From 9d697bc3989748f125859ebe0dc22475124608a9 Mon Sep 17 00:00:00 2001 From: Andrea Amorese Date: Tue, 24 Aug 2021 17:26:11 +0200 Subject: [PATCH] Built motion from commit 85951d68.|2.5.33 --- apidoc/api_project.js | 2 +- apidoc/api_project.json | 2 +- server/api/action/action.attributes.js | 2 +- server/api/action/action.controller.js | 2 +- server/api/action/action.model.js | 2 +- server/api/action/action.rpc.js | 2 +- server/api/action/index.js | 2 +- .../analyticCustomReport.attributes.js | 2 +- .../analyticCustomReport.controller.js | 2 +- .../analyticCustomReport.model.js | 2 +- .../analyticCustomReport.rpc.js | 2 +- server/api/analyticCustomReport/index.js | 2 +- .../analyticDefaultReport.attributes.js | 2 +- .../analyticDefaultReport.controller.js | 2 +- .../analyticDefaultReport.model.js | 2 +- .../analyticDefaultReport.rpc.js | 2 +- server/api/analyticDefaultReport/index.js | 2 +- .../analyticExtractedReport.attributes.js | 2 +- .../analyticExtractedReport.controller.js | 2 +- .../analyticExtractedReport.model.js | 2 +- .../analyticExtractedReport.rpc.js | 2 +- server/api/analyticExtractedReport/index.js | 2 +- .../analyticFieldReport.attributes.js | 2 +- .../analyticFieldReport.controller.js | 2 +- .../analyticFieldReport.model.js | 2 +- .../analyticFieldReport/analyticFieldReport.rpc.js | 2 +- server/api/analyticFieldReport/index.js | 2 +- .../analyticMetric/analyticMetric.attributes.js | 2 +- .../analyticMetric/analyticMetric.controller.js | 2 +- server/api/analyticMetric/analyticMetric.model.js | 2 +- server/api/analyticMetric/analyticMetric.rpc.js | 2 +- server/api/analyticMetric/index.js | 2 +- .../analyticTreeReport.attributes.js | 2 +- .../analyticTreeReport.controller.js | 2 +- .../analyticTreeReport/analyticTreeReport.model.js | 2 +- .../analyticTreeReport/analyticTreeReport.rpc.js | 2 +- server/api/analyticTreeReport/index.js | 2 +- server/api/attachment/attachment.attributes.js | 2 +- server/api/attachment/attachment.controller.js | 2 +- server/api/attachment/attachment.model.js | 2 +- server/api/attachment/attachment.rpc.js | 2 +- server/api/attachment/index.js | 2 +- server/api/authGoogle/authGoogle.controller.js | 2 +- server/api/authGoogle/index.js | 2 +- server/api/authLocal/authLocal.controller.js | 2 +- server/api/authLocal/index.js | 2 +- server/api/automation/automation.attributes.js | 2 +- server/api/automation/automation.controller.js | 2 +- server/api/automation/automation.model.js | 2 +- server/api/automation/automation.rpc.js | 2 +- server/api/automation/index.js | 2 +- server/api/campaign/campaign.attributes.js | 2 +- server/api/campaign/campaign.controller.js | 2 +- server/api/campaign/campaign.model.js | 2 +- server/api/campaign/campaign.rpc.js | 2 +- server/api/campaign/index.js | 2 +- server/api/cannedAnswer/cannedAnswer.attributes.js | 2 +- server/api/cannedAnswer/cannedAnswer.controller.js | 2 +- server/api/cannedAnswer/cannedAnswer.model.js | 2 +- server/api/cannedAnswer/cannedAnswer.rpc.js | 2 +- server/api/cannedAnswer/index.js | 2 +- server/api/cdr/cdr.attributes.js | 2 +- server/api/cdr/cdr.controller.js | 2 +- server/api/cdr/cdr.model.js | 2 +- server/api/cdr/cdr.rpc.js | 2 +- server/api/cdr/index.js | 2 +- .../chatApplication/chatApplication.attributes.js | 2 +- .../chatApplication/chatApplication.controller.js | 2 +- .../api/chatApplication/chatApplication.model.js | 2 +- server/api/chatApplication/chatApplication.rpc.js | 2 +- server/api/chatApplication/index.js | 2 +- server/api/chatGroup/chatGroup.attributes.js | 2 +- server/api/chatGroup/chatGroup.controller.js | 2 +- server/api/chatGroup/chatGroup.events.js | 2 +- server/api/chatGroup/chatGroup.model.js | 2 +- server/api/chatGroup/chatGroup.rpc.js | 2 +- server/api/chatGroup/chatGroup.socket.js | 2 +- server/api/chatGroup/index.js | 2 +- .../chatInteraction/chatInteraction.attributes.js | 2 +- .../chatInteraction/chatInteraction.controller.js | 2 +- .../api/chatInteraction/chatInteraction.events.js | 2 +- .../api/chatInteraction/chatInteraction.model.js | 2 +- server/api/chatInteraction/chatInteraction.rpc.js | 2 +- .../api/chatInteraction/chatInteraction.socket.js | 2 +- server/api/chatInteraction/index.js | 2 +- .../chatInternalMessage.attributes.js | 2 +- .../chatInternalMessage.controller.js | 2 +- .../chatInternalMessage.events.js | 2 +- .../chatInternalMessage.model.js | 2 +- .../chatInternalMessage/chatInternalMessage.rpc.js | 2 +- .../chatInternalMessage.socket.js | 2 +- server/api/chatInternalMessage/index.js | 2 +- server/api/chatMessage/chatMessage.attributes.js | 2 +- server/api/chatMessage/chatMessage.controller.js | 2 +- server/api/chatMessage/chatMessage.events.js | 2 +- server/api/chatMessage/chatMessage.model.js | 2 +- server/api/chatMessage/chatMessage.rpc.js | 2 +- server/api/chatMessage/chatMessage.socket.js | 2 +- server/api/chatMessage/index.js | 2 +- .../chatOfflineMessage.attributes.js | 2 +- .../chatOfflineMessage.controller.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.model.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.rpc.js | 2 +- server/api/chatOfflineMessage/index.js | 2 +- .../chatProactiveAction.attributes.js | 2 +- .../chatProactiveAction.controller.js | 2 +- .../chatProactiveAction.model.js | 2 +- .../chatProactiveAction/chatProactiveAction.rpc.js | 2 +- server/api/chatProactiveAction/index.js | 2 +- server/api/chatQueue/chatQueue.attributes.js | 2 +- server/api/chatQueue/chatQueue.controller.js | 2 +- server/api/chatQueue/chatQueue.events.js | 2 +- server/api/chatQueue/chatQueue.model.js | 2 +- server/api/chatQueue/chatQueue.rpc.js | 2 +- server/api/chatQueue/chatQueue.socket.js | 2 +- server/api/chatQueue/index.js | 2 +- .../chatQueueReport/chatQueueReport.attributes.js | 2 +- .../chatQueueReport/chatQueueReport.controller.js | 2 +- .../api/chatQueueReport/chatQueueReport.model.js | 2 +- server/api/chatQueueReport/chatQueueReport.rpc.js | 2 +- server/api/chatQueueReport/index.js | 2 +- .../chatTransferReport.attributes.js | 2 +- .../chatTransferReport.controller.js | 2 +- .../chatTransferReport/chatTransferReport.model.js | 2 +- .../chatTransferReport/chatTransferReport.rpc.js | 2 +- server/api/chatTransferReport/index.js | 2 +- server/api/chatWebsite/chatWebsite.attributes.js | 2 +- server/api/chatWebsite/chatWebsite.controller.js | 2 +- server/api/chatWebsite/chatWebsite.events.js | 2 +- server/api/chatWebsite/chatWebsite.model.js | 2 +- server/api/chatWebsite/chatWebsite.rpc.js | 2 +- server/api/chatWebsite/chatWebsite.socket.js | 2 +- server/api/chatWebsite/index.js | 2 +- .../api/cloudProvider/cloudProvider.attributes.js | 2 +- .../api/cloudProvider/cloudProvider.controller.js | 2 +- server/api/cloudProvider/cloudProvider.model.js | 2 +- server/api/cloudProvider/cloudProvider.rpc.js | 2 +- server/api/cloudProvider/index.js | 2 +- server/api/cmCompany/cmCompany.attributes.js | 2 +- server/api/cmCompany/cmCompany.controller.js | 2 +- server/api/cmCompany/cmCompany.model.js | 2 +- server/api/cmCompany/cmCompany.rpc.js | 2 +- server/api/cmCompany/index.js | 2 +- server/api/cmContact/cmContact.attributes.js | 2 +- server/api/cmContact/cmContact.controller.js | 2 +- server/api/cmContact/cmContact.events.js | 2 +- server/api/cmContact/cmContact.model.js | 2 +- server/api/cmContact/cmContact.rpc.js | 2 +- server/api/cmContact/cmContact.socket.js | 2 +- server/api/cmContact/index.js | 2 +- .../cmContactHasItem.attributes.js | 2 +- .../cmContactHasItem.controller.js | 2 +- .../api/cmContactHasItem/cmContactHasItem.model.js | 2 +- .../api/cmContactHasItem/cmContactHasItem.rpc.js | 2 +- server/api/cmContactHasItem/index.js | 2 +- .../api/cmCustomField/cmCustomField.attributes.js | 2 +- .../api/cmCustomField/cmCustomField.controller.js | 2 +- server/api/cmCustomField/cmCustomField.model.js | 2 +- server/api/cmCustomField/cmCustomField.rpc.js | 2 +- server/api/cmCustomField/index.js | 2 +- server/api/cmHopper/cmHopper.attributes.js | 2 +- server/api/cmHopper/cmHopper.controller.js | 2 +- server/api/cmHopper/cmHopper.model.js | 2 +- server/api/cmHopper/cmHopper.rpc.js | 2 +- server/api/cmHopper/index.js | 2 +- .../cmHopperAdditionalPhone.attributes.js | 2 +- .../cmHopperAdditionalPhone.controller.js | 2 +- .../cmHopperAdditionalPhone.model.js | 2 +- .../cmHopperAdditionalPhone.rpc.js | 2 +- server/api/cmHopperAdditionalPhone/index.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.attributes.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.controller.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.model.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.rpc.js | 2 +- server/api/cmHopperBlack/index.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.attributes.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.controller.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.model.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.rpc.js | 2 +- server/api/cmHopperFinal/index.js | 2 +- .../cmHopperHistory/cmHopperHistory.attributes.js | 2 +- .../cmHopperHistory/cmHopperHistory.controller.js | 2 +- .../api/cmHopperHistory/cmHopperHistory.model.js | 2 +- server/api/cmHopperHistory/cmHopperHistory.rpc.js | 2 +- server/api/cmHopperHistory/index.js | 2 +- server/api/cmList/cmList.attributes.js | 2 +- server/api/cmList/cmList.controller.js | 2 +- server/api/cmList/cmList.events.js | 2 +- server/api/cmList/cmList.model.js | 2 +- server/api/cmList/cmList.rpc.js | 2 +- server/api/cmList/cmList.socket.js | 2 +- server/api/cmList/index.js | 2 +- server/api/condition/condition.attributes.js | 2 +- server/api/condition/condition.controller.js | 2 +- server/api/condition/condition.model.js | 2 +- server/api/condition/condition.rpc.js | 2 +- server/api/condition/index.js | 2 +- .../contactItemType/contactItemType.attributes.js | 2 +- .../contactItemType/contactItemType.controller.js | 2 +- .../api/contactItemType/contactItemType.model.js | 2 +- server/api/contactItemType/contactItemType.rpc.js | 2 +- server/api/contactItemType/index.js | 2 +- server/api/dashboard/dashboard.attributes.js | 2 +- server/api/dashboard/dashboard.controller.js | 2 +- server/api/dashboard/dashboard.events.js | 2 +- server/api/dashboard/dashboard.model.js | 2 +- server/api/dashboard/dashboard.rpc.js | 2 +- server/api/dashboard/dashboard.socket.js | 2 +- server/api/dashboard/index.js | 2 +- .../api/dashboardItem/dashboardItem.attributes.js | 2 +- .../api/dashboardItem/dashboardItem.controller.js | 2 +- server/api/dashboardItem/dashboardItem.events.js | 2 +- server/api/dashboardItem/dashboardItem.model.js | 2 +- server/api/dashboardItem/dashboardItem.rpc.js | 2 +- server/api/dashboardItem/dashboardItem.socket.js | 2 +- server/api/dashboardItem/index.js | 2 +- server/api/disposition/disposition.attributes.js | 2 +- server/api/disposition/disposition.controller.js | 2 +- server/api/disposition/disposition.model.js | 2 +- server/api/disposition/disposition.rpc.js | 2 +- server/api/disposition/index.js | 2 +- server/api/faxAccount/faxAccount.attributes.js | 2 +- server/api/faxAccount/faxAccount.controller.js | 2 +- server/api/faxAccount/faxAccount.events.js | 2 +- server/api/faxAccount/faxAccount.model.js | 2 +- server/api/faxAccount/faxAccount.rpc.js | 2 +- server/api/faxAccount/faxAccount.socket.js | 2 +- server/api/faxAccount/index.js | 2 +- .../faxApplication/faxApplication.attributes.js | 2 +- .../faxApplication/faxApplication.controller.js | 2 +- server/api/faxApplication/faxApplication.model.js | 2 +- server/api/faxApplication/faxApplication.rpc.js | 2 +- server/api/faxApplication/index.js | 2 +- .../faxInteraction/faxInteraction.attributes.js | 2 +- .../faxInteraction/faxInteraction.controller.js | 2 +- server/api/faxInteraction/faxInteraction.events.js | 2 +- server/api/faxInteraction/faxInteraction.model.js | 2 +- server/api/faxInteraction/faxInteraction.rpc.js | 2 +- server/api/faxInteraction/faxInteraction.socket.js | 2 +- server/api/faxInteraction/index.js | 2 +- server/api/faxMessage/faxMessage.attributes.js | 2 +- server/api/faxMessage/faxMessage.controller.js | 2 +- server/api/faxMessage/faxMessage.events.js | 2 +- server/api/faxMessage/faxMessage.model.js | 2 +- server/api/faxMessage/faxMessage.rpc.js | 2 +- server/api/faxMessage/faxMessage.socket.js | 2 +- server/api/faxMessage/index.js | 2 +- server/api/faxQueue/faxQueue.attributes.js | 2 +- server/api/faxQueue/faxQueue.controller.js | 2 +- server/api/faxQueue/faxQueue.events.js | 2 +- server/api/faxQueue/faxQueue.model.js | 2 +- server/api/faxQueue/faxQueue.rpc.js | 2 +- server/api/faxQueue/faxQueue.socket.js | 2 +- server/api/faxQueue/index.js | 2 +- .../faxQueueReport/faxQueueReport.attributes.js | 2 +- .../faxQueueReport/faxQueueReport.controller.js | 2 +- server/api/faxQueueReport/faxQueueReport.model.js | 2 +- server/api/faxQueueReport/faxQueueReport.rpc.js | 2 +- server/api/faxQueueReport/index.js | 2 +- .../faxTransferReport.attributes.js | 2 +- .../faxTransferReport.controller.js | 2 +- .../faxTransferReport/faxTransferReport.model.js | 2 +- .../api/faxTransferReport/faxTransferReport.rpc.js | 2 +- server/api/faxTransferReport/index.js | 2 +- server/api/intDeskAccount/index.js | 2 +- .../intDeskAccount/intDeskAccount.attributes.js | 2 +- .../intDeskAccount/intDeskAccount.controller.js | 2 +- server/api/intDeskAccount/intDeskAccount.model.js | 2 +- server/api/intDeskAccount/intDeskAccount.rpc.js | 2 +- server/api/intDeskConfiguration/index.js | 2 +- .../intDeskConfiguration.attributes.js | 2 +- .../intDeskConfiguration.controller.js | 2 +- .../intDeskConfiguration.model.js | 2 +- .../intDeskConfiguration.rpc.js | 2 +- server/api/intDeskField/index.js | 2 +- server/api/intDeskField/intDeskField.attributes.js | 2 +- server/api/intDeskField/intDeskField.controller.js | 2 +- server/api/intDeskField/intDeskField.model.js | 2 +- server/api/intDeskField/intDeskField.rpc.js | 2 +- server/api/intDynamics365Account/index.js | 2 +- .../intDynamics365Account.attributes.js | 2 +- .../intDynamics365Account.controller.js | 2 +- .../intDynamics365Account.model.js | 2 +- .../intDynamics365Account.rpc.js | 2 +- server/api/intDynamics365Configuration/index.js | 2 +- .../intDynamics365Configuration.attributes.js | 2 +- .../intDynamics365Configuration.controller.js | 2 +- .../intDynamics365Configuration.model.js | 2 +- .../intDynamics365Configuration.rpc.js | 2 +- server/api/intDynamics365Field/index.js | 2 +- .../intDynamics365Field.attributes.js | 2 +- .../intDynamics365Field.controller.js | 2 +- .../intDynamics365Field.model.js | 2 +- .../intDynamics365Field/intDynamics365Field.rpc.js | 2 +- server/api/intFreshdeskAccount/index.js | 2 +- .../intFreshdeskAccount.attributes.js | 2 +- .../intFreshdeskAccount.controller.js | 2 +- .../intFreshdeskAccount.model.js | 2 +- .../intFreshdeskAccount/intFreshdeskAccount.rpc.js | 2 +- server/api/intFreshdeskConfiguration/index.js | 2 +- .../intFreshdeskConfiguration.attributes.js | 2 +- .../intFreshdeskConfiguration.controller.js | 2 +- .../intFreshdeskConfiguration.model.js | 2 +- .../intFreshdeskConfiguration.rpc.js | 2 +- server/api/intFreshdeskField/index.js | 2 +- .../intFreshdeskField.attributes.js | 2 +- .../intFreshdeskField.controller.js | 2 +- .../intFreshdeskField/intFreshdeskField.model.js | 2 +- .../api/intFreshdeskField/intFreshdeskField.rpc.js | 2 +- server/api/intFreshsalesAccount/index.js | 2 +- .../intFreshsalesAccount.attributes.js | 2 +- .../intFreshsalesAccount.controller.js | 2 +- .../intFreshsalesAccount.model.js | 2 +- .../intFreshsalesAccount.rpc.js | 2 +- server/api/intFreshsalesConfiguration/index.js | 2 +- .../intFreshsalesConfiguration.attributes.js | 2 +- .../intFreshsalesConfiguration.controller.js | 2 +- .../intFreshsalesConfiguration.model.js | 2 +- .../intFreshsalesConfiguration.rpc.js | 2 +- server/api/intFreshsalesField/index.js | 2 +- .../intFreshsalesField.attributes.js | 2 +- .../intFreshsalesField.controller.js | 2 +- .../intFreshsalesField/intFreshsalesField.model.js | 2 +- .../intFreshsalesField/intFreshsalesField.rpc.js | 2 +- server/api/intSalesforceAccount/index.js | 2 +- .../intSalesforceAccount.attributes.js | 2 +- .../intSalesforceAccount.controller.js | 2 +- .../intSalesforceAccount.model.js | 2 +- .../intSalesforceAccount.rpc.js | 2 +- server/api/intSalesforceConfiguration/index.js | 2 +- .../intSalesforceConfiguration.attributes.js | 2 +- .../intSalesforceConfiguration.controller.js | 2 +- .../intSalesforceConfiguration.model.js | 2 +- .../intSalesforceConfiguration.rpc.js | 2 +- server/api/intSalesforceField/index.js | 2 +- .../intSalesforceField.attributes.js | 2 +- .../intSalesforceField.controller.js | 2 +- .../intSalesforceField/intSalesforceField.model.js | 2 +- .../intSalesforceField/intSalesforceField.rpc.js | 2 +- server/api/intServicenowAccount/index.js | 2 +- .../intServicenowAccount.attributes.js | 2 +- .../intServicenowAccount.controller.js | 2 +- .../intServicenowAccount.model.js | 2 +- .../intServicenowAccount.rpc.js | 2 +- server/api/intServicenowConfiguration/index.js | 2 +- .../intServicenowConfiguration.attributes.js | 2 +- .../intServicenowConfiguration.controller.js | 2 +- .../intServicenowConfiguration.model.js | 2 +- .../intServicenowConfiguration.rpc.js | 2 +- server/api/intServicenowField/index.js | 2 +- .../intServicenowField.attributes.js | 2 +- .../intServicenowField.controller.js | 2 +- .../intServicenowField/intServicenowField.model.js | 2 +- .../intServicenowField/intServicenowField.rpc.js | 2 +- server/api/intSugarcrmAccount/index.js | 2 +- .../intSugarcrmAccount.attributes.js | 2 +- .../intSugarcrmAccount.controller.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.model.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.rpc.js | 2 +- server/api/intSugarcrmConfiguration/index.js | 2 +- .../intSugarcrmConfiguration.attributes.js | 2 +- .../intSugarcrmConfiguration.controller.js | 2 +- .../intSugarcrmConfiguration.model.js | 2 +- .../intSugarcrmConfiguration.rpc.js | 2 +- server/api/intSugarcrmField/index.js | 2 +- .../intSugarcrmField.attributes.js | 2 +- .../intSugarcrmField.controller.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.model.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.rpc.js | 2 +- server/api/intVtigerAccount/index.js | 2 +- .../intVtigerAccount.attributes.js | 2 +- .../intVtigerAccount.controller.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.model.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.rpc.js | 2 +- server/api/intVtigerConfiguration/index.js | 2 +- .../intVtigerConfiguration.attributes.js | 2 +- .../intVtigerConfiguration.controller.js | 2 +- .../intVtigerConfiguration.model.js | 2 +- .../intVtigerConfiguration.rpc.js | 2 +- server/api/intVtigerField/index.js | 2 +- .../intVtigerField/intVtigerField.attributes.js | 2 +- .../intVtigerField/intVtigerField.controller.js | 2 +- server/api/intVtigerField/intVtigerField.model.js | 2 +- server/api/intVtigerField/intVtigerField.rpc.js | 2 +- server/api/intZendeskAccount/index.js | 2 +- .../intZendeskAccount.attributes.js | 2 +- .../intZendeskAccount.controller.js | 2 +- .../intZendeskAccount/intZendeskAccount.model.js | 2 +- .../api/intZendeskAccount/intZendeskAccount.rpc.js | 2 +- server/api/intZendeskConfiguration/index.js | 2 +- .../intZendeskConfiguration.attributes.js | 2 +- .../intZendeskConfiguration.controller.js | 2 +- .../intZendeskConfiguration.model.js | 2 +- .../intZendeskConfiguration.rpc.js | 2 +- server/api/intZendeskField/index.js | 2 +- .../intZendeskField/intZendeskField.attributes.js | 2 +- .../intZendeskField/intZendeskField.controller.js | 2 +- .../api/intZendeskField/intZendeskField.model.js | 2 +- server/api/intZendeskField/intZendeskField.rpc.js | 2 +- server/api/intZohoAccount/index.js | 2 +- .../intZohoAccount/intZohoAccount.attributes.js | 2 +- .../intZohoAccount/intZohoAccount.controller.js | 2 +- server/api/intZohoAccount/intZohoAccount.model.js | 2 +- server/api/intZohoAccount/intZohoAccount.rpc.js | 2 +- server/api/intZohoConfiguration/index.js | 2 +- .../intZohoConfiguration.attributes.js | 2 +- .../intZohoConfiguration.controller.js | 2 +- .../intZohoConfiguration.model.js | 2 +- .../intZohoConfiguration.rpc.js | 2 +- server/api/intZohoField/index.js | 2 +- server/api/intZohoField/intZohoField.attributes.js | 2 +- server/api/intZohoField/intZohoField.controller.js | 2 +- server/api/intZohoField/intZohoField.model.js | 2 +- server/api/intZohoField/intZohoField.rpc.js | 2 +- server/api/integration/index.js | 2 +- server/api/integration/integration.attributes.js | 2 +- server/api/integration/integration.controller.js | 2 +- server/api/integration/integration.model.js | 2 +- server/api/integration/integration.rpc.js | 2 +- server/api/integrationReport/index.js | 2 +- .../integrationReport.attributes.js | 2 +- .../integrationReport.controller.js | 2 +- .../integrationReport/integrationReport.model.js | 2 +- .../api/integrationReport/integrationReport.rpc.js | 2 +- server/api/interval/index.js | 2 +- server/api/interval/interval.attributes.js | 2 +- server/api/interval/interval.controller.js | 2 +- server/api/interval/interval.model.js | 2 +- server/api/interval/interval.rpc.js | 2 +- server/api/jira/index.js | 2 +- server/api/jira/jira.controller.js | 2 +- server/api/jscriptyAnswerReport/index.js | 2 +- .../jscriptyAnswerReport.attributes.js | 2 +- .../jscriptyAnswerReport.controller.js | 2 +- .../jscriptyAnswerReport.model.js | 2 +- .../jscriptyAnswerReport.rpc.js | 2 +- server/api/jscriptyProject/index.js | 2 +- .../jscriptyProject/jscriptyProject.attributes.js | 2 +- .../jscriptyProject/jscriptyProject.controller.js | 2 +- .../api/jscriptyProject/jscriptyProject.model.js | 2 +- server/api/jscriptyProject/jscriptyProject.rpc.js | 2 +- server/api/jscriptyQuestionReport/index.js | 2 +- .../jscriptyQuestionReport.attributes.js | 2 +- .../jscriptyQuestionReport.controller.js | 2 +- .../jscriptyQuestionReport.model.js | 2 +- .../jscriptyQuestionReport.rpc.js | 2 +- server/api/jscriptySessionReport/index.js | 2 +- .../jscriptySessionReport.attributes.js | 2 +- .../jscriptySessionReport.controller.js | 2 +- .../jscriptySessionReport.model.js | 2 +- .../jscriptySessionReport.rpc.js | 2 +- server/api/license/index.js | 2 +- server/api/license/license.attributes.js | 2 +- server/api/license/license.controller.js | 2 +- server/api/license/license.model.js | 2 +- server/api/license/license.rpc.js | 2 +- server/api/mailAccount/index.js | 2 +- server/api/mailAccount/mailAccount.attributes.js | 2 +- server/api/mailAccount/mailAccount.controller.js | 2 +- server/api/mailAccount/mailAccount.events.js | 2 +- server/api/mailAccount/mailAccount.model.js | 2 +- server/api/mailAccount/mailAccount.rpc.js | 2 +- server/api/mailAccount/mailAccount.socket.js | 2 +- server/api/mailApplication/index.js | 2 +- .../mailApplication/mailApplication.attributes.js | 2 +- .../mailApplication/mailApplication.controller.js | 2 +- .../api/mailApplication/mailApplication.model.js | 2 +- server/api/mailApplication/mailApplication.rpc.js | 2 +- server/api/mailInteraction/index.js | 2 +- .../mailInteraction/mailInteraction.attributes.js | 2 +- .../mailInteraction/mailInteraction.controller.js | 2 +- .../api/mailInteraction/mailInteraction.events.js | 2 +- .../api/mailInteraction/mailInteraction.model.js | 2 +- server/api/mailInteraction/mailInteraction.rpc.js | 2 +- .../api/mailInteraction/mailInteraction.socket.js | 2 +- server/api/mailMessage/index.js | 2 +- server/api/mailMessage/mailMessage.attributes.js | 2 +- server/api/mailMessage/mailMessage.controller.js | 2 +- server/api/mailMessage/mailMessage.events.js | 2 +- server/api/mailMessage/mailMessage.model.js | 2 +- server/api/mailMessage/mailMessage.rpc.js | 2 +- server/api/mailMessage/mailMessage.socket.js | 2 +- server/api/mailQueue/index.js | 2 +- server/api/mailQueue/mailQueue.attributes.js | 2 +- server/api/mailQueue/mailQueue.controller.js | 2 +- server/api/mailQueue/mailQueue.events.js | 2 +- server/api/mailQueue/mailQueue.model.js | 2 +- server/api/mailQueue/mailQueue.rpc.js | 2 +- server/api/mailQueue/mailQueue.socket.js | 2 +- server/api/mailQueueReport/index.js | 2 +- .../mailQueueReport/mailQueueReport.attributes.js | 2 +- .../mailQueueReport/mailQueueReport.controller.js | 2 +- .../api/mailQueueReport/mailQueueReport.model.js | 2 +- server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +- server/api/mailServerIn/index.js | 2 +- server/api/mailServerIn/mailServerIn.attributes.js | 2 +- server/api/mailServerIn/mailServerIn.model.js | 2 +- server/api/mailServerIn/mailServerIn.rpc.js | 2 +- server/api/mailServerOut/index.js | 2 +- .../api/mailServerOut/mailServerOut.attributes.js | 2 +- .../api/mailServerOut/mailServerOut.controller.js | 2 +- server/api/mailServerOut/mailServerOut.model.js | 2 +- server/api/mailServerOut/mailServerOut.rpc.js | 2 +- server/api/mailSubstatus/index.js | 2 +- .../api/mailSubstatus/mailSubstatus.attributes.js | 2 +- .../api/mailSubstatus/mailSubstatus.controller.js | 2 +- server/api/mailSubstatus/mailSubstatus.model.js | 2 +- server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +- server/api/mailTransferReport/index.js | 2 +- .../mailTransferReport.attributes.js | 2 +- .../mailTransferReport.controller.js | 2 +- .../mailTransferReport/mailTransferReport.model.js | 2 +- .../mailTransferReport/mailTransferReport.rpc.js | 2 +- server/api/memberReport/index.js | 2 +- server/api/memberReport/memberReport.attributes.js | 2 +- server/api/memberReport/memberReport.controller.js | 2 +- server/api/memberReport/memberReport.model.js | 2 +- server/api/memberReport/memberReport.rpc.js | 2 +- server/api/migration/index.js | 2 +- server/api/migration/migration.attributes.js | 2 +- server/api/migration/migration.controller.js | 2 +- server/api/migration/migration.model.js | 2 +- server/api/migration/migration.rpc.js | 2 +- server/api/network/index.js | 2 +- server/api/network/network.attributes.js | 2 +- server/api/network/network.controller.js | 2 +- server/api/network/network.model.js | 2 +- server/api/network/network.rpc.js | 2 +- server/api/openchannelAccount/index.js | 2 +- .../openchannelAccount.attributes.js | 2 +- .../openchannelAccount.controller.js | 2 +- .../openchannelAccount.events.js | 2 +- .../openchannelAccount/openchannelAccount.model.js | 2 +- .../openchannelAccount/openchannelAccount.rpc.js | 2 +- .../openchannelAccount.socket.js | 2 +- server/api/openchannelApplication/index.js | 2 +- .../openchannelApplication.attributes.js | 2 +- .../openchannelApplication.controller.js | 2 +- .../openchannelApplication.model.js | 2 +- .../openchannelApplication.rpc.js | 2 +- server/api/openchannelInteraction/index.js | 2 +- .../openchannelInteraction.attributes.js | 2 +- .../openchannelInteraction.controller.js | 2 +- .../openchannelInteraction.events.js | 2 +- .../openchannelInteraction.model.js | 2 +- .../openchannelInteraction.rpc.js | 2 +- .../openchannelInteraction.socket.js | 2 +- server/api/openchannelMessage/index.js | 2 +- .../openchannelMessage.attributes.js | 2 +- .../openchannelMessage.controller.js | 2 +- .../openchannelMessage.events.js | 2 +- .../openchannelMessage/openchannelMessage.model.js | 2 +- .../openchannelMessage/openchannelMessage.rpc.js | 2 +- .../openchannelMessage.socket.js | 2 +- server/api/openchannelQueue/index.js | 2 +- .../openchannelQueue.attributes.js | 2 +- .../openchannelQueue.controller.js | 2 +- .../openchannelQueue/openchannelQueue.events.js | 2 +- .../api/openchannelQueue/openchannelQueue.model.js | 2 +- .../api/openchannelQueue/openchannelQueue.rpc.js | 2 +- .../openchannelQueue/openchannelQueue.socket.js | 2 +- server/api/openchannelQueueReport/index.js | 2 +- .../openchannelQueueReport.attributes.js | 2 +- .../openchannelQueueReport.controller.js | 2 +- .../openchannelQueueReport.model.js | 2 +- .../openchannelQueueReport.rpc.js | 2 +- server/api/openchannelTransferReport/index.js | 2 +- .../openchannelTransferReport.attributes.js | 2 +- .../openchannelTransferReport.controller.js | 2 +- .../openchannelTransferReport.model.js | 2 +- .../openchannelTransferReport.rpc.js | 2 +- server/api/pause/index.js | 2 +- server/api/pause/pause.attributes.js | 2 +- server/api/pause/pause.controller.js | 2 +- server/api/pause/pause.model.js | 2 +- server/api/pause/pause.rpc.js | 2 +- server/api/plugin/index.js | 2 +- server/api/plugin/plugin.attributes.js | 2 +- server/api/plugin/plugin.controller.js | 2 +- server/api/plugin/plugin.events.js | 2 +- server/api/plugin/plugin.model.js | 2 +- server/api/plugin/plugin.rpc.js | 2 +- server/api/plugin/plugin.socket.js | 2 +- server/api/pm2/index.js | 2 +- server/api/pm2/pm2.controller.js | 2 +- server/api/realtime/index.js | 2 +- server/api/realtime/realtime.controller.js | 2 +- server/api/realtime/realtime.model.js | 2 +- server/api/reportAgentPreview/index.js | 2 +- .../reportAgentPreview.attributes.js | 2 +- .../reportAgentPreview/reportAgentPreview.model.js | 2 +- .../reportAgentPreview/reportAgentPreview.rpc.js | 2 +- server/api/rpc/index.js | 2 +- server/api/rpc/rpc.controller.js | 2 +- server/api/schedule/index.js | 2 +- server/api/schedule/schedule.attributes.js | 2 +- server/api/schedule/schedule.controller.js | 2 +- server/api/schedule/schedule.model.js | 2 +- server/api/schedule/schedule.rpc.js | 2 +- server/api/screenRecording/index.js | 2 +- .../screenRecording/screenRecording.attributes.js | 2 +- .../screenRecording/screenRecording.controller.js | 2 +- .../api/screenRecording/screenRecording.model.js | 2 +- server/api/screenRecording/screenRecording.rpc.js | 2 +- server/api/setting/index.js | 2 +- server/api/setting/setting.attributes.js | 2 +- server/api/setting/setting.controller.js | 2 +- server/api/setting/setting.model.js | 2 +- server/api/setting/setting.rpc.js | 2 +- server/api/smsAccount/index.js | 2 +- server/api/smsAccount/smsAccount.attributes.js | 2 +- server/api/smsAccount/smsAccount.controller.js | 2 +- server/api/smsAccount/smsAccount.events.js | 2 +- server/api/smsAccount/smsAccount.model.js | 2 +- server/api/smsAccount/smsAccount.rpc.js | 2 +- server/api/smsAccount/smsAccount.socket.js | 2 +- server/api/smsApplication/index.js | 2 +- .../smsApplication/smsApplication.attributes.js | 2 +- .../smsApplication/smsApplication.controller.js | 2 +- server/api/smsApplication/smsApplication.model.js | 2 +- server/api/smsApplication/smsApplication.rpc.js | 2 +- server/api/smsInteraction/index.js | 2 +- .../smsInteraction/smsInteraction.attributes.js | 2 +- .../smsInteraction/smsInteraction.controller.js | 2 +- server/api/smsInteraction/smsInteraction.events.js | 2 +- server/api/smsInteraction/smsInteraction.model.js | 2 +- server/api/smsInteraction/smsInteraction.rpc.js | 2 +- server/api/smsInteraction/smsInteraction.socket.js | 2 +- server/api/smsMessage/index.js | 2 +- server/api/smsMessage/smsMessage.attributes.js | 2 +- server/api/smsMessage/smsMessage.controller.js | 2 +- server/api/smsMessage/smsMessage.events.js | 2 +- server/api/smsMessage/smsMessage.model.js | 2 +- server/api/smsMessage/smsMessage.rpc.js | 2 +- server/api/smsMessage/smsMessage.socket.js | 2 +- server/api/smsQueue/index.js | 2 +- server/api/smsQueue/smsQueue.attributes.js | 2 +- server/api/smsQueue/smsQueue.controller.js | 2 +- server/api/smsQueue/smsQueue.events.js | 2 +- server/api/smsQueue/smsQueue.model.js | 2 +- server/api/smsQueue/smsQueue.rpc.js | 2 +- server/api/smsQueue/smsQueue.socket.js | 2 +- server/api/smsQueueReport/index.js | 2 +- .../smsQueueReport/smsQueueReport.attributes.js | 2 +- .../smsQueueReport/smsQueueReport.controller.js | 2 +- server/api/smsQueueReport/smsQueueReport.model.js | 2 +- server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +- server/api/smsTransferReport/index.js | 2 +- .../smsTransferReport.attributes.js | 2 +- .../smsTransferReport.controller.js | 2 +- .../smsTransferReport/smsTransferReport.model.js | 2 +- .../api/smsTransferReport/smsTransferReport.rpc.js | 2 +- server/api/sound/index.js | 2 +- server/api/sound/sound.attributes.js | 2 +- server/api/sound/sound.controller.js | 2 +- server/api/sound/sound.model.js | 2 +- server/api/sound/sound.rpc.js | 2 +- server/api/squareMessage/index.js | 2 +- .../api/squareMessage/squareMessage.attributes.js | 2 +- .../api/squareMessage/squareMessage.controller.js | 2 +- server/api/squareMessage/squareMessage.model.js | 2 +- server/api/squareMessage/squareMessage.rpc.js | 2 +- server/api/squareOdbc/index.js | 2 +- server/api/squareOdbc/squareOdbc.attributes.js | 2 +- server/api/squareOdbc/squareOdbc.controller.js | 2 +- server/api/squareOdbc/squareOdbc.model.js | 2 +- server/api/squareOdbc/squareOdbc.rpc.js | 2 +- server/api/squareProject/index.js | 2 +- .../api/squareProject/squareProject.attributes.js | 2 +- .../api/squareProject/squareProject.controller.js | 2 +- server/api/squareProject/squareProject.events.js | 2 +- server/api/squareProject/squareProject.model.js | 2 +- server/api/squareProject/squareProject.rpc.js | 2 +- server/api/squareProject/squareProject.socket.js | 2 +- server/api/squareRecording/index.js | 2 +- .../squareRecording/squareRecording.attributes.js | 2 +- .../squareRecording/squareRecording.controller.js | 2 +- .../api/squareRecording/squareRecording.model.js | 2 +- server/api/squareRecording/squareRecording.rpc.js | 2 +- server/api/squareReport/index.js | 2 +- server/api/squareReport/squareReport.attributes.js | 2 +- server/api/squareReport/squareReport.controller.js | 2 +- server/api/squareReport/squareReport.model.js | 2 +- server/api/squareReport/squareReport.rpc.js | 2 +- server/api/squareReportDetail/index.js | 2 +- .../squareReportDetail.attributes.js | 2 +- .../squareReportDetail.controller.js | 2 +- .../squareReportDetail/squareReportDetail.model.js | 2 +- .../squareReportDetail/squareReportDetail.rpc.js | 2 +- server/api/system/index.js | 2 +- server/api/system/system.controller.js | 2 +- server/api/tag/index.js | 2 +- server/api/tag/tag.attributes.js | 2 +- server/api/tag/tag.controller.js | 2 +- server/api/tag/tag.model.js | 2 +- server/api/tag/tag.rpc.js | 2 +- server/api/team/index.js | 2 +- server/api/team/team.attributes.js | 2 +- server/api/team/team.controller.js | 2 +- server/api/team/team.events.js | 2 +- server/api/team/team.model.js | 2 +- server/api/team/team.rpc.js | 2 +- server/api/team/team.socket.js | 2 +- server/api/teamVoiceQueue/index.js | 2 +- .../teamVoiceQueue/teamVoiceQueue.attributes.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.model.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.rpc.js | 2 +- server/api/template/index.js | 2 +- server/api/template/template.attributes.js | 2 +- server/api/template/template.controller.js | 2 +- server/api/template/template.model.js | 2 +- server/api/template/template.rpc.js | 2 +- server/api/trigger/index.js | 2 +- server/api/trigger/trigger.attributes.js | 2 +- server/api/trigger/trigger.controller.js | 2 +- server/api/trigger/trigger.model.js | 2 +- server/api/trigger/trigger.rpc.js | 2 +- server/api/trunk/index.js | 2 +- server/api/trunk/trunk.attributes.js | 2 +- server/api/trunk/trunk.controller.js | 2 +- server/api/trunk/trunk.model.js | 2 +- server/api/trunk/trunk.rpc.js | 2 +- server/api/user/index.js | 2 +- server/api/user/user.attributes.js | 2 +- server/api/user/user.controller.js | 2 +- server/api/user/user.events.js | 2 +- server/api/user/user.model.js | 2 +- server/api/user/user.rpc.js | 2 +- server/api/user/user.socket.js | 2 +- server/api/userChatQueue/index.js | 2 +- .../api/userChatQueue/userChatQueue.attributes.js | 2 +- server/api/userChatQueue/userChatQueue.model.js | 2 +- server/api/userChatQueue/userChatQueue.rpc.js | 2 +- server/api/userFaxQueue/index.js | 2 +- server/api/userFaxQueue/userFaxQueue.attributes.js | 2 +- server/api/userFaxQueue/userFaxQueue.model.js | 2 +- server/api/userFaxQueue/userFaxQueue.rpc.js | 2 +- server/api/userMailQueue/index.js | 2 +- .../api/userMailQueue/userMailQueue.attributes.js | 2 +- server/api/userMailQueue/userMailQueue.model.js | 2 +- server/api/userMailQueue/userMailQueue.rpc.js | 2 +- server/api/userNotification/index.js | 2 +- .../userNotification.attributes.js | 2 +- .../userNotification.controller.js | 2 +- .../userNotification/userNotification.events.js | 2 +- .../api/userNotification/userNotification.model.js | 2 +- .../api/userNotification/userNotification.rpc.js | 2 +- .../userNotification/userNotification.socket.js | 2 +- server/api/userOpenchannelQueue/index.js | 2 +- .../userOpenchannelQueue.attributes.js | 2 +- .../userOpenchannelQueue.model.js | 2 +- .../userOpenchannelQueue.rpc.js | 2 +- server/api/userProfile/index.js | 2 +- server/api/userProfile/userProfile.attributes.js | 2 +- server/api/userProfile/userProfile.controller.js | 2 +- server/api/userProfile/userProfile.events.js | 2 +- server/api/userProfile/userProfile.model.js | 2 +- server/api/userProfile/userProfile.rpc.js | 2 +- server/api/userProfile/userProfile.socket.js | 2 +- server/api/userProfileResource/index.js | 2 +- .../userProfileResource.attributes.js | 2 +- .../userProfileResource.controller.js | 2 +- .../userProfileResource.model.js | 2 +- .../userProfileResource/userProfileResource.rpc.js | 2 +- server/api/userProfileSection/index.js | 2 +- .../userProfileSection.attributes.js | 2 +- .../userProfileSection.controller.js | 2 +- .../userProfileSection/userProfileSection.model.js | 2 +- .../userProfileSection/userProfileSection.rpc.js | 2 +- server/api/userSmsQueue/index.js | 2 +- server/api/userSmsQueue/userSmsQueue.attributes.js | 2 +- server/api/userSmsQueue/userSmsQueue.model.js | 2 +- server/api/userSmsQueue/userSmsQueue.rpc.js | 2 +- server/api/userVoiceQueue/index.js | 2 +- .../userVoiceQueue/userVoiceQueue.attributes.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +- server/api/userVoiceQueueRt/index.js | 2 +- .../userVoiceQueueRt.attributes.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +- server/api/userWhatsappQueue/index.js | 2 +- .../userWhatsappQueue.attributes.js | 2 +- .../userWhatsappQueue/userWhatsappQueue.model.js | 2 +- .../api/userWhatsappQueue/userWhatsappQueue.rpc.js | 2 +- server/api/variable/index.js | 2 +- server/api/variable/variable.attributes.js | 2 +- server/api/variable/variable.controller.js | 2 +- server/api/variable/variable.model.js | 2 +- server/api/variable/variable.rpc.js | 2 +- server/api/version/index.js | 2 +- server/api/version/version.controller.js | 2 +- server/api/voiceAgentReport/index.js | 2 +- .../voiceAgentReport.attributes.js | 2 +- .../voiceAgentReport.controller.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.model.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.rpc.js | 2 +- server/api/voiceCallReport/index.js | 2 +- .../voiceCallReport/voiceCallReport.attributes.js | 2 +- .../voiceCallReport/voiceCallReport.controller.js | 2 +- .../api/voiceCallReport/voiceCallReport.model.js | 2 +- server/api/voiceCallReport/voiceCallReport.rpc.js | 2 +- server/api/voiceChanSpy/index.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.attributes.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.controller.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.model.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.rpc.js | 2 +- server/api/voiceContext/index.js | 2 +- server/api/voiceContext/voiceContext.attributes.js | 2 +- server/api/voiceContext/voiceContext.controller.js | 2 +- server/api/voiceContext/voiceContext.model.js | 2 +- server/api/voiceContext/voiceContext.rpc.js | 2 +- server/api/voiceDialReport/index.js | 2 +- .../voiceDialReport/voiceDialReport.attributes.js | 2 +- .../voiceDialReport/voiceDialReport.controller.js | 2 +- .../api/voiceDialReport/voiceDialReport.model.js | 2 +- server/api/voiceDialReport/voiceDialReport.rpc.js | 2 +- server/api/voiceExtension/index.js | 2 +- .../voiceExtension/voiceExtension.attributes.js | 2 +- .../voiceExtension/voiceExtension.controller.js | 2 +- server/api/voiceExtension/voiceExtension.events.js | 2 +- server/api/voiceExtension/voiceExtension.model.js | 2 +- server/api/voiceExtension/voiceExtension.rpc.js | 2 +- server/api/voiceExtension/voiceExtension.socket.js | 2 +- server/api/voiceMail/index.js | 2 +- server/api/voiceMail/voiceMail.attributes.js | 2 +- server/api/voiceMail/voiceMail.controller.js | 2 +- server/api/voiceMail/voiceMail.model.js | 2 +- server/api/voiceMail/voiceMail.rpc.js | 2 +- server/api/voiceMailMessage/index.js | 2 +- .../voiceMailMessage.attributes.js | 2 +- .../voiceMailMessage.controller.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.model.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.rpc.js | 2 +- server/api/voiceMusicOnHold/index.js | 2 +- .../voiceMusicOnHold.attributes.js | 2 +- .../voiceMusicOnHold.controller.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.model.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.rpc.js | 2 +- server/api/voicePrefix/index.js | 2 +- server/api/voicePrefix/voicePrefix.attributes.js | 2 +- server/api/voicePrefix/voicePrefix.controller.js | 2 +- server/api/voicePrefix/voicePrefix.events.js | 2 +- server/api/voicePrefix/voicePrefix.model.js | 2 +- server/api/voicePrefix/voicePrefix.rpc.js | 2 +- server/api/voicePrefix/voicePrefix.socket.js | 2 +- server/api/voiceQueue/index.js | 2 +- server/api/voiceQueue/voiceQueue.attributes.js | 2 +- server/api/voiceQueue/voiceQueue.controller.js | 2 +- server/api/voiceQueue/voiceQueue.events.js | 2 +- server/api/voiceQueue/voiceQueue.model.js | 2 +- server/api/voiceQueue/voiceQueue.rpc.js | 2 +- server/api/voiceQueue/voiceQueue.socket.js | 2 +- server/api/voiceQueueReport/index.js | 2 +- .../voiceQueueReport.attributes.js | 2 +- .../voiceQueueReport.controller.js | 2 +- .../voiceQueueReport/voiceQueueReport.events.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.model.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.rpc.js | 2 +- .../voiceQueueReport/voiceQueueReport.socket.js | 2 +- server/api/voiceQueuesLog/index.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.attributes.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.controller.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.model.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.rpc.js | 2 +- server/api/voiceRecording/index.js | 2 +- .../voiceRecording/voiceRecording.attributes.js | 2 +- .../voiceRecording/voiceRecording.controller.js | 2 +- server/api/voiceRecording/voiceRecording.model.js | 2 +- server/api/voiceRecording/voiceRecording.rpc.js | 2 +- server/api/voiceTransferReport/index.js | 2 +- .../voiceTransferReport.attributes.js | 2 +- .../voiceTransferReport.controller.js | 2 +- .../voiceTransferReport.model.js | 2 +- .../voiceTransferReport/voiceTransferReport.rpc.js | 2 +- server/api/webbar/index.js | 2 +- server/api/webbar/webbar.controller.js | 2 +- server/api/whatsappAccount/index.js | 2 +- .../whatsappAccount/whatsappAccount.attributes.js | 2 +- .../whatsappAccount/whatsappAccount.controller.js | 2 +- .../api/whatsappAccount/whatsappAccount.events.js | 2 +- .../api/whatsappAccount/whatsappAccount.model.js | 2 +- server/api/whatsappAccount/whatsappAccount.rpc.js | 2 +- .../api/whatsappAccount/whatsappAccount.socket.js | 2 +- server/api/whatsappApplication/index.js | 2 +- .../whatsappApplication.attributes.js | 2 +- .../whatsappApplication.controller.js | 2 +- .../whatsappApplication.model.js | 2 +- .../whatsappApplication/whatsappApplication.rpc.js | 2 +- server/api/whatsappInteraction/index.js | 2 +- .../whatsappInteraction.attributes.js | 2 +- .../whatsappInteraction.controller.js | 2 +- .../whatsappInteraction.events.js | 2 +- .../whatsappInteraction.model.js | 2 +- .../whatsappInteraction/whatsappInteraction.rpc.js | 2 +- .../whatsappInteraction.socket.js | 2 +- server/api/whatsappMessage/index.js | 2 +- .../whatsappMessage/whatsappMessage.attributes.js | 2 +- .../whatsappMessage/whatsappMessage.controller.js | 2 +- .../api/whatsappMessage/whatsappMessage.events.js | 2 +- .../api/whatsappMessage/whatsappMessage.model.js | 2 +- server/api/whatsappMessage/whatsappMessage.rpc.js | 2 +- .../api/whatsappMessage/whatsappMessage.socket.js | 2 +- server/api/whatsappQueue/index.js | 2 +- .../api/whatsappQueue/whatsappQueue.attributes.js | 2 +- .../api/whatsappQueue/whatsappQueue.controller.js | 2 +- server/api/whatsappQueue/whatsappQueue.events.js | 2 +- server/api/whatsappQueue/whatsappQueue.model.js | 2 +- server/api/whatsappQueue/whatsappQueue.rpc.js | 2 +- server/api/whatsappQueue/whatsappQueue.socket.js | 2 +- server/api/whatsappQueueReport/index.js | 2 +- .../whatsappQueueReport.attributes.js | 2 +- .../whatsappQueueReport.controller.js | 2 +- .../whatsappQueueReport.model.js | 2 +- .../whatsappQueueReport/whatsappQueueReport.rpc.js | 2 +- server/api/whatsappTransferReport/index.js | 2 +- .../whatsappTransferReport.attributes.js | 2 +- .../whatsappTransferReport.controller.js | 2 +- .../whatsappTransferReport.model.js | 2 +- .../whatsappTransferReport.rpc.js | 2 +- server/app.js | 2 +- server/components/auth/service.js | 2 +- server/components/encryptor/index.js | 2 +- server/components/export/csv.js | 2 +- server/components/export/pdf.js | 2 +- server/components/export/xlsx.js | 2 +- server/components/extensions/rewrite.js | 2 +- server/components/import/cm/csv.js | 2 +- server/components/import/cm/csv2.js | 2 +- server/components/import/cm/csvUpdates.js | 2 +- server/components/integrations/configuration.js | 2 +- server/components/interaction/service.js | 2 +- server/components/license/service.js | 2 +- server/components/parsers/advancedSearch.js | 2 +- server/components/parsers/qs.js | 2 +- server/config/express.js | 2 +- server/config/license/hardware.js | 2 +- server/config/license/index.js | 2 +- server/config/license/util.js | 2 +- server/config/local.env.js | 2 +- server/config/logger.js | 2 +- server/config/pm2/config.js | 2 +- server/config/pm2/index.js | 2 +- server/config/schedule/chat.js | 2 +- server/config/schedule/index.js | 2 +- server/config/schedule/transcribe.js | 2 +- server/config/schedule/whatsapp.js | 2 +- server/config/seedContact.js | 2 +- server/config/seedUsers.js | 2 +- server/config/socketio.js | 2 +- server/config/triggers/index.js | 2 +- server/config/utils.js | 2 +- server/errors/index.js | 2 +- server/mysqldb/index.js | 2 +- server/routes.js | 2 +- server/rpc/index.js | 2 +- server/services/agi/channel.js | 2 +- server/services/agi/error.js | 2 +- server/services/agi/graph/index.js | 2 +- server/services/agi/index.js | 2 +- server/services/agi/mailRpc/index.js | 2 +- server/services/agi/reply.js | 2 +- server/services/agi/rpc/index.js | 2 +- server/services/agi/scripts/aws/index.js | 2 +- server/services/agi/scripts/aws/lex/index.js | 2 +- server/services/agi/scripts/aws/lex/lib/api.js | 2 +- server/services/agi/scripts/aws/polly/index.js | 2 +- server/services/agi/scripts/aws/polly/lib/api.js | 2 +- server/services/agi/scripts/google/asr/index.js | 2 +- server/services/agi/scripts/google/asr/lib/api.js | 2 +- server/services/agi/scripts/google/index.js | 2 +- server/services/agi/scripts/index.js | 2 +- server/services/agi/scripts/sestek/index.js | 2 +- server/services/agi/scripts/sestek/nda/index.js | 2 +- server/services/agi/scripts/tilde/asr/index.js | 2 +- server/services/agi/scripts/tilde/asr/lib/api.js | 2 +- server/services/agi/scripts/tilde/index.js | 2 +- server/services/agi/server.js | 2 +- server/services/agi/vertices.js | 2 +- server/services/ami/acw/index.js | 2 +- server/services/ami/ami.js | 2 +- server/services/ami/client.js | 2 +- server/services/ami/dialer/action.js | 2 +- server/services/ami/dialer/additionalPhone.js | 2 +- server/services/ami/dialer/agentComplete.js | 2 +- server/services/ami/dialer/final.js | 2 +- server/services/ami/dialer/hangup.js | 2 +- server/services/ami/dialer/history.js | 2 +- server/services/ami/dialer/index.js | 2 +- server/services/ami/dialer/queueCallerAbandon.js | 2 +- server/services/ami/fax/action.js | 2 +- server/services/ami/fax/index.js | 2 +- server/services/ami/fax/rpcDb.js | 2 +- server/services/ami/fax/util/gs.js | 2 +- server/services/ami/fax/util/util.js | 2 +- server/services/ami/index.js | 2 +- server/services/ami/model/agent.js | 2 +- server/services/ami/model/campaign.js | 2 +- server/services/ami/model/channel.js | 2 +- server/services/ami/model/deskAccount.js | 2 +- server/services/ami/model/dynamics365Account.js | 2 +- server/services/ami/model/faxAccount.js | 2 +- server/services/ami/model/freshdeskAccount.js | 2 +- server/services/ami/model/freshsalesAccount.js | 2 +- server/services/ami/model/queueReport.js | 2 +- server/services/ami/model/salesforceAccount.js | 2 +- server/services/ami/model/servicenowAccount.js | 2 +- server/services/ami/model/sugarcrmAccount.js | 2 +- server/services/ami/model/telephone.js | 2 +- server/services/ami/model/template.js | 2 +- server/services/ami/model/trigger.js | 2 +- server/services/ami/model/trunk.js | 2 +- server/services/ami/model/voiceExtension.js | 2 +- server/services/ami/model/voiceQueue.js | 2 +- server/services/ami/model/vtigerAccount.js | 2 +- server/services/ami/model/zendeskAccount.js | 2 +- server/services/ami/model/zohoAccount.js | 2 +- server/services/ami/preview/action.js | 2 +- server/services/ami/preview/index.js | 2 +- server/services/ami/preview/rpcDb.js | 2 +- server/services/ami/preview/util/util.js | 2 +- server/services/ami/properties.js | 2 +- server/services/ami/realtime/index.js | 2 +- server/services/ami/report/index.js | 2 +- server/services/ami/report/userReport.js | 2 +- server/services/ami/report/voiceAgentReport.js | 2 +- server/services/ami/report/voiceCallReport.js | 2 +- server/services/ami/report/voiceDialReport.js | 2 +- server/services/ami/report/voiceQueueReport.js | 2 +- server/services/ami/rpc/agentReportPreview.js | 2 +- server/services/ami/rpc/attachment.js | 2 +- server/services/ami/rpc/campaign.js | 2 +- server/services/ami/rpc/cmContact.js | 2 +- server/services/ami/rpc/cmHopper.js | 2 +- server/services/ami/rpc/cmHopperAdditionalPhone.js | 2 +- server/services/ami/rpc/cmHopperBlack.js | 2 +- server/services/ami/rpc/cmHopperFinal.js | 2 +- server/services/ami/rpc/cmHopperHistory.js | 2 +- server/services/ami/rpc/faxAccount.js | 2 +- server/services/ami/rpc/faxMessage.js | 2 +- server/services/ami/rpc/integrations/desk.js | 2 +- .../services/ami/rpc/integrations/dynamics365.js | 2 +- server/services/ami/rpc/integrations/freshdesk.js | 2 +- server/services/ami/rpc/integrations/freshsales.js | 2 +- server/services/ami/rpc/integrations/salesforce.js | 2 +- server/services/ami/rpc/integrations/servicenow.js | 2 +- server/services/ami/rpc/integrations/sugarcrm.js | 2 +- server/services/ami/rpc/integrations/vtiger.js | 2 +- server/services/ami/rpc/integrations/zendesk.js | 2 +- server/services/ami/rpc/integrations/zoho.js | 2 +- server/services/ami/rpc/memberReport.js | 2 +- server/services/ami/rpc/setting.js | 2 +- server/services/ami/rpc/template.js | 2 +- server/services/ami/rpc/trigger.js | 2 +- server/services/ami/rpc/trunk.js | 2 +- server/services/ami/rpc/user.js | 2 +- server/services/ami/rpc/voiceAgentReport.js | 2 +- server/services/ami/rpc/voiceCallReport.js | 2 +- server/services/ami/rpc/voiceDialReport.js | 2 +- server/services/ami/rpc/voiceExtension.js | 2 +- server/services/ami/rpc/voiceQueue.js | 2 +- server/services/ami/rpc/voiceQueueReport.js | 2 +- server/services/ami/rpc/voiceQueueRt.js | 2 +- server/services/ami/rpc/voiceRecording.js | 2 +- server/services/ami/rpc/voiceTransferReport.js | 2 +- server/services/ami/server/index.js | 2 +- server/services/ami/trigger/cmContact/index.js | 2 +- server/services/ami/trigger/index.js | 2 +- server/services/ami/trigger/integration/desk.js | 2 +- .../ami/trigger/integration/dynamics365.js | 2 +- .../services/ami/trigger/integration/freshdesk.js | 2 +- .../services/ami/trigger/integration/freshsales.js | 2 +- server/services/ami/trigger/integration/index.js | 2 +- .../services/ami/trigger/integration/salesforce.js | 2 +- .../services/ami/trigger/integration/servicenow.js | 2 +- .../services/ami/trigger/integration/sugarcrm.js | 2 +- server/services/ami/trigger/integration/util.js | 2 +- server/services/ami/trigger/integration/vtiger.js | 2 +- server/services/ami/trigger/integration/zendesk.js | 2 +- server/services/ami/trigger/integration/zoho.js | 2 +- server/services/ami/trigger/script/index.js | 2 +- server/services/ami/trigger/urlforward/index.js | 2 +- server/services/email/client.js | 2 +- server/services/email/index.js | 2 +- server/services/email/lib/email.js | 2 +- server/services/email/lib/imap.js | 2 +- server/services/email/lib/smtp.js | 2 +- server/services/email/lib/utils.js | 2 +- server/services/email/model/mailAccount.js | 2 +- server/services/email/realtime/index.js | 2 +- server/services/email/rpc/mailAccount.js | 2 +- server/services/email/rpc/setting.js | 2 +- server/services/email/server/index.js | 2 +- server/services/express/index.js | 2 +- server/services/routing/client.js | 2 +- server/services/routing/index.js | 2 +- server/services/routing/lib/rule-engine.js | 2 +- server/services/routing/mailRpc/index.js | 2 +- server/services/routing/model/agent.js | 2 +- server/services/routing/model/chatQueue.js | 2 +- server/services/routing/model/faxQueue.js | 2 +- server/services/routing/model/interval.js | 2 +- server/services/routing/model/mailQueue.js | 2 +- server/services/routing/model/openchannelQueue.js | 2 +- server/services/routing/model/smsQueue.js | 2 +- server/services/routing/model/whatsappQueue.js | 2 +- server/services/routing/realtime/index.js | 2 +- server/services/routing/rpc/chatInteraction.js | 2 +- server/services/routing/rpc/chatMessage.js | 2 +- server/services/routing/rpc/chatQueue.js | 2 +- server/services/routing/rpc/chatQueueReport.js | 2 +- server/services/routing/rpc/faxInteraction.js | 2 +- server/services/routing/rpc/faxMessage.js | 2 +- server/services/routing/rpc/faxQueue.js | 2 +- server/services/routing/rpc/faxQueueReport.js | 2 +- server/services/routing/rpc/interval.js | 2 +- server/services/routing/rpc/mailInteraction.js | 2 +- server/services/routing/rpc/mailMessage.js | 2 +- server/services/routing/rpc/mailQueue.js | 2 +- server/services/routing/rpc/mailQueueReport.js | 2 +- .../services/routing/rpc/openchannelInteraction.js | 2 +- server/services/routing/rpc/openchannelMessage.js | 2 +- server/services/routing/rpc/openchannelQueue.js | 2 +- .../services/routing/rpc/openchannelQueueReport.js | 2 +- server/services/routing/rpc/smsInteraction.js | 2 +- server/services/routing/rpc/smsMessage.js | 2 +- server/services/routing/rpc/smsQueue.js | 2 +- server/services/routing/rpc/smsQueueReport.js | 2 +- server/services/routing/rpc/user.js | 2 +- server/services/routing/rpc/whatsappInteraction.js | 2 +- server/services/routing/rpc/whatsappMessage.js | 2 +- server/services/routing/rpc/whatsappQueue.js | 2 +- server/services/routing/rpc/whatsappQueueReport.js | 2 +- .../services/routing/server/applications/agent.js | 2 +- .../routing/server/applications/amazonlex.js | 2 +- .../routing/server/applications/autoreply.js | 2 +- .../services/routing/server/applications/close.js | 2 +- .../routing/server/applications/dialogflow.js | 2 +- .../routing/server/applications/dialogflowV2.js | 2 +- .../services/routing/server/applications/gotoif.js | 2 +- .../services/routing/server/applications/gotop.js | 2 +- .../routing/server/applications/message.js | 2 +- .../services/routing/server/applications/noop.js | 2 +- .../services/routing/server/applications/queue.js | 2 +- .../routing/server/applications/strategy/agent.js | 2 +- .../server/applications/strategy/beepall.js | 2 +- .../routing/server/applications/strategy/index.js | 2 +- .../server/applications/strategy/rrmemory.js | 2 +- .../routing/server/applications/strategy/util.js | 2 +- .../services/routing/server/applications/system.js | 2 +- server/services/routing/server/applications/tag.js | 2 +- .../services/routing/server/applications/utils.js | 2 +- server/services/routing/server/index.js | 2 +- server/services/routing/server/interval.js | 2 +- server/services/xdr/agents.controller.js | 2 +- server/services/xdr/calls.controller.js | 2 +- server/services/xdr/core.controller.js | 2 +- server/services/xdr/dials.controller.js | 2 +- server/services/xdr/index.js | 2 +- server/services/xdr/members.controller.js | 2 +- server/services/xdr/queues.controller.js | 2 +- server/services/xdr/recordings.controller.js | 2 +- server/services/xdr/transfers.controller.js | 2 +- server/services/xdr/utils.js | 2 +- 1166 files changed, 1166 insertions(+), 1166 deletions(-) diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 26ac1c8..0506226 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-08-24T15:12:00.018Z", + "time": "2021-08-24T15:20:17.729Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index ebb7023..4145310 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-08-24T15:12:00.018Z", + "time": "2021-08-24T15:20:17.729Z", "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 2704a5f..f59f7f7 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 _0xf3ff=['Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','urlForward'];(function(_0x520401,_0x6a3ccc){var _0x250325=function(_0x53f3c3){while(--_0x53f3c3){_0x520401['push'](_0x520401['shift']());}};_0x250325(++_0x6a3ccc);}(_0xf3ff,0x104));var _0xff3f=function(_0x202a07,_0x3b0cec){_0x202a07=_0x202a07-0x0;var _0x4c966f=_0xf3ff[_0x202a07];return _0x4c966f;};'use strict';var Sequelize=require(_0xff3f('0x0'));module[_0xff3f('0x1')]={'name':{'type':Sequelize[_0xff3f('0x2')],'get':function(_0x40c978){return this[_0xff3f('0x3')](_0xff3f('0x4'));}},'action':{'type':Sequelize[_0xff3f('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0xff3f('0x6'),_0xff3f('0x7'),_0xff3f('0x8'),'jscripty',_0xff3f('0x9'),'browser','bot','script']],'msg':_0xff3f('0xa')}},'comment':_0xff3f('0xa')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0xff3f('0xb')},'data2':{'type':Sequelize[_0xff3f('0x5')](0x1000),'comment':_0xff3f('0xc')},'data3':{'type':Sequelize[_0xff3f('0x5')](0x1000),'comment':_0xff3f('0xd')},'data4':{'type':Sequelize[_0xff3f('0x5')](0x1000)},'data5':{'type':Sequelize['STRING'](0x1000)},'data6':{'type':Sequelize['STRING']},'data7':{'type':Sequelize[_0xff3f('0xe')]}}; \ No newline at end of file +var _0xbd4d=['STRING','contactManager','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize','exports','action'];(function(_0x46a8b5,_0x5bdeb9){var _0x18588e=function(_0x283553){while(--_0x283553){_0x46a8b5['push'](_0x46a8b5['shift']());}};_0x18588e(++_0x5bdeb9);}(_0xbd4d,0x1eb));var _0xdbd4=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0xbd4d[_0x29d915];return _0x160f86;};'use strict';var Sequelize=require(_0xdbd4('0x0'));module[_0xdbd4('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x38b926){return this['getDataValue'](_0xdbd4('0x2'));}},'action':{'type':Sequelize[_0xdbd4('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0xdbd4('0x4'),'integration','motionbar','jscripty',_0xdbd4('0x5'),_0xdbd4('0x6'),_0xdbd4('0x7'),_0xdbd4('0x8')]],'msg':_0xdbd4('0x9')}},'comment':_0xdbd4('0x9')},'data1':{'type':Sequelize[_0xdbd4('0x3')](0x1000),'comment':'contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]'},'data2':{'type':Sequelize[_0xdbd4('0x3')](0x1000),'comment':_0xdbd4('0xa')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0xdbd4('0xb')},'data4':{'type':Sequelize[_0xdbd4('0x3')](0x1000)},'data5':{'type':Sequelize[_0xdbd4('0x3')](0x1000)},'data6':{'type':Sequelize['STRING']},'data7':{'type':Sequelize[_0xdbd4('0xc')]}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 00c466e..eb984cb 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 _0xbdde=['find','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','offset','undefined','count','limit','json','apply','reject','save','update','then','destroy','end','sendStatus','error','name','send','body','params','catch','Action'];(function(_0x94b169,_0x5df9e5){var _0x14434c=function(_0x46593c){while(--_0x46593c){_0x94b169['push'](_0x94b169['shift']());}};_0x14434c(++_0x5df9e5);}(_0xbdde,0x12e));var _0xebdd=function(_0x250453,_0x2a0799){_0x250453=_0x250453-0x0;var _0x471c1a=_0xbdde[_0x250453];return _0x471c1a;};'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(_0xebdd('0x0'));var moment=require('moment');var BPromise=require(_0xebdd('0x1'));var Mustache=require(_0xebdd('0x2'));var util=require(_0xebdd('0x3'));var path=require('path');var sox=require(_0xebdd('0x4'));var csv=require(_0xebdd('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xebdd('0x6'));var _=require(_0xebdd('0x7'));var squel=require(_0xebdd('0x8'));var crypto=require(_0xebdd('0x9'));var jsforce=require(_0xebdd('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xebdd('0x5'));var querystring=require(_0xebdd('0xb'));var Papa=require(_0xebdd('0xc'));var Redis=require(_0xebdd('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xebdd('0xe'));var as=require(_0xebdd('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xebdd('0x10'))(_0xebdd('0x11'));var utils=require(_0xebdd('0x12'));var config=require(_0xebdd('0x13'));var licenseUtil=require(_0xebdd('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7e35ac,_0x1f566a){_0x1f566a=_0x1f566a||0xcc;return function(_0x39050c){if(_0x39050c){return _0x7e35ac['sendStatus'](_0x1f566a);}return _0x7e35ac[_0xebdd('0x15')](_0x1f566a)['end']();};}function respondWithResult(_0x1dbe68,_0xf3d997){_0xf3d997=_0xf3d997||0xc8;return function(_0x57e83d){if(_0x57e83d){return _0x1dbe68['status'](_0xf3d997)['json'](_0x57e83d);}};}function respondWithFilteredResult(_0x1bc740,_0x611915){return function(_0x18640e){if(_0x18640e){var _0x747cb5=typeof _0x611915[_0xebdd('0x16')]==='undefined'&&typeof _0x611915['limit']===_0xebdd('0x17');var _0x37b220=_0x18640e['count'];var _0x438e27=_0x747cb5?0x0:_0x611915[_0xebdd('0x16')];var _0x49d72e=_0x747cb5?_0x18640e[_0xebdd('0x18')]:_0x611915[_0xebdd('0x16')]+_0x611915[_0xebdd('0x19')];var _0x42d3be;if(_0x49d72e>=_0x37b220){_0x49d72e=_0x37b220;_0x42d3be=0xc8;}else{_0x42d3be=0xce;}_0x1bc740[_0xebdd('0x15')](_0x42d3be);return _0x1bc740['set']('Content-Range',_0x438e27+'-'+_0x49d72e+'/'+_0x37b220)[_0xebdd('0x1a')](_0x18640e);}return null;};}function patchUpdates(_0x312e5c){return function(_0x49339a){try{jsonpatch[_0xebdd('0x1b')](_0x49339a,_0x312e5c,!![]);}catch(_0x1875b1){return BPromise[_0xebdd('0x1c')](_0x1875b1);}return _0x49339a[_0xebdd('0x1d')]();};}function saveUpdates(_0x32ca78,_0x295d51){return function(_0x1b9452){if(_0x1b9452){return _0x1b9452[_0xebdd('0x1e')](_0x32ca78)[_0xebdd('0x1f')](function(_0x1febc2){return _0x1febc2;});}return null;};}function removeEntity(_0x2eb6a0,_0x4ac289){return function(_0x855255){if(_0x855255){return _0x855255[_0xebdd('0x20')]()[_0xebdd('0x1f')](function(){_0x2eb6a0['status'](0xcc)[_0xebdd('0x21')]();});}};}function handleEntityNotFound(_0x33d18c,_0xb3fbc4){return function(_0x50d3ee){if(!_0x50d3ee){_0x33d18c[_0xebdd('0x22')](0x194);}return _0x50d3ee;};}function handleError(_0x203fc7,_0x26045f){_0x26045f=_0x26045f||0x1f4;return function(_0x32c075){logger[_0xebdd('0x23')](_0x32c075['stack']);if(_0x32c075[_0xebdd('0x24')]){delete _0x32c075['name'];}_0x203fc7[_0xebdd('0x15')](_0x26045f)[_0xebdd('0x25')](_0x32c075);};}exports[_0xebdd('0x1e')]=function(_0x5f4b63,_0x50cd4a){if(_0x5f4b63[_0xebdd('0x26')]['id']){delete _0x5f4b63['body']['id'];}return db['Action']['find']({'where':{'id':_0x5f4b63[_0xebdd('0x27')]['id']}})[_0xebdd('0x1f')](handleEntityNotFound(_0x50cd4a,null))[_0xebdd('0x1f')](saveUpdates(_0x5f4b63[_0xebdd('0x26')],null))[_0xebdd('0x1f')](respondWithResult(_0x50cd4a,null))[_0xebdd('0x28')](handleError(_0x50cd4a,null));};exports['destroy']=function(_0x5c4757,_0x52849b){return db[_0xebdd('0x29')][_0xebdd('0x2a')]({'where':{'id':_0x5c4757['params']['id']}})[_0xebdd('0x1f')](handleEntityNotFound(_0x52849b,null))[_0xebdd('0x1f')](removeEntity(_0x52849b,null))['catch'](handleError(_0x52849b,null));}; \ No newline at end of file +var _0x03c3=['name','send','body','Action','find','params','catch','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x03c3,0xf2));var _0x303c=function(_0x8a3dee,_0x37f627){_0x8a3dee=_0x8a3dee-0x0;var _0x3a8474=_0x03c3[_0x8a3dee];return _0x3a8474;};'use strict';var emlformat=require(_0x303c('0x0'));var rimraf=require(_0x303c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x303c('0x2'));var moment=require(_0x303c('0x3'));var BPromise=require(_0x303c('0x4'));var Mustache=require('mustache');var util=require(_0x303c('0x5'));var path=require(_0x303c('0x6'));var sox=require(_0x303c('0x7'));var csv=require(_0x303c('0x8'));var ejs=require(_0x303c('0x9'));var fs=require('fs');var fs_extra=require(_0x303c('0xa'));var _=require(_0x303c('0xb'));var squel=require(_0x303c('0xc'));var crypto=require(_0x303c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x303c('0xe'));var toCsv=require(_0x303c('0x8'));var querystring=require(_0x303c('0xf'));var Papa=require('papaparse');var Redis=require(_0x303c('0x10'));var authService=require(_0x303c('0x11'));var qs=require(_0x303c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x303c('0x13'));var logger=require('../../config/logger')(_0x303c('0x14'));var utils=require('../../config/utils');var config=require(_0x303c('0x15'));var licenseUtil=require(_0x303c('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a8122,_0xda684f){_0xda684f=_0xda684f||0xcc;return function(_0x328d27){if(_0x328d27){return _0x1a8122[_0x303c('0x17')](_0xda684f);}return _0x1a8122[_0x303c('0x18')](_0xda684f)['end']();};}function respondWithResult(_0x5ea30e,_0x7f58ef){_0x7f58ef=_0x7f58ef||0xc8;return function(_0x277bda){if(_0x277bda){return _0x5ea30e[_0x303c('0x18')](_0x7f58ef)[_0x303c('0x19')](_0x277bda);}};}function respondWithFilteredResult(_0x4b239f,_0x10d42c){return function(_0x2fe6f9){if(_0x2fe6f9){var _0x9869e6=typeof _0x10d42c[_0x303c('0x1a')]===_0x303c('0x1b')&&typeof _0x10d42c[_0x303c('0x1c')]==='undefined';var _0x2628cd=_0x2fe6f9[_0x303c('0x1d')];var _0x366833=_0x9869e6?0x0:_0x10d42c[_0x303c('0x1a')];var _0x3282c2=_0x9869e6?_0x2fe6f9[_0x303c('0x1d')]:_0x10d42c[_0x303c('0x1a')]+_0x10d42c['limit'];var _0x2061af;if(_0x3282c2>=_0x2628cd){_0x3282c2=_0x2628cd;_0x2061af=0xc8;}else{_0x2061af=0xce;}_0x4b239f['status'](_0x2061af);return _0x4b239f[_0x303c('0x1e')](_0x303c('0x1f'),_0x366833+'-'+_0x3282c2+'/'+_0x2628cd)[_0x303c('0x19')](_0x2fe6f9);}return null;};}function patchUpdates(_0x43a31c){return function(_0x4697d4){try{jsonpatch[_0x303c('0x20')](_0x4697d4,_0x43a31c,!![]);}catch(_0x3c8dad){return BPromise[_0x303c('0x21')](_0x3c8dad);}return _0x4697d4[_0x303c('0x22')]();};}function saveUpdates(_0x2d1361,_0x1bc66e){return function(_0x1a5a1d){if(_0x1a5a1d){return _0x1a5a1d[_0x303c('0x23')](_0x2d1361)[_0x303c('0x24')](function(_0x1c2123){return _0x1c2123;});}return null;};}function removeEntity(_0x2c566a,_0x4fb59f){return function(_0x16edcb){if(_0x16edcb){return _0x16edcb[_0x303c('0x25')]()[_0x303c('0x24')](function(){_0x2c566a[_0x303c('0x18')](0xcc)[_0x303c('0x26')]();});}};}function handleEntityNotFound(_0x2430e7,_0x3fc9dd){return function(_0x5754bb){if(!_0x5754bb){_0x2430e7['sendStatus'](0x194);}return _0x5754bb;};}function handleError(_0x3d7107,_0x4a23ec){_0x4a23ec=_0x4a23ec||0x1f4;return function(_0x15c62b){logger[_0x303c('0x27')](_0x15c62b['stack']);if(_0x15c62b[_0x303c('0x28')]){delete _0x15c62b[_0x303c('0x28')];}_0x3d7107[_0x303c('0x18')](_0x4a23ec)[_0x303c('0x29')](_0x15c62b);};}exports[_0x303c('0x23')]=function(_0x158fda,_0x292ddb){if(_0x158fda[_0x303c('0x2a')]['id']){delete _0x158fda[_0x303c('0x2a')]['id'];}return db[_0x303c('0x2b')][_0x303c('0x2c')]({'where':{'id':_0x158fda[_0x303c('0x2d')]['id']}})['then'](handleEntityNotFound(_0x292ddb,null))[_0x303c('0x24')](saveUpdates(_0x158fda[_0x303c('0x2a')],null))[_0x303c('0x24')](respondWithResult(_0x292ddb,null))['catch'](handleError(_0x292ddb,null));};exports[_0x303c('0x25')]=function(_0x50e8db,_0x1d5ac5){return db[_0x303c('0x2b')][_0x303c('0x2c')]({'where':{'id':_0x50e8db[_0x303c('0x2d')]['id']}})[_0x303c('0x24')](handleEntityNotFound(_0x1d5ac5,null))[_0x303c('0x24')](removeEntity(_0x1d5ac5,null))[_0x303c('0x2e')](handleError(_0x1d5ac5,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 3b47045..00e5d78 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 _0x29b1=['rimraf','../../config/environment','./action.attributes','exports','Action','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x3f5c46,_0x1cb7c4){var _0x2ce2fc=function(_0x96dff3){while(--_0x96dff3){_0x3f5c46['push'](_0x3f5c46['shift']());}};_0x2ce2fc(++_0x1cb7c4);}(_0x29b1,0x16d));var _0x129b=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0x29b1[_0x298ed3];return _0x5aad28;};'use strict';var _=require(_0x129b('0x0'));var util=require(_0x129b('0x1'));var logger=require(_0x129b('0x2'))(_0x129b('0x3'));var moment=require(_0x129b('0x4'));var BPromise=require('bluebird');var rp=require(_0x129b('0x5'));var fs=require('fs');var path=require(_0x129b('0x6'));var rimraf=require(_0x129b('0x7'));var config=require(_0x129b('0x8'));var attributes=require(_0x129b('0x9'));module[_0x129b('0xa')]=function(_0x31e428,_0xe27ed4){return _0x31e428['define'](_0x129b('0xb'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbf75=['../../config/environment','./action.attributes','define','tools_actions','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x2e3b99,_0x5194f9){var _0x4fca25=function(_0xd6efa7){while(--_0xd6efa7){_0x2e3b99['push'](_0x2e3b99['shift']());}};_0x4fca25(++_0x5194f9);}(_0xbf75,0x1f3));var _0x5bf7=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0xbf75[_0x2b5eae];return _0x5f3ac9;};'use strict';var _=require(_0x5bf7('0x0'));var util=require(_0x5bf7('0x1'));var logger=require(_0x5bf7('0x2'))('api');var moment=require(_0x5bf7('0x3'));var BPromise=require(_0x5bf7('0x4'));var rp=require(_0x5bf7('0x5'));var fs=require('fs');var path=require(_0x5bf7('0x6'));var rimraf=require('rimraf');var config=require(_0x5bf7('0x7'));var attributes=require(_0x5bf7('0x8'));module['exports']=function(_0x3081e2,_0x592ae7){return _0x3081e2[_0x5bf7('0x9')]('Action',attributes,{'tableName':_0x5bf7('0xa'),'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 287729d..c830b87 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 _0x1261=['then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x2b65b3,_0x1cbb98){var _0xf7b6ff=function(_0x526859){while(--_0x526859){_0x2b65b3['push'](_0x2b65b3['shift']());}};_0xf7b6ff(++_0x1cbb98);}(_0x1261,0x144));var _0x1126=function(_0x117f4c,_0x36a9b1){_0x117f4c=_0x117f4c-0x0;var _0x2b24e9=_0x1261[_0x117f4c];return _0x2b24e9;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('Action,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x24ede5,_0x28425f){var _0x5320ea=function(_0x4fef7c){while(--_0x4fef7c){_0x24ede5['push'](_0x24ede5['shift']());}};_0x5320ea(++_0x28425f);}(_0xabce,0x103));var _0xeabc=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xabce[_0x12d033];return _0x3b4e80;};'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')]('Action,\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/action/index.js b/server/api/action/index.js index 6ee8581..f78c200 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 _0xb23d=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./action.controller','put','/:id','isAuthenticated','update','delete','exports','multer','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb23d,0x184));var _0xdb23=function(_0xf5d71c,_0x2613a6){_0xf5d71c=_0xf5d71c-0x0;var _0x5af672=_0xb23d[_0xf5d71c];return _0x5af672;};'use strict';var multer=require(_0xdb23('0x0'));var util=require('util');var path=require(_0xdb23('0x1'));var timeout=require(_0xdb23('0x2'));var express=require(_0xdb23('0x3'));var router=express[_0xdb23('0x4')]();var fs_extra=require(_0xdb23('0x5'));var auth=require(_0xdb23('0x6'));var interaction=require(_0xdb23('0x7'));var config=require('../../config/environment');var controller=require(_0xdb23('0x8'));router[_0xdb23('0x9')](_0xdb23('0xa'),auth[_0xdb23('0xb')](),controller[_0xdb23('0xc')]);router[_0xdb23('0xd')](_0xdb23('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xdb23('0xe')]=router; \ No newline at end of file +var _0x2a40=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','delete','isAuthenticated','destroy','exports','util'];(function(_0x20aadb,_0x5a607a){var _0x520018=function(_0x1d258a){while(--_0x1d258a){_0x20aadb['push'](_0x20aadb['shift']());}};_0x520018(++_0x5a607a);}(_0x2a40,0x194));var _0x02a4=function(_0x30033a,_0x5ce4a6){_0x30033a=_0x30033a-0x0;var _0x5e3518=_0x2a40[_0x30033a];return _0x5e3518;};'use strict';var multer=require('multer');var util=require(_0x02a4('0x0'));var path=require(_0x02a4('0x1'));var timeout=require(_0x02a4('0x2'));var express=require(_0x02a4('0x3'));var router=express[_0x02a4('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x02a4('0x5'));var interaction=require(_0x02a4('0x6'));var config=require(_0x02a4('0x7'));var controller=require(_0x02a4('0x8'));router[_0x02a4('0x9')](_0x02a4('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x02a4('0xb')](_0x02a4('0xa'),auth[_0x02a4('0xc')](),controller[_0x02a4('0xd')]);module[_0x02a4('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 9a2753d..de86e22 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 _0xb4c7=['STRING','TEXT','sequelize','exports'];(function(_0x6173fc,_0x32aadf){var _0x965fbe=function(_0x50d5b3){while(--_0x50d5b3){_0x6173fc['push'](_0x6173fc['shift']());}};_0x965fbe(++_0x32aadf);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x4d98ab,_0x2e35cc){_0x4d98ab=_0x4d98ab-0x0;var _0x3d582e=_0xb4c7[_0x4d98ab];return _0x3d582e;};'use strict';var Sequelize=require(_0x7b4c('0x0'));module[_0x7b4c('0x1')]={'name':{'type':Sequelize[_0x7b4c('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7b4c('0x2')]},'parent':{'type':Sequelize[_0x7b4c('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x7b4c('0x3')]},'joins':{'type':Sequelize[_0x7b4c('0x3')]}}; \ No newline at end of file +var _0xd8fb=['TEXT','sequelize','exports','STRING'];(function(_0x47c9c9,_0x5618bf){var _0x4462bd=function(_0x3dbf26){while(--_0x3dbf26){_0x47c9c9['push'](_0x47c9c9['shift']());}};_0x4462bd(++_0x5618bf);}(_0xd8fb,0x99));var _0xbd8f=function(_0x3872a1,_0x5807e2){_0x3872a1=_0x3872a1-0x0;var _0xee61e8=_0xd8fb[_0x3872a1];return _0xee61e8;};'use strict';var Sequelize=require(_0xbd8f('0x0'));module[_0xbd8f('0x1')]={'name':{'type':Sequelize[_0xbd8f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xbd8f('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xbd8f('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 5921266..d658435 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 _0x50bf=['merge','options','includeAll','include','rows','catch','show','params','body','user','role','Reports','find','autoAssociation','UserProfileResource','create','error','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','MetricId','replace','function','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','Limited\x20Query:','sequelize','SELECT','join','right_join','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','includes','operator','getFields','metric','groupBy','output','fullPath','%s-%s.%s','randomstring','generate','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','toString','countTable','COUNT(*)','QueryTypes','run','left_join','MIN(%s)','SEC_TO_TIME(%s)','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomReports','sendStatus','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','VIRTUAL'];(function(_0x3d6d10,_0x57c8fb){var _0xbeda88=function(_0x2171e7){while(--_0x2171e7){_0x3d6d10['push'](_0x3d6d10['shift']());}};_0xbeda88(++_0x57c8fb);}(_0x50bf,0x106));var _0xf50b=function(_0x365890,_0xd9d579){_0x365890=_0x365890-0x0;var _0x4199ae=_0x50bf[_0x365890];return _0x4199ae;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf50b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf50b('0x1'));var rp=require(_0xf50b('0x2'));var moment=require('moment');var BPromise=require(_0xf50b('0x3'));var Mustache=require(_0xf50b('0x4'));var util=require('util');var path=require(_0xf50b('0x5'));var sox=require('sox');var csv=require(_0xf50b('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf50b('0x7'));var _=require(_0xf50b('0x8'));var squel=require(_0xf50b('0x9'));var crypto=require('crypto');var jsforce=require(_0xf50b('0xa'));var deskjs=require(_0xf50b('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf50b('0xc'));var qs=require(_0xf50b('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf50b('0xe'));var logger=require('../../config/logger')(_0xf50b('0xf'));var utils=require(_0xf50b('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0xf50b('0x11'));var db=require(_0xf50b('0x12'))['db'];var dbH=require('../../mysqldb')[_0xf50b('0x13')];function respondWithStatusCode(_0x420701,_0x12ce91){_0x12ce91=_0x12ce91||0xcc;return function(_0x2cf201){if(_0x2cf201){return _0x420701['sendStatus'](_0x12ce91);}return _0x420701[_0xf50b('0x14')](_0x12ce91)[_0xf50b('0x15')]();};}function respondWithResult(_0x405f94,_0x4e28c7){_0x4e28c7=_0x4e28c7||0xc8;return function(_0x5cf90c){if(_0x5cf90c){return _0x405f94['status'](_0x4e28c7)[_0xf50b('0x16')](_0x5cf90c);}};}function respondWithFilteredResult(_0x4c041d,_0x19460c){return function(_0x39b90f){if(_0x39b90f){var _0x6b3d2d=typeof _0x19460c[_0xf50b('0x17')]==='undefined'&&typeof _0x19460c['limit']===_0xf50b('0x18');var _0x4fbf00=_0x39b90f['count'];var _0x43ad41=_0x6b3d2d?0x0:_0x19460c[_0xf50b('0x17')];var _0x159e70=_0x6b3d2d?_0x39b90f[_0xf50b('0x19')]:_0x19460c['offset']+_0x19460c['limit'];var _0x10f1f4;if(_0x159e70>=_0x4fbf00){_0x159e70=_0x4fbf00;_0x10f1f4=0xc8;}else{_0x10f1f4=0xce;}_0x4c041d['status'](_0x10f1f4);return _0x4c041d[_0xf50b('0x1a')](_0xf50b('0x1b'),_0x43ad41+'-'+_0x159e70+'/'+_0x4fbf00)[_0xf50b('0x16')](_0x39b90f);}return null;};}function patchUpdates(_0x43a8a2){return function(_0x26912b){try{jsonpatch[_0xf50b('0x1c')](_0x26912b,_0x43a8a2,!![]);}catch(_0x217451){return BPromise[_0xf50b('0x1d')](_0x217451);}return _0x26912b[_0xf50b('0x1e')]();};}function saveUpdates(_0x5121fd,_0x12d6e5){return function(_0xf7a4d3){if(_0xf7a4d3){return _0xf7a4d3[_0xf50b('0x1f')](_0x5121fd)[_0xf50b('0x20')](function(_0x1572c9){return _0x1572c9;});}return null;};}function removeEntity(_0x3a0df9,_0x4a23e9){return function(_0x3942fb){if(_0x3942fb){return _0x3942fb[_0xf50b('0x21')]()['then'](function(){var _0x531399=_0x3942fb[_0xf50b('0x22')]({'plain':!![]});var _0x50f773=_0xf50b('0x23');return db['UserProfileResource'][_0xf50b('0x21')]({'where':{'type':_0x50f773,'resourceId':_0x531399['id']}})[_0xf50b('0x20')](function(){return _0x3942fb;});})['then'](function(){_0x3a0df9[_0xf50b('0x14')](0xcc)[_0xf50b('0x15')]();});}};}function handleEntityNotFound(_0xc9c5a6,_0x532367){return function(_0x33a55e){if(!_0x33a55e){_0xc9c5a6[_0xf50b('0x24')](0x194);}return _0x33a55e;};}function handleError(_0xf2dfac,_0x2997b9){_0x2997b9=_0x2997b9||0x1f4;return function(_0x5e4c29){logger['error'](_0x5e4c29[_0xf50b('0x25')]);if(_0x5e4c29['name']){delete _0x5e4c29[_0xf50b('0x26')];}_0xf2dfac[_0xf50b('0x14')](_0x2997b9)[_0xf50b('0x27')](_0x5e4c29);};}exports[_0xf50b('0x28')]=function(_0x4ec50d,_0x3c1666){var _0x4446f0={},_0x58a132={},_0x4978bb={'count':0x0,'rows':[]};var _0xec921a=_[_0xf50b('0x29')](db[_0xf50b('0x2a')][_0xf50b('0x2b')],function(_0x5315f0){return{'name':_0x5315f0['fieldName'],'type':_0x5315f0[_0xf50b('0x2c')][_0xf50b('0x2d')]};});_0x58a132[_0xf50b('0x2e')]=_[_0xf50b('0x29')](_0xec921a,'name');_0x58a132[_0xf50b('0x2f')]=_[_0xf50b('0x30')](_0x4ec50d[_0xf50b('0x2f')]);_0x58a132[_0xf50b('0x31')]=_[_0xf50b('0x32')](_0x58a132['model'],_0x58a132[_0xf50b('0x2f')]);_0x4446f0[_0xf50b('0x33')]=_[_0xf50b('0x32')](_0x58a132[_0xf50b('0x2e')],qs[_0xf50b('0x34')](_0x4ec50d['query'][_0xf50b('0x34')]));_0x4446f0[_0xf50b('0x33')]=_0x4446f0['attributes'][_0xf50b('0x35')]?_0x4446f0[_0xf50b('0x33')]:_0x58a132[_0xf50b('0x2e')];if(!_0x4ec50d[_0xf50b('0x2f')]['hasOwnProperty'](_0xf50b('0x36'))){_0x4446f0[_0xf50b('0x37')]=qs[_0xf50b('0x37')](_0x4ec50d[_0xf50b('0x2f')][_0xf50b('0x37')]);_0x4446f0['offset']=qs[_0xf50b('0x17')](_0x4ec50d[_0xf50b('0x2f')]['offset']);}_0x4446f0[_0xf50b('0x38')]=qs[_0xf50b('0x39')](_0x4ec50d[_0xf50b('0x2f')][_0xf50b('0x39')]);_0x4446f0[_0xf50b('0x3a')]=qs[_0xf50b('0x31')](_[_0xf50b('0x3b')](_0x4ec50d['query'],_0x58a132['filters']),_0xec921a);if(_0x4ec50d[_0xf50b('0x2f')][_0xf50b('0x3c')]){_0x4446f0['where']=_['merge'](_0x4446f0[_0xf50b('0x3a')],{'$or':_['map'](_0xec921a,function(_0x4394e2){if(_0x4394e2[_0xf50b('0x2c')]!==_0xf50b('0x3d')){var _0x4375f7={};_0x4375f7[_0x4394e2['name']]={'$like':'%'+_0x4ec50d['query'][_0xf50b('0x3c')]+'%'};return _0x4375f7;}})});}_0x4446f0=_[_0xf50b('0x3e')]({},_0x4446f0,_0x4ec50d[_0xf50b('0x3f')]);var _0x940983={'where':_0x4446f0[_0xf50b('0x3a')]};return db['AnalyticCustomReport']['count'](_0x940983)[_0xf50b('0x20')](function(_0x421699){_0x4978bb[_0xf50b('0x19')]=_0x421699;if(_0x4ec50d[_0xf50b('0x2f')][_0xf50b('0x40')]){_0x4446f0[_0xf50b('0x41')]=[{'all':!![]}];}return db[_0xf50b('0x2a')]['findAll'](_0x4446f0);})[_0xf50b('0x20')](function(_0x263738){_0x4978bb[_0xf50b('0x42')]=_0x263738;return _0x4978bb;})['then'](respondWithFilteredResult(_0x3c1666,_0x4446f0))[_0xf50b('0x43')](handleError(_0x3c1666,null));};exports[_0xf50b('0x44')]=function(_0x593df2,_0x50d812){var _0x1e4b1f={'raw':![],'where':{'id':_0x593df2[_0xf50b('0x45')]['id']}},_0x1a6fd6={};_0x1a6fd6['model']=_[_0xf50b('0x30')](db['AnalyticCustomReport'][_0xf50b('0x2b')]);_0x1a6fd6['query']=_[_0xf50b('0x30')](_0x593df2[_0xf50b('0x2f')]);_0x1a6fd6[_0xf50b('0x31')]=_[_0xf50b('0x32')](_0x1a6fd6['model'],_0x1a6fd6['query']);_0x1e4b1f[_0xf50b('0x33')]=_[_0xf50b('0x32')](_0x1a6fd6[_0xf50b('0x2e')],qs[_0xf50b('0x34')](_0x593df2[_0xf50b('0x2f')][_0xf50b('0x34')]));_0x1e4b1f[_0xf50b('0x33')]=_0x1e4b1f[_0xf50b('0x33')][_0xf50b('0x35')]?_0x1e4b1f[_0xf50b('0x33')]:_0x1a6fd6[_0xf50b('0x2e')];if(_0x593df2['query']['includeAll']){_0x1e4b1f[_0xf50b('0x41')]=[{'all':!![]}];}_0x1e4b1f=_[_0xf50b('0x3e')]({},_0x1e4b1f,_0x593df2[_0xf50b('0x3f')]);return db['AnalyticCustomReport']['find'](_0x1e4b1f)['then'](handleEntityNotFound(_0x50d812,null))['then'](respondWithResult(_0x50d812,null))[_0xf50b('0x43')](handleError(_0x50d812,null));};exports['create']=function(_0x12030d,_0x3e8175){return db[_0xf50b('0x2a')]['create'](_0x12030d[_0xf50b('0x46')],{})[_0xf50b('0x20')](function(_0x402207){var _0x3fc592=_0x12030d[_0xf50b('0x47')][_0xf50b('0x22')]({'plain':!![]});if(!_0x3fc592)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3fc592[_0xf50b('0x48')]==='user'){var _0x32391e=_0x402207[_0xf50b('0x22')]({'plain':!![]});var _0x5e9f25=_0xf50b('0x49');return db['UserProfileSection'][_0xf50b('0x4a')]({'where':{'name':_0x5e9f25,'userProfileId':_0x3fc592['userProfileId']},'raw':!![]})[_0xf50b('0x20')](function(_0x57de5e){if(_0x57de5e&&_0x57de5e[_0xf50b('0x4b')]===0x0){return db[_0xf50b('0x4c')][_0xf50b('0x4d')]({'name':_0x32391e[_0xf50b('0x26')],'resourceId':_0x32391e['id'],'type':'CustomReports','sectionId':_0x57de5e['id']},{})['then'](function(){return _0x402207;});}else{return _0x402207;}})['catch'](function(_0x2d456a){logger[_0xf50b('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2d456a);throw _0x2d456a;});}return _0x402207;})[_0xf50b('0x20')](respondWithResult(_0x3e8175,0xc9))[_0xf50b('0x43')](handleError(_0x3e8175,null));};exports[_0xf50b('0x1f')]=function(_0x4e247a,_0x292b4d){if(_0x4e247a[_0xf50b('0x46')]['id']){delete _0x4e247a[_0xf50b('0x46')]['id'];}return db['AnalyticCustomReport'][_0xf50b('0x4a')]({'where':{'id':_0x4e247a[_0xf50b('0x45')]['id']}})[_0xf50b('0x20')](handleEntityNotFound(_0x292b4d,null))[_0xf50b('0x20')](saveUpdates(_0x4e247a[_0xf50b('0x46')],null))[_0xf50b('0x20')](respondWithResult(_0x292b4d,null))[_0xf50b('0x43')](handleError(_0x292b4d,null));};exports[_0xf50b('0x21')]=function(_0x2e798a,_0xeec22d){return db[_0xf50b('0x2a')][_0xf50b('0x4a')]({'where':{'id':_0x2e798a[_0xf50b('0x45')]['id']}})['then'](handleEntityNotFound(_0xeec22d,null))[_0xf50b('0x20')](removeEntity(_0xeec22d,null))['catch'](handleError(_0xeec22d,null));};exports['preview']=function(_0xbe4791,_0x2ee0ac){var _0xc43bfa=0xa;var _0xf19fec=['join','left_join','right_join',_0xf50b('0x4f')];var _0x56695e={'SUM':_0xf50b('0x50'),'COUNT':_0xf50b('0x51'),'COUNT DISTINCT':_0xf50b('0x52'),'MAX':_0xf50b('0x53'),'MIN':'MIN(%s)','AVG':_0xf50b('0x54'),'GROUP_CONCAT':_0xf50b('0x55'),'GROUP_CONCAT ASC':_0xf50b('0x56'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xa358fc={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xf50b('0x57'),'HOUR':_0xf50b('0x58'),'ROUND':_0xf50b('0x59'),'UNIX_TIMESTAMP':_0xf50b('0x5a')};var _0x2d9ef2=function(_0x4d5180){return!_['includes']([_0xf50b('0x5b'),_0xf50b('0x5c'),_0xf50b('0x5d'),_0xf50b('0x5e')],_0x4d5180);};var _0x3174c9=function(_0x42fb77){if(!_0x42fb77||!_0x42fb77[_0xf50b('0x5f')][_0xf50b('0x35')]){return'';}for(var _0x309dee='(',_0x12ba67=0x0;_0x12ba67<_0x42fb77['rules'][_0xf50b('0x35')];_0x12ba67+=0x1){_0x12ba67>0x0&&(_0x309dee+='\x20'+_0x42fb77['operator']+'\x20');_0x309dee+=_0x42fb77[_0xf50b('0x5f')][_0x12ba67][_0xf50b('0x60')]?_0x3174c9(_0x42fb77[_0xf50b('0x5f')][_0x12ba67]['group']):_0x42fb77[_0xf50b('0x5f')][_0x12ba67][_0xf50b('0x61')]+'\x20'+_0x42fb77['rules'][_0x12ba67][_0xf50b('0x62')]+(_0x2d9ef2(_0x42fb77[_0xf50b('0x5f')][_0x12ba67][_0xf50b('0x62')])?'\x20'+_0x42fb77[_0xf50b('0x5f')][_0x12ba67][_0xf50b('0x63')]:'');}return _0x309dee+')';};var _0x4ed0a9={'where':{'id':_0xbe4791[_0xf50b('0x45')]['id']}},_0x3c0a07,_0x1e1ca4,_0x1c126d,_0x6ad1c,_0x444f16;_0x4ed0a9=_[_0xf50b('0x3e')]({},_0x4ed0a9,_0xbe4791[_0xf50b('0x3f')]);return db[_0xf50b('0x2a')]['find'](_0x4ed0a9)[_0xf50b('0x20')](function(_0x456cdc){if(_0x456cdc){_0x3c0a07=_0x456cdc;return _0x456cdc['getFields']();}return null;})['then'](function(_0x192e51){if(_0x192e51){if(!_0x192e51[_0xf50b('0x35')]){throw new db[(_0xf50b('0x64'))][(_0xf50b('0x65'))](_0xf50b('0x66'),0x193);}_0x1e1ca4=_0x192e51;return db[_0xf50b('0x67')][_0xf50b('0x68')]({'raw':!![]});}return null;})[_0xf50b('0x20')](function(_0x3fee9d){if(_0x3fee9d){_0x1c126d=_[_0xf50b('0x69')](_0x3fee9d,'id');var _0x5d3b31;var _0x203169=squel[_0xf50b('0x6a')]();_0x203169[_0xf50b('0x6b')](_0x3c0a07['table']);for(var _0x544bee=0x0;_0x544bee<_0x1e1ca4[_0xf50b('0x35')];_0x544bee+=0x1){_0x5d3b31=_0x1e1ca4[_0x544bee][_0xf50b('0x6c')]?_0x1c126d[_0x1e1ca4[_0x544bee][_0xf50b('0x6c')]]['metric']:_0x1e1ca4[_0x544bee][_0xf50b('0x61')];_0x5d3b31=_0x1e1ca4[_0x544bee]['function']?_[_0xf50b('0x6d')](_0x56695e[_0x1e1ca4[_0x544bee][_0xf50b('0x6e')]],'%s',_0x5d3b31):_0x5d3b31;_0x5d3b31=_0x1e1ca4[_0x544bee][_0xf50b('0x6f')]?_[_0xf50b('0x6d')](_0xa358fc[_0x1e1ca4[_0x544bee][_0xf50b('0x6f')]],'%s',_0x5d3b31):_0x5d3b31;if(_0x1e1ca4[_0x544bee]['groupBy']){_0x203169[_0xf50b('0x60')](_0x5d3b31);}_0x1e1ca4[_0x544bee][_0xf50b('0x70')]&&_0x203169[_0xf50b('0x38')](_0x5d3b31,_0x1e1ca4[_0x544bee][_0xf50b('0x70')]===_0xf50b('0x71')?![]:!![]);_0x203169[_0xf50b('0x61')](_0x5d3b31,_0x1e1ca4[_0x544bee][_0xf50b('0x72')]||_0x5d3b31);}if(_0x3c0a07[_0xf50b('0x73')]){_0x3c0a07['joins']=JSON[_0xf50b('0x74')](_0x3c0a07['joins']);for(var _0x439511=0x0;_0x439511<_0x3c0a07[_0xf50b('0x73')][_0xf50b('0x35')];_0x439511+=0x1){if(_0x3c0a07['joins'][_0x439511]['type']&&_['includes'](_0xf19fec,_0x3c0a07['joins'][_0x439511][_0xf50b('0x2c')])&&_0x3c0a07[_0xf50b('0x73')][_0x439511][_0xf50b('0x75')]&&_0x3c0a07[_0xf50b('0x73')][_0x439511][_0xf50b('0x76')]&&_0x3c0a07[_0xf50b('0x73')][_0x439511][_0xf50b('0x77')]){_0x203169[_0x3c0a07[_0xf50b('0x73')][_0x439511][_0xf50b('0x2c')]](_0x3c0a07[_0xf50b('0x73')][_0x439511][_0xf50b('0x76')],null,util[_0xf50b('0x6f')](_0xf50b('0x78'),_0x3c0a07[_0xf50b('0x79')],_0x3c0a07[_0xf50b('0x73')][_0x439511]['parentKey'],_0x3c0a07[_0xf50b('0x73')][_0x439511][_0xf50b('0x76')],_0x3c0a07[_0xf50b('0x73')][_0x439511]['foreignKey']));}}}if(_0x3c0a07[_0xf50b('0x7a')]){_0x3c0a07[_0xf50b('0x7a')]=JSON[_0xf50b('0x74')](_0x3c0a07[_0xf50b('0x7a')]);_0x203169['where'](_0x3174c9(_0x3c0a07['conditions'][_0xf50b('0x60')]));}_0x444f16=_0x203169[_0xf50b('0x7b')]();_0x203169[_0xf50b('0x37')](_0xc43bfa);_0x203169[_0xf50b('0x17')](0x0);logger[_0xf50b('0x7c')](_0xf50b('0x7d'),_0x203169['toString']());return dbH[_0xf50b('0x7e')][_0xf50b('0x2f')](_0x203169['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0xf50b('0x7f')]});}})[_0xf50b('0x20')](respondWithResult(_0x2ee0ac,null))[_0xf50b('0x43')](handleError(_0x2ee0ac,null));};function runReport(_0x34e1bf,_0x42aa44,_0xb84e51){var _0x44aa76=_0x42aa44[_0xf50b('0x26')];var _0x59fca5=0xa;var _0x4e748b=[_0xf50b('0x80'),'left_join',_0xf50b('0x81'),_0xf50b('0x4f')];var _0x1b285c={'SUM':'SUM(%s)','COUNT':_0xf50b('0x51'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xf50b('0x53'),'MIN':'MIN(%s)','AVG':_0xf50b('0x54'),'GROUP_CONCAT':_0xf50b('0x55'),'GROUP_CONCAT ASC':_0xf50b('0x56'),'GROUP_CONCAT DESC':_0xf50b('0x82')};var _0x1eeb53={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xf50b('0x57'),'HOUR':_0xf50b('0x58'),'ROUND':_0xf50b('0x59'),'UNIX_TIMESTAMP':_0xf50b('0x5a')};var _0x6fd21b=function(_0x146ab7){return!_[_0xf50b('0x83')]([_0xf50b('0x5b'),_0xf50b('0x5c'),_0xf50b('0x5d'),_0xf50b('0x5e')],_0x146ab7);};var _0x317190=function(_0xe2b562){if(!_0xe2b562||!_0xe2b562[_0xf50b('0x5f')][_0xf50b('0x35')]){return'';}for(var _0x1eac4c='(',_0xc2719e=0x0;_0xc2719e<_0xe2b562['rules'][_0xf50b('0x35')];_0xc2719e+=0x1){_0xc2719e>0x0&&(_0x1eac4c+='\x20'+_0xe2b562[_0xf50b('0x84')]+'\x20');_0x1eac4c+=_0xe2b562['rules'][_0xc2719e]['group']?_0x317190(_0xe2b562['rules'][_0xc2719e]['group']):_0xe2b562[_0xf50b('0x5f')][_0xc2719e][_0xf50b('0x61')]+'\x20'+_0xe2b562[_0xf50b('0x5f')][_0xc2719e]['condition']+(_0x6fd21b(_0xe2b562[_0xf50b('0x5f')][_0xc2719e]['condition'])?'\x20'+_0xe2b562['rules'][_0xc2719e][_0xf50b('0x63')]:'');}return _0x1eac4c+')';};var _0xf829f1={'where':{'id':_0x34e1bf['id']}},_0x3f72c0,_0x5212c3,_0x28da62,_0x16f384,_0xedc329;_0xf829f1=_[_0xf50b('0x3e')]({},_0xf829f1,_0xb84e51);return db[_0xf50b('0x2a')][_0xf50b('0x4a')](_0xf829f1)[_0xf50b('0x20')](function(_0x551be7){if(_0x551be7){_0x3f72c0=_0x551be7;return _0x551be7[_0xf50b('0x85')]();}return null;})['then'](function(_0xdfe0c8){if(_0xdfe0c8){if(!_0xdfe0c8['length']){throw new db[(_0xf50b('0x64'))][(_0xf50b('0x65'))](_0xf50b('0x66'),0x193);}_0x5212c3=_0xdfe0c8;return db[_0xf50b('0x67')]['findAll']({'raw':!![]});}return null;})[_0xf50b('0x20')](function(_0x2dc994){if(_0x2dc994){_0x28da62=_['keyBy'](_0x2dc994,'id');var _0x226bf4;var _0x155ba3=squel[_0xf50b('0x6a')]();_0x155ba3[_0xf50b('0x6b')](_0x3f72c0[_0xf50b('0x79')]);for(var _0x24395b=0x0;_0x24395b<_0x5212c3[_0xf50b('0x35')];_0x24395b+=0x1){_0x226bf4=_0x5212c3[_0x24395b][_0xf50b('0x6c')]?_0x28da62[_0x5212c3[_0x24395b]['MetricId']][_0xf50b('0x86')]:_0x5212c3[_0x24395b][_0xf50b('0x61')];_0x226bf4=_0x5212c3[_0x24395b][_0xf50b('0x6e')]?_[_0xf50b('0x6d')](_0x1b285c[_0x5212c3[_0x24395b][_0xf50b('0x6e')]],'%s',_0x226bf4):_0x226bf4;_0x226bf4=_0x5212c3[_0x24395b]['format']?_['replace'](_0x1eeb53[_0x5212c3[_0x24395b][_0xf50b('0x6f')]],'%s',_0x226bf4):_0x226bf4;if(_0x5212c3[_0x24395b][_0xf50b('0x87')]){_0x155ba3[_0xf50b('0x60')](_0x226bf4);}_0x5212c3[_0x24395b][_0xf50b('0x70')]&&_0x155ba3[_0xf50b('0x38')](_0x226bf4,_0x5212c3[_0x24395b][_0xf50b('0x70')]==='DESC'?![]:!![]);_0x155ba3[_0xf50b('0x61')](_0x226bf4,_0x5212c3[_0x24395b][_0xf50b('0x72')]||_0x226bf4);}if(_0x3f72c0[_0xf50b('0x73')]){_0x3f72c0['joins']=JSON[_0xf50b('0x74')](_0x3f72c0[_0xf50b('0x73')]);for(var _0x125821=0x0;_0x125821<_0x3f72c0['joins'][_0xf50b('0x35')];_0x125821+=0x1){if(_0x3f72c0[_0xf50b('0x73')][_0x125821][_0xf50b('0x2c')]&&_['includes'](_0x4e748b,_0x3f72c0['joins'][_0x125821][_0xf50b('0x2c')])&&_0x3f72c0[_0xf50b('0x73')][_0x125821][_0xf50b('0x75')]&&_0x3f72c0[_0xf50b('0x73')][_0x125821][_0xf50b('0x76')]&&_0x3f72c0[_0xf50b('0x73')][_0x125821][_0xf50b('0x77')]){_0x155ba3[_0x3f72c0[_0xf50b('0x73')][_0x125821][_0xf50b('0x2c')]](_0x3f72c0['joins'][_0x125821][_0xf50b('0x76')],null,util[_0xf50b('0x6f')](_0xf50b('0x78'),_0x3f72c0[_0xf50b('0x79')],_0x3f72c0[_0xf50b('0x73')][_0x125821][_0xf50b('0x75')],_0x3f72c0[_0xf50b('0x73')][_0x125821][_0xf50b('0x76')],_0x3f72c0[_0xf50b('0x73')][_0x125821][_0xf50b('0x77')]));}}}if(_0x3f72c0[_0xf50b('0x7a')]){_0x3f72c0['conditions']=JSON['parse'](_0x3f72c0[_0xf50b('0x7a')]);_0x155ba3[_0xf50b('0x3a')](_0x317190(_0x3f72c0['conditions'][_0xf50b('0x60')]));}_0xedc329=_0x155ba3[_0xf50b('0x7b')]();_0x155ba3[_0xf50b('0x37')](_0x59fca5);_0x155ba3['offset'](0x0);return;}})[_0xf50b('0x20')](function(){if(_0x42aa44[_0xf50b('0x88')]==='web'){return null;}var _0x3e0879=_[_0xf50b('0x3e')](_0x42aa44,{'name':_0x42aa44[_0xf50b('0x89')]||_0x42aa44[_0xf50b('0x26')]||_0x3f72c0[_0xf50b('0x26')],'basename':_0x44aa76,'savename':util[_0xf50b('0x6f')](_0xf50b('0x8a'),_0x42aa44[_0xf50b('0x26')]||_0x3f72c0['name'],require(_0xf50b('0x8b'))[_0xf50b('0x8c')](0x4),_0x42aa44['output']||'csv'),'reportId':_0x3f72c0['id'],'reportType':_0xf50b('0x8d')});return db[_0xf50b('0x8e')][_0xf50b('0x4d')](_0x3e0879,{'raw':!![]});})[_0xf50b('0x20')](function(_0x5c7465){if(_0x3f72c0[_0xf50b('0x79')]===_0xf50b('0x8f')){_0xedc329[_0xf50b('0x3a')](_0x3f72c0[_0xf50b('0x79')]+_0xf50b('0x90'),_0x42aa44[_0xf50b('0x91')],_0x42aa44[_0xf50b('0x92')]);}else{_0xedc329['where'](_0x3f72c0[_0xf50b('0x79')]+_0xf50b('0x93'),_0x42aa44[_0xf50b('0x91')],_0x42aa44[_0xf50b('0x92')]);}if(_0x5c7465){logger['info'](_0xf50b('0x94'),_0xedc329['toString']());require(_0xf50b('0x95'))[_0xf50b('0x96')](path[_0xf50b('0x80')](__dirname,_0xf50b('0x97'),_0x5c7465[_0xf50b('0x88')]),[_0x5c7465['id'],_0xedc329['toString'](),path['join'](__dirname,_0xf50b('0x98'),_0x5c7465[_0xf50b('0x99')]),_0x44aa76]);return _0x5c7465;}else{var _0x3c0834=squel[_0xf50b('0x6a')]();_0x3c0834[_0xf50b('0x6b')]('('+_0xedc329[_0xf50b('0x9a')]()+')',_0xf50b('0x9b'));_0x3c0834['field'](_0xf50b('0x9c'),_0xf50b('0x19'));_0xedc329[_0xf50b('0x37')](_0x42aa44[_0xf50b('0x37')]||_0x59fca5);_0xedc329['offset'](_0x42aa44[_0xf50b('0x17')]||0x0);return dbH[_0xf50b('0x7e')][_0xf50b('0x2f')](_0x3c0834['toString'](),{'type':dbH[_0xf50b('0x7e')][_0xf50b('0x9d')][_0xf50b('0x7f')]})['then'](function(_0x1e33c6){if(!_0x1e33c6['length']){_0x16f384=0x0;}else{_0x16f384=_0x1e33c6[0x0]['count']||0x0;}return dbH[_0xf50b('0x7e')][_0xf50b('0x2f')](_0xedc329[_0xf50b('0x9a')](),{'type':dbH['sequelize'][_0xf50b('0x9d')]['SELECT']});})['then'](function(_0x38d030){return{'rows':_0x38d030||[],'count':_0x16f384};});}});}exports[_0xf50b('0x9e')]=function(_0x230fd4,_0x193d94){return runReport(_0x230fd4['params'],_0x230fd4[_0xf50b('0x2f')],_0x230fd4['options'])[_0xf50b('0x20')](respondWithResult(_0x193d94,null))['catch'](handleError(_0x193d94,null));};exports['runReport']=runReport;exports[_0xf50b('0x2f')]=function(_0x40392b,_0x1bd938){var _0x526430=0xa;var _0x1786df=[_0xf50b('0x80'),_0xf50b('0x9f'),_0xf50b('0x81'),_0xf50b('0x4f')];var _0x4bcce3={'SUM':_0xf50b('0x50'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xf50b('0x52'),'MAX':'MAX(%s)','MIN':_0xf50b('0xa0'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xf50b('0x55'),'GROUP_CONCAT ASC':_0xf50b('0x56'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x10db4b={'SEC_TO_TIME':_0xf50b('0xa1'),'DATE':_0xf50b('0x57'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xf50b('0x5a')};var _0x105bcd=function(_0x85545b){return!_['includes']([_0xf50b('0x5b'),_0xf50b('0x5c'),_0xf50b('0x5d'),_0xf50b('0x5e')],_0x85545b);};var _0x31b572=function(_0x57926d){if(!_0x57926d||!_0x57926d[_0xf50b('0x5f')][_0xf50b('0x35')]){return'';}for(var _0x365c50='(',_0xeaaa3f=0x0;_0xeaaa3f<_0x57926d[_0xf50b('0x5f')][_0xf50b('0x35')];_0xeaaa3f+=0x1){_0xeaaa3f>0x0&&(_0x365c50+='\x20'+_0x57926d[_0xf50b('0x84')]+'\x20');_0x365c50+=_0x57926d[_0xf50b('0x5f')][_0xeaaa3f]['group']?_0x31b572(_0x57926d[_0xf50b('0x5f')][_0xeaaa3f]['group']):_0x57926d[_0xf50b('0x5f')][_0xeaaa3f][_0xf50b('0x61')]+'\x20'+_0x57926d[_0xf50b('0x5f')][_0xeaaa3f][_0xf50b('0x62')]+(_0x105bcd(_0x57926d[_0xf50b('0x5f')][_0xeaaa3f][_0xf50b('0x62')])?'\x20'+_0x57926d[_0xf50b('0x5f')][_0xeaaa3f][_0xf50b('0x63')]:'');}return _0x365c50+')';};var _0x4a23f3={'where':{'id':_0x40392b[_0xf50b('0x45')]['id']}},_0x3a6101,_0x135d41,_0x1a21bc,_0x415c32,_0x4d0d3e;_0x4a23f3=_[_0xf50b('0x3e')]({},_0x4a23f3,_0x40392b[_0xf50b('0x3f')]);return db[_0xf50b('0x2a')][_0xf50b('0x4a')](_0x4a23f3)[_0xf50b('0x20')](function(_0x2324d2){if(_0x2324d2){_0x3a6101=_0x2324d2;return _0x2324d2[_0xf50b('0x85')]();}return null;})[_0xf50b('0x20')](function(_0x5e6041){if(_0x5e6041){if(!_0x5e6041[_0xf50b('0x35')]){throw new db[(_0xf50b('0x64'))][(_0xf50b('0x65'))](_0xf50b('0x66'),0x193);}_0x135d41=_0x5e6041;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})['then'](function(_0x4ac860){if(_0x4ac860){_0x1a21bc=_['keyBy'](_0x4ac860,'id');var _0x2273c1;var _0x53ae15=squel[_0xf50b('0x6a')]();_0x53ae15[_0xf50b('0x6b')](_0x3a6101['table']);for(var _0x2ad825=0x0;_0x2ad825<_0x135d41[_0xf50b('0x35')];_0x2ad825+=0x1){_0x2273c1=_0x135d41[_0x2ad825]['MetricId']?_0x1a21bc[_0x135d41[_0x2ad825][_0xf50b('0x6c')]]['metric']:_0x135d41[_0x2ad825][_0xf50b('0x61')];_0x2273c1=_0x135d41[_0x2ad825]['function']?_['replace'](_0x4bcce3[_0x135d41[_0x2ad825][_0xf50b('0x6e')]],'%s',_0x2273c1):_0x2273c1;_0x2273c1=_0x135d41[_0x2ad825]['format']?_[_0xf50b('0x6d')](_0x10db4b[_0x135d41[_0x2ad825][_0xf50b('0x6f')]],'%s',_0x2273c1):_0x2273c1;if(_0x135d41[_0x2ad825][_0xf50b('0x87')]){_0x53ae15[_0xf50b('0x60')](_0x2273c1);}_0x135d41[_0x2ad825][_0xf50b('0x70')]&&_0x53ae15[_0xf50b('0x38')](_0x2273c1,_0x135d41[_0x2ad825][_0xf50b('0x70')]===_0xf50b('0x71')?![]:!![]);_0x53ae15['field'](_0x2273c1,_0x135d41[_0x2ad825][_0xf50b('0x72')]||_0x2273c1);}if(_0x3a6101[_0xf50b('0x73')]){_0x3a6101[_0xf50b('0x73')]=JSON[_0xf50b('0x74')](_0x3a6101['joins']);for(var _0x572e0a=0x0;_0x572e0a<_0x3a6101[_0xf50b('0x73')][_0xf50b('0x35')];_0x572e0a+=0x1){if(_0x3a6101['joins'][_0x572e0a][_0xf50b('0x2c')]&&_[_0xf50b('0x83')](_0x1786df,_0x3a6101[_0xf50b('0x73')][_0x572e0a][_0xf50b('0x2c')])&&_0x3a6101[_0xf50b('0x73')][_0x572e0a]['parentKey']&&_0x3a6101['joins'][_0x572e0a]['foreignTable']&&_0x3a6101[_0xf50b('0x73')][_0x572e0a][_0xf50b('0x77')]){_0x53ae15[_0x3a6101[_0xf50b('0x73')][_0x572e0a][_0xf50b('0x2c')]](_0x3a6101[_0xf50b('0x73')][_0x572e0a][_0xf50b('0x76')],null,util[_0xf50b('0x6f')]('%s.%s\x20=\x20%s.%s',_0x3a6101[_0xf50b('0x79')],_0x3a6101['joins'][_0x572e0a][_0xf50b('0x75')],_0x3a6101[_0xf50b('0x73')][_0x572e0a][_0xf50b('0x76')],_0x3a6101['joins'][_0x572e0a][_0xf50b('0x77')]));}}}if(_0x3a6101[_0xf50b('0x7a')]){_0x3a6101[_0xf50b('0x7a')]=JSON[_0xf50b('0x74')](_0x3a6101[_0xf50b('0x7a')]);_0x53ae15[_0xf50b('0x3a')](_0x31b572(_0x3a6101[_0xf50b('0x7a')][_0xf50b('0x60')]));}_0x4d0d3e=_0x53ae15[_0xf50b('0x7b')]();_0x53ae15['limit'](_0x526430);_0x53ae15[_0xf50b('0x17')](0x0);logger[_0xf50b('0x7c')](_0xf50b('0x7d'),_0x53ae15['toString']());return dbH['sequelize'][_0xf50b('0x2f')](_0x53ae15[_0xf50b('0x9a')](),{'type':dbH['sequelize'][_0xf50b('0x9d')][_0xf50b('0x7f')]});}})[_0xf50b('0x20')](function(){return{'sql':_0x4d0d3e[_0xf50b('0x9a')]()};})[_0xf50b('0x20')](respondWithResult(_0x1bd938,null))['catch'](handleError(_0x1bd938,null));}; \ No newline at end of file +var _0xd3c5=['squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','end','offset','undefined','count','set','Content-Range','apply','reject','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','AnalyticCustomReport','includeAll','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','join','right_join','COUNT(%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','options','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','select','from','table','MetricId','replace','function','groupBy','orderBy','DESC','alias','joins','includes','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey','conditions','parse','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','SUM(%s)','MIN(%s)','GROUP_CONCAT(%s)','DATE(%s)','value','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','metric','format','output','web','fullPath','randomstring','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)','runReport','left_join','COUNT(DISTINCT\x20%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20EMPTY','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','lodash'];(function(_0x3fa694,_0x477066){var _0x5d345c=function(_0x43d71f){while(--_0x43d71f){_0x3fa694['push'](_0x3fa694['shift']());}};_0x5d345c(++_0x477066);}(_0xd3c5,0x9a));var _0x5d3c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd3c5[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x5d3c('0x0'));var rimraf=require(_0x5d3c('0x1'));var zipdir=require(_0x5d3c('0x2'));var jsonpatch=require(_0x5d3c('0x3'));var rp=require(_0x5d3c('0x4'));var moment=require(_0x5d3c('0x5'));var BPromise=require(_0x5d3c('0x6'));var Mustache=require(_0x5d3c('0x7'));var util=require('util');var path=require(_0x5d3c('0x8'));var sox=require(_0x5d3c('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5d3c('0xa'));var squel=require(_0x5d3c('0xb'));var crypto=require(_0x5d3c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5d3c('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5d3c('0xe'));var Papa=require(_0x5d3c('0xf'));var Redis=require(_0x5d3c('0x10'));var authService=require(_0x5d3c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x5d3c('0x12'));var hardwareService=require(_0x5d3c('0x13'));var logger=require('../../config/logger')(_0x5d3c('0x14'));var utils=require(_0x5d3c('0x15'));var config=require(_0x5d3c('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5d3c('0x17'))['db'];var dbH=require(_0x5d3c('0x17'))[_0x5d3c('0x18')];function respondWithStatusCode(_0x5cad02,_0x140722){_0x140722=_0x140722||0xcc;return function(_0x12340b){if(_0x12340b){return _0x5cad02[_0x5d3c('0x19')](_0x140722);}return _0x5cad02[_0x5d3c('0x1a')](_0x140722)[_0x5d3c('0x1b')]();};}function respondWithResult(_0x2c2116,_0x11cb51){_0x11cb51=_0x11cb51||0xc8;return function(_0x328309){if(_0x328309){return _0x2c2116[_0x5d3c('0x1a')](_0x11cb51)['json'](_0x328309);}};}function respondWithFilteredResult(_0xcbf8e2,_0x47c114){return function(_0x411896){if(_0x411896){var _0x13e44f=typeof _0x47c114[_0x5d3c('0x1c')]===_0x5d3c('0x1d')&&typeof _0x47c114['limit']===_0x5d3c('0x1d');var _0x6ba636=_0x411896[_0x5d3c('0x1e')];var _0x1bcf40=_0x13e44f?0x0:_0x47c114['offset'];var _0x508915=_0x13e44f?_0x411896[_0x5d3c('0x1e')]:_0x47c114['offset']+_0x47c114['limit'];var _0x20ed36;if(_0x508915>=_0x6ba636){_0x508915=_0x6ba636;_0x20ed36=0xc8;}else{_0x20ed36=0xce;}_0xcbf8e2[_0x5d3c('0x1a')](_0x20ed36);return _0xcbf8e2[_0x5d3c('0x1f')](_0x5d3c('0x20'),_0x1bcf40+'-'+_0x508915+'/'+_0x6ba636)['json'](_0x411896);}return null;};}function patchUpdates(_0x119a82){return function(_0x34c9f8){try{jsonpatch[_0x5d3c('0x21')](_0x34c9f8,_0x119a82,!![]);}catch(_0x3b1bd6){return BPromise[_0x5d3c('0x22')](_0x3b1bd6);}return _0x34c9f8['save']();};}function saveUpdates(_0xcde6bf,_0x48b6cc){return function(_0x26ca92){if(_0x26ca92){return _0x26ca92['update'](_0xcde6bf)[_0x5d3c('0x23')](function(_0x1bdd10){return _0x1bdd10;});}return null;};}function removeEntity(_0x35d03b,_0x2eff95){return function(_0x3ab5e3){if(_0x3ab5e3){return _0x3ab5e3[_0x5d3c('0x24')]()[_0x5d3c('0x23')](function(){var _0x276000=_0x3ab5e3[_0x5d3c('0x25')]({'plain':!![]});var _0x204777='CustomReports';return db[_0x5d3c('0x26')][_0x5d3c('0x24')]({'where':{'type':_0x204777,'resourceId':_0x276000['id']}})[_0x5d3c('0x23')](function(){return _0x3ab5e3;});})[_0x5d3c('0x23')](function(){_0x35d03b[_0x5d3c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x220b4c,_0x5a3d29){return function(_0x43acd0){if(!_0x43acd0){_0x220b4c['sendStatus'](0x194);}return _0x43acd0;};}function handleError(_0x1d01f9,_0x3c3006){_0x3c3006=_0x3c3006||0x1f4;return function(_0x5bf3d6){logger[_0x5d3c('0x27')](_0x5bf3d6[_0x5d3c('0x28')]);if(_0x5bf3d6[_0x5d3c('0x29')]){delete _0x5bf3d6[_0x5d3c('0x29')];}_0x1d01f9['status'](_0x3c3006)[_0x5d3c('0x2a')](_0x5bf3d6);};}exports[_0x5d3c('0x2b')]=function(_0x14e0fd,_0x2a16a3){var _0x562a5c={},_0x18c16c={},_0x4666c6={'count':0x0,'rows':[]};var _0x158777=_[_0x5d3c('0x2c')](db['AnalyticCustomReport'][_0x5d3c('0x2d')],function(_0x5afc2f){return{'name':_0x5afc2f[_0x5d3c('0x2e')],'type':_0x5afc2f[_0x5d3c('0x2f')][_0x5d3c('0x30')]};});_0x18c16c['model']=_[_0x5d3c('0x2c')](_0x158777,_0x5d3c('0x29'));_0x18c16c[_0x5d3c('0x31')]=_[_0x5d3c('0x32')](_0x14e0fd[_0x5d3c('0x31')]);_0x18c16c[_0x5d3c('0x33')]=_[_0x5d3c('0x34')](_0x18c16c[_0x5d3c('0x35')],_0x18c16c[_0x5d3c('0x31')]);_0x562a5c[_0x5d3c('0x36')]=_['intersection'](_0x18c16c[_0x5d3c('0x35')],qs[_0x5d3c('0x37')](_0x14e0fd[_0x5d3c('0x31')][_0x5d3c('0x37')]));_0x562a5c['attributes']=_0x562a5c[_0x5d3c('0x36')][_0x5d3c('0x38')]?_0x562a5c[_0x5d3c('0x36')]:_0x18c16c[_0x5d3c('0x35')];if(!_0x14e0fd[_0x5d3c('0x31')][_0x5d3c('0x39')](_0x5d3c('0x3a'))){_0x562a5c[_0x5d3c('0x3b')]=qs['limit'](_0x14e0fd['query']['limit']);_0x562a5c[_0x5d3c('0x1c')]=qs[_0x5d3c('0x1c')](_0x14e0fd[_0x5d3c('0x31')][_0x5d3c('0x1c')]);}_0x562a5c[_0x5d3c('0x3c')]=qs[_0x5d3c('0x3d')](_0x14e0fd[_0x5d3c('0x31')][_0x5d3c('0x3d')]);_0x562a5c[_0x5d3c('0x3e')]=qs[_0x5d3c('0x33')](_[_0x5d3c('0x3f')](_0x14e0fd['query'],_0x18c16c[_0x5d3c('0x33')]),_0x158777);if(_0x14e0fd[_0x5d3c('0x31')][_0x5d3c('0x40')]){_0x562a5c[_0x5d3c('0x3e')]=_[_0x5d3c('0x41')](_0x562a5c['where'],{'$or':_[_0x5d3c('0x2c')](_0x158777,function(_0x581cec){if(_0x581cec['type']!==_0x5d3c('0x42')){var _0x3c1c10={};_0x3c1c10[_0x581cec[_0x5d3c('0x29')]]={'$like':'%'+_0x14e0fd[_0x5d3c('0x31')][_0x5d3c('0x40')]+'%'};return _0x3c1c10;}})});}_0x562a5c=_[_0x5d3c('0x41')]({},_0x562a5c,_0x14e0fd['options']);var _0x75e500={'where':_0x562a5c[_0x5d3c('0x3e')]};return db[_0x5d3c('0x43')]['count'](_0x75e500)[_0x5d3c('0x23')](function(_0xb06b64){_0x4666c6['count']=_0xb06b64;if(_0x14e0fd[_0x5d3c('0x31')][_0x5d3c('0x44')]){_0x562a5c[_0x5d3c('0x45')]=[{'all':!![]}];}return db[_0x5d3c('0x43')][_0x5d3c('0x46')](_0x562a5c);})['then'](function(_0x841d24){_0x4666c6[_0x5d3c('0x47')]=_0x841d24;return _0x4666c6;})[_0x5d3c('0x23')](respondWithFilteredResult(_0x2a16a3,_0x562a5c))[_0x5d3c('0x48')](handleError(_0x2a16a3,null));};exports[_0x5d3c('0x49')]=function(_0x9d3dcc,_0x37e627){var _0x41480c={'raw':![],'where':{'id':_0x9d3dcc[_0x5d3c('0x4a')]['id']}},_0x1cfbb3={};_0x1cfbb3[_0x5d3c('0x35')]=_[_0x5d3c('0x32')](db[_0x5d3c('0x43')][_0x5d3c('0x2d')]);_0x1cfbb3['query']=_[_0x5d3c('0x32')](_0x9d3dcc[_0x5d3c('0x31')]);_0x1cfbb3[_0x5d3c('0x33')]=_[_0x5d3c('0x34')](_0x1cfbb3[_0x5d3c('0x35')],_0x1cfbb3[_0x5d3c('0x31')]);_0x41480c[_0x5d3c('0x36')]=_[_0x5d3c('0x34')](_0x1cfbb3[_0x5d3c('0x35')],qs[_0x5d3c('0x37')](_0x9d3dcc[_0x5d3c('0x31')][_0x5d3c('0x37')]));_0x41480c[_0x5d3c('0x36')]=_0x41480c[_0x5d3c('0x36')]['length']?_0x41480c[_0x5d3c('0x36')]:_0x1cfbb3['model'];if(_0x9d3dcc[_0x5d3c('0x31')]['includeAll']){_0x41480c[_0x5d3c('0x45')]=[{'all':!![]}];}_0x41480c=_[_0x5d3c('0x41')]({},_0x41480c,_0x9d3dcc['options']);return db['AnalyticCustomReport'][_0x5d3c('0x4b')](_0x41480c)[_0x5d3c('0x23')](handleEntityNotFound(_0x37e627,null))[_0x5d3c('0x23')](respondWithResult(_0x37e627,null))[_0x5d3c('0x48')](handleError(_0x37e627,null));};exports[_0x5d3c('0x4c')]=function(_0x4b1e0f,_0x1eea9d){return db[_0x5d3c('0x43')][_0x5d3c('0x4c')](_0x4b1e0f['body'],{})['then'](function(_0xd383ae){var _0x5bd284=_0x4b1e0f[_0x5d3c('0x4d')]['get']({'plain':!![]});if(!_0x5bd284)throw new Error(_0x5d3c('0x4e'));if(_0x5bd284[_0x5d3c('0x4f')]===_0x5d3c('0x4d')){var _0x4db062=_0xd383ae[_0x5d3c('0x25')]({'plain':!![]});var _0x3f8f4f='Reports';return db['UserProfileSection'][_0x5d3c('0x4b')]({'where':{'name':_0x3f8f4f,'userProfileId':_0x5bd284[_0x5d3c('0x50')]},'raw':!![]})['then'](function(_0x207acb){if(_0x207acb&&_0x207acb['autoAssociation']===0x0){return db[_0x5d3c('0x26')][_0x5d3c('0x4c')]({'name':_0x4db062[_0x5d3c('0x29')],'resourceId':_0x4db062['id'],'type':'CustomReports','sectionId':_0x207acb['id']},{})['then'](function(){return _0xd383ae;});}else{return _0xd383ae;}})[_0x5d3c('0x48')](function(_0x3937ac){logger[_0x5d3c('0x27')](_0x5d3c('0x51'),_0x3937ac);throw _0x3937ac;});}return _0xd383ae;})[_0x5d3c('0x23')](respondWithResult(_0x1eea9d,0xc9))[_0x5d3c('0x48')](handleError(_0x1eea9d,null));};exports[_0x5d3c('0x52')]=function(_0x2cf5fa,_0x41d1c9){if(_0x2cf5fa[_0x5d3c('0x53')]['id']){delete _0x2cf5fa[_0x5d3c('0x53')]['id'];}return db['AnalyticCustomReport'][_0x5d3c('0x4b')]({'where':{'id':_0x2cf5fa[_0x5d3c('0x4a')]['id']}})[_0x5d3c('0x23')](handleEntityNotFound(_0x41d1c9,null))['then'](saveUpdates(_0x2cf5fa[_0x5d3c('0x53')],null))[_0x5d3c('0x23')](respondWithResult(_0x41d1c9,null))[_0x5d3c('0x48')](handleError(_0x41d1c9,null));};exports[_0x5d3c('0x24')]=function(_0xf0556a,_0x54ff16){return db[_0x5d3c('0x43')][_0x5d3c('0x4b')]({'where':{'id':_0xf0556a[_0x5d3c('0x4a')]['id']}})[_0x5d3c('0x23')](handleEntityNotFound(_0x54ff16,null))[_0x5d3c('0x23')](removeEntity(_0x54ff16,null))[_0x5d3c('0x48')](handleError(_0x54ff16,null));};exports['preview']=function(_0x29335d,_0x594966){var _0x69e8ed=0xa;var _0x12db24=[_0x5d3c('0x54'),'left_join',_0x5d3c('0x55'),'cross_join'];var _0x3fa2ec={'SUM':'SUM(%s)','COUNT':_0x5d3c('0x56'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x5d3c('0x57'),'MIN':'MIN(%s)','AVG':_0x5d3c('0x58'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x5d3c('0x59'),'GROUP_CONCAT DESC':_0x5d3c('0x5a')};var _0x568be1={'SEC_TO_TIME':_0x5d3c('0x5b'),'DATE':'DATE(%s)','HOUR':_0x5d3c('0x5c'),'ROUND':_0x5d3c('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x34cbc3=function(_0x41618f){return!_['includes']([_0x5d3c('0x5e'),_0x5d3c('0x5f'),_0x5d3c('0x60'),'IS\x20NOT\x20EMPTY'],_0x41618f);};var _0x4a52db=function(_0x5d2ddd){if(!_0x5d2ddd||!_0x5d2ddd['rules'][_0x5d3c('0x38')]){return'';}for(var _0x2799ba='(',_0x3ff7eb=0x0;_0x3ff7eb<_0x5d2ddd[_0x5d3c('0x61')][_0x5d3c('0x38')];_0x3ff7eb+=0x1){_0x3ff7eb>0x0&&(_0x2799ba+='\x20'+_0x5d2ddd[_0x5d3c('0x62')]+'\x20');_0x2799ba+=_0x5d2ddd[_0x5d3c('0x61')][_0x3ff7eb][_0x5d3c('0x63')]?_0x4a52db(_0x5d2ddd[_0x5d3c('0x61')][_0x3ff7eb][_0x5d3c('0x63')]):_0x5d2ddd['rules'][_0x3ff7eb][_0x5d3c('0x64')]+'\x20'+_0x5d2ddd[_0x5d3c('0x61')][_0x3ff7eb][_0x5d3c('0x65')]+(_0x34cbc3(_0x5d2ddd[_0x5d3c('0x61')][_0x3ff7eb][_0x5d3c('0x65')])?'\x20'+_0x5d2ddd[_0x5d3c('0x61')][_0x3ff7eb]['value']:'');}return _0x2799ba+')';};var _0x2953db={'where':{'id':_0x29335d[_0x5d3c('0x4a')]['id']}},_0x32d0cb,_0x403eef,_0x388c9f,_0x5c95f4,_0x1b7bc9;_0x2953db=_[_0x5d3c('0x41')]({},_0x2953db,_0x29335d[_0x5d3c('0x66')]);return db[_0x5d3c('0x43')][_0x5d3c('0x4b')](_0x2953db)['then'](function(_0xe0437d){if(_0xe0437d){_0x32d0cb=_0xe0437d;return _0xe0437d[_0x5d3c('0x67')]();}return null;})[_0x5d3c('0x23')](function(_0x3c51c8){if(_0x3c51c8){if(!_0x3c51c8['length']){throw new db[(_0x5d3c('0x68'))][(_0x5d3c('0x69'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x403eef=_0x3c51c8;return db[_0x5d3c('0x6a')]['findAll']({'raw':!![]});}return null;})[_0x5d3c('0x23')](function(_0x52ee1d){if(_0x52ee1d){_0x388c9f=_['keyBy'](_0x52ee1d,'id');var _0x9c1a32;var _0x4f0de9=squel[_0x5d3c('0x6b')]();_0x4f0de9[_0x5d3c('0x6c')](_0x32d0cb[_0x5d3c('0x6d')]);for(var _0x341269=0x0;_0x341269<_0x403eef[_0x5d3c('0x38')];_0x341269+=0x1){_0x9c1a32=_0x403eef[_0x341269][_0x5d3c('0x6e')]?_0x388c9f[_0x403eef[_0x341269][_0x5d3c('0x6e')]]['metric']:_0x403eef[_0x341269][_0x5d3c('0x64')];_0x9c1a32=_0x403eef[_0x341269]['function']?_[_0x5d3c('0x6f')](_0x3fa2ec[_0x403eef[_0x341269][_0x5d3c('0x70')]],'%s',_0x9c1a32):_0x9c1a32;_0x9c1a32=_0x403eef[_0x341269]['format']?_[_0x5d3c('0x6f')](_0x568be1[_0x403eef[_0x341269]['format']],'%s',_0x9c1a32):_0x9c1a32;if(_0x403eef[_0x341269][_0x5d3c('0x71')]){_0x4f0de9['group'](_0x9c1a32);}_0x403eef[_0x341269][_0x5d3c('0x72')]&&_0x4f0de9[_0x5d3c('0x3c')](_0x9c1a32,_0x403eef[_0x341269][_0x5d3c('0x72')]===_0x5d3c('0x73')?![]:!![]);_0x4f0de9[_0x5d3c('0x64')](_0x9c1a32,_0x403eef[_0x341269][_0x5d3c('0x74')]||_0x9c1a32);}if(_0x32d0cb['joins']){_0x32d0cb['joins']=JSON['parse'](_0x32d0cb['joins']);for(var _0x38daa1=0x0;_0x38daa1<_0x32d0cb[_0x5d3c('0x75')][_0x5d3c('0x38')];_0x38daa1+=0x1){if(_0x32d0cb[_0x5d3c('0x75')][_0x38daa1][_0x5d3c('0x2f')]&&_[_0x5d3c('0x76')](_0x12db24,_0x32d0cb[_0x5d3c('0x75')][_0x38daa1][_0x5d3c('0x2f')])&&_0x32d0cb[_0x5d3c('0x75')][_0x38daa1]['parentKey']&&_0x32d0cb[_0x5d3c('0x75')][_0x38daa1][_0x5d3c('0x77')]&&_0x32d0cb[_0x5d3c('0x75')][_0x38daa1]['foreignKey']){_0x4f0de9[_0x32d0cb[_0x5d3c('0x75')][_0x38daa1][_0x5d3c('0x2f')]](_0x32d0cb[_0x5d3c('0x75')][_0x38daa1][_0x5d3c('0x77')],null,util['format'](_0x5d3c('0x78'),_0x32d0cb[_0x5d3c('0x6d')],_0x32d0cb[_0x5d3c('0x75')][_0x38daa1][_0x5d3c('0x79')],_0x32d0cb['joins'][_0x38daa1][_0x5d3c('0x77')],_0x32d0cb['joins'][_0x38daa1][_0x5d3c('0x7a')]));}}}if(_0x32d0cb[_0x5d3c('0x7b')]){_0x32d0cb[_0x5d3c('0x7b')]=JSON[_0x5d3c('0x7c')](_0x32d0cb[_0x5d3c('0x7b')]);_0x4f0de9[_0x5d3c('0x3e')](_0x4a52db(_0x32d0cb['conditions']['group']));}_0x1b7bc9=_0x4f0de9[_0x5d3c('0x7d')]();_0x4f0de9[_0x5d3c('0x3b')](_0x69e8ed);_0x4f0de9[_0x5d3c('0x1c')](0x0);logger['debug'](_0x5d3c('0x7e'),_0x4f0de9[_0x5d3c('0x7f')]());return dbH[_0x5d3c('0x80')][_0x5d3c('0x31')](_0x4f0de9[_0x5d3c('0x7f')](),{'type':dbH[_0x5d3c('0x80')][_0x5d3c('0x81')][_0x5d3c('0x82')]});}})[_0x5d3c('0x23')](respondWithResult(_0x594966,null))[_0x5d3c('0x48')](handleError(_0x594966,null));};function runReport(_0x308bd0,_0x282889,_0xd7351){var _0x3441a4=_0x282889[_0x5d3c('0x29')];var _0x40459f=0xa;var _0x1807f1=[_0x5d3c('0x54'),'left_join',_0x5d3c('0x55'),_0x5d3c('0x83')];var _0x129b0b={'SUM':_0x5d3c('0x84'),'COUNT':_0x5d3c('0x56'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x5d3c('0x57'),'MIN':_0x5d3c('0x85'),'AVG':_0x5d3c('0x58'),'GROUP_CONCAT':_0x5d3c('0x86'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x222bd9={'SEC_TO_TIME':_0x5d3c('0x5b'),'DATE':_0x5d3c('0x87'),'HOUR':_0x5d3c('0x5c'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x51ec31=function(_0x57b340){return!_[_0x5d3c('0x76')]([_0x5d3c('0x5e'),_0x5d3c('0x5f'),_0x5d3c('0x60'),'IS\x20NOT\x20EMPTY'],_0x57b340);};var _0x1dff23=function(_0x36cced){if(!_0x36cced||!_0x36cced[_0x5d3c('0x61')][_0x5d3c('0x38')]){return'';}for(var _0x3a7798='(',_0x33cb79=0x0;_0x33cb79<_0x36cced['rules'][_0x5d3c('0x38')];_0x33cb79+=0x1){_0x33cb79>0x0&&(_0x3a7798+='\x20'+_0x36cced[_0x5d3c('0x62')]+'\x20');_0x3a7798+=_0x36cced[_0x5d3c('0x61')][_0x33cb79][_0x5d3c('0x63')]?_0x1dff23(_0x36cced[_0x5d3c('0x61')][_0x33cb79][_0x5d3c('0x63')]):_0x36cced['rules'][_0x33cb79][_0x5d3c('0x64')]+'\x20'+_0x36cced[_0x5d3c('0x61')][_0x33cb79]['condition']+(_0x51ec31(_0x36cced[_0x5d3c('0x61')][_0x33cb79]['condition'])?'\x20'+_0x36cced[_0x5d3c('0x61')][_0x33cb79][_0x5d3c('0x88')]:'');}return _0x3a7798+')';};var _0x731fb2={'where':{'id':_0x308bd0['id']}},_0x530228,_0x374105,_0x39d458,_0x330be2,_0x324813;_0x731fb2=_['merge']({},_0x731fb2,_0xd7351);return db[_0x5d3c('0x43')]['find'](_0x731fb2)[_0x5d3c('0x23')](function(_0x28c889){if(_0x28c889){_0x530228=_0x28c889;return _0x28c889[_0x5d3c('0x67')]();}return null;})[_0x5d3c('0x23')](function(_0x372984){if(_0x372984){if(!_0x372984[_0x5d3c('0x38')]){throw new db[(_0x5d3c('0x68'))]['ValidationErrorItem'](_0x5d3c('0x89'),0x193);}_0x374105=_0x372984;return db[_0x5d3c('0x6a')][_0x5d3c('0x46')]({'raw':!![]});}return null;})[_0x5d3c('0x23')](function(_0x55c8b7){if(_0x55c8b7){_0x39d458=_[_0x5d3c('0x8a')](_0x55c8b7,'id');var _0x1f2c4f;var _0x56dc92=squel[_0x5d3c('0x6b')]();_0x56dc92[_0x5d3c('0x6c')](_0x530228[_0x5d3c('0x6d')]);for(var _0x2c0f3f=0x0;_0x2c0f3f<_0x374105['length'];_0x2c0f3f+=0x1){_0x1f2c4f=_0x374105[_0x2c0f3f][_0x5d3c('0x6e')]?_0x39d458[_0x374105[_0x2c0f3f][_0x5d3c('0x6e')]][_0x5d3c('0x8b')]:_0x374105[_0x2c0f3f][_0x5d3c('0x64')];_0x1f2c4f=_0x374105[_0x2c0f3f][_0x5d3c('0x70')]?_[_0x5d3c('0x6f')](_0x129b0b[_0x374105[_0x2c0f3f][_0x5d3c('0x70')]],'%s',_0x1f2c4f):_0x1f2c4f;_0x1f2c4f=_0x374105[_0x2c0f3f][_0x5d3c('0x8c')]?_[_0x5d3c('0x6f')](_0x222bd9[_0x374105[_0x2c0f3f][_0x5d3c('0x8c')]],'%s',_0x1f2c4f):_0x1f2c4f;if(_0x374105[_0x2c0f3f][_0x5d3c('0x71')]){_0x56dc92['group'](_0x1f2c4f);}_0x374105[_0x2c0f3f][_0x5d3c('0x72')]&&_0x56dc92['order'](_0x1f2c4f,_0x374105[_0x2c0f3f][_0x5d3c('0x72')]===_0x5d3c('0x73')?![]:!![]);_0x56dc92['field'](_0x1f2c4f,_0x374105[_0x2c0f3f][_0x5d3c('0x74')]||_0x1f2c4f);}if(_0x530228[_0x5d3c('0x75')]){_0x530228[_0x5d3c('0x75')]=JSON[_0x5d3c('0x7c')](_0x530228[_0x5d3c('0x75')]);for(var _0x45a3c6=0x0;_0x45a3c6<_0x530228[_0x5d3c('0x75')][_0x5d3c('0x38')];_0x45a3c6+=0x1){if(_0x530228[_0x5d3c('0x75')][_0x45a3c6][_0x5d3c('0x2f')]&&_[_0x5d3c('0x76')](_0x1807f1,_0x530228[_0x5d3c('0x75')][_0x45a3c6][_0x5d3c('0x2f')])&&_0x530228['joins'][_0x45a3c6]['parentKey']&&_0x530228[_0x5d3c('0x75')][_0x45a3c6][_0x5d3c('0x77')]&&_0x530228[_0x5d3c('0x75')][_0x45a3c6][_0x5d3c('0x7a')]){_0x56dc92[_0x530228['joins'][_0x45a3c6][_0x5d3c('0x2f')]](_0x530228[_0x5d3c('0x75')][_0x45a3c6][_0x5d3c('0x77')],null,util[_0x5d3c('0x8c')](_0x5d3c('0x78'),_0x530228[_0x5d3c('0x6d')],_0x530228[_0x5d3c('0x75')][_0x45a3c6]['parentKey'],_0x530228[_0x5d3c('0x75')][_0x45a3c6][_0x5d3c('0x77')],_0x530228[_0x5d3c('0x75')][_0x45a3c6][_0x5d3c('0x7a')]));}}}if(_0x530228[_0x5d3c('0x7b')]){_0x530228[_0x5d3c('0x7b')]=JSON['parse'](_0x530228['conditions']);_0x56dc92['where'](_0x1dff23(_0x530228[_0x5d3c('0x7b')][_0x5d3c('0x63')]));}_0x324813=_0x56dc92[_0x5d3c('0x7d')]();_0x56dc92[_0x5d3c('0x3b')](_0x40459f);_0x56dc92[_0x5d3c('0x1c')](0x0);return;}})['then'](function(){if(_0x282889[_0x5d3c('0x8d')]===_0x5d3c('0x8e')){return null;}var _0x1eb527=_[_0x5d3c('0x41')](_0x282889,{'name':_0x282889[_0x5d3c('0x8f')]||_0x282889['name']||_0x530228['name'],'basename':_0x3441a4,'savename':util[_0x5d3c('0x8c')]('%s-%s.%s',_0x282889[_0x5d3c('0x29')]||_0x530228[_0x5d3c('0x29')],require(_0x5d3c('0x90'))['generate'](0x4),_0x282889[_0x5d3c('0x8d')]||'csv'),'reportId':_0x530228['id'],'reportType':_0x5d3c('0x91')});return db[_0x5d3c('0x92')][_0x5d3c('0x4c')](_0x1eb527,{'raw':!![]});})[_0x5d3c('0x23')](function(_0x1a21de){if(_0x530228[_0x5d3c('0x6d')]===_0x5d3c('0x93')){_0x324813[_0x5d3c('0x3e')](_0x530228[_0x5d3c('0x6d')]+_0x5d3c('0x94'),_0x282889[_0x5d3c('0x95')],_0x282889['endDate']);}else{_0x324813[_0x5d3c('0x3e')](_0x530228[_0x5d3c('0x6d')]+_0x5d3c('0x96'),_0x282889[_0x5d3c('0x95')],_0x282889[_0x5d3c('0x97')]);}if(_0x1a21de){logger[_0x5d3c('0x98')](_0x5d3c('0x99'),_0x324813[_0x5d3c('0x7f')]());require(_0x5d3c('0x9a'))[_0x5d3c('0x9b')](path[_0x5d3c('0x54')](__dirname,_0x5d3c('0x9c'),_0x1a21de['output']),[_0x1a21de['id'],_0x324813[_0x5d3c('0x7f')](),path[_0x5d3c('0x54')](__dirname,_0x5d3c('0x9d'),_0x1a21de['savename']),_0x3441a4]);return _0x1a21de;}else{var _0x22c45c=squel[_0x5d3c('0x6b')]();_0x22c45c[_0x5d3c('0x6c')]('('+_0x324813[_0x5d3c('0x7f')]()+')',_0x5d3c('0x9e'));_0x22c45c[_0x5d3c('0x64')](_0x5d3c('0x9f'),_0x5d3c('0x1e'));_0x324813[_0x5d3c('0x3b')](_0x282889[_0x5d3c('0x3b')]||_0x40459f);_0x324813['offset'](_0x282889[_0x5d3c('0x1c')]||0x0);return dbH[_0x5d3c('0x80')]['query'](_0x22c45c[_0x5d3c('0x7f')](),{'type':dbH[_0x5d3c('0x80')]['QueryTypes'][_0x5d3c('0x82')]})[_0x5d3c('0x23')](function(_0x50d1f2){if(!_0x50d1f2[_0x5d3c('0x38')]){_0x330be2=0x0;}else{_0x330be2=_0x50d1f2[0x0][_0x5d3c('0x1e')]||0x0;}return dbH[_0x5d3c('0x80')][_0x5d3c('0x31')](_0x324813[_0x5d3c('0x7f')](),{'type':dbH[_0x5d3c('0x80')]['QueryTypes']['SELECT']});})[_0x5d3c('0x23')](function(_0x1fbe73){return{'rows':_0x1fbe73||[],'count':_0x330be2};});}});}exports['run']=function(_0x50258a,_0x48bc7b){return runReport(_0x50258a['params'],_0x50258a[_0x5d3c('0x31')],_0x50258a[_0x5d3c('0x66')])[_0x5d3c('0x23')](respondWithResult(_0x48bc7b,null))[_0x5d3c('0x48')](handleError(_0x48bc7b,null));};exports[_0x5d3c('0xa0')]=runReport;exports[_0x5d3c('0x31')]=function(_0x206e86,_0x491123){var _0x2f38a9=0xa;var _0x5de5b9=[_0x5d3c('0x54'),_0x5d3c('0xa1'),_0x5d3c('0x55'),_0x5d3c('0x83')];var _0x4fedac={'SUM':_0x5d3c('0x84'),'COUNT':_0x5d3c('0x56'),'COUNT DISTINCT':_0x5d3c('0xa2'),'MAX':_0x5d3c('0x57'),'MIN':_0x5d3c('0x85'),'AVG':_0x5d3c('0x58'),'GROUP_CONCAT':_0x5d3c('0x86'),'GROUP_CONCAT ASC':_0x5d3c('0x59'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2945cb={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x5d3c('0x87'),'HOUR':_0x5d3c('0x5c'),'ROUND':_0x5d3c('0x5d'),'UNIX_TIMESTAMP':_0x5d3c('0xa3')};var _0x1e3a4b=function(_0x85786b){return!_[_0x5d3c('0x76')](['IS\x20NULL',_0x5d3c('0x5f'),'IS\x20EMPTY',_0x5d3c('0xa4')],_0x85786b);};var _0x2b63d3=function(_0x3e6fc3){if(!_0x3e6fc3||!_0x3e6fc3[_0x5d3c('0x61')]['length']){return'';}for(var _0x4f2130='(',_0x2d5fa0=0x0;_0x2d5fa0<_0x3e6fc3[_0x5d3c('0x61')][_0x5d3c('0x38')];_0x2d5fa0+=0x1){_0x2d5fa0>0x0&&(_0x4f2130+='\x20'+_0x3e6fc3[_0x5d3c('0x62')]+'\x20');_0x4f2130+=_0x3e6fc3['rules'][_0x2d5fa0]['group']?_0x2b63d3(_0x3e6fc3[_0x5d3c('0x61')][_0x2d5fa0][_0x5d3c('0x63')]):_0x3e6fc3['rules'][_0x2d5fa0]['field']+'\x20'+_0x3e6fc3[_0x5d3c('0x61')][_0x2d5fa0][_0x5d3c('0x65')]+(_0x1e3a4b(_0x3e6fc3[_0x5d3c('0x61')][_0x2d5fa0][_0x5d3c('0x65')])?'\x20'+_0x3e6fc3[_0x5d3c('0x61')][_0x2d5fa0][_0x5d3c('0x88')]:'');}return _0x4f2130+')';};var _0x34bedd={'where':{'id':_0x206e86[_0x5d3c('0x4a')]['id']}},_0x9ea147,_0x391727,_0x46705d,_0x586813,_0x43b512;_0x34bedd=_[_0x5d3c('0x41')]({},_0x34bedd,_0x206e86[_0x5d3c('0x66')]);return db[_0x5d3c('0x43')]['find'](_0x34bedd)[_0x5d3c('0x23')](function(_0x126fae){if(_0x126fae){_0x9ea147=_0x126fae;return _0x126fae[_0x5d3c('0x67')]();}return null;})[_0x5d3c('0x23')](function(_0x371ff2){if(_0x371ff2){if(!_0x371ff2['length']){throw new db[(_0x5d3c('0x68'))]['ValidationErrorItem'](_0x5d3c('0x89'),0x193);}_0x391727=_0x371ff2;return db['AnalyticMetric'][_0x5d3c('0x46')]({'raw':!![]});}return null;})[_0x5d3c('0x23')](function(_0x3a6087){if(_0x3a6087){_0x46705d=_[_0x5d3c('0x8a')](_0x3a6087,'id');var _0x28dc0f;var _0x3fc32b=squel['select']();_0x3fc32b[_0x5d3c('0x6c')](_0x9ea147[_0x5d3c('0x6d')]);for(var _0x329c47=0x0;_0x329c47<_0x391727['length'];_0x329c47+=0x1){_0x28dc0f=_0x391727[_0x329c47][_0x5d3c('0x6e')]?_0x46705d[_0x391727[_0x329c47][_0x5d3c('0x6e')]][_0x5d3c('0x8b')]:_0x391727[_0x329c47][_0x5d3c('0x64')];_0x28dc0f=_0x391727[_0x329c47]['function']?_['replace'](_0x4fedac[_0x391727[_0x329c47][_0x5d3c('0x70')]],'%s',_0x28dc0f):_0x28dc0f;_0x28dc0f=_0x391727[_0x329c47]['format']?_[_0x5d3c('0x6f')](_0x2945cb[_0x391727[_0x329c47][_0x5d3c('0x8c')]],'%s',_0x28dc0f):_0x28dc0f;if(_0x391727[_0x329c47][_0x5d3c('0x71')]){_0x3fc32b['group'](_0x28dc0f);}_0x391727[_0x329c47][_0x5d3c('0x72')]&&_0x3fc32b[_0x5d3c('0x3c')](_0x28dc0f,_0x391727[_0x329c47][_0x5d3c('0x72')]===_0x5d3c('0x73')?![]:!![]);_0x3fc32b[_0x5d3c('0x64')](_0x28dc0f,_0x391727[_0x329c47][_0x5d3c('0x74')]||_0x28dc0f);}if(_0x9ea147[_0x5d3c('0x75')]){_0x9ea147[_0x5d3c('0x75')]=JSON[_0x5d3c('0x7c')](_0x9ea147['joins']);for(var _0x433014=0x0;_0x433014<_0x9ea147[_0x5d3c('0x75')][_0x5d3c('0x38')];_0x433014+=0x1){if(_0x9ea147[_0x5d3c('0x75')][_0x433014][_0x5d3c('0x2f')]&&_[_0x5d3c('0x76')](_0x5de5b9,_0x9ea147[_0x5d3c('0x75')][_0x433014]['type'])&&_0x9ea147[_0x5d3c('0x75')][_0x433014]['parentKey']&&_0x9ea147[_0x5d3c('0x75')][_0x433014][_0x5d3c('0x77')]&&_0x9ea147[_0x5d3c('0x75')][_0x433014][_0x5d3c('0x7a')]){_0x3fc32b[_0x9ea147[_0x5d3c('0x75')][_0x433014][_0x5d3c('0x2f')]](_0x9ea147[_0x5d3c('0x75')][_0x433014][_0x5d3c('0x77')],null,util[_0x5d3c('0x8c')](_0x5d3c('0x78'),_0x9ea147[_0x5d3c('0x6d')],_0x9ea147['joins'][_0x433014][_0x5d3c('0x79')],_0x9ea147['joins'][_0x433014][_0x5d3c('0x77')],_0x9ea147[_0x5d3c('0x75')][_0x433014]['foreignKey']));}}}if(_0x9ea147['conditions']){_0x9ea147[_0x5d3c('0x7b')]=JSON[_0x5d3c('0x7c')](_0x9ea147[_0x5d3c('0x7b')]);_0x3fc32b[_0x5d3c('0x3e')](_0x2b63d3(_0x9ea147['conditions'][_0x5d3c('0x63')]));}_0x43b512=_0x3fc32b[_0x5d3c('0x7d')]();_0x3fc32b[_0x5d3c('0x3b')](_0x2f38a9);_0x3fc32b[_0x5d3c('0x1c')](0x0);logger['debug'](_0x5d3c('0x7e'),_0x3fc32b[_0x5d3c('0x7f')]());return dbH[_0x5d3c('0x80')][_0x5d3c('0x31')](_0x3fc32b['toString'](),{'type':dbH[_0x5d3c('0x80')][_0x5d3c('0x81')][_0x5d3c('0x82')]});}})[_0x5d3c('0x23')](function(){return{'sql':_0x43b512[_0x5d3c('0x7f')]()};})['then'](respondWithResult(_0x491123,null))[_0x5d3c('0x48')](handleError(_0x491123,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 02f74ed..fde3803 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 _0x9cb7=['path','rimraf','../../config/environment','./analyticCustomReport.attributes','define','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x57e118,_0x99b7b8){var _0x58896c=function(_0xb83347){while(--_0xb83347){_0x57e118['push'](_0x57e118['shift']());}};_0x58896c(++_0x99b7b8);}(_0x9cb7,0xbc));var _0x79cb=function(_0x41fe6b,_0x2aea0f){_0x41fe6b=_0x41fe6b-0x0;var _0x2c4d39=_0x9cb7[_0x41fe6b];return _0x2c4d39;};'use strict';var _=require(_0x79cb('0x0'));var util=require(_0x79cb('0x1'));var logger=require(_0x79cb('0x2'))(_0x79cb('0x3'));var moment=require(_0x79cb('0x4'));var BPromise=require(_0x79cb('0x5'));var rp=require(_0x79cb('0x6'));var fs=require('fs');var path=require(_0x79cb('0x7'));var rimraf=require(_0x79cb('0x8'));var config=require(_0x79cb('0x9'));var attributes=require(_0x79cb('0xa'));module['exports']=function(_0x419685,_0x37bb0c){return _0x419685[_0x79cb('0xb')]('AnalyticCustomReport',attributes,{'tableName':_0x79cb('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xddb5=['rimraf','../../config/environment','exports','define','AnalyticCustomReport','analytics_custom_reports','util','../../config/logger','bluebird','request-promise','path'];(function(_0x3670e8,_0x3dc1d6){var _0x4b99cf=function(_0x19556c){while(--_0x19556c){_0x3670e8['push'](_0x3670e8['shift']());}};_0x4b99cf(++_0x3dc1d6);}(_0xddb5,0xab));var _0x5ddb=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xddb5[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require(_0x5ddb('0x0'));var logger=require(_0x5ddb('0x1'))('api');var moment=require('moment');var BPromise=require(_0x5ddb('0x2'));var rp=require(_0x5ddb('0x3'));var fs=require('fs');var path=require(_0x5ddb('0x4'));var rimraf=require(_0x5ddb('0x5'));var config=require(_0x5ddb('0x6'));var attributes=require('./analyticCustomReport.attributes');module[_0x5ddb('0x7')]=function(_0x18b686,_0x4f352c){return _0x18b686[_0x5ddb('0x8')](_0x5ddb('0x9'),attributes,{'tableName':_0x5ddb('0xa'),'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 8277f7d..0c34986 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 _0x157e=['code','message','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x16404b,_0x28a2dc){var _0x55fa00=function(_0x595d67){while(--_0x595d67){_0x16404b['push'](_0x16404b['shift']());}};_0x55fa00(++_0x28a2dc);}(_0x157e,0x9c));var _0xe157=function(_0x112e2a,_0x364486){_0x112e2a=_0x112e2a-0x0;var _0x4f8af9=_0x157e[_0x112e2a];return _0x4f8af9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe157('0x0'));var BPromise=require(_0xe157('0x1'));var rs=require(_0xe157('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe157('0x3'))['db'];var utils=require(_0xe157('0x4'));var logger=require(_0xe157('0x5'))(_0xe157('0x6'));var config=require(_0xe157('0x7'));var jayson=require(_0xe157('0x8'));var client=jayson[_0xe157('0x9')][_0xe157('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4262b9,_0x107fd3,_0x17770a){return new BPromise(function(_0x4f1980,_0x1b4606){return client[_0xe157('0xb')](_0x4262b9,_0x17770a)[_0xe157('0xc')](function(_0x3ec433){logger[_0xe157('0xd')](_0xe157('0xe'),_0x107fd3,_0xe157('0xf'));logger[_0xe157('0x10')](_0xe157('0x11'),_0x107fd3,_0xe157('0xf'),JSON[_0xe157('0x12')](_0x3ec433));if(_0x3ec433[_0xe157('0x13')]){if(_0x3ec433[_0xe157('0x13')][_0xe157('0x14')]===0x1f4){logger[_0xe157('0x13')](_0xe157('0xe'),_0x107fd3,_0x3ec433[_0xe157('0x13')][_0xe157('0x15')]);return _0x1b4606(_0x3ec433[_0xe157('0x13')][_0xe157('0x15')]);}logger['error'](_0xe157('0xe'),_0x107fd3,_0x3ec433[_0xe157('0x13')][_0xe157('0x15')]);return _0x4f1980(_0x3ec433[_0xe157('0x13')]['message']);}else{logger[_0xe157('0xd')](_0xe157('0xe'),_0x107fd3,_0xe157('0xf'));_0x4f1980(_0x3ec433['result'][_0xe157('0x15')]);}})['catch'](function(_0x1bcde1){logger['error'](_0xe157('0xe'),_0x107fd3,_0x1bcde1);_0x1b4606(_0x1bcde1);});});} \ No newline at end of file +var _0x61d9=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x61d9,0x1b9));var _0x961d=function(_0x133079,_0x2f6535){_0x133079=_0x133079-0x0;var _0x97e20f=_0x61d9[_0x133079];return _0x97e20f;};'use strict';var _=require(_0x961d('0x0'));var util=require(_0x961d('0x1'));var moment=require(_0x961d('0x2'));var BPromise=require(_0x961d('0x3'));var rs=require(_0x961d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x961d('0x5'))['db'];var utils=require(_0x961d('0x6'));var logger=require(_0x961d('0x7'))(_0x961d('0x8'));var config=require(_0x961d('0x9'));var jayson=require(_0x961d('0xa'));var client=jayson['client'][_0x961d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a0fa2,_0x2820d2,_0x5871d9){return new BPromise(function(_0x115589,_0x25e3ad){return client['request'](_0x2a0fa2,_0x5871d9)['then'](function(_0xe924b1){logger[_0x961d('0xc')](_0x961d('0xd'),_0x2820d2,_0x961d('0xe'));logger[_0x961d('0xf')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x2820d2,_0x961d('0xe'),JSON[_0x961d('0x10')](_0xe924b1));if(_0xe924b1[_0x961d('0x11')]){if(_0xe924b1['error'][_0x961d('0x12')]===0x1f4){logger[_0x961d('0x11')](_0x961d('0xd'),_0x2820d2,_0xe924b1[_0x961d('0x11')][_0x961d('0x13')]);return _0x25e3ad(_0xe924b1[_0x961d('0x11')][_0x961d('0x13')]);}logger[_0x961d('0x11')](_0x961d('0xd'),_0x2820d2,_0xe924b1[_0x961d('0x11')][_0x961d('0x13')]);return _0x115589(_0xe924b1[_0x961d('0x11')][_0x961d('0x13')]);}else{logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x2820d2,_0x961d('0xe'));_0x115589(_0xe924b1[_0x961d('0x14')][_0x961d('0x13')]);}})[_0x961d('0x15')](function(_0x3e559d){logger['error'](_0x961d('0xd'),_0x2820d2,_0x3e559d);_0x25e3ad(_0x3e559d);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 219df1d..bd4f5f8 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 _0xaf08=['index','show','/:id/preview','preview','run','/:id/query','query','post','create','put','/:id','update','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated'];(function(_0x5e3665,_0x369ac8){var _0x187299=function(_0x5c37f8){while(--_0x5c37f8){_0x5e3665['push'](_0x5e3665['shift']());}};_0x187299(++_0x369ac8);}(_0xaf08,0x138));var _0x8af0=function(_0xc7348b,_0x145880){_0xc7348b=_0xc7348b-0x0;var _0x307cec=_0xaf08[_0xc7348b];return _0x307cec;};'use strict';var multer=require('multer');var util=require(_0x8af0('0x0'));var path=require(_0x8af0('0x1'));var timeout=require('connect-timeout');var express=require(_0x8af0('0x2'));var router=express[_0x8af0('0x3')]();var fs_extra=require(_0x8af0('0x4'));var auth=require(_0x8af0('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8af0('0x6'));var controller=require(_0x8af0('0x7'));router[_0x8af0('0x8')]('/',auth[_0x8af0('0x9')](),controller[_0x8af0('0xa')]);router[_0x8af0('0x8')]('/:id',auth[_0x8af0('0x9')](),controller[_0x8af0('0xb')]);router['get'](_0x8af0('0xc'),auth['isAuthenticated'](),controller[_0x8af0('0xd')]);router['get']('/:id/run',auth[_0x8af0('0x9')](),controller[_0x8af0('0xe')]);router[_0x8af0('0x8')](_0x8af0('0xf'),auth[_0x8af0('0x9')](),controller[_0x8af0('0x10')]);router[_0x8af0('0x11')]('/',auth[_0x8af0('0x9')](),controller[_0x8af0('0x12')]);router[_0x8af0('0x13')](_0x8af0('0x14'),auth[_0x8af0('0x9')](),controller[_0x8af0('0x15')]);router['delete']('/:id',auth[_0x8af0('0x9')](),controller[_0x8af0('0x16')]);module['exports']=router; \ No newline at end of file +var _0xf7de=['/:id/preview','preview','/:id/query','query','post','create','put','/:id','exports','util','path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show'];(function(_0x5680cb,_0x18be32){var _0x3e8a55=function(_0x3d5190){while(--_0x3d5190){_0x5680cb['push'](_0x5680cb['shift']());}};_0x3e8a55(++_0x18be32);}(_0xf7de,0xed));var _0xef7d=function(_0x3ce09c,_0x1d7dd8){_0x3ce09c=_0x3ce09c-0x0;var _0x193a6f=_0xf7de[_0x3ce09c];return _0x193a6f;};'use strict';var multer=require('multer');var util=require(_0xef7d('0x0'));var path=require(_0xef7d('0x1'));var timeout=require('connect-timeout');var express=require(_0xef7d('0x2'));var router=express[_0xef7d('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xef7d('0x4'));var config=require(_0xef7d('0x5'));var controller=require('./analyticCustomReport.controller');router[_0xef7d('0x6')]('/',auth[_0xef7d('0x7')](),controller[_0xef7d('0x8')]);router[_0xef7d('0x6')]('/:id',auth[_0xef7d('0x7')](),controller[_0xef7d('0x9')]);router[_0xef7d('0x6')](_0xef7d('0xa'),auth[_0xef7d('0x7')](),controller[_0xef7d('0xb')]);router[_0xef7d('0x6')]('/:id/run',auth['isAuthenticated'](),controller['run']);router[_0xef7d('0x6')](_0xef7d('0xc'),auth[_0xef7d('0x7')](),controller[_0xef7d('0xd')]);router[_0xef7d('0xe')]('/',auth[_0xef7d('0x7')](),controller[_0xef7d('0xf')]);router[_0xef7d('0x10')](_0xef7d('0x11'),auth[_0xef7d('0x7')](),controller['update']);router['delete']('/:id',auth[_0xef7d('0x7')](),controller['destroy']);module[_0xef7d('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 1965a14..ea5dce0 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 _0x31f0=['sequelize','STRING','TEXT'];(function(_0x2a275f,_0x14b467){var _0x445d29=function(_0x239cdb){while(--_0x239cdb){_0x2a275f['push'](_0x2a275f['shift']());}};_0x445d29(++_0x14b467);}(_0x31f0,0xb7));var _0x031f=function(_0x8b4957,_0xb90afa){_0x8b4957=_0x8b4957-0x0;var _0x54b3e4=_0x31f0[_0x8b4957];return _0x54b3e4;};'use strict';var Sequelize=require(_0x031f('0x0'));module['exports']={'name':{'type':Sequelize[_0x031f('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x031f('0x1')]},'table':{'type':Sequelize[_0x031f('0x1')]},'conditions':{'type':Sequelize[_0x031f('0x2')]},'joins':{'type':Sequelize[_0x031f('0x2')]}}; \ No newline at end of file +var _0x7fbe=['STRING','TEXT'];(function(_0x3ceb6c,_0x554602){var _0x256814=function(_0x7800cf){while(--_0x7800cf){_0x3ceb6c['push'](_0x3ceb6c['shift']());}};_0x256814(++_0x554602);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x2bd007,_0x281ba0){_0x2bd007=_0x2bd007-0x0;var _0x53c252=_0x7fbe[_0x2bd007];return _0x53c252;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe7fb('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0xe7fb('0x0')]},'parent':{'type':Sequelize[_0xe7fb('0x0')]},'table':{'type':Sequelize[_0xe7fb('0x0')]},'conditions':{'type':Sequelize[_0xe7fb('0x1')]},'joins':{'type':Sequelize[_0xe7fb('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 6be9bb5..8dc543d 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 _0xc4aa=['Content-Range','apply','reject','save','update','then','destroy','get','DefaultReports','UserProfileResource','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','AnalyticDefaultReport','findAll','rows','catch','show','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','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\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','MAX(%s)','AVG(%s)','SEC_TO_TIME(%s)','IS\x20NOT\x20EMPTY','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','groupBy','alias','includes','foreignKey','output','web','fullPath','%s-%s.%s','randomstring','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','child_process','fork','countTable','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x5ba549,_0x425afd){var _0x36e3a1=function(_0x464308){while(--_0x464308){_0x5ba549['push'](_0x5ba549['shift']());}};_0x36e3a1(++_0x425afd);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xc4aa[_0x199572];return _0x13cfa3;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];var dbH=require(_0xac4a('0x16'))['dbH'];function respondWithStatusCode(_0x21a79,_0x68424a){_0x68424a=_0x68424a||0xcc;return function(_0x247b78){if(_0x247b78){return _0x21a79[_0xac4a('0x17')](_0x68424a);}return _0x21a79[_0xac4a('0x18')](_0x68424a)[_0xac4a('0x19')]();};}function respondWithResult(_0x34bc01,_0x33c287){_0x33c287=_0x33c287||0xc8;return function(_0x190418){if(_0x190418){return _0x34bc01[_0xac4a('0x18')](_0x33c287)[_0xac4a('0x1a')](_0x190418);}};}function respondWithFilteredResult(_0x26dbb8,_0x4a2119){return function(_0x402fff){if(_0x402fff){var _0x34d797=typeof _0x4a2119[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x4a2119[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x28e304=_0x402fff[_0xac4a('0x1e')];var _0x546c5d=_0x34d797?0x0:_0x4a2119['offset'];var _0x21a729=_0x34d797?_0x402fff[_0xac4a('0x1e')]:_0x4a2119[_0xac4a('0x1b')]+_0x4a2119['limit'];var _0x39e83e;if(_0x21a729>=_0x28e304){_0x21a729=_0x28e304;_0x39e83e=0xc8;}else{_0x39e83e=0xce;}_0x26dbb8[_0xac4a('0x18')](_0x39e83e);return _0x26dbb8[_0xac4a('0x1f')](_0xac4a('0x20'),_0x546c5d+'-'+_0x21a729+'/'+_0x28e304)[_0xac4a('0x1a')](_0x402fff);}return null;};}function patchUpdates(_0x3e829c){return function(_0xe38996){try{jsonpatch[_0xac4a('0x21')](_0xe38996,_0x3e829c,!![]);}catch(_0x534092){return BPromise[_0xac4a('0x22')](_0x534092);}return _0xe38996[_0xac4a('0x23')]();};}function saveUpdates(_0x599787,_0x3d7ce0){return function(_0x4169c0){if(_0x4169c0){return _0x4169c0[_0xac4a('0x24')](_0x599787)[_0xac4a('0x25')](function(_0x4d2d6c){return _0x4d2d6c;});}return null;};}function removeEntity(_0x1b7998,_0x2503d8){return function(_0x15435c){if(_0x15435c){return _0x15435c[_0xac4a('0x26')]()[_0xac4a('0x25')](function(){var _0x2b0dc2=_0x15435c[_0xac4a('0x27')]({'plain':!![]});var _0x36054a=_0xac4a('0x28');return db[_0xac4a('0x29')][_0xac4a('0x26')]({'where':{'type':_0x36054a,'resourceId':_0x2b0dc2['id']}})[_0xac4a('0x25')](function(){return _0x15435c;});})[_0xac4a('0x25')](function(){_0x1b7998[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x20202c,_0x4e17ce){return function(_0x23b061){if(!_0x23b061){_0x20202c[_0xac4a('0x17')](0x194);}return _0x23b061;};}function handleError(_0x42a33c,_0x2772fe){_0x2772fe=_0x2772fe||0x1f4;return function(_0x116700){logger['error'](_0x116700['stack']);if(_0x116700[_0xac4a('0x2a')]){delete _0x116700[_0xac4a('0x2a')];}_0x42a33c[_0xac4a('0x18')](_0x2772fe)['send'](_0x116700);};}exports['index']=function(_0x355755,_0x2896bc){var _0x228629={},_0x432066={},_0x17118e={'count':0x0,'rows':[]};var _0x53d3a5=_[_0xac4a('0x2b')](db['AnalyticDefaultReport'][_0xac4a('0x2c')],function(_0x57adcf){return{'name':_0x57adcf[_0xac4a('0x2d')],'type':_0x57adcf[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x432066[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0x53d3a5,_0xac4a('0x2a'));_0x432066[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x355755[_0xac4a('0x31')]);_0x432066[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x432066[_0xac4a('0x30')],_0x432066[_0xac4a('0x31')]);_0x228629[_0xac4a('0x35')]=_['intersection'](_0x432066[_0xac4a('0x30')],qs[_0xac4a('0x36')](_0x355755['query'][_0xac4a('0x36')]));_0x228629[_0xac4a('0x35')]=_0x228629['attributes']['length']?_0x228629[_0xac4a('0x35')]:_0x432066[_0xac4a('0x30')];if(!_0x355755[_0xac4a('0x31')][_0xac4a('0x37')]('nolimit')){_0x228629[_0xac4a('0x1d')]=qs[_0xac4a('0x1d')](_0x355755['query'][_0xac4a('0x1d')]);_0x228629[_0xac4a('0x1b')]=qs[_0xac4a('0x1b')](_0x355755['query'][_0xac4a('0x1b')]);}_0x228629[_0xac4a('0x38')]=qs[_0xac4a('0x39')](_0x355755['query'][_0xac4a('0x39')]);_0x228629[_0xac4a('0x3a')]=qs['filters'](_['pick'](_0x355755[_0xac4a('0x31')],_0x432066['filters']),_0x53d3a5);if(_0x355755['query']['filter']){_0x228629['where']=_[_0xac4a('0x3b')](_0x228629[_0xac4a('0x3a')],{'$or':_[_0xac4a('0x2b')](_0x53d3a5,function(_0x472484){if(_0x472484[_0xac4a('0x2e')]!==_0xac4a('0x3c')){var _0x4220e2={};_0x4220e2[_0x472484[_0xac4a('0x2a')]]={'$like':'%'+_0x355755[_0xac4a('0x31')][_0xac4a('0x3d')]+'%'};return _0x4220e2;}})});}_0x228629=_[_0xac4a('0x3b')]({},_0x228629,_0x355755[_0xac4a('0x3e')]);var _0x4e4994={'where':_0x228629['where']};return db['AnalyticDefaultReport'][_0xac4a('0x1e')](_0x4e4994)[_0xac4a('0x25')](function(_0x14e80b){_0x17118e[_0xac4a('0x1e')]=_0x14e80b;if(_0x355755[_0xac4a('0x31')][_0xac4a('0x3f')]){_0x228629[_0xac4a('0x40')]=[{'all':!![]}];}return db[_0xac4a('0x41')][_0xac4a('0x42')](_0x228629);})[_0xac4a('0x25')](function(_0x561cb7){_0x17118e[_0xac4a('0x43')]=_0x561cb7;return _0x17118e;})[_0xac4a('0x25')](respondWithFilteredResult(_0x2896bc,_0x228629))[_0xac4a('0x44')](handleError(_0x2896bc,null));};exports[_0xac4a('0x45')]=function(_0x1a96cf,_0x57b879){var _0x8700b4={'raw':!![],'where':{'id':_0x1a96cf['params']['id']}},_0x1b77bb={};_0x1b77bb[_0xac4a('0x30')]=_['keys'](db[_0xac4a('0x41')][_0xac4a('0x2c')]);_0x1b77bb[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x1a96cf[_0xac4a('0x31')]);_0x1b77bb[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],_0x1b77bb[_0xac4a('0x31')]);_0x8700b4[_0xac4a('0x35')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],qs['fields'](_0x1a96cf[_0xac4a('0x31')][_0xac4a('0x36')]));_0x8700b4[_0xac4a('0x35')]=_0x8700b4['attributes'][_0xac4a('0x46')]?_0x8700b4[_0xac4a('0x35')]:_0x1b77bb['model'];if(_0x1a96cf[_0xac4a('0x31')]['includeAll']){_0x8700b4[_0xac4a('0x40')]=[{'all':!![]}];}_0x8700b4=_[_0xac4a('0x3b')]({},_0x8700b4,_0x1a96cf[_0xac4a('0x3e')]);return db['AnalyticDefaultReport']['find'](_0x8700b4)[_0xac4a('0x25')](handleEntityNotFound(_0x57b879,null))['then'](respondWithResult(_0x57b879,null))[_0xac4a('0x44')](handleError(_0x57b879,null));};exports['create']=function(_0x3d2aaf,_0x530bbb){return db[_0xac4a('0x41')][_0xac4a('0x47')](_0x3d2aaf[_0xac4a('0x48')],{})[_0xac4a('0x25')](function(_0x54782f){var _0x31c794=_0x3d2aaf[_0xac4a('0x49')][_0xac4a('0x27')]({'plain':!![]});if(!_0x31c794)throw new Error(_0xac4a('0x4a'));if(_0x31c794[_0xac4a('0x4b')]===_0xac4a('0x49')){var _0x187306=_0x54782f['get']({'plain':!![]});var _0x35dee5=_0xac4a('0x4c');return db['UserProfileSection'][_0xac4a('0x4d')]({'where':{'name':_0x35dee5,'userProfileId':_0x31c794[_0xac4a('0x4e')]},'raw':!![]})[_0xac4a('0x25')](function(_0x3ac36e){if(_0x3ac36e&&_0x3ac36e['autoAssociation']===0x0){return db[_0xac4a('0x29')][_0xac4a('0x47')]({'name':_0x187306[_0xac4a('0x2a')],'resourceId':_0x187306['id'],'type':_0xac4a('0x28'),'sectionId':_0x3ac36e['id']},{})[_0xac4a('0x25')](function(){return _0x54782f;});}else{return _0x54782f;}})['catch'](function(_0x179373){logger['error'](_0xac4a('0x4f'),_0x179373);throw _0x179373;});}return _0x54782f;})[_0xac4a('0x25')](respondWithResult(_0x530bbb,0xc9))['catch'](handleError(_0x530bbb,null));};exports['update']=function(_0x437466,_0x70fdc3){if(_0x437466['body']['id']){delete _0x437466[_0xac4a('0x48')]['id'];}return db[_0xac4a('0x41')][_0xac4a('0x4d')]({'where':{'id':_0x437466[_0xac4a('0x50')]['id']}})['then'](handleEntityNotFound(_0x70fdc3,null))[_0xac4a('0x25')](saveUpdates(_0x437466[_0xac4a('0x48')],null))[_0xac4a('0x25')](respondWithResult(_0x70fdc3,null))[_0xac4a('0x44')](handleError(_0x70fdc3,null));};exports[_0xac4a('0x26')]=function(_0x411547,_0x36179a){return db['AnalyticDefaultReport'][_0xac4a('0x4d')]({'where':{'id':_0x411547[_0xac4a('0x50')]['id']}})[_0xac4a('0x25')](handleEntityNotFound(_0x36179a,null))[_0xac4a('0x25')](removeEntity(_0x36179a,null))[_0xac4a('0x44')](handleError(_0x36179a,null));};exports[_0xac4a('0x51')]=function(_0x213df2,_0x236f57){var _0x159e43=0xa;var _0x786d9=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x5222f3={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xac4a('0x57'),'MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x5cac9b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x2f9940=function(_0xb7b884){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),'IS\x20NOT\x20EMPTY'],_0xb7b884);};var _0x347880=function(_0x19ce2c){if(!_0x19ce2c||!_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x429273='(',_0x2bc39a=0x0;_0x2bc39a<_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')];_0x2bc39a+=0x1){_0x2bc39a>0x0&&(_0x429273+='\x20'+_0x19ce2c[_0xac4a('0x62')]+'\x20');_0x429273+=_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]?_0x347880(_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]):_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x64')]+'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x65')]+(_0x2f9940(_0x19ce2c['rules'][_0x2bc39a][_0xac4a('0x65')])?'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a]['value']:'');}return _0x429273+')';};var _0x3c3576={'where':{'id':_0x213df2['params']['id']}},_0x34bd1c,_0x2d24c7,_0x2b8562,_0x357cac,_0x4d1440;_0x3c3576=_[_0xac4a('0x3b')]({},_0x3c3576,_0x213df2[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x3c3576)[_0xac4a('0x25')](function(_0x21ef8b){if(_0x21ef8b){_0x34bd1c=_0x21ef8b;return _0x21ef8b[_0xac4a('0x66')]();}return null;})[_0xac4a('0x25')](function(_0x44c60b){if(_0x44c60b){if(!_0x44c60b[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d24c7=_0x44c60b;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x423f70){if(_0x423f70){_0x2b8562=_[_0xac4a('0x69')](_0x423f70,'id');var _0x283107;var _0x1d24bb=squel[_0xac4a('0x6a')]();_0x1d24bb[_0xac4a('0x6b')](_0x34bd1c[_0xac4a('0x6c')]);for(var _0xb09b89=0x0;_0xb09b89<_0x2d24c7[_0xac4a('0x46')];_0xb09b89+=0x1){_0x283107=_0x2d24c7[_0xb09b89]['MetricId']?_0x2b8562[_0x2d24c7[_0xb09b89][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x2d24c7[_0xb09b89][_0xac4a('0x64')];_0x283107=_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]?_['replace'](_0x5222f3[_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]],'%s',_0x283107):_0x283107;_0x283107=_0x2d24c7[_0xb09b89]['format']?_[_0xac4a('0x70')](_0x5cac9b[_0x2d24c7[_0xb09b89][_0xac4a('0x71')]],'%s',_0x283107):_0x283107;if(_0x2d24c7[_0xb09b89]['groupBy']){_0x1d24bb['group'](_0x283107);}_0x2d24c7[_0xb09b89][_0xac4a('0x72')]&&_0x1d24bb[_0xac4a('0x38')](_0x283107,_0x2d24c7[_0xb09b89][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x1d24bb[_0xac4a('0x64')](_0x283107,_0x2d24c7[_0xb09b89]['alias']||_0x283107);}if(_0x34bd1c[_0xac4a('0x73')]){_0x34bd1c['joins']=JSON['parse'](_0x34bd1c[_0xac4a('0x73')]);for(var _0x56ef2a=0x0;_0x56ef2a<_0x34bd1c[_0xac4a('0x73')]['length'];_0x56ef2a+=0x1){if(_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x2e')]&&_['includes'](_0x786d9,_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type'])&&_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x74')]&&_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')]&&_0x34bd1c['joins'][_0x56ef2a]['foreignKey']){_0x1d24bb[_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type']](_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignTable'],null,util['format'](_0xac4a('0x76'),_0x34bd1c[_0xac4a('0x6c')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['parentKey'],_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignKey']));}}}if(_0x34bd1c['conditions']){_0x34bd1c[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x34bd1c[_0xac4a('0x77')]);_0x1d24bb[_0xac4a('0x3a')](_0x347880(_0x34bd1c[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x4d1440=_0x1d24bb[_0xac4a('0x79')]();_0x1d24bb[_0xac4a('0x1d')](_0x159e43);_0x1d24bb[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x1d24bb[_0xac4a('0x7b')]());return dbH[_0xac4a('0x7c')]['query'](_0x1d24bb[_0xac4a('0x7b')](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')][_0xac4a('0x7e')]});}})[_0xac4a('0x25')](respondWithResult(_0x236f57,null))['catch'](handleError(_0x236f57,null));};function runReport(_0x290a73,_0x19ce24,_0xc9d040){var _0x37e519=_0x19ce24[_0xac4a('0x2a')];var _0x451248=0xa;var _0xd7bdd6=['join',_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x35a97c={'SUM':_0xac4a('0x56'),'COUNT':_0xac4a('0x7f'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xac4a('0x80'),'MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x56a934={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x212a22=function(_0x1fe86a){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),_0xac4a('0x83')],_0x1fe86a);};var _0x406b64=function(_0x35328e){if(!_0x35328e||!_0x35328e[_0xac4a('0x61')]['length']){return'';}for(var _0x50f471='(',_0x31cda0=0x0;_0x31cda0<_0x35328e[_0xac4a('0x61')][_0xac4a('0x46')];_0x31cda0+=0x1){_0x31cda0>0x0&&(_0x50f471+='\x20'+_0x35328e[_0xac4a('0x62')]+'\x20');_0x50f471+=_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]?_0x406b64(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]):_0x35328e['rules'][_0x31cda0]['field']+'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')]+(_0x212a22(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')])?'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x84')]:'');}return _0x50f471+')';};var _0xdaa2ef={'where':{'id':_0x290a73['id']}},_0x2e704b,_0x540d8e,_0x5e0be4,_0x32fd0c,_0x168f30;_0xdaa2ef=_[_0xac4a('0x3b')]({},_0xdaa2ef,_0xc9d040);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0xdaa2ef)[_0xac4a('0x25')](function(_0x338af3){if(_0x338af3){_0x2e704b=_0x338af3;return _0x338af3['getFields']();}return null;})[_0xac4a('0x25')](function(_0x1bacf2){if(_0x1bacf2){if(!_0x1bacf2[_0xac4a('0x46')]){throw new db['Sequelize'][(_0xac4a('0x85'))](_0xac4a('0x86'),0x193);}_0x540d8e=_0x1bacf2;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x27d023){if(_0x27d023){_0x5e0be4=_[_0xac4a('0x69')](_0x27d023,'id');var _0x2ef42a;var _0x322465=squel['select']();_0x322465[_0xac4a('0x6b')](_0x2e704b['table']);for(var _0x203321=0x0;_0x203321<_0x540d8e[_0xac4a('0x46')];_0x203321+=0x1){_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6d')]?_0x5e0be4[_0x540d8e[_0x203321][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x540d8e[_0x203321][_0xac4a('0x64')];_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6f')]?_['replace'](_0x35a97c[_0x540d8e[_0x203321][_0xac4a('0x6f')]],'%s',_0x2ef42a):_0x2ef42a;_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x71')]?_[_0xac4a('0x70')](_0x56a934[_0x540d8e[_0x203321][_0xac4a('0x71')]],'%s',_0x2ef42a):_0x2ef42a;if(_0x540d8e[_0x203321][_0xac4a('0x87')]){_0x322465['group'](_0x2ef42a);}_0x540d8e[_0x203321][_0xac4a('0x72')]&&_0x322465[_0xac4a('0x38')](_0x2ef42a,_0x540d8e[_0x203321]['orderBy']==='DESC'?![]:!![]);_0x322465[_0xac4a('0x64')](_0x2ef42a,_0x540d8e[_0x203321][_0xac4a('0x88')]||_0x2ef42a);}if(_0x2e704b['joins']){_0x2e704b[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x73')]);for(var _0x37657e=0x0;_0x37657e<_0x2e704b[_0xac4a('0x73')][_0xac4a('0x46')];_0x37657e+=0x1){if(_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]&&_[_0xac4a('0x89')](_0xd7bdd6,_0x2e704b[_0xac4a('0x73')][_0x37657e]['type'])&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x74')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x75')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x8a')]){_0x322465[_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]](_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],null,util[_0xac4a('0x71')]('%s.%s\x20=\x20%s.%s',_0x2e704b[_0xac4a('0x6c')],_0x2e704b[_0xac4a('0x73')][_0x37657e]['parentKey'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignKey']));}}}if(_0x2e704b[_0xac4a('0x77')]){_0x2e704b[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x77')]);_0x322465[_0xac4a('0x3a')](_0x406b64(_0x2e704b[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x168f30=_0x322465[_0xac4a('0x79')]();_0x322465[_0xac4a('0x1d')](_0x451248);_0x322465[_0xac4a('0x1b')](0x0);return;}})[_0xac4a('0x25')](function(){if(_0x19ce24[_0xac4a('0x8b')]===_0xac4a('0x8c')){return null;}var _0x4217df=_['merge'](_0x19ce24,{'name':_0x19ce24[_0xac4a('0x8d')]||_0x19ce24[_0xac4a('0x2a')]||_0x2e704b['name'],'basename':_0x37e519,'savename':util[_0xac4a('0x71')](_0xac4a('0x8e'),_0x19ce24[_0xac4a('0x2a')]||_0x2e704b[_0xac4a('0x2a')],require(_0xac4a('0x8f'))['generate'](0x4),_0x19ce24[_0xac4a('0x8b')]||'csv'),'reportId':_0x2e704b['id'],'reportType':_0xac4a('0x90')});return db[_0xac4a('0x91')][_0xac4a('0x47')](_0x4217df,{'raw':!![]});})[_0xac4a('0x25')](function(_0x53f23d){if(_0x2e704b[_0xac4a('0x6c')]==='cdr'){_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+_0xac4a('0x92'),_0x19ce24['startDate'],_0x19ce24[_0xac4a('0x93')]);}else{_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x19ce24[_0xac4a('0x94')],_0x19ce24[_0xac4a('0x93')]);}if(_0x53f23d){logger[_0xac4a('0x95')](_0xac4a('0x96'),_0x168f30[_0xac4a('0x7b')]());require(_0xac4a('0x97'))[_0xac4a('0x98')](path[_0xac4a('0x52')](__dirname,'../../components/export/',_0x53f23d[_0xac4a('0x8b')]),[_0x53f23d['id'],_0x168f30['toString'](),path['join'](__dirname,'../../files/reports',_0x53f23d['savename']),_0x37e519]);return _0x53f23d;}else{var _0x502275=squel[_0xac4a('0x6a')]();_0x502275[_0xac4a('0x6b')]('('+_0x168f30[_0xac4a('0x7b')]()+')',_0xac4a('0x99'));_0x502275[_0xac4a('0x64')]('COUNT(*)',_0xac4a('0x1e'));_0x168f30[_0xac4a('0x1d')](_0x19ce24[_0xac4a('0x1d')]||_0x451248);_0x168f30[_0xac4a('0x1b')](_0x19ce24[_0xac4a('0x1b')]||0x0);return dbH[_0xac4a('0x7c')][_0xac4a('0x31')](_0x502275[_0xac4a('0x7b')](),{'type':dbH['sequelize'][_0xac4a('0x7d')][_0xac4a('0x7e')]})[_0xac4a('0x25')](function(_0x25331f){if(!_0x25331f[_0xac4a('0x46')]){_0x32fd0c=0x0;}else{_0x32fd0c=_0x25331f[0x0][_0xac4a('0x1e')]||0x0;}return dbH[_0xac4a('0x7c')]['query'](_0x168f30['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});})[_0xac4a('0x25')](function(_0x366f5a){return{'rows':_0x366f5a||[],'count':_0x32fd0c};});}});}exports['run']=function(_0x5bd013,_0x2fe103){return runReport(_0x5bd013[_0xac4a('0x50')],_0x5bd013[_0xac4a('0x31')],_0x5bd013[_0xac4a('0x3e')])[_0xac4a('0x25')](respondWithResult(_0x2fe103,null))['catch'](handleError(_0x2fe103,null));};exports[_0xac4a('0x9a')]=runReport;exports['query']=function(_0x4f2d85,_0x538cfd){var _0x63c30=0xa;var _0x4301c3=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0xcad25d={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':_0xac4a('0x9b'),'GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0xcd140e={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x37cb49=function(_0xe0fd57){return!_[_0xac4a('0x89')]([_0xac4a('0x5f'),_0xac4a('0x9c'),_0xac4a('0x60'),_0xac4a('0x83')],_0xe0fd57);};var _0x41cdb5=function(_0x172d03){if(!_0x172d03||!_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x3e2575='(',_0x4cc581=0x0;_0x4cc581<_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')];_0x4cc581+=0x1){_0x4cc581>0x0&&(_0x3e2575+='\x20'+_0x172d03[_0xac4a('0x62')]+'\x20');_0x3e2575+=_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]?_0x41cdb5(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]):_0x172d03[_0xac4a('0x61')][_0x4cc581]['field']+'\x20'+_0x172d03['rules'][_0x4cc581][_0xac4a('0x65')]+(_0x37cb49(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x65')])?'\x20'+_0x172d03['rules'][_0x4cc581]['value']:'');}return _0x3e2575+')';};var _0x5de198={'where':{'id':_0x4f2d85[_0xac4a('0x50')]['id']}},_0x2b6773,_0x52df82,_0x59e82c,_0x216055,_0x52963c;_0x5de198=_['merge']({},_0x5de198,_0x4f2d85[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x5de198)[_0xac4a('0x25')](function(_0x403a16){if(_0x403a16){_0x2b6773=_0x403a16;return _0x403a16[_0xac4a('0x66')]();}return null;})['then'](function(_0x25bf23){if(_0x25bf23){if(!_0x25bf23[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem'](_0xac4a('0x86'),0x193);}_0x52df82=_0x25bf23;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x5bb911){if(_0x5bb911){_0x59e82c=_[_0xac4a('0x69')](_0x5bb911,'id');var _0x403f5a;var _0x3eae2f=squel[_0xac4a('0x6a')]();_0x3eae2f[_0xac4a('0x6b')](_0x2b6773[_0xac4a('0x6c')]);for(var _0x4a0cd9=0x0;_0x4a0cd9<_0x52df82['length'];_0x4a0cd9+=0x1){_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]?_0x59e82c[_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x52df82[_0x4a0cd9][_0xac4a('0x64')];_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6f')]?_[_0xac4a('0x70')](_0xcad25d[_0x52df82[_0x4a0cd9]['function']],'%s',_0x403f5a):_0x403f5a;_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x71')]?_['replace'](_0xcd140e[_0x52df82[_0x4a0cd9][_0xac4a('0x71')]],'%s',_0x403f5a):_0x403f5a;if(_0x52df82[_0x4a0cd9]['groupBy']){_0x3eae2f[_0xac4a('0x63')](_0x403f5a);}_0x52df82[_0x4a0cd9][_0xac4a('0x72')]&&_0x3eae2f[_0xac4a('0x38')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x3eae2f[_0xac4a('0x64')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x88')]||_0x403f5a);}if(_0x2b6773[_0xac4a('0x73')]){_0x2b6773[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2b6773['joins']);for(var _0x3dd60a=0x0;_0x3dd60a<_0x2b6773[_0xac4a('0x73')][_0xac4a('0x46')];_0x3dd60a+=0x1){if(_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')]&&_['includes'](_0x4301c3,_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')])&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')]&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a]['foreignTable']&&_0x2b6773['joins'][_0x3dd60a]['foreignKey']){_0x3eae2f[_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x2e')]](_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x75')],null,util[_0xac4a('0x71')](_0xac4a('0x76'),_0x2b6773['table'],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')],_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x75')],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x8a')]));}}}if(_0x2b6773['conditions']){_0x2b6773[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2b6773[_0xac4a('0x77')]);_0x3eae2f[_0xac4a('0x3a')](_0x41cdb5(_0x2b6773[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x52963c=_0x3eae2f[_0xac4a('0x79')]();_0x3eae2f[_0xac4a('0x1d')](_0x63c30);_0x3eae2f[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x3eae2f[_0xac4a('0x7b')]());return dbH['sequelize'][_0xac4a('0x31')](_0x3eae2f['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});}})[_0xac4a('0x25')](function(){return{'sql':_0x52963c[_0xac4a('0x7b')]()};})[_0xac4a('0x25')](respondWithResult(_0x538cfd,null))[_0xac4a('0x44')](handleError(_0x538cfd,null));}; \ No newline at end of file +var _0x1261=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','limit','undefined','set','json','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','error','name','index','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','count','include','findAll','rows','show','length','includeAll','options','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','conditions','parse','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','AVG(%s)','DATE(%s)','value','keyBy','select','order','%s.%s\x20=\x20%s.%s','clone','web','fullPath','randomstring','generate','output','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','Run\x20Query:','../../components/export/','savename','COUNT(*)','run','runReport','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','Sequelize','debug'];(function(_0x2dc840,_0x4a569e){var _0x2821a=function(_0x37705b){while(--_0x37705b){_0x2dc840['push'](_0x2dc840['shift']());}};_0x2821a(++_0x4a569e);}(_0x1261,0x144));var _0x1126=function(_0x3d8776,_0x5305dc){_0x3d8776=_0x3d8776-0x0;var _0x51d331=_0x1261[_0x3d8776];return _0x51d331;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1126('0x0'));var zipdir=require(_0x1126('0x1'));var jsonpatch=require(_0x1126('0x2'));var rp=require(_0x1126('0x3'));var moment=require(_0x1126('0x4'));var BPromise=require(_0x1126('0x5'));var Mustache=require(_0x1126('0x6'));var util=require(_0x1126('0x7'));var path=require(_0x1126('0x8'));var sox=require(_0x1126('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1126('0xa'));var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1126('0x16'));var db=require(_0x1126('0x17'))['db'];var dbH=require(_0x1126('0x17'))[_0x1126('0x18')];function respondWithStatusCode(_0xca0355,_0x3f10e9){_0x3f10e9=_0x3f10e9||0xcc;return function(_0xd8ca42){if(_0xd8ca42){return _0xca0355[_0x1126('0x19')](_0x3f10e9);}return _0xca0355[_0x1126('0x1a')](_0x3f10e9)['end']();};}function respondWithResult(_0x5de9a7,_0x1af673){_0x1af673=_0x1af673||0xc8;return function(_0x154e20){if(_0x154e20){return _0x5de9a7[_0x1126('0x1a')](_0x1af673)['json'](_0x154e20);}};}function respondWithFilteredResult(_0x45149c,_0x4794a7){return function(_0x35fe9f){if(_0x35fe9f){var _0x42f379=typeof _0x4794a7[_0x1126('0x1b')]==='undefined'&&typeof _0x4794a7[_0x1126('0x1c')]===_0x1126('0x1d');var _0x4a7b49=_0x35fe9f['count'];var _0x22ae0b=_0x42f379?0x0:_0x4794a7[_0x1126('0x1b')];var _0x58d11a=_0x42f379?_0x35fe9f['count']:_0x4794a7[_0x1126('0x1b')]+_0x4794a7['limit'];var _0x22ed37;if(_0x58d11a>=_0x4a7b49){_0x58d11a=_0x4a7b49;_0x22ed37=0xc8;}else{_0x22ed37=0xce;}_0x45149c[_0x1126('0x1a')](_0x22ed37);return _0x45149c[_0x1126('0x1e')]('Content-Range',_0x22ae0b+'-'+_0x58d11a+'/'+_0x4a7b49)[_0x1126('0x1f')](_0x35fe9f);}return null;};}function patchUpdates(_0x49d209){return function(_0x56efeb){try{jsonpatch[_0x1126('0x20')](_0x56efeb,_0x49d209,!![]);}catch(_0x3a9bed){return BPromise[_0x1126('0x21')](_0x3a9bed);}return _0x56efeb[_0x1126('0x22')]();};}function saveUpdates(_0x526ca1,_0x29ab60){return function(_0x477e6a){if(_0x477e6a){return _0x477e6a['update'](_0x526ca1)[_0x1126('0x23')](function(_0x59cd8e){return _0x59cd8e;});}return null;};}function removeEntity(_0x529dd9,_0x4b57ab){return function(_0x2199d9){if(_0x2199d9){return _0x2199d9[_0x1126('0x24')]()[_0x1126('0x23')](function(){var _0x34bcf1=_0x2199d9[_0x1126('0x25')]({'plain':!![]});var _0x1b07a7=_0x1126('0x26');return db[_0x1126('0x27')]['destroy']({'where':{'type':_0x1b07a7,'resourceId':_0x34bcf1['id']}})[_0x1126('0x23')](function(){return _0x2199d9;});})[_0x1126('0x23')](function(){_0x529dd9[_0x1126('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x541bc9,_0xeb7d89){return function(_0x39bf0e){if(!_0x39bf0e){_0x541bc9['sendStatus'](0x194);}return _0x39bf0e;};}function handleError(_0x2fb797,_0x23d2bc){_0x23d2bc=_0x23d2bc||0x1f4;return function(_0x4a334a){logger[_0x1126('0x28')](_0x4a334a['stack']);if(_0x4a334a[_0x1126('0x29')]){delete _0x4a334a['name'];}_0x2fb797[_0x1126('0x1a')](_0x23d2bc)['send'](_0x4a334a);};}exports[_0x1126('0x2a')]=function(_0x5f2611,_0x5252e0){var _0x4a53ab={},_0x17646e={},_0xa8906d={'count':0x0,'rows':[]};var _0x1cef48=_['map'](db[_0x1126('0x2b')][_0x1126('0x2c')],function(_0x56f7f8){return{'name':_0x56f7f8[_0x1126('0x2d')],'type':_0x56f7f8[_0x1126('0x2e')][_0x1126('0x2f')]};});_0x17646e[_0x1126('0x30')]=_['map'](_0x1cef48,'name');_0x17646e[_0x1126('0x31')]=_[_0x1126('0x32')](_0x5f2611[_0x1126('0x31')]);_0x17646e[_0x1126('0x33')]=_['intersection'](_0x17646e[_0x1126('0x30')],_0x17646e[_0x1126('0x31')]);_0x4a53ab[_0x1126('0x34')]=_[_0x1126('0x35')](_0x17646e[_0x1126('0x30')],qs['fields'](_0x5f2611[_0x1126('0x31')][_0x1126('0x36')]));_0x4a53ab[_0x1126('0x34')]=_0x4a53ab[_0x1126('0x34')]['length']?_0x4a53ab['attributes']:_0x17646e[_0x1126('0x30')];if(!_0x5f2611[_0x1126('0x31')]['hasOwnProperty'](_0x1126('0x37'))){_0x4a53ab[_0x1126('0x1c')]=qs[_0x1126('0x1c')](_0x5f2611['query']['limit']);_0x4a53ab[_0x1126('0x1b')]=qs[_0x1126('0x1b')](_0x5f2611[_0x1126('0x31')][_0x1126('0x1b')]);}_0x4a53ab['order']=qs[_0x1126('0x38')](_0x5f2611['query'][_0x1126('0x38')]);_0x4a53ab[_0x1126('0x39')]=qs[_0x1126('0x33')](_[_0x1126('0x3a')](_0x5f2611[_0x1126('0x31')],_0x17646e['filters']),_0x1cef48);if(_0x5f2611[_0x1126('0x31')][_0x1126('0x3b')]){_0x4a53ab[_0x1126('0x39')]=_[_0x1126('0x3c')](_0x4a53ab[_0x1126('0x39')],{'$or':_[_0x1126('0x3d')](_0x1cef48,function(_0x3052f9){if(_0x3052f9['type']!==_0x1126('0x3e')){var _0x154c28={};_0x154c28[_0x3052f9[_0x1126('0x29')]]={'$like':'%'+_0x5f2611[_0x1126('0x31')][_0x1126('0x3b')]+'%'};return _0x154c28;}})});}_0x4a53ab=_['merge']({},_0x4a53ab,_0x5f2611['options']);var _0x1c4f06={'where':_0x4a53ab[_0x1126('0x39')]};return db[_0x1126('0x2b')][_0x1126('0x3f')](_0x1c4f06)[_0x1126('0x23')](function(_0x276fd5){_0xa8906d['count']=_0x276fd5;if(_0x5f2611['query']['includeAll']){_0x4a53ab[_0x1126('0x40')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x1126('0x41')](_0x4a53ab);})[_0x1126('0x23')](function(_0x3584a3){_0xa8906d[_0x1126('0x42')]=_0x3584a3;return _0xa8906d;})['then'](respondWithFilteredResult(_0x5252e0,_0x4a53ab))['catch'](handleError(_0x5252e0,null));};exports[_0x1126('0x43')]=function(_0xa93167,_0x1d63b9){var _0x5f5d3a={'raw':!![],'where':{'id':_0xa93167['params']['id']}},_0x2f8551={};_0x2f8551[_0x1126('0x30')]=_['keys'](db[_0x1126('0x2b')][_0x1126('0x2c')]);_0x2f8551[_0x1126('0x31')]=_['keys'](_0xa93167[_0x1126('0x31')]);_0x2f8551[_0x1126('0x33')]=_[_0x1126('0x35')](_0x2f8551['model'],_0x2f8551['query']);_0x5f5d3a['attributes']=_[_0x1126('0x35')](_0x2f8551['model'],qs[_0x1126('0x36')](_0xa93167['query'][_0x1126('0x36')]));_0x5f5d3a[_0x1126('0x34')]=_0x5f5d3a[_0x1126('0x34')][_0x1126('0x44')]?_0x5f5d3a[_0x1126('0x34')]:_0x2f8551['model'];if(_0xa93167[_0x1126('0x31')][_0x1126('0x45')]){_0x5f5d3a['include']=[{'all':!![]}];}_0x5f5d3a=_[_0x1126('0x3c')]({},_0x5f5d3a,_0xa93167[_0x1126('0x46')]);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x5f5d3a)[_0x1126('0x23')](handleEntityNotFound(_0x1d63b9,null))['then'](respondWithResult(_0x1d63b9,null))[_0x1126('0x48')](handleError(_0x1d63b9,null));};exports[_0x1126('0x49')]=function(_0x213a76,_0x59656d){return db[_0x1126('0x2b')][_0x1126('0x49')](_0x213a76[_0x1126('0x4a')],{})[_0x1126('0x23')](function(_0x224456){var _0x2081f2=_0x213a76[_0x1126('0x4b')][_0x1126('0x25')]({'plain':!![]});if(!_0x2081f2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2081f2[_0x1126('0x4c')]==='user'){var _0x40168e=_0x224456[_0x1126('0x25')]({'plain':!![]});var _0x4a1831='Reports';return db[_0x1126('0x4d')][_0x1126('0x47')]({'where':{'name':_0x4a1831,'userProfileId':_0x2081f2[_0x1126('0x4e')]},'raw':!![]})['then'](function(_0x3cb44c){if(_0x3cb44c&&_0x3cb44c[_0x1126('0x4f')]===0x0){return db[_0x1126('0x27')][_0x1126('0x49')]({'name':_0x40168e['name'],'resourceId':_0x40168e['id'],'type':_0x1126('0x26'),'sectionId':_0x3cb44c['id']},{})[_0x1126('0x23')](function(){return _0x224456;});}else{return _0x224456;}})['catch'](function(_0x4bcc08){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4bcc08);throw _0x4bcc08;});}return _0x224456;})[_0x1126('0x23')](respondWithResult(_0x59656d,0xc9))[_0x1126('0x48')](handleError(_0x59656d,null));};exports['update']=function(_0x16552b,_0x1c7a2b){if(_0x16552b[_0x1126('0x4a')]['id']){delete _0x16552b[_0x1126('0x4a')]['id'];}return db[_0x1126('0x2b')]['find']({'where':{'id':_0x16552b[_0x1126('0x50')]['id']}})[_0x1126('0x23')](handleEntityNotFound(_0x1c7a2b,null))['then'](saveUpdates(_0x16552b[_0x1126('0x4a')],null))[_0x1126('0x23')](respondWithResult(_0x1c7a2b,null))[_0x1126('0x48')](handleError(_0x1c7a2b,null));};exports[_0x1126('0x24')]=function(_0xc8a0f,_0x59c3d0){return db[_0x1126('0x2b')]['find']({'where':{'id':_0xc8a0f[_0x1126('0x50')]['id']}})[_0x1126('0x23')](handleEntityNotFound(_0x59c3d0,null))[_0x1126('0x23')](removeEntity(_0x59c3d0,null))['catch'](handleError(_0x59c3d0,null));};exports[_0x1126('0x51')]=function(_0x2340f8,_0x5763b4){var _0x30812d=0xa;var _0x25038f=[_0x1126('0x52'),'left_join',_0x1126('0x53'),_0x1126('0x54')];var _0x22ab18={'SUM':_0x1126('0x55'),'COUNT':_0x1126('0x56'),'COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':_0x1126('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x1126('0x5a'),'GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x2a5422={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':'DATE(%s)','HOUR':_0x1126('0x5e'),'ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3767e4=function(_0x5246aa){return!_[_0x1126('0x60')]([_0x1126('0x61'),'IS\x20NOT\x20NULL',_0x1126('0x62'),_0x1126('0x63')],_0x5246aa);};var _0x375b76=function(_0x592960){if(!_0x592960||!_0x592960[_0x1126('0x64')]['length']){return'';}for(var _0x558b6e='(',_0xbdc58=0x0;_0xbdc58<_0x592960[_0x1126('0x64')][_0x1126('0x44')];_0xbdc58+=0x1){_0xbdc58>0x0&&(_0x558b6e+='\x20'+_0x592960[_0x1126('0x65')]+'\x20');_0x558b6e+=_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x66')]?_0x375b76(_0x592960[_0x1126('0x64')][_0xbdc58]['group']):_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x67')]+'\x20'+_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x68')]+(_0x3767e4(_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x68')])?'\x20'+_0x592960['rules'][_0xbdc58]['value']:'');}return _0x558b6e+')';};var _0x16a343={'where':{'id':_0x2340f8[_0x1126('0x50')]['id']}},_0x3921c2,_0x4bf2b3,_0x5ee130,_0x5e9260,_0x51a28d;_0x16a343=_[_0x1126('0x3c')]({},_0x16a343,_0x2340f8[_0x1126('0x46')]);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x16a343)[_0x1126('0x23')](function(_0x170bf0){if(_0x170bf0){_0x3921c2=_0x170bf0;return _0x170bf0[_0x1126('0x69')]();}return null;})[_0x1126('0x23')](function(_0x3f007b){if(_0x3f007b){if(!_0x3f007b[_0x1126('0x44')]){throw new db['Sequelize'][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x4bf2b3=_0x3f007b;return db[_0x1126('0x6c')][_0x1126('0x41')]({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0x56c003){if(_0x56c003){_0x5ee130=_['keyBy'](_0x56c003,'id');var _0x15cf3d;var _0x2643d7=squel['select']();_0x2643d7[_0x1126('0x6d')](_0x3921c2[_0x1126('0x6e')]);for(var _0x366675=0x0;_0x366675<_0x4bf2b3[_0x1126('0x44')];_0x366675+=0x1){_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x6f')]?_0x5ee130[_0x4bf2b3[_0x366675][_0x1126('0x6f')]][_0x1126('0x70')]:_0x4bf2b3[_0x366675][_0x1126('0x67')];_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x71')]?_[_0x1126('0x72')](_0x22ab18[_0x4bf2b3[_0x366675][_0x1126('0x71')]],'%s',_0x15cf3d):_0x15cf3d;_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x73')]?_[_0x1126('0x72')](_0x2a5422[_0x4bf2b3[_0x366675]['format']],'%s',_0x15cf3d):_0x15cf3d;if(_0x4bf2b3[_0x366675][_0x1126('0x74')]){_0x2643d7[_0x1126('0x66')](_0x15cf3d);}_0x4bf2b3[_0x366675][_0x1126('0x75')]&&_0x2643d7['order'](_0x15cf3d,_0x4bf2b3[_0x366675]['orderBy']===_0x1126('0x76')?![]:!![]);_0x2643d7[_0x1126('0x67')](_0x15cf3d,_0x4bf2b3[_0x366675][_0x1126('0x77')]||_0x15cf3d);}if(_0x3921c2[_0x1126('0x78')]){_0x3921c2['joins']=JSON['parse'](_0x3921c2['joins']);for(var _0x79afca=0x0;_0x79afca<_0x3921c2[_0x1126('0x78')][_0x1126('0x44')];_0x79afca+=0x1){if(_0x3921c2[_0x1126('0x78')][_0x79afca]['type']&&_[_0x1126('0x60')](_0x25038f,_0x3921c2['joins'][_0x79afca][_0x1126('0x2e')])&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x79')]&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7a')]&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7b')]){_0x2643d7[_0x3921c2['joins'][_0x79afca][_0x1126('0x2e')]](_0x3921c2['joins'][_0x79afca][_0x1126('0x7a')],null,util[_0x1126('0x73')]('%s.%s\x20=\x20%s.%s',_0x3921c2[_0x1126('0x6e')],_0x3921c2[_0x1126('0x78')][_0x79afca]['parentKey'],_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7a')],_0x3921c2['joins'][_0x79afca]['foreignKey']));}}}if(_0x3921c2[_0x1126('0x7c')]){_0x3921c2[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x3921c2['conditions']);_0x2643d7['where'](_0x375b76(_0x3921c2['conditions'][_0x1126('0x66')]));}_0x51a28d=_0x2643d7['clone']();_0x2643d7['limit'](_0x30812d);_0x2643d7[_0x1126('0x1b')](0x0);logger['debug'](_0x1126('0x7e'),_0x2643d7[_0x1126('0x7f')]());return dbH['sequelize'][_0x1126('0x31')](_0x2643d7[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]});}})['then'](respondWithResult(_0x5763b4,null))[_0x1126('0x48')](handleError(_0x5763b4,null));};function runReport(_0x426faa,_0x5679ec,_0xd182b1){var _0x2d6fcf=_0x5679ec[_0x1126('0x29')];var _0x2af2d0=0xa;var _0x2598a7=[_0x1126('0x52'),_0x1126('0x83'),_0x1126('0x53'),_0x1126('0x54')];var _0x9a2af0={'SUM':_0x1126('0x55'),'COUNT':_0x1126('0x56'),'COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':_0x1126('0x59'),'AVG':_0x1126('0x84'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x33cccf={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':_0x1126('0x85'),'HOUR':'HOUR(%s)','ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5bdb30=function(_0xb1199b){return!_[_0x1126('0x60')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x1126('0x62'),_0x1126('0x63')],_0xb1199b);};var _0x228552=function(_0x1ee970){if(!_0x1ee970||!_0x1ee970[_0x1126('0x64')][_0x1126('0x44')]){return'';}for(var _0x2d7150='(',_0x35a9a4=0x0;_0x35a9a4<_0x1ee970[_0x1126('0x64')]['length'];_0x35a9a4+=0x1){_0x35a9a4>0x0&&(_0x2d7150+='\x20'+_0x1ee970[_0x1126('0x65')]+'\x20');_0x2d7150+=_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x66')]?_0x228552(_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x66')]):_0x1ee970[_0x1126('0x64')][_0x35a9a4]['field']+'\x20'+_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x68')]+(_0x5bdb30(_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x68')])?'\x20'+_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x86')]:'');}return _0x2d7150+')';};var _0x2418ca={'where':{'id':_0x426faa['id']}},_0x2d2dfc,_0x38eac6,_0xc3503b,_0x5d6edb,_0x50238d;_0x2418ca=_[_0x1126('0x3c')]({},_0x2418ca,_0xd182b1);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x2418ca)['then'](function(_0x4461ae){if(_0x4461ae){_0x2d2dfc=_0x4461ae;return _0x4461ae['getFields']();}return null;})[_0x1126('0x23')](function(_0x4fbd44){if(_0x4fbd44){if(!_0x4fbd44['length']){throw new db['Sequelize'][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x38eac6=_0x4fbd44;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0xe2f82d){if(_0xe2f82d){_0xc3503b=_[_0x1126('0x87')](_0xe2f82d,'id');var _0x5dfb8f;var _0x48f914=squel[_0x1126('0x88')]();_0x48f914['from'](_0x2d2dfc[_0x1126('0x6e')]);for(var _0x39d9a0=0x0;_0x39d9a0<_0x38eac6[_0x1126('0x44')];_0x39d9a0+=0x1){_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x6f')]?_0xc3503b[_0x38eac6[_0x39d9a0][_0x1126('0x6f')]]['metric']:_0x38eac6[_0x39d9a0]['field'];_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x71')]?_[_0x1126('0x72')](_0x9a2af0[_0x38eac6[_0x39d9a0][_0x1126('0x71')]],'%s',_0x5dfb8f):_0x5dfb8f;_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x73')]?_[_0x1126('0x72')](_0x33cccf[_0x38eac6[_0x39d9a0][_0x1126('0x73')]],'%s',_0x5dfb8f):_0x5dfb8f;if(_0x38eac6[_0x39d9a0][_0x1126('0x74')]){_0x48f914[_0x1126('0x66')](_0x5dfb8f);}_0x38eac6[_0x39d9a0][_0x1126('0x75')]&&_0x48f914[_0x1126('0x89')](_0x5dfb8f,_0x38eac6[_0x39d9a0][_0x1126('0x75')]==='DESC'?![]:!![]);_0x48f914[_0x1126('0x67')](_0x5dfb8f,_0x38eac6[_0x39d9a0]['alias']||_0x5dfb8f);}if(_0x2d2dfc[_0x1126('0x78')]){_0x2d2dfc['joins']=JSON[_0x1126('0x7d')](_0x2d2dfc[_0x1126('0x78')]);for(var _0x215d4d=0x0;_0x215d4d<_0x2d2dfc[_0x1126('0x78')]['length'];_0x215d4d+=0x1){if(_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x2e')]&&_['includes'](_0x2598a7,_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x2e')])&&_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x79')]&&_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x7a')]&&_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x7b')]){_0x48f914[_0x2d2dfc[_0x1126('0x78')][_0x215d4d]['type']](_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x7a')],null,util[_0x1126('0x73')](_0x1126('0x8a'),_0x2d2dfc[_0x1126('0x6e')],_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x79')],_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x7a')],_0x2d2dfc['joins'][_0x215d4d]['foreignKey']));}}}if(_0x2d2dfc['conditions']){_0x2d2dfc[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x2d2dfc[_0x1126('0x7c')]);_0x48f914[_0x1126('0x39')](_0x228552(_0x2d2dfc['conditions'][_0x1126('0x66')]));}_0x50238d=_0x48f914[_0x1126('0x8b')]();_0x48f914[_0x1126('0x1c')](_0x2af2d0);_0x48f914[_0x1126('0x1b')](0x0);return;}})[_0x1126('0x23')](function(){if(_0x5679ec['output']===_0x1126('0x8c')){return null;}var _0x21c487=_['merge'](_0x5679ec,{'name':_0x5679ec[_0x1126('0x8d')]||_0x5679ec['name']||_0x2d2dfc['name'],'basename':_0x2d6fcf,'savename':util[_0x1126('0x73')]('%s-%s.%s',_0x5679ec[_0x1126('0x29')]||_0x2d2dfc[_0x1126('0x29')],require(_0x1126('0x8e'))[_0x1126('0x8f')](0x4),_0x5679ec[_0x1126('0x90')]||_0x1126('0x91')),'reportId':_0x2d2dfc['id'],'reportType':_0x1126('0x92')});return db[_0x1126('0x93')][_0x1126('0x49')](_0x21c487,{'raw':!![]});})['then'](function(_0x2577f5){if(_0x2d2dfc[_0x1126('0x6e')]===_0x1126('0x94')){_0x50238d[_0x1126('0x39')](_0x2d2dfc['table']+_0x1126('0x95'),_0x5679ec[_0x1126('0x96')],_0x5679ec[_0x1126('0x97')]);}else{_0x50238d[_0x1126('0x39')](_0x2d2dfc['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5679ec['startDate'],_0x5679ec[_0x1126('0x97')]);}if(_0x2577f5){logger['info'](_0x1126('0x98'),_0x50238d[_0x1126('0x7f')]());require('child_process')['fork'](path[_0x1126('0x52')](__dirname,_0x1126('0x99'),_0x2577f5['output']),[_0x2577f5['id'],_0x50238d[_0x1126('0x7f')](),path[_0x1126('0x52')](__dirname,'../../files/reports',_0x2577f5[_0x1126('0x9a')]),_0x2d6fcf]);return _0x2577f5;}else{var _0x4a9941=squel[_0x1126('0x88')]();_0x4a9941[_0x1126('0x6d')]('('+_0x50238d[_0x1126('0x7f')]()+')','countTable');_0x4a9941[_0x1126('0x67')](_0x1126('0x9b'),_0x1126('0x3f'));_0x50238d[_0x1126('0x1c')](_0x5679ec[_0x1126('0x1c')]||_0x2af2d0);_0x50238d[_0x1126('0x1b')](_0x5679ec[_0x1126('0x1b')]||0x0);return dbH[_0x1126('0x80')][_0x1126('0x31')](_0x4a9941[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]})[_0x1126('0x23')](function(_0x12ffa5){if(!_0x12ffa5[_0x1126('0x44')]){_0x5d6edb=0x0;}else{_0x5d6edb=_0x12ffa5[0x0][_0x1126('0x3f')]||0x0;}return dbH['sequelize'][_0x1126('0x31')](_0x50238d[_0x1126('0x7f')](),{'type':dbH['sequelize']['QueryTypes'][_0x1126('0x82')]});})[_0x1126('0x23')](function(_0x35065c){return{'rows':_0x35065c||[],'count':_0x5d6edb};});}});}exports[_0x1126('0x9c')]=function(_0x5c0215,_0x444f94){return runReport(_0x5c0215[_0x1126('0x50')],_0x5c0215['query'],_0x5c0215[_0x1126('0x46')])['then'](respondWithResult(_0x444f94,null))[_0x1126('0x48')](handleError(_0x444f94,null));};exports[_0x1126('0x9d')]=runReport;exports['query']=function(_0x4d43ad,_0xa02d9e){var _0x548f9e=0xa;var _0x5edb83=[_0x1126('0x52'),_0x1126('0x83'),_0x1126('0x53'),_0x1126('0x54')];var _0x4f29ce={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':'MIN(%s)','AVG':_0x1126('0x84'),'GROUP_CONCAT':_0x1126('0x5a'),'GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x17b25d={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':_0x1126('0x85'),'HOUR':_0x1126('0x5e'),'ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':_0x1126('0x9e')};var _0x3a4a91=function(_0x55145f){return!_[_0x1126('0x60')](['IS\x20NULL',_0x1126('0x9f'),_0x1126('0x62'),_0x1126('0x63')],_0x55145f);};var _0x4c7dc7=function(_0x33a27b){if(!_0x33a27b||!_0x33a27b[_0x1126('0x64')][_0x1126('0x44')]){return'';}for(var _0x578c1b='(',_0x1562b2=0x0;_0x1562b2<_0x33a27b[_0x1126('0x64')][_0x1126('0x44')];_0x1562b2+=0x1){_0x1562b2>0x0&&(_0x578c1b+='\x20'+_0x33a27b[_0x1126('0x65')]+'\x20');_0x578c1b+=_0x33a27b[_0x1126('0x64')][_0x1562b2]['group']?_0x4c7dc7(_0x33a27b['rules'][_0x1562b2][_0x1126('0x66')]):_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x67')]+'\x20'+_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x68')]+(_0x3a4a91(_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x68')])?'\x20'+_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x86')]:'');}return _0x578c1b+')';};var _0x2fb228={'where':{'id':_0x4d43ad[_0x1126('0x50')]['id']}},_0x2c95b6,_0x4a4b43,_0x588f4f,_0x5ac4d6,_0x1168a5;_0x2fb228=_['merge']({},_0x2fb228,_0x4d43ad['options']);return db[_0x1126('0x2b')][_0x1126('0x47')](_0x2fb228)[_0x1126('0x23')](function(_0x48b088){if(_0x48b088){_0x2c95b6=_0x48b088;return _0x48b088[_0x1126('0x69')]();}return null;})[_0x1126('0x23')](function(_0x5a28f9){if(_0x5a28f9){if(!_0x5a28f9[_0x1126('0x44')]){throw new db[(_0x1126('0xa0'))][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x4a4b43=_0x5a28f9;return db[_0x1126('0x6c')]['findAll']({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0x1140ec){if(_0x1140ec){_0x588f4f=_['keyBy'](_0x1140ec,'id');var _0x578f5c;var _0x559dae=squel[_0x1126('0x88')]();_0x559dae[_0x1126('0x6d')](_0x2c95b6[_0x1126('0x6e')]);for(var _0x9d7819=0x0;_0x9d7819<_0x4a4b43[_0x1126('0x44')];_0x9d7819+=0x1){_0x578f5c=_0x4a4b43[_0x9d7819]['MetricId']?_0x588f4f[_0x4a4b43[_0x9d7819][_0x1126('0x6f')]]['metric']:_0x4a4b43[_0x9d7819][_0x1126('0x67')];_0x578f5c=_0x4a4b43[_0x9d7819][_0x1126('0x71')]?_['replace'](_0x4f29ce[_0x4a4b43[_0x9d7819]['function']],'%s',_0x578f5c):_0x578f5c;_0x578f5c=_0x4a4b43[_0x9d7819][_0x1126('0x73')]?_[_0x1126('0x72')](_0x17b25d[_0x4a4b43[_0x9d7819]['format']],'%s',_0x578f5c):_0x578f5c;if(_0x4a4b43[_0x9d7819]['groupBy']){_0x559dae[_0x1126('0x66')](_0x578f5c);}_0x4a4b43[_0x9d7819][_0x1126('0x75')]&&_0x559dae[_0x1126('0x89')](_0x578f5c,_0x4a4b43[_0x9d7819][_0x1126('0x75')]===_0x1126('0x76')?![]:!![]);_0x559dae[_0x1126('0x67')](_0x578f5c,_0x4a4b43[_0x9d7819][_0x1126('0x77')]||_0x578f5c);}if(_0x2c95b6[_0x1126('0x78')]){_0x2c95b6[_0x1126('0x78')]=JSON[_0x1126('0x7d')](_0x2c95b6['joins']);for(var _0x4d6528=0x0;_0x4d6528<_0x2c95b6[_0x1126('0x78')][_0x1126('0x44')];_0x4d6528+=0x1){if(_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x2e')]&&_[_0x1126('0x60')](_0x5edb83,_0x2c95b6[_0x1126('0x78')][_0x4d6528]['type'])&&_0x2c95b6['joins'][_0x4d6528][_0x1126('0x79')]&&_0x2c95b6['joins'][_0x4d6528]['foreignTable']&&_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7b')]){_0x559dae[_0x2c95b6['joins'][_0x4d6528][_0x1126('0x2e')]](_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7a')],null,util[_0x1126('0x73')]('%s.%s\x20=\x20%s.%s',_0x2c95b6[_0x1126('0x6e')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x79')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7a')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7b')]));}}}if(_0x2c95b6['conditions']){_0x2c95b6[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x2c95b6[_0x1126('0x7c')]);_0x559dae[_0x1126('0x39')](_0x4c7dc7(_0x2c95b6['conditions'][_0x1126('0x66')]));}_0x1168a5=_0x559dae[_0x1126('0x8b')]();_0x559dae['limit'](_0x548f9e);_0x559dae[_0x1126('0x1b')](0x0);logger[_0x1126('0xa1')](_0x1126('0x7e'),_0x559dae['toString']());return dbH[_0x1126('0x80')][_0x1126('0x31')](_0x559dae[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]});}})['then'](function(){return{'sql':_0x1168a5[_0x1126('0x7f')]()};})[_0x1126('0x23')](respondWithResult(_0xa02d9e,null))['catch'](handleError(_0xa02d9e,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 1c5e984..3840b3a 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 _0xb694=['exports','define','AnalyticDefaultReport','lodash','util','bluebird','request-promise','rimraf'];(function(_0x2be2ff,_0x4a4e07){var _0x2b0ed3=function(_0x2d1843){while(--_0x2d1843){_0x2be2ff['push'](_0x2be2ff['shift']());}};_0x2b0ed3(++_0x4a4e07);}(_0xb694,0xcb));var _0x4b69=function(_0x51888b,_0x5f1ce9){_0x51888b=_0x51888b-0x0;var _0x29baa6=_0xb694[_0x51888b];return _0x29baa6;};'use strict';var _=require(_0x4b69('0x0'));var util=require(_0x4b69('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x4b69('0x2'));var rp=require(_0x4b69('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4b69('0x4'));var config=require('../../config/environment');var attributes=require('./analyticDefaultReport.attributes');module[_0x4b69('0x5')]=function(_0xca7592,_0x2f937d){return _0xca7592[_0x4b69('0x6')](_0x4b69('0x7'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x480a=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','util'];(function(_0x4697d9,_0x2376a3){var _0x5d32b0=function(_0x498900){while(--_0x498900){_0x4697d9['push'](_0x4697d9['shift']());}};_0x5d32b0(++_0x2376a3);}(_0x480a,0x19f));var _0xa480=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x480a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xa480('0x0'));var logger=require(_0xa480('0x1'))(_0xa480('0x2'));var moment=require(_0xa480('0x3'));var BPromise=require(_0xa480('0x4'));var rp=require(_0xa480('0x5'));var fs=require('fs');var path=require(_0xa480('0x6'));var rimraf=require(_0xa480('0x7'));var config=require('../../config/environment');var attributes=require(_0xa480('0x8'));module[_0xa480('0x9')]=function(_0x53cf15,_0x207d1e){return _0x53cf15[_0xa480('0xa')](_0xa480('0xb'),attributes,{'tableName':_0xa480('0xc'),'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 ff3e4d6..2504a7f 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 _0x8fd3=['catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','client','request','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x46fc6c,_0x297637){var _0x18694f=function(_0x34e1e0){while(--_0x34e1e0){_0x46fc6c['push'](_0x46fc6c['shift']());}};_0x18694f(++_0x297637);}(_0x8fd3,0x1a5));var _0x38fd=function(_0x4aec3e,_0x1c9afd){_0x4aec3e=_0x4aec3e-0x0;var _0x59cae3=_0x8fd3[_0x4aec3e];return _0x59cae3;};'use strict';var _=require(_0x38fd('0x0'));var util=require(_0x38fd('0x1'));var moment=require(_0x38fd('0x2'));var BPromise=require(_0x38fd('0x3'));var rs=require(_0x38fd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x38fd('0x5'))(_0x38fd('0x6'));var config=require(_0x38fd('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x38fd('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12a3f0,_0x568b14,_0x4ea202){return new BPromise(function(_0x36be61,_0x1a2e0e){return client[_0x38fd('0x9')](_0x12a3f0,_0x4ea202)['then'](function(_0x1dfb6c){logger[_0x38fd('0xa')](_0x38fd('0xb'),_0x568b14,_0x38fd('0xc'));logger[_0x38fd('0xd')](_0x38fd('0xe'),_0x568b14,_0x38fd('0xc'),JSON[_0x38fd('0xf')](_0x1dfb6c));if(_0x1dfb6c['error']){if(_0x1dfb6c[_0x38fd('0x10')][_0x38fd('0x11')]===0x1f4){logger[_0x38fd('0x10')](_0x38fd('0xb'),_0x568b14,_0x1dfb6c[_0x38fd('0x10')][_0x38fd('0x12')]);return _0x1a2e0e(_0x1dfb6c[_0x38fd('0x10')][_0x38fd('0x12')]);}logger[_0x38fd('0x10')](_0x38fd('0xb'),_0x568b14,_0x1dfb6c['error'][_0x38fd('0x12')]);return _0x36be61(_0x1dfb6c[_0x38fd('0x10')]['message']);}else{logger[_0x38fd('0xa')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x568b14,_0x38fd('0xc'));_0x36be61(_0x1dfb6c['result'][_0x38fd('0x12')]);}})[_0x38fd('0x13')](function(_0x50eaa8){logger[_0x38fd('0x10')](_0x38fd('0xb'),_0x568b14,_0x50eaa8);_0x1a2e0e(_0x50eaa8);});});} \ No newline at end of file +var _0x66a5=['http','info','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','AnalyticDefaultReport,\x20%s,\x20%s','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2fb45c,_0xf72bc5){var _0x463026=function(_0x1099c0){while(--_0x1099c0){_0x2fb45c['push'](_0x2fb45c['shift']());}};_0x463026(++_0xf72bc5);}(_0x66a5,0x14c));var _0x566a=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0x66a5[_0x2080a3];return _0x8d7d17;};'use strict';var _=require(_0x566a('0x0'));var util=require(_0x566a('0x1'));var moment=require(_0x566a('0x2'));var BPromise=require(_0x566a('0x3'));var rs=require(_0x566a('0x4'));var fs=require('fs');var Redis=require(_0x566a('0x5'));var db=require(_0x566a('0x6'))['db'];var utils=require(_0x566a('0x7'));var logger=require(_0x566a('0x8'))(_0x566a('0x9'));var config=require(_0x566a('0xa'));var jayson=require(_0x566a('0xb'));var client=jayson[_0x566a('0xc')][_0x566a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x50cc89,_0x489567,_0x37b8dc){return new BPromise(function(_0x56fee2,_0x4accd9){return client['request'](_0x50cc89,_0x37b8dc)['then'](function(_0x20e101){logger[_0x566a('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x489567,'request\x20sent');logger[_0x566a('0xf')](_0x566a('0x10'),_0x489567,_0x566a('0x11'),JSON[_0x566a('0x12')](_0x20e101));if(_0x20e101['error']){if(_0x20e101['error']['code']===0x1f4){logger['error'](_0x566a('0x13'),_0x489567,_0x20e101[_0x566a('0x14')]['message']);return _0x4accd9(_0x20e101[_0x566a('0x14')]['message']);}logger[_0x566a('0x14')](_0x566a('0x13'),_0x489567,_0x20e101[_0x566a('0x14')]['message']);return _0x56fee2(_0x20e101[_0x566a('0x14')][_0x566a('0x15')]);}else{logger[_0x566a('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x489567,_0x566a('0x11'));_0x56fee2(_0x20e101[_0x566a('0x16')][_0x566a('0x15')]);}})['catch'](function(_0x14c66a){logger[_0x566a('0x14')](_0x566a('0x13'),_0x489567,_0x14c66a);_0x4accd9(_0x14c66a);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 7df96a9..2ab719e 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 _0x3d1f=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','index','isAuthenticated','show','/:id/preview','/:id/run','/:id/query','query','post','create','put','/:id','destroy','multer','util'];(function(_0x324496,_0x3a4cdd){var _0x899545=function(_0x506ef1){while(--_0x506ef1){_0x324496['push'](_0x324496['shift']());}};_0x899545(++_0x3a4cdd);}(_0x3d1f,0xfb));var _0xf3d1=function(_0x445af7,_0x2921ef){_0x445af7=_0x445af7-0x0;var _0x1ca9a2=_0x3d1f[_0x445af7];return _0x1ca9a2;};'use strict';var multer=require(_0xf3d1('0x0'));var util=require(_0xf3d1('0x1'));var path=require(_0xf3d1('0x2'));var timeout=require(_0xf3d1('0x3'));var express=require('express');var router=express[_0xf3d1('0x4')]();var fs_extra=require(_0xf3d1('0x5'));var auth=require(_0xf3d1('0x6'));var interaction=require(_0xf3d1('0x7'));var config=require(_0xf3d1('0x8'));var controller=require(_0xf3d1('0x9'));router[_0xf3d1('0xa')]('/',auth['isAuthenticated'](),controller[_0xf3d1('0xb')]);router[_0xf3d1('0xa')]('/:id',auth[_0xf3d1('0xc')](),controller[_0xf3d1('0xd')]);router['get'](_0xf3d1('0xe'),auth[_0xf3d1('0xc')](),controller['preview']);router[_0xf3d1('0xa')](_0xf3d1('0xf'),auth['isAuthenticated'](),controller['run']);router[_0xf3d1('0xa')](_0xf3d1('0x10'),auth[_0xf3d1('0xc')](),controller[_0xf3d1('0x11')]);router[_0xf3d1('0x12')]('/',auth[_0xf3d1('0xc')](),controller[_0xf3d1('0x13')]);router[_0xf3d1('0x14')](_0xf3d1('0x15'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xf3d1('0x16')]);module['exports']=router; \ No newline at end of file +var _0x6174=['path','express','Router','fs-extra','isAuthenticated','index','get','preview','/:id/run','run','/:id/query','query','update','delete','/:id','destroy','exports','util'];(function(_0x2495b8,_0x524bc8){var _0x10818b=function(_0xd7d79c){while(--_0xd7d79c){_0x2495b8['push'](_0x2495b8['shift']());}};_0x10818b(++_0x524bc8);}(_0x6174,0x1af));var _0x4617=function(_0x4934e1,_0x22262f){_0x4934e1=_0x4934e1-0x0;var _0xd6cf78=_0x6174[_0x4934e1];return _0xd6cf78;};'use strict';var multer=require('multer');var util=require(_0x4617('0x0'));var path=require(_0x4617('0x1'));var timeout=require('connect-timeout');var express=require(_0x4617('0x2'));var router=express[_0x4617('0x3')]();var fs_extra=require(_0x4617('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router['get']('/',auth[_0x4617('0x5')](),controller[_0x4617('0x6')]);router['get']('/:id',auth[_0x4617('0x5')](),controller['show']);router[_0x4617('0x7')]('/:id/preview',auth['isAuthenticated'](),controller[_0x4617('0x8')]);router['get'](_0x4617('0x9'),auth[_0x4617('0x5')](),controller[_0x4617('0xa')]);router[_0x4617('0x7')](_0x4617('0xb'),auth[_0x4617('0x5')](),controller[_0x4617('0xc')]);router['post']('/',auth[_0x4617('0x5')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x4617('0xd')]);router[_0x4617('0xe')](_0x4617('0xf'),auth[_0x4617('0x5')](),controller[_0x4617('0x10')]);module[_0x4617('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index db2d18f..738a609 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 _0x60a4=['INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual'];(function(_0x4af01f,_0x423477){var _0x3e02b9=function(_0x5c5626){while(--_0x5c5626){_0x4af01f['push'](_0x4af01f['shift']());}};_0x3e02b9(++_0x423477);}(_0x60a4,0x12d));var _0x460a=function(_0x52cbe2,_0x5afefb){_0x52cbe2=_0x52cbe2-0x0;var _0x277141=_0x60a4[_0x52cbe2];return _0x277141;};'use strict';var Sequelize=require(_0x460a('0x0'));var moment=require(_0x460a('0x1'));module[_0x460a('0x2')]={'name':{'type':Sequelize[_0x460a('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x460a('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x460a('0x4')](_0x460a('0x5'),_0x460a('0x6'),_0x460a('0x7')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x460a('0x8')]},'endDate':{'type':Sequelize[_0x460a('0x8')]},'status':{'type':Sequelize[_0x460a('0x3')],'defaultValue':_0x460a('0x9')},'type':{'type':Sequelize[_0x460a('0x4')](_0x460a('0xa'),'scheduled'),'allowNull':![],'defaultValue':_0x460a('0xa')},'reportId':{'type':Sequelize[_0x460a('0xb')](0xb)[_0x460a('0xc')]},'reportType':{'type':Sequelize[_0x460a('0x3')]}}; \ No newline at end of file +var _0x6400=['DATE','Loading','manual','INTEGER','UNSIGNED','moment','exports','STRING','ENUM','pdf','csv'];(function(_0x31464b,_0x292eb3){var _0x48ba7c=function(_0x16dc3c){while(--_0x16dc3c){_0x31464b['push'](_0x31464b['shift']());}};_0x48ba7c(++_0x292eb3);}(_0x6400,0x191));var _0x0640=function(_0x14c195,_0x59d195){_0x14c195=_0x14c195-0x0;var _0x17a689=_0x6400[_0x14c195];return _0x17a689;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x0640('0x0'));module[_0x0640('0x1')]={'name':{'type':Sequelize[_0x0640('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x0640('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x0640('0x3')]('csv',_0x0640('0x4'),'xlsx'),'allowNull':![],'defaultValue':_0x0640('0x5')},'savename':{'type':Sequelize[_0x0640('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x0640('0x6')]},'endDate':{'type':Sequelize[_0x0640('0x6')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x0640('0x7')},'type':{'type':Sequelize['ENUM'](_0x0640('0x8'),'scheduled'),'allowNull':![],'defaultValue':_0x0640('0x8')},'reportId':{'type':Sequelize[_0x0640('0x9')](0xb)[_0x0640('0xa')]},'reportType':{'type':Sequelize[_0x0640('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 2f6b20c..672d0a7 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 _0xde96=['query','keys','filters','model','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','fields','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','destroy','download','basename','savename','existsSync','join','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','root','format','output','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','ExtractedReports','UserProfileResource','error','stack','name','send','index','map','AnalyticExtractedReport','fieldName','type','key'];(function(_0x14a34f,_0x250eec){var _0x32676c=function(_0x414e9e){while(--_0x414e9e){_0x14a34f['push'](_0x14a34f['shift']());}};_0x32676c(++_0x250eec);}(_0xde96,0x14e));var _0x6de9=function(_0x155806,_0x41696e){_0x155806=_0x155806-0x0;var _0x102397=_0xde96[_0x155806];return _0x102397;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6de9('0x0'));var zipdir=require(_0x6de9('0x1'));var jsonpatch=require(_0x6de9('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6de9('0x3'));var Mustache=require(_0x6de9('0x4'));var util=require(_0x6de9('0x5'));var path=require(_0x6de9('0x6'));var sox=require(_0x6de9('0x7'));var csv=require(_0x6de9('0x8'));var ejs=require(_0x6de9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6de9('0xa'));var squel=require(_0x6de9('0xb'));var crypto=require('crypto');var jsforce=require(_0x6de9('0xc'));var deskjs=require(_0x6de9('0xd'));var toCsv=require(_0x6de9('0x8'));var querystring=require(_0x6de9('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6de9('0xf'));var as=require(_0x6de9('0x10'));var hardwareService=require(_0x6de9('0x11'));var logger=require(_0x6de9('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2659d7,_0xa38219){_0xa38219=_0xa38219||0xcc;return function(_0x1290bb){if(_0x1290bb){return _0x2659d7[_0x6de9('0x13')](_0xa38219);}return _0x2659d7[_0x6de9('0x14')](_0xa38219)[_0x6de9('0x15')]();};}function respondWithResult(_0x53f28b,_0x392c13){_0x392c13=_0x392c13||0xc8;return function(_0x2bdf60){if(_0x2bdf60){return _0x53f28b[_0x6de9('0x14')](_0x392c13)[_0x6de9('0x16')](_0x2bdf60);}};}function respondWithFilteredResult(_0xbb752a,_0x276191){return function(_0x215a09){if(_0x215a09){var _0x3f8cd8=typeof _0x276191[_0x6de9('0x17')]===_0x6de9('0x18')&&typeof _0x276191[_0x6de9('0x19')]===_0x6de9('0x18');var _0x2745f7=_0x215a09[_0x6de9('0x1a')];var _0x1b4142=_0x3f8cd8?0x0:_0x276191[_0x6de9('0x17')];var _0x48d8c1=_0x3f8cd8?_0x215a09[_0x6de9('0x1a')]:_0x276191[_0x6de9('0x17')]+_0x276191[_0x6de9('0x19')];var _0x31f47e;if(_0x48d8c1>=_0x2745f7){_0x48d8c1=_0x2745f7;_0x31f47e=0xc8;}else{_0x31f47e=0xce;}_0xbb752a[_0x6de9('0x14')](_0x31f47e);return _0xbb752a[_0x6de9('0x1b')](_0x6de9('0x1c'),_0x1b4142+'-'+_0x48d8c1+'/'+_0x2745f7)['json'](_0x215a09);}return null;};}function patchUpdates(_0x205338){return function(_0x14faef){try{jsonpatch['apply'](_0x14faef,_0x205338,!![]);}catch(_0x22255f){return BPromise[_0x6de9('0x1d')](_0x22255f);}return _0x14faef[_0x6de9('0x1e')]();};}function saveUpdates(_0x1d3292,_0x798f47){return function(_0x31497f){if(_0x31497f){return _0x31497f[_0x6de9('0x1f')](_0x1d3292)['then'](function(_0x2f2956){return _0x2f2956;});}return null;};}function removeEntity(_0x2dbfc0,_0x508026){return function(_0x44829f){if(_0x44829f){return _0x44829f['destroy']()[_0x6de9('0x20')](function(){var _0x147582=_0x44829f[_0x6de9('0x21')]({'plain':!![]});var _0x1c5f18=_0x6de9('0x22');return db[_0x6de9('0x23')]['destroy']({'where':{'type':_0x1c5f18,'resourceId':_0x147582['id']}})[_0x6de9('0x20')](function(){return _0x44829f;});})[_0x6de9('0x20')](function(){_0x2dbfc0[_0x6de9('0x14')](0xcc)[_0x6de9('0x15')]();});}};}function handleEntityNotFound(_0x3c6a08,_0x4a561f){return function(_0x2235e2){if(!_0x2235e2){_0x3c6a08['sendStatus'](0x194);}return _0x2235e2;};}function handleError(_0x2acdfc,_0x4a4271){_0x4a4271=_0x4a4271||0x1f4;return function(_0x58c924){logger[_0x6de9('0x24')](_0x58c924[_0x6de9('0x25')]);if(_0x58c924[_0x6de9('0x26')]){delete _0x58c924[_0x6de9('0x26')];}_0x2acdfc['status'](_0x4a4271)[_0x6de9('0x27')](_0x58c924);};}exports[_0x6de9('0x28')]=function(_0x4270dd,_0xefb84a){var _0x1365e2={},_0x5b406f={},_0x5d18d1={'count':0x0,'rows':[]};var _0x12ba0b=_[_0x6de9('0x29')](db[_0x6de9('0x2a')]['rawAttributes'],function(_0x3c7847){return{'name':_0x3c7847[_0x6de9('0x2b')],'type':_0x3c7847[_0x6de9('0x2c')][_0x6de9('0x2d')]};});_0x5b406f['model']=_[_0x6de9('0x29')](_0x12ba0b,_0x6de9('0x26'));_0x5b406f[_0x6de9('0x2e')]=_[_0x6de9('0x2f')](_0x4270dd['query']);_0x5b406f[_0x6de9('0x30')]=_['intersection'](_0x5b406f[_0x6de9('0x31')],_0x5b406f[_0x6de9('0x2e')]);_0x1365e2[_0x6de9('0x32')]=_[_0x6de9('0x33')](_0x5b406f[_0x6de9('0x31')],qs['fields'](_0x4270dd[_0x6de9('0x2e')]['fields']));_0x1365e2[_0x6de9('0x32')]=_0x1365e2[_0x6de9('0x32')][_0x6de9('0x34')]?_0x1365e2['attributes']:_0x5b406f[_0x6de9('0x31')];if(!_0x4270dd[_0x6de9('0x2e')][_0x6de9('0x35')](_0x6de9('0x36'))){_0x1365e2[_0x6de9('0x19')]=qs[_0x6de9('0x19')](_0x4270dd['query'][_0x6de9('0x19')]);_0x1365e2[_0x6de9('0x17')]=qs[_0x6de9('0x17')](_0x4270dd[_0x6de9('0x2e')]['offset']);}_0x1365e2[_0x6de9('0x37')]=qs[_0x6de9('0x38')](_0x4270dd['query'][_0x6de9('0x38')]);_0x1365e2[_0x6de9('0x39')]=qs[_0x6de9('0x30')](_[_0x6de9('0x3a')](_0x4270dd[_0x6de9('0x2e')],_0x5b406f[_0x6de9('0x30')]),_0x12ba0b);if(_0x4270dd[_0x6de9('0x2e')][_0x6de9('0x3b')]){_0x1365e2[_0x6de9('0x39')]=_[_0x6de9('0x3c')](_0x1365e2['where'],{'$or':_[_0x6de9('0x29')](_0x12ba0b,function(_0x3a6072){if(_0x3a6072[_0x6de9('0x2c')]!==_0x6de9('0x3d')){var _0x2edc69={};_0x2edc69[_0x3a6072[_0x6de9('0x26')]]={'$like':'%'+_0x4270dd[_0x6de9('0x2e')][_0x6de9('0x3b')]+'%'};return _0x2edc69;}})});}_0x1365e2=_[_0x6de9('0x3c')]({},_0x1365e2,_0x4270dd[_0x6de9('0x3e')]);var _0x13c7f2={'where':_0x1365e2['where']};return db[_0x6de9('0x2a')][_0x6de9('0x1a')](_0x13c7f2)[_0x6de9('0x20')](function(_0x4b5b2a){_0x5d18d1[_0x6de9('0x1a')]=_0x4b5b2a;if(_0x4270dd['query'][_0x6de9('0x3f')]){_0x1365e2[_0x6de9('0x40')]=[{'all':!![]}];}return db[_0x6de9('0x2a')][_0x6de9('0x41')](_0x1365e2);})[_0x6de9('0x20')](function(_0x182ac2){_0x5d18d1['rows']=_0x182ac2;return _0x5d18d1;})[_0x6de9('0x20')](respondWithFilteredResult(_0xefb84a,_0x1365e2))[_0x6de9('0x42')](handleError(_0xefb84a,null));};exports[_0x6de9('0x43')]=function(_0x14ee39,_0xa22e56){var _0x44d787={'raw':!![],'where':{'id':_0x14ee39[_0x6de9('0x44')]['id']}},_0x32015a={};_0x32015a[_0x6de9('0x31')]=_[_0x6de9('0x2f')](db[_0x6de9('0x2a')][_0x6de9('0x45')]);_0x32015a[_0x6de9('0x2e')]=_['keys'](_0x14ee39[_0x6de9('0x2e')]);_0x32015a[_0x6de9('0x30')]=_[_0x6de9('0x33')](_0x32015a[_0x6de9('0x31')],_0x32015a['query']);_0x44d787[_0x6de9('0x32')]=_[_0x6de9('0x33')](_0x32015a['model'],qs[_0x6de9('0x46')](_0x14ee39[_0x6de9('0x2e')][_0x6de9('0x46')]));_0x44d787[_0x6de9('0x32')]=_0x44d787['attributes'][_0x6de9('0x34')]?_0x44d787[_0x6de9('0x32')]:_0x32015a[_0x6de9('0x31')];if(_0x14ee39['query'][_0x6de9('0x3f')]){_0x44d787['include']=[{'all':!![]}];}_0x44d787=_[_0x6de9('0x3c')]({},_0x44d787,_0x14ee39['options']);return db[_0x6de9('0x2a')][_0x6de9('0x47')](_0x44d787)['then'](handleEntityNotFound(_0xa22e56,null))[_0x6de9('0x20')](respondWithResult(_0xa22e56,null))[_0x6de9('0x42')](handleError(_0xa22e56,null));};exports[_0x6de9('0x48')]=function(_0x4e50cd,_0x205723){return db[_0x6de9('0x2a')]['create'](_0x4e50cd[_0x6de9('0x49')],{})['then'](function(_0x3a4c24){var _0x41223a=_0x4e50cd[_0x6de9('0x4a')][_0x6de9('0x21')]({'plain':!![]});if(!_0x41223a)throw new Error(_0x6de9('0x4b'));if(_0x41223a[_0x6de9('0x4c')]===_0x6de9('0x4a')){var _0x289cd4=_0x3a4c24[_0x6de9('0x21')]({'plain':!![]});var _0x4a98ee=_0x6de9('0x22');return db[_0x6de9('0x4d')]['find']({'where':{'name':_0x4a98ee,'userProfileId':_0x41223a[_0x6de9('0x4e')]},'raw':!![]})[_0x6de9('0x20')](function(_0x40ddea){if(_0x40ddea&&_0x40ddea[_0x6de9('0x4f')]===0x0){return db[_0x6de9('0x23')][_0x6de9('0x48')]({'name':_0x289cd4[_0x6de9('0x26')],'resourceId':_0x289cd4['id'],'type':_0x40ddea[_0x6de9('0x26')],'sectionId':_0x40ddea['id']},{})[_0x6de9('0x20')](function(){return _0x3a4c24;});}else{return _0x3a4c24;}})['catch'](function(_0x1b4850){logger[_0x6de9('0x24')](_0x6de9('0x50'),_0x1b4850);throw _0x1b4850;});}return _0x3a4c24;})[_0x6de9('0x20')](respondWithResult(_0x205723,0xc9))[_0x6de9('0x42')](handleError(_0x205723,null));};exports[_0x6de9('0x1f')]=function(_0xedaf1,_0x3b56f7){if(_0xedaf1[_0x6de9('0x49')]['id']){delete _0xedaf1[_0x6de9('0x49')]['id'];}return db[_0x6de9('0x2a')][_0x6de9('0x47')]({'where':{'id':_0xedaf1[_0x6de9('0x44')]['id']}})[_0x6de9('0x20')](handleEntityNotFound(_0x3b56f7,null))[_0x6de9('0x20')](saveUpdates(_0xedaf1['body'],null))[_0x6de9('0x20')](respondWithResult(_0x3b56f7,null))[_0x6de9('0x42')](handleError(_0x3b56f7,null));};exports[_0x6de9('0x51')]=function(_0x2a4bf6,_0x1046db){return db[_0x6de9('0x2a')][_0x6de9('0x47')]({'where':{'id':_0x2a4bf6[_0x6de9('0x44')]['id']}})[_0x6de9('0x20')](handleEntityNotFound(_0x1046db,null))[_0x6de9('0x20')](removeEntity(_0x1046db,null))[_0x6de9('0x42')](handleError(_0x1046db,null));};exports[_0x6de9('0x52')]=function(_0x347214,_0x302233,_0x25ff0c){return db[_0x6de9('0x2a')][_0x6de9('0x47')]({'where':{'id':_0x347214[_0x6de9('0x44')]['id']},'attributes':[_0x6de9('0x26'),_0x6de9('0x53'),_0x6de9('0x54'),'output'],'raw':!![]})[_0x6de9('0x20')](handleEntityNotFound(_0x302233,null))['then'](function(_0x5b7c2e){if(_0x5b7c2e){if(!fs[_0x6de9('0x55')](path[_0x6de9('0x56')](config['root'],_0x6de9('0x57'),_0x5b7c2e[_0x6de9('0x54')]))){throw new db[(_0x6de9('0x58'))][(_0x6de9('0x59'))](_0x6de9('0x5a'));}if(_0x347214[_0x6de9('0x2e')][_0x6de9('0x5b')]){return _0x302233[_0x6de9('0x13')](0xc8);}return _0x302233[_0x6de9('0x52')](path[_0x6de9('0x56')](config[_0x6de9('0x5c')],_0x6de9('0x57'),_0x5b7c2e['savename']),util[_0x6de9('0x5d')]('%s.%s',_0x5b7c2e[_0x6de9('0x53')]||_0x5b7c2e['name'],_0x5b7c2e[_0x6de9('0x5e')]['toLowerCase']()));}})['catch'](handleError(_0x302233,null));}; \ No newline at end of file +var _0xdfab=['send','index','map','AnalyticExtractedReport','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','rows','catch','include','options','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','userProfileId','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','savename','output','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','basename','toLowerCase','zip-dir','bluebird','mustache','util','path','sox','to-csv','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','ExtractedReports','UserProfileResource','destroy','stack','name'];(function(_0x5ebd12,_0x21f572){var _0x31edab=function(_0x5edc3f){while(--_0x5edc3f){_0x5ebd12['push'](_0x5ebd12['shift']());}};_0x31edab(++_0x21f572);}(_0xdfab,0x1a9));var _0xbdfa=function(_0x3718b7,_0x2da677){_0x3718b7=_0x3718b7-0x0;var _0xf8c91e=_0xdfab[_0x3718b7];return _0xf8c91e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xbdfa('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xbdfa('0x1'));var Mustache=require(_0xbdfa('0x2'));var util=require(_0xbdfa('0x3'));var path=require(_0xbdfa('0x4'));var sox=require(_0xbdfa('0x5'));var csv=require(_0xbdfa('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xbdfa('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xbdfa('0x8'));var toCsv=require(_0xbdfa('0x6'));var querystring=require(_0xbdfa('0x9'));var Papa=require(_0xbdfa('0xa'));var Redis=require(_0xbdfa('0xb'));var authService=require('../../components/auth/service');var qs=require(_0xbdfa('0xc'));var as=require(_0xbdfa('0xd'));var hardwareService=require(_0xbdfa('0xe'));var logger=require(_0xbdfa('0xf'))(_0xbdfa('0x10'));var utils=require(_0xbdfa('0x11'));var config=require(_0xbdfa('0x12'));var licenseUtil=require(_0xbdfa('0x13'));var db=require(_0xbdfa('0x14'))['db'];function respondWithStatusCode(_0x41fcfb,_0x56f485){_0x56f485=_0x56f485||0xcc;return function(_0x50f8ff){if(_0x50f8ff){return _0x41fcfb[_0xbdfa('0x15')](_0x56f485);}return _0x41fcfb[_0xbdfa('0x16')](_0x56f485)[_0xbdfa('0x17')]();};}function respondWithResult(_0x2c157a,_0x810b9e){_0x810b9e=_0x810b9e||0xc8;return function(_0x5891b9){if(_0x5891b9){return _0x2c157a[_0xbdfa('0x16')](_0x810b9e)['json'](_0x5891b9);}};}function respondWithFilteredResult(_0x1999fe,_0x558c6e){return function(_0x3c4816){if(_0x3c4816){var _0x31b513=typeof _0x558c6e[_0xbdfa('0x18')]==='undefined'&&typeof _0x558c6e[_0xbdfa('0x19')]===_0xbdfa('0x1a');var _0x5345cd=_0x3c4816[_0xbdfa('0x1b')];var _0x2384b0=_0x31b513?0x0:_0x558c6e[_0xbdfa('0x18')];var _0x239d2a=_0x31b513?_0x3c4816['count']:_0x558c6e['offset']+_0x558c6e[_0xbdfa('0x19')];var _0x3224f1;if(_0x239d2a>=_0x5345cd){_0x239d2a=_0x5345cd;_0x3224f1=0xc8;}else{_0x3224f1=0xce;}_0x1999fe[_0xbdfa('0x16')](_0x3224f1);return _0x1999fe[_0xbdfa('0x1c')](_0xbdfa('0x1d'),_0x2384b0+'-'+_0x239d2a+'/'+_0x5345cd)[_0xbdfa('0x1e')](_0x3c4816);}return null;};}function patchUpdates(_0x56232f){return function(_0x5f1299){try{jsonpatch[_0xbdfa('0x1f')](_0x5f1299,_0x56232f,!![]);}catch(_0x2cc724){return BPromise[_0xbdfa('0x20')](_0x2cc724);}return _0x5f1299['save']();};}function saveUpdates(_0x3d42ee,_0x5436bd){return function(_0x3864d3){if(_0x3864d3){return _0x3864d3[_0xbdfa('0x21')](_0x3d42ee)['then'](function(_0x197b56){return _0x197b56;});}return null;};}function removeEntity(_0x29b5df,_0x55e967){return function(_0x1adce8){if(_0x1adce8){return _0x1adce8['destroy']()[_0xbdfa('0x22')](function(){var _0x275e4f=_0x1adce8['get']({'plain':!![]});var _0x318afb=_0xbdfa('0x23');return db[_0xbdfa('0x24')][_0xbdfa('0x25')]({'where':{'type':_0x318afb,'resourceId':_0x275e4f['id']}})[_0xbdfa('0x22')](function(){return _0x1adce8;});})[_0xbdfa('0x22')](function(){_0x29b5df[_0xbdfa('0x16')](0xcc)[_0xbdfa('0x17')]();});}};}function handleEntityNotFound(_0x58730c,_0x45d7ca){return function(_0x290da1){if(!_0x290da1){_0x58730c[_0xbdfa('0x15')](0x194);}return _0x290da1;};}function handleError(_0x1e0c4a,_0x56982d){_0x56982d=_0x56982d||0x1f4;return function(_0x154409){logger['error'](_0x154409[_0xbdfa('0x26')]);if(_0x154409[_0xbdfa('0x27')]){delete _0x154409[_0xbdfa('0x27')];}_0x1e0c4a[_0xbdfa('0x16')](_0x56982d)[_0xbdfa('0x28')](_0x154409);};}exports[_0xbdfa('0x29')]=function(_0x496fef,_0x4fb9c6){var _0x38bdd6={},_0xee2e85={},_0x2c0d5d={'count':0x0,'rows':[]};var _0x964ef5=_[_0xbdfa('0x2a')](db[_0xbdfa('0x2b')][_0xbdfa('0x2c')],function(_0xecfc0f){return{'name':_0xecfc0f['fieldName'],'type':_0xecfc0f[_0xbdfa('0x2d')][_0xbdfa('0x2e')]};});_0xee2e85[_0xbdfa('0x2f')]=_[_0xbdfa('0x2a')](_0x964ef5,_0xbdfa('0x27'));_0xee2e85[_0xbdfa('0x30')]=_[_0xbdfa('0x31')](_0x496fef[_0xbdfa('0x30')]);_0xee2e85[_0xbdfa('0x32')]=_['intersection'](_0xee2e85[_0xbdfa('0x2f')],_0xee2e85[_0xbdfa('0x30')]);_0x38bdd6[_0xbdfa('0x33')]=_[_0xbdfa('0x34')](_0xee2e85[_0xbdfa('0x2f')],qs[_0xbdfa('0x35')](_0x496fef[_0xbdfa('0x30')][_0xbdfa('0x35')]));_0x38bdd6[_0xbdfa('0x33')]=_0x38bdd6['attributes'][_0xbdfa('0x36')]?_0x38bdd6[_0xbdfa('0x33')]:_0xee2e85[_0xbdfa('0x2f')];if(!_0x496fef['query'][_0xbdfa('0x37')](_0xbdfa('0x38'))){_0x38bdd6[_0xbdfa('0x19')]=qs[_0xbdfa('0x19')](_0x496fef['query'][_0xbdfa('0x19')]);_0x38bdd6[_0xbdfa('0x18')]=qs[_0xbdfa('0x18')](_0x496fef['query']['offset']);}_0x38bdd6[_0xbdfa('0x39')]=qs[_0xbdfa('0x3a')](_0x496fef[_0xbdfa('0x30')][_0xbdfa('0x3a')]);_0x38bdd6[_0xbdfa('0x3b')]=qs['filters'](_['pick'](_0x496fef[_0xbdfa('0x30')],_0xee2e85['filters']),_0x964ef5);if(_0x496fef[_0xbdfa('0x30')]['filter']){_0x38bdd6['where']=_[_0xbdfa('0x3c')](_0x38bdd6['where'],{'$or':_[_0xbdfa('0x2a')](_0x964ef5,function(_0x47b7bb){if(_0x47b7bb[_0xbdfa('0x2d')]!==_0xbdfa('0x3d')){var _0x584476={};_0x584476[_0x47b7bb['name']]={'$like':'%'+_0x496fef[_0xbdfa('0x30')][_0xbdfa('0x3e')]+'%'};return _0x584476;}})});}_0x38bdd6=_['merge']({},_0x38bdd6,_0x496fef['options']);var _0x26a4d8={'where':_0x38bdd6['where']};return db[_0xbdfa('0x2b')][_0xbdfa('0x1b')](_0x26a4d8)[_0xbdfa('0x22')](function(_0x1a5b53){_0x2c0d5d[_0xbdfa('0x1b')]=_0x1a5b53;if(_0x496fef[_0xbdfa('0x30')][_0xbdfa('0x3f')]){_0x38bdd6['include']=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0x38bdd6);})['then'](function(_0x448292){_0x2c0d5d[_0xbdfa('0x40')]=_0x448292;return _0x2c0d5d;})[_0xbdfa('0x22')](respondWithFilteredResult(_0x4fb9c6,_0x38bdd6))[_0xbdfa('0x41')](handleError(_0x4fb9c6,null));};exports['show']=function(_0x2c2891,_0x591feb){var _0x5011a4={'raw':!![],'where':{'id':_0x2c2891['params']['id']}},_0x2aff39={};_0x2aff39[_0xbdfa('0x2f')]=_[_0xbdfa('0x31')](db[_0xbdfa('0x2b')][_0xbdfa('0x2c')]);_0x2aff39['query']=_[_0xbdfa('0x31')](_0x2c2891['query']);_0x2aff39['filters']=_['intersection'](_0x2aff39[_0xbdfa('0x2f')],_0x2aff39[_0xbdfa('0x30')]);_0x5011a4[_0xbdfa('0x33')]=_[_0xbdfa('0x34')](_0x2aff39['model'],qs[_0xbdfa('0x35')](_0x2c2891[_0xbdfa('0x30')][_0xbdfa('0x35')]));_0x5011a4[_0xbdfa('0x33')]=_0x5011a4['attributes'][_0xbdfa('0x36')]?_0x5011a4[_0xbdfa('0x33')]:_0x2aff39['model'];if(_0x2c2891[_0xbdfa('0x30')][_0xbdfa('0x3f')]){_0x5011a4[_0xbdfa('0x42')]=[{'all':!![]}];}_0x5011a4=_[_0xbdfa('0x3c')]({},_0x5011a4,_0x2c2891[_0xbdfa('0x43')]);return db[_0xbdfa('0x2b')]['find'](_0x5011a4)[_0xbdfa('0x22')](handleEntityNotFound(_0x591feb,null))[_0xbdfa('0x22')](respondWithResult(_0x591feb,null))['catch'](handleError(_0x591feb,null));};exports['create']=function(_0x4e1a62,_0x3ce18c){return db[_0xbdfa('0x2b')]['create'](_0x4e1a62[_0xbdfa('0x44')],{})[_0xbdfa('0x22')](function(_0x18b2df){var _0xfbbf05=_0x4e1a62['user'][_0xbdfa('0x45')]({'plain':!![]});if(!_0xfbbf05)throw new Error(_0xbdfa('0x46'));if(_0xfbbf05['role']===_0xbdfa('0x47')){var _0x1c222d=_0x18b2df[_0xbdfa('0x45')]({'plain':!![]});var _0x15c31e=_0xbdfa('0x23');return db[_0xbdfa('0x48')][_0xbdfa('0x49')]({'where':{'name':_0x15c31e,'userProfileId':_0xfbbf05[_0xbdfa('0x4a')]},'raw':!![]})[_0xbdfa('0x22')](function(_0x5673c7){if(_0x5673c7&&_0x5673c7[_0xbdfa('0x4b')]===0x0){return db[_0xbdfa('0x24')][_0xbdfa('0x4c')]({'name':_0x1c222d[_0xbdfa('0x27')],'resourceId':_0x1c222d['id'],'type':_0x5673c7[_0xbdfa('0x27')],'sectionId':_0x5673c7['id']},{})[_0xbdfa('0x22')](function(){return _0x18b2df;});}else{return _0x18b2df;}})[_0xbdfa('0x41')](function(_0x3b767a){logger[_0xbdfa('0x4d')](_0xbdfa('0x4e'),_0x3b767a);throw _0x3b767a;});}return _0x18b2df;})[_0xbdfa('0x22')](respondWithResult(_0x3ce18c,0xc9))[_0xbdfa('0x41')](handleError(_0x3ce18c,null));};exports[_0xbdfa('0x21')]=function(_0x24ead2,_0x38dba1){if(_0x24ead2[_0xbdfa('0x44')]['id']){delete _0x24ead2['body']['id'];}return db[_0xbdfa('0x2b')][_0xbdfa('0x49')]({'where':{'id':_0x24ead2[_0xbdfa('0x4f')]['id']}})[_0xbdfa('0x22')](handleEntityNotFound(_0x38dba1,null))['then'](saveUpdates(_0x24ead2['body'],null))['then'](respondWithResult(_0x38dba1,null))[_0xbdfa('0x41')](handleError(_0x38dba1,null));};exports['destroy']=function(_0x4af23d,_0x4bd415){return db['AnalyticExtractedReport'][_0xbdfa('0x49')]({'where':{'id':_0x4af23d['params']['id']}})[_0xbdfa('0x22')](handleEntityNotFound(_0x4bd415,null))[_0xbdfa('0x22')](removeEntity(_0x4bd415,null))[_0xbdfa('0x41')](handleError(_0x4bd415,null));};exports[_0xbdfa('0x50')]=function(_0x195a43,_0x3090a1,_0x3e3c81){return db[_0xbdfa('0x2b')][_0xbdfa('0x49')]({'where':{'id':_0x195a43[_0xbdfa('0x4f')]['id']},'attributes':[_0xbdfa('0x27'),'basename',_0xbdfa('0x51'),_0xbdfa('0x52')],'raw':!![]})[_0xbdfa('0x22')](handleEntityNotFound(_0x3090a1,null))[_0xbdfa('0x22')](function(_0x2e284b){if(_0x2e284b){if(!fs['existsSync'](path[_0xbdfa('0x53')](config[_0xbdfa('0x54')],_0xbdfa('0x55'),_0x2e284b[_0xbdfa('0x51')]))){throw new db[(_0xbdfa('0x56'))][(_0xbdfa('0x57'))](_0xbdfa('0x58'));}if(_0x195a43['query'][_0xbdfa('0x59')]){return _0x3090a1[_0xbdfa('0x15')](0xc8);}return _0x3090a1['download'](path['join'](config[_0xbdfa('0x54')],'server/files/reports',_0x2e284b[_0xbdfa('0x51')]),util[_0xbdfa('0x5a')]('%s.%s',_0x2e284b[_0xbdfa('0x5b')]||_0x2e284b[_0xbdfa('0x27')],_0x2e284b[_0xbdfa('0x52')][_0xbdfa('0x5c')]()));}})[_0xbdfa('0x41')](handleError(_0x3090a1,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 7fb37e5..c2b4377 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 _0x124f=['request-promise','path','../../config/environment','exports','AnalyticExtractedReport','../../config/logger','api','bluebird'];(function(_0x46a3b0,_0xfa6e4){var _0x2e3980=function(_0x43ce3b){while(--_0x43ce3b){_0x46a3b0['push'](_0x46a3b0['shift']());}};_0x2e3980(++_0xfa6e4);}(_0x124f,0x18d));var _0xf124=function(_0x295cc1,_0x2664fb){_0x295cc1=_0x295cc1-0x0;var _0x4f5dbc=_0x124f[_0x295cc1];return _0x4f5dbc;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf124('0x0'))(_0xf124('0x1'));var moment=require('moment');var BPromise=require(_0xf124('0x2'));var rp=require(_0xf124('0x3'));var fs=require('fs');var path=require(_0xf124('0x4'));var rimraf=require('rimraf');var config=require(_0xf124('0x5'));var attributes=require('./analyticExtractedReport.attributes');module[_0xf124('0x6')]=function(_0x506ebb,_0xbeb49f){return _0x506ebb['define'](_0xf124('0x7'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6dfa=['bluebird','request-promise','path','rimraf','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','moment'];(function(_0x48326a,_0x8cfa0c){var _0x466709=function(_0x5ab1b7){while(--_0x5ab1b7){_0x48326a['push'](_0x48326a['shift']());}};_0x466709(++_0x8cfa0c);}(_0x6dfa,0x80));var _0xa6df=function(_0x39043e,_0x22e801){_0x39043e=_0x39043e-0x0;var _0x13b384=_0x6dfa[_0x39043e];return _0x13b384;};'use strict';var _=require(_0xa6df('0x0'));var util=require(_0xa6df('0x1'));var logger=require(_0xa6df('0x2'))('api');var moment=require(_0xa6df('0x3'));var BPromise=require(_0xa6df('0x4'));var rp=require(_0xa6df('0x5'));var fs=require('fs');var path=require(_0xa6df('0x6'));var rimraf=require(_0xa6df('0x7'));var config=require('../../config/environment');var attributes=require('./analyticExtractedReport.attributes');module['exports']=function(_0x4bf017,_0x446626){return _0x4bf017[_0xa6df('0x8')](_0xa6df('0x9'),attributes,{'tableName':_0xa6df('0xa'),'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 e02e32c..4c6d9f9 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 _0xf36b=['info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','then'];(function(_0x3f9e8c,_0x4f6caf){var _0x590945=function(_0x566887){while(--_0x566887){_0x3f9e8c['push'](_0x3f9e8c['shift']());}};_0x590945(++_0x4f6caf);}(_0xf36b,0x127));var _0xbf36=function(_0x53f1b7,_0x355294){_0x53f1b7=_0x53f1b7-0x0;var _0x32669c=_0xf36b[_0x53f1b7];return _0x32669c;};'use strict';var _=require(_0xbf36('0x0'));var util=require(_0xbf36('0x1'));var moment=require(_0xbf36('0x2'));var BPromise=require(_0xbf36('0x3'));var rs=require(_0xbf36('0x4'));var fs=require('fs');var Redis=require(_0xbf36('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xbf36('0x6'));var logger=require(_0xbf36('0x7'))(_0xbf36('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbf36('0x9')][_0xbf36('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x582e62,_0x36fcf5,_0x3187e9){return new BPromise(function(_0x4f84d6,_0x12aea9){return client[_0xbf36('0xb')](_0x582e62,_0x3187e9)[_0xbf36('0xc')](function(_0x42a29d){logger[_0xbf36('0xd')](_0xbf36('0xe'),_0x36fcf5,_0xbf36('0xf'));logger[_0xbf36('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x36fcf5,_0xbf36('0xf'),JSON[_0xbf36('0x11')](_0x42a29d));if(_0x42a29d[_0xbf36('0x12')]){if(_0x42a29d[_0xbf36('0x12')][_0xbf36('0x13')]===0x1f4){logger[_0xbf36('0x12')](_0xbf36('0xe'),_0x36fcf5,_0x42a29d[_0xbf36('0x12')][_0xbf36('0x14')]);return _0x12aea9(_0x42a29d[_0xbf36('0x12')][_0xbf36('0x14')]);}logger[_0xbf36('0x12')](_0xbf36('0xe'),_0x36fcf5,_0x42a29d[_0xbf36('0x12')][_0xbf36('0x14')]);return _0x4f84d6(_0x42a29d[_0xbf36('0x12')]['message']);}else{logger[_0xbf36('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x36fcf5,_0xbf36('0xf'));_0x4f84d6(_0x42a29d[_0xbf36('0x15')][_0xbf36('0x14')]);}})['catch'](function(_0x3f41cc){logger[_0xbf36('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x36fcf5,_0x3f41cc);_0x12aea9(_0x3f41cc);});});} \ No newline at end of file +var _0x6301=['message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0x6301,0x9e));var _0x1630=function(_0x2dea58,_0x59d6f0){_0x2dea58=_0x2dea58-0x0;var _0x2b23c2=_0x6301[_0x2dea58];return _0x2b23c2;};'use strict';var _=require(_0x1630('0x0'));var util=require(_0x1630('0x1'));var moment=require(_0x1630('0x2'));var BPromise=require(_0x1630('0x3'));var rs=require(_0x1630('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1630('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1630('0x6'))(_0x1630('0x7'));var config=require(_0x1630('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1630('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c675e,_0x1916cc,_0x496099){return new BPromise(function(_0x374c93,_0x3800b9){return client['request'](_0x1c675e,_0x496099)[_0x1630('0xa')](function(_0x5a8036){logger['info'](_0x1630('0xb'),_0x1916cc,_0x1630('0xc'));logger[_0x1630('0xd')](_0x1630('0xe'),_0x1916cc,'request\x20sent',JSON[_0x1630('0xf')](_0x5a8036));if(_0x5a8036[_0x1630('0x10')]){if(_0x5a8036[_0x1630('0x10')][_0x1630('0x11')]===0x1f4){logger[_0x1630('0x10')](_0x1630('0xb'),_0x1916cc,_0x5a8036[_0x1630('0x10')][_0x1630('0x12')]);return _0x3800b9(_0x5a8036['error'][_0x1630('0x12')]);}logger[_0x1630('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1916cc,_0x5a8036[_0x1630('0x10')][_0x1630('0x12')]);return _0x374c93(_0x5a8036[_0x1630('0x10')][_0x1630('0x12')]);}else{logger[_0x1630('0x13')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1916cc,_0x1630('0xc'));_0x374c93(_0x5a8036[_0x1630('0x14')][_0x1630('0x12')]);}})[_0x1630('0x15')](function(_0x42a5dd){logger[_0x1630('0x10')](_0x1630('0xb'),_0x1916cc,_0x42a5dd);_0x3800b9(_0x42a5dd);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 32b53d3..ca5b92a 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 _0x87f3=['multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put','update','destroy','exports'];(function(_0x10edeb,_0x1b93b8){var _0x1c5fea=function(_0x16a1c5){while(--_0x16a1c5){_0x10edeb['push'](_0x10edeb['shift']());}};_0x1c5fea(++_0x1b93b8);}(_0x87f3,0x69));var _0x387f=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0x87f3[_0x373dee];return _0x46798f;};'use strict';var multer=require(_0x387f('0x0'));var util=require('util');var path=require(_0x387f('0x1'));var timeout=require(_0x387f('0x2'));var express=require('express');var router=express[_0x387f('0x3')]();var fs_extra=require(_0x387f('0x4'));var auth=require(_0x387f('0x5'));var interaction=require(_0x387f('0x6'));var config=require(_0x387f('0x7'));var controller=require('./analyticExtractedReport.controller');router[_0x387f('0x8')]('/',auth[_0x387f('0x9')](),controller[_0x387f('0xa')]);router['get'](_0x387f('0xb'),auth['isAuthenticated'](),controller[_0x387f('0xc')]);router[_0x387f('0x8')](_0x387f('0xd'),auth[_0x387f('0x9')](),controller[_0x387f('0xe')]);router[_0x387f('0xf')]('/',auth[_0x387f('0x9')](),controller[_0x387f('0x10')]);router[_0x387f('0x11')](_0x387f('0xb'),auth['isAuthenticated'](),controller[_0x387f('0x12')]);router['delete'](_0x387f('0xb'),auth['isAuthenticated'](),controller[_0x387f('0x13')]);module[_0x387f('0x14')]=router; \ No newline at end of file +var _0xf256=['update','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','show','/:id/download','download','post','create','put','/:id'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xf256,0x1a4));var _0x6f25=function(_0x3267ee,_0x1bf1cf){_0x3267ee=_0x3267ee-0x0;var _0x425762=_0xf256[_0x3267ee];return _0x425762;};'use strict';var multer=require(_0x6f25('0x0'));var util=require(_0x6f25('0x1'));var path=require(_0x6f25('0x2'));var timeout=require(_0x6f25('0x3'));var express=require(_0x6f25('0x4'));var router=express['Router']();var fs_extra=require(_0x6f25('0x5'));var auth=require(_0x6f25('0x6'));var interaction=require(_0x6f25('0x7'));var config=require(_0x6f25('0x8'));var controller=require(_0x6f25('0x9'));router[_0x6f25('0xa')]('/',auth[_0x6f25('0xb')](),controller[_0x6f25('0xc')]);router[_0x6f25('0xa')]('/:id',auth[_0x6f25('0xb')](),controller[_0x6f25('0xd')]);router[_0x6f25('0xa')](_0x6f25('0xe'),auth['isAuthenticated'](),controller[_0x6f25('0xf')]);router[_0x6f25('0x10')]('/',auth[_0x6f25('0xb')](),controller[_0x6f25('0x11')]);router[_0x6f25('0x12')](_0x6f25('0x13'),auth['isAuthenticated'](),controller[_0x6f25('0x14')]);router['delete'](_0x6f25('0x13'),auth[_0x6f25('0xb')](),controller['destroy']);module[_0x6f25('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 6f1d358..7e16965 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 _0x0a38=['BOOLEAN','exports','STRING'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x0a38,0xc1));var _0x80a3=function(_0x4b2088,_0x3facc7){_0x4b2088=_0x4b2088-0x0;var _0x49c48d=_0x0a38[_0x4b2088];return _0x49c48d;};'use strict';var Sequelize=require('sequelize');module[_0x80a3('0x0')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x80a3('0x1')]},'format':{'type':Sequelize[_0x80a3('0x1')]},'groupBy':{'type':Sequelize[_0x80a3('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x80a3('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xbd9d=['STRING','BOOLEAN','sequelize','exports'];(function(_0x318256,_0xa773f3){var _0xb1e352=function(_0x4bb14e){while(--_0x4bb14e){_0x318256['push'](_0x318256['shift']());}};_0xb1e352(++_0xa773f3);}(_0xbd9d,0x1a2));var _0xdbd9=function(_0x343f7a,_0x35c8b5){_0x343f7a=_0x343f7a-0x0;var _0xf49751=_0xbd9d[_0x343f7a];return _0xf49751;};'use strict';var Sequelize=require(_0xdbd9('0x0'));module[_0xdbd9('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xdbd9('0x2')]},'format':{'type':Sequelize[_0xdbd9('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xdbd9('0x2')]},'custom':{'type':Sequelize[_0xdbd9('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 f64c6d1..8f9878a 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 _0x68f5=['key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','create','body','bulkCreate','update','find','destroy','ids','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','save','then','stack','name','send','map','AnalyticFieldReport','rawAttributes'];(function(_0x2b2d32,_0x401bf9){var _0x594f99=function(_0x10760d){while(--_0x10760d){_0x2b2d32['push'](_0x2b2d32['shift']());}};_0x594f99(++_0x401bf9);}(_0x68f5,0x75));var _0x568f=function(_0x4323cc,_0x37f323){_0x4323cc=_0x4323cc-0x0;var _0x2209de=_0x68f5[_0x4323cc];return _0x2209de;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x568f('0x0'));var rp=require(_0x568f('0x1'));var moment=require(_0x568f('0x2'));var BPromise=require(_0x568f('0x3'));var Mustache=require(_0x568f('0x4'));var util=require(_0x568f('0x5'));var path=require(_0x568f('0x6'));var sox=require(_0x568f('0x7'));var csv=require(_0x568f('0x8'));var ejs=require(_0x568f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x568f('0xa'));var squel=require(_0x568f('0xb'));var crypto=require(_0x568f('0xc'));var jsforce=require(_0x568f('0xd'));var deskjs=require(_0x568f('0xe'));var toCsv=require(_0x568f('0x8'));var querystring=require(_0x568f('0xf'));var Papa=require(_0x568f('0x10'));var Redis=require(_0x568f('0x11'));var authService=require(_0x568f('0x12'));var qs=require(_0x568f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x568f('0x14'));var logger=require('../../config/logger')(_0x568f('0x15'));var utils=require(_0x568f('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x568f('0x17'));var db=require(_0x568f('0x18'))['db'];function respondWithStatusCode(_0x2fa40e,_0x91ce6b){_0x91ce6b=_0x91ce6b||0xcc;return function(_0x1c4052){if(_0x1c4052){return _0x2fa40e[_0x568f('0x19')](_0x91ce6b);}return _0x2fa40e[_0x568f('0x1a')](_0x91ce6b)[_0x568f('0x1b')]();};}function respondWithResult(_0x1805c9,_0x5e0081){_0x5e0081=_0x5e0081||0xc8;return function(_0x370955){if(_0x370955){return _0x1805c9[_0x568f('0x1a')](_0x5e0081)[_0x568f('0x1c')](_0x370955);}};}function respondWithFilteredResult(_0x27fee6,_0x351bcd){return function(_0x2a0cb9){if(_0x2a0cb9){var _0x2c3113=typeof _0x351bcd[_0x568f('0x1d')]===_0x568f('0x1e')&&typeof _0x351bcd['limit']===_0x568f('0x1e');var _0x43b415=_0x2a0cb9[_0x568f('0x1f')];var _0x309a7b=_0x2c3113?0x0:_0x351bcd[_0x568f('0x1d')];var _0x5f17a5=_0x2c3113?_0x2a0cb9[_0x568f('0x1f')]:_0x351bcd[_0x568f('0x1d')]+_0x351bcd[_0x568f('0x20')];var _0x29ff29;if(_0x5f17a5>=_0x43b415){_0x5f17a5=_0x43b415;_0x29ff29=0xc8;}else{_0x29ff29=0xce;}_0x27fee6[_0x568f('0x1a')](_0x29ff29);return _0x27fee6[_0x568f('0x21')](_0x568f('0x22'),_0x309a7b+'-'+_0x5f17a5+'/'+_0x43b415)[_0x568f('0x1c')](_0x2a0cb9);}return null;};}function patchUpdates(_0x48758a){return function(_0x9e431f){try{jsonpatch['apply'](_0x9e431f,_0x48758a,!![]);}catch(_0x4bd26d){return BPromise['reject'](_0x4bd26d);}return _0x9e431f[_0x568f('0x23')]();};}function saveUpdates(_0x57117f,_0x153cd0){return function(_0x278d2b){if(_0x278d2b){return _0x278d2b['update'](_0x57117f)[_0x568f('0x24')](function(_0x4a12b9){return _0x4a12b9;});}return null;};}function removeEntity(_0x644732,_0x39e0a4){return function(_0x1f6519){if(_0x1f6519){return _0x1f6519['destroy']()[_0x568f('0x24')](function(){_0x644732[_0x568f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15f60e,_0x2cfab7){return function(_0x163941){if(!_0x163941){_0x15f60e[_0x568f('0x19')](0x194);}return _0x163941;};}function handleError(_0x161f7d,_0x57d32b){_0x57d32b=_0x57d32b||0x1f4;return function(_0x501077){logger['error'](_0x501077[_0x568f('0x25')]);if(_0x501077[_0x568f('0x26')]){delete _0x501077['name'];}_0x161f7d[_0x568f('0x1a')](_0x57d32b)[_0x568f('0x27')](_0x501077);};}exports['index']=function(_0x3877ac,_0x3792eb){var _0x1937ae={},_0x2b763e={},_0x4c5884={'count':0x0,'rows':[]};var _0x478d31=_[_0x568f('0x28')](db[_0x568f('0x29')][_0x568f('0x2a')],function(_0x2833f0){return{'name':_0x2833f0['fieldName'],'type':_0x2833f0['type'][_0x568f('0x2b')]};});_0x2b763e[_0x568f('0x2c')]=_[_0x568f('0x28')](_0x478d31,_0x568f('0x26'));_0x2b763e[_0x568f('0x2d')]=_[_0x568f('0x2e')](_0x3877ac[_0x568f('0x2d')]);_0x2b763e[_0x568f('0x2f')]=_[_0x568f('0x30')](_0x2b763e[_0x568f('0x2c')],_0x2b763e[_0x568f('0x2d')]);_0x1937ae[_0x568f('0x31')]=_['intersection'](_0x2b763e['model'],qs[_0x568f('0x32')](_0x3877ac['query']['fields']));_0x1937ae[_0x568f('0x31')]=_0x1937ae[_0x568f('0x31')][_0x568f('0x33')]?_0x1937ae['attributes']:_0x2b763e[_0x568f('0x2c')];if(!_0x3877ac[_0x568f('0x2d')][_0x568f('0x34')]('nolimit')){_0x1937ae[_0x568f('0x20')]=qs[_0x568f('0x20')](_0x3877ac[_0x568f('0x2d')][_0x568f('0x20')]);_0x1937ae[_0x568f('0x1d')]=qs['offset'](_0x3877ac[_0x568f('0x2d')][_0x568f('0x1d')]);}_0x1937ae[_0x568f('0x35')]=qs['sort'](_0x3877ac[_0x568f('0x2d')][_0x568f('0x36')]);_0x1937ae[_0x568f('0x37')]=qs[_0x568f('0x2f')](_[_0x568f('0x38')](_0x3877ac['query'],_0x2b763e['filters']),_0x478d31);if(_0x3877ac[_0x568f('0x2d')][_0x568f('0x39')]){_0x1937ae['where']=_[_0x568f('0x3a')](_0x1937ae[_0x568f('0x37')],{'$or':_[_0x568f('0x28')](_0x478d31,function(_0x161bf6){if(_0x161bf6[_0x568f('0x3b')]!==_0x568f('0x3c')){var _0x39203a={};_0x39203a[_0x161bf6['name']]={'$like':'%'+_0x3877ac[_0x568f('0x2d')][_0x568f('0x39')]+'%'};return _0x39203a;}})});}_0x1937ae=_[_0x568f('0x3a')]({},_0x1937ae,_0x3877ac['options']);var _0x48d399={'where':_0x1937ae[_0x568f('0x37')]};return db['AnalyticFieldReport']['count'](_0x48d399)[_0x568f('0x24')](function(_0x96fc54){_0x4c5884[_0x568f('0x1f')]=_0x96fc54;if(_0x3877ac[_0x568f('0x2d')][_0x568f('0x3d')]){_0x1937ae[_0x568f('0x3e')]=[{'all':!![]}];}return db[_0x568f('0x29')][_0x568f('0x3f')](_0x1937ae);})[_0x568f('0x24')](function(_0x44c50e){_0x4c5884[_0x568f('0x40')]=_0x44c50e;return _0x4c5884;})[_0x568f('0x24')](respondWithFilteredResult(_0x3792eb,_0x1937ae))[_0x568f('0x41')](handleError(_0x3792eb,null));};exports[_0x568f('0x42')]=function(_0x2f1092,_0xe90c35){var _0x595c09={'raw':![],'where':{'id':_0x2f1092[_0x568f('0x43')]['id']}},_0x2e52f5={};_0x2e52f5[_0x568f('0x2c')]=_[_0x568f('0x2e')](db[_0x568f('0x29')]['rawAttributes']);_0x2e52f5['query']=_[_0x568f('0x2e')](_0x2f1092['query']);_0x2e52f5[_0x568f('0x2f')]=_['intersection'](_0x2e52f5[_0x568f('0x2c')],_0x2e52f5[_0x568f('0x2d')]);_0x595c09[_0x568f('0x31')]=_['intersection'](_0x2e52f5[_0x568f('0x2c')],qs[_0x568f('0x32')](_0x2f1092['query'][_0x568f('0x32')]));_0x595c09[_0x568f('0x31')]=_0x595c09[_0x568f('0x31')][_0x568f('0x33')]?_0x595c09[_0x568f('0x31')]:_0x2e52f5[_0x568f('0x2c')];if(_0x2f1092[_0x568f('0x2d')][_0x568f('0x3d')]){_0x595c09[_0x568f('0x3e')]=[{'all':!![]}];}_0x595c09=_[_0x568f('0x3a')]({},_0x595c09,_0x2f1092['options']);return db[_0x568f('0x29')]['find'](_0x595c09)[_0x568f('0x24')](handleEntityNotFound(_0xe90c35,null))['then'](respondWithResult(_0xe90c35,null))[_0x568f('0x41')](handleError(_0xe90c35,null));};exports[_0x568f('0x44')]=function(_0x2418f6,_0x47fdf3){return db['AnalyticFieldReport'][_0x568f('0x44')](_0x2418f6[_0x568f('0x45')],{})[_0x568f('0x24')](respondWithResult(_0x47fdf3,0xc9))[_0x568f('0x41')](handleError(_0x47fdf3,null));};exports[_0x568f('0x46')]=function(_0x2442a0,_0x27d050){return db[_0x568f('0x29')][_0x568f('0x46')](_0x2442a0['body'],{'raw':![],'individualHooks':!![]})[_0x568f('0x24')](respondWithResult(_0x27d050,0xc9))[_0x568f('0x41')](handleError(_0x27d050,null));};exports[_0x568f('0x47')]=function(_0xa1db11,_0x12ded2){if(_0xa1db11[_0x568f('0x45')]['id']){delete _0xa1db11[_0x568f('0x45')]['id'];}return db[_0x568f('0x29')][_0x568f('0x48')]({'where':{'id':_0xa1db11[_0x568f('0x43')]['id']}})['then'](handleEntityNotFound(_0x12ded2,null))[_0x568f('0x24')](saveUpdates(_0xa1db11[_0x568f('0x45')],null))[_0x568f('0x24')](respondWithResult(_0x12ded2,null))[_0x568f('0x41')](handleError(_0x12ded2,null));};exports[_0x568f('0x49')]=function(_0x1af873,_0x34df2e){return db[_0x568f('0x29')][_0x568f('0x48')]({'where':{'id':_0x1af873[_0x568f('0x43')]['id']}})[_0x568f('0x24')](handleEntityNotFound(_0x34df2e,null))['then'](removeEntity(_0x34df2e,null))[_0x568f('0x41')](handleError(_0x34df2e,null));};exports['bulkDestroy']=function(_0xd8bfa9,_0x5ac76b){return db[_0x568f('0x29')][_0x568f('0x49')]({'where':{'id':_0xd8bfa9[_0x568f('0x2d')][_0x568f('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0x568f('0x24')](respondWithResult(_0x5ac76b,0xcc))[_0x568f('0x41')](handleError(_0x5ac76b,null));};exports[_0x568f('0x4b')]=function(_0x2ed4a3,_0x290aed,_0x131d40){return db[_0x568f('0x4c')]['findOne']({'where':{'id':_0x2ed4a3[_0x568f('0x43')]['id']}})[_0x568f('0x24')](handleEntityNotFound(_0x290aed,null))[_0x568f('0x24')](function(_0xb53d34){if(_0xb53d34){return db[_0x568f('0x4d')][_0x568f('0x4e')](function(_0xbeb401){return db[_0x568f('0x29')][_0x568f('0x49')]({'where':{'CustomReportId':_0x2ed4a3[_0x568f('0x43')]['id']},'transaction':_0xbeb401})[_0x568f('0x24')](function(_0x562167){var _0x163073=_[_0x568f('0x28')](_0x2ed4a3['body'],function(_0x329777){delete _0x329777['id'];_0x329777[_0x568f('0x4f')]=_0x2ed4a3[_0x568f('0x43')]['id'];return _0x329777;});return db[_0x568f('0x29')][_0x568f('0x46')](_0x163073,{'transaction':_0xbeb401});});})[_0x568f('0x24')](function(){return db[_0x568f('0x29')][_0x568f('0x3f')]({'where':{'CustomReportId':_0x2ed4a3[_0x568f('0x43')]['id']}});});}})[_0x568f('0x24')](respondWithResult(_0x290aed,null))['catch'](handleError(_0x290aed,null));}; \ No newline at end of file +var _0xe169=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','merge','options','includeAll','findAll','rows','catch','show','params','keys','include','find','create','bulkCreate','body','bulkDestroy','ids','sequelize','transaction','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs'];(function(_0x4eff9f,_0x3ab1f9){var _0x446aa1=function(_0x2f8a40){while(--_0x2f8a40){_0x4eff9f['push'](_0x4eff9f['shift']());}};_0x446aa1(++_0x3ab1f9);}(_0xe169,0x93));var _0x9e16=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe169[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x9e16('0x0'));var rimraf=require(_0x9e16('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9e16('0x2'));var rp=require(_0x9e16('0x3'));var moment=require(_0x9e16('0x4'));var BPromise=require(_0x9e16('0x5'));var Mustache=require(_0x9e16('0x6'));var util=require('util');var path=require(_0x9e16('0x7'));var sox=require(_0x9e16('0x8'));var csv=require(_0x9e16('0x9'));var ejs=require(_0x9e16('0xa'));var fs=require('fs');var fs_extra=require(_0x9e16('0xb'));var _=require(_0x9e16('0xc'));var squel=require(_0x9e16('0xd'));var crypto=require(_0x9e16('0xe'));var jsforce=require(_0x9e16('0xf'));var deskjs=require(_0x9e16('0x10'));var toCsv=require(_0x9e16('0x9'));var querystring=require(_0x9e16('0x11'));var Papa=require(_0x9e16('0x12'));var Redis=require(_0x9e16('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x9e16('0x14'));var as=require(_0x9e16('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9e16('0x16'))(_0x9e16('0x17'));var utils=require(_0x9e16('0x18'));var config=require(_0x9e16('0x19'));var licenseUtil=require(_0x9e16('0x1a'));var db=require(_0x9e16('0x1b'))['db'];function respondWithStatusCode(_0x543020,_0x440b81){_0x440b81=_0x440b81||0xcc;return function(_0x19582d){if(_0x19582d){return _0x543020['sendStatus'](_0x440b81);}return _0x543020[_0x9e16('0x1c')](_0x440b81)[_0x9e16('0x1d')]();};}function respondWithResult(_0x2f1e59,_0x84df45){_0x84df45=_0x84df45||0xc8;return function(_0x1ef754){if(_0x1ef754){return _0x2f1e59['status'](_0x84df45)[_0x9e16('0x1e')](_0x1ef754);}};}function respondWithFilteredResult(_0x5680e7,_0x58e3f3){return function(_0x475fd8){if(_0x475fd8){var _0x417a2a=typeof _0x58e3f3[_0x9e16('0x1f')]==='undefined'&&typeof _0x58e3f3['limit']===_0x9e16('0x20');var _0x8de81=_0x475fd8[_0x9e16('0x21')];var _0x4cc69a=_0x417a2a?0x0:_0x58e3f3[_0x9e16('0x1f')];var _0x5964c5=_0x417a2a?_0x475fd8[_0x9e16('0x21')]:_0x58e3f3[_0x9e16('0x1f')]+_0x58e3f3[_0x9e16('0x22')];var _0x3b4f85;if(_0x5964c5>=_0x8de81){_0x5964c5=_0x8de81;_0x3b4f85=0xc8;}else{_0x3b4f85=0xce;}_0x5680e7[_0x9e16('0x1c')](_0x3b4f85);return _0x5680e7[_0x9e16('0x23')](_0x9e16('0x24'),_0x4cc69a+'-'+_0x5964c5+'/'+_0x8de81)[_0x9e16('0x1e')](_0x475fd8);}return null;};}function patchUpdates(_0x2b809d){return function(_0x558157){try{jsonpatch[_0x9e16('0x25')](_0x558157,_0x2b809d,!![]);}catch(_0x241ad1){return BPromise[_0x9e16('0x26')](_0x241ad1);}return _0x558157[_0x9e16('0x27')]();};}function saveUpdates(_0x10daeb,_0x2e6897){return function(_0x3b9847){if(_0x3b9847){return _0x3b9847[_0x9e16('0x28')](_0x10daeb)[_0x9e16('0x29')](function(_0x1987dc){return _0x1987dc;});}return null;};}function removeEntity(_0x17bced,_0x23eca8){return function(_0x2e2cd0){if(_0x2e2cd0){return _0x2e2cd0[_0x9e16('0x2a')]()[_0x9e16('0x29')](function(){_0x17bced['status'](0xcc)[_0x9e16('0x1d')]();});}};}function handleEntityNotFound(_0x3564cb,_0x452ce9){return function(_0x403902){if(!_0x403902){_0x3564cb[_0x9e16('0x2b')](0x194);}return _0x403902;};}function handleError(_0x43c406,_0x2efc39){_0x2efc39=_0x2efc39||0x1f4;return function(_0x4566ac){logger[_0x9e16('0x2c')](_0x4566ac[_0x9e16('0x2d')]);if(_0x4566ac[_0x9e16('0x2e')]){delete _0x4566ac[_0x9e16('0x2e')];}_0x43c406[_0x9e16('0x1c')](_0x2efc39)[_0x9e16('0x2f')](_0x4566ac);};}exports[_0x9e16('0x30')]=function(_0x33f5fd,_0x3ae513){var _0x1f277c={},_0x3337ee={},_0x27c4e0={'count':0x0,'rows':[]};var _0x2c781c=_[_0x9e16('0x31')](db[_0x9e16('0x32')][_0x9e16('0x33')],function(_0x19a18e){return{'name':_0x19a18e[_0x9e16('0x34')],'type':_0x19a18e[_0x9e16('0x35')][_0x9e16('0x36')]};});_0x3337ee[_0x9e16('0x37')]=_[_0x9e16('0x31')](_0x2c781c,'name');_0x3337ee[_0x9e16('0x38')]=_['keys'](_0x33f5fd['query']);_0x3337ee[_0x9e16('0x39')]=_['intersection'](_0x3337ee[_0x9e16('0x37')],_0x3337ee[_0x9e16('0x38')]);_0x1f277c[_0x9e16('0x3a')]=_[_0x9e16('0x3b')](_0x3337ee['model'],qs[_0x9e16('0x3c')](_0x33f5fd['query'][_0x9e16('0x3c')]));_0x1f277c[_0x9e16('0x3a')]=_0x1f277c[_0x9e16('0x3a')][_0x9e16('0x3d')]?_0x1f277c[_0x9e16('0x3a')]:_0x3337ee['model'];if(!_0x33f5fd[_0x9e16('0x38')][_0x9e16('0x3e')]('nolimit')){_0x1f277c['limit']=qs['limit'](_0x33f5fd[_0x9e16('0x38')][_0x9e16('0x22')]);_0x1f277c[_0x9e16('0x1f')]=qs[_0x9e16('0x1f')](_0x33f5fd['query'][_0x9e16('0x1f')]);}_0x1f277c['order']=qs[_0x9e16('0x3f')](_0x33f5fd[_0x9e16('0x38')][_0x9e16('0x3f')]);_0x1f277c[_0x9e16('0x40')]=qs[_0x9e16('0x39')](_[_0x9e16('0x41')](_0x33f5fd[_0x9e16('0x38')],_0x3337ee[_0x9e16('0x39')]),_0x2c781c);if(_0x33f5fd[_0x9e16('0x38')]['filter']){_0x1f277c[_0x9e16('0x40')]=_[_0x9e16('0x42')](_0x1f277c[_0x9e16('0x40')],{'$or':_[_0x9e16('0x31')](_0x2c781c,function(_0x258a5a){if(_0x258a5a[_0x9e16('0x35')]!=='VIRTUAL'){var _0x2cd1c5={};_0x2cd1c5[_0x258a5a[_0x9e16('0x2e')]]={'$like':'%'+_0x33f5fd[_0x9e16('0x38')]['filter']+'%'};return _0x2cd1c5;}})});}_0x1f277c=_[_0x9e16('0x42')]({},_0x1f277c,_0x33f5fd[_0x9e16('0x43')]);var _0x146398={'where':_0x1f277c[_0x9e16('0x40')]};return db[_0x9e16('0x32')][_0x9e16('0x21')](_0x146398)[_0x9e16('0x29')](function(_0x6d1c75){_0x27c4e0[_0x9e16('0x21')]=_0x6d1c75;if(_0x33f5fd['query'][_0x9e16('0x44')]){_0x1f277c['include']=[{'all':!![]}];}return db[_0x9e16('0x32')][_0x9e16('0x45')](_0x1f277c);})[_0x9e16('0x29')](function(_0x4eef58){_0x27c4e0[_0x9e16('0x46')]=_0x4eef58;return _0x27c4e0;})['then'](respondWithFilteredResult(_0x3ae513,_0x1f277c))[_0x9e16('0x47')](handleError(_0x3ae513,null));};exports[_0x9e16('0x48')]=function(_0x213baa,_0x1af968){var _0x5d9d92={'raw':![],'where':{'id':_0x213baa[_0x9e16('0x49')]['id']}},_0x72dab5={};_0x72dab5[_0x9e16('0x37')]=_[_0x9e16('0x4a')](db[_0x9e16('0x32')][_0x9e16('0x33')]);_0x72dab5[_0x9e16('0x38')]=_[_0x9e16('0x4a')](_0x213baa[_0x9e16('0x38')]);_0x72dab5[_0x9e16('0x39')]=_[_0x9e16('0x3b')](_0x72dab5['model'],_0x72dab5[_0x9e16('0x38')]);_0x5d9d92[_0x9e16('0x3a')]=_['intersection'](_0x72dab5['model'],qs[_0x9e16('0x3c')](_0x213baa['query'][_0x9e16('0x3c')]));_0x5d9d92[_0x9e16('0x3a')]=_0x5d9d92['attributes']['length']?_0x5d9d92[_0x9e16('0x3a')]:_0x72dab5[_0x9e16('0x37')];if(_0x213baa[_0x9e16('0x38')][_0x9e16('0x44')]){_0x5d9d92[_0x9e16('0x4b')]=[{'all':!![]}];}_0x5d9d92=_[_0x9e16('0x42')]({},_0x5d9d92,_0x213baa['options']);return db['AnalyticFieldReport'][_0x9e16('0x4c')](_0x5d9d92)[_0x9e16('0x29')](handleEntityNotFound(_0x1af968,null))[_0x9e16('0x29')](respondWithResult(_0x1af968,null))['catch'](handleError(_0x1af968,null));};exports[_0x9e16('0x4d')]=function(_0x35869f,_0x1c628e){return db[_0x9e16('0x32')]['create'](_0x35869f['body'],{})[_0x9e16('0x29')](respondWithResult(_0x1c628e,0xc9))[_0x9e16('0x47')](handleError(_0x1c628e,null));};exports[_0x9e16('0x4e')]=function(_0x4e5dd0,_0x1963ea){return db[_0x9e16('0x32')]['bulkCreate'](_0x4e5dd0[_0x9e16('0x4f')],{'raw':![],'individualHooks':!![]})[_0x9e16('0x29')](respondWithResult(_0x1963ea,0xc9))[_0x9e16('0x47')](handleError(_0x1963ea,null));};exports[_0x9e16('0x28')]=function(_0x406f59,_0x3ac592){if(_0x406f59[_0x9e16('0x4f')]['id']){delete _0x406f59[_0x9e16('0x4f')]['id'];}return db[_0x9e16('0x32')][_0x9e16('0x4c')]({'where':{'id':_0x406f59[_0x9e16('0x49')]['id']}})[_0x9e16('0x29')](handleEntityNotFound(_0x3ac592,null))['then'](saveUpdates(_0x406f59[_0x9e16('0x4f')],null))[_0x9e16('0x29')](respondWithResult(_0x3ac592,null))[_0x9e16('0x47')](handleError(_0x3ac592,null));};exports[_0x9e16('0x2a')]=function(_0x10192b,_0x36538b){return db[_0x9e16('0x32')][_0x9e16('0x4c')]({'where':{'id':_0x10192b[_0x9e16('0x49')]['id']}})['then'](handleEntityNotFound(_0x36538b,null))['then'](removeEntity(_0x36538b,null))['catch'](handleError(_0x36538b,null));};exports[_0x9e16('0x50')]=function(_0x27d9c7,_0x39285d){return db['AnalyticFieldReport'][_0x9e16('0x2a')]({'where':{'id':_0x27d9c7[_0x9e16('0x38')][_0x9e16('0x51')]||[]},'raw':![],'individualHooks':!![]})[_0x9e16('0x29')](respondWithResult(_0x39285d,0xcc))[_0x9e16('0x47')](handleError(_0x39285d,null));};exports['addFields']=function(_0x481342,_0x127798,_0x2dcb94){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x481342[_0x9e16('0x49')]['id']}})[_0x9e16('0x29')](handleEntityNotFound(_0x127798,null))['then'](function(_0x50bfe5){if(_0x50bfe5){return db[_0x9e16('0x52')][_0x9e16('0x53')](function(_0x50bed0){return db[_0x9e16('0x32')][_0x9e16('0x2a')]({'where':{'CustomReportId':_0x481342[_0x9e16('0x49')]['id']},'transaction':_0x50bed0})[_0x9e16('0x29')](function(_0x4cf85a){var _0x726598=_[_0x9e16('0x31')](_0x481342[_0x9e16('0x4f')],function(_0x569b64){delete _0x569b64['id'];_0x569b64['CustomReportId']=_0x481342[_0x9e16('0x49')]['id'];return _0x569b64;});return db[_0x9e16('0x32')][_0x9e16('0x4e')](_0x726598,{'transaction':_0x50bed0});});})['then'](function(){return db[_0x9e16('0x32')][_0x9e16('0x45')]({'where':{'CustomReportId':_0x481342['params']['id']}});});}})['then'](respondWithResult(_0x127798,null))[_0x9e16('0x47')](handleError(_0x127798,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index f9868cb..bdd71d1 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 _0x5a93=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields'];(function(_0x3122c1,_0x21d826){var _0x2c280a=function(_0x20bec6){while(--_0x20bec6){_0x3122c1['push'](_0x3122c1['shift']());}};_0x2c280a(++_0x21d826);}(_0x5a93,0x17a));var _0x35a9=function(_0x13fa45,_0x3eecdc){_0x13fa45=_0x13fa45-0x0;var _0x5f2b91=_0x5a93[_0x13fa45];return _0x5f2b91;};'use strict';var _=require(_0x35a9('0x0'));var util=require(_0x35a9('0x1'));var logger=require(_0x35a9('0x2'))(_0x35a9('0x3'));var moment=require('moment');var BPromise=require(_0x35a9('0x4'));var rp=require(_0x35a9('0x5'));var fs=require('fs');var path=require(_0x35a9('0x6'));var rimraf=require(_0x35a9('0x7'));var config=require(_0x35a9('0x8'));var attributes=require(_0x35a9('0x9'));module[_0x35a9('0xa')]=function(_0x44bf7e,_0x5e25a4){return _0x44bf7e[_0x35a9('0xb')](_0x35a9('0xc'),attributes,{'tableName':_0x35a9('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x25b2=['define','analytics_report_fields','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','./analyticFieldReport.attributes'];(function(_0x268c4c,_0x5cce8d){var _0x37e96e=function(_0x59d4c2){while(--_0x59d4c2){_0x268c4c['push'](_0x268c4c['shift']());}};_0x37e96e(++_0x5cce8d);}(_0x25b2,0x188));var _0x225b=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x25b2[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x225b('0x0'));var util=require(_0x225b('0x1'));var logger=require(_0x225b('0x2'))(_0x225b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x225b('0x4'));var fs=require('fs');var path=require(_0x225b('0x5'));var rimraf=require('rimraf');var config=require(_0x225b('0x6'));var attributes=require(_0x225b('0x7'));module['exports']=function(_0x2c9ace,_0x140397){return _0x2c9ace[_0x225b('0x8')]('AnalyticFieldReport',attributes,{'tableName':_0x225b('0x9'),'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 3173d58..125b896 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 _0x6594=['client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise'];(function(_0x96e3c9,_0x2078a6){var _0x581019=function(_0x4a070b){while(--_0x4a070b){_0x96e3c9['push'](_0x96e3c9['shift']());}};_0x581019(++_0x2078a6);}(_0x6594,0x100));var _0x4659=function(_0x547bb6,_0x2d6f27){_0x547bb6=_0x547bb6-0x0;var _0x1a9154=_0x6594[_0x547bb6];return _0x1a9154;};'use strict';var _=require('lodash');var util=require(_0x4659('0x0'));var moment=require(_0x4659('0x1'));var BPromise=require('bluebird');var rs=require(_0x4659('0x2'));var fs=require('fs');var Redis=require(_0x4659('0x3'));var db=require(_0x4659('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4659('0x5'));var config=require(_0x4659('0x6'));var jayson=require(_0x4659('0x7'));var client=jayson[_0x4659('0x8')][_0x4659('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x16b1c3,_0x1bc8ab,_0x3f18e7){return new BPromise(function(_0x3734dc,_0x2955db){return client[_0x4659('0xa')](_0x16b1c3,_0x3f18e7)[_0x4659('0xb')](function(_0x1114bb){logger[_0x4659('0xc')](_0x4659('0xd'),_0x1bc8ab,_0x4659('0xe'));logger[_0x4659('0xf')](_0x4659('0x10'),_0x1bc8ab,_0x4659('0xe'),JSON[_0x4659('0x11')](_0x1114bb));if(_0x1114bb[_0x4659('0x12')]){if(_0x1114bb[_0x4659('0x12')][_0x4659('0x13')]===0x1f4){logger[_0x4659('0x12')](_0x4659('0xd'),_0x1bc8ab,_0x1114bb[_0x4659('0x12')][_0x4659('0x14')]);return _0x2955db(_0x1114bb[_0x4659('0x12')][_0x4659('0x14')]);}logger[_0x4659('0x12')](_0x4659('0xd'),_0x1bc8ab,_0x1114bb[_0x4659('0x12')]['message']);return _0x3734dc(_0x1114bb[_0x4659('0x12')][_0x4659('0x14')]);}else{logger[_0x4659('0xc')](_0x4659('0xd'),_0x1bc8ab,_0x4659('0xe'));_0x3734dc(_0x1114bb['result']['message']);}})[_0x4659('0x15')](function(_0x1918ea){logger[_0x4659('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1bc8ab,_0x1918ea);_0x2955db(_0x1918ea);});});} \ No newline at end of file +var _0x91c2=['http','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1f83a5,_0x59843f){var _0x45edf0=function(_0x431e25){while(--_0x431e25){_0x1f83a5['push'](_0x1f83a5['shift']());}};_0x45edf0(++_0x59843f);}(_0x91c2,0xb4));var _0x291c=function(_0x2323be,_0x222262){_0x2323be=_0x2323be-0x0;var _0x342eaf=_0x91c2[_0x2323be];return _0x342eaf;};'use strict';var _=require(_0x291c('0x0'));var util=require(_0x291c('0x1'));var moment=require(_0x291c('0x2'));var BPromise=require(_0x291c('0x3'));var rs=require(_0x291c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x291c('0x5'))['db'];var utils=require(_0x291c('0x6'));var logger=require(_0x291c('0x7'))(_0x291c('0x8'));var config=require(_0x291c('0x9'));var jayson=require(_0x291c('0xa'));var client=jayson[_0x291c('0xb')][_0x291c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1206f4,_0x3ac8d2,_0xff1395){return new BPromise(function(_0x472017,_0x15887d){return client[_0x291c('0xd')](_0x1206f4,_0xff1395)['then'](function(_0x21e16f){logger[_0x291c('0xe')](_0x291c('0xf'),_0x3ac8d2,_0x291c('0x10'));logger[_0x291c('0x11')](_0x291c('0x12'),_0x3ac8d2,'request\x20sent',JSON[_0x291c('0x13')](_0x21e16f));if(_0x21e16f[_0x291c('0x14')]){if(_0x21e16f[_0x291c('0x14')][_0x291c('0x15')]===0x1f4){logger['error'](_0x291c('0xf'),_0x3ac8d2,_0x21e16f['error'][_0x291c('0x16')]);return _0x15887d(_0x21e16f[_0x291c('0x14')][_0x291c('0x16')]);}logger[_0x291c('0x14')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3ac8d2,_0x21e16f[_0x291c('0x14')][_0x291c('0x16')]);return _0x472017(_0x21e16f[_0x291c('0x14')][_0x291c('0x16')]);}else{logger[_0x291c('0xe')](_0x291c('0xf'),_0x3ac8d2,_0x291c('0x10'));_0x472017(_0x21e16f[_0x291c('0x17')][_0x291c('0x16')]);}})['catch'](function(_0x5a274e){logger[_0x291c('0x14')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3ac8d2,_0x5a274e);_0x15887d(_0x5a274e);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 250e537..74cc944 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(_0x124d6c,_0x3f6654){var _0x3b4645=function(_0x206003){while(--_0x206003){_0x124d6c['push'](_0x124d6c['shift']());}};_0x3b4645(++_0x3f6654);}(_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['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(_0x27ac4b,_0x2fa555){var _0x1598a4=function(_0x26ceaa){while(--_0x26ceaa){_0x27ac4b['push'](_0x27ac4b['shift']());}};_0x1598a4(++_0x2fa555);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'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 da6aab3..b081bb0 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 _0x4746=['name','TEXT','STRING','sequelize','exports'];(function(_0x30a956,_0x11222e){var _0x2ac17d=function(_0x3be1d2){while(--_0x3be1d2){_0x30a956['push'](_0x30a956['shift']());}};_0x2ac17d(++_0x11222e);}(_0x4746,0xc6));var _0x6474=function(_0x5c8736,_0x2a2a03){_0x5c8736=_0x5c8736-0x0;var _0x142bdb=_0x4746[_0x5c8736];return _0x142bdb;};'use strict';var Sequelize=require(_0x6474('0x0'));module[_0x6474('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6474('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x6474('0x3')]},'description':{'type':Sequelize[_0x6474('0x4')]}}; \ No newline at end of file +var _0x3c1a=['STRING','name','TEXT','sequelize','exports'];(function(_0x4f08dd,_0x3784ec){var _0x3017ee=function(_0x7d95be){while(--_0x7d95be){_0x4f08dd['push'](_0x4f08dd['shift']());}};_0x3017ee(++_0x3784ec);}(_0x3c1a,0xda));var _0xa3c1=function(_0x1ae491,_0x5b83b9){_0x1ae491=_0x1ae491-0x0;var _0x4958a5=_0x3c1a[_0x1ae491];return _0x4958a5;};'use strict';var Sequelize=require(_0xa3c1('0x0'));module[_0xa3c1('0x1')]={'name':{'type':Sequelize[_0xa3c1('0x2')],'allowNull':![],'unique':_0xa3c1('0x3')},'table':{'type':Sequelize[_0xa3c1('0x2')]},'metric':{'type':Sequelize[_0xa3c1('0x4')]},'description':{'type':Sequelize[_0xa3c1('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 4de2639..773bd67 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 _0x55ca=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','get','Metrics','UserProfileResource','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','AnalyticMetric','findAll','catch','show','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x13ee19,_0x1a8807){var _0x4f2fbe=function(_0x36d6d4){while(--_0x36d6d4){_0x13ee19['push'](_0x13ee19['shift']());}};_0x4f2fbe(++_0x1a8807);}(_0x55ca,0x126));var _0xa55c=function(_0xa63ea3,_0x4367ff){_0xa63ea3=_0xa63ea3-0x0;var _0x2aa5ff=_0x55ca[_0xa63ea3];return _0x2aa5ff;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){var _0x54b038=_0x5ba836[_0xa55c('0x21')]({'plain':!![]});var _0x190757=_0xa55c('0x22');return db[_0xa55c('0x23')][_0xa55c('0x24')]({'where':{'type':_0x190757,'resourceId':_0x54b038['id']}})[_0xa55c('0x20')](function(){return _0x5ba836;});})[_0xa55c('0x20')](function(){_0x1fc828[_0xa55c('0x18')](0xcc)[_0xa55c('0x25')]();});}};}function handleEntityNotFound(_0x3cd152,_0x1273d7){return function(_0x57f271){if(!_0x57f271){_0x3cd152[_0xa55c('0x26')](0x194);}return _0x57f271;};}function handleError(_0x28814f,_0x1c9f6b){_0x1c9f6b=_0x1c9f6b||0x1f4;return function(_0x906caa){logger['error'](_0x906caa[_0xa55c('0x27')]);if(_0x906caa[_0xa55c('0x28')]){delete _0x906caa[_0xa55c('0x28')];}_0x28814f[_0xa55c('0x18')](_0x1c9f6b)[_0xa55c('0x29')](_0x906caa);};}exports[_0xa55c('0x2a')]=function(_0x52d37f,_0x23e698){var _0x490b7d={},_0x35c9c2={},_0x1d730b={'count':0x0,'rows':[]};var _0x1cc53e=_[_0xa55c('0x2b')](db['AnalyticMetric'][_0xa55c('0x2c')],function(_0x2096ae){return{'name':_0x2096ae[_0xa55c('0x2d')],'type':_0x2096ae[_0xa55c('0x2e')][_0xa55c('0x2f')]};});_0x35c9c2[_0xa55c('0x30')]=_[_0xa55c('0x2b')](_0x1cc53e,_0xa55c('0x28'));_0x35c9c2[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x52d37f[_0xa55c('0x31')]);_0x35c9c2['filters']=_['intersection'](_0x35c9c2[_0xa55c('0x30')],_0x35c9c2[_0xa55c('0x31')]);_0x490b7d['attributes']=_[_0xa55c('0x33')](_0x35c9c2[_0xa55c('0x30')],qs[_0xa55c('0x34')](_0x52d37f[_0xa55c('0x31')][_0xa55c('0x34')]));_0x490b7d[_0xa55c('0x35')]=_0x490b7d[_0xa55c('0x35')][_0xa55c('0x36')]?_0x490b7d[_0xa55c('0x35')]:_0x35c9c2['model'];if(!_0x52d37f['query']['hasOwnProperty'](_0xa55c('0x37'))){_0x490b7d[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x52d37f['query'][_0xa55c('0x1c')]);_0x490b7d['offset']=qs[_0xa55c('0x1a')](_0x52d37f['query'][_0xa55c('0x1a')]);}_0x490b7d[_0xa55c('0x38')]=qs[_0xa55c('0x39')](_0x52d37f['query'][_0xa55c('0x39')]);_0x490b7d[_0xa55c('0x3a')]=qs['filters'](_[_0xa55c('0x3b')](_0x52d37f[_0xa55c('0x31')],_0x35c9c2['filters']),_0x1cc53e);if(_0x52d37f['query'][_0xa55c('0x3c')]){_0x490b7d['where']=_[_0xa55c('0x3d')](_0x490b7d[_0xa55c('0x3a')],{'$or':_['map'](_0x1cc53e,function(_0x542d76){if(_0x542d76['type']!=='VIRTUAL'){var _0x3b3308={};_0x3b3308[_0x542d76[_0xa55c('0x28')]]={'$like':'%'+_0x52d37f[_0xa55c('0x31')][_0xa55c('0x3c')]+'%'};return _0x3b3308;}})});}_0x490b7d=_[_0xa55c('0x3d')]({},_0x490b7d,_0x52d37f['options']);var _0x3d52d8={'where':_0x490b7d[_0xa55c('0x3a')]};return db[_0xa55c('0x3e')][_0xa55c('0x1d')](_0x3d52d8)[_0xa55c('0x20')](function(_0x23cef5){_0x1d730b['count']=_0x23cef5;if(_0x52d37f[_0xa55c('0x31')]['includeAll']){_0x490b7d['include']=[{'all':!![]}];}return db[_0xa55c('0x3e')][_0xa55c('0x3f')](_0x490b7d);})['then'](function(_0x2bd98b){_0x1d730b['rows']=_0x2bd98b;return _0x1d730b;})['then'](respondWithFilteredResult(_0x23e698,_0x490b7d))[_0xa55c('0x40')](handleError(_0x23e698,null));};exports[_0xa55c('0x41')]=function(_0x1630ac,_0x540337){var _0x1b2708={'raw':!![],'where':{'id':_0x1630ac['params']['id']}},_0xd5a006={};_0xd5a006[_0xa55c('0x30')]=_['keys'](db[_0xa55c('0x3e')][_0xa55c('0x2c')]);_0xd5a006['query']=_[_0xa55c('0x32')](_0x1630ac[_0xa55c('0x31')]);_0xd5a006['filters']=_[_0xa55c('0x33')](_0xd5a006[_0xa55c('0x30')],_0xd5a006[_0xa55c('0x31')]);_0x1b2708['attributes']=_[_0xa55c('0x33')](_0xd5a006['model'],qs[_0xa55c('0x34')](_0x1630ac[_0xa55c('0x31')][_0xa55c('0x34')]));_0x1b2708['attributes']=_0x1b2708[_0xa55c('0x35')][_0xa55c('0x36')]?_0x1b2708['attributes']:_0xd5a006[_0xa55c('0x30')];if(_0x1630ac[_0xa55c('0x31')]['includeAll']){_0x1b2708[_0xa55c('0x42')]=[{'all':!![]}];}_0x1b2708=_[_0xa55c('0x3d')]({},_0x1b2708,_0x1630ac['options']);return db[_0xa55c('0x3e')][_0xa55c('0x43')](_0x1b2708)[_0xa55c('0x20')](handleEntityNotFound(_0x540337,null))[_0xa55c('0x20')](respondWithResult(_0x540337,null))['catch'](handleError(_0x540337,null));};exports[_0xa55c('0x44')]=function(_0x58a7ea,_0x2157d6){return db[_0xa55c('0x3e')][_0xa55c('0x44')](_0x58a7ea['body'],{})[_0xa55c('0x20')](function(_0x250b00){var _0x574fe9=_0x58a7ea[_0xa55c('0x45')][_0xa55c('0x21')]({'plain':!![]});if(!_0x574fe9)throw new Error(_0xa55c('0x46'));if(_0x574fe9[_0xa55c('0x47')]===_0xa55c('0x45')){var _0x1c84d9=_0x250b00[_0xa55c('0x21')]({'plain':!![]});var _0x129626=_0xa55c('0x22');return db[_0xa55c('0x48')]['find']({'where':{'name':_0x129626,'userProfileId':_0x574fe9[_0xa55c('0x49')]},'raw':!![]})[_0xa55c('0x20')](function(_0x216de8){if(_0x216de8&&_0x216de8['autoAssociation']===0x0){return db[_0xa55c('0x23')][_0xa55c('0x44')]({'name':_0x1c84d9['name'],'resourceId':_0x1c84d9['id'],'type':_0x216de8[_0xa55c('0x28')],'sectionId':_0x216de8['id']},{})['then'](function(){return _0x250b00;});}else{return _0x250b00;}})[_0xa55c('0x40')](function(_0x228df4){logger[_0xa55c('0x4a')](_0xa55c('0x4b'),_0x228df4);throw _0x228df4;});}return _0x250b00;})[_0xa55c('0x20')](respondWithResult(_0x2157d6,0xc9))['catch'](handleError(_0x2157d6,null));};exports[_0xa55c('0x1f')]=function(_0x4607ca,_0x4b85cc){if(_0x4607ca[_0xa55c('0x4c')]['id']){delete _0x4607ca[_0xa55c('0x4c')]['id'];}return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x4607ca['params']['id']}})['then'](handleEntityNotFound(_0x4b85cc,null))[_0xa55c('0x20')](saveUpdates(_0x4607ca[_0xa55c('0x4c')],null))[_0xa55c('0x20')](respondWithResult(_0x4b85cc,null))[_0xa55c('0x40')](handleError(_0x4b85cc,null));};exports['destroy']=function(_0x30c0c9,_0x5ce463){return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x30c0c9[_0xa55c('0x4d')]['id']}})[_0xa55c('0x20')](handleEntityNotFound(_0x5ce463,null))[_0xa55c('0x20')](removeEntity(_0x5ce463,null))['catch'](handleError(_0x5ce463,null));}; \ No newline at end of file +var _0xd6d6=['includeAll','catch','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','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Metrics','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','include','AnalyticMetric','rows','show'];(function(_0x446be5,_0x1c8c81){var _0x2a5872=function(_0x44f8ad){while(--_0x44f8ad){_0x446be5['push'](_0x446be5['shift']());}};_0x2a5872(++_0x1c8c81);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x393216,_0x33465f){_0x393216=_0x393216-0x0;var _0x33bc7b=_0xd6d6[_0x393216];return _0x33bc7b;};'use strict';var emlformat=require(_0x6d6d('0x0'));var rimraf=require(_0x6d6d('0x1'));var zipdir=require(_0x6d6d('0x2'));var jsonpatch=require(_0x6d6d('0x3'));var rp=require('request-promise');var moment=require(_0x6d6d('0x4'));var BPromise=require(_0x6d6d('0x5'));var Mustache=require(_0x6d6d('0x6'));var util=require(_0x6d6d('0x7'));var path=require(_0x6d6d('0x8'));var sox=require(_0x6d6d('0x9'));var csv=require(_0x6d6d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d6d('0xb'));var _=require(_0x6d6d('0xc'));var squel=require(_0x6d6d('0xd'));var crypto=require(_0x6d6d('0xe'));var jsforce=require(_0x6d6d('0xf'));var deskjs=require(_0x6d6d('0x10'));var toCsv=require(_0x6d6d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6d6d('0x11'));var authService=require(_0x6d6d('0x12'));var qs=require(_0x6d6d('0x13'));var as=require(_0x6d6d('0x14'));var hardwareService=require(_0x6d6d('0x15'));var logger=require('../../config/logger')(_0x6d6d('0x16'));var utils=require(_0x6d6d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6d6d('0x18'))['db'];function respondWithStatusCode(_0x32146d,_0xe61c36){_0xe61c36=_0xe61c36||0xcc;return function(_0x3f8542){if(_0x3f8542){return _0x32146d[_0x6d6d('0x19')](_0xe61c36);}return _0x32146d[_0x6d6d('0x1a')](_0xe61c36)[_0x6d6d('0x1b')]();};}function respondWithResult(_0x2cb2dd,_0x5f4154){_0x5f4154=_0x5f4154||0xc8;return function(_0xd09ea7){if(_0xd09ea7){return _0x2cb2dd[_0x6d6d('0x1a')](_0x5f4154)[_0x6d6d('0x1c')](_0xd09ea7);}};}function respondWithFilteredResult(_0xa3b05d,_0x29cbd8){return function(_0x5d80c0){if(_0x5d80c0){var _0x2e6fdb=typeof _0x29cbd8['offset']===_0x6d6d('0x1d')&&typeof _0x29cbd8[_0x6d6d('0x1e')]===_0x6d6d('0x1d');var _0x4bb3d1=_0x5d80c0['count'];var _0x9e1e18=_0x2e6fdb?0x0:_0x29cbd8[_0x6d6d('0x1f')];var _0x2b59d4=_0x2e6fdb?_0x5d80c0[_0x6d6d('0x20')]:_0x29cbd8['offset']+_0x29cbd8['limit'];var _0x474873;if(_0x2b59d4>=_0x4bb3d1){_0x2b59d4=_0x4bb3d1;_0x474873=0xc8;}else{_0x474873=0xce;}_0xa3b05d['status'](_0x474873);return _0xa3b05d[_0x6d6d('0x21')](_0x6d6d('0x22'),_0x9e1e18+'-'+_0x2b59d4+'/'+_0x4bb3d1)[_0x6d6d('0x1c')](_0x5d80c0);}return null;};}function patchUpdates(_0x450352){return function(_0x40d35b){try{jsonpatch[_0x6d6d('0x23')](_0x40d35b,_0x450352,!![]);}catch(_0x164c67){return BPromise[_0x6d6d('0x24')](_0x164c67);}return _0x40d35b[_0x6d6d('0x25')]();};}function saveUpdates(_0x6f64e3,_0x24b10d){return function(_0x6e58e3){if(_0x6e58e3){return _0x6e58e3[_0x6d6d('0x26')](_0x6f64e3)[_0x6d6d('0x27')](function(_0x1f7f88){return _0x1f7f88;});}return null;};}function removeEntity(_0x25a02e,_0xced622){return function(_0x583b10){if(_0x583b10){return _0x583b10[_0x6d6d('0x28')]()[_0x6d6d('0x27')](function(){var _0x99f7d6=_0x583b10[_0x6d6d('0x29')]({'plain':!![]});var _0xf0df7f=_0x6d6d('0x2a');return db['UserProfileResource'][_0x6d6d('0x28')]({'where':{'type':_0xf0df7f,'resourceId':_0x99f7d6['id']}})[_0x6d6d('0x27')](function(){return _0x583b10;});})[_0x6d6d('0x27')](function(){_0x25a02e[_0x6d6d('0x1a')](0xcc)[_0x6d6d('0x1b')]();});}};}function handleEntityNotFound(_0x408f98,_0x3641fc){return function(_0x4a57a1){if(!_0x4a57a1){_0x408f98[_0x6d6d('0x19')](0x194);}return _0x4a57a1;};}function handleError(_0x9595d8,_0x51bd68){_0x51bd68=_0x51bd68||0x1f4;return function(_0x553645){logger[_0x6d6d('0x2b')](_0x553645[_0x6d6d('0x2c')]);if(_0x553645[_0x6d6d('0x2d')]){delete _0x553645['name'];}_0x9595d8[_0x6d6d('0x1a')](_0x51bd68)[_0x6d6d('0x2e')](_0x553645);};}exports[_0x6d6d('0x2f')]=function(_0x1c8340,_0x64d1f7){var _0x428c17={},_0xdda3f2={},_0x359cfd={'count':0x0,'rows':[]};var _0x6c4741=_[_0x6d6d('0x30')](db['AnalyticMetric'][_0x6d6d('0x31')],function(_0x4f1fc5){return{'name':_0x4f1fc5[_0x6d6d('0x32')],'type':_0x4f1fc5[_0x6d6d('0x33')][_0x6d6d('0x34')]};});_0xdda3f2[_0x6d6d('0x35')]=_['map'](_0x6c4741,_0x6d6d('0x2d'));_0xdda3f2['query']=_[_0x6d6d('0x36')](_0x1c8340[_0x6d6d('0x37')]);_0xdda3f2['filters']=_[_0x6d6d('0x38')](_0xdda3f2[_0x6d6d('0x35')],_0xdda3f2[_0x6d6d('0x37')]);_0x428c17[_0x6d6d('0x39')]=_[_0x6d6d('0x38')](_0xdda3f2[_0x6d6d('0x35')],qs[_0x6d6d('0x3a')](_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x3a')]));_0x428c17[_0x6d6d('0x39')]=_0x428c17[_0x6d6d('0x39')][_0x6d6d('0x3b')]?_0x428c17[_0x6d6d('0x39')]:_0xdda3f2[_0x6d6d('0x35')];if(!_0x1c8340['query'][_0x6d6d('0x3c')](_0x6d6d('0x3d'))){_0x428c17[_0x6d6d('0x1e')]=qs[_0x6d6d('0x1e')](_0x1c8340['query']['limit']);_0x428c17[_0x6d6d('0x1f')]=qs[_0x6d6d('0x1f')](_0x1c8340[_0x6d6d('0x37')]['offset']);}_0x428c17[_0x6d6d('0x3e')]=qs[_0x6d6d('0x3f')](_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x3f')]);_0x428c17['where']=qs['filters'](_['pick'](_0x1c8340[_0x6d6d('0x37')],_0xdda3f2[_0x6d6d('0x40')]),_0x6c4741);if(_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x41')]){_0x428c17['where']=_[_0x6d6d('0x42')](_0x428c17[_0x6d6d('0x43')],{'$or':_[_0x6d6d('0x30')](_0x6c4741,function(_0x3c6d23){if(_0x3c6d23[_0x6d6d('0x33')]!==_0x6d6d('0x44')){var _0x4b457d={};_0x4b457d[_0x3c6d23[_0x6d6d('0x2d')]]={'$like':'%'+_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x41')]+'%'};return _0x4b457d;}})});}_0x428c17=_[_0x6d6d('0x42')]({},_0x428c17,_0x1c8340[_0x6d6d('0x45')]);var _0x3e27b7={'where':_0x428c17[_0x6d6d('0x43')]};return db['AnalyticMetric'][_0x6d6d('0x20')](_0x3e27b7)[_0x6d6d('0x27')](function(_0x16e177){_0x359cfd[_0x6d6d('0x20')]=_0x16e177;if(_0x1c8340[_0x6d6d('0x37')]['includeAll']){_0x428c17[_0x6d6d('0x46')]=[{'all':!![]}];}return db[_0x6d6d('0x47')]['findAll'](_0x428c17);})[_0x6d6d('0x27')](function(_0x50dc17){_0x359cfd[_0x6d6d('0x48')]=_0x50dc17;return _0x359cfd;})[_0x6d6d('0x27')](respondWithFilteredResult(_0x64d1f7,_0x428c17))['catch'](handleError(_0x64d1f7,null));};exports[_0x6d6d('0x49')]=function(_0x3324ec,_0x252cbe){var _0x4041f3={'raw':!![],'where':{'id':_0x3324ec['params']['id']}},_0xf7ea0d={};_0xf7ea0d['model']=_[_0x6d6d('0x36')](db['AnalyticMetric']['rawAttributes']);_0xf7ea0d[_0x6d6d('0x37')]=_[_0x6d6d('0x36')](_0x3324ec[_0x6d6d('0x37')]);_0xf7ea0d['filters']=_[_0x6d6d('0x38')](_0xf7ea0d['model'],_0xf7ea0d[_0x6d6d('0x37')]);_0x4041f3[_0x6d6d('0x39')]=_[_0x6d6d('0x38')](_0xf7ea0d[_0x6d6d('0x35')],qs[_0x6d6d('0x3a')](_0x3324ec[_0x6d6d('0x37')][_0x6d6d('0x3a')]));_0x4041f3['attributes']=_0x4041f3[_0x6d6d('0x39')][_0x6d6d('0x3b')]?_0x4041f3[_0x6d6d('0x39')]:_0xf7ea0d[_0x6d6d('0x35')];if(_0x3324ec[_0x6d6d('0x37')][_0x6d6d('0x4a')]){_0x4041f3[_0x6d6d('0x46')]=[{'all':!![]}];}_0x4041f3=_[_0x6d6d('0x42')]({},_0x4041f3,_0x3324ec[_0x6d6d('0x45')]);return db['AnalyticMetric']['find'](_0x4041f3)[_0x6d6d('0x27')](handleEntityNotFound(_0x252cbe,null))[_0x6d6d('0x27')](respondWithResult(_0x252cbe,null))[_0x6d6d('0x4b')](handleError(_0x252cbe,null));};exports[_0x6d6d('0x4c')]=function(_0xe2a20e,_0x492834){return db[_0x6d6d('0x47')][_0x6d6d('0x4c')](_0xe2a20e[_0x6d6d('0x4d')],{})[_0x6d6d('0x27')](function(_0x2ee917){var _0x23c2db=_0xe2a20e[_0x6d6d('0x4e')][_0x6d6d('0x29')]({'plain':!![]});if(!_0x23c2db)throw new Error(_0x6d6d('0x4f'));if(_0x23c2db[_0x6d6d('0x50')]===_0x6d6d('0x4e')){var _0x175e26=_0x2ee917['get']({'plain':!![]});var _0x190786=_0x6d6d('0x2a');return db[_0x6d6d('0x51')][_0x6d6d('0x52')]({'where':{'name':_0x190786,'userProfileId':_0x23c2db[_0x6d6d('0x53')]},'raw':!![]})['then'](function(_0x38c307){if(_0x38c307&&_0x38c307[_0x6d6d('0x54')]===0x0){return db[_0x6d6d('0x55')]['create']({'name':_0x175e26['name'],'resourceId':_0x175e26['id'],'type':_0x38c307[_0x6d6d('0x2d')],'sectionId':_0x38c307['id']},{})['then'](function(){return _0x2ee917;});}else{return _0x2ee917;}})[_0x6d6d('0x4b')](function(_0x995fe2){logger[_0x6d6d('0x2b')](_0x6d6d('0x56'),_0x995fe2);throw _0x995fe2;});}return _0x2ee917;})[_0x6d6d('0x27')](respondWithResult(_0x492834,0xc9))[_0x6d6d('0x4b')](handleError(_0x492834,null));};exports[_0x6d6d('0x26')]=function(_0x26c23a,_0x1a8f33){if(_0x26c23a[_0x6d6d('0x4d')]['id']){delete _0x26c23a['body']['id'];}return db[_0x6d6d('0x47')][_0x6d6d('0x52')]({'where':{'id':_0x26c23a[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x27')](handleEntityNotFound(_0x1a8f33,null))[_0x6d6d('0x27')](saveUpdates(_0x26c23a[_0x6d6d('0x4d')],null))[_0x6d6d('0x27')](respondWithResult(_0x1a8f33,null))['catch'](handleError(_0x1a8f33,null));};exports['destroy']=function(_0x3ad9b0,_0x122865){return db['AnalyticMetric'][_0x6d6d('0x52')]({'where':{'id':_0x3ad9b0[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x27')](handleEntityNotFound(_0x122865,null))[_0x6d6d('0x27')](removeEntity(_0x122865,null))[_0x6d6d('0x4b')](handleError(_0x122865,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 2c8e85e..1de85ae 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 _0x11e5=['path','../../config/environment','define','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x354e78,_0xa8c7d8){var _0x3f9cb2=function(_0x2bdff2){while(--_0x2bdff2){_0x354e78['push'](_0x354e78['shift']());}};_0x3f9cb2(++_0xa8c7d8);}(_0x11e5,0x8b));var _0x511e=function(_0x40f4cc,_0x432f55){_0x40f4cc=_0x40f4cc-0x0;var _0x458315=_0x11e5[_0x40f4cc];return _0x458315;};'use strict';var _=require(_0x511e('0x0'));var util=require('util');var logger=require(_0x511e('0x1'))(_0x511e('0x2'));var moment=require('moment');var BPromise=require(_0x511e('0x3'));var rp=require(_0x511e('0x4'));var fs=require('fs');var path=require(_0x511e('0x5'));var rimraf=require('rimraf');var config=require(_0x511e('0x6'));var attributes=require('./analyticMetric.attributes');module['exports']=function(_0x342539,_0x323f8c){return _0x342539[_0x511e('0x7')]('AnalyticMetric',attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3c94=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','moment'];(function(_0x58029b,_0x4ce586){var _0x4b3678=function(_0x4934e5){while(--_0x4934e5){_0x58029b['push'](_0x58029b['shift']());}};_0x4b3678(++_0x4ce586);}(_0x3c94,0xcd));var _0x43c9=function(_0x11eb1f,_0x826f0b){_0x11eb1f=_0x11eb1f-0x0;var _0x2121e9=_0x3c94[_0x11eb1f];return _0x2121e9;};'use strict';var _=require(_0x43c9('0x0'));var util=require(_0x43c9('0x1'));var logger=require(_0x43c9('0x2'))(_0x43c9('0x3'));var moment=require(_0x43c9('0x4'));var BPromise=require(_0x43c9('0x5'));var rp=require(_0x43c9('0x6'));var fs=require('fs');var path=require(_0x43c9('0x7'));var rimraf=require(_0x43c9('0x8'));var config=require(_0x43c9('0x9'));var attributes=require(_0x43c9('0xa'));module[_0x43c9('0xb')]=function(_0x4fdfc2,_0x39c220){return _0x4fdfc2[_0x43c9('0xc')](_0x43c9('0xd'),attributes,{'tableName':_0x43c9('0xe'),'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 1b958f8..5ac6ca7 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 _0xbb20=['AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug'];(function(_0x57392e,_0x2ba38b){var _0x1f2183=function(_0x2563ad){while(--_0x2563ad){_0x57392e['push'](_0x57392e['shift']());}};_0x1f2183(++_0x2ba38b);}(_0xbb20,0x152));var _0x0bb2=function(_0xbeea1c,_0x541820){_0xbeea1c=_0xbeea1c-0x0;var _0x294011=_0xbb20[_0xbeea1c];return _0x294011;};'use strict';var _=require('lodash');var util=require(_0x0bb2('0x0'));var moment=require(_0x0bb2('0x1'));var BPromise=require(_0x0bb2('0x2'));var rs=require(_0x0bb2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0bb2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0bb2('0x5'))('rpc');var config=require(_0x0bb2('0x6'));var jayson=require(_0x0bb2('0x7'));var client=jayson[_0x0bb2('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xebdd98,_0x59ad45,_0x4b4fcc){return new BPromise(function(_0x5470ac,_0xf51477){return client[_0x0bb2('0x9')](_0xebdd98,_0x4b4fcc)[_0x0bb2('0xa')](function(_0x6e2381){logger[_0x0bb2('0xb')]('AnalyticMetric,\x20%s,\x20%s',_0x59ad45,_0x0bb2('0xc'));logger[_0x0bb2('0xd')](_0x0bb2('0xe'),_0x59ad45,_0x0bb2('0xc'),JSON[_0x0bb2('0xf')](_0x6e2381));if(_0x6e2381[_0x0bb2('0x10')]){if(_0x6e2381[_0x0bb2('0x10')][_0x0bb2('0x11')]===0x1f4){logger[_0x0bb2('0x10')](_0x0bb2('0x12'),_0x59ad45,_0x6e2381[_0x0bb2('0x10')][_0x0bb2('0x13')]);return _0xf51477(_0x6e2381['error'][_0x0bb2('0x13')]);}logger[_0x0bb2('0x10')](_0x0bb2('0x12'),_0x59ad45,_0x6e2381[_0x0bb2('0x10')][_0x0bb2('0x13')]);return _0x5470ac(_0x6e2381[_0x0bb2('0x10')]['message']);}else{logger[_0x0bb2('0xb')](_0x0bb2('0x12'),_0x59ad45,_0x0bb2('0xc'));_0x5470ac(_0x6e2381[_0x0bb2('0x14')][_0x0bb2('0x13')]);}})[_0x0bb2('0x15')](function(_0x5013bb){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x59ad45,_0x5013bb);_0xf51477(_0x5013bb);});});} \ No newline at end of file +var _0x9da1=['stringify','error','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x9da1,0x98));var _0x19da=function(_0x385b70,_0x52974f){_0x385b70=_0x385b70-0x0;var _0x33e2ef=_0x9da1[_0x385b70];return _0x33e2ef;};'use strict';var _=require(_0x19da('0x0'));var util=require(_0x19da('0x1'));var moment=require(_0x19da('0x2'));var BPromise=require(_0x19da('0x3'));var rs=require(_0x19da('0x4'));var fs=require('fs');var Redis=require(_0x19da('0x5'));var db=require(_0x19da('0x6'))['db'];var utils=require(_0x19da('0x7'));var logger=require('../../config/logger')(_0x19da('0x8'));var config=require(_0x19da('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x19da('0xa')][_0x19da('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5c23c1,_0x1d226b,_0x280b3e){return new BPromise(function(_0x33debf,_0x295f43){return client['request'](_0x5c23c1,_0x280b3e)[_0x19da('0xc')](function(_0x85c76c){logger['info'](_0x19da('0xd'),_0x1d226b,_0x19da('0xe'));logger['debug'](_0x19da('0xf'),_0x1d226b,'request\x20sent',JSON[_0x19da('0x10')](_0x85c76c));if(_0x85c76c[_0x19da('0x11')]){if(_0x85c76c[_0x19da('0x11')]['code']===0x1f4){logger[_0x19da('0x11')](_0x19da('0xd'),_0x1d226b,_0x85c76c['error'][_0x19da('0x12')]);return _0x295f43(_0x85c76c[_0x19da('0x11')][_0x19da('0x12')]);}logger[_0x19da('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x1d226b,_0x85c76c['error'][_0x19da('0x12')]);return _0x33debf(_0x85c76c['error'][_0x19da('0x12')]);}else{logger[_0x19da('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x1d226b,_0x19da('0xe'));_0x33debf(_0x85c76c['result'][_0x19da('0x12')]);}})[_0x19da('0x14')](function(_0x2afec5){logger[_0x19da('0x11')](_0x19da('0xd'),_0x1d226b,_0x2afec5);_0x295f43(_0x2afec5);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 2016510..fd1952d 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 _0xf13b=['multer','express','Router','fs-extra','../../components/auth/service','./analyticMetric.controller','get','index','isAuthenticated','show','create','put','/:id','update','destroy','exports'];(function(_0x33f5fd,_0x13c092){var _0x4f4546=function(_0x4cb466){while(--_0x4cb466){_0x33f5fd['push'](_0x33f5fd['shift']());}};_0x4f4546(++_0x13c092);}(_0xf13b,0x1f0));var _0xbf13=function(_0x2d43ea,_0x169e4c){_0x2d43ea=_0x2d43ea-0x0;var _0x432d99=_0xf13b[_0x2d43ea];return _0x432d99;};'use strict';var multer=require(_0xbf13('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbf13('0x1'));var router=express[_0xbf13('0x2')]();var fs_extra=require(_0xbf13('0x3'));var auth=require(_0xbf13('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbf13('0x5'));router[_0xbf13('0x6')]('/',auth['isAuthenticated'](),controller[_0xbf13('0x7')]);router[_0xbf13('0x6')]('/:id',auth[_0xbf13('0x8')](),controller[_0xbf13('0x9')]);router['post']('/',auth[_0xbf13('0x8')](),controller[_0xbf13('0xa')]);router[_0xbf13('0xb')](_0xbf13('0xc'),auth['isAuthenticated'](),controller[_0xbf13('0xd')]);router['delete'](_0xbf13('0xc'),auth['isAuthenticated'](),controller[_0xbf13('0xe')]);module[_0xbf13('0xf')]=router; \ No newline at end of file +var _0x41f2=['fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','update','delete','destroy','multer','util','connect-timeout','express','Router'];(function(_0x31678f,_0x4bd077){var _0x49d438=function(_0x5139d4){while(--_0x5139d4){_0x31678f['push'](_0x31678f['shift']());}};_0x49d438(++_0x4bd077);}(_0x41f2,0x14f));var _0x241f=function(_0xec1bf7,_0x4b5613){_0xec1bf7=_0xec1bf7-0x0;var _0x1f5431=_0x41f2[_0xec1bf7];return _0x1f5431;};'use strict';var multer=require(_0x241f('0x0'));var util=require(_0x241f('0x1'));var path=require('path');var timeout=require(_0x241f('0x2'));var express=require(_0x241f('0x3'));var router=express[_0x241f('0x4')]();var fs_extra=require(_0x241f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x241f('0x6'));var config=require(_0x241f('0x7'));var controller=require('./analyticMetric.controller');router[_0x241f('0x8')]('/',auth[_0x241f('0x9')](),controller[_0x241f('0xa')]);router[_0x241f('0x8')](_0x241f('0xb'),auth['isAuthenticated'](),controller[_0x241f('0xc')]);router[_0x241f('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x241f('0xb'),auth['isAuthenticated'](),controller[_0x241f('0xe')]);router[_0x241f('0xf')](_0x241f('0xb'),auth['isAuthenticated'](),controller[_0x241f('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 8d3370c..279eeec 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 _0xe623=['exports','TEXT'];(function(_0x781f65,_0x1908bd){var _0x4b5514=function(_0x20298d){while(--_0x20298d){_0x781f65['push'](_0x781f65['shift']());}};_0x4b5514(++_0x1908bd);}(_0xe623,0x10a));var _0x3e62=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xe623[_0x11005e];return _0x29338f;};'use strict';var Sequelize=require('sequelize');module[_0x3e62('0x0')]={'tree':{'type':Sequelize[_0x3e62('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x5ce0=['exports'];(function(_0x271060,_0x3f86b1){var _0x40540b=function(_0x1735a7){while(--_0x1735a7){_0x271060['push'](_0x271060['shift']());}};_0x40540b(++_0x3f86b1);}(_0x5ce0,0x1ed));var _0x05ce=function(_0x5e8d3e,_0x18ed2e){_0x5e8d3e=_0x5e8d3e-0x0;var _0x1348c0=_0x5ce0[_0x5e8d3e];return _0x1348c0;};'use strict';var Sequelize=require('sequelize');module[_0x05ce('0x0')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index ad9743d..9530b16 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 _0xa803=['../../config/environment','../../config/license/util','end','status','json','limit','undefined','offset','count','set','Content-Range','apply','update','destroy','then','sendStatus','error','stack','name','index','AnalyticTreeReport','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','map','VIRTUAL','include','findAll','rows','catch','show','keys','rawAttributes','includeAll','options','create','body','params','find','eml-format','zip-dir','fast-json-patch','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','../../config/logger','api'];(function(_0x492fe1,_0x54de76){var _0x269485=function(_0x59a3ca){while(--_0x59a3ca){_0x492fe1['push'](_0x492fe1['shift']());}};_0x269485(++_0x54de76);}(_0xa803,0x119));var _0x3a80=function(_0x4937c7,_0x49c4c1){_0x4937c7=_0x4937c7-0x0;var _0x4ba422=_0xa803[_0x4937c7];return _0x4ba422;};'use strict';var emlformat=require(_0x3a80('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3a80('0x1'));var jsonpatch=require(_0x3a80('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3a80('0x3'));var Mustache=require(_0x3a80('0x4'));var util=require(_0x3a80('0x5'));var path=require(_0x3a80('0x6'));var sox=require('sox');var csv=require(_0x3a80('0x7'));var ejs=require(_0x3a80('0x8'));var fs=require('fs');var fs_extra=require(_0x3a80('0x9'));var _=require(_0x3a80('0xa'));var squel=require(_0x3a80('0xb'));var crypto=require(_0x3a80('0xc'));var jsforce=require(_0x3a80('0xd'));var deskjs=require(_0x3a80('0xe'));var toCsv=require(_0x3a80('0x7'));var querystring=require(_0x3a80('0xf'));var Papa=require(_0x3a80('0x10'));var Redis=require(_0x3a80('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x3a80('0x12'));var as=require(_0x3a80('0x13'));var hardwareService=require(_0x3a80('0x14'));var logger=require(_0x3a80('0x15'))(_0x3a80('0x16'));var utils=require('../../config/utils');var config=require(_0x3a80('0x17'));var licenseUtil=require(_0x3a80('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x501ca6,_0x34b188){_0x34b188=_0x34b188||0xcc;return function(_0x40919b){if(_0x40919b){return _0x501ca6['sendStatus'](_0x34b188);}return _0x501ca6['status'](_0x34b188)[_0x3a80('0x19')]();};}function respondWithResult(_0xdf5e00,_0x34487d){_0x34487d=_0x34487d||0xc8;return function(_0x406b30){if(_0x406b30){return _0xdf5e00[_0x3a80('0x1a')](_0x34487d)[_0x3a80('0x1b')](_0x406b30);}};}function respondWithFilteredResult(_0x22c925,_0x27b26e){return function(_0x5b8eeb){if(_0x5b8eeb){var _0x8ae209=typeof _0x27b26e['offset']==='undefined'&&typeof _0x27b26e[_0x3a80('0x1c')]===_0x3a80('0x1d');var _0x372c75=_0x5b8eeb['count'];var _0x580e0c=_0x8ae209?0x0:_0x27b26e[_0x3a80('0x1e')];var _0x4c6466=_0x8ae209?_0x5b8eeb[_0x3a80('0x1f')]:_0x27b26e[_0x3a80('0x1e')]+_0x27b26e[_0x3a80('0x1c')];var _0x504b69;if(_0x4c6466>=_0x372c75){_0x4c6466=_0x372c75;_0x504b69=0xc8;}else{_0x504b69=0xce;}_0x22c925[_0x3a80('0x1a')](_0x504b69);return _0x22c925[_0x3a80('0x20')](_0x3a80('0x21'),_0x580e0c+'-'+_0x4c6466+'/'+_0x372c75)[_0x3a80('0x1b')](_0x5b8eeb);}return null;};}function patchUpdates(_0xeda109){return function(_0x4ab27f){try{jsonpatch[_0x3a80('0x22')](_0x4ab27f,_0xeda109,!![]);}catch(_0x114a00){return BPromise['reject'](_0x114a00);}return _0x4ab27f['save']();};}function saveUpdates(_0x35948a,_0x35acd4){return function(_0x1d3fcd){if(_0x1d3fcd){return _0x1d3fcd[_0x3a80('0x23')](_0x35948a)['then'](function(_0x7d8323){return _0x7d8323;});}return null;};}function removeEntity(_0x295651,_0x1a49eb){return function(_0x2bb0f3){if(_0x2bb0f3){return _0x2bb0f3[_0x3a80('0x24')]()[_0x3a80('0x25')](function(){_0x295651[_0x3a80('0x1a')](0xcc)[_0x3a80('0x19')]();});}};}function handleEntityNotFound(_0x6bdbca,_0x1cad4b){return function(_0x21ccbd){if(!_0x21ccbd){_0x6bdbca[_0x3a80('0x26')](0x194);}return _0x21ccbd;};}function handleError(_0x8b3eb4,_0x8e98da){_0x8e98da=_0x8e98da||0x1f4;return function(_0x4f97a3){logger[_0x3a80('0x27')](_0x4f97a3[_0x3a80('0x28')]);if(_0x4f97a3[_0x3a80('0x29')]){delete _0x4f97a3[_0x3a80('0x29')];}_0x8b3eb4[_0x3a80('0x1a')](_0x8e98da)['send'](_0x4f97a3);};}exports[_0x3a80('0x2a')]=function(_0x42578e,_0xf7dc9b){var _0x16e963={},_0x5c9569={},_0xfba31={'count':0x0,'rows':[]};var _0x505b7f=_['map'](db[_0x3a80('0x2b')]['rawAttributes'],function(_0x2b2cc5){return{'name':_0x2b2cc5[_0x3a80('0x2c')],'type':_0x2b2cc5[_0x3a80('0x2d')][_0x3a80('0x2e')]};});_0x5c9569[_0x3a80('0x2f')]=_['map'](_0x505b7f,_0x3a80('0x29'));_0x5c9569[_0x3a80('0x30')]=_['keys'](_0x42578e[_0x3a80('0x30')]);_0x5c9569['filters']=_[_0x3a80('0x31')](_0x5c9569[_0x3a80('0x2f')],_0x5c9569[_0x3a80('0x30')]);_0x16e963['attributes']=_[_0x3a80('0x31')](_0x5c9569[_0x3a80('0x2f')],qs[_0x3a80('0x32')](_0x42578e[_0x3a80('0x30')][_0x3a80('0x32')]));_0x16e963[_0x3a80('0x33')]=_0x16e963[_0x3a80('0x33')][_0x3a80('0x34')]?_0x16e963['attributes']:_0x5c9569[_0x3a80('0x2f')];if(!_0x42578e[_0x3a80('0x30')][_0x3a80('0x35')]('nolimit')){_0x16e963[_0x3a80('0x1c')]=qs[_0x3a80('0x1c')](_0x42578e[_0x3a80('0x30')][_0x3a80('0x1c')]);_0x16e963[_0x3a80('0x1e')]=qs[_0x3a80('0x1e')](_0x42578e[_0x3a80('0x30')][_0x3a80('0x1e')]);}_0x16e963[_0x3a80('0x36')]=qs['sort'](_0x42578e[_0x3a80('0x30')][_0x3a80('0x37')]);_0x16e963[_0x3a80('0x38')]=qs['filters'](_[_0x3a80('0x39')](_0x42578e[_0x3a80('0x30')],_0x5c9569[_0x3a80('0x3a')]),_0x505b7f);if(_0x42578e[_0x3a80('0x30')][_0x3a80('0x3b')]){_0x16e963[_0x3a80('0x38')]=_[_0x3a80('0x3c')](_0x16e963[_0x3a80('0x38')],{'$or':_[_0x3a80('0x3d')](_0x505b7f,function(_0x5486be){if(_0x5486be[_0x3a80('0x2d')]!==_0x3a80('0x3e')){var _0x27fee4={};_0x27fee4[_0x5486be[_0x3a80('0x29')]]={'$like':'%'+_0x42578e[_0x3a80('0x30')][_0x3a80('0x3b')]+'%'};return _0x27fee4;}})});}_0x16e963=_[_0x3a80('0x3c')]({},_0x16e963,_0x42578e['options']);var _0x367b68={'where':_0x16e963[_0x3a80('0x38')]};return db['AnalyticTreeReport']['count'](_0x367b68)['then'](function(_0x80318e){_0xfba31['count']=_0x80318e;if(_0x42578e['query']['includeAll']){_0x16e963[_0x3a80('0x3f')]=[{'all':!![]}];}return db[_0x3a80('0x2b')][_0x3a80('0x40')](_0x16e963);})[_0x3a80('0x25')](function(_0x3e88c2){_0xfba31[_0x3a80('0x41')]=_0x3e88c2;return _0xfba31;})[_0x3a80('0x25')](respondWithFilteredResult(_0xf7dc9b,_0x16e963))[_0x3a80('0x42')](handleError(_0xf7dc9b,null));};exports[_0x3a80('0x43')]=function(_0x4fef3a,_0x2238f3){var _0x4a256f={'raw':!![],'where':{'id':_0x4fef3a['params']['id']}},_0x1b77cf={};_0x1b77cf[_0x3a80('0x2f')]=_[_0x3a80('0x44')](db[_0x3a80('0x2b')][_0x3a80('0x45')]);_0x1b77cf['query']=_['keys'](_0x4fef3a[_0x3a80('0x30')]);_0x1b77cf['filters']=_[_0x3a80('0x31')](_0x1b77cf[_0x3a80('0x2f')],_0x1b77cf['query']);_0x4a256f[_0x3a80('0x33')]=_[_0x3a80('0x31')](_0x1b77cf[_0x3a80('0x2f')],qs['fields'](_0x4fef3a[_0x3a80('0x30')][_0x3a80('0x32')]));_0x4a256f[_0x3a80('0x33')]=_0x4a256f[_0x3a80('0x33')][_0x3a80('0x34')]?_0x4a256f[_0x3a80('0x33')]:_0x1b77cf[_0x3a80('0x2f')];if(_0x4fef3a[_0x3a80('0x30')][_0x3a80('0x46')]){_0x4a256f[_0x3a80('0x3f')]=[{'all':!![]}];}_0x4a256f=_['merge']({},_0x4a256f,_0x4fef3a[_0x3a80('0x47')]);return db[_0x3a80('0x2b')]['find'](_0x4a256f)[_0x3a80('0x25')](handleEntityNotFound(_0x2238f3,null))[_0x3a80('0x25')](respondWithResult(_0x2238f3,null))[_0x3a80('0x42')](handleError(_0x2238f3,null));};exports[_0x3a80('0x48')]=function(_0x2a345b,_0x51e41c){return db[_0x3a80('0x2b')]['create'](_0x2a345b[_0x3a80('0x49')],{})[_0x3a80('0x25')](respondWithResult(_0x51e41c,0xc9))[_0x3a80('0x42')](handleError(_0x51e41c,null));};exports[_0x3a80('0x23')]=function(_0x326117,_0x221dc2){if(_0x326117[_0x3a80('0x49')]['id']){delete _0x326117['body']['id'];}return db['AnalyticTreeReport']['find']({'where':{'id':_0x326117[_0x3a80('0x4a')]['id']}})[_0x3a80('0x25')](handleEntityNotFound(_0x221dc2,null))[_0x3a80('0x25')](saveUpdates(_0x326117[_0x3a80('0x49')],null))['then'](respondWithResult(_0x221dc2,null))[_0x3a80('0x42')](handleError(_0x221dc2,null));};exports['destroy']=function(_0x5bd1bb,_0x24eaee){return db[_0x3a80('0x2b')][_0x3a80('0x4b')]({'where':{'id':_0x5bd1bb[_0x3a80('0x4a')]['id']}})[_0x3a80('0x25')](handleEntityNotFound(_0x24eaee,null))[_0x3a80('0x25')](removeEntity(_0x24eaee,null))[_0x3a80('0x42')](handleError(_0x24eaee,null));}; \ No newline at end of file +var _0x6075=['limit','set','apply','reject','save','then','destroy','stack','name','send','map','AnalyticTreeReport','rawAttributes','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','count','rows','show','params','keys','includeAll','include','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined'];(function(_0x2da1aa,_0x6560e6){var _0x7dcea1=function(_0x2849a2){while(--_0x2849a2){_0x2da1aa['push'](_0x2da1aa['shift']());}};_0x7dcea1(++_0x6560e6);}(_0x6075,0x10d));var _0x5607=function(_0x78085d,_0x225f2f){_0x78085d=_0x78085d-0x0;var _0x2e8a78=_0x6075[_0x78085d];return _0x2e8a78;};'use strict';var emlformat=require(_0x5607('0x0'));var rimraf=require(_0x5607('0x1'));var zipdir=require(_0x5607('0x2'));var jsonpatch=require(_0x5607('0x3'));var rp=require(_0x5607('0x4'));var moment=require(_0x5607('0x5'));var BPromise=require(_0x5607('0x6'));var Mustache=require(_0x5607('0x7'));var util=require(_0x5607('0x8'));var path=require('path');var sox=require(_0x5607('0x9'));var csv=require(_0x5607('0xa'));var ejs=require(_0x5607('0xb'));var fs=require('fs');var fs_extra=require(_0x5607('0xc'));var _=require(_0x5607('0xd'));var squel=require(_0x5607('0xe'));var crypto=require(_0x5607('0xf'));var jsforce=require(_0x5607('0x10'));var deskjs=require(_0x5607('0x11'));var toCsv=require(_0x5607('0xa'));var querystring=require(_0x5607('0x12'));var Papa=require(_0x5607('0x13'));var Redis=require(_0x5607('0x14'));var authService=require(_0x5607('0x15'));var qs=require(_0x5607('0x16'));var as=require(_0x5607('0x17'));var hardwareService=require(_0x5607('0x18'));var logger=require(_0x5607('0x19'))(_0x5607('0x1a'));var utils=require('../../config/utils');var config=require(_0x5607('0x1b'));var licenseUtil=require(_0x5607('0x1c'));var db=require(_0x5607('0x1d'))['db'];function respondWithStatusCode(_0x23f4b4,_0x3b3507){_0x3b3507=_0x3b3507||0xcc;return function(_0x28ed1a){if(_0x28ed1a){return _0x23f4b4['sendStatus'](_0x3b3507);}return _0x23f4b4[_0x5607('0x1e')](_0x3b3507)[_0x5607('0x1f')]();};}function respondWithResult(_0x5c09f0,_0xf32a2b){_0xf32a2b=_0xf32a2b||0xc8;return function(_0x36ea16){if(_0x36ea16){return _0x5c09f0[_0x5607('0x1e')](_0xf32a2b)[_0x5607('0x20')](_0x36ea16);}};}function respondWithFilteredResult(_0x4114f2,_0xddbb09){return function(_0x1abf1d){if(_0x1abf1d){var _0x5a19de=typeof _0xddbb09[_0x5607('0x21')]===_0x5607('0x22')&&typeof _0xddbb09[_0x5607('0x23')]===_0x5607('0x22');var _0x82acbe=_0x1abf1d['count'];var _0x5595f2=_0x5a19de?0x0:_0xddbb09['offset'];var _0x30031d=_0x5a19de?_0x1abf1d['count']:_0xddbb09[_0x5607('0x21')]+_0xddbb09[_0x5607('0x23')];var _0x14cde0;if(_0x30031d>=_0x82acbe){_0x30031d=_0x82acbe;_0x14cde0=0xc8;}else{_0x14cde0=0xce;}_0x4114f2[_0x5607('0x1e')](_0x14cde0);return _0x4114f2[_0x5607('0x24')]('Content-Range',_0x5595f2+'-'+_0x30031d+'/'+_0x82acbe)['json'](_0x1abf1d);}return null;};}function patchUpdates(_0x364d0a){return function(_0x50d65f){try{jsonpatch[_0x5607('0x25')](_0x50d65f,_0x364d0a,!![]);}catch(_0x205983){return BPromise[_0x5607('0x26')](_0x205983);}return _0x50d65f[_0x5607('0x27')]();};}function saveUpdates(_0x2dcb62,_0x2a08ce){return function(_0x421c1f){if(_0x421c1f){return _0x421c1f['update'](_0x2dcb62)[_0x5607('0x28')](function(_0x5246b2){return _0x5246b2;});}return null;};}function removeEntity(_0x521afe,_0x12a26d){return function(_0x6f64b0){if(_0x6f64b0){return _0x6f64b0[_0x5607('0x29')]()[_0x5607('0x28')](function(){_0x521afe[_0x5607('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e26a4,_0x4e5afc){return function(_0x126f6c){if(!_0x126f6c){_0x5e26a4['sendStatus'](0x194);}return _0x126f6c;};}function handleError(_0x5dbdfc,_0x422567){_0x422567=_0x422567||0x1f4;return function(_0x2b0c91){logger['error'](_0x2b0c91[_0x5607('0x2a')]);if(_0x2b0c91[_0x5607('0x2b')]){delete _0x2b0c91[_0x5607('0x2b')];}_0x5dbdfc[_0x5607('0x1e')](_0x422567)[_0x5607('0x2c')](_0x2b0c91);};}exports['index']=function(_0x313058,_0x5ece74){var _0x4ba05c={},_0x1416e6={},_0xd7235d={'count':0x0,'rows':[]};var _0x2adc0c=_[_0x5607('0x2d')](db[_0x5607('0x2e')][_0x5607('0x2f')],function(_0x352680){return{'name':_0x352680['fieldName'],'type':_0x352680['type']['key']};});_0x1416e6['model']=_[_0x5607('0x2d')](_0x2adc0c,_0x5607('0x2b'));_0x1416e6['query']=_['keys'](_0x313058[_0x5607('0x30')]);_0x1416e6[_0x5607('0x31')]=_[_0x5607('0x32')](_0x1416e6[_0x5607('0x33')],_0x1416e6['query']);_0x4ba05c[_0x5607('0x34')]=_[_0x5607('0x32')](_0x1416e6[_0x5607('0x33')],qs[_0x5607('0x35')](_0x313058[_0x5607('0x30')][_0x5607('0x35')]));_0x4ba05c[_0x5607('0x34')]=_0x4ba05c['attributes'][_0x5607('0x36')]?_0x4ba05c[_0x5607('0x34')]:_0x1416e6[_0x5607('0x33')];if(!_0x313058[_0x5607('0x30')][_0x5607('0x37')](_0x5607('0x38'))){_0x4ba05c[_0x5607('0x23')]=qs[_0x5607('0x23')](_0x313058[_0x5607('0x30')][_0x5607('0x23')]);_0x4ba05c['offset']=qs[_0x5607('0x21')](_0x313058['query'][_0x5607('0x21')]);}_0x4ba05c[_0x5607('0x39')]=qs[_0x5607('0x3a')](_0x313058[_0x5607('0x30')][_0x5607('0x3a')]);_0x4ba05c[_0x5607('0x3b')]=qs['filters'](_[_0x5607('0x3c')](_0x313058[_0x5607('0x30')],_0x1416e6['filters']),_0x2adc0c);if(_0x313058['query'][_0x5607('0x3d')]){_0x4ba05c['where']=_[_0x5607('0x3e')](_0x4ba05c[_0x5607('0x3b')],{'$or':_[_0x5607('0x2d')](_0x2adc0c,function(_0x4250cb){if(_0x4250cb[_0x5607('0x3f')]!=='VIRTUAL'){var _0x39c3fb={};_0x39c3fb[_0x4250cb['name']]={'$like':'%'+_0x313058[_0x5607('0x30')]['filter']+'%'};return _0x39c3fb;}})});}_0x4ba05c=_[_0x5607('0x3e')]({},_0x4ba05c,_0x313058['options']);var _0x1f79d4={'where':_0x4ba05c[_0x5607('0x3b')]};return db[_0x5607('0x2e')][_0x5607('0x40')](_0x1f79d4)[_0x5607('0x28')](function(_0x3f831a){_0xd7235d[_0x5607('0x40')]=_0x3f831a;if(_0x313058['query']['includeAll']){_0x4ba05c['include']=[{'all':!![]}];}return db[_0x5607('0x2e')]['findAll'](_0x4ba05c);})[_0x5607('0x28')](function(_0x74885b){_0xd7235d[_0x5607('0x41')]=_0x74885b;return _0xd7235d;})['then'](respondWithFilteredResult(_0x5ece74,_0x4ba05c))['catch'](handleError(_0x5ece74,null));};exports[_0x5607('0x42')]=function(_0x9d97e0,_0xf9f9ce){var _0x54a943={'raw':!![],'where':{'id':_0x9d97e0[_0x5607('0x43')]['id']}},_0x267a06={};_0x267a06[_0x5607('0x33')]=_['keys'](db[_0x5607('0x2e')]['rawAttributes']);_0x267a06['query']=_[_0x5607('0x44')](_0x9d97e0[_0x5607('0x30')]);_0x267a06['filters']=_[_0x5607('0x32')](_0x267a06[_0x5607('0x33')],_0x267a06[_0x5607('0x30')]);_0x54a943[_0x5607('0x34')]=_[_0x5607('0x32')](_0x267a06[_0x5607('0x33')],qs[_0x5607('0x35')](_0x9d97e0['query'][_0x5607('0x35')]));_0x54a943[_0x5607('0x34')]=_0x54a943[_0x5607('0x34')][_0x5607('0x36')]?_0x54a943[_0x5607('0x34')]:_0x267a06[_0x5607('0x33')];if(_0x9d97e0['query'][_0x5607('0x45')]){_0x54a943[_0x5607('0x46')]=[{'all':!![]}];}_0x54a943=_[_0x5607('0x3e')]({},_0x54a943,_0x9d97e0[_0x5607('0x47')]);return db[_0x5607('0x2e')][_0x5607('0x48')](_0x54a943)[_0x5607('0x28')](handleEntityNotFound(_0xf9f9ce,null))['then'](respondWithResult(_0xf9f9ce,null))[_0x5607('0x49')](handleError(_0xf9f9ce,null));};exports[_0x5607('0x4a')]=function(_0x1ef399,_0x5249cf){return db[_0x5607('0x2e')][_0x5607('0x4a')](_0x1ef399['body'],{})[_0x5607('0x28')](respondWithResult(_0x5249cf,0xc9))[_0x5607('0x49')](handleError(_0x5249cf,null));};exports['update']=function(_0x1c4f7b,_0x5b5f10){if(_0x1c4f7b[_0x5607('0x4b')]['id']){delete _0x1c4f7b[_0x5607('0x4b')]['id'];}return db['AnalyticTreeReport'][_0x5607('0x48')]({'where':{'id':_0x1c4f7b[_0x5607('0x43')]['id']}})[_0x5607('0x28')](handleEntityNotFound(_0x5b5f10,null))[_0x5607('0x28')](saveUpdates(_0x1c4f7b[_0x5607('0x4b')],null))[_0x5607('0x28')](respondWithResult(_0x5b5f10,null))[_0x5607('0x49')](handleError(_0x5b5f10,null));};exports['destroy']=function(_0x21813b,_0xb73207){return db['AnalyticTreeReport'][_0x5607('0x48')]({'where':{'id':_0x21813b[_0x5607('0x43')]['id']}})[_0x5607('0x28')](handleEntityNotFound(_0xb73207,null))['then'](removeEntity(_0xb73207,null))[_0x5607('0x49')](handleError(_0xb73207,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 4376a67..6e005e7 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 _0x5817=['analytics_report_trees','lodash','util','../../config/logger','api','path','rimraf','./analyticTreeReport.attributes','define','AnalyticTreeReport'];(function(_0x59bed7,_0x235302){var _0x58c04a=function(_0xef3b65){while(--_0xef3b65){_0x59bed7['push'](_0x59bed7['shift']());}};_0x58c04a(++_0x235302);}(_0x5817,0xa1));var _0x7581=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x5817[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x7581('0x0'));var util=require(_0x7581('0x1'));var logger=require(_0x7581('0x2'))(_0x7581('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7581('0x4'));var rimraf=require(_0x7581('0x5'));var config=require('../../config/environment');var attributes=require(_0x7581('0x6'));module['exports']=function(_0x1685f6,_0xe2183e){return _0x1685f6[_0x7581('0x7')](_0x7581('0x8'),attributes,{'tableName':_0x7581('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x84d8=['rimraf','./analyticTreeReport.attributes','define','AnalyticTreeReport','analytics_report_trees','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x100053,_0x350561){var _0x207a0d=function(_0x3ff9f7){while(--_0x3ff9f7){_0x100053['push'](_0x100053['shift']());}};_0x207a0d(++_0x350561);}(_0x84d8,0x101));var _0x884d=function(_0x27b116,_0x5a995f){_0x27b116=_0x27b116-0x0;var _0x2d6d83=_0x84d8[_0x27b116];return _0x2d6d83;};'use strict';var _=require('lodash');var util=require(_0x884d('0x0'));var logger=require(_0x884d('0x1'))(_0x884d('0x2'));var moment=require(_0x884d('0x3'));var BPromise=require(_0x884d('0x4'));var rp=require(_0x884d('0x5'));var fs=require('fs');var path=require(_0x884d('0x6'));var rimraf=require(_0x884d('0x7'));var config=require('../../config/environment');var attributes=require(_0x884d('0x8'));module['exports']=function(_0x18ec6e,_0x582a7c){return _0x18ec6e[_0x884d('0x9')](_0x884d('0xa'),attributes,{'tableName':_0x884d('0xb'),'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 3e41362..cfa949c 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(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0x2971d5,_0x205974){_0x2971d5=_0x2971d5-0x0;var _0x31e59e=_0x7a54[_0x2971d5];return _0x31e59e;};'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 _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x5e8103,_0x43db45){var _0x31b966=function(_0x3ab9d4){while(--_0x3ab9d4){_0x5e8103['push'](_0x5e8103['shift']());}};_0x31b966(++_0x43db45);}(_0x1261,0x144));var _0x1126=function(_0x6acb69,_0xd36dbf){_0x6acb69=_0x6acb69-0x0;var _0x29a021=_0x1261[_0x6acb69];return _0x29a021;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index e88182a..9f2a5d2 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 _0xb450=['isAuthenticated','get','/:id','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service','./analyticTreeReport.controller'];(function(_0x26d10b,_0x1d909b){var _0xe9a76=function(_0x37bc2c){while(--_0x37bc2c){_0x26d10b['push'](_0x26d10b['shift']());}};_0xe9a76(++_0x1d909b);}(_0xb450,0xad));var _0x0b45=function(_0x589081,_0x54d794){_0x589081=_0x589081-0x0;var _0x4b7e8c=_0xb450[_0x589081];return _0x4b7e8c;};'use strict';var multer=require(_0x0b45('0x0'));var util=require(_0x0b45('0x1'));var path=require(_0x0b45('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0b45('0x3')]();var fs_extra=require(_0x0b45('0x4'));var auth=require(_0x0b45('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0b45('0x6'));router['get']('/',auth[_0x0b45('0x7')](),controller['index']);router[_0x0b45('0x8')](_0x0b45('0x9'),auth[_0x0b45('0x7')](),controller['show']);router['post']('/',auth[_0x0b45('0x7')](),controller['create']);router['put'](_0x0b45('0x9'),auth[_0x0b45('0x7')](),controller['update']);router[_0x0b45('0xa')](_0x0b45('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x0b45('0xb')]=router; \ No newline at end of file +var _0xa89b=['util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','post','create','update','delete','destroy','exports','multer'];(function(_0x28c6f1,_0x5b0cd9){var _0x45d430=function(_0x50edff){while(--_0x50edff){_0x28c6f1['push'](_0x28c6f1['shift']());}};_0x45d430(++_0x5b0cd9);}(_0xa89b,0x6b));var _0xba89=function(_0x4d9d1e,_0x3c2d20){_0x4d9d1e=_0x4d9d1e-0x0;var _0x1b9d54=_0xa89b[_0x4d9d1e];return _0x1b9d54;};'use strict';var multer=require(_0xba89('0x0'));var util=require(_0xba89('0x1'));var path=require(_0xba89('0x2'));var timeout=require(_0xba89('0x3'));var express=require('express');var router=express[_0xba89('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xba89('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xba89('0x6'));var controller=require(_0xba89('0x7'));router[_0xba89('0x8')]('/',auth[_0xba89('0x9')](),controller[_0xba89('0xa')]);router[_0xba89('0x8')](_0xba89('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xba89('0xc')]('/',auth[_0xba89('0x9')](),controller[_0xba89('0xd')]);router['put'](_0xba89('0xb'),auth[_0xba89('0x9')](),controller[_0xba89('0xe')]);router[_0xba89('0xf')](_0xba89('0xb'),auth[_0xba89('0x9')](),controller[_0xba89('0x10')]);module[_0xba89('0x11')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index e4e05db..866ce41 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 _0xc997=['exports','STRING'];(function(_0x298064,_0x1d2bfb){var _0x2512ea=function(_0x3e5b28){while(--_0x3e5b28){_0x298064['push'](_0x298064['shift']());}};_0x2512ea(++_0x1d2bfb);}(_0xc997,0x1ac));var _0x7c99=function(_0x537a03,_0x187e16){_0x537a03=_0x537a03-0x0;var _0x5f59df=_0xc997[_0x537a03];return _0x5f59df;};'use strict';var Sequelize=require('sequelize');module[_0x7c99('0x0')]={'name':{'type':Sequelize[_0x7c99('0x1')]},'basename':{'type':Sequelize[_0x7c99('0x1')]},'type':{'type':Sequelize[_0x7c99('0x1')]}}; \ No newline at end of file +var _0x6f7f=['STRING','exports'];(function(_0xd6640b,_0x475e47){var _0x4c843e=function(_0x11040f){while(--_0x11040f){_0xd6640b['push'](_0xd6640b['shift']());}};_0x4c843e(++_0x475e47);}(_0x6f7f,0x177));var _0xf6f7=function(_0x4e9993,_0xeb2400){_0x4e9993=_0x4e9993-0x0;var _0x5d96ce=_0x6f7f[_0x4e9993];return _0x5d96ce;};'use strict';var Sequelize=require('sequelize');module[_0xf6f7('0x0')]={'name':{'type':Sequelize[_0xf6f7('0x1')]},'basename':{'type':Sequelize[_0xf6f7('0x1')]},'type':{'type':Sequelize[_0xf6f7('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 6842e0c..9a0524d 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 _0xd56e=['Attachment','rawAttributes','type','key','model','name','query','keys','filters','attributes','fields','length','sort','where','merge','VIRTUAL','filter','options','includeAll','rows','catch','show','params','intersection','include','find','get','omit','updatedAt','body','createdAt','destroy','create','file','originalname','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','ejs','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','end','status','offset','undefined','count','limit','Content-Range','json','reject','save','update','then','error','map'];(function(_0xbb1fa0,_0xff58e8){var _0xe383a3=function(_0x429459){while(--_0x429459){_0xbb1fa0['push'](_0xbb1fa0['shift']());}};_0xe383a3(++_0xff58e8);}(_0xd56e,0x11c));var _0xed56=function(_0x3e48d3,_0x2a2931){_0x3e48d3=_0x3e48d3-0x0;var _0x220927=_0xd56e[_0x3e48d3];return _0x220927;};'use strict';var emlformat=require(_0xed56('0x0'));var rimraf=require(_0xed56('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xed56('0x2'));var rp=require(_0xed56('0x3'));var moment=require(_0xed56('0x4'));var BPromise=require(_0xed56('0x5'));var Mustache=require('mustache');var util=require(_0xed56('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xed56('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xed56('0x8'));var squel=require(_0xed56('0x9'));var crypto=require(_0xed56('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xed56('0xb'));var toCsv=require(_0xed56('0xc'));var querystring=require('querystring');var Papa=require(_0xed56('0xd'));var Redis=require(_0xed56('0xe'));var authService=require(_0xed56('0xf'));var qs=require(_0xed56('0x10'));var as=require(_0xed56('0x11'));var hardwareService=require(_0xed56('0x12'));var logger=require('../../config/logger')(_0xed56('0x13'));var utils=require(_0xed56('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xed56('0x15'))['db'];function respondWithStatusCode(_0x6f119d,_0x2c6fdc){_0x2c6fdc=_0x2c6fdc||0xcc;return function(_0x151f72){if(_0x151f72){return _0x6f119d['sendStatus'](_0x2c6fdc);}return _0x6f119d['status'](_0x2c6fdc)[_0xed56('0x16')]();};}function respondWithResult(_0x8d0ee6,_0x4f7eae){_0x4f7eae=_0x4f7eae||0xc8;return function(_0x70bf8f){if(_0x70bf8f){return _0x8d0ee6[_0xed56('0x17')](_0x4f7eae)['json'](_0x70bf8f);}};}function respondWithFilteredResult(_0x2202c9,_0x6fb655){return function(_0x13102b){if(_0x13102b){var _0x50df94=typeof _0x6fb655[_0xed56('0x18')]===_0xed56('0x19')&&typeof _0x6fb655['limit']===_0xed56('0x19');var _0x2ee147=_0x13102b[_0xed56('0x1a')];var _0xe416f9=_0x50df94?0x0:_0x6fb655[_0xed56('0x18')];var _0x31edca=_0x50df94?_0x13102b['count']:_0x6fb655[_0xed56('0x18')]+_0x6fb655[_0xed56('0x1b')];var _0x3f1f74;if(_0x31edca>=_0x2ee147){_0x31edca=_0x2ee147;_0x3f1f74=0xc8;}else{_0x3f1f74=0xce;}_0x2202c9[_0xed56('0x17')](_0x3f1f74);return _0x2202c9['set'](_0xed56('0x1c'),_0xe416f9+'-'+_0x31edca+'/'+_0x2ee147)[_0xed56('0x1d')](_0x13102b);}return null;};}function patchUpdates(_0x138651){return function(_0x4390a9){try{jsonpatch['apply'](_0x4390a9,_0x138651,!![]);}catch(_0x4af5b5){return BPromise[_0xed56('0x1e')](_0x4af5b5);}return _0x4390a9[_0xed56('0x1f')]();};}function saveUpdates(_0x2c800c,_0x502cf2){return function(_0x17f810){if(_0x17f810){return _0x17f810[_0xed56('0x20')](_0x2c800c)['then'](function(_0x86c1f0){return _0x86c1f0;});}return null;};}function removeEntity(_0x25970b,_0x2d2057){return function(_0x298ceb){if(_0x298ceb){return _0x298ceb['destroy']()[_0xed56('0x21')](function(){_0x25970b[_0xed56('0x17')](0xcc)[_0xed56('0x16')]();});}};}function handleEntityNotFound(_0x49bb83,_0x2cef7e){return function(_0x5924fc){if(!_0x5924fc){_0x49bb83['sendStatus'](0x194);}return _0x5924fc;};}function handleError(_0x4ee943,_0x106384){_0x106384=_0x106384||0x1f4;return function(_0x3652fc){logger[_0xed56('0x22')](_0x3652fc['stack']);if(_0x3652fc['name']){delete _0x3652fc['name'];}_0x4ee943[_0xed56('0x17')](_0x106384)['send'](_0x3652fc);};}exports['index']=function(_0x5df5c3,_0x3a6a90){var _0x457f5b={},_0x5b0665={},_0x239033={'count':0x0,'rows':[]};var _0x12dff9=_[_0xed56('0x23')](db[_0xed56('0x24')][_0xed56('0x25')],function(_0x2fafc5){return{'name':_0x2fafc5['fieldName'],'type':_0x2fafc5[_0xed56('0x26')][_0xed56('0x27')]};});_0x5b0665[_0xed56('0x28')]=_[_0xed56('0x23')](_0x12dff9,_0xed56('0x29'));_0x5b0665[_0xed56('0x2a')]=_[_0xed56('0x2b')](_0x5df5c3['query']);_0x5b0665[_0xed56('0x2c')]=_['intersection'](_0x5b0665['model'],_0x5b0665[_0xed56('0x2a')]);_0x457f5b[_0xed56('0x2d')]=_['intersection'](_0x5b0665[_0xed56('0x28')],qs['fields'](_0x5df5c3[_0xed56('0x2a')][_0xed56('0x2e')]));_0x457f5b[_0xed56('0x2d')]=_0x457f5b[_0xed56('0x2d')][_0xed56('0x2f')]?_0x457f5b[_0xed56('0x2d')]:_0x5b0665['model'];if(!_0x5df5c3[_0xed56('0x2a')]['hasOwnProperty']('nolimit')){_0x457f5b[_0xed56('0x1b')]=qs[_0xed56('0x1b')](_0x5df5c3[_0xed56('0x2a')][_0xed56('0x1b')]);_0x457f5b['offset']=qs[_0xed56('0x18')](_0x5df5c3[_0xed56('0x2a')][_0xed56('0x18')]);}_0x457f5b['order']=qs[_0xed56('0x30')](_0x5df5c3['query'][_0xed56('0x30')]);_0x457f5b[_0xed56('0x31')]=qs['filters'](_['pick'](_0x5df5c3[_0xed56('0x2a')],_0x5b0665[_0xed56('0x2c')]),_0x12dff9);if(_0x5df5c3['query']['filter']){_0x457f5b[_0xed56('0x31')]=_[_0xed56('0x32')](_0x457f5b['where'],{'$or':_[_0xed56('0x23')](_0x12dff9,function(_0x23201a){if(_0x23201a[_0xed56('0x26')]!==_0xed56('0x33')){var _0x332e4a={};_0x332e4a[_0x23201a[_0xed56('0x29')]]={'$like':'%'+_0x5df5c3[_0xed56('0x2a')][_0xed56('0x34')]+'%'};return _0x332e4a;}})});}_0x457f5b=_['merge']({},_0x457f5b,_0x5df5c3[_0xed56('0x35')]);var _0x143756={'where':_0x457f5b[_0xed56('0x31')]};return db[_0xed56('0x24')][_0xed56('0x1a')](_0x143756)[_0xed56('0x21')](function(_0x43805d){_0x239033[_0xed56('0x1a')]=_0x43805d;if(_0x5df5c3[_0xed56('0x2a')][_0xed56('0x36')]){_0x457f5b['include']=[{'all':!![]}];}return db[_0xed56('0x24')]['findAll'](_0x457f5b);})[_0xed56('0x21')](function(_0x25a568){_0x239033[_0xed56('0x37')]=_0x25a568;return _0x239033;})[_0xed56('0x21')](respondWithFilteredResult(_0x3a6a90,_0x457f5b))[_0xed56('0x38')](handleError(_0x3a6a90,null));};exports[_0xed56('0x39')]=function(_0x3fdd08,_0x4acb75){var _0x3c1788={'raw':!![],'where':{'id':_0x3fdd08[_0xed56('0x3a')]['id']}},_0x17b3df={};_0x17b3df[_0xed56('0x28')]=_[_0xed56('0x2b')](db[_0xed56('0x24')][_0xed56('0x25')]);_0x17b3df[_0xed56('0x2a')]=_['keys'](_0x3fdd08['query']);_0x17b3df[_0xed56('0x2c')]=_[_0xed56('0x3b')](_0x17b3df[_0xed56('0x28')],_0x17b3df[_0xed56('0x2a')]);_0x3c1788[_0xed56('0x2d')]=_[_0xed56('0x3b')](_0x17b3df[_0xed56('0x28')],qs[_0xed56('0x2e')](_0x3fdd08[_0xed56('0x2a')]['fields']));_0x3c1788[_0xed56('0x2d')]=_0x3c1788['attributes']['length']?_0x3c1788[_0xed56('0x2d')]:_0x17b3df[_0xed56('0x28')];if(_0x3fdd08[_0xed56('0x2a')][_0xed56('0x36')]){_0x3c1788[_0xed56('0x3c')]=[{'all':!![]}];}_0x3c1788=_[_0xed56('0x32')]({},_0x3c1788,_0x3fdd08[_0xed56('0x35')]);return db['Attachment'][_0xed56('0x3d')](_0x3c1788)[_0xed56('0x21')](handleEntityNotFound(_0x4acb75,null))[_0xed56('0x21')](respondWithResult(_0x4acb75,null))[_0xed56('0x38')](handleError(_0x4acb75,null));};exports['clone']=function(_0x57a0da,_0x331a71){var _0x46e8ff={'where':{'id':_0x57a0da[_0xed56('0x3a')]['id']}},_0x580c73={};_0x580c73[_0xed56('0x28')]=_[_0xed56('0x2b')](db['Attachment'][_0xed56('0x25')]);_0x46e8ff['attributes']=_[_0xed56('0x3b')](_0x580c73['model'],qs[_0xed56('0x2e')](_0x57a0da[_0xed56('0x2a')][_0xed56('0x2e')]));_0x46e8ff[_0xed56('0x2d')]=_0x46e8ff['attributes'][_0xed56('0x2f')]?_0x46e8ff[_0xed56('0x2d')]:_0x580c73[_0xed56('0x28')];if(_0x57a0da['query'][_0xed56('0x36')]){_0x46e8ff[_0xed56('0x3c')]=[{'all':!![]}];}_0x46e8ff=_[_0xed56('0x32')]({},_0x46e8ff,_0x57a0da[_0xed56('0x35')]);return db['Attachment'][_0xed56('0x3d')](_0x46e8ff)[_0xed56('0x21')](handleEntityNotFound(_0x331a71,null))[_0xed56('0x21')](function(_0x250719){if(_0x250719){var _0x2bc884=_0x250719[_0xed56('0x3e')]({'plain':!![]});_0x2bc884=qs[_0xed56('0x3f')](_0x2bc884,['id','createdAt',_0xed56('0x40')]);_0x57a0da['body']=_[_0xed56('0x3f')](_0x57a0da[_0xed56('0x41')],['id',_0xed56('0x42'),_0xed56('0x40')]);return db[_0xed56('0x24')]['create'](_[_0xed56('0x32')](_0x2bc884,_0x57a0da[_0xed56('0x41')]),{'include':_0x57a0da[_0xed56('0x2a')][_0xed56('0x36')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x331a71,0xc9))['catch'](handleError(_0x331a71,null));};exports['update']=function(_0x5947ab,_0x5db2b1){if(_0x5947ab[_0xed56('0x41')]['id']){delete _0x5947ab[_0xed56('0x41')]['id'];}return db['Attachment'][_0xed56('0x3d')]({'where':{'id':_0x5947ab[_0xed56('0x3a')]['id']}})[_0xed56('0x21')](handleEntityNotFound(_0x5db2b1,null))[_0xed56('0x21')](saveUpdates(_0x5947ab['body'],null))['then'](respondWithResult(_0x5db2b1,null))[_0xed56('0x38')](handleError(_0x5db2b1,null));};exports[_0xed56('0x43')]=function(_0x11b3b5,_0x190e87){return db[_0xed56('0x24')][_0xed56('0x3d')]({'where':{'id':_0x11b3b5[_0xed56('0x3a')]['id']}})[_0xed56('0x21')](handleEntityNotFound(_0x190e87,null))[_0xed56('0x21')](removeEntity(_0x190e87,null))[_0xed56('0x38')](handleError(_0x190e87,null));};exports[_0xed56('0x44')]=function(_0xe3cc80,_0x293407,_0x13b9e9){_0xe3cc80['body'][_0xed56('0x29')]=_0xe3cc80[_0xed56('0x45')][_0xed56('0x46')];_0xe3cc80[_0xed56('0x41')]['basename']=_0xe3cc80[_0xed56('0x45')][_0xed56('0x47')];_0xe3cc80[_0xed56('0x41')][_0xed56('0x26')]=_0xe3cc80[_0xed56('0x45')][_0xed56('0x48')];return db[_0xed56('0x24')][_0xed56('0x44')](_0xe3cc80[_0xed56('0x41')])[_0xed56('0x21')](respondWithResult(_0x293407,0xc9))[_0xed56('0x38')](handleError(_0x293407,null));};exports[_0xed56('0x49')]=function(_0x59a193,_0x1b9945,_0x37c6d7){return db[_0xed56('0x24')][_0xed56('0x4a')]({'where':{'id':_0x59a193[_0xed56('0x3a')]['id']},'raw':!![]})[_0xed56('0x21')](handleEntityNotFound(_0x1b9945,null))[_0xed56('0x21')](function(_0x3e944c){if(_0x3e944c){var _0x281970=_0x3e944c[_0xed56('0x4b')]!==null;var _0x4bfcc8=path[_0xed56('0x4c')](config[_0xed56('0x4d')],_0xed56('0x4e'));if(_0x281970){_0x4bfcc8=path[_0xed56('0x4c')](_0x4bfcc8,_0xed56('0x4f'));}var _0x495d91=path[_0xed56('0x4c')](_0x4bfcc8,_0x3e944c['basename']);return _0x1b9945['download'](_0x495d91);}})[_0xed56('0x38')](handleError(_0x1b9945,null));}; \ No newline at end of file +var _0xef2b=['includeAll','include','Attachment','findAll','rows','catch','show','params','find','clone','get','omit','createdAt','updatedAt','body','create','originalname','basename','file','filename','mimetype','join','root','server/files/attachments/','offline-chat/','download','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','merge','type','VIRTUAL','filter','options'];(function(_0x532e8b,_0x133d9c){var _0x5999e2=function(_0x35aa9){while(--_0x35aa9){_0x532e8b['push'](_0x532e8b['shift']());}};_0x5999e2(++_0x133d9c);}(_0xef2b,0x172));var _0xbef2=function(_0x365efa,_0x1c6f57){_0x365efa=_0x365efa-0x0;var _0x57e85a=_0xef2b[_0x365efa];return _0x57e85a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbef2('0x0'));var zipdir=require(_0xbef2('0x1'));var jsonpatch=require(_0xbef2('0x2'));var rp=require(_0xbef2('0x3'));var moment=require(_0xbef2('0x4'));var BPromise=require(_0xbef2('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xbef2('0x6'));var csv=require(_0xbef2('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbef2('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xbef2('0x9'));var jsforce=require(_0xbef2('0xa'));var deskjs=require(_0xbef2('0xb'));var toCsv=require(_0xbef2('0x7'));var querystring=require(_0xbef2('0xc'));var Papa=require(_0xbef2('0xd'));var Redis=require(_0xbef2('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xbef2('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbef2('0x10'));var logger=require(_0xbef2('0x11'))(_0xbef2('0x12'));var utils=require(_0xbef2('0x13'));var config=require(_0xbef2('0x14'));var licenseUtil=require(_0xbef2('0x15'));var db=require(_0xbef2('0x16'))['db'];function respondWithStatusCode(_0x2aba93,_0x53dc2e){_0x53dc2e=_0x53dc2e||0xcc;return function(_0x55f791){if(_0x55f791){return _0x2aba93[_0xbef2('0x17')](_0x53dc2e);}return _0x2aba93[_0xbef2('0x18')](_0x53dc2e)['end']();};}function respondWithResult(_0x141288,_0x452ef9){_0x452ef9=_0x452ef9||0xc8;return function(_0x2a2757){if(_0x2a2757){return _0x141288[_0xbef2('0x18')](_0x452ef9)[_0xbef2('0x19')](_0x2a2757);}};}function respondWithFilteredResult(_0xf92b3b,_0x4902d8){return function(_0x49486c){if(_0x49486c){var _0x48a373=typeof _0x4902d8['offset']===_0xbef2('0x1a')&&typeof _0x4902d8[_0xbef2('0x1b')]===_0xbef2('0x1a');var _0x516348=_0x49486c[_0xbef2('0x1c')];var _0x4c796d=_0x48a373?0x0:_0x4902d8[_0xbef2('0x1d')];var _0x287823=_0x48a373?_0x49486c[_0xbef2('0x1c')]:_0x4902d8[_0xbef2('0x1d')]+_0x4902d8[_0xbef2('0x1b')];var _0x284bad;if(_0x287823>=_0x516348){_0x287823=_0x516348;_0x284bad=0xc8;}else{_0x284bad=0xce;}_0xf92b3b[_0xbef2('0x18')](_0x284bad);return _0xf92b3b[_0xbef2('0x1e')](_0xbef2('0x1f'),_0x4c796d+'-'+_0x287823+'/'+_0x516348)[_0xbef2('0x19')](_0x49486c);}return null;};}function patchUpdates(_0x4f55c0){return function(_0x23de40){try{jsonpatch[_0xbef2('0x20')](_0x23de40,_0x4f55c0,!![]);}catch(_0x58e269){return BPromise[_0xbef2('0x21')](_0x58e269);}return _0x23de40[_0xbef2('0x22')]();};}function saveUpdates(_0x85b23a,_0x552c42){return function(_0x38e5ee){if(_0x38e5ee){return _0x38e5ee[_0xbef2('0x23')](_0x85b23a)[_0xbef2('0x24')](function(_0x1e2090){return _0x1e2090;});}return null;};}function removeEntity(_0x154fbf,_0x3f8d24){return function(_0x5e3c74){if(_0x5e3c74){return _0x5e3c74[_0xbef2('0x25')]()[_0xbef2('0x24')](function(){_0x154fbf[_0xbef2('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13fb45,_0x1232ab){return function(_0x4193d1){if(!_0x4193d1){_0x13fb45[_0xbef2('0x17')](0x194);}return _0x4193d1;};}function handleError(_0x350948,_0x202c42){_0x202c42=_0x202c42||0x1f4;return function(_0x50729b){logger[_0xbef2('0x26')](_0x50729b[_0xbef2('0x27')]);if(_0x50729b[_0xbef2('0x28')]){delete _0x50729b[_0xbef2('0x28')];}_0x350948[_0xbef2('0x18')](_0x202c42)['send'](_0x50729b);};}exports[_0xbef2('0x29')]=function(_0x67a239,_0x219b0b){var _0x1c6753={},_0xb4620f={},_0x2f77dc={'count':0x0,'rows':[]};var _0x3f14f2=_[_0xbef2('0x2a')](db['Attachment'][_0xbef2('0x2b')],function(_0xa51029){return{'name':_0xa51029['fieldName'],'type':_0xa51029['type']['key']};});_0xb4620f[_0xbef2('0x2c')]=_[_0xbef2('0x2a')](_0x3f14f2,_0xbef2('0x28'));_0xb4620f[_0xbef2('0x2d')]=_[_0xbef2('0x2e')](_0x67a239[_0xbef2('0x2d')]);_0xb4620f[_0xbef2('0x2f')]=_[_0xbef2('0x30')](_0xb4620f[_0xbef2('0x2c')],_0xb4620f['query']);_0x1c6753['attributes']=_[_0xbef2('0x30')](_0xb4620f[_0xbef2('0x2c')],qs[_0xbef2('0x31')](_0x67a239[_0xbef2('0x2d')][_0xbef2('0x31')]));_0x1c6753['attributes']=_0x1c6753[_0xbef2('0x32')][_0xbef2('0x33')]?_0x1c6753[_0xbef2('0x32')]:_0xb4620f[_0xbef2('0x2c')];if(!_0x67a239[_0xbef2('0x2d')][_0xbef2('0x34')]('nolimit')){_0x1c6753[_0xbef2('0x1b')]=qs[_0xbef2('0x1b')](_0x67a239[_0xbef2('0x2d')][_0xbef2('0x1b')]);_0x1c6753['offset']=qs['offset'](_0x67a239[_0xbef2('0x2d')][_0xbef2('0x1d')]);}_0x1c6753['order']=qs['sort'](_0x67a239[_0xbef2('0x2d')][_0xbef2('0x35')]);_0x1c6753[_0xbef2('0x36')]=qs[_0xbef2('0x2f')](_['pick'](_0x67a239[_0xbef2('0x2d')],_0xb4620f['filters']),_0x3f14f2);if(_0x67a239[_0xbef2('0x2d')]['filter']){_0x1c6753[_0xbef2('0x36')]=_[_0xbef2('0x37')](_0x1c6753[_0xbef2('0x36')],{'$or':_[_0xbef2('0x2a')](_0x3f14f2,function(_0xdccc6){if(_0xdccc6[_0xbef2('0x38')]!==_0xbef2('0x39')){var _0x5785cd={};_0x5785cd[_0xdccc6['name']]={'$like':'%'+_0x67a239[_0xbef2('0x2d')][_0xbef2('0x3a')]+'%'};return _0x5785cd;}})});}_0x1c6753=_[_0xbef2('0x37')]({},_0x1c6753,_0x67a239[_0xbef2('0x3b')]);var _0x452339={'where':_0x1c6753[_0xbef2('0x36')]};return db['Attachment'][_0xbef2('0x1c')](_0x452339)[_0xbef2('0x24')](function(_0x267b86){_0x2f77dc[_0xbef2('0x1c')]=_0x267b86;if(_0x67a239['query'][_0xbef2('0x3c')]){_0x1c6753[_0xbef2('0x3d')]=[{'all':!![]}];}return db[_0xbef2('0x3e')][_0xbef2('0x3f')](_0x1c6753);})[_0xbef2('0x24')](function(_0x5b70ca){_0x2f77dc[_0xbef2('0x40')]=_0x5b70ca;return _0x2f77dc;})[_0xbef2('0x24')](respondWithFilteredResult(_0x219b0b,_0x1c6753))[_0xbef2('0x41')](handleError(_0x219b0b,null));};exports[_0xbef2('0x42')]=function(_0x2ff648,_0x368a41){var _0x5c26fa={'raw':!![],'where':{'id':_0x2ff648[_0xbef2('0x43')]['id']}},_0xa67aed={};_0xa67aed[_0xbef2('0x2c')]=_['keys'](db[_0xbef2('0x3e')][_0xbef2('0x2b')]);_0xa67aed['query']=_[_0xbef2('0x2e')](_0x2ff648[_0xbef2('0x2d')]);_0xa67aed['filters']=_[_0xbef2('0x30')](_0xa67aed[_0xbef2('0x2c')],_0xa67aed[_0xbef2('0x2d')]);_0x5c26fa[_0xbef2('0x32')]=_['intersection'](_0xa67aed[_0xbef2('0x2c')],qs[_0xbef2('0x31')](_0x2ff648[_0xbef2('0x2d')][_0xbef2('0x31')]));_0x5c26fa[_0xbef2('0x32')]=_0x5c26fa[_0xbef2('0x32')][_0xbef2('0x33')]?_0x5c26fa[_0xbef2('0x32')]:_0xa67aed['model'];if(_0x2ff648[_0xbef2('0x2d')]['includeAll']){_0x5c26fa[_0xbef2('0x3d')]=[{'all':!![]}];}_0x5c26fa=_[_0xbef2('0x37')]({},_0x5c26fa,_0x2ff648[_0xbef2('0x3b')]);return db[_0xbef2('0x3e')][_0xbef2('0x44')](_0x5c26fa)['then'](handleEntityNotFound(_0x368a41,null))[_0xbef2('0x24')](respondWithResult(_0x368a41,null))[_0xbef2('0x41')](handleError(_0x368a41,null));};exports[_0xbef2('0x45')]=function(_0x538b7c,_0x3505ec){var _0xc48daf={'where':{'id':_0x538b7c['params']['id']}},_0x55dfe3={};_0x55dfe3[_0xbef2('0x2c')]=_['keys'](db[_0xbef2('0x3e')][_0xbef2('0x2b')]);_0xc48daf[_0xbef2('0x32')]=_[_0xbef2('0x30')](_0x55dfe3[_0xbef2('0x2c')],qs[_0xbef2('0x31')](_0x538b7c[_0xbef2('0x2d')][_0xbef2('0x31')]));_0xc48daf['attributes']=_0xc48daf[_0xbef2('0x32')]['length']?_0xc48daf[_0xbef2('0x32')]:_0x55dfe3['model'];if(_0x538b7c[_0xbef2('0x2d')][_0xbef2('0x3c')]){_0xc48daf[_0xbef2('0x3d')]=[{'all':!![]}];}_0xc48daf=_[_0xbef2('0x37')]({},_0xc48daf,_0x538b7c[_0xbef2('0x3b')]);return db[_0xbef2('0x3e')]['find'](_0xc48daf)[_0xbef2('0x24')](handleEntityNotFound(_0x3505ec,null))[_0xbef2('0x24')](function(_0x93143a){if(_0x93143a){var _0x137528=_0x93143a[_0xbef2('0x46')]({'plain':!![]});_0x137528=qs[_0xbef2('0x47')](_0x137528,['id',_0xbef2('0x48'),_0xbef2('0x49')]);_0x538b7c[_0xbef2('0x4a')]=_[_0xbef2('0x47')](_0x538b7c[_0xbef2('0x4a')],['id',_0xbef2('0x48'),_0xbef2('0x49')]);return db[_0xbef2('0x3e')][_0xbef2('0x4b')](_[_0xbef2('0x37')](_0x137528,_0x538b7c[_0xbef2('0x4a')]),{'include':_0x538b7c[_0xbef2('0x2d')][_0xbef2('0x3c')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x3505ec,0xc9))[_0xbef2('0x41')](handleError(_0x3505ec,null));};exports[_0xbef2('0x23')]=function(_0x1a874d,_0x2bd018){if(_0x1a874d[_0xbef2('0x4a')]['id']){delete _0x1a874d[_0xbef2('0x4a')]['id'];}return db[_0xbef2('0x3e')][_0xbef2('0x44')]({'where':{'id':_0x1a874d[_0xbef2('0x43')]['id']}})[_0xbef2('0x24')](handleEntityNotFound(_0x2bd018,null))[_0xbef2('0x24')](saveUpdates(_0x1a874d[_0xbef2('0x4a')],null))[_0xbef2('0x24')](respondWithResult(_0x2bd018,null))[_0xbef2('0x41')](handleError(_0x2bd018,null));};exports['destroy']=function(_0xdbe9fa,_0xcc0232){return db['Attachment'][_0xbef2('0x44')]({'where':{'id':_0xdbe9fa['params']['id']}})[_0xbef2('0x24')](handleEntityNotFound(_0xcc0232,null))['then'](removeEntity(_0xcc0232,null))['catch'](handleError(_0xcc0232,null));};exports[_0xbef2('0x4b')]=function(_0x14d2ee,_0x5d2ae3,_0x3ccc6b){_0x14d2ee[_0xbef2('0x4a')][_0xbef2('0x28')]=_0x14d2ee['file'][_0xbef2('0x4c')];_0x14d2ee['body'][_0xbef2('0x4d')]=_0x14d2ee[_0xbef2('0x4e')][_0xbef2('0x4f')];_0x14d2ee[_0xbef2('0x4a')][_0xbef2('0x38')]=_0x14d2ee[_0xbef2('0x4e')][_0xbef2('0x50')];return db[_0xbef2('0x3e')][_0xbef2('0x4b')](_0x14d2ee['body'])['then'](respondWithResult(_0x5d2ae3,0xc9))[_0xbef2('0x41')](handleError(_0x5d2ae3,null));};exports['download']=function(_0x18630b,_0x3f7675,_0x3ebe8b){return db[_0xbef2('0x3e')]['findOne']({'where':{'id':_0x18630b[_0xbef2('0x43')]['id']},'raw':!![]})[_0xbef2('0x24')](handleEntityNotFound(_0x3f7675,null))[_0xbef2('0x24')](function(_0x37e092){if(_0x37e092){var _0x4fe047=_0x37e092['ChatOfflineMessageId']!==null;var _0x3cd44e=path[_0xbef2('0x51')](config[_0xbef2('0x52')],_0xbef2('0x53'));if(_0x4fe047){_0x3cd44e=path[_0xbef2('0x51')](_0x3cd44e,_0xbef2('0x54'));}var _0x49aaf5=path[_0xbef2('0x51')](_0x3cd44e,_0x37e092[_0xbef2('0x4d')]);return _0x3f7675[_0xbef2('0x55')](_0x49aaf5);}})[_0xbef2('0x41')](handleError(_0x3f7675,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index d773852..0e3e7de 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 _0x6ff0=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments'];(function(_0x27cfaf,_0x125bff){var _0x38490f=function(_0x334cf0){while(--_0x334cf0){_0x27cfaf['push'](_0x27cfaf['shift']());}};_0x38490f(++_0x125bff);}(_0x6ff0,0x16c));var _0x06ff=function(_0x2308d7,_0xb501ad){_0x2308d7=_0x2308d7-0x0;var _0x480907=_0x6ff0[_0x2308d7];return _0x480907;};'use strict';var _=require(_0x06ff('0x0'));var util=require(_0x06ff('0x1'));var logger=require('../../config/logger')(_0x06ff('0x2'));var moment=require(_0x06ff('0x3'));var BPromise=require(_0x06ff('0x4'));var rp=require(_0x06ff('0x5'));var fs=require('fs');var path=require(_0x06ff('0x6'));var rimraf=require(_0x06ff('0x7'));var config=require(_0x06ff('0x8'));var attributes=require(_0x06ff('0x9'));module[_0x06ff('0xa')]=function(_0x1f1fa0,_0x79af3c){return _0x1f1fa0[_0x06ff('0xb')](_0x06ff('0xc'),attributes,{'tableName':_0x06ff('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x59e9=['attachments','lodash','api','moment','path','rimraf','../../config/environment','exports','Attachment'];(function(_0x2055a7,_0x415a4c){var _0x42a14d=function(_0x83139b){while(--_0x83139b){_0x2055a7['push'](_0x2055a7['shift']());}};_0x42a14d(++_0x415a4c);}(_0x59e9,0xb5));var _0x959e=function(_0x4a22f7,_0x2f1324){_0x4a22f7=_0x4a22f7-0x0;var _0xba429=_0x59e9[_0x4a22f7];return _0xba429;};'use strict';var _=require(_0x959e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x959e('0x1'));var moment=require(_0x959e('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x959e('0x3'));var rimraf=require(_0x959e('0x4'));var config=require(_0x959e('0x5'));var attributes=require('./attachment.attributes');module[_0x959e('0x6')]=function(_0x1a56e2,_0x5308a1){return _0x1a56e2['define'](_0x959e('0x7'),attributes,{'tableName':_0x959e('0x8'),'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 ccc70dc..cd3c7f5 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 _0xa588=['debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateAttachment','create','body','options','raw'];(function(_0x57db49,_0x288094){var _0xd0636f=function(_0x227787){while(--_0x227787){_0x57db49['push'](_0x57db49['shift']());}};_0xd0636f(++_0x288094);}(_0xa588,0xe1));var _0x8a58=function(_0x47397f,_0x45ba05){_0x47397f=_0x47397f-0x0;var _0xba5ff1=_0xa588[_0x47397f];return _0xba5ff1;};'use strict';var _=require('lodash');var util=require(_0x8a58('0x0'));var moment=require(_0x8a58('0x1'));var BPromise=require(_0x8a58('0x2'));var rs=require(_0x8a58('0x3'));var fs=require('fs');var Redis=require(_0x8a58('0x4'));var db=require(_0x8a58('0x5'))['db'];var utils=require(_0x8a58('0x6'));var logger=require(_0x8a58('0x7'))(_0x8a58('0x8'));var config=require('../../config/environment');var jayson=require(_0x8a58('0x9'));var client=jayson[_0x8a58('0xa')][_0x8a58('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x35d5ad,_0xe0af18,_0x140f99){return new BPromise(function(_0x77b421,_0x585376){return client['request'](_0x35d5ad,_0x140f99)[_0x8a58('0xc')](function(_0x39a20e){logger[_0x8a58('0xd')](_0x8a58('0xe'),_0xe0af18,_0x8a58('0xf'));logger['debug'](_0x8a58('0x10'),_0xe0af18,_0x8a58('0xf'),JSON[_0x8a58('0x11')](_0x39a20e));if(_0x39a20e[_0x8a58('0x12')]){if(_0x39a20e['error']['code']===0x1f4){logger[_0x8a58('0x12')]('Attachment,\x20%s,\x20%s',_0xe0af18,_0x39a20e[_0x8a58('0x12')][_0x8a58('0x13')]);return _0x585376(_0x39a20e['error'][_0x8a58('0x13')]);}logger[_0x8a58('0x12')]('Attachment,\x20%s,\x20%s',_0xe0af18,_0x39a20e[_0x8a58('0x12')][_0x8a58('0x13')]);return _0x77b421(_0x39a20e['error'][_0x8a58('0x13')]);}else{logger[_0x8a58('0xd')](_0x8a58('0xe'),_0xe0af18,_0x8a58('0xf'));_0x77b421(_0x39a20e[_0x8a58('0x14')][_0x8a58('0x13')]);}})[_0x8a58('0x15')](function(_0x49ee0e){logger['error'](_0x8a58('0xe'),_0xe0af18,_0x49ee0e);_0x585376(_0x49ee0e);});});}exports[_0x8a58('0x16')]=function(_0x18a14d){var _0x4b5012=this;return new Promise(function(_0x282f2d,_0xe73eb9){return db['Attachment'][_0x8a58('0x17')](_0x18a14d[_0x8a58('0x18')],{'raw':_0x18a14d[_0x8a58('0x19')]?_0x18a14d[_0x8a58('0x19')][_0x8a58('0x1a')]===undefined?!![]:![]:!![]})[_0x8a58('0xc')](function(_0x284bb8){logger[_0x8a58('0xd')](_0x8a58('0x16'),_0x18a14d);logger[_0x8a58('0x1b')](_0x8a58('0x16'),_0x18a14d,JSON[_0x8a58('0x11')](_0x284bb8));_0x282f2d(_0x284bb8);})[_0x8a58('0x15')](function(_0x34adb8){logger['error'](_0x8a58('0x16'),_0x34adb8[_0x8a58('0x13')],_0x18a14d);_0xe73eb9(_0x4b5012[_0x8a58('0x12')](0x1f4,_0x34adb8[_0x8a58('0x13')]));});});}; \ No newline at end of file +var _0x19ea=['CreateAttachment','create','options','raw','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x49fbd0,_0x58d2f5){var _0x45bfb4=function(_0x500c93){while(--_0x500c93){_0x49fbd0['push'](_0x49fbd0['shift']());}};_0x45bfb4(++_0x58d2f5);}(_0x19ea,0xfe));var _0xa19e=function(_0x386c3e,_0x44a375){_0x386c3e=_0x386c3e-0x0;var _0x4b8e13=_0x19ea[_0x386c3e];return _0x4b8e13;};'use strict';var _=require(_0xa19e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa19e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa19e('0x2'));var db=require(_0xa19e('0x3'))['db'];var utils=require(_0xa19e('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xa19e('0x5'));var jayson=require(_0xa19e('0x6'));var client=jayson[_0xa19e('0x7')][_0xa19e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1087e7,_0x30fd4a,_0x336e23){return new BPromise(function(_0x1867cb,_0x44e468){return client[_0xa19e('0x9')](_0x1087e7,_0x336e23)[_0xa19e('0xa')](function(_0x59b907){logger[_0xa19e('0xb')](_0xa19e('0xc'),_0x30fd4a,_0xa19e('0xd'));logger[_0xa19e('0xe')]('Attachment,\x20%s,\x20%s,\x20%s',_0x30fd4a,_0xa19e('0xd'),JSON[_0xa19e('0xf')](_0x59b907));if(_0x59b907[_0xa19e('0x10')]){if(_0x59b907['error'][_0xa19e('0x11')]===0x1f4){logger[_0xa19e('0x10')](_0xa19e('0xc'),_0x30fd4a,_0x59b907[_0xa19e('0x10')][_0xa19e('0x12')]);return _0x44e468(_0x59b907['error'][_0xa19e('0x12')]);}logger[_0xa19e('0x10')](_0xa19e('0xc'),_0x30fd4a,_0x59b907[_0xa19e('0x10')][_0xa19e('0x12')]);return _0x1867cb(_0x59b907[_0xa19e('0x10')][_0xa19e('0x12')]);}else{logger[_0xa19e('0xb')](_0xa19e('0xc'),_0x30fd4a,_0xa19e('0xd'));_0x1867cb(_0x59b907[_0xa19e('0x13')]['message']);}})[_0xa19e('0x14')](function(_0x34066a){logger[_0xa19e('0x10')](_0xa19e('0xc'),_0x30fd4a,_0x34066a);_0x44e468(_0x34066a);});});}exports[_0xa19e('0x15')]=function(_0x38e398){var _0x1f37c4=this;return new Promise(function(_0x530a75,_0xd3e0ff){return db['Attachment'][_0xa19e('0x16')](_0x38e398['body'],{'raw':_0x38e398['options']?_0x38e398[_0xa19e('0x17')][_0xa19e('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x1cb9f9){logger[_0xa19e('0xb')](_0xa19e('0x15'),_0x38e398);logger[_0xa19e('0xe')]('CreateAttachment',_0x38e398,JSON[_0xa19e('0xf')](_0x1cb9f9));_0x530a75(_0x1cb9f9);})[_0xa19e('0x14')](function(_0x105874){logger[_0xa19e('0x10')](_0xa19e('0x15'),_0x105874[_0xa19e('0x12')],_0x38e398);_0xd3e0ff(_0x1f37c4[_0xa19e('0x10')](0x1f4,_0x105874[_0xa19e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 11c57c6..d3b16cb 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 _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x20e7e3,_0x1529be){var _0x14b9de=function(_0xa82925){while(--_0xa82925){_0x20e7e3['push'](_0x20e7e3['shift']());}};_0x14b9de(++_0x1529be);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x5f66[_0x2f5ac5];return _0x37c9a8;};'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('./attachment.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['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router; \ No newline at end of file +var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb28,0x106));var _0x8db2=function(_0xe41c53,_0x8e24a){_0xe41c53=_0xe41c53-0x0;var _0x336b0c=_0xdb28[_0xe41c53];return _0x336b0c;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 6312b62..e37a2a2 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 _0xc818=['passport-google-oauth20','Strategy','../../mysqldb','../../config/environment','../../components/auth/service','../../config/utils','google','/login','profile','callback','use','clientID','clientSecret','callbackURL','Setting','allowedLoginAttempts','blockDuration','then','User','map','value','admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','minutes','getLicense','catch','lodash','passport'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0xc818,0x86));var _0x8c81=function(_0x6a3be8,_0x3cfef3){_0x6a3be8=_0x6a3be8-0x0;var _0x5d041b=_0xc818[_0x6a3be8];return _0x5d041b;};'use strict';var _=require(_0x8c81('0x0'));var passport=require(_0x8c81('0x1'));var GoogleStrategy=require(_0x8c81('0x2'))[_0x8c81('0x3')];var moment=require('moment');var db=require(_0x8c81('0x4'))['db'];var config=require(_0x8c81('0x5'));var signToken=require(_0x8c81('0x6'))['signToken'];var utils=require(_0x8c81('0x7'));exports['login']=passport['authenticate'](_0x8c81('0x8'),{'failureRedirect':_0x8c81('0x9'),'scope':[_0x8c81('0xa'),'email'],'session':![]});exports[_0x8c81('0xb')]=passport['authenticate'](_0x8c81('0x8'),{'failureRedirect':_0x8c81('0x9'),'session':![]});passport[_0x8c81('0xc')](new GoogleStrategy({'clientID':config[_0x8c81('0x8')]?config[_0x8c81('0x8')][_0x8c81('0xd')]:'id','clientSecret':config[_0x8c81('0x8')]?config['google'][_0x8c81('0xe')]:'secret','callbackURL':config['google']?config['google'][_0x8c81('0xf')]:''},function(_0xff8bf6,_0x2c3007,_0x449941,_0x1c63be){var _0x1993d0,_0x1081b5;return db[_0x8c81('0x10')]['findOne']({'where':{'id':0x1},'attributes':[_0x8c81('0x11'),_0x8c81('0x12')],'raw':!![]})[_0x8c81('0x13')](function(_0x5cd9ed){_0x1993d0=_0x5cd9ed;return db[_0x8c81('0x14')]['find']({'where':{'email':_[_0x8c81('0x15')](_0x449941['emails'],_0x8c81('0x16')),'role':{'$or':[_0x8c81('0x17'),_0x8c81('0x18'),_0x8c81('0x19')]}}});})[_0x8c81('0x13')](function(_0x110c2a){_0x1081b5=_0x110c2a;if(_0x1081b5){if(_0x1081b5[_0x8c81('0x1a')]){return _0x1c63be(_0x8c81('0x1b'));}else if(_0x1993d0['blockDuration']>0x0){if(_0x1081b5[_0x8c81('0x1c')]){if(moment(_0x1081b5[_0x8c81('0x1d')])[_0x8c81('0x1e')](_0x1993d0[_0x8c81('0x12')],_0x8c81('0x1f'))>moment()){return _0x1c63be('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils['clearBlockUser'](_0x1081b5,0x0,![],null)[_0x8c81('0x13')](function(){return utils[_0x8c81('0x20')](_0x1081b5);})['then'](function(){return _0x1c63be(null,_0x1081b5);});}}else{return utils[_0x8c81('0x20')](_0x1081b5)[_0x8c81('0x13')](function(){return _0x1c63be(null,_0x1081b5);});}}else{return utils[_0x8c81('0x20')](_0x1081b5)[_0x8c81('0x13')](function(){return _0x1c63be(null,_0x1081b5);});}}return _0x1c63be(_0x8c81('0x1b'));})[_0x8c81('0x21')](function(_0x4b1a56){_0x1c63be(_0x4b1a56);});})); \ No newline at end of file +var _0x7edf=['passport','Strategy','moment','../../mysqldb','../../config/environment','../../config/utils','login','google','/login','profile','email','callback','use','clientID','clientSecret','secret','callbackURL','Setting','allowedLoginAttempts','then','User','find','map','emails','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','minutes','getLicense','catch','lodash'];(function(_0x58f245,_0x3e4f31){var _0x1f0cfb=function(_0x515942){while(--_0x515942){_0x58f245['push'](_0x58f245['shift']());}};_0x1f0cfb(++_0x3e4f31);}(_0x7edf,0x15d));var _0xf7ed=function(_0x3b19ea,_0x518b6b){_0x3b19ea=_0x3b19ea-0x0;var _0x40ece9=_0x7edf[_0x3b19ea];return _0x40ece9;};'use strict';var _=require(_0xf7ed('0x0'));var passport=require(_0xf7ed('0x1'));var GoogleStrategy=require('passport-google-oauth20')[_0xf7ed('0x2')];var moment=require(_0xf7ed('0x3'));var db=require(_0xf7ed('0x4'))['db'];var config=require(_0xf7ed('0x5'));var signToken=require('../../components/auth/service')['signToken'];var utils=require(_0xf7ed('0x6'));exports[_0xf7ed('0x7')]=passport['authenticate'](_0xf7ed('0x8'),{'failureRedirect':_0xf7ed('0x9'),'scope':[_0xf7ed('0xa'),_0xf7ed('0xb')],'session':![]});exports[_0xf7ed('0xc')]=passport['authenticate']('google',{'failureRedirect':_0xf7ed('0x9'),'session':![]});passport[_0xf7ed('0xd')](new GoogleStrategy({'clientID':config[_0xf7ed('0x8')]?config[_0xf7ed('0x8')][_0xf7ed('0xe')]:'id','clientSecret':config['google']?config['google'][_0xf7ed('0xf')]:_0xf7ed('0x10'),'callbackURL':config[_0xf7ed('0x8')]?config[_0xf7ed('0x8')][_0xf7ed('0x11')]:''},function(_0x548fc9,_0x57182b,_0x5b8517,_0x43f24c){var _0x4200c0,_0x2cf742;return db[_0xf7ed('0x12')]['findOne']({'where':{'id':0x1},'attributes':[_0xf7ed('0x13'),'blockDuration'],'raw':!![]})[_0xf7ed('0x14')](function(_0x289a67){_0x4200c0=_0x289a67;return db[_0xf7ed('0x15')][_0xf7ed('0x16')]({'where':{'email':_[_0xf7ed('0x17')](_0x5b8517[_0xf7ed('0x18')],'value'),'role':{'$or':['admin',_0xf7ed('0x19'),_0xf7ed('0x1a')]}}});})['then'](function(_0x2e1932){_0x2cf742=_0x2e1932;if(_0x2cf742){if(_0x2cf742['disabled']){return _0x43f24c(_0xf7ed('0x1b'));}else if(_0x4200c0[_0xf7ed('0x1c')]>0x0){if(_0x2cf742[_0xf7ed('0x1d')]){if(moment(_0x2cf742[_0xf7ed('0x1e')])[_0xf7ed('0x1f')](_0x4200c0[_0xf7ed('0x1c')],_0xf7ed('0x20'))>moment()){return _0x43f24c('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils['clearBlockUser'](_0x2cf742,0x0,![],null)[_0xf7ed('0x14')](function(){return utils[_0xf7ed('0x21')](_0x2cf742);})[_0xf7ed('0x14')](function(){return _0x43f24c(null,_0x2cf742);});}}else{return utils[_0xf7ed('0x21')](_0x2cf742)['then'](function(){return _0x43f24c(null,_0x2cf742);});}}else{return utils[_0xf7ed('0x21')](_0x2cf742)[_0xf7ed('0x14')](function(){return _0x43f24c(null,_0x2cf742);});}}return _0x43f24c(_0xf7ed('0x1b'));})[_0xf7ed('0x22')](function(_0xab873e){_0x43f24c(_0xab873e);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 6db8eea..c2f44f2 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 _0x362a=['Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','isMiddleware','setTokenCookie','exports','express','passport'];(function(_0x3d25e6,_0x2e55a3){var _0x3639c0=function(_0x2ac5a4){while(--_0x2ac5a4){_0x3d25e6['push'](_0x3d25e6['shift']());}};_0x3639c0(++_0x2e55a3);}(_0x362a,0x102));var _0xa362=function(_0x14d233,_0x4289f7){_0x14d233=_0x14d233-0x0;var _0x2d4c76=_0x362a[_0x14d233];return _0x2d4c76;};'use strict';var express=require(_0xa362('0x0'));var passport=require(_0xa362('0x1'));var router=express[_0xa362('0x2')]();var controller=require(_0xa362('0x3'));var userController=require(_0xa362('0x4'));var authService=require(_0xa362('0x5'));router[_0xa362('0x6')]('/',controller[_0xa362('0x7')]);router[_0xa362('0x6')](_0xa362('0x8'),controller[_0xa362('0x9')],authService[_0xa362('0xa')],userController['login'],authService[_0xa362('0xb')]);module[_0xa362('0xc')]=router; \ No newline at end of file +var _0x9efb=['callback','isMiddleware','setTokenCookie','passport','Router','../user/user.controller.js','../../components/auth/service','login','get','/callback'];(function(_0x40aaa4,_0x3b22f4){var _0x4e21e5=function(_0x35d2f3){while(--_0x35d2f3){_0x40aaa4['push'](_0x40aaa4['shift']());}};_0x4e21e5(++_0x3b22f4);}(_0x9efb,0x143));var _0xb9ef=function(_0x4ddbae,_0x3d2e5c){_0x4ddbae=_0x4ddbae-0x0;var _0x587ffb=_0x9efb[_0x4ddbae];return _0x587ffb;};'use strict';var express=require('express');var passport=require(_0xb9ef('0x0'));var router=express[_0xb9ef('0x1')]();var controller=require('./authGoogle.controller');var userController=require(_0xb9ef('0x2'));var authService=require(_0xb9ef('0x3'));router['get']('/',controller[_0xb9ef('0x4')]);router[_0xb9ef('0x5')](_0xb9ef('0x6'),controller[_0xb9ef('0x7')],authService[_0xb9ef('0x8')],userController[_0xb9ef('0x4')],authService[_0xb9ef('0x9')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 3cc7245..5631973 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 _0xc343=['Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','find','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','params','token','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','Password\x20reset!','use','util','passport-local','Strategy','jayson/promise','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','then','password','salt','role','disabled','loginAttempts','admin','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blocked','blockedAt','add','blockDuration','minutes','clearBlockUser','getLicense','catch','MailAccount','email','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host','port','secure','authentication','auth','user','pass','merge','format','\x22%s\x22\x20<%s>','SendMail','error','message','stringify','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body'];(function(_0xa06e80,_0x552e22){var _0x3729f8=function(_0x22d078){while(--_0x22d078){_0xa06e80['push'](_0xa06e80['shift']());}};_0x3729f8(++_0x552e22);}(_0xc343,0x173));var _0x3c34=function(_0x309d68,_0x971dd1){_0x309d68=_0x309d68-0x0;var _0x2c6801=_0xc343[_0x309d68];return _0x2c6801;};'use strict';var util=require(_0x3c34('0x0'));var passport=require('passport');var LocalStrategy=require(_0x3c34('0x1'))[_0x3c34('0x2')];var jayson=require(_0x3c34('0x3'));var _=require('lodash');var rs=require('randomstring');var moment=require(_0x3c34('0x4'));var db=require(_0x3c34('0x5'))['db'];var authService=require(_0x3c34('0x6'));var utils=require(_0x3c34('0x7'));var client=jayson[_0x3c34('0x8')][_0x3c34('0x9')]({'port':0x232b});function localAuthenticate(_0x401457,_0x2b12df,_0x9b457,_0x3d7335){var _0x351315,_0x1e98c3;return db[_0x3c34('0xa')][_0x3c34('0xb')]({'where':{'id':0x1},'attributes':[_0x3c34('0xc'),'blockDuration'],'raw':!![]})[_0x3c34('0xd')](function(_0x519a26){_0x351315=_0x519a26;return _0x401457[_0x3c34('0xb')]({'attributes':['id','name',_0x3c34('0xe'),_0x3c34('0xf'),_0x3c34('0x10'),_0x3c34('0x11'),'blocked','blockedAt',_0x3c34('0x12')],'where':{'name':_0x2b12df,'role':{'$or':[_0x3c34('0x13'),'user',_0x3c34('0x14')]}}});})[_0x3c34('0xd')](function(_0x50b90d){if(!_0x50b90d||_0x50b90d&&_0x50b90d[_0x3c34('0x15')]!==_0x2b12df){throw new Error(_0x3c34('0x16'));}else{_0x1e98c3=_0x50b90d;return _0x1e98c3;}})[_0x3c34('0xd')](function(){_0x1e98c3[_0x3c34('0x17')](_0x9b457,function(_0x236ffc,_0x277539){var _0x1ab6d9=_0x1e98c3['loginAttempts']+0x1;if(_0x236ffc){return _0x3d7335(_0x236ffc);}else if(!_0x277539){if(_0x1e98c3[_0x3c34('0x11')]){return _0x3d7335(null,![],{'message':_0x3c34('0x16')});}else if(_0x351315[_0x3c34('0xc')]>0x0){if(_0x1e98c3[_0x3c34('0x18')]){if(_0x351315['blockDuration']>0x0){if(moment(_0x1e98c3[_0x3c34('0x19')])[_0x3c34('0x1a')](_0x351315[_0x3c34('0x1b')],_0x3c34('0x1c'))>moment()){return _0x3d7335(null,![],{'message':_0x3c34('0x16')});}else{return utils[_0x3c34('0x1d')](_0x1e98c3,_0x1ab6d9,![],null)[_0x3c34('0xd')](function(){return _0x3d7335(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x3d7335(null,![],{'message':_0x3c34('0x16')});}}else{if(_0x1ab6d9>=_0x351315[_0x3c34('0xc')]){return utils[_0x3c34('0x1d')](_0x1e98c3,0x0,!![],moment())['then'](function(){return _0x3d7335(null,![],{'message':_0x3c34('0x16')});});}else{return utils[_0x3c34('0x1d')](_0x1e98c3,_0x1ab6d9,![],null)[_0x3c34('0xd')](function(){return _0x3d7335(null,![],{'message':_0x3c34('0x16')});});}}}else{return _0x3d7335(null,![],{'message':_0x3c34('0x16')});}}else{if(_0x1e98c3[_0x3c34('0x11')]){return _0x3d7335(null,![],{'message':_0x3c34('0x16')});}else if(_0x351315[_0x3c34('0xc')]>0x0){if(_0x1e98c3[_0x3c34('0x18')]){if(_0x351315[_0x3c34('0x1b')]>0x0){if(moment(_0x1e98c3[_0x3c34('0x19')])[_0x3c34('0x1a')](_0x351315['blockDuration'],_0x3c34('0x1c'))>moment()){return _0x3d7335(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x3c34('0x1d')](_0x1e98c3,0x0,![],null)[_0x3c34('0xd')](function(){return utils[_0x3c34('0x1e')](_0x1e98c3);})[_0x3c34('0xd')](function(){return _0x3d7335(null,_0x1e98c3);});}}else{return _0x3d7335(null,![],{'message':_0x3c34('0x16')});}}else{return utils[_0x3c34('0x1d')](_0x1e98c3,0x0,![],null)[_0x3c34('0xd')](function(){return utils[_0x3c34('0x1e')](_0x1e98c3);})['then'](function(){return _0x3d7335(null,_0x1e98c3);})[_0x3c34('0x1f')](function(_0x1e3764){return _0x3d7335(null,![],_0x1e3764);});}}else{if(_0x1e98c3[_0x3c34('0x18')]){return _0x3d7335(null,![],{'message':_0x3c34('0x16')});}else{return utils['getLicense'](_0x1e98c3)[_0x3c34('0xd')](function(){return _0x3d7335(null,_0x1e98c3);});}}}});})['catch'](function(_0x5892b0){return _0x3d7335(null,![],_0x5892b0);});}function sendServiceMail(_0x48ba00){return db[_0x3c34('0x20')]['find']({'where':{'service':!![]},'attributes':['id','name',_0x3c34('0x21')],'include':[{'model':db['MailServerOut'],'as':'Smtp'}]})['then'](function(_0x5ef622){if(!_0x5ef622){throw new Error(_0x3c34('0x22'));}var _0x431b7c={'tls':{'rejectUnauthorized':![]}};if(_0x5ef622[_0x3c34('0x23')]['service']){_0x431b7c[_0x3c34('0x24')]=_0x5ef622[_0x3c34('0x23')][_0x3c34('0x24')];}else{_0x431b7c[_0x3c34('0x25')]=_0x5ef622['Smtp'][_0x3c34('0x25')];_0x431b7c[_0x3c34('0x26')]=_0x5ef622['Smtp']['port'];_0x431b7c[_0x3c34('0x27')]=_0x5ef622[_0x3c34('0x23')][_0x3c34('0x27')];}if(_0x5ef622[_0x3c34('0x23')][_0x3c34('0x28')]){_0x431b7c[_0x3c34('0x29')]={'user':_0x5ef622[_0x3c34('0x23')][_0x3c34('0x2a')],'pass':_0x5ef622[_0x3c34('0x23')][_0x3c34('0x2b')]};}var _0x51187a={'account':_0x431b7c,'message':_[_0x3c34('0x2c')]({'from':util[_0x3c34('0x2d')](_0x3c34('0x2e'),_0x5ef622[_0x3c34('0x15')],_0x5ef622[_0x3c34('0x21')]||_0x5ef622[_0x3c34('0x23')][_0x3c34('0x2a')])},_0x48ba00)};return client['request'](_0x3c34('0x2f'),_0x51187a);})['then'](function(_0x454019){if(_0x454019['error']){throw new Error(util[_0x3c34('0x2d')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x454019[_0x3c34('0x30')][_0x3c34('0x31')]||JSON[_0x3c34('0x32')](_0x454019[_0x3c34('0x30')])));}return!![];});}function handleError(_0x4e791d,_0x1cee5f,_0x517ed5){return _0x4e791d['status'](_0x1cee5f||0x1f4)[_0x3c34('0x33')]({'message':_0x517ed5?_0x517ed5['message']||_0x517ed5:''});}exports[_0x3c34('0x34')]=function(_0x219481,_0x30c311,_0x20f93b){passport['authenticate']('local',function(_0x59db30,_0x13d19b,_0x249832){var _0xfd3dad=_0x59db30||_0x249832;if(_0xfd3dad){return handleError(_0x30c311,0x191,_0xfd3dad);}if(!_0x13d19b){return handleError(_0x30c311,0x194,{'message':_0x3c34('0x35')});}else{var _0x536bf8={'payload':{'id':_0x13d19b['id'],'role':_0x13d19b['role']},'options':{'expiresIn':0x15180}};return authService[_0x3c34('0x36')](_0x536bf8)[_0x3c34('0xd')](function(_0x1e7c08){_0x30c311[_0x3c34('0x37')]({'id':_0x13d19b['id'],'token':_0x1e7c08,'statusCall':'','isAlreadyLogged':_0x13d19b[_0x3c34('0x38')]});});}})(_0x219481,_0x30c311,_0x20f93b);};exports[_0x3c34('0x39')]=function(_0x56ae4d,_0x32913f,_0x875eb2){if(!_0x56ae4d[_0x3c34('0x3a')][_0x3c34('0x21')]){return handleError(_0x32913f,0x1f4,{'message':_0x3c34('0x3b')});}var _0x1fdd75=rs[_0x3c34('0x3c')]();_0x56ae4d[_0x3c34('0x3a')][_0x3c34('0x21')]=_0x56ae4d[_0x3c34('0x3a')]['email'][_0x3c34('0x3d')]()[_0x3c34('0x3e')]();var _0x25432f;return db[_0x3c34('0xa')][_0x3c34('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0x3c34('0xd')](function(_0x566f8c){_0x25432f=_0x566f8c;return db[_0x3c34('0x3f')][_0x3c34('0x40')]({'where':{'email':_0x56ae4d[_0x3c34('0x3a')][_0x3c34('0x21')]}});})[_0x3c34('0xd')](function(_0x3abfd8){if(!_0x3abfd8){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x3abfd8['disabled']){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x3abfd8[_0x3c34('0x18')]){if(moment(_0x3abfd8[_0x3c34('0x19')])[_0x3c34('0x1a')](_0x25432f[_0x3c34('0x1b')],_0x3c34('0x1c'))>moment()){throw new Error(_0x3c34('0x41'));}else{_0x3abfd8['blocked']=![];_0x3abfd8[_0x3c34('0x19')]=null;}}_0x3abfd8[_0x3c34('0x42')]=_0x1fdd75;_0x3abfd8['resetPasswordExpires']=Date[_0x3c34('0x43')]()+0x36ee80;return _0x3abfd8[_0x3c34('0x44')]();})[_0x3c34('0xd')](function(){return sendServiceMail({'to':_0x56ae4d[_0x3c34('0x3a')][_0x3c34('0x21')],'subject':_0x3c34('0x45'),'text':_0x3c34('0x46')+_0x3c34('0x47')+'https://'+_0x56ae4d[_0x3c34('0x48')][_0x3c34('0x25')]+_0x3c34('0x49')+_0x1fdd75+'\x0a\x0a'+_0x3c34('0x4a')});})[_0x3c34('0xd')](function(){_0x32913f[_0x3c34('0x4b')](0xc8)[_0x3c34('0x33')]({'message':_0x3c34('0x4c')});})[_0x3c34('0x1f')](function(_0x348c74){return handleError(_0x32913f,0x1f4,_0x348c74);});};exports['reset']=function(_0x283243,_0x4631d8,_0x2913f7){return db['User'][_0x3c34('0x40')]({'where':{'resetPasswordToken':_0x283243[_0x3c34('0x4d')][_0x3c34('0x4e')],'resetPasswordExpires':{'$gt':Date[_0x3c34('0x43')]()}}})[_0x3c34('0xd')](function(_0x393a67){if(!_0x393a67){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x3c34('0xa')][_0x3c34('0xb')]({'attributes':['id',_0x3c34('0x4f'),_0x3c34('0x50'),_0x3c34('0x51')]})['then'](function(_0x21334c){if(_0x21334c[_0x3c34('0x4f')])authService[_0x3c34('0x52')](_0x283243['body'][_0x3c34('0xe')]);if(!_0x21334c[_0x3c34('0x50')]||!_0x393a67['previousPasswords'])return _0x393a67;authService['validatePasswordHistory'](_0x283243['body'][_0x3c34('0xe')],_0x393a67[_0x3c34('0x53')],_0x21334c['passwordHistoryLimit']);return _0x393a67;})[_0x3c34('0xd')](function(){_0x393a67['password']=_0x283243[_0x3c34('0x3a')][_0x3c34('0xe')];_0x393a67[_0x3c34('0x42')]=null;_0x393a67['resetPasswordExpires']=null;return _0x393a67[_0x3c34('0x44')]();});})[_0x3c34('0xd')](function(){_0x4631d8[_0x3c34('0x4b')](0xc8)[_0x3c34('0x33')]({'message':_0x3c34('0x54')});})[_0x3c34('0x1f')](function(_0x193d8c){return handleError(_0x4631d8,0x1f4,_0x193d8c);});};passport[_0x3c34('0x55')](new LocalStrategy({'usernameField':_0x3c34('0x15'),'passwordField':_0x3c34('0xe')},function(_0x439c75,_0x46aa36,_0x43739b){return localAuthenticate(db[_0x3c34('0x3f')],_0x439c75,_0x46aa36,_0x43739b);})); \ No newline at end of file +var _0x99fc=['This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','resetPasswordToken','Password\x20reset!','use','util','Strategy','jayson/promise','lodash','../../mysqldb','../../components/auth/service','../../config/utils','client','http','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','blocked','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','host','port','secure','authentication','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','forgot','email','generate','body','trim','Setting','User'];(function(_0x108437,_0xc01413){var _0x101be0=function(_0x1ec318){while(--_0x1ec318){_0x108437['push'](_0x108437['shift']());}};_0x101be0(++_0xc01413);}(_0x99fc,0x153));var _0xc99f=function(_0x63b24a,_0x23b365){_0x63b24a=_0x63b24a-0x0;var _0x32c345=_0x99fc[_0x63b24a];return _0x32c345;};'use strict';var util=require(_0xc99f('0x0'));var passport=require('passport');var LocalStrategy=require('passport-local')[_0xc99f('0x1')];var jayson=require(_0xc99f('0x2'));var _=require(_0xc99f('0x3'));var rs=require('randomstring');var moment=require('moment');var db=require(_0xc99f('0x4'))['db'];var authService=require(_0xc99f('0x5'));var utils=require(_0xc99f('0x6'));var client=jayson[_0xc99f('0x7')][_0xc99f('0x8')]({'port':0x232b});function localAuthenticate(_0x5592fb,_0x10fbf4,_0x1073c0,_0x13667b){var _0x3559a6,_0x36afc6;return db['Setting'][_0xc99f('0x9')]({'where':{'id':0x1},'attributes':[_0xc99f('0xa'),_0xc99f('0xb')],'raw':!![]})[_0xc99f('0xc')](function(_0x5b8e64){_0x3559a6=_0x5b8e64;return _0x5592fb['findOne']({'attributes':['id',_0xc99f('0xd'),_0xc99f('0xe'),_0xc99f('0xf'),_0xc99f('0x10'),'disabled','blocked',_0xc99f('0x11'),_0xc99f('0x12')],'where':{'name':_0x10fbf4,'role':{'$or':[_0xc99f('0x13'),_0xc99f('0x14'),_0xc99f('0x15')]}}});})['then'](function(_0x5c351c){if(!_0x5c351c||_0x5c351c&&_0x5c351c[_0xc99f('0xd')]!==_0x10fbf4){throw new Error(_0xc99f('0x16'));}else{_0x36afc6=_0x5c351c;return _0x36afc6;}})['then'](function(){_0x36afc6[_0xc99f('0x17')](_0x1073c0,function(_0x3e9392,_0xe2b94e){var _0x288f42=_0x36afc6['loginAttempts']+0x1;if(_0x3e9392){return _0x13667b(_0x3e9392);}else if(!_0xe2b94e){if(_0x36afc6[_0xc99f('0x18')]){return _0x13667b(null,![],{'message':_0xc99f('0x16')});}else if(_0x3559a6[_0xc99f('0xa')]>0x0){if(_0x36afc6[_0xc99f('0x19')]){if(_0x3559a6[_0xc99f('0xb')]>0x0){if(moment(_0x36afc6['blockedAt'])[_0xc99f('0x1a')](_0x3559a6['blockDuration'],_0xc99f('0x1b'))>moment()){return _0x13667b(null,![],{'message':_0xc99f('0x16')});}else{return utils['clearBlockUser'](_0x36afc6,_0x288f42,![],null)[_0xc99f('0xc')](function(){return _0x13667b(null,![],{'message':_0xc99f('0x16')});});}}else{return _0x13667b(null,![],{'message':_0xc99f('0x16')});}}else{if(_0x288f42>=_0x3559a6[_0xc99f('0xa')]){return utils['clearBlockUser'](_0x36afc6,0x0,!![],moment())[_0xc99f('0xc')](function(){return _0x13667b(null,![],{'message':_0xc99f('0x16')});});}else{return utils[_0xc99f('0x1c')](_0x36afc6,_0x288f42,![],null)[_0xc99f('0xc')](function(){return _0x13667b(null,![],{'message':_0xc99f('0x16')});});}}}else{return _0x13667b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x36afc6[_0xc99f('0x18')]){return _0x13667b(null,![],{'message':_0xc99f('0x16')});}else if(_0x3559a6[_0xc99f('0xa')]>0x0){if(_0x36afc6[_0xc99f('0x19')]){if(_0x3559a6[_0xc99f('0xb')]>0x0){if(moment(_0x36afc6[_0xc99f('0x11')])[_0xc99f('0x1a')](_0x3559a6[_0xc99f('0xb')],_0xc99f('0x1b'))>moment()){return _0x13667b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xc99f('0x1c')](_0x36afc6,0x0,![],null)[_0xc99f('0xc')](function(){return utils[_0xc99f('0x1d')](_0x36afc6);})[_0xc99f('0xc')](function(){return _0x13667b(null,_0x36afc6);});}}else{return _0x13667b(null,![],{'message':_0xc99f('0x16')});}}else{return utils[_0xc99f('0x1c')](_0x36afc6,0x0,![],null)[_0xc99f('0xc')](function(){return utils[_0xc99f('0x1d')](_0x36afc6);})[_0xc99f('0xc')](function(){return _0x13667b(null,_0x36afc6);})[_0xc99f('0x1e')](function(_0x35baf1){return _0x13667b(null,![],_0x35baf1);});}}else{if(_0x36afc6['blocked']){return _0x13667b(null,![],{'message':_0xc99f('0x16')});}else{return utils[_0xc99f('0x1d')](_0x36afc6)[_0xc99f('0xc')](function(){return _0x13667b(null,_0x36afc6);});}}}});})[_0xc99f('0x1e')](function(_0x5e89ea){return _0x13667b(null,![],_0x5e89ea);});}function sendServiceMail(_0x4f6ab3){return db[_0xc99f('0x1f')][_0xc99f('0x20')]({'where':{'service':!![]},'attributes':['id',_0xc99f('0xd'),'email'],'include':[{'model':db['MailServerOut'],'as':_0xc99f('0x21')}]})[_0xc99f('0xc')](function(_0x11a9dd){if(!_0x11a9dd){throw new Error(_0xc99f('0x22'));}var _0x57a0d6={'tls':{'rejectUnauthorized':![]}};if(_0x11a9dd['Smtp']['service']){_0x57a0d6['service']=_0x11a9dd['Smtp']['service'];}else{_0x57a0d6[_0xc99f('0x23')]=_0x11a9dd[_0xc99f('0x21')][_0xc99f('0x23')];_0x57a0d6[_0xc99f('0x24')]=_0x11a9dd[_0xc99f('0x21')]['port'];_0x57a0d6['secure']=_0x11a9dd['Smtp'][_0xc99f('0x25')];}if(_0x11a9dd[_0xc99f('0x21')][_0xc99f('0x26')]){_0x57a0d6['auth']={'user':_0x11a9dd[_0xc99f('0x21')][_0xc99f('0x14')],'pass':_0x11a9dd[_0xc99f('0x21')]['pass']};}var _0x345b25={'account':_0x57a0d6,'message':_[_0xc99f('0x27')]({'from':util[_0xc99f('0x28')](_0xc99f('0x29'),_0x11a9dd[_0xc99f('0xd')],_0x11a9dd['email']||_0x11a9dd[_0xc99f('0x21')][_0xc99f('0x14')])},_0x4f6ab3)};return client[_0xc99f('0x2a')](_0xc99f('0x2b'),_0x345b25);})[_0xc99f('0xc')](function(_0x707ef4){if(_0x707ef4[_0xc99f('0x2c')]){throw new Error(util[_0xc99f('0x28')](_0xc99f('0x2d'),_0x707ef4[_0xc99f('0x2c')][_0xc99f('0x2e')]||JSON[_0xc99f('0x2f')](_0x707ef4[_0xc99f('0x2c')])));}return!![];});}function handleError(_0x44650c,_0xab2f69,_0xb6773){return _0x44650c[_0xc99f('0x30')](_0xab2f69||0x1f4)[_0xc99f('0x31')]({'message':_0xb6773?_0xb6773['message']||_0xb6773:''});}exports[_0xc99f('0x32')]=function(_0x55ac2b,_0x14be3a,_0x5311c6){passport[_0xc99f('0x17')](_0xc99f('0x33'),function(_0x314c73,_0x4a6fb8,_0x142267){var _0x59e328=_0x314c73||_0x142267;if(_0x59e328){return handleError(_0x14be3a,0x191,_0x59e328);}if(!_0x4a6fb8){return handleError(_0x14be3a,0x194,{'message':_0xc99f('0x34')});}else{var _0x5ddfe4={'payload':{'id':_0x4a6fb8['id'],'role':_0x4a6fb8[_0xc99f('0x10')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x5ddfe4)[_0xc99f('0xc')](function(_0x1856b1){_0x14be3a[_0xc99f('0x35')]({'id':_0x4a6fb8['id'],'token':_0x1856b1,'statusCall':'','isAlreadyLogged':_0x4a6fb8['online']});});}})(_0x55ac2b,_0x14be3a,_0x5311c6);};exports[_0xc99f('0x36')]=function(_0x21fa57,_0x1d10d7,_0x248bbd){if(!_0x21fa57['body'][_0xc99f('0x37')]){return handleError(_0x1d10d7,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x276e9c=rs[_0xc99f('0x38')]();_0x21fa57[_0xc99f('0x39')][_0xc99f('0x37')]=_0x21fa57[_0xc99f('0x39')][_0xc99f('0x37')][_0xc99f('0x3a')]()['toLowerCase']();var _0x111eca;return db[_0xc99f('0x3b')][_0xc99f('0x9')]({'where':{'id':0x1},'attributes':[_0xc99f('0xa'),'blockDuration'],'raw':!![]})[_0xc99f('0xc')](function(_0x5669a1){_0x111eca=_0x5669a1;return db[_0xc99f('0x3c')][_0xc99f('0x20')]({'where':{'email':_0x21fa57[_0xc99f('0x39')][_0xc99f('0x37')]}});})['then'](function(_0x3d7d86){if(!_0x3d7d86){throw new Error(_0xc99f('0x3d'));}if(_0x3d7d86['disabled']){throw new Error(_0xc99f('0x3e'));}if(_0x3d7d86['blocked']){if(moment(_0x3d7d86['blockedAt'])[_0xc99f('0x1a')](_0x111eca['blockDuration'],_0xc99f('0x1b'))>moment()){throw new Error(_0xc99f('0x3f'));}else{_0x3d7d86[_0xc99f('0x19')]=![];_0x3d7d86[_0xc99f('0x11')]=null;}}_0x3d7d86['resetPasswordToken']=_0x276e9c;_0x3d7d86[_0xc99f('0x40')]=Date[_0xc99f('0x41')]()+0x36ee80;return _0x3d7d86[_0xc99f('0x42')]();})['then'](function(){return sendServiceMail({'to':_0x21fa57['body'][_0xc99f('0x37')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0xc99f('0x43')+_0xc99f('0x44')+_0x21fa57[_0xc99f('0x45')][_0xc99f('0x23')]+'/reset/'+_0x276e9c+'\x0a\x0a'+_0xc99f('0x46')});})['then'](function(){_0x1d10d7[_0xc99f('0x30')](0xc8)[_0xc99f('0x31')]({'message':_0xc99f('0x47')});})[_0xc99f('0x1e')](function(_0x386394){return handleError(_0x1d10d7,0x1f4,_0x386394);});};exports['reset']=function(_0x5e3ec8,_0x4be730,_0x248dd1){return db[_0xc99f('0x3c')][_0xc99f('0x20')]({'where':{'resetPasswordToken':_0x5e3ec8['params']['token'],'resetPasswordExpires':{'$gt':Date[_0xc99f('0x41')]()}}})[_0xc99f('0xc')](function(_0x33473b){if(!_0x33473b){throw new Error(_0xc99f('0x48'));}return db['Setting'][_0xc99f('0x9')]({'attributes':['id',_0xc99f('0x49'),_0xc99f('0x4a'),_0xc99f('0x4b')]})['then'](function(_0x5c6887){if(_0x5c6887['securePassword'])authService['validatePasswordPattern'](_0x5e3ec8['body']['password']);if(!_0x5c6887[_0xc99f('0x4a')]||!_0x33473b[_0xc99f('0x4c')])return _0x33473b;authService['validatePasswordHistory'](_0x5e3ec8[_0xc99f('0x39')]['password'],_0x33473b['previousPasswords'],_0x5c6887[_0xc99f('0x4b')]);return _0x33473b;})['then'](function(){_0x33473b['password']=_0x5e3ec8['body']['password'];_0x33473b[_0xc99f('0x4d')]=null;_0x33473b[_0xc99f('0x40')]=null;return _0x33473b['save']();});})['then'](function(){_0x4be730[_0xc99f('0x30')](0xc8)[_0xc99f('0x31')]({'message':_0xc99f('0x4e')});})[_0xc99f('0x1e')](function(_0xb4507a){return handleError(_0x4be730,0x1f4,_0xb4507a);});};passport[_0xc99f('0x4f')](new LocalStrategy({'usernameField':_0xc99f('0xd'),'passwordField':_0xc99f('0xe')},function(_0x41405a,_0x5b2a7e,_0x73da5d){return localAuthenticate(db[_0xc99f('0x3c')],_0x41405a,_0x5b2a7e,_0x73da5d);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index a6388ba..8621ccb 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 _0xe5e6=['forgot','/reset/:token','reset','express','./authLocal.controller','post','/forgot'];(function(_0x1e1bd9,_0x5d2e0c){var _0x28ea77=function(_0x359f98){while(--_0x359f98){_0x1e1bd9['push'](_0x1e1bd9['shift']());}};_0x28ea77(++_0x5d2e0c);}(_0xe5e6,0x168));var _0x6e5e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe5e6[_0x321bb2];return _0x9c12ed;};'use strict';var express=require(_0x6e5e('0x0'));var router=express['Router']();var controller=require(_0x6e5e('0x1'));router['post']('/',controller['login']);router[_0x6e5e('0x2')](_0x6e5e('0x3'),controller[_0x6e5e('0x4')]);router[_0x6e5e('0x2')](_0x6e5e('0x5'),controller[_0x6e5e('0x6')]);module['exports']=router; \ No newline at end of file +var _0xe4e8=['./authLocal.controller','post','login','forgot','/reset/:token','reset','exports','express'];(function(_0x356a22,_0x241023){var _0x3b9add=function(_0x22fc24){while(--_0x22fc24){_0x356a22['push'](_0x356a22['shift']());}};_0x3b9add(++_0x241023);}(_0xe4e8,0xef));var _0x8e4e=function(_0xf2fcc,_0x388aed){_0xf2fcc=_0xf2fcc-0x0;var _0x37fa69=_0xe4e8[_0xf2fcc];return _0x37fa69;};'use strict';var express=require(_0x8e4e('0x0'));var router=express['Router']();var controller=require(_0x8e4e('0x1'));router[_0x8e4e('0x2')]('/',controller[_0x8e4e('0x3')]);router['post']('/forgot',controller[_0x8e4e('0x4')]);router[_0x8e4e('0x2')](_0x8e4e('0x5'),controller[_0x8e4e('0x6')]);module[_0x8e4e('0x7')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 7d8878d..b0f9a97 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 _0x7f59=['STRING','INTEGER','sequelize','exports'];(function(_0x3adf4e,_0x26d25f){var _0x4dc28b=function(_0x38d031){while(--_0x38d031){_0x3adf4e['push'](_0x3adf4e['shift']());}};_0x4dc28b(++_0x26d25f);}(_0x7f59,0xba));var _0x97f5=function(_0x51ab0a,_0x2c6928){_0x51ab0a=_0x51ab0a-0x0;var _0x35d20e=_0x7f59[_0x51ab0a];return _0x35d20e;};'use strict';var Sequelize=require(_0x97f5('0x0'));module[_0x97f5('0x1')]={'name':{'type':Sequelize[_0x97f5('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x97f5('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0xd044=['BOOLEAN','INTEGER','sequelize','STRING'];(function(_0x2bcddb,_0x3eaf37){var _0x12a9e8=function(_0xeeb678){while(--_0xeeb678){_0x2bcddb['push'](_0x2bcddb['shift']());}};_0x12a9e8(++_0x3eaf37);}(_0xd044,0x13e));var _0x4d04=function(_0x3869c8,_0x2ff137){_0x3869c8=_0x3869c8-0x0;var _0x4caf60=_0xd044[_0x3869c8];return _0x4caf60;};'use strict';var Sequelize=require(_0x4d04('0x0'));module['exports']={'name':{'type':Sequelize[_0x4d04('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x4d04('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x4d04('0x3')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 08e83c2..26b79da 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 _0xa9cb=['attributes','intersection','fields','query','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','addConditions','Condition','ids','omit','getConditions','findOne','addActions','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','apply','reject','update','then','destroy','name','send','index','map','Automation','type','model','keys','filters'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa9cb,0x125));var _0xba9c=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9cb[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0xba9c('0x0'));var rimraf=require(_0xba9c('0x1'));var zipdir=require(_0xba9c('0x2'));var jsonpatch=require(_0xba9c('0x3'));var rp=require(_0xba9c('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xba9c('0x5'));var util=require('util');var path=require(_0xba9c('0x6'));var sox=require(_0xba9c('0x7'));var csv=require(_0xba9c('0x8'));var ejs=require(_0xba9c('0x9'));var fs=require('fs');var fs_extra=require(_0xba9c('0xa'));var _=require(_0xba9c('0xb'));var squel=require(_0xba9c('0xc'));var crypto=require(_0xba9c('0xd'));var jsforce=require(_0xba9c('0xe'));var deskjs=require(_0xba9c('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xba9c('0x10'));var Redis=require(_0xba9c('0x11'));var authService=require(_0xba9c('0x12'));var qs=require(_0xba9c('0x13'));var as=require(_0xba9c('0x14'));var hardwareService=require(_0xba9c('0x15'));var logger=require(_0xba9c('0x16'))(_0xba9c('0x17'));var utils=require(_0xba9c('0x18'));var config=require(_0xba9c('0x19'));var licenseUtil=require(_0xba9c('0x1a'));var db=require(_0xba9c('0x1b'))['db'];function respondWithStatusCode(_0x36020f,_0x366c3f){_0x366c3f=_0x366c3f||0xcc;return function(_0x1bf2fe){if(_0x1bf2fe){return _0x36020f[_0xba9c('0x1c')](_0x366c3f);}return _0x36020f[_0xba9c('0x1d')](_0x366c3f)[_0xba9c('0x1e')]();};}function respondWithResult(_0x16587e,_0x1b5b04){_0x1b5b04=_0x1b5b04||0xc8;return function(_0x5bcd30){if(_0x5bcd30){return _0x16587e[_0xba9c('0x1d')](_0x1b5b04)['json'](_0x5bcd30);}};}function respondWithFilteredResult(_0x4f0cb,_0x13db57){return function(_0x30eccb){if(_0x30eccb){var _0x9e2848=typeof _0x13db57['offset']===_0xba9c('0x1f')&&typeof _0x13db57[_0xba9c('0x20')]===_0xba9c('0x1f');var _0x210475=_0x30eccb['count'];var _0x265046=_0x9e2848?0x0:_0x13db57[_0xba9c('0x21')];var _0x2404ec=_0x9e2848?_0x30eccb[_0xba9c('0x22')]:_0x13db57[_0xba9c('0x21')]+_0x13db57[_0xba9c('0x20')];var _0x1b7ebe;if(_0x2404ec>=_0x210475){_0x2404ec=_0x210475;_0x1b7ebe=0xc8;}else{_0x1b7ebe=0xce;}_0x4f0cb[_0xba9c('0x1d')](_0x1b7ebe);return _0x4f0cb[_0xba9c('0x23')](_0xba9c('0x24'),_0x265046+'-'+_0x2404ec+'/'+_0x210475)['json'](_0x30eccb);}return null;};}function patchUpdates(_0x49904d){return function(_0x37406c){try{jsonpatch[_0xba9c('0x25')](_0x37406c,_0x49904d,!![]);}catch(_0x41ed7e){return BPromise[_0xba9c('0x26')](_0x41ed7e);}return _0x37406c['save']();};}function saveUpdates(_0x1c02e5,_0x5d863b){return function(_0x24ddc6){if(_0x24ddc6){return _0x24ddc6[_0xba9c('0x27')](_0x1c02e5)[_0xba9c('0x28')](function(_0x42d49a){return _0x42d49a;});}return null;};}function removeEntity(_0x2b829a,_0x5e1cd3){return function(_0x444a4c){if(_0x444a4c){return _0x444a4c[_0xba9c('0x29')]()[_0xba9c('0x28')](function(){_0x2b829a[_0xba9c('0x1d')](0xcc)[_0xba9c('0x1e')]();});}};}function handleEntityNotFound(_0xb676c2,_0xdd90d2){return function(_0x1912db){if(!_0x1912db){_0xb676c2[_0xba9c('0x1c')](0x194);}return _0x1912db;};}function handleError(_0x3664c4,_0x52e9e1){_0x52e9e1=_0x52e9e1||0x1f4;return function(_0x499bc9){logger['error'](_0x499bc9['stack']);if(_0x499bc9[_0xba9c('0x2a')]){delete _0x499bc9[_0xba9c('0x2a')];}_0x3664c4[_0xba9c('0x1d')](_0x52e9e1)[_0xba9c('0x2b')](_0x499bc9);};}exports[_0xba9c('0x2c')]=function(_0x3b3d01,_0x545ac5){var _0x2f3118={},_0x4b1597={},_0x47a7a0={'count':0x0,'rows':[]};var _0x46be5f=_[_0xba9c('0x2d')](db[_0xba9c('0x2e')]['rawAttributes'],function(_0xd7b73e){return{'name':_0xd7b73e['fieldName'],'type':_0xd7b73e[_0xba9c('0x2f')]['key']};});_0x4b1597[_0xba9c('0x30')]=_[_0xba9c('0x2d')](_0x46be5f,_0xba9c('0x2a'));_0x4b1597['query']=_[_0xba9c('0x31')](_0x3b3d01['query']);_0x4b1597[_0xba9c('0x32')]=_['intersection'](_0x4b1597['model'],_0x4b1597['query']);_0x2f3118[_0xba9c('0x33')]=_[_0xba9c('0x34')](_0x4b1597[_0xba9c('0x30')],qs[_0xba9c('0x35')](_0x3b3d01[_0xba9c('0x36')][_0xba9c('0x35')]));_0x2f3118[_0xba9c('0x33')]=_0x2f3118[_0xba9c('0x33')][_0xba9c('0x37')]?_0x2f3118[_0xba9c('0x33')]:_0x4b1597[_0xba9c('0x30')];if(!_0x3b3d01[_0xba9c('0x36')][_0xba9c('0x38')](_0xba9c('0x39'))){_0x2f3118[_0xba9c('0x20')]=qs['limit'](_0x3b3d01['query'][_0xba9c('0x20')]);_0x2f3118[_0xba9c('0x21')]=qs[_0xba9c('0x21')](_0x3b3d01['query'][_0xba9c('0x21')]);}_0x2f3118[_0xba9c('0x3a')]=qs[_0xba9c('0x3b')](_0x3b3d01[_0xba9c('0x36')]['sort']);_0x2f3118['where']=qs[_0xba9c('0x32')](_[_0xba9c('0x3c')](_0x3b3d01[_0xba9c('0x36')],_0x4b1597[_0xba9c('0x32')]),_0x46be5f);if(_0x3b3d01['query'][_0xba9c('0x3d')]){_0x2f3118[_0xba9c('0x3e')]=_[_0xba9c('0x3f')](_0x2f3118[_0xba9c('0x3e')],{'$or':_[_0xba9c('0x2d')](_0x46be5f,function(_0x4089f9){if(_0x4089f9[_0xba9c('0x2f')]!==_0xba9c('0x40')){var _0x427734={};_0x427734[_0x4089f9['name']]={'$like':'%'+_0x3b3d01[_0xba9c('0x36')][_0xba9c('0x3d')]+'%'};return _0x427734;}})});}_0x2f3118=_['merge']({},_0x2f3118,_0x3b3d01[_0xba9c('0x41')]);var _0x4975fc={'where':_0x2f3118['where']};return db[_0xba9c('0x2e')]['count'](_0x4975fc)[_0xba9c('0x28')](function(_0x2f123d){_0x47a7a0[_0xba9c('0x22')]=_0x2f123d;if(_0x3b3d01[_0xba9c('0x36')][_0xba9c('0x42')]){_0x2f3118['include']=[{'all':!![]}];}return db['Automation'][_0xba9c('0x43')](_0x2f3118);})['then'](function(_0x48d8cd){_0x47a7a0[_0xba9c('0x44')]=_0x48d8cd;return _0x47a7a0;})[_0xba9c('0x28')](respondWithFilteredResult(_0x545ac5,_0x2f3118))[_0xba9c('0x45')](handleError(_0x545ac5,null));};exports[_0xba9c('0x46')]=function(_0x3dd37a,_0x3ee490){var _0x813e39={'raw':![],'where':{'id':_0x3dd37a[_0xba9c('0x47')]['id']}},_0x5f5a73={};_0x5f5a73[_0xba9c('0x30')]=_[_0xba9c('0x31')](db[_0xba9c('0x2e')][_0xba9c('0x48')]);_0x5f5a73[_0xba9c('0x36')]=_[_0xba9c('0x31')](_0x3dd37a[_0xba9c('0x36')]);_0x5f5a73[_0xba9c('0x32')]=_[_0xba9c('0x34')](_0x5f5a73[_0xba9c('0x30')],_0x5f5a73[_0xba9c('0x36')]);_0x813e39['attributes']=_[_0xba9c('0x34')](_0x5f5a73[_0xba9c('0x30')],qs[_0xba9c('0x35')](_0x3dd37a[_0xba9c('0x36')][_0xba9c('0x35')]));_0x813e39[_0xba9c('0x33')]=_0x813e39[_0xba9c('0x33')][_0xba9c('0x37')]?_0x813e39['attributes']:_0x5f5a73['model'];if(_0x3dd37a[_0xba9c('0x36')][_0xba9c('0x42')]){_0x813e39[_0xba9c('0x49')]=[{'all':!![]}];}_0x813e39=_[_0xba9c('0x3f')]({},_0x813e39,_0x3dd37a[_0xba9c('0x41')]);return db[_0xba9c('0x2e')][_0xba9c('0x4a')](_0x813e39)[_0xba9c('0x28')](handleEntityNotFound(_0x3ee490,null))[_0xba9c('0x28')](respondWithResult(_0x3ee490,null))[_0xba9c('0x45')](handleError(_0x3ee490,null));};exports[_0xba9c('0x4b')]=function(_0x4071d2,_0x4229a6){return db[_0xba9c('0x2e')][_0xba9c('0x4b')](_0x4071d2[_0xba9c('0x4c')],{})[_0xba9c('0x28')](respondWithResult(_0x4229a6,0xc9))[_0xba9c('0x45')](handleError(_0x4229a6,null));};exports[_0xba9c('0x27')]=function(_0x332fb4,_0x52d4f1){if(_0x332fb4[_0xba9c('0x4c')]['id']){delete _0x332fb4[_0xba9c('0x4c')]['id'];}return db[_0xba9c('0x2e')]['find']({'where':{'id':_0x332fb4[_0xba9c('0x47')]['id']}})[_0xba9c('0x28')](handleEntityNotFound(_0x52d4f1,null))[_0xba9c('0x28')](saveUpdates(_0x332fb4[_0xba9c('0x4c')],null))['then'](respondWithResult(_0x52d4f1,null))[_0xba9c('0x45')](handleError(_0x52d4f1,null));};exports['destroy']=function(_0x2ec21f,_0x2aa91b){return db[_0xba9c('0x2e')][_0xba9c('0x4a')]({'where':{'id':_0x2ec21f['params']['id']}})[_0xba9c('0x28')](handleEntityNotFound(_0x2aa91b,null))[_0xba9c('0x28')](removeEntity(_0x2aa91b,null))[_0xba9c('0x45')](handleError(_0x2aa91b,null));};exports[_0xba9c('0x4d')]=function(_0x1d9512,_0x335815,_0x6c7fbe){return db[_0xba9c('0x4e')][_0xba9c('0x4a')]({'where':{'id':_0x1d9512[_0xba9c('0x47')]['id']}})['then'](handleEntityNotFound(_0x335815,null))[_0xba9c('0x28')](function(_0x5bb3fa){if(_0x5bb3fa){return _0x5bb3fa[_0xba9c('0x4d')](_0x1d9512[_0xba9c('0x4c')][_0xba9c('0x4f')],_[_0xba9c('0x50')](_0x1d9512[_0xba9c('0x4c')],[_0xba9c('0x4f'),'id'])||{});}})[_0xba9c('0x28')](respondWithResult(_0x335815,null))['catch'](handleError(_0x335815,null));};exports[_0xba9c('0x51')]=function(_0x18d649,_0x34f64d,_0x1ec6c4){var _0x4fddd9={};var _0x4c645c={};var _0x1bcbbf;var _0x58be28;return db[_0xba9c('0x2e')][_0xba9c('0x52')]({'where':{'id':_0x18d649['params']['id']}})[_0xba9c('0x28')](handleEntityNotFound(_0x34f64d,null))['then'](function(_0x288768){if(_0x288768){_0x1bcbbf=_0x288768;_0x4c645c[_0xba9c('0x30')]=_[_0xba9c('0x31')](db[_0xba9c('0x4e')][_0xba9c('0x48')]);_0x4c645c[_0xba9c('0x36')]=_['keys'](_0x18d649[_0xba9c('0x36')]);_0x4c645c[_0xba9c('0x32')]=_[_0xba9c('0x34')](_0x4c645c[_0xba9c('0x30')],_0x4c645c[_0xba9c('0x36')]);_0x4fddd9[_0xba9c('0x33')]=_['intersection'](_0x4c645c[_0xba9c('0x30')],qs['fields'](_0x18d649[_0xba9c('0x36')][_0xba9c('0x35')]));_0x4fddd9[_0xba9c('0x33')]=_0x4fddd9['attributes'][_0xba9c('0x37')]?_0x4fddd9[_0xba9c('0x33')]:_0x4c645c[_0xba9c('0x30')];_0x4fddd9[_0xba9c('0x3a')]=qs[_0xba9c('0x3b')](_0x18d649[_0xba9c('0x36')][_0xba9c('0x3b')]);_0x4fddd9[_0xba9c('0x3e')]=qs[_0xba9c('0x32')](_[_0xba9c('0x3c')](_0x18d649['query'],_0x4c645c[_0xba9c('0x32')]));if(_0x18d649[_0xba9c('0x36')][_0xba9c('0x3d')]){_0x4fddd9[_0xba9c('0x3e')]=_[_0xba9c('0x3f')](_0x4fddd9[_0xba9c('0x3e')],{'$or':_[_0xba9c('0x2d')](_0x4fddd9[_0xba9c('0x33')],function(_0x506e80){var _0x1d4f59={};_0x1d4f59[_0x506e80]={'$like':'%'+_0x18d649[_0xba9c('0x36')][_0xba9c('0x3d')]+'%'};return _0x1d4f59;})});}_0x4fddd9=_[_0xba9c('0x3f')]({},_0x4fddd9,_0x18d649[_0xba9c('0x41')]);return _0x1bcbbf[_0xba9c('0x51')](_0x4fddd9);}})['then'](function(_0x5267e3){if(_0x5267e3){_0x58be28=_0x5267e3[_0xba9c('0x37')];if(!_0x18d649[_0xba9c('0x36')]['hasOwnProperty'](_0xba9c('0x39'))){_0x4fddd9[_0xba9c('0x20')]=qs[_0xba9c('0x20')](_0x18d649[_0xba9c('0x36')][_0xba9c('0x20')]);_0x4fddd9[_0xba9c('0x21')]=qs[_0xba9c('0x21')](_0x18d649[_0xba9c('0x36')][_0xba9c('0x21')]);}return _0x1bcbbf[_0xba9c('0x51')](_0x4fddd9);}})[_0xba9c('0x28')](function(_0x2cada8){if(_0x2cada8){return _0x2cada8?{'count':_0x58be28,'rows':_0x2cada8}:null;}})[_0xba9c('0x28')](respondWithResult(_0x34f64d,null))['catch'](handleError(_0x34f64d,null));};exports[_0xba9c('0x53')]=function(_0x489d5b,_0x53aba2,_0x9f4e31){return db[_0xba9c('0x54')][_0xba9c('0x4a')]({'where':{'id':_0x489d5b['params']['id']}})[_0xba9c('0x28')](handleEntityNotFound(_0x53aba2,null))['then'](function(_0x31e963){if(_0x31e963){return _0x31e963[_0xba9c('0x53')](_0x489d5b[_0xba9c('0x4c')][_0xba9c('0x4f')],_[_0xba9c('0x50')](_0x489d5b[_0xba9c('0x4c')],['ids','id'])||{});}})[_0xba9c('0x28')](respondWithResult(_0x53aba2,null))[_0xba9c('0x45')](handleError(_0x53aba2,null));};exports[_0xba9c('0x55')]=function(_0x672bc3,_0x12cb5e,_0x358832){var _0x157396={};var _0x48f1b5={};var _0x5474e5;var _0x5842b5;return db[_0xba9c('0x2e')][_0xba9c('0x52')]({'where':{'id':_0x672bc3[_0xba9c('0x47')]['id']}})[_0xba9c('0x28')](handleEntityNotFound(_0x12cb5e,null))[_0xba9c('0x28')](function(_0x5dad59){if(_0x5dad59){_0x5474e5=_0x5dad59;_0x48f1b5[_0xba9c('0x30')]=_[_0xba9c('0x31')](db['Action'][_0xba9c('0x48')]);_0x48f1b5['query']=_['keys'](_0x672bc3[_0xba9c('0x36')]);_0x48f1b5[_0xba9c('0x32')]=_[_0xba9c('0x34')](_0x48f1b5['model'],_0x48f1b5[_0xba9c('0x36')]);_0x157396[_0xba9c('0x33')]=_[_0xba9c('0x34')](_0x48f1b5[_0xba9c('0x30')],qs[_0xba9c('0x35')](_0x672bc3[_0xba9c('0x36')][_0xba9c('0x35')]));_0x157396['attributes']=_0x157396[_0xba9c('0x33')][_0xba9c('0x37')]?_0x157396['attributes']:_0x48f1b5[_0xba9c('0x30')];_0x157396[_0xba9c('0x3a')]=qs[_0xba9c('0x3b')](_0x672bc3[_0xba9c('0x36')][_0xba9c('0x3b')]);_0x157396[_0xba9c('0x3e')]=qs[_0xba9c('0x32')](_['pick'](_0x672bc3[_0xba9c('0x36')],_0x48f1b5[_0xba9c('0x32')]));if(_0x672bc3['query'][_0xba9c('0x3d')]){_0x157396['where']=_[_0xba9c('0x3f')](_0x157396[_0xba9c('0x3e')],{'$or':_[_0xba9c('0x2d')](_0x157396[_0xba9c('0x33')],function(_0xdb922a){var _0x2d1d21={};_0x2d1d21[_0xdb922a]={'$like':'%'+_0x672bc3[_0xba9c('0x36')][_0xba9c('0x3d')]+'%'};return _0x2d1d21;})});}_0x157396=_[_0xba9c('0x3f')]({},_0x157396,_0x672bc3[_0xba9c('0x41')]);return _0x5474e5[_0xba9c('0x55')](_0x157396);}})[_0xba9c('0x28')](function(_0x20f1ad){if(_0x20f1ad){_0x5842b5=_0x20f1ad[_0xba9c('0x37')];if(!_0x672bc3[_0xba9c('0x36')][_0xba9c('0x38')]('nolimit')){_0x157396[_0xba9c('0x20')]=qs[_0xba9c('0x20')](_0x672bc3['query']['limit']);_0x157396[_0xba9c('0x21')]=qs[_0xba9c('0x21')](_0x672bc3[_0xba9c('0x36')][_0xba9c('0x21')]);}return _0x5474e5['getActions'](_0x157396);}})['then'](function(_0x6f57b5){if(_0x6f57b5){return _0x6f57b5?{'count':_0x5842b5,'rows':_0x6f57b5}:null;}})['then'](respondWithResult(_0x12cb5e,null))['catch'](handleError(_0x12cb5e,null));}; \ No newline at end of file +var _0x42ed=['index','map','Automation','rawAttributes','type','model','filters','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','addConditions','Condition','ids','omit','getConditions','findOne','addActions','Action','getActions','nolimit','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','json','apply','reject','update','then','destroy','error','stack','name','send'];(function(_0x27c4f2,_0x5d7982){var _0x49be99=function(_0x228d67){while(--_0x228d67){_0x27c4f2['push'](_0x27c4f2['shift']());}};_0x49be99(++_0x5d7982);}(_0x42ed,0x11e));var _0xd42e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x42ed[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd42e('0x0'));var zipdir=require(_0xd42e('0x1'));var jsonpatch=require(_0xd42e('0x2'));var rp=require(_0xd42e('0x3'));var moment=require(_0xd42e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd42e('0x5'));var path=require(_0xd42e('0x6'));var sox=require('sox');var csv=require(_0xd42e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd42e('0x8'));var _=require(_0xd42e('0x9'));var squel=require('squel');var crypto=require(_0xd42e('0xa'));var jsforce=require(_0xd42e('0xb'));var deskjs=require(_0xd42e('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd42e('0xd'));var Papa=require(_0xd42e('0xe'));var Redis=require('ioredis');var authService=require(_0xd42e('0xf'));var qs=require(_0xd42e('0x10'));var as=require(_0xd42e('0x11'));var hardwareService=require(_0xd42e('0x12'));var logger=require(_0xd42e('0x13'))(_0xd42e('0x14'));var utils=require(_0xd42e('0x15'));var config=require(_0xd42e('0x16'));var licenseUtil=require(_0xd42e('0x17'));var db=require(_0xd42e('0x18'))['db'];function respondWithStatusCode(_0x4504de,_0x1cfa21){_0x1cfa21=_0x1cfa21||0xcc;return function(_0x3ed605){if(_0x3ed605){return _0x4504de[_0xd42e('0x19')](_0x1cfa21);}return _0x4504de[_0xd42e('0x1a')](_0x1cfa21)[_0xd42e('0x1b')]();};}function respondWithResult(_0x149e4c,_0x2f54eb){_0x2f54eb=_0x2f54eb||0xc8;return function(_0x3d3886){if(_0x3d3886){return _0x149e4c[_0xd42e('0x1a')](_0x2f54eb)['json'](_0x3d3886);}};}function respondWithFilteredResult(_0x3cc090,_0x4d880e){return function(_0x336f1e){if(_0x336f1e){var _0x441411=typeof _0x4d880e[_0xd42e('0x1c')]===_0xd42e('0x1d')&&typeof _0x4d880e[_0xd42e('0x1e')]===_0xd42e('0x1d');var _0x10366d=_0x336f1e[_0xd42e('0x1f')];var _0x50e11e=_0x441411?0x0:_0x4d880e['offset'];var _0x3ac42d=_0x441411?_0x336f1e[_0xd42e('0x1f')]:_0x4d880e[_0xd42e('0x1c')]+_0x4d880e['limit'];var _0x403b59;if(_0x3ac42d>=_0x10366d){_0x3ac42d=_0x10366d;_0x403b59=0xc8;}else{_0x403b59=0xce;}_0x3cc090[_0xd42e('0x1a')](_0x403b59);return _0x3cc090['set']('Content-Range',_0x50e11e+'-'+_0x3ac42d+'/'+_0x10366d)[_0xd42e('0x20')](_0x336f1e);}return null;};}function patchUpdates(_0x59ce72){return function(_0x35ffe2){try{jsonpatch[_0xd42e('0x21')](_0x35ffe2,_0x59ce72,!![]);}catch(_0x474190){return BPromise[_0xd42e('0x22')](_0x474190);}return _0x35ffe2['save']();};}function saveUpdates(_0xfaf1db,_0x18646c){return function(_0x35ffcc){if(_0x35ffcc){return _0x35ffcc[_0xd42e('0x23')](_0xfaf1db)[_0xd42e('0x24')](function(_0x375e17){return _0x375e17;});}return null;};}function removeEntity(_0x24abc4,_0x51fcb5){return function(_0x36358c){if(_0x36358c){return _0x36358c[_0xd42e('0x25')]()[_0xd42e('0x24')](function(){_0x24abc4['status'](0xcc)[_0xd42e('0x1b')]();});}};}function handleEntityNotFound(_0x38fe3c,_0x27eedf){return function(_0xb32b9e){if(!_0xb32b9e){_0x38fe3c[_0xd42e('0x19')](0x194);}return _0xb32b9e;};}function handleError(_0x5ece60,_0x5b238e){_0x5b238e=_0x5b238e||0x1f4;return function(_0x34b835){logger[_0xd42e('0x26')](_0x34b835[_0xd42e('0x27')]);if(_0x34b835[_0xd42e('0x28')]){delete _0x34b835[_0xd42e('0x28')];}_0x5ece60[_0xd42e('0x1a')](_0x5b238e)[_0xd42e('0x29')](_0x34b835);};}exports[_0xd42e('0x2a')]=function(_0x4b01fa,_0x789483){var _0x19e108={},_0x40425b={},_0x4ab021={'count':0x0,'rows':[]};var _0x3af461=_[_0xd42e('0x2b')](db[_0xd42e('0x2c')][_0xd42e('0x2d')],function(_0x2daea5){return{'name':_0x2daea5['fieldName'],'type':_0x2daea5[_0xd42e('0x2e')]['key']};});_0x40425b[_0xd42e('0x2f')]=_[_0xd42e('0x2b')](_0x3af461,_0xd42e('0x28'));_0x40425b['query']=_['keys'](_0x4b01fa['query']);_0x40425b[_0xd42e('0x30')]=_['intersection'](_0x40425b[_0xd42e('0x2f')],_0x40425b[_0xd42e('0x31')]);_0x19e108[_0xd42e('0x32')]=_[_0xd42e('0x33')](_0x40425b[_0xd42e('0x2f')],qs[_0xd42e('0x34')](_0x4b01fa['query'][_0xd42e('0x34')]));_0x19e108[_0xd42e('0x32')]=_0x19e108['attributes'][_0xd42e('0x35')]?_0x19e108[_0xd42e('0x32')]:_0x40425b[_0xd42e('0x2f')];if(!_0x4b01fa[_0xd42e('0x31')][_0xd42e('0x36')]('nolimit')){_0x19e108[_0xd42e('0x1e')]=qs[_0xd42e('0x1e')](_0x4b01fa[_0xd42e('0x31')][_0xd42e('0x1e')]);_0x19e108[_0xd42e('0x1c')]=qs[_0xd42e('0x1c')](_0x4b01fa[_0xd42e('0x31')][_0xd42e('0x1c')]);}_0x19e108[_0xd42e('0x37')]=qs[_0xd42e('0x38')](_0x4b01fa['query'][_0xd42e('0x38')]);_0x19e108[_0xd42e('0x39')]=qs[_0xd42e('0x30')](_['pick'](_0x4b01fa[_0xd42e('0x31')],_0x40425b[_0xd42e('0x30')]),_0x3af461);if(_0x4b01fa[_0xd42e('0x31')][_0xd42e('0x3a')]){_0x19e108[_0xd42e('0x39')]=_[_0xd42e('0x3b')](_0x19e108[_0xd42e('0x39')],{'$or':_[_0xd42e('0x2b')](_0x3af461,function(_0x379c0f){if(_0x379c0f[_0xd42e('0x2e')]!==_0xd42e('0x3c')){var _0x2cd7d2={};_0x2cd7d2[_0x379c0f[_0xd42e('0x28')]]={'$like':'%'+_0x4b01fa[_0xd42e('0x31')]['filter']+'%'};return _0x2cd7d2;}})});}_0x19e108=_[_0xd42e('0x3b')]({},_0x19e108,_0x4b01fa[_0xd42e('0x3d')]);var _0x55de5b={'where':_0x19e108[_0xd42e('0x39')]};return db[_0xd42e('0x2c')]['count'](_0x55de5b)['then'](function(_0x27c18f){_0x4ab021[_0xd42e('0x1f')]=_0x27c18f;if(_0x4b01fa[_0xd42e('0x31')][_0xd42e('0x3e')]){_0x19e108[_0xd42e('0x3f')]=[{'all':!![]}];}return db[_0xd42e('0x2c')][_0xd42e('0x40')](_0x19e108);})['then'](function(_0x13a4f7){_0x4ab021[_0xd42e('0x41')]=_0x13a4f7;return _0x4ab021;})[_0xd42e('0x24')](respondWithFilteredResult(_0x789483,_0x19e108))[_0xd42e('0x42')](handleError(_0x789483,null));};exports['show']=function(_0x21c26f,_0xcc1a97){var _0x59c1c1={'raw':![],'where':{'id':_0x21c26f[_0xd42e('0x43')]['id']}},_0x237818={};_0x237818['model']=_[_0xd42e('0x44')](db[_0xd42e('0x2c')]['rawAttributes']);_0x237818[_0xd42e('0x31')]=_[_0xd42e('0x44')](_0x21c26f[_0xd42e('0x31')]);_0x237818[_0xd42e('0x30')]=_['intersection'](_0x237818[_0xd42e('0x2f')],_0x237818[_0xd42e('0x31')]);_0x59c1c1[_0xd42e('0x32')]=_[_0xd42e('0x33')](_0x237818[_0xd42e('0x2f')],qs[_0xd42e('0x34')](_0x21c26f[_0xd42e('0x31')]['fields']));_0x59c1c1['attributes']=_0x59c1c1[_0xd42e('0x32')][_0xd42e('0x35')]?_0x59c1c1['attributes']:_0x237818['model'];if(_0x21c26f['query'][_0xd42e('0x3e')]){_0x59c1c1['include']=[{'all':!![]}];}_0x59c1c1=_['merge']({},_0x59c1c1,_0x21c26f[_0xd42e('0x3d')]);return db['Automation'][_0xd42e('0x45')](_0x59c1c1)[_0xd42e('0x24')](handleEntityNotFound(_0xcc1a97,null))[_0xd42e('0x24')](respondWithResult(_0xcc1a97,null))[_0xd42e('0x42')](handleError(_0xcc1a97,null));};exports['create']=function(_0x49262c,_0x611906){return db[_0xd42e('0x2c')][_0xd42e('0x46')](_0x49262c[_0xd42e('0x47')],{})['then'](respondWithResult(_0x611906,0xc9))['catch'](handleError(_0x611906,null));};exports['update']=function(_0x1ed8bf,_0x32ee1f){if(_0x1ed8bf['body']['id']){delete _0x1ed8bf[_0xd42e('0x47')]['id'];}return db[_0xd42e('0x2c')]['find']({'where':{'id':_0x1ed8bf['params']['id']}})['then'](handleEntityNotFound(_0x32ee1f,null))[_0xd42e('0x24')](saveUpdates(_0x1ed8bf[_0xd42e('0x47')],null))[_0xd42e('0x24')](respondWithResult(_0x32ee1f,null))[_0xd42e('0x42')](handleError(_0x32ee1f,null));};exports[_0xd42e('0x25')]=function(_0x28ce0e,_0x5eebba){return db[_0xd42e('0x2c')][_0xd42e('0x45')]({'where':{'id':_0x28ce0e[_0xd42e('0x43')]['id']}})['then'](handleEntityNotFound(_0x5eebba,null))[_0xd42e('0x24')](removeEntity(_0x5eebba,null))['catch'](handleError(_0x5eebba,null));};exports[_0xd42e('0x48')]=function(_0x225ecb,_0x752349,_0x19202d){return db[_0xd42e('0x49')][_0xd42e('0x45')]({'where':{'id':_0x225ecb[_0xd42e('0x43')]['id']}})[_0xd42e('0x24')](handleEntityNotFound(_0x752349,null))['then'](function(_0x21ef23){if(_0x21ef23){return _0x21ef23[_0xd42e('0x48')](_0x225ecb['body'][_0xd42e('0x4a')],_[_0xd42e('0x4b')](_0x225ecb[_0xd42e('0x47')],[_0xd42e('0x4a'),'id'])||{});}})[_0xd42e('0x24')](respondWithResult(_0x752349,null))[_0xd42e('0x42')](handleError(_0x752349,null));};exports[_0xd42e('0x4c')]=function(_0x540b06,_0x21c4b7,_0x43b9f6){var _0x54e7e2={};var _0x3351fc={};var _0x17655c;var _0x1aec84;return db[_0xd42e('0x2c')][_0xd42e('0x4d')]({'where':{'id':_0x540b06[_0xd42e('0x43')]['id']}})[_0xd42e('0x24')](handleEntityNotFound(_0x21c4b7,null))[_0xd42e('0x24')](function(_0x5135c1){if(_0x5135c1){_0x17655c=_0x5135c1;_0x3351fc[_0xd42e('0x2f')]=_[_0xd42e('0x44')](db[_0xd42e('0x49')]['rawAttributes']);_0x3351fc[_0xd42e('0x31')]=_['keys'](_0x540b06['query']);_0x3351fc[_0xd42e('0x30')]=_[_0xd42e('0x33')](_0x3351fc[_0xd42e('0x2f')],_0x3351fc['query']);_0x54e7e2[_0xd42e('0x32')]=_[_0xd42e('0x33')](_0x3351fc['model'],qs[_0xd42e('0x34')](_0x540b06[_0xd42e('0x31')][_0xd42e('0x34')]));_0x54e7e2[_0xd42e('0x32')]=_0x54e7e2[_0xd42e('0x32')]['length']?_0x54e7e2[_0xd42e('0x32')]:_0x3351fc['model'];_0x54e7e2[_0xd42e('0x37')]=qs[_0xd42e('0x38')](_0x540b06[_0xd42e('0x31')][_0xd42e('0x38')]);_0x54e7e2[_0xd42e('0x39')]=qs[_0xd42e('0x30')](_['pick'](_0x540b06[_0xd42e('0x31')],_0x3351fc['filters']));if(_0x540b06[_0xd42e('0x31')][_0xd42e('0x3a')]){_0x54e7e2[_0xd42e('0x39')]=_[_0xd42e('0x3b')](_0x54e7e2['where'],{'$or':_[_0xd42e('0x2b')](_0x54e7e2[_0xd42e('0x32')],function(_0x4e8406){var _0x5cf2f0={};_0x5cf2f0[_0x4e8406]={'$like':'%'+_0x540b06[_0xd42e('0x31')]['filter']+'%'};return _0x5cf2f0;})});}_0x54e7e2=_[_0xd42e('0x3b')]({},_0x54e7e2,_0x540b06[_0xd42e('0x3d')]);return _0x17655c[_0xd42e('0x4c')](_0x54e7e2);}})[_0xd42e('0x24')](function(_0x88fa44){if(_0x88fa44){_0x1aec84=_0x88fa44[_0xd42e('0x35')];if(!_0x540b06['query'][_0xd42e('0x36')]('nolimit')){_0x54e7e2[_0xd42e('0x1e')]=qs[_0xd42e('0x1e')](_0x540b06[_0xd42e('0x31')]['limit']);_0x54e7e2[_0xd42e('0x1c')]=qs[_0xd42e('0x1c')](_0x540b06[_0xd42e('0x31')]['offset']);}return _0x17655c['getConditions'](_0x54e7e2);}})[_0xd42e('0x24')](function(_0x2f9d11){if(_0x2f9d11){return _0x2f9d11?{'count':_0x1aec84,'rows':_0x2f9d11}:null;}})[_0xd42e('0x24')](respondWithResult(_0x21c4b7,null))['catch'](handleError(_0x21c4b7,null));};exports[_0xd42e('0x4e')]=function(_0x5588cf,_0x2d6c85,_0x2c3de1){return db[_0xd42e('0x4f')][_0xd42e('0x45')]({'where':{'id':_0x5588cf['params']['id']}})[_0xd42e('0x24')](handleEntityNotFound(_0x2d6c85,null))[_0xd42e('0x24')](function(_0x2b0957){if(_0x2b0957){return _0x2b0957[_0xd42e('0x4e')](_0x5588cf[_0xd42e('0x47')][_0xd42e('0x4a')],_['omit'](_0x5588cf[_0xd42e('0x47')],[_0xd42e('0x4a'),'id'])||{});}})[_0xd42e('0x24')](respondWithResult(_0x2d6c85,null))[_0xd42e('0x42')](handleError(_0x2d6c85,null));};exports[_0xd42e('0x50')]=function(_0xb3497,_0x4e205c,_0xdda171){var _0xfa514a={};var _0x24e3e0={};var _0x287d6e;var _0x3ffc88;return db[_0xd42e('0x2c')]['findOne']({'where':{'id':_0xb3497[_0xd42e('0x43')]['id']}})['then'](handleEntityNotFound(_0x4e205c,null))['then'](function(_0x21734b){if(_0x21734b){_0x287d6e=_0x21734b;_0x24e3e0[_0xd42e('0x2f')]=_[_0xd42e('0x44')](db[_0xd42e('0x4f')][_0xd42e('0x2d')]);_0x24e3e0[_0xd42e('0x31')]=_[_0xd42e('0x44')](_0xb3497[_0xd42e('0x31')]);_0x24e3e0[_0xd42e('0x30')]=_[_0xd42e('0x33')](_0x24e3e0[_0xd42e('0x2f')],_0x24e3e0[_0xd42e('0x31')]);_0xfa514a[_0xd42e('0x32')]=_[_0xd42e('0x33')](_0x24e3e0[_0xd42e('0x2f')],qs[_0xd42e('0x34')](_0xb3497[_0xd42e('0x31')][_0xd42e('0x34')]));_0xfa514a[_0xd42e('0x32')]=_0xfa514a[_0xd42e('0x32')][_0xd42e('0x35')]?_0xfa514a[_0xd42e('0x32')]:_0x24e3e0[_0xd42e('0x2f')];_0xfa514a[_0xd42e('0x37')]=qs[_0xd42e('0x38')](_0xb3497['query'][_0xd42e('0x38')]);_0xfa514a[_0xd42e('0x39')]=qs['filters'](_['pick'](_0xb3497[_0xd42e('0x31')],_0x24e3e0[_0xd42e('0x30')]));if(_0xb3497[_0xd42e('0x31')][_0xd42e('0x3a')]){_0xfa514a[_0xd42e('0x39')]=_[_0xd42e('0x3b')](_0xfa514a['where'],{'$or':_[_0xd42e('0x2b')](_0xfa514a[_0xd42e('0x32')],function(_0x18ce9c){var _0x3ba5de={};_0x3ba5de[_0x18ce9c]={'$like':'%'+_0xb3497[_0xd42e('0x31')][_0xd42e('0x3a')]+'%'};return _0x3ba5de;})});}_0xfa514a=_['merge']({},_0xfa514a,_0xb3497[_0xd42e('0x3d')]);return _0x287d6e['getActions'](_0xfa514a);}})[_0xd42e('0x24')](function(_0x451ce2){if(_0x451ce2){_0x3ffc88=_0x451ce2[_0xd42e('0x35')];if(!_0xb3497[_0xd42e('0x31')][_0xd42e('0x36')](_0xd42e('0x51'))){_0xfa514a['limit']=qs[_0xd42e('0x1e')](_0xb3497['query'][_0xd42e('0x1e')]);_0xfa514a[_0xd42e('0x1c')]=qs[_0xd42e('0x1c')](_0xb3497[_0xd42e('0x31')]['offset']);}return _0x287d6e[_0xd42e('0x50')](_0xfa514a);}})['then'](function(_0x534665){if(_0x534665){return _0x534665?{'count':_0x3ffc88,'rows':_0x534665}:null;}})[_0xd42e('0x24')](respondWithResult(_0x4e205c,null))['catch'](handleError(_0x4e205c,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index e70e0b4..74c4225 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 _0x46cd=['rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x32e4de,_0x7da1c5){var _0x51ba2a=function(_0x2a7322){while(--_0x2a7322){_0x32e4de['push'](_0x32e4de['shift']());}};_0x51ba2a(++_0x7da1c5);}(_0x46cd,0xd7));var _0xd46c=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0x46cd[_0x616290];return _0x453879;};'use strict';var _=require(_0xd46c('0x0'));var util=require(_0xd46c('0x1'));var logger=require(_0xd46c('0x2'))('api');var moment=require(_0xd46c('0x3'));var BPromise=require('bluebird');var rp=require(_0xd46c('0x4'));var fs=require('fs');var path=require(_0xd46c('0x5'));var rimraf=require(_0xd46c('0x6'));var config=require(_0xd46c('0x7'));var attributes=require(_0xd46c('0x8'));module[_0xd46c('0x9')]=function(_0xdb3d5a,_0x576568){return _0xdb3d5a[_0xd46c('0xa')](_0xd46c('0xb'),attributes,{'tableName':_0xd46c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x76b6=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define','Automation','tools_automations','lodash'];(function(_0xa77cc9,_0x3df827){var _0x55d0d5=function(_0x5a2a39){while(--_0x5a2a39){_0xa77cc9['push'](_0xa77cc9['shift']());}};_0x55d0d5(++_0x3df827);}(_0x76b6,0x173));var _0x676b=function(_0x25878e,_0x5b4169){_0x25878e=_0x25878e-0x0;var _0x284151=_0x76b6[_0x25878e];return _0x284151;};'use strict';var _=require(_0x676b('0x0'));var util=require(_0x676b('0x1'));var logger=require(_0x676b('0x2'))(_0x676b('0x3'));var moment=require(_0x676b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x676b('0x5'));var rimraf=require(_0x676b('0x6'));var config=require(_0x676b('0x7'));var attributes=require('./automation.attributes');module[_0x676b('0x8')]=function(_0x34d3dc,_0x4ce692){return _0x34d3dc[_0x676b('0x9')](_0x676b('0xa'),attributes,{'tableName':_0x676b('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 ad0a486..0136c65 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 _0x86c0=['Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','Automation,\x20%s,\x20%s','message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','debug'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0x86c0,0x133));var _0x086c=function(_0x5d4205,_0x135eaa){_0x5d4205=_0x5d4205-0x0;var _0x3ff943=_0x86c0[_0x5d4205];return _0x3ff943;};'use strict';var _=require(_0x086c('0x0'));var util=require('util');var moment=require(_0x086c('0x1'));var BPromise=require(_0x086c('0x2'));var rs=require(_0x086c('0x3'));var fs=require('fs');var Redis=require(_0x086c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x086c('0x5'));var logger=require(_0x086c('0x6'))(_0x086c('0x7'));var config=require(_0x086c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x086c('0x9')][_0x086c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e27a8,_0x387428,_0x117df9){return new BPromise(function(_0x25e437,_0x52b942){return client[_0x086c('0xb')](_0x2e27a8,_0x117df9)[_0x086c('0xc')](function(_0xa1b79a){logger['info']('Automation,\x20%s,\x20%s',_0x387428,_0x086c('0xd'));logger[_0x086c('0xe')](_0x086c('0xf'),_0x387428,_0x086c('0xd'),JSON[_0x086c('0x10')](_0xa1b79a));if(_0xa1b79a['error']){if(_0xa1b79a[_0x086c('0x11')][_0x086c('0x12')]===0x1f4){logger[_0x086c('0x11')](_0x086c('0x13'),_0x387428,_0xa1b79a['error']['message']);return _0x52b942(_0xa1b79a[_0x086c('0x11')]['message']);}logger[_0x086c('0x11')](_0x086c('0x13'),_0x387428,_0xa1b79a['error'][_0x086c('0x14')]);return _0x25e437(_0xa1b79a[_0x086c('0x11')][_0x086c('0x14')]);}else{logger[_0x086c('0x15')]('Automation,\x20%s,\x20%s',_0x387428,_0x086c('0xd'));_0x25e437(_0xa1b79a[_0x086c('0x16')][_0x086c('0x14')]);}})['catch'](function(_0x34e74f){logger[_0x086c('0x11')](_0x086c('0x13'),_0x387428,_0x34e74f);_0x52b942(_0x34e74f);});});} \ No newline at end of file +var _0x6c00=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5dd853,_0x562937){var _0x2b172f=function(_0x56b80f){while(--_0x56b80f){_0x5dd853['push'](_0x5dd853['shift']());}};_0x2b172f(++_0x562937);}(_0x6c00,0x1a9));var _0x06c0=function(_0x473738,_0x15ea31){_0x473738=_0x473738-0x0;var _0x1df4ae=_0x6c00[_0x473738];return _0x1df4ae;};'use strict';var _=require(_0x06c0('0x0'));var util=require(_0x06c0('0x1'));var moment=require(_0x06c0('0x2'));var BPromise=require('bluebird');var rs=require(_0x06c0('0x3'));var fs=require('fs');var Redis=require(_0x06c0('0x4'));var db=require(_0x06c0('0x5'))['db'];var utils=require(_0x06c0('0x6'));var logger=require('../../config/logger')(_0x06c0('0x7'));var config=require(_0x06c0('0x8'));var jayson=require(_0x06c0('0x9'));var client=jayson[_0x06c0('0xa')][_0x06c0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5978d1,_0x5a686f,_0x46f544){return new BPromise(function(_0x257556,_0x5f2ac0){return client[_0x06c0('0xc')](_0x5978d1,_0x46f544)[_0x06c0('0xd')](function(_0x2c1f22){logger[_0x06c0('0xe')](_0x06c0('0xf'),_0x5a686f,_0x06c0('0x10'));logger[_0x06c0('0x11')](_0x06c0('0x12'),_0x5a686f,_0x06c0('0x10'),JSON[_0x06c0('0x13')](_0x2c1f22));if(_0x2c1f22[_0x06c0('0x14')]){if(_0x2c1f22['error']['code']===0x1f4){logger[_0x06c0('0x14')](_0x06c0('0xf'),_0x5a686f,_0x2c1f22[_0x06c0('0x14')][_0x06c0('0x15')]);return _0x5f2ac0(_0x2c1f22[_0x06c0('0x14')]['message']);}logger['error'](_0x06c0('0xf'),_0x5a686f,_0x2c1f22[_0x06c0('0x14')][_0x06c0('0x15')]);return _0x257556(_0x2c1f22[_0x06c0('0x14')][_0x06c0('0x15')]);}else{logger[_0x06c0('0xe')](_0x06c0('0xf'),_0x5a686f,'request\x20sent');_0x257556(_0x2c1f22[_0x06c0('0x16')][_0x06c0('0x15')]);}})[_0x06c0('0x17')](function(_0x2dd969){logger[_0x06c0('0x14')]('Automation,\x20%s,\x20%s',_0x5a686f,_0x2dd969);_0x5f2ac0(_0x2dd969);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index a8b7a98..11cc512 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 _0x207d=['./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','/:id/actions','create','post','addActions','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x14e67a,_0x2f62a3){var _0x2e53be=function(_0x5d27ea){while(--_0x5d27ea){_0x14e67a['push'](_0x14e67a['shift']());}};_0x2e53be(++_0x2f62a3);}(_0x207d,0x10d));var _0xd207=function(_0x2a29de,_0x1acca3){_0x2a29de=_0x2a29de-0x0;var _0x1e31f3=_0x207d[_0x2a29de];return _0x1e31f3;};'use strict';var multer=require(_0xd207('0x0'));var util=require(_0xd207('0x1'));var path=require(_0xd207('0x2'));var timeout=require(_0xd207('0x3'));var express=require('express');var router=express[_0xd207('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd207('0x5'));var interaction=require(_0xd207('0x6'));var config=require('../../config/environment');var controller=require(_0xd207('0x7'));router[_0xd207('0x8')]('/',auth[_0xd207('0x9')](),controller[_0xd207('0xa')]);router[_0xd207('0x8')](_0xd207('0xb'),auth[_0xd207('0x9')](),controller[_0xd207('0xc')]);router[_0xd207('0x8')](_0xd207('0xd'),auth[_0xd207('0x9')](),controller['getConditions']);router[_0xd207('0x8')](_0xd207('0xe'),auth[_0xd207('0x9')](),controller['getActions']);router['post']('/',auth[_0xd207('0x9')](),controller[_0xd207('0xf')]);router[_0xd207('0x10')]('/:id/conditions',auth[_0xd207('0x9')](),controller['addConditions']);router['post']('/:id/actions',auth[_0xd207('0x9')](),controller[_0xd207('0x11')]);router[_0xd207('0x12')](_0xd207('0xb'),auth[_0xd207('0x9')](),controller[_0xd207('0x13')]);router[_0xd207('0x14')](_0xd207('0xb'),auth[_0xd207('0x9')](),controller[_0xd207('0x15')]);module[_0xd207('0x16')]=router; \ No newline at end of file +var _0x26ed=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','/:id','show','getConditions','/:id/actions','post','create','/:id/conditions','addConditions','addActions','put','update','delete','destroy','exports','multer','path','connect-timeout','Router'];(function(_0x711bc2,_0x43a478){var _0x34fa5d=function(_0x5b3f2c){while(--_0x5b3f2c){_0x711bc2['push'](_0x711bc2['shift']());}};_0x34fa5d(++_0x43a478);}(_0x26ed,0x1f0));var _0xd26e=function(_0x26ac27,_0x574b86){_0x26ac27=_0x26ac27-0x0;var _0x44a599=_0x26ed[_0x26ac27];return _0x44a599;};'use strict';var multer=require(_0xd26e('0x0'));var util=require('util');var path=require(_0xd26e('0x1'));var timeout=require(_0xd26e('0x2'));var express=require('express');var router=express[_0xd26e('0x3')]();var fs_extra=require(_0xd26e('0x4'));var auth=require(_0xd26e('0x5'));var interaction=require(_0xd26e('0x6'));var config=require(_0xd26e('0x7'));var controller=require(_0xd26e('0x8'));router[_0xd26e('0x9')]('/',auth[_0xd26e('0xa')](),controller['index']);router[_0xd26e('0x9')](_0xd26e('0xb'),auth[_0xd26e('0xa')](),controller[_0xd26e('0xc')]);router[_0xd26e('0x9')]('/:id/conditions',auth[_0xd26e('0xa')](),controller[_0xd26e('0xd')]);router[_0xd26e('0x9')](_0xd26e('0xe'),auth[_0xd26e('0xa')](),controller['getActions']);router[_0xd26e('0xf')]('/',auth['isAuthenticated'](),controller[_0xd26e('0x10')]);router[_0xd26e('0xf')](_0xd26e('0x11'),auth['isAuthenticated'](),controller[_0xd26e('0x12')]);router[_0xd26e('0xf')](_0xd26e('0xe'),auth[_0xd26e('0xa')](),controller[_0xd26e('0x13')]);router[_0xd26e('0x14')](_0xd26e('0xb'),auth[_0xd26e('0xa')](),controller[_0xd26e('0x15')]);router[_0xd26e('0x16')](_0xd26e('0xb'),auth[_0xd26e('0xa')](),controller[_0xd26e('0x17')]);module[_0xd26e('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 08215f1..068014f 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 _0x2838=['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\x20Maximum\x20Word\x20Length','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','#Congestion\x20Retry\x20(min:1,\x20max:999)','INTEGER','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)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'];(function(_0x383dbb,_0x17d41b){var _0x6e8bde=function(_0x2740f1){while(--_0x2740f1){_0x383dbb['push'](_0x383dbb['shift']());}};_0x6e8bde(++_0x17d41b);}(_0x2838,0x146));var _0x8283=function(_0x1aa0e7,_0x498fbd){_0x1aa0e7=_0x1aa0e7-0x0;var _0x55f771=_0x2838[_0x1aa0e7];return _0x55f771;};'use strict';var Sequelize=require(_0x8283('0x0'));module[_0x8283('0x1')]={'name':{'type':Sequelize[_0x8283('0x2')],'unique':_0x8283('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x8283('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x8283('0x2')]},'active':{'type':Sequelize[_0x8283('0x5')],'defaultValue':0x0,'comment':_0x8283('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x8283('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x8283('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x8283('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x8283('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8283('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8283('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x8283('0xa')](0x5)[_0x8283('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8283('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x8283('0xa')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x8283('0xa')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8283('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x8283('0xa')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x8283('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8283('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8283('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x8283('0xa')](0x3)[_0x8283('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x8283('0xf')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x8283('0x10')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x8283('0x11'),_0x8283('0x12'),_0x8283('0x13')),'defaultValue':_0x8283('0x11')},'dialAMDActive':{'type':Sequelize[_0x8283('0x5')],'defaultValue':0x0,'comment':_0x8283('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0x8283('0xa')](0x9)[_0x8283('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x8283('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x8283('0xa')](0x9)[_0x8283('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x8283('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x8283('0xa')](0x9)[_0x8283('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x8283('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x8283('0xa')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8283('0x18')},'dialAMDMinWordLength':{'type':Sequelize[_0x8283('0xa')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x8283('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x8283('0xa')](0x9)[_0x8283('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x8283('0x1a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x8283('0xa')](0x9)[_0x8283('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x8283('0xa')](0x5)[_0x8283('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x8283('0xa')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8283('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x8283('0x1c'),_0x8283('0x1d')),'defaultValue':_0x8283('0x1c')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x8283('0xa')](0x3)[_0x8283('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x8283('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8283('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8283('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8283('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8283('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0x8283('0xa')](0x3)[_0x8283('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x8283('0xa')](0x5)[_0x8283('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x8283('0xa')](0x3)[_0x8283('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8283('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x8283('0xa')](0x5)[_0x8283('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8283('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0x8283('0xa')](0x3)[_0x8283('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8283('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0x8283('0xa')](0x5)[_0x8283('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8283('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x8283('0xa')](0x3)[_0x8283('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8283('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x8283('0xa')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file +var _0x6b68=['INTEGER','#Congestion\x20Retry\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)','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','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)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'];(function(_0x221418,_0x92a8bf){var _0x475b33=function(_0x394578){while(--_0x394578){_0x221418['push'](_0x221418['shift']());}};_0x475b33(++_0x92a8bf);}(_0x6b68,0x1be));var _0x86b6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6b68[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x86b6('0x0'));module[_0x86b6('0x1')]={'name':{'type':Sequelize[_0x86b6('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x86b6('0x3')]('ivr'),'allowNull':![],'defaultValue':_0x86b6('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x86b6('0x5')],'defaultValue':0x0,'comment':_0x86b6('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x86b6('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x86b6('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x86b6('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x86b6('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x86b6('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x86b6('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x86b6('0xa')](0x3)[_0x86b6('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x86b6('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x86b6('0xa')](0x5)[_0x86b6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x86b6('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x86b6('0xa')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x86b6('0xa')](0x5)[_0x86b6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x86b6('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x86b6('0xa')](0x3)[_0x86b6('0x7')],'defaultValue':0x3,'comment':_0x86b6('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x86b6('0xa')](0x5)[_0x86b6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x86b6('0xa')](0x3)[_0x86b6('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x86b6('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x86b6('0x3')](_0x86b6('0xf'),_0x86b6('0x10'),'onlyIfOpen'),'defaultValue':_0x86b6('0xf')},'dialAMDActive':{'type':Sequelize[_0x86b6('0x5')],'defaultValue':0x0,'comment':_0x86b6('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0x86b6('0xa')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x86b6('0x12')},'dialAMDGreeting':{'type':Sequelize[_0x86b6('0xa')](0x9)[_0x86b6('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x86b6('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x86b6('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x86b6('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x86b6('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x86b6('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0x86b6('0xa')](0x9)[_0x86b6('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x86b6('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x86b6('0xa')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x86b6('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x86b6('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x86b6('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x86b6('0xa')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x86b6('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0x86b6('0x3')](_0x86b6('0x1a'),_0x86b6('0x1b')),'defaultValue':_0x86b6('0x1a')},'dialPrefix':{'type':Sequelize[_0x86b6('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x86b6('0xa')](0x3)[_0x86b6('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x86b6('0x1c')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x86b6('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x86b6('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x86b6('0xa')](0x3)[_0x86b6('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x86b6('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x86b6('0xa')](0x5)[_0x86b6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x86b6('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0x86b6('0xa')](0x3)[_0x86b6('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x86b6('0x20')},'dialDropRetryFrequency':{'type':Sequelize[_0x86b6('0xa')](0x5)[_0x86b6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x86b6('0xa')](0x3)[_0x86b6('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x86b6('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x86b6('0xa')](0x5)[_0x86b6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x86b6('0x22')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x86b6('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x86b6('0x23')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x86b6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x86b6('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x86b6('0xa')](0x3)[_0x86b6('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x86b6('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x86b6('0xa')](0x5)[_0x86b6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 7d6fcb6..dc044f6 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 _0x3f8c=['IvrCampaigns','UserProfileResource','destroy','error','stack','name','index','map','Campaign','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','role','userProfileId','params','getHoppers','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','findOne','CampaignId','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','phone','scheduledAt','ContactId','ListId','createdAt','select','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','fromQuery','ListId\x20=\x20?','cm_hopper_additional_phones','cmHopperId','h.id','ci.OrderBY','OrderBy','cm_contact_has_items','join','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','zip-dir','fast-json-patch','request-promise','moment','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','Content-Range','reject','save','update','then'];(function(_0x4cfcbf,_0x7804a2){var _0x152d90=function(_0x17e3af){while(--_0x17e3af){_0x4cfcbf['push'](_0x4cfcbf['shift']());}};_0x152d90(++_0x7804a2);}(_0x3f8c,0x104));var _0xc3f8=function(_0x44bf69,_0x34269d){_0x44bf69=_0x44bf69-0x0;var _0x2c9cb6=_0x3f8c[_0x44bf69];return _0x2c9cb6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc3f8('0x0'));var jsonpatch=require(_0xc3f8('0x1'));var rp=require(_0xc3f8('0x2'));var moment=require(_0xc3f8('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xc3f8('0x4'));var ejs=require(_0xc3f8('0x5'));var fs=require('fs');var fs_extra=require(_0xc3f8('0x6'));var _=require(_0xc3f8('0x7'));var squel=require(_0xc3f8('0x8'));var crypto=require(_0xc3f8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xc3f8('0xa'));var toCsv=require(_0xc3f8('0x4'));var querystring=require(_0xc3f8('0xb'));var Papa=require(_0xc3f8('0xc'));var Redis=require(_0xc3f8('0xd'));var authService=require(_0xc3f8('0xe'));var qs=require(_0xc3f8('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc3f8('0x10'));var logger=require(_0xc3f8('0x11'))(_0xc3f8('0x12'));var utils=require(_0xc3f8('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xc3f8('0x14'));var db=require(_0xc3f8('0x15'))['db'];function respondWithStatusCode(_0x256e3d,_0x155c80){_0x155c80=_0x155c80||0xcc;return function(_0x511763){if(_0x511763){return _0x256e3d[_0xc3f8('0x16')](_0x155c80);}return _0x256e3d[_0xc3f8('0x17')](_0x155c80)[_0xc3f8('0x18')]();};}function respondWithResult(_0x44632a,_0x6155e9){_0x6155e9=_0x6155e9||0xc8;return function(_0x47754c){if(_0x47754c){return _0x44632a[_0xc3f8('0x17')](_0x6155e9)[_0xc3f8('0x19')](_0x47754c);}};}function respondWithFilteredResult(_0x12b141,_0x2fd8e8){return function(_0x3cb28a){if(_0x3cb28a){var _0x2a9f64=typeof _0x2fd8e8[_0xc3f8('0x1a')]==='undefined'&&typeof _0x2fd8e8[_0xc3f8('0x1b')]==='undefined';var _0x51807b=_0x3cb28a[_0xc3f8('0x1c')];var _0x2e7c0f=_0x2a9f64?0x0:_0x2fd8e8[_0xc3f8('0x1a')];var _0xb4ab67=_0x2a9f64?_0x3cb28a['count']:_0x2fd8e8[_0xc3f8('0x1a')]+_0x2fd8e8[_0xc3f8('0x1b')];var _0x5df6f9;if(_0xb4ab67>=_0x51807b){_0xb4ab67=_0x51807b;_0x5df6f9=0xc8;}else{_0x5df6f9=0xce;}_0x12b141[_0xc3f8('0x17')](_0x5df6f9);return _0x12b141['set'](_0xc3f8('0x1d'),_0x2e7c0f+'-'+_0xb4ab67+'/'+_0x51807b)[_0xc3f8('0x19')](_0x3cb28a);}return null;};}function patchUpdates(_0x3b2e98){return function(_0x53ada5){try{jsonpatch['apply'](_0x53ada5,_0x3b2e98,!![]);}catch(_0x113cd2){return BPromise[_0xc3f8('0x1e')](_0x113cd2);}return _0x53ada5[_0xc3f8('0x1f')]();};}function saveUpdates(_0x25a4c7,_0x6522e9){return function(_0x251bf7){if(_0x251bf7){return _0x251bf7[_0xc3f8('0x20')](_0x25a4c7)[_0xc3f8('0x21')](function(_0x49aeea){return _0x49aeea;});}return null;};}function removeEntity(_0x571f92,_0x4b83f0){return function(_0x2559a4){if(_0x2559a4){return _0x2559a4['destroy']()[_0xc3f8('0x21')](function(){var _0x3f196d=_0x2559a4['get']({'plain':!![]});var _0x4569c2=_0xc3f8('0x22');return db[_0xc3f8('0x23')][_0xc3f8('0x24')]({'where':{'type':_0x4569c2,'resourceId':_0x3f196d['id']}})[_0xc3f8('0x21')](function(){return _0x2559a4;});})[_0xc3f8('0x21')](function(){_0x571f92[_0xc3f8('0x17')](0xcc)[_0xc3f8('0x18')]();});}};}function handleEntityNotFound(_0x21b002,_0xbea3b8){return function(_0x22c8e6){if(!_0x22c8e6){_0x21b002[_0xc3f8('0x16')](0x194);}return _0x22c8e6;};}function handleError(_0x238ff5,_0x429fd8){_0x429fd8=_0x429fd8||0x1f4;return function(_0x59e4dd){logger[_0xc3f8('0x25')](_0x59e4dd[_0xc3f8('0x26')]);if(_0x59e4dd[_0xc3f8('0x27')]){delete _0x59e4dd['name'];}_0x238ff5[_0xc3f8('0x17')](_0x429fd8)['send'](_0x59e4dd);};}exports[_0xc3f8('0x28')]=function(_0x32343e,_0x47ab53){var _0x48b32e={},_0x21a225={},_0x25df65={'count':0x0,'rows':[]};var _0xd32b09=_[_0xc3f8('0x29')](db[_0xc3f8('0x2a')][_0xc3f8('0x2b')],function(_0x680047){return{'name':_0x680047[_0xc3f8('0x2c')],'type':_0x680047[_0xc3f8('0x2d')][_0xc3f8('0x2e')]};});_0x21a225['model']=_[_0xc3f8('0x29')](_0xd32b09,_0xc3f8('0x27'));_0x21a225[_0xc3f8('0x2f')]=_[_0xc3f8('0x30')](_0x32343e[_0xc3f8('0x2f')]);_0x21a225['filters']=_['intersection'](_0x21a225[_0xc3f8('0x31')],_0x21a225[_0xc3f8('0x2f')]);_0x48b32e[_0xc3f8('0x32')]=_[_0xc3f8('0x33')](_0x21a225[_0xc3f8('0x31')],qs['fields'](_0x32343e[_0xc3f8('0x2f')][_0xc3f8('0x34')]));_0x48b32e[_0xc3f8('0x32')]=_0x48b32e['attributes'][_0xc3f8('0x35')]?_0x48b32e[_0xc3f8('0x32')]:_0x21a225[_0xc3f8('0x31')];if(!_0x32343e['query'][_0xc3f8('0x36')](_0xc3f8('0x37'))){_0x48b32e['limit']=qs[_0xc3f8('0x1b')](_0x32343e[_0xc3f8('0x2f')][_0xc3f8('0x1b')]);_0x48b32e[_0xc3f8('0x1a')]=qs[_0xc3f8('0x1a')](_0x32343e[_0xc3f8('0x2f')]['offset']);}_0x48b32e[_0xc3f8('0x38')]=qs[_0xc3f8('0x39')](_0x32343e[_0xc3f8('0x2f')][_0xc3f8('0x39')]);_0x48b32e[_0xc3f8('0x3a')]=qs['filters'](_[_0xc3f8('0x3b')](_0x32343e[_0xc3f8('0x2f')],_0x21a225[_0xc3f8('0x3c')]),_0xd32b09);if(_0x32343e['query'][_0xc3f8('0x3d')]){_0x48b32e[_0xc3f8('0x3a')]=_[_0xc3f8('0x3e')](_0x48b32e[_0xc3f8('0x3a')],{'$or':_['map'](_0xd32b09,function(_0x306182){if(_0x306182[_0xc3f8('0x2d')]!==_0xc3f8('0x3f')){var _0x37b104={};_0x37b104[_0x306182['name']]={'$like':'%'+_0x32343e[_0xc3f8('0x2f')]['filter']+'%'};return _0x37b104;}})});}_0x48b32e=_['merge']({},_0x48b32e,_0x32343e[_0xc3f8('0x40')]);var _0x1f3aef={'where':_0x48b32e[_0xc3f8('0x3a')]};return db[_0xc3f8('0x2a')]['count'](_0x1f3aef)['then'](function(_0x361a85){_0x25df65[_0xc3f8('0x1c')]=_0x361a85;if(_0x32343e[_0xc3f8('0x2f')][_0xc3f8('0x41')]){_0x48b32e[_0xc3f8('0x42')]=[{'all':!![]}];}return db[_0xc3f8('0x2a')][_0xc3f8('0x43')](_0x48b32e);})[_0xc3f8('0x21')](function(_0x13d8dc){_0x25df65[_0xc3f8('0x44')]=_0x13d8dc;return _0x25df65;})[_0xc3f8('0x21')](respondWithFilteredResult(_0x47ab53,_0x48b32e))['catch'](handleError(_0x47ab53,null));};exports[_0xc3f8('0x45')]=function(_0x22e9b3,_0x4b327f){var _0x1aff20={'raw':![],'where':{'id':_0x22e9b3['params']['id']}},_0x172f1a={};_0x172f1a[_0xc3f8('0x31')]=_[_0xc3f8('0x30')](db[_0xc3f8('0x2a')][_0xc3f8('0x2b')]);_0x172f1a[_0xc3f8('0x2f')]=_[_0xc3f8('0x30')](_0x22e9b3[_0xc3f8('0x2f')]);_0x172f1a[_0xc3f8('0x3c')]=_[_0xc3f8('0x33')](_0x172f1a[_0xc3f8('0x31')],_0x172f1a[_0xc3f8('0x2f')]);_0x1aff20['attributes']=_[_0xc3f8('0x33')](_0x172f1a[_0xc3f8('0x31')],qs['fields'](_0x22e9b3[_0xc3f8('0x2f')][_0xc3f8('0x34')]));_0x1aff20[_0xc3f8('0x32')]=_0x1aff20[_0xc3f8('0x32')]['length']?_0x1aff20['attributes']:_0x172f1a[_0xc3f8('0x31')];if(_0x22e9b3[_0xc3f8('0x2f')][_0xc3f8('0x41')]){_0x1aff20['include']=[{'all':!![]}];}_0x1aff20=_[_0xc3f8('0x3e')]({},_0x1aff20,_0x22e9b3[_0xc3f8('0x40')]);return db[_0xc3f8('0x2a')][_0xc3f8('0x46')](_0x1aff20)[_0xc3f8('0x21')](handleEntityNotFound(_0x4b327f,null))['then'](respondWithResult(_0x4b327f,null))[_0xc3f8('0x47')](handleError(_0x4b327f,null));};exports[_0xc3f8('0x48')]=function(_0x5961ab,_0x1becae){return db[_0xc3f8('0x2a')][_0xc3f8('0x48')](_0x5961ab[_0xc3f8('0x49')],{})[_0xc3f8('0x21')](function(_0x3045bc){var _0x1ca7c9=_0x5961ab['user'][_0xc3f8('0x4a')]({'plain':!![]});if(!_0x1ca7c9)throw new Error(_0xc3f8('0x4b'));if(_0x1ca7c9['role']===_0xc3f8('0x4c')){var _0x2e9f93=_0x3045bc[_0xc3f8('0x4a')]({'plain':!![]});var _0x33e5c5=_0xc3f8('0x22');return db[_0xc3f8('0x4d')][_0xc3f8('0x46')]({'where':{'name':_0x33e5c5,'userProfileId':_0x1ca7c9['userProfileId']},'raw':!![]})[_0xc3f8('0x21')](function(_0x2c6999){if(_0x2c6999&&_0x2c6999[_0xc3f8('0x4e')]===0x0){return db[_0xc3f8('0x23')][_0xc3f8('0x48')]({'name':_0x2e9f93[_0xc3f8('0x27')],'resourceId':_0x2e9f93['id'],'type':_0x2c6999[_0xc3f8('0x27')],'sectionId':_0x2c6999['id']},{})[_0xc3f8('0x21')](function(){return _0x3045bc;});}else{return _0x3045bc;}})['catch'](function(_0x51249a){logger[_0xc3f8('0x25')](_0xc3f8('0x4f'),_0x51249a);throw _0x51249a;});}return _0x3045bc;})['then'](respondWithResult(_0x1becae,0xc9))['catch'](handleError(_0x1becae,null));};exports[_0xc3f8('0x50')]=function(_0x4b4adb,_0x1b1e13){var _0xf1e0a6={'where':{'id':_0x4b4adb['params']['id']}},_0x1d95f5={};_0x1d95f5[_0xc3f8('0x31')]=_['keys'](db['Campaign'][_0xc3f8('0x2b')]);_0xf1e0a6['attributes']=_[_0xc3f8('0x33')](_0x1d95f5[_0xc3f8('0x31')],qs[_0xc3f8('0x34')](_0x4b4adb['query'][_0xc3f8('0x34')]));_0xf1e0a6[_0xc3f8('0x32')]=_0xf1e0a6[_0xc3f8('0x32')][_0xc3f8('0x35')]?_0xf1e0a6[_0xc3f8('0x32')]:_0x1d95f5['model'];if(_0x4b4adb['query'][_0xc3f8('0x41')]){_0xf1e0a6[_0xc3f8('0x42')]=[{'all':!![]}];}_0xf1e0a6=_[_0xc3f8('0x3e')]({},_0xf1e0a6,_0x4b4adb[_0xc3f8('0x40')]);return db[_0xc3f8('0x2a')]['find'](_0xf1e0a6)[_0xc3f8('0x21')](handleEntityNotFound(_0x1b1e13,null))['then'](function(_0x21dfc8){if(_0x21dfc8){var _0x337029=_0x21dfc8[_0xc3f8('0x4a')]({'plain':!![]});_0x337029=qs[_0xc3f8('0x51')](_0x337029,['id','createdAt',_0xc3f8('0x52')]);_0x4b4adb['body']=_['omit'](_0x4b4adb['body'],['id','createdAt',_0xc3f8('0x52')]);return db[_0xc3f8('0x2a')][_0xc3f8('0x48')](_[_0xc3f8('0x3e')](_0x337029,_0x4b4adb[_0xc3f8('0x49')]),{'include':_0x4b4adb[_0xc3f8('0x2f')][_0xc3f8('0x41')]?[{'all':!![]}]:undefined})[_0xc3f8('0x21')](function(_0x5250df){var _0x84e1a2=_0x4b4adb[_0xc3f8('0x4c')][_0xc3f8('0x4a')]({'plain':!![]});if(!_0x84e1a2)throw new Error(_0xc3f8('0x4b'));if(_0x84e1a2[_0xc3f8('0x53')]==='user'){var _0x19aded=_0x5250df[_0xc3f8('0x4a')]({'plain':!![]});var _0x30c90f=_0xc3f8('0x22');return db[_0xc3f8('0x4d')]['find']({'where':{'name':_0x30c90f,'userProfileId':_0x84e1a2[_0xc3f8('0x54')]},'raw':!![]})[_0xc3f8('0x21')](function(_0x42b255){if(_0x42b255&&_0x42b255[_0xc3f8('0x4e')]===0x0){return db[_0xc3f8('0x23')][_0xc3f8('0x48')]({'name':_0x19aded['name'],'resourceId':_0x19aded['id'],'type':_0x42b255[_0xc3f8('0x27')],'sectionId':_0x42b255['id']},{})[_0xc3f8('0x21')](function(){return _0x5250df;});}else{return _0x5250df;}})[_0xc3f8('0x47')](function(_0x5e3f96){logger[_0xc3f8('0x25')](_0xc3f8('0x4f'),_0x5e3f96);throw _0x5e3f96;});}return _0x5250df;});}})['then'](respondWithResult(_0x1b1e13,0xc9))['catch'](handleError(_0x1b1e13,null));};exports[_0xc3f8('0x20')]=function(_0x2c7ab9,_0x4a1e61){if(_0x2c7ab9[_0xc3f8('0x49')]['id']){delete _0x2c7ab9[_0xc3f8('0x49')]['id'];}return db[_0xc3f8('0x2a')][_0xc3f8('0x46')]({'where':{'id':_0x2c7ab9[_0xc3f8('0x55')]['id']}})[_0xc3f8('0x21')](handleEntityNotFound(_0x4a1e61,null))[_0xc3f8('0x21')](saveUpdates(_0x2c7ab9[_0xc3f8('0x49')],null))['then'](respondWithResult(_0x4a1e61,null))['catch'](handleError(_0x4a1e61,null));};exports[_0xc3f8('0x24')]=function(_0x5cd8b4,_0x4a1cf5){return db['Campaign']['find']({'where':{'id':_0x5cd8b4['params']['id']}})[_0xc3f8('0x21')](handleEntityNotFound(_0x4a1cf5,null))[_0xc3f8('0x21')](removeEntity(_0x4a1cf5,null))[_0xc3f8('0x47')](handleError(_0x4a1cf5,null));};exports[_0xc3f8('0x56')]=function(_0x4dd44f,_0x18a398,_0x2d0b58){var _0x5d6208={'raw':!![],'where':{}};var _0x3b9b47={};var _0x273faf={'count':0x0,'rows':[]};return db[_0xc3f8('0x2a')]['findOne']({'where':{'id':_0x4dd44f[_0xc3f8('0x55')]['id']}})['then'](handleEntityNotFound(_0x18a398,null))['then'](function(_0x4935ae){if(_0x4935ae){_0x3b9b47[_0xc3f8('0x31')]=_[_0xc3f8('0x30')](db['CmHopper'][_0xc3f8('0x2b')]);_0x3b9b47[_0xc3f8('0x2f')]=_['keys'](_0x4dd44f[_0xc3f8('0x2f')]);_0x3b9b47[_0xc3f8('0x3c')]=_['intersection'](_0x3b9b47[_0xc3f8('0x31')],_0x3b9b47['query']);_0x5d6208[_0xc3f8('0x32')]=_[_0xc3f8('0x33')](_0x3b9b47['model'],qs['fields'](_0x4dd44f[_0xc3f8('0x2f')][_0xc3f8('0x34')]));_0x5d6208['attributes']=_0x5d6208[_0xc3f8('0x32')]['length']?_0x5d6208[_0xc3f8('0x32')]:_0x3b9b47['model'];if(!_0x4dd44f[_0xc3f8('0x2f')][_0xc3f8('0x36')](_0xc3f8('0x37'))){_0x5d6208[_0xc3f8('0x1b')]=qs[_0xc3f8('0x1b')](_0x4dd44f[_0xc3f8('0x2f')][_0xc3f8('0x1b')]);_0x5d6208[_0xc3f8('0x1a')]=qs[_0xc3f8('0x1a')](_0x4dd44f['query'][_0xc3f8('0x1a')]);}_0x5d6208[_0xc3f8('0x38')]=qs[_0xc3f8('0x39')](_0x4dd44f[_0xc3f8('0x2f')][_0xc3f8('0x39')]);_0x5d6208['where']=qs[_0xc3f8('0x3c')](_[_0xc3f8('0x3b')](_0x4dd44f[_0xc3f8('0x2f')],_0x3b9b47[_0xc3f8('0x3c')]));_0x5d6208[_0xc3f8('0x3a')]['CampaignId']=_0x4935ae['id'];if(_0x4dd44f[_0xc3f8('0x2f')][_0xc3f8('0x3d')]){_0x5d6208[_0xc3f8('0x3a')]=_['merge'](_0x5d6208['where'],{'$or':_[_0xc3f8('0x29')](_0x5d6208[_0xc3f8('0x32')],function(_0x1a9c33){var _0x34158f={};_0x34158f[_0x1a9c33]={'$like':'%'+_0x4dd44f['query'][_0xc3f8('0x3d')]+'%'};return _0x34158f;})});}_0x5d6208=_[_0xc3f8('0x3e')]({},_0x5d6208,_0x4dd44f[_0xc3f8('0x40')]);return db['CmHopper'][_0xc3f8('0x1c')]({'where':_0x5d6208[_0xc3f8('0x3a')]})['then'](function(_0x478d21){_0x273faf[_0xc3f8('0x1c')]=_0x478d21;if(_0x4dd44f[_0xc3f8('0x2f')]['includeAll']){_0x5d6208[_0xc3f8('0x42')]=[{'all':!![]}];}return db[_0xc3f8('0x57')]['findAll'](_0x5d6208);})[_0xc3f8('0x21')](function(_0x5f2d86){_0x273faf[_0xc3f8('0x44')]=_0x5f2d86;return _0x273faf;});}})['then'](respondWithFilteredResult(_0x18a398,_0x5d6208))[_0xc3f8('0x47')](handleError(_0x18a398,null));};exports[_0xc3f8('0x58')]=function(_0x2fafd7,_0x1d4abf,_0x2de860){var _0x1a5cc9={'raw':!![],'where':{}};var _0x34af4a={};var _0x18cc23={'count':0x0,'rows':[]};return db[_0xc3f8('0x2a')]['findOne']({'where':{'id':_0x2fafd7['params']['id']}})[_0xc3f8('0x21')](handleEntityNotFound(_0x1d4abf,null))['then'](function(_0xa2b49d){if(_0xa2b49d){_0x34af4a[_0xc3f8('0x31')]=_[_0xc3f8('0x30')](db[_0xc3f8('0x59')]['rawAttributes']);_0x34af4a[_0xc3f8('0x2f')]=_[_0xc3f8('0x30')](_0x2fafd7[_0xc3f8('0x2f')]);_0x34af4a[_0xc3f8('0x3c')]=_[_0xc3f8('0x33')](_0x34af4a[_0xc3f8('0x31')],_0x34af4a[_0xc3f8('0x2f')]);_0x1a5cc9[_0xc3f8('0x32')]=_[_0xc3f8('0x33')](_0x34af4a['model'],qs['fields'](_0x2fafd7[_0xc3f8('0x2f')][_0xc3f8('0x34')]));_0x1a5cc9[_0xc3f8('0x32')]=_0x1a5cc9['attributes'][_0xc3f8('0x35')]?_0x1a5cc9['attributes']:_0x34af4a[_0xc3f8('0x31')];if(!_0x2fafd7['query'][_0xc3f8('0x36')](_0xc3f8('0x37'))){_0x1a5cc9[_0xc3f8('0x1b')]=qs[_0xc3f8('0x1b')](_0x2fafd7[_0xc3f8('0x2f')][_0xc3f8('0x1b')]);_0x1a5cc9[_0xc3f8('0x1a')]=qs[_0xc3f8('0x1a')](_0x2fafd7['query'][_0xc3f8('0x1a')]);}_0x1a5cc9[_0xc3f8('0x38')]=qs[_0xc3f8('0x39')](_0x2fafd7[_0xc3f8('0x2f')][_0xc3f8('0x39')]);_0x1a5cc9['where']=qs[_0xc3f8('0x3c')](_[_0xc3f8('0x3b')](_0x2fafd7[_0xc3f8('0x2f')],_0x34af4a[_0xc3f8('0x3c')]));_0x1a5cc9['where']['CampaignId']=_0xa2b49d['id'];if(_0x2fafd7[_0xc3f8('0x2f')][_0xc3f8('0x3d')]){_0x1a5cc9['where']=_['merge'](_0x1a5cc9['where'],{'$or':_[_0xc3f8('0x29')](_0x1a5cc9['attributes'],function(_0x2a4b80){var _0x31b48d={};_0x31b48d[_0x2a4b80]={'$like':'%'+_0x2fafd7[_0xc3f8('0x2f')][_0xc3f8('0x3d')]+'%'};return _0x31b48d;})});}_0x1a5cc9=_[_0xc3f8('0x3e')]({},_0x1a5cc9,_0x2fafd7[_0xc3f8('0x40')]);return db[_0xc3f8('0x59')]['count']({'where':_0x1a5cc9['where']})['then'](function(_0x4ea284){_0x18cc23[_0xc3f8('0x1c')]=_0x4ea284;if(_0x2fafd7['query'][_0xc3f8('0x41')]){_0x1a5cc9[_0xc3f8('0x42')]=[{'all':!![]}];}return db[_0xc3f8('0x59')]['findAll'](_0x1a5cc9);})[_0xc3f8('0x21')](function(_0x12bb93){_0x18cc23['rows']=_0x12bb93;return _0x18cc23;});}})[_0xc3f8('0x21')](respondWithFilteredResult(_0x1d4abf,_0x1a5cc9))[_0xc3f8('0x47')](handleError(_0x1d4abf,null));};exports[_0xc3f8('0x5a')]=function(_0x501b02,_0x3314fc,_0x426074){var _0x2acc92={'raw':!![],'where':{}};var _0x5a2197={};var _0x1704e5={'count':0x0,'rows':[]};return db[_0xc3f8('0x2a')][_0xc3f8('0x5b')]({'where':{'id':_0x501b02[_0xc3f8('0x55')]['id']}})[_0xc3f8('0x21')](handleEntityNotFound(_0x3314fc,null))[_0xc3f8('0x21')](function(_0x481112){if(_0x481112){_0x5a2197[_0xc3f8('0x31')]=_[_0xc3f8('0x30')](db['CmHopperFinal'][_0xc3f8('0x2b')]);_0x5a2197[_0xc3f8('0x2f')]=_['keys'](_0x501b02[_0xc3f8('0x2f')]);_0x5a2197[_0xc3f8('0x3c')]=_[_0xc3f8('0x33')](_0x5a2197['model'],_0x5a2197['query']);_0x2acc92[_0xc3f8('0x32')]=_['intersection'](_0x5a2197[_0xc3f8('0x31')],qs[_0xc3f8('0x34')](_0x501b02[_0xc3f8('0x2f')]['fields']));_0x2acc92[_0xc3f8('0x32')]=_0x2acc92[_0xc3f8('0x32')][_0xc3f8('0x35')]?_0x2acc92[_0xc3f8('0x32')]:_0x5a2197[_0xc3f8('0x31')];if(!_0x501b02[_0xc3f8('0x2f')]['hasOwnProperty'](_0xc3f8('0x37'))){_0x2acc92[_0xc3f8('0x1b')]=qs[_0xc3f8('0x1b')](_0x501b02[_0xc3f8('0x2f')][_0xc3f8('0x1b')]);_0x2acc92['offset']=qs[_0xc3f8('0x1a')](_0x501b02[_0xc3f8('0x2f')][_0xc3f8('0x1a')]);}_0x2acc92['order']=qs[_0xc3f8('0x39')](_0x501b02[_0xc3f8('0x2f')][_0xc3f8('0x39')]);_0x2acc92[_0xc3f8('0x3a')]=qs[_0xc3f8('0x3c')](_['pick'](_0x501b02[_0xc3f8('0x2f')],_0x5a2197[_0xc3f8('0x3c')]));_0x2acc92[_0xc3f8('0x3a')][_0xc3f8('0x5c')]=_0x481112['id'];if(_0x501b02[_0xc3f8('0x2f')][_0xc3f8('0x3d')]){_0x2acc92[_0xc3f8('0x3a')]=_[_0xc3f8('0x3e')](_0x2acc92[_0xc3f8('0x3a')],{'$or':_[_0xc3f8('0x29')](_0x2acc92[_0xc3f8('0x32')],function(_0x50a6e0){var _0x55e2ee={};_0x55e2ee[_0x50a6e0]={'$like':'%'+_0x501b02[_0xc3f8('0x2f')]['filter']+'%'};return _0x55e2ee;})});}_0x2acc92=_['merge']({},_0x2acc92,_0x501b02[_0xc3f8('0x40')]);return db[_0xc3f8('0x5d')][_0xc3f8('0x1c')]({'where':_0x2acc92[_0xc3f8('0x3a')]})['then'](function(_0x2dad3f){_0x1704e5[_0xc3f8('0x1c')]=_0x2dad3f;if(_0x501b02['query'][_0xc3f8('0x41')]){_0x2acc92[_0xc3f8('0x42')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x2acc92);})['then'](function(_0x1426ea){_0x1704e5[_0xc3f8('0x44')]=_0x1426ea;return _0x1704e5;});}})[_0xc3f8('0x21')](respondWithFilteredResult(_0x3314fc,_0x2acc92))[_0xc3f8('0x47')](handleError(_0x3314fc,null));};exports[_0xc3f8('0x5e')]=function(_0xefe62a,_0x1c77df,_0x15e1f3){var _0x1ebbe1={'raw':!![],'where':{}};var _0x4c55ae={};var _0x49a936={'count':0x0,'rows':[]};return db[_0xc3f8('0x2a')][_0xc3f8('0x5b')]({'where':{'id':_0xefe62a[_0xc3f8('0x55')]['id']}})[_0xc3f8('0x21')](handleEntityNotFound(_0x1c77df,null))[_0xc3f8('0x21')](function(_0x21fe09){if(_0x21fe09){_0x4c55ae[_0xc3f8('0x31')]=_[_0xc3f8('0x30')](db[_0xc3f8('0x5f')]['rawAttributes']);_0x4c55ae[_0xc3f8('0x2f')]=_['keys'](_0xefe62a['query']);_0x4c55ae[_0xc3f8('0x3c')]=_[_0xc3f8('0x33')](_0x4c55ae[_0xc3f8('0x31')],_0x4c55ae[_0xc3f8('0x2f')]);_0x1ebbe1[_0xc3f8('0x32')]=_[_0xc3f8('0x33')](_0x4c55ae['model'],qs[_0xc3f8('0x34')](_0xefe62a[_0xc3f8('0x2f')][_0xc3f8('0x34')]));_0x1ebbe1['attributes']=_0x1ebbe1['attributes'][_0xc3f8('0x35')]?_0x1ebbe1[_0xc3f8('0x32')]:_0x4c55ae['model'];if(!_0xefe62a[_0xc3f8('0x2f')][_0xc3f8('0x36')]('nolimit')){_0x1ebbe1[_0xc3f8('0x1b')]=qs[_0xc3f8('0x1b')](_0xefe62a[_0xc3f8('0x2f')][_0xc3f8('0x1b')]);_0x1ebbe1[_0xc3f8('0x1a')]=qs['offset'](_0xefe62a[_0xc3f8('0x2f')]['offset']);}_0x1ebbe1[_0xc3f8('0x38')]=qs[_0xc3f8('0x39')](_0xefe62a['query'][_0xc3f8('0x39')]);_0x1ebbe1[_0xc3f8('0x3a')]=qs[_0xc3f8('0x3c')](_[_0xc3f8('0x3b')](_0xefe62a[_0xc3f8('0x2f')],_0x4c55ae[_0xc3f8('0x3c')]));_0x1ebbe1[_0xc3f8('0x3a')][_0xc3f8('0x5c')]=_0x21fe09['id'];if(_0xefe62a[_0xc3f8('0x2f')][_0xc3f8('0x3d')]){_0x1ebbe1[_0xc3f8('0x3a')]=_[_0xc3f8('0x3e')](_0x1ebbe1[_0xc3f8('0x3a')],{'$or':_[_0xc3f8('0x29')](_0x1ebbe1[_0xc3f8('0x32')],function(_0x5085cf){var _0x31d6da={};_0x31d6da[_0x5085cf]={'$like':'%'+_0xefe62a[_0xc3f8('0x2f')][_0xc3f8('0x3d')]+'%'};return _0x31d6da;})});}_0x1ebbe1=_['merge']({},_0x1ebbe1,_0xefe62a[_0xc3f8('0x40')]);return db[_0xc3f8('0x5f')]['count']({'where':_0x1ebbe1[_0xc3f8('0x3a')]})['then'](function(_0x2ef6e5){_0x49a936['count']=_0x2ef6e5;if(_0xefe62a[_0xc3f8('0x2f')][_0xc3f8('0x41')]){_0x1ebbe1[_0xc3f8('0x42')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xc3f8('0x43')](_0x1ebbe1);})[_0xc3f8('0x21')](function(_0x276108){_0x49a936[_0xc3f8('0x44')]=_0x276108;return _0x49a936;});}})[_0xc3f8('0x21')](respondWithFilteredResult(_0x1c77df,_0x1ebbe1))[_0xc3f8('0x47')](handleError(_0x1c77df,null));};exports[_0xc3f8('0x60')]=function(_0x4af05a,_0x1e1adf,_0xa7e06){var _0x103ded={};var _0x3e87d7={};var _0x349dd9;var _0x4337be;return db[_0xc3f8('0x2a')][_0xc3f8('0x5b')]({'where':{'id':_0x4af05a[_0xc3f8('0x55')]['id']}})[_0xc3f8('0x21')](handleEntityNotFound(_0x1e1adf,null))[_0xc3f8('0x21')](function(_0x24f12f){if(_0x24f12f){_0x349dd9=_0x24f12f;_0x3e87d7[_0xc3f8('0x31')]=_[_0xc3f8('0x30')](db['CmList'][_0xc3f8('0x2b')]);_0x3e87d7['query']=_[_0xc3f8('0x30')](_0x4af05a['query']);_0x3e87d7['filters']=_[_0xc3f8('0x33')](_0x3e87d7[_0xc3f8('0x31')],_0x3e87d7[_0xc3f8('0x2f')]);_0x103ded['attributes']=_['intersection'](_0x3e87d7[_0xc3f8('0x31')],qs[_0xc3f8('0x34')](_0x4af05a[_0xc3f8('0x2f')][_0xc3f8('0x34')]));_0x103ded[_0xc3f8('0x32')]=_0x103ded['attributes'][_0xc3f8('0x35')]?_0x103ded[_0xc3f8('0x32')]:_0x3e87d7[_0xc3f8('0x31')];_0x103ded['order']=qs['sort'](_0x4af05a[_0xc3f8('0x2f')]['sort']);_0x103ded['where']=qs['filters'](_[_0xc3f8('0x3b')](_0x4af05a[_0xc3f8('0x2f')],_0x3e87d7[_0xc3f8('0x3c')]));if(_0x4af05a[_0xc3f8('0x2f')]['filter']){_0x103ded[_0xc3f8('0x3a')]=_[_0xc3f8('0x3e')](_0x103ded[_0xc3f8('0x3a')],{'$or':_['map'](_0x103ded[_0xc3f8('0x32')],function(_0x21b8ed){var _0x165d27={};_0x165d27[_0x21b8ed]={'$like':'%'+_0x4af05a[_0xc3f8('0x2f')][_0xc3f8('0x3d')]+'%'};return _0x165d27;})});}_0x103ded=_['merge']({},_0x103ded,_0x4af05a[_0xc3f8('0x40')]);return _0x349dd9[_0xc3f8('0x60')](_0x103ded);}})[_0xc3f8('0x21')](function(_0x194b4a){if(_0x194b4a){_0x4337be=_0x194b4a[_0xc3f8('0x35')];if(!_0x4af05a[_0xc3f8('0x2f')]['hasOwnProperty'](_0xc3f8('0x37'))){_0x103ded[_0xc3f8('0x1b')]=qs['limit'](_0x4af05a[_0xc3f8('0x2f')][_0xc3f8('0x1b')]);_0x103ded[_0xc3f8('0x1a')]=qs['offset'](_0x4af05a[_0xc3f8('0x2f')]['offset']);}return _0x349dd9[_0xc3f8('0x60')](_0x103ded);}})[_0xc3f8('0x21')](function(_0x6139a6){if(_0x6139a6){return _0x6139a6?{'count':_0x4337be,'rows':_0x6139a6}:null;}})[_0xc3f8('0x21')](respondWithResult(_0x1e1adf,null))[_0xc3f8('0x47')](handleError(_0x1e1adf,null));};exports[_0xc3f8('0x61')]=function(_0x10cfbe,_0x1376e4,_0x2c9b71){var _0x2049f0,_0x3aa0c2;var _0x215ae9=[];var _0x1c6d52=moment()[_0xc3f8('0x62')](_0xc3f8('0x63'));return db[_0xc3f8('0x2a')]['find']({'where':{'id':_0x10cfbe[_0xc3f8('0x55')]['id']}})[_0xc3f8('0x21')](handleEntityNotFound(_0x1376e4,null))[_0xc3f8('0x21')](function(_0x3a53a9){if(_0x3a53a9){_0x3aa0c2=_0x3a53a9;return _0x3a53a9[_0xc3f8('0x61')](_0x10cfbe['body'][_0xc3f8('0x64')],_[_0xc3f8('0x51')](_0x10cfbe[_0xc3f8('0x49')],[_0xc3f8('0x64'),'id'])||{});}return null;})[_0xc3f8('0x65')](function(_0xb31d99){var _0x161637;var _0x5a8090;_0x2049f0=_0xb31d99||[];var _0x254bf9=[];if(_0xb31d99){for(var _0x5bde4a=0x0;_0x5bde4a<_0xb31d99['length'];_0x5bde4a+=0x1){var _0x28db21=_0xb31d99[_0x5bde4a][_0xc3f8('0x4a')]({'plain':!![]});_0x3aa0c2[_0xc3f8('0x66')]=_0x10cfbe[_0xc3f8('0x49')][_0xc3f8('0x66')]?_0x10cfbe['body'][_0xc3f8('0x66')]:_0x3aa0c2['dialCheckDuplicateType'];switch(_0x3aa0c2[_0xc3f8('0x66')]){case _0xc3f8('0x67'):_0x161637=squel['insert']()[_0xc3f8('0x68')](_0xc3f8('0x69'))['fromQuery']([_0xc3f8('0x6a'),_0xc3f8('0x6b'),_0xc3f8('0x6c'),_0xc3f8('0x6d'),_0xc3f8('0x5c'),_0xc3f8('0x6e'),_0xc3f8('0x52')],squel[_0xc3f8('0x6f')]()[_0xc3f8('0x70')](_0xc3f8('0x6a'),_0xc3f8('0x6a'))['field'](_0xc3f8('0x71'),'scheduledAt')[_0xc3f8('0x70')]('id','ContactId')[_0xc3f8('0x70')](_0x28db21[_0xc3f8('0x72')]['toString'](),'ListId')['field'](_0x10cfbe[_0xc3f8('0x55')]['id'][_0xc3f8('0x73')](),_0xc3f8('0x5c'))[_0xc3f8('0x70')]('\x27'+_0x1c6d52+'\x27',_0xc3f8('0x6e'))[_0xc3f8('0x70')]('\x27'+_0x1c6d52+'\x27',_0xc3f8('0x52'))[_0xc3f8('0x74')](_0xc3f8('0x75'))[_0xc3f8('0x3a')](_0xc3f8('0x76'))[_0xc3f8('0x3a')]('ListId\x20=\x20?',_0x28db21[_0xc3f8('0x72')][_0xc3f8('0x73')]())[_0xc3f8('0x3a')](_0xc3f8('0x77'))[_0xc3f8('0x3a')](_0xc3f8('0x78'),squel[_0xc3f8('0x6f')]()[_0xc3f8('0x70')](_0xc3f8('0x79'))['from'](_0xc3f8('0x7a'))[_0xc3f8('0x3a')](_0xc3f8('0x7b'),_0x10cfbe[_0xc3f8('0x55')]['id'][_0xc3f8('0x73')]()))[_0xc3f8('0x3a')](_0xc3f8('0x78'),squel[_0xc3f8('0x6f')]()[_0xc3f8('0x70')](_0xc3f8('0x7c'))[_0xc3f8('0x74')](_0xc3f8('0x69'))[_0xc3f8('0x3a')](_0xc3f8('0x7b'),_0x10cfbe[_0xc3f8('0x55')]['id'][_0xc3f8('0x73')]())))[_0xc3f8('0x73')]();break;case _0xc3f8('0x7d'):_0x161637=squel[_0xc3f8('0x7e')]()[_0xc3f8('0x68')](_0xc3f8('0x69'))[_0xc3f8('0x7f')](['phone','scheduledAt','ContactId',_0xc3f8('0x6d'),_0xc3f8('0x5c'),_0xc3f8('0x6e'),'updatedAt'],squel['select']()['field'](_0xc3f8('0x6a'),_0xc3f8('0x6a'))[_0xc3f8('0x70')](_0xc3f8('0x71'),_0xc3f8('0x6b'))['field']('id','ContactId')[_0xc3f8('0x70')](_0x28db21['CmListId']['toString'](),_0xc3f8('0x6d'))[_0xc3f8('0x70')](_0x10cfbe['params']['id']['toString'](),_0xc3f8('0x5c'))[_0xc3f8('0x70')]('\x27'+_0x1c6d52+'\x27',_0xc3f8('0x6e'))[_0xc3f8('0x70')]('\x27'+_0x1c6d52+'\x27','updatedAt')[_0xc3f8('0x74')](_0xc3f8('0x75'))[_0xc3f8('0x3a')](_0xc3f8('0x76'))[_0xc3f8('0x3a')]('ListId\x20=\x20?',_0x28db21[_0xc3f8('0x72')][_0xc3f8('0x73')]())[_0xc3f8('0x3a')](_0xc3f8('0x77'))[_0xc3f8('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel[_0xc3f8('0x6f')]()[_0xc3f8('0x70')]('COALESCE(phone,\x27\x27)')['from'](_0xc3f8('0x69'))[_0xc3f8('0x3a')](_0xc3f8('0x7b'),_0x10cfbe[_0xc3f8('0x55')]['id'][_0xc3f8('0x73')]())))['toString']();break;default:_0x161637=squel[_0xc3f8('0x7e')]()['into']('cm_hopper')[_0xc3f8('0x7f')]([_0xc3f8('0x6a'),_0xc3f8('0x6b'),_0xc3f8('0x6c'),_0xc3f8('0x6d'),_0xc3f8('0x5c'),_0xc3f8('0x6e'),_0xc3f8('0x52')],squel[_0xc3f8('0x6f')]()['field'](_0xc3f8('0x6a'),_0xc3f8('0x6a'))[_0xc3f8('0x70')]('NOW()',_0xc3f8('0x6b'))[_0xc3f8('0x70')]('id',_0xc3f8('0x6c'))[_0xc3f8('0x70')](_0x28db21[_0xc3f8('0x72')][_0xc3f8('0x73')](),'ListId')['field'](_0x10cfbe[_0xc3f8('0x55')]['id']['toString'](),_0xc3f8('0x5c'))[_0xc3f8('0x70')]('\x27'+_0x1c6d52+'\x27',_0xc3f8('0x6e'))['field']('\x27'+_0x1c6d52+'\x27','updatedAt')[_0xc3f8('0x74')](_0xc3f8('0x75'))[_0xc3f8('0x3a')](_0xc3f8('0x76'))[_0xc3f8('0x3a')](_0xc3f8('0x80'),_0x28db21['CmListId'][_0xc3f8('0x73')]())[_0xc3f8('0x3a')](_0xc3f8('0x77')))['toString']();}_0x5a8090=squel[_0xc3f8('0x7e')]()[_0xc3f8('0x68')](_0xc3f8('0x81'))['fromQuery']([_0xc3f8('0x82'),'scheduledAt',_0xc3f8('0x6a'),'OrderBy',_0xc3f8('0x6e'),_0xc3f8('0x52')],squel[_0xc3f8('0x6f')]()[_0xc3f8('0x70')](_0xc3f8('0x83'),'id')['field'](_0xc3f8('0x71'),_0xc3f8('0x6b'))[_0xc3f8('0x70')]('ci.item',_0xc3f8('0x6a'))[_0xc3f8('0x70')](_0xc3f8('0x84'),_0xc3f8('0x85'))[_0xc3f8('0x70')]('\x27'+_0x1c6d52+'\x27',_0xc3f8('0x6e'))['field']('\x27'+_0x1c6d52+'\x27','updatedAt')[_0xc3f8('0x74')](_0xc3f8('0x86'),'ci')[_0xc3f8('0x87')](_0xc3f8('0x69'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0xc3f8('0x3a')](_0xc3f8('0x88'),_0x28db21[_0xc3f8('0x72')]['toString']())[_0xc3f8('0x3a')](_0xc3f8('0x89'),_0x10cfbe[_0xc3f8('0x55')]['id'][_0xc3f8('0x73')]())[_0xc3f8('0x3a')](_0xc3f8('0x8a'),_0x1c6d52))[_0xc3f8('0x73')]();_0x254bf9[_0xc3f8('0x8b')](db[_0xc3f8('0x8c')]['query'](_0x161637));_0x215ae9[_0xc3f8('0x8b')](db[_0xc3f8('0x8c')][_0xc3f8('0x2f')](_0x5a8090));}return BPromise[_0xc3f8('0x8d')](_0x254bf9);}})[_0xc3f8('0x21')](function(){return BPromise[_0xc3f8('0x8d')](_0x215ae9);})['then'](function(){return _0x2049f0;})['then'](respondWithResult(_0x1376e4,null))[_0xc3f8('0x47')](handleError(_0x1376e4,null));};exports['removeLists']=function(_0x3e4819,_0x932db6,_0xae1cee){return db[_0xc3f8('0x2a')][_0xc3f8('0x46')]({'where':{'id':_0x3e4819['params']['id']}})['then'](handleEntityNotFound(_0x932db6,null))[_0xc3f8('0x21')](function(_0x1b449c){if(_0x1b449c){return _0x1b449c[_0xc3f8('0x8e')](_0x3e4819[_0xc3f8('0x2f')][_0xc3f8('0x64')]);}})[_0xc3f8('0x21')](function(_0x8122fd){if(_0x8122fd){return db[_0xc3f8('0x57')]['destroy']({'where':{'ListId':_0x3e4819[_0xc3f8('0x2f')][_0xc3f8('0x64')],'CampaignId':_0x3e4819[_0xc3f8('0x55')]['id']}})[_0xc3f8('0x21')](function(){return _0x8122fd;});}})['then'](respondWithStatusCode(_0x932db6,null))[_0xc3f8('0x47')](handleError(_0x932db6,null));};exports[_0xc3f8('0x8f')]=function(_0x522759,_0x2eeb45,_0x4da608){var _0x59c31a={};var _0x1c3b72={};var _0x5b0e13;var _0x10bd96;return db[_0xc3f8('0x2a')]['findOne']({'where':{'id':_0x522759['params']['id']}})['then'](handleEntityNotFound(_0x2eeb45,null))[_0xc3f8('0x21')](function(_0x4e01b7){if(_0x4e01b7){_0x5b0e13=_0x4e01b7;_0x1c3b72['model']=_[_0xc3f8('0x30')](db['CmList']['rawAttributes']);_0x1c3b72[_0xc3f8('0x2f')]=_[_0xc3f8('0x30')](_0x522759[_0xc3f8('0x2f')]);_0x1c3b72[_0xc3f8('0x3c')]=_['intersection'](_0x1c3b72[_0xc3f8('0x31')],_0x1c3b72[_0xc3f8('0x2f')]);_0x59c31a[_0xc3f8('0x32')]=_[_0xc3f8('0x33')](_0x1c3b72[_0xc3f8('0x31')],qs[_0xc3f8('0x34')](_0x522759[_0xc3f8('0x2f')][_0xc3f8('0x34')]));_0x59c31a[_0xc3f8('0x32')]=_0x59c31a[_0xc3f8('0x32')]['length']?_0x59c31a[_0xc3f8('0x32')]:_0x1c3b72[_0xc3f8('0x31')];_0x59c31a[_0xc3f8('0x38')]=qs[_0xc3f8('0x39')](_0x522759[_0xc3f8('0x2f')]['sort']);_0x59c31a[_0xc3f8('0x3a')]=qs[_0xc3f8('0x3c')](_[_0xc3f8('0x3b')](_0x522759['query'],_0x1c3b72[_0xc3f8('0x3c')]));if(_0x522759[_0xc3f8('0x2f')]['filter']){_0x59c31a[_0xc3f8('0x3a')]=_[_0xc3f8('0x3e')](_0x59c31a[_0xc3f8('0x3a')],{'$or':_[_0xc3f8('0x29')](_0x59c31a[_0xc3f8('0x32')],function(_0x2f1709){var _0x3cc8d4={};_0x3cc8d4[_0x2f1709]={'$like':'%'+_0x522759[_0xc3f8('0x2f')][_0xc3f8('0x3d')]+'%'};return _0x3cc8d4;})});}_0x59c31a=_['merge']({},_0x59c31a,_0x522759[_0xc3f8('0x40')]);return _0x5b0e13[_0xc3f8('0x8f')](_0x59c31a);}})[_0xc3f8('0x21')](function(_0x492b9e){if(_0x492b9e){_0x10bd96=_0x492b9e['length'];if(!_0x522759[_0xc3f8('0x2f')][_0xc3f8('0x36')](_0xc3f8('0x37'))){_0x59c31a[_0xc3f8('0x1b')]=qs[_0xc3f8('0x1b')](_0x522759[_0xc3f8('0x2f')][_0xc3f8('0x1b')]);_0x59c31a[_0xc3f8('0x1a')]=qs[_0xc3f8('0x1a')](_0x522759[_0xc3f8('0x2f')][_0xc3f8('0x1a')]);}return _0x5b0e13[_0xc3f8('0x8f')](_0x59c31a);}})['then'](function(_0x3796d1){if(_0x3796d1){return _0x3796d1?{'count':_0x10bd96,'rows':_0x3796d1}:null;}})[_0xc3f8('0x21')](respondWithResult(_0x2eeb45,null))[_0xc3f8('0x47')](handleError(_0x2eeb45,null));};exports[_0xc3f8('0x90')]=function(_0x27c888,_0x14bf38,_0x12986b){var _0x3fc6fc,_0x3642be;var _0x545b5a=[];var _0x4d921b=moment()[_0xc3f8('0x62')](_0xc3f8('0x63'));return db[_0xc3f8('0x2a')][_0xc3f8('0x46')]({'where':{'id':_0x27c888[_0xc3f8('0x55')]['id']}})[_0xc3f8('0x21')](handleEntityNotFound(_0x14bf38,null))[_0xc3f8('0x21')](function(_0x2a36a9){if(_0x2a36a9){_0x3642be=_0x2a36a9;return _0x2a36a9[_0xc3f8('0x90')](_0x27c888['body'][_0xc3f8('0x64')],_['omit'](_0x27c888['body'],[_0xc3f8('0x64'),'id'])||{});}return null;})['spread'](function(_0x49d71a){var _0x4fd1bb;var _0x4558f8;_0x3fc6fc=_0x49d71a||[];var _0x53d8d1=[];if(_0x49d71a){for(var _0x22a9e2=0x0;_0x22a9e2<_0x49d71a[_0xc3f8('0x35')];_0x22a9e2+=0x1){var _0x50f6a0=_0x49d71a[_0x22a9e2][_0xc3f8('0x4a')]({'plain':!![]});_0x4fd1bb=squel[_0xc3f8('0x7e')]()[_0xc3f8('0x68')](_0xc3f8('0x91'))['fromQuery']([_0xc3f8('0x6a'),_0xc3f8('0x6c'),_0xc3f8('0x6d'),_0xc3f8('0x5c'),'createdAt',_0xc3f8('0x52')],squel[_0xc3f8('0x6f')]()['field'](_0xc3f8('0x6a'),_0xc3f8('0x6a'))[_0xc3f8('0x70')]('id',_0xc3f8('0x6c'))[_0xc3f8('0x70')](_0x50f6a0[_0xc3f8('0x72')][_0xc3f8('0x73')](),_0xc3f8('0x6d'))[_0xc3f8('0x70')](_0x27c888[_0xc3f8('0x55')]['id'][_0xc3f8('0x73')](),_0xc3f8('0x5c'))['field'](_0xc3f8('0x71'),_0xc3f8('0x6e'))['field'](_0xc3f8('0x71'),_0xc3f8('0x52'))[_0xc3f8('0x74')](_0xc3f8('0x75'))['where'](_0xc3f8('0x76'))['where'](_0xc3f8('0x80'),_0x50f6a0[_0xc3f8('0x72')][_0xc3f8('0x73')]())[_0xc3f8('0x3a')](_0xc3f8('0x77')))[_0xc3f8('0x73')]();_0x53d8d1[_0xc3f8('0x8b')](db[_0xc3f8('0x8c')][_0xc3f8('0x2f')](_0x4fd1bb));}return BPromise[_0xc3f8('0x8d')](_0x53d8d1);}})[_0xc3f8('0x21')](function(){return _0x3fc6fc;})[_0xc3f8('0x21')](respondWithResult(_0x14bf38,null))[_0xc3f8('0x47')](handleError(_0x14bf38,null));};exports['removeBlackLists']=function(_0x312f3b,_0x36f4dd,_0x34a23a){return db[_0xc3f8('0x2a')][_0xc3f8('0x46')]({'where':{'id':_0x312f3b[_0xc3f8('0x55')]['id']}})['then'](handleEntityNotFound(_0x36f4dd,null))['then'](function(_0x13ff81){if(_0x13ff81){return _0x13ff81[_0xc3f8('0x92')](_0x312f3b[_0xc3f8('0x2f')][_0xc3f8('0x64')]);}})[_0xc3f8('0x21')](function(_0x3c480c){if(_0x3c480c){return db[_0xc3f8('0x5f')][_0xc3f8('0x24')]({'where':{'ListId':_0x312f3b[_0xc3f8('0x2f')][_0xc3f8('0x64')],'CampaignId':_0x312f3b['params']['id']}})[_0xc3f8('0x21')](function(){return _0x3c480c;});}})['then'](respondWithStatusCode(_0x36f4dd,null))[_0xc3f8('0x47')](handleError(_0x36f4dd,null));}; \ No newline at end of file +var _0x5cfa=['h.ListId\x20=\x20?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','cm_hopper_black','removeBlackLists','eml-format','zip-dir','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','error','stack','name','send','map','Campaign','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','create','clone','omit','createdAt','updatedAt','body','role','IvrCampaigns','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getHoppers','findOne','nolimit','CmHopper','getHopperHistories','getHopperFinals','CampaignId','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','format','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','ContactId','select','field','NOW()','scheduledAt','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','ListId','phone\x20NOT\x20IN\x20(?)','cm_contacts','cm_hopper_additional_phones','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId'];(function(_0x548599,_0x2fd2b7){var _0x43d782=function(_0x565796){while(--_0x565796){_0x548599['push'](_0x548599['shift']());}};_0x43d782(++_0x2fd2b7);}(_0x5cfa,0x12b));var _0xa5cf=function(_0x194758,_0x459a4d){_0x194758=_0x194758-0x0;var _0x12a66c=_0x5cfa[_0x194758];return _0x12a66c;};'use strict';var emlformat=require(_0xa5cf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa5cf('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xa5cf('0x2'));var sox=require(_0xa5cf('0x3'));var csv=require('to-csv');var ejs=require(_0xa5cf('0x4'));var fs=require('fs');var fs_extra=require(_0xa5cf('0x5'));var _=require(_0xa5cf('0x6'));var squel=require('squel');var crypto=require(_0xa5cf('0x7'));var jsforce=require(_0xa5cf('0x8'));var deskjs=require(_0xa5cf('0x9'));var toCsv=require(_0xa5cf('0xa'));var querystring=require(_0xa5cf('0xb'));var Papa=require('papaparse');var Redis=require(_0xa5cf('0xc'));var authService=require(_0xa5cf('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xa5cf('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa5cf('0xf'))(_0xa5cf('0x10'));var utils=require(_0xa5cf('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xa5cf('0x12'));var db=require(_0xa5cf('0x13'))['db'];function respondWithStatusCode(_0x546a22,_0x190031){_0x190031=_0x190031||0xcc;return function(_0x3337f6){if(_0x3337f6){return _0x546a22[_0xa5cf('0x14')](_0x190031);}return _0x546a22[_0xa5cf('0x15')](_0x190031)[_0xa5cf('0x16')]();};}function respondWithResult(_0x4a3ffa,_0x534869){_0x534869=_0x534869||0xc8;return function(_0x5d27a){if(_0x5d27a){return _0x4a3ffa[_0xa5cf('0x15')](_0x534869)['json'](_0x5d27a);}};}function respondWithFilteredResult(_0x219855,_0x487638){return function(_0x24a88f){if(_0x24a88f){var _0x5edcea=typeof _0x487638[_0xa5cf('0x17')]===_0xa5cf('0x18')&&typeof _0x487638[_0xa5cf('0x19')]==='undefined';var _0xdce774=_0x24a88f[_0xa5cf('0x1a')];var _0x5aac64=_0x5edcea?0x0:_0x487638['offset'];var _0x50eb98=_0x5edcea?_0x24a88f[_0xa5cf('0x1a')]:_0x487638['offset']+_0x487638[_0xa5cf('0x19')];var _0x4b21d2;if(_0x50eb98>=_0xdce774){_0x50eb98=_0xdce774;_0x4b21d2=0xc8;}else{_0x4b21d2=0xce;}_0x219855[_0xa5cf('0x15')](_0x4b21d2);return _0x219855[_0xa5cf('0x1b')](_0xa5cf('0x1c'),_0x5aac64+'-'+_0x50eb98+'/'+_0xdce774)['json'](_0x24a88f);}return null;};}function patchUpdates(_0x2a9813){return function(_0x28a755){try{jsonpatch['apply'](_0x28a755,_0x2a9813,!![]);}catch(_0xdca3e0){return BPromise[_0xa5cf('0x1d')](_0xdca3e0);}return _0x28a755[_0xa5cf('0x1e')]();};}function saveUpdates(_0x14b7f4,_0x5abc36){return function(_0x4770f4){if(_0x4770f4){return _0x4770f4['update'](_0x14b7f4)[_0xa5cf('0x1f')](function(_0x281ed3){return _0x281ed3;});}return null;};}function removeEntity(_0x5a6cca,_0x4400ed){return function(_0x163c53){if(_0x163c53){return _0x163c53['destroy']()[_0xa5cf('0x1f')](function(){var _0xbe1480=_0x163c53['get']({'plain':!![]});var _0x50bc52='IvrCampaigns';return db['UserProfileResource'][_0xa5cf('0x20')]({'where':{'type':_0x50bc52,'resourceId':_0xbe1480['id']}})[_0xa5cf('0x1f')](function(){return _0x163c53;});})[_0xa5cf('0x1f')](function(){_0x5a6cca['status'](0xcc)[_0xa5cf('0x16')]();});}};}function handleEntityNotFound(_0x2b73a4,_0x541c46){return function(_0x550241){if(!_0x550241){_0x2b73a4[_0xa5cf('0x14')](0x194);}return _0x550241;};}function handleError(_0x116f03,_0x24f3c8){_0x24f3c8=_0x24f3c8||0x1f4;return function(_0x38420d){logger[_0xa5cf('0x21')](_0x38420d[_0xa5cf('0x22')]);if(_0x38420d[_0xa5cf('0x23')]){delete _0x38420d[_0xa5cf('0x23')];}_0x116f03[_0xa5cf('0x15')](_0x24f3c8)[_0xa5cf('0x24')](_0x38420d);};}exports['index']=function(_0xacd01,_0x115e9e){var _0x5efa7c={},_0x58dea1={},_0x414f10={'count':0x0,'rows':[]};var _0x5d259d=_[_0xa5cf('0x25')](db[_0xa5cf('0x26')][_0xa5cf('0x27')],function(_0x203680){return{'name':_0x203680[_0xa5cf('0x28')],'type':_0x203680[_0xa5cf('0x29')][_0xa5cf('0x2a')]};});_0x58dea1[_0xa5cf('0x2b')]=_[_0xa5cf('0x25')](_0x5d259d,'name');_0x58dea1[_0xa5cf('0x2c')]=_['keys'](_0xacd01[_0xa5cf('0x2c')]);_0x58dea1[_0xa5cf('0x2d')]=_[_0xa5cf('0x2e')](_0x58dea1[_0xa5cf('0x2b')],_0x58dea1[_0xa5cf('0x2c')]);_0x5efa7c[_0xa5cf('0x2f')]=_[_0xa5cf('0x2e')](_0x58dea1['model'],qs[_0xa5cf('0x30')](_0xacd01[_0xa5cf('0x2c')][_0xa5cf('0x30')]));_0x5efa7c['attributes']=_0x5efa7c['attributes'][_0xa5cf('0x31')]?_0x5efa7c[_0xa5cf('0x2f')]:_0x58dea1[_0xa5cf('0x2b')];if(!_0xacd01[_0xa5cf('0x2c')][_0xa5cf('0x32')]('nolimit')){_0x5efa7c[_0xa5cf('0x19')]=qs[_0xa5cf('0x19')](_0xacd01['query']['limit']);_0x5efa7c[_0xa5cf('0x17')]=qs['offset'](_0xacd01[_0xa5cf('0x2c')][_0xa5cf('0x17')]);}_0x5efa7c[_0xa5cf('0x33')]=qs['sort'](_0xacd01[_0xa5cf('0x2c')][_0xa5cf('0x34')]);_0x5efa7c[_0xa5cf('0x35')]=qs[_0xa5cf('0x2d')](_[_0xa5cf('0x36')](_0xacd01['query'],_0x58dea1[_0xa5cf('0x2d')]),_0x5d259d);if(_0xacd01[_0xa5cf('0x2c')][_0xa5cf('0x37')]){_0x5efa7c[_0xa5cf('0x35')]=_[_0xa5cf('0x38')](_0x5efa7c[_0xa5cf('0x35')],{'$or':_[_0xa5cf('0x25')](_0x5d259d,function(_0x5b26c9){if(_0x5b26c9[_0xa5cf('0x29')]!==_0xa5cf('0x39')){var _0x52b905={};_0x52b905[_0x5b26c9[_0xa5cf('0x23')]]={'$like':'%'+_0xacd01['query']['filter']+'%'};return _0x52b905;}})});}_0x5efa7c=_[_0xa5cf('0x38')]({},_0x5efa7c,_0xacd01[_0xa5cf('0x3a')]);var _0x398a70={'where':_0x5efa7c['where']};return db[_0xa5cf('0x26')][_0xa5cf('0x1a')](_0x398a70)[_0xa5cf('0x1f')](function(_0x5b3c33){_0x414f10[_0xa5cf('0x1a')]=_0x5b3c33;if(_0xacd01['query'][_0xa5cf('0x3b')]){_0x5efa7c[_0xa5cf('0x3c')]=[{'all':!![]}];}return db['Campaign'][_0xa5cf('0x3d')](_0x5efa7c);})[_0xa5cf('0x1f')](function(_0x2bf8dd){_0x414f10[_0xa5cf('0x3e')]=_0x2bf8dd;return _0x414f10;})['then'](respondWithFilteredResult(_0x115e9e,_0x5efa7c))[_0xa5cf('0x3f')](handleError(_0x115e9e,null));};exports[_0xa5cf('0x40')]=function(_0x33a168,_0x468181){var _0x1ff094={'raw':![],'where':{'id':_0x33a168[_0xa5cf('0x41')]['id']}},_0x2d905a={};_0x2d905a[_0xa5cf('0x2b')]=_['keys'](db[_0xa5cf('0x26')][_0xa5cf('0x27')]);_0x2d905a[_0xa5cf('0x2c')]=_[_0xa5cf('0x42')](_0x33a168[_0xa5cf('0x2c')]);_0x2d905a['filters']=_['intersection'](_0x2d905a[_0xa5cf('0x2b')],_0x2d905a[_0xa5cf('0x2c')]);_0x1ff094['attributes']=_[_0xa5cf('0x2e')](_0x2d905a['model'],qs['fields'](_0x33a168[_0xa5cf('0x2c')][_0xa5cf('0x30')]));_0x1ff094[_0xa5cf('0x2f')]=_0x1ff094[_0xa5cf('0x2f')][_0xa5cf('0x31')]?_0x1ff094[_0xa5cf('0x2f')]:_0x2d905a[_0xa5cf('0x2b')];if(_0x33a168[_0xa5cf('0x2c')][_0xa5cf('0x3b')]){_0x1ff094[_0xa5cf('0x3c')]=[{'all':!![]}];}_0x1ff094=_[_0xa5cf('0x38')]({},_0x1ff094,_0x33a168[_0xa5cf('0x3a')]);return db[_0xa5cf('0x26')][_0xa5cf('0x43')](_0x1ff094)[_0xa5cf('0x1f')](handleEntityNotFound(_0x468181,null))[_0xa5cf('0x1f')](respondWithResult(_0x468181,null))[_0xa5cf('0x3f')](handleError(_0x468181,null));};exports['create']=function(_0x5d2f43,_0x408b19){return db['Campaign']['create'](_0x5d2f43['body'],{})[_0xa5cf('0x1f')](function(_0x1403e0){var _0x133856=_0x5d2f43[_0xa5cf('0x44')][_0xa5cf('0x45')]({'plain':!![]});if(!_0x133856)throw new Error(_0xa5cf('0x46'));if(_0x133856['role']===_0xa5cf('0x44')){var _0x79d97=_0x1403e0[_0xa5cf('0x45')]({'plain':!![]});var _0x5bc3c1='IvrCampaigns';return db['UserProfileSection'][_0xa5cf('0x43')]({'where':{'name':_0x5bc3c1,'userProfileId':_0x133856[_0xa5cf('0x47')]},'raw':!![]})[_0xa5cf('0x1f')](function(_0x3a6b7a){if(_0x3a6b7a&&_0x3a6b7a[_0xa5cf('0x48')]===0x0){return db[_0xa5cf('0x49')][_0xa5cf('0x4a')]({'name':_0x79d97[_0xa5cf('0x23')],'resourceId':_0x79d97['id'],'type':_0x3a6b7a[_0xa5cf('0x23')],'sectionId':_0x3a6b7a['id']},{})[_0xa5cf('0x1f')](function(){return _0x1403e0;});}else{return _0x1403e0;}})['catch'](function(_0x33d56d){logger[_0xa5cf('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x33d56d);throw _0x33d56d;});}return _0x1403e0;})[_0xa5cf('0x1f')](respondWithResult(_0x408b19,0xc9))[_0xa5cf('0x3f')](handleError(_0x408b19,null));};exports[_0xa5cf('0x4b')]=function(_0x2f76e0,_0x1a7a26){var _0x2a0dae={'where':{'id':_0x2f76e0[_0xa5cf('0x41')]['id']}},_0x2d14c5={};_0x2d14c5[_0xa5cf('0x2b')]=_[_0xa5cf('0x42')](db[_0xa5cf('0x26')][_0xa5cf('0x27')]);_0x2a0dae['attributes']=_[_0xa5cf('0x2e')](_0x2d14c5[_0xa5cf('0x2b')],qs['fields'](_0x2f76e0['query'][_0xa5cf('0x30')]));_0x2a0dae[_0xa5cf('0x2f')]=_0x2a0dae[_0xa5cf('0x2f')]['length']?_0x2a0dae[_0xa5cf('0x2f')]:_0x2d14c5['model'];if(_0x2f76e0[_0xa5cf('0x2c')][_0xa5cf('0x3b')]){_0x2a0dae[_0xa5cf('0x3c')]=[{'all':!![]}];}_0x2a0dae=_[_0xa5cf('0x38')]({},_0x2a0dae,_0x2f76e0[_0xa5cf('0x3a')]);return db[_0xa5cf('0x26')]['find'](_0x2a0dae)[_0xa5cf('0x1f')](handleEntityNotFound(_0x1a7a26,null))['then'](function(_0x69569){if(_0x69569){var _0xf3406c=_0x69569[_0xa5cf('0x45')]({'plain':!![]});_0xf3406c=qs[_0xa5cf('0x4c')](_0xf3406c,['id',_0xa5cf('0x4d'),_0xa5cf('0x4e')]);_0x2f76e0['body']=_[_0xa5cf('0x4c')](_0x2f76e0[_0xa5cf('0x4f')],['id',_0xa5cf('0x4d'),_0xa5cf('0x4e')]);return db[_0xa5cf('0x26')][_0xa5cf('0x4a')](_[_0xa5cf('0x38')](_0xf3406c,_0x2f76e0[_0xa5cf('0x4f')]),{'include':_0x2f76e0[_0xa5cf('0x2c')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x3c5f65){var _0x5befbd=_0x2f76e0[_0xa5cf('0x44')][_0xa5cf('0x45')]({'plain':!![]});if(!_0x5befbd)throw new Error(_0xa5cf('0x46'));if(_0x5befbd[_0xa5cf('0x50')]===_0xa5cf('0x44')){var _0x1d2270=_0x3c5f65[_0xa5cf('0x45')]({'plain':!![]});var _0x34ddeb=_0xa5cf('0x51');return db[_0xa5cf('0x52')][_0xa5cf('0x43')]({'where':{'name':_0x34ddeb,'userProfileId':_0x5befbd[_0xa5cf('0x47')]},'raw':!![]})[_0xa5cf('0x1f')](function(_0x52071c){if(_0x52071c&&_0x52071c[_0xa5cf('0x48')]===0x0){return db[_0xa5cf('0x49')][_0xa5cf('0x4a')]({'name':_0x1d2270[_0xa5cf('0x23')],'resourceId':_0x1d2270['id'],'type':_0x52071c[_0xa5cf('0x23')],'sectionId':_0x52071c['id']},{})[_0xa5cf('0x1f')](function(){return _0x3c5f65;});}else{return _0x3c5f65;}})[_0xa5cf('0x3f')](function(_0x5652e8){logger['error'](_0xa5cf('0x53'),_0x5652e8);throw _0x5652e8;});}return _0x3c5f65;});}})[_0xa5cf('0x1f')](respondWithResult(_0x1a7a26,0xc9))['catch'](handleError(_0x1a7a26,null));};exports[_0xa5cf('0x54')]=function(_0x4f2361,_0x17ee01){if(_0x4f2361[_0xa5cf('0x4f')]['id']){delete _0x4f2361[_0xa5cf('0x4f')]['id'];}return db[_0xa5cf('0x26')][_0xa5cf('0x43')]({'where':{'id':_0x4f2361[_0xa5cf('0x41')]['id']}})[_0xa5cf('0x1f')](handleEntityNotFound(_0x17ee01,null))[_0xa5cf('0x1f')](saveUpdates(_0x4f2361['body'],null))['then'](respondWithResult(_0x17ee01,null))[_0xa5cf('0x3f')](handleError(_0x17ee01,null));};exports[_0xa5cf('0x20')]=function(_0x3dcbca,_0x2d5b91){return db[_0xa5cf('0x26')]['find']({'where':{'id':_0x3dcbca[_0xa5cf('0x41')]['id']}})['then'](handleEntityNotFound(_0x2d5b91,null))[_0xa5cf('0x1f')](removeEntity(_0x2d5b91,null))[_0xa5cf('0x3f')](handleError(_0x2d5b91,null));};exports[_0xa5cf('0x55')]=function(_0x1be1cd,_0x334742,_0x101e7c){var _0x2f8316={'raw':!![],'where':{}};var _0xa62e80={};var _0x48f2d0={'count':0x0,'rows':[]};return db[_0xa5cf('0x26')][_0xa5cf('0x56')]({'where':{'id':_0x1be1cd[_0xa5cf('0x41')]['id']}})[_0xa5cf('0x1f')](handleEntityNotFound(_0x334742,null))[_0xa5cf('0x1f')](function(_0x35f873){if(_0x35f873){_0xa62e80['model']=_[_0xa5cf('0x42')](db['CmHopper'][_0xa5cf('0x27')]);_0xa62e80[_0xa5cf('0x2c')]=_[_0xa5cf('0x42')](_0x1be1cd[_0xa5cf('0x2c')]);_0xa62e80[_0xa5cf('0x2d')]=_[_0xa5cf('0x2e')](_0xa62e80[_0xa5cf('0x2b')],_0xa62e80[_0xa5cf('0x2c')]);_0x2f8316[_0xa5cf('0x2f')]=_[_0xa5cf('0x2e')](_0xa62e80['model'],qs['fields'](_0x1be1cd[_0xa5cf('0x2c')]['fields']));_0x2f8316[_0xa5cf('0x2f')]=_0x2f8316['attributes'][_0xa5cf('0x31')]?_0x2f8316['attributes']:_0xa62e80[_0xa5cf('0x2b')];if(!_0x1be1cd[_0xa5cf('0x2c')][_0xa5cf('0x32')](_0xa5cf('0x57'))){_0x2f8316[_0xa5cf('0x19')]=qs[_0xa5cf('0x19')](_0x1be1cd[_0xa5cf('0x2c')][_0xa5cf('0x19')]);_0x2f8316['offset']=qs[_0xa5cf('0x17')](_0x1be1cd[_0xa5cf('0x2c')][_0xa5cf('0x17')]);}_0x2f8316['order']=qs[_0xa5cf('0x34')](_0x1be1cd['query'][_0xa5cf('0x34')]);_0x2f8316[_0xa5cf('0x35')]=qs[_0xa5cf('0x2d')](_[_0xa5cf('0x36')](_0x1be1cd['query'],_0xa62e80[_0xa5cf('0x2d')]));_0x2f8316['where']['CampaignId']=_0x35f873['id'];if(_0x1be1cd[_0xa5cf('0x2c')][_0xa5cf('0x37')]){_0x2f8316['where']=_[_0xa5cf('0x38')](_0x2f8316['where'],{'$or':_[_0xa5cf('0x25')](_0x2f8316[_0xa5cf('0x2f')],function(_0x2880e5){var _0x11dafc={};_0x11dafc[_0x2880e5]={'$like':'%'+_0x1be1cd['query'][_0xa5cf('0x37')]+'%'};return _0x11dafc;})});}_0x2f8316=_[_0xa5cf('0x38')]({},_0x2f8316,_0x1be1cd[_0xa5cf('0x3a')]);return db['CmHopper']['count']({'where':_0x2f8316[_0xa5cf('0x35')]})[_0xa5cf('0x1f')](function(_0x41c31b){_0x48f2d0[_0xa5cf('0x1a')]=_0x41c31b;if(_0x1be1cd[_0xa5cf('0x2c')]['includeAll']){_0x2f8316['include']=[{'all':!![]}];}return db[_0xa5cf('0x58')][_0xa5cf('0x3d')](_0x2f8316);})[_0xa5cf('0x1f')](function(_0x258457){_0x48f2d0[_0xa5cf('0x3e')]=_0x258457;return _0x48f2d0;});}})['then'](respondWithFilteredResult(_0x334742,_0x2f8316))[_0xa5cf('0x3f')](handleError(_0x334742,null));};exports[_0xa5cf('0x59')]=function(_0x2a9e13,_0x37ea50,_0x257856){var _0x39d71b={'raw':!![],'where':{}};var _0x4a0f88={};var _0x585094={'count':0x0,'rows':[]};return db['Campaign'][_0xa5cf('0x56')]({'where':{'id':_0x2a9e13[_0xa5cf('0x41')]['id']}})[_0xa5cf('0x1f')](handleEntityNotFound(_0x37ea50,null))['then'](function(_0x329a97){if(_0x329a97){_0x4a0f88[_0xa5cf('0x2b')]=_[_0xa5cf('0x42')](db['CmHopperHistory']['rawAttributes']);_0x4a0f88[_0xa5cf('0x2c')]=_['keys'](_0x2a9e13[_0xa5cf('0x2c')]);_0x4a0f88['filters']=_[_0xa5cf('0x2e')](_0x4a0f88[_0xa5cf('0x2b')],_0x4a0f88['query']);_0x39d71b['attributes']=_[_0xa5cf('0x2e')](_0x4a0f88[_0xa5cf('0x2b')],qs[_0xa5cf('0x30')](_0x2a9e13[_0xa5cf('0x2c')][_0xa5cf('0x30')]));_0x39d71b[_0xa5cf('0x2f')]=_0x39d71b['attributes'][_0xa5cf('0x31')]?_0x39d71b[_0xa5cf('0x2f')]:_0x4a0f88['model'];if(!_0x2a9e13['query'][_0xa5cf('0x32')](_0xa5cf('0x57'))){_0x39d71b['limit']=qs[_0xa5cf('0x19')](_0x2a9e13['query'][_0xa5cf('0x19')]);_0x39d71b[_0xa5cf('0x17')]=qs[_0xa5cf('0x17')](_0x2a9e13[_0xa5cf('0x2c')][_0xa5cf('0x17')]);}_0x39d71b[_0xa5cf('0x33')]=qs[_0xa5cf('0x34')](_0x2a9e13[_0xa5cf('0x2c')][_0xa5cf('0x34')]);_0x39d71b['where']=qs[_0xa5cf('0x2d')](_['pick'](_0x2a9e13['query'],_0x4a0f88[_0xa5cf('0x2d')]));_0x39d71b[_0xa5cf('0x35')]['CampaignId']=_0x329a97['id'];if(_0x2a9e13[_0xa5cf('0x2c')][_0xa5cf('0x37')]){_0x39d71b[_0xa5cf('0x35')]=_[_0xa5cf('0x38')](_0x39d71b[_0xa5cf('0x35')],{'$or':_['map'](_0x39d71b[_0xa5cf('0x2f')],function(_0x309cd1){var _0x12f823={};_0x12f823[_0x309cd1]={'$like':'%'+_0x2a9e13[_0xa5cf('0x2c')]['filter']+'%'};return _0x12f823;})});}_0x39d71b=_[_0xa5cf('0x38')]({},_0x39d71b,_0x2a9e13[_0xa5cf('0x3a')]);return db['CmHopperHistory'][_0xa5cf('0x1a')]({'where':_0x39d71b[_0xa5cf('0x35')]})[_0xa5cf('0x1f')](function(_0x2d9c61){_0x585094[_0xa5cf('0x1a')]=_0x2d9c61;if(_0x2a9e13[_0xa5cf('0x2c')][_0xa5cf('0x3b')]){_0x39d71b[_0xa5cf('0x3c')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xa5cf('0x3d')](_0x39d71b);})[_0xa5cf('0x1f')](function(_0x562f72){_0x585094[_0xa5cf('0x3e')]=_0x562f72;return _0x585094;});}})[_0xa5cf('0x1f')](respondWithFilteredResult(_0x37ea50,_0x39d71b))['catch'](handleError(_0x37ea50,null));};exports[_0xa5cf('0x5a')]=function(_0x1d0deb,_0x27b667,_0x171edc){var _0x20047b={'raw':!![],'where':{}};var _0x56a80d={};var _0x4f3aff={'count':0x0,'rows':[]};return db[_0xa5cf('0x26')][_0xa5cf('0x56')]({'where':{'id':_0x1d0deb[_0xa5cf('0x41')]['id']}})['then'](handleEntityNotFound(_0x27b667,null))[_0xa5cf('0x1f')](function(_0x23112e){if(_0x23112e){_0x56a80d[_0xa5cf('0x2b')]=_[_0xa5cf('0x42')](db['CmHopperFinal'][_0xa5cf('0x27')]);_0x56a80d['query']=_[_0xa5cf('0x42')](_0x1d0deb['query']);_0x56a80d['filters']=_[_0xa5cf('0x2e')](_0x56a80d[_0xa5cf('0x2b')],_0x56a80d['query']);_0x20047b[_0xa5cf('0x2f')]=_[_0xa5cf('0x2e')](_0x56a80d[_0xa5cf('0x2b')],qs[_0xa5cf('0x30')](_0x1d0deb[_0xa5cf('0x2c')]['fields']));_0x20047b[_0xa5cf('0x2f')]=_0x20047b['attributes']['length']?_0x20047b[_0xa5cf('0x2f')]:_0x56a80d['model'];if(!_0x1d0deb[_0xa5cf('0x2c')][_0xa5cf('0x32')](_0xa5cf('0x57'))){_0x20047b[_0xa5cf('0x19')]=qs[_0xa5cf('0x19')](_0x1d0deb[_0xa5cf('0x2c')][_0xa5cf('0x19')]);_0x20047b[_0xa5cf('0x17')]=qs[_0xa5cf('0x17')](_0x1d0deb[_0xa5cf('0x2c')][_0xa5cf('0x17')]);}_0x20047b['order']=qs['sort'](_0x1d0deb['query'][_0xa5cf('0x34')]);_0x20047b['where']=qs['filters'](_[_0xa5cf('0x36')](_0x1d0deb[_0xa5cf('0x2c')],_0x56a80d[_0xa5cf('0x2d')]));_0x20047b['where'][_0xa5cf('0x5b')]=_0x23112e['id'];if(_0x1d0deb['query'][_0xa5cf('0x37')]){_0x20047b[_0xa5cf('0x35')]=_['merge'](_0x20047b['where'],{'$or':_[_0xa5cf('0x25')](_0x20047b['attributes'],function(_0x100c55){var _0x48eaf3={};_0x48eaf3[_0x100c55]={'$like':'%'+_0x1d0deb[_0xa5cf('0x2c')]['filter']+'%'};return _0x48eaf3;})});}_0x20047b=_[_0xa5cf('0x38')]({},_0x20047b,_0x1d0deb[_0xa5cf('0x3a')]);return db[_0xa5cf('0x5c')][_0xa5cf('0x1a')]({'where':_0x20047b[_0xa5cf('0x35')]})[_0xa5cf('0x1f')](function(_0x9976d0){_0x4f3aff['count']=_0x9976d0;if(_0x1d0deb[_0xa5cf('0x2c')][_0xa5cf('0x3b')]){_0x20047b['include']=[{'all':!![]}];}return db[_0xa5cf('0x5c')][_0xa5cf('0x3d')](_0x20047b);})['then'](function(_0x19291c){_0x4f3aff[_0xa5cf('0x3e')]=_0x19291c;return _0x4f3aff;});}})[_0xa5cf('0x1f')](respondWithFilteredResult(_0x27b667,_0x20047b))[_0xa5cf('0x3f')](handleError(_0x27b667,null));};exports[_0xa5cf('0x5d')]=function(_0x4af373,_0x5db072,_0x1bffb1){var _0x318e6d={'raw':!![],'where':{}};var _0x5d5e78={};var _0x101dbf={'count':0x0,'rows':[]};return db[_0xa5cf('0x26')][_0xa5cf('0x56')]({'where':{'id':_0x4af373[_0xa5cf('0x41')]['id']}})[_0xa5cf('0x1f')](handleEntityNotFound(_0x5db072,null))['then'](function(_0x362acb){if(_0x362acb){_0x5d5e78['model']=_[_0xa5cf('0x42')](db['CmHopperBlack'][_0xa5cf('0x27')]);_0x5d5e78['query']=_[_0xa5cf('0x42')](_0x4af373['query']);_0x5d5e78[_0xa5cf('0x2d')]=_[_0xa5cf('0x2e')](_0x5d5e78['model'],_0x5d5e78['query']);_0x318e6d[_0xa5cf('0x2f')]=_[_0xa5cf('0x2e')](_0x5d5e78[_0xa5cf('0x2b')],qs[_0xa5cf('0x30')](_0x4af373['query']['fields']));_0x318e6d[_0xa5cf('0x2f')]=_0x318e6d[_0xa5cf('0x2f')][_0xa5cf('0x31')]?_0x318e6d['attributes']:_0x5d5e78[_0xa5cf('0x2b')];if(!_0x4af373[_0xa5cf('0x2c')][_0xa5cf('0x32')](_0xa5cf('0x57'))){_0x318e6d[_0xa5cf('0x19')]=qs[_0xa5cf('0x19')](_0x4af373[_0xa5cf('0x2c')][_0xa5cf('0x19')]);_0x318e6d['offset']=qs['offset'](_0x4af373[_0xa5cf('0x2c')][_0xa5cf('0x17')]);}_0x318e6d[_0xa5cf('0x33')]=qs[_0xa5cf('0x34')](_0x4af373[_0xa5cf('0x2c')][_0xa5cf('0x34')]);_0x318e6d['where']=qs[_0xa5cf('0x2d')](_['pick'](_0x4af373['query'],_0x5d5e78[_0xa5cf('0x2d')]));_0x318e6d[_0xa5cf('0x35')][_0xa5cf('0x5b')]=_0x362acb['id'];if(_0x4af373['query']['filter']){_0x318e6d[_0xa5cf('0x35')]=_['merge'](_0x318e6d['where'],{'$or':_[_0xa5cf('0x25')](_0x318e6d['attributes'],function(_0x7a6a17){var _0x656758={};_0x656758[_0x7a6a17]={'$like':'%'+_0x4af373['query'][_0xa5cf('0x37')]+'%'};return _0x656758;})});}_0x318e6d=_[_0xa5cf('0x38')]({},_0x318e6d,_0x4af373[_0xa5cf('0x3a')]);return db[_0xa5cf('0x5e')][_0xa5cf('0x1a')]({'where':_0x318e6d[_0xa5cf('0x35')]})[_0xa5cf('0x1f')](function(_0x206bb5){_0x101dbf[_0xa5cf('0x1a')]=_0x206bb5;if(_0x4af373['query']['includeAll']){_0x318e6d[_0xa5cf('0x3c')]=[{'all':!![]}];}return db[_0xa5cf('0x5e')][_0xa5cf('0x3d')](_0x318e6d);})[_0xa5cf('0x1f')](function(_0x502ba7){_0x101dbf[_0xa5cf('0x3e')]=_0x502ba7;return _0x101dbf;});}})[_0xa5cf('0x1f')](respondWithFilteredResult(_0x5db072,_0x318e6d))[_0xa5cf('0x3f')](handleError(_0x5db072,null));};exports[_0xa5cf('0x5f')]=function(_0x3e08d5,_0x5c31cd,_0x42e741){var _0x47d2d8={};var _0x43f7f={};var _0x222787;var _0x1d65ce;return db[_0xa5cf('0x26')][_0xa5cf('0x56')]({'where':{'id':_0x3e08d5[_0xa5cf('0x41')]['id']}})[_0xa5cf('0x1f')](handleEntityNotFound(_0x5c31cd,null))[_0xa5cf('0x1f')](function(_0x4f1ae0){if(_0x4f1ae0){_0x222787=_0x4f1ae0;_0x43f7f[_0xa5cf('0x2b')]=_['keys'](db[_0xa5cf('0x60')][_0xa5cf('0x27')]);_0x43f7f[_0xa5cf('0x2c')]=_[_0xa5cf('0x42')](_0x3e08d5['query']);_0x43f7f[_0xa5cf('0x2d')]=_[_0xa5cf('0x2e')](_0x43f7f[_0xa5cf('0x2b')],_0x43f7f[_0xa5cf('0x2c')]);_0x47d2d8['attributes']=_[_0xa5cf('0x2e')](_0x43f7f[_0xa5cf('0x2b')],qs[_0xa5cf('0x30')](_0x3e08d5[_0xa5cf('0x2c')]['fields']));_0x47d2d8[_0xa5cf('0x2f')]=_0x47d2d8[_0xa5cf('0x2f')][_0xa5cf('0x31')]?_0x47d2d8[_0xa5cf('0x2f')]:_0x43f7f[_0xa5cf('0x2b')];_0x47d2d8[_0xa5cf('0x33')]=qs[_0xa5cf('0x34')](_0x3e08d5['query'][_0xa5cf('0x34')]);_0x47d2d8[_0xa5cf('0x35')]=qs[_0xa5cf('0x2d')](_[_0xa5cf('0x36')](_0x3e08d5['query'],_0x43f7f['filters']));if(_0x3e08d5[_0xa5cf('0x2c')][_0xa5cf('0x37')]){_0x47d2d8[_0xa5cf('0x35')]=_['merge'](_0x47d2d8['where'],{'$or':_[_0xa5cf('0x25')](_0x47d2d8[_0xa5cf('0x2f')],function(_0x52c091){var _0x221c9e={};_0x221c9e[_0x52c091]={'$like':'%'+_0x3e08d5['query']['filter']+'%'};return _0x221c9e;})});}_0x47d2d8=_[_0xa5cf('0x38')]({},_0x47d2d8,_0x3e08d5[_0xa5cf('0x3a')]);return _0x222787['getLists'](_0x47d2d8);}})[_0xa5cf('0x1f')](function(_0x266864){if(_0x266864){_0x1d65ce=_0x266864[_0xa5cf('0x31')];if(!_0x3e08d5[_0xa5cf('0x2c')][_0xa5cf('0x32')](_0xa5cf('0x57'))){_0x47d2d8['limit']=qs[_0xa5cf('0x19')](_0x3e08d5[_0xa5cf('0x2c')][_0xa5cf('0x19')]);_0x47d2d8[_0xa5cf('0x17')]=qs['offset'](_0x3e08d5[_0xa5cf('0x2c')]['offset']);}return _0x222787[_0xa5cf('0x5f')](_0x47d2d8);}})['then'](function(_0x35f352){if(_0x35f352){return _0x35f352?{'count':_0x1d65ce,'rows':_0x35f352}:null;}})[_0xa5cf('0x1f')](respondWithResult(_0x5c31cd,null))[_0xa5cf('0x3f')](handleError(_0x5c31cd,null));};exports['addLists']=function(_0x40cb1f,_0x282023,_0x34e2d8){var _0x6da95a,_0x5c8511;var _0x3a6485=[];var _0x4af1df=moment()[_0xa5cf('0x61')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0xa5cf('0x26')]['find']({'where':{'id':_0x40cb1f[_0xa5cf('0x41')]['id']}})['then'](handleEntityNotFound(_0x282023,null))['then'](function(_0x36a9a1){if(_0x36a9a1){_0x5c8511=_0x36a9a1;return _0x36a9a1[_0xa5cf('0x62')](_0x40cb1f[_0xa5cf('0x4f')][_0xa5cf('0x63')],_['omit'](_0x40cb1f[_0xa5cf('0x4f')],[_0xa5cf('0x63'),'id'])||{});}return null;})[_0xa5cf('0x64')](function(_0x458978){var _0x493a2a;var _0x5ba7c4;_0x6da95a=_0x458978||[];var _0x54bc0a=[];if(_0x458978){for(var _0x1d5b50=0x0;_0x1d5b50<_0x458978[_0xa5cf('0x31')];_0x1d5b50+=0x1){var _0x4762c8=_0x458978[_0x1d5b50]['get']({'plain':!![]});_0x5c8511[_0xa5cf('0x65')]=_0x40cb1f[_0xa5cf('0x4f')]['dialCheckDuplicateType']?_0x40cb1f[_0xa5cf('0x4f')][_0xa5cf('0x65')]:_0x5c8511[_0xa5cf('0x65')];switch(_0x5c8511[_0xa5cf('0x65')]){case _0xa5cf('0x66'):_0x493a2a=squel[_0xa5cf('0x67')]()[_0xa5cf('0x68')](_0xa5cf('0x69'))[_0xa5cf('0x6a')]([_0xa5cf('0x6b'),'scheduledAt',_0xa5cf('0x6c'),'ListId',_0xa5cf('0x5b'),_0xa5cf('0x4d'),_0xa5cf('0x4e')],squel[_0xa5cf('0x6d')]()[_0xa5cf('0x6e')](_0xa5cf('0x6b'),_0xa5cf('0x6b'))[_0xa5cf('0x6e')](_0xa5cf('0x6f'),_0xa5cf('0x70'))[_0xa5cf('0x6e')]('id',_0xa5cf('0x6c'))[_0xa5cf('0x6e')](_0x4762c8['CmListId']['toString'](),'ListId')[_0xa5cf('0x6e')](_0x40cb1f[_0xa5cf('0x41')]['id'][_0xa5cf('0x71')](),_0xa5cf('0x5b'))['field']('\x27'+_0x4af1df+'\x27',_0xa5cf('0x4d'))['field']('\x27'+_0x4af1df+'\x27',_0xa5cf('0x4e'))[_0xa5cf('0x72')]('cm_contacts')['where'](_0xa5cf('0x73'))[_0xa5cf('0x35')](_0xa5cf('0x74'),_0x4762c8['CmListId'][_0xa5cf('0x71')]())['where'](_0xa5cf('0x75'))[_0xa5cf('0x35')]('phone\x20NOT\x20IN\x20(?)',squel[_0xa5cf('0x6d')]()['field']('COALESCE(calleridnum,\x27\x27)')['from'](_0xa5cf('0x76'))['where'](_0xa5cf('0x77'),_0x40cb1f[_0xa5cf('0x41')]['id']['toString']()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xa5cf('0x6d')]()[_0xa5cf('0x6e')](_0xa5cf('0x78'))['from']('cm_hopper')[_0xa5cf('0x35')](_0xa5cf('0x77'),_0x40cb1f[_0xa5cf('0x41')]['id']['toString']())))[_0xa5cf('0x71')]();break;case _0xa5cf('0x79'):_0x493a2a=squel[_0xa5cf('0x67')]()['into'](_0xa5cf('0x69'))[_0xa5cf('0x6a')](['phone','scheduledAt',_0xa5cf('0x6c'),'ListId',_0xa5cf('0x5b'),_0xa5cf('0x4d'),_0xa5cf('0x4e')],squel[_0xa5cf('0x6d')]()[_0xa5cf('0x6e')](_0xa5cf('0x6b'),_0xa5cf('0x6b'))[_0xa5cf('0x6e')](_0xa5cf('0x6f'),'scheduledAt')[_0xa5cf('0x6e')]('id',_0xa5cf('0x6c'))[_0xa5cf('0x6e')](_0x4762c8['CmListId'][_0xa5cf('0x71')](),_0xa5cf('0x7a'))[_0xa5cf('0x6e')](_0x40cb1f[_0xa5cf('0x41')]['id'][_0xa5cf('0x71')](),'CampaignId')[_0xa5cf('0x6e')]('\x27'+_0x4af1df+'\x27',_0xa5cf('0x4d'))['field']('\x27'+_0x4af1df+'\x27',_0xa5cf('0x4e'))[_0xa5cf('0x72')]('cm_contacts')['where'](_0xa5cf('0x73'))[_0xa5cf('0x35')](_0xa5cf('0x74'),_0x4762c8['CmListId'][_0xa5cf('0x71')]())[_0xa5cf('0x35')]('phone\x20IS\x20NOT\x20NULL')['where'](_0xa5cf('0x7b'),squel[_0xa5cf('0x6d')]()[_0xa5cf('0x6e')](_0xa5cf('0x78'))['from']('cm_hopper')[_0xa5cf('0x35')](_0xa5cf('0x77'),_0x40cb1f[_0xa5cf('0x41')]['id']['toString']())))[_0xa5cf('0x71')]();break;default:_0x493a2a=squel[_0xa5cf('0x67')]()[_0xa5cf('0x68')](_0xa5cf('0x69'))[_0xa5cf('0x6a')](['phone',_0xa5cf('0x70'),_0xa5cf('0x6c'),'ListId',_0xa5cf('0x5b'),_0xa5cf('0x4d'),_0xa5cf('0x4e')],squel['select']()[_0xa5cf('0x6e')](_0xa5cf('0x6b'),'phone')[_0xa5cf('0x6e')](_0xa5cf('0x6f'),_0xa5cf('0x70'))[_0xa5cf('0x6e')]('id',_0xa5cf('0x6c'))[_0xa5cf('0x6e')](_0x4762c8['CmListId'][_0xa5cf('0x71')](),_0xa5cf('0x7a'))[_0xa5cf('0x6e')](_0x40cb1f[_0xa5cf('0x41')]['id'][_0xa5cf('0x71')](),_0xa5cf('0x5b'))[_0xa5cf('0x6e')]('\x27'+_0x4af1df+'\x27',_0xa5cf('0x4d'))[_0xa5cf('0x6e')]('\x27'+_0x4af1df+'\x27',_0xa5cf('0x4e'))[_0xa5cf('0x72')](_0xa5cf('0x7c'))[_0xa5cf('0x35')](_0xa5cf('0x73'))[_0xa5cf('0x35')](_0xa5cf('0x74'),_0x4762c8['CmListId'][_0xa5cf('0x71')]())[_0xa5cf('0x35')](_0xa5cf('0x75')))['toString']();}_0x5ba7c4=squel[_0xa5cf('0x67')]()[_0xa5cf('0x68')](_0xa5cf('0x7d'))[_0xa5cf('0x6a')](['cmHopperId','scheduledAt',_0xa5cf('0x6b'),_0xa5cf('0x7e'),_0xa5cf('0x4d'),_0xa5cf('0x4e')],squel[_0xa5cf('0x6d')]()[_0xa5cf('0x6e')](_0xa5cf('0x7f'),'id')[_0xa5cf('0x6e')]('NOW()',_0xa5cf('0x70'))['field'](_0xa5cf('0x80'),'phone')[_0xa5cf('0x6e')](_0xa5cf('0x81'),'OrderBy')[_0xa5cf('0x6e')]('\x27'+_0x4af1df+'\x27',_0xa5cf('0x4d'))[_0xa5cf('0x6e')]('\x27'+_0x4af1df+'\x27',_0xa5cf('0x4e'))[_0xa5cf('0x72')](_0xa5cf('0x82'),'ci')[_0xa5cf('0x83')](_0xa5cf('0x69'),'h',_0xa5cf('0x84'))['where'](_0xa5cf('0x85'),_0x4762c8['CmListId']['toString']())[_0xa5cf('0x35')]('h.CampaignId=?',_0x40cb1f[_0xa5cf('0x41')]['id'][_0xa5cf('0x71')]())['where'](_0xa5cf('0x86'),_0x4af1df))['toString']();_0x54bc0a[_0xa5cf('0x87')](db[_0xa5cf('0x88')][_0xa5cf('0x2c')](_0x493a2a));_0x3a6485['push'](db[_0xa5cf('0x88')][_0xa5cf('0x2c')](_0x5ba7c4));}return BPromise[_0xa5cf('0x89')](_0x54bc0a);}})['then'](function(){return BPromise[_0xa5cf('0x89')](_0x3a6485);})[_0xa5cf('0x1f')](function(){return _0x6da95a;})[_0xa5cf('0x1f')](respondWithResult(_0x282023,null))['catch'](handleError(_0x282023,null));};exports[_0xa5cf('0x8a')]=function(_0x84c92a,_0x432718,_0x3a4c30){return db[_0xa5cf('0x26')][_0xa5cf('0x43')]({'where':{'id':_0x84c92a['params']['id']}})[_0xa5cf('0x1f')](handleEntityNotFound(_0x432718,null))[_0xa5cf('0x1f')](function(_0x3c67b1){if(_0x3c67b1){return _0x3c67b1['removeLists'](_0x84c92a[_0xa5cf('0x2c')][_0xa5cf('0x63')]);}})['then'](function(_0x2d80dc){if(_0x2d80dc){return db[_0xa5cf('0x58')][_0xa5cf('0x20')]({'where':{'ListId':_0x84c92a['query']['ids'],'CampaignId':_0x84c92a[_0xa5cf('0x41')]['id']}})['then'](function(){return _0x2d80dc;});}})[_0xa5cf('0x1f')](respondWithStatusCode(_0x432718,null))[_0xa5cf('0x3f')](handleError(_0x432718,null));};exports['getBlackLists']=function(_0x3e0836,_0x4b1c4d,_0x54f6c9){var _0x1dd071={};var _0x367c2b={};var _0x583a10;var _0x54f106;return db['Campaign'][_0xa5cf('0x56')]({'where':{'id':_0x3e0836[_0xa5cf('0x41')]['id']}})['then'](handleEntityNotFound(_0x4b1c4d,null))['then'](function(_0x3f01f5){if(_0x3f01f5){_0x583a10=_0x3f01f5;_0x367c2b[_0xa5cf('0x2b')]=_[_0xa5cf('0x42')](db[_0xa5cf('0x60')][_0xa5cf('0x27')]);_0x367c2b[_0xa5cf('0x2c')]=_[_0xa5cf('0x42')](_0x3e0836[_0xa5cf('0x2c')]);_0x367c2b[_0xa5cf('0x2d')]=_[_0xa5cf('0x2e')](_0x367c2b['model'],_0x367c2b[_0xa5cf('0x2c')]);_0x1dd071['attributes']=_['intersection'](_0x367c2b['model'],qs[_0xa5cf('0x30')](_0x3e0836[_0xa5cf('0x2c')][_0xa5cf('0x30')]));_0x1dd071['attributes']=_0x1dd071[_0xa5cf('0x2f')][_0xa5cf('0x31')]?_0x1dd071[_0xa5cf('0x2f')]:_0x367c2b[_0xa5cf('0x2b')];_0x1dd071['order']=qs['sort'](_0x3e0836[_0xa5cf('0x2c')][_0xa5cf('0x34')]);_0x1dd071[_0xa5cf('0x35')]=qs[_0xa5cf('0x2d')](_[_0xa5cf('0x36')](_0x3e0836[_0xa5cf('0x2c')],_0x367c2b[_0xa5cf('0x2d')]));if(_0x3e0836[_0xa5cf('0x2c')][_0xa5cf('0x37')]){_0x1dd071[_0xa5cf('0x35')]=_[_0xa5cf('0x38')](_0x1dd071[_0xa5cf('0x35')],{'$or':_['map'](_0x1dd071[_0xa5cf('0x2f')],function(_0x2600ed){var _0x5d6a3a={};_0x5d6a3a[_0x2600ed]={'$like':'%'+_0x3e0836[_0xa5cf('0x2c')][_0xa5cf('0x37')]+'%'};return _0x5d6a3a;})});}_0x1dd071=_['merge']({},_0x1dd071,_0x3e0836[_0xa5cf('0x3a')]);return _0x583a10[_0xa5cf('0x8b')](_0x1dd071);}})[_0xa5cf('0x1f')](function(_0x285dc6){if(_0x285dc6){_0x54f106=_0x285dc6['length'];if(!_0x3e0836['query'][_0xa5cf('0x32')]('nolimit')){_0x1dd071[_0xa5cf('0x19')]=qs[_0xa5cf('0x19')](_0x3e0836[_0xa5cf('0x2c')][_0xa5cf('0x19')]);_0x1dd071[_0xa5cf('0x17')]=qs[_0xa5cf('0x17')](_0x3e0836[_0xa5cf('0x2c')]['offset']);}return _0x583a10[_0xa5cf('0x8b')](_0x1dd071);}})[_0xa5cf('0x1f')](function(_0x293d75){if(_0x293d75){return _0x293d75?{'count':_0x54f106,'rows':_0x293d75}:null;}})[_0xa5cf('0x1f')](respondWithResult(_0x4b1c4d,null))['catch'](handleError(_0x4b1c4d,null));};exports[_0xa5cf('0x8c')]=function(_0x478ab8,_0xa7f1b9,_0x5c6dde){var _0x10c6f0,_0x31500e;var _0x5083c3=[];var _0x4c73d9=moment()[_0xa5cf('0x61')](_0xa5cf('0x8d'));return db[_0xa5cf('0x26')][_0xa5cf('0x43')]({'where':{'id':_0x478ab8[_0xa5cf('0x41')]['id']}})[_0xa5cf('0x1f')](handleEntityNotFound(_0xa7f1b9,null))[_0xa5cf('0x1f')](function(_0x186cfd){if(_0x186cfd){_0x31500e=_0x186cfd;return _0x186cfd[_0xa5cf('0x8c')](_0x478ab8[_0xa5cf('0x4f')]['ids'],_[_0xa5cf('0x4c')](_0x478ab8['body'],[_0xa5cf('0x63'),'id'])||{});}return null;})[_0xa5cf('0x64')](function(_0x229874){var _0x132ee3;var _0x199849;_0x10c6f0=_0x229874||[];var _0x1b87d6=[];if(_0x229874){for(var _0x5150dc=0x0;_0x5150dc<_0x229874['length'];_0x5150dc+=0x1){var _0x4f8473=_0x229874[_0x5150dc][_0xa5cf('0x45')]({'plain':!![]});_0x132ee3=squel[_0xa5cf('0x67')]()[_0xa5cf('0x68')](_0xa5cf('0x8e'))[_0xa5cf('0x6a')]([_0xa5cf('0x6b'),_0xa5cf('0x6c'),_0xa5cf('0x7a'),_0xa5cf('0x5b'),_0xa5cf('0x4d'),_0xa5cf('0x4e')],squel[_0xa5cf('0x6d')]()[_0xa5cf('0x6e')](_0xa5cf('0x6b'),_0xa5cf('0x6b'))[_0xa5cf('0x6e')]('id',_0xa5cf('0x6c'))[_0xa5cf('0x6e')](_0x4f8473['CmListId'][_0xa5cf('0x71')](),_0xa5cf('0x7a'))[_0xa5cf('0x6e')](_0x478ab8[_0xa5cf('0x41')]['id']['toString'](),_0xa5cf('0x5b'))['field'](_0xa5cf('0x6f'),'createdAt')['field']('NOW()',_0xa5cf('0x4e'))[_0xa5cf('0x72')](_0xa5cf('0x7c'))[_0xa5cf('0x35')](_0xa5cf('0x73'))[_0xa5cf('0x35')](_0xa5cf('0x74'),_0x4f8473['CmListId'][_0xa5cf('0x71')]())[_0xa5cf('0x35')](_0xa5cf('0x75')))[_0xa5cf('0x71')]();_0x1b87d6['push'](db[_0xa5cf('0x88')][_0xa5cf('0x2c')](_0x132ee3));}return BPromise[_0xa5cf('0x89')](_0x1b87d6);}})[_0xa5cf('0x1f')](function(){return _0x10c6f0;})['then'](respondWithResult(_0xa7f1b9,null))[_0xa5cf('0x3f')](handleError(_0xa7f1b9,null));};exports[_0xa5cf('0x8f')]=function(_0x1ec7a1,_0xf42767,_0x8f418){return db[_0xa5cf('0x26')][_0xa5cf('0x43')]({'where':{'id':_0x1ec7a1[_0xa5cf('0x41')]['id']}})[_0xa5cf('0x1f')](handleEntityNotFound(_0xf42767,null))[_0xa5cf('0x1f')](function(_0x32b905){if(_0x32b905){return _0x32b905['removeBlackLists'](_0x1ec7a1[_0xa5cf('0x2c')][_0xa5cf('0x63')]);}})[_0xa5cf('0x1f')](function(_0x430280){if(_0x430280){return db[_0xa5cf('0x5e')][_0xa5cf('0x20')]({'where':{'ListId':_0x1ec7a1[_0xa5cf('0x2c')][_0xa5cf('0x63')],'CampaignId':_0x1ec7a1[_0xa5cf('0x41')]['id']}})[_0xa5cf('0x1f')](function(){return _0x430280;});}})['then'](respondWithStatusCode(_0xf42767,null))[_0xa5cf('0x3f')](handleError(_0xf42767,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 422f1bb..6f34574 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x402671,_0x5bb553){var _0x326991=function(_0xa2f254){while(--_0xa2f254){_0x402671['push'](_0x402671['shift']());}};_0x326991(++_0x5bb553);}(_0x7a54,0x106));var _0x47a5=function(_0x52ae53,_0x4fb4f0){_0x52ae53=_0x52ae53-0x0;var _0x229f86=_0x7a54[_0x52ae53];return _0x229f86;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0xf34895,_0x21fb70){var _0x143f44=function(_0x2e7730){while(--_0x2e7730){_0xf34895['push'](_0xf34895['shift']());}};_0x143f44(++_0x21fb70);}(_0x7a54,0x106));var _0x47a5=function(_0x371f27,_0x289070){_0x371f27=_0x371f27-0x0;var _0x2b97b2=_0x7a54[_0x371f27];return _0x2b97b2;};'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 a8870d8..e4694ab 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 _0x9ef8=['util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','model','map','debug','lodash'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x9ef8,0x17f));var _0x89ef=function(_0x2b91c5,_0x3b6db5){_0x2b91c5=_0x2b91c5-0x0;var _0xbd5531=_0x9ef8[_0x2b91c5];return _0xbd5531;};'use strict';var _=require(_0x89ef('0x0'));var util=require(_0x89ef('0x1'));var moment=require('moment');var BPromise=require(_0x89ef('0x2'));var rs=require(_0x89ef('0x3'));var fs=require('fs');var Redis=require(_0x89ef('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x89ef('0x5'));var logger=require(_0x89ef('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x89ef('0x7')][_0x89ef('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x24439e,_0x90b5bf,_0x46c0da){return new BPromise(function(_0x373288,_0x16e8c3){return client[_0x89ef('0x9')](_0x24439e,_0x46c0da)[_0x89ef('0xa')](function(_0x5683b6){logger[_0x89ef('0xb')](_0x89ef('0xc'),_0x90b5bf,_0x89ef('0xd'));logger['debug'](_0x89ef('0xe'),_0x90b5bf,_0x89ef('0xd'),JSON[_0x89ef('0xf')](_0x5683b6));if(_0x5683b6[_0x89ef('0x10')]){if(_0x5683b6[_0x89ef('0x10')]['code']===0x1f4){logger[_0x89ef('0x10')]('Campaign,\x20%s,\x20%s',_0x90b5bf,_0x5683b6[_0x89ef('0x10')][_0x89ef('0x11')]);return _0x16e8c3(_0x5683b6['error'][_0x89ef('0x11')]);}logger[_0x89ef('0x10')](_0x89ef('0xc'),_0x90b5bf,_0x5683b6[_0x89ef('0x10')][_0x89ef('0x11')]);return _0x373288(_0x5683b6['error'][_0x89ef('0x11')]);}else{logger['info']('Campaign,\x20%s,\x20%s',_0x90b5bf,_0x89ef('0xd'));_0x373288(_0x5683b6[_0x89ef('0x12')]['message']);}})[_0x89ef('0x13')](function(_0x490877){logger[_0x89ef('0x10')]('Campaign,\x20%s,\x20%s',_0x90b5bf,_0x490877);_0x16e8c3(_0x490877);});});}exports[_0x89ef('0x14')]=function(_0x2c5f51){var _0x2aa140=this;return new Promise(function(_0x1189d7,_0x5e3aed){return db[_0x89ef('0x15')][_0x89ef('0x16')]({'raw':_0x2c5f51[_0x89ef('0x17')]?_0x2c5f51[_0x89ef('0x17')][_0x89ef('0x18')]===undefined?!![]:![]:!![],'where':_0x2c5f51[_0x89ef('0x17')]?_0x2c5f51[_0x89ef('0x17')][_0x89ef('0x19')]||null:null,'attributes':_0x2c5f51[_0x89ef('0x17')]?_0x2c5f51[_0x89ef('0x17')][_0x89ef('0x1a')]||null:null,'limit':_0x2c5f51[_0x89ef('0x17')]?_0x2c5f51[_0x89ef('0x17')][_0x89ef('0x1b')]||null:null,'include':_0x2c5f51[_0x89ef('0x17')]?_0x2c5f51[_0x89ef('0x17')][_0x89ef('0x1c')]?_['map'](_0x2c5f51['options']['include'],function(_0x5c9242){return{'model':db[_0x5c9242[_0x89ef('0x1d')]],'as':_0x5c9242['as'],'attributes':_0x5c9242[_0x89ef('0x1a')],'include':_0x5c9242['include']?_['map'](_0x5c9242[_0x89ef('0x1c')],function(_0x10bb22){return{'model':db[_0x10bb22['model']],'as':_0x10bb22['as'],'attributes':_0x10bb22['attributes'],'include':_0x10bb22[_0x89ef('0x1c')]?_[_0x89ef('0x1e')](_0x10bb22[_0x89ef('0x1c')],function(_0x3efb34){return{'model':db[_0x3efb34[_0x89ef('0x1d')]],'as':_0x3efb34['as'],'attributes':_0x3efb34[_0x89ef('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x89ef('0xa')](function(_0x5e8108){logger[_0x89ef('0xb')](_0x89ef('0x14'),_0x2c5f51);logger[_0x89ef('0x1f')](_0x89ef('0x14'),_0x2c5f51,JSON['stringify'](_0x5e8108));_0x1189d7(_0x5e8108);})['catch'](function(_0x51245a){logger[_0x89ef('0x10')](_0x89ef('0x14'),_0x51245a['message'],_0x2c5f51);_0x5e3aed(_0x2aa140[_0x89ef('0x10')](0x1f4,_0x51245a[_0x89ef('0x11')]));});});}; \ No newline at end of file +var _0x4c6d=['info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetCampaign','Campaign','findAll','options','raw','where','limit','include','map','model','attributes','then','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request'];(function(_0x578f2a,_0x2dfe78){var _0xb77346=function(_0x5ebd29){while(--_0x5ebd29){_0x578f2a['push'](_0x578f2a['shift']());}};_0xb77346(++_0x2dfe78);}(_0x4c6d,0x1d0));var _0xd4c6=function(_0x47bba1,_0x250bac){_0x47bba1=_0x47bba1-0x0;var _0x587c23=_0x4c6d[_0x47bba1];return _0x587c23;};'use strict';var _=require(_0xd4c6('0x0'));var util=require(_0xd4c6('0x1'));var moment=require(_0xd4c6('0x2'));var BPromise=require(_0xd4c6('0x3'));var rs=require(_0xd4c6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd4c6('0x5'))['db'];var utils=require(_0xd4c6('0x6'));var logger=require(_0xd4c6('0x7'))('rpc');var config=require(_0xd4c6('0x8'));var jayson=require(_0xd4c6('0x9'));var client=jayson['client'][_0xd4c6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x316314,_0x4329e3,_0x5d4fce){return new BPromise(function(_0x440ee3,_0x19ce1c){return client[_0xd4c6('0xb')](_0x316314,_0x5d4fce)['then'](function(_0xe2f90b){logger[_0xd4c6('0xc')](_0xd4c6('0xd'),_0x4329e3,'request\x20sent');logger[_0xd4c6('0xe')](_0xd4c6('0xf'),_0x4329e3,_0xd4c6('0x10'),JSON[_0xd4c6('0x11')](_0xe2f90b));if(_0xe2f90b[_0xd4c6('0x12')]){if(_0xe2f90b[_0xd4c6('0x12')]['code']===0x1f4){logger['error'](_0xd4c6('0xd'),_0x4329e3,_0xe2f90b['error'][_0xd4c6('0x13')]);return _0x19ce1c(_0xe2f90b[_0xd4c6('0x12')][_0xd4c6('0x13')]);}logger[_0xd4c6('0x12')](_0xd4c6('0xd'),_0x4329e3,_0xe2f90b[_0xd4c6('0x12')][_0xd4c6('0x13')]);return _0x440ee3(_0xe2f90b['error']['message']);}else{logger[_0xd4c6('0xc')](_0xd4c6('0xd'),_0x4329e3,_0xd4c6('0x10'));_0x440ee3(_0xe2f90b[_0xd4c6('0x14')][_0xd4c6('0x13')]);}})[_0xd4c6('0x15')](function(_0xe52075){logger['error'](_0xd4c6('0xd'),_0x4329e3,_0xe52075);_0x19ce1c(_0xe52075);});});}exports[_0xd4c6('0x16')]=function(_0x23a16f){var _0x2c97b=this;return new Promise(function(_0x31f328,_0x54e0a5){return db[_0xd4c6('0x17')][_0xd4c6('0x18')]({'raw':_0x23a16f[_0xd4c6('0x19')]?_0x23a16f['options'][_0xd4c6('0x1a')]===undefined?!![]:![]:!![],'where':_0x23a16f[_0xd4c6('0x19')]?_0x23a16f[_0xd4c6('0x19')][_0xd4c6('0x1b')]||null:null,'attributes':_0x23a16f['options']?_0x23a16f[_0xd4c6('0x19')]['attributes']||null:null,'limit':_0x23a16f[_0xd4c6('0x19')]?_0x23a16f[_0xd4c6('0x19')][_0xd4c6('0x1c')]||null:null,'include':_0x23a16f[_0xd4c6('0x19')]?_0x23a16f[_0xd4c6('0x19')][_0xd4c6('0x1d')]?_[_0xd4c6('0x1e')](_0x23a16f[_0xd4c6('0x19')][_0xd4c6('0x1d')],function(_0x466330){return{'model':db[_0x466330[_0xd4c6('0x1f')]],'as':_0x466330['as'],'attributes':_0x466330[_0xd4c6('0x20')],'include':_0x466330['include']?_['map'](_0x466330[_0xd4c6('0x1d')],function(_0x2febbf){return{'model':db[_0x2febbf['model']],'as':_0x2febbf['as'],'attributes':_0x2febbf[_0xd4c6('0x20')],'include':_0x2febbf[_0xd4c6('0x1d')]?_[_0xd4c6('0x1e')](_0x2febbf['include'],function(_0x35b50c){return{'model':db[_0x35b50c[_0xd4c6('0x1f')]],'as':_0x35b50c['as'],'attributes':_0x35b50c['attributes']};}):[]};}):[]};}):[]:[]})[_0xd4c6('0x21')](function(_0x8ce066){logger[_0xd4c6('0xc')]('GetCampaign',_0x23a16f);logger[_0xd4c6('0xe')](_0xd4c6('0x16'),_0x23a16f,JSON[_0xd4c6('0x11')](_0x8ce066));_0x31f328(_0x8ce066);})[_0xd4c6('0x15')](function(_0x2e8c34){logger[_0xd4c6('0x12')](_0xd4c6('0x16'),_0x2e8c34[_0xd4c6('0x13')],_0x23a16f);_0x54e0a5(_0x2c97b[_0xd4c6('0x12')](0x1f4,_0x2e8c34[_0xd4c6('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index ca23f10..8c1383c 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 _0x4092=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_black','/:id/lists','/:id/blacklists','create','post','/:id/clone','clone','addBlackLists','put','delete','removeBlackLists','exports','util','path','connect-timeout','express'];(function(_0x53b611,_0x2912fa){var _0x5649aa=function(_0x18b222){while(--_0x18b222){_0x53b611['push'](_0x53b611['shift']());}};_0x5649aa(++_0x2912fa);}(_0x4092,0x1af));var _0x2409=function(_0xea4f3a,_0x46d2e6){_0xea4f3a=_0xea4f3a-0x0;var _0x88e3dd=_0x4092[_0xea4f3a];return _0x88e3dd;};'use strict';var multer=require('multer');var util=require(_0x2409('0x0'));var path=require(_0x2409('0x1'));var timeout=require(_0x2409('0x2'));var express=require(_0x2409('0x3'));var router=express[_0x2409('0x4')]();var fs_extra=require(_0x2409('0x5'));var auth=require(_0x2409('0x6'));var interaction=require(_0x2409('0x7'));var config=require(_0x2409('0x8'));var controller=require('./campaign.controller');router[_0x2409('0x9')]('/',auth[_0x2409('0xa')](),controller[_0x2409('0xb')]);router['get'](_0x2409('0xc'),auth[_0x2409('0xa')](),controller[_0x2409('0xd')]);router[_0x2409('0x9')](_0x2409('0xe'),auth[_0x2409('0xa')](),controller[_0x2409('0xf')]);router['get']('/:id/hopper_histories',auth[_0x2409('0xa')](),controller[_0x2409('0x10')]);router['get']('/:id/hopper_finals',auth[_0x2409('0xa')](),controller['getHopperFinals']);router[_0x2409('0x9')](_0x2409('0x11'),auth[_0x2409('0xa')](),controller['getHopperBlacks']);router['get'](_0x2409('0x12'),auth[_0x2409('0xa')](),controller['getLists']);router['get'](_0x2409('0x13'),auth[_0x2409('0xa')](),controller['getBlackLists']);router['post']('/',auth['isAuthenticated'](),controller[_0x2409('0x14')]);router[_0x2409('0x15')](_0x2409('0x16'),auth[_0x2409('0xa')](),controller[_0x2409('0x17')]);router[_0x2409('0x15')]('/:id/lists',auth['isAuthenticated'](),controller['addLists']);router[_0x2409('0x15')](_0x2409('0x13'),auth[_0x2409('0xa')](),controller[_0x2409('0x18')]);router[_0x2409('0x19')](_0x2409('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x2409('0x1a')](_0x2409('0xc'),auth['isAuthenticated'](),controller['destroy']);router[_0x2409('0x1a')](_0x2409('0x12'),auth['isAuthenticated'](),controller['removeLists']);router[_0x2409('0x1a')](_0x2409('0x13'),auth[_0x2409('0xa')](),controller[_0x2409('0x1b')]);module[_0x2409('0x1c')]=router; \ No newline at end of file +var _0x82c0=['../../config/environment','./campaign.controller','isAuthenticated','/:id','show','/:id/hoppers','getHoppers','get','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','put','update','delete','destroy','removeLists','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0xbf8b4d,_0xdf0650){var _0x1f6800=function(_0x553442){while(--_0x553442){_0xbf8b4d['push'](_0xbf8b4d['shift']());}};_0x1f6800(++_0xdf0650);}(_0x82c0,0xe8));var _0x082c=function(_0x4793d6,_0x71e3c){_0x4793d6=_0x4793d6-0x0;var _0x222dea=_0x82c0[_0x4793d6];return _0x222dea;};'use strict';var multer=require(_0x082c('0x0'));var util=require(_0x082c('0x1'));var path=require('path');var timeout=require(_0x082c('0x2'));var express=require(_0x082c('0x3'));var router=express[_0x082c('0x4')]();var fs_extra=require(_0x082c('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x082c('0x6'));var controller=require(_0x082c('0x7'));router['get']('/',auth[_0x082c('0x8')](),controller['index']);router['get'](_0x082c('0x9'),auth[_0x082c('0x8')](),controller[_0x082c('0xa')]);router['get'](_0x082c('0xb'),auth[_0x082c('0x8')](),controller[_0x082c('0xc')]);router[_0x082c('0xd')](_0x082c('0xe'),auth['isAuthenticated'](),controller[_0x082c('0xf')]);router[_0x082c('0xd')](_0x082c('0x10'),auth['isAuthenticated'](),controller[_0x082c('0x11')]);router['get'](_0x082c('0x12'),auth[_0x082c('0x8')](),controller['getHopperBlacks']);router['get'](_0x082c('0x13'),auth[_0x082c('0x8')](),controller['getLists']);router[_0x082c('0xd')](_0x082c('0x14'),auth[_0x082c('0x8')](),controller[_0x082c('0x15')]);router[_0x082c('0x16')]('/',auth['isAuthenticated'](),controller[_0x082c('0x17')]);router[_0x082c('0x16')](_0x082c('0x18'),auth['isAuthenticated'](),controller[_0x082c('0x19')]);router[_0x082c('0x16')](_0x082c('0x13'),auth[_0x082c('0x8')](),controller[_0x082c('0x1a')]);router[_0x082c('0x16')](_0x082c('0x14'),auth[_0x082c('0x8')](),controller[_0x082c('0x1b')]);router[_0x082c('0x1c')]('/:id',auth[_0x082c('0x8')](),controller[_0x082c('0x1d')]);router[_0x082c('0x1e')](_0x082c('0x9'),auth[_0x082c('0x8')](),controller[_0x082c('0x1f')]);router[_0x082c('0x1e')]('/:id/lists',auth[_0x082c('0x8')](),controller[_0x082c('0x20')]);router[_0x082c('0x1e')](_0x082c('0x14'),auth[_0x082c('0x8')](),controller['removeBlackLists']);module[_0x082c('0x21')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 0a21017..0f40605 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 _0x51a8=['exports','STRING','getDataValue','sequelize'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x51a8,0x1db));var _0x851a=function(_0x424c67,_0x2fd19b){_0x424c67=_0x424c67-0x0;var _0x509b9a=_0x51a8[_0x424c67];return _0x509b9a;};'use strict';var Sequelize=require(_0x851a('0x0'));module[_0x851a('0x1')]={'key':{'type':Sequelize[_0x851a('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x851a('0x3')]('key');}}}; \ No newline at end of file +var _0xff2c=['exports','STRING','TEXT','VIRTUAL'];(function(_0x145954,_0x2fc62e){var _0x325e48=function(_0x1d4a50){while(--_0x1d4a50){_0x145954['push'](_0x145954['shift']());}};_0x325e48(++_0x2fc62e);}(_0xff2c,0x68));var _0xcff2=function(_0x3d34da,_0x3abcc1){_0x3d34da=_0x3d34da-0x0;var _0xcf6af8=_0xff2c[_0x3d34da];return _0xcf6af8;};'use strict';var Sequelize=require('sequelize');module[_0xcff2('0x0')]={'key':{'type':Sequelize[_0xcff2('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0xcff2('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xcff2('0x3')],'get':function(){return this['getDataValue']('key');}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 7546936..3360f69 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 _0xdc77=['sendStatus','status','json','limit','undefined','offset','count','set','Content-Range','apply','reject','save','then','destroy','get','CannedAnswers','UserProfileResource','end','error','stack','send','index','CannedAnswer','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','filter','merge','include','findAll','catch','show','params','includeAll','options','find','update','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xdc77,0xed));var _0x7dc7=function(_0x278495,_0x264281){_0x278495=_0x278495-0x0;var _0x229a4a=_0xdc77[_0x278495];return _0x229a4a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7dc7('0x0'));var zipdir=require(_0x7dc7('0x1'));var jsonpatch=require(_0x7dc7('0x2'));var rp=require('request-promise');var moment=require(_0x7dc7('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7dc7('0x4'));var path=require(_0x7dc7('0x5'));var sox=require(_0x7dc7('0x6'));var csv=require('to-csv');var ejs=require(_0x7dc7('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7dc7('0x8'));var crypto=require('crypto');var jsforce=require(_0x7dc7('0x9'));var deskjs=require(_0x7dc7('0xa'));var toCsv=require('to-csv');var querystring=require(_0x7dc7('0xb'));var Papa=require('papaparse');var Redis=require(_0x7dc7('0xc'));var authService=require(_0x7dc7('0xd'));var qs=require(_0x7dc7('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7dc7('0xf'));var logger=require(_0x7dc7('0x10'))(_0x7dc7('0x11'));var utils=require('../../config/utils');var config=require(_0x7dc7('0x12'));var licenseUtil=require(_0x7dc7('0x13'));var db=require(_0x7dc7('0x14'))['db'];function respondWithStatusCode(_0x2d758d,_0x404fb){_0x404fb=_0x404fb||0xcc;return function(_0x984aa5){if(_0x984aa5){return _0x2d758d[_0x7dc7('0x15')](_0x404fb);}return _0x2d758d['status'](_0x404fb)['end']();};}function respondWithResult(_0x235261,_0x305b82){_0x305b82=_0x305b82||0xc8;return function(_0xa5688e){if(_0xa5688e){return _0x235261[_0x7dc7('0x16')](_0x305b82)[_0x7dc7('0x17')](_0xa5688e);}};}function respondWithFilteredResult(_0x1b0831,_0x2fe5d2){return function(_0x59c3b4){if(_0x59c3b4){var _0x261cfa=typeof _0x2fe5d2['offset']==='undefined'&&typeof _0x2fe5d2[_0x7dc7('0x18')]===_0x7dc7('0x19');var _0x16c4dc=_0x59c3b4['count'];var _0x473a03=_0x261cfa?0x0:_0x2fe5d2[_0x7dc7('0x1a')];var _0x2972e6=_0x261cfa?_0x59c3b4[_0x7dc7('0x1b')]:_0x2fe5d2[_0x7dc7('0x1a')]+_0x2fe5d2[_0x7dc7('0x18')];var _0x14e49a;if(_0x2972e6>=_0x16c4dc){_0x2972e6=_0x16c4dc;_0x14e49a=0xc8;}else{_0x14e49a=0xce;}_0x1b0831[_0x7dc7('0x16')](_0x14e49a);return _0x1b0831[_0x7dc7('0x1c')](_0x7dc7('0x1d'),_0x473a03+'-'+_0x2972e6+'/'+_0x16c4dc)[_0x7dc7('0x17')](_0x59c3b4);}return null;};}function patchUpdates(_0xdecb31){return function(_0x4881f4){try{jsonpatch[_0x7dc7('0x1e')](_0x4881f4,_0xdecb31,!![]);}catch(_0x5705cb){return BPromise[_0x7dc7('0x1f')](_0x5705cb);}return _0x4881f4[_0x7dc7('0x20')]();};}function saveUpdates(_0x26f99d,_0x53f2f5){return function(_0x4616bf){if(_0x4616bf){return _0x4616bf['update'](_0x26f99d)[_0x7dc7('0x21')](function(_0x1c0627){return _0x1c0627;});}return null;};}function removeEntity(_0x20333d,_0x19628b){return function(_0xbbdcc3){if(_0xbbdcc3){return _0xbbdcc3[_0x7dc7('0x22')]()[_0x7dc7('0x21')](function(){var _0xfff274=_0xbbdcc3[_0x7dc7('0x23')]({'plain':!![]});var _0x123a36=_0x7dc7('0x24');return db[_0x7dc7('0x25')][_0x7dc7('0x22')]({'where':{'type':_0x123a36,'resourceId':_0xfff274['id']}})[_0x7dc7('0x21')](function(){return _0xbbdcc3;});})[_0x7dc7('0x21')](function(){_0x20333d[_0x7dc7('0x16')](0xcc)[_0x7dc7('0x26')]();});}};}function handleEntityNotFound(_0xd3c24b,_0x3b511d){return function(_0x423a23){if(!_0x423a23){_0xd3c24b[_0x7dc7('0x15')](0x194);}return _0x423a23;};}function handleError(_0x2c5983,_0x38b7c2){_0x38b7c2=_0x38b7c2||0x1f4;return function(_0x3144f1){logger[_0x7dc7('0x27')](_0x3144f1[_0x7dc7('0x28')]);if(_0x3144f1['name']){delete _0x3144f1['name'];}_0x2c5983['status'](_0x38b7c2)[_0x7dc7('0x29')](_0x3144f1);};}exports[_0x7dc7('0x2a')]=function(_0x3ba0e0,_0xfbd198){var _0x2974c4={},_0x715c31={},_0x54de13={'count':0x0,'rows':[]};var _0x344aa5=_['map'](db[_0x7dc7('0x2b')][_0x7dc7('0x2c')],function(_0x1e5431){return{'name':_0x1e5431['fieldName'],'type':_0x1e5431[_0x7dc7('0x2d')][_0x7dc7('0x2e')]};});_0x715c31[_0x7dc7('0x2f')]=_[_0x7dc7('0x30')](_0x344aa5,'name');_0x715c31[_0x7dc7('0x31')]=_[_0x7dc7('0x32')](_0x3ba0e0[_0x7dc7('0x31')]);_0x715c31[_0x7dc7('0x33')]=_[_0x7dc7('0x34')](_0x715c31[_0x7dc7('0x2f')],_0x715c31[_0x7dc7('0x31')]);_0x2974c4['attributes']=_[_0x7dc7('0x34')](_0x715c31[_0x7dc7('0x2f')],qs[_0x7dc7('0x35')](_0x3ba0e0[_0x7dc7('0x31')]['fields']));_0x2974c4[_0x7dc7('0x36')]=_0x2974c4['attributes'][_0x7dc7('0x37')]?_0x2974c4[_0x7dc7('0x36')]:_0x715c31['model'];if(!_0x3ba0e0['query'][_0x7dc7('0x38')]('nolimit')){_0x2974c4[_0x7dc7('0x18')]=qs[_0x7dc7('0x18')](_0x3ba0e0['query']['limit']);_0x2974c4[_0x7dc7('0x1a')]=qs[_0x7dc7('0x1a')](_0x3ba0e0[_0x7dc7('0x31')][_0x7dc7('0x1a')]);}_0x2974c4['order']=qs[_0x7dc7('0x39')](_0x3ba0e0['query'][_0x7dc7('0x39')]);_0x2974c4[_0x7dc7('0x3a')]=qs[_0x7dc7('0x33')](_['pick'](_0x3ba0e0[_0x7dc7('0x31')],_0x715c31['filters']),_0x344aa5);if(_0x3ba0e0[_0x7dc7('0x31')][_0x7dc7('0x3b')]){_0x2974c4['where']=_[_0x7dc7('0x3c')](_0x2974c4[_0x7dc7('0x3a')],{'$or':[{'key':{'$like':'%'+_0x3ba0e0[_0x7dc7('0x31')][_0x7dc7('0x3b')]+'%'}},{'value':{'$like':'%'+_0x3ba0e0[_0x7dc7('0x31')][_0x7dc7('0x3b')]+'%'}}]});}_0x2974c4=_[_0x7dc7('0x3c')]({},_0x2974c4,_0x3ba0e0['options']);var _0x5898bc={'where':_0x2974c4[_0x7dc7('0x3a')]};return db[_0x7dc7('0x2b')][_0x7dc7('0x1b')](_0x5898bc)['then'](function(_0x4f8687){_0x54de13['count']=_0x4f8687;if(_0x3ba0e0['query']['includeAll']){_0x2974c4[_0x7dc7('0x3d')]=[{'all':!![]}];}return db[_0x7dc7('0x2b')][_0x7dc7('0x3e')](_0x2974c4);})['then'](function(_0x1bc21c){_0x54de13['rows']=_0x1bc21c;return _0x54de13;})[_0x7dc7('0x21')](respondWithFilteredResult(_0xfbd198,_0x2974c4))[_0x7dc7('0x3f')](handleError(_0xfbd198,null));};exports[_0x7dc7('0x40')]=function(_0x252506,_0x53558b){var _0x42b503={'raw':!![],'where':{'id':_0x252506[_0x7dc7('0x41')]['id']}},_0x3dbc6b={};_0x3dbc6b[_0x7dc7('0x2f')]=_[_0x7dc7('0x32')](db['CannedAnswer']['rawAttributes']);_0x3dbc6b[_0x7dc7('0x31')]=_['keys'](_0x252506[_0x7dc7('0x31')]);_0x3dbc6b[_0x7dc7('0x33')]=_[_0x7dc7('0x34')](_0x3dbc6b['model'],_0x3dbc6b['query']);_0x42b503[_0x7dc7('0x36')]=_[_0x7dc7('0x34')](_0x3dbc6b[_0x7dc7('0x2f')],qs[_0x7dc7('0x35')](_0x252506[_0x7dc7('0x31')][_0x7dc7('0x35')]));_0x42b503[_0x7dc7('0x36')]=_0x42b503[_0x7dc7('0x36')]['length']?_0x42b503[_0x7dc7('0x36')]:_0x3dbc6b['model'];if(_0x252506['query'][_0x7dc7('0x42')]){_0x42b503[_0x7dc7('0x3d')]=[{'all':!![]}];}_0x42b503=_[_0x7dc7('0x3c')]({},_0x42b503,_0x252506[_0x7dc7('0x43')]);return db[_0x7dc7('0x2b')][_0x7dc7('0x44')](_0x42b503)[_0x7dc7('0x21')](handleEntityNotFound(_0x53558b,null))[_0x7dc7('0x21')](respondWithResult(_0x53558b,null))[_0x7dc7('0x3f')](handleError(_0x53558b,null));};exports[_0x7dc7('0x45')]=function(_0x63d4b9,_0x41721c){if(_0x63d4b9[_0x7dc7('0x46')]['id']){delete _0x63d4b9[_0x7dc7('0x46')]['id'];}return db[_0x7dc7('0x2b')][_0x7dc7('0x44')]({'where':{'id':_0x63d4b9['params']['id']}})[_0x7dc7('0x21')](handleEntityNotFound(_0x41721c,null))[_0x7dc7('0x21')](saveUpdates(_0x63d4b9[_0x7dc7('0x46')],null))[_0x7dc7('0x21')](respondWithResult(_0x41721c,null))['catch'](handleError(_0x41721c,null));};exports[_0x7dc7('0x22')]=function(_0x3c00fc,_0x2d2a06){return db[_0x7dc7('0x2b')]['find']({'where':{'id':_0x3c00fc[_0x7dc7('0x41')]['id']}})[_0x7dc7('0x21')](handleEntityNotFound(_0x2d2a06,null))[_0x7dc7('0x21')](removeEntity(_0x2d2a06,null))[_0x7dc7('0x3f')](handleError(_0x2d2a06,null));};exports[_0x7dc7('0x47')]=function(_0x17167b,_0x36ed69){var _0x24677e={'key':_0x17167b[_0x7dc7('0x46')][_0x7dc7('0x2e')]};if(_0x17167b[_0x7dc7('0x46')][_0x7dc7('0x48')]){_0x24677e[_0x7dc7('0x48')]=_0x17167b[_0x7dc7('0x46')]['MailAccountId'];}else if(_0x17167b[_0x7dc7('0x46')]['SmsAccountId']){_0x24677e[_0x7dc7('0x49')]=_0x17167b[_0x7dc7('0x46')][_0x7dc7('0x49')];}else if(_0x17167b[_0x7dc7('0x46')][_0x7dc7('0x4a')]){_0x24677e[_0x7dc7('0x4a')]=_0x17167b[_0x7dc7('0x46')][_0x7dc7('0x4a')];}else if(_0x17167b['body'][_0x7dc7('0x4b')]){_0x24677e['ChatWebsiteId']=_0x17167b['body'][_0x7dc7('0x4b')];}return db['CannedAnswer'][_0x7dc7('0x44')]({'where':_0x24677e})[_0x7dc7('0x21')](function(_0x5b9937){if(_0x5b9937){throw new db[(_0x7dc7('0x4c'))][(_0x7dc7('0x4d'))](_0x7dc7('0x4e'));}return db[_0x7dc7('0x2b')][_0x7dc7('0x47')](_0x17167b[_0x7dc7('0x46')]);})['then'](function(_0x36d043){var _0x4ef93a=_0x17167b[_0x7dc7('0x4f')][_0x7dc7('0x23')]({'plain':!![]});if(!_0x4ef93a)throw new Error(_0x7dc7('0x50'));if(_0x4ef93a[_0x7dc7('0x51')]===_0x7dc7('0x4f')){var _0x3811b0=_0x36d043[_0x7dc7('0x23')]({'plain':!![]});return db[_0x7dc7('0x52')][_0x7dc7('0x44')]({'where':{'name':_0x7dc7('0x24'),'userProfileId':_0x4ef93a[_0x7dc7('0x53')]},'raw':!![]})['then'](function(_0x3b7f63){if(_0x3b7f63&&_0x3b7f63['autoAssociation']===0x0){return db[_0x7dc7('0x25')][_0x7dc7('0x47')]({'name':_0x3811b0[_0x7dc7('0x54')],'resourceId':_0x3811b0['id'],'type':_0x3b7f63[_0x7dc7('0x54')],'sectionId':_0x3b7f63['id']},{})[_0x7dc7('0x21')](function(){return _0x36d043;});}else{return _0x36d043;}})[_0x7dc7('0x3f')](function(_0x49738b){logger[_0x7dc7('0x27')](_0x7dc7('0x55'),_0x49738b);throw _0x49738b;});}return _0x36d043;})[_0x7dc7('0x21')](respondWithResult(_0x36ed69,0xc9))[_0x7dc7('0x3f')](handleError(_0x36ed69,null));}; \ No newline at end of file +var _0xb2a2=['key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','eml-format','rimraf','zip-dir','moment','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','apply','reject','update','get','CannedAnswers','UserProfileResource','destroy','then','end','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','filter','merge','options','CannedAnswer','includeAll','findAll','rows','show','params','include','find','catch','body','create'];(function(_0x3bb7eb,_0x184c53){var _0x247ba2=function(_0x2cea5c){while(--_0x2cea5c){_0x3bb7eb['push'](_0x3bb7eb['shift']());}};_0x247ba2(++_0x184c53);}(_0xb2a2,0x64));var _0x2b2a=function(_0x45cc86,_0x3427d5){_0x45cc86=_0x45cc86-0x0;var _0x30c203=_0xb2a2[_0x45cc86];return _0x30c203;};'use strict';var emlformat=require(_0x2b2a('0x0'));var rimraf=require(_0x2b2a('0x1'));var zipdir=require(_0x2b2a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2b2a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2b2a('0x4'));var util=require('util');var path=require('path');var sox=require(_0x2b2a('0x5'));var csv=require(_0x2b2a('0x6'));var ejs=require(_0x2b2a('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2b2a('0x8'));var squel=require(_0x2b2a('0x9'));var crypto=require(_0x2b2a('0xa'));var jsforce=require(_0x2b2a('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x2b2a('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2b2a('0xc'));var qs=require(_0x2b2a('0xd'));var as=require(_0x2b2a('0xe'));var hardwareService=require(_0x2b2a('0xf'));var logger=require(_0x2b2a('0x10'))(_0x2b2a('0x11'));var utils=require(_0x2b2a('0x12'));var config=require(_0x2b2a('0x13'));var licenseUtil=require(_0x2b2a('0x14'));var db=require(_0x2b2a('0x15'))['db'];function respondWithStatusCode(_0x1bacec,_0x522c33){_0x522c33=_0x522c33||0xcc;return function(_0x4b90c4){if(_0x4b90c4){return _0x1bacec[_0x2b2a('0x16')](_0x522c33);}return _0x1bacec[_0x2b2a('0x17')](_0x522c33)['end']();};}function respondWithResult(_0x1ec4c1,_0x76ede9){_0x76ede9=_0x76ede9||0xc8;return function(_0x3a5068){if(_0x3a5068){return _0x1ec4c1[_0x2b2a('0x17')](_0x76ede9)[_0x2b2a('0x18')](_0x3a5068);}};}function respondWithFilteredResult(_0x777579,_0x413e67){return function(_0x586cf4){if(_0x586cf4){var _0x332cf3=typeof _0x413e67[_0x2b2a('0x19')]==='undefined'&&typeof _0x413e67[_0x2b2a('0x1a')]===_0x2b2a('0x1b');var _0x3855ac=_0x586cf4[_0x2b2a('0x1c')];var _0x3fefea=_0x332cf3?0x0:_0x413e67['offset'];var _0x34c489=_0x332cf3?_0x586cf4['count']:_0x413e67[_0x2b2a('0x19')]+_0x413e67[_0x2b2a('0x1a')];var _0x58951c;if(_0x34c489>=_0x3855ac){_0x34c489=_0x3855ac;_0x58951c=0xc8;}else{_0x58951c=0xce;}_0x777579['status'](_0x58951c);return _0x777579[_0x2b2a('0x1d')]('Content-Range',_0x3fefea+'-'+_0x34c489+'/'+_0x3855ac)['json'](_0x586cf4);}return null;};}function patchUpdates(_0x157afa){return function(_0x176dd6){try{jsonpatch[_0x2b2a('0x1e')](_0x176dd6,_0x157afa,!![]);}catch(_0x1db4fc){return BPromise[_0x2b2a('0x1f')](_0x1db4fc);}return _0x176dd6['save']();};}function saveUpdates(_0x9eaa98,_0x23520f){return function(_0x13134f){if(_0x13134f){return _0x13134f[_0x2b2a('0x20')](_0x9eaa98)['then'](function(_0x106a7f){return _0x106a7f;});}return null;};}function removeEntity(_0x10618e,_0x2528f3){return function(_0xb8481c){if(_0xb8481c){return _0xb8481c['destroy']()['then'](function(){var _0x4dfcc2=_0xb8481c[_0x2b2a('0x21')]({'plain':!![]});var _0x5211cb=_0x2b2a('0x22');return db[_0x2b2a('0x23')][_0x2b2a('0x24')]({'where':{'type':_0x5211cb,'resourceId':_0x4dfcc2['id']}})['then'](function(){return _0xb8481c;});})[_0x2b2a('0x25')](function(){_0x10618e[_0x2b2a('0x17')](0xcc)[_0x2b2a('0x26')]();});}};}function handleEntityNotFound(_0x891a0b,_0x15fd6c){return function(_0x592150){if(!_0x592150){_0x891a0b['sendStatus'](0x194);}return _0x592150;};}function handleError(_0x4cc1ce,_0x4cd5d3){_0x4cd5d3=_0x4cd5d3||0x1f4;return function(_0x1f132c){logger['error'](_0x1f132c['stack']);if(_0x1f132c['name']){delete _0x1f132c[_0x2b2a('0x27')];}_0x4cc1ce[_0x2b2a('0x17')](_0x4cd5d3)[_0x2b2a('0x28')](_0x1f132c);};}exports[_0x2b2a('0x29')]=function(_0x3f87d9,_0x132320){var _0x39289e={},_0x30151a={},_0x3b2a04={'count':0x0,'rows':[]};var _0x200c10=_[_0x2b2a('0x2a')](db['CannedAnswer'][_0x2b2a('0x2b')],function(_0x503955){return{'name':_0x503955[_0x2b2a('0x2c')],'type':_0x503955[_0x2b2a('0x2d')]['key']};});_0x30151a[_0x2b2a('0x2e')]=_[_0x2b2a('0x2a')](_0x200c10,'name');_0x30151a[_0x2b2a('0x2f')]=_[_0x2b2a('0x30')](_0x3f87d9['query']);_0x30151a['filters']=_[_0x2b2a('0x31')](_0x30151a[_0x2b2a('0x2e')],_0x30151a[_0x2b2a('0x2f')]);_0x39289e['attributes']=_[_0x2b2a('0x31')](_0x30151a['model'],qs[_0x2b2a('0x32')](_0x3f87d9[_0x2b2a('0x2f')][_0x2b2a('0x32')]));_0x39289e[_0x2b2a('0x33')]=_0x39289e['attributes'][_0x2b2a('0x34')]?_0x39289e['attributes']:_0x30151a['model'];if(!_0x3f87d9[_0x2b2a('0x2f')][_0x2b2a('0x35')]('nolimit')){_0x39289e['limit']=qs[_0x2b2a('0x1a')](_0x3f87d9[_0x2b2a('0x2f')][_0x2b2a('0x1a')]);_0x39289e[_0x2b2a('0x19')]=qs[_0x2b2a('0x19')](_0x3f87d9['query'][_0x2b2a('0x19')]);}_0x39289e['order']=qs[_0x2b2a('0x36')](_0x3f87d9['query'][_0x2b2a('0x36')]);_0x39289e[_0x2b2a('0x37')]=qs[_0x2b2a('0x38')](_[_0x2b2a('0x39')](_0x3f87d9['query'],_0x30151a[_0x2b2a('0x38')]),_0x200c10);if(_0x3f87d9['query'][_0x2b2a('0x3a')]){_0x39289e[_0x2b2a('0x37')]=_[_0x2b2a('0x3b')](_0x39289e['where'],{'$or':[{'key':{'$like':'%'+_0x3f87d9[_0x2b2a('0x2f')][_0x2b2a('0x3a')]+'%'}},{'value':{'$like':'%'+_0x3f87d9[_0x2b2a('0x2f')][_0x2b2a('0x3a')]+'%'}}]});}_0x39289e=_['merge']({},_0x39289e,_0x3f87d9[_0x2b2a('0x3c')]);var _0x4b3fd9={'where':_0x39289e[_0x2b2a('0x37')]};return db[_0x2b2a('0x3d')]['count'](_0x4b3fd9)['then'](function(_0x239a9b){_0x3b2a04[_0x2b2a('0x1c')]=_0x239a9b;if(_0x3f87d9['query'][_0x2b2a('0x3e')]){_0x39289e['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x2b2a('0x3f')](_0x39289e);})[_0x2b2a('0x25')](function(_0x1dc997){_0x3b2a04[_0x2b2a('0x40')]=_0x1dc997;return _0x3b2a04;})[_0x2b2a('0x25')](respondWithFilteredResult(_0x132320,_0x39289e))['catch'](handleError(_0x132320,null));};exports[_0x2b2a('0x41')]=function(_0x229243,_0x279098){var _0x409bac={'raw':!![],'where':{'id':_0x229243[_0x2b2a('0x42')]['id']}},_0x1f5ee5={};_0x1f5ee5['model']=_[_0x2b2a('0x30')](db[_0x2b2a('0x3d')][_0x2b2a('0x2b')]);_0x1f5ee5[_0x2b2a('0x2f')]=_[_0x2b2a('0x30')](_0x229243[_0x2b2a('0x2f')]);_0x1f5ee5[_0x2b2a('0x38')]=_[_0x2b2a('0x31')](_0x1f5ee5[_0x2b2a('0x2e')],_0x1f5ee5[_0x2b2a('0x2f')]);_0x409bac[_0x2b2a('0x33')]=_[_0x2b2a('0x31')](_0x1f5ee5[_0x2b2a('0x2e')],qs[_0x2b2a('0x32')](_0x229243[_0x2b2a('0x2f')][_0x2b2a('0x32')]));_0x409bac['attributes']=_0x409bac['attributes'][_0x2b2a('0x34')]?_0x409bac['attributes']:_0x1f5ee5[_0x2b2a('0x2e')];if(_0x229243[_0x2b2a('0x2f')]['includeAll']){_0x409bac[_0x2b2a('0x43')]=[{'all':!![]}];}_0x409bac=_[_0x2b2a('0x3b')]({},_0x409bac,_0x229243[_0x2b2a('0x3c')]);return db[_0x2b2a('0x3d')][_0x2b2a('0x44')](_0x409bac)[_0x2b2a('0x25')](handleEntityNotFound(_0x279098,null))[_0x2b2a('0x25')](respondWithResult(_0x279098,null))[_0x2b2a('0x45')](handleError(_0x279098,null));};exports[_0x2b2a('0x20')]=function(_0x4f24af,_0x3604da){if(_0x4f24af[_0x2b2a('0x46')]['id']){delete _0x4f24af[_0x2b2a('0x46')]['id'];}return db[_0x2b2a('0x3d')][_0x2b2a('0x44')]({'where':{'id':_0x4f24af[_0x2b2a('0x42')]['id']}})['then'](handleEntityNotFound(_0x3604da,null))[_0x2b2a('0x25')](saveUpdates(_0x4f24af[_0x2b2a('0x46')],null))[_0x2b2a('0x25')](respondWithResult(_0x3604da,null))[_0x2b2a('0x45')](handleError(_0x3604da,null));};exports['destroy']=function(_0x5b44a9,_0x3ee99b){return db[_0x2b2a('0x3d')][_0x2b2a('0x44')]({'where':{'id':_0x5b44a9[_0x2b2a('0x42')]['id']}})['then'](handleEntityNotFound(_0x3ee99b,null))[_0x2b2a('0x25')](removeEntity(_0x3ee99b,null))[_0x2b2a('0x45')](handleError(_0x3ee99b,null));};exports[_0x2b2a('0x47')]=function(_0x39a0a2,_0x436f5e){var _0x2fe612={'key':_0x39a0a2['body'][_0x2b2a('0x48')]};if(_0x39a0a2[_0x2b2a('0x46')]['MailAccountId']){_0x2fe612[_0x2b2a('0x49')]=_0x39a0a2[_0x2b2a('0x46')]['MailAccountId'];}else if(_0x39a0a2['body'][_0x2b2a('0x4a')]){_0x2fe612[_0x2b2a('0x4a')]=_0x39a0a2[_0x2b2a('0x46')][_0x2b2a('0x4a')];}else if(_0x39a0a2[_0x2b2a('0x46')][_0x2b2a('0x4b')]){_0x2fe612['OpenchannelAccountId']=_0x39a0a2[_0x2b2a('0x46')][_0x2b2a('0x4b')];}else if(_0x39a0a2['body']['ChatWebsiteId']){_0x2fe612[_0x2b2a('0x4c')]=_0x39a0a2[_0x2b2a('0x46')][_0x2b2a('0x4c')];}return db[_0x2b2a('0x3d')][_0x2b2a('0x44')]({'where':_0x2fe612})[_0x2b2a('0x25')](function(_0x5dc395){if(_0x5dc395){throw new db[(_0x2b2a('0x4d'))][(_0x2b2a('0x4e'))](_0x2b2a('0x4f'));}return db[_0x2b2a('0x3d')][_0x2b2a('0x47')](_0x39a0a2['body']);})[_0x2b2a('0x25')](function(_0x267fe9){var _0x53a0a2=_0x39a0a2[_0x2b2a('0x50')][_0x2b2a('0x21')]({'plain':!![]});if(!_0x53a0a2)throw new Error(_0x2b2a('0x51'));if(_0x53a0a2[_0x2b2a('0x52')]===_0x2b2a('0x50')){var _0x4766d6=_0x267fe9[_0x2b2a('0x21')]({'plain':!![]});return db[_0x2b2a('0x53')][_0x2b2a('0x44')]({'where':{'name':_0x2b2a('0x22'),'userProfileId':_0x53a0a2[_0x2b2a('0x54')]},'raw':!![]})[_0x2b2a('0x25')](function(_0x392687){if(_0x392687&&_0x392687['autoAssociation']===0x0){return db['UserProfileResource'][_0x2b2a('0x47')]({'name':_0x4766d6[_0x2b2a('0x27')],'resourceId':_0x4766d6['id'],'type':_0x392687['name'],'sectionId':_0x392687['id']},{})[_0x2b2a('0x25')](function(){return _0x267fe9;});}else{return _0x267fe9;}})[_0x2b2a('0x45')](function(_0x4de668){logger[_0x2b2a('0x55')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4de668);throw _0x4de668;});}return _0x267fe9;})[_0x2b2a('0x25')](respondWithResult(_0x436f5e,0xc9))[_0x2b2a('0x45')](handleError(_0x436f5e,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index ad56356..b6b01ea 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 _0xaebe=['path','rimraf','./cannedAnswer.attributes','exports','define','tools_canned_answers','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xaebe,0xed));var _0xeaeb=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0xaebe[_0x2e4aa2];return _0x5e6092;};'use strict';var _=require(_0xeaeb('0x0'));var util=require(_0xeaeb('0x1'));var logger=require(_0xeaeb('0x2'))('api');var moment=require('moment');var BPromise=require(_0xeaeb('0x3'));var rp=require(_0xeaeb('0x4'));var fs=require('fs');var path=require(_0xeaeb('0x5'));var rimraf=require(_0xeaeb('0x6'));var config=require('../../config/environment');var attributes=require(_0xeaeb('0x7'));module[_0xeaeb('0x8')]=function(_0x2d542c,_0x1a1a6c){return _0x2d542c[_0xeaeb('0x9')]('CannedAnswer',attributes,{'tableName':_0xeaeb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x1044=['path','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','lodash','util','../../config/logger','api','request-promise'];(function(_0x29cfb1,_0x25382b){var _0x3b0e0c=function(_0x53a654){while(--_0x53a654){_0x29cfb1['push'](_0x29cfb1['shift']());}};_0x3b0e0c(++_0x25382b);}(_0x1044,0x16f));var _0x4104=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x1044[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x4104('0x0'));var util=require(_0x4104('0x1'));var logger=require(_0x4104('0x2'))(_0x4104('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4104('0x4'));var fs=require('fs');var path=require(_0x4104('0x5'));var rimraf=require('rimraf');var config=require(_0x4104('0x6'));var attributes=require(_0x4104('0x7'));module[_0x4104('0x8')]=function(_0x45e726,_0xd70566){return _0x45e726[_0x4104('0x9')](_0x4104('0xa'),attributes,{'tableName':_0x4104('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 988bfc7..7b79775 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(_0x18d556,_0x4c8eea){var _0x2acef1=function(_0x4ed9f4){while(--_0x4ed9f4){_0x18d556['push'](_0x18d556['shift']());}};_0x2acef1(++_0x4c8eea);}(_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','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(_0x593e14,_0x6ba693){var _0x234d7d=function(_0x3f66d6){while(--_0x3f66d6){_0x593e14['push'](_0x593e14['shift']());}};_0x234d7d(++_0x6ba693);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'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 3d724ee..3c167e7 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 _0x7894=['show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x7894,0x1bf));var _0x4789=function(_0x1096f0,_0xb7c8a0){_0x1096f0=_0x1096f0-0x0;var _0x5286c8=_0x7894[_0x1096f0];return _0x5286c8;};'use strict';var multer=require(_0x4789('0x0'));var util=require(_0x4789('0x1'));var path=require(_0x4789('0x2'));var timeout=require(_0x4789('0x3'));var express=require(_0x4789('0x4'));var router=express[_0x4789('0x5')]();var fs_extra=require(_0x4789('0x6'));var auth=require(_0x4789('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x4789('0x8'));var controller=require('./cannedAnswer.controller');router[_0x4789('0x9')]('/',auth[_0x4789('0xa')](),controller[_0x4789('0xb')]);router[_0x4789('0x9')](_0x4789('0xc'),auth['isAuthenticated'](),controller[_0x4789('0xd')]);router['post']('/',auth[_0x4789('0xa')](),controller[_0x4789('0xe')]);router[_0x4789('0xf')]('/:id',auth[_0x4789('0xa')](),controller[_0x4789('0x10')]);router[_0x4789('0x11')](_0x4789('0xc'),auth['isAuthenticated'](),controller[_0x4789('0x12')]);module[_0x4789('0x13')]=router; \ No newline at end of file +var _0xd26d=['connect-timeout','express','Router','fs-extra','get','isAuthenticated','index','/:id','create','put','delete','exports','multer','util','path'];(function(_0x1a2160,_0x1c539a){var _0x32e2c0=function(_0x319331){while(--_0x319331){_0x1a2160['push'](_0x1a2160['shift']());}};_0x32e2c0(++_0x1c539a);}(_0xd26d,0x1bf));var _0xdd26=function(_0x4d8764,_0xd13d7b){_0x4d8764=_0x4d8764-0x0;var _0x4e0b49=_0xd26d[_0x4d8764];return _0x4e0b49;};'use strict';var multer=require(_0xdd26('0x0'));var util=require(_0xdd26('0x1'));var path=require(_0xdd26('0x2'));var timeout=require(_0xdd26('0x3'));var express=require(_0xdd26('0x4'));var router=express[_0xdd26('0x5')]();var fs_extra=require(_0xdd26('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cannedAnswer.controller');router[_0xdd26('0x7')]('/',auth[_0xdd26('0x8')](),controller[_0xdd26('0x9')]);router[_0xdd26('0x7')](_0xdd26('0xa'),auth[_0xdd26('0x8')](),controller['show']);router['post']('/',auth[_0xdd26('0x8')](),controller[_0xdd26('0xb')]);router[_0xdd26('0xc')](_0xdd26('0xa'),auth[_0xdd26('0x8')](),controller['update']);router[_0xdd26('0xd')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xdd26('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 8588f17..17b9ee8 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 _0xd8b0=['INTEGER','sequelize','exports','STRING'];(function(_0x124ff4,_0x51c1b5){var _0x2c240a=function(_0x2633e0){while(--_0x2633e0){_0x124ff4['push'](_0x124ff4['shift']());}};_0x2c240a(++_0x51c1b5);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x0d8b('0x2')]},'dst':{'type':Sequelize[_0x0d8b('0x2')]},'dcontext':{'type':Sequelize[_0x0d8b('0x2')]},'channel':{'type':Sequelize[_0x0d8b('0x2')]},'dstchannel':{'type':Sequelize[_0x0d8b('0x2')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x0d8b('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x0d8b('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0d8b('0x2')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x0d8b('0x2')]},'userfield':{'type':Sequelize[_0x0d8b('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x0d8b('0x2')]},'sequence':{'type':Sequelize[_0x0d8b('0x2')]},'peeraccount':{'type':Sequelize[_0x0d8b('0x2')]},'type':{'type':Sequelize[_0x0d8b('0x2')]},'tag':{'type':Sequelize[_0x0d8b('0x2')]}}; \ No newline at end of file +var _0xd240=['STRING','INTEGER','exports'];(function(_0x2c2dac,_0xecac14){var _0x5450c2=function(_0x45952a){while(--_0x45952a){_0x2c2dac['push'](_0x2c2dac['shift']());}};_0x5450c2(++_0xecac14);}(_0xd240,0x1c7));var _0x0d24=function(_0x1cea44,_0xf58a16){_0x1cea44=_0x1cea44-0x0;var _0x4d2e2e=_0xd240[_0x1cea44];return _0x4d2e2e;};'use strict';var Sequelize=require('sequelize');module[_0x0d24('0x0')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x0d24('0x1')]},'src':{'type':Sequelize[_0x0d24('0x1')]},'dst':{'type':Sequelize[_0x0d24('0x1')]},'dcontext':{'type':Sequelize[_0x0d24('0x1')]},'channel':{'type':Sequelize[_0x0d24('0x1')]},'dstchannel':{'type':Sequelize[_0x0d24('0x1')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x0d24('0x2')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x0d24('0x2')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0d24('0x1')]},'amaflags':{'type':Sequelize[_0x0d24('0x2')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x0d24('0x1')]},'uniqueid':{'type':Sequelize[_0x0d24('0x1')]},'linkedid':{'type':Sequelize[_0x0d24('0x1')]},'sequence':{'type':Sequelize[_0x0d24('0x1')]},'peeraccount':{'type':Sequelize[_0x0d24('0x1')]},'type':{'type':Sequelize[_0x0d24('0x1')]},'tag':{'type':Sequelize[_0x0d24('0x1')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 0f01253..b7187ed 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 _0xfb65=['../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','Cdr','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api'];(function(_0x1a2ef3,_0x21186c){var _0x34f4a4=function(_0x277126){while(--_0x277126){_0x1a2ef3['push'](_0x1a2ef3['shift']());}};_0x34f4a4(++_0x21186c);}(_0xfb65,0x82));var _0x5fb6=function(_0x2b1bb9,_0x3f85cc){_0x2b1bb9=_0x2b1bb9-0x0;var _0x59f401=_0xfb65[_0x2b1bb9];return _0x59f401;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5fb6('0x0'));var zipdir=require(_0x5fb6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5fb6('0x2'));var moment=require('moment');var BPromise=require(_0x5fb6('0x3'));var Mustache=require(_0x5fb6('0x4'));var util=require(_0x5fb6('0x5'));var path=require(_0x5fb6('0x6'));var sox=require(_0x5fb6('0x7'));var csv=require(_0x5fb6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5fb6('0x9'));var squel=require(_0x5fb6('0xa'));var crypto=require(_0x5fb6('0xb'));var jsforce=require(_0x5fb6('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5fb6('0x8'));var querystring=require(_0x5fb6('0xd'));var Papa=require(_0x5fb6('0xe'));var Redis=require(_0x5fb6('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5fb6('0x10'));var as=require(_0x5fb6('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5fb6('0x12'))(_0x5fb6('0x13'));var utils=require(_0x5fb6('0x14'));var config=require(_0x5fb6('0x15'));var licenseUtil=require(_0x5fb6('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1927d0,_0x15b296){_0x15b296=_0x15b296||0xcc;return function(_0x42285b){if(_0x42285b){return _0x1927d0[_0x5fb6('0x17')](_0x15b296);}return _0x1927d0[_0x5fb6('0x18')](_0x15b296)[_0x5fb6('0x19')]();};}function respondWithResult(_0x1a391f,_0x1ded21){_0x1ded21=_0x1ded21||0xc8;return function(_0x5e69c3){if(_0x5e69c3){return _0x1a391f['status'](_0x1ded21)[_0x5fb6('0x1a')](_0x5e69c3);}};}function respondWithFilteredResult(_0xfaea56,_0x58febe){return function(_0x1d57b1){if(_0x1d57b1){var _0x21ddd3=typeof _0x58febe[_0x5fb6('0x1b')]==='undefined'&&typeof _0x58febe[_0x5fb6('0x1c')]===_0x5fb6('0x1d');var _0x27bd8b=_0x1d57b1[_0x5fb6('0x1e')];var _0x167354=_0x21ddd3?0x0:_0x58febe[_0x5fb6('0x1b')];var _0x50bca8=_0x21ddd3?_0x1d57b1[_0x5fb6('0x1e')]:_0x58febe['offset']+_0x58febe[_0x5fb6('0x1c')];var _0x54c319;if(_0x50bca8>=_0x27bd8b){_0x50bca8=_0x27bd8b;_0x54c319=0xc8;}else{_0x54c319=0xce;}_0xfaea56[_0x5fb6('0x18')](_0x54c319);return _0xfaea56[_0x5fb6('0x1f')](_0x5fb6('0x20'),_0x167354+'-'+_0x50bca8+'/'+_0x27bd8b)[_0x5fb6('0x1a')](_0x1d57b1);}return null;};}function patchUpdates(_0x5885f1){return function(_0x418f58){try{jsonpatch[_0x5fb6('0x21')](_0x418f58,_0x5885f1,!![]);}catch(_0x50a414){return BPromise['reject'](_0x50a414);}return _0x418f58[_0x5fb6('0x22')]();};}function saveUpdates(_0x39ace4,_0x48a70e){return function(_0xdf1794){if(_0xdf1794){return _0xdf1794[_0x5fb6('0x23')](_0x39ace4)[_0x5fb6('0x24')](function(_0x36457e){return _0x36457e;});}return null;};}function removeEntity(_0x582f60,_0x2fca34){return function(_0x44aebe){if(_0x44aebe){return _0x44aebe[_0x5fb6('0x25')]()[_0x5fb6('0x24')](function(){_0x582f60[_0x5fb6('0x18')](0xcc)[_0x5fb6('0x19')]();});}};}function handleEntityNotFound(_0x4e2bff,_0x4cbdaf){return function(_0x298b44){if(!_0x298b44){_0x4e2bff[_0x5fb6('0x17')](0x194);}return _0x298b44;};}function handleError(_0x92f94d,_0x3ce22f){_0x3ce22f=_0x3ce22f||0x1f4;return function(_0x2731a3){logger[_0x5fb6('0x26')](_0x2731a3[_0x5fb6('0x27')]);if(_0x2731a3['name']){delete _0x2731a3[_0x5fb6('0x28')];}_0x92f94d[_0x5fb6('0x18')](_0x3ce22f)[_0x5fb6('0x29')](_0x2731a3);};}exports['index']=function(_0x2afc08,_0x1b4ae4){var _0x49a828={},_0x218428={},_0x408fd9={'count':0x0,'rows':[]};var _0x52afd7=_[_0x5fb6('0x2a')](db['Cdr'][_0x5fb6('0x2b')],function(_0x53dbeb){return{'name':_0x53dbeb['fieldName'],'type':_0x53dbeb[_0x5fb6('0x2c')][_0x5fb6('0x2d')]};});_0x218428[_0x5fb6('0x2e')]=_[_0x5fb6('0x2a')](_0x52afd7,_0x5fb6('0x28'));_0x218428[_0x5fb6('0x2f')]=_['keys'](_0x2afc08[_0x5fb6('0x2f')]);_0x218428[_0x5fb6('0x30')]=_[_0x5fb6('0x31')](_0x218428[_0x5fb6('0x2e')],_0x218428[_0x5fb6('0x2f')]);_0x49a828[_0x5fb6('0x32')]=_[_0x5fb6('0x31')](_0x218428[_0x5fb6('0x2e')],qs[_0x5fb6('0x33')](_0x2afc08[_0x5fb6('0x2f')][_0x5fb6('0x33')]));_0x49a828['attributes']=_0x49a828[_0x5fb6('0x32')][_0x5fb6('0x34')]?_0x49a828['attributes']:_0x218428[_0x5fb6('0x2e')];if(!_0x2afc08['query']['hasOwnProperty'](_0x5fb6('0x35'))){_0x49a828[_0x5fb6('0x1c')]=qs[_0x5fb6('0x1c')](_0x2afc08['query'][_0x5fb6('0x1c')]);_0x49a828['offset']=qs['offset'](_0x2afc08[_0x5fb6('0x2f')][_0x5fb6('0x1b')]);}_0x49a828[_0x5fb6('0x36')]=qs[_0x5fb6('0x37')](_0x2afc08[_0x5fb6('0x2f')][_0x5fb6('0x37')]);_0x49a828[_0x5fb6('0x38')]=qs[_0x5fb6('0x30')](_[_0x5fb6('0x39')](_0x2afc08[_0x5fb6('0x2f')],_0x218428[_0x5fb6('0x30')]),_0x52afd7);if(_0x2afc08[_0x5fb6('0x2f')]['filter']){_0x49a828[_0x5fb6('0x38')]=_[_0x5fb6('0x3a')](_0x49a828[_0x5fb6('0x38')],{'$or':_['map'](_0x52afd7,function(_0x1e83fc){if(_0x1e83fc['type']!==_0x5fb6('0x3b')){var _0x4bd9e5={};_0x4bd9e5[_0x1e83fc[_0x5fb6('0x28')]]={'$like':'%'+_0x2afc08[_0x5fb6('0x2f')][_0x5fb6('0x3c')]+'%'};return _0x4bd9e5;}})});}_0x49a828=_[_0x5fb6('0x3a')]({},_0x49a828,_0x2afc08[_0x5fb6('0x3d')]);var _0x59875a={'where':_0x49a828[_0x5fb6('0x38')]};return db[_0x5fb6('0x3e')][_0x5fb6('0x1e')](_0x59875a)[_0x5fb6('0x24')](function(_0x52e858){_0x408fd9[_0x5fb6('0x1e')]=_0x52e858;if(_0x2afc08[_0x5fb6('0x2f')][_0x5fb6('0x3f')]){_0x49a828[_0x5fb6('0x40')]=[{'all':!![]}];}return db[_0x5fb6('0x3e')][_0x5fb6('0x41')](_0x49a828);})['then'](function(_0x10c242){_0x408fd9[_0x5fb6('0x42')]=_0x10c242;return _0x408fd9;})[_0x5fb6('0x24')](respondWithFilteredResult(_0x1b4ae4,_0x49a828))[_0x5fb6('0x43')](handleError(_0x1b4ae4,null));};exports[_0x5fb6('0x44')]=function(_0x290e77,_0xd3245f){var _0x529c2d={'raw':!![],'where':{'id':_0x290e77[_0x5fb6('0x45')]['id']}},_0x2e3f97={};_0x2e3f97[_0x5fb6('0x2e')]=_['keys'](db[_0x5fb6('0x3e')]['rawAttributes']);_0x2e3f97[_0x5fb6('0x2f')]=_[_0x5fb6('0x46')](_0x290e77['query']);_0x2e3f97[_0x5fb6('0x30')]=_[_0x5fb6('0x31')](_0x2e3f97[_0x5fb6('0x2e')],_0x2e3f97['query']);_0x529c2d['attributes']=_[_0x5fb6('0x31')](_0x2e3f97[_0x5fb6('0x2e')],qs[_0x5fb6('0x33')](_0x290e77[_0x5fb6('0x2f')][_0x5fb6('0x33')]));_0x529c2d[_0x5fb6('0x32')]=_0x529c2d[_0x5fb6('0x32')][_0x5fb6('0x34')]?_0x529c2d[_0x5fb6('0x32')]:_0x2e3f97[_0x5fb6('0x2e')];if(_0x290e77[_0x5fb6('0x2f')]['includeAll']){_0x529c2d[_0x5fb6('0x40')]=[{'all':!![]}];}_0x529c2d=_['merge']({},_0x529c2d,_0x290e77['options']);return db[_0x5fb6('0x3e')][_0x5fb6('0x47')](_0x529c2d)[_0x5fb6('0x24')](handleEntityNotFound(_0xd3245f,null))[_0x5fb6('0x24')](respondWithResult(_0xd3245f,null))[_0x5fb6('0x43')](handleError(_0xd3245f,null));};exports[_0x5fb6('0x48')]=function(_0x45ba31,_0x5729a2){return db[_0x5fb6('0x3e')][_0x5fb6('0x48')](_0x45ba31['body'],{})[_0x5fb6('0x24')](respondWithResult(_0x5729a2,0xc9))[_0x5fb6('0x43')](handleError(_0x5729a2,null));};exports[_0x5fb6('0x23')]=function(_0x3fc547,_0x3b508a){if(_0x3fc547[_0x5fb6('0x49')]['id']){delete _0x3fc547[_0x5fb6('0x49')]['id'];}return db[_0x5fb6('0x3e')]['find']({'where':{'id':_0x3fc547[_0x5fb6('0x45')]['id']}})[_0x5fb6('0x24')](handleEntityNotFound(_0x3b508a,null))['then'](saveUpdates(_0x3fc547[_0x5fb6('0x49')],null))[_0x5fb6('0x24')](respondWithResult(_0x3b508a,null))[_0x5fb6('0x43')](handleError(_0x3b508a,null));};exports[_0x5fb6('0x25')]=function(_0x4bf156,_0x4bb943){return db[_0x5fb6('0x3e')][_0x5fb6('0x47')]({'where':{'id':_0x4bf156[_0x5fb6('0x45')]['id']}})['then'](handleEntityNotFound(_0x4bb943,null))[_0x5fb6('0x24')](removeEntity(_0x4bb943,null))['catch'](handleError(_0x4bb943,null));};exports[_0x5fb6('0x4a')]=function(_0x5eb7cf,_0xa949ae){return db[_0x5fb6('0x3e')][_0x5fb6('0x4a')]()['then'](respondWithResult(_0xa949ae,null))[_0x5fb6('0x43')](handleError(_0xa949ae,null));}; \ No newline at end of file +var _0xa3e6=['offset','count','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','Cdr','fieldName','type','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','merge','where','VIRTUAL','options','include','findAll','catch','params','rawAttributes','includeAll','find','create','body','describe','eml-format','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x3fd5f8,_0x485d25){var _0x404870=function(_0x2aa84c){while(--_0x2aa84c){_0x3fd5f8['push'](_0x3fd5f8['shift']());}};_0x404870(++_0x485d25);}(_0xa3e6,0xbe));var _0x6a3e=function(_0x10cbd6,_0x40f843){_0x10cbd6=_0x10cbd6-0x0;var _0x51111c=_0xa3e6[_0x10cbd6];return _0x51111c;};'use strict';var emlformat=require(_0x6a3e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6a3e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6a3e('0x2'));var moment=require(_0x6a3e('0x3'));var BPromise=require(_0x6a3e('0x4'));var Mustache=require('mustache');var util=require(_0x6a3e('0x5'));var path=require('path');var sox=require(_0x6a3e('0x6'));var csv=require(_0x6a3e('0x7'));var ejs=require(_0x6a3e('0x8'));var fs=require('fs');var fs_extra=require(_0x6a3e('0x9'));var _=require(_0x6a3e('0xa'));var squel=require('squel');var crypto=require(_0x6a3e('0xb'));var jsforce=require(_0x6a3e('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6a3e('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6a3e('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x6a3e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6a3e('0x10'))(_0x6a3e('0x11'));var utils=require(_0x6a3e('0x12'));var config=require(_0x6a3e('0x13'));var licenseUtil=require(_0x6a3e('0x14'));var db=require(_0x6a3e('0x15'))['db'];function respondWithStatusCode(_0x4a3a97,_0x27e169){_0x27e169=_0x27e169||0xcc;return function(_0x385c29){if(_0x385c29){return _0x4a3a97[_0x6a3e('0x16')](_0x27e169);}return _0x4a3a97[_0x6a3e('0x17')](_0x27e169)[_0x6a3e('0x18')]();};}function respondWithResult(_0x31aefa,_0x222f7c){_0x222f7c=_0x222f7c||0xc8;return function(_0x4bd05f){if(_0x4bd05f){return _0x31aefa[_0x6a3e('0x17')](_0x222f7c)[_0x6a3e('0x19')](_0x4bd05f);}};}function respondWithFilteredResult(_0x8ed74b,_0x2a62a8){return function(_0x500ccd){if(_0x500ccd){var _0x462b8d=typeof _0x2a62a8[_0x6a3e('0x1a')]==='undefined'&&typeof _0x2a62a8['limit']==='undefined';var _0x58b221=_0x500ccd['count'];var _0x3693a2=_0x462b8d?0x0:_0x2a62a8[_0x6a3e('0x1a')];var _0x31a190=_0x462b8d?_0x500ccd[_0x6a3e('0x1b')]:_0x2a62a8[_0x6a3e('0x1a')]+_0x2a62a8[_0x6a3e('0x1c')];var _0x1d6ccc;if(_0x31a190>=_0x58b221){_0x31a190=_0x58b221;_0x1d6ccc=0xc8;}else{_0x1d6ccc=0xce;}_0x8ed74b[_0x6a3e('0x17')](_0x1d6ccc);return _0x8ed74b['set'](_0x6a3e('0x1d'),_0x3693a2+'-'+_0x31a190+'/'+_0x58b221)['json'](_0x500ccd);}return null;};}function patchUpdates(_0xc0452f){return function(_0x5ae73b){try{jsonpatch[_0x6a3e('0x1e')](_0x5ae73b,_0xc0452f,!![]);}catch(_0x131d80){return BPromise[_0x6a3e('0x1f')](_0x131d80);}return _0x5ae73b[_0x6a3e('0x20')]();};}function saveUpdates(_0x58721c,_0x4f7507){return function(_0x215ac1){if(_0x215ac1){return _0x215ac1[_0x6a3e('0x21')](_0x58721c)[_0x6a3e('0x22')](function(_0x4687d0){return _0x4687d0;});}return null;};}function removeEntity(_0x4e5a25,_0x1ae966){return function(_0x21b5aa){if(_0x21b5aa){return _0x21b5aa[_0x6a3e('0x23')]()[_0x6a3e('0x22')](function(){_0x4e5a25[_0x6a3e('0x17')](0xcc)[_0x6a3e('0x18')]();});}};}function handleEntityNotFound(_0x359460,_0x83e681){return function(_0x25fc14){if(!_0x25fc14){_0x359460[_0x6a3e('0x16')](0x194);}return _0x25fc14;};}function handleError(_0x5b1ed9,_0x4ec834){_0x4ec834=_0x4ec834||0x1f4;return function(_0x150992){logger[_0x6a3e('0x24')](_0x150992[_0x6a3e('0x25')]);if(_0x150992[_0x6a3e('0x26')]){delete _0x150992[_0x6a3e('0x26')];}_0x5b1ed9[_0x6a3e('0x17')](_0x4ec834)[_0x6a3e('0x27')](_0x150992);};}exports[_0x6a3e('0x28')]=function(_0xd87198,_0x436169){var _0x3a831b={},_0x508a55={},_0x4eec67={'count':0x0,'rows':[]};var _0x2a2b2a=_['map'](db[_0x6a3e('0x29')]['rawAttributes'],function(_0x553fc5){return{'name':_0x553fc5[_0x6a3e('0x2a')],'type':_0x553fc5[_0x6a3e('0x2b')]['key']};});_0x508a55['model']=_[_0x6a3e('0x2c')](_0x2a2b2a,_0x6a3e('0x26'));_0x508a55[_0x6a3e('0x2d')]=_[_0x6a3e('0x2e')](_0xd87198['query']);_0x508a55['filters']=_[_0x6a3e('0x2f')](_0x508a55[_0x6a3e('0x30')],_0x508a55[_0x6a3e('0x2d')]);_0x3a831b[_0x6a3e('0x31')]=_['intersection'](_0x508a55[_0x6a3e('0x30')],qs[_0x6a3e('0x32')](_0xd87198['query']['fields']));_0x3a831b['attributes']=_0x3a831b[_0x6a3e('0x31')][_0x6a3e('0x33')]?_0x3a831b[_0x6a3e('0x31')]:_0x508a55[_0x6a3e('0x30')];if(!_0xd87198[_0x6a3e('0x2d')][_0x6a3e('0x34')](_0x6a3e('0x35'))){_0x3a831b[_0x6a3e('0x1c')]=qs[_0x6a3e('0x1c')](_0xd87198[_0x6a3e('0x2d')][_0x6a3e('0x1c')]);_0x3a831b[_0x6a3e('0x1a')]=qs[_0x6a3e('0x1a')](_0xd87198[_0x6a3e('0x2d')][_0x6a3e('0x1a')]);}_0x3a831b['order']=qs[_0x6a3e('0x36')](_0xd87198[_0x6a3e('0x2d')][_0x6a3e('0x36')]);_0x3a831b['where']=qs[_0x6a3e('0x37')](_[_0x6a3e('0x38')](_0xd87198['query'],_0x508a55[_0x6a3e('0x37')]),_0x2a2b2a);if(_0xd87198[_0x6a3e('0x2d')][_0x6a3e('0x39')]){_0x3a831b['where']=_[_0x6a3e('0x3a')](_0x3a831b[_0x6a3e('0x3b')],{'$or':_[_0x6a3e('0x2c')](_0x2a2b2a,function(_0x3e604c){if(_0x3e604c[_0x6a3e('0x2b')]!==_0x6a3e('0x3c')){var _0x5f4ff5={};_0x5f4ff5[_0x3e604c[_0x6a3e('0x26')]]={'$like':'%'+_0xd87198['query']['filter']+'%'};return _0x5f4ff5;}})});}_0x3a831b=_['merge']({},_0x3a831b,_0xd87198[_0x6a3e('0x3d')]);var _0x4bb1ba={'where':_0x3a831b[_0x6a3e('0x3b')]};return db[_0x6a3e('0x29')][_0x6a3e('0x1b')](_0x4bb1ba)[_0x6a3e('0x22')](function(_0xca83d2){_0x4eec67[_0x6a3e('0x1b')]=_0xca83d2;if(_0xd87198['query']['includeAll']){_0x3a831b[_0x6a3e('0x3e')]=[{'all':!![]}];}return db[_0x6a3e('0x29')][_0x6a3e('0x3f')](_0x3a831b);})[_0x6a3e('0x22')](function(_0x1dd524){_0x4eec67['rows']=_0x1dd524;return _0x4eec67;})[_0x6a3e('0x22')](respondWithFilteredResult(_0x436169,_0x3a831b))[_0x6a3e('0x40')](handleError(_0x436169,null));};exports['show']=function(_0x35c927,_0x417f8a){var _0x35c836={'raw':!![],'where':{'id':_0x35c927[_0x6a3e('0x41')]['id']}},_0x53ad48={};_0x53ad48[_0x6a3e('0x30')]=_[_0x6a3e('0x2e')](db[_0x6a3e('0x29')][_0x6a3e('0x42')]);_0x53ad48[_0x6a3e('0x2d')]=_['keys'](_0x35c927[_0x6a3e('0x2d')]);_0x53ad48[_0x6a3e('0x37')]=_[_0x6a3e('0x2f')](_0x53ad48['model'],_0x53ad48[_0x6a3e('0x2d')]);_0x35c836['attributes']=_['intersection'](_0x53ad48[_0x6a3e('0x30')],qs[_0x6a3e('0x32')](_0x35c927[_0x6a3e('0x2d')]['fields']));_0x35c836['attributes']=_0x35c836[_0x6a3e('0x31')][_0x6a3e('0x33')]?_0x35c836[_0x6a3e('0x31')]:_0x53ad48[_0x6a3e('0x30')];if(_0x35c927[_0x6a3e('0x2d')][_0x6a3e('0x43')]){_0x35c836['include']=[{'all':!![]}];}_0x35c836=_[_0x6a3e('0x3a')]({},_0x35c836,_0x35c927[_0x6a3e('0x3d')]);return db[_0x6a3e('0x29')][_0x6a3e('0x44')](_0x35c836)[_0x6a3e('0x22')](handleEntityNotFound(_0x417f8a,null))[_0x6a3e('0x22')](respondWithResult(_0x417f8a,null))[_0x6a3e('0x40')](handleError(_0x417f8a,null));};exports[_0x6a3e('0x45')]=function(_0x2d0685,_0x4d36e2){return db[_0x6a3e('0x29')][_0x6a3e('0x45')](_0x2d0685['body'],{})[_0x6a3e('0x22')](respondWithResult(_0x4d36e2,0xc9))['catch'](handleError(_0x4d36e2,null));};exports[_0x6a3e('0x21')]=function(_0x10cd8e,_0x28a3e9){if(_0x10cd8e['body']['id']){delete _0x10cd8e[_0x6a3e('0x46')]['id'];}return db[_0x6a3e('0x29')]['find']({'where':{'id':_0x10cd8e['params']['id']}})['then'](handleEntityNotFound(_0x28a3e9,null))[_0x6a3e('0x22')](saveUpdates(_0x10cd8e[_0x6a3e('0x46')],null))[_0x6a3e('0x22')](respondWithResult(_0x28a3e9,null))[_0x6a3e('0x40')](handleError(_0x28a3e9,null));};exports[_0x6a3e('0x23')]=function(_0x448e46,_0x404473){return db[_0x6a3e('0x29')][_0x6a3e('0x44')]({'where':{'id':_0x448e46[_0x6a3e('0x41')]['id']}})[_0x6a3e('0x22')](handleEntityNotFound(_0x404473,null))['then'](removeEntity(_0x404473,null))[_0x6a3e('0x40')](handleError(_0x404473,null));};exports[_0x6a3e('0x47')]=function(_0x3fabf8,_0x21ba7b){return db[_0x6a3e('0x29')]['describe']()[_0x6a3e('0x22')](respondWithResult(_0x21ba7b,null))['catch'](handleError(_0x21ba7b,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index de32c2c..624d738 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x3e6f07,_0x155ae7){var _0x2954ab=function(_0x275c8b){while(--_0x275c8b){_0x3e6f07['push'](_0x3e6f07['shift']());}};_0x2954ab(++_0x155ae7);}(_0x7a54,0x106));var _0x47a5=function(_0x24fe54,_0x2cda12){_0x24fe54=_0x24fe54-0x0;var _0x518051=_0x7a54[_0x24fe54];return _0x518051;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x15f5b2,_0x41b6d6){var _0x5d9a5c=function(_0x212b79){while(--_0x212b79){_0x15f5b2['push'](_0x15f5b2['shift']());}};_0x5d9a5c(++_0x41b6d6);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index b52e72f..f644408 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 _0x0ab5=['request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Cdr,\x20%s,\x20%s','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0ab5,0xc6));var _0x50ab=function(_0x15407b,_0x4a30c7){_0x15407b=_0x15407b-0x0;var _0x46e21d=_0x0ab5[_0x15407b];return _0x46e21d;};'use strict';var _=require('lodash');var util=require(_0x50ab('0x0'));var moment=require(_0x50ab('0x1'));var BPromise=require(_0x50ab('0x2'));var rs=require(_0x50ab('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x50ab('0x4'))['db'];var utils=require(_0x50ab('0x5'));var logger=require('../../config/logger')(_0x50ab('0x6'));var config=require(_0x50ab('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x50ab('0x8')][_0x50ab('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20189d,_0x359fe3,_0x3a2272){return new BPromise(function(_0x10c0b2,_0x93dff4){return client[_0x50ab('0xa')](_0x20189d,_0x3a2272)['then'](function(_0x17f9a7){logger[_0x50ab('0xb')]('Cdr,\x20%s,\x20%s',_0x359fe3,_0x50ab('0xc'));logger[_0x50ab('0xd')](_0x50ab('0xe'),_0x359fe3,_0x50ab('0xc'),JSON[_0x50ab('0xf')](_0x17f9a7));if(_0x17f9a7[_0x50ab('0x10')]){if(_0x17f9a7['error'][_0x50ab('0x11')]===0x1f4){logger[_0x50ab('0x10')]('Cdr,\x20%s,\x20%s',_0x359fe3,_0x17f9a7[_0x50ab('0x10')][_0x50ab('0x12')]);return _0x93dff4(_0x17f9a7['error']['message']);}logger[_0x50ab('0x10')]('Cdr,\x20%s,\x20%s',_0x359fe3,_0x17f9a7['error'][_0x50ab('0x12')]);return _0x10c0b2(_0x17f9a7[_0x50ab('0x10')]['message']);}else{logger[_0x50ab('0xb')](_0x50ab('0x13'),_0x359fe3,_0x50ab('0xc'));_0x10c0b2(_0x17f9a7[_0x50ab('0x14')][_0x50ab('0x12')]);}})['catch'](function(_0x45e0b6){logger['error'](_0x50ab('0x13'),_0x359fe3,_0x45e0b6);_0x93dff4(_0x45e0b6);});});} \ No newline at end of file +var _0x702b=['message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1582de,_0x784b2e){var _0x49dd27=function(_0x1a09ec){while(--_0x1a09ec){_0x1582de['push'](_0x1582de['shift']());}};_0x49dd27(++_0x784b2e);}(_0x702b,0x95));var _0xb702=function(_0x5042a4,_0xab0f0f){_0x5042a4=_0x5042a4-0x0;var _0x45d1c7=_0x702b[_0x5042a4];return _0x45d1c7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb702('0x0'));var BPromise=require(_0xb702('0x1'));var rs=require(_0xb702('0x2'));var fs=require('fs');var Redis=require(_0xb702('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb702('0x4'));var logger=require(_0xb702('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb702('0x6'));var client=jayson[_0xb702('0x7')][_0xb702('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x14f1f3,_0xa2ad98,_0x583da7){return new BPromise(function(_0x43f668,_0xa28c29){return client[_0xb702('0x9')](_0x14f1f3,_0x583da7)[_0xb702('0xa')](function(_0x353667){logger[_0xb702('0xb')](_0xb702('0xc'),_0xa2ad98,_0xb702('0xd'));logger[_0xb702('0xe')](_0xb702('0xf'),_0xa2ad98,_0xb702('0xd'),JSON[_0xb702('0x10')](_0x353667));if(_0x353667[_0xb702('0x11')]){if(_0x353667[_0xb702('0x11')][_0xb702('0x12')]===0x1f4){logger[_0xb702('0x11')](_0xb702('0xc'),_0xa2ad98,_0x353667['error']['message']);return _0xa28c29(_0x353667[_0xb702('0x11')][_0xb702('0x13')]);}logger['error'](_0xb702('0xc'),_0xa2ad98,_0x353667[_0xb702('0x11')][_0xb702('0x13')]);return _0x43f668(_0x353667[_0xb702('0x11')][_0xb702('0x13')]);}else{logger[_0xb702('0xb')](_0xb702('0xc'),_0xa2ad98,_0xb702('0xd'));_0x43f668(_0x353667['result'][_0xb702('0x13')]);}})[_0xb702('0x14')](function(_0x20031e){logger[_0xb702('0x11')](_0xb702('0xc'),_0xa2ad98,_0x20031e);_0xa28c29(_0x20031e);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 0711486..96b2af3 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(_0x457062,_0x1893df){var _0x4df1a9=function(_0x5b9652){while(--_0x5b9652){_0x457062['push'](_0x457062['shift']());}};_0x4df1a9(++_0x1893df);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +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(_0x5c1cdc,_0x322014){var _0x2e8317=function(_0x2e9dfa){while(--_0x2e9dfa){_0x5c1cdc['push'](_0x5c1cdc['shift']());}};_0x2e8317(++_0x322014);}(_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 diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 78ccdc9..3c8a445 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 _0x1f2b=['*,*,*,*','sequelize','STRING','noop','TEXT'];(function(_0x22a217,_0x5daf6d){var _0x5a208b=function(_0x1331d9){while(--_0x1331d9){_0x22a217['push'](_0x22a217['shift']());}};_0x5a208b(++_0x5daf6d);}(_0x1f2b,0x182));var _0xb1f2=function(_0x3e7bd4,_0x5ec934){_0x3e7bd4=_0x3e7bd4-0x0;var _0x3b4224=_0x1f2b[_0x3e7bd4];return _0x3b4224;};'use strict';var Sequelize=require(_0xb1f2('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xb1f2('0x1')],'allowNull':![],'defaultValue':_0xb1f2('0x2')},'appdata':{'type':Sequelize[_0xb1f2('0x3')]()},'description':{'type':Sequelize[_0xb1f2('0x1')]},'interval':{'type':Sequelize[_0xb1f2('0x1')],'defaultValue':_0xb1f2('0x4')}}; \ No newline at end of file +var _0xdb45=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x26acf0,_0x34a834){var _0x31d06f=function(_0x51a397){while(--_0x51a397){_0x26acf0['push'](_0x26acf0['shift']());}};_0x31d06f(++_0x34a834);}(_0xdb45,0x110));var _0x5db4=function(_0xdb6228,_0x370bd2){_0xdb6228=_0xdb6228-0x0;var _0x7d09b1=_0xdb45[_0xdb6228];return _0x7d09b1;};'use strict';var Sequelize=require(_0x5db4('0x0'));module[_0x5db4('0x1')]={'priority':{'type':Sequelize[_0x5db4('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x5db4('0x3')],'allowNull':![],'defaultValue':_0x5db4('0x4')},'appdata':{'type':Sequelize[_0x5db4('0x5')]()},'description':{'type':Sequelize[_0x5db4('0x3')]},'interval':{'type':Sequelize[_0x5db4('0x3')],'defaultValue':_0x5db4('0x6')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 28fbd49..a6af128 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 _0x7382=['save','then','destroy','error','stack','name','send','show','params','ChatApplication','rawAttributes','query','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','catch','update','body','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','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject'];(function(_0x47c5bf,_0x45977e){var _0x11b779=function(_0x1bd585){while(--_0x1bd585){_0x47c5bf['push'](_0x47c5bf['shift']());}};_0x11b779(++_0x45977e);}(_0x7382,0x1f2));var _0x2738=function(_0x4dfbe8,_0x1bee42){_0x4dfbe8=_0x4dfbe8-0x0;var _0x2a2a44=_0x7382[_0x4dfbe8];return _0x2a2a44;};'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'];function respondWithStatusCode(_0x46072b,_0x263b48){_0x263b48=_0x263b48||0xcc;return function(_0x41b111){if(_0x41b111){return _0x46072b[_0x2738('0x15')](_0x263b48);}return _0x46072b[_0x2738('0x16')](_0x263b48)[_0x2738('0x17')]();};}function respondWithResult(_0x1506fe,_0x4584f8){_0x4584f8=_0x4584f8||0xc8;return function(_0x1d2de7){if(_0x1d2de7){return _0x1506fe['status'](_0x4584f8)[_0x2738('0x18')](_0x1d2de7);}};}function respondWithFilteredResult(_0x2db43f,_0x547823){return function(_0x4cde16){if(_0x4cde16){var _0x1542b6=typeof _0x547823[_0x2738('0x19')]===_0x2738('0x1a')&&typeof _0x547823['limit']===_0x2738('0x1a');var _0x1f3962=_0x4cde16[_0x2738('0x1b')];var _0x2ab61b=_0x1542b6?0x0:_0x547823[_0x2738('0x19')];var _0x4a0f1e=_0x1542b6?_0x4cde16[_0x2738('0x1b')]:_0x547823[_0x2738('0x19')]+_0x547823[_0x2738('0x1c')];var _0x1d5cb1;if(_0x4a0f1e>=_0x1f3962){_0x4a0f1e=_0x1f3962;_0x1d5cb1=0xc8;}else{_0x1d5cb1=0xce;}_0x2db43f[_0x2738('0x16')](_0x1d5cb1);return _0x2db43f[_0x2738('0x1d')](_0x2738('0x1e'),_0x2ab61b+'-'+_0x4a0f1e+'/'+_0x1f3962)[_0x2738('0x18')](_0x4cde16);}return null;};}function patchUpdates(_0x2dcc5e){return function(_0x514e45){try{jsonpatch[_0x2738('0x1f')](_0x514e45,_0x2dcc5e,!![]);}catch(_0x52c7df){return BPromise[_0x2738('0x20')](_0x52c7df);}return _0x514e45[_0x2738('0x21')]();};}function saveUpdates(_0x264a56,_0x36b4bb){return function(_0x532cb8){if(_0x532cb8){return _0x532cb8['update'](_0x264a56)[_0x2738('0x22')](function(_0xae5515){return _0xae5515;});}return null;};}function removeEntity(_0x1637bb,_0x476c38){return function(_0x509c92){if(_0x509c92){return _0x509c92[_0x2738('0x23')]()[_0x2738('0x22')](function(){_0x1637bb[_0x2738('0x16')](0xcc)[_0x2738('0x17')]();});}};}function handleEntityNotFound(_0x4b4c15,_0x4bb15e){return function(_0x5b7fd0){if(!_0x5b7fd0){_0x4b4c15[_0x2738('0x15')](0x194);}return _0x5b7fd0;};}function handleError(_0x37f176,_0x536d42){_0x536d42=_0x536d42||0x1f4;return function(_0x2f0002){logger[_0x2738('0x24')](_0x2f0002[_0x2738('0x25')]);if(_0x2f0002['name']){delete _0x2f0002[_0x2738('0x26')];}_0x37f176[_0x2738('0x16')](_0x536d42)[_0x2738('0x27')](_0x2f0002);};}exports[_0x2738('0x28')]=function(_0xbfa426,_0x263ebd){var _0x13343a={'raw':!![],'where':{'id':_0xbfa426[_0x2738('0x29')]['id']}},_0x390d2d={};_0x390d2d['model']=_['keys'](db[_0x2738('0x2a')][_0x2738('0x2b')]);_0x390d2d['query']=_['keys'](_0xbfa426[_0x2738('0x2c')]);_0x390d2d[_0x2738('0x2d')]=_[_0x2738('0x2e')](_0x390d2d[_0x2738('0x2f')],_0x390d2d[_0x2738('0x2c')]);_0x13343a[_0x2738('0x30')]=_[_0x2738('0x2e')](_0x390d2d[_0x2738('0x2f')],qs[_0x2738('0x31')](_0xbfa426['query']['fields']));_0x13343a[_0x2738('0x30')]=_0x13343a[_0x2738('0x30')][_0x2738('0x32')]?_0x13343a[_0x2738('0x30')]:_0x390d2d[_0x2738('0x2f')];if(_0xbfa426['query'][_0x2738('0x33')]){_0x13343a[_0x2738('0x34')]=[{'all':!![]}];}_0x13343a=_[_0x2738('0x35')]({},_0x13343a,_0xbfa426[_0x2738('0x36')]);return db[_0x2738('0x2a')][_0x2738('0x37')](_0x13343a)[_0x2738('0x22')](handleEntityNotFound(_0x263ebd,null))[_0x2738('0x22')](respondWithResult(_0x263ebd,null))[_0x2738('0x38')](handleError(_0x263ebd,null));};exports[_0x2738('0x39')]=function(_0x19d49d,_0x20e02a){if(_0x19d49d[_0x2738('0x3a')]['id']){delete _0x19d49d[_0x2738('0x3a')]['id'];}return db[_0x2738('0x2a')][_0x2738('0x37')]({'where':{'id':_0x19d49d[_0x2738('0x29')]['id']}})[_0x2738('0x22')](handleEntityNotFound(_0x20e02a,null))[_0x2738('0x22')](saveUpdates(_0x19d49d[_0x2738('0x3a')],null))[_0x2738('0x22')](respondWithResult(_0x20e02a,null))[_0x2738('0x38')](handleError(_0x20e02a,null));};exports[_0x2738('0x23')]=function(_0x53084c,_0x10e729){return db[_0x2738('0x2a')][_0x2738('0x37')]({'where':{'id':_0x53084c[_0x2738('0x29')]['id']}})[_0x2738('0x22')](handleEntityNotFound(_0x10e729,null))[_0x2738('0x22')](removeEntity(_0x10e729,null))[_0x2738('0x38')](handleError(_0x10e729,null));}; \ No newline at end of file +var _0xbdb7=['update','error','stack','name','send','show','params','model','keys','ChatApplication','query','filters','intersection','attributes','length','includeAll','merge','find','then','body','catch','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x59b9d3,_0x384472){_0x59b9d3=_0x59b9d3-0x0;var _0x171163=_0xbdb7[_0x59b9d3];return _0x171163;};'use strict';var emlformat=require(_0x7bdb('0x0'));var rimraf=require(_0x7bdb('0x1'));var zipdir=require(_0x7bdb('0x2'));var jsonpatch=require(_0x7bdb('0x3'));var rp=require(_0x7bdb('0x4'));var moment=require(_0x7bdb('0x5'));var BPromise=require(_0x7bdb('0x6'));var Mustache=require(_0x7bdb('0x7'));var util=require(_0x7bdb('0x8'));var path=require('path');var sox=require(_0x7bdb('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7bdb('0xa'));var _=require(_0x7bdb('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7bdb('0xc'));var deskjs=require(_0x7bdb('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7bdb('0xe'));var Redis=require(_0x7bdb('0xf'));var authService=require(_0x7bdb('0x10'));var qs=require(_0x7bdb('0x11'));var as=require(_0x7bdb('0x12'));var hardwareService=require(_0x7bdb('0x13'));var logger=require(_0x7bdb('0x14'))(_0x7bdb('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7bdb('0x16'))['db'];function respondWithStatusCode(_0x25e3cb,_0x496613){_0x496613=_0x496613||0xcc;return function(_0x8d74ff){if(_0x8d74ff){return _0x25e3cb['sendStatus'](_0x496613);}return _0x25e3cb['status'](_0x496613)[_0x7bdb('0x17')]();};}function respondWithResult(_0x46dd4a,_0x4fd91a){_0x4fd91a=_0x4fd91a||0xc8;return function(_0x50eeca){if(_0x50eeca){return _0x46dd4a['status'](_0x4fd91a)[_0x7bdb('0x18')](_0x50eeca);}};}function respondWithFilteredResult(_0x195b2e,_0xe9919f){return function(_0x25d417){if(_0x25d417){var _0x31c909=typeof _0xe9919f[_0x7bdb('0x19')]===_0x7bdb('0x1a')&&typeof _0xe9919f[_0x7bdb('0x1b')]==='undefined';var _0x1c5750=_0x25d417[_0x7bdb('0x1c')];var _0x5723f4=_0x31c909?0x0:_0xe9919f[_0x7bdb('0x19')];var _0x4ffd4b=_0x31c909?_0x25d417[_0x7bdb('0x1c')]:_0xe9919f[_0x7bdb('0x19')]+_0xe9919f['limit'];var _0x3e5f8e;if(_0x4ffd4b>=_0x1c5750){_0x4ffd4b=_0x1c5750;_0x3e5f8e=0xc8;}else{_0x3e5f8e=0xce;}_0x195b2e[_0x7bdb('0x1d')](_0x3e5f8e);return _0x195b2e[_0x7bdb('0x1e')](_0x7bdb('0x1f'),_0x5723f4+'-'+_0x4ffd4b+'/'+_0x1c5750)[_0x7bdb('0x18')](_0x25d417);}return null;};}function patchUpdates(_0x5bfc35){return function(_0x49f353){try{jsonpatch[_0x7bdb('0x20')](_0x49f353,_0x5bfc35,!![]);}catch(_0xcb25f2){return BPromise['reject'](_0xcb25f2);}return _0x49f353[_0x7bdb('0x21')]();};}function saveUpdates(_0x118ea1,_0x346c72){return function(_0x3f53e7){if(_0x3f53e7){return _0x3f53e7[_0x7bdb('0x22')](_0x118ea1)['then'](function(_0x1d37ac){return _0x1d37ac;});}return null;};}function removeEntity(_0xdad53d,_0x40c447){return function(_0x3a456f){if(_0x3a456f){return _0x3a456f['destroy']()['then'](function(){_0xdad53d[_0x7bdb('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47abaf,_0x4a9e02){return function(_0x2abef6){if(!_0x2abef6){_0x47abaf['sendStatus'](0x194);}return _0x2abef6;};}function handleError(_0x2b14bc,_0x72ba69){_0x72ba69=_0x72ba69||0x1f4;return function(_0x3ec129){logger[_0x7bdb('0x23')](_0x3ec129[_0x7bdb('0x24')]);if(_0x3ec129['name']){delete _0x3ec129[_0x7bdb('0x25')];}_0x2b14bc[_0x7bdb('0x1d')](_0x72ba69)[_0x7bdb('0x26')](_0x3ec129);};}exports[_0x7bdb('0x27')]=function(_0x371e8a,_0x2e8e65){var _0x1e9996={'raw':!![],'where':{'id':_0x371e8a[_0x7bdb('0x28')]['id']}},_0xd2d7be={};_0xd2d7be[_0x7bdb('0x29')]=_[_0x7bdb('0x2a')](db[_0x7bdb('0x2b')]['rawAttributes']);_0xd2d7be[_0x7bdb('0x2c')]=_[_0x7bdb('0x2a')](_0x371e8a[_0x7bdb('0x2c')]);_0xd2d7be[_0x7bdb('0x2d')]=_[_0x7bdb('0x2e')](_0xd2d7be['model'],_0xd2d7be[_0x7bdb('0x2c')]);_0x1e9996[_0x7bdb('0x2f')]=_[_0x7bdb('0x2e')](_0xd2d7be[_0x7bdb('0x29')],qs['fields'](_0x371e8a['query']['fields']));_0x1e9996[_0x7bdb('0x2f')]=_0x1e9996['attributes'][_0x7bdb('0x30')]?_0x1e9996['attributes']:_0xd2d7be[_0x7bdb('0x29')];if(_0x371e8a[_0x7bdb('0x2c')][_0x7bdb('0x31')]){_0x1e9996['include']=[{'all':!![]}];}_0x1e9996=_[_0x7bdb('0x32')]({},_0x1e9996,_0x371e8a['options']);return db['ChatApplication'][_0x7bdb('0x33')](_0x1e9996)['then'](handleEntityNotFound(_0x2e8e65,null))[_0x7bdb('0x34')](respondWithResult(_0x2e8e65,null))['catch'](handleError(_0x2e8e65,null));};exports['update']=function(_0x206c26,_0x353b26){if(_0x206c26[_0x7bdb('0x35')]['id']){delete _0x206c26[_0x7bdb('0x35')]['id'];}return db[_0x7bdb('0x2b')][_0x7bdb('0x33')]({'where':{'id':_0x206c26['params']['id']}})[_0x7bdb('0x34')](handleEntityNotFound(_0x353b26,null))[_0x7bdb('0x34')](saveUpdates(_0x206c26[_0x7bdb('0x35')],null))[_0x7bdb('0x34')](respondWithResult(_0x353b26,null))[_0x7bdb('0x36')](handleError(_0x353b26,null));};exports[_0x7bdb('0x37')]=function(_0x228340,_0x2587af){return db[_0x7bdb('0x2b')]['find']({'where':{'id':_0x228340['params']['id']}})[_0x7bdb('0x34')](handleEntityNotFound(_0x2587af,null))[_0x7bdb('0x34')](removeEntity(_0x2587af,null))[_0x7bdb('0x36')](handleError(_0x2587af,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 8af963e..1f53bfc 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 _0xc964=['bluebird','path','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment'];(function(_0x3efdaa,_0x236adf){var _0x1848f7=function(_0x4f0c23){while(--_0x4f0c23){_0x3efdaa['push'](_0x3efdaa['shift']());}};_0x1848f7(++_0x236adf);}(_0xc964,0x7e));var _0x4c96=function(_0x468fbf,_0x385efe){_0x468fbf=_0x468fbf-0x0;var _0x4a7892=_0xc964[_0x468fbf];return _0x4a7892;};'use strict';var _=require(_0x4c96('0x0'));var util=require(_0x4c96('0x1'));var logger=require('../../config/logger')(_0x4c96('0x2'));var moment=require(_0x4c96('0x3'));var BPromise=require(_0x4c96('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4c96('0x5'));var rimraf=require('rimraf');var config=require(_0x4c96('0x6'));var attributes=require(_0x4c96('0x7'));module[_0x4c96('0x8')]=function(_0x2f6461,_0x45bb27){return _0x2f6461[_0x4c96('0x9')](_0x4c96('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4c96('0xb'),'collate':_0x4c96('0xc')});}; \ No newline at end of file +var _0x7aa2=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatApplication.attributes','define','ChatApplication','chat_applications','utf8mb4','lodash','util'];(function(_0x157773,_0x1e7c8a){var _0x23ee38=function(_0x152598){while(--_0x152598){_0x157773['push'](_0x157773['shift']());}};_0x23ee38(++_0x1e7c8a);}(_0x7aa2,0x132));var _0x27aa=function(_0x534f7c,_0x3eb489){_0x534f7c=_0x534f7c-0x0;var _0x5c3e22=_0x7aa2[_0x534f7c];return _0x5c3e22;};'use strict';var _=require(_0x27aa('0x0'));var util=require(_0x27aa('0x1'));var logger=require(_0x27aa('0x2'))(_0x27aa('0x3'));var moment=require(_0x27aa('0x4'));var BPromise=require(_0x27aa('0x5'));var rp=require(_0x27aa('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x27aa('0x7'));var config=require(_0x27aa('0x8'));var attributes=require(_0x27aa('0x9'));module['exports']=function(_0x2eb905,_0x29fcb7){return _0x2eb905[_0x27aa('0xa')](_0x27aa('0xb'),attributes,{'tableName':_0x27aa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x27aa('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index d6eaec7..67e1fcc 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 _0x4568=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x38c7d8,_0x253557){var _0x266426=function(_0x2f727b){while(--_0x2f727b){_0x38c7d8['push'](_0x38c7d8['shift']());}};_0x266426(++_0x253557);}(_0x4568,0x154));var _0x8456=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0x4568[_0xbf8ebe];return _0x1e25e8;};'use strict';var _=require(_0x8456('0x0'));var util=require('util');var moment=require(_0x8456('0x1'));var BPromise=require(_0x8456('0x2'));var rs=require(_0x8456('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8456('0x4'))['db'];var utils=require(_0x8456('0x5'));var logger=require('../../config/logger')(_0x8456('0x6'));var config=require(_0x8456('0x7'));var jayson=require(_0x8456('0x8'));var client=jayson['client'][_0x8456('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf78b1f,_0x473539,_0x3165ac){return new BPromise(function(_0xc2732,_0x493c63){return client['request'](_0xf78b1f,_0x3165ac)['then'](function(_0x3c89e7){logger[_0x8456('0xa')](_0x8456('0xb'),_0x473539,_0x8456('0xc'));logger[_0x8456('0xd')](_0x8456('0xe'),_0x473539,'request\x20sent',JSON[_0x8456('0xf')](_0x3c89e7));if(_0x3c89e7[_0x8456('0x10')]){if(_0x3c89e7[_0x8456('0x10')]['code']===0x1f4){logger[_0x8456('0x10')](_0x8456('0xb'),_0x473539,_0x3c89e7[_0x8456('0x10')]['message']);return _0x493c63(_0x3c89e7[_0x8456('0x10')][_0x8456('0x11')]);}logger[_0x8456('0x10')]('ChatApplication,\x20%s,\x20%s',_0x473539,_0x3c89e7[_0x8456('0x10')][_0x8456('0x11')]);return _0xc2732(_0x3c89e7[_0x8456('0x10')][_0x8456('0x11')]);}else{logger['info'](_0x8456('0xb'),_0x473539,_0x8456('0xc'));_0xc2732(_0x3c89e7[_0x8456('0x12')][_0x8456('0x11')]);}})[_0x8456('0x13')](function(_0x4745f3){logger[_0x8456('0x10')]('ChatApplication,\x20%s,\x20%s',_0x473539,_0x4745f3);_0x493c63(_0x4745f3);});});} \ No newline at end of file +var _0xb9c3=['../../config/logger','jayson/promise','client','http','request','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x18f382,_0x520b90){var _0x1354c3=function(_0x32c2af){while(--_0x32c2af){_0x18f382['push'](_0x18f382['shift']());}};_0x1354c3(++_0x520b90);}(_0xb9c3,0x15e));var _0x3b9c=function(_0x423590,_0x62eb9e){_0x423590=_0x423590-0x0;var _0x5f5417=_0xb9c3[_0x423590];return _0x5f5417;};'use strict';var _=require(_0x3b9c('0x0'));var util=require(_0x3b9c('0x1'));var moment=require(_0x3b9c('0x2'));var BPromise=require(_0x3b9c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3b9c('0x4'));var db=require(_0x3b9c('0x5'))['db'];var utils=require(_0x3b9c('0x6'));var logger=require(_0x3b9c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3b9c('0x8'));var client=jayson[_0x3b9c('0x9')][_0x3b9c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2eedc0,_0x449d90,_0x55d572){return new BPromise(function(_0x1ee8ae,_0x4fa601){return client[_0x3b9c('0xb')](_0x2eedc0,_0x55d572)['then'](function(_0x363fc9){logger[_0x3b9c('0xc')](_0x3b9c('0xd'),_0x449d90,'request\x20sent');logger[_0x3b9c('0xe')](_0x3b9c('0xf'),_0x449d90,'request\x20sent',JSON[_0x3b9c('0x10')](_0x363fc9));if(_0x363fc9[_0x3b9c('0x11')]){if(_0x363fc9[_0x3b9c('0x11')][_0x3b9c('0x12')]===0x1f4){logger[_0x3b9c('0x11')]('ChatApplication,\x20%s,\x20%s',_0x449d90,_0x363fc9[_0x3b9c('0x11')][_0x3b9c('0x13')]);return _0x4fa601(_0x363fc9[_0x3b9c('0x11')][_0x3b9c('0x13')]);}logger[_0x3b9c('0x11')](_0x3b9c('0xd'),_0x449d90,_0x363fc9[_0x3b9c('0x11')][_0x3b9c('0x13')]);return _0x1ee8ae(_0x363fc9['error']['message']);}else{logger[_0x3b9c('0xc')](_0x3b9c('0xd'),_0x449d90,_0x3b9c('0x14'));_0x1ee8ae(_0x363fc9['result']['message']);}})['catch'](function(_0x1e3841){logger[_0x3b9c('0x11')](_0x3b9c('0xd'),_0x449d90,_0x1e3841);_0x4fa601(_0x1e3841);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index f332bdb..f4601f2 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 _0xdad1=['delete','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xdad1,0xb6));var _0x1dad=function(_0x1ceaed,_0x2cac3d){_0x1ceaed=_0x1ceaed-0x0;var _0x1d9dd0=_0xdad1[_0x1ceaed];return _0x1d9dd0;};'use strict';var multer=require(_0x1dad('0x0'));var util=require('util');var path=require(_0x1dad('0x1'));var timeout=require(_0x1dad('0x2'));var express=require('express');var router=express[_0x1dad('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1dad('0x4'));var interaction=require(_0x1dad('0x5'));var config=require('../../config/environment');var controller=require(_0x1dad('0x6'));router[_0x1dad('0x7')](_0x1dad('0x8'),auth[_0x1dad('0x9')](),controller[_0x1dad('0xa')]);router[_0x1dad('0xb')](_0x1dad('0x8'),auth[_0x1dad('0x9')](),controller[_0x1dad('0xc')]);router[_0x1dad('0xd')](_0x1dad('0x8'),auth[_0x1dad('0x9')](),controller['destroy']);module[_0x1dad('0xe')]=router; \ No newline at end of file +var _0x2fb2=['delete','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','put','isAuthenticated','update'];(function(_0x261b6d,_0x24a00f){var _0x224e30=function(_0x5c2ef8){while(--_0x5c2ef8){_0x261b6d['push'](_0x261b6d['shift']());}};_0x224e30(++_0x24a00f);}(_0x2fb2,0x89));var _0x22fb=function(_0x47719b,_0x1f88bd){_0x47719b=_0x47719b-0x0;var _0xfe13df=_0x2fb2[_0x47719b];return _0xfe13df;};'use strict';var multer=require(_0x22fb('0x0'));var util=require(_0x22fb('0x1'));var path=require('path');var timeout=require(_0x22fb('0x2'));var express=require('express');var router=express[_0x22fb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x22fb('0x4'));var interaction=require(_0x22fb('0x5'));var config=require(_0x22fb('0x6'));var controller=require(_0x22fb('0x7'));router[_0x22fb('0x8')](_0x22fb('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x22fb('0xa')]('/:id',auth[_0x22fb('0xb')](),controller[_0x22fb('0xc')]);router[_0x22fb('0xd')](_0x22fb('0x9'),auth[_0x22fb('0xb')](),controller['destroy']);module[_0x22fb('0xe')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index c012cf3..dff50b8 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 _0x242e=['STRING','sequelize'];(function(_0x2e46d1,_0x38899a){var _0xd9f1c1=function(_0x3d66fa){while(--_0x3d66fa){_0x2e46d1['push'](_0x2e46d1['shift']());}};_0xd9f1c1(++_0x38899a);}(_0x242e,0x12f));var _0xe242=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x242e[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0xe242('0x0'));module['exports']={'name':{'type':Sequelize[_0xe242('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xe242('0x1')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xccd1=['STRING','BOOLEAN','sequelize','exports'];(function(_0x217a49,_0x2b1903){var _0x46872c=function(_0x58ef3a){while(--_0x58ef3a){_0x217a49['push'](_0x217a49['shift']());}};_0x46872c(++_0x2b1903);}(_0xccd1,0x66));var _0x1ccd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xccd1[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x1ccd('0x0'));module[_0x1ccd('0x1')]={'name':{'type':Sequelize[_0x1ccd('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x1ccd('0x2')]},'write':{'type':Sequelize[_0x1ccd('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 a344857..562a9ea 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 _0x48f8=['options','includeAll','include','rows','catch','show','params','find','create','body','describe','getUnread','ChatInternalMessage','user','addMembers','ids','omit','findOne','order','getMembers','nolimit','removeMembers','addMessage','ChatGroupId','$gte','format','getMessages','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','error','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge'];(function(_0x37ef93,_0x8b26a6){var _0xa47012=function(_0x4c2ad8){while(--_0x4c2ad8){_0x37ef93['push'](_0x37ef93['shift']());}};_0xa47012(++_0x8b26a6);}(_0x48f8,0x18f));var _0x848f=function(_0x106d51,_0x2eb27c){_0x106d51=_0x106d51-0x0;var _0x1924b9=_0x48f8[_0x106d51];return _0x1924b9;};'use strict';var emlformat=require(_0x848f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x848f('0x1'));var jsonpatch=require(_0x848f('0x2'));var rp=require(_0x848f('0x3'));var moment=require('moment');var BPromise=require(_0x848f('0x4'));var Mustache=require('mustache');var util=require(_0x848f('0x5'));var path=require(_0x848f('0x6'));var sox=require(_0x848f('0x7'));var csv=require(_0x848f('0x8'));var ejs=require(_0x848f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x848f('0xa'));var squel=require('squel');var crypto=require(_0x848f('0xb'));var jsforce=require(_0x848f('0xc'));var deskjs=require(_0x848f('0xd'));var toCsv=require(_0x848f('0x8'));var querystring=require(_0x848f('0xe'));var Papa=require(_0x848f('0xf'));var Redis=require(_0x848f('0x10'));var authService=require(_0x848f('0x11'));var qs=require(_0x848f('0x12'));var as=require(_0x848f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x848f('0x14'))(_0x848f('0x15'));var utils=require(_0x848f('0x16'));var config=require(_0x848f('0x17'));var licenseUtil=require(_0x848f('0x18'));var db=require(_0x848f('0x19'))['db'];config['redis']=_['defaults'](config[_0x848f('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x848f('0x1a')]));require('./chatGroup.socket')['register'](socket);function respondWithStatusCode(_0xdbc693,_0x2b6546){_0x2b6546=_0x2b6546||0xcc;return function(_0x17cbe3){if(_0x17cbe3){return _0xdbc693[_0x848f('0x1b')](_0x2b6546);}return _0xdbc693['status'](_0x2b6546)[_0x848f('0x1c')]();};}function respondWithResult(_0x57ae7b,_0x240c98){_0x240c98=_0x240c98||0xc8;return function(_0x5009cc){if(_0x5009cc){return _0x57ae7b[_0x848f('0x1d')](_0x240c98)[_0x848f('0x1e')](_0x5009cc);}};}function respondWithFilteredResult(_0x674dd2,_0x324a93){return function(_0x497cc3){if(_0x497cc3){var _0x3771b3=typeof _0x324a93[_0x848f('0x1f')]===_0x848f('0x20')&&typeof _0x324a93[_0x848f('0x21')]===_0x848f('0x20');var _0x2f79fd=_0x497cc3[_0x848f('0x22')];var _0x53081e=_0x3771b3?0x0:_0x324a93['offset'];var _0x5d88e0=_0x3771b3?_0x497cc3[_0x848f('0x22')]:_0x324a93['offset']+_0x324a93['limit'];var _0x4d5667;if(_0x5d88e0>=_0x2f79fd){_0x5d88e0=_0x2f79fd;_0x4d5667=0xc8;}else{_0x4d5667=0xce;}_0x674dd2[_0x848f('0x1d')](_0x4d5667);return _0x674dd2['set'](_0x848f('0x23'),_0x53081e+'-'+_0x5d88e0+'/'+_0x2f79fd)['json'](_0x497cc3);}return null;};}function patchUpdates(_0x51817e){return function(_0x3db3c7){try{jsonpatch[_0x848f('0x24')](_0x3db3c7,_0x51817e,!![]);}catch(_0x4e5976){return BPromise[_0x848f('0x25')](_0x4e5976);}return _0x3db3c7['save']();};}function saveUpdates(_0x389fbe,_0x3fa759){return function(_0x23917a){if(_0x23917a){return _0x23917a[_0x848f('0x26')](_0x389fbe)[_0x848f('0x27')](function(_0x1772ce){return _0x1772ce;});}return null;};}function removeEntity(_0x2e3d70,_0x115f6e){return function(_0x3a0328){if(_0x3a0328){return _0x3a0328[_0x848f('0x28')]()[_0x848f('0x27')](function(){_0x2e3d70[_0x848f('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3313b7,_0x5de048){return function(_0x19815c){if(!_0x19815c){_0x3313b7[_0x848f('0x1b')](0x194);}return _0x19815c;};}function handleError(_0x32c0a3,_0x535e35){_0x535e35=_0x535e35||0x1f4;return function(_0x457265){logger[_0x848f('0x29')](_0x457265['stack']);if(_0x457265[_0x848f('0x2a')]){delete _0x457265['name'];}_0x32c0a3['status'](_0x535e35)[_0x848f('0x2b')](_0x457265);};}exports[_0x848f('0x2c')]=function(_0x1b3950,_0x1a3d46){var _0x39884f={},_0x1d2892={},_0x90f1ce={'count':0x0,'rows':[]};var _0x4f5741=_[_0x848f('0x2d')](db[_0x848f('0x2e')][_0x848f('0x2f')],function(_0x54cec9){return{'name':_0x54cec9[_0x848f('0x30')],'type':_0x54cec9[_0x848f('0x31')][_0x848f('0x32')]};});_0x1d2892[_0x848f('0x33')]=_[_0x848f('0x2d')](_0x4f5741,_0x848f('0x2a'));_0x1d2892[_0x848f('0x34')]=_[_0x848f('0x35')](_0x1b3950[_0x848f('0x34')]);_0x1d2892[_0x848f('0x36')]=_[_0x848f('0x37')](_0x1d2892[_0x848f('0x33')],_0x1d2892[_0x848f('0x34')]);_0x39884f[_0x848f('0x38')]=_[_0x848f('0x37')](_0x1d2892[_0x848f('0x33')],qs['fields'](_0x1b3950[_0x848f('0x34')][_0x848f('0x39')]));_0x39884f[_0x848f('0x38')]=_0x39884f[_0x848f('0x38')][_0x848f('0x3a')]?_0x39884f[_0x848f('0x38')]:_0x1d2892[_0x848f('0x33')];if(!_0x1b3950[_0x848f('0x34')][_0x848f('0x3b')]('nolimit')){_0x39884f[_0x848f('0x21')]=qs['limit'](_0x1b3950[_0x848f('0x34')][_0x848f('0x21')]);_0x39884f[_0x848f('0x1f')]=qs[_0x848f('0x1f')](_0x1b3950[_0x848f('0x34')]['offset']);}_0x39884f['order']=qs['sort'](_0x1b3950[_0x848f('0x34')][_0x848f('0x3c')]);_0x39884f[_0x848f('0x3d')]=qs[_0x848f('0x36')](_[_0x848f('0x3e')](_0x1b3950[_0x848f('0x34')],_0x1d2892['filters']),_0x4f5741);if(_0x1b3950[_0x848f('0x34')][_0x848f('0x3f')]){_0x39884f[_0x848f('0x3d')]=_['merge'](_0x39884f[_0x848f('0x3d')],{'$or':_[_0x848f('0x2d')](_0x4f5741,function(_0x4aff69){if(_0x4aff69[_0x848f('0x31')]!==_0x848f('0x40')){var _0x11f6b3={};_0x11f6b3[_0x4aff69['name']]={'$like':'%'+_0x1b3950[_0x848f('0x34')][_0x848f('0x3f')]+'%'};return _0x11f6b3;}})});}_0x39884f=_[_0x848f('0x41')]({},_0x39884f,_0x1b3950[_0x848f('0x42')]);var _0x5bf0f1={'where':_0x39884f[_0x848f('0x3d')]};return db[_0x848f('0x2e')][_0x848f('0x22')](_0x5bf0f1)[_0x848f('0x27')](function(_0x387c33){_0x90f1ce['count']=_0x387c33;if(_0x1b3950[_0x848f('0x34')][_0x848f('0x43')]){_0x39884f[_0x848f('0x44')]=[{'all':!![]}];}return db[_0x848f('0x2e')]['findAll'](_0x39884f);})[_0x848f('0x27')](function(_0x215a0f){_0x90f1ce[_0x848f('0x45')]=_0x215a0f;return _0x90f1ce;})['then'](respondWithFilteredResult(_0x1a3d46,_0x39884f))[_0x848f('0x46')](handleError(_0x1a3d46,null));};exports[_0x848f('0x47')]=function(_0x34ea88,_0x398333){var _0x3c1de3={'raw':!![],'where':{'id':_0x34ea88[_0x848f('0x48')]['id']}},_0x2c15e5={};_0x2c15e5[_0x848f('0x33')]=_[_0x848f('0x35')](db[_0x848f('0x2e')][_0x848f('0x2f')]);_0x2c15e5['query']=_[_0x848f('0x35')](_0x34ea88[_0x848f('0x34')]);_0x2c15e5[_0x848f('0x36')]=_[_0x848f('0x37')](_0x2c15e5[_0x848f('0x33')],_0x2c15e5['query']);_0x3c1de3[_0x848f('0x38')]=_[_0x848f('0x37')](_0x2c15e5[_0x848f('0x33')],qs[_0x848f('0x39')](_0x34ea88[_0x848f('0x34')][_0x848f('0x39')]));_0x3c1de3[_0x848f('0x38')]=_0x3c1de3['attributes'][_0x848f('0x3a')]?_0x3c1de3[_0x848f('0x38')]:_0x2c15e5[_0x848f('0x33')];if(_0x34ea88['query'][_0x848f('0x43')]){_0x3c1de3[_0x848f('0x44')]=[{'all':!![]}];}_0x3c1de3=_[_0x848f('0x41')]({},_0x3c1de3,_0x34ea88[_0x848f('0x42')]);return db[_0x848f('0x2e')][_0x848f('0x49')](_0x3c1de3)['then'](handleEntityNotFound(_0x398333,null))[_0x848f('0x27')](respondWithResult(_0x398333,null))[_0x848f('0x46')](handleError(_0x398333,null));};exports[_0x848f('0x4a')]=function(_0x168f81,_0x110f91){return db['ChatGroup']['create'](_0x168f81[_0x848f('0x4b')],{})[_0x848f('0x27')](respondWithResult(_0x110f91,0xc9))[_0x848f('0x46')](handleError(_0x110f91,null));};exports['update']=function(_0x3d28d2,_0x561141){if(_0x3d28d2[_0x848f('0x4b')]['id']){delete _0x3d28d2[_0x848f('0x4b')]['id'];}return db[_0x848f('0x2e')][_0x848f('0x49')]({'where':{'id':_0x3d28d2[_0x848f('0x48')]['id']}})[_0x848f('0x27')](handleEntityNotFound(_0x561141,null))['then'](saveUpdates(_0x3d28d2['body'],null))['then'](respondWithResult(_0x561141,null))['catch'](handleError(_0x561141,null));};exports[_0x848f('0x28')]=function(_0x24dc45,_0x3d1505){return db[_0x848f('0x2e')]['find']({'where':{'id':_0x24dc45[_0x848f('0x48')]['id']}})[_0x848f('0x27')](handleEntityNotFound(_0x3d1505,null))['then'](removeEntity(_0x3d1505,null))[_0x848f('0x46')](handleError(_0x3d1505,null));};exports[_0x848f('0x4c')]=function(_0x23631d,_0x317bf8){return db[_0x848f('0x2e')][_0x848f('0x4c')]()[_0x848f('0x27')](respondWithResult(_0x317bf8,null))[_0x848f('0x46')](handleError(_0x317bf8,null));};exports[_0x848f('0x4d')]=function(_0x5d4b61,_0x5dad98,_0x4d400a){return db[_0x848f('0x4e')][_0x848f('0x22')]({'where':{'ChatGroupId':_0x5d4b61['params']['id'],'ToId':_0x5d4b61[_0x848f('0x4f')]['id'],'read':![]}})[_0x848f('0x27')](function(_0x5dccb1){return{'id':_['toInteger'](_0x5d4b61[_0x848f('0x48')]['id']),'count':_0x5dccb1};})['then'](respondWithResult(_0x5dad98,null))[_0x848f('0x46')](handleError(_0x5dad98,null));};exports[_0x848f('0x50')]=function(_0x3c1309,_0x1bac0a,_0x18d391){return db[_0x848f('0x2e')][_0x848f('0x49')]({'where':{'id':_0x3c1309[_0x848f('0x48')]['id']}})[_0x848f('0x27')](handleEntityNotFound(_0x1bac0a,null))[_0x848f('0x27')](function(_0x27074c){if(_0x27074c){return _0x27074c[_0x848f('0x50')](_0x3c1309[_0x848f('0x4b')][_0x848f('0x51')],_[_0x848f('0x52')](_0x3c1309['body'],[_0x848f('0x51'),'id'])||{});}})[_0x848f('0x27')](respondWithResult(_0x1bac0a,null))['catch'](handleError(_0x1bac0a,null));};exports['getMembers']=function(_0x313477,_0x374ae5,_0xa387e3){var _0x1c596f={};var _0x29c6a5={};var _0x377361;var _0x3a93b6;return db[_0x848f('0x2e')][_0x848f('0x53')]({'where':{'id':_0x313477[_0x848f('0x48')]['id']}})[_0x848f('0x27')](handleEntityNotFound(_0x374ae5,null))[_0x848f('0x27')](function(_0x2667d2){if(_0x2667d2){_0x377361=_0x2667d2;_0x29c6a5[_0x848f('0x33')]=_[_0x848f('0x35')](db['User'][_0x848f('0x2f')]);_0x29c6a5['query']=_[_0x848f('0x35')](_0x313477['query']);_0x29c6a5[_0x848f('0x36')]=_[_0x848f('0x37')](_0x29c6a5[_0x848f('0x33')],_0x29c6a5['query']);_0x1c596f[_0x848f('0x38')]=_[_0x848f('0x37')](_0x29c6a5[_0x848f('0x33')],qs['fields'](_0x313477[_0x848f('0x34')][_0x848f('0x39')]));_0x1c596f[_0x848f('0x38')]=_0x1c596f[_0x848f('0x38')][_0x848f('0x3a')]?_0x1c596f['attributes']:_0x29c6a5['model'];_0x1c596f[_0x848f('0x54')]=qs[_0x848f('0x3c')](_0x313477['query'][_0x848f('0x3c')]);_0x1c596f['where']=qs[_0x848f('0x36')](_[_0x848f('0x3e')](_0x313477[_0x848f('0x34')],_0x29c6a5['filters']));if(_0x313477[_0x848f('0x34')]['filter']){_0x1c596f['where']=_[_0x848f('0x41')](_0x1c596f[_0x848f('0x3d')],{'$or':_[_0x848f('0x2d')](_0x1c596f[_0x848f('0x38')],function(_0x103eef){var _0x3d481f={};_0x3d481f[_0x103eef]={'$like':'%'+_0x313477[_0x848f('0x34')]['filter']+'%'};return _0x3d481f;})});}_0x1c596f=_[_0x848f('0x41')]({},_0x1c596f,_0x313477[_0x848f('0x42')]);return _0x377361[_0x848f('0x55')](_0x1c596f);}})[_0x848f('0x27')](function(_0x1dc500){if(_0x1dc500){_0x3a93b6=_0x1dc500[_0x848f('0x3a')];if(!_0x313477[_0x848f('0x34')]['hasOwnProperty'](_0x848f('0x56'))){_0x1c596f[_0x848f('0x21')]=qs['limit'](_0x313477[_0x848f('0x34')][_0x848f('0x21')]);_0x1c596f[_0x848f('0x1f')]=qs[_0x848f('0x1f')](_0x313477[_0x848f('0x34')][_0x848f('0x1f')]);}return _0x377361[_0x848f('0x55')](_0x1c596f);}})[_0x848f('0x27')](function(_0x26071d){if(_0x26071d){return _0x26071d?{'count':_0x3a93b6,'rows':_0x26071d}:null;}})[_0x848f('0x27')](respondWithResult(_0x374ae5,null))[_0x848f('0x46')](handleError(_0x374ae5,null));};exports[_0x848f('0x57')]=function(_0x209da5,_0x72e699,_0x55d719){return db['ChatGroup'][_0x848f('0x49')]({'where':{'id':_0x209da5[_0x848f('0x48')]['id']}})[_0x848f('0x27')](handleEntityNotFound(_0x72e699,null))[_0x848f('0x27')](function(_0x2c6466){if(_0x2c6466){return _0x2c6466[_0x848f('0x57')](_0x209da5[_0x848f('0x34')]['ids']);}})[_0x848f('0x27')](respondWithStatusCode(_0x72e699,null))[_0x848f('0x46')](handleError(_0x72e699,null));};exports[_0x848f('0x58')]=function(_0x439b6d,_0x1d70d8,_0x4be3a6){if(_0x439b6d[_0x848f('0x4b')]['id']){delete _0x439b6d['body']['id'];}return db['ChatGroup']['find']({'where':{'id':_0x439b6d[_0x848f('0x48')]['id']}})['then'](handleEntityNotFound(_0x1d70d8,null))['then'](function(_0x29d974){if(_0x29d974){_0x439b6d[_0x848f('0x4b')][_0x848f('0x59')]=_0x29d974['id'];return db[_0x848f('0x4e')]['create'](_0x439b6d[_0x848f('0x4b')]);}})[_0x848f('0x27')](respondWithResult(_0x1d70d8,null))[_0x848f('0x46')](handleError(_0x1d70d8,null));};exports['getMessages']=function(_0x118418,_0x4898bf,_0x2f4caf){var _0x1cc371={};var _0x4929ff={};var _0x1901af;var _0x25ec71;return db[_0x848f('0x2e')][_0x848f('0x53')]({'where':{'id':_0x118418[_0x848f('0x48')]['id']}})[_0x848f('0x27')](handleEntityNotFound(_0x4898bf,null))[_0x848f('0x27')](function(_0x2d61fb){if(_0x2d61fb){_0x1901af=_0x2d61fb;_0x4929ff['model']=_['keys'](db[_0x848f('0x4e')][_0x848f('0x2f')]);_0x4929ff[_0x848f('0x34')]=_[_0x848f('0x35')](_0x118418[_0x848f('0x34')]);_0x4929ff[_0x848f('0x36')]=_[_0x848f('0x37')](_0x4929ff[_0x848f('0x33')],_0x4929ff['query']);_0x1cc371[_0x848f('0x38')]=_['intersection'](_0x4929ff[_0x848f('0x33')],qs['fields'](_0x118418[_0x848f('0x34')][_0x848f('0x39')]));_0x1cc371[_0x848f('0x38')]=_0x1cc371[_0x848f('0x38')]['length']?_0x1cc371[_0x848f('0x38')]:_0x4929ff[_0x848f('0x33')];_0x1cc371[_0x848f('0x54')]=qs[_0x848f('0x3c')](_0x118418[_0x848f('0x34')][_0x848f('0x3c')]);_0x1cc371[_0x848f('0x3d')]=qs[_0x848f('0x36')](_[_0x848f('0x3e')](_0x118418[_0x848f('0x34')],_0x4929ff[_0x848f('0x36')]));if(_0x118418[_0x848f('0x34')]['filter']){_0x1cc371[_0x848f('0x3d')]=_[_0x848f('0x41')](_0x1cc371[_0x848f('0x3d')],{'$or':_[_0x848f('0x2d')](_0x1cc371[_0x848f('0x38')],function(_0x50db42){var _0x210f91={};_0x210f91[_0x50db42]={'$like':'%'+_0x118418['query'][_0x848f('0x3f')]+'%'};return _0x210f91;})});}if(_0x118418['query'][_0x848f('0x5a')]){var _0xcb52af=_0x118418[_0x848f('0x34')][_0x848f('0x5a')]['split'](',');var _0xfc31fc={};_0xfc31fc[_0xcb52af[0x0]]={'$gte':moment(_0xcb52af[0x1])[_0x848f('0x5b')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1cc371[_0x848f('0x3d')]=_['merge'](_0x1cc371['where'],_0xfc31fc);}_0x1cc371=_[_0x848f('0x41')]({},_0x1cc371,_0x118418[_0x848f('0x42')]);return _0x1901af[_0x848f('0x5c')](_0x1cc371);}})[_0x848f('0x27')](function(_0x59133a){if(_0x59133a){_0x25ec71=_0x59133a[_0x848f('0x3a')];if(!_0x118418[_0x848f('0x34')][_0x848f('0x3b')](_0x848f('0x56'))){_0x1cc371['limit']=qs['limit'](_0x118418[_0x848f('0x34')][_0x848f('0x21')]);_0x1cc371[_0x848f('0x1f')]=qs[_0x848f('0x1f')](_0x118418['query'][_0x848f('0x1f')]);}return _0x1901af[_0x848f('0x5c')](_0x1cc371);}})[_0x848f('0x27')](function(_0x28eaee){if(_0x28eaee){return _0x28eaee?{'count':_0x25ec71,'rows':_0x28eaee}:null;}})[_0x848f('0x27')](respondWithResult(_0x4898bf,null))[_0x848f('0x46')](handleError(_0x4898bf,null));}; \ No newline at end of file +var _0xd7c2=['end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','keys','intersection','query','attributes','length','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','fields','options','find','create','body','describe','getUnread','ChatInternalMessage','user','addMembers','ids','omit','getMembers','User','removeMembers','addMessage','ChatGroupId','getMessages','findOne','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','hasOwnProperty','rimraf','zip-dir','request-promise','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','status'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd7c2,0x105));var _0x2d7c=function(_0x4a4b3c,_0x42f623){_0x4a4b3c=_0x4a4b3c-0x0;var _0x126a63=_0xd7c2[_0x4a4b3c];return _0x126a63;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2d7c('0x0'));var zipdir=require(_0x2d7c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2d7c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2d7c('0x3'));var util=require(_0x2d7c('0x4'));var path=require('path');var sox=require(_0x2d7c('0x5'));var csv=require('to-csv');var ejs=require(_0x2d7c('0x6'));var fs=require('fs');var fs_extra=require(_0x2d7c('0x7'));var _=require(_0x2d7c('0x8'));var squel=require(_0x2d7c('0x9'));var crypto=require(_0x2d7c('0xa'));var jsforce=require(_0x2d7c('0xb'));var deskjs=require(_0x2d7c('0xc'));var toCsv=require(_0x2d7c('0xd'));var querystring=require('querystring');var Papa=require(_0x2d7c('0xe'));var Redis=require(_0x2d7c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2d7c('0x10'));var as=require(_0x2d7c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2d7c('0x12'));var utils=require('../../config/utils');var config=require(_0x2d7c('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x2d7c('0x14'))['db'];config[_0x2d7c('0x15')]=_['defaults'](config['redis'],{'host':_0x2d7c('0x16'),'port':0x18eb});var socket=require(_0x2d7c('0x17'))(new Redis(config[_0x2d7c('0x15')]));require(_0x2d7c('0x18'))['register'](socket);function respondWithStatusCode(_0x42302d,_0x31c612){_0x31c612=_0x31c612||0xcc;return function(_0x3ac978){if(_0x3ac978){return _0x42302d[_0x2d7c('0x19')](_0x31c612);}return _0x42302d[_0x2d7c('0x1a')](_0x31c612)[_0x2d7c('0x1b')]();};}function respondWithResult(_0x18cbbe,_0x2f34ae){_0x2f34ae=_0x2f34ae||0xc8;return function(_0x56b7a1){if(_0x56b7a1){return _0x18cbbe['status'](_0x2f34ae)[_0x2d7c('0x1c')](_0x56b7a1);}};}function respondWithFilteredResult(_0x292701,_0x511e3f){return function(_0x2215e3){if(_0x2215e3){var _0x563de2=typeof _0x511e3f['offset']===_0x2d7c('0x1d')&&typeof _0x511e3f[_0x2d7c('0x1e')]===_0x2d7c('0x1d');var _0xf7aa14=_0x2215e3[_0x2d7c('0x1f')];var _0x15aa4e=_0x563de2?0x0:_0x511e3f['offset'];var _0x40b48f=_0x563de2?_0x2215e3['count']:_0x511e3f[_0x2d7c('0x20')]+_0x511e3f[_0x2d7c('0x1e')];var _0x52d4a4;if(_0x40b48f>=_0xf7aa14){_0x40b48f=_0xf7aa14;_0x52d4a4=0xc8;}else{_0x52d4a4=0xce;}_0x292701['status'](_0x52d4a4);return _0x292701[_0x2d7c('0x21')](_0x2d7c('0x22'),_0x15aa4e+'-'+_0x40b48f+'/'+_0xf7aa14)[_0x2d7c('0x1c')](_0x2215e3);}return null;};}function patchUpdates(_0x330fd5){return function(_0x559b7d){try{jsonpatch[_0x2d7c('0x23')](_0x559b7d,_0x330fd5,!![]);}catch(_0xdf57a4){return BPromise[_0x2d7c('0x24')](_0xdf57a4);}return _0x559b7d[_0x2d7c('0x25')]();};}function saveUpdates(_0x26a29d,_0x32ad72){return function(_0x4e034c){if(_0x4e034c){return _0x4e034c[_0x2d7c('0x26')](_0x26a29d)[_0x2d7c('0x27')](function(_0x393c5e){return _0x393c5e;});}return null;};}function removeEntity(_0x2bfc1c,_0x2fcdde){return function(_0x4d6ffa){if(_0x4d6ffa){return _0x4d6ffa[_0x2d7c('0x28')]()['then'](function(){_0x2bfc1c[_0x2d7c('0x1a')](0xcc)[_0x2d7c('0x1b')]();});}};}function handleEntityNotFound(_0x4db89f,_0x5b6556){return function(_0x18ab36){if(!_0x18ab36){_0x4db89f[_0x2d7c('0x19')](0x194);}return _0x18ab36;};}function handleError(_0x292c3f,_0x5e3d1b){_0x5e3d1b=_0x5e3d1b||0x1f4;return function(_0x227596){logger['error'](_0x227596[_0x2d7c('0x29')]);if(_0x227596[_0x2d7c('0x2a')]){delete _0x227596[_0x2d7c('0x2a')];}_0x292c3f['status'](_0x5e3d1b)[_0x2d7c('0x2b')](_0x227596);};}exports[_0x2d7c('0x2c')]=function(_0x2fcc1a,_0x30a8fa){var _0x4035e5={},_0x3d3b1a={},_0x1696b5={'count':0x0,'rows':[]};var _0x305ba0=_[_0x2d7c('0x2d')](db[_0x2d7c('0x2e')][_0x2d7c('0x2f')],function(_0xe13a1f){return{'name':_0xe13a1f[_0x2d7c('0x30')],'type':_0xe13a1f[_0x2d7c('0x31')][_0x2d7c('0x32')]};});_0x3d3b1a[_0x2d7c('0x33')]=_[_0x2d7c('0x2d')](_0x305ba0,_0x2d7c('0x2a'));_0x3d3b1a['query']=_[_0x2d7c('0x34')](_0x2fcc1a['query']);_0x3d3b1a['filters']=_['intersection'](_0x3d3b1a[_0x2d7c('0x33')],_0x3d3b1a['query']);_0x4035e5['attributes']=_[_0x2d7c('0x35')](_0x3d3b1a[_0x2d7c('0x33')],qs['fields'](_0x2fcc1a[_0x2d7c('0x36')]['fields']));_0x4035e5[_0x2d7c('0x37')]=_0x4035e5[_0x2d7c('0x37')][_0x2d7c('0x38')]?_0x4035e5['attributes']:_0x3d3b1a[_0x2d7c('0x33')];if(!_0x2fcc1a[_0x2d7c('0x36')]['hasOwnProperty'](_0x2d7c('0x39'))){_0x4035e5['limit']=qs[_0x2d7c('0x1e')](_0x2fcc1a[_0x2d7c('0x36')]['limit']);_0x4035e5[_0x2d7c('0x20')]=qs[_0x2d7c('0x20')](_0x2fcc1a['query']['offset']);}_0x4035e5[_0x2d7c('0x3a')]=qs[_0x2d7c('0x3b')](_0x2fcc1a['query'][_0x2d7c('0x3b')]);_0x4035e5['where']=qs[_0x2d7c('0x3c')](_[_0x2d7c('0x3d')](_0x2fcc1a[_0x2d7c('0x36')],_0x3d3b1a[_0x2d7c('0x3c')]),_0x305ba0);if(_0x2fcc1a['query'][_0x2d7c('0x3e')]){_0x4035e5[_0x2d7c('0x3f')]=_[_0x2d7c('0x40')](_0x4035e5[_0x2d7c('0x3f')],{'$or':_['map'](_0x305ba0,function(_0x174932){if(_0x174932[_0x2d7c('0x31')]!==_0x2d7c('0x41')){var _0x227aa0={};_0x227aa0[_0x174932[_0x2d7c('0x2a')]]={'$like':'%'+_0x2fcc1a[_0x2d7c('0x36')][_0x2d7c('0x3e')]+'%'};return _0x227aa0;}})});}_0x4035e5=_['merge']({},_0x4035e5,_0x2fcc1a['options']);var _0x40a460={'where':_0x4035e5[_0x2d7c('0x3f')]};return db['ChatGroup'][_0x2d7c('0x1f')](_0x40a460)[_0x2d7c('0x27')](function(_0x4b571d){_0x1696b5['count']=_0x4b571d;if(_0x2fcc1a['query'][_0x2d7c('0x42')]){_0x4035e5[_0x2d7c('0x43')]=[{'all':!![]}];}return db[_0x2d7c('0x2e')][_0x2d7c('0x44')](_0x4035e5);})['then'](function(_0x3d8fb2){_0x1696b5['rows']=_0x3d8fb2;return _0x1696b5;})[_0x2d7c('0x27')](respondWithFilteredResult(_0x30a8fa,_0x4035e5))[_0x2d7c('0x45')](handleError(_0x30a8fa,null));};exports[_0x2d7c('0x46')]=function(_0x48a5e5,_0x1b150e){var _0x8e768c={'raw':!![],'where':{'id':_0x48a5e5[_0x2d7c('0x47')]['id']}},_0x33272f={};_0x33272f[_0x2d7c('0x33')]=_[_0x2d7c('0x34')](db[_0x2d7c('0x2e')][_0x2d7c('0x2f')]);_0x33272f[_0x2d7c('0x36')]=_[_0x2d7c('0x34')](_0x48a5e5[_0x2d7c('0x36')]);_0x33272f[_0x2d7c('0x3c')]=_[_0x2d7c('0x35')](_0x33272f[_0x2d7c('0x33')],_0x33272f['query']);_0x8e768c[_0x2d7c('0x37')]=_[_0x2d7c('0x35')](_0x33272f[_0x2d7c('0x33')],qs[_0x2d7c('0x48')](_0x48a5e5[_0x2d7c('0x36')][_0x2d7c('0x48')]));_0x8e768c['attributes']=_0x8e768c[_0x2d7c('0x37')][_0x2d7c('0x38')]?_0x8e768c[_0x2d7c('0x37')]:_0x33272f[_0x2d7c('0x33')];if(_0x48a5e5[_0x2d7c('0x36')][_0x2d7c('0x42')]){_0x8e768c[_0x2d7c('0x43')]=[{'all':!![]}];}_0x8e768c=_['merge']({},_0x8e768c,_0x48a5e5[_0x2d7c('0x49')]);return db['ChatGroup'][_0x2d7c('0x4a')](_0x8e768c)[_0x2d7c('0x27')](handleEntityNotFound(_0x1b150e,null))[_0x2d7c('0x27')](respondWithResult(_0x1b150e,null))[_0x2d7c('0x45')](handleError(_0x1b150e,null));};exports[_0x2d7c('0x4b')]=function(_0x227b84,_0x2db43d){return db['ChatGroup'][_0x2d7c('0x4b')](_0x227b84[_0x2d7c('0x4c')],{})[_0x2d7c('0x27')](respondWithResult(_0x2db43d,0xc9))[_0x2d7c('0x45')](handleError(_0x2db43d,null));};exports[_0x2d7c('0x26')]=function(_0x9feefa,_0x41bcd7){if(_0x9feefa[_0x2d7c('0x4c')]['id']){delete _0x9feefa[_0x2d7c('0x4c')]['id'];}return db['ChatGroup'][_0x2d7c('0x4a')]({'where':{'id':_0x9feefa[_0x2d7c('0x47')]['id']}})[_0x2d7c('0x27')](handleEntityNotFound(_0x41bcd7,null))['then'](saveUpdates(_0x9feefa[_0x2d7c('0x4c')],null))['then'](respondWithResult(_0x41bcd7,null))[_0x2d7c('0x45')](handleError(_0x41bcd7,null));};exports[_0x2d7c('0x28')]=function(_0x1b4c7a,_0xbee5d){return db['ChatGroup'][_0x2d7c('0x4a')]({'where':{'id':_0x1b4c7a[_0x2d7c('0x47')]['id']}})[_0x2d7c('0x27')](handleEntityNotFound(_0xbee5d,null))['then'](removeEntity(_0xbee5d,null))['catch'](handleError(_0xbee5d,null));};exports[_0x2d7c('0x4d')]=function(_0x36f9f8,_0x50e5ee){return db[_0x2d7c('0x2e')]['describe']()[_0x2d7c('0x27')](respondWithResult(_0x50e5ee,null))[_0x2d7c('0x45')](handleError(_0x50e5ee,null));};exports[_0x2d7c('0x4e')]=function(_0x49149f,_0x29713f,_0x2a65b3){return db[_0x2d7c('0x4f')][_0x2d7c('0x1f')]({'where':{'ChatGroupId':_0x49149f[_0x2d7c('0x47')]['id'],'ToId':_0x49149f[_0x2d7c('0x50')]['id'],'read':![]}})['then'](function(_0x298c4d){return{'id':_['toInteger'](_0x49149f[_0x2d7c('0x47')]['id']),'count':_0x298c4d};})[_0x2d7c('0x27')](respondWithResult(_0x29713f,null))['catch'](handleError(_0x29713f,null));};exports[_0x2d7c('0x51')]=function(_0x50caca,_0x6e3662,_0x4d83a3){return db[_0x2d7c('0x2e')][_0x2d7c('0x4a')]({'where':{'id':_0x50caca['params']['id']}})[_0x2d7c('0x27')](handleEntityNotFound(_0x6e3662,null))[_0x2d7c('0x27')](function(_0x5ae6e1){if(_0x5ae6e1){return _0x5ae6e1[_0x2d7c('0x51')](_0x50caca[_0x2d7c('0x4c')][_0x2d7c('0x52')],_[_0x2d7c('0x53')](_0x50caca['body'],[_0x2d7c('0x52'),'id'])||{});}})['then'](respondWithResult(_0x6e3662,null))[_0x2d7c('0x45')](handleError(_0x6e3662,null));};exports[_0x2d7c('0x54')]=function(_0x18ddce,_0x48e0bc,_0x4e2dda){var _0x3f2e28={};var _0x26ff6e={};var _0x441711;var _0x13519a;return db[_0x2d7c('0x2e')]['findOne']({'where':{'id':_0x18ddce['params']['id']}})['then'](handleEntityNotFound(_0x48e0bc,null))['then'](function(_0x587053){if(_0x587053){_0x441711=_0x587053;_0x26ff6e['model']=_['keys'](db[_0x2d7c('0x55')][_0x2d7c('0x2f')]);_0x26ff6e['query']=_[_0x2d7c('0x34')](_0x18ddce[_0x2d7c('0x36')]);_0x26ff6e['filters']=_['intersection'](_0x26ff6e[_0x2d7c('0x33')],_0x26ff6e[_0x2d7c('0x36')]);_0x3f2e28[_0x2d7c('0x37')]=_[_0x2d7c('0x35')](_0x26ff6e['model'],qs[_0x2d7c('0x48')](_0x18ddce[_0x2d7c('0x36')][_0x2d7c('0x48')]));_0x3f2e28[_0x2d7c('0x37')]=_0x3f2e28['attributes'][_0x2d7c('0x38')]?_0x3f2e28[_0x2d7c('0x37')]:_0x26ff6e[_0x2d7c('0x33')];_0x3f2e28['order']=qs[_0x2d7c('0x3b')](_0x18ddce[_0x2d7c('0x36')]['sort']);_0x3f2e28['where']=qs[_0x2d7c('0x3c')](_[_0x2d7c('0x3d')](_0x18ddce[_0x2d7c('0x36')],_0x26ff6e[_0x2d7c('0x3c')]));if(_0x18ddce['query'][_0x2d7c('0x3e')]){_0x3f2e28[_0x2d7c('0x3f')]=_[_0x2d7c('0x40')](_0x3f2e28[_0x2d7c('0x3f')],{'$or':_[_0x2d7c('0x2d')](_0x3f2e28['attributes'],function(_0x447904){var _0xb2f777={};_0xb2f777[_0x447904]={'$like':'%'+_0x18ddce['query'][_0x2d7c('0x3e')]+'%'};return _0xb2f777;})});}_0x3f2e28=_[_0x2d7c('0x40')]({},_0x3f2e28,_0x18ddce[_0x2d7c('0x49')]);return _0x441711[_0x2d7c('0x54')](_0x3f2e28);}})[_0x2d7c('0x27')](function(_0x20e631){if(_0x20e631){_0x13519a=_0x20e631[_0x2d7c('0x38')];if(!_0x18ddce[_0x2d7c('0x36')]['hasOwnProperty'](_0x2d7c('0x39'))){_0x3f2e28[_0x2d7c('0x1e')]=qs[_0x2d7c('0x1e')](_0x18ddce[_0x2d7c('0x36')][_0x2d7c('0x1e')]);_0x3f2e28[_0x2d7c('0x20')]=qs[_0x2d7c('0x20')](_0x18ddce[_0x2d7c('0x36')][_0x2d7c('0x20')]);}return _0x441711[_0x2d7c('0x54')](_0x3f2e28);}})['then'](function(_0x230267){if(_0x230267){return _0x230267?{'count':_0x13519a,'rows':_0x230267}:null;}})[_0x2d7c('0x27')](respondWithResult(_0x48e0bc,null))[_0x2d7c('0x45')](handleError(_0x48e0bc,null));};exports[_0x2d7c('0x56')]=function(_0x20a110,_0x790227,_0x5d4ba3){return db[_0x2d7c('0x2e')]['find']({'where':{'id':_0x20a110[_0x2d7c('0x47')]['id']}})[_0x2d7c('0x27')](handleEntityNotFound(_0x790227,null))['then'](function(_0x4d8c7c){if(_0x4d8c7c){return _0x4d8c7c['removeMembers'](_0x20a110[_0x2d7c('0x36')][_0x2d7c('0x52')]);}})[_0x2d7c('0x27')](respondWithStatusCode(_0x790227,null))[_0x2d7c('0x45')](handleError(_0x790227,null));};exports[_0x2d7c('0x57')]=function(_0x5364d4,_0x19ffc2,_0x168083){if(_0x5364d4['body']['id']){delete _0x5364d4['body']['id'];}return db[_0x2d7c('0x2e')]['find']({'where':{'id':_0x5364d4[_0x2d7c('0x47')]['id']}})[_0x2d7c('0x27')](handleEntityNotFound(_0x19ffc2,null))['then'](function(_0x5ebd39){if(_0x5ebd39){_0x5364d4[_0x2d7c('0x4c')][_0x2d7c('0x58')]=_0x5ebd39['id'];return db['ChatInternalMessage'][_0x2d7c('0x4b')](_0x5364d4['body']);}})[_0x2d7c('0x27')](respondWithResult(_0x19ffc2,null))[_0x2d7c('0x45')](handleError(_0x19ffc2,null));};exports[_0x2d7c('0x59')]=function(_0x798f0f,_0x1d4a23,_0x17ed2f){var _0x1f9beb={};var _0xa63c89={};var _0x16294c;var _0x205b5d;return db['ChatGroup'][_0x2d7c('0x5a')]({'where':{'id':_0x798f0f[_0x2d7c('0x47')]['id']}})[_0x2d7c('0x27')](handleEntityNotFound(_0x1d4a23,null))[_0x2d7c('0x27')](function(_0x2effbc){if(_0x2effbc){_0x16294c=_0x2effbc;_0xa63c89[_0x2d7c('0x33')]=_['keys'](db[_0x2d7c('0x4f')]['rawAttributes']);_0xa63c89[_0x2d7c('0x36')]=_[_0x2d7c('0x34')](_0x798f0f[_0x2d7c('0x36')]);_0xa63c89['filters']=_['intersection'](_0xa63c89[_0x2d7c('0x33')],_0xa63c89[_0x2d7c('0x36')]);_0x1f9beb[_0x2d7c('0x37')]=_['intersection'](_0xa63c89['model'],qs[_0x2d7c('0x48')](_0x798f0f['query']['fields']));_0x1f9beb[_0x2d7c('0x37')]=_0x1f9beb['attributes'][_0x2d7c('0x38')]?_0x1f9beb['attributes']:_0xa63c89[_0x2d7c('0x33')];_0x1f9beb[_0x2d7c('0x3a')]=qs[_0x2d7c('0x3b')](_0x798f0f[_0x2d7c('0x36')][_0x2d7c('0x3b')]);_0x1f9beb[_0x2d7c('0x3f')]=qs[_0x2d7c('0x3c')](_[_0x2d7c('0x3d')](_0x798f0f[_0x2d7c('0x36')],_0xa63c89[_0x2d7c('0x3c')]));if(_0x798f0f[_0x2d7c('0x36')]['filter']){_0x1f9beb[_0x2d7c('0x3f')]=_[_0x2d7c('0x40')](_0x1f9beb[_0x2d7c('0x3f')],{'$or':_[_0x2d7c('0x2d')](_0x1f9beb[_0x2d7c('0x37')],function(_0x34406d){var _0x367fe0={};_0x367fe0[_0x34406d]={'$like':'%'+_0x798f0f[_0x2d7c('0x36')][_0x2d7c('0x3e')]+'%'};return _0x367fe0;})});}if(_0x798f0f['query'][_0x2d7c('0x5b')]){var _0x1a71b0=_0x798f0f[_0x2d7c('0x36')][_0x2d7c('0x5b')][_0x2d7c('0x5c')](',');var _0x38e0b7={};_0x38e0b7[_0x1a71b0[0x0]]={'$gte':moment(_0x1a71b0[0x1])[_0x2d7c('0x5d')](_0x2d7c('0x5e'))};_0x1f9beb[_0x2d7c('0x3f')]=_['merge'](_0x1f9beb[_0x2d7c('0x3f')],_0x38e0b7);}_0x1f9beb=_[_0x2d7c('0x40')]({},_0x1f9beb,_0x798f0f['options']);return _0x16294c[_0x2d7c('0x59')](_0x1f9beb);}})[_0x2d7c('0x27')](function(_0x275e81){if(_0x275e81){_0x205b5d=_0x275e81[_0x2d7c('0x38')];if(!_0x798f0f['query'][_0x2d7c('0x5f')](_0x2d7c('0x39'))){_0x1f9beb[_0x2d7c('0x1e')]=qs[_0x2d7c('0x1e')](_0x798f0f[_0x2d7c('0x36')][_0x2d7c('0x1e')]);_0x1f9beb[_0x2d7c('0x20')]=qs[_0x2d7c('0x20')](_0x798f0f['query'][_0x2d7c('0x20')]);}return _0x16294c[_0x2d7c('0x59')](_0x1f9beb);}})[_0x2d7c('0x27')](function(_0x1b82b3){if(_0x1b82b3){return _0x1b82b3?{'count':_0x205b5d,'rows':_0x1b82b3}:null;}})['then'](respondWithResult(_0x1d4a23,null))[_0x2d7c('0x45')](handleError(_0x1d4a23,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index dd1165e..df899ef 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 _0x1d63=['hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','remove','emit'];(function(_0x2ae881,_0x1d223a){var _0x572d1e=function(_0x4b0229){while(--_0x4b0229){_0x2ae881['push'](_0x2ae881['shift']());}};_0x572d1e(++_0x1d223a);}(_0x1d63,0xa4));var _0x31d6=function(_0x165c9d,_0xedb680){_0x165c9d=_0x165c9d-0x0;var _0x294ab1=_0x1d63[_0x165c9d];return _0x294ab1;};'use strict';var EventEmitter=require(_0x31d6('0x0'));var ChatGroup=require(_0x31d6('0x1'))['db'][_0x31d6('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x31d6('0x3')](0x0);var events={'afterCreate':_0x31d6('0x4'),'afterUpdate':'update','afterDestroy':_0x31d6('0x5')};function emitEvent(_0x44ebb1){return function(_0x27c1c8,_0xe4dc8b,_0x3e83c7){ChatGroupEvents[_0x31d6('0x6')](_0x44ebb1+':'+_0x27c1c8['id'],_0x27c1c8);ChatGroupEvents[_0x31d6('0x6')](_0x44ebb1,_0x27c1c8);_0x3e83c7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x31d6('0x7')](e,emitEvent(event));}}module[_0x31d6('0x8')]=ChatGroupEvents; \ No newline at end of file +var _0x1342=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','../../mysqldb','ChatGroup'];(function(_0x2503aa,_0x4ea0db){var _0x44f5e2=function(_0x49ca0d){while(--_0x49ca0d){_0x2503aa['push'](_0x2503aa['shift']());}};_0x44f5e2(++_0x4ea0db);}(_0x1342,0xdf));var _0x2134=function(_0x5bc0c9,_0x114157){_0x5bc0c9=_0x5bc0c9-0x0;var _0x360a78=_0x1342[_0x5bc0c9];return _0x360a78;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x2134('0x0'))['db'][_0x2134('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x2134('0x2')](0x0);var events={'afterCreate':_0x2134('0x3'),'afterUpdate':_0x2134('0x4'),'afterDestroy':_0x2134('0x5')};function emitEvent(_0x546366){return function(_0x38d110,_0x1c2628,_0x116825){ChatGroupEvents[_0x2134('0x6')](_0x546366+':'+_0x38d110['id'],_0x38d110);ChatGroupEvents['emit'](_0x546366,_0x38d110);_0x116825(null);};}for(var e in events){if(events[_0x2134('0x7')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x2134('0x8')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 0ebda9a..fdcacc4 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 _0xe3ec=['moment','path','rimraf','../../config/environment','./chatGroup.attributes','define','ChatGroup','chat_groups','util','api'];(function(_0x200b50,_0x4cf547){var _0x58e759=function(_0x5cbb73){while(--_0x5cbb73){_0x200b50['push'](_0x200b50['shift']());}};_0x58e759(++_0x4cf547);}(_0xe3ec,0x1a2));var _0xce3e=function(_0x50b087,_0x29e612){_0x50b087=_0x50b087-0x0;var _0x4d4d94=_0xe3ec[_0x50b087];return _0x4d4d94;};'use strict';var _=require('lodash');var util=require(_0xce3e('0x0'));var logger=require('../../config/logger')(_0xce3e('0x1'));var moment=require(_0xce3e('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xce3e('0x3'));var rimraf=require(_0xce3e('0x4'));var config=require(_0xce3e('0x5'));var attributes=require(_0xce3e('0x6'));module['exports']=function(_0x4508db,_0x5282b3){return _0x4508db[_0xce3e('0x7')](_0xce3e('0x8'),attributes,{'tableName':_0xce3e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb1d8=['./chatGroup.attributes','exports','define','chat_groups','lodash','api','moment','request-promise','path','rimraf'];(function(_0x3430aa,_0x57cd92){var _0x2ac5c=function(_0x3068dd){while(--_0x3068dd){_0x3430aa['push'](_0x3430aa['shift']());}};_0x2ac5c(++_0x57cd92);}(_0xb1d8,0x1bc));var _0x8b1d=function(_0x10411a,_0x3e47d3){_0x10411a=_0x10411a-0x0;var _0x358c23=_0xb1d8[_0x10411a];return _0x358c23;};'use strict';var _=require(_0x8b1d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8b1d('0x1'));var moment=require(_0x8b1d('0x2'));var BPromise=require('bluebird');var rp=require(_0x8b1d('0x3'));var fs=require('fs');var path=require(_0x8b1d('0x4'));var rimraf=require(_0x8b1d('0x5'));var config=require('../../config/environment');var attributes=require(_0x8b1d('0x6'));module[_0x8b1d('0x7')]=function(_0x344b07,_0x53b802){return _0x344b07[_0x8b1d('0x8')]('ChatGroup',attributes,{'tableName':_0x8b1d('0x9'),'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 9c3707b..f1e0896 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 _0x7217=['then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request'];(function(_0x455150,_0x274121){var _0x12ca9c=function(_0x47eb22){while(--_0x47eb22){_0x455150['push'](_0x455150['shift']());}};_0x12ca9c(++_0x274121);}(_0x7217,0x19e));var _0x7721=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x7217[_0x2b10c6];return _0x3789d2;};'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});config[_0x7721('0xb')]=_[_0x7721('0xc')](config[_0x7721('0xb')],{'host':_0x7721('0xd'),'port':0x18eb});var socket=require(_0x7721('0xe'))(new Redis(config[_0x7721('0xb')]));require(_0x7721('0xf'))[_0x7721('0x10')](socket);function respondWithRpcPromise(_0x138740,_0x2c3986,_0x578d59){return new BPromise(function(_0x461d1a,_0x29bc8f){return client[_0x7721('0x11')](_0x138740,_0x578d59)[_0x7721('0x12')](function(_0xa8977c){logger[_0x7721('0x13')](_0x7721('0x14'),_0x2c3986,_0x7721('0x15'));logger['debug'](_0x7721('0x16'),_0x2c3986,_0x7721('0x15'),JSON['stringify'](_0xa8977c));if(_0xa8977c[_0x7721('0x17')]){if(_0xa8977c[_0x7721('0x17')][_0x7721('0x18')]===0x1f4){logger[_0x7721('0x17')]('ChatGroup,\x20%s,\x20%s',_0x2c3986,_0xa8977c[_0x7721('0x17')][_0x7721('0x19')]);return _0x29bc8f(_0xa8977c['error']['message']);}logger['error'](_0x7721('0x14'),_0x2c3986,_0xa8977c[_0x7721('0x17')][_0x7721('0x19')]);return _0x461d1a(_0xa8977c[_0x7721('0x17')]['message']);}else{logger[_0x7721('0x13')]('ChatGroup,\x20%s,\x20%s',_0x2c3986,_0x7721('0x15'));_0x461d1a(_0xa8977c['result'][_0x7721('0x19')]);}})[_0x7721('0x1a')](function(_0x3ab5a5){logger[_0x7721('0x17')](_0x7721('0x14'),_0x2c3986,_0x3ab5a5);_0x29bc8f(_0x3ab5a5);});});} \ No newline at end of file +var _0x3c70=['defaults','localhost','socket.io-emitter','register','request','then','info','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatGroup,\x20%s,\x20%s','request\x20sent','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3c70,0x10c));var _0x03c7=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0x3c70[_0x34021d];return _0x16597b;};'use strict';var _=require(_0x03c7('0x0'));var util=require(_0x03c7('0x1'));var moment=require(_0x03c7('0x2'));var BPromise=require('bluebird');var rs=require(_0x03c7('0x3'));var fs=require('fs');var Redis=require(_0x03c7('0x4'));var db=require(_0x03c7('0x5'))['db'];var utils=require(_0x03c7('0x6'));var logger=require(_0x03c7('0x7'))(_0x03c7('0x8'));var config=require('../../config/environment');var jayson=require(_0x03c7('0x9'));var client=jayson['client'][_0x03c7('0xa')]({'port':0x232a});config[_0x03c7('0xb')]=_[_0x03c7('0xc')](config['redis'],{'host':_0x03c7('0xd'),'port':0x18eb});var socket=require(_0x03c7('0xe'))(new Redis(config[_0x03c7('0xb')]));require('./chatGroup.socket')[_0x03c7('0xf')](socket);function respondWithRpcPromise(_0x48c3f7,_0x103052,_0x20c6c8){return new BPromise(function(_0x57c8fb,_0x856199){return client[_0x03c7('0x10')](_0x48c3f7,_0x20c6c8)[_0x03c7('0x11')](function(_0xf98747){logger[_0x03c7('0x12')]('ChatGroup,\x20%s,\x20%s',_0x103052,'request\x20sent');logger[_0x03c7('0x13')](_0x03c7('0x14'),_0x103052,'request\x20sent',JSON[_0x03c7('0x15')](_0xf98747));if(_0xf98747[_0x03c7('0x16')]){if(_0xf98747[_0x03c7('0x16')][_0x03c7('0x17')]===0x1f4){logger[_0x03c7('0x16')]('ChatGroup,\x20%s,\x20%s',_0x103052,_0xf98747[_0x03c7('0x16')]['message']);return _0x856199(_0xf98747[_0x03c7('0x16')][_0x03c7('0x18')]);}logger['error'](_0x03c7('0x19'),_0x103052,_0xf98747[_0x03c7('0x16')][_0x03c7('0x18')]);return _0x57c8fb(_0xf98747['error'][_0x03c7('0x18')]);}else{logger[_0x03c7('0x12')](_0x03c7('0x19'),_0x103052,_0x03c7('0x1a'));_0x57c8fb(_0xf98747[_0x03c7('0x1b')][_0x03c7('0x18')]);}})['catch'](function(_0x571108){logger[_0x03c7('0x16')](_0x03c7('0x19'),_0x103052,_0x571108);_0x856199(_0x571108);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index d37b7df..8b2af28 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 _0x5910=['removeListener','register','length','chatGroup:','./chatGroup.events','remove','update','emit'];(function(_0x97ade9,_0x568fad){var _0x171e11=function(_0x1d280a){while(--_0x1d280a){_0x97ade9['push'](_0x97ade9['shift']());}};_0x171e11(++_0x568fad);}(_0x5910,0x12c));var _0x0591=function(_0x1f0398,_0x4a96ef){_0x1f0398=_0x1f0398-0x0;var _0x1c35cd=_0x5910[_0x1f0398];return _0x1c35cd;};'use strict';var ChatGroupEvents=require(_0x0591('0x0'));var events=['save',_0x0591('0x1'),_0x0591('0x2')];function createListener(_0x15644e,_0xb4dd9f){return function(_0x4b499d){_0xb4dd9f[_0x0591('0x3')](_0x15644e,_0x4b499d);};}function removeListener(_0x58936a,_0xc0de1f){return function(){ChatGroupEvents[_0x0591('0x4')](_0x58936a,_0xc0de1f);};}exports[_0x0591('0x5')]=function(_0x58e506){for(var _0xaa8e8f=0x0,_0x2247aa=events[_0x0591('0x6')];_0xaa8e8f<_0x2247aa;_0xaa8e8f++){var _0x1c0a63=events[_0xaa8e8f];var _0x3babfb=createListener(_0x0591('0x7')+_0x1c0a63,_0x58e506);ChatGroupEvents['on'](_0x1c0a63,_0x3babfb);}}; \ No newline at end of file +var _0x91b7=['length','chatGroup:','save','update','removeListener','register'];(function(_0x36591d,_0x110f4d){var _0xa0b3f6=function(_0x206b02){while(--_0x206b02){_0x36591d['push'](_0x36591d['shift']());}};_0xa0b3f6(++_0x110f4d);}(_0x91b7,0x8c));var _0x791b=function(_0x245d40,_0x455ece){_0x245d40=_0x245d40-0x0;var _0x245534=_0x91b7[_0x245d40];return _0x245534;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x791b('0x0'),'remove',_0x791b('0x1')];function createListener(_0xde7c42,_0x2ecd6c){return function(_0x128808){_0x2ecd6c['emit'](_0xde7c42,_0x128808);};}function removeListener(_0xea6bb2,_0x42bff6){return function(){ChatGroupEvents[_0x791b('0x2')](_0xea6bb2,_0x42bff6);};}exports[_0x791b('0x3')]=function(_0x1aabc0){for(var _0x25cfd8=0x0,_0x22231e=events[_0x791b('0x4')];_0x25cfd8<_0x22231e;_0x25cfd8++){var _0x4c45b7=events[_0x25cfd8];var _0x35a17b=createListener(_0x791b('0x5')+_0x4c45b7,_0x1aabc0);ChatGroupEvents['on'](_0x4c45b7,_0x35a17b);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index e83e449..d1d1921 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 _0x0144=['describe','/:id','isAuthenticated','show','/:id/unread','getUnread','/:id/members','getMembers','getMessages','post','/:id/messages','put','delete','destroy','removeMembers','exports','multer','connect-timeout','fs-extra','../../config/environment','./chatGroup.controller','get','index','/describe'];(function(_0x40a545,_0x5a2595){var _0x5888da=function(_0x3d3e6c){while(--_0x3d3e6c){_0x40a545['push'](_0x40a545['shift']());}};_0x5888da(++_0x5a2595);}(_0x0144,0xb8));var _0x4014=function(_0x1e2321,_0x3ae1c5){_0x1e2321=_0x1e2321-0x0;var _0x1d346d=_0x0144[_0x1e2321];return _0x1d346d;};'use strict';var multer=require(_0x4014('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4014('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4014('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4014('0x3'));var controller=require(_0x4014('0x4'));router[_0x4014('0x5')]('/',auth['isAuthenticated'](),controller[_0x4014('0x6')]);router[_0x4014('0x5')](_0x4014('0x7'),auth['isAuthenticated'](),controller[_0x4014('0x8')]);router['get'](_0x4014('0x9'),auth[_0x4014('0xa')](),controller[_0x4014('0xb')]);router['get'](_0x4014('0xc'),auth['isAuthenticated'](),controller[_0x4014('0xd')]);router['get'](_0x4014('0xe'),auth['isAuthenticated'](),controller[_0x4014('0xf')]);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0x4014('0x10')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x4014('0x11')](_0x4014('0xe'),auth[_0x4014('0xa')](),controller['addMembers']);router[_0x4014('0x11')](_0x4014('0x12'),auth['isAuthenticated'](),controller['addMessage']);router[_0x4014('0x13')](_0x4014('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x4014('0x14')](_0x4014('0x9'),auth[_0x4014('0xa')](),controller[_0x4014('0x15')]);router['delete']('/:id/members',auth[_0x4014('0xa')](),controller[_0x4014('0x16')]);module[_0x4014('0x17')]=router; \ No newline at end of file +var _0xd0d8=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','describe','/:id','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','create','post','addMembers','put','update','delete','destroy','removeMembers','multer','util'];(function(_0x3feee9,_0x33769a){var _0x2315aa=function(_0x19881f){while(--_0x19881f){_0x3feee9['push'](_0x3feee9['shift']());}};_0x2315aa(++_0x33769a);}(_0xd0d8,0x177));var _0x8d0d=function(_0x37dbf3,_0x4ad77d){_0x37dbf3=_0x37dbf3-0x0;var _0x1cda9b=_0xd0d8[_0x37dbf3];return _0x1cda9b;};'use strict';var multer=require(_0x8d0d('0x0'));var util=require(_0x8d0d('0x1'));var path=require(_0x8d0d('0x2'));var timeout=require(_0x8d0d('0x3'));var express=require(_0x8d0d('0x4'));var router=express[_0x8d0d('0x5')]();var fs_extra=require(_0x8d0d('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8d0d('0x7'));var config=require(_0x8d0d('0x8'));var controller=require(_0x8d0d('0x9'));router[_0x8d0d('0xa')]('/',auth[_0x8d0d('0xb')](),controller[_0x8d0d('0xc')]);router[_0x8d0d('0xa')]('/describe',auth[_0x8d0d('0xb')](),controller[_0x8d0d('0xd')]);router['get'](_0x8d0d('0xe'),auth[_0x8d0d('0xb')](),controller['show']);router['get'](_0x8d0d('0xf'),auth[_0x8d0d('0xb')](),controller[_0x8d0d('0x10')]);router[_0x8d0d('0xa')](_0x8d0d('0x11'),auth[_0x8d0d('0xb')](),controller[_0x8d0d('0x12')]);router[_0x8d0d('0xa')](_0x8d0d('0x13'),auth[_0x8d0d('0xb')](),controller[_0x8d0d('0x14')]);router['post']('/',auth[_0x8d0d('0xb')](),controller[_0x8d0d('0x15')]);router[_0x8d0d('0x16')]('/:id/members',auth[_0x8d0d('0xb')](),controller[_0x8d0d('0x17')]);router['post'](_0x8d0d('0x13'),auth[_0x8d0d('0xb')](),controller['addMessage']);router[_0x8d0d('0x18')](_0x8d0d('0xe'),auth['isAuthenticated'](),controller[_0x8d0d('0x19')]);router[_0x8d0d('0x1a')](_0x8d0d('0xe'),auth['isAuthenticated'](),controller[_0x8d0d('0x1b')]);router[_0x8d0d('0x1a')](_0x8d0d('0x11'),auth[_0x8d0d('0xb')](),controller[_0x8d0d('0x1c')]);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 d1d45cf..7c2df0c 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 _0x7df3=['BOOLEAN','sequelize','exports','INTEGER','star','TEXT','STRING','DATE','ENUM'];(function(_0x28be71,_0x1a660d){var _0x369de0=function(_0x259ec9){while(--_0x259ec9){_0x28be71['push'](_0x28be71['shift']());}};_0x369de0(++_0x1a660d);}(_0x7df3,0x1cc));var _0x37df=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x7df3[_0x4154a6];return _0x3b2786;};'use strict';var Sequelize=require(_0x37df('0x0'));module[_0x37df('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x37df('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0x37df('0x3'),'thumb'),'defaultValue':_0x37df('0x3')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x37df('0x4')]},'mailTranscript':{'type':Sequelize[_0x37df('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x37df('0x6')]},'disposition':{'type':Sequelize[_0x37df('0x5')]},'secondDisposition':{'type':Sequelize[_0x37df('0x5')]},'thirdDisposition':{'type':Sequelize[_0x37df('0x5')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x37df('0x5')]},'osVersion':{'type':Sequelize[_0x37df('0x5')]},'deviceModel':{'type':Sequelize[_0x37df('0x5')]},'deviceVendor':{'type':Sequelize[_0x37df('0x5')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x37df('0x4')]},'customerIp':{'type':Sequelize[_0x37df('0x5')]},'formData':{'type':Sequelize[_0x37df('0x4')]('long')},'read1stAt':{'type':Sequelize[_0x37df('0x6')]},'lastMsgAt':{'type':Sequelize[_0x37df('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x37df('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x37df('0x5')]},'customerPort':{'type':Sequelize[_0x37df('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x37df('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x37df('0x8')],'defaultValue':![]}}; \ No newline at end of file +var _0x793b=['INTEGER','ENUM','thumb','star','STRING','DATE','TEXT','long','out','sequelize','exports','BOOLEAN'];(function(_0x439d59,_0x11ccdf){var _0x3670c7=function(_0x11cfcb){while(--_0x11cfcb){_0x439d59['push'](_0x439d59['shift']());}};_0x3670c7(++_0x11ccdf);}(_0x793b,0x189));var _0xb793=function(_0x19f44e,_0x3a56c3){_0x19f44e=_0x19f44e-0x0;var _0x585647=_0x793b[_0x19f44e];return _0x585647;};'use strict';var Sequelize=require(_0xb793('0x0'));module[_0xb793('0x1')]={'closed':{'type':Sequelize[_0xb793('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xb793('0x3')]},'ratingType':{'type':Sequelize[_0xb793('0x4')]('star',_0xb793('0x5')),'defaultValue':_0xb793('0x6')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0xb793('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xb793('0x8')]},'disposition':{'type':Sequelize[_0xb793('0x7')]},'secondDisposition':{'type':Sequelize[_0xb793('0x7')]},'thirdDisposition':{'type':Sequelize[_0xb793('0x7')]},'note':{'type':Sequelize[_0xb793('0x7')]},'browserName':{'type':Sequelize[_0xb793('0x7')]},'browserVersion':{'type':Sequelize[_0xb793('0x7')]},'osName':{'type':Sequelize[_0xb793('0x7')]},'osVersion':{'type':Sequelize[_0xb793('0x7')]},'deviceModel':{'type':Sequelize[_0xb793('0x7')]},'deviceVendor':{'type':Sequelize[_0xb793('0x7')]},'deviceType':{'type':Sequelize[_0xb793('0x7')]},'referer':{'type':Sequelize[_0xb793('0x9')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xb793('0x9')](_0xb793('0xa'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xb793('0x4')]('in',_0xb793('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0xb793('0x7')]},'vidaooSessionId':{'type':Sequelize[_0xb793('0x9')]},'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 c6b913d..ec19a5c 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 _0xef0f=['alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','auth','pass','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','mailTranscript','addMessage','ids','getMessages','YYYY-MM-DD\x20HH:mm:ss','findAll','hasOwnProperty','includeAgent','addTags','setTags','omit','emit','removeTags','download','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','direction','Account','mkdirSync','Chat','Owner','N.A.','browserName','osName','existsSync','pipe','createWriteStream','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','err','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','jayson/promise','http','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','json','offset','undefined','limit','set','Content-Range','save','update','destroy','end','stack','name','send','render','body','contact','interaction','account','Users','TagIds','Tags','split','forEach','push','index','ChatInteraction','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','select','field','u.id','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','length','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','text','start','Tag','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','some','compact','isEmpty','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','getChatWebsites','ChatWebsiteId','sequelize','toString','count','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','contactName','Contact.firstName','Contact.lastName','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','params','keys','includeAll','include','options','create','describe','createVidaooSession','ChatWebsite','findOne','vidaooEscalation','vidaooTopic','vidaooMetadata','vidaooApiKey','email','isNull','vidaooNote','follow','metadata','ValidationError','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','originalname','basename','file','filename','mimetype','Unauthorized','Attachment','attachId','join','root','server/files/attachments/','offline-chat/','server/files/chat/upload/','format','now','Messages','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias'];(function(_0x38d23e,_0x5e4cd6){var _0x55a3eb=function(_0x27eb8c){while(--_0x27eb8c){_0x38d23e['push'](_0x38d23e['shift']());}};_0x55a3eb(++_0x5e4cd6);}(_0xef0f,0x168));var _0xfef0=function(_0x5d7926,_0x10895a){_0x5d7926=_0x5d7926-0x0;var _0x66fbfc=_0xef0f[_0x5d7926];return _0x66fbfc;};'use strict';var emlformat=require(_0xfef0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfef0('0x1'));var jsonpatch=require(_0xfef0('0x2'));var rp=require(_0xfef0('0x3'));var moment=require('moment');var BPromise=require(_0xfef0('0x4'));var Mustache=require(_0xfef0('0x5'));var util=require(_0xfef0('0x6'));var path=require('path');var sox=require(_0xfef0('0x7'));var csv=require(_0xfef0('0x8'));var ejs=require(_0xfef0('0x9'));var fs=require('fs');var fs_extra=require(_0xfef0('0xa'));var _=require(_0xfef0('0xb'));var squel=require(_0xfef0('0xc'));var crypto=require('crypto');var jsforce=require(_0xfef0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xfef0('0x8'));var querystring=require(_0xfef0('0xe'));var Papa=require(_0xfef0('0xf'));var Redis=require(_0xfef0('0x10'));var authService=require(_0xfef0('0x11'));var qs=require(_0xfef0('0x12'));var as=require(_0xfef0('0x13'));var pdf=require(_0xfef0('0x14'));var hardwareService=require(_0xfef0('0x15'));var logger=require(_0xfef0('0x16'))(_0xfef0('0x17'));var utils=require(_0xfef0('0x18'));var config=require(_0xfef0('0x19'));var licenseUtil=require(_0xfef0('0x1a'));var db=require('../../mysqldb')['db'];config[_0xfef0('0x1b')]=_[_0xfef0('0x1c')](config[_0xfef0('0x1b')],{'host':_0xfef0('0x1d'),'port':0x18eb});var socket=require(_0xfef0('0x1e'))(new Redis(config[_0xfef0('0x1b')]));require(_0xfef0('0x1f'))['register'](socket);var jayson=require(_0xfef0('0x20'));var client=jayson['client']['http']({'port':0x232b});var client9004=jayson['client'][_0xfef0('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x284b6d,_0x3510a7,_0x1bce2f,_0x2a96d9){return new BPromise(function(_0x3f9a6c,_0x155833){var _0x2887e6=_0x2a96d9||client;return _0x2887e6['request'](_0x284b6d,_0x1bce2f)[_0xfef0('0x22')](function(_0x1642cd){logger[_0xfef0('0x23')](_0xfef0('0x24'),_0x3510a7,_0xfef0('0x25'));logger['debug'](_0xfef0('0x26'),_0x3510a7,'request\x20sent',JSON[_0xfef0('0x27')](_0x1642cd));if(_0x1642cd[_0xfef0('0x28')]){if(_0x1642cd[_0xfef0('0x28')]['code']===0x1f4){logger[_0xfef0('0x28')]('ChatInteraction,\x20%s,\x20%s',_0x3510a7,_0x1642cd[_0xfef0('0x28')][_0xfef0('0x29')]);return _0x155833(_0x1642cd['error']['message']);}logger['error'](_0xfef0('0x24'),_0x3510a7,_0x1642cd['error'][_0xfef0('0x29')]);return _0x3f9a6c(_0x1642cd[_0xfef0('0x28')][_0xfef0('0x29')]);}else{logger[_0xfef0('0x23')](_0xfef0('0x24'),_0x3510a7,_0xfef0('0x25'));_0x3f9a6c(_0x1642cd['result']['message']);}})[_0xfef0('0x2a')](function(_0x1ffaa4){logger[_0xfef0('0x28')](_0xfef0('0x24'),_0x3510a7,_0x1ffaa4);_0x155833(_0x1ffaa4);});});}function respondWithStatusCode(_0xab231c,_0xf60f2){_0xf60f2=_0xf60f2||0xcc;return function(_0x5df04f){if(_0x5df04f){return _0xab231c[_0xfef0('0x2b')](_0xf60f2);}return _0xab231c[_0xfef0('0x2c')](_0xf60f2)['end']();};}function respondWithResult(_0x1a6758,_0x394bad){_0x394bad=_0x394bad||0xc8;return function(_0xca0cce){if(_0xca0cce){return _0x1a6758[_0xfef0('0x2c')](_0x394bad)[_0xfef0('0x2d')](_0xca0cce);}};}function respondWithFilteredResult(_0x1ac4a3,_0x3e3c4c){return function(_0x3e026a){if(_0x3e026a){var _0x26cb9a=typeof _0x3e3c4c[_0xfef0('0x2e')]===_0xfef0('0x2f')&&typeof _0x3e3c4c[_0xfef0('0x30')]==='undefined';var _0x445625=_0x3e026a['count'];var _0x4eaf74=_0x26cb9a?0x0:_0x3e3c4c[_0xfef0('0x2e')];var _0x2ae54a=_0x26cb9a?_0x3e026a['count']:_0x3e3c4c['offset']+_0x3e3c4c['limit'];var _0x4f65cd;if(_0x2ae54a>=_0x445625){_0x2ae54a=_0x445625;_0x4f65cd=0xc8;}else{_0x4f65cd=0xce;}_0x1ac4a3['status'](_0x4f65cd);return _0x1ac4a3[_0xfef0('0x31')](_0xfef0('0x32'),_0x4eaf74+'-'+_0x2ae54a+'/'+_0x445625)[_0xfef0('0x2d')](_0x3e026a);}return null;};}function patchUpdates(_0x5cda6b){return function(_0x4d0778){try{jsonpatch['apply'](_0x4d0778,_0x5cda6b,!![]);}catch(_0x1f8110){return BPromise['reject'](_0x1f8110);}return _0x4d0778[_0xfef0('0x33')]();};}function saveUpdates(_0x3783f9,_0x1b9f39){return function(_0x4a2773){if(_0x4a2773){return _0x4a2773[_0xfef0('0x34')](_0x3783f9)['then'](function(_0x4234e4){return _0x4234e4;});}return null;};}function removeEntity(_0x1f21b7,_0x234d49){return function(_0xe5188e){if(_0xe5188e){return _0xe5188e[_0xfef0('0x35')]()[_0xfef0('0x22')](function(){_0x1f21b7[_0xfef0('0x2c')](0xcc)[_0xfef0('0x36')]();});}};}function handleEntityNotFound(_0x590e37,_0x24ea7c){return function(_0xea09ec){if(!_0xea09ec){_0x590e37[_0xfef0('0x2b')](0x194);}return _0xea09ec;};}function handleError(_0x36b2d1,_0xae697){_0xae697=_0xae697||0x1f4;return function(_0x262341){logger[_0xfef0('0x28')](_0x262341[_0xfef0('0x37')]);if(_0x262341[_0xfef0('0x38')]){delete _0x262341[_0xfef0('0x38')];}_0x36b2d1[_0xfef0('0x2c')](_0xae697)[_0xfef0('0x39')](_0x262341);};}function getMustacheRender(_0x366667,_0x4a8af4){return Mustache[_0xfef0('0x3a')](_0x366667,_['merge'](_0x4a8af4[_0xfef0('0x3b')],{'contact':_0x4a8af4[_0xfef0('0x3c')],'message':_0x4a8af4[_0xfef0('0x29')],'agent':_0x4a8af4['agent'],'interaction':_0x4a8af4[_0xfef0('0x3d')],'account':_0x4a8af4[_0xfef0('0x3e')]}))||'';}function getInteractionUsers(_0x3f2753,_0x5537c8){return new BPromise(function(_0x8613a0,_0x3abcc5){try{if(_0x5537c8[_0x3f2753['id']]){_0x3f2753[_0xfef0('0x3f')]=_['map'](_0x5537c8[_0x3f2753['id']],function(_0x3a6667){return{'id':_0x3a6667['id'],'fullname':_0x3a6667['fullname']};});}}catch(_0x49ed48){_0x3abcc5(_0x49ed48);}_0x8613a0(_0x3f2753);});}function getInteractionTags(_0xf30aff,_0x547a5d){return new BPromise(function(_0x5c3305,_0xbf6ddd){try{if(_0xf30aff[_0xfef0('0x40')]){_0xf30aff[_0xfef0('0x41')]=[];_0xf30aff[_0xfef0('0x40')][_0xfef0('0x42')](',')[_0xfef0('0x43')](function(_0x4dd8f8){_0xf30aff[_0xfef0('0x41')][_0xfef0('0x44')](_0x547a5d[_0x4dd8f8]);});}delete _0xf30aff['TagIds'];}catch(_0x54d5cb){_0xbf6ddd(_0x54d5cb);}_0x5c3305(_0xf30aff);});}function updateChatInteraction(_0x1d554e,_0x5dc824,_0x1fc518){return new BPromise(function(_0x22c940,_0x3c100c){return getInteractionUsers(_0x1d554e,_0x1fc518)[_0xfef0('0x22')](function(_0x199c57){return getInteractionTags(_0x199c57,_0x5dc824);})[_0xfef0('0x22')](function(_0x166a7b){_0x22c940(_0x166a7b);})[_0xfef0('0x2a')](function(_0x4e63f3){_0x3c100c(_0x4e63f3);});});}exports[_0xfef0('0x45')]=function(_0x50e372,_0x4b6da1){var _0x18c656={},_0x17d7f2={},_0x5bf416={'count':0x0,'rows':[]};var _0x2af79f=_['map'](db[_0xfef0('0x46')][_0xfef0('0x47')],function(_0x1f252e){return{'name':_0x1f252e[_0xfef0('0x48')],'type':_0x1f252e['type'][_0xfef0('0x49')]};});_0x17d7f2[_0xfef0('0x4a')]=_['map'](_0x2af79f,'name');_0x17d7f2[_0xfef0('0x4b')]=_['keys'](_0x50e372[_0xfef0('0x4b')]);_0x17d7f2[_0xfef0('0x4c')]=_[_0xfef0('0x4d')](_0x17d7f2[_0xfef0('0x4a')],_0x17d7f2[_0xfef0('0x4b')]);_0x18c656[_0xfef0('0x4e')]=_['intersection'](_0x17d7f2[_0xfef0('0x4a')],qs['fields'](_0x50e372['query'][_0xfef0('0x4f')]));_0x18c656[_0xfef0('0x4e')]=_0x18c656[_0xfef0('0x4e')]['length']?_0x18c656[_0xfef0('0x4e')]:_0x17d7f2['model'];if(!_0x50e372['query']['hasOwnProperty'](_0xfef0('0x50'))){_0x18c656[_0xfef0('0x30')]=qs[_0xfef0('0x30')](_0x50e372[_0xfef0('0x4b')][_0xfef0('0x30')]);_0x18c656[_0xfef0('0x2e')]=qs[_0xfef0('0x2e')](_0x50e372[_0xfef0('0x4b')][_0xfef0('0x2e')]);}_0x18c656['order']=qs['sort'](_0x50e372[_0xfef0('0x4b')][_0xfef0('0x51')]);_0x18c656[_0xfef0('0x52')]=qs[_0xfef0('0x4c')](_[_0xfef0('0x53')](_0x50e372[_0xfef0('0x4b')],_0x17d7f2[_0xfef0('0x4c')]),_0x2af79f);var _0x20b647=[];var _0x5e989f=squel[_0xfef0('0x54')]()[_0xfef0('0x55')]('id')[_0xfef0('0x55')](_0xfef0('0x38'))[_0xfef0('0x55')]('color')['from']('tools_tags');var _0x445f3f=squel[_0xfef0('0x54')]()[_0xfef0('0x55')](_0xfef0('0x56'))['field'](_0xfef0('0x57'))[_0xfef0('0x55')](_0xfef0('0x58'))[_0xfef0('0x59')](_0xfef0('0x5a'),'ui')[_0xfef0('0x5b')](_0xfef0('0x5c'),'u','u.id\x20=\x20ui.UserId');var _0x3458b0=squel[_0xfef0('0x54')]()['from'](_0xfef0('0x5d'),'i')['left_join'](_0xfef0('0x5e'),'c',_0xfef0('0x5f'))['left_join'](_0xfef0('0x5c'),'o','o.id\x20=\x20i.UserId')['left_join']('chat_websites','a',_0xfef0('0x60'))[_0xfef0('0x5b')](_0xfef0('0x61'),'me',_0xfef0('0x62'))[_0xfef0('0x5b')](_0xfef0('0x63'),'it','it.ChatInteractionId\x20=\x20i.id')[_0xfef0('0x5b')](_0xfef0('0x64'),'t',_0xfef0('0x65'));var _0x45abb3=squel[_0xfef0('0x66')]();var _0x58d95e=[];var _0x59d1b6=squel['expr']();var _0x135653;if(_0x50e372['query'][_0xfef0('0x67')]){_0x135653=as[_0xfef0('0x68')](_0x50e372[_0xfef0('0x4b')][_0xfef0('0x67')]);var _0xd0255c=_0x135653['sqlOperator'];for(var _0x2abdb7=0x0;_0x2abdb7<_0x135653['conditions'][_0xfef0('0x69')];_0x2abdb7++){var _0x4a1316=_0x135653['conditions'][_0x2abdb7];var _0x3a12c5='i';var _0x3c5640=_[_0xfef0('0x6a')](_0x2af79f,[_0xfef0('0x38'),_0x4a1316[_0xfef0('0x55')]]);if(!_0x3c5640){switch(_0x4a1316[_0xfef0('0x55')]){case _0xfef0('0x6b'):if(_0x4a1316[_0xfef0('0x6c')]==0x1){_0x3458b0[_0xfef0('0x6d')]('`'+_0x4a1316[_0xfef0('0x55')]+_0xfef0('0x6e'));}else{_0x3458b0[_0xfef0('0x6d')]('`'+_0x4a1316['field']+_0xfef0('0x6f'));}break;case _0xfef0('0x70'):if(_0x4a1316[_0xfef0('0x71')]===_0xfef0('0x72')){if(_0x4a1316[_0xfef0('0x6c')]['split']('\x20')[_0xfef0('0x69')]>0x1){_0x45abb3[_0xd0255c](_0xfef0('0x73'),qs[_0xfef0('0x74')](_0x4a1316[_0xfef0('0x6c')]),null);}else{var _0x176fc7='%'+_0x4a1316[_0xfef0('0x6c')]+'%';_0x45abb3[_0xd0255c](_0xfef0('0x75'),_0x176fc7,_0x176fc7,_0x176fc7);}}else{_0x3c5640=_[_0xfef0('0x6a')](_0x2af79f,[_0xfef0('0x38'),_0xfef0('0x76')]);_0x4a1316['field']=_0xfef0('0x76');_0x1d7caf=as['buildExpression'](_0x3a12c5,_0x3c5640[_0xfef0('0x77')],_0x4a1316);_0x45abb3[_0xd0255c](_0x1d7caf[_0xfef0('0x78')],_0x1d7caf['value'][_0xfef0('0x79')],_0x1d7caf[_0xfef0('0x6c')][_0xfef0('0x36')]);}break;case _0xfef0('0x7a'):var _0x1e0ad5=_0x4a1316['value'][_0xfef0('0x42')](',')[_0xfef0('0x7b')](function(_0x2ccb33){return Number(_0x2ccb33);});_0x1e0ad5['forEach'](function(_0x117b74){_0x59d1b6['or'](_0xfef0('0x7c'),'%,'+_0x117b74+',%');});_0x58d95e=_[_0xfef0('0x7d')](_0x58d95e,_0x1e0ad5);break;case _0xfef0('0x7e'):if(_0x4a1316[_0xfef0('0x71')]===_0xfef0('0x72')){_0x45abb3[_0xd0255c](_0xfef0('0x7f'),'%'+_0x4a1316['value']+'%',null);}else{_0x3c5640=_[_0xfef0('0x6a')](_0x2af79f,[_0xfef0('0x38'),_0xfef0('0x80')]);_0x4a1316[_0xfef0('0x55')]=_0xfef0('0x80');_0x1d7caf=as[_0xfef0('0x81')](_0x3a12c5,_0x3c5640['type'],_0x4a1316);_0x45abb3[_0xd0255c](_0x1d7caf[_0xfef0('0x78')],_0x1d7caf[_0xfef0('0x6c')][_0xfef0('0x79')],_0x1d7caf[_0xfef0('0x6c')]['end']);}break;case _0xfef0('0x3b'):_0x1d7caf=as[_0xfef0('0x81')]('me',null,_0x4a1316);_0x45abb3[_0xd0255c](_0x1d7caf['text'],_0x1d7caf[_0xfef0('0x6c')][_0xfef0('0x79')],_0x1d7caf[_0xfef0('0x6c')][_0xfef0('0x36')]);break;}}else{var _0x1d7caf=as['buildExpression'](_0x3a12c5,_0x3c5640['type'],_0x4a1316);_0x45abb3[_0xd0255c](_0x1d7caf['text'],_0x1d7caf[_0xfef0('0x6c')][_0xfef0('0x79')],_0x1d7caf[_0xfef0('0x6c')]['end']);}}}else{var _0x24229e=_(_0x50e372['query'])['keys']()['map'](function(_0x2a92de){return _[_0xfef0('0x82')](_0x2af79f,['name',_0x2a92de])?_0x2a92de:undefined;})[_0xfef0('0x83')]()[_0xfef0('0x6c')]();if(!_[_0xfef0('0x84')](_0x24229e)){_0x24229e['forEach'](function(_0x3f2b55){if(_0x3f2b55==='ChatWebsiteId'){_0x3458b0['where'](_0xfef0('0x85'),[][_0xfef0('0x86')](_0x50e372[_0xfef0('0x4b')][_0x3f2b55]));}else if(_0x3f2b55===_0xfef0('0x87')){var _0x4df63b=JSON['parse'](_0x50e372['query'][_0x3f2b55])[_0xfef0('0x88')];var _0x546455=JSON[_0xfef0('0x89')](_0x50e372[_0xfef0('0x4b')][_0x3f2b55])[_0xfef0('0x8a')];_0x3458b0[_0xfef0('0x52')](_0xfef0('0x8b'),_0x4df63b,_0x546455);}else{if(_0x50e372['query'][_0x3f2b55]===_0xfef0('0x8c')){_0x3458b0['where']('i.'+_0x3f2b55+'\x20IS\x20NULL');}else{_0x3458b0[_0xfef0('0x52')]('i.'+_0x3f2b55+_0xfef0('0x8d'),_0x50e372[_0xfef0('0x4b')][_0x3f2b55]);}}});}if(_0x50e372[_0xfef0('0x4b')]['read']){if(_0x50e372['query'][_0xfef0('0x8e')]==0x1){_0x3458b0[_0xfef0('0x6d')]('`unreadMessages`\x20=\x200');}else{_0x3458b0[_0xfef0('0x6d')](_0xfef0('0x8f'));}}if(_0x50e372[_0xfef0('0x4b')][_0xfef0('0x90')]){_0x58d95e=_[_0xfef0('0x91')](_0x50e372[_0xfef0('0x4b')][_0xfef0('0x90')])?_0x50e372[_0xfef0('0x4b')][_0xfef0('0x90')]:new Array(_0x50e372[_0xfef0('0x4b')][_0xfef0('0x90')]);_0x58d95e[_0xfef0('0x43')](function(_0x3c1136){_0x59d1b6['or'](_0xfef0('0x7c'),'%,'+_0x3c1136+',%');});}if(_0x50e372[_0xfef0('0x4b')][_0xfef0('0x92')]){var _0x1a61e4=_0x50e372['query'][_0xfef0('0x92')][_0xfef0('0x93')]('\x5c','\x5c\x5c')[_0xfef0('0x93')](/'/g,'\x27\x27');if(qs[_0xfef0('0x94')](_0x1a61e4)){_0x45abb3['or'](_0xfef0('0x95'),_0x1a61e4+'%');}else{_0x45abb3['or'](_0xfef0('0x96'),qs[_0xfef0('0x74')](_0x1a61e4))['or'](_0xfef0('0x97'),_0x1a61e4+'%');}}}_0x3458b0[_0xfef0('0x52')](_0x45abb3);_0x3458b0[_0xfef0('0x98')](_0xfef0('0x99'));var _0x17c350={'type':db[_0xfef0('0x9a')]['QueryTypes'][_0xfef0('0x9b')],'raw':!![]};var _0x56af65=_0x3458b0['clone']();_0x56af65[_0xfef0('0x55')](_0xfef0('0x99'));_0x56af65['field'](_0xfef0('0x9c'),'unreadMessages');if(_0x18c656['order']){_0x18c656[_0xfef0('0x9d')][_0xfef0('0x43')](function(_0x4ebcf){var _0x437cb2=_0x4ebcf[0x0]==='contactName'?_0x4ebcf[0x0]:'i.'+_0x4ebcf[0x0];_0x3458b0[_0xfef0('0x9d')](_0x437cb2,_0x4ebcf[0x1]===_0xfef0('0x9e')?![]:!![]);});}if(!_['isEmpty'](_0x58d95e)){_0x3458b0[_0xfef0('0x6d')](_0x59d1b6);_0x56af65[_0xfef0('0x52')](_0xfef0('0x9f'),_0x58d95e);}BPromise['resolve']()['then'](function(){if(!_0x135653){if(_0x50e372[_0xfef0('0x4b')]['ChatWebsiteId'])return;_0x56af65['where'](_0xfef0('0xa0'));_0x3458b0['where'](_0xfef0('0xa0'));return;}if(_0x50e372[_0xfef0('0xa1')][_0xfef0('0xa2')]!==_0xfef0('0xa3'))return;return _0x50e372[_0xfef0('0xa1')][_0xfef0('0xa4')]({'attributes':['id'],'raw':!![]})[_0xfef0('0x22')](function(_0x28cc77){if(_[_0xfef0('0x84')](_0x28cc77)){_0x56af65[_0xfef0('0x52')]('i.ChatWebsiteId\x20IS\x20NULL');_0x3458b0[_0xfef0('0x52')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x56af65['where'](_0xfef0('0x85'),_['map'](_0x28cc77,'id'));_0x3458b0[_0xfef0('0x52')](_0xfef0('0x85'),_[_0xfef0('0x7b')](_0x28cc77,'id'));}});})[_0xfef0('0x22')](function(){if(_0x50e372[_0xfef0('0xa1')][_0xfef0('0xa2')]==='agent'&&!_0x135653&&!_0x50e372[_0xfef0('0x4b')][_0xfef0('0xa5')])return[];return db[_0xfef0('0xa6')][_0xfef0('0x4b')](_0x56af65[_0xfef0('0xa7')](),_0x17c350);})[_0xfef0('0x22')](function(_0x3cc27e){_0x5bf416[_0xfef0('0xa8')]=_0x3cc27e['length'];if(_0x5bf416[_0xfef0('0xa8')]===0x0)return[];return db[_0xfef0('0xa6')]['query'](_0x5e989f[_0xfef0('0xa7')](),_0x17c350)[_0xfef0('0x22')](function(_0x221b17){_0x20b647=_['keyBy'](_0x221b17,'id');_0x17c350=_[_0xfef0('0xa9')](_0x17c350,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x50e372[_0xfef0('0x4b')][_0xfef0('0x4f')]){_0x18c656['attributes'][_0xfef0('0x43')](function(_0x51f79b){_0x3458b0[_0xfef0('0x55')]('i.'+_0x51f79b);});}else{_0x3458b0[_0xfef0('0x55')](_0xfef0('0x9c'),_0xfef0('0x6b'));_0x3458b0[_0xfef0('0x55')](_0xfef0('0xaa'),_0xfef0('0xab'));_0x3458b0[_0xfef0('0x55')](_0xfef0('0xac'),_0xfef0('0xad'));_0x3458b0[_0xfef0('0x55')]('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',_0xfef0('0xae'));_0x3458b0['field']('i.*');_0x3458b0[_0xfef0('0x55')]('c.firstName',_0xfef0('0xaf'));_0x3458b0['field']('c.lastName',_0xfef0('0xb0'));_0x3458b0['field']('c.email','Contact.email');_0x3458b0[_0xfef0('0x55')](_0xfef0('0xb1'),_0xfef0('0xb2'));_0x3458b0[_0xfef0('0x55')]('c.mobile',_0xfef0('0xb3'));_0x3458b0[_0xfef0('0x55')](_0xfef0('0xb4'),_0xfef0('0xb5'));_0x3458b0[_0xfef0('0x55')]('o.fullname','Owner.fullname');_0x3458b0[_0xfef0('0x55')](_0xfef0('0xb6'),'Owner.internal');_0x3458b0[_0xfef0('0x55')](_0xfef0('0xb7'),_0xfef0('0x40'));}if(_0x18c656[_0xfef0('0x30')])_0x3458b0[_0xfef0('0x30')](_0x18c656[_0xfef0('0x30')]);if(_0x18c656[_0xfef0('0x2e')])_0x3458b0[_0xfef0('0x2e')](_0x18c656['offset']);return db['sequelize'][_0xfef0('0x4b')](_0x3458b0[_0xfef0('0xa7')](),_0x17c350);})[_0xfef0('0x22')](function(_0x475eb7){if(_0x475eb7[_0xfef0('0x69')]>0x0)_0x445f3f[_0xfef0('0x52')](_0xfef0('0xb8'),_[_0xfef0('0x7b')](_0x475eb7,'id'));return db['sequelize']['query'](_0x445f3f[_0xfef0('0xa7')](),_0x17c350)[_0xfef0('0x22')](function(_0x374877){var _0xd780bb=_[_0xfef0('0xb9')](_0x374877,_0xfef0('0xba'));var _0x5ac2df=[];_0x475eb7[_0xfef0('0x43')](function(_0x1060c2){_0x5ac2df['push'](updateChatInteraction(_0x1060c2,_0x20b647,_0xd780bb));});return BPromise[_0xfef0('0xbb')](_0x5ac2df);});});})[_0xfef0('0x22')](function(_0x36873f){_0x5bf416[_0xfef0('0xbc')]=_0x36873f;return _0x5bf416;})[_0xfef0('0x22')](respondWithFilteredResult(_0x4b6da1,_0x18c656))[_0xfef0('0x2a')](handleError(_0x4b6da1,null));};exports['show']=function(_0x4dd6e8,_0x1084b9){var _0xd7c5b={'raw':![],'where':{'id':_0x4dd6e8[_0xfef0('0xbd')]['id']}},_0xd2c0be={};_0xd2c0be[_0xfef0('0x4a')]=_[_0xfef0('0xbe')](db['ChatInteraction'][_0xfef0('0x47')]);_0xd2c0be['query']=_[_0xfef0('0xbe')](_0x4dd6e8['query']);_0xd2c0be[_0xfef0('0x4c')]=_[_0xfef0('0x4d')](_0xd2c0be['model'],_0xd2c0be[_0xfef0('0x4b')]);_0xd7c5b[_0xfef0('0x4e')]=_[_0xfef0('0x4d')](_0xd2c0be['model'],qs['fields'](_0x4dd6e8['query'][_0xfef0('0x4f')]));_0xd7c5b['attributes']=_0xd7c5b[_0xfef0('0x4e')][_0xfef0('0x69')]?_0xd7c5b['attributes']:_0xd2c0be[_0xfef0('0x4a')];if(_0x4dd6e8['query'][_0xfef0('0xbf')]){_0xd7c5b[_0xfef0('0xc0')]=[{'all':!![]}];}_0xd7c5b=_[_0xfef0('0xa9')]({},_0xd7c5b,_0x4dd6e8[_0xfef0('0xc1')]);return db[_0xfef0('0x46')][_0xfef0('0x6a')](_0xd7c5b)[_0xfef0('0x22')](handleEntityNotFound(_0x1084b9,null))['then'](respondWithResult(_0x1084b9,null))[_0xfef0('0x2a')](handleError(_0x1084b9,null));};exports[_0xfef0('0xc2')]=function(_0x38f96f,_0x1bdf18){return db[_0xfef0('0x46')][_0xfef0('0xc2')](_0x38f96f[_0xfef0('0x3b')],{})[_0xfef0('0x22')](respondWithResult(_0x1bdf18,0xc9))[_0xfef0('0x2a')](handleError(_0x1bdf18,null));};exports[_0xfef0('0x34')]=function(_0x2a25cb,_0x34f1db){if(_0x2a25cb[_0xfef0('0x3b')]['id']){delete _0x2a25cb[_0xfef0('0x3b')]['id'];}return db['ChatInteraction'][_0xfef0('0x6a')]({'where':{'id':_0x2a25cb[_0xfef0('0xbd')]['id']}})[_0xfef0('0x22')](handleEntityNotFound(_0x34f1db,null))[_0xfef0('0x22')](saveUpdates(_0x2a25cb[_0xfef0('0x3b')],null))[_0xfef0('0x22')](respondWithResult(_0x34f1db,null))[_0xfef0('0x2a')](handleError(_0x34f1db,null));};exports[_0xfef0('0x35')]=function(_0x191072,_0x5b5a15){return db['ChatInteraction'][_0xfef0('0x6a')]({'where':{'id':_0x191072['params']['id']}})[_0xfef0('0x22')](handleEntityNotFound(_0x5b5a15,null))[_0xfef0('0x22')](removeEntity(_0x5b5a15,null))[_0xfef0('0x2a')](handleError(_0x5b5a15,null));};exports[_0xfef0('0xc3')]=function(_0xd9c290,_0x365938){return db[_0xfef0('0x46')][_0xfef0('0xc3')]()[_0xfef0('0x22')](respondWithResult(_0x365938,null))[_0xfef0('0x2a')](handleError(_0x365938,null));};exports[_0xfef0('0xc4')]=function(_0x4c6ddd,_0x17ac08){var _0x40afcb=_0x4c6ddd['params']['id'];var _0xaa5902;var _0x189964;var _0x524db7;return db[_0xfef0('0x46')]['findOne']({'where':{'id':_0x40afcb}})[_0xfef0('0x22')](function(_0x41aadf){_0xaa5902=_0x41aadf;return db[_0xfef0('0xc5')][_0xfef0('0xc6')]({'where':{'id':_0x41aadf[_0xfef0('0xa5')]},'attributes':['id','vidaooApiKey',_0xfef0('0xc7'),_0xfef0('0xc8'),'vidaooNote',_0xfef0('0xc9')],'raw':!![]});})['then'](function(_0x3a180e){if(_0x3a180e&&_0x3a180e[_0xfef0('0xca')]&&_0x3a180e[_0xfef0('0xc7')]){_0x189964=_0x3a180e;var _0x52fb8b={'interaction':{'id':_0x40afcb},'agent':{'id':_0x4c6ddd[_0xfef0('0xa1')]['id'],'name':_0x4c6ddd['user']['name'],'fullname':_0x4c6ddd[_0xfef0('0xa1')]['fullname'],'email':_0x4c6ddd[_0xfef0('0xa1')][_0xfef0('0xcb')]},'contact':_0x4c6ddd[_0xfef0('0x3b')][_0xfef0('0x3c')],'account':_0x4c6ddd[_0xfef0('0x3b')][_0xfef0('0x3e')]};var _0x7f9b61={'rejectUnauthorized':![],'method':'POST','url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x3a180e[_0xfef0('0xca')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4c6ddd['user'][_0xfef0('0xcb')]],'buttons':null,'topic':_0x189964[_0xfef0('0xc8')],'note':_[_0xfef0('0xcc')](_0x189964[_0xfef0('0xcd')])?null:getMustacheRender(_0x189964[_0xfef0('0xcd')],_0x52fb8b),'metadata':null},'redirect':_0xfef0('0xce'),'json':!![]};try{if(!_[_0xfef0('0xcc')](_0x189964[_0xfef0('0xc9')])){var _0x4a3b68=getMustacheRender(_0x189964['vidaooMetadata'],_0x52fb8b);var _0x3c5471=JSON[_0xfef0('0x89')](_0x4a3b68);_0x7f9b61[_0xfef0('0x3b')][_0xfef0('0xcf')]=_0x3c5471;}}catch(_0xdbd7f2){throw new db['Sequelize']['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x7f9b61);}else{throw new db[(_0xfef0('0x9a'))][(_0xfef0('0xd0'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xfef0('0x22')](function(_0x4f171b){_0x524db7=_0x4f171b;if(_0x524db7['id']){var _0x236523={'body':_0x524db7[_0xfef0('0xd1')],'ChatWebsiteId':_0x189964['id'],'ChatInteractionId':_0xaa5902['id'],'direction':_0xfef0('0xd2'),'UserId':_0x4c6ddd[_0xfef0('0xa1')]['id']};return db[_0xfef0('0xd3')][_0xfef0('0xc2')](_0x236523,{});}else{throw new db[(_0xfef0('0x9a'))][(_0xfef0('0xd0'))](_0xfef0('0xd4'));}})[_0xfef0('0x22')](function(){return _0xaa5902[_0xfef0('0xd5')]({'vidaooSessionId':_0x524db7['id']});})['then'](respondWithResult(_0x17ac08,null))[_0xfef0('0x2a')](handleError(_0x17ac08,null));};exports['customUpdate']=function(_0xf763b1,_0x1fc6a0){if(_0xf763b1[_0xfef0('0x3b')]['id']){delete _0xf763b1[_0xfef0('0x3b')]['id'];}return db[_0xfef0('0x46')][_0xfef0('0x6a')]({'where':{'id':_0xf763b1[_0xfef0('0xbd')]['id']},'include':[{'model':db[_0xfef0('0xd6')],'as':_0xfef0('0x70')}]})['then'](handleEntityNotFound(_0x1fc6a0,null))['then'](saveUpdates(_0xf763b1[_0xfef0('0x3b')],null))['then'](respondWithResult(_0x1fc6a0,null))[_0xfef0('0x2a')](handleError(_0x1fc6a0,null));};exports[_0xfef0('0xd7')]=function(_0x45049d,_0x238112,_0x3a7c93){if(_0x45049d['body']['id']){delete _0x45049d[_0xfef0('0x3b')]['id'];}return db['ChatInteraction'][_0xfef0('0x6a')]({'where':{'id':_0x45049d[_0xfef0('0xbd')]['id']}})['then'](function(_0x34bcc3){if(!_0x34bcc3){logger['error'](_0xfef0('0xd8'),'abandon',0x194,'entity\x20not\x20found');_0x238112[_0xfef0('0x2b')](0x194);}else{if(_0x34bcc3['UserId']){throw new db[(_0xfef0('0x9a'))][(_0xfef0('0xd0'))](_0xfef0('0xd9'));}}return _0x34bcc3;})['then'](function(_0x5c7b35){if(_0x5c7b35){return _0x5c7b35[_0xfef0('0x34')]({'closed':_0x45049d[_0xfef0('0x3b')][_0xfef0('0xda')],'disposition':_0x45049d[_0xfef0('0x3b')][_0xfef0('0xdb')]})[_0xfef0('0x22')](function(_0x3107e2){return _0x3107e2;});}})[_0xfef0('0x22')](function(_0x325d36){return respondWithRpcPromise('AbandonInteraction',_0xfef0('0xd7'),_0x45049d[_0xfef0('0x3b')],client9004);})[_0xfef0('0x22')](respondWithResult(_0x238112,null))[_0xfef0('0x2a')](handleError(_0x238112,null));};exports[_0xfef0('0xdc')]=function(_0xb1df6f,_0x42604b,_0x5969d2){_0xb1df6f[_0xfef0('0x3b')][_0xfef0('0x38')]=_0xb1df6f['file'][_0xfef0('0xdd')];_0xb1df6f[_0xfef0('0x3b')][_0xfef0('0xde')]=_0xb1df6f[_0xfef0('0xdf')][_0xfef0('0xe0')];_0xb1df6f['body'][_0xfef0('0x77')]=_0xb1df6f['file'][_0xfef0('0xe1')];return db['Attachment']['create'](_0xb1df6f['body'])[_0xfef0('0x22')](respondWithResult(_0x42604b,0xc9))['catch'](handleError(_0x42604b,null));};exports['attachmentDownload']=function(_0x25fed0,_0x43453b,_0x4da5b0){return db[_0xfef0('0x46')][_0xfef0('0xc6')]({'where':{'id':_0x25fed0[_0xfef0('0xbd')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x43453b,null))['then'](function(_0x39a2a7){if(_0x39a2a7){if(_0x39a2a7[_0xfef0('0xda')]){return _0x43453b[_0xfef0('0x2c')](0x193)[_0xfef0('0x2d')]({'status':0x193,'message':_0xfef0('0xe2')});}return db[_0xfef0('0xe3')][_0xfef0('0xc6')]({'where':{'id':_0x25fed0['query'][_0xfef0('0xe4')]},'raw':!![]})[_0xfef0('0x22')](handleEntityNotFound(_0x43453b,null));}})[_0xfef0('0x22')](function(_0x4544fe){if(_0x4544fe){var _0x5c0f32=_0x4544fe['ChatOfflineMessageId']!==null;var _0x461c91=path[_0xfef0('0xe5')](config[_0xfef0('0xe6')],_0xfef0('0xe7'));if(_0x5c0f32){_0x461c91=path[_0xfef0('0xe5')](_0x461c91,_0xfef0('0xe8'));}var _0xe24c2d=path['join'](_0x461c91,_0x4544fe['basename']);return _0x43453b['download'](_0xe24c2d);}})[_0xfef0('0x2a')](handleError(_0x43453b,null));};exports['close']=function(_0x38ac84,_0x4a1406){var _0x2daf2a=null;var _0x4f703e=null;var _0x20cf67=null;var _0x235122=null;if(_0x38ac84[_0xfef0('0x3b')]['id']){delete _0x38ac84[_0xfef0('0x3b')]['id'];}if(_0x38ac84[_0xfef0('0x3b')]['mailTranscript']){_0x235122=path[_0xfef0('0xe5')](config[_0xfef0('0xe6')],_0xfef0('0xe9'),util[_0xfef0('0xea')]('transcript-%s.txt',Date[_0xfef0('0xeb')]()));_0x38ac84['body']['pathTranscript']=_0x235122;}return db[_0xfef0('0x46')]['find']({'where':{'id':_0x38ac84['params']['id']},'include':[{'model':db[_0xfef0('0xd3')],'as':'Messages','include':[{'model':db[_0xfef0('0x7e')],'as':_0xfef0('0x7e')}]}]})[_0xfef0('0x22')](handleEntityNotFound(_0x4a1406,null))[_0xfef0('0x22')](saveUpdates(_0x38ac84[_0xfef0('0x3b')],null))[_0xfef0('0x22')](function(_0x4f6c50){if(_0x4f6c50){_0x2daf2a=_0x4f6c50;return db[_0xfef0('0xc5')][_0xfef0('0x6a')]({'where':{'id':_0x2daf2a[_0xfef0('0xa5')]}});}})['then'](function(_0x3ac462){if(_0x3ac462){_0x20cf67=_0x3ac462;return db['CmContact'][_0xfef0('0x6a')]({'where':{'id':_0x2daf2a[_0xfef0('0x76')]}});}})[_0xfef0('0x22')](function(_0x5ef687){if(_0x5ef687){_0x4f703e=_0x5ef687;if(_0x235122){var _0x906e55=null;for(var _0x4cec7d=0x1;_0x4cec7d<_0x2daf2a['Messages'][_0xfef0('0x69')];++_0x4cec7d){_0x906e55=_0x2daf2a[_0xfef0('0xec')][_0x4cec7d];var _0x58a4ef=_0x906e55[_0xfef0('0x80')]?util[_0xfef0('0xea')](_0xfef0('0xed'),_0x20cf67[_0xfef0('0xee')],_0x906e55['UserId']):_0xfef0('0xef');var _0x484cc3=_0x38ac84[_0xfef0('0x3b')][_0xfef0('0xf0')]||util[_0xfef0('0xea')](_0xfef0('0xed'),_0xfef0('0xf1'),_0x906e55[_0xfef0('0x76')]);switch(_0x20cf67[_0xfef0('0xf2')]){case _0xfef0('0xf3'):_0x58a4ef=_0x906e55[_0xfef0('0x80')]?util['format'](_0xfef0('0xed'),_0x20cf67[_0xfef0('0xee')],_0x906e55['UserId']):_0xfef0('0xef');break;case'agent_alias':_0x58a4ef=_0x906e55[_0xfef0('0x80')]?_0x906e55[_0xfef0('0x7e')][_0xfef0('0xf4')]||_0x906e55[_0xfef0('0x7e')][_0xfef0('0xf5')]:'System';break;case _0xfef0('0xf6'):_0x58a4ef=_0x906e55[_0xfef0('0x80')]?_0x906e55[_0xfef0('0x7e')]['fullname']:'System';break;default:_0x58a4ef=_0x906e55[_0xfef0('0x80')]?util[_0xfef0('0xea')](_0xfef0('0xed'),_0x20cf67[_0xfef0('0xee')],_0x906e55['UserId']):_0xfef0('0xef');}var _0x4b4986=util[_0xfef0('0xea')](_0xfef0('0xf7'),moment(_0x906e55[_0xfef0('0x87')])[_0xfef0('0xea')](_0xfef0('0xf8')),_0x906e55['direction']==='in'?_0x484cc3:_0x58a4ef,_0x906e55[_0xfef0('0x3b')]);if(!_0x906e55[_0xfef0('0xf9')]){fs[_0xfef0('0xfa')](_0x235122,_0x4b4986);}}return db[_0xfef0('0xfb')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xfef0('0xfc')],'as':'Smtp','raw':!![]}]});}}})[_0xfef0('0x22')](function(_0x402c7d){if(_0x402c7d&&_0x402c7d[_0xfef0('0xfd')]&&_0x38ac84[_0xfef0('0x3b')]){var _0x5315eb={'tls':{'rejectUnauthorized':![]}};if(_0x402c7d['Smtp'][_0xfef0('0xfe')]){_0x5315eb[_0xfef0('0xfe')]=_0x402c7d[_0xfef0('0xfd')][_0xfef0('0xfe')];}else{_0x5315eb[_0xfef0('0xff')]=_0x402c7d[_0xfef0('0xfd')][_0xfef0('0xff')];_0x5315eb['port']=_0x402c7d['Smtp'][_0xfef0('0x100')];_0x5315eb[_0xfef0('0x101')]=_0x402c7d['Smtp'][_0xfef0('0x101')];}if(_0x402c7d['Smtp']['authentication']){_0x5315eb[_0xfef0('0x102')]={'user':_0x402c7d[_0xfef0('0xfd')][_0xfef0('0xa1')],'pass':_0x402c7d[_0xfef0('0xfd')][_0xfef0('0x103')]};}return respondWithRpcPromise('SendMail',_0xfef0('0x104'),{'account':_0x5315eb,'message':{'from':util[_0xfef0('0xea')](_0xfef0('0x105'),_0x402c7d[_0xfef0('0x38')],_0x402c7d['email']||_0x402c7d['Smtp']['user']),'to':_0x38ac84[_0xfef0('0x3b')]['mailTranscript'],'subject':_0xfef0('0x106'),'text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x38ac84['body'][_0xfef0('0x107')]),'attachments':[{'path':_0x235122}]}})[_0xfef0('0x22')](function(){return _0x2daf2a;})['catch'](function(_0x411870){console['error'](_0x411870);});}else{return _0x2daf2a;}})[_0xfef0('0x22')](respondWithStatusCode(_0x4a1406,0xc8))[_0xfef0('0x2a')](handleError(_0x4a1406,null));};exports[_0xfef0('0x108')]=function(_0x9b2969,_0x1f842f,_0x36c978){return db[_0xfef0('0xd3')][_0xfef0('0x6a')]({'where':{'id':_0x9b2969[_0xfef0('0xbd')]['id']}})[_0xfef0('0x22')](handleEntityNotFound(_0x1f842f,null))['then'](function(_0x1d342a){if(_0x1d342a){return _0x1d342a[_0xfef0('0x108')](_0x9b2969['body'][_0xfef0('0x109')],_['omit'](_0x9b2969[_0xfef0('0x3b')],[_0xfef0('0x109'),'id'])||{});}})[_0xfef0('0x22')](respondWithResult(_0x1f842f,null))[_0xfef0('0x2a')](handleError(_0x1f842f,null));};exports[_0xfef0('0x10a')]=function(_0x422af1,_0xcb9eb8,_0x38e829){var _0x287403={'raw':![],'where':{}};var _0x2ebd8d={};var _0x115454={'count':0x0,'rows':[]};return db[_0xfef0('0x46')][_0xfef0('0xc6')]({'where':{'id':_0x422af1[_0xfef0('0xbd')]['id']}})['then'](handleEntityNotFound(_0xcb9eb8,null))[_0xfef0('0x22')](function(_0x5593de){if(_0x5593de){_0x2ebd8d['model']=_[_0xfef0('0xbe')](db['ChatMessage'][_0xfef0('0x47')]);_0x2ebd8d[_0xfef0('0x4b')]=_[_0xfef0('0xbe')](_0x422af1['query']);_0x2ebd8d[_0xfef0('0x4c')]=_[_0xfef0('0x4d')](_0x2ebd8d[_0xfef0('0x4a')],_0x2ebd8d[_0xfef0('0x4b')]);_0x287403[_0xfef0('0x4e')]=_[_0xfef0('0x4d')](_0x2ebd8d[_0xfef0('0x4a')],qs[_0xfef0('0x4f')](_0x422af1[_0xfef0('0x4b')][_0xfef0('0x4f')]));_0x287403[_0xfef0('0x4e')]=_0x287403[_0xfef0('0x4e')][_0xfef0('0x69')]?_0x287403[_0xfef0('0x4e')]:_0x2ebd8d['model'];if(!_0x422af1[_0xfef0('0x4b')]['hasOwnProperty'](_0xfef0('0x50'))){_0x287403['limit']=qs[_0xfef0('0x30')](_0x422af1[_0xfef0('0x4b')][_0xfef0('0x30')]);_0x287403[_0xfef0('0x2e')]=qs[_0xfef0('0x2e')](_0x422af1['query']['offset']);}_0x287403[_0xfef0('0x9d')]=qs[_0xfef0('0x51')](_0x422af1['query'][_0xfef0('0x51')]);_0x287403[_0xfef0('0x52')]=qs[_0xfef0('0x4c')](_[_0xfef0('0x53')](_0x422af1[_0xfef0('0x4b')],_0x2ebd8d[_0xfef0('0x4c')]));_0x287403[_0xfef0('0x52')][_0xfef0('0xba')]=_0x5593de['id'];if(_0x422af1['query'][_0xfef0('0x92')]){_0x287403[_0xfef0('0x52')]=_['merge'](_0x287403[_0xfef0('0x52')],{'$or':_['map'](_0x287403[_0xfef0('0x4e')],function(_0x41790c){var _0x189965={};_0x189965[_0x41790c]={'$like':'%'+_0x422af1[_0xfef0('0x4b')][_0xfef0('0x92')]+'%'};return _0x189965;})});}if(_0x422af1[_0xfef0('0x4b')][_0xfef0('0x88')]){var _0x5b1b34=_0x422af1[_0xfef0('0x4b')][_0xfef0('0x88')]['split'](',');var _0xfa83e1={};_0xfa83e1[_0x5b1b34[0x0]]={'$gte':moment(_0x5b1b34[0x1])[_0xfef0('0xea')](_0xfef0('0x10b'))};_0x287403['where']=_[_0xfef0('0xa9')](_0x287403[_0xfef0('0x52')],_0xfa83e1);}_0x287403=_[_0xfef0('0xa9')]({},_0x287403,_0x422af1[_0xfef0('0xc1')]);return db[_0xfef0('0xd3')][_0xfef0('0xa8')]({'where':_0x287403[_0xfef0('0x52')]})[_0xfef0('0x22')](function(_0x464d00){_0x115454[_0xfef0('0xa8')]=_0x464d00;if(_0x422af1['query'][_0xfef0('0xbf')]){_0x287403[_0xfef0('0xc0')]=[{'all':!![]}];}return db[_0xfef0('0xd3')][_0xfef0('0x10c')](_0x287403);})[_0xfef0('0x22')](function(_0x1b23f0){_0x115454['rows']=_0x1b23f0;return _0x115454;});}})['then'](respondWithFilteredResult(_0xcb9eb8,_0x287403))[_0xfef0('0x2a')](handleError(_0xcb9eb8,null));};exports['getMyMessages']=function(_0x30f7d5,_0x1a53fa,_0x14a37e){var _0x303128={'where':{}},_0x2b3263={},_0x43e758={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xfef0('0xc6')]({'where':{'id':_0x30f7d5[_0xfef0('0xbd')]['id']}})[_0xfef0('0x22')](handleEntityNotFound(_0x1a53fa,null))[_0xfef0('0x22')](function(_0x273e8b){if(_0x273e8b){_0x2b3263[_0xfef0('0x4a')]=_[_0xfef0('0xbe')](db['ChatMessage'][_0xfef0('0x47')]);_0x2b3263[_0xfef0('0x4b')]=_[_0xfef0('0xbe')](_0x30f7d5[_0xfef0('0x4b')]);_0x2b3263[_0xfef0('0x4c')]=_[_0xfef0('0x4d')](_0x2b3263['model'],_0x2b3263['query']);_0x303128[_0xfef0('0x4e')]=_[_0xfef0('0x4d')](_0x2b3263[_0xfef0('0x4a')],qs[_0xfef0('0x4f')](_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0x4f')]));_0x303128[_0xfef0('0x4e')]=_0x303128[_0xfef0('0x4e')][_0xfef0('0x69')]?_0x303128[_0xfef0('0x4e')]:_0x2b3263[_0xfef0('0x4a')];if(!_0x30f7d5['query'][_0xfef0('0x10d')](_0xfef0('0x50'))){_0x303128[_0xfef0('0x30')]=qs[_0xfef0('0x30')](_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0x30')]);_0x303128['offset']=qs[_0xfef0('0x2e')](_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0x2e')]);}_0x303128[_0xfef0('0x9d')]=qs['sort'](_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0x51')]);_0x303128['where']=qs[_0xfef0('0x4c')](_[_0xfef0('0x53')](_0x30f7d5[_0xfef0('0x4b')],_0x2b3263[_0xfef0('0x4c')]));_0x303128[_0xfef0('0x52')][_0xfef0('0xba')]=_0x273e8b['id'];if(_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0x92')]){_0x303128['where']=_[_0xfef0('0xa9')](_0x303128[_0xfef0('0x52')],{'$or':_['map'](_0x303128['attributes'],function(_0x3081e){var _0xd34b68={};_0xd34b68[_0x3081e]={'$like':'%'+_0x30f7d5[_0xfef0('0x4b')]['filter']+'%'};return _0xd34b68;})});}_0x303128[_0xfef0('0x52')][_0xfef0('0xf9')]=![];if(_0x30f7d5['query']['id']){_0x303128[_0xfef0('0x52')]['id']={'$gt':_0x30f7d5[_0xfef0('0x4b')]['id']};}_0x303128=_[_0xfef0('0xa9')]({},_0x303128,_0x30f7d5[_0xfef0('0xc1')]);return db[_0xfef0('0xd3')]['count']({'where':_0x303128[_0xfef0('0x52')]})['then'](function(_0x63bcae){_0x43e758['count']=_0x63bcae;_0x303128[_0xfef0('0xc0')]=[];if(_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0x10e')]){_0x303128['include'][_0xfef0('0x44')]({'model':db[_0xfef0('0x7e')],'as':'User','attributes':['id','fullname',_0xfef0('0xf4')]});}if(_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0xbf')]){_0x303128['include']=[{'all':!![]}];}return db[_0xfef0('0xd3')][_0xfef0('0x10c')](_0x303128);})['then'](function(_0x527d0d){_0x43e758[_0xfef0('0xbc')]=_0x527d0d;return _0x43e758;});}})[_0xfef0('0x22')](respondWithFilteredResult(_0x1a53fa,_0x303128))['catch'](handleError(_0x1a53fa,null));};exports[_0xfef0('0x10f')]=function(_0x3f68ed,_0x45a5e8,_0x33cecb){return db[_0xfef0('0x46')][_0xfef0('0x6a')]({'where':{'id':_0x3f68ed[_0xfef0('0xbd')]['id']}})[_0xfef0('0x22')](handleEntityNotFound(_0x45a5e8,null))[_0xfef0('0x22')](function(_0x53ce05){if(_0x53ce05){return _0x53ce05[_0xfef0('0x110')](_0x3f68ed[_0xfef0('0x3b')][_0xfef0('0x109')],_[_0xfef0('0x111')](_0x3f68ed[_0xfef0('0x3b')],[_0xfef0('0x109'),'id'])||{})['spread'](function(){return db[_0xfef0('0x7a')][_0xfef0('0x10c')]({'attributes':['id','name','color'],'where':{'id':_0x3f68ed[_0xfef0('0x3b')][_0xfef0('0x109')]}});})[_0xfef0('0x22')](function(_0x4697ee){socket[_0xfef0('0x112')]('chatInteractionTags:save',{'id':Number(_0x3f68ed[_0xfef0('0xbd')]['id']),'tags':_0x4697ee||[]});return{'id':Number(_0x3f68ed[_0xfef0('0xbd')]['id']),'tags':_0x4697ee||[]};});}})[_0xfef0('0x22')](respondWithResult(_0x45a5e8,null))['catch'](handleError(_0x45a5e8,null));};exports[_0xfef0('0x113')]=function(_0x2a229b,_0xcb6d50,_0x53ed7e){return db['ChatInteraction'][_0xfef0('0x6a')]({'where':{'id':_0x2a229b[_0xfef0('0xbd')]['id']}})[_0xfef0('0x22')](handleEntityNotFound(_0xcb6d50,null))['then'](function(_0x241763){if(_0x241763){return _0x241763[_0xfef0('0x113')](_0x2a229b['query'][_0xfef0('0x109')]);}})[_0xfef0('0x22')](respondWithStatusCode(_0xcb6d50,null))['catch'](handleError(_0xcb6d50,null));};exports[_0xfef0('0x114')]=function(_0x57e2d8,_0x3fdeae){var _0x30b0a9=moment()[_0xfef0('0x115')]()['toString']();var _0x416d36=path[_0xfef0('0xe5')](config['root'],_0xfef0('0x116'),_0xfef0('0x117'),_0xfef0('0x118'));var _0x50b3d7=path[_0xfef0('0xe5')](config[_0xfef0('0xe6')],_0xfef0('0x116'),_0xfef0('0x117'),_0xfef0('0x119'));var _0x2a9a1e=path[_0xfef0('0xe5')](_0x416d36,_0x30b0a9);var _0x584c9b=util[_0xfef0('0xea')](_0xfef0('0x11a'),_0x57e2d8[_0xfef0('0xbd')]['id'],_0x30b0a9);var _0x4f4c4e=path[_0xfef0('0xe5')](_0x416d36,_0x584c9b);var _0x1c6ab9=[];_0x1c6ab9[_0xfef0('0x44')]({'model':db[_0xfef0('0x7e')],'as':_0xfef0('0x7e'),'attributes':['id',_0xfef0('0xf5')],'raw':!![]});_0x1c6ab9['push']({'model':db[_0xfef0('0xd6')],'as':'Contact','attributes':['id',_0xfef0('0x11b'),_0xfef0('0x11c')],'raw':!![]});if(_0x57e2d8[_0xfef0('0x4b')][_0xfef0('0x119')]){_0x1c6ab9[_0xfef0('0x44')]({'model':db[_0xfef0('0xe3')],'as':'Attachment','raw':!![]});}var _0x937d8e=[{'model':db[_0xfef0('0xd3')],'as':_0xfef0('0xec'),'attributes':['id',_0xfef0('0x3b'),'createdAt',_0xfef0('0x11d'),_0xfef0('0xf9'),'read'],'include':_0x1c6ab9}];_0x937d8e['push']({'model':db[_0xfef0('0xc5')],'as':_0xfef0('0x11e'),'attributes':['id',_0xfef0('0x38')]});_0x937d8e[_0xfef0('0x44')]({'model':db['User'],'as':'Owner','attributes':['id',_0xfef0('0xf5')]});return db[_0xfef0('0x46')][_0xfef0('0x6a')]({'where':{'id':_0x57e2d8[_0xfef0('0xbd')]['id']},'include':_0x937d8e})[_0xfef0('0x22')](handleEntityNotFound(_0x3fdeae,null))['then'](function(_0x2978cc){if(_0x2978cc){var _0x81bcee=_0x2978cc['get']({'plain':!![]});fs[_0xfef0('0x11f')](_0x2a9a1e);var _0xc8d0ca={'channel':_0xfef0('0x120'),'account':_0x81bcee[_0xfef0('0x11e')][_0xfef0('0x38')],'agent':_0x81bcee[_0xfef0('0x121')]?_0x81bcee['Owner']['fullname']:_0xfef0('0x122'),'createdAt':moment(_0x81bcee[_0xfef0('0x87')])[_0xfef0('0xea')](_0xfef0('0x10b'))['toString'](),'closedAt':_0x81bcee['closed']?moment(_0x81bcee['closedAt'])[_0xfef0('0xea')](_0xfef0('0x10b'))[_0xfef0('0xa7')]():'','disposition':_0x81bcee[_0xfef0('0xdb')],'chatInfo':{'browser':_0x81bcee[_0xfef0('0x123')],'os':_0x81bcee[_0xfef0('0x124')],'referer':_0x81bcee['referer'],'customerIp':_0x81bcee['customerIp'],'customerPort':_0x81bcee['customerPort']?_0x81bcee['customerPort']:'N.A.'},'messages':_(_0x81bcee[_0xfef0('0xec')])['tail']()[_0xfef0('0x92')]({'secret':![]})[_0xfef0('0x7b')](function(_0x46ab62){if(_0x46ab62[_0xfef0('0xe3')]){var _0x3507a8=path['join'](_0x50b3d7,_0x46ab62[_0xfef0('0xe3')][_0xfef0('0xde')]);if(fs[_0xfef0('0x125')](_0x3507a8)){fs['createReadStream'](_0x3507a8)[_0xfef0('0x126')](fs[_0xfef0('0x127')](path[_0xfef0('0xe5')](_0x2a9a1e,_0x46ab62[_0xfef0('0xe3')][_0xfef0('0xde')])));}}return{'date':moment(_0x46ab62[_0xfef0('0x87')])[_0xfef0('0xea')](_0xfef0('0x10b'))[_0xfef0('0xa7')](),'sender':_0x46ab62[_0xfef0('0x11d')]===_0xfef0('0xd2')?_0x46ab62[_0xfef0('0x7e')]?_0x46ab62[_0xfef0('0x7e')][_0xfef0('0xf5')]:_0xfef0('0xef'):_0x46ab62[_0xfef0('0x70')][_0xfef0('0x11b')]+(_0x46ab62[_0xfef0('0x70')][_0xfef0('0x11c')]?'\x20'+_0x46ab62[_0xfef0('0x70')]['lastName']:''),'body':_0x46ab62['Attachment']?_0x46ab62['Attachment']['basename']:_0x46ab62[_0xfef0('0x3b')],'direction':_0x46ab62[_0xfef0('0x11d')]===_0xfef0('0xd2')?'A':'C','secret':_0x46ab62['secret'],'read':_0x46ab62[_0xfef0('0x8e')],'attachment':_0x46ab62[_0xfef0('0xe3')]};})[_0xfef0('0x6c')]()};return ejs[_0xfef0('0x128')](path['join'](config['root'],'server',_0xfef0('0x129'),_0xfef0('0x12a')),{'interaction':_0xc8d0ca})[_0xfef0('0x22')](function(_0x2b1f64){var _0x55ecff=path[_0xfef0('0xe5')](_0x2a9a1e,_0xfef0('0x12b')+_0x81bcee['id']+'-'+_0x30b0a9+'.pdf');var _0x409147={'path':_0x55ecff,'channel':_0xfef0('0x120'),'interactionId':_0x81bcee['id']};return pdf[_0xfef0('0x12c')](_0x2b1f64,_0x409147);})[_0xfef0('0x22')](function(){return new BPromise(function(_0x27856d,_0x44081d){zipdir(_0x2a9a1e,{'saveTo':_0x4f4c4e},function(_0x177c9b,_0x322672){if(_0x177c9b)return _0x44081d(_0x177c9b);return _0x27856d(_0x322672);});})[_0xfef0('0x22')](function(){return new BPromise(function(_0x102b4e,_0x2a206b){rimraf(_0x2a9a1e,function(_0x279f5b){if(_0x279f5b)_0x2a206b(_0x279f5b);return _0x102b4e();});});})[_0xfef0('0x22')](function(){return _0x3fdeae[_0xfef0('0x114')](_0x4f4c4e,_0x584c9b,function(_0x44603e){if(_0x44603e){console['log'](_0xfef0('0x12d'),_0x44603e);}else{fs['unlinkSync'](_0x4f4c4e);}});});});}else{return _0x3fdeae[_0xfef0('0x2b')](0xc8);}})['catch'](handleError(_0x3fdeae,null));}; \ No newline at end of file +var _0xb10b=['querystring','papaparse','ioredis','../../components/auth/service','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','offset','undefined','count','Content-Range','json','apply','reject','update','stack','name','send','body','contact','interaction','account','Users','map','fullname','TagIds','Tags','forEach','push','index','ChatInteraction','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','select','field','color','tools_tags','u.id','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','unreadMessages','value','having','`\x20>\x200','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','UserId','buildExpression','some','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','isEmpty','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','catch','show','params','keys','includeAll','include','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooNote','email','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','isNull','follow','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','file','filename','mimetype','attachmentDownload','closed','Unauthorized','Attachment','attachId','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','basename','close','mailTranscript','root','now','Messages','format','%s%d','System','customer','Visitor','agentIdentifier','website_alias','agentAlias','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','sendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','ids','omit','getMessages','split','YYYY-MM-DD\x20HH:mm:ss','includeAgent','alias','findAll','setTags','chatInteractionTags:save','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','Contact','firstName','lastName','Account','Owner','get','mkdirSync','Chat','N.A.','disposition','osName','referer','customerPort','tail','existsSync','pipe','createWriteStream','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0xb10b,0x12a));var _0xbb10=function(_0x35485a,_0x91cdd4){_0x35485a=_0x35485a-0x0;var _0x5148e6=_0xb10b[_0x35485a];return _0x5148e6;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var jsonpatch=require(_0xbb10('0x2'));var rp=require(_0xbb10('0x3'));var moment=require('moment');var BPromise=require(_0xbb10('0x4'));var Mustache=require(_0xbb10('0x5'));var util=require(_0xbb10('0x6'));var path=require(_0xbb10('0x7'));var sox=require(_0xbb10('0x8'));var csv=require(_0xbb10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb10('0xa'));var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0x9'));var querystring=require(_0xbb10('0xf'));var Papa=require(_0xbb10('0x10'));var Redis=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xbb10('0x13'));var hardwareService=require(_0xbb10('0x14'));var logger=require(_0xbb10('0x15'))('api');var utils=require(_0xbb10('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xbb10('0x17'));var db=require(_0xbb10('0x18'))['db'];config[_0xbb10('0x19')]=_[_0xbb10('0x1a')](config[_0xbb10('0x19')],{'host':_0xbb10('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbb10('0x19')]));require(_0xbb10('0x1c'))[_0xbb10('0x1d')](socket);var jayson=require(_0xbb10('0x1e'));var client=jayson[_0xbb10('0x1f')][_0xbb10('0x20')]({'port':0x232b});var client9004=jayson[_0xbb10('0x1f')][_0xbb10('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x3e26f4,_0x2b184e,_0x4a2bfc,_0x2eca0f){return new BPromise(function(_0x1145f1,_0x133ac2){var _0x42db98=_0x2eca0f||client;return _0x42db98[_0xbb10('0x21')](_0x3e26f4,_0x4a2bfc)[_0xbb10('0x22')](function(_0x575cca){logger[_0xbb10('0x23')](_0xbb10('0x24'),_0x2b184e,_0xbb10('0x25'));logger['debug'](_0xbb10('0x26'),_0x2b184e,_0xbb10('0x25'),JSON[_0xbb10('0x27')](_0x575cca));if(_0x575cca[_0xbb10('0x28')]){if(_0x575cca[_0xbb10('0x28')][_0xbb10('0x29')]===0x1f4){logger['error'](_0xbb10('0x24'),_0x2b184e,_0x575cca[_0xbb10('0x28')]['message']);return _0x133ac2(_0x575cca['error'][_0xbb10('0x2a')]);}logger[_0xbb10('0x28')](_0xbb10('0x24'),_0x2b184e,_0x575cca[_0xbb10('0x28')][_0xbb10('0x2a')]);return _0x1145f1(_0x575cca[_0xbb10('0x28')][_0xbb10('0x2a')]);}else{logger[_0xbb10('0x23')](_0xbb10('0x24'),_0x2b184e,_0xbb10('0x25'));_0x1145f1(_0x575cca[_0xbb10('0x2b')][_0xbb10('0x2a')]);}})['catch'](function(_0x4fedac){logger['error'](_0xbb10('0x24'),_0x2b184e,_0x4fedac);_0x133ac2(_0x4fedac);});});}function respondWithStatusCode(_0x3c5ae7,_0x2c89b9){_0x2c89b9=_0x2c89b9||0xcc;return function(_0x4e25ff){if(_0x4e25ff){return _0x3c5ae7[_0xbb10('0x2c')](_0x2c89b9);}return _0x3c5ae7[_0xbb10('0x2d')](_0x2c89b9)[_0xbb10('0x2e')]();};}function respondWithResult(_0x1d5e95,_0x1acce9){_0x1acce9=_0x1acce9||0xc8;return function(_0x20d946){if(_0x20d946){return _0x1d5e95[_0xbb10('0x2d')](_0x1acce9)['json'](_0x20d946);}};}function respondWithFilteredResult(_0x3796c7,_0x21ac54){return function(_0xfc3595){if(_0xfc3595){var _0x2e0249=typeof _0x21ac54[_0xbb10('0x2f')]===_0xbb10('0x30')&&typeof _0x21ac54['limit']===_0xbb10('0x30');var _0x4ee02e=_0xfc3595[_0xbb10('0x31')];var _0x56f2da=_0x2e0249?0x0:_0x21ac54[_0xbb10('0x2f')];var _0x1dcc9c=_0x2e0249?_0xfc3595[_0xbb10('0x31')]:_0x21ac54['offset']+_0x21ac54['limit'];var _0x4c3744;if(_0x1dcc9c>=_0x4ee02e){_0x1dcc9c=_0x4ee02e;_0x4c3744=0xc8;}else{_0x4c3744=0xce;}_0x3796c7[_0xbb10('0x2d')](_0x4c3744);return _0x3796c7['set'](_0xbb10('0x32'),_0x56f2da+'-'+_0x1dcc9c+'/'+_0x4ee02e)[_0xbb10('0x33')](_0xfc3595);}return null;};}function patchUpdates(_0x2f653f){return function(_0x1c0b57){try{jsonpatch[_0xbb10('0x34')](_0x1c0b57,_0x2f653f,!![]);}catch(_0x138bc6){return BPromise[_0xbb10('0x35')](_0x138bc6);}return _0x1c0b57['save']();};}function saveUpdates(_0x25acb3,_0x1da9c9){return function(_0x441d15){if(_0x441d15){return _0x441d15[_0xbb10('0x36')](_0x25acb3)[_0xbb10('0x22')](function(_0x9de708){return _0x9de708;});}return null;};}function removeEntity(_0x188cbd,_0x10202c){return function(_0x3c8d7d){if(_0x3c8d7d){return _0x3c8d7d['destroy']()[_0xbb10('0x22')](function(){_0x188cbd[_0xbb10('0x2d')](0xcc)[_0xbb10('0x2e')]();});}};}function handleEntityNotFound(_0x3c3c45,_0x570f5a){return function(_0x111762){if(!_0x111762){_0x3c3c45['sendStatus'](0x194);}return _0x111762;};}function handleError(_0x4e2754,_0x3eb3cc){_0x3eb3cc=_0x3eb3cc||0x1f4;return function(_0x40c164){logger[_0xbb10('0x28')](_0x40c164[_0xbb10('0x37')]);if(_0x40c164[_0xbb10('0x38')]){delete _0x40c164[_0xbb10('0x38')];}_0x4e2754['status'](_0x3eb3cc)[_0xbb10('0x39')](_0x40c164);};}function getMustacheRender(_0x25d72f,_0x52de31){return Mustache['render'](_0x25d72f,_['merge'](_0x52de31[_0xbb10('0x3a')],{'contact':_0x52de31[_0xbb10('0x3b')],'message':_0x52de31[_0xbb10('0x2a')],'agent':_0x52de31['agent'],'interaction':_0x52de31[_0xbb10('0x3c')],'account':_0x52de31[_0xbb10('0x3d')]}))||'';}function getInteractionUsers(_0x4345f3,_0x4d1a83){return new BPromise(function(_0x17b6c5,_0x12238a){try{if(_0x4d1a83[_0x4345f3['id']]){_0x4345f3[_0xbb10('0x3e')]=_[_0xbb10('0x3f')](_0x4d1a83[_0x4345f3['id']],function(_0x4f1cdd){return{'id':_0x4f1cdd['id'],'fullname':_0x4f1cdd[_0xbb10('0x40')]};});}}catch(_0x110eb5){_0x12238a(_0x110eb5);}_0x17b6c5(_0x4345f3);});}function getInteractionTags(_0x5835fd,_0xe2040f){return new BPromise(function(_0x2e3214,_0x44d6ae){try{if(_0x5835fd[_0xbb10('0x41')]){_0x5835fd[_0xbb10('0x42')]=[];_0x5835fd[_0xbb10('0x41')]['split'](',')[_0xbb10('0x43')](function(_0x1c7fae){_0x5835fd[_0xbb10('0x42')][_0xbb10('0x44')](_0xe2040f[_0x1c7fae]);});}delete _0x5835fd['TagIds'];}catch(_0x3fff6c){_0x44d6ae(_0x3fff6c);}_0x2e3214(_0x5835fd);});}function updateChatInteraction(_0x331751,_0x23dc18,_0x403beb){return new BPromise(function(_0x5e2cfa,_0x351484){return getInteractionUsers(_0x331751,_0x403beb)[_0xbb10('0x22')](function(_0x54ac18){return getInteractionTags(_0x54ac18,_0x23dc18);})['then'](function(_0x38d78f){_0x5e2cfa(_0x38d78f);})['catch'](function(_0x318984){_0x351484(_0x318984);});});}exports[_0xbb10('0x45')]=function(_0x4c66d8,_0x366608){var _0x1d82bf={},_0x474e99={},_0x5cf4f8={'count':0x0,'rows':[]};var _0x2dd02b=_[_0xbb10('0x3f')](db[_0xbb10('0x46')][_0xbb10('0x47')],function(_0x36e1fa){return{'name':_0x36e1fa[_0xbb10('0x48')],'type':_0x36e1fa[_0xbb10('0x49')][_0xbb10('0x4a')]};});_0x474e99[_0xbb10('0x4b')]=_[_0xbb10('0x3f')](_0x2dd02b,_0xbb10('0x38'));_0x474e99[_0xbb10('0x4c')]=_['keys'](_0x4c66d8[_0xbb10('0x4c')]);_0x474e99[_0xbb10('0x4d')]=_['intersection'](_0x474e99[_0xbb10('0x4b')],_0x474e99[_0xbb10('0x4c')]);_0x1d82bf[_0xbb10('0x4e')]=_[_0xbb10('0x4f')](_0x474e99[_0xbb10('0x4b')],qs[_0xbb10('0x50')](_0x4c66d8[_0xbb10('0x4c')]['fields']));_0x1d82bf['attributes']=_0x1d82bf[_0xbb10('0x4e')][_0xbb10('0x51')]?_0x1d82bf[_0xbb10('0x4e')]:_0x474e99['model'];if(!_0x4c66d8['query'][_0xbb10('0x52')](_0xbb10('0x53'))){_0x1d82bf[_0xbb10('0x54')]=qs[_0xbb10('0x54')](_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x54')]);_0x1d82bf[_0xbb10('0x2f')]=qs[_0xbb10('0x2f')](_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x2f')]);}_0x1d82bf['order']=qs['sort'](_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x55')]);_0x1d82bf[_0xbb10('0x56')]=qs[_0xbb10('0x4d')](_[_0xbb10('0x57')](_0x4c66d8[_0xbb10('0x4c')],_0x474e99[_0xbb10('0x4d')]),_0x2dd02b);var _0x445870=[];var _0x1c0d8f=squel[_0xbb10('0x58')]()[_0xbb10('0x59')]('id')[_0xbb10('0x59')](_0xbb10('0x38'))[_0xbb10('0x59')](_0xbb10('0x5a'))['from'](_0xbb10('0x5b'));var _0x5bd44d=squel[_0xbb10('0x58')]()[_0xbb10('0x59')](_0xbb10('0x5c'))[_0xbb10('0x59')](_0xbb10('0x5d'))[_0xbb10('0x59')](_0xbb10('0x5e'))[_0xbb10('0x5f')](_0xbb10('0x60'),'ui')[_0xbb10('0x61')](_0xbb10('0x62'),'u',_0xbb10('0x63'));var _0x1d49e1=squel[_0xbb10('0x58')]()[_0xbb10('0x5f')]('chat_interactions','i')[_0xbb10('0x61')](_0xbb10('0x64'),'c',_0xbb10('0x65'))[_0xbb10('0x61')](_0xbb10('0x62'),'o',_0xbb10('0x66'))['left_join'](_0xbb10('0x67'),'a',_0xbb10('0x68'))[_0xbb10('0x61')](_0xbb10('0x69'),'me',_0xbb10('0x6a'))[_0xbb10('0x61')](_0xbb10('0x6b'),'it',_0xbb10('0x6c'))[_0xbb10('0x61')](_0xbb10('0x5b'),'t',_0xbb10('0x6d'));var _0x2a1ce1=squel[_0xbb10('0x6e')]();var _0x4e7fac=[];var _0x4ea1a6=squel[_0xbb10('0x6e')]();var _0x3e6338;if(_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x6f')]){_0x3e6338=as['parseSearch'](_0x4c66d8['query'][_0xbb10('0x6f')]);var _0xaf2cc3=_0x3e6338[_0xbb10('0x70')];for(var _0x2dd150=0x0;_0x2dd150<_0x3e6338[_0xbb10('0x71')][_0xbb10('0x51')];_0x2dd150++){var _0x45c0dc=_0x3e6338['conditions'][_0x2dd150];var _0x117e84='i';var _0x216cff=_['find'](_0x2dd02b,['name',_0x45c0dc['field']]);if(!_0x216cff){switch(_0x45c0dc[_0xbb10('0x59')]){case _0xbb10('0x72'):if(_0x45c0dc[_0xbb10('0x73')]==0x1){_0x1d49e1['having']('`'+_0x45c0dc['field']+'`\x20=\x200');}else{_0x1d49e1[_0xbb10('0x74')]('`'+_0x45c0dc[_0xbb10('0x59')]+_0xbb10('0x75'));}break;case'Contact':if(_0x45c0dc[_0xbb10('0x76')]===_0xbb10('0x77')){if(_0x45c0dc['value']['split']('\x20')[_0xbb10('0x51')]>0x1){_0x2a1ce1[_0xaf2cc3](_0xbb10('0x78'),qs[_0xbb10('0x79')](_0x45c0dc[_0xbb10('0x73')]),null);}else{var _0x54b7c5='%'+_0x45c0dc[_0xbb10('0x73')]+'%';_0x2a1ce1[_0xaf2cc3](_0xbb10('0x7a'),_0x54b7c5,_0x54b7c5,_0x54b7c5);}}else{_0x216cff=_[_0xbb10('0x7b')](_0x2dd02b,['name',_0xbb10('0x7c')]);_0x45c0dc[_0xbb10('0x59')]=_0xbb10('0x7c');_0x329da7=as['buildExpression'](_0x117e84,_0x216cff[_0xbb10('0x49')],_0x45c0dc);_0x2a1ce1[_0xaf2cc3](_0x329da7[_0xbb10('0x7d')],_0x329da7[_0xbb10('0x73')][_0xbb10('0x7e')],_0x329da7['value'][_0xbb10('0x2e')]);}break;case _0xbb10('0x7f'):var _0x108e5b=_0x45c0dc[_0xbb10('0x73')]['split'](',')[_0xbb10('0x3f')](function(_0x277fe7){return Number(_0x277fe7);});_0x108e5b[_0xbb10('0x43')](function(_0x2ceb3e){_0x4ea1a6['or'](_0xbb10('0x80'),'%,'+_0x2ceb3e+',%');});_0x4e7fac=_[_0xbb10('0x81')](_0x4e7fac,_0x108e5b);break;case _0xbb10('0x82'):if(_0x45c0dc['operator']==='$substring'){_0x2a1ce1[_0xaf2cc3]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x45c0dc[_0xbb10('0x73')]+'%',null);}else{_0x216cff=_[_0xbb10('0x7b')](_0x2dd02b,[_0xbb10('0x38'),'UserId']);_0x45c0dc['field']=_0xbb10('0x83');_0x329da7=as[_0xbb10('0x84')](_0x117e84,_0x216cff[_0xbb10('0x49')],_0x45c0dc);_0x2a1ce1[_0xaf2cc3](_0x329da7[_0xbb10('0x7d')],_0x329da7[_0xbb10('0x73')][_0xbb10('0x7e')],_0x329da7['value'][_0xbb10('0x2e')]);}break;case _0xbb10('0x3a'):_0x329da7=as[_0xbb10('0x84')]('me',null,_0x45c0dc);_0x2a1ce1[_0xaf2cc3](_0x329da7[_0xbb10('0x7d')],_0x329da7[_0xbb10('0x73')]['start'],_0x329da7['value']['end']);break;}}else{var _0x329da7=as[_0xbb10('0x84')](_0x117e84,_0x216cff[_0xbb10('0x49')],_0x45c0dc);_0x2a1ce1[_0xaf2cc3](_0x329da7[_0xbb10('0x7d')],_0x329da7[_0xbb10('0x73')][_0xbb10('0x7e')],_0x329da7['value'][_0xbb10('0x2e')]);}}}else{var _0x4bc316=_(_0x4c66d8['query'])['keys']()[_0xbb10('0x3f')](function(_0x13040d){return _[_0xbb10('0x85')](_0x2dd02b,[_0xbb10('0x38'),_0x13040d])?_0x13040d:undefined;})['compact']()[_0xbb10('0x73')]();if(!_['isEmpty'](_0x4bc316)){_0x4bc316['forEach'](function(_0x165fe9){if(_0x165fe9===_0xbb10('0x86')){_0x1d49e1[_0xbb10('0x56')](_0xbb10('0x87'),[][_0xbb10('0x88')](_0x4c66d8['query'][_0x165fe9]));}else if(_0x165fe9===_0xbb10('0x89')){var _0x19fcec=JSON[_0xbb10('0x8a')](_0x4c66d8[_0xbb10('0x4c')][_0x165fe9])[_0xbb10('0x8b')];var _0x27f42f=JSON[_0xbb10('0x8a')](_0x4c66d8['query'][_0x165fe9])[_0xbb10('0x8c')];_0x1d49e1[_0xbb10('0x56')](_0xbb10('0x8d'),_0x19fcec,_0x27f42f);}else{if(_0x4c66d8[_0xbb10('0x4c')][_0x165fe9]===_0xbb10('0x8e')){_0x1d49e1[_0xbb10('0x56')]('i.'+_0x165fe9+_0xbb10('0x8f'));}else{_0x1d49e1[_0xbb10('0x56')]('i.'+_0x165fe9+'\x20=\x20?',_0x4c66d8[_0xbb10('0x4c')][_0x165fe9]);}}});}if(_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x90')]){if(_0x4c66d8['query']['read']==0x1){_0x1d49e1['having'](_0xbb10('0x91'));}else{_0x1d49e1['having']('`unreadMessages`\x20>\x200');}}if(_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x92')]){_0x4e7fac=_[_0xbb10('0x93')](_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x92')])?_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x92')]:new Array(_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x92')]);_0x4e7fac['forEach'](function(_0x318a14){_0x4ea1a6['or'](_0xbb10('0x80'),'%,'+_0x318a14+',%');});}if(_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x94')]){var _0x5c8eb8=_0x4c66d8['query'][_0xbb10('0x94')][_0xbb10('0x95')]('\x5c','\x5c\x5c')[_0xbb10('0x95')](/'/g,'\x27\x27');if(qs[_0xbb10('0x96')](_0x5c8eb8)){_0x2a1ce1['or']('i.id\x20LIKE\x20?',_0x5c8eb8+'%');}else{_0x2a1ce1['or'](_0xbb10('0x97'),qs[_0xbb10('0x79')](_0x5c8eb8))['or'](_0xbb10('0x98'),_0x5c8eb8+'%');}}}_0x1d49e1[_0xbb10('0x56')](_0x2a1ce1);_0x1d49e1[_0xbb10('0x99')]('i.id');var _0x5f0691={'type':db[_0xbb10('0x9a')][_0xbb10('0x9b')][_0xbb10('0x9c')],'raw':!![]};var _0x5239da=_0x1d49e1[_0xbb10('0x9d')]();_0x5239da[_0xbb10('0x59')]('i.id');_0x5239da['field'](_0xbb10('0x9e'),_0xbb10('0x72'));if(_0x1d82bf[_0xbb10('0x9f')]){_0x1d82bf['order'][_0xbb10('0x43')](function(_0x3a17fc){var _0xfbb365=_0x3a17fc[0x0]===_0xbb10('0xa0')?_0x3a17fc[0x0]:'i.'+_0x3a17fc[0x0];_0x1d49e1[_0xbb10('0x9f')](_0xfbb365,_0x3a17fc[0x1]===_0xbb10('0xa1')?![]:!![]);});}if(!_[_0xbb10('0xa2')](_0x4e7fac)){_0x1d49e1[_0xbb10('0x74')](_0x4ea1a6);_0x5239da[_0xbb10('0x56')]('t.id\x20IN\x20?',_0x4e7fac);}BPromise[_0xbb10('0xa3')]()[_0xbb10('0x22')](function(){if(!_0x3e6338){if(_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x86')])return;_0x5239da[_0xbb10('0x56')](_0xbb10('0xa4'));_0x1d49e1[_0xbb10('0x56')](_0xbb10('0xa4'));return;}if(_0x4c66d8[_0xbb10('0xa5')][_0xbb10('0xa6')]!==_0xbb10('0xa7'))return;return _0x4c66d8[_0xbb10('0xa5')]['getChatWebsites']({'attributes':['id'],'raw':!![]})['then'](function(_0xe1fc51){if(_[_0xbb10('0xa2')](_0xe1fc51)){_0x5239da[_0xbb10('0x56')](_0xbb10('0xa8'));_0x1d49e1[_0xbb10('0x56')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x5239da[_0xbb10('0x56')](_0xbb10('0x87'),_[_0xbb10('0x3f')](_0xe1fc51,'id'));_0x1d49e1[_0xbb10('0x56')](_0xbb10('0x87'),_[_0xbb10('0x3f')](_0xe1fc51,'id'));}});})['then'](function(){if(_0x4c66d8[_0xbb10('0xa5')][_0xbb10('0xa6')]==='agent'&&!_0x3e6338&&!_0x4c66d8[_0xbb10('0x4c')]['ChatWebsiteId'])return[];return db[_0xbb10('0xa9')][_0xbb10('0x4c')](_0x5239da[_0xbb10('0xaa')](),_0x5f0691);})[_0xbb10('0x22')](function(_0x3a4a6e){_0x5cf4f8['count']=_0x3a4a6e[_0xbb10('0x51')];if(_0x5cf4f8['count']===0x0)return[];return db[_0xbb10('0xa9')][_0xbb10('0x4c')](_0x1c0d8f['toString'](),_0x5f0691)['then'](function(_0x415407){_0x445870=_[_0xbb10('0xab')](_0x415407,'id');_0x5f0691=_[_0xbb10('0xac')](_0x5f0691,{'model':db[_0xbb10('0x46')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x50')]){_0x1d82bf[_0xbb10('0x4e')][_0xbb10('0x43')](function(_0x252ab8){_0x1d49e1[_0xbb10('0x59')]('i.'+_0x252ab8);});}else{_0x1d49e1[_0xbb10('0x59')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xbb10('0x72'));_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xad'),_0xbb10('0xae'));_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xaf'),_0xbb10('0xb0'));_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xb1'),_0xbb10('0xa0'));_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xb2'));_0x1d49e1['field'](_0xbb10('0xb3'),'Contact.firstName');_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xb4'),_0xbb10('0xb5'));_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xb6'),'Contact.email');_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xb7'),_0xbb10('0xb8'));_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xb9'),_0xbb10('0xba'));_0x1d49e1['field']('c.fax',_0xbb10('0xbb'));_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xbc'),'Owner.fullname');_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xbd'),'Owner.internal');_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xbe'),'TagIds');}if(_0x1d82bf[_0xbb10('0x54')])_0x1d49e1['limit'](_0x1d82bf[_0xbb10('0x54')]);if(_0x1d82bf[_0xbb10('0x2f')])_0x1d49e1['offset'](_0x1d82bf[_0xbb10('0x2f')]);return db[_0xbb10('0xa9')]['query'](_0x1d49e1['toString'](),_0x5f0691);})[_0xbb10('0x22')](function(_0x13ae83){if(_0x13ae83[_0xbb10('0x51')]>0x0)_0x5bd44d[_0xbb10('0x56')](_0xbb10('0xbf'),_['map'](_0x13ae83,'id'));return db[_0xbb10('0xa9')][_0xbb10('0x4c')](_0x5bd44d[_0xbb10('0xaa')](),_0x5f0691)['then'](function(_0xd68afa){var _0x4f90e6=_[_0xbb10('0xc0')](_0xd68afa,_0xbb10('0xc1'));var _0x44a3e1=[];_0x13ae83[_0xbb10('0x43')](function(_0x1f55d3){_0x44a3e1[_0xbb10('0x44')](updateChatInteraction(_0x1f55d3,_0x445870,_0x4f90e6));});return BPromise[_0xbb10('0xc2')](_0x44a3e1);});});})['then'](function(_0x4fc544){_0x5cf4f8[_0xbb10('0xc3')]=_0x4fc544;return _0x5cf4f8;})[_0xbb10('0x22')](respondWithFilteredResult(_0x366608,_0x1d82bf))[_0xbb10('0xc4')](handleError(_0x366608,null));};exports[_0xbb10('0xc5')]=function(_0x20b585,_0x363b81){var _0x1cccec={'raw':![],'where':{'id':_0x20b585[_0xbb10('0xc6')]['id']}},_0x1674f7={};_0x1674f7[_0xbb10('0x4b')]=_[_0xbb10('0xc7')](db[_0xbb10('0x46')][_0xbb10('0x47')]);_0x1674f7['query']=_[_0xbb10('0xc7')](_0x20b585[_0xbb10('0x4c')]);_0x1674f7[_0xbb10('0x4d')]=_[_0xbb10('0x4f')](_0x1674f7[_0xbb10('0x4b')],_0x1674f7[_0xbb10('0x4c')]);_0x1cccec[_0xbb10('0x4e')]=_[_0xbb10('0x4f')](_0x1674f7[_0xbb10('0x4b')],qs[_0xbb10('0x50')](_0x20b585[_0xbb10('0x4c')]['fields']));_0x1cccec[_0xbb10('0x4e')]=_0x1cccec['attributes'][_0xbb10('0x51')]?_0x1cccec[_0xbb10('0x4e')]:_0x1674f7[_0xbb10('0x4b')];if(_0x20b585[_0xbb10('0x4c')][_0xbb10('0xc8')]){_0x1cccec[_0xbb10('0xc9')]=[{'all':!![]}];}_0x1cccec=_['merge']({},_0x1cccec,_0x20b585[_0xbb10('0xca')]);return db['ChatInteraction'][_0xbb10('0x7b')](_0x1cccec)[_0xbb10('0x22')](handleEntityNotFound(_0x363b81,null))[_0xbb10('0x22')](respondWithResult(_0x363b81,null))[_0xbb10('0xc4')](handleError(_0x363b81,null));};exports[_0xbb10('0xcb')]=function(_0x31907e,_0x4f06c){return db[_0xbb10('0x46')][_0xbb10('0xcb')](_0x31907e[_0xbb10('0x3a')],{})[_0xbb10('0x22')](respondWithResult(_0x4f06c,0xc9))[_0xbb10('0xc4')](handleError(_0x4f06c,null));};exports['update']=function(_0x3696b3,_0x516520){if(_0x3696b3[_0xbb10('0x3a')]['id']){delete _0x3696b3[_0xbb10('0x3a')]['id'];}return db[_0xbb10('0x46')][_0xbb10('0x7b')]({'where':{'id':_0x3696b3[_0xbb10('0xc6')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x516520,null))[_0xbb10('0x22')](saveUpdates(_0x3696b3['body'],null))[_0xbb10('0x22')](respondWithResult(_0x516520,null))['catch'](handleError(_0x516520,null));};exports['destroy']=function(_0x1513e0,_0x35cbb9){return db[_0xbb10('0x46')][_0xbb10('0x7b')]({'where':{'id':_0x1513e0[_0xbb10('0xc6')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x35cbb9,null))['then'](removeEntity(_0x35cbb9,null))[_0xbb10('0xc4')](handleError(_0x35cbb9,null));};exports[_0xbb10('0xcc')]=function(_0x39aa9e,_0xb1b7c8){return db[_0xbb10('0x46')][_0xbb10('0xcc')]()['then'](respondWithResult(_0xb1b7c8,null))[_0xbb10('0xc4')](handleError(_0xb1b7c8,null));};exports[_0xbb10('0xcd')]=function(_0xb7c454,_0xa8b7c3){var _0x31718f=_0xb7c454[_0xbb10('0xc6')]['id'];var _0x2764e1;var _0x5e405b;var _0x33a43e;return db['ChatInteraction'][_0xbb10('0xce')]({'where':{'id':_0x31718f}})['then'](function(_0x4c8b68){_0x2764e1=_0x4c8b68;return db[_0xbb10('0xcf')][_0xbb10('0xce')]({'where':{'id':_0x4c8b68[_0xbb10('0x86')]},'attributes':['id',_0xbb10('0xd0'),_0xbb10('0xd1'),'vidaooTopic',_0xbb10('0xd2'),'vidaooMetadata'],'raw':!![]});})['then'](function(_0x4dd138){if(_0x4dd138&&_0x4dd138[_0xbb10('0xd0')]&&_0x4dd138[_0xbb10('0xd1')]){_0x5e405b=_0x4dd138;var _0x1b9012={'interaction':{'id':_0x31718f},'agent':{'id':_0xb7c454[_0xbb10('0xa5')]['id'],'name':_0xb7c454[_0xbb10('0xa5')]['name'],'fullname':_0xb7c454[_0xbb10('0xa5')][_0xbb10('0x40')],'email':_0xb7c454[_0xbb10('0xa5')][_0xbb10('0xd3')]},'contact':_0xb7c454[_0xbb10('0x3a')][_0xbb10('0x3b')],'account':_0xb7c454[_0xbb10('0x3a')]['account']};var _0x4c95c2={'rejectUnauthorized':![],'method':'POST','url':_0xbb10('0xd4'),'headers':{'X-APIKEY':_0x4dd138[_0xbb10('0xd0')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0xb7c454[_0xbb10('0xa5')][_0xbb10('0xd3')]],'buttons':null,'topic':_0x5e405b[_0xbb10('0xd5')],'note':_[_0xbb10('0xd6')](_0x5e405b[_0xbb10('0xd2')])?null:getMustacheRender(_0x5e405b[_0xbb10('0xd2')],_0x1b9012),'metadata':null},'redirect':_0xbb10('0xd7'),'json':!![]};try{if(!_[_0xbb10('0xd6')](_0x5e405b['vidaooMetadata'])){var _0x58295f=getMustacheRender(_0x5e405b['vidaooMetadata'],_0x1b9012);var _0x3d4b89=JSON[_0xbb10('0x8a')](_0x58295f);_0x4c95c2[_0xbb10('0x3a')]['metadata']=_0x3d4b89;}}catch(_0x2bfa8e){throw new db[(_0xbb10('0x9a'))][(_0xbb10('0xd8'))](_0xbb10('0xd9'));}return rp(_0x4c95c2);}else{throw new db[(_0xbb10('0x9a'))][(_0xbb10('0xd8'))]('Error\x20in\x20Vidaoo\x20configuration');}})['then'](function(_0x356660){_0x33a43e=_0x356660;if(_0x33a43e['id']){var _0x48889b={'body':_0x33a43e[_0xbb10('0xda')],'ChatWebsiteId':_0x5e405b['id'],'ChatInteractionId':_0x2764e1['id'],'direction':_0xbb10('0xdb'),'UserId':_0xb7c454[_0xbb10('0xa5')]['id']};return db[_0xbb10('0xdc')][_0xbb10('0xcb')](_0x48889b,{});}else{throw new db[(_0xbb10('0x9a'))][(_0xbb10('0xd8'))](_0xbb10('0xdd'));}})[_0xbb10('0x22')](function(){return _0x2764e1[_0xbb10('0xde')]({'vidaooSessionId':_0x33a43e['id']});})['then'](respondWithResult(_0xa8b7c3,null))[_0xbb10('0xc4')](handleError(_0xa8b7c3,null));};exports['customUpdate']=function(_0x27bed2,_0x5547fa){if(_0x27bed2[_0xbb10('0x3a')]['id']){delete _0x27bed2[_0xbb10('0x3a')]['id'];}return db[_0xbb10('0x46')][_0xbb10('0x7b')]({'where':{'id':_0x27bed2['params']['id']},'include':[{'model':db[_0xbb10('0xdf')],'as':'Contact'}]})[_0xbb10('0x22')](handleEntityNotFound(_0x5547fa,null))[_0xbb10('0x22')](saveUpdates(_0x27bed2[_0xbb10('0x3a')],null))['then'](respondWithResult(_0x5547fa,null))[_0xbb10('0xc4')](handleError(_0x5547fa,null));};exports[_0xbb10('0xe0')]=function(_0x140173,_0x18a44f,_0x11d31b){if(_0x140173[_0xbb10('0x3a')]['id']){delete _0x140173['body']['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x140173[_0xbb10('0xc6')]['id']}})['then'](function(_0x318908){if(!_0x318908){logger['error'](_0xbb10('0xe1'),_0xbb10('0xe0'),0x194,_0xbb10('0xe2'));_0x18a44f['sendStatus'](0x194);}else{if(_0x318908['UserId']){throw new db[(_0xbb10('0x9a'))][(_0xbb10('0xd8'))](_0xbb10('0xe3'));}}return _0x318908;})['then'](function(_0x440108){if(_0x440108){return _0x440108[_0xbb10('0x36')]({'closed':_0x140173[_0xbb10('0x3a')]['closed'],'disposition':_0x140173['body']['disposition']})[_0xbb10('0x22')](function(_0x55aa03){return _0x55aa03;});}})[_0xbb10('0x22')](function(_0x1c2c95){return respondWithRpcPromise(_0xbb10('0xe4'),_0xbb10('0xe0'),_0x140173[_0xbb10('0x3a')],client9004);})[_0xbb10('0x22')](respondWithResult(_0x18a44f,null))[_0xbb10('0xc4')](handleError(_0x18a44f,null));};exports[_0xbb10('0xe5')]=function(_0x2746eb,_0x431792,_0x2e2710){_0x2746eb['body'][_0xbb10('0x38')]=_0x2746eb[_0xbb10('0xe6')]['originalname'];_0x2746eb[_0xbb10('0x3a')]['basename']=_0x2746eb['file'][_0xbb10('0xe7')];_0x2746eb[_0xbb10('0x3a')][_0xbb10('0x49')]=_0x2746eb[_0xbb10('0xe6')][_0xbb10('0xe8')];return db['Attachment'][_0xbb10('0xcb')](_0x2746eb[_0xbb10('0x3a')])['then'](respondWithResult(_0x431792,0xc9))[_0xbb10('0xc4')](handleError(_0x431792,null));};exports[_0xbb10('0xe9')]=function(_0x5a82e7,_0x424c96,_0x4c769b){return db[_0xbb10('0x46')][_0xbb10('0xce')]({'where':{'id':_0x5a82e7[_0xbb10('0xc6')]['id']},'raw':!![]})[_0xbb10('0x22')](handleEntityNotFound(_0x424c96,null))[_0xbb10('0x22')](function(_0x20b312){if(_0x20b312){if(_0x20b312[_0xbb10('0xea')]){return _0x424c96['status'](0x193)[_0xbb10('0x33')]({'status':0x193,'message':_0xbb10('0xeb')});}return db[_0xbb10('0xec')][_0xbb10('0xce')]({'where':{'id':_0x5a82e7[_0xbb10('0x4c')][_0xbb10('0xed')]},'raw':!![]})['then'](handleEntityNotFound(_0x424c96,null));}})['then'](function(_0x5a40e8){if(_0x5a40e8){var _0x23849e=_0x5a40e8[_0xbb10('0xee')]!==null;var _0x3e1a86=path[_0xbb10('0xef')](config['root'],_0xbb10('0xf0'));if(_0x23849e){_0x3e1a86=path[_0xbb10('0xef')](_0x3e1a86,_0xbb10('0xf1'));}var _0x577d27=path['join'](_0x3e1a86,_0x5a40e8[_0xbb10('0xf2')]);return _0x424c96['download'](_0x577d27);}})[_0xbb10('0xc4')](handleError(_0x424c96,null));};exports[_0xbb10('0xf3')]=function(_0xb9bc5a,_0x42276f){var _0x425505=null;var _0xcb61bb=null;var _0x1fe250=null;var _0x57933f=null;if(_0xb9bc5a[_0xbb10('0x3a')]['id']){delete _0xb9bc5a[_0xbb10('0x3a')]['id'];}if(_0xb9bc5a['body'][_0xbb10('0xf4')]){_0x57933f=path[_0xbb10('0xef')](config[_0xbb10('0xf5')],'server/files/chat/upload/',util['format']('transcript-%s.txt',Date[_0xbb10('0xf6')]()));_0xb9bc5a[_0xbb10('0x3a')]['pathTranscript']=_0x57933f;}return db[_0xbb10('0x46')][_0xbb10('0x7b')]({'where':{'id':_0xb9bc5a[_0xbb10('0xc6')]['id']},'include':[{'model':db[_0xbb10('0xdc')],'as':_0xbb10('0xf7'),'include':[{'model':db[_0xbb10('0x82')],'as':_0xbb10('0x82')}]}]})['then'](handleEntityNotFound(_0x42276f,null))[_0xbb10('0x22')](saveUpdates(_0xb9bc5a['body'],null))['then'](function(_0x4aa0d7){if(_0x4aa0d7){_0x425505=_0x4aa0d7;return db[_0xbb10('0xcf')][_0xbb10('0x7b')]({'where':{'id':_0x425505['ChatWebsiteId']}});}})[_0xbb10('0x22')](function(_0x49f324){if(_0x49f324){_0x1fe250=_0x49f324;return db[_0xbb10('0xdf')][_0xbb10('0x7b')]({'where':{'id':_0x425505[_0xbb10('0x7c')]}});}})['then'](function(_0x4d10ea){if(_0x4d10ea){_0xcb61bb=_0x4d10ea;if(_0x57933f){var _0x447c0d=null;for(var _0x502e73=0x1;_0x502e73<_0x425505[_0xbb10('0xf7')][_0xbb10('0x51')];++_0x502e73){_0x447c0d=_0x425505['Messages'][_0x502e73];var _0x50cd00=_0x447c0d[_0xbb10('0x83')]?util[_0xbb10('0xf8')](_0xbb10('0xf9'),_0x1fe250['agentAlias'],_0x447c0d[_0xbb10('0x83')]):_0xbb10('0xfa');var _0x22f153=_0xb9bc5a['body'][_0xbb10('0xfb')]||util[_0xbb10('0xf8')](_0xbb10('0xf9'),_0xbb10('0xfc'),_0x447c0d[_0xbb10('0x7c')]);switch(_0x1fe250[_0xbb10('0xfd')]){case _0xbb10('0xfe'):_0x50cd00=_0x447c0d[_0xbb10('0x83')]?util[_0xbb10('0xf8')](_0xbb10('0xf9'),_0x1fe250[_0xbb10('0xff')],_0x447c0d[_0xbb10('0x83')]):_0xbb10('0xfa');break;case'agent_alias':_0x50cd00=_0x447c0d['UserId']?_0x447c0d[_0xbb10('0x82')]['alias']||_0x447c0d[_0xbb10('0x82')][_0xbb10('0x40')]:_0xbb10('0xfa');break;case'agent_fullname':_0x50cd00=_0x447c0d[_0xbb10('0x83')]?_0x447c0d[_0xbb10('0x82')][_0xbb10('0x40')]:_0xbb10('0xfa');break;default:_0x50cd00=_0x447c0d[_0xbb10('0x83')]?util['format'](_0xbb10('0xf9'),_0x1fe250[_0xbb10('0xff')],_0x447c0d[_0xbb10('0x83')]):_0xbb10('0xfa');}var _0x150d4c=util[_0xbb10('0xf8')]('[%s]\x20%s:\x20%s\x0a',moment(_0x447c0d[_0xbb10('0x89')])[_0xbb10('0xf8')]('MM/DD/YYYY\x20HH:mm:ss'),_0x447c0d[_0xbb10('0x100')]==='in'?_0x22f153:_0x50cd00,_0x447c0d[_0xbb10('0x3a')]);if(!_0x447c0d[_0xbb10('0x101')]){fs[_0xbb10('0x102')](_0x57933f,_0x150d4c);}}return db[_0xbb10('0x103')][_0xbb10('0xce')]({'where':{'service':!![]},'include':[{'model':db[_0xbb10('0x104')],'as':_0xbb10('0x105'),'raw':!![]}]});}}})[_0xbb10('0x22')](function(_0x33d1b7){if(_0x33d1b7&&_0x33d1b7[_0xbb10('0x105')]&&_0xb9bc5a[_0xbb10('0x3a')]){var _0x1db646={'tls':{'rejectUnauthorized':![]}};if(_0x33d1b7[_0xbb10('0x105')][_0xbb10('0x106')]){_0x1db646['service']=_0x33d1b7[_0xbb10('0x105')][_0xbb10('0x106')];}else{_0x1db646['host']=_0x33d1b7['Smtp'][_0xbb10('0x107')];_0x1db646[_0xbb10('0x108')]=_0x33d1b7[_0xbb10('0x105')][_0xbb10('0x108')];_0x1db646[_0xbb10('0x109')]=_0x33d1b7[_0xbb10('0x105')][_0xbb10('0x109')];}if(_0x33d1b7[_0xbb10('0x105')][_0xbb10('0x10a')]){_0x1db646['auth']={'user':_0x33d1b7['Smtp']['user'],'pass':_0x33d1b7['Smtp']['pass']};}return respondWithRpcPromise('SendMail',_0xbb10('0x10b'),{'account':_0x1db646,'message':{'from':util[_0xbb10('0xf8')](_0xbb10('0x10c'),_0x33d1b7[_0xbb10('0x38')],_0x33d1b7['email']||_0x33d1b7[_0xbb10('0x105')][_0xbb10('0xa5')]),'to':_0xb9bc5a[_0xbb10('0x3a')][_0xbb10('0xf4')],'subject':'Mail\x20Transcript','text':util['format'](_0xbb10('0x10d'),_0xb9bc5a[_0xbb10('0x3a')]['mailTranscript']),'attachments':[{'path':_0x57933f}]}})['then'](function(){return _0x425505;})[_0xbb10('0xc4')](function(_0xf1371a){console[_0xbb10('0x28')](_0xf1371a);});}else{return _0x425505;}})[_0xbb10('0x22')](respondWithStatusCode(_0x42276f,0xc8))[_0xbb10('0xc4')](handleError(_0x42276f,null));};exports['addMessage']=function(_0x4744f4,_0x5382e9,_0x4c97b9){return db[_0xbb10('0xdc')][_0xbb10('0x7b')]({'where':{'id':_0x4744f4[_0xbb10('0xc6')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x5382e9,null))[_0xbb10('0x22')](function(_0x21c0fd){if(_0x21c0fd){return _0x21c0fd['addMessage'](_0x4744f4[_0xbb10('0x3a')][_0xbb10('0x10e')],_[_0xbb10('0x10f')](_0x4744f4[_0xbb10('0x3a')],[_0xbb10('0x10e'),'id'])||{});}})[_0xbb10('0x22')](respondWithResult(_0x5382e9,null))[_0xbb10('0xc4')](handleError(_0x5382e9,null));};exports[_0xbb10('0x110')]=function(_0x233d5e,_0x16f3ce,_0xbae19c){var _0x26f4b0={'raw':![],'where':{}};var _0x1dbf7b={};var _0x117e95={'count':0x0,'rows':[]};return db[_0xbb10('0x46')][_0xbb10('0xce')]({'where':{'id':_0x233d5e[_0xbb10('0xc6')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x16f3ce,null))[_0xbb10('0x22')](function(_0x43a203){if(_0x43a203){_0x1dbf7b[_0xbb10('0x4b')]=_[_0xbb10('0xc7')](db['ChatMessage'][_0xbb10('0x47')]);_0x1dbf7b['query']=_[_0xbb10('0xc7')](_0x233d5e[_0xbb10('0x4c')]);_0x1dbf7b[_0xbb10('0x4d')]=_[_0xbb10('0x4f')](_0x1dbf7b[_0xbb10('0x4b')],_0x1dbf7b['query']);_0x26f4b0['attributes']=_['intersection'](_0x1dbf7b[_0xbb10('0x4b')],qs[_0xbb10('0x50')](_0x233d5e['query'][_0xbb10('0x50')]));_0x26f4b0[_0xbb10('0x4e')]=_0x26f4b0[_0xbb10('0x4e')]['length']?_0x26f4b0[_0xbb10('0x4e')]:_0x1dbf7b[_0xbb10('0x4b')];if(!_0x233d5e[_0xbb10('0x4c')]['hasOwnProperty'](_0xbb10('0x53'))){_0x26f4b0['limit']=qs[_0xbb10('0x54')](_0x233d5e['query']['limit']);_0x26f4b0['offset']=qs['offset'](_0x233d5e['query']['offset']);}_0x26f4b0[_0xbb10('0x9f')]=qs[_0xbb10('0x55')](_0x233d5e[_0xbb10('0x4c')][_0xbb10('0x55')]);_0x26f4b0['where']=qs[_0xbb10('0x4d')](_[_0xbb10('0x57')](_0x233d5e[_0xbb10('0x4c')],_0x1dbf7b[_0xbb10('0x4d')]));_0x26f4b0[_0xbb10('0x56')][_0xbb10('0xc1')]=_0x43a203['id'];if(_0x233d5e[_0xbb10('0x4c')][_0xbb10('0x94')]){_0x26f4b0[_0xbb10('0x56')]=_[_0xbb10('0xac')](_0x26f4b0['where'],{'$or':_[_0xbb10('0x3f')](_0x26f4b0[_0xbb10('0x4e')],function(_0x288ccc){var _0x5c5ecc={};_0x5c5ecc[_0x288ccc]={'$like':'%'+_0x233d5e[_0xbb10('0x4c')][_0xbb10('0x94')]+'%'};return _0x5c5ecc;})});}if(_0x233d5e[_0xbb10('0x4c')][_0xbb10('0x8b')]){var _0x5b2292=_0x233d5e[_0xbb10('0x4c')][_0xbb10('0x8b')][_0xbb10('0x111')](',');var _0x22ec50={};_0x22ec50[_0x5b2292[0x0]]={'$gte':moment(_0x5b2292[0x1])[_0xbb10('0xf8')](_0xbb10('0x112'))};_0x26f4b0[_0xbb10('0x56')]=_[_0xbb10('0xac')](_0x26f4b0[_0xbb10('0x56')],_0x22ec50);}_0x26f4b0=_[_0xbb10('0xac')]({},_0x26f4b0,_0x233d5e[_0xbb10('0xca')]);return db['ChatMessage'][_0xbb10('0x31')]({'where':_0x26f4b0[_0xbb10('0x56')]})['then'](function(_0x5eb1fb){_0x117e95[_0xbb10('0x31')]=_0x5eb1fb;if(_0x233d5e[_0xbb10('0x4c')]['includeAll']){_0x26f4b0[_0xbb10('0xc9')]=[{'all':!![]}];}return db[_0xbb10('0xdc')]['findAll'](_0x26f4b0);})[_0xbb10('0x22')](function(_0x42441e){_0x117e95[_0xbb10('0xc3')]=_0x42441e;return _0x117e95;});}})[_0xbb10('0x22')](respondWithFilteredResult(_0x16f3ce,_0x26f4b0))[_0xbb10('0xc4')](handleError(_0x16f3ce,null));};exports['getMyMessages']=function(_0x4fc260,_0x5a502c,_0xaeaa51){var _0x4db9ad={'where':{}},_0x43deea={},_0x53e73e={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xbb10('0xce')]({'where':{'id':_0x4fc260[_0xbb10('0xc6')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x5a502c,null))[_0xbb10('0x22')](function(_0x2527f4){if(_0x2527f4){_0x43deea[_0xbb10('0x4b')]=_['keys'](db['ChatMessage']['rawAttributes']);_0x43deea[_0xbb10('0x4c')]=_[_0xbb10('0xc7')](_0x4fc260[_0xbb10('0x4c')]);_0x43deea[_0xbb10('0x4d')]=_[_0xbb10('0x4f')](_0x43deea[_0xbb10('0x4b')],_0x43deea[_0xbb10('0x4c')]);_0x4db9ad['attributes']=_[_0xbb10('0x4f')](_0x43deea[_0xbb10('0x4b')],qs[_0xbb10('0x50')](_0x4fc260[_0xbb10('0x4c')]['fields']));_0x4db9ad[_0xbb10('0x4e')]=_0x4db9ad['attributes']['length']?_0x4db9ad[_0xbb10('0x4e')]:_0x43deea[_0xbb10('0x4b')];if(!_0x4fc260[_0xbb10('0x4c')][_0xbb10('0x52')](_0xbb10('0x53'))){_0x4db9ad[_0xbb10('0x54')]=qs['limit'](_0x4fc260[_0xbb10('0x4c')][_0xbb10('0x54')]);_0x4db9ad[_0xbb10('0x2f')]=qs[_0xbb10('0x2f')](_0x4fc260[_0xbb10('0x4c')][_0xbb10('0x2f')]);}_0x4db9ad[_0xbb10('0x9f')]=qs['sort'](_0x4fc260[_0xbb10('0x4c')][_0xbb10('0x55')]);_0x4db9ad[_0xbb10('0x56')]=qs['filters'](_['pick'](_0x4fc260[_0xbb10('0x4c')],_0x43deea[_0xbb10('0x4d')]));_0x4db9ad[_0xbb10('0x56')][_0xbb10('0xc1')]=_0x2527f4['id'];if(_0x4fc260[_0xbb10('0x4c')][_0xbb10('0x94')]){_0x4db9ad[_0xbb10('0x56')]=_['merge'](_0x4db9ad[_0xbb10('0x56')],{'$or':_[_0xbb10('0x3f')](_0x4db9ad[_0xbb10('0x4e')],function(_0x55ba78){var _0x5e195a={};_0x5e195a[_0x55ba78]={'$like':'%'+_0x4fc260['query']['filter']+'%'};return _0x5e195a;})});}_0x4db9ad[_0xbb10('0x56')][_0xbb10('0x101')]=![];if(_0x4fc260[_0xbb10('0x4c')]['id']){_0x4db9ad[_0xbb10('0x56')]['id']={'$gt':_0x4fc260['query']['id']};}_0x4db9ad=_[_0xbb10('0xac')]({},_0x4db9ad,_0x4fc260['options']);return db[_0xbb10('0xdc')][_0xbb10('0x31')]({'where':_0x4db9ad[_0xbb10('0x56')]})[_0xbb10('0x22')](function(_0xa16287){_0x53e73e[_0xbb10('0x31')]=_0xa16287;_0x4db9ad[_0xbb10('0xc9')]=[];if(_0x4fc260[_0xbb10('0x4c')][_0xbb10('0x113')]){_0x4db9ad[_0xbb10('0xc9')][_0xbb10('0x44')]({'model':db[_0xbb10('0x82')],'as':'User','attributes':['id',_0xbb10('0x40'),_0xbb10('0x114')]});}if(_0x4fc260[_0xbb10('0x4c')]['includeAll']){_0x4db9ad[_0xbb10('0xc9')]=[{'all':!![]}];}return db['ChatMessage'][_0xbb10('0x115')](_0x4db9ad);})[_0xbb10('0x22')](function(_0x280119){_0x53e73e[_0xbb10('0xc3')]=_0x280119;return _0x53e73e;});}})[_0xbb10('0x22')](respondWithFilteredResult(_0x5a502c,_0x4db9ad))['catch'](handleError(_0x5a502c,null));};exports['addTags']=function(_0x842d94,_0x4cf5cc,_0x553bb8){return db[_0xbb10('0x46')]['find']({'where':{'id':_0x842d94[_0xbb10('0xc6')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x4cf5cc,null))[_0xbb10('0x22')](function(_0x4469c4){if(_0x4469c4){return _0x4469c4[_0xbb10('0x116')](_0x842d94[_0xbb10('0x3a')][_0xbb10('0x10e')],_[_0xbb10('0x10f')](_0x842d94['body'],[_0xbb10('0x10e'),'id'])||{})['spread'](function(){return db[_0xbb10('0x7f')]['findAll']({'attributes':['id',_0xbb10('0x38'),_0xbb10('0x5a')],'where':{'id':_0x842d94['body'][_0xbb10('0x10e')]}});})[_0xbb10('0x22')](function(_0x1bb072){socket['emit'](_0xbb10('0x117'),{'id':Number(_0x842d94[_0xbb10('0xc6')]['id']),'tags':_0x1bb072||[]});return{'id':Number(_0x842d94[_0xbb10('0xc6')]['id']),'tags':_0x1bb072||[]};});}})['then'](respondWithResult(_0x4cf5cc,null))[_0xbb10('0xc4')](handleError(_0x4cf5cc,null));};exports[_0xbb10('0x118')]=function(_0x46df90,_0x4b781e,_0x3e6756){return db['ChatInteraction'][_0xbb10('0x7b')]({'where':{'id':_0x46df90[_0xbb10('0xc6')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x4b781e,null))[_0xbb10('0x22')](function(_0x583a3e){if(_0x583a3e){return _0x583a3e[_0xbb10('0x118')](_0x46df90[_0xbb10('0x4c')][_0xbb10('0x10e')]);}})[_0xbb10('0x22')](respondWithStatusCode(_0x4b781e,null))[_0xbb10('0xc4')](handleError(_0x4b781e,null));};exports['download']=function(_0x4b10ed,_0x40b5da){var _0x4739a6=moment()[_0xbb10('0x119')]()['toString']();var _0x3d5870=path[_0xbb10('0xef')](config[_0xbb10('0xf5')],_0xbb10('0x11a'),_0xbb10('0x11b'),_0xbb10('0x11c'));var _0x81d970=path[_0xbb10('0xef')](config[_0xbb10('0xf5')],'server',_0xbb10('0x11b'),_0xbb10('0x11d'));var _0x4102af=path[_0xbb10('0xef')](_0x3d5870,_0x4739a6);var _0x4d49a7=util[_0xbb10('0xf8')](_0xbb10('0x11e'),_0x4b10ed[_0xbb10('0xc6')]['id'],_0x4739a6);var _0x59fef2=path['join'](_0x3d5870,_0x4d49a7);var _0x3b45c4=[];_0x3b45c4['push']({'model':db[_0xbb10('0x82')],'as':'User','attributes':['id',_0xbb10('0x40')],'raw':!![]});_0x3b45c4[_0xbb10('0x44')]({'model':db[_0xbb10('0xdf')],'as':_0xbb10('0x11f'),'attributes':['id',_0xbb10('0x120'),_0xbb10('0x121')],'raw':!![]});if(_0x4b10ed[_0xbb10('0x4c')]['attachments']){_0x3b45c4[_0xbb10('0x44')]({'model':db[_0xbb10('0xec')],'as':_0xbb10('0xec'),'raw':!![]});}var _0x2807d2=[{'model':db[_0xbb10('0xdc')],'as':_0xbb10('0xf7'),'attributes':['id','body',_0xbb10('0x89'),_0xbb10('0x100'),_0xbb10('0x101'),_0xbb10('0x90')],'include':_0x3b45c4}];_0x2807d2[_0xbb10('0x44')]({'model':db[_0xbb10('0xcf')],'as':_0xbb10('0x122'),'attributes':['id','name']});_0x2807d2[_0xbb10('0x44')]({'model':db[_0xbb10('0x82')],'as':_0xbb10('0x123'),'attributes':['id','fullname']});return db[_0xbb10('0x46')]['find']({'where':{'id':_0x4b10ed[_0xbb10('0xc6')]['id']},'include':_0x2807d2})[_0xbb10('0x22')](handleEntityNotFound(_0x40b5da,null))[_0xbb10('0x22')](function(_0x58a447){if(_0x58a447){var _0x50fa4e=_0x58a447[_0xbb10('0x124')]({'plain':!![]});fs[_0xbb10('0x125')](_0x4102af);var _0xbb410e={'channel':_0xbb10('0x126'),'account':_0x50fa4e[_0xbb10('0x122')][_0xbb10('0x38')],'agent':_0x50fa4e[_0xbb10('0x123')]?_0x50fa4e[_0xbb10('0x123')][_0xbb10('0x40')]:_0xbb10('0x127'),'createdAt':moment(_0x50fa4e[_0xbb10('0x89')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xbb10('0xaa')](),'closedAt':_0x50fa4e[_0xbb10('0xea')]?moment(_0x50fa4e['closedAt'])['format'](_0xbb10('0x112'))[_0xbb10('0xaa')]():'','disposition':_0x50fa4e[_0xbb10('0x128')],'chatInfo':{'browser':_0x50fa4e['browserName'],'os':_0x50fa4e[_0xbb10('0x129')],'referer':_0x50fa4e[_0xbb10('0x12a')],'customerIp':_0x50fa4e['customerIp'],'customerPort':_0x50fa4e[_0xbb10('0x12b')]?_0x50fa4e[_0xbb10('0x12b')]:'N.A.'},'messages':_(_0x50fa4e['Messages'])[_0xbb10('0x12c')]()[_0xbb10('0x94')]({'secret':![]})[_0xbb10('0x3f')](function(_0x5cab64){if(_0x5cab64['Attachment']){var _0x58ee41=path[_0xbb10('0xef')](_0x81d970,_0x5cab64['Attachment'][_0xbb10('0xf2')]);if(fs[_0xbb10('0x12d')](_0x58ee41)){fs['createReadStream'](_0x58ee41)[_0xbb10('0x12e')](fs[_0xbb10('0x12f')](path[_0xbb10('0xef')](_0x4102af,_0x5cab64[_0xbb10('0xec')]['basename'])));}}return{'date':moment(_0x5cab64[_0xbb10('0x89')])['format'](_0xbb10('0x112'))[_0xbb10('0xaa')](),'sender':_0x5cab64[_0xbb10('0x100')]===_0xbb10('0xdb')?_0x5cab64[_0xbb10('0x82')]?_0x5cab64[_0xbb10('0x82')][_0xbb10('0x40')]:_0xbb10('0xfa'):_0x5cab64['Contact'][_0xbb10('0x120')]+(_0x5cab64[_0xbb10('0x11f')][_0xbb10('0x121')]?'\x20'+_0x5cab64[_0xbb10('0x11f')]['lastName']:''),'body':_0x5cab64['Attachment']?_0x5cab64[_0xbb10('0xec')][_0xbb10('0xf2')]:_0x5cab64[_0xbb10('0x3a')],'direction':_0x5cab64[_0xbb10('0x100')]==='out'?'A':'C','secret':_0x5cab64[_0xbb10('0x101')],'read':_0x5cab64[_0xbb10('0x90')],'attachment':_0x5cab64['Attachment']};})[_0xbb10('0x73')]()};return ejs['renderFile'](path['join'](config[_0xbb10('0xf5')],_0xbb10('0x11a'),_0xbb10('0x130'),_0xbb10('0x131')),{'interaction':_0xbb410e})[_0xbb10('0x22')](function(_0x4aa76a){var _0x38403e=path[_0xbb10('0xef')](_0x4102af,_0xbb10('0x132')+_0x50fa4e['id']+'-'+_0x4739a6+_0xbb10('0x133'));var _0x1b7274={'path':_0x38403e,'channel':_0xbb10('0x126'),'interactionId':_0x50fa4e['id']};return pdf[_0xbb10('0x134')](_0x4aa76a,_0x1b7274);})[_0xbb10('0x22')](function(){return new BPromise(function(_0x34f4d6,_0x254b6e){zipdir(_0x4102af,{'saveTo':_0x59fef2},function(_0x368adb,_0xef4ccf){if(_0x368adb)return _0x254b6e(_0x368adb);return _0x34f4d6(_0xef4ccf);});})[_0xbb10('0x22')](function(){return new BPromise(function(_0x9fcc26,_0x111fd4){rimraf(_0x4102af,function(_0x256ce9){if(_0x256ce9)_0x111fd4(_0x256ce9);return _0x9fcc26();});});})[_0xbb10('0x22')](function(){return _0x40b5da[_0xbb10('0x135')](_0x59fef2,_0x4d49a7,function(_0x27e0c5){if(_0x27e0c5){console[_0xbb10('0x136')](_0xbb10('0x137'),_0x27e0c5);}else{fs[_0xbb10('0x138')](_0x59fef2);}});});});}else{return _0x40b5da[_0xbb10('0x2c')](0xc8);}})[_0xbb10('0xc4')](handleError(_0x40b5da,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 3ff63ab..03fe6e2 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 _0x7536=['Users','map','unreadMessages','emit','catch','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x7536,0x97));var _0x6753=function(_0x4e6eb2,_0x16a451){_0x4e6eb2=_0x4e6eb2-0x0;var _0x4e0c1c=_0x7536[_0x4e6eb2];return _0x4e0c1c;};'use strict';var EventEmitter=require(_0x6753('0x0'));var ChatInteraction=require(_0x6753('0x1'))['db'][_0x6753('0x2')];var ChatMessage=require(_0x6753('0x1'))['db'][_0x6753('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x6753('0x4')](0x0);var events={'afterCreate':_0x6753('0x5'),'afterUpdate':_0x6753('0x6'),'afterDestroy':_0x6753('0x7')};function emitEvent(_0x3b20ff){return function(_0x1a902d,_0x4651a1,_0x282b86){_0x1a902d[_0x6753('0x8')]({'attributes':['id'],'raw':!![]})[_0x6753('0x9')](function(_0x1a88d8){_0x1a902d[_0x6753('0xa')](_0x6753('0xb'),_0x1a88d8[_0x6753('0xc')](function(_0x3f3377){return{'id':_0x3f3377['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x1a902d['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2382ae){_0x1a902d[_0x6753('0xa')](_0x6753('0xd'),_0x2382ae['length']);ChatInteractionEvents[_0x6753('0xe')](_0x3b20ff+':'+_0x1a902d['id'],_0x1a902d);ChatInteractionEvents[_0x6753('0xe')](_0x3b20ff,_0x1a902d);_0x282b86(null);})[_0x6753('0xf')](_0x282b86(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x6753('0x10')](e,emitEvent(event));}}module[_0x6753('0x11')]=ChatInteractionEvents; \ No newline at end of file +var _0x34b5=['remove','then','Users','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','update'];(function(_0x5ecadc,_0x1cf9f1){var _0x565037=function(_0x22908b){while(--_0x22908b){_0x5ecadc['push'](_0x5ecadc['shift']());}};_0x565037(++_0x1cf9f1);}(_0x34b5,0x181));var _0x534b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x34b5[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x534b('0x0'));var ChatInteraction=require(_0x534b('0x1'))['db'][_0x534b('0x2')];var ChatMessage=require(_0x534b('0x1'))['db'][_0x534b('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x534b('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x534b('0x5'),'afterDestroy':_0x534b('0x6')};function emitEvent(_0x574b80){return function(_0x12c182,_0x38707c,_0x171e14){_0x12c182['getUsers']({'attributes':['id'],'raw':!![]})[_0x534b('0x7')](function(_0x500d0f){_0x12c182['setDataValue'](_0x534b('0x8'),_0x500d0f['map'](function(_0x301a6a){return{'id':_0x301a6a['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x12c182['id'],'direction':'in','read':![]},'raw':!![]});})[_0x534b('0x7')](function(_0xd6afeb){_0x12c182[_0x534b('0x9')](_0x534b('0xa'),_0xd6afeb[_0x534b('0xb')]);ChatInteractionEvents['emit'](_0x574b80+':'+_0x12c182['id'],_0x12c182);ChatInteractionEvents[_0x534b('0xc')](_0x574b80,_0x12c182);_0x171e14(null);})[_0x534b('0xd')](_0x171e14(null));};}for(var e in events){if(events[_0x534b('0xe')](e)){var event=events[e];ChatInteraction[_0x534b('0xf')](e,emitEvent(event));}}module[_0x534b('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 5b8e98f..c5166f6 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 _0x76ec=['changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','chat_interactions'];(function(_0x40a1fd,_0x2e0977){var _0x496317=function(_0x17e189){while(--_0x17e189){_0x40a1fd['push'](_0x40a1fd['shift']());}};_0x496317(++_0x2e0977);}(_0x76ec,0x7d));var _0xc76e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x76ec[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xc76e('0x0'));var util=require(_0xc76e('0x1'));var logger=require(_0xc76e('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc76e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc76e('0x4'));var rimraf=require(_0xc76e('0x5'));var config=require(_0xc76e('0x6'));var attributes=require(_0xc76e('0x7'));module['exports']=function(_0x30632d,_0x12b151){return _0x30632d[_0xc76e('0x8')](_0xc76e('0x9'),attributes,{'tableName':_0xc76e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x335a07,_0x1624a4,_0x2ae79d){if(_0x335a07[_0xc76e('0xb')]('closed')){_0x335a07[_0xc76e('0xc')]=moment()[_0xc76e('0xd')](_0xc76e('0xe'));}_0x2ae79d(null,_0x335a07);}},'charset':_0xc76e('0xf'),'collate':_0xc76e('0x10')});}; \ No newline at end of file +var _0x1bc3=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','ChatInteraction','chat_interactions','changed','closed','format'];(function(_0x18847a,_0xd6898e){var _0x5b68ca=function(_0xf333b){while(--_0xf333b){_0x18847a['push'](_0x18847a['shift']());}};_0x5b68ca(++_0xd6898e);}(_0x1bc3,0x123));var _0x31bc=function(_0x3b544e,_0x31a861){_0x3b544e=_0x3b544e-0x0;var _0x2a09b1=_0x1bc3[_0x3b544e];return _0x2a09b1;};'use strict';var _=require(_0x31bc('0x0'));var util=require(_0x31bc('0x1'));var logger=require(_0x31bc('0x2'))(_0x31bc('0x3'));var moment=require('moment');var BPromise=require(_0x31bc('0x4'));var rp=require(_0x31bc('0x5'));var fs=require('fs');var path=require(_0x31bc('0x6'));var rimraf=require(_0x31bc('0x7'));var config=require(_0x31bc('0x8'));var attributes=require('./chatInteraction.attributes');module[_0x31bc('0x9')]=function(_0x2b7d27,_0xf9215f){return _0x2b7d27['define'](_0x31bc('0xa'),attributes,{'tableName':_0x31bc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xc5b5d1,_0x4fff4a,_0x3de363){if(_0xc5b5d1[_0x31bc('0xc')](_0x31bc('0xd'))){_0xc5b5d1['closedAt']=moment()[_0x31bc('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3de363(null,_0xc5b5d1);}},'charset':_0x31bc('0xf'),'collate':_0x31bc('0x10')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index b1ca528..3c78583 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 _0x5672=['body','omit','spread','AddTags','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','../../config/environment','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','info','ChatInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','UpdateChatInteraction','ChatInteraction','update','options','raw','where','then','AddTagsToChatInteraction','find','addTags'];(function(_0x40eba3,_0x37c878){var _0x1131e6=function(_0x23c09f){while(--_0x23c09f){_0x40eba3['push'](_0x40eba3['shift']());}};_0x1131e6(++_0x37c878);}(_0x5672,0x19b));var _0x2567=function(_0x77d310,_0x2b2fe7){_0x77d310=_0x77d310-0x0;var _0x2cdce4=_0x5672[_0x77d310];return _0x2cdce4;};'use strict';var _=require(_0x2567('0x0'));var util=require(_0x2567('0x1'));var moment=require(_0x2567('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2567('0x3'));var db=require(_0x2567('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2567('0x5'))('rpc');var config=require(_0x2567('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x2567('0x7')](config[_0x2567('0x8')],{'host':_0x2567('0x9'),'port':0x18eb});var socket=require(_0x2567('0xa'))(new Redis(config['redis']));require(_0x2567('0xb'))[_0x2567('0xc')](socket);function respondWithRpcPromise(_0x661c0e,_0x3e2291,_0x57dedc){return new BPromise(function(_0x23dd83,_0x39582a){return client[_0x2567('0xd')](_0x661c0e,_0x57dedc)['then'](function(_0x4100a9){logger[_0x2567('0xe')](_0x2567('0xf'),_0x3e2291,'request\x20sent');logger[_0x2567('0x10')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x3e2291,_0x2567('0x11'),JSON[_0x2567('0x12')](_0x4100a9));if(_0x4100a9['error']){if(_0x4100a9[_0x2567('0x13')]['code']===0x1f4){logger['error'](_0x2567('0xf'),_0x3e2291,_0x4100a9[_0x2567('0x13')][_0x2567('0x14')]);return _0x39582a(_0x4100a9[_0x2567('0x13')]['message']);}logger[_0x2567('0x13')](_0x2567('0xf'),_0x3e2291,_0x4100a9[_0x2567('0x13')][_0x2567('0x14')]);return _0x23dd83(_0x4100a9['error'][_0x2567('0x14')]);}else{logger['info'](_0x2567('0xf'),_0x3e2291,'request\x20sent');_0x23dd83(_0x4100a9[_0x2567('0x15')]['message']);}})[_0x2567('0x16')](function(_0x5d6b22){logger[_0x2567('0x13')](_0x2567('0xf'),_0x3e2291,_0x5d6b22);_0x39582a(_0x5d6b22);});});}exports[_0x2567('0x17')]=function(_0x43f9b8){var _0x40a27c=this;return new Promise(function(_0x4b55be,_0x4d72d6){return db[_0x2567('0x18')][_0x2567('0x19')](_0x43f9b8['body'],{'raw':_0x43f9b8[_0x2567('0x1a')]?_0x43f9b8[_0x2567('0x1a')][_0x2567('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43f9b8['options']?_0x43f9b8[_0x2567('0x1a')][_0x2567('0x1c')]||null:null,'attributes':_0x43f9b8[_0x2567('0x1a')]?_0x43f9b8[_0x2567('0x1a')]['attributes']||null:null,'limit':_0x43f9b8['options']?_0x43f9b8[_0x2567('0x1a')]['limit']||null:null})[_0x2567('0x1d')](function(_0x23cd27){logger[_0x2567('0xe')](_0x2567('0x17'),_0x43f9b8);logger[_0x2567('0x10')](_0x2567('0x17'),_0x43f9b8,JSON['stringify'](_0x23cd27));_0x4b55be(_0x23cd27);})[_0x2567('0x16')](function(_0x4b2909){logger[_0x2567('0x13')](_0x2567('0x17'),_0x4b2909[_0x2567('0x14')],_0x43f9b8);_0x4d72d6(_0x40a27c[_0x2567('0x13')](0x1f4,_0x4b2909[_0x2567('0x14')]));});});};exports[_0x2567('0x1e')]=function(_0x3c1cd4){return new Promise(function(_0x49d000,_0x4f071b){return db[_0x2567('0x18')][_0x2567('0x1f')]({'where':_0x3c1cd4[_0x2567('0x1a')]?_0x3c1cd4['options'][_0x2567('0x1c')]||null:null})[_0x2567('0x1d')](function(_0x112a67){if(_0x112a67){return _0x112a67[_0x2567('0x20')](_0x3c1cd4[_0x2567('0x21')]['ids'],_[_0x2567('0x22')](_0x3c1cd4[_0x2567('0x21')],['ids','id'])||{});}})[_0x2567('0x23')](function(_0x1a1745){logger['info'](_0x2567('0x24'),_0x3c1cd4);logger['debug'](_0x2567('0x24'),_0x3c1cd4,JSON['stringify'](_0x1a1745));_0x49d000(_0x1a1745);})[_0x2567('0x16')](function(_0x323ee4){logger['error'](_0x2567('0x24'),_0x323ee4['message'],_0x3c1cd4);_0x4f071b(_this[_0x2567('0x13')](0x1f4,_0x323ee4['message']));});});}; \ No newline at end of file +var _0x5b33=['register','then','info','ChatInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','ChatInteraction','update','body','options','where','attributes','UpdateChatInteraction','find','addTags','ids','AddTags','lodash','util','randomstring','ioredis','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket'];(function(_0x1de1e1,_0x436a29){var _0x16e853=function(_0x1fbc6d){while(--_0x1fbc6d){_0x1de1e1['push'](_0x1de1e1['shift']());}};_0x16e853(++_0x436a29);}(_0x5b33,0x152));var _0x35b3=function(_0x385fd1,_0x427ec3){_0x385fd1=_0x385fd1-0x0;var _0x402c49=_0x5b33[_0x385fd1];return _0x402c49;};'use strict';var _=require(_0x35b3('0x0'));var util=require(_0x35b3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x35b3('0x2'));var fs=require('fs');var Redis=require(_0x35b3('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x35b3('0x4'))(_0x35b3('0x5'));var config=require(_0x35b3('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x35b3('0x7')]=_[_0x35b3('0x8')](config[_0x35b3('0x7')],{'host':_0x35b3('0x9'),'port':0x18eb});var socket=require(_0x35b3('0xa'))(new Redis(config[_0x35b3('0x7')]));require(_0x35b3('0xb'))[_0x35b3('0xc')](socket);function respondWithRpcPromise(_0x7e0c60,_0x304c8e,_0x154df8){return new BPromise(function(_0xf08393,_0x204696){return client['request'](_0x7e0c60,_0x154df8)[_0x35b3('0xd')](function(_0x3d6150){logger[_0x35b3('0xe')](_0x35b3('0xf'),_0x304c8e,'request\x20sent');logger[_0x35b3('0x10')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x304c8e,_0x35b3('0x11'),JSON[_0x35b3('0x12')](_0x3d6150));if(_0x3d6150[_0x35b3('0x13')]){if(_0x3d6150[_0x35b3('0x13')][_0x35b3('0x14')]===0x1f4){logger[_0x35b3('0x13')](_0x35b3('0xf'),_0x304c8e,_0x3d6150[_0x35b3('0x13')][_0x35b3('0x15')]);return _0x204696(_0x3d6150[_0x35b3('0x13')][_0x35b3('0x15')]);}logger[_0x35b3('0x13')](_0x35b3('0xf'),_0x304c8e,_0x3d6150[_0x35b3('0x13')][_0x35b3('0x15')]);return _0xf08393(_0x3d6150['error']['message']);}else{logger['info'](_0x35b3('0xf'),_0x304c8e,_0x35b3('0x11'));_0xf08393(_0x3d6150[_0x35b3('0x16')][_0x35b3('0x15')]);}})[_0x35b3('0x17')](function(_0x4cf1c4){logger[_0x35b3('0x13')](_0x35b3('0xf'),_0x304c8e,_0x4cf1c4);_0x204696(_0x4cf1c4);});});}exports['UpdateChatInteraction']=function(_0x2af4f7){var _0xe88ba6=this;return new Promise(function(_0xd9917a,_0x2e11ea){return db[_0x35b3('0x18')][_0x35b3('0x19')](_0x2af4f7[_0x35b3('0x1a')],{'raw':_0x2af4f7[_0x35b3('0x1b')]?_0x2af4f7[_0x35b3('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2af4f7[_0x35b3('0x1b')]?_0x2af4f7['options'][_0x35b3('0x1c')]||null:null,'attributes':_0x2af4f7[_0x35b3('0x1b')]?_0x2af4f7[_0x35b3('0x1b')][_0x35b3('0x1d')]||null:null,'limit':_0x2af4f7[_0x35b3('0x1b')]?_0x2af4f7['options']['limit']||null:null})['then'](function(_0x4286c5){logger['info'](_0x35b3('0x1e'),_0x2af4f7);logger[_0x35b3('0x10')](_0x35b3('0x1e'),_0x2af4f7,JSON['stringify'](_0x4286c5));_0xd9917a(_0x4286c5);})['catch'](function(_0x26314d){logger['error'](_0x35b3('0x1e'),_0x26314d['message'],_0x2af4f7);_0x2e11ea(_0xe88ba6[_0x35b3('0x13')](0x1f4,_0x26314d[_0x35b3('0x15')]));});});};exports['AddTagsToChatInteraction']=function(_0x1b4739){return new Promise(function(_0x45e09f,_0x637b24){return db[_0x35b3('0x18')][_0x35b3('0x1f')]({'where':_0x1b4739['options']?_0x1b4739[_0x35b3('0x1b')][_0x35b3('0x1c')]||null:null})[_0x35b3('0xd')](function(_0x4a9dbb){if(_0x4a9dbb){return _0x4a9dbb[_0x35b3('0x20')](_0x1b4739['body']['ids'],_['omit'](_0x1b4739[_0x35b3('0x1a')],[_0x35b3('0x21'),'id'])||{});}})['spread'](function(_0x1f66e4){logger['info']('AddTags',_0x1b4739);logger[_0x35b3('0x10')](_0x35b3('0x22'),_0x1b4739,JSON[_0x35b3('0x12')](_0x1f66e4));_0x45e09f(_0x1f66e4);})[_0x35b3('0x17')](function(_0x38e22c){logger['error'](_0x35b3('0x22'),_0x38e22c[_0x35b3('0x15')],_0x1b4739);_0x637b24(_this[_0x35b3('0x13')](0x1f4,_0x38e22c[_0x35b3('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 8307dd8..45a1059 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 _0x6bbe=['length','chatInteraction:','./chatInteraction.events','save','update','emit','removeListener','register'];(function(_0x5c7995,_0x55727f){var _0x1bf482=function(_0x3fd79c){while(--_0x3fd79c){_0x5c7995['push'](_0x5c7995['shift']());}};_0x1bf482(++_0x55727f);}(_0x6bbe,0x172));var _0xe6bb=function(_0x4b16b5,_0x2405c6){_0x4b16b5=_0x4b16b5-0x0;var _0x498d87=_0x6bbe[_0x4b16b5];return _0x498d87;};'use strict';var ChatInteractionEvents=require(_0xe6bb('0x0'));var events=[_0xe6bb('0x1'),'remove',_0xe6bb('0x2')];function createListener(_0x3c3ca0,_0xde9621){return function(_0x4f0622){_0xde9621[_0xe6bb('0x3')](_0x3c3ca0,_0x4f0622);};}function removeListener(_0x410cc9,_0x38d8d0){return function(){ChatInteractionEvents[_0xe6bb('0x4')](_0x410cc9,_0x38d8d0);};}exports[_0xe6bb('0x5')]=function(_0x3742d0){for(var _0x2c74d8=0x0,_0x2fef59=events[_0xe6bb('0x6')];_0x2c74d8<_0x2fef59;_0x2c74d8++){var _0x21bbdd=events[_0x2c74d8];var _0xfe720b=createListener(_0xe6bb('0x7')+_0x21bbdd,_0x3742d0);ChatInteractionEvents['on'](_0x21bbdd,_0xfe720b);}}; \ No newline at end of file +var _0x3232=['./chatInteraction.events','remove','update','emit'];(function(_0x3ed194,_0x1467d1){var _0x29ac97=function(_0x19a525){while(--_0x19a525){_0x3ed194['push'](_0x3ed194['shift']());}};_0x29ac97(++_0x1467d1);}(_0x3232,0x178));var _0x2323=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x3232[_0x411add];return _0x238242;};'use strict';var ChatInteractionEvents=require(_0x2323('0x0'));var events=['save',_0x2323('0x1'),_0x2323('0x2')];function createListener(_0x174541,_0x31a1a9){return function(_0x2a1ba8){_0x31a1a9[_0x2323('0x3')](_0x174541,_0x2a1ba8);};}function removeListener(_0x1a03ea,_0x1d402a){return function(){ChatInteractionEvents['removeListener'](_0x1a03ea,_0x1d402a);};}exports['register']=function(_0x29400b){for(var _0x532845=0x0,_0x480298=events['length'];_0x532845<_0x480298;_0x532845++){var _0x164728=events[_0x532845];var _0x279aa8=createListener('chatInteraction:'+_0x164728,_0x29400b);ChatInteractionEvents['on'](_0x164728,_0x279aa8);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index fec7bc5..7e7629b 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 _0x651d=['chatinteraction:addtags','addTags','put','tracked','chatinteraction:update','update','customUpdate','/:id/abandon','abandon','/:id/close','delete','chatinteraction:destroy','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','format','now','originalname','/:id/attachment_upload','single','file','/:id/tags','chat'];(function(_0x104662,_0x53a7a7){var _0x19cba7=function(_0x5a76c0){while(--_0x5a76c0){_0x104662['push'](_0x104662['shift']());}};_0x19cba7(++_0x53a7a7);}(_0x651d,0x111));var _0xd651=function(_0x5756c6,_0x58290a){_0x5756c6=_0x5756c6-0x0;var _0x4b5806=_0x651d[_0x5756c6];return _0x4b5806;};'use strict';var multer=require(_0xd651('0x0'));var util=require(_0xd651('0x1'));var path=require(_0xd651('0x2'));var timeout=require(_0xd651('0x3'));var express=require(_0xd651('0x4'));var router=express[_0xd651('0x5')]();var fs_extra=require(_0xd651('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd651('0x7'));var controller=require(_0xd651('0x8'));router[_0xd651('0x9')]('/',auth[_0xd651('0xa')](),controller[_0xd651('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xd651('0xc')]);router['get'](_0xd651('0xd'),auth[_0xd651('0xe')](),controller[_0xd651('0xf')]);router[_0xd651('0x9')](_0xd651('0x10'),auth['isChatInteractionAuthorized'](),controller[_0xd651('0x11')]);router[_0xd651('0x9')](_0xd651('0x12'),auth['isAuthenticated'](),controller[_0xd651('0x13')]);router[_0xd651('0x9')](_0xd651('0x14'),auth[_0xd651('0xe')](),controller[_0xd651('0x15')]);router['get'](_0xd651('0x16'),auth[_0xd651('0xa')](),controller[_0xd651('0x17')]);router['post']('/',auth[_0xd651('0xa')](),controller[_0xd651('0x18')]);router[_0xd651('0x19')](_0xd651('0x1a'),auth[_0xd651('0xa')](),controller[_0xd651('0x1b')]);var upload=multer({'storage':multer[_0xd651('0x1c')]({'destination':function(_0x34cdd4,_0x1cf519,_0x417f5a){_0x417f5a(null,path[_0xd651('0x1d')](config[_0xd651('0x1e')],'server/files/attachments/'));},'filename':function(_0x33c610,_0x42eab1,_0x26e244){_0x26e244(null,util[_0xd651('0x1f')]('%s-%s',Date[_0xd651('0x20')](),_0x42eab1[_0xd651('0x21')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xd651('0x19')](_0xd651('0x22'),upload[_0xd651('0x23')](_0xd651('0x24')),controller['attachmentUpload']);router['post'](_0xd651('0x12'),auth[_0xd651('0xe')](),controller['addMessage']);router[_0xd651('0x19')](_0xd651('0x25'),auth[_0xd651('0xa')](),interaction['tracked'](_0xd651('0x26'),_0xd651('0x27')),controller[_0xd651('0x28')]);router[_0xd651('0x29')]('/:id',auth[_0xd651('0xa')](),interaction[_0xd651('0x2a')](_0xd651('0x26'),_0xd651('0x2b')),controller[_0xd651('0x2c')]);router[_0xd651('0x29')]('/:id/custom_update',controller[_0xd651('0x2d')]);router[_0xd651('0x29')](_0xd651('0x2e'),auth['isChatInteractionAuthorized'](),controller[_0xd651('0x2f')]);router['put'](_0xd651('0x30'),controller['close']);router[_0xd651('0x31')](_0xd651('0xd'),auth[_0xd651('0xa')](),interaction[_0xd651('0x2a')](_0xd651('0x26'),_0xd651('0x32')),controller[_0xd651('0x33')]);router['delete'](_0xd651('0x25'),auth['isAuthenticated'](),controller['removeTags']);module['exports']=router; \ No newline at end of file +var _0x919f=['/:id/my_messages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','root','server/files/attachments/','%s-%s','now','originalname','/:id/attachment_upload','single','file','attachmentUpload','addMessage','chat','addTags','/:id','tracked','chatinteraction:update','update','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','/:id/tags','removeTags','exports','util','path','connect-timeout','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','getMessages'];(function(_0xe36921,_0xdf33a5){var _0x10cf35=function(_0x25f94a){while(--_0x25f94a){_0xe36921['push'](_0xe36921['shift']());}};_0x10cf35(++_0xdf33a5);}(_0x919f,0xf9));var _0xf919=function(_0x141736,_0x3d0aa9){_0x141736=_0x141736-0x0;var _0x137537=_0x919f[_0x141736];return _0x137537;};'use strict';var multer=require('multer');var util=require(_0xf919('0x0'));var path=require(_0xf919('0x1'));var timeout=require(_0xf919('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf919('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xf919('0x4'));var controller=require(_0xf919('0x5'));router[_0xf919('0x6')]('/',auth[_0xf919('0x7')](),controller[_0xf919('0x8')]);router['get'](_0xf919('0x9'),auth['isAuthenticated'](),controller[_0xf919('0xa')]);router['get']('/:id',auth[_0xf919('0xb')](),controller[_0xf919('0xc')]);router[_0xf919('0x6')]('/:id/attachment_download',auth[_0xf919('0xb')](),controller[_0xf919('0xd')]);router[_0xf919('0x6')](_0xf919('0xe'),auth['isAuthenticated'](),controller[_0xf919('0xf')]);router['get'](_0xf919('0x10'),auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router[_0xf919('0x6')](_0xf919('0x11'),auth[_0xf919('0x7')](),controller[_0xf919('0x12')]);router[_0xf919('0x13')]('/',auth[_0xf919('0x7')](),controller[_0xf919('0x14')]);router[_0xf919('0x13')](_0xf919('0x15'),auth[_0xf919('0x7')](),controller[_0xf919('0x16')]);var upload=multer({'storage':multer[_0xf919('0x17')]({'destination':function(_0x5d28f5,_0x2a8b96,_0xa58228){_0xa58228(null,path['join'](config[_0xf919('0x18')],_0xf919('0x19')));},'filename':function(_0x38425a,_0x289b7c,_0x438839){_0x438839(null,util['format'](_0xf919('0x1a'),Date[_0xf919('0x1b')](),_0x289b7c[_0xf919('0x1c')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xf919('0x1d'),upload[_0xf919('0x1e')](_0xf919('0x1f')),controller[_0xf919('0x20')]);router[_0xf919('0x13')](_0xf919('0xe'),auth[_0xf919('0xb')](),controller[_0xf919('0x21')]);router[_0xf919('0x13')]('/:id/tags',auth['isAuthenticated'](),interaction['tracked'](_0xf919('0x22'),'chatinteraction:addtags'),controller[_0xf919('0x23')]);router['put'](_0xf919('0x24'),auth[_0xf919('0x7')](),interaction[_0xf919('0x25')]('chat',_0xf919('0x26')),controller[_0xf919('0x27')]);router[_0xf919('0x28')](_0xf919('0x29'),controller[_0xf919('0x2a')]);router[_0xf919('0x28')](_0xf919('0x2b'),auth['isChatInteractionAuthorized'](),controller[_0xf919('0x2c')]);router['put'](_0xf919('0x2d'),controller[_0xf919('0x2e')]);router[_0xf919('0x2f')](_0xf919('0x24'),auth[_0xf919('0x7')](),interaction['tracked'](_0xf919('0x22'),_0xf919('0x30')),controller[_0xf919('0x31')]);router[_0xf919('0x2f')](_0xf919('0x32'),auth['isAuthenticated'](),controller[_0xf919('0x33')]);module[_0xf919('0x34')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index c36f9ab..e9790a1 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 _0x5ab6=['INTEGER','sequelize','TEXT','medium'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x5ab6,0x19d));var _0x65ab=function(_0x6d4970,_0x4dae29){_0x6d4970=_0x6d4970-0x0;var _0x3597e3=_0x5ab6[_0x6d4970];return _0x3597e3;};'use strict';var Sequelize=require(_0x65ab('0x0'));module['exports']={'body':{'type':Sequelize[_0x65ab('0x1')](_0x65ab('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x65ab('0x3')]}}; \ No newline at end of file +var _0x0c8d=['medium','INTEGER','exports','TEXT'];(function(_0x5ad6c2,_0x929061){var _0x403f1f=function(_0x448605){while(--_0x448605){_0x5ad6c2['push'](_0x5ad6c2['shift']());}};_0x403f1f(++_0x929061);}(_0x0c8d,0x17e));var _0xd0c8=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x0c8d[_0x2e4e19];return _0x9ba20b;};'use strict';var Sequelize=require('sequelize');module[_0xd0c8('0x0')]={'body':{'type':Sequelize[_0xd0c8('0x1')](_0xd0c8('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xd0c8('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 252801f..385a4d3 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 _0x3e43=['fieldName','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','VIRTUAL','options','includeAll','findAll','catch','show','params','include','create','body','find','describe','get','messages','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','createdAt','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','map','ChatInternalMessage','rawAttributes'];(function(_0x2d7eae,_0x484361){var _0x208af1=function(_0x2ef19c){while(--_0x2ef19c){_0x2d7eae['push'](_0x2d7eae['shift']());}};_0x208af1(++_0x484361);}(_0x3e43,0x19d));var _0x33e4=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x3e43[_0x55f8b4];return _0x2475f9;};'use strict';var emlformat=require(_0x33e4('0x0'));var rimraf=require(_0x33e4('0x1'));var zipdir=require(_0x33e4('0x2'));var jsonpatch=require(_0x33e4('0x3'));var rp=require('request-promise');var moment=require(_0x33e4('0x4'));var BPromise=require(_0x33e4('0x5'));var Mustache=require(_0x33e4('0x6'));var util=require(_0x33e4('0x7'));var path=require('path');var sox=require(_0x33e4('0x8'));var csv=require(_0x33e4('0x9'));var ejs=require(_0x33e4('0xa'));var fs=require('fs');var fs_extra=require(_0x33e4('0xb'));var _=require(_0x33e4('0xc'));var squel=require(_0x33e4('0xd'));var crypto=require(_0x33e4('0xe'));var jsforce=require(_0x33e4('0xf'));var deskjs=require(_0x33e4('0x10'));var toCsv=require('to-csv');var querystring=require(_0x33e4('0x11'));var Papa=require(_0x33e4('0x12'));var Redis=require(_0x33e4('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x33e4('0x14'));var as=require(_0x33e4('0x15'));var hardwareService=require(_0x33e4('0x16'));var logger=require(_0x33e4('0x17'))(_0x33e4('0x18'));var utils=require('../../config/utils');var config=require(_0x33e4('0x19'));var licenseUtil=require(_0x33e4('0x1a'));var db=require(_0x33e4('0x1b'))['db'];config[_0x33e4('0x1c')]=_[_0x33e4('0x1d')](config['redis'],{'host':_0x33e4('0x1e'),'port':0x18eb});var socket=require(_0x33e4('0x1f'))(new Redis(config[_0x33e4('0x1c')]));require('./chatInternalMessage.socket')[_0x33e4('0x20')](socket);function respondWithStatusCode(_0x32a2a2,_0x430abc){_0x430abc=_0x430abc||0xcc;return function(_0x3b084e){if(_0x3b084e){return _0x32a2a2['sendStatus'](_0x430abc);}return _0x32a2a2[_0x33e4('0x21')](_0x430abc)['end']();};}function respondWithResult(_0x519e25,_0x49c91f){_0x49c91f=_0x49c91f||0xc8;return function(_0x2470bc){if(_0x2470bc){return _0x519e25[_0x33e4('0x21')](_0x49c91f)[_0x33e4('0x22')](_0x2470bc);}};}function respondWithFilteredResult(_0x139e2e,_0xf1628){return function(_0x56e305){if(_0x56e305){var _0x5129a3=typeof _0xf1628['offset']==='undefined'&&typeof _0xf1628[_0x33e4('0x23')]==='undefined';var _0x19eb4c=_0x56e305[_0x33e4('0x24')];var _0xd251e8=_0x5129a3?0x0:_0xf1628['offset'];var _0x53c3b8=_0x5129a3?_0x56e305[_0x33e4('0x24')]:_0xf1628[_0x33e4('0x25')]+_0xf1628['limit'];var _0x55ceca;if(_0x53c3b8>=_0x19eb4c){_0x53c3b8=_0x19eb4c;_0x55ceca=0xc8;}else{_0x55ceca=0xce;}_0x139e2e[_0x33e4('0x21')](_0x55ceca);return _0x139e2e[_0x33e4('0x26')](_0x33e4('0x27'),_0xd251e8+'-'+_0x53c3b8+'/'+_0x19eb4c)[_0x33e4('0x22')](_0x56e305);}return null;};}function patchUpdates(_0x59fc4a){return function(_0x82a9f6){try{jsonpatch[_0x33e4('0x28')](_0x82a9f6,_0x59fc4a,!![]);}catch(_0x846a34){return BPromise[_0x33e4('0x29')](_0x846a34);}return _0x82a9f6[_0x33e4('0x2a')]();};}function saveUpdates(_0x2977e1,_0x5223ac){return function(_0x50ecfb){if(_0x50ecfb){return _0x50ecfb[_0x33e4('0x2b')](_0x2977e1)[_0x33e4('0x2c')](function(_0x385a33){return _0x385a33;});}return null;};}function removeEntity(_0x253540,_0x47ed14){return function(_0xde7b86){if(_0xde7b86){return _0xde7b86[_0x33e4('0x2d')]()[_0x33e4('0x2c')](function(){_0x253540['status'](0xcc)[_0x33e4('0x2e')]();});}};}function handleEntityNotFound(_0x509847,_0x5b7e54){return function(_0x540e7f){if(!_0x540e7f){_0x509847[_0x33e4('0x2f')](0x194);}return _0x540e7f;};}function handleError(_0x46be70,_0x520b26){_0x520b26=_0x520b26||0x1f4;return function(_0x38102c){logger[_0x33e4('0x30')](_0x38102c[_0x33e4('0x31')]);if(_0x38102c[_0x33e4('0x32')]){delete _0x38102c[_0x33e4('0x32')];}_0x46be70['status'](_0x520b26)[_0x33e4('0x33')](_0x38102c);};}exports['index']=function(_0x412c45,_0x3c6a70){var _0x15f297={},_0x95ab89={},_0x267278={'count':0x0,'rows':[]};var _0x4a45e3=_[_0x33e4('0x34')](db[_0x33e4('0x35')][_0x33e4('0x36')],function(_0x3178b0){return{'name':_0x3178b0[_0x33e4('0x37')],'type':_0x3178b0[_0x33e4('0x38')]['key']};});_0x95ab89[_0x33e4('0x39')]=_[_0x33e4('0x34')](_0x4a45e3,_0x33e4('0x32'));_0x95ab89[_0x33e4('0x3a')]=_[_0x33e4('0x3b')](_0x412c45[_0x33e4('0x3a')]);_0x95ab89[_0x33e4('0x3c')]=_['intersection'](_0x95ab89[_0x33e4('0x39')],_0x95ab89['query']);_0x15f297[_0x33e4('0x3d')]=_['intersection'](_0x95ab89['model'],qs[_0x33e4('0x3e')](_0x412c45[_0x33e4('0x3a')][_0x33e4('0x3e')]));_0x15f297[_0x33e4('0x3d')]=_0x15f297[_0x33e4('0x3d')][_0x33e4('0x3f')]?_0x15f297['attributes']:_0x95ab89['model'];if(!_0x412c45[_0x33e4('0x3a')][_0x33e4('0x40')](_0x33e4('0x41'))){_0x15f297[_0x33e4('0x23')]=qs[_0x33e4('0x23')](_0x412c45['query'][_0x33e4('0x23')]);_0x15f297[_0x33e4('0x25')]=qs[_0x33e4('0x25')](_0x412c45['query'][_0x33e4('0x25')]);}_0x15f297[_0x33e4('0x42')]=qs[_0x33e4('0x43')](_0x412c45[_0x33e4('0x3a')]['sort']);_0x15f297['where']=qs['filters'](_['pick'](_0x412c45[_0x33e4('0x3a')],_0x95ab89[_0x33e4('0x3c')]),_0x4a45e3);if(_0x412c45['query'][_0x33e4('0x44')]){_0x15f297['where']=_[_0x33e4('0x45')](_0x15f297[_0x33e4('0x46')],{'$or':_[_0x33e4('0x34')](_0x4a45e3,function(_0x52c088){if(_0x52c088[_0x33e4('0x38')]!==_0x33e4('0x47')){var _0x3c5db0={};_0x3c5db0[_0x52c088[_0x33e4('0x32')]]={'$like':'%'+_0x412c45[_0x33e4('0x3a')][_0x33e4('0x44')]+'%'};return _0x3c5db0;}})});}_0x15f297=_[_0x33e4('0x45')]({},_0x15f297,_0x412c45[_0x33e4('0x48')]);var _0x5ba6c0={'where':_0x15f297['where']};return db[_0x33e4('0x35')]['count'](_0x5ba6c0)['then'](function(_0x211638){_0x267278[_0x33e4('0x24')]=_0x211638;if(_0x412c45['query'][_0x33e4('0x49')]){_0x15f297['include']=[{'all':!![]}];}return db[_0x33e4('0x35')][_0x33e4('0x4a')](_0x15f297);})[_0x33e4('0x2c')](function(_0x36d244){_0x267278['rows']=_0x36d244;return _0x267278;})[_0x33e4('0x2c')](respondWithFilteredResult(_0x3c6a70,_0x15f297))[_0x33e4('0x4b')](handleError(_0x3c6a70,null));};exports[_0x33e4('0x4c')]=function(_0x7c4b22,_0x4271b8){var _0x85c72a={'raw':!![],'where':{'id':_0x7c4b22[_0x33e4('0x4d')]['id']}},_0x25362e={};_0x25362e[_0x33e4('0x39')]=_['keys'](db[_0x33e4('0x35')][_0x33e4('0x36')]);_0x25362e[_0x33e4('0x3a')]=_['keys'](_0x7c4b22[_0x33e4('0x3a')]);_0x25362e[_0x33e4('0x3c')]=_['intersection'](_0x25362e['model'],_0x25362e[_0x33e4('0x3a')]);_0x85c72a['attributes']=_['intersection'](_0x25362e['model'],qs[_0x33e4('0x3e')](_0x7c4b22[_0x33e4('0x3a')][_0x33e4('0x3e')]));_0x85c72a[_0x33e4('0x3d')]=_0x85c72a[_0x33e4('0x3d')]['length']?_0x85c72a['attributes']:_0x25362e['model'];if(_0x7c4b22[_0x33e4('0x3a')]['includeAll']){_0x85c72a[_0x33e4('0x4e')]=[{'all':!![]}];}_0x85c72a=_[_0x33e4('0x45')]({},_0x85c72a,_0x7c4b22[_0x33e4('0x48')]);return db[_0x33e4('0x35')]['find'](_0x85c72a)[_0x33e4('0x2c')](handleEntityNotFound(_0x4271b8,null))[_0x33e4('0x2c')](respondWithResult(_0x4271b8,null))['catch'](handleError(_0x4271b8,null));};exports[_0x33e4('0x4f')]=function(_0x3fccfb,_0x5dab6f){return db[_0x33e4('0x35')]['create'](_0x3fccfb[_0x33e4('0x50')],{})[_0x33e4('0x2c')](respondWithResult(_0x5dab6f,0xc9))[_0x33e4('0x4b')](handleError(_0x5dab6f,null));};exports[_0x33e4('0x2b')]=function(_0x743c09,_0x461eb4){if(_0x743c09[_0x33e4('0x50')]['id']){delete _0x743c09[_0x33e4('0x50')]['id'];}return db['ChatInternalMessage'][_0x33e4('0x51')]({'where':{'id':_0x743c09[_0x33e4('0x4d')]['id']}})[_0x33e4('0x2c')](handleEntityNotFound(_0x461eb4,null))[_0x33e4('0x2c')](saveUpdates(_0x743c09[_0x33e4('0x50')],null))[_0x33e4('0x2c')](respondWithResult(_0x461eb4,null))[_0x33e4('0x4b')](handleError(_0x461eb4,null));};exports['destroy']=function(_0x248f38,_0xadfc09){return db[_0x33e4('0x35')][_0x33e4('0x51')]({'where':{'id':_0x248f38['params']['id']}})[_0x33e4('0x2c')](handleEntityNotFound(_0xadfc09,null))[_0x33e4('0x2c')](removeEntity(_0xadfc09,null))[_0x33e4('0x4b')](handleError(_0xadfc09,null));};exports[_0x33e4('0x52')]=function(_0x15b56c,_0x545ea3){return db[_0x33e4('0x35')][_0x33e4('0x52')]()['then'](respondWithResult(_0x545ea3,null))['catch'](handleError(_0x545ea3,null));};function wrapUser(_0x363543){return function(_0x343f47){var _0x3934af=_0x363543[_0x33e4('0x53')]({'plain':!![]});_0x3934af[_0x33e4('0x54')]=[];if(_0x343f47){_0x3934af[_0x33e4('0x55')]=_0x343f47['createdAt'];_0x3934af[_0x33e4('0x56')]=_0x343f47;}else{_0x3934af[_0x33e4('0x55')]=moment(0x0)[_0x33e4('0x57')](_0x33e4('0x58'));_0x3934af['lastMessage']={};}return _0x3934af;};}exports['getUsers']=function(_0x362b2f,_0x2cd79d,_0xd5a425){var _0x55feee=[];return db['User']['findAll']({'where':{'role':[_0x33e4('0x59'),_0x33e4('0x5a'),_0x33e4('0x5b')]},'attributes':['id',_0x33e4('0x5c'),_0x33e4('0x32'),_0x33e4('0x5d'),_0x33e4('0x5e'),_0x33e4('0x5f'),_0x33e4('0x60'),_0x33e4('0x61'),_0x33e4('0x62'),_0x33e4('0x63')],'order':qs[_0x33e4('0x43')](_0x33e4('0x64')),'include':[{'model':db[_0x33e4('0x65')],'as':_0x33e4('0x66'),'attributes':['id',_0x33e4('0x32'),_0x33e4('0x38')],'through':{'attributes':[]}}]})[_0x33e4('0x2c')](function(_0x5f409e){if(_0x5f409e){var _0x15acf3=_0x362b2f[_0x33e4('0x5b')][_0x33e4('0x53')]({'plain':!![]});if(!_0x15acf3)throw new Error(_0x33e4('0x67'));if(_0x15acf3[_0x33e4('0x5d')]===_0x33e4('0x5b')){return db['UserProfileSection']['find']({'where':{'name':_0x33e4('0x68'),'userProfileId':_0x15acf3[_0x33e4('0x69')]},'raw':!![]})[_0x33e4('0x2c')](function(_0x29a81a){if(_0x29a81a){if(_0x29a81a[_0x33e4('0x6a')]===0x0){return db[_0x33e4('0x6b')][_0x33e4('0x4a')]({'where':{'sectionId':_0x29a81a['id']},'raw':!![]})[_0x33e4('0x2c')](function(_0x4a53af){var _0x29a79a=[];if(_[_0x33e4('0x6c')](_0x4a53af)){_0x29a79a=_['filter'](_0x5f409e,function(_0x168ad7){if(_0x168ad7['role']!==_0x33e4('0x59')){return _0x168ad7;}});return _0x29a79a;}else{for(var _0x1bd0f9=0x0;_0x1bd0f9<_0x5f409e['length'];_0x1bd0f9++){var _0x18b277=_0x5f409e[_0x1bd0f9];if(_0x18b277['role']===_0x33e4('0x59')){var _0x4e35d3=_[_0x33e4('0x51')](_0x4a53af,function(_0xb66aae){return _0xb66aae[_0x33e4('0x6d')]===_0x18b277['id'];});if(_0x4e35d3)_0x29a79a[_0x33e4('0x6e')](_0x18b277);}else{_0x29a79a['push'](_0x18b277);}}return _0x29a79a;}});}else{return _0x5f409e;}}else{var _0x26821a=_[_0x33e4('0x44')](_0x5f409e,function(_0x54eefb){if(_0x54eefb[_0x33e4('0x5d')]!==_0x33e4('0x59')){return _0x54eefb;}});return _0x26821a;}});}else{return _0x5f409e;}}})[_0x33e4('0x2c')](function(_0x626a22){var _0x5ac75e=[];if(_0x626a22){_0x55feee=_0x626a22;for(var _0x3e884b=0x0;_0x3e884b<_0x626a22[_0x33e4('0x3f')];_0x3e884b+=0x1){_0x55feee[_0x3e884b][_0x33e4('0x54')]=[];_0x5ac75e[_0x33e4('0x6e')](db[_0x33e4('0x35')][_0x33e4('0x51')]({'where':{'FromId':[_0x362b2f[_0x33e4('0x5b')]['id'],_0x626a22[_0x3e884b]['id']],'ToId':[_0x362b2f[_0x33e4('0x5b')]['id'],_0x626a22[_0x3e884b]['id']],'ChatGroupId':null},'attributes':['id',_0x33e4('0x6f'),_0x33e4('0x70'),_0x33e4('0x71'),_0x33e4('0x72'),_0x33e4('0x50')],'order':qs['sort'](_0x33e4('0x73')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x33e4('0x2c')](wrapUser(_0x626a22[_0x3e884b])));}return BPromise[_0x33e4('0x74')](_0x5ac75e);}return[];})[_0x33e4('0x2c')](function(_0x6296f2){return{'rows':_0x6296f2,'count':_0x6296f2[_0x33e4('0x3f')]};})[_0x33e4('0x2c')](respondWithResult(_0x2cd79d,null))['catch'](handleError(_0x2cd79d,null));}; \ No newline at end of file +var _0x4269=['nolimit','sort','where','merge','filter','includeAll','findAll','rows','catch','show','params','keys','find','create','body','describe','get','createdAt','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','role','allowmessenger','showWebBar','-online','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','messages','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','./chatInternalMessage.socket','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','ChatInternalMessage','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x34f1f9,_0x1343d0){var _0x4c28dd=function(_0x8d623d){while(--_0x8d623d){_0x34f1f9['push'](_0x34f1f9['shift']());}};_0x4c28dd(++_0x1343d0);}(_0x4269,0x10a));var _0x9426=function(_0xa1dc2c,_0x6d230d){_0xa1dc2c=_0xa1dc2c-0x0;var _0x4caf06=_0x4269[_0xa1dc2c];return _0x4caf06;};'use strict';var emlformat=require(_0x9426('0x0'));var rimraf=require(_0x9426('0x1'));var zipdir=require(_0x9426('0x2'));var jsonpatch=require(_0x9426('0x3'));var rp=require(_0x9426('0x4'));var moment=require(_0x9426('0x5'));var BPromise=require(_0x9426('0x6'));var Mustache=require('mustache');var util=require(_0x9426('0x7'));var path=require(_0x9426('0x8'));var sox=require(_0x9426('0x9'));var csv=require(_0x9426('0xa'));var ejs=require(_0x9426('0xb'));var fs=require('fs');var fs_extra=require(_0x9426('0xc'));var _=require(_0x9426('0xd'));var squel=require(_0x9426('0xe'));var crypto=require(_0x9426('0xf'));var jsforce=require(_0x9426('0x10'));var deskjs=require(_0x9426('0x11'));var toCsv=require(_0x9426('0xa'));var querystring=require(_0x9426('0x12'));var Papa=require(_0x9426('0x13'));var Redis=require(_0x9426('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9426('0x15'));var hardwareService=require(_0x9426('0x16'));var logger=require(_0x9426('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x9426('0x18'));var licenseUtil=require(_0x9426('0x19'));var db=require(_0x9426('0x1a'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x9426('0x1b'),'port':0x18eb});var socket=require(_0x9426('0x1c'))(new Redis(config['redis']));require(_0x9426('0x1d'))['register'](socket);function respondWithStatusCode(_0x279848,_0x29461a){_0x29461a=_0x29461a||0xcc;return function(_0x5c86b3){if(_0x5c86b3){return _0x279848[_0x9426('0x1e')](_0x29461a);}return _0x279848['status'](_0x29461a)['end']();};}function respondWithResult(_0x3ee37d,_0x1aa2a3){_0x1aa2a3=_0x1aa2a3||0xc8;return function(_0xf9332){if(_0xf9332){return _0x3ee37d[_0x9426('0x1f')](_0x1aa2a3)[_0x9426('0x20')](_0xf9332);}};}function respondWithFilteredResult(_0x54777b,_0x3357dc){return function(_0x5e7622){if(_0x5e7622){var _0x132756=typeof _0x3357dc['offset']===_0x9426('0x21')&&typeof _0x3357dc[_0x9426('0x22')]==='undefined';var _0xdc9b63=_0x5e7622[_0x9426('0x23')];var _0x279edf=_0x132756?0x0:_0x3357dc[_0x9426('0x24')];var _0x5dd204=_0x132756?_0x5e7622[_0x9426('0x23')]:_0x3357dc[_0x9426('0x24')]+_0x3357dc[_0x9426('0x22')];var _0x5589a3;if(_0x5dd204>=_0xdc9b63){_0x5dd204=_0xdc9b63;_0x5589a3=0xc8;}else{_0x5589a3=0xce;}_0x54777b['status'](_0x5589a3);return _0x54777b[_0x9426('0x25')](_0x9426('0x26'),_0x279edf+'-'+_0x5dd204+'/'+_0xdc9b63)['json'](_0x5e7622);}return null;};}function patchUpdates(_0x3f8af5){return function(_0x1d9495){try{jsonpatch['apply'](_0x1d9495,_0x3f8af5,!![]);}catch(_0x4942a4){return BPromise[_0x9426('0x27')](_0x4942a4);}return _0x1d9495[_0x9426('0x28')]();};}function saveUpdates(_0x5230f1,_0x4a5b00){return function(_0x4623c1){if(_0x4623c1){return _0x4623c1[_0x9426('0x29')](_0x5230f1)[_0x9426('0x2a')](function(_0x31c7e8){return _0x31c7e8;});}return null;};}function removeEntity(_0x69babb,_0x3192c0){return function(_0xdc4e0d){if(_0xdc4e0d){return _0xdc4e0d[_0x9426('0x2b')]()['then'](function(){_0x69babb[_0x9426('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36797b,_0x205e20){return function(_0x583018){if(!_0x583018){_0x36797b['sendStatus'](0x194);}return _0x583018;};}function handleError(_0x35deca,_0x1e0e98){_0x1e0e98=_0x1e0e98||0x1f4;return function(_0x104fab){logger['error'](_0x104fab[_0x9426('0x2c')]);if(_0x104fab[_0x9426('0x2d')]){delete _0x104fab[_0x9426('0x2d')];}_0x35deca[_0x9426('0x1f')](_0x1e0e98)[_0x9426('0x2e')](_0x104fab);};}exports[_0x9426('0x2f')]=function(_0x34fa6b,_0x2e4068){var _0x19deaa={},_0x46e2b3={},_0x571c13={'count':0x0,'rows':[]};var _0x1a3a9d=_['map'](db[_0x9426('0x30')][_0x9426('0x31')],function(_0x281f3d){return{'name':_0x281f3d['fieldName'],'type':_0x281f3d[_0x9426('0x32')][_0x9426('0x33')]};});_0x46e2b3[_0x9426('0x34')]=_[_0x9426('0x35')](_0x1a3a9d,_0x9426('0x2d'));_0x46e2b3[_0x9426('0x36')]=_['keys'](_0x34fa6b[_0x9426('0x36')]);_0x46e2b3[_0x9426('0x37')]=_[_0x9426('0x38')](_0x46e2b3[_0x9426('0x34')],_0x46e2b3[_0x9426('0x36')]);_0x19deaa[_0x9426('0x39')]=_['intersection'](_0x46e2b3[_0x9426('0x34')],qs[_0x9426('0x3a')](_0x34fa6b['query'][_0x9426('0x3a')]));_0x19deaa[_0x9426('0x39')]=_0x19deaa[_0x9426('0x39')][_0x9426('0x3b')]?_0x19deaa[_0x9426('0x39')]:_0x46e2b3[_0x9426('0x34')];if(!_0x34fa6b['query'][_0x9426('0x3c')](_0x9426('0x3d'))){_0x19deaa[_0x9426('0x22')]=qs[_0x9426('0x22')](_0x34fa6b[_0x9426('0x36')][_0x9426('0x22')]);_0x19deaa[_0x9426('0x24')]=qs[_0x9426('0x24')](_0x34fa6b[_0x9426('0x36')][_0x9426('0x24')]);}_0x19deaa['order']=qs[_0x9426('0x3e')](_0x34fa6b['query'][_0x9426('0x3e')]);_0x19deaa[_0x9426('0x3f')]=qs[_0x9426('0x37')](_['pick'](_0x34fa6b['query'],_0x46e2b3[_0x9426('0x37')]),_0x1a3a9d);if(_0x34fa6b[_0x9426('0x36')]['filter']){_0x19deaa[_0x9426('0x3f')]=_[_0x9426('0x40')](_0x19deaa[_0x9426('0x3f')],{'$or':_[_0x9426('0x35')](_0x1a3a9d,function(_0x367945){if(_0x367945[_0x9426('0x32')]!=='VIRTUAL'){var _0x8452d5={};_0x8452d5[_0x367945[_0x9426('0x2d')]]={'$like':'%'+_0x34fa6b[_0x9426('0x36')][_0x9426('0x41')]+'%'};return _0x8452d5;}})});}_0x19deaa=_[_0x9426('0x40')]({},_0x19deaa,_0x34fa6b['options']);var _0x9b3e2d={'where':_0x19deaa[_0x9426('0x3f')]};return db[_0x9426('0x30')][_0x9426('0x23')](_0x9b3e2d)[_0x9426('0x2a')](function(_0x4f2a4a){_0x571c13[_0x9426('0x23')]=_0x4f2a4a;if(_0x34fa6b[_0x9426('0x36')][_0x9426('0x42')]){_0x19deaa['include']=[{'all':!![]}];}return db['ChatInternalMessage'][_0x9426('0x43')](_0x19deaa);})[_0x9426('0x2a')](function(_0x46cb3a){_0x571c13[_0x9426('0x44')]=_0x46cb3a;return _0x571c13;})['then'](respondWithFilteredResult(_0x2e4068,_0x19deaa))[_0x9426('0x45')](handleError(_0x2e4068,null));};exports[_0x9426('0x46')]=function(_0x2d3399,_0x451dec){var _0x446dea={'raw':!![],'where':{'id':_0x2d3399[_0x9426('0x47')]['id']}},_0x15c86d={};_0x15c86d[_0x9426('0x34')]=_[_0x9426('0x48')](db[_0x9426('0x30')][_0x9426('0x31')]);_0x15c86d[_0x9426('0x36')]=_[_0x9426('0x48')](_0x2d3399[_0x9426('0x36')]);_0x15c86d['filters']=_[_0x9426('0x38')](_0x15c86d[_0x9426('0x34')],_0x15c86d[_0x9426('0x36')]);_0x446dea[_0x9426('0x39')]=_['intersection'](_0x15c86d['model'],qs[_0x9426('0x3a')](_0x2d3399[_0x9426('0x36')]['fields']));_0x446dea[_0x9426('0x39')]=_0x446dea[_0x9426('0x39')][_0x9426('0x3b')]?_0x446dea['attributes']:_0x15c86d[_0x9426('0x34')];if(_0x2d3399[_0x9426('0x36')][_0x9426('0x42')]){_0x446dea['include']=[{'all':!![]}];}_0x446dea=_[_0x9426('0x40')]({},_0x446dea,_0x2d3399['options']);return db[_0x9426('0x30')][_0x9426('0x49')](_0x446dea)['then'](handleEntityNotFound(_0x451dec,null))[_0x9426('0x2a')](respondWithResult(_0x451dec,null))[_0x9426('0x45')](handleError(_0x451dec,null));};exports['create']=function(_0x55e8b8,_0x3434f9){return db[_0x9426('0x30')][_0x9426('0x4a')](_0x55e8b8[_0x9426('0x4b')],{})['then'](respondWithResult(_0x3434f9,0xc9))[_0x9426('0x45')](handleError(_0x3434f9,null));};exports['update']=function(_0x166fb0,_0x431c40){if(_0x166fb0[_0x9426('0x4b')]['id']){delete _0x166fb0[_0x9426('0x4b')]['id'];}return db[_0x9426('0x30')]['find']({'where':{'id':_0x166fb0[_0x9426('0x47')]['id']}})[_0x9426('0x2a')](handleEntityNotFound(_0x431c40,null))[_0x9426('0x2a')](saveUpdates(_0x166fb0[_0x9426('0x4b')],null))[_0x9426('0x2a')](respondWithResult(_0x431c40,null))[_0x9426('0x45')](handleError(_0x431c40,null));};exports[_0x9426('0x2b')]=function(_0x28b692,_0x46241d){return db[_0x9426('0x30')][_0x9426('0x49')]({'where':{'id':_0x28b692[_0x9426('0x47')]['id']}})[_0x9426('0x2a')](handleEntityNotFound(_0x46241d,null))[_0x9426('0x2a')](removeEntity(_0x46241d,null))[_0x9426('0x45')](handleError(_0x46241d,null));};exports[_0x9426('0x4c')]=function(_0x31cff7,_0x2e4931){return db['ChatInternalMessage'][_0x9426('0x4c')]()[_0x9426('0x2a')](respondWithResult(_0x2e4931,null))[_0x9426('0x45')](handleError(_0x2e4931,null));};function wrapUser(_0x4b7e22){return function(_0x47d69){var _0x5678cf=_0x4b7e22[_0x9426('0x4d')]({'plain':!![]});_0x5678cf['messages']=[];if(_0x47d69){_0x5678cf['lastMessageAt']=_0x47d69[_0x9426('0x4e')];_0x5678cf[_0x9426('0x4f')]=_0x47d69;}else{_0x5678cf[_0x9426('0x50')]=moment(0x0)[_0x9426('0x51')](_0x9426('0x52'));_0x5678cf[_0x9426('0x4f')]={};}return _0x5678cf;};}exports[_0x9426('0x53')]=function(_0x20b6ca,_0x371e2b,_0xf04584){var _0x39fc17=[];return db[_0x9426('0x54')][_0x9426('0x43')]({'where':{'role':[_0x9426('0x55'),_0x9426('0x56'),_0x9426('0x57')]},'attributes':['id',_0x9426('0x58'),_0x9426('0x2d'),_0x9426('0x59'),'userpic','internal','online','lastLoginAt',_0x9426('0x5a'),_0x9426('0x5b')],'order':qs['sort'](_0x9426('0x5c')),'include':[{'model':db[_0x9426('0x5d')],'as':'VoiceQueues','attributes':['id',_0x9426('0x2d'),'type'],'through':{'attributes':[]}}]})[_0x9426('0x2a')](function(_0x1db3be){if(_0x1db3be){var _0x2c2c03=_0x20b6ca['user']['get']({'plain':!![]});if(!_0x2c2c03)throw new Error(_0x9426('0x5e'));if(_0x2c2c03[_0x9426('0x59')]===_0x9426('0x57')){return db[_0x9426('0x5f')][_0x9426('0x49')]({'where':{'name':_0x9426('0x60'),'userProfileId':_0x2c2c03[_0x9426('0x61')]},'raw':!![]})[_0x9426('0x2a')](function(_0x267209){if(_0x267209){if(_0x267209[_0x9426('0x62')]===0x0){return db[_0x9426('0x63')][_0x9426('0x43')]({'where':{'sectionId':_0x267209['id']},'raw':!![]})[_0x9426('0x2a')](function(_0x474981){var _0x427812=[];if(_[_0x9426('0x64')](_0x474981)){_0x427812=_[_0x9426('0x41')](_0x1db3be,function(_0x2ca010){if(_0x2ca010[_0x9426('0x59')]!==_0x9426('0x55')){return _0x2ca010;}});return _0x427812;}else{for(var _0x3a1319=0x0;_0x3a1319<_0x1db3be[_0x9426('0x3b')];_0x3a1319++){var _0x26cab3=_0x1db3be[_0x3a1319];if(_0x26cab3[_0x9426('0x59')]==='agent'){var _0x4613fd=_[_0x9426('0x49')](_0x474981,function(_0x129c05){return _0x129c05[_0x9426('0x65')]===_0x26cab3['id'];});if(_0x4613fd)_0x427812[_0x9426('0x66')](_0x26cab3);}else{_0x427812[_0x9426('0x66')](_0x26cab3);}}return _0x427812;}});}else{return _0x1db3be;}}else{var _0x4c5053=_[_0x9426('0x41')](_0x1db3be,function(_0x1b0d24){if(_0x1b0d24[_0x9426('0x59')]!==_0x9426('0x55')){return _0x1b0d24;}});return _0x4c5053;}});}else{return _0x1db3be;}}})[_0x9426('0x2a')](function(_0x50155f){var _0x16e236=[];if(_0x50155f){_0x39fc17=_0x50155f;for(var _0x3a6ec=0x0;_0x3a6ec<_0x50155f[_0x9426('0x3b')];_0x3a6ec+=0x1){_0x39fc17[_0x3a6ec][_0x9426('0x67')]=[];_0x16e236[_0x9426('0x66')](db['ChatInternalMessage'][_0x9426('0x49')]({'where':{'FromId':[_0x20b6ca[_0x9426('0x57')]['id'],_0x50155f[_0x3a6ec]['id']],'ToId':[_0x20b6ca['user']['id'],_0x50155f[_0x3a6ec]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x9426('0x68'),_0x9426('0x69'),_0x9426('0x6a'),_0x9426('0x4b')],'order':qs[_0x9426('0x3e')](_0x9426('0x6b')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x9426('0x2a')](wrapUser(_0x50155f[_0x3a6ec])));}return BPromise[_0x9426('0x6c')](_0x16e236);}return[];})['then'](function(_0x5e6eb2){return{'rows':_0x5e6eb2,'count':_0x5e6eb2[_0x9426('0x3b')]};})['then'](respondWithResult(_0x371e2b,null))[_0x9426('0x45')](handleError(_0x371e2b,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 744f3b4..03d2288 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 _0x326b=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners'];(function(_0x340aa5,_0x2d5553){var _0x3a5b7f=function(_0x23758f){while(--_0x23758f){_0x340aa5['push'](_0x340aa5['shift']());}};_0x3a5b7f(++_0x2d5553);}(_0x326b,0x1dc));var _0xb326=function(_0x16d411,_0x5e0970){_0x16d411=_0x16d411-0x0;var _0x20336d=_0x326b[_0x16d411];return _0x20336d;};'use strict';var EventEmitter=require(_0xb326('0x0'));var ChatInternalMessage=require(_0xb326('0x1'))['db'][_0xb326('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xb326('0x3')](0x0);var events={'afterCreate':_0xb326('0x4'),'afterUpdate':_0xb326('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3fdbc2){return function(_0x50e112,_0x217543,_0x51ffb8){ChatInternalMessageEvents[_0xb326('0x6')](_0x3fdbc2+':'+_0x50e112['id'],_0x50e112);ChatInternalMessageEvents['emit'](_0x3fdbc2,_0x50e112);_0x51ffb8(null);};}for(var e in events){if(events[_0xb326('0x7')](e)){var event=events[e];ChatInternalMessage[_0xb326('0x8')](e,emitEvent(event));}}module[_0xb326('0x9')]=ChatInternalMessageEvents; \ No newline at end of file +var _0xc8d2=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage'];(function(_0x434351,_0x1ab289){var _0x3df67f=function(_0x2f31a0){while(--_0x2f31a0){_0x434351['push'](_0x434351['shift']());}};_0x3df67f(++_0x1ab289);}(_0xc8d2,0xf7));var _0x2c8d=function(_0x1ee367,_0x2e5568){_0x1ee367=_0x1ee367-0x0;var _0x5b51bc=_0xc8d2[_0x1ee367];return _0x5b51bc;};'use strict';var EventEmitter=require(_0x2c8d('0x0'));var ChatInternalMessage=require(_0x2c8d('0x1'))['db'][_0x2c8d('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x2c8d('0x3')](0x0);var events={'afterCreate':_0x2c8d('0x4'),'afterUpdate':'update','afterDestroy':_0x2c8d('0x5')};function emitEvent(_0x3b4c6e){return function(_0xc23346,_0x1fe7a7,_0x38f2f9){ChatInternalMessageEvents['emit'](_0x3b4c6e+':'+_0xc23346['id'],_0xc23346);ChatInternalMessageEvents[_0x2c8d('0x6')](_0x3b4c6e,_0xc23346);_0x38f2f9(null);};}for(var e in events){if(events[_0x2c8d('0x7')](e)){var event=events[e];ChatInternalMessage[_0x2c8d('0x8')](e,emitEvent(event));}}module[_0x2c8d('0x9')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 7a0c0b5..3172ddd 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 _0xc101=['rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','chat_internal_messages','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','path'];(function(_0x41be79,_0x51393e){var _0x37ffca=function(_0x4a6d78){while(--_0x4a6d78){_0x41be79['push'](_0x41be79['shift']());}};_0x37ffca(++_0x51393e);}(_0xc101,0x1f3));var _0x1c10=function(_0x3e91a9,_0x53c466){_0x3e91a9=_0x3e91a9-0x0;var _0x25c9ad=_0xc101[_0x3e91a9];return _0x25c9ad;};'use strict';var _=require('lodash');var util=require(_0x1c10('0x0'));var logger=require(_0x1c10('0x1'))('api');var moment=require(_0x1c10('0x2'));var BPromise=require(_0x1c10('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1c10('0x4'));var rimraf=require(_0x1c10('0x5'));var config=require(_0x1c10('0x6'));var attributes=require(_0x1c10('0x7'));module[_0x1c10('0x8')]=function(_0x259de2,_0x3f9418){return _0x259de2[_0x1c10('0x9')]('ChatInternalMessage',attributes,{'tableName':_0x1c10('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x1c10('0xb')});}; \ No newline at end of file +var _0x930f=['./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','lodash','api','moment','rimraf','../../config/environment'];(function(_0x5f4db8,_0x50de79){var _0x558cec=function(_0x585309){while(--_0x585309){_0x5f4db8['push'](_0x5f4db8['shift']());}};_0x558cec(++_0x50de79);}(_0x930f,0x1a8));var _0xf930=function(_0x360c70,_0x546df5){_0x360c70=_0x360c70-0x0;var _0xa5adc8=_0x930f[_0x360c70];return _0xa5adc8;};'use strict';var _=require(_0xf930('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf930('0x1'));var moment=require(_0xf930('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf930('0x3'));var config=require(_0xf930('0x4'));var attributes=require(_0xf930('0x5'));module[_0xf930('0x6')]=function(_0x24a83d,_0x441f44){return _0x24a83d[_0xf930('0x7')](_0xf930('0x8'),attributes,{'tableName':_0xf930('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf930('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index bd4b1f6..527d41b 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 _0x57b8=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error'];(function(_0x93b411,_0x4263ca){var _0x14ce11=function(_0x3f71c4){while(--_0x3f71c4){_0x93b411['push'](_0x93b411['shift']());}};_0x14ce11(++_0x4263ca);}(_0x57b8,0x17c));var _0x857b=function(_0x49f3cc,_0x46f3e0){_0x49f3cc=_0x49f3cc-0x0;var _0x499553=_0x57b8[_0x49f3cc];return _0x499553;};'use strict';var _=require(_0x857b('0x0'));var util=require(_0x857b('0x1'));var moment=require(_0x857b('0x2'));var BPromise=require(_0x857b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x857b('0x4'));var db=require(_0x857b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x857b('0x6'))(_0x857b('0x7'));var config=require(_0x857b('0x8'));var jayson=require(_0x857b('0x9'));var client=jayson[_0x857b('0xa')][_0x857b('0xb')]({'port':0x232a});config[_0x857b('0xc')]=_[_0x857b('0xd')](config[_0x857b('0xc')],{'host':_0x857b('0xe'),'port':0x18eb});var socket=require(_0x857b('0xf'))(new Redis(config['redis']));require(_0x857b('0x10'))[_0x857b('0x11')](socket);function respondWithRpcPromise(_0x5167fe,_0x4cd93b,_0x31f976){return new BPromise(function(_0x3710be,_0x1e994b){return client[_0x857b('0x12')](_0x5167fe,_0x31f976)[_0x857b('0x13')](function(_0x39a5be){logger[_0x857b('0x14')](_0x857b('0x15'),_0x4cd93b,_0x857b('0x16'));logger[_0x857b('0x17')](_0x857b('0x18'),_0x4cd93b,_0x857b('0x16'),JSON['stringify'](_0x39a5be));if(_0x39a5be[_0x857b('0x19')]){if(_0x39a5be['error']['code']===0x1f4){logger[_0x857b('0x19')](_0x857b('0x15'),_0x4cd93b,_0x39a5be['error'][_0x857b('0x1a')]);return _0x1e994b(_0x39a5be[_0x857b('0x19')][_0x857b('0x1a')]);}logger['error'](_0x857b('0x15'),_0x4cd93b,_0x39a5be[_0x857b('0x19')][_0x857b('0x1a')]);return _0x3710be(_0x39a5be[_0x857b('0x19')][_0x857b('0x1a')]);}else{logger[_0x857b('0x14')](_0x857b('0x15'),_0x4cd93b,_0x857b('0x16'));_0x3710be(_0x39a5be[_0x857b('0x1b')][_0x857b('0x1a')]);}})[_0x857b('0x1c')](function(_0x5938f4){logger[_0x857b('0x19')]('ChatInternalMessage,\x20%s,\x20%s',_0x4cd93b,_0x5938f4);_0x1e994b(_0x5938f4);});});} \ No newline at end of file +var _0x6a5c=['localhost','register','then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatInternalMessage,\x20%s,\x20%s','result','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults'];(function(_0x3e705b,_0x461287){var _0x111d59=function(_0x4b5f2b){while(--_0x4b5f2b){_0x3e705b['push'](_0x3e705b['shift']());}};_0x111d59(++_0x461287);}(_0x6a5c,0x9d));var _0xc6a5=function(_0x5c16ad,_0x24312a){_0x5c16ad=_0x5c16ad-0x0;var _0xf9d36e=_0x6a5c[_0x5c16ad];return _0xf9d36e;};'use strict';var _=require('lodash');var util=require(_0xc6a5('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc6a5('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc6a5('0x2'))['db'];var utils=require(_0xc6a5('0x3'));var logger=require(_0xc6a5('0x4'))(_0xc6a5('0x5'));var config=require(_0xc6a5('0x6'));var jayson=require(_0xc6a5('0x7'));var client=jayson[_0xc6a5('0x8')]['http']({'port':0x232a});config[_0xc6a5('0x9')]=_[_0xc6a5('0xa')](config['redis'],{'host':_0xc6a5('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0xc6a5('0xc')](socket);function respondWithRpcPromise(_0x25a9a7,_0x343355,_0x20c0cf){return new BPromise(function(_0x45f517,_0x25d88a){return client['request'](_0x25a9a7,_0x20c0cf)[_0xc6a5('0xd')](function(_0x3e1165){logger[_0xc6a5('0xe')]('ChatInternalMessage,\x20%s,\x20%s',_0x343355,_0xc6a5('0xf'));logger[_0xc6a5('0x10')](_0xc6a5('0x11'),_0x343355,_0xc6a5('0xf'),JSON[_0xc6a5('0x12')](_0x3e1165));if(_0x3e1165['error']){if(_0x3e1165[_0xc6a5('0x13')][_0xc6a5('0x14')]===0x1f4){logger[_0xc6a5('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x343355,_0x3e1165['error']['message']);return _0x25d88a(_0x3e1165['error'][_0xc6a5('0x15')]);}logger['error'](_0xc6a5('0x16'),_0x343355,_0x3e1165[_0xc6a5('0x13')][_0xc6a5('0x15')]);return _0x45f517(_0x3e1165[_0xc6a5('0x13')][_0xc6a5('0x15')]);}else{logger['info'](_0xc6a5('0x16'),_0x343355,_0xc6a5('0xf'));_0x45f517(_0x3e1165[_0xc6a5('0x17')][_0xc6a5('0x15')]);}})['catch'](function(_0x2efade){logger[_0xc6a5('0x13')](_0xc6a5('0x16'),_0x343355,_0x2efade);_0x25d88a(_0x2efade);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index bc9fe12..6fdcbc7 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 _0xb6af=['register','length','chatInternalMessage:','./chatInternalMessage.events','save','update','emit','removeListener'];(function(_0x5a636f,_0x3fec2b){var _0x6a8cfb=function(_0x20e6ca){while(--_0x20e6ca){_0x5a636f['push'](_0x5a636f['shift']());}};_0x6a8cfb(++_0x3fec2b);}(_0xb6af,0x7b));var _0xfb6a=function(_0x176317,_0x4897b3){_0x176317=_0x176317-0x0;var _0xef2759=_0xb6af[_0x176317];return _0xef2759;};'use strict';var ChatInternalMessageEvents=require(_0xfb6a('0x0'));var events=[_0xfb6a('0x1'),'remove',_0xfb6a('0x2')];function createListener(_0x8d95b5,_0x16c3fc){return function(_0x24ba0c){_0x16c3fc[_0xfb6a('0x3')](_0x8d95b5,_0x24ba0c);};}function removeListener(_0xd2980,_0x3cdf5a){return function(){ChatInternalMessageEvents[_0xfb6a('0x4')](_0xd2980,_0x3cdf5a);};}exports[_0xfb6a('0x5')]=function(_0x2e00e0){for(var _0x30fe14=0x0,_0x48e55a=events[_0xfb6a('0x6')];_0x30fe14<_0x48e55a;_0x30fe14++){var _0x42ce82=events[_0x30fe14];var _0x5648c7=createListener(_0xfb6a('0x7')+_0x42ce82,_0x2e00e0);ChatInternalMessageEvents['on'](_0x42ce82,_0x5648c7);}}; \ No newline at end of file +var _0x27de=['./chatInternalMessage.events','remove','removeListener','register','length','chatInternalMessage:'];(function(_0x179560,_0x4090a1){var _0x46413e=function(_0x1653f1){while(--_0x1653f1){_0x179560['push'](_0x179560['shift']());}};_0x46413e(++_0x4090a1);}(_0x27de,0x1c8));var _0xe27d=function(_0x23e5d6,_0x581445){_0x23e5d6=_0x23e5d6-0x0;var _0x51d225=_0x27de[_0x23e5d6];return _0x51d225;};'use strict';var ChatInternalMessageEvents=require(_0xe27d('0x0'));var events=['save',_0xe27d('0x1'),'update'];function createListener(_0x14c527,_0x3a7f6b){return function(_0x2da084){_0x3a7f6b['emit'](_0x14c527,_0x2da084);};}function removeListener(_0x3f4d,_0x27c708){return function(){ChatInternalMessageEvents[_0xe27d('0x2')](_0x3f4d,_0x27c708);};}exports[_0xe27d('0x3')]=function(_0x1d5be0){for(var _0x40fd9d=0x0,_0x511d9d=events[_0xe27d('0x4')];_0x40fd9d<_0x511d9d;_0x40fd9d++){var _0x127d29=events[_0x40fd9d];var _0x355ccb=createListener(_0xe27d('0x5')+_0x127d29,_0x1d5be0);ChatInternalMessageEvents['on'](_0x127d29,_0x355ccb);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index d1f2a39..3a03c27 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 _0x5607=['getUsers','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','fs-extra','../../config/environment','./chatInternalMessage.controller','get','/describe','isAuthenticated','describe'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0x5607,0x186));var _0x7560=function(_0x1d69e1,_0x450840){_0x1d69e1=_0x1d69e1-0x0;var _0x23f4e1=_0x5607[_0x1d69e1];return _0x23f4e1;};'use strict';var multer=require(_0x7560('0x0'));var util=require(_0x7560('0x1'));var path=require('path');var timeout=require(_0x7560('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7560('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7560('0x4'));var controller=require(_0x7560('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x7560('0x6')](_0x7560('0x7'),auth[_0x7560('0x8')](),controller[_0x7560('0x9')]);router[_0x7560('0x6')]('/users',auth[_0x7560('0x8')](),controller[_0x7560('0xa')]);router[_0x7560('0x6')](_0x7560('0xb'),auth['isAuthenticated'](),controller[_0x7560('0xc')]);router[_0x7560('0xd')]('/',auth[_0x7560('0x8')](),controller[_0x7560('0xe')]);router[_0x7560('0xf')](_0x7560('0xb'),controller[_0x7560('0x10')]);router[_0x7560('0x11')]('/:id',auth[_0x7560('0x8')](),controller[_0x7560('0x12')]);module[_0x7560('0x13')]=router; \ No newline at end of file +var _0x6f0b=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/users','getUsers','show','post','create','put','/:id','update','delete','destroy','exports','multer','util'];(function(_0x40e41e,_0x3d30e7){var _0x18b70c=function(_0x2b4b66){while(--_0x2b4b66){_0x40e41e['push'](_0x40e41e['shift']());}};_0x18b70c(++_0x3d30e7);}(_0x6f0b,0x94));var _0xb6f0=function(_0x31b3d5,_0x488d43){_0x31b3d5=_0x31b3d5-0x0;var _0x274a25=_0x6f0b[_0x31b3d5];return _0x274a25;};'use strict';var multer=require(_0xb6f0('0x0'));var util=require(_0xb6f0('0x1'));var path=require(_0xb6f0('0x2'));var timeout=require('connect-timeout');var express=require(_0xb6f0('0x3'));var router=express[_0xb6f0('0x4')]();var fs_extra=require(_0xb6f0('0x5'));var auth=require(_0xb6f0('0x6'));var interaction=require(_0xb6f0('0x7'));var config=require(_0xb6f0('0x8'));var controller=require('./chatInternalMessage.controller');router[_0xb6f0('0x9')]('/',auth[_0xb6f0('0xa')](),controller[_0xb6f0('0xb')]);router[_0xb6f0('0x9')](_0xb6f0('0xc'),auth[_0xb6f0('0xa')](),controller[_0xb6f0('0xd')]);router[_0xb6f0('0x9')](_0xb6f0('0xe'),auth[_0xb6f0('0xa')](),controller[_0xb6f0('0xf')]);router[_0xb6f0('0x9')]('/:id',auth[_0xb6f0('0xa')](),controller[_0xb6f0('0x10')]);router[_0xb6f0('0x11')]('/',auth[_0xb6f0('0xa')](),controller[_0xb6f0('0x12')]);router[_0xb6f0('0x13')](_0xb6f0('0x14'),controller[_0xb6f0('0x15')]);router[_0xb6f0('0x16')](_0xb6f0('0x14'),auth['isAuthenticated'](),controller[_0xb6f0('0x17')]);module[_0xb6f0('0x18')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index af6dbb0..5e660e0 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 _0x97e6=['out','DATE','sequelize','TEXT','medium','BOOLEAN','ENUM'];(function(_0x5e9b18,_0x3874b4){var _0x2f342b=function(_0x17808f){while(--_0x17808f){_0x5e9b18['push'](_0x5e9b18['shift']());}};_0x2f342b(++_0x3874b4);}(_0x97e6,0x159));var _0x697e=function(_0x2c9d95,_0xcc4c3){_0x2c9d95=_0x2c9d95-0x0;var _0x1b9a2e=_0x97e6[_0x2c9d95];return _0x1b9a2e;};'use strict';var Sequelize=require(_0x697e('0x0'));module['exports']={'body':{'type':Sequelize[_0x697e('0x1')](_0x697e('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x697e('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x697e('0x4')]('in',_0x697e('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x697e('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x697e('0x1')]}}; \ No newline at end of file +var _0x574d=['out','DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x574d,0xc0));var _0xd574=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x574d[_0x565ed7];return _0x183ad7;};'use strict';var Sequelize=require(_0xd574('0x0'));module[_0xd574('0x1')]={'body':{'type':Sequelize[_0xd574('0x2')](_0xd574('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xd574('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xd574('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd574('0x5')]('in','out'),'defaultValue':_0xd574('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xd574('0x7')]},'providerName':{'type':Sequelize[_0xd574('0x8')]},'providerResponse':{'type':Sequelize[_0xd574('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 3a4fa2f..de0e93f 100644 --- a/server/api/chatMessage/chatMessage.controller.js +++ b/server/api/chatMessage/chatMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','chat','ChatInteraction','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','fullname','rejectmessage','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','map','ChatMessage','fieldName','type','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','body','find','describe','../../config/logger','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteractionId','isNil','read1stAt','format'];(function(_0x2b3661,_0x1842ac){var _0xb12ecb=function(_0x127636){while(--_0x127636){_0x2b3661['push'](_0x2b3661['shift']());}};_0xb12ecb(++_0x1842ac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x0a9e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5d0880,_0x1985b6,_0x519dfd,_0x16033c){return new BPromise(function(_0x12066b,_0x48f32d){var _0x225616=_0x16033c||client;return _0x225616['request'](_0x5d0880,_0x519dfd)[_0x0a9e('0x1d')](function(_0x478723){logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x1985b6,_0x0a9e('0x20'),JSON[_0x0a9e('0x23')](_0x478723));if(_0x478723[_0x0a9e('0x24')]){if(_0x478723[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')]['message']);return _0x48f32d(_0x478723[_0x0a9e('0x24')]['message']);}logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')][_0x0a9e('0x26')]);return _0x12066b(_0x478723[_0x0a9e('0x24')]['message']);}else{logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));_0x12066b(_0x478723[_0x0a9e('0x27')][_0x0a9e('0x26')]);}})[_0x0a9e('0x28')](function(_0x16b1ca){logger['error']('ChatMessage,\x20%s,\x20%s',_0x1985b6,_0x16b1ca);_0x48f32d(_0x16b1ca);});});}function respondWithStatusCode(_0x197ec0,_0x3a8e58){_0x3a8e58=_0x3a8e58||0xcc;return function(_0x40c424){if(_0x40c424){return _0x197ec0[_0x0a9e('0x29')](_0x3a8e58);}return _0x197ec0['status'](_0x3a8e58)[_0x0a9e('0x2a')]();};}function respondWithResult(_0x479bc4,_0x45a1e7){_0x45a1e7=_0x45a1e7||0xc8;return function(_0x5bfb33){if(_0x5bfb33){return _0x479bc4[_0x0a9e('0x2b')](_0x45a1e7)[_0x0a9e('0x2c')](_0x5bfb33);}};}function respondWithFilteredResult(_0x25fba9,_0x14433c){return function(_0x140511){if(_0x140511){var _0x1538a4=typeof _0x14433c[_0x0a9e('0x2d')]===_0x0a9e('0x2e')&&typeof _0x14433c['limit']===_0x0a9e('0x2e');var _0x468813=_0x140511[_0x0a9e('0x2f')];var _0x2ec755=_0x1538a4?0x0:_0x14433c['offset'];var _0x15b200=_0x1538a4?_0x140511[_0x0a9e('0x2f')]:_0x14433c[_0x0a9e('0x2d')]+_0x14433c[_0x0a9e('0x30')];var _0x58b06f;if(_0x15b200>=_0x468813){_0x15b200=_0x468813;_0x58b06f=0xc8;}else{_0x58b06f=0xce;}_0x25fba9[_0x0a9e('0x2b')](_0x58b06f);return _0x25fba9[_0x0a9e('0x31')](_0x0a9e('0x32'),_0x2ec755+'-'+_0x15b200+'/'+_0x468813)[_0x0a9e('0x2c')](_0x140511);}return null;};}function patchUpdates(_0x540530){return function(_0x426950){try{jsonpatch['apply'](_0x426950,_0x540530,!![]);}catch(_0x2407f9){return BPromise[_0x0a9e('0x33')](_0x2407f9);}return _0x426950[_0x0a9e('0x34')]();};}function saveUpdates(_0x33bdb7,_0x25ce3a){return function(_0x5180f1){if(_0x5180f1){return _0x5180f1[_0x0a9e('0x35')](_0x33bdb7)[_0x0a9e('0x1d')](function(_0x40cb85){return _0x40cb85;});}return null;};}function removeEntity(_0x2da5c0,_0x2b45ea){return function(_0x409319){if(_0x409319){return _0x409319[_0x0a9e('0x36')]()[_0x0a9e('0x1d')](function(){_0x2da5c0['status'](0xcc)[_0x0a9e('0x2a')]();});}};}function handleEntityNotFound(_0x5e7238,_0x2cc7a0){return function(_0x14b13f){if(!_0x14b13f){_0x5e7238[_0x0a9e('0x29')](0x194);}return _0x14b13f;};}function handleError(_0x3f3d41,_0x567193){_0x567193=_0x567193||0x1f4;return function(_0x191e91){logger[_0x0a9e('0x24')](_0x191e91[_0x0a9e('0x37')]);if(_0x191e91[_0x0a9e('0x38')]){delete _0x191e91['name'];}_0x3f3d41['status'](_0x567193)[_0x0a9e('0x39')](_0x191e91);};}exports['index']=function(_0x24936a,_0x3d9717){var _0x381c37={},_0x1ef87a={},_0x4f41ae={'count':0x0,'rows':[]};var _0x31916f=_[_0x0a9e('0x3a')](db[_0x0a9e('0x3b')]['rawAttributes'],function(_0x1dbf74){return{'name':_0x1dbf74[_0x0a9e('0x3c')],'type':_0x1dbf74[_0x0a9e('0x3d')]['key']};});_0x1ef87a['model']=_[_0x0a9e('0x3a')](_0x31916f,_0x0a9e('0x38'));_0x1ef87a['query']=_[_0x0a9e('0x3e')](_0x24936a[_0x0a9e('0x3f')]);_0x1ef87a[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],_0x1ef87a['query']);_0x381c37[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],qs[_0x0a9e('0x43')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x43')]));_0x381c37['attributes']=_0x381c37[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x381c37[_0x0a9e('0x42')]:_0x1ef87a[_0x0a9e('0x45')];if(!_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x46')](_0x0a9e('0x47'))){_0x381c37[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x30')]);_0x381c37[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x2d')]);}_0x381c37['order']=qs['sort'](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x48')]);_0x381c37[_0x0a9e('0x49')]=qs[_0x0a9e('0x40')](_[_0x0a9e('0x4a')](_0x24936a[_0x0a9e('0x3f')],_0x1ef87a[_0x0a9e('0x40')]),_0x31916f);if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]){_0x381c37[_0x0a9e('0x49')]=_[_0x0a9e('0x4c')](_0x381c37[_0x0a9e('0x49')],{'$or':_['map'](_0x31916f,function(_0x117c99){if(_0x117c99[_0x0a9e('0x3d')]!==_0x0a9e('0x4d')){var _0xfbd5ad={};_0xfbd5ad[_0x117c99[_0x0a9e('0x38')]]={'$like':'%'+_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]+'%'};return _0xfbd5ad;}})});}_0x381c37=_[_0x0a9e('0x4c')]({},_0x381c37,_0x24936a['options']);var _0x2e9d90={'where':_0x381c37['where']};return db[_0x0a9e('0x3b')][_0x0a9e('0x2f')](_0x2e9d90)[_0x0a9e('0x1d')](function(_0x562fb4){_0x4f41ae[_0x0a9e('0x2f')]=_0x562fb4;if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4e')]){_0x381c37[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0x3b')][_0x0a9e('0x50')](_0x381c37);})[_0x0a9e('0x1d')](function(_0x5bbcde){_0x4f41ae[_0x0a9e('0x51')]=_0x5bbcde;return _0x4f41ae;})[_0x0a9e('0x1d')](respondWithFilteredResult(_0x3d9717,_0x381c37))[_0x0a9e('0x28')](handleError(_0x3d9717,null));};exports[_0x0a9e('0x52')]=function(_0x409789,_0x992c77){var _0x6054ee={'raw':!![],'where':{'id':_0x409789[_0x0a9e('0x53')]['id']}},_0x19383e={};_0x19383e['model']=_[_0x0a9e('0x3e')](db[_0x0a9e('0x3b')]['rawAttributes']);_0x19383e['query']=_['keys'](_0x409789[_0x0a9e('0x3f')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],_0x19383e[_0x0a9e('0x3f')]);_0x6054ee[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],qs['fields'](_0x409789['query']['fields']));_0x6054ee[_0x0a9e('0x42')]=_0x6054ee[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x6054ee['attributes']:_0x19383e[_0x0a9e('0x45')];if(_0x409789[_0x0a9e('0x3f')]['includeAll']){_0x6054ee['include']=[{'all':!![]}];}_0x6054ee=_[_0x0a9e('0x4c')]({},_0x6054ee,_0x409789['options']);return db[_0x0a9e('0x3b')]['find'](_0x6054ee)[_0x0a9e('0x1d')](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x1d')](respondWithResult(_0x992c77,null))[_0x0a9e('0x28')](handleError(_0x992c77,null));};exports['create']=function(_0x2f82da,_0x1bf38a){return db['ChatMessage']['create'](_0x2f82da[_0x0a9e('0x54')],{})[_0x0a9e('0x1d')](respondWithResult(_0x1bf38a,0xc9))['catch'](handleError(_0x1bf38a,null));};exports[_0x0a9e('0x35')]=function(_0x5ce9ac,_0x211ef9){if(_0x5ce9ac['body']['id']){delete _0x5ce9ac[_0x0a9e('0x54')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x5ce9ac['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x211ef9,null))['then'](saveUpdates(_0x5ce9ac[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](respondWithResult(_0x211ef9,null))[_0x0a9e('0x28')](handleError(_0x211ef9,null));};exports[_0x0a9e('0x36')]=function(_0x232830,_0x272738){return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x232830['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x272738,null))[_0x0a9e('0x1d')](removeEntity(_0x272738,null))[_0x0a9e('0x28')](handleError(_0x272738,null));};exports[_0x0a9e('0x56')]=function(_0xb83dfd,_0x156662){return db['ChatMessage'][_0x0a9e('0x56')]()[_0x0a9e('0x1d')](respondWithResult(_0x156662,null))['catch'](handleError(_0x156662,null));};var interaction_log=require(_0x0a9e('0x57'))('chat-interactions');exports[_0x0a9e('0x58')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee){var _0x273cb5={'agent':{},'channel':'chat'};if(_0x5ba1f9[_0x0a9e('0x54')]['id']){delete _0x5ba1f9[_0x0a9e('0x54')]['id'];}_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x59')]=!![];_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5a')]=moment()['format'](_0x0a9e('0x5b'));_0x5ba1f9['body'][_0x0a9e('0x5c')]=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')]||_0x5ba1f9['user']['id'];_0x273cb5[_0x0a9e('0x5d')]['id']=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')];return db[_0x0a9e('0x3b')]['find']({'where':{'id':_0x5ba1f9[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](saveUpdates(_0x5ba1f9[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](function(_0x88dcbf){if(_0x88dcbf){_0x273cb5[_0x0a9e('0x26')]=_0x88dcbf[_0x0a9e('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x0a9e('0x55')]({'where':{'id':_0x88dcbf[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](function(_0x3528b7){if(_0x3528b7){return _0x3528b7['update']({'UserId':_0x5ba1f9['body'][_0x0a9e('0x5c')],'read1stAt':_[_0x0a9e('0x60')](_0x3528b7[_0x0a9e('0x61')])?moment()[_0x0a9e('0x62')](_0x0a9e('0x5b')):undefined});}return null;})[_0x0a9e('0x1d')](function(_0x387489){if(_0x387489){_0x273cb5[_0x0a9e('0x63')]=_0x387489[_0x0a9e('0x5e')]({'plain':!![]});interaction_log[_0x0a9e('0x1e')](_0x0a9e('0x64'),_0x5ba1f9[_0x0a9e('0x65')]['id'],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x66')],_0x273cb5[_0x0a9e('0x63')]['id'],_0x5ba1f9[_0x0a9e('0x54')]?JSON['stringify'](_0x5ba1f9[_0x0a9e('0x54')]):_0x0a9e('0x67'));return respondWithRpcPromise(_0x0a9e('0x68'),'acceptMessage',_0x273cb5);}return null;})[_0x0a9e('0x1d')](function(_0x30944e){var _0x4b341d=_0x0a9e('0x69')+_0x30944e[_0x0a9e('0x26')][_0x0a9e('0x6a')];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0x4b341d,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x0a9e('0x1d')](function(_0x18bf5d){return _0x18bf5d;});})[_0x0a9e('0x1d')](function(_0x23a7d3){if(_0x23a7d3){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x23a7d3[0x0];if(!_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),'fullname',_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})['then'](function(_0x2ed01e){if(!_0x2ed01e)return null;_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x2ed01e;return _0x273cb5;})[_0x0a9e('0x1d')](function(_0x542ece){if(_0x542ece){if(_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x6f')]){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x70')]=util['format'](_0x0a9e('0x71'),_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')]);_0x273cb5[_0x0a9e('0x26')]['channel']=_0x273cb5[_0x0a9e('0x72')];_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x58');return respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x75'),'message':_[_0x0a9e('0x4c')](_0x273cb5[_0x0a9e('0x26')],JSON[_0x0a9e('0x76')](_0x273cb5[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002)[_0x0a9e('0x1d')](function(){return _0x273cb5;});}return _0x273cb5;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x4b3c1a,null))['catch'](handleError(_0x4b3c1a,null));};var interaction_log=require(_0x0a9e('0x57'))(_0x0a9e('0x78'));exports[_0x0a9e('0x33')]=function(_0x563627,_0x3736e0,_0x33dda0){var _0x8cea96={'agent':{},'channel':_0x0a9e('0x79')};if(_0x563627['body']['id']){delete _0x563627['body']['id'];}_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')]=_0x563627['body'][_0x0a9e('0x5c')]||_0x563627['user']['id'];_0x8cea96[_0x0a9e('0x5d')]['id']=_0x563627[_0x0a9e('0x54')]['UserId'];return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))[_0x0a9e('0x1d')](function(_0x1f42a0){if(_0x1f42a0){_0x8cea96[_0x0a9e('0x26')]=_0x1f42a0['get']({'plain':!![]});return db[_0x0a9e('0x7a')][_0x0a9e('0x55')]({'where':{'id':_0x1f42a0[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))['then'](function(_0xf51744){if(_0xf51744){_0x8cea96[_0x0a9e('0x63')]=_0xf51744['get']({'plain':!![]});interaction_log[_0x0a9e('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x563627[_0x0a9e('0x65')]['id'],_0x563627[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x563627[_0x0a9e('0x65')]['role'],_0x8cea96['interaction']['id'],_0x563627[_0x0a9e('0x54')]?JSON[_0x0a9e('0x23')](_0x563627[_0x0a9e('0x54')]):'null');return respondWithRpcPromise(_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x8cea96);}return null;})['then'](function(_0x4e46b2){var _0xf0a802='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e46b2['message']['ContactId'];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0xf0a802,{'type':db[_0x0a9e('0x7d')][_0x0a9e('0x7e')][_0x0a9e('0x7f')],'raw':!![]})[_0x0a9e('0x1d')](function(_0x5a8854){return _0x5a8854;});})[_0x0a9e('0x1d')](function(_0x5955f1){if(_0x5955f1){_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x5955f1[0x0];if(!_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),_0x0a9e('0x80'),_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})[_0x0a9e('0x1d')](function(_0x1910bf){if(!_0x1910bf)return null;_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x1910bf;return _0x8cea96;})['then'](function(_0x2645d6){if(_0x2645d6){_0x2645d6[_0x0a9e('0x26')]['interface']=util[_0x0a9e('0x62')](_0x0a9e('0x71'),_0x563627[_0x0a9e('0x65')]['name']);_0x2645d6[_0x0a9e('0x26')]['channel']=_0x8cea96[_0x0a9e('0x72')];_0x2645d6[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x33');respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x81'),'message':_[_0x0a9e('0x4c')](_0x8cea96['message'],JSON[_0x0a9e('0x76')](_0x8cea96[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002);return _0x8cea96;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x3736e0,null))[_0x0a9e('0x28')](handleError(_0x3736e0,null));}; \ No newline at end of file +var _0xa9e0=['interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','chat','ChatInteraction','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','fullname','rejectmessage','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','map','ChatMessage','fieldName','type','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','body','find','describe','../../config/logger','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteractionId','isNil','read1stAt','format'];(function(_0x389882,_0x30c7b5){var _0x3ee355=function(_0x1d6205){while(--_0x1d6205){_0x389882['push'](_0x389882['shift']());}};_0x3ee355(++_0x30c7b5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x0a9e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5d0880,_0x1985b6,_0x519dfd,_0x16033c){return new BPromise(function(_0x12066b,_0x48f32d){var _0x225616=_0x16033c||client;return _0x225616['request'](_0x5d0880,_0x519dfd)[_0x0a9e('0x1d')](function(_0x478723){logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x1985b6,_0x0a9e('0x20'),JSON[_0x0a9e('0x23')](_0x478723));if(_0x478723[_0x0a9e('0x24')]){if(_0x478723[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')]['message']);return _0x48f32d(_0x478723[_0x0a9e('0x24')]['message']);}logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')][_0x0a9e('0x26')]);return _0x12066b(_0x478723[_0x0a9e('0x24')]['message']);}else{logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));_0x12066b(_0x478723[_0x0a9e('0x27')][_0x0a9e('0x26')]);}})[_0x0a9e('0x28')](function(_0x16b1ca){logger['error']('ChatMessage,\x20%s,\x20%s',_0x1985b6,_0x16b1ca);_0x48f32d(_0x16b1ca);});});}function respondWithStatusCode(_0x197ec0,_0x3a8e58){_0x3a8e58=_0x3a8e58||0xcc;return function(_0x40c424){if(_0x40c424){return _0x197ec0[_0x0a9e('0x29')](_0x3a8e58);}return _0x197ec0['status'](_0x3a8e58)[_0x0a9e('0x2a')]();};}function respondWithResult(_0x479bc4,_0x45a1e7){_0x45a1e7=_0x45a1e7||0xc8;return function(_0x5bfb33){if(_0x5bfb33){return _0x479bc4[_0x0a9e('0x2b')](_0x45a1e7)[_0x0a9e('0x2c')](_0x5bfb33);}};}function respondWithFilteredResult(_0x25fba9,_0x14433c){return function(_0x140511){if(_0x140511){var _0x1538a4=typeof _0x14433c[_0x0a9e('0x2d')]===_0x0a9e('0x2e')&&typeof _0x14433c['limit']===_0x0a9e('0x2e');var _0x468813=_0x140511[_0x0a9e('0x2f')];var _0x2ec755=_0x1538a4?0x0:_0x14433c['offset'];var _0x15b200=_0x1538a4?_0x140511[_0x0a9e('0x2f')]:_0x14433c[_0x0a9e('0x2d')]+_0x14433c[_0x0a9e('0x30')];var _0x58b06f;if(_0x15b200>=_0x468813){_0x15b200=_0x468813;_0x58b06f=0xc8;}else{_0x58b06f=0xce;}_0x25fba9[_0x0a9e('0x2b')](_0x58b06f);return _0x25fba9[_0x0a9e('0x31')](_0x0a9e('0x32'),_0x2ec755+'-'+_0x15b200+'/'+_0x468813)[_0x0a9e('0x2c')](_0x140511);}return null;};}function patchUpdates(_0x540530){return function(_0x426950){try{jsonpatch['apply'](_0x426950,_0x540530,!![]);}catch(_0x2407f9){return BPromise[_0x0a9e('0x33')](_0x2407f9);}return _0x426950[_0x0a9e('0x34')]();};}function saveUpdates(_0x33bdb7,_0x25ce3a){return function(_0x5180f1){if(_0x5180f1){return _0x5180f1[_0x0a9e('0x35')](_0x33bdb7)[_0x0a9e('0x1d')](function(_0x40cb85){return _0x40cb85;});}return null;};}function removeEntity(_0x2da5c0,_0x2b45ea){return function(_0x409319){if(_0x409319){return _0x409319[_0x0a9e('0x36')]()[_0x0a9e('0x1d')](function(){_0x2da5c0['status'](0xcc)[_0x0a9e('0x2a')]();});}};}function handleEntityNotFound(_0x5e7238,_0x2cc7a0){return function(_0x14b13f){if(!_0x14b13f){_0x5e7238[_0x0a9e('0x29')](0x194);}return _0x14b13f;};}function handleError(_0x3f3d41,_0x567193){_0x567193=_0x567193||0x1f4;return function(_0x191e91){logger[_0x0a9e('0x24')](_0x191e91[_0x0a9e('0x37')]);if(_0x191e91[_0x0a9e('0x38')]){delete _0x191e91['name'];}_0x3f3d41['status'](_0x567193)[_0x0a9e('0x39')](_0x191e91);};}exports['index']=function(_0x24936a,_0x3d9717){var _0x381c37={},_0x1ef87a={},_0x4f41ae={'count':0x0,'rows':[]};var _0x31916f=_[_0x0a9e('0x3a')](db[_0x0a9e('0x3b')]['rawAttributes'],function(_0x1dbf74){return{'name':_0x1dbf74[_0x0a9e('0x3c')],'type':_0x1dbf74[_0x0a9e('0x3d')]['key']};});_0x1ef87a['model']=_[_0x0a9e('0x3a')](_0x31916f,_0x0a9e('0x38'));_0x1ef87a['query']=_[_0x0a9e('0x3e')](_0x24936a[_0x0a9e('0x3f')]);_0x1ef87a[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],_0x1ef87a['query']);_0x381c37[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],qs[_0x0a9e('0x43')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x43')]));_0x381c37['attributes']=_0x381c37[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x381c37[_0x0a9e('0x42')]:_0x1ef87a[_0x0a9e('0x45')];if(!_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x46')](_0x0a9e('0x47'))){_0x381c37[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x30')]);_0x381c37[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x2d')]);}_0x381c37['order']=qs['sort'](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x48')]);_0x381c37[_0x0a9e('0x49')]=qs[_0x0a9e('0x40')](_[_0x0a9e('0x4a')](_0x24936a[_0x0a9e('0x3f')],_0x1ef87a[_0x0a9e('0x40')]),_0x31916f);if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]){_0x381c37[_0x0a9e('0x49')]=_[_0x0a9e('0x4c')](_0x381c37[_0x0a9e('0x49')],{'$or':_['map'](_0x31916f,function(_0x117c99){if(_0x117c99[_0x0a9e('0x3d')]!==_0x0a9e('0x4d')){var _0xfbd5ad={};_0xfbd5ad[_0x117c99[_0x0a9e('0x38')]]={'$like':'%'+_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]+'%'};return _0xfbd5ad;}})});}_0x381c37=_[_0x0a9e('0x4c')]({},_0x381c37,_0x24936a['options']);var _0x2e9d90={'where':_0x381c37['where']};return db[_0x0a9e('0x3b')][_0x0a9e('0x2f')](_0x2e9d90)[_0x0a9e('0x1d')](function(_0x562fb4){_0x4f41ae[_0x0a9e('0x2f')]=_0x562fb4;if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4e')]){_0x381c37[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0x3b')][_0x0a9e('0x50')](_0x381c37);})[_0x0a9e('0x1d')](function(_0x5bbcde){_0x4f41ae[_0x0a9e('0x51')]=_0x5bbcde;return _0x4f41ae;})[_0x0a9e('0x1d')](respondWithFilteredResult(_0x3d9717,_0x381c37))[_0x0a9e('0x28')](handleError(_0x3d9717,null));};exports[_0x0a9e('0x52')]=function(_0x409789,_0x992c77){var _0x6054ee={'raw':!![],'where':{'id':_0x409789[_0x0a9e('0x53')]['id']}},_0x19383e={};_0x19383e['model']=_[_0x0a9e('0x3e')](db[_0x0a9e('0x3b')]['rawAttributes']);_0x19383e['query']=_['keys'](_0x409789[_0x0a9e('0x3f')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],_0x19383e[_0x0a9e('0x3f')]);_0x6054ee[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],qs['fields'](_0x409789['query']['fields']));_0x6054ee[_0x0a9e('0x42')]=_0x6054ee[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x6054ee['attributes']:_0x19383e[_0x0a9e('0x45')];if(_0x409789[_0x0a9e('0x3f')]['includeAll']){_0x6054ee['include']=[{'all':!![]}];}_0x6054ee=_[_0x0a9e('0x4c')]({},_0x6054ee,_0x409789['options']);return db[_0x0a9e('0x3b')]['find'](_0x6054ee)[_0x0a9e('0x1d')](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x1d')](respondWithResult(_0x992c77,null))[_0x0a9e('0x28')](handleError(_0x992c77,null));};exports['create']=function(_0x2f82da,_0x1bf38a){return db['ChatMessage']['create'](_0x2f82da[_0x0a9e('0x54')],{})[_0x0a9e('0x1d')](respondWithResult(_0x1bf38a,0xc9))['catch'](handleError(_0x1bf38a,null));};exports[_0x0a9e('0x35')]=function(_0x5ce9ac,_0x211ef9){if(_0x5ce9ac['body']['id']){delete _0x5ce9ac[_0x0a9e('0x54')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x5ce9ac['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x211ef9,null))['then'](saveUpdates(_0x5ce9ac[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](respondWithResult(_0x211ef9,null))[_0x0a9e('0x28')](handleError(_0x211ef9,null));};exports[_0x0a9e('0x36')]=function(_0x232830,_0x272738){return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x232830['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x272738,null))[_0x0a9e('0x1d')](removeEntity(_0x272738,null))[_0x0a9e('0x28')](handleError(_0x272738,null));};exports[_0x0a9e('0x56')]=function(_0xb83dfd,_0x156662){return db['ChatMessage'][_0x0a9e('0x56')]()[_0x0a9e('0x1d')](respondWithResult(_0x156662,null))['catch'](handleError(_0x156662,null));};var interaction_log=require(_0x0a9e('0x57'))('chat-interactions');exports[_0x0a9e('0x58')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee){var _0x273cb5={'agent':{},'channel':'chat'};if(_0x5ba1f9[_0x0a9e('0x54')]['id']){delete _0x5ba1f9[_0x0a9e('0x54')]['id'];}_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x59')]=!![];_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5a')]=moment()['format'](_0x0a9e('0x5b'));_0x5ba1f9['body'][_0x0a9e('0x5c')]=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')]||_0x5ba1f9['user']['id'];_0x273cb5[_0x0a9e('0x5d')]['id']=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')];return db[_0x0a9e('0x3b')]['find']({'where':{'id':_0x5ba1f9[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](saveUpdates(_0x5ba1f9[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](function(_0x88dcbf){if(_0x88dcbf){_0x273cb5[_0x0a9e('0x26')]=_0x88dcbf[_0x0a9e('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x0a9e('0x55')]({'where':{'id':_0x88dcbf[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](function(_0x3528b7){if(_0x3528b7){return _0x3528b7['update']({'UserId':_0x5ba1f9['body'][_0x0a9e('0x5c')],'read1stAt':_[_0x0a9e('0x60')](_0x3528b7[_0x0a9e('0x61')])?moment()[_0x0a9e('0x62')](_0x0a9e('0x5b')):undefined});}return null;})[_0x0a9e('0x1d')](function(_0x387489){if(_0x387489){_0x273cb5[_0x0a9e('0x63')]=_0x387489[_0x0a9e('0x5e')]({'plain':!![]});interaction_log[_0x0a9e('0x1e')](_0x0a9e('0x64'),_0x5ba1f9[_0x0a9e('0x65')]['id'],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x66')],_0x273cb5[_0x0a9e('0x63')]['id'],_0x5ba1f9[_0x0a9e('0x54')]?JSON['stringify'](_0x5ba1f9[_0x0a9e('0x54')]):_0x0a9e('0x67'));return respondWithRpcPromise(_0x0a9e('0x68'),'acceptMessage',_0x273cb5);}return null;})[_0x0a9e('0x1d')](function(_0x30944e){var _0x4b341d=_0x0a9e('0x69')+_0x30944e[_0x0a9e('0x26')][_0x0a9e('0x6a')];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0x4b341d,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x0a9e('0x1d')](function(_0x18bf5d){return _0x18bf5d;});})[_0x0a9e('0x1d')](function(_0x23a7d3){if(_0x23a7d3){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x23a7d3[0x0];if(!_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),'fullname',_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})['then'](function(_0x2ed01e){if(!_0x2ed01e)return null;_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x2ed01e;return _0x273cb5;})[_0x0a9e('0x1d')](function(_0x542ece){if(_0x542ece){if(_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x6f')]){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x70')]=util['format'](_0x0a9e('0x71'),_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')]);_0x273cb5[_0x0a9e('0x26')]['channel']=_0x273cb5[_0x0a9e('0x72')];_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x58');return respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x75'),'message':_[_0x0a9e('0x4c')](_0x273cb5[_0x0a9e('0x26')],JSON[_0x0a9e('0x76')](_0x273cb5[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002)[_0x0a9e('0x1d')](function(){return _0x273cb5;});}return _0x273cb5;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x4b3c1a,null))['catch'](handleError(_0x4b3c1a,null));};var interaction_log=require(_0x0a9e('0x57'))(_0x0a9e('0x78'));exports[_0x0a9e('0x33')]=function(_0x563627,_0x3736e0,_0x33dda0){var _0x8cea96={'agent':{},'channel':_0x0a9e('0x79')};if(_0x563627['body']['id']){delete _0x563627['body']['id'];}_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')]=_0x563627['body'][_0x0a9e('0x5c')]||_0x563627['user']['id'];_0x8cea96[_0x0a9e('0x5d')]['id']=_0x563627[_0x0a9e('0x54')]['UserId'];return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))[_0x0a9e('0x1d')](function(_0x1f42a0){if(_0x1f42a0){_0x8cea96[_0x0a9e('0x26')]=_0x1f42a0['get']({'plain':!![]});return db[_0x0a9e('0x7a')][_0x0a9e('0x55')]({'where':{'id':_0x1f42a0[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))['then'](function(_0xf51744){if(_0xf51744){_0x8cea96[_0x0a9e('0x63')]=_0xf51744['get']({'plain':!![]});interaction_log[_0x0a9e('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x563627[_0x0a9e('0x65')]['id'],_0x563627[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x563627[_0x0a9e('0x65')]['role'],_0x8cea96['interaction']['id'],_0x563627[_0x0a9e('0x54')]?JSON[_0x0a9e('0x23')](_0x563627[_0x0a9e('0x54')]):'null');return respondWithRpcPromise(_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x8cea96);}return null;})['then'](function(_0x4e46b2){var _0xf0a802='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e46b2['message']['ContactId'];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0xf0a802,{'type':db[_0x0a9e('0x7d')][_0x0a9e('0x7e')][_0x0a9e('0x7f')],'raw':!![]})[_0x0a9e('0x1d')](function(_0x5a8854){return _0x5a8854;});})[_0x0a9e('0x1d')](function(_0x5955f1){if(_0x5955f1){_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x5955f1[0x0];if(!_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),_0x0a9e('0x80'),_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})[_0x0a9e('0x1d')](function(_0x1910bf){if(!_0x1910bf)return null;_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x1910bf;return _0x8cea96;})['then'](function(_0x2645d6){if(_0x2645d6){_0x2645d6[_0x0a9e('0x26')]['interface']=util[_0x0a9e('0x62')](_0x0a9e('0x71'),_0x563627[_0x0a9e('0x65')]['name']);_0x2645d6[_0x0a9e('0x26')]['channel']=_0x8cea96[_0x0a9e('0x72')];_0x2645d6[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x33');respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x81'),'message':_[_0x0a9e('0x4c')](_0x8cea96['message'],JSON[_0x0a9e('0x76')](_0x8cea96[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002);return _0x8cea96;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x3736e0,null))[_0x0a9e('0x28')](handleError(_0x3736e0,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index e620e94..3ded6dd 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 _0xfd47=['emit','hook','exports','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove'];(function(_0x3bbd7a,_0x45f9ac){var _0x27e32f=function(_0x3f3831){while(--_0x3f3831){_0x3bbd7a['push'](_0x3bbd7a['shift']());}};_0x27e32f(++_0x45f9ac);}(_0xfd47,0x9c));var _0x7fd4=function(_0x2ad3b5,_0x5ab1c4){_0x2ad3b5=_0x2ad3b5-0x0;var _0x281301=_0xfd47[_0x2ad3b5];return _0x281301;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x7fd4('0x0'))['db'][_0x7fd4('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x7fd4('0x2')](0x0);var events={'afterCreate':_0x7fd4('0x3'),'afterUpdate':_0x7fd4('0x4'),'afterDestroy':_0x7fd4('0x5')};function emitEvent(_0x453773){return function(_0x243ce9,_0x4b3e58,_0xff8b4c){ChatMessageEvents[_0x7fd4('0x6')](_0x453773+':'+_0x243ce9['id'],_0x243ce9);ChatMessageEvents[_0x7fd4('0x6')](_0x453773,_0x243ce9);_0xff8b4c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x7fd4('0x7')](e,emitEvent(event));}}module[_0x7fd4('0x8')]=ChatMessageEvents; \ No newline at end of file +var _0x7990=['ChatMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x407997,_0x416ff3){var _0x49b030=function(_0x5a3a14){while(--_0x5a3a14){_0x407997['push'](_0x407997['shift']());}};_0x49b030(++_0x416ff3);}(_0x7990,0x9e));var _0x0799=function(_0xce283a,_0x1b2518){_0xce283a=_0xce283a-0x0;var _0xaecfcb=_0x7990[_0xce283a];return _0xaecfcb;};'use strict';var EventEmitter=require(_0x0799('0x0'));var ChatMessage=require(_0x0799('0x1'))['db'][_0x0799('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x0799('0x3')](0x0);var events={'afterCreate':_0x0799('0x4'),'afterUpdate':'update','afterDestroy':_0x0799('0x5')};function emitEvent(_0x4a6a1c){return function(_0x41e0ca,_0x72726f,_0x3a0906){ChatMessageEvents[_0x0799('0x6')](_0x4a6a1c+':'+_0x41e0ca['id'],_0x41e0ca);ChatMessageEvents[_0x0799('0x6')](_0x4a6a1c,_0x41e0ca);_0x3a0906(null);};}for(var e in events){if(events[_0x0799('0x7')](e)){var event=events[e];ChatMessage[_0x0799('0x8')](e,emitEvent(event));}}module[_0x0799('0x9')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 7beb15b..51d70c8 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 _0x3fc6=['ChatInteraction','findOne','ChatInteractionId','then','update','catch','utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','chat_messages','fti_chat_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3fc6,0x159));var _0x63fc=function(_0x5a421e,_0x18f21){_0x5a421e=_0x5a421e-0x0;var _0x2a0ea0=_0x3fc6[_0x5a421e];return _0x2a0ea0;};'use strict';var _=require(_0x63fc('0x0'));var util=require(_0x63fc('0x1'));var logger=require(_0x63fc('0x2'))('api');var moment=require(_0x63fc('0x3'));var BPromise=require(_0x63fc('0x4'));var rp=require(_0x63fc('0x5'));var fs=require('fs');var path=require(_0x63fc('0x6'));var rimraf=require(_0x63fc('0x7'));var config=require(_0x63fc('0x8'));var attributes=require('./chatMessage.attributes');module['exports']=function(_0xdb65b8,_0x7d24f){return _0xdb65b8[_0x63fc('0x9')]('ChatMessage',attributes,{'tableName':_0x63fc('0xa'),'paranoid':![],'indexes':[{'name':_0x63fc('0xb'),'fields':['body'],'type':_0x63fc('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x28a180,_0x231e48,_0x21866b){var _0xef7fb2=_0xdb65b8[_0x63fc('0xd')];var _0x17cf03=_0x28a180[_0x63fc('0xe')]({'plain':!![]});if(_0x17cf03[_0x63fc('0xf')][_0x63fc('0x10')]()==='in'||_0x17cf03['direction'][_0x63fc('0x10')]()===_0x63fc('0x11')&&!_0x17cf03[_0x63fc('0x12')]&&!_['isNil'](_0x17cf03['UserId'])){_0xef7fb2[_0x63fc('0x13')][_0x63fc('0x14')]({'where':{'id':_0x17cf03[_0x63fc('0x15')]}})[_0x63fc('0x16')](function(_0xed9cc1){if(_0xed9cc1){_0xed9cc1[_0x63fc('0x17')]({'lastMsgAt':_0x17cf03['createdAt'],'lastMsgDirection':_0x17cf03[_0x63fc('0xf')][_0x63fc('0x10')]()});}})[_0x63fc('0x18')](function(_0x337192){console['error'](_0x337192);});}_0x21866b();}},'charset':_0x63fc('0x19'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x3865=['request-promise','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird'];(function(_0xb27e40,_0x459db1){var _0x27a960=function(_0x478c11){while(--_0x478c11){_0xb27e40['push'](_0xb27e40['shift']());}};_0x27a960(++_0x459db1);}(_0x3865,0x151));var _0x5386=function(_0x1d3322,_0xe09f15){_0x1d3322=_0x1d3322-0x0;var _0x4c1e15=_0x3865[_0x1d3322];return _0x4c1e15;};'use strict';var _=require(_0x5386('0x0'));var util=require('util');var logger=require(_0x5386('0x1'))('api');var moment=require(_0x5386('0x2'));var BPromise=require(_0x5386('0x3'));var rp=require(_0x5386('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5386('0x5'));var config=require(_0x5386('0x6'));var attributes=require(_0x5386('0x7'));module[_0x5386('0x8')]=function(_0x39d40c,_0x57a6d3){return _0x39d40c[_0x5386('0x9')](_0x5386('0xa'),attributes,{'tableName':_0x5386('0xb'),'paranoid':![],'indexes':[{'name':_0x5386('0xc'),'fields':[_0x5386('0xd')],'type':_0x5386('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x45ed7a,_0x1b2cf1,_0x4a6c1a){var _0x39a9c6=_0x39d40c['models'];var _0x44951b=_0x45ed7a[_0x5386('0xf')]({'plain':!![]});if(_0x44951b[_0x5386('0x10')][_0x5386('0x11')]()==='in'||_0x44951b[_0x5386('0x10')][_0x5386('0x11')]()===_0x5386('0x12')&&!_0x44951b[_0x5386('0x13')]&&!_[_0x5386('0x14')](_0x44951b[_0x5386('0x15')])){_0x39a9c6[_0x5386('0x16')][_0x5386('0x17')]({'where':{'id':_0x44951b[_0x5386('0x18')]}})[_0x5386('0x19')](function(_0x4463c2){if(_0x4463c2){_0x4463c2[_0x5386('0x1a')]({'lastMsgAt':_0x44951b[_0x5386('0x1b')],'lastMsgDirection':_0x44951b['direction'][_0x5386('0x11')]()});}})[_0x5386('0x1c')](function(_0x3ce77e){console['error'](_0x3ce77e);});}_0x4a6c1a();}},'charset':_0x5386('0x1d'),'collate':_0x5386('0x1e')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index a241554..82bb0d5 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 _0xfb00=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','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','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','stringify','util','moment'];(function(_0xe5b349,_0x5f06e4){var _0x26b0ad=function(_0x1a97f1){while(--_0x1a97f1){_0xe5b349['push'](_0xe5b349['shift']());}};_0x26b0ad(++_0x5f06e4);}(_0xfb00,0x8a));var _0x0fb0=function(_0xcfd89f,_0x106e8f){_0xcfd89f=_0xcfd89f-0x0;var _0x59acd4=_0xfb00[_0xcfd89f];return _0x59acd4;};'use strict';var _=require('lodash');var util=require(_0x0fb0('0x0'));var moment=require(_0x0fb0('0x1'));var BPromise=require(_0x0fb0('0x2'));var rs=require(_0x0fb0('0x3'));var fs=require('fs');var Redis=require(_0x0fb0('0x4'));var db=require(_0x0fb0('0x5'))['db'];var utils=require(_0x0fb0('0x6'));var logger=require(_0x0fb0('0x7'))('rpc');var config=require(_0x0fb0('0x8'));var jayson=require(_0x0fb0('0x9'));var client=jayson[_0x0fb0('0xa')][_0x0fb0('0xb')]({'port':0x232a});config[_0x0fb0('0xc')]=_[_0x0fb0('0xd')](config['redis'],{'host':_0x0fb0('0xe'),'port':0x18eb});var socket=require(_0x0fb0('0xf'))(new Redis(config[_0x0fb0('0xc')]));require(_0x0fb0('0x10'))['register'](socket);function respondWithRpcPromise(_0x30d7da,_0x3f2bc2,_0x1b932e){return new BPromise(function(_0x50a29c,_0x6a0ed4){return client[_0x0fb0('0x11')](_0x30d7da,_0x1b932e)[_0x0fb0('0x12')](function(_0x11e7c4){logger[_0x0fb0('0x13')](_0x0fb0('0x14'),_0x3f2bc2,_0x0fb0('0x15'));logger[_0x0fb0('0x16')](_0x0fb0('0x17'),_0x3f2bc2,'request\x20sent',JSON['stringify'](_0x11e7c4));if(_0x11e7c4[_0x0fb0('0x18')]){if(_0x11e7c4[_0x0fb0('0x18')]['code']===0x1f4){logger[_0x0fb0('0x18')](_0x0fb0('0x14'),_0x3f2bc2,_0x11e7c4[_0x0fb0('0x18')][_0x0fb0('0x19')]);return _0x6a0ed4(_0x11e7c4['error'][_0x0fb0('0x19')]);}logger['error'](_0x0fb0('0x14'),_0x3f2bc2,_0x11e7c4[_0x0fb0('0x18')][_0x0fb0('0x19')]);return _0x50a29c(_0x11e7c4[_0x0fb0('0x18')]['message']);}else{logger['info'](_0x0fb0('0x14'),_0x3f2bc2,'request\x20sent');_0x50a29c(_0x11e7c4[_0x0fb0('0x1a')][_0x0fb0('0x19')]);}})[_0x0fb0('0x1b')](function(_0x36639a){logger['error'](_0x0fb0('0x14'),_0x3f2bc2,_0x36639a);_0x6a0ed4(_0x36639a);});});}exports[_0x0fb0('0x1c')]=function(_0x27a77f){var _0x1394e5=this;return new Promise(function(_0x314228,_0x16028b){return db[_0x0fb0('0x1d')][_0x0fb0('0x1e')](_0x27a77f[_0x0fb0('0x1f')],{'raw':_0x27a77f[_0x0fb0('0x20')]?_0x27a77f[_0x0fb0('0x20')][_0x0fb0('0x21')]===undefined?!![]:![]:!![]})['then'](function(_0x3063e0){logger[_0x0fb0('0x13')](_0x0fb0('0x1c'),_0x27a77f);logger['debug'](_0x0fb0('0x1c'),_0x27a77f,JSON[_0x0fb0('0x22')](_0x3063e0));_0x314228(_0x3063e0);})[_0x0fb0('0x1b')](function(_0x56fc6b){logger[_0x0fb0('0x18')](_0x0fb0('0x1c'),_0x56fc6b[_0x0fb0('0x19')],_0x27a77f);_0x16028b(_0x1394e5[_0x0fb0('0x18')](0x1f4,_0x56fc6b[_0x0fb0('0x19')]));});});}; \ No newline at end of file +var _0xb8f5=['options','then','stringify','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','CreateChatMessage','ChatMessage','body'];(function(_0x44b6f8,_0x302591){var _0x32b459=function(_0x4dc28a){while(--_0x4dc28a){_0x44b6f8['push'](_0x44b6f8['shift']());}};_0x32b459(++_0x302591);}(_0xb8f5,0x1a7));var _0x5b8f=function(_0x1501ee,_0x1043b4){_0x1501ee=_0x1501ee-0x0;var _0x302c8d=_0xb8f5[_0x1501ee];return _0x302c8d;};'use strict';var _=require(_0x5b8f('0x0'));var util=require(_0x5b8f('0x1'));var moment=require(_0x5b8f('0x2'));var BPromise=require(_0x5b8f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b8f('0x4'))['db'];var utils=require(_0x5b8f('0x5'));var logger=require(_0x5b8f('0x6'))(_0x5b8f('0x7'));var config=require(_0x5b8f('0x8'));var jayson=require(_0x5b8f('0x9'));var client=jayson[_0x5b8f('0xa')][_0x5b8f('0xb')]({'port':0x232a});config[_0x5b8f('0xc')]=_[_0x5b8f('0xd')](config[_0x5b8f('0xc')],{'host':_0x5b8f('0xe'),'port':0x18eb});var socket=require(_0x5b8f('0xf'))(new Redis(config[_0x5b8f('0xc')]));require(_0x5b8f('0x10'))[_0x5b8f('0x11')](socket);function respondWithRpcPromise(_0x40907a,_0x5e0f6b,_0x2eef82){return new BPromise(function(_0x38e195,_0xc39a46){return client[_0x5b8f('0x12')](_0x40907a,_0x2eef82)['then'](function(_0xde19ac){logger[_0x5b8f('0x13')]('ChatMessage,\x20%s,\x20%s',_0x5e0f6b,_0x5b8f('0x14'));logger[_0x5b8f('0x15')](_0x5b8f('0x16'),_0x5e0f6b,'request\x20sent',JSON['stringify'](_0xde19ac));if(_0xde19ac['error']){if(_0xde19ac[_0x5b8f('0x17')][_0x5b8f('0x18')]===0x1f4){logger[_0x5b8f('0x17')](_0x5b8f('0x19'),_0x5e0f6b,_0xde19ac[_0x5b8f('0x17')][_0x5b8f('0x1a')]);return _0xc39a46(_0xde19ac[_0x5b8f('0x17')]['message']);}logger[_0x5b8f('0x17')](_0x5b8f('0x19'),_0x5e0f6b,_0xde19ac[_0x5b8f('0x17')][_0x5b8f('0x1a')]);return _0x38e195(_0xde19ac[_0x5b8f('0x17')][_0x5b8f('0x1a')]);}else{logger[_0x5b8f('0x13')](_0x5b8f('0x19'),_0x5e0f6b,_0x5b8f('0x14'));_0x38e195(_0xde19ac[_0x5b8f('0x1b')][_0x5b8f('0x1a')]);}})[_0x5b8f('0x1c')](function(_0x5efbff){logger[_0x5b8f('0x17')](_0x5b8f('0x19'),_0x5e0f6b,_0x5efbff);_0xc39a46(_0x5efbff);});});}exports[_0x5b8f('0x1d')]=function(_0x47bd71){var _0x160e56=this;return new Promise(function(_0xac88f9,_0x189f99){return db[_0x5b8f('0x1e')]['create'](_0x47bd71[_0x5b8f('0x1f')],{'raw':_0x47bd71[_0x5b8f('0x20')]?_0x47bd71[_0x5b8f('0x20')]['raw']===undefined?!![]:![]:!![]})[_0x5b8f('0x21')](function(_0x418b8b){logger[_0x5b8f('0x13')]('CreateChatMessage',_0x47bd71);logger['debug'](_0x5b8f('0x1d'),_0x47bd71,JSON[_0x5b8f('0x22')](_0x418b8b));_0xac88f9(_0x418b8b);})['catch'](function(_0x24785a){logger['error'](_0x5b8f('0x1d'),_0x24785a[_0x5b8f('0x1a')],_0x47bd71);_0x189f99(_0x160e56[_0x5b8f('0x17')](0x1f4,_0x24785a[_0x5b8f('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index cbfb5fb..c256286 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 _0x2f2e=['emit','length','save','remove'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x2f2e,0x146));var _0xe2f2=function(_0x358c86,_0x38a8a2){_0x358c86=_0x358c86-0x0;var _0x52edc5=_0x2f2e[_0x358c86];return _0x52edc5;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0xe2f2('0x0'),_0xe2f2('0x1'),'update'];function createListener(_0xc8150e,_0x5c1823){return function(_0x1d89ba){_0x5c1823[_0xe2f2('0x2')](_0xc8150e,_0x1d89ba);};}function removeListener(_0x2da048,_0x14543c){return function(){ChatMessageEvents['removeListener'](_0x2da048,_0x14543c);};}exports['register']=function(_0x5b202f){for(var _0x3dca30=0x0,_0x23f7a8=events[_0xe2f2('0x3')];_0x3dca30<_0x23f7a8;_0x3dca30++){var _0xc44c89=events[_0x3dca30];var _0x48111c=createListener('chatMessage:'+_0xc44c89,_0x5b202f);ChatMessageEvents['on'](_0xc44c89,_0x48111c);}}; \ No newline at end of file +var _0x1d7e=['remove','update','emit','removeListener','register','length','save'];(function(_0x5cc753,_0x50d3b6){var _0x12b9ea=function(_0x3eb26b){while(--_0x3eb26b){_0x5cc753['push'](_0x5cc753['shift']());}};_0x12b9ea(++_0x50d3b6);}(_0x1d7e,0x7d));var _0xe1d7=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x1d7e[_0x4243a3];return _0x1b2a33;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0xe1d7('0x0'),_0xe1d7('0x1'),_0xe1d7('0x2')];function createListener(_0x47c24f,_0x141274){return function(_0x4c39bd){_0x141274[_0xe1d7('0x3')](_0x47c24f,_0x4c39bd);};}function removeListener(_0x118bc6,_0x354906){return function(){ChatMessageEvents[_0xe1d7('0x4')](_0x118bc6,_0x354906);};}exports[_0xe1d7('0x5')]=function(_0x4058fe){for(var _0x252026=0x0,_0x867e5=events[_0xe1d7('0x6')];_0x252026<_0x867e5;_0x252026++){var _0x439ffd=events[_0x252026];var _0x3f1859=createListener('chatMessage:'+_0x439ffd,_0x4058fe);ChatMessageEvents['on'](_0x439ffd,_0x3f1859);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index c346ad7..4252bbb 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 _0xff53=['../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','tracked','chat','chatmessage:create','put','update','/:id/accept','/:id/reject','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x10896c,_0x4f833a){var _0xd9ab0a=function(_0x5945fb){while(--_0x5945fb){_0x10896c['push'](_0x10896c['shift']());}};_0xd9ab0a(++_0x4f833a);}(_0xff53,0x116));var _0x3ff5=function(_0xdfc45b,_0x16abfc){_0xdfc45b=_0xdfc45b-0x0;var _0x2c2f2d=_0xff53[_0xdfc45b];return _0x2c2f2d;};'use strict';var multer=require(_0x3ff5('0x0'));var util=require(_0x3ff5('0x1'));var path=require(_0x3ff5('0x2'));var timeout=require(_0x3ff5('0x3'));var express=require(_0x3ff5('0x4'));var router=express['Router']();var fs_extra=require(_0x3ff5('0x5'));var auth=require(_0x3ff5('0x6'));var interaction=require(_0x3ff5('0x7'));var config=require(_0x3ff5('0x8'));var controller=require(_0x3ff5('0x9'));router[_0x3ff5('0xa')]('/',auth[_0x3ff5('0xb')](),controller[_0x3ff5('0xc')]);router[_0x3ff5('0xa')](_0x3ff5('0xd'),auth[_0x3ff5('0xb')](),controller[_0x3ff5('0xe')]);router[_0x3ff5('0xa')](_0x3ff5('0xf'),auth[_0x3ff5('0xb')](),controller['show']);router[_0x3ff5('0x10')]('/',auth[_0x3ff5('0xb')](),interaction[_0x3ff5('0x11')](_0x3ff5('0x12'),_0x3ff5('0x13')),controller['create']);router[_0x3ff5('0x14')](_0x3ff5('0xf'),controller[_0x3ff5('0x15')]);router[_0x3ff5('0x14')](_0x3ff5('0x16'),auth[_0x3ff5('0xb')](),controller['accept']);router[_0x3ff5('0x14')](_0x3ff5('0x17'),auth[_0x3ff5('0xb')](),controller['reject']);router[_0x3ff5('0x18')](_0x3ff5('0xf'),auth[_0x3ff5('0xb')](),controller['destroy']);module[_0x3ff5('0x19')]=router; \ No newline at end of file +var _0xfc99=['isAuthenticated','index','describe','show','post','chatmessage:create','create','/:id','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x2d0979,_0x5f1cfa){var _0x19b80f=function(_0xe16ffe){while(--_0xe16ffe){_0x2d0979['push'](_0x2d0979['shift']());}};_0x19b80f(++_0x5f1cfa);}(_0xfc99,0x196));var _0x9fc9=function(_0x410b5c,_0x5261dc){_0x410b5c=_0x410b5c-0x0;var _0x4709b4=_0xfc99[_0x410b5c];return _0x4709b4;};'use strict';var multer=require(_0x9fc9('0x0'));var util=require('util');var path=require(_0x9fc9('0x1'));var timeout=require(_0x9fc9('0x2'));var express=require(_0x9fc9('0x3'));var router=express[_0x9fc9('0x4')]();var fs_extra=require(_0x9fc9('0x5'));var auth=require(_0x9fc9('0x6'));var interaction=require(_0x9fc9('0x7'));var config=require(_0x9fc9('0x8'));var controller=require('./chatMessage.controller');router[_0x9fc9('0x9')]('/',auth[_0x9fc9('0xa')](),controller[_0x9fc9('0xb')]);router['get']('/describe',auth[_0x9fc9('0xa')](),controller[_0x9fc9('0xc')]);router['get']('/:id',auth[_0x9fc9('0xa')](),controller[_0x9fc9('0xd')]);router[_0x9fc9('0xe')]('/',auth[_0x9fc9('0xa')](),interaction['tracked']('chat',_0x9fc9('0xf')),controller[_0x9fc9('0x10')]);router['put'](_0x9fc9('0x11'),controller['update']);router[_0x9fc9('0x12')](_0x9fc9('0x13'),auth[_0x9fc9('0xa')](),controller[_0x9fc9('0x14')]);router[_0x9fc9('0x12')](_0x9fc9('0x15'),auth[_0x9fc9('0xa')](),controller[_0x9fc9('0x16')]);router[_0x9fc9('0x17')]('/:id',auth[_0x9fc9('0xa')](),controller[_0x9fc9('0x18')]);module[_0x9fc9('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index fcee613..bb74b59 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 _0xf071=['TEXT','medium','sequelize'];(function(_0x3a00e0,_0x1454ef){var _0x261259=function(_0x3f3d7e){while(--_0x3f3d7e){_0x3a00e0['push'](_0x3a00e0['shift']());}};_0x261259(++_0x1454ef);}(_0xf071,0x146));var _0x1f07=function(_0xc97c28,_0x286191){_0xc97c28=_0xc97c28-0x0;var _0x5a6aec=_0xf071[_0xc97c28];return _0x5a6aec;};'use strict';var Sequelize=require(_0x1f07('0x0'));module['exports']={'body':{'type':Sequelize[_0x1f07('0x1')](_0x1f07('0x2')),'allowNull':![]}}; \ No newline at end of file +var _0x1adb=['sequelize','exports','TEXT'];(function(_0x34091b,_0x2e0627){var _0xb63a0a=function(_0x17885e){while(--_0x17885e){_0x34091b['push'](_0x34091b['shift']());}};_0xb63a0a(++_0x2e0627);}(_0x1adb,0x19e));var _0xb1ad=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x1adb[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0xb1ad('0x0'));module[_0xb1ad('0x1')]={'body':{'type':Sequelize[_0xb1ad('0x2')]('medium'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 5eefe67..0afe654 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x7a54,0x106));var _0x47a5=function(_0xd822f3,_0x489dd9){_0xd822f3=_0xd822f3-0x0;var _0x13ec6a=_0x7a54[_0xd822f3];return _0x13ec6a;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x7a54,0x106));var _0x47a5=function(_0x3fede3,_0x1bb537){_0x3fede3=_0x3fede3-0x0;var _0x13e285=_0x7a54[_0x3fede3];return _0x13e285;};'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.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 3f78588..48f646d 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 _0x1351=['moment','bluebird','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x503790,_0x525c78){var _0x388092=function(_0x2ab2b8){while(--_0x2ab2b8){_0x503790['push'](_0x503790['shift']());}};_0x388092(++_0x525c78);}(_0x1351,0x7a));var _0x1135=function(_0xca66c5,_0x45c6f3){_0xca66c5=_0xca66c5-0x0;var _0x2ad2ad=_0x1351[_0xca66c5];return _0x2ad2ad;};'use strict';var _=require(_0x1135('0x0'));var util=require(_0x1135('0x1'));var logger=require(_0x1135('0x2'))(_0x1135('0x3'));var moment=require(_0x1135('0x4'));var BPromise=require(_0x1135('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1135('0x6'));var attributes=require(_0x1135('0x7'));module[_0x1135('0x8')]=function(_0x1b79e2,_0x4b88c8){return _0x1b79e2[_0x1135('0x9')](_0x1135('0xa'),attributes,{'tableName':_0x1135('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1135('0xc'),'collate':_0x1135('0xd')});}; \ No newline at end of file +var _0x3617=['chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage'];(function(_0x2e0443,_0x7e5974){var _0x52d450=function(_0x3a9985){while(--_0x3a9985){_0x2e0443['push'](_0x2e0443['shift']());}};_0x52d450(++_0x7e5974);}(_0x3617,0x18b));var _0x7361=function(_0x58acea,_0x5a9ec4){_0x58acea=_0x58acea-0x0;var _0x453242=_0x3617[_0x58acea];return _0x453242;};'use strict';var _=require('lodash');var util=require(_0x7361('0x0'));var logger=require(_0x7361('0x1'))(_0x7361('0x2'));var moment=require(_0x7361('0x3'));var BPromise=require(_0x7361('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7361('0x5'));var rimraf=require('rimraf');var config=require(_0x7361('0x6'));var attributes=require(_0x7361('0x7'));module[_0x7361('0x8')]=function(_0x4305c8,_0x1fc493){return _0x4305c8[_0x7361('0x9')](_0x7361('0xa'),attributes,{'tableName':_0x7361('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7361('0xc'),'collate':_0x7361('0xd')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 7884a72..16be0c7 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 _0x3713=['client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0xf7b253,_0x2de075){var _0x413798=function(_0x3420fc){while(--_0x3420fc){_0xf7b253['push'](_0xf7b253['shift']());}};_0x413798(++_0x2de075);}(_0x3713,0xe7));var _0x3371=function(_0x821dba,_0x569953){_0x821dba=_0x821dba-0x0;var _0x1a4dac=_0x3713[_0x821dba];return _0x1a4dac;};'use strict';var _=require(_0x3371('0x0'));var util=require('util');var moment=require(_0x3371('0x1'));var BPromise=require(_0x3371('0x2'));var rs=require(_0x3371('0x3'));var fs=require('fs');var Redis=require(_0x3371('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3371('0x5'));var logger=require(_0x3371('0x6'))('rpc');var config=require(_0x3371('0x7'));var jayson=require(_0x3371('0x8'));var client=jayson[_0x3371('0x9')][_0x3371('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x26bf23,_0xd2e5fa,_0x8342ed){return new BPromise(function(_0x26f18e,_0x506a72){return client[_0x3371('0xb')](_0x26bf23,_0x8342ed)[_0x3371('0xc')](function(_0x45f661){logger[_0x3371('0xd')](_0x3371('0xe'),_0xd2e5fa,_0x3371('0xf'));logger[_0x3371('0x10')](_0x3371('0x11'),_0xd2e5fa,'request\x20sent',JSON[_0x3371('0x12')](_0x45f661));if(_0x45f661[_0x3371('0x13')]){if(_0x45f661[_0x3371('0x13')][_0x3371('0x14')]===0x1f4){logger[_0x3371('0x13')](_0x3371('0xe'),_0xd2e5fa,_0x45f661[_0x3371('0x13')][_0x3371('0x15')]);return _0x506a72(_0x45f661[_0x3371('0x13')][_0x3371('0x15')]);}logger[_0x3371('0x13')](_0x3371('0xe'),_0xd2e5fa,_0x45f661['error']['message']);return _0x26f18e(_0x45f661[_0x3371('0x13')][_0x3371('0x15')]);}else{logger[_0x3371('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0xd2e5fa,_0x3371('0xf'));_0x26f18e(_0x45f661[_0x3371('0x16')]['message']);}})[_0x3371('0x17')](function(_0x1b3ce7){logger[_0x3371('0x13')](_0x3371('0xe'),_0xd2e5fa,_0x1b3ce7);_0x506a72(_0x1b3ce7);});});} \ No newline at end of file +var _0xe157=['request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatOfflineMessage,\x20%s,\x20%s'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xe157,0x13c));var _0x7e15=function(_0x5100a6,_0x553dac){_0x5100a6=_0x5100a6-0x0;var _0x5dbc50=_0xe157[_0x5100a6];return _0x5dbc50;};'use strict';var _=require(_0x7e15('0x0'));var util=require(_0x7e15('0x1'));var moment=require(_0x7e15('0x2'));var BPromise=require(_0x7e15('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7e15('0x4'));var logger=require(_0x7e15('0x5'))(_0x7e15('0x6'));var config=require(_0x7e15('0x7'));var jayson=require(_0x7e15('0x8'));var client=jayson[_0x7e15('0x9')][_0x7e15('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x324e63,_0x59b98b,_0x2bf5e2){return new BPromise(function(_0x3532cb,_0x26dc90){return client[_0x7e15('0xb')](_0x324e63,_0x2bf5e2)['then'](function(_0x5b2935){logger[_0x7e15('0xc')](_0x7e15('0xd'),_0x59b98b,_0x7e15('0xe'));logger[_0x7e15('0xf')](_0x7e15('0x10'),_0x59b98b,_0x7e15('0xe'),JSON[_0x7e15('0x11')](_0x5b2935));if(_0x5b2935['error']){if(_0x5b2935['error']['code']===0x1f4){logger[_0x7e15('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x59b98b,_0x5b2935[_0x7e15('0x12')][_0x7e15('0x13')]);return _0x26dc90(_0x5b2935['error'][_0x7e15('0x13')]);}logger[_0x7e15('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x59b98b,_0x5b2935['error'][_0x7e15('0x13')]);return _0x3532cb(_0x5b2935[_0x7e15('0x12')][_0x7e15('0x13')]);}else{logger['info'](_0x7e15('0xd'),_0x59b98b,'request\x20sent');_0x3532cb(_0x5b2935[_0x7e15('0x14')][_0x7e15('0x13')]);}})[_0x7e15('0x15')](function(_0x5bb544){logger['error'](_0x7e15('0xd'),_0x59b98b,_0x5bb544);_0x26dc90(_0x5bb544);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 52e5b42..40d14c8 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 _0xe729=['express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','create','update','delete','/:id','exports','multer','util','path'];(function(_0x53f7b6,_0x16ffbe){var _0x1aeb7e=function(_0x54e835){while(--_0x54e835){_0x53f7b6['push'](_0x53f7b6['shift']());}};_0x1aeb7e(++_0x16ffbe);}(_0xe729,0x19d));var _0x9e72=function(_0x4830ef,_0x12b408){_0x4830ef=_0x4830ef-0x0;var _0x350dae=_0xe729[_0x4830ef];return _0x350dae;};'use strict';var multer=require(_0x9e72('0x0'));var util=require(_0x9e72('0x1'));var path=require(_0x9e72('0x2'));var timeout=require('connect-timeout');var express=require(_0x9e72('0x3'));var router=express['Router']();var fs_extra=require(_0x9e72('0x4'));var auth=require(_0x9e72('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9e72('0x6'));var controller=require('./chatOfflineMessage.controller');router[_0x9e72('0x7')]('/',auth[_0x9e72('0x8')](),controller[_0x9e72('0x9')]);router[_0x9e72('0x7')](_0x9e72('0xa'),auth[_0x9e72('0x8')](),controller['describe']);router[_0x9e72('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x9e72('0x8')](),controller[_0x9e72('0xb')]);router['put']('/:id',auth[_0x9e72('0x8')](),controller[_0x9e72('0xc')]);router[_0x9e72('0xd')](_0x9e72('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x9e72('0xf')]=router; \ No newline at end of file +var _0xeac6=['put','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','describe','/:id','show','post'];(function(_0x99868f,_0xbdb8e7){var _0x27a71b=function(_0x41feca){while(--_0x41feca){_0x99868f['push'](_0x99868f['shift']());}};_0x27a71b(++_0xbdb8e7);}(_0xeac6,0xe0));var _0x6eac=function(_0x439184,_0x2ab98d){_0x439184=_0x439184-0x0;var _0x4d733b=_0xeac6[_0x439184];return _0x4d733b;};'use strict';var multer=require(_0x6eac('0x0'));var util=require(_0x6eac('0x1'));var path=require('path');var timeout=require(_0x6eac('0x2'));var express=require(_0x6eac('0x3'));var router=express['Router']();var fs_extra=require(_0x6eac('0x4'));var auth=require(_0x6eac('0x5'));var interaction=require(_0x6eac('0x6'));var config=require(_0x6eac('0x7'));var controller=require(_0x6eac('0x8'));router[_0x6eac('0x9')]('/',auth[_0x6eac('0xa')](),controller[_0x6eac('0xb')]);router[_0x6eac('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x6eac('0xc')]);router[_0x6eac('0x9')](_0x6eac('0xd'),auth[_0x6eac('0xa')](),controller[_0x6eac('0xe')]);router[_0x6eac('0xf')]('/',auth[_0x6eac('0xa')](),controller['create']);router[_0x6eac('0x10')]('/:id',auth[_0x6eac('0xa')](),controller['update']);router[_0x6eac('0x11')](_0x6eac('0xd'),auth[_0x6eac('0xa')](),controller[_0x6eac('0x12')]);module[_0x6eac('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index eea4ff7..7455e74 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 _0xbf20=['timeout','INTEGER','sequelize','exports','STRING','ENUM','mouseOver'];(function(_0x384eb1,_0xef2c1f){var _0x12cd33=function(_0x59d08d){while(--_0x59d08d){_0x384eb1['push'](_0x384eb1['shift']());}};_0x12cd33(++_0xef2c1f);}(_0xbf20,0xcd));var _0x0bf2=function(_0x5e9bc0,_0x5a8e4e){_0x5e9bc0=_0x5e9bc0-0x0;var _0x294555=_0xbf20[_0x5e9bc0];return _0x294555;};'use strict';var Sequelize=require(_0x0bf2('0x0'));module[_0x0bf2('0x1')]={'name':{'type':Sequelize[_0x0bf2('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x0bf2('0x3')](_0x0bf2('0x4'),_0x0bf2('0x5')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x0bf2('0x2')]},'timeout':{'type':Sequelize[_0x0bf2('0x6')]}}; \ No newline at end of file +var _0x88d5=['INTEGER','sequelize','exports','STRING','ENUM','mouseOver'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x88d5,0x127));var _0x588d=function(_0x8ee873,_0x35651b){_0x8ee873=_0x8ee873-0x0;var _0x18dc06=_0x88d5[_0x8ee873];return _0x18dc06;};'use strict';var Sequelize=require(_0x588d('0x0'));module[_0x588d('0x1')]={'name':{'type':Sequelize[_0x588d('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x588d('0x3')](_0x588d('0x4'),'timeout'),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x588d('0x2')]},'timeout':{'type':Sequelize[_0x588d('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index c1f1c56..02640b1 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 _0x308a=['ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','include','options','find','catch','create','update','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv'];(function(_0x3da612,_0x332456){var _0x1a9d1d=function(_0x5ca0d0){while(--_0x5ca0d0){_0x3da612['push'](_0x3da612['shift']());}};_0x1a9d1d(++_0x332456);}(_0x308a,0x71));var _0xa308=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x308a[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xa308('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa308('0x1'));var jsonpatch=require(_0xa308('0x2'));var rp=require(_0xa308('0x3'));var moment=require(_0xa308('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa308('0x5'));var path=require(_0xa308('0x6'));var sox=require(_0xa308('0x7'));var csv=require(_0xa308('0x8'));var ejs=require(_0xa308('0x9'));var fs=require('fs');var fs_extra=require(_0xa308('0xa'));var _=require(_0xa308('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa308('0xc'));var deskjs=require(_0xa308('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa308('0xe'));var Papa=require('papaparse');var Redis=require(_0xa308('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa308('0x10'));var as=require(_0xa308('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa308('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xa308('0x13'));var licenseUtil=require(_0xa308('0x14'));var db=require(_0xa308('0x15'))['db'];function respondWithStatusCode(_0x36b6eb,_0x224599){_0x224599=_0x224599||0xcc;return function(_0x4577ca){if(_0x4577ca){return _0x36b6eb['sendStatus'](_0x224599);}return _0x36b6eb[_0xa308('0x16')](_0x224599)[_0xa308('0x17')]();};}function respondWithResult(_0x80ee50,_0x32d57e){_0x32d57e=_0x32d57e||0xc8;return function(_0x39b04c){if(_0x39b04c){return _0x80ee50['status'](_0x32d57e)['json'](_0x39b04c);}};}function respondWithFilteredResult(_0x558c31,_0x1ba897){return function(_0x31193e){if(_0x31193e){var _0x178c33=typeof _0x1ba897[_0xa308('0x18')]==='undefined'&&typeof _0x1ba897[_0xa308('0x19')]===_0xa308('0x1a');var _0x1a94ba=_0x31193e[_0xa308('0x1b')];var _0x309ac0=_0x178c33?0x0:_0x1ba897[_0xa308('0x18')];var _0x4d6ab9=_0x178c33?_0x31193e[_0xa308('0x1b')]:_0x1ba897[_0xa308('0x18')]+_0x1ba897[_0xa308('0x19')];var _0x5408b1;if(_0x4d6ab9>=_0x1a94ba){_0x4d6ab9=_0x1a94ba;_0x5408b1=0xc8;}else{_0x5408b1=0xce;}_0x558c31[_0xa308('0x16')](_0x5408b1);return _0x558c31[_0xa308('0x1c')](_0xa308('0x1d'),_0x309ac0+'-'+_0x4d6ab9+'/'+_0x1a94ba)[_0xa308('0x1e')](_0x31193e);}return null;};}function patchUpdates(_0x1312aa){return function(_0x2e1d96){try{jsonpatch[_0xa308('0x1f')](_0x2e1d96,_0x1312aa,!![]);}catch(_0x57cec3){return BPromise[_0xa308('0x20')](_0x57cec3);}return _0x2e1d96[_0xa308('0x21')]();};}function saveUpdates(_0x167a27,_0x1588d0){return function(_0x31eb17){if(_0x31eb17){return _0x31eb17['update'](_0x167a27)[_0xa308('0x22')](function(_0x3acb1c){return _0x3acb1c;});}return null;};}function removeEntity(_0x1c5a22,_0x18ec9a){return function(_0x5dbbbf){if(_0x5dbbbf){return _0x5dbbbf[_0xa308('0x23')]()[_0xa308('0x22')](function(){_0x1c5a22[_0xa308('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ed1a2,_0x5f3995){return function(_0x557a11){if(!_0x557a11){_0x1ed1a2[_0xa308('0x24')](0x194);}return _0x557a11;};}function handleError(_0x54bfc4,_0x592364){_0x592364=_0x592364||0x1f4;return function(_0x192597){logger[_0xa308('0x25')](_0x192597[_0xa308('0x26')]);if(_0x192597['name']){delete _0x192597[_0xa308('0x27')];}_0x54bfc4[_0xa308('0x16')](_0x592364)[_0xa308('0x28')](_0x192597);};}exports[_0xa308('0x29')]=function(_0x15666f,_0x1f49f2){var _0x5814eb={'raw':!![],'where':{'id':_0x15666f[_0xa308('0x2a')]['id']}},_0x1f9db4={};_0x1f9db4[_0xa308('0x2b')]=_[_0xa308('0x2c')](db[_0xa308('0x2d')][_0xa308('0x2e')]);_0x1f9db4['query']=_[_0xa308('0x2c')](_0x15666f[_0xa308('0x2f')]);_0x1f9db4[_0xa308('0x30')]=_['intersection'](_0x1f9db4[_0xa308('0x2b')],_0x1f9db4['query']);_0x5814eb[_0xa308('0x31')]=_[_0xa308('0x32')](_0x1f9db4[_0xa308('0x2b')],qs[_0xa308('0x33')](_0x15666f['query'][_0xa308('0x33')]));_0x5814eb[_0xa308('0x31')]=_0x5814eb[_0xa308('0x31')][_0xa308('0x34')]?_0x5814eb['attributes']:_0x1f9db4['model'];if(_0x15666f[_0xa308('0x2f')][_0xa308('0x35')]){_0x5814eb[_0xa308('0x36')]=[{'all':!![]}];}_0x5814eb=_['merge']({},_0x5814eb,_0x15666f[_0xa308('0x37')]);return db['ChatProactiveAction'][_0xa308('0x38')](_0x5814eb)[_0xa308('0x22')](handleEntityNotFound(_0x1f49f2,null))[_0xa308('0x22')](respondWithResult(_0x1f49f2,null))[_0xa308('0x39')](handleError(_0x1f49f2,null));};exports[_0xa308('0x3a')]=function(_0x101ed6,_0x4940bf){return db[_0xa308('0x2d')]['create'](_0x101ed6['body'],{})[_0xa308('0x22')](respondWithResult(_0x4940bf,0xc9))['catch'](handleError(_0x4940bf,null));};exports[_0xa308('0x3b')]=function(_0x3b8cc8,_0x1eac26){if(_0x3b8cc8['body']['id']){delete _0x3b8cc8[_0xa308('0x3c')]['id'];}return db[_0xa308('0x2d')][_0xa308('0x38')]({'where':{'id':_0x3b8cc8[_0xa308('0x2a')]['id']}})[_0xa308('0x22')](handleEntityNotFound(_0x1eac26,null))[_0xa308('0x22')](saveUpdates(_0x3b8cc8[_0xa308('0x3c')],null))[_0xa308('0x22')](respondWithResult(_0x1eac26,null))[_0xa308('0x39')](handleError(_0x1eac26,null));};exports['destroy']=function(_0x501def,_0x1ea9d1){return db['ChatProactiveAction']['find']({'where':{'id':_0x501def[_0xa308('0x2a')]['id']}})[_0xa308('0x22')](handleEntityNotFound(_0x1ea9d1,null))[_0xa308('0x22')](removeEntity(_0x1ea9d1,null))[_0xa308('0x39')](handleError(_0x1ea9d1,null));}; \ No newline at end of file +var _0x1052=['intersection','model','attributes','fields','length','include','merge','create','body','destroy','find','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','update','then','error','stack','name','send','params','ChatProactiveAction','rawAttributes','query','keys','filters'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1052,0xf4));var _0x2105=function(_0x9894ff,_0x9256ba){_0x9894ff=_0x9894ff-0x0;var _0x462988=_0x1052[_0x9894ff];return _0x462988;};'use strict';var emlformat=require(_0x2105('0x0'));var rimraf=require(_0x2105('0x1'));var zipdir=require(_0x2105('0x2'));var jsonpatch=require(_0x2105('0x3'));var rp=require(_0x2105('0x4'));var moment=require(_0x2105('0x5'));var BPromise=require(_0x2105('0x6'));var Mustache=require(_0x2105('0x7'));var util=require(_0x2105('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x2105('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2105('0xa'));var _=require(_0x2105('0xb'));var squel=require('squel');var crypto=require(_0x2105('0xc'));var jsforce=require(_0x2105('0xd'));var deskjs=require(_0x2105('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2105('0xf'));var Redis=require(_0x2105('0x10'));var authService=require(_0x2105('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2105('0x12'));var hardwareService=require(_0x2105('0x13'));var logger=require(_0x2105('0x14'))(_0x2105('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2105('0x16'));var db=require(_0x2105('0x17'))['db'];function respondWithStatusCode(_0x462fc3,_0x16e9ff){_0x16e9ff=_0x16e9ff||0xcc;return function(_0x983ad){if(_0x983ad){return _0x462fc3[_0x2105('0x18')](_0x16e9ff);}return _0x462fc3[_0x2105('0x19')](_0x16e9ff)[_0x2105('0x1a')]();};}function respondWithResult(_0x190e9d,_0x15af88){_0x15af88=_0x15af88||0xc8;return function(_0x59c7c5){if(_0x59c7c5){return _0x190e9d[_0x2105('0x19')](_0x15af88)[_0x2105('0x1b')](_0x59c7c5);}};}function respondWithFilteredResult(_0x1a3fa3,_0x25e0c7){return function(_0x576c51){if(_0x576c51){var _0x42526b=typeof _0x25e0c7[_0x2105('0x1c')]===_0x2105('0x1d')&&typeof _0x25e0c7[_0x2105('0x1e')]===_0x2105('0x1d');var _0x499942=_0x576c51[_0x2105('0x1f')];var _0x1afa9d=_0x42526b?0x0:_0x25e0c7['offset'];var _0x3c8402=_0x42526b?_0x576c51[_0x2105('0x1f')]:_0x25e0c7[_0x2105('0x1c')]+_0x25e0c7[_0x2105('0x1e')];var _0x21c4d4;if(_0x3c8402>=_0x499942){_0x3c8402=_0x499942;_0x21c4d4=0xc8;}else{_0x21c4d4=0xce;}_0x1a3fa3[_0x2105('0x19')](_0x21c4d4);return _0x1a3fa3['set']('Content-Range',_0x1afa9d+'-'+_0x3c8402+'/'+_0x499942)[_0x2105('0x1b')](_0x576c51);}return null;};}function patchUpdates(_0x31cc0c){return function(_0x359abd){try{jsonpatch[_0x2105('0x20')](_0x359abd,_0x31cc0c,!![]);}catch(_0x206906){return BPromise[_0x2105('0x21')](_0x206906);}return _0x359abd['save']();};}function saveUpdates(_0x11d067,_0x33d8ea){return function(_0x5b00fc){if(_0x5b00fc){return _0x5b00fc[_0x2105('0x22')](_0x11d067)[_0x2105('0x23')](function(_0x172c91){return _0x172c91;});}return null;};}function removeEntity(_0xc99047,_0x5de51d){return function(_0x4200d2){if(_0x4200d2){return _0x4200d2['destroy']()['then'](function(){_0xc99047[_0x2105('0x19')](0xcc)[_0x2105('0x1a')]();});}};}function handleEntityNotFound(_0x25eb8c,_0x124a22){return function(_0x531f14){if(!_0x531f14){_0x25eb8c[_0x2105('0x18')](0x194);}return _0x531f14;};}function handleError(_0x2ce9b5,_0x31da07){_0x31da07=_0x31da07||0x1f4;return function(_0x3a4af1){logger[_0x2105('0x24')](_0x3a4af1[_0x2105('0x25')]);if(_0x3a4af1[_0x2105('0x26')]){delete _0x3a4af1[_0x2105('0x26')];}_0x2ce9b5['status'](_0x31da07)[_0x2105('0x27')](_0x3a4af1);};}exports['show']=function(_0x20a564,_0x1c1df3){var _0x110973={'raw':!![],'where':{'id':_0x20a564[_0x2105('0x28')]['id']}},_0x2deb12={};_0x2deb12['model']=_['keys'](db[_0x2105('0x29')][_0x2105('0x2a')]);_0x2deb12[_0x2105('0x2b')]=_[_0x2105('0x2c')](_0x20a564[_0x2105('0x2b')]);_0x2deb12[_0x2105('0x2d')]=_[_0x2105('0x2e')](_0x2deb12[_0x2105('0x2f')],_0x2deb12['query']);_0x110973[_0x2105('0x30')]=_[_0x2105('0x2e')](_0x2deb12[_0x2105('0x2f')],qs['fields'](_0x20a564['query'][_0x2105('0x31')]));_0x110973[_0x2105('0x30')]=_0x110973[_0x2105('0x30')][_0x2105('0x32')]?_0x110973[_0x2105('0x30')]:_0x2deb12['model'];if(_0x20a564['query']['includeAll']){_0x110973[_0x2105('0x33')]=[{'all':!![]}];}_0x110973=_[_0x2105('0x34')]({},_0x110973,_0x20a564['options']);return db['ChatProactiveAction']['find'](_0x110973)[_0x2105('0x23')](handleEntityNotFound(_0x1c1df3,null))[_0x2105('0x23')](respondWithResult(_0x1c1df3,null))['catch'](handleError(_0x1c1df3,null));};exports[_0x2105('0x35')]=function(_0x8394cd,_0x2eb5e9){return db['ChatProactiveAction'][_0x2105('0x35')](_0x8394cd[_0x2105('0x36')],{})[_0x2105('0x23')](respondWithResult(_0x2eb5e9,0xc9))['catch'](handleError(_0x2eb5e9,null));};exports[_0x2105('0x22')]=function(_0x40f13a,_0x5cc639){if(_0x40f13a[_0x2105('0x36')]['id']){delete _0x40f13a[_0x2105('0x36')]['id'];}return db[_0x2105('0x29')]['find']({'where':{'id':_0x40f13a[_0x2105('0x28')]['id']}})[_0x2105('0x23')](handleEntityNotFound(_0x5cc639,null))[_0x2105('0x23')](saveUpdates(_0x40f13a[_0x2105('0x36')],null))[_0x2105('0x23')](respondWithResult(_0x5cc639,null))['catch'](handleError(_0x5cc639,null));};exports[_0x2105('0x37')]=function(_0x1d987e,_0x4b6fe1){return db[_0x2105('0x29')][_0x2105('0x38')]({'where':{'id':_0x1d987e[_0x2105('0x28')]['id']}})[_0x2105('0x23')](handleEntityNotFound(_0x4b6fe1,null))[_0x2105('0x23')](removeEntity(_0x4b6fe1,null))[_0x2105('0x39')](handleError(_0x4b6fe1,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 237adc0..dbf1009 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 _0x8361=['util','bluebird','path','rimraf','../../config/environment','./chatProactiveAction.attributes','chat_proactive_actions'];(function(_0x25ec19,_0x385cd5){var _0x173b68=function(_0x49052f){while(--_0x49052f){_0x25ec19['push'](_0x25ec19['shift']());}};_0x173b68(++_0x385cd5);}(_0x8361,0xd9));var _0x1836=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x8361[_0x82129b];return _0x2ae5dc;};'use strict';var _=require('lodash');var util=require(_0x1836('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x1836('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1836('0x2'));var rimraf=require(_0x1836('0x3'));var config=require(_0x1836('0x4'));var attributes=require(_0x1836('0x5'));module['exports']=function(_0x4b344b,_0x4146f9){return _0x4b344b['define']('ChatProactiveAction',attributes,{'tableName':_0x1836('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd2de=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger'];(function(_0x3ff39a,_0x34513b){var _0x3c1858=function(_0x9b8969){while(--_0x9b8969){_0x3ff39a['push'](_0x3ff39a['shift']());}};_0x3c1858(++_0x34513b);}(_0xd2de,0x1ec));var _0xed2d=function(_0xa73c1f,_0x3c3b65){_0xa73c1f=_0xa73c1f-0x0;var _0x50a1db=_0xd2de[_0xa73c1f];return _0x50a1db;};'use strict';var _=require(_0xed2d('0x0'));var util=require(_0xed2d('0x1'));var logger=require(_0xed2d('0x2'))(_0xed2d('0x3'));var moment=require(_0xed2d('0x4'));var BPromise=require(_0xed2d('0x5'));var rp=require(_0xed2d('0x6'));var fs=require('fs');var path=require(_0xed2d('0x7'));var rimraf=require(_0xed2d('0x8'));var config=require(_0xed2d('0x9'));var attributes=require(_0xed2d('0xa'));module[_0xed2d('0xb')]=function(_0x448c3b,_0x223c52){return _0x448c3b[_0xed2d('0xc')](_0xed2d('0xd'),attributes,{'tableName':_0xed2d('0xe'),'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 df8924f..e6da660 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 _0xd80e=['error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','ChatProactiveAction,\x20%s,\x20%s','ChatProactiveAction,\x20%s,\x20%s,\x20%s'];(function(_0x3c84a4,_0x1a2471){var _0x521c7f=function(_0x5a18a3){while(--_0x5a18a3){_0x3c84a4['push'](_0x3c84a4['shift']());}};_0x521c7f(++_0x1a2471);}(_0xd80e,0xf6));var _0xed80=function(_0x2a448c,_0x488f3f){_0x2a448c=_0x2a448c-0x0;var _0x2c04ee=_0xd80e[_0x2a448c];return _0x2c04ee;};'use strict';var _=require(_0xed80('0x0'));var util=require(_0xed80('0x1'));var moment=require(_0xed80('0x2'));var BPromise=require(_0xed80('0x3'));var rs=require(_0xed80('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xed80('0x5'));var logger=require(_0xed80('0x6'))('rpc');var config=require(_0xed80('0x7'));var jayson=require(_0xed80('0x8'));var client=jayson['client'][_0xed80('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x9ae150,_0x3041d2,_0x841e23){return new BPromise(function(_0x28d15e,_0x10eaf2){return client[_0xed80('0xa')](_0x9ae150,_0x841e23)[_0xed80('0xb')](function(_0x3f2668){logger['info'](_0xed80('0xc'),_0x3041d2,'request\x20sent');logger['debug'](_0xed80('0xd'),_0x3041d2,'request\x20sent',JSON['stringify'](_0x3f2668));if(_0x3f2668['error']){if(_0x3f2668[_0xed80('0xe')][_0xed80('0xf')]===0x1f4){logger[_0xed80('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x3041d2,_0x3f2668['error'][_0xed80('0x10')]);return _0x10eaf2(_0x3f2668[_0xed80('0xe')]['message']);}logger[_0xed80('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x3041d2,_0x3f2668[_0xed80('0xe')]['message']);return _0x28d15e(_0x3f2668[_0xed80('0xe')][_0xed80('0x10')]);}else{logger[_0xed80('0x11')](_0xed80('0xc'),_0x3041d2,'request\x20sent');_0x28d15e(_0x3f2668[_0xed80('0x12')]['message']);}})[_0xed80('0x13')](function(_0x378754){logger[_0xed80('0xe')](_0xed80('0xc'),_0x3041d2,_0x378754);_0x10eaf2(_0x378754);});});} \ No newline at end of file +var _0x6c41=['jayson/promise','client','http','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x1664bc,_0x59f652){var _0x148d6e=function(_0x507448){while(--_0x507448){_0x1664bc['push'](_0x1664bc['shift']());}};_0x148d6e(++_0x59f652);}(_0x6c41,0x1c6));var _0x16c4=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0x6c41[_0x49d41c];return _0xb64c5f;};'use strict';var _=require('lodash');var util=require(_0x16c4('0x0'));var moment=require(_0x16c4('0x1'));var BPromise=require(_0x16c4('0x2'));var rs=require(_0x16c4('0x3'));var fs=require('fs');var Redis=require(_0x16c4('0x4'));var db=require(_0x16c4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x16c4('0x6'))(_0x16c4('0x7'));var config=require('../../config/environment');var jayson=require(_0x16c4('0x8'));var client=jayson[_0x16c4('0x9')][_0x16c4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x347546,_0x8ba811,_0x15e218){return new BPromise(function(_0x5eacec,_0x5a4d00){return client[_0x16c4('0xb')](_0x347546,_0x15e218)['then'](function(_0x3a4075){logger[_0x16c4('0xc')](_0x16c4('0xd'),_0x8ba811,_0x16c4('0xe'));logger[_0x16c4('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x8ba811,_0x16c4('0xe'),JSON[_0x16c4('0x10')](_0x3a4075));if(_0x3a4075[_0x16c4('0x11')]){if(_0x3a4075['error'][_0x16c4('0x12')]===0x1f4){logger[_0x16c4('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x8ba811,_0x3a4075['error'][_0x16c4('0x13')]);return _0x5a4d00(_0x3a4075['error'][_0x16c4('0x13')]);}logger[_0x16c4('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x8ba811,_0x3a4075['error'][_0x16c4('0x13')]);return _0x5eacec(_0x3a4075[_0x16c4('0x11')][_0x16c4('0x13')]);}else{logger[_0x16c4('0xc')](_0x16c4('0xd'),_0x8ba811,'request\x20sent');_0x5eacec(_0x3a4075[_0x16c4('0x14')]['message']);}})[_0x16c4('0x15')](function(_0x586134){logger['error'](_0x16c4('0xd'),_0x8ba811,_0x586134);_0x5a4d00(_0x586134);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 5b09a08..e3a6dd0 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 _0x24ca=['../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','put','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x4f8718,_0x524b54){var _0x751503=function(_0x53451f){while(--_0x53451f){_0x4f8718['push'](_0x4f8718['shift']());}};_0x751503(++_0x524b54);}(_0x24ca,0x1bc));var _0xa24c=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x24ca[_0x18ab2a];return _0x16dcee;};'use strict';var multer=require(_0xa24c('0x0'));var util=require('util');var path=require(_0xa24c('0x1'));var timeout=require(_0xa24c('0x2'));var express=require(_0xa24c('0x3'));var router=express['Router']();var fs_extra=require(_0xa24c('0x4'));var auth=require(_0xa24c('0x5'));var interaction=require(_0xa24c('0x6'));var config=require(_0xa24c('0x7'));var controller=require(_0xa24c('0x8'));router[_0xa24c('0x9')](_0xa24c('0xa'),auth[_0xa24c('0xb')](),controller[_0xa24c('0xc')]);router[_0xa24c('0xd')]('/',auth[_0xa24c('0xb')](),controller['create']);router[_0xa24c('0xe')](_0xa24c('0xa'),auth[_0xa24c('0xb')](),controller['update']);router[_0xa24c('0xf')](_0xa24c('0xa'),auth[_0xa24c('0xb')](),controller[_0xa24c('0x10')]);module[_0xa24c('0x11')]=router; \ No newline at end of file +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(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x425d,0x1e0));var _0xd425=function(_0x5e6c43,_0x132a12){_0x5e6c43=_0x5e6c43-0x0;var _0x23d90e=_0x425d[_0x5e6c43];return _0x23d90e;};'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 diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 50db3a4..5b59f0a 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 _0xcb38=['beepall','sequelize','exports','name','STRING','INTEGER','ENUM','rrmemory'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0xcb38,0x71));var _0x8cb3=function(_0x4e998d,_0x145397){_0x4e998d=_0x4e998d-0x0;var _0x5e8a44=_0xcb38[_0x4e998d];return _0x5e8a44;};'use strict';var Sequelize=require(_0x8cb3('0x0'));module[_0x8cb3('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x8cb3('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8cb3('0x3')]},'timeout':{'type':Sequelize[_0x8cb3('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8cb3('0x5')](_0x8cb3('0x6'),_0x8cb3('0x7'),'roundrobin')}}; \ No newline at end of file +var _0x0059=['INTEGER','rrmemory','roundrobin','exports','STRING','name'];(function(_0x44454f,_0x4bfbe8){var _0x475150=function(_0x1cde13){while(--_0x1cde13){_0x44454f['push'](_0x44454f['shift']());}};_0x475150(++_0x4bfbe8);}(_0x0059,0xdb));var _0x9005=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x0059[_0x4fde08];return _0x12e725;};'use strict';var Sequelize=require('sequelize');module[_0x9005('0x0')]={'name':{'type':Sequelize[_0x9005('0x1')],'unique':_0x9005('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9005('0x1')]},'timeout':{'type':Sequelize[_0x9005('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x9005('0x4'),'beepall',_0x9005('0x5'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 09bce5a..3bc14ea 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 _0x79d7=['catch','sendStatus','status','undefined','count','offset','limit','set','json','apply','save','update','destroy','get','name','send','index','map','ChatQueue','rawAttributes','fieldName','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','params','describe','getMembers','findOne','ChatQueueId','UserChatQueue','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','SIP','getTeams','Team','addTeams','ids','Agents','online','flatMap','transaction','each','forEach','emit','userChatQueue:save','removeTeams','field','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','removeAgents','userChatQueue:remove','addAgents','spread','isArray','getAgents','rimraf','request-promise','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x306186,_0x5db739){var _0x27c782=function(_0x9c5c16){while(--_0x9c5c16){_0x306186['push'](_0x306186['shift']());}};_0x27c782(++_0x5db739);}(_0x79d7,0x18c));var _0x779d=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x79d7[_0x4f9b18];return _0x29f20c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x779d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x779d('0x1'));var moment=require(_0x779d('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x779d('0x3'));var util=require('util');var path=require(_0x779d('0x4'));var sox=require(_0x779d('0x5'));var csv=require(_0x779d('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x779d('0x7'));var _=require(_0x779d('0x8'));var squel=require(_0x779d('0x9'));var crypto=require(_0x779d('0xa'));var jsforce=require(_0x779d('0xb'));var deskjs=require(_0x779d('0xc'));var toCsv=require(_0x779d('0x6'));var querystring=require(_0x779d('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x779d('0xe'));var qs=require(_0x779d('0xf'));var as=require(_0x779d('0x10'));var hardwareService=require(_0x779d('0x11'));var logger=require(_0x779d('0x12'))('api');var utils=require(_0x779d('0x13'));var config=require(_0x779d('0x14'));var licenseUtil=require(_0x779d('0x15'));var db=require(_0x779d('0x16'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x779d('0x17'),'port':0x18eb});var socket=require(_0x779d('0x18'))(new Redis(config['redis']));require(_0x779d('0x19'))[_0x779d('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2ed7a5,_0x3fb8df,_0x2cfe06,_0xfa4390){return new BPromise(function(_0x459fb7,_0xd7c43a){var _0x115f53=_0xfa4390||client;return _0x115f53[_0x779d('0x1b')](_0x2ed7a5,_0x2cfe06)[_0x779d('0x1c')](function(_0x167207){logger[_0x779d('0x1d')](_0x779d('0x1e'),_0x3fb8df,'request\x20sent');logger[_0x779d('0x1f')](_0x779d('0x20'),_0x3fb8df,_0x779d('0x21'),JSON[_0x779d('0x22')](_0x167207));if(_0x167207['error']){if(_0x167207[_0x779d('0x23')][_0x779d('0x24')]===0x1f4){logger['error'](_0x779d('0x1e'),_0x3fb8df,_0x167207[_0x779d('0x23')][_0x779d('0x25')]);return _0xd7c43a(_0x167207[_0x779d('0x23')]['message']);}logger[_0x779d('0x23')](_0x779d('0x1e'),_0x3fb8df,_0x167207[_0x779d('0x23')]['message']);return _0x459fb7(_0x167207[_0x779d('0x23')][_0x779d('0x25')]);}else{logger[_0x779d('0x1d')](_0x779d('0x1e'),_0x3fb8df,_0x779d('0x21'));_0x459fb7(_0x167207[_0x779d('0x26')]['message']);}})[_0x779d('0x27')](function(_0x5ca74b){logger['error'](_0x779d('0x1e'),_0x3fb8df,_0x5ca74b);_0xd7c43a(_0x5ca74b);});});}function respondWithStatusCode(_0x22d1a4,_0x3e52c0){_0x3e52c0=_0x3e52c0||0xcc;return function(_0x190236){if(_0x190236){return _0x22d1a4[_0x779d('0x28')](_0x3e52c0);}return _0x22d1a4[_0x779d('0x29')](_0x3e52c0)['end']();};}function respondWithResult(_0xaa4afb,_0xd313b){_0xd313b=_0xd313b||0xc8;return function(_0x125c7d){if(_0x125c7d){return _0xaa4afb['status'](_0xd313b)['json'](_0x125c7d);}};}function respondWithFilteredResult(_0x47e74e,_0x54843c){return function(_0x5d0b77){if(_0x5d0b77){var _0x2c51ac=typeof _0x54843c['offset']==='undefined'&&typeof _0x54843c['limit']===_0x779d('0x2a');var _0x124c37=_0x5d0b77[_0x779d('0x2b')];var _0x592c3c=_0x2c51ac?0x0:_0x54843c[_0x779d('0x2c')];var _0x19bc1c=_0x2c51ac?_0x5d0b77[_0x779d('0x2b')]:_0x54843c[_0x779d('0x2c')]+_0x54843c[_0x779d('0x2d')];var _0x49f237;if(_0x19bc1c>=_0x124c37){_0x19bc1c=_0x124c37;_0x49f237=0xc8;}else{_0x49f237=0xce;}_0x47e74e['status'](_0x49f237);return _0x47e74e[_0x779d('0x2e')]('Content-Range',_0x592c3c+'-'+_0x19bc1c+'/'+_0x124c37)[_0x779d('0x2f')](_0x5d0b77);}return null;};}function patchUpdates(_0x1973f4){return function(_0x111234){try{jsonpatch[_0x779d('0x30')](_0x111234,_0x1973f4,!![]);}catch(_0xc8e940){return BPromise['reject'](_0xc8e940);}return _0x111234[_0x779d('0x31')]();};}function saveUpdates(_0x4e950d,_0x22d3c3){return function(_0xea1106){if(_0xea1106){return _0xea1106[_0x779d('0x32')](_0x4e950d)[_0x779d('0x1c')](function(_0x4ccbe5){return _0x4ccbe5;});}return null;};}function removeEntity(_0x3bb208,_0x5f39cd){return function(_0x2335a1){if(_0x2335a1){return _0x2335a1[_0x779d('0x33')]()['then'](function(){var _0x58b4bf=_0x2335a1[_0x779d('0x34')]({'plain':!![]});var _0x32141a='ChatQueues';return db['UserProfileResource']['destroy']({'where':{'type':_0x32141a,'resourceId':_0x58b4bf['id']}})[_0x779d('0x1c')](function(){return _0x2335a1;});})[_0x779d('0x1c')](function(){_0x3bb208[_0x779d('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1df56e,_0x595e6f){return function(_0xfa213d){if(!_0xfa213d){_0x1df56e[_0x779d('0x28')](0x194);}return _0xfa213d;};}function handleError(_0x1a3b16,_0x2d0004){_0x2d0004=_0x2d0004||0x1f4;return function(_0x521641){logger[_0x779d('0x23')](_0x521641['stack']);if(_0x521641['name']){delete _0x521641[_0x779d('0x35')];}_0x1a3b16[_0x779d('0x29')](_0x2d0004)[_0x779d('0x36')](_0x521641);};}exports[_0x779d('0x37')]=function(_0x729251,_0xf576aa){var _0x5e5aea={},_0x208dbd={},_0x2cbe3f={'count':0x0,'rows':[]};var _0x442e97=_[_0x779d('0x38')](db[_0x779d('0x39')][_0x779d('0x3a')],function(_0x3de56c){return{'name':_0x3de56c[_0x779d('0x3b')],'type':_0x3de56c['type'][_0x779d('0x3c')]};});_0x208dbd[_0x779d('0x3d')]=_[_0x779d('0x38')](_0x442e97,_0x779d('0x35'));_0x208dbd['query']=_[_0x779d('0x3e')](_0x729251[_0x779d('0x3f')]);_0x208dbd[_0x779d('0x40')]=_['intersection'](_0x208dbd[_0x779d('0x3d')],_0x208dbd[_0x779d('0x3f')]);_0x5e5aea[_0x779d('0x41')]=_[_0x779d('0x42')](_0x208dbd['model'],qs['fields'](_0x729251['query'][_0x779d('0x43')]));_0x5e5aea[_0x779d('0x41')]=_0x5e5aea[_0x779d('0x41')]['length']?_0x5e5aea[_0x779d('0x41')]:_0x208dbd[_0x779d('0x3d')];if(!_0x729251[_0x779d('0x3f')][_0x779d('0x44')](_0x779d('0x45'))){_0x5e5aea[_0x779d('0x2d')]=qs[_0x779d('0x2d')](_0x729251['query']['limit']);_0x5e5aea['offset']=qs[_0x779d('0x2c')](_0x729251['query']['offset']);}_0x5e5aea[_0x779d('0x46')]=qs[_0x779d('0x47')](_0x729251[_0x779d('0x3f')]['sort']);_0x5e5aea[_0x779d('0x48')]=qs['filters'](_[_0x779d('0x49')](_0x729251['query'],_0x208dbd['filters']),_0x442e97);if(_0x729251[_0x779d('0x3f')][_0x779d('0x4a')]){_0x5e5aea[_0x779d('0x48')]=_[_0x779d('0x4b')](_0x5e5aea['where'],{'$or':_[_0x779d('0x38')](_0x442e97,function(_0x39f015){if(_0x39f015[_0x779d('0x4c')]!==_0x779d('0x4d')){var _0xd0441c={};_0xd0441c[_0x39f015[_0x779d('0x35')]]={'$like':'%'+_0x729251['query']['filter']+'%'};return _0xd0441c;}})});}_0x5e5aea=_[_0x779d('0x4b')]({},_0x5e5aea,_0x729251[_0x779d('0x4e')]);var _0xf61041={'where':_0x5e5aea[_0x779d('0x48')]};return db[_0x779d('0x39')]['count'](_0xf61041)[_0x779d('0x1c')](function(_0x20ae88){_0x2cbe3f[_0x779d('0x2b')]=_0x20ae88;if(_0x729251[_0x779d('0x3f')][_0x779d('0x4f')]){_0x5e5aea[_0x779d('0x50')]=[{'all':!![]}];}return db[_0x779d('0x39')][_0x779d('0x51')](_0x5e5aea);})[_0x779d('0x1c')](function(_0x298448){_0x2cbe3f[_0x779d('0x52')]=_0x298448;return _0x2cbe3f;})[_0x779d('0x1c')](respondWithFilteredResult(_0xf576aa,_0x5e5aea))[_0x779d('0x27')](handleError(_0xf576aa,null));};exports[_0x779d('0x53')]=function(_0x4a8b71,_0x5654b4){var _0x42934f={'raw':!![],'where':{'id':_0x4a8b71['params']['id']}},_0x333f84={};_0x333f84[_0x779d('0x3d')]=_['keys'](db[_0x779d('0x39')][_0x779d('0x3a')]);_0x333f84[_0x779d('0x3f')]=_['keys'](_0x4a8b71[_0x779d('0x3f')]);_0x333f84['filters']=_['intersection'](_0x333f84[_0x779d('0x3d')],_0x333f84['query']);_0x42934f[_0x779d('0x41')]=_[_0x779d('0x42')](_0x333f84[_0x779d('0x3d')],qs['fields'](_0x4a8b71[_0x779d('0x3f')]['fields']));_0x42934f['attributes']=_0x42934f[_0x779d('0x41')][_0x779d('0x54')]?_0x42934f[_0x779d('0x41')]:_0x333f84[_0x779d('0x3d')];if(_0x4a8b71[_0x779d('0x3f')][_0x779d('0x4f')]){_0x42934f[_0x779d('0x50')]=[{'all':!![]}];}_0x42934f=_[_0x779d('0x4b')]({},_0x42934f,_0x4a8b71[_0x779d('0x4e')]);return db[_0x779d('0x39')][_0x779d('0x55')](_0x42934f)[_0x779d('0x1c')](handleEntityNotFound(_0x5654b4,null))[_0x779d('0x1c')](respondWithResult(_0x5654b4,null))[_0x779d('0x27')](handleError(_0x5654b4,null));};exports[_0x779d('0x56')]=function(_0x18eae7,_0x2bcfbe){return db[_0x779d('0x39')]['create'](_0x18eae7[_0x779d('0x57')],{})[_0x779d('0x1c')](function(_0x176ba2){var _0x189db9=_0x18eae7[_0x779d('0x58')][_0x779d('0x34')]({'plain':!![]});if(!_0x189db9)throw new Error(_0x779d('0x59'));if(_0x189db9['role']===_0x779d('0x58')){var _0x5ebb84=_0x176ba2['get']({'plain':!![]});var _0x5d1087='ChatQueues';return db[_0x779d('0x5a')]['find']({'where':{'name':_0x5d1087,'userProfileId':_0x189db9['userProfileId']},'raw':!![]})['then'](function(_0x42b8a7){if(_0x42b8a7&&_0x42b8a7[_0x779d('0x5b')]===0x0){return db[_0x779d('0x5c')][_0x779d('0x56')]({'name':_0x5ebb84[_0x779d('0x35')],'resourceId':_0x5ebb84['id'],'type':_0x42b8a7['name'],'sectionId':_0x42b8a7['id']},{})[_0x779d('0x1c')](function(){return _0x176ba2;});}else{return _0x176ba2;}})[_0x779d('0x27')](function(_0x2c8976){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2c8976);throw _0x2c8976;});}return _0x176ba2;})[_0x779d('0x1c')](respondWithResult(_0x2bcfbe,0xc9))[_0x779d('0x27')](handleError(_0x2bcfbe,null));};exports[_0x779d('0x32')]=function(_0x3919eb,_0x287bdd){if(_0x3919eb[_0x779d('0x57')]['id']){delete _0x3919eb[_0x779d('0x57')]['id'];}return db[_0x779d('0x39')]['find']({'where':{'id':_0x3919eb[_0x779d('0x5d')]['id']}})[_0x779d('0x1c')](handleEntityNotFound(_0x287bdd,null))['then'](saveUpdates(_0x3919eb[_0x779d('0x57')],null))[_0x779d('0x1c')](respondWithResult(_0x287bdd,null))[_0x779d('0x27')](handleError(_0x287bdd,null));};exports['destroy']=function(_0x62ecfb,_0x1aaa08){return db[_0x779d('0x39')][_0x779d('0x55')]({'where':{'id':_0x62ecfb['params']['id']}})['then'](handleEntityNotFound(_0x1aaa08,null))['then'](removeEntity(_0x1aaa08,null))['catch'](handleError(_0x1aaa08,null));};exports[_0x779d('0x5e')]=function(_0x49bccc,_0x4f232b){return db[_0x779d('0x39')]['describe']()[_0x779d('0x1c')](respondWithResult(_0x4f232b,null))['catch'](handleError(_0x4f232b,null));};exports[_0x779d('0x5f')]=function(_0xc09cbd,_0xf18e27,_0x2031f9){var _0x598058={'raw':!![],'where':{}},_0x42d6d1={},_0x579a39;return db['ChatQueue'][_0x779d('0x60')]({'where':{'id':_0xc09cbd[_0x779d('0x5d')]['id']}})[_0x779d('0x1c')](handleEntityNotFound(_0xf18e27,null))['then'](function(_0x2970aa){if(_0x2970aa){_0x579a39=_0x2970aa[_0x779d('0x34')]({'plain':!![]});_0x42d6d1['model']=_[_0x779d('0x3e')](db['UserChatQueue']['rawAttributes']);_0x42d6d1['query']=_[_0x779d('0x3e')](_0xc09cbd[_0x779d('0x3f')]);_0x42d6d1[_0x779d('0x40')]=_[_0x779d('0x42')](_0x42d6d1['model'],_0x42d6d1[_0x779d('0x3f')]);_0x598058[_0x779d('0x41')]=_[_0x779d('0x42')](_0x42d6d1['model'],qs['fields'](_0xc09cbd['query'][_0x779d('0x43')]));_0x598058[_0x779d('0x41')]=_0x598058[_0x779d('0x41')][_0x779d('0x54')]?_0x598058[_0x779d('0x41')]:_0x42d6d1[_0x779d('0x3d')];if(!_0xc09cbd[_0x779d('0x3f')][_0x779d('0x44')](_0x779d('0x45'))){_0x598058['limit']=qs[_0x779d('0x2d')](_0xc09cbd[_0x779d('0x3f')]['limit']);_0x598058['offset']=qs[_0x779d('0x2c')](_0xc09cbd[_0x779d('0x3f')][_0x779d('0x2c')]);}_0x598058[_0x779d('0x46')]=qs['sort'](_0xc09cbd[_0x779d('0x3f')][_0x779d('0x47')]);_0x598058['where']=qs[_0x779d('0x40')](_[_0x779d('0x49')](_0xc09cbd[_0x779d('0x3f')],_0x42d6d1[_0x779d('0x40')]));_0x598058['where'][_0x779d('0x61')]=_0x2970aa['id'];if(_0xc09cbd[_0x779d('0x3f')][_0x779d('0x4a')]){_0x598058['where']=_['merge'](_0x598058[_0x779d('0x48')],{'$or':_['map'](_0x598058['attributes'],function(_0x5569ed){var _0x25a597={};_0x25a597[_0x5569ed]={'$like':'%'+_0xc09cbd[_0x779d('0x3f')]['filter']+'%'};return _0x25a597;})});}_0x598058=_[_0x779d('0x4b')]({},_0x598058,_0xc09cbd['options']);return db[_0x779d('0x62')][_0x779d('0x51')](_0x598058);}})[_0x779d('0x1c')](function(_0x2fe516){if(_0x2fe516){return db[_0x779d('0x63')][_0x779d('0x64')]({'where':{'id':_['map'](_0x2fe516,_0x779d('0x65')),'role':_0x779d('0x66')},'attributes':['id','name',_0x779d('0x67'),_0x779d('0x68'),_0x779d('0x69')]});}})[_0x779d('0x1c')](function(_0xde3c95){if(_0xde3c95){return{'count':_0xde3c95[_0x779d('0x2b')],'rows':_[_0x779d('0x38')](_0xde3c95['rows'],function(_0x2b89be){return{'membername':_0x2b89be[_0x779d('0x35')],'UserId':_0x2b89be['id'],'queue_name':_0x579a39['name'],'ChatQueueId':_0x579a39['id'],'interface':util[_0x779d('0x6a')]('%s/%s',_0x779d('0x6b'),_0x2b89be[_0x779d('0x35')]),'penalty':0x0,'paused':_0x2b89be[_0x779d('0x67')],'createdAt':_0x2b89be['createdAt'],'updatedAt':_0x2b89be[_0x779d('0x68')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x779d('0x1c')](respondWithFilteredResult(_0xf18e27,_0x598058))[_0x779d('0x27')](handleError(_0xf18e27,null));};exports[_0x779d('0x6c')]=function(_0x3f5f64,_0x20c201,_0x370cf8){var _0x300974={};var _0x2e92ed={};var _0x45e96f;var _0x1c0a58;return db['ChatQueue']['findOne']({'where':{'id':_0x3f5f64[_0x779d('0x5d')]['id']}})[_0x779d('0x1c')](handleEntityNotFound(_0x20c201,null))[_0x779d('0x1c')](function(_0x462999){if(_0x462999){_0x45e96f=_0x462999;_0x2e92ed[_0x779d('0x3d')]=_[_0x779d('0x3e')](db[_0x779d('0x6d')][_0x779d('0x3a')]);_0x2e92ed[_0x779d('0x3f')]=_[_0x779d('0x3e')](_0x3f5f64[_0x779d('0x3f')]);_0x2e92ed[_0x779d('0x40')]=_[_0x779d('0x42')](_0x2e92ed[_0x779d('0x3d')],_0x2e92ed['query']);_0x300974[_0x779d('0x41')]=_[_0x779d('0x42')](_0x2e92ed[_0x779d('0x3d')],qs[_0x779d('0x43')](_0x3f5f64[_0x779d('0x3f')][_0x779d('0x43')]));_0x300974[_0x779d('0x41')]=_0x300974[_0x779d('0x41')]['length']?_0x300974['attributes']:_0x2e92ed[_0x779d('0x3d')];_0x300974['order']=qs[_0x779d('0x47')](_0x3f5f64[_0x779d('0x3f')][_0x779d('0x47')]);_0x300974[_0x779d('0x48')]=qs[_0x779d('0x40')](_[_0x779d('0x49')](_0x3f5f64[_0x779d('0x3f')],_0x2e92ed[_0x779d('0x40')]));if(_0x3f5f64[_0x779d('0x3f')][_0x779d('0x4a')]){_0x300974[_0x779d('0x48')]=_[_0x779d('0x4b')](_0x300974[_0x779d('0x48')],{'$or':_[_0x779d('0x38')](_0x300974[_0x779d('0x41')],function(_0x1f498a){var _0x378eea={};_0x378eea[_0x1f498a]={'$like':'%'+_0x3f5f64[_0x779d('0x3f')][_0x779d('0x4a')]+'%'};return _0x378eea;})});}_0x300974=_[_0x779d('0x4b')]({},_0x300974,_0x3f5f64[_0x779d('0x4e')]);return _0x45e96f[_0x779d('0x6c')](_0x300974);}})[_0x779d('0x1c')](function(_0x4aac4c){if(_0x4aac4c){_0x1c0a58=_0x4aac4c[_0x779d('0x54')];if(!_0x3f5f64[_0x779d('0x3f')][_0x779d('0x44')]('nolimit')){_0x300974[_0x779d('0x2d')]=qs[_0x779d('0x2d')](_0x3f5f64[_0x779d('0x3f')][_0x779d('0x2d')]);_0x300974[_0x779d('0x2c')]=qs['offset'](_0x3f5f64[_0x779d('0x3f')][_0x779d('0x2c')]);}return _0x45e96f[_0x779d('0x6c')](_0x300974);}})[_0x779d('0x1c')](function(_0x448717){if(_0x448717){return _0x448717?{'count':_0x1c0a58,'rows':_0x448717}:null;}})['then'](respondWithResult(_0x20c201,null))[_0x779d('0x27')](handleError(_0x20c201,null));};exports[_0x779d('0x6e')]=function(_0x56021c,_0x1ba2b7,_0x182322){var _0x3b5199=_0x56021c['body'][_0x779d('0x6f')];return db[_0x779d('0x6d')][_0x779d('0x51')]({'where':{'id':_0x3b5199},'attributes':['id'],'include':[{'model':db[_0x779d('0x63')],'as':_0x779d('0x70'),'attributes':['id',_0x779d('0x35'),_0x779d('0x71'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0x412da7){if(_0x412da7){var _0x5143ab=_[_0x779d('0x72')](_0x412da7,function(_0x12bc63){var _0x5a2fe2=_0x12bc63[_0x779d('0x34')]({'plain':!![]});return _0x5a2fe2[_0x779d('0x70')];});return db[_0x779d('0x39')]['find']({'where':{'id':_0x56021c[_0x779d('0x5d')]['id']}})[_0x779d('0x1c')](function(_0x52ced5){return db['sequelize'][_0x779d('0x73')](function(_0x306783){return _0x52ced5[_0x779d('0x6e')](_0x3b5199,{'transaction':_0x306783})[_0x779d('0x1c')](function(){return BPromise[_0x779d('0x74')](_0x5143ab,function(_0x1cbe45){return db[_0x779d('0x62')]['findOrCreate']({'where':{'UserId':_0x1cbe45['id'],'ChatQueueId':_0x56021c[_0x779d('0x5d')]['id']},'transaction':_0x306783});});})[_0x779d('0x1c')](function(){_0x5143ab[_0x779d('0x75')](function(_0x7ead9d){socket[_0x779d('0x76')](_0x779d('0x77'),{'UserId':_0x7ead9d['id'],'ChatQueueId':_0x52ced5['id']});});});});});}})[_0x779d('0x1c')](respondWithStatusCode(_0x1ba2b7,null))[_0x779d('0x27')](handleError(_0x1ba2b7,null));};exports[_0x779d('0x78')]=function(_0x24bfd6,_0x206dd8,_0x27282b){return db[_0x779d('0x6d')]['findAll']({'where':{'id':_0x24bfd6[_0x779d('0x3f')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x779d('0x70'),'attributes':['id'],'raw':!![]}]})[_0x779d('0x1c')](handleEntityNotFound(_0x206dd8,null))[_0x779d('0x1c')](function(_0x185c98){var _0x2e7fc1=_[_0x779d('0x38')](_0x185c98,'id');var _0x5f105a=[];var _0x115d1a=[];var _0x123a84=squel['select']();_0x123a84[_0x779d('0x79')](_0x779d('0x7a'))[_0x779d('0x7b')]('team_has_chat_queues','tq')['join'](_0x779d('0x7c'),'ut',_0x779d('0x7d'))['where'](_0x779d('0x7e'),_0x24bfd6['params']['id']);for(var _0x3a4e27=0x0;_0x3a4e27<_0x185c98['length'];_0x3a4e27+=0x1){let _0x3dfb63=_0x185c98[_0x3a4e27];for(var _0x55c2f1=0x0;_0x55c2f1<_0x3dfb63[_0x779d('0x70')][_0x779d('0x54')];_0x55c2f1+=0x1){let _0x264669=_0x3dfb63[_0x779d('0x70')][_0x55c2f1];var _0x52ba76=_0x123a84['clone']();_0x52ba76[_0x779d('0x48')](_0x779d('0x7f'),_0x264669['id']);_0x115d1a[_0x779d('0x80')](db[_0x779d('0x81')][_0x779d('0x3f')](_0x52ba76['toString'](),{'type':db[_0x779d('0x81')][_0x779d('0x82')][_0x779d('0x83')]})['then'](function(_0x35d201){if(_0x35d201[_0x779d('0x54')]===0x1){return _0x264669['id'];}else{var _0x214e7a=_[_0x779d('0x84')](_['map'](_0x35d201,_0x779d('0x85')),function(_0x117835){return _[_0x779d('0x86')](_0x2e7fc1,_0x117835);});if(_0x214e7a){return _0x264669['id'];}}}));}}return BPromise[_0x779d('0x87')](_0x115d1a)['then'](function(_0x77f3f){_0x5f105a=_(_0x5f105a)[_0x779d('0x88')](_0x77f3f)[_0x779d('0x89')]()[_0x779d('0x8a')]();return db['ChatQueue'][_0x779d('0x55')]({'where':{'id':_0x24bfd6['params']['id']}})[_0x779d('0x1c')](function(_0x380ad2){return db[_0x779d('0x81')][_0x779d('0x73')](function(_0x19b645){return _0x380ad2[_0x779d('0x78')](_0x24bfd6[_0x779d('0x3f')]['ids'],{'transaction':_0x19b645})['then'](function(){if(!_['isEmpty'](_0x5f105a)){return _0x380ad2[_0x779d('0x8b')](_0x5f105a,{'transaction':_0x19b645});}})[_0x779d('0x1c')](function(){_0x5f105a['forEach'](function(_0x4e2fab){socket['emit'](_0x779d('0x8c'),{'UserId':_0x4e2fab,'ChatQueueId':_0x380ad2['id']});});});});});});})[_0x779d('0x1c')](respondWithStatusCode(_0x206dd8,null))[_0x779d('0x27')](handleError(_0x206dd8,null));};exports[_0x779d('0x8d')]=function(_0x271cfb,_0x2aca7e,_0x15fb1d){return db[_0x779d('0x39')][_0x779d('0x55')]({'where':{'id':_0x271cfb[_0x779d('0x5d')]['id']}})[_0x779d('0x1c')](handleEntityNotFound(_0x2aca7e,null))[_0x779d('0x1c')](function(_0x519a62){if(_0x519a62){return _0x519a62['addAgents'](_0x271cfb[_0x779d('0x57')][_0x779d('0x6f')],_['omit'](_0x271cfb[_0x779d('0x57')],['ids','id'])||{})[_0x779d('0x8e')](function(_0x243db1){for(var _0x3fb08b=0x0;_0x3fb08b<_0x271cfb[_0x779d('0x57')][_0x779d('0x6f')][_0x779d('0x54')];_0x3fb08b+=0x1){socket['emit']('userChatQueue:save',{'UserId':Number(_0x271cfb[_0x779d('0x57')][_0x779d('0x6f')][_0x3fb08b]),'ChatQueueId':Number(_0x271cfb['params']['id'])});}return _0x243db1;});}})[_0x779d('0x1c')](respondWithResult(_0x2aca7e,null))[_0x779d('0x27')](handleError(_0x2aca7e,null));};exports['removeAgents']=function(_0x437535,_0x5adba8,_0x28ee49){return db[_0x779d('0x39')]['find']({'where':{'id':_0x437535[_0x779d('0x5d')]['id']}})[_0x779d('0x1c')](handleEntityNotFound(_0x5adba8,null))[_0x779d('0x1c')](function(_0x2c60dc){if(_0x2c60dc){return _0x2c60dc[_0x779d('0x8b')](_0x437535[_0x779d('0x3f')][_0x779d('0x6f')])[_0x779d('0x1c')](function(){if(_[_0x779d('0x8f')](_0x437535[_0x779d('0x3f')]['ids'])){for(var _0x1cdacb=0x0;_0x1cdacb<_0x437535[_0x779d('0x3f')][_0x779d('0x6f')][_0x779d('0x54')];_0x1cdacb+=0x1){socket[_0x779d('0x76')](_0x779d('0x8c'),{'UserId':Number(_0x437535[_0x779d('0x3f')][_0x779d('0x6f')][_0x1cdacb]),'ChatQueueId':Number(_0x437535[_0x779d('0x5d')]['id'])});}}else{socket[_0x779d('0x76')]('userChatQueue:remove',{'UserId':Number(_0x437535[_0x779d('0x3f')][_0x779d('0x6f')]),'ChatQueueId':Number(_0x437535[_0x779d('0x5d')]['id'])});}});}})[_0x779d('0x1c')](respondWithStatusCode(_0x5adba8,null))['catch'](handleError(_0x5adba8,null));};exports['getAgents']=function(_0x27484f,_0x49948d,_0x5ccf89){var _0x2d364e={};var _0x34daf3={};var _0x5a992a;var _0x57eecc;return db[_0x779d('0x39')][_0x779d('0x60')]({'where':{'id':_0x27484f[_0x779d('0x5d')]['id']}})[_0x779d('0x1c')](handleEntityNotFound(_0x49948d,null))[_0x779d('0x1c')](function(_0xdd9b3a){if(_0xdd9b3a){_0x5a992a=_0xdd9b3a;_0x34daf3[_0x779d('0x3d')]=_['keys'](db[_0x779d('0x63')][_0x779d('0x3a')]);_0x34daf3[_0x779d('0x3f')]=_[_0x779d('0x3e')](_0x27484f[_0x779d('0x3f')]);_0x34daf3['filters']=_[_0x779d('0x42')](_0x34daf3[_0x779d('0x3d')],_0x34daf3['query']);_0x2d364e[_0x779d('0x41')]=_[_0x779d('0x42')](_0x34daf3['model'],qs[_0x779d('0x43')](_0x27484f[_0x779d('0x3f')]['fields']));_0x2d364e[_0x779d('0x41')]=_0x2d364e[_0x779d('0x41')]['length']?_0x2d364e[_0x779d('0x41')]:_0x34daf3[_0x779d('0x3d')];_0x2d364e[_0x779d('0x46')]=qs['sort'](_0x27484f[_0x779d('0x3f')][_0x779d('0x47')]);_0x2d364e[_0x779d('0x48')]=qs[_0x779d('0x40')](_[_0x779d('0x49')](_0x27484f[_0x779d('0x3f')],_0x34daf3[_0x779d('0x40')]));if(_0x27484f['query'][_0x779d('0x4a')]){_0x2d364e['where']=_['merge'](_0x2d364e['where'],{'$or':_[_0x779d('0x38')](_0x2d364e[_0x779d('0x41')],function(_0x1d900e){var _0x3f4716={};_0x3f4716[_0x1d900e]={'$like':'%'+_0x27484f[_0x779d('0x3f')][_0x779d('0x4a')]+'%'};return _0x3f4716;})});}_0x2d364e=_['merge']({},_0x2d364e,_0x27484f['options']);return _0x5a992a[_0x779d('0x90')](_0x2d364e);}})[_0x779d('0x1c')](function(_0xeee092){if(_0xeee092){_0x57eecc=_0xeee092[_0x779d('0x54')];if(!_0x27484f[_0x779d('0x3f')][_0x779d('0x44')](_0x779d('0x45'))){_0x2d364e[_0x779d('0x2d')]=qs[_0x779d('0x2d')](_0x27484f[_0x779d('0x3f')]['limit']);_0x2d364e[_0x779d('0x2c')]=qs['offset'](_0x27484f[_0x779d('0x3f')]['offset']);}return _0x5a992a[_0x779d('0x90')](_0x2d364e);}})['then'](function(_0x21cadf){if(_0x21cadf){return _0x21cadf?{'count':_0x57eecc,'rows':_0x21cadf}:null;}})[_0x779d('0x1c')](respondWithResult(_0x49948d,null))[_0x779d('0x27')](handleError(_0x49948d,null));}; \ No newline at end of file +var _0x4cc4=['voicePause','sequelize','transaction','findOrCreate','forEach','userChatQueue:save','select','tq.TeamId','join','user_has_teams','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','TeamId','union','compact','value','removeTeams','removeAgents','emit','userChatQueue:remove','addAgents','omit','isArray','getAgents','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','register','client','http','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','reject','save','update','then','get','destroy','end','stack','name','send','map','fieldName','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','ChatQueue','include','findAll','rows','show','params','rawAttributes','includeAll','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ChatQueues','UserProfileSection','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ChatQueueId','UserChatQueue','User','UserId','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','Team','addTeams','ids','Agents','online'];(function(_0x123155,_0x27038d){var _0x9cb7d2=function(_0x51dd82){while(--_0x51dd82){_0x123155['push'](_0x123155['shift']());}};_0x9cb7d2(++_0x27038d);}(_0x4cc4,0x1d0));var _0x44cc=function(_0x21ac1a,_0x558076){_0x21ac1a=_0x21ac1a-0x0;var _0x131fb3=_0x4cc4[_0x21ac1a];return _0x131fb3;};'use strict';var emlformat=require(_0x44cc('0x0'));var rimraf=require(_0x44cc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x44cc('0x2'));var moment=require(_0x44cc('0x3'));var BPromise=require(_0x44cc('0x4'));var Mustache=require(_0x44cc('0x5'));var util=require(_0x44cc('0x6'));var path=require(_0x44cc('0x7'));var sox=require(_0x44cc('0x8'));var csv=require(_0x44cc('0x9'));var ejs=require(_0x44cc('0xa'));var fs=require('fs');var fs_extra=require(_0x44cc('0xb'));var _=require(_0x44cc('0xc'));var squel=require('squel');var crypto=require(_0x44cc('0xd'));var jsforce=require(_0x44cc('0xe'));var deskjs=require(_0x44cc('0xf'));var toCsv=require(_0x44cc('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x44cc('0x10'));var authService=require(_0x44cc('0x11'));var qs=require(_0x44cc('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x44cc('0x13'));var logger=require(_0x44cc('0x14'))(_0x44cc('0x15'));var utils=require(_0x44cc('0x16'));var config=require(_0x44cc('0x17'));var licenseUtil=require(_0x44cc('0x18'));var db=require(_0x44cc('0x19'))['db'];config[_0x44cc('0x1a')]=_['defaults'](config[_0x44cc('0x1a')],{'host':_0x44cc('0x1b'),'port':0x18eb});var socket=require(_0x44cc('0x1c'))(new Redis(config[_0x44cc('0x1a')]));require(_0x44cc('0x1d'))[_0x44cc('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x44cc('0x1f')][_0x44cc('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x2932d3,_0x51e82c,_0x11cb24,_0x2e1c66){return new BPromise(function(_0x40cf8a,_0x23e388){var _0x16e09c=_0x2e1c66||client;return _0x16e09c[_0x44cc('0x21')](_0x2932d3,_0x11cb24)['then'](function(_0x575346){logger[_0x44cc('0x22')](_0x44cc('0x23'),_0x51e82c,_0x44cc('0x24'));logger['debug'](_0x44cc('0x25'),_0x51e82c,_0x44cc('0x24'),JSON['stringify'](_0x575346));if(_0x575346[_0x44cc('0x26')]){if(_0x575346['error'][_0x44cc('0x27')]===0x1f4){logger['error'](_0x44cc('0x23'),_0x51e82c,_0x575346[_0x44cc('0x26')][_0x44cc('0x28')]);return _0x23e388(_0x575346['error'][_0x44cc('0x28')]);}logger[_0x44cc('0x26')](_0x44cc('0x23'),_0x51e82c,_0x575346['error'][_0x44cc('0x28')]);return _0x40cf8a(_0x575346['error'][_0x44cc('0x28')]);}else{logger['info'](_0x44cc('0x23'),_0x51e82c,'request\x20sent');_0x40cf8a(_0x575346[_0x44cc('0x29')][_0x44cc('0x28')]);}})[_0x44cc('0x2a')](function(_0x1d9176){logger[_0x44cc('0x26')](_0x44cc('0x23'),_0x51e82c,_0x1d9176);_0x23e388(_0x1d9176);});});}function respondWithStatusCode(_0x3cc8f6,_0x404f4d){_0x404f4d=_0x404f4d||0xcc;return function(_0xff2d5e){if(_0xff2d5e){return _0x3cc8f6[_0x44cc('0x2b')](_0x404f4d);}return _0x3cc8f6[_0x44cc('0x2c')](_0x404f4d)['end']();};}function respondWithResult(_0x2caaba,_0x5f4311){_0x5f4311=_0x5f4311||0xc8;return function(_0x227a93){if(_0x227a93){return _0x2caaba[_0x44cc('0x2c')](_0x5f4311)['json'](_0x227a93);}};}function respondWithFilteredResult(_0x5041b7,_0x1053e7){return function(_0x3f9d56){if(_0x3f9d56){var _0xd4d3e2=typeof _0x1053e7['offset']===_0x44cc('0x2d')&&typeof _0x1053e7[_0x44cc('0x2e')]===_0x44cc('0x2d');var _0x2e45c4=_0x3f9d56[_0x44cc('0x2f')];var _0x362ab1=_0xd4d3e2?0x0:_0x1053e7['offset'];var _0x1a35da=_0xd4d3e2?_0x3f9d56[_0x44cc('0x2f')]:_0x1053e7[_0x44cc('0x30')]+_0x1053e7[_0x44cc('0x2e')];var _0x45fdc3;if(_0x1a35da>=_0x2e45c4){_0x1a35da=_0x2e45c4;_0x45fdc3=0xc8;}else{_0x45fdc3=0xce;}_0x5041b7['status'](_0x45fdc3);return _0x5041b7[_0x44cc('0x31')](_0x44cc('0x32'),_0x362ab1+'-'+_0x1a35da+'/'+_0x2e45c4)[_0x44cc('0x33')](_0x3f9d56);}return null;};}function patchUpdates(_0x4a4c6a){return function(_0x1d459e){try{jsonpatch['apply'](_0x1d459e,_0x4a4c6a,!![]);}catch(_0x338a1a){return BPromise[_0x44cc('0x34')](_0x338a1a);}return _0x1d459e[_0x44cc('0x35')]();};}function saveUpdates(_0x3084b0,_0x350057){return function(_0x4d196b){if(_0x4d196b){return _0x4d196b[_0x44cc('0x36')](_0x3084b0)[_0x44cc('0x37')](function(_0x22ff66){return _0x22ff66;});}return null;};}function removeEntity(_0xae6de5,_0xc79919){return function(_0x2007bb){if(_0x2007bb){return _0x2007bb['destroy']()[_0x44cc('0x37')](function(){var _0x51926e=_0x2007bb[_0x44cc('0x38')]({'plain':!![]});var _0x3c5496='ChatQueues';return db['UserProfileResource'][_0x44cc('0x39')]({'where':{'type':_0x3c5496,'resourceId':_0x51926e['id']}})[_0x44cc('0x37')](function(){return _0x2007bb;});})['then'](function(){_0xae6de5['status'](0xcc)[_0x44cc('0x3a')]();});}};}function handleEntityNotFound(_0x317d76,_0x4841ce){return function(_0x26a04b){if(!_0x26a04b){_0x317d76[_0x44cc('0x2b')](0x194);}return _0x26a04b;};}function handleError(_0x4bda34,_0x534a00){_0x534a00=_0x534a00||0x1f4;return function(_0x4ed7ca){logger['error'](_0x4ed7ca[_0x44cc('0x3b')]);if(_0x4ed7ca[_0x44cc('0x3c')]){delete _0x4ed7ca[_0x44cc('0x3c')];}_0x4bda34[_0x44cc('0x2c')](_0x534a00)[_0x44cc('0x3d')](_0x4ed7ca);};}exports['index']=function(_0x4a742f,_0x2a78c7){var _0x45bff3={},_0x3c56ef={},_0x50dc6c={'count':0x0,'rows':[]};var _0x110d13=_[_0x44cc('0x3e')](db['ChatQueue']['rawAttributes'],function(_0x2e21b9){return{'name':_0x2e21b9[_0x44cc('0x3f')],'type':_0x2e21b9['type'][_0x44cc('0x40')]};});_0x3c56ef['model']=_[_0x44cc('0x3e')](_0x110d13,_0x44cc('0x3c'));_0x3c56ef['query']=_[_0x44cc('0x41')](_0x4a742f[_0x44cc('0x42')]);_0x3c56ef[_0x44cc('0x43')]=_[_0x44cc('0x44')](_0x3c56ef[_0x44cc('0x45')],_0x3c56ef['query']);_0x45bff3['attributes']=_[_0x44cc('0x44')](_0x3c56ef[_0x44cc('0x45')],qs[_0x44cc('0x46')](_0x4a742f['query']['fields']));_0x45bff3[_0x44cc('0x47')]=_0x45bff3[_0x44cc('0x47')][_0x44cc('0x48')]?_0x45bff3[_0x44cc('0x47')]:_0x3c56ef['model'];if(!_0x4a742f[_0x44cc('0x42')][_0x44cc('0x49')](_0x44cc('0x4a'))){_0x45bff3[_0x44cc('0x2e')]=qs['limit'](_0x4a742f[_0x44cc('0x42')]['limit']);_0x45bff3[_0x44cc('0x30')]=qs[_0x44cc('0x30')](_0x4a742f[_0x44cc('0x42')]['offset']);}_0x45bff3[_0x44cc('0x4b')]=qs[_0x44cc('0x4c')](_0x4a742f[_0x44cc('0x42')][_0x44cc('0x4c')]);_0x45bff3[_0x44cc('0x4d')]=qs[_0x44cc('0x43')](_[_0x44cc('0x4e')](_0x4a742f[_0x44cc('0x42')],_0x3c56ef[_0x44cc('0x43')]),_0x110d13);if(_0x4a742f['query'][_0x44cc('0x4f')]){_0x45bff3['where']=_[_0x44cc('0x50')](_0x45bff3[_0x44cc('0x4d')],{'$or':_[_0x44cc('0x3e')](_0x110d13,function(_0x499968){if(_0x499968[_0x44cc('0x51')]!=='VIRTUAL'){var _0x415bba={};_0x415bba[_0x499968[_0x44cc('0x3c')]]={'$like':'%'+_0x4a742f[_0x44cc('0x42')]['filter']+'%'};return _0x415bba;}})});}_0x45bff3=_[_0x44cc('0x50')]({},_0x45bff3,_0x4a742f[_0x44cc('0x52')]);var _0x37cccf={'where':_0x45bff3[_0x44cc('0x4d')]};return db[_0x44cc('0x53')][_0x44cc('0x2f')](_0x37cccf)['then'](function(_0x45ce87){_0x50dc6c['count']=_0x45ce87;if(_0x4a742f[_0x44cc('0x42')]['includeAll']){_0x45bff3[_0x44cc('0x54')]=[{'all':!![]}];}return db[_0x44cc('0x53')][_0x44cc('0x55')](_0x45bff3);})[_0x44cc('0x37')](function(_0x5070c6){_0x50dc6c[_0x44cc('0x56')]=_0x5070c6;return _0x50dc6c;})['then'](respondWithFilteredResult(_0x2a78c7,_0x45bff3))['catch'](handleError(_0x2a78c7,null));};exports[_0x44cc('0x57')]=function(_0xd840b2,_0x634450){var _0xf71c3b={'raw':!![],'where':{'id':_0xd840b2[_0x44cc('0x58')]['id']}},_0x250c15={};_0x250c15['model']=_[_0x44cc('0x41')](db[_0x44cc('0x53')][_0x44cc('0x59')]);_0x250c15[_0x44cc('0x42')]=_[_0x44cc('0x41')](_0xd840b2['query']);_0x250c15[_0x44cc('0x43')]=_[_0x44cc('0x44')](_0x250c15[_0x44cc('0x45')],_0x250c15[_0x44cc('0x42')]);_0xf71c3b[_0x44cc('0x47')]=_['intersection'](_0x250c15[_0x44cc('0x45')],qs[_0x44cc('0x46')](_0xd840b2['query'][_0x44cc('0x46')]));_0xf71c3b['attributes']=_0xf71c3b[_0x44cc('0x47')][_0x44cc('0x48')]?_0xf71c3b[_0x44cc('0x47')]:_0x250c15[_0x44cc('0x45')];if(_0xd840b2['query'][_0x44cc('0x5a')]){_0xf71c3b['include']=[{'all':!![]}];}_0xf71c3b=_[_0x44cc('0x50')]({},_0xf71c3b,_0xd840b2[_0x44cc('0x52')]);return db[_0x44cc('0x53')]['find'](_0xf71c3b)[_0x44cc('0x37')](handleEntityNotFound(_0x634450,null))[_0x44cc('0x37')](respondWithResult(_0x634450,null))[_0x44cc('0x2a')](handleError(_0x634450,null));};exports['create']=function(_0x20bd6e,_0x3d6c86){return db[_0x44cc('0x53')][_0x44cc('0x5b')](_0x20bd6e[_0x44cc('0x5c')],{})[_0x44cc('0x37')](function(_0x4d8466){var _0x1b9ad9=_0x20bd6e['user'][_0x44cc('0x38')]({'plain':!![]});if(!_0x1b9ad9)throw new Error(_0x44cc('0x5d'));if(_0x1b9ad9[_0x44cc('0x5e')]===_0x44cc('0x5f')){var _0x20d7d4=_0x4d8466['get']({'plain':!![]});var _0x10df60=_0x44cc('0x60');return db[_0x44cc('0x61')][_0x44cc('0x62')]({'where':{'name':_0x10df60,'userProfileId':_0x1b9ad9['userProfileId']},'raw':!![]})[_0x44cc('0x37')](function(_0x12e9f9){if(_0x12e9f9&&_0x12e9f9[_0x44cc('0x63')]===0x0){return db[_0x44cc('0x64')]['create']({'name':_0x20d7d4[_0x44cc('0x3c')],'resourceId':_0x20d7d4['id'],'type':_0x12e9f9['name'],'sectionId':_0x12e9f9['id']},{})['then'](function(){return _0x4d8466;});}else{return _0x4d8466;}})['catch'](function(_0x247d7c){logger[_0x44cc('0x26')](_0x44cc('0x65'),_0x247d7c);throw _0x247d7c;});}return _0x4d8466;})['then'](respondWithResult(_0x3d6c86,0xc9))[_0x44cc('0x2a')](handleError(_0x3d6c86,null));};exports[_0x44cc('0x36')]=function(_0x208351,_0x24761b){if(_0x208351['body']['id']){delete _0x208351[_0x44cc('0x5c')]['id'];}return db[_0x44cc('0x53')]['find']({'where':{'id':_0x208351['params']['id']}})[_0x44cc('0x37')](handleEntityNotFound(_0x24761b,null))[_0x44cc('0x37')](saveUpdates(_0x208351[_0x44cc('0x5c')],null))['then'](respondWithResult(_0x24761b,null))[_0x44cc('0x2a')](handleError(_0x24761b,null));};exports[_0x44cc('0x39')]=function(_0x5e9f13,_0x18111d){return db[_0x44cc('0x53')]['find']({'where':{'id':_0x5e9f13[_0x44cc('0x58')]['id']}})[_0x44cc('0x37')](handleEntityNotFound(_0x18111d,null))['then'](removeEntity(_0x18111d,null))[_0x44cc('0x2a')](handleError(_0x18111d,null));};exports[_0x44cc('0x66')]=function(_0x424731,_0x349373){return db[_0x44cc('0x53')][_0x44cc('0x66')]()[_0x44cc('0x37')](respondWithResult(_0x349373,null))[_0x44cc('0x2a')](handleError(_0x349373,null));};exports['getMembers']=function(_0x1f880e,_0x2da817,_0x127887){var _0x184e96={'raw':!![],'where':{}},_0x1afd80={},_0x484553;return db[_0x44cc('0x53')]['findOne']({'where':{'id':_0x1f880e[_0x44cc('0x58')]['id']}})[_0x44cc('0x37')](handleEntityNotFound(_0x2da817,null))[_0x44cc('0x37')](function(_0x2f9873){if(_0x2f9873){_0x484553=_0x2f9873['get']({'plain':!![]});_0x1afd80[_0x44cc('0x45')]=_[_0x44cc('0x41')](db['UserChatQueue'][_0x44cc('0x59')]);_0x1afd80[_0x44cc('0x42')]=_[_0x44cc('0x41')](_0x1f880e['query']);_0x1afd80[_0x44cc('0x43')]=_[_0x44cc('0x44')](_0x1afd80[_0x44cc('0x45')],_0x1afd80[_0x44cc('0x42')]);_0x184e96['attributes']=_[_0x44cc('0x44')](_0x1afd80['model'],qs[_0x44cc('0x46')](_0x1f880e[_0x44cc('0x42')][_0x44cc('0x46')]));_0x184e96[_0x44cc('0x47')]=_0x184e96[_0x44cc('0x47')][_0x44cc('0x48')]?_0x184e96[_0x44cc('0x47')]:_0x1afd80[_0x44cc('0x45')];if(!_0x1f880e['query'][_0x44cc('0x49')]('nolimit')){_0x184e96[_0x44cc('0x2e')]=qs[_0x44cc('0x2e')](_0x1f880e[_0x44cc('0x42')][_0x44cc('0x2e')]);_0x184e96['offset']=qs[_0x44cc('0x30')](_0x1f880e[_0x44cc('0x42')][_0x44cc('0x30')]);}_0x184e96[_0x44cc('0x4b')]=qs[_0x44cc('0x4c')](_0x1f880e[_0x44cc('0x42')]['sort']);_0x184e96[_0x44cc('0x4d')]=qs[_0x44cc('0x43')](_['pick'](_0x1f880e['query'],_0x1afd80[_0x44cc('0x43')]));_0x184e96[_0x44cc('0x4d')][_0x44cc('0x67')]=_0x2f9873['id'];if(_0x1f880e[_0x44cc('0x42')][_0x44cc('0x4f')]){_0x184e96[_0x44cc('0x4d')]=_[_0x44cc('0x50')](_0x184e96['where'],{'$or':_[_0x44cc('0x3e')](_0x184e96[_0x44cc('0x47')],function(_0x3bb1f1){var _0x2e580a={};_0x2e580a[_0x3bb1f1]={'$like':'%'+_0x1f880e['query']['filter']+'%'};return _0x2e580a;})});}_0x184e96=_[_0x44cc('0x50')]({},_0x184e96,_0x1f880e[_0x44cc('0x52')]);return db[_0x44cc('0x68')][_0x44cc('0x55')](_0x184e96);}})[_0x44cc('0x37')](function(_0x13a497){if(_0x13a497){return db[_0x44cc('0x69')]['findAndCountAll']({'where':{'id':_[_0x44cc('0x3e')](_0x13a497,_0x44cc('0x6a')),'role':'agent'},'attributes':['id','name',_0x44cc('0x6b'),_0x44cc('0x6c'),_0x44cc('0x6d')]});}})[_0x44cc('0x37')](function(_0x4f28b6){if(_0x4f28b6){return{'count':_0x4f28b6[_0x44cc('0x2f')],'rows':_[_0x44cc('0x3e')](_0x4f28b6['rows'],function(_0x587870){return{'membername':_0x587870[_0x44cc('0x3c')],'UserId':_0x587870['id'],'queue_name':_0x484553['name'],'ChatQueueId':_0x484553['id'],'interface':util[_0x44cc('0x6e')](_0x44cc('0x6f'),_0x44cc('0x70'),_0x587870['name']),'penalty':0x0,'paused':_0x587870['chatPause'],'createdAt':_0x587870[_0x44cc('0x6d')],'updatedAt':_0x587870[_0x44cc('0x6c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x44cc('0x37')](respondWithFilteredResult(_0x2da817,_0x184e96))['catch'](handleError(_0x2da817,null));};exports[_0x44cc('0x71')]=function(_0x3522e0,_0x445aeb,_0x2f6151){var _0x387471={};var _0x3689f9={};var _0x3eab21;var _0x73b06d;return db[_0x44cc('0x53')][_0x44cc('0x72')]({'where':{'id':_0x3522e0[_0x44cc('0x58')]['id']}})[_0x44cc('0x37')](handleEntityNotFound(_0x445aeb,null))[_0x44cc('0x37')](function(_0x5aaa88){if(_0x5aaa88){_0x3eab21=_0x5aaa88;_0x3689f9[_0x44cc('0x45')]=_[_0x44cc('0x41')](db[_0x44cc('0x73')][_0x44cc('0x59')]);_0x3689f9[_0x44cc('0x42')]=_[_0x44cc('0x41')](_0x3522e0[_0x44cc('0x42')]);_0x3689f9['filters']=_[_0x44cc('0x44')](_0x3689f9['model'],_0x3689f9[_0x44cc('0x42')]);_0x387471[_0x44cc('0x47')]=_[_0x44cc('0x44')](_0x3689f9[_0x44cc('0x45')],qs[_0x44cc('0x46')](_0x3522e0[_0x44cc('0x42')][_0x44cc('0x46')]));_0x387471['attributes']=_0x387471[_0x44cc('0x47')]['length']?_0x387471[_0x44cc('0x47')]:_0x3689f9['model'];_0x387471[_0x44cc('0x4b')]=qs['sort'](_0x3522e0[_0x44cc('0x42')][_0x44cc('0x4c')]);_0x387471[_0x44cc('0x4d')]=qs[_0x44cc('0x43')](_[_0x44cc('0x4e')](_0x3522e0[_0x44cc('0x42')],_0x3689f9[_0x44cc('0x43')]));if(_0x3522e0['query'][_0x44cc('0x4f')]){_0x387471[_0x44cc('0x4d')]=_[_0x44cc('0x50')](_0x387471[_0x44cc('0x4d')],{'$or':_[_0x44cc('0x3e')](_0x387471[_0x44cc('0x47')],function(_0x3b9e24){var _0x273df5={};_0x273df5[_0x3b9e24]={'$like':'%'+_0x3522e0[_0x44cc('0x42')][_0x44cc('0x4f')]+'%'};return _0x273df5;})});}_0x387471=_['merge']({},_0x387471,_0x3522e0[_0x44cc('0x52')]);return _0x3eab21['getTeams'](_0x387471);}})[_0x44cc('0x37')](function(_0x3f5929){if(_0x3f5929){_0x73b06d=_0x3f5929['length'];if(!_0x3522e0[_0x44cc('0x42')][_0x44cc('0x49')](_0x44cc('0x4a'))){_0x387471[_0x44cc('0x2e')]=qs[_0x44cc('0x2e')](_0x3522e0['query'][_0x44cc('0x2e')]);_0x387471['offset']=qs[_0x44cc('0x30')](_0x3522e0['query'][_0x44cc('0x30')]);}return _0x3eab21[_0x44cc('0x71')](_0x387471);}})[_0x44cc('0x37')](function(_0x40f5ae){if(_0x40f5ae){return _0x40f5ae?{'count':_0x73b06d,'rows':_0x40f5ae}:null;}})[_0x44cc('0x37')](respondWithResult(_0x445aeb,null))['catch'](handleError(_0x445aeb,null));};exports[_0x44cc('0x74')]=function(_0x277731,_0x42b679,_0x3fa342){var _0x536605=_0x277731[_0x44cc('0x5c')][_0x44cc('0x75')];return db[_0x44cc('0x73')][_0x44cc('0x55')]({'where':{'id':_0x536605},'attributes':['id'],'include':[{'model':db[_0x44cc('0x69')],'as':_0x44cc('0x76'),'attributes':['id','name',_0x44cc('0x77'),_0x44cc('0x78'),'interface'],'raw':!![]}]})[_0x44cc('0x37')](function(_0x228f1a){if(_0x228f1a){var _0x3bb4df=_['flatMap'](_0x228f1a,function(_0xf3b6dc){var _0x251a3d=_0xf3b6dc['get']({'plain':!![]});return _0x251a3d[_0x44cc('0x76')];});return db[_0x44cc('0x53')][_0x44cc('0x62')]({'where':{'id':_0x277731[_0x44cc('0x58')]['id']}})['then'](function(_0x27477e){return db[_0x44cc('0x79')][_0x44cc('0x7a')](function(_0x2f5d5b){return _0x27477e[_0x44cc('0x74')](_0x536605,{'transaction':_0x2f5d5b})[_0x44cc('0x37')](function(){return BPromise['each'](_0x3bb4df,function(_0x4de780){return db['UserChatQueue'][_0x44cc('0x7b')]({'where':{'UserId':_0x4de780['id'],'ChatQueueId':_0x277731[_0x44cc('0x58')]['id']},'transaction':_0x2f5d5b});});})['then'](function(){_0x3bb4df[_0x44cc('0x7c')](function(_0x5d9bb8){socket['emit'](_0x44cc('0x7d'),{'UserId':_0x5d9bb8['id'],'ChatQueueId':_0x27477e['id']});});});});});}})['then'](respondWithStatusCode(_0x42b679,null))['catch'](handleError(_0x42b679,null));};exports['removeTeams']=function(_0x3511af,_0x378c1b,_0x34d079){return db['Team'][_0x44cc('0x55')]({'where':{'id':_0x3511af[_0x44cc('0x42')][_0x44cc('0x75')]},'attributes':['id'],'include':[{'model':db[_0x44cc('0x69')],'as':_0x44cc('0x76'),'attributes':['id'],'raw':!![]}]})[_0x44cc('0x37')](handleEntityNotFound(_0x378c1b,null))[_0x44cc('0x37')](function(_0x1f4067){var _0x5e5314=_[_0x44cc('0x3e')](_0x1f4067,'id');var _0x4425ee=[];var _0x1f8dbc=[];var _0x3b3d91=squel[_0x44cc('0x7e')]();_0x3b3d91['field'](_0x44cc('0x7f'))['from']('team_has_chat_queues','tq')[_0x44cc('0x80')](_0x44cc('0x81'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x44cc('0x4d')]('ChatQueueId\x20=\x20?',_0x3511af[_0x44cc('0x58')]['id']);for(var _0x3b4586=0x0;_0x3b4586<_0x1f4067['length'];_0x3b4586+=0x1){let _0x21f105=_0x1f4067[_0x3b4586];for(var _0x56ca63=0x0;_0x56ca63<_0x21f105[_0x44cc('0x76')]['length'];_0x56ca63+=0x1){let _0x169c26=_0x21f105[_0x44cc('0x76')][_0x56ca63];var _0x57bdfd=_0x3b3d91['clone']();_0x57bdfd['where'](_0x44cc('0x82'),_0x169c26['id']);_0x1f8dbc[_0x44cc('0x83')](db['sequelize'][_0x44cc('0x42')](_0x57bdfd['toString'](),{'type':db[_0x44cc('0x79')][_0x44cc('0x84')][_0x44cc('0x85')]})[_0x44cc('0x37')](function(_0x20ae2b){if(_0x20ae2b[_0x44cc('0x48')]===0x1){return _0x169c26['id'];}else{var _0x280ad3=_['every'](_[_0x44cc('0x3e')](_0x20ae2b,_0x44cc('0x86')),function(_0x1edea0){return _['includes'](_0x5e5314,_0x1edea0);});if(_0x280ad3){return _0x169c26['id'];}}}));}}return BPromise['all'](_0x1f8dbc)[_0x44cc('0x37')](function(_0x3f6ade){_0x4425ee=_(_0x4425ee)[_0x44cc('0x87')](_0x3f6ade)[_0x44cc('0x88')]()[_0x44cc('0x89')]();return db['ChatQueue'][_0x44cc('0x62')]({'where':{'id':_0x3511af[_0x44cc('0x58')]['id']}})[_0x44cc('0x37')](function(_0x4a9a37){return db[_0x44cc('0x79')][_0x44cc('0x7a')](function(_0x2c22a8){return _0x4a9a37[_0x44cc('0x8a')](_0x3511af['query'][_0x44cc('0x75')],{'transaction':_0x2c22a8})[_0x44cc('0x37')](function(){if(!_['isEmpty'](_0x4425ee)){return _0x4a9a37[_0x44cc('0x8b')](_0x4425ee,{'transaction':_0x2c22a8});}})[_0x44cc('0x37')](function(){_0x4425ee[_0x44cc('0x7c')](function(_0x5edbc5){socket[_0x44cc('0x8c')](_0x44cc('0x8d'),{'UserId':_0x5edbc5,'ChatQueueId':_0x4a9a37['id']});});});});});});})[_0x44cc('0x37')](respondWithStatusCode(_0x378c1b,null))['catch'](handleError(_0x378c1b,null));};exports[_0x44cc('0x8e')]=function(_0x529eca,_0x1b58f8,_0x84f7d4){return db[_0x44cc('0x53')][_0x44cc('0x62')]({'where':{'id':_0x529eca[_0x44cc('0x58')]['id']}})[_0x44cc('0x37')](handleEntityNotFound(_0x1b58f8,null))['then'](function(_0x24bad9){if(_0x24bad9){return _0x24bad9['addAgents'](_0x529eca[_0x44cc('0x5c')][_0x44cc('0x75')],_[_0x44cc('0x8f')](_0x529eca['body'],[_0x44cc('0x75'),'id'])||{})['spread'](function(_0x31f66f){for(var _0x2085fb=0x0;_0x2085fb<_0x529eca[_0x44cc('0x5c')][_0x44cc('0x75')][_0x44cc('0x48')];_0x2085fb+=0x1){socket[_0x44cc('0x8c')](_0x44cc('0x7d'),{'UserId':Number(_0x529eca[_0x44cc('0x5c')][_0x44cc('0x75')][_0x2085fb]),'ChatQueueId':Number(_0x529eca[_0x44cc('0x58')]['id'])});}return _0x31f66f;});}})[_0x44cc('0x37')](respondWithResult(_0x1b58f8,null))['catch'](handleError(_0x1b58f8,null));};exports[_0x44cc('0x8b')]=function(_0x16bca4,_0x57025d,_0x5edcff){return db['ChatQueue'][_0x44cc('0x62')]({'where':{'id':_0x16bca4[_0x44cc('0x58')]['id']}})[_0x44cc('0x37')](handleEntityNotFound(_0x57025d,null))[_0x44cc('0x37')](function(_0xa18d59){if(_0xa18d59){return _0xa18d59[_0x44cc('0x8b')](_0x16bca4['query']['ids'])[_0x44cc('0x37')](function(){if(_[_0x44cc('0x90')](_0x16bca4[_0x44cc('0x42')][_0x44cc('0x75')])){for(var _0x4b1784=0x0;_0x4b1784<_0x16bca4[_0x44cc('0x42')][_0x44cc('0x75')][_0x44cc('0x48')];_0x4b1784+=0x1){socket[_0x44cc('0x8c')](_0x44cc('0x8d'),{'UserId':Number(_0x16bca4[_0x44cc('0x42')][_0x44cc('0x75')][_0x4b1784]),'ChatQueueId':Number(_0x16bca4[_0x44cc('0x58')]['id'])});}}else{socket[_0x44cc('0x8c')](_0x44cc('0x8d'),{'UserId':Number(_0x16bca4[_0x44cc('0x42')][_0x44cc('0x75')]),'ChatQueueId':Number(_0x16bca4['params']['id'])});}});}})[_0x44cc('0x37')](respondWithStatusCode(_0x57025d,null))[_0x44cc('0x2a')](handleError(_0x57025d,null));};exports[_0x44cc('0x91')]=function(_0x1b3da0,_0x56281c,_0x9d0efa){var _0x1cc770={};var _0x725d83={};var _0x589539;var _0x2cb9f7;return db['ChatQueue'][_0x44cc('0x72')]({'where':{'id':_0x1b3da0[_0x44cc('0x58')]['id']}})[_0x44cc('0x37')](handleEntityNotFound(_0x56281c,null))[_0x44cc('0x37')](function(_0x4adb5e){if(_0x4adb5e){_0x589539=_0x4adb5e;_0x725d83['model']=_[_0x44cc('0x41')](db[_0x44cc('0x69')][_0x44cc('0x59')]);_0x725d83[_0x44cc('0x42')]=_[_0x44cc('0x41')](_0x1b3da0[_0x44cc('0x42')]);_0x725d83[_0x44cc('0x43')]=_[_0x44cc('0x44')](_0x725d83[_0x44cc('0x45')],_0x725d83[_0x44cc('0x42')]);_0x1cc770[_0x44cc('0x47')]=_['intersection'](_0x725d83['model'],qs[_0x44cc('0x46')](_0x1b3da0[_0x44cc('0x42')][_0x44cc('0x46')]));_0x1cc770[_0x44cc('0x47')]=_0x1cc770[_0x44cc('0x47')][_0x44cc('0x48')]?_0x1cc770['attributes']:_0x725d83[_0x44cc('0x45')];_0x1cc770[_0x44cc('0x4b')]=qs[_0x44cc('0x4c')](_0x1b3da0[_0x44cc('0x42')]['sort']);_0x1cc770[_0x44cc('0x4d')]=qs[_0x44cc('0x43')](_[_0x44cc('0x4e')](_0x1b3da0['query'],_0x725d83[_0x44cc('0x43')]));if(_0x1b3da0[_0x44cc('0x42')][_0x44cc('0x4f')]){_0x1cc770[_0x44cc('0x4d')]=_[_0x44cc('0x50')](_0x1cc770['where'],{'$or':_[_0x44cc('0x3e')](_0x1cc770['attributes'],function(_0x4523a1){var _0x51f912={};_0x51f912[_0x4523a1]={'$like':'%'+_0x1b3da0[_0x44cc('0x42')][_0x44cc('0x4f')]+'%'};return _0x51f912;})});}_0x1cc770=_[_0x44cc('0x50')]({},_0x1cc770,_0x1b3da0[_0x44cc('0x52')]);return _0x589539[_0x44cc('0x91')](_0x1cc770);}})['then'](function(_0x509e25){if(_0x509e25){_0x2cb9f7=_0x509e25['length'];if(!_0x1b3da0[_0x44cc('0x42')]['hasOwnProperty'](_0x44cc('0x4a'))){_0x1cc770['limit']=qs['limit'](_0x1b3da0[_0x44cc('0x42')][_0x44cc('0x2e')]);_0x1cc770[_0x44cc('0x30')]=qs[_0x44cc('0x30')](_0x1b3da0[_0x44cc('0x42')][_0x44cc('0x30')]);}return _0x589539['getAgents'](_0x1cc770);}})['then'](function(_0x5157b6){if(_0x5157b6){return _0x5157b6?{'count':_0x2cb9f7,'rows':_0x5157b6}:null;}})[_0x44cc('0x37')](respondWithResult(_0x56281c,null))['catch'](handleError(_0x56281c,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 34c3984..b6d20aa 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 _0x45d1=['events','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x5a8480,_0xfc8036){var _0x1abdd0=function(_0x2099af){while(--_0x2099af){_0x5a8480['push'](_0x5a8480['shift']());}};_0x1abdd0(++_0xfc8036);}(_0x45d1,0x1cb));var _0x145d=function(_0x5cf90e,_0x5df405){_0x5cf90e=_0x5cf90e-0x0;var _0xae958d=_0x45d1[_0x5cf90e];return _0xae958d;};'use strict';var EventEmitter=require(_0x145d('0x0'));var ChatQueue=require(_0x145d('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x145d('0x2')](0x0);var events={'afterCreate':_0x145d('0x3'),'afterUpdate':'update','afterDestroy':_0x145d('0x4')};function emitEvent(_0x55eb4e){return function(_0x3076c2,_0x327cd3,_0x407d84){ChatQueueEvents[_0x145d('0x5')](_0x55eb4e+':'+_0x3076c2['id'],_0x3076c2);ChatQueueEvents[_0x145d('0x5')](_0x55eb4e,_0x3076c2);_0x407d84(null);};}for(var e in events){if(events[_0x145d('0x6')](e)){var event=events[e];ChatQueue[_0x145d('0x7')](e,emitEvent(event));}}module[_0x145d('0x8')]=ChatQueueEvents; \ No newline at end of file +var _0x117c=['update','emit','exports','../../mysqldb','setMaxListeners'];(function(_0x326eee,_0x5e5d39){var _0x592ea7=function(_0x47b807){while(--_0x47b807){_0x326eee['push'](_0x326eee['shift']());}};_0x592ea7(++_0x5e5d39);}(_0x117c,0x8f));var _0xc117=function(_0x105045,_0x2e471e){_0x105045=_0x105045-0x0;var _0x2487d0=_0x117c[_0x105045];return _0x2487d0;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0xc117('0x0'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xc117('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc117('0x2'),'afterDestroy':'remove'};function emitEvent(_0x8b9a2){return function(_0x3b4523,_0x4df175,_0x3edcab){ChatQueueEvents['emit'](_0x8b9a2+':'+_0x3b4523['id'],_0x3b4523);ChatQueueEvents[_0xc117('0x3')](_0x8b9a2,_0x3b4523);_0x3edcab(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0xc117('0x4')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 0680134..0e7f2ef 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 _0xd1d5=['bluebird','path','rimraf','../../config/environment','define','ChatQueue','chat_queues','util','../../config/logger','api','moment'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xd1d5,0x96));var _0x5d1d=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xd1d5[_0x13b8f3];return _0x1a6d06;};'use strict';var _=require('lodash');var util=require(_0x5d1d('0x0'));var logger=require(_0x5d1d('0x1'))(_0x5d1d('0x2'));var moment=require(_0x5d1d('0x3'));var BPromise=require(_0x5d1d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5d1d('0x5'));var rimraf=require(_0x5d1d('0x6'));var config=require(_0x5d1d('0x7'));var attributes=require('./chatQueue.attributes');module['exports']=function(_0x30d5f7,_0x2bdba5){return _0x30d5f7[_0x5d1d('0x8')](_0x5d1d('0x9'),attributes,{'tableName':_0x5d1d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4570=['ChatQueue','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','define'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4570,0x137));var _0x0457=function(_0x56ab11,_0x14cba4){_0x56ab11=_0x56ab11-0x0;var _0x5f3bba=_0x4570[_0x56ab11];return _0x5f3bba;};'use strict';var _=require(_0x0457('0x0'));var util=require(_0x0457('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0457('0x2'));var BPromise=require(_0x0457('0x3'));var rp=require(_0x0457('0x4'));var fs=require('fs');var path=require(_0x0457('0x5'));var rimraf=require(_0x0457('0x6'));var config=require(_0x0457('0x7'));var attributes=require('./chatQueue.attributes');module['exports']=function(_0x195e8a,_0x48618f){return _0x195e8a[_0x0457('0x8')](_0x0457('0x9'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index d3f9683..e6e38d7 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 _0x3eaf=['options','raw','where','include','model','attributes','map','GetChatQueue','find','ShowChatQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','./chatQueue.socket','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','ChatQueue','findAll'];(function(_0x166b45,_0x55f458){var _0x2ed348=function(_0x233a9a){while(--_0x233a9a){_0x166b45['push'](_0x166b45['shift']());}};_0x2ed348(++_0x55f458);}(_0x3eaf,0x190));var _0xf3ea=function(_0x4f2ebb,_0x2843e8){_0x4f2ebb=_0x4f2ebb-0x0;var _0x31a724=_0x3eaf[_0x4f2ebb];return _0x31a724;};'use strict';var _=require(_0xf3ea('0x0'));var util=require(_0xf3ea('0x1'));var moment=require(_0xf3ea('0x2'));var BPromise=require(_0xf3ea('0x3'));var rs=require(_0xf3ea('0x4'));var fs=require('fs');var Redis=require(_0xf3ea('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf3ea('0x6'));var logger=require(_0xf3ea('0x7'))(_0xf3ea('0x8'));var config=require('../../config/environment');var jayson=require(_0xf3ea('0x9'));var client=jayson['client'][_0xf3ea('0xa')]({'port':0x232a});config[_0xf3ea('0xb')]=_[_0xf3ea('0xc')](config['redis'],{'host':_0xf3ea('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf3ea('0xb')]));require(_0xf3ea('0xe'))['register'](socket);function respondWithRpcPromise(_0x1c62d3,_0x4c98aa,_0x21a505){return new BPromise(function(_0x1f2825,_0x585092){return client['request'](_0x1c62d3,_0x21a505)[_0xf3ea('0xf')](function(_0x446f7c){logger[_0xf3ea('0x10')]('ChatQueue,\x20%s,\x20%s',_0x4c98aa,_0xf3ea('0x11'));logger[_0xf3ea('0x12')](_0xf3ea('0x13'),_0x4c98aa,'request\x20sent',JSON[_0xf3ea('0x14')](_0x446f7c));if(_0x446f7c[_0xf3ea('0x15')]){if(_0x446f7c[_0xf3ea('0x15')][_0xf3ea('0x16')]===0x1f4){logger[_0xf3ea('0x15')](_0xf3ea('0x17'),_0x4c98aa,_0x446f7c[_0xf3ea('0x15')][_0xf3ea('0x18')]);return _0x585092(_0x446f7c['error'][_0xf3ea('0x18')]);}logger['error'](_0xf3ea('0x17'),_0x4c98aa,_0x446f7c[_0xf3ea('0x15')]['message']);return _0x1f2825(_0x446f7c[_0xf3ea('0x15')][_0xf3ea('0x18')]);}else{logger[_0xf3ea('0x10')](_0xf3ea('0x17'),_0x4c98aa,'request\x20sent');_0x1f2825(_0x446f7c[_0xf3ea('0x19')][_0xf3ea('0x18')]);}})[_0xf3ea('0x1a')](function(_0x16bff3){logger[_0xf3ea('0x15')]('ChatQueue,\x20%s,\x20%s',_0x4c98aa,_0x16bff3);_0x585092(_0x16bff3);});});}exports['GetChatQueue']=function(_0x23c030){var _0x69546=this;return new Promise(function(_0x4d7f46,_0x2c7419){return db[_0xf3ea('0x1b')][_0xf3ea('0x1c')]({'raw':_0x23c030[_0xf3ea('0x1d')]?_0x23c030[_0xf3ea('0x1d')][_0xf3ea('0x1e')]===undefined?!![]:![]:!![],'where':_0x23c030[_0xf3ea('0x1d')]?_0x23c030[_0xf3ea('0x1d')][_0xf3ea('0x1f')]||null:null,'attributes':_0x23c030[_0xf3ea('0x1d')]?_0x23c030[_0xf3ea('0x1d')]['attributes']||null:null,'limit':_0x23c030[_0xf3ea('0x1d')]?_0x23c030[_0xf3ea('0x1d')]['limit']||null:null,'include':_0x23c030['options']?_0x23c030['options'][_0xf3ea('0x20')]?_['map'](_0x23c030[_0xf3ea('0x1d')][_0xf3ea('0x20')],function(_0x4ea971){return{'model':db[_0x4ea971[_0xf3ea('0x21')]],'as':_0x4ea971['as'],'attributes':_0x4ea971[_0xf3ea('0x22')],'include':_0x4ea971[_0xf3ea('0x20')]?_[_0xf3ea('0x23')](_0x4ea971[_0xf3ea('0x20')],function(_0x5b91e9){return{'model':db[_0x5b91e9['model']],'as':_0x5b91e9['as'],'attributes':_0x5b91e9['attributes'],'include':_0x5b91e9['include']?_[_0xf3ea('0x23')](_0x5b91e9[_0xf3ea('0x20')],function(_0x120232){return{'model':db[_0x120232[_0xf3ea('0x21')]],'as':_0x120232['as'],'attributes':_0x120232[_0xf3ea('0x22')]};}):[]};}):[]};}):[]:[]})[_0xf3ea('0xf')](function(_0x3c2cdb){logger[_0xf3ea('0x10')]('GetChatQueue',_0x23c030);logger[_0xf3ea('0x12')](_0xf3ea('0x24'),_0x23c030,JSON[_0xf3ea('0x14')](_0x3c2cdb));_0x4d7f46(_0x3c2cdb);})[_0xf3ea('0x1a')](function(_0x9c5d48){logger[_0xf3ea('0x15')](_0xf3ea('0x24'),_0x9c5d48[_0xf3ea('0x18')],_0x23c030);_0x2c7419(_0x69546[_0xf3ea('0x15')](0x1f4,_0x9c5d48[_0xf3ea('0x18')]));});});};exports['ShowChatQueue']=function(_0x4a6093){var _0x18f0a8=this;return new Promise(function(_0x299ff8,_0x457629){return db[_0xf3ea('0x1b')][_0xf3ea('0x25')]({'raw':_0x4a6093[_0xf3ea('0x1d')]?_0x4a6093[_0xf3ea('0x1d')][_0xf3ea('0x1e')]===undefined?!![]:![]:!![],'where':_0x4a6093[_0xf3ea('0x1d')]?_0x4a6093['options'][_0xf3ea('0x1f')]||null:null,'attributes':_0x4a6093[_0xf3ea('0x1d')]?_0x4a6093[_0xf3ea('0x1d')][_0xf3ea('0x22')]||null:null,'include':_0x4a6093[_0xf3ea('0x1d')]?_0x4a6093[_0xf3ea('0x1d')][_0xf3ea('0x20')]?_[_0xf3ea('0x23')](_0x4a6093[_0xf3ea('0x1d')][_0xf3ea('0x20')],function(_0x2186ba){return{'model':db[_0x2186ba[_0xf3ea('0x21')]],'as':_0x2186ba['as'],'attributes':_0x2186ba[_0xf3ea('0x22')],'include':_0x2186ba[_0xf3ea('0x20')]?_[_0xf3ea('0x23')](_0x2186ba['include'],function(_0x4b73e8){return{'model':db[_0x4b73e8[_0xf3ea('0x21')]],'as':_0x4b73e8['as'],'attributes':_0x4b73e8[_0xf3ea('0x22')],'include':_0x4b73e8[_0xf3ea('0x20')]?_['map'](_0x4b73e8[_0xf3ea('0x20')],function(_0x51589d){return{'model':db[_0x51589d[_0xf3ea('0x21')]],'as':_0x51589d['as'],'attributes':_0x51589d['attributes']};}):[]};}):[]};}):[]:[]})[_0xf3ea('0xf')](function(_0x59fa88){logger[_0xf3ea('0x10')](_0xf3ea('0x26'),_0x4a6093);logger[_0xf3ea('0x12')](_0xf3ea('0x26'),_0x4a6093,JSON[_0xf3ea('0x14')](_0x59fa88));_0x299ff8(_0x59fa88);})[_0xf3ea('0x1a')](function(_0x44a599){logger[_0xf3ea('0x15')](_0xf3ea('0x26'),_0x44a599[_0xf3ea('0x18')],_0x4a6093);_0x457629(_0x18f0a8[_0xf3ea('0x15')](0x1f4,_0x44a599['message']));});});}; \ No newline at end of file +var _0xbc1d=['./chatQueue.socket','then','info','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','ChatQueue,\x20%s,\x20%s','ChatQueue','findAll','options','raw','where','limit','include','map','model','attributes','GetChatQueue','catch','ShowChatQueue','find','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x52e571,_0x4a11a3){var _0x4c79a3=function(_0x5675ce){while(--_0x5675ce){_0x52e571['push'](_0x52e571['shift']());}};_0x4c79a3(++_0x4a11a3);}(_0xbc1d,0x12a));var _0xdbc1=function(_0x22bdd3,_0x552e50){_0x22bdd3=_0x22bdd3-0x0;var _0x44d9d9=_0xbc1d[_0x22bdd3];return _0x44d9d9;};'use strict';var _=require(_0xdbc1('0x0'));var util=require(_0xdbc1('0x1'));var moment=require(_0xdbc1('0x2'));var BPromise=require('bluebird');var rs=require(_0xdbc1('0x3'));var fs=require('fs');var Redis=require(_0xdbc1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdbc1('0x5'));var logger=require(_0xdbc1('0x6'))('rpc');var config=require(_0xdbc1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xdbc1('0x8')][_0xdbc1('0x9')]({'port':0x232a});config[_0xdbc1('0xa')]=_[_0xdbc1('0xb')](config[_0xdbc1('0xa')],{'host':_0xdbc1('0xc'),'port':0x18eb});var socket=require(_0xdbc1('0xd'))(new Redis(config[_0xdbc1('0xa')]));require(_0xdbc1('0xe'))['register'](socket);function respondWithRpcPromise(_0x15b13d,_0xf98500,_0x1cae43){return new BPromise(function(_0x1bc86f,_0x503a02){return client['request'](_0x15b13d,_0x1cae43)[_0xdbc1('0xf')](function(_0x39cbfd){logger[_0xdbc1('0x10')]('ChatQueue,\x20%s,\x20%s',_0xf98500,'request\x20sent');logger[_0xdbc1('0x11')](_0xdbc1('0x12'),_0xf98500,_0xdbc1('0x13'),JSON[_0xdbc1('0x14')](_0x39cbfd));if(_0x39cbfd['error']){if(_0x39cbfd['error'][_0xdbc1('0x15')]===0x1f4){logger[_0xdbc1('0x16')]('ChatQueue,\x20%s,\x20%s',_0xf98500,_0x39cbfd[_0xdbc1('0x16')]['message']);return _0x503a02(_0x39cbfd[_0xdbc1('0x16')]['message']);}logger['error']('ChatQueue,\x20%s,\x20%s',_0xf98500,_0x39cbfd[_0xdbc1('0x16')][_0xdbc1('0x17')]);return _0x1bc86f(_0x39cbfd[_0xdbc1('0x16')]['message']);}else{logger[_0xdbc1('0x10')](_0xdbc1('0x18'),_0xf98500,_0xdbc1('0x13'));_0x1bc86f(_0x39cbfd['result'][_0xdbc1('0x17')]);}})['catch'](function(_0x3a8962){logger[_0xdbc1('0x16')](_0xdbc1('0x18'),_0xf98500,_0x3a8962);_0x503a02(_0x3a8962);});});}exports['GetChatQueue']=function(_0x8fffbc){var _0x30a75e=this;return new Promise(function(_0x59f948,_0x5b21c0){return db[_0xdbc1('0x19')][_0xdbc1('0x1a')]({'raw':_0x8fffbc[_0xdbc1('0x1b')]?_0x8fffbc[_0xdbc1('0x1b')][_0xdbc1('0x1c')]===undefined?!![]:![]:!![],'where':_0x8fffbc[_0xdbc1('0x1b')]?_0x8fffbc[_0xdbc1('0x1b')][_0xdbc1('0x1d')]||null:null,'attributes':_0x8fffbc[_0xdbc1('0x1b')]?_0x8fffbc[_0xdbc1('0x1b')]['attributes']||null:null,'limit':_0x8fffbc[_0xdbc1('0x1b')]?_0x8fffbc[_0xdbc1('0x1b')][_0xdbc1('0x1e')]||null:null,'include':_0x8fffbc[_0xdbc1('0x1b')]?_0x8fffbc[_0xdbc1('0x1b')][_0xdbc1('0x1f')]?_[_0xdbc1('0x20')](_0x8fffbc[_0xdbc1('0x1b')][_0xdbc1('0x1f')],function(_0x1b28f9){return{'model':db[_0x1b28f9[_0xdbc1('0x21')]],'as':_0x1b28f9['as'],'attributes':_0x1b28f9[_0xdbc1('0x22')],'include':_0x1b28f9[_0xdbc1('0x1f')]?_[_0xdbc1('0x20')](_0x1b28f9[_0xdbc1('0x1f')],function(_0x4c33ca){return{'model':db[_0x4c33ca[_0xdbc1('0x21')]],'as':_0x4c33ca['as'],'attributes':_0x4c33ca[_0xdbc1('0x22')],'include':_0x4c33ca['include']?_['map'](_0x4c33ca['include'],function(_0x55c07c){return{'model':db[_0x55c07c['model']],'as':_0x55c07c['as'],'attributes':_0x55c07c[_0xdbc1('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1a8d84){logger[_0xdbc1('0x10')](_0xdbc1('0x23'),_0x8fffbc);logger[_0xdbc1('0x11')](_0xdbc1('0x23'),_0x8fffbc,JSON[_0xdbc1('0x14')](_0x1a8d84));_0x59f948(_0x1a8d84);})[_0xdbc1('0x24')](function(_0x3a04e2){logger[_0xdbc1('0x16')](_0xdbc1('0x23'),_0x3a04e2['message'],_0x8fffbc);_0x5b21c0(_0x30a75e[_0xdbc1('0x16')](0x1f4,_0x3a04e2[_0xdbc1('0x17')]));});});};exports[_0xdbc1('0x25')]=function(_0x2e28e2){var _0xe2a0cb=this;return new Promise(function(_0x5dabf3,_0xa6399){return db[_0xdbc1('0x19')][_0xdbc1('0x26')]({'raw':_0x2e28e2[_0xdbc1('0x1b')]?_0x2e28e2[_0xdbc1('0x1b')][_0xdbc1('0x1c')]===undefined?!![]:![]:!![],'where':_0x2e28e2[_0xdbc1('0x1b')]?_0x2e28e2[_0xdbc1('0x1b')][_0xdbc1('0x1d')]||null:null,'attributes':_0x2e28e2[_0xdbc1('0x1b')]?_0x2e28e2['options'][_0xdbc1('0x22')]||null:null,'include':_0x2e28e2[_0xdbc1('0x1b')]?_0x2e28e2[_0xdbc1('0x1b')]['include']?_[_0xdbc1('0x20')](_0x2e28e2[_0xdbc1('0x1b')][_0xdbc1('0x1f')],function(_0x47271c){return{'model':db[_0x47271c[_0xdbc1('0x21')]],'as':_0x47271c['as'],'attributes':_0x47271c['attributes'],'include':_0x47271c[_0xdbc1('0x1f')]?_['map'](_0x47271c[_0xdbc1('0x1f')],function(_0x27b7c9){return{'model':db[_0x27b7c9['model']],'as':_0x27b7c9['as'],'attributes':_0x27b7c9[_0xdbc1('0x22')],'include':_0x27b7c9[_0xdbc1('0x1f')]?_[_0xdbc1('0x20')](_0x27b7c9['include'],function(_0x4607ea){return{'model':db[_0x4607ea['model']],'as':_0x4607ea['as'],'attributes':_0x4607ea[_0xdbc1('0x22')]};}):[]};}):[]};}):[]:[]})[_0xdbc1('0xf')](function(_0xca82cb){logger[_0xdbc1('0x10')]('ShowChatQueue',_0x2e28e2);logger[_0xdbc1('0x11')](_0xdbc1('0x25'),_0x2e28e2,JSON['stringify'](_0xca82cb));_0x5dabf3(_0xca82cb);})['catch'](function(_0x3af038){logger[_0xdbc1('0x16')](_0xdbc1('0x25'),_0x3af038[_0xdbc1('0x17')],_0x2e28e2);_0xa6399(_0xe2a0cb[_0xdbc1('0x16')](0x1f4,_0x3af038[_0xdbc1('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 322feba..0b46dbe 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 _0x0bde=['save','update','emit','removeListener','register','length','chatQueue:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0bde,0xe7));var _0xe0bd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0bde[_0x321bb2];return _0x9c12ed;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0xe0bd('0x0'),'remove',_0xe0bd('0x1')];function createListener(_0x3dc984,_0x1d8922){return function(_0x1e198a){_0x1d8922[_0xe0bd('0x2')](_0x3dc984,_0x1e198a);};}function removeListener(_0x5541b9,_0x34df88){return function(){ChatQueueEvents[_0xe0bd('0x3')](_0x5541b9,_0x34df88);};}exports[_0xe0bd('0x4')]=function(_0x3b712a){for(var _0x22bfd1=0x0,_0x26393f=events[_0xe0bd('0x5')];_0x22bfd1<_0x26393f;_0x22bfd1++){var _0x491dc7=events[_0x22bfd1];var _0x40b36a=createListener(_0xe0bd('0x6')+_0x491dc7,_0x3b712a);ChatQueueEvents['on'](_0x491dc7,_0x40b36a);}}; \ No newline at end of file +var _0xb66c=['chatQueue:','./chatQueue.events','remove','removeListener','register','length'];(function(_0x2bc3f4,_0x470b26){var _0x14ac53=function(_0x5121bd){while(--_0x5121bd){_0x2bc3f4['push'](_0x2bc3f4['shift']());}};_0x14ac53(++_0x470b26);}(_0xb66c,0x175));var _0xcb66=function(_0x2330d1,_0x428eab){_0x2330d1=_0x2330d1-0x0;var _0x268702=_0xb66c[_0x2330d1];return _0x268702;};'use strict';var ChatQueueEvents=require(_0xcb66('0x0'));var events=['save',_0xcb66('0x1'),'update'];function createListener(_0x2afcb8,_0x24ea13){return function(_0xf7ccc5){_0x24ea13['emit'](_0x2afcb8,_0xf7ccc5);};}function removeListener(_0x35d439,_0x386241){return function(){ChatQueueEvents[_0xcb66('0x2')](_0x35d439,_0x386241);};}exports[_0xcb66('0x3')]=function(_0x5d766d){for(var _0x518163=0x0,_0x19adf5=events[_0xcb66('0x4')];_0x518163<_0x19adf5;_0x518163++){var _0xa3993=events[_0x518163];var _0x439f3d=createListener(_0xcb66('0x5')+_0xa3993,_0x5d766d);ChatQueueEvents['on'](_0xa3993,_0x439f3d);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 4e30efd..3e12ed7 100644 --- a/server/api/chatQueue/index.js +++ b/server/api/chatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5e8c32,_0x1b1f3f){_0x5e8c32=_0x5e8c32-0x0;var _0x595f7b=_0x5fc3[_0x5e8c32];return _0x595f7b;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router; \ No newline at end of file +var _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(_0x3eb022,_0x1dc091){var _0x23662e=function(_0x3fd40f){while(--_0x3fd40f){_0x3eb022['push'](_0x3eb022['shift']());}};_0x23662e(++_0x1dc091);}(_0xe14b,0x93));var _0xbe14=function(_0x14e394,_0x4afb12){_0x14e394=_0x14e394-0x0;var _0x1e0af1=_0xe14b[_0x14e394];return _0x1e0af1;};'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 e3dd748..eea6772 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 _0x52be=['moment','sequelize','STRING','DATE'];(function(_0x25b4a7,_0x33e75b){var _0x2e5b69=function(_0x7d4843){while(--_0x7d4843){_0x25b4a7['push'](_0x25b4a7['shift']());}};_0x2e5b69(++_0x33e75b);}(_0x52be,0xc4));var _0xe52b=function(_0x34f8ba,_0x2bb6a8){_0x34f8ba=_0x34f8ba-0x0;var _0xa5ed05=_0x52be[_0x34f8ba];return _0xa5ed05;};'use strict';var moment=require(_0xe52b('0x0'));var Sequelize=require(_0xe52b('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xe52b('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xe52b('0x2')]},'joinAt':{'type':Sequelize[_0xe52b('0x3')]},'leaveAt':{'type':Sequelize[_0xe52b('0x3')]},'acceptAt':{'type':Sequelize[_0xe52b('0x3')]},'exitAt':{'type':Sequelize[_0xe52b('0x3')]},'reason':{'type':Sequelize[_0xe52b('0x2')]}}; \ No newline at end of file +var _0x31dc=['moment','sequelize','exports','STRING','DATE'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x31dc,0xc3));var _0xc31d=function(_0x326c7f,_0x2b17d0){_0x326c7f=_0x326c7f-0x0;var _0x1a1795=_0x31dc[_0x326c7f];return _0x1a1795;};'use strict';var moment=require(_0xc31d('0x0'));var Sequelize=require(_0xc31d('0x1'));module[_0xc31d('0x2')]={'uniqueid':{'type':Sequelize[_0xc31d('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xc31d('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xc31d('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 0f7cb9d..61a2c33 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 _0x9e2e=['zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','filters','length','find','body','describe','eml-format','rimraf'];(function(_0xd2d531,_0x19de07){var _0x70346=function(_0x136e8b){while(--_0x136e8b){_0xd2d531['push'](_0xd2d531['shift']());}};_0x70346(++_0x19de07);}(_0x9e2e,0xd6));var _0xe9e2=function(_0x414212,_0xce2258){_0x414212=_0x414212-0x0;var _0x97dfa2=_0x9e2e[_0x414212];return _0x97dfa2;};'use strict';var emlformat=require(_0xe9e2('0x0'));var rimraf=require(_0xe9e2('0x1'));var zipdir=require(_0xe9e2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe9e2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe9e2('0x4'));var util=require(_0xe9e2('0x5'));var path=require(_0xe9e2('0x6'));var sox=require(_0xe9e2('0x7'));var csv=require(_0xe9e2('0x8'));var ejs=require(_0xe9e2('0x9'));var fs=require('fs');var fs_extra=require(_0xe9e2('0xa'));var _=require('lodash');var squel=require(_0xe9e2('0xb'));var crypto=require('crypto');var jsforce=require(_0xe9e2('0xc'));var deskjs=require(_0xe9e2('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe9e2('0xe'));var Papa=require(_0xe9e2('0xf'));var Redis=require('ioredis');var authService=require(_0xe9e2('0x10'));var qs=require(_0xe9e2('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe9e2('0x12'))(_0xe9e2('0x13'));var utils=require(_0xe9e2('0x14'));var config=require(_0xe9e2('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b6493,_0xc13a68){_0xc13a68=_0xc13a68||0xcc;return function(_0x116686){if(_0x116686){return _0x1b6493[_0xe9e2('0x16')](_0xc13a68);}return _0x1b6493[_0xe9e2('0x17')](_0xc13a68)[_0xe9e2('0x18')]();};}function respondWithResult(_0x41ea08,_0x1ba905){_0x1ba905=_0x1ba905||0xc8;return function(_0xc67cb1){if(_0xc67cb1){return _0x41ea08[_0xe9e2('0x17')](_0x1ba905)['json'](_0xc67cb1);}};}function respondWithFilteredResult(_0x5ae5ff,_0x117e38){return function(_0x590974){if(_0x590974){var _0x533e9e=typeof _0x117e38[_0xe9e2('0x19')]===_0xe9e2('0x1a')&&typeof _0x117e38[_0xe9e2('0x1b')]===_0xe9e2('0x1a');var _0x20da8e=_0x590974[_0xe9e2('0x1c')];var _0x5f3fc8=_0x533e9e?0x0:_0x117e38[_0xe9e2('0x19')];var _0x2094fc=_0x533e9e?_0x590974[_0xe9e2('0x1c')]:_0x117e38['offset']+_0x117e38[_0xe9e2('0x1b')];var _0x2e7fd0;if(_0x2094fc>=_0x20da8e){_0x2094fc=_0x20da8e;_0x2e7fd0=0xc8;}else{_0x2e7fd0=0xce;}_0x5ae5ff[_0xe9e2('0x17')](_0x2e7fd0);return _0x5ae5ff['set'](_0xe9e2('0x1d'),_0x5f3fc8+'-'+_0x2094fc+'/'+_0x20da8e)[_0xe9e2('0x1e')](_0x590974);}return null;};}function patchUpdates(_0x6d8193){return function(_0x5057f6){try{jsonpatch[_0xe9e2('0x1f')](_0x5057f6,_0x6d8193,!![]);}catch(_0x36c8a3){return BPromise[_0xe9e2('0x20')](_0x36c8a3);}return _0x5057f6[_0xe9e2('0x21')]();};}function saveUpdates(_0x5bb286,_0x183680){return function(_0x1655fe){if(_0x1655fe){return _0x1655fe[_0xe9e2('0x22')](_0x5bb286)[_0xe9e2('0x23')](function(_0x38fb40){return _0x38fb40;});}return null;};}function removeEntity(_0x518328,_0x26ce3d){return function(_0x26239c){if(_0x26239c){return _0x26239c[_0xe9e2('0x24')]()[_0xe9e2('0x23')](function(){_0x518328[_0xe9e2('0x17')](0xcc)[_0xe9e2('0x18')]();});}};}function handleEntityNotFound(_0x2a3d69,_0x274468){return function(_0x313b09){if(!_0x313b09){_0x2a3d69[_0xe9e2('0x16')](0x194);}return _0x313b09;};}function handleError(_0x2fac3e,_0x4d4343){_0x4d4343=_0x4d4343||0x1f4;return function(_0x43445d){logger[_0xe9e2('0x25')](_0x43445d[_0xe9e2('0x26')]);if(_0x43445d[_0xe9e2('0x27')]){delete _0x43445d['name'];}_0x2fac3e[_0xe9e2('0x17')](_0x4d4343)[_0xe9e2('0x28')](_0x43445d);};}exports[_0xe9e2('0x29')]=function(_0x39c4a9,_0x257a3a){var _0x4fc1ce={},_0x4cf43f={},_0x39df15={'count':0x0,'rows':[]};var _0x242319=_[_0xe9e2('0x2a')](db[_0xe9e2('0x2b')][_0xe9e2('0x2c')],function(_0x42b8ca){return{'name':_0x42b8ca[_0xe9e2('0x2d')],'type':_0x42b8ca[_0xe9e2('0x2e')][_0xe9e2('0x2f')]};});_0x4cf43f[_0xe9e2('0x30')]=_[_0xe9e2('0x2a')](_0x242319,_0xe9e2('0x27'));_0x4cf43f[_0xe9e2('0x31')]=_[_0xe9e2('0x32')](_0x39c4a9['query']);_0x4cf43f['filters']=_[_0xe9e2('0x33')](_0x4cf43f[_0xe9e2('0x30')],_0x4cf43f['query']);_0x4fc1ce[_0xe9e2('0x34')]=_[_0xe9e2('0x33')](_0x4cf43f[_0xe9e2('0x30')],qs['fields'](_0x39c4a9[_0xe9e2('0x31')][_0xe9e2('0x35')]));_0x4fc1ce[_0xe9e2('0x34')]=_0x4fc1ce[_0xe9e2('0x34')]['length']?_0x4fc1ce[_0xe9e2('0x34')]:_0x4cf43f[_0xe9e2('0x30')];if(!_0x39c4a9[_0xe9e2('0x31')]['hasOwnProperty']('nolimit')){_0x4fc1ce[_0xe9e2('0x1b')]=qs[_0xe9e2('0x1b')](_0x39c4a9[_0xe9e2('0x31')][_0xe9e2('0x1b')]);_0x4fc1ce[_0xe9e2('0x19')]=qs[_0xe9e2('0x19')](_0x39c4a9[_0xe9e2('0x31')]['offset']);}_0x4fc1ce['order']=qs[_0xe9e2('0x36')](_0x39c4a9['query'][_0xe9e2('0x36')]);_0x4fc1ce[_0xe9e2('0x37')]=qs['filters'](_[_0xe9e2('0x38')](_0x39c4a9[_0xe9e2('0x31')],_0x4cf43f['filters']),_0x242319);if(_0x39c4a9[_0xe9e2('0x31')][_0xe9e2('0x39')]){_0x4fc1ce['where']=_['merge'](_0x4fc1ce[_0xe9e2('0x37')],{'$or':_[_0xe9e2('0x2a')](_0x242319,function(_0x24ed93){if(_0x24ed93['type']!==_0xe9e2('0x3a')){var _0x4f9970={};_0x4f9970[_0x24ed93[_0xe9e2('0x27')]]={'$like':'%'+_0x39c4a9[_0xe9e2('0x31')][_0xe9e2('0x39')]+'%'};return _0x4f9970;}})});}_0x4fc1ce=_[_0xe9e2('0x3b')]({},_0x4fc1ce,_0x39c4a9[_0xe9e2('0x3c')]);var _0x1c687d={'where':_0x4fc1ce[_0xe9e2('0x37')]};return db[_0xe9e2('0x2b')]['count'](_0x1c687d)['then'](function(_0x269068){_0x39df15[_0xe9e2('0x1c')]=_0x269068;if(_0x39c4a9[_0xe9e2('0x31')][_0xe9e2('0x3d')]){_0x4fc1ce[_0xe9e2('0x3e')]=[{'all':!![]}];}return db['ChatQueueReport'][_0xe9e2('0x3f')](_0x4fc1ce);})['then'](function(_0x1fe966){_0x39df15['rows']=_0x1fe966;return _0x39df15;})[_0xe9e2('0x23')](respondWithFilteredResult(_0x257a3a,_0x4fc1ce))[_0xe9e2('0x40')](handleError(_0x257a3a,null));};exports[_0xe9e2('0x41')]=function(_0x5275bb,_0x33e750){var _0x40d34b={'raw':!![],'where':{'id':_0x5275bb[_0xe9e2('0x42')]['id']}},_0x22092e={};_0x22092e[_0xe9e2('0x30')]=_[_0xe9e2('0x32')](db['ChatQueueReport']['rawAttributes']);_0x22092e[_0xe9e2('0x31')]=_[_0xe9e2('0x32')](_0x5275bb[_0xe9e2('0x31')]);_0x22092e[_0xe9e2('0x43')]=_[_0xe9e2('0x33')](_0x22092e[_0xe9e2('0x30')],_0x22092e['query']);_0x40d34b[_0xe9e2('0x34')]=_['intersection'](_0x22092e['model'],qs[_0xe9e2('0x35')](_0x5275bb[_0xe9e2('0x31')]['fields']));_0x40d34b['attributes']=_0x40d34b[_0xe9e2('0x34')][_0xe9e2('0x44')]?_0x40d34b['attributes']:_0x22092e['model'];if(_0x5275bb[_0xe9e2('0x31')][_0xe9e2('0x3d')]){_0x40d34b[_0xe9e2('0x3e')]=[{'all':!![]}];}_0x40d34b=_[_0xe9e2('0x3b')]({},_0x40d34b,_0x5275bb[_0xe9e2('0x3c')]);return db['ChatQueueReport'][_0xe9e2('0x45')](_0x40d34b)[_0xe9e2('0x23')](handleEntityNotFound(_0x33e750,null))[_0xe9e2('0x23')](respondWithResult(_0x33e750,null))[_0xe9e2('0x40')](handleError(_0x33e750,null));};exports['create']=function(_0x1ab0ee,_0x176c73){return db['ChatQueueReport']['create'](_0x1ab0ee[_0xe9e2('0x46')],{})[_0xe9e2('0x23')](respondWithResult(_0x176c73,0xc9))[_0xe9e2('0x40')](handleError(_0x176c73,null));};exports[_0xe9e2('0x22')]=function(_0x1be3ba,_0x502381){if(_0x1be3ba[_0xe9e2('0x46')]['id']){delete _0x1be3ba[_0xe9e2('0x46')]['id'];}return db[_0xe9e2('0x2b')][_0xe9e2('0x45')]({'where':{'id':_0x1be3ba[_0xe9e2('0x42')]['id']}})['then'](handleEntityNotFound(_0x502381,null))['then'](saveUpdates(_0x1be3ba[_0xe9e2('0x46')],null))[_0xe9e2('0x23')](respondWithResult(_0x502381,null))[_0xe9e2('0x40')](handleError(_0x502381,null));};exports['destroy']=function(_0x1ca157,_0x209af0){return db[_0xe9e2('0x2b')]['find']({'where':{'id':_0x1ca157[_0xe9e2('0x42')]['id']}})[_0xe9e2('0x23')](handleEntityNotFound(_0x209af0,null))[_0xe9e2('0x23')](removeEntity(_0x209af0,null))[_0xe9e2('0x40')](handleError(_0x209af0,null));};exports['describe']=function(_0x25e832,_0x3732e7){return db[_0xe9e2('0x2b')][_0xe9e2('0x47')]()[_0xe9e2('0x23')](respondWithResult(_0x3732e7,null))[_0xe9e2('0x40')](handleError(_0x3732e7,null));}; \ No newline at end of file +var _0xb3f9=['count','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','ChatQueueReport','includeAll','findAll','show','params','include','options','find','create','body','catch','update','describe','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','papaparse','../../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','undefined','limit'];(function(_0x2e13f7,_0x979ba5){var _0x50d053=function(_0x406de3){while(--_0x406de3){_0x2e13f7['push'](_0x2e13f7['shift']());}};_0x50d053(++_0x979ba5);}(_0xb3f9,0x7a));var _0x9b3f=function(_0x1d2173,_0x2c1fd6){_0x1d2173=_0x1d2173-0x0;var _0x49f028=_0xb3f9[_0x1d2173];return _0x49f028;};'use strict';var emlformat=require(_0x9b3f('0x0'));var rimraf=require(_0x9b3f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9b3f('0x2'));var moment=require('moment');var BPromise=require(_0x9b3f('0x3'));var Mustache=require(_0x9b3f('0x4'));var util=require(_0x9b3f('0x5'));var path=require(_0x9b3f('0x6'));var sox=require(_0x9b3f('0x7'));var csv=require(_0x9b3f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9b3f('0x9'));var squel=require(_0x9b3f('0xa'));var crypto=require('crypto');var jsforce=require(_0x9b3f('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9b3f('0xc'));var Redis=require('ioredis');var authService=require(_0x9b3f('0xd'));var qs=require(_0x9b3f('0xe'));var as=require(_0x9b3f('0xf'));var hardwareService=require(_0x9b3f('0x10'));var logger=require(_0x9b3f('0x11'))('api');var utils=require(_0x9b3f('0x12'));var config=require(_0x9b3f('0x13'));var licenseUtil=require(_0x9b3f('0x14'));var db=require(_0x9b3f('0x15'))['db'];function respondWithStatusCode(_0x1ce80f,_0x310b83){_0x310b83=_0x310b83||0xcc;return function(_0x35554e){if(_0x35554e){return _0x1ce80f[_0x9b3f('0x16')](_0x310b83);}return _0x1ce80f['status'](_0x310b83)['end']();};}function respondWithResult(_0x56f676,_0x2f9d90){_0x2f9d90=_0x2f9d90||0xc8;return function(_0x27dab5){if(_0x27dab5){return _0x56f676[_0x9b3f('0x17')](_0x2f9d90)[_0x9b3f('0x18')](_0x27dab5);}};}function respondWithFilteredResult(_0x52310c,_0x4aa66a){return function(_0x49c0ac){if(_0x49c0ac){var _0x34fb19=typeof _0x4aa66a[_0x9b3f('0x19')]===_0x9b3f('0x1a')&&typeof _0x4aa66a[_0x9b3f('0x1b')]===_0x9b3f('0x1a');var _0x2cdc7c=_0x49c0ac['count'];var _0x579c32=_0x34fb19?0x0:_0x4aa66a[_0x9b3f('0x19')];var _0x235434=_0x34fb19?_0x49c0ac[_0x9b3f('0x1c')]:_0x4aa66a[_0x9b3f('0x19')]+_0x4aa66a[_0x9b3f('0x1b')];var _0x297fa8;if(_0x235434>=_0x2cdc7c){_0x235434=_0x2cdc7c;_0x297fa8=0xc8;}else{_0x297fa8=0xce;}_0x52310c[_0x9b3f('0x17')](_0x297fa8);return _0x52310c[_0x9b3f('0x1d')](_0x9b3f('0x1e'),_0x579c32+'-'+_0x235434+'/'+_0x2cdc7c)[_0x9b3f('0x18')](_0x49c0ac);}return null;};}function patchUpdates(_0xa4883e){return function(_0x1cb346){try{jsonpatch[_0x9b3f('0x1f')](_0x1cb346,_0xa4883e,!![]);}catch(_0x1218c0){return BPromise[_0x9b3f('0x20')](_0x1218c0);}return _0x1cb346[_0x9b3f('0x21')]();};}function saveUpdates(_0x1d5c43,_0x5195e9){return function(_0x3360d6){if(_0x3360d6){return _0x3360d6['update'](_0x1d5c43)[_0x9b3f('0x22')](function(_0x4db496){return _0x4db496;});}return null;};}function removeEntity(_0x4704dd,_0x5d075f){return function(_0x3c9d8d){if(_0x3c9d8d){return _0x3c9d8d[_0x9b3f('0x23')]()[_0x9b3f('0x22')](function(){_0x4704dd['status'](0xcc)[_0x9b3f('0x24')]();});}};}function handleEntityNotFound(_0x483eb3,_0x325c74){return function(_0x526355){if(!_0x526355){_0x483eb3[_0x9b3f('0x16')](0x194);}return _0x526355;};}function handleError(_0x32aa3e,_0x51014e){_0x51014e=_0x51014e||0x1f4;return function(_0x248c9d){logger[_0x9b3f('0x25')](_0x248c9d[_0x9b3f('0x26')]);if(_0x248c9d[_0x9b3f('0x27')]){delete _0x248c9d['name'];}_0x32aa3e['status'](_0x51014e)[_0x9b3f('0x28')](_0x248c9d);};}exports['index']=function(_0x377d0e,_0x4a0d60){var _0x1059b1={},_0x128542={},_0x35f2dd={'count':0x0,'rows':[]};var _0x1c89d3=_[_0x9b3f('0x29')](db['ChatQueueReport'][_0x9b3f('0x2a')],function(_0x38dd12){return{'name':_0x38dd12[_0x9b3f('0x2b')],'type':_0x38dd12[_0x9b3f('0x2c')][_0x9b3f('0x2d')]};});_0x128542[_0x9b3f('0x2e')]=_[_0x9b3f('0x29')](_0x1c89d3,'name');_0x128542['query']=_[_0x9b3f('0x2f')](_0x377d0e['query']);_0x128542['filters']=_[_0x9b3f('0x30')](_0x128542['model'],_0x128542[_0x9b3f('0x31')]);_0x1059b1[_0x9b3f('0x32')]=_[_0x9b3f('0x30')](_0x128542[_0x9b3f('0x2e')],qs[_0x9b3f('0x33')](_0x377d0e['query'][_0x9b3f('0x33')]));_0x1059b1[_0x9b3f('0x32')]=_0x1059b1[_0x9b3f('0x32')][_0x9b3f('0x34')]?_0x1059b1[_0x9b3f('0x32')]:_0x128542[_0x9b3f('0x2e')];if(!_0x377d0e['query'][_0x9b3f('0x35')](_0x9b3f('0x36'))){_0x1059b1[_0x9b3f('0x1b')]=qs['limit'](_0x377d0e[_0x9b3f('0x31')][_0x9b3f('0x1b')]);_0x1059b1[_0x9b3f('0x19')]=qs[_0x9b3f('0x19')](_0x377d0e[_0x9b3f('0x31')][_0x9b3f('0x19')]);}_0x1059b1[_0x9b3f('0x37')]=qs[_0x9b3f('0x38')](_0x377d0e[_0x9b3f('0x31')][_0x9b3f('0x38')]);_0x1059b1[_0x9b3f('0x39')]=qs[_0x9b3f('0x3a')](_[_0x9b3f('0x3b')](_0x377d0e[_0x9b3f('0x31')],_0x128542[_0x9b3f('0x3a')]),_0x1c89d3);if(_0x377d0e['query'][_0x9b3f('0x3c')]){_0x1059b1[_0x9b3f('0x39')]=_[_0x9b3f('0x3d')](_0x1059b1[_0x9b3f('0x39')],{'$or':_[_0x9b3f('0x29')](_0x1c89d3,function(_0x1d08b5){if(_0x1d08b5[_0x9b3f('0x2c')]!=='VIRTUAL'){var _0x1c2154={};_0x1c2154[_0x1d08b5[_0x9b3f('0x27')]]={'$like':'%'+_0x377d0e['query'][_0x9b3f('0x3c')]+'%'};return _0x1c2154;}})});}_0x1059b1=_[_0x9b3f('0x3d')]({},_0x1059b1,_0x377d0e['options']);var _0x13b6c4={'where':_0x1059b1[_0x9b3f('0x39')]};return db[_0x9b3f('0x3e')]['count'](_0x13b6c4)[_0x9b3f('0x22')](function(_0xb34c29){_0x35f2dd[_0x9b3f('0x1c')]=_0xb34c29;if(_0x377d0e[_0x9b3f('0x31')][_0x9b3f('0x3f')]){_0x1059b1['include']=[{'all':!![]}];}return db['ChatQueueReport'][_0x9b3f('0x40')](_0x1059b1);})[_0x9b3f('0x22')](function(_0x54e5bc){_0x35f2dd['rows']=_0x54e5bc;return _0x35f2dd;})[_0x9b3f('0x22')](respondWithFilteredResult(_0x4a0d60,_0x1059b1))['catch'](handleError(_0x4a0d60,null));};exports[_0x9b3f('0x41')]=function(_0x547fdc,_0x8f9971){var _0x4ae4c1={'raw':!![],'where':{'id':_0x547fdc[_0x9b3f('0x42')]['id']}},_0x4eb8fe={};_0x4eb8fe[_0x9b3f('0x2e')]=_[_0x9b3f('0x2f')](db[_0x9b3f('0x3e')]['rawAttributes']);_0x4eb8fe['query']=_[_0x9b3f('0x2f')](_0x547fdc['query']);_0x4eb8fe[_0x9b3f('0x3a')]=_[_0x9b3f('0x30')](_0x4eb8fe['model'],_0x4eb8fe[_0x9b3f('0x31')]);_0x4ae4c1[_0x9b3f('0x32')]=_[_0x9b3f('0x30')](_0x4eb8fe[_0x9b3f('0x2e')],qs['fields'](_0x547fdc[_0x9b3f('0x31')][_0x9b3f('0x33')]));_0x4ae4c1[_0x9b3f('0x32')]=_0x4ae4c1[_0x9b3f('0x32')][_0x9b3f('0x34')]?_0x4ae4c1['attributes']:_0x4eb8fe[_0x9b3f('0x2e')];if(_0x547fdc[_0x9b3f('0x31')]['includeAll']){_0x4ae4c1[_0x9b3f('0x43')]=[{'all':!![]}];}_0x4ae4c1=_[_0x9b3f('0x3d')]({},_0x4ae4c1,_0x547fdc[_0x9b3f('0x44')]);return db[_0x9b3f('0x3e')][_0x9b3f('0x45')](_0x4ae4c1)[_0x9b3f('0x22')](handleEntityNotFound(_0x8f9971,null))[_0x9b3f('0x22')](respondWithResult(_0x8f9971,null))['catch'](handleError(_0x8f9971,null));};exports[_0x9b3f('0x46')]=function(_0x3bc2c9,_0x420d6f){return db[_0x9b3f('0x3e')][_0x9b3f('0x46')](_0x3bc2c9[_0x9b3f('0x47')],{})[_0x9b3f('0x22')](respondWithResult(_0x420d6f,0xc9))[_0x9b3f('0x48')](handleError(_0x420d6f,null));};exports[_0x9b3f('0x49')]=function(_0x51dd3d,_0x24d3cd){if(_0x51dd3d['body']['id']){delete _0x51dd3d[_0x9b3f('0x47')]['id'];}return db[_0x9b3f('0x3e')][_0x9b3f('0x45')]({'where':{'id':_0x51dd3d[_0x9b3f('0x42')]['id']}})['then'](handleEntityNotFound(_0x24d3cd,null))[_0x9b3f('0x22')](saveUpdates(_0x51dd3d[_0x9b3f('0x47')],null))[_0x9b3f('0x22')](respondWithResult(_0x24d3cd,null))[_0x9b3f('0x48')](handleError(_0x24d3cd,null));};exports['destroy']=function(_0x571f57,_0x4eede7){return db['ChatQueueReport'][_0x9b3f('0x45')]({'where':{'id':_0x571f57[_0x9b3f('0x42')]['id']}})[_0x9b3f('0x22')](handleEntityNotFound(_0x4eede7,null))[_0x9b3f('0x22')](removeEntity(_0x4eede7,null))[_0x9b3f('0x48')](handleError(_0x4eede7,null));};exports['describe']=function(_0x1799bd,_0x48ac1f){return db[_0x9b3f('0x3e')][_0x9b3f('0x4a')]()['then'](respondWithResult(_0x48ac1f,null))[_0x9b3f('0x48')](handleError(_0x48ac1f,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index b1914c0..30dffde 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(_0x14c5cc,_0xbebb70){var _0x33096f=function(_0x73aea6){while(--_0x73aea6){_0x14c5cc['push'](_0x14c5cc['shift']());}};_0x33096f(++_0xbebb70);}(_0xbaf0,0x12a));var _0x0baf=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbaf0[_0x19e35c];return _0x3e1fe8;};'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 _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x465147,_0x240ccd){var _0x5449b5=function(_0x3d7dce){while(--_0x3d7dce){_0x465147['push'](_0x465147['shift']());}};_0x5449b5(++_0x240ccd);}(_0xb10b,0x12a));var _0xbb10=function(_0x34e0dd,_0x1bd86f){_0x34e0dd=_0x34e0dd-0x0;var _0x505d0c=_0xb10b[_0x34e0dd];return _0x505d0c;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 67a8fd4..2cc9826 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 _0x4d41=['message','CreateChatQueueReport','create','body','options','update','raw','where','attributes','UpdateChatQueueReport','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code'];(function(_0x4e0f38,_0x221eda){var _0x2a42b4=function(_0x5ab9d2){while(--_0x5ab9d2){_0x4e0f38['push'](_0x4e0f38['shift']());}};_0x2a42b4(++_0x221eda);}(_0x4d41,0x1a0));var _0x14d4=function(_0x493503,_0x351993){_0x493503=_0x493503-0x0;var _0x1986d0=_0x4d41[_0x493503];return _0x1986d0;};'use strict';var _=require(_0x14d4('0x0'));var util=require('util');var moment=require(_0x14d4('0x1'));var BPromise=require('bluebird');var rs=require(_0x14d4('0x2'));var fs=require('fs');var Redis=require(_0x14d4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x14d4('0x4'));var logger=require(_0x14d4('0x5'))('rpc');var config=require(_0x14d4('0x6'));var jayson=require(_0x14d4('0x7'));var client=jayson[_0x14d4('0x8')][_0x14d4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3880ad,_0x10db52,_0x5afc24){return new BPromise(function(_0x211701,_0x1d345d){return client[_0x14d4('0xa')](_0x3880ad,_0x5afc24)[_0x14d4('0xb')](function(_0x57c107){logger[_0x14d4('0xc')](_0x14d4('0xd'),_0x10db52,'request\x20sent');logger[_0x14d4('0xe')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x10db52,_0x14d4('0xf'),JSON[_0x14d4('0x10')](_0x57c107));if(_0x57c107[_0x14d4('0x11')]){if(_0x57c107['error'][_0x14d4('0x12')]===0x1f4){logger[_0x14d4('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x10db52,_0x57c107['error'][_0x14d4('0x13')]);return _0x1d345d(_0x57c107[_0x14d4('0x11')][_0x14d4('0x13')]);}logger['error'](_0x14d4('0xd'),_0x10db52,_0x57c107[_0x14d4('0x11')][_0x14d4('0x13')]);return _0x211701(_0x57c107[_0x14d4('0x11')]['message']);}else{logger[_0x14d4('0xc')](_0x14d4('0xd'),_0x10db52,_0x14d4('0xf'));_0x211701(_0x57c107['result'][_0x14d4('0x13')]);}})['catch'](function(_0x21072b){logger[_0x14d4('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x10db52,_0x21072b);_0x1d345d(_0x21072b);});});}exports[_0x14d4('0x14')]=function(_0x4be7ed){var _0x3adaa1=this;return new Promise(function(_0x4544bb,_0x4b4be4){return db['ChatQueueReport'][_0x14d4('0x15')](_0x4be7ed[_0x14d4('0x16')],{'raw':_0x4be7ed['options']?_0x4be7ed[_0x14d4('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x14d4('0xb')](function(_0x6535e8){logger['info'](_0x14d4('0x14'),_0x4be7ed);logger['debug'](_0x14d4('0x14'),_0x4be7ed,JSON[_0x14d4('0x10')](_0x6535e8));_0x4544bb(_0x6535e8);})['catch'](function(_0x157c1d){logger[_0x14d4('0x11')](_0x14d4('0x14'),_0x157c1d[_0x14d4('0x13')],_0x4be7ed);_0x4b4be4(_0x3adaa1['error'](0x1f4,_0x157c1d[_0x14d4('0x13')]));});});};exports['UpdateChatQueueReport']=function(_0x598773){var _0x2f0c0c=this;return new Promise(function(_0xd3d24e,_0x543c58){return db['ChatQueueReport'][_0x14d4('0x18')](_0x598773[_0x14d4('0x16')],{'raw':_0x598773[_0x14d4('0x17')]?_0x598773[_0x14d4('0x17')][_0x14d4('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x598773['options']?_0x598773[_0x14d4('0x17')][_0x14d4('0x1a')]||null:null,'attributes':_0x598773[_0x14d4('0x17')]?_0x598773['options'][_0x14d4('0x1b')]||null:null,'limit':_0x598773[_0x14d4('0x17')]?_0x598773[_0x14d4('0x17')]['limit']||null:null})['then'](function(_0x37ebca){logger[_0x14d4('0xc')](_0x14d4('0x1c'),_0x598773);logger[_0x14d4('0xe')]('UpdateChatQueueReport',_0x598773,JSON[_0x14d4('0x10')](_0x37ebca));_0xd3d24e(_0x37ebca);})['catch'](function(_0x5a84a0){logger['error']('UpdateChatQueueReport',_0x5a84a0[_0x14d4('0x13')],_0x598773);_0x543c58(_0x2f0c0c[_0x14d4('0x11')](0x1f4,_0x5a84a0['message']));});});}; \ No newline at end of file +var _0xb602=['result','catch','CreateChatQueueReport','ChatQueueReport','create','options','raw','then','UpdateChatQueueReport','update','body','where','limit','lodash','util','moment','bluebird','../../config/utils','../../config/environment','client','http','request','ChatQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','info','request\x20sent'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xb602,0x175));var _0x2b60=function(_0x5192eb,_0x565daf){_0x5192eb=_0x5192eb-0x0;var _0xb0b6f7=_0xb602[_0x5192eb];return _0xb0b6f7;};'use strict';var _=require(_0x2b60('0x0'));var util=require(_0x2b60('0x1'));var moment=require(_0x2b60('0x2'));var BPromise=require(_0x2b60('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2b60('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x2b60('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x2b60('0x6')][_0x2b60('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x272982,_0x149e5d,_0x43420e){return new BPromise(function(_0x2b54bf,_0x25de9f){return client[_0x2b60('0x8')](_0x272982,_0x43420e)['then'](function(_0x1dff91){logger['info'](_0x2b60('0x9'),_0x149e5d,'request\x20sent');logger[_0x2b60('0xa')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x149e5d,'request\x20sent',JSON[_0x2b60('0xb')](_0x1dff91));if(_0x1dff91['error']){if(_0x1dff91[_0x2b60('0xc')][_0x2b60('0xd')]===0x1f4){logger[_0x2b60('0xc')](_0x2b60('0x9'),_0x149e5d,_0x1dff91[_0x2b60('0xc')]['message']);return _0x25de9f(_0x1dff91[_0x2b60('0xc')]['message']);}logger[_0x2b60('0xc')](_0x2b60('0x9'),_0x149e5d,_0x1dff91['error'][_0x2b60('0xe')]);return _0x2b54bf(_0x1dff91['error'][_0x2b60('0xe')]);}else{logger[_0x2b60('0xf')](_0x2b60('0x9'),_0x149e5d,_0x2b60('0x10'));_0x2b54bf(_0x1dff91[_0x2b60('0x11')][_0x2b60('0xe')]);}})[_0x2b60('0x12')](function(_0x208575){logger[_0x2b60('0xc')](_0x2b60('0x9'),_0x149e5d,_0x208575);_0x25de9f(_0x208575);});});}exports[_0x2b60('0x13')]=function(_0xf2daa0){var _0x2e4779=this;return new Promise(function(_0xa9dde4,_0x4ec5fd){return db[_0x2b60('0x14')][_0x2b60('0x15')](_0xf2daa0['body'],{'raw':_0xf2daa0['options']?_0xf2daa0[_0x2b60('0x16')][_0x2b60('0x17')]===undefined?!![]:![]:!![]})[_0x2b60('0x18')](function(_0x3aaa93){logger['info'](_0x2b60('0x13'),_0xf2daa0);logger[_0x2b60('0xa')]('CreateChatQueueReport',_0xf2daa0,JSON[_0x2b60('0xb')](_0x3aaa93));_0xa9dde4(_0x3aaa93);})['catch'](function(_0x304cfd){logger[_0x2b60('0xc')](_0x2b60('0x13'),_0x304cfd[_0x2b60('0xe')],_0xf2daa0);_0x4ec5fd(_0x2e4779['error'](0x1f4,_0x304cfd['message']));});});};exports[_0x2b60('0x19')]=function(_0x16208e){var _0x5b7c2d=this;return new Promise(function(_0x4f4caa,_0x1f498c){return db[_0x2b60('0x14')][_0x2b60('0x1a')](_0x16208e[_0x2b60('0x1b')],{'raw':_0x16208e['options']?_0x16208e[_0x2b60('0x16')][_0x2b60('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16208e['options']?_0x16208e['options'][_0x2b60('0x1c')]||null:null,'attributes':_0x16208e['options']?_0x16208e[_0x2b60('0x16')]['attributes']||null:null,'limit':_0x16208e[_0x2b60('0x16')]?_0x16208e['options'][_0x2b60('0x1d')]||null:null})[_0x2b60('0x18')](function(_0x89c5cd){logger[_0x2b60('0xf')]('UpdateChatQueueReport',_0x16208e);logger['debug']('UpdateChatQueueReport',_0x16208e,JSON[_0x2b60('0xb')](_0x89c5cd));_0x4f4caa(_0x89c5cd);})[_0x2b60('0x12')](function(_0x80e676){logger[_0x2b60('0xc')](_0x2b60('0x19'),_0x80e676[_0x2b60('0xe')],_0x16208e);_0x1f498c(_0x5b7c2d[_0x2b60('0xc')](0x1f4,_0x80e676[_0x2b60('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 6220ece..774eb8b 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 _0x125b=['get','isAuthenticated','index','/describe','describe','create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../config/environment','./chatQueueReport.controller'];(function(_0x4ba0ba,_0x399518){var _0x2a5dcf=function(_0x303226){while(--_0x303226){_0x4ba0ba['push'](_0x4ba0ba['shift']());}};_0x2a5dcf(++_0x399518);}(_0x125b,0x91));var _0xb125=function(_0x39f097,_0x17116b){_0x39f097=_0x39f097-0x0;var _0x544f6a=_0x125b[_0x39f097];return _0x544f6a;};'use strict';var multer=require(_0xb125('0x0'));var util=require(_0xb125('0x1'));var path=require('path');var timeout=require(_0xb125('0x2'));var express=require('express');var router=express[_0xb125('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb125('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb125('0x5'));var controller=require(_0xb125('0x6'));router[_0xb125('0x7')]('/',auth[_0xb125('0x8')](),controller[_0xb125('0x9')]);router['get'](_0xb125('0xa'),auth[_0xb125('0x8')](),controller[_0xb125('0xb')]);router[_0xb125('0x7')]('/:id',auth[_0xb125('0x8')](),controller['show']);router['post']('/',auth[_0xb125('0x8')](),controller[_0xb125('0xc')]);router[_0xb125('0xd')](_0xb125('0xe'),auth[_0xb125('0x8')](),controller[_0xb125('0xf')]);router[_0xb125('0x10')](_0xb125('0xe'),auth[_0xb125('0x8')](),controller[_0xb125('0x11')]);module[_0xb125('0x12')]=router; \ No newline at end of file +var _0xa69e=['path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/:id','show','post','put','destroy','multer','util'];(function(_0x158f93,_0x6fba75){var _0x3dfeb4=function(_0x288b08){while(--_0x288b08){_0x158f93['push'](_0x158f93['shift']());}};_0x3dfeb4(++_0x6fba75);}(_0xa69e,0x130));var _0xea69=function(_0xe0b8f9,_0x5853ad){_0xe0b8f9=_0xe0b8f9-0x0;var _0x54fe4a=_0xa69e[_0xe0b8f9];return _0x54fe4a;};'use strict';var multer=require(_0xea69('0x0'));var util=require(_0xea69('0x1'));var path=require(_0xea69('0x2'));var timeout=require('connect-timeout');var express=require(_0xea69('0x3'));var router=express[_0xea69('0x4')]();var fs_extra=require(_0xea69('0x5'));var auth=require(_0xea69('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xea69('0x7'));var controller=require(_0xea69('0x8'));router[_0xea69('0x9')]('/',auth[_0xea69('0xa')](),controller[_0xea69('0xb')]);router[_0xea69('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0xea69('0xc'),auth[_0xea69('0xa')](),controller[_0xea69('0xd')]);router[_0xea69('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xea69('0xf')](_0xea69('0xc'),auth[_0xea69('0xa')](),controller['update']);router['delete'](_0xea69('0xc'),auth[_0xea69('0xa')](),controller[_0xea69('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 0d6f931..06de1a5 100644 --- a/server/api/chatTransferReport/chatTransferReport.attributes.js +++ b/server/api/chatTransferReport/chatTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0xf2662b,_0x4d8f41){var _0x257dc7=function(_0x46b1d1){while(--_0x46b1d1){_0xf2662b['push'](_0xf2662b['shift']());}};_0x257dc7(++_0x4d8f41);}(_0xb43b,0x1b2));var _0xbb43=function(_0x10f363,_0x37c87a){_0x10f363=_0x10f363-0x0;var _0x2e8b9a=_0xb43b[_0x10f363];return _0x2e8b9a;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file +var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x29eb8c,_0x3a9eec){var _0x558e65=function(_0x416c37){while(--_0x416c37){_0x29eb8c['push'](_0x29eb8c['shift']());}};_0x558e65(++_0x3a9eec);}(_0xedd9,0xfc));var _0x9edd=function(_0x31344e,_0xc1b9c){_0x31344e=_0x31344e-0x0;var _0x2afddd=_0xedd9[_0x31344e];return _0x2afddd;};'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/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index d34473a..3150b15 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 _0x0904=['includeAll','include','findAll','rows','show','find','catch','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','util','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/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','stack','name','send','index','ChatTransferReport','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options'];(function(_0x2338fa,_0x80579a){var _0x42df9b=function(_0x13fe56){while(--_0x13fe56){_0x2338fa['push'](_0x2338fa['shift']());}};_0x42df9b(++_0x80579a);}(_0x0904,0x182));var _0x4090=function(_0x1e0a4a,_0x55752e){_0x1e0a4a=_0x1e0a4a-0x0;var _0x352afd=_0x0904[_0x1e0a4a];return _0x352afd;};'use strict';var emlformat=require(_0x4090('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4090('0x1'));var jsonpatch=require(_0x4090('0x2'));var rp=require(_0x4090('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4090('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x4090('0x5'));var ejs=require(_0x4090('0x6'));var fs=require('fs');var fs_extra=require(_0x4090('0x7'));var _=require('lodash');var squel=require(_0x4090('0x8'));var crypto=require(_0x4090('0x9'));var jsforce=require(_0x4090('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4090('0xb'));var Papa=require(_0x4090('0xc'));var Redis=require(_0x4090('0xd'));var authService=require(_0x4090('0xe'));var qs=require(_0x4090('0xf'));var as=require(_0x4090('0x10'));var hardwareService=require(_0x4090('0x11'));var logger=require(_0x4090('0x12'))(_0x4090('0x13'));var utils=require(_0x4090('0x14'));var config=require(_0x4090('0x15'));var licenseUtil=require(_0x4090('0x16'));var db=require(_0x4090('0x17'))['db'];function respondWithStatusCode(_0x82d5e4,_0x2d04a7){_0x2d04a7=_0x2d04a7||0xcc;return function(_0x44b07d){if(_0x44b07d){return _0x82d5e4[_0x4090('0x18')](_0x2d04a7);}return _0x82d5e4[_0x4090('0x19')](_0x2d04a7)[_0x4090('0x1a')]();};}function respondWithResult(_0x2382e5,_0x1b3b8d){_0x1b3b8d=_0x1b3b8d||0xc8;return function(_0x9852ad){if(_0x9852ad){return _0x2382e5[_0x4090('0x19')](_0x1b3b8d)[_0x4090('0x1b')](_0x9852ad);}};}function respondWithFilteredResult(_0x4485fc,_0x3164c2){return function(_0x50a0c4){if(_0x50a0c4){var _0x413626=typeof _0x3164c2[_0x4090('0x1c')]===_0x4090('0x1d')&&typeof _0x3164c2[_0x4090('0x1e')]===_0x4090('0x1d');var _0x4c06ed=_0x50a0c4['count'];var _0x4588ea=_0x413626?0x0:_0x3164c2[_0x4090('0x1c')];var _0x51f940=_0x413626?_0x50a0c4[_0x4090('0x1f')]:_0x3164c2[_0x4090('0x1c')]+_0x3164c2[_0x4090('0x1e')];var _0x17bbf7;if(_0x51f940>=_0x4c06ed){_0x51f940=_0x4c06ed;_0x17bbf7=0xc8;}else{_0x17bbf7=0xce;}_0x4485fc['status'](_0x17bbf7);return _0x4485fc[_0x4090('0x20')](_0x4090('0x21'),_0x4588ea+'-'+_0x51f940+'/'+_0x4c06ed)[_0x4090('0x1b')](_0x50a0c4);}return null;};}function patchUpdates(_0x348b2c){return function(_0x523fc2){try{jsonpatch['apply'](_0x523fc2,_0x348b2c,!![]);}catch(_0xa7654d){return BPromise[_0x4090('0x22')](_0xa7654d);}return _0x523fc2['save']();};}function saveUpdates(_0x4b06ca,_0x1dfe29){return function(_0x22ee53){if(_0x22ee53){return _0x22ee53[_0x4090('0x23')](_0x4b06ca)[_0x4090('0x24')](function(_0x13e1ce){return _0x13e1ce;});}return null;};}function removeEntity(_0x31b7c4,_0x20c6e7){return function(_0x21764f){if(_0x21764f){return _0x21764f[_0x4090('0x25')]()[_0x4090('0x24')](function(){_0x31b7c4[_0x4090('0x19')](0xcc)[_0x4090('0x1a')]();});}};}function handleEntityNotFound(_0x5c4550,_0x87e904){return function(_0xe5f7e6){if(!_0xe5f7e6){_0x5c4550[_0x4090('0x18')](0x194);}return _0xe5f7e6;};}function handleError(_0x4f5d57,_0x34e4fd){_0x34e4fd=_0x34e4fd||0x1f4;return function(_0x2ea073){logger['error'](_0x2ea073[_0x4090('0x26')]);if(_0x2ea073[_0x4090('0x27')]){delete _0x2ea073[_0x4090('0x27')];}_0x4f5d57[_0x4090('0x19')](_0x34e4fd)[_0x4090('0x28')](_0x2ea073);};}exports[_0x4090('0x29')]=function(_0x6c1861,_0x2fa9fc){var _0x5a6706={},_0x2817d2={},_0x594781={'count':0x0,'rows':[]};var _0x27e637=_['map'](db[_0x4090('0x2a')][_0x4090('0x2b')],function(_0x51be4e){return{'name':_0x51be4e[_0x4090('0x2c')],'type':_0x51be4e[_0x4090('0x2d')][_0x4090('0x2e')]};});_0x2817d2['model']=_[_0x4090('0x2f')](_0x27e637,_0x4090('0x27'));_0x2817d2[_0x4090('0x30')]=_[_0x4090('0x31')](_0x6c1861[_0x4090('0x30')]);_0x2817d2[_0x4090('0x32')]=_[_0x4090('0x33')](_0x2817d2[_0x4090('0x34')],_0x2817d2[_0x4090('0x30')]);_0x5a6706[_0x4090('0x35')]=_[_0x4090('0x33')](_0x2817d2[_0x4090('0x34')],qs[_0x4090('0x36')](_0x6c1861[_0x4090('0x30')]['fields']));_0x5a6706[_0x4090('0x35')]=_0x5a6706[_0x4090('0x35')]['length']?_0x5a6706['attributes']:_0x2817d2[_0x4090('0x34')];if(!_0x6c1861['query'][_0x4090('0x37')](_0x4090('0x38'))){_0x5a6706[_0x4090('0x1e')]=qs[_0x4090('0x1e')](_0x6c1861['query']['limit']);_0x5a6706['offset']=qs[_0x4090('0x1c')](_0x6c1861[_0x4090('0x30')][_0x4090('0x1c')]);}_0x5a6706[_0x4090('0x39')]=qs['sort'](_0x6c1861[_0x4090('0x30')][_0x4090('0x3a')]);_0x5a6706[_0x4090('0x3b')]=qs['filters'](_['pick'](_0x6c1861['query'],_0x2817d2['filters']),_0x27e637);if(_0x6c1861['query'][_0x4090('0x3c')]){_0x5a6706[_0x4090('0x3b')]=_[_0x4090('0x3d')](_0x5a6706[_0x4090('0x3b')],{'$or':_[_0x4090('0x2f')](_0x27e637,function(_0x5c234a){if(_0x5c234a[_0x4090('0x2d')]!==_0x4090('0x3e')){var _0x724d4d={};_0x724d4d[_0x5c234a[_0x4090('0x27')]]={'$like':'%'+_0x6c1861['query']['filter']+'%'};return _0x724d4d;}})});}_0x5a6706=_[_0x4090('0x3d')]({},_0x5a6706,_0x6c1861[_0x4090('0x3f')]);var _0x23ee77={'where':_0x5a6706['where']};return db[_0x4090('0x2a')][_0x4090('0x1f')](_0x23ee77)[_0x4090('0x24')](function(_0x588fe2){_0x594781[_0x4090('0x1f')]=_0x588fe2;if(_0x6c1861[_0x4090('0x30')][_0x4090('0x40')]){_0x5a6706[_0x4090('0x41')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x4090('0x42')](_0x5a6706);})[_0x4090('0x24')](function(_0x5d9773){_0x594781[_0x4090('0x43')]=_0x5d9773;return _0x594781;})[_0x4090('0x24')](respondWithFilteredResult(_0x2fa9fc,_0x5a6706))['catch'](handleError(_0x2fa9fc,null));};exports[_0x4090('0x44')]=function(_0x1ae243,_0x17f388){var _0x4332fc={'raw':!![],'where':{'id':_0x1ae243['params']['id']}},_0x486f7e={};_0x486f7e[_0x4090('0x34')]=_['keys'](db[_0x4090('0x2a')]['rawAttributes']);_0x486f7e[_0x4090('0x30')]=_[_0x4090('0x31')](_0x1ae243[_0x4090('0x30')]);_0x486f7e[_0x4090('0x32')]=_[_0x4090('0x33')](_0x486f7e['model'],_0x486f7e['query']);_0x4332fc[_0x4090('0x35')]=_['intersection'](_0x486f7e[_0x4090('0x34')],qs[_0x4090('0x36')](_0x1ae243[_0x4090('0x30')][_0x4090('0x36')]));_0x4332fc[_0x4090('0x35')]=_0x4332fc[_0x4090('0x35')]['length']?_0x4332fc[_0x4090('0x35')]:_0x486f7e[_0x4090('0x34')];if(_0x1ae243[_0x4090('0x30')][_0x4090('0x40')]){_0x4332fc[_0x4090('0x41')]=[{'all':!![]}];}_0x4332fc=_['merge']({},_0x4332fc,_0x1ae243['options']);return db[_0x4090('0x2a')][_0x4090('0x45')](_0x4332fc)[_0x4090('0x24')](handleEntityNotFound(_0x17f388,null))[_0x4090('0x24')](respondWithResult(_0x17f388,null))[_0x4090('0x46')](handleError(_0x17f388,null));};exports['create']=function(_0x3ebca1,_0x5312ca){return db['ChatTransferReport'][_0x4090('0x47')](_0x3ebca1['body'],{})[_0x4090('0x24')](respondWithResult(_0x5312ca,0xc9))[_0x4090('0x46')](handleError(_0x5312ca,null));};exports[_0x4090('0x23')]=function(_0x517a01,_0x1c7168){if(_0x517a01[_0x4090('0x48')]['id']){delete _0x517a01[_0x4090('0x48')]['id'];}return db[_0x4090('0x2a')][_0x4090('0x45')]({'where':{'id':_0x517a01['params']['id']}})[_0x4090('0x24')](handleEntityNotFound(_0x1c7168,null))[_0x4090('0x24')](saveUpdates(_0x517a01[_0x4090('0x48')],null))['then'](respondWithResult(_0x1c7168,null))[_0x4090('0x46')](handleError(_0x1c7168,null));};exports[_0x4090('0x25')]=function(_0x315db5,_0x4399c9){return db[_0x4090('0x2a')][_0x4090('0x45')]({'where':{'id':_0x315db5[_0x4090('0x49')]['id']}})[_0x4090('0x24')](handleEntityNotFound(_0x4399c9,null))[_0x4090('0x24')](removeEntity(_0x4399c9,null))[_0x4090('0x46')](handleError(_0x4399c9,null));};exports['describe']=function(_0xc47278,_0x39f03d){return db[_0x4090('0x2a')][_0x4090('0x4a')]()[_0x4090('0x24')](respondWithResult(_0x39f03d,null))['catch'](handleError(_0x39f03d,null));}; \ No newline at end of file +var _0xcd0f=['fast-json-patch','request-promise','moment','bluebird','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','json','undefined','count','offset','limit','status','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','keys','create','body','find','describe','eml-format','rimraf','zip-dir'];(function(_0x4a96ca,_0x13754e){var _0x2aed48=function(_0x361330){while(--_0x361330){_0x4a96ca['push'](_0x4a96ca['shift']());}};_0x2aed48(++_0x13754e);}(_0xcd0f,0x131));var _0xfcd0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xcd0f[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xfcd0('0x0'));var rimraf=require(_0xfcd0('0x1'));var zipdir=require(_0xfcd0('0x2'));var jsonpatch=require(_0xfcd0('0x3'));var rp=require(_0xfcd0('0x4'));var moment=require(_0xfcd0('0x5'));var BPromise=require(_0xfcd0('0x6'));var Mustache=require('mustache');var util=require(_0xfcd0('0x7'));var path=require(_0xfcd0('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfcd0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfcd0('0xa'));var squel=require(_0xfcd0('0xb'));var crypto=require(_0xfcd0('0xc'));var jsforce=require(_0xfcd0('0xd'));var deskjs=require(_0xfcd0('0xe'));var toCsv=require(_0xfcd0('0xf'));var querystring=require(_0xfcd0('0x10'));var Papa=require(_0xfcd0('0x11'));var Redis=require('ioredis');var authService=require(_0xfcd0('0x12'));var qs=require(_0xfcd0('0x13'));var as=require(_0xfcd0('0x14'));var hardwareService=require(_0xfcd0('0x15'));var logger=require(_0xfcd0('0x16'))('api');var utils=require(_0xfcd0('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xfcd0('0x18'));var db=require(_0xfcd0('0x19'))['db'];function respondWithStatusCode(_0x587b90,_0x1a89b0){_0x1a89b0=_0x1a89b0||0xcc;return function(_0x20a1fc){if(_0x20a1fc){return _0x587b90['sendStatus'](_0x1a89b0);}return _0x587b90['status'](_0x1a89b0)[_0xfcd0('0x1a')]();};}function respondWithResult(_0x3b4101,_0x203fa1){_0x203fa1=_0x203fa1||0xc8;return function(_0x33ad0a){if(_0x33ad0a){return _0x3b4101['status'](_0x203fa1)[_0xfcd0('0x1b')](_0x33ad0a);}};}function respondWithFilteredResult(_0x35a1e0,_0x3082aa){return function(_0xf98d13){if(_0xf98d13){var _0x2203e8=typeof _0x3082aa['offset']===_0xfcd0('0x1c')&&typeof _0x3082aa['limit']===_0xfcd0('0x1c');var _0x1018b0=_0xf98d13[_0xfcd0('0x1d')];var _0xa17afa=_0x2203e8?0x0:_0x3082aa['offset'];var _0x5e9f2c=_0x2203e8?_0xf98d13[_0xfcd0('0x1d')]:_0x3082aa[_0xfcd0('0x1e')]+_0x3082aa[_0xfcd0('0x1f')];var _0x61feef;if(_0x5e9f2c>=_0x1018b0){_0x5e9f2c=_0x1018b0;_0x61feef=0xc8;}else{_0x61feef=0xce;}_0x35a1e0[_0xfcd0('0x20')](_0x61feef);return _0x35a1e0['set'](_0xfcd0('0x21'),_0xa17afa+'-'+_0x5e9f2c+'/'+_0x1018b0)[_0xfcd0('0x1b')](_0xf98d13);}return null;};}function patchUpdates(_0x3072af){return function(_0x148d15){try{jsonpatch[_0xfcd0('0x22')](_0x148d15,_0x3072af,!![]);}catch(_0x1784bc){return BPromise[_0xfcd0('0x23')](_0x1784bc);}return _0x148d15[_0xfcd0('0x24')]();};}function saveUpdates(_0x165cdb,_0x3015f3){return function(_0xfb48f2){if(_0xfb48f2){return _0xfb48f2[_0xfcd0('0x25')](_0x165cdb)[_0xfcd0('0x26')](function(_0x446b93){return _0x446b93;});}return null;};}function removeEntity(_0x2f342e,_0x2b8c80){return function(_0x38c910){if(_0x38c910){return _0x38c910[_0xfcd0('0x27')]()[_0xfcd0('0x26')](function(){_0x2f342e[_0xfcd0('0x20')](0xcc)[_0xfcd0('0x1a')]();});}};}function handleEntityNotFound(_0x1b4b8a,_0x256b37){return function(_0xe1bb86){if(!_0xe1bb86){_0x1b4b8a['sendStatus'](0x194);}return _0xe1bb86;};}function handleError(_0x28a209,_0x108404){_0x108404=_0x108404||0x1f4;return function(_0x55ca3c){logger[_0xfcd0('0x28')](_0x55ca3c[_0xfcd0('0x29')]);if(_0x55ca3c[_0xfcd0('0x2a')]){delete _0x55ca3c[_0xfcd0('0x2a')];}_0x28a209['status'](_0x108404)[_0xfcd0('0x2b')](_0x55ca3c);};}exports[_0xfcd0('0x2c')]=function(_0x308ceb,_0xf51b2a){var _0x4ba02a={},_0x44d2dc={},_0x1b3fc2={'count':0x0,'rows':[]};var _0x15f639=_[_0xfcd0('0x2d')](db[_0xfcd0('0x2e')][_0xfcd0('0x2f')],function(_0x2cb76f){return{'name':_0x2cb76f[_0xfcd0('0x30')],'type':_0x2cb76f[_0xfcd0('0x31')][_0xfcd0('0x32')]};});_0x44d2dc['model']=_[_0xfcd0('0x2d')](_0x15f639,_0xfcd0('0x2a'));_0x44d2dc['query']=_['keys'](_0x308ceb[_0xfcd0('0x33')]);_0x44d2dc['filters']=_[_0xfcd0('0x34')](_0x44d2dc[_0xfcd0('0x35')],_0x44d2dc[_0xfcd0('0x33')]);_0x4ba02a[_0xfcd0('0x36')]=_[_0xfcd0('0x34')](_0x44d2dc['model'],qs[_0xfcd0('0x37')](_0x308ceb[_0xfcd0('0x33')]['fields']));_0x4ba02a['attributes']=_0x4ba02a[_0xfcd0('0x36')][_0xfcd0('0x38')]?_0x4ba02a[_0xfcd0('0x36')]:_0x44d2dc[_0xfcd0('0x35')];if(!_0x308ceb[_0xfcd0('0x33')][_0xfcd0('0x39')]('nolimit')){_0x4ba02a['limit']=qs['limit'](_0x308ceb['query']['limit']);_0x4ba02a[_0xfcd0('0x1e')]=qs[_0xfcd0('0x1e')](_0x308ceb[_0xfcd0('0x33')][_0xfcd0('0x1e')]);}_0x4ba02a[_0xfcd0('0x3a')]=qs[_0xfcd0('0x3b')](_0x308ceb['query'][_0xfcd0('0x3b')]);_0x4ba02a[_0xfcd0('0x3c')]=qs['filters'](_['pick'](_0x308ceb['query'],_0x44d2dc[_0xfcd0('0x3d')]),_0x15f639);if(_0x308ceb[_0xfcd0('0x33')]['filter']){_0x4ba02a[_0xfcd0('0x3c')]=_[_0xfcd0('0x3e')](_0x4ba02a[_0xfcd0('0x3c')],{'$or':_['map'](_0x15f639,function(_0x54aca8){if(_0x54aca8[_0xfcd0('0x31')]!==_0xfcd0('0x3f')){var _0x2e84f7={};_0x2e84f7[_0x54aca8['name']]={'$like':'%'+_0x308ceb[_0xfcd0('0x33')][_0xfcd0('0x40')]+'%'};return _0x2e84f7;}})});}_0x4ba02a=_[_0xfcd0('0x3e')]({},_0x4ba02a,_0x308ceb[_0xfcd0('0x41')]);var _0x1b12fe={'where':_0x4ba02a[_0xfcd0('0x3c')]};return db[_0xfcd0('0x2e')][_0xfcd0('0x1d')](_0x1b12fe)['then'](function(_0x1c10ac){_0x1b3fc2[_0xfcd0('0x1d')]=_0x1c10ac;if(_0x308ceb[_0xfcd0('0x33')]['includeAll']){_0x4ba02a[_0xfcd0('0x42')]=[{'all':!![]}];}return db[_0xfcd0('0x2e')][_0xfcd0('0x43')](_0x4ba02a);})[_0xfcd0('0x26')](function(_0xbc2455){_0x1b3fc2[_0xfcd0('0x44')]=_0xbc2455;return _0x1b3fc2;})['then'](respondWithFilteredResult(_0xf51b2a,_0x4ba02a))[_0xfcd0('0x45')](handleError(_0xf51b2a,null));};exports[_0xfcd0('0x46')]=function(_0xdad990,_0x2c11de){var _0xa4f368={'raw':!![],'where':{'id':_0xdad990[_0xfcd0('0x47')]['id']}},_0x19cc7b={};_0x19cc7b[_0xfcd0('0x35')]=_[_0xfcd0('0x48')](db['ChatTransferReport']['rawAttributes']);_0x19cc7b['query']=_[_0xfcd0('0x48')](_0xdad990[_0xfcd0('0x33')]);_0x19cc7b[_0xfcd0('0x3d')]=_[_0xfcd0('0x34')](_0x19cc7b[_0xfcd0('0x35')],_0x19cc7b['query']);_0xa4f368[_0xfcd0('0x36')]=_[_0xfcd0('0x34')](_0x19cc7b[_0xfcd0('0x35')],qs[_0xfcd0('0x37')](_0xdad990[_0xfcd0('0x33')][_0xfcd0('0x37')]));_0xa4f368[_0xfcd0('0x36')]=_0xa4f368[_0xfcd0('0x36')][_0xfcd0('0x38')]?_0xa4f368[_0xfcd0('0x36')]:_0x19cc7b['model'];if(_0xdad990[_0xfcd0('0x33')]['includeAll']){_0xa4f368[_0xfcd0('0x42')]=[{'all':!![]}];}_0xa4f368=_[_0xfcd0('0x3e')]({},_0xa4f368,_0xdad990[_0xfcd0('0x41')]);return db[_0xfcd0('0x2e')]['find'](_0xa4f368)[_0xfcd0('0x26')](handleEntityNotFound(_0x2c11de,null))[_0xfcd0('0x26')](respondWithResult(_0x2c11de,null))[_0xfcd0('0x45')](handleError(_0x2c11de,null));};exports['create']=function(_0x52cfc8,_0x2fc021){return db[_0xfcd0('0x2e')][_0xfcd0('0x49')](_0x52cfc8[_0xfcd0('0x4a')],{})[_0xfcd0('0x26')](respondWithResult(_0x2fc021,0xc9))['catch'](handleError(_0x2fc021,null));};exports[_0xfcd0('0x25')]=function(_0x52d2b5,_0xd60d20){if(_0x52d2b5[_0xfcd0('0x4a')]['id']){delete _0x52d2b5[_0xfcd0('0x4a')]['id'];}return db['ChatTransferReport'][_0xfcd0('0x4b')]({'where':{'id':_0x52d2b5[_0xfcd0('0x47')]['id']}})[_0xfcd0('0x26')](handleEntityNotFound(_0xd60d20,null))[_0xfcd0('0x26')](saveUpdates(_0x52d2b5[_0xfcd0('0x4a')],null))[_0xfcd0('0x26')](respondWithResult(_0xd60d20,null))[_0xfcd0('0x45')](handleError(_0xd60d20,null));};exports[_0xfcd0('0x27')]=function(_0x151f87,_0x4fe1cf){return db[_0xfcd0('0x2e')][_0xfcd0('0x4b')]({'where':{'id':_0x151f87[_0xfcd0('0x47')]['id']}})['then'](handleEntityNotFound(_0x4fe1cf,null))[_0xfcd0('0x26')](removeEntity(_0x4fe1cf,null))[_0xfcd0('0x45')](handleError(_0x4fe1cf,null));};exports[_0xfcd0('0x4c')]=function(_0x5b65e7,_0x2c2dcb){return db[_0xfcd0('0x2e')][_0xfcd0('0x4c')]()['then'](respondWithResult(_0x2c2dcb,null))[_0xfcd0('0x45')](handleError(_0x2c2dcb,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 0e493c1..8a153e6 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 _0x82db=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util'];(function(_0x10f6b0,_0x48c9b8){var _0x61feee=function(_0x67196a){while(--_0x67196a){_0x10f6b0['push'](_0x10f6b0['shift']());}};_0x61feee(++_0x48c9b8);}(_0x82db,0xee));var _0xb82d=function(_0x31185a,_0xd5eddd){_0x31185a=_0x31185a-0x0;var _0x7458fb=_0x82db[_0x31185a];return _0x7458fb;};'use strict';var _=require(_0xb82d('0x0'));var util=require(_0xb82d('0x1'));var logger=require(_0xb82d('0x2'))(_0xb82d('0x3'));var moment=require(_0xb82d('0x4'));var BPromise=require(_0xb82d('0x5'));var rp=require(_0xb82d('0x6'));var fs=require('fs');var path=require(_0xb82d('0x7'));var rimraf=require(_0xb82d('0x8'));var config=require(_0xb82d('0x9'));var attributes=require(_0xb82d('0xa'));module[_0xb82d('0xb')]=function(_0x4af15b,_0x2b2d0e){return _0x4af15b[_0xb82d('0xc')](_0xb82d('0xd'),attributes,{'tableName':_0xb82d('0xe'),'paranoid':![],'indexes':[{'name':_0xb82d('0xf'),'fields':[_0xb82d('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9d5a=['util','../../config/logger','moment','bluebird','path','rimraf','exports','define','ChatTransferReport','report_chat_transfer','uniqueid'];(function(_0x16e73a,_0x146629){var _0x187aa1=function(_0x26eb2f){while(--_0x26eb2f){_0x16e73a['push'](_0x16e73a['shift']());}};_0x187aa1(++_0x146629);}(_0x9d5a,0x129));var _0xa9d5=function(_0x421c11,_0xcf7560){_0x421c11=_0x421c11-0x0;var _0x317709=_0x9d5a[_0x421c11];return _0x317709;};'use strict';var _=require('lodash');var util=require(_0xa9d5('0x0'));var logger=require(_0xa9d5('0x1'))('api');var moment=require(_0xa9d5('0x2'));var BPromise=require(_0xa9d5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa9d5('0x4'));var rimraf=require(_0xa9d5('0x5'));var config=require('../../config/environment');var attributes=require('./chatTransferReport.attributes');module[_0xa9d5('0x6')]=function(_0x125421,_0x5e9151){return _0x125421[_0xa9d5('0x7')](_0xa9d5('0x8'),attributes,{'tableName':_0xa9d5('0x9'),'paranoid':![],'indexes':[{'name':_0xa9d5('0xa'),'fields':[_0xa9d5('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 713cb5c..a368795 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 _0xc372=['error','message','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0xbab8d5,_0x45ae45){var _0x274ce6=function(_0x16b1cc){while(--_0x16b1cc){_0xbab8d5['push'](_0xbab8d5['shift']());}};_0x274ce6(++_0x45ae45);}(_0xc372,0xdf));var _0x2c37=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc372[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x2c37('0x0'));var util=require(_0x2c37('0x1'));var moment=require(_0x2c37('0x2'));var BPromise=require(_0x2c37('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2c37('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2c37('0x5'));var logger=require(_0x2c37('0x6'))(_0x2c37('0x7'));var config=require(_0x2c37('0x8'));var jayson=require(_0x2c37('0x9'));var client=jayson[_0x2c37('0xa')][_0x2c37('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45472f,_0x9a023e,_0x43e438){return new BPromise(function(_0x318a4e,_0x354a77){return client[_0x2c37('0xc')](_0x45472f,_0x43e438)['then'](function(_0x35ffcd){logger[_0x2c37('0xd')](_0x2c37('0xe'),_0x9a023e,_0x2c37('0xf'));logger['debug'](_0x2c37('0x10'),_0x9a023e,_0x2c37('0xf'),JSON['stringify'](_0x35ffcd));if(_0x35ffcd[_0x2c37('0x11')]){if(_0x35ffcd[_0x2c37('0x11')]['code']===0x1f4){logger[_0x2c37('0x11')](_0x2c37('0xe'),_0x9a023e,_0x35ffcd[_0x2c37('0x11')][_0x2c37('0x12')]);return _0x354a77(_0x35ffcd[_0x2c37('0x11')]['message']);}logger[_0x2c37('0x11')](_0x2c37('0xe'),_0x9a023e,_0x35ffcd['error']['message']);return _0x318a4e(_0x35ffcd[_0x2c37('0x11')][_0x2c37('0x12')]);}else{logger['info'](_0x2c37('0xe'),_0x9a023e,_0x2c37('0xf'));_0x318a4e(_0x35ffcd['result']['message']);}})[_0x2c37('0x13')](function(_0x1f4d9c){logger['error'](_0x2c37('0xe'),_0x9a023e,_0x1f4d9c);_0x354a77(_0x1f4d9c);});});} \ No newline at end of file +var _0xa036=['request\x20sent','debug','stringify','error','code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','request','then','info','ChatTransferReport,\x20%s,\x20%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa036,0x1b6));var _0x6a03=function(_0xb26409,_0x298d50){_0xb26409=_0xb26409-0x0;var _0x5394eb=_0xa036[_0xb26409];return _0x5394eb;};'use strict';var _=require('lodash');var util=require(_0x6a03('0x0'));var moment=require(_0x6a03('0x1'));var BPromise=require(_0x6a03('0x2'));var rs=require(_0x6a03('0x3'));var fs=require('fs');var Redis=require(_0x6a03('0x4'));var db=require(_0x6a03('0x5'))['db'];var utils=require(_0x6a03('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6a03('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5cbfca,_0x226c5c,_0x15645f){return new BPromise(function(_0xab4adf,_0x256707){return client[_0x6a03('0x8')](_0x5cbfca,_0x15645f)[_0x6a03('0x9')](function(_0xf508da){logger[_0x6a03('0xa')](_0x6a03('0xb'),_0x226c5c,_0x6a03('0xc'));logger[_0x6a03('0xd')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x226c5c,'request\x20sent',JSON[_0x6a03('0xe')](_0xf508da));if(_0xf508da['error']){if(_0xf508da[_0x6a03('0xf')][_0x6a03('0x10')]===0x1f4){logger[_0x6a03('0xf')](_0x6a03('0xb'),_0x226c5c,_0xf508da[_0x6a03('0xf')][_0x6a03('0x11')]);return _0x256707(_0xf508da['error'][_0x6a03('0x11')]);}logger[_0x6a03('0xf')](_0x6a03('0xb'),_0x226c5c,_0xf508da[_0x6a03('0xf')][_0x6a03('0x11')]);return _0xab4adf(_0xf508da[_0x6a03('0xf')][_0x6a03('0x11')]);}else{logger[_0x6a03('0xa')](_0x6a03('0xb'),_0x226c5c,'request\x20sent');_0xab4adf(_0xf508da['result'][_0x6a03('0x11')]);}})['catch'](function(_0x293115){logger[_0x6a03('0xf')](_0x6a03('0xb'),_0x226c5c,_0x293115);_0x256707(_0x293115);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 07a48e4..ae82da9 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 _0x9d57=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer'];(function(_0x55097b,_0x14beb7){var _0x5b90ae=function(_0x58d82d){while(--_0x58d82d){_0x55097b['push'](_0x55097b['shift']());}};_0x5b90ae(++_0x14beb7);}(_0x9d57,0x158));var _0x79d5=function(_0x4de566,_0x504ac0){_0x4de566=_0x4de566-0x0;var _0x47837b=_0x9d57[_0x4de566];return _0x47837b;};'use strict';var multer=require(_0x79d5('0x0'));var util=require('util');var path=require(_0x79d5('0x1'));var timeout=require(_0x79d5('0x2'));var express=require(_0x79d5('0x3'));var router=express[_0x79d5('0x4')]();var fs_extra=require(_0x79d5('0x5'));var auth=require(_0x79d5('0x6'));var interaction=require(_0x79d5('0x7'));var config=require(_0x79d5('0x8'));var controller=require(_0x79d5('0x9'));router[_0x79d5('0xa')]('/',auth[_0x79d5('0xb')](),controller[_0x79d5('0xc')]);router['get'](_0x79d5('0xd'),auth[_0x79d5('0xb')](),controller[_0x79d5('0xe')]);router[_0x79d5('0xa')](_0x79d5('0xf'),auth[_0x79d5('0xb')](),controller[_0x79d5('0x10')]);router[_0x79d5('0x11')]('/',auth[_0x79d5('0xb')](),controller[_0x79d5('0x12')]);router['put'](_0x79d5('0xf'),auth['isAuthenticated'](),controller[_0x79d5('0x13')]);router[_0x79d5('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x79d5('0x15')]);module[_0x79d5('0x16')]=router; \ No newline at end of file +var _0x9922=['exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','get','isAuthenticated','index','/describe','/:id','post','create','put','update','destroy'];(function(_0x3be473,_0x2cc94b){var _0x3787ea=function(_0x3a448f){while(--_0x3a448f){_0x3be473['push'](_0x3be473['shift']());}};_0x3787ea(++_0x2cc94b);}(_0x9922,0x1c9));var _0x2992=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9922[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x2992('0x0'));var util=require(_0x2992('0x1'));var path=require('path');var timeout=require(_0x2992('0x2'));var express=require(_0x2992('0x3'));var router=express[_0x2992('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2992('0x5'));var interaction=require(_0x2992('0x6'));var config=require('../../config/environment');var controller=require(_0x2992('0x7'));router[_0x2992('0x8')]('/',auth[_0x2992('0x9')](),controller[_0x2992('0xa')]);router[_0x2992('0x8')](_0x2992('0xb'),auth[_0x2992('0x9')](),controller['describe']);router[_0x2992('0x8')](_0x2992('0xc'),auth[_0x2992('0x9')](),controller['show']);router[_0x2992('0xd')]('/',auth[_0x2992('0x9')](),controller[_0x2992('0xe')]);router[_0x2992('0xf')]('/:id',auth[_0x2992('0x9')](),controller[_0x2992('0x10')]);router['delete'](_0x2992('0xc'),auth[_0x2992('0x9')](),controller[_0x2992('0x11')]);module[_0x2992('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 25c955d..da7b43d 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 _0x3ea4=['offlineForm','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.','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','address','email','#011F6A','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','INTEGER','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Feedback','star','thumb','input','name','getDataValue','onlineForm','parse','setDataValue','stringify','Comments','Leave\x20your\x20comments'];(function(_0x1a2974,_0xfba559){var _0x31f214=function(_0x1c2d58){while(--_0x1c2d58){_0x1a2974['push'](_0x1a2974['shift']());}};_0x31f214(++_0xfba559);}(_0x3ea4,0xcc));var _0x43ea=function(_0x59ee91,_0x5ca1ef){_0x59ee91=_0x59ee91-0x0;var _0x51b0b7=_0x3ea4[_0x59ee91];return _0x51b0b7;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x43ea('0x0'));module[_0x43ea('0x1')]={'name':{'type':Sequelize[_0x43ea('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x43ea('0x2')],'allowNull':![],'unique':_0x43ea('0x3')},'description':{'type':Sequelize[_0x43ea('0x2')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x43ea('0x2')],'defaultValue':_0x43ea('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x43ea('0x2')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x43ea('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x43ea('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x43ea('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x43ea('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x43ea('0x2')]},'animation':{'type':Sequelize[_0x43ea('0x6')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x43ea('0x7')](_0x43ea('0x8'),_0x43ea('0x9')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x43ea('0x2')],'defaultValue':_0x43ea('0xa')},'start_chat_button':{'type':Sequelize[_0x43ea('0x2')],'defaultValue':_0x43ea('0xb')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x43ea('0xc')},'header_offline':{'type':Sequelize[_0x43ea('0x2')],'defaultValue':_0x43ea('0xd')},'download_transcript':{'type':Sequelize[_0x43ea('0x6')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x43ea('0xe')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x43ea('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x43ea('0x6')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x43ea('0xf')]},'closingQuestion':{'type':Sequelize[_0x43ea('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x43ea('0x2')],'defaultValue':_0x43ea('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0x43ea('0x2')],'defaultValue':_0x43ea('0x11')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x43ea('0x2')],'defaultValue':_0x43ea('0x12')},'closingMessage':{'type':Sequelize[_0x43ea('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x43ea('0x2')],'defaultValue':_0x43ea('0xc')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x43ea('0x6')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x43ea('0x6')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x43ea('0x6')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x43ea('0x2')],'defaultValue':_0x43ea('0x13')},'ratingType':{'type':Sequelize[_0x43ea('0x7')](_0x43ea('0x14'),_0x43ea('0x15')),'defaultValue':_0x43ea('0x14')},'ratingStarsNumber':{'type':Sequelize[_0x43ea('0xe')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x43ea('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x43ea('0x16'),'variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':_0x43ea('0x17'),'helpText':''}},{'type':_0x43ea('0x16'),'props':{'title':_0x43ea('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x43ea('0x4'),'type':_0x43ea('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x43ea('0x18')](_0x43ea('0x19'))?JSON[_0x43ea('0x1a')](this[_0x43ea('0x18')](_0x43ea('0x19'))):{};},'set':function(_0x1ed4af){return this[_0x43ea('0x1b')]('onlineForm',JSON[_0x43ea('0x1c')](_0x1ed4af));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x43ea('0x1c')]({'items':[{'type':_0x43ea('0x16'),'props':{'title':_0x43ea('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x43ea('0x4'),'type':'email'},'variable':null},{'type':'textarea','config':{'placeholder':_0x43ea('0x1d')},'props':{'title':_0x43ea('0x1d'),'helpText':_0x43ea('0x1e')}}],'fromKey':0x0});},'get':function(){return this[_0x43ea('0x18')]('offlineForm')?JSON[_0x43ea('0x1a')](this[_0x43ea('0x18')](_0x43ea('0x1f'))):{};},'set':function(_0x1a99a1){return this[_0x43ea('0x1b')]('offlineForm',JSON['stringify'](_0x1a99a1));}},'token':{'type':Sequelize[_0x43ea('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x43ea('0x6')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x43ea('0x6')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x43ea('0x2')]},'forwardOffline':{'type':Sequelize[_0x43ea('0x6')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x43ea('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x43ea('0x20')},'waitingMessage':{'type':Sequelize[_0x43ea('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x43ea('0x2')],'defaultValue':_0x43ea('0x21')},'offlineMessageBody':{'type':Sequelize[_0x43ea('0x2')],'defaultValue':_0x43ea('0x22')},'enableUnmanagedNote':{'type':Sequelize[_0x43ea('0x6')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x43ea('0x2')],'defaultValue':_0x43ea('0x23')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x43ea('0x24')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x43ea('0x6')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x43ea('0xf')]},'showAgentAvatar':{'type':Sequelize[_0x43ea('0x6')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x43ea('0x25');}},'notificationSound':{'type':Sequelize[_0x43ea('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x43ea('0x6')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x43ea('0x2')],'defaultValue':_0x43ea('0x26')},'waitForTheAssignedAgent':{'type':Sequelize[_0x43ea('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x43ea('0x27')},'verticalAlignment':{'type':Sequelize[_0x43ea('0xe')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x43ea('0x28')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x43ea('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0x43ea('0x6')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x43ea('0xe')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x43ea('0x2')],'allowNull':![],'defaultValue':_0x43ea('0x29'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x43ea('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x43ea('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x43ea('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x43ea('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x43ea('0x2a')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x43ea('0xe')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x43ea('0x6')],'defaultValue':![],'comment':_0x43ea('0x2b'),'set':function(_0x3f0e2a){if(!_0x3f0e2a)this[_0x43ea('0x1b')](_0x43ea('0x2c'),null);this['setDataValue'](_0x43ea('0x2d'),_0x3f0e2a);}},'vidaooEscalation':{'type':Sequelize[_0x43ea('0x6')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x43ea('0x2')]},'vidaooTopic':{'type':Sequelize[_0x43ea('0x2')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x43ea('0x2')],'defaultValue':function(){return _0x43ea('0x2e');}},'vidaooMetadata':{'type':Sequelize[_0x43ea('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x43ea('0x6')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x43ea('0xf')]}}; \ No newline at end of file +var _0xfbf4=['Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','email','#011F6A','#ffffff','BOOLEAN','rounded','Chat','Send','Contact\x20us','INTEGER','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','Comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'];(function(_0x492e7e,_0x5d6d3f){var _0x523154=function(_0x32d138){while(--_0x32d138){_0x492e7e['push'](_0x492e7e['shift']());}};_0x523154(++_0x5d6d3f);}(_0xfbf4,0x121));var _0x4fbf=function(_0x5b9ad5,_0x1b8ed6){_0x5b9ad5=_0x5b9ad5-0x0;var _0x40338e=_0xfbf4[_0x5b9ad5];return _0x40338e;};'use strict';var Sequelize=require(_0x4fbf('0x0'));var rs=require(_0x4fbf('0x1'));module['exports']={'name':{'type':Sequelize[_0x4fbf('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x4fbf('0x2')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x4fbf('0x2')]},'mapKey':{'type':Sequelize[_0x4fbf('0x2')],'defaultValue':_0x4fbf('0x3')},'mapKeyOffline':{'type':Sequelize[_0x4fbf('0x2')],'defaultValue':'email'},'key':{'type':Sequelize[_0x4fbf('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x4fbf('0x2')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x4fbf('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4fbf('0x4'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x4fbf('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x4fbf('0x2')],'allowNull':![],'defaultValue':_0x4fbf('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x4fbf('0x2')]},'animation':{'type':Sequelize[_0x4fbf('0x6')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x4fbf('0x7'),'squared'),'defaultValue':_0x4fbf('0x7')},'header_online':{'type':Sequelize['STRING'],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x4fbf('0x2')],'defaultValue':_0x4fbf('0x8')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x4fbf('0x9')},'header_offline':{'type':Sequelize[_0x4fbf('0x2')],'defaultValue':_0x4fbf('0xa')},'download_transcript':{'type':Sequelize[_0x4fbf('0x6')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x4fbf('0xb')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x4fbf('0x6')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x4fbf('0xc')]},'closingQuestion':{'type':Sequelize[_0x4fbf('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x4fbf('0x2')],'defaultValue':_0x4fbf('0xd')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x4fbf('0xe')},'noteTitle':{'type':Sequelize[_0x4fbf('0x2')],'defaultValue':_0x4fbf('0xf')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x4fbf('0x10')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x4fbf('0x11')},'closingMessageButton':{'type':Sequelize[_0x4fbf('0x2')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x4fbf('0x2')],'defaultValue':_0x4fbf('0x12')},'conditionAgreement':{'type':Sequelize[_0x4fbf('0x6')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x4fbf('0x6')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x4fbf('0x6')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x4fbf('0x6')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x4fbf('0x13')},'ratingType':{'type':Sequelize['ENUM'](_0x4fbf('0x14'),_0x4fbf('0x15')),'defaultValue':_0x4fbf('0x14')},'ratingStarsNumber':{'type':Sequelize[_0x4fbf('0xb')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x4fbf('0xc')],'defaultValue':function(){return JSON[_0x4fbf('0x16')]({'items':[{'type':_0x4fbf('0x17'),'variable':null,'config':{'placeholder':_0x4fbf('0x18'),'type':_0x4fbf('0x19'),'required':!![]},'props':{'title':_0x4fbf('0x18'),'helpText':''}},{'type':_0x4fbf('0x17'),'props':{'title':_0x4fbf('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x4fbf('0x3'),'type':_0x4fbf('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x4fbf('0x1a')](_0x4fbf('0x1b'))?JSON[_0x4fbf('0x1c')](this['getDataValue'](_0x4fbf('0x1b'))):{};},'set':function(_0x830295){return this[_0x4fbf('0x1d')]('onlineForm',JSON[_0x4fbf('0x16')](_0x830295));}},'offlineForm':{'type':Sequelize[_0x4fbf('0xc')],'defaultValue':function(){return JSON[_0x4fbf('0x16')]({'items':[{'type':_0x4fbf('0x17'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x4fbf('0x3'),'type':_0x4fbf('0x3')},'variable':null},{'type':'textarea','config':{'placeholder':_0x4fbf('0x1e')},'props':{'title':_0x4fbf('0x1e'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x4fbf('0x1a')](_0x4fbf('0x1f'))?JSON['parse'](this[_0x4fbf('0x1a')](_0x4fbf('0x1f'))):{};},'set':function(_0x27196f){return this[_0x4fbf('0x1d')](_0x4fbf('0x1f'),JSON['stringify'](_0x27196f));}},'token':{'type':Sequelize[_0x4fbf('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x4fbf('0x6')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x4fbf('0x6')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x4fbf('0x2')]},'forwardOffline':{'type':Sequelize[_0x4fbf('0x6')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x4fbf('0x20')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x4fbf('0x21')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x4fbf('0x2')],'defaultValue':_0x4fbf('0x22')},'enableUnmanagedNote':{'type':Sequelize[_0x4fbf('0x6')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x4fbf('0x2')],'defaultValue':_0x4fbf('0x23')},'skipUnmanaged':{'type':Sequelize[_0x4fbf('0x2')],'defaultValue':_0x4fbf('0x12')},'sendUnmanaged':{'type':Sequelize[_0x4fbf('0x2')],'defaultValue':_0x4fbf('0x9')},'enableCustomerAttachment':{'type':Sequelize[_0x4fbf('0x6')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x4fbf('0x6')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x4fbf('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x4fbf('0x24');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4fbf('0x6')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x4fbf('0x6')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x4fbf('0x25')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x4fbf('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x4fbf('0xb')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x4fbf('0x26')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x4fbf('0x6')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x4fbf('0xb')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x4fbf('0x2')],'allowNull':![],'defaultValue':_0x4fbf('0x27'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x4fbf('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4fbf('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4fbf('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4fbf('0xb')],'comment':_0x4fbf('0x28')},'mandatoryDisposition':{'type':Sequelize[_0x4fbf('0x6')],'defaultValue':![],'comment':_0x4fbf('0x29'),'set':function(_0x14ac36){if(!_0x14ac36)this[_0x4fbf('0x1d')](_0x4fbf('0x2a'),null);this['setDataValue'](_0x4fbf('0x2b'),_0x14ac36);}},'vidaooEscalation':{'type':Sequelize[_0x4fbf('0x6')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x4fbf('0x2')],'allowNull':![],'defaultValue':_0x4fbf('0x2c')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x4fbf('0x2d');}},'vidaooMetadata':{'type':Sequelize[_0x4fbf('0xc')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x4fbf('0xc')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 51355f2..9127adb 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 _0x03fe=['x-real-ip','connection','remoteAddress','referer','replace','alignment','color','color_button','addApplications','transaction','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','online','false','onlineForm','items','fromKey','Attachment','Attachments','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','rimraf','zip-dir','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatWebsite,\x20%s,\x20%s','result','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','ChatWebsites','destroy','end','name','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','pick','type','VIRTUAL','filter','merge','options','includeAll','include','rows','catch','show','params','Pause','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','describe','ChatWebsiteId','Disposition','findOne','sort','removeDispositions','addAnswer','CannedAnswer','order','findAll','removeAnswers','ids','sitepic','file','filename','addAvatar','agentAvatar','customerAvatar','addSystemAvatar','getLogo','join','getLicense','custom','root','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','isNil','existsSync','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','CmContact','Contacts','DESC','ChatApplication','Applications','List','account','list','orderBy','applications','priority','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','x-real-port','browser','version','%s\x20%s','unknown','format','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','forcedOwnership','Start','startRouting','EventManager','offline','CompanyId','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','server','files','attachments','offline-chat','basename','openNewInteraction','sequelize','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','pass','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','mimetype','subjectOffline','NotifyMailAccount','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','Tag','Tags','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','inspect','No\x20timezone','Interval','Intervals','getProactiveActions','virtual','License','all','some','server/files/chat/iframe.ejs','remote'];(function(_0x946d1f,_0x1cf238){var _0x546e1b=function(_0x180ea1){while(--_0x180ea1){_0x946d1f['push'](_0x946d1f['shift']());}};_0x546e1b(++_0x1cf238);}(_0x03fe,0x154));var _0xe03f=function(_0x5719dc,_0x4bab45){_0x5719dc=_0x5719dc-0x0;var _0x4349d0=_0x03fe[_0x5719dc];return _0x4349d0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe03f('0x0'));var zipdir=require(_0xe03f('0x1'));var jsonpatch=require(_0xe03f('0x2'));var rp=require(_0xe03f('0x3'));var moment=require(_0xe03f('0x4'));var BPromise=require(_0xe03f('0x5'));var Mustache=require(_0xe03f('0x6'));var util=require(_0xe03f('0x7'));var path=require(_0xe03f('0x8'));var sox=require('sox');var csv=require(_0xe03f('0x9'));var ejs=require(_0xe03f('0xa'));var fs=require('fs');var fs_extra=require(_0xe03f('0xb'));var _=require(_0xe03f('0xc'));var squel=require(_0xe03f('0xd'));var crypto=require(_0xe03f('0xe'));var jsforce=require(_0xe03f('0xf'));var deskjs=require(_0xe03f('0x10'));var toCsv=require(_0xe03f('0x9'));var querystring=require(_0xe03f('0x11'));var Papa=require(_0xe03f('0x12'));var Redis=require('ioredis');var authService=require(_0xe03f('0x13'));var qs=require(_0xe03f('0x14'));var as=require(_0xe03f('0x15'));var hardwareService=require(_0xe03f('0x16'));var logger=require('../../config/logger')(_0xe03f('0x17'));var utils=require(_0xe03f('0x18'));var config=require(_0xe03f('0x19'));var licenseUtil=require(_0xe03f('0x1a'));var db=require(_0xe03f('0x1b'))['db'];config[_0xe03f('0x1c')]=_[_0xe03f('0x1d')](config[_0xe03f('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0xe03f('0x1e'))(new Redis(config['redis']));require(_0xe03f('0x1f'))[_0xe03f('0x20')](socket);var jayson=require(_0xe03f('0x21'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xe03f('0x22')][_0xe03f('0x23')]({'port':0x232a});var client9003=jayson[_0xe03f('0x22')]['http']({'port':0x232b});var client9001=jayson[_0xe03f('0x22')][_0xe03f('0x23')]({'port':0x2329});function respondWithRpcPromise(_0xcba94c,_0x585916,_0x72b466,_0x5abdd3){return new BPromise(function(_0x2a57da,_0x4887a2){var _0x12b570=_0x5abdd3||client;return _0x12b570[_0xe03f('0x24')](_0xcba94c,_0x72b466)[_0xe03f('0x25')](function(_0x501388){logger[_0xe03f('0x26')]('ChatWebsite,\x20%s,\x20%s',_0x585916,_0xe03f('0x27'));logger[_0xe03f('0x28')](_0xe03f('0x29'),_0x585916,'request\x20sent',JSON[_0xe03f('0x2a')](_0x501388));if(_0x501388[_0xe03f('0x2b')]){if(_0x501388[_0xe03f('0x2b')][_0xe03f('0x2c')]===0x1f4){logger[_0xe03f('0x2b')]('ChatWebsite,\x20%s,\x20%s',_0x585916,_0x501388[_0xe03f('0x2b')]['message']);return _0x4887a2(_0x501388['error'][_0xe03f('0x2d')]);}logger['error'](_0xe03f('0x2e'),_0x585916,_0x501388[_0xe03f('0x2b')][_0xe03f('0x2d')]);return _0x2a57da(_0x501388[_0xe03f('0x2b')][_0xe03f('0x2d')]);}else{logger[_0xe03f('0x26')](_0xe03f('0x2e'),_0x585916,_0xe03f('0x27'));_0x2a57da(_0x501388[_0xe03f('0x2f')][_0xe03f('0x2d')]);}})['catch'](function(_0x468dae){logger['error'](_0xe03f('0x2e'),_0x585916,_0x468dae);_0x4887a2(_0x468dae);});});}function respondWithStatusCode(_0x3eb2b8,_0x1efbe9){_0x1efbe9=_0x1efbe9||0xcc;return function(_0x1cea86){if(_0x1cea86){return _0x3eb2b8[_0xe03f('0x30')](_0x1efbe9);}return _0x3eb2b8[_0xe03f('0x31')](_0x1efbe9)['end']();};}function respondWithResult(_0x36f881,_0x108f6b){_0x108f6b=_0x108f6b||0xc8;return function(_0x378d71){if(_0x378d71){return _0x36f881[_0xe03f('0x31')](_0x108f6b)[_0xe03f('0x32')](_0x378d71);}};}function respondWithFilteredResult(_0xd6413,_0x2fdfd8){return function(_0x25af93){if(_0x25af93){var _0x3a9190=typeof _0x2fdfd8[_0xe03f('0x33')]===_0xe03f('0x34')&&typeof _0x2fdfd8[_0xe03f('0x35')]===_0xe03f('0x34');var _0x106925=_0x25af93[_0xe03f('0x36')];var _0x191a41=_0x3a9190?0x0:_0x2fdfd8['offset'];var _0x553bf3=_0x3a9190?_0x25af93[_0xe03f('0x36')]:_0x2fdfd8[_0xe03f('0x33')]+_0x2fdfd8['limit'];var _0x20d324;if(_0x553bf3>=_0x106925){_0x553bf3=_0x106925;_0x20d324=0xc8;}else{_0x20d324=0xce;}_0xd6413[_0xe03f('0x31')](_0x20d324);return _0xd6413[_0xe03f('0x37')](_0xe03f('0x38'),_0x191a41+'-'+_0x553bf3+'/'+_0x106925)[_0xe03f('0x32')](_0x25af93);}return null;};}function patchUpdates(_0x48b5ad){return function(_0x3fe2c2){try{jsonpatch[_0xe03f('0x39')](_0x3fe2c2,_0x48b5ad,!![]);}catch(_0x355ff5){return BPromise['reject'](_0x355ff5);}return _0x3fe2c2[_0xe03f('0x3a')]();};}function saveUpdates(_0x3b616f,_0x3ca58f){return function(_0x573c8e){if(_0x573c8e){return _0x573c8e[_0xe03f('0x3b')](_0x3b616f)[_0xe03f('0x25')](function(_0x1e9849){return _0x1e9849;});}return null;};}function removeEntity(_0x1f21f3,_0x19fc7d){return function(_0x2edbb3){if(_0x2edbb3){return _0x2edbb3['destroy']()[_0xe03f('0x25')](function(){var _0x182050=_0x2edbb3['get']({'plain':!![]});var _0x1329b9=_0xe03f('0x3c');return db['UserProfileResource'][_0xe03f('0x3d')]({'where':{'type':_0x1329b9,'resourceId':_0x182050['id']}})['then'](function(){return _0x2edbb3;});})['then'](function(){_0x1f21f3[_0xe03f('0x31')](0xcc)[_0xe03f('0x3e')]();});}};}function handleEntityNotFound(_0x168b80,_0x4c49ce){return function(_0x37b6cf){if(!_0x37b6cf){_0x168b80[_0xe03f('0x30')](0x194);}return _0x37b6cf;};}function handleError(_0x1fc0c3,_0xb90aa3){_0xb90aa3=_0xb90aa3||0x1f4;return function(_0x285074){logger['error'](_0x285074['stack']);if(_0x285074['name']){delete _0x285074[_0xe03f('0x3f')];}_0x1fc0c3[_0xe03f('0x31')](_0xb90aa3)['send'](_0x285074);};}exports[_0xe03f('0x40')]=function(_0x85e20f,_0x468e3a){var _0x1b484b={'include':[{'model':db['Pause'],'as':_0xe03f('0x41')}]},_0x558fa2={},_0x23ca5a={'count':0x0,'rows':[]};var _0x5abd60=_[_0xe03f('0x42')](db[_0xe03f('0x43')][_0xe03f('0x44')],function(_0x33fd70){return{'name':_0x33fd70[_0xe03f('0x45')],'type':_0x33fd70['type'][_0xe03f('0x46')]};});_0x558fa2[_0xe03f('0x47')]=_[_0xe03f('0x42')](_0x5abd60,_0xe03f('0x3f'));_0x558fa2['query']=_['keys'](_0x85e20f[_0xe03f('0x48')]);_0x558fa2[_0xe03f('0x49')]=_[_0xe03f('0x4a')](_0x558fa2[_0xe03f('0x47')],_0x558fa2[_0xe03f('0x48')]);_0x1b484b[_0xe03f('0x4b')]=_['intersection'](_0x558fa2[_0xe03f('0x47')],qs[_0xe03f('0x4c')](_0x85e20f[_0xe03f('0x48')][_0xe03f('0x4c')]));_0x1b484b['attributes']=_0x1b484b[_0xe03f('0x4b')][_0xe03f('0x4d')]?_0x1b484b['attributes']:_0x558fa2['model'];if(!_0x85e20f['query'][_0xe03f('0x4e')](_0xe03f('0x4f'))){_0x1b484b[_0xe03f('0x35')]=qs['limit'](_0x85e20f['query']['limit']);_0x1b484b['offset']=qs['offset'](_0x85e20f[_0xe03f('0x48')][_0xe03f('0x33')]);}_0x1b484b['order']=qs['sort'](_0x85e20f['query']['sort']);_0x1b484b[_0xe03f('0x50')]=qs[_0xe03f('0x49')](_[_0xe03f('0x51')](_0x85e20f[_0xe03f('0x48')],_0x558fa2[_0xe03f('0x49')]),_0x5abd60);if(_0x85e20f[_0xe03f('0x48')]['filter']){_0x1b484b['where']=_['merge'](_0x1b484b[_0xe03f('0x50')],{'$or':_[_0xe03f('0x42')](_0x5abd60,function(_0x4888ef){if(_0x4888ef[_0xe03f('0x52')]!==_0xe03f('0x53')){var _0x6b4dca={};_0x6b4dca[_0x4888ef[_0xe03f('0x3f')]]={'$like':'%'+_0x85e20f[_0xe03f('0x48')][_0xe03f('0x54')]+'%'};return _0x6b4dca;}})});}_0x1b484b=_[_0xe03f('0x55')]({},_0x1b484b,_0x85e20f[_0xe03f('0x56')]);var _0xeee97c={'where':_0x1b484b[_0xe03f('0x50')]};return db[_0xe03f('0x43')][_0xe03f('0x36')](_0xeee97c)['then'](function(_0x52e9cd){_0x23ca5a[_0xe03f('0x36')]=_0x52e9cd;if(_0x85e20f[_0xe03f('0x48')][_0xe03f('0x57')]){_0x1b484b[_0xe03f('0x58')]=[{'all':!![]}];}return db[_0xe03f('0x43')]['findAll'](_0x1b484b);})[_0xe03f('0x25')](function(_0x5ae653){_0x23ca5a[_0xe03f('0x59')]=_0x5ae653;return _0x23ca5a;})[_0xe03f('0x25')](respondWithFilteredResult(_0x468e3a,_0x1b484b))[_0xe03f('0x5a')](handleError(_0x468e3a,null));};exports[_0xe03f('0x5b')]=function(_0x1d6e7f,_0x4d974c){var _0x11d486={'raw':![],'where':{'id':_0x1d6e7f[_0xe03f('0x5c')]['id']},'include':[{'model':db[_0xe03f('0x5d')],'as':'mandatoryDispositionPause'}]},_0x15d53b={};_0x15d53b[_0xe03f('0x47')]=_[_0xe03f('0x5e')](db[_0xe03f('0x43')][_0xe03f('0x44')]);_0x15d53b[_0xe03f('0x48')]=_[_0xe03f('0x5e')](_0x1d6e7f['query']);_0x15d53b[_0xe03f('0x49')]=_[_0xe03f('0x4a')](_0x15d53b[_0xe03f('0x47')],_0x15d53b[_0xe03f('0x48')]);_0x11d486[_0xe03f('0x4b')]=_[_0xe03f('0x4a')](_0x15d53b[_0xe03f('0x47')],qs['fields'](_0x1d6e7f[_0xe03f('0x48')]['fields']));_0x11d486[_0xe03f('0x4b')]=_0x11d486[_0xe03f('0x4b')][_0xe03f('0x4d')]?_0x11d486[_0xe03f('0x4b')]:_0x15d53b['model'];if(_0x1d6e7f['query'][_0xe03f('0x57')]){_0x11d486[_0xe03f('0x58')]=[{'all':!![]}];}_0x11d486=_[_0xe03f('0x55')]({},_0x11d486,_0x1d6e7f[_0xe03f('0x56')]);return db['ChatWebsite'][_0xe03f('0x5f')](_0x11d486)['then'](handleEntityNotFound(_0x4d974c,null))[_0xe03f('0x25')](respondWithResult(_0x4d974c,null))['catch'](handleError(_0x4d974c,null));};exports[_0xe03f('0x60')]=function(_0xa19092,_0x3370e9){return db[_0xe03f('0x43')][_0xe03f('0x60')](_0xa19092[_0xe03f('0x61')],{})[_0xe03f('0x25')](function(_0x91863f){var _0x96d233=_0xa19092[_0xe03f('0x62')][_0xe03f('0x63')]({'plain':!![]});if(!_0x96d233)throw new Error(_0xe03f('0x64'));if(_0x96d233[_0xe03f('0x65')]===_0xe03f('0x62')){var _0x2b6035=_0x91863f['get']({'plain':!![]});var _0x13e843=_0xe03f('0x3c');return db[_0xe03f('0x66')][_0xe03f('0x5f')]({'where':{'name':_0x13e843,'userProfileId':_0x96d233['userProfileId']},'raw':!![]})[_0xe03f('0x25')](function(_0x438f05){if(_0x438f05&&_0x438f05[_0xe03f('0x67')]===0x0){return db[_0xe03f('0x68')]['create']({'name':_0x2b6035[_0xe03f('0x3f')],'resourceId':_0x2b6035['id'],'type':_0x438f05[_0xe03f('0x3f')],'sectionId':_0x438f05['id']},{})['then'](function(){return _0x91863f;});}else{return _0x91863f;}})['catch'](function(_0x131d29){logger[_0xe03f('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x131d29);throw _0x131d29;});}return _0x91863f;})['then'](respondWithResult(_0x3370e9,0xc9))[_0xe03f('0x5a')](handleError(_0x3370e9,null));};exports['update']=function(_0x3eba41,_0x35b6dd){if(_0x3eba41[_0xe03f('0x61')]['id']){delete _0x3eba41[_0xe03f('0x61')]['id'];}return db['ChatWebsite'][_0xe03f('0x5f')]({'where':{'id':_0x3eba41[_0xe03f('0x5c')]['id']},'include':[{'model':db[_0xe03f('0x5d')],'as':_0xe03f('0x41')}]})['then'](handleEntityNotFound(_0x35b6dd,null))[_0xe03f('0x25')](saveUpdates(_0x3eba41[_0xe03f('0x61')],null))[_0xe03f('0x25')](respondWithResult(_0x35b6dd,null))[_0xe03f('0x5a')](handleError(_0x35b6dd,null));};exports[_0xe03f('0x3d')]=function(_0x5dcb1c,_0x5d2e8e){return db[_0xe03f('0x43')]['find']({'where':{'id':_0x5dcb1c[_0xe03f('0x5c')]['id']}})[_0xe03f('0x25')](handleEntityNotFound(_0x5d2e8e,null))[_0xe03f('0x25')](removeEntity(_0x5d2e8e,null))['catch'](handleError(_0x5d2e8e,null));};exports[_0xe03f('0x69')]=function(_0x2266af,_0x216f3a){return db['ChatWebsite']['describe']()[_0xe03f('0x25')](respondWithResult(_0x216f3a,null))['catch'](handleError(_0x216f3a,null));};exports['addDisposition']=function(_0x5b93c8,_0x374f9a,_0x395d89){if(_0x5b93c8[_0xe03f('0x61')]['id']){delete _0x5b93c8[_0xe03f('0x61')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x5b93c8['params']['id']}})['then'](handleEntityNotFound(_0x374f9a,null))[_0xe03f('0x25')](function(_0x289099){if(_0x289099){_0x5b93c8[_0xe03f('0x61')][_0xe03f('0x6a')]=_0x289099['id'];return db[_0xe03f('0x6b')][_0xe03f('0x60')](_0x5b93c8[_0xe03f('0x61')]);}})[_0xe03f('0x25')](respondWithResult(_0x374f9a,null))['catch'](handleError(_0x374f9a,null));};exports['getDispositions']=function(_0x4dd18d,_0x4ea623,_0x347ed8){var _0x59f28c={'raw':![],'where':{}};var _0xd0f594={};var _0x3b66ff={'count':0x0,'rows':[]};return db[_0xe03f('0x43')][_0xe03f('0x6c')]({'where':{'id':_0x4dd18d['params']['id']}})[_0xe03f('0x25')](handleEntityNotFound(_0x4ea623,null))[_0xe03f('0x25')](function(_0x2dc9ed){if(_0x2dc9ed){_0xd0f594['model']=_['keys'](db[_0xe03f('0x6b')]['rawAttributes']);_0xd0f594[_0xe03f('0x48')]=_[_0xe03f('0x5e')](_0x4dd18d[_0xe03f('0x48')]);_0xd0f594[_0xe03f('0x49')]=_['intersection'](_0xd0f594['model'],_0xd0f594[_0xe03f('0x48')]);_0x59f28c[_0xe03f('0x4b')]=_[_0xe03f('0x4a')](_0xd0f594[_0xe03f('0x47')],qs[_0xe03f('0x4c')](_0x4dd18d[_0xe03f('0x48')]['fields']));_0x59f28c[_0xe03f('0x4b')]=_0x59f28c['attributes'][_0xe03f('0x4d')]?_0x59f28c['attributes']:_0xd0f594[_0xe03f('0x47')];if(!_0x4dd18d[_0xe03f('0x48')][_0xe03f('0x4e')](_0xe03f('0x4f'))){_0x59f28c[_0xe03f('0x35')]=qs[_0xe03f('0x35')](_0x4dd18d[_0xe03f('0x48')][_0xe03f('0x35')]);_0x59f28c[_0xe03f('0x33')]=qs[_0xe03f('0x33')](_0x4dd18d[_0xe03f('0x48')][_0xe03f('0x33')]);}_0x59f28c['order']=qs[_0xe03f('0x6d')](_0x4dd18d['query']['sort']);_0x59f28c[_0xe03f('0x50')]=qs['filters'](_[_0xe03f('0x51')](_0x4dd18d[_0xe03f('0x48')],_0xd0f594[_0xe03f('0x49')]));_0x59f28c[_0xe03f('0x50')][_0xe03f('0x6a')]=_0x2dc9ed['id'];if(_0x4dd18d[_0xe03f('0x48')][_0xe03f('0x54')]){_0x59f28c[_0xe03f('0x50')]=_[_0xe03f('0x55')](_0x59f28c[_0xe03f('0x50')],{'$or':_[_0xe03f('0x42')](_0x59f28c[_0xe03f('0x4b')],function(_0x2eb9db){var _0x510437={};_0x510437[_0x2eb9db]={'$like':'%'+_0x4dd18d[_0xe03f('0x48')][_0xe03f('0x54')]+'%'};return _0x510437;})});}_0x59f28c=_['merge']({},_0x59f28c,_0x4dd18d[_0xe03f('0x56')]);return db['Disposition'][_0xe03f('0x36')]({'where':_0x59f28c[_0xe03f('0x50')]})[_0xe03f('0x25')](function(_0x2ad7ee){_0x3b66ff['count']=_0x2ad7ee;if(_0x4dd18d[_0xe03f('0x48')][_0xe03f('0x57')]){_0x59f28c['include']=[{'all':!![]}];}return db[_0xe03f('0x6b')]['findAll'](_0x59f28c);})['then'](function(_0x2fef60){_0x3b66ff[_0xe03f('0x59')]=_0x2fef60;return _0x3b66ff;});}})[_0xe03f('0x25')](respondWithFilteredResult(_0x4ea623,_0x59f28c))['catch'](handleError(_0x4ea623,null));};exports[_0xe03f('0x6e')]=function(_0x44f703,_0x13b774,_0x2dd2b2){return db[_0xe03f('0x43')][_0xe03f('0x5f')]({'where':{'id':_0x44f703[_0xe03f('0x5c')]['id']}})['then'](handleEntityNotFound(_0x13b774,null))[_0xe03f('0x25')](function(_0x4dfafa){if(_0x4dfafa){return _0x4dfafa['removeDispositions'](_0x44f703['query']['ids']);}})[_0xe03f('0x25')](respondWithStatusCode(_0x13b774,null))[_0xe03f('0x5a')](handleError(_0x13b774,null));};exports[_0xe03f('0x6f')]=function(_0x22ec7e,_0x390055,_0x5de7d4){if(_0x22ec7e[_0xe03f('0x61')]['id']){delete _0x22ec7e[_0xe03f('0x61')]['id'];}return db['ChatWebsite'][_0xe03f('0x5f')]({'where':{'id':_0x22ec7e['params']['id']}})[_0xe03f('0x25')](handleEntityNotFound(_0x390055,null))[_0xe03f('0x25')](function(_0x13d928){if(_0x13d928){_0x22ec7e[_0xe03f('0x61')][_0xe03f('0x6a')]=_0x13d928['id'];return db[_0xe03f('0x70')][_0xe03f('0x60')](_0x22ec7e[_0xe03f('0x61')]);}})[_0xe03f('0x25')](respondWithResult(_0x390055,null))[_0xe03f('0x5a')](handleError(_0x390055,null));};exports['getAnswers']=function(_0x5c1cbd,_0x22a4e2,_0x2ac303){var _0x9cb54b={'raw':![],'where':{}};var _0x2a22d2={};var _0x59a8df={'count':0x0,'rows':[]};return db[_0xe03f('0x43')]['findOne']({'where':{'id':_0x5c1cbd[_0xe03f('0x5c')]['id']}})[_0xe03f('0x25')](handleEntityNotFound(_0x22a4e2,null))[_0xe03f('0x25')](function(_0x167295){if(_0x167295){_0x2a22d2[_0xe03f('0x47')]=_[_0xe03f('0x5e')](db[_0xe03f('0x70')][_0xe03f('0x44')]);_0x2a22d2[_0xe03f('0x48')]=_['keys'](_0x5c1cbd[_0xe03f('0x48')]);_0x2a22d2[_0xe03f('0x49')]=_[_0xe03f('0x4a')](_0x2a22d2[_0xe03f('0x47')],_0x2a22d2[_0xe03f('0x48')]);_0x9cb54b[_0xe03f('0x4b')]=_['intersection'](_0x2a22d2[_0xe03f('0x47')],qs[_0xe03f('0x4c')](_0x5c1cbd[_0xe03f('0x48')][_0xe03f('0x4c')]));_0x9cb54b[_0xe03f('0x4b')]=_0x9cb54b[_0xe03f('0x4b')]['length']?_0x9cb54b[_0xe03f('0x4b')]:_0x2a22d2[_0xe03f('0x47')];if(!_0x5c1cbd['query'][_0xe03f('0x4e')]('nolimit')){_0x9cb54b['limit']=qs['limit'](_0x5c1cbd['query'][_0xe03f('0x35')]);_0x9cb54b['offset']=qs['offset'](_0x5c1cbd[_0xe03f('0x48')][_0xe03f('0x33')]);}_0x9cb54b[_0xe03f('0x71')]=qs['sort'](_0x5c1cbd[_0xe03f('0x48')][_0xe03f('0x6d')]);_0x9cb54b[_0xe03f('0x50')]=qs[_0xe03f('0x49')](_[_0xe03f('0x51')](_0x5c1cbd[_0xe03f('0x48')],_0x2a22d2[_0xe03f('0x49')]));_0x9cb54b['where'][_0xe03f('0x6a')]=_0x167295['id'];if(_0x5c1cbd[_0xe03f('0x48')][_0xe03f('0x54')]){_0x9cb54b['where']=_[_0xe03f('0x55')](_0x9cb54b[_0xe03f('0x50')],{'$or':_['map'](_0x9cb54b[_0xe03f('0x4b')],function(_0x5190a2){var _0x3b790b={};_0x3b790b[_0x5190a2]={'$like':'%'+_0x5c1cbd[_0xe03f('0x48')][_0xe03f('0x54')]+'%'};return _0x3b790b;})});}_0x9cb54b=_['merge']({},_0x9cb54b,_0x5c1cbd['options']);return db[_0xe03f('0x70')][_0xe03f('0x36')]({'where':_0x9cb54b[_0xe03f('0x50')]})[_0xe03f('0x25')](function(_0x19c83a){_0x59a8df[_0xe03f('0x36')]=_0x19c83a;if(_0x5c1cbd[_0xe03f('0x48')][_0xe03f('0x57')]){_0x9cb54b['include']=[{'all':!![]}];}return db[_0xe03f('0x70')][_0xe03f('0x72')](_0x9cb54b);})[_0xe03f('0x25')](function(_0x489e58){_0x59a8df['rows']=_0x489e58;return _0x59a8df;});}})[_0xe03f('0x25')](respondWithFilteredResult(_0x22a4e2,_0x9cb54b))[_0xe03f('0x5a')](handleError(_0x22a4e2,null));};exports[_0xe03f('0x73')]=function(_0x35ad8c,_0x1d5bc1,_0x4ddf71){return db[_0xe03f('0x43')][_0xe03f('0x5f')]({'where':{'id':_0x35ad8c['params']['id']}})[_0xe03f('0x25')](handleEntityNotFound(_0x1d5bc1,null))[_0xe03f('0x25')](function(_0xbcc8b7){if(_0xbcc8b7){return _0xbcc8b7[_0xe03f('0x73')](_0x35ad8c[_0xe03f('0x48')][_0xe03f('0x74')]);}})[_0xe03f('0x25')](respondWithStatusCode(_0x1d5bc1,null))[_0xe03f('0x5a')](handleError(_0x1d5bc1,null));};exports['addLogo']=function(_0x22922b,_0x49ff47,_0x28368d){_0x22922b[_0xe03f('0x61')][_0xe03f('0x75')]=_0x22922b[_0xe03f('0x76')][_0xe03f('0x77')];return db[_0xe03f('0x43')][_0xe03f('0x5f')]({'where':{'id':_0x22922b[_0xe03f('0x5c')]['id']}})[_0xe03f('0x25')](handleEntityNotFound(_0x49ff47,null))[_0xe03f('0x25')](saveUpdates(_0x22922b[_0xe03f('0x61')],null))['then'](respondWithResult(_0x49ff47,null))[_0xe03f('0x5a')](handleError(_0x49ff47,null));};exports[_0xe03f('0x78')]=function(_0x32e65b,_0x3067c1,_0x27e38b){_0x32e65b[_0xe03f('0x61')][_0xe03f('0x79')]=_0x32e65b['file'][_0xe03f('0x77')];return db['ChatWebsite'][_0xe03f('0x5f')]({'where':{'id':_0x32e65b[_0xe03f('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3067c1,null))[_0xe03f('0x25')](saveUpdates(_0x32e65b['body'],null))['then'](respondWithResult(_0x3067c1,null))[_0xe03f('0x5a')](handleError(_0x3067c1,null));};exports['addCustomerAvatar']=function(_0x299295,_0x35acd1,_0x1202ca){_0x299295[_0xe03f('0x61')][_0xe03f('0x7a')]=_0x299295[_0xe03f('0x76')][_0xe03f('0x77')];return db[_0xe03f('0x43')][_0xe03f('0x5f')]({'where':{'id':_0x299295[_0xe03f('0x5c')]['id']}})['then'](handleEntityNotFound(_0x35acd1,null))['then'](saveUpdates(_0x299295[_0xe03f('0x61')],null))[_0xe03f('0x25')](respondWithResult(_0x35acd1,null))[_0xe03f('0x5a')](handleError(_0x35acd1,null));};exports[_0xe03f('0x7b')]=function(_0x1b076b,_0x1ed334,_0x462432){_0x1b076b[_0xe03f('0x61')]['systemAvatar']=_0x1b076b[_0xe03f('0x76')][_0xe03f('0x77')];return db['ChatWebsite']['find']({'where':{'id':_0x1b076b[_0xe03f('0x5c')]['id']}})[_0xe03f('0x25')](handleEntityNotFound(_0x1ed334,null))[_0xe03f('0x25')](saveUpdates(_0x1b076b[_0xe03f('0x61')],null))[_0xe03f('0x25')](respondWithResult(_0x1ed334,null))[_0xe03f('0x5a')](handleError(_0x1ed334,null));};exports[_0xe03f('0x7c')]=function(_0x47695c,_0x1df6ca,_0x58fdbc){var _0x2d76a5=path[_0xe03f('0x7d')](config['root'],'server/files/images/logos/default_logo.svg');var _0x3e2115={'where':{'id':_0x47695c[_0xe03f('0x5c')]['id']},'attributes':['id',_0xe03f('0x75')],'raw':!![]};var _0x192ba4=![];return require(_0xe03f('0x1a'))[_0xe03f('0x7e')]()['then'](function(_0x5c188d){if(_0x5c188d){_0x192ba4=_0x5c188d[_0xe03f('0x7f')];}})[_0xe03f('0x25')](function(){return db[_0xe03f('0x43')][_0xe03f('0x5f')](_0x3e2115);})['then'](handleEntityNotFound(_0x1df6ca,null))[_0xe03f('0x25')](function(_0x305581){if(_0x305581){if(!_['isNil'](_0x305581[_0xe03f('0x75')])){if(fs['existsSync'](path[_0xe03f('0x7d')](config[_0xe03f('0x80')],_0xe03f('0x81'),_0x305581[_0xe03f('0x75')]))&&_0x192ba4){_0x2d76a5=path[_0xe03f('0x7d')](config['root'],_0xe03f('0x81'),_0x305581[_0xe03f('0x75')]);}}return _0x1df6ca[_0xe03f('0x82')](_0x2d76a5);}})[_0xe03f('0x5a')](handleError(_0x1df6ca,null));};exports['getAvatar']=function(_0x32b902,_0x147df1,_0x2dccee){var _0xb9839f=path[_0xe03f('0x7d')](config[_0xe03f('0x80')],_0xe03f('0x83'));var _0x1fcb96={'where':{'id':_0x32b902['params']['id']},'attributes':['id',_0xe03f('0x79')],'raw':!![]};return db['ChatWebsite'][_0xe03f('0x5f')](_0x1fcb96)[_0xe03f('0x25')](handleEntityNotFound(_0x147df1,null))[_0xe03f('0x25')](function(_0x4995bc){if(_0x4995bc){if(!_[_0xe03f('0x84')](_0x4995bc['agentAvatar'])){if(fs[_0xe03f('0x85')](path[_0xe03f('0x7d')](config[_0xe03f('0x80')],'server/files/images/avatars/',_0x4995bc['agentAvatar']))){_0xb9839f=path['join'](config[_0xe03f('0x80')],'server/files/images/avatars/',_0x4995bc[_0xe03f('0x79')]);}}return _0x147df1[_0xe03f('0x82')](_0xb9839f);}})[_0xe03f('0x5a')](handleError(_0x147df1,null));};exports[_0xe03f('0x86')]=function(_0x22d3b3,_0x8acddb,_0x5729cd){var _0x1d94ba=path['join'](config[_0xe03f('0x80')],_0xe03f('0x87'));var _0x3ece64={'where':{'id':_0x22d3b3[_0xe03f('0x5c')]['id']},'attributes':['id','customerAvatar',_0xe03f('0x88')],'raw':!![]};return db[_0xe03f('0x43')]['find'](_0x3ece64)[_0xe03f('0x25')](handleEntityNotFound(_0x8acddb,null))[_0xe03f('0x25')](function(_0x5ee5a4){if(_0x5ee5a4){if(!_[_0xe03f('0x84')](_0x5ee5a4[_0xe03f('0x7a')])){if(fs[_0xe03f('0x85')](path[_0xe03f('0x7d')](config[_0xe03f('0x80')],_0xe03f('0x89'),_0x5ee5a4[_0xe03f('0x7a')]))&&_0x5ee5a4[_0xe03f('0x88')]){_0x1d94ba=path['join'](config[_0xe03f('0x80')],_0xe03f('0x89'),_0x5ee5a4['customerAvatar']);}}return _0x8acddb[_0xe03f('0x82')](_0x1d94ba);}})[_0xe03f('0x5a')](handleError(_0x8acddb,null));};exports[_0xe03f('0x8a')]=function(_0x4c703e,_0x54855d,_0x380e39){var _0x2af139=path[_0xe03f('0x7d')](config['root'],_0xe03f('0x8b'));var _0x41a4eb={'where':{'id':_0x4c703e[_0xe03f('0x5c')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xe03f('0x43')][_0xe03f('0x5f')](_0x41a4eb)['then'](handleEntityNotFound(_0x54855d,null))[_0xe03f('0x25')](function(_0x3ebfc4){if(_0x3ebfc4){if(!_[_0xe03f('0x84')](_0x3ebfc4[_0xe03f('0x8c')])){if(fs['existsSync'](path[_0xe03f('0x7d')](config[_0xe03f('0x80')],_0xe03f('0x89'),_0x3ebfc4['systemAvatar']))){_0x2af139=path['join'](config['root'],_0xe03f('0x89'),_0x3ebfc4['systemAvatar']);}}return _0x54855d['download'](_0x2af139);}})[_0xe03f('0x5a')](handleError(_0x54855d,null));};exports[_0xe03f('0x8d')]=function(_0x26efd1,_0x78f64b,_0x2cf515){var _0x32c47c=require(_0xe03f('0x8e'));var _0x8e3598=new _0x32c47c();var _0x1a6b09=_0x8e3598[_0xe03f('0x8f')](_0x26efd1[_0xe03f('0x90')][_0xe03f('0x91')])[_0xe03f('0x92')]();var _0x42776c={'body':_0x26efd1[_0xe03f('0x61')],'channel':_0xe03f('0x93')};var _0x3f1083=[];var _0x296f98=[];var _0x565643={};var _0x7616f5=![];return db['CmContact']['describe']()[_0xe03f('0x25')](function(_0x4d6db2){if(!_0x4d6db2){throw new db[(_0xe03f('0x94'))][(_0xe03f('0x95'))](_0xe03f('0x96'));}_0x3f1083=_[_0xe03f('0x97')](_['keys'](_0x4d6db2),[_0xe03f('0x98'),_0xe03f('0x99')]);_0x296f98=_[_0xe03f('0x97')](_[_0xe03f('0x5e')](_0x4d6db2),['createdAt','updatedAt','CompanyId',_0xe03f('0x9a')]);if(_0x26efd1[_0xe03f('0x61')]['id']){delete _0x26efd1[_0xe03f('0x61')]['id'];}if(_[_0xe03f('0x84')](_0x26efd1[_0xe03f('0x61')]['from'])){throw new db['Sequelize'][(_0xe03f('0x95'))](_0xe03f('0x9b'));}if(_[_0xe03f('0x84')](_0x26efd1[_0xe03f('0x61')]['body'])||_0x26efd1[_0xe03f('0x61')][_0xe03f('0x61')]===''){throw new db[(_0xe03f('0x94'))][(_0xe03f('0x95'))](_0xe03f('0x9c'));}if(_[_0xe03f('0x84')](_0x26efd1[_0xe03f('0x61')][_0xe03f('0x9d')])){throw new db[(_0xe03f('0x94'))][(_0xe03f('0x95'))](_0xe03f('0x9e')+_0x296f98);}if(!_[_0xe03f('0x9f')](_0x296f98,_0x26efd1['body'][_0xe03f('0x9d')])){throw new db[(_0xe03f('0x94'))][(_0xe03f('0x95'))](_0xe03f('0xa0')+_0x296f98);}_0x565643[_0x26efd1[_0xe03f('0x61')]['mapKey']]=_0x26efd1[_0xe03f('0x61')][_0xe03f('0xa1')];})['then'](function(){return db[_0xe03f('0x43')][_0xe03f('0x5f')]({'where':{'id':_0x26efd1['params']['id']},'include':[{'model':db[_0xe03f('0xa2')],'as':'List','include':[{'model':db[_0xe03f('0xa3')],'as':_0xe03f('0xa4'),'where':_0x565643,'limit':0x1,'order':[[_0xe03f('0x99'),_0xe03f('0xa5')]]}]},{'model':db[_0xe03f('0xa6')],'as':_0xe03f('0xa7')}]});})[_0xe03f('0x25')](handleEntityNotFound(_0x78f64b,null))[_0xe03f('0x25')](function(_0x109d13){if(_0x109d13&&_0x109d13[_0xe03f('0xa8')]){_0x42776c[_0xe03f('0xa9')]=_0x109d13;_0x42776c['applications']=_0x109d13[_0xe03f('0xa7')];_0x42776c[_0xe03f('0xaa')]=_0x109d13[_0xe03f('0xa8')];_0x42776c['applications']=_[_0xe03f('0xab')](_0x42776c[_0xe03f('0xac')],[_0xe03f('0xad')],['asc']);if(_0x42776c['account']['Applications']){delete _0x42776c['account'][_0xe03f('0xa7')];}if(_0x42776c[_0xe03f('0xa9')][_0xe03f('0xa8')]&&_0x42776c['account']['List'][_0xe03f('0xa4')][_0xe03f('0x4d')]){return _0x42776c['account'][_0xe03f('0xa8')][_0xe03f('0xa4')][0x0];}var _0x24e495=_[_0xe03f('0x1d')](_0x26efd1[_0xe03f('0x61')],{'firstName':_0x26efd1[_0xe03f('0x61')][_0xe03f('0xa1')],'ListId':_0x109d13['ListId']});_0x24e495[_0x26efd1[_0xe03f('0x61')][_0xe03f('0x9d')]]=_0x26efd1[_0xe03f('0x61')][_0xe03f('0xa1')];return db[_0xe03f('0xa3')][_0xe03f('0x60')](_0x24e495,{'fields':_0x3f1083,'raw':!![]});}})[_0xe03f('0x25')](handleEntityNotFound(_0x78f64b,null))[_0xe03f('0x25')](function(_0x17e3a2){_0x42776c[_0xe03f('0xae')]=_0x17e3a2;var _0x4fa634=_0x26efd1[_0xe03f('0x61')][_0xe03f('0xaf')];if(_0x26efd1[_0xe03f('0x90')][_0xe03f('0xb0')]){_0x4fa634=_0x26efd1[_0xe03f('0x90')][_0xe03f('0xb0')];}else if(_0x26efd1[_0xe03f('0x90')]['x-forwarded-for']){_0x4fa634=_[_0xe03f('0xb1')](_0x26efd1['headers'][_0xe03f('0xb2')][_0xe03f('0xb3')](','));}if(_0x17e3a2){var _0x217f05={'ContactId':_0x17e3a2['id'],'ChatWebsiteId':_0x26efd1[_0xe03f('0x5c')]['id'],'from':(_0x17e3a2[_0xe03f('0xb4')]||'')+'\x20'+(_0x17e3a2[_0xe03f('0xb5')]||''),'customerIp':_0x4fa634,'customerPort':_0x26efd1[_0xe03f('0x90')][_0xe03f('0xb6')]?_0x26efd1[_0xe03f('0x90')]['x-real-port']:null,'referer':_0x26efd1['body']['referer'],'browserName':_0x1a6b09['browser'][_0xe03f('0x3f')]&&_0x1a6b09[_0xe03f('0xb7')][_0xe03f('0xb8')]?util['format'](_0xe03f('0xb9'),_0x1a6b09[_0xe03f('0xb7')][_0xe03f('0x3f')],_0x1a6b09['browser'][_0xe03f('0xb8')]):'unknown','browserVersion':_0x1a6b09['browser'][_0xe03f('0xb8')]||_0xe03f('0xba'),'osName':util[_0xe03f('0xbb')](_0xe03f('0xb9'),_0x1a6b09['os'][_0xe03f('0x3f')],_0x1a6b09['os']['version']),'osVersion':_0x1a6b09['os'][_0xe03f('0xb8')],'deviceModel':_0x1a6b09['device'][_0xe03f('0x47')]&&_0x1a6b09[_0xe03f('0xbc')][_0xe03f('0xbd')]?util[_0xe03f('0xbb')](_0xe03f('0xbe'),_0x1a6b09['device'][_0xe03f('0x47')],_0x1a6b09[_0xe03f('0xbc')]['vendor'],_0x1a6b09[_0xe03f('0xbc')]['type']):null,'deviceVendor':_0x1a6b09['device'][_0xe03f('0xbd')],'deviceType':_0x1a6b09[_0xe03f('0xbc')][_0xe03f('0x52')],'formData':JSON[_0xe03f('0x2a')](_0x26efd1['body'])};var _0x1cfbba={'ChatWebsiteId':_0x26efd1[_0xe03f('0x5c')]['id'],'closed':![]};if(_0x26efd1[_0xe03f('0x61')][_0xe03f('0xbf')]){_0x1cfbba[_0xe03f('0xbf')]=_0x26efd1[_0xe03f('0x61')][_0xe03f('0xbf')];return db[_0xe03f('0xc0')][_0xe03f('0x5f')]({'where':_0x1cfbba})[_0xe03f('0x25')](function(_0x3d1d80){if(_0x3d1d80){return[_0x3d1d80,![]];}_0x217f05[_0xe03f('0xbf')]=_0x26efd1[_0xe03f('0x61')]['threadId'];_0x217f05[_0xe03f('0xc1')]=_0x26efd1[_0xe03f('0x61')][_0xe03f('0xc1')];return db[_0xe03f('0xc0')][_0xe03f('0x60')](_0x217f05)[_0xe03f('0x25')](function(_0x4a4791){return[_0x4a4791,!![]];});});}_0x1cfbba[_0xe03f('0xc2')]=_0x17e3a2['id'];if(_0x26efd1[_0xe03f('0x61')][_0xe03f('0xc3')]&&_0x26efd1[_0xe03f('0x61')]['interaction']['id']){_0x1cfbba['id']=_0x26efd1[_0xe03f('0x61')]['interaction']['id'];return db[_0xe03f('0xc0')]['find']({'where':_0x1cfbba})['then'](function(_0x560cfd){if(_0x560cfd){return[_0x560cfd,![]];}return db[_0xe03f('0xc0')]['create'](_0x217f05)[_0xe03f('0x25')](function(_0x5cc169){return[_0x5cc169,!![]];});});}return db[_0xe03f('0xc0')][_0xe03f('0x60')](_0x217f05)[_0xe03f('0x25')](function(_0x1fa4bd){return[_0x1fa4bd,!![]];});}})[_0xe03f('0xc4')](function(_0x4d7c36,_0x27240a){if(_0x4d7c36){_0x7616f5=_0x27240a;if(!_0x27240a){var _0x32646f={'from':(_0x42776c[_0xe03f('0xae')][_0xe03f('0xb4')]||'')+'\x20'+(_0x42776c[_0xe03f('0xae')][_0xe03f('0xb5')]||'')};if(_0x26efd1[_0xe03f('0x61')][_0xe03f('0xbf')]&&_0x26efd1[_0xe03f('0x61')]['messageId']&&_0x26efd1['body'][_0xe03f('0xbf')]!=_0x26efd1[_0xe03f('0x61')][_0xe03f('0xc5')]){_0x32646f['threadId']=_0x26efd1[_0xe03f('0x61')][_0xe03f('0xc5')];}return _0x4d7c36[_0xe03f('0x3b')](_0x32646f);}else{return _0x4d7c36;}}})[_0xe03f('0x25')](function(_0x3873aa){_0x42776c[_0xe03f('0xc3')]=_0x3873aa[_0xe03f('0x63')]({'plain':!![]});_0x42776c[_0xe03f('0xc3')][_0xe03f('0xc6')]=_0x7616f5;if(_0x42776c[_0xe03f('0xc3')][_0xe03f('0xc6')]){if(_0x42776c[_0xe03f('0xa9')][_0xe03f('0xc7')]){_0x42776c['applications'][_0xe03f('0xc8')]({'id':0x0,'priority':_0x42776c[_0xe03f('0xac')][_0xe03f('0x4d')]+0x1,'app':_0xe03f('0xc9'),'appdata':_0xe03f('0xca'),'interval':_0xe03f('0xcb')});}}return db[_0xe03f('0xcc')][_0xe03f('0x60')]({'body':_0x26efd1[_0xe03f('0x61')]['body'],'ChatWebsiteId':_0x26efd1['params']['id'],'ChatInteractionId':_0x3873aa['id'],'direction':'in','ContactId':_0x42776c[_0xe03f('0xae')]['id'],'AttachmentId':_0x26efd1[_0xe03f('0x61')][_0xe03f('0xcd')]});})['then'](function(_0x24b284){_0x42776c['message']=_0x24b284;if(_0x42776c[_0xe03f('0xc3')][_0xe03f('0xce')]){return db[_0xe03f('0xcf')]['find']({'attributes':['id',_0xe03f('0x3f')],'where':{'id':_0x42776c['interaction'][_0xe03f('0xce')]}})[_0xe03f('0x25')](function(_0x38e13a){if(_0x38e13a){_0x42776c[_0xe03f('0xac')][_0xe03f('0xd0')]({'id':0x0,'priority':0x0,'app':_0xe03f('0xd1'),'appdata':_0x38e13a['name']+','+(_0x42776c[_0xe03f('0xa9')]['waitForTheAssignedAgent']||0xa),'interval':_0xe03f('0xcb')});_0x42776c[_0xe03f('0xd2')]=!![];}return respondWithRpcPromise(_0xe03f('0xd3'),_0xe03f('0xd4'),_0x42776c);});}return respondWithRpcPromise(_0xe03f('0xd3'),_0xe03f('0xd4'),_0x42776c);})[_0xe03f('0x25')](function(_0x49bed6){respondWithRpcPromise(_0xe03f('0xd5'),_0xe03f('0xd5'),{'event':_0xe03f('0x8d'),'message':_0x49bed6},client9002);return _0x49bed6;})['then'](respondWithResult(_0x78f64b,null))[_0xe03f('0x5a')](handleError(_0x78f64b,null));};exports[_0xe03f('0xd6')]=function(_0x450aba,_0x1d059b,_0x540fe2){var _0x2d14f6,_0x1f748c,_0x136b0c;var _0x6908a7=[];var _0x4d9830=[];var _0x1aad51={};var _0x2473fc=_0x450aba['files']||[];var _0x19e37b=[];var _0x33511d;return db[_0xe03f('0xa3')][_0xe03f('0x69')]()['then'](function(_0x5a5d14){if(!_0x5a5d14){throw new db['Sequelize'][(_0xe03f('0x95'))](_0xe03f('0x96'));}_0x4d9830=_[_0xe03f('0x97')](_[_0xe03f('0x5e')](_0x5a5d14),[_0xe03f('0x98'),'updatedAt']);_0x6908a7=_['difference'](_['keys'](_0x5a5d14),[_0xe03f('0x98'),_0xe03f('0x99'),_0xe03f('0xd7'),_0xe03f('0x9a')]);if(_0x450aba[_0xe03f('0x61')]['id']){delete _0x450aba[_0xe03f('0x61')]['id'];}if(_[_0xe03f('0x84')](_0x450aba[_0xe03f('0x61')][_0xe03f('0xa1')])){throw _0x1d059b[_0xe03f('0x31')](0x1f4)[_0xe03f('0xd8')](new db[(_0xe03f('0x94'))]['ValidationError']('from\x20is\x20mandatory'));}if(_['isNil'](_0x450aba['body'][_0xe03f('0x61')])||_0x450aba['body'][_0xe03f('0x61')]===''){throw _0x1d059b[_0xe03f('0x31')](0x1f4)['send'](new db[(_0xe03f('0x94'))][(_0xe03f('0x95'))](_0xe03f('0x9c')));}if(_[_0xe03f('0x84')](_0x450aba[_0xe03f('0x61')][_0xe03f('0xd9')])){throw _0x1d059b['status'](0x1f4)[_0xe03f('0xd8')](new db['Sequelize'][(_0xe03f('0x95'))](_0xe03f('0xda')+_0x6908a7));}if(!_[_0xe03f('0x9f')](_0x6908a7,_0x450aba[_0xe03f('0x61')][_0xe03f('0xd9')])){throw _0x1d059b[_0xe03f('0x31')](0x1f4)[_0xe03f('0xd8')](new db[(_0xe03f('0x94'))][(_0xe03f('0x95'))](_0xe03f('0xdb')+_0x6908a7));}_0x1aad51[_0x450aba[_0xe03f('0x61')]['mapKeyOffline']]=_0x450aba[_0xe03f('0x61')][_0xe03f('0xa1')];})[_0xe03f('0x25')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x450aba['params']['id']},'include':[{'model':db[_0xe03f('0xa2')],'as':_0xe03f('0xa8')},{'model':db[_0xe03f('0xdc')],'as':_0xe03f('0xdc')}]});})[_0xe03f('0x25')](handleEntityNotFound(_0x1d059b,null))[_0xe03f('0x25')](function(_0x34c4c2){if(_0x34c4c2&&_0x34c4c2[_0xe03f('0xa8')]){_0x1f748c=_0x34c4c2;var _0x4fe45e=_[_0xe03f('0x1d')](_0x450aba[_0xe03f('0x61')],{'firstName':_0x450aba['body']['from'],'phone':_0x450aba[_0xe03f('0x61')][_0xe03f('0xa1')],'ListId':_0x34c4c2[_0xe03f('0x9a')]});_0x4fe45e[_0x450aba['body'][_0xe03f('0xd9')]]=_0x450aba['body'][_0xe03f('0xa1')];return db[_0xe03f('0xa3')][_0xe03f('0xdd')]({'where':_0x1aad51,'defaults':_0x4fe45e});}})[_0xe03f('0xc4')](function(_0x47b147){if(_0x47b147){_0x136b0c=_0x47b147;var _0x2d80c4=fs[_0xe03f('0xde')](path[_0xe03f('0x7d')](config[_0xe03f('0x80')],_0xe03f('0xdf')),_0xe03f('0xe0'));var _0x43a02f=ejs[_0xe03f('0xe1')](_0x2d80c4,{'body':_[_0xe03f('0xe2')](_0x450aba[_0xe03f('0x61')][_0xe03f('0x61')]),'bodyTitle':_0x1f748c[_0xe03f('0xe3')]});return db[_0xe03f('0xe4')][_0xe03f('0x60')]({'body':_0x43a02f,'ContactId':_0x47b147['id'],'ChatWebsiteId':_0x1f748c['id']});}})[_0xe03f('0x25')](function(_0x26ebed){_0x33511d=_0x26ebed;if(_0x2473fc[_0xe03f('0x4d')]){var _0x4fdb29=_0x2473fc['map'](function(_0xe2d2d0){return{'name':_0xe2d2d0[_0xe03f('0xe5')],'basename':_0xe2d2d0[_0xe03f('0x77')],'type':_0xe2d2d0['mimetype'],'ChatOfflineMessageId':_0x26ebed['id']};});_0x19e37b=_0x4fdb29['map'](_0x5132f7=>{var _0x2b4286={'filename':_0x5132f7['name'],'path':path['join'](config[_0xe03f('0x80')],_0xe03f('0xe6'),_0xe03f('0xe7'),_0xe03f('0xe8'),_0xe03f('0xe9'),_0x5132f7[_0xe03f('0xea')])};return _0x2b4286;});if(!_0x1f748c[_0xe03f('0xeb')]){return db[_0xe03f('0xec')]['transaction'](function(_0x57278c){return db['Attachment'][_0xe03f('0xed')](_0x4fdb29,{'transaction':_0x57278c});});}}})['then'](function(){if(_0x33511d){_0x2d14f6=_0x33511d;return db[_0xe03f('0xdc')][_0xe03f('0x6c')]({'where':{'active':!![]},'include':[{'model':db[_0xe03f('0xee')],'as':_0xe03f('0xef'),'raw':!![]}]});}})['then'](function(_0x406494){if(_0x406494&&_0x406494[_0xe03f('0xef')]&&_0x1f748c[_0xe03f('0xf0')]&&_0x1f748c[_0xe03f('0xf1')]){var _0x9ca17a={'tls':{'rejectUnauthorized':![]}};if(_0x406494[_0xe03f('0xef')][_0xe03f('0xf2')]){_0x9ca17a[_0xe03f('0xf2')]=_0x406494[_0xe03f('0xef')][_0xe03f('0xf2')];}else{_0x9ca17a['host']=_0x406494[_0xe03f('0xef')][_0xe03f('0xf3')];_0x9ca17a[_0xe03f('0xf4')]=_0x406494[_0xe03f('0xef')][_0xe03f('0xf4')];_0x9ca17a[_0xe03f('0xf5')]=_0x406494[_0xe03f('0xef')]['secure'];}if(_0x406494['Smtp']['authentication']){_0x9ca17a['auth']={'user':_0x406494['Smtp']['user'],'pass':_0x406494[_0xe03f('0xef')][_0xe03f('0xf6')]};}return respondWithRpcPromise(_0xe03f('0xf7'),'sendMail',{'account':_0x9ca17a,'message':{'from':util[_0xe03f('0xbb')](_0xe03f('0xf8'),_0x406494[_0xe03f('0x3f')],_0x406494[_0xe03f('0xf9')]||_0x406494[_0xe03f('0xef')][_0xe03f('0x62')]),'to':_0x1f748c['forwardOfflineAddress'],'subject':_0x1f748c[_0xe03f('0xfa')],'html':_0x2d14f6[_0xe03f('0x61')],'attachments':_0x19e37b}},client9003)[_0xe03f('0x25')](function(){return _0x2d14f6;})[_0xe03f('0x5a')](function(_0x3c6d9d){console[_0xe03f('0x2b')](_0x3c6d9d);});}})[_0xe03f('0x25')](function(){if(_0x1f748c&&_0x1f748c[_0xe03f('0xeb')]&&_0x1f748c[_0xe03f('0xfb')]){var _0x3a65da=[];if(_0x2473fc[_0xe03f('0x4d')]){_0x3a65da=_0x2473fc['map'](function(_0xb7c74e){return{'name':_0xb7c74e[_0xe03f('0xe5')],'basename':_0xb7c74e[_0xe03f('0x77')],'type':_0xb7c74e[_0xe03f('0xfc')],'ChatOfflineMessageId':_0x33511d['id']};});}var _0x289887;if(!_['isNil'](_0x1f748c[_0xe03f('0xfd')])){var _0x2b1b31=_[_0xe03f('0x42')](_0x450aba[_0xe03f('0x61')],function(_0x36e1ff){return _0x36e1ff;});var _0x352a95=_['toPairsIn'](_0x2b1b31)[0x0];var _0x55b9a3=_['mapValues'](_0x352a95,function(_0x48b903){return _0x48b903;});_0x289887=_0x55b9a3[0x1][_0x1f748c[_0xe03f('0xfd')]];}var _0x273a31={'from':_0x136b0c[_0xe03f('0xf9')],'firstName':_0x136b0c[_0xe03f('0xb4')],'lastName':_0x136b0c[_0xe03f('0xb5')],'mapKey':'email','message':{'from':_0x136b0c[_0xe03f('0xf9')],'to':_0x1f748c[_0xe03f('0xdc')]['email'],'cc':'','subject':_[_0xe03f('0x84')](_0x289887)?_0x1f748c[_0xe03f('0xfa')]:_0x289887,'messageId':'','sentAt':new Date(),'attach':_0x3a65da[_0xe03f('0x4d')],'attachments':_0x3a65da,'originChannel':'Chat','ChatWebsiteId':_0x1f748c['id'],'ChatOfflineMessageId':_0x2d14f6['id'],'originTo':_0x1f748c[_0xe03f('0xdc')]['email']},'body':_0x2d14f6[_0xe03f('0x61')]};var _0x1c7126={'account':{'id':_0x1f748c['MailAccountId']},'body':_0x273a31,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0xe03f('0xfe'),'notifyMail',_0x1c7126,client9001)[_0xe03f('0x25')](function(){return _0x2d14f6;})[_0xe03f('0x5a')](function(_0x5d667c){console[_0xe03f('0x2b')](_0x5d667c);});}return;})[_0xe03f('0x25')](function(){if(_0x2d14f6){return _0x2d14f6;}})[_0xe03f('0x25')](respondWithResult(_0x1d059b,null))['catch'](function(_0x2a887d){console[_0xe03f('0x2b')](_0xe03f('0x5a'),_0x2a887d);for(var _0x1c68a3 of _0x2473fc){var _0x4925b8=path[_0xe03f('0x7d')](config[_0xe03f('0x80')],'server',_0xe03f('0xe7'),_0xe03f('0xe8'),_0xe03f('0xe9'),_0x1c68a3['filename']);fs_extra[_0xe03f('0xff')](_0x4925b8)[_0xe03f('0x5a')](function(_0x223186){console['error'](_0xe03f('0x100'),_0x4925b8,_0x223186);});}});};exports['addInteraction']=function(_0x52767d,_0x17ea1e,_0x162ffd){return db[_0xe03f('0xc0')][_0xe03f('0x5f')]({'where':{'id':_0x52767d[_0xe03f('0x5c')]['id']}})[_0xe03f('0x25')](handleEntityNotFound(_0x17ea1e,null))[_0xe03f('0x25')](function(_0x304043){if(_0x304043){return _0x304043[_0xe03f('0x101')](_0x52767d['body'][_0xe03f('0x74')],_[_0xe03f('0x102')](_0x52767d[_0xe03f('0x61')],[_0xe03f('0x74'),'id'])||{});}})[_0xe03f('0x25')](respondWithResult(_0x17ea1e,null))['catch'](handleError(_0x17ea1e,null));};exports[_0xe03f('0x103')]=function(_0x5acac2,_0x265407,_0x87b17b){var _0x15b145={'raw':![],'where':{}};var _0x42767f={};var _0x47b755={'count':0x0,'rows':[]};return db[_0xe03f('0x43')]['findOne']({'where':{'id':_0x5acac2[_0xe03f('0x5c')]['id']}})[_0xe03f('0x25')](handleEntityNotFound(_0x265407,null))[_0xe03f('0x25')](function(_0x5791c5){if(_0x5791c5){_0x42767f[_0xe03f('0x47')]=_[_0xe03f('0x5e')](db[_0xe03f('0xc0')][_0xe03f('0x44')]);_0x42767f[_0xe03f('0x48')]=_[_0xe03f('0x5e')](_0x5acac2['query']);_0x42767f[_0xe03f('0x49')]=_[_0xe03f('0x4a')](_0x42767f[_0xe03f('0x47')],_0x42767f['query']);_0x15b145[_0xe03f('0x4b')]=_[_0xe03f('0x4a')](_0x42767f[_0xe03f('0x47')],qs[_0xe03f('0x4c')](_0x5acac2[_0xe03f('0x48')][_0xe03f('0x4c')]));_0x15b145['attributes']=_0x15b145[_0xe03f('0x4b')][_0xe03f('0x4d')]?_0x15b145[_0xe03f('0x4b')]:_0x42767f[_0xe03f('0x47')];if(!_0x5acac2['query'][_0xe03f('0x4e')](_0xe03f('0x4f'))){_0x15b145[_0xe03f('0x35')]=qs[_0xe03f('0x35')](_0x5acac2['query'][_0xe03f('0x35')]);_0x15b145[_0xe03f('0x33')]=qs[_0xe03f('0x33')](_0x5acac2[_0xe03f('0x48')][_0xe03f('0x33')]);}_0x15b145[_0xe03f('0x71')]=qs[_0xe03f('0x6d')](_0x5acac2[_0xe03f('0x48')][_0xe03f('0x6d')]);_0x15b145[_0xe03f('0x50')]=qs[_0xe03f('0x49')](_['pick'](_0x5acac2['query'],_0x42767f[_0xe03f('0x49')]));_0x15b145[_0xe03f('0x50')][_0xe03f('0x6a')]=_0x5791c5['id'];if(_0x5acac2[_0xe03f('0x48')][_0xe03f('0x54')]){_0x15b145[_0xe03f('0x50')]=_[_0xe03f('0x55')](_0x15b145[_0xe03f('0x50')],{'$or':_[_0xe03f('0x42')](_0x15b145['attributes'],function(_0x80cc58){var _0x350384={};_0x350384[_0x80cc58]={'$like':'%'+_0x5acac2['query'][_0xe03f('0x54')]+'%'};return _0x350384;})});}_0x15b145=_['merge']({},_0x15b145,_0x5acac2[_0xe03f('0x56')]);return db['ChatInteraction']['count']({'where':_0x15b145[_0xe03f('0x50')]})[_0xe03f('0x25')](function(_0x2e8c26){_0x47b755['count']=_0x2e8c26;if(_0x5acac2[_0xe03f('0x48')][_0xe03f('0x57')]){_0x15b145[_0xe03f('0x58')]=[{'model':db[_0xe03f('0xa3')],'as':_0xe03f('0x104'),'required':![]},{'model':db[_0xe03f('0xcf')],'as':_0xe03f('0x105'),'attributes':[_0xe03f('0x3f'),_0xe03f('0x106'),'internal'],'required':![]},{'model':db[_0xe03f('0x107')],'as':_0xe03f('0x108'),'attributes':['id',_0xe03f('0x3f'),'color'],'where':_0x5acac2['query'][_0xe03f('0x109')]?{'id':_0x5acac2[_0xe03f('0x48')][_0xe03f('0x109')]}:undefined,'required':_0x5acac2[_0xe03f('0x48')][_0xe03f('0x109')]?!![]:![]}];}return db[_0xe03f('0xc0')][_0xe03f('0x72')](_0x15b145);})['then'](function(_0x5ab1d7){_0x47b755[_0xe03f('0x59')]=_0x5ab1d7;return _0x47b755;});}})[_0xe03f('0x25')](respondWithFilteredResult(_0x265407,_0x15b145))[_0xe03f('0x5a')](handleError(_0x265407,null));};function iftimePromise(_0x223b1f,_0xcf091a){return respondWithRpcPromise(_0xe03f('0x10a'),_0xe03f('0x10b'),{'command':_0xcf091a[_0xe03f('0x10c')]?util[_0xe03f('0xbb')](_0xe03f('0x10d'),_0x223b1f[_0xe03f('0x10e')],_0xcf091a['timezone']):util[_0xe03f('0xbb')](_0xe03f('0x10f'),_0x223b1f[_0xe03f('0x10e')])},client9002)['then'](function(_0x217789){var _0x254444=_0x217789&&_0x217789['indexOf']('true')>=0x0?!![]:![];logger[_0xe03f('0x26')](_0xe03f('0x110'),_0xcf091a['id'],_0x223b1f['id'],_0x223b1f[_0xe03f('0x10e')],_0x254444?_0xe03f('0x111'):_0xe03f('0x112'),_0xcf091a[_0xe03f('0x10c')]?_0xcf091a[_0xe03f('0x10c')]:'No\x20timezone');return _0x254444;})['catch'](function(_0x17e5a8){logger[_0xe03f('0x2b')](_0xe03f('0x110'),_0xcf091a['id'],_0x223b1f['id'],_0x223b1f['interval'],util[_0xe03f('0x113')](_0x17e5a8,{'showHidden':![],'depth':null}),_0xcf091a['timezone']?_0xcf091a[_0xe03f('0x10c')]:_0xe03f('0x114'));return![];});}exports[_0xe03f('0x10b')]=function(_0x40fe22,_0x5c8b12,_0x1f48ba){var _0x23a1d6=0x0;var _0x24024e=0x0;var _0x2da007=![];var _0x548430;var _0x25fb65;return db['ChatWebsite'][_0xe03f('0x5f')]({'where':{'id':_0x40fe22['params']['id']},'include':[{'model':db[_0xe03f('0x115')],'as':_0xe03f('0x115'),'include':[{'model':db[_0xe03f('0x115')],'as':_0xe03f('0x116'),'attributes':['id',_0xe03f('0x10e')],'raw':!![]}]}]})[_0xe03f('0x25')](handleEntityNotFound(_0x5c8b12,null))[_0xe03f('0x25')](function(_0x9d39cb){if(_0x9d39cb){_0x548430=_0x9d39cb;return _0x9d39cb[_0xe03f('0x117')]({'raw':!![]});}})['then'](function(_0x3a6833){if(_0x548430){if(_0x3a6833){_0x25fb65=_0x3a6833;}}return require(_0xe03f('0x1a'))[_0xe03f('0x7e')]();})['then'](function(_0x2f5738){if(_0x2f5738){_0x24024e=_0x2f5738[_0xe03f('0x118')];_0x2da007=_0x2f5738[_0xe03f('0x7f')];}})['then'](function(){return db[_0xe03f('0xc0')]['count']({'where':{'closed':![]}});})[_0xe03f('0x25')](function(_0xc5fd6){_0x23a1d6=_0xc5fd6;if(_0x24024e&&_0xc5fd6>_0x24024e){return db[_0xe03f('0x119')]['findOne']({'where':{'id':0x1}})['then'](function(_0x4eb2fe){if(_0x4eb2fe){_0x4eb2fe['increment']('chatLicenseExceeded');}});}})[_0xe03f('0x25')](function(){if(_0x548430[_0xe03f('0x115')]&&_0x548430[_0xe03f('0x115')][_0xe03f('0x116')]){var _0x5a41d5=[];for(var _0x3592da=0x0;_0x3592da<_0x548430[_0xe03f('0x115')][_0xe03f('0x116')][_0xe03f('0x4d')];_0x3592da++){var _0x487656=_0x548430[_0xe03f('0x115')][_0xe03f('0x116')][_0x3592da][_0xe03f('0x63')]({'plain':!![]});_0x5a41d5[_0xe03f('0xc8')](iftimePromise(_0x487656,_0x548430));}return BPromise[_0xe03f('0x11a')](_0x5a41d5)[_0xe03f('0x25')](function(_0x1fa1b6){return _[_0xe03f('0x11b')](_0x1fa1b6);});}else{return!![];}})['then'](function(_0x203f4a){var _0xa9147b=fs[_0xe03f('0xde')](path[_0xe03f('0x7d')](config[_0xe03f('0x80')],_0xe03f('0x11c')),_0xe03f('0xe0'));var _0x3a8030={'remote':_0x548430[_0xe03f('0x11d')],'query':querystring[_0xe03f('0x2a')](_[_0xe03f('0x55')](_0x548430[_0xe03f('0x63')]({'plain':!![]}),{'customerIp':_0x40fe22[_0xe03f('0x90')][_0xe03f('0xb2')]||_0x40fe22[_0xe03f('0x90')][_0xe03f('0x11e')]||_0x40fe22[_0xe03f('0x11f')][_0xe03f('0x120')]||_0x40fe22['ip'],'referer':_0x40fe22['headers'][_0xe03f('0x121')],'openedInteractions':_0x23a1d6,'maxInteractions':_0x24024e,'virtual':_0x2da007['virtual'],'online':_0x203f4a,'custom':_0x2da007}))[_0xe03f('0x122')](/'/g,'\x5c\x27')};_0x5c8b12[_0xe03f('0xd8')](ejs['render'](Mustache[_0xe03f('0xe1')](_0xa9147b,_0x3a8030),{'proactiveActions':_0x25fb65,'alignment':_0x548430[_0xe03f('0x123')],'verticalAlignment':_0x548430['verticalAlignment'],'div_color':_0x548430[_0xe03f('0x124')],'text_color':_0x548430['textColor'],'button_color':_0x548430[_0xe03f('0x125')],'background_color':_0x548430['backgroundColor']}));})[_0xe03f('0x5a')](handleError(_0x5c8b12,null));};exports[_0xe03f('0x126')]=function(_0x4358a9,_0x1173dc,_0x2ecbca){return db[_0xe03f('0x43')][_0xe03f('0x6c')]({'where':{'id':_0x4358a9['params']['id']}})[_0xe03f('0x25')](handleEntityNotFound(_0x1173dc,null))[_0xe03f('0x25')](function(_0x49a215){if(_0x49a215){return db['sequelize'][_0xe03f('0x127')](function(_0x3a8b1f){return db[_0xe03f('0xa6')][_0xe03f('0x3d')]({'where':{'ChatWebsiteId':_0x4358a9[_0xe03f('0x5c')]['id']},'transaction':_0x3a8b1f})[_0xe03f('0x25')](function(_0x194a16){var _0x4d606e=_[_0xe03f('0x42')](_0x4358a9[_0xe03f('0x61')],function(_0x171bbd){_0x171bbd['ChatWebsiteId']=_0x4358a9[_0xe03f('0x5c')]['id'];return _0x171bbd;});return db[_0xe03f('0xa6')]['bulkCreate'](_0x4d606e,{'transaction':_0x3a8b1f});});})['then'](function(){return db[_0xe03f('0xa6')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x4358a9[_0xe03f('0x5c')]['id']},'order':_0xe03f('0xad')});});}})[_0xe03f('0x25')](respondWithResult(_0x1173dc,null))[_0xe03f('0x5a')](handleError(_0x1173dc,null));};exports[_0xe03f('0x128')]=function(_0x4362cc,_0x409a97,_0x4e0235){var _0x39ed6f={};var _0x3a9dcf={};var _0xb5b9b9;var _0x4f2091;return db['ChatWebsite'][_0xe03f('0x6c')]({'where':{'id':_0x4362cc[_0xe03f('0x5c')]['id']}})[_0xe03f('0x25')](handleEntityNotFound(_0x409a97,null))[_0xe03f('0x25')](function(_0x489246){if(_0x489246){_0xb5b9b9=_0x489246;_0x3a9dcf[_0xe03f('0x47')]=_[_0xe03f('0x5e')](db[_0xe03f('0xa6')]['rawAttributes']);_0x3a9dcf[_0xe03f('0x48')]=_[_0xe03f('0x5e')](_0x4362cc['query']);_0x3a9dcf[_0xe03f('0x49')]=_['intersection'](_0x3a9dcf[_0xe03f('0x47')],_0x3a9dcf[_0xe03f('0x48')]);_0x39ed6f['attributes']=_[_0xe03f('0x4a')](_0x3a9dcf[_0xe03f('0x47')],qs[_0xe03f('0x4c')](_0x4362cc[_0xe03f('0x48')][_0xe03f('0x4c')]));_0x39ed6f[_0xe03f('0x4b')]=_0x39ed6f[_0xe03f('0x4b')][_0xe03f('0x4d')]?_0x39ed6f[_0xe03f('0x4b')]:_0x3a9dcf['model'];_0x39ed6f[_0xe03f('0x71')]=qs[_0xe03f('0x6d')](_0x4362cc['query'][_0xe03f('0x6d')]);_0x39ed6f[_0xe03f('0x50')]=qs['filters'](_['pick'](_0x4362cc[_0xe03f('0x48')],_0x3a9dcf[_0xe03f('0x49')]));if(_0x4362cc[_0xe03f('0x48')][_0xe03f('0x54')]){_0x39ed6f[_0xe03f('0x50')]=_['merge'](_0x39ed6f['where'],{'$or':_['map'](_0x39ed6f['attributes'],function(_0x41bf11){var _0xab4684={};_0xab4684[_0x41bf11]={'$like':'%'+_0x4362cc[_0xe03f('0x48')]['filter']+'%'};return _0xab4684;})});}_0x39ed6f=_[_0xe03f('0x55')]({},_0x39ed6f,_0x4362cc[_0xe03f('0x56')]);return _0xb5b9b9[_0xe03f('0x128')](_0x39ed6f);}})[_0xe03f('0x25')](function(_0x22678c){if(_0x22678c){_0x4f2091=_0x22678c[_0xe03f('0x4d')];if(!_0x4362cc[_0xe03f('0x48')]['hasOwnProperty'](_0xe03f('0x4f'))){_0x39ed6f['limit']=qs['limit'](_0x4362cc[_0xe03f('0x48')][_0xe03f('0x35')]);_0x39ed6f[_0xe03f('0x33')]=qs[_0xe03f('0x33')](_0x4362cc[_0xe03f('0x48')][_0xe03f('0x33')]);}return _0xb5b9b9[_0xe03f('0x128')](_0x39ed6f);}})['then'](function(_0x1c5ee0){if(_0x1c5ee0){return _0x1c5ee0?{'count':_0x4f2091,'rows':_0x1c5ee0}:null;}})['then'](respondWithResult(_0x409a97,null))[_0xe03f('0x5a')](handleError(_0x409a97,null));};exports[_0xe03f('0x129')]=function(_0x389486,_0xa828db,_0x2a794f){return db[_0xe03f('0x12a')]['find']({'where':{'id':_0x389486[_0xe03f('0x5c')]['id']}})[_0xe03f('0x25')](handleEntityNotFound(_0xa828db,null))[_0xe03f('0x25')](function(_0x5b4cab){if(_0x5b4cab){return _0x5b4cab[_0xe03f('0x129')](_0x389486[_0xe03f('0x61')][_0xe03f('0x74')],_[_0xe03f('0x102')](_0x389486[_0xe03f('0x61')],[_0xe03f('0x74'),'id'])||{});}})[_0xe03f('0x25')](respondWithResult(_0xa828db,null))['catch'](handleError(_0xa828db,null));};exports['getProactiveActions']=function(_0x5066d4,_0x3d7204,_0x3ff2f6){var _0x470881={};var _0x128f43={};var _0x3cf889;var _0x30030c;return db[_0xe03f('0x43')][_0xe03f('0x6c')]({'where':{'id':_0x5066d4[_0xe03f('0x5c')]['id']}})[_0xe03f('0x25')](handleEntityNotFound(_0x3d7204,null))[_0xe03f('0x25')](function(_0x212904){if(_0x212904){_0x3cf889=_0x212904;_0x128f43[_0xe03f('0x47')]=_[_0xe03f('0x5e')](db[_0xe03f('0x12b')][_0xe03f('0x44')]);_0x128f43[_0xe03f('0x48')]=_[_0xe03f('0x5e')](_0x5066d4[_0xe03f('0x48')]);_0x128f43[_0xe03f('0x49')]=_[_0xe03f('0x4a')](_0x128f43['model'],_0x128f43['query']);_0x470881['attributes']=_['intersection'](_0x128f43['model'],qs['fields'](_0x5066d4[_0xe03f('0x48')][_0xe03f('0x4c')]));_0x470881[_0xe03f('0x4b')]=_0x470881[_0xe03f('0x4b')][_0xe03f('0x4d')]?_0x470881['attributes']:_0x128f43['model'];_0x470881[_0xe03f('0x71')]=qs['sort'](_0x5066d4[_0xe03f('0x48')][_0xe03f('0x6d')]);_0x470881['where']=qs[_0xe03f('0x49')](_[_0xe03f('0x51')](_0x5066d4[_0xe03f('0x48')],_0x128f43['filters']));if(_0x5066d4[_0xe03f('0x48')][_0xe03f('0x54')]){_0x470881[_0xe03f('0x50')]=_['merge'](_0x470881[_0xe03f('0x50')],{'$or':_['map'](_0x470881[_0xe03f('0x4b')],function(_0x585664){var _0x64a56d={};_0x64a56d[_0x585664]={'$like':'%'+_0x5066d4[_0xe03f('0x48')][_0xe03f('0x54')]+'%'};return _0x64a56d;})});}_0x470881=_[_0xe03f('0x55')]({},_0x470881,_0x5066d4[_0xe03f('0x56')]);return _0x3cf889[_0xe03f('0x117')](_0x470881);}})[_0xe03f('0x25')](function(_0x21ab8b){if(_0x21ab8b){_0x30030c=_0x21ab8b[_0xe03f('0x4d')];if(!_0x5066d4[_0xe03f('0x48')]['hasOwnProperty'](_0xe03f('0x4f'))){_0x470881[_0xe03f('0x35')]=qs['limit'](_0x5066d4[_0xe03f('0x48')]['limit']);_0x470881[_0xe03f('0x33')]=qs['offset'](_0x5066d4[_0xe03f('0x48')][_0xe03f('0x33')]);}return _0x3cf889[_0xe03f('0x117')](_0x470881);}})['then'](function(_0x131b15){if(_0x131b15){return _0x131b15?{'count':_0x30030c,'rows':_0x131b15}:null;}})[_0xe03f('0x25')](respondWithResult(_0x3d7204,null))[_0xe03f('0x5a')](handleError(_0x3d7204,null));};exports['getFields']=function(_0x28cbb9,_0x2bf131,_0x474e06){var _0x5ca8b2=_0x28cbb9[_0xe03f('0x48')][_0xe03f('0x12c')]===_0xe03f('0x12d')?'offlineForm':_0xe03f('0x12e');return db[_0xe03f('0x43')][_0xe03f('0x5f')]({'attributes':['id',_0x5ca8b2],'where':{'id':_0x28cbb9['params']['id']}})[_0xe03f('0x25')](handleEntityNotFound(_0x2bf131,null))['then'](function(_0x12bf11){if(_0x12bf11){var _0x35af04=_0x12bf11[_0x5ca8b2];var _0x1c0179=_0x35af04&&_0x35af04[_0xe03f('0x12f')]?_0x35af04[_0xe03f('0x12f')]:[];_0x2bf131[_0xe03f('0xd8')]({'fromKey':_[_0xe03f('0x84')](_0x35af04[_0xe03f('0x130')])?undefined:_0x35af04[_0xe03f('0x130')],'count':_0x1c0179[_0xe03f('0x4d')],'rows':_0x1c0179});}})[_0xe03f('0x5a')](handleError(_0x2bf131,null));};exports['getOfflineMessages']=function(_0x5ab8dc,_0x1d34e6,_0x2dc7ee){var _0x298b5e={'raw':![],'where':{}};var _0x3dbdf1={};var _0x3a2d24={'count':0x0,'rows':[]};return db[_0xe03f('0x43')][_0xe03f('0x6c')]({'where':{'id':_0x5ab8dc[_0xe03f('0x5c')]['id']}})['then'](handleEntityNotFound(_0x1d34e6,null))[_0xe03f('0x25')](function(_0x1b01ce){if(_0x1b01ce){_0x3dbdf1[_0xe03f('0x47')]=_[_0xe03f('0x5e')](db[_0xe03f('0xe4')][_0xe03f('0x44')]);_0x3dbdf1[_0xe03f('0x48')]=_['keys'](_0x5ab8dc[_0xe03f('0x48')]);_0x3dbdf1[_0xe03f('0x49')]=_[_0xe03f('0x4a')](_0x3dbdf1[_0xe03f('0x47')],_0x3dbdf1[_0xe03f('0x48')]);_0x298b5e[_0xe03f('0x4b')]=_[_0xe03f('0x4a')](_0x3dbdf1['model'],qs[_0xe03f('0x4c')](_0x5ab8dc[_0xe03f('0x48')][_0xe03f('0x4c')]));_0x298b5e[_0xe03f('0x4b')]=_0x298b5e['attributes']['length']?_0x298b5e[_0xe03f('0x4b')]:_0x3dbdf1[_0xe03f('0x47')];if(!_0x5ab8dc['query']['hasOwnProperty'](_0xe03f('0x4f'))){_0x298b5e[_0xe03f('0x35')]=qs[_0xe03f('0x35')](_0x5ab8dc[_0xe03f('0x48')][_0xe03f('0x35')]);_0x298b5e[_0xe03f('0x33')]=qs[_0xe03f('0x33')](_0x5ab8dc[_0xe03f('0x48')][_0xe03f('0x33')]);}_0x298b5e['order']=qs['sort'](_0x5ab8dc[_0xe03f('0x48')][_0xe03f('0x6d')]);_0x298b5e[_0xe03f('0x50')]=qs[_0xe03f('0x49')](_['pick'](_0x5ab8dc['query'],_0x3dbdf1['filters']));_0x298b5e[_0xe03f('0x50')][_0xe03f('0x6a')]=_0x1b01ce['id'];if(_0x5ab8dc[_0xe03f('0x48')][_0xe03f('0x54')]){_0x298b5e[_0xe03f('0x50')]=_[_0xe03f('0x55')](_0x298b5e[_0xe03f('0x50')],{'$or':_[_0xe03f('0x42')](_0x298b5e['attributes'],function(_0x31b5cc){var _0xfd7ff9={};_0xfd7ff9[_0x31b5cc]={'$like':'%'+_0x5ab8dc[_0xe03f('0x48')]['filter']+'%'};return _0xfd7ff9;})});}_0x298b5e=_['merge']({},_0x298b5e,_0x5ab8dc['options']);return db['ChatOfflineMessage'][_0xe03f('0x36')]({'where':_0x298b5e['where']})[_0xe03f('0x25')](function(_0x569229){_0x3a2d24[_0xe03f('0x36')]=_0x569229;if(_0x5ab8dc[_0xe03f('0x48')][_0xe03f('0x57')]){_0x298b5e['include']=[{'all':!![]}];}else{_0x298b5e[_0xe03f('0x58')]=[{'model':db['CmContact'],'as':_0xe03f('0x104'),'required':![]},{'model':db[_0xe03f('0x131')],'as':_0xe03f('0x132'),'required':![]}];}return db[_0xe03f('0xe4')][_0xe03f('0x72')](_0x298b5e);})[_0xe03f('0x25')](function(_0x23456b){_0x3a2d24[_0xe03f('0x59')]=_0x23456b;return _0x3a2d24;});}})['then'](respondWithFilteredResult(_0x1d34e6,_0x298b5e))[_0xe03f('0x5a')](handleError(_0x1d34e6,null));};exports['addAgents']=function(_0x5d9dd6,_0xc7e928,_0x3e7691){return db['ChatWebsite'][_0xe03f('0x5f')]({'where':{'id':_0x5d9dd6[_0xe03f('0x5c')]['id']}})[_0xe03f('0x25')](handleEntityNotFound(_0xc7e928,null))['then'](function(_0x2dc8c5){if(_0x2dc8c5){return _0x2dc8c5[_0xe03f('0x133')](_0x5d9dd6[_0xe03f('0x61')][_0xe03f('0x74')],_[_0xe03f('0x102')](_0x5d9dd6[_0xe03f('0x61')],[_0xe03f('0x74'),'id'])||{})[_0xe03f('0xc4')](function(_0x2a3492){for(var _0x20eeac=0x0;_0x20eeac<_0x5d9dd6[_0xe03f('0x61')]['ids'][_0xe03f('0x4d')];_0x20eeac+=0x1){socket[_0xe03f('0x134')]('userChatWebsite:save',{'UserId':Number(_0x5d9dd6[_0xe03f('0x61')][_0xe03f('0x74')][_0x20eeac]),'ChatWebsiteId':Number(_0x5d9dd6['params']['id'])});}return _0x2a3492;});}})['then'](respondWithResult(_0xc7e928,null))['catch'](handleError(_0xc7e928,null));};exports['removeAgents']=function(_0x3e92ae,_0x661f36,_0x2a6f0d){return db[_0xe03f('0x43')][_0xe03f('0x5f')]({'where':{'id':_0x3e92ae[_0xe03f('0x5c')]['id']}})['then'](handleEntityNotFound(_0x661f36,null))[_0xe03f('0x25')](function(_0x56e55e){if(_0x56e55e){return _0x56e55e[_0xe03f('0x135')](_0x3e92ae[_0xe03f('0x48')][_0xe03f('0x74')])['then'](function(){if(_[_0xe03f('0x136')](_0x3e92ae[_0xe03f('0x48')]['ids'])){for(var _0x245d34=0x0;_0x245d34<_0x3e92ae[_0xe03f('0x48')][_0xe03f('0x74')][_0xe03f('0x4d')];_0x245d34+=0x1){socket[_0xe03f('0x134')](_0xe03f('0x137'),{'UserId':Number(_0x3e92ae[_0xe03f('0x48')][_0xe03f('0x74')][_0x245d34]),'ChatWebsiteId':Number(_0x3e92ae[_0xe03f('0x5c')]['id'])});}}else{socket['emit'](_0xe03f('0x137'),{'UserId':Number(_0x3e92ae['query'][_0xe03f('0x74')]),'ChatWebsiteId':Number(_0x3e92ae[_0xe03f('0x5c')]['id'])});}});}})[_0xe03f('0x25')](respondWithStatusCode(_0x661f36,null))[_0xe03f('0x5a')](handleError(_0x661f36,null));};exports[_0xe03f('0x138')]=function(_0x382112,_0x1a30cc,_0x40e7ff){var _0x3a0830={};var _0x32e764={};var _0x14bbb2;var _0x5d1776;return db[_0xe03f('0x43')][_0xe03f('0x6c')]({'where':{'id':_0x382112[_0xe03f('0x5c')]['id']}})[_0xe03f('0x25')](handleEntityNotFound(_0x1a30cc,null))[_0xe03f('0x25')](function(_0x4c0cc6){if(_0x4c0cc6){_0x14bbb2=_0x4c0cc6;_0x32e764['model']=_[_0xe03f('0x5e')](db[_0xe03f('0xcf')][_0xe03f('0x44')]);_0x32e764[_0xe03f('0x48')]=_[_0xe03f('0x5e')](_0x382112[_0xe03f('0x48')]);_0x32e764[_0xe03f('0x49')]=_[_0xe03f('0x4a')](_0x32e764[_0xe03f('0x47')],_0x32e764['query']);_0x3a0830[_0xe03f('0x4b')]=_['intersection'](_0x32e764[_0xe03f('0x47')],qs[_0xe03f('0x4c')](_0x382112[_0xe03f('0x48')][_0xe03f('0x4c')]));_0x3a0830[_0xe03f('0x4b')]=_0x3a0830[_0xe03f('0x4b')]['length']?_0x3a0830['attributes']:_0x32e764[_0xe03f('0x47')];_0x3a0830[_0xe03f('0x71')]=qs[_0xe03f('0x6d')](_0x382112['query'][_0xe03f('0x6d')]);_0x3a0830[_0xe03f('0x50')]=qs[_0xe03f('0x49')](_[_0xe03f('0x51')](_0x382112[_0xe03f('0x48')],_0x32e764['filters']));if(_0x382112[_0xe03f('0x48')]['filter']){_0x3a0830[_0xe03f('0x50')]=_[_0xe03f('0x55')](_0x3a0830[_0xe03f('0x50')],{'$or':_['map'](_0x3a0830[_0xe03f('0x4b')],function(_0x338d23){var _0x21a7e9={};_0x21a7e9[_0x338d23]={'$like':'%'+_0x382112[_0xe03f('0x48')]['filter']+'%'};return _0x21a7e9;})});}_0x3a0830=_[_0xe03f('0x55')]({},_0x3a0830,_0x382112[_0xe03f('0x56')]);return _0x14bbb2[_0xe03f('0x138')](_0x3a0830);}})['then'](function(_0x3277da){if(_0x3277da){_0x5d1776=_0x3277da['length'];if(!_0x382112['query']['hasOwnProperty'](_0xe03f('0x4f'))){_0x3a0830[_0xe03f('0x35')]=qs[_0xe03f('0x35')](_0x382112[_0xe03f('0x48')]['limit']);_0x3a0830['offset']=qs[_0xe03f('0x33')](_0x382112[_0xe03f('0x48')][_0xe03f('0x33')]);}return _0x14bbb2[_0xe03f('0x138')](_0x3a0830);}})[_0xe03f('0x25')](function(_0x3831b9){if(_0x3831b9){return _0x3831b9?{'count':_0x5d1776,'rows':_0x3831b9}:null;}})[_0xe03f('0x25')](respondWithResult(_0x1a30cc,null))[_0xe03f('0x5a')](handleError(_0x1a30cc,null));}; \ No newline at end of file +var _0x4934=['getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','notify','user-agent-parser','setUA','user-agent','getResult','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','Contacts','DESC','ChatApplication','Applications','List','account','list','applications','priority','asc','ListId','contact','headers','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','threadId','externalUrl','ContactId','interaction','ChatInteraction','spread','messageId','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','from','send','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','toPairs','offlineMessageBody','originalname','mimetype','server','attachments','offline-chat','openNewInteraction','transaction','Attachment','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','pass','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','mapValues','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','Contact','Owner','internal','Tag','Tags','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','indexOf','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','Interval','Intervals','getProactiveActions','virtual','chatLicenseExceeded','all','some','readFileSync','utf8','x-real-ip','connection','remoteAddress','replace','render','color','textColor','addApplications','getApplications','addProactiveActions','omit','ChatProactiveAction','online','false','offlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','result','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','reject','update','destroy','get','ChatWebsites','UserProfileResource','sendStatus','stack','name','index','Pause','mandatoryDispositionPause','map','ChatWebsite','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL','includeAll','rows','catch','show','rawAttributes','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','order','pick','include','findAll','removeDispositions','ids','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','addLogo','sitepic','file','filename','addAvatar','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','join','getLicense','custom','isNil','existsSync','root','getAvatar','agentAvatar','server/files/images/avatars/','download'];(function(_0xd20b50,_0x49b5b3){var _0xe4ecc7=function(_0x2caebd){while(--_0x2caebd){_0xd20b50['push'](_0xd20b50['shift']());}};_0xe4ecc7(++_0x49b5b3);}(_0x4934,0x1d4));var _0x4493=function(_0x4e1e1e,_0x3998bd){_0x4e1e1e=_0x4e1e1e-0x0;var _0x2a0d75=_0x4934[_0x4e1e1e];return _0x2a0d75;};'use strict';var emlformat=require(_0x4493('0x0'));var rimraf=require(_0x4493('0x1'));var zipdir=require(_0x4493('0x2'));var jsonpatch=require(_0x4493('0x3'));var rp=require('request-promise');var moment=require(_0x4493('0x4'));var BPromise=require(_0x4493('0x5'));var Mustache=require('mustache');var util=require(_0x4493('0x6'));var path=require('path');var sox=require(_0x4493('0x7'));var csv=require('to-csv');var ejs=require(_0x4493('0x8'));var fs=require('fs');var fs_extra=require(_0x4493('0x9'));var _=require(_0x4493('0xa'));var squel=require(_0x4493('0xb'));var crypto=require(_0x4493('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4493('0xd'));var Papa=require('papaparse');var Redis=require(_0x4493('0xe'));var authService=require(_0x4493('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x4493('0x10'));var hardwareService=require(_0x4493('0x11'));var logger=require('../../config/logger')(_0x4493('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4493('0x13'));var db=require(_0x4493('0x14'))['db'];config[_0x4493('0x15')]=_[_0x4493('0x16')](config[_0x4493('0x15')],{'host':_0x4493('0x17'),'port':0x18eb});var socket=require(_0x4493('0x18'))(new Redis(config[_0x4493('0x15')]));require(_0x4493('0x19'))[_0x4493('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x4493('0x1b')][_0x4493('0x1c')]({'port':0x232c});var client9002=jayson[_0x4493('0x1b')]['http']({'port':0x232a});var client9003=jayson[_0x4493('0x1b')][_0x4493('0x1c')]({'port':0x232b});var client9001=jayson['client'][_0x4493('0x1c')]({'port':0x2329});function respondWithRpcPromise(_0x42b6d8,_0x5b14d6,_0x57b1f8,_0x5d4ea3){return new BPromise(function(_0x128753,_0x137f86){var _0x39125e=_0x5d4ea3||client;return _0x39125e[_0x4493('0x1d')](_0x42b6d8,_0x57b1f8)[_0x4493('0x1e')](function(_0x4f94aa){logger[_0x4493('0x1f')](_0x4493('0x20'),_0x5b14d6,_0x4493('0x21'));logger[_0x4493('0x22')](_0x4493('0x23'),_0x5b14d6,_0x4493('0x21'),JSON[_0x4493('0x24')](_0x4f94aa));if(_0x4f94aa['error']){if(_0x4f94aa[_0x4493('0x25')]['code']===0x1f4){logger[_0x4493('0x25')](_0x4493('0x20'),_0x5b14d6,_0x4f94aa[_0x4493('0x25')][_0x4493('0x26')]);return _0x137f86(_0x4f94aa[_0x4493('0x25')][_0x4493('0x26')]);}logger[_0x4493('0x25')](_0x4493('0x20'),_0x5b14d6,_0x4f94aa['error']['message']);return _0x128753(_0x4f94aa[_0x4493('0x25')][_0x4493('0x26')]);}else{logger[_0x4493('0x1f')]('ChatWebsite,\x20%s,\x20%s',_0x5b14d6,'request\x20sent');_0x128753(_0x4f94aa[_0x4493('0x27')][_0x4493('0x26')]);}})['catch'](function(_0x1dc530){logger[_0x4493('0x25')](_0x4493('0x20'),_0x5b14d6,_0x1dc530);_0x137f86(_0x1dc530);});});}function respondWithStatusCode(_0x2e0828,_0x541094){_0x541094=_0x541094||0xcc;return function(_0x1d0d0c){if(_0x1d0d0c){return _0x2e0828['sendStatus'](_0x541094);}return _0x2e0828[_0x4493('0x28')](_0x541094)[_0x4493('0x29')]();};}function respondWithResult(_0x50b60c,_0x36b40c){_0x36b40c=_0x36b40c||0xc8;return function(_0x2369c2){if(_0x2369c2){return _0x50b60c[_0x4493('0x28')](_0x36b40c)[_0x4493('0x2a')](_0x2369c2);}};}function respondWithFilteredResult(_0x19ad27,_0x118249){return function(_0x1b6991){if(_0x1b6991){var _0x30af2c=typeof _0x118249['offset']==='undefined'&&typeof _0x118249['limit']===_0x4493('0x2b');var _0x4ccbfe=_0x1b6991['count'];var _0x321992=_0x30af2c?0x0:_0x118249[_0x4493('0x2c')];var _0x2cf7a0=_0x30af2c?_0x1b6991[_0x4493('0x2d')]:_0x118249[_0x4493('0x2c')]+_0x118249[_0x4493('0x2e')];var _0x4c87b1;if(_0x2cf7a0>=_0x4ccbfe){_0x2cf7a0=_0x4ccbfe;_0x4c87b1=0xc8;}else{_0x4c87b1=0xce;}_0x19ad27[_0x4493('0x28')](_0x4c87b1);return _0x19ad27[_0x4493('0x2f')](_0x4493('0x30'),_0x321992+'-'+_0x2cf7a0+'/'+_0x4ccbfe)[_0x4493('0x2a')](_0x1b6991);}return null;};}function patchUpdates(_0x1b981b){return function(_0x339e3f){try{jsonpatch[_0x4493('0x31')](_0x339e3f,_0x1b981b,!![]);}catch(_0x58e26f){return BPromise[_0x4493('0x32')](_0x58e26f);}return _0x339e3f['save']();};}function saveUpdates(_0x57c0e3,_0x14c1da){return function(_0x4cf197){if(_0x4cf197){return _0x4cf197[_0x4493('0x33')](_0x57c0e3)[_0x4493('0x1e')](function(_0x233ccc){return _0x233ccc;});}return null;};}function removeEntity(_0x280e26,_0x22713e){return function(_0x5e705d){if(_0x5e705d){return _0x5e705d[_0x4493('0x34')]()[_0x4493('0x1e')](function(){var _0x15748d=_0x5e705d[_0x4493('0x35')]({'plain':!![]});var _0x4daa38=_0x4493('0x36');return db[_0x4493('0x37')]['destroy']({'where':{'type':_0x4daa38,'resourceId':_0x15748d['id']}})[_0x4493('0x1e')](function(){return _0x5e705d;});})['then'](function(){_0x280e26[_0x4493('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47777a,_0x46882f){return function(_0x207db4){if(!_0x207db4){_0x47777a[_0x4493('0x38')](0x194);}return _0x207db4;};}function handleError(_0x328250,_0x4c5e51){_0x4c5e51=_0x4c5e51||0x1f4;return function(_0x4ed468){logger[_0x4493('0x25')](_0x4ed468[_0x4493('0x39')]);if(_0x4ed468[_0x4493('0x3a')]){delete _0x4ed468[_0x4493('0x3a')];}_0x328250[_0x4493('0x28')](_0x4c5e51)['send'](_0x4ed468);};}exports[_0x4493('0x3b')]=function(_0x1d3ce9,_0x44796a){var _0x4c5ac9={'include':[{'model':db[_0x4493('0x3c')],'as':_0x4493('0x3d')}]},_0x33d1f9={},_0x2c8246={'count':0x0,'rows':[]};var _0x1c069a=_[_0x4493('0x3e')](db[_0x4493('0x3f')]['rawAttributes'],function(_0x15e876){return{'name':_0x15e876[_0x4493('0x40')],'type':_0x15e876[_0x4493('0x41')][_0x4493('0x42')]};});_0x33d1f9['model']=_['map'](_0x1c069a,_0x4493('0x3a'));_0x33d1f9[_0x4493('0x43')]=_[_0x4493('0x44')](_0x1d3ce9['query']);_0x33d1f9[_0x4493('0x45')]=_[_0x4493('0x46')](_0x33d1f9[_0x4493('0x47')],_0x33d1f9[_0x4493('0x43')]);_0x4c5ac9[_0x4493('0x48')]=_[_0x4493('0x46')](_0x33d1f9[_0x4493('0x47')],qs[_0x4493('0x49')](_0x1d3ce9[_0x4493('0x43')][_0x4493('0x49')]));_0x4c5ac9[_0x4493('0x48')]=_0x4c5ac9[_0x4493('0x48')][_0x4493('0x4a')]?_0x4c5ac9['attributes']:_0x33d1f9[_0x4493('0x47')];if(!_0x1d3ce9[_0x4493('0x43')][_0x4493('0x4b')](_0x4493('0x4c'))){_0x4c5ac9[_0x4493('0x2e')]=qs['limit'](_0x1d3ce9[_0x4493('0x43')][_0x4493('0x2e')]);_0x4c5ac9[_0x4493('0x2c')]=qs[_0x4493('0x2c')](_0x1d3ce9[_0x4493('0x43')][_0x4493('0x2c')]);}_0x4c5ac9['order']=qs['sort'](_0x1d3ce9[_0x4493('0x43')][_0x4493('0x4d')]);_0x4c5ac9['where']=qs[_0x4493('0x45')](_['pick'](_0x1d3ce9[_0x4493('0x43')],_0x33d1f9[_0x4493('0x45')]),_0x1c069a);if(_0x1d3ce9[_0x4493('0x43')][_0x4493('0x4e')]){_0x4c5ac9[_0x4493('0x4f')]=_[_0x4493('0x50')](_0x4c5ac9['where'],{'$or':_[_0x4493('0x3e')](_0x1c069a,function(_0x97be76){if(_0x97be76[_0x4493('0x41')]!==_0x4493('0x51')){var _0x2d2ce6={};_0x2d2ce6[_0x97be76['name']]={'$like':'%'+_0x1d3ce9['query'][_0x4493('0x4e')]+'%'};return _0x2d2ce6;}})});}_0x4c5ac9=_[_0x4493('0x50')]({},_0x4c5ac9,_0x1d3ce9['options']);var _0x59f30f={'where':_0x4c5ac9['where']};return db['ChatWebsite'][_0x4493('0x2d')](_0x59f30f)['then'](function(_0x32f8c6){_0x2c8246['count']=_0x32f8c6;if(_0x1d3ce9[_0x4493('0x43')][_0x4493('0x52')]){_0x4c5ac9['include']=[{'all':!![]}];}return db[_0x4493('0x3f')]['findAll'](_0x4c5ac9);})[_0x4493('0x1e')](function(_0x83806c){_0x2c8246[_0x4493('0x53')]=_0x83806c;return _0x2c8246;})['then'](respondWithFilteredResult(_0x44796a,_0x4c5ac9))[_0x4493('0x54')](handleError(_0x44796a,null));};exports[_0x4493('0x55')]=function(_0x4e993d,_0x399f70){var _0x1a837b={'raw':![],'where':{'id':_0x4e993d['params']['id']},'include':[{'model':db[_0x4493('0x3c')],'as':'mandatoryDispositionPause'}]},_0x494936={};_0x494936[_0x4493('0x47')]=_[_0x4493('0x44')](db[_0x4493('0x3f')][_0x4493('0x56')]);_0x494936[_0x4493('0x43')]=_['keys'](_0x4e993d[_0x4493('0x43')]);_0x494936[_0x4493('0x45')]=_['intersection'](_0x494936[_0x4493('0x47')],_0x494936[_0x4493('0x43')]);_0x1a837b[_0x4493('0x48')]=_[_0x4493('0x46')](_0x494936[_0x4493('0x47')],qs[_0x4493('0x49')](_0x4e993d[_0x4493('0x43')][_0x4493('0x49')]));_0x1a837b[_0x4493('0x48')]=_0x1a837b[_0x4493('0x48')][_0x4493('0x4a')]?_0x1a837b[_0x4493('0x48')]:_0x494936[_0x4493('0x47')];if(_0x4e993d[_0x4493('0x43')][_0x4493('0x52')]){_0x1a837b['include']=[{'all':!![]}];}_0x1a837b=_[_0x4493('0x50')]({},_0x1a837b,_0x4e993d[_0x4493('0x57')]);return db[_0x4493('0x3f')]['find'](_0x1a837b)[_0x4493('0x1e')](handleEntityNotFound(_0x399f70,null))[_0x4493('0x1e')](respondWithResult(_0x399f70,null))['catch'](handleError(_0x399f70,null));};exports['create']=function(_0x4aaf6e,_0xee6e1d){return db[_0x4493('0x3f')][_0x4493('0x58')](_0x4aaf6e[_0x4493('0x59')],{})['then'](function(_0x4a34ba){var _0x3f9b3b=_0x4aaf6e[_0x4493('0x5a')]['get']({'plain':!![]});if(!_0x3f9b3b)throw new Error(_0x4493('0x5b'));if(_0x3f9b3b[_0x4493('0x5c')]===_0x4493('0x5a')){var _0x9e6252=_0x4a34ba[_0x4493('0x35')]({'plain':!![]});var _0x3e86d2=_0x4493('0x36');return db['UserProfileSection'][_0x4493('0x5d')]({'where':{'name':_0x3e86d2,'userProfileId':_0x3f9b3b['userProfileId']},'raw':!![]})[_0x4493('0x1e')](function(_0x1ce337){if(_0x1ce337&&_0x1ce337[_0x4493('0x5e')]===0x0){return db[_0x4493('0x37')][_0x4493('0x58')]({'name':_0x9e6252[_0x4493('0x3a')],'resourceId':_0x9e6252['id'],'type':_0x1ce337[_0x4493('0x3a')],'sectionId':_0x1ce337['id']},{})['then'](function(){return _0x4a34ba;});}else{return _0x4a34ba;}})[_0x4493('0x54')](function(_0x45c291){logger[_0x4493('0x25')](_0x4493('0x5f'),_0x45c291);throw _0x45c291;});}return _0x4a34ba;})['then'](respondWithResult(_0xee6e1d,0xc9))[_0x4493('0x54')](handleError(_0xee6e1d,null));};exports[_0x4493('0x33')]=function(_0x4041d5,_0x17b3f9){if(_0x4041d5['body']['id']){delete _0x4041d5['body']['id'];}return db[_0x4493('0x3f')][_0x4493('0x5d')]({'where':{'id':_0x4041d5[_0x4493('0x60')]['id']},'include':[{'model':db[_0x4493('0x3c')],'as':_0x4493('0x3d')}]})['then'](handleEntityNotFound(_0x17b3f9,null))[_0x4493('0x1e')](saveUpdates(_0x4041d5['body'],null))[_0x4493('0x1e')](respondWithResult(_0x17b3f9,null))[_0x4493('0x54')](handleError(_0x17b3f9,null));};exports[_0x4493('0x34')]=function(_0x1e9fc7,_0x22def1){return db[_0x4493('0x3f')][_0x4493('0x5d')]({'where':{'id':_0x1e9fc7['params']['id']}})['then'](handleEntityNotFound(_0x22def1,null))['then'](removeEntity(_0x22def1,null))[_0x4493('0x54')](handleError(_0x22def1,null));};exports['describe']=function(_0x2ce5b0,_0x235b24){return db[_0x4493('0x3f')][_0x4493('0x61')]()[_0x4493('0x1e')](respondWithResult(_0x235b24,null))[_0x4493('0x54')](handleError(_0x235b24,null));};exports[_0x4493('0x62')]=function(_0x100d0f,_0x3ef378,_0x4cb8d5){if(_0x100d0f[_0x4493('0x59')]['id']){delete _0x100d0f[_0x4493('0x59')]['id'];}return db[_0x4493('0x3f')]['find']({'where':{'id':_0x100d0f[_0x4493('0x60')]['id']}})['then'](handleEntityNotFound(_0x3ef378,null))[_0x4493('0x1e')](function(_0x5055e9){if(_0x5055e9){_0x100d0f[_0x4493('0x59')][_0x4493('0x63')]=_0x5055e9['id'];return db[_0x4493('0x64')]['create'](_0x100d0f[_0x4493('0x59')]);}})[_0x4493('0x1e')](respondWithResult(_0x3ef378,null))[_0x4493('0x54')](handleError(_0x3ef378,null));};exports[_0x4493('0x65')]=function(_0x9c0fb5,_0x11a3e3,_0x114f87){var _0x5cbd6c={'raw':![],'where':{}};var _0x5abfd4={};var _0x27ddf0={'count':0x0,'rows':[]};return db[_0x4493('0x3f')]['findOne']({'where':{'id':_0x9c0fb5[_0x4493('0x60')]['id']}})[_0x4493('0x1e')](handleEntityNotFound(_0x11a3e3,null))[_0x4493('0x1e')](function(_0x3c4b72){if(_0x3c4b72){_0x5abfd4[_0x4493('0x47')]=_[_0x4493('0x44')](db[_0x4493('0x64')]['rawAttributes']);_0x5abfd4[_0x4493('0x43')]=_[_0x4493('0x44')](_0x9c0fb5[_0x4493('0x43')]);_0x5abfd4['filters']=_[_0x4493('0x46')](_0x5abfd4['model'],_0x5abfd4[_0x4493('0x43')]);_0x5cbd6c[_0x4493('0x48')]=_[_0x4493('0x46')](_0x5abfd4[_0x4493('0x47')],qs[_0x4493('0x49')](_0x9c0fb5['query'][_0x4493('0x49')]));_0x5cbd6c['attributes']=_0x5cbd6c['attributes'][_0x4493('0x4a')]?_0x5cbd6c[_0x4493('0x48')]:_0x5abfd4[_0x4493('0x47')];if(!_0x9c0fb5['query']['hasOwnProperty'](_0x4493('0x4c'))){_0x5cbd6c[_0x4493('0x2e')]=qs['limit'](_0x9c0fb5[_0x4493('0x43')][_0x4493('0x2e')]);_0x5cbd6c['offset']=qs[_0x4493('0x2c')](_0x9c0fb5[_0x4493('0x43')]['offset']);}_0x5cbd6c[_0x4493('0x66')]=qs[_0x4493('0x4d')](_0x9c0fb5['query'][_0x4493('0x4d')]);_0x5cbd6c[_0x4493('0x4f')]=qs['filters'](_[_0x4493('0x67')](_0x9c0fb5[_0x4493('0x43')],_0x5abfd4[_0x4493('0x45')]));_0x5cbd6c[_0x4493('0x4f')][_0x4493('0x63')]=_0x3c4b72['id'];if(_0x9c0fb5[_0x4493('0x43')][_0x4493('0x4e')]){_0x5cbd6c[_0x4493('0x4f')]=_['merge'](_0x5cbd6c[_0x4493('0x4f')],{'$or':_['map'](_0x5cbd6c['attributes'],function(_0x1bd4bb){var _0x30f574={};_0x30f574[_0x1bd4bb]={'$like':'%'+_0x9c0fb5[_0x4493('0x43')][_0x4493('0x4e')]+'%'};return _0x30f574;})});}_0x5cbd6c=_[_0x4493('0x50')]({},_0x5cbd6c,_0x9c0fb5['options']);return db[_0x4493('0x64')][_0x4493('0x2d')]({'where':_0x5cbd6c[_0x4493('0x4f')]})[_0x4493('0x1e')](function(_0x582961){_0x27ddf0[_0x4493('0x2d')]=_0x582961;if(_0x9c0fb5[_0x4493('0x43')][_0x4493('0x52')]){_0x5cbd6c[_0x4493('0x68')]=[{'all':!![]}];}return db[_0x4493('0x64')][_0x4493('0x69')](_0x5cbd6c);})[_0x4493('0x1e')](function(_0x74c4){_0x27ddf0[_0x4493('0x53')]=_0x74c4;return _0x27ddf0;});}})[_0x4493('0x1e')](respondWithFilteredResult(_0x11a3e3,_0x5cbd6c))[_0x4493('0x54')](handleError(_0x11a3e3,null));};exports[_0x4493('0x6a')]=function(_0x1eec00,_0x18c25b,_0xcc3f49){return db[_0x4493('0x3f')][_0x4493('0x5d')]({'where':{'id':_0x1eec00['params']['id']}})[_0x4493('0x1e')](handleEntityNotFound(_0x18c25b,null))[_0x4493('0x1e')](function(_0x1699ab){if(_0x1699ab){return _0x1699ab['removeDispositions'](_0x1eec00['query'][_0x4493('0x6b')]);}})['then'](respondWithStatusCode(_0x18c25b,null))['catch'](handleError(_0x18c25b,null));};exports[_0x4493('0x6c')]=function(_0x1e7002,_0x2d0d84,_0xc31872){if(_0x1e7002['body']['id']){delete _0x1e7002[_0x4493('0x59')]['id'];}return db[_0x4493('0x3f')]['find']({'where':{'id':_0x1e7002[_0x4493('0x60')]['id']}})['then'](handleEntityNotFound(_0x2d0d84,null))['then'](function(_0x4913a9){if(_0x4913a9){_0x1e7002['body'][_0x4493('0x63')]=_0x4913a9['id'];return db['CannedAnswer']['create'](_0x1e7002[_0x4493('0x59')]);}})[_0x4493('0x1e')](respondWithResult(_0x2d0d84,null))[_0x4493('0x54')](handleError(_0x2d0d84,null));};exports[_0x4493('0x6d')]=function(_0x42f851,_0x209c42,_0x417d30){var _0xc77914={'raw':![],'where':{}};var _0x2d9c9b={};var _0x31e291={'count':0x0,'rows':[]};return db[_0x4493('0x3f')][_0x4493('0x6e')]({'where':{'id':_0x42f851[_0x4493('0x60')]['id']}})[_0x4493('0x1e')](handleEntityNotFound(_0x209c42,null))[_0x4493('0x1e')](function(_0x140fc2){if(_0x140fc2){_0x2d9c9b[_0x4493('0x47')]=_[_0x4493('0x44')](db[_0x4493('0x6f')]['rawAttributes']);_0x2d9c9b[_0x4493('0x43')]=_[_0x4493('0x44')](_0x42f851[_0x4493('0x43')]);_0x2d9c9b['filters']=_[_0x4493('0x46')](_0x2d9c9b[_0x4493('0x47')],_0x2d9c9b[_0x4493('0x43')]);_0xc77914[_0x4493('0x48')]=_[_0x4493('0x46')](_0x2d9c9b['model'],qs[_0x4493('0x49')](_0x42f851[_0x4493('0x43')]['fields']));_0xc77914[_0x4493('0x48')]=_0xc77914[_0x4493('0x48')][_0x4493('0x4a')]?_0xc77914[_0x4493('0x48')]:_0x2d9c9b['model'];if(!_0x42f851['query'][_0x4493('0x4b')](_0x4493('0x4c'))){_0xc77914[_0x4493('0x2e')]=qs[_0x4493('0x2e')](_0x42f851['query'][_0x4493('0x2e')]);_0xc77914[_0x4493('0x2c')]=qs[_0x4493('0x2c')](_0x42f851[_0x4493('0x43')][_0x4493('0x2c')]);}_0xc77914['order']=qs[_0x4493('0x4d')](_0x42f851['query'][_0x4493('0x4d')]);_0xc77914[_0x4493('0x4f')]=qs[_0x4493('0x45')](_[_0x4493('0x67')](_0x42f851[_0x4493('0x43')],_0x2d9c9b[_0x4493('0x45')]));_0xc77914[_0x4493('0x4f')][_0x4493('0x63')]=_0x140fc2['id'];if(_0x42f851[_0x4493('0x43')][_0x4493('0x4e')]){_0xc77914[_0x4493('0x4f')]=_['merge'](_0xc77914[_0x4493('0x4f')],{'$or':_[_0x4493('0x3e')](_0xc77914[_0x4493('0x48')],function(_0x3b9f9b){var _0x50fcb4={};_0x50fcb4[_0x3b9f9b]={'$like':'%'+_0x42f851['query'][_0x4493('0x4e')]+'%'};return _0x50fcb4;})});}_0xc77914=_[_0x4493('0x50')]({},_0xc77914,_0x42f851[_0x4493('0x57')]);return db[_0x4493('0x6f')][_0x4493('0x2d')]({'where':_0xc77914[_0x4493('0x4f')]})[_0x4493('0x1e')](function(_0x523094){_0x31e291[_0x4493('0x2d')]=_0x523094;if(_0x42f851[_0x4493('0x43')][_0x4493('0x52')]){_0xc77914[_0x4493('0x68')]=[{'all':!![]}];}return db[_0x4493('0x6f')][_0x4493('0x69')](_0xc77914);})[_0x4493('0x1e')](function(_0x2d5920){_0x31e291[_0x4493('0x53')]=_0x2d5920;return _0x31e291;});}})[_0x4493('0x1e')](respondWithFilteredResult(_0x209c42,_0xc77914))[_0x4493('0x54')](handleError(_0x209c42,null));};exports[_0x4493('0x70')]=function(_0xf8012e,_0x3d88b9,_0x1665cf){return db[_0x4493('0x3f')]['find']({'where':{'id':_0xf8012e[_0x4493('0x60')]['id']}})[_0x4493('0x1e')](handleEntityNotFound(_0x3d88b9,null))[_0x4493('0x1e')](function(_0x3245f1){if(_0x3245f1){return _0x3245f1[_0x4493('0x70')](_0xf8012e['query'][_0x4493('0x6b')]);}})['then'](respondWithStatusCode(_0x3d88b9,null))[_0x4493('0x54')](handleError(_0x3d88b9,null));};exports[_0x4493('0x71')]=function(_0x124086,_0x510f96,_0x207c36){_0x124086[_0x4493('0x59')][_0x4493('0x72')]=_0x124086[_0x4493('0x73')][_0x4493('0x74')];return db[_0x4493('0x3f')][_0x4493('0x5d')]({'where':{'id':_0x124086[_0x4493('0x60')]['id']}})['then'](handleEntityNotFound(_0x510f96,null))[_0x4493('0x1e')](saveUpdates(_0x124086[_0x4493('0x59')],null))[_0x4493('0x1e')](respondWithResult(_0x510f96,null))[_0x4493('0x54')](handleError(_0x510f96,null));};exports[_0x4493('0x75')]=function(_0x5e8916,_0x426fd9,_0x59094e){_0x5e8916['body']['agentAvatar']=_0x5e8916[_0x4493('0x73')][_0x4493('0x74')];return db[_0x4493('0x3f')][_0x4493('0x5d')]({'where':{'id':_0x5e8916[_0x4493('0x60')]['id']}})[_0x4493('0x1e')](handleEntityNotFound(_0x426fd9,null))[_0x4493('0x1e')](saveUpdates(_0x5e8916[_0x4493('0x59')],null))['then'](respondWithResult(_0x426fd9,null))[_0x4493('0x54')](handleError(_0x426fd9,null));};exports[_0x4493('0x76')]=function(_0x359305,_0x300060,_0xc066d1){_0x359305['body']['customerAvatar']=_0x359305[_0x4493('0x73')][_0x4493('0x74')];return db['ChatWebsite'][_0x4493('0x5d')]({'where':{'id':_0x359305[_0x4493('0x60')]['id']}})[_0x4493('0x1e')](handleEntityNotFound(_0x300060,null))[_0x4493('0x1e')](saveUpdates(_0x359305[_0x4493('0x59')],null))['then'](respondWithResult(_0x300060,null))['catch'](handleError(_0x300060,null));};exports[_0x4493('0x77')]=function(_0x1e8ec0,_0xd3bfff,_0x4f6405){_0x1e8ec0['body'][_0x4493('0x78')]=_0x1e8ec0['file'][_0x4493('0x74')];return db[_0x4493('0x3f')][_0x4493('0x5d')]({'where':{'id':_0x1e8ec0[_0x4493('0x60')]['id']}})['then'](handleEntityNotFound(_0xd3bfff,null))[_0x4493('0x1e')](saveUpdates(_0x1e8ec0[_0x4493('0x59')],null))[_0x4493('0x1e')](respondWithResult(_0xd3bfff,null))[_0x4493('0x54')](handleError(_0xd3bfff,null));};exports[_0x4493('0x79')]=function(_0x2c0906,_0x202bc7,_0x59fabe){var _0x54e2b9=path[_0x4493('0x7a')](config['root'],'server/files/images/logos/default_logo.svg');var _0x13c876={'where':{'id':_0x2c0906['params']['id']},'attributes':['id',_0x4493('0x72')],'raw':!![]};var _0x2a4b9c=![];return require(_0x4493('0x13'))[_0x4493('0x7b')]()[_0x4493('0x1e')](function(_0x49b464){if(_0x49b464){_0x2a4b9c=_0x49b464[_0x4493('0x7c')];}})[_0x4493('0x1e')](function(){return db[_0x4493('0x3f')][_0x4493('0x5d')](_0x13c876);})[_0x4493('0x1e')](handleEntityNotFound(_0x202bc7,null))['then'](function(_0x5696d5){if(_0x5696d5){if(!_[_0x4493('0x7d')](_0x5696d5[_0x4493('0x72')])){if(fs[_0x4493('0x7e')](path[_0x4493('0x7a')](config[_0x4493('0x7f')],'server/files/images/logos/',_0x5696d5[_0x4493('0x72')]))&&_0x2a4b9c){_0x54e2b9=path[_0x4493('0x7a')](config[_0x4493('0x7f')],'server/files/images/logos/',_0x5696d5['sitepic']);}}return _0x202bc7['download'](_0x54e2b9);}})[_0x4493('0x54')](handleError(_0x202bc7,null));};exports[_0x4493('0x80')]=function(_0x106dc9,_0x1a27c3,_0x1f4e6a){var _0x407433=path['join'](config[_0x4493('0x7f')],'server/files/images/avatars/default_avatar.png');var _0x31d603={'where':{'id':_0x106dc9['params']['id']},'attributes':['id',_0x4493('0x81')],'raw':!![]};return db[_0x4493('0x3f')][_0x4493('0x5d')](_0x31d603)[_0x4493('0x1e')](handleEntityNotFound(_0x1a27c3,null))[_0x4493('0x1e')](function(_0x55153b){if(_0x55153b){if(!_[_0x4493('0x7d')](_0x55153b['agentAvatar'])){if(fs[_0x4493('0x7e')](path[_0x4493('0x7a')](config[_0x4493('0x7f')],_0x4493('0x82'),_0x55153b[_0x4493('0x81')]))){_0x407433=path[_0x4493('0x7a')](config[_0x4493('0x7f')],_0x4493('0x82'),_0x55153b[_0x4493('0x81')]);}}return _0x1a27c3[_0x4493('0x83')](_0x407433);}})['catch'](handleError(_0x1a27c3,null));};exports[_0x4493('0x84')]=function(_0x3b26d6,_0x566f95,_0x56e427){var _0x267dfc=path['join'](config['root'],_0x4493('0x85'));var _0x4d0e97={'where':{'id':_0x3b26d6[_0x4493('0x60')]['id']},'attributes':['id',_0x4493('0x86'),_0x4493('0x87')],'raw':!![]};return db['ChatWebsite'][_0x4493('0x5d')](_0x4d0e97)[_0x4493('0x1e')](handleEntityNotFound(_0x566f95,null))[_0x4493('0x1e')](function(_0x30f0c1){if(_0x30f0c1){if(!_[_0x4493('0x7d')](_0x30f0c1['customerAvatar'])){if(fs[_0x4493('0x7e')](path[_0x4493('0x7a')](config[_0x4493('0x7f')],_0x4493('0x82'),_0x30f0c1['customerAvatar']))&&_0x30f0c1[_0x4493('0x87')]){_0x267dfc=path[_0x4493('0x7a')](config['root'],'server/files/images/avatars/',_0x30f0c1['customerAvatar']);}}return _0x566f95[_0x4493('0x83')](_0x267dfc);}})['catch'](handleError(_0x566f95,null));};exports[_0x4493('0x88')]=function(_0x512c81,_0x439980,_0x2ba6c5){var _0x2810be=path[_0x4493('0x7a')](config[_0x4493('0x7f')],'server/files/images/avatars/system_avatar.png');var _0x2feb15={'where':{'id':_0x512c81[_0x4493('0x60')]['id']},'attributes':['id',_0x4493('0x78')],'raw':!![]};return db[_0x4493('0x3f')][_0x4493('0x5d')](_0x2feb15)[_0x4493('0x1e')](handleEntityNotFound(_0x439980,null))[_0x4493('0x1e')](function(_0x4a1604){if(_0x4a1604){if(!_[_0x4493('0x7d')](_0x4a1604['systemAvatar'])){if(fs[_0x4493('0x7e')](path['join'](config[_0x4493('0x7f')],_0x4493('0x82'),_0x4a1604['systemAvatar']))){_0x2810be=path[_0x4493('0x7a')](config[_0x4493('0x7f')],_0x4493('0x82'),_0x4a1604[_0x4493('0x78')]);}}return _0x439980[_0x4493('0x83')](_0x2810be);}})[_0x4493('0x54')](handleError(_0x439980,null));};exports[_0x4493('0x89')]=function(_0x35998b,_0x2f2481,_0x405737){var _0x850445=require(_0x4493('0x8a'));var _0x4e1d70=new _0x850445();var _0x1f532d=_0x4e1d70[_0x4493('0x8b')](_0x35998b['headers'][_0x4493('0x8c')])[_0x4493('0x8d')]();var _0x49711c={'body':_0x35998b[_0x4493('0x59')],'channel':'chat'};var _0x51d4e7=[];var _0x29ba78=[];var _0x3c907c={};var _0x4f41cf=![];return db[_0x4493('0x8e')][_0x4493('0x61')]()[_0x4493('0x1e')](function(_0x1ec2ae){if(!_0x1ec2ae){throw new db['Sequelize'][(_0x4493('0x8f'))](_0x4493('0x90'));}_0x51d4e7=_[_0x4493('0x91')](_[_0x4493('0x44')](_0x1ec2ae),[_0x4493('0x92'),_0x4493('0x93')]);_0x29ba78=_['difference'](_[_0x4493('0x44')](_0x1ec2ae),[_0x4493('0x92'),_0x4493('0x93'),_0x4493('0x94'),'ListId']);if(_0x35998b['body']['id']){delete _0x35998b[_0x4493('0x59')]['id'];}if(_[_0x4493('0x7d')](_0x35998b[_0x4493('0x59')]['from'])){throw new db[(_0x4493('0x95'))][(_0x4493('0x8f'))](_0x4493('0x96'));}if(_['isNil'](_0x35998b[_0x4493('0x59')][_0x4493('0x59')])||_0x35998b[_0x4493('0x59')][_0x4493('0x59')]===''){throw new db[(_0x4493('0x95'))][(_0x4493('0x8f'))](_0x4493('0x97'));}if(_['isNil'](_0x35998b[_0x4493('0x59')][_0x4493('0x98')])){throw new db['Sequelize'][(_0x4493('0x8f'))](_0x4493('0x99')+_0x29ba78);}if(!_[_0x4493('0x9a')](_0x29ba78,_0x35998b[_0x4493('0x59')][_0x4493('0x98')])){throw new db[(_0x4493('0x95'))][(_0x4493('0x8f'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x29ba78);}_0x3c907c[_0x35998b['body'][_0x4493('0x98')]]=_0x35998b[_0x4493('0x59')]['from'];})[_0x4493('0x1e')](function(){return db[_0x4493('0x3f')][_0x4493('0x5d')]({'where':{'id':_0x35998b[_0x4493('0x60')]['id']},'include':[{'model':db[_0x4493('0x9b')],'as':'List','include':[{'model':db['CmContact'],'as':_0x4493('0x9c'),'where':_0x3c907c,'limit':0x1,'order':[[_0x4493('0x93'),_0x4493('0x9d')]]}]},{'model':db[_0x4493('0x9e')],'as':_0x4493('0x9f')}]});})[_0x4493('0x1e')](handleEntityNotFound(_0x2f2481,null))[_0x4493('0x1e')](function(_0xdd4371){if(_0xdd4371&&_0xdd4371[_0x4493('0xa0')]){_0x49711c[_0x4493('0xa1')]=_0xdd4371;_0x49711c['applications']=_0xdd4371[_0x4493('0x9f')];_0x49711c[_0x4493('0xa2')]=_0xdd4371[_0x4493('0xa0')];_0x49711c[_0x4493('0xa3')]=_['orderBy'](_0x49711c[_0x4493('0xa3')],[_0x4493('0xa4')],[_0x4493('0xa5')]);if(_0x49711c[_0x4493('0xa1')]['Applications']){delete _0x49711c[_0x4493('0xa1')]['Applications'];}if(_0x49711c[_0x4493('0xa1')][_0x4493('0xa0')]&&_0x49711c[_0x4493('0xa1')]['List'][_0x4493('0x9c')][_0x4493('0x4a')]){return _0x49711c[_0x4493('0xa1')][_0x4493('0xa0')][_0x4493('0x9c')][0x0];}var _0x3d941a=_['defaults'](_0x35998b[_0x4493('0x59')],{'firstName':_0x35998b[_0x4493('0x59')]['from'],'ListId':_0xdd4371[_0x4493('0xa6')]});_0x3d941a[_0x35998b[_0x4493('0x59')][_0x4493('0x98')]]=_0x35998b[_0x4493('0x59')]['from'];return db[_0x4493('0x8e')][_0x4493('0x58')](_0x3d941a,{'fields':_0x51d4e7,'raw':!![]});}})[_0x4493('0x1e')](handleEntityNotFound(_0x2f2481,null))[_0x4493('0x1e')](function(_0x4b4b86){_0x49711c[_0x4493('0xa7')]=_0x4b4b86;var _0x481857=_0x35998b[_0x4493('0x59')]['customerIp'];if(_0x35998b[_0x4493('0xa8')][_0x4493('0xa9')]){_0x481857=_0x35998b[_0x4493('0xa8')][_0x4493('0xa9')];}else if(_0x35998b[_0x4493('0xa8')][_0x4493('0xaa')]){_0x481857=_[_0x4493('0xab')](_0x35998b['headers'][_0x4493('0xaa')][_0x4493('0xac')](','));}if(_0x4b4b86){var _0x59b35c={'ContactId':_0x4b4b86['id'],'ChatWebsiteId':_0x35998b[_0x4493('0x60')]['id'],'from':(_0x4b4b86[_0x4493('0xad')]||'')+'\x20'+(_0x4b4b86[_0x4493('0xae')]||''),'customerIp':_0x481857,'customerPort':_0x35998b[_0x4493('0xa8')][_0x4493('0xaf')]?_0x35998b[_0x4493('0xa8')]['x-real-port']:null,'referer':_0x35998b[_0x4493('0x59')][_0x4493('0xb0')],'browserName':_0x1f532d[_0x4493('0xb1')][_0x4493('0x3a')]&&_0x1f532d[_0x4493('0xb1')][_0x4493('0xb2')]?util['format']('%s\x20%s',_0x1f532d[_0x4493('0xb1')][_0x4493('0x3a')],_0x1f532d[_0x4493('0xb1')][_0x4493('0xb2')]):'unknown','browserVersion':_0x1f532d[_0x4493('0xb1')][_0x4493('0xb2')]||_0x4493('0xb3'),'osName':util[_0x4493('0xb4')]('%s\x20%s',_0x1f532d['os'][_0x4493('0x3a')],_0x1f532d['os'][_0x4493('0xb2')]),'osVersion':_0x1f532d['os']['version'],'deviceModel':_0x1f532d[_0x4493('0xb5')][_0x4493('0x47')]&&_0x1f532d[_0x4493('0xb5')][_0x4493('0xb6')]?util[_0x4493('0xb4')](_0x4493('0xb7'),_0x1f532d[_0x4493('0xb5')][_0x4493('0x47')],_0x1f532d[_0x4493('0xb5')][_0x4493('0xb6')],_0x1f532d[_0x4493('0xb5')][_0x4493('0x41')]):null,'deviceVendor':_0x1f532d[_0x4493('0xb5')][_0x4493('0xb6')],'deviceType':_0x1f532d[_0x4493('0xb5')]['type'],'formData':JSON[_0x4493('0x24')](_0x35998b[_0x4493('0x59')])};var _0x26cc61={'ChatWebsiteId':_0x35998b[_0x4493('0x60')]['id'],'closed':![]};if(_0x35998b['body'][_0x4493('0xb8')]){_0x26cc61[_0x4493('0xb8')]=_0x35998b[_0x4493('0x59')]['threadId'];return db['ChatInteraction'][_0x4493('0x5d')]({'where':_0x26cc61})[_0x4493('0x1e')](function(_0x59a318){if(_0x59a318){return[_0x59a318,![]];}_0x59b35c['threadId']=_0x35998b[_0x4493('0x59')][_0x4493('0xb8')];_0x59b35c[_0x4493('0xb9')]=_0x35998b[_0x4493('0x59')]['externalUrl'];return db['ChatInteraction'][_0x4493('0x58')](_0x59b35c)[_0x4493('0x1e')](function(_0x3de2d8){return[_0x3de2d8,!![]];});});}_0x26cc61[_0x4493('0xba')]=_0x4b4b86['id'];if(_0x35998b['body'][_0x4493('0xbb')]&&_0x35998b[_0x4493('0x59')][_0x4493('0xbb')]['id']){_0x26cc61['id']=_0x35998b[_0x4493('0x59')][_0x4493('0xbb')]['id'];return db['ChatInteraction']['find']({'where':_0x26cc61})[_0x4493('0x1e')](function(_0x1a3b43){if(_0x1a3b43){return[_0x1a3b43,![]];}return db[_0x4493('0xbc')][_0x4493('0x58')](_0x59b35c)[_0x4493('0x1e')](function(_0x5298dd){return[_0x5298dd,!![]];});});}return db['ChatInteraction'][_0x4493('0x58')](_0x59b35c)['then'](function(_0x5ed383){return[_0x5ed383,!![]];});}})[_0x4493('0xbd')](function(_0x29ddd9,_0x2c1219){if(_0x29ddd9){_0x4f41cf=_0x2c1219;if(!_0x2c1219){var _0x11f85f={'from':(_0x49711c[_0x4493('0xa7')][_0x4493('0xad')]||'')+'\x20'+(_0x49711c[_0x4493('0xa7')][_0x4493('0xae')]||'')};if(_0x35998b[_0x4493('0x59')][_0x4493('0xb8')]&&_0x35998b['body'][_0x4493('0xbe')]&&_0x35998b[_0x4493('0x59')][_0x4493('0xb8')]!=_0x35998b[_0x4493('0x59')][_0x4493('0xbe')]){_0x11f85f[_0x4493('0xb8')]=_0x35998b[_0x4493('0x59')]['messageId'];}return _0x29ddd9['update'](_0x11f85f);}else{return _0x29ddd9;}}})[_0x4493('0x1e')](function(_0x1709f7){_0x49711c[_0x4493('0xbb')]=_0x1709f7[_0x4493('0x35')]({'plain':!![]});_0x49711c['interaction']['created']=_0x4f41cf;if(_0x49711c[_0x4493('0xbb')]['created']){if(_0x49711c['account'][_0x4493('0xbf')]){_0x49711c[_0x4493('0xa3')][_0x4493('0xc0')]({'id':0x0,'priority':_0x49711c[_0x4493('0xa3')]['length']+0x1,'app':_0x4493('0xc1'),'appdata':_0x4493('0xc2'),'interval':_0x4493('0xc3')});}}return db[_0x4493('0xc4')]['create']({'body':_0x35998b[_0x4493('0x59')][_0x4493('0x59')],'ChatWebsiteId':_0x35998b['params']['id'],'ChatInteractionId':_0x1709f7['id'],'direction':'in','ContactId':_0x49711c[_0x4493('0xa7')]['id'],'AttachmentId':_0x35998b[_0x4493('0x59')][_0x4493('0xc5')]});})[_0x4493('0x1e')](function(_0x3a9481){_0x49711c[_0x4493('0x26')]=_0x3a9481;if(_0x49711c[_0x4493('0xbb')][_0x4493('0xc6')]){return db['User'][_0x4493('0x5d')]({'attributes':['id',_0x4493('0x3a')],'where':{'id':_0x49711c['interaction'][_0x4493('0xc6')]}})[_0x4493('0x1e')](function(_0x51b21f){if(_0x51b21f){_0x49711c[_0x4493('0xa3')][_0x4493('0xc7')]({'id':0x0,'priority':0x0,'app':_0x4493('0xc8'),'appdata':_0x51b21f[_0x4493('0x3a')]+','+(_0x49711c['account'][_0x4493('0xc9')]||0xa),'interval':_0x4493('0xc3')});_0x49711c[_0x4493('0xca')]=!![];}return respondWithRpcPromise(_0x4493('0xcb'),_0x4493('0xcc'),_0x49711c);});}return respondWithRpcPromise(_0x4493('0xcb'),_0x4493('0xcc'),_0x49711c);})[_0x4493('0x1e')](function(_0xe1aa75){respondWithRpcPromise(_0x4493('0xcd'),_0x4493('0xcd'),{'event':'notify','message':_0xe1aa75},client9002);return _0xe1aa75;})[_0x4493('0x1e')](respondWithResult(_0x2f2481,null))[_0x4493('0x54')](handleError(_0x2f2481,null));};exports[_0x4493('0xce')]=function(_0x445dd3,_0x298d63,_0x543c8f){var _0x11c0ac,_0x198fb8,_0xdefe99;var _0x129d00=[];var _0x569478=[];var _0xbd85f7={};var _0x55dcb8=_0x445dd3[_0x4493('0xcf')]||[];var _0x3b86ca=[];var _0x2a4431;return db[_0x4493('0x8e')][_0x4493('0x61')]()['then'](function(_0xf551cd){if(!_0xf551cd){throw new db[(_0x4493('0x95'))][(_0x4493('0x8f'))]('no\x20available\x20attributes');}_0x569478=_[_0x4493('0x91')](_[_0x4493('0x44')](_0xf551cd),[_0x4493('0x92'),_0x4493('0x93')]);_0x129d00=_['difference'](_[_0x4493('0x44')](_0xf551cd),[_0x4493('0x92'),_0x4493('0x93'),'CompanyId',_0x4493('0xa6')]);if(_0x445dd3[_0x4493('0x59')]['id']){delete _0x445dd3[_0x4493('0x59')]['id'];}if(_[_0x4493('0x7d')](_0x445dd3[_0x4493('0x59')][_0x4493('0xd0')])){throw _0x298d63[_0x4493('0x28')](0x1f4)[_0x4493('0xd1')](new db['Sequelize'][(_0x4493('0x8f'))]('from\x20is\x20mandatory'));}if(_[_0x4493('0x7d')](_0x445dd3[_0x4493('0x59')][_0x4493('0x59')])||_0x445dd3[_0x4493('0x59')]['body']===''){throw _0x298d63[_0x4493('0x28')](0x1f4)['send'](new db[(_0x4493('0x95'))][(_0x4493('0x8f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x4493('0x7d')](_0x445dd3['body']['mapKeyOffline'])){throw _0x298d63[_0x4493('0x28')](0x1f4)['send'](new db[(_0x4493('0x95'))][(_0x4493('0x8f'))](_0x4493('0xd2')+_0x129d00));}if(!_['includes'](_0x129d00,_0x445dd3['body']['mapKeyOffline'])){throw _0x298d63[_0x4493('0x28')](0x1f4)[_0x4493('0xd1')](new db[(_0x4493('0x95'))][(_0x4493('0x8f'))](_0x4493('0xd3')+_0x129d00));}_0xbd85f7[_0x445dd3['body'][_0x4493('0xd4')]]=_0x445dd3[_0x4493('0x59')]['from'];})['then'](function(){return db[_0x4493('0x3f')][_0x4493('0x5d')]({'where':{'id':_0x445dd3['params']['id']},'include':[{'model':db[_0x4493('0x9b')],'as':_0x4493('0xa0')},{'model':db[_0x4493('0xd5')],'as':'MailAccount'}]});})[_0x4493('0x1e')](handleEntityNotFound(_0x298d63,null))[_0x4493('0x1e')](function(_0x486e01){if(_0x486e01&&_0x486e01[_0x4493('0xa0')]){_0x198fb8=_0x486e01;var _0x5a30ce=_[_0x4493('0x16')](_0x445dd3[_0x4493('0x59')],{'firstName':_0x445dd3['body']['from'],'phone':_0x445dd3['body'][_0x4493('0xd0')],'ListId':_0x486e01[_0x4493('0xa6')]});_0x5a30ce[_0x445dd3[_0x4493('0x59')][_0x4493('0xd4')]]=_0x445dd3['body'][_0x4493('0xd0')];return db[_0x4493('0x8e')][_0x4493('0xd6')]({'where':_0xbd85f7,'defaults':_0x5a30ce});}})[_0x4493('0xbd')](function(_0x283af0){if(_0x283af0){_0xdefe99=_0x283af0;var _0x44eb33=fs['readFileSync'](path[_0x4493('0x7a')](config[_0x4493('0x7f')],_0x4493('0xd7')),'utf8');var _0x563b43=ejs['render'](_0x44eb33,{'body':_[_0x4493('0xd8')](_0x445dd3[_0x4493('0x59')]['body']),'bodyTitle':_0x198fb8[_0x4493('0xd9')]});return db['ChatOfflineMessage'][_0x4493('0x58')]({'body':_0x563b43,'ContactId':_0x283af0['id'],'ChatWebsiteId':_0x198fb8['id']});}})[_0x4493('0x1e')](function(_0x20f2b1){_0x2a4431=_0x20f2b1;if(_0x55dcb8[_0x4493('0x4a')]){var _0x35d343=_0x55dcb8[_0x4493('0x3e')](function(_0x2b819b){return{'name':_0x2b819b[_0x4493('0xda')],'basename':_0x2b819b[_0x4493('0x74')],'type':_0x2b819b[_0x4493('0xdb')],'ChatOfflineMessageId':_0x20f2b1['id']};});_0x3b86ca=_0x35d343[_0x4493('0x3e')](_0x259a80=>{var _0x534ced={'filename':_0x259a80['name'],'path':path['join'](config['root'],_0x4493('0xdc'),_0x4493('0xcf'),_0x4493('0xdd'),_0x4493('0xde'),_0x259a80['basename'])};return _0x534ced;});if(!_0x198fb8[_0x4493('0xdf')]){return db['sequelize'][_0x4493('0xe0')](function(_0x140ca0){return db[_0x4493('0xe1')]['bulkCreate'](_0x35d343,{'transaction':_0x140ca0});});}}})[_0x4493('0x1e')](function(){if(_0x2a4431){_0x11c0ac=_0x2a4431;return db['MailAccount']['findOne']({'where':{'active':!![]},'include':[{'model':db[_0x4493('0xe2')],'as':_0x4493('0xe3'),'raw':!![]}]});}})['then'](function(_0x49e113){if(_0x49e113&&_0x49e113[_0x4493('0xe3')]&&_0x198fb8['forwardOffline']&&_0x198fb8[_0x4493('0xe4')]){var _0x2c390a={'tls':{'rejectUnauthorized':![]}};if(_0x49e113[_0x4493('0xe3')][_0x4493('0xe5')]){_0x2c390a['service']=_0x49e113[_0x4493('0xe3')]['service'];}else{_0x2c390a[_0x4493('0xe6')]=_0x49e113[_0x4493('0xe3')][_0x4493('0xe6')];_0x2c390a['port']=_0x49e113[_0x4493('0xe3')][_0x4493('0xe7')];_0x2c390a['secure']=_0x49e113[_0x4493('0xe3')][_0x4493('0xe8')];}if(_0x49e113[_0x4493('0xe3')][_0x4493('0xe9')]){_0x2c390a['auth']={'user':_0x49e113[_0x4493('0xe3')][_0x4493('0x5a')],'pass':_0x49e113[_0x4493('0xe3')][_0x4493('0xea')]};}return respondWithRpcPromise('SendMail',_0x4493('0xeb'),{'account':_0x2c390a,'message':{'from':util[_0x4493('0xb4')](_0x4493('0xec'),_0x49e113[_0x4493('0x3a')],_0x49e113[_0x4493('0xed')]||_0x49e113[_0x4493('0xe3')][_0x4493('0x5a')]),'to':_0x198fb8[_0x4493('0xe4')],'subject':_0x198fb8[_0x4493('0xee')],'html':_0x11c0ac[_0x4493('0x59')],'attachments':_0x3b86ca}},client9003)[_0x4493('0x1e')](function(){return _0x11c0ac;})[_0x4493('0x54')](function(_0x3334f4){console['error'](_0x3334f4);});}})[_0x4493('0x1e')](function(){if(_0x198fb8&&_0x198fb8[_0x4493('0xdf')]&&_0x198fb8[_0x4493('0xef')]){var _0x1e691e=[];if(_0x55dcb8[_0x4493('0x4a')]){_0x1e691e=_0x55dcb8['map'](function(_0x543a83){return{'name':_0x543a83[_0x4493('0xda')],'basename':_0x543a83['filename'],'type':_0x543a83[_0x4493('0xdb')],'ChatOfflineMessageId':_0x2a4431['id']};});}var _0x3e1b3b;if(!_[_0x4493('0x7d')](_0x198fb8[_0x4493('0xf0')])){var _0x3ac82b=_[_0x4493('0x3e')](_0x445dd3[_0x4493('0x59')],function(_0x30edb6){return _0x30edb6;});var _0x2c6bb3=_['toPairsIn'](_0x3ac82b)[0x0];var _0x39c827=_[_0x4493('0xf1')](_0x2c6bb3,function(_0x122cbd){return _0x122cbd;});_0x3e1b3b=_0x39c827[0x1][_0x198fb8[_0x4493('0xf0')]];}var _0x2a6d30={'from':_0xdefe99[_0x4493('0xed')],'firstName':_0xdefe99[_0x4493('0xad')],'lastName':_0xdefe99[_0x4493('0xae')],'mapKey':_0x4493('0xed'),'message':{'from':_0xdefe99[_0x4493('0xed')],'to':_0x198fb8['MailAccount'][_0x4493('0xed')],'cc':'','subject':_[_0x4493('0x7d')](_0x3e1b3b)?_0x198fb8[_0x4493('0xee')]:_0x3e1b3b,'messageId':'','sentAt':new Date(),'attach':_0x1e691e[_0x4493('0x4a')],'attachments':_0x1e691e,'originChannel':_0x4493('0xf2'),'ChatWebsiteId':_0x198fb8['id'],'ChatOfflineMessageId':_0x11c0ac['id'],'originTo':_0x198fb8[_0x4493('0xd5')][_0x4493('0xed')]},'body':_0x11c0ac['body']};var _0x16f937={'account':{'id':_0x198fb8[_0x4493('0xef')]},'body':_0x2a6d30,'log':_0x4493('0xf3')};return respondWithRpcPromise(_0x4493('0xf3'),_0x4493('0xf4'),_0x16f937,client9001)[_0x4493('0x1e')](function(){return _0x11c0ac;})['catch'](function(_0x4cc76c){console[_0x4493('0x25')](_0x4cc76c);});}return;})['then'](function(){if(_0x11c0ac){return _0x11c0ac;}})[_0x4493('0x1e')](respondWithResult(_0x298d63,null))[_0x4493('0x54')](function(_0x124129){console['error'](_0x4493('0x54'),_0x124129);for(var _0xaa2009 of _0x55dcb8){var _0x38364d=path[_0x4493('0x7a')](config['root'],'server','files',_0x4493('0xdd'),_0x4493('0xde'),_0xaa2009[_0x4493('0x74')]);fs_extra[_0x4493('0xf5')](_0x38364d)[_0x4493('0x54')](function(_0x344b3e){console[_0x4493('0x25')](_0x4493('0xf6'),_0x38364d,_0x344b3e);});}});};exports[_0x4493('0xf7')]=function(_0x59607c,_0x385217,_0x31013d){return db[_0x4493('0xbc')][_0x4493('0x5d')]({'where':{'id':_0x59607c[_0x4493('0x60')]['id']}})[_0x4493('0x1e')](handleEntityNotFound(_0x385217,null))[_0x4493('0x1e')](function(_0x4a77f2){if(_0x4a77f2){return _0x4a77f2[_0x4493('0xf7')](_0x59607c['body'][_0x4493('0x6b')],_['omit'](_0x59607c['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x385217,null))[_0x4493('0x54')](handleError(_0x385217,null));};exports['getInteractions']=function(_0xe1a392,_0xa7ec71,_0x927282){var _0x4d6a10={'raw':![],'where':{}};var _0x43ac95={};var _0x42adda={'count':0x0,'rows':[]};return db[_0x4493('0x3f')][_0x4493('0x6e')]({'where':{'id':_0xe1a392[_0x4493('0x60')]['id']}})[_0x4493('0x1e')](handleEntityNotFound(_0xa7ec71,null))['then'](function(_0x361056){if(_0x361056){_0x43ac95['model']=_[_0x4493('0x44')](db['ChatInteraction']['rawAttributes']);_0x43ac95[_0x4493('0x43')]=_[_0x4493('0x44')](_0xe1a392[_0x4493('0x43')]);_0x43ac95['filters']=_[_0x4493('0x46')](_0x43ac95['model'],_0x43ac95[_0x4493('0x43')]);_0x4d6a10[_0x4493('0x48')]=_[_0x4493('0x46')](_0x43ac95['model'],qs['fields'](_0xe1a392[_0x4493('0x43')]['fields']));_0x4d6a10[_0x4493('0x48')]=_0x4d6a10[_0x4493('0x48')]['length']?_0x4d6a10[_0x4493('0x48')]:_0x43ac95['model'];if(!_0xe1a392['query'][_0x4493('0x4b')]('nolimit')){_0x4d6a10[_0x4493('0x2e')]=qs['limit'](_0xe1a392[_0x4493('0x43')][_0x4493('0x2e')]);_0x4d6a10['offset']=qs[_0x4493('0x2c')](_0xe1a392[_0x4493('0x43')][_0x4493('0x2c')]);}_0x4d6a10[_0x4493('0x66')]=qs['sort'](_0xe1a392[_0x4493('0x43')][_0x4493('0x4d')]);_0x4d6a10[_0x4493('0x4f')]=qs[_0x4493('0x45')](_[_0x4493('0x67')](_0xe1a392[_0x4493('0x43')],_0x43ac95[_0x4493('0x45')]));_0x4d6a10[_0x4493('0x4f')][_0x4493('0x63')]=_0x361056['id'];if(_0xe1a392[_0x4493('0x43')]['filter']){_0x4d6a10['where']=_[_0x4493('0x50')](_0x4d6a10[_0x4493('0x4f')],{'$or':_['map'](_0x4d6a10['attributes'],function(_0x4cc3c8){var _0xce28cb={};_0xce28cb[_0x4cc3c8]={'$like':'%'+_0xe1a392['query'][_0x4493('0x4e')]+'%'};return _0xce28cb;})});}_0x4d6a10=_[_0x4493('0x50')]({},_0x4d6a10,_0xe1a392['options']);return db[_0x4493('0xbc')][_0x4493('0x2d')]({'where':_0x4d6a10['where']})[_0x4493('0x1e')](function(_0xa29064){_0x42adda[_0x4493('0x2d')]=_0xa29064;if(_0xe1a392['query'][_0x4493('0x52')]){_0x4d6a10[_0x4493('0x68')]=[{'model':db[_0x4493('0x8e')],'as':_0x4493('0xf8'),'required':![]},{'model':db['User'],'as':_0x4493('0xf9'),'attributes':[_0x4493('0x3a'),'fullname',_0x4493('0xfa')],'required':![]},{'model':db[_0x4493('0xfb')],'as':_0x4493('0xfc'),'attributes':['id',_0x4493('0x3a'),'color'],'where':_0xe1a392['query'][_0x4493('0xfd')]?{'id':_0xe1a392[_0x4493('0x43')][_0x4493('0xfd')]}:undefined,'required':_0xe1a392[_0x4493('0x43')][_0x4493('0xfd')]?!![]:![]}];}return db[_0x4493('0xbc')][_0x4493('0x69')](_0x4d6a10);})[_0x4493('0x1e')](function(_0x3ebfe3){_0x42adda['rows']=_0x3ebfe3;return _0x42adda;});}})['then'](respondWithFilteredResult(_0xa7ec71,_0x4d6a10))['catch'](handleError(_0xa7ec71,null));};function iftimePromise(_0x10f636,_0x1ac14d){return respondWithRpcPromise(_0x4493('0xfe'),_0x4493('0xff'),{'command':_0x1ac14d[_0x4493('0x100')]?util['format'](_0x4493('0x101'),_0x10f636[_0x4493('0x102')],_0x1ac14d[_0x4493('0x100')]):util[_0x4493('0xb4')]('iftime\x20%s',_0x10f636[_0x4493('0x102')])},client9002)[_0x4493('0x1e')](function(_0x3b4ff4){var _0x24ddb1=_0x3b4ff4&&_0x3b4ff4[_0x4493('0x103')]('true')>=0x0?!![]:![];logger['info']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x1ac14d['id'],_0x10f636['id'],_0x10f636[_0x4493('0x102')],_0x24ddb1?_0x4493('0x104'):_0x4493('0x105'),_0x1ac14d[_0x4493('0x100')]?_0x1ac14d[_0x4493('0x100')]:_0x4493('0x106'));return _0x24ddb1;})[_0x4493('0x54')](function(_0x64174a){logger[_0x4493('0x25')](_0x4493('0x107'),_0x1ac14d['id'],_0x10f636['id'],_0x10f636['interval'],util['inspect'](_0x64174a,{'showHidden':![],'depth':null}),_0x1ac14d['timezone']?_0x1ac14d['timezone']:_0x4493('0x106'));return![];});}exports[_0x4493('0xff')]=function(_0x45bb5d,_0x2044b2,_0x5d5adf){var _0x156e7e=0x0;var _0x38389c=0x0;var _0x1ec030=![];var _0x39cf94;var _0x5e3fea;return db[_0x4493('0x3f')][_0x4493('0x5d')]({'where':{'id':_0x45bb5d[_0x4493('0x60')]['id']},'include':[{'model':db[_0x4493('0x108')],'as':_0x4493('0x108'),'include':[{'model':db[_0x4493('0x108')],'as':_0x4493('0x109'),'attributes':['id',_0x4493('0x102')],'raw':!![]}]}]})[_0x4493('0x1e')](handleEntityNotFound(_0x2044b2,null))[_0x4493('0x1e')](function(_0x1bf150){if(_0x1bf150){_0x39cf94=_0x1bf150;return _0x1bf150[_0x4493('0x10a')]({'raw':!![]});}})['then'](function(_0x164bb4){if(_0x39cf94){if(_0x164bb4){_0x5e3fea=_0x164bb4;}}return require(_0x4493('0x13'))[_0x4493('0x7b')]();})['then'](function(_0x3bd387){if(_0x3bd387){_0x38389c=_0x3bd387[_0x4493('0x10b')];_0x1ec030=_0x3bd387[_0x4493('0x7c')];}})[_0x4493('0x1e')](function(){return db[_0x4493('0xbc')][_0x4493('0x2d')]({'where':{'closed':![]}});})[_0x4493('0x1e')](function(_0x21ee92){_0x156e7e=_0x21ee92;if(_0x38389c&&_0x21ee92>_0x38389c){return db['License'][_0x4493('0x6e')]({'where':{'id':0x1}})[_0x4493('0x1e')](function(_0x5d9f70){if(_0x5d9f70){_0x5d9f70['increment'](_0x4493('0x10c'));}});}})[_0x4493('0x1e')](function(){if(_0x39cf94[_0x4493('0x108')]&&_0x39cf94[_0x4493('0x108')]['Intervals']){var _0x45f490=[];for(var _0x4b7d21=0x0;_0x4b7d21<_0x39cf94[_0x4493('0x108')][_0x4493('0x109')][_0x4493('0x4a')];_0x4b7d21++){var _0x3f7faa=_0x39cf94[_0x4493('0x108')]['Intervals'][_0x4b7d21][_0x4493('0x35')]({'plain':!![]});_0x45f490[_0x4493('0xc0')](iftimePromise(_0x3f7faa,_0x39cf94));}return BPromise[_0x4493('0x10d')](_0x45f490)[_0x4493('0x1e')](function(_0xa6b66b){return _[_0x4493('0x10e')](_0xa6b66b);});}else{return!![];}})[_0x4493('0x1e')](function(_0x27dcc6){var _0x2efcb7=fs[_0x4493('0x10f')](path['join'](config[_0x4493('0x7f')],'server/files/chat/iframe.ejs'),_0x4493('0x110'));var _0x146db6={'remote':_0x39cf94['remote'],'query':querystring[_0x4493('0x24')](_[_0x4493('0x50')](_0x39cf94['get']({'plain':!![]}),{'customerIp':_0x45bb5d['headers'][_0x4493('0xaa')]||_0x45bb5d[_0x4493('0xa8')][_0x4493('0x111')]||_0x45bb5d[_0x4493('0x112')][_0x4493('0x113')]||_0x45bb5d['ip'],'referer':_0x45bb5d[_0x4493('0xa8')][_0x4493('0xb0')],'openedInteractions':_0x156e7e,'maxInteractions':_0x38389c,'virtual':_0x1ec030['virtual'],'online':_0x27dcc6,'custom':_0x1ec030}))[_0x4493('0x114')](/'/g,'\x5c\x27')};_0x2044b2[_0x4493('0xd1')](ejs[_0x4493('0x115')](Mustache['render'](_0x2efcb7,_0x146db6),{'proactiveActions':_0x5e3fea,'alignment':_0x39cf94['alignment'],'verticalAlignment':_0x39cf94['verticalAlignment'],'div_color':_0x39cf94[_0x4493('0x116')],'text_color':_0x39cf94[_0x4493('0x117')],'button_color':_0x39cf94['color_button'],'background_color':_0x39cf94['backgroundColor']}));})[_0x4493('0x54')](handleError(_0x2044b2,null));};exports[_0x4493('0x118')]=function(_0x35d42b,_0x302a0b,_0x4846b2){return db[_0x4493('0x3f')][_0x4493('0x6e')]({'where':{'id':_0x35d42b[_0x4493('0x60')]['id']}})['then'](handleEntityNotFound(_0x302a0b,null))[_0x4493('0x1e')](function(_0x97a057){if(_0x97a057){return db['sequelize'][_0x4493('0xe0')](function(_0x21cd5c){return db['ChatApplication'][_0x4493('0x34')]({'where':{'ChatWebsiteId':_0x35d42b[_0x4493('0x60')]['id']},'transaction':_0x21cd5c})['then'](function(_0x511724){var _0x405147=_['map'](_0x35d42b[_0x4493('0x59')],function(_0x4f4967){_0x4f4967[_0x4493('0x63')]=_0x35d42b[_0x4493('0x60')]['id'];return _0x4f4967;});return db[_0x4493('0x9e')]['bulkCreate'](_0x405147,{'transaction':_0x21cd5c});});})[_0x4493('0x1e')](function(){return db[_0x4493('0x9e')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x35d42b[_0x4493('0x60')]['id']},'order':'priority'});});}})[_0x4493('0x1e')](respondWithResult(_0x302a0b,null))[_0x4493('0x54')](handleError(_0x302a0b,null));};exports[_0x4493('0x119')]=function(_0x16272f,_0xd82e53,_0x308f95){var _0x5e235f={};var _0x229d89={};var _0x46581e;var _0x183ff4;return db[_0x4493('0x3f')][_0x4493('0x6e')]({'where':{'id':_0x16272f[_0x4493('0x60')]['id']}})[_0x4493('0x1e')](handleEntityNotFound(_0xd82e53,null))[_0x4493('0x1e')](function(_0x403535){if(_0x403535){_0x46581e=_0x403535;_0x229d89[_0x4493('0x47')]=_[_0x4493('0x44')](db[_0x4493('0x9e')][_0x4493('0x56')]);_0x229d89['query']=_[_0x4493('0x44')](_0x16272f[_0x4493('0x43')]);_0x229d89[_0x4493('0x45')]=_[_0x4493('0x46')](_0x229d89['model'],_0x229d89['query']);_0x5e235f[_0x4493('0x48')]=_[_0x4493('0x46')](_0x229d89[_0x4493('0x47')],qs['fields'](_0x16272f['query'][_0x4493('0x49')]));_0x5e235f[_0x4493('0x48')]=_0x5e235f['attributes']['length']?_0x5e235f[_0x4493('0x48')]:_0x229d89[_0x4493('0x47')];_0x5e235f[_0x4493('0x66')]=qs[_0x4493('0x4d')](_0x16272f['query'][_0x4493('0x4d')]);_0x5e235f[_0x4493('0x4f')]=qs[_0x4493('0x45')](_[_0x4493('0x67')](_0x16272f['query'],_0x229d89[_0x4493('0x45')]));if(_0x16272f['query'][_0x4493('0x4e')]){_0x5e235f[_0x4493('0x4f')]=_[_0x4493('0x50')](_0x5e235f[_0x4493('0x4f')],{'$or':_[_0x4493('0x3e')](_0x5e235f[_0x4493('0x48')],function(_0x388d59){var _0x52d00e={};_0x52d00e[_0x388d59]={'$like':'%'+_0x16272f['query'][_0x4493('0x4e')]+'%'};return _0x52d00e;})});}_0x5e235f=_[_0x4493('0x50')]({},_0x5e235f,_0x16272f['options']);return _0x46581e[_0x4493('0x119')](_0x5e235f);}})[_0x4493('0x1e')](function(_0x14bc86){if(_0x14bc86){_0x183ff4=_0x14bc86[_0x4493('0x4a')];if(!_0x16272f[_0x4493('0x43')][_0x4493('0x4b')]('nolimit')){_0x5e235f[_0x4493('0x2e')]=qs[_0x4493('0x2e')](_0x16272f[_0x4493('0x43')][_0x4493('0x2e')]);_0x5e235f['offset']=qs[_0x4493('0x2c')](_0x16272f['query'][_0x4493('0x2c')]);}return _0x46581e['getApplications'](_0x5e235f);}})[_0x4493('0x1e')](function(_0x334754){if(_0x334754){return _0x334754?{'count':_0x183ff4,'rows':_0x334754}:null;}})[_0x4493('0x1e')](respondWithResult(_0xd82e53,null))[_0x4493('0x54')](handleError(_0xd82e53,null));};exports['addProactiveActions']=function(_0x30d517,_0x2c3439,_0x2930b5){return db['chatProactiveAction']['find']({'where':{'id':_0x30d517[_0x4493('0x60')]['id']}})[_0x4493('0x1e')](handleEntityNotFound(_0x2c3439,null))[_0x4493('0x1e')](function(_0x30d337){if(_0x30d337){return _0x30d337[_0x4493('0x11a')](_0x30d517[_0x4493('0x59')][_0x4493('0x6b')],_[_0x4493('0x11b')](_0x30d517['body'],['ids','id'])||{});}})[_0x4493('0x1e')](respondWithResult(_0x2c3439,null))[_0x4493('0x54')](handleError(_0x2c3439,null));};exports[_0x4493('0x10a')]=function(_0x35b30f,_0x545741,_0x5852d2){var _0xd810c6={};var _0x8ae4a0={};var _0x25d7ea;var _0x2a7add;return db[_0x4493('0x3f')][_0x4493('0x6e')]({'where':{'id':_0x35b30f[_0x4493('0x60')]['id']}})[_0x4493('0x1e')](handleEntityNotFound(_0x545741,null))[_0x4493('0x1e')](function(_0x11f92a){if(_0x11f92a){_0x25d7ea=_0x11f92a;_0x8ae4a0['model']=_[_0x4493('0x44')](db[_0x4493('0x11c')][_0x4493('0x56')]);_0x8ae4a0[_0x4493('0x43')]=_[_0x4493('0x44')](_0x35b30f[_0x4493('0x43')]);_0x8ae4a0[_0x4493('0x45')]=_[_0x4493('0x46')](_0x8ae4a0[_0x4493('0x47')],_0x8ae4a0[_0x4493('0x43')]);_0xd810c6[_0x4493('0x48')]=_[_0x4493('0x46')](_0x8ae4a0[_0x4493('0x47')],qs[_0x4493('0x49')](_0x35b30f[_0x4493('0x43')][_0x4493('0x49')]));_0xd810c6[_0x4493('0x48')]=_0xd810c6[_0x4493('0x48')]['length']?_0xd810c6['attributes']:_0x8ae4a0[_0x4493('0x47')];_0xd810c6[_0x4493('0x66')]=qs[_0x4493('0x4d')](_0x35b30f[_0x4493('0x43')][_0x4493('0x4d')]);_0xd810c6[_0x4493('0x4f')]=qs['filters'](_[_0x4493('0x67')](_0x35b30f['query'],_0x8ae4a0[_0x4493('0x45')]));if(_0x35b30f['query']['filter']){_0xd810c6[_0x4493('0x4f')]=_[_0x4493('0x50')](_0xd810c6[_0x4493('0x4f')],{'$or':_[_0x4493('0x3e')](_0xd810c6[_0x4493('0x48')],function(_0x49ae79){var _0x443164={};_0x443164[_0x49ae79]={'$like':'%'+_0x35b30f[_0x4493('0x43')]['filter']+'%'};return _0x443164;})});}_0xd810c6=_['merge']({},_0xd810c6,_0x35b30f[_0x4493('0x57')]);return _0x25d7ea[_0x4493('0x10a')](_0xd810c6);}})[_0x4493('0x1e')](function(_0x13b91f){if(_0x13b91f){_0x2a7add=_0x13b91f[_0x4493('0x4a')];if(!_0x35b30f[_0x4493('0x43')][_0x4493('0x4b')]('nolimit')){_0xd810c6['limit']=qs['limit'](_0x35b30f[_0x4493('0x43')][_0x4493('0x2e')]);_0xd810c6[_0x4493('0x2c')]=qs[_0x4493('0x2c')](_0x35b30f[_0x4493('0x43')][_0x4493('0x2c')]);}return _0x25d7ea[_0x4493('0x10a')](_0xd810c6);}})[_0x4493('0x1e')](function(_0x25c7d5){if(_0x25c7d5){return _0x25c7d5?{'count':_0x2a7add,'rows':_0x25c7d5}:null;}})['then'](respondWithResult(_0x545741,null))[_0x4493('0x54')](handleError(_0x545741,null));};exports['getFields']=function(_0x342c28,_0x2f8bb9,_0x82b760){var _0x3a9a99=_0x342c28['query'][_0x4493('0x11d')]===_0x4493('0x11e')?_0x4493('0x11f'):'onlineForm';return db[_0x4493('0x3f')][_0x4493('0x5d')]({'attributes':['id',_0x3a9a99],'where':{'id':_0x342c28['params']['id']}})['then'](handleEntityNotFound(_0x2f8bb9,null))[_0x4493('0x1e')](function(_0xb3fe8c){if(_0xb3fe8c){var _0x30ff8a=_0xb3fe8c[_0x3a9a99];var _0x4948d0=_0x30ff8a&&_0x30ff8a[_0x4493('0x120')]?_0x30ff8a[_0x4493('0x120')]:[];_0x2f8bb9[_0x4493('0xd1')]({'fromKey':_[_0x4493('0x7d')](_0x30ff8a[_0x4493('0x121')])?undefined:_0x30ff8a[_0x4493('0x121')],'count':_0x4948d0['length'],'rows':_0x4948d0});}})['catch'](handleError(_0x2f8bb9,null));};exports[_0x4493('0x122')]=function(_0x24f900,_0x68475c,_0x3fd38a){var _0x1da422={'raw':![],'where':{}};var _0x1597ad={};var _0x2faf06={'count':0x0,'rows':[]};return db[_0x4493('0x3f')]['findOne']({'where':{'id':_0x24f900[_0x4493('0x60')]['id']}})['then'](handleEntityNotFound(_0x68475c,null))[_0x4493('0x1e')](function(_0x52f928){if(_0x52f928){_0x1597ad[_0x4493('0x47')]=_['keys'](db[_0x4493('0x123')][_0x4493('0x56')]);_0x1597ad[_0x4493('0x43')]=_[_0x4493('0x44')](_0x24f900['query']);_0x1597ad[_0x4493('0x45')]=_[_0x4493('0x46')](_0x1597ad['model'],_0x1597ad['query']);_0x1da422[_0x4493('0x48')]=_[_0x4493('0x46')](_0x1597ad[_0x4493('0x47')],qs['fields'](_0x24f900[_0x4493('0x43')][_0x4493('0x49')]));_0x1da422[_0x4493('0x48')]=_0x1da422[_0x4493('0x48')][_0x4493('0x4a')]?_0x1da422['attributes']:_0x1597ad[_0x4493('0x47')];if(!_0x24f900[_0x4493('0x43')][_0x4493('0x4b')]('nolimit')){_0x1da422['limit']=qs[_0x4493('0x2e')](_0x24f900[_0x4493('0x43')][_0x4493('0x2e')]);_0x1da422[_0x4493('0x2c')]=qs['offset'](_0x24f900[_0x4493('0x43')][_0x4493('0x2c')]);}_0x1da422[_0x4493('0x66')]=qs[_0x4493('0x4d')](_0x24f900['query'][_0x4493('0x4d')]);_0x1da422[_0x4493('0x4f')]=qs[_0x4493('0x45')](_[_0x4493('0x67')](_0x24f900[_0x4493('0x43')],_0x1597ad[_0x4493('0x45')]));_0x1da422[_0x4493('0x4f')][_0x4493('0x63')]=_0x52f928['id'];if(_0x24f900[_0x4493('0x43')]['filter']){_0x1da422[_0x4493('0x4f')]=_[_0x4493('0x50')](_0x1da422[_0x4493('0x4f')],{'$or':_[_0x4493('0x3e')](_0x1da422[_0x4493('0x48')],function(_0x50cc2e){var _0x5abab2={};_0x5abab2[_0x50cc2e]={'$like':'%'+_0x24f900[_0x4493('0x43')][_0x4493('0x4e')]+'%'};return _0x5abab2;})});}_0x1da422=_[_0x4493('0x50')]({},_0x1da422,_0x24f900[_0x4493('0x57')]);return db[_0x4493('0x123')][_0x4493('0x2d')]({'where':_0x1da422[_0x4493('0x4f')]})['then'](function(_0x1abc69){_0x2faf06[_0x4493('0x2d')]=_0x1abc69;if(_0x24f900[_0x4493('0x43')][_0x4493('0x52')]){_0x1da422[_0x4493('0x68')]=[{'all':!![]}];}else{_0x1da422['include']=[{'model':db[_0x4493('0x8e')],'as':'Contact','required':![]},{'model':db[_0x4493('0xe1')],'as':_0x4493('0x124'),'required':![]}];}return db[_0x4493('0x123')][_0x4493('0x69')](_0x1da422);})['then'](function(_0xc31292){_0x2faf06['rows']=_0xc31292;return _0x2faf06;});}})[_0x4493('0x1e')](respondWithFilteredResult(_0x68475c,_0x1da422))[_0x4493('0x54')](handleError(_0x68475c,null));};exports['addAgents']=function(_0x3a235f,_0x5da3cd,_0x4b73a6){return db[_0x4493('0x3f')][_0x4493('0x5d')]({'where':{'id':_0x3a235f['params']['id']}})['then'](handleEntityNotFound(_0x5da3cd,null))[_0x4493('0x1e')](function(_0x48eb58){if(_0x48eb58){return _0x48eb58[_0x4493('0x125')](_0x3a235f[_0x4493('0x59')][_0x4493('0x6b')],_['omit'](_0x3a235f['body'],['ids','id'])||{})[_0x4493('0xbd')](function(_0x1a440f){for(var _0x2ad9fd=0x0;_0x2ad9fd<_0x3a235f['body'][_0x4493('0x6b')][_0x4493('0x4a')];_0x2ad9fd+=0x1){socket[_0x4493('0x126')](_0x4493('0x127'),{'UserId':Number(_0x3a235f['body']['ids'][_0x2ad9fd]),'ChatWebsiteId':Number(_0x3a235f[_0x4493('0x60')]['id'])});}return _0x1a440f;});}})['then'](respondWithResult(_0x5da3cd,null))['catch'](handleError(_0x5da3cd,null));};exports[_0x4493('0x128')]=function(_0x3c03fb,_0x16c1ae,_0x59e98d){return db['ChatWebsite'][_0x4493('0x5d')]({'where':{'id':_0x3c03fb['params']['id']}})[_0x4493('0x1e')](handleEntityNotFound(_0x16c1ae,null))[_0x4493('0x1e')](function(_0x52979a){if(_0x52979a){return _0x52979a[_0x4493('0x128')](_0x3c03fb[_0x4493('0x43')][_0x4493('0x6b')])[_0x4493('0x1e')](function(){if(_['isArray'](_0x3c03fb['query'][_0x4493('0x6b')])){for(var _0x573277=0x0;_0x573277<_0x3c03fb[_0x4493('0x43')]['ids']['length'];_0x573277+=0x1){socket[_0x4493('0x126')](_0x4493('0x129'),{'UserId':Number(_0x3c03fb[_0x4493('0x43')]['ids'][_0x573277]),'ChatWebsiteId':Number(_0x3c03fb[_0x4493('0x60')]['id'])});}}else{socket[_0x4493('0x126')](_0x4493('0x129'),{'UserId':Number(_0x3c03fb['query'][_0x4493('0x6b')]),'ChatWebsiteId':Number(_0x3c03fb[_0x4493('0x60')]['id'])});}});}})[_0x4493('0x1e')](respondWithStatusCode(_0x16c1ae,null))[_0x4493('0x54')](handleError(_0x16c1ae,null));};exports[_0x4493('0x12a')]=function(_0x315740,_0x23c6c2,_0x438d13){var _0x5189bc={};var _0x16c2a6={};var _0x297a10;var _0x47d5ad;return db[_0x4493('0x3f')][_0x4493('0x6e')]({'where':{'id':_0x315740[_0x4493('0x60')]['id']}})[_0x4493('0x1e')](handleEntityNotFound(_0x23c6c2,null))[_0x4493('0x1e')](function(_0x54fd6e){if(_0x54fd6e){_0x297a10=_0x54fd6e;_0x16c2a6[_0x4493('0x47')]=_['keys'](db[_0x4493('0x12b')][_0x4493('0x56')]);_0x16c2a6[_0x4493('0x43')]=_[_0x4493('0x44')](_0x315740[_0x4493('0x43')]);_0x16c2a6[_0x4493('0x45')]=_['intersection'](_0x16c2a6[_0x4493('0x47')],_0x16c2a6[_0x4493('0x43')]);_0x5189bc[_0x4493('0x48')]=_[_0x4493('0x46')](_0x16c2a6[_0x4493('0x47')],qs[_0x4493('0x49')](_0x315740['query'][_0x4493('0x49')]));_0x5189bc[_0x4493('0x48')]=_0x5189bc[_0x4493('0x48')][_0x4493('0x4a')]?_0x5189bc[_0x4493('0x48')]:_0x16c2a6[_0x4493('0x47')];_0x5189bc[_0x4493('0x66')]=qs['sort'](_0x315740['query'][_0x4493('0x4d')]);_0x5189bc[_0x4493('0x4f')]=qs['filters'](_['pick'](_0x315740['query'],_0x16c2a6[_0x4493('0x45')]));if(_0x315740[_0x4493('0x43')][_0x4493('0x4e')]){_0x5189bc['where']=_['merge'](_0x5189bc[_0x4493('0x4f')],{'$or':_[_0x4493('0x3e')](_0x5189bc[_0x4493('0x48')],function(_0x437fbc){var _0x13a892={};_0x13a892[_0x437fbc]={'$like':'%'+_0x315740[_0x4493('0x43')][_0x4493('0x4e')]+'%'};return _0x13a892;})});}_0x5189bc=_[_0x4493('0x50')]({},_0x5189bc,_0x315740[_0x4493('0x57')]);return _0x297a10[_0x4493('0x12a')](_0x5189bc);}})[_0x4493('0x1e')](function(_0x44224e){if(_0x44224e){_0x47d5ad=_0x44224e['length'];if(!_0x315740[_0x4493('0x43')][_0x4493('0x4b')]('nolimit')){_0x5189bc['limit']=qs[_0x4493('0x2e')](_0x315740[_0x4493('0x43')]['limit']);_0x5189bc[_0x4493('0x2c')]=qs[_0x4493('0x2c')](_0x315740[_0x4493('0x43')][_0x4493('0x2c')]);}return _0x297a10['getAgents'](_0x5189bc);}})[_0x4493('0x1e')](function(_0x49b825){if(_0x49b825){return _0x49b825?{'count':_0x47d5ad,'rows':_0x49b825}:null;}})[_0x4493('0x1e')](respondWithResult(_0x23c6c2,null))[_0x4493('0x54')](handleError(_0x23c6c2,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 1970e30..a5b99b4 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 _0x9865=['hasOwnProperty','hook','events','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','emit'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x9865,0x1ba));var _0x5986=function(_0x5c9274,_0x4e849b){_0x5c9274=_0x5c9274-0x0;var _0x1ef7d3=_0x9865[_0x5c9274];return _0x1ef7d3;};'use strict';var EventEmitter=require(_0x5986('0x0'));var ChatWebsite=require(_0x5986('0x1'))['db'][_0x5986('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x5986('0x3')](0x0);var events={'afterCreate':_0x5986('0x4'),'afterUpdate':_0x5986('0x5'),'afterDestroy':_0x5986('0x6')};function emitEvent(_0x12c471){return function(_0x236420,_0xef2d15,_0x5b7602){ChatWebsiteEvents[_0x5986('0x7')](_0x12c471+':'+_0x236420['id'],_0x236420);ChatWebsiteEvents[_0x5986('0x7')](_0x12c471,_0x236420);_0x5b7602(null);};}for(var e in events){if(events[_0x5986('0x8')](e)){var event=events[e];ChatWebsite[_0x5986('0x9')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file +var _0x8c25=['ChatWebsite','setMaxListeners','save','update','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x2cdde7,_0x7221c1){var _0x12f5de=function(_0x322df6){while(--_0x322df6){_0x2cdde7['push'](_0x2cdde7['shift']());}};_0x12f5de(++_0x7221c1);}(_0x8c25,0x15e));var _0x58c2=function(_0x3d4bfa,_0x2f6b73){_0x3d4bfa=_0x3d4bfa-0x0;var _0x40ece9=_0x8c25[_0x3d4bfa];return _0x40ece9;};'use strict';var EventEmitter=require(_0x58c2('0x0'));var ChatWebsite=require(_0x58c2('0x1'))['db'][_0x58c2('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x58c2('0x3')](0x0);var events={'afterCreate':_0x58c2('0x4'),'afterUpdate':_0x58c2('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2808d9){return function(_0x4b834a,_0x5e7500,_0x491a1c){ChatWebsiteEvents[_0x58c2('0x6')](_0x2808d9+':'+_0x4b834a['id'],_0x4b834a);ChatWebsiteEvents['emit'](_0x2808d9,_0x4b834a);_0x491a1c(null);};}for(var e in events){if(events[_0x58c2('0x7')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index a87e7c5..e06b3e5 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 _0xb1e3=['define','ChatWebsite','chat_websites','util','api','moment','bluebird','request-promise','rimraf','exports'];(function(_0x5c43cf,_0x297c45){var _0x56a800=function(_0x1f1b3e){while(--_0x1f1b3e){_0x5c43cf['push'](_0x5c43cf['shift']());}};_0x56a800(++_0x297c45);}(_0xb1e3,0x1bb));var _0x3b1e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb1e3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x3b1e('0x0'));var logger=require('../../config/logger')(_0x3b1e('0x1'));var moment=require(_0x3b1e('0x2'));var BPromise=require(_0x3b1e('0x3'));var rp=require(_0x3b1e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3b1e('0x5'));var config=require('../../config/environment');var attributes=require('./chatWebsite.attributes');module[_0x3b1e('0x6')]=function(_0xa635e6,_0x20b1b2){return _0xa635e6[_0x3b1e('0x7')](_0x3b1e('0x8'),attributes,{'tableName':_0x3b1e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xec2a=['./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x590712,_0x21ed3c){var _0xb7b99f=function(_0x5a7319){while(--_0x5a7319){_0x590712['push'](_0x590712['shift']());}};_0xb7b99f(++_0x21ed3c);}(_0xec2a,0x18b));var _0xaec2=function(_0xa4a9b3,_0x3b271c){_0xa4a9b3=_0xa4a9b3-0x0;var _0xb7a49e=_0xec2a[_0xa4a9b3];return _0xb7a49e;};'use strict';var _=require(_0xaec2('0x0'));var util=require(_0xaec2('0x1'));var logger=require(_0xaec2('0x2'))(_0xaec2('0x3'));var moment=require(_0xaec2('0x4'));var BPromise=require(_0xaec2('0x5'));var rp=require(_0xaec2('0x6'));var fs=require('fs');var path=require(_0xaec2('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xaec2('0x8'));module[_0xaec2('0x9')]=function(_0x1b3b1e,_0x2143d1){return _0x1b3b1e[_0xaec2('0xa')](_0xaec2('0xb'),attributes,{'tableName':_0xaec2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 0310558..2575d94 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 _0x40e6=['debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatWebsite,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','http','defaults','redis','./chatWebsite.socket','register','request','info','request\x20sent'];(function(_0x2fdf82,_0x322e7c){var _0x2382f5=function(_0x4d6951){while(--_0x4d6951){_0x2fdf82['push'](_0x2fdf82['shift']());}};_0x2382f5(++_0x322e7c);}(_0x40e6,0xe1));var _0x640e=function(_0xbd77c1,_0x50b969){_0xbd77c1=_0xbd77c1-0x0;var _0x47fa83=_0x40e6[_0xbd77c1];return _0x47fa83;};'use strict';var _=require('lodash');var util=require(_0x640e('0x0'));var moment=require(_0x640e('0x1'));var BPromise=require(_0x640e('0x2'));var rs=require(_0x640e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x640e('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x640e('0x5'));var config=require(_0x640e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x640e('0x7')]({'port':0x232a});config['redis']=_[_0x640e('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x640e('0x9')]));require(_0x640e('0xa'))[_0x640e('0xb')](socket);function respondWithRpcPromise(_0x32d64d,_0x57599b,_0x4248f6){return new BPromise(function(_0x151492,_0x79cfac){return client[_0x640e('0xc')](_0x32d64d,_0x4248f6)['then'](function(_0x3099b6){logger[_0x640e('0xd')]('ChatWebsite,\x20%s,\x20%s',_0x57599b,_0x640e('0xe'));logger[_0x640e('0xf')](_0x640e('0x10'),_0x57599b,_0x640e('0xe'),JSON[_0x640e('0x11')](_0x3099b6));if(_0x3099b6[_0x640e('0x12')]){if(_0x3099b6['error'][_0x640e('0x13')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x57599b,_0x3099b6['error'][_0x640e('0x14')]);return _0x79cfac(_0x3099b6[_0x640e('0x12')][_0x640e('0x14')]);}logger[_0x640e('0x12')](_0x640e('0x15'),_0x57599b,_0x3099b6['error']['message']);return _0x151492(_0x3099b6[_0x640e('0x12')]['message']);}else{logger[_0x640e('0xd')](_0x640e('0x15'),_0x57599b,'request\x20sent');_0x151492(_0x3099b6[_0x640e('0x16')][_0x640e('0x14')]);}})[_0x640e('0x17')](function(_0x217a02){logger[_0x640e('0x12')](_0x640e('0x15'),_0x57599b,_0x217a02);_0x79cfac(_0x217a02);});});} \ No newline at end of file +var _0x01b9=['client','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4c2f17,_0x5c6821){var _0x20919e=function(_0x31eef7){while(--_0x31eef7){_0x4c2f17['push'](_0x4c2f17['shift']());}};_0x20919e(++_0x5c6821);}(_0x01b9,0xb0));var _0x901b=function(_0x15658c,_0xa256f5){_0x15658c=_0x15658c-0x0;var _0x50b27a=_0x01b9[_0x15658c];return _0x50b27a;};'use strict';var _=require(_0x901b('0x0'));var util=require(_0x901b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x901b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x901b('0x3'))['db'];var utils=require(_0x901b('0x4'));var logger=require(_0x901b('0x5'))(_0x901b('0x6'));var config=require(_0x901b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x901b('0x8')]['http']({'port':0x232a});config['redis']=_[_0x901b('0x9')](config[_0x901b('0xa')],{'host':_0x901b('0xb'),'port':0x18eb});var socket=require(_0x901b('0xc'))(new Redis(config[_0x901b('0xa')]));require(_0x901b('0xd'))[_0x901b('0xe')](socket);function respondWithRpcPromise(_0x52d33e,_0x28498c,_0x13ddf5){return new BPromise(function(_0x2b3d9c,_0x497b50){return client[_0x901b('0xf')](_0x52d33e,_0x13ddf5)['then'](function(_0x216a4f){logger[_0x901b('0x10')](_0x901b('0x11'),_0x28498c,_0x901b('0x12'));logger['debug'](_0x901b('0x13'),_0x28498c,'request\x20sent',JSON['stringify'](_0x216a4f));if(_0x216a4f[_0x901b('0x14')]){if(_0x216a4f[_0x901b('0x14')]['code']===0x1f4){logger[_0x901b('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x28498c,_0x216a4f[_0x901b('0x14')][_0x901b('0x15')]);return _0x497b50(_0x216a4f[_0x901b('0x14')]['message']);}logger[_0x901b('0x14')](_0x901b('0x11'),_0x28498c,_0x216a4f[_0x901b('0x14')]['message']);return _0x2b3d9c(_0x216a4f[_0x901b('0x14')]['message']);}else{logger[_0x901b('0x10')](_0x901b('0x11'),_0x28498c,_0x901b('0x12'));_0x2b3d9c(_0x216a4f[_0x901b('0x16')][_0x901b('0x15')]);}})['catch'](function(_0x42d1fc){logger[_0x901b('0x14')](_0x901b('0x11'),_0x28498c,_0x42d1fc);_0x497b50(_0x42d1fc);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index c6c11c0..51c8ec4 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 _0x6b1d=['register','length','chatWebsite:','./chatWebsite.events','remove','removeListener'];(function(_0x121033,_0x4d1215){var _0x5751af=function(_0x260c8c){while(--_0x260c8c){_0x121033['push'](_0x121033['shift']());}};_0x5751af(++_0x4d1215);}(_0x6b1d,0xe7));var _0xd6b1=function(_0xd3b0ac,_0x2f5065){_0xd3b0ac=_0xd3b0ac-0x0;var _0x3d773e=_0x6b1d[_0xd3b0ac];return _0x3d773e;};'use strict';var ChatWebsiteEvents=require(_0xd6b1('0x0'));var events=['save',_0xd6b1('0x1'),'update'];function createListener(_0x1f16c4,_0x584cdc){return function(_0x20561a){_0x584cdc['emit'](_0x1f16c4,_0x20561a);};}function removeListener(_0x1306b9,_0x62f5b4){return function(){ChatWebsiteEvents[_0xd6b1('0x2')](_0x1306b9,_0x62f5b4);};}exports[_0xd6b1('0x3')]=function(_0x54cf64){for(var _0x46ea5b=0x0,_0x197c82=events[_0xd6b1('0x4')];_0x46ea5b<_0x197c82;_0x46ea5b++){var _0x4dd836=events[_0x46ea5b];var _0x44c6e5=createListener(_0xd6b1('0x5')+_0x4dd836,_0x54cf64);ChatWebsiteEvents['on'](_0x4dd836,_0x44c6e5);}}; \ No newline at end of file +var _0x0d9b=['chatWebsite:','./chatWebsite.events','remove','update','emit','removeListener','register','length'];(function(_0xfb7a8d,_0x25b597){var _0x695fcf=function(_0x36321c){while(--_0x36321c){_0xfb7a8d['push'](_0xfb7a8d['shift']());}};_0x695fcf(++_0x25b597);}(_0x0d9b,0x151));var _0xb0d9=function(_0x5060ac,_0x46cf92){_0x5060ac=_0x5060ac-0x0;var _0x496f54=_0x0d9b[_0x5060ac];return _0x496f54;};'use strict';var ChatWebsiteEvents=require(_0xb0d9('0x0'));var events=['save',_0xb0d9('0x1'),_0xb0d9('0x2')];function createListener(_0x972098,_0x9b4d47){return function(_0x1825b9){_0x9b4d47[_0xb0d9('0x3')](_0x972098,_0x1825b9);};}function removeListener(_0x333919,_0x15b3ac){return function(){ChatWebsiteEvents[_0xb0d9('0x4')](_0x333919,_0x15b3ac);};}exports[_0xb0d9('0x5')]=function(_0x2ccfd8){for(var _0x340b47=0x0,_0x555eba=events[_0xb0d9('0x6')];_0x340b47<_0x555eba;_0x340b47++){var _0x5b1a02=events[_0x340b47];var _0x3b53fa=createListener(_0xb0d9('0x7')+_0x5b1a02,_0x2ccfd8);ChatWebsiteEvents['on'](_0x5b1a02,_0x3b53fa);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 4efac45..d62c7a5 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 _0xcb59=['/:id/offline','any','offline','addInteraction','addApplications','/:id/proactive_actions','addAgents','put','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/logo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','/:id/fields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','diskStorage','root','format','%s-%s','now','originalname','file','addLogo','join','server/files/images/avatars/','single','addAvatar','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','ensureDir','replace'];(function(_0x8b9b45,_0x555425){var _0x5254f1=function(_0x3980a5){while(--_0x3980a5){_0x8b9b45['push'](_0x8b9b45['shift']());}};_0x5254f1(++_0x555425);}(_0xcb59,0x138));var _0x9cb5=function(_0x7a18fb,_0x3242fb){_0x7a18fb=_0x7a18fb-0x0;var _0x412cc6=_0xcb59[_0x7a18fb];return _0x412cc6;};'use strict';var multer=require(_0x9cb5('0x0'));var util=require(_0x9cb5('0x1'));var path=require(_0x9cb5('0x2'));var timeout=require(_0x9cb5('0x3'));var express=require(_0x9cb5('0x4'));var router=express[_0x9cb5('0x5')]();var fs_extra=require(_0x9cb5('0x6'));var auth=require(_0x9cb5('0x7'));var interaction=require(_0x9cb5('0x8'));var config=require(_0x9cb5('0x9'));var controller=require(_0x9cb5('0xa'));router[_0x9cb5('0xb')]('/',auth[_0x9cb5('0xc')](),controller[_0x9cb5('0xd')]);router['get'](_0x9cb5('0xe'),auth[_0x9cb5('0xc')](),controller[_0x9cb5('0xf')]);router[_0x9cb5('0xb')]('/:id',auth[_0x9cb5('0xc')](),controller[_0x9cb5('0x10')]);router['get'](_0x9cb5('0x11'),auth[_0x9cb5('0xc')](),controller[_0x9cb5('0x12')]);router['get']('/:id/canned_answers',auth[_0x9cb5('0xc')](),controller['getAnswers']);router['get'](_0x9cb5('0x13'),controller['getLogo']);router[_0x9cb5('0xb')](_0x9cb5('0x14'),controller[_0x9cb5('0x15')]);router[_0x9cb5('0xb')]('/:id/customer_avatar',controller[_0x9cb5('0x16')]);router[_0x9cb5('0xb')](_0x9cb5('0x17'),controller['getSystemAvatar']);router[_0x9cb5('0xb')]('/:id/interactions',auth[_0x9cb5('0xc')](),controller[_0x9cb5('0x18')]);router[_0x9cb5('0xb')](_0x9cb5('0x19'),controller[_0x9cb5('0x1a')]);router[_0x9cb5('0xb')](_0x9cb5('0x1b'),auth['isAuthenticated'](),controller['getApplications']);router[_0x9cb5('0xb')]('/:id/proactive_actions',auth[_0x9cb5('0xc')](),controller['getProactiveActions']);router['get'](_0x9cb5('0x1c'),controller['getFields']);router['get'](_0x9cb5('0x1d'),auth[_0x9cb5('0xc')](),controller[_0x9cb5('0x1e')]);router[_0x9cb5('0xb')](_0x9cb5('0x1f'),auth[_0x9cb5('0xc')](),controller[_0x9cb5('0x20')]);router[_0x9cb5('0x21')]('/',auth['isAuthenticated'](),controller[_0x9cb5('0x22')]);router[_0x9cb5('0x21')](_0x9cb5('0x11'),auth[_0x9cb5('0xc')](),controller[_0x9cb5('0x23')]);router[_0x9cb5('0x21')](_0x9cb5('0x24'),auth['isAuthenticated'](),controller[_0x9cb5('0x25')]);var upload=multer({'storage':multer[_0x9cb5('0x26')]({'destination':function(_0x96e9eb,_0x57fa14,_0x2efddf){_0x2efddf(null,path['join'](config[_0x9cb5('0x27')],'server/files/images/logos/'));},'filename':function(_0x3f0026,_0x314234,_0x55fe67){_0x55fe67(null,util[_0x9cb5('0x28')](_0x9cb5('0x29'),Date[_0x9cb5('0x2a')](),_0x314234[_0x9cb5('0x2b')]));}})});router['post'](_0x9cb5('0x13'),upload['single'](_0x9cb5('0x2c')),controller[_0x9cb5('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2aa798,_0x364c65,_0x186479){_0x186479(null,path[_0x9cb5('0x2e')](config['root'],_0x9cb5('0x2f')));},'filename':function(_0x2ea038,_0x4ba820,_0x3cc181){_0x3cc181(null,util['format'](_0x9cb5('0x29'),Date['now'](),_0x4ba820[_0x9cb5('0x2b')]));}})});router[_0x9cb5('0x21')]('/:id/avatar',upload[_0x9cb5('0x30')](_0x9cb5('0x2c')),controller[_0x9cb5('0x31')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4026df,_0x1efaa5,_0x59f10c){_0x59f10c(null,path[_0x9cb5('0x2e')](config[_0x9cb5('0x27')],_0x9cb5('0x2f')));},'filename':function(_0x2dd49c,_0x297dfc,_0x4aa9af){_0x4aa9af(null,util[_0x9cb5('0x28')](_0x9cb5('0x29'),Date[_0x9cb5('0x2a')](),_0x297dfc[_0x9cb5('0x2b')]));}})});router['post'](_0x9cb5('0x32'),upload['single'](_0x9cb5('0x2c')),controller[_0x9cb5('0x33')]);var upload=multer({'storage':multer[_0x9cb5('0x26')]({'destination':function(_0x388c70,_0x1eba73,_0x44107f){_0x44107f(null,path[_0x9cb5('0x2e')](config[_0x9cb5('0x27')],'server/files/images/avatars/'));},'filename':function(_0x2ef953,_0x421c78,_0x258efb){_0x258efb(null,util[_0x9cb5('0x28')](_0x9cb5('0x29'),Date['now'](),_0x421c78[_0x9cb5('0x2b')]));}})});router[_0x9cb5('0x21')](_0x9cb5('0x17'),upload[_0x9cb5('0x30')](_0x9cb5('0x2c')),controller[_0x9cb5('0x34')]);router['post'](_0x9cb5('0x35'),controller[_0x9cb5('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0x9cb5('0x26')]({'destination':function(_0x5081ab,_0x446f37,_0x3c0d4c){const _0x39f879=path[_0x9cb5('0x2e')](config[_0x9cb5('0x27')],_0x9cb5('0x37'),'attachments','offline-chat');fs_extra[_0x9cb5('0x38')](_0x39f879,function(){_0x3c0d4c(null,_0x39f879);});},'filename':function(_0x59bcb0,_0x577da3,_0x3a99ae){const _0x206a1f=_0x577da3[_0x9cb5('0x2b')][_0x9cb5('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2cc1e7=path['extname'](_0x206a1f);const _0x3ddb80=Date[_0x9cb5('0x2a')]()+'-'+_0x206a1f[_0x9cb5('0x39')](_0x2cc1e7,'')+_0x2cc1e7;_0x3a99ae(null,_0x3ddb80);}})});router[_0x9cb5('0x21')](_0x9cb5('0x3a'),offlineUploadMulter[_0x9cb5('0x3b')](),controller[_0x9cb5('0x3c')]);router['post']('/:id/interactions',auth[_0x9cb5('0xc')](),controller[_0x9cb5('0x3d')]);router[_0x9cb5('0x21')](_0x9cb5('0x1b'),auth[_0x9cb5('0xc')](),controller[_0x9cb5('0x3e')]);router[_0x9cb5('0x21')](_0x9cb5('0x3f'),auth[_0x9cb5('0xc')](),controller['addProactiveActions']);router['post'](_0x9cb5('0x1f'),auth[_0x9cb5('0xc')](),controller[_0x9cb5('0x40')]);router[_0x9cb5('0x41')](_0x9cb5('0x42'),auth[_0x9cb5('0xc')](),controller[_0x9cb5('0x43')]);router[_0x9cb5('0x44')](_0x9cb5('0x42'),auth[_0x9cb5('0xc')](),controller[_0x9cb5('0x45')]);router['delete']('/:id/dispositions',auth[_0x9cb5('0xc')](),controller[_0x9cb5('0x46')]);router[_0x9cb5('0x44')](_0x9cb5('0x24'),auth['isAuthenticated'](),controller[_0x9cb5('0x47')]);router[_0x9cb5('0x44')](_0x9cb5('0x1f'),auth[_0x9cb5('0xc')](),controller[_0x9cb5('0x48')]);module[_0x9cb5('0x49')]=router; \ No newline at end of file +var _0xa32c=['getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','getAgents','post','create','addDisposition','join','root','server/files/images/logos/','%s-%s','file','addLogo','diskStorage','server/files/images/avatars/','format','now','originalname','addAvatar','single','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','extname','replace','/:id/offline','offline','addInteraction','/:id/users','addAgents','put','/:id','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions'];(function(_0x3acdb6,_0x378a8b){var _0x89bf51=function(_0x4fb7bc){while(--_0x4fb7bc){_0x3acdb6['push'](_0x3acdb6['shift']());}};_0x89bf51(++_0x378a8b);}(_0xa32c,0x10f));var _0xca32=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xa32c[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0xca32('0x0'));var util=require(_0xca32('0x1'));var path=require(_0xca32('0x2'));var timeout=require(_0xca32('0x3'));var express=require(_0xca32('0x4'));var router=express[_0xca32('0x5')]();var fs_extra=require(_0xca32('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xca32('0x7'));var config=require(_0xca32('0x8'));var controller=require('./chatWebsite.controller');router[_0xca32('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xca32('0x9')](_0xca32('0xa'),auth[_0xca32('0xb')](),controller[_0xca32('0xc')]);router[_0xca32('0x9')]('/:id',auth[_0xca32('0xb')](),controller[_0xca32('0xd')]);router[_0xca32('0x9')](_0xca32('0xe'),auth['isAuthenticated'](),controller['getDispositions']);router[_0xca32('0x9')](_0xca32('0xf'),auth[_0xca32('0xb')](),controller[_0xca32('0x10')]);router['get'](_0xca32('0x11'),controller[_0xca32('0x12')]);router[_0xca32('0x9')](_0xca32('0x13'),controller[_0xca32('0x14')]);router[_0xca32('0x9')]('/:id/customer_avatar',controller[_0xca32('0x15')]);router[_0xca32('0x9')](_0xca32('0x16'),controller[_0xca32('0x17')]);router[_0xca32('0x9')](_0xca32('0x18'),auth[_0xca32('0xb')](),controller[_0xca32('0x19')]);router[_0xca32('0x9')](_0xca32('0x1a'),controller[_0xca32('0x1b')]);router['get'](_0xca32('0x1c'),auth[_0xca32('0xb')](),controller[_0xca32('0x1d')]);router['get'](_0xca32('0x1e'),auth[_0xca32('0xb')](),controller[_0xca32('0x1f')]);router[_0xca32('0x9')](_0xca32('0x20'),controller['getFields']);router['get'](_0xca32('0x21'),auth[_0xca32('0xb')](),controller[_0xca32('0x22')]);router[_0xca32('0x9')]('/:id/users',auth[_0xca32('0xb')](),controller[_0xca32('0x23')]);router[_0xca32('0x24')]('/',auth[_0xca32('0xb')](),controller[_0xca32('0x25')]);router[_0xca32('0x24')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xca32('0x26')]);router['post']('/:id/canned_answers',auth[_0xca32('0xb')](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3d29fb,_0x272127,_0x57d141){_0x57d141(null,path[_0xca32('0x27')](config[_0xca32('0x28')],_0xca32('0x29')));},'filename':function(_0x332e7c,_0x414856,_0x25ab7a){_0x25ab7a(null,util['format'](_0xca32('0x2a'),Date['now'](),_0x414856['originalname']));}})});router[_0xca32('0x24')](_0xca32('0x11'),upload['single'](_0xca32('0x2b')),controller[_0xca32('0x2c')]);var upload=multer({'storage':multer[_0xca32('0x2d')]({'destination':function(_0x1b858d,_0x410546,_0x4c5c58){_0x4c5c58(null,path[_0xca32('0x27')](config[_0xca32('0x28')],_0xca32('0x2e')));},'filename':function(_0x21c129,_0x3d83bb,_0x1cfbbf){_0x1cfbbf(null,util[_0xca32('0x2f')](_0xca32('0x2a'),Date[_0xca32('0x30')](),_0x3d83bb[_0xca32('0x31')]));}})});router[_0xca32('0x24')](_0xca32('0x13'),upload['single'](_0xca32('0x2b')),controller[_0xca32('0x32')]);var upload=multer({'storage':multer[_0xca32('0x2d')]({'destination':function(_0x33b735,_0x319953,_0x1413a2){_0x1413a2(null,path[_0xca32('0x27')](config[_0xca32('0x28')],_0xca32('0x2e')));},'filename':function(_0x2815b5,_0xcc7212,_0x3dc5ec){_0x3dc5ec(null,util['format'](_0xca32('0x2a'),Date[_0xca32('0x30')](),_0xcc7212[_0xca32('0x31')]));}})});router[_0xca32('0x24')]('/:id/customer_avatar',upload[_0xca32('0x33')](_0xca32('0x2b')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0xca32('0x2d')]({'destination':function(_0x3574ba,_0x1f9700,_0xec9209){_0xec9209(null,path[_0xca32('0x27')](config['root'],_0xca32('0x2e')));},'filename':function(_0x1f7e6e,_0x3b7eb4,_0x10ded6){_0x10ded6(null,util[_0xca32('0x2f')]('%s-%s',Date[_0xca32('0x30')](),_0x3b7eb4[_0xca32('0x31')]));}})});router[_0xca32('0x24')](_0xca32('0x16'),upload['single'](_0xca32('0x2b')),controller[_0xca32('0x34')]);router[_0xca32('0x24')](_0xca32('0x35'),controller[_0xca32('0x36')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x5045d2,_0x207f75,_0x2feb0d){const _0x1b346d=path[_0xca32('0x27')](config[_0xca32('0x28')],_0xca32('0x37'),_0xca32('0x38'),_0xca32('0x39'));fs_extra[_0xca32('0x3a')](_0x1b346d,function(){_0x2feb0d(null,_0x1b346d);});},'filename':function(_0x48bc33,_0x8cfb2a,_0x5db00e){const _0x55574f=_0x8cfb2a[_0xca32('0x31')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2f5454=path[_0xca32('0x3b')](_0x55574f);const _0x4ee146=Date['now']()+'-'+_0x55574f[_0xca32('0x3c')](_0x2f5454,'')+_0x2f5454;_0x5db00e(null,_0x4ee146);}})});router[_0xca32('0x24')](_0xca32('0x3d'),offlineUploadMulter['any'](),controller[_0xca32('0x3e')]);router['post'](_0xca32('0x18'),auth[_0xca32('0xb')](),controller[_0xca32('0x3f')]);router[_0xca32('0x24')](_0xca32('0x1c'),auth[_0xca32('0xb')](),controller['addApplications']);router['post'](_0xca32('0x1e'),auth['isAuthenticated'](),controller['addProactiveActions']);router[_0xca32('0x24')](_0xca32('0x40'),auth['isAuthenticated'](),controller[_0xca32('0x41')]);router[_0xca32('0x42')](_0xca32('0x43'),auth[_0xca32('0xb')](),controller[_0xca32('0x44')]);router[_0xca32('0x45')](_0xca32('0x43'),auth[_0xca32('0xb')](),controller['destroy']);router['delete'](_0xca32('0xe'),auth[_0xca32('0xb')](),controller[_0xca32('0x46')]);router['delete'](_0xca32('0xf'),auth[_0xca32('0xb')](),controller[_0xca32('0x47')]);router['delete'](_0xca32('0x40'),auth[_0xca32('0xb')](),controller[_0xca32('0x48')]);module[_0xca32('0x49')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 926287f..7885275 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 _0xd8a5=['sequelize','STRING','ENUM','Google'];(function(_0x47ad1a,_0x467d68){var _0x586211=function(_0x169364){while(--_0x169364){_0x47ad1a['push'](_0x47ad1a['shift']());}};_0x586211(++_0x467d68);}(_0xd8a5,0x160));var _0x5d8a=function(_0x616db3,_0x1d982f){_0x616db3=_0x616db3-0x0;var _0x5315e7=_0xd8a5[_0x616db3];return _0x5315e7;};'use strict';var Sequelize=require(_0x5d8a('0x0'));module['exports']={'name':{'type':Sequelize[_0x5d8a('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x5d8a('0x2')]('AmazonAWS',_0x5d8a('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x5d8a('0x1')]},'data2':{'type':Sequelize[_0x5d8a('0x1')]}}; \ No newline at end of file +var _0x042a=['AmazonAWS','sequelize','STRING','ENUM'];(function(_0x1c3386,_0x2868c0){var _0x2cc8e9=function(_0x556aa2){while(--_0x556aa2){_0x1c3386['push'](_0x1c3386['shift']());}};_0x2cc8e9(++_0x2868c0);}(_0x042a,0x1d9));var _0xa042=function(_0x217f51,_0x185d87){_0x217f51=_0x217f51-0x0;var _0x19473b=_0x042a[_0x217f51];return _0x19473b;};'use strict';var Sequelize=require(_0xa042('0x0'));module['exports']={'name':{'type':Sequelize[_0xa042('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xa042('0x2')](_0xa042('0x3'),'Google'),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xa042('0x1')]},'data2':{'type':Sequelize[_0xa042('0x1')]}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 4e5816b..9507c5d 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 _0x5f66=['update','catch','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','CloudProvider','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','find','create','body'];(function(_0x12646b,_0x5d7539){var _0x1b244f=function(_0x4fd6ad){while(--_0x4fd6ad){_0x12646b['push'](_0x12646b['shift']());}};_0x1b244f(++_0x5d7539);}(_0x5f66,0x1a0));var _0x65f6=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x5f66[_0x126558];return _0x1f6d14;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'all':!![]}];}return db[_0x65f6('0x27')][_0x65f6('0x3c')](_0x4ac04b);})[_0x65f6('0x21')](function(_0xed4c96){_0x266cfe[_0x65f6('0x3d')]=_0xed4c96;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))['catch'](handleError(_0x559330,null));};exports[_0x65f6('0x3e')]=function(_0x400ed2,_0x377ae5){var _0x181798={'raw':!![],'where':{'id':_0x400ed2[_0x65f6('0x3f')]['id']}},_0x83e2d9={};_0x83e2d9[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x83e2d9[_0x65f6('0x2c')]=_[_0x65f6('0x2b')](_0x400ed2[_0x65f6('0x2c')]);_0x83e2d9[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],_0x83e2d9['query']);_0x181798[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x400ed2['query'][_0x65f6('0x2f')]));_0x181798[_0x65f6('0x30')]=_0x181798[_0x65f6('0x30')]['length']?_0x181798[_0x65f6('0x30')]:_0x83e2d9[_0x65f6('0x2a')];if(_0x400ed2[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x181798['include']=[{'all':!![]}];}_0x181798=_[_0x65f6('0x37')]({},_0x181798,_0x400ed2['options']);return db[_0x65f6('0x27')][_0x65f6('0x40')](_0x181798)['then'](handleEntityNotFound(_0x377ae5,null))[_0x65f6('0x21')](respondWithResult(_0x377ae5,null))['catch'](handleError(_0x377ae5,null));};exports[_0x65f6('0x41')]=function(_0x4d9b76,_0x2d1706){return db[_0x65f6('0x27')][_0x65f6('0x41')](_0x4d9b76[_0x65f6('0x42')],{})['then'](respondWithResult(_0x2d1706,0xc9))['catch'](handleError(_0x2d1706,null));};exports[_0x65f6('0x43')]=function(_0x15d3ba,_0x3b647a){if(_0x15d3ba[_0x65f6('0x42')]['id']){delete _0x15d3ba[_0x65f6('0x42')]['id'];}return db[_0x65f6('0x27')][_0x65f6('0x40')]({'where':{'id':_0x15d3ba[_0x65f6('0x3f')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b647a,null))['then'](saveUpdates(_0x15d3ba[_0x65f6('0x42')],null))[_0x65f6('0x21')](respondWithResult(_0x3b647a,null))[_0x65f6('0x44')](handleError(_0x3b647a,null));};exports['destroy']=function(_0x47e749,_0x42d453){return db['CloudProvider'][_0x65f6('0x40')]({'where':{'id':_0x47e749[_0x65f6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x42d453,null))[_0x65f6('0x21')](removeEntity(_0x42d453,null))['catch'](handleError(_0x42d453,null));}; \ No newline at end of file +var _0x7a54=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','CloudProvider','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x2adca1,_0x3d2a48){var _0x586415=function(_0x1c19c5){while(--_0x1c19c5){_0x2adca1['push'](_0x2adca1['shift']());}};_0x586415(++_0x3d2a48);}(_0x7a54,0x106));var _0x47a5=function(_0x1f9ef2,_0x598bf9){_0x1f9ef2=_0x1f9ef2-0x0;var _0x17a4d3=_0x7a54[_0x1f9ef2];return _0x17a4d3;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['CloudProvider'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['CloudProvider']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['CloudProvider']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index fce78af..5341454 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 _0x36ce=['CloudProvider','cloud_providers','util','../../config/logger','api','path','rimraf','./cloudProvider.attributes','define'];(function(_0x3f9631,_0x51ffcb){var _0x242d84=function(_0xfcd4f7){while(--_0xfcd4f7){_0x3f9631['push'](_0x3f9631['shift']());}};_0x242d84(++_0x51ffcb);}(_0x36ce,0xa4));var _0xe36c=function(_0x1ab8f9,_0x57f54e){_0x1ab8f9=_0x1ab8f9-0x0;var _0x3da929=_0x36ce[_0x1ab8f9];return _0x3da929;};'use strict';var _=require('lodash');var util=require(_0xe36c('0x0'));var logger=require(_0xe36c('0x1'))(_0xe36c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe36c('0x3'));var rimraf=require(_0xe36c('0x4'));var config=require('../../config/environment');var attributes=require(_0xe36c('0x5'));module['exports']=function(_0x2e29ce,_0x3c9c12){return _0x2e29ce[_0xe36c('0x6')](_0xe36c('0x7'),attributes,{'tableName':_0xe36c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x13cd=['moment','bluebird','request-promise','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','../../config/logger','api'];(function(_0x3e3cc1,_0x31f8a5){var _0x411645=function(_0x54126d){while(--_0x54126d){_0x3e3cc1['push'](_0x3e3cc1['shift']());}};_0x411645(++_0x31f8a5);}(_0x13cd,0xb9));var _0xd13c=function(_0x20cbd4,_0x932828){_0x20cbd4=_0x20cbd4-0x0;var _0x52c55c=_0x13cd[_0x20cbd4];return _0x52c55c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd13c('0x0'))(_0xd13c('0x1'));var moment=require(_0xd13c('0x2'));var BPromise=require(_0xd13c('0x3'));var rp=require(_0xd13c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd13c('0x5'));var config=require(_0xd13c('0x6'));var attributes=require(_0xd13c('0x7'));module[_0xd13c('0x8')]=function(_0xad8643,_0x529499){return _0xad8643[_0xd13c('0x9')](_0xd13c('0xa'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index c697fde..05aff18 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 _0x5853=['then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x5853,0x113));var _0x3585=function(_0x2bf1d6,_0x410efd){_0x2bf1d6=_0x2bf1d6-0x0;var _0x1be08a=_0x5853[_0x2bf1d6];return _0x1be08a;};'use strict';var _=require(_0x3585('0x0'));var util=require(_0x3585('0x1'));var moment=require(_0x3585('0x2'));var BPromise=require(_0x3585('0x3'));var rs=require(_0x3585('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3585('0x5'))['db'];var utils=require(_0x3585('0x6'));var logger=require(_0x3585('0x7'))(_0x3585('0x8'));var config=require(_0x3585('0x9'));var jayson=require(_0x3585('0xa'));var client=jayson['client'][_0x3585('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48b3ff,_0x5d8c2d,_0x1a97fd){return new BPromise(function(_0x5e78f3,_0x5910ab){return client[_0x3585('0xc')](_0x48b3ff,_0x1a97fd)[_0x3585('0xd')](function(_0x2febe8){logger[_0x3585('0xe')](_0x3585('0xf'),_0x5d8c2d,_0x3585('0x10'));logger['debug'](_0x3585('0x11'),_0x5d8c2d,_0x3585('0x10'),JSON[_0x3585('0x12')](_0x2febe8));if(_0x2febe8[_0x3585('0x13')]){if(_0x2febe8[_0x3585('0x13')][_0x3585('0x14')]===0x1f4){logger[_0x3585('0x13')]('CloudProvider,\x20%s,\x20%s',_0x5d8c2d,_0x2febe8[_0x3585('0x13')]['message']);return _0x5910ab(_0x2febe8['error']['message']);}logger['error'](_0x3585('0xf'),_0x5d8c2d,_0x2febe8['error'][_0x3585('0x15')]);return _0x5e78f3(_0x2febe8[_0x3585('0x13')]['message']);}else{logger[_0x3585('0xe')](_0x3585('0xf'),_0x5d8c2d,'request\x20sent');_0x5e78f3(_0x2febe8[_0x3585('0x16')][_0x3585('0x15')]);}})[_0x3585('0x17')](function(_0x2beae5){logger[_0x3585('0x13')]('CloudProvider,\x20%s,\x20%s',_0x5d8c2d,_0x2beae5);_0x5910ab(_0x2beae5);});});} \ No newline at end of file +var _0x794b=['CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info'];(function(_0x2a6824,_0x44c0b7){var _0x49920d=function(_0x5b2678){while(--_0x5b2678){_0x2a6824['push'](_0x2a6824['shift']());}};_0x49920d(++_0x44c0b7);}(_0x794b,0x1c2));var _0xb794=function(_0x51af96,_0x42104c){_0x51af96=_0x51af96-0x0;var _0x2bb16b=_0x794b[_0x51af96];return _0x2bb16b;};'use strict';var _=require(_0xb794('0x0'));var util=require(_0xb794('0x1'));var moment=require('moment');var BPromise=require(_0xb794('0x2'));var rs=require(_0xb794('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb794('0x4'));var logger=require(_0xb794('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb794('0x6'));var client=jayson[_0xb794('0x7')][_0xb794('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x20e4d4,_0x231206,_0x340863){return new BPromise(function(_0x5d099b,_0x30f03f){return client[_0xb794('0x9')](_0x20e4d4,_0x340863)[_0xb794('0xa')](function(_0xc3dde7){logger[_0xb794('0xb')](_0xb794('0xc'),_0x231206,_0xb794('0xd'));logger[_0xb794('0xe')](_0xb794('0xf'),_0x231206,_0xb794('0xd'),JSON[_0xb794('0x10')](_0xc3dde7));if(_0xc3dde7[_0xb794('0x11')]){if(_0xc3dde7[_0xb794('0x11')][_0xb794('0x12')]===0x1f4){logger[_0xb794('0x11')](_0xb794('0xc'),_0x231206,_0xc3dde7[_0xb794('0x11')][_0xb794('0x13')]);return _0x30f03f(_0xc3dde7[_0xb794('0x11')][_0xb794('0x13')]);}logger[_0xb794('0x11')]('CloudProvider,\x20%s,\x20%s',_0x231206,_0xc3dde7[_0xb794('0x11')][_0xb794('0x13')]);return _0x5d099b(_0xc3dde7[_0xb794('0x11')][_0xb794('0x13')]);}else{logger[_0xb794('0xb')](_0xb794('0xc'),_0x231206,'request\x20sent');_0x5d099b(_0xc3dde7[_0xb794('0x14')][_0xb794('0x13')]);}})['catch'](function(_0x408766){logger[_0xb794('0x11')]('CloudProvider,\x20%s,\x20%s',_0x231206,_0x408766);_0x30f03f(_0x408766);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 633a7ff..1177db1 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 _0xf590=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','index','/:id','show','post','create','put','isAuthenticated','delete','multer','path','express','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf590,0x1e2));var _0x0f59=function(_0x36c87d,_0x2ab247){_0x36c87d=_0x36c87d-0x0;var _0x54dc55=_0xf590[_0x36c87d];return _0x54dc55;};'use strict';var multer=require(_0x0f59('0x0'));var util=require('util');var path=require(_0x0f59('0x1'));var timeout=require('connect-timeout');var express=require(_0x0f59('0x2'));var router=express[_0x0f59('0x3')]();var fs_extra=require(_0x0f59('0x4'));var auth=require(_0x0f59('0x5'));var interaction=require(_0x0f59('0x6'));var config=require(_0x0f59('0x7'));var controller=require(_0x0f59('0x8'));router[_0x0f59('0x9')]('/',auth['isAuthenticated'](),controller[_0x0f59('0xa')]);router[_0x0f59('0x9')](_0x0f59('0xb'),auth['isAuthenticated'](),controller[_0x0f59('0xc')]);router[_0x0f59('0xd')]('/',auth['isAuthenticated'](),controller[_0x0f59('0xe')]);router[_0x0f59('0xf')](_0x0f59('0xb'),auth[_0x0f59('0x10')](),controller['update']);router[_0x0f59('0x11')](_0x0f59('0xb'),auth[_0x0f59('0x10')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xa76e=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','create','put','update','delete','destroy','exports','util','path'];(function(_0x1c8df6,_0x149c27){var _0x5a2b1f=function(_0x2494cc){while(--_0x2494cc){_0x1c8df6['push'](_0x1c8df6['shift']());}};_0x5a2b1f(++_0x149c27);}(_0xa76e,0xfe));var _0xea76=function(_0x18f152,_0x41585a){_0x18f152=_0x18f152-0x0;var _0xa10b34=_0xa76e[_0x18f152];return _0xa10b34;};'use strict';var multer=require('multer');var util=require(_0xea76('0x0'));var path=require(_0xea76('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xea76('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xea76('0x3'));var interaction=require(_0xea76('0x4'));var config=require(_0xea76('0x5'));var controller=require('./cloudProvider.controller');router[_0xea76('0x6')]('/',auth['isAuthenticated'](),controller[_0xea76('0x7')]);router['get'](_0xea76('0x8'),auth[_0xea76('0x9')](),controller['show']);router['post']('/',auth[_0xea76('0x9')](),controller[_0xea76('0xa')]);router[_0xea76('0xb')](_0xea76('0x8'),auth['isAuthenticated'](),controller[_0xea76('0xc')]);router[_0xea76('0xd')](_0xea76('0x8'),auth['isAuthenticated'](),controller[_0xea76('0xe')]);module[_0xea76('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 3f7508d..5030a85 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 _0xef2e=['exports','STRING','name'];(function(_0x4c73ac,_0x46b73c){var _0x9839ee=function(_0x2076fb){while(--_0x2076fb){_0x4c73ac['push'](_0x4c73ac['shift']());}};_0x9839ee(++_0x46b73c);}(_0xef2e,0x141));var _0xeef2=function(_0x3246b4,_0x401153){_0x3246b4=_0x3246b4-0x0;var _0x34b3d7=_0xef2e[_0x3246b4];return _0x34b3d7;};'use strict';var Sequelize=require('sequelize');module[_0xeef2('0x0')]={'name':{'type':Sequelize[_0xeef2('0x1')],'unique':_0xeef2('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xeef2('0x1')]},'companyId':{'type':Sequelize[_0xeef2('0x1')]},'website':{'type':Sequelize[_0xeef2('0x1')]},'phone':{'type':Sequelize[_0xeef2('0x1')]},'fax':{'type':Sequelize[_0xeef2('0x1')]},'type':{'type':Sequelize[_0xeef2('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xeef2('0x1')]},'city':{'type':Sequelize[_0xeef2('0x1')]},'country':{'type':Sequelize[_0xeef2('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xeef2('0x1')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xeef2('0x1')]},'sCity':{'type':Sequelize[_0xeef2('0x1')]},'sCountry':{'type':Sequelize[_0xeef2('0x1')]},'description':{'type':Sequelize[_0xeef2('0x1')]}}; \ No newline at end of file +var _0x201c=['STRING','name','sequelize','exports'];(function(_0x3ab164,_0x2fa5e9){var _0x39565e=function(_0x40dfe8){while(--_0x40dfe8){_0x3ab164['push'](_0x3ab164['shift']());}};_0x39565e(++_0x2fa5e9);}(_0x201c,0x17a));var _0xc201=function(_0x353e0f,_0x4eb49b){_0x353e0f=_0x353e0f-0x0;var _0x140b47=_0x201c[_0x353e0f];return _0x140b47;};'use strict';var Sequelize=require(_0xc201('0x0'));module[_0xc201('0x1')]={'name':{'type':Sequelize[_0xc201('0x2')],'unique':_0xc201('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xc201('0x2')]},'companyId':{'type':Sequelize[_0xc201('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xc201('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xc201('0x2')]},'street':{'type':Sequelize[_0xc201('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xc201('0x2')]},'country':{'type':Sequelize[_0xc201('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0xc201('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xc201('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc201('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 3090173..0fe4db1 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 _0xe1d9=['includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addContacts','CmContact','ids','getContacts','order','nolimit','eml-format','zip-dir','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','destroy','then','get','Companies','UserProfileResource','stack','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','map','options'];(function(_0x1b1bd5,_0xf50a3){var _0x12bf17=function(_0x5a1a9f){while(--_0x5a1a9f){_0x1b1bd5['push'](_0x1b1bd5['shift']());}};_0x12bf17(++_0xf50a3);}(_0xe1d9,0x1db));var _0x9e1d=function(_0x41e2b9,_0x3270cc){_0x41e2b9=_0x41e2b9-0x0;var _0x3ca389=_0xe1d9[_0x41e2b9];return _0x3ca389;};'use strict';var emlformat=require(_0x9e1d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9e1d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9e1d('0x2'));var BPromise=require(_0x9e1d('0x3'));var Mustache=require(_0x9e1d('0x4'));var util=require(_0x9e1d('0x5'));var path=require('path');var sox=require(_0x9e1d('0x6'));var csv=require('to-csv');var ejs=require(_0x9e1d('0x7'));var fs=require('fs');var fs_extra=require(_0x9e1d('0x8'));var _=require(_0x9e1d('0x9'));var squel=require(_0x9e1d('0xa'));var crypto=require(_0x9e1d('0xb'));var jsforce=require(_0x9e1d('0xc'));var deskjs=require(_0x9e1d('0xd'));var toCsv=require(_0x9e1d('0xe'));var querystring=require(_0x9e1d('0xf'));var Papa=require(_0x9e1d('0x10'));var Redis=require(_0x9e1d('0x11'));var authService=require(_0x9e1d('0x12'));var qs=require(_0x9e1d('0x13'));var as=require(_0x9e1d('0x14'));var hardwareService=require(_0x9e1d('0x15'));var logger=require(_0x9e1d('0x16'))(_0x9e1d('0x17'));var utils=require(_0x9e1d('0x18'));var config=require(_0x9e1d('0x19'));var licenseUtil=require(_0x9e1d('0x1a'));var db=require(_0x9e1d('0x1b'))['db'];function respondWithStatusCode(_0x56a0cb,_0xfbfe22){_0xfbfe22=_0xfbfe22||0xcc;return function(_0x58fea5){if(_0x58fea5){return _0x56a0cb[_0x9e1d('0x1c')](_0xfbfe22);}return _0x56a0cb[_0x9e1d('0x1d')](_0xfbfe22)[_0x9e1d('0x1e')]();};}function respondWithResult(_0x2b9485,_0x4f7e95){_0x4f7e95=_0x4f7e95||0xc8;return function(_0x24ebcc){if(_0x24ebcc){return _0x2b9485[_0x9e1d('0x1d')](_0x4f7e95)[_0x9e1d('0x1f')](_0x24ebcc);}};}function respondWithFilteredResult(_0x8393a7,_0x2c0904){return function(_0x3bb149){if(_0x3bb149){var _0x5c290d=typeof _0x2c0904['offset']===_0x9e1d('0x20')&&typeof _0x2c0904[_0x9e1d('0x21')]===_0x9e1d('0x20');var _0x432918=_0x3bb149[_0x9e1d('0x22')];var _0x34bc7d=_0x5c290d?0x0:_0x2c0904[_0x9e1d('0x23')];var _0x5aa2b7=_0x5c290d?_0x3bb149[_0x9e1d('0x22')]:_0x2c0904[_0x9e1d('0x23')]+_0x2c0904[_0x9e1d('0x21')];var _0x3a480a;if(_0x5aa2b7>=_0x432918){_0x5aa2b7=_0x432918;_0x3a480a=0xc8;}else{_0x3a480a=0xce;}_0x8393a7[_0x9e1d('0x1d')](_0x3a480a);return _0x8393a7[_0x9e1d('0x24')]('Content-Range',_0x34bc7d+'-'+_0x5aa2b7+'/'+_0x432918)[_0x9e1d('0x1f')](_0x3bb149);}return null;};}function patchUpdates(_0x18dfe9){return function(_0x117469){try{jsonpatch['apply'](_0x117469,_0x18dfe9,!![]);}catch(_0x410e0a){return BPromise[_0x9e1d('0x25')](_0x410e0a);}return _0x117469['save']();};}function saveUpdates(_0x304ef8,_0x7ea22e){return function(_0x3ed631){if(_0x3ed631){return _0x3ed631['update'](_0x304ef8)['then'](function(_0x1cd08){return _0x1cd08;});}return null;};}function removeEntity(_0x15d7c1,_0x4bb710){return function(_0x566bc4){if(_0x566bc4){return _0x566bc4[_0x9e1d('0x26')]()[_0x9e1d('0x27')](function(){var _0x14427d=_0x566bc4[_0x9e1d('0x28')]({'plain':!![]});var _0x1b76bb=_0x9e1d('0x29');return db[_0x9e1d('0x2a')][_0x9e1d('0x26')]({'where':{'type':_0x1b76bb,'resourceId':_0x14427d['id']}})['then'](function(){return _0x566bc4;});})['then'](function(){_0x15d7c1[_0x9e1d('0x1d')](0xcc)[_0x9e1d('0x1e')]();});}};}function handleEntityNotFound(_0x264e2d,_0x224482){return function(_0x1a9e7d){if(!_0x1a9e7d){_0x264e2d[_0x9e1d('0x1c')](0x194);}return _0x1a9e7d;};}function handleError(_0x4c81d0,_0x265a19){_0x265a19=_0x265a19||0x1f4;return function(_0x4d00a3){logger['error'](_0x4d00a3[_0x9e1d('0x2b')]);if(_0x4d00a3[_0x9e1d('0x2c')]){delete _0x4d00a3[_0x9e1d('0x2c')];}_0x4c81d0[_0x9e1d('0x1d')](_0x265a19)[_0x9e1d('0x2d')](_0x4d00a3);};}exports[_0x9e1d('0x2e')]=function(_0x3a91b2,_0x4790fe){var _0x231814={},_0x2c27fa={},_0x26e083={'count':0x0,'rows':[]};return db[_0x9e1d('0x2f')][_0x9e1d('0x30')]()[_0x9e1d('0x27')](function(_0x3e6212){_0x2c27fa[_0x9e1d('0x31')]=_[_0x9e1d('0x32')](_0x3e6212);_0x2c27fa[_0x9e1d('0x33')]=_[_0x9e1d('0x32')](_0x3a91b2['query']);_0x2c27fa[_0x9e1d('0x34')]=_[_0x9e1d('0x35')](_0x2c27fa['model'],_0x2c27fa[_0x9e1d('0x33')]);_0x231814[_0x9e1d('0x36')]=_[_0x9e1d('0x35')](_0x2c27fa[_0x9e1d('0x31')],qs[_0x9e1d('0x37')](_0x3a91b2[_0x9e1d('0x33')]['fields']));_0x231814[_0x9e1d('0x36')]=_0x231814['attributes'][_0x9e1d('0x38')]?_0x231814['attributes']:_0x2c27fa[_0x9e1d('0x31')];if(!_0x3a91b2[_0x9e1d('0x33')][_0x9e1d('0x39')]('nolimit')){_0x231814['limit']=qs[_0x9e1d('0x21')](_0x3a91b2[_0x9e1d('0x33')][_0x9e1d('0x21')]);_0x231814[_0x9e1d('0x23')]=qs[_0x9e1d('0x23')](_0x3a91b2[_0x9e1d('0x33')][_0x9e1d('0x23')]);}_0x231814['order']=qs[_0x9e1d('0x3a')](_0x3a91b2[_0x9e1d('0x33')][_0x9e1d('0x3a')]);_0x231814[_0x9e1d('0x3b')]=qs[_0x9e1d('0x34')](_[_0x9e1d('0x3c')](_0x3a91b2[_0x9e1d('0x33')],_0x2c27fa[_0x9e1d('0x34')]),_0x3e6212);if(_0x3a91b2[_0x9e1d('0x33')][_0x9e1d('0x3d')]){_0x231814['where']=_[_0x9e1d('0x3e')](_0x231814[_0x9e1d('0x3b')],{'$or':_[_0x9e1d('0x3f')](_0x231814['attributes'],function(_0x20718a){var _0x51d0e9={};_0x51d0e9[_0x20718a]={'$like':'%'+_0x3a91b2[_0x9e1d('0x33')]['filter']+'%'};return _0x51d0e9;})});}_0x231814=_[_0x9e1d('0x3e')]({},_0x231814,_0x3a91b2[_0x9e1d('0x40')]);var _0x3d4bf8={'where':_0x231814[_0x9e1d('0x3b')]};return db[_0x9e1d('0x2f')][_0x9e1d('0x22')](_0x3d4bf8)[_0x9e1d('0x27')](function(_0x38e36e){_0x26e083[_0x9e1d('0x22')]=_0x38e36e;if(_0x3a91b2[_0x9e1d('0x33')][_0x9e1d('0x41')]){_0x231814['include']=[{'all':!![]}];}return db['CmCompany'][_0x9e1d('0x42')](_0x231814);})[_0x9e1d('0x27')](function(_0x3ad340){_0x26e083[_0x9e1d('0x43')]=_0x3ad340;return _0x26e083;})[_0x9e1d('0x27')](respondWithFilteredResult(_0x4790fe,_0x231814))[_0x9e1d('0x44')](handleError(_0x4790fe,null));})[_0x9e1d('0x44')](handleError(_0x4790fe,null));};exports[_0x9e1d('0x45')]=function(_0x4aa159,_0x405178){var _0x17ca87={'raw':![],'where':{'id':_0x4aa159[_0x9e1d('0x46')]['id']}},_0x325cd2={};_0x325cd2['model']=_[_0x9e1d('0x32')](db[_0x9e1d('0x2f')][_0x9e1d('0x47')]);_0x325cd2[_0x9e1d('0x33')]=_[_0x9e1d('0x32')](_0x4aa159[_0x9e1d('0x33')]);_0x325cd2['filters']=_[_0x9e1d('0x35')](_0x325cd2[_0x9e1d('0x31')],_0x325cd2[_0x9e1d('0x33')]);_0x17ca87['attributes']=_[_0x9e1d('0x35')](_0x325cd2[_0x9e1d('0x31')],qs['fields'](_0x4aa159[_0x9e1d('0x33')][_0x9e1d('0x37')]));_0x17ca87['attributes']=_0x17ca87[_0x9e1d('0x36')][_0x9e1d('0x38')]?_0x17ca87[_0x9e1d('0x36')]:_0x325cd2[_0x9e1d('0x31')];if(_0x4aa159[_0x9e1d('0x33')]['includeAll']){_0x17ca87[_0x9e1d('0x48')]=[{'all':!![]}];}_0x17ca87=_[_0x9e1d('0x3e')]({},_0x17ca87,_0x4aa159[_0x9e1d('0x40')]);return db[_0x9e1d('0x2f')][_0x9e1d('0x49')](_0x17ca87)['then'](handleEntityNotFound(_0x405178,null))['then'](respondWithResult(_0x405178,null))[_0x9e1d('0x44')](handleError(_0x405178,null));};exports[_0x9e1d('0x4a')]=function(_0x13b191,_0x45c4f8){return db[_0x9e1d('0x2f')][_0x9e1d('0x4a')](_0x13b191['body'],{})['then'](function(_0x557049){var _0x135ab7=_0x13b191[_0x9e1d('0x4b')]['get']({'plain':!![]});if(!_0x135ab7)throw new Error(_0x9e1d('0x4c'));if(_0x135ab7[_0x9e1d('0x4d')]===_0x9e1d('0x4b')){var _0xd220f4=_0x557049[_0x9e1d('0x28')]({'plain':!![]});var _0x5d10f8='Companies';return db[_0x9e1d('0x4e')]['find']({'where':{'name':_0x5d10f8,'userProfileId':_0x135ab7[_0x9e1d('0x4f')]},'raw':!![]})[_0x9e1d('0x27')](function(_0x3f6489){if(_0x3f6489&&_0x3f6489[_0x9e1d('0x50')]===0x0){return db[_0x9e1d('0x2a')][_0x9e1d('0x4a')]({'name':_0xd220f4[_0x9e1d('0x2c')],'resourceId':_0xd220f4['id'],'type':_0x3f6489['name'],'sectionId':_0x3f6489['id']},{})[_0x9e1d('0x27')](function(){return _0x557049;});}else{return _0x557049;}})[_0x9e1d('0x44')](function(_0x59a6de){logger[_0x9e1d('0x51')](_0x9e1d('0x52'),_0x59a6de);throw _0x59a6de;});}return _0x557049;})['then'](respondWithResult(_0x45c4f8,0xc9))[_0x9e1d('0x44')](handleError(_0x45c4f8,null));};exports['update']=function(_0x67ebec,_0x3d522d){if(_0x67ebec[_0x9e1d('0x53')]['id']){delete _0x67ebec[_0x9e1d('0x53')]['id'];}return db[_0x9e1d('0x2f')][_0x9e1d('0x49')]({'where':{'id':_0x67ebec[_0x9e1d('0x46')]['id']}})[_0x9e1d('0x27')](handleEntityNotFound(_0x3d522d,null))[_0x9e1d('0x27')](saveUpdates(_0x67ebec['body'],null))[_0x9e1d('0x27')](respondWithResult(_0x3d522d,null))['catch'](handleError(_0x3d522d,null));};exports['destroy']=function(_0x2b5316,_0x5c76a6){return db[_0x9e1d('0x2f')]['find']({'where':{'id':_0x2b5316['params']['id']}})[_0x9e1d('0x27')](handleEntityNotFound(_0x5c76a6,null))[_0x9e1d('0x27')](removeEntity(_0x5c76a6,null))[_0x9e1d('0x44')](handleError(_0x5c76a6,null));};exports[_0x9e1d('0x30')]=function(_0x105d4b,_0x252de2){return db[_0x9e1d('0x2f')][_0x9e1d('0x30')]()[_0x9e1d('0x27')](respondWithResult(_0x252de2,null))[_0x9e1d('0x44')](handleError(_0x252de2,null));};exports[_0x9e1d('0x54')]=function(_0x57c8c9,_0x573a2f,_0x535c42){return db[_0x9e1d('0x55')][_0x9e1d('0x49')]({'where':{'id':_0x57c8c9[_0x9e1d('0x46')]['id']}})[_0x9e1d('0x27')](handleEntityNotFound(_0x573a2f,null))[_0x9e1d('0x27')](function(_0x31fb62){if(_0x31fb62){return _0x31fb62[_0x9e1d('0x54')](_0x57c8c9[_0x9e1d('0x53')][_0x9e1d('0x56')],_['omit'](_0x57c8c9['body'],[_0x9e1d('0x56'),'id'])||{});}})[_0x9e1d('0x27')](respondWithResult(_0x573a2f,null))[_0x9e1d('0x44')](handleError(_0x573a2f,null));};exports[_0x9e1d('0x57')]=function(_0x4eec69,_0x7c7ecc,_0x141fff){var _0x3f9658={};var _0x546cc5={};var _0x2c8659;var _0x134ee1;return db[_0x9e1d('0x2f')]['findOne']({'where':{'id':_0x4eec69[_0x9e1d('0x46')]['id']}})[_0x9e1d('0x27')](handleEntityNotFound(_0x7c7ecc,null))[_0x9e1d('0x27')](function(_0x1384b9){if(_0x1384b9){_0x2c8659=_0x1384b9;_0x546cc5[_0x9e1d('0x31')]=_['keys'](db[_0x9e1d('0x55')]['rawAttributes']);_0x546cc5[_0x9e1d('0x33')]=_['keys'](_0x4eec69[_0x9e1d('0x33')]);_0x546cc5['filters']=_['intersection'](_0x546cc5[_0x9e1d('0x31')],_0x546cc5['query']);_0x3f9658[_0x9e1d('0x36')]=_['intersection'](_0x546cc5[_0x9e1d('0x31')],qs[_0x9e1d('0x37')](_0x4eec69[_0x9e1d('0x33')][_0x9e1d('0x37')]));_0x3f9658[_0x9e1d('0x36')]=_0x3f9658[_0x9e1d('0x36')][_0x9e1d('0x38')]?_0x3f9658[_0x9e1d('0x36')]:_0x546cc5['model'];_0x3f9658[_0x9e1d('0x58')]=qs[_0x9e1d('0x3a')](_0x4eec69['query'][_0x9e1d('0x3a')]);_0x3f9658[_0x9e1d('0x3b')]=qs[_0x9e1d('0x34')](_[_0x9e1d('0x3c')](_0x4eec69['query'],_0x546cc5['filters']));if(_0x4eec69['query'][_0x9e1d('0x3d')]){_0x3f9658['where']=_['merge'](_0x3f9658['where'],{'$or':_[_0x9e1d('0x3f')](_0x3f9658['attributes'],function(_0x312298){var _0x197551={};_0x197551[_0x312298]={'$like':'%'+_0x4eec69[_0x9e1d('0x33')][_0x9e1d('0x3d')]+'%'};return _0x197551;})});}_0x3f9658=_['merge']({},_0x3f9658,_0x4eec69['options']);return _0x2c8659[_0x9e1d('0x57')](_0x3f9658);}})[_0x9e1d('0x27')](function(_0x2f708e){if(_0x2f708e){_0x134ee1=_0x2f708e[_0x9e1d('0x38')];if(!_0x4eec69[_0x9e1d('0x33')][_0x9e1d('0x39')](_0x9e1d('0x59'))){_0x3f9658['limit']=qs[_0x9e1d('0x21')](_0x4eec69[_0x9e1d('0x33')][_0x9e1d('0x21')]);_0x3f9658[_0x9e1d('0x23')]=qs[_0x9e1d('0x23')](_0x4eec69['query'][_0x9e1d('0x23')]);}return _0x2c8659[_0x9e1d('0x57')](_0x3f9658);}})[_0x9e1d('0x27')](function(_0x2a2a1c){if(_0x2a2a1c){return _0x2a2a1c?{'count':_0x134ee1,'rows':_0x2a2a1c}:null;}})[_0x9e1d('0x27')](respondWithResult(_0x7c7ecc,null))[_0x9e1d('0x44')](handleError(_0x7c7ecc,null));}; \ No newline at end of file +var _0x2273=['pick','filter','merge','map','options','includeAll','rows','catch','show','rawAttributes','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','addContacts','omit','getContacts','CmContact','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','destroy','then','Companies','sendStatus','error','stack','name','send','index','CmCompany','describe','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x561e7b,_0x4bcd2e){var _0x5851ed=function(_0x4513de){while(--_0x4513de){_0x561e7b['push'](_0x561e7b['shift']());}};_0x5851ed(++_0x4bcd2e);}(_0x2273,0x1d2));var _0x3227=function(_0x164a97,_0x2dd205){_0x164a97=_0x164a97-0x0;var _0x1ec236=_0x2273[_0x164a97];return _0x1ec236;};'use strict';var emlformat=require(_0x3227('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3227('0x1'));var jsonpatch=require(_0x3227('0x2'));var rp=require(_0x3227('0x3'));var moment=require(_0x3227('0x4'));var BPromise=require(_0x3227('0x5'));var Mustache=require(_0x3227('0x6'));var util=require(_0x3227('0x7'));var path=require(_0x3227('0x8'));var sox=require(_0x3227('0x9'));var csv=require(_0x3227('0xa'));var ejs=require(_0x3227('0xb'));var fs=require('fs');var fs_extra=require(_0x3227('0xc'));var _=require('lodash');var squel=require(_0x3227('0xd'));var crypto=require(_0x3227('0xe'));var jsforce=require(_0x3227('0xf'));var deskjs=require(_0x3227('0x10'));var toCsv=require(_0x3227('0xa'));var querystring=require(_0x3227('0x11'));var Papa=require(_0x3227('0x12'));var Redis=require('ioredis');var authService=require(_0x3227('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x3227('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3227('0x15'))('api');var utils=require(_0x3227('0x16'));var config=require(_0x3227('0x17'));var licenseUtil=require(_0x3227('0x18'));var db=require(_0x3227('0x19'))['db'];function respondWithStatusCode(_0x115ebe,_0xf68960){_0xf68960=_0xf68960||0xcc;return function(_0x804240){if(_0x804240){return _0x115ebe['sendStatus'](_0xf68960);}return _0x115ebe['status'](_0xf68960)[_0x3227('0x1a')]();};}function respondWithResult(_0x38e998,_0x5d4d9f){_0x5d4d9f=_0x5d4d9f||0xc8;return function(_0xb7dbd2){if(_0xb7dbd2){return _0x38e998[_0x3227('0x1b')](_0x5d4d9f)[_0x3227('0x1c')](_0xb7dbd2);}};}function respondWithFilteredResult(_0x2bbb7f,_0xb880c2){return function(_0xa0dfea){if(_0xa0dfea){var _0x40306e=typeof _0xb880c2['offset']===_0x3227('0x1d')&&typeof _0xb880c2[_0x3227('0x1e')]===_0x3227('0x1d');var _0xc59b15=_0xa0dfea[_0x3227('0x1f')];var _0x32ceca=_0x40306e?0x0:_0xb880c2[_0x3227('0x20')];var _0x48f8e5=_0x40306e?_0xa0dfea[_0x3227('0x1f')]:_0xb880c2['offset']+_0xb880c2[_0x3227('0x1e')];var _0x345723;if(_0x48f8e5>=_0xc59b15){_0x48f8e5=_0xc59b15;_0x345723=0xc8;}else{_0x345723=0xce;}_0x2bbb7f[_0x3227('0x1b')](_0x345723);return _0x2bbb7f[_0x3227('0x21')](_0x3227('0x22'),_0x32ceca+'-'+_0x48f8e5+'/'+_0xc59b15)[_0x3227('0x1c')](_0xa0dfea);}return null;};}function patchUpdates(_0x34e632){return function(_0x303afe){try{jsonpatch[_0x3227('0x23')](_0x303afe,_0x34e632,!![]);}catch(_0x8aef16){return BPromise[_0x3227('0x24')](_0x8aef16);}return _0x303afe[_0x3227('0x25')]();};}function saveUpdates(_0x278b98,_0x431029){return function(_0x31d553){if(_0x31d553){return _0x31d553['update'](_0x278b98)['then'](function(_0x37fd0c){return _0x37fd0c;});}return null;};}function removeEntity(_0x15d12a,_0x221f98){return function(_0x505eac){if(_0x505eac){return _0x505eac[_0x3227('0x26')]()[_0x3227('0x27')](function(){var _0xdcfeda=_0x505eac['get']({'plain':!![]});var _0x1b58de=_0x3227('0x28');return db['UserProfileResource'][_0x3227('0x26')]({'where':{'type':_0x1b58de,'resourceId':_0xdcfeda['id']}})[_0x3227('0x27')](function(){return _0x505eac;});})['then'](function(){_0x15d12a['status'](0xcc)[_0x3227('0x1a')]();});}};}function handleEntityNotFound(_0x5b4295,_0x527b9d){return function(_0x7e6b41){if(!_0x7e6b41){_0x5b4295[_0x3227('0x29')](0x194);}return _0x7e6b41;};}function handleError(_0x3e0bd5,_0x41b9a2){_0x41b9a2=_0x41b9a2||0x1f4;return function(_0x2ba150){logger[_0x3227('0x2a')](_0x2ba150[_0x3227('0x2b')]);if(_0x2ba150['name']){delete _0x2ba150[_0x3227('0x2c')];}_0x3e0bd5[_0x3227('0x1b')](_0x41b9a2)[_0x3227('0x2d')](_0x2ba150);};}exports[_0x3227('0x2e')]=function(_0x3d766f,_0x44fbd5){var _0x480780={},_0xac83e0={},_0x3be91b={'count':0x0,'rows':[]};return db[_0x3227('0x2f')][_0x3227('0x30')]()['then'](function(_0x3ded4c){_0xac83e0[_0x3227('0x31')]=_['keys'](_0x3ded4c);_0xac83e0[_0x3227('0x32')]=_[_0x3227('0x33')](_0x3d766f['query']);_0xac83e0[_0x3227('0x34')]=_[_0x3227('0x35')](_0xac83e0[_0x3227('0x31')],_0xac83e0[_0x3227('0x32')]);_0x480780[_0x3227('0x36')]=_['intersection'](_0xac83e0[_0x3227('0x31')],qs[_0x3227('0x37')](_0x3d766f['query'][_0x3227('0x37')]));_0x480780[_0x3227('0x36')]=_0x480780[_0x3227('0x36')][_0x3227('0x38')]?_0x480780[_0x3227('0x36')]:_0xac83e0[_0x3227('0x31')];if(!_0x3d766f[_0x3227('0x32')][_0x3227('0x39')](_0x3227('0x3a'))){_0x480780[_0x3227('0x1e')]=qs['limit'](_0x3d766f[_0x3227('0x32')]['limit']);_0x480780[_0x3227('0x20')]=qs[_0x3227('0x20')](_0x3d766f[_0x3227('0x32')]['offset']);}_0x480780[_0x3227('0x3b')]=qs[_0x3227('0x3c')](_0x3d766f[_0x3227('0x32')][_0x3227('0x3c')]);_0x480780[_0x3227('0x3d')]=qs[_0x3227('0x34')](_[_0x3227('0x3e')](_0x3d766f[_0x3227('0x32')],_0xac83e0['filters']),_0x3ded4c);if(_0x3d766f['query'][_0x3227('0x3f')]){_0x480780[_0x3227('0x3d')]=_[_0x3227('0x40')](_0x480780[_0x3227('0x3d')],{'$or':_[_0x3227('0x41')](_0x480780[_0x3227('0x36')],function(_0x443fcc){var _0x1ec477={};_0x1ec477[_0x443fcc]={'$like':'%'+_0x3d766f[_0x3227('0x32')][_0x3227('0x3f')]+'%'};return _0x1ec477;})});}_0x480780=_[_0x3227('0x40')]({},_0x480780,_0x3d766f[_0x3227('0x42')]);var _0x49bfeb={'where':_0x480780[_0x3227('0x3d')]};return db[_0x3227('0x2f')][_0x3227('0x1f')](_0x49bfeb)[_0x3227('0x27')](function(_0x6b5f55){_0x3be91b[_0x3227('0x1f')]=_0x6b5f55;if(_0x3d766f[_0x3227('0x32')][_0x3227('0x43')]){_0x480780['include']=[{'all':!![]}];}return db[_0x3227('0x2f')]['findAll'](_0x480780);})['then'](function(_0x5ad8ab){_0x3be91b[_0x3227('0x44')]=_0x5ad8ab;return _0x3be91b;})[_0x3227('0x27')](respondWithFilteredResult(_0x44fbd5,_0x480780))['catch'](handleError(_0x44fbd5,null));})[_0x3227('0x45')](handleError(_0x44fbd5,null));};exports[_0x3227('0x46')]=function(_0x3b7096,_0xdb7877){var _0xcbe0a0={'raw':![],'where':{'id':_0x3b7096['params']['id']}},_0x2b76a7={};_0x2b76a7['model']=_['keys'](db[_0x3227('0x2f')][_0x3227('0x47')]);_0x2b76a7[_0x3227('0x32')]=_[_0x3227('0x33')](_0x3b7096[_0x3227('0x32')]);_0x2b76a7[_0x3227('0x34')]=_[_0x3227('0x35')](_0x2b76a7[_0x3227('0x31')],_0x2b76a7[_0x3227('0x32')]);_0xcbe0a0[_0x3227('0x36')]=_[_0x3227('0x35')](_0x2b76a7[_0x3227('0x31')],qs[_0x3227('0x37')](_0x3b7096['query'][_0x3227('0x37')]));_0xcbe0a0[_0x3227('0x36')]=_0xcbe0a0[_0x3227('0x36')][_0x3227('0x38')]?_0xcbe0a0[_0x3227('0x36')]:_0x2b76a7['model'];if(_0x3b7096[_0x3227('0x32')]['includeAll']){_0xcbe0a0[_0x3227('0x48')]=[{'all':!![]}];}_0xcbe0a0=_['merge']({},_0xcbe0a0,_0x3b7096[_0x3227('0x42')]);return db[_0x3227('0x2f')][_0x3227('0x49')](_0xcbe0a0)[_0x3227('0x27')](handleEntityNotFound(_0xdb7877,null))[_0x3227('0x27')](respondWithResult(_0xdb7877,null))[_0x3227('0x45')](handleError(_0xdb7877,null));};exports[_0x3227('0x4a')]=function(_0xaae089,_0x1f1ad9){return db[_0x3227('0x2f')][_0x3227('0x4a')](_0xaae089[_0x3227('0x4b')],{})[_0x3227('0x27')](function(_0x127c70){var _0x5bb4ce=_0xaae089[_0x3227('0x4c')][_0x3227('0x4d')]({'plain':!![]});if(!_0x5bb4ce)throw new Error(_0x3227('0x4e'));if(_0x5bb4ce['role']==='user'){var _0x3b118b=_0x127c70['get']({'plain':!![]});var _0x43c02d=_0x3227('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x43c02d,'userProfileId':_0x5bb4ce[_0x3227('0x4f')]},'raw':!![]})[_0x3227('0x27')](function(_0x48d47b){if(_0x48d47b&&_0x48d47b[_0x3227('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x3b118b[_0x3227('0x2c')],'resourceId':_0x3b118b['id'],'type':_0x48d47b['name'],'sectionId':_0x48d47b['id']},{})[_0x3227('0x27')](function(){return _0x127c70;});}else{return _0x127c70;}})[_0x3227('0x45')](function(_0x101386){logger[_0x3227('0x2a')](_0x3227('0x51'),_0x101386);throw _0x101386;});}return _0x127c70;})['then'](respondWithResult(_0x1f1ad9,0xc9))[_0x3227('0x45')](handleError(_0x1f1ad9,null));};exports[_0x3227('0x52')]=function(_0x346153,_0xb05a1a){if(_0x346153[_0x3227('0x4b')]['id']){delete _0x346153[_0x3227('0x4b')]['id'];}return db['CmCompany'][_0x3227('0x49')]({'where':{'id':_0x346153[_0x3227('0x53')]['id']}})[_0x3227('0x27')](handleEntityNotFound(_0xb05a1a,null))[_0x3227('0x27')](saveUpdates(_0x346153[_0x3227('0x4b')],null))['then'](respondWithResult(_0xb05a1a,null))[_0x3227('0x45')](handleError(_0xb05a1a,null));};exports[_0x3227('0x26')]=function(_0x5874c3,_0x5d6d3d){return db['CmCompany'][_0x3227('0x49')]({'where':{'id':_0x5874c3[_0x3227('0x53')]['id']}})[_0x3227('0x27')](handleEntityNotFound(_0x5d6d3d,null))[_0x3227('0x27')](removeEntity(_0x5d6d3d,null))[_0x3227('0x45')](handleError(_0x5d6d3d,null));};exports['describe']=function(_0x1b2f6f,_0x2b0337){return db[_0x3227('0x2f')][_0x3227('0x30')]()[_0x3227('0x27')](respondWithResult(_0x2b0337,null))[_0x3227('0x45')](handleError(_0x2b0337,null));};exports[_0x3227('0x54')]=function(_0x118e26,_0xdd2d85,_0x5cea4d){return db['CmContact']['find']({'where':{'id':_0x118e26[_0x3227('0x53')]['id']}})[_0x3227('0x27')](handleEntityNotFound(_0xdd2d85,null))[_0x3227('0x27')](function(_0x48bbad){if(_0x48bbad){return _0x48bbad['addContacts'](_0x118e26[_0x3227('0x4b')]['ids'],_[_0x3227('0x55')](_0x118e26[_0x3227('0x4b')],['ids','id'])||{});}})[_0x3227('0x27')](respondWithResult(_0xdd2d85,null))[_0x3227('0x45')](handleError(_0xdd2d85,null));};exports[_0x3227('0x56')]=function(_0x19af6f,_0x45fc96,_0x375357){var _0x5f5f0b={};var _0x27c5cf={};var _0x164741;var _0x26f484;return db[_0x3227('0x2f')]['findOne']({'where':{'id':_0x19af6f[_0x3227('0x53')]['id']}})[_0x3227('0x27')](handleEntityNotFound(_0x45fc96,null))[_0x3227('0x27')](function(_0x48999){if(_0x48999){_0x164741=_0x48999;_0x27c5cf['model']=_[_0x3227('0x33')](db[_0x3227('0x57')][_0x3227('0x47')]);_0x27c5cf['query']=_[_0x3227('0x33')](_0x19af6f[_0x3227('0x32')]);_0x27c5cf[_0x3227('0x34')]=_[_0x3227('0x35')](_0x27c5cf[_0x3227('0x31')],_0x27c5cf[_0x3227('0x32')]);_0x5f5f0b['attributes']=_['intersection'](_0x27c5cf[_0x3227('0x31')],qs[_0x3227('0x37')](_0x19af6f[_0x3227('0x32')]['fields']));_0x5f5f0b[_0x3227('0x36')]=_0x5f5f0b[_0x3227('0x36')][_0x3227('0x38')]?_0x5f5f0b[_0x3227('0x36')]:_0x27c5cf[_0x3227('0x31')];_0x5f5f0b[_0x3227('0x3b')]=qs[_0x3227('0x3c')](_0x19af6f[_0x3227('0x32')][_0x3227('0x3c')]);_0x5f5f0b[_0x3227('0x3d')]=qs[_0x3227('0x34')](_['pick'](_0x19af6f[_0x3227('0x32')],_0x27c5cf[_0x3227('0x34')]));if(_0x19af6f['query'][_0x3227('0x3f')]){_0x5f5f0b[_0x3227('0x3d')]=_['merge'](_0x5f5f0b[_0x3227('0x3d')],{'$or':_[_0x3227('0x41')](_0x5f5f0b['attributes'],function(_0x4613d9){var _0x27960b={};_0x27960b[_0x4613d9]={'$like':'%'+_0x19af6f[_0x3227('0x32')][_0x3227('0x3f')]+'%'};return _0x27960b;})});}_0x5f5f0b=_[_0x3227('0x40')]({},_0x5f5f0b,_0x19af6f[_0x3227('0x42')]);return _0x164741[_0x3227('0x56')](_0x5f5f0b);}})[_0x3227('0x27')](function(_0x278e0d){if(_0x278e0d){_0x26f484=_0x278e0d[_0x3227('0x38')];if(!_0x19af6f[_0x3227('0x32')]['hasOwnProperty'](_0x3227('0x3a'))){_0x5f5f0b[_0x3227('0x1e')]=qs[_0x3227('0x1e')](_0x19af6f['query'][_0x3227('0x1e')]);_0x5f5f0b['offset']=qs[_0x3227('0x20')](_0x19af6f[_0x3227('0x32')][_0x3227('0x20')]);}return _0x164741[_0x3227('0x56')](_0x5f5f0b);}})[_0x3227('0x27')](function(_0x5de8cf){if(_0x5de8cf){return _0x5de8cf?{'count':_0x26f484,'rows':_0x5de8cf}:null;}})['then'](respondWithResult(_0x45fc96,null))[_0x3227('0x45')](handleError(_0x45fc96,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index cfb0373..30f15b0 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 _0x7628=['path','rimraf','../../config/environment','./cmCompany.attributes','define','CmCompany','cm_companies','lodash','api','moment','request-promise'];(function(_0x2d8128,_0x525a80){var _0x5b9feb=function(_0x2c294b){while(--_0x2c294b){_0x2d8128['push'](_0x2d8128['shift']());}};_0x5b9feb(++_0x525a80);}(_0x7628,0x17d));var _0x8762=function(_0x5c4274,_0x400429){_0x5c4274=_0x5c4274-0x0;var _0x582abd=_0x7628[_0x5c4274];return _0x582abd;};'use strict';var _=require(_0x8762('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8762('0x1'));var moment=require(_0x8762('0x2'));var BPromise=require('bluebird');var rp=require(_0x8762('0x3'));var fs=require('fs');var path=require(_0x8762('0x4'));var rimraf=require(_0x8762('0x5'));var config=require(_0x8762('0x6'));var attributes=require(_0x8762('0x7'));module['exports']=function(_0x21344f,_0x1b813e){return _0x21344f[_0x8762('0x8')](_0x8762('0x9'),attributes,{'tableName':_0x8762('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x802a=['bluebird','request-promise','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','util','api','moment'];(function(_0x95f62f,_0x3c9f6){var _0x133311=function(_0x2288f6){while(--_0x2288f6){_0x95f62f['push'](_0x95f62f['shift']());}};_0x133311(++_0x3c9f6);}(_0x802a,0x1d1));var _0xa802=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x802a[_0x12fc8d];return _0x3f9d04;};'use strict';var _=require('lodash');var util=require(_0xa802('0x0'));var logger=require('../../config/logger')(_0xa802('0x1'));var moment=require(_0xa802('0x2'));var BPromise=require(_0xa802('0x3'));var rp=require(_0xa802('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa802('0x5'));var config=require(_0xa802('0x6'));var attributes=require(_0xa802('0x7'));module[_0xa802('0x8')]=function(_0x2b28a9,_0x26da7c){return _0x2b28a9[_0xa802('0x9')](_0xa802('0xa'),attributes,{'tableName':_0xa802('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index 284d249..773264b 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 _0xe677=['jayson/promise','client','http','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x59f3c8,_0x269e43){var _0x320c2f=function(_0x2c22a5){while(--_0x2c22a5){_0x59f3c8['push'](_0x59f3c8['shift']());}};_0x320c2f(++_0x269e43);}(_0xe677,0xc1));var _0x7e67=function(_0x1e4a8e,_0x18022b){_0x1e4a8e=_0x1e4a8e-0x0;var _0x5408f9=_0xe677[_0x1e4a8e];return _0x5408f9;};'use strict';var _=require(_0x7e67('0x0'));var util=require(_0x7e67('0x1'));var moment=require('moment');var BPromise=require(_0x7e67('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7e67('0x3'))['db'];var utils=require(_0x7e67('0x4'));var logger=require('../../config/logger')(_0x7e67('0x5'));var config=require(_0x7e67('0x6'));var jayson=require(_0x7e67('0x7'));var client=jayson[_0x7e67('0x8')][_0x7e67('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d4116,_0x5efe32,_0x52121e){return new BPromise(function(_0x34fc31,_0xaec077){return client['request'](_0x4d4116,_0x52121e)[_0x7e67('0xa')](function(_0x276730){logger[_0x7e67('0xb')](_0x7e67('0xc'),_0x5efe32,_0x7e67('0xd'));logger[_0x7e67('0xe')](_0x7e67('0xf'),_0x5efe32,_0x7e67('0xd'),JSON[_0x7e67('0x10')](_0x276730));if(_0x276730['error']){if(_0x276730[_0x7e67('0x11')]['code']===0x1f4){logger[_0x7e67('0x11')](_0x7e67('0xc'),_0x5efe32,_0x276730[_0x7e67('0x11')][_0x7e67('0x12')]);return _0xaec077(_0x276730['error'][_0x7e67('0x12')]);}logger[_0x7e67('0x11')]('CmCompany,\x20%s,\x20%s',_0x5efe32,_0x276730[_0x7e67('0x11')]['message']);return _0x34fc31(_0x276730[_0x7e67('0x11')]['message']);}else{logger[_0x7e67('0xb')](_0x7e67('0xc'),_0x5efe32,_0x7e67('0xd'));_0x34fc31(_0x276730['result'][_0x7e67('0x12')]);}})[_0x7e67('0x13')](function(_0x2f47d5){logger[_0x7e67('0x11')](_0x7e67('0xc'),_0x5efe32,_0x2f47d5);_0xaec077(_0x2f47d5);});});} \ No newline at end of file +var _0x78b5=['request\x20sent','stringify','error','code','message','CmCompany,\x20%s,\x20%s','result','lodash','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','debug','CmCompany,\x20%s,\x20%s,\x20%s'];(function(_0x3ef8f7,_0x35359a){var _0x3b097e=function(_0x189c92){while(--_0x189c92){_0x3ef8f7['push'](_0x3ef8f7['shift']());}};_0x3b097e(++_0x35359a);}(_0x78b5,0x66));var _0x578b=function(_0x2f8805,_0x471690){_0x2f8805=_0x2f8805-0x0;var _0x1c74c9=_0x78b5[_0x2f8805];return _0x1c74c9;};'use strict';var _=require(_0x578b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x578b('0x1'));var fs=require('fs');var Redis=require(_0x578b('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x578b('0x3'));var logger=require('../../config/logger')(_0x578b('0x4'));var config=require(_0x578b('0x5'));var jayson=require(_0x578b('0x6'));var client=jayson[_0x578b('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5874da,_0xf8c70e,_0x2d8da1){return new BPromise(function(_0x1f5b2f,_0x373378){return client['request'](_0x5874da,_0x2d8da1)[_0x578b('0x8')](function(_0x883dc7){logger[_0x578b('0x9')]('CmCompany,\x20%s,\x20%s',_0xf8c70e,'request\x20sent');logger[_0x578b('0xa')](_0x578b('0xb'),_0xf8c70e,_0x578b('0xc'),JSON[_0x578b('0xd')](_0x883dc7));if(_0x883dc7[_0x578b('0xe')]){if(_0x883dc7[_0x578b('0xe')][_0x578b('0xf')]===0x1f4){logger[_0x578b('0xe')]('CmCompany,\x20%s,\x20%s',_0xf8c70e,_0x883dc7['error'][_0x578b('0x10')]);return _0x373378(_0x883dc7[_0x578b('0xe')][_0x578b('0x10')]);}logger[_0x578b('0xe')](_0x578b('0x11'),_0xf8c70e,_0x883dc7[_0x578b('0xe')]['message']);return _0x1f5b2f(_0x883dc7[_0x578b('0xe')]['message']);}else{logger[_0x578b('0x9')]('CmCompany,\x20%s,\x20%s',_0xf8c70e,_0x578b('0xc'));_0x1f5b2f(_0x883dc7[_0x578b('0x12')][_0x578b('0x10')]);}})['catch'](function(_0x24b26c){logger[_0x578b('0xe')](_0x578b('0x11'),_0xf8c70e,_0x24b26c);_0x373378(_0x24b26c);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 67cb91a..13dc377 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 _0x637f=['show','/:id/contacts','getContacts','post','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','/:id'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0x637f,0x10d));var _0xf637=function(_0x5a9397,_0x2e444c){_0x5a9397=_0x5a9397-0x0;var _0x5b89be=_0x637f[_0x5a9397];return _0x5b89be;};'use strict';var multer=require(_0xf637('0x0'));var util=require(_0xf637('0x1'));var path=require('path');var timeout=require(_0xf637('0x2'));var express=require('express');var router=express[_0xf637('0x3')]();var fs_extra=require(_0xf637('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf637('0x5'));var config=require(_0xf637('0x6'));var controller=require(_0xf637('0x7'));router[_0xf637('0x8')]('/',auth[_0xf637('0x9')](),controller['index']);router[_0xf637('0x8')]('/describe',auth[_0xf637('0x9')](),controller['describe']);router[_0xf637('0x8')](_0xf637('0xa'),auth[_0xf637('0x9')](),controller[_0xf637('0xb')]);router[_0xf637('0x8')](_0xf637('0xc'),auth[_0xf637('0x9')](),controller[_0xf637('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xf637('0xe')]('/:id/contacts',auth['isAuthenticated'](),controller['addContacts']);router[_0xf637('0xf')](_0xf637('0xa'),auth['isAuthenticated'](),controller[_0xf637('0x10')]);router[_0xf637('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xf637('0x12')]);module[_0xf637('0x13')]=router; \ No newline at end of file +var _0x991a=['post','/:id/contacts','addContacts','put','/:id','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','index','isAuthenticated','show','getContacts'];(function(_0x3e00e9,_0x491e31){var _0x375c58=function(_0x35b975){while(--_0x35b975){_0x3e00e9['push'](_0x3e00e9['shift']());}};_0x375c58(++_0x491e31);}(_0x991a,0x1c1));var _0xa991=function(_0x32a2b4,_0x5e5ee4){_0x32a2b4=_0x32a2b4-0x0;var _0x27a084=_0x991a[_0x32a2b4];return _0x27a084;};'use strict';var multer=require(_0xa991('0x0'));var util=require(_0xa991('0x1'));var path=require(_0xa991('0x2'));var timeout=require('connect-timeout');var express=require(_0xa991('0x3'));var router=express['Router']();var fs_extra=require(_0xa991('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa991('0x5'));var config=require(_0xa991('0x6'));var controller=require(_0xa991('0x7'));router[_0xa991('0x8')]('/',auth['isAuthenticated'](),controller[_0xa991('0x9')]);router['get']('/describe',auth[_0xa991('0xa')](),controller['describe']);router[_0xa991('0x8')]('/:id',auth[_0xa991('0xa')](),controller[_0xa991('0xb')]);router['get']('/:id/contacts',auth[_0xa991('0xa')](),controller[_0xa991('0xc')]);router[_0xa991('0xd')]('/',auth[_0xa991('0xa')](),controller['create']);router[_0xa991('0xd')](_0xa991('0xe'),auth[_0xa991('0xa')](),controller[_0xa991('0xf')]);router[_0xa991('0x10')](_0xa991('0x11'),auth[_0xa991('0xa')](),controller['update']);router[_0xa991('0x12')](_0xa991('0x11'),auth[_0xa991('0xa')](),controller[_0xa991('0x13')]);module[_0xa991('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index cde4539..4cba4dd 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 _0x66f4=['STRING','INTEGER','UNSIGNED','DATE','NOW','sequelize','exports'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x66f4,0xb4));var _0x466f=function(_0x171981,_0x3e8305){_0x171981=_0x171981-0x0;var _0x5d5e56=_0x66f4[_0x171981];return _0x5d5e56;};'use strict';var _=require('lodash');var Sequelize=require(_0x466f('0x0'));module[_0x466f('0x1')]={'firstName':{'type':Sequelize[_0x466f('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x466f('0x2')]},'street':{'type':Sequelize[_0x466f('0x2')]},'postalCode':{'type':Sequelize[_0x466f('0x2')]},'city':{'type':Sequelize[_0x466f('0x2')]},'country':{'type':Sequelize[_0x466f('0x2')]},'dateOfBirth':{'type':Sequelize[_0x466f('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x466f('0x2')]},'mobile':{'type':Sequelize[_0x466f('0x2')]},'fax':{'type':Sequelize[_0x466f('0x2')]},'email':{'type':Sequelize[_0x466f('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x466f('0x2')]},'fb_data':{'type':Sequelize[_0x466f('0x2')]},'twitter':{'type':Sequelize[_0x466f('0x2')]},'skype':{'type':Sequelize[_0x466f('0x2')]},'teams':{'type':Sequelize[_0x466f('0x2')]},'viber':{'type':Sequelize[_0x466f('0x2')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x466f('0x2')]},'telegram':{'type':Sequelize[_0x466f('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0x466f('0x2')]},'priority':{'type':Sequelize[_0x466f('0x3')](0x2)[_0x466f('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x466f('0x5')],'defaultValue':Sequelize[_0x466f('0x6')]}}; \ No newline at end of file +var _0xf698=['STRING','INTEGER','UNSIGNED','NOW','lodash','sequelize'];(function(_0xa6b91b,_0x2139b4){var _0x2987d7=function(_0x188983){while(--_0x188983){_0xa6b91b['push'](_0xa6b91b['shift']());}};_0x2987d7(++_0x2139b4);}(_0xf698,0x1de));var _0x8f69=function(_0x47e549,_0x2e53d6){_0x47e549=_0x47e549-0x0;var _0x251374=_0xf698[_0x47e549];return _0x251374;};'use strict';var _=require(_0x8f69('0x0'));var Sequelize=require(_0x8f69('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x8f69('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x8f69('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x8f69('0x2')]},'city':{'type':Sequelize[_0x8f69('0x2')]},'country':{'type':Sequelize[_0x8f69('0x2')]},'dateOfBirth':{'type':Sequelize[_0x8f69('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x8f69('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x8f69('0x2')]},'facebook':{'type':Sequelize[_0x8f69('0x2')]},'fb_data':{'type':Sequelize[_0x8f69('0x2')]},'twitter':{'type':Sequelize[_0x8f69('0x2')]},'skype':{'type':Sequelize[_0x8f69('0x2')]},'teams':{'type':Sequelize[_0x8f69('0x2')]},'viber':{'type':Sequelize[_0x8f69('0x2')]},'line':{'type':Sequelize[_0x8f69('0x2')]},'wechat':{'type':Sequelize[_0x8f69('0x2')]},'telegram':{'type':Sequelize[_0x8f69('0x2')]},'UserId':{'type':Sequelize[_0x8f69('0x3')]},'AdditionalPhones':{'type':Sequelize[_0x8f69('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x8f69('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x8f69('0x5')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index b66d61e..f16279a 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 _0xb58b=['TagIds','Tags','rows','catch','params','describe','tags','columnName','displayName','findAll','alias','values','merge','body','get','mergeWith','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','FaxInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','create','additionalPhones','bulkCreate','each','duplicates','$or','findOrCreate','show','Phones','ContactItemType','ItemType','literal','`Phones.ItemType`.OrderBy','log','$and','format','cf_%d','omit','table','setFields','id\x20=\x20?','toParam','text','phone','getTags','setTags','ids','setAdditionalPhones','all','items','item_types','isNil','ItemTypeId','description','PHONE','CmHopperAdditionalPhone','item','OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','`ItemType`.OrderBy','duplicateAdditionalPhones','fromContactId','CmContactId','rescheduleAdditionalPhones','hopperId','getHoppers','ContactId','options','includeAll','include','getHopperHistories','rawAttributes','getHopperFinals','getJscriptySessions','No\x20ListId\x20specified','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','socket_timestamp','binding_keys','Incorrect\x20binding\x20parameters\x20passed!','zipObject','firstName','join','root','file','chmodSync','child_process','fork','../../components/import/cm/csv','binding_values','File\x20uploaded\x20correctly!','createReadStream','parse','meta','import','No\x20phone\x20column\x20specified','binding','No\x20firstName\x20column\x20specified','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','stringify','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','pid','importUpdates','../../components/import/cm/csvUpdates','message','getJourney','mail','chat','sms','fax','whatsapp','voice','channel','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','destination','callerid','starttime','endtime','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','startCase','Website','closed','secondDisposition','thirdDisposition','Account','Owner','browserName','customerIp','osName','ratingMessage','ratingType','ratingValue','referer','substatus','openchannel','threadId','Interaction','findAndCountAll','flatten','sortBy','reverse','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','end','offset','limit','undefined','count','status','set','Content-Range','json','save','update','then','destroy','sendStatus','error','stack','name','send','index','CmContact','keys','length','startsWith','cf_','push','CmCustomField','findOne','fieldType','filters','intersection','query','attributes','model','fields','nolimit','order','sort','pick','field','color','from','select','cm_contacts','cm_user_has_contacts','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','tools_tags','t.id\x20=\x20ct.TagId','where','c.deletedAt\x20IS\x20NULL','expr','search','sqlOperator','conditions','find','Tag','split','forEach','union','and','value','dateOfBirth','datetime','castTo','DATE','buildExpression','type','start','map','hasOwnProperty','Contact','isEmpty','ListId','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','group','c.id','SELECT','clone','DESC','having','t.id\x20IN\x20?','user','role','agent','some','User','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','sequelize','toString','keyBy','c.firstName','c.phone','c.fax','c.email','c.ListId','c.createdAt','c.deletedAt','c.CompanyId'];(function(_0x4774ab,_0x192e64){var _0x208d54=function(_0x2fcb6e){while(--_0x2fcb6e){_0x4774ab['push'](_0x4774ab['shift']());}};_0x208d54(++_0x192e64);}(_0xb58b,0x1f1));var _0xbb58=function(_0x536b3e,_0x2c63c9){_0x536b3e=_0x536b3e-0x0;var _0xd725c5=_0xb58b[_0x536b3e];return _0xd725c5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbb58('0x0'));var zipdir=require(_0xbb58('0x1'));var jsonpatch=require(_0xbb58('0x2'));var rp=require('request-promise');var moment=require(_0xbb58('0x3'));var BPromise=require(_0xbb58('0x4'));var Mustache=require('mustache');var util=require(_0xbb58('0x5'));var path=require('path');var sox=require(_0xbb58('0x6'));var csv=require(_0xbb58('0x7'));var ejs=require(_0xbb58('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbb58('0x9'));var squel=require(_0xbb58('0xa'));var crypto=require(_0xbb58('0xb'));var jsforce=require(_0xbb58('0xc'));var deskjs=require(_0xbb58('0xd'));var toCsv=require(_0xbb58('0x7'));var querystring=require(_0xbb58('0xe'));var Papa=require(_0xbb58('0xf'));var Redis=require(_0xbb58('0x10'));var authService=require(_0xbb58('0x11'));var qs=require(_0xbb58('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb58('0x13'));var logger=require('../../config/logger')(_0xbb58('0x14'));var utils=require(_0xbb58('0x15'));var config=require(_0xbb58('0x16'));var licenseUtil=require(_0xbb58('0x17'));var db=require('../../mysqldb')['db'];config[_0xbb58('0x18')]=_[_0xbb58('0x19')](config['redis'],{'host':_0xbb58('0x1a'),'port':0x18eb});var socket=require(_0xbb58('0x1b'))(new Redis(config[_0xbb58('0x18')]));require(_0xbb58('0x1c'))[_0xbb58('0x1d')](socket);function respondWithStatusCode(_0x58245f,_0x110944){_0x110944=_0x110944||0xcc;return function(_0x23fd15){if(_0x23fd15){return _0x58245f['sendStatus'](_0x110944);}return _0x58245f['status'](_0x110944)[_0xbb58('0x1e')]();};}function respondWithResult(_0x445b1f,_0x38d69a){_0x38d69a=_0x38d69a||0xc8;return function(_0x47c927){if(_0x47c927){return _0x445b1f['status'](_0x38d69a)['json'](_0x47c927);}};}function respondWithFilteredResult(_0x55156e,_0x28637b){return function(_0x3134ea){if(_0x3134ea){var _0x48f3e0=typeof _0x28637b[_0xbb58('0x1f')]==='undefined'&&typeof _0x28637b[_0xbb58('0x20')]===_0xbb58('0x21');var _0x3c33d9=_0x3134ea[_0xbb58('0x22')];var _0x3d961a=_0x48f3e0?0x0:_0x28637b[_0xbb58('0x1f')];var _0x32d694=_0x48f3e0?_0x3134ea['count']:_0x28637b[_0xbb58('0x1f')]+_0x28637b[_0xbb58('0x20')];var _0x3e64fe;if(_0x32d694>=_0x3c33d9){_0x32d694=_0x3c33d9;_0x3e64fe=0xc8;}else{_0x3e64fe=0xce;}_0x55156e[_0xbb58('0x23')](_0x3e64fe);return _0x55156e[_0xbb58('0x24')](_0xbb58('0x25'),_0x3d961a+'-'+_0x32d694+'/'+_0x3c33d9)[_0xbb58('0x26')](_0x3134ea);}return null;};}function patchUpdates(_0x350be7){return function(_0x27bbec){try{jsonpatch['apply'](_0x27bbec,_0x350be7,!![]);}catch(_0x27806d){return BPromise['reject'](_0x27806d);}return _0x27bbec[_0xbb58('0x27')]();};}function saveUpdates(_0x287822,_0x152f22){return function(_0x3e215c){if(_0x3e215c){return _0x3e215c[_0xbb58('0x28')](_0x287822)[_0xbb58('0x29')](function(_0x2d556a){return _0x2d556a;});}return null;};}function removeEntity(_0x15e4c5,_0x4e0303){return function(_0x283dff){if(_0x283dff){return _0x283dff[_0xbb58('0x2a')]()[_0xbb58('0x29')](function(){_0x15e4c5[_0xbb58('0x23')](0xcc)[_0xbb58('0x1e')]();});}};}function handleEntityNotFound(_0x521d0c,_0x3608dc){return function(_0x2ce7c3){if(!_0x2ce7c3){_0x521d0c[_0xbb58('0x2b')](0x194);}return _0x2ce7c3;};}function handleError(_0x2d5b39,_0xf6687e){_0xf6687e=_0xf6687e||0x1f4;return function(_0x28b3a3){logger[_0xbb58('0x2c')](_0x28b3a3[_0xbb58('0x2d')]);if(_0x28b3a3[_0xbb58('0x2e')]){delete _0x28b3a3['name'];}_0x2d5b39[_0xbb58('0x23')](_0xf6687e)[_0xbb58('0x2f')](_0x28b3a3);};}exports[_0xbb58('0x30')]=function(_0x3c9cee,_0x3304b9){var _0x9d379f={},_0x1ba526={},_0x643e0e={'count':0x0,'rows':[]};return db[_0xbb58('0x31')]['describe']()[_0xbb58('0x29')](function(_0x22329b){var _0x3edc34=[];for(var _0x3a1e46=0x0;_0x3a1e460x1){_0x18799c['or'](_0xbb58('0x70'),qs['getFullTextValue'](_0x2a6963),null);}else{if(qs[_0xbb58('0x71')](_0x2a6963)){_0x18799c['or'](_0xbb58('0x72'),_0x2a6963+'%');_0x18799c['or'](_0xbb58('0x73'),_0x2a6963+'%');_0x18799c['or']('c.mobile\x20LIKE\x20?',_0x2a6963+'%');_0x18799c['or'](_0xbb58('0x74'),_0x2a6963+'%');}else if(qs['isEmail'](_0x2a6963)){_0x18799c['or'](_0xbb58('0x75'),_0x2a6963+'%');}else{_0x18799c['or'](_0xbb58('0x76'),'%'+_0x2a6963+'%');_0x18799c['or']('c.lastName\x20LIKE\x20?','%'+_0x2a6963+'%');_0x18799c['or'](_0xbb58('0x75'),'%'+_0x2a6963+'%');}}}}_0x324be0[_0xbb58('0x4f')](_0x18799c);_0x324be0[_0xbb58('0x77')](_0xbb58('0x78'));var _0xcac910={'type':db['Sequelize']['QueryTypes'][_0xbb58('0x79')],'raw':!![]};var _0x2f0db7=_0x324be0[_0xbb58('0x7a')]()['field'](_0xbb58('0x78'));if(_0x9d379f[_0xbb58('0x41')]){_0x9d379f['order'][_0xbb58('0x58')](function(_0x22a287){_0x324be0['order']('c.'+_0x22a287[0x0],_0x22a287[0x1]===_0xbb58('0x7b')?![]:!![]);});}if(!_[_0xbb58('0x66')](_0x2c4ba6)){_0x324be0[_0xbb58('0x7c')](_0x109a95);_0x2f0db7[_0xbb58('0x4f')](_0xbb58('0x7d'),_0x2c4ba6);}BPromise['resolve']()[_0xbb58('0x29')](function(){if(!_0x55a1cc)return;if(_0x3c9cee[_0xbb58('0x7e')][_0xbb58('0x7f')]!==_0xbb58('0x80'))return;if(!_[_0xbb58('0x81')](_0x55a1cc['conditions'],['field',_0xbb58('0x82')])){return _0x3c9cee['user'][_0xbb58('0x83')]({'attributes':['id'],'raw':!![]})[_0xbb58('0x29')](function(_0xcfac9e){if(_[_0xbb58('0x66')](_0xcfac9e)){_0x2f0db7[_0xbb58('0x4f')](_0xbb58('0x84'));_0x324be0[_0xbb58('0x4f')](_0xbb58('0x84'));}else{_0x2f0db7[_0xbb58('0x4f')](_0xbb58('0x85'),_['map'](_0xcfac9e,'id'));_0x324be0[_0xbb58('0x4f')](_0xbb58('0x85'),_[_0xbb58('0x63')](_0xcfac9e,'id'));}});}})['then'](function(){if(_0x3c9cee[_0xbb58('0x7e')]['role']==='agent'&&!_0x55a1cc&&!_0x3c9cee[_0xbb58('0x3c')][_0xbb58('0x67')])return[];return db[_0xbb58('0x86')][_0xbb58('0x3c')](_0x2f0db7['toString'](),_0xcac910);})['then'](function(_0x3210d7){_0x643e0e[_0xbb58('0x22')]=_0x3210d7['length'];if(_0x643e0e[_0xbb58('0x22')]===0x0)return[];return db[_0xbb58('0x86')][_0xbb58('0x3c')](_0x301e15[_0xbb58('0x87')](),_0xcac910)[_0xbb58('0x29')](function(_0x55d3c5){_0x1185b3=_[_0xbb58('0x88')](_0x55d3c5,'id');_0xcac910=_['merge'](_0xcac910,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3c9cee[_0xbb58('0x3c')][_0xbb58('0x3f')]){_0x9d379f[_0xbb58('0x3d')]['forEach'](function(_0x25b6d8){_0x324be0[_0xbb58('0x44')]('c.'+_0x25b6d8);});}else{_0x324be0[_0xbb58('0x44')](_0xbb58('0x78'));_0x324be0['field'](_0xbb58('0x89'));_0x324be0['field']('c.lastName');_0x324be0[_0xbb58('0x44')](_0xbb58('0x8a'));_0x324be0[_0xbb58('0x44')]('c.mobile');_0x324be0['field'](_0xbb58('0x8b'));_0x324be0[_0xbb58('0x44')](_0xbb58('0x8c'));_0x324be0[_0xbb58('0x44')](_0xbb58('0x8d'));_0x324be0[_0xbb58('0x44')](_0xbb58('0x8e'));_0x324be0[_0xbb58('0x44')](_0xbb58('0x8f'));_0x324be0[_0xbb58('0x44')](_0xbb58('0x90'));_0x324be0['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0xbb58('0x91'));}if(_0x9d379f[_0xbb58('0x20')])_0x324be0[_0xbb58('0x20')](_0x9d379f['limit']);if(_0x9d379f[_0xbb58('0x1f')])_0x324be0[_0xbb58('0x1f')](_0x9d379f[_0xbb58('0x1f')]);return db['sequelize'][_0xbb58('0x3c')](_0x324be0['toString'](),_0xcac910);});})[_0xbb58('0x29')](function(_0x47fd65){_0x47fd65[_0xbb58('0x58')](function(_0x35dc6e){if(_0x35dc6e[_0xbb58('0x91')]){_0x35dc6e[_0xbb58('0x92')]=[];_0x35dc6e[_0xbb58('0x91')][_0xbb58('0x57')](',')['forEach'](function(_0x5dc707){_0x35dc6e[_0xbb58('0x92')][_0xbb58('0x36')](_0x1185b3[_0x5dc707]);});}delete _0x35dc6e['TagIds'];});_0x643e0e[_0xbb58('0x93')]=_0x47fd65;return _0x643e0e;})[_0xbb58('0x29')](respondWithFilteredResult(_0x3304b9,_0x9d379f));})[_0xbb58('0x94')](handleError(_0x3304b9,null));};exports['destroy']=function(_0x371a9a,_0x5a7f77){return db[_0xbb58('0x31')][_0xbb58('0x55')]({'where':{'id':_0x371a9a[_0xbb58('0x95')]['id']}})[_0xbb58('0x29')](handleEntityNotFound(_0x5a7f77,null))[_0xbb58('0x29')](removeEntity(_0x5a7f77,null))[_0xbb58('0x94')](handleError(_0x5a7f77,null));};exports[_0xbb58('0x96')]=function(_0x5a80ef,_0x10828e){return db[_0xbb58('0x31')][_0xbb58('0x96')]()['then'](function(_0x25fb59){delete _0x25fb59[_0xbb58('0x97')];for(var _0x484a81=0x0;_0x484a810x0){return new Promise(function(_0x3cc325,_0x200d16){var _0x1f5844=[];for(var _0xab7d39=0x0;_0xab7d39<_0x3e1502['length'];_0xab7d39++){_0x1f5844['push'](insertAdditionalPhones(_0x3e1502[_0xab7d39]['contact'],_0x3e1502[_0xab7d39][_0xbb58('0xba')]));}Promise['all'](_0x1f5844)[_0xbb58('0x29')](function(){_0x3cc325(0x1);});})[_0xbb58('0x29')](function(){return{'success':_0x4bd8c9,'failure':_0x450581,'duplicates':_0x578b9a};});}else{return{'success':_0x4bd8c9,'failure':_0x450581,'duplicates':_0x578b9a};}}})[_0xbb58('0x29')](respondWithResult(_0x26f479,0xc9))[_0xbb58('0x94')](handleError(_0x26f479,null));};exports[_0xbb58('0xc0')]=function(_0x2e5dcd,_0x9050b8,_0x52ba37){var _0x154f13;return db[_0xbb58('0x31')][_0xbb58('0x96')]()[_0xbb58('0x29')](function(_0x2ca70a){return db['CmContact'][_0xbb58('0x55')]({'where':{'id':_0x2e5dcd['params']['id']},'include':[{'model':db[_0xbb58('0x56')],'as':_0xbb58('0x92'),'attributes':['id',_0xbb58('0x2e'),_0xbb58('0x45')],'required':_0x2e5dcd[_0xbb58('0x3c')]['tag']?!![]:![]},{'model':db[_0xbb58('0xae')],'as':_0xbb58('0xc1'),'where':{'CmContactId':_0x2e5dcd[_0xbb58('0x95')]['id']},'required':![],'include':[{'model':db[_0xbb58('0xc2')],'as':_0xbb58('0xc3')}]}],'order':[db['sequelize'][_0xbb58('0xc4')](_0xbb58('0xc5'))],'logging':console[_0xbb58('0xc6')],'attributes':_[_0xbb58('0x32')](_0x2ca70a)});})['then'](function(_0xf1243e){_0x154f13=_0xf1243e[_0xbb58('0x9f')]({'plain':!![]});var _0x4e617f={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf1243e&&_0xf1243e[_0xbb58('0x67')]){if(_0xf1243e[_0xbb58('0x67')]){_0x4e617f[_0xbb58('0x4f')][_0xbb58('0xc7')][_0xbb58('0x36')]({'ListId':{'$ne':_0xf1243e[_0xbb58('0x67')]}});}}return db[_0xbb58('0x37')][_0xbb58('0x9a')](_0x4e617f);})['then'](function(_0x5c6b9b){return _['omit'](_0x154f13,_['map'](_0x5c6b9b,function(_0x5b7751){return util[_0xbb58('0xc8')](_0xbb58('0xc9'),_0x5b7751['id']);}));})[_0xbb58('0x29')](handleEntityNotFound(_0x9050b8,null))[_0xbb58('0x29')](respondWithResult(_0x9050b8,null))[_0xbb58('0x94')](handleError(_0x9050b8,null));};exports[_0xbb58('0x28')]=function(_0x520662,_0x2f3189){var _0x2968e3;if(_0x520662[_0xbb58('0x9e')]['id']){delete _0x520662[_0xbb58('0x9e')]['id'];}return db['CmContact']['find']({'where':{'id':_0x520662[_0xbb58('0x95')]['id']}})[_0xbb58('0x29')](handleEntityNotFound(_0x2f3189,null))[_0xbb58('0x29')](saveUpdates(_0x520662[_0xbb58('0x9e')],null))['then'](function(_0xe2d886){_0x2968e3=_0xe2d886;var _0x261064={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xe2d886&&_0xe2d886['ListId']){if(_0xe2d886[_0xbb58('0x67')]){_0x261064[_0xbb58('0x4f')][_0xbb58('0xc7')][_0xbb58('0x36')]({'ListId':{'$ne':_0xe2d886['ListId']}});}}return db['CmCustomField']['findAll'](_0x261064);})[_0xbb58('0x29')](function(_0xde4dff){if(_0xde4dff){return _[_0xbb58('0xca')](_['pickBy'](_0x520662['body'],function(_0x9ab172,_0x93cc1b){return _['startsWith'](_0x93cc1b,'cf_');}),_[_0xbb58('0x63')](_0xde4dff,function(_0x2649df){return util[_0xbb58('0xc8')](_0xbb58('0xc9'),_0x2649df['id']);}));}})[_0xbb58('0x29')](function(_0x2e2e89){if(_0x2e2e89&&!_[_0xbb58('0x66')](_0x2e2e89)){var _0x2eb383=squel[_0xbb58('0x28')]()[_0xbb58('0xcb')]('cm_contacts')[_0xbb58('0xcc')](_0x2e2e89)[_0xbb58('0x4f')](_0xbb58('0xcd'),_0x520662['params']['id'])[_0xbb58('0xce')]();return db[_0xbb58('0x86')][_0xbb58('0x3c')](_0x2eb383[_0xbb58('0xcf')],{'replacements':_0x2eb383['values']});}})['then'](function(){if(_0x520662['body']['phone']&&_0x2968e3){return db[_0xbb58('0xa3')]['update']({'phone':_0x520662[_0xbb58('0x9e')][_0xbb58('0xd0')]},{'where':{'ContactId':_0x2968e3['id']}});}})[_0xbb58('0x29')](function(){return _0x2968e3;})[_0xbb58('0x29')](respondWithResult(_0x2f3189,null))['catch'](handleError(_0x2f3189,null));};exports[_0xbb58('0xd1')]=function(_0x2e18dc,_0xe2af62,_0x39a058){var _0x237a05={};var _0x35a73f={};var _0x2ce203;var _0x1ca3ba;return db[_0xbb58('0x31')][_0xbb58('0x38')]({'where':{'id':_0x2e18dc[_0xbb58('0x95')]['id']}})['then'](handleEntityNotFound(_0xe2af62,null))[_0xbb58('0x29')](function(_0x598279){if(_0x598279){_0x2ce203=_0x598279;_0x35a73f[_0xbb58('0x3e')]=_[_0xbb58('0x32')](db[_0xbb58('0x56')]['rawAttributes']);_0x35a73f['query']=_[_0xbb58('0x32')](_0x2e18dc[_0xbb58('0x3c')]);_0x35a73f[_0xbb58('0x3a')]=_['intersection'](_0x35a73f[_0xbb58('0x3e')],_0x35a73f[_0xbb58('0x3c')]);_0x237a05[_0xbb58('0x3d')]=_[_0xbb58('0x3b')](_0x35a73f[_0xbb58('0x3e')],qs[_0xbb58('0x3f')](_0x2e18dc[_0xbb58('0x3c')][_0xbb58('0x3f')]));_0x237a05[_0xbb58('0x3d')]=_0x237a05[_0xbb58('0x3d')][_0xbb58('0x33')]?_0x237a05[_0xbb58('0x3d')]:_0x35a73f[_0xbb58('0x3e')];_0x237a05[_0xbb58('0x41')]=qs[_0xbb58('0x42')](_0x2e18dc[_0xbb58('0x3c')][_0xbb58('0x42')]);_0x237a05[_0xbb58('0x4f')]=qs['filters'](_[_0xbb58('0x43')](_0x2e18dc[_0xbb58('0x3c')],_0x35a73f[_0xbb58('0x3a')]));if(_0x2e18dc[_0xbb58('0x3c')][_0xbb58('0x6e')]){_0x237a05[_0xbb58('0x4f')]=_[_0xbb58('0x9d')](_0x237a05[_0xbb58('0x4f')],{'$or':_[_0xbb58('0x63')](_0x237a05[_0xbb58('0x3d')],function(_0x41d338){var _0x1fb584={};_0x1fb584[_0x41d338]={'$like':'%'+_0x2e18dc['query']['filter']+'%'};return _0x1fb584;})});}_0x237a05=_[_0xbb58('0x9d')]({},_0x237a05,_0x2e18dc['options']);return _0x2ce203[_0xbb58('0xd1')](_0x237a05);}})[_0xbb58('0x29')](function(_0x2d5bf4){if(_0x2d5bf4){_0x1ca3ba=_0x2d5bf4[_0xbb58('0x33')];if(!_0x2e18dc['query'][_0xbb58('0x64')](_0xbb58('0x40'))){_0x237a05['limit']=qs[_0xbb58('0x20')](_0x2e18dc[_0xbb58('0x3c')][_0xbb58('0x20')]);_0x237a05[_0xbb58('0x1f')]=qs[_0xbb58('0x1f')](_0x2e18dc[_0xbb58('0x3c')][_0xbb58('0x1f')]);}return _0x2ce203[_0xbb58('0xd1')](_0x237a05);}})['then'](function(_0x49b610){if(_0x49b610){return _0x49b610?{'count':_0x1ca3ba,'rows':_0x49b610}:null;}})[_0xbb58('0x29')](respondWithResult(_0xe2af62,null))['catch'](handleError(_0xe2af62,null));};exports[_0xbb58('0xd2')]=function(_0xa7b4bb,_0x963489,_0x2d26e4){if(_0xa7b4bb['body']['id']){delete _0xa7b4bb[_0xbb58('0x9e')]['id'];}return db[_0xbb58('0x31')][_0xbb58('0x38')]({'where':{'id':_0xa7b4bb[_0xbb58('0x95')]['id']}})['then'](handleEntityNotFound(_0x963489,null))[_0xbb58('0x29')](function(_0x294264){if(_0x294264){return _0x294264['setTags'](_0xa7b4bb[_0xbb58('0x9e')][_0xbb58('0xd3')]||[]);}return null;})['then'](respondWithResult(_0x963489,null))[_0xbb58('0x94')](handleError(_0x963489,null));};exports[_0xbb58('0xd4')]=function(_0xed090e,_0x290044){var _0x50a286=[];_0x50a286[_0xbb58('0x36')](addAdditionalPhones(_0xed090e['body']));Promise[_0xbb58('0xd5')](_0x50a286)[_0xbb58('0x29')](function(){_0x50a286=[];_0x50a286[_0xbb58('0x36')](deleteCmHopperPhones(_0xed090e[_0xbb58('0x9e')]['id']));_0x50a286['push'](addCmHopperPhones(_0xed090e['body']['id']));Promise[_0xbb58('0xd5')](_0x50a286)[_0xbb58('0x29')](function(){return[0x1];})['then'](respondWithResult(_0x290044,null));});};function addAdditionalPhones(_0x424391){return new Promise(function(_0x49d142,_0x2f0816){return db[_0xbb58('0xae')][_0xbb58('0x2a')]({'where':{'CmContactId':_0x424391['id']}})[_0xbb58('0x29')](function(){var _0x3bb7ba=[];for(var _0x2d9f63=0x0;_0x2d9f63<_0x424391[_0xbb58('0xd6')]['length'];_0x2d9f63++){_0x3bb7ba[_0xbb58('0x36')](addAdditionalPhone(_0x424391['id'],_0x424391[_0xbb58('0xd6')][_0x2d9f63][_0xbb58('0xd0')],_0x424391[_0xbb58('0xd7')]?_[_0xbb58('0xd8')](_0x424391[_0xbb58('0xd7')][_0x2d9f63])?null:_0x424391['item_types'][_0x2d9f63]:_0x424391[_0xbb58('0xd6')][_0x2d9f63][_0xbb58('0xd9')]?_0x424391['items'][_0x2d9f63]['ItemTypeId']:null,_0x2d9f63,_0x424391[_0xbb58('0xd6')][_0x2d9f63][_0xbb58('0xda')]));}Promise[_0xbb58('0xd5')](_0x3bb7ba)[_0xbb58('0x29')](function(){_0x49d142(0x1);});});});}function addAdditionalPhone(_0x3efd44,_0x110007,_0xa618a8,_0x5e0ae5,_0x581a86){return db[_0xbb58('0xae')]['find']({'where':{'CmContactId':_0x3efd44,'item':_0x110007}})[_0xbb58('0x29')](function(_0x3090b5){if(_0x3090b5)logger[_0xbb58('0xa1')]('contact\x20phone\x20exists',_0x3090b5);else{db[_0xbb58('0xae')][_0xbb58('0xb9')]({'CmContactId':_0x3efd44,'item':_0x110007,'ItemTypeId':_0xa618a8,'OrderBy':_0x5e0ae5,'ItemClass':_0xbb58('0xdb'),'description':_0x581a86});}});}function deletePhones(_0x500654){return db[_0xbb58('0xae')][_0xbb58('0x2a')]({'where':{'CmContactId':_0x500654}});}function deleteCmHopperPhones(_0x2c8d82){return new Promise(function(_0x16594f,_0x55537b){return db[_0xbb58('0xa3')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x2c8d82}})[_0xbb58('0x29')](function(_0x3dbbdf){db[_0xbb58('0xdc')][_0xbb58('0x2a')]({'where':{'CmHopperId':{'$in':_[_0xbb58('0x63')](_0x3dbbdf,'id')}}});})[_0xbb58('0x29')](function(){_0x16594f(0x1);});});}function addCmHopperPhones(_0x5b6c2f){return new Promise(function(_0x23e42e,_0x583fa4){return db[_0xbb58('0xa3')][_0xbb58('0x9a')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x5b6c2f}})[_0xbb58('0x29')](function(_0x2c8b0e){var _0x1a223b=[];_[_0xbb58('0x63')](_0x2c8b0e,function(_0x25e695){_0x1a223b[_0xbb58('0x36')](createCmHopperPhone(_0x5b6c2f,_0x25e695['id']));});Promise[_0xbb58('0xd5')](_0x1a223b)[_0xbb58('0x29')](function(){_0x23e42e(0x1);});});});}function createCmHopperPhone(_0x24da2a,_0x3c045f){return new Promise(function(_0x2c2ef1,_0x50a786){db['CmContactHasItem'][_0xbb58('0x9a')]({'raw':!![],'attributes':[_0xbb58('0xdd')],'where':{'CmContactId':_0x24da2a,'ItemClass':_0xbb58('0xdb')},'include':[{'model':db[_0xbb58('0xc2')],'attributes':[_0xbb58('0xde')],'as':_0xbb58('0xc3')}],'order':[db[_0xbb58('0x86')][_0xbb58('0xc4')]('`ItemType`.OrderBy')]})[_0xbb58('0x29')](function(_0x45175d){var _0x24fd50=0x1;var _0x1ba344=_[_0xbb58('0x63')](_0x45175d,function(_0x1fff94){_0x1fff94[_0xbb58('0xdf')]=_0x3c045f;_0x1fff94[_0xbb58('0xd0')]=_0x1fff94[_0xbb58('0xdd')];_0x1fff94[_0xbb58('0xde')]=_0x1fff94[_0xbb58('0xe0')]||_0x24fd50;delete _0x1fff94['ItemType.OrderBy'];_0x24fd50=_0x24fd50+0x1;return _0x1fff94;});return db[_0xbb58('0xdc')][_0xbb58('0xbb')](_0x1ba344,{});})[_0xbb58('0x29')](function(){_0x2c2ef1(0x1);});});}function insertAdditionalPhones(_0xc8affe,_0x27eeb6){return new Promise(function(_0xaf0f2f,_0x4ab464){var _0x548e6a=[];for(var _0x3f470a=0x0;_0x3f470a<_0x27eeb6[_0xbb58('0x33')];_0x3f470a++){var _0x5ae2cb=_0x27eeb6[_0x3f470a];_0x548e6a[_0xbb58('0x36')](parseContactItemType(_0x5ae2cb));}Promise[_0xbb58('0xd5')](_0x548e6a)['then'](function(){var _0x37d956={'id':_0xc8affe['id'],'items':_0x27eeb6};return addAdditionalPhones(_0x37d956)[_0xbb58('0x29')](function(_0x214f17){return addCmHopperPhones(_0xc8affe['id']);});})['then'](function(){_0xaf0f2f(_0xc8affe);});});}function parseContactItemType(_0x33194a){return new Promise(function(_0x44f609,_0x4242e2){if(_0x33194a[_0xbb58('0x64')](_0xbb58('0xd9'))){_0x44f609(_0x33194a);}else{return db['ContactItemType']['find']({'where':{'name':_0x33194a[_0xbb58('0xc3')]}})[_0xbb58('0x29')](function(_0x52f803){if(_[_0xbb58('0xd8')](_0x52f803))_0x33194a[_0xbb58('0xd9')]=null;else _0x33194a[_0xbb58('0xd9')]=_0x52f803['id'];_0x44f609(_0x33194a);});}});}exports[_0xbb58('0xe1')]=function(_0x1733f7,_0x1972af){return db[_0xbb58('0xae')][_0xbb58('0x9a')]({'raw':!![],'where':{'CmContactId':_0x1733f7['params']['id'],'ItemClass':_0xbb58('0xdb')},'include':[{'model':db['ContactItemType'],'as':_0xbb58('0xc3')}],'order':[[db[_0xbb58('0x86')][_0xbb58('0xc4')](_0xbb58('0xe2'))],[_0xbb58('0xde')]]})[_0xbb58('0x29')](function(_0x4d5745){return _0x4d5745;})[_0xbb58('0x29')](respondWithResult(_0x1972af,null))[_0xbb58('0x94')](handleError(_0x1972af,null));};exports[_0xbb58('0xe3')]=function(_0x2ee131,_0x46e36b){return db[_0xbb58('0xae')][_0xbb58('0x9a')]({'raw':!![],'where':{'CmContactId':_0x2ee131[_0xbb58('0x9e')][_0xbb58('0xe4')]}})['then'](function(_0x24983c){var _0x4cafeb=_[_0xbb58('0x63')](_0x24983c,function(_0x14e817){_0x14e817[_0xbb58('0xe5')]=_0x2ee131['body']['toContactId'];return _0x14e817;});return db[_0xbb58('0xae')][_0xbb58('0xbb')](_0x4cafeb,{});})[_0xbb58('0x29')](function(_0x5b275f){return addCmHopperPhones(_0x2ee131[_0xbb58('0x9e')]['toContactId']);})['then'](function(_0x21eb63){return['ok'];})[_0xbb58('0x29')](respondWithResult(_0x46e36b,null))[_0xbb58('0x94')](handleError(_0x46e36b,null));};exports[_0xbb58('0xe6')]=function(_0x29bc66,_0x30e354){var _0x50b5ee=[];_0x50b5ee[_0xbb58('0x36')](createCmHopperPhone(_0x29bc66[_0xbb58('0x9e')]['id'],_0x29bc66['body'][_0xbb58('0xe7')]));Promise[_0xbb58('0xd5')](_0x50b5ee)['then'](function(){return[0x1];})[_0xbb58('0x29')](respondWithResult(_0x30e354,null));};exports[_0xbb58('0xe8')]=function(_0x18972f,_0x305e0a,_0x3ee22f){var _0x4841ab={'raw':![],'where':{}};var _0x129a40={};var _0x187efc={'count':0x0,'rows':[]};return db['CmContact'][_0xbb58('0x38')]({'where':{'id':_0x18972f[_0xbb58('0x95')]['id']}})[_0xbb58('0x29')](handleEntityNotFound(_0x305e0a,null))['then'](function(_0x285017){if(_0x285017){_0x129a40[_0xbb58('0x3e')]=_[_0xbb58('0x32')](db[_0xbb58('0xa3')]['rawAttributes']);_0x129a40[_0xbb58('0x3c')]=_[_0xbb58('0x32')](_0x18972f[_0xbb58('0x3c')]);_0x129a40[_0xbb58('0x3a')]=_[_0xbb58('0x3b')](_0x129a40[_0xbb58('0x3e')],_0x129a40[_0xbb58('0x3c')]);_0x4841ab[_0xbb58('0x3d')]=_[_0xbb58('0x3b')](_0x129a40['model'],qs['fields'](_0x18972f[_0xbb58('0x3c')]['fields']));_0x4841ab[_0xbb58('0x3d')]=_0x4841ab[_0xbb58('0x3d')]['length']?_0x4841ab[_0xbb58('0x3d')]:_0x129a40[_0xbb58('0x3e')];if(!_0x18972f[_0xbb58('0x3c')][_0xbb58('0x64')]('nolimit')){_0x4841ab[_0xbb58('0x20')]=qs[_0xbb58('0x20')](_0x18972f[_0xbb58('0x3c')][_0xbb58('0x20')]);_0x4841ab['offset']=qs['offset'](_0x18972f[_0xbb58('0x3c')][_0xbb58('0x1f')]);}_0x4841ab[_0xbb58('0x41')]=qs[_0xbb58('0x42')](_0x18972f['query'][_0xbb58('0x42')]);_0x4841ab['where']=qs[_0xbb58('0x3a')](_[_0xbb58('0x43')](_0x18972f['query'],_0x129a40['filters']));_0x4841ab[_0xbb58('0x4f')][_0xbb58('0xe9')]=_0x285017['id'];if(_0x18972f['query'][_0xbb58('0x6e')]){_0x4841ab['where']=_[_0xbb58('0x9d')](_0x4841ab['where'],{'$or':_['map'](_0x4841ab[_0xbb58('0x3d')],function(_0x1220d6){var _0x4e3700={};_0x4e3700[_0x1220d6]={'$like':'%'+_0x18972f[_0xbb58('0x3c')][_0xbb58('0x6e')]+'%'};return _0x4e3700;})});}_0x4841ab=_[_0xbb58('0x9d')]({},_0x4841ab,_0x18972f[_0xbb58('0xea')]);return db[_0xbb58('0xa3')]['count']({'where':_0x4841ab[_0xbb58('0x4f')]})[_0xbb58('0x29')](function(_0x31f4a8){_0x187efc[_0xbb58('0x22')]=_0x31f4a8;if(_0x18972f['query'][_0xbb58('0xeb')]){_0x4841ab[_0xbb58('0xec')]=[{'all':!![]}];}return db[_0xbb58('0xa3')]['findAll'](_0x4841ab);})[_0xbb58('0x29')](function(_0x34d6d4){_0x187efc[_0xbb58('0x93')]=_0x34d6d4;return _0x187efc;});}})['then'](respondWithFilteredResult(_0x305e0a,_0x4841ab))[_0xbb58('0x94')](handleError(_0x305e0a,null));};exports[_0xbb58('0xed')]=function(_0x1f306a,_0x134cf9,_0x5734b2){var _0x5d815f={'raw':!![],'where':{}};var _0xde225e={};var _0x15c13d={'count':0x0,'rows':[]};return db[_0xbb58('0x31')][_0xbb58('0x38')]({'where':{'id':_0x1f306a[_0xbb58('0x95')]['id']}})['then'](handleEntityNotFound(_0x134cf9,null))['then'](function(_0xb7de6){if(_0xb7de6){_0xde225e[_0xbb58('0x3e')]=_[_0xbb58('0x32')](db[_0xbb58('0xb0')][_0xbb58('0xee')]);_0xde225e['query']=_[_0xbb58('0x32')](_0x1f306a['query']);_0xde225e[_0xbb58('0x3a')]=_[_0xbb58('0x3b')](_0xde225e[_0xbb58('0x3e')],_0xde225e[_0xbb58('0x3c')]);_0x5d815f[_0xbb58('0x3d')]=_['intersection'](_0xde225e[_0xbb58('0x3e')],qs[_0xbb58('0x3f')](_0x1f306a['query']['fields']));_0x5d815f[_0xbb58('0x3d')]=_0x5d815f[_0xbb58('0x3d')]['length']?_0x5d815f['attributes']:_0xde225e[_0xbb58('0x3e')];if(!_0x1f306a['query'][_0xbb58('0x64')](_0xbb58('0x40'))){_0x5d815f[_0xbb58('0x20')]=qs['limit'](_0x1f306a['query'][_0xbb58('0x20')]);_0x5d815f[_0xbb58('0x1f')]=qs[_0xbb58('0x1f')](_0x1f306a['query']['offset']);}_0x5d815f['order']=qs[_0xbb58('0x42')](_0x1f306a[_0xbb58('0x3c')][_0xbb58('0x42')]);_0x5d815f[_0xbb58('0x4f')]=qs['filters'](_[_0xbb58('0x43')](_0x1f306a[_0xbb58('0x3c')],_0xde225e['filters']));_0x5d815f[_0xbb58('0x4f')][_0xbb58('0xe9')]=_0xb7de6['id'];if(_0x1f306a[_0xbb58('0x3c')][_0xbb58('0x6e')]){_0x5d815f['where']=_[_0xbb58('0x9d')](_0x5d815f[_0xbb58('0x4f')],{'$or':_[_0xbb58('0x63')](_0x5d815f[_0xbb58('0x3d')],function(_0x5102a6){var _0x4caf14={};_0x4caf14[_0x5102a6]={'$like':'%'+_0x1f306a['query'][_0xbb58('0x6e')]+'%'};return _0x4caf14;})});}_0x5d815f=_[_0xbb58('0x9d')]({},_0x5d815f,_0x1f306a['options']);return db[_0xbb58('0xb0')]['count']({'where':_0x5d815f[_0xbb58('0x4f')]})['then'](function(_0x4d04b0){_0x15c13d['count']=_0x4d04b0;if(_0x1f306a['query']['includeAll']){_0x5d815f['include']=[{'all':!![]}];}return db[_0xbb58('0xb0')]['findAll'](_0x5d815f);})[_0xbb58('0x29')](function(_0x41fca2){_0x15c13d[_0xbb58('0x93')]=_0x41fca2;return _0x15c13d;});}})[_0xbb58('0x29')](respondWithFilteredResult(_0x134cf9,_0x5d815f))[_0xbb58('0x94')](handleError(_0x134cf9,null));};exports[_0xbb58('0xef')]=function(_0x6d299a,_0x1f1219,_0x147467){var _0x3e21bf={'raw':!![],'where':{}};var _0x5f4a84={};var _0x4a82e7={'count':0x0,'rows':[]};return db[_0xbb58('0x31')]['findOne']({'where':{'id':_0x6d299a['params']['id']}})[_0xbb58('0x29')](handleEntityNotFound(_0x1f1219,null))['then'](function(_0x29d6e1){if(_0x29d6e1){_0x5f4a84[_0xbb58('0x3e')]=_[_0xbb58('0x32')](db[_0xbb58('0xaf')][_0xbb58('0xee')]);_0x5f4a84[_0xbb58('0x3c')]=_['keys'](_0x6d299a['query']);_0x5f4a84[_0xbb58('0x3a')]=_[_0xbb58('0x3b')](_0x5f4a84['model'],_0x5f4a84[_0xbb58('0x3c')]);_0x3e21bf[_0xbb58('0x3d')]=_[_0xbb58('0x3b')](_0x5f4a84[_0xbb58('0x3e')],qs[_0xbb58('0x3f')](_0x6d299a[_0xbb58('0x3c')][_0xbb58('0x3f')]));_0x3e21bf[_0xbb58('0x3d')]=_0x3e21bf[_0xbb58('0x3d')]['length']?_0x3e21bf[_0xbb58('0x3d')]:_0x5f4a84['model'];if(!_0x6d299a[_0xbb58('0x3c')][_0xbb58('0x64')](_0xbb58('0x40'))){_0x3e21bf[_0xbb58('0x20')]=qs[_0xbb58('0x20')](_0x6d299a[_0xbb58('0x3c')][_0xbb58('0x20')]);_0x3e21bf[_0xbb58('0x1f')]=qs[_0xbb58('0x1f')](_0x6d299a['query'][_0xbb58('0x1f')]);}_0x3e21bf['order']=qs[_0xbb58('0x42')](_0x6d299a[_0xbb58('0x3c')][_0xbb58('0x42')]);_0x3e21bf[_0xbb58('0x4f')]=qs[_0xbb58('0x3a')](_[_0xbb58('0x43')](_0x6d299a['query'],_0x5f4a84[_0xbb58('0x3a')]));_0x3e21bf[_0xbb58('0x4f')][_0xbb58('0xe9')]=_0x29d6e1['id'];if(_0x6d299a[_0xbb58('0x3c')][_0xbb58('0x6e')]){_0x3e21bf[_0xbb58('0x4f')]=_['merge'](_0x3e21bf[_0xbb58('0x4f')],{'$or':_['map'](_0x3e21bf[_0xbb58('0x3d')],function(_0x30169f){var _0x5bf0b9={};_0x5bf0b9[_0x30169f]={'$like':'%'+_0x6d299a[_0xbb58('0x3c')][_0xbb58('0x6e')]+'%'};return _0x5bf0b9;})});}_0x3e21bf=_[_0xbb58('0x9d')]({},_0x3e21bf,_0x6d299a['options']);return db[_0xbb58('0xaf')][_0xbb58('0x22')]({'where':_0x3e21bf[_0xbb58('0x4f')]})[_0xbb58('0x29')](function(_0x2ac8d1){_0x4a82e7[_0xbb58('0x22')]=_0x2ac8d1;if(_0x6d299a[_0xbb58('0x3c')][_0xbb58('0xeb')]){_0x3e21bf[_0xbb58('0xec')]=[{'all':!![]}];}return db[_0xbb58('0xaf')][_0xbb58('0x9a')](_0x3e21bf);})[_0xbb58('0x29')](function(_0x22c054){_0x4a82e7[_0xbb58('0x93')]=_0x22c054;return _0x4a82e7;});}})['then'](respondWithFilteredResult(_0x1f1219,_0x3e21bf))[_0xbb58('0x94')](handleError(_0x1f1219,null));};exports[_0xbb58('0xf0')]=function(_0x14a3f0,_0x2b63fb,_0x2b36c8){var _0x17a6ee={'raw':!![],'where':{}};var _0x5d8f94={};var _0x300084={'count':0x0,'rows':[]};return db[_0xbb58('0x31')][_0xbb58('0x38')]({'where':{'id':_0x14a3f0[_0xbb58('0x95')]['id']}})['then'](handleEntityNotFound(_0x2b63fb,null))[_0xbb58('0x29')](function(_0x1de5da){if(_0x1de5da){_0x5d8f94['model']=_[_0xbb58('0x32')](db[_0xbb58('0xb6')][_0xbb58('0xee')]);_0x5d8f94['query']=_[_0xbb58('0x32')](_0x14a3f0[_0xbb58('0x3c')]);_0x5d8f94[_0xbb58('0x3a')]=_[_0xbb58('0x3b')](_0x5d8f94[_0xbb58('0x3e')],_0x5d8f94[_0xbb58('0x3c')]);_0x17a6ee[_0xbb58('0x3d')]=_[_0xbb58('0x3b')](_0x5d8f94['model'],qs[_0xbb58('0x3f')](_0x14a3f0[_0xbb58('0x3c')][_0xbb58('0x3f')]));_0x17a6ee[_0xbb58('0x3d')]=_0x17a6ee[_0xbb58('0x3d')][_0xbb58('0x33')]?_0x17a6ee[_0xbb58('0x3d')]:_0x5d8f94[_0xbb58('0x3e')];if(!_0x14a3f0[_0xbb58('0x3c')][_0xbb58('0x64')](_0xbb58('0x40'))){_0x17a6ee[_0xbb58('0x20')]=qs[_0xbb58('0x20')](_0x14a3f0['query'][_0xbb58('0x20')]);_0x17a6ee[_0xbb58('0x1f')]=qs[_0xbb58('0x1f')](_0x14a3f0[_0xbb58('0x3c')]['offset']);}_0x17a6ee['order']=qs['sort'](_0x14a3f0[_0xbb58('0x3c')]['sort']);_0x17a6ee[_0xbb58('0x4f')]=qs[_0xbb58('0x3a')](_[_0xbb58('0x43')](_0x14a3f0['query'],_0x5d8f94[_0xbb58('0x3a')]));_0x17a6ee[_0xbb58('0x4f')][_0xbb58('0xe9')]=_0x1de5da['id'];if(_0x14a3f0[_0xbb58('0x3c')][_0xbb58('0x6e')]){_0x17a6ee[_0xbb58('0x4f')]=_[_0xbb58('0x9d')](_0x17a6ee[_0xbb58('0x4f')],{'$or':_[_0xbb58('0x63')](_0x17a6ee['attributes'],function(_0x28b7dc){var _0xd2e409={};_0xd2e409[_0x28b7dc]={'$like':'%'+_0x14a3f0[_0xbb58('0x3c')][_0xbb58('0x6e')]+'%'};return _0xd2e409;})});}_0x17a6ee=_['merge']({},_0x17a6ee,_0x14a3f0['options']);return db[_0xbb58('0xb6')][_0xbb58('0x22')]({'where':_0x17a6ee[_0xbb58('0x4f')]})['then'](function(_0x5f1c0b){_0x300084[_0xbb58('0x22')]=_0x5f1c0b;if(_0x14a3f0[_0xbb58('0x3c')][_0xbb58('0xeb')]){_0x17a6ee[_0xbb58('0xec')]=[{'all':!![]}];}return db[_0xbb58('0xb6')][_0xbb58('0x9a')](_0x17a6ee);})[_0xbb58('0x29')](function(_0x3b1ba0){_0x300084[_0xbb58('0x93')]=_0x3b1ba0;return _0x300084;});}})['then'](respondWithFilteredResult(_0x2b63fb,_0x17a6ee))[_0xbb58('0x94')](handleError(_0x2b63fb,null));};exports['uploadCsv']=function(_0x241f69,_0x186b0e,_0x14424f){try{if(!_0x241f69['body'][_0xbb58('0x67')]){throw new Error(_0xbb58('0xf1'));}if(!_0x241f69[_0xbb58('0x9e')]['binding_keys']){throw new Error(_0xbb58('0xf2'));}if(!_0x241f69[_0xbb58('0x9e')]['binding_values']){throw new Error(_0xbb58('0xf3'));}if(!_0x241f69[_0xbb58('0x9e')][_0xbb58('0xf4')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x150089=_0x241f69[_0xbb58('0x9e')][_0xbb58('0xf5')][_0xbb58('0x57')](',');var _0x4fbad2=_0x241f69[_0xbb58('0x9e')]['binding_values'][_0xbb58('0x57')](',');if(!_0x150089['length']||!_0x4fbad2[_0xbb58('0x33')]||_0x150089[_0xbb58('0x33')]!==_0x4fbad2[_0xbb58('0x33')]){throw new Error(_0xbb58('0xf6'));}_0x241f69[_0xbb58('0x9e')][_0xbb58('0x3f')]=_[_0xbb58('0xf7')](_0x150089,_0x4fbad2);if(!_0x241f69[_0xbb58('0x9e')][_0xbb58('0x3f')][_0xbb58('0xd0')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x241f69[_0xbb58('0x9e')]['fields'][_0xbb58('0xf8')]){throw new Error('No\x20firstName\x20column\x20specified');}var _0x10410d=path[_0xbb58('0xf9')](config[_0xbb58('0xfa')],'server/files/tmp',_0x241f69[_0xbb58('0xfb')]['filename']);fs[_0xbb58('0xfc')](_0x10410d,parseInt('0777',0x8));var _0x4b0ebd=require(_0xbb58('0xfd'))[_0xbb58('0xfe')](path[_0xbb58('0xf9')](__dirname,_0xbb58('0xff')),[_0x10410d,_0x241f69[_0xbb58('0x9e')][_0xbb58('0xf5')],_0x241f69[_0xbb58('0x9e')][_0xbb58('0x100')],_0x241f69[_0xbb58('0x9e')]['ListId'],_0x241f69[_0xbb58('0x9e')]['CompanyId'],_0x241f69[_0xbb58('0x9e')]['duplicates'],_0x241f69[_0xbb58('0x9e')][_0xbb58('0xf4')]]);return _0x186b0e[_0xbb58('0x23')](0xc8)[_0xbb58('0x26')]({'message':_0xbb58('0x101'),'pid':_0x4b0ebd['pid']});}catch(_0x20f9dc){return _0x186b0e['status'](0x1f4)[_0xbb58('0x2f')](_0x20f9dc);}};exports['upload']=function(_0x25676a,_0x2b2ac6,_0x377578){var _0x463183=fs[_0xbb58('0x102')](_0x25676a['file']['path']);Papa[_0xbb58('0x103')](_0x463183,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x27c26e){return _0x2b2ac6[_0xbb58('0x23')](0xc8)['json']({'file':_0x25676a[_0xbb58('0xfb')],'fields':_0x27c26e[_0xbb58('0x104')][_0xbb58('0x3f')]});}});};exports[_0xbb58('0x105')]=function(_0x5efaef,_0x31abab,_0x1da3d1){return db[_0xbb58('0x82')][_0xbb58('0x9a')]({'raw':!![],'attributes':['id'],'where':{'role':_0xbb58('0x80')}})[_0xbb58('0x29')](function(_0x31f7d7){var _0x145945=![];if(!_0x5efaef['body'][_0xbb58('0x67')]){throw new Error(_0xbb58('0xf1'));}if(!_0x5efaef[_0xbb58('0x9e')]['binding']['phone']){throw new Error(_0xbb58('0x106'));}if(!_0x5efaef[_0xbb58('0x9e')][_0xbb58('0x107')][_0xbb58('0xf8')]){throw new Error(_0xbb58('0x108'));}if(!_0x5efaef[_0xbb58('0x9e')][_0xbb58('0xf4')]){throw new Error(_0xbb58('0x109'));}var _0x1347c1=require(_0xbb58('0xfd'))[_0xbb58('0xfe')](path[_0xbb58('0xf9')](__dirname,'../../components/import/cm/csv2'),[_0x5efaef[_0xbb58('0x95')]['id'],JSON[_0xbb58('0x10a')](_0x5efaef[_0xbb58('0x9e')]),JSON[_0xbb58('0x10a')](_0x31f7d7)]);_0x1347c1['on']('message',function(_0x523c43){_0x145945=!![];return _0x31abab[_0xbb58('0x23')](0xc8)[_0xbb58('0x26')]({'message':_0xbb58('0x10b'),'pid':_0x1347c1['pid']});});_0x1347c1['on'](_0xbb58('0x10c'),function(_0x36f0f0){if(_0x36f0f0&&!_0x145945){return _0x31abab[_0xbb58('0x23')](0x1f4)[_0xbb58('0x26')]({'message':_0xbb58('0x10d'),'pid':_0x1347c1[_0xbb58('0x10e')]});}});})[_0xbb58('0x94')](handleError(_0x31abab,null));};exports[_0xbb58('0x10f')]=function(_0x1e533c,_0x468674,_0x3a35d4){return db[_0xbb58('0x82')][_0xbb58('0x9a')]({'raw':!![],'attributes':['id'],'where':{'role':_0xbb58('0x80')}})['then'](function(_0x21aa8b){var _0x156abc=![];if(!_0x1e533c[_0xbb58('0x9e')]['ListId']){throw new Error('No\x20ListId\x20specified');}if(!_0x1e533c[_0xbb58('0x9e')][_0xbb58('0x107')][_0xbb58('0xd0')]){throw new Error(_0xbb58('0x106'));}if(!_0x1e533c[_0xbb58('0x9e')][_0xbb58('0x107')][_0xbb58('0xf8')]){throw new Error(_0xbb58('0x108'));}if(!_0x1e533c[_0xbb58('0x9e')][_0xbb58('0xf4')]){throw new Error(_0xbb58('0x109'));}var _0x23ff9a=require(_0xbb58('0xfd'))['fork'](path['join'](__dirname,_0xbb58('0x110')),[_0x1e533c[_0xbb58('0x95')]['id'],JSON[_0xbb58('0x10a')](_0x1e533c[_0xbb58('0x9e')]),JSON[_0xbb58('0x10a')](_0x21aa8b)]);_0x23ff9a['on'](_0xbb58('0x111'),function(_0x4d2169){_0x156abc=!![];return _0x468674[_0xbb58('0x23')](0xc8)[_0xbb58('0x26')]({'message':'start\x20child\x20process\x20correctly!','pid':_0x23ff9a[_0xbb58('0x10e')]});});_0x23ff9a['on']('exit',function(_0x1091ce){if(_0x1091ce&&!_0x156abc){return _0x468674[_0xbb58('0x23')](0x1f4)[_0xbb58('0x26')]({'message':_0xbb58('0x10d'),'pid':_0x23ff9a[_0xbb58('0x10e')]});}});})['catch'](handleError(_0x468674,null));};exports[_0xbb58('0x112')]=function(_0x8701aa,_0xdfbe03){var _0x395182=[_0xbb58('0x113'),_0xbb58('0x114'),_0xbb58('0x115'),'openchannel',_0xbb58('0x116'),_0xbb58('0x117'),_0xbb58('0x118')];var _0xf9ec14={'offset':0x0,'order':qs[_0xbb58('0x42')]('-createdAt')},_0x103e21={'count':0x0,'rows':[]};Promise['resolve']()[_0xbb58('0x29')](function(){if(_0x8701aa[_0xbb58('0x3c')]['channel']){if(!_['includes'](_0x395182,_0x8701aa[_0xbb58('0x3c')][_0xbb58('0x119')][_0xbb58('0x11a')]())){throw new Error(_0xbb58('0x11b'));}_0x395182=[_0x8701aa['query'][_0xbb58('0x119')]['toLowerCase']()];}if(_0x8701aa['query'][_0xbb58('0x11c')]){try{var _0x2df3b4=JSON[_0xbb58('0x103')](_0x8701aa[_0xbb58('0x3c')][_0xbb58('0x11c')]);if(!moment(_0x2df3b4[_0xbb58('0x46')])[_0xbb58('0x11d')]()){throw new Error(_0xbb58('0x11e'));}if(!moment(_0x2df3b4['to'])[_0xbb58('0x11d')]()){throw new Error(_0xbb58('0x11f'));}}catch(_0x2ca1b4){throw new Error('Invalid\x20createdAt\x20filter');}}if(!_0x8701aa[_0xbb58('0x3c')][_0xbb58('0x64')]('nolimit')){_0xf9ec14['limit']=qs['limit'](_0x8701aa['query'][_0xbb58('0x20')]||0xa);_0xf9ec14['offset']=qs['offset'](_0x8701aa[_0xbb58('0x3c')][_0xbb58('0x1f')]);}var _0x57c0b0=_0x395182[_0xbb58('0x63')](function(_0x11b57a){if(_0x11b57a==='voice'){var _0x191b6b={'attributes':['id','uniqueid','type','source',_0xbb58('0x120'),_0xbb58('0x121'),_0xbb58('0x122'),_0xbb58('0x123'),'duration',_0xbb58('0x124'),_0xbb58('0x125'),_0xbb58('0x126'),_0xbb58('0x127'),_0xbb58('0x128'),_0xbb58('0x129')],'where':{'ContactId':_0x8701aa[_0xbb58('0x95')]['id']},'include':[{'model':db['User'],'as':'User','attributes':['id',_0xbb58('0x2e'),_0xbb58('0x12a'),_0xbb58('0x9b')]}],'order':[[_0xbb58('0x125'),_0xbb58('0x7b')]]};if(_0x8701aa[_0xbb58('0x3c')][_0xbb58('0x11c')]){_0x191b6b[_0xbb58('0x4f')][_0xbb58('0x125')]={'$gte':_0x2df3b4[_0xbb58('0x46')],'$lte':_0x2df3b4['to']};}return db['VoiceCallReport']['findAndCountAll'](_0x191b6b)[_0xbb58('0x29')](function(_0x14dafd){_0x103e21['count']+=_0x14dafd['count'];return _[_0xbb58('0x63')](_0x14dafd['rows'],function(_0x4c8921){var _0x4db97f=_0x4c8921[_0xbb58('0x9f')]({'plain':!![]});_0x4db97f[_0xbb58('0x119')]=_0x11b57a;if(_0x4db97f[_0xbb58('0x82')]){_0x4db97f[_0xbb58('0x82')]={'id':_0x4db97f['User']['id'],'name':_0x4db97f[_0xbb58('0x82')][_0xbb58('0x2e')],'fullname':_0x4db97f['User'][_0xbb58('0x12a')],'alias':_0x4db97f[_0xbb58('0x82')][_0xbb58('0x9b')]};}return _0x4db97f;});});}else{var _0x566aee=_[_0xbb58('0x12b')](_0x11b57a)+(_0x11b57a==='chat'?_0xbb58('0x12c'):'Account');var _0x27b38c={'attributes':['id',_0xbb58('0x12d'),'closedAt',_0xbb58('0x125'),_0xbb58('0x124'),'disposition',_0xbb58('0x12e'),_0xbb58('0x12f'),'UserId',_0x566aee+'Id'],'where':{'ContactId':_0x8701aa['params']['id']},'include':[{'model':db[_0x566aee],'as':_0xbb58('0x130'),'attributes':['id','name','key']},{'model':db[_0xbb58('0x82')],'as':_0xbb58('0x131'),'attributes':['id',_0xbb58('0x2e'),_0xbb58('0x12a')]},{'model':db[_0xbb58('0x56')],'as':'Tags','attributes':['id',_0xbb58('0x2e'),_0xbb58('0x45')],'through':{'attributes':[]}}],'order':[[_0xbb58('0x125'),_0xbb58('0x7b')]]};if(_0x8701aa['query'][_0xbb58('0x11c')]){_0x27b38c[_0xbb58('0x4f')][_0xbb58('0x125')]={'$gte':_0x2df3b4[_0xbb58('0x46')],'$lte':_0x2df3b4['to']};}switch(_0x11b57a){case'chat':_0x27b38c[_0xbb58('0x3d')][_0xbb58('0x36')](_0xbb58('0x132'),_0xbb58('0x133'),'customerPort','deviceModel',_0xbb58('0x134'),_0xbb58('0x135'),_0xbb58('0x136'),_0xbb58('0x137'),_0xbb58('0x138'));break;case _0xbb58('0x113'):_0x27b38c['attributes']['push']('subject',_0xbb58('0x139'));break;case _0xbb58('0x13a'):_0x27b38c['attributes'][_0xbb58('0x36')]('externalUrl',_0xbb58('0x13b'));break;}return db[_[_0xbb58('0x12b')](_0x11b57a)+_0xbb58('0x13c')][_0xbb58('0x13d')](_0x27b38c)[_0xbb58('0x29')](function(_0x2aa4f3){_0x103e21['count']+=_0x2aa4f3[_0xbb58('0x22')];return _[_0xbb58('0x63')](_0x2aa4f3[_0xbb58('0x93')],function(_0x62c97f){var _0x354dca=_0x62c97f[_0xbb58('0x9f')]({'plain':!![]});_0x354dca[_0xbb58('0x119')]=_0x11b57a;if(_0x354dca[_0xbb58('0x131')]){_0x354dca['Owner']={'id':_0x354dca[_0xbb58('0x131')]['id'],'name':_0x354dca[_0xbb58('0x131')][_0xbb58('0x2e')],'fullname':_0x354dca[_0xbb58('0x131')][_0xbb58('0x12a')]};}return _0x354dca;});});}});return Promise[_0xbb58('0xd5')](_0x57c0b0);})[_0xbb58('0x29')](function(_0x38a6f5){return _(_0x38a6f5)[_0xbb58('0x13e')]()[_0xbb58('0x13f')](_0xbb58('0x125'))[_0xbb58('0x140')]()[_0xbb58('0x5b')]();})[_0xbb58('0x29')](function(_0x157301){_0x103e21['rows']=_0xf9ec14[_0xbb58('0x20')]?_0x157301['slice'](_0xf9ec14[_0xbb58('0x1f')],_0xf9ec14[_0xbb58('0x1f')]+_0xf9ec14['limit']):_0x157301;return _0x103e21;})[_0xbb58('0x29')](respondWithFilteredResult(_0xdfbe03,_0xf9ec14))['catch'](handleError(_0xdfbe03,null));}; \ No newline at end of file +var _0xe8cd=['customerPort','deviceModel','osName','ratingMessage','ratingType','ratingValue','referer','mail','subject','substatus','openchannel','externalUrl','threadId','Interaction','Owner','flatten','reverse','zip-dir','fast-json-patch','moment','mustache','util','fs-extra','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','CmContact','describe','keys','length','startsWith','cf_','push','CmCustomField','trimStart','all','type','model','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filters','field','color','tools_tags','from','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','find','Tag','value','split','forEach','union','uc.UserId\x20=\x20?','fieldType','datetime','castTo','DATE','buildExpression','text','start','map','filter','isNil','Contact','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','replace','getFullTextValue','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','group','c.id','QueryTypes','SELECT','clone','DESC','isEmpty','t.id\x20IN\x20?','resolve','user','role','User','getLists','c.ListId\x20IS\x20NULL','agent','ListId','sequelize','toString','merge','c.firstName','c.lastName','c.phone','c.mobile','c.fax','c.email','c.createdAt','c.deletedAt','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','params','tags','columnName','findAll','displayName','alias','custom','values','body','get','mergeWith','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','FaxQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','join','additionalPhones','duplicates','$or','spread','contact','CmContactHasItem','Phones','ContactItemType','literal','`Phones.ItemType`.OrderBy','log','omit','$and','pickBy','format','cf_%d','setFields','id\x20=\x20?','toParam','phone','getTags','findOne','rawAttributes','sort','options','setTags','ids','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','OrderBy','ItemType','CmHopperId','ItemType.OrderBy','bulkCreate','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','ContactId','includeAll','include','getJscriptySessions','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_values','firstName','server/files/tmp','file','filename','0777','child_process','fork','../../components/import/cm/csv','File\x20uploaded\x20correctly!','upload','createReadStream','path','parse','meta','import','binding','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','pid','exit','error\x20child\x20process','importUpdates','../../components/import/cm/csvUpdates','getJourney','chat','sms','fax','whatsapp','voice','-createdAt','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','uniqueid','callerid','starttime','duration','createdAt','fullname','findAndCountAll','startCase','Website','Account','closed','closedAt','note','disposition','secondDisposition','thirdDisposition','key','browserName'];(function(_0x3cea72,_0x2ca42c){var _0x5b831f=function(_0x216209){while(--_0x216209){_0x3cea72['push'](_0x3cea72['shift']());}};_0x5b831f(++_0x2ca42c);}(_0xe8cd,0x152));var _0xde8c=function(_0x460fd7,_0x2012db){_0x460fd7=_0x460fd7-0x0;var _0x44d1c2=_0xe8cd[_0x460fd7];return _0x44d1c2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xde8c('0x0'));var jsonpatch=require(_0xde8c('0x1'));var rp=require('request-promise');var moment=require(_0xde8c('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xde8c('0x3'));var util=require(_0xde8c('0x4'));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(_0xde8c('0x5'));var _=require('lodash');var squel=require(_0xde8c('0x6'));var crypto=require('crypto');var jsforce=require(_0xde8c('0x7'));var deskjs=require(_0xde8c('0x8'));var toCsv=require(_0xde8c('0x9'));var querystring=require(_0xde8c('0xa'));var Papa=require('papaparse');var Redis=require(_0xde8c('0xb'));var authService=require(_0xde8c('0xc'));var qs=require(_0xde8c('0xd'));var as=require(_0xde8c('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xde8c('0xf'))(_0xde8c('0x10'));var utils=require(_0xde8c('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xde8c('0x12'));var db=require(_0xde8c('0x13'))['db'];config[_0xde8c('0x14')]=_['defaults'](config['redis'],{'host':_0xde8c('0x15'),'port':0x18eb});var socket=require(_0xde8c('0x16'))(new Redis(config['redis']));require('./cmContact.socket')[_0xde8c('0x17')](socket);function respondWithStatusCode(_0x46b884,_0x40a957){_0x40a957=_0x40a957||0xcc;return function(_0x3c96e8){if(_0x3c96e8){return _0x46b884[_0xde8c('0x18')](_0x40a957);}return _0x46b884[_0xde8c('0x19')](_0x40a957)[_0xde8c('0x1a')]();};}function respondWithResult(_0x5157a4,_0x370de0){_0x370de0=_0x370de0||0xc8;return function(_0x136a54){if(_0x136a54){return _0x5157a4[_0xde8c('0x19')](_0x370de0)[_0xde8c('0x1b')](_0x136a54);}};}function respondWithFilteredResult(_0x9119da,_0x33b928){return function(_0x24eef1){if(_0x24eef1){var _0x313244=typeof _0x33b928['offset']===_0xde8c('0x1c')&&typeof _0x33b928[_0xde8c('0x1d')]===_0xde8c('0x1c');var _0x2ce527=_0x24eef1[_0xde8c('0x1e')];var _0x1c4895=_0x313244?0x0:_0x33b928[_0xde8c('0x1f')];var _0x1aa737=_0x313244?_0x24eef1[_0xde8c('0x1e')]:_0x33b928[_0xde8c('0x1f')]+_0x33b928['limit'];var _0x937857;if(_0x1aa737>=_0x2ce527){_0x1aa737=_0x2ce527;_0x937857=0xc8;}else{_0x937857=0xce;}_0x9119da['status'](_0x937857);return _0x9119da[_0xde8c('0x20')](_0xde8c('0x21'),_0x1c4895+'-'+_0x1aa737+'/'+_0x2ce527)['json'](_0x24eef1);}return null;};}function patchUpdates(_0x234b62){return function(_0x1b3904){try{jsonpatch[_0xde8c('0x22')](_0x1b3904,_0x234b62,!![]);}catch(_0x51db74){return BPromise['reject'](_0x51db74);}return _0x1b3904['save']();};}function saveUpdates(_0x2967ef,_0x60d407){return function(_0x8c436b){if(_0x8c436b){return _0x8c436b[_0xde8c('0x23')](_0x2967ef)[_0xde8c('0x24')](function(_0x209f60){return _0x209f60;});}return null;};}function removeEntity(_0x209974,_0x13ec48){return function(_0x599c5){if(_0x599c5){return _0x599c5[_0xde8c('0x25')]()[_0xde8c('0x24')](function(){_0x209974[_0xde8c('0x19')](0xcc)[_0xde8c('0x1a')]();});}};}function handleEntityNotFound(_0x1896f4,_0x1e160e){return function(_0x2edcb8){if(!_0x2edcb8){_0x1896f4[_0xde8c('0x18')](0x194);}return _0x2edcb8;};}function handleError(_0x25c998,_0x6503e3){_0x6503e3=_0x6503e3||0x1f4;return function(_0x1273b5){logger[_0xde8c('0x26')](_0x1273b5[_0xde8c('0x27')]);if(_0x1273b5[_0xde8c('0x28')]){delete _0x1273b5[_0xde8c('0x28')];}_0x25c998[_0xde8c('0x19')](_0x6503e3)[_0xde8c('0x29')](_0x1273b5);};}exports[_0xde8c('0x2a')]=function(_0x371095,_0x2b89ad){var _0x2991f9={},_0x18d2b7={},_0x5e52a8={'count':0x0,'rows':[]};return db[_0xde8c('0x2b')][_0xde8c('0x2c')]()[_0xde8c('0x24')](function(_0x5234e1){var _0x410e40=[];for(var _0x4bd415=0x0;_0x4bd4150x1){_0x3753b0['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xde8c('0x6b')](_0x55cd4f),null);}else{if(qs['isNumeric'](_0x55cd4f)){_0x3753b0['or']('c.id\x20LIKE\x20?',_0x55cd4f+'%');_0x3753b0['or'](_0xde8c('0x6c'),_0x55cd4f+'%');_0x3753b0['or']('c.mobile\x20LIKE\x20?',_0x55cd4f+'%');_0x3753b0['or'](_0xde8c('0x6d'),_0x55cd4f+'%');}else if(qs[_0xde8c('0x6e')](_0x55cd4f)){_0x3753b0['or']('c.email\x20LIKE\x20?',_0x55cd4f+'%');}else{_0x3753b0['or'](_0xde8c('0x6f'),'%'+_0x55cd4f+'%');_0x3753b0['or'](_0xde8c('0x70'),'%'+_0x55cd4f+'%');_0x3753b0['or'](_0xde8c('0x71'),'%'+_0x55cd4f+'%');}}}}_0x4b1aee[_0xde8c('0x3e')](_0x3753b0);_0x4b1aee[_0xde8c('0x72')](_0xde8c('0x73'));var _0x917f3b={'type':db['Sequelize'][_0xde8c('0x74')][_0xde8c('0x75')],'raw':!![]};var _0x82f68f=_0x4b1aee[_0xde8c('0x76')]()[_0xde8c('0x41')](_0xde8c('0x73'));if(_0x2991f9['order']){_0x2991f9['order']['forEach'](function(_0x5de3d0){_0x4b1aee[_0xde8c('0x3d')]('c.'+_0x5de3d0[0x0],_0x5de3d0[0x1]===_0xde8c('0x77')?![]:!![]);});}if(!_[_0xde8c('0x78')](_0x3d887a)){_0x4b1aee['having'](_0x5aeee3);_0x82f68f[_0xde8c('0x3e')](_0xde8c('0x79'),_0x3d887a);}BPromise[_0xde8c('0x7a')]()[_0xde8c('0x24')](function(){if(!_0x3e1b15)return;if(_0x371095[_0xde8c('0x7b')][_0xde8c('0x7c')]!=='agent')return;if(!_['some'](_0x3e1b15[_0xde8c('0x51')],[_0xde8c('0x41'),_0xde8c('0x7d')])){return _0x371095[_0xde8c('0x7b')][_0xde8c('0x7e')]({'attributes':['id'],'raw':!![]})[_0xde8c('0x24')](function(_0x152b88){if(_['isEmpty'](_0x152b88)){_0x82f68f[_0xde8c('0x3e')](_0xde8c('0x7f'));_0x4b1aee['where'](_0xde8c('0x7f'));}else{_0x82f68f[_0xde8c('0x3e')](_0xde8c('0x64'),_[_0xde8c('0x60')](_0x152b88,'id'));_0x4b1aee[_0xde8c('0x3e')](_0xde8c('0x64'),_['map'](_0x152b88,'id'));}});}})[_0xde8c('0x24')](function(){if(_0x371095[_0xde8c('0x7b')][_0xde8c('0x7c')]===_0xde8c('0x80')&&!_0x3e1b15&&!_0x371095[_0xde8c('0x38')][_0xde8c('0x81')])return[];return db[_0xde8c('0x82')][_0xde8c('0x38')](_0x82f68f[_0xde8c('0x83')](),_0x917f3b);})[_0xde8c('0x24')](function(_0x498817){_0x5e52a8[_0xde8c('0x1e')]=_0x498817[_0xde8c('0x2e')];if(_0x5e52a8[_0xde8c('0x1e')]===0x0)return[];return db[_0xde8c('0x82')][_0xde8c('0x38')](_0x95d8f3[_0xde8c('0x83')](),_0x917f3b)[_0xde8c('0x24')](function(_0x128f3a){_0x4bccf9=_['keyBy'](_0x128f3a,'id');_0x917f3b=_[_0xde8c('0x84')](_0x917f3b,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x371095['query']['fields']){_0x2991f9[_0xde8c('0x39')][_0xde8c('0x56')](function(_0x4b9371){_0x4b1aee[_0xde8c('0x41')]('c.'+_0x4b9371);});}else{_0x4b1aee[_0xde8c('0x41')](_0xde8c('0x73'));_0x4b1aee['field'](_0xde8c('0x85'));_0x4b1aee[_0xde8c('0x41')](_0xde8c('0x86'));_0x4b1aee['field'](_0xde8c('0x87'));_0x4b1aee['field'](_0xde8c('0x88'));_0x4b1aee[_0xde8c('0x41')](_0xde8c('0x89'));_0x4b1aee[_0xde8c('0x41')](_0xde8c('0x8a'));_0x4b1aee[_0xde8c('0x41')]('c.ListId');_0x4b1aee[_0xde8c('0x41')](_0xde8c('0x8b'));_0x4b1aee[_0xde8c('0x41')](_0xde8c('0x8c'));_0x4b1aee['field']('c.CompanyId');_0x4b1aee['field'](_0xde8c('0x8d'),'TagIds');}if(_0x2991f9[_0xde8c('0x1d')])_0x4b1aee[_0xde8c('0x1d')](_0x2991f9[_0xde8c('0x1d')]);if(_0x2991f9[_0xde8c('0x1f')])_0x4b1aee[_0xde8c('0x1f')](_0x2991f9[_0xde8c('0x1f')]);return db[_0xde8c('0x82')][_0xde8c('0x38')](_0x4b1aee[_0xde8c('0x83')](),_0x917f3b);});})[_0xde8c('0x24')](function(_0x500114){_0x500114['forEach'](function(_0x3697ae){if(_0x3697ae[_0xde8c('0x8e')]){_0x3697ae[_0xde8c('0x8f')]=[];_0x3697ae[_0xde8c('0x8e')][_0xde8c('0x55')](',')['forEach'](function(_0x4d6b3d){_0x3697ae[_0xde8c('0x8f')]['push'](_0x4bccf9[_0x4d6b3d]);});}delete _0x3697ae[_0xde8c('0x8e')];});_0x5e52a8[_0xde8c('0x90')]=_0x500114;return _0x5e52a8;})['then'](respondWithFilteredResult(_0x2b89ad,_0x2991f9));})[_0xde8c('0x91')](handleError(_0x2b89ad,null));};exports[_0xde8c('0x25')]=function(_0x31e497,_0x97f470){return db[_0xde8c('0x2b')]['find']({'where':{'id':_0x31e497[_0xde8c('0x92')]['id']}})[_0xde8c('0x24')](handleEntityNotFound(_0x97f470,null))[_0xde8c('0x24')](removeEntity(_0x97f470,null))['catch'](handleError(_0x97f470,null));};exports[_0xde8c('0x2c')]=function(_0x1b4cfc,_0x37416f){return db[_0xde8c('0x2b')][_0xde8c('0x2c')]()['then'](function(_0x55888b){delete _0x55888b[_0xde8c('0x93')];for(var _0x42bb86=0x0;_0x42bb860x0){return new Promise(function(_0x5f0a2a,_0x1af531){var _0x440104=[];for(var _0x2561ba=0x0;_0x2561ba<_0x514ca0[_0xde8c('0x2e')];_0x2561ba++){_0x440104[_0xde8c('0x31')](insertAdditionalPhones(_0x514ca0[_0x2561ba][_0xde8c('0xbe')],_0x514ca0[_0x2561ba][_0xde8c('0xba')]));}Promise[_0xde8c('0x34')](_0x440104)[_0xde8c('0x24')](function(){_0x5f0a2a(0x1);});})[_0xde8c('0x24')](function(){return{'success':_0x3ab377,'failure':_0xfe37e2,'duplicates':_0x2e5519};});}else{return{'success':_0x3ab377,'failure':_0xfe37e2,'duplicates':_0x2e5519};}}})[_0xde8c('0x24')](respondWithResult(_0x21ddf7,0xc9))[_0xde8c('0x91')](handleError(_0x21ddf7,null));};exports['show']=function(_0x10c3f5,_0x26a690,_0x555f08){var _0x224495;return db['CmContact'][_0xde8c('0x2c')]()['then'](function(_0x56b27d){return db[_0xde8c('0x2b')]['find']({'where':{'id':_0x10c3f5['params']['id']},'include':[{'model':db[_0xde8c('0x53')],'as':_0xde8c('0x8f'),'attributes':['id',_0xde8c('0x28'),'color'],'required':_0x10c3f5[_0xde8c('0x38')][_0xde8c('0x68')]?!![]:![]},{'model':db[_0xde8c('0xbf')],'as':_0xde8c('0xc0'),'where':{'CmContactId':_0x10c3f5[_0xde8c('0x92')]['id']},'required':![],'include':[{'model':db[_0xde8c('0xc1')],'as':'ItemType'}]}],'order':[db['sequelize'][_0xde8c('0xc2')](_0xde8c('0xc3'))],'logging':console[_0xde8c('0xc4')],'attributes':_[_0xde8c('0x2d')](_0x56b27d)});})[_0xde8c('0x24')](function(_0x11674f){_0x224495=_0x11674f[_0xde8c('0x9b')]({'plain':!![]});var _0x8887d9={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x11674f&&_0x11674f[_0xde8c('0x81')]){if(_0x11674f['ListId']){_0x8887d9[_0xde8c('0x3e')]['$and'][_0xde8c('0x31')]({'ListId':{'$ne':_0x11674f['ListId']}});}}return db['CmCustomField'][_0xde8c('0x95')](_0x8887d9);})[_0xde8c('0x24')](function(_0x56c48c){return _[_0xde8c('0xc5')](_0x224495,_['map'](_0x56c48c,function(_0x4ae035){return util['format']('cf_%d',_0x4ae035['id']);}));})[_0xde8c('0x24')](handleEntityNotFound(_0x26a690,null))[_0xde8c('0x24')](respondWithResult(_0x26a690,null))['catch'](handleError(_0x26a690,null));};exports[_0xde8c('0x23')]=function(_0x5373d6,_0x3c43de){var _0x5a6018;if(_0x5373d6['body']['id']){delete _0x5373d6['body']['id'];}return db['CmContact'][_0xde8c('0x52')]({'where':{'id':_0x5373d6[_0xde8c('0x92')]['id']}})[_0xde8c('0x24')](handleEntityNotFound(_0x3c43de,null))['then'](saveUpdates(_0x5373d6[_0xde8c('0x9a')],null))[_0xde8c('0x24')](function(_0x115780){_0x5a6018=_0x115780;var _0x279fa9={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x115780&&_0x115780['ListId']){if(_0x115780[_0xde8c('0x81')]){_0x279fa9[_0xde8c('0x3e')][_0xde8c('0xc6')][_0xde8c('0x31')]({'ListId':{'$ne':_0x115780[_0xde8c('0x81')]}});}}return db['CmCustomField']['findAll'](_0x279fa9);})['then'](function(_0x194e96){if(_0x194e96){return _[_0xde8c('0xc5')](_[_0xde8c('0xc7')](_0x5373d6['body'],function(_0x5ba53b,_0x50b0ff){return _[_0xde8c('0x2f')](_0x50b0ff,_0xde8c('0x30'));}),_['map'](_0x194e96,function(_0x1952af){return util[_0xde8c('0xc8')](_0xde8c('0xc9'),_0x1952af['id']);}));}})[_0xde8c('0x24')](function(_0x274366){if(_0x274366&&!_['isEmpty'](_0x274366)){var _0x3e4bed=squel[_0xde8c('0x23')]()['table']('cm_contacts')[_0xde8c('0xca')](_0x274366)[_0xde8c('0x3e')](_0xde8c('0xcb'),_0x5373d6[_0xde8c('0x92')]['id'])[_0xde8c('0xcc')]();return db[_0xde8c('0x82')]['query'](_0x3e4bed[_0xde8c('0x5e')],{'replacements':_0x3e4bed[_0xde8c('0x99')]});}})[_0xde8c('0x24')](function(){if(_0x5373d6[_0xde8c('0x9a')]['phone']&&_0x5a6018){return db[_0xde8c('0x9f')]['update']({'phone':_0x5373d6[_0xde8c('0x9a')][_0xde8c('0xcd')]},{'where':{'ContactId':_0x5a6018['id']}});}})[_0xde8c('0x24')](function(){return _0x5a6018;})[_0xde8c('0x24')](respondWithResult(_0x3c43de,null))[_0xde8c('0x91')](handleError(_0x3c43de,null));};exports[_0xde8c('0xce')]=function(_0x231f6c,_0x4a15be,_0x313abc){var _0x3611c1={};var _0xfa168d={};var _0x347a5a;var _0x3b37f2;return db['CmContact'][_0xde8c('0xcf')]({'where':{'id':_0x231f6c[_0xde8c('0x92')]['id']}})['then'](handleEntityNotFound(_0x4a15be,null))[_0xde8c('0x24')](function(_0x619e8c){if(_0x619e8c){_0x347a5a=_0x619e8c;_0xfa168d[_0xde8c('0x36')]=_[_0xde8c('0x2d')](db[_0xde8c('0x53')][_0xde8c('0xd0')]);_0xfa168d[_0xde8c('0x38')]=_[_0xde8c('0x2d')](_0x231f6c[_0xde8c('0x38')]);_0xfa168d[_0xde8c('0x40')]=_[_0xde8c('0x37')](_0xfa168d[_0xde8c('0x36')],_0xfa168d[_0xde8c('0x38')]);_0x3611c1[_0xde8c('0x39')]=_[_0xde8c('0x37')](_0xfa168d[_0xde8c('0x36')],qs['fields'](_0x231f6c[_0xde8c('0x38')]['fields']));_0x3611c1[_0xde8c('0x39')]=_0x3611c1[_0xde8c('0x39')][_0xde8c('0x2e')]?_0x3611c1[_0xde8c('0x39')]:_0xfa168d['model'];_0x3611c1[_0xde8c('0x3d')]=qs[_0xde8c('0xd1')](_0x231f6c['query'][_0xde8c('0xd1')]);_0x3611c1[_0xde8c('0x3e')]=qs[_0xde8c('0x40')](_[_0xde8c('0x3f')](_0x231f6c[_0xde8c('0x38')],_0xfa168d[_0xde8c('0x40')]));if(_0x231f6c[_0xde8c('0x38')][_0xde8c('0x61')]){_0x3611c1[_0xde8c('0x3e')]=_[_0xde8c('0x84')](_0x3611c1[_0xde8c('0x3e')],{'$or':_[_0xde8c('0x60')](_0x3611c1[_0xde8c('0x39')],function(_0x21cffc){var _0x5bf688={};_0x5bf688[_0x21cffc]={'$like':'%'+_0x231f6c[_0xde8c('0x38')][_0xde8c('0x61')]+'%'};return _0x5bf688;})});}_0x3611c1=_[_0xde8c('0x84')]({},_0x3611c1,_0x231f6c[_0xde8c('0xd2')]);return _0x347a5a['getTags'](_0x3611c1);}})['then'](function(_0x139644){if(_0x139644){_0x3b37f2=_0x139644[_0xde8c('0x2e')];if(!_0x231f6c[_0xde8c('0x38')][_0xde8c('0x3b')](_0xde8c('0x3c'))){_0x3611c1['limit']=qs[_0xde8c('0x1d')](_0x231f6c[_0xde8c('0x38')][_0xde8c('0x1d')]);_0x3611c1[_0xde8c('0x1f')]=qs['offset'](_0x231f6c[_0xde8c('0x38')][_0xde8c('0x1f')]);}return _0x347a5a['getTags'](_0x3611c1);}})['then'](function(_0xa81407){if(_0xa81407){return _0xa81407?{'count':_0x3b37f2,'rows':_0xa81407}:null;}})[_0xde8c('0x24')](respondWithResult(_0x4a15be,null))[_0xde8c('0x91')](handleError(_0x4a15be,null));};exports[_0xde8c('0xd3')]=function(_0x51ddf6,_0x15c616,_0xa69fd3){if(_0x51ddf6[_0xde8c('0x9a')]['id']){delete _0x51ddf6[_0xde8c('0x9a')]['id'];}return db['CmContact'][_0xde8c('0xcf')]({'where':{'id':_0x51ddf6['params']['id']}})[_0xde8c('0x24')](handleEntityNotFound(_0x15c616,null))[_0xde8c('0x24')](function(_0x4138b0){if(_0x4138b0){return _0x4138b0[_0xde8c('0xd3')](_0x51ddf6[_0xde8c('0x9a')][_0xde8c('0xd4')]||[]);}return null;})[_0xde8c('0x24')](respondWithResult(_0x15c616,null))[_0xde8c('0x91')](handleError(_0x15c616,null));};exports['setAdditionalPhones']=function(_0x297d5a,_0x12ab54){var _0x131926=[];_0x131926[_0xde8c('0x31')](addAdditionalPhones(_0x297d5a['body']));Promise[_0xde8c('0x34')](_0x131926)['then'](function(){_0x131926=[];_0x131926[_0xde8c('0x31')](deleteCmHopperPhones(_0x297d5a[_0xde8c('0x9a')]['id']));_0x131926[_0xde8c('0x31')](addCmHopperPhones(_0x297d5a['body']['id']));Promise[_0xde8c('0x34')](_0x131926)[_0xde8c('0x24')](function(){return[0x1];})[_0xde8c('0x24')](respondWithResult(_0x12ab54,null));});};function addAdditionalPhones(_0x203894){return new Promise(function(_0x12b0e9,_0x39785e){return db['CmContactHasItem'][_0xde8c('0x25')]({'where':{'CmContactId':_0x203894['id']}})[_0xde8c('0x24')](function(){var _0x202a33=[];for(var _0x5ea7d6=0x0;_0x5ea7d6<_0x203894[_0xde8c('0xd5')][_0xde8c('0x2e')];_0x5ea7d6++){_0x202a33[_0xde8c('0x31')](addAdditionalPhone(_0x203894['id'],_0x203894[_0xde8c('0xd5')][_0x5ea7d6][_0xde8c('0xcd')],_0x203894['item_types']?_[_0xde8c('0x62')](_0x203894[_0xde8c('0xd6')][_0x5ea7d6])?null:_0x203894[_0xde8c('0xd6')][_0x5ea7d6]:_0x203894['items'][_0x5ea7d6][_0xde8c('0xd7')]?_0x203894[_0xde8c('0xd5')][_0x5ea7d6][_0xde8c('0xd7')]:null,_0x5ea7d6,_0x203894['items'][_0x5ea7d6][_0xde8c('0xd8')]));}Promise['all'](_0x202a33)[_0xde8c('0x24')](function(){_0x12b0e9(0x1);});});});}function addAdditionalPhone(_0x1a3127,_0x24c9c4,_0x14caa3,_0x2c9eef,_0x4af630){return db[_0xde8c('0xbf')][_0xde8c('0x52')]({'where':{'CmContactId':_0x1a3127,'item':_0x24c9c4}})[_0xde8c('0x24')](function(_0x4fa6c7){if(_0x4fa6c7)logger[_0xde8c('0x9d')](_0xde8c('0xd9'),_0x4fa6c7);else{db[_0xde8c('0xbf')][_0xde8c('0xa3')]({'CmContactId':_0x1a3127,'item':_0x24c9c4,'ItemTypeId':_0x14caa3,'OrderBy':_0x2c9eef,'ItemClass':_0xde8c('0xda'),'description':_0x4af630});}});}function deletePhones(_0x97cf73){return db[_0xde8c('0xbf')][_0xde8c('0x25')]({'where':{'CmContactId':_0x97cf73}});}function deleteCmHopperPhones(_0x14c799){return new Promise(function(_0x43bc01,_0x1941b2){return db[_0xde8c('0x9f')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x14c799}})['then'](function(_0x1c0d4e){db[_0xde8c('0xdb')][_0xde8c('0x25')]({'where':{'CmHopperId':{'$in':_[_0xde8c('0x60')](_0x1c0d4e,'id')}}});})[_0xde8c('0x24')](function(){_0x43bc01(0x1);});});}function addCmHopperPhones(_0x4343b6){return new Promise(function(_0x605c1e,_0x54ff4b){return db[_0xde8c('0x9f')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x4343b6}})[_0xde8c('0x24')](function(_0x4c8b4e){var _0x175585=[];_[_0xde8c('0x60')](_0x4c8b4e,function(_0x448c26){_0x175585[_0xde8c('0x31')](createCmHopperPhone(_0x4343b6,_0x448c26['id']));});Promise[_0xde8c('0x34')](_0x175585)[_0xde8c('0x24')](function(){_0x605c1e(0x1);});});});}function createCmHopperPhone(_0x25c759,_0x2f5a37){return new Promise(function(_0x281fd8,_0x5867c9){db[_0xde8c('0xbf')][_0xde8c('0x95')]({'raw':!![],'attributes':[_0xde8c('0xdc')],'where':{'CmContactId':_0x25c759,'ItemClass':_0xde8c('0xda')},'include':[{'model':db[_0xde8c('0xc1')],'attributes':[_0xde8c('0xdd')],'as':_0xde8c('0xde')}],'order':[db['sequelize']['literal']('`ItemType`.OrderBy')]})['then'](function(_0x123c9a){var _0x97458b=0x1;var _0x52e554=_[_0xde8c('0x60')](_0x123c9a,function(_0x296e38){_0x296e38[_0xde8c('0xdf')]=_0x2f5a37;_0x296e38['phone']=_0x296e38[_0xde8c('0xdc')];_0x296e38[_0xde8c('0xdd')]=_0x296e38[_0xde8c('0xe0')]||_0x97458b;delete _0x296e38[_0xde8c('0xe0')];_0x97458b=_0x97458b+0x1;return _0x296e38;});return db[_0xde8c('0xdb')][_0xde8c('0xe1')](_0x52e554,{});})[_0xde8c('0x24')](function(){_0x281fd8(0x1);});});}function insertAdditionalPhones(_0x20d32f,_0x16acc1){return new Promise(function(_0x2da25d,_0x39cc6b){var _0x51f97e=[];for(var _0x225f64=0x0;_0x225f64<_0x16acc1[_0xde8c('0x2e')];_0x225f64++){var _0x5178fe=_0x16acc1[_0x225f64];_0x51f97e[_0xde8c('0x31')](parseContactItemType(_0x5178fe));}Promise['all'](_0x51f97e)[_0xde8c('0x24')](function(){var _0x3c8424={'id':_0x20d32f['id'],'items':_0x16acc1};return addAdditionalPhones(_0x3c8424)[_0xde8c('0x24')](function(_0xe743b5){return addCmHopperPhones(_0x20d32f['id']);});})['then'](function(){_0x2da25d(_0x20d32f);});});}function parseContactItemType(_0x4f7450){return new Promise(function(_0x3f2868,_0x1fea1a){if(_0x4f7450['hasOwnProperty']('ItemTypeId')){_0x3f2868(_0x4f7450);}else{return db[_0xde8c('0xc1')][_0xde8c('0x52')]({'where':{'name':_0x4f7450[_0xde8c('0xde')]}})[_0xde8c('0x24')](function(_0x3bb5cf){if(_[_0xde8c('0x62')](_0x3bb5cf))_0x4f7450['ItemTypeId']=null;else _0x4f7450[_0xde8c('0xd7')]=_0x3bb5cf['id'];_0x3f2868(_0x4f7450);});}});}exports[_0xde8c('0xe2')]=function(_0x25fb1e,_0x234007){return db['CmContactHasItem'][_0xde8c('0x95')]({'raw':!![],'where':{'CmContactId':_0x25fb1e[_0xde8c('0x92')]['id'],'ItemClass':_0xde8c('0xda')},'include':[{'model':db[_0xde8c('0xc1')],'as':_0xde8c('0xde')}],'order':[[db['sequelize'][_0xde8c('0xc2')]('`ItemType`.OrderBy')],['OrderBy']]})[_0xde8c('0x24')](function(_0x56e233){return _0x56e233;})['then'](respondWithResult(_0x234007,null))[_0xde8c('0x91')](handleError(_0x234007,null));};exports[_0xde8c('0xe3')]=function(_0x149706,_0x162247){return db[_0xde8c('0xbf')]['findAll']({'raw':!![],'where':{'CmContactId':_0x149706[_0xde8c('0x9a')][_0xde8c('0xe4')]}})[_0xde8c('0x24')](function(_0x497fe0){var _0x4d04c0=_[_0xde8c('0x60')](_0x497fe0,function(_0x116395){_0x116395[_0xde8c('0xe5')]=_0x149706[_0xde8c('0x9a')]['toContactId'];return _0x116395;});return db[_0xde8c('0xbf')][_0xde8c('0xe1')](_0x4d04c0,{});})[_0xde8c('0x24')](function(_0x139864){return addCmHopperPhones(_0x149706[_0xde8c('0x9a')][_0xde8c('0xe6')]);})[_0xde8c('0x24')](function(_0x2be09c){return['ok'];})['then'](respondWithResult(_0x162247,null))['catch'](handleError(_0x162247,null));};exports[_0xde8c('0xe7')]=function(_0x594f45,_0x28c06c){var _0x3d5db4=[];_0x3d5db4[_0xde8c('0x31')](createCmHopperPhone(_0x594f45['body']['id'],_0x594f45['body'][_0xde8c('0xe8')]));Promise['all'](_0x3d5db4)['then'](function(){return[0x1];})[_0xde8c('0x24')](respondWithResult(_0x28c06c,null));};exports['getHoppers']=function(_0x1a5c45,_0x32c905,_0x299c2e){var _0x3b4119={'raw':![],'where':{}};var _0x4e98dc={};var _0x283b63={'count':0x0,'rows':[]};return db[_0xde8c('0x2b')]['findOne']({'where':{'id':_0x1a5c45['params']['id']}})['then'](handleEntityNotFound(_0x32c905,null))[_0xde8c('0x24')](function(_0x2fddfd){if(_0x2fddfd){_0x4e98dc[_0xde8c('0x36')]=_[_0xde8c('0x2d')](db['CmHopper'][_0xde8c('0xd0')]);_0x4e98dc[_0xde8c('0x38')]=_['keys'](_0x1a5c45[_0xde8c('0x38')]);_0x4e98dc['filters']=_[_0xde8c('0x37')](_0x4e98dc[_0xde8c('0x36')],_0x4e98dc[_0xde8c('0x38')]);_0x3b4119[_0xde8c('0x39')]=_[_0xde8c('0x37')](_0x4e98dc[_0xde8c('0x36')],qs[_0xde8c('0x3a')](_0x1a5c45[_0xde8c('0x38')][_0xde8c('0x3a')]));_0x3b4119[_0xde8c('0x39')]=_0x3b4119['attributes'][_0xde8c('0x2e')]?_0x3b4119['attributes']:_0x4e98dc[_0xde8c('0x36')];if(!_0x1a5c45['query'][_0xde8c('0x3b')](_0xde8c('0x3c'))){_0x3b4119[_0xde8c('0x1d')]=qs[_0xde8c('0x1d')](_0x1a5c45[_0xde8c('0x38')][_0xde8c('0x1d')]);_0x3b4119[_0xde8c('0x1f')]=qs[_0xde8c('0x1f')](_0x1a5c45[_0xde8c('0x38')][_0xde8c('0x1f')]);}_0x3b4119[_0xde8c('0x3d')]=qs[_0xde8c('0xd1')](_0x1a5c45[_0xde8c('0x38')][_0xde8c('0xd1')]);_0x3b4119[_0xde8c('0x3e')]=qs[_0xde8c('0x40')](_[_0xde8c('0x3f')](_0x1a5c45[_0xde8c('0x38')],_0x4e98dc[_0xde8c('0x40')]));_0x3b4119[_0xde8c('0x3e')][_0xde8c('0xe9')]=_0x2fddfd['id'];if(_0x1a5c45[_0xde8c('0x38')][_0xde8c('0x61')]){_0x3b4119[_0xde8c('0x3e')]=_[_0xde8c('0x84')](_0x3b4119[_0xde8c('0x3e')],{'$or':_[_0xde8c('0x60')](_0x3b4119[_0xde8c('0x39')],function(_0x57ad87){var _0x218fc0={};_0x218fc0[_0x57ad87]={'$like':'%'+_0x1a5c45['query'][_0xde8c('0x61')]+'%'};return _0x218fc0;})});}_0x3b4119=_['merge']({},_0x3b4119,_0x1a5c45[_0xde8c('0xd2')]);return db[_0xde8c('0x9f')][_0xde8c('0x1e')]({'where':_0x3b4119['where']})[_0xde8c('0x24')](function(_0x13e9bb){_0x283b63[_0xde8c('0x1e')]=_0x13e9bb;if(_0x1a5c45[_0xde8c('0x38')][_0xde8c('0xea')]){_0x3b4119['include']=[{'all':!![]}];}return db[_0xde8c('0x9f')]['findAll'](_0x3b4119);})[_0xde8c('0x24')](function(_0x3fc58d){_0x283b63[_0xde8c('0x90')]=_0x3fc58d;return _0x283b63;});}})[_0xde8c('0x24')](respondWithFilteredResult(_0x32c905,_0x3b4119))[_0xde8c('0x91')](handleError(_0x32c905,null));};exports['getHopperHistories']=function(_0x1d2b16,_0x507f7b,_0x398c55){var _0x2932c0={'raw':!![],'where':{}};var _0x2b9588={};var _0x677bef={'count':0x0,'rows':[]};return db[_0xde8c('0x2b')]['findOne']({'where':{'id':_0x1d2b16['params']['id']}})[_0xde8c('0x24')](handleEntityNotFound(_0x507f7b,null))[_0xde8c('0x24')](function(_0x49f0f5){if(_0x49f0f5){_0x2b9588[_0xde8c('0x36')]=_['keys'](db[_0xde8c('0xaf')][_0xde8c('0xd0')]);_0x2b9588['query']=_['keys'](_0x1d2b16[_0xde8c('0x38')]);_0x2b9588[_0xde8c('0x40')]=_[_0xde8c('0x37')](_0x2b9588[_0xde8c('0x36')],_0x2b9588[_0xde8c('0x38')]);_0x2932c0[_0xde8c('0x39')]=_[_0xde8c('0x37')](_0x2b9588['model'],qs['fields'](_0x1d2b16[_0xde8c('0x38')][_0xde8c('0x3a')]));_0x2932c0[_0xde8c('0x39')]=_0x2932c0[_0xde8c('0x39')][_0xde8c('0x2e')]?_0x2932c0[_0xde8c('0x39')]:_0x2b9588[_0xde8c('0x36')];if(!_0x1d2b16[_0xde8c('0x38')][_0xde8c('0x3b')](_0xde8c('0x3c'))){_0x2932c0[_0xde8c('0x1d')]=qs[_0xde8c('0x1d')](_0x1d2b16[_0xde8c('0x38')][_0xde8c('0x1d')]);_0x2932c0[_0xde8c('0x1f')]=qs[_0xde8c('0x1f')](_0x1d2b16[_0xde8c('0x38')][_0xde8c('0x1f')]);}_0x2932c0['order']=qs[_0xde8c('0xd1')](_0x1d2b16[_0xde8c('0x38')]['sort']);_0x2932c0[_0xde8c('0x3e')]=qs[_0xde8c('0x40')](_[_0xde8c('0x3f')](_0x1d2b16[_0xde8c('0x38')],_0x2b9588['filters']));_0x2932c0[_0xde8c('0x3e')][_0xde8c('0xe9')]=_0x49f0f5['id'];if(_0x1d2b16[_0xde8c('0x38')][_0xde8c('0x61')]){_0x2932c0[_0xde8c('0x3e')]=_[_0xde8c('0x84')](_0x2932c0['where'],{'$or':_['map'](_0x2932c0['attributes'],function(_0x1196d1){var _0x230cd6={};_0x230cd6[_0x1196d1]={'$like':'%'+_0x1d2b16[_0xde8c('0x38')][_0xde8c('0x61')]+'%'};return _0x230cd6;})});}_0x2932c0=_['merge']({},_0x2932c0,_0x1d2b16[_0xde8c('0xd2')]);return db['CmHopperHistory'][_0xde8c('0x1e')]({'where':_0x2932c0[_0xde8c('0x3e')]})[_0xde8c('0x24')](function(_0x4b13df){_0x677bef[_0xde8c('0x1e')]=_0x4b13df;if(_0x1d2b16[_0xde8c('0x38')]['includeAll']){_0x2932c0[_0xde8c('0xeb')]=[{'all':!![]}];}return db[_0xde8c('0xaf')]['findAll'](_0x2932c0);})[_0xde8c('0x24')](function(_0x35f7ca){_0x677bef[_0xde8c('0x90')]=_0x35f7ca;return _0x677bef;});}})[_0xde8c('0x24')](respondWithFilteredResult(_0x507f7b,_0x2932c0))[_0xde8c('0x91')](handleError(_0x507f7b,null));};exports['getHopperFinals']=function(_0x4ed1ed,_0x174794,_0x2d52df){var _0xba4a7f={'raw':!![],'where':{}};var _0x5c90f6={};var _0x4b7769={'count':0x0,'rows':[]};return db['CmContact'][_0xde8c('0xcf')]({'where':{'id':_0x4ed1ed[_0xde8c('0x92')]['id']}})[_0xde8c('0x24')](handleEntityNotFound(_0x174794,null))[_0xde8c('0x24')](function(_0x2e2122){if(_0x2e2122){_0x5c90f6[_0xde8c('0x36')]=_['keys'](db[_0xde8c('0xae')][_0xde8c('0xd0')]);_0x5c90f6['query']=_[_0xde8c('0x2d')](_0x4ed1ed[_0xde8c('0x38')]);_0x5c90f6[_0xde8c('0x40')]=_[_0xde8c('0x37')](_0x5c90f6[_0xde8c('0x36')],_0x5c90f6[_0xde8c('0x38')]);_0xba4a7f[_0xde8c('0x39')]=_[_0xde8c('0x37')](_0x5c90f6['model'],qs[_0xde8c('0x3a')](_0x4ed1ed[_0xde8c('0x38')][_0xde8c('0x3a')]));_0xba4a7f[_0xde8c('0x39')]=_0xba4a7f[_0xde8c('0x39')][_0xde8c('0x2e')]?_0xba4a7f[_0xde8c('0x39')]:_0x5c90f6[_0xde8c('0x36')];if(!_0x4ed1ed[_0xde8c('0x38')][_0xde8c('0x3b')](_0xde8c('0x3c'))){_0xba4a7f[_0xde8c('0x1d')]=qs[_0xde8c('0x1d')](_0x4ed1ed['query'][_0xde8c('0x1d')]);_0xba4a7f[_0xde8c('0x1f')]=qs[_0xde8c('0x1f')](_0x4ed1ed[_0xde8c('0x38')][_0xde8c('0x1f')]);}_0xba4a7f['order']=qs[_0xde8c('0xd1')](_0x4ed1ed[_0xde8c('0x38')][_0xde8c('0xd1')]);_0xba4a7f[_0xde8c('0x3e')]=qs[_0xde8c('0x40')](_['pick'](_0x4ed1ed['query'],_0x5c90f6[_0xde8c('0x40')]));_0xba4a7f[_0xde8c('0x3e')][_0xde8c('0xe9')]=_0x2e2122['id'];if(_0x4ed1ed['query']['filter']){_0xba4a7f[_0xde8c('0x3e')]=_[_0xde8c('0x84')](_0xba4a7f[_0xde8c('0x3e')],{'$or':_['map'](_0xba4a7f[_0xde8c('0x39')],function(_0x366714){var _0x45fc4d={};_0x45fc4d[_0x366714]={'$like':'%'+_0x4ed1ed[_0xde8c('0x38')]['filter']+'%'};return _0x45fc4d;})});}_0xba4a7f=_[_0xde8c('0x84')]({},_0xba4a7f,_0x4ed1ed[_0xde8c('0xd2')]);return db['CmHopperFinal'][_0xde8c('0x1e')]({'where':_0xba4a7f[_0xde8c('0x3e')]})[_0xde8c('0x24')](function(_0x16340b){_0x4b7769[_0xde8c('0x1e')]=_0x16340b;if(_0x4ed1ed[_0xde8c('0x38')][_0xde8c('0xea')]){_0xba4a7f[_0xde8c('0xeb')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xde8c('0x95')](_0xba4a7f);})['then'](function(_0x596a52){_0x4b7769[_0xde8c('0x90')]=_0x596a52;return _0x4b7769;});}})[_0xde8c('0x24')](respondWithFilteredResult(_0x174794,_0xba4a7f))[_0xde8c('0x91')](handleError(_0x174794,null));};exports[_0xde8c('0xec')]=function(_0x474134,_0x3c1fe4,_0x53564b){var _0x379491={'raw':!![],'where':{}};var _0x51bafa={};var _0x3dba48={'count':0x0,'rows':[]};return db[_0xde8c('0x2b')]['findOne']({'where':{'id':_0x474134[_0xde8c('0x92')]['id']}})['then'](handleEntityNotFound(_0x3c1fe4,null))['then'](function(_0x111199){if(_0x111199){_0x51bafa[_0xde8c('0x36')]=_[_0xde8c('0x2d')](db[_0xde8c('0xb5')][_0xde8c('0xd0')]);_0x51bafa[_0xde8c('0x38')]=_['keys'](_0x474134[_0xde8c('0x38')]);_0x51bafa[_0xde8c('0x40')]=_[_0xde8c('0x37')](_0x51bafa[_0xde8c('0x36')],_0x51bafa['query']);_0x379491[_0xde8c('0x39')]=_[_0xde8c('0x37')](_0x51bafa[_0xde8c('0x36')],qs[_0xde8c('0x3a')](_0x474134['query'][_0xde8c('0x3a')]));_0x379491[_0xde8c('0x39')]=_0x379491[_0xde8c('0x39')][_0xde8c('0x2e')]?_0x379491['attributes']:_0x51bafa[_0xde8c('0x36')];if(!_0x474134[_0xde8c('0x38')]['hasOwnProperty'](_0xde8c('0x3c'))){_0x379491[_0xde8c('0x1d')]=qs[_0xde8c('0x1d')](_0x474134[_0xde8c('0x38')][_0xde8c('0x1d')]);_0x379491[_0xde8c('0x1f')]=qs['offset'](_0x474134[_0xde8c('0x38')][_0xde8c('0x1f')]);}_0x379491[_0xde8c('0x3d')]=qs[_0xde8c('0xd1')](_0x474134[_0xde8c('0x38')][_0xde8c('0xd1')]);_0x379491['where']=qs[_0xde8c('0x40')](_[_0xde8c('0x3f')](_0x474134[_0xde8c('0x38')],_0x51bafa[_0xde8c('0x40')]));_0x379491[_0xde8c('0x3e')][_0xde8c('0xe9')]=_0x111199['id'];if(_0x474134[_0xde8c('0x38')][_0xde8c('0x61')]){_0x379491[_0xde8c('0x3e')]=_['merge'](_0x379491[_0xde8c('0x3e')],{'$or':_['map'](_0x379491['attributes'],function(_0x4a7b71){var _0x372bc7={};_0x372bc7[_0x4a7b71]={'$like':'%'+_0x474134[_0xde8c('0x38')][_0xde8c('0x61')]+'%'};return _0x372bc7;})});}_0x379491=_[_0xde8c('0x84')]({},_0x379491,_0x474134[_0xde8c('0xd2')]);return db[_0xde8c('0xb5')][_0xde8c('0x1e')]({'where':_0x379491[_0xde8c('0x3e')]})[_0xde8c('0x24')](function(_0x7e309b){_0x3dba48['count']=_0x7e309b;if(_0x474134[_0xde8c('0x38')][_0xde8c('0xea')]){_0x379491[_0xde8c('0xeb')]=[{'all':!![]}];}return db[_0xde8c('0xb5')][_0xde8c('0x95')](_0x379491);})[_0xde8c('0x24')](function(_0x2487ea){_0x3dba48[_0xde8c('0x90')]=_0x2487ea;return _0x3dba48;});}})['then'](respondWithFilteredResult(_0x3c1fe4,_0x379491))[_0xde8c('0x91')](handleError(_0x3c1fe4,null));};exports['uploadCsv']=function(_0x14c13d,_0x81860b,_0x4e575d){try{if(!_0x14c13d[_0xde8c('0x9a')]['ListId']){throw new Error(_0xde8c('0xed'));}if(!_0x14c13d['body'][_0xde8c('0xee')]){throw new Error(_0xde8c('0xef'));}if(!_0x14c13d[_0xde8c('0x9a')]['binding_values']){throw new Error(_0xde8c('0xf0'));}if(!_0x14c13d[_0xde8c('0x9a')][_0xde8c('0xf1')]){throw new Error(_0xde8c('0xf2'));}var _0x47b672=_0x14c13d[_0xde8c('0x9a')]['binding_keys'][_0xde8c('0x55')](',');var _0x225520=_0x14c13d[_0xde8c('0x9a')][_0xde8c('0xf3')]['split'](',');if(!_0x47b672[_0xde8c('0x2e')]||!_0x225520['length']||_0x47b672[_0xde8c('0x2e')]!==_0x225520[_0xde8c('0x2e')]){throw new Error('Incorrect\x20binding\x20parameters\x20passed!');}_0x14c13d[_0xde8c('0x9a')]['fields']=_['zipObject'](_0x47b672,_0x225520);if(!_0x14c13d[_0xde8c('0x9a')][_0xde8c('0x3a')][_0xde8c('0xcd')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x14c13d['body']['fields'][_0xde8c('0xf4')]){throw new Error('No\x20firstName\x20column\x20specified');}var _0x4f275b=path['join'](config['root'],_0xde8c('0xf5'),_0x14c13d[_0xde8c('0xf6')][_0xde8c('0xf7')]);fs['chmodSync'](_0x4f275b,parseInt(_0xde8c('0xf8'),0x8));var _0x359d59=require(_0xde8c('0xf9'))[_0xde8c('0xfa')](path[_0xde8c('0xb9')](__dirname,_0xde8c('0xfb')),[_0x4f275b,_0x14c13d['body'][_0xde8c('0xee')],_0x14c13d[_0xde8c('0x9a')][_0xde8c('0xf3')],_0x14c13d[_0xde8c('0x9a')][_0xde8c('0x81')],_0x14c13d['body']['CompanyId'],_0x14c13d[_0xde8c('0x9a')][_0xde8c('0xbb')],_0x14c13d[_0xde8c('0x9a')][_0xde8c('0xf1')]]);return _0x81860b[_0xde8c('0x19')](0xc8)['json']({'message':_0xde8c('0xfc'),'pid':_0x359d59['pid']});}catch(_0x2dbec0){return _0x81860b[_0xde8c('0x19')](0x1f4)[_0xde8c('0x29')](_0x2dbec0);}};exports[_0xde8c('0xfd')]=function(_0x33483f,_0x33b89d,_0xef3cc3){var _0x53a222=fs[_0xde8c('0xfe')](_0x33483f[_0xde8c('0xf6')][_0xde8c('0xff')]);Papa[_0xde8c('0x100')](_0x53a222,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x53ace9){return _0x33b89d['status'](0xc8)['json']({'file':_0x33483f[_0xde8c('0xf6')],'fields':_0x53ace9[_0xde8c('0x101')][_0xde8c('0x3a')]});}});};exports[_0xde8c('0x102')]=function(_0x361094,_0x5c1b2f,_0x288fb5){return db['User']['findAll']({'raw':!![],'attributes':['id'],'where':{'role':'agent'}})[_0xde8c('0x24')](function(_0x250a12){var _0x232a7c=![];if(!_0x361094['body'][_0xde8c('0x81')]){throw new Error('No\x20ListId\x20specified');}if(!_0x361094[_0xde8c('0x9a')][_0xde8c('0x103')][_0xde8c('0xcd')]){throw new Error(_0xde8c('0x104'));}if(!_0x361094['body'][_0xde8c('0x103')][_0xde8c('0xf4')]){throw new Error(_0xde8c('0x105'));}if(!_0x361094[_0xde8c('0x9a')][_0xde8c('0xf1')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x4b1045=require(_0xde8c('0xf9'))[_0xde8c('0xfa')](path[_0xde8c('0xb9')](__dirname,_0xde8c('0x106')),[_0x361094[_0xde8c('0x92')]['id'],JSON[_0xde8c('0x107')](_0x361094[_0xde8c('0x9a')]),JSON[_0xde8c('0x107')](_0x250a12)]);_0x4b1045['on'](_0xde8c('0x108'),function(_0x4380cd){_0x232a7c=!![];return _0x5c1b2f[_0xde8c('0x19')](0xc8)[_0xde8c('0x1b')]({'message':_0xde8c('0x109'),'pid':_0x4b1045[_0xde8c('0x10a')]});});_0x4b1045['on'](_0xde8c('0x10b'),function(_0x5bfd29){if(_0x5bfd29&&!_0x232a7c){return _0x5c1b2f[_0xde8c('0x19')](0x1f4)[_0xde8c('0x1b')]({'message':_0xde8c('0x10c'),'pid':_0x4b1045[_0xde8c('0x10a')]});}});})['catch'](handleError(_0x5c1b2f,null));};exports[_0xde8c('0x10d')]=function(_0x5ea4aa,_0xf92921,_0x818be1){return db['User'][_0xde8c('0x95')]({'raw':!![],'attributes':['id'],'where':{'role':_0xde8c('0x80')}})[_0xde8c('0x24')](function(_0xa7de62){var _0x53c37f=![];if(!_0x5ea4aa['body'][_0xde8c('0x81')]){throw new Error('No\x20ListId\x20specified');}if(!_0x5ea4aa[_0xde8c('0x9a')]['binding'][_0xde8c('0xcd')]){throw new Error(_0xde8c('0x104'));}if(!_0x5ea4aa[_0xde8c('0x9a')][_0xde8c('0x103')][_0xde8c('0xf4')]){throw new Error(_0xde8c('0x105'));}if(!_0x5ea4aa[_0xde8c('0x9a')][_0xde8c('0xf1')]){throw new Error(_0xde8c('0xf2'));}var _0xa7206f=require(_0xde8c('0xf9'))[_0xde8c('0xfa')](path[_0xde8c('0xb9')](__dirname,_0xde8c('0x10e')),[_0x5ea4aa['params']['id'],JSON[_0xde8c('0x107')](_0x5ea4aa[_0xde8c('0x9a')]),JSON['stringify'](_0xa7de62)]);_0xa7206f['on'](_0xde8c('0x108'),function(_0x5d2093){_0x53c37f=!![];return _0xf92921[_0xde8c('0x19')](0xc8)['json']({'message':'start\x20child\x20process\x20correctly!','pid':_0xa7206f['pid']});});_0xa7206f['on'](_0xde8c('0x10b'),function(_0x2906aa){if(_0x2906aa&&!_0x53c37f){return _0xf92921[_0xde8c('0x19')](0x1f4)[_0xde8c('0x1b')]({'message':_0xde8c('0x10c'),'pid':_0xa7206f[_0xde8c('0x10a')]});}});})[_0xde8c('0x91')](handleError(_0xf92921,null));};exports[_0xde8c('0x10f')]=function(_0xe59895,_0x3d5c0a){var _0x2b8b77=['mail',_0xde8c('0x110'),_0xde8c('0x111'),'openchannel',_0xde8c('0x112'),_0xde8c('0x113'),_0xde8c('0x114')];var _0x531086={'offset':0x0,'order':qs[_0xde8c('0xd1')](_0xde8c('0x115'))},_0x5d4df5={'count':0x0,'rows':[]};Promise[_0xde8c('0x7a')]()[_0xde8c('0x24')](function(){if(_0xe59895['query'][_0xde8c('0x116')]){if(!_[_0xde8c('0x117')](_0x2b8b77,_0xe59895[_0xde8c('0x38')][_0xde8c('0x116')][_0xde8c('0x118')]())){throw new Error(_0xde8c('0x119'));}_0x2b8b77=[_0xe59895[_0xde8c('0x38')][_0xde8c('0x116')][_0xde8c('0x118')]()];}if(_0xe59895[_0xde8c('0x38')]['range']){try{var _0x5d4979=JSON[_0xde8c('0x100')](_0xe59895[_0xde8c('0x38')][_0xde8c('0x11a')]);if(!moment(_0x5d4979[_0xde8c('0x44')])[_0xde8c('0x11b')]()){throw new Error(_0xde8c('0x11c'));}if(!moment(_0x5d4979['to'])[_0xde8c('0x11b')]()){throw new Error(_0xde8c('0x11d'));}}catch(_0x5c832c){throw new Error('Invalid\x20createdAt\x20filter');}}if(!_0xe59895[_0xde8c('0x38')][_0xde8c('0x3b')](_0xde8c('0x3c'))){_0x531086[_0xde8c('0x1d')]=qs[_0xde8c('0x1d')](_0xe59895['query'][_0xde8c('0x1d')]||0xa);_0x531086[_0xde8c('0x1f')]=qs[_0xde8c('0x1f')](_0xe59895['query'][_0xde8c('0x1f')]);}var _0x10de9d=_0x2b8b77[_0xde8c('0x60')](function(_0x7869f8){if(_0x7869f8==='voice'){var _0x13ee3a={'attributes':['id',_0xde8c('0x11e'),_0xde8c('0x35'),'source','destination',_0xde8c('0x11f'),_0xde8c('0x120'),'endtime',_0xde8c('0x121'),'note',_0xde8c('0x122'),'userDisposition','userSecondDisposition','userThirdDisposition','UserId'],'where':{'ContactId':_0xe59895[_0xde8c('0x92')]['id']},'include':[{'model':db[_0xde8c('0x7d')],'as':_0xde8c('0x7d'),'attributes':['id','name',_0xde8c('0x123'),'alias']}],'order':[[_0xde8c('0x122'),'DESC']]};if(_0xe59895['query'][_0xde8c('0x11a')]){_0x13ee3a[_0xde8c('0x3e')][_0xde8c('0x122')]={'$gte':_0x5d4979[_0xde8c('0x44')],'$lte':_0x5d4979['to']};}return db['VoiceCallReport'][_0xde8c('0x124')](_0x13ee3a)[_0xde8c('0x24')](function(_0x380ffe){_0x5d4df5[_0xde8c('0x1e')]+=_0x380ffe[_0xde8c('0x1e')];return _['map'](_0x380ffe[_0xde8c('0x90')],function(_0x3f2d6c){var _0x11a276=_0x3f2d6c[_0xde8c('0x9b')]({'plain':!![]});_0x11a276['channel']=_0x7869f8;if(_0x11a276[_0xde8c('0x7d')]){_0x11a276[_0xde8c('0x7d')]={'id':_0x11a276['User']['id'],'name':_0x11a276['User'][_0xde8c('0x28')],'fullname':_0x11a276[_0xde8c('0x7d')][_0xde8c('0x123')],'alias':_0x11a276['User']['alias']};}return _0x11a276;});});}else{var _0x5a5c27=_[_0xde8c('0x125')](_0x7869f8)+(_0x7869f8===_0xde8c('0x110')?_0xde8c('0x126'):_0xde8c('0x127'));var _0x1efa8f={'attributes':['id',_0xde8c('0x128'),_0xde8c('0x129'),_0xde8c('0x122'),_0xde8c('0x12a'),_0xde8c('0x12b'),_0xde8c('0x12c'),_0xde8c('0x12d'),'UserId',_0x5a5c27+'Id'],'where':{'ContactId':_0xe59895[_0xde8c('0x92')]['id']},'include':[{'model':db[_0x5a5c27],'as':_0xde8c('0x127'),'attributes':['id','name',_0xde8c('0x12e')]},{'model':db[_0xde8c('0x7d')],'as':'Owner','attributes':['id',_0xde8c('0x28'),_0xde8c('0x123')]},{'model':db[_0xde8c('0x53')],'as':_0xde8c('0x8f'),'attributes':['id',_0xde8c('0x28'),_0xde8c('0x42')],'through':{'attributes':[]}}],'order':[['createdAt',_0xde8c('0x77')]]};if(_0xe59895['query'][_0xde8c('0x11a')]){_0x1efa8f[_0xde8c('0x3e')]['createdAt']={'$gte':_0x5d4979[_0xde8c('0x44')],'$lte':_0x5d4979['to']};}switch(_0x7869f8){case'chat':_0x1efa8f[_0xde8c('0x39')][_0xde8c('0x31')](_0xde8c('0x12f'),'customerIp',_0xde8c('0x130'),_0xde8c('0x131'),_0xde8c('0x132'),_0xde8c('0x133'),_0xde8c('0x134'),_0xde8c('0x135'),_0xde8c('0x136'));break;case _0xde8c('0x137'):_0x1efa8f[_0xde8c('0x39')][_0xde8c('0x31')](_0xde8c('0x138'),_0xde8c('0x139'));break;case _0xde8c('0x13a'):_0x1efa8f[_0xde8c('0x39')][_0xde8c('0x31')](_0xde8c('0x13b'),_0xde8c('0x13c'));break;}return db[_[_0xde8c('0x125')](_0x7869f8)+_0xde8c('0x13d')][_0xde8c('0x124')](_0x1efa8f)[_0xde8c('0x24')](function(_0x5db52c){_0x5d4df5[_0xde8c('0x1e')]+=_0x5db52c['count'];return _[_0xde8c('0x60')](_0x5db52c['rows'],function(_0x23a01c){var _0x2de8f5=_0x23a01c[_0xde8c('0x9b')]({'plain':!![]});_0x2de8f5['channel']=_0x7869f8;if(_0x2de8f5[_0xde8c('0x13e')]){_0x2de8f5[_0xde8c('0x13e')]={'id':_0x2de8f5['Owner']['id'],'name':_0x2de8f5[_0xde8c('0x13e')]['name'],'fullname':_0x2de8f5[_0xde8c('0x13e')][_0xde8c('0x123')]};}return _0x2de8f5;});});}});return Promise['all'](_0x10de9d);})[_0xde8c('0x24')](function(_0x1a50d1){return _(_0x1a50d1)[_0xde8c('0x13f')]()['sortBy']('createdAt')[_0xde8c('0x140')]()[_0xde8c('0x54')]();})[_0xde8c('0x24')](function(_0x44b207){_0x5d4df5[_0xde8c('0x90')]=_0x531086[_0xde8c('0x1d')]?_0x44b207['slice'](_0x531086[_0xde8c('0x1f')],_0x531086[_0xde8c('0x1f')]+_0x531086[_0xde8c('0x1d')]):_0x44b207;return _0x5d4df5;})[_0xde8c('0x24')](respondWithFilteredResult(_0x3d5c0a,_0x531086))['catch'](handleError(_0x3d5c0a,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 16d45c9..baf0818 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 _0x4b96=['save','emit','hook','exports','events','CmContact','setMaxListeners'];(function(_0x1a2411,_0x2b1a04){var _0x2f5872=function(_0x25d8aa){while(--_0x25d8aa){_0x1a2411['push'](_0x1a2411['shift']());}};_0x2f5872(++_0x2b1a04);}(_0x4b96,0xa5));var _0x64b9=function(_0x334adf,_0x2325f3){_0x334adf=_0x334adf-0x0;var _0x3d6c9e=_0x4b96[_0x334adf];return _0x3d6c9e;};'use strict';var EventEmitter=require(_0x64b9('0x0'));var CmContact=require('../../mysqldb')['db'][_0x64b9('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x64b9('0x2')](0x0);var events={'afterCreate':_0x64b9('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x45aa0b){return function(_0x2e0e86,_0x2d3f44,_0x2c3114){CmContactEvents[_0x64b9('0x4')](_0x45aa0b+':'+_0x2e0e86['id'],_0x2e0e86);CmContactEvents[_0x64b9('0x4')](_0x45aa0b,_0x2e0e86);_0x2c3114(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact[_0x64b9('0x5')](e,emitEvent(event));}}module[_0x64b9('0x6')]=CmContactEvents; \ No newline at end of file +var _0x09eb=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x09eb,0x1d9));var _0xb09e=function(_0x37fcda,_0x2f5aa1){_0x37fcda=_0x37fcda-0x0;var _0xf5ed91=_0x09eb[_0x37fcda];return _0xf5ed91;};'use strict';var EventEmitter=require(_0xb09e('0x0'));var CmContact=require(_0xb09e('0x1'))['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents[_0xb09e('0x2')](0x0);var events={'afterCreate':_0xb09e('0x3'),'afterUpdate':_0xb09e('0x4'),'afterDestroy':_0xb09e('0x5')};function emitEvent(_0x5ddced){return function(_0xe5eaf5,_0x2b9a1f,_0x1b8ad4){CmContactEvents[_0xb09e('0x6')](_0x5ddced+':'+_0xe5eaf5['id'],_0xe5eaf5);CmContactEvents[_0xb09e('0x6')](_0x5ddced,_0xe5eaf5);_0x1b8ad4(null);};}for(var e in events){if(events[_0xb09e('0x7')](e)){var event=events[e];CmContact[_0xb09e('0x8')](e,emitEvent(event));}}module[_0xb09e('0x9')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index 0d5eabe..209234d 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 _0xa8c7=['\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','afterCreate','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','VoiceQueue','outbound','CmList','Lists','length','get','dialCheckDuplicateType','always','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','message','Campaign','findAll','onlyIfOpen','List\x20not\x20found','isEmpty','destroy','ContactId','push','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','util','api','moment','request-promise','rimraf','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','lastName','mobile','fax','email','FULLTEXT','utf8mb4_unicode_ci','models','error','cmContact','inspect','CmHopper','findOne','then','cmContact,\x20afterCreate\x20','create','ListId','priority','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','callbackUniqueid','catch','isNil'];(function(_0x55b5e4,_0x3a5c4a){var _0x25257e=function(_0x37a6b8){while(--_0x37a6b8){_0x55b5e4['push'](_0x55b5e4['shift']());}};_0x25257e(++_0x3a5c4a);}(_0xa8c7,0x1a3));var _0x7a8c=function(_0x970aec,_0x1815c1){_0x970aec=_0x970aec-0x0;var _0x48cffa=_0xa8c7[_0x970aec];return _0x48cffa;};'use strict';var _=require('lodash');var util=require(_0x7a8c('0x0'));var logger=require('../../config/logger')(_0x7a8c('0x1'));var moment=require(_0x7a8c('0x2'));var BPromise=require('bluebird');var rp=require(_0x7a8c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7a8c('0x4'));var config=require('../../config/environment');var attributes=require(_0x7a8c('0x5'));module[_0x7a8c('0x6')]=function(_0x661ee7,_0x2296cd){return _0x661ee7[_0x7a8c('0x7')](_0x7a8c('0x8'),attributes,{'tableName':_0x7a8c('0x9'),'paranoid':!![],'indexes':[{'name':_0x7a8c('0xa'),'fields':['phone']},{'name':_0x7a8c('0xb'),'fields':[_0x7a8c('0xc'),_0x7a8c('0xd'),_0x7a8c('0xa'),_0x7a8c('0xe'),_0x7a8c('0xf'),_0x7a8c('0x10')],'type':_0x7a8c('0x11')}],'timestamps':!![],'charset':'utf8mb4','collate':_0x7a8c('0x12'),'hooks':{'afterCreate':function(_0x3a10d1,_0x5c7e58,_0x313717){var _0x5a760d=_0x661ee7[_0x7a8c('0x13')];var _0x27220d=_0x3a10d1['get']({'plain':!![]});function _0x1d5961(){return function(_0x17c012){logger[_0x7a8c('0x14')](_0x7a8c('0x15'),'afterCreate',util[_0x7a8c('0x16')](_0x17c012,{'showHidden':![],'depth':null}));};}var _0x413e78=function(_0x4f5e65){return new BPromise(function(_0x5d379b,_0x575d45){_0x5a760d[_0x7a8c('0x17')][_0x7a8c('0x18')]({'where':{'phone':_0x27220d[_0x7a8c('0xa')],'VoiceQueueId':_0x4f5e65['id']}})[_0x7a8c('0x19')](function(_0x5d240e){if(!_['isNil'](_0x5d240e)){throw new Error(_0x7a8c('0x1a')+_0x27220d[_0x7a8c('0xa')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x4f5e65['id']);}return _0x5a760d[_0x7a8c('0x17')][_0x7a8c('0x1b')]({'phone':_0x27220d[_0x7a8c('0xa')],'ContactId':_0x27220d['id'],'ListId':_0x27220d[_0x7a8c('0x1c')],'priority':_0x27220d[_0x7a8c('0x1d')]?_0x27220d[_0x7a8c('0x1d')]:0x2,'scheduledat':_0x27220d[_0x7a8c('0x1e')]?_0x27220d[_0x7a8c('0x1e')]:moment()[_0x7a8c('0x1f')](_0x7a8c('0x20')),'callback':_0x27220d[_0x7a8c('0x21')]?!![]:![],'callbackuniqueid':_0x27220d[_0x7a8c('0x21')]?_0x27220d[_0x7a8c('0x21')]:undefined,'callbackat':_0x27220d[_0x7a8c('0x21')]?moment()[_0x7a8c('0x1f')](_0x7a8c('0x20')):undefined,'VoiceQueueId':_0x4f5e65['id']});})[_0x7a8c('0x22')](function(_0x3f2338){_0x575d45(_0x3f2338);});});};var _0x50a881=function(_0x1153a0){return new BPromise(function(_0x5080c4,_0x153031){_0x5a760d[_0x7a8c('0x17')][_0x7a8c('0x18')]({'where':{'phone':_0x27220d[_0x7a8c('0xa')],'VoiceQueueId':_0x1153a0['id']}})[_0x7a8c('0x19')](function(_0x932beb){if(!_[_0x7a8c('0x23')](_0x932beb)){throw new Error('cmContact,\x20afterCreate\x20'+_0x27220d['phone']+_0x7a8c('0x24')+_0x1153a0['id']);}return _0x5a760d[_0x7a8c('0x25')][_0x7a8c('0x18')]({'where':{'calleridnum':_0x27220d[_0x7a8c('0xa')],'VoiceQueueId':_0x1153a0['id']}});})[_0x7a8c('0x19')](function(_0x1ac7b2){if(!_['isNil'](_0x1ac7b2)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x27220d[_0x7a8c('0xa')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x1153a0['id']);}return _0x5a760d[_0x7a8c('0x17')][_0x7a8c('0x1b')]({'phone':_0x27220d[_0x7a8c('0xa')],'ContactId':_0x27220d['id'],'ListId':_0x27220d[_0x7a8c('0x1c')],'priority':_0x27220d[_0x7a8c('0x1d')]?_0x27220d[_0x7a8c('0x1d')]:0x2,'scheduledat':_0x27220d[_0x7a8c('0x1e')]?_0x27220d[_0x7a8c('0x1e')]:moment()[_0x7a8c('0x1f')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x27220d[_0x7a8c('0x21')]?!![]:![],'callbackuniqueid':_0x27220d[_0x7a8c('0x21')]?_0x27220d[_0x7a8c('0x21')]:undefined,'callbackat':_0x27220d[_0x7a8c('0x21')]?moment()[_0x7a8c('0x1f')](_0x7a8c('0x20')):undefined,'VoiceQueueId':_0x1153a0['id']});})[_0x7a8c('0x22')](function(_0x18843e){_0x153031(_0x18843e);});});};function _0x2c6f95(){return function(_0x38e41c){logger[_0x7a8c('0x14')](_0x7a8c('0x15'),_0x7a8c('0x26'),util[_0x7a8c('0x16')](_0x38e41c,{'showHidden':![],'depth':null}));};}var _0x34c69c=function(_0x3565a4){return new BPromise(function(_0x472351,_0x5b5c87){_0x5a760d['CmHopper'][_0x7a8c('0x18')]({'where':{'phone':_0x27220d['phone'],'CampaignId':_0x3565a4['id']}})[_0x7a8c('0x19')](function(_0x128948){if(!_[_0x7a8c('0x23')](_0x128948)){throw new Error(_0x7a8c('0x1a')+_0x27220d[_0x7a8c('0xa')]+_0x7a8c('0x27')+_0x3565a4['id']);}return _0x5a760d[_0x7a8c('0x17')][_0x7a8c('0x1b')]({'phone':_0x27220d[_0x7a8c('0xa')],'ContactId':_0x27220d['id'],'ListId':_0x27220d[_0x7a8c('0x1c')],'priority':_0x27220d['priority']?_0x27220d[_0x7a8c('0x1d')]:0x2,'scheduledat':_0x27220d[_0x7a8c('0x1e')]?_0x27220d['scheduledat']:moment()[_0x7a8c('0x1f')](_0x7a8c('0x20')),'callback':_0x27220d['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x27220d[_0x7a8c('0x21')]?_0x27220d[_0x7a8c('0x21')]:undefined,'callbackat':_0x27220d['callbackUniqueid']?moment()[_0x7a8c('0x1f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x3565a4['id']});})[_0x7a8c('0x22')](function(_0x51f512){_0x5b5c87(_0x51f512);});});};var _0x15ebbe=function(_0x428cee){return new BPromise(function(_0x22716a,_0xb289fc){_0x5a760d[_0x7a8c('0x17')][_0x7a8c('0x18')]({'where':{'phone':_0x27220d[_0x7a8c('0xa')],'CampaignId':_0x428cee['id']}})[_0x7a8c('0x19')](function(_0x1f6e2e){if(!_[_0x7a8c('0x23')](_0x1f6e2e)){throw new Error(_0x7a8c('0x1a')+_0x27220d[_0x7a8c('0xa')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x428cee['id']);}return _0x5a760d[_0x7a8c('0x25')][_0x7a8c('0x18')]({'where':{'calleridnum':_0x27220d[_0x7a8c('0xa')],'CampaignId':_0x428cee['id']}});})[_0x7a8c('0x19')](function(_0x5ee6be){if(!_['isNil'](_0x5ee6be)){throw new Error(_0x7a8c('0x28')+_0x27220d[_0x7a8c('0xa')]+_0x7a8c('0x29')+_0x428cee['id']);}return _0x5a760d[_0x7a8c('0x17')][_0x7a8c('0x1b')]({'phone':_0x27220d['phone'],'ContactId':_0x27220d['id'],'ListId':_0x27220d[_0x7a8c('0x1c')],'priority':_0x27220d['priority']?_0x27220d[_0x7a8c('0x1d')]:0x2,'scheduledat':_0x27220d[_0x7a8c('0x1e')]?_0x27220d['scheduledat']:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x27220d[_0x7a8c('0x21')]?!![]:![],'callbackuniqueid':_0x27220d[_0x7a8c('0x21')]?_0x27220d[_0x7a8c('0x21')]:undefined,'callbackat':_0x27220d[_0x7a8c('0x21')]?moment()['format'](_0x7a8c('0x20')):undefined,'CampaignId':_0x428cee['id']});})[_0x7a8c('0x22')](function(_0x21674c){_0xb289fc(_0x21674c);});});};if(_0x27220d[_0x7a8c('0x1c')]){_0x5a760d[_0x7a8c('0x2a')]['findAll']({'where':{'type':_0x7a8c('0x2b')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':_0x5a760d[_0x7a8c('0x2c')],'as':_0x7a8c('0x2d'),'where':{'id':_0x27220d[_0x7a8c('0x1c')]}}]})[_0x7a8c('0x19')](function(_0x247fa1){if(_0x247fa1){var _0xfd5571=[];for(var _0x13e390=0x0,_0x1830a5;_0x13e390<_0x247fa1[_0x7a8c('0x2e')];_0x13e390+=0x1){_0x1830a5=_0x247fa1[_0x13e390][_0x7a8c('0x2f')]({'plain':!![]});switch(_0x1830a5[_0x7a8c('0x30')]){case _0x7a8c('0x31'):_0x50a881(_0x1830a5)[_0x7a8c('0x22')](_0x1d5961());break;case'onlyIfOpen':_0x413e78(_0x1830a5)[_0x7a8c('0x22')](_0x1d5961());break;default:_0x5a760d[_0x7a8c('0x17')][_0x7a8c('0x1b')]({'phone':_0x27220d[_0x7a8c('0xa')],'ContactId':_0x27220d['id'],'ListId':_0x27220d[_0x7a8c('0x1c')],'scheduledat':_0x27220d['scheduledat']?_0x27220d[_0x7a8c('0x1e')]:moment()[_0x7a8c('0x1f')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x27220d[_0x7a8c('0x1d')]?_0x27220d[_0x7a8c('0x1d')]:0x2,'callback':_0x27220d[_0x7a8c('0x21')]?!![]:![],'callbackuniqueid':_0x27220d[_0x7a8c('0x21')]?_0x27220d[_0x7a8c('0x21')]:undefined,'callbackat':_0x27220d[_0x7a8c('0x21')]?moment()[_0x7a8c('0x1f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x1830a5['id']})[_0x7a8c('0x22')](_0x1d5961());}}}})['then'](function(){return _0x5a760d[_0x7a8c('0x2a')]['findAll']({'where':{'type':_0x7a8c('0x2b')},'attributes':['id'],'include':[{'model':_0x5a760d[_0x7a8c('0x2c')],'as':_0x7a8c('0x32'),'where':{'id':_0x27220d[_0x7a8c('0x1c')]}}]})[_0x7a8c('0x19')](function(_0x1dca93){if(_0x1dca93){var _0x511f2b=[];for(var _0x57518d=0x0,_0x1c34c6;_0x57518d<_0x1dca93[_0x7a8c('0x2e')];_0x57518d+=0x1){_0x1c34c6=_0x1dca93[_0x57518d]['get']({'plain':!![]});_0x5a760d[_0x7a8c('0x33')][_0x7a8c('0x1b')]({'phone':_0x27220d[_0x7a8c('0xa')],'ContactId':_0x27220d['id'],'ListId':_0x27220d[_0x7a8c('0x1c')],'VoiceQueueId':_0x1c34c6['id']})[_0x7a8c('0x22')](function(_0xa68b38){logger['error'](_0x7a8c('0x34'),_0x7a8c('0x26'),_0xa68b38[_0x7a8c('0x35')]);});}}});})['then'](function(){return _0x5a760d[_0x7a8c('0x36')][_0x7a8c('0x37')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':_0x5a760d[_0x7a8c('0x2c')],'as':_0x7a8c('0x2d'),'where':{'id':_0x27220d['ListId']}}]})[_0x7a8c('0x19')](function(_0x1a319c){if(_0x1a319c){var _0x5c0edd=[];for(var _0x113973=0x0,_0x4a9ad9;_0x113973<_0x1a319c['length'];_0x113973+=0x1){_0x4a9ad9=_0x1a319c[_0x113973][_0x7a8c('0x2f')]({'plain':!![]});switch(_0x4a9ad9['dialCheckDuplicateType']){case _0x7a8c('0x31'):_0x15ebbe(_0x4a9ad9)[_0x7a8c('0x22')](_0x2c6f95());break;case _0x7a8c('0x38'):_0x34c69c(_0x4a9ad9)['catch'](_0x2c6f95());break;default:_0x5a760d['CmHopper'][_0x7a8c('0x1b')]({'phone':_0x27220d[_0x7a8c('0xa')],'ContactId':_0x27220d['id'],'ListId':_0x27220d[_0x7a8c('0x1c')],'scheduledat':_0x27220d[_0x7a8c('0x1e')]?_0x27220d[_0x7a8c('0x1e')]:moment()['format'](_0x7a8c('0x20')),'priority':_0x27220d[_0x7a8c('0x1d')]?_0x27220d[_0x7a8c('0x1d')]:0x2,'callback':_0x27220d[_0x7a8c('0x21')]?!![]:![],'callbackuniqueid':_0x27220d['callbackUniqueid']?_0x27220d['callbackUniqueid']:undefined,'callbackat':_0x27220d[_0x7a8c('0x21')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x4a9ad9['id']})[_0x7a8c('0x22')](_0x2c6f95());}}}});})[_0x7a8c('0x19')](function(){return _0x5a760d[_0x7a8c('0x36')][_0x7a8c('0x37')]({'attributes':['id'],'include':[{'model':_0x5a760d[_0x7a8c('0x2c')],'as':_0x7a8c('0x32'),'where':{'id':_0x27220d[_0x7a8c('0x1c')]}}]})[_0x7a8c('0x19')](function(_0x17d701){if(_0x17d701){var _0x27b881=[];for(var _0x390bcf=0x0,_0x57217a;_0x390bcf<_0x17d701['length'];_0x390bcf+=0x1){_0x57217a=_0x17d701[_0x390bcf][_0x7a8c('0x2f')]({'plain':!![]});_0x5a760d[_0x7a8c('0x33')][_0x7a8c('0x1b')]({'phone':_0x27220d[_0x7a8c('0xa')],'ContactId':_0x27220d['id'],'ListId':_0x27220d[_0x7a8c('0x1c')],'CampaignId':_0x57217a['id']})[_0x7a8c('0x22')](function(_0x2d5fbc){logger['error']('cmContact,\x20%s,\x20%s',_0x7a8c('0x26'),_0x2d5fbc[_0x7a8c('0x35')]);});}}});})[_0x7a8c('0x19')](function(){_0x313717();})[_0x7a8c('0x22')](function(_0x2c6094){logger[_0x7a8c('0x14')](_0x7a8c('0x34'),'afterCreate',_0x2c6094[_0x7a8c('0x35')]);_0x313717(_0x2c6094);});}else{_0x313717(new Error(_0x7a8c('0x39')));}},'afterDestroy':function(_0xf08afc,_0x3809a6,_0x200672){var _0x2aaf31=_0x661ee7['models'];var _0x52df1d=_0xf08afc[_0x7a8c('0x2f')]({'plain':!![]});return _0x2aaf31[_0x7a8c('0x17')][_0x7a8c('0x37')]({'raw':!![],'where':{'ListId':_0x52df1d[_0x7a8c('0x1c')],'ContactId':_0x52df1d['id']}})[_0x7a8c('0x19')](function(_0x3c3f02){if(!_[_0x7a8c('0x3a')](_0x3c3f02)){var _0x30007f=[];for(var _0x1b8d1d=0x0;_0x1b8d1d<_0x3c3f02[_0x7a8c('0x2e')];_0x1b8d1d+=0x1){var _0x14295f=_0x2aaf31[_0x7a8c('0x17')][_0x7a8c('0x3b')]({'where':{'ListId':_0x3c3f02[_0x1b8d1d][_0x7a8c('0x1c')],'ContactId':_0x3c3f02[_0x1b8d1d][_0x7a8c('0x3c')],'VoiceQueueId':_0x3c3f02[_0x1b8d1d]['VoiceQueueId'],'CampaignId':_0x3c3f02[_0x1b8d1d]['CampaignId']}});_0x30007f[_0x7a8c('0x3d')](_0x14295f);}return BPromise['all'](_0x30007f);}})[_0x7a8c('0x19')](function(_0x402d50){logger[_0x7a8c('0x3e')](_0x7a8c('0x3f'),util['inspect'](_0x402d50,{'showHidden':![],'depth':null}));_0x200672();})[_0x7a8c('0x22')](function(_0x5a81fe){logger[_0x7a8c('0x14')](_0x7a8c('0x40'),util[_0x7a8c('0x16')](_0x5a81fe,{'showHidden':![],'depth':null}));_0x200672(_0x5a81fe);});}}});}; \ No newline at end of file +var _0x6df7=['utf8mb4_unicode_ci','models','get','error','cmContact','afterCreate','inspect','CmHopper','findOne','isNil','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','callbackUniqueid','catch','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','then','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','CmHopperFinal','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','length','always','onlyIfOpen','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','message','Campaign','List\x20not\x20found','isEmpty','destroy','ContactId','CampaignId','all','info','[CmContact][afterDestroy][Error]','lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./cmContact.attributes','define','cm_contacts','phone','fti_cm_contacts','firstName','fax','FULLTEXT','utf8mb4'];(function(_0x167914,_0x87b5a){var _0x5e5d79=function(_0x221d4e){while(--_0x221d4e){_0x167914['push'](_0x167914['shift']());}};_0x5e5d79(++_0x87b5a);}(_0x6df7,0x72));var _0x76df=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x6df7[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x76df('0x0'));var util=require('util');var logger=require(_0x76df('0x1'))(_0x76df('0x2'));var moment=require('moment');var BPromise=require(_0x76df('0x3'));var rp=require(_0x76df('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x76df('0x5'));var config=require(_0x76df('0x6'));var attributes=require(_0x76df('0x7'));module['exports']=function(_0x247223,_0x4750a0){return _0x247223[_0x76df('0x8')]('CmContact',attributes,{'tableName':_0x76df('0x9'),'paranoid':!![],'indexes':[{'name':_0x76df('0xa'),'fields':[_0x76df('0xa')]},{'name':_0x76df('0xb'),'fields':[_0x76df('0xc'),'lastName',_0x76df('0xa'),'mobile',_0x76df('0xd'),'email'],'type':_0x76df('0xe')}],'timestamps':!![],'charset':_0x76df('0xf'),'collate':_0x76df('0x10'),'hooks':{'afterCreate':function(_0xb1a519,_0x3e989f,_0x41c402){var _0x1ee92c=_0x247223[_0x76df('0x11')];var _0x12efd9=_0xb1a519[_0x76df('0x12')]({'plain':!![]});function _0x7e1865(){return function(_0x18752c){logger[_0x76df('0x13')](_0x76df('0x14'),_0x76df('0x15'),util[_0x76df('0x16')](_0x18752c,{'showHidden':![],'depth':null}));};}var _0x46f981=function(_0x408b18){return new BPromise(function(_0x296f53,_0x3a906b){_0x1ee92c[_0x76df('0x17')][_0x76df('0x18')]({'where':{'phone':_0x12efd9['phone'],'VoiceQueueId':_0x408b18['id']}})['then'](function(_0x26ae44){if(!_[_0x76df('0x19')](_0x26ae44)){throw new Error('cmContact,\x20afterCreate\x20'+_0x12efd9[_0x76df('0xa')]+_0x76df('0x1a')+_0x408b18['id']);}return _0x1ee92c[_0x76df('0x17')][_0x76df('0x1b')]({'phone':_0x12efd9[_0x76df('0xa')],'ContactId':_0x12efd9['id'],'ListId':_0x12efd9[_0x76df('0x1c')],'priority':_0x12efd9[_0x76df('0x1d')]?_0x12efd9['priority']:0x2,'scheduledat':_0x12efd9[_0x76df('0x1e')]?_0x12efd9[_0x76df('0x1e')]:moment()[_0x76df('0x1f')](_0x76df('0x20')),'callback':_0x12efd9['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x12efd9[_0x76df('0x21')]?_0x12efd9['callbackUniqueid']:undefined,'callbackat':_0x12efd9[_0x76df('0x21')]?moment()['format'](_0x76df('0x20')):undefined,'VoiceQueueId':_0x408b18['id']});})[_0x76df('0x22')](function(_0x4787fd){_0x3a906b(_0x4787fd);});});};var _0x469d98=function(_0x1de576){return new BPromise(function(_0x142803,_0x15a2a8){_0x1ee92c[_0x76df('0x17')][_0x76df('0x18')]({'where':{'phone':_0x12efd9[_0x76df('0xa')],'VoiceQueueId':_0x1de576['id']}})['then'](function(_0x2094a9){if(!_[_0x76df('0x19')](_0x2094a9)){throw new Error(_0x76df('0x23')+_0x12efd9[_0x76df('0xa')]+_0x76df('0x24')+_0x1de576['id']);}return _0x1ee92c['CmHopperFinal'][_0x76df('0x18')]({'where':{'calleridnum':_0x12efd9[_0x76df('0xa')],'VoiceQueueId':_0x1de576['id']}});})['then'](function(_0x15f636){if(!_['isNil'](_0x15f636)){throw new Error(_0x76df('0x25')+_0x12efd9[_0x76df('0xa')]+_0x76df('0x26')+_0x1de576['id']);}return _0x1ee92c['CmHopper']['create']({'phone':_0x12efd9[_0x76df('0xa')],'ContactId':_0x12efd9['id'],'ListId':_0x12efd9[_0x76df('0x1c')],'priority':_0x12efd9[_0x76df('0x1d')]?_0x12efd9[_0x76df('0x1d')]:0x2,'scheduledat':_0x12efd9[_0x76df('0x1e')]?_0x12efd9[_0x76df('0x1e')]:moment()[_0x76df('0x1f')](_0x76df('0x20')),'callback':_0x12efd9[_0x76df('0x21')]?!![]:![],'callbackuniqueid':_0x12efd9['callbackUniqueid']?_0x12efd9[_0x76df('0x21')]:undefined,'callbackat':_0x12efd9[_0x76df('0x21')]?moment()[_0x76df('0x1f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x1de576['id']});})[_0x76df('0x22')](function(_0x4fa767){_0x15a2a8(_0x4fa767);});});};function _0x1fe3e0(){return function(_0x105c78){logger[_0x76df('0x13')](_0x76df('0x14'),_0x76df('0x15'),util[_0x76df('0x16')](_0x105c78,{'showHidden':![],'depth':null}));};}var _0xd511b4=function(_0x4c5732){return new BPromise(function(_0x19045c,_0x1fb909){_0x1ee92c[_0x76df('0x17')]['findOne']({'where':{'phone':_0x12efd9[_0x76df('0xa')],'CampaignId':_0x4c5732['id']}})[_0x76df('0x27')](function(_0x2e69e1){if(!_[_0x76df('0x19')](_0x2e69e1)){throw new Error(_0x76df('0x23')+_0x12efd9['phone']+_0x76df('0x28')+_0x4c5732['id']);}return _0x1ee92c[_0x76df('0x17')][_0x76df('0x1b')]({'phone':_0x12efd9[_0x76df('0xa')],'ContactId':_0x12efd9['id'],'ListId':_0x12efd9['ListId'],'priority':_0x12efd9[_0x76df('0x1d')]?_0x12efd9['priority']:0x2,'scheduledat':_0x12efd9['scheduledat']?_0x12efd9[_0x76df('0x1e')]:moment()['format'](_0x76df('0x20')),'callback':_0x12efd9['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x12efd9[_0x76df('0x21')]?_0x12efd9[_0x76df('0x21')]:undefined,'callbackat':_0x12efd9[_0x76df('0x21')]?moment()['format'](_0x76df('0x20')):undefined,'CampaignId':_0x4c5732['id']});})['catch'](function(_0x44bb1e){_0x1fb909(_0x44bb1e);});});};var _0x29a14e=function(_0x109175){return new BPromise(function(_0x1d90f3,_0x3f4f55){_0x1ee92c[_0x76df('0x17')][_0x76df('0x18')]({'where':{'phone':_0x12efd9[_0x76df('0xa')],'CampaignId':_0x109175['id']}})[_0x76df('0x27')](function(_0x1fbbec){if(!_['isNil'](_0x1fbbec)){throw new Error(_0x76df('0x23')+_0x12efd9[_0x76df('0xa')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x109175['id']);}return _0x1ee92c[_0x76df('0x29')][_0x76df('0x18')]({'where':{'calleridnum':_0x12efd9[_0x76df('0xa')],'CampaignId':_0x109175['id']}});})[_0x76df('0x27')](function(_0xe3bdc6){if(!_[_0x76df('0x19')](_0xe3bdc6)){throw new Error(_0x76df('0x25')+_0x12efd9[_0x76df('0xa')]+_0x76df('0x2a')+_0x109175['id']);}return _0x1ee92c[_0x76df('0x17')][_0x76df('0x1b')]({'phone':_0x12efd9[_0x76df('0xa')],'ContactId':_0x12efd9['id'],'ListId':_0x12efd9[_0x76df('0x1c')],'priority':_0x12efd9[_0x76df('0x1d')]?_0x12efd9[_0x76df('0x1d')]:0x2,'scheduledat':_0x12efd9[_0x76df('0x1e')]?_0x12efd9['scheduledat']:moment()[_0x76df('0x1f')](_0x76df('0x20')),'callback':_0x12efd9['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x12efd9['callbackUniqueid']?_0x12efd9[_0x76df('0x21')]:undefined,'callbackat':_0x12efd9[_0x76df('0x21')]?moment()['format'](_0x76df('0x20')):undefined,'CampaignId':_0x109175['id']});})['catch'](function(_0x1e43d4){_0x3f4f55(_0x1e43d4);});});};if(_0x12efd9[_0x76df('0x1c')]){_0x1ee92c[_0x76df('0x2b')][_0x76df('0x2c')]({'where':{'type':_0x76df('0x2d')},'attributes':['id',_0x76df('0x2e')],'include':[{'model':_0x1ee92c[_0x76df('0x2f')],'as':_0x76df('0x30'),'where':{'id':_0x12efd9[_0x76df('0x1c')]}}]})[_0x76df('0x27')](function(_0x45a86e){if(_0x45a86e){var _0x28ca4a=[];for(var _0x30f90b=0x0,_0x3ab769;_0x30f90b<_0x45a86e[_0x76df('0x31')];_0x30f90b+=0x1){_0x3ab769=_0x45a86e[_0x30f90b][_0x76df('0x12')]({'plain':!![]});switch(_0x3ab769[_0x76df('0x2e')]){case _0x76df('0x32'):_0x469d98(_0x3ab769)[_0x76df('0x22')](_0x7e1865());break;case _0x76df('0x33'):_0x46f981(_0x3ab769)[_0x76df('0x22')](_0x7e1865());break;default:_0x1ee92c[_0x76df('0x17')][_0x76df('0x1b')]({'phone':_0x12efd9['phone'],'ContactId':_0x12efd9['id'],'ListId':_0x12efd9[_0x76df('0x1c')],'scheduledat':_0x12efd9[_0x76df('0x1e')]?_0x12efd9[_0x76df('0x1e')]:moment()[_0x76df('0x1f')](_0x76df('0x20')),'priority':_0x12efd9[_0x76df('0x1d')]?_0x12efd9['priority']:0x2,'callback':_0x12efd9[_0x76df('0x21')]?!![]:![],'callbackuniqueid':_0x12efd9[_0x76df('0x21')]?_0x12efd9[_0x76df('0x21')]:undefined,'callbackat':_0x12efd9[_0x76df('0x21')]?moment()[_0x76df('0x1f')](_0x76df('0x20')):undefined,'VoiceQueueId':_0x3ab769['id']})['catch'](_0x7e1865());}}}})[_0x76df('0x27')](function(){return _0x1ee92c[_0x76df('0x2b')][_0x76df('0x2c')]({'where':{'type':_0x76df('0x2d')},'attributes':['id'],'include':[{'model':_0x1ee92c[_0x76df('0x2f')],'as':_0x76df('0x34'),'where':{'id':_0x12efd9[_0x76df('0x1c')]}}]})[_0x76df('0x27')](function(_0x5784ed){if(_0x5784ed){var _0x3efcc6=[];for(var _0x21830c=0x0,_0x28b582;_0x21830c<_0x5784ed['length'];_0x21830c+=0x1){_0x28b582=_0x5784ed[_0x21830c][_0x76df('0x12')]({'plain':!![]});_0x1ee92c[_0x76df('0x35')][_0x76df('0x1b')]({'phone':_0x12efd9['phone'],'ContactId':_0x12efd9['id'],'ListId':_0x12efd9[_0x76df('0x1c')],'VoiceQueueId':_0x28b582['id']})['catch'](function(_0x4c084c){logger['error'](_0x76df('0x36'),_0x76df('0x15'),_0x4c084c[_0x76df('0x37')]);});}}});})['then'](function(){return _0x1ee92c['Campaign']['findAll']({'attributes':['id',_0x76df('0x2e')],'include':[{'model':_0x1ee92c[_0x76df('0x2f')],'as':_0x76df('0x30'),'where':{'id':_0x12efd9[_0x76df('0x1c')]}}]})['then'](function(_0x3b066d){if(_0x3b066d){var _0x36574b=[];for(var _0x2afd39=0x0,_0x255264;_0x2afd39<_0x3b066d[_0x76df('0x31')];_0x2afd39+=0x1){_0x255264=_0x3b066d[_0x2afd39][_0x76df('0x12')]({'plain':!![]});switch(_0x255264[_0x76df('0x2e')]){case _0x76df('0x32'):_0x29a14e(_0x255264)[_0x76df('0x22')](_0x1fe3e0());break;case'onlyIfOpen':_0xd511b4(_0x255264)[_0x76df('0x22')](_0x1fe3e0());break;default:_0x1ee92c['CmHopper'][_0x76df('0x1b')]({'phone':_0x12efd9[_0x76df('0xa')],'ContactId':_0x12efd9['id'],'ListId':_0x12efd9['ListId'],'scheduledat':_0x12efd9[_0x76df('0x1e')]?_0x12efd9[_0x76df('0x1e')]:moment()[_0x76df('0x1f')](_0x76df('0x20')),'priority':_0x12efd9[_0x76df('0x1d')]?_0x12efd9['priority']:0x2,'callback':_0x12efd9[_0x76df('0x21')]?!![]:![],'callbackuniqueid':_0x12efd9['callbackUniqueid']?_0x12efd9[_0x76df('0x21')]:undefined,'callbackat':_0x12efd9[_0x76df('0x21')]?moment()['format'](_0x76df('0x20')):undefined,'CampaignId':_0x255264['id']})[_0x76df('0x22')](_0x1fe3e0());}}}});})['then'](function(){return _0x1ee92c[_0x76df('0x38')][_0x76df('0x2c')]({'attributes':['id'],'include':[{'model':_0x1ee92c[_0x76df('0x2f')],'as':_0x76df('0x34'),'where':{'id':_0x12efd9[_0x76df('0x1c')]}}]})[_0x76df('0x27')](function(_0x1697a7){if(_0x1697a7){var _0x50d4ea=[];for(var _0x88f0d0=0x0,_0x3324b8;_0x88f0d0<_0x1697a7[_0x76df('0x31')];_0x88f0d0+=0x1){_0x3324b8=_0x1697a7[_0x88f0d0]['get']({'plain':!![]});_0x1ee92c['CmHopperBlack'][_0x76df('0x1b')]({'phone':_0x12efd9[_0x76df('0xa')],'ContactId':_0x12efd9['id'],'ListId':_0x12efd9[_0x76df('0x1c')],'CampaignId':_0x3324b8['id']})[_0x76df('0x22')](function(_0x298abb){logger[_0x76df('0x13')](_0x76df('0x36'),_0x76df('0x15'),_0x298abb[_0x76df('0x37')]);});}}});})[_0x76df('0x27')](function(){_0x41c402();})[_0x76df('0x22')](function(_0x3a1493){logger[_0x76df('0x13')]('cmContact,\x20%s,\x20%s',_0x76df('0x15'),_0x3a1493[_0x76df('0x37')]);_0x41c402(_0x3a1493);});}else{_0x41c402(new Error(_0x76df('0x39')));}},'afterDestroy':function(_0x5c5e73,_0x58a880,_0x3ae34e){var _0x3d2777=_0x247223[_0x76df('0x11')];var _0x41a6fd=_0x5c5e73[_0x76df('0x12')]({'plain':!![]});return _0x3d2777['CmHopper']['findAll']({'raw':!![],'where':{'ListId':_0x41a6fd[_0x76df('0x1c')],'ContactId':_0x41a6fd['id']}})[_0x76df('0x27')](function(_0x1fcb54){if(!_[_0x76df('0x3a')](_0x1fcb54)){var _0x8b26cd=[];for(var _0x59c072=0x0;_0x59c072<_0x1fcb54['length'];_0x59c072+=0x1){var _0xf81026=_0x3d2777[_0x76df('0x17')][_0x76df('0x3b')]({'where':{'ListId':_0x1fcb54[_0x59c072][_0x76df('0x1c')],'ContactId':_0x1fcb54[_0x59c072][_0x76df('0x3c')],'VoiceQueueId':_0x1fcb54[_0x59c072]['VoiceQueueId'],'CampaignId':_0x1fcb54[_0x59c072][_0x76df('0x3d')]}});_0x8b26cd['push'](_0xf81026);}return BPromise[_0x76df('0x3e')](_0x8b26cd);}})[_0x76df('0x27')](function(_0x70c94a){logger[_0x76df('0x3f')]('[CmContact][afterDestroy][Succesfull]',util[_0x76df('0x16')](_0x70c94a,{'showHidden':![],'depth':null}));_0x3ae34e();})[_0x76df('0x22')](function(_0x5565c5){logger[_0x76df('0x13')](_0x76df('0x40'),util['inspect'](_0x5565c5,{'showHidden':![],'depth':null}));_0x3ae34e(_0x5565c5);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index 5ce9626..2b1c5f0 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 _0x0f05=['model','GetCmContact','CreateCmContact','CmContact','create','body','keys','startsWith','cf_','update','table','id\x20=\x20?','toString','sequelize','lodash','moment','bluebird','randomstring','ioredis','squel','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./cmContact.socket','request','then','info','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','error','message','CmContact,\x20%s,\x20%s','result','catch','options','raw','where','attributes','include','map'];(function(_0x9de36,_0x9f4373){var _0x491088=function(_0x8395ba){while(--_0x8395ba){_0x9de36['push'](_0x9de36['shift']());}};_0x491088(++_0x9f4373);}(_0x0f05,0x18e));var _0x50f0=function(_0x5f319e,_0x518c2c){_0x5f319e=_0x5f319e-0x0;var _0xaaa963=_0x0f05[_0x5f319e];return _0xaaa963;};'use strict';var _=require(_0x50f0('0x0'));var util=require('util');var moment=require(_0x50f0('0x1'));var BPromise=require(_0x50f0('0x2'));var rs=require(_0x50f0('0x3'));var fs=require('fs');var Redis=require(_0x50f0('0x4'));var squel=require(_0x50f0('0x5'));var db=require(_0x50f0('0x6'))['db'];var utils=require(_0x50f0('0x7'));var logger=require('../../config/logger')(_0x50f0('0x8'));var config=require(_0x50f0('0x9'));var jayson=require(_0x50f0('0xa'));var client=jayson[_0x50f0('0xb')]['http']({'port':0x232a});config[_0x50f0('0xc')]=_['defaults'](config[_0x50f0('0xc')],{'host':_0x50f0('0xd'),'port':0x18eb});var socket=require(_0x50f0('0xe'))(new Redis(config['redis']));require(_0x50f0('0xf'))['register'](socket);function respondWithRpcPromise(_0x3a4756,_0xfba722,_0x537494){return new BPromise(function(_0x1a3ea9,_0x5a17fc){return client[_0x50f0('0x10')](_0x3a4756,_0x537494)[_0x50f0('0x11')](function(_0x5998e2){logger[_0x50f0('0x12')]('CmContact,\x20%s,\x20%s',_0xfba722,_0x50f0('0x13'));logger[_0x50f0('0x14')](_0x50f0('0x15'),_0xfba722,_0x50f0('0x13'),JSON[_0x50f0('0x16')](_0x5998e2));if(_0x5998e2[_0x50f0('0x17')]){if(_0x5998e2[_0x50f0('0x17')]['code']===0x1f4){logger[_0x50f0('0x17')]('CmContact,\x20%s,\x20%s',_0xfba722,_0x5998e2['error'][_0x50f0('0x18')]);return _0x5a17fc(_0x5998e2[_0x50f0('0x17')][_0x50f0('0x18')]);}logger['error']('CmContact,\x20%s,\x20%s',_0xfba722,_0x5998e2['error']['message']);return _0x1a3ea9(_0x5998e2[_0x50f0('0x17')][_0x50f0('0x18')]);}else{logger[_0x50f0('0x12')](_0x50f0('0x19'),_0xfba722,_0x50f0('0x13'));_0x1a3ea9(_0x5998e2[_0x50f0('0x1a')]['message']);}})[_0x50f0('0x1b')](function(_0x46bff5){logger[_0x50f0('0x17')](_0x50f0('0x19'),_0xfba722,_0x46bff5);_0x5a17fc(_0x46bff5);});});}exports['GetCmContact']=function(_0x11990b){var _0x19eab4=this;return new Promise(function(_0x207898,_0x40c6df){return db['CmContact']['findAll']({'raw':_0x11990b['options']?_0x11990b[_0x50f0('0x1c')][_0x50f0('0x1d')]===undefined?!![]:![]:!![],'where':_0x11990b[_0x50f0('0x1c')]?_0x11990b[_0x50f0('0x1c')][_0x50f0('0x1e')]||null:null,'attributes':_0x11990b[_0x50f0('0x1c')]?_0x11990b[_0x50f0('0x1c')][_0x50f0('0x1f')]||null:null,'limit':_0x11990b[_0x50f0('0x1c')]?_0x11990b[_0x50f0('0x1c')]['limit']||null:null,'include':_0x11990b[_0x50f0('0x1c')]?_0x11990b[_0x50f0('0x1c')][_0x50f0('0x20')]?_[_0x50f0('0x21')](_0x11990b[_0x50f0('0x1c')]['include'],function(_0x1172c7){return{'model':db[_0x1172c7[_0x50f0('0x22')]],'as':_0x1172c7['as'],'attributes':_0x1172c7['attributes'],'include':_0x1172c7['include']?_[_0x50f0('0x21')](_0x1172c7[_0x50f0('0x20')],function(_0x1ee073){return{'model':db[_0x1ee073['model']],'as':_0x1ee073['as'],'attributes':_0x1ee073['attributes'],'include':_0x1ee073[_0x50f0('0x20')]?_[_0x50f0('0x21')](_0x1ee073[_0x50f0('0x20')],function(_0x14cd9b){return{'model':db[_0x14cd9b[_0x50f0('0x22')]],'as':_0x14cd9b['as'],'attributes':_0x14cd9b['attributes']};}):[]};}):[]};}):[]:[]})[_0x50f0('0x11')](function(_0x5b8c56){logger[_0x50f0('0x12')]('GetCmContact',_0x11990b);logger[_0x50f0('0x14')]('GetCmContact',_0x11990b,JSON[_0x50f0('0x16')](_0x5b8c56));_0x207898(_0x5b8c56);})['catch'](function(_0x3d4d93){logger[_0x50f0('0x17')](_0x50f0('0x23'),_0x3d4d93[_0x50f0('0x18')],_0x11990b);_0x40c6df(_0x19eab4['error'](0x1f4,_0x3d4d93[_0x50f0('0x18')]));});});};exports[_0x50f0('0x24')]=function(_0x36a574){var _0x3df053=this;return new Promise(function(_0x1a1be6,_0x9d5d6c){return db[_0x50f0('0x25')][_0x50f0('0x26')](_0x36a574[_0x50f0('0x27')],{'raw':_0x36a574[_0x50f0('0x1c')]?_0x36a574['options'][_0x50f0('0x1d')]===undefined?!![]:![]:!![]})[_0x50f0('0x11')](function(_0x5e021e){var _0x39e4c3;for(var _0x413984=0x0;_0x413984{}\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(_0x4739f8,_0x3b8a62){var _0x35edbb=function(_0x5eb379){while(--_0x5eb379){_0x4739f8['push'](_0x4739f8['shift']());}};_0x35edbb(++_0x3b8a62);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'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 383ab4f..1c92b8e 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 _0x644a=['INTEGER','STRING','PHONE','sequelize','exports'];(function(_0x2a9197,_0x5225eb){var _0x588c8a=function(_0x4698ee){while(--_0x4698ee){_0x2a9197['push'](_0x2a9197['shift']());}};_0x588c8a(++_0x5225eb);}(_0x644a,0xfd));var _0xa644=function(_0x437ea9,_0x55c4cd){_0x437ea9=_0x437ea9-0x0;var _0x5c04b4=_0x644a[_0x437ea9];return _0x5c04b4;};'use strict';var Sequelize=require(_0xa644('0x0'));module[_0xa644('0x1')]={'CmContactId':{'type':Sequelize[_0xa644('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0xa644('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xa644('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':_0xa644('0x4')},'OrderBy':{'type':Sequelize[_0xa644('0x2')],'defaultValue':null},'description':{'type':Sequelize['STRING'],'defaultValue':null}}; \ No newline at end of file +var _0x946e=['INTEGER','STRING','sequelize'];(function(_0x6bb2ac,_0x541a71){var _0x5cd27a=function(_0xb3f201){while(--_0xb3f201){_0x6bb2ac['push'](_0x6bb2ac['shift']());}};_0x5cd27a(++_0x541a71);}(_0x946e,0x1d0));var _0xe946=function(_0x3f940e,_0x140c3b){_0x3f940e=_0x3f940e-0x0;var _0x424b2e=_0x946e[_0x3f940e];return _0x424b2e;};'use strict';var Sequelize=require(_0xe946('0x0'));module['exports']={'CmContactId':{'type':Sequelize[_0xe946('0x1')],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xe946('0x1')],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':'PHONE'},'OrderBy':{'type':Sequelize[_0xe946('0x1')],'defaultValue':null},'description':{'type':Sequelize[_0xe946('0x2')],'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 8909bec..f97d3f6 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 _0x99b9=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','set','apply','reject','save','update','then','get','CmContactHasItems','UserProfileResource','destroy','sendStatus','error','stack','name','send','CmContactHasItem','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','options','include','rows','catch','params','merge','find','create','user','role','UserProfileSection'];(function(_0x5842eb,_0x585f4c){var _0x3eca2d=function(_0x59a441){while(--_0x59a441){_0x5842eb['push'](_0x5842eb['shift']());}};_0x3eca2d(++_0x585f4c);}(_0x99b9,0x1ea));var _0x999b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x99b9[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x999b('0x0'));var zipdir=require(_0x999b('0x1'));var jsonpatch=require(_0x999b('0x2'));var rp=require('request-promise');var moment=require(_0x999b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x999b('0x4'));var util=require(_0x999b('0x5'));var path=require(_0x999b('0x6'));var sox=require('sox');var csv=require(_0x999b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x999b('0x8'));var _=require(_0x999b('0x9'));var squel=require(_0x999b('0xa'));var crypto=require(_0x999b('0xb'));var jsforce=require(_0x999b('0xc'));var deskjs=require(_0x999b('0xd'));var toCsv=require(_0x999b('0x7'));var querystring=require(_0x999b('0xe'));var Papa=require(_0x999b('0xf'));var Redis=require(_0x999b('0x10'));var authService=require(_0x999b('0x11'));var qs=require(_0x999b('0x12'));var as=require(_0x999b('0x13'));var hardwareService=require(_0x999b('0x14'));var logger=require(_0x999b('0x15'))('api');var utils=require(_0x999b('0x16'));var config=require(_0x999b('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x999b('0x18'))['db'];function respondWithStatusCode(_0x5d1732,_0x147c30){_0x147c30=_0x147c30||0xcc;return function(_0x3115dc){if(_0x3115dc){return _0x5d1732['sendStatus'](_0x147c30);}return _0x5d1732[_0x999b('0x19')](_0x147c30)[_0x999b('0x1a')]();};}function respondWithResult(_0x3a617d,_0x56d8b6){_0x56d8b6=_0x56d8b6||0xc8;return function(_0x407b4f){if(_0x407b4f){return _0x3a617d[_0x999b('0x19')](_0x56d8b6)[_0x999b('0x1b')](_0x407b4f);}};}function respondWithFilteredResult(_0x1a6eb8,_0x4fbbcd){return function(_0x1c9934){if(_0x1c9934){var _0x2e9a65=typeof _0x4fbbcd[_0x999b('0x1c')]===_0x999b('0x1d')&&typeof _0x4fbbcd['limit']===_0x999b('0x1d');var _0x53532c=_0x1c9934['count'];var _0xbb9a81=_0x2e9a65?0x0:_0x4fbbcd[_0x999b('0x1c')];var _0x2e318c=_0x2e9a65?_0x1c9934[_0x999b('0x1e')]:_0x4fbbcd[_0x999b('0x1c')]+_0x4fbbcd['limit'];var _0x20de61;if(_0x2e318c>=_0x53532c){_0x2e318c=_0x53532c;_0x20de61=0xc8;}else{_0x20de61=0xce;}_0x1a6eb8[_0x999b('0x19')](_0x20de61);return _0x1a6eb8[_0x999b('0x1f')]('Content-Range',_0xbb9a81+'-'+_0x2e318c+'/'+_0x53532c)[_0x999b('0x1b')](_0x1c9934);}return null;};}function patchUpdates(_0x23b780){return function(_0x2bf77c){try{jsonpatch[_0x999b('0x20')](_0x2bf77c,_0x23b780,!![]);}catch(_0x1ee738){return BPromise[_0x999b('0x21')](_0x1ee738);}return _0x2bf77c[_0x999b('0x22')]();};}function saveUpdates(_0x41d303,_0x10d0b8){return function(_0x554546){if(_0x554546){return _0x554546[_0x999b('0x23')](_0x41d303)[_0x999b('0x24')](function(_0x568d67){return _0x568d67;});}return null;};}function removeEntity(_0x464cc8,_0x4dd45a){return function(_0xc25804){if(_0xc25804){return _0xc25804['destroy']()[_0x999b('0x24')](function(){var _0x3bc9a6=_0xc25804[_0x999b('0x25')]({'plain':!![]});var _0x3cfd46=_0x999b('0x26');return db[_0x999b('0x27')][_0x999b('0x28')]({'where':{'type':_0x3cfd46,'resourceId':_0x3bc9a6['id']}})['then'](function(){return _0xc25804;});})[_0x999b('0x24')](function(){_0x464cc8[_0x999b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x487401,_0x1b3b15){return function(_0x5b4b30){if(!_0x5b4b30){_0x487401[_0x999b('0x29')](0x194);}return _0x5b4b30;};}function handleError(_0x267ac6,_0x492e25){_0x492e25=_0x492e25||0x1f4;return function(_0x522cde){logger[_0x999b('0x2a')](_0x522cde[_0x999b('0x2b')]);if(_0x522cde[_0x999b('0x2c')]){delete _0x522cde['name'];}_0x267ac6[_0x999b('0x19')](_0x492e25)[_0x999b('0x2d')](_0x522cde);};}exports['index']=function(_0x3c7fe3,_0x5940ee){var _0x57c849={},_0x2914a0={},_0x13a5e4={'count':0x0,'rows':[]};var _0x9eb273=_['map'](db[_0x999b('0x2e')][_0x999b('0x2f')],function(_0x55814e){return{'name':_0x55814e[_0x999b('0x30')],'type':_0x55814e[_0x999b('0x31')]['key']};});_0x2914a0[_0x999b('0x32')]=_[_0x999b('0x33')](_0x9eb273,_0x999b('0x2c'));_0x2914a0[_0x999b('0x34')]=_[_0x999b('0x35')](_0x3c7fe3[_0x999b('0x34')]);_0x2914a0[_0x999b('0x36')]=_[_0x999b('0x37')](_0x2914a0[_0x999b('0x32')],_0x2914a0[_0x999b('0x34')]);_0x57c849[_0x999b('0x38')]=_['intersection'](_0x2914a0[_0x999b('0x32')],qs['fields'](_0x3c7fe3['query'][_0x999b('0x39')]));_0x57c849[_0x999b('0x38')]=_0x57c849['attributes'][_0x999b('0x3a')]?_0x57c849[_0x999b('0x38')]:_0x2914a0[_0x999b('0x32')];if(!_0x3c7fe3[_0x999b('0x34')][_0x999b('0x3b')](_0x999b('0x3c'))){_0x57c849[_0x999b('0x3d')]=qs[_0x999b('0x3d')](_0x3c7fe3[_0x999b('0x34')][_0x999b('0x3d')]);_0x57c849[_0x999b('0x1c')]=qs['offset'](_0x3c7fe3[_0x999b('0x34')][_0x999b('0x1c')]);}_0x57c849['order']=qs['sort'](_0x3c7fe3[_0x999b('0x34')][_0x999b('0x3e')]);_0x57c849[_0x999b('0x3f')]=qs[_0x999b('0x36')](_[_0x999b('0x40')](_0x3c7fe3[_0x999b('0x34')],_0x2914a0[_0x999b('0x36')]),_0x9eb273);if(_0x3c7fe3[_0x999b('0x34')]['filter']){_0x57c849[_0x999b('0x3f')]=_['merge'](_0x57c849[_0x999b('0x3f')],{'$or':_[_0x999b('0x33')](_0x9eb273,function(_0x296581){if(_0x296581[_0x999b('0x31')]!=='VIRTUAL'){var _0x3eb178={};_0x3eb178[_0x296581['name']]={'$like':'%'+_0x3c7fe3['query'][_0x999b('0x41')]+'%'};return _0x3eb178;}})});}_0x57c849=_['merge']({},_0x57c849,_0x3c7fe3[_0x999b('0x42')]);var _0x1d46cc={'where':_0x57c849[_0x999b('0x3f')]};return db[_0x999b('0x2e')][_0x999b('0x1e')](_0x1d46cc)['then'](function(_0x36e83e){_0x13a5e4[_0x999b('0x1e')]=_0x36e83e;if(_0x3c7fe3[_0x999b('0x34')]['includeAll']){_0x57c849[_0x999b('0x43')]=[{'all':!![]}];}return db[_0x999b('0x2e')]['findAll'](_0x57c849);})[_0x999b('0x24')](function(_0x2b8835){_0x13a5e4[_0x999b('0x44')]=_0x2b8835;return _0x13a5e4;})[_0x999b('0x24')](respondWithFilteredResult(_0x5940ee,_0x57c849))[_0x999b('0x45')](handleError(_0x5940ee,null));};exports['show']=function(_0x31343d,_0x29c768){var _0x43e4fa={'raw':!![],'where':{'id':_0x31343d[_0x999b('0x46')]['id']}},_0x16f9f8={};_0x16f9f8[_0x999b('0x32')]=_[_0x999b('0x35')](db[_0x999b('0x2e')]['rawAttributes']);_0x16f9f8[_0x999b('0x34')]=_['keys'](_0x31343d[_0x999b('0x34')]);_0x16f9f8[_0x999b('0x36')]=_[_0x999b('0x37')](_0x16f9f8[_0x999b('0x32')],_0x16f9f8[_0x999b('0x34')]);_0x43e4fa[_0x999b('0x38')]=_[_0x999b('0x37')](_0x16f9f8[_0x999b('0x32')],qs['fields'](_0x31343d['query'][_0x999b('0x39')]));_0x43e4fa[_0x999b('0x38')]=_0x43e4fa['attributes'][_0x999b('0x3a')]?_0x43e4fa[_0x999b('0x38')]:_0x16f9f8[_0x999b('0x32')];if(_0x31343d['query']['includeAll']){_0x43e4fa['include']=[{'all':!![]}];}_0x43e4fa=_[_0x999b('0x47')]({},_0x43e4fa,_0x31343d['options']);return db[_0x999b('0x2e')][_0x999b('0x48')](_0x43e4fa)['then'](handleEntityNotFound(_0x29c768,null))[_0x999b('0x24')](respondWithResult(_0x29c768,null))[_0x999b('0x45')](handleError(_0x29c768,null));};exports['create']=function(_0x1e3fae,_0x5f3e07){return db[_0x999b('0x2e')][_0x999b('0x49')](_0x1e3fae['body'],{})[_0x999b('0x24')](function(_0x4a82ab){var _0x3b9043=_0x1e3fae[_0x999b('0x4a')][_0x999b('0x25')]({'plain':!![]});if(!_0x3b9043)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3b9043[_0x999b('0x4b')]===_0x999b('0x4a')){var _0x510dc8=_0x4a82ab['get']({'plain':!![]});var _0x1fa12d=_0x999b('0x26');return db[_0x999b('0x4c')][_0x999b('0x48')]({'where':{'name':_0x1fa12d,'userProfileId':_0x3b9043[_0x999b('0x4d')]},'raw':!![]})[_0x999b('0x24')](function(_0x559b22){if(_0x559b22&&_0x559b22[_0x999b('0x4e')]===0x0){return db[_0x999b('0x27')][_0x999b('0x49')]({'name':_0x510dc8[_0x999b('0x2c')],'resourceId':_0x510dc8['id'],'type':_0x559b22['name'],'sectionId':_0x559b22['id']},{})[_0x999b('0x24')](function(){return _0x4a82ab;});}else{return _0x4a82ab;}})[_0x999b('0x45')](function(_0xfe517d){logger['error'](_0x999b('0x4f'),_0xfe517d);throw _0xfe517d;});}return _0x4a82ab;})[_0x999b('0x24')](respondWithResult(_0x5f3e07,0xc9))[_0x999b('0x45')](handleError(_0x5f3e07,null));};exports[_0x999b('0x23')]=function(_0x54cb26,_0x2ccc6a){if(_0x54cb26[_0x999b('0x50')]['id']){delete _0x54cb26[_0x999b('0x50')]['id'];}return db[_0x999b('0x2e')][_0x999b('0x48')]({'where':{'id':_0x54cb26[_0x999b('0x46')]['id']}})[_0x999b('0x24')](handleEntityNotFound(_0x2ccc6a,null))[_0x999b('0x24')](saveUpdates(_0x54cb26[_0x999b('0x50')],null))['then'](respondWithResult(_0x2ccc6a,null))['catch'](handleError(_0x2ccc6a,null));};exports['destroy']=function(_0x3118de,_0x53568e){return db[_0x999b('0x2e')][_0x999b('0x48')]({'where':{'id':_0x3118de[_0x999b('0x46')]['id']}})[_0x999b('0x24')](handleEntityNotFound(_0x53568e,null))[_0x999b('0x24')](removeEntity(_0x53568e,null))[_0x999b('0x45')](handleError(_0x53568e,null));}; \ No newline at end of file +var _0xb971=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','get','CmContactHasItems','UserProfileResource','destroy','end','stack','name','send','index','map','CmContactHasItem','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','findAll','rows','catch','show','params','keys','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find'];(function(_0x511d49,_0x5efbae){var _0x7cf33f=function(_0x3cef81){while(--_0x3cef81){_0x511d49['push'](_0x511d49['shift']());}};_0x7cf33f(++_0x5efbae);}(_0xb971,0x1f4));var _0x1b97=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb971[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x1b97('0x0'));var rimraf=require(_0x1b97('0x1'));var zipdir=require(_0x1b97('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1b97('0x3'));var moment=require(_0x1b97('0x4'));var BPromise=require(_0x1b97('0x5'));var Mustache=require('mustache');var util=require(_0x1b97('0x6'));var path=require('path');var sox=require(_0x1b97('0x7'));var csv=require(_0x1b97('0x8'));var ejs=require(_0x1b97('0x9'));var fs=require('fs');var fs_extra=require(_0x1b97('0xa'));var _=require(_0x1b97('0xb'));var squel=require(_0x1b97('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1b97('0xd'));var toCsv=require(_0x1b97('0x8'));var querystring=require(_0x1b97('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1b97('0xf'));var qs=require(_0x1b97('0x10'));var as=require(_0x1b97('0x11'));var hardwareService=require(_0x1b97('0x12'));var logger=require(_0x1b97('0x13'))(_0x1b97('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1b97('0x15'));var db=require(_0x1b97('0x16'))['db'];function respondWithStatusCode(_0x28fc60,_0x55b6ae){_0x55b6ae=_0x55b6ae||0xcc;return function(_0x4086ac){if(_0x4086ac){return _0x28fc60[_0x1b97('0x17')](_0x55b6ae);}return _0x28fc60[_0x1b97('0x18')](_0x55b6ae)['end']();};}function respondWithResult(_0x4d308a,_0x5c4598){_0x5c4598=_0x5c4598||0xc8;return function(_0xebedae){if(_0xebedae){return _0x4d308a[_0x1b97('0x18')](_0x5c4598)[_0x1b97('0x19')](_0xebedae);}};}function respondWithFilteredResult(_0x4202a7,_0x469842){return function(_0x415358){if(_0x415358){var _0x54274d=typeof _0x469842[_0x1b97('0x1a')]==='undefined'&&typeof _0x469842['limit']===_0x1b97('0x1b');var _0x56357c=_0x415358[_0x1b97('0x1c')];var _0x2588fc=_0x54274d?0x0:_0x469842[_0x1b97('0x1a')];var _0x434e00=_0x54274d?_0x415358[_0x1b97('0x1c')]:_0x469842[_0x1b97('0x1a')]+_0x469842[_0x1b97('0x1d')];var _0xf8c039;if(_0x434e00>=_0x56357c){_0x434e00=_0x56357c;_0xf8c039=0xc8;}else{_0xf8c039=0xce;}_0x4202a7[_0x1b97('0x18')](_0xf8c039);return _0x4202a7['set'](_0x1b97('0x1e'),_0x2588fc+'-'+_0x434e00+'/'+_0x56357c)[_0x1b97('0x19')](_0x415358);}return null;};}function patchUpdates(_0x4e0c30){return function(_0x3c11fb){try{jsonpatch[_0x1b97('0x1f')](_0x3c11fb,_0x4e0c30,!![]);}catch(_0x6b9a33){return BPromise[_0x1b97('0x20')](_0x6b9a33);}return _0x3c11fb[_0x1b97('0x21')]();};}function saveUpdates(_0x5bca96,_0x22e859){return function(_0x53d84d){if(_0x53d84d){return _0x53d84d[_0x1b97('0x22')](_0x5bca96)['then'](function(_0x557097){return _0x557097;});}return null;};}function removeEntity(_0x5e7d91,_0x16cc07){return function(_0x1d493c){if(_0x1d493c){return _0x1d493c['destroy']()[_0x1b97('0x23')](function(){var _0x515876=_0x1d493c[_0x1b97('0x24')]({'plain':!![]});var _0x14efad=_0x1b97('0x25');return db[_0x1b97('0x26')][_0x1b97('0x27')]({'where':{'type':_0x14efad,'resourceId':_0x515876['id']}})[_0x1b97('0x23')](function(){return _0x1d493c;});})[_0x1b97('0x23')](function(){_0x5e7d91[_0x1b97('0x18')](0xcc)[_0x1b97('0x28')]();});}};}function handleEntityNotFound(_0x7750e4,_0x14647c){return function(_0x1acf15){if(!_0x1acf15){_0x7750e4[_0x1b97('0x17')](0x194);}return _0x1acf15;};}function handleError(_0x4856a5,_0x5b1120){_0x5b1120=_0x5b1120||0x1f4;return function(_0x2b466a){logger['error'](_0x2b466a[_0x1b97('0x29')]);if(_0x2b466a[_0x1b97('0x2a')]){delete _0x2b466a[_0x1b97('0x2a')];}_0x4856a5[_0x1b97('0x18')](_0x5b1120)[_0x1b97('0x2b')](_0x2b466a);};}exports[_0x1b97('0x2c')]=function(_0x5aece6,_0xd16bcf){var _0x24a239={},_0x2a338d={},_0x464a2d={'count':0x0,'rows':[]};var _0x41143a=_[_0x1b97('0x2d')](db[_0x1b97('0x2e')][_0x1b97('0x2f')],function(_0x2169cb){return{'name':_0x2169cb[_0x1b97('0x30')],'type':_0x2169cb[_0x1b97('0x31')]['key']};});_0x2a338d[_0x1b97('0x32')]=_[_0x1b97('0x2d')](_0x41143a,_0x1b97('0x2a'));_0x2a338d['query']=_['keys'](_0x5aece6[_0x1b97('0x33')]);_0x2a338d['filters']=_[_0x1b97('0x34')](_0x2a338d['model'],_0x2a338d[_0x1b97('0x33')]);_0x24a239[_0x1b97('0x35')]=_['intersection'](_0x2a338d[_0x1b97('0x32')],qs[_0x1b97('0x36')](_0x5aece6[_0x1b97('0x33')][_0x1b97('0x36')]));_0x24a239['attributes']=_0x24a239[_0x1b97('0x35')][_0x1b97('0x37')]?_0x24a239[_0x1b97('0x35')]:_0x2a338d[_0x1b97('0x32')];if(!_0x5aece6[_0x1b97('0x33')][_0x1b97('0x38')](_0x1b97('0x39'))){_0x24a239[_0x1b97('0x1d')]=qs[_0x1b97('0x1d')](_0x5aece6[_0x1b97('0x33')][_0x1b97('0x1d')]);_0x24a239[_0x1b97('0x1a')]=qs[_0x1b97('0x1a')](_0x5aece6[_0x1b97('0x33')][_0x1b97('0x1a')]);}_0x24a239[_0x1b97('0x3a')]=qs['sort'](_0x5aece6['query'][_0x1b97('0x3b')]);_0x24a239[_0x1b97('0x3c')]=qs[_0x1b97('0x3d')](_[_0x1b97('0x3e')](_0x5aece6[_0x1b97('0x33')],_0x2a338d[_0x1b97('0x3d')]),_0x41143a);if(_0x5aece6[_0x1b97('0x33')][_0x1b97('0x3f')]){_0x24a239[_0x1b97('0x3c')]=_['merge'](_0x24a239[_0x1b97('0x3c')],{'$or':_[_0x1b97('0x2d')](_0x41143a,function(_0x4e6aac){if(_0x4e6aac[_0x1b97('0x31')]!==_0x1b97('0x40')){var _0x5e658e={};_0x5e658e[_0x4e6aac['name']]={'$like':'%'+_0x5aece6[_0x1b97('0x33')][_0x1b97('0x3f')]+'%'};return _0x5e658e;}})});}_0x24a239=_[_0x1b97('0x41')]({},_0x24a239,_0x5aece6['options']);var _0xf2a9c4={'where':_0x24a239[_0x1b97('0x3c')]};return db[_0x1b97('0x2e')][_0x1b97('0x1c')](_0xf2a9c4)[_0x1b97('0x23')](function(_0x3480e2){_0x464a2d[_0x1b97('0x1c')]=_0x3480e2;if(_0x5aece6[_0x1b97('0x33')][_0x1b97('0x42')]){_0x24a239['include']=[{'all':!![]}];}return db[_0x1b97('0x2e')][_0x1b97('0x43')](_0x24a239);})['then'](function(_0x125287){_0x464a2d[_0x1b97('0x44')]=_0x125287;return _0x464a2d;})[_0x1b97('0x23')](respondWithFilteredResult(_0xd16bcf,_0x24a239))[_0x1b97('0x45')](handleError(_0xd16bcf,null));};exports[_0x1b97('0x46')]=function(_0x170d1d,_0x533852){var _0x3aec0e={'raw':!![],'where':{'id':_0x170d1d[_0x1b97('0x47')]['id']}},_0x140f17={};_0x140f17[_0x1b97('0x32')]=_[_0x1b97('0x48')](db[_0x1b97('0x2e')]['rawAttributes']);_0x140f17[_0x1b97('0x33')]=_[_0x1b97('0x48')](_0x170d1d[_0x1b97('0x33')]);_0x140f17[_0x1b97('0x3d')]=_[_0x1b97('0x34')](_0x140f17[_0x1b97('0x32')],_0x140f17['query']);_0x3aec0e[_0x1b97('0x35')]=_['intersection'](_0x140f17[_0x1b97('0x32')],qs[_0x1b97('0x36')](_0x170d1d[_0x1b97('0x33')][_0x1b97('0x36')]));_0x3aec0e[_0x1b97('0x35')]=_0x3aec0e[_0x1b97('0x35')][_0x1b97('0x37')]?_0x3aec0e['attributes']:_0x140f17['model'];if(_0x170d1d['query'][_0x1b97('0x42')]){_0x3aec0e[_0x1b97('0x49')]=[{'all':!![]}];}_0x3aec0e=_[_0x1b97('0x41')]({},_0x3aec0e,_0x170d1d['options']);return db[_0x1b97('0x2e')]['find'](_0x3aec0e)[_0x1b97('0x23')](handleEntityNotFound(_0x533852,null))['then'](respondWithResult(_0x533852,null))[_0x1b97('0x45')](handleError(_0x533852,null));};exports[_0x1b97('0x4a')]=function(_0x16b21c,_0x16d656){return db[_0x1b97('0x2e')][_0x1b97('0x4a')](_0x16b21c[_0x1b97('0x4b')],{})['then'](function(_0x2d5243){var _0x1c5925=_0x16b21c[_0x1b97('0x4c')][_0x1b97('0x24')]({'plain':!![]});if(!_0x1c5925)throw new Error(_0x1b97('0x4d'));if(_0x1c5925[_0x1b97('0x4e')]===_0x1b97('0x4c')){var _0x19c26b=_0x2d5243[_0x1b97('0x24')]({'plain':!![]});var _0x3dbc4f=_0x1b97('0x25');return db[_0x1b97('0x4f')][_0x1b97('0x50')]({'where':{'name':_0x3dbc4f,'userProfileId':_0x1c5925['userProfileId']},'raw':!![]})[_0x1b97('0x23')](function(_0x1834ca){if(_0x1834ca&&_0x1834ca[_0x1b97('0x51')]===0x0){return db[_0x1b97('0x26')][_0x1b97('0x4a')]({'name':_0x19c26b['name'],'resourceId':_0x19c26b['id'],'type':_0x1834ca[_0x1b97('0x2a')],'sectionId':_0x1834ca['id']},{})[_0x1b97('0x23')](function(){return _0x2d5243;});}else{return _0x2d5243;}})['catch'](function(_0x1bb4eb){logger['error'](_0x1b97('0x52'),_0x1bb4eb);throw _0x1bb4eb;});}return _0x2d5243;})[_0x1b97('0x23')](respondWithResult(_0x16d656,0xc9))[_0x1b97('0x45')](handleError(_0x16d656,null));};exports['update']=function(_0x5e1b3b,_0xeb1298){if(_0x5e1b3b[_0x1b97('0x4b')]['id']){delete _0x5e1b3b['body']['id'];}return db[_0x1b97('0x2e')][_0x1b97('0x50')]({'where':{'id':_0x5e1b3b[_0x1b97('0x47')]['id']}})['then'](handleEntityNotFound(_0xeb1298,null))[_0x1b97('0x23')](saveUpdates(_0x5e1b3b[_0x1b97('0x4b')],null))[_0x1b97('0x23')](respondWithResult(_0xeb1298,null))[_0x1b97('0x45')](handleError(_0xeb1298,null));};exports[_0x1b97('0x27')]=function(_0x332b38,_0x29c75b){return db['CmContactHasItem'][_0x1b97('0x50')]({'where':{'id':_0x332b38[_0x1b97('0x47')]['id']}})['then'](handleEntityNotFound(_0x29c75b,null))[_0x1b97('0x23')](removeEntity(_0x29c75b,null))[_0x1b97('0x45')](handleError(_0x29c75b,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index f56d7d8..819c7e7 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 _0xc10a=['path','rimraf','../../config/environment','./cmContactHasItem.attributes','define','cm_contact_has_items','util','api','moment','bluebird'];(function(_0x412801,_0x1a8606){var _0x5a0acf=function(_0x4ee05b){while(--_0x4ee05b){_0x412801['push'](_0x412801['shift']());}};_0x5a0acf(++_0x1a8606);}(_0xc10a,0x15a));var _0xac10=function(_0x2c27ed,_0x5c50f0){_0x2c27ed=_0x2c27ed-0x0;var _0x597bd1=_0xc10a[_0x2c27ed];return _0x597bd1;};'use strict';var _=require('lodash');var util=require(_0xac10('0x0'));var logger=require('../../config/logger')(_0xac10('0x1'));var moment=require(_0xac10('0x2'));var BPromise=require(_0xac10('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xac10('0x4'));var rimraf=require(_0xac10('0x5'));var config=require(_0xac10('0x6'));var attributes=require(_0xac10('0x7'));module['exports']=function(_0x43cf8a,_0x1d9817){return _0x43cf8a[_0xac10('0x8')]('CmContactHasItem',attributes,{'tableName':_0xac10('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x376a=['bluebird','request-promise','path','rimraf','../../config/environment','./cmContactHasItem.attributes','exports','CmContactHasItem','cm_contact_has_items','lodash','util','api','moment'];(function(_0x685fd1,_0x31bc0a){var _0x4cfea0=function(_0x4557db){while(--_0x4557db){_0x685fd1['push'](_0x685fd1['shift']());}};_0x4cfea0(++_0x31bc0a);}(_0x376a,0xbf));var _0xa376=function(_0x43798c,_0xe501b8){_0x43798c=_0x43798c-0x0;var _0x1fdc98=_0x376a[_0x43798c];return _0x1fdc98;};'use strict';var _=require(_0xa376('0x0'));var util=require(_0xa376('0x1'));var logger=require('../../config/logger')(_0xa376('0x2'));var moment=require(_0xa376('0x3'));var BPromise=require(_0xa376('0x4'));var rp=require(_0xa376('0x5'));var fs=require('fs');var path=require(_0xa376('0x6'));var rimraf=require(_0xa376('0x7'));var config=require(_0xa376('0x8'));var attributes=require(_0xa376('0x9'));module[_0xa376('0xa')]=function(_0x3945ce,_0x147bbf){return _0x3945ce['define'](_0xa376('0xb'),attributes,{'tableName':_0xa376('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 ecd6b15..cda350b 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 _0x7d13=['message','info','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4e1645,_0x21ef10){var _0xe2de77=function(_0x582a6f){while(--_0x582a6f){_0x4e1645['push'](_0x4e1645['shift']());}};_0xe2de77(++_0x21ef10);}(_0x7d13,0x174));var _0x37d1=function(_0x3325c8,_0x5701c2){_0x3325c8=_0x3325c8-0x0;var _0x3526f9=_0x7d13[_0x3325c8];return _0x3526f9;};'use strict';var _=require('lodash');var util=require(_0x37d1('0x0'));var moment=require(_0x37d1('0x1'));var BPromise=require('bluebird');var rs=require(_0x37d1('0x2'));var fs=require('fs');var Redis=require(_0x37d1('0x3'));var db=require(_0x37d1('0x4'))['db'];var utils=require(_0x37d1('0x5'));var logger=require(_0x37d1('0x6'))(_0x37d1('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x37d1('0x8')][_0x37d1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x6651c0,_0x26297f,_0x521507){return new BPromise(function(_0x6d7af0,_0x38730e){return client[_0x37d1('0xa')](_0x6651c0,_0x521507)[_0x37d1('0xb')](function(_0x1fe6bf){logger['info'](_0x37d1('0xc'),_0x26297f,_0x37d1('0xd'));logger[_0x37d1('0xe')](_0x37d1('0xf'),_0x26297f,_0x37d1('0xd'),JSON[_0x37d1('0x10')](_0x1fe6bf));if(_0x1fe6bf[_0x37d1('0x11')]){if(_0x1fe6bf[_0x37d1('0x11')][_0x37d1('0x12')]===0x1f4){logger[_0x37d1('0x11')](_0x37d1('0xc'),_0x26297f,_0x1fe6bf[_0x37d1('0x11')][_0x37d1('0x13')]);return _0x38730e(_0x1fe6bf['error']['message']);}logger[_0x37d1('0x11')](_0x37d1('0xc'),_0x26297f,_0x1fe6bf[_0x37d1('0x11')][_0x37d1('0x13')]);return _0x6d7af0(_0x1fe6bf['error'][_0x37d1('0x13')]);}else{logger[_0x37d1('0x14')](_0x37d1('0xc'),_0x26297f,_0x37d1('0xd'));_0x6d7af0(_0x1fe6bf[_0x37d1('0x15')][_0x37d1('0x13')]);}})[_0x37d1('0x16')](function(_0x5e5882){logger[_0x37d1('0x11')](_0x37d1('0xc'),_0x26297f,_0x5e5882);_0x38730e(_0x5e5882);});});} \ No newline at end of file +var _0x37c4=['../../config/logger','rpc','jayson/promise','client','http','request','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x2e59c4,_0x15072e){var _0x48858d=function(_0xab2b55){while(--_0xab2b55){_0x2e59c4['push'](_0x2e59c4['shift']());}};_0x48858d(++_0x15072e);}(_0x37c4,0x7f));var _0x437c=function(_0x587c6c,_0x5ef4d9){_0x587c6c=_0x587c6c-0x0;var _0x598b78=_0x37c4[_0x587c6c];return _0x598b78;};'use strict';var _=require('lodash');var util=require(_0x437c('0x0'));var moment=require(_0x437c('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x437c('0x2'));var db=require(_0x437c('0x3'))['db'];var utils=require(_0x437c('0x4'));var logger=require(_0x437c('0x5'))(_0x437c('0x6'));var config=require('../../config/environment');var jayson=require(_0x437c('0x7'));var client=jayson[_0x437c('0x8')][_0x437c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5933c4,_0x5a2102,_0x220a5d){return new BPromise(function(_0x2f7d8b,_0xdc7497){return client[_0x437c('0xa')](_0x5933c4,_0x220a5d)[_0x437c('0xb')](function(_0x51e748){logger[_0x437c('0xc')](_0x437c('0xd'),_0x5a2102,_0x437c('0xe'));logger['debug'](_0x437c('0xf'),_0x5a2102,'request\x20sent',JSON[_0x437c('0x10')](_0x51e748));if(_0x51e748[_0x437c('0x11')]){if(_0x51e748[_0x437c('0x11')][_0x437c('0x12')]===0x1f4){logger[_0x437c('0x11')]('CmContactHasItem,\x20%s,\x20%s',_0x5a2102,_0x51e748[_0x437c('0x11')]['message']);return _0xdc7497(_0x51e748[_0x437c('0x11')]['message']);}logger[_0x437c('0x11')](_0x437c('0xd'),_0x5a2102,_0x51e748[_0x437c('0x11')][_0x437c('0x13')]);return _0x2f7d8b(_0x51e748['error'][_0x437c('0x13')]);}else{logger[_0x437c('0xc')](_0x437c('0xd'),_0x5a2102,_0x437c('0xe'));_0x2f7d8b(_0x51e748[_0x437c('0x14')][_0x437c('0x13')]);}})[_0x437c('0x15')](function(_0x475086){logger[_0x437c('0x11')](_0x437c('0xd'),_0x5a2102,_0x475086);_0xdc7497(_0x475086);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 299448f..10349e7 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 _0x67ec=['./cmContactHasItem.controller','get','isAuthenticated','index','/:id','show','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x47a13d,_0x582540){var _0x4ac638=function(_0x5bafd6){while(--_0x5bafd6){_0x47a13d['push'](_0x47a13d['shift']());}};_0x4ac638(++_0x582540);}(_0x67ec,0x11c));var _0xc67e=function(_0x168e82,_0x5827fb){_0x168e82=_0x168e82-0x0;var _0x5b4a64=_0x67ec[_0x168e82];return _0x5b4a64;};'use strict';var multer=require(_0xc67e('0x0'));var util=require(_0xc67e('0x1'));var path=require(_0xc67e('0x2'));var timeout=require(_0xc67e('0x3'));var express=require(_0xc67e('0x4'));var router=express[_0xc67e('0x5')]();var fs_extra=require(_0xc67e('0x6'));var auth=require(_0xc67e('0x7'));var interaction=require(_0xc67e('0x8'));var config=require(_0xc67e('0x9'));var controller=require(_0xc67e('0xa'));router[_0xc67e('0xb')]('/',auth[_0xc67e('0xc')](),controller[_0xc67e('0xd')]);router[_0xc67e('0xb')](_0xc67e('0xe'),auth['isAuthenticated'](),controller[_0xc67e('0xf')]);router['post']('/',auth[_0xc67e('0xc')](),controller[_0xc67e('0x10')]);router[_0xc67e('0x11')](_0xc67e('0xe'),auth['isAuthenticated'](),controller['update']);router[_0xc67e('0x12')](_0xc67e('0xe'),auth[_0xc67e('0xc')](),controller[_0xc67e('0x13')]);module[_0xc67e('0x14')]=router; \ No newline at end of file +var _0x07bb=['/:id','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','post','create','put','update'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x07bb,0xc9));var _0xb07b=function(_0x4d6e8c,_0x510798){_0x4d6e8c=_0x4d6e8c-0x0;var _0x582629=_0x07bb[_0x4d6e8c];return _0x582629;};'use strict';var multer=require(_0xb07b('0x0'));var util=require('util');var path=require(_0xb07b('0x1'));var timeout=require(_0xb07b('0x2'));var express=require(_0xb07b('0x3'));var router=express['Router']();var fs_extra=require(_0xb07b('0x4'));var auth=require(_0xb07b('0x5'));var interaction=require(_0xb07b('0x6'));var config=require(_0xb07b('0x7'));var controller=require('./cmContactHasItem.controller');router[_0xb07b('0x8')]('/',auth[_0xb07b('0x9')](),controller[_0xb07b('0xa')]);router[_0xb07b('0x8')]('/:id',auth[_0xb07b('0x9')](),controller['show']);router[_0xb07b('0xb')]('/',auth[_0xb07b('0x9')](),controller[_0xb07b('0xc')]);router[_0xb07b('0xd')]('/:id',auth[_0xb07b('0x9')](),controller[_0xb07b('0xe')]);router['delete'](_0xb07b('0xf'),auth[_0xb07b('0x9')](),controller[_0xb07b('0x10')]);module[_0xb07b('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 60b154d..304a828 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 _0x08df=['VIRTUAL','getDataValue','alias','STRING','setDataValue','TEXT','type','select','parse','values','isArray','stringify','BOOLEAN','voice','sequelize'];(function(_0x3420da,_0xc7f01f){var _0x2c7100=function(_0x29f8d){while(--_0x29f8d){_0x3420da['push'](_0x3420da['shift']());}};_0x2c7100(++_0xc7f01f);}(_0x08df,0x11c));var _0xf08d=function(_0x135904,_0x1e252b){_0x135904=_0x135904-0x0;var _0x1ce7d5=_0x08df[_0x135904];return _0x1ce7d5;};'use strict';var Sequelize=require(_0xf08d('0x0'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0xf08d('0x1')],'get':function(_0x58a336){return this[_0xf08d('0x2')](_0xf08d('0x3'));}},'alias':{'type':Sequelize[_0xf08d('0x4')],'allowNull':![],'set':function(_0x4e1a17){this[_0xf08d('0x5')](_0xf08d('0x3'),_0x4e1a17?_0x4e1a17:this['getDataValue']('name'));}},'type':{'type':Sequelize[_0xf08d('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0xf08d('0x6')]('long'),'get':function(){if(this[_0xf08d('0x2')](_0xf08d('0x7'))===_0xf08d('0x8')){return JSON[_0xf08d('0x9')](this[_0xf08d('0x2')](_0xf08d('0xa')));}else{return this[_0xf08d('0x2')](_0xf08d('0xa'));}},'set':function(_0x77e43b){if(Array[_0xf08d('0xb')](_0x77e43b)){this[_0xf08d('0x5')](_0xf08d('0xa'),JSON[_0xf08d('0xc')](_0x77e43b));}else{this[_0xf08d('0x5')](_0xf08d('0xa'),_0x77e43b);}}},'required':{'type':Sequelize[_0xf08d('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xf08d('0xd')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0xf08d('0xe'))}}; \ No newline at end of file +var _0x1efb=['voice','lodash','exports','VIRTUAL','getDataValue','alias','STRING','setDataValue','type','select','parse','values','isArray','stringify','BOOLEAN','ENUM'];(function(_0x49c987,_0x4cd72d){var _0x4e1eb6=function(_0xcb5e81){while(--_0xcb5e81){_0x49c987['push'](_0x49c987['shift']());}};_0x4e1eb6(++_0x4cd72d);}(_0x1efb,0xf1));var _0xb1ef=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x1efb[_0x543084];return _0x306a57;};'use strict';var Sequelize=require('sequelize');var _=require(_0xb1ef('0x0'));module[_0xb1ef('0x1')]={'name':{'type':Sequelize[_0xb1ef('0x2')],'get':function(_0x13134c){return this[_0xb1ef('0x3')](_0xb1ef('0x4'));}},'alias':{'type':Sequelize[_0xb1ef('0x5')],'allowNull':![],'set':function(_0x1a7632){this[_0xb1ef('0x6')]('alias',_0x1a7632?_0x1a7632:this[_0xb1ef('0x3')]('name'));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize['TEXT']('long'),'get':function(){if(this[_0xb1ef('0x3')](_0xb1ef('0x7'))===_0xb1ef('0x8')){return JSON[_0xb1ef('0x9')](this[_0xb1ef('0x3')](_0xb1ef('0xa')));}else{return this[_0xb1ef('0x3')](_0xb1ef('0xa'));}},'set':function(_0x38ec9b){if(Array[_0xb1ef('0xb')](_0x38ec9b)){this['setDataValue'](_0xb1ef('0xa'),JSON[_0xb1ef('0xc')](_0x38ec9b));}else{this[_0xb1ef('0x6')](_0xb1ef('0xa'),_0x38ec9b);}}},'required':{'type':Sequelize[_0xb1ef('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xb1ef('0xd')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xb1ef('0xe')](_0xb1ef('0xf'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 95c0bfa..c12ba7f 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 _0xb54d=['../../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','save','then','destroy','error','stack','name','send','index','map','CmCustomField','rawAttributes','type','model','differenceBy','query','keys','filters','attributes','intersection','fields','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','find','catch','update','body','create','Sequelize','text','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','sequelize','addColumn','cm_contacts','format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','papaparse','ioredis'];(function(_0x54597a,_0x4ea42f){var _0x5a764f=function(_0x5c000b){while(--_0x5c000b){_0x54597a['push'](_0x54597a['shift']());}};_0x5a764f(++_0x4ea42f);}(_0xb54d,0xa3));var _0xdb54=function(_0x498334,_0x27b6fe){_0x498334=_0x498334-0x0;var _0x13bb70=_0xb54d[_0x498334];return _0x13bb70;};'use strict';var emlformat=require(_0xdb54('0x0'));var rimraf=require(_0xdb54('0x1'));var zipdir=require(_0xdb54('0x2'));var jsonpatch=require(_0xdb54('0x3'));var rp=require(_0xdb54('0x4'));var moment=require(_0xdb54('0x5'));var BPromise=require(_0xdb54('0x6'));var Mustache=require('mustache');var util=require(_0xdb54('0x7'));var path=require(_0xdb54('0x8'));var sox=require(_0xdb54('0x9'));var csv=require(_0xdb54('0xa'));var ejs=require(_0xdb54('0xb'));var fs=require('fs');var fs_extra=require(_0xdb54('0xc'));var _=require('lodash');var squel=require(_0xdb54('0xd'));var crypto=require(_0xdb54('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xdb54('0xa'));var querystring=require('querystring');var Papa=require(_0xdb54('0xf'));var Redis=require(_0xdb54('0x10'));var authService=require(_0xdb54('0x11'));var qs=require(_0xdb54('0x12'));var as=require(_0xdb54('0x13'));var hardwareService=require(_0xdb54('0x14'));var logger=require(_0xdb54('0x15'))(_0xdb54('0x16'));var utils=require(_0xdb54('0x17'));var config=require(_0xdb54('0x18'));var licenseUtil=require(_0xdb54('0x19'));var db=require(_0xdb54('0x1a'))['db'];function respondWithStatusCode(_0x150196,_0x4885b7){_0x4885b7=_0x4885b7||0xcc;return function(_0x4326f1){if(_0x4326f1){return _0x150196[_0xdb54('0x1b')](_0x4885b7);}return _0x150196[_0xdb54('0x1c')](_0x4885b7)[_0xdb54('0x1d')]();};}function respondWithResult(_0x1f8514,_0x1e23df){_0x1e23df=_0x1e23df||0xc8;return function(_0x109a1e){if(_0x109a1e){return _0x1f8514[_0xdb54('0x1c')](_0x1e23df)[_0xdb54('0x1e')](_0x109a1e);}};}function respondWithFilteredResult(_0xf20eac,_0x224c81){return function(_0x5dce2){if(_0x5dce2){var _0x13b6c8=typeof _0x224c81[_0xdb54('0x1f')]===_0xdb54('0x20')&&typeof _0x224c81[_0xdb54('0x21')]===_0xdb54('0x20');var _0x427913=_0x5dce2[_0xdb54('0x22')];var _0x4b4a37=_0x13b6c8?0x0:_0x224c81[_0xdb54('0x1f')];var _0x550ae1=_0x13b6c8?_0x5dce2['count']:_0x224c81[_0xdb54('0x1f')]+_0x224c81[_0xdb54('0x21')];var _0x241edc;if(_0x550ae1>=_0x427913){_0x550ae1=_0x427913;_0x241edc=0xc8;}else{_0x241edc=0xce;}_0xf20eac[_0xdb54('0x1c')](_0x241edc);return _0xf20eac[_0xdb54('0x23')](_0xdb54('0x24'),_0x4b4a37+'-'+_0x550ae1+'/'+_0x427913)['json'](_0x5dce2);}return null;};}function patchUpdates(_0x579454){return function(_0x1012b4){try{jsonpatch['apply'](_0x1012b4,_0x579454,!![]);}catch(_0x296636){return BPromise[_0xdb54('0x25')](_0x296636);}return _0x1012b4[_0xdb54('0x26')]();};}function saveUpdates(_0x4fdb8d,_0x2e762d){return function(_0x1b677f){if(_0x1b677f){return _0x1b677f['update'](_0x4fdb8d)[_0xdb54('0x27')](function(_0x5a2dda){return _0x5a2dda;});}return null;};}function removeEntity(_0x2016c8,_0x509247){return function(_0x562007){if(_0x562007){return _0x562007[_0xdb54('0x28')]()[_0xdb54('0x27')](function(){_0x2016c8[_0xdb54('0x1c')](0xcc)[_0xdb54('0x1d')]();});}};}function handleEntityNotFound(_0xecfd58,_0x8fa7a1){return function(_0x406f19){if(!_0x406f19){_0xecfd58[_0xdb54('0x1b')](0x194);}return _0x406f19;};}function handleError(_0x405cfe,_0x105fdb){_0x105fdb=_0x105fdb||0x1f4;return function(_0x2f2c5b){logger[_0xdb54('0x29')](_0x2f2c5b[_0xdb54('0x2a')]);if(_0x2f2c5b['name']){delete _0x2f2c5b[_0xdb54('0x2b')];}_0x405cfe[_0xdb54('0x1c')](_0x105fdb)[_0xdb54('0x2c')](_0x2f2c5b);};}exports[_0xdb54('0x2d')]=function(_0x1ced7a,_0x47c661){var _0x4d1bdd={},_0x1d8422={},_0x2b7e2f={'count':0x0,'rows':[]};var _0x5f2cb1=_[_0xdb54('0x2e')](db[_0xdb54('0x2f')][_0xdb54('0x30')],function(_0x23c7a6){return{'name':_0x23c7a6['fieldName'],'type':_0x23c7a6[_0xdb54('0x31')]['key']};});_0x1d8422[_0xdb54('0x32')]=_[_0xdb54('0x33')](_[_0xdb54('0x2e')](_0x5f2cb1,_0xdb54('0x2b')),[_0xdb54('0x2b')]);_0x1d8422[_0xdb54('0x34')]=_[_0xdb54('0x35')](_0x1ced7a['query']);_0x1d8422[_0xdb54('0x36')]=_['intersection'](_0x1d8422['model'],_0x1d8422[_0xdb54('0x34')]);_0x4d1bdd[_0xdb54('0x37')]=_[_0xdb54('0x38')](_0x1d8422[_0xdb54('0x32')],qs[_0xdb54('0x39')](_0x1ced7a['query'][_0xdb54('0x39')]));_0x4d1bdd[_0xdb54('0x37')]=_0x4d1bdd['attributes']['length']?_0x4d1bdd['attributes']:_0x1d8422[_0xdb54('0x32')];if(!_0x1ced7a[_0xdb54('0x34')][_0xdb54('0x3a')]('nolimit')){_0x4d1bdd[_0xdb54('0x21')]=qs[_0xdb54('0x21')](_0x1ced7a[_0xdb54('0x34')][_0xdb54('0x21')]);_0x4d1bdd[_0xdb54('0x1f')]=qs[_0xdb54('0x1f')](_0x1ced7a[_0xdb54('0x34')]['offset']);}_0x4d1bdd['order']=qs[_0xdb54('0x3b')](_0x1ced7a[_0xdb54('0x34')][_0xdb54('0x3b')]);_0x4d1bdd[_0xdb54('0x3c')]=qs['filters'](_[_0xdb54('0x3d')](_0x1ced7a['query'],_0x1d8422[_0xdb54('0x36')]),_0x5f2cb1);if(_0x1ced7a[_0xdb54('0x34')][_0xdb54('0x3e')]){_0x4d1bdd[_0xdb54('0x3c')]=_[_0xdb54('0x3f')](_0x4d1bdd['where'],{'$or':_[_0xdb54('0x2e')](_0x5f2cb1,function(_0x618bdd){if(_0x618bdd[_0xdb54('0x31')]!==_0xdb54('0x40')){var _0x29b9e8={};_0x29b9e8[_0x618bdd['name']]={'$like':'%'+_0x1ced7a['query']['filter']+'%'};return _0x29b9e8;}})});}_0x4d1bdd=_['merge']({},_0x4d1bdd,_0x1ced7a[_0xdb54('0x41')]);var _0x14e5bc={'where':_0x4d1bdd['where']};return db[_0xdb54('0x2f')]['count'](_0x14e5bc)[_0xdb54('0x27')](function(_0x3c7417){_0x2b7e2f[_0xdb54('0x22')]=_0x3c7417;if(_0x1ced7a[_0xdb54('0x34')][_0xdb54('0x42')]){_0x4d1bdd[_0xdb54('0x43')]=[{'all':!![]}];}return db[_0xdb54('0x2f')][_0xdb54('0x44')](_0x4d1bdd);})[_0xdb54('0x27')](function(_0x3c47c4){_0x2b7e2f[_0xdb54('0x45')]=_0x3c47c4;return _0x2b7e2f;})['then'](respondWithFilteredResult(_0x47c661,_0x4d1bdd))['catch'](handleError(_0x47c661,null));};exports[_0xdb54('0x46')]=function(_0x7fbfbc,_0xf8aa3e){var _0x384c58={'raw':!![],'where':{'id':_0x7fbfbc[_0xdb54('0x47')]['id']}},_0x187c6e={};_0x187c6e[_0xdb54('0x32')]=_[_0xdb54('0x35')](db[_0xdb54('0x2f')][_0xdb54('0x30')]);_0x187c6e['query']=_[_0xdb54('0x35')](_0x7fbfbc[_0xdb54('0x34')]);_0x187c6e[_0xdb54('0x36')]=_[_0xdb54('0x38')](_0x187c6e[_0xdb54('0x32')],_0x187c6e['query']);_0x384c58['attributes']=_['intersection'](_0x187c6e[_0xdb54('0x32')],qs[_0xdb54('0x39')](_0x7fbfbc[_0xdb54('0x34')]['fields']));_0x384c58[_0xdb54('0x37')]=_0x384c58['attributes'][_0xdb54('0x48')]?_0x384c58[_0xdb54('0x37')]:_0x187c6e[_0xdb54('0x32')];if(_0x7fbfbc[_0xdb54('0x34')][_0xdb54('0x42')]){_0x384c58[_0xdb54('0x43')]=[{'all':!![]}];}_0x384c58=_[_0xdb54('0x3f')]({},_0x384c58,_0x7fbfbc[_0xdb54('0x41')]);return db[_0xdb54('0x2f')][_0xdb54('0x49')](_0x384c58)[_0xdb54('0x27')](handleEntityNotFound(_0xf8aa3e,null))[_0xdb54('0x27')](respondWithResult(_0xf8aa3e,null))[_0xdb54('0x4a')](handleError(_0xf8aa3e,null));};exports[_0xdb54('0x4b')]=function(_0x6ab6b,_0x403f91){if(_0x6ab6b['body']['id']){delete _0x6ab6b[_0xdb54('0x4c')]['id'];}return db[_0xdb54('0x2f')][_0xdb54('0x49')]({'where':{'id':_0x6ab6b[_0xdb54('0x47')]['id']}})[_0xdb54('0x27')](handleEntityNotFound(_0x403f91,null))[_0xdb54('0x27')](saveUpdates(_0x6ab6b[_0xdb54('0x4c')],null))[_0xdb54('0x27')](respondWithResult(_0x403f91,null))[_0xdb54('0x4a')](handleError(_0x403f91,null));};exports['destroy']=function(_0x529789,_0x3e4b1d){return db[_0xdb54('0x2f')][_0xdb54('0x49')]({'where':{'id':_0x529789[_0xdb54('0x47')]['id']}})[_0xdb54('0x27')](handleEntityNotFound(_0x3e4b1d,null))[_0xdb54('0x27')](removeEntity(_0x3e4b1d,null))['catch'](handleError(_0x3e4b1d,null));};exports['create']=function(_0x314dc6,_0x3a4ad0){var _0x3e1deb;return db['sequelize']['transaction'](function(_0x8684c){return db[_0xdb54('0x2f')][_0xdb54('0x4d')](_0x314dc6[_0xdb54('0x4c')],{'transaction':_0x8684c})['then'](function(_0x21859c){_0x3e1deb=_0x21859c;var _0x3f196f={'type':db[_0xdb54('0x4e')]['TEXT'],'transaction':_0x8684c};switch(_0x314dc6['body']['type']){case _0xdb54('0x4f'):_0x3f196f['type']=db['Sequelize'][_0xdb54('0x50')];break;case _0xdb54('0x51'):_0x3f196f[_0xdb54('0x31')]=db[_0xdb54('0x4e')][_0xdb54('0x52')];break;case _0xdb54('0x53'):_0x3f196f['type']=db[_0xdb54('0x4e')][_0xdb54('0x54')];_0x3f196f[_0xdb54('0x55')]=![];break;default:}return db[_0xdb54('0x56')]['queryInterface'][_0xdb54('0x57')](_0xdb54('0x58'),util[_0xdb54('0x59')]('cf_%d',_0x3e1deb['id']),_0x3f196f);})['then'](function(){return _0x3e1deb;});})['then'](respondWithResult(_0x3a4ad0,0xc9))[_0xdb54('0x4a')](handleError(_0x3a4ad0,null));}; \ No newline at end of file +var _0xcbde=['papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','then','destroy','error','stack','name','send','index','CmCustomField','rawAttributes','fieldName','type','model','differenceBy','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','update','body','create','sequelize','transaction','Sequelize','TEXT','text','INTEGER','switch','BOOLEAN','addColumn','cm_contacts','cf_%d','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xcbde,0x141));var _0xecbd=function(_0x157d43,_0x3edb8d){_0x157d43=_0x157d43-0x0;var _0x480140=_0xcbde[_0x157d43];return _0x480140;};'use strict';var emlformat=require(_0xecbd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xecbd('0x1'));var jsonpatch=require(_0xecbd('0x2'));var rp=require(_0xecbd('0x3'));var moment=require(_0xecbd('0x4'));var BPromise=require(_0xecbd('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xecbd('0x6'));var sox=require(_0xecbd('0x7'));var csv=require('to-csv');var ejs=require(_0xecbd('0x8'));var fs=require('fs');var fs_extra=require(_0xecbd('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xecbd('0xa'));var jsforce=require(_0xecbd('0xb'));var deskjs=require(_0xecbd('0xc'));var toCsv=require(_0xecbd('0xd'));var querystring=require(_0xecbd('0xe'));var Papa=require(_0xecbd('0xf'));var Redis=require('ioredis');var authService=require(_0xecbd('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xecbd('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xecbd('0x12'));var utils=require('../../config/utils');var config=require(_0xecbd('0x13'));var licenseUtil=require(_0xecbd('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c6429,_0x444a88){_0x444a88=_0x444a88||0xcc;return function(_0x447856){if(_0x447856){return _0x3c6429[_0xecbd('0x15')](_0x444a88);}return _0x3c6429[_0xecbd('0x16')](_0x444a88)[_0xecbd('0x17')]();};}function respondWithResult(_0x1f4122,_0xd9295c){_0xd9295c=_0xd9295c||0xc8;return function(_0x244e8f){if(_0x244e8f){return _0x1f4122['status'](_0xd9295c)[_0xecbd('0x18')](_0x244e8f);}};}function respondWithFilteredResult(_0x1607ec,_0x2cc3f0){return function(_0x3805a){if(_0x3805a){var _0x1ea87a=typeof _0x2cc3f0[_0xecbd('0x19')]===_0xecbd('0x1a')&&typeof _0x2cc3f0[_0xecbd('0x1b')]===_0xecbd('0x1a');var _0x3896ca=_0x3805a['count'];var _0x200782=_0x1ea87a?0x0:_0x2cc3f0['offset'];var _0x116cfd=_0x1ea87a?_0x3805a[_0xecbd('0x1c')]:_0x2cc3f0[_0xecbd('0x19')]+_0x2cc3f0[_0xecbd('0x1b')];var _0x3131b2;if(_0x116cfd>=_0x3896ca){_0x116cfd=_0x3896ca;_0x3131b2=0xc8;}else{_0x3131b2=0xce;}_0x1607ec[_0xecbd('0x16')](_0x3131b2);return _0x1607ec[_0xecbd('0x1d')]('Content-Range',_0x200782+'-'+_0x116cfd+'/'+_0x3896ca)[_0xecbd('0x18')](_0x3805a);}return null;};}function patchUpdates(_0x2a3166){return function(_0x3cde92){try{jsonpatch[_0xecbd('0x1e')](_0x3cde92,_0x2a3166,!![]);}catch(_0x342c41){return BPromise['reject'](_0x342c41);}return _0x3cde92[_0xecbd('0x1f')]();};}function saveUpdates(_0x3ab72d,_0x11b003){return function(_0x257000){if(_0x257000){return _0x257000['update'](_0x3ab72d)[_0xecbd('0x20')](function(_0x47b0cc){return _0x47b0cc;});}return null;};}function removeEntity(_0x190cab,_0x3b66ed){return function(_0x292cce){if(_0x292cce){return _0x292cce[_0xecbd('0x21')]()['then'](function(){_0x190cab['status'](0xcc)[_0xecbd('0x17')]();});}};}function handleEntityNotFound(_0x138630,_0x28285a){return function(_0x407027){if(!_0x407027){_0x138630['sendStatus'](0x194);}return _0x407027;};}function handleError(_0xfb307e,_0x184118){_0x184118=_0x184118||0x1f4;return function(_0x1c05d9){logger[_0xecbd('0x22')](_0x1c05d9[_0xecbd('0x23')]);if(_0x1c05d9[_0xecbd('0x24')]){delete _0x1c05d9[_0xecbd('0x24')];}_0xfb307e[_0xecbd('0x16')](_0x184118)[_0xecbd('0x25')](_0x1c05d9);};}exports[_0xecbd('0x26')]=function(_0x1a237f,_0x3641d6){var _0x370b52={},_0x4950d6={},_0x56597d={'count':0x0,'rows':[]};var _0x549988=_['map'](db[_0xecbd('0x27')][_0xecbd('0x28')],function(_0x58682d){return{'name':_0x58682d[_0xecbd('0x29')],'type':_0x58682d[_0xecbd('0x2a')]['key']};});_0x4950d6[_0xecbd('0x2b')]=_[_0xecbd('0x2c')](_[_0xecbd('0x2d')](_0x549988,'name'),[_0xecbd('0x24')]);_0x4950d6[_0xecbd('0x2e')]=_[_0xecbd('0x2f')](_0x1a237f[_0xecbd('0x2e')]);_0x4950d6[_0xecbd('0x30')]=_[_0xecbd('0x31')](_0x4950d6[_0xecbd('0x2b')],_0x4950d6[_0xecbd('0x2e')]);_0x370b52[_0xecbd('0x32')]=_[_0xecbd('0x31')](_0x4950d6[_0xecbd('0x2b')],qs['fields'](_0x1a237f[_0xecbd('0x2e')][_0xecbd('0x33')]));_0x370b52['attributes']=_0x370b52['attributes'][_0xecbd('0x34')]?_0x370b52[_0xecbd('0x32')]:_0x4950d6[_0xecbd('0x2b')];if(!_0x1a237f[_0xecbd('0x2e')][_0xecbd('0x35')]('nolimit')){_0x370b52[_0xecbd('0x1b')]=qs[_0xecbd('0x1b')](_0x1a237f['query'][_0xecbd('0x1b')]);_0x370b52[_0xecbd('0x19')]=qs[_0xecbd('0x19')](_0x1a237f[_0xecbd('0x2e')][_0xecbd('0x19')]);}_0x370b52[_0xecbd('0x36')]=qs[_0xecbd('0x37')](_0x1a237f[_0xecbd('0x2e')]['sort']);_0x370b52['where']=qs[_0xecbd('0x30')](_[_0xecbd('0x38')](_0x1a237f[_0xecbd('0x2e')],_0x4950d6[_0xecbd('0x30')]),_0x549988);if(_0x1a237f[_0xecbd('0x2e')][_0xecbd('0x39')]){_0x370b52[_0xecbd('0x3a')]=_[_0xecbd('0x3b')](_0x370b52[_0xecbd('0x3a')],{'$or':_[_0xecbd('0x2d')](_0x549988,function(_0x16c212){if(_0x16c212['type']!==_0xecbd('0x3c')){var _0x4ace42={};_0x4ace42[_0x16c212[_0xecbd('0x24')]]={'$like':'%'+_0x1a237f[_0xecbd('0x2e')]['filter']+'%'};return _0x4ace42;}})});}_0x370b52=_[_0xecbd('0x3b')]({},_0x370b52,_0x1a237f[_0xecbd('0x3d')]);var _0x271e39={'where':_0x370b52[_0xecbd('0x3a')]};return db[_0xecbd('0x27')]['count'](_0x271e39)[_0xecbd('0x20')](function(_0x19fdb4){_0x56597d[_0xecbd('0x1c')]=_0x19fdb4;if(_0x1a237f[_0xecbd('0x2e')][_0xecbd('0x3e')]){_0x370b52[_0xecbd('0x3f')]=[{'all':!![]}];}return db[_0xecbd('0x27')][_0xecbd('0x40')](_0x370b52);})[_0xecbd('0x20')](function(_0x2d99b2){_0x56597d[_0xecbd('0x41')]=_0x2d99b2;return _0x56597d;})[_0xecbd('0x20')](respondWithFilteredResult(_0x3641d6,_0x370b52))[_0xecbd('0x42')](handleError(_0x3641d6,null));};exports[_0xecbd('0x43')]=function(_0x13daf6,_0x3ba0cc){var _0xb09f76={'raw':!![],'where':{'id':_0x13daf6[_0xecbd('0x44')]['id']}},_0x3b5c61={};_0x3b5c61[_0xecbd('0x2b')]=_[_0xecbd('0x2f')](db['CmCustomField']['rawAttributes']);_0x3b5c61['query']=_[_0xecbd('0x2f')](_0x13daf6[_0xecbd('0x2e')]);_0x3b5c61[_0xecbd('0x30')]=_[_0xecbd('0x31')](_0x3b5c61[_0xecbd('0x2b')],_0x3b5c61[_0xecbd('0x2e')]);_0xb09f76['attributes']=_[_0xecbd('0x31')](_0x3b5c61[_0xecbd('0x2b')],qs[_0xecbd('0x33')](_0x13daf6[_0xecbd('0x2e')]['fields']));_0xb09f76['attributes']=_0xb09f76[_0xecbd('0x32')][_0xecbd('0x34')]?_0xb09f76[_0xecbd('0x32')]:_0x3b5c61[_0xecbd('0x2b')];if(_0x13daf6['query'][_0xecbd('0x3e')]){_0xb09f76[_0xecbd('0x3f')]=[{'all':!![]}];}_0xb09f76=_['merge']({},_0xb09f76,_0x13daf6['options']);return db[_0xecbd('0x27')][_0xecbd('0x45')](_0xb09f76)['then'](handleEntityNotFound(_0x3ba0cc,null))['then'](respondWithResult(_0x3ba0cc,null))[_0xecbd('0x42')](handleError(_0x3ba0cc,null));};exports[_0xecbd('0x46')]=function(_0x42b8c8,_0x48acb5){if(_0x42b8c8['body']['id']){delete _0x42b8c8[_0xecbd('0x47')]['id'];}return db[_0xecbd('0x27')][_0xecbd('0x45')]({'where':{'id':_0x42b8c8[_0xecbd('0x44')]['id']}})[_0xecbd('0x20')](handleEntityNotFound(_0x48acb5,null))['then'](saveUpdates(_0x42b8c8['body'],null))[_0xecbd('0x20')](respondWithResult(_0x48acb5,null))[_0xecbd('0x42')](handleError(_0x48acb5,null));};exports[_0xecbd('0x21')]=function(_0xa4e33f,_0x1177cb){return db[_0xecbd('0x27')][_0xecbd('0x45')]({'where':{'id':_0xa4e33f[_0xecbd('0x44')]['id']}})[_0xecbd('0x20')](handleEntityNotFound(_0x1177cb,null))['then'](removeEntity(_0x1177cb,null))['catch'](handleError(_0x1177cb,null));};exports[_0xecbd('0x48')]=function(_0x5a4c1e,_0x24f065){var _0x4cccfc;return db[_0xecbd('0x49')][_0xecbd('0x4a')](function(_0x3595c6){return db[_0xecbd('0x27')][_0xecbd('0x48')](_0x5a4c1e['body'],{'transaction':_0x3595c6})[_0xecbd('0x20')](function(_0x15a97b){_0x4cccfc=_0x15a97b;var _0xf27e0c={'type':db[_0xecbd('0x4b')][_0xecbd('0x4c')],'transaction':_0x3595c6};switch(_0x5a4c1e['body'][_0xecbd('0x2a')]){case _0xecbd('0x4d'):_0xf27e0c[_0xecbd('0x2a')]=db['Sequelize']['TEXT'];break;case'number':_0xf27e0c[_0xecbd('0x2a')]=db[_0xecbd('0x4b')][_0xecbd('0x4e')];break;case _0xecbd('0x4f'):_0xf27e0c[_0xecbd('0x2a')]=db[_0xecbd('0x4b')][_0xecbd('0x50')];_0xf27e0c['defaultValue']=![];break;default:}return db['sequelize']['queryInterface'][_0xecbd('0x51')](_0xecbd('0x52'),util['format'](_0xecbd('0x53'),_0x4cccfc['id']),_0xf27e0c);})[_0xecbd('0x20')](function(){return _0x4cccfc;});})[_0xecbd('0x20')](respondWithResult(_0x24f065,0xc9))['catch'](handleError(_0x24f065,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index ba843e8..cedb9c4 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 _0xf22a=['define','cm_custom_fields','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4b13a4,_0xb9fa20){var _0x501041=function(_0x428b13){while(--_0x428b13){_0x4b13a4['push'](_0x4b13a4['shift']());}};_0x501041(++_0xb9fa20);}(_0xf22a,0x1ec));var _0xaf22=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xf22a[_0xdea41a];return _0x15d0d8;};'use strict';var _=require(_0xaf22('0x0'));var util=require('util');var logger=require(_0xaf22('0x1'))(_0xaf22('0x2'));var moment=require(_0xaf22('0x3'));var BPromise=require(_0xaf22('0x4'));var rp=require(_0xaf22('0x5'));var fs=require('fs');var path=require(_0xaf22('0x6'));var rimraf=require(_0xaf22('0x7'));var config=require('../../config/environment');var attributes=require('./cmCustomField.attributes');module['exports']=function(_0x2d0319,_0x119d0e){return _0x2d0319[_0xaf22('0x8')]('CmCustomField',attributes,{'tableName':_0xaf22('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdcd2=['./cmCustomField.attributes','exports','CmCustomField','cm_custom_fields','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x4e9c26,_0xad8b46){var _0x59dda3=function(_0x27ee63){while(--_0x27ee63){_0x4e9c26['push'](_0x4e9c26['shift']());}};_0x59dda3(++_0xad8b46);}(_0xdcd2,0x160));var _0x2dcd=function(_0x1a39fa,_0x389dd0){_0x1a39fa=_0x1a39fa-0x0;var _0x4a24b3=_0xdcd2[_0x1a39fa];return _0x4a24b3;};'use strict';var _=require(_0x2dcd('0x0'));var util=require(_0x2dcd('0x1'));var logger=require(_0x2dcd('0x2'))(_0x2dcd('0x3'));var moment=require('moment');var BPromise=require(_0x2dcd('0x4'));var rp=require(_0x2dcd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2dcd('0x6'));var config=require(_0x2dcd('0x7'));var attributes=require(_0x2dcd('0x8'));module[_0x2dcd('0x9')]=function(_0x387bfc,_0xf8fa65){return _0x387bfc['define'](_0x2dcd('0xa'),attributes,{'tableName':_0x2dcd('0xb'),'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 99f14e7..72c21ed 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 _0x2455=['rpc','../../config/environment','jayson/promise','client','request','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x1116ac,_0xcbe059){var _0x3e806b=function(_0x33b585){while(--_0x33b585){_0x1116ac['push'](_0x1116ac['shift']());}};_0x3e806b(++_0xcbe059);}(_0x2455,0x19c));var _0x5245=function(_0x5e7979,_0x4175c0){_0x5e7979=_0x5e7979-0x0;var _0x50f569=_0x2455[_0x5e7979];return _0x50f569;};'use strict';var _=require(_0x5245('0x0'));var util=require(_0x5245('0x1'));var moment=require(_0x5245('0x2'));var BPromise=require(_0x5245('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5245('0x4'))['db'];var utils=require(_0x5245('0x5'));var logger=require('../../config/logger')(_0x5245('0x6'));var config=require(_0x5245('0x7'));var jayson=require(_0x5245('0x8'));var client=jayson[_0x5245('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ab414,_0x1f32ea,_0x3159ac){return new BPromise(function(_0x2eb16f,_0x523331){return client[_0x5245('0xa')](_0x4ab414,_0x3159ac)['then'](function(_0x56199a){logger['info'](_0x5245('0xb'),_0x1f32ea,_0x5245('0xc'));logger[_0x5245('0xd')](_0x5245('0xe'),_0x1f32ea,_0x5245('0xc'),JSON[_0x5245('0xf')](_0x56199a));if(_0x56199a[_0x5245('0x10')]){if(_0x56199a[_0x5245('0x10')][_0x5245('0x11')]===0x1f4){logger[_0x5245('0x10')](_0x5245('0xb'),_0x1f32ea,_0x56199a[_0x5245('0x10')][_0x5245('0x12')]);return _0x523331(_0x56199a[_0x5245('0x10')][_0x5245('0x12')]);}logger['error'](_0x5245('0xb'),_0x1f32ea,_0x56199a[_0x5245('0x10')]['message']);return _0x2eb16f(_0x56199a[_0x5245('0x10')][_0x5245('0x12')]);}else{logger[_0x5245('0x13')]('CmCustomField,\x20%s,\x20%s',_0x1f32ea,_0x5245('0xc'));_0x2eb16f(_0x56199a[_0x5245('0x14')][_0x5245('0x12')]);}})[_0x5245('0x15')](function(_0x39ebed){logger[_0x5245('0x10')](_0x5245('0xb'),_0x1f32ea,_0x39ebed);_0x523331(_0x39ebed);});});} \ No newline at end of file +var _0x60b7=['../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmCustomField,\x20%s,\x20%s','catch','lodash','moment','bluebird','randomstring','../../config/utils'];(function(_0x347f37,_0x28dbae){var _0x284fd9=function(_0x35d133){while(--_0x35d133){_0x347f37['push'](_0x347f37['shift']());}};_0x284fd9(++_0x28dbae);}(_0x60b7,0x1ef));var _0x760b=function(_0x3cb530,_0x170e8c){_0x3cb530=_0x3cb530-0x0;var _0x4168ea=_0x60b7[_0x3cb530];return _0x4168ea;};'use strict';var _=require(_0x760b('0x0'));var util=require('util');var moment=require(_0x760b('0x1'));var BPromise=require(_0x760b('0x2'));var rs=require(_0x760b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x760b('0x4'));var logger=require(_0x760b('0x5'))('rpc');var config=require(_0x760b('0x6'));var jayson=require(_0x760b('0x7'));var client=jayson[_0x760b('0x8')][_0x760b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x52df65,_0x1abce5,_0x4de464){return new BPromise(function(_0xf23081,_0x293a1d){return client['request'](_0x52df65,_0x4de464)[_0x760b('0xa')](function(_0x1e95c4){logger[_0x760b('0xb')]('CmCustomField,\x20%s,\x20%s',_0x1abce5,_0x760b('0xc'));logger['debug'](_0x760b('0xd'),_0x1abce5,_0x760b('0xc'),JSON[_0x760b('0xe')](_0x1e95c4));if(_0x1e95c4[_0x760b('0xf')]){if(_0x1e95c4[_0x760b('0xf')][_0x760b('0x10')]===0x1f4){logger[_0x760b('0xf')]('CmCustomField,\x20%s,\x20%s',_0x1abce5,_0x1e95c4[_0x760b('0xf')][_0x760b('0x11')]);return _0x293a1d(_0x1e95c4[_0x760b('0xf')][_0x760b('0x11')]);}logger['error'](_0x760b('0x12'),_0x1abce5,_0x1e95c4['error']['message']);return _0xf23081(_0x1e95c4[_0x760b('0xf')][_0x760b('0x11')]);}else{logger[_0x760b('0xb')](_0x760b('0x12'),_0x1abce5,_0x760b('0xc'));_0xf23081(_0x1e95c4['result'][_0x760b('0x11')]);}})[_0x760b('0x13')](function(_0x3f10cb){logger[_0x760b('0xf')](_0x760b('0x12'),_0x1abce5,_0x3f10cb);_0x293a1d(_0x3f10cb);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index b33e5cd..393b07a 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 _0xb175=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','isAuthenticated','index','get','/:id','show','post','put'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0xb175,0x1a4));var _0x5b17=function(_0x34e506,_0x542966){_0x34e506=_0x34e506-0x0;var _0x298d4a=_0xb175[_0x34e506];return _0x298d4a;};'use strict';var multer=require(_0x5b17('0x0'));var util=require(_0x5b17('0x1'));var path=require(_0x5b17('0x2'));var timeout=require(_0x5b17('0x3'));var express=require('express');var router=express[_0x5b17('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmCustomField.controller');router['get']('/',auth[_0x5b17('0x5')](),controller[_0x5b17('0x6')]);router[_0x5b17('0x7')](_0x5b17('0x8'),auth[_0x5b17('0x5')](),controller[_0x5b17('0x9')]);router[_0x5b17('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5b17('0xb')]('/:id',auth[_0x5b17('0x5')](),controller[_0x5b17('0xc')]);router[_0x5b17('0xd')](_0x5b17('0x8'),auth[_0x5b17('0x5')](),controller[_0x5b17('0xe')]);module[_0x5b17('0xf')]=router; \ No newline at end of file +var _0xb491=['express','Router','../../components/auth/service','../../components/interaction/service','./cmCustomField.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x32fdcd,_0x457ce6){var _0xc5db8e=function(_0x5d10b3){while(--_0x5d10b3){_0x32fdcd['push'](_0x32fdcd['shift']());}};_0xc5db8e(++_0x457ce6);}(_0xb491,0x18c));var _0x1b49=function(_0x38f737,_0x54f685){_0x38f737=_0x38f737-0x0;var _0x7afda3=_0xb491[_0x38f737];return _0x7afda3;};'use strict';var multer=require(_0x1b49('0x0'));var util=require(_0x1b49('0x1'));var path=require(_0x1b49('0x2'));var timeout=require(_0x1b49('0x3'));var express=require(_0x1b49('0x4'));var router=express[_0x1b49('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1b49('0x6'));var interaction=require(_0x1b49('0x7'));var config=require('../../config/environment');var controller=require(_0x1b49('0x8'));router[_0x1b49('0x9')]('/',auth[_0x1b49('0xa')](),controller['index']);router[_0x1b49('0x9')]('/:id',auth[_0x1b49('0xa')](),controller[_0x1b49('0xb')]);router[_0x1b49('0xc')]('/',auth[_0x1b49('0xa')](),controller[_0x1b49('0xd')]);router[_0x1b49('0xe')](_0x1b49('0xf'),auth[_0x1b49('0xa')](),controller[_0x1b49('0x10')]);router[_0x1b49('0x11')](_0x1b49('0xf'),auth[_0x1b49('0xa')](),controller[_0x1b49('0x12')]);module[_0x1b49('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 21eb081..c9f7dc0 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 _0x307d=['contactListQueue','moment','exports','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED'];(function(_0x39036f,_0x284392){var _0x184dd1=function(_0x49d792){while(--_0x49d792){_0x39036f['push'](_0x39036f['shift']());}};_0x184dd1(++_0x284392);}(_0x307d,0x9a));var _0xd307=function(_0x44ee72,_0x5723bb){_0x44ee72=_0x44ee72-0x0;var _0x35cb71=_0x307d[_0x44ee72];return _0x35cb71;};'use strict';var moment=require(_0xd307('0x0'));var Sequelize=require('sequelize');module[_0xd307('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0xd307('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xd307('0x3')],'defaultValue':moment()[_0xd307('0x4')](_0xd307('0x5'))},'countbusyretry':{'type':Sequelize[_0xd307('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xd307('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xd307('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0xd307('0x6')](0x2)[_0xd307('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xd307('0x8')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xd307('0x8')},'UserId':{'type':Sequelize[_0xd307('0x6')]},'VoiceQueueId':{'type':Sequelize[_0xd307('0x6')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0xd307('0x6')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xd307('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xd307('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xd307('0x6')],'defaultValue':0x0},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':0x0}}; \ No newline at end of file +var _0xadc7=['DATE','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','exports','STRING','BOOLEAN'];(function(_0x47bb22,_0x5907b9){var _0x2be3c9=function(_0x26cc89){while(--_0x26cc89){_0x47bb22['push'](_0x47bb22['shift']());}};_0x2be3c9(++_0x5907b9);}(_0xadc7,0xd4));var _0x7adc=function(_0x31ead7,_0x2e9a7c){_0x31ead7=_0x31ead7-0x0;var _0x3516f0=_0xadc7[_0x31ead7];return _0x3516f0;};'use strict';var moment=require(_0x7adc('0x0'));var Sequelize=require('sequelize');module[_0x7adc('0x1')]={'phone':{'type':Sequelize[_0x7adc('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x7adc('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x7adc('0x4')],'defaultValue':moment()['format'](_0x7adc('0x5'))},'countbusyretry':{'type':Sequelize[_0x7adc('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x7adc('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x7adc('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x7adc('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0x7adc('0x6')](0x2)[_0x7adc('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x7adc('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x7adc('0x6')],'unique':_0x7adc('0x8')},'ListId':{'type':Sequelize[_0x7adc('0x6')],'unique':_0x7adc('0x8')},'UserId':{'type':Sequelize[_0x7adc('0x6')]},'VoiceQueueId':{'type':Sequelize[_0x7adc('0x6')],'unique':_0x7adc('0x8')},'CampaignId':{'type':Sequelize[_0x7adc('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0x7adc('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x7adc('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x7adc('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x7adc('0x6')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x7adc('0x6')],'allowNull':!![],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 1a27795..4bebd4a 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 _0xedd9=['count','set','apply','then','end','error','stack','send','index','map','CmHopper','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','concat','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$iLike','$overlap','$contains','$contained','$any','fields','attributes','length','hasOwnProperty','order','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','body','update','destroy','CampaignId','VoiceQueue','Campaign','VoiceQueueId','omit','dataValues','state','deleted','campaign','membername','user','deletedat','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','queue','CmContact','ContactId','lastName','isNil','firstName','finally','outbound','dialOrderByScheduledAt','sequelize','transaction','format','direction','prev','hopperIds','priority','ASC','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','LOCK','UPDATE','Contact','CmCompany','Company','CmList','Queue','dialActive','getOpenContacts','preview','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','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'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xedd9,0xfc));var _0x9edd=function(_0x52147f,_0x1b0a35){_0x52147f=_0x52147f-0x0;var _0x5554cf=_0xedd9[_0x52147f];return _0x5554cf;};'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')]);_0x2ae8dd[_0x9edd('0x31')]=_[_0x9edd('0x33')](_0x2ae8dd['filters'],[_0x9edd('0x34'),_0x9edd('0x35'),_0x9edd('0x36'),_0x9edd('0x37'),_0x9edd('0x38'),_0x9edd('0x39'),_0x9edd('0x3a'),_0x9edd('0x3b'),_0x9edd('0x3c'),_0x9edd('0x3d'),_0x9edd('0x3e'),_0x9edd('0x3f'),_0x9edd('0x40'),_0x9edd('0x41'),'$notLike',_0x9edd('0x42'),'$notILike',_0x9edd('0x41'),_0x9edd('0x43'),_0x9edd('0x44'),_0x9edd('0x45'),_0x9edd('0x46')]);_0x28cfae['attributes']=_[_0x9edd('0x32')](_0x2ae8dd[_0x9edd('0x2d')],qs[_0x9edd('0x47')](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x47')]));_0x28cfae[_0x9edd('0x48')]=_0x28cfae[_0x9edd('0x48')][_0x9edd('0x49')]?_0x28cfae[_0x9edd('0x48')]:_0x2ae8dd[_0x9edd('0x2d')];if(!_0x52746a['query'][_0x9edd('0x4a')]('nolimit')){_0x28cfae[_0x9edd('0x1d')]=qs['limit'](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x1d')]);_0x28cfae[_0x9edd('0x1b')]=qs['offset'](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x1b')]);}_0x28cfae[_0x9edd('0x4b')]=qs['sort'](_0x52746a[_0x9edd('0x2f')]['sort']);_0x28cfae[_0x9edd('0x4c')]=qs[_0x9edd('0x31')](_['pick'](_0x52746a[_0x9edd('0x2f')],_0x2ae8dd[_0x9edd('0x31')]),_0x5eccfb);if(_0x52746a[_0x9edd('0x2f')][_0x9edd('0x4d')]){_0x28cfae['where']=_[_0x9edd('0x4e')](_0x28cfae['where'],{'$or':_[_0x9edd('0x27')](_0x5eccfb,function(_0xc1e657){if(_0xc1e657['type']!==_0x9edd('0x4f')){var _0x49a128={};_0x49a128[_0xc1e657['name']]={'$like':'%'+_0x52746a[_0x9edd('0x2f')][_0x9edd('0x4d')]+'%'};return _0x49a128;}})});}_0x28cfae=_[_0x9edd('0x4e')]({},_0x28cfae,_0x52746a[_0x9edd('0x50')]);var _0x25e6ec={'where':_0x28cfae[_0x9edd('0x4c')]};return db[_0x9edd('0x28')][_0x9edd('0x1e')](_0x25e6ec)[_0x9edd('0x21')](function(_0x2b081a){_0x41af53[_0x9edd('0x1e')]=_0x2b081a;if(_0x52746a[_0x9edd('0x2f')][_0x9edd('0x51')]){_0x28cfae[_0x9edd('0x52')]=[{'all':!![]}];}return db[_0x9edd('0x28')]['findAll'](_0x28cfae);})[_0x9edd('0x21')](function(_0x2570e3){_0x41af53[_0x9edd('0x53')]=_0x2570e3;return _0x41af53;})[_0x9edd('0x21')](respondWithFilteredResult(_0x238b22,_0x28cfae))[_0x9edd('0x54')](handleError(_0x238b22,null));};exports[_0x9edd('0x55')]=function(_0x10d41e,_0x4e9ad1){var _0x4a4656={'raw':!![],'where':{'id':_0x10d41e[_0x9edd('0x56')]['id']}},_0x4bc7a1={};_0x4bc7a1['model']=_[_0x9edd('0x30')](db[_0x9edd('0x28')][_0x9edd('0x29')]);_0x4bc7a1[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x10d41e['query']);_0x4bc7a1[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x4bc7a1[_0x9edd('0x2d')],_0x4bc7a1['query']);_0x4a4656[_0x9edd('0x48')]=_[_0x9edd('0x32')](_0x4bc7a1[_0x9edd('0x2d')],qs[_0x9edd('0x47')](_0x10d41e[_0x9edd('0x2f')][_0x9edd('0x47')]));_0x4a4656['attributes']=_0x4a4656[_0x9edd('0x48')][_0x9edd('0x49')]?_0x4a4656['attributes']:_0x4bc7a1[_0x9edd('0x2d')];if(_0x10d41e[_0x9edd('0x2f')]['includeAll']){_0x4a4656[_0x9edd('0x52')]=[{'all':!![]}];}_0x4a4656=_[_0x9edd('0x4e')]({},_0x4a4656,_0x10d41e[_0x9edd('0x50')]);return db['CmHopper'][_0x9edd('0x57')](_0x4a4656)[_0x9edd('0x21')](handleEntityNotFound(_0x4e9ad1,null))[_0x9edd('0x21')](respondWithResult(_0x4e9ad1,null))[_0x9edd('0x54')](handleError(_0x4e9ad1,null));};exports['create']=function(_0x446443,_0x527727){return db[_0x9edd('0x28')]['create'](_0x446443[_0x9edd('0x58')],{})[_0x9edd('0x21')](respondWithResult(_0x527727,0xc9))['catch'](handleError(_0x527727,null));};exports[_0x9edd('0x59')]=function(_0x4e2aaf,_0x336494){if(_0x4e2aaf[_0x9edd('0x58')]['id']){delete _0x4e2aaf[_0x9edd('0x58')]['id'];}return db[_0x9edd('0x28')][_0x9edd('0x57')]({'where':{'id':_0x4e2aaf[_0x9edd('0x56')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x336494,null))[_0x9edd('0x21')](saveUpdates(_0x4e2aaf[_0x9edd('0x58')],null))[_0x9edd('0x21')](respondWithResult(_0x336494,null))[_0x9edd('0x54')](handleError(_0x336494,null));};exports['describe']=function(_0x161bea,_0xf617e3){return db[_0x9edd('0x28')]['describe']()[_0x9edd('0x21')](respondWithResult(_0xf617e3,null))['catch'](handleError(_0xf617e3,null));};exports['destroy']=function(_0x54ecfa,_0x1348a7){var _0x45f47c;var _0x366316=_0x54ecfa[_0x9edd('0x56')]['id'];return db['CmHopper']['find']({'where':{'id':_0x54ecfa['params']['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x1348a7,null))[_0x9edd('0x21')](function(_0xd5090a){if(_0xd5090a){return _0xd5090a[_0x9edd('0x5a')]()[_0x9edd('0x21')](function(_0x41ec97){return _0x41ec97;});}})[_0x9edd('0x21')](function(_0x1e3087){_0x45f47c=_0x1e3087;if(_0x1e3087){if(_0x1e3087['VoiceQueueId']||_0x1e3087[_0x9edd('0x5b')]){return db[_0x1e3087['VoiceQueueId']?_0x9edd('0x5c'):_0x9edd('0x5d')]['find']({'where':{'id':_0x1e3087[_0x9edd('0x5e')]?_0x1e3087[_0x9edd('0x5e')]:_0x1e3087[_0x9edd('0x5b')]},'attributes':['id','name'],'raw':!![]});}}})[_0x9edd('0x21')](function(_0x2e1ce3){var _0x430eb4={};if(_0x2e1ce3){_[_0x9edd('0x4e')](_0x430eb4,_[_0x9edd('0x5f')](_0x45f47c[_0x9edd('0x60')],['createdAt','updatedAt','id']));_0x430eb4[_0x9edd('0x61')]=0x15;_0x430eb4['statedesc']=_0x9edd('0x62');_0x430eb4[_0x9edd('0x63')]=_0x2e1ce3[_0x9edd('0x2e')];_0x430eb4[_0x9edd('0x64')]=_0x54ecfa['user'][_0x9edd('0x2e')];_0x430eb4['UserId']=_0x54ecfa[_0x9edd('0x65')]['id'];_0x430eb4[_0x9edd('0x62')]=!![];_0x430eb4[_0x9edd('0x66')]=moment()['format'](_0x9edd('0x67'));_0x430eb4['calleridnum']=_0x45f47c[_0x9edd('0x68')];_0x430eb4[_0x9edd('0x69')]=_0x45f47c['VoiceQueueId']?_0x9edd('0x6a'):'ivr';return db[_0x9edd('0x6b')][_0x9edd('0x57')]({'where':{'id':_0x430eb4[_0x9edd('0x6c')]},'attributes':['firstName',_0x9edd('0x6d')]})[_0x9edd('0x21')](function(_0x45c17d){if(!_[_0x9edd('0x6e')](_0x1348a7)&&!_[_0x9edd('0x6e')](_0x45c17d['firstName'])){_0x430eb4['calleridname']=_0x45c17d[_0x9edd('0x6f')];if(!_[_0x9edd('0x6e')](_0x45c17d['lastName'])){_0x430eb4['calleridname']+='\x20'+_0x45c17d['lastName'];}}})[_0x9edd('0x70')](function(){return db['CmHopperFinal']['create'](_0x430eb4);});}})[_0x9edd('0x21')](function(_0x32ff46){return db['CmHopperAdditionalPhone'][_0x9edd('0x5a')]({'where':{'CmHopperId':_0x366316}});})[_0x9edd('0x21')](function(){return _0x1348a7[_0x9edd('0x19')](0xcc)['end']();})[_0x9edd('0x54')](handleError(_0x1348a7,null));};exports['getPreview']=function(_0x37b018,_0x18d1a0,_0x4c8d06){var _0x1f80c4=[];return db[_0x9edd('0x6b')]['describe']()[_0x9edd('0x21')](function(_0x475dc3){_0x1f80c4=_[_0x9edd('0x30')](_0x475dc3);return _0x37b018[_0x9edd('0x65')]['getVoiceQueues']({'where':{'type':_0x9edd('0x71'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x9edd('0x72')],'raw':!![]});})[_0x9edd('0x21')](function(_0xf6c8aa){if(_0xf6c8aa&&_0xf6c8aa['length']){return db[_0x9edd('0x73')][_0x9edd('0x74')](function(_0x130dba){var _0x383cb9={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x9edd('0x75')](_0x9edd('0x67'))},'VoiceQueueId':{'$in':_[_0x9edd('0x27')](_0xf6c8aa,'id')},'$or':[{'UserId':null},{'UserId':_0x37b018['user']['id']}]};var _0x5e29d0=[];if(_0x37b018[_0x9edd('0x58')][_0x9edd('0x76')]&&_0x37b018[_0x9edd('0x58')][_0x9edd('0x76')]===_0x9edd('0x77')){if(!_['isEmpty'](_0x37b018[_0x9edd('0x58')][_0x9edd('0x78')])){_0x383cb9['id']={'$in':_0x37b018[_0x9edd('0x58')]['hopperIds']};}_0x5e29d0=[[_0x9edd('0x79'),_0x9edd('0x7a')],['scheduledAt',_0xf6c8aa[0x0][_0x9edd('0x72')]===_0x9edd('0x7a')?'DESC':_0x9edd('0x7a')],db[_0x9edd('0x73')]['literal'](_0x9edd('0x7b')),['id','DESC']];}else{if(!_['isEmpty'](_0x37b018[_0x9edd('0x58')][_0x9edd('0x78')])){_0x383cb9['id']={'$notIn':_0x37b018[_0x9edd('0x58')]['hopperIds']};}_0x5e29d0=[[_0x9edd('0x79'),_0x9edd('0x7c')],['scheduledAt',_0xf6c8aa[0x0][_0x9edd('0x72')]],db[_0x9edd('0x73')][_0x9edd('0x7d')](_0x9edd('0x7e')),['id','ASC']];}return db['CmHopper'][_0x9edd('0x7f')]({'attributes':['id','scheduledat',_0x9edd('0x68')],'where':_0x383cb9,'order':_0x5e29d0,'transaction':_0x130dba,'lock':_0x130dba[_0x9edd('0x80')][_0x9edd('0x81')],'include':[{'model':db[_0x9edd('0x6b')],'as':_0x9edd('0x82'),'attributes':_0x1f80c4,'include':[{'model':db[_0x9edd('0x83')],'as':_0x9edd('0x84'),'attributes':['id',_0x9edd('0x2e')]}]},{'model':db[_0x9edd('0x85')],'as':'List','attributes':['id',_0x9edd('0x2e')]},{'model':db[_0x9edd('0x5c')],'as':_0x9edd('0x86'),'attributes':['id',_0x9edd('0x2e'),_0x9edd('0x87')]}]})[_0x9edd('0x21')](function(_0x14fa8a){if(_0x14fa8a){return _0x14fa8a['update']({'UserId':_0x37b018[_0x9edd('0x65')]['id']},{'transaction':_0x130dba});}});});}})[_0x9edd('0x21')](handleEntityNotFound(_0x18d1a0,null))['then'](respondWithResult(_0x18d1a0,null))[_0x9edd('0x54')](handleError(_0x18d1a0,null));};exports[_0x9edd('0x88')]=function(_0x57231c,_0x304e56,_0x3d6d7a){return _0x57231c[_0x9edd('0x65')]['getVoiceQueues']({'where':{'type':_0x9edd('0x71'),'dialActive':!![],'dialMethod':_0x9edd('0x89')},'attributes':['id'],'raw':!![]})[_0x9edd('0x21')](function(_0x5a7de3){if(_0x5a7de3&&_0x5a7de3['length']){return db['CmHopper']['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x9edd('0x75')](_0x9edd('0x67'))},'VoiceQueueId':{'$in':_[_0x9edd('0x27')](_0x5a7de3,'id')},'$or':[{'UserId':null},{'UserId':_0x57231c['user']['id']}]}});}return 0x0;})['then'](function(_0x49dc1d){if(!_[_0x9edd('0x6e')](_0x49dc1d)&&_[_0x9edd('0x8a')](_0x49dc1d)){return _0x304e56[_0x9edd('0x19')](0xc8)[_0x9edd('0x1a')]({'contacts':_0x49dc1d});}else{logger[_0x9edd('0x23')](_0x9edd('0x8b'),_0x9edd('0x88'),0x194,_0x9edd('0x8c'));_0x304e56[_0x9edd('0x18')](0x194);}})[_0x9edd('0x54')](handleError(_0x304e56,null));}; \ No newline at end of file +var _0x4b84=['Contact','CmCompany','Company','List','Queue','preview','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','sendStatus','eml-format','rimraf','request-promise','mustache','util','path','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','concat','$and','$or','$gt','$lt','$lte','$ne','$eq','$not','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','CmHopper','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','UserId','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','queue','ivr','ContactId','firstName','isNil','calleridname','lastName','finally','CmHopperAdditionalPhone','getPreview','CmContact','getVoiceQueues','outbound','dialOrderByScheduledAt','sequelize','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE'];(function(_0x1894e7,_0x1253e6){var _0x5e857f=function(_0x1b47c3){while(--_0x1b47c3){_0x1894e7['push'](_0x1894e7['shift']());}};_0x5e857f(++_0x1253e6);}(_0x4b84,0x1cc));var _0x44b8=function(_0x1cd674,_0x8d3638){_0x1cd674=_0x1cd674-0x0;var _0x27928f=_0x4b84[_0x1cd674];return _0x27928f;};'use strict';var emlformat=require(_0x44b8('0x0'));var rimraf=require(_0x44b8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x44b8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x44b8('0x3'));var util=require(_0x44b8('0x4'));var path=require(_0x44b8('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x44b8('0x6'));var _=require('lodash');var squel=require(_0x44b8('0x7'));var crypto=require('crypto');var jsforce=require(_0x44b8('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x44b8('0x9'));var Papa=require(_0x44b8('0xa'));var Redis=require(_0x44b8('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x44b8('0xc'));var as=require(_0x44b8('0xd'));var hardwareService=require(_0x44b8('0xe'));var logger=require(_0x44b8('0xf'))(_0x44b8('0x10'));var utils=require(_0x44b8('0x11'));var config=require(_0x44b8('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x44b8('0x13'))['db'];function respondWithStatusCode(_0x4301a6,_0x4bcc43){_0x4bcc43=_0x4bcc43||0xcc;return function(_0x194230){if(_0x194230){return _0x4301a6['sendStatus'](_0x4bcc43);}return _0x4301a6[_0x44b8('0x14')](_0x4bcc43)[_0x44b8('0x15')]();};}function respondWithResult(_0x4df670,_0x63e8f6){_0x63e8f6=_0x63e8f6||0xc8;return function(_0x4be54c){if(_0x4be54c){return _0x4df670['status'](_0x63e8f6)[_0x44b8('0x16')](_0x4be54c);}};}function respondWithFilteredResult(_0x2af0ad,_0x1722da){return function(_0x41ab46){if(_0x41ab46){var _0x5e52f2=typeof _0x1722da['offset']==='undefined'&&typeof _0x1722da[_0x44b8('0x17')]==='undefined';var _0x28ef36=_0x41ab46[_0x44b8('0x18')];var _0x55e258=_0x5e52f2?0x0:_0x1722da[_0x44b8('0x19')];var _0xe3de8f=_0x5e52f2?_0x41ab46['count']:_0x1722da[_0x44b8('0x19')]+_0x1722da[_0x44b8('0x17')];var _0x4b600f;if(_0xe3de8f>=_0x28ef36){_0xe3de8f=_0x28ef36;_0x4b600f=0xc8;}else{_0x4b600f=0xce;}_0x2af0ad[_0x44b8('0x14')](_0x4b600f);return _0x2af0ad[_0x44b8('0x1a')](_0x44b8('0x1b'),_0x55e258+'-'+_0xe3de8f+'/'+_0x28ef36)[_0x44b8('0x16')](_0x41ab46);}return null;};}function patchUpdates(_0x102ef9){return function(_0x369c09){try{jsonpatch[_0x44b8('0x1c')](_0x369c09,_0x102ef9,!![]);}catch(_0x9b0536){return BPromise[_0x44b8('0x1d')](_0x9b0536);}return _0x369c09[_0x44b8('0x1e')]();};}function saveUpdates(_0x1d642b,_0x14996c){return function(_0x48327e){if(_0x48327e){return _0x48327e[_0x44b8('0x1f')](_0x1d642b)[_0x44b8('0x20')](function(_0x416b34){return _0x416b34;});}return null;};}function removeEntity(_0x1418db,_0x305a5c){return function(_0x51a34a){if(_0x51a34a){return _0x51a34a[_0x44b8('0x21')]()['then'](function(){_0x1418db[_0x44b8('0x14')](0xcc)[_0x44b8('0x15')]();});}};}function handleEntityNotFound(_0x25a0c1,_0x47689e){return function(_0x230a3d){if(!_0x230a3d){_0x25a0c1['sendStatus'](0x194);}return _0x230a3d;};}function handleError(_0x474f01,_0x502acf){_0x502acf=_0x502acf||0x1f4;return function(_0x41d673){logger[_0x44b8('0x22')](_0x41d673['stack']);if(_0x41d673[_0x44b8('0x23')]){delete _0x41d673[_0x44b8('0x23')];}_0x474f01[_0x44b8('0x14')](_0x502acf)['send'](_0x41d673);};}exports[_0x44b8('0x24')]=function(_0x242342,_0x53d9c7){var _0x2e0174={},_0x4a182d={},_0xfb0028={'count':0x0,'rows':[]};var _0x5a544c=_['map'](db['CmHopper'][_0x44b8('0x25')],function(_0x29b18d){return{'name':_0x29b18d[_0x44b8('0x26')],'type':_0x29b18d[_0x44b8('0x27')][_0x44b8('0x28')]};});_0x4a182d[_0x44b8('0x29')]=_[_0x44b8('0x2a')](_0x5a544c,_0x44b8('0x23'));_0x4a182d[_0x44b8('0x2b')]=_[_0x44b8('0x2c')](_0x242342[_0x44b8('0x2b')]);_0x4a182d[_0x44b8('0x2d')]=_[_0x44b8('0x2e')](_0x4a182d['model'],_0x4a182d[_0x44b8('0x2b')]);_0x4a182d['filters']=_[_0x44b8('0x2f')](_0x4a182d[_0x44b8('0x2d')],[_0x44b8('0x30'),_0x44b8('0x31'),_0x44b8('0x32'),'$gte',_0x44b8('0x33'),_0x44b8('0x34'),_0x44b8('0x35'),_0x44b8('0x36'),_0x44b8('0x37'),'$between',_0x44b8('0x38'),_0x44b8('0x39'),_0x44b8('0x3a'),_0x44b8('0x3b'),_0x44b8('0x3c'),_0x44b8('0x3d'),_0x44b8('0x3e'),_0x44b8('0x3b'),_0x44b8('0x3f'),_0x44b8('0x40'),_0x44b8('0x41'),_0x44b8('0x42')]);_0x2e0174[_0x44b8('0x43')]=_[_0x44b8('0x2e')](_0x4a182d[_0x44b8('0x29')],qs[_0x44b8('0x44')](_0x242342[_0x44b8('0x2b')][_0x44b8('0x44')]));_0x2e0174[_0x44b8('0x43')]=_0x2e0174[_0x44b8('0x43')][_0x44b8('0x45')]?_0x2e0174[_0x44b8('0x43')]:_0x4a182d['model'];if(!_0x242342[_0x44b8('0x2b')][_0x44b8('0x46')]('nolimit')){_0x2e0174[_0x44b8('0x17')]=qs[_0x44b8('0x17')](_0x242342[_0x44b8('0x2b')][_0x44b8('0x17')]);_0x2e0174['offset']=qs[_0x44b8('0x19')](_0x242342[_0x44b8('0x2b')][_0x44b8('0x19')]);}_0x2e0174[_0x44b8('0x47')]=qs[_0x44b8('0x48')](_0x242342[_0x44b8('0x2b')][_0x44b8('0x48')]);_0x2e0174[_0x44b8('0x49')]=qs[_0x44b8('0x2d')](_[_0x44b8('0x4a')](_0x242342[_0x44b8('0x2b')],_0x4a182d[_0x44b8('0x2d')]),_0x5a544c);if(_0x242342[_0x44b8('0x2b')][_0x44b8('0x4b')]){_0x2e0174[_0x44b8('0x49')]=_[_0x44b8('0x4c')](_0x2e0174['where'],{'$or':_[_0x44b8('0x2a')](_0x5a544c,function(_0x43e43a){if(_0x43e43a[_0x44b8('0x27')]!=='VIRTUAL'){var _0xd424f8={};_0xd424f8[_0x43e43a[_0x44b8('0x23')]]={'$like':'%'+_0x242342[_0x44b8('0x2b')]['filter']+'%'};return _0xd424f8;}})});}_0x2e0174=_[_0x44b8('0x4c')]({},_0x2e0174,_0x242342[_0x44b8('0x4d')]);var _0x149d55={'where':_0x2e0174[_0x44b8('0x49')]};return db[_0x44b8('0x4e')]['count'](_0x149d55)['then'](function(_0x215f7b){_0xfb0028[_0x44b8('0x18')]=_0x215f7b;if(_0x242342[_0x44b8('0x2b')][_0x44b8('0x4f')]){_0x2e0174[_0x44b8('0x50')]=[{'all':!![]}];}return db[_0x44b8('0x4e')][_0x44b8('0x51')](_0x2e0174);})[_0x44b8('0x20')](function(_0x455fd6){_0xfb0028[_0x44b8('0x52')]=_0x455fd6;return _0xfb0028;})[_0x44b8('0x20')](respondWithFilteredResult(_0x53d9c7,_0x2e0174))[_0x44b8('0x53')](handleError(_0x53d9c7,null));};exports[_0x44b8('0x54')]=function(_0x1236c7,_0x149731){var _0x60eeb2={'raw':!![],'where':{'id':_0x1236c7[_0x44b8('0x55')]['id']}},_0xce06dc={};_0xce06dc[_0x44b8('0x29')]=_['keys'](db['CmHopper'][_0x44b8('0x25')]);_0xce06dc[_0x44b8('0x2b')]=_[_0x44b8('0x2c')](_0x1236c7[_0x44b8('0x2b')]);_0xce06dc[_0x44b8('0x2d')]=_[_0x44b8('0x2e')](_0xce06dc[_0x44b8('0x29')],_0xce06dc['query']);_0x60eeb2[_0x44b8('0x43')]=_['intersection'](_0xce06dc[_0x44b8('0x29')],qs[_0x44b8('0x44')](_0x1236c7[_0x44b8('0x2b')][_0x44b8('0x44')]));_0x60eeb2[_0x44b8('0x43')]=_0x60eeb2[_0x44b8('0x43')]['length']?_0x60eeb2[_0x44b8('0x43')]:_0xce06dc[_0x44b8('0x29')];if(_0x1236c7[_0x44b8('0x2b')][_0x44b8('0x4f')]){_0x60eeb2['include']=[{'all':!![]}];}_0x60eeb2=_[_0x44b8('0x4c')]({},_0x60eeb2,_0x1236c7[_0x44b8('0x4d')]);return db[_0x44b8('0x4e')][_0x44b8('0x56')](_0x60eeb2)[_0x44b8('0x20')](handleEntityNotFound(_0x149731,null))[_0x44b8('0x20')](respondWithResult(_0x149731,null))['catch'](handleError(_0x149731,null));};exports[_0x44b8('0x57')]=function(_0x450715,_0x2c5c27){return db[_0x44b8('0x4e')][_0x44b8('0x57')](_0x450715['body'],{})['then'](respondWithResult(_0x2c5c27,0xc9))[_0x44b8('0x53')](handleError(_0x2c5c27,null));};exports['update']=function(_0x2d9f89,_0x5785ef){if(_0x2d9f89[_0x44b8('0x58')]['id']){delete _0x2d9f89[_0x44b8('0x58')]['id'];}return db[_0x44b8('0x4e')][_0x44b8('0x56')]({'where':{'id':_0x2d9f89[_0x44b8('0x55')]['id']}})[_0x44b8('0x20')](handleEntityNotFound(_0x5785ef,null))[_0x44b8('0x20')](saveUpdates(_0x2d9f89['body'],null))[_0x44b8('0x20')](respondWithResult(_0x5785ef,null))[_0x44b8('0x53')](handleError(_0x5785ef,null));};exports[_0x44b8('0x59')]=function(_0x492be6,_0x20bcc8){return db[_0x44b8('0x4e')][_0x44b8('0x59')]()[_0x44b8('0x20')](respondWithResult(_0x20bcc8,null))['catch'](handleError(_0x20bcc8,null));};exports[_0x44b8('0x21')]=function(_0x308f7b,_0x4a6e55){var _0x3de425;var _0x19f22b=_0x308f7b[_0x44b8('0x55')]['id'];return db[_0x44b8('0x4e')][_0x44b8('0x56')]({'where':{'id':_0x308f7b['params']['id']}})['then'](handleEntityNotFound(_0x4a6e55,null))[_0x44b8('0x20')](function(_0x3154bc){if(_0x3154bc){return _0x3154bc[_0x44b8('0x21')]()[_0x44b8('0x20')](function(_0x765e45){return _0x765e45;});}})[_0x44b8('0x20')](function(_0x3c9534){_0x3de425=_0x3c9534;if(_0x3c9534){if(_0x3c9534[_0x44b8('0x5a')]||_0x3c9534[_0x44b8('0x5b')]){return db[_0x3c9534[_0x44b8('0x5a')]?_0x44b8('0x5c'):_0x44b8('0x5d')]['find']({'where':{'id':_0x3c9534[_0x44b8('0x5a')]?_0x3c9534[_0x44b8('0x5a')]:_0x3c9534[_0x44b8('0x5b')]},'attributes':['id',_0x44b8('0x23')],'raw':!![]});}}})[_0x44b8('0x20')](function(_0x1df915){var _0x426a6a={};if(_0x1df915){_[_0x44b8('0x4c')](_0x426a6a,_[_0x44b8('0x5e')](_0x3de425[_0x44b8('0x5f')],[_0x44b8('0x60'),_0x44b8('0x61'),'id']));_0x426a6a[_0x44b8('0x62')]=0x15;_0x426a6a[_0x44b8('0x63')]=_0x44b8('0x64');_0x426a6a[_0x44b8('0x65')]=_0x1df915[_0x44b8('0x23')];_0x426a6a[_0x44b8('0x66')]=_0x308f7b['user'][_0x44b8('0x23')];_0x426a6a[_0x44b8('0x67')]=_0x308f7b[_0x44b8('0x68')]['id'];_0x426a6a[_0x44b8('0x64')]=!![];_0x426a6a[_0x44b8('0x69')]=moment()[_0x44b8('0x6a')](_0x44b8('0x6b'));_0x426a6a['calleridnum']=_0x3de425[_0x44b8('0x6c')];_0x426a6a[_0x44b8('0x6d')]=_0x3de425['VoiceQueueId']?_0x44b8('0x6e'):_0x44b8('0x6f');return db['CmContact'][_0x44b8('0x56')]({'where':{'id':_0x426a6a[_0x44b8('0x70')]},'attributes':[_0x44b8('0x71'),'lastName']})[_0x44b8('0x20')](function(_0x5da64b){if(!_[_0x44b8('0x72')](_0x4a6e55)&&!_['isNil'](_0x5da64b[_0x44b8('0x71')])){_0x426a6a[_0x44b8('0x73')]=_0x5da64b[_0x44b8('0x71')];if(!_[_0x44b8('0x72')](_0x5da64b[_0x44b8('0x74')])){_0x426a6a[_0x44b8('0x73')]+='\x20'+_0x5da64b['lastName'];}}})[_0x44b8('0x75')](function(){return db['CmHopperFinal'][_0x44b8('0x57')](_0x426a6a);});}})[_0x44b8('0x20')](function(_0x4c1a7c){return db[_0x44b8('0x76')][_0x44b8('0x21')]({'where':{'CmHopperId':_0x19f22b}});})[_0x44b8('0x20')](function(){return _0x4a6e55[_0x44b8('0x14')](0xcc)[_0x44b8('0x15')]();})[_0x44b8('0x53')](handleError(_0x4a6e55,null));};exports[_0x44b8('0x77')]=function(_0x3d4a88,_0x3f9102,_0x11ad5b){var _0x41111f=[];return db[_0x44b8('0x78')]['describe']()[_0x44b8('0x20')](function(_0x4052a9){_0x41111f=_[_0x44b8('0x2c')](_0x4052a9);return _0x3d4a88['user'][_0x44b8('0x79')]({'where':{'type':_0x44b8('0x7a'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x44b8('0x7b')],'raw':!![]});})[_0x44b8('0x20')](function(_0xb89680){if(_0xb89680&&_0xb89680[_0x44b8('0x45')]){return db[_0x44b8('0x7c')]['transaction'](function(_0x445ed9){var _0x36b890={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x44b8('0x6a')](_0x44b8('0x6b'))},'VoiceQueueId':{'$in':_[_0x44b8('0x2a')](_0xb89680,'id')},'$or':[{'UserId':null},{'UserId':_0x3d4a88[_0x44b8('0x68')]['id']}]};var _0x3d7fb3=[];if(_0x3d4a88[_0x44b8('0x58')]['direction']&&_0x3d4a88[_0x44b8('0x58')][_0x44b8('0x7d')]===_0x44b8('0x7e')){if(!_[_0x44b8('0x7f')](_0x3d4a88['body']['hopperIds'])){_0x36b890['id']={'$in':_0x3d4a88['body'][_0x44b8('0x80')]};}_0x3d7fb3=[[_0x44b8('0x81'),_0x44b8('0x82')],[_0x44b8('0x83'),_0xb89680[0x0][_0x44b8('0x7b')]==='ASC'?_0x44b8('0x84'):'ASC'],db[_0x44b8('0x7c')][_0x44b8('0x85')](_0x44b8('0x86')),['id','DESC']];}else{if(!_['isEmpty'](_0x3d4a88[_0x44b8('0x58')][_0x44b8('0x80')])){_0x36b890['id']={'$notIn':_0x3d4a88[_0x44b8('0x58')]['hopperIds']};}_0x3d7fb3=[[_0x44b8('0x81'),_0x44b8('0x84')],[_0x44b8('0x83'),_0xb89680[0x0][_0x44b8('0x7b')]],db[_0x44b8('0x7c')]['literal'](_0x44b8('0x87')),['id',_0x44b8('0x82')]];}return db[_0x44b8('0x4e')][_0x44b8('0x88')]({'attributes':['id',_0x44b8('0x89'),'phone'],'where':_0x36b890,'order':_0x3d7fb3,'transaction':_0x445ed9,'lock':_0x445ed9[_0x44b8('0x8a')][_0x44b8('0x8b')],'include':[{'model':db[_0x44b8('0x78')],'as':_0x44b8('0x8c'),'attributes':_0x41111f,'include':[{'model':db[_0x44b8('0x8d')],'as':_0x44b8('0x8e'),'attributes':['id',_0x44b8('0x23')]}]},{'model':db['CmList'],'as':_0x44b8('0x8f'),'attributes':['id',_0x44b8('0x23')]},{'model':db['VoiceQueue'],'as':_0x44b8('0x90'),'attributes':['id',_0x44b8('0x23'),'dialActive']}]})[_0x44b8('0x20')](function(_0x5ddbc7){if(_0x5ddbc7){return _0x5ddbc7['update']({'UserId':_0x3d4a88[_0x44b8('0x68')]['id']},{'transaction':_0x445ed9});}});});}})[_0x44b8('0x20')](handleEntityNotFound(_0x3f9102,null))[_0x44b8('0x20')](respondWithResult(_0x3f9102,null))['catch'](handleError(_0x3f9102,null));};exports['getOpenContacts']=function(_0x5b82ec,_0x36334a,_0x225782){return _0x5b82ec[_0x44b8('0x68')][_0x44b8('0x79')]({'where':{'type':_0x44b8('0x7a'),'dialActive':!![],'dialMethod':_0x44b8('0x91')},'attributes':['id'],'raw':!![]})[_0x44b8('0x20')](function(_0x2c7497){if(_0x2c7497&&_0x2c7497['length']){return db[_0x44b8('0x4e')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x44b8('0x2a')](_0x2c7497,'id')},'$or':[{'UserId':null},{'UserId':_0x5b82ec['user']['id']}]}});}return 0x0;})[_0x44b8('0x20')](function(_0x1e37fd){if(!_[_0x44b8('0x72')](_0x1e37fd)&&_[_0x44b8('0x92')](_0x1e37fd)){return _0x36334a[_0x44b8('0x14')](0xc8)[_0x44b8('0x16')]({'contacts':_0x1e37fd});}else{logger[_0x44b8('0x22')](_0x44b8('0x93'),'getOpenContacts',0x194,_0x44b8('0x94'));_0x36334a[_0x44b8('0x95')](0x194);}})[_0x44b8('0x53')](handleError(_0x36334a,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 002cbd3..e412825 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 _0x90b1=['priority','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','define','CmHopper','cm_hopper','scheduledat','phone'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0x90b1,0x1bb));var _0x190b=function(_0x2c5315,_0x3696d8){_0x2c5315=_0x2c5315-0x0;var _0x934ff9=_0x90b1[_0x2c5315];return _0x934ff9;};'use strict';var _=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var logger=require(_0x190b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x190b('0x3'));var rp=require(_0x190b('0x4'));var fs=require('fs');var path=require(_0x190b('0x5'));var rimraf=require(_0x190b('0x6'));var config=require('../../config/environment');var attributes=require('./cmHopper.attributes');module['exports']=function(_0x5da9c1,_0x27ff8c){return _0x5da9c1[_0x190b('0x7')](_0x190b('0x8'),attributes,{'tableName':_0x190b('0x9'),'paranoid':![],'indexes':[{'name':_0x190b('0xa'),'fields':[_0x190b('0xa')]},{'name':_0x190b('0xb'),'fields':['phone']},{'name':_0x190b('0xc'),'fields':[_0x190b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0295=['define','scheduledat','phone','priority','lodash','api','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0x0295,0x1f0));var _0x5029=function(_0x59e9ff,_0x5080c3){_0x59e9ff=_0x59e9ff-0x0;var _0xa71d5e=_0x0295[_0x59e9ff];return _0xa71d5e;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5029('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5029('0x2'));var fs=require('fs');var path=require(_0x5029('0x3'));var rimraf=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var attributes=require(_0x5029('0x6'));module[_0x5029('0x7')]=function(_0x200217,_0x215955){return _0x200217[_0x5029('0x8')]('CmHopper',attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':'scheduledat','fields':[_0x5029('0x9')]},{'name':'phone','fields':[_0x5029('0xa')]},{'name':'priority','fields':[_0x5029('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index cd1b3db..534d3c3 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 _0x0b7c=['ShowCmHopper','CmHopper','find','then','CreateCmHopper','create','UpdateCmHopper','update','body','limit','DestroyCmHopper','destroy','GetContactDialer','describe','transaction','order','CmContact','Contact','keys','User','Agent','voicePause','length','push','includes','all','MoveContactManagedDialer','CountReScheduled','sequelize','literal','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','GetContactRecallMe','UserId','UPDATE','GetCmHopperPreview','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopper','findAll','options','raw','where','include','map','model','attributes'];(function(_0x12fb7a,_0x3a091c){var _0x2eec67=function(_0x5e9348){while(--_0x5e9348){_0x12fb7a['push'](_0x12fb7a['shift']());}};_0x2eec67(++_0x3a091c);}(_0x0b7c,0x184));var _0xc0b7=function(_0x112147,_0x4e692e){_0x112147=_0x112147-0x0;var _0x3ba744=_0x0b7c[_0x112147];return _0x3ba744;};'use strict';var _=require(_0xc0b7('0x0'));var util=require(_0xc0b7('0x1'));var moment=require('moment');var BPromise=require(_0xc0b7('0x2'));var rs=require(_0xc0b7('0x3'));var fs=require('fs');var Redis=require(_0xc0b7('0x4'));var db=require(_0xc0b7('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc0b7('0x6'));var config=require(_0xc0b7('0x7'));var jayson=require(_0xc0b7('0x8'));var client=jayson[_0xc0b7('0x9')][_0xc0b7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27404e,_0x1679ad,_0x2e7f6f){return new BPromise(function(_0x328b52,_0x18b48a){return client[_0xc0b7('0xb')](_0x27404e,_0x2e7f6f)['then'](function(_0x1c5600){logger[_0xc0b7('0xc')](_0xc0b7('0xd'),_0x1679ad,_0xc0b7('0xe'));logger[_0xc0b7('0xf')](_0xc0b7('0x10'),_0x1679ad,'request\x20sent',JSON[_0xc0b7('0x11')](_0x1c5600));if(_0x1c5600['error']){if(_0x1c5600[_0xc0b7('0x12')][_0xc0b7('0x13')]===0x1f4){logger[_0xc0b7('0x12')](_0xc0b7('0xd'),_0x1679ad,_0x1c5600[_0xc0b7('0x12')]['message']);return _0x18b48a(_0x1c5600[_0xc0b7('0x12')][_0xc0b7('0x14')]);}logger[_0xc0b7('0x12')](_0xc0b7('0xd'),_0x1679ad,_0x1c5600[_0xc0b7('0x12')][_0xc0b7('0x14')]);return _0x328b52(_0x1c5600[_0xc0b7('0x12')][_0xc0b7('0x14')]);}else{logger[_0xc0b7('0xc')]('CmHopper,\x20%s,\x20%s',_0x1679ad,'request\x20sent');_0x328b52(_0x1c5600[_0xc0b7('0x15')][_0xc0b7('0x14')]);}})[_0xc0b7('0x16')](function(_0x410608){logger[_0xc0b7('0x12')](_0xc0b7('0xd'),_0x1679ad,_0x410608);_0x18b48a(_0x410608);});});}exports[_0xc0b7('0x17')]=function(_0x1d46c5){var _0x58b772=this;return new Promise(function(_0x4d46f7,_0x5cfebc){return db['CmHopper'][_0xc0b7('0x18')]({'raw':_0x1d46c5[_0xc0b7('0x19')]?_0x1d46c5['options'][_0xc0b7('0x1a')]===undefined?!![]:![]:!![],'where':_0x1d46c5[_0xc0b7('0x19')]?_0x1d46c5[_0xc0b7('0x19')][_0xc0b7('0x1b')]||null:null,'attributes':_0x1d46c5['options']?_0x1d46c5[_0xc0b7('0x19')]['attributes']||null:null,'limit':_0x1d46c5[_0xc0b7('0x19')]?_0x1d46c5['options']['limit']||null:null,'include':_0x1d46c5[_0xc0b7('0x19')]?_0x1d46c5[_0xc0b7('0x19')][_0xc0b7('0x1c')]?_[_0xc0b7('0x1d')](_0x1d46c5[_0xc0b7('0x19')][_0xc0b7('0x1c')],function(_0x326ba7){return{'model':db[_0x326ba7[_0xc0b7('0x1e')]],'as':_0x326ba7['as'],'attributes':_0x326ba7['attributes'],'include':_0x326ba7[_0xc0b7('0x1c')]?_[_0xc0b7('0x1d')](_0x326ba7[_0xc0b7('0x1c')],function(_0x4ad7ec){return{'model':db[_0x4ad7ec['model']],'as':_0x4ad7ec['as'],'attributes':_0x4ad7ec[_0xc0b7('0x1f')],'include':_0x4ad7ec[_0xc0b7('0x1c')]?_['map'](_0x4ad7ec[_0xc0b7('0x1c')],function(_0x45b7fe){return{'model':db[_0x45b7fe[_0xc0b7('0x1e')]],'as':_0x45b7fe['as'],'attributes':_0x45b7fe[_0xc0b7('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x285004){logger['info'](_0xc0b7('0x17'),_0x1d46c5);logger[_0xc0b7('0xf')]('GetCmHopper',_0x1d46c5,JSON[_0xc0b7('0x11')](_0x285004));_0x4d46f7(_0x285004);})[_0xc0b7('0x16')](function(_0x5edf32){logger[_0xc0b7('0x12')](_0xc0b7('0x17'),_0x5edf32['message'],_0x1d46c5);_0x5cfebc(_0x58b772[_0xc0b7('0x12')](0x1f4,_0x5edf32[_0xc0b7('0x14')]));});});};exports[_0xc0b7('0x20')]=function(_0xb81d68){var _0x1e78f4=this;return new Promise(function(_0x2194bc,_0x2621a5){return db[_0xc0b7('0x21')][_0xc0b7('0x22')]({'raw':_0xb81d68[_0xc0b7('0x19')]?_0xb81d68[_0xc0b7('0x19')][_0xc0b7('0x1a')]===undefined?!![]:![]:!![],'where':_0xb81d68[_0xc0b7('0x19')]?_0xb81d68[_0xc0b7('0x19')][_0xc0b7('0x1b')]||null:null,'attributes':_0xb81d68[_0xc0b7('0x19')]?_0xb81d68[_0xc0b7('0x19')][_0xc0b7('0x1f')]||null:null,'include':_0xb81d68[_0xc0b7('0x19')]?_0xb81d68[_0xc0b7('0x19')]['include']?_[_0xc0b7('0x1d')](_0xb81d68['options'][_0xc0b7('0x1c')],function(_0x4e938d){return{'model':db[_0x4e938d[_0xc0b7('0x1e')]],'as':_0x4e938d['as'],'attributes':_0x4e938d['attributes'],'include':_0x4e938d[_0xc0b7('0x1c')]?_[_0xc0b7('0x1d')](_0x4e938d[_0xc0b7('0x1c')],function(_0x241ace){return{'model':db[_0x241ace[_0xc0b7('0x1e')]],'as':_0x241ace['as'],'attributes':_0x241ace['attributes'],'include':_0x241ace[_0xc0b7('0x1c')]?_[_0xc0b7('0x1d')](_0x241ace[_0xc0b7('0x1c')],function(_0x3b2c1d){return{'model':db[_0x3b2c1d[_0xc0b7('0x1e')]],'as':_0x3b2c1d['as'],'attributes':_0x3b2c1d[_0xc0b7('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc0b7('0x23')](function(_0x1f2ad8){logger['info']('ShowCmHopper',_0xb81d68);logger['debug'](_0xc0b7('0x20'),_0xb81d68,JSON['stringify'](_0x1f2ad8));_0x2194bc(_0x1f2ad8);})['catch'](function(_0x4de169){logger[_0xc0b7('0x12')](_0xc0b7('0x20'),_0x4de169['message'],_0xb81d68);_0x2621a5(_0x1e78f4[_0xc0b7('0x12')](0x1f4,_0x4de169[_0xc0b7('0x14')]));});});};exports[_0xc0b7('0x24')]=function(_0x1a0e5b){var _0x375579=this;return new Promise(function(_0x50f230,_0x33b5ee){return db['CmHopper'][_0xc0b7('0x25')](_0x1a0e5b['body'],{'raw':_0x1a0e5b[_0xc0b7('0x19')]?_0x1a0e5b[_0xc0b7('0x19')][_0xc0b7('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x4c606a){logger[_0xc0b7('0xc')](_0xc0b7('0x24'),_0x1a0e5b);logger['debug'](_0xc0b7('0x24'),_0x1a0e5b,JSON[_0xc0b7('0x11')](_0x4c606a));_0x50f230(_0x4c606a);})[_0xc0b7('0x16')](function(_0x2ed049){logger[_0xc0b7('0x12')]('CreateCmHopper',_0x2ed049['message'],_0x1a0e5b);_0x33b5ee(_0x375579[_0xc0b7('0x12')](0x1f4,_0x2ed049[_0xc0b7('0x14')]));});});};exports[_0xc0b7('0x26')]=function(_0xd103bf){var _0x5b6e3d=this;return new Promise(function(_0x3fdc22,_0x2c18f1){return db[_0xc0b7('0x21')][_0xc0b7('0x27')](_0xd103bf[_0xc0b7('0x28')],{'raw':_0xd103bf[_0xc0b7('0x19')]?_0xd103bf[_0xc0b7('0x19')][_0xc0b7('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd103bf[_0xc0b7('0x19')]?_0xd103bf[_0xc0b7('0x19')][_0xc0b7('0x1b')]||null:null,'attributes':_0xd103bf[_0xc0b7('0x19')]?_0xd103bf[_0xc0b7('0x19')][_0xc0b7('0x1f')]||null:null,'limit':_0xd103bf['options']?_0xd103bf[_0xc0b7('0x19')][_0xc0b7('0x29')]||null:null})[_0xc0b7('0x23')](function(_0x38319c){logger[_0xc0b7('0xc')](_0xc0b7('0x26'),_0xd103bf);logger[_0xc0b7('0xf')](_0xc0b7('0x26'),_0xd103bf,JSON[_0xc0b7('0x11')](_0x38319c));_0x3fdc22(_0x38319c);})[_0xc0b7('0x16')](function(_0x5627af){logger[_0xc0b7('0x12')]('UpdateCmHopper',_0x5627af[_0xc0b7('0x14')],_0xd103bf);_0x2c18f1(_0x5b6e3d['error'](0x1f4,_0x5627af[_0xc0b7('0x14')]));});});};exports[_0xc0b7('0x2a')]=function(_0x74151d){var _0x4d570c=this;return new Promise(function(_0xd2b8c,_0x3a8290){return db['CmHopper'][_0xc0b7('0x2b')]({'where':_0x74151d['options']?_0x74151d[_0xc0b7('0x19')][_0xc0b7('0x1b')]||null:null})[_0xc0b7('0x23')](function(_0x5838b6){logger['info'](_0xc0b7('0x2a'),_0x74151d);logger[_0xc0b7('0xf')](_0xc0b7('0x2a'),_0x74151d,JSON['stringify'](_0x5838b6));_0xd2b8c(_0x5838b6);})[_0xc0b7('0x16')](function(_0x2e063f){logger[_0xc0b7('0x12')]('DestroyCmHopper',_0x2e063f[_0xc0b7('0x14')],_0x74151d);_0x3a8290(_0x4d570c[_0xc0b7('0x12')](0x1f4,_0x2e063f[_0xc0b7('0x14')]));});});};exports[_0xc0b7('0x2c')]=function(_0x40cc00){var _0xe4d4a=this;return new Promise(function(_0x455951,_0x4cb27e){return db['CmContact'][_0xc0b7('0x2d')]()[_0xc0b7('0x23')](function(_0xeae843){return db['sequelize'][_0xc0b7('0x2e')](function(_0x328b19){return db[_0xc0b7('0x21')]['findAll']({'where':_0x40cc00[_0xc0b7('0x19')]?_0x40cc00[_0xc0b7('0x19')][_0xc0b7('0x1b')]||null:null,'attributes':_0x40cc00['options']?_0x40cc00[_0xc0b7('0x19')][_0xc0b7('0x1f')]||null:null,'limit':_0x40cc00['options']?_0x40cc00[_0xc0b7('0x19')][_0xc0b7('0x29')]||null:null,'order':_0x40cc00[_0xc0b7('0x19')]?_0x40cc00[_0xc0b7('0x19')][_0xc0b7('0x2f')]||null:null,'transaction':_0x328b19,'lock':_0x328b19['LOCK']['UPDATE'],'include':[{'model':db[_0xc0b7('0x30')],'as':_0xc0b7('0x31'),'attributes':_[_0xc0b7('0x32')](_0xeae843)},{'model':db[_0xc0b7('0x33')],'as':_0xc0b7('0x34'),'attributes':['id','name',_0xc0b7('0x35')]}]})[_0xc0b7('0x23')](function(_0x1a3141){var _0x26c606=[];var _0x4d23ab=[];for(var _0x586369=0x0;_0x586369<_0x1a3141[_0xc0b7('0x36')];_0x586369+=0x1){var _0x38527f=_0x1a3141[_0x586369]['UserId'];if(_0x38527f===null){_0x26c606[_0xc0b7('0x37')](_0x1a3141[_0x586369][_0xc0b7('0x27')](_0x40cc00[_0xc0b7('0x28')],{'transaction':_0x328b19}));}else if(!_0x4d23ab[_0xc0b7('0x38')](_0x38527f)){_0x4d23ab[_0xc0b7('0x37')](_0x38527f);_0x26c606[_0xc0b7('0x37')](_0x1a3141[_0x586369]['update'](_0x40cc00[_0xc0b7('0x28')],{'transaction':_0x328b19}));}}return BPromise[_0xc0b7('0x39')](_0x26c606);});})[_0xc0b7('0x23')](function(_0x129161){logger['info'](_0xc0b7('0x2c'),_0x40cc00);logger[_0xc0b7('0xf')](_0xc0b7('0x2c'),_0x40cc00,JSON[_0xc0b7('0x11')](_0x129161));_0x455951(_0x129161);})[_0xc0b7('0x16')](function(_0x1e880d){logger[_0xc0b7('0x12')](_0xc0b7('0x2c'),_0x1e880d[_0xc0b7('0x14')],_0x40cc00);_0x4cb27e(_0xe4d4a['error'](0x1f4,_0x1e880d[_0xc0b7('0x14')]));});});});};exports[_0xc0b7('0x3a')]=function(_0x207c11){var _0x5bab50=this;return new Promise(function(_0x356eab,_0xfc723a){return db['sequelize'][_0xc0b7('0x2e')](function(_0x491f23){return db['CmHopperFinal'][_0xc0b7('0x25')](_0x207c11[_0xc0b7('0x28')],{'raw':_0x207c11[_0xc0b7('0x19')]?_0x207c11[_0xc0b7('0x19')][_0xc0b7('0x1a')]===undefined?!![]:![]:!![],'transaction':_0x491f23})[_0xc0b7('0x23')](function(){return db[_0xc0b7('0x21')][_0xc0b7('0x2b')]({'where':_0x207c11[_0xc0b7('0x19')]?_0x207c11[_0xc0b7('0x19')][_0xc0b7('0x1b')]||null:null,'transaction':_0x491f23});});})[_0xc0b7('0x23')](function(_0x37f117){logger[_0xc0b7('0xc')]('MoveContactManagedDialer',_0x207c11);logger[_0xc0b7('0xf')]('MoveContactManagedDialer',_0x207c11,JSON[_0xc0b7('0x11')](_0x37f117));_0x356eab(_0x37f117);})[_0xc0b7('0x16')](function(_0x54df5d){logger['error'](_0xc0b7('0x3a'),_0x54df5d[_0xc0b7('0x14')],_0x207c11);_0xfc723a(_0x5bab50[_0xc0b7('0x12')](0x1f4,_0x54df5d[_0xc0b7('0x14')]));});});};exports[_0xc0b7('0x3b')]=function(_0x4648fc){var _0x9647b0=this;return new Promise(function(_0x20ded6,_0x4806eb){return db[_0xc0b7('0x21')][_0xc0b7('0x18')]({'raw':_0x4648fc['options']?_0x4648fc[_0xc0b7('0x19')][_0xc0b7('0x1a')]===undefined?!![]:![]:!![],'where':_0x4648fc[_0xc0b7('0x19')]?_0x4648fc['options']['where']||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0xc0b7('0x3c')]['fn']('IF',db[_0xc0b7('0x3c')][_0xc0b7('0x3d')](_0xc0b7('0x3e')+util[_0xc0b7('0x3f')]('\x22%s\x22',moment()['format'](_0xc0b7('0x40')))+_0xc0b7('0x41')))),'contactsRescheduled']]})[_0xc0b7('0x23')](function(_0x3ce398){logger[_0xc0b7('0xc')](_0xc0b7('0x3b'),_0x4648fc);logger[_0xc0b7('0xf')]('CountReScheduled',_0x4648fc,JSON[_0xc0b7('0x11')](_0x3ce398));_0x20ded6(_0x3ce398);})[_0xc0b7('0x16')](function(_0x8deaaf){logger['error'](_0xc0b7('0x3b'),_0x8deaaf[_0xc0b7('0x14')],_0x4648fc);_0x4806eb(_0x9647b0[_0xc0b7('0x12')](0x1f4,_0x8deaaf[_0xc0b7('0x14')]));});});};exports[_0xc0b7('0x42')]=function(_0x3be582){var _0x4cc528=this;return new Promise(function(_0x11b17f,_0x2022f5){return db[_0xc0b7('0x30')][_0xc0b7('0x2d')]()[_0xc0b7('0x23')](function(_0x35706b){return db[_0xc0b7('0x3c')]['transaction'](function(_0x3bb923){return db[_0xc0b7('0x21')][_0xc0b7('0x18')]({'where':_0x3be582[_0xc0b7('0x19')]?_0x3be582['options'][_0xc0b7('0x1b')]||null:null,'attributes':_0x3be582[_0xc0b7('0x19')]?_0x3be582['options'][_0xc0b7('0x1f')]||null:null,'limit':0x1,'order':_0x3be582[_0xc0b7('0x19')]?_0x3be582['options'][_0xc0b7('0x2f')]||null:null,'group':db[_0xc0b7('0x21')][_0xc0b7('0x43')],'transaction':_0x3bb923,'lock':_0x3bb923['LOCK'][_0xc0b7('0x44')],'include':_0x3be582[_0xc0b7('0x19')]?_0x3be582['options'][_0xc0b7('0x1c')]?_['map'](_0x3be582[_0xc0b7('0x19')][_0xc0b7('0x1c')],function(_0x4d97a3){return{'model':db[_0x4d97a3['model']],'as':_0x4d97a3['as'],'attributes':_0x4d97a3[_0xc0b7('0x1f')],'include':_0x4d97a3[_0xc0b7('0x1c')]?_[_0xc0b7('0x1d')](_0x4d97a3[_0xc0b7('0x1c')],function(_0x4fc020){return{'model':db[_0x4fc020[_0xc0b7('0x1e')]],'as':_0x4fc020['as'],'attributes':_0x4fc020[_0xc0b7('0x1f')],'include':_0x4fc020[_0xc0b7('0x1c')]?_[_0xc0b7('0x1d')](_0x4fc020[_0xc0b7('0x1c')],function(_0x4d2212){return{'model':db[_0x4d2212[_0xc0b7('0x1e')]],'as':_0x4d2212['as'],'attributes':_0x4d2212['attributes']};}):[]};}):[]};}):[]:[]})[_0xc0b7('0x23')](function(_0x1e32d6){var _0xad5d8d=[];for(var _0x137777=0x0;_0x137777<_0x1e32d6[_0xc0b7('0x36')];_0x137777+=0x1){_0xad5d8d['push'](_0x1e32d6[_0x137777]['update'](_0x3be582['body'],{'transaction':_0x3bb923}));}return BPromise[_0xc0b7('0x39')](_0xad5d8d);});})['then'](function(_0x475c10){logger['info'](_0xc0b7('0x42'),_0x3be582);logger[_0xc0b7('0xf')](_0xc0b7('0x42'),_0x3be582,JSON[_0xc0b7('0x11')](_0x475c10));_0x11b17f(_0x475c10);})[_0xc0b7('0x16')](function(_0x4ffe3f){logger[_0xc0b7('0x12')](_0xc0b7('0x42'),_0x4ffe3f['message'],_0x3be582);_0x2022f5(_0x4cc528[_0xc0b7('0x12')](0x1f4,_0x4ffe3f[_0xc0b7('0x14')]));});});});};exports[_0xc0b7('0x45')]=function(_0x3b6dbb){var _0x14ac09=this;return new Promise(function(_0x503a85,_0x1c8d50){db[_0xc0b7('0x30')][_0xc0b7('0x2d')]()[_0xc0b7('0x23')](function(_0x15276b){return db[_0xc0b7('0x21')]['findAll']({'raw':_0x3b6dbb['options']?_0x3b6dbb['options'][_0xc0b7('0x1a')]===undefined?!![]:![]:!![],'where':_0x3b6dbb[_0xc0b7('0x19')]?_0x3b6dbb[_0xc0b7('0x19')][_0xc0b7('0x1b')]||null:null,'attributes':_0x3b6dbb[_0xc0b7('0x19')]?_0x3b6dbb['options'][_0xc0b7('0x1f')]||null:null,'limit':_0x3b6dbb[_0xc0b7('0x19')]?_0x3b6dbb[_0xc0b7('0x19')][_0xc0b7('0x29')]||null:null,'include':_0x3b6dbb[_0xc0b7('0x19')]?_0x3b6dbb['options'][_0xc0b7('0x1c')]?_[_0xc0b7('0x1d')](_0x3b6dbb['options']['include'],function(_0x39ce81){return{'model':db[_0x39ce81[_0xc0b7('0x1e')]],'as':_0x39ce81['as'],'attributes':_0x39ce81['as']===_0xc0b7('0x31')?_[_0xc0b7('0x32')](_0x15276b):_0x39ce81[_0xc0b7('0x1f')],'include':_0x39ce81[_0xc0b7('0x1c')]?_['map'](_0x39ce81['include'],function(_0x122edd){return{'model':db[_0x122edd[_0xc0b7('0x1e')]],'as':_0x122edd['as'],'attributes':_0x122edd[_0xc0b7('0x1f')],'include':_0x122edd[_0xc0b7('0x1c')]?_[_0xc0b7('0x1d')](_0x122edd[_0xc0b7('0x1c')],function(_0x2107ad){return{'model':db[_0x2107ad['model']],'as':_0x2107ad['as'],'attributes':_0x2107ad[_0xc0b7('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xb8c0e4){logger[_0xc0b7('0xc')](_0xc0b7('0x17'),_0x3b6dbb);logger[_0xc0b7('0xf')](_0xc0b7('0x17'),_0x3b6dbb,JSON[_0xc0b7('0x11')](_0xb8c0e4));_0x503a85(_0xb8c0e4);})['catch'](function(_0x8642cb){logger[_0xc0b7('0x12')](_0xc0b7('0x17'),_0x8642cb['message'],_0x3b6dbb);_0x1c8d50(_0x14ac09[_0xc0b7('0x12')](0x1f4,_0x8642cb['message']));});});});}; \ No newline at end of file +var _0x23c9=['rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','error','message','result','catch','options','raw','where','limit','include','map','model','attributes','stringify','GetCmHopper','CmHopper','ShowCmHopper','CreateCmHopper','body','UpdateCmHopper','DestroyCmHopper','CmContact','describe','sequelize','transaction','order','LOCK','UPDATE','Contact','User','name','length','UserId','push','update','includes','all','GetContactDialer','MoveContactManagedDialer','CmHopperFinal','create','destroy','findAll','COUNT','literal','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','GetContactRecallMe','GetCmHopperPreview','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x4ccd32,_0x3b11c9){var _0x30b693=function(_0x1b816f){while(--_0x1b816f){_0x4ccd32['push'](_0x4ccd32['shift']());}};_0x30b693(++_0x3b11c9);}(_0x23c9,0x153));var _0x923c=function(_0x30b75e,_0x2083b8){_0x30b75e=_0x30b75e-0x0;var _0x38f5b6=_0x23c9[_0x30b75e];return _0x38f5b6;};'use strict';var _=require(_0x923c('0x0'));var util=require('util');var moment=require(_0x923c('0x1'));var BPromise=require(_0x923c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x923c('0x3'));var db=require(_0x923c('0x4'))['db'];var utils=require(_0x923c('0x5'));var logger=require('../../config/logger')(_0x923c('0x6'));var config=require(_0x923c('0x7'));var jayson=require(_0x923c('0x8'));var client=jayson['client'][_0x923c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a8c22,_0x54ac12,_0x3d54e5){return new BPromise(function(_0x307b95,_0x581dbd){return client[_0x923c('0xa')](_0x1a8c22,_0x3d54e5)[_0x923c('0xb')](function(_0x268196){logger[_0x923c('0xc')](_0x923c('0xd'),_0x54ac12,_0x923c('0xe'));logger[_0x923c('0xf')](_0x923c('0x10'),_0x54ac12,_0x923c('0xe'),JSON['stringify'](_0x268196));if(_0x268196[_0x923c('0x11')]){if(_0x268196[_0x923c('0x11')]['code']===0x1f4){logger['error'](_0x923c('0xd'),_0x54ac12,_0x268196[_0x923c('0x11')][_0x923c('0x12')]);return _0x581dbd(_0x268196[_0x923c('0x11')][_0x923c('0x12')]);}logger[_0x923c('0x11')](_0x923c('0xd'),_0x54ac12,_0x268196[_0x923c('0x11')][_0x923c('0x12')]);return _0x307b95(_0x268196[_0x923c('0x11')][_0x923c('0x12')]);}else{logger[_0x923c('0xc')](_0x923c('0xd'),_0x54ac12,'request\x20sent');_0x307b95(_0x268196[_0x923c('0x13')][_0x923c('0x12')]);}})[_0x923c('0x14')](function(_0x2072ad){logger[_0x923c('0x11')](_0x923c('0xd'),_0x54ac12,_0x2072ad);_0x581dbd(_0x2072ad);});});}exports['GetCmHopper']=function(_0x5156d7){var _0x3f010f=this;return new Promise(function(_0x519b4a,_0x37f161){return db['CmHopper']['findAll']({'raw':_0x5156d7[_0x923c('0x15')]?_0x5156d7[_0x923c('0x15')][_0x923c('0x16')]===undefined?!![]:![]:!![],'where':_0x5156d7[_0x923c('0x15')]?_0x5156d7[_0x923c('0x15')][_0x923c('0x17')]||null:null,'attributes':_0x5156d7[_0x923c('0x15')]?_0x5156d7[_0x923c('0x15')]['attributes']||null:null,'limit':_0x5156d7[_0x923c('0x15')]?_0x5156d7[_0x923c('0x15')][_0x923c('0x18')]||null:null,'include':_0x5156d7[_0x923c('0x15')]?_0x5156d7[_0x923c('0x15')][_0x923c('0x19')]?_[_0x923c('0x1a')](_0x5156d7['options']['include'],function(_0x237d22){return{'model':db[_0x237d22[_0x923c('0x1b')]],'as':_0x237d22['as'],'attributes':_0x237d22['attributes'],'include':_0x237d22[_0x923c('0x19')]?_['map'](_0x237d22[_0x923c('0x19')],function(_0x49e773){return{'model':db[_0x49e773[_0x923c('0x1b')]],'as':_0x49e773['as'],'attributes':_0x49e773['attributes'],'include':_0x49e773['include']?_['map'](_0x49e773[_0x923c('0x19')],function(_0x4b5793){return{'model':db[_0x4b5793[_0x923c('0x1b')]],'as':_0x4b5793['as'],'attributes':_0x4b5793[_0x923c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x923c('0xb')](function(_0x20acf7){logger[_0x923c('0xc')]('GetCmHopper',_0x5156d7);logger['debug']('GetCmHopper',_0x5156d7,JSON[_0x923c('0x1d')](_0x20acf7));_0x519b4a(_0x20acf7);})[_0x923c('0x14')](function(_0x1d7194){logger[_0x923c('0x11')](_0x923c('0x1e'),_0x1d7194['message'],_0x5156d7);_0x37f161(_0x3f010f['error'](0x1f4,_0x1d7194[_0x923c('0x12')]));});});};exports['ShowCmHopper']=function(_0x4bef79){var _0x43cd11=this;return new Promise(function(_0x45e23a,_0x215b8c){return db[_0x923c('0x1f')]['find']({'raw':_0x4bef79[_0x923c('0x15')]?_0x4bef79[_0x923c('0x15')][_0x923c('0x16')]===undefined?!![]:![]:!![],'where':_0x4bef79[_0x923c('0x15')]?_0x4bef79[_0x923c('0x15')][_0x923c('0x17')]||null:null,'attributes':_0x4bef79['options']?_0x4bef79[_0x923c('0x15')][_0x923c('0x1c')]||null:null,'include':_0x4bef79[_0x923c('0x15')]?_0x4bef79[_0x923c('0x15')][_0x923c('0x19')]?_[_0x923c('0x1a')](_0x4bef79['options'][_0x923c('0x19')],function(_0x139d7d){return{'model':db[_0x139d7d['model']],'as':_0x139d7d['as'],'attributes':_0x139d7d[_0x923c('0x1c')],'include':_0x139d7d[_0x923c('0x19')]?_[_0x923c('0x1a')](_0x139d7d[_0x923c('0x19')],function(_0x2e88a0){return{'model':db[_0x2e88a0[_0x923c('0x1b')]],'as':_0x2e88a0['as'],'attributes':_0x2e88a0[_0x923c('0x1c')],'include':_0x2e88a0['include']?_[_0x923c('0x1a')](_0x2e88a0[_0x923c('0x19')],function(_0x606526){return{'model':db[_0x606526[_0x923c('0x1b')]],'as':_0x606526['as'],'attributes':_0x606526['attributes']};}):[]};}):[]};}):[]:[]})[_0x923c('0xb')](function(_0x54648c){logger[_0x923c('0xc')]('ShowCmHopper',_0x4bef79);logger[_0x923c('0xf')](_0x923c('0x20'),_0x4bef79,JSON[_0x923c('0x1d')](_0x54648c));_0x45e23a(_0x54648c);})[_0x923c('0x14')](function(_0xf8503){logger[_0x923c('0x11')](_0x923c('0x20'),_0xf8503[_0x923c('0x12')],_0x4bef79);_0x215b8c(_0x43cd11[_0x923c('0x11')](0x1f4,_0xf8503[_0x923c('0x12')]));});});};exports[_0x923c('0x21')]=function(_0x2f8859){var _0x26f80d=this;return new Promise(function(_0x499477,_0x1938df){return db[_0x923c('0x1f')]['create'](_0x2f8859[_0x923c('0x22')],{'raw':_0x2f8859[_0x923c('0x15')]?_0x2f8859[_0x923c('0x15')][_0x923c('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x582439){logger['info']('CreateCmHopper',_0x2f8859);logger[_0x923c('0xf')]('CreateCmHopper',_0x2f8859,JSON['stringify'](_0x582439));_0x499477(_0x582439);})['catch'](function(_0x4901c1){logger[_0x923c('0x11')](_0x923c('0x21'),_0x4901c1[_0x923c('0x12')],_0x2f8859);_0x1938df(_0x26f80d['error'](0x1f4,_0x4901c1[_0x923c('0x12')]));});});};exports[_0x923c('0x23')]=function(_0x46308a){var _0x4ad246=this;return new Promise(function(_0x887c9f,_0x4428ac){return db[_0x923c('0x1f')]['update'](_0x46308a[_0x923c('0x22')],{'raw':_0x46308a['options']?_0x46308a[_0x923c('0x15')][_0x923c('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46308a[_0x923c('0x15')]?_0x46308a[_0x923c('0x15')][_0x923c('0x17')]||null:null,'attributes':_0x46308a[_0x923c('0x15')]?_0x46308a[_0x923c('0x15')][_0x923c('0x1c')]||null:null,'limit':_0x46308a[_0x923c('0x15')]?_0x46308a[_0x923c('0x15')]['limit']||null:null})[_0x923c('0xb')](function(_0x251463){logger[_0x923c('0xc')](_0x923c('0x23'),_0x46308a);logger[_0x923c('0xf')](_0x923c('0x23'),_0x46308a,JSON[_0x923c('0x1d')](_0x251463));_0x887c9f(_0x251463);})[_0x923c('0x14')](function(_0x38fd0a){logger[_0x923c('0x11')](_0x923c('0x23'),_0x38fd0a[_0x923c('0x12')],_0x46308a);_0x4428ac(_0x4ad246[_0x923c('0x11')](0x1f4,_0x38fd0a['message']));});});};exports[_0x923c('0x24')]=function(_0x1a104b){var _0x43ed71=this;return new Promise(function(_0x1a22fa,_0x41be75){return db[_0x923c('0x1f')]['destroy']({'where':_0x1a104b[_0x923c('0x15')]?_0x1a104b[_0x923c('0x15')][_0x923c('0x17')]||null:null})[_0x923c('0xb')](function(_0x33ac97){logger[_0x923c('0xc')]('DestroyCmHopper',_0x1a104b);logger['debug']('DestroyCmHopper',_0x1a104b,JSON[_0x923c('0x1d')](_0x33ac97));_0x1a22fa(_0x33ac97);})[_0x923c('0x14')](function(_0x5f2912){logger[_0x923c('0x11')]('DestroyCmHopper',_0x5f2912['message'],_0x1a104b);_0x41be75(_0x43ed71['error'](0x1f4,_0x5f2912['message']));});});};exports['GetContactDialer']=function(_0x38426b){var _0x4ba95a=this;return new Promise(function(_0x4e92dc,_0x33dbbc){return db[_0x923c('0x25')][_0x923c('0x26')]()['then'](function(_0x3433a4){return db[_0x923c('0x27')][_0x923c('0x28')](function(_0x82f6f){return db[_0x923c('0x1f')]['findAll']({'where':_0x38426b[_0x923c('0x15')]?_0x38426b[_0x923c('0x15')][_0x923c('0x17')]||null:null,'attributes':_0x38426b[_0x923c('0x15')]?_0x38426b['options'][_0x923c('0x1c')]||null:null,'limit':_0x38426b[_0x923c('0x15')]?_0x38426b['options'][_0x923c('0x18')]||null:null,'order':_0x38426b[_0x923c('0x15')]?_0x38426b[_0x923c('0x15')][_0x923c('0x29')]||null:null,'transaction':_0x82f6f,'lock':_0x82f6f[_0x923c('0x2a')][_0x923c('0x2b')],'include':[{'model':db[_0x923c('0x25')],'as':_0x923c('0x2c'),'attributes':_['keys'](_0x3433a4)},{'model':db[_0x923c('0x2d')],'as':'Agent','attributes':['id',_0x923c('0x2e'),'voicePause']}]})[_0x923c('0xb')](function(_0x4bce54){var _0x5d89c6=[];var _0x498d65=[];for(var _0x39bb28=0x0;_0x39bb28<_0x4bce54[_0x923c('0x2f')];_0x39bb28+=0x1){var _0x48a556=_0x4bce54[_0x39bb28][_0x923c('0x30')];if(_0x48a556===null){_0x5d89c6[_0x923c('0x31')](_0x4bce54[_0x39bb28][_0x923c('0x32')](_0x38426b[_0x923c('0x22')],{'transaction':_0x82f6f}));}else if(!_0x498d65[_0x923c('0x33')](_0x48a556)){_0x498d65[_0x923c('0x31')](_0x48a556);_0x5d89c6[_0x923c('0x31')](_0x4bce54[_0x39bb28][_0x923c('0x32')](_0x38426b[_0x923c('0x22')],{'transaction':_0x82f6f}));}}return BPromise[_0x923c('0x34')](_0x5d89c6);});})['then'](function(_0xe2c2b1){logger[_0x923c('0xc')](_0x923c('0x35'),_0x38426b);logger['debug'](_0x923c('0x35'),_0x38426b,JSON[_0x923c('0x1d')](_0xe2c2b1));_0x4e92dc(_0xe2c2b1);})[_0x923c('0x14')](function(_0x3c8d0d){logger[_0x923c('0x11')](_0x923c('0x35'),_0x3c8d0d['message'],_0x38426b);_0x33dbbc(_0x4ba95a['error'](0x1f4,_0x3c8d0d[_0x923c('0x12')]));});});});};exports[_0x923c('0x36')]=function(_0x50c1e6){var _0x5e72cb=this;return new Promise(function(_0x436e90,_0x399aa5){return db['sequelize'][_0x923c('0x28')](function(_0x3b0c5c){return db[_0x923c('0x37')][_0x923c('0x38')](_0x50c1e6[_0x923c('0x22')],{'raw':_0x50c1e6[_0x923c('0x15')]?_0x50c1e6[_0x923c('0x15')][_0x923c('0x16')]===undefined?!![]:![]:!![],'transaction':_0x3b0c5c})[_0x923c('0xb')](function(){return db[_0x923c('0x1f')][_0x923c('0x39')]({'where':_0x50c1e6[_0x923c('0x15')]?_0x50c1e6[_0x923c('0x15')][_0x923c('0x17')]||null:null,'transaction':_0x3b0c5c});});})[_0x923c('0xb')](function(_0x2f2bce){logger[_0x923c('0xc')](_0x923c('0x36'),_0x50c1e6);logger[_0x923c('0xf')]('MoveContactManagedDialer',_0x50c1e6,JSON['stringify'](_0x2f2bce));_0x436e90(_0x2f2bce);})[_0x923c('0x14')](function(_0x47ad86){logger[_0x923c('0x11')](_0x923c('0x36'),_0x47ad86[_0x923c('0x12')],_0x50c1e6);_0x399aa5(_0x5e72cb['error'](0x1f4,_0x47ad86[_0x923c('0x12')]));});});};exports['CountReScheduled']=function(_0x4897e8){var _0x5904cb=this;return new Promise(function(_0x469393,_0x1f1ee0){return db[_0x923c('0x1f')][_0x923c('0x3a')]({'raw':_0x4897e8['options']?_0x4897e8[_0x923c('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x4897e8[_0x923c('0x15')]?_0x4897e8[_0x923c('0x15')][_0x923c('0x17')]||null:null,'attributes':[[db['sequelize']['fn'](_0x923c('0x3b'),db[_0x923c('0x27')]['fn']('IF',db[_0x923c('0x27')][_0x923c('0x3c')](_0x923c('0x3d')+util[_0x923c('0x3e')]('\x22%s\x22',moment()[_0x923c('0x3e')](_0x923c('0x3f')))+_0x923c('0x40')))),_0x923c('0x41')]]})[_0x923c('0xb')](function(_0x346ef4){logger[_0x923c('0xc')](_0x923c('0x42'),_0x4897e8);logger[_0x923c('0xf')]('CountReScheduled',_0x4897e8,JSON[_0x923c('0x1d')](_0x346ef4));_0x469393(_0x346ef4);})[_0x923c('0x14')](function(_0xecd692){logger[_0x923c('0x11')](_0x923c('0x42'),_0xecd692['message'],_0x4897e8);_0x1f1ee0(_0x5904cb[_0x923c('0x11')](0x1f4,_0xecd692[_0x923c('0x12')]));});});};exports[_0x923c('0x43')]=function(_0xbb2d4a){var _0x43abc1=this;return new Promise(function(_0x2a6ee9,_0x4d8a4b){return db['CmContact'][_0x923c('0x26')]()['then'](function(_0x574630){return db[_0x923c('0x27')][_0x923c('0x28')](function(_0xc1d537){return db[_0x923c('0x1f')][_0x923c('0x3a')]({'where':_0xbb2d4a[_0x923c('0x15')]?_0xbb2d4a['options'][_0x923c('0x17')]||null:null,'attributes':_0xbb2d4a[_0x923c('0x15')]?_0xbb2d4a[_0x923c('0x15')][_0x923c('0x1c')]||null:null,'limit':0x1,'order':_0xbb2d4a[_0x923c('0x15')]?_0xbb2d4a[_0x923c('0x15')][_0x923c('0x29')]||null:null,'group':db[_0x923c('0x1f')][_0x923c('0x30')],'transaction':_0xc1d537,'lock':_0xc1d537[_0x923c('0x2a')][_0x923c('0x2b')],'include':_0xbb2d4a[_0x923c('0x15')]?_0xbb2d4a[_0x923c('0x15')][_0x923c('0x19')]?_['map'](_0xbb2d4a[_0x923c('0x15')][_0x923c('0x19')],function(_0x245788){return{'model':db[_0x245788['model']],'as':_0x245788['as'],'attributes':_0x245788[_0x923c('0x1c')],'include':_0x245788[_0x923c('0x19')]?_[_0x923c('0x1a')](_0x245788[_0x923c('0x19')],function(_0x2935ec){return{'model':db[_0x2935ec['model']],'as':_0x2935ec['as'],'attributes':_0x2935ec['attributes'],'include':_0x2935ec[_0x923c('0x19')]?_[_0x923c('0x1a')](_0x2935ec[_0x923c('0x19')],function(_0x3563f6){return{'model':db[_0x3563f6[_0x923c('0x1b')]],'as':_0x3563f6['as'],'attributes':_0x3563f6[_0x923c('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x120eec){var _0x1215ce=[];for(var _0x5965e9=0x0;_0x5965e9<_0x120eec[_0x923c('0x2f')];_0x5965e9+=0x1){_0x1215ce[_0x923c('0x31')](_0x120eec[_0x5965e9][_0x923c('0x32')](_0xbb2d4a['body'],{'transaction':_0xc1d537}));}return BPromise[_0x923c('0x34')](_0x1215ce);});})['then'](function(_0x4d3693){logger[_0x923c('0xc')](_0x923c('0x43'),_0xbb2d4a);logger[_0x923c('0xf')](_0x923c('0x43'),_0xbb2d4a,JSON['stringify'](_0x4d3693));_0x2a6ee9(_0x4d3693);})[_0x923c('0x14')](function(_0x524884){logger['error']('GetContactRecallMe',_0x524884['message'],_0xbb2d4a);_0x4d8a4b(_0x43abc1[_0x923c('0x11')](0x1f4,_0x524884[_0x923c('0x12')]));});});});};exports[_0x923c('0x44')]=function(_0x235a8d){var _0x3b8372=this;return new Promise(function(_0x4c7d74,_0x52baef){db['CmContact'][_0x923c('0x26')]()[_0x923c('0xb')](function(_0x40e132){return db[_0x923c('0x1f')][_0x923c('0x3a')]({'raw':_0x235a8d['options']?_0x235a8d[_0x923c('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x235a8d[_0x923c('0x15')]?_0x235a8d[_0x923c('0x15')][_0x923c('0x17')]||null:null,'attributes':_0x235a8d[_0x923c('0x15')]?_0x235a8d[_0x923c('0x15')][_0x923c('0x1c')]||null:null,'limit':_0x235a8d[_0x923c('0x15')]?_0x235a8d['options'][_0x923c('0x18')]||null:null,'include':_0x235a8d[_0x923c('0x15')]?_0x235a8d['options'][_0x923c('0x19')]?_[_0x923c('0x1a')](_0x235a8d[_0x923c('0x15')][_0x923c('0x19')],function(_0x307ba9){return{'model':db[_0x307ba9[_0x923c('0x1b')]],'as':_0x307ba9['as'],'attributes':_0x307ba9['as']===_0x923c('0x2c')?_['keys'](_0x40e132):_0x307ba9[_0x923c('0x1c')],'include':_0x307ba9[_0x923c('0x19')]?_['map'](_0x307ba9[_0x923c('0x19')],function(_0x2b13f3){return{'model':db[_0x2b13f3['model']],'as':_0x2b13f3['as'],'attributes':_0x2b13f3['attributes'],'include':_0x2b13f3[_0x923c('0x19')]?_['map'](_0x2b13f3[_0x923c('0x19')],function(_0x422815){return{'model':db[_0x422815[_0x923c('0x1b')]],'as':_0x422815['as'],'attributes':_0x422815[_0x923c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x923c('0xb')](function(_0x2e9735){logger[_0x923c('0xc')](_0x923c('0x1e'),_0x235a8d);logger[_0x923c('0xf')](_0x923c('0x1e'),_0x235a8d,JSON[_0x923c('0x1d')](_0x2e9735));_0x4c7d74(_0x2e9735);})[_0x923c('0x14')](function(_0x4055dc){logger['error'](_0x923c('0x1e'),_0x4055dc[_0x923c('0x12')],_0x235a8d);_0x52baef(_0x3b8372[_0x923c('0x11')](0x1f4,_0x4055dc[_0x923c('0x12')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 8f1c950..17f50b9 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 _0x626f=['/describe','describe','getOpenContacts','/:id','show','post','/preview','getPreview','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x626f,0x184));var _0xf626=function(_0x25fd8c,_0x5e91fa){_0x25fd8c=_0x25fd8c-0x0;var _0x37ca9b=_0x626f[_0x25fd8c];return _0x37ca9b;};'use strict';var multer=require(_0xf626('0x0'));var util=require(_0xf626('0x1'));var path=require(_0xf626('0x2'));var timeout=require(_0xf626('0x3'));var express=require('express');var router=express[_0xf626('0x4')]();var fs_extra=require(_0xf626('0x5'));var auth=require(_0xf626('0x6'));var interaction=require(_0xf626('0x7'));var config=require(_0xf626('0x8'));var controller=require(_0xf626('0x9'));router[_0xf626('0xa')]('/',auth[_0xf626('0xb')](),controller['index']);router['get'](_0xf626('0xc'),auth[_0xf626('0xb')](),controller[_0xf626('0xd')]);router[_0xf626('0xa')]('/opencontacts',auth[_0xf626('0xb')](),controller[_0xf626('0xe')]);router[_0xf626('0xa')](_0xf626('0xf'),auth['isAuthenticated'](),controller[_0xf626('0x10')]);router[_0xf626('0x11')]('/',auth[_0xf626('0xb')](),controller['create']);router[_0xf626('0x11')](_0xf626('0x12'),auth['isAuthenticated'](),controller[_0xf626('0x13')]);router[_0xf626('0x14')](_0xf626('0xf'),auth[_0xf626('0xb')](),controller[_0xf626('0x15')]);router[_0xf626('0x16')](_0xf626('0xf'),auth[_0xf626('0xb')](),controller[_0xf626('0x17')]);module[_0xf626('0x18')]=router; \ No newline at end of file +var _0xe32a=['show','post','create','/preview','getPreview','put','update','delete','destroy','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','isAuthenticated','index','get','/describe','/opencontacts','getOpenContacts','/:id'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xe32a,0x12a));var _0xae32=function(_0x2fdf82,_0x322e7c){_0x2fdf82=_0x2fdf82-0x0;var _0x2382f5=_0xe32a[_0x2fdf82];return _0x2382f5;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xae32('0x0'));var express=require(_0xae32('0x1'));var router=express[_0xae32('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xae32('0x3'));var interaction=require(_0xae32('0x4'));var config=require(_0xae32('0x5'));var controller=require(_0xae32('0x6'));router['get']('/',auth[_0xae32('0x7')](),controller[_0xae32('0x8')]);router[_0xae32('0x9')](_0xae32('0xa'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xae32('0xb'),auth['isAuthenticated'](),controller[_0xae32('0xc')]);router['get'](_0xae32('0xd'),auth['isAuthenticated'](),controller[_0xae32('0xe')]);router[_0xae32('0xf')]('/',auth[_0xae32('0x7')](),controller[_0xae32('0x10')]);router[_0xae32('0xf')](_0xae32('0x11'),auth[_0xae32('0x7')](),controller[_0xae32('0x12')]);router[_0xae32('0x13')](_0xae32('0xd'),auth[_0xae32('0x7')](),controller[_0xae32('0x14')]);router[_0xae32('0x15')]('/:id',auth[_0xae32('0x7')](),controller[_0xae32('0x16')]);module[_0xae32('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index 057837a..bf7cdd1 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 _0xa9de=['INTEGER','STRING','moment','sequelize'];(function(_0x2301c1,_0x3c5a47){var _0x28f1eb=function(_0x6a6bb){while(--_0x6a6bb){_0x2301c1['push'](_0x2301c1['shift']());}};_0x28f1eb(++_0x3c5a47);}(_0xa9de,0xb2));var _0xea9d=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xa9de[_0x4b369d];return _0x571a98;};'use strict';var moment=require(_0xea9d('0x0'));var Sequelize=require(_0xea9d('0x1'));module['exports']={'CmHopperId':{'type':Sequelize[_0xea9d('0x2')]},'phone':{'type':Sequelize[_0xea9d('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0xea9d('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0xea9d('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xea9d('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0xea9d('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xea9d('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xea9d('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xea9d('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x80f0=['format','YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','exports','INTEGER','STRING'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x80f0,0x1c2));var _0x080f=function(_0x34e6fa,_0x5bfbdd){_0x34e6fa=_0x34e6fa-0x0;var _0x43bf0c=_0x80f0[_0x34e6fa];return _0x43bf0c;};'use strict';var moment=require(_0x080f('0x0'));var Sequelize=require(_0x080f('0x1'));module[_0x080f('0x2')]={'CmHopperId':{'type':Sequelize[_0x080f('0x3')]},'phone':{'type':Sequelize[_0x080f('0x4')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x080f('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x080f('0x5')](_0x080f('0x6'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x080f('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x080f('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x080f('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x080f('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x080f('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index 21abe8a..1a424b0 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 _0xa967=['order','sort','where','filters','filter','merge','map','VIRTUAL','options','includeAll','findAll','rows','catch','keys','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','CmHopperAdditionalPhones','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','destroy','get','error','stack','name','index','CmHopperAdditionalPhone','rawAttributes','type','key','model','intersection','attributes','fields','length','query','hasOwnProperty'];(function(_0x1cb042,_0x481bf8){var _0x1495a5=function(_0x18a5ee){while(--_0x18a5ee){_0x1cb042['push'](_0x1cb042['shift']());}};_0x1495a5(++_0x481bf8);}(_0xa967,0x6d));var _0x7a96=function(_0x3ef626,_0x335afc){_0x3ef626=_0x3ef626-0x0;var _0x57039b=_0xa967[_0x3ef626];return _0x57039b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7a96('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7a96('0x1'));var rp=require(_0x7a96('0x2'));var moment=require(_0x7a96('0x3'));var BPromise=require(_0x7a96('0x4'));var Mustache=require('mustache');var util=require(_0x7a96('0x5'));var path=require(_0x7a96('0x6'));var sox=require('sox');var csv=require(_0x7a96('0x7'));var ejs=require(_0x7a96('0x8'));var fs=require('fs');var fs_extra=require(_0x7a96('0x9'));var _=require(_0x7a96('0xa'));var squel=require(_0x7a96('0xb'));var crypto=require(_0x7a96('0xc'));var jsforce=require(_0x7a96('0xd'));var deskjs=require(_0x7a96('0xe'));var toCsv=require(_0x7a96('0x7'));var querystring=require(_0x7a96('0xf'));var Papa=require(_0x7a96('0x10'));var Redis=require(_0x7a96('0x11'));var authService=require(_0x7a96('0x12'));var qs=require(_0x7a96('0x13'));var as=require(_0x7a96('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7a96('0x15'))(_0x7a96('0x16'));var utils=require(_0x7a96('0x17'));var config=require(_0x7a96('0x18'));var licenseUtil=require(_0x7a96('0x19'));var db=require(_0x7a96('0x1a'))['db'];function respondWithStatusCode(_0x244804,_0x394492){_0x394492=_0x394492||0xcc;return function(_0x2f4744){if(_0x2f4744){return _0x244804[_0x7a96('0x1b')](_0x394492);}return _0x244804['status'](_0x394492)[_0x7a96('0x1c')]();};}function respondWithResult(_0x3de2b5,_0x3d2ad1){_0x3d2ad1=_0x3d2ad1||0xc8;return function(_0x47cef6){if(_0x47cef6){return _0x3de2b5[_0x7a96('0x1d')](_0x3d2ad1)[_0x7a96('0x1e')](_0x47cef6);}};}function respondWithFilteredResult(_0x3f4ab5,_0xb24fa3){return function(_0x282f28){if(_0x282f28){var _0xa2aab3=typeof _0xb24fa3['offset']===_0x7a96('0x1f')&&typeof _0xb24fa3[_0x7a96('0x20')]==='undefined';var _0x33f7d2=_0x282f28[_0x7a96('0x21')];var _0x116db2=_0xa2aab3?0x0:_0xb24fa3[_0x7a96('0x22')];var _0x4edc5d=_0xa2aab3?_0x282f28[_0x7a96('0x21')]:_0xb24fa3[_0x7a96('0x22')]+_0xb24fa3[_0x7a96('0x20')];var _0x42fe1d;if(_0x4edc5d>=_0x33f7d2){_0x4edc5d=_0x33f7d2;_0x42fe1d=0xc8;}else{_0x42fe1d=0xce;}_0x3f4ab5[_0x7a96('0x1d')](_0x42fe1d);return _0x3f4ab5['set'](_0x7a96('0x23'),_0x116db2+'-'+_0x4edc5d+'/'+_0x33f7d2)[_0x7a96('0x1e')](_0x282f28);}return null;};}function patchUpdates(_0x1ac97d){return function(_0x24cd90){try{jsonpatch[_0x7a96('0x24')](_0x24cd90,_0x1ac97d,!![]);}catch(_0x444699){return BPromise[_0x7a96('0x25')](_0x444699);}return _0x24cd90['save']();};}function saveUpdates(_0x6c3066,_0x38e7c5){return function(_0x5ed058){if(_0x5ed058){return _0x5ed058[_0x7a96('0x26')](_0x6c3066)[_0x7a96('0x27')](function(_0x2816ad){return _0x2816ad;});}return null;};}function removeEntity(_0x297c74,_0x3878c3){return function(_0x2b1a78){if(_0x2b1a78){return _0x2b1a78[_0x7a96('0x28')]()[_0x7a96('0x27')](function(){var _0x2f4499=_0x2b1a78[_0x7a96('0x29')]({'plain':!![]});var _0x11ae28='CmHopperAdditionalPhones';return db['UserProfileResource']['destroy']({'where':{'type':_0x11ae28,'resourceId':_0x2f4499['id']}})['then'](function(){return _0x2b1a78;});})[_0x7a96('0x27')](function(){_0x297c74[_0x7a96('0x1d')](0xcc)[_0x7a96('0x1c')]();});}};}function handleEntityNotFound(_0x9ccf0,_0x184866){return function(_0x1ec8ed){if(!_0x1ec8ed){_0x9ccf0['sendStatus'](0x194);}return _0x1ec8ed;};}function handleError(_0x5b9ce5,_0x1f6c17){_0x1f6c17=_0x1f6c17||0x1f4;return function(_0x43453a){logger[_0x7a96('0x2a')](_0x43453a[_0x7a96('0x2b')]);if(_0x43453a[_0x7a96('0x2c')]){delete _0x43453a[_0x7a96('0x2c')];}_0x5b9ce5[_0x7a96('0x1d')](_0x1f6c17)['send'](_0x43453a);};}exports[_0x7a96('0x2d')]=function(_0x3fc310,_0x40e500){var _0x3a0f55={},_0x26d800={},_0x5edc0f={'count':0x0,'rows':[]};var _0x2acd2c=_['map'](db[_0x7a96('0x2e')][_0x7a96('0x2f')],function(_0x361bfc){return{'name':_0x361bfc['fieldName'],'type':_0x361bfc[_0x7a96('0x30')][_0x7a96('0x31')]};});_0x26d800[_0x7a96('0x32')]=_['map'](_0x2acd2c,_0x7a96('0x2c'));_0x26d800['query']=_['keys'](_0x3fc310['query']);_0x26d800['filters']=_[_0x7a96('0x33')](_0x26d800['model'],_0x26d800['query']);_0x3a0f55[_0x7a96('0x34')]=_[_0x7a96('0x33')](_0x26d800[_0x7a96('0x32')],qs[_0x7a96('0x35')](_0x3fc310['query'][_0x7a96('0x35')]));_0x3a0f55[_0x7a96('0x34')]=_0x3a0f55[_0x7a96('0x34')][_0x7a96('0x36')]?_0x3a0f55[_0x7a96('0x34')]:_0x26d800[_0x7a96('0x32')];if(!_0x3fc310[_0x7a96('0x37')][_0x7a96('0x38')]('nolimit')){_0x3a0f55[_0x7a96('0x20')]=qs['limit'](_0x3fc310['query'][_0x7a96('0x20')]);_0x3a0f55[_0x7a96('0x22')]=qs['offset'](_0x3fc310[_0x7a96('0x37')][_0x7a96('0x22')]);}_0x3a0f55[_0x7a96('0x39')]=qs[_0x7a96('0x3a')](_0x3fc310['query'][_0x7a96('0x3a')]);_0x3a0f55[_0x7a96('0x3b')]=qs[_0x7a96('0x3c')](_['pick'](_0x3fc310[_0x7a96('0x37')],_0x26d800[_0x7a96('0x3c')]),_0x2acd2c);if(_0x3fc310[_0x7a96('0x37')][_0x7a96('0x3d')]){_0x3a0f55['where']=_[_0x7a96('0x3e')](_0x3a0f55['where'],{'$or':_[_0x7a96('0x3f')](_0x2acd2c,function(_0x4fa38c){if(_0x4fa38c[_0x7a96('0x30')]!==_0x7a96('0x40')){var _0x5b64de={};_0x5b64de[_0x4fa38c[_0x7a96('0x2c')]]={'$like':'%'+_0x3fc310[_0x7a96('0x37')][_0x7a96('0x3d')]+'%'};return _0x5b64de;}})});}_0x3a0f55=_['merge']({},_0x3a0f55,_0x3fc310[_0x7a96('0x41')]);var _0x1ff1a8={'where':_0x3a0f55['where']};return db[_0x7a96('0x2e')][_0x7a96('0x21')](_0x1ff1a8)['then'](function(_0x7631f7){_0x5edc0f['count']=_0x7631f7;if(_0x3fc310['query'][_0x7a96('0x42')]){_0x3a0f55['include']=[{'all':!![]}];}return db[_0x7a96('0x2e')][_0x7a96('0x43')](_0x3a0f55);})['then'](function(_0x2b5a27){_0x5edc0f[_0x7a96('0x44')]=_0x2b5a27;return _0x5edc0f;})[_0x7a96('0x27')](respondWithFilteredResult(_0x40e500,_0x3a0f55))[_0x7a96('0x45')](handleError(_0x40e500,null));};exports['show']=function(_0x262f4a,_0x40e00e){var _0x57a97e={'raw':!![],'where':{'id':_0x262f4a['params']['id']}},_0x132f60={};_0x132f60[_0x7a96('0x32')]=_[_0x7a96('0x46')](db['CmHopperAdditionalPhone'][_0x7a96('0x2f')]);_0x132f60[_0x7a96('0x37')]=_[_0x7a96('0x46')](_0x262f4a[_0x7a96('0x37')]);_0x132f60[_0x7a96('0x3c')]=_[_0x7a96('0x33')](_0x132f60[_0x7a96('0x32')],_0x132f60[_0x7a96('0x37')]);_0x57a97e[_0x7a96('0x34')]=_[_0x7a96('0x33')](_0x132f60[_0x7a96('0x32')],qs[_0x7a96('0x35')](_0x262f4a[_0x7a96('0x37')][_0x7a96('0x35')]));_0x57a97e[_0x7a96('0x34')]=_0x57a97e[_0x7a96('0x34')][_0x7a96('0x36')]?_0x57a97e[_0x7a96('0x34')]:_0x132f60[_0x7a96('0x32')];if(_0x262f4a[_0x7a96('0x37')][_0x7a96('0x42')]){_0x57a97e[_0x7a96('0x47')]=[{'all':!![]}];}_0x57a97e=_['merge']({},_0x57a97e,_0x262f4a[_0x7a96('0x41')]);return db[_0x7a96('0x2e')]['find'](_0x57a97e)['then'](handleEntityNotFound(_0x40e00e,null))[_0x7a96('0x27')](respondWithResult(_0x40e00e,null))['catch'](handleError(_0x40e00e,null));};exports[_0x7a96('0x48')]=function(_0x21fb38,_0x53874b){return db[_0x7a96('0x2e')][_0x7a96('0x48')](_0x21fb38[_0x7a96('0x49')],{})[_0x7a96('0x27')](function(_0x38f04f){var _0x4bbbc6=_0x21fb38['user'][_0x7a96('0x29')]({'plain':!![]});if(!_0x4bbbc6)throw new Error(_0x7a96('0x4a'));if(_0x4bbbc6['role']==='user'){var _0x3b5a87=_0x38f04f['get']({'plain':!![]});var _0x4cbaa5=_0x7a96('0x4b');return db[_0x7a96('0x4c')][_0x7a96('0x4d')]({'where':{'name':_0x4cbaa5,'userProfileId':_0x4bbbc6[_0x7a96('0x4e')]},'raw':!![]})[_0x7a96('0x27')](function(_0xdd1b71){if(_0xdd1b71&&_0xdd1b71[_0x7a96('0x4f')]===0x0){return db[_0x7a96('0x50')][_0x7a96('0x48')]({'name':_0x3b5a87['name'],'resourceId':_0x3b5a87['id'],'type':_0xdd1b71[_0x7a96('0x2c')],'sectionId':_0xdd1b71['id']},{})[_0x7a96('0x27')](function(){return _0x38f04f;});}else{return _0x38f04f;}})[_0x7a96('0x45')](function(_0x53534e){logger['error'](_0x7a96('0x51'),_0x53534e);throw _0x53534e;});}return _0x38f04f;})[_0x7a96('0x27')](respondWithResult(_0x53874b,0xc9))[_0x7a96('0x45')](handleError(_0x53874b,null));};exports[_0x7a96('0x26')]=function(_0x23fc9b,_0xfbd907){if(_0x23fc9b[_0x7a96('0x49')]['id']){delete _0x23fc9b[_0x7a96('0x49')]['id'];}return db[_0x7a96('0x2e')][_0x7a96('0x4d')]({'where':{'id':_0x23fc9b[_0x7a96('0x52')]['id']}})[_0x7a96('0x27')](handleEntityNotFound(_0xfbd907,null))[_0x7a96('0x27')](saveUpdates(_0x23fc9b[_0x7a96('0x49')],null))[_0x7a96('0x27')](respondWithResult(_0xfbd907,null))[_0x7a96('0x45')](handleError(_0xfbd907,null));};exports[_0x7a96('0x28')]=function(_0x248d36,_0x30410d){return db[_0x7a96('0x2e')][_0x7a96('0x4d')]({'where':{'id':_0x248d36[_0x7a96('0x52')]['id']}})['then'](handleEntityNotFound(_0x30410d,null))[_0x7a96('0x27')](removeEntity(_0x30410d,null))[_0x7a96('0x45')](handleError(_0x30410d,null));}; \ No newline at end of file +var _0x0b0c=['type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','CmHopperAdditionalPhone','find','catch','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CmHopperAdditionalPhones','UserProfileSection','userProfileId','create','eml-format','rimraf','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','rawAttributes','key','model','map','keys','query','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge'];(function(_0x2289b2,_0x57a069){var _0x2e3301=function(_0x2bf4e4){while(--_0x2bf4e4){_0x2289b2['push'](_0x2289b2['shift']());}};_0x2e3301(++_0x57a069);}(_0x0b0c,0x1f3));var _0xc0b0=function(_0x2c61a2,_0x40fe37){_0x2c61a2=_0x2c61a2-0x0;var _0x28bf7c=_0x0b0c[_0x2c61a2];return _0x28bf7c;};'use strict';var emlformat=require(_0xc0b0('0x0'));var rimraf=require(_0xc0b0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc0b0('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xc0b0('0x3'));var util=require(_0xc0b0('0x4'));var path=require(_0xc0b0('0x5'));var sox=require(_0xc0b0('0x6'));var csv=require(_0xc0b0('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc0b0('0x8'));var _=require(_0xc0b0('0x9'));var squel=require(_0xc0b0('0xa'));var crypto=require(_0xc0b0('0xb'));var jsforce=require(_0xc0b0('0xc'));var deskjs=require(_0xc0b0('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc0b0('0xe'));var Papa=require('papaparse');var Redis=require(_0xc0b0('0xf'));var authService=require(_0xc0b0('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xc0b0('0x11'));var hardwareService=require(_0xc0b0('0x12'));var logger=require(_0xc0b0('0x13'))(_0xc0b0('0x14'));var utils=require(_0xc0b0('0x15'));var config=require(_0xc0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc0b0('0x17'))['db'];function respondWithStatusCode(_0xdd0a22,_0x20c63e){_0x20c63e=_0x20c63e||0xcc;return function(_0x42ea3e){if(_0x42ea3e){return _0xdd0a22[_0xc0b0('0x18')](_0x20c63e);}return _0xdd0a22[_0xc0b0('0x19')](_0x20c63e)[_0xc0b0('0x1a')]();};}function respondWithResult(_0x1306b4,_0x4ac6da){_0x4ac6da=_0x4ac6da||0xc8;return function(_0x50cd17){if(_0x50cd17){return _0x1306b4[_0xc0b0('0x19')](_0x4ac6da)[_0xc0b0('0x1b')](_0x50cd17);}};}function respondWithFilteredResult(_0x4c8f60,_0x4726f5){return function(_0x5bfc5e){if(_0x5bfc5e){var _0xd061a6=typeof _0x4726f5[_0xc0b0('0x1c')]==='undefined'&&typeof _0x4726f5[_0xc0b0('0x1d')]===_0xc0b0('0x1e');var _0x37a6c5=_0x5bfc5e['count'];var _0x5edc50=_0xd061a6?0x0:_0x4726f5[_0xc0b0('0x1c')];var _0x46b472=_0xd061a6?_0x5bfc5e[_0xc0b0('0x1f')]:_0x4726f5['offset']+_0x4726f5[_0xc0b0('0x1d')];var _0x5669da;if(_0x46b472>=_0x37a6c5){_0x46b472=_0x37a6c5;_0x5669da=0xc8;}else{_0x5669da=0xce;}_0x4c8f60[_0xc0b0('0x19')](_0x5669da);return _0x4c8f60[_0xc0b0('0x20')](_0xc0b0('0x21'),_0x5edc50+'-'+_0x46b472+'/'+_0x37a6c5)['json'](_0x5bfc5e);}return null;};}function patchUpdates(_0x4dad3a){return function(_0x3b9a3f){try{jsonpatch[_0xc0b0('0x22')](_0x3b9a3f,_0x4dad3a,!![]);}catch(_0x18d281){return BPromise[_0xc0b0('0x23')](_0x18d281);}return _0x3b9a3f[_0xc0b0('0x24')]();};}function saveUpdates(_0x11d66f,_0x25cf31){return function(_0x24099c){if(_0x24099c){return _0x24099c[_0xc0b0('0x25')](_0x11d66f)[_0xc0b0('0x26')](function(_0x490abc){return _0x490abc;});}return null;};}function removeEntity(_0x2d0646,_0x43956e){return function(_0x2384f4){if(_0x2384f4){return _0x2384f4[_0xc0b0('0x27')]()[_0xc0b0('0x26')](function(){var _0x5c0b9e=_0x2384f4[_0xc0b0('0x28')]({'plain':!![]});var _0x594555='CmHopperAdditionalPhones';return db[_0xc0b0('0x29')][_0xc0b0('0x27')]({'where':{'type':_0x594555,'resourceId':_0x5c0b9e['id']}})[_0xc0b0('0x26')](function(){return _0x2384f4;});})[_0xc0b0('0x26')](function(){_0x2d0646[_0xc0b0('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45648e,_0x24b2d1){return function(_0x5249fa){if(!_0x5249fa){_0x45648e[_0xc0b0('0x18')](0x194);}return _0x5249fa;};}function handleError(_0xabca4a,_0x3bab42){_0x3bab42=_0x3bab42||0x1f4;return function(_0x48a9d1){logger[_0xc0b0('0x2a')](_0x48a9d1[_0xc0b0('0x2b')]);if(_0x48a9d1[_0xc0b0('0x2c')]){delete _0x48a9d1[_0xc0b0('0x2c')];}_0xabca4a[_0xc0b0('0x19')](_0x3bab42)['send'](_0x48a9d1);};}exports['index']=function(_0xa621f0,_0x2ef069){var _0xa9aceb={},_0x111932={},_0x2e7f70={'count':0x0,'rows':[]};var _0x43cc04=_['map'](db['CmHopperAdditionalPhone'][_0xc0b0('0x2d')],function(_0x2b6d37){return{'name':_0x2b6d37['fieldName'],'type':_0x2b6d37['type'][_0xc0b0('0x2e')]};});_0x111932[_0xc0b0('0x2f')]=_[_0xc0b0('0x30')](_0x43cc04,_0xc0b0('0x2c'));_0x111932['query']=_[_0xc0b0('0x31')](_0xa621f0[_0xc0b0('0x32')]);_0x111932[_0xc0b0('0x33')]=_[_0xc0b0('0x34')](_0x111932[_0xc0b0('0x2f')],_0x111932['query']);_0xa9aceb[_0xc0b0('0x35')]=_[_0xc0b0('0x34')](_0x111932[_0xc0b0('0x2f')],qs[_0xc0b0('0x36')](_0xa621f0[_0xc0b0('0x32')][_0xc0b0('0x36')]));_0xa9aceb[_0xc0b0('0x35')]=_0xa9aceb['attributes'][_0xc0b0('0x37')]?_0xa9aceb['attributes']:_0x111932[_0xc0b0('0x2f')];if(!_0xa621f0['query']['hasOwnProperty']('nolimit')){_0xa9aceb[_0xc0b0('0x1d')]=qs[_0xc0b0('0x1d')](_0xa621f0[_0xc0b0('0x32')][_0xc0b0('0x1d')]);_0xa9aceb[_0xc0b0('0x1c')]=qs['offset'](_0xa621f0[_0xc0b0('0x32')][_0xc0b0('0x1c')]);}_0xa9aceb['order']=qs[_0xc0b0('0x38')](_0xa621f0[_0xc0b0('0x32')]['sort']);_0xa9aceb[_0xc0b0('0x39')]=qs[_0xc0b0('0x33')](_[_0xc0b0('0x3a')](_0xa621f0['query'],_0x111932[_0xc0b0('0x33')]),_0x43cc04);if(_0xa621f0[_0xc0b0('0x32')][_0xc0b0('0x3b')]){_0xa9aceb[_0xc0b0('0x39')]=_[_0xc0b0('0x3c')](_0xa9aceb[_0xc0b0('0x39')],{'$or':_[_0xc0b0('0x30')](_0x43cc04,function(_0x13cc7b){if(_0x13cc7b[_0xc0b0('0x3d')]!==_0xc0b0('0x3e')){var _0xac8bd3={};_0xac8bd3[_0x13cc7b[_0xc0b0('0x2c')]]={'$like':'%'+_0xa621f0[_0xc0b0('0x32')][_0xc0b0('0x3b')]+'%'};return _0xac8bd3;}})});}_0xa9aceb=_[_0xc0b0('0x3c')]({},_0xa9aceb,_0xa621f0[_0xc0b0('0x3f')]);var _0xc3a87f={'where':_0xa9aceb[_0xc0b0('0x39')]};return db['CmHopperAdditionalPhone'][_0xc0b0('0x1f')](_0xc3a87f)[_0xc0b0('0x26')](function(_0x44967c){_0x2e7f70[_0xc0b0('0x1f')]=_0x44967c;if(_0xa621f0[_0xc0b0('0x32')][_0xc0b0('0x40')]){_0xa9aceb[_0xc0b0('0x41')]=[{'all':!![]}];}return db['CmHopperAdditionalPhone'][_0xc0b0('0x42')](_0xa9aceb);})[_0xc0b0('0x26')](function(_0x344bbd){_0x2e7f70[_0xc0b0('0x43')]=_0x344bbd;return _0x2e7f70;})[_0xc0b0('0x26')](respondWithFilteredResult(_0x2ef069,_0xa9aceb))['catch'](handleError(_0x2ef069,null));};exports[_0xc0b0('0x44')]=function(_0x39ac8,_0x51ec80){var _0x20541b={'raw':!![],'where':{'id':_0x39ac8[_0xc0b0('0x45')]['id']}},_0x585faf={};_0x585faf['model']=_[_0xc0b0('0x31')](db[_0xc0b0('0x46')][_0xc0b0('0x2d')]);_0x585faf[_0xc0b0('0x32')]=_[_0xc0b0('0x31')](_0x39ac8[_0xc0b0('0x32')]);_0x585faf[_0xc0b0('0x33')]=_[_0xc0b0('0x34')](_0x585faf[_0xc0b0('0x2f')],_0x585faf[_0xc0b0('0x32')]);_0x20541b[_0xc0b0('0x35')]=_[_0xc0b0('0x34')](_0x585faf[_0xc0b0('0x2f')],qs[_0xc0b0('0x36')](_0x39ac8['query']['fields']));_0x20541b[_0xc0b0('0x35')]=_0x20541b[_0xc0b0('0x35')][_0xc0b0('0x37')]?_0x20541b[_0xc0b0('0x35')]:_0x585faf[_0xc0b0('0x2f')];if(_0x39ac8['query'][_0xc0b0('0x40')]){_0x20541b['include']=[{'all':!![]}];}_0x20541b=_[_0xc0b0('0x3c')]({},_0x20541b,_0x39ac8['options']);return db[_0xc0b0('0x46')][_0xc0b0('0x47')](_0x20541b)[_0xc0b0('0x26')](handleEntityNotFound(_0x51ec80,null))['then'](respondWithResult(_0x51ec80,null))[_0xc0b0('0x48')](handleError(_0x51ec80,null));};exports['create']=function(_0x3b5d10,_0x49d049){return db[_0xc0b0('0x46')]['create'](_0x3b5d10[_0xc0b0('0x49')],{})['then'](function(_0x448037){var _0x5e8437=_0x3b5d10['user'][_0xc0b0('0x28')]({'plain':!![]});if(!_0x5e8437)throw new Error(_0xc0b0('0x4a'));if(_0x5e8437[_0xc0b0('0x4b')]==='user'){var _0x2048fe=_0x448037[_0xc0b0('0x28')]({'plain':!![]});var _0x41a0d0=_0xc0b0('0x4c');return db[_0xc0b0('0x4d')]['find']({'where':{'name':_0x41a0d0,'userProfileId':_0x5e8437[_0xc0b0('0x4e')]},'raw':!![]})[_0xc0b0('0x26')](function(_0x36bd49){if(_0x36bd49&&_0x36bd49['autoAssociation']===0x0){return db[_0xc0b0('0x29')][_0xc0b0('0x4f')]({'name':_0x2048fe[_0xc0b0('0x2c')],'resourceId':_0x2048fe['id'],'type':_0x36bd49['name'],'sectionId':_0x36bd49['id']},{})[_0xc0b0('0x26')](function(){return _0x448037;});}else{return _0x448037;}})[_0xc0b0('0x48')](function(_0x59ae14){logger[_0xc0b0('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x59ae14);throw _0x59ae14;});}return _0x448037;})[_0xc0b0('0x26')](respondWithResult(_0x49d049,0xc9))[_0xc0b0('0x48')](handleError(_0x49d049,null));};exports['update']=function(_0x170cdf,_0x4d761a){if(_0x170cdf[_0xc0b0('0x49')]['id']){delete _0x170cdf['body']['id'];}return db[_0xc0b0('0x46')][_0xc0b0('0x47')]({'where':{'id':_0x170cdf['params']['id']}})[_0xc0b0('0x26')](handleEntityNotFound(_0x4d761a,null))['then'](saveUpdates(_0x170cdf[_0xc0b0('0x49')],null))[_0xc0b0('0x26')](respondWithResult(_0x4d761a,null))['catch'](handleError(_0x4d761a,null));};exports['destroy']=function(_0x5693a9,_0x453f48){return db['CmHopperAdditionalPhone'][_0xc0b0('0x47')]({'where':{'id':_0x5693a9[_0xc0b0('0x45')]['id']}})[_0xc0b0('0x26')](handleEntityNotFound(_0x453f48,null))[_0xc0b0('0x26')](removeEntity(_0x453f48,null))[_0xc0b0('0x48')](handleError(_0x453f48,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index feb7a5e..dd3e274 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 _0x1427=['CmHopperAdditionalPhone','cm_hopper_additional_phones','util','../../config/logger','api','moment','path','../../config/environment','./cmHopperAdditionalPhone.attributes','exports','define'];(function(_0x40548b,_0x4fa248){var _0x4b93b4=function(_0x2602a2){while(--_0x2602a2){_0x40548b['push'](_0x40548b['shift']());}};_0x4b93b4(++_0x4fa248);}(_0x1427,0x7b));var _0x7142=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1427[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x7142('0x0'));var logger=require(_0x7142('0x1'))(_0x7142('0x2'));var moment=require(_0x7142('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7142('0x4'));var rimraf=require('rimraf');var config=require(_0x7142('0x5'));var attributes=require(_0x7142('0x6'));module[_0x7142('0x7')]=function(_0x3a225d,_0x28a8cd){return _0x3a225d[_0x7142('0x8')](_0x7142('0x9'),attributes,{'tableName':_0x7142('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4725=['moment','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','exports','CmHopperAdditionalPhone','lodash','util','api'];(function(_0x12cbfe,_0x2ff10c){var _0x50ddc8=function(_0x3c0d06){while(--_0x3c0d06){_0x12cbfe['push'](_0x12cbfe['shift']());}};_0x50ddc8(++_0x2ff10c);}(_0x4725,0x14a));var _0x5472=function(_0x10ea35,_0x5b22f0){_0x10ea35=_0x10ea35-0x0;var _0x1dd0ea=_0x4725[_0x10ea35];return _0x1dd0ea;};'use strict';var _=require(_0x5472('0x0'));var util=require(_0x5472('0x1'));var logger=require('../../config/logger')(_0x5472('0x2'));var moment=require(_0x5472('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5472('0x4'));var config=require(_0x5472('0x5'));var attributes=require(_0x5472('0x6'));module[_0x5472('0x7')]=function(_0x5283e9,_0x32a22b){return _0x5283e9['define'](_0x5472('0x8'),attributes,{'tableName':'cm_hopper_additional_phones','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 2b4a6d9..ff10db9 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 _0x8422=['debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','error','CmHopperAdditionalPhone,\x20%s,\x20%s','message','result','VerifyAdditionalPhones','CmHopper','findOne','body','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','entity','countabandonedretry','dialGlobalMaxRetry','catch','SwapAdditionalPhones','duration','waitTime','scheduledat','minutes','add','createdAt','updatedAt','isNil','countdropretry','hopperToAdd','transaction','update','phone','IncrementPreviewCounters','field','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent'];(function(_0x5c25ed,_0x54b40b){var _0x3eb331=function(_0x56fa93){while(--_0x56fa93){_0x5c25ed['push'](_0x5c25ed['shift']());}};_0x3eb331(++_0x54b40b);}(_0x8422,0x64));var _0x2842=function(_0x28b0a4,_0x2ea758){_0x28b0a4=_0x28b0a4-0x0;var _0x105ce6=_0x8422[_0x28b0a4];return _0x105ce6;};'use strict';var _=require(_0x2842('0x0'));var util=require(_0x2842('0x1'));var moment=require(_0x2842('0x2'));var BPromise=require(_0x2842('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2842('0x4'));var db=require(_0x2842('0x5'))['db'];var utils=require(_0x2842('0x6'));var logger=require(_0x2842('0x7'))(_0x2842('0x8'));var config=require(_0x2842('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2842('0xa')][_0x2842('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x403f7a,_0x2e3fb0,_0x555f54){return new BPromise(function(_0x138d23,_0x4e422d){return client[_0x2842('0xc')](_0x403f7a,_0x555f54)[_0x2842('0xd')](function(_0x8af36b){logger[_0x2842('0xe')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x2e3fb0,_0x2842('0xf'));logger[_0x2842('0x10')](_0x2842('0x11'),_0x2e3fb0,_0x2842('0xf'),JSON['stringify'](_0x8af36b));if(_0x8af36b['error']){if(_0x8af36b[_0x2842('0x12')]['code']===0x1f4){logger[_0x2842('0x12')](_0x2842('0x13'),_0x2e3fb0,_0x8af36b[_0x2842('0x12')][_0x2842('0x14')]);return _0x4e422d(_0x8af36b['error']['message']);}logger[_0x2842('0x12')](_0x2842('0x13'),_0x2e3fb0,_0x8af36b['error']['message']);return _0x138d23(_0x8af36b[_0x2842('0x12')]['message']);}else{logger[_0x2842('0xe')](_0x2842('0x13'),_0x2e3fb0,_0x2842('0xf'));_0x138d23(_0x8af36b[_0x2842('0x15')][_0x2842('0x14')]);}})['catch'](function(_0x1e1980){logger[_0x2842('0x12')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x2e3fb0,_0x1e1980);_0x4e422d(_0x1e1980);});});}exports[_0x2842('0x16')]=function(_0x1fff96){var _0x12da9c=this;return new Promise(function(_0x46f393,_0x2cfee0){return db[_0x2842('0x17')][_0x2842('0x18')]({'raw':!![],'where':{'ContactId':_0x1fff96['body']['ContactId'],'ListId':_0x1fff96[_0x2842('0x19')][_0x2842('0x1a')],'VoiceQueueId':_0x1fff96[_0x2842('0x19')][_0x2842('0x1b')]===undefined?null:_0x1fff96[_0x2842('0x19')][_0x2842('0x1b')],'CampaignId':_0x1fff96['body'][_0x2842('0x1c')]===undefined?null:_0x1fff96[_0x2842('0x19')][_0x2842('0x1c')]}})[_0x2842('0xd')](function(_0x1c99a2){if(_0x1c99a2!=null){return db[_0x2842('0x1d')][_0x2842('0x18')]({'raw':!![],'where':{'CmHopperId':_0x1c99a2['id'],'OrderBy':{'$gt':_0x1c99a2['OrderBy']}},'order':[[_0x2842('0x1e'),_0x2842('0x1f')]]})[_0x2842('0xd')](function(_0x16b20){var _0x21365e=0x0;if(_0x16b20){if(_0x16b20[_0x2842('0x20')]+_0x16b20[_0x2842('0x21')]+_0x16b20[_0x2842('0x22')]+_0x16b20[_0x2842('0x23')]+_0x16b20['countdropretry']+_0x16b20['countabandonedretry']+_0x16b20[_0x2842('0x24')]+_0x16b20[_0x2842('0x25')]<_0x1fff96[_0x2842('0x26')]['dialGlobalMaxRetry'])_0x21365e=0x1;_0x46f393({'additional':_0x21365e});}else{return db[_0x2842('0x1d')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x1c99a2['id']},'order':[['OrderBy',_0x2842('0x1f')]]})[_0x2842('0xd')](function(_0x394fd3){var _0x1b0a74=0x0;if(_0x394fd3){if(_0x394fd3['countbusyretry']+_0x394fd3[_0x2842('0x21')]+_0x394fd3[_0x2842('0x22')]+_0x394fd3[_0x2842('0x23')]+_0x394fd3['countdropretry']+_0x394fd3[_0x2842('0x27')]+_0x394fd3[_0x2842('0x24')]+_0x394fd3[_0x2842('0x25')]<_0x1fff96[_0x2842('0x26')][_0x2842('0x28')])_0x1b0a74=0x1;_0x46f393({'additional':_0x1b0a74});}else{_0x46f393({'additional':0x0});}})[_0x2842('0x29')](function(_0x11b9d6){logger['error'](_0x2842('0x16'),_0x11b9d6[_0x2842('0x14')],_0x1fff96);_0x2cfee0(_0x12da9c[_0x2842('0x12')](0x1f4,_0x11b9d6[_0x2842('0x14')]));});}})['catch'](function(_0x961941){logger[_0x2842('0x12')](_0x2842('0x16'),_0x961941[_0x2842('0x14')],_0x1fff96);_0x2cfee0(_0x12da9c[_0x2842('0x12')](0x1f4,_0x961941[_0x2842('0x14')]));});}else _0x46f393({'additional':0x0});});});};exports[_0x2842('0x2a')]=function(_0x177cad){var _0x3fb0e3=this;return new Promise(function(_0x3c2def,_0x2edced){return db[_0x2842('0x17')][_0x2842('0x18')]({'raw':!![],'where':{'ContactId':_0x177cad['body']['ContactId'],'ListId':_0x177cad[_0x2842('0x19')]['ListId'],'VoiceQueueId':_0x177cad[_0x2842('0x19')][_0x2842('0x1b')]===undefined?null:_0x177cad['body']['VoiceQueueId'],'CampaignId':_0x177cad[_0x2842('0x19')][_0x2842('0x1c')]===undefined?null:_0x177cad[_0x2842('0x19')]['CampaignId']}})[_0x2842('0xd')](function(_0x45c53a){if(_0x45c53a!=null){return db['CmHopperAdditionalPhone'][_0x2842('0x18')]({'raw':!![],'where':{'CmHopperId':_0x45c53a['id'],'OrderBy':{'$gte':_0x45c53a['OrderBy']}},'order':[[_0x2842('0x1e'),_0x2842('0x1f')]]})[_0x2842('0xd')](function(_0x24ae2a){if(_0x24ae2a)return activateAdditionalPhone(_0x45c53a,_0x177cad[_0x2842('0x19')],_0x24ae2a,_0x177cad[_0x2842('0x2b')],_0x177cad[_0x2842('0x2c')])[_0x2842('0xd')](function(_0x4e425c){_0x3c2def(_0x4e425c);});else{return db[_0x2842('0x1d')][_0x2842('0x18')]({'raw':!![],'where':{'CmHopperId':_0x45c53a['id']},'order':[[_0x2842('0x1e'),_0x2842('0x1f')]]})[_0x2842('0xd')](function(_0x2668d6){if(_0x2668d6)return activateAdditionalPhone(_0x45c53a,_0x177cad[_0x2842('0x19')],_0x2668d6,_0x177cad[_0x2842('0x2b')],_0x177cad[_0x2842('0x2c')])[_0x2842('0xd')](function(_0x20a8be){_0x3c2def(_0x20a8be);});else{_0x3c2def({'id':_0x45c53a['id'],'phone':''});}})[_0x2842('0x29')](function(_0x579de1){logger[_0x2842('0x12')](_0x2842('0x16'),_0x579de1[_0x2842('0x14')],_0x177cad);_0x2edced(_0x3fb0e3['error'](0x1f4,_0x579de1[_0x2842('0x14')]));});}})[_0x2842('0x29')](function(_0x409fc3){logger[_0x2842('0x12')](_0x2842('0x16'),_0x409fc3[_0x2842('0x14')],_0x177cad);_0x2edced(_0x3fb0e3[_0x2842('0x12')](0x1f4,_0x409fc3[_0x2842('0x14')]));});}else _0x3c2def(0x1);});});};function activateAdditionalPhone(_0x53ef99,_0x10327b,_0x151776,_0x569e7f,_0x38f74d){return new Promise(function(_0x17d183,_0x2203c3){logger['info'](_0x2842('0x16'),_0x151776);var _0x20b409;if(moment()>moment(_0x151776[_0x2842('0x2d')])){_0x20b409=moment()['add'](_0x38f74d||0x3,_0x2842('0x2e'));}else{if(_0x151776[_0x2842('0x1e')]==0x0){_0x20b409=moment(_0x151776['scheduledat']);}else{_0x20b409=moment()[_0x2842('0x2f')](_0x38f74d||0x3,_0x2842('0x2e'));}}var _0x4667d3={'phone':_0x53ef99['phone'],'active':0x0,'OrderBy':_['isNil'](_0x53ef99['OrderBy'])?0x0:_0x53ef99['OrderBy'],'scheduledat':moment()[_0x2842('0x2f')](_0x569e7f||0x1,_0x2842('0x2e')),'countbusyretry':_0x10327b[_0x2842('0x20')],'countcongestionretry':_0x10327b[_0x2842('0x21')],'countnoanswerretry':_0x10327b[_0x2842('0x22')],'countnosuchnumberretry':_0x10327b[_0x2842('0x23')],'countdropretry':_0x10327b['countdropretry'],'countabandonedretry':_0x10327b[_0x2842('0x27')],'countmachineretry':_0x10327b[_0x2842('0x24')],'countagentrejectretry':_0x10327b[_0x2842('0x25')],'createdAt':_0x10327b[_0x2842('0x30')],'updatedAt':_0x10327b[_0x2842('0x31')]};var _0xecb4dd={'CmHopperId':_0x53ef99['id'],'phone':_0x151776['phone'],'active':0x0,'OrderBy':_[_0x2842('0x32')](_0x151776[_0x2842('0x1e')])?0x0:_0x151776['OrderBy'],'scheduledat':_0x20b409,'countbusyretry':_0x151776['countbusyretry'],'countcongestionretry':_0x151776[_0x2842('0x21')],'countnoanswerretry':_0x151776[_0x2842('0x22')],'countnosuchnumberretry':_0x151776[_0x2842('0x23')],'countdropretry':_0x151776[_0x2842('0x33')],'countabandonedretry':_0x151776[_0x2842('0x27')],'countmachineretry':_0x151776[_0x2842('0x24')],'countagentrejectretry':_0x151776[_0x2842('0x25')],'createdAt':_0x151776[_0x2842('0x30')],'updatedAt':_0x151776[_0x2842('0x31')]};logger[_0x2842('0xe')](_0x2842('0x34'),_0x4667d3);logger['info']('additionalToHop',_0xecb4dd);return db['sequelize'][_0x2842('0x35')](function(_0x173b3d){return db[_0x2842('0x1d')][_0x2842('0x36')](_0x4667d3,{'where':{'id':_0x151776['id']}},{'transaction':_0x173b3d})[_0x2842('0xd')](function(){return db['CmHopper'][_0x2842('0x36')](_0xecb4dd,{'where':{'id':_0x53ef99['id']}},{'transaction':_0x173b3d});});})[_0x2842('0xd')](function(_0x3d58ec){_0x17d183({'id':_0x53ef99['id'],'phone':_0x151776[_0x2842('0x37')]});})[_0x2842('0x29')](function(_0x263a8a){logger['error'](_0x2842('0x16'),_0x263a8a[_0x2842('0x14')],req);_0x2203c3(_this['error'](0x1f4,_0x263a8a[_0x2842('0x14')]));});});}exports[_0x2842('0x38')]=function(_0x484a60){var _0x4e648b=this;return new Promise(function(_0x4f6705,_0x4b4fbd){return db[_0x2842('0x17')][_0x2842('0x36')](_0x484a60[_0x2842('0x19')][_0x2842('0x39')],{'where':{'id':_0x484a60[_0x2842('0x19')]['id']}})[_0x2842('0xd')](function(_0x449510){_0x4f6705(_0x449510);})[_0x2842('0x29')](function(_0x577eea){logger[_0x2842('0x12')]('IncrementPreviewCounters',_0x577eea[_0x2842('0x14')],_0x484a60);_0x4b4fbd(_0x4e648b[_0x2842('0x12')](0x1f4,_0x577eea[_0x2842('0x14')]));});});}; \ No newline at end of file +var _0x5dc8=['error','message','catch','VerifyAdditionalPhones','CmHopper','findOne','ContactId','body','VoiceQueueId','CampaignId','then','CmHopperAdditionalPhone','OrderBy','ASC','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','entity','dialGlobalMaxRetry','countmachineretry','SwapAdditionalPhones','ListId','duration','waitTime','add','minutes','scheduledat','createdAt','updatedAt','phone','isNil','hopperToAdd','additionalToHop','sequelize','transaction','update','IncrementPreviewCounters','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','CmHopperAdditionalPhone,\x20%s,\x20%s','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x1c8a04,_0x24d13c){var _0x48f9cf=function(_0x4490f6){while(--_0x4490f6){_0x1c8a04['push'](_0x1c8a04['shift']());}};_0x48f9cf(++_0x24d13c);}(_0x5dc8,0x14b));var _0x85dc=function(_0x5566b7,_0x4e9e2c){_0x5566b7=_0x5566b7-0x0;var _0x1c7ea7=_0x5dc8[_0x5566b7];return _0x1c7ea7;};'use strict';var _=require(_0x85dc('0x0'));var util=require(_0x85dc('0x1'));var moment=require('moment');var BPromise=require(_0x85dc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x85dc('0x3'))['db'];var utils=require(_0x85dc('0x4'));var logger=require(_0x85dc('0x5'))(_0x85dc('0x6'));var config=require(_0x85dc('0x7'));var jayson=require(_0x85dc('0x8'));var client=jayson[_0x85dc('0x9')][_0x85dc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x92528e,_0x1dcb4a,_0x25af77){return new BPromise(function(_0x8a211,_0x138b02){return client[_0x85dc('0xb')](_0x92528e,_0x25af77)['then'](function(_0x20f0dd){logger[_0x85dc('0xc')](_0x85dc('0xd'),_0x1dcb4a,'request\x20sent');logger['debug'](_0x85dc('0xe'),_0x1dcb4a,_0x85dc('0xf'),JSON[_0x85dc('0x10')](_0x20f0dd));if(_0x20f0dd[_0x85dc('0x11')]){if(_0x20f0dd[_0x85dc('0x11')]['code']===0x1f4){logger[_0x85dc('0x11')](_0x85dc('0xd'),_0x1dcb4a,_0x20f0dd[_0x85dc('0x11')]['message']);return _0x138b02(_0x20f0dd[_0x85dc('0x11')][_0x85dc('0x12')]);}logger['error'](_0x85dc('0xd'),_0x1dcb4a,_0x20f0dd[_0x85dc('0x11')][_0x85dc('0x12')]);return _0x8a211(_0x20f0dd[_0x85dc('0x11')][_0x85dc('0x12')]);}else{logger[_0x85dc('0xc')](_0x85dc('0xd'),_0x1dcb4a,'request\x20sent');_0x8a211(_0x20f0dd['result'][_0x85dc('0x12')]);}})[_0x85dc('0x13')](function(_0x592f0a){logger[_0x85dc('0x11')](_0x85dc('0xd'),_0x1dcb4a,_0x592f0a);_0x138b02(_0x592f0a);});});}exports[_0x85dc('0x14')]=function(_0x1923c6){var _0x3b91f2=this;return new Promise(function(_0x3139a7,_0x5c603e){return db[_0x85dc('0x15')][_0x85dc('0x16')]({'raw':!![],'where':{'ContactId':_0x1923c6['body'][_0x85dc('0x17')],'ListId':_0x1923c6[_0x85dc('0x18')]['ListId'],'VoiceQueueId':_0x1923c6[_0x85dc('0x18')][_0x85dc('0x19')]===undefined?null:_0x1923c6[_0x85dc('0x18')][_0x85dc('0x19')],'CampaignId':_0x1923c6[_0x85dc('0x18')][_0x85dc('0x1a')]===undefined?null:_0x1923c6[_0x85dc('0x18')]['CampaignId']}})[_0x85dc('0x1b')](function(_0x36cbb0){if(_0x36cbb0!=null){return db[_0x85dc('0x1c')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x36cbb0['id'],'OrderBy':{'$gt':_0x36cbb0[_0x85dc('0x1d')]}},'order':[[_0x85dc('0x1d'),_0x85dc('0x1e')]]})[_0x85dc('0x1b')](function(_0x5bcbf2){var _0x1277e2=0x0;if(_0x5bcbf2){if(_0x5bcbf2[_0x85dc('0x1f')]+_0x5bcbf2[_0x85dc('0x20')]+_0x5bcbf2[_0x85dc('0x21')]+_0x5bcbf2[_0x85dc('0x22')]+_0x5bcbf2[_0x85dc('0x23')]+_0x5bcbf2[_0x85dc('0x24')]+_0x5bcbf2['countmachineretry']+_0x5bcbf2[_0x85dc('0x25')]<_0x1923c6[_0x85dc('0x26')][_0x85dc('0x27')])_0x1277e2=0x1;_0x3139a7({'additional':_0x1277e2});}else{return db[_0x85dc('0x1c')][_0x85dc('0x16')]({'raw':!![],'where':{'CmHopperId':_0x36cbb0['id']},'order':[[_0x85dc('0x1d'),_0x85dc('0x1e')]]})[_0x85dc('0x1b')](function(_0x1b4025){var _0x51415a=0x0;if(_0x1b4025){if(_0x1b4025[_0x85dc('0x1f')]+_0x1b4025[_0x85dc('0x20')]+_0x1b4025[_0x85dc('0x21')]+_0x1b4025[_0x85dc('0x22')]+_0x1b4025[_0x85dc('0x23')]+_0x1b4025[_0x85dc('0x24')]+_0x1b4025[_0x85dc('0x28')]+_0x1b4025['countagentrejectretry']<_0x1923c6['entity'][_0x85dc('0x27')])_0x51415a=0x1;_0x3139a7({'additional':_0x51415a});}else{_0x3139a7({'additional':0x0});}})[_0x85dc('0x13')](function(_0x49c64f){logger[_0x85dc('0x11')](_0x85dc('0x14'),_0x49c64f[_0x85dc('0x12')],_0x1923c6);_0x5c603e(_0x3b91f2[_0x85dc('0x11')](0x1f4,_0x49c64f['message']));});}})[_0x85dc('0x13')](function(_0x3cf82f){logger[_0x85dc('0x11')](_0x85dc('0x14'),_0x3cf82f[_0x85dc('0x12')],_0x1923c6);_0x5c603e(_0x3b91f2[_0x85dc('0x11')](0x1f4,_0x3cf82f[_0x85dc('0x12')]));});}else _0x3139a7({'additional':0x0});});});};exports[_0x85dc('0x29')]=function(_0xc116c4){var _0x57edb3=this;return new Promise(function(_0x1552ac,_0x495bd6){return db[_0x85dc('0x15')][_0x85dc('0x16')]({'raw':!![],'where':{'ContactId':_0xc116c4[_0x85dc('0x18')]['ContactId'],'ListId':_0xc116c4[_0x85dc('0x18')][_0x85dc('0x2a')],'VoiceQueueId':_0xc116c4[_0x85dc('0x18')][_0x85dc('0x19')]===undefined?null:_0xc116c4['body']['VoiceQueueId'],'CampaignId':_0xc116c4['body']['CampaignId']===undefined?null:_0xc116c4['body'][_0x85dc('0x1a')]}})['then'](function(_0x3b9e62){if(_0x3b9e62!=null){return db[_0x85dc('0x1c')][_0x85dc('0x16')]({'raw':!![],'where':{'CmHopperId':_0x3b9e62['id'],'OrderBy':{'$gte':_0x3b9e62[_0x85dc('0x1d')]}},'order':[[_0x85dc('0x1d'),_0x85dc('0x1e')]]})[_0x85dc('0x1b')](function(_0x2c3405){if(_0x2c3405)return activateAdditionalPhone(_0x3b9e62,_0xc116c4[_0x85dc('0x18')],_0x2c3405,_0xc116c4[_0x85dc('0x2b')],_0xc116c4[_0x85dc('0x2c')])['then'](function(_0x2dde3f){_0x1552ac(_0x2dde3f);});else{return db[_0x85dc('0x1c')][_0x85dc('0x16')]({'raw':!![],'where':{'CmHopperId':_0x3b9e62['id']},'order':[[_0x85dc('0x1d'),_0x85dc('0x1e')]]})[_0x85dc('0x1b')](function(_0x2c31d8){if(_0x2c31d8)return activateAdditionalPhone(_0x3b9e62,_0xc116c4[_0x85dc('0x18')],_0x2c31d8,_0xc116c4[_0x85dc('0x2b')],_0xc116c4['waitTime'])[_0x85dc('0x1b')](function(_0x4d609d){_0x1552ac(_0x4d609d);});else{_0x1552ac({'id':_0x3b9e62['id'],'phone':''});}})[_0x85dc('0x13')](function(_0x23f51b){logger[_0x85dc('0x11')](_0x85dc('0x14'),_0x23f51b[_0x85dc('0x12')],_0xc116c4);_0x495bd6(_0x57edb3['error'](0x1f4,_0x23f51b[_0x85dc('0x12')]));});}})[_0x85dc('0x13')](function(_0x542b52){logger[_0x85dc('0x11')](_0x85dc('0x14'),_0x542b52[_0x85dc('0x12')],_0xc116c4);_0x495bd6(_0x57edb3[_0x85dc('0x11')](0x1f4,_0x542b52[_0x85dc('0x12')]));});}else _0x1552ac(0x1);});});};function activateAdditionalPhone(_0x53596e,_0x13ded8,_0x4fb38c,_0x33b384,_0x599eaa){return new Promise(function(_0x4f2093,_0x170d51){logger[_0x85dc('0xc')](_0x85dc('0x14'),_0x4fb38c);var _0x4f2f3a;if(moment()>moment(_0x4fb38c['scheduledat'])){_0x4f2f3a=moment()[_0x85dc('0x2d')](_0x599eaa||0x3,_0x85dc('0x2e'));}else{if(_0x4fb38c[_0x85dc('0x1d')]==0x0){_0x4f2f3a=moment(_0x4fb38c[_0x85dc('0x2f')]);}else{_0x4f2f3a=moment()[_0x85dc('0x2d')](_0x599eaa||0x3,_0x85dc('0x2e'));}}var _0x63e151={'phone':_0x53596e['phone'],'active':0x0,'OrderBy':_['isNil'](_0x53596e['OrderBy'])?0x0:_0x53596e['OrderBy'],'scheduledat':moment()['add'](_0x33b384||0x1,_0x85dc('0x2e')),'countbusyretry':_0x13ded8['countbusyretry'],'countcongestionretry':_0x13ded8['countcongestionretry'],'countnoanswerretry':_0x13ded8[_0x85dc('0x21')],'countnosuchnumberretry':_0x13ded8['countnosuchnumberretry'],'countdropretry':_0x13ded8[_0x85dc('0x23')],'countabandonedretry':_0x13ded8[_0x85dc('0x24')],'countmachineretry':_0x13ded8[_0x85dc('0x28')],'countagentrejectretry':_0x13ded8[_0x85dc('0x25')],'createdAt':_0x13ded8[_0x85dc('0x30')],'updatedAt':_0x13ded8[_0x85dc('0x31')]};var _0x3a17f4={'CmHopperId':_0x53596e['id'],'phone':_0x4fb38c[_0x85dc('0x32')],'active':0x0,'OrderBy':_[_0x85dc('0x33')](_0x4fb38c[_0x85dc('0x1d')])?0x0:_0x4fb38c['OrderBy'],'scheduledat':_0x4f2f3a,'countbusyretry':_0x4fb38c['countbusyretry'],'countcongestionretry':_0x4fb38c[_0x85dc('0x20')],'countnoanswerretry':_0x4fb38c[_0x85dc('0x21')],'countnosuchnumberretry':_0x4fb38c[_0x85dc('0x22')],'countdropretry':_0x4fb38c['countdropretry'],'countabandonedretry':_0x4fb38c[_0x85dc('0x24')],'countmachineretry':_0x4fb38c[_0x85dc('0x28')],'countagentrejectretry':_0x4fb38c['countagentrejectretry'],'createdAt':_0x4fb38c[_0x85dc('0x30')],'updatedAt':_0x4fb38c[_0x85dc('0x31')]};logger[_0x85dc('0xc')](_0x85dc('0x34'),_0x63e151);logger['info'](_0x85dc('0x35'),_0x3a17f4);return db[_0x85dc('0x36')][_0x85dc('0x37')](function(_0x44574d){return db['CmHopperAdditionalPhone']['update'](_0x63e151,{'where':{'id':_0x4fb38c['id']}},{'transaction':_0x44574d})[_0x85dc('0x1b')](function(){return db['CmHopper'][_0x85dc('0x38')](_0x3a17f4,{'where':{'id':_0x53596e['id']}},{'transaction':_0x44574d});});})[_0x85dc('0x1b')](function(_0x5e2f3d){_0x4f2093({'id':_0x53596e['id'],'phone':_0x4fb38c[_0x85dc('0x32')]});})[_0x85dc('0x13')](function(_0xe27b01){logger[_0x85dc('0x11')](_0x85dc('0x14'),_0xe27b01['message'],req);_0x170d51(_this['error'](0x1f4,_0xe27b01[_0x85dc('0x12')]));});});}exports[_0x85dc('0x39')]=function(_0x117707){var _0x18cd27=this;return new Promise(function(_0x33d049,_0x13ad86){return db[_0x85dc('0x15')][_0x85dc('0x38')](_0x117707[_0x85dc('0x18')]['field'],{'where':{'id':_0x117707[_0x85dc('0x18')]['id']}})['then'](function(_0x17664c){_0x33d049(_0x17664c);})['catch'](function(_0x47d3e5){logger[_0x85dc('0x11')](_0x85dc('0x39'),_0x47d3e5[_0x85dc('0x12')],_0x117707);_0x13ad86(_0x18cd27[_0x85dc('0x11')](0x1f4,_0x47d3e5[_0x85dc('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index dbf7df3..f0f5a47 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 _0xa354=['./cmHopperAdditionalPhone.controller','get','isAuthenticated','index','/:id','post','create','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x3c2863,_0x1b2cee){var _0x2c3d27=function(_0x4f831b){while(--_0x4f831b){_0x3c2863['push'](_0x3c2863['shift']());}};_0x2c3d27(++_0x1b2cee);}(_0xa354,0xd6));var _0x4a35=function(_0x30eccc,_0x23566d){_0x30eccc=_0x30eccc-0x0;var _0x53d230=_0xa354[_0x30eccc];return _0x53d230;};'use strict';var multer=require(_0x4a35('0x0'));var util=require(_0x4a35('0x1'));var path=require(_0x4a35('0x2'));var timeout=require(_0x4a35('0x3'));var express=require(_0x4a35('0x4'));var router=express['Router']();var fs_extra=require(_0x4a35('0x5'));var auth=require(_0x4a35('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4a35('0x7'));router[_0x4a35('0x8')]('/',auth[_0x4a35('0x9')](),controller[_0x4a35('0xa')]);router['get'](_0x4a35('0xb'),auth[_0x4a35('0x9')](),controller['show']);router[_0x4a35('0xc')]('/',auth[_0x4a35('0x9')](),controller[_0x4a35('0xd')]);router['put']('/:id',auth[_0x4a35('0x9')](),controller[_0x4a35('0xe')]);router[_0x4a35('0xf')]('/:id',auth[_0x4a35('0x9')](),controller['destroy']);module[_0x4a35('0x10')]=router; \ No newline at end of file +var _0x6412=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x2955c5,_0x2f8d8e){var _0x271ed2=function(_0x4526f9){while(--_0x4526f9){_0x2955c5['push'](_0x2955c5['shift']());}};_0x271ed2(++_0x2f8d8e);}(_0x6412,0xad));var _0x2641=function(_0xf43d98,_0x205203){_0xf43d98=_0xf43d98-0x0;var _0x22c563=_0x6412[_0xf43d98];return _0x22c563;};'use strict';var multer=require(_0x2641('0x0'));var util=require(_0x2641('0x1'));var path=require(_0x2641('0x2'));var timeout=require(_0x2641('0x3'));var express=require(_0x2641('0x4'));var router=express[_0x2641('0x5')]();var fs_extra=require(_0x2641('0x6'));var auth=require(_0x2641('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x2641('0x8'));var controller=require(_0x2641('0x9'));router[_0x2641('0xa')]('/',auth[_0x2641('0xb')](),controller[_0x2641('0xc')]);router[_0x2641('0xa')](_0x2641('0xd'),auth[_0x2641('0xb')](),controller[_0x2641('0xe')]);router[_0x2641('0xf')]('/',auth[_0x2641('0xb')](),controller[_0x2641('0x10')]);router[_0x2641('0x11')](_0x2641('0xd'),auth[_0x2641('0xb')](),controller[_0x2641('0x12')]);router[_0x2641('0x13')](_0x2641('0xd'),auth[_0x2641('0xb')](),controller[_0x2641('0x14')]);module[_0x2641('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 50f010f..40aa7b2 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 _0x3cdc=['sequelize','exports','STRING','INTEGER','contactListQueue'];(function(_0x389a8c,_0x13e8cf){var _0x3de6a8=function(_0x9feede){while(--_0x9feede){_0x389a8c['push'](_0x389a8c['shift']());}};_0x3de6a8(++_0x13e8cf);}(_0x3cdc,0x18b));var _0xc3cd=function(_0x5bff9e,_0x39ea3a){_0x5bff9e=_0x5bff9e-0x0;var _0x7f42ef=_0x3cdc[_0x5bff9e];return _0x7f42ef;};'use strict';var moment=require('moment');var Sequelize=require(_0xc3cd('0x0'));module[_0xc3cd('0x1')]={'phone':{'type':Sequelize[_0xc3cd('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xc3cd('0x3')],'unique':_0xc3cd('0x4')},'ListId':{'type':Sequelize[_0xc3cd('0x3')],'unique':_0xc3cd('0x4')},'VoiceQueueId':{'type':Sequelize[_0xc3cd('0x3')],'unique':_0xc3cd('0x4')}}; \ No newline at end of file +var _0xc677=['exports','STRING','INTEGER','contactListQueue','sequelize'];(function(_0x9f615c,_0x24430f){var _0x5378ab=function(_0x57eb4c){while(--_0x57eb4c){_0x9f615c['push'](_0x9f615c['shift']());}};_0x5378ab(++_0x24430f);}(_0xc677,0x16c));var _0x7c67=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc677[_0x321bb2];return _0x9c12ed;};'use strict';var moment=require('moment');var Sequelize=require(_0x7c67('0x0'));module[_0x7c67('0x1')]={'phone':{'type':Sequelize[_0x7c67('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x7c67('0x3')],'unique':_0x7c67('0x4')},'ListId':{'type':Sequelize[_0x7c67('0x3')],'unique':_0x7c67('0x4')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index ead2ec4..d355a3b 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 _0xdebe=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','CmHopperBlack','includeAll','include','catch','find','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','squel','crypto','desk.js','querystring'];(function(_0x340619,_0x580b0b){var _0x3cf7b6=function(_0x2ebdc9){while(--_0x2ebdc9){_0x340619['push'](_0x340619['shift']());}};_0x3cf7b6(++_0x580b0b);}(_0xdebe,0x142));var _0xedeb=function(_0x235ec0,_0x2f4031){_0x235ec0=_0x235ec0-0x0;var _0x4ebb45=_0xdebe[_0x235ec0];return _0x4ebb45;};'use strict';var emlformat=require(_0xedeb('0x0'));var rimraf=require(_0xedeb('0x1'));var zipdir=require(_0xedeb('0x2'));var jsonpatch=require(_0xedeb('0x3'));var rp=require('request-promise');var moment=require(_0xedeb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xedeb('0x5'));var util=require(_0xedeb('0x6'));var path=require('path');var sox=require(_0xedeb('0x7'));var csv=require(_0xedeb('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xedeb('0x9'));var crypto=require(_0xedeb('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xedeb('0xb'));var toCsv=require('to-csv');var querystring=require(_0xedeb('0xc'));var Papa=require(_0xedeb('0xd'));var Redis=require(_0xedeb('0xe'));var authService=require(_0xedeb('0xf'));var qs=require(_0xedeb('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xedeb('0x11'));var logger=require(_0xedeb('0x12'))(_0xedeb('0x13'));var utils=require(_0xedeb('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xedeb('0x15'))['db'];function respondWithStatusCode(_0x151982,_0x37f7ab){_0x37f7ab=_0x37f7ab||0xcc;return function(_0x43da53){if(_0x43da53){return _0x151982['sendStatus'](_0x37f7ab);}return _0x151982[_0xedeb('0x16')](_0x37f7ab)['end']();};}function respondWithResult(_0x31cb04,_0x1371e5){_0x1371e5=_0x1371e5||0xc8;return function(_0x1666be){if(_0x1666be){return _0x31cb04[_0xedeb('0x16')](_0x1371e5)[_0xedeb('0x17')](_0x1666be);}};}function respondWithFilteredResult(_0x3e0045,_0x385f93){return function(_0x209b11){if(_0x209b11){var _0x5c7d92=typeof _0x385f93[_0xedeb('0x18')]===_0xedeb('0x19')&&typeof _0x385f93['limit']===_0xedeb('0x19');var _0x312e11=_0x209b11[_0xedeb('0x1a')];var _0x272067=_0x5c7d92?0x0:_0x385f93[_0xedeb('0x18')];var _0x216a3e=_0x5c7d92?_0x209b11[_0xedeb('0x1a')]:_0x385f93[_0xedeb('0x18')]+_0x385f93[_0xedeb('0x1b')];var _0x1323ec;if(_0x216a3e>=_0x312e11){_0x216a3e=_0x312e11;_0x1323ec=0xc8;}else{_0x1323ec=0xce;}_0x3e0045[_0xedeb('0x16')](_0x1323ec);return _0x3e0045[_0xedeb('0x1c')](_0xedeb('0x1d'),_0x272067+'-'+_0x216a3e+'/'+_0x312e11)[_0xedeb('0x17')](_0x209b11);}return null;};}function patchUpdates(_0xe9897f){return function(_0x3e5b28){try{jsonpatch['apply'](_0x3e5b28,_0xe9897f,!![]);}catch(_0xc8359a){return BPromise[_0xedeb('0x1e')](_0xc8359a);}return _0x3e5b28[_0xedeb('0x1f')]();};}function saveUpdates(_0x27aa01,_0x33887e){return function(_0x20bb3f){if(_0x20bb3f){return _0x20bb3f[_0xedeb('0x20')](_0x27aa01)[_0xedeb('0x21')](function(_0x4bcaf4){return _0x4bcaf4;});}return null;};}function removeEntity(_0xadf097,_0x2b7051){return function(_0x8a1152){if(_0x8a1152){return _0x8a1152[_0xedeb('0x22')]()[_0xedeb('0x21')](function(){_0xadf097['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x35b30b,_0x46db0d){return function(_0x579987){if(!_0x579987){_0x35b30b['sendStatus'](0x194);}return _0x579987;};}function handleError(_0x4db997,_0x33a207){_0x33a207=_0x33a207||0x1f4;return function(_0x3c7b62){logger[_0xedeb('0x23')](_0x3c7b62[_0xedeb('0x24')]);if(_0x3c7b62[_0xedeb('0x25')]){delete _0x3c7b62[_0xedeb('0x25')];}_0x4db997['status'](_0x33a207)['send'](_0x3c7b62);};}exports[_0xedeb('0x26')]=function(_0x42d0d0,_0x36f06c){var _0xedc43c={},_0x3f92fa={},_0x366de0={'count':0x0,'rows':[]};var _0x9c5646=_[_0xedeb('0x27')](db['CmHopperBlack'][_0xedeb('0x28')],function(_0x488c58){return{'name':_0x488c58[_0xedeb('0x29')],'type':_0x488c58[_0xedeb('0x2a')]['key']};});_0x3f92fa['model']=_['map'](_0x9c5646,_0xedeb('0x25'));_0x3f92fa[_0xedeb('0x2b')]=_[_0xedeb('0x2c')](_0x42d0d0[_0xedeb('0x2b')]);_0x3f92fa[_0xedeb('0x2d')]=_[_0xedeb('0x2e')](_0x3f92fa[_0xedeb('0x2f')],_0x3f92fa[_0xedeb('0x2b')]);_0xedc43c[_0xedeb('0x30')]=_['intersection'](_0x3f92fa[_0xedeb('0x2f')],qs[_0xedeb('0x31')](_0x42d0d0[_0xedeb('0x2b')][_0xedeb('0x31')]));_0xedc43c[_0xedeb('0x30')]=_0xedc43c[_0xedeb('0x30')][_0xedeb('0x32')]?_0xedc43c['attributes']:_0x3f92fa[_0xedeb('0x2f')];if(!_0x42d0d0[_0xedeb('0x2b')]['hasOwnProperty'](_0xedeb('0x33'))){_0xedc43c['limit']=qs[_0xedeb('0x1b')](_0x42d0d0[_0xedeb('0x2b')][_0xedeb('0x1b')]);_0xedc43c[_0xedeb('0x18')]=qs[_0xedeb('0x18')](_0x42d0d0[_0xedeb('0x2b')][_0xedeb('0x18')]);}_0xedc43c['order']=qs[_0xedeb('0x34')](_0x42d0d0[_0xedeb('0x2b')][_0xedeb('0x34')]);_0xedc43c[_0xedeb('0x35')]=qs[_0xedeb('0x2d')](_[_0xedeb('0x36')](_0x42d0d0[_0xedeb('0x2b')],_0x3f92fa['filters']),_0x9c5646);if(_0x42d0d0[_0xedeb('0x2b')][_0xedeb('0x37')]){_0xedc43c[_0xedeb('0x35')]=_[_0xedeb('0x38')](_0xedc43c['where'],{'$or':_[_0xedeb('0x27')](_0x9c5646,function(_0x26c6b5){if(_0x26c6b5[_0xedeb('0x2a')]!==_0xedeb('0x39')){var _0x4903f2={};_0x4903f2[_0x26c6b5[_0xedeb('0x25')]]={'$like':'%'+_0x42d0d0[_0xedeb('0x2b')][_0xedeb('0x37')]+'%'};return _0x4903f2;}})});}_0xedc43c=_[_0xedeb('0x38')]({},_0xedc43c,_0x42d0d0[_0xedeb('0x3a')]);var _0x1ee31e={'where':_0xedc43c['where']};return db[_0xedeb('0x3b')][_0xedeb('0x1a')](_0x1ee31e)[_0xedeb('0x21')](function(_0x4fdbe0){_0x366de0[_0xedeb('0x1a')]=_0x4fdbe0;if(_0x42d0d0[_0xedeb('0x2b')][_0xedeb('0x3c')]){_0xedc43c[_0xedeb('0x3d')]=[{'all':!![]}];}return db[_0xedeb('0x3b')]['findAll'](_0xedc43c);})[_0xedeb('0x21')](function(_0x48d9ad){_0x366de0['rows']=_0x48d9ad;return _0x366de0;})[_0xedeb('0x21')](respondWithFilteredResult(_0x36f06c,_0xedc43c))[_0xedeb('0x3e')](handleError(_0x36f06c,null));};exports['show']=function(_0x194b95,_0x3503a7){var _0x29b208={'raw':!![],'where':{'id':_0x194b95['params']['id']}},_0x11375a={};_0x11375a[_0xedeb('0x2f')]=_['keys'](db[_0xedeb('0x3b')][_0xedeb('0x28')]);_0x11375a[_0xedeb('0x2b')]=_[_0xedeb('0x2c')](_0x194b95[_0xedeb('0x2b')]);_0x11375a[_0xedeb('0x2d')]=_[_0xedeb('0x2e')](_0x11375a[_0xedeb('0x2f')],_0x11375a[_0xedeb('0x2b')]);_0x29b208[_0xedeb('0x30')]=_[_0xedeb('0x2e')](_0x11375a[_0xedeb('0x2f')],qs[_0xedeb('0x31')](_0x194b95[_0xedeb('0x2b')][_0xedeb('0x31')]));_0x29b208[_0xedeb('0x30')]=_0x29b208['attributes'][_0xedeb('0x32')]?_0x29b208[_0xedeb('0x30')]:_0x11375a[_0xedeb('0x2f')];if(_0x194b95[_0xedeb('0x2b')][_0xedeb('0x3c')]){_0x29b208[_0xedeb('0x3d')]=[{'all':!![]}];}_0x29b208=_[_0xedeb('0x38')]({},_0x29b208,_0x194b95[_0xedeb('0x3a')]);return db[_0xedeb('0x3b')][_0xedeb('0x3f')](_0x29b208)[_0xedeb('0x21')](handleEntityNotFound(_0x3503a7,null))[_0xedeb('0x21')](respondWithResult(_0x3503a7,null))['catch'](handleError(_0x3503a7,null));};exports[_0xedeb('0x20')]=function(_0x28b485,_0x1ee6d0){if(_0x28b485['body']['id']){delete _0x28b485[_0xedeb('0x40')]['id'];}return db[_0xedeb('0x3b')]['find']({'where':{'id':_0x28b485[_0xedeb('0x41')]['id']}})[_0xedeb('0x21')](handleEntityNotFound(_0x1ee6d0,null))[_0xedeb('0x21')](saveUpdates(_0x28b485[_0xedeb('0x40')],null))['then'](respondWithResult(_0x1ee6d0,null))['catch'](handleError(_0x1ee6d0,null));};exports[_0xedeb('0x22')]=function(_0x1846a5,_0x558594){return db[_0xedeb('0x3b')][_0xedeb('0x3f')]({'where':{'id':_0x1846a5[_0xedeb('0x41')]['id']}})[_0xedeb('0x21')](handleEntityNotFound(_0x558594,null))[_0xedeb('0x21')](removeEntity(_0x558594,null))[_0xedeb('0x3e')](handleError(_0x558594,null));};exports[_0xedeb('0x42')]=function(_0x3b3137,_0x5de3fb){return db[_0xedeb('0x3b')]['describe']()[_0xedeb('0x21')](respondWithResult(_0x5de3fb,null))[_0xedeb('0x3e')](handleError(_0x5de3fb,null));}; \ No newline at end of file +var _0xc558=['sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','error','name','send','index','CmHopperBlack','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','find','body','describe','fast-json-patch','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x38dcff,_0x129a00){var _0x17c442=function(_0x1bbaa4){while(--_0x1bbaa4){_0x38dcff['push'](_0x38dcff['shift']());}};_0x17c442(++_0x129a00);}(_0xc558,0x79));var _0x8c55=function(_0x1307c6,_0x5d69df){_0x1307c6=_0x1307c6-0x0;var _0x3b3c0b=_0xc558[_0x1307c6];return _0x3b3c0b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8c55('0x0'));var rp=require('request-promise');var moment=require(_0x8c55('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x8c55('0x2'));var util=require(_0x8c55('0x3'));var path=require('path');var sox=require(_0x8c55('0x4'));var csv=require(_0x8c55('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8c55('0x6'));var squel=require(_0x8c55('0x7'));var crypto=require(_0x8c55('0x8'));var jsforce=require(_0x8c55('0x9'));var deskjs=require(_0x8c55('0xa'));var toCsv=require(_0x8c55('0x5'));var querystring=require(_0x8c55('0xb'));var Papa=require(_0x8c55('0xc'));var Redis=require('ioredis');var authService=require(_0x8c55('0xd'));var qs=require(_0x8c55('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8c55('0xf'));var logger=require(_0x8c55('0x10'))(_0x8c55('0x11'));var utils=require(_0x8c55('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x8c55('0x13'));var db=require(_0x8c55('0x14'))['db'];function respondWithStatusCode(_0x10bcab,_0x2b8fb8){_0x2b8fb8=_0x2b8fb8||0xcc;return function(_0x55395b){if(_0x55395b){return _0x10bcab[_0x8c55('0x15')](_0x2b8fb8);}return _0x10bcab[_0x8c55('0x16')](_0x2b8fb8)[_0x8c55('0x17')]();};}function respondWithResult(_0x25fa44,_0x181ef5){_0x181ef5=_0x181ef5||0xc8;return function(_0x2318c1){if(_0x2318c1){return _0x25fa44[_0x8c55('0x16')](_0x181ef5)[_0x8c55('0x18')](_0x2318c1);}};}function respondWithFilteredResult(_0x5e1da7,_0x117b65){return function(_0x331f66){if(_0x331f66){var _0xc1b002=typeof _0x117b65[_0x8c55('0x19')]==='undefined'&&typeof _0x117b65[_0x8c55('0x1a')]===_0x8c55('0x1b');var _0x7838e=_0x331f66['count'];var _0xaf1f9=_0xc1b002?0x0:_0x117b65[_0x8c55('0x19')];var _0x1b1d8a=_0xc1b002?_0x331f66[_0x8c55('0x1c')]:_0x117b65['offset']+_0x117b65[_0x8c55('0x1a')];var _0x37203a;if(_0x1b1d8a>=_0x7838e){_0x1b1d8a=_0x7838e;_0x37203a=0xc8;}else{_0x37203a=0xce;}_0x5e1da7[_0x8c55('0x16')](_0x37203a);return _0x5e1da7[_0x8c55('0x1d')](_0x8c55('0x1e'),_0xaf1f9+'-'+_0x1b1d8a+'/'+_0x7838e)[_0x8c55('0x18')](_0x331f66);}return null;};}function patchUpdates(_0x4c1b93){return function(_0x30977c){try{jsonpatch[_0x8c55('0x1f')](_0x30977c,_0x4c1b93,!![]);}catch(_0x12d675){return BPromise[_0x8c55('0x20')](_0x12d675);}return _0x30977c[_0x8c55('0x21')]();};}function saveUpdates(_0x42963c,_0x259c3d){return function(_0x241acc){if(_0x241acc){return _0x241acc[_0x8c55('0x22')](_0x42963c)[_0x8c55('0x23')](function(_0x1c6c99){return _0x1c6c99;});}return null;};}function removeEntity(_0x46ab20,_0x31cac4){return function(_0x1bd19f){if(_0x1bd19f){return _0x1bd19f['destroy']()[_0x8c55('0x23')](function(){_0x46ab20[_0x8c55('0x16')](0xcc)[_0x8c55('0x17')]();});}};}function handleEntityNotFound(_0x39f435,_0x1900e2){return function(_0x414413){if(!_0x414413){_0x39f435['sendStatus'](0x194);}return _0x414413;};}function handleError(_0x12be1a,_0x3ccd27){_0x3ccd27=_0x3ccd27||0x1f4;return function(_0x21f2bc){logger[_0x8c55('0x24')](_0x21f2bc['stack']);if(_0x21f2bc[_0x8c55('0x25')]){delete _0x21f2bc['name'];}_0x12be1a[_0x8c55('0x16')](_0x3ccd27)[_0x8c55('0x26')](_0x21f2bc);};}exports[_0x8c55('0x27')]=function(_0x6f6920,_0x447f48){var _0x3bf3f9={},_0x4c0afe={},_0x50f3b6={'count':0x0,'rows':[]};var _0x1ae9d0=_['map'](db[_0x8c55('0x28')][_0x8c55('0x29')],function(_0x46765d){return{'name':_0x46765d[_0x8c55('0x2a')],'type':_0x46765d[_0x8c55('0x2b')]['key']};});_0x4c0afe['model']=_[_0x8c55('0x2c')](_0x1ae9d0,_0x8c55('0x25'));_0x4c0afe[_0x8c55('0x2d')]=_[_0x8c55('0x2e')](_0x6f6920[_0x8c55('0x2d')]);_0x4c0afe[_0x8c55('0x2f')]=_[_0x8c55('0x30')](_0x4c0afe[_0x8c55('0x31')],_0x4c0afe['query']);_0x3bf3f9[_0x8c55('0x32')]=_['intersection'](_0x4c0afe[_0x8c55('0x31')],qs[_0x8c55('0x33')](_0x6f6920['query'][_0x8c55('0x33')]));_0x3bf3f9[_0x8c55('0x32')]=_0x3bf3f9[_0x8c55('0x32')][_0x8c55('0x34')]?_0x3bf3f9['attributes']:_0x4c0afe[_0x8c55('0x31')];if(!_0x6f6920[_0x8c55('0x2d')][_0x8c55('0x35')]('nolimit')){_0x3bf3f9[_0x8c55('0x1a')]=qs[_0x8c55('0x1a')](_0x6f6920[_0x8c55('0x2d')][_0x8c55('0x1a')]);_0x3bf3f9[_0x8c55('0x19')]=qs[_0x8c55('0x19')](_0x6f6920[_0x8c55('0x2d')][_0x8c55('0x19')]);}_0x3bf3f9[_0x8c55('0x36')]=qs[_0x8c55('0x37')](_0x6f6920[_0x8c55('0x2d')]['sort']);_0x3bf3f9[_0x8c55('0x38')]=qs[_0x8c55('0x2f')](_[_0x8c55('0x39')](_0x6f6920[_0x8c55('0x2d')],_0x4c0afe[_0x8c55('0x2f')]),_0x1ae9d0);if(_0x6f6920[_0x8c55('0x2d')][_0x8c55('0x3a')]){_0x3bf3f9[_0x8c55('0x38')]=_[_0x8c55('0x3b')](_0x3bf3f9[_0x8c55('0x38')],{'$or':_[_0x8c55('0x2c')](_0x1ae9d0,function(_0x4f7e7a){if(_0x4f7e7a[_0x8c55('0x2b')]!==_0x8c55('0x3c')){var _0x1ea63d={};_0x1ea63d[_0x4f7e7a['name']]={'$like':'%'+_0x6f6920['query'][_0x8c55('0x3a')]+'%'};return _0x1ea63d;}})});}_0x3bf3f9=_[_0x8c55('0x3b')]({},_0x3bf3f9,_0x6f6920[_0x8c55('0x3d')]);var _0x506da0={'where':_0x3bf3f9[_0x8c55('0x38')]};return db[_0x8c55('0x28')][_0x8c55('0x1c')](_0x506da0)[_0x8c55('0x23')](function(_0x5c3edf){_0x50f3b6[_0x8c55('0x1c')]=_0x5c3edf;if(_0x6f6920[_0x8c55('0x2d')]['includeAll']){_0x3bf3f9['include']=[{'all':!![]}];}return db[_0x8c55('0x28')][_0x8c55('0x3e')](_0x3bf3f9);})[_0x8c55('0x23')](function(_0x45891a){_0x50f3b6[_0x8c55('0x3f')]=_0x45891a;return _0x50f3b6;})[_0x8c55('0x23')](respondWithFilteredResult(_0x447f48,_0x3bf3f9))[_0x8c55('0x40')](handleError(_0x447f48,null));};exports[_0x8c55('0x41')]=function(_0x264c9f,_0x51d3ec){var _0xbea21b={'raw':!![],'where':{'id':_0x264c9f[_0x8c55('0x42')]['id']}},_0x42d855={};_0x42d855[_0x8c55('0x31')]=_[_0x8c55('0x2e')](db['CmHopperBlack'][_0x8c55('0x29')]);_0x42d855[_0x8c55('0x2d')]=_[_0x8c55('0x2e')](_0x264c9f[_0x8c55('0x2d')]);_0x42d855['filters']=_[_0x8c55('0x30')](_0x42d855[_0x8c55('0x31')],_0x42d855[_0x8c55('0x2d')]);_0xbea21b[_0x8c55('0x32')]=_['intersection'](_0x42d855[_0x8c55('0x31')],qs[_0x8c55('0x33')](_0x264c9f[_0x8c55('0x2d')][_0x8c55('0x33')]));_0xbea21b[_0x8c55('0x32')]=_0xbea21b[_0x8c55('0x32')][_0x8c55('0x34')]?_0xbea21b[_0x8c55('0x32')]:_0x42d855[_0x8c55('0x31')];if(_0x264c9f[_0x8c55('0x2d')][_0x8c55('0x43')]){_0xbea21b['include']=[{'all':!![]}];}_0xbea21b=_[_0x8c55('0x3b')]({},_0xbea21b,_0x264c9f[_0x8c55('0x3d')]);return db[_0x8c55('0x28')][_0x8c55('0x44')](_0xbea21b)[_0x8c55('0x23')](handleEntityNotFound(_0x51d3ec,null))[_0x8c55('0x23')](respondWithResult(_0x51d3ec,null))[_0x8c55('0x40')](handleError(_0x51d3ec,null));};exports[_0x8c55('0x22')]=function(_0x479886,_0x5694de){if(_0x479886['body']['id']){delete _0x479886[_0x8c55('0x45')]['id'];}return db[_0x8c55('0x28')][_0x8c55('0x44')]({'where':{'id':_0x479886[_0x8c55('0x42')]['id']}})[_0x8c55('0x23')](handleEntityNotFound(_0x5694de,null))[_0x8c55('0x23')](saveUpdates(_0x479886[_0x8c55('0x45')],null))[_0x8c55('0x23')](respondWithResult(_0x5694de,null))[_0x8c55('0x40')](handleError(_0x5694de,null));};exports['destroy']=function(_0x2ef3cd,_0x55ddd8){return db[_0x8c55('0x28')]['find']({'where':{'id':_0x2ef3cd[_0x8c55('0x42')]['id']}})[_0x8c55('0x23')](handleEntityNotFound(_0x55ddd8,null))[_0x8c55('0x23')](removeEntity(_0x55ddd8,null))[_0x8c55('0x40')](handleError(_0x55ddd8,null));};exports[_0x8c55('0x46')]=function(_0x3c65f8,_0x2fcc65){return db[_0x8c55('0x28')][_0x8c55('0x46')]()[_0x8c55('0x23')](respondWithResult(_0x2fcc65,null))[_0x8c55('0x40')](handleError(_0x2fcc65,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 679cc96..f97b0cf 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 _0x7fb9=['request-promise','exports','define','CmHopperBlack','cm_hopper_black','lodash','util','api','moment','bluebird'];(function(_0x5f5baf,_0x430fce){var _0x36e933=function(_0x735729){while(--_0x735729){_0x5f5baf['push'](_0x5f5baf['shift']());}};_0x36e933(++_0x430fce);}(_0x7fb9,0x131));var _0x97fb=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x7fb9[_0x311c35];return _0x5cc50c;};'use strict';var _=require(_0x97fb('0x0'));var util=require(_0x97fb('0x1'));var logger=require('../../config/logger')(_0x97fb('0x2'));var moment=require(_0x97fb('0x3'));var BPromise=require(_0x97fb('0x4'));var rp=require(_0x97fb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmHopperBlack.attributes');module[_0x97fb('0x6')]=function(_0x383ce0,_0x18de8d){return _0x383ce0[_0x97fb('0x7')](_0x97fb('0x8'),attributes,{'tableName':_0x97fb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x27d9=['CmHopperBlack','cm_hopper_black','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define'];(function(_0x59e0b9,_0x4f1a66){var _0x2b6fb2=function(_0xd90b22){while(--_0xd90b22){_0x59e0b9['push'](_0x59e0b9['shift']());}};_0x2b6fb2(++_0x4f1a66);}(_0x27d9,0x9c));var _0x927d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x27d9[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x927d('0x0'));var logger=require(_0x927d('0x1'))(_0x927d('0x2'));var moment=require(_0x927d('0x3'));var BPromise=require(_0x927d('0x4'));var rp=require(_0x927d('0x5'));var fs=require('fs');var path=require(_0x927d('0x6'));var rimraf=require(_0x927d('0x7'));var config=require(_0x927d('0x8'));var attributes=require(_0x927d('0x9'));module[_0x927d('0xa')]=function(_0x5875f8,_0x558609){return _0x5875f8[_0x927d('0xb')](_0x927d('0xc'),attributes,{'tableName':_0x927d('0xd'),'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 d94bb3b..d4e5fd3 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 _0xc2d8=['util','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','limit','include','map','model','UpdateCmHopperBlack','body','debug','destroy','DestroyCmHopperBlack','lodash'];(function(_0x18f396,_0x174d17){var _0x3ba532=function(_0x2bc92f){while(--_0x2bc92f){_0x18f396['push'](_0x18f396['shift']());}};_0x3ba532(++_0x174d17);}(_0xc2d8,0x1e0));var _0x8c2d=function(_0x183b69,_0x21b23e){_0x183b69=_0x183b69-0x0;var _0x326224=_0xc2d8[_0x183b69];return _0x326224;};'use strict';var _=require(_0x8c2d('0x0'));var util=require(_0x8c2d('0x1'));var moment=require('moment');var BPromise=require(_0x8c2d('0x2'));var rs=require(_0x8c2d('0x3'));var fs=require('fs');var Redis=require(_0x8c2d('0x4'));var db=require(_0x8c2d('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8c2d('0x6'));var config=require('../../config/environment');var jayson=require(_0x8c2d('0x7'));var client=jayson[_0x8c2d('0x8')][_0x8c2d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3838d8,_0x42a6dc,_0x2bcfa9){return new BPromise(function(_0x50808a,_0x26702f){return client[_0x8c2d('0xa')](_0x3838d8,_0x2bcfa9)[_0x8c2d('0xb')](function(_0x25dc26){logger[_0x8c2d('0xc')](_0x8c2d('0xd'),_0x42a6dc,'request\x20sent');logger['debug'](_0x8c2d('0xe'),_0x42a6dc,_0x8c2d('0xf'),JSON[_0x8c2d('0x10')](_0x25dc26));if(_0x25dc26[_0x8c2d('0x11')]){if(_0x25dc26[_0x8c2d('0x11')][_0x8c2d('0x12')]===0x1f4){logger[_0x8c2d('0x11')](_0x8c2d('0xd'),_0x42a6dc,_0x25dc26[_0x8c2d('0x11')]['message']);return _0x26702f(_0x25dc26[_0x8c2d('0x11')][_0x8c2d('0x13')]);}logger[_0x8c2d('0x11')](_0x8c2d('0xd'),_0x42a6dc,_0x25dc26['error']['message']);return _0x50808a(_0x25dc26[_0x8c2d('0x11')][_0x8c2d('0x13')]);}else{logger[_0x8c2d('0xc')](_0x8c2d('0xd'),_0x42a6dc,_0x8c2d('0xf'));_0x50808a(_0x25dc26['result']['message']);}})[_0x8c2d('0x14')](function(_0x4226f4){logger['error'](_0x8c2d('0xd'),_0x42a6dc,_0x4226f4);_0x26702f(_0x4226f4);});});}exports[_0x8c2d('0x15')]=function(_0x3a396a){var _0x11c6c6=this;return new Promise(function(_0x482be4,_0x155847){return db[_0x8c2d('0x16')][_0x8c2d('0x17')]({'raw':_0x3a396a[_0x8c2d('0x18')]?_0x3a396a['options'][_0x8c2d('0x19')]===undefined?!![]:![]:!![],'where':_0x3a396a[_0x8c2d('0x18')]?_0x3a396a[_0x8c2d('0x18')][_0x8c2d('0x1a')]||null:null,'attributes':_0x3a396a[_0x8c2d('0x18')]?_0x3a396a[_0x8c2d('0x18')][_0x8c2d('0x1b')]||null:null,'limit':_0x3a396a['options']?_0x3a396a['options'][_0x8c2d('0x1c')]||null:null,'include':_0x3a396a[_0x8c2d('0x18')]?_0x3a396a[_0x8c2d('0x18')][_0x8c2d('0x1d')]?_[_0x8c2d('0x1e')](_0x3a396a[_0x8c2d('0x18')][_0x8c2d('0x1d')],function(_0x3a0f51){return{'model':db[_0x3a0f51[_0x8c2d('0x1f')]],'as':_0x3a0f51['as'],'attributes':_0x3a0f51[_0x8c2d('0x1b')],'include':_0x3a0f51[_0x8c2d('0x1d')]?_['map'](_0x3a0f51[_0x8c2d('0x1d')],function(_0x52293){return{'model':db[_0x52293[_0x8c2d('0x1f')]],'as':_0x52293['as'],'attributes':_0x52293[_0x8c2d('0x1b')],'include':_0x52293['include']?_[_0x8c2d('0x1e')](_0x52293['include'],function(_0x46cd7c){return{'model':db[_0x46cd7c[_0x8c2d('0x1f')]],'as':_0x46cd7c['as'],'attributes':_0x46cd7c[_0x8c2d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8c2d('0xb')](function(_0x1b3255){logger[_0x8c2d('0xc')](_0x8c2d('0x15'),_0x3a396a);logger['debug'](_0x8c2d('0x15'),_0x3a396a,JSON[_0x8c2d('0x10')](_0x1b3255));_0x482be4(_0x1b3255);})[_0x8c2d('0x14')](function(_0x53a085){logger[_0x8c2d('0x11')](_0x8c2d('0x15'),_0x53a085['message'],_0x3a396a);_0x155847(_0x11c6c6['error'](0x1f4,_0x53a085[_0x8c2d('0x13')]));});});};exports[_0x8c2d('0x20')]=function(_0x1cb22e){var _0x400acb=this;return new Promise(function(_0x159b34,_0x54d25d){return db[_0x8c2d('0x16')]['update'](_0x1cb22e[_0x8c2d('0x21')],{'raw':_0x1cb22e[_0x8c2d('0x18')]?_0x1cb22e[_0x8c2d('0x18')][_0x8c2d('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1cb22e[_0x8c2d('0x18')]?_0x1cb22e['options'][_0x8c2d('0x1a')]||null:null,'attributes':_0x1cb22e[_0x8c2d('0x18')]?_0x1cb22e[_0x8c2d('0x18')][_0x8c2d('0x1b')]||null:null,'limit':_0x1cb22e[_0x8c2d('0x18')]?_0x1cb22e['options'][_0x8c2d('0x1c')]||null:null})[_0x8c2d('0xb')](function(_0x1a3b4f){logger[_0x8c2d('0xc')](_0x8c2d('0x20'),_0x1cb22e);logger[_0x8c2d('0x22')]('UpdateCmHopperBlack',_0x1cb22e,JSON[_0x8c2d('0x10')](_0x1a3b4f));_0x159b34(_0x1a3b4f);})[_0x8c2d('0x14')](function(_0x302d7e){logger['error'](_0x8c2d('0x20'),_0x302d7e[_0x8c2d('0x13')],_0x1cb22e);_0x54d25d(_0x400acb[_0x8c2d('0x11')](0x1f4,_0x302d7e['message']));});});};exports['DestroyCmHopperBlack']=function(_0x28bb54){var _0x1a0ee0=this;return new Promise(function(_0x490ccf,_0x163fd7){return db[_0x8c2d('0x16')][_0x8c2d('0x23')]({'where':_0x28bb54[_0x8c2d('0x18')]?_0x28bb54[_0x8c2d('0x18')]['where']||null:null})[_0x8c2d('0xb')](function(_0x8bc6f7){logger[_0x8c2d('0xc')](_0x8c2d('0x24'),_0x28bb54);logger[_0x8c2d('0x22')](_0x8c2d('0x24'),_0x28bb54,JSON[_0x8c2d('0x10')](_0x8bc6f7));_0x490ccf(_0x8bc6f7);})[_0x8c2d('0x14')](function(_0x4108a3){logger[_0x8c2d('0x11')]('DestroyCmHopperBlack',_0x4108a3[_0x8c2d('0x13')],_0x28bb54);_0x163fd7(_0x1a0ee0[_0x8c2d('0x11')](0x1f4,_0x4108a3['message']));});});}; \ No newline at end of file +var _0xd970=['../../config/environment','jayson/promise','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetCmHopperBlack','findAll','options','raw','where','attributes','limit','include','map','model','catch','UpdateCmHopperBlack','CmHopperBlack','update','DestroyCmHopperBlack','destroy','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4eba1a,_0x12e1f0){var _0x40498d=function(_0x1031bb){while(--_0x1031bb){_0x4eba1a['push'](_0x4eba1a['shift']());}};_0x40498d(++_0x12e1f0);}(_0xd970,0x1a5));var _0x0d97=function(_0x5c052c,_0x68b960){_0x5c052c=_0x5c052c-0x0;var _0x85ed60=_0xd970[_0x5c052c];return _0x85ed60;};'use strict';var _=require('lodash');var util=require(_0x0d97('0x0'));var moment=require(_0x0d97('0x1'));var BPromise=require(_0x0d97('0x2'));var rs=require(_0x0d97('0x3'));var fs=require('fs');var Redis=require(_0x0d97('0x4'));var db=require(_0x0d97('0x5'))['db'];var utils=require(_0x0d97('0x6'));var logger=require(_0x0d97('0x7'))('rpc');var config=require(_0x0d97('0x8'));var jayson=require(_0x0d97('0x9'));var client=jayson['client'][_0x0d97('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57da61,_0x590557,_0x1e14fd){return new BPromise(function(_0x295968,_0x3a3bf0){return client[_0x0d97('0xb')](_0x57da61,_0x1e14fd)[_0x0d97('0xc')](function(_0x359ce8){logger[_0x0d97('0xd')](_0x0d97('0xe'),_0x590557,'request\x20sent');logger[_0x0d97('0xf')](_0x0d97('0x10'),_0x590557,_0x0d97('0x11'),JSON[_0x0d97('0x12')](_0x359ce8));if(_0x359ce8[_0x0d97('0x13')]){if(_0x359ce8[_0x0d97('0x13')][_0x0d97('0x14')]===0x1f4){logger['error'](_0x0d97('0xe'),_0x590557,_0x359ce8['error'][_0x0d97('0x15')]);return _0x3a3bf0(_0x359ce8[_0x0d97('0x13')][_0x0d97('0x15')]);}logger[_0x0d97('0x13')](_0x0d97('0xe'),_0x590557,_0x359ce8[_0x0d97('0x13')][_0x0d97('0x15')]);return _0x295968(_0x359ce8[_0x0d97('0x13')]['message']);}else{logger[_0x0d97('0xd')](_0x0d97('0xe'),_0x590557,_0x0d97('0x11'));_0x295968(_0x359ce8[_0x0d97('0x16')][_0x0d97('0x15')]);}})['catch'](function(_0x2dc235){logger[_0x0d97('0x13')](_0x0d97('0xe'),_0x590557,_0x2dc235);_0x3a3bf0(_0x2dc235);});});}exports[_0x0d97('0x17')]=function(_0xeb98fa){var _0xd64421=this;return new Promise(function(_0x2f7b39,_0x31266f){return db['CmHopperBlack'][_0x0d97('0x18')]({'raw':_0xeb98fa[_0x0d97('0x19')]?_0xeb98fa['options'][_0x0d97('0x1a')]===undefined?!![]:![]:!![],'where':_0xeb98fa[_0x0d97('0x19')]?_0xeb98fa['options'][_0x0d97('0x1b')]||null:null,'attributes':_0xeb98fa[_0x0d97('0x19')]?_0xeb98fa[_0x0d97('0x19')][_0x0d97('0x1c')]||null:null,'limit':_0xeb98fa[_0x0d97('0x19')]?_0xeb98fa[_0x0d97('0x19')][_0x0d97('0x1d')]||null:null,'include':_0xeb98fa['options']?_0xeb98fa[_0x0d97('0x19')][_0x0d97('0x1e')]?_[_0x0d97('0x1f')](_0xeb98fa[_0x0d97('0x19')]['include'],function(_0x31174e){return{'model':db[_0x31174e['model']],'as':_0x31174e['as'],'attributes':_0x31174e[_0x0d97('0x1c')],'include':_0x31174e[_0x0d97('0x1e')]?_[_0x0d97('0x1f')](_0x31174e[_0x0d97('0x1e')],function(_0x69c2a1){return{'model':db[_0x69c2a1[_0x0d97('0x20')]],'as':_0x69c2a1['as'],'attributes':_0x69c2a1[_0x0d97('0x1c')],'include':_0x69c2a1[_0x0d97('0x1e')]?_['map'](_0x69c2a1['include'],function(_0x116f3e){return{'model':db[_0x116f3e[_0x0d97('0x20')]],'as':_0x116f3e['as'],'attributes':_0x116f3e[_0x0d97('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0d97('0xc')](function(_0x1ff83f){logger['info']('GetCmHopperBlack',_0xeb98fa);logger[_0x0d97('0xf')](_0x0d97('0x17'),_0xeb98fa,JSON['stringify'](_0x1ff83f));_0x2f7b39(_0x1ff83f);})[_0x0d97('0x21')](function(_0x19a23a){logger[_0x0d97('0x13')]('GetCmHopperBlack',_0x19a23a[_0x0d97('0x15')],_0xeb98fa);_0x31266f(_0xd64421[_0x0d97('0x13')](0x1f4,_0x19a23a[_0x0d97('0x15')]));});});};exports[_0x0d97('0x22')]=function(_0x2f97ec){var _0x466395=this;return new Promise(function(_0x3ac39b,_0x3d24c8){return db[_0x0d97('0x23')][_0x0d97('0x24')](_0x2f97ec['body'],{'raw':_0x2f97ec['options']?_0x2f97ec[_0x0d97('0x19')][_0x0d97('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f97ec[_0x0d97('0x19')]?_0x2f97ec[_0x0d97('0x19')][_0x0d97('0x1b')]||null:null,'attributes':_0x2f97ec[_0x0d97('0x19')]?_0x2f97ec['options']['attributes']||null:null,'limit':_0x2f97ec[_0x0d97('0x19')]?_0x2f97ec[_0x0d97('0x19')][_0x0d97('0x1d')]||null:null})[_0x0d97('0xc')](function(_0x2ae4ed){logger[_0x0d97('0xd')](_0x0d97('0x22'),_0x2f97ec);logger[_0x0d97('0xf')]('UpdateCmHopperBlack',_0x2f97ec,JSON['stringify'](_0x2ae4ed));_0x3ac39b(_0x2ae4ed);})['catch'](function(_0x43a352){logger[_0x0d97('0x13')](_0x0d97('0x22'),_0x43a352[_0x0d97('0x15')],_0x2f97ec);_0x3d24c8(_0x466395[_0x0d97('0x13')](0x1f4,_0x43a352[_0x0d97('0x15')]));});});};exports[_0x0d97('0x25')]=function(_0x37fb81){var _0x56f489=this;return new Promise(function(_0x5c4c41,_0x4ef236){return db[_0x0d97('0x23')][_0x0d97('0x26')]({'where':_0x37fb81[_0x0d97('0x19')]?_0x37fb81['options']['where']||null:null})[_0x0d97('0xc')](function(_0x153d0c){logger[_0x0d97('0xd')](_0x0d97('0x25'),_0x37fb81);logger['debug'](_0x0d97('0x25'),_0x37fb81,JSON[_0x0d97('0x12')](_0x153d0c));_0x5c4c41(_0x153d0c);})[_0x0d97('0x21')](function(_0x589121){logger[_0x0d97('0x13')](_0x0d97('0x25'),_0x589121['message'],_0x37fb81);_0x4ef236(_0x56f489['error'](0x1f4,_0x589121['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 54804f5..c59b73d 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 _0xcaf2=['./cmHopperBlack.controller','get','isAuthenticated','/describe','describe','/:id','show','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service'];(function(_0x32a6f7,_0x5890e9){var _0x4e5269=function(_0x1634b4){while(--_0x1634b4){_0x32a6f7['push'](_0x32a6f7['shift']());}};_0x4e5269(++_0x5890e9);}(_0xcaf2,0x8a));var _0x2caf=function(_0x5e9689,_0x48e034){_0x5e9689=_0x5e9689-0x0;var _0x2fac94=_0xcaf2[_0x5e9689];return _0x2fac94;};'use strict';var multer=require(_0x2caf('0x0'));var util=require('util');var path=require(_0x2caf('0x1'));var timeout=require(_0x2caf('0x2'));var express=require('express');var router=express[_0x2caf('0x3')]();var fs_extra=require(_0x2caf('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2caf('0x5'));var config=require('../../config/environment');var controller=require(_0x2caf('0x6'));router[_0x2caf('0x7')]('/',auth[_0x2caf('0x8')](),controller['index']);router[_0x2caf('0x7')](_0x2caf('0x9'),auth[_0x2caf('0x8')](),controller[_0x2caf('0xa')]);router['get'](_0x2caf('0xb'),auth[_0x2caf('0x8')](),controller[_0x2caf('0xc')]);router[_0x2caf('0xd')](_0x2caf('0xb'),auth[_0x2caf('0x8')](),controller[_0x2caf('0xe')]);router[_0x2caf('0xf')](_0x2caf('0xb'),auth['isAuthenticated'](),controller[_0x2caf('0x10')]);module[_0x2caf('0x11')]=router; \ No newline at end of file +var _0xd8fb=['/describe','describe','show','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','get','index'];(function(_0x344eb0,_0x532fb1){var _0x111962=function(_0x53cd6c){while(--_0x53cd6c){_0x344eb0['push'](_0x344eb0['shift']());}};_0x111962(++_0x532fb1);}(_0xd8fb,0x99));var _0xbd8f=function(_0x5ab975,_0x1f1295){_0x5ab975=_0x5ab975-0x0;var _0xd918aa=_0xd8fb[_0x5ab975];return _0xd918aa;};'use strict';var multer=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var path=require(_0xbd8f('0x2'));var timeout=require(_0xbd8f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbd8f('0x4'));var interaction=require(_0xbd8f('0x5'));var config=require('../../config/environment');var controller=require(_0xbd8f('0x6'));router[_0xbd8f('0x7')]('/',auth['isAuthenticated'](),controller[_0xbd8f('0x8')]);router['get'](_0xbd8f('0x9'),auth['isAuthenticated'](),controller[_0xbd8f('0xa')]);router[_0xbd8f('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xbd8f('0xb')]);router[_0xbd8f('0xc')](_0xbd8f('0xd'),auth['isAuthenticated'](),controller[_0xbd8f('0xe')]);router[_0xbd8f('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xbd8f('0x10')]);module[_0xbd8f('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index d564704..e21035a 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 _0xb2c0=['sequelize','moment','INTEGER','STRING','DATE','getDataValue','endtime','followuptime','seconds','BOOLEAN'];(function(_0xcea54f,_0x171ac7){var _0x1b820f=function(_0x241e63){while(--_0x241e63){_0xcea54f['push'](_0xcea54f['shift']());}};_0x1b820f(++_0x171ac7);}(_0xb2c0,0x14a));var _0x0b2c=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xb2c0[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0x0b2c('0x0'));var moment=require(_0x0b2c('0x1'));module['exports']={'state':{'type':Sequelize[_0x0b2c('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x0b2c('0x3')]},'scheduledat':{'type':Sequelize[_0x0b2c('0x4')]},'countbusyretry':{'type':Sequelize[_0x0b2c('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x0b2c('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x0b2c('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x0b2c('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x0b2c('0x3')]},'originatecalleridname':{'type':Sequelize[_0x0b2c('0x3')]},'calleridnum':{'type':Sequelize[_0x0b2c('0x3')]},'calleridname':{'type':Sequelize[_0x0b2c('0x3')]},'starttime':{'type':Sequelize[_0x0b2c('0x4')]},'responsetime':{'type':Sequelize[_0x0b2c('0x4')]},'answertime':{'type':Sequelize[_0x0b2c('0x4')]},'droptime':{'type':Sequelize[_0x0b2c('0x4')]},'endtime':{'type':Sequelize[_0x0b2c('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x0b2c('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x0b2c('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x0b2c('0x3')]},'campaign':{'type':Sequelize[_0x0b2c('0x3')]},'campaigntype':{'type':Sequelize[_0x0b2c('0x3')]},'membername':{'type':Sequelize[_0x0b2c('0x3')]},'reason':{'type':Sequelize[_0x0b2c('0x3')]},'disposition':{'type':Sequelize[_0x0b2c('0x3')]},'secondDisposition':{'type':Sequelize[_0x0b2c('0x3')]},'thirdDisposition':{'type':Sequelize[_0x0b2c('0x3')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x209652){var _0x2e2cff=this[_0x0b2c('0x5')](_0x0b2c('0x6'));if(_0x2e2cff&&_0x209652){this['setDataValue'](_0x0b2c('0x7'),moment(_0x209652)['diff'](moment(_0x2e2cff),_0x0b2c('0x8')));}}},'amd':{'type':Sequelize[_0x0b2c('0x9')],'defaultValue':![]},'fax':{'type':Sequelize[_0x0b2c('0x9')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x0b2c('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x0b2c('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x0b2c('0x4')]},'callback':{'type':Sequelize[_0x0b2c('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x0b2c('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x0b2c('0x4')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0x0b2c('0x4')]},'recallme':{'type':Sequelize[_0x0b2c('0x9')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x0b2c('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x0b2c('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x0b2c('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x0b2c('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x0b2c('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x0b2c('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc976=['endtime','followuptime','diff','BOOLEAN','moment','INTEGER','STRING','DATE'];(function(_0x5b071a,_0x54b721){var _0x777d1e=function(_0x49f4a3){while(--_0x49f4a3){_0x5b071a['push'](_0x5b071a['shift']());}};_0x777d1e(++_0x54b721);}(_0xc976,0xac));var _0x6c97=function(_0x4dda15,_0x1ca3e7){_0x4dda15=_0x4dda15-0x0;var _0x3cdd6f=_0xc976[_0x4dda15];return _0x3cdd6f;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x6c97('0x0'));module['exports']={'state':{'type':Sequelize[_0x6c97('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x6c97('0x2')]},'scheduledat':{'type':Sequelize[_0x6c97('0x3')]},'countbusyretry':{'type':Sequelize[_0x6c97('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x6c97('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6c97('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x6c97('0x2')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x6c97('0x2')]},'calleridnum':{'type':Sequelize[_0x6c97('0x2')]},'calleridname':{'type':Sequelize[_0x6c97('0x2')]},'starttime':{'type':Sequelize[_0x6c97('0x3')]},'responsetime':{'type':Sequelize[_0x6c97('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x6c97('0x3')]},'endtime':{'type':Sequelize[_0x6c97('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x6c97('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x6c97('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x6c97('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x6c97('0x2')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x6c97('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x6c97('0x2')]},'thirdDisposition':{'type':Sequelize[_0x6c97('0x2')]},'dispositionat':{'type':Sequelize[_0x6c97('0x3')],'set':function(_0x49d0e3){var _0xf11701=this['getDataValue'](_0x6c97('0x4'));if(_0xf11701&&_0x49d0e3){this['setDataValue'](_0x6c97('0x5'),moment(_0x49d0e3)[_0x6c97('0x6')](moment(_0xf11701),'seconds'));}}},'amd':{'type':Sequelize[_0x6c97('0x7')],'defaultValue':![]},'fax':{'type':Sequelize[_0x6c97('0x7')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x6c97('0x7')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x6c97('0x7')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x6c97('0x3')]},'callback':{'type':Sequelize[_0x6c97('0x7')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x6c97('0x3')]},'deleted':{'type':Sequelize[_0x6c97('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x6c97('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x6c97('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0x6c97('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x6c97('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 1087be9..533fb6c 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 _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(_0x1b283a,_0x37ae9c){var _0x13a83c=function(_0x124185){while(--_0x124185){_0x1b283a['push'](_0x1b283a['shift']());}};_0x13a83c(++_0x37ae9c);}(_0xd117,0x182));var _0x7d11=function(_0x497948,_0x4ca60c){_0x497948=_0x497948-0x0;var _0x39bb36=_0xd117[_0x497948];return _0x39bb36;};'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 +var _0x524e=['destroy','name','send','index','map','rawAttributes','key','model','keys','filters','intersection','attributes','fields','query','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','CmHopperFinal','then','includeAll','include','findAll','rows','catch','show','length','find','describe','body','uniqueid','params','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2022,\x201,\x20null','countContactsIvrCampaignHopperFinal','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','VoiceQueueId','createdAt','select','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','updatedAt','from','cm_hopper_final','toString','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','VoiceQueueId\x20=\x20?','group','Campaign','ContactId','ANY_VALUE(calleridnum)','CampaignId','CampaignId\x20=\x20?','state\x20=\x20?','calleridnum','CmHopper','findOne','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','end','json','offset','limit','count','set','apply','reject','save','update'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x524e,0x15e));var _0xe524=function(_0x389c52,_0x33b03d){_0x389c52=_0x389c52-0x0;var _0x238efb=_0x524e[_0x389c52];return _0x238efb;};'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'];function respondWithStatusCode(_0x5077c1,_0x4b0f51){_0x4b0f51=_0x4b0f51||0xcc;return function(_0xfdc2a5){if(_0xfdc2a5){return _0x5077c1[_0xe524('0x1c')](_0x4b0f51);}return _0x5077c1[_0xe524('0x1d')](_0x4b0f51)[_0xe524('0x1e')]();};}function respondWithResult(_0x20a852,_0x57c1b6){_0x57c1b6=_0x57c1b6||0xc8;return function(_0x12ff75){if(_0x12ff75){return _0x20a852['status'](_0x57c1b6)[_0xe524('0x1f')](_0x12ff75);}};}function respondWithFilteredResult(_0x1b0af6,_0x48165e){return function(_0x569660){if(_0x569660){var _0x488fce=typeof _0x48165e[_0xe524('0x20')]==='undefined'&&typeof _0x48165e[_0xe524('0x21')]==='undefined';var _0x5c8736=_0x569660['count'];var _0x3a4027=_0x488fce?0x0:_0x48165e['offset'];var _0x11b2a1=_0x488fce?_0x569660[_0xe524('0x22')]:_0x48165e[_0xe524('0x20')]+_0x48165e[_0xe524('0x21')];var _0x5d7b17;if(_0x11b2a1>=_0x5c8736){_0x11b2a1=_0x5c8736;_0x5d7b17=0xc8;}else{_0x5d7b17=0xce;}_0x1b0af6[_0xe524('0x1d')](_0x5d7b17);return _0x1b0af6[_0xe524('0x23')]('Content-Range',_0x3a4027+'-'+_0x11b2a1+'/'+_0x5c8736)[_0xe524('0x1f')](_0x569660);}return null;};}function patchUpdates(_0x309f85){return function(_0x43a4f9){try{jsonpatch[_0xe524('0x24')](_0x43a4f9,_0x309f85,!![]);}catch(_0x1c4194){return BPromise[_0xe524('0x25')](_0x1c4194);}return _0x43a4f9[_0xe524('0x26')]();};}function saveUpdates(_0x375219,_0x7dfe97){return function(_0x5c4d21){if(_0x5c4d21){return _0x5c4d21[_0xe524('0x27')](_0x375219)['then'](function(_0x577d1f){return _0x577d1f;});}return null;};}function removeEntity(_0x2d2f83,_0x23df5e){return function(_0x1ad106){if(_0x1ad106){return _0x1ad106[_0xe524('0x28')]()['then'](function(){_0x2d2f83[_0xe524('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17e245,_0xcf5db){return function(_0xd62772){if(!_0xd62772){_0x17e245[_0xe524('0x1c')](0x194);}return _0xd62772;};}function handleError(_0x4102d9,_0xfd5965){_0xfd5965=_0xfd5965||0x1f4;return function(_0x2141db){logger['error'](_0x2141db['stack']);if(_0x2141db[_0xe524('0x29')]){delete _0x2141db[_0xe524('0x29')];}_0x4102d9[_0xe524('0x1d')](_0xfd5965)[_0xe524('0x2a')](_0x2141db);};}exports[_0xe524('0x2b')]=function(_0x5405e4,_0x52f140){var _0x4b1ff={},_0x25e7a7={},_0x3aedd9={'count':0x0,'rows':[]};var _0x8070e4=_[_0xe524('0x2c')](db['CmHopperFinal'][_0xe524('0x2d')],function(_0x9a7e98){return{'name':_0x9a7e98['fieldName'],'type':_0x9a7e98['type'][_0xe524('0x2e')]};});_0x25e7a7[_0xe524('0x2f')]=_['map'](_0x8070e4,_0xe524('0x29'));_0x25e7a7['query']=_[_0xe524('0x30')](_0x5405e4['query']);_0x25e7a7[_0xe524('0x31')]=_[_0xe524('0x32')](_0x25e7a7[_0xe524('0x2f')],_0x25e7a7['query']);_0x4b1ff[_0xe524('0x33')]=_['intersection'](_0x25e7a7[_0xe524('0x2f')],qs[_0xe524('0x34')](_0x5405e4[_0xe524('0x35')]['fields']));_0x4b1ff[_0xe524('0x33')]=_0x4b1ff[_0xe524('0x33')]['length']?_0x4b1ff[_0xe524('0x33')]:_0x25e7a7[_0xe524('0x2f')];if(!_0x5405e4[_0xe524('0x35')][_0xe524('0x36')]('nolimit')){_0x4b1ff[_0xe524('0x21')]=qs[_0xe524('0x21')](_0x5405e4[_0xe524('0x35')][_0xe524('0x21')]);_0x4b1ff[_0xe524('0x20')]=qs[_0xe524('0x20')](_0x5405e4[_0xe524('0x35')][_0xe524('0x20')]);}_0x4b1ff['order']=qs[_0xe524('0x37')](_0x5405e4['query'][_0xe524('0x37')]);_0x4b1ff[_0xe524('0x38')]=qs['filters'](_[_0xe524('0x39')](_0x5405e4['query'],_0x25e7a7[_0xe524('0x31')]),_0x8070e4);if(_0x5405e4[_0xe524('0x35')][_0xe524('0x3a')]){_0x4b1ff[_0xe524('0x38')]=_[_0xe524('0x3b')](_0x4b1ff[_0xe524('0x38')],{'$or':_[_0xe524('0x2c')](_0x8070e4,function(_0x13762c){if(_0x13762c['type']!==_0xe524('0x3c')){var _0x940c05={};_0x940c05[_0x13762c[_0xe524('0x29')]]={'$like':'%'+_0x5405e4[_0xe524('0x35')][_0xe524('0x3a')]+'%'};return _0x940c05;}})});}_0x4b1ff=_[_0xe524('0x3b')]({},_0x4b1ff,_0x5405e4[_0xe524('0x3d')]);var _0x158d45={'where':_0x4b1ff['where']};return db[_0xe524('0x3e')][_0xe524('0x22')](_0x158d45)[_0xe524('0x3f')](function(_0x59781b){_0x3aedd9[_0xe524('0x22')]=_0x59781b;if(_0x5405e4['query'][_0xe524('0x40')]){_0x4b1ff[_0xe524('0x41')]=[{'all':!![]}];}return db[_0xe524('0x3e')][_0xe524('0x42')](_0x4b1ff);})[_0xe524('0x3f')](function(_0x4746cd){_0x3aedd9[_0xe524('0x43')]=_0x4746cd;return _0x3aedd9;})['then'](respondWithFilteredResult(_0x52f140,_0x4b1ff))[_0xe524('0x44')](handleError(_0x52f140,null));};exports[_0xe524('0x45')]=function(_0x13c54c,_0x376505){var _0x438962={'raw':!![],'where':{'id':_0x13c54c['params']['id']}},_0x1ae283={};_0x1ae283[_0xe524('0x2f')]=_[_0xe524('0x30')](db[_0xe524('0x3e')]['rawAttributes']);_0x1ae283[_0xe524('0x35')]=_['keys'](_0x13c54c['query']);_0x1ae283[_0xe524('0x31')]=_[_0xe524('0x32')](_0x1ae283['model'],_0x1ae283[_0xe524('0x35')]);_0x438962[_0xe524('0x33')]=_[_0xe524('0x32')](_0x1ae283[_0xe524('0x2f')],qs['fields'](_0x13c54c['query'][_0xe524('0x34')]));_0x438962[_0xe524('0x33')]=_0x438962['attributes'][_0xe524('0x46')]?_0x438962['attributes']:_0x1ae283[_0xe524('0x2f')];if(_0x13c54c[_0xe524('0x35')][_0xe524('0x40')]){_0x438962[_0xe524('0x41')]=[{'all':!![]}];}_0x438962=_[_0xe524('0x3b')]({},_0x438962,_0x13c54c[_0xe524('0x3d')]);return db[_0xe524('0x3e')][_0xe524('0x47')](_0x438962)[_0xe524('0x3f')](handleEntityNotFound(_0x376505,null))[_0xe524('0x3f')](respondWithResult(_0x376505,null))[_0xe524('0x44')](handleError(_0x376505,null));};exports[_0xe524('0x48')]=function(_0x3d7ab7,_0x33b1c8){return db[_0xe524('0x3e')]['describe']()[_0xe524('0x3f')](respondWithResult(_0x33b1c8,null))['catch'](handleError(_0x33b1c8,null));};exports['update']=function(_0x24f313,_0x59fe6b){if(_0x24f313[_0xe524('0x49')][_0xe524('0x4a')]){delete _0x24f313['body'][_0xe524('0x4a')];}return db['CmHopperFinal']['find']({'where':{'uniqueid':_0x24f313[_0xe524('0x4b')]['id']}})[_0xe524('0x3f')](handleEntityNotFound(_0x59fe6b,null))[_0xe524('0x3f')](saveUpdates(_0x24f313['body'],null))['then'](respondWithResult(_0x59fe6b,null))['catch'](handleError(_0x59fe6b,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x4f7a64,_0x5477ca,_0x45f504){return db[_0xe524('0x3e')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x4f7a64[_0xe524('0x4b')]['id']},'attributes':[[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')]['literal'](_0xe524('0x4e')))),_0xe524('0x4f')],[db[_0xe524('0x4c')]['fn']('COUNT',db[_0xe524('0x4c')]['fn']('IF',db['sequelize'][_0xe524('0x50')](_0xe524('0x51')))),_0xe524('0x52')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')](_0xe524('0x53')))),_0xe524('0x54')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xe524('0x55')))),_0xe524('0x56')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')](_0xe524('0x57')))),_0xe524('0x58')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db['sequelize']['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')]('`state`\x20=\x2011\x20,\x201,\x20null'))),'abandonedContacts'],[db['sequelize']['fn']('COUNT',db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')](_0xe524('0x59')))),'reCallContacts'],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})[_0xe524('0x3f')](handleEntityNotFound(_0x5477ca,null))['then'](respondWithResult(_0x5477ca,null))[_0xe524('0x44')](handleError(_0x5477ca,null));};exports[_0xe524('0x5a')]=function(_0x3f4201,_0x287ab8,_0x2b2a0e){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'CampaignId':_0x3f4201[_0xe524('0x4b')]['id']},'attributes':[[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')]('`state`\x20=\x200,\x201,\x20null'))),_0xe524('0x4f')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db['sequelize']['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')](_0xe524('0x51')))),'noAnswerContacts'],[db['sequelize']['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')](_0xe524('0x53')))),'busyContacts'],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')](_0xe524('0x55')))),_0xe524('0x56')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')]['literal'](_0xe524('0x57')))),_0xe524('0x58')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db['sequelize'][_0xe524('0x50')](_0xe524('0x5b')))),_0xe524('0x5c')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')]['literal'](_0xe524('0x59')))),_0xe524('0x5d')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db['sequelize']['fn']('IF',db[_0xe524('0x4c')]['literal'](_0xe524('0x5e')))),_0xe524('0x5f')]]})[_0xe524('0x3f')](handleEntityNotFound(_0x287ab8,null))['then'](respondWithResult(_0x287ab8,null))[_0xe524('0x44')](handleError(_0x287ab8,null));};exports[_0xe524('0x60')]=function(_0x43d125,_0x13905f,_0x4514d4){return db['VoiceQueue'][_0xe524('0x47')]({'where':{'id':_0x43d125[_0xe524('0x4b')]['id']}})[_0xe524('0x3f')](handleEntityNotFound(_0x13905f,null))[_0xe524('0x3f')](function(_0x109da1){var _0x57b6bb;if(_0x109da1){_0x57b6bb=squel[_0xe524('0x61')]()[_0xe524('0x62')](_0xe524('0x63'))[_0xe524('0x64')]([_0xe524('0x65'),_0xe524('0x66'),'ContactId',_0xe524('0x67'),_0xe524('0x68'),_0xe524('0x69'),'updatedAt'],squel[_0xe524('0x6a')]()[_0xe524('0x6b')]('ANY_VALUE(calleridnum)',_0xe524('0x65'))[_0xe524('0x6b')](_0xe524('0x6c'),_0xe524('0x66'))[_0xe524('0x6b')](_0xe524('0x6d'),'ContactId')[_0xe524('0x6b')](_0xe524('0x6e'),_0xe524('0x67'))[_0xe524('0x6b')](_0xe524('0x6f'),_0xe524('0x68'))[_0xe524('0x6b')](_0xe524('0x6c'),_0xe524('0x69'))[_0xe524('0x6b')](_0xe524('0x6c'),_0xe524('0x70'))[_0xe524('0x71')](_0xe524('0x72'))[_0xe524('0x38')]('VoiceQueueId\x20=\x20?',_0x43d125[_0xe524('0x4b')]['id'][_0xe524('0x73')]())[_0xe524('0x38')]('state\x20=\x20?',_0x43d125[_0xe524('0x49')][_0xe524('0x74')]['toString']())['where'](_0xe524('0x75'))['where'](_0xe524('0x76'),squel['select']()[_0xe524('0x6b')](_0xe524('0x65'))[_0xe524('0x71')](_0xe524('0x63'))['where']('VoiceQueueId\x20=\x20?',_0x43d125[_0xe524('0x4b')]['id'][_0xe524('0x73')]()))['where'](_0xe524('0x76'),squel[_0xe524('0x6a')]()[_0xe524('0x6b')]('calleridnum')[_0xe524('0x71')](_0xe524('0x72'))[_0xe524('0x38')](_0xe524('0x77'),_0x43d125[_0xe524('0x4b')]['id'][_0xe524('0x73')]())['where']('state\x20=\x204'))[_0xe524('0x78')]('ContactId'))[_0xe524('0x73')]();return db[_0xe524('0x4c')][_0xe524('0x35')](_0x57b6bb);}return[];})['then'](respondWithResult(_0x13905f,null))[_0xe524('0x44')](handleError(_0x13905f,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x1681c5,_0x41e693,_0xfc62e5){return db[_0xe524('0x79')][_0xe524('0x47')]({'where':{'id':_0x1681c5[_0xe524('0x4b')]['id']}})['then'](handleEntityNotFound(_0x41e693,null))[_0xe524('0x3f')](function(_0x35d0f4){var _0xa8334;if(_0x35d0f4){_0xa8334=squel['insert']()[_0xe524('0x62')](_0xe524('0x63'))['fromQuery']([_0xe524('0x65'),_0xe524('0x66'),_0xe524('0x7a'),_0xe524('0x67'),'CampaignId',_0xe524('0x69'),_0xe524('0x70')],squel[_0xe524('0x6a')]()['field'](_0xe524('0x7b'),'phone')[_0xe524('0x6b')](_0xe524('0x6c'),_0xe524('0x66'))['field'](_0xe524('0x6d'),_0xe524('0x7a'))[_0xe524('0x6b')]('ANY_VALUE(ListId)','ListId')[_0xe524('0x6b')]('ANY_VALUE(CampaignId)',_0xe524('0x7c'))['field'](_0xe524('0x6c'),_0xe524('0x69'))['field'](_0xe524('0x6c'),_0xe524('0x70'))['from']('cm_hopper_final')[_0xe524('0x38')](_0xe524('0x7d'),_0x1681c5[_0xe524('0x4b')]['id']['toString']())[_0xe524('0x38')](_0xe524('0x7e'),_0x1681c5[_0xe524('0x49')][_0xe524('0x74')][_0xe524('0x73')]())[_0xe524('0x38')]('calleridnum\x20IS\x20NOT\x20NULL')[_0xe524('0x38')](_0xe524('0x76'),squel['select']()['field'](_0xe524('0x65'))[_0xe524('0x71')](_0xe524('0x63'))[_0xe524('0x38')]('CampaignId\x20=\x20?',_0x1681c5[_0xe524('0x4b')]['id'][_0xe524('0x73')]()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xe524('0x6a')]()[_0xe524('0x6b')](_0xe524('0x7f'))[_0xe524('0x71')](_0xe524('0x72'))[_0xe524('0x38')]('CampaignId\x20=\x20?',_0x1681c5['params']['id'][_0xe524('0x73')]())[_0xe524('0x38')]('state\x20=\x204'))['group'](_0xe524('0x7a')))[_0xe524('0x73')]();return db[_0xe524('0x4c')][_0xe524('0x35')](_0xa8334);}return[];})[_0xe524('0x3f')](respondWithResult(_0x41e693,null))[_0xe524('0x44')](handleError(_0x41e693,null));};exports['checkContactHopper']=function(_0x555801,_0x3e8668,_0x390093){return db[_0xe524('0x80')][_0xe524('0x81')]({'where':{'VoiceQueueId':_0x555801[_0xe524('0x49')][_0xe524('0x68')],'CampaignId':_0x555801[_0xe524('0x49')][_0xe524('0x7c')],'ContactId':_0x555801['body'][_0xe524('0x7a')]}})[_0xe524('0x3f')](handleEntityNotFound(_0x3e8668,null))[_0xe524('0x3f')](function(_0x5242b7){if(_0x5242b7){return _0x5242b7;}return null;})['then'](respondWithResult(_0x3e8668,null))[_0xe524('0x44')](handleError(_0x3e8668,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index ab85b86..556c143 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 _0x9d93=['cm_hopper_final','calleridnum','uniqueid','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal'];(function(_0x5c1449,_0x2af4b4){var _0x270473=function(_0x1461b6){while(--_0x1461b6){_0x5c1449['push'](_0x5c1449['shift']());}};_0x270473(++_0x2af4b4);}(_0x9d93,0x189));var _0x39d9=function(_0x29c7b7,_0x4bdfbf){_0x29c7b7=_0x29c7b7-0x0;var _0x68d9b8=_0x9d93[_0x29c7b7];return _0x68d9b8;};'use strict';var _=require(_0x39d9('0x0'));var util=require(_0x39d9('0x1'));var logger=require('../../config/logger')(_0x39d9('0x2'));var moment=require(_0x39d9('0x3'));var BPromise=require('bluebird');var rp=require(_0x39d9('0x4'));var fs=require('fs');var path=require(_0x39d9('0x5'));var rimraf=require(_0x39d9('0x6'));var config=require(_0x39d9('0x7'));var attributes=require(_0x39d9('0x8'));module[_0x39d9('0x9')]=function(_0x678ec5,_0x31e21b){return _0x678ec5[_0x39d9('0xa')](_0x39d9('0xb'),attributes,{'tableName':_0x39d9('0xc'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0x39d9('0xd')]},{'name':_0x39d9('0xe'),'fields':[_0x39d9('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xac64=['path','rimraf','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','../../config/logger','bluebird','request-promise'];(function(_0x42f84b,_0x2c5c92){var _0x297881=function(_0x21b0cf){while(--_0x21b0cf){_0x42f84b['push'](_0x42f84b['shift']());}};_0x297881(++_0x2c5c92);}(_0xac64,0x13b));var _0x4ac6=function(_0x2f5093,_0x40ceef){_0x2f5093=_0x2f5093-0x0;var _0x25b3c4=_0xac64[_0x2f5093];return _0x25b3c4;};'use strict';var _=require(_0x4ac6('0x0'));var util=require('util');var logger=require(_0x4ac6('0x1'))('api');var moment=require('moment');var BPromise=require(_0x4ac6('0x2'));var rp=require(_0x4ac6('0x3'));var fs=require('fs');var path=require(_0x4ac6('0x4'));var rimraf=require(_0x4ac6('0x5'));var config=require('../../config/environment');var attributes=require('./cmHopperFinal.attributes');module['exports']=function(_0x5274e9,_0x5708f0){return _0x5274e9[_0x4ac6('0x6')](_0x4ac6('0x7'),attributes,{'tableName':_0x4ac6('0x8'),'paranoid':![],'indexes':[{'name':_0x4ac6('0x9'),'fields':[_0x4ac6('0x9')]},{'name':_0x4ac6('0xa'),'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 43776f0..8787649 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x300723,_0x4d6db8){var _0x25ccac=function(_0x5d9c80){while(--_0x5d9c80){_0x300723['push'](_0x300723['shift']());}};_0x25ccac(++_0x4d6db8);}(_0xb10b,0x12a));var _0xbb10=function(_0x2287c3,_0x2b34e2){_0x2287c3=_0x2287c3-0x0;var _0x448916=_0xb10b[_0x2287c3];return _0x448916;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x2ee50b,_0x551e39){var _0x3ba02d=function(_0x253c37){while(--_0x253c37){_0x2ee50b['push'](_0x2ee50b['shift']());}};_0x3ba02d(++_0x551e39);}(_0xb10b,0x12a));var _0xbb10=function(_0x1d130e,_0x314633){_0x1d130e=_0x1d130e-0x0;var _0x156c2f=_0xb10b[_0x1d130e];return _0x156c2f;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 4d738c0..00eaf9f 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 _0x2711=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','describe','/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','update','exports','util','path'];(function(_0x3ead04,_0x39bccf){var _0x142c29=function(_0x394f0a){while(--_0x394f0a){_0x3ead04['push'](_0x3ead04['shift']());}};_0x142c29(++_0x39bccf);}(_0x2711,0x1e1));var _0x1271=function(_0x2d0bb7,_0x12d5a9){_0x2d0bb7=_0x2d0bb7-0x0;var _0x4b9432=_0x2711[_0x2d0bb7];return _0x4b9432;};'use strict';var multer=require('multer');var util=require(_0x1271('0x0'));var path=require(_0x1271('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1271('0x2')]();var fs_extra=require(_0x1271('0x3'));var auth=require(_0x1271('0x4'));var interaction=require(_0x1271('0x5'));var config=require(_0x1271('0x6'));var controller=require(_0x1271('0x7'));router[_0x1271('0x8')]('/',auth[_0x1271('0x9')](),controller['index']);router[_0x1271('0x8')]('/describe',auth[_0x1271('0x9')](),controller[_0x1271('0xa')]);router[_0x1271('0x8')](_0x1271('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1271('0x8')]('/voice/queue/countAttributes/:id',auth[_0x1271('0x9')](),controller[_0x1271('0xc')]);router[_0x1271('0x8')](_0x1271('0xd'),auth['isAuthenticated'](),controller[_0x1271('0xe')]);router[_0x1271('0xf')]('/voice/queue/moveContacts/:id',auth[_0x1271('0x9')](),controller[_0x1271('0x10')]);router['post'](_0x1271('0x11'),auth[_0x1271('0x9')](),controller[_0x1271('0x12')]);router[_0x1271('0xf')](_0x1271('0x13'),auth[_0x1271('0x9')](),controller[_0x1271('0x14')]);router['put'](_0x1271('0xb'),auth['isAuthenticated'](),controller[_0x1271('0x15')]);module[_0x1271('0x16')]=router; \ No newline at end of file +var _0x988c=['multer','express','Router','fs-extra','./cmHopperFinal.controller','get','isAuthenticated','/describe','/:id','show','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','post','/voice/queue/moveContacts/:id','/checkContactHopper','checkContactHopper','update','exports'];(function(_0x1603a3,_0x3d77bd){var _0x90be91=function(_0x39d80c){while(--_0x39d80c){_0x1603a3['push'](_0x1603a3['shift']());}};_0x90be91(++_0x3d77bd);}(_0x988c,0x19e));var _0xc988=function(_0xc9630,_0x339c24){_0xc9630=_0xc9630-0x0;var _0x10e7f3=_0x988c[_0xc9630];return _0x10e7f3;};'use strict';var multer=require(_0xc988('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc988('0x1'));var router=express[_0xc988('0x2')]();var fs_extra=require(_0xc988('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc988('0x4'));router[_0xc988('0x5')]('/',auth[_0xc988('0x6')](),controller['index']);router[_0xc988('0x5')](_0xc988('0x7'),auth['isAuthenticated'](),controller['describe']);router[_0xc988('0x5')](_0xc988('0x8'),auth[_0xc988('0x6')](),controller[_0xc988('0x9')]);router[_0xc988('0x5')]('/voice/queue/countAttributes/:id',auth[_0xc988('0x6')](),controller[_0xc988('0xa')]);router[_0xc988('0x5')](_0xc988('0xb'),auth[_0xc988('0x6')](),controller['countContactsIvrCampaignHopperFinal']);router[_0xc988('0xc')](_0xc988('0xd'),auth[_0xc988('0x6')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0xc988('0xc')]('/voice/campaign/moveContacts/:id',auth[_0xc988('0x6')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0xc988('0xc')](_0xc988('0xe'),auth[_0xc988('0x6')](),controller[_0xc988('0xf')]);router['put'](_0xc988('0x8'),auth[_0xc988('0x6')](),controller[_0xc988('0x10')]);module[_0xc988('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index fb97e55..810a369 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 _0xd585=['INTEGER','STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x24fdd7,_0xe598bf){var _0x38931b=function(_0x114027){while(--_0x114027){_0x24fdd7['push'](_0x24fdd7['shift']());}};_0x38931b(++_0xe598bf);}(_0xd585,0x130));var _0x5d58=function(_0x528623,_0x19a3f9){_0x528623=_0x528623-0x0;var _0xa76ff1=_0xd585[_0x528623];return _0xa76ff1;};'use strict';var Sequelize=require(_0x5d58('0x0'));module[_0x5d58('0x1')]={'state':{'type':Sequelize[_0x5d58('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x5d58('0x3')]},'scheduledat':{'type':Sequelize[_0x5d58('0x4')]},'countbusyretry':{'type':Sequelize[_0x5d58('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5d58('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x5d58('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x5d58('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x5d58('0x3')]},'calleridnum':{'type':Sequelize[_0x5d58('0x3')]},'calleridname':{'type':Sequelize[_0x5d58('0x3')]},'starttime':{'type':Sequelize[_0x5d58('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x5d58('0x4')]},'droptime':{'type':Sequelize[_0x5d58('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x5d58('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x5d58('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x5d58('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x5d58('0x3')]},'campaign':{'type':Sequelize[_0x5d58('0x3')]},'campaigntype':{'type':Sequelize[_0x5d58('0x3')]},'membername':{'type':Sequelize[_0x5d58('0x3')]},'reason':{'type':Sequelize[_0x5d58('0x3')]},'amd':{'type':Sequelize[_0x5d58('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x5d58('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x5d58('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5d58('0x4')]},'recallme':{'type':Sequelize[_0x5d58('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x5d58('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x5d58('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x5d58('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5d58('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x9e6e=['INTEGER','STRING','DATE','BOOLEAN','exports'];(function(_0x406f66,_0x5779e1){var _0x3d4321=function(_0x30825e){while(--_0x30825e){_0x406f66['push'](_0x406f66['shift']());}};_0x3d4321(++_0x5779e1);}(_0x9e6e,0x126));var _0xe9e6=function(_0x3edd9a,_0x1dddcc){_0x3edd9a=_0x3edd9a-0x0;var _0x258cd1=_0x9e6e[_0x3edd9a];return _0x258cd1;};'use strict';var Sequelize=require('sequelize');module[_0xe9e6('0x0')]={'state':{'type':Sequelize[_0xe9e6('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xe9e6('0x2')]},'scheduledat':{'type':Sequelize[_0xe9e6('0x3')]},'countbusyretry':{'type':Sequelize[_0xe9e6('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xe9e6('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xe9e6('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xe9e6('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xe9e6('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xe9e6('0x2')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xe9e6('0x3')]},'droptime':{'type':Sequelize[_0xe9e6('0x3')]},'endtime':{'type':Sequelize[_0xe9e6('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xe9e6('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xe9e6('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xe9e6('0x2')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xe9e6('0x2')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0xe9e6('0x4')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0xe9e6('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xe9e6('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xe9e6('0x3')]},'recallme':{'type':Sequelize[_0xe9e6('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xe9e6('0x3')]},'edited':{'type':Sequelize[_0xe9e6('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xe9e6('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xe9e6('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xe9e6('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xe9e6('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xe9e6('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 710775d..a3344fb 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 _0xca5c=['../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','reject','save','update','destroy','error','name','send','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','filter','options','then','include','findAll','rows','params','length','includeAll','catch','create','body','describe','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x564821,_0x4d037e){var _0x2b604d=function(_0x26fabf){while(--_0x26fabf){_0x564821['push'](_0x564821['shift']());}};_0x2b604d(++_0x4d037e);}(_0xca5c,0x1b7));var _0xcca5=function(_0x5e4563,_0x3ff918){_0x5e4563=_0x5e4563-0x0;var _0x8d1bf5=_0xca5c[_0x5e4563];return _0x8d1bf5;};'use strict';var emlformat=require(_0xcca5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcca5('0x1'));var jsonpatch=require(_0xcca5('0x2'));var rp=require(_0xcca5('0x3'));var moment=require(_0xcca5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xcca5('0x5'));var util=require(_0xcca5('0x6'));var path=require(_0xcca5('0x7'));var sox=require('sox');var csv=require(_0xcca5('0x8'));var ejs=require(_0xcca5('0x9'));var fs=require('fs');var fs_extra=require(_0xcca5('0xa'));var _=require(_0xcca5('0xb'));var squel=require(_0xcca5('0xc'));var crypto=require(_0xcca5('0xd'));var jsforce=require(_0xcca5('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xcca5('0x8'));var querystring=require(_0xcca5('0xf'));var Papa=require(_0xcca5('0x10'));var Redis=require(_0xcca5('0x11'));var authService=require(_0xcca5('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xcca5('0x13'));var hardwareService=require(_0xcca5('0x14'));var logger=require(_0xcca5('0x15'))(_0xcca5('0x16'));var utils=require(_0xcca5('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xcca5('0x18'));var db=require(_0xcca5('0x19'))['db'];function respondWithStatusCode(_0x20a815,_0x5cb1c5){_0x5cb1c5=_0x5cb1c5||0xcc;return function(_0x43426c){if(_0x43426c){return _0x20a815[_0xcca5('0x1a')](_0x5cb1c5);}return _0x20a815['status'](_0x5cb1c5)[_0xcca5('0x1b')]();};}function respondWithResult(_0x21c07e,_0x2fa398){_0x2fa398=_0x2fa398||0xc8;return function(_0x818e7e){if(_0x818e7e){return _0x21c07e['status'](_0x2fa398)[_0xcca5('0x1c')](_0x818e7e);}};}function respondWithFilteredResult(_0x22e962,_0x43e9a2){return function(_0x478458){if(_0x478458){var _0x5dff51=typeof _0x43e9a2[_0xcca5('0x1d')]===_0xcca5('0x1e')&&typeof _0x43e9a2[_0xcca5('0x1f')]===_0xcca5('0x1e');var _0x598c0b=_0x478458[_0xcca5('0x20')];var _0x10c77b=_0x5dff51?0x0:_0x43e9a2['offset'];var _0x367d34=_0x5dff51?_0x478458['count']:_0x43e9a2['offset']+_0x43e9a2['limit'];var _0x46af71;if(_0x367d34>=_0x598c0b){_0x367d34=_0x598c0b;_0x46af71=0xc8;}else{_0x46af71=0xce;}_0x22e962[_0xcca5('0x21')](_0x46af71);return _0x22e962[_0xcca5('0x22')]('Content-Range',_0x10c77b+'-'+_0x367d34+'/'+_0x598c0b)['json'](_0x478458);}return null;};}function patchUpdates(_0x371a88){return function(_0x21ae30){try{jsonpatch[_0xcca5('0x23')](_0x21ae30,_0x371a88,!![]);}catch(_0x5c4fc9){return BPromise[_0xcca5('0x24')](_0x5c4fc9);}return _0x21ae30[_0xcca5('0x25')]();};}function saveUpdates(_0x3853ea,_0x42d3d8){return function(_0x4ca8db){if(_0x4ca8db){return _0x4ca8db[_0xcca5('0x26')](_0x3853ea)['then'](function(_0x41c013){return _0x41c013;});}return null;};}function removeEntity(_0xf12b24,_0x2d93eb){return function(_0x2f6110){if(_0x2f6110){return _0x2f6110[_0xcca5('0x27')]()['then'](function(){_0xf12b24[_0xcca5('0x21')](0xcc)[_0xcca5('0x1b')]();});}};}function handleEntityNotFound(_0x527984,_0x366fbf){return function(_0x301015){if(!_0x301015){_0x527984[_0xcca5('0x1a')](0x194);}return _0x301015;};}function handleError(_0x3b426a,_0x385f9a){_0x385f9a=_0x385f9a||0x1f4;return function(_0x9ded7f){logger[_0xcca5('0x28')](_0x9ded7f['stack']);if(_0x9ded7f[_0xcca5('0x29')]){delete _0x9ded7f[_0xcca5('0x29')];}_0x3b426a[_0xcca5('0x21')](_0x385f9a)[_0xcca5('0x2a')](_0x9ded7f);};}exports['index']=function(_0x4d50f5,_0x228671){var _0x8e774d={},_0x1bcb35={},_0x232fd8={'count':0x0,'rows':[]};var _0x4b1a34=_[_0xcca5('0x2b')](db[_0xcca5('0x2c')][_0xcca5('0x2d')],function(_0x34482b){return{'name':_0x34482b[_0xcca5('0x2e')],'type':_0x34482b[_0xcca5('0x2f')][_0xcca5('0x30')]};});_0x1bcb35[_0xcca5('0x31')]=_[_0xcca5('0x2b')](_0x4b1a34,_0xcca5('0x29'));_0x1bcb35[_0xcca5('0x32')]=_[_0xcca5('0x33')](_0x4d50f5['query']);_0x1bcb35[_0xcca5('0x34')]=_[_0xcca5('0x35')](_0x1bcb35[_0xcca5('0x31')],_0x1bcb35[_0xcca5('0x32')]);_0x8e774d[_0xcca5('0x36')]=_['intersection'](_0x1bcb35[_0xcca5('0x31')],qs[_0xcca5('0x37')](_0x4d50f5[_0xcca5('0x32')][_0xcca5('0x37')]));_0x8e774d['attributes']=_0x8e774d[_0xcca5('0x36')]['length']?_0x8e774d[_0xcca5('0x36')]:_0x1bcb35[_0xcca5('0x31')];if(!_0x4d50f5[_0xcca5('0x32')][_0xcca5('0x38')](_0xcca5('0x39'))){_0x8e774d['limit']=qs[_0xcca5('0x1f')](_0x4d50f5[_0xcca5('0x32')][_0xcca5('0x1f')]);_0x8e774d[_0xcca5('0x1d')]=qs[_0xcca5('0x1d')](_0x4d50f5[_0xcca5('0x32')][_0xcca5('0x1d')]);}_0x8e774d[_0xcca5('0x3a')]=qs['sort'](_0x4d50f5[_0xcca5('0x32')]['sort']);_0x8e774d[_0xcca5('0x3b')]=qs[_0xcca5('0x34')](_[_0xcca5('0x3c')](_0x4d50f5[_0xcca5('0x32')],_0x1bcb35[_0xcca5('0x34')]),_0x4b1a34);if(_0x4d50f5['query']['filter']){_0x8e774d[_0xcca5('0x3b')]=_[_0xcca5('0x3d')](_0x8e774d[_0xcca5('0x3b')],{'$or':_[_0xcca5('0x2b')](_0x4b1a34,function(_0x5e1f02){if(_0x5e1f02['type']!==_0xcca5('0x3e')){var _0x49f13b={};_0x49f13b[_0x5e1f02['name']]={'$like':'%'+_0x4d50f5[_0xcca5('0x32')][_0xcca5('0x3f')]+'%'};return _0x49f13b;}})});}_0x8e774d=_[_0xcca5('0x3d')]({},_0x8e774d,_0x4d50f5[_0xcca5('0x40')]);var _0x12db4c={'where':_0x8e774d[_0xcca5('0x3b')]};return db['CmHopperHistory'][_0xcca5('0x20')](_0x12db4c)[_0xcca5('0x41')](function(_0x179c47){_0x232fd8['count']=_0x179c47;if(_0x4d50f5[_0xcca5('0x32')]['includeAll']){_0x8e774d[_0xcca5('0x42')]=[{'all':!![]}];}return db[_0xcca5('0x2c')][_0xcca5('0x43')](_0x8e774d);})[_0xcca5('0x41')](function(_0x1b948d){_0x232fd8[_0xcca5('0x44')]=_0x1b948d;return _0x232fd8;})['then'](respondWithFilteredResult(_0x228671,_0x8e774d))['catch'](handleError(_0x228671,null));};exports['show']=function(_0x1f975b,_0x30a984){var _0x29ab8d={'raw':!![],'where':{'id':_0x1f975b[_0xcca5('0x45')]['id']}},_0x110aa3={};_0x110aa3[_0xcca5('0x31')]=_[_0xcca5('0x33')](db[_0xcca5('0x2c')]['rawAttributes']);_0x110aa3[_0xcca5('0x32')]=_[_0xcca5('0x33')](_0x1f975b[_0xcca5('0x32')]);_0x110aa3['filters']=_[_0xcca5('0x35')](_0x110aa3['model'],_0x110aa3['query']);_0x29ab8d['attributes']=_[_0xcca5('0x35')](_0x110aa3[_0xcca5('0x31')],qs[_0xcca5('0x37')](_0x1f975b[_0xcca5('0x32')][_0xcca5('0x37')]));_0x29ab8d[_0xcca5('0x36')]=_0x29ab8d[_0xcca5('0x36')][_0xcca5('0x46')]?_0x29ab8d[_0xcca5('0x36')]:_0x110aa3[_0xcca5('0x31')];if(_0x1f975b[_0xcca5('0x32')][_0xcca5('0x47')]){_0x29ab8d[_0xcca5('0x42')]=[{'all':!![]}];}_0x29ab8d=_['merge']({},_0x29ab8d,_0x1f975b['options']);return db['CmHopperHistory']['find'](_0x29ab8d)[_0xcca5('0x41')](handleEntityNotFound(_0x30a984,null))[_0xcca5('0x41')](respondWithResult(_0x30a984,null))[_0xcca5('0x48')](handleError(_0x30a984,null));};exports[_0xcca5('0x49')]=function(_0x3d09eb,_0xf16366){return db[_0xcca5('0x2c')][_0xcca5('0x49')](_0x3d09eb[_0xcca5('0x4a')],{})[_0xcca5('0x41')](respondWithResult(_0xf16366,0xc9))['catch'](handleError(_0xf16366,null));};exports[_0xcca5('0x4b')]=function(_0x492191,_0x4d7538){return db[_0xcca5('0x2c')][_0xcca5('0x4b')]()[_0xcca5('0x41')](respondWithResult(_0x4d7538,null))['catch'](handleError(_0x4d7538,null));};exports[_0xcca5('0x26')]=function(_0x5d1c79,_0x259008){if(_0x5d1c79[_0xcca5('0x4a')]['uniqueid']){delete _0x5d1c79[_0xcca5('0x4a')]['uniqueid'];}return db[_0xcca5('0x2c')][_0xcca5('0x4c')]({'where':{'uniqueid':_0x5d1c79[_0xcca5('0x45')]['id']}})[_0xcca5('0x41')](handleEntityNotFound(_0x259008,null))[_0xcca5('0x41')](saveUpdates(_0x5d1c79[_0xcca5('0x4a')],null))['then'](respondWithResult(_0x259008,null))['catch'](handleError(_0x259008,null));}; \ No newline at end of file +var _0xf7b5=['eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','save','update','then','name','send','index','CmHopperHistory','rawAttributes','type','key','map','keys','query','model','attributes','intersection','fields','length','nolimit','limit','order','sort','filters','pick','filter','where','merge','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','uniqueid'];(function(_0x389cda,_0x31155c){var _0x5889bc=function(_0x32f473){while(--_0x32f473){_0x389cda['push'](_0x389cda['shift']());}};_0x5889bc(++_0x31155c);}(_0xf7b5,0x120));var _0x5f7b=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0xf7b5[_0x4f9b18];return _0x29f20c;};'use strict';var emlformat=require(_0x5f7b('0x0'));var rimraf=require(_0x5f7b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5f7b('0x2'));var rp=require(_0x5f7b('0x3'));var moment=require('moment');var BPromise=require(_0x5f7b('0x4'));var Mustache=require(_0x5f7b('0x5'));var util=require('util');var path=require(_0x5f7b('0x6'));var sox=require(_0x5f7b('0x7'));var csv=require(_0x5f7b('0x8'));var ejs=require(_0x5f7b('0x9'));var fs=require('fs');var fs_extra=require(_0x5f7b('0xa'));var _=require('lodash');var squel=require(_0x5f7b('0xb'));var crypto=require(_0x5f7b('0xc'));var jsforce=require(_0x5f7b('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5f7b('0xe'));var Papa=require(_0x5f7b('0xf'));var Redis=require(_0x5f7b('0x10'));var authService=require(_0x5f7b('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5f7b('0x12'));var logger=require(_0x5f7b('0x13'))(_0x5f7b('0x14'));var utils=require(_0x5f7b('0x15'));var config=require(_0x5f7b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5f7b('0x17'))['db'];function respondWithStatusCode(_0x1afe6b,_0x6944d9){_0x6944d9=_0x6944d9||0xcc;return function(_0x2088cf){if(_0x2088cf){return _0x1afe6b[_0x5f7b('0x18')](_0x6944d9);}return _0x1afe6b[_0x5f7b('0x19')](_0x6944d9)[_0x5f7b('0x1a')]();};}function respondWithResult(_0x35a5dd,_0x5d870f){_0x5d870f=_0x5d870f||0xc8;return function(_0x41be7d){if(_0x41be7d){return _0x35a5dd['status'](_0x5d870f)[_0x5f7b('0x1b')](_0x41be7d);}};}function respondWithFilteredResult(_0x2abb6a,_0x201093){return function(_0x371790){if(_0x371790){var _0x45a003=typeof _0x201093[_0x5f7b('0x1c')]===_0x5f7b('0x1d')&&typeof _0x201093['limit']==='undefined';var _0x1eaafd=_0x371790[_0x5f7b('0x1e')];var _0xbe19a8=_0x45a003?0x0:_0x201093[_0x5f7b('0x1c')];var _0x28e433=_0x45a003?_0x371790['count']:_0x201093[_0x5f7b('0x1c')]+_0x201093['limit'];var _0x4ac607;if(_0x28e433>=_0x1eaafd){_0x28e433=_0x1eaafd;_0x4ac607=0xc8;}else{_0x4ac607=0xce;}_0x2abb6a[_0x5f7b('0x19')](_0x4ac607);return _0x2abb6a[_0x5f7b('0x1f')](_0x5f7b('0x20'),_0xbe19a8+'-'+_0x28e433+'/'+_0x1eaafd)[_0x5f7b('0x1b')](_0x371790);}return null;};}function patchUpdates(_0x106070){return function(_0x4cc10b){try{jsonpatch['apply'](_0x4cc10b,_0x106070,!![]);}catch(_0xdc4d44){return BPromise['reject'](_0xdc4d44);}return _0x4cc10b[_0x5f7b('0x21')]();};}function saveUpdates(_0x36f5cc,_0x128a5d){return function(_0x1f5b23){if(_0x1f5b23){return _0x1f5b23[_0x5f7b('0x22')](_0x36f5cc)['then'](function(_0x53c221){return _0x53c221;});}return null;};}function removeEntity(_0x302bf7,_0x414b57){return function(_0x36005b){if(_0x36005b){return _0x36005b['destroy']()[_0x5f7b('0x23')](function(){_0x302bf7[_0x5f7b('0x19')](0xcc)[_0x5f7b('0x1a')]();});}};}function handleEntityNotFound(_0x39d7d0,_0x4de63f){return function(_0x1d303e){if(!_0x1d303e){_0x39d7d0[_0x5f7b('0x18')](0x194);}return _0x1d303e;};}function handleError(_0x5e8d2d,_0x3aeda5){_0x3aeda5=_0x3aeda5||0x1f4;return function(_0x58e152){logger['error'](_0x58e152['stack']);if(_0x58e152[_0x5f7b('0x24')]){delete _0x58e152[_0x5f7b('0x24')];}_0x5e8d2d[_0x5f7b('0x19')](_0x3aeda5)[_0x5f7b('0x25')](_0x58e152);};}exports[_0x5f7b('0x26')]=function(_0x2c1ef3,_0x4899ce){var _0x442e37={},_0x44a472={},_0x3fe5f2={'count':0x0,'rows':[]};var _0x2a2c28=_['map'](db[_0x5f7b('0x27')][_0x5f7b('0x28')],function(_0x413e32){return{'name':_0x413e32['fieldName'],'type':_0x413e32[_0x5f7b('0x29')][_0x5f7b('0x2a')]};});_0x44a472['model']=_[_0x5f7b('0x2b')](_0x2a2c28,'name');_0x44a472['query']=_[_0x5f7b('0x2c')](_0x2c1ef3[_0x5f7b('0x2d')]);_0x44a472['filters']=_['intersection'](_0x44a472[_0x5f7b('0x2e')],_0x44a472['query']);_0x442e37[_0x5f7b('0x2f')]=_[_0x5f7b('0x30')](_0x44a472['model'],qs[_0x5f7b('0x31')](_0x2c1ef3['query'][_0x5f7b('0x31')]));_0x442e37[_0x5f7b('0x2f')]=_0x442e37['attributes'][_0x5f7b('0x32')]?_0x442e37[_0x5f7b('0x2f')]:_0x44a472[_0x5f7b('0x2e')];if(!_0x2c1ef3['query']['hasOwnProperty'](_0x5f7b('0x33'))){_0x442e37[_0x5f7b('0x34')]=qs[_0x5f7b('0x34')](_0x2c1ef3['query'][_0x5f7b('0x34')]);_0x442e37[_0x5f7b('0x1c')]=qs[_0x5f7b('0x1c')](_0x2c1ef3[_0x5f7b('0x2d')][_0x5f7b('0x1c')]);}_0x442e37[_0x5f7b('0x35')]=qs[_0x5f7b('0x36')](_0x2c1ef3['query'][_0x5f7b('0x36')]);_0x442e37['where']=qs[_0x5f7b('0x37')](_[_0x5f7b('0x38')](_0x2c1ef3['query'],_0x44a472[_0x5f7b('0x37')]),_0x2a2c28);if(_0x2c1ef3[_0x5f7b('0x2d')][_0x5f7b('0x39')]){_0x442e37[_0x5f7b('0x3a')]=_[_0x5f7b('0x3b')](_0x442e37[_0x5f7b('0x3a')],{'$or':_[_0x5f7b('0x2b')](_0x2a2c28,function(_0x11a611){if(_0x11a611[_0x5f7b('0x29')]!=='VIRTUAL'){var _0x41264d={};_0x41264d[_0x11a611[_0x5f7b('0x24')]]={'$like':'%'+_0x2c1ef3[_0x5f7b('0x2d')]['filter']+'%'};return _0x41264d;}})});}_0x442e37=_['merge']({},_0x442e37,_0x2c1ef3['options']);var _0x3fc7fb={'where':_0x442e37['where']};return db[_0x5f7b('0x27')][_0x5f7b('0x1e')](_0x3fc7fb)['then'](function(_0xfb822c){_0x3fe5f2['count']=_0xfb822c;if(_0x2c1ef3[_0x5f7b('0x2d')][_0x5f7b('0x3c')]){_0x442e37[_0x5f7b('0x3d')]=[{'all':!![]}];}return db[_0x5f7b('0x27')][_0x5f7b('0x3e')](_0x442e37);})['then'](function(_0x4c48ac){_0x3fe5f2[_0x5f7b('0x3f')]=_0x4c48ac;return _0x3fe5f2;})[_0x5f7b('0x23')](respondWithFilteredResult(_0x4899ce,_0x442e37))[_0x5f7b('0x40')](handleError(_0x4899ce,null));};exports[_0x5f7b('0x41')]=function(_0x4b202b,_0x34dc64){var _0x2a7e5d={'raw':!![],'where':{'id':_0x4b202b[_0x5f7b('0x42')]['id']}},_0x425cce={};_0x425cce['model']=_[_0x5f7b('0x2c')](db[_0x5f7b('0x27')][_0x5f7b('0x28')]);_0x425cce[_0x5f7b('0x2d')]=_['keys'](_0x4b202b[_0x5f7b('0x2d')]);_0x425cce['filters']=_[_0x5f7b('0x30')](_0x425cce[_0x5f7b('0x2e')],_0x425cce[_0x5f7b('0x2d')]);_0x2a7e5d[_0x5f7b('0x2f')]=_[_0x5f7b('0x30')](_0x425cce[_0x5f7b('0x2e')],qs[_0x5f7b('0x31')](_0x4b202b[_0x5f7b('0x2d')]['fields']));_0x2a7e5d['attributes']=_0x2a7e5d[_0x5f7b('0x2f')][_0x5f7b('0x32')]?_0x2a7e5d[_0x5f7b('0x2f')]:_0x425cce[_0x5f7b('0x2e')];if(_0x4b202b[_0x5f7b('0x2d')][_0x5f7b('0x3c')]){_0x2a7e5d['include']=[{'all':!![]}];}_0x2a7e5d=_['merge']({},_0x2a7e5d,_0x4b202b['options']);return db[_0x5f7b('0x27')][_0x5f7b('0x43')](_0x2a7e5d)['then'](handleEntityNotFound(_0x34dc64,null))[_0x5f7b('0x23')](respondWithResult(_0x34dc64,null))['catch'](handleError(_0x34dc64,null));};exports[_0x5f7b('0x44')]=function(_0x2ffed6,_0x49985e){return db['CmHopperHistory'][_0x5f7b('0x44')](_0x2ffed6[_0x5f7b('0x45')],{})[_0x5f7b('0x23')](respondWithResult(_0x49985e,0xc9))[_0x5f7b('0x40')](handleError(_0x49985e,null));};exports['describe']=function(_0x2a0fbf,_0x552d17){return db[_0x5f7b('0x27')][_0x5f7b('0x46')]()[_0x5f7b('0x23')](respondWithResult(_0x552d17,null))['catch'](handleError(_0x552d17,null));};exports[_0x5f7b('0x22')]=function(_0x3e4835,_0x2c7bb2){if(_0x3e4835[_0x5f7b('0x45')][_0x5f7b('0x47')]){delete _0x3e4835[_0x5f7b('0x45')][_0x5f7b('0x47')];}return db['CmHopperHistory'][_0x5f7b('0x43')]({'where':{'uniqueid':_0x3e4835[_0x5f7b('0x42')]['id']}})['then'](handleEntityNotFound(_0x2c7bb2,null))[_0x5f7b('0x23')](saveUpdates(_0x3e4835[_0x5f7b('0x45')],null))['then'](respondWithResult(_0x2c7bb2,null))[_0x5f7b('0x40')](handleError(_0x2c7bb2,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index cb0cb91..91acdcd 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 _0xc2a2=['lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./cmHopperHistory.attributes','exports','endtime','uniqueid'];(function(_0xa3463d,_0x32f8da){var _0x50fd67=function(_0xb984fd){while(--_0xb984fd){_0xa3463d['push'](_0xa3463d['shift']());}};_0x50fd67(++_0x32f8da);}(_0xc2a2,0x84));var _0x2c2a=function(_0x5e9ebc,_0x167133){_0x5e9ebc=_0x5e9ebc-0x0;var _0x2bfb69=_0xc2a2[_0x5e9ebc];return _0x2bfb69;};'use strict';var _=require(_0x2c2a('0x0'));var util=require(_0x2c2a('0x1'));var logger=require(_0x2c2a('0x2'))(_0x2c2a('0x3'));var moment=require('moment');var BPromise=require(_0x2c2a('0x4'));var rp=require(_0x2c2a('0x5'));var fs=require('fs');var path=require(_0x2c2a('0x6'));var rimraf=require('rimraf');var config=require(_0x2c2a('0x7'));var attributes=require(_0x2c2a('0x8'));module[_0x2c2a('0x9')]=function(_0x17db27,_0x51c919){return _0x17db27['define']('CmHopperHistory',attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':'endtime','fields':[_0x2c2a('0xa')]},{'name':'uniqueid','fields':[_0x2c2a('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf277=['lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','cm_hopper_history','endtime','uniqueid'];(function(_0x2c3045,_0x2bfb2e){var _0x9bfa0c=function(_0x5f5da2){while(--_0x5f5da2){_0x2c3045['push'](_0x2c3045['shift']());}};_0x9bfa0c(++_0x2bfb2e);}(_0xf277,0x1e1));var _0x7f27=function(_0x6e0f19,_0x327037){_0x6e0f19=_0x6e0f19-0x0;var _0x30e0e3=_0xf277[_0x6e0f19];return _0x30e0e3;};'use strict';var _=require(_0x7f27('0x0'));var util=require(_0x7f27('0x1'));var logger=require('../../config/logger')(_0x7f27('0x2'));var moment=require('moment');var BPromise=require(_0x7f27('0x3'));var rp=require(_0x7f27('0x4'));var fs=require('fs');var path=require(_0x7f27('0x5'));var rimraf=require(_0x7f27('0x6'));var config=require(_0x7f27('0x7'));var attributes=require('./cmHopperHistory.attributes');module[_0x7f27('0x8')]=function(_0x57b338,_0x40bcdf){return _0x57b338[_0x7f27('0x9')]('CmHopperHistory',attributes,{'tableName':_0x7f27('0xa'),'paranoid':![],'indexes':[{'name':_0x7f27('0xb'),'fields':['endtime']},{'name':_0x7f27('0xc'),'fields':[_0x7f27('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index d0e7152..519dee0 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 _0x9795=['`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrAnswerCallsDay','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CmHopperHistory','options','CreateCmHopperHistory','AvgHandleTime','findAll','raw','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','literal','`state`\x20=\x2011,\x201,\x20null','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','catch','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay'];(function(_0x4d0b28,_0x41f716){var _0x2b401a=function(_0x3e0424){while(--_0x3e0424){_0x4d0b28['push'](_0x4d0b28['shift']());}};_0x2b401a(++_0x41f716);}(_0x9795,0x92));var _0x5979=function(_0x176a0d,_0xa1cfab){_0x176a0d=_0x176a0d-0x0;var _0x30fc9c=_0x9795[_0x176a0d];return _0x30fc9c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5979('0x0'));var BPromise=require('bluebird');var rs=require(_0x5979('0x1'));var fs=require('fs');var Redis=require(_0x5979('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x5979('0x3'));var logger=require('../../config/logger')(_0x5979('0x4'));var config=require(_0x5979('0x5'));var jayson=require(_0x5979('0x6'));var client=jayson[_0x5979('0x7')][_0x5979('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x12e4ae,_0x3415ff,_0x150d7e){return new BPromise(function(_0x35777c,_0x475731){return client[_0x5979('0x9')](_0x12e4ae,_0x150d7e)[_0x5979('0xa')](function(_0x3bddac){logger['info'](_0x5979('0xb'),_0x3415ff,_0x5979('0xc'));logger[_0x5979('0xd')](_0x5979('0xe'),_0x3415ff,_0x5979('0xc'),JSON[_0x5979('0xf')](_0x3bddac));if(_0x3bddac[_0x5979('0x10')]){if(_0x3bddac[_0x5979('0x10')][_0x5979('0x11')]===0x1f4){logger['error'](_0x5979('0xb'),_0x3415ff,_0x3bddac['error']['message']);return _0x475731(_0x3bddac['error'][_0x5979('0x12')]);}logger[_0x5979('0x10')]('CmHopperHistory,\x20%s,\x20%s',_0x3415ff,_0x3bddac['error'][_0x5979('0x12')]);return _0x35777c(_0x3bddac[_0x5979('0x10')][_0x5979('0x12')]);}else{logger[_0x5979('0x13')]('CmHopperHistory,\x20%s,\x20%s',_0x3415ff,_0x5979('0xc'));_0x35777c(_0x3bddac[_0x5979('0x14')][_0x5979('0x12')]);}})['catch'](function(_0x5d14be){logger[_0x5979('0x10')]('CmHopperHistory,\x20%s,\x20%s',_0x3415ff,_0x5d14be);_0x475731(_0x5d14be);});});}exports['CreateCmHopperHistory']=function(_0x2ae33f){var _0x4468c9=this;return new Promise(function(_0x360870,_0x35a695){return db[_0x5979('0x15')]['create'](_0x2ae33f['body'],{'raw':_0x2ae33f['options']?_0x2ae33f[_0x5979('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x5979('0xa')](function(_0x5e5012){logger[_0x5979('0x13')](_0x5979('0x17'),_0x2ae33f);logger['debug']('CreateCmHopperHistory',_0x2ae33f,JSON[_0x5979('0xf')](_0x5e5012));_0x360870(_0x5e5012);})['catch'](function(_0x165223){logger['error'](_0x5979('0x17'),_0x165223[_0x5979('0x12')],_0x2ae33f);_0x35a695(_0x4468c9[_0x5979('0x10')](0x1f4,_0x165223['message']));});});};exports[_0x5979('0x18')]=function(_0x11029b){var _0x4f9bb0=this;return new Promise(function(_0x2d0555,_0x2d02ca){return db[_0x5979('0x15')][_0x5979('0x19')]({'raw':_0x11029b[_0x5979('0x16')]?_0x11029b[_0x5979('0x16')][_0x5979('0x1a')]===undefined?!![]:![]:!![],'where':_0x11029b[_0x5979('0x16')]?_0x11029b[_0x5979('0x16')][_0x5979('0x1b')]||null:null,'attributes':[[db[_0x5979('0x1c')]['fn'](_0x5979('0x1d'),db[_0x5979('0x1c')][_0x5979('0x1e')]('id')),_0x5979('0x1f')],[db['sequelize']['fn'](_0x5979('0x1d'),db[_0x5979('0x1c')]['fn']('IF',db[_0x5979('0x1c')]['literal'](_0x5979('0x20')))),_0x5979('0x21')],[db[_0x5979('0x1c')]['fn'](_0x5979('0x1d'),db[_0x5979('0x1c')]['fn']('IF',db[_0x5979('0x1c')]['literal']('`state`\x20=\x2010,\x201,\x20null'))),_0x5979('0x22')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x5979('0x23')](_0x5979('0x24')))),'predictiveIntervalDroppedCallsCallersExit'],[db['sequelize']['fn'](_0x5979('0x25'),db[_0x5979('0x1c')]['fn']('IF',db[_0x5979('0x1c')][_0x5979('0x23')](_0x5979('0x26')))),_0x5979('0x27')],[db[_0x5979('0x1c')]['fn'](_0x5979('0x25'),db['sequelize']['fn']('IF',db[_0x5979('0x1c')]['literal'](_0x5979('0x28')))),_0x5979('0x29')]]})[_0x5979('0xa')](function(_0xa493be){logger[_0x5979('0x13')](_0x5979('0x18'),_0x11029b);logger[_0x5979('0xd')](_0x5979('0x18'),_0x11029b,JSON['stringify'](_0xa493be));_0x2d0555(_0xa493be);})[_0x5979('0x2a')](function(_0x2950ff){logger[_0x5979('0x10')](_0x5979('0x18'),_0x2950ff['message'],_0x11029b);_0x2d02ca(_0x4f9bb0[_0x5979('0x10')](0x1f4,_0x2950ff[_0x5979('0x12')]));});});};exports[_0x5979('0x2b')]=function(_0x1b5d2b){var _0x2a66bf=this;return new Promise(function(_0x3702f2,_0xf64983){return db['CmHopperHistory'][_0x5979('0x19')]({'raw':_0x1b5d2b[_0x5979('0x16')]?_0x1b5d2b['options']['raw']===undefined?!![]:![]:!![],'where':_0x1b5d2b[_0x5979('0x16')]?_0x1b5d2b[_0x5979('0x16')][_0x5979('0x1b')]||null:null,'attributes':[[_0x5979('0x2c'),_0x5979('0x2d')],[db['sequelize']['fn']('COUNT',db[_0x5979('0x1c')]['fn']('IF',db[_0x5979('0x1c')][_0x5979('0x23')](_0x5979('0x2e')))),_0x5979('0x2f')],[db[_0x5979('0x1c')]['fn'](_0x5979('0x1d'),db[_0x5979('0x1c')]['fn']('IF',db[_0x5979('0x1c')][_0x5979('0x23')](_0x5979('0x30')))),_0x5979('0x31')],[db[_0x5979('0x1c')]['fn'](_0x5979('0x1d'),db[_0x5979('0x1c')]['fn']('IF',db[_0x5979('0x1c')][_0x5979('0x23')](_0x5979('0x20')))),_0x5979('0x32')],[db['sequelize']['fn'](_0x5979('0x1d'),db[_0x5979('0x1c')]['fn']('IF',db[_0x5979('0x1c')][_0x5979('0x23')](_0x5979('0x33')))),_0x5979('0x34')],[db[_0x5979('0x1c')]['fn'](_0x5979('0x1d'),db[_0x5979('0x1c')]['fn']('IF',db[_0x5979('0x1c')][_0x5979('0x23')]('`state`\x20=\x208,\x201,\x20null'))),'outboundCongestionCallsDay'],[db[_0x5979('0x1c')]['fn'](_0x5979('0x1d'),db[_0x5979('0x1c')]['fn']('IF',db['sequelize'][_0x5979('0x23')](_0x5979('0x35')))),'outboundDropCallsDayTimeout'],[db[_0x5979('0x1c')]['fn'](_0x5979('0x1d'),db['sequelize']['fn']('IF',db[_0x5979('0x1c')][_0x5979('0x23')](_0x5979('0x36')))),_0x5979('0x37')],[db[_0x5979('0x1c')]['fn'](_0x5979('0x1d'),db[_0x5979('0x1c')]['fn']('IF',db[_0x5979('0x1c')][_0x5979('0x23')](_0x5979('0x38')))),_0x5979('0x39')],[db[_0x5979('0x1c')]['fn'](_0x5979('0x1d'),db[_0x5979('0x1c')]['fn']('IF',db['sequelize'][_0x5979('0x23')](_0x5979('0x3a')))),'outboundBlacklistCallsDay'],[db[_0x5979('0x1c')]['fn'](_0x5979('0x1d'),db[_0x5979('0x1c')]['fn']('IF',db[_0x5979('0x1c')][_0x5979('0x23')](_0x5979('0x3b')))),_0x5979('0x3c')],[db[_0x5979('0x1c')]['fn']('COUNT',db[_0x5979('0x1c')]['fn']('IF',db[_0x5979('0x1c')][_0x5979('0x23')](_0x5979('0x3d')))),_0x5979('0x3e')],[db[_0x5979('0x1c')]['fn'](_0x5979('0x1d'),db[_0x5979('0x1c')]['fn']('IF',db[_0x5979('0x1c')][_0x5979('0x23')]('`state`\x20=\x2016,\x201,\x20null'))),_0x5979('0x3f')],[db[_0x5979('0x1c')]['fn'](_0x5979('0x1d'),db[_0x5979('0x1c')]['fn']('IF',db['sequelize'][_0x5979('0x23')]('`state`\x20=\x2020,\x201,\x20null'))),_0x5979('0x3e')],[db[_0x5979('0x1c')]['fn']('COUNT',db[_0x5979('0x1c')]['fn']('IF',db[_0x5979('0x1c')][_0x5979('0x23')](_0x5979('0x40')))),_0x5979('0x41')]],'group':[_0x5979('0x2c')]})[_0x5979('0xa')](function(_0x43bc84){logger[_0x5979('0x13')](_0x5979('0x2b'),_0x1b5d2b);logger[_0x5979('0xd')](_0x5979('0x2b'),_0x1b5d2b,JSON[_0x5979('0xf')](_0x43bc84));_0x3702f2(_0x43bc84);})[_0x5979('0x2a')](function(_0x30c6ac){logger['error'](_0x5979('0x2b'),_0x30c6ac[_0x5979('0x12')],_0x1b5d2b);_0xf64983(_0x2a66bf[_0x5979('0x10')](0x1f4,_0x30c6ac[_0x5979('0x12')]));});});};exports[_0x5979('0x42')]=function(_0x38fd76){var _0x4708fb=this;return new Promise(function(_0x328346,_0x22a4ea){return db[_0x5979('0x15')]['findAll']({'raw':_0x38fd76[_0x5979('0x16')]?_0x38fd76[_0x5979('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x38fd76[_0x5979('0x16')]?_0x38fd76['options'][_0x5979('0x1b')]||null:null,'attributes':[[_0x5979('0x2c'),'name'],[db[_0x5979('0x1c')]['fn']('COUNT',db[_0x5979('0x1c')][_0x5979('0x1e')]('id')),'ivrTotalCallsDays'],[db['sequelize']['fn']('COUNT',db[_0x5979('0x1c')]['fn']('IF',db['sequelize'][_0x5979('0x23')](_0x5979('0x20')))),_0x5979('0x43')]],'group':['campaign']})[_0x5979('0xa')](function(_0x4c56b4){logger[_0x5979('0x13')](_0x5979('0x42'),_0x38fd76);logger[_0x5979('0xd')](_0x5979('0x42'),_0x38fd76,JSON[_0x5979('0xf')](_0x4c56b4));_0x328346(_0x4c56b4);})[_0x5979('0x2a')](function(_0x394c8d){logger['error'](_0x5979('0x42'),_0x394c8d[_0x5979('0x12')],_0x38fd76);_0x22a4ea(_0x4708fb[_0x5979('0x10')](0x1f4,_0x394c8d[_0x5979('0x12')]));});});}; \ No newline at end of file +var _0x063c=['CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateCmHopperHistory','CmHopperHistory','body','options','debug','stringify','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgTalktime','AvgHandleTime','GetVoiceQueueHopperHistory','findAll','raw','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','name','ivrTotalCallsDays','ivrAnswerCallsDay','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','client','http','then','CmHopperHistory,\x20%s,\x20%s','request\x20sent'];(function(_0x55c1f0,_0x4f574f){var _0x1530fa=function(_0x631542){while(--_0x631542){_0x55c1f0['push'](_0x55c1f0['shift']());}};_0x1530fa(++_0x4f574f);}(_0x063c,0xba));var _0xc063=function(_0x2977de,_0xb7fe61){_0x2977de=_0x2977de-0x0;var _0x201873=_0x063c[_0x2977de];return _0x201873;};'use strict';var _=require('lodash');var util=require(_0xc063('0x0'));var moment=require(_0xc063('0x1'));var BPromise=require(_0xc063('0x2'));var rs=require(_0xc063('0x3'));var fs=require('fs');var Redis=require(_0xc063('0x4'));var db=require(_0xc063('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc063('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc063('0x7')][_0xc063('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x57ba85,_0x3dbe7c,_0x10716b){return new BPromise(function(_0x3f286a,_0x2f2915){return client['request'](_0x57ba85,_0x10716b)[_0xc063('0x9')](function(_0x421328){logger['info'](_0xc063('0xa'),_0x3dbe7c,_0xc063('0xb'));logger['debug'](_0xc063('0xc'),_0x3dbe7c,'request\x20sent',JSON['stringify'](_0x421328));if(_0x421328['error']){if(_0x421328[_0xc063('0xd')][_0xc063('0xe')]===0x1f4){logger['error'](_0xc063('0xa'),_0x3dbe7c,_0x421328['error'][_0xc063('0xf')]);return _0x2f2915(_0x421328[_0xc063('0xd')][_0xc063('0xf')]);}logger['error'](_0xc063('0xa'),_0x3dbe7c,_0x421328[_0xc063('0xd')][_0xc063('0xf')]);return _0x3f286a(_0x421328[_0xc063('0xd')][_0xc063('0xf')]);}else{logger[_0xc063('0x10')](_0xc063('0xa'),_0x3dbe7c,_0xc063('0xb'));_0x3f286a(_0x421328[_0xc063('0x11')]['message']);}})[_0xc063('0x12')](function(_0xfddf5c){logger['error'](_0xc063('0xa'),_0x3dbe7c,_0xfddf5c);_0x2f2915(_0xfddf5c);});});}exports[_0xc063('0x13')]=function(_0x4dcef1){var _0x238ecb=this;return new Promise(function(_0x13cc09,_0xf87f41){return db[_0xc063('0x14')]['create'](_0x4dcef1[_0xc063('0x15')],{'raw':_0x4dcef1[_0xc063('0x16')]?_0x4dcef1[_0xc063('0x16')]['raw']===undefined?!![]:![]:!![]})[_0xc063('0x9')](function(_0x5fa053){logger['info'](_0xc063('0x13'),_0x4dcef1);logger[_0xc063('0x17')](_0xc063('0x13'),_0x4dcef1,JSON[_0xc063('0x18')](_0x5fa053));_0x13cc09(_0x5fa053);})[_0xc063('0x12')](function(_0x4a82eb){logger['error']('CreateCmHopperHistory',_0x4a82eb[_0xc063('0xf')],_0x4dcef1);_0xf87f41(_0x238ecb['error'](0x1f4,_0x4a82eb['message']));});});};exports['AvgHandleTime']=function(_0x382f79){var _0x3e1040=this;return new Promise(function(_0x1bffbf,_0x10c8e2){return db[_0xc063('0x14')]['findAll']({'raw':_0x382f79['options']?_0x382f79[_0xc063('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x382f79[_0xc063('0x16')]?_0x382f79[_0xc063('0x16')][_0xc063('0x19')]||null:null,'attributes':[[db[_0xc063('0x1a')]['fn'](_0xc063('0x1b'),db[_0xc063('0x1a')][_0xc063('0x1c')]('id')),_0xc063('0x1d')],[db['sequelize']['fn'](_0xc063('0x1b'),db[_0xc063('0x1a')]['fn']('IF',db[_0xc063('0x1a')][_0xc063('0x1e')](_0xc063('0x1f')))),_0xc063('0x20')],[db[_0xc063('0x1a')]['fn'](_0xc063('0x1b'),db['sequelize']['fn']('IF',db[_0xc063('0x1a')][_0xc063('0x1e')]('`state`\x20=\x2010,\x201,\x20null'))),'predictiveIntervalDroppedCallsTimeout'],[db['sequelize']['fn'](_0xc063('0x1b'),db['sequelize']['fn']('IF',db[_0xc063('0x1a')][_0xc063('0x1e')](_0xc063('0x21')))),_0xc063('0x22')],[db['sequelize']['fn'](_0xc063('0x23'),db[_0xc063('0x1a')]['fn']('IF',db[_0xc063('0x1a')]['literal'](_0xc063('0x24')))),'predictiveIntervalAvgHoldtime'],[db[_0xc063('0x1a')]['fn'](_0xc063('0x23'),db['sequelize']['fn']('IF',db['sequelize'][_0xc063('0x1e')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0xc063('0x25')]]})[_0xc063('0x9')](function(_0x40f551){logger['info']('AvgHandleTime',_0x382f79);logger['debug'](_0xc063('0x26'),_0x382f79,JSON['stringify'](_0x40f551));_0x1bffbf(_0x40f551);})[_0xc063('0x12')](function(_0x4e0416){logger[_0xc063('0xd')](_0xc063('0x26'),_0x4e0416[_0xc063('0xf')],_0x382f79);_0x10c8e2(_0x3e1040[_0xc063('0xd')](0x1f4,_0x4e0416['message']));});});};exports[_0xc063('0x27')]=function(_0x18be99){var _0x886acc=this;return new Promise(function(_0x4bf1a8,_0xcd344b){return db[_0xc063('0x14')][_0xc063('0x28')]({'raw':_0x18be99[_0xc063('0x16')]?_0x18be99[_0xc063('0x16')][_0xc063('0x29')]===undefined?!![]:![]:!![],'where':_0x18be99[_0xc063('0x16')]?_0x18be99[_0xc063('0x16')][_0xc063('0x19')]||null:null,'attributes':[[_0xc063('0x2a'),'name'],[db[_0xc063('0x1a')]['fn'](_0xc063('0x1b'),db[_0xc063('0x1a')]['fn']('IF',db[_0xc063('0x1a')][_0xc063('0x1e')](_0xc063('0x2b')))),_0xc063('0x2c')],[db[_0xc063('0x1a')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xc063('0x2d')))),_0xc063('0x2e')],[db[_0xc063('0x1a')]['fn'](_0xc063('0x1b'),db[_0xc063('0x1a')]['fn']('IF',db[_0xc063('0x1a')][_0xc063('0x1e')](_0xc063('0x1f')))),'outboundAnswerCallsDay'],[db[_0xc063('0x1a')]['fn'](_0xc063('0x1b'),db[_0xc063('0x1a')]['fn']('IF',db[_0xc063('0x1a')][_0xc063('0x1e')]('`state`\x20=\x205,\x201,\x20null'))),'outboundBusyCallsDay'],[db['sequelize']['fn'](_0xc063('0x1b'),db[_0xc063('0x1a')]['fn']('IF',db[_0xc063('0x1a')][_0xc063('0x1e')](_0xc063('0x2f')))),_0xc063('0x30')],[db[_0xc063('0x1a')]['fn'](_0xc063('0x1b'),db['sequelize']['fn']('IF',db[_0xc063('0x1a')][_0xc063('0x1e')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xc063('0x31')],[db[_0xc063('0x1a')]['fn']('COUNT',db[_0xc063('0x1a')]['fn']('IF',db[_0xc063('0x1a')][_0xc063('0x1e')](_0xc063('0x32')))),'outboundDropCallsDayCallersExit'],[db[_0xc063('0x1a')]['fn'](_0xc063('0x1b'),db[_0xc063('0x1a')]['fn']('IF',db['sequelize']['literal'](_0xc063('0x33')))),_0xc063('0x34')],[db[_0xc063('0x1a')]['fn'](_0xc063('0x1b'),db[_0xc063('0x1a')]['fn']('IF',db['sequelize'][_0xc063('0x1e')](_0xc063('0x35')))),_0xc063('0x36')],[db[_0xc063('0x1a')]['fn']('COUNT',db[_0xc063('0x1a')]['fn']('IF',db[_0xc063('0x1a')]['literal'](_0xc063('0x37')))),'outboundOriginateFailureCallsDay'],[db[_0xc063('0x1a')]['fn'](_0xc063('0x1b'),db[_0xc063('0x1a')]['fn']('IF',db[_0xc063('0x1a')]['literal'](_0xc063('0x38')))),_0xc063('0x39')],[db[_0xc063('0x1a')]['fn'](_0xc063('0x1b'),db[_0xc063('0x1a')]['fn']('IF',db['sequelize'][_0xc063('0x1e')]('`state`\x20=\x2016,\x201,\x20null'))),_0xc063('0x3a')],[db[_0xc063('0x1a')]['fn'](_0xc063('0x1b'),db[_0xc063('0x1a')]['fn']('IF',db[_0xc063('0x1a')][_0xc063('0x1e')](_0xc063('0x3b')))),_0xc063('0x39')],[db[_0xc063('0x1a')]['fn'](_0xc063('0x1b'),db['sequelize']['fn']('IF',db['sequelize'][_0xc063('0x1e')](_0xc063('0x3c')))),_0xc063('0x3d')]],'group':[_0xc063('0x2a')]})['then'](function(_0x24bec2){logger[_0xc063('0x10')](_0xc063('0x27'),_0x18be99);logger[_0xc063('0x17')](_0xc063('0x27'),_0x18be99,JSON[_0xc063('0x18')](_0x24bec2));_0x4bf1a8(_0x24bec2);})['catch'](function(_0x4f2bad){logger[_0xc063('0xd')](_0xc063('0x27'),_0x4f2bad[_0xc063('0xf')],_0x18be99);_0xcd344b(_0x886acc[_0xc063('0xd')](0x1f4,_0x4f2bad[_0xc063('0xf')]));});});};exports[_0xc063('0x3e')]=function(_0x3847f3){var _0xb04f6e=this;return new Promise(function(_0xbed52,_0x2e6389){return db[_0xc063('0x14')][_0xc063('0x28')]({'raw':_0x3847f3['options']?_0x3847f3[_0xc063('0x16')][_0xc063('0x29')]===undefined?!![]:![]:!![],'where':_0x3847f3['options']?_0x3847f3[_0xc063('0x16')]['where']||null:null,'attributes':[[_0xc063('0x2a'),_0xc063('0x3f')],[db[_0xc063('0x1a')]['fn']('COUNT',db[_0xc063('0x1a')]['col']('id')),_0xc063('0x40')],[db[_0xc063('0x1a')]['fn'](_0xc063('0x1b'),db[_0xc063('0x1a')]['fn']('IF',db[_0xc063('0x1a')][_0xc063('0x1e')](_0xc063('0x1f')))),_0xc063('0x41')]],'group':['campaign']})[_0xc063('0x9')](function(_0x130dd7){logger['info']('GetCampaignHopperHistory',_0x3847f3);logger[_0xc063('0x17')](_0xc063('0x3e'),_0x3847f3,JSON[_0xc063('0x18')](_0x130dd7));_0xbed52(_0x130dd7);})[_0xc063('0x12')](function(_0x157a48){logger[_0xc063('0xd')]('GetCampaignHopperHistory',_0x157a48[_0xc063('0xf')],_0x3847f3);_0x2e6389(_0xb04f6e[_0xc063('0xd')](0x1f4,_0x157a48[_0xc063('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 9ebed9f..f6c3fcf 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 _0xa252=['./cmHopperHistory.controller','isAuthenticated','index','get','post','put','/:id','update','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x42bbd4,_0x231135){var _0x3da3e8=function(_0x1a39db){while(--_0x1a39db){_0x42bbd4['push'](_0x42bbd4['shift']());}};_0x3da3e8(++_0x231135);}(_0xa252,0xe0));var _0x2a25=function(_0x5acd6,_0x50d378){_0x5acd6=_0x5acd6-0x0;var _0x5a7ed0=_0xa252[_0x5acd6];return _0x5a7ed0;};'use strict';var multer=require(_0x2a25('0x0'));var util=require(_0x2a25('0x1'));var path=require(_0x2a25('0x2'));var timeout=require(_0x2a25('0x3'));var express=require(_0x2a25('0x4'));var router=express[_0x2a25('0x5')]();var fs_extra=require(_0x2a25('0x6'));var auth=require(_0x2a25('0x7'));var interaction=require(_0x2a25('0x8'));var config=require(_0x2a25('0x9'));var controller=require(_0x2a25('0xa'));router['get']('/',auth[_0x2a25('0xb')](),controller[_0x2a25('0xc')]);router[_0x2a25('0xd')]('/describe',auth[_0x2a25('0xb')](),controller['describe']);router[_0x2a25('0xd')]('/:id',auth[_0x2a25('0xb')](),controller['show']);router[_0x2a25('0xe')]('/',auth[_0x2a25('0xb')](),controller['create']);router[_0x2a25('0xf')](_0x2a25('0x10'),auth['isAuthenticated'](),controller[_0x2a25('0x11')]);module['exports']=router; \ No newline at end of file +var _0x1df4=['fs-extra','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','create','update','exports','multer','util','path','connect-timeout','Router'];(function(_0x10989e,_0x48719d){var _0x5825dc=function(_0x1f9f47){while(--_0x1f9f47){_0x10989e['push'](_0x10989e['shift']());}};_0x5825dc(++_0x48719d);}(_0x1df4,0x1a4));var _0x41df=function(_0x312378,_0x5b2961){_0x312378=_0x312378-0x0;var _0x2d833c=_0x1df4[_0x312378];return _0x2d833c;};'use strict';var multer=require(_0x41df('0x0'));var util=require(_0x41df('0x1'));var path=require(_0x41df('0x2'));var timeout=require(_0x41df('0x3'));var express=require('express');var router=express[_0x41df('0x4')]();var fs_extra=require(_0x41df('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x41df('0x6'));var config=require('../../config/environment');var controller=require('./cmHopperHistory.controller');router[_0x41df('0x7')]('/',auth[_0x41df('0x8')](),controller[_0x41df('0x9')]);router['get'](_0x41df('0xa'),auth[_0x41df('0x8')](),controller[_0x41df('0xb')]);router[_0x41df('0x7')](_0x41df('0xc'),auth[_0x41df('0x8')](),controller[_0x41df('0xd')]);router['post']('/',auth[_0x41df('0x8')](),controller[_0x41df('0xe')]);router['put'](_0x41df('0xc'),auth['isAuthenticated'](),controller[_0x41df('0xf')]);module[_0x41df('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index bc05ad4..79d13d9 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 _0xb079=['name','exports','STRING'];(function(_0x31836e,_0x82a1d){var _0x484f8d=function(_0x51edf8){while(--_0x51edf8){_0x31836e['push'](_0x31836e['shift']());}};_0x484f8d(++_0x82a1d);}(_0xb079,0x1c9));var _0x9b07=function(_0x208950,_0x40b1dd){_0x208950=_0x208950-0x0;var _0xb8ea1e=_0xb079[_0x208950];return _0xb8ea1e;};'use strict';var Sequelize=require('sequelize');module[_0x9b07('0x0')]={'name':{'type':Sequelize[_0x9b07('0x1')],'unique':_0x9b07('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9b07('0x1')]},'dialPrefix':{'type':Sequelize[_0x9b07('0x1')]}}; \ No newline at end of file +var _0x0738=['STRING','name','sequelize'];(function(_0x6c0e71,_0x30b942){var _0x5edcad=function(_0x2f5a68){while(--_0x2f5a68){_0x6c0e71['push'](_0x6c0e71['shift']());}};_0x5edcad(++_0x30b942);}(_0x0738,0x6e));var _0x8073=function(_0x282f9a,_0x63dff){_0x282f9a=_0x282f9a-0x0;var _0x52528c=_0x0738[_0x282f9a];return _0x52528c;};'use strict';var Sequelize=require(_0x8073('0x0'));module['exports']={'name':{'type':Sequelize[_0x8073('0x1')],'unique':_0x8073('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8073('0x1')]},'dialPrefix':{'type':Sequelize[_0x8073('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index c0beb44..a21d9af 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 _0x4919=['describe','ListId','Disposition','getDispositions','findOne','removeDispositions','CmContact','tags','isArray','join','push','ids','success','dataValues','message','Malformed\x20request\x20syntax','getContacts','CustomFields','format','cf_%d','getContactsCsv','concat','raw','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','attachment;\x20filename=','list_%d_%s.csv','Content-type','download','sequelize','addCustomFields','TEXT','text','Sequelize','number','INTEGER','switch','defaultValue','queryInterface','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','omit','spread','removeAgents','emit','getAgents','User','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','Lists','UserProfileResource','destroy','error','stack','name','send','CmList','rawAttributes','fieldName','type','key','model','map','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','length','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find'];(function(_0x109d91,_0x37b324){var _0x4fd53d=function(_0xf74bd6){while(--_0xf74bd6){_0x109d91['push'](_0x109d91['shift']());}};_0x4fd53d(++_0x37b324);}(_0x4919,0xc8));var _0x9491=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0x4919[_0x3c8e9a];return _0x2d4c57;};'use strict';var emlformat=require(_0x9491('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9491('0x1'));var jsonpatch=require(_0x9491('0x2'));var rp=require(_0x9491('0x3'));var moment=require(_0x9491('0x4'));var BPromise=require(_0x9491('0x5'));var Mustache=require(_0x9491('0x6'));var util=require(_0x9491('0x7'));var path=require(_0x9491('0x8'));var sox=require('sox');var csv=require(_0x9491('0x9'));var ejs=require(_0x9491('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9491('0xb'));var squel=require('squel');var crypto=require(_0x9491('0xc'));var jsforce=require(_0x9491('0xd'));var deskjs=require(_0x9491('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9491('0xf'));var Papa=require(_0x9491('0x10'));var Redis=require('ioredis');var authService=require(_0x9491('0x11'));var qs=require(_0x9491('0x12'));var as=require(_0x9491('0x13'));var hardwareService=require(_0x9491('0x14'));var logger=require('../../config/logger')(_0x9491('0x15'));var utils=require(_0x9491('0x16'));var config=require(_0x9491('0x17'));var licenseUtil=require(_0x9491('0x18'));var db=require(_0x9491('0x19'))['db'];config[_0x9491('0x1a')]=_[_0x9491('0x1b')](config[_0x9491('0x1a')],{'host':_0x9491('0x1c'),'port':0x18eb});var socket=require(_0x9491('0x1d'))(new Redis(config[_0x9491('0x1a')]));require('./cmList.socket')[_0x9491('0x1e')](socket);function respondWithStatusCode(_0x1f8714,_0x5b11cd){_0x5b11cd=_0x5b11cd||0xcc;return function(_0x193229){if(_0x193229){return _0x1f8714[_0x9491('0x1f')](_0x5b11cd);}return _0x1f8714[_0x9491('0x20')](_0x5b11cd)[_0x9491('0x21')]();};}function respondWithResult(_0x2fa30e,_0x2da891){_0x2da891=_0x2da891||0xc8;return function(_0x3ef0da){if(_0x3ef0da){return _0x2fa30e[_0x9491('0x20')](_0x2da891)[_0x9491('0x22')](_0x3ef0da);}};}function respondWithFilteredResult(_0xa024f7,_0x5e52ae){return function(_0x5d3e08){if(_0x5d3e08){var _0x9378ce=typeof _0x5e52ae[_0x9491('0x23')]==='undefined'&&typeof _0x5e52ae['limit']===_0x9491('0x24');var _0x1f5cd1=_0x5d3e08[_0x9491('0x25')];var _0x97b8c2=_0x9378ce?0x0:_0x5e52ae[_0x9491('0x23')];var _0x163c2a=_0x9378ce?_0x5d3e08[_0x9491('0x25')]:_0x5e52ae[_0x9491('0x23')]+_0x5e52ae[_0x9491('0x26')];var _0x4f2f1f;if(_0x163c2a>=_0x1f5cd1){_0x163c2a=_0x1f5cd1;_0x4f2f1f=0xc8;}else{_0x4f2f1f=0xce;}_0xa024f7[_0x9491('0x20')](_0x4f2f1f);return _0xa024f7[_0x9491('0x27')](_0x9491('0x28'),_0x97b8c2+'-'+_0x163c2a+'/'+_0x1f5cd1)['json'](_0x5d3e08);}return null;};}function patchUpdates(_0x5627cf){return function(_0x53a4d2){try{jsonpatch[_0x9491('0x29')](_0x53a4d2,_0x5627cf,!![]);}catch(_0x53fe71){return BPromise[_0x9491('0x2a')](_0x53fe71);}return _0x53a4d2[_0x9491('0x2b')]();};}function saveUpdates(_0x56f7ed,_0x5ad2bf){return function(_0x486ce4){if(_0x486ce4){return _0x486ce4['update'](_0x56f7ed)[_0x9491('0x2c')](function(_0x4ed6c5){return _0x4ed6c5;});}return null;};}function removeEntity(_0x251639,_0x4b7f0e){return function(_0x33c8c5){if(_0x33c8c5){return _0x33c8c5['destroy']()[_0x9491('0x2c')](function(){var _0x37dc36=_0x33c8c5['get']({'plain':!![]});var _0x3b960c=_0x9491('0x2d');return db[_0x9491('0x2e')][_0x9491('0x2f')]({'where':{'type':_0x3b960c,'resourceId':_0x37dc36['id']}})[_0x9491('0x2c')](function(){return _0x33c8c5;});})[_0x9491('0x2c')](function(){_0x251639[_0x9491('0x20')](0xcc)[_0x9491('0x21')]();});}};}function handleEntityNotFound(_0x305350,_0x2714e3){return function(_0x4d1ece){if(!_0x4d1ece){_0x305350[_0x9491('0x1f')](0x194);}return _0x4d1ece;};}function handleError(_0x34d180,_0x1726c5){_0x1726c5=_0x1726c5||0x1f4;return function(_0x381b11){logger[_0x9491('0x30')](_0x381b11[_0x9491('0x31')]);if(_0x381b11[_0x9491('0x32')]){delete _0x381b11[_0x9491('0x32')];}_0x34d180[_0x9491('0x20')](_0x1726c5)[_0x9491('0x33')](_0x381b11);};}exports['index']=function(_0x2f754a,_0x5eea8c){var _0x2d9436={},_0xcb7958={},_0x21c183={'count':0x0,'rows':[]};var _0x4c8bb0=_['map'](db[_0x9491('0x34')][_0x9491('0x35')],function(_0x2e008c){return{'name':_0x2e008c[_0x9491('0x36')],'type':_0x2e008c[_0x9491('0x37')][_0x9491('0x38')]};});_0xcb7958[_0x9491('0x39')]=_[_0x9491('0x3a')](_0x4c8bb0,_0x9491('0x32'));_0xcb7958[_0x9491('0x3b')]=_['keys'](_0x2f754a[_0x9491('0x3b')]);_0xcb7958['filters']=_[_0x9491('0x3c')](_0xcb7958['model'],_0xcb7958[_0x9491('0x3b')]);_0x2d9436['attributes']=_['intersection'](_0xcb7958[_0x9491('0x39')],qs['fields'](_0x2f754a['query'][_0x9491('0x3d')]));_0x2d9436[_0x9491('0x3e')]=_0x2d9436[_0x9491('0x3e')]['length']?_0x2d9436[_0x9491('0x3e')]:_0xcb7958['model'];if(!_0x2f754a['query'][_0x9491('0x3f')](_0x9491('0x40'))){_0x2d9436[_0x9491('0x26')]=qs[_0x9491('0x26')](_0x2f754a['query'][_0x9491('0x26')]);_0x2d9436['offset']=qs[_0x9491('0x23')](_0x2f754a[_0x9491('0x3b')][_0x9491('0x23')]);}_0x2d9436[_0x9491('0x41')]=qs[_0x9491('0x42')](_0x2f754a[_0x9491('0x3b')]['sort']);_0x2d9436[_0x9491('0x43')]=qs[_0x9491('0x44')](_[_0x9491('0x45')](_0x2f754a[_0x9491('0x3b')],_0xcb7958[_0x9491('0x44')]),_0x4c8bb0);if(_0x2f754a['query'][_0x9491('0x46')]){_0x2d9436['where']=_[_0x9491('0x47')](_0x2d9436[_0x9491('0x43')],{'$or':_['map'](_0x4c8bb0,function(_0x2bbf6e){if(_0x2bbf6e[_0x9491('0x37')]!==_0x9491('0x48')){var _0x109290={};_0x109290[_0x2bbf6e['name']]={'$like':'%'+_0x2f754a['query']['filter']+'%'};return _0x109290;}})});}_0x2d9436=_[_0x9491('0x47')]({},_0x2d9436,_0x2f754a[_0x9491('0x49')]);var _0x4919dc={'where':_0x2d9436['where']};return db[_0x9491('0x34')]['count'](_0x4919dc)[_0x9491('0x2c')](function(_0x1aa77d){_0x21c183[_0x9491('0x25')]=_0x1aa77d;if(_0x2f754a['query'][_0x9491('0x4a')]){_0x2d9436[_0x9491('0x4b')]=[{'all':!![]}];}return db[_0x9491('0x34')][_0x9491('0x4c')](_0x2d9436);})['then'](function(_0x3e6135){_0x21c183[_0x9491('0x4d')]=_0x3e6135;return _0x21c183;})['then'](respondWithFilteredResult(_0x5eea8c,_0x2d9436))[_0x9491('0x4e')](handleError(_0x5eea8c,null));};exports[_0x9491('0x4f')]=function(_0x24bd82,_0x3fd10a){var _0x538981={'raw':![],'where':{'id':_0x24bd82[_0x9491('0x50')]['id']}},_0x4d76f2={};_0x4d76f2['model']=_['keys'](db[_0x9491('0x34')]['rawAttributes']);_0x4d76f2[_0x9491('0x3b')]=_[_0x9491('0x51')](_0x24bd82[_0x9491('0x3b')]);_0x4d76f2[_0x9491('0x44')]=_[_0x9491('0x3c')](_0x4d76f2[_0x9491('0x39')],_0x4d76f2[_0x9491('0x3b')]);_0x538981[_0x9491('0x3e')]=_[_0x9491('0x3c')](_0x4d76f2[_0x9491('0x39')],qs[_0x9491('0x3d')](_0x24bd82[_0x9491('0x3b')][_0x9491('0x3d')]));_0x538981[_0x9491('0x3e')]=_0x538981[_0x9491('0x3e')][_0x9491('0x52')]?_0x538981[_0x9491('0x3e')]:_0x4d76f2[_0x9491('0x39')];if(_0x24bd82[_0x9491('0x3b')]['includeAll']){_0x538981['include']=[{'all':!![]}];}_0x538981=_[_0x9491('0x47')]({},_0x538981,_0x24bd82[_0x9491('0x49')]);return db['CmList']['find'](_0x538981)['then'](handleEntityNotFound(_0x3fd10a,null))['then'](respondWithResult(_0x3fd10a,null))[_0x9491('0x4e')](handleError(_0x3fd10a,null));};exports['create']=function(_0x4d1571,_0x430962){return db[_0x9491('0x34')]['create'](_0x4d1571[_0x9491('0x53')],{})[_0x9491('0x2c')](function(_0x147b66){var _0x22d12a=_0x4d1571[_0x9491('0x54')][_0x9491('0x55')]({'plain':!![]});if(!_0x22d12a)throw new Error(_0x9491('0x56'));if(_0x22d12a[_0x9491('0x57')]===_0x9491('0x54')){var _0x411f14=_0x147b66[_0x9491('0x55')]({'plain':!![]});var _0x5d5504='Lists';return db[_0x9491('0x58')]['find']({'where':{'name':_0x5d5504,'userProfileId':_0x22d12a['userProfileId']},'raw':!![]})[_0x9491('0x2c')](function(_0x553c93){if(_0x553c93&&_0x553c93[_0x9491('0x59')]===0x0){return db['UserProfileResource'][_0x9491('0x5a')]({'name':_0x411f14[_0x9491('0x32')],'resourceId':_0x411f14['id'],'type':_0x553c93[_0x9491('0x32')],'sectionId':_0x553c93['id']},{})['then'](function(){return _0x147b66;});}else{return _0x147b66;}})[_0x9491('0x4e')](function(_0x108157){logger[_0x9491('0x30')](_0x9491('0x5b'),_0x108157);throw _0x108157;});}return _0x147b66;})[_0x9491('0x2c')](respondWithResult(_0x430962,0xc9))[_0x9491('0x4e')](handleError(_0x430962,null));};exports[_0x9491('0x5c')]=function(_0x519a43,_0x334df1){if(_0x519a43['body']['id']){delete _0x519a43['body']['id'];}return db[_0x9491('0x34')][_0x9491('0x5d')]({'where':{'id':_0x519a43[_0x9491('0x50')]['id']}})[_0x9491('0x2c')](handleEntityNotFound(_0x334df1,null))[_0x9491('0x2c')](saveUpdates(_0x519a43['body'],null))[_0x9491('0x2c')](respondWithResult(_0x334df1,null))[_0x9491('0x4e')](handleError(_0x334df1,null));};exports['destroy']=function(_0x105b84,_0x557b0d){return db[_0x9491('0x34')][_0x9491('0x5d')]({'where':{'id':_0x105b84[_0x9491('0x50')]['id']}})[_0x9491('0x2c')](handleEntityNotFound(_0x557b0d,null))[_0x9491('0x2c')](removeEntity(_0x557b0d,null))[_0x9491('0x4e')](handleError(_0x557b0d,null));};exports[_0x9491('0x5e')]=function(_0x2f41fc,_0x570b66){return db[_0x9491('0x34')][_0x9491('0x5e')]()[_0x9491('0x2c')](respondWithResult(_0x570b66,null))['catch'](handleError(_0x570b66,null));};exports['addDisposition']=function(_0x4994cb,_0x35af62,_0x482b3a){if(_0x4994cb[_0x9491('0x53')]['id']){delete _0x4994cb['body']['id'];}return db[_0x9491('0x34')][_0x9491('0x5d')]({'where':{'id':_0x4994cb[_0x9491('0x50')]['id']}})[_0x9491('0x2c')](handleEntityNotFound(_0x35af62,null))[_0x9491('0x2c')](function(_0x31c1ad){if(_0x31c1ad){_0x4994cb[_0x9491('0x53')][_0x9491('0x5f')]=_0x31c1ad['id'];return db[_0x9491('0x60')][_0x9491('0x5a')](_0x4994cb[_0x9491('0x53')]);}})[_0x9491('0x2c')](respondWithResult(_0x35af62,null))['catch'](handleError(_0x35af62,null));};exports[_0x9491('0x61')]=function(_0x1037e3,_0x395583,_0x187143){var _0xb0c0b7={'raw':![],'where':{}};var _0x3f40bb={};var _0x50ff1d={'count':0x0,'rows':[]};return db[_0x9491('0x34')][_0x9491('0x62')]({'where':{'id':_0x1037e3[_0x9491('0x50')]['id']}})[_0x9491('0x2c')](handleEntityNotFound(_0x395583,null))['then'](function(_0x328cdb){if(_0x328cdb){_0x3f40bb[_0x9491('0x39')]=_[_0x9491('0x51')](db['Disposition'][_0x9491('0x35')]);_0x3f40bb['query']=_[_0x9491('0x51')](_0x1037e3['query']);_0x3f40bb['filters']=_['intersection'](_0x3f40bb[_0x9491('0x39')],_0x3f40bb[_0x9491('0x3b')]);_0xb0c0b7[_0x9491('0x3e')]=_[_0x9491('0x3c')](_0x3f40bb[_0x9491('0x39')],qs[_0x9491('0x3d')](_0x1037e3[_0x9491('0x3b')]['fields']));_0xb0c0b7['attributes']=_0xb0c0b7[_0x9491('0x3e')][_0x9491('0x52')]?_0xb0c0b7[_0x9491('0x3e')]:_0x3f40bb[_0x9491('0x39')];if(!_0x1037e3[_0x9491('0x3b')][_0x9491('0x3f')](_0x9491('0x40'))){_0xb0c0b7['limit']=qs[_0x9491('0x26')](_0x1037e3['query']['limit']);_0xb0c0b7['offset']=qs['offset'](_0x1037e3[_0x9491('0x3b')][_0x9491('0x23')]);}_0xb0c0b7[_0x9491('0x41')]=qs[_0x9491('0x42')](_0x1037e3[_0x9491('0x3b')][_0x9491('0x42')]);_0xb0c0b7['where']=qs['filters'](_[_0x9491('0x45')](_0x1037e3[_0x9491('0x3b')],_0x3f40bb[_0x9491('0x44')]));_0xb0c0b7[_0x9491('0x43')][_0x9491('0x5f')]=_0x328cdb['id'];if(_0x1037e3[_0x9491('0x3b')][_0x9491('0x46')]){_0xb0c0b7[_0x9491('0x43')]=_[_0x9491('0x47')](_0xb0c0b7['where'],{'$or':_['map'](_0xb0c0b7['attributes'],function(_0x5c9611){var _0x2f7d39={};_0x2f7d39[_0x5c9611]={'$like':'%'+_0x1037e3[_0x9491('0x3b')]['filter']+'%'};return _0x2f7d39;})});}_0xb0c0b7=_['merge']({},_0xb0c0b7,_0x1037e3[_0x9491('0x49')]);return db[_0x9491('0x60')]['count']({'where':_0xb0c0b7['where']})[_0x9491('0x2c')](function(_0x5b7809){_0x50ff1d['count']=_0x5b7809;if(_0x1037e3[_0x9491('0x3b')][_0x9491('0x4a')]){_0xb0c0b7[_0x9491('0x4b')]=[{'all':!![]}];}return db['Disposition'][_0x9491('0x4c')](_0xb0c0b7);})[_0x9491('0x2c')](function(_0x106adf){_0x50ff1d[_0x9491('0x4d')]=_0x106adf;return _0x50ff1d;});}})[_0x9491('0x2c')](respondWithFilteredResult(_0x395583,_0xb0c0b7))[_0x9491('0x4e')](handleError(_0x395583,null));};exports[_0x9491('0x63')]=function(_0x4dd091,_0x5d5658,_0x57b956){return db[_0x9491('0x34')][_0x9491('0x5d')]({'where':{'id':_0x4dd091[_0x9491('0x50')]['id']}})[_0x9491('0x2c')](handleEntityNotFound(_0x5d5658,null))['then'](function(_0x38691b){if(_0x38691b){return _0x38691b[_0x9491('0x63')](_0x4dd091[_0x9491('0x3b')]['ids']);}})['then'](respondWithStatusCode(_0x5d5658,null))[_0x9491('0x4e')](handleError(_0x5d5658,null));};exports['addContacts']=function(_0x55ff38,_0x38e958,_0x818581){return db[_0x9491('0x34')][_0x9491('0x5d')]({'where':{'id':_0x55ff38[_0x9491('0x50')]['id']}})[_0x9491('0x2c')](handleEntityNotFound(_0x38e958,null))[_0x9491('0x2c')](function(_0x2fb35d){if(_0x2fb35d){var _0x340117=[];var _0x50cdb5={'success':[],'errors':[]};return db[_0x9491('0x64')][_0x9491('0x5e')]()[_0x9491('0x2c')](function(_0x505431){if(_0x55ff38[_0x9491('0x53')][_0x9491('0x65')]&&_[_0x9491('0x66')](_0x55ff38[_0x9491('0x53')]['tags'])){if(_0x55ff38[_0x9491('0x53')]['tags']['length']){_0x55ff38[_0x9491('0x53')][_0x9491('0x65')]=_0x55ff38[_0x9491('0x53')][_0x9491('0x65')][_0x9491('0x67')](';')+';';}else{_0x55ff38[_0x9491('0x53')][_0x9491('0x65')]=null;}}else{_0x55ff38[_0x9491('0x53')][_0x9491('0x65')]=null;}if(_0x55ff38[_0x9491('0x53')]&&_[_0x9491('0x66')](_0x55ff38[_0x9491('0x53')])){for(var _0x512167=0x0;_0x512167<_0x55ff38[_0x9491('0x53')]['length'];_0x512167+=0x1){_0x55ff38[_0x9491('0x53')][_0x512167]['ListId']=_0x55ff38[_0x9491('0x50')]['id'];_0x340117[_0x9491('0x68')](_0x55ff38[_0x9491('0x53')][_0x512167]);}return BPromise['each'](_0x340117,function(_0x41f07d){return db[_0x9491('0x64')][_0x9491('0x5a')](_['omit'](_0x41f07d,[_0x9491('0x69'),'id'])||{},{'fields':_[_0x9491('0x51')](_0x505431),'raw':!![]})[_0x9491('0x2c')](function(_0x319bca){_0x50cdb5[_0x9491('0x6a')][_0x9491('0x68')](_0x319bca[_0x9491('0x6b')]);})[_0x9491('0x4e')](function(_0x117385){_0x50cdb5['errors']['push']({'data':_0x41f07d,'error':_0x117385[_0x9491('0x6c')]});});})[_0x9491('0x2c')](function(_0x4aaac9){return _0x50cdb5;})['catch'](function(_0x183bb1){return _0x183bb1;});}else{_0x38e958[_0x9491('0x20')](0x190)[_0x9491('0x22')]({'message':_0x9491('0x6d')});}});}})['then'](respondWithResult(_0x38e958,null))['catch'](handleError(_0x38e958,null));};exports[_0x9491('0x6e')]=function(_0x37cfae,_0x179c6e,_0x58f63b){var _0x4097c8;return db[_0x9491('0x34')][_0x9491('0x5d')]({'where':{'id':_0x37cfae[_0x9491('0x50')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x9491('0x6f')}]})[_0x9491('0x2c')](handleEntityNotFound(_0x179c6e,null))[_0x9491('0x2c')](function(_0x1a2ccb){if(_0x1a2ccb){_0x4097c8=_0x1a2ccb;return db[_0x9491('0x64')]['rawAttributes'];}})[_0x9491('0x2c')](function(_0x39ea1f){if(_0x39ea1f){var _0x1b5210={};var _0x43dc8c={};_0x43dc8c[_0x9491('0x39')]=_['concat'](_[_0x9491('0x51')](_0x39ea1f),_[_0x9491('0x3a')](_0x4097c8[_0x9491('0x6f')],function(_0x4b5447){return util[_0x9491('0x70')](_0x9491('0x71'),_0x4b5447['id']);}));_0x43dc8c[_0x9491('0x3b')]=_[_0x9491('0x51')](_0x37cfae[_0x9491('0x3b')]);_0x43dc8c['filters']=_[_0x9491('0x3c')](_0x43dc8c[_0x9491('0x39')],_0x43dc8c[_0x9491('0x3b')]);_0x1b5210['attributes']=_[_0x9491('0x3c')](_0x43dc8c['model'],qs[_0x9491('0x3d')](_0x37cfae[_0x9491('0x3b')][_0x9491('0x3d')]));_0x1b5210[_0x9491('0x3e')]=_0x1b5210['attributes'][_0x9491('0x52')]?_0x1b5210[_0x9491('0x3e')]:_0x43dc8c[_0x9491('0x39')];if(!_0x37cfae[_0x9491('0x3b')][_0x9491('0x3f')](_0x9491('0x40'))){_0x1b5210['limit']=qs['limit'](_0x37cfae['query'][_0x9491('0x26')]);_0x1b5210[_0x9491('0x23')]=qs['offset'](_0x37cfae[_0x9491('0x3b')][_0x9491('0x23')]);}_0x1b5210[_0x9491('0x41')]=qs[_0x9491('0x42')](_0x37cfae['query'][_0x9491('0x42')]);_0x1b5210['where']=qs['filters'](_[_0x9491('0x45')](_0x37cfae[_0x9491('0x3b')],_0x43dc8c[_0x9491('0x44')]));_0x1b5210['raw']=!![];if(_0x37cfae[_0x9491('0x3b')][_0x9491('0x46')]){_0x1b5210[_0x9491('0x43')]=_[_0x9491('0x47')](_0x1b5210[_0x9491('0x43')],{'$or':_['map'](_0x1b5210['attributes'],function(_0x36dbee){var _0x50e96b={};_0x50e96b[_0x36dbee]={'$like':'%'+_0x37cfae[_0x9491('0x3b')][_0x9491('0x46')]+'%'};return _0x50e96b;})});}_0x1b5210=_[_0x9491('0x47')]({},_0x1b5210,_0x37cfae[_0x9491('0x49')]);return _0x4097c8[_0x9491('0x6e')](_0x1b5210);}})[_0x9491('0x2c')](respondWithResult(_0x179c6e,null))['catch'](handleError(_0x179c6e,null));};exports[_0x9491('0x72')]=function(_0x2527b0,_0x3691d7,_0x23d52a){var _0x34271b;return db[_0x9491('0x34')][_0x9491('0x5d')]({'where':{'id':_0x2527b0[_0x9491('0x50')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x9491('0x6f')}]})[_0x9491('0x2c')](handleEntityNotFound(_0x3691d7,null))['then'](function(_0x5bd287){if(_0x5bd287){_0x34271b=_0x5bd287;return db[_0x9491('0x64')][_0x9491('0x35')];}})[_0x9491('0x2c')](function(_0x1c228c){if(_0x1c228c){var _0xffc797={};var _0x28431e={};_0x28431e[_0x9491('0x39')]=_[_0x9491('0x73')](_[_0x9491('0x51')](_0x1c228c),_[_0x9491('0x3a')](_0x34271b[_0x9491('0x6f')],function(_0x6e0016){return util[_0x9491('0x70')](_0x9491('0x71'),_0x6e0016['id']);}));_0x28431e[_0x9491('0x3b')]=_[_0x9491('0x51')](_0x2527b0['query']);_0x28431e[_0x9491('0x44')]=_[_0x9491('0x3c')](_0x28431e[_0x9491('0x39')],_0x28431e[_0x9491('0x3b')]);_0xffc797[_0x9491('0x3e')]=_['intersection'](_0x28431e[_0x9491('0x39')],qs[_0x9491('0x3d')](_0x2527b0['query']['fields']));_0xffc797[_0x9491('0x3e')]=_0xffc797[_0x9491('0x3e')][_0x9491('0x52')]?_0xffc797[_0x9491('0x3e')]:_0x28431e[_0x9491('0x39')];if(!_0x2527b0['query'][_0x9491('0x3f')](_0x9491('0x40'))){_0xffc797[_0x9491('0x26')]=qs[_0x9491('0x26')](_0x2527b0[_0x9491('0x3b')][_0x9491('0x26')]);_0xffc797['offset']=qs[_0x9491('0x23')](_0x2527b0['query'][_0x9491('0x23')]);}_0xffc797['order']=qs['sort'](_0x2527b0[_0x9491('0x3b')][_0x9491('0x42')]);_0xffc797[_0x9491('0x43')]=qs['filters'](_[_0x9491('0x45')](_0x2527b0[_0x9491('0x3b')],_0x28431e['filters']));_0xffc797[_0x9491('0x74')]=!![];if(_0x2527b0['query'][_0x9491('0x46')]){_0xffc797[_0x9491('0x43')]=_[_0x9491('0x47')](_0xffc797[_0x9491('0x43')],{'$or':_[_0x9491('0x3a')](_0xffc797[_0x9491('0x3e')],function(_0x3b71fc){var _0x25d83c={};_0x25d83c[_0x3b71fc]={'$like':'%'+_0x2527b0[_0x9491('0x3b')][_0x9491('0x46')]+'%'};return _0x25d83c;})});}_0xffc797=_[_0x9491('0x47')]({},_0xffc797,_0x2527b0[_0x9491('0x49')]);return _0x34271b['getContacts'](_0xffc797);}})[_0x9491('0x2c')](function(_0x8cac90){if(!_[_0x9491('0x75')](_0x8cac90)){var _0x1cb36c=toCsv(_0x8cac90);var _0x2dad95=Date[_0x9491('0x76')]();fs[_0x9491('0x77')](util[_0x9491('0x70')](_0x9491('0x78'),_0x34271b['id'],_0x2dad95),_0x1cb36c);_0x3691d7[_0x9491('0x79')]('Content-disposition',_0x9491('0x7a')+util[_0x9491('0x70')](_0x9491('0x7b'),_0x34271b['id'],_0x2dad95));_0x3691d7[_0x9491('0x79')](_0x9491('0x7c'),'text/csv');return _0x3691d7[_0x9491('0x7d')](util[_0x9491('0x70')](_0x9491('0x78'),_0x34271b['id'],_0x2dad95));}else{return _0x3691d7[_0x9491('0x1f')](0xcc);}})[_0x9491('0x4e')](handleError(_0x3691d7,null));};exports['addCustomField']=function(_0x29aa05,_0x9aefc9,_0x573e8e){var _0x50565b;delete _0x29aa05['body']['id'];return db['CmList'][_0x9491('0x62')]({'where':{'id':_0x29aa05[_0x9491('0x50')]['id']}})['then'](handleEntityNotFound(_0x9aefc9,null))['then'](function(_0x59808d){if(_0x59808d){return db[_0x9491('0x7e')]['transaction'](function(_0x2b1688){return db['CmCustomField']['create'](_0x29aa05[_0x9491('0x53')],{'transaction':_0x2b1688})[_0x9491('0x2c')](function(_0x529774){_0x50565b=_0x529774;return _0x59808d[_0x9491('0x7f')](_0x529774,{'transaction':_0x2b1688});})['then'](function(){var _0x1705cc={'type':db['Sequelize'][_0x9491('0x80')],'transaction':_0x2b1688};switch(_0x29aa05['body'][_0x9491('0x37')]){case _0x9491('0x81'):_0x1705cc[_0x9491('0x37')]=db[_0x9491('0x82')]['TEXT'];break;case _0x9491('0x83'):_0x1705cc['type']=db[_0x9491('0x82')][_0x9491('0x84')];break;case _0x9491('0x85'):_0x1705cc['type']=db[_0x9491('0x82')]['BOOLEAN'];_0x1705cc[_0x9491('0x86')]=![];break;default:}return db[_0x9491('0x7e')][_0x9491('0x87')]['addColumn'](_0x9491('0x88'),util[_0x9491('0x70')](_0x9491('0x89'),_0x50565b['id']),_0x1705cc);})[_0x9491('0x2c')](function(){return _0x50565b;});});}})['then'](respondWithResult(_0x9aefc9,null))[_0x9491('0x4e')](handleError(_0x9aefc9,null));};exports[_0x9491('0x8a')]=function(_0x5a1338,_0x1e9197,_0xce623a){var _0x5b9b04={};var _0x4c3848={};var _0x44f97c;var _0x5740b5;return db[_0x9491('0x34')][_0x9491('0x62')]({'where':{'id':_0x5a1338[_0x9491('0x50')]['id']}})[_0x9491('0x2c')](handleEntityNotFound(_0x1e9197,null))[_0x9491('0x2c')](function(_0x148aba){if(_0x148aba){_0x44f97c=_0x148aba;_0x4c3848[_0x9491('0x39')]=_[_0x9491('0x51')](db['CmCustomField'][_0x9491('0x35')]);_0x4c3848['query']=_[_0x9491('0x51')](_0x5a1338[_0x9491('0x3b')]);_0x4c3848[_0x9491('0x44')]=_[_0x9491('0x3c')](_0x4c3848['model'],_0x4c3848['query']);_0x5b9b04[_0x9491('0x3e')]=_[_0x9491('0x3c')](_0x4c3848[_0x9491('0x39')],qs[_0x9491('0x3d')](_0x5a1338[_0x9491('0x3b')]['fields']));_0x5b9b04[_0x9491('0x3e')]=_0x5b9b04[_0x9491('0x3e')][_0x9491('0x52')]?_0x5b9b04[_0x9491('0x3e')]:_0x4c3848['model'];_0x5b9b04[_0x9491('0x41')]=qs['sort'](_0x5a1338[_0x9491('0x3b')][_0x9491('0x42')]);_0x5b9b04['where']=qs[_0x9491('0x44')](_[_0x9491('0x45')](_0x5a1338[_0x9491('0x3b')],_0x4c3848[_0x9491('0x44')]));_0x5b9b04[_0x9491('0x43')]=_[_0x9491('0x47')](_0x5b9b04[_0x9491('0x43')],{'$or':[{'ListId':_0x148aba['id']},{'ListId':null}]});if(_0x5a1338[_0x9491('0x3b')][_0x9491('0x46')]){_0x5b9b04['where']=_[_0x9491('0x47')](_0x5b9b04['where'],{'$or':_[_0x9491('0x3a')](_0x5b9b04[_0x9491('0x3e')],function(_0x345383){var _0x21b85b={};_0x21b85b[_0x345383]={'$like':'%'+_0x5a1338[_0x9491('0x3b')][_0x9491('0x46')]+'%'};return _0x21b85b;})});}_0x5b9b04=_[_0x9491('0x47')]({},_0x5b9b04,_0x5a1338['options']);return db['CmCustomField'][_0x9491('0x8b')](_0x5b9b04);}})[_0x9491('0x2c')](respondWithResult(_0x1e9197,null))[_0x9491('0x4e')](handleError(_0x1e9197,null));};exports[_0x9491('0x8c')]=function(_0x5cdc4f,_0x2fa5d7,_0xb9e964){return db[_0x9491('0x34')]['find']({'where':{'id':_0x5cdc4f[_0x9491('0x50')]['id']}})[_0x9491('0x2c')](handleEntityNotFound(_0x2fa5d7,null))[_0x9491('0x2c')](function(_0x3ce05a){if(_0x3ce05a){return _0x3ce05a[_0x9491('0x8c')](_0x5cdc4f[_0x9491('0x53')][_0x9491('0x69')],_[_0x9491('0x8d')](_0x5cdc4f[_0x9491('0x53')],[_0x9491('0x69'),'id'])||{})[_0x9491('0x8e')](function(_0x39d242){for(var _0x101092=0x0;_0x101092<_0x5cdc4f['body'][_0x9491('0x69')][_0x9491('0x52')];_0x101092+=0x1){socket['emit']('userCmList:save',{'UserId':Number(_0x5cdc4f[_0x9491('0x53')][_0x9491('0x69')][_0x101092]),'CmListId':Number(_0x5cdc4f[_0x9491('0x50')]['id'])});}return _0x39d242;});}})[_0x9491('0x2c')](respondWithResult(_0x2fa5d7,null))[_0x9491('0x4e')](handleError(_0x2fa5d7,null));};exports['removeAgents']=function(_0x50e045,_0x19602e,_0x117648){return db[_0x9491('0x34')][_0x9491('0x5d')]({'where':{'id':_0x50e045[_0x9491('0x50')]['id']}})[_0x9491('0x2c')](handleEntityNotFound(_0x19602e,null))['then'](function(_0x356c6b){if(_0x356c6b){return _0x356c6b[_0x9491('0x8f')](_0x50e045[_0x9491('0x3b')]['ids'])['then'](function(){if(_[_0x9491('0x66')](_0x50e045['query'][_0x9491('0x69')])){for(var _0x467ff2=0x0;_0x467ff2<_0x50e045[_0x9491('0x3b')]['ids'][_0x9491('0x52')];_0x467ff2+=0x1){socket[_0x9491('0x90')]('userCmList:remove',{'UserId':Number(_0x50e045[_0x9491('0x3b')][_0x9491('0x69')][_0x467ff2]),'CmListId':Number(_0x50e045[_0x9491('0x50')]['id'])});}}else{socket[_0x9491('0x90')]('userCmList:remove',{'UserId':Number(_0x50e045[_0x9491('0x3b')][_0x9491('0x69')]),'CmListId':Number(_0x50e045[_0x9491('0x50')]['id'])});}});}})['then'](respondWithStatusCode(_0x19602e,null))[_0x9491('0x4e')](handleError(_0x19602e,null));};exports[_0x9491('0x91')]=function(_0x1553ae,_0x5d4470,_0x4fe69d){var _0x287527={};var _0x319366={};var _0x2599bc;var _0x52ec4c;return db[_0x9491('0x34')][_0x9491('0x62')]({'where':{'id':_0x1553ae[_0x9491('0x50')]['id']}})[_0x9491('0x2c')](handleEntityNotFound(_0x5d4470,null))[_0x9491('0x2c')](function(_0x305a8b){if(_0x305a8b){_0x2599bc=_0x305a8b;_0x319366[_0x9491('0x39')]=_[_0x9491('0x51')](db[_0x9491('0x92')][_0x9491('0x35')]);_0x319366[_0x9491('0x3b')]=_[_0x9491('0x51')](_0x1553ae[_0x9491('0x3b')]);_0x319366[_0x9491('0x44')]=_[_0x9491('0x3c')](_0x319366[_0x9491('0x39')],_0x319366['query']);_0x287527[_0x9491('0x3e')]=_[_0x9491('0x3c')](_0x319366[_0x9491('0x39')],qs[_0x9491('0x3d')](_0x1553ae[_0x9491('0x3b')][_0x9491('0x3d')]));_0x287527[_0x9491('0x3e')]=_0x287527[_0x9491('0x3e')][_0x9491('0x52')]?_0x287527[_0x9491('0x3e')]:_0x319366[_0x9491('0x39')];_0x287527[_0x9491('0x41')]=qs[_0x9491('0x42')](_0x1553ae[_0x9491('0x3b')]['sort']);_0x287527['where']=qs[_0x9491('0x44')](_[_0x9491('0x45')](_0x1553ae[_0x9491('0x3b')],_0x319366[_0x9491('0x44')]));if(_0x1553ae['query'][_0x9491('0x46')]){_0x287527[_0x9491('0x43')]=_[_0x9491('0x47')](_0x287527['where'],{'$or':_['map'](_0x287527[_0x9491('0x3e')],function(_0x51bfb5){var _0x2daaea={};_0x2daaea[_0x51bfb5]={'$like':'%'+_0x1553ae['query']['filter']+'%'};return _0x2daaea;})});}_0x287527=_[_0x9491('0x47')]({},_0x287527,_0x1553ae['options']);return _0x2599bc[_0x9491('0x91')](_0x287527);}})[_0x9491('0x2c')](function(_0x5ce84f){if(_0x5ce84f){_0x52ec4c=_0x5ce84f[_0x9491('0x52')];if(!_0x1553ae[_0x9491('0x3b')]['hasOwnProperty'](_0x9491('0x40'))){_0x287527[_0x9491('0x26')]=qs['limit'](_0x1553ae[_0x9491('0x3b')][_0x9491('0x26')]);_0x287527[_0x9491('0x23')]=qs['offset'](_0x1553ae[_0x9491('0x3b')][_0x9491('0x23')]);}return _0x2599bc[_0x9491('0x91')](_0x287527);}})[_0x9491('0x2c')](function(_0x2cbad1){if(_0x2cbad1){return _0x2cbad1?{'count':_0x52ec4c,'rows':_0x2cbad1}:null;}})[_0x9491('0x2c')](respondWithResult(_0x5d4470,null))['catch'](handleError(_0x5d4470,null));}; \ No newline at end of file +var _0x3abe=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','type','VIRTUAL','merge','CmList','include','findAll','rows','catch','show','keys','includeAll','options','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','ListId','Disposition','getDispositions','findOne','pick','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','each','omit','success','errors','message','json','getContacts','CmCustomField','CustomFields','concat','format','raw','getContactsCsv','cf_%d','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','setHeader','Content-type','download','sequelize','addCustomFields','Sequelize','TEXT','text','number','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','addAgents','spread','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','User','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','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','get','Lists','error','name','send','map','rawAttributes','fieldName','model','query'];(function(_0x557fc9,_0x4224c1){var _0x58d8e8=function(_0x50087d){while(--_0x50087d){_0x557fc9['push'](_0x557fc9['shift']());}};_0x58d8e8(++_0x4224c1);}(_0x3abe,0x184));var _0xe3ab=function(_0x250e4a,_0x17e15d){_0x250e4a=_0x250e4a-0x0;var _0x205cf1=_0x3abe[_0x250e4a];return _0x205cf1;};'use strict';var emlformat=require(_0xe3ab('0x0'));var rimraf=require(_0xe3ab('0x1'));var zipdir=require(_0xe3ab('0x2'));var jsonpatch=require(_0xe3ab('0x3'));var rp=require(_0xe3ab('0x4'));var moment=require(_0xe3ab('0x5'));var BPromise=require(_0xe3ab('0x6'));var Mustache=require(_0xe3ab('0x7'));var util=require('util');var path=require(_0xe3ab('0x8'));var sox=require(_0xe3ab('0x9'));var csv=require(_0xe3ab('0xa'));var ejs=require(_0xe3ab('0xb'));var fs=require('fs');var fs_extra=require(_0xe3ab('0xc'));var _=require(_0xe3ab('0xd'));var squel=require(_0xe3ab('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe3ab('0xf'));var toCsv=require(_0xe3ab('0xa'));var querystring=require(_0xe3ab('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe3ab('0x11'));var qs=require(_0xe3ab('0x12'));var as=require(_0xe3ab('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe3ab('0x14'));var utils=require('../../config/utils');var config=require(_0xe3ab('0x15'));var licenseUtil=require(_0xe3ab('0x16'));var db=require(_0xe3ab('0x17'))['db'];config[_0xe3ab('0x18')]=_[_0xe3ab('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe3ab('0x1a'))(new Redis(config['redis']));require(_0xe3ab('0x1b'))[_0xe3ab('0x1c')](socket);function respondWithStatusCode(_0xc3f3b,_0x516c02){_0x516c02=_0x516c02||0xcc;return function(_0x25f6b6){if(_0x25f6b6){return _0xc3f3b[_0xe3ab('0x1d')](_0x516c02);}return _0xc3f3b[_0xe3ab('0x1e')](_0x516c02)[_0xe3ab('0x1f')]();};}function respondWithResult(_0x53fe07,_0x19ff53){_0x19ff53=_0x19ff53||0xc8;return function(_0x4121b6){if(_0x4121b6){return _0x53fe07[_0xe3ab('0x1e')](_0x19ff53)['json'](_0x4121b6);}};}function respondWithFilteredResult(_0x20bdc1,_0x58a69c){return function(_0x19ef80){if(_0x19ef80){var _0x21096a=typeof _0x58a69c[_0xe3ab('0x20')]==='undefined'&&typeof _0x58a69c[_0xe3ab('0x21')]===_0xe3ab('0x22');var _0x3483ff=_0x19ef80[_0xe3ab('0x23')];var _0x2d454c=_0x21096a?0x0:_0x58a69c[_0xe3ab('0x20')];var _0x7fd6c6=_0x21096a?_0x19ef80[_0xe3ab('0x23')]:_0x58a69c[_0xe3ab('0x20')]+_0x58a69c['limit'];var _0x466b7b;if(_0x7fd6c6>=_0x3483ff){_0x7fd6c6=_0x3483ff;_0x466b7b=0xc8;}else{_0x466b7b=0xce;}_0x20bdc1[_0xe3ab('0x1e')](_0x466b7b);return _0x20bdc1[_0xe3ab('0x24')]('Content-Range',_0x2d454c+'-'+_0x7fd6c6+'/'+_0x3483ff)['json'](_0x19ef80);}return null;};}function patchUpdates(_0x183306){return function(_0x5f57ae){try{jsonpatch[_0xe3ab('0x25')](_0x5f57ae,_0x183306,!![]);}catch(_0x58e957){return BPromise[_0xe3ab('0x26')](_0x58e957);}return _0x5f57ae[_0xe3ab('0x27')]();};}function saveUpdates(_0x51d9b0,_0x398ea5){return function(_0x528d25){if(_0x528d25){return _0x528d25[_0xe3ab('0x28')](_0x51d9b0)[_0xe3ab('0x29')](function(_0x342c26){return _0x342c26;});}return null;};}function removeEntity(_0x102843,_0x1b4fde){return function(_0x289cd4){if(_0x289cd4){return _0x289cd4[_0xe3ab('0x2a')]()[_0xe3ab('0x29')](function(){var _0x1c4c7b=_0x289cd4[_0xe3ab('0x2b')]({'plain':!![]});var _0x125ca7=_0xe3ab('0x2c');return db['UserProfileResource'][_0xe3ab('0x2a')]({'where':{'type':_0x125ca7,'resourceId':_0x1c4c7b['id']}})[_0xe3ab('0x29')](function(){return _0x289cd4;});})['then'](function(){_0x102843[_0xe3ab('0x1e')](0xcc)[_0xe3ab('0x1f')]();});}};}function handleEntityNotFound(_0x109cdc,_0x5527a1){return function(_0x556cf0){if(!_0x556cf0){_0x109cdc['sendStatus'](0x194);}return _0x556cf0;};}function handleError(_0x32831f,_0x2eb4eb){_0x2eb4eb=_0x2eb4eb||0x1f4;return function(_0x399966){logger[_0xe3ab('0x2d')](_0x399966['stack']);if(_0x399966[_0xe3ab('0x2e')]){delete _0x399966[_0xe3ab('0x2e')];}_0x32831f[_0xe3ab('0x1e')](_0x2eb4eb)[_0xe3ab('0x2f')](_0x399966);};}exports['index']=function(_0x1b388a,_0x5733a1){var _0x3f9ab7={},_0x58ccb2={},_0x325bc7={'count':0x0,'rows':[]};var _0x597c80=_[_0xe3ab('0x30')](db['CmList'][_0xe3ab('0x31')],function(_0x56753e){return{'name':_0x56753e[_0xe3ab('0x32')],'type':_0x56753e['type']['key']};});_0x58ccb2[_0xe3ab('0x33')]=_[_0xe3ab('0x30')](_0x597c80,_0xe3ab('0x2e'));_0x58ccb2[_0xe3ab('0x34')]=_['keys'](_0x1b388a[_0xe3ab('0x34')]);_0x58ccb2['filters']=_[_0xe3ab('0x35')](_0x58ccb2[_0xe3ab('0x33')],_0x58ccb2['query']);_0x3f9ab7[_0xe3ab('0x36')]=_[_0xe3ab('0x35')](_0x58ccb2[_0xe3ab('0x33')],qs['fields'](_0x1b388a['query'][_0xe3ab('0x37')]));_0x3f9ab7[_0xe3ab('0x36')]=_0x3f9ab7[_0xe3ab('0x36')][_0xe3ab('0x38')]?_0x3f9ab7[_0xe3ab('0x36')]:_0x58ccb2['model'];if(!_0x1b388a[_0xe3ab('0x34')][_0xe3ab('0x39')](_0xe3ab('0x3a'))){_0x3f9ab7[_0xe3ab('0x21')]=qs['limit'](_0x1b388a[_0xe3ab('0x34')][_0xe3ab('0x21')]);_0x3f9ab7[_0xe3ab('0x20')]=qs[_0xe3ab('0x20')](_0x1b388a[_0xe3ab('0x34')][_0xe3ab('0x20')]);}_0x3f9ab7[_0xe3ab('0x3b')]=qs[_0xe3ab('0x3c')](_0x1b388a[_0xe3ab('0x34')][_0xe3ab('0x3c')]);_0x3f9ab7[_0xe3ab('0x3d')]=qs[_0xe3ab('0x3e')](_['pick'](_0x1b388a[_0xe3ab('0x34')],_0x58ccb2[_0xe3ab('0x3e')]),_0x597c80);if(_0x1b388a[_0xe3ab('0x34')][_0xe3ab('0x3f')]){_0x3f9ab7[_0xe3ab('0x3d')]=_['merge'](_0x3f9ab7[_0xe3ab('0x3d')],{'$or':_['map'](_0x597c80,function(_0x31c1f5){if(_0x31c1f5[_0xe3ab('0x40')]!==_0xe3ab('0x41')){var _0x246d6a={};_0x246d6a[_0x31c1f5[_0xe3ab('0x2e')]]={'$like':'%'+_0x1b388a['query'][_0xe3ab('0x3f')]+'%'};return _0x246d6a;}})});}_0x3f9ab7=_[_0xe3ab('0x42')]({},_0x3f9ab7,_0x1b388a['options']);var _0x51cb68={'where':_0x3f9ab7[_0xe3ab('0x3d')]};return db[_0xe3ab('0x43')][_0xe3ab('0x23')](_0x51cb68)['then'](function(_0x356581){_0x325bc7[_0xe3ab('0x23')]=_0x356581;if(_0x1b388a[_0xe3ab('0x34')]['includeAll']){_0x3f9ab7[_0xe3ab('0x44')]=[{'all':!![]}];}return db[_0xe3ab('0x43')][_0xe3ab('0x45')](_0x3f9ab7);})[_0xe3ab('0x29')](function(_0x4a3c25){_0x325bc7[_0xe3ab('0x46')]=_0x4a3c25;return _0x325bc7;})[_0xe3ab('0x29')](respondWithFilteredResult(_0x5733a1,_0x3f9ab7))[_0xe3ab('0x47')](handleError(_0x5733a1,null));};exports[_0xe3ab('0x48')]=function(_0x1fba7f,_0x661359){var _0x13d9b4={'raw':![],'where':{'id':_0x1fba7f['params']['id']}},_0x55ca63={};_0x55ca63[_0xe3ab('0x33')]=_['keys'](db[_0xe3ab('0x43')][_0xe3ab('0x31')]);_0x55ca63[_0xe3ab('0x34')]=_[_0xe3ab('0x49')](_0x1fba7f[_0xe3ab('0x34')]);_0x55ca63['filters']=_[_0xe3ab('0x35')](_0x55ca63[_0xe3ab('0x33')],_0x55ca63[_0xe3ab('0x34')]);_0x13d9b4['attributes']=_[_0xe3ab('0x35')](_0x55ca63[_0xe3ab('0x33')],qs['fields'](_0x1fba7f[_0xe3ab('0x34')][_0xe3ab('0x37')]));_0x13d9b4[_0xe3ab('0x36')]=_0x13d9b4[_0xe3ab('0x36')]['length']?_0x13d9b4['attributes']:_0x55ca63['model'];if(_0x1fba7f['query'][_0xe3ab('0x4a')]){_0x13d9b4['include']=[{'all':!![]}];}_0x13d9b4=_[_0xe3ab('0x42')]({},_0x13d9b4,_0x1fba7f[_0xe3ab('0x4b')]);return db[_0xe3ab('0x43')][_0xe3ab('0x4c')](_0x13d9b4)[_0xe3ab('0x29')](handleEntityNotFound(_0x661359,null))[_0xe3ab('0x29')](respondWithResult(_0x661359,null))[_0xe3ab('0x47')](handleError(_0x661359,null));};exports[_0xe3ab('0x4d')]=function(_0xe063ad,_0x467659){return db['CmList'][_0xe3ab('0x4d')](_0xe063ad[_0xe3ab('0x4e')],{})['then'](function(_0x557d7e){var _0x2497c5=_0xe063ad[_0xe3ab('0x4f')][_0xe3ab('0x2b')]({'plain':!![]});if(!_0x2497c5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2497c5[_0xe3ab('0x50')]===_0xe3ab('0x4f')){var _0x1948aa=_0x557d7e['get']({'plain':!![]});var _0x2b1530=_0xe3ab('0x2c');return db[_0xe3ab('0x51')][_0xe3ab('0x4c')]({'where':{'name':_0x2b1530,'userProfileId':_0x2497c5[_0xe3ab('0x52')]},'raw':!![]})[_0xe3ab('0x29')](function(_0x2bfeed){if(_0x2bfeed&&_0x2bfeed[_0xe3ab('0x53')]===0x0){return db[_0xe3ab('0x54')][_0xe3ab('0x4d')]({'name':_0x1948aa['name'],'resourceId':_0x1948aa['id'],'type':_0x2bfeed['name'],'sectionId':_0x2bfeed['id']},{})[_0xe3ab('0x29')](function(){return _0x557d7e;});}else{return _0x557d7e;}})['catch'](function(_0x531825){logger[_0xe3ab('0x2d')](_0xe3ab('0x55'),_0x531825);throw _0x531825;});}return _0x557d7e;})['then'](respondWithResult(_0x467659,0xc9))['catch'](handleError(_0x467659,null));};exports['update']=function(_0x4e65f2,_0x476d00){if(_0x4e65f2['body']['id']){delete _0x4e65f2[_0xe3ab('0x4e')]['id'];}return db['CmList'][_0xe3ab('0x4c')]({'where':{'id':_0x4e65f2[_0xe3ab('0x56')]['id']}})['then'](handleEntityNotFound(_0x476d00,null))[_0xe3ab('0x29')](saveUpdates(_0x4e65f2['body'],null))[_0xe3ab('0x29')](respondWithResult(_0x476d00,null))['catch'](handleError(_0x476d00,null));};exports[_0xe3ab('0x2a')]=function(_0x4195ea,_0x4099b7){return db['CmList'][_0xe3ab('0x4c')]({'where':{'id':_0x4195ea[_0xe3ab('0x56')]['id']}})['then'](handleEntityNotFound(_0x4099b7,null))[_0xe3ab('0x29')](removeEntity(_0x4099b7,null))[_0xe3ab('0x47')](handleError(_0x4099b7,null));};exports[_0xe3ab('0x57')]=function(_0x52a787,_0xa9eac2){return db[_0xe3ab('0x43')][_0xe3ab('0x57')]()[_0xe3ab('0x29')](respondWithResult(_0xa9eac2,null))[_0xe3ab('0x47')](handleError(_0xa9eac2,null));};exports['addDisposition']=function(_0xdffcf2,_0xbd53e0,_0x4b02f7){if(_0xdffcf2[_0xe3ab('0x4e')]['id']){delete _0xdffcf2[_0xe3ab('0x4e')]['id'];}return db[_0xe3ab('0x43')][_0xe3ab('0x4c')]({'where':{'id':_0xdffcf2['params']['id']}})[_0xe3ab('0x29')](handleEntityNotFound(_0xbd53e0,null))[_0xe3ab('0x29')](function(_0x2fa575){if(_0x2fa575){_0xdffcf2['body'][_0xe3ab('0x58')]=_0x2fa575['id'];return db[_0xe3ab('0x59')][_0xe3ab('0x4d')](_0xdffcf2[_0xe3ab('0x4e')]);}})['then'](respondWithResult(_0xbd53e0,null))[_0xe3ab('0x47')](handleError(_0xbd53e0,null));};exports[_0xe3ab('0x5a')]=function(_0x1e8ac7,_0x27dcd5,_0x3003cc){var _0xa01c91={'raw':![],'where':{}};var _0x48c078={};var _0x158094={'count':0x0,'rows':[]};return db['CmList'][_0xe3ab('0x5b')]({'where':{'id':_0x1e8ac7['params']['id']}})['then'](handleEntityNotFound(_0x27dcd5,null))[_0xe3ab('0x29')](function(_0xd38388){if(_0xd38388){_0x48c078[_0xe3ab('0x33')]=_['keys'](db[_0xe3ab('0x59')][_0xe3ab('0x31')]);_0x48c078['query']=_[_0xe3ab('0x49')](_0x1e8ac7[_0xe3ab('0x34')]);_0x48c078[_0xe3ab('0x3e')]=_[_0xe3ab('0x35')](_0x48c078[_0xe3ab('0x33')],_0x48c078[_0xe3ab('0x34')]);_0xa01c91[_0xe3ab('0x36')]=_[_0xe3ab('0x35')](_0x48c078[_0xe3ab('0x33')],qs[_0xe3ab('0x37')](_0x1e8ac7[_0xe3ab('0x34')]['fields']));_0xa01c91[_0xe3ab('0x36')]=_0xa01c91[_0xe3ab('0x36')][_0xe3ab('0x38')]?_0xa01c91[_0xe3ab('0x36')]:_0x48c078['model'];if(!_0x1e8ac7[_0xe3ab('0x34')][_0xe3ab('0x39')]('nolimit')){_0xa01c91[_0xe3ab('0x21')]=qs[_0xe3ab('0x21')](_0x1e8ac7[_0xe3ab('0x34')][_0xe3ab('0x21')]);_0xa01c91[_0xe3ab('0x20')]=qs[_0xe3ab('0x20')](_0x1e8ac7[_0xe3ab('0x34')][_0xe3ab('0x20')]);}_0xa01c91['order']=qs[_0xe3ab('0x3c')](_0x1e8ac7['query'][_0xe3ab('0x3c')]);_0xa01c91[_0xe3ab('0x3d')]=qs[_0xe3ab('0x3e')](_[_0xe3ab('0x5c')](_0x1e8ac7[_0xe3ab('0x34')],_0x48c078['filters']));_0xa01c91[_0xe3ab('0x3d')]['ListId']=_0xd38388['id'];if(_0x1e8ac7[_0xe3ab('0x34')][_0xe3ab('0x3f')]){_0xa01c91[_0xe3ab('0x3d')]=_[_0xe3ab('0x42')](_0xa01c91[_0xe3ab('0x3d')],{'$or':_[_0xe3ab('0x30')](_0xa01c91[_0xe3ab('0x36')],function(_0x2c1e7c){var _0x3eec6e={};_0x3eec6e[_0x2c1e7c]={'$like':'%'+_0x1e8ac7[_0xe3ab('0x34')][_0xe3ab('0x3f')]+'%'};return _0x3eec6e;})});}_0xa01c91=_[_0xe3ab('0x42')]({},_0xa01c91,_0x1e8ac7['options']);return db[_0xe3ab('0x59')][_0xe3ab('0x23')]({'where':_0xa01c91['where']})[_0xe3ab('0x29')](function(_0x544f08){_0x158094[_0xe3ab('0x23')]=_0x544f08;if(_0x1e8ac7[_0xe3ab('0x34')][_0xe3ab('0x4a')]){_0xa01c91[_0xe3ab('0x44')]=[{'all':!![]}];}return db[_0xe3ab('0x59')][_0xe3ab('0x45')](_0xa01c91);})[_0xe3ab('0x29')](function(_0x118f11){_0x158094[_0xe3ab('0x46')]=_0x118f11;return _0x158094;});}})['then'](respondWithFilteredResult(_0x27dcd5,_0xa01c91))[_0xe3ab('0x47')](handleError(_0x27dcd5,null));};exports[_0xe3ab('0x5d')]=function(_0x44564c,_0x12d87c,_0x32a855){return db['CmList'][_0xe3ab('0x4c')]({'where':{'id':_0x44564c[_0xe3ab('0x56')]['id']}})['then'](handleEntityNotFound(_0x12d87c,null))[_0xe3ab('0x29')](function(_0x831639){if(_0x831639){return _0x831639[_0xe3ab('0x5d')](_0x44564c[_0xe3ab('0x34')][_0xe3ab('0x5e')]);}})[_0xe3ab('0x29')](respondWithStatusCode(_0x12d87c,null))[_0xe3ab('0x47')](handleError(_0x12d87c,null));};exports[_0xe3ab('0x5f')]=function(_0x4f37bd,_0x3a6150,_0x2a7c9c){return db[_0xe3ab('0x43')][_0xe3ab('0x4c')]({'where':{'id':_0x4f37bd[_0xe3ab('0x56')]['id']}})['then'](handleEntityNotFound(_0x3a6150,null))['then'](function(_0x2fb639){if(_0x2fb639){var _0x288ade=[];var _0x48a245={'success':[],'errors':[]};return db[_0xe3ab('0x60')][_0xe3ab('0x57')]()[_0xe3ab('0x29')](function(_0x4fcc38){if(_0x4f37bd[_0xe3ab('0x4e')][_0xe3ab('0x61')]&&_[_0xe3ab('0x62')](_0x4f37bd[_0xe3ab('0x4e')]['tags'])){if(_0x4f37bd[_0xe3ab('0x4e')][_0xe3ab('0x61')][_0xe3ab('0x38')]){_0x4f37bd[_0xe3ab('0x4e')][_0xe3ab('0x61')]=_0x4f37bd[_0xe3ab('0x4e')][_0xe3ab('0x61')][_0xe3ab('0x63')](';')+';';}else{_0x4f37bd[_0xe3ab('0x4e')][_0xe3ab('0x61')]=null;}}else{_0x4f37bd[_0xe3ab('0x4e')][_0xe3ab('0x61')]=null;}if(_0x4f37bd[_0xe3ab('0x4e')]&&_[_0xe3ab('0x62')](_0x4f37bd[_0xe3ab('0x4e')])){for(var _0x21019a=0x0;_0x21019a<_0x4f37bd[_0xe3ab('0x4e')][_0xe3ab('0x38')];_0x21019a+=0x1){_0x4f37bd[_0xe3ab('0x4e')][_0x21019a][_0xe3ab('0x58')]=_0x4f37bd['params']['id'];_0x288ade[_0xe3ab('0x64')](_0x4f37bd[_0xe3ab('0x4e')][_0x21019a]);}return BPromise[_0xe3ab('0x65')](_0x288ade,function(_0x36160b){return db[_0xe3ab('0x60')][_0xe3ab('0x4d')](_[_0xe3ab('0x66')](_0x36160b,[_0xe3ab('0x5e'),'id'])||{},{'fields':_[_0xe3ab('0x49')](_0x4fcc38),'raw':!![]})[_0xe3ab('0x29')](function(_0x505656){_0x48a245[_0xe3ab('0x67')][_0xe3ab('0x64')](_0x505656['dataValues']);})[_0xe3ab('0x47')](function(_0x19b194){_0x48a245[_0xe3ab('0x68')][_0xe3ab('0x64')]({'data':_0x36160b,'error':_0x19b194[_0xe3ab('0x69')]});});})[_0xe3ab('0x29')](function(_0x53cb34){return _0x48a245;})[_0xe3ab('0x47')](function(_0x55a22a){return _0x55a22a;});}else{_0x3a6150[_0xe3ab('0x1e')](0x190)[_0xe3ab('0x6a')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0xe3ab('0x29')](respondWithResult(_0x3a6150,null))[_0xe3ab('0x47')](handleError(_0x3a6150,null));};exports[_0xe3ab('0x6b')]=function(_0x589566,_0x44744f,_0x156994){var _0x17199c;return db[_0xe3ab('0x43')]['find']({'where':{'id':_0x589566['params']['id']},'include':[{'model':db[_0xe3ab('0x6c')],'as':_0xe3ab('0x6d')}]})['then'](handleEntityNotFound(_0x44744f,null))[_0xe3ab('0x29')](function(_0x564976){if(_0x564976){_0x17199c=_0x564976;return db[_0xe3ab('0x60')]['rawAttributes'];}})[_0xe3ab('0x29')](function(_0x11fbc4){if(_0x11fbc4){var _0x4aa48c={};var _0x3ce681={};_0x3ce681[_0xe3ab('0x33')]=_[_0xe3ab('0x6e')](_[_0xe3ab('0x49')](_0x11fbc4),_[_0xe3ab('0x30')](_0x17199c[_0xe3ab('0x6d')],function(_0x43796a){return util[_0xe3ab('0x6f')]('cf_%d',_0x43796a['id']);}));_0x3ce681['query']=_[_0xe3ab('0x49')](_0x589566[_0xe3ab('0x34')]);_0x3ce681['filters']=_[_0xe3ab('0x35')](_0x3ce681[_0xe3ab('0x33')],_0x3ce681[_0xe3ab('0x34')]);_0x4aa48c[_0xe3ab('0x36')]=_['intersection'](_0x3ce681[_0xe3ab('0x33')],qs[_0xe3ab('0x37')](_0x589566[_0xe3ab('0x34')][_0xe3ab('0x37')]));_0x4aa48c['attributes']=_0x4aa48c['attributes'][_0xe3ab('0x38')]?_0x4aa48c[_0xe3ab('0x36')]:_0x3ce681[_0xe3ab('0x33')];if(!_0x589566[_0xe3ab('0x34')][_0xe3ab('0x39')](_0xe3ab('0x3a'))){_0x4aa48c[_0xe3ab('0x21')]=qs[_0xe3ab('0x21')](_0x589566[_0xe3ab('0x34')][_0xe3ab('0x21')]);_0x4aa48c[_0xe3ab('0x20')]=qs[_0xe3ab('0x20')](_0x589566['query']['offset']);}_0x4aa48c['order']=qs[_0xe3ab('0x3c')](_0x589566[_0xe3ab('0x34')][_0xe3ab('0x3c')]);_0x4aa48c[_0xe3ab('0x3d')]=qs[_0xe3ab('0x3e')](_['pick'](_0x589566[_0xe3ab('0x34')],_0x3ce681[_0xe3ab('0x3e')]));_0x4aa48c[_0xe3ab('0x70')]=!![];if(_0x589566[_0xe3ab('0x34')][_0xe3ab('0x3f')]){_0x4aa48c[_0xe3ab('0x3d')]=_['merge'](_0x4aa48c[_0xe3ab('0x3d')],{'$or':_[_0xe3ab('0x30')](_0x4aa48c[_0xe3ab('0x36')],function(_0x2d28aa){var _0x1328da={};_0x1328da[_0x2d28aa]={'$like':'%'+_0x589566[_0xe3ab('0x34')][_0xe3ab('0x3f')]+'%'};return _0x1328da;})});}_0x4aa48c=_['merge']({},_0x4aa48c,_0x589566[_0xe3ab('0x4b')]);return _0x17199c['getContacts'](_0x4aa48c);}})[_0xe3ab('0x29')](respondWithResult(_0x44744f,null))[_0xe3ab('0x47')](handleError(_0x44744f,null));};exports[_0xe3ab('0x71')]=function(_0x2a4ffb,_0x3d0889,_0x28d46b){var _0x5a98d1;return db[_0xe3ab('0x43')][_0xe3ab('0x4c')]({'where':{'id':_0x2a4ffb[_0xe3ab('0x56')]['id']},'include':[{'model':db[_0xe3ab('0x6c')],'as':'CustomFields'}]})[_0xe3ab('0x29')](handleEntityNotFound(_0x3d0889,null))[_0xe3ab('0x29')](function(_0xa49424){if(_0xa49424){_0x5a98d1=_0xa49424;return db[_0xe3ab('0x60')][_0xe3ab('0x31')];}})[_0xe3ab('0x29')](function(_0x18e31d){if(_0x18e31d){var _0x496441={};var _0x386f2e={};_0x386f2e['model']=_['concat'](_[_0xe3ab('0x49')](_0x18e31d),_[_0xe3ab('0x30')](_0x5a98d1[_0xe3ab('0x6d')],function(_0x3463cb){return util['format'](_0xe3ab('0x72'),_0x3463cb['id']);}));_0x386f2e['query']=_[_0xe3ab('0x49')](_0x2a4ffb['query']);_0x386f2e[_0xe3ab('0x3e')]=_['intersection'](_0x386f2e[_0xe3ab('0x33')],_0x386f2e[_0xe3ab('0x34')]);_0x496441[_0xe3ab('0x36')]=_['intersection'](_0x386f2e[_0xe3ab('0x33')],qs[_0xe3ab('0x37')](_0x2a4ffb[_0xe3ab('0x34')][_0xe3ab('0x37')]));_0x496441[_0xe3ab('0x36')]=_0x496441[_0xe3ab('0x36')]['length']?_0x496441[_0xe3ab('0x36')]:_0x386f2e[_0xe3ab('0x33')];if(!_0x2a4ffb[_0xe3ab('0x34')][_0xe3ab('0x39')](_0xe3ab('0x3a'))){_0x496441['limit']=qs[_0xe3ab('0x21')](_0x2a4ffb[_0xe3ab('0x34')]['limit']);_0x496441['offset']=qs[_0xe3ab('0x20')](_0x2a4ffb[_0xe3ab('0x34')][_0xe3ab('0x20')]);}_0x496441[_0xe3ab('0x3b')]=qs[_0xe3ab('0x3c')](_0x2a4ffb[_0xe3ab('0x34')][_0xe3ab('0x3c')]);_0x496441[_0xe3ab('0x3d')]=qs[_0xe3ab('0x3e')](_[_0xe3ab('0x5c')](_0x2a4ffb[_0xe3ab('0x34')],_0x386f2e['filters']));_0x496441[_0xe3ab('0x70')]=!![];if(_0x2a4ffb[_0xe3ab('0x34')]['filter']){_0x496441[_0xe3ab('0x3d')]=_[_0xe3ab('0x42')](_0x496441['where'],{'$or':_['map'](_0x496441['attributes'],function(_0x44b12f){var _0x17396c={};_0x17396c[_0x44b12f]={'$like':'%'+_0x2a4ffb[_0xe3ab('0x34')][_0xe3ab('0x3f')]+'%'};return _0x17396c;})});}_0x496441=_[_0xe3ab('0x42')]({},_0x496441,_0x2a4ffb[_0xe3ab('0x4b')]);return _0x5a98d1[_0xe3ab('0x6b')](_0x496441);}})['then'](function(_0x1537a0){if(!_[_0xe3ab('0x73')](_0x1537a0)){var _0x5ef0f5=toCsv(_0x1537a0);var _0x27a7b1=Date[_0xe3ab('0x74')]();fs[_0xe3ab('0x75')](util['format'](_0xe3ab('0x76'),_0x5a98d1['id'],_0x27a7b1),_0x5ef0f5);_0x3d0889['setHeader'](_0xe3ab('0x77'),_0xe3ab('0x78')+util['format'](_0xe3ab('0x79'),_0x5a98d1['id'],_0x27a7b1));_0x3d0889[_0xe3ab('0x7a')](_0xe3ab('0x7b'),'text/csv');return _0x3d0889[_0xe3ab('0x7c')](util[_0xe3ab('0x6f')](_0xe3ab('0x76'),_0x5a98d1['id'],_0x27a7b1));}else{return _0x3d0889['sendStatus'](0xcc);}})[_0xe3ab('0x47')](handleError(_0x3d0889,null));};exports['addCustomField']=function(_0x2cc56a,_0x4838a9,_0x418da6){var _0x58c31d;delete _0x2cc56a[_0xe3ab('0x4e')]['id'];return db[_0xe3ab('0x43')]['findOne']({'where':{'id':_0x2cc56a[_0xe3ab('0x56')]['id']}})['then'](handleEntityNotFound(_0x4838a9,null))[_0xe3ab('0x29')](function(_0x15f2a4){if(_0x15f2a4){return db[_0xe3ab('0x7d')]['transaction'](function(_0x226a7f){return db[_0xe3ab('0x6c')][_0xe3ab('0x4d')](_0x2cc56a[_0xe3ab('0x4e')],{'transaction':_0x226a7f})[_0xe3ab('0x29')](function(_0x23aef3){_0x58c31d=_0x23aef3;return _0x15f2a4[_0xe3ab('0x7e')](_0x23aef3,{'transaction':_0x226a7f});})['then'](function(){var _0x54e9a7={'type':db[_0xe3ab('0x7f')][_0xe3ab('0x80')],'transaction':_0x226a7f};switch(_0x2cc56a[_0xe3ab('0x4e')][_0xe3ab('0x40')]){case _0xe3ab('0x81'):_0x54e9a7['type']=db[_0xe3ab('0x7f')][_0xe3ab('0x80')];break;case _0xe3ab('0x82'):_0x54e9a7[_0xe3ab('0x40')]=db[_0xe3ab('0x7f')][_0xe3ab('0x83')];break;case'switch':_0x54e9a7[_0xe3ab('0x40')]=db['Sequelize'][_0xe3ab('0x84')];_0x54e9a7[_0xe3ab('0x85')]=![];break;default:}return db['sequelize'][_0xe3ab('0x86')][_0xe3ab('0x87')](_0xe3ab('0x88'),util['format'](_0xe3ab('0x89'),_0x58c31d['id']),_0x54e9a7);})[_0xe3ab('0x29')](function(){return _0x58c31d;});});}})[_0xe3ab('0x29')](respondWithResult(_0x4838a9,null))[_0xe3ab('0x47')](handleError(_0x4838a9,null));};exports[_0xe3ab('0x8a')]=function(_0x5069e6,_0x1cc215,_0x57c8ab){var _0x579330={};var _0x3f4a11={};var _0x23d2f7;var _0x3a5483;return db[_0xe3ab('0x43')][_0xe3ab('0x5b')]({'where':{'id':_0x5069e6[_0xe3ab('0x56')]['id']}})[_0xe3ab('0x29')](handleEntityNotFound(_0x1cc215,null))[_0xe3ab('0x29')](function(_0xe472d3){if(_0xe472d3){_0x23d2f7=_0xe472d3;_0x3f4a11['model']=_[_0xe3ab('0x49')](db[_0xe3ab('0x6c')]['rawAttributes']);_0x3f4a11[_0xe3ab('0x34')]=_['keys'](_0x5069e6[_0xe3ab('0x34')]);_0x3f4a11[_0xe3ab('0x3e')]=_[_0xe3ab('0x35')](_0x3f4a11[_0xe3ab('0x33')],_0x3f4a11[_0xe3ab('0x34')]);_0x579330[_0xe3ab('0x36')]=_[_0xe3ab('0x35')](_0x3f4a11[_0xe3ab('0x33')],qs[_0xe3ab('0x37')](_0x5069e6[_0xe3ab('0x34')]['fields']));_0x579330[_0xe3ab('0x36')]=_0x579330[_0xe3ab('0x36')][_0xe3ab('0x38')]?_0x579330[_0xe3ab('0x36')]:_0x3f4a11[_0xe3ab('0x33')];_0x579330['order']=qs[_0xe3ab('0x3c')](_0x5069e6[_0xe3ab('0x34')][_0xe3ab('0x3c')]);_0x579330['where']=qs['filters'](_[_0xe3ab('0x5c')](_0x5069e6[_0xe3ab('0x34')],_0x3f4a11[_0xe3ab('0x3e')]));_0x579330['where']=_[_0xe3ab('0x42')](_0x579330[_0xe3ab('0x3d')],{'$or':[{'ListId':_0xe472d3['id']},{'ListId':null}]});if(_0x5069e6[_0xe3ab('0x34')][_0xe3ab('0x3f')]){_0x579330[_0xe3ab('0x3d')]=_[_0xe3ab('0x42')](_0x579330[_0xe3ab('0x3d')],{'$or':_[_0xe3ab('0x30')](_0x579330[_0xe3ab('0x36')],function(_0x261a07){var _0x302f7f={};_0x302f7f[_0x261a07]={'$like':'%'+_0x5069e6[_0xe3ab('0x34')][_0xe3ab('0x3f')]+'%'};return _0x302f7f;})});}_0x579330=_[_0xe3ab('0x42')]({},_0x579330,_0x5069e6['options']);return db['CmCustomField']['findAndCountAll'](_0x579330);}})[_0xe3ab('0x29')](respondWithResult(_0x1cc215,null))[_0xe3ab('0x47')](handleError(_0x1cc215,null));};exports[_0xe3ab('0x8b')]=function(_0x43f7ec,_0x427997,_0x106529){return db['CmList'][_0xe3ab('0x4c')]({'where':{'id':_0x43f7ec[_0xe3ab('0x56')]['id']}})['then'](handleEntityNotFound(_0x427997,null))[_0xe3ab('0x29')](function(_0x2e3d56){if(_0x2e3d56){return _0x2e3d56[_0xe3ab('0x8b')](_0x43f7ec[_0xe3ab('0x4e')][_0xe3ab('0x5e')],_['omit'](_0x43f7ec[_0xe3ab('0x4e')],[_0xe3ab('0x5e'),'id'])||{})[_0xe3ab('0x8c')](function(_0x13120b){for(var _0x24a04f=0x0;_0x24a04f<_0x43f7ec[_0xe3ab('0x4e')]['ids'][_0xe3ab('0x38')];_0x24a04f+=0x1){socket['emit'](_0xe3ab('0x8d'),{'UserId':Number(_0x43f7ec[_0xe3ab('0x4e')]['ids'][_0x24a04f]),'CmListId':Number(_0x43f7ec['params']['id'])});}return _0x13120b;});}})['then'](respondWithResult(_0x427997,null))[_0xe3ab('0x47')](handleError(_0x427997,null));};exports[_0xe3ab('0x8e')]=function(_0x40bf11,_0x3ba95a,_0x158f80){return db['CmList'][_0xe3ab('0x4c')]({'where':{'id':_0x40bf11[_0xe3ab('0x56')]['id']}})[_0xe3ab('0x29')](handleEntityNotFound(_0x3ba95a,null))[_0xe3ab('0x29')](function(_0x9ee08e){if(_0x9ee08e){return _0x9ee08e[_0xe3ab('0x8e')](_0x40bf11['query'][_0xe3ab('0x5e')])[_0xe3ab('0x29')](function(){if(_[_0xe3ab('0x62')](_0x40bf11[_0xe3ab('0x34')][_0xe3ab('0x5e')])){for(var _0x5a7fc3=0x0;_0x5a7fc3<_0x40bf11[_0xe3ab('0x34')]['ids'][_0xe3ab('0x38')];_0x5a7fc3+=0x1){socket[_0xe3ab('0x8f')](_0xe3ab('0x90'),{'UserId':Number(_0x40bf11[_0xe3ab('0x34')][_0xe3ab('0x5e')][_0x5a7fc3]),'CmListId':Number(_0x40bf11[_0xe3ab('0x56')]['id'])});}}else{socket[_0xe3ab('0x8f')]('userCmList:remove',{'UserId':Number(_0x40bf11['query']['ids']),'CmListId':Number(_0x40bf11[_0xe3ab('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0x3ba95a,null))[_0xe3ab('0x47')](handleError(_0x3ba95a,null));};exports[_0xe3ab('0x91')]=function(_0x533265,_0x1fdcbe,_0x5986ad){var _0x452c7b={};var _0x5970ec={};var _0x9d6763;var _0x5dfafd;return db[_0xe3ab('0x43')][_0xe3ab('0x5b')]({'where':{'id':_0x533265['params']['id']}})['then'](handleEntityNotFound(_0x1fdcbe,null))[_0xe3ab('0x29')](function(_0x307b7e){if(_0x307b7e){_0x9d6763=_0x307b7e;_0x5970ec[_0xe3ab('0x33')]=_['keys'](db[_0xe3ab('0x92')][_0xe3ab('0x31')]);_0x5970ec['query']=_['keys'](_0x533265[_0xe3ab('0x34')]);_0x5970ec[_0xe3ab('0x3e')]=_['intersection'](_0x5970ec['model'],_0x5970ec[_0xe3ab('0x34')]);_0x452c7b[_0xe3ab('0x36')]=_[_0xe3ab('0x35')](_0x5970ec[_0xe3ab('0x33')],qs[_0xe3ab('0x37')](_0x533265[_0xe3ab('0x34')][_0xe3ab('0x37')]));_0x452c7b[_0xe3ab('0x36')]=_0x452c7b[_0xe3ab('0x36')][_0xe3ab('0x38')]?_0x452c7b['attributes']:_0x5970ec[_0xe3ab('0x33')];_0x452c7b['order']=qs['sort'](_0x533265[_0xe3ab('0x34')]['sort']);_0x452c7b[_0xe3ab('0x3d')]=qs[_0xe3ab('0x3e')](_[_0xe3ab('0x5c')](_0x533265[_0xe3ab('0x34')],_0x5970ec[_0xe3ab('0x3e')]));if(_0x533265['query'][_0xe3ab('0x3f')]){_0x452c7b[_0xe3ab('0x3d')]=_['merge'](_0x452c7b['where'],{'$or':_[_0xe3ab('0x30')](_0x452c7b['attributes'],function(_0x5030f8){var _0x2a4ecb={};_0x2a4ecb[_0x5030f8]={'$like':'%'+_0x533265[_0xe3ab('0x34')]['filter']+'%'};return _0x2a4ecb;})});}_0x452c7b=_[_0xe3ab('0x42')]({},_0x452c7b,_0x533265[_0xe3ab('0x4b')]);return _0x9d6763[_0xe3ab('0x91')](_0x452c7b);}})[_0xe3ab('0x29')](function(_0x1d6af0){if(_0x1d6af0){_0x5dfafd=_0x1d6af0['length'];if(!_0x533265['query'][_0xe3ab('0x39')](_0xe3ab('0x3a'))){_0x452c7b[_0xe3ab('0x21')]=qs['limit'](_0x533265[_0xe3ab('0x34')]['limit']);_0x452c7b[_0xe3ab('0x20')]=qs['offset'](_0x533265[_0xe3ab('0x34')][_0xe3ab('0x20')]);}return _0x9d6763[_0xe3ab('0x91')](_0x452c7b);}})[_0xe3ab('0x29')](function(_0x136584){if(_0x136584){return _0x136584?{'count':_0x5dfafd,'rows':_0x136584}:null;}})[_0xe3ab('0x29')](respondWithResult(_0x1fdcbe,null))[_0xe3ab('0x47')](handleError(_0x1fdcbe,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 63e1cfc..2539d50 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 _0x7217=['emit','hasOwnProperty','hook','exports','events','CmList','setMaxListeners','save','update','remove'];(function(_0x24a88e,_0x22a0b8){var _0x232cbb=function(_0x50b7a4){while(--_0x50b7a4){_0x24a88e['push'](_0x24a88e['shift']());}};_0x232cbb(++_0x22a0b8);}(_0x7217,0x19e));var _0x7721=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0x7217[_0x4b7b62];return _0x2280df;};'use strict';var EventEmitter=require(_0x7721('0x0'));var CmList=require('../../mysqldb')['db'][_0x7721('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x7721('0x2')](0x0);var events={'afterCreate':_0x7721('0x3'),'afterUpdate':_0x7721('0x4'),'afterDestroy':_0x7721('0x5')};function emitEvent(_0x4d6446){return function(_0x5bf160,_0x472a96,_0xce17f9){CmListEvents[_0x7721('0x6')](_0x4d6446+':'+_0x5bf160['id'],_0x5bf160);CmListEvents[_0x7721('0x6')](_0x4d6446,_0x5bf160);_0xce17f9(null);};}for(var e in events){if(events[_0x7721('0x7')](e)){var event=events[e];CmList[_0x7721('0x8')](e,emitEvent(event));}}module[_0x7721('0x9')]=CmListEvents; \ No newline at end of file +var _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x5fc3,0xa8));var _0x35fc=function(_0x34d275,_0x5d84ee){_0x34d275=_0x34d275-0x0;var _0x1379cc=_0x5fc3[_0x34d275];return _0x1379cc;};'use strict';var EventEmitter=require(_0x35fc('0x0'));var CmList=require(_0x35fc('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x35fc('0x2')](0x0);var events={'afterCreate':_0x35fc('0x3'),'afterUpdate':_0x35fc('0x4'),'afterDestroy':_0x35fc('0x5')};function emitEvent(_0xb4f9ce){return function(_0x5e75e6,_0x2d1404,_0x1d5fec){CmListEvents[_0x35fc('0x6')](_0xb4f9ce+':'+_0x5e75e6['id'],_0x5e75e6);CmListEvents['emit'](_0xb4f9ce,_0x5e75e6);_0x1d5fec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x35fc('0x7')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 041d823..f3409e6 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 _0xa9e0=['../../config/environment','./cmList.attributes','exports','define','CmList','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x1f76ec,_0x38b217){var _0x44851e=function(_0x313c54){while(--_0x313c54){_0x1f76ec['push'](_0x1f76ec['shift']());}};_0x44851e(++_0x38b217);}(_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':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ea3=['CmList','cm_lists','lodash','util','../../config/logger','api','bluebird','path','./cmList.attributes','exports','define'];(function(_0x193e28,_0x3dac1d){var _0x20ef59=function(_0x48047e){while(--_0x48047e){_0x193e28['push'](_0x193e28['shift']());}};_0x20ef59(++_0x3dac1d);}(_0x4ea3,0x70));var _0x34ea=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x4ea3[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x34ea('0x0'));var util=require(_0x34ea('0x1'));var logger=require(_0x34ea('0x2'))(_0x34ea('0x3'));var moment=require('moment');var BPromise=require(_0x34ea('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x34ea('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x34ea('0x6'));module[_0x34ea('0x7')]=function(_0x962596,_0x123d48){return _0x962596[_0x34ea('0x8')](_0x34ea('0x9'),attributes,{'tableName':_0x34ea('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 9d3f89a..5b5ae2f 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 _0xade8=['error','code','message','catch','lodash','util','moment','randomstring','ioredis','rpc','jayson/promise','client','redis','localhost','socket.io-emitter','./cmList.socket','register','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x88d72b,_0x161055){var _0x15a298=function(_0x2a9b04){while(--_0x2a9b04){_0x88d72b['push'](_0x88d72b['shift']());}};_0x15a298(++_0x161055);}(_0xade8,0x94));var _0x8ade=function(_0x1e2232,_0x397ea8){_0x1e2232=_0x1e2232-0x0;var _0x410968=_0xade8[_0x1e2232];return _0x410968;};'use strict';var _=require(_0x8ade('0x0'));var util=require(_0x8ade('0x1'));var moment=require(_0x8ade('0x2'));var BPromise=require('bluebird');var rs=require(_0x8ade('0x3'));var fs=require('fs');var Redis=require(_0x8ade('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8ade('0x5'));var config=require('../../config/environment');var jayson=require(_0x8ade('0x6'));var client=jayson[_0x8ade('0x7')]['http']({'port':0x232a});config[_0x8ade('0x8')]=_['defaults'](config['redis'],{'host':_0x8ade('0x9'),'port':0x18eb});var socket=require(_0x8ade('0xa'))(new Redis(config[_0x8ade('0x8')]));require(_0x8ade('0xb'))[_0x8ade('0xc')](socket);function respondWithRpcPromise(_0x4539b1,_0x332ebd,_0x4d4a3c){return new BPromise(function(_0x52f841,_0x3d33fa){return client['request'](_0x4539b1,_0x4d4a3c)[_0x8ade('0xd')](function(_0x35e22f){logger[_0x8ade('0xe')](_0x8ade('0xf'),_0x332ebd,_0x8ade('0x10'));logger[_0x8ade('0x11')](_0x8ade('0x12'),_0x332ebd,_0x8ade('0x10'),JSON[_0x8ade('0x13')](_0x35e22f));if(_0x35e22f[_0x8ade('0x14')]){if(_0x35e22f[_0x8ade('0x14')][_0x8ade('0x15')]===0x1f4){logger[_0x8ade('0x14')](_0x8ade('0xf'),_0x332ebd,_0x35e22f['error'][_0x8ade('0x16')]);return _0x3d33fa(_0x35e22f['error'][_0x8ade('0x16')]);}logger[_0x8ade('0x14')](_0x8ade('0xf'),_0x332ebd,_0x35e22f[_0x8ade('0x14')][_0x8ade('0x16')]);return _0x52f841(_0x35e22f[_0x8ade('0x14')][_0x8ade('0x16')]);}else{logger[_0x8ade('0xe')]('CmList,\x20%s,\x20%s',_0x332ebd,_0x8ade('0x10'));_0x52f841(_0x35e22f['result'][_0x8ade('0x16')]);}})[_0x8ade('0x17')](function(_0x152276){logger[_0x8ade('0x14')](_0x8ade('0xf'),_0x332ebd,_0x152276);_0x3d33fa(_0x152276);});});} \ No newline at end of file +var _0x66cc=['jayson/promise','client','redis','defaults','socket.io-emitter','request','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x21b254,_0x28c55b){var _0xa52d8c=function(_0x4f0a70){while(--_0x4f0a70){_0x21b254['push'](_0x21b254['shift']());}};_0xa52d8c(++_0x28c55b);}(_0x66cc,0x1a6));var _0xc66c=function(_0x3890ae,_0x414c9f){_0x3890ae=_0x3890ae-0x0;var _0x5151f4=_0x66cc[_0x3890ae];return _0x5151f4;};'use strict';var _=require(_0xc66c('0x0'));var util=require(_0xc66c('0x1'));var moment=require(_0xc66c('0x2'));var BPromise=require(_0xc66c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc66c('0x4'));var db=require(_0xc66c('0x5'))['db'];var utils=require(_0xc66c('0x6'));var logger=require(_0xc66c('0x7'))(_0xc66c('0x8'));var config=require(_0xc66c('0x9'));var jayson=require(_0xc66c('0xa'));var client=jayson[_0xc66c('0xb')]['http']({'port':0x232a});config[_0xc66c('0xc')]=_[_0xc66c('0xd')](config[_0xc66c('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xc66c('0xe'))(new Redis(config[_0xc66c('0xc')]));require('./cmList.socket')['register'](socket);function respondWithRpcPromise(_0x2b1f4a,_0x120b1b,_0x4e696c){return new BPromise(function(_0x52e3f7,_0x243ed4){return client[_0xc66c('0xf')](_0x2b1f4a,_0x4e696c)['then'](function(_0x2bb2b9){logger[_0xc66c('0x10')](_0xc66c('0x11'),_0x120b1b,_0xc66c('0x12'));logger[_0xc66c('0x13')](_0xc66c('0x14'),_0x120b1b,_0xc66c('0x12'),JSON[_0xc66c('0x15')](_0x2bb2b9));if(_0x2bb2b9[_0xc66c('0x16')]){if(_0x2bb2b9[_0xc66c('0x16')][_0xc66c('0x17')]===0x1f4){logger[_0xc66c('0x16')](_0xc66c('0x11'),_0x120b1b,_0x2bb2b9[_0xc66c('0x16')][_0xc66c('0x18')]);return _0x243ed4(_0x2bb2b9['error'][_0xc66c('0x18')]);}logger['error']('CmList,\x20%s,\x20%s',_0x120b1b,_0x2bb2b9[_0xc66c('0x16')]['message']);return _0x52e3f7(_0x2bb2b9[_0xc66c('0x16')][_0xc66c('0x18')]);}else{logger['info'](_0xc66c('0x11'),_0x120b1b,_0xc66c('0x12'));_0x52e3f7(_0x2bb2b9[_0xc66c('0x19')][_0xc66c('0x18')]);}})[_0xc66c('0x1a')](function(_0x3a6e71){logger[_0xc66c('0x16')]('CmList,\x20%s,\x20%s',_0x120b1b,_0x3a6e71);_0x243ed4(_0x3a6e71);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index bf3f188..8c87b0a 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 _0xbeed=['update','emit','register','length','cmList:','./cmList.events','remove'];(function(_0x4d89fd,_0x411fe1){var _0x3262a6=function(_0x2c7505){while(--_0x2c7505){_0x4d89fd['push'](_0x4d89fd['shift']());}};_0x3262a6(++_0x411fe1);}(_0xbeed,0x9f));var _0xdbee=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xbeed[_0x2dafbe];return _0x58a45a;};'use strict';var CmListEvents=require(_0xdbee('0x0'));var events=['save',_0xdbee('0x1'),_0xdbee('0x2')];function createListener(_0x53cf23,_0x1f3c51){return function(_0x46e905){_0x1f3c51[_0xdbee('0x3')](_0x53cf23,_0x46e905);};}function removeListener(_0x5798a7,_0x4e1b25){return function(){CmListEvents['removeListener'](_0x5798a7,_0x4e1b25);};}exports[_0xdbee('0x4')]=function(_0x2b408e){for(var _0x42daf1=0x0,_0x3a5944=events[_0xdbee('0x5')];_0x42daf1<_0x3a5944;_0x42daf1++){var _0x139da4=events[_0x42daf1];var _0xdb61e9=createListener(_0xdbee('0x6')+_0x139da4,_0x2b408e);CmListEvents['on'](_0x139da4,_0xdb61e9);}}; \ No newline at end of file +var _0x5cec=['./cmList.events','save','update','emit','removeListener','register'];(function(_0x2296b5,_0x5efe9c){var _0x1e8ae2=function(_0x45219f){while(--_0x45219f){_0x2296b5['push'](_0x2296b5['shift']());}};_0x1e8ae2(++_0x5efe9c);}(_0x5cec,0x14a));var _0xc5ce=function(_0x54c464,_0x43affc){_0x54c464=_0x54c464-0x0;var _0xd71a31=_0x5cec[_0x54c464];return _0xd71a31;};'use strict';var CmListEvents=require(_0xc5ce('0x0'));var events=[_0xc5ce('0x1'),'remove',_0xc5ce('0x2')];function createListener(_0x4068d6,_0x4d002d){return function(_0x442ee3){_0x4d002d[_0xc5ce('0x3')](_0x4068d6,_0x442ee3);};}function removeListener(_0x47c514,_0x30b8f4){return function(){CmListEvents[_0xc5ce('0x4')](_0x47c514,_0x30b8f4);};}exports[_0xc5ce('0x5')]=function(_0xab7218){for(var _0xe7059a=0x0,_0x50c958=events['length'];_0xe7059a<_0x50c958;_0xe7059a++){var _0x166b2c=events[_0xe7059a];var _0x1ad37a=createListener('cmList:'+_0x166b2c,_0xab7218);CmListEvents['on'](_0x166b2c,_0x1ad37a);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 6002ffe..c960ce1 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 _0x8ce7=['getDispositions','/:id/contacts','getContacts','getContactsCsv','/:id/fields','getAgents','post','addDisposition','addContacts','addCustomField','addAgents','put','update','delete','destroy','/:id/users','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmList.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions'];(function(_0x2236dc,_0x43c7f9){var _0x20583f=function(_0x293e36){while(--_0x293e36){_0x2236dc['push'](_0x2236dc['shift']());}};_0x20583f(++_0x43c7f9);}(_0x8ce7,0xbb));var _0x78ce=function(_0x26bb33,_0x5bfd82){_0x26bb33=_0x26bb33-0x0;var _0x3aae3c=_0x8ce7[_0x26bb33];return _0x3aae3c;};'use strict';var multer=require(_0x78ce('0x0'));var util=require(_0x78ce('0x1'));var path=require(_0x78ce('0x2'));var timeout=require(_0x78ce('0x3'));var express=require(_0x78ce('0x4'));var router=express[_0x78ce('0x5')]();var fs_extra=require(_0x78ce('0x6'));var auth=require(_0x78ce('0x7'));var interaction=require(_0x78ce('0x8'));var config=require('../../config/environment');var controller=require(_0x78ce('0x9'));router[_0x78ce('0xa')]('/',auth[_0x78ce('0xb')](),controller[_0x78ce('0xc')]);router[_0x78ce('0xa')](_0x78ce('0xd'),auth[_0x78ce('0xb')](),controller['describe']);router[_0x78ce('0xa')](_0x78ce('0xe'),auth['isAuthenticated'](),controller[_0x78ce('0xf')]);router['get'](_0x78ce('0x10'),auth[_0x78ce('0xb')](),controller[_0x78ce('0x11')]);router['get'](_0x78ce('0x12'),auth[_0x78ce('0xb')](),controller[_0x78ce('0x13')]);router[_0x78ce('0xa')]('/:id/contacts/csv',auth[_0x78ce('0xb')](),controller[_0x78ce('0x14')]);router[_0x78ce('0xa')](_0x78ce('0x15'),auth['isAuthenticated'](),controller['getCustomFields']);router['get']('/:id/users',auth[_0x78ce('0xb')](),controller[_0x78ce('0x16')]);router[_0x78ce('0x17')]('/',auth[_0x78ce('0xb')](),controller['create']);router['post'](_0x78ce('0x10'),auth['isAuthenticated'](),controller[_0x78ce('0x18')]);router[_0x78ce('0x17')](_0x78ce('0x12'),auth['isAuthenticated'](),controller[_0x78ce('0x19')]);router[_0x78ce('0x17')]('/:id/fields',auth[_0x78ce('0xb')](),controller[_0x78ce('0x1a')]);router[_0x78ce('0x17')]('/:id/users',auth[_0x78ce('0xb')](),controller[_0x78ce('0x1b')]);router[_0x78ce('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0x78ce('0x1d')]);router[_0x78ce('0x1e')](_0x78ce('0xe'),auth[_0x78ce('0xb')](),controller[_0x78ce('0x1f')]);router[_0x78ce('0x1e')]('/:id/dispositions',auth[_0x78ce('0xb')](),controller['removeDispositions']);router[_0x78ce('0x1e')](_0x78ce('0x20'),auth[_0x78ce('0xb')](),controller['removeAgents']);module[_0x78ce('0x21')]=router; \ No newline at end of file +var _0x5f47=['put','update','destroy','delete','removeDispositions','/:id/users','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./cmList.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','post','addDisposition','addContacts','addCustomField','addAgents'];(function(_0x1590f5,_0xc7d7c0){var _0x4a7b67=function(_0x59e856){while(--_0x59e856){_0x1590f5['push'](_0x1590f5['shift']());}};_0x4a7b67(++_0xc7d7c0);}(_0x5f47,0x107));var _0x75f4=function(_0x280a12,_0xdb85a1){_0x280a12=_0x280a12-0x0;var _0x3db985=_0x5f47[_0x280a12];return _0x3db985;};'use strict';var multer=require(_0x75f4('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x75f4('0x1'));var express=require(_0x75f4('0x2'));var router=express[_0x75f4('0x3')]();var fs_extra=require(_0x75f4('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x75f4('0x5'));var config=require('../../config/environment');var controller=require(_0x75f4('0x6'));router[_0x75f4('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x75f4('0x7')](_0x75f4('0x8'),auth[_0x75f4('0x9')](),controller[_0x75f4('0xa')]);router[_0x75f4('0x7')](_0x75f4('0xb'),auth['isAuthenticated'](),controller[_0x75f4('0xc')]);router[_0x75f4('0x7')](_0x75f4('0xd'),auth[_0x75f4('0x9')](),controller['getDispositions']);router['get'](_0x75f4('0xe'),auth[_0x75f4('0x9')](),controller[_0x75f4('0xf')]);router[_0x75f4('0x7')](_0x75f4('0x10'),auth['isAuthenticated'](),controller[_0x75f4('0x11')]);router['get'](_0x75f4('0x12'),auth[_0x75f4('0x9')](),controller[_0x75f4('0x13')]);router[_0x75f4('0x7')]('/:id/users',auth[_0x75f4('0x9')](),controller['getAgents']);router[_0x75f4('0x14')]('/',auth[_0x75f4('0x9')](),controller['create']);router[_0x75f4('0x14')](_0x75f4('0xd'),auth[_0x75f4('0x9')](),controller[_0x75f4('0x15')]);router[_0x75f4('0x14')](_0x75f4('0xe'),auth['isAuthenticated'](),controller[_0x75f4('0x16')]);router[_0x75f4('0x14')]('/:id/fields',auth['isAuthenticated'](),controller[_0x75f4('0x17')]);router['post']('/:id/users',auth[_0x75f4('0x9')](),controller[_0x75f4('0x18')]);router[_0x75f4('0x19')](_0x75f4('0xb'),auth[_0x75f4('0x9')](),controller[_0x75f4('0x1a')]);router['delete'](_0x75f4('0xb'),auth[_0x75f4('0x9')](),controller[_0x75f4('0x1b')]);router[_0x75f4('0x1c')](_0x75f4('0xd'),auth[_0x75f4('0x9')](),controller[_0x75f4('0x1d')]);router[_0x75f4('0x1c')](_0x75f4('0x1e'),auth[_0x75f4('0x9')](),controller['removeAgents']);module[_0x75f4('0x1f')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 0900439..9b1d97f 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 _0x1af8=['VIRTUAL','getDataValue','field','STRING','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1af8,0xcc));var _0x81af=function(_0x1b939b,_0x5188ac){_0x1b939b=_0x1b939b-0x0;var _0x4f1020=_0x1af8[_0x1b939b];return _0x4f1020;};'use strict';var Sequelize=require('sequelize');module[_0x81af('0x0')]={'name':{'type':Sequelize[_0x81af('0x1')],'get':function(_0x171dce){return this[_0x81af('0x2')](_0x81af('0x3'));}},'field':{'type':Sequelize[_0x81af('0x4')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x81af('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0x03ec=['sequelize','VIRTUAL','getDataValue','STRING'];(function(_0x5229f8,_0x4aa58c){var _0x408403=function(_0x4758eb){while(--_0x4758eb){_0x5229f8['push'](_0x5229f8['shift']());}};_0x408403(++_0x4aa58c);}(_0x03ec,0x134));var _0xc03e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x03ec[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xc03e('0x0'));module['exports']={'name':{'type':Sequelize[_0xc03e('0x1')],'get':function(_0x5df94b){return this[_0xc03e('0x2')]('field');}},'field':{'type':Sequelize[_0xc03e('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0xc03e('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0xc03e('0x3')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 8d670fd..df94850 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(_0x4c2f42,_0x18bcf8){var _0x3bf57b=function(_0x49f7a7){while(--_0x49f7a7){_0x4c2f42['push'](_0x4c2f42['shift']());}};_0x3bf57b(++_0x18bcf8);}(_0x7a54,0x106));var _0x47a5=function(_0x36bd4a,_0x54c4ee){_0x36bd4a=_0x36bd4a-0x0;var _0x5ba279=_0x7a54[_0x36bd4a];return _0x5ba279;};'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 _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x577f91,_0x398c1d){var _0x4c6fbd=function(_0xc8c851){while(--_0xc8c851){_0x577f91['push'](_0x577f91['shift']());}};_0x4c6fbd(++_0x398c1d);}(_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){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 4170efd..e1d1872 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 _0x2ed9=['request-promise','./condition.attributes','define','lodash','../../config/logger','api','moment'];(function(_0x408bb6,_0x51ec4a){var _0x830d87=function(_0x2a0ccd){while(--_0x2a0ccd){_0x408bb6['push'](_0x408bb6['shift']());}};_0x830d87(++_0x51ec4a);}(_0x2ed9,0x129));var _0x92ed=function(_0x5eae14,_0x127218){_0x5eae14=_0x5eae14-0x0;var _0x317a7e=_0x2ed9[_0x5eae14];return _0x317a7e;};'use strict';var _=require(_0x92ed('0x0'));var util=require('util');var logger=require(_0x92ed('0x1'))(_0x92ed('0x2'));var moment=require(_0x92ed('0x3'));var BPromise=require('bluebird');var rp=require(_0x92ed('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x92ed('0x5'));module['exports']=function(_0x4b96c6,_0x4e8d0b){return _0x4b96c6[_0x92ed('0x6')]('Condition',attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x10dc=['api','moment','bluebird','request-promise','rimraf','./condition.attributes','exports','define','Condition','tools_conditions','lodash','util','../../config/logger'];(function(_0x1bb6aa,_0x40fe82){var _0x2ef28e=function(_0x32b4eb){while(--_0x32b4eb){_0x1bb6aa['push'](_0x1bb6aa['shift']());}};_0x2ef28e(++_0x40fe82);}(_0x10dc,0xe7));var _0xc10d=function(_0x52b828,_0x359d0f){_0x52b828=_0x52b828-0x0;var _0x2721d8=_0x10dc[_0x52b828];return _0x2721d8;};'use strict';var _=require(_0xc10d('0x0'));var util=require(_0xc10d('0x1'));var logger=require(_0xc10d('0x2'))(_0xc10d('0x3'));var moment=require(_0xc10d('0x4'));var BPromise=require(_0xc10d('0x5'));var rp=require(_0xc10d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc10d('0x7'));var config=require('../../config/environment');var attributes=require(_0xc10d('0x8'));module[_0xc10d('0x9')]=function(_0x36e88d,_0x40e3f3){return _0x36e88d[_0xc10d('0xa')](_0xc10d('0xb'),attributes,{'tableName':_0xc10d('0xc'),'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 e96b69b..d4135c7 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 _0x11a8=['message','result','lodash','moment','ioredis','../../config/logger','../../config/environment','jayson/promise','http','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x54dcf4,_0xc85639){var _0x15b109=function(_0x570493){while(--_0x570493){_0x54dcf4['push'](_0x54dcf4['shift']());}};_0x15b109(++_0xc85639);}(_0x11a8,0x134));var _0x811a=function(_0x1025c2,_0x26b5db){_0x1025c2=_0x1025c2-0x0;var _0x25e5c2=_0x11a8[_0x1025c2];return _0x25e5c2;};'use strict';var _=require(_0x811a('0x0'));var util=require('util');var moment=require(_0x811a('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x811a('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x811a('0x3'))('rpc');var config=require(_0x811a('0x4'));var jayson=require(_0x811a('0x5'));var client=jayson['client'][_0x811a('0x6')]({'port':0x232a});function respondWithRpcPromise(_0xfd4402,_0x4280c3,_0x1842e4){return new BPromise(function(_0x26acac,_0x116934){return client['request'](_0xfd4402,_0x1842e4)[_0x811a('0x7')](function(_0x1ef8b1){logger[_0x811a('0x8')](_0x811a('0x9'),_0x4280c3,_0x811a('0xa'));logger[_0x811a('0xb')]('Condition,\x20%s,\x20%s,\x20%s',_0x4280c3,_0x811a('0xa'),JSON[_0x811a('0xc')](_0x1ef8b1));if(_0x1ef8b1[_0x811a('0xd')]){if(_0x1ef8b1[_0x811a('0xd')][_0x811a('0xe')]===0x1f4){logger[_0x811a('0xd')](_0x811a('0x9'),_0x4280c3,_0x1ef8b1['error'][_0x811a('0xf')]);return _0x116934(_0x1ef8b1[_0x811a('0xd')][_0x811a('0xf')]);}logger['error'](_0x811a('0x9'),_0x4280c3,_0x1ef8b1[_0x811a('0xd')][_0x811a('0xf')]);return _0x26acac(_0x1ef8b1[_0x811a('0xd')][_0x811a('0xf')]);}else{logger[_0x811a('0x8')](_0x811a('0x9'),_0x4280c3,'request\x20sent');_0x26acac(_0x1ef8b1[_0x811a('0x10')][_0x811a('0xf')]);}})['catch'](function(_0x42a1a1){logger[_0x811a('0xd')](_0x811a('0x9'),_0x4280c3,_0x42a1a1);_0x116934(_0x42a1a1);});});} \ No newline at end of file +var _0x4f49=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','util','moment','randomstring'];(function(_0x45515b,_0x1e16a8){var _0x20ed56=function(_0x2eac5e){while(--_0x2eac5e){_0x45515b['push'](_0x45515b['shift']());}};_0x20ed56(++_0x1e16a8);}(_0x4f49,0xe4));var _0x94f4=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x4f49[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require(_0x94f4('0x0'));var moment=require(_0x94f4('0x1'));var BPromise=require('bluebird');var rs=require(_0x94f4('0x2'));var fs=require('fs');var Redis=require(_0x94f4('0x3'));var db=require(_0x94f4('0x4'))['db'];var utils=require(_0x94f4('0x5'));var logger=require(_0x94f4('0x6'))(_0x94f4('0x7'));var config=require(_0x94f4('0x8'));var jayson=require(_0x94f4('0x9'));var client=jayson['client'][_0x94f4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41799a,_0xebdef5,_0x223ff9){return new BPromise(function(_0x587c3d,_0x19888a){return client[_0x94f4('0xb')](_0x41799a,_0x223ff9)['then'](function(_0x5be42e){logger['info'](_0x94f4('0xc'),_0xebdef5,_0x94f4('0xd'));logger[_0x94f4('0xe')](_0x94f4('0xf'),_0xebdef5,_0x94f4('0xd'),JSON[_0x94f4('0x10')](_0x5be42e));if(_0x5be42e[_0x94f4('0x11')]){if(_0x5be42e[_0x94f4('0x11')]['code']===0x1f4){logger['error']('Condition,\x20%s,\x20%s',_0xebdef5,_0x5be42e[_0x94f4('0x11')][_0x94f4('0x12')]);return _0x19888a(_0x5be42e[_0x94f4('0x11')][_0x94f4('0x12')]);}logger[_0x94f4('0x11')](_0x94f4('0xc'),_0xebdef5,_0x5be42e[_0x94f4('0x11')][_0x94f4('0x12')]);return _0x587c3d(_0x5be42e[_0x94f4('0x11')][_0x94f4('0x12')]);}else{logger[_0x94f4('0x13')](_0x94f4('0xc'),_0xebdef5,_0x94f4('0xd'));_0x587c3d(_0x5be42e[_0x94f4('0x14')]['message']);}})['catch'](function(_0x9f5e37){logger[_0x94f4('0x11')](_0x94f4('0xc'),_0xebdef5,_0x9f5e37);_0x19888a(_0x9f5e37);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 250156d..b92d747 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 _0x5b0d=['/:id','update','delete','isAuthenticated','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./condition.controller'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5b0d,0xae));var _0xd5b0=function(_0x5bbfa7,_0x118a4a){_0x5bbfa7=_0x5bbfa7-0x0;var _0x671f7=_0x5b0d[_0x5bbfa7];return _0x671f7;};'use strict';var multer=require(_0xd5b0('0x0'));var util=require('util');var path=require(_0xd5b0('0x1'));var timeout=require(_0xd5b0('0x2'));var express=require(_0xd5b0('0x3'));var router=express[_0xd5b0('0x4')]();var fs_extra=require(_0xd5b0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd5b0('0x6'));var config=require('../../config/environment');var controller=require(_0xd5b0('0x7'));router['put'](_0xd5b0('0x8'),auth['isAuthenticated'](),controller[_0xd5b0('0x9')]);router[_0xd5b0('0xa')](_0xd5b0('0x8'),auth[_0xd5b0('0xb')](),controller[_0xd5b0('0xc')]);module[_0xd5b0('0xd')]=router; \ No newline at end of file +var _0x4c8f=['../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','update','delete','/:id','isAuthenticated','destroy','exports','multer','util','connect-timeout','Router','fs-extra'];(function(_0x4cbd80,_0x1f2001){var _0x2e0950=function(_0x31fc5c){while(--_0x31fc5c){_0x4cbd80['push'](_0x4cbd80['shift']());}};_0x2e0950(++_0x1f2001);}(_0x4c8f,0x10b));var _0xf4c8=function(_0x1645f7,_0x36a351){_0x1645f7=_0x1645f7-0x0;var _0x19d184=_0x4c8f[_0x1645f7];return _0x19d184;};'use strict';var multer=require(_0xf4c8('0x0'));var util=require(_0xf4c8('0x1'));var path=require('path');var timeout=require(_0xf4c8('0x2'));var express=require('express');var router=express[_0xf4c8('0x3')]();var fs_extra=require(_0xf4c8('0x4'));var auth=require(_0xf4c8('0x5'));var interaction=require(_0xf4c8('0x6'));var config=require(_0xf4c8('0x7'));var controller=require(_0xf4c8('0x8'));router[_0xf4c8('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xf4c8('0xa')]);router[_0xf4c8('0xb')](_0xf4c8('0xc'),auth[_0xf4c8('0xd')](),controller[_0xf4c8('0xe')]);module[_0xf4c8('0xf')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 5226a13..fdd3351 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 _0xc120=['STRING','name','sequelize'];(function(_0x4ca24a,_0x20672e){var _0x2180dc=function(_0x21dc74){while(--_0x21dc74){_0x4ca24a['push'](_0x4ca24a['shift']());}};_0x2180dc(++_0x20672e);}(_0xc120,0x1be));var _0x0c12=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xc120[_0x40ac5e];return _0x2839d6;};'use strict';var Sequelize=require(_0x0c12('0x0'));module['exports']={'name':{'type':Sequelize[_0x0c12('0x1')],'allowNull':![],'unique':_0x0c12('0x2')},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0xad6e=['name','sequelize','exports','STRING'];(function(_0x8133ca,_0x3b2efc){var _0x225e17=function(_0xeab268){while(--_0xeab268){_0x8133ca['push'](_0x8133ca['shift']());}};_0x225e17(++_0x3b2efc);}(_0xad6e,0x89));var _0xead6=function(_0x51b55b,_0x238980){_0x51b55b=_0x51b55b-0x0;var _0x4f853b=_0xad6e[_0x51b55b];return _0x4f853b;};'use strict';var Sequelize=require(_0xead6('0x0'));module[_0xead6('0x1')]={'name':{'type':Sequelize[_0xead6('0x2')],'allowNull':![],'unique':_0xead6('0x3')},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0xead6('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 078f90a..03a90dd 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 _0x2ca4=['count','include','findAll','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','set','Content-Range','json','apply','reject','save','update','destroy','then','get','ContactItemTypes','end','error','name','map','rawAttributes','type','key','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','merge','VIRTUAL','filter','options','ContactItemType'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0x2ca4,0x66));var _0x42ca=function(_0x42ebba,_0x4cbf87){_0x42ebba=_0x42ebba-0x0;var _0x3fd2af=_0x2ca4[_0x42ebba];return _0x3fd2af;};'use strict';var emlformat=require(_0x42ca('0x0'));var rimraf=require(_0x42ca('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x42ca('0x2'));var rp=require(_0x42ca('0x3'));var moment=require('moment');var BPromise=require(_0x42ca('0x4'));var Mustache=require(_0x42ca('0x5'));var util=require(_0x42ca('0x6'));var path=require(_0x42ca('0x7'));var sox=require(_0x42ca('0x8'));var csv=require('to-csv');var ejs=require(_0x42ca('0x9'));var fs=require('fs');var fs_extra=require(_0x42ca('0xa'));var _=require(_0x42ca('0xb'));var squel=require(_0x42ca('0xc'));var crypto=require(_0x42ca('0xd'));var jsforce=require(_0x42ca('0xe'));var deskjs=require(_0x42ca('0xf'));var toCsv=require(_0x42ca('0x10'));var querystring=require(_0x42ca('0x11'));var Papa=require(_0x42ca('0x12'));var Redis=require(_0x42ca('0x13'));var authService=require(_0x42ca('0x14'));var qs=require(_0x42ca('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x42ca('0x16'))(_0x42ca('0x17'));var utils=require('../../config/utils');var config=require(_0x42ca('0x18'));var licenseUtil=require(_0x42ca('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x166797,_0x5d52f5){_0x5d52f5=_0x5d52f5||0xcc;return function(_0x25154c){if(_0x25154c){return _0x166797[_0x42ca('0x1a')](_0x5d52f5);}return _0x166797[_0x42ca('0x1b')](_0x5d52f5)['end']();};}function respondWithResult(_0xb91a40,_0x1301f9){_0x1301f9=_0x1301f9||0xc8;return function(_0x20999b){if(_0x20999b){return _0xb91a40[_0x42ca('0x1b')](_0x1301f9)['json'](_0x20999b);}};}function respondWithFilteredResult(_0x3c605f,_0x2d99bb){return function(_0x5ca598){if(_0x5ca598){var _0x6144ca=typeof _0x2d99bb[_0x42ca('0x1c')]==='undefined'&&typeof _0x2d99bb['limit']===_0x42ca('0x1d');var _0x168890=_0x5ca598['count'];var _0x200c8b=_0x6144ca?0x0:_0x2d99bb[_0x42ca('0x1c')];var _0x3ca6ab=_0x6144ca?_0x5ca598['count']:_0x2d99bb[_0x42ca('0x1c')]+_0x2d99bb['limit'];var _0x105f5d;if(_0x3ca6ab>=_0x168890){_0x3ca6ab=_0x168890;_0x105f5d=0xc8;}else{_0x105f5d=0xce;}_0x3c605f[_0x42ca('0x1b')](_0x105f5d);return _0x3c605f[_0x42ca('0x1e')](_0x42ca('0x1f'),_0x200c8b+'-'+_0x3ca6ab+'/'+_0x168890)[_0x42ca('0x20')](_0x5ca598);}return null;};}function patchUpdates(_0x502196){return function(_0x2c145f){try{jsonpatch[_0x42ca('0x21')](_0x2c145f,_0x502196,!![]);}catch(_0x17bf68){return BPromise[_0x42ca('0x22')](_0x17bf68);}return _0x2c145f[_0x42ca('0x23')]();};}function saveUpdates(_0x10bdec,_0x5de56b){return function(_0x2d5a35){if(_0x2d5a35){return _0x2d5a35[_0x42ca('0x24')](_0x10bdec)['then'](function(_0x59489e){return _0x59489e;});}return null;};}function removeEntity(_0x41b5c7,_0x27cb30){return function(_0x4a7857){if(_0x4a7857){return _0x4a7857[_0x42ca('0x25')]()[_0x42ca('0x26')](function(){var _0x5883c6=_0x4a7857[_0x42ca('0x27')]({'plain':!![]});var _0x44b30a=_0x42ca('0x28');return db['UserProfileResource'][_0x42ca('0x25')]({'where':{'type':_0x44b30a,'resourceId':_0x5883c6['id']}})[_0x42ca('0x26')](function(){return _0x4a7857;});})['then'](function(){_0x41b5c7['status'](0xcc)[_0x42ca('0x29')]();});}};}function handleEntityNotFound(_0x280326,_0x413d2a){return function(_0x246315){if(!_0x246315){_0x280326[_0x42ca('0x1a')](0x194);}return _0x246315;};}function handleError(_0x12ddc5,_0x13ace2){_0x13ace2=_0x13ace2||0x1f4;return function(_0x298dc7){logger[_0x42ca('0x2a')](_0x298dc7['stack']);if(_0x298dc7[_0x42ca('0x2b')]){delete _0x298dc7[_0x42ca('0x2b')];}_0x12ddc5['status'](_0x13ace2)['send'](_0x298dc7);};}exports['index']=function(_0x1932a0,_0x1f6ffb){var _0x3d58fd={},_0x544507={},_0x16680f={'count':0x0,'rows':[]};var _0x523001=_[_0x42ca('0x2c')](db['ContactItemType'][_0x42ca('0x2d')],function(_0x20d938){return{'name':_0x20d938['fieldName'],'type':_0x20d938[_0x42ca('0x2e')][_0x42ca('0x2f')]};});_0x544507['model']=_['map'](_0x523001,'name');_0x544507[_0x42ca('0x30')]=_['keys'](_0x1932a0['query']);_0x544507[_0x42ca('0x31')]=_['intersection'](_0x544507[_0x42ca('0x32')],_0x544507['query']);_0x3d58fd[_0x42ca('0x33')]=_[_0x42ca('0x34')](_0x544507[_0x42ca('0x32')],qs[_0x42ca('0x35')](_0x1932a0[_0x42ca('0x30')]['fields']));_0x3d58fd[_0x42ca('0x33')]=_0x3d58fd['attributes'][_0x42ca('0x36')]?_0x3d58fd[_0x42ca('0x33')]:_0x544507[_0x42ca('0x32')];if(!_0x1932a0['query'][_0x42ca('0x37')](_0x42ca('0x38'))){_0x3d58fd[_0x42ca('0x39')]=qs['limit'](_0x1932a0[_0x42ca('0x30')]['limit']);_0x3d58fd[_0x42ca('0x1c')]=qs[_0x42ca('0x1c')](_0x1932a0[_0x42ca('0x30')][_0x42ca('0x1c')]);}_0x3d58fd[_0x42ca('0x3a')]=qs[_0x42ca('0x3b')](_0x1932a0['query'][_0x42ca('0x3b')]);_0x3d58fd[_0x42ca('0x3c')]=qs[_0x42ca('0x31')](_['pick'](_0x1932a0[_0x42ca('0x30')],_0x544507[_0x42ca('0x31')]),_0x523001);if(_0x1932a0[_0x42ca('0x30')]['filter']){_0x3d58fd['where']=_[_0x42ca('0x3d')](_0x3d58fd['where'],{'$or':_['map'](_0x523001,function(_0x311ebf){if(_0x311ebf[_0x42ca('0x2e')]!==_0x42ca('0x3e')){var _0x5776a6={};_0x5776a6[_0x311ebf[_0x42ca('0x2b')]]={'$like':'%'+_0x1932a0[_0x42ca('0x30')][_0x42ca('0x3f')]+'%'};return _0x5776a6;}})});}_0x3d58fd=_[_0x42ca('0x3d')]({},_0x3d58fd,_0x1932a0[_0x42ca('0x40')]);var _0x5d48f2={'where':_0x3d58fd[_0x42ca('0x3c')]};return db[_0x42ca('0x41')][_0x42ca('0x42')](_0x5d48f2)['then'](function(_0x503f9b){_0x16680f[_0x42ca('0x42')]=_0x503f9b;if(_0x1932a0[_0x42ca('0x30')]['includeAll']){_0x3d58fd[_0x42ca('0x43')]=[{'all':!![]}];}return db[_0x42ca('0x41')][_0x42ca('0x44')](_0x3d58fd);})[_0x42ca('0x26')](function(_0x434243){_0x16680f['rows']=_0x434243;return _0x16680f;})['then'](respondWithFilteredResult(_0x1f6ffb,_0x3d58fd))[_0x42ca('0x45')](handleError(_0x1f6ffb,null));};exports[_0x42ca('0x46')]=function(_0x15f621,_0x5667f9){var _0x2a22cf={'raw':!![],'where':{'id':_0x15f621[_0x42ca('0x47')]['id']}},_0xffd8fc={};_0xffd8fc[_0x42ca('0x32')]=_[_0x42ca('0x48')](db[_0x42ca('0x41')][_0x42ca('0x2d')]);_0xffd8fc['query']=_[_0x42ca('0x48')](_0x15f621['query']);_0xffd8fc['filters']=_[_0x42ca('0x34')](_0xffd8fc[_0x42ca('0x32')],_0xffd8fc['query']);_0x2a22cf[_0x42ca('0x33')]=_[_0x42ca('0x34')](_0xffd8fc[_0x42ca('0x32')],qs['fields'](_0x15f621[_0x42ca('0x30')]['fields']));_0x2a22cf[_0x42ca('0x33')]=_0x2a22cf['attributes']['length']?_0x2a22cf[_0x42ca('0x33')]:_0xffd8fc[_0x42ca('0x32')];if(_0x15f621[_0x42ca('0x30')]['includeAll']){_0x2a22cf[_0x42ca('0x43')]=[{'all':!![]}];}_0x2a22cf=_[_0x42ca('0x3d')]({},_0x2a22cf,_0x15f621['options']);return db['ContactItemType'][_0x42ca('0x49')](_0x2a22cf)[_0x42ca('0x26')](handleEntityNotFound(_0x5667f9,null))[_0x42ca('0x26')](respondWithResult(_0x5667f9,null))[_0x42ca('0x45')](handleError(_0x5667f9,null));};exports[_0x42ca('0x4a')]=function(_0x26214f,_0x356401){return db[_0x42ca('0x41')]['create'](_0x26214f[_0x42ca('0x4b')],{})[_0x42ca('0x26')](function(_0x2415ab){var _0x11717c=_0x26214f[_0x42ca('0x4c')][_0x42ca('0x27')]({'plain':!![]});if(!_0x11717c)throw new Error(_0x42ca('0x4d'));if(_0x11717c[_0x42ca('0x4e')]===_0x42ca('0x4c')){var _0x156072=_0x2415ab[_0x42ca('0x27')]({'plain':!![]});var _0xc320d2=_0x42ca('0x28');return db[_0x42ca('0x4f')][_0x42ca('0x49')]({'where':{'name':_0xc320d2,'userProfileId':_0x11717c[_0x42ca('0x50')]},'raw':!![]})[_0x42ca('0x26')](function(_0x47f661){if(_0x47f661&&_0x47f661[_0x42ca('0x51')]===0x0){return db[_0x42ca('0x52')][_0x42ca('0x4a')]({'name':_0x156072[_0x42ca('0x2b')],'resourceId':_0x156072['id'],'type':_0x47f661['name'],'sectionId':_0x47f661['id']},{})[_0x42ca('0x26')](function(){return _0x2415ab;});}else{return _0x2415ab;}})[_0x42ca('0x45')](function(_0x2f4339){logger[_0x42ca('0x2a')](_0x42ca('0x53'),_0x2f4339);throw _0x2f4339;});}return _0x2415ab;})[_0x42ca('0x26')](respondWithResult(_0x356401,0xc9))[_0x42ca('0x45')](handleError(_0x356401,null));};exports['update']=function(_0x2a9589,_0x25a8bf){if(_0x2a9589[_0x42ca('0x4b')]['id']){delete _0x2a9589[_0x42ca('0x4b')]['id'];}return db[_0x42ca('0x41')]['find']({'where':{'id':_0x2a9589[_0x42ca('0x47')]['id']}})[_0x42ca('0x26')](handleEntityNotFound(_0x25a8bf,null))[_0x42ca('0x26')](saveUpdates(_0x2a9589[_0x42ca('0x4b')],null))['then'](respondWithResult(_0x25a8bf,null))['catch'](handleError(_0x25a8bf,null));};exports[_0x42ca('0x25')]=function(_0x599861,_0x2e54ea){return db[_0x42ca('0x41')][_0x42ca('0x49')]({'where':{'id':_0x599861[_0x42ca('0x47')]['id']}})[_0x42ca('0x26')](handleEntityNotFound(_0x2e54ea,null))['then'](removeEntity(_0x2e54ea,null))[_0x42ca('0x45')](handleError(_0x2e54ea,null));}; \ No newline at end of file +var _0xeb8c=['squel','crypto','jsforce','querystring','papaparse','ioredis','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','ContactItemTypes','error','stack','name','index','map','ContactItemType','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','rawAttributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','moment','mustache','path','to-csv','fs-extra','lodash'];(function(_0x3c2695,_0x10cc93){var _0xadead1=function(_0x3e5bc7){while(--_0x3e5bc7){_0x3c2695['push'](_0x3c2695['shift']());}};_0xadead1(++_0x10cc93);}(_0xeb8c,0x17d));var _0xceb8=function(_0x4b2dc3,_0x27cc98){_0x4b2dc3=_0x4b2dc3-0x0;var _0x532418=_0xeb8c[_0x4b2dc3];return _0x532418;};'use strict';var emlformat=require(_0xceb8('0x0'));var rimraf=require(_0xceb8('0x1'));var zipdir=require(_0xceb8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xceb8('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xceb8('0x4'));var util=require('util');var path=require(_0xceb8('0x5'));var sox=require('sox');var csv=require(_0xceb8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xceb8('0x7'));var _=require(_0xceb8('0x8'));var squel=require(_0xceb8('0x9'));var crypto=require(_0xceb8('0xa'));var jsforce=require(_0xceb8('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xceb8('0x6'));var querystring=require(_0xceb8('0xc'));var Papa=require(_0xceb8('0xd'));var Redis=require(_0xceb8('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xceb8('0xf'));var utils=require(_0xceb8('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0xceb8('0x11'));var db=require(_0xceb8('0x12'))['db'];function respondWithStatusCode(_0x392969,_0x1e9e01){_0x1e9e01=_0x1e9e01||0xcc;return function(_0x2ebedb){if(_0x2ebedb){return _0x392969[_0xceb8('0x13')](_0x1e9e01);}return _0x392969[_0xceb8('0x14')](_0x1e9e01)[_0xceb8('0x15')]();};}function respondWithResult(_0x184913,_0x17d025){_0x17d025=_0x17d025||0xc8;return function(_0x316f0a){if(_0x316f0a){return _0x184913[_0xceb8('0x14')](_0x17d025)[_0xceb8('0x16')](_0x316f0a);}};}function respondWithFilteredResult(_0x164013,_0x14aa47){return function(_0x548937){if(_0x548937){var _0x4e2c93=typeof _0x14aa47[_0xceb8('0x17')]===_0xceb8('0x18')&&typeof _0x14aa47[_0xceb8('0x19')]==='undefined';var _0x5c1f12=_0x548937[_0xceb8('0x1a')];var _0xdb231a=_0x4e2c93?0x0:_0x14aa47[_0xceb8('0x17')];var _0x5dcabe=_0x4e2c93?_0x548937[_0xceb8('0x1a')]:_0x14aa47[_0xceb8('0x17')]+_0x14aa47[_0xceb8('0x19')];var _0x22a822;if(_0x5dcabe>=_0x5c1f12){_0x5dcabe=_0x5c1f12;_0x22a822=0xc8;}else{_0x22a822=0xce;}_0x164013[_0xceb8('0x14')](_0x22a822);return _0x164013[_0xceb8('0x1b')]('Content-Range',_0xdb231a+'-'+_0x5dcabe+'/'+_0x5c1f12)[_0xceb8('0x16')](_0x548937);}return null;};}function patchUpdates(_0x2baba4){return function(_0x4a8cd9){try{jsonpatch[_0xceb8('0x1c')](_0x4a8cd9,_0x2baba4,!![]);}catch(_0x47d3f3){return BPromise[_0xceb8('0x1d')](_0x47d3f3);}return _0x4a8cd9[_0xceb8('0x1e')]();};}function saveUpdates(_0x3a74a0,_0x4fa85f){return function(_0x321b77){if(_0x321b77){return _0x321b77['update'](_0x3a74a0)[_0xceb8('0x1f')](function(_0x1a94d4){return _0x1a94d4;});}return null;};}function removeEntity(_0x3ae8c4,_0x491d62){return function(_0x319a2b){if(_0x319a2b){return _0x319a2b[_0xceb8('0x20')]()[_0xceb8('0x1f')](function(){var _0x40cd79=_0x319a2b['get']({'plain':!![]});var _0xdfac6=_0xceb8('0x21');return db['UserProfileResource'][_0xceb8('0x20')]({'where':{'type':_0xdfac6,'resourceId':_0x40cd79['id']}})[_0xceb8('0x1f')](function(){return _0x319a2b;});})[_0xceb8('0x1f')](function(){_0x3ae8c4[_0xceb8('0x14')](0xcc)[_0xceb8('0x15')]();});}};}function handleEntityNotFound(_0x4ef8c1,_0x4d4664){return function(_0x249d52){if(!_0x249d52){_0x4ef8c1[_0xceb8('0x13')](0x194);}return _0x249d52;};}function handleError(_0x1a236d,_0x4d61ec){_0x4d61ec=_0x4d61ec||0x1f4;return function(_0x5003dc){logger[_0xceb8('0x22')](_0x5003dc[_0xceb8('0x23')]);if(_0x5003dc['name']){delete _0x5003dc[_0xceb8('0x24')];}_0x1a236d['status'](_0x4d61ec)['send'](_0x5003dc);};}exports[_0xceb8('0x25')]=function(_0x53364e,_0x3f5a2b){var _0x42b233={},_0x16e235={},_0xd67077={'count':0x0,'rows':[]};var _0x167071=_[_0xceb8('0x26')](db[_0xceb8('0x27')]['rawAttributes'],function(_0x6135be){return{'name':_0x6135be[_0xceb8('0x28')],'type':_0x6135be[_0xceb8('0x29')][_0xceb8('0x2a')]};});_0x16e235[_0xceb8('0x2b')]=_[_0xceb8('0x26')](_0x167071,'name');_0x16e235[_0xceb8('0x2c')]=_[_0xceb8('0x2d')](_0x53364e[_0xceb8('0x2c')]);_0x16e235['filters']=_[_0xceb8('0x2e')](_0x16e235['model'],_0x16e235[_0xceb8('0x2c')]);_0x42b233[_0xceb8('0x2f')]=_[_0xceb8('0x2e')](_0x16e235[_0xceb8('0x2b')],qs['fields'](_0x53364e[_0xceb8('0x2c')][_0xceb8('0x30')]));_0x42b233[_0xceb8('0x2f')]=_0x42b233[_0xceb8('0x2f')][_0xceb8('0x31')]?_0x42b233['attributes']:_0x16e235[_0xceb8('0x2b')];if(!_0x53364e['query'][_0xceb8('0x32')]('nolimit')){_0x42b233[_0xceb8('0x19')]=qs[_0xceb8('0x19')](_0x53364e[_0xceb8('0x2c')][_0xceb8('0x19')]);_0x42b233[_0xceb8('0x17')]=qs[_0xceb8('0x17')](_0x53364e[_0xceb8('0x2c')][_0xceb8('0x17')]);}_0x42b233[_0xceb8('0x33')]=qs['sort'](_0x53364e[_0xceb8('0x2c')]['sort']);_0x42b233[_0xceb8('0x34')]=qs[_0xceb8('0x35')](_[_0xceb8('0x36')](_0x53364e[_0xceb8('0x2c')],_0x16e235[_0xceb8('0x35')]),_0x167071);if(_0x53364e[_0xceb8('0x2c')][_0xceb8('0x37')]){_0x42b233[_0xceb8('0x34')]=_[_0xceb8('0x38')](_0x42b233[_0xceb8('0x34')],{'$or':_[_0xceb8('0x26')](_0x167071,function(_0x58292b){if(_0x58292b['type']!==_0xceb8('0x39')){var _0x2b4181={};_0x2b4181[_0x58292b[_0xceb8('0x24')]]={'$like':'%'+_0x53364e[_0xceb8('0x2c')][_0xceb8('0x37')]+'%'};return _0x2b4181;}})});}_0x42b233=_[_0xceb8('0x38')]({},_0x42b233,_0x53364e[_0xceb8('0x3a')]);var _0x4ddb81={'where':_0x42b233[_0xceb8('0x34')]};return db['ContactItemType']['count'](_0x4ddb81)[_0xceb8('0x1f')](function(_0x97d376){_0xd67077[_0xceb8('0x1a')]=_0x97d376;if(_0x53364e[_0xceb8('0x2c')][_0xceb8('0x3b')]){_0x42b233[_0xceb8('0x3c')]=[{'all':!![]}];}return db[_0xceb8('0x27')]['findAll'](_0x42b233);})[_0xceb8('0x1f')](function(_0x205daf){_0xd67077['rows']=_0x205daf;return _0xd67077;})[_0xceb8('0x1f')](respondWithFilteredResult(_0x3f5a2b,_0x42b233))[_0xceb8('0x3d')](handleError(_0x3f5a2b,null));};exports[_0xceb8('0x3e')]=function(_0x3329f3,_0xb3cdcd){var _0x1201b5={'raw':!![],'where':{'id':_0x3329f3[_0xceb8('0x3f')]['id']}},_0x2a70d4={};_0x2a70d4['model']=_[_0xceb8('0x2d')](db['ContactItemType'][_0xceb8('0x40')]);_0x2a70d4[_0xceb8('0x2c')]=_[_0xceb8('0x2d')](_0x3329f3[_0xceb8('0x2c')]);_0x2a70d4['filters']=_['intersection'](_0x2a70d4[_0xceb8('0x2b')],_0x2a70d4[_0xceb8('0x2c')]);_0x1201b5[_0xceb8('0x2f')]=_[_0xceb8('0x2e')](_0x2a70d4[_0xceb8('0x2b')],qs[_0xceb8('0x30')](_0x3329f3[_0xceb8('0x2c')]['fields']));_0x1201b5['attributes']=_0x1201b5['attributes']['length']?_0x1201b5[_0xceb8('0x2f')]:_0x2a70d4[_0xceb8('0x2b')];if(_0x3329f3[_0xceb8('0x2c')][_0xceb8('0x3b')]){_0x1201b5[_0xceb8('0x3c')]=[{'all':!![]}];}_0x1201b5=_[_0xceb8('0x38')]({},_0x1201b5,_0x3329f3['options']);return db[_0xceb8('0x27')][_0xceb8('0x41')](_0x1201b5)[_0xceb8('0x1f')](handleEntityNotFound(_0xb3cdcd,null))['then'](respondWithResult(_0xb3cdcd,null))[_0xceb8('0x3d')](handleError(_0xb3cdcd,null));};exports['create']=function(_0x22659f,_0x428ae2){return db[_0xceb8('0x27')][_0xceb8('0x42')](_0x22659f[_0xceb8('0x43')],{})[_0xceb8('0x1f')](function(_0x12dfcf){var _0x1d3ea4=_0x22659f[_0xceb8('0x44')][_0xceb8('0x45')]({'plain':!![]});if(!_0x1d3ea4)throw new Error(_0xceb8('0x46'));if(_0x1d3ea4[_0xceb8('0x47')]===_0xceb8('0x44')){var _0x2dd4a7=_0x12dfcf['get']({'plain':!![]});var _0x9612ae=_0xceb8('0x21');return db[_0xceb8('0x48')]['find']({'where':{'name':_0x9612ae,'userProfileId':_0x1d3ea4[_0xceb8('0x49')]},'raw':!![]})['then'](function(_0x547831){if(_0x547831&&_0x547831[_0xceb8('0x4a')]===0x0){return db[_0xceb8('0x4b')]['create']({'name':_0x2dd4a7[_0xceb8('0x24')],'resourceId':_0x2dd4a7['id'],'type':_0x547831['name'],'sectionId':_0x547831['id']},{})[_0xceb8('0x1f')](function(){return _0x12dfcf;});}else{return _0x12dfcf;}})['catch'](function(_0x4e26dc){logger[_0xceb8('0x22')](_0xceb8('0x4c'),_0x4e26dc);throw _0x4e26dc;});}return _0x12dfcf;})['then'](respondWithResult(_0x428ae2,0xc9))['catch'](handleError(_0x428ae2,null));};exports[_0xceb8('0x4d')]=function(_0x46f0e9,_0x254b3a){if(_0x46f0e9['body']['id']){delete _0x46f0e9[_0xceb8('0x43')]['id'];}return db[_0xceb8('0x27')]['find']({'where':{'id':_0x46f0e9[_0xceb8('0x3f')]['id']}})[_0xceb8('0x1f')](handleEntityNotFound(_0x254b3a,null))[_0xceb8('0x1f')](saveUpdates(_0x46f0e9[_0xceb8('0x43')],null))['then'](respondWithResult(_0x254b3a,null))[_0xceb8('0x3d')](handleError(_0x254b3a,null));};exports['destroy']=function(_0x15a40a,_0x384a95){return db['ContactItemType']['find']({'where':{'id':_0x15a40a[_0xceb8('0x3f')]['id']}})[_0xceb8('0x1f')](handleEntityNotFound(_0x384a95,null))[_0xceb8('0x1f')](removeEntity(_0x384a95,null))['catch'](handleError(_0x384a95,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 3e244de..9a7a104 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 _0x8d3c=['rimraf','../../config/environment','./contactItemType.attributes','exports','define','ContactItemType','tools_contact_item_types','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x15dfef,_0x43b647){var _0x125abf=function(_0x25bccd){while(--_0x25bccd){_0x15dfef['push'](_0x15dfef['shift']());}};_0x125abf(++_0x43b647);}(_0x8d3c,0x19a));var _0xc8d3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8d3c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc8d3('0x0'));var util=require(_0xc8d3('0x1'));var logger=require(_0xc8d3('0x2'))(_0xc8d3('0x3'));var moment=require('moment');var BPromise=require(_0xc8d3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc8d3('0x5'));var rimraf=require(_0xc8d3('0x6'));var config=require(_0xc8d3('0x7'));var attributes=require(_0xc8d3('0x8'));module[_0xc8d3('0x9')]=function(_0x2ddc41,_0x2afafb){return _0x2ddc41[_0xc8d3('0xa')](_0xc8d3('0xb'),attributes,{'tableName':_0xc8d3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa610=['lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','./contactItemType.attributes','exports','define','ContactItemType'];(function(_0x3f583c,_0x549c24){var _0x25576f=function(_0x35fd84){while(--_0x35fd84){_0x3f583c['push'](_0x3f583c['shift']());}};_0x25576f(++_0x549c24);}(_0xa610,0xe7));var _0x0a61=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa610[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0a61('0x0'));var util=require(_0x0a61('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0a61('0x2'));var rp=require(_0x0a61('0x3'));var fs=require('fs');var path=require(_0x0a61('0x4'));var rimraf=require(_0x0a61('0x5'));var config=require(_0x0a61('0x6'));var attributes=require(_0x0a61('0x7'));module[_0x0a61('0x8')]=function(_0x37bd67,_0x2299ae){return _0x37bd67[_0x0a61('0x9')](_0x0a61('0xa'),attributes,{'tableName':'tools_contact_item_types','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 182f371..f2fd2ac 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 _0x6b35=['result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','request','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','code','error','message'];(function(_0x194329,_0x1212d4){var _0x432437=function(_0x22b74e){while(--_0x22b74e){_0x194329['push'](_0x194329['shift']());}};_0x432437(++_0x1212d4);}(_0x6b35,0x6e));var _0x56b3=function(_0x45f47d,_0x3ba268){_0x45f47d=_0x45f47d-0x0;var _0x5a34d4=_0x6b35[_0x45f47d];return _0x5a34d4;};'use strict';var _=require('lodash');var util=require(_0x56b3('0x0'));var moment=require(_0x56b3('0x1'));var BPromise=require(_0x56b3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x56b3('0x3'))['db'];var utils=require(_0x56b3('0x4'));var logger=require(_0x56b3('0x5'))(_0x56b3('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1a33a5,_0x3486b9,_0xabf2d7){return new BPromise(function(_0x1ca183,_0x48a098){return client[_0x56b3('0x7')](_0x1a33a5,_0xabf2d7)[_0x56b3('0x8')](function(_0x3d6f0d){logger[_0x56b3('0x9')](_0x56b3('0xa'),_0x3486b9,_0x56b3('0xb'));logger[_0x56b3('0xc')]('ContactItemType,\x20%s,\x20%s,\x20%s',_0x3486b9,'request\x20sent',JSON['stringify'](_0x3d6f0d));if(_0x3d6f0d['error']){if(_0x3d6f0d['error'][_0x56b3('0xd')]===0x1f4){logger[_0x56b3('0xe')](_0x56b3('0xa'),_0x3486b9,_0x3d6f0d[_0x56b3('0xe')][_0x56b3('0xf')]);return _0x48a098(_0x3d6f0d[_0x56b3('0xe')][_0x56b3('0xf')]);}logger[_0x56b3('0xe')](_0x56b3('0xa'),_0x3486b9,_0x3d6f0d[_0x56b3('0xe')][_0x56b3('0xf')]);return _0x1ca183(_0x3d6f0d[_0x56b3('0xe')][_0x56b3('0xf')]);}else{logger[_0x56b3('0x9')]('ContactItemType,\x20%s,\x20%s',_0x3486b9,_0x56b3('0xb'));_0x1ca183(_0x3d6f0d[_0x56b3('0x10')][_0x56b3('0xf')]);}})[_0x56b3('0x11')](function(_0x3ab6cc){logger[_0x56b3('0xe')](_0x56b3('0xa'),_0x3486b9,_0x3ab6cc);_0x48a098(_0x3ab6cc);});});} \ No newline at end of file +var _0xda3f=['../../config/environment','jayson/promise','client','request','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/logger'];(function(_0x20379f,_0x1570fa){var _0x4943f1=function(_0x35aa73){while(--_0x35aa73){_0x20379f['push'](_0x20379f['shift']());}};_0x4943f1(++_0x1570fa);}(_0xda3f,0x18b));var _0xfda3=function(_0x502cdd,_0x2e01a2){_0x502cdd=_0x502cdd-0x0;var _0x317b31=_0xda3f[_0x502cdd];return _0x317b31;};'use strict';var _=require(_0xfda3('0x0'));var util=require(_0xfda3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfda3('0x2'));var fs=require('fs');var Redis=require(_0xfda3('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x4'))('rpc');var config=require(_0xfda3('0x5'));var jayson=require(_0xfda3('0x6'));var client=jayson[_0xfda3('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40fdfb,_0x4c7a02,_0x1cb666){return new BPromise(function(_0x26594a,_0xa0e84){return client[_0xfda3('0x8')](_0x40fdfb,_0x1cb666)['then'](function(_0x23fac8){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x4c7a02,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x4c7a02,_0xfda3('0xb'),JSON[_0xfda3('0xe')](_0x23fac8));if(_0x23fac8[_0xfda3('0xf')]){if(_0x23fac8[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x4c7a02,_0x23fac8[_0xfda3('0xf')][_0xfda3('0x11')]);return _0xa0e84(_0x23fac8[_0xfda3('0xf')][_0xfda3('0x11')]);}logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x4c7a02,_0x23fac8['error'][_0xfda3('0x11')]);return _0x26594a(_0x23fac8[_0xfda3('0xf')][_0xfda3('0x11')]);}else{logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x4c7a02,_0xfda3('0xb'));_0x26594a(_0x23fac8[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0xa0d28a){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x4c7a02,_0xa0d28a);_0xa0e84(_0xa0d28a);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 0de0a26..5182dcc 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 _0x36c8=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','index','/:id','show','post','create','put','isAuthenticated','update','delete'];(function(_0x5afbc2,_0x29aab5){var _0xe98381=function(_0x33038f){while(--_0x33038f){_0x5afbc2['push'](_0x5afbc2['shift']());}};_0xe98381(++_0x29aab5);}(_0x36c8,0x75));var _0x836c=function(_0x5416c2,_0x5d3ab2){_0x5416c2=_0x5416c2-0x0;var _0x1e0002=_0x36c8[_0x5416c2];return _0x1e0002;};'use strict';var multer=require(_0x836c('0x0'));var util=require(_0x836c('0x1'));var path=require(_0x836c('0x2'));var timeout=require(_0x836c('0x3'));var express=require(_0x836c('0x4'));var router=express[_0x836c('0x5')]();var fs_extra=require(_0x836c('0x6'));var auth=require(_0x836c('0x7'));var interaction=require(_0x836c('0x8'));var config=require(_0x836c('0x9'));var controller=require(_0x836c('0xa'));router[_0x836c('0xb')]('/',auth['isAuthenticated'](),controller[_0x836c('0xc')]);router[_0x836c('0xb')](_0x836c('0xd'),auth['isAuthenticated'](),controller[_0x836c('0xe')]);router[_0x836c('0xf')]('/',auth['isAuthenticated'](),controller[_0x836c('0x10')]);router[_0x836c('0x11')](_0x836c('0xd'),auth[_0x836c('0x12')](),controller[_0x836c('0x13')]);router[_0x836c('0x14')](_0x836c('0xd'),auth['isAuthenticated'](),controller[_0x836c('0x15')]);module[_0x836c('0x16')]=router; \ No newline at end of file +var _0x6f94=['../../config/environment','./contactItemType.controller','get','isAuthenticated','show','create','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0xb1383f,_0x4aac4a){var _0x207abd=function(_0xb1d1f8){while(--_0xb1d1f8){_0xb1383f['push'](_0xb1383f['shift']());}};_0x207abd(++_0x4aac4a);}(_0x6f94,0xe8));var _0x46f9=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0x6f94[_0x3fba9f];return _0x192cf1;};'use strict';var multer=require(_0x46f9('0x0'));var util=require('util');var path=require(_0x46f9('0x1'));var timeout=require(_0x46f9('0x2'));var express=require(_0x46f9('0x3'));var router=express[_0x46f9('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x46f9('0x5'));var config=require(_0x46f9('0x6'));var controller=require(_0x46f9('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x46f9('0x8')]('/:id',auth[_0x46f9('0x9')](),controller[_0x46f9('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x46f9('0xb')]);router['put'](_0x46f9('0xc'),auth['isAuthenticated'](),controller[_0x46f9('0xd')]);router[_0x46f9('0xe')](_0x46f9('0xc'),auth[_0x46f9('0x9')](),controller[_0x46f9('0xf')]);module[_0x46f9('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 c9cfc14..5b84500 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(_0x35007a,_0x58a0d4){var _0x574f68=function(_0xd1c129){while(--_0xd1c129){_0x35007a['push'](_0x35007a['shift']());}};_0x574f68(++_0x58a0d4);}(_0xb7e7,0x121));var _0x7b7e=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0xb7e7[_0x513aa5];return _0x1a1a7c;};'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 _0xbaf0=['name','exports','STRING'];(function(_0x1b92a6,_0x14444b){var _0x24be5b=function(_0x3a5fb5){while(--_0x3a5fb5){_0x1b92a6['push'](_0x1b92a6['shift']());}};_0x24be5b(++_0x14444b);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 08acb02..35c23b5 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 _0x4d60=['fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','./dashboard.socket','register','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','Dashboard','rawAttributes','key','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','filter','merge','type','VIRTUAL','includeAll','include','rows','catch','show','options','find','create','body','user','role','CustomDashboards','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','UserProfileSection','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','sort','pick','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x447919,_0x1a0776){var _0x4cd546=function(_0x2f61b0){while(--_0x2f61b0){_0x447919['push'](_0x447919['shift']());}};_0x4cd546(++_0x1a0776);}(_0x4d60,0x1e3));var _0x04d6=function(_0x233494,_0x498a62){_0x233494=_0x233494-0x0;var _0x4547f9=_0x4d60[_0x233494];return _0x4547f9;};'use strict';var emlformat=require(_0x04d6('0x0'));var rimraf=require(_0x04d6('0x1'));var zipdir=require(_0x04d6('0x2'));var jsonpatch=require(_0x04d6('0x3'));var rp=require(_0x04d6('0x4'));var moment=require(_0x04d6('0x5'));var BPromise=require(_0x04d6('0x6'));var Mustache=require(_0x04d6('0x7'));var util=require(_0x04d6('0x8'));var path=require(_0x04d6('0x9'));var sox=require(_0x04d6('0xa'));var csv=require(_0x04d6('0xb'));var ejs=require(_0x04d6('0xc'));var fs=require('fs');var fs_extra=require(_0x04d6('0xd'));var _=require(_0x04d6('0xe'));var squel=require(_0x04d6('0xf'));var crypto=require('crypto');var jsforce=require(_0x04d6('0x10'));var deskjs=require(_0x04d6('0x11'));var toCsv=require(_0x04d6('0xb'));var querystring=require(_0x04d6('0x12'));var Papa=require(_0x04d6('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x04d6('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x04d6('0x15'));var logger=require(_0x04d6('0x16'))('api');var utils=require(_0x04d6('0x17'));var config=require(_0x04d6('0x18'));var licenseUtil=require(_0x04d6('0x19'));var db=require(_0x04d6('0x1a'))['db'];config[_0x04d6('0x1b')]=_['defaults'](config[_0x04d6('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x04d6('0x1b')]));require(_0x04d6('0x1c'))[_0x04d6('0x1d')](socket);function respondWithStatusCode(_0x4c5269,_0x95337a){_0x95337a=_0x95337a||0xcc;return function(_0x411c65){if(_0x411c65){return _0x4c5269[_0x04d6('0x1e')](_0x95337a);}return _0x4c5269[_0x04d6('0x1f')](_0x95337a)[_0x04d6('0x20')]();};}function respondWithResult(_0x597698,_0x17049b){_0x17049b=_0x17049b||0xc8;return function(_0x2a4868){if(_0x2a4868){return _0x597698[_0x04d6('0x1f')](_0x17049b)[_0x04d6('0x21')](_0x2a4868);}};}function respondWithFilteredResult(_0x5c55bc,_0x2e9866){return function(_0x1384b0){if(_0x1384b0){var _0x214043=typeof _0x2e9866[_0x04d6('0x22')]===_0x04d6('0x23')&&typeof _0x2e9866['limit']===_0x04d6('0x23');var _0x3d1d23=_0x1384b0[_0x04d6('0x24')];var _0x4e71e5=_0x214043?0x0:_0x2e9866['offset'];var _0x14ae63=_0x214043?_0x1384b0[_0x04d6('0x24')]:_0x2e9866[_0x04d6('0x22')]+_0x2e9866['limit'];var _0x4e4575;if(_0x14ae63>=_0x3d1d23){_0x14ae63=_0x3d1d23;_0x4e4575=0xc8;}else{_0x4e4575=0xce;}_0x5c55bc[_0x04d6('0x1f')](_0x4e4575);return _0x5c55bc[_0x04d6('0x25')](_0x04d6('0x26'),_0x4e71e5+'-'+_0x14ae63+'/'+_0x3d1d23)[_0x04d6('0x21')](_0x1384b0);}return null;};}function patchUpdates(_0x4560f1){return function(_0xca6b35){try{jsonpatch[_0x04d6('0x27')](_0xca6b35,_0x4560f1,!![]);}catch(_0x455b9f){return BPromise['reject'](_0x455b9f);}return _0xca6b35[_0x04d6('0x28')]();};}function saveUpdates(_0x2d44ba,_0xe3bfb6){return function(_0x29b842){if(_0x29b842){return _0x29b842[_0x04d6('0x29')](_0x2d44ba)[_0x04d6('0x2a')](function(_0x412aa7){return _0x412aa7;});}return null;};}function removeEntity(_0x11b0ff,_0x53df16){return function(_0x45287b){if(_0x45287b){return _0x45287b[_0x04d6('0x2b')]()[_0x04d6('0x2a')](function(){var _0x2f0392=_0x45287b[_0x04d6('0x2c')]({'plain':!![]});var _0x19fba1='CustomDashboards';return db[_0x04d6('0x2d')][_0x04d6('0x2b')]({'where':{'type':_0x19fba1,'resourceId':_0x2f0392['id']}})[_0x04d6('0x2a')](function(){return _0x45287b;});})[_0x04d6('0x2a')](function(){_0x11b0ff['status'](0xcc)[_0x04d6('0x20')]();});}};}function handleEntityNotFound(_0xe00654,_0x242c44){return function(_0x1a4a9b){if(!_0x1a4a9b){_0xe00654['sendStatus'](0x194);}return _0x1a4a9b;};}function handleError(_0xc0729a,_0x2664be){_0x2664be=_0x2664be||0x1f4;return function(_0xe23b57){logger[_0x04d6('0x2e')](_0xe23b57[_0x04d6('0x2f')]);if(_0xe23b57[_0x04d6('0x30')]){delete _0xe23b57['name'];}_0xc0729a['status'](_0x2664be)[_0x04d6('0x31')](_0xe23b57);};}exports[_0x04d6('0x32')]=function(_0x510889,_0x417c06){var _0x372c9e={},_0x36c966={},_0x54aef1={'count':0x0,'rows':[]};var _0x18038b=_[_0x04d6('0x33')](db[_0x04d6('0x34')][_0x04d6('0x35')],function(_0x5a682f){return{'name':_0x5a682f['fieldName'],'type':_0x5a682f['type'][_0x04d6('0x36')]};});_0x36c966['model']=_[_0x04d6('0x33')](_0x18038b,_0x04d6('0x30'));_0x36c966['query']=_[_0x04d6('0x37')](_0x510889['query']);_0x36c966[_0x04d6('0x38')]=_[_0x04d6('0x39')](_0x36c966[_0x04d6('0x3a')],_0x36c966[_0x04d6('0x3b')]);_0x372c9e[_0x04d6('0x3c')]=_[_0x04d6('0x39')](_0x36c966[_0x04d6('0x3a')],qs[_0x04d6('0x3d')](_0x510889[_0x04d6('0x3b')][_0x04d6('0x3d')]));_0x372c9e[_0x04d6('0x3c')]=_0x372c9e[_0x04d6('0x3c')][_0x04d6('0x3e')]?_0x372c9e[_0x04d6('0x3c')]:_0x36c966[_0x04d6('0x3a')];if(!_0x510889[_0x04d6('0x3b')][_0x04d6('0x3f')](_0x04d6('0x40'))){_0x372c9e['limit']=qs[_0x04d6('0x41')](_0x510889[_0x04d6('0x3b')][_0x04d6('0x41')]);_0x372c9e[_0x04d6('0x22')]=qs['offset'](_0x510889['query'][_0x04d6('0x22')]);}_0x372c9e[_0x04d6('0x42')]=qs['sort'](_0x510889[_0x04d6('0x3b')]['sort']);_0x372c9e[_0x04d6('0x43')]=qs[_0x04d6('0x38')](_['pick'](_0x510889['query'],_0x36c966[_0x04d6('0x38')]),_0x18038b);if(_0x510889['query'][_0x04d6('0x44')]){_0x372c9e[_0x04d6('0x43')]=_[_0x04d6('0x45')](_0x372c9e[_0x04d6('0x43')],{'$or':_[_0x04d6('0x33')](_0x18038b,function(_0x238716){if(_0x238716[_0x04d6('0x46')]!==_0x04d6('0x47')){var _0x223a62={};_0x223a62[_0x238716['name']]={'$like':'%'+_0x510889[_0x04d6('0x3b')]['filter']+'%'};return _0x223a62;}})});}_0x372c9e=_[_0x04d6('0x45')]({},_0x372c9e,_0x510889['options']);var _0x49a8c0={'where':_0x372c9e[_0x04d6('0x43')]};return db[_0x04d6('0x34')][_0x04d6('0x24')](_0x49a8c0)[_0x04d6('0x2a')](function(_0x2ee35a){_0x54aef1['count']=_0x2ee35a;if(_0x510889[_0x04d6('0x3b')][_0x04d6('0x48')]){_0x372c9e[_0x04d6('0x49')]=[{'all':!![]}];}return db[_0x04d6('0x34')]['findAll'](_0x372c9e);})[_0x04d6('0x2a')](function(_0x229d77){_0x54aef1[_0x04d6('0x4a')]=_0x229d77;return _0x54aef1;})[_0x04d6('0x2a')](respondWithFilteredResult(_0x417c06,_0x372c9e))[_0x04d6('0x4b')](handleError(_0x417c06,null));};exports[_0x04d6('0x4c')]=function(_0x3b5d56,_0x3892f8){var _0x409ae6={'raw':![],'where':{'id':_0x3b5d56['params']['id']}},_0x4b08c4={};_0x4b08c4[_0x04d6('0x3a')]=_['keys'](db[_0x04d6('0x34')][_0x04d6('0x35')]);_0x4b08c4[_0x04d6('0x3b')]=_[_0x04d6('0x37')](_0x3b5d56['query']);_0x4b08c4[_0x04d6('0x38')]=_[_0x04d6('0x39')](_0x4b08c4['model'],_0x4b08c4[_0x04d6('0x3b')]);_0x409ae6[_0x04d6('0x3c')]=_[_0x04d6('0x39')](_0x4b08c4['model'],qs[_0x04d6('0x3d')](_0x3b5d56[_0x04d6('0x3b')][_0x04d6('0x3d')]));_0x409ae6[_0x04d6('0x3c')]=_0x409ae6[_0x04d6('0x3c')][_0x04d6('0x3e')]?_0x409ae6['attributes']:_0x4b08c4[_0x04d6('0x3a')];if(_0x3b5d56[_0x04d6('0x3b')]['includeAll']){_0x409ae6[_0x04d6('0x49')]=[{'all':!![]}];}_0x409ae6=_[_0x04d6('0x45')]({},_0x409ae6,_0x3b5d56[_0x04d6('0x4d')]);return db[_0x04d6('0x34')][_0x04d6('0x4e')](_0x409ae6)[_0x04d6('0x2a')](handleEntityNotFound(_0x3892f8,null))[_0x04d6('0x2a')](respondWithResult(_0x3892f8,null))['catch'](handleError(_0x3892f8,null));};exports[_0x04d6('0x4f')]=function(_0x40a71c,_0x223520){return db[_0x04d6('0x34')][_0x04d6('0x4f')](_0x40a71c[_0x04d6('0x50')],{})['then'](function(_0x1a1793){var _0x5d6e8a=_0x40a71c[_0x04d6('0x51')]['get']({'plain':!![]});if(!_0x5d6e8a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5d6e8a[_0x04d6('0x52')]===_0x04d6('0x51')){var _0x255d54=_0x1a1793[_0x04d6('0x2c')]({'plain':!![]});var _0x5304bd=_0x04d6('0x53');return db['UserProfileSection'][_0x04d6('0x4e')]({'where':{'name':_0x5304bd,'userProfileId':_0x5d6e8a[_0x04d6('0x54')]},'raw':!![]})[_0x04d6('0x2a')](function(_0x4b0e58){if(_0x4b0e58&&_0x4b0e58[_0x04d6('0x55')]===0x0){return db[_0x04d6('0x2d')][_0x04d6('0x4f')]({'name':_0x255d54['name'],'resourceId':_0x255d54['id'],'type':_0x4b0e58[_0x04d6('0x30')],'sectionId':_0x4b0e58['id']},{})[_0x04d6('0x2a')](function(){return _0x1a1793;});}else{return _0x1a1793;}})[_0x04d6('0x4b')](function(_0x49acbe){logger[_0x04d6('0x2e')](_0x04d6('0x56'),_0x49acbe);throw _0x49acbe;});}return _0x1a1793;})[_0x04d6('0x2a')](respondWithResult(_0x223520,0xc9))['catch'](handleError(_0x223520,null));};exports[_0x04d6('0x57')]=function(_0x8f8e2e,_0x147af6){var _0x20c8fe={'where':{'id':_0x8f8e2e[_0x04d6('0x58')]['id']}},_0xb90e8b={};_0xb90e8b[_0x04d6('0x3a')]=_['keys'](db[_0x04d6('0x34')][_0x04d6('0x35')]);_0x20c8fe[_0x04d6('0x3c')]=_[_0x04d6('0x39')](_0xb90e8b['model'],qs['fields'](_0x8f8e2e[_0x04d6('0x3b')][_0x04d6('0x3d')]));_0x20c8fe[_0x04d6('0x3c')]=_0x20c8fe[_0x04d6('0x3c')][_0x04d6('0x3e')]?_0x20c8fe['attributes']:_0xb90e8b[_0x04d6('0x3a')];if(_0x8f8e2e[_0x04d6('0x3b')][_0x04d6('0x48')]){_0x20c8fe[_0x04d6('0x49')]=[{'all':!![]}];}_0x20c8fe=_['merge']({},_0x20c8fe,_0x8f8e2e[_0x04d6('0x4d')]);return db[_0x04d6('0x34')][_0x04d6('0x4e')](_0x20c8fe)[_0x04d6('0x2a')](handleEntityNotFound(_0x147af6,null))[_0x04d6('0x2a')](function(_0x3ad90f){if(_0x3ad90f){var _0x2a818f=_0x3ad90f['get']({'plain':!![]});_0x2a818f=qs[_0x04d6('0x59')](_0x2a818f,['id',_0x04d6('0x5a'),_0x04d6('0x5b')]);_0x8f8e2e['body']=_['omit'](_0x8f8e2e[_0x04d6('0x50')],['id',_0x04d6('0x5a'),_0x04d6('0x5b')]);return db['Dashboard'][_0x04d6('0x4f')](_[_0x04d6('0x45')](_0x2a818f,_0x8f8e2e[_0x04d6('0x50')]),{'include':_0x8f8e2e['query'][_0x04d6('0x48')]?[{'all':!![]}]:undefined})['then'](function(_0x543d8d){var _0x5d9234=_0x8f8e2e[_0x04d6('0x51')][_0x04d6('0x2c')]({'plain':!![]});if(!_0x5d9234)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5d9234[_0x04d6('0x52')]===_0x04d6('0x51')){var _0x5ba176=_0x543d8d[_0x04d6('0x2c')]({'plain':!![]});var _0x3dfd44=_0x04d6('0x53');return db[_0x04d6('0x5c')][_0x04d6('0x4e')]({'where':{'name':_0x3dfd44,'userProfileId':_0x5d9234['userProfileId']},'raw':!![]})[_0x04d6('0x2a')](function(_0x568f99){if(_0x568f99&&_0x568f99[_0x04d6('0x55')]===0x0){return db[_0x04d6('0x2d')]['create']({'name':_0x5ba176[_0x04d6('0x30')],'resourceId':_0x5ba176['id'],'type':_0x568f99[_0x04d6('0x30')],'sectionId':_0x568f99['id']},{})[_0x04d6('0x2a')](function(){return _0x543d8d;});}else{return _0x543d8d;}})['catch'](function(_0x1c56f0){logger[_0x04d6('0x2e')](_0x04d6('0x56'),_0x1c56f0);throw _0x1c56f0;});}return _0x543d8d;});}})[_0x04d6('0x2a')](respondWithResult(_0x147af6,0xc9))['catch'](handleError(_0x147af6,null));};exports[_0x04d6('0x29')]=function(_0x2bcca0,_0x1dd762){if(_0x2bcca0[_0x04d6('0x50')]['id']){delete _0x2bcca0[_0x04d6('0x50')]['id'];}return db['Dashboard'][_0x04d6('0x4e')]({'where':{'id':_0x2bcca0['params']['id']}})[_0x04d6('0x2a')](handleEntityNotFound(_0x1dd762,null))[_0x04d6('0x2a')](saveUpdates(_0x2bcca0[_0x04d6('0x50')],null))['then'](respondWithResult(_0x1dd762,null))[_0x04d6('0x4b')](handleError(_0x1dd762,null));};exports[_0x04d6('0x2b')]=function(_0x5a97a3,_0x473360){return db['Dashboard'][_0x04d6('0x4e')]({'where':{'id':_0x5a97a3[_0x04d6('0x58')]['id']}})[_0x04d6('0x2a')](handleEntityNotFound(_0x473360,null))[_0x04d6('0x2a')](removeEntity(_0x473360,null))[_0x04d6('0x4b')](handleError(_0x473360,null));};function widgetAttributes(_0x2d9fab){try{switch(_0x2d9fab[_0x04d6('0x46')]){case _0x04d6('0x5d'):return[{'name':_0x04d6('0x5e'),'value':_0x2d9fab[_0x04d6('0x5e')]||(_0x2d9fab[_0x04d6('0x5f')]&&_0x2d9fab[_0x04d6('0x5f')][0x0]?_0x2d9fab[_0x04d6('0x5f')][0x0][_0x04d6('0x60')]:undefined)||_0x04d6('0x61')}];case'custom':return[{'name':_0x04d6('0x62'),'value':_0x2d9fab['attrPath']||(_0x2d9fab[_0x04d6('0x5f')]&&_0x2d9fab[_0x04d6('0x5f')][0x0]?_0x2d9fab[_0x04d6('0x5f')][0x0]['value']:undefined)||''}];case _0x04d6('0x63'):return[{'name':_0x04d6('0x64'),'value':_0x2d9fab[_0x04d6('0x64')]||(_0x2d9fab[_0x04d6('0x5f')]&&_0x2d9fab[_0x04d6('0x5f')][0x0]?_0x2d9fab[_0x04d6('0x5f')][0x0][_0x04d6('0x60')]:undefined)||'HH:mm:ss'},{'name':_0x04d6('0x65'),'value':_0x2d9fab[_0x04d6('0x65')]||(_0x2d9fab[_0x04d6('0x5f')]&&_0x2d9fab['attrs'][0x1]?_0x2d9fab[_0x04d6('0x5f')][0x1][_0x04d6('0x60')]:undefined)||_0x04d6('0x66')},{'name':_0x04d6('0x67'),'value':_0x2d9fab[_0x04d6('0x67')]||(_0x2d9fab[_0x04d6('0x5f')]&&_0x2d9fab['attrs'][0x2]?_0x2d9fab[_0x04d6('0x5f')][0x2]['value']:undefined)||0xc}];case _0x04d6('0x68'):return[{'name':_0x04d6('0x69'),'value':_0x2d9fab[_0x04d6('0x69')]||(_0x2d9fab[_0x04d6('0x5f')]&&_0x2d9fab[_0x04d6('0x5f')][0x0]?_0x2d9fab[_0x04d6('0x5f')][0x0][_0x04d6('0x60')]:undefined)||'total'},{'name':_0x04d6('0x6a'),'value':_0x2d9fab['attrVoiceQueues']||(_0x2d9fab[_0x04d6('0x5f')]&&_0x2d9fab['attrs'][0x1]?_0x2d9fab['attrs'][0x1][_0x04d6('0x60')]:undefined)||[]},{'name':_0x04d6('0x67'),'value':_0x2d9fab[_0x04d6('0x67')]||(_0x2d9fab['attrs']&&_0x2d9fab['attrs'][0x2]?_0x2d9fab[_0x04d6('0x5f')][0x2][_0x04d6('0x60')]:undefined)||0x14}];case _0x04d6('0x6b'):case _0x04d6('0x6c'):return[{'name':_0x04d6('0x6d'),'value':_0x2d9fab[_0x04d6('0x6d')]||(_0x2d9fab[_0x04d6('0x5f')]&&_0x2d9fab[_0x04d6('0x5f')][0x0]?_0x2d9fab[_0x04d6('0x5f')][0x0][_0x04d6('0x60')]:undefined)||_0x04d6('0x6e')},{'name':_0x04d6('0x6f'),'value':_0x2d9fab[_0x04d6('0x6f')]||(_0x2d9fab[_0x04d6('0x5f')]&&_0x2d9fab[_0x04d6('0x5f')][0x1]?_0x2d9fab[_0x04d6('0x5f')][0x1][_0x04d6('0x60')]:undefined)||null},{'name':_0x04d6('0x70'),'value':_0x2d9fab[_0x04d6('0x70')]||(_0x2d9fab[_0x04d6('0x5f')]&&_0x2d9fab[_0x04d6('0x5f')][0x2]?_0x2d9fab['attrs'][0x2]['value']:undefined)||null},{'name':_0x04d6('0x6a'),'value':_0x2d9fab[_0x04d6('0x6a')]||(_0x2d9fab['attrs']&&_0x2d9fab[_0x04d6('0x5f')][0x3]?_0x2d9fab['attrs'][0x3]['value']:undefined)||[]}];case'web-report':return[{'name':_0x04d6('0x71'),'type':_0x2d9fab[_0x04d6('0x72')]||(_0x2d9fab[_0x04d6('0x5f')]&&_0x2d9fab[_0x04d6('0x5f')][0x0]?_0x2d9fab['attrs'][0x0][_0x04d6('0x46')]:undefined)||null,'value':_0x2d9fab[_0x04d6('0x71')]||(_0x2d9fab[_0x04d6('0x5f')]&&_0x2d9fab[_0x04d6('0x5f')][0x0]?_0x2d9fab[_0x04d6('0x5f')][0x0][_0x04d6('0x60')]:undefined)||null},{'name':'attrRefresh','value':_0x2d9fab[_0x04d6('0x73')]||(_0x2d9fab[_0x04d6('0x5f')]&&_0x2d9fab[_0x04d6('0x5f')][0x1]?_0x2d9fab[_0x04d6('0x5f')][0x1][_0x04d6('0x60')]:undefined)||0x0}];default:return[];}}catch(_0x4ceeef){logger['error']('widgetAttributes:\x20%s',JSON[_0x04d6('0x74')](_0x4ceeef));return[];}}exports[_0x04d6('0x75')]=function(_0x3916f4,_0x3ebc9c,_0x37bf68){if(_0x3916f4[_0x04d6('0x50')]['id']){delete _0x3916f4[_0x04d6('0x50')]['id'];}return db['Dashboard'][_0x04d6('0x4e')]({'where':{'id':_0x3916f4[_0x04d6('0x58')]['id']}})[_0x04d6('0x2a')](handleEntityNotFound(_0x3ebc9c,null))['then'](function(_0x54e4d6){if(_0x54e4d6){_0x3916f4[_0x04d6('0x50')][_0x04d6('0x76')]=_0x54e4d6['id'];_0x3916f4[_0x04d6('0x50')][_0x04d6('0x5f')]=widgetAttributes(_0x3916f4['body']);return db[_0x04d6('0x77')]['create'](_0x3916f4[_0x04d6('0x50')]);}})['then'](respondWithResult(_0x3ebc9c,null))[_0x04d6('0x4b')](handleError(_0x3ebc9c,null));};exports[_0x04d6('0x78')]=function(_0x19edd4,_0x23ffd8,_0x4908bc){var _0x3f637d={};var _0x5920c2={};var _0x1602c5;var _0x343699;return db[_0x04d6('0x34')][_0x04d6('0x79')]({'where':{'id':_0x19edd4[_0x04d6('0x58')]['id']}})['then'](handleEntityNotFound(_0x23ffd8,null))['then'](function(_0xdeeb51){if(_0xdeeb51){_0x1602c5=_0xdeeb51;_0x5920c2[_0x04d6('0x3a')]=_[_0x04d6('0x37')](db[_0x04d6('0x77')][_0x04d6('0x35')]);_0x5920c2[_0x04d6('0x3b')]=_['keys'](_0x19edd4[_0x04d6('0x3b')]);_0x5920c2[_0x04d6('0x38')]=_['intersection'](_0x5920c2['model'],_0x5920c2[_0x04d6('0x3b')]);_0x3f637d[_0x04d6('0x3c')]=_[_0x04d6('0x39')](_0x5920c2[_0x04d6('0x3a')],qs[_0x04d6('0x3d')](_0x19edd4[_0x04d6('0x3b')]['fields']));_0x3f637d[_0x04d6('0x3c')]=_0x3f637d[_0x04d6('0x3c')][_0x04d6('0x3e')]?_0x3f637d[_0x04d6('0x3c')]:_0x5920c2['model'];_0x3f637d[_0x04d6('0x42')]=qs[_0x04d6('0x7a')](_0x19edd4[_0x04d6('0x3b')][_0x04d6('0x7a')]);_0x3f637d['where']=qs[_0x04d6('0x38')](_[_0x04d6('0x7b')](_0x19edd4[_0x04d6('0x3b')],_0x5920c2[_0x04d6('0x38')]));if(_0x19edd4[_0x04d6('0x3b')]['filter']){_0x3f637d[_0x04d6('0x43')]=_[_0x04d6('0x45')](_0x3f637d[_0x04d6('0x43')],{'$or':_[_0x04d6('0x33')](_0x3f637d[_0x04d6('0x3c')],function(_0x4a7fb1){var _0x43fb5a={};_0x43fb5a[_0x4a7fb1]={'$like':'%'+_0x19edd4['query'][_0x04d6('0x44')]+'%'};return _0x43fb5a;})});}_0x3f637d=_[_0x04d6('0x45')]({},_0x3f637d,_0x19edd4[_0x04d6('0x4d')]);return _0x1602c5[_0x04d6('0x78')](_0x3f637d);}})[_0x04d6('0x2a')](function(_0x3617ca){if(_0x3617ca){_0x343699=_0x3617ca[_0x04d6('0x3e')];if(!_0x19edd4[_0x04d6('0x3b')][_0x04d6('0x3f')](_0x04d6('0x40'))){_0x3f637d[_0x04d6('0x41')]=qs[_0x04d6('0x41')](_0x19edd4[_0x04d6('0x3b')]['limit']);_0x3f637d[_0x04d6('0x22')]=qs[_0x04d6('0x22')](_0x19edd4['query']['offset']);}return _0x1602c5[_0x04d6('0x78')](_0x3f637d);}})[_0x04d6('0x2a')](function(_0x3fe7f7){if(_0x3fe7f7){return _0x3fe7f7?{'count':_0x343699,'rows':_0x3fe7f7}:null;}})[_0x04d6('0x2a')](respondWithResult(_0x23ffd8,null))['catch'](handleError(_0x23ffd8,null));}; \ No newline at end of file +var _0xe54d=['filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','fields','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','CustomDashboards','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','length','find','omit','createdAt','updatedAt','body','role','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','findOne','getItems','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./dashboard.socket','register','status','end','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','error','stack','name','index','map','Dashboard','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x389832,_0x10a4a9){var _0x59429e=function(_0x5f3562){while(--_0x5f3562){_0x389832['push'](_0x389832['shift']());}};_0x59429e(++_0x10a4a9);}(_0xe54d,0xbe));var _0xde54=function(_0x52482a,_0x2c80bd){_0x52482a=_0x52482a-0x0;var _0x436c25=_0xe54d[_0x52482a];return _0x436c25;};'use strict';var emlformat=require(_0xde54('0x0'));var rimraf=require(_0xde54('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xde54('0x2'));var rp=require('request-promise');var moment=require(_0xde54('0x3'));var BPromise=require(_0xde54('0x4'));var Mustache=require('mustache');var util=require(_0xde54('0x5'));var path=require(_0xde54('0x6'));var sox=require(_0xde54('0x7'));var csv=require(_0xde54('0x8'));var ejs=require(_0xde54('0x9'));var fs=require('fs');var fs_extra=require(_0xde54('0xa'));var _=require(_0xde54('0xb'));var squel=require(_0xde54('0xc'));var crypto=require(_0xde54('0xd'));var jsforce=require(_0xde54('0xe'));var deskjs=require(_0xde54('0xf'));var toCsv=require(_0xde54('0x8'));var querystring=require('querystring');var Papa=require(_0xde54('0x10'));var Redis=require(_0xde54('0x11'));var authService=require(_0xde54('0x12'));var qs=require(_0xde54('0x13'));var as=require(_0xde54('0x14'));var hardwareService=require(_0xde54('0x15'));var logger=require('../../config/logger')(_0xde54('0x16'));var utils=require(_0xde54('0x17'));var config=require(_0xde54('0x18'));var licenseUtil=require(_0xde54('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xde54('0x1a')](config[_0xde54('0x1b')],{'host':_0xde54('0x1c'),'port':0x18eb});var socket=require(_0xde54('0x1d'))(new Redis(config['redis']));require(_0xde54('0x1e'))[_0xde54('0x1f')](socket);function respondWithStatusCode(_0x5139c2,_0x129b3c){_0x129b3c=_0x129b3c||0xcc;return function(_0x51b569){if(_0x51b569){return _0x5139c2['sendStatus'](_0x129b3c);}return _0x5139c2[_0xde54('0x20')](_0x129b3c)[_0xde54('0x21')]();};}function respondWithResult(_0x46aac8,_0x123593){_0x123593=_0x123593||0xc8;return function(_0x25f0bd){if(_0x25f0bd){return _0x46aac8[_0xde54('0x20')](_0x123593)['json'](_0x25f0bd);}};}function respondWithFilteredResult(_0x14dd1c,_0x364e38){return function(_0x38c68f){if(_0x38c68f){var _0x885f79=typeof _0x364e38[_0xde54('0x22')]==='undefined'&&typeof _0x364e38[_0xde54('0x23')]===_0xde54('0x24');var _0x1c4df9=_0x38c68f[_0xde54('0x25')];var _0x2f7c21=_0x885f79?0x0:_0x364e38[_0xde54('0x22')];var _0x5335e8=_0x885f79?_0x38c68f['count']:_0x364e38[_0xde54('0x22')]+_0x364e38['limit'];var _0x1d674c;if(_0x5335e8>=_0x1c4df9){_0x5335e8=_0x1c4df9;_0x1d674c=0xc8;}else{_0x1d674c=0xce;}_0x14dd1c[_0xde54('0x20')](_0x1d674c);return _0x14dd1c[_0xde54('0x26')](_0xde54('0x27'),_0x2f7c21+'-'+_0x5335e8+'/'+_0x1c4df9)['json'](_0x38c68f);}return null;};}function patchUpdates(_0x19a6bd){return function(_0x36f594){try{jsonpatch[_0xde54('0x28')](_0x36f594,_0x19a6bd,!![]);}catch(_0x4a41b4){return BPromise['reject'](_0x4a41b4);}return _0x36f594[_0xde54('0x29')]();};}function saveUpdates(_0x1af782,_0x1d46db){return function(_0x2fe191){if(_0x2fe191){return _0x2fe191[_0xde54('0x2a')](_0x1af782)[_0xde54('0x2b')](function(_0x38e648){return _0x38e648;});}return null;};}function removeEntity(_0x282460,_0x2a1d6b){return function(_0x3e6e2a){if(_0x3e6e2a){return _0x3e6e2a[_0xde54('0x2c')]()[_0xde54('0x2b')](function(){var _0x356c49=_0x3e6e2a[_0xde54('0x2d')]({'plain':!![]});var _0x51225a='CustomDashboards';return db[_0xde54('0x2e')][_0xde54('0x2c')]({'where':{'type':_0x51225a,'resourceId':_0x356c49['id']}})[_0xde54('0x2b')](function(){return _0x3e6e2a;});})[_0xde54('0x2b')](function(){_0x282460[_0xde54('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46fdbd,_0x4545f8){return function(_0x550001){if(!_0x550001){_0x46fdbd['sendStatus'](0x194);}return _0x550001;};}function handleError(_0x57d1f4,_0x469b1d){_0x469b1d=_0x469b1d||0x1f4;return function(_0x70be46){logger[_0xde54('0x2f')](_0x70be46[_0xde54('0x30')]);if(_0x70be46[_0xde54('0x31')]){delete _0x70be46['name'];}_0x57d1f4[_0xde54('0x20')](_0x469b1d)['send'](_0x70be46);};}exports[_0xde54('0x32')]=function(_0x227763,_0x448d85){var _0x21409e={},_0x726f02={},_0x3c8b26={'count':0x0,'rows':[]};var _0x3fbfac=_[_0xde54('0x33')](db[_0xde54('0x34')][_0xde54('0x35')],function(_0x1d21d4){return{'name':_0x1d21d4[_0xde54('0x36')],'type':_0x1d21d4[_0xde54('0x37')][_0xde54('0x38')]};});_0x726f02[_0xde54('0x39')]=_[_0xde54('0x33')](_0x3fbfac,_0xde54('0x31'));_0x726f02[_0xde54('0x3a')]=_[_0xde54('0x3b')](_0x227763[_0xde54('0x3a')]);_0x726f02[_0xde54('0x3c')]=_[_0xde54('0x3d')](_0x726f02['model'],_0x726f02[_0xde54('0x3a')]);_0x21409e[_0xde54('0x3e')]=_[_0xde54('0x3d')](_0x726f02[_0xde54('0x39')],qs['fields'](_0x227763[_0xde54('0x3a')]['fields']));_0x21409e[_0xde54('0x3e')]=_0x21409e[_0xde54('0x3e')]['length']?_0x21409e[_0xde54('0x3e')]:_0x726f02[_0xde54('0x39')];if(!_0x227763[_0xde54('0x3a')][_0xde54('0x3f')](_0xde54('0x40'))){_0x21409e[_0xde54('0x23')]=qs[_0xde54('0x23')](_0x227763[_0xde54('0x3a')][_0xde54('0x23')]);_0x21409e[_0xde54('0x22')]=qs[_0xde54('0x22')](_0x227763[_0xde54('0x3a')][_0xde54('0x22')]);}_0x21409e[_0xde54('0x41')]=qs['sort'](_0x227763[_0xde54('0x3a')][_0xde54('0x42')]);_0x21409e['where']=qs[_0xde54('0x3c')](_[_0xde54('0x43')](_0x227763[_0xde54('0x3a')],_0x726f02[_0xde54('0x3c')]),_0x3fbfac);if(_0x227763[_0xde54('0x3a')][_0xde54('0x44')]){_0x21409e[_0xde54('0x45')]=_['merge'](_0x21409e['where'],{'$or':_[_0xde54('0x33')](_0x3fbfac,function(_0x3e6e81){if(_0x3e6e81[_0xde54('0x37')]!=='VIRTUAL'){var _0x3de0a6={};_0x3de0a6[_0x3e6e81[_0xde54('0x31')]]={'$like':'%'+_0x227763[_0xde54('0x3a')][_0xde54('0x44')]+'%'};return _0x3de0a6;}})});}_0x21409e=_[_0xde54('0x46')]({},_0x21409e,_0x227763[_0xde54('0x47')]);var _0x125446={'where':_0x21409e[_0xde54('0x45')]};return db[_0xde54('0x34')][_0xde54('0x25')](_0x125446)[_0xde54('0x2b')](function(_0x3a60ba){_0x3c8b26[_0xde54('0x25')]=_0x3a60ba;if(_0x227763[_0xde54('0x3a')][_0xde54('0x48')]){_0x21409e[_0xde54('0x49')]=[{'all':!![]}];}return db[_0xde54('0x34')][_0xde54('0x4a')](_0x21409e);})[_0xde54('0x2b')](function(_0x410c4c){_0x3c8b26[_0xde54('0x4b')]=_0x410c4c;return _0x3c8b26;})[_0xde54('0x2b')](respondWithFilteredResult(_0x448d85,_0x21409e))[_0xde54('0x4c')](handleError(_0x448d85,null));};exports[_0xde54('0x4d')]=function(_0x52155f,_0x489b11){var _0x5885d6={'raw':![],'where':{'id':_0x52155f['params']['id']}},_0x3e4961={};_0x3e4961[_0xde54('0x39')]=_[_0xde54('0x3b')](db[_0xde54('0x34')]['rawAttributes']);_0x3e4961[_0xde54('0x3a')]=_[_0xde54('0x3b')](_0x52155f[_0xde54('0x3a')]);_0x3e4961[_0xde54('0x3c')]=_[_0xde54('0x3d')](_0x3e4961[_0xde54('0x39')],_0x3e4961[_0xde54('0x3a')]);_0x5885d6[_0xde54('0x3e')]=_[_0xde54('0x3d')](_0x3e4961['model'],qs['fields'](_0x52155f[_0xde54('0x3a')][_0xde54('0x4e')]));_0x5885d6[_0xde54('0x3e')]=_0x5885d6[_0xde54('0x3e')]['length']?_0x5885d6[_0xde54('0x3e')]:_0x3e4961[_0xde54('0x39')];if(_0x52155f[_0xde54('0x3a')][_0xde54('0x48')]){_0x5885d6[_0xde54('0x49')]=[{'all':!![]}];}_0x5885d6=_[_0xde54('0x46')]({},_0x5885d6,_0x52155f['options']);return db[_0xde54('0x34')]['find'](_0x5885d6)['then'](handleEntityNotFound(_0x489b11,null))['then'](respondWithResult(_0x489b11,null))[_0xde54('0x4c')](handleError(_0x489b11,null));};exports[_0xde54('0x4f')]=function(_0x1cd03c,_0x515e92){return db[_0xde54('0x34')][_0xde54('0x4f')](_0x1cd03c['body'],{})[_0xde54('0x2b')](function(_0x5717b9){var _0x519807=_0x1cd03c['user'][_0xde54('0x2d')]({'plain':!![]});if(!_0x519807)throw new Error(_0xde54('0x50'));if(_0x519807['role']===_0xde54('0x51')){var _0x58cd3e=_0x5717b9[_0xde54('0x2d')]({'plain':!![]});var _0x419148=_0xde54('0x52');return db[_0xde54('0x53')]['find']({'where':{'name':_0x419148,'userProfileId':_0x519807[_0xde54('0x54')]},'raw':!![]})[_0xde54('0x2b')](function(_0x1445ac){if(_0x1445ac&&_0x1445ac[_0xde54('0x55')]===0x0){return db['UserProfileResource'][_0xde54('0x4f')]({'name':_0x58cd3e[_0xde54('0x31')],'resourceId':_0x58cd3e['id'],'type':_0x1445ac['name'],'sectionId':_0x1445ac['id']},{})[_0xde54('0x2b')](function(){return _0x5717b9;});}else{return _0x5717b9;}})[_0xde54('0x4c')](function(_0x4c2b8a){logger[_0xde54('0x2f')](_0xde54('0x56'),_0x4c2b8a);throw _0x4c2b8a;});}return _0x5717b9;})[_0xde54('0x2b')](respondWithResult(_0x515e92,0xc9))[_0xde54('0x4c')](handleError(_0x515e92,null));};exports[_0xde54('0x57')]=function(_0xfafbbe,_0x2276ee){var _0xb55876={'where':{'id':_0xfafbbe[_0xde54('0x58')]['id']}},_0x2e238f={};_0x2e238f[_0xde54('0x39')]=_[_0xde54('0x3b')](db[_0xde54('0x34')][_0xde54('0x35')]);_0xb55876[_0xde54('0x3e')]=_[_0xde54('0x3d')](_0x2e238f[_0xde54('0x39')],qs['fields'](_0xfafbbe[_0xde54('0x3a')][_0xde54('0x4e')]));_0xb55876['attributes']=_0xb55876[_0xde54('0x3e')][_0xde54('0x59')]?_0xb55876[_0xde54('0x3e')]:_0x2e238f['model'];if(_0xfafbbe[_0xde54('0x3a')][_0xde54('0x48')]){_0xb55876[_0xde54('0x49')]=[{'all':!![]}];}_0xb55876=_[_0xde54('0x46')]({},_0xb55876,_0xfafbbe[_0xde54('0x47')]);return db[_0xde54('0x34')][_0xde54('0x5a')](_0xb55876)[_0xde54('0x2b')](handleEntityNotFound(_0x2276ee,null))[_0xde54('0x2b')](function(_0x59f30d){if(_0x59f30d){var _0x3e51b2=_0x59f30d[_0xde54('0x2d')]({'plain':!![]});_0x3e51b2=qs[_0xde54('0x5b')](_0x3e51b2,['id',_0xde54('0x5c'),_0xde54('0x5d')]);_0xfafbbe[_0xde54('0x5e')]=_[_0xde54('0x5b')](_0xfafbbe['body'],['id',_0xde54('0x5c'),_0xde54('0x5d')]);return db[_0xde54('0x34')][_0xde54('0x4f')](_['merge'](_0x3e51b2,_0xfafbbe[_0xde54('0x5e')]),{'include':_0xfafbbe[_0xde54('0x3a')][_0xde54('0x48')]?[{'all':!![]}]:undefined})['then'](function(_0x23da0c){var _0x23b9a1=_0xfafbbe[_0xde54('0x51')]['get']({'plain':!![]});if(!_0x23b9a1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23b9a1[_0xde54('0x5f')]===_0xde54('0x51')){var _0xb571ae=_0x23da0c['get']({'plain':!![]});var _0x4c0a93='CustomDashboards';return db['UserProfileSection'][_0xde54('0x5a')]({'where':{'name':_0x4c0a93,'userProfileId':_0x23b9a1[_0xde54('0x54')]},'raw':!![]})[_0xde54('0x2b')](function(_0x1c875a){if(_0x1c875a&&_0x1c875a[_0xde54('0x55')]===0x0){return db[_0xde54('0x2e')][_0xde54('0x4f')]({'name':_0xb571ae[_0xde54('0x31')],'resourceId':_0xb571ae['id'],'type':_0x1c875a['name'],'sectionId':_0x1c875a['id']},{})[_0xde54('0x2b')](function(){return _0x23da0c;});}else{return _0x23da0c;}})['catch'](function(_0x17e7c0){logger[_0xde54('0x2f')](_0xde54('0x56'),_0x17e7c0);throw _0x17e7c0;});}return _0x23da0c;});}})[_0xde54('0x2b')](respondWithResult(_0x2276ee,0xc9))[_0xde54('0x4c')](handleError(_0x2276ee,null));};exports['update']=function(_0xed5f32,_0x2cade3){if(_0xed5f32[_0xde54('0x5e')]['id']){delete _0xed5f32[_0xde54('0x5e')]['id'];}return db[_0xde54('0x34')]['find']({'where':{'id':_0xed5f32[_0xde54('0x58')]['id']}})[_0xde54('0x2b')](handleEntityNotFound(_0x2cade3,null))['then'](saveUpdates(_0xed5f32['body'],null))[_0xde54('0x2b')](respondWithResult(_0x2cade3,null))[_0xde54('0x4c')](handleError(_0x2cade3,null));};exports[_0xde54('0x2c')]=function(_0x4ee5ff,_0x72505d){return db[_0xde54('0x34')]['find']({'where':{'id':_0x4ee5ff['params']['id']}})[_0xde54('0x2b')](handleEntityNotFound(_0x72505d,null))[_0xde54('0x2b')](removeEntity(_0x72505d,null))['catch'](handleError(_0x72505d,null));};function widgetAttributes(_0x33040d){try{switch(_0x33040d[_0xde54('0x37')]){case _0xde54('0x60'):return[{'name':_0xde54('0x61'),'value':_0x33040d['attrUrl']||(_0x33040d[_0xde54('0x62')]&&_0x33040d[_0xde54('0x62')][0x0]?_0x33040d[_0xde54('0x62')][0x0][_0xde54('0x63')]:undefined)||_0xde54('0x64')}];case'custom':return[{'name':_0xde54('0x65'),'value':_0x33040d[_0xde54('0x65')]||(_0x33040d['attrs']&&_0x33040d[_0xde54('0x62')][0x0]?_0x33040d[_0xde54('0x62')][0x0][_0xde54('0x63')]:undefined)||''}];case _0xde54('0x66'):return[{'name':_0xde54('0x67'),'value':_0x33040d[_0xde54('0x67')]||(_0x33040d[_0xde54('0x62')]&&_0x33040d[_0xde54('0x62')][0x0]?_0x33040d[_0xde54('0x62')][0x0][_0xde54('0x63')]:undefined)||_0xde54('0x68')},{'name':_0xde54('0x69'),'value':_0x33040d[_0xde54('0x69')]||(_0x33040d[_0xde54('0x62')]&&_0x33040d[_0xde54('0x62')][0x1]?_0x33040d[_0xde54('0x62')][0x1][_0xde54('0x63')]:undefined)||_0xde54('0x6a')},{'name':_0xde54('0x6b'),'value':_0x33040d[_0xde54('0x6b')]||(_0x33040d[_0xde54('0x62')]&&_0x33040d[_0xde54('0x62')][0x2]?_0x33040d[_0xde54('0x62')][0x2][_0xde54('0x63')]:undefined)||0xc}];case _0xde54('0x6c'):return[{'name':_0xde54('0x6d'),'value':_0x33040d[_0xde54('0x6d')]||(_0x33040d[_0xde54('0x62')]&&_0x33040d[_0xde54('0x62')][0x0]?_0x33040d[_0xde54('0x62')][0x0][_0xde54('0x63')]:undefined)||_0xde54('0x6e')},{'name':'attrVoiceQueues','value':_0x33040d[_0xde54('0x6f')]||(_0x33040d[_0xde54('0x62')]&&_0x33040d[_0xde54('0x62')][0x1]?_0x33040d[_0xde54('0x62')][0x1][_0xde54('0x63')]:undefined)||[]},{'name':_0xde54('0x6b'),'value':_0x33040d['attrFontSize']||(_0x33040d[_0xde54('0x62')]&&_0x33040d[_0xde54('0x62')][0x2]?_0x33040d[_0xde54('0x62')][0x2][_0xde54('0x63')]:undefined)||0x14}];case'multibar-chart':case _0xde54('0x70'):return[{'name':_0xde54('0x71'),'value':_0x33040d[_0xde54('0x71')]||(_0x33040d[_0xde54('0x62')]&&_0x33040d[_0xde54('0x62')][0x0]?_0x33040d[_0xde54('0x62')][0x0][_0xde54('0x63')]:undefined)||_0xde54('0x6e')},{'name':_0xde54('0x72'),'value':_0x33040d[_0xde54('0x72')]||(_0x33040d[_0xde54('0x62')]&&_0x33040d[_0xde54('0x62')][0x1]?_0x33040d[_0xde54('0x62')][0x1]['value']:undefined)||null},{'name':_0xde54('0x73'),'value':_0x33040d['attrSerie3']||(_0x33040d[_0xde54('0x62')]&&_0x33040d[_0xde54('0x62')][0x2]?_0x33040d[_0xde54('0x62')][0x2][_0xde54('0x63')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x33040d[_0xde54('0x6f')]||(_0x33040d[_0xde54('0x62')]&&_0x33040d['attrs'][0x3]?_0x33040d[_0xde54('0x62')][0x3][_0xde54('0x63')]:undefined)||[]}];case'web-report':return[{'name':_0xde54('0x74'),'type':_0x33040d['reportType']||(_0x33040d[_0xde54('0x62')]&&_0x33040d[_0xde54('0x62')][0x0]?_0x33040d[_0xde54('0x62')][0x0][_0xde54('0x37')]:undefined)||null,'value':_0x33040d[_0xde54('0x74')]||(_0x33040d['attrs']&&_0x33040d[_0xde54('0x62')][0x0]?_0x33040d[_0xde54('0x62')][0x0]['value']:undefined)||null},{'name':_0xde54('0x75'),'value':_0x33040d[_0xde54('0x75')]||(_0x33040d[_0xde54('0x62')]&&_0x33040d[_0xde54('0x62')][0x1]?_0x33040d[_0xde54('0x62')][0x1][_0xde54('0x63')]:undefined)||0x0}];default:return[];}}catch(_0x1da57d){logger['error'](_0xde54('0x76'),JSON[_0xde54('0x77')](_0x1da57d));return[];}}exports[_0xde54('0x78')]=function(_0x39b210,_0xfd2f,_0xa09538){if(_0x39b210[_0xde54('0x5e')]['id']){delete _0x39b210['body']['id'];}return db[_0xde54('0x34')]['find']({'where':{'id':_0x39b210['params']['id']}})[_0xde54('0x2b')](handleEntityNotFound(_0xfd2f,null))['then'](function(_0x1aaad9){if(_0x1aaad9){_0x39b210[_0xde54('0x5e')][_0xde54('0x79')]=_0x1aaad9['id'];_0x39b210['body'][_0xde54('0x62')]=widgetAttributes(_0x39b210[_0xde54('0x5e')]);return db[_0xde54('0x7a')]['create'](_0x39b210[_0xde54('0x5e')]);}})[_0xde54('0x2b')](respondWithResult(_0xfd2f,null))[_0xde54('0x4c')](handleError(_0xfd2f,null));};exports['getItems']=function(_0x588a5c,_0x401a71,_0x47bb96){var _0x3994af={};var _0x44fab7={};var _0x200e1c;var _0x86f0a2;return db[_0xde54('0x34')][_0xde54('0x7b')]({'where':{'id':_0x588a5c['params']['id']}})[_0xde54('0x2b')](handleEntityNotFound(_0x401a71,null))[_0xde54('0x2b')](function(_0x8c4b4c){if(_0x8c4b4c){_0x200e1c=_0x8c4b4c;_0x44fab7[_0xde54('0x39')]=_[_0xde54('0x3b')](db[_0xde54('0x7a')][_0xde54('0x35')]);_0x44fab7[_0xde54('0x3a')]=_[_0xde54('0x3b')](_0x588a5c[_0xde54('0x3a')]);_0x44fab7[_0xde54('0x3c')]=_[_0xde54('0x3d')](_0x44fab7['model'],_0x44fab7[_0xde54('0x3a')]);_0x3994af[_0xde54('0x3e')]=_['intersection'](_0x44fab7[_0xde54('0x39')],qs[_0xde54('0x4e')](_0x588a5c[_0xde54('0x3a')][_0xde54('0x4e')]));_0x3994af[_0xde54('0x3e')]=_0x3994af[_0xde54('0x3e')][_0xde54('0x59')]?_0x3994af['attributes']:_0x44fab7[_0xde54('0x39')];_0x3994af[_0xde54('0x41')]=qs[_0xde54('0x42')](_0x588a5c[_0xde54('0x3a')][_0xde54('0x42')]);_0x3994af[_0xde54('0x45')]=qs['filters'](_[_0xde54('0x43')](_0x588a5c[_0xde54('0x3a')],_0x44fab7[_0xde54('0x3c')]));if(_0x588a5c[_0xde54('0x3a')][_0xde54('0x44')]){_0x3994af[_0xde54('0x45')]=_['merge'](_0x3994af[_0xde54('0x45')],{'$or':_[_0xde54('0x33')](_0x3994af[_0xde54('0x3e')],function(_0x283764){var _0x463e36={};_0x463e36[_0x283764]={'$like':'%'+_0x588a5c[_0xde54('0x3a')]['filter']+'%'};return _0x463e36;})});}_0x3994af=_[_0xde54('0x46')]({},_0x3994af,_0x588a5c['options']);return _0x200e1c[_0xde54('0x7c')](_0x3994af);}})[_0xde54('0x2b')](function(_0x2421e2){if(_0x2421e2){_0x86f0a2=_0x2421e2['length'];if(!_0x588a5c[_0xde54('0x3a')][_0xde54('0x3f')]('nolimit')){_0x3994af[_0xde54('0x23')]=qs[_0xde54('0x23')](_0x588a5c[_0xde54('0x3a')]['limit']);_0x3994af['offset']=qs[_0xde54('0x22')](_0x588a5c['query'][_0xde54('0x22')]);}return _0x200e1c['getItems'](_0x3994af);}})[_0xde54('0x2b')](function(_0x10f22f){if(_0x10f22f){return _0x10f22f?{'count':_0x86f0a2,'rows':_0x10f22f}:null;}})['then'](respondWithResult(_0x401a71,null))[_0xde54('0x4c')](handleError(_0x401a71,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 678cfc7..3731b12 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 _0x9e0c=['update','remove','emit','hook','events','../../mysqldb','setMaxListeners','save'];(function(_0x529a26,_0x149b7e){var _0x5eec66=function(_0x5a3f0f){while(--_0x5a3f0f){_0x529a26['push'](_0x529a26['shift']());}};_0x5eec66(++_0x149b7e);}(_0x9e0c,0x194));var _0xc9e0=function(_0x24fc34,_0x1c1e06){_0x24fc34=_0x24fc34-0x0;var _0x2fc6b5=_0x9e0c[_0x24fc34];return _0x2fc6b5;};'use strict';var EventEmitter=require(_0xc9e0('0x0'));var Dashboard=require(_0xc9e0('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0xc9e0('0x2')](0x0);var events={'afterCreate':_0xc9e0('0x3'),'afterUpdate':_0xc9e0('0x4'),'afterDestroy':_0xc9e0('0x5')};function emitEvent(_0x58c9b8){return function(_0xd59665,_0x4c1d12,_0x1e6bc1){DashboardEvents[_0xc9e0('0x6')](_0x58c9b8+':'+_0xd59665['id'],_0xd59665);DashboardEvents[_0xc9e0('0x6')](_0x58c9b8,_0xd59665);_0x1e6bc1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0xc9e0('0x7')](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file +var _0x7c74=['events','../../mysqldb','Dashboard','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x4c239c,_0x1ed9c6){var _0x3719a9=function(_0x55f072){while(--_0x55f072){_0x4c239c['push'](_0x4c239c['shift']());}};_0x3719a9(++_0x1ed9c6);}(_0x7c74,0x79));var _0x47c7=function(_0x35f7f5,_0x4e2ee1){_0x35f7f5=_0x35f7f5-0x0;var _0x5567a4=_0x7c74[_0x35f7f5];return _0x5567a4;};'use strict';var EventEmitter=require(_0x47c7('0x0'));var Dashboard=require(_0x47c7('0x1'))['db'][_0x47c7('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x47c7('0x3')](0x0);var events={'afterCreate':_0x47c7('0x4'),'afterUpdate':_0x47c7('0x5'),'afterDestroy':_0x47c7('0x6')};function emitEvent(_0x3d048d){return function(_0x3e1376,_0x68be71,_0x37b7f4){DashboardEvents[_0x47c7('0x7')](_0x3d048d+':'+_0x3e1376['id'],_0x3e1376);DashboardEvents[_0x47c7('0x7')](_0x3d048d,_0x3e1376);_0x37b7f4(null);};}for(var e in events){if(events[_0x47c7('0x8')](e)){var event=events[e];Dashboard[_0x47c7('0x9')](e,emitEvent(event));}}module[_0x47c7('0xa')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 4a9079d..cacae07 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 _0x6f83=['path','rimraf','./dashboard.attributes','define','util','api','moment'];(function(_0x209659,_0x424b92){var _0x32670f=function(_0x5a2c6b){while(--_0x5a2c6b){_0x209659['push'](_0x209659['shift']());}};_0x32670f(++_0x424b92);}(_0x6f83,0x154));var _0x36f8=function(_0x3a1ba0,_0x5c6dce){_0x3a1ba0=_0x3a1ba0-0x0;var _0x661e48=_0x6f83[_0x3a1ba0];return _0x661e48;};'use strict';var _=require('lodash');var util=require(_0x36f8('0x0'));var logger=require('../../config/logger')(_0x36f8('0x1'));var moment=require(_0x36f8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x36f8('0x3'));var rimraf=require(_0x36f8('0x4'));var config=require('../../config/environment');var attributes=require(_0x36f8('0x5'));module['exports']=function(_0x517ce6,_0x184f73){return _0x517ce6[_0x36f8('0x6')]('Dashboard',attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa788=['request-promise','rimraf','../../config/environment','define','lodash','util','../../config/logger','api','bluebird'];(function(_0x691112,_0x4b736f){var _0x25fe71=function(_0xbf101e){while(--_0xbf101e){_0x691112['push'](_0x691112['shift']());}};_0x25fe71(++_0x4b736f);}(_0xa788,0x70));var _0x8a78=function(_0x966f43,_0x5d80fb){_0x966f43=_0x966f43-0x0;var _0x16de6a=_0xa788[_0x966f43];return _0x16de6a;};'use strict';var _=require(_0x8a78('0x0'));var util=require(_0x8a78('0x1'));var logger=require(_0x8a78('0x2'))(_0x8a78('0x3'));var moment=require('moment');var BPromise=require(_0x8a78('0x4'));var rp=require(_0x8a78('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8a78('0x6'));var config=require(_0x8a78('0x7'));var attributes=require('./dashboard.attributes');module['exports']=function(_0x506edf,_0x316a62){return _0x506edf[_0x8a78('0x8')]('Dashboard',attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index 9069d59..22f5fa0 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 _0x6ebd=['stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','./dashboard.socket','request','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s'];(function(_0x5cccb4,_0x3f7e91){var _0x4fe1e8=function(_0x29e4ea){while(--_0x29e4ea){_0x5cccb4['push'](_0x5cccb4['shift']());}};_0x4fe1e8(++_0x3f7e91);}(_0x6ebd,0xf6));var _0xd6eb=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x6ebd[_0x29b609];return _0x54c952;};'use strict';var _=require('lodash');var util=require(_0xd6eb('0x0'));var moment=require(_0xd6eb('0x1'));var BPromise=require('bluebird');var rs=require(_0xd6eb('0x2'));var fs=require('fs');var Redis=require(_0xd6eb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd6eb('0x4'));var logger=require(_0xd6eb('0x5'))(_0xd6eb('0x6'));var config=require(_0xd6eb('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd6eb('0x8')][_0xd6eb('0x9')]({'port':0x232a});config[_0xd6eb('0xa')]=_[_0xd6eb('0xb')](config[_0xd6eb('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd6eb('0xc'))['register'](socket);function respondWithRpcPromise(_0x59c620,_0x41cc26,_0x1c8d1d){return new BPromise(function(_0x59cffd,_0x134ba2){return client[_0xd6eb('0xd')](_0x59c620,_0x1c8d1d)['then'](function(_0x4b736f){logger['info'](_0xd6eb('0xe'),_0x41cc26,_0xd6eb('0xf'));logger[_0xd6eb('0x10')](_0xd6eb('0x11'),_0x41cc26,'request\x20sent',JSON[_0xd6eb('0x12')](_0x4b736f));if(_0x4b736f[_0xd6eb('0x13')]){if(_0x4b736f[_0xd6eb('0x13')][_0xd6eb('0x14')]===0x1f4){logger[_0xd6eb('0x13')]('Dashboard,\x20%s,\x20%s',_0x41cc26,_0x4b736f['error']['message']);return _0x134ba2(_0x4b736f[_0xd6eb('0x13')][_0xd6eb('0x15')]);}logger[_0xd6eb('0x13')](_0xd6eb('0xe'),_0x41cc26,_0x4b736f['error']['message']);return _0x59cffd(_0x4b736f[_0xd6eb('0x13')][_0xd6eb('0x15')]);}else{logger['info'](_0xd6eb('0xe'),_0x41cc26,_0xd6eb('0xf'));_0x59cffd(_0x4b736f[_0xd6eb('0x16')][_0xd6eb('0x15')]);}})[_0xd6eb('0x17')](function(_0x43d409){logger['error']('Dashboard,\x20%s,\x20%s',_0x41cc26,_0x43d409);_0x134ba2(_0x43d409);});});} \ No newline at end of file +var _0x846b=['http','redis','./dashboard.socket','register','request','then','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4d0cc8,_0x5a03d3){var _0x477af2=function(_0x3ce069){while(--_0x3ce069){_0x4d0cc8['push'](_0x4d0cc8['shift']());}};_0x477af2(++_0x5a03d3);}(_0x846b,0x13a));var _0xb846=function(_0xb39695,_0x14f0d0){_0xb39695=_0xb39695-0x0;var _0x38d9d3=_0x846b[_0xb39695];return _0x38d9d3;};'use strict';var _=require(_0xb846('0x0'));var util=require('util');var moment=require(_0xb846('0x1'));var BPromise=require(_0xb846('0x2'));var rs=require(_0xb846('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb846('0x4'));var logger=require(_0xb846('0x5'))(_0xb846('0x6'));var config=require(_0xb846('0x7'));var jayson=require(_0xb846('0x8'));var client=jayson[_0xb846('0x9')][_0xb846('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xb846('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb846('0xb')]));require(_0xb846('0xc'))[_0xb846('0xd')](socket);function respondWithRpcPromise(_0xc9af7f,_0x19c375,_0x4fab86){return new BPromise(function(_0x5a0518,_0xd4f919){return client[_0xb846('0xe')](_0xc9af7f,_0x4fab86)[_0xb846('0xf')](function(_0x3a7c3e){logger['info'](_0xb846('0x10'),_0x19c375,_0xb846('0x11'));logger[_0xb846('0x12')](_0xb846('0x13'),_0x19c375,_0xb846('0x11'),JSON[_0xb846('0x14')](_0x3a7c3e));if(_0x3a7c3e[_0xb846('0x15')]){if(_0x3a7c3e[_0xb846('0x15')][_0xb846('0x16')]===0x1f4){logger[_0xb846('0x15')](_0xb846('0x10'),_0x19c375,_0x3a7c3e['error'][_0xb846('0x17')]);return _0xd4f919(_0x3a7c3e['error'][_0xb846('0x17')]);}logger[_0xb846('0x15')](_0xb846('0x10'),_0x19c375,_0x3a7c3e[_0xb846('0x15')][_0xb846('0x17')]);return _0x5a0518(_0x3a7c3e[_0xb846('0x15')]['message']);}else{logger[_0xb846('0x18')](_0xb846('0x10'),_0x19c375,_0xb846('0x11'));_0x5a0518(_0x3a7c3e[_0xb846('0x19')]['message']);}})[_0xb846('0x1a')](function(_0x4e3d9d){logger[_0xb846('0x15')](_0xb846('0x10'),_0x19c375,_0x4e3d9d);_0xd4f919(_0x4e3d9d);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index ee7b92e..18d78f7 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 _0xab6a=['remove','update','emit','removeListener','save'];(function(_0x3938f7,_0x3dc3ef){var _0x42bf7d=function(_0x42bee3){while(--_0x42bee3){_0x3938f7['push'](_0x3938f7['shift']());}};_0x42bf7d(++_0x3dc3ef);}(_0xab6a,0x9a));var _0xaab6=function(_0xe01761,_0x80ef7d){_0xe01761=_0xe01761-0x0;var _0x3586f2=_0xab6a[_0xe01761];return _0x3586f2;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0xaab6('0x0'),_0xaab6('0x1'),_0xaab6('0x2')];function createListener(_0x12af95,_0x5a69cd){return function(_0x2e7d0d){_0x5a69cd[_0xaab6('0x3')](_0x12af95,_0x2e7d0d);};}function removeListener(_0x26b4c2,_0x436bc3){return function(){DashboardEvents[_0xaab6('0x4')](_0x26b4c2,_0x436bc3);};}exports['register']=function(_0x33c8bb){for(var _0x1763f7=0x0,_0x486412=events['length'];_0x1763f7<_0x486412;_0x1763f7++){var _0x526acc=events[_0x1763f7];var _0x4253da=createListener('dashboard:'+_0x526acc,_0x33c8bb);DashboardEvents['on'](_0x526acc,_0x4253da);}}; \ No newline at end of file +var _0x690c=['save','update','emit','removeListener','register','length','./dashboard.events'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x690c,0x1f0));var _0xc690=function(_0x3b94eb,_0x5e690d){_0x3b94eb=_0x3b94eb-0x0;var _0x14e15d=_0x690c[_0x3b94eb];return _0x14e15d;};'use strict';var DashboardEvents=require(_0xc690('0x0'));var events=[_0xc690('0x1'),'remove',_0xc690('0x2')];function createListener(_0x93f539,_0x37ba78){return function(_0x3cdcbb){_0x37ba78[_0xc690('0x3')](_0x93f539,_0x3cdcbb);};}function removeListener(_0x3439d5,_0x49284a){return function(){DashboardEvents[_0xc690('0x4')](_0x3439d5,_0x49284a);};}exports[_0xc690('0x5')]=function(_0x2137d3){for(var _0xef8c40=0x0,_0x52f37f=events[_0xc690('0x6')];_0xef8c40<_0x52f37f;_0xef8c40++){var _0x458050=events[_0xef8c40];var _0x44a6b2=createListener('dashboard:'+_0x458050,_0x2137d3);DashboardEvents['on'](_0x458050,_0x44a6b2);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 7515e22..a3a4d02 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 _0xf08e=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','index','get','/:id','show','isAuthenticated','getItems','post','clone','/:id/items','addItem','put','update','destroy'];(function(_0x2ef252,_0x1993fe){var _0x1139ca=function(_0x31f949){while(--_0x31f949){_0x2ef252['push'](_0x2ef252['shift']());}};_0x1139ca(++_0x1993fe);}(_0xf08e,0xb0));var _0xef08=function(_0x23d45e,_0x159a89){_0x23d45e=_0x23d45e-0x0;var _0x2b3511=_0xf08e[_0x23d45e];return _0x2b3511;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xef08('0x0'));var timeout=require(_0xef08('0x1'));var express=require(_0xef08('0x2'));var router=express[_0xef08('0x3')]();var fs_extra=require(_0xef08('0x4'));var auth=require(_0xef08('0x5'));var interaction=require(_0xef08('0x6'));var config=require(_0xef08('0x7'));var controller=require(_0xef08('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xef08('0x9')]);router[_0xef08('0xa')](_0xef08('0xb'),auth['isAuthenticated'](),controller[_0xef08('0xc')]);router['get']('/:id/items',auth[_0xef08('0xd')](),controller[_0xef08('0xe')]);router[_0xef08('0xf')]('/',auth[_0xef08('0xd')](),controller['create']);router['post']('/:id/clone',auth[_0xef08('0xd')](),controller[_0xef08('0x10')]);router['post'](_0xef08('0x11'),auth[_0xef08('0xd')](),controller[_0xef08('0x12')]);router[_0xef08('0x13')](_0xef08('0xb'),auth[_0xef08('0xd')](),controller[_0xef08('0x14')]);router['delete']('/:id',auth[_0xef08('0xd')](),controller[_0xef08('0x15')]);module['exports']=router; \ No newline at end of file +var _0xa85e=['./dashboard.controller','get','isAuthenticated','/:id','show','/:id/items','getItems','create','post','clone','addItem','put','delete','destroy','exports','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4f0425,_0xd224a4){var _0x476622=function(_0x5cbd15){while(--_0x5cbd15){_0x4f0425['push'](_0x4f0425['shift']());}};_0x476622(++_0xd224a4);}(_0xa85e,0x1c8));var _0xea85=function(_0x214266,_0x1f6f52){_0x214266=_0x214266-0x0;var _0x568f75=_0xa85e[_0x214266];return _0x568f75;};'use strict';var multer=require('multer');var util=require(_0xea85('0x0'));var path=require(_0xea85('0x1'));var timeout=require(_0xea85('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xea85('0x3'));var interaction=require(_0xea85('0x4'));var config=require(_0xea85('0x5'));var controller=require(_0xea85('0x6'));router[_0xea85('0x7')]('/',auth[_0xea85('0x8')](),controller['index']);router[_0xea85('0x7')](_0xea85('0x9'),auth[_0xea85('0x8')](),controller[_0xea85('0xa')]);router[_0xea85('0x7')](_0xea85('0xb'),auth[_0xea85('0x8')](),controller[_0xea85('0xc')]);router['post']('/',auth[_0xea85('0x8')](),controller[_0xea85('0xd')]);router[_0xea85('0xe')]('/:id/clone',auth[_0xea85('0x8')](),controller[_0xea85('0xf')]);router[_0xea85('0xe')](_0xea85('0xb'),auth[_0xea85('0x8')](),controller[_0xea85('0x10')]);router[_0xea85('0x11')](_0xea85('0x9'),auth['isAuthenticated'](),controller['update']);router[_0xea85('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xea85('0x13')]);module[_0xea85('0x14')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 7151bd3..10447ce 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 _0xafc4=['TEXT','long','setDataValue','attrs','stringify','INTEGER','sequelize','lodash','STRING'];(function(_0x275af3,_0x58c7c5){var _0x12846e=function(_0x28231a){while(--_0x28231a){_0x275af3['push'](_0x275af3['shift']());}};_0x12846e(++_0x58c7c5);}(_0xafc4,0x69));var _0x4afc=function(_0x1a9a12,_0x528eed){_0x1a9a12=_0x1a9a12-0x0;var _0xfe41d7=_0xafc4[_0x1a9a12];return _0xfe41d7;};'use strict';var Sequelize=require(_0x4afc('0x0'));var squel=require('squel');var _=require(_0x4afc('0x1'));module['exports']={'title':{'type':Sequelize[_0x4afc('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x4afc('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x4afc('0x3')](_0x4afc('0x4')),'get':function(){try{return JSON['parse'](this['getDataValue']('attrs'));}catch(_0x36cb50){return[];}},'set':function(_0x471d45){try{this[_0x4afc('0x5')](_0x4afc('0x6'),JSON[_0x4afc('0x7')](_0x471d45));}catch(_0xaf053d){this['setDataValue'](_0x4afc('0x6'),JSON[_0x4afc('0x7')]([]));}}},'sizeX':{'type':Sequelize[_0x4afc('0x8')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x4afc('0x8')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x4afc('0x8')]},'col':{'type':Sequelize[_0x4afc('0x8')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x4afc('0x2')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x4afc('0x2')]},'titleFontSize':{'type':Sequelize[_0x4afc('0x8')],'defaultValue':0xc}}; \ No newline at end of file +var _0x1967=['parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#2196f3','squel','lodash','exports','STRING','TEXT','long'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0x1967,0x173));var _0x7196=function(_0x3c3e4f,_0x12bcff){_0x3c3e4f=_0x3c3e4f-0x0;var _0x3a2ce0=_0x1967[_0x3c3e4f];return _0x3a2ce0;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x7196('0x0'));var _=require(_0x7196('0x1'));module[_0x7196('0x2')]={'title':{'type':Sequelize[_0x7196('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x7196('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x7196('0x4')](_0x7196('0x5')),'get':function(){try{return JSON[_0x7196('0x6')](this[_0x7196('0x7')](_0x7196('0x8')));}catch(_0x5c128f){return[];}},'set':function(_0x36b01e){try{this[_0x7196('0x9')](_0x7196('0x8'),JSON[_0x7196('0xa')](_0x36b01e));}catch(_0x266a6e){this[_0x7196('0x9')]('attrs',JSON[_0x7196('0xa')]([]));}}},'sizeX':{'type':Sequelize[_0x7196('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x7196('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x7196('0xb')]},'col':{'type':Sequelize[_0x7196('0xb')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x7196('0x3')],'allowNull':![],'defaultValue':_0x7196('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x7196('0x3')]},'titleFontSize':{'type':Sequelize[_0x7196('0xb')],'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 6dc29d1..4c4d9bb 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 _0x5632=['options','catch','find','type','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','error','stack','name','send','params','model','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','fields','length','include','merge'];(function(_0x1dae94,_0x239003){var _0x36ce2d=function(_0x295f18){while(--_0x295f18){_0x1dae94['push'](_0x1dae94['shift']());}};_0x36ce2d(++_0x239003);}(_0x5632,0xd4));var _0x2563=function(_0x447ade,_0xa0711f){_0x447ade=_0x447ade-0x0;var _0x1e0617=_0x5632[_0x447ade];return _0x1e0617;};'use strict';var emlformat=require(_0x2563('0x0'));var rimraf=require(_0x2563('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2563('0x2'));var rp=require(_0x2563('0x3'));var moment=require(_0x2563('0x4'));var BPromise=require(_0x2563('0x5'));var Mustache=require(_0x2563('0x6'));var util=require(_0x2563('0x7'));var path=require(_0x2563('0x8'));var sox=require(_0x2563('0x9'));var csv=require(_0x2563('0xa'));var ejs=require(_0x2563('0xb'));var fs=require('fs');var fs_extra=require(_0x2563('0xc'));var _=require(_0x2563('0xd'));var squel=require(_0x2563('0xe'));var crypto=require(_0x2563('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x2563('0x10'));var toCsv=require(_0x2563('0xa'));var querystring=require(_0x2563('0x11'));var Papa=require(_0x2563('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2563('0x13'));var as=require(_0x2563('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2563('0x15'));var utils=require(_0x2563('0x16'));var config=require(_0x2563('0x17'));var licenseUtil=require(_0x2563('0x18'));var db=require(_0x2563('0x19'))['db'];config[_0x2563('0x1a')]=_[_0x2563('0x1b')](config[_0x2563('0x1a')],{'host':_0x2563('0x1c'),'port':0x18eb});var socket=require(_0x2563('0x1d'))(new Redis(config[_0x2563('0x1a')]));require(_0x2563('0x1e'))[_0x2563('0x1f')](socket);function respondWithStatusCode(_0x25a4f3,_0x29fbfd){_0x29fbfd=_0x29fbfd||0xcc;return function(_0x2af310){if(_0x2af310){return _0x25a4f3[_0x2563('0x20')](_0x29fbfd);}return _0x25a4f3[_0x2563('0x21')](_0x29fbfd)[_0x2563('0x22')]();};}function respondWithResult(_0x3f1bf8,_0x3f6ff9){_0x3f6ff9=_0x3f6ff9||0xc8;return function(_0x43d079){if(_0x43d079){return _0x3f1bf8[_0x2563('0x21')](_0x3f6ff9)[_0x2563('0x23')](_0x43d079);}};}function respondWithFilteredResult(_0x62f947,_0x31e52b){return function(_0x8ca677){if(_0x8ca677){var _0xf5631=typeof _0x31e52b[_0x2563('0x24')]===_0x2563('0x25')&&typeof _0x31e52b['limit']==='undefined';var _0xf6e1dc=_0x8ca677[_0x2563('0x26')];var _0x56e51f=_0xf5631?0x0:_0x31e52b[_0x2563('0x24')];var _0x46a59e=_0xf5631?_0x8ca677[_0x2563('0x26')]:_0x31e52b[_0x2563('0x24')]+_0x31e52b[_0x2563('0x27')];var _0x27f254;if(_0x46a59e>=_0xf6e1dc){_0x46a59e=_0xf6e1dc;_0x27f254=0xc8;}else{_0x27f254=0xce;}_0x62f947['status'](_0x27f254);return _0x62f947[_0x2563('0x28')]('Content-Range',_0x56e51f+'-'+_0x46a59e+'/'+_0xf6e1dc)['json'](_0x8ca677);}return null;};}function patchUpdates(_0x2300a3){return function(_0xe12cf9){try{jsonpatch[_0x2563('0x29')](_0xe12cf9,_0x2300a3,!![]);}catch(_0x71c48c){return BPromise[_0x2563('0x2a')](_0x71c48c);}return _0xe12cf9[_0x2563('0x2b')]();};}function saveUpdates(_0x2c6a19,_0x2231dd){return function(_0x1091e7){if(_0x1091e7){return _0x1091e7[_0x2563('0x2c')](_0x2c6a19)[_0x2563('0x2d')](function(_0xca2d75){return _0xca2d75;});}return null;};}function removeEntity(_0x1fdc2e,_0x5b21f0){return function(_0x43adfb){if(_0x43adfb){return _0x43adfb[_0x2563('0x2e')]()[_0x2563('0x2d')](function(){_0x1fdc2e['status'](0xcc)[_0x2563('0x22')]();});}};}function handleEntityNotFound(_0x22f2e7,_0x33acd0){return function(_0x42e5cc){if(!_0x42e5cc){_0x22f2e7[_0x2563('0x20')](0x194);}return _0x42e5cc;};}function handleError(_0x12b076,_0x7e4cbf){_0x7e4cbf=_0x7e4cbf||0x1f4;return function(_0x49e79f){logger[_0x2563('0x2f')](_0x49e79f[_0x2563('0x30')]);if(_0x49e79f[_0x2563('0x31')]){delete _0x49e79f[_0x2563('0x31')];}_0x12b076['status'](_0x7e4cbf)[_0x2563('0x32')](_0x49e79f);};}exports['show']=function(_0x556824,_0x24e050){var _0x440257={'raw':![],'where':{'id':_0x556824[_0x2563('0x33')]['id']}},_0x5c60c2={};_0x5c60c2[_0x2563('0x34')]=_[_0x2563('0x35')](db[_0x2563('0x36')][_0x2563('0x37')]);_0x5c60c2['query']=_['keys'](_0x556824[_0x2563('0x38')]);_0x5c60c2[_0x2563('0x39')]=_[_0x2563('0x3a')](_0x5c60c2[_0x2563('0x34')],_0x5c60c2[_0x2563('0x38')]);_0x440257[_0x2563('0x3b')]=_['intersection'](_0x5c60c2[_0x2563('0x34')],qs[_0x2563('0x3c')](_0x556824['query'][_0x2563('0x3c')]));_0x440257[_0x2563('0x3b')]=_0x440257[_0x2563('0x3b')][_0x2563('0x3d')]?_0x440257['attributes']:_0x5c60c2[_0x2563('0x34')];if(_0x556824[_0x2563('0x38')]['includeAll']){_0x440257[_0x2563('0x3e')]=[{'all':!![]}];}_0x440257=_[_0x2563('0x3f')]({},_0x440257,_0x556824[_0x2563('0x40')]);return db[_0x2563('0x36')]['find'](_0x440257)[_0x2563('0x2d')](handleEntityNotFound(_0x24e050,null))[_0x2563('0x2d')](respondWithResult(_0x24e050,null))[_0x2563('0x41')](handleError(_0x24e050,null));};exports[_0x2563('0x2e')]=function(_0x164fa0,_0x198e66){return db[_0x2563('0x36')][_0x2563('0x42')]({'where':{'id':_0x164fa0[_0x2563('0x33')]['id']}})[_0x2563('0x2d')](handleEntityNotFound(_0x198e66,null))[_0x2563('0x2d')](removeEntity(_0x198e66,null))[_0x2563('0x41')](handleError(_0x198e66,null));};function widgetAttributes(_0x50df28){try{switch(_0x50df28[_0x2563('0x43')]){case _0x2563('0x44'):return[{'name':_0x2563('0x45'),'value':_0x50df28[_0x2563('0x45')]||(_0x50df28[_0x2563('0x46')]&&_0x50df28['attrs'][0x0]?_0x50df28[_0x2563('0x46')][0x0][_0x2563('0x47')]:undefined)||_0x2563('0x48')}];case'custom':return[{'name':_0x2563('0x49'),'value':_0x50df28[_0x2563('0x49')]||(_0x50df28['attrs']&&_0x50df28[_0x2563('0x46')][0x0]?_0x50df28['attrs'][0x0][_0x2563('0x47')]:undefined)||''}];case _0x2563('0x4a'):return[{'name':'attrHourFormat','value':_0x50df28[_0x2563('0x4b')]||(_0x50df28[_0x2563('0x46')]&&_0x50df28[_0x2563('0x46')][0x0]?_0x50df28[_0x2563('0x46')][0x0]['value']:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0x50df28['attrTimezone']||(_0x50df28[_0x2563('0x46')]&&_0x50df28[_0x2563('0x46')][0x1]?_0x50df28[_0x2563('0x46')][0x1][_0x2563('0x47')]:undefined)||_0x2563('0x4c')},{'name':_0x2563('0x4d'),'value':_0x50df28[_0x2563('0x4d')]||(_0x50df28[_0x2563('0x46')]&&_0x50df28[_0x2563('0x46')][0x2]?_0x50df28[_0x2563('0x46')][0x2][_0x2563('0x47')]:undefined)||0xc}];case _0x2563('0x4e'):return[{'name':'attrMetric','value':_0x50df28[_0x2563('0x4f')]||(_0x50df28[_0x2563('0x46')]&&_0x50df28['attrs'][0x0]?_0x50df28[_0x2563('0x46')][0x0][_0x2563('0x47')]:undefined)||_0x2563('0x50')},{'name':_0x2563('0x51'),'value':_0x50df28['attrVoiceQueues']||(_0x50df28['attrs']&&_0x50df28[_0x2563('0x46')][0x1]?_0x50df28['attrs'][0x1][_0x2563('0x47')]:undefined)||[]},{'name':_0x2563('0x4d'),'value':_0x50df28[_0x2563('0x4d')]||(_0x50df28[_0x2563('0x46')]&&_0x50df28[_0x2563('0x46')][0x2]?_0x50df28[_0x2563('0x46')][0x2][_0x2563('0x47')]:undefined)||0x14}];case _0x2563('0x52'):case _0x2563('0x53'):return[{'name':_0x2563('0x54'),'value':_0x50df28[_0x2563('0x54')]||(_0x50df28['attrs']&&_0x50df28['attrs'][0x0]?_0x50df28[_0x2563('0x46')][0x0][_0x2563('0x47')]:undefined)||_0x2563('0x50')},{'name':_0x2563('0x55'),'value':_0x50df28[_0x2563('0x55')]||(_0x50df28['attrs']&&_0x50df28[_0x2563('0x46')][0x1]?_0x50df28[_0x2563('0x46')][0x1][_0x2563('0x47')]:undefined)||null},{'name':_0x2563('0x56'),'value':_0x50df28[_0x2563('0x56')]||(_0x50df28[_0x2563('0x46')]&&_0x50df28[_0x2563('0x46')][0x2]?_0x50df28[_0x2563('0x46')][0x2][_0x2563('0x47')]:undefined)||null},{'name':_0x2563('0x51'),'value':_0x50df28[_0x2563('0x51')]||(_0x50df28[_0x2563('0x46')]&&_0x50df28[_0x2563('0x46')][0x3]?_0x50df28[_0x2563('0x46')][0x3][_0x2563('0x47')]:undefined)||[]}];case _0x2563('0x57'):return[{'name':_0x2563('0x58'),'type':_0x50df28['reportType']||(_0x50df28[_0x2563('0x46')]&&_0x50df28[_0x2563('0x46')][0x0]?_0x50df28['attrs'][0x0][_0x2563('0x43')]:undefined)||null,'value':_0x50df28[_0x2563('0x58')]||(_0x50df28[_0x2563('0x46')]&&_0x50df28[_0x2563('0x46')][0x0]?_0x50df28['attrs'][0x0][_0x2563('0x47')]:undefined)||null},{'name':_0x2563('0x59'),'value':_0x50df28[_0x2563('0x59')]||(_0x50df28[_0x2563('0x46')]&&_0x50df28[_0x2563('0x46')][0x1]?_0x50df28[_0x2563('0x46')][0x1][_0x2563('0x47')]:undefined)||0x0}];default:return[];}}catch(_0x521c08){logger['error'](_0x2563('0x5a'),JSON['stringify'](_0x521c08));return[];}}exports['create']=function(_0x40f54c,_0x5c9b25){if(_0x40f54c[_0x2563('0x5b')]){_0x40f54c[_0x2563('0x5b')][_0x2563('0x46')]=widgetAttributes(_0x40f54c[_0x2563('0x5b')]);}return db[_0x2563('0x36')]['create'](_0x40f54c['body'],{})[_0x2563('0x2d')](respondWithResult(_0x5c9b25,0xc9))[_0x2563('0x41')](handleError(_0x5c9b25,null));};exports[_0x2563('0x2c')]=function(_0x12c241,_0x326b81){if(_0x12c241[_0x2563('0x5b')]['id']){delete _0x12c241['body']['id'];}_0x12c241['body'][_0x2563('0x46')]=widgetAttributes(_0x12c241[_0x2563('0x5b')]);return db[_0x2563('0x36')][_0x2563('0x42')]({'where':{'id':_0x12c241['params']['id']}})[_0x2563('0x2d')](handleEntityNotFound(_0x326b81,null))['then'](saveUpdates(_0x12c241[_0x2563('0x5b')],null))[_0x2563('0x2d')](respondWithResult(_0x326b81,null))['catch'](handleError(_0x326b81,null));}; \ No newline at end of file +var _0xf6ec=['attrs','https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','find','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./dashboardItem.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','error','stack','name','send','show','params','model','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','catch','iframe','attrUrl'];(function(_0x1fcc72,_0x191471){var _0x77731c=function(_0x36c407){while(--_0x36c407){_0x1fcc72['push'](_0x1fcc72['shift']());}};_0x77731c(++_0x191471);}(_0xf6ec,0x198));var _0xcf6e=function(_0x1a51ca,_0x37793c){_0x1a51ca=_0x1a51ca-0x0;var _0x4795a5=_0xf6ec[_0x1a51ca];return _0x4795a5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcf6e('0x0'));var zipdir=require(_0xcf6e('0x1'));var jsonpatch=require(_0xcf6e('0x2'));var rp=require('request-promise');var moment=require(_0xcf6e('0x3'));var BPromise=require(_0xcf6e('0x4'));var Mustache=require(_0xcf6e('0x5'));var util=require(_0xcf6e('0x6'));var path=require(_0xcf6e('0x7'));var sox=require(_0xcf6e('0x8'));var csv=require(_0xcf6e('0x9'));var ejs=require(_0xcf6e('0xa'));var fs=require('fs');var fs_extra=require(_0xcf6e('0xb'));var _=require(_0xcf6e('0xc'));var squel=require('squel');var crypto=require(_0xcf6e('0xd'));var jsforce=require(_0xcf6e('0xe'));var deskjs=require(_0xcf6e('0xf'));var toCsv=require('to-csv');var querystring=require(_0xcf6e('0x10'));var Papa=require(_0xcf6e('0x11'));var Redis=require('ioredis');var authService=require(_0xcf6e('0x12'));var qs=require(_0xcf6e('0x13'));var as=require(_0xcf6e('0x14'));var hardwareService=require(_0xcf6e('0x15'));var logger=require('../../config/logger')(_0xcf6e('0x16'));var utils=require(_0xcf6e('0x17'));var config=require(_0xcf6e('0x18'));var licenseUtil=require(_0xcf6e('0x19'));var db=require('../../mysqldb')['db'];config[_0xcf6e('0x1a')]=_[_0xcf6e('0x1b')](config[_0xcf6e('0x1a')],{'host':_0xcf6e('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcf6e('0x1a')]));require(_0xcf6e('0x1d'))[_0xcf6e('0x1e')](socket);function respondWithStatusCode(_0x9fa48a,_0x4d409b){_0x4d409b=_0x4d409b||0xcc;return function(_0x31a2f4){if(_0x31a2f4){return _0x9fa48a[_0xcf6e('0x1f')](_0x4d409b);}return _0x9fa48a[_0xcf6e('0x20')](_0x4d409b)[_0xcf6e('0x21')]();};}function respondWithResult(_0x429ee3,_0x49a5b5){_0x49a5b5=_0x49a5b5||0xc8;return function(_0x6d4a1d){if(_0x6d4a1d){return _0x429ee3[_0xcf6e('0x20')](_0x49a5b5)[_0xcf6e('0x22')](_0x6d4a1d);}};}function respondWithFilteredResult(_0x33f0ad,_0x2bb4a8){return function(_0x3e5a63){if(_0x3e5a63){var _0x25caec=typeof _0x2bb4a8[_0xcf6e('0x23')]===_0xcf6e('0x24')&&typeof _0x2bb4a8[_0xcf6e('0x25')]===_0xcf6e('0x24');var _0x1c02b6=_0x3e5a63[_0xcf6e('0x26')];var _0x3dd4f4=_0x25caec?0x0:_0x2bb4a8[_0xcf6e('0x23')];var _0x38768d=_0x25caec?_0x3e5a63[_0xcf6e('0x26')]:_0x2bb4a8[_0xcf6e('0x23')]+_0x2bb4a8['limit'];var _0xe85766;if(_0x38768d>=_0x1c02b6){_0x38768d=_0x1c02b6;_0xe85766=0xc8;}else{_0xe85766=0xce;}_0x33f0ad[_0xcf6e('0x20')](_0xe85766);return _0x33f0ad[_0xcf6e('0x27')](_0xcf6e('0x28'),_0x3dd4f4+'-'+_0x38768d+'/'+_0x1c02b6)[_0xcf6e('0x22')](_0x3e5a63);}return null;};}function patchUpdates(_0x140218){return function(_0x3e504b){try{jsonpatch[_0xcf6e('0x29')](_0x3e504b,_0x140218,!![]);}catch(_0x2c0b66){return BPromise['reject'](_0x2c0b66);}return _0x3e504b['save']();};}function saveUpdates(_0x220e61,_0x2277a4){return function(_0x1b4b84){if(_0x1b4b84){return _0x1b4b84[_0xcf6e('0x2a')](_0x220e61)[_0xcf6e('0x2b')](function(_0x41c92b){return _0x41c92b;});}return null;};}function removeEntity(_0x24baa5,_0x1cf5a8){return function(_0x348b43){if(_0x348b43){return _0x348b43[_0xcf6e('0x2c')]()[_0xcf6e('0x2b')](function(){_0x24baa5[_0xcf6e('0x20')](0xcc)[_0xcf6e('0x21')]();});}};}function handleEntityNotFound(_0x1f29c7,_0x372489){return function(_0x1d15c3){if(!_0x1d15c3){_0x1f29c7[_0xcf6e('0x1f')](0x194);}return _0x1d15c3;};}function handleError(_0x4909ee,_0x4b3aa5){_0x4b3aa5=_0x4b3aa5||0x1f4;return function(_0x22a597){logger[_0xcf6e('0x2d')](_0x22a597[_0xcf6e('0x2e')]);if(_0x22a597[_0xcf6e('0x2f')]){delete _0x22a597[_0xcf6e('0x2f')];}_0x4909ee[_0xcf6e('0x20')](_0x4b3aa5)[_0xcf6e('0x30')](_0x22a597);};}exports[_0xcf6e('0x31')]=function(_0x1411ba,_0x4f20c5){var _0x25a75d={'raw':![],'where':{'id':_0x1411ba[_0xcf6e('0x32')]['id']}},_0x152b33={};_0x152b33[_0xcf6e('0x33')]=_[_0xcf6e('0x34')](db[_0xcf6e('0x35')][_0xcf6e('0x36')]);_0x152b33['query']=_[_0xcf6e('0x34')](_0x1411ba[_0xcf6e('0x37')]);_0x152b33[_0xcf6e('0x38')]=_[_0xcf6e('0x39')](_0x152b33[_0xcf6e('0x33')],_0x152b33[_0xcf6e('0x37')]);_0x25a75d[_0xcf6e('0x3a')]=_['intersection'](_0x152b33[_0xcf6e('0x33')],qs[_0xcf6e('0x3b')](_0x1411ba[_0xcf6e('0x37')][_0xcf6e('0x3b')]));_0x25a75d[_0xcf6e('0x3a')]=_0x25a75d[_0xcf6e('0x3a')][_0xcf6e('0x3c')]?_0x25a75d[_0xcf6e('0x3a')]:_0x152b33[_0xcf6e('0x33')];if(_0x1411ba[_0xcf6e('0x37')][_0xcf6e('0x3d')]){_0x25a75d[_0xcf6e('0x3e')]=[{'all':!![]}];}_0x25a75d=_[_0xcf6e('0x3f')]({},_0x25a75d,_0x1411ba['options']);return db[_0xcf6e('0x35')]['find'](_0x25a75d)[_0xcf6e('0x2b')](handleEntityNotFound(_0x4f20c5,null))['then'](respondWithResult(_0x4f20c5,null))[_0xcf6e('0x40')](handleError(_0x4f20c5,null));};exports[_0xcf6e('0x2c')]=function(_0x394d33,_0x477ba6){return db[_0xcf6e('0x35')]['find']({'where':{'id':_0x394d33[_0xcf6e('0x32')]['id']}})['then'](handleEntityNotFound(_0x477ba6,null))[_0xcf6e('0x2b')](removeEntity(_0x477ba6,null))['catch'](handleError(_0x477ba6,null));};function widgetAttributes(_0x535323){try{switch(_0x535323['type']){case _0xcf6e('0x41'):return[{'name':_0xcf6e('0x42'),'value':_0x535323[_0xcf6e('0x42')]||(_0x535323[_0xcf6e('0x43')]&&_0x535323[_0xcf6e('0x43')][0x0]?_0x535323[_0xcf6e('0x43')][0x0]['value']:undefined)||_0xcf6e('0x44')}];case _0xcf6e('0x45'):return[{'name':_0xcf6e('0x46'),'value':_0x535323[_0xcf6e('0x46')]||(_0x535323[_0xcf6e('0x43')]&&_0x535323[_0xcf6e('0x43')][0x0]?_0x535323[_0xcf6e('0x43')][0x0][_0xcf6e('0x47')]:undefined)||''}];case _0xcf6e('0x48'):return[{'name':'attrHourFormat','value':_0x535323[_0xcf6e('0x49')]||(_0x535323[_0xcf6e('0x43')]&&_0x535323['attrs'][0x0]?_0x535323['attrs'][0x0][_0xcf6e('0x47')]:undefined)||_0xcf6e('0x4a')},{'name':'attrTimezone','value':_0x535323[_0xcf6e('0x4b')]||(_0x535323[_0xcf6e('0x43')]&&_0x535323[_0xcf6e('0x43')][0x1]?_0x535323[_0xcf6e('0x43')][0x1][_0xcf6e('0x47')]:undefined)||_0xcf6e('0x4c')},{'name':_0xcf6e('0x4d'),'value':_0x535323[_0xcf6e('0x4d')]||(_0x535323['attrs']&&_0x535323[_0xcf6e('0x43')][0x2]?_0x535323[_0xcf6e('0x43')][0x2][_0xcf6e('0x47')]:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x535323[_0xcf6e('0x4e')]||(_0x535323['attrs']&&_0x535323[_0xcf6e('0x43')][0x0]?_0x535323['attrs'][0x0][_0xcf6e('0x47')]:undefined)||'total'},{'name':_0xcf6e('0x4f'),'value':_0x535323[_0xcf6e('0x4f')]||(_0x535323[_0xcf6e('0x43')]&&_0x535323[_0xcf6e('0x43')][0x1]?_0x535323[_0xcf6e('0x43')][0x1][_0xcf6e('0x47')]:undefined)||[]},{'name':_0xcf6e('0x4d'),'value':_0x535323[_0xcf6e('0x4d')]||(_0x535323['attrs']&&_0x535323[_0xcf6e('0x43')][0x2]?_0x535323[_0xcf6e('0x43')][0x2][_0xcf6e('0x47')]:undefined)||0x14}];case _0xcf6e('0x50'):case _0xcf6e('0x51'):return[{'name':_0xcf6e('0x52'),'value':_0x535323[_0xcf6e('0x52')]||(_0x535323[_0xcf6e('0x43')]&&_0x535323[_0xcf6e('0x43')][0x0]?_0x535323[_0xcf6e('0x43')][0x0][_0xcf6e('0x47')]:undefined)||_0xcf6e('0x53')},{'name':_0xcf6e('0x54'),'value':_0x535323[_0xcf6e('0x54')]||(_0x535323[_0xcf6e('0x43')]&&_0x535323[_0xcf6e('0x43')][0x1]?_0x535323[_0xcf6e('0x43')][0x1]['value']:undefined)||null},{'name':_0xcf6e('0x55'),'value':_0x535323['attrSerie3']||(_0x535323[_0xcf6e('0x43')]&&_0x535323[_0xcf6e('0x43')][0x2]?_0x535323[_0xcf6e('0x43')][0x2]['value']:undefined)||null},{'name':_0xcf6e('0x4f'),'value':_0x535323[_0xcf6e('0x4f')]||(_0x535323[_0xcf6e('0x43')]&&_0x535323[_0xcf6e('0x43')][0x3]?_0x535323['attrs'][0x3]['value']:undefined)||[]}];case _0xcf6e('0x56'):return[{'name':_0xcf6e('0x57'),'type':_0x535323[_0xcf6e('0x58')]||(_0x535323[_0xcf6e('0x43')]&&_0x535323[_0xcf6e('0x43')][0x0]?_0x535323[_0xcf6e('0x43')][0x0]['type']:undefined)||null,'value':_0x535323[_0xcf6e('0x57')]||(_0x535323['attrs']&&_0x535323[_0xcf6e('0x43')][0x0]?_0x535323['attrs'][0x0][_0xcf6e('0x47')]:undefined)||null},{'name':'attrRefresh','value':_0x535323[_0xcf6e('0x59')]||(_0x535323[_0xcf6e('0x43')]&&_0x535323[_0xcf6e('0x43')][0x1]?_0x535323[_0xcf6e('0x43')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x2075d7){logger['error'](_0xcf6e('0x5a'),JSON[_0xcf6e('0x5b')](_0x2075d7));return[];}}exports[_0xcf6e('0x5c')]=function(_0x5213d1,_0x186f70){if(_0x5213d1['body']){_0x5213d1['body'][_0xcf6e('0x43')]=widgetAttributes(_0x5213d1[_0xcf6e('0x5d')]);}return db[_0xcf6e('0x35')][_0xcf6e('0x5c')](_0x5213d1[_0xcf6e('0x5d')],{})[_0xcf6e('0x2b')](respondWithResult(_0x186f70,0xc9))['catch'](handleError(_0x186f70,null));};exports[_0xcf6e('0x2a')]=function(_0x33f5d9,_0x2e40e5){if(_0x33f5d9[_0xcf6e('0x5d')]['id']){delete _0x33f5d9[_0xcf6e('0x5d')]['id'];}_0x33f5d9[_0xcf6e('0x5d')]['attrs']=widgetAttributes(_0x33f5d9[_0xcf6e('0x5d')]);return db[_0xcf6e('0x35')][_0xcf6e('0x5e')]({'where':{'id':_0x33f5d9[_0xcf6e('0x32')]['id']}})['then'](handleEntityNotFound(_0x2e40e5,null))['then'](saveUpdates(_0x33f5d9[_0xcf6e('0x5d')],null))['then'](respondWithResult(_0x2e40e5,null))['catch'](handleError(_0x2e40e5,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index c31fcae..c937e9d 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 _0x90c1=['setMaxListeners','save','update','emit','hook','exports','events'];(function(_0x714d60,_0x1ede1f){var _0x25b2f1=function(_0x12b209){while(--_0x12b209){_0x714d60['push'](_0x714d60['shift']());}};_0x25b2f1(++_0x1ede1f);}(_0x90c1,0x109));var _0x190c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x90c1[_0xa464c9];return _0x3d73c4;};'use strict';var EventEmitter=require(_0x190c('0x0'));var DashboardItem=require('../../mysqldb')['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x190c('0x1')](0x0);var events={'afterCreate':_0x190c('0x2'),'afterUpdate':_0x190c('0x3'),'afterDestroy':'remove'};function emitEvent(_0x37e128){return function(_0x337bfe,_0xaf259a,_0x2f47fb){DashboardItemEvents[_0x190c('0x4')](_0x37e128+':'+_0x337bfe['id'],_0x337bfe);DashboardItemEvents[_0x190c('0x4')](_0x37e128,_0x337bfe);_0x2f47fb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x190c('0x5')](e,emitEvent(event));}}module[_0x190c('0x6')]=DashboardItemEvents; \ No newline at end of file +var _0xe02a=['hook','exports','events','update','remove','emit','hasOwnProperty'];(function(_0x3d8c4c,_0x3366e6){var _0x31d3b2=function(_0xfbf1e8){while(--_0xfbf1e8){_0x3d8c4c['push'](_0x3d8c4c['shift']());}};_0x31d3b2(++_0x3366e6);}(_0xe02a,0xa3));var _0xae02=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xe02a[_0x2c91e9];return _0x13f0ff;};'use strict';var EventEmitter=require(_0xae02('0x0'));var DashboardItem=require('../../mysqldb')['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xae02('0x1'),'afterDestroy':_0xae02('0x2')};function emitEvent(_0x2d96ad){return function(_0x329b04,_0x35a6f9,_0x39a104){DashboardItemEvents[_0xae02('0x3')](_0x2d96ad+':'+_0x329b04['id'],_0x329b04);DashboardItemEvents[_0xae02('0x3')](_0x2d96ad,_0x329b04);_0x39a104(null);};}for(var e in events){if(events[_0xae02('0x4')](e)){var event=events[e];DashboardItem[_0xae02('0x5')](e,emitEvent(event));}}module[_0xae02('0x6')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 4962172..f4158db 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 _0xfdc5=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','lodash'];(function(_0x2f67cc,_0x5e41eb){var _0x3adf53=function(_0x7b9a13){while(--_0x7b9a13){_0x2f67cc['push'](_0x2f67cc['shift']());}};_0x3adf53(++_0x5e41eb);}(_0xfdc5,0xa8));var _0x5fdc=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xfdc5[_0x34bf97];return _0x292719;};'use strict';var _=require(_0x5fdc('0x0'));var util=require(_0x5fdc('0x1'));var logger=require(_0x5fdc('0x2'))(_0x5fdc('0x3'));var moment=require(_0x5fdc('0x4'));var BPromise=require(_0x5fdc('0x5'));var rp=require(_0x5fdc('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5fdc('0x7'));var config=require('../../config/environment');var attributes=require(_0x5fdc('0x8'));module[_0x5fdc('0x9')]=function(_0x2aa904,_0x1cc2e8){return _0x2aa904[_0x5fdc('0xa')](_0x5fdc('0xb'),attributes,{'tableName':_0x5fdc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb150=['rimraf','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5a452e,_0x355a90){var _0x2c4c43=function(_0x2d9e3f){while(--_0x2d9e3f){_0x5a452e['push'](_0x5a452e['shift']());}};_0x2c4c43(++_0x355a90);}(_0xb150,0x18e));var _0x0b15=function(_0x1da228,_0x277ebb){_0x1da228=_0x1da228-0x0;var _0x39a007=_0xb150[_0x1da228];return _0x39a007;};'use strict';var _=require(_0x0b15('0x0'));var util=require(_0x0b15('0x1'));var logger=require(_0x0b15('0x2'))(_0x0b15('0x3'));var moment=require(_0x0b15('0x4'));var BPromise=require(_0x0b15('0x5'));var rp=require(_0x0b15('0x6'));var fs=require('fs');var path=require(_0x0b15('0x7'));var rimraf=require(_0x0b15('0x8'));var config=require('../../config/environment');var attributes=require(_0x0b15('0x9'));module[_0x0b15('0xa')]=function(_0x1d9d4c,_0x1dd580){return _0x1d9d4c[_0x0b15('0xb')](_0x0b15('0xc'),attributes,{'tableName':_0x0b15('0xd'),'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 44d10dd..734be3c 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 _0x751a=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','then','info','DashboardItem,\x20%s,\x20%s','debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util'];(function(_0x33f614,_0x5242a8){var _0x564db2=function(_0x16d3e0){while(--_0x16d3e0){_0x33f614['push'](_0x33f614['shift']());}};_0x564db2(++_0x5242a8);}(_0x751a,0xc9));var _0xa751=function(_0x543242,_0xeac9fd){_0x543242=_0x543242-0x0;var _0x4c99b6=_0x751a[_0x543242];return _0x4c99b6;};'use strict';var _=require(_0xa751('0x0'));var util=require(_0xa751('0x1'));var moment=require(_0xa751('0x2'));var BPromise=require(_0xa751('0x3'));var rs=require(_0xa751('0x4'));var fs=require('fs');var Redis=require(_0xa751('0x5'));var db=require(_0xa751('0x6'))['db'];var utils=require(_0xa751('0x7'));var logger=require('../../config/logger')(_0xa751('0x8'));var config=require(_0xa751('0x9'));var jayson=require(_0xa751('0xa'));var client=jayson['client'][_0xa751('0xb')]({'port':0x232a});config['redis']=_[_0xa751('0xc')](config[_0xa751('0xd')],{'host':_0xa751('0xe'),'port':0x18eb});var socket=require(_0xa751('0xf'))(new Redis(config[_0xa751('0xd')]));require(_0xa751('0x10'))[_0xa751('0x11')](socket);function respondWithRpcPromise(_0x3f1ead,_0x1485f0,_0x491e64){return new BPromise(function(_0x1df96a,_0x16a482){return client['request'](_0x3f1ead,_0x491e64)[_0xa751('0x12')](function(_0x5a594b){logger[_0xa751('0x13')](_0xa751('0x14'),_0x1485f0,'request\x20sent');logger[_0xa751('0x15')](_0xa751('0x16'),_0x1485f0,_0xa751('0x17'),JSON[_0xa751('0x18')](_0x5a594b));if(_0x5a594b[_0xa751('0x19')]){if(_0x5a594b[_0xa751('0x19')]['code']===0x1f4){logger[_0xa751('0x19')]('DashboardItem,\x20%s,\x20%s',_0x1485f0,_0x5a594b['error'][_0xa751('0x1a')]);return _0x16a482(_0x5a594b[_0xa751('0x19')][_0xa751('0x1a')]);}logger[_0xa751('0x19')](_0xa751('0x14'),_0x1485f0,_0x5a594b[_0xa751('0x19')][_0xa751('0x1a')]);return _0x1df96a(_0x5a594b[_0xa751('0x19')][_0xa751('0x1a')]);}else{logger[_0xa751('0x13')](_0xa751('0x14'),_0x1485f0,'request\x20sent');_0x1df96a(_0x5a594b[_0xa751('0x1b')][_0xa751('0x1a')]);}})[_0xa751('0x1c')](function(_0x5f2a63){logger[_0xa751('0x19')](_0xa751('0x14'),_0x1485f0,_0x5f2a63);_0x16a482(_0x5f2a63);});});} \ No newline at end of file +var _0x3af5=['register','request','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./dashboardItem.socket'];(function(_0x1d472b,_0x36cea9){var _0xdc7719=function(_0xf1e6a3){while(--_0xf1e6a3){_0x1d472b['push'](_0x1d472b['shift']());}};_0xdc7719(++_0x36cea9);}(_0x3af5,0x12a));var _0x53af=function(_0x4452dc,_0x479149){_0x4452dc=_0x4452dc-0x0;var _0x52b892=_0x3af5[_0x4452dc];return _0x52b892;};'use strict';var _=require(_0x53af('0x0'));var util=require('util');var moment=require(_0x53af('0x1'));var BPromise=require(_0x53af('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x53af('0x3'))['db'];var utils=require(_0x53af('0x4'));var logger=require(_0x53af('0x5'))(_0x53af('0x6'));var config=require(_0x53af('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x53af('0x8')][_0x53af('0x9')]({'port':0x232a});config[_0x53af('0xa')]=_[_0x53af('0xb')](config[_0x53af('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x53af('0xc'))(new Redis(config[_0x53af('0xa')]));require(_0x53af('0xd'))[_0x53af('0xe')](socket);function respondWithRpcPromise(_0x926c2e,_0x468e1a,_0x2078c9){return new BPromise(function(_0x2a56be,_0x3c0ba9){return client[_0x53af('0xf')](_0x926c2e,_0x2078c9)['then'](function(_0x5466ba){logger[_0x53af('0x10')](_0x53af('0x11'),_0x468e1a,_0x53af('0x12'));logger[_0x53af('0x13')](_0x53af('0x14'),_0x468e1a,_0x53af('0x12'),JSON[_0x53af('0x15')](_0x5466ba));if(_0x5466ba[_0x53af('0x16')]){if(_0x5466ba[_0x53af('0x16')]['code']===0x1f4){logger['error'](_0x53af('0x11'),_0x468e1a,_0x5466ba['error']['message']);return _0x3c0ba9(_0x5466ba[_0x53af('0x16')][_0x53af('0x17')]);}logger[_0x53af('0x16')](_0x53af('0x11'),_0x468e1a,_0x5466ba[_0x53af('0x16')][_0x53af('0x17')]);return _0x2a56be(_0x5466ba['error'][_0x53af('0x17')]);}else{logger['info'](_0x53af('0x11'),_0x468e1a,'request\x20sent');_0x2a56be(_0x5466ba[_0x53af('0x18')][_0x53af('0x17')]);}})[_0x53af('0x19')](function(_0x126c2f){logger['error']('DashboardItem,\x20%s,\x20%s',_0x468e1a,_0x126c2f);_0x3c0ba9(_0x126c2f);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index df1ad90..a39a82b 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 _0x53c2=['removeListener','register','dashboardItem:','./dashboardItem.events','remove','emit'];(function(_0x5bb77e,_0x166608){var _0x3f9482=function(_0x1d38b0){while(--_0x1d38b0){_0x5bb77e['push'](_0x5bb77e['shift']());}};_0x3f9482(++_0x166608);}(_0x53c2,0x99));var _0x253c=function(_0x3515bc,_0x26a1ec){_0x3515bc=_0x3515bc-0x0;var _0xeef5f=_0x53c2[_0x3515bc];return _0xeef5f;};'use strict';var DashboardItemEvents=require(_0x253c('0x0'));var events=['save',_0x253c('0x1'),'update'];function createListener(_0xc1b5d8,_0x1b86cf){return function(_0x2952c9){_0x1b86cf[_0x253c('0x2')](_0xc1b5d8,_0x2952c9);};}function removeListener(_0x321556,_0x35a25c){return function(){DashboardItemEvents[_0x253c('0x3')](_0x321556,_0x35a25c);};}exports[_0x253c('0x4')]=function(_0x3e2592){for(var _0x5dfb39=0x0,_0x3dadbf=events['length'];_0x5dfb39<_0x3dadbf;_0x5dfb39++){var _0x3b0308=events[_0x5dfb39];var _0x13d29c=createListener(_0x253c('0x5')+_0x3b0308,_0x3e2592);DashboardItemEvents['on'](_0x3b0308,_0x13d29c);}}; \ No newline at end of file +var _0xc6b8=['register','length','dashboardItem:','save','emit','removeListener'];(function(_0x234504,_0x7f6b52){var _0x60268b=function(_0x490288){while(--_0x490288){_0x234504['push'](_0x234504['shift']());}};_0x60268b(++_0x7f6b52);}(_0xc6b8,0xd5));var _0x8c6b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc6b8[_0x321bb2];return _0x9c12ed;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x8c6b('0x0'),'remove','update'];function createListener(_0x19a934,_0x452f28){return function(_0x1ff147){_0x452f28[_0x8c6b('0x1')](_0x19a934,_0x1ff147);};}function removeListener(_0x254ddd,_0x54e3a9){return function(){DashboardItemEvents[_0x8c6b('0x2')](_0x254ddd,_0x54e3a9);};}exports[_0x8c6b('0x3')]=function(_0x274a57){for(var _0x29cba2=0x0,_0x3a5909=events[_0x8c6b('0x4')];_0x29cba2<_0x3a5909;_0x29cba2++){var _0x3798f9=events[_0x29cba2];var _0x48511e=createListener(_0x8c6b('0x5')+_0x3798f9,_0x274a57);DashboardItemEvents['on'](_0x3798f9,_0x48511e);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 638fb70..31e1f75 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 _0xf653=['destroy','exports','util','connect-timeout','express','fs-extra','./dashboardItem.controller','/:id','isAuthenticated','post','create','update','delete'];(function(_0x4e8a07,_0x16bedb){var _0x3a16ea=function(_0xc11398){while(--_0xc11398){_0x4e8a07['push'](_0x4e8a07['shift']());}};_0x3a16ea(++_0x16bedb);}(_0xf653,0x195));var _0x3f65=function(_0x22e5e8,_0x5e67d0){_0x22e5e8=_0x22e5e8-0x0;var _0x286231=_0xf653[_0x22e5e8];return _0x286231;};'use strict';var multer=require('multer');var util=require(_0x3f65('0x0'));var path=require('path');var timeout=require(_0x3f65('0x1'));var express=require(_0x3f65('0x2'));var router=express['Router']();var fs_extra=require(_0x3f65('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3f65('0x4'));router['get'](_0x3f65('0x5'),auth[_0x3f65('0x6')](),controller['show']);router[_0x3f65('0x7')]('/',auth[_0x3f65('0x6')](),controller[_0x3f65('0x8')]);router['put'](_0x3f65('0x5'),auth[_0x3f65('0x6')](),controller[_0x3f65('0x9')]);router[_0x3f65('0xa')]('/:id',auth[_0x3f65('0x6')](),controller[_0x3f65('0xb')]);module[_0x3f65('0xc')]=router; \ No newline at end of file +var _0xe47f=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./dashboardItem.controller','/:id','isAuthenticated','post','create','put','update','delete','exports'];(function(_0x2458a9,_0x213929){var _0x5ad56a=function(_0xcb5106){while(--_0xcb5106){_0x2458a9['push'](_0x2458a9['shift']());}};_0x5ad56a(++_0x213929);}(_0xe47f,0xff));var _0xfe47=function(_0x2986fb,_0x9482a0){_0x2986fb=_0x2986fb-0x0;var _0xb3c156=_0xe47f[_0x2986fb];return _0xb3c156;};'use strict';var multer=require(_0xfe47('0x0'));var util=require(_0xfe47('0x1'));var path=require(_0xfe47('0x2'));var timeout=require('connect-timeout');var express=require(_0xfe47('0x3'));var router=express[_0xfe47('0x4')]();var fs_extra=require(_0xfe47('0x5'));var auth=require(_0xfe47('0x6'));var interaction=require(_0xfe47('0x7'));var config=require('../../config/environment');var controller=require(_0xfe47('0x8'));router['get'](_0xfe47('0x9'),auth[_0xfe47('0xa')](),controller['show']);router[_0xfe47('0xb')]('/',auth[_0xfe47('0xa')](),controller[_0xfe47('0xc')]);router[_0xfe47('0xd')](_0xfe47('0x9'),auth[_0xfe47('0xa')](),controller[_0xfe47('0xe')]);router[_0xfe47('0xf')](_0xfe47('0x9'),auth[_0xfe47('0xa')](),controller['destroy']);module[_0xfe47('0x10')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index cf1fc77..131e120 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 _0xb4a3=['sequelize','exports','STRING','ENUM','second','third','first'];(function(_0x41c088,_0x155e0f){var _0x273b77=function(_0x1ba82f){while(--_0x1ba82f){_0x41c088['push'](_0x41c088['shift']());}};_0x273b77(++_0x155e0f);}(_0xb4a3,0xbd));var _0x3b4a=function(_0x44268d,_0xad8443){_0x44268d=_0x44268d-0x0;var _0x4be92d=_0xb4a3[_0x44268d];return _0x4be92d;};'use strict';var Sequelize=require(_0x3b4a('0x0'));module[_0x3b4a('0x1')]={'name':{'type':Sequelize[_0x3b4a('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x3b4a('0x3')]('first',_0x3b4a('0x4'),_0x3b4a('0x5')),'allowNull':![],'defaultValue':_0x3b4a('0x6')},'description':{'type':Sequelize[_0x3b4a('0x2')]}}; \ No newline at end of file +var _0xcc72=['exports','ENUM','first','third','sequelize'];(function(_0x1d39f6,_0x146f4a){var _0x3dbd7a=function(_0x4486f2){while(--_0x4486f2){_0x1d39f6['push'](_0x1d39f6['shift']());}};_0x3dbd7a(++_0x146f4a);}(_0xcc72,0xb3));var _0x2cc7=function(_0x58355a,_0x1acda4){_0x58355a=_0x58355a-0x0;var _0x1b4775=_0xcc72[_0x58355a];return _0x1b4775;};'use strict';var Sequelize=require(_0x2cc7('0x0'));module[_0x2cc7('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0x2cc7('0x2')](_0x2cc7('0x3'),'second',_0x2cc7('0x4')),'allowNull':![],'defaultValue':_0x2cc7('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index db01a25..24873ef 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 _0x9ca1=['filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','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','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','get','Dispositions','UserProfileResource','destroy','end','sendStatus','error','stack','name','map','Disposition','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9ca1,0x1cc));var _0x19ca=function(_0x3f2adc,_0x17fddd){_0x3f2adc=_0x3f2adc-0x0;var _0x48a6bb=_0x9ca1[_0x3f2adc];return _0x48a6bb;};'use strict';var emlformat=require(_0x19ca('0x0'));var rimraf=require(_0x19ca('0x1'));var zipdir=require(_0x19ca('0x2'));var jsonpatch=require(_0x19ca('0x3'));var rp=require(_0x19ca('0x4'));var moment=require(_0x19ca('0x5'));var BPromise=require(_0x19ca('0x6'));var Mustache=require(_0x19ca('0x7'));var util=require(_0x19ca('0x8'));var path=require(_0x19ca('0x9'));var sox=require(_0x19ca('0xa'));var csv=require('to-csv');var ejs=require(_0x19ca('0xb'));var fs=require('fs');var fs_extra=require(_0x19ca('0xc'));var _=require(_0x19ca('0xd'));var squel=require('squel');var crypto=require(_0x19ca('0xe'));var jsforce=require(_0x19ca('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x19ca('0x10'));var querystring=require(_0x19ca('0x11'));var Papa=require('papaparse');var Redis=require(_0x19ca('0x12'));var authService=require(_0x19ca('0x13'));var qs=require(_0x19ca('0x14'));var as=require(_0x19ca('0x15'));var hardwareService=require(_0x19ca('0x16'));var logger=require(_0x19ca('0x17'))(_0x19ca('0x18'));var utils=require(_0x19ca('0x19'));var config=require(_0x19ca('0x1a'));var licenseUtil=require(_0x19ca('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x194637,_0x4b7849){_0x4b7849=_0x4b7849||0xcc;return function(_0x1cf26c){if(_0x1cf26c){return _0x194637['sendStatus'](_0x4b7849);}return _0x194637['status'](_0x4b7849)['end']();};}function respondWithResult(_0x1140fe,_0x2c95e9){_0x2c95e9=_0x2c95e9||0xc8;return function(_0xd3d0da){if(_0xd3d0da){return _0x1140fe[_0x19ca('0x1c')](_0x2c95e9)[_0x19ca('0x1d')](_0xd3d0da);}};}function respondWithFilteredResult(_0x41ce35,_0x5ef83a){return function(_0x4dd7bf){if(_0x4dd7bf){var _0x2e4e4c=typeof _0x5ef83a['offset']===_0x19ca('0x1e')&&typeof _0x5ef83a[_0x19ca('0x1f')]===_0x19ca('0x1e');var _0x32b675=_0x4dd7bf[_0x19ca('0x20')];var _0x576d19=_0x2e4e4c?0x0:_0x5ef83a['offset'];var _0x8d0152=_0x2e4e4c?_0x4dd7bf[_0x19ca('0x20')]:_0x5ef83a[_0x19ca('0x21')]+_0x5ef83a['limit'];var _0x18b386;if(_0x8d0152>=_0x32b675){_0x8d0152=_0x32b675;_0x18b386=0xc8;}else{_0x18b386=0xce;}_0x41ce35['status'](_0x18b386);return _0x41ce35[_0x19ca('0x22')](_0x19ca('0x23'),_0x576d19+'-'+_0x8d0152+'/'+_0x32b675)['json'](_0x4dd7bf);}return null;};}function patchUpdates(_0x11da7e){return function(_0x2b26e5){try{jsonpatch[_0x19ca('0x24')](_0x2b26e5,_0x11da7e,!![]);}catch(_0x4b1abc){return BPromise[_0x19ca('0x25')](_0x4b1abc);}return _0x2b26e5[_0x19ca('0x26')]();};}function saveUpdates(_0x5a0e6c,_0x12b6dc){return function(_0x29d9de){if(_0x29d9de){return _0x29d9de['update'](_0x5a0e6c)['then'](function(_0x56d564){return _0x56d564;});}return null;};}function removeEntity(_0x1764e5,_0x518fef){return function(_0x3db06f){if(_0x3db06f){return _0x3db06f['destroy']()[_0x19ca('0x27')](function(){var _0x4bed1b=_0x3db06f[_0x19ca('0x28')]({'plain':!![]});var _0x3cfe4c=_0x19ca('0x29');return db[_0x19ca('0x2a')][_0x19ca('0x2b')]({'where':{'type':_0x3cfe4c,'resourceId':_0x4bed1b['id']}})[_0x19ca('0x27')](function(){return _0x3db06f;});})[_0x19ca('0x27')](function(){_0x1764e5[_0x19ca('0x1c')](0xcc)[_0x19ca('0x2c')]();});}};}function handleEntityNotFound(_0x110e02,_0x2a3197){return function(_0x280a30){if(!_0x280a30){_0x110e02[_0x19ca('0x2d')](0x194);}return _0x280a30;};}function handleError(_0xfe17cf,_0x1b0d3e){_0x1b0d3e=_0x1b0d3e||0x1f4;return function(_0x398da7){logger[_0x19ca('0x2e')](_0x398da7[_0x19ca('0x2f')]);if(_0x398da7[_0x19ca('0x30')]){delete _0x398da7[_0x19ca('0x30')];}_0xfe17cf[_0x19ca('0x1c')](_0x1b0d3e)['send'](_0x398da7);};}exports['index']=function(_0x58d699,_0x27c2c4){var _0x83e400={},_0x12064e={},_0x2eebd7={'count':0x0,'rows':[]};var _0x14e08a=_[_0x19ca('0x31')](db[_0x19ca('0x32')][_0x19ca('0x33')],function(_0x2493a5){return{'name':_0x2493a5[_0x19ca('0x34')],'type':_0x2493a5[_0x19ca('0x35')][_0x19ca('0x36')]};});_0x12064e[_0x19ca('0x37')]=_['map'](_0x14e08a,_0x19ca('0x30'));_0x12064e[_0x19ca('0x38')]=_[_0x19ca('0x39')](_0x58d699['query']);_0x12064e[_0x19ca('0x3a')]=_[_0x19ca('0x3b')](_0x12064e[_0x19ca('0x37')],_0x12064e['query']);_0x83e400[_0x19ca('0x3c')]=_[_0x19ca('0x3b')](_0x12064e[_0x19ca('0x37')],qs['fields'](_0x58d699['query'][_0x19ca('0x3d')]));_0x83e400[_0x19ca('0x3c')]=_0x83e400[_0x19ca('0x3c')][_0x19ca('0x3e')]?_0x83e400[_0x19ca('0x3c')]:_0x12064e['model'];if(!_0x58d699['query'][_0x19ca('0x3f')]('nolimit')){_0x83e400[_0x19ca('0x1f')]=qs[_0x19ca('0x1f')](_0x58d699[_0x19ca('0x38')]['limit']);_0x83e400[_0x19ca('0x21')]=qs[_0x19ca('0x21')](_0x58d699[_0x19ca('0x38')][_0x19ca('0x21')]);}_0x83e400[_0x19ca('0x40')]=qs[_0x19ca('0x41')](_0x58d699[_0x19ca('0x38')][_0x19ca('0x41')]);_0x83e400[_0x19ca('0x42')]=qs[_0x19ca('0x3a')](_[_0x19ca('0x43')](_0x58d699['query'],_0x12064e[_0x19ca('0x3a')]),_0x14e08a);if(_0x58d699[_0x19ca('0x38')][_0x19ca('0x44')]){_0x83e400[_0x19ca('0x42')]=_[_0x19ca('0x45')](_0x83e400[_0x19ca('0x42')],{'$or':_[_0x19ca('0x31')](_0x14e08a,function(_0x4ffed9){if(_0x4ffed9['type']!==_0x19ca('0x46')){var _0x104d8b={};_0x104d8b[_0x4ffed9[_0x19ca('0x30')]]={'$like':'%'+_0x58d699[_0x19ca('0x38')][_0x19ca('0x44')]+'%'};return _0x104d8b;}})});}_0x83e400=_[_0x19ca('0x45')]({},_0x83e400,_0x58d699[_0x19ca('0x47')]);var _0x16109b={'where':_0x83e400[_0x19ca('0x42')]};return db[_0x19ca('0x32')]['count'](_0x16109b)['then'](function(_0x46877a){_0x2eebd7['count']=_0x46877a;if(_0x58d699[_0x19ca('0x38')][_0x19ca('0x48')]){_0x83e400[_0x19ca('0x49')]=[{'all':!![]}];}return db[_0x19ca('0x32')][_0x19ca('0x4a')](_0x83e400);})['then'](function(_0x5d2182){_0x2eebd7[_0x19ca('0x4b')]=_0x5d2182;return _0x2eebd7;})[_0x19ca('0x27')](respondWithFilteredResult(_0x27c2c4,_0x83e400))[_0x19ca('0x4c')](handleError(_0x27c2c4,null));};exports[_0x19ca('0x4d')]=function(_0x2061b3,_0x22bfb4){var _0x203ba2={'raw':!![],'where':{'id':_0x2061b3[_0x19ca('0x4e')]['id']}},_0x4bf362={};_0x4bf362[_0x19ca('0x37')]=_[_0x19ca('0x39')](db[_0x19ca('0x32')]['rawAttributes']);_0x4bf362['query']=_[_0x19ca('0x39')](_0x2061b3[_0x19ca('0x38')]);_0x4bf362[_0x19ca('0x3a')]=_[_0x19ca('0x3b')](_0x4bf362[_0x19ca('0x37')],_0x4bf362[_0x19ca('0x38')]);_0x203ba2[_0x19ca('0x3c')]=_['intersection'](_0x4bf362[_0x19ca('0x37')],qs['fields'](_0x2061b3[_0x19ca('0x38')][_0x19ca('0x3d')]));_0x203ba2[_0x19ca('0x3c')]=_0x203ba2[_0x19ca('0x3c')]['length']?_0x203ba2[_0x19ca('0x3c')]:_0x4bf362['model'];if(_0x2061b3[_0x19ca('0x38')]['includeAll']){_0x203ba2[_0x19ca('0x49')]=[{'all':!![]}];}_0x203ba2=_['merge']({},_0x203ba2,_0x2061b3[_0x19ca('0x47')]);return db[_0x19ca('0x32')][_0x19ca('0x4f')](_0x203ba2)[_0x19ca('0x27')](handleEntityNotFound(_0x22bfb4,null))[_0x19ca('0x27')](respondWithResult(_0x22bfb4,null))[_0x19ca('0x4c')](handleError(_0x22bfb4,null));};exports[_0x19ca('0x50')]=function(_0x4af6aa,_0xfd190f){return db[_0x19ca('0x32')][_0x19ca('0x50')](_0x4af6aa[_0x19ca('0x51')],{})['then'](function(_0x159d38){var _0x315208=_0x4af6aa['user'][_0x19ca('0x28')]({'plain':!![]});if(!_0x315208)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x315208[_0x19ca('0x52')]===_0x19ca('0x53')){var _0x1e92fe=_0x159d38[_0x19ca('0x28')]({'plain':!![]});var _0x5159a8=_0x19ca('0x29');return db[_0x19ca('0x54')][_0x19ca('0x4f')]({'where':{'name':_0x5159a8,'userProfileId':_0x315208[_0x19ca('0x55')]},'raw':!![]})[_0x19ca('0x27')](function(_0x5ec75e){if(_0x5ec75e&&_0x5ec75e['autoAssociation']===0x0){return db[_0x19ca('0x2a')]['create']({'name':_0x1e92fe[_0x19ca('0x30')],'resourceId':_0x1e92fe['id'],'type':_0x5ec75e[_0x19ca('0x30')],'sectionId':_0x5ec75e['id']},{})['then'](function(){return _0x159d38;});}else{return _0x159d38;}})[_0x19ca('0x4c')](function(_0x205faf){logger[_0x19ca('0x2e')](_0x19ca('0x56'),_0x205faf);throw _0x205faf;});}return _0x159d38;})[_0x19ca('0x27')](respondWithResult(_0xfd190f,0xc9))[_0x19ca('0x4c')](handleError(_0xfd190f,null));};exports[_0x19ca('0x57')]=function(_0x1a9e47,_0x1f31c0){if(_0x1a9e47[_0x19ca('0x51')]['id']){delete _0x1a9e47[_0x19ca('0x51')]['id'];}return db[_0x19ca('0x32')][_0x19ca('0x4f')]({'where':{'id':_0x1a9e47['params']['id']}})[_0x19ca('0x27')](handleEntityNotFound(_0x1f31c0,null))['then'](saveUpdates(_0x1a9e47['body'],null))[_0x19ca('0x27')](respondWithResult(_0x1f31c0,null))[_0x19ca('0x4c')](handleError(_0x1f31c0,null));};exports[_0x19ca('0x2b')]=function(_0x3fde10,_0xc8b9c){return db[_0x19ca('0x32')][_0x19ca('0x4f')]({'where':{'id':_0x3fde10[_0x19ca('0x4e')]['id']}})[_0x19ca('0x27')](handleEntityNotFound(_0xc8b9c,null))[_0x19ca('0x27')](removeEntity(_0xc8b9c,null))['catch'](handleError(_0xc8b9c,null));}; \ No newline at end of file +var _0x4e13=['options','includeAll','findAll','show','params','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','undefined','limit','count','offset','json','apply','reject','save','update','destroy','then','Dispositions','UserProfileResource','end','sendStatus','error','name','send','map','Disposition','rawAttributes','fieldName','key','filters','intersection','query','attributes','model','fields','length','nolimit','order','sort','where','pick','merge','type','filter'];(function(_0x24378e,_0x4d8424){var _0x11ed83=function(_0x47bcc3){while(--_0x47bcc3){_0x24378e['push'](_0x24378e['shift']());}};_0x11ed83(++_0x4d8424);}(_0x4e13,0xb1));var _0x34e1=function(_0x59e862,_0x477bf2){_0x59e862=_0x59e862-0x0;var _0x1a25ee=_0x4e13[_0x59e862];return _0x1a25ee;};'use strict';var emlformat=require(_0x34e1('0x0'));var rimraf=require(_0x34e1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x34e1('0x2'));var rp=require(_0x34e1('0x3'));var moment=require(_0x34e1('0x4'));var BPromise=require(_0x34e1('0x5'));var Mustache=require('mustache');var util=require(_0x34e1('0x6'));var path=require(_0x34e1('0x7'));var sox=require(_0x34e1('0x8'));var csv=require(_0x34e1('0x9'));var ejs=require(_0x34e1('0xa'));var fs=require('fs');var fs_extra=require(_0x34e1('0xb'));var _=require(_0x34e1('0xc'));var squel=require(_0x34e1('0xd'));var crypto=require('crypto');var jsforce=require(_0x34e1('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x34e1('0x9'));var querystring=require(_0x34e1('0xf'));var Papa=require(_0x34e1('0x10'));var Redis=require('ioredis');var authService=require(_0x34e1('0x11'));var qs=require(_0x34e1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x34e1('0x13'));var logger=require(_0x34e1('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x34e1('0x15'));var licenseUtil=require(_0x34e1('0x16'));var db=require(_0x34e1('0x17'))['db'];function respondWithStatusCode(_0x24c0a4,_0x940984){_0x940984=_0x940984||0xcc;return function(_0x3e6601){if(_0x3e6601){return _0x24c0a4['sendStatus'](_0x940984);}return _0x24c0a4[_0x34e1('0x18')](_0x940984)['end']();};}function respondWithResult(_0x4676a5,_0x4590c2){_0x4590c2=_0x4590c2||0xc8;return function(_0x9667c4){if(_0x9667c4){return _0x4676a5[_0x34e1('0x18')](_0x4590c2)['json'](_0x9667c4);}};}function respondWithFilteredResult(_0x5d3607,_0x58d36f){return function(_0x4403bd){if(_0x4403bd){var _0xb0477c=typeof _0x58d36f['offset']===_0x34e1('0x19')&&typeof _0x58d36f[_0x34e1('0x1a')]===_0x34e1('0x19');var _0x2386e0=_0x4403bd[_0x34e1('0x1b')];var _0x37b142=_0xb0477c?0x0:_0x58d36f[_0x34e1('0x1c')];var _0x3f32e3=_0xb0477c?_0x4403bd[_0x34e1('0x1b')]:_0x58d36f[_0x34e1('0x1c')]+_0x58d36f[_0x34e1('0x1a')];var _0x378fda;if(_0x3f32e3>=_0x2386e0){_0x3f32e3=_0x2386e0;_0x378fda=0xc8;}else{_0x378fda=0xce;}_0x5d3607[_0x34e1('0x18')](_0x378fda);return _0x5d3607['set']('Content-Range',_0x37b142+'-'+_0x3f32e3+'/'+_0x2386e0)[_0x34e1('0x1d')](_0x4403bd);}return null;};}function patchUpdates(_0xdfe947){return function(_0x3b1dfe){try{jsonpatch[_0x34e1('0x1e')](_0x3b1dfe,_0xdfe947,!![]);}catch(_0x10c262){return BPromise[_0x34e1('0x1f')](_0x10c262);}return _0x3b1dfe[_0x34e1('0x20')]();};}function saveUpdates(_0x34b1d2,_0x1eb612){return function(_0x50ebec){if(_0x50ebec){return _0x50ebec[_0x34e1('0x21')](_0x34b1d2)['then'](function(_0x539359){return _0x539359;});}return null;};}function removeEntity(_0x3573a1,_0x5dc70b){return function(_0x5c9830){if(_0x5c9830){return _0x5c9830[_0x34e1('0x22')]()[_0x34e1('0x23')](function(){var _0x22fa3b=_0x5c9830['get']({'plain':!![]});var _0x3ef94c=_0x34e1('0x24');return db[_0x34e1('0x25')][_0x34e1('0x22')]({'where':{'type':_0x3ef94c,'resourceId':_0x22fa3b['id']}})['then'](function(){return _0x5c9830;});})[_0x34e1('0x23')](function(){_0x3573a1[_0x34e1('0x18')](0xcc)[_0x34e1('0x26')]();});}};}function handleEntityNotFound(_0x1d0233,_0x2251aa){return function(_0x122dd2){if(!_0x122dd2){_0x1d0233[_0x34e1('0x27')](0x194);}return _0x122dd2;};}function handleError(_0x2986ff,_0x4e3ac6){_0x4e3ac6=_0x4e3ac6||0x1f4;return function(_0x23c350){logger[_0x34e1('0x28')](_0x23c350['stack']);if(_0x23c350['name']){delete _0x23c350[_0x34e1('0x29')];}_0x2986ff[_0x34e1('0x18')](_0x4e3ac6)[_0x34e1('0x2a')](_0x23c350);};}exports['index']=function(_0x1a4b9f,_0x4ed3b5){var _0x16b0b4={},_0x440287={},_0x4c469a={'count':0x0,'rows':[]};var _0x4d1c87=_[_0x34e1('0x2b')](db[_0x34e1('0x2c')][_0x34e1('0x2d')],function(_0x29b94c){return{'name':_0x29b94c[_0x34e1('0x2e')],'type':_0x29b94c['type'][_0x34e1('0x2f')]};});_0x440287['model']=_['map'](_0x4d1c87,_0x34e1('0x29'));_0x440287['query']=_['keys'](_0x1a4b9f['query']);_0x440287[_0x34e1('0x30')]=_[_0x34e1('0x31')](_0x440287['model'],_0x440287[_0x34e1('0x32')]);_0x16b0b4[_0x34e1('0x33')]=_[_0x34e1('0x31')](_0x440287[_0x34e1('0x34')],qs['fields'](_0x1a4b9f[_0x34e1('0x32')][_0x34e1('0x35')]));_0x16b0b4[_0x34e1('0x33')]=_0x16b0b4[_0x34e1('0x33')][_0x34e1('0x36')]?_0x16b0b4[_0x34e1('0x33')]:_0x440287[_0x34e1('0x34')];if(!_0x1a4b9f[_0x34e1('0x32')]['hasOwnProperty'](_0x34e1('0x37'))){_0x16b0b4[_0x34e1('0x1a')]=qs[_0x34e1('0x1a')](_0x1a4b9f[_0x34e1('0x32')]['limit']);_0x16b0b4[_0x34e1('0x1c')]=qs['offset'](_0x1a4b9f[_0x34e1('0x32')][_0x34e1('0x1c')]);}_0x16b0b4[_0x34e1('0x38')]=qs[_0x34e1('0x39')](_0x1a4b9f['query'][_0x34e1('0x39')]);_0x16b0b4[_0x34e1('0x3a')]=qs[_0x34e1('0x30')](_[_0x34e1('0x3b')](_0x1a4b9f[_0x34e1('0x32')],_0x440287[_0x34e1('0x30')]),_0x4d1c87);if(_0x1a4b9f[_0x34e1('0x32')]['filter']){_0x16b0b4[_0x34e1('0x3a')]=_[_0x34e1('0x3c')](_0x16b0b4['where'],{'$or':_[_0x34e1('0x2b')](_0x4d1c87,function(_0x2fc6e1){if(_0x2fc6e1[_0x34e1('0x3d')]!=='VIRTUAL'){var _0x36e826={};_0x36e826[_0x2fc6e1['name']]={'$like':'%'+_0x1a4b9f[_0x34e1('0x32')][_0x34e1('0x3e')]+'%'};return _0x36e826;}})});}_0x16b0b4=_['merge']({},_0x16b0b4,_0x1a4b9f[_0x34e1('0x3f')]);var _0x288323={'where':_0x16b0b4['where']};return db[_0x34e1('0x2c')]['count'](_0x288323)[_0x34e1('0x23')](function(_0x2c06a6){_0x4c469a[_0x34e1('0x1b')]=_0x2c06a6;if(_0x1a4b9f['query'][_0x34e1('0x40')]){_0x16b0b4['include']=[{'all':!![]}];}return db['Disposition'][_0x34e1('0x41')](_0x16b0b4);})['then'](function(_0x4e4b73){_0x4c469a['rows']=_0x4e4b73;return _0x4c469a;})['then'](respondWithFilteredResult(_0x4ed3b5,_0x16b0b4))['catch'](handleError(_0x4ed3b5,null));};exports[_0x34e1('0x42')]=function(_0x36c8e9,_0x5c967c){var _0x25ceca={'raw':!![],'where':{'id':_0x36c8e9[_0x34e1('0x43')]['id']}},_0x4aec01={};_0x4aec01[_0x34e1('0x34')]=_[_0x34e1('0x44')](db[_0x34e1('0x2c')]['rawAttributes']);_0x4aec01[_0x34e1('0x32')]=_[_0x34e1('0x44')](_0x36c8e9['query']);_0x4aec01[_0x34e1('0x30')]=_[_0x34e1('0x31')](_0x4aec01[_0x34e1('0x34')],_0x4aec01[_0x34e1('0x32')]);_0x25ceca['attributes']=_[_0x34e1('0x31')](_0x4aec01[_0x34e1('0x34')],qs[_0x34e1('0x35')](_0x36c8e9['query']['fields']));_0x25ceca['attributes']=_0x25ceca[_0x34e1('0x33')][_0x34e1('0x36')]?_0x25ceca[_0x34e1('0x33')]:_0x4aec01['model'];if(_0x36c8e9[_0x34e1('0x32')][_0x34e1('0x40')]){_0x25ceca['include']=[{'all':!![]}];}_0x25ceca=_[_0x34e1('0x3c')]({},_0x25ceca,_0x36c8e9[_0x34e1('0x3f')]);return db[_0x34e1('0x2c')][_0x34e1('0x45')](_0x25ceca)[_0x34e1('0x23')](handleEntityNotFound(_0x5c967c,null))['then'](respondWithResult(_0x5c967c,null))['catch'](handleError(_0x5c967c,null));};exports[_0x34e1('0x46')]=function(_0x4a5c1e,_0x26e662){return db[_0x34e1('0x2c')][_0x34e1('0x46')](_0x4a5c1e[_0x34e1('0x47')],{})['then'](function(_0x14f757){var _0x9615f4=_0x4a5c1e[_0x34e1('0x48')][_0x34e1('0x49')]({'plain':!![]});if(!_0x9615f4)throw new Error(_0x34e1('0x4a'));if(_0x9615f4['role']===_0x34e1('0x48')){var _0xc730e0=_0x14f757[_0x34e1('0x49')]({'plain':!![]});var _0x1c15db='Dispositions';return db[_0x34e1('0x4b')][_0x34e1('0x45')]({'where':{'name':_0x1c15db,'userProfileId':_0x9615f4[_0x34e1('0x4c')]},'raw':!![]})[_0x34e1('0x23')](function(_0x5780be){if(_0x5780be&&_0x5780be[_0x34e1('0x4d')]===0x0){return db[_0x34e1('0x25')][_0x34e1('0x46')]({'name':_0xc730e0[_0x34e1('0x29')],'resourceId':_0xc730e0['id'],'type':_0x5780be[_0x34e1('0x29')],'sectionId':_0x5780be['id']},{})['then'](function(){return _0x14f757;});}else{return _0x14f757;}})[_0x34e1('0x4e')](function(_0x5f4051){logger[_0x34e1('0x28')](_0x34e1('0x4f'),_0x5f4051);throw _0x5f4051;});}return _0x14f757;})[_0x34e1('0x23')](respondWithResult(_0x26e662,0xc9))[_0x34e1('0x4e')](handleError(_0x26e662,null));};exports[_0x34e1('0x21')]=function(_0xe447c4,_0x464f34){if(_0xe447c4[_0x34e1('0x47')]['id']){delete _0xe447c4[_0x34e1('0x47')]['id'];}return db[_0x34e1('0x2c')]['find']({'where':{'id':_0xe447c4[_0x34e1('0x43')]['id']}})[_0x34e1('0x23')](handleEntityNotFound(_0x464f34,null))[_0x34e1('0x23')](saveUpdates(_0xe447c4['body'],null))[_0x34e1('0x23')](respondWithResult(_0x464f34,null))['catch'](handleError(_0x464f34,null));};exports['destroy']=function(_0x351e4b,_0x24114e){return db[_0x34e1('0x2c')]['find']({'where':{'id':_0x351e4b[_0x34e1('0x43')]['id']}})[_0x34e1('0x23')](handleEntityNotFound(_0x24114e,null))['then'](removeEntity(_0x24114e,null))[_0x34e1('0x4e')](handleError(_0x24114e,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 7dba75e..93b78e2 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 _0x9849=['ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name'];(function(_0x1a8f86,_0x5ed9c4){var _0x20d876=function(_0x596e1b){while(--_0x596e1b){_0x1a8f86['push'](_0x1a8f86['shift']());}};_0x20d876(++_0x5ed9c4);}(_0x9849,0x1a2));var _0x9984=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0x9849[_0xa6cc5c];return _0x44803d;};'use strict';var _=require(_0x9984('0x0'));var util=require('util');var logger=require(_0x9984('0x1'))(_0x9984('0x2'));var moment=require(_0x9984('0x3'));var BPromise=require(_0x9984('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9984('0x5'));var config=require(_0x9984('0x6'));var attributes=require(_0x9984('0x7'));module[_0x9984('0x8')]=function(_0x50bd4d,_0x437188){return _0x50bd4d[_0x9984('0x9')](_0x9984('0xa'),attributes,{'tableName':_0x9984('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x9984('0xc'),'fields':[_0x9984('0xd'),_0x9984('0xe')]},{'unique':!![],'name':_0x9984('0xf'),'fields':[_0x9984('0xd'),_0x9984('0x10')]},{'unique':!![],'name':_0x9984('0x11'),'fields':[_0x9984('0xd'),_0x9984('0x12')]},{'unique':!![],'name':_0x9984('0x13'),'fields':[_0x9984('0xd'),_0x9984('0x14')]},{'unique':!![],'name':'name_fax','fields':[_0x9984('0xd'),'FaxAccountId']},{'unique':!![],'name':'name_openchannel','fields':[_0x9984('0xd'),_0x9984('0x15')]},{'unique':!![],'name':_0x9984('0x16'),'fields':[_0x9984('0xd'),_0x9984('0x17')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x513f=['SmsAccountId','name_fax','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms'];(function(_0x1138d6,_0x305096){var _0x31dbc4=function(_0xad832){while(--_0xad832){_0x1138d6['push'](_0x1138d6['shift']());}};_0x31dbc4(++_0x305096);}(_0x513f,0xce));var _0xf513=function(_0x84a211,_0x29d025){_0x84a211=_0x84a211-0x0;var _0x5637c1=_0x513f[_0x84a211];return _0x5637c1;};'use strict';var _=require('lodash');var util=require(_0xf513('0x0'));var logger=require(_0xf513('0x1'))('api');var moment=require(_0xf513('0x2'));var BPromise=require(_0xf513('0x3'));var rp=require(_0xf513('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf513('0x5'));var attributes=require(_0xf513('0x6'));module[_0xf513('0x7')]=function(_0x3d2bda,_0x13f0b5){return _0x3d2bda[_0xf513('0x8')](_0xf513('0x9'),attributes,{'tableName':_0xf513('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xf513('0xb'),'fields':[_0xf513('0xc'),_0xf513('0xd')]},{'unique':!![],'name':_0xf513('0xe'),'fields':[_0xf513('0xc'),_0xf513('0xf')]},{'unique':!![],'name':_0xf513('0x10'),'fields':['name',_0xf513('0x11')]},{'unique':!![],'name':_0xf513('0x12'),'fields':[_0xf513('0xc'),_0xf513('0x13')]},{'unique':!![],'name':_0xf513('0x14'),'fields':[_0xf513('0xc'),'FaxAccountId']},{'unique':!![],'name':_0xf513('0x15'),'fields':[_0xf513('0xc'),_0xf513('0x16')]},{'unique':!![],'name':_0xf513('0x17'),'fields':['name',_0xf513('0x18')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index fe95726..377d8a5 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(_0x566efd,_0x5ddae3){var _0x4bb188=function(_0x981ec2){while(--_0x981ec2){_0x566efd['push'](_0x566efd['shift']());}};_0x4bb188(++_0x5ddae3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'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(_0x298982,_0x516ca1){var _0x56f07a=function(_0x56fe98){while(--_0x56fe98){_0x298982['push'](_0x298982['shift']());}};_0x56f07a(++_0x516ca1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'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 c173dc6..45f608f 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 _0xb568=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','multer','path'];(function(_0x300caf,_0x6118c5){var _0x18ce81=function(_0x1c867d){while(--_0x1c867d){_0x300caf['push'](_0x300caf['shift']());}};_0x18ce81(++_0x6118c5);}(_0xb568,0x1ec));var _0x8b56=function(_0x50a635,_0x158de3){_0x50a635=_0x50a635-0x0;var _0x15fcdf=_0xb568[_0x50a635];return _0x15fcdf;};'use strict';var multer=require(_0x8b56('0x0'));var util=require('util');var path=require(_0x8b56('0x1'));var timeout=require('connect-timeout');var express=require(_0x8b56('0x2'));var router=express[_0x8b56('0x3')]();var fs_extra=require(_0x8b56('0x4'));var auth=require(_0x8b56('0x5'));var interaction=require(_0x8b56('0x6'));var config=require(_0x8b56('0x7'));var controller=require(_0x8b56('0x8'));router[_0x8b56('0x9')]('/',auth[_0x8b56('0xa')](),controller[_0x8b56('0xb')]);router['get'](_0x8b56('0xc'),auth['isAuthenticated'](),controller[_0x8b56('0xd')]);router[_0x8b56('0xe')]('/',auth[_0x8b56('0xa')](),controller[_0x8b56('0xf')]);router['put'](_0x8b56('0xc'),auth[_0x8b56('0xa')](),controller[_0x8b56('0x10')]);router[_0x8b56('0x11')](_0x8b56('0xc'),auth[_0x8b56('0xa')](),controller[_0x8b56('0x12')]);module['exports']=router; \ No newline at end of file +var _0x7f2a=['delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','post','create','put','update'];(function(_0xd94111,_0x4d1c97){var _0x27546f=function(_0x4f6397){while(--_0x4f6397){_0xd94111['push'](_0xd94111['shift']());}};_0x27546f(++_0x4d1c97);}(_0x7f2a,0xa5));var _0xa7f2=function(_0x323041,_0x1fedea){_0x323041=_0x323041-0x0;var _0x4e996c=_0x7f2a[_0x323041];return _0x4e996c;};'use strict';var multer=require('multer');var util=require(_0xa7f2('0x0'));var path=require(_0xa7f2('0x1'));var timeout=require(_0xa7f2('0x2'));var express=require('express');var router=express[_0xa7f2('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa7f2('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa7f2('0x5'));var controller=require(_0xa7f2('0x6'));router[_0xa7f2('0x7')]('/',auth[_0xa7f2('0x8')](),controller[_0xa7f2('0x9')]);router[_0xa7f2('0x7')](_0xa7f2('0xa'),auth[_0xa7f2('0x8')](),controller['show']);router[_0xa7f2('0xb')]('/',auth[_0xa7f2('0x8')](),controller[_0xa7f2('0xc')]);router[_0xa7f2('0xd')](_0xa7f2('0xa'),auth['isAuthenticated'](),controller[_0xa7f2('0xe')]);router[_0xa7f2('0xf')](_0xa7f2('0xa'),auth['isAuthenticated'](),controller[_0xa7f2('0x10')]);module[_0xa7f2('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 6af15ea..62a4c5c 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 _0xc939=['INTEGER','SIP','IAX','DADHI','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','yes','xCALLY\x20Motion\x20Fax','ENUM','2400','7200','9600','12000','4800','14400','v17,v27,v29'];(function(_0x2417af,_0x24011d){var _0x3736bb=function(_0x9b621f){while(--_0x9b621f){_0x2417af['push'](_0x2417af['shift']());}};_0x3736bb(++_0x24011d);}(_0xc939,0xed));var _0x9c93=function(_0x14eece,_0x326c42){_0x14eece=_0x14eece-0x0;var _0xdf72c8=_0xc939[_0x14eece];return _0xdf72c8;};'use strict';var Sequelize=require(_0x9c93('0x0'));module[_0x9c93('0x1')]={'name':{'type':Sequelize[_0x9c93('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9c93('0x2')]},'ecm':{'type':Sequelize['ENUM'](_0x9c93('0x3'),'no'),'defaultValue':_0x9c93('0x3')},'headerinfo':{'type':Sequelize[_0x9c93('0x2')],'defaultValue':_0x9c93('0x4')},'localstationid':{'type':Sequelize['STRING'],'unique':'localstationid'},'minrate':{'type':Sequelize[_0x9c93('0x5')](_0x9c93('0x6'),'4800',_0x9c93('0x7'),_0x9c93('0x8'),_0x9c93('0x9'),'14400'),'defaultValue':_0x9c93('0xa')},'maxrate':{'type':Sequelize[_0x9c93('0x5')](_0x9c93('0x6'),'4800',_0x9c93('0x7'),_0x9c93('0x8'),_0x9c93('0x9'),_0x9c93('0xb')),'defaultValue':_0x9c93('0xb')},'modem':{'type':Sequelize[_0x9c93('0x2')],'defaultValue':_0x9c93('0xc')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x9c93('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x9c93('0x5')](_0x9c93('0xe'),_0x9c93('0xf'),_0x9c93('0x10'),'KHOMP'),'defaultValue':_0x9c93('0xe')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x9c93('0x11')],'defaultValue':function(){return _0x9c93('0x12');}},'notificationSound':{'type':Sequelize[_0x9c93('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9c93('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9c93('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9c93('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9c93('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9c93('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x9c93('0x14')},'mandatoryDisposition':{'type':Sequelize[_0x9c93('0x13')],'defaultValue':![],'comment':_0x9c93('0x15'),'set':function(_0x454c3d){if(!_0x454c3d)this[_0x9c93('0x16')](_0x9c93('0x17'),null);this['setDataValue'](_0x9c93('0x18'),_0x454c3d);}}}; \ No newline at end of file +var _0xbd18=['exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','9600','12000','14400','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDisposition'];(function(_0x1fbd46,_0x4b456f){var _0x264d03=function(_0x4f3fe8){while(--_0x4f3fe8){_0x1fbd46['push'](_0x1fbd46['shift']());}};_0x264d03(++_0x4b456f);}(_0xbd18,0x180));var _0x8bd1=function(_0x4fee18,_0x2a78e4){_0x4fee18=_0x4fee18-0x0;var _0x40c0ba=_0xbd18[_0x4fee18];return _0x40c0ba;};'use strict';var Sequelize=require('sequelize');module[_0x8bd1('0x0')]={'name':{'type':Sequelize[_0x8bd1('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8bd1('0x1')]},'ecm':{'type':Sequelize[_0x8bd1('0x2')](_0x8bd1('0x3'),'no'),'defaultValue':_0x8bd1('0x3')},'headerinfo':{'type':Sequelize[_0x8bd1('0x1')],'defaultValue':_0x8bd1('0x4')},'localstationid':{'type':Sequelize[_0x8bd1('0x1')],'unique':_0x8bd1('0x5')},'minrate':{'type':Sequelize[_0x8bd1('0x2')](_0x8bd1('0x6'),_0x8bd1('0x7'),_0x8bd1('0x8'),_0x8bd1('0x9'),_0x8bd1('0xa'),_0x8bd1('0xb')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x8bd1('0x2')](_0x8bd1('0x6'),_0x8bd1('0x7'),'7200',_0x8bd1('0x9'),_0x8bd1('0xa'),_0x8bd1('0xb')),'defaultValue':_0x8bd1('0xb')},'modem':{'type':Sequelize['STRING'],'defaultValue':_0x8bd1('0xc')},'gateway':{'type':Sequelize[_0x8bd1('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x8bd1('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x8bd1('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x8bd1('0x2')](_0x8bd1('0xe'),_0x8bd1('0xf'),_0x8bd1('0x10'),_0x8bd1('0x11')),'defaultValue':_0x8bd1('0xe')},'key':{'type':Sequelize[_0x8bd1('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x8bd1('0x12')],'defaultValue':function(){return _0x8bd1('0x13');}},'notificationSound':{'type':Sequelize[_0x8bd1('0x14')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8bd1('0x14')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8bd1('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x8bd1('0x14')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8bd1('0x14')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8bd1('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x8bd1('0x15')},'mandatoryDisposition':{'type':Sequelize[_0x8bd1('0x14')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3d3ae7){if(!_0x3d3ae7)this[_0x8bd1('0x16')]('mandatoryDispositionPauseId',null);this[_0x8bd1('0x16')](_0x8bd1('0x17'),_0x3d3ae7);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 06ec638..6bcd4f8 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 _0xcc99=['client','request','then','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','FaxAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','VIRTUAL','filter','includeAll','include','findAll','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','Disposition','getDispositions','length','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addInteraction','FaxInteraction','getInteractions','findOne','Contact','User','Owner','fullname','internal','Tags','tag','addApplications','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','from-voip-provider','exten','app','system','description','appdata','push','Answer','ecm','localstationid','gateway','faxdetect','headerinfo','maxrate','minrate','modem','FAXOPT(','Set','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','addAccountApplications','sequelize','VoiceExtension','omit','key','createdAt','TrunkId','findById','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','rows','CmList','List','CmContact','Contacts','DESC','attachments','join','root','server/files/attachments','CheckAfterSend','isNil','from','ListId','List\x20not\x20found','Send\x20Fax\x20failed','out','Messages','Contact\x20not\x20found','spread','filename','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','getAgents','moment','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','defaults','socket.io-emitter','redis','./faxAccount.socket','register','http'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0xcc99,0x163));var _0x9cc9=function(_0x157a48,_0x53a46e){_0x157a48=_0x157a48-0x0;var _0x27b51f=_0xcc99[_0x157a48];return _0x27b51f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9cc9('0x0'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9cc9('0x1'));var path=require(_0x9cc9('0x2'));var sox=require('sox');var csv=require(_0x9cc9('0x3'));var ejs=require(_0x9cc9('0x4'));var fs=require('fs');var fs_extra=require(_0x9cc9('0x5'));var _=require('lodash');var squel=require(_0x9cc9('0x6'));var crypto=require(_0x9cc9('0x7'));var jsforce=require(_0x9cc9('0x8'));var deskjs=require(_0x9cc9('0x9'));var toCsv=require(_0x9cc9('0x3'));var querystring=require('querystring');var Papa=require(_0x9cc9('0xa'));var Redis=require(_0x9cc9('0xb'));var authService=require(_0x9cc9('0xc'));var qs=require(_0x9cc9('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9cc9('0xe'));var logger=require(_0x9cc9('0xf'))(_0x9cc9('0x10'));var utils=require(_0x9cc9('0x11'));var config=require(_0x9cc9('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x9cc9('0x13')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9cc9('0x14'))(new Redis(config[_0x9cc9('0x15')]));require(_0x9cc9('0x16'))[_0x9cc9('0x17')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x9cc9('0x18')]({'port':0x232c});var client9002=jayson[_0x9cc9('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2cc3c6,_0xd929e6,_0x5c4a4d,_0xed1204){return new BPromise(function(_0x555310,_0x5a2027){var _0x35faaa=_0xed1204||client;return _0x35faaa[_0x9cc9('0x1a')](_0x2cc3c6,_0x5c4a4d)[_0x9cc9('0x1b')](function(_0x928614){logger['info']('FaxAccount,\x20%s,\x20%s',_0xd929e6,_0x9cc9('0x1c'));logger[_0x9cc9('0x1d')](_0x9cc9('0x1e'),_0xd929e6,_0x9cc9('0x1c'),JSON[_0x9cc9('0x1f')](_0x928614));if(_0x928614['error']){if(_0x928614[_0x9cc9('0x20')][_0x9cc9('0x21')]===0x1f4){logger[_0x9cc9('0x20')](_0x9cc9('0x22'),_0xd929e6,_0x928614[_0x9cc9('0x20')]['message']);return _0x5a2027(_0x928614[_0x9cc9('0x20')][_0x9cc9('0x23')]);}logger[_0x9cc9('0x20')](_0x9cc9('0x22'),_0xd929e6,_0x928614[_0x9cc9('0x20')][_0x9cc9('0x23')]);return _0x555310(_0x928614[_0x9cc9('0x20')][_0x9cc9('0x23')]);}else{logger[_0x9cc9('0x24')]('FaxAccount,\x20%s,\x20%s',_0xd929e6,_0x9cc9('0x1c'));_0x555310(_0x928614[_0x9cc9('0x25')][_0x9cc9('0x23')]);}})[_0x9cc9('0x26')](function(_0x152da5){logger['error'](_0x9cc9('0x22'),_0xd929e6,_0x152da5);_0x5a2027(_0x152da5);});});}function respondWithStatusCode(_0x34283f,_0x129886){_0x129886=_0x129886||0xcc;return function(_0x50ed65){if(_0x50ed65){return _0x34283f[_0x9cc9('0x27')](_0x129886);}return _0x34283f[_0x9cc9('0x28')](_0x129886)[_0x9cc9('0x29')]();};}function respondWithResult(_0x323bbc,_0x278f2e){_0x278f2e=_0x278f2e||0xc8;return function(_0x1ee2d2){if(_0x1ee2d2){return _0x323bbc['status'](_0x278f2e)[_0x9cc9('0x2a')](_0x1ee2d2);}};}function respondWithFilteredResult(_0x5d65fd,_0x2b5316){return function(_0x49712c){if(_0x49712c){var _0x55cc7f=typeof _0x2b5316[_0x9cc9('0x2b')]===_0x9cc9('0x2c')&&typeof _0x2b5316[_0x9cc9('0x2d')]===_0x9cc9('0x2c');var _0x87eb3e=_0x49712c[_0x9cc9('0x2e')];var _0x12ad69=_0x55cc7f?0x0:_0x2b5316[_0x9cc9('0x2b')];var _0x413b78=_0x55cc7f?_0x49712c[_0x9cc9('0x2e')]:_0x2b5316[_0x9cc9('0x2b')]+_0x2b5316['limit'];var _0x439b92;if(_0x413b78>=_0x87eb3e){_0x413b78=_0x87eb3e;_0x439b92=0xc8;}else{_0x439b92=0xce;}_0x5d65fd['status'](_0x439b92);return _0x5d65fd[_0x9cc9('0x2f')]('Content-Range',_0x12ad69+'-'+_0x413b78+'/'+_0x87eb3e)[_0x9cc9('0x2a')](_0x49712c);}return null;};}function patchUpdates(_0x35a9f6){return function(_0x487ac1){try{jsonpatch['apply'](_0x487ac1,_0x35a9f6,!![]);}catch(_0x502317){return BPromise[_0x9cc9('0x30')](_0x502317);}return _0x487ac1[_0x9cc9('0x31')]();};}function saveUpdates(_0xd5a96,_0x511b3a){return function(_0x5132a7){if(_0x5132a7){return _0x5132a7[_0x9cc9('0x32')](_0xd5a96)[_0x9cc9('0x1b')](function(_0x24a6d7){return _0x24a6d7;});}return null;};}function removeEntity(_0x49fccf,_0x23b2e0){return function(_0x1d1485){if(_0x1d1485){return _0x1d1485[_0x9cc9('0x33')]()[_0x9cc9('0x1b')](function(){var _0x17d83b=_0x1d1485[_0x9cc9('0x34')]({'plain':!![]});var _0x1a22ea=_0x9cc9('0x35');return db[_0x9cc9('0x36')][_0x9cc9('0x33')]({'where':{'type':_0x1a22ea,'resourceId':_0x17d83b['id']}})[_0x9cc9('0x1b')](function(){return _0x1d1485;});})[_0x9cc9('0x1b')](function(){_0x49fccf[_0x9cc9('0x28')](0xcc)[_0x9cc9('0x29')]();});}};}function handleEntityNotFound(_0x26d384,_0x180d4c){return function(_0x16bfdb){if(!_0x16bfdb){_0x26d384[_0x9cc9('0x27')](0x194);}return _0x16bfdb;};}function handleError(_0x1b079f,_0x525204){_0x525204=_0x525204||0x1f4;return function(_0x592194){logger[_0x9cc9('0x20')](_0x592194[_0x9cc9('0x37')]);if(_0x592194[_0x9cc9('0x38')]){delete _0x592194[_0x9cc9('0x38')];}_0x1b079f['status'](_0x525204)[_0x9cc9('0x39')](_0x592194);};}exports[_0x9cc9('0x3a')]=function(_0x56f325,_0x32ea3f){var _0x580a5c={'include':[{'model':db[_0x9cc9('0x3b')],'as':_0x9cc9('0x3c')}]},_0x86c989={},_0xb8d50e={'count':0x0,'rows':[]};var _0x32ad92=_['map'](db[_0x9cc9('0x3d')][_0x9cc9('0x3e')],function(_0x1e206c){return{'name':_0x1e206c[_0x9cc9('0x3f')],'type':_0x1e206c[_0x9cc9('0x40')]['key']};});_0x86c989[_0x9cc9('0x41')]=_['map'](_0x32ad92,_0x9cc9('0x38'));_0x86c989[_0x9cc9('0x42')]=_[_0x9cc9('0x43')](_0x56f325[_0x9cc9('0x42')]);_0x86c989[_0x9cc9('0x44')]=_[_0x9cc9('0x45')](_0x86c989['model'],_0x86c989['query']);_0x580a5c['attributes']=_[_0x9cc9('0x45')](_0x86c989[_0x9cc9('0x41')],qs[_0x9cc9('0x46')](_0x56f325[_0x9cc9('0x42')]['fields']));_0x580a5c[_0x9cc9('0x47')]=_0x580a5c['attributes']['length']?_0x580a5c[_0x9cc9('0x47')]:_0x86c989[_0x9cc9('0x41')];if(!_0x56f325['query'][_0x9cc9('0x48')](_0x9cc9('0x49'))){_0x580a5c['limit']=qs[_0x9cc9('0x2d')](_0x56f325['query'][_0x9cc9('0x2d')]);_0x580a5c['offset']=qs['offset'](_0x56f325[_0x9cc9('0x42')][_0x9cc9('0x2b')]);}_0x580a5c[_0x9cc9('0x4a')]=qs[_0x9cc9('0x4b')](_0x56f325[_0x9cc9('0x42')][_0x9cc9('0x4b')]);_0x580a5c[_0x9cc9('0x4c')]=qs[_0x9cc9('0x44')](_[_0x9cc9('0x4d')](_0x56f325[_0x9cc9('0x42')],_0x86c989[_0x9cc9('0x44')]),_0x32ad92);if(_0x56f325[_0x9cc9('0x42')]['filter']){_0x580a5c[_0x9cc9('0x4c')]=_[_0x9cc9('0x4e')](_0x580a5c[_0x9cc9('0x4c')],{'$or':_[_0x9cc9('0x4f')](_0x32ad92,function(_0x49f173){if(_0x49f173[_0x9cc9('0x40')]!==_0x9cc9('0x50')){var _0x58cf89={};_0x58cf89[_0x49f173[_0x9cc9('0x38')]]={'$like':'%'+_0x56f325[_0x9cc9('0x42')][_0x9cc9('0x51')]+'%'};return _0x58cf89;}})});}_0x580a5c=_[_0x9cc9('0x4e')]({},_0x580a5c,_0x56f325['options']);var _0x49019f={'where':_0x580a5c[_0x9cc9('0x4c')]};return db[_0x9cc9('0x3d')]['count'](_0x49019f)[_0x9cc9('0x1b')](function(_0x1987a5){_0xb8d50e['count']=_0x1987a5;if(_0x56f325[_0x9cc9('0x42')][_0x9cc9('0x52')]){_0x580a5c[_0x9cc9('0x53')]=[{'all':!![]}];}return db['FaxAccount'][_0x9cc9('0x54')](_0x580a5c);})['then'](function(_0x3f2cb9){_0xb8d50e['rows']=_0x3f2cb9;return _0xb8d50e;})[_0x9cc9('0x1b')](respondWithFilteredResult(_0x32ea3f,_0x580a5c))[_0x9cc9('0x26')](handleError(_0x32ea3f,null));};exports[_0x9cc9('0x55')]=function(_0x5a4dd7,_0x18ccc9){var _0x131e9c={'raw':![],'where':{'id':_0x5a4dd7[_0x9cc9('0x56')]['id']},'include':[{'model':db[_0x9cc9('0x3b')],'as':'mandatoryDispositionPause'}]},_0x370593={};_0x370593['model']=_[_0x9cc9('0x43')](db[_0x9cc9('0x3d')][_0x9cc9('0x3e')]);_0x370593[_0x9cc9('0x42')]=_['keys'](_0x5a4dd7[_0x9cc9('0x42')]);_0x370593[_0x9cc9('0x44')]=_['intersection'](_0x370593[_0x9cc9('0x41')],_0x370593[_0x9cc9('0x42')]);_0x131e9c[_0x9cc9('0x47')]=_[_0x9cc9('0x45')](_0x370593[_0x9cc9('0x41')],qs['fields'](_0x5a4dd7[_0x9cc9('0x42')][_0x9cc9('0x46')]));_0x131e9c[_0x9cc9('0x47')]=_0x131e9c[_0x9cc9('0x47')]['length']?_0x131e9c[_0x9cc9('0x47')]:_0x370593[_0x9cc9('0x41')];if(_0x5a4dd7['query']['includeAll']){_0x131e9c[_0x9cc9('0x53')]=[{'all':!![]}];}_0x131e9c=_[_0x9cc9('0x4e')]({},_0x131e9c,_0x5a4dd7[_0x9cc9('0x57')]);return db[_0x9cc9('0x3d')][_0x9cc9('0x58')](_0x131e9c)['then'](handleEntityNotFound(_0x18ccc9,null))[_0x9cc9('0x1b')](respondWithResult(_0x18ccc9,null))['catch'](handleError(_0x18ccc9,null));};exports[_0x9cc9('0x59')]=function(_0x5c4723,_0x5a3589){return db[_0x9cc9('0x3d')][_0x9cc9('0x59')](_0x5c4723[_0x9cc9('0x5a')],{})[_0x9cc9('0x1b')](function(_0x3fcbb2){var _0x89f67b=_0x5c4723[_0x9cc9('0x5b')]['get']({'plain':!![]});if(!_0x89f67b)throw new Error(_0x9cc9('0x5c'));if(_0x89f67b[_0x9cc9('0x5d')]==='user'){var _0x44c5fa=_0x3fcbb2['get']({'plain':!![]});var _0x5d0db4=_0x9cc9('0x35');return db['UserProfileSection']['find']({'where':{'name':_0x5d0db4,'userProfileId':_0x89f67b[_0x9cc9('0x5e')]},'raw':!![]})[_0x9cc9('0x1b')](function(_0x14d4f1){if(_0x14d4f1&&_0x14d4f1['autoAssociation']===0x0){return db['UserProfileResource'][_0x9cc9('0x59')]({'name':_0x44c5fa[_0x9cc9('0x38')],'resourceId':_0x44c5fa['id'],'type':_0x14d4f1[_0x9cc9('0x38')],'sectionId':_0x14d4f1['id']},{})[_0x9cc9('0x1b')](function(){return _0x3fcbb2;});}else{return _0x3fcbb2;}})[_0x9cc9('0x26')](function(_0x26c316){logger[_0x9cc9('0x20')](_0x9cc9('0x5f'),_0x26c316);throw _0x26c316;});}return _0x3fcbb2;})[_0x9cc9('0x1b')](respondWithResult(_0x5a3589,0xc9))[_0x9cc9('0x26')](handleError(_0x5a3589,null));};exports['update']=function(_0x4d13ea,_0x199ef5){if(_0x4d13ea['body']['id']){delete _0x4d13ea[_0x9cc9('0x5a')]['id'];}return db[_0x9cc9('0x3d')][_0x9cc9('0x58')]({'where':{'id':_0x4d13ea[_0x9cc9('0x56')]['id']},'include':[{'model':db[_0x9cc9('0x3b')],'as':_0x9cc9('0x3c')}]})['then'](handleEntityNotFound(_0x199ef5,null))['then'](saveUpdates(_0x4d13ea[_0x9cc9('0x5a')],null))[_0x9cc9('0x1b')](respondWithResult(_0x199ef5,null))['catch'](handleError(_0x199ef5,null));};exports['destroy']=function(_0x15b48c,_0x4704bc){return db['FaxAccount'][_0x9cc9('0x58')]({'where':{'id':_0x15b48c['params']['id']}})['then'](handleEntityNotFound(_0x4704bc,null))[_0x9cc9('0x1b')](removeEntity(_0x4704bc,null))[_0x9cc9('0x26')](handleError(_0x4704bc,null));};exports[_0x9cc9('0x60')]=function(_0x30116e,_0x55979f){return db['FaxAccount']['describe']()['then'](respondWithResult(_0x55979f,null))[_0x9cc9('0x26')](handleError(_0x55979f,null));};exports[_0x9cc9('0x61')]=function(_0x8b2214,_0x222666,_0x504246){if(_0x8b2214[_0x9cc9('0x5a')]['id']){delete _0x8b2214[_0x9cc9('0x5a')]['id'];}return db[_0x9cc9('0x3d')]['find']({'where':{'id':_0x8b2214[_0x9cc9('0x56')]['id']}})[_0x9cc9('0x1b')](handleEntityNotFound(_0x222666,null))[_0x9cc9('0x1b')](function(_0x364837){if(_0x364837){_0x8b2214[_0x9cc9('0x5a')][_0x9cc9('0x62')]=_0x364837['id'];return db[_0x9cc9('0x63')][_0x9cc9('0x59')](_0x8b2214[_0x9cc9('0x5a')]);}})[_0x9cc9('0x1b')](respondWithResult(_0x222666,null))[_0x9cc9('0x26')](handleError(_0x222666,null));};exports[_0x9cc9('0x64')]=function(_0x3d15cb,_0x4b02ff,_0x380dd3){var _0x544c96={'raw':![],'where':{}};var _0x51a823={};var _0x56b432={'count':0x0,'rows':[]};return db[_0x9cc9('0x3d')]['findOne']({'where':{'id':_0x3d15cb[_0x9cc9('0x56')]['id']}})['then'](handleEntityNotFound(_0x4b02ff,null))[_0x9cc9('0x1b')](function(_0xc7b5fd){if(_0xc7b5fd){_0x51a823['model']=_['keys'](db[_0x9cc9('0x63')][_0x9cc9('0x3e')]);_0x51a823['query']=_['keys'](_0x3d15cb[_0x9cc9('0x42')]);_0x51a823[_0x9cc9('0x44')]=_[_0x9cc9('0x45')](_0x51a823[_0x9cc9('0x41')],_0x51a823[_0x9cc9('0x42')]);_0x544c96[_0x9cc9('0x47')]=_['intersection'](_0x51a823[_0x9cc9('0x41')],qs[_0x9cc9('0x46')](_0x3d15cb['query']['fields']));_0x544c96[_0x9cc9('0x47')]=_0x544c96[_0x9cc9('0x47')][_0x9cc9('0x65')]?_0x544c96[_0x9cc9('0x47')]:_0x51a823[_0x9cc9('0x41')];if(!_0x3d15cb[_0x9cc9('0x42')][_0x9cc9('0x48')](_0x9cc9('0x49'))){_0x544c96[_0x9cc9('0x2d')]=qs[_0x9cc9('0x2d')](_0x3d15cb['query'][_0x9cc9('0x2d')]);_0x544c96[_0x9cc9('0x2b')]=qs[_0x9cc9('0x2b')](_0x3d15cb['query'][_0x9cc9('0x2b')]);}_0x544c96[_0x9cc9('0x4a')]=qs[_0x9cc9('0x4b')](_0x3d15cb[_0x9cc9('0x42')][_0x9cc9('0x4b')]);_0x544c96[_0x9cc9('0x4c')]=qs[_0x9cc9('0x44')](_[_0x9cc9('0x4d')](_0x3d15cb['query'],_0x51a823['filters']));_0x544c96[_0x9cc9('0x4c')][_0x9cc9('0x62')]=_0xc7b5fd['id'];if(_0x3d15cb[_0x9cc9('0x42')][_0x9cc9('0x51')]){_0x544c96[_0x9cc9('0x4c')]=_[_0x9cc9('0x4e')](_0x544c96[_0x9cc9('0x4c')],{'$or':_[_0x9cc9('0x4f')](_0x544c96[_0x9cc9('0x47')],function(_0x2f1684){var _0x15a1f0={};_0x15a1f0[_0x2f1684]={'$like':'%'+_0x3d15cb['query']['filter']+'%'};return _0x15a1f0;})});}_0x544c96=_[_0x9cc9('0x4e')]({},_0x544c96,_0x3d15cb[_0x9cc9('0x57')]);return db['Disposition'][_0x9cc9('0x2e')]({'where':_0x544c96[_0x9cc9('0x4c')]})[_0x9cc9('0x1b')](function(_0x1cb788){_0x56b432['count']=_0x1cb788;if(_0x3d15cb[_0x9cc9('0x42')][_0x9cc9('0x52')]){_0x544c96[_0x9cc9('0x53')]=[{'all':!![]}];}return db[_0x9cc9('0x63')][_0x9cc9('0x54')](_0x544c96);})[_0x9cc9('0x1b')](function(_0x3d2099){_0x56b432['rows']=_0x3d2099;return _0x56b432;});}})[_0x9cc9('0x1b')](respondWithFilteredResult(_0x4b02ff,_0x544c96))[_0x9cc9('0x26')](handleError(_0x4b02ff,null));};exports[_0x9cc9('0x66')]=function(_0x43b941,_0x2fa0a4,_0x50f502){return db['FaxAccount']['find']({'where':{'id':_0x43b941['params']['id']}})[_0x9cc9('0x1b')](handleEntityNotFound(_0x2fa0a4,null))[_0x9cc9('0x1b')](function(_0x31c5d8){if(_0x31c5d8){return _0x31c5d8[_0x9cc9('0x66')](_0x43b941[_0x9cc9('0x42')][_0x9cc9('0x67')]);}})['then'](respondWithStatusCode(_0x2fa0a4,null))['catch'](handleError(_0x2fa0a4,null));};exports[_0x9cc9('0x68')]=function(_0x4ba244,_0x4e117e,_0x48f0f6){if(_0x4ba244['body']['id']){delete _0x4ba244[_0x9cc9('0x5a')]['id'];}return db[_0x9cc9('0x3d')][_0x9cc9('0x58')]({'where':{'id':_0x4ba244[_0x9cc9('0x56')]['id']}})[_0x9cc9('0x1b')](handleEntityNotFound(_0x4e117e,null))[_0x9cc9('0x1b')](function(_0x581828){if(_0x581828){_0x4ba244[_0x9cc9('0x5a')]['FaxAccountId']=_0x581828['id'];return db['CannedAnswer'][_0x9cc9('0x59')](_0x4ba244['body']);}})[_0x9cc9('0x1b')](respondWithResult(_0x4e117e,null))[_0x9cc9('0x26')](handleError(_0x4e117e,null));};exports[_0x9cc9('0x69')]=function(_0x4c73e9,_0x1cb639,_0x3c3082){var _0x1df7af={'raw':![],'where':{}};var _0x1cb7d7={};var _0x2afd92={'count':0x0,'rows':[]};return db[_0x9cc9('0x3d')]['findOne']({'where':{'id':_0x4c73e9[_0x9cc9('0x56')]['id']}})['then'](handleEntityNotFound(_0x1cb639,null))['then'](function(_0x428e){if(_0x428e){_0x1cb7d7[_0x9cc9('0x41')]=_['keys'](db[_0x9cc9('0x6a')][_0x9cc9('0x3e')]);_0x1cb7d7[_0x9cc9('0x42')]=_[_0x9cc9('0x43')](_0x4c73e9['query']);_0x1cb7d7['filters']=_[_0x9cc9('0x45')](_0x1cb7d7[_0x9cc9('0x41')],_0x1cb7d7[_0x9cc9('0x42')]);_0x1df7af[_0x9cc9('0x47')]=_['intersection'](_0x1cb7d7[_0x9cc9('0x41')],qs[_0x9cc9('0x46')](_0x4c73e9['query'][_0x9cc9('0x46')]));_0x1df7af[_0x9cc9('0x47')]=_0x1df7af['attributes'][_0x9cc9('0x65')]?_0x1df7af[_0x9cc9('0x47')]:_0x1cb7d7[_0x9cc9('0x41')];if(!_0x4c73e9[_0x9cc9('0x42')][_0x9cc9('0x48')]('nolimit')){_0x1df7af[_0x9cc9('0x2d')]=qs[_0x9cc9('0x2d')](_0x4c73e9[_0x9cc9('0x42')][_0x9cc9('0x2d')]);_0x1df7af['offset']=qs[_0x9cc9('0x2b')](_0x4c73e9[_0x9cc9('0x42')][_0x9cc9('0x2b')]);}_0x1df7af['order']=qs['sort'](_0x4c73e9[_0x9cc9('0x42')][_0x9cc9('0x4b')]);_0x1df7af[_0x9cc9('0x4c')]=qs['filters'](_[_0x9cc9('0x4d')](_0x4c73e9['query'],_0x1cb7d7[_0x9cc9('0x44')]));_0x1df7af['where'][_0x9cc9('0x62')]=_0x428e['id'];if(_0x4c73e9[_0x9cc9('0x42')][_0x9cc9('0x51')]){_0x1df7af['where']=_[_0x9cc9('0x4e')](_0x1df7af['where'],{'$or':_['map'](_0x1df7af['attributes'],function(_0xa260a){var _0x1934ff={};_0x1934ff[_0xa260a]={'$like':'%'+_0x4c73e9[_0x9cc9('0x42')]['filter']+'%'};return _0x1934ff;})});}_0x1df7af=_['merge']({},_0x1df7af,_0x4c73e9[_0x9cc9('0x57')]);return db[_0x9cc9('0x6a')][_0x9cc9('0x2e')]({'where':_0x1df7af[_0x9cc9('0x4c')]})[_0x9cc9('0x1b')](function(_0x4e8384){_0x2afd92['count']=_0x4e8384;if(_0x4c73e9[_0x9cc9('0x42')]['includeAll']){_0x1df7af['include']=[{'all':!![]}];}return db[_0x9cc9('0x6a')][_0x9cc9('0x54')](_0x1df7af);})[_0x9cc9('0x1b')](function(_0x16ceae){_0x2afd92['rows']=_0x16ceae;return _0x2afd92;});}})[_0x9cc9('0x1b')](respondWithFilteredResult(_0x1cb639,_0x1df7af))['catch'](handleError(_0x1cb639,null));};exports[_0x9cc9('0x6b')]=function(_0x56801,_0x32c4a2,_0x58d02e){return db[_0x9cc9('0x3d')][_0x9cc9('0x58')]({'where':{'id':_0x56801[_0x9cc9('0x56')]['id']}})['then'](handleEntityNotFound(_0x32c4a2,null))[_0x9cc9('0x1b')](function(_0x470de5){if(_0x470de5){return _0x470de5[_0x9cc9('0x6b')](_0x56801[_0x9cc9('0x42')][_0x9cc9('0x67')]);}})['then'](respondWithStatusCode(_0x32c4a2,null))[_0x9cc9('0x26')](handleError(_0x32c4a2,null));};exports[_0x9cc9('0x6c')]=function(_0x321c05,_0x14004d,_0x2c9edf){return db[_0x9cc9('0x6d')][_0x9cc9('0x58')]({'where':{'id':_0x321c05[_0x9cc9('0x56')]['id']}})['then'](handleEntityNotFound(_0x14004d,null))[_0x9cc9('0x1b')](function(_0x4e4559){if(_0x4e4559){return _0x4e4559[_0x9cc9('0x6c')](_0x321c05['body'][_0x9cc9('0x67')],_['omit'](_0x321c05['body'],[_0x9cc9('0x67'),'id'])||{});}})[_0x9cc9('0x1b')](respondWithResult(_0x14004d,null))['catch'](handleError(_0x14004d,null));};exports[_0x9cc9('0x6e')]=function(_0x5c4337,_0x2ba567,_0x49e8d5){var _0xc09799={'raw':![],'where':{}};var _0x512e91={};var _0x409827={'count':0x0,'rows':[]};return db[_0x9cc9('0x3d')][_0x9cc9('0x6f')]({'where':{'id':_0x5c4337['params']['id']}})[_0x9cc9('0x1b')](handleEntityNotFound(_0x2ba567,null))[_0x9cc9('0x1b')](function(_0x4b2e79){if(_0x4b2e79){_0x512e91[_0x9cc9('0x41')]=_[_0x9cc9('0x43')](db[_0x9cc9('0x6d')]['rawAttributes']);_0x512e91[_0x9cc9('0x42')]=_['keys'](_0x5c4337[_0x9cc9('0x42')]);_0x512e91[_0x9cc9('0x44')]=_[_0x9cc9('0x45')](_0x512e91[_0x9cc9('0x41')],_0x512e91[_0x9cc9('0x42')]);_0xc09799['attributes']=_[_0x9cc9('0x45')](_0x512e91['model'],qs['fields'](_0x5c4337[_0x9cc9('0x42')][_0x9cc9('0x46')]));_0xc09799[_0x9cc9('0x47')]=_0xc09799[_0x9cc9('0x47')]['length']?_0xc09799[_0x9cc9('0x47')]:_0x512e91[_0x9cc9('0x41')];if(!_0x5c4337[_0x9cc9('0x42')][_0x9cc9('0x48')](_0x9cc9('0x49'))){_0xc09799[_0x9cc9('0x2d')]=qs[_0x9cc9('0x2d')](_0x5c4337['query'][_0x9cc9('0x2d')]);_0xc09799[_0x9cc9('0x2b')]=qs['offset'](_0x5c4337[_0x9cc9('0x42')]['offset']);}_0xc09799['order']=qs[_0x9cc9('0x4b')](_0x5c4337[_0x9cc9('0x42')][_0x9cc9('0x4b')]);_0xc09799[_0x9cc9('0x4c')]=qs[_0x9cc9('0x44')](_[_0x9cc9('0x4d')](_0x5c4337[_0x9cc9('0x42')],_0x512e91[_0x9cc9('0x44')]));_0xc09799[_0x9cc9('0x4c')]['FaxAccountId']=_0x4b2e79['id'];if(_0x5c4337['query'][_0x9cc9('0x51')]){_0xc09799[_0x9cc9('0x4c')]=_['merge'](_0xc09799['where'],{'$or':_[_0x9cc9('0x4f')](_0xc09799[_0x9cc9('0x47')],function(_0x3dd140){var _0x43347a={};_0x43347a[_0x3dd140]={'$like':'%'+_0x5c4337[_0x9cc9('0x42')][_0x9cc9('0x51')]+'%'};return _0x43347a;})});}_0xc09799=_[_0x9cc9('0x4e')]({},_0xc09799,_0x5c4337[_0x9cc9('0x57')]);return db[_0x9cc9('0x6d')]['count']({'where':_0xc09799[_0x9cc9('0x4c')]})[_0x9cc9('0x1b')](function(_0x54b3a7){_0x409827[_0x9cc9('0x2e')]=_0x54b3a7;if(_0x5c4337[_0x9cc9('0x42')][_0x9cc9('0x52')]){_0xc09799['include']=[{'model':db['CmContact'],'as':_0x9cc9('0x70'),'required':![]},{'model':db[_0x9cc9('0x71')],'as':_0x9cc9('0x72'),'attributes':[_0x9cc9('0x38'),_0x9cc9('0x73'),_0x9cc9('0x74')],'required':![]},{'model':db['Tag'],'as':_0x9cc9('0x75'),'attributes':['id','name','color'],'where':_0x5c4337['query']['tag']?{'id':_0x5c4337['query'][_0x9cc9('0x76')]}:undefined,'required':_0x5c4337[_0x9cc9('0x42')]['tag']?!![]:![]}];}return db[_0x9cc9('0x6d')][_0x9cc9('0x54')](_0xc09799);})[_0x9cc9('0x1b')](function(_0x26904a){_0x409827['rows']=_0x26904a;return _0x409827;});}})['then'](respondWithFilteredResult(_0x2ba567,_0xc09799))[_0x9cc9('0x26')](handleError(_0x2ba567,null));};exports[_0x9cc9('0x77')]=function(_0x37b0c5,_0x6149e9,_0x209e4f){return db['FaxAccount'][_0x9cc9('0x6f')]({'where':{'id':_0x37b0c5['params']['id']}})[_0x9cc9('0x1b')](handleEntityNotFound(_0x6149e9,null))['then'](function(_0x348eab){if(_0x348eab){return db['sequelize'][_0x9cc9('0x78')](function(_0x231243){return db[_0x9cc9('0x79')][_0x9cc9('0x33')]({'where':{'FaxAccountId':_0x37b0c5[_0x9cc9('0x56')]['id']},'transaction':_0x231243})[_0x9cc9('0x1b')](function(_0x14e2f3){var _0x23827d=_[_0x9cc9('0x4f')](_0x37b0c5['body'],function(_0x37106e){_0x37106e[_0x9cc9('0x62')]=_0x37b0c5[_0x9cc9('0x56')]['id'];return _0x37106e;});return db[_0x9cc9('0x79')][_0x9cc9('0x7a')](_0x23827d,{'transaction':_0x231243});});})[_0x9cc9('0x1b')](function(){return db[_0x9cc9('0x79')][_0x9cc9('0x7b')]({'where':{'FaxAccountId':_0x37b0c5[_0x9cc9('0x56')]['id']},'order':_0x9cc9('0x7c')});});}})[_0x9cc9('0x1b')](respondWithResult(_0x6149e9,null))[_0x9cc9('0x26')](handleError(_0x6149e9,null));};exports[_0x9cc9('0x7d')]=function(_0x22d63f,_0x5b03af,_0x11cf48){var _0x11c56c={};var _0x4bc55f={};var _0x5351a3;var _0x1dc564;return db[_0x9cc9('0x3d')][_0x9cc9('0x6f')]({'where':{'id':_0x22d63f[_0x9cc9('0x56')]['id']}})[_0x9cc9('0x1b')](handleEntityNotFound(_0x5b03af,null))[_0x9cc9('0x1b')](function(_0x258b55){if(_0x258b55){_0x5351a3=_0x258b55;_0x4bc55f[_0x9cc9('0x41')]=_[_0x9cc9('0x43')](db[_0x9cc9('0x79')]['rawAttributes']);_0x4bc55f['query']=_[_0x9cc9('0x43')](_0x22d63f[_0x9cc9('0x42')]);_0x4bc55f[_0x9cc9('0x44')]=_['intersection'](_0x4bc55f[_0x9cc9('0x41')],_0x4bc55f[_0x9cc9('0x42')]);_0x11c56c['attributes']=_[_0x9cc9('0x45')](_0x4bc55f[_0x9cc9('0x41')],qs[_0x9cc9('0x46')](_0x22d63f[_0x9cc9('0x42')][_0x9cc9('0x46')]));_0x11c56c['attributes']=_0x11c56c['attributes'][_0x9cc9('0x65')]?_0x11c56c[_0x9cc9('0x47')]:_0x4bc55f[_0x9cc9('0x41')];_0x11c56c[_0x9cc9('0x4a')]=qs[_0x9cc9('0x4b')](_0x22d63f[_0x9cc9('0x42')][_0x9cc9('0x4b')]);_0x11c56c['where']=qs['filters'](_[_0x9cc9('0x4d')](_0x22d63f[_0x9cc9('0x42')],_0x4bc55f[_0x9cc9('0x44')]));if(_0x22d63f['query']['filter']){_0x11c56c['where']=_['merge'](_0x11c56c[_0x9cc9('0x4c')],{'$or':_[_0x9cc9('0x4f')](_0x11c56c[_0x9cc9('0x47')],function(_0x35327b){var _0x544add={};_0x544add[_0x35327b]={'$like':'%'+_0x22d63f[_0x9cc9('0x42')][_0x9cc9('0x51')]+'%'};return _0x544add;})});}_0x11c56c=_[_0x9cc9('0x4e')]({},_0x11c56c,_0x22d63f[_0x9cc9('0x57')]);return _0x5351a3[_0x9cc9('0x7d')](_0x11c56c);}})['then'](function(_0x2cabe5){if(_0x2cabe5){_0x1dc564=_0x2cabe5[_0x9cc9('0x65')];if(!_0x22d63f[_0x9cc9('0x42')]['hasOwnProperty'](_0x9cc9('0x49'))){_0x11c56c[_0x9cc9('0x2d')]=qs[_0x9cc9('0x2d')](_0x22d63f[_0x9cc9('0x42')][_0x9cc9('0x2d')]);_0x11c56c[_0x9cc9('0x2b')]=qs['offset'](_0x22d63f[_0x9cc9('0x42')][_0x9cc9('0x2b')]);}return _0x5351a3[_0x9cc9('0x7d')](_0x11c56c);}})[_0x9cc9('0x1b')](function(_0x56e8fa){if(_0x56e8fa){return _0x56e8fa?{'count':_0x1dc564,'rows':_0x56e8fa}:null;}})[_0x9cc9('0x1b')](respondWithResult(_0x5b03af,null))[_0x9cc9('0x26')](handleError(_0x5b03af,null));};function Extension(_0x56d748,_0xd095e3,_0x4f5d7f,_0x2075d6){this['context']=_0x9cc9('0x7e');this[_0x9cc9('0x7f')]=_0x56d748['localstationid'];this[_0x9cc9('0x80')]=_0x2075d6;this[_0x9cc9('0x40')]=_0x9cc9('0x81');this[_0x9cc9('0x82')]='Fax\x20Extension';this[_0x9cc9('0x62')]=_0x56d748['id'];this[_0x9cc9('0x7c')]=_0xd095e3;this[_0x9cc9('0x83')]=_0x4f5d7f;}function createExtensionsReciveFax(_0x47ad47){var _0x3dffe0=0x1;var _0x1e7a42=[];_0x1e7a42[_0x9cc9('0x84')](new Extension(_0x47ad47,_0x3dffe0,'',_0x9cc9('0x85')));_0x3dffe0+=0x1;_0x1e7a42[_0x9cc9('0x84')](new Extension(_0x47ad47,_0x3dffe0,'CDR(type)=inbound-fax','Set'));_0x3dffe0+=0x1;for(var _0x198cd5 in _0x47ad47){if(_0x47ad47['hasOwnProperty'](_0x198cd5)&&(_0x198cd5===_0x9cc9('0x86')||_0x198cd5===_0x9cc9('0x87')||_0x198cd5===_0x9cc9('0x88')||_0x198cd5===_0x9cc9('0x89')||_0x198cd5===_0x9cc9('0x8a')||_0x198cd5===_0x9cc9('0x8b')||_0x198cd5===_0x9cc9('0x8c')||_0x198cd5===_0x9cc9('0x8d')||_0x198cd5==='t38timeout')){_0x1e7a42['push'](new Extension(_0x47ad47,_0x3dffe0,_0x9cc9('0x8e')+_0x198cd5+')='+_0x47ad47[_0x198cd5],_0x9cc9('0x8f')));_0x3dffe0+=0x1;}}_0x1e7a42[_0x9cc9('0x84')](new Extension(_0x47ad47,_0x3dffe0,'6',_0x9cc9('0x90')));_0x3dffe0+=0x1;_0x1e7a42[_0x9cc9('0x84')](new Extension(_0x47ad47,_0x3dffe0,_0x9cc9('0x91'),'ReceiveFax'));_0x3dffe0=0x0;return _0x1e7a42;}exports[_0x9cc9('0x92')]=function(_0x100b4c,_0x575d44,_0x302880){var _0x17798a;return db[_0x9cc9('0x93')][_0x9cc9('0x78')](function(_0xf6755e){return db[_0x9cc9('0x3d')][_0x9cc9('0x59')](_0x100b4c[_0x9cc9('0x5a')],{'transaction':_0xf6755e})[_0x9cc9('0x1b')](function(_0x39f97f){_0x17798a=_0x39f97f[_0x9cc9('0x34')]({'plain':!![]});return db[_0x9cc9('0x94')][_0x9cc9('0x7a')](createExtensionsReciveFax(_0x17798a),{'transaction':_0xf6755e});});})[_0x9cc9('0x1b')](function(){return _0x17798a;})[_0x9cc9('0x1b')](respondWithResult(_0x575d44,null))['catch'](handleError(_0x575d44,null));};exports['updateAccountApplications']=function(_0x81add3,_0x30ecf5,_0x4d5c8e){var _0x3e69c9;return db['sequelize'][_0x9cc9('0x78')](function(_0x4b047c){return db[_0x9cc9('0x3d')]['update'](_0x81add3[_0x9cc9('0x5a')],{'where':{'id':_0x81add3[_0x9cc9('0x5a')]['id']},'transaction':_0x4b047c})['then'](function(_0x36bcea){return db[_0x9cc9('0x94')][_0x9cc9('0x33')]({'where':{'FaxAccountId':_0x81add3[_0x9cc9('0x5a')]['id']},'transaction':_0x4b047c})[_0x9cc9('0x1b')](function(_0x21299f){return db[_0x9cc9('0x94')][_0x9cc9('0x7a')](createExtensionsReciveFax(_[_0x9cc9('0x95')](_0x81add3[_0x9cc9('0x5a')],['tech',_0x9cc9('0x96'),_0x9cc9('0x97'),'updatedAt',_0x9cc9('0x98'),'ListId'])),{'transaction':_0x4b047c});});});})['then'](function(){return db[_0x9cc9('0x3d')][_0x9cc9('0x99')](_0x81add3[_0x9cc9('0x5a')]['id']);})[_0x9cc9('0x1b')](respondWithResult(_0x30ecf5,null))['catch'](handleError(_0x30ecf5,null));};exports['getMessages']=function(_0x1b67be,_0x52d4ad,_0x14ea7c){var _0xc4e6a0={'raw':!![],'where':{}};var _0x3c9f2f={};var _0x362def={'count':0x0,'rows':[]};return db[_0x9cc9('0x3d')][_0x9cc9('0x6f')]({'where':{'id':_0x1b67be[_0x9cc9('0x56')]['id']}})[_0x9cc9('0x1b')](handleEntityNotFound(_0x52d4ad,null))[_0x9cc9('0x1b')](function(_0xb89fd6){if(_0xb89fd6){_0x3c9f2f[_0x9cc9('0x41')]=_[_0x9cc9('0x43')](db['FaxMessage'][_0x9cc9('0x3e')]);_0x3c9f2f[_0x9cc9('0x42')]=_['keys'](_0x1b67be[_0x9cc9('0x42')]);_0x3c9f2f[_0x9cc9('0x44')]=_[_0x9cc9('0x45')](_0x3c9f2f[_0x9cc9('0x41')],_0x3c9f2f[_0x9cc9('0x42')]);_0xc4e6a0['attributes']=_[_0x9cc9('0x45')](_0x3c9f2f[_0x9cc9('0x41')],qs[_0x9cc9('0x46')](_0x1b67be[_0x9cc9('0x42')][_0x9cc9('0x46')]));_0xc4e6a0['attributes']=_0xc4e6a0[_0x9cc9('0x47')][_0x9cc9('0x65')]?_0xc4e6a0[_0x9cc9('0x47')]:_0x3c9f2f['model'];if(!_0x1b67be[_0x9cc9('0x42')][_0x9cc9('0x48')](_0x9cc9('0x49'))){_0xc4e6a0[_0x9cc9('0x2d')]=qs[_0x9cc9('0x2d')](_0x1b67be[_0x9cc9('0x42')][_0x9cc9('0x2d')]);_0xc4e6a0[_0x9cc9('0x2b')]=qs[_0x9cc9('0x2b')](_0x1b67be[_0x9cc9('0x42')][_0x9cc9('0x2b')]);}_0xc4e6a0[_0x9cc9('0x4a')]=qs['sort'](_0x1b67be['query'][_0x9cc9('0x4b')]);_0xc4e6a0[_0x9cc9('0x4c')]=qs[_0x9cc9('0x44')](_[_0x9cc9('0x4d')](_0x1b67be[_0x9cc9('0x42')],_0x3c9f2f[_0x9cc9('0x44')]));_0xc4e6a0[_0x9cc9('0x4c')][_0x9cc9('0x62')]=_0xb89fd6['id'];if(_0x1b67be[_0x9cc9('0x42')][_0x9cc9('0x51')]){_0xc4e6a0[_0x9cc9('0x4c')]=_[_0x9cc9('0x4e')](_0xc4e6a0[_0x9cc9('0x4c')],{'$or':_[_0x9cc9('0x4f')](_0xc4e6a0[_0x9cc9('0x47')],function(_0x1c516f){var _0x4f68aa={};_0x4f68aa[_0x1c516f]={'$like':'%'+_0x1b67be[_0x9cc9('0x42')][_0x9cc9('0x51')]+'%'};return _0x4f68aa;})});}if(_0x1b67be[_0x9cc9('0x42')]['$gte']){var _0x349035=_0x1b67be[_0x9cc9('0x42')][_0x9cc9('0x9a')][_0x9cc9('0x9b')](',');var _0x56d0d9={};_0x56d0d9[_0x349035[0x0]]={'$gte':moment(_0x349035[0x1])[_0x9cc9('0x9c')](_0x9cc9('0x9d'))};_0xc4e6a0['where']=_['merge'](_0xc4e6a0['where'],_0x56d0d9);}_0xc4e6a0=_[_0x9cc9('0x4e')]({},_0xc4e6a0,_0x1b67be[_0x9cc9('0x57')]);return db['FaxMessage'][_0x9cc9('0x2e')]({'where':_0xc4e6a0['where']})[_0x9cc9('0x1b')](function(_0x14b8b7){_0x362def['count']=_0x14b8b7;if(_0x1b67be['query'][_0x9cc9('0x52')]){_0xc4e6a0[_0x9cc9('0x53')]=[{'all':!![]}];}return db[_0x9cc9('0x9e')]['findAll'](_0xc4e6a0);})[_0x9cc9('0x1b')](function(_0x3084bf){_0x362def[_0x9cc9('0x9f')]=_0x3084bf;return _0x362def;});}})['then'](respondWithFilteredResult(_0x52d4ad,_0xc4e6a0))[_0x9cc9('0x26')](handleError(_0x52d4ad,null));};exports[_0x9cc9('0x39')]=function(_0x146f22,_0x532cef,_0xc5b936){var _0x48f1e1,_0x39b119={},_0x5931ca;if(_0x146f22[_0x9cc9('0x5a')]['to']){_0x5931ca=_0x146f22[_0x9cc9('0x5a')]['to'][0x0];}return db['FaxAccount'][_0x9cc9('0x58')]({'where':{'id':_0x146f22[_0x9cc9('0x56')]['id']},'include':[{'model':db[_0x9cc9('0xa0')],'as':_0x9cc9('0xa1'),'include':[{'model':db[_0x9cc9('0xa2')],'as':_0x9cc9('0xa3'),'where':{'fax':_0x5931ca},'limit':0x1,'order':[['updatedAt',_0x9cc9('0xa4')]]}]}]})[_0x9cc9('0x1b')](handleEntityNotFound(_0x532cef,null))[_0x9cc9('0x1b')](function(_0x593ada){_0x48f1e1=_0x593ada;if(_0x146f22[_0x9cc9('0x5a')][_0x9cc9('0xa5')]&&_0x146f22[_0x9cc9('0x5a')][_0x9cc9('0xa5')][_0x9cc9('0x65')]){for(var _0x3b3c15=0x0;_0x3b3c15<_0x146f22[_0x9cc9('0x5a')][_0x9cc9('0xa5')]['length'];_0x3b3c15+=0x1){_0x146f22['body'][_0x9cc9('0xa5')][_0x3b3c15]={'filename':_0x146f22[_0x9cc9('0x5a')]['attachments'][_0x3b3c15]['name'],'id':_0x146f22[_0x9cc9('0x5a')][_0x9cc9('0xa5')][_0x3b3c15]['id'],'path':path[_0x9cc9('0xa6')](config[_0x9cc9('0xa7')],_0x9cc9('0xa8'),_0x146f22[_0x9cc9('0x5a')][_0x9cc9('0xa5')][_0x3b3c15]['basename'])};}}return respondWithRpcPromise(_0x9cc9('0xa9'),_0x9cc9('0xa9'),{'FaxAccountId':_[_0x9cc9('0xaa')](_0x146f22[_0x9cc9('0x56')]['id'])?undefined:_0x146f22['params']['id'],'path':_[_0x9cc9('0xaa')](_0x146f22[_0x9cc9('0x5a')][_0x9cc9('0xa5')][0x0][_0x9cc9('0x2')])?undefined:_0x146f22['body'][_0x9cc9('0xa5')][0x0]['path'],'fax':_[_0x9cc9('0xaa')](_0x146f22['body']['to'][0x0])?undefined:_0x146f22['body']['to'][0x0]},client9002);})[_0x9cc9('0x1b')](function(){if(_0x48f1e1){if(_['isNil'](_0x146f22[_0x9cc9('0x5a')]['from'])){_0x146f22['body'][_0x9cc9('0xab')]=util['format']('\x22%s\x22\x20<%s>',_0x48f1e1['name'],_0x48f1e1['fax']);}if(_0x48f1e1[_0x9cc9('0xa1')]){if(_0x48f1e1[_0x9cc9('0xa1')][_0x9cc9('0xa3')]['length']){return _0x48f1e1[_0x9cc9('0xa1')][_0x9cc9('0xa3')][0x0];}else{return db['CmContact'][_0x9cc9('0x59')](_[_0x9cc9('0x13')](_0x146f22[_0x9cc9('0x5a')],{'firstName':_0x146f22[_0x9cc9('0x5a')]['to'][0x0],'phone':_0x146f22['body']['to'][0x0],'fax':_0x146f22[_0x9cc9('0x5a')]['to'][0x0],'ListId':_0x48f1e1[_0x9cc9('0xac')]}));}}else{throw new Error(_0x9cc9('0xad'));}}else{throw new Error(_0x9cc9('0xae'));}})[_0x9cc9('0x1b')](function(_0x544e2c){if(_0x544e2c){return db[_0x9cc9('0x6d')][_0x9cc9('0x58')]({'where':{'ContactId':_0x544e2c['id'],'closed':![],'FaxAccountId':_0x48f1e1['id']}})['then'](function(_0x2ea3ad){if(_0x2ea3ad){return[_0x2ea3ad,![]];}return db[_0x9cc9('0x6d')][_0x9cc9('0x59')]({'UserId':_0x146f22[_0x9cc9('0x5b')]['id'],'ContactId':_0x544e2c['id'],'FaxAccountId':_0x48f1e1['id'],'fax':_0x146f22[_0x9cc9('0x5a')]['to'][0x0],'firstMsgDirection':_0x9cc9('0xaf'),'Messages':[_[_0x9cc9('0x4e')](_0x146f22['body'],{'read':![],'body':_0x146f22[_0x9cc9('0x5a')][_0x9cc9('0xa5')][0x0]['filename'],'FaxAccountId':_0x48f1e1['id'],'UserId':_0x146f22[_0x9cc9('0x5b')]['id'],'ContactId':_0x544e2c['id'],'AttachmentId':_0x146f22['body'][_0x9cc9('0xa5')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x9cc9('0xb0')}]})[_0x9cc9('0x1b')](function(_0x4b9b9a){return[_0x4b9b9a,!![]];});});}else{throw new Error(_0x9cc9('0xb1'));}})[_0x9cc9('0xb2')](function(_0x55ce99,_0x85d958){if(_0x85d958){return _0x55ce99;}return db[_0x9cc9('0x9e')][_0x9cc9('0x59')]({'direction':'out','read':![],'body':_0x146f22[_0x9cc9('0x5a')][_0x9cc9('0xa5')][0x0][_0x9cc9('0xb3')],'FaxAccountId':_0x48f1e1['id'],'FaxInteractionId':_0x55ce99['id'],'UserId':_0x146f22[_0x9cc9('0x5b')]['id'],'ContactId':_0x55ce99[_0x9cc9('0xb4')],'AttachmentId':_0x146f22['body'][_0x9cc9('0xa5')][0x0]['id']})[_0x9cc9('0x1b')](function(_0x56dfac){_0x55ce99['dataValues'][_0x9cc9('0xb0')]=[];_0x55ce99['dataValues'][_0x9cc9('0xb0')]['push'](_0x56dfac[_0x9cc9('0xb5')]);return _0x55ce99;});})[_0x9cc9('0x1b')](function(_0x14926a){respondWithRpcPromise(_0x9cc9('0xb6'),_0x9cc9('0xb6'),{'FaxAccountId':_[_0x9cc9('0xaa')](_0x146f22[_0x9cc9('0x56')]['id'])?undefined:_0x146f22[_0x9cc9('0x56')]['id'],'path':_[_0x9cc9('0xaa')](_0x146f22[_0x9cc9('0x5a')]['attachments'][0x0][_0x9cc9('0x2')])?undefined:_0x146f22['body']['attachments'][0x0][_0x9cc9('0x2')],'fax':_[_0x9cc9('0xaa')](_0x146f22['body']['to'][0x0])?undefined:_0x146f22[_0x9cc9('0x5a')]['to'][0x0],'AttachmentId':_0x146f22['body']['attachments'][0x0]['id']},client9002)[_0x9cc9('0x1b')](function(_0x3bbaf8){logger['info']('SendFaxRpc,\x20%s',_0x3bbaf8);})[_0x9cc9('0x26')](function(_0x4ead56){logger[_0x9cc9('0x24')](_0x9cc9('0xb7'),_0x4ead56);});return _0x14926a;})['then'](respondWithResult(_0x532cef,null))['catch'](handleError(_0x532cef,null));};exports[_0x9cc9('0xb8')]=function(_0x271385,_0x4b6ec9,_0x118a66){return db['FaxAccount'][_0x9cc9('0x58')]({'where':{'id':_0x271385[_0x9cc9('0x56')]['id']}})[_0x9cc9('0x1b')](handleEntityNotFound(_0x4b6ec9,null))[_0x9cc9('0x1b')](function(_0x3e6fe6){if(_0x3e6fe6){return _0x3e6fe6[_0x9cc9('0xb8')](_0x271385[_0x9cc9('0x5a')][_0x9cc9('0x67')],_[_0x9cc9('0x95')](_0x271385[_0x9cc9('0x5a')],[_0x9cc9('0x67'),'id'])||{})[_0x9cc9('0xb2')](function(_0x11ad84){for(var _0x23b54c=0x0;_0x23b54c<_0x271385[_0x9cc9('0x5a')][_0x9cc9('0x67')]['length'];_0x23b54c+=0x1){socket[_0x9cc9('0xb9')](_0x9cc9('0xba'),{'UserId':Number(_0x271385[_0x9cc9('0x5a')][_0x9cc9('0x67')][_0x23b54c]),'FaxAccountId':Number(_0x271385[_0x9cc9('0x56')]['id'])});}return _0x11ad84;});}})[_0x9cc9('0x1b')](respondWithResult(_0x4b6ec9,null))[_0x9cc9('0x26')](handleError(_0x4b6ec9,null));};exports[_0x9cc9('0xbb')]=function(_0x2cad82,_0x293945,_0x53c514){return db[_0x9cc9('0x3d')]['find']({'where':{'id':_0x2cad82[_0x9cc9('0x56')]['id']}})[_0x9cc9('0x1b')](handleEntityNotFound(_0x293945,null))[_0x9cc9('0x1b')](function(_0x1d5597){if(_0x1d5597){return _0x1d5597[_0x9cc9('0xbb')](_0x2cad82[_0x9cc9('0x42')][_0x9cc9('0x67')])[_0x9cc9('0x1b')](function(){if(_[_0x9cc9('0xbc')](_0x2cad82['query'][_0x9cc9('0x67')])){for(var _0xf75e5f=0x0;_0xf75e5f<_0x2cad82[_0x9cc9('0x42')][_0x9cc9('0x67')]['length'];_0xf75e5f+=0x1){socket[_0x9cc9('0xb9')]('userFaxAccount:remove',{'UserId':Number(_0x2cad82['query']['ids'][_0xf75e5f]),'FaxAccountId':Number(_0x2cad82[_0x9cc9('0x56')]['id'])});}}else{socket[_0x9cc9('0xb9')]('userFaxAccount:remove',{'UserId':Number(_0x2cad82[_0x9cc9('0x42')][_0x9cc9('0x67')]),'FaxAccountId':Number(_0x2cad82[_0x9cc9('0x56')]['id'])});}});}})[_0x9cc9('0x1b')](respondWithStatusCode(_0x293945,null))[_0x9cc9('0x26')](handleError(_0x293945,null));};exports[_0x9cc9('0xbd')]=function(_0x29eab6,_0x9bace4,_0x18a486){var _0x5e28bb={};var _0x4d5c91={};var _0x578171;var _0x47fd52;return db['FaxAccount']['findOne']({'where':{'id':_0x29eab6['params']['id']}})[_0x9cc9('0x1b')](handleEntityNotFound(_0x9bace4,null))[_0x9cc9('0x1b')](function(_0xc56e58){if(_0xc56e58){_0x578171=_0xc56e58;_0x4d5c91['model']=_[_0x9cc9('0x43')](db['User'][_0x9cc9('0x3e')]);_0x4d5c91[_0x9cc9('0x42')]=_[_0x9cc9('0x43')](_0x29eab6[_0x9cc9('0x42')]);_0x4d5c91[_0x9cc9('0x44')]=_[_0x9cc9('0x45')](_0x4d5c91[_0x9cc9('0x41')],_0x4d5c91[_0x9cc9('0x42')]);_0x5e28bb['attributes']=_[_0x9cc9('0x45')](_0x4d5c91[_0x9cc9('0x41')],qs[_0x9cc9('0x46')](_0x29eab6['query'][_0x9cc9('0x46')]));_0x5e28bb[_0x9cc9('0x47')]=_0x5e28bb[_0x9cc9('0x47')]['length']?_0x5e28bb[_0x9cc9('0x47')]:_0x4d5c91[_0x9cc9('0x41')];_0x5e28bb[_0x9cc9('0x4a')]=qs['sort'](_0x29eab6[_0x9cc9('0x42')][_0x9cc9('0x4b')]);_0x5e28bb['where']=qs['filters'](_[_0x9cc9('0x4d')](_0x29eab6['query'],_0x4d5c91[_0x9cc9('0x44')]));if(_0x29eab6[_0x9cc9('0x42')][_0x9cc9('0x51')]){_0x5e28bb[_0x9cc9('0x4c')]=_[_0x9cc9('0x4e')](_0x5e28bb[_0x9cc9('0x4c')],{'$or':_[_0x9cc9('0x4f')](_0x5e28bb['attributes'],function(_0x34f291){var _0x3fa37d={};_0x3fa37d[_0x34f291]={'$like':'%'+_0x29eab6[_0x9cc9('0x42')][_0x9cc9('0x51')]+'%'};return _0x3fa37d;})});}_0x5e28bb=_[_0x9cc9('0x4e')]({},_0x5e28bb,_0x29eab6[_0x9cc9('0x57')]);return _0x578171['getAgents'](_0x5e28bb);}})['then'](function(_0x64a0c8){if(_0x64a0c8){_0x47fd52=_0x64a0c8[_0x9cc9('0x65')];if(!_0x29eab6[_0x9cc9('0x42')][_0x9cc9('0x48')]('nolimit')){_0x5e28bb[_0x9cc9('0x2d')]=qs[_0x9cc9('0x2d')](_0x29eab6[_0x9cc9('0x42')][_0x9cc9('0x2d')]);_0x5e28bb[_0x9cc9('0x2b')]=qs[_0x9cc9('0x2b')](_0x29eab6['query'][_0x9cc9('0x2b')]);}return _0x578171[_0x9cc9('0xbd')](_0x5e28bb);}})['then'](function(_0x3cc771){if(_0x3cc771){return _0x3cc771?{'count':_0x47fd52,'rows':_0x3cc771}:null;}})[_0x9cc9('0x1b')](respondWithResult(_0x9bace4,null))['catch'](handleError(_0x9bace4,null));}; \ No newline at end of file +var _0x8ab6=['Answer','CDR(type)=inbound-fax','Set','ecm','faxdetect','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','bulkCreate','updateAccountApplications','tech','createdAt','updatedAt','TrunkId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','CmContact','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','path','from','\x22%s\x22\x20<%s>','defaults','ListId','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','moment','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','localhost','./faxAccount.socket','client','http','then','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','FaxAccount,\x20%s,\x20%s','message','catch','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','destroy','get','FaxAccounts','UserProfileResource','name','send','Pause','map','FaxAccount','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','include','params','keys','rawAttributes','options','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','update','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','hasOwnProperty','order','pick','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','rows','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','FaxApplication','findAndCountAll','priority','getApplications','from-voip-provider','exten','localstationid','description','appdata','push'];(function(_0x19db20,_0x410d0e){var _0x4d9ba0=function(_0x22bb23){while(--_0x22bb23){_0x19db20['push'](_0x19db20['shift']());}};_0x4d9ba0(++_0x410d0e);}(_0x8ab6,0x1b3));var _0x68ab=function(_0x3840cb,_0x3697ab){_0x3840cb=_0x3840cb-0x0;var _0xe47f6f=_0x8ab6[_0x3840cb];return _0xe47f6f;};'use strict';var emlformat=require(_0x68ab('0x0'));var rimraf=require(_0x68ab('0x1'));var zipdir=require(_0x68ab('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x68ab('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x68ab('0x4'));var util=require(_0x68ab('0x5'));var path=require('path');var sox=require(_0x68ab('0x6'));var csv=require(_0x68ab('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x68ab('0x8'));var _=require('lodash');var squel=require(_0x68ab('0x9'));var crypto=require(_0x68ab('0xa'));var jsforce=require(_0x68ab('0xb'));var deskjs=require(_0x68ab('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x68ab('0xd'));var Redis=require(_0x68ab('0xe'));var authService=require(_0x68ab('0xf'));var qs=require(_0x68ab('0x10'));var as=require(_0x68ab('0x11'));var hardwareService=require(_0x68ab('0x12'));var logger=require(_0x68ab('0x13'))('api');var utils=require(_0x68ab('0x14'));var config=require(_0x68ab('0x15'));var licenseUtil=require(_0x68ab('0x16'));var db=require(_0x68ab('0x17'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x68ab('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x68ab('0x19'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x68ab('0x1a')][_0x68ab('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0xa5b3a5,_0x286989,_0x3a31fe,_0x2cea47){return new BPromise(function(_0x20f8da,_0x5ac3bc){var _0x195f5e=_0x2cea47||client;return _0x195f5e['request'](_0xa5b3a5,_0x3a31fe)[_0x68ab('0x1c')](function(_0x3323a0){logger[_0x68ab('0x1d')]('FaxAccount,\x20%s,\x20%s',_0x286989,_0x68ab('0x1e'));logger[_0x68ab('0x1f')](_0x68ab('0x20'),_0x286989,_0x68ab('0x1e'),JSON[_0x68ab('0x21')](_0x3323a0));if(_0x3323a0[_0x68ab('0x22')]){if(_0x3323a0['error']['code']===0x1f4){logger['error'](_0x68ab('0x23'),_0x286989,_0x3323a0[_0x68ab('0x22')][_0x68ab('0x24')]);return _0x5ac3bc(_0x3323a0[_0x68ab('0x22')][_0x68ab('0x24')]);}logger['error'](_0x68ab('0x23'),_0x286989,_0x3323a0[_0x68ab('0x22')][_0x68ab('0x24')]);return _0x20f8da(_0x3323a0[_0x68ab('0x22')][_0x68ab('0x24')]);}else{logger[_0x68ab('0x1d')](_0x68ab('0x23'),_0x286989,_0x68ab('0x1e'));_0x20f8da(_0x3323a0['result']['message']);}})[_0x68ab('0x25')](function(_0x4b7436){logger['error']('FaxAccount,\x20%s,\x20%s',_0x286989,_0x4b7436);_0x5ac3bc(_0x4b7436);});});}function respondWithStatusCode(_0x446d15,_0x3504de){_0x3504de=_0x3504de||0xcc;return function(_0x5b91c5){if(_0x5b91c5){return _0x446d15[_0x68ab('0x26')](_0x3504de);}return _0x446d15[_0x68ab('0x27')](_0x3504de)['end']();};}function respondWithResult(_0x37a8d4,_0x482487){_0x482487=_0x482487||0xc8;return function(_0x130025){if(_0x130025){return _0x37a8d4['status'](_0x482487)[_0x68ab('0x28')](_0x130025);}};}function respondWithFilteredResult(_0x20859f,_0x18f0d4){return function(_0xa06999){if(_0xa06999){var _0x2e83b0=typeof _0x18f0d4[_0x68ab('0x29')]==='undefined'&&typeof _0x18f0d4[_0x68ab('0x2a')]===_0x68ab('0x2b');var _0x1bd726=_0xa06999[_0x68ab('0x2c')];var _0x143626=_0x2e83b0?0x0:_0x18f0d4[_0x68ab('0x29')];var _0x138947=_0x2e83b0?_0xa06999[_0x68ab('0x2c')]:_0x18f0d4[_0x68ab('0x29')]+_0x18f0d4[_0x68ab('0x2a')];var _0x33c6d7;if(_0x138947>=_0x1bd726){_0x138947=_0x1bd726;_0x33c6d7=0xc8;}else{_0x33c6d7=0xce;}_0x20859f[_0x68ab('0x27')](_0x33c6d7);return _0x20859f['set'](_0x68ab('0x2d'),_0x143626+'-'+_0x138947+'/'+_0x1bd726)[_0x68ab('0x28')](_0xa06999);}return null;};}function patchUpdates(_0x49e842){return function(_0x264628){try{jsonpatch[_0x68ab('0x2e')](_0x264628,_0x49e842,!![]);}catch(_0x3cc24f){return BPromise[_0x68ab('0x2f')](_0x3cc24f);}return _0x264628[_0x68ab('0x30')]();};}function saveUpdates(_0x22fd08,_0x5514ef){return function(_0x339f2b){if(_0x339f2b){return _0x339f2b['update'](_0x22fd08)[_0x68ab('0x1c')](function(_0x2120cd){return _0x2120cd;});}return null;};}function removeEntity(_0x4b36b9,_0x35fe1c){return function(_0x529c99){if(_0x529c99){return _0x529c99[_0x68ab('0x31')]()[_0x68ab('0x1c')](function(){var _0x1abb4a=_0x529c99[_0x68ab('0x32')]({'plain':!![]});var _0x594828=_0x68ab('0x33');return db[_0x68ab('0x34')][_0x68ab('0x31')]({'where':{'type':_0x594828,'resourceId':_0x1abb4a['id']}})[_0x68ab('0x1c')](function(){return _0x529c99;});})['then'](function(){_0x4b36b9[_0x68ab('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40d87f,_0xc27e3){return function(_0x1ea803){if(!_0x1ea803){_0x40d87f[_0x68ab('0x26')](0x194);}return _0x1ea803;};}function handleError(_0x28fd63,_0x278530){_0x278530=_0x278530||0x1f4;return function(_0x5a02eb){logger[_0x68ab('0x22')](_0x5a02eb['stack']);if(_0x5a02eb[_0x68ab('0x35')]){delete _0x5a02eb[_0x68ab('0x35')];}_0x28fd63[_0x68ab('0x27')](_0x278530)[_0x68ab('0x36')](_0x5a02eb);};}exports['index']=function(_0x374486,_0x1b1955){var _0x1ba551={'include':[{'model':db[_0x68ab('0x37')],'as':'mandatoryDispositionPause'}]},_0x57dca3={},_0x24f8e2={'count':0x0,'rows':[]};var _0x41598f=_[_0x68ab('0x38')](db[_0x68ab('0x39')]['rawAttributes'],function(_0x36b889){return{'name':_0x36b889[_0x68ab('0x3a')],'type':_0x36b889[_0x68ab('0x3b')][_0x68ab('0x3c')]};});_0x57dca3[_0x68ab('0x3d')]=_[_0x68ab('0x38')](_0x41598f,_0x68ab('0x35'));_0x57dca3['query']=_['keys'](_0x374486[_0x68ab('0x3e')]);_0x57dca3[_0x68ab('0x3f')]=_[_0x68ab('0x40')](_0x57dca3[_0x68ab('0x3d')],_0x57dca3[_0x68ab('0x3e')]);_0x1ba551['attributes']=_[_0x68ab('0x40')](_0x57dca3[_0x68ab('0x3d')],qs['fields'](_0x374486[_0x68ab('0x3e')][_0x68ab('0x41')]));_0x1ba551['attributes']=_0x1ba551[_0x68ab('0x42')][_0x68ab('0x43')]?_0x1ba551[_0x68ab('0x42')]:_0x57dca3[_0x68ab('0x3d')];if(!_0x374486['query']['hasOwnProperty'](_0x68ab('0x44'))){_0x1ba551[_0x68ab('0x2a')]=qs[_0x68ab('0x2a')](_0x374486[_0x68ab('0x3e')][_0x68ab('0x2a')]);_0x1ba551['offset']=qs[_0x68ab('0x29')](_0x374486[_0x68ab('0x3e')][_0x68ab('0x29')]);}_0x1ba551['order']=qs['sort'](_0x374486[_0x68ab('0x3e')][_0x68ab('0x45')]);_0x1ba551[_0x68ab('0x46')]=qs['filters'](_['pick'](_0x374486[_0x68ab('0x3e')],_0x57dca3[_0x68ab('0x3f')]),_0x41598f);if(_0x374486[_0x68ab('0x3e')][_0x68ab('0x47')]){_0x1ba551[_0x68ab('0x46')]=_[_0x68ab('0x48')](_0x1ba551['where'],{'$or':_[_0x68ab('0x38')](_0x41598f,function(_0x6b6b73){if(_0x6b6b73[_0x68ab('0x3b')]!==_0x68ab('0x49')){var _0x2b5de1={};_0x2b5de1[_0x6b6b73[_0x68ab('0x35')]]={'$like':'%'+_0x374486[_0x68ab('0x3e')][_0x68ab('0x47')]+'%'};return _0x2b5de1;}})});}_0x1ba551=_[_0x68ab('0x48')]({},_0x1ba551,_0x374486['options']);var _0x22b63c={'where':_0x1ba551[_0x68ab('0x46')]};return db['FaxAccount'][_0x68ab('0x2c')](_0x22b63c)[_0x68ab('0x1c')](function(_0x458dc9){_0x24f8e2[_0x68ab('0x2c')]=_0x458dc9;if(_0x374486[_0x68ab('0x3e')][_0x68ab('0x4a')]){_0x1ba551[_0x68ab('0x4b')]=[{'all':!![]}];}return db[_0x68ab('0x39')]['findAll'](_0x1ba551);})[_0x68ab('0x1c')](function(_0x545ea0){_0x24f8e2['rows']=_0x545ea0;return _0x24f8e2;})[_0x68ab('0x1c')](respondWithFilteredResult(_0x1b1955,_0x1ba551))[_0x68ab('0x25')](handleError(_0x1b1955,null));};exports['show']=function(_0x4b47ba,_0x1b0431){var _0x264547={'raw':![],'where':{'id':_0x4b47ba[_0x68ab('0x4c')]['id']},'include':[{'model':db[_0x68ab('0x37')],'as':'mandatoryDispositionPause'}]},_0x2ac4fe={};_0x2ac4fe[_0x68ab('0x3d')]=_[_0x68ab('0x4d')](db[_0x68ab('0x39')][_0x68ab('0x4e')]);_0x2ac4fe[_0x68ab('0x3e')]=_[_0x68ab('0x4d')](_0x4b47ba[_0x68ab('0x3e')]);_0x2ac4fe[_0x68ab('0x3f')]=_[_0x68ab('0x40')](_0x2ac4fe[_0x68ab('0x3d')],_0x2ac4fe[_0x68ab('0x3e')]);_0x264547['attributes']=_[_0x68ab('0x40')](_0x2ac4fe[_0x68ab('0x3d')],qs[_0x68ab('0x41')](_0x4b47ba[_0x68ab('0x3e')]['fields']));_0x264547['attributes']=_0x264547[_0x68ab('0x42')][_0x68ab('0x43')]?_0x264547[_0x68ab('0x42')]:_0x2ac4fe['model'];if(_0x4b47ba[_0x68ab('0x3e')][_0x68ab('0x4a')]){_0x264547[_0x68ab('0x4b')]=[{'all':!![]}];}_0x264547=_[_0x68ab('0x48')]({},_0x264547,_0x4b47ba[_0x68ab('0x4f')]);return db[_0x68ab('0x39')][_0x68ab('0x50')](_0x264547)['then'](handleEntityNotFound(_0x1b0431,null))[_0x68ab('0x1c')](respondWithResult(_0x1b0431,null))['catch'](handleError(_0x1b0431,null));};exports[_0x68ab('0x51')]=function(_0x95d94,_0x4febf4){return db[_0x68ab('0x39')]['create'](_0x95d94[_0x68ab('0x52')],{})[_0x68ab('0x1c')](function(_0x5dc64c){var _0x5727b4=_0x95d94[_0x68ab('0x53')]['get']({'plain':!![]});if(!_0x5727b4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5727b4[_0x68ab('0x54')]==='user'){var _0x5d5ab7=_0x5dc64c['get']({'plain':!![]});var _0x588f1c='FaxAccounts';return db[_0x68ab('0x55')][_0x68ab('0x50')]({'where':{'name':_0x588f1c,'userProfileId':_0x5727b4[_0x68ab('0x56')]},'raw':!![]})[_0x68ab('0x1c')](function(_0xf7910b){if(_0xf7910b&&_0xf7910b[_0x68ab('0x57')]===0x0){return db[_0x68ab('0x34')]['create']({'name':_0x5d5ab7[_0x68ab('0x35')],'resourceId':_0x5d5ab7['id'],'type':_0xf7910b[_0x68ab('0x35')],'sectionId':_0xf7910b['id']},{})[_0x68ab('0x1c')](function(){return _0x5dc64c;});}else{return _0x5dc64c;}})[_0x68ab('0x25')](function(_0x2f4436){logger[_0x68ab('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2f4436);throw _0x2f4436;});}return _0x5dc64c;})[_0x68ab('0x1c')](respondWithResult(_0x4febf4,0xc9))['catch'](handleError(_0x4febf4,null));};exports[_0x68ab('0x58')]=function(_0x3e2eeb,_0x124c1c){if(_0x3e2eeb[_0x68ab('0x52')]['id']){delete _0x3e2eeb[_0x68ab('0x52')]['id'];}return db[_0x68ab('0x39')][_0x68ab('0x50')]({'where':{'id':_0x3e2eeb[_0x68ab('0x4c')]['id']},'include':[{'model':db[_0x68ab('0x37')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x124c1c,null))[_0x68ab('0x1c')](saveUpdates(_0x3e2eeb[_0x68ab('0x52')],null))[_0x68ab('0x1c')](respondWithResult(_0x124c1c,null))[_0x68ab('0x25')](handleError(_0x124c1c,null));};exports[_0x68ab('0x31')]=function(_0x409e26,_0x1aa222){return db[_0x68ab('0x39')][_0x68ab('0x50')]({'where':{'id':_0x409e26[_0x68ab('0x4c')]['id']}})[_0x68ab('0x1c')](handleEntityNotFound(_0x1aa222,null))[_0x68ab('0x1c')](removeEntity(_0x1aa222,null))[_0x68ab('0x25')](handleError(_0x1aa222,null));};exports['describe']=function(_0x541676,_0x2a7231){return db['FaxAccount'][_0x68ab('0x59')]()[_0x68ab('0x1c')](respondWithResult(_0x2a7231,null))['catch'](handleError(_0x2a7231,null));};exports[_0x68ab('0x5a')]=function(_0x40c0cd,_0x6294c,_0x119dcc){if(_0x40c0cd[_0x68ab('0x52')]['id']){delete _0x40c0cd[_0x68ab('0x52')]['id'];}return db[_0x68ab('0x39')][_0x68ab('0x50')]({'where':{'id':_0x40c0cd[_0x68ab('0x4c')]['id']}})[_0x68ab('0x1c')](handleEntityNotFound(_0x6294c,null))['then'](function(_0x48ea04){if(_0x48ea04){_0x40c0cd[_0x68ab('0x52')][_0x68ab('0x5b')]=_0x48ea04['id'];return db[_0x68ab('0x5c')]['create'](_0x40c0cd[_0x68ab('0x52')]);}})[_0x68ab('0x1c')](respondWithResult(_0x6294c,null))[_0x68ab('0x25')](handleError(_0x6294c,null));};exports[_0x68ab('0x5d')]=function(_0x31e078,_0x231261,_0x3f27b9){var _0x552a88={'raw':![],'where':{}};var _0x497171={};var _0x6148b0={'count':0x0,'rows':[]};return db[_0x68ab('0x39')][_0x68ab('0x5e')]({'where':{'id':_0x31e078[_0x68ab('0x4c')]['id']}})[_0x68ab('0x1c')](handleEntityNotFound(_0x231261,null))[_0x68ab('0x1c')](function(_0x2af463){if(_0x2af463){_0x497171[_0x68ab('0x3d')]=_[_0x68ab('0x4d')](db[_0x68ab('0x5c')][_0x68ab('0x4e')]);_0x497171['query']=_[_0x68ab('0x4d')](_0x31e078['query']);_0x497171[_0x68ab('0x3f')]=_[_0x68ab('0x40')](_0x497171[_0x68ab('0x3d')],_0x497171[_0x68ab('0x3e')]);_0x552a88[_0x68ab('0x42')]=_[_0x68ab('0x40')](_0x497171[_0x68ab('0x3d')],qs[_0x68ab('0x41')](_0x31e078[_0x68ab('0x3e')][_0x68ab('0x41')]));_0x552a88['attributes']=_0x552a88[_0x68ab('0x42')][_0x68ab('0x43')]?_0x552a88[_0x68ab('0x42')]:_0x497171[_0x68ab('0x3d')];if(!_0x31e078[_0x68ab('0x3e')][_0x68ab('0x5f')](_0x68ab('0x44'))){_0x552a88['limit']=qs[_0x68ab('0x2a')](_0x31e078[_0x68ab('0x3e')][_0x68ab('0x2a')]);_0x552a88['offset']=qs[_0x68ab('0x29')](_0x31e078['query']['offset']);}_0x552a88[_0x68ab('0x60')]=qs[_0x68ab('0x45')](_0x31e078[_0x68ab('0x3e')][_0x68ab('0x45')]);_0x552a88[_0x68ab('0x46')]=qs[_0x68ab('0x3f')](_[_0x68ab('0x61')](_0x31e078['query'],_0x497171[_0x68ab('0x3f')]));_0x552a88[_0x68ab('0x46')][_0x68ab('0x5b')]=_0x2af463['id'];if(_0x31e078[_0x68ab('0x3e')][_0x68ab('0x47')]){_0x552a88['where']=_['merge'](_0x552a88[_0x68ab('0x46')],{'$or':_[_0x68ab('0x38')](_0x552a88['attributes'],function(_0x4ca2a9){var _0x54313e={};_0x54313e[_0x4ca2a9]={'$like':'%'+_0x31e078['query'][_0x68ab('0x47')]+'%'};return _0x54313e;})});}_0x552a88=_[_0x68ab('0x48')]({},_0x552a88,_0x31e078['options']);return db['Disposition'][_0x68ab('0x2c')]({'where':_0x552a88['where']})[_0x68ab('0x1c')](function(_0x189c0e){_0x6148b0[_0x68ab('0x2c')]=_0x189c0e;if(_0x31e078['query'][_0x68ab('0x4a')]){_0x552a88[_0x68ab('0x4b')]=[{'all':!![]}];}return db['Disposition'][_0x68ab('0x62')](_0x552a88);})[_0x68ab('0x1c')](function(_0x1f3531){_0x6148b0['rows']=_0x1f3531;return _0x6148b0;});}})[_0x68ab('0x1c')](respondWithFilteredResult(_0x231261,_0x552a88))[_0x68ab('0x25')](handleError(_0x231261,null));};exports[_0x68ab('0x63')]=function(_0x128416,_0x16f2d8,_0x2d7e1d){return db[_0x68ab('0x39')][_0x68ab('0x50')]({'where':{'id':_0x128416[_0x68ab('0x4c')]['id']}})['then'](handleEntityNotFound(_0x16f2d8,null))[_0x68ab('0x1c')](function(_0x5d5b43){if(_0x5d5b43){return _0x5d5b43[_0x68ab('0x63')](_0x128416['query'][_0x68ab('0x64')]);}})[_0x68ab('0x1c')](respondWithStatusCode(_0x16f2d8,null))['catch'](handleError(_0x16f2d8,null));};exports[_0x68ab('0x65')]=function(_0x280337,_0x387dbe,_0x5d2689){if(_0x280337[_0x68ab('0x52')]['id']){delete _0x280337[_0x68ab('0x52')]['id'];}return db['FaxAccount'][_0x68ab('0x50')]({'where':{'id':_0x280337[_0x68ab('0x4c')]['id']}})[_0x68ab('0x1c')](handleEntityNotFound(_0x387dbe,null))['then'](function(_0x1d36ea){if(_0x1d36ea){_0x280337[_0x68ab('0x52')][_0x68ab('0x5b')]=_0x1d36ea['id'];return db[_0x68ab('0x66')][_0x68ab('0x51')](_0x280337[_0x68ab('0x52')]);}})[_0x68ab('0x1c')](respondWithResult(_0x387dbe,null))['catch'](handleError(_0x387dbe,null));};exports[_0x68ab('0x67')]=function(_0x59f76d,_0x27e92d,_0x373f5a){var _0x7d7883={'raw':![],'where':{}};var _0x4e9660={};var _0x268a08={'count':0x0,'rows':[]};return db[_0x68ab('0x39')][_0x68ab('0x5e')]({'where':{'id':_0x59f76d[_0x68ab('0x4c')]['id']}})[_0x68ab('0x1c')](handleEntityNotFound(_0x27e92d,null))[_0x68ab('0x1c')](function(_0x4b507f){if(_0x4b507f){_0x4e9660[_0x68ab('0x3d')]=_[_0x68ab('0x4d')](db[_0x68ab('0x66')][_0x68ab('0x4e')]);_0x4e9660[_0x68ab('0x3e')]=_['keys'](_0x59f76d[_0x68ab('0x3e')]);_0x4e9660[_0x68ab('0x3f')]=_[_0x68ab('0x40')](_0x4e9660[_0x68ab('0x3d')],_0x4e9660[_0x68ab('0x3e')]);_0x7d7883[_0x68ab('0x42')]=_[_0x68ab('0x40')](_0x4e9660[_0x68ab('0x3d')],qs[_0x68ab('0x41')](_0x59f76d[_0x68ab('0x3e')][_0x68ab('0x41')]));_0x7d7883['attributes']=_0x7d7883[_0x68ab('0x42')][_0x68ab('0x43')]?_0x7d7883[_0x68ab('0x42')]:_0x4e9660['model'];if(!_0x59f76d[_0x68ab('0x3e')]['hasOwnProperty']('nolimit')){_0x7d7883[_0x68ab('0x2a')]=qs[_0x68ab('0x2a')](_0x59f76d[_0x68ab('0x3e')][_0x68ab('0x2a')]);_0x7d7883['offset']=qs[_0x68ab('0x29')](_0x59f76d[_0x68ab('0x3e')][_0x68ab('0x29')]);}_0x7d7883[_0x68ab('0x60')]=qs['sort'](_0x59f76d[_0x68ab('0x3e')][_0x68ab('0x45')]);_0x7d7883['where']=qs[_0x68ab('0x3f')](_[_0x68ab('0x61')](_0x59f76d[_0x68ab('0x3e')],_0x4e9660[_0x68ab('0x3f')]));_0x7d7883['where'][_0x68ab('0x5b')]=_0x4b507f['id'];if(_0x59f76d[_0x68ab('0x3e')]['filter']){_0x7d7883['where']=_[_0x68ab('0x48')](_0x7d7883[_0x68ab('0x46')],{'$or':_[_0x68ab('0x38')](_0x7d7883[_0x68ab('0x42')],function(_0x1f31fe){var _0x2a71c3={};_0x2a71c3[_0x1f31fe]={'$like':'%'+_0x59f76d[_0x68ab('0x3e')]['filter']+'%'};return _0x2a71c3;})});}_0x7d7883=_[_0x68ab('0x48')]({},_0x7d7883,_0x59f76d['options']);return db[_0x68ab('0x66')][_0x68ab('0x2c')]({'where':_0x7d7883[_0x68ab('0x46')]})[_0x68ab('0x1c')](function(_0x57b646){_0x268a08[_0x68ab('0x2c')]=_0x57b646;if(_0x59f76d[_0x68ab('0x3e')][_0x68ab('0x4a')]){_0x7d7883[_0x68ab('0x4b')]=[{'all':!![]}];}return db[_0x68ab('0x66')][_0x68ab('0x62')](_0x7d7883);})[_0x68ab('0x1c')](function(_0x13765f){_0x268a08[_0x68ab('0x68')]=_0x13765f;return _0x268a08;});}})[_0x68ab('0x1c')](respondWithFilteredResult(_0x27e92d,_0x7d7883))[_0x68ab('0x25')](handleError(_0x27e92d,null));};exports[_0x68ab('0x69')]=function(_0x270084,_0x21b19c,_0xa45ae5){return db[_0x68ab('0x39')][_0x68ab('0x50')]({'where':{'id':_0x270084['params']['id']}})[_0x68ab('0x1c')](handleEntityNotFound(_0x21b19c,null))[_0x68ab('0x1c')](function(_0x2d8fa3){if(_0x2d8fa3){return _0x2d8fa3[_0x68ab('0x69')](_0x270084[_0x68ab('0x3e')][_0x68ab('0x64')]);}})['then'](respondWithStatusCode(_0x21b19c,null))[_0x68ab('0x25')](handleError(_0x21b19c,null));};exports[_0x68ab('0x6a')]=function(_0x48ffa5,_0x5a88d0,_0x826f84){return db[_0x68ab('0x6b')][_0x68ab('0x50')]({'where':{'id':_0x48ffa5['params']['id']}})[_0x68ab('0x1c')](handleEntityNotFound(_0x5a88d0,null))[_0x68ab('0x1c')](function(_0x526a72){if(_0x526a72){return _0x526a72[_0x68ab('0x6a')](_0x48ffa5[_0x68ab('0x52')][_0x68ab('0x64')],_[_0x68ab('0x6c')](_0x48ffa5['body'],[_0x68ab('0x64'),'id'])||{});}})[_0x68ab('0x1c')](respondWithResult(_0x5a88d0,null))[_0x68ab('0x25')](handleError(_0x5a88d0,null));};exports[_0x68ab('0x6d')]=function(_0x440a7f,_0x43ab65,_0x3ed021){var _0x11e488={'raw':![],'where':{}};var _0x1d6b02={};var _0x454c22={'count':0x0,'rows':[]};return db[_0x68ab('0x39')][_0x68ab('0x5e')]({'where':{'id':_0x440a7f[_0x68ab('0x4c')]['id']}})[_0x68ab('0x1c')](handleEntityNotFound(_0x43ab65,null))[_0x68ab('0x1c')](function(_0x31a37b){if(_0x31a37b){_0x1d6b02['model']=_[_0x68ab('0x4d')](db[_0x68ab('0x6b')][_0x68ab('0x4e')]);_0x1d6b02[_0x68ab('0x3e')]=_[_0x68ab('0x4d')](_0x440a7f[_0x68ab('0x3e')]);_0x1d6b02[_0x68ab('0x3f')]=_['intersection'](_0x1d6b02[_0x68ab('0x3d')],_0x1d6b02[_0x68ab('0x3e')]);_0x11e488[_0x68ab('0x42')]=_[_0x68ab('0x40')](_0x1d6b02['model'],qs[_0x68ab('0x41')](_0x440a7f['query']['fields']));_0x11e488[_0x68ab('0x42')]=_0x11e488[_0x68ab('0x42')]['length']?_0x11e488['attributes']:_0x1d6b02['model'];if(!_0x440a7f[_0x68ab('0x3e')]['hasOwnProperty']('nolimit')){_0x11e488['limit']=qs[_0x68ab('0x2a')](_0x440a7f[_0x68ab('0x3e')][_0x68ab('0x2a')]);_0x11e488[_0x68ab('0x29')]=qs[_0x68ab('0x29')](_0x440a7f['query'][_0x68ab('0x29')]);}_0x11e488[_0x68ab('0x60')]=qs[_0x68ab('0x45')](_0x440a7f[_0x68ab('0x3e')]['sort']);_0x11e488[_0x68ab('0x46')]=qs['filters'](_[_0x68ab('0x61')](_0x440a7f[_0x68ab('0x3e')],_0x1d6b02[_0x68ab('0x3f')]));_0x11e488['where'][_0x68ab('0x5b')]=_0x31a37b['id'];if(_0x440a7f[_0x68ab('0x3e')][_0x68ab('0x47')]){_0x11e488['where']=_[_0x68ab('0x48')](_0x11e488[_0x68ab('0x46')],{'$or':_[_0x68ab('0x38')](_0x11e488[_0x68ab('0x42')],function(_0x5a5aec){var _0xe416d6={};_0xe416d6[_0x5a5aec]={'$like':'%'+_0x440a7f[_0x68ab('0x3e')][_0x68ab('0x47')]+'%'};return _0xe416d6;})});}_0x11e488=_[_0x68ab('0x48')]({},_0x11e488,_0x440a7f[_0x68ab('0x4f')]);return db[_0x68ab('0x6b')]['count']({'where':_0x11e488[_0x68ab('0x46')]})[_0x68ab('0x1c')](function(_0x5e6018){_0x454c22[_0x68ab('0x2c')]=_0x5e6018;if(_0x440a7f[_0x68ab('0x3e')][_0x68ab('0x4a')]){_0x11e488[_0x68ab('0x4b')]=[{'model':db['CmContact'],'as':_0x68ab('0x6e'),'required':![]},{'model':db[_0x68ab('0x6f')],'as':_0x68ab('0x70'),'attributes':['name',_0x68ab('0x71'),_0x68ab('0x72')],'required':![]},{'model':db[_0x68ab('0x73')],'as':_0x68ab('0x74'),'attributes':['id',_0x68ab('0x35'),_0x68ab('0x75')],'where':_0x440a7f[_0x68ab('0x3e')][_0x68ab('0x76')]?{'id':_0x440a7f['query'][_0x68ab('0x76')]}:undefined,'required':_0x440a7f[_0x68ab('0x3e')]['tag']?!![]:![]}];}return db['FaxInteraction'][_0x68ab('0x62')](_0x11e488);})[_0x68ab('0x1c')](function(_0x3aebc0){_0x454c22['rows']=_0x3aebc0;return _0x454c22;});}})[_0x68ab('0x1c')](respondWithFilteredResult(_0x43ab65,_0x11e488))[_0x68ab('0x25')](handleError(_0x43ab65,null));};exports[_0x68ab('0x77')]=function(_0x199bc2,_0x590e9d,_0xb6d02c){return db[_0x68ab('0x39')][_0x68ab('0x5e')]({'where':{'id':_0x199bc2[_0x68ab('0x4c')]['id']}})['then'](handleEntityNotFound(_0x590e9d,null))['then'](function(_0x35505c){if(_0x35505c){return db[_0x68ab('0x78')][_0x68ab('0x79')](function(_0x5cab08){return db['FaxApplication'][_0x68ab('0x31')]({'where':{'FaxAccountId':_0x199bc2[_0x68ab('0x4c')]['id']},'transaction':_0x5cab08})[_0x68ab('0x1c')](function(_0x3dec5b){var _0xd6b439=_['map'](_0x199bc2[_0x68ab('0x52')],function(_0x2f410a){_0x2f410a[_0x68ab('0x5b')]=_0x199bc2[_0x68ab('0x4c')]['id'];return _0x2f410a;});return db[_0x68ab('0x7a')]['bulkCreate'](_0xd6b439,{'transaction':_0x5cab08});});})[_0x68ab('0x1c')](function(){return db[_0x68ab('0x7a')][_0x68ab('0x7b')]({'where':{'FaxAccountId':_0x199bc2[_0x68ab('0x4c')]['id']},'order':_0x68ab('0x7c')});});}})[_0x68ab('0x1c')](respondWithResult(_0x590e9d,null))[_0x68ab('0x25')](handleError(_0x590e9d,null));};exports[_0x68ab('0x7d')]=function(_0x28fdfb,_0x1bcacc,_0x2a811e){var _0x241669={};var _0x4b20ce={};var _0x338760;var _0xc6ddfe;return db['FaxAccount'][_0x68ab('0x5e')]({'where':{'id':_0x28fdfb['params']['id']}})[_0x68ab('0x1c')](handleEntityNotFound(_0x1bcacc,null))[_0x68ab('0x1c')](function(_0x563db9){if(_0x563db9){_0x338760=_0x563db9;_0x4b20ce[_0x68ab('0x3d')]=_[_0x68ab('0x4d')](db[_0x68ab('0x7a')]['rawAttributes']);_0x4b20ce['query']=_['keys'](_0x28fdfb[_0x68ab('0x3e')]);_0x4b20ce['filters']=_[_0x68ab('0x40')](_0x4b20ce[_0x68ab('0x3d')],_0x4b20ce['query']);_0x241669[_0x68ab('0x42')]=_[_0x68ab('0x40')](_0x4b20ce[_0x68ab('0x3d')],qs['fields'](_0x28fdfb[_0x68ab('0x3e')][_0x68ab('0x41')]));_0x241669['attributes']=_0x241669['attributes']['length']?_0x241669[_0x68ab('0x42')]:_0x4b20ce[_0x68ab('0x3d')];_0x241669[_0x68ab('0x60')]=qs[_0x68ab('0x45')](_0x28fdfb[_0x68ab('0x3e')]['sort']);_0x241669[_0x68ab('0x46')]=qs[_0x68ab('0x3f')](_[_0x68ab('0x61')](_0x28fdfb['query'],_0x4b20ce['filters']));if(_0x28fdfb[_0x68ab('0x3e')][_0x68ab('0x47')]){_0x241669[_0x68ab('0x46')]=_[_0x68ab('0x48')](_0x241669[_0x68ab('0x46')],{'$or':_[_0x68ab('0x38')](_0x241669[_0x68ab('0x42')],function(_0x1e2581){var _0xd635a={};_0xd635a[_0x1e2581]={'$like':'%'+_0x28fdfb[_0x68ab('0x3e')][_0x68ab('0x47')]+'%'};return _0xd635a;})});}_0x241669=_['merge']({},_0x241669,_0x28fdfb[_0x68ab('0x4f')]);return _0x338760['getApplications'](_0x241669);}})[_0x68ab('0x1c')](function(_0x46987d){if(_0x46987d){_0xc6ddfe=_0x46987d[_0x68ab('0x43')];if(!_0x28fdfb[_0x68ab('0x3e')]['hasOwnProperty'](_0x68ab('0x44'))){_0x241669['limit']=qs[_0x68ab('0x2a')](_0x28fdfb[_0x68ab('0x3e')][_0x68ab('0x2a')]);_0x241669[_0x68ab('0x29')]=qs[_0x68ab('0x29')](_0x28fdfb[_0x68ab('0x3e')]['offset']);}return _0x338760[_0x68ab('0x7d')](_0x241669);}})[_0x68ab('0x1c')](function(_0x320b90){if(_0x320b90){return _0x320b90?{'count':_0xc6ddfe,'rows':_0x320b90}:null;}})[_0x68ab('0x1c')](respondWithResult(_0x1bcacc,null))[_0x68ab('0x25')](handleError(_0x1bcacc,null));};function Extension(_0x2b09f3,_0x2d153c,_0x30a895,_0x12ef6a){this['context']=_0x68ab('0x7e');this[_0x68ab('0x7f')]=_0x2b09f3[_0x68ab('0x80')];this['app']=_0x12ef6a;this[_0x68ab('0x3b')]='system';this[_0x68ab('0x81')]='Fax\x20Extension';this['FaxAccountId']=_0x2b09f3['id'];this[_0x68ab('0x7c')]=_0x2d153c;this[_0x68ab('0x82')]=_0x30a895;}function createExtensionsReciveFax(_0x3cbafa){var _0x198082=0x1;var _0x1cc105=[];_0x1cc105[_0x68ab('0x83')](new Extension(_0x3cbafa,_0x198082,'',_0x68ab('0x84')));_0x198082+=0x1;_0x1cc105[_0x68ab('0x83')](new Extension(_0x3cbafa,_0x198082,_0x68ab('0x85'),_0x68ab('0x86')));_0x198082+=0x1;for(var _0xd92c81 in _0x3cbafa){if(_0x3cbafa[_0x68ab('0x5f')](_0xd92c81)&&(_0xd92c81===_0x68ab('0x87')||_0xd92c81===_0x68ab('0x80')||_0xd92c81==='gateway'||_0xd92c81===_0x68ab('0x88')||_0xd92c81==='headerinfo'||_0xd92c81==='maxrate'||_0xd92c81==='minrate'||_0xd92c81===_0x68ab('0x89')||_0xd92c81===_0x68ab('0x8a'))){_0x1cc105[_0x68ab('0x83')](new Extension(_0x3cbafa,_0x198082,_0x68ab('0x8b')+_0xd92c81+')='+_0x3cbafa[_0xd92c81],'Set'));_0x198082+=0x1;}}_0x1cc105[_0x68ab('0x83')](new Extension(_0x3cbafa,_0x198082,'6',_0x68ab('0x8c')));_0x198082+=0x1;_0x1cc105[_0x68ab('0x83')](new Extension(_0x3cbafa,_0x198082,_0x68ab('0x8d'),_0x68ab('0x8e')));_0x198082=0x0;return _0x1cc105;}exports[_0x68ab('0x8f')]=function(_0x4053ce,_0x198306,_0x358958){var _0x5c6fe1;return db[_0x68ab('0x78')][_0x68ab('0x79')](function(_0x46e634){return db[_0x68ab('0x39')][_0x68ab('0x51')](_0x4053ce[_0x68ab('0x52')],{'transaction':_0x46e634})['then'](function(_0x4cbadb){_0x5c6fe1=_0x4cbadb[_0x68ab('0x32')]({'plain':!![]});return db[_0x68ab('0x90')][_0x68ab('0x91')](createExtensionsReciveFax(_0x5c6fe1),{'transaction':_0x46e634});});})['then'](function(){return _0x5c6fe1;})['then'](respondWithResult(_0x198306,null))['catch'](handleError(_0x198306,null));};exports[_0x68ab('0x92')]=function(_0x208e53,_0x4c2f5b,_0x4a39bc){var _0x49810c;return db[_0x68ab('0x78')][_0x68ab('0x79')](function(_0x21cff7){return db['FaxAccount'][_0x68ab('0x58')](_0x208e53['body'],{'where':{'id':_0x208e53[_0x68ab('0x52')]['id']},'transaction':_0x21cff7})[_0x68ab('0x1c')](function(_0x106372){return db[_0x68ab('0x90')][_0x68ab('0x31')]({'where':{'FaxAccountId':_0x208e53[_0x68ab('0x52')]['id']},'transaction':_0x21cff7})[_0x68ab('0x1c')](function(_0x405b3e){return db[_0x68ab('0x90')]['bulkCreate'](createExtensionsReciveFax(_['omit'](_0x208e53[_0x68ab('0x52')],[_0x68ab('0x93'),_0x68ab('0x3c'),_0x68ab('0x94'),_0x68ab('0x95'),_0x68ab('0x96'),'ListId'])),{'transaction':_0x21cff7});});});})[_0x68ab('0x1c')](function(){return db[_0x68ab('0x39')][_0x68ab('0x97')](_0x208e53[_0x68ab('0x52')]['id']);})[_0x68ab('0x1c')](respondWithResult(_0x4c2f5b,null))[_0x68ab('0x25')](handleError(_0x4c2f5b,null));};exports[_0x68ab('0x98')]=function(_0x28d038,_0x307c60,_0x45a11b){var _0x40a36a={'raw':!![],'where':{}};var _0x50a957={};var _0x9e1df9={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x28d038['params']['id']}})[_0x68ab('0x1c')](handleEntityNotFound(_0x307c60,null))[_0x68ab('0x1c')](function(_0x4bed45){if(_0x4bed45){_0x50a957[_0x68ab('0x3d')]=_[_0x68ab('0x4d')](db[_0x68ab('0x99')][_0x68ab('0x4e')]);_0x50a957[_0x68ab('0x3e')]=_[_0x68ab('0x4d')](_0x28d038[_0x68ab('0x3e')]);_0x50a957[_0x68ab('0x3f')]=_[_0x68ab('0x40')](_0x50a957[_0x68ab('0x3d')],_0x50a957['query']);_0x40a36a['attributes']=_[_0x68ab('0x40')](_0x50a957[_0x68ab('0x3d')],qs[_0x68ab('0x41')](_0x28d038[_0x68ab('0x3e')]['fields']));_0x40a36a['attributes']=_0x40a36a[_0x68ab('0x42')][_0x68ab('0x43')]?_0x40a36a[_0x68ab('0x42')]:_0x50a957[_0x68ab('0x3d')];if(!_0x28d038['query']['hasOwnProperty']('nolimit')){_0x40a36a['limit']=qs['limit'](_0x28d038[_0x68ab('0x3e')]['limit']);_0x40a36a['offset']=qs[_0x68ab('0x29')](_0x28d038['query']['offset']);}_0x40a36a[_0x68ab('0x60')]=qs[_0x68ab('0x45')](_0x28d038['query'][_0x68ab('0x45')]);_0x40a36a['where']=qs['filters'](_[_0x68ab('0x61')](_0x28d038[_0x68ab('0x3e')],_0x50a957[_0x68ab('0x3f')]));_0x40a36a[_0x68ab('0x46')][_0x68ab('0x5b')]=_0x4bed45['id'];if(_0x28d038[_0x68ab('0x3e')][_0x68ab('0x47')]){_0x40a36a[_0x68ab('0x46')]=_[_0x68ab('0x48')](_0x40a36a['where'],{'$or':_['map'](_0x40a36a[_0x68ab('0x42')],function(_0x2d7aa5){var _0xd43dc={};_0xd43dc[_0x2d7aa5]={'$like':'%'+_0x28d038[_0x68ab('0x3e')][_0x68ab('0x47')]+'%'};return _0xd43dc;})});}if(_0x28d038[_0x68ab('0x3e')][_0x68ab('0x9a')]){var _0x2a804c=_0x28d038['query'][_0x68ab('0x9a')][_0x68ab('0x9b')](',');var _0x271a14={};_0x271a14[_0x2a804c[0x0]]={'$gte':moment(_0x2a804c[0x1])[_0x68ab('0x9c')](_0x68ab('0x9d'))};_0x40a36a[_0x68ab('0x46')]=_[_0x68ab('0x48')](_0x40a36a[_0x68ab('0x46')],_0x271a14);}_0x40a36a=_[_0x68ab('0x48')]({},_0x40a36a,_0x28d038[_0x68ab('0x4f')]);return db['FaxMessage'][_0x68ab('0x2c')]({'where':_0x40a36a[_0x68ab('0x46')]})[_0x68ab('0x1c')](function(_0x59f132){_0x9e1df9[_0x68ab('0x2c')]=_0x59f132;if(_0x28d038[_0x68ab('0x3e')]['includeAll']){_0x40a36a[_0x68ab('0x4b')]=[{'all':!![]}];}return db['FaxMessage'][_0x68ab('0x62')](_0x40a36a);})[_0x68ab('0x1c')](function(_0xe9a7bc){_0x9e1df9[_0x68ab('0x68')]=_0xe9a7bc;return _0x9e1df9;});}})['then'](respondWithFilteredResult(_0x307c60,_0x40a36a))[_0x68ab('0x25')](handleError(_0x307c60,null));};exports[_0x68ab('0x36')]=function(_0x1adcf4,_0xc77294,_0x329672){var _0x24bfa3,_0x3ba1cb={},_0x1badf7;if(_0x1adcf4['body']['to']){_0x1badf7=_0x1adcf4[_0x68ab('0x52')]['to'][0x0];}return db[_0x68ab('0x39')][_0x68ab('0x50')]({'where':{'id':_0x1adcf4['params']['id']},'include':[{'model':db[_0x68ab('0x9e')],'as':_0x68ab('0x9f'),'include':[{'model':db[_0x68ab('0xa0')],'as':_0x68ab('0xa1'),'where':{'fax':_0x1badf7},'limit':0x1,'order':[['updatedAt',_0x68ab('0xa2')]]}]}]})[_0x68ab('0x1c')](handleEntityNotFound(_0xc77294,null))[_0x68ab('0x1c')](function(_0x101a1c){_0x24bfa3=_0x101a1c;if(_0x1adcf4[_0x68ab('0x52')][_0x68ab('0xa3')]&&_0x1adcf4['body'][_0x68ab('0xa3')][_0x68ab('0x43')]){for(var _0x404e88=0x0;_0x404e88<_0x1adcf4['body']['attachments']['length'];_0x404e88+=0x1){_0x1adcf4[_0x68ab('0x52')][_0x68ab('0xa3')][_0x404e88]={'filename':_0x1adcf4[_0x68ab('0x52')]['attachments'][_0x404e88]['name'],'id':_0x1adcf4[_0x68ab('0x52')]['attachments'][_0x404e88]['id'],'path':path[_0x68ab('0xa4')](config[_0x68ab('0xa5')],_0x68ab('0xa6'),_0x1adcf4[_0x68ab('0x52')][_0x68ab('0xa3')][_0x404e88][_0x68ab('0xa7')])};}}return respondWithRpcPromise(_0x68ab('0xa8'),_0x68ab('0xa8'),{'FaxAccountId':_[_0x68ab('0xa9')](_0x1adcf4[_0x68ab('0x4c')]['id'])?undefined:_0x1adcf4[_0x68ab('0x4c')]['id'],'path':_[_0x68ab('0xa9')](_0x1adcf4[_0x68ab('0x52')][_0x68ab('0xa3')][0x0][_0x68ab('0xaa')])?undefined:_0x1adcf4[_0x68ab('0x52')][_0x68ab('0xa3')][0x0][_0x68ab('0xaa')],'fax':_['isNil'](_0x1adcf4[_0x68ab('0x52')]['to'][0x0])?undefined:_0x1adcf4[_0x68ab('0x52')]['to'][0x0]},client9002);})[_0x68ab('0x1c')](function(){if(_0x24bfa3){if(_[_0x68ab('0xa9')](_0x1adcf4['body'][_0x68ab('0xab')])){_0x1adcf4[_0x68ab('0x52')]['from']=util[_0x68ab('0x9c')](_0x68ab('0xac'),_0x24bfa3[_0x68ab('0x35')],_0x24bfa3['fax']);}if(_0x24bfa3[_0x68ab('0x9f')]){if(_0x24bfa3[_0x68ab('0x9f')]['Contacts'][_0x68ab('0x43')]){return _0x24bfa3[_0x68ab('0x9f')][_0x68ab('0xa1')][0x0];}else{return db['CmContact']['create'](_[_0x68ab('0xad')](_0x1adcf4['body'],{'firstName':_0x1adcf4[_0x68ab('0x52')]['to'][0x0],'phone':_0x1adcf4['body']['to'][0x0],'fax':_0x1adcf4[_0x68ab('0x52')]['to'][0x0],'ListId':_0x24bfa3[_0x68ab('0xae')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error('Send\x20Fax\x20failed');}})[_0x68ab('0x1c')](function(_0x48ddc9){if(_0x48ddc9){return db[_0x68ab('0x6b')][_0x68ab('0x50')]({'where':{'ContactId':_0x48ddc9['id'],'closed':![],'FaxAccountId':_0x24bfa3['id']}})['then'](function(_0x563fad){if(_0x563fad){return[_0x563fad,![]];}return db['FaxInteraction'][_0x68ab('0x51')]({'UserId':_0x1adcf4[_0x68ab('0x53')]['id'],'ContactId':_0x48ddc9['id'],'FaxAccountId':_0x24bfa3['id'],'fax':_0x1adcf4[_0x68ab('0x52')]['to'][0x0],'firstMsgDirection':_0x68ab('0xaf'),'Messages':[_[_0x68ab('0x48')](_0x1adcf4[_0x68ab('0x52')],{'read':![],'body':_0x1adcf4[_0x68ab('0x52')][_0x68ab('0xa3')][0x0][_0x68ab('0xb0')],'FaxAccountId':_0x24bfa3['id'],'UserId':_0x1adcf4[_0x68ab('0x53')]['id'],'ContactId':_0x48ddc9['id'],'AttachmentId':_0x1adcf4[_0x68ab('0x52')][_0x68ab('0xa3')][0x0]['id']})]},{'include':[{'model':db[_0x68ab('0x99')],'as':_0x68ab('0xb1')}]})[_0x68ab('0x1c')](function(_0x1d5b11){return[_0x1d5b11,!![]];});});}else{throw new Error(_0x68ab('0xb2'));}})[_0x68ab('0xb3')](function(_0xbcff12,_0x2f8319){if(_0x2f8319){return _0xbcff12;}return db[_0x68ab('0x99')]['create']({'direction':_0x68ab('0xaf'),'read':![],'body':_0x1adcf4[_0x68ab('0x52')][_0x68ab('0xa3')][0x0]['filename'],'FaxAccountId':_0x24bfa3['id'],'FaxInteractionId':_0xbcff12['id'],'UserId':_0x1adcf4[_0x68ab('0x53')]['id'],'ContactId':_0xbcff12[_0x68ab('0xb4')],'AttachmentId':_0x1adcf4['body'][_0x68ab('0xa3')][0x0]['id']})[_0x68ab('0x1c')](function(_0x3b3c82){_0xbcff12[_0x68ab('0xb5')][_0x68ab('0xb1')]=[];_0xbcff12[_0x68ab('0xb5')]['Messages'][_0x68ab('0x83')](_0x3b3c82[_0x68ab('0xb5')]);return _0xbcff12;});})['then'](function(_0x1e4836){respondWithRpcPromise(_0x68ab('0xb6'),_0x68ab('0xb6'),{'FaxAccountId':_[_0x68ab('0xa9')](_0x1adcf4[_0x68ab('0x4c')]['id'])?undefined:_0x1adcf4[_0x68ab('0x4c')]['id'],'path':_[_0x68ab('0xa9')](_0x1adcf4[_0x68ab('0x52')][_0x68ab('0xa3')][0x0][_0x68ab('0xaa')])?undefined:_0x1adcf4[_0x68ab('0x52')][_0x68ab('0xa3')][0x0][_0x68ab('0xaa')],'fax':_[_0x68ab('0xa9')](_0x1adcf4['body']['to'][0x0])?undefined:_0x1adcf4[_0x68ab('0x52')]['to'][0x0],'AttachmentId':_0x1adcf4[_0x68ab('0x52')]['attachments'][0x0]['id']},client9002)['then'](function(_0x20580e){logger[_0x68ab('0x1d')](_0x68ab('0xb7'),_0x20580e);})[_0x68ab('0x25')](function(_0x3e8369){logger[_0x68ab('0x1d')](_0x68ab('0xb7'),_0x3e8369);});return _0x1e4836;})[_0x68ab('0x1c')](respondWithResult(_0xc77294,null))[_0x68ab('0x25')](handleError(_0xc77294,null));};exports[_0x68ab('0xb8')]=function(_0x5ca5c2,_0x4bce4a,_0x13a07a){return db[_0x68ab('0x39')][_0x68ab('0x50')]({'where':{'id':_0x5ca5c2['params']['id']}})[_0x68ab('0x1c')](handleEntityNotFound(_0x4bce4a,null))[_0x68ab('0x1c')](function(_0x4d1a8e){if(_0x4d1a8e){return _0x4d1a8e[_0x68ab('0xb8')](_0x5ca5c2[_0x68ab('0x52')][_0x68ab('0x64')],_[_0x68ab('0x6c')](_0x5ca5c2[_0x68ab('0x52')],['ids','id'])||{})[_0x68ab('0xb3')](function(_0x3ef67b){for(var _0x243466=0x0;_0x243466<_0x5ca5c2[_0x68ab('0x52')]['ids'][_0x68ab('0x43')];_0x243466+=0x1){socket[_0x68ab('0xb9')](_0x68ab('0xba'),{'UserId':Number(_0x5ca5c2[_0x68ab('0x52')][_0x68ab('0x64')][_0x243466]),'FaxAccountId':Number(_0x5ca5c2[_0x68ab('0x4c')]['id'])});}return _0x3ef67b;});}})[_0x68ab('0x1c')](respondWithResult(_0x4bce4a,null))[_0x68ab('0x25')](handleError(_0x4bce4a,null));};exports['removeAgents']=function(_0x4d1b52,_0x598cfc,_0x3ad986){return db[_0x68ab('0x39')][_0x68ab('0x50')]({'where':{'id':_0x4d1b52[_0x68ab('0x4c')]['id']}})['then'](handleEntityNotFound(_0x598cfc,null))[_0x68ab('0x1c')](function(_0x3bc020){if(_0x3bc020){return _0x3bc020['removeAgents'](_0x4d1b52['query'][_0x68ab('0x64')])[_0x68ab('0x1c')](function(){if(_['isArray'](_0x4d1b52[_0x68ab('0x3e')][_0x68ab('0x64')])){for(var _0x5ea7cc=0x0;_0x5ea7cc<_0x4d1b52['query'][_0x68ab('0x64')][_0x68ab('0x43')];_0x5ea7cc+=0x1){socket[_0x68ab('0xb9')]('userFaxAccount:remove',{'UserId':Number(_0x4d1b52[_0x68ab('0x3e')][_0x68ab('0x64')][_0x5ea7cc]),'FaxAccountId':Number(_0x4d1b52[_0x68ab('0x4c')]['id'])});}}else{socket['emit'](_0x68ab('0xbb'),{'UserId':Number(_0x4d1b52[_0x68ab('0x3e')][_0x68ab('0x64')]),'FaxAccountId':Number(_0x4d1b52['params']['id'])});}});}})[_0x68ab('0x1c')](respondWithStatusCode(_0x598cfc,null))[_0x68ab('0x25')](handleError(_0x598cfc,null));};exports[_0x68ab('0xbc')]=function(_0x81f7b,_0x19f135,_0x1b4a96){var _0xe3d6d6={};var _0x3c8d42={};var _0x1a5c58;var _0x593e2b;return db[_0x68ab('0x39')][_0x68ab('0x5e')]({'where':{'id':_0x81f7b['params']['id']}})[_0x68ab('0x1c')](handleEntityNotFound(_0x19f135,null))[_0x68ab('0x1c')](function(_0x34ab2a){if(_0x34ab2a){_0x1a5c58=_0x34ab2a;_0x3c8d42['model']=_[_0x68ab('0x4d')](db[_0x68ab('0x6f')][_0x68ab('0x4e')]);_0x3c8d42[_0x68ab('0x3e')]=_[_0x68ab('0x4d')](_0x81f7b['query']);_0x3c8d42[_0x68ab('0x3f')]=_[_0x68ab('0x40')](_0x3c8d42[_0x68ab('0x3d')],_0x3c8d42[_0x68ab('0x3e')]);_0xe3d6d6[_0x68ab('0x42')]=_[_0x68ab('0x40')](_0x3c8d42['model'],qs[_0x68ab('0x41')](_0x81f7b[_0x68ab('0x3e')][_0x68ab('0x41')]));_0xe3d6d6[_0x68ab('0x42')]=_0xe3d6d6[_0x68ab('0x42')]['length']?_0xe3d6d6[_0x68ab('0x42')]:_0x3c8d42[_0x68ab('0x3d')];_0xe3d6d6[_0x68ab('0x60')]=qs[_0x68ab('0x45')](_0x81f7b[_0x68ab('0x3e')][_0x68ab('0x45')]);_0xe3d6d6['where']=qs['filters'](_[_0x68ab('0x61')](_0x81f7b['query'],_0x3c8d42[_0x68ab('0x3f')]));if(_0x81f7b[_0x68ab('0x3e')][_0x68ab('0x47')]){_0xe3d6d6[_0x68ab('0x46')]=_[_0x68ab('0x48')](_0xe3d6d6['where'],{'$or':_[_0x68ab('0x38')](_0xe3d6d6[_0x68ab('0x42')],function(_0xdda8e1){var _0x18de7a={};_0x18de7a[_0xdda8e1]={'$like':'%'+_0x81f7b[_0x68ab('0x3e')][_0x68ab('0x47')]+'%'};return _0x18de7a;})});}_0xe3d6d6=_[_0x68ab('0x48')]({},_0xe3d6d6,_0x81f7b['options']);return _0x1a5c58[_0x68ab('0xbc')](_0xe3d6d6);}})[_0x68ab('0x1c')](function(_0x1a2cc6){if(_0x1a2cc6){_0x593e2b=_0x1a2cc6[_0x68ab('0x43')];if(!_0x81f7b['query'][_0x68ab('0x5f')](_0x68ab('0x44'))){_0xe3d6d6[_0x68ab('0x2a')]=qs[_0x68ab('0x2a')](_0x81f7b['query'][_0x68ab('0x2a')]);_0xe3d6d6[_0x68ab('0x29')]=qs['offset'](_0x81f7b[_0x68ab('0x3e')][_0x68ab('0x29')]);}return _0x1a5c58['getAgents'](_0xe3d6d6);}})['then'](function(_0x4a97f6){if(_0x4a97f6){return _0x4a97f6?{'count':_0x593e2b,'rows':_0x4a97f6}:null;}})['then'](respondWithResult(_0x19f135,null))[_0x68ab('0x25')](handleError(_0x19f135,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 448b87e..b3366d9 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 _0x3859=['hasOwnProperty','hook','events','setMaxListeners','save','update','remove','emit'];(function(_0x54b3d5,_0x1a09b2){var _0x259ea6=function(_0x57a46c){while(--_0x57a46c){_0x54b3d5['push'](_0x54b3d5['shift']());}};_0x259ea6(++_0x1a09b2);}(_0x3859,0xf2));var _0x9385=function(_0x3c06c1,_0x340bd6){_0x3c06c1=_0x3c06c1-0x0;var _0x52031f=_0x3859[_0x3c06c1];return _0x52031f;};'use strict';var EventEmitter=require(_0x9385('0x0'));var FaxAccount=require('../../mysqldb')['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x9385('0x1')](0x0);var events={'afterCreate':_0x9385('0x2'),'afterUpdate':_0x9385('0x3'),'afterDestroy':_0x9385('0x4')};function emitEvent(_0x3d17fc){return function(_0x1f8063,_0x26ee66,_0x28c6c8){FaxAccountEvents['emit'](_0x3d17fc+':'+_0x1f8063['id'],_0x1f8063);FaxAccountEvents[_0x9385('0x5')](_0x3d17fc,_0x1f8063);_0x28c6c8(null);};}for(var e in events){if(events[_0x9385('0x6')](e)){var event=events[e];FaxAccount[_0x9385('0x7')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file +var _0x02a0=['remove','emit','hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners','save','update'];(function(_0x4781ed,_0x40b84e){var _0x1b088b=function(_0x584f06){while(--_0x584f06){_0x4781ed['push'](_0x4781ed['shift']());}};_0x1b088b(++_0x40b84e);}(_0x02a0,0x86));var _0x002a=function(_0x2e99ee,_0xa4813){_0x2e99ee=_0x2e99ee-0x0;var _0x2fb7db=_0x02a0[_0x2e99ee];return _0x2fb7db;};'use strict';var EventEmitter=require(_0x002a('0x0'));var FaxAccount=require(_0x002a('0x1'))['db'][_0x002a('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x002a('0x3')](0x0);var events={'afterCreate':_0x002a('0x4'),'afterUpdate':_0x002a('0x5'),'afterDestroy':_0x002a('0x6')};function emitEvent(_0x24679a){return function(_0x3a5229,_0x515bad,_0x2e6def){FaxAccountEvents[_0x002a('0x7')](_0x24679a+':'+_0x3a5229['id'],_0x3a5229);FaxAccountEvents[_0x002a('0x7')](_0x24679a,_0x3a5229);_0x2e6def(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0x002a('0x8')](e,emitEvent(event));}}module[_0x002a('0x9')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 3ba9bf4..b2f28be 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 _0xd3af=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','lodash','util'];(function(_0x45dbe3,_0xd2bf96){var _0x1e71cf=function(_0x47d46d){while(--_0x47d46d){_0x45dbe3['push'](_0x45dbe3['shift']());}};_0x1e71cf(++_0xd2bf96);}(_0xd3af,0x196));var _0xfd3a=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xd3af[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xfd3a('0x0'));var util=require(_0xfd3a('0x1'));var logger=require(_0xfd3a('0x2'))('api');var moment=require(_0xfd3a('0x3'));var BPromise=require(_0xfd3a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfd3a('0x5'));var rimraf=require(_0xfd3a('0x6'));var config=require(_0xfd3a('0x7'));var attributes=require(_0xfd3a('0x8'));module[_0xfd3a('0x9')]=function(_0x29c499,_0x512fce){return _0x29c499[_0xfd3a('0xa')](_0xfd3a('0xb'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc9e4=['exports','FaxAccount','fax_accounts','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x3857e5,_0x1e9abf){var _0xc19a95=function(_0x3e2e53){while(--_0x3e2e53){_0x3857e5['push'](_0x3857e5['shift']());}};_0xc19a95(++_0x1e9abf);}(_0xc9e4,0x1ef));var _0x4c9e=function(_0xba7840,_0x36fac8){_0xba7840=_0xba7840-0x0;var _0x532b9a=_0xc9e4[_0xba7840];return _0x532b9a;};'use strict';var _=require(_0x4c9e('0x0'));var util=require(_0x4c9e('0x1'));var logger=require(_0x4c9e('0x2'))(_0x4c9e('0x3'));var moment=require(_0x4c9e('0x4'));var BPromise=require('bluebird');var rp=require(_0x4c9e('0x5'));var fs=require('fs');var path=require(_0x4c9e('0x6'));var rimraf=require(_0x4c9e('0x7'));var config=require(_0x4c9e('0x8'));var attributes=require('./faxAccount.attributes');module[_0x4c9e('0x9')]=function(_0x14e166,_0x2e234a){return _0x14e166['define'](_0x4c9e('0xa'),attributes,{'tableName':_0x4c9e('0xb'),'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 4464236..b2c98a3 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 _0x6820=['Contact\x20not\x20found','spread','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','GetFaxAccount','FaxAccount','options','raw','where','limit','include','map','model','attributes','debug','stringify','fax','Sequelize','no\x20available\x20attributes','difference','keys','updatedAt','CompanyId','ListId','body','isNil','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','find','account','CmList','List','CmContact','Contacts','DESC','FaxApplication','Applications','get','applications','list','orderBy','priority','length','from','create','contact','FaxInteraction'];(function(_0x3ebf9b,_0x503fa6){var _0x3b2664=function(_0x4edf52){while(--_0x4edf52){_0x3ebf9b['push'](_0x3ebf9b['shift']());}};_0x3b2664(++_0x503fa6);}(_0x6820,0x6d));var _0x0682=function(_0x2f5072,_0x11d0cd){_0x2f5072=_0x2f5072-0x0;var _0x28d2c8=_0x6820[_0x2f5072];return _0x28d2c8;};'use strict';var _=require('lodash');var util=require(_0x0682('0x0'));var moment=require(_0x0682('0x1'));var BPromise=require('bluebird');var rs=require(_0x0682('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0682('0x3'))['db'];var utils=require(_0x0682('0x4'));var logger=require(_0x0682('0x5'))('rpc');var config=require(_0x0682('0x6'));var jayson=require(_0x0682('0x7'));var client=jayson[_0x0682('0x8')][_0x0682('0x9')]({'port':0x232c});config[_0x0682('0xa')]=_[_0x0682('0xb')](config[_0x0682('0xa')],{'host':_0x0682('0xc'),'port':0x18eb});var socket=require(_0x0682('0xd'))(new Redis(config[_0x0682('0xa')]));require('./faxAccount.socket')[_0x0682('0xe')](socket);function respondWithRpcPromise(_0x57f855,_0x5b7813,_0x4d8839){return new BPromise(function(_0x17d4b8,_0x57fcb5){return client[_0x0682('0xf')](_0x57f855,_0x4d8839)[_0x0682('0x10')](function(_0x3f1e5c){logger['info']('FaxAccount,\x20%s,\x20%s',_0x5b7813,_0x0682('0x11'));logger['debug'](_0x0682('0x12'),_0x5b7813,_0x0682('0x11'),JSON['stringify'](_0x3f1e5c));if(_0x3f1e5c[_0x0682('0x13')]){if(_0x3f1e5c[_0x0682('0x13')][_0x0682('0x14')]===0x1f4){logger[_0x0682('0x13')](_0x0682('0x15'),_0x5b7813,_0x3f1e5c[_0x0682('0x13')]['message']);return _0x57fcb5(_0x3f1e5c[_0x0682('0x13')][_0x0682('0x16')]);}logger[_0x0682('0x13')](_0x0682('0x15'),_0x5b7813,_0x3f1e5c[_0x0682('0x13')]['message']);return _0x17d4b8(_0x3f1e5c['error'][_0x0682('0x16')]);}else{logger['info'](_0x0682('0x15'),_0x5b7813,_0x0682('0x11'));_0x17d4b8(_0x3f1e5c[_0x0682('0x17')][_0x0682('0x16')]);}})[_0x0682('0x18')](function(_0x5f534c){logger[_0x0682('0x13')](_0x0682('0x15'),_0x5b7813,_0x5f534c);_0x57fcb5(_0x5f534c);});});}exports[_0x0682('0x19')]=function(_0x388f21){var _0x13576f=this;return new Promise(function(_0x636a28,_0x1ad921){return db[_0x0682('0x1a')]['findAll']({'raw':_0x388f21[_0x0682('0x1b')]?_0x388f21[_0x0682('0x1b')][_0x0682('0x1c')]===undefined?!![]:![]:!![],'where':_0x388f21['options']?_0x388f21[_0x0682('0x1b')][_0x0682('0x1d')]||null:null,'attributes':_0x388f21[_0x0682('0x1b')]?_0x388f21[_0x0682('0x1b')]['attributes']||null:null,'limit':_0x388f21[_0x0682('0x1b')]?_0x388f21[_0x0682('0x1b')][_0x0682('0x1e')]||null:null,'include':_0x388f21[_0x0682('0x1b')]?_0x388f21['options'][_0x0682('0x1f')]?_[_0x0682('0x20')](_0x388f21['options'][_0x0682('0x1f')],function(_0x575f84){return{'model':db[_0x575f84[_0x0682('0x21')]],'as':_0x575f84['as'],'attributes':_0x575f84['attributes'],'include':_0x575f84[_0x0682('0x1f')]?_[_0x0682('0x20')](_0x575f84[_0x0682('0x1f')],function(_0x2f0e9e){return{'model':db[_0x2f0e9e[_0x0682('0x21')]],'as':_0x2f0e9e['as'],'attributes':_0x2f0e9e[_0x0682('0x22')],'include':_0x2f0e9e[_0x0682('0x1f')]?_[_0x0682('0x20')](_0x2f0e9e[_0x0682('0x1f')],function(_0x99a563){return{'model':db[_0x99a563['model']],'as':_0x99a563['as'],'attributes':_0x99a563[_0x0682('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0682('0x10')](function(_0xc0a668){logger['info'](_0x0682('0x19'),_0x388f21);logger[_0x0682('0x23')](_0x0682('0x19'),_0x388f21,JSON[_0x0682('0x24')](_0xc0a668));_0x636a28(_0xc0a668);})[_0x0682('0x18')](function(_0x241051){logger[_0x0682('0x13')](_0x0682('0x19'),_0x241051[_0x0682('0x16')],_0x388f21);_0x1ad921(_0x13576f[_0x0682('0x13')](0x1f4,_0x241051[_0x0682('0x16')]));});});};exports['NotifyFaxAccount']=function(_0x4087a3,_0x362ce1,_0x131013){var _0x5f2ac7=this;return new Promise(function(_0xe9b6a2,_0x2ad46d){var _0x4ac012={'body':_0x4087a3['body'],'channel':_0x0682('0x25')};var _0x1aef99=[];var _0x114008=[];var _0x1ef69d={};return db['CmContact']['describe']()['then'](function(_0x4449a7){if(!_0x4449a7){throw new db[(_0x0682('0x26'))]['ValidationError'](_0x0682('0x27'));}_0x1aef99=_[_0x0682('0x28')](_[_0x0682('0x29')](_0x4449a7),['createdAt','updatedAt']);_0x114008=_['difference'](_[_0x0682('0x29')](_0x4449a7),['createdAt',_0x0682('0x2a'),_0x0682('0x2b'),_0x0682('0x2c')]);if(_0x4087a3[_0x0682('0x2d')]['id']){delete _0x4087a3[_0x0682('0x2d')]['id'];}if(_[_0x0682('0x2e')](_0x4087a3['body']['from'])){throw new db['Sequelize'][(_0x0682('0x2f'))]('from\x20is\x20mandatory');}if(_[_0x0682('0x2e')](_0x4087a3['body'][_0x0682('0x2d')])||_0x4087a3[_0x0682('0x2d')][_0x0682('0x2d')]===''){throw new db[(_0x0682('0x26'))][(_0x0682('0x2f'))](_0x0682('0x30'));}if(_[_0x0682('0x2e')](_0x4087a3['body'][_0x0682('0x31')])){throw new db[(_0x0682('0x26'))][(_0x0682('0x2f'))](_0x0682('0x32')+_0x114008);}if(!_[_0x0682('0x33')](_0x114008,_0x4087a3[_0x0682('0x2d')]['mapKey'])){throw new db['Sequelize'][(_0x0682('0x2f'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x114008);}_0x1ef69d[_0x4087a3['body'][_0x0682('0x31')]]=_0x4087a3['body']['from'];})['then'](function(){return db['FaxAccount'][_0x0682('0x34')]({'where':{'id':_0x4087a3[_0x0682('0x35')]['id']},'include':[{'model':db[_0x0682('0x36')],'as':_0x0682('0x37'),'include':[{'model':db[_0x0682('0x38')],'as':_0x0682('0x39'),'where':_0x1ef69d,'limit':0x1,'order':[['updatedAt',_0x0682('0x3a')]]}]},{'model':db[_0x0682('0x3b')],'as':_0x0682('0x3c')}]});})[_0x0682('0x10')](function(_0x268c08){if(_0x268c08&&_0x268c08['List']){var _0x45bcae=_0x268c08[_0x0682('0x3d')]({'plain':!![]});_0x4ac012[_0x0682('0x35')]=_0x45bcae;_0x4ac012[_0x0682('0x3e')]=_0x45bcae[_0x0682('0x3c')];_0x4ac012[_0x0682('0x3f')]=_0x45bcae[_0x0682('0x37')];_0x4ac012[_0x0682('0x3e')]=_[_0x0682('0x40')](_0x4ac012[_0x0682('0x3e')],[_0x0682('0x41')],['asc']);if(_0x4ac012[_0x0682('0x35')][_0x0682('0x3c')]){delete _0x4ac012[_0x0682('0x35')][_0x0682('0x3c')];}if(_0x4ac012[_0x0682('0x35')]['List']&&_0x4ac012['account'][_0x0682('0x37')][_0x0682('0x39')][_0x0682('0x42')]){return _0x4ac012['account'][_0x0682('0x37')][_0x0682('0x39')][0x0];}var _0x48c83d=_[_0x0682('0xb')](_0x4087a3[_0x0682('0x2d')],{'firstName':_0x4087a3[_0x0682('0x2d')][_0x0682('0x43')],'ListId':_0x45bcae[_0x0682('0x2c')]});_0x48c83d[_0x4087a3[_0x0682('0x2d')]['mapKey']]=_0x4087a3['body'][_0x0682('0x43')];return db[_0x0682('0x38')][_0x0682('0x44')](_0x48c83d,{'fields':_0x1aef99,'raw':!![]});}})[_0x0682('0x10')](function(_0x2f350c){_0x4ac012[_0x0682('0x45')]=_0x2f350c;if(_0x2f350c){var _0x71fe2f={'ContactId':_0x2f350c['id'],'FaxAccountId':_0x4087a3[_0x0682('0x35')]['id'],'fax':_0x2f350c['fax']};return db['FaxInteraction']['find']({'where':{'ContactId':_0x2f350c['id'],'closed':![],'FaxAccountId':_0x4087a3[_0x0682('0x35')]['id']}})[_0x0682('0x10')](function(_0x27617b){if(_0x27617b){return[_0x27617b,![]];}return db[_0x0682('0x46')][_0x0682('0x44')](_0x71fe2f)[_0x0682('0x10')](function(_0x56a66b){return[_0x56a66b,!![]];});});}else{throw new Error(_0x0682('0x47'));}})[_0x0682('0x48')](function(_0x19a6c8,_0x17e60f){var _0x235d87=_0x19a6c8[_0x0682('0x3d')]({'plain':!![]});if(_0x17e60f){if(_0x4ac012[_0x0682('0x35')][_0x0682('0x49')]){_0x4ac012[_0x0682('0x3e')][_0x0682('0x4a')]({'id':0x0,'priority':_0x4ac012['applications'][_0x0682('0x42')]+0x1,'app':_0x0682('0x4b'),'appdata':_0x0682('0x4c'),'interval':_0x0682('0x4d')});}_0x235d87[_0x0682('0x4e')]=!![];}else{_0x235d87[_0x0682('0x4e')]=![];}_0x4ac012[_0x0682('0x4f')]=_0x235d87;return db[_0x0682('0x50')][_0x0682('0x44')]({'body':_0x4087a3['body'][_0x0682('0x2d')],'FaxAccountId':_0x4087a3['account']['id'],'FaxInteractionId':_0x19a6c8['id'],'direction':'in','ContactId':_0x19a6c8[_0x0682('0x51')],'AttachmentId':_0x4087a3[_0x0682('0x2d')][_0x0682('0x52')]});})['then'](function(_0x2d8e4f){_0x4ac012[_0x0682('0x16')]=_0x2d8e4f;if(_0x4ac012['interaction'][_0x0682('0x53')]){return db['User'][_0x0682('0x34')]({'attributes':['id',_0x0682('0x54')],'where':{'id':_0x4ac012[_0x0682('0x4f')][_0x0682('0x53')]}})[_0x0682('0x10')](function(_0x1fb89a){if(_0x1fb89a){_0x4ac012['applications'][_0x0682('0x55')]({'id':0x0,'priority':0x0,'app':_0x0682('0x56'),'appdata':_0x1fb89a[_0x0682('0x54')]+','+(_0x4ac012[_0x0682('0x35')][_0x0682('0x57')]||0xa),'interval':_0x0682('0x4d')});}return respondWithRpcPromise('Start','startRouting',_0x4ac012);});}return respondWithRpcPromise(_0x0682('0x58'),_0x0682('0x59'),_0x4ac012);})[_0x0682('0x10')](function(_0x18e9f3){_0xe9b6a2(_0x18e9f3);})[_0x0682('0x18')](function(_0x26f11d){_0x2ad46d(_0x5f2ac7[_0x0682('0x13')](0x1f4,_0x26f11d[_0x0682('0x16')]));});});}; \ No newline at end of file +var _0x7d6e=['UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','FaxAccount,\x20%s,\x20%s','message','info','request\x20sent','result','catch','FaxAccount','findAll','options','raw','where','attributes','limit','include','model','map','GetFaxAccount','body','fax','CmContact','describe','Sequelize','no\x20available\x20attributes','difference','updatedAt','CompanyId','ListId','from','ValidationError','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','account','CmList','List','Contacts','DESC','FaxApplication','Applications','get','list','applications','orderBy','priority','asc','length','create','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','close','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId'];(function(_0x19f6ed,_0x46c098){var _0x3c3a5d=function(_0x4ceb09){while(--_0x4ceb09){_0x19f6ed['push'](_0x19f6ed['shift']());}};_0x3c3a5d(++_0x46c098);}(_0x7d6e,0x1c9));var _0xe7d6=function(_0xc4966b,_0x6cd5e0){_0xc4966b=_0xc4966b-0x0;var _0x1802bb=_0x7d6e[_0xc4966b];return _0x1802bb;};'use strict';var _=require(_0xe7d6('0x0'));var util=require(_0xe7d6('0x1'));var moment=require(_0xe7d6('0x2'));var BPromise=require(_0xe7d6('0x3'));var rs=require(_0xe7d6('0x4'));var fs=require('fs');var Redis=require(_0xe7d6('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe7d6('0x6'))(_0xe7d6('0x7'));var config=require('../../config/environment');var jayson=require(_0xe7d6('0x8'));var client=jayson[_0xe7d6('0x9')][_0xe7d6('0xa')]({'port':0x232c});config[_0xe7d6('0xb')]=_[_0xe7d6('0xc')](config[_0xe7d6('0xb')],{'host':_0xe7d6('0xd'),'port':0x18eb});var socket=require(_0xe7d6('0xe'))(new Redis(config[_0xe7d6('0xb')]));require('./faxAccount.socket')[_0xe7d6('0xf')](socket);function respondWithRpcPromise(_0x14360e,_0x25d6d2,_0xceb57b){return new BPromise(function(_0x5ef210,_0x59a5ee){return client['request'](_0x14360e,_0xceb57b)[_0xe7d6('0x10')](function(_0x22c732){logger['info']('FaxAccount,\x20%s,\x20%s',_0x25d6d2,'request\x20sent');logger[_0xe7d6('0x11')](_0xe7d6('0x12'),_0x25d6d2,'request\x20sent',JSON['stringify'](_0x22c732));if(_0x22c732[_0xe7d6('0x13')]){if(_0x22c732[_0xe7d6('0x13')][_0xe7d6('0x14')]===0x1f4){logger[_0xe7d6('0x13')](_0xe7d6('0x15'),_0x25d6d2,_0x22c732[_0xe7d6('0x13')][_0xe7d6('0x16')]);return _0x59a5ee(_0x22c732[_0xe7d6('0x13')]['message']);}logger[_0xe7d6('0x13')](_0xe7d6('0x15'),_0x25d6d2,_0x22c732['error'][_0xe7d6('0x16')]);return _0x5ef210(_0x22c732[_0xe7d6('0x13')][_0xe7d6('0x16')]);}else{logger[_0xe7d6('0x17')](_0xe7d6('0x15'),_0x25d6d2,_0xe7d6('0x18'));_0x5ef210(_0x22c732[_0xe7d6('0x19')][_0xe7d6('0x16')]);}})[_0xe7d6('0x1a')](function(_0x764131){logger[_0xe7d6('0x13')](_0xe7d6('0x15'),_0x25d6d2,_0x764131);_0x59a5ee(_0x764131);});});}exports['GetFaxAccount']=function(_0x470f06){var _0x137acb=this;return new Promise(function(_0x3ce228,_0x2edc95){return db[_0xe7d6('0x1b')][_0xe7d6('0x1c')]({'raw':_0x470f06[_0xe7d6('0x1d')]?_0x470f06[_0xe7d6('0x1d')][_0xe7d6('0x1e')]===undefined?!![]:![]:!![],'where':_0x470f06['options']?_0x470f06[_0xe7d6('0x1d')][_0xe7d6('0x1f')]||null:null,'attributes':_0x470f06[_0xe7d6('0x1d')]?_0x470f06[_0xe7d6('0x1d')][_0xe7d6('0x20')]||null:null,'limit':_0x470f06[_0xe7d6('0x1d')]?_0x470f06[_0xe7d6('0x1d')][_0xe7d6('0x21')]||null:null,'include':_0x470f06[_0xe7d6('0x1d')]?_0x470f06[_0xe7d6('0x1d')][_0xe7d6('0x22')]?_['map'](_0x470f06[_0xe7d6('0x1d')][_0xe7d6('0x22')],function(_0x577988){return{'model':db[_0x577988[_0xe7d6('0x23')]],'as':_0x577988['as'],'attributes':_0x577988[_0xe7d6('0x20')],'include':_0x577988[_0xe7d6('0x22')]?_[_0xe7d6('0x24')](_0x577988[_0xe7d6('0x22')],function(_0x38bf1c){return{'model':db[_0x38bf1c['model']],'as':_0x38bf1c['as'],'attributes':_0x38bf1c['attributes'],'include':_0x38bf1c[_0xe7d6('0x22')]?_['map'](_0x38bf1c[_0xe7d6('0x22')],function(_0x2ddf69){return{'model':db[_0x2ddf69[_0xe7d6('0x23')]],'as':_0x2ddf69['as'],'attributes':_0x2ddf69[_0xe7d6('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe7d6('0x10')](function(_0x11480d){logger[_0xe7d6('0x17')](_0xe7d6('0x25'),_0x470f06);logger[_0xe7d6('0x11')](_0xe7d6('0x25'),_0x470f06,JSON['stringify'](_0x11480d));_0x3ce228(_0x11480d);})[_0xe7d6('0x1a')](function(_0x241460){logger[_0xe7d6('0x13')](_0xe7d6('0x25'),_0x241460['message'],_0x470f06);_0x2edc95(_0x137acb[_0xe7d6('0x13')](0x1f4,_0x241460['message']));});});};exports['NotifyFaxAccount']=function(_0x393285,_0x269bfe,_0x5330e4){var _0x3f2e37=this;return new Promise(function(_0x55061e,_0x5799a9){var _0x28e789={'body':_0x393285[_0xe7d6('0x26')],'channel':_0xe7d6('0x27')};var _0x1c4996=[];var _0x215fd0=[];var _0x596397={};return db[_0xe7d6('0x28')][_0xe7d6('0x29')]()[_0xe7d6('0x10')](function(_0x1440d8){if(!_0x1440d8){throw new db[(_0xe7d6('0x2a'))]['ValidationError'](_0xe7d6('0x2b'));}_0x1c4996=_[_0xe7d6('0x2c')](_['keys'](_0x1440d8),['createdAt',_0xe7d6('0x2d')]);_0x215fd0=_[_0xe7d6('0x2c')](_['keys'](_0x1440d8),['createdAt',_0xe7d6('0x2d'),_0xe7d6('0x2e'),_0xe7d6('0x2f')]);if(_0x393285[_0xe7d6('0x26')]['id']){delete _0x393285['body']['id'];}if(_['isNil'](_0x393285['body'][_0xe7d6('0x30')])){throw new db[(_0xe7d6('0x2a'))][(_0xe7d6('0x31'))](_0xe7d6('0x32'));}if(_[_0xe7d6('0x33')](_0x393285[_0xe7d6('0x26')][_0xe7d6('0x26')])||_0x393285[_0xe7d6('0x26')]['body']===''){throw new db[(_0xe7d6('0x2a'))][(_0xe7d6('0x31'))](_0xe7d6('0x34'));}if(_[_0xe7d6('0x33')](_0x393285['body'][_0xe7d6('0x35')])){throw new db[(_0xe7d6('0x2a'))][(_0xe7d6('0x31'))](_0xe7d6('0x36')+_0x215fd0);}if(!_[_0xe7d6('0x37')](_0x215fd0,_0x393285[_0xe7d6('0x26')][_0xe7d6('0x35')])){throw new db[(_0xe7d6('0x2a'))][(_0xe7d6('0x31'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x215fd0);}_0x596397[_0x393285[_0xe7d6('0x26')][_0xe7d6('0x35')]]=_0x393285[_0xe7d6('0x26')][_0xe7d6('0x30')];})[_0xe7d6('0x10')](function(){return db['FaxAccount']['find']({'where':{'id':_0x393285[_0xe7d6('0x38')]['id']},'include':[{'model':db[_0xe7d6('0x39')],'as':_0xe7d6('0x3a'),'include':[{'model':db[_0xe7d6('0x28')],'as':_0xe7d6('0x3b'),'where':_0x596397,'limit':0x1,'order':[[_0xe7d6('0x2d'),_0xe7d6('0x3c')]]}]},{'model':db[_0xe7d6('0x3d')],'as':_0xe7d6('0x3e')}]});})[_0xe7d6('0x10')](function(_0x862aee){if(_0x862aee&&_0x862aee[_0xe7d6('0x3a')]){var _0x7d6556=_0x862aee[_0xe7d6('0x3f')]({'plain':!![]});_0x28e789[_0xe7d6('0x38')]=_0x7d6556;_0x28e789['applications']=_0x7d6556[_0xe7d6('0x3e')];_0x28e789[_0xe7d6('0x40')]=_0x7d6556['List'];_0x28e789[_0xe7d6('0x41')]=_[_0xe7d6('0x42')](_0x28e789[_0xe7d6('0x41')],[_0xe7d6('0x43')],[_0xe7d6('0x44')]);if(_0x28e789['account'][_0xe7d6('0x3e')]){delete _0x28e789[_0xe7d6('0x38')][_0xe7d6('0x3e')];}if(_0x28e789['account']['List']&&_0x28e789['account'][_0xe7d6('0x3a')][_0xe7d6('0x3b')][_0xe7d6('0x45')]){return _0x28e789[_0xe7d6('0x38')][_0xe7d6('0x3a')][_0xe7d6('0x3b')][0x0];}var _0x3c6658=_[_0xe7d6('0xc')](_0x393285['body'],{'firstName':_0x393285[_0xe7d6('0x26')]['from'],'ListId':_0x7d6556[_0xe7d6('0x2f')]});_0x3c6658[_0x393285[_0xe7d6('0x26')][_0xe7d6('0x35')]]=_0x393285[_0xe7d6('0x26')][_0xe7d6('0x30')];return db[_0xe7d6('0x28')][_0xe7d6('0x46')](_0x3c6658,{'fields':_0x1c4996,'raw':!![]});}})[_0xe7d6('0x10')](function(_0x15fe9c){_0x28e789['contact']=_0x15fe9c;if(_0x15fe9c){var _0x58615c={'ContactId':_0x15fe9c['id'],'FaxAccountId':_0x393285['account']['id'],'fax':_0x15fe9c[_0xe7d6('0x27')]};return db[_0xe7d6('0x47')]['find']({'where':{'ContactId':_0x15fe9c['id'],'closed':![],'FaxAccountId':_0x393285['account']['id']}})[_0xe7d6('0x10')](function(_0x554b69){if(_0x554b69){return[_0x554b69,![]];}return db['FaxInteraction']['create'](_0x58615c)['then'](function(_0x22b481){return[_0x22b481,!![]];});});}else{throw new Error(_0xe7d6('0x48'));}})[_0xe7d6('0x49')](function(_0x1e045a,_0x3b1136){var _0x598f81=_0x1e045a[_0xe7d6('0x3f')]({'plain':!![]});if(_0x3b1136){if(_0x28e789[_0xe7d6('0x38')][_0xe7d6('0x4a')]){_0x28e789[_0xe7d6('0x41')][_0xe7d6('0x4b')]({'id':0x0,'priority':_0x28e789[_0xe7d6('0x41')][_0xe7d6('0x45')]+0x1,'app':_0xe7d6('0x4c'),'appdata':'unmanaged','interval':_0xe7d6('0x4d')});}_0x598f81[_0xe7d6('0x4e')]=!![];}else{_0x598f81[_0xe7d6('0x4e')]=![];}_0x28e789[_0xe7d6('0x4f')]=_0x598f81;return db[_0xe7d6('0x50')]['create']({'body':_0x393285[_0xe7d6('0x26')]['body'],'FaxAccountId':_0x393285[_0xe7d6('0x38')]['id'],'FaxInteractionId':_0x1e045a['id'],'direction':'in','ContactId':_0x1e045a[_0xe7d6('0x51')],'AttachmentId':_0x393285[_0xe7d6('0x26')][_0xe7d6('0x52')]});})[_0xe7d6('0x10')](function(_0x20a9ba){_0x28e789['message']=_0x20a9ba;if(_0x28e789[_0xe7d6('0x4f')][_0xe7d6('0x53')]){return db[_0xe7d6('0x54')]['find']({'attributes':['id',_0xe7d6('0x55')],'where':{'id':_0x28e789[_0xe7d6('0x4f')][_0xe7d6('0x53')]}})[_0xe7d6('0x10')](function(_0xa1fb8a){if(_0xa1fb8a){_0x28e789['applications'][_0xe7d6('0x56')]({'id':0x0,'priority':0x0,'app':_0xe7d6('0x57'),'appdata':_0xa1fb8a[_0xe7d6('0x55')]+','+(_0x28e789[_0xe7d6('0x38')][_0xe7d6('0x58')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xe7d6('0x59'),'startRouting',_0x28e789);});}return respondWithRpcPromise('Start','startRouting',_0x28e789);})[_0xe7d6('0x10')](function(_0x355445){_0x55061e(_0x355445);})[_0xe7d6('0x1a')](function(_0x556a45){_0x5799a9(_0x3f2e37[_0xe7d6('0x13')](0x1f4,_0x556a45[_0xe7d6('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index d850b40..677065d 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 _0xf7e9=['update','remove'];(function(_0x3a4513,_0x2663ea){var _0x4bed7d=function(_0x30d979){while(--_0x30d979){_0x3a4513['push'](_0x3a4513['shift']());}};_0x4bed7d(++_0x2663ea);}(_0xf7e9,0x109));var _0x9f7e=function(_0x2338fa,_0x80579a){_0x2338fa=_0x2338fa-0x0;var _0x42df9b=_0xf7e9[_0x2338fa];return _0x42df9b;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=['save',_0x9f7e('0x0'),_0x9f7e('0x1')];function createListener(_0x3977db,_0x2da958){return function(_0x53b0f4){_0x2da958['emit'](_0x3977db,_0x53b0f4);};}function removeListener(_0x5c995f,_0xec22fa){return function(){FaxAccountEvents['removeListener'](_0x5c995f,_0xec22fa);};}exports['register']=function(_0x4217dc){for(var _0x3dd1bb=0x0,_0x243bc4=events['length'];_0x3dd1bb<_0x243bc4;_0x3dd1bb++){var _0x9918f3=events[_0x3dd1bb];var _0x1fe035=createListener('faxAccount:'+_0x9918f3,_0x4217dc);FaxAccountEvents['on'](_0x9918f3,_0x1fe035);}}; \ No newline at end of file +var _0x2ebd=['removeListener','register','length','faxAccount:','./faxAccount.events','update','emit'];(function(_0x3ec113,_0x260340){var _0x54b22b=function(_0x29176b){while(--_0x29176b){_0x3ec113['push'](_0x3ec113['shift']());}};_0x54b22b(++_0x260340);}(_0x2ebd,0x9e));var _0xd2eb=function(_0x554634,_0x511e4a){_0x554634=_0x554634-0x0;var _0x2aaf6f=_0x2ebd[_0x554634];return _0x2aaf6f;};'use strict';var FaxAccountEvents=require(_0xd2eb('0x0'));var events=['save','remove',_0xd2eb('0x1')];function createListener(_0x3cc661,_0x43c1b4){return function(_0x33ecff){_0x43c1b4[_0xd2eb('0x2')](_0x3cc661,_0x33ecff);};}function removeListener(_0x2452f4,_0x1a77c5){return function(){FaxAccountEvents[_0xd2eb('0x3')](_0x2452f4,_0x1a77c5);};}exports[_0xd2eb('0x4')]=function(_0x1671c3){for(var _0x1a29ba=0x0,_0x41e66c=events[_0xd2eb('0x5')];_0x1a29ba<_0x41e66c;_0x1a29ba++){var _0x300c8d=events[_0x1a29ba];var _0x496da6=createListener(_0xd2eb('0x6')+_0x300c8d,_0x1671c3);FaxAccountEvents['on'](_0x300c8d,_0x496da6);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 04aa566..06ddacf 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(_0x2efd23,_0x44fcb2){var _0x232e4c=function(_0x1d5d3b){while(--_0x1d5d3b){_0x2efd23['push'](_0x2efd23['shift']());}};_0x232e4c(++_0x44fcb2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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(_0x37b04e,_0x25376e){var _0x2529a8=function(_0x5172b8){while(--_0x5172b8){_0x37b04e['push'](_0x37b04e['shift']());}};_0x2529a8(++_0x25376e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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 96361e6..1cfdd88 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 _0x2b4b=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x2b4b,0x1bb));var _0xb2b4=function(_0xefcea9,_0x2a644a){_0xefcea9=_0xefcea9-0x0;var _0x36ec67=_0x2b4b[_0xefcea9];return _0x36ec67;};'use strict';var Sequelize=require(_0xb2b4('0x0'));module[_0xb2b4('0x1')]={'priority':{'type':Sequelize[_0xb2b4('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xb2b4('0x3')],'allowNull':![],'defaultValue':_0xb2b4('0x4')},'appdata':{'type':Sequelize[_0xb2b4('0x5')]()},'description':{'type':Sequelize[_0xb2b4('0x3')]},'interval':{'type':Sequelize[_0xb2b4('0x3')],'defaultValue':_0xb2b4('0x6')}}; \ No newline at end of file +var _0x38e9=['STRING','noop','TEXT','sequelize','INTEGER'];(function(_0x3b7fb0,_0x553e21){var _0x3b7fc5=function(_0x286bdc){while(--_0x286bdc){_0x3b7fb0['push'](_0x3b7fb0['shift']());}};_0x3b7fc5(++_0x553e21);}(_0x38e9,0x134));var _0x938e=function(_0x4b87a3,_0x3a698c){_0x4b87a3=_0x4b87a3-0x0;var _0x334112=_0x38e9[_0x4b87a3];return _0x334112;};'use strict';var Sequelize=require(_0x938e('0x0'));module['exports']={'priority':{'type':Sequelize[_0x938e('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x938e('0x2')],'allowNull':![],'defaultValue':_0x938e('0x3')},'appdata':{'type':Sequelize[_0x938e('0x4')]()},'description':{'type':Sequelize[_0x938e('0x2')]},'interval':{'type':Sequelize[_0x938e('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 3ea08a8..0f66b3f 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 _0x54d3=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','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/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','FaxApplication','rawAttributes','fieldName','key','model','map','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','filters','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body'];(function(_0x4c0266,_0x12014a){var _0x2139d1=function(_0xf2a49b){while(--_0xf2a49b){_0x4c0266['push'](_0x4c0266['shift']());}};_0x2139d1(++_0x12014a);}(_0x54d3,0x1d4));var _0x354d=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x54d3[_0x487b0c];return _0x1adbdc;};'use strict';var emlformat=require(_0x354d('0x0'));var rimraf=require(_0x354d('0x1'));var zipdir=require(_0x354d('0x2'));var jsonpatch=require(_0x354d('0x3'));var rp=require('request-promise');var moment=require(_0x354d('0x4'));var BPromise=require(_0x354d('0x5'));var Mustache=require('mustache');var util=require(_0x354d('0x6'));var path=require('path');var sox=require(_0x354d('0x7'));var csv=require(_0x354d('0x8'));var ejs=require(_0x354d('0x9'));var fs=require('fs');var fs_extra=require(_0x354d('0xa'));var _=require(_0x354d('0xb'));var squel=require(_0x354d('0xc'));var crypto=require(_0x354d('0xd'));var jsforce=require(_0x354d('0xe'));var deskjs=require(_0x354d('0xf'));var toCsv=require('to-csv');var querystring=require(_0x354d('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x354d('0x11'));var qs=require(_0x354d('0x12'));var as=require(_0x354d('0x13'));var hardwareService=require(_0x354d('0x14'));var logger=require(_0x354d('0x15'))(_0x354d('0x16'));var utils=require('../../config/utils');var config=require(_0x354d('0x17'));var licenseUtil=require(_0x354d('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25694b,_0x21b72a){_0x21b72a=_0x21b72a||0xcc;return function(_0x35d32f){if(_0x35d32f){return _0x25694b[_0x354d('0x19')](_0x21b72a);}return _0x25694b[_0x354d('0x1a')](_0x21b72a)['end']();};}function respondWithResult(_0x4c4f64,_0x327665){_0x327665=_0x327665||0xc8;return function(_0x447ddb){if(_0x447ddb){return _0x4c4f64[_0x354d('0x1a')](_0x327665)[_0x354d('0x1b')](_0x447ddb);}};}function respondWithFilteredResult(_0x361493,_0x2974b2){return function(_0x113fee){if(_0x113fee){var _0x383ee6=typeof _0x2974b2[_0x354d('0x1c')]===_0x354d('0x1d')&&typeof _0x2974b2[_0x354d('0x1e')]==='undefined';var _0x40310c=_0x113fee['count'];var _0x1e744d=_0x383ee6?0x0:_0x2974b2['offset'];var _0x2639ae=_0x383ee6?_0x113fee[_0x354d('0x1f')]:_0x2974b2['offset']+_0x2974b2[_0x354d('0x1e')];var _0x31f2d9;if(_0x2639ae>=_0x40310c){_0x2639ae=_0x40310c;_0x31f2d9=0xc8;}else{_0x31f2d9=0xce;}_0x361493[_0x354d('0x1a')](_0x31f2d9);return _0x361493[_0x354d('0x20')](_0x354d('0x21'),_0x1e744d+'-'+_0x2639ae+'/'+_0x40310c)['json'](_0x113fee);}return null;};}function patchUpdates(_0x1dab88){return function(_0x1cc337){try{jsonpatch[_0x354d('0x22')](_0x1cc337,_0x1dab88,!![]);}catch(_0xae7f56){return BPromise[_0x354d('0x23')](_0xae7f56);}return _0x1cc337[_0x354d('0x24')]();};}function saveUpdates(_0x37a19a,_0x590d5c){return function(_0x17b7ae){if(_0x17b7ae){return _0x17b7ae[_0x354d('0x25')](_0x37a19a)[_0x354d('0x26')](function(_0x15c2e4){return _0x15c2e4;});}return null;};}function removeEntity(_0x3fb280,_0x3c72a2){return function(_0x3470b3){if(_0x3470b3){return _0x3470b3[_0x354d('0x27')]()[_0x354d('0x26')](function(){_0x3fb280[_0x354d('0x1a')](0xcc)[_0x354d('0x28')]();});}};}function handleEntityNotFound(_0xcf82ff,_0x3da4b2){return function(_0x3e7b55){if(!_0x3e7b55){_0xcf82ff[_0x354d('0x19')](0x194);}return _0x3e7b55;};}function handleError(_0x1e7fd6,_0x269a77){_0x269a77=_0x269a77||0x1f4;return function(_0x3aeaa0){logger[_0x354d('0x29')](_0x3aeaa0[_0x354d('0x2a')]);if(_0x3aeaa0[_0x354d('0x2b')]){delete _0x3aeaa0['name'];}_0x1e7fd6['status'](_0x269a77)[_0x354d('0x2c')](_0x3aeaa0);};}exports[_0x354d('0x2d')]=function(_0x4cc22e,_0x2da7ec){var _0x68d7f3={},_0x17fcd6={},_0x1d15f1={'count':0x0,'rows':[]};var _0x3c5d87=_['map'](db[_0x354d('0x2e')][_0x354d('0x2f')],function(_0x759998){return{'name':_0x759998[_0x354d('0x30')],'type':_0x759998['type'][_0x354d('0x31')]};});_0x17fcd6[_0x354d('0x32')]=_[_0x354d('0x33')](_0x3c5d87,'name');_0x17fcd6['query']=_[_0x354d('0x34')](_0x4cc22e[_0x354d('0x35')]);_0x17fcd6['filters']=_['intersection'](_0x17fcd6[_0x354d('0x32')],_0x17fcd6[_0x354d('0x35')]);_0x68d7f3[_0x354d('0x36')]=_[_0x354d('0x37')](_0x17fcd6['model'],qs[_0x354d('0x38')](_0x4cc22e[_0x354d('0x35')]['fields']));_0x68d7f3[_0x354d('0x36')]=_0x68d7f3[_0x354d('0x36')][_0x354d('0x39')]?_0x68d7f3['attributes']:_0x17fcd6[_0x354d('0x32')];if(!_0x4cc22e['query'][_0x354d('0x3a')](_0x354d('0x3b'))){_0x68d7f3['limit']=qs[_0x354d('0x1e')](_0x4cc22e[_0x354d('0x35')]['limit']);_0x68d7f3[_0x354d('0x1c')]=qs[_0x354d('0x1c')](_0x4cc22e[_0x354d('0x35')][_0x354d('0x1c')]);}_0x68d7f3['order']=qs[_0x354d('0x3c')](_0x4cc22e[_0x354d('0x35')][_0x354d('0x3c')]);_0x68d7f3['where']=qs[_0x354d('0x3d')](_['pick'](_0x4cc22e['query'],_0x17fcd6[_0x354d('0x3d')]),_0x3c5d87);if(_0x4cc22e[_0x354d('0x35')][_0x354d('0x3e')]){_0x68d7f3[_0x354d('0x3f')]=_[_0x354d('0x40')](_0x68d7f3[_0x354d('0x3f')],{'$or':_[_0x354d('0x33')](_0x3c5d87,function(_0x39ea47){if(_0x39ea47[_0x354d('0x41')]!==_0x354d('0x42')){var _0x1de8eb={};_0x1de8eb[_0x39ea47['name']]={'$like':'%'+_0x4cc22e['query'][_0x354d('0x3e')]+'%'};return _0x1de8eb;}})});}_0x68d7f3=_[_0x354d('0x40')]({},_0x68d7f3,_0x4cc22e[_0x354d('0x43')]);var _0x5ce1d0={'where':_0x68d7f3[_0x354d('0x3f')]};return db[_0x354d('0x2e')][_0x354d('0x1f')](_0x5ce1d0)[_0x354d('0x26')](function(_0x3e102f){_0x1d15f1[_0x354d('0x1f')]=_0x3e102f;if(_0x4cc22e['query'][_0x354d('0x44')]){_0x68d7f3[_0x354d('0x45')]=[{'all':!![]}];}return db['FaxApplication'][_0x354d('0x46')](_0x68d7f3);})['then'](function(_0x31f378){_0x1d15f1[_0x354d('0x47')]=_0x31f378;return _0x1d15f1;})[_0x354d('0x26')](respondWithFilteredResult(_0x2da7ec,_0x68d7f3))[_0x354d('0x48')](handleError(_0x2da7ec,null));};exports[_0x354d('0x49')]=function(_0x353971,_0xd5f2ed){var _0x1b637c={'raw':!![],'where':{'id':_0x353971[_0x354d('0x4a')]['id']}},_0x2a5563={};_0x2a5563[_0x354d('0x32')]=_[_0x354d('0x34')](db[_0x354d('0x2e')][_0x354d('0x2f')]);_0x2a5563[_0x354d('0x35')]=_[_0x354d('0x34')](_0x353971[_0x354d('0x35')]);_0x2a5563[_0x354d('0x3d')]=_[_0x354d('0x37')](_0x2a5563[_0x354d('0x32')],_0x2a5563['query']);_0x1b637c['attributes']=_[_0x354d('0x37')](_0x2a5563[_0x354d('0x32')],qs[_0x354d('0x38')](_0x353971[_0x354d('0x35')][_0x354d('0x38')]));_0x1b637c['attributes']=_0x1b637c['attributes'][_0x354d('0x39')]?_0x1b637c['attributes']:_0x2a5563[_0x354d('0x32')];if(_0x353971[_0x354d('0x35')][_0x354d('0x44')]){_0x1b637c['include']=[{'all':!![]}];}_0x1b637c=_[_0x354d('0x40')]({},_0x1b637c,_0x353971[_0x354d('0x43')]);return db[_0x354d('0x2e')][_0x354d('0x4b')](_0x1b637c)[_0x354d('0x26')](handleEntityNotFound(_0xd5f2ed,null))[_0x354d('0x26')](respondWithResult(_0xd5f2ed,null))[_0x354d('0x48')](handleError(_0xd5f2ed,null));};exports[_0x354d('0x4c')]=function(_0x53a23b,_0x895ff2){return db[_0x354d('0x2e')]['create'](_0x53a23b[_0x354d('0x4d')],{})['then'](respondWithResult(_0x895ff2,0xc9))[_0x354d('0x48')](handleError(_0x895ff2,null));};exports['update']=function(_0x797786,_0x214ca){if(_0x797786[_0x354d('0x4d')]['id']){delete _0x797786[_0x354d('0x4d')]['id'];}return db[_0x354d('0x2e')]['find']({'where':{'id':_0x797786[_0x354d('0x4a')]['id']}})[_0x354d('0x26')](handleEntityNotFound(_0x214ca,null))[_0x354d('0x26')](saveUpdates(_0x797786['body'],null))[_0x354d('0x26')](respondWithResult(_0x214ca,null))[_0x354d('0x48')](handleError(_0x214ca,null));};exports[_0x354d('0x27')]=function(_0x3c7120,_0x43ec23){return db[_0x354d('0x2e')][_0x354d('0x4b')]({'where':{'id':_0x3c7120[_0x354d('0x4a')]['id']}})[_0x354d('0x26')](handleEntityNotFound(_0x43ec23,null))[_0x354d('0x26')](removeEntity(_0x43ec23,null))[_0x354d('0x48')](handleError(_0x43ec23,null));}; \ No newline at end of file +var _0xcf34=['filter','where','VIRTUAL','merge','include','FaxApplication','findAll','rows','catch','keys','options','find','create','body','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','end','error','send','map','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort'];(function(_0x207100,_0x5b16dc){var _0x201d76=function(_0x9ef9e){while(--_0x9ef9e){_0x207100['push'](_0x207100['shift']());}};_0x201d76(++_0x5b16dc);}(_0xcf34,0x1dc));var _0x4cf3=function(_0x18aaaf,_0x385db6){_0x18aaaf=_0x18aaaf-0x0;var _0x52d892=_0xcf34[_0x18aaaf];return _0x52d892;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4cf3('0x0'));var zipdir=require(_0x4cf3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4cf3('0x2'));var moment=require(_0x4cf3('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4cf3('0x4'));var util=require(_0x4cf3('0x5'));var path=require(_0x4cf3('0x6'));var sox=require('sox');var csv=require(_0x4cf3('0x7'));var ejs=require(_0x4cf3('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4cf3('0x9'));var crypto=require(_0x4cf3('0xa'));var jsforce=require(_0x4cf3('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x4cf3('0x7'));var querystring=require(_0x4cf3('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4cf3('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4cf3('0xe'));var logger=require(_0x4cf3('0xf'))('api');var utils=require(_0x4cf3('0x10'));var config=require(_0x4cf3('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x4cf3('0x12'))['db'];function respondWithStatusCode(_0x51a7f5,_0x1c747a){_0x1c747a=_0x1c747a||0xcc;return function(_0x15bcc7){if(_0x15bcc7){return _0x51a7f5[_0x4cf3('0x13')](_0x1c747a);}return _0x51a7f5[_0x4cf3('0x14')](_0x1c747a)['end']();};}function respondWithResult(_0x46efc1,_0x438bbd){_0x438bbd=_0x438bbd||0xc8;return function(_0x131e2a){if(_0x131e2a){return _0x46efc1[_0x4cf3('0x14')](_0x438bbd)[_0x4cf3('0x15')](_0x131e2a);}};}function respondWithFilteredResult(_0x2cadc4,_0x55e9d3){return function(_0x8ac9c8){if(_0x8ac9c8){var _0x47532=typeof _0x55e9d3['offset']===_0x4cf3('0x16')&&typeof _0x55e9d3[_0x4cf3('0x17')]==='undefined';var _0x268416=_0x8ac9c8[_0x4cf3('0x18')];var _0x43e20c=_0x47532?0x0:_0x55e9d3[_0x4cf3('0x19')];var _0x304343=_0x47532?_0x8ac9c8[_0x4cf3('0x18')]:_0x55e9d3[_0x4cf3('0x19')]+_0x55e9d3[_0x4cf3('0x17')];var _0x3b7005;if(_0x304343>=_0x268416){_0x304343=_0x268416;_0x3b7005=0xc8;}else{_0x3b7005=0xce;}_0x2cadc4[_0x4cf3('0x14')](_0x3b7005);return _0x2cadc4[_0x4cf3('0x1a')](_0x4cf3('0x1b'),_0x43e20c+'-'+_0x304343+'/'+_0x268416)[_0x4cf3('0x15')](_0x8ac9c8);}return null;};}function patchUpdates(_0x97f6f4){return function(_0x434e5d){try{jsonpatch['apply'](_0x434e5d,_0x97f6f4,!![]);}catch(_0x6a16d){return BPromise[_0x4cf3('0x1c')](_0x6a16d);}return _0x434e5d[_0x4cf3('0x1d')]();};}function saveUpdates(_0x24afa9,_0x372d9c){return function(_0x463781){if(_0x463781){return _0x463781[_0x4cf3('0x1e')](_0x24afa9)[_0x4cf3('0x1f')](function(_0x453d89){return _0x453d89;});}return null;};}function removeEntity(_0x26fa8d,_0xfc692c){return function(_0x1d37fe){if(_0x1d37fe){return _0x1d37fe[_0x4cf3('0x20')]()['then'](function(){_0x26fa8d[_0x4cf3('0x14')](0xcc)[_0x4cf3('0x21')]();});}};}function handleEntityNotFound(_0x461b42,_0x251606){return function(_0x50f7be){if(!_0x50f7be){_0x461b42[_0x4cf3('0x13')](0x194);}return _0x50f7be;};}function handleError(_0x1e229e,_0x275075){_0x275075=_0x275075||0x1f4;return function(_0x1a5a4b){logger[_0x4cf3('0x22')](_0x1a5a4b['stack']);if(_0x1a5a4b['name']){delete _0x1a5a4b['name'];}_0x1e229e['status'](_0x275075)[_0x4cf3('0x23')](_0x1a5a4b);};}exports['index']=function(_0x20b102,_0x246d6b){var _0x14b332={},_0x4b332e={},_0x9a7e16={'count':0x0,'rows':[]};var _0x14cf6d=_[_0x4cf3('0x24')](db['FaxApplication'][_0x4cf3('0x25')],function(_0x441da7){return{'name':_0x441da7[_0x4cf3('0x26')],'type':_0x441da7[_0x4cf3('0x27')][_0x4cf3('0x28')]};});_0x4b332e[_0x4cf3('0x29')]=_[_0x4cf3('0x24')](_0x14cf6d,_0x4cf3('0x2a'));_0x4b332e[_0x4cf3('0x2b')]=_['keys'](_0x20b102[_0x4cf3('0x2b')]);_0x4b332e[_0x4cf3('0x2c')]=_[_0x4cf3('0x2d')](_0x4b332e['model'],_0x4b332e['query']);_0x14b332['attributes']=_['intersection'](_0x4b332e['model'],qs[_0x4cf3('0x2e')](_0x20b102['query'][_0x4cf3('0x2e')]));_0x14b332[_0x4cf3('0x2f')]=_0x14b332[_0x4cf3('0x2f')][_0x4cf3('0x30')]?_0x14b332[_0x4cf3('0x2f')]:_0x4b332e['model'];if(!_0x20b102[_0x4cf3('0x2b')][_0x4cf3('0x31')]('nolimit')){_0x14b332[_0x4cf3('0x17')]=qs[_0x4cf3('0x17')](_0x20b102[_0x4cf3('0x2b')][_0x4cf3('0x17')]);_0x14b332[_0x4cf3('0x19')]=qs['offset'](_0x20b102[_0x4cf3('0x2b')][_0x4cf3('0x19')]);}_0x14b332[_0x4cf3('0x32')]=qs[_0x4cf3('0x33')](_0x20b102[_0x4cf3('0x2b')][_0x4cf3('0x33')]);_0x14b332['where']=qs[_0x4cf3('0x2c')](_['pick'](_0x20b102['query'],_0x4b332e['filters']),_0x14cf6d);if(_0x20b102['query'][_0x4cf3('0x34')]){_0x14b332[_0x4cf3('0x35')]=_['merge'](_0x14b332['where'],{'$or':_[_0x4cf3('0x24')](_0x14cf6d,function(_0x276dff){if(_0x276dff[_0x4cf3('0x27')]!==_0x4cf3('0x36')){var _0x37b22b={};_0x37b22b[_0x276dff[_0x4cf3('0x2a')]]={'$like':'%'+_0x20b102[_0x4cf3('0x2b')][_0x4cf3('0x34')]+'%'};return _0x37b22b;}})});}_0x14b332=_[_0x4cf3('0x37')]({},_0x14b332,_0x20b102['options']);var _0x55e31e={'where':_0x14b332[_0x4cf3('0x35')]};return db['FaxApplication'][_0x4cf3('0x18')](_0x55e31e)[_0x4cf3('0x1f')](function(_0x4c266b){_0x9a7e16['count']=_0x4c266b;if(_0x20b102['query']['includeAll']){_0x14b332[_0x4cf3('0x38')]=[{'all':!![]}];}return db[_0x4cf3('0x39')][_0x4cf3('0x3a')](_0x14b332);})[_0x4cf3('0x1f')](function(_0x310b6e){_0x9a7e16[_0x4cf3('0x3b')]=_0x310b6e;return _0x9a7e16;})['then'](respondWithFilteredResult(_0x246d6b,_0x14b332))[_0x4cf3('0x3c')](handleError(_0x246d6b,null));};exports['show']=function(_0x33a534,_0x98ccf6){var _0x47de99={'raw':!![],'where':{'id':_0x33a534['params']['id']}},_0x310737={};_0x310737[_0x4cf3('0x29')]=_[_0x4cf3('0x3d')](db[_0x4cf3('0x39')][_0x4cf3('0x25')]);_0x310737[_0x4cf3('0x2b')]=_[_0x4cf3('0x3d')](_0x33a534[_0x4cf3('0x2b')]);_0x310737[_0x4cf3('0x2c')]=_['intersection'](_0x310737[_0x4cf3('0x29')],_0x310737[_0x4cf3('0x2b')]);_0x47de99[_0x4cf3('0x2f')]=_[_0x4cf3('0x2d')](_0x310737[_0x4cf3('0x29')],qs['fields'](_0x33a534['query'][_0x4cf3('0x2e')]));_0x47de99['attributes']=_0x47de99[_0x4cf3('0x2f')][_0x4cf3('0x30')]?_0x47de99[_0x4cf3('0x2f')]:_0x310737[_0x4cf3('0x29')];if(_0x33a534['query']['includeAll']){_0x47de99['include']=[{'all':!![]}];}_0x47de99=_['merge']({},_0x47de99,_0x33a534[_0x4cf3('0x3e')]);return db[_0x4cf3('0x39')][_0x4cf3('0x3f')](_0x47de99)['then'](handleEntityNotFound(_0x98ccf6,null))[_0x4cf3('0x1f')](respondWithResult(_0x98ccf6,null))[_0x4cf3('0x3c')](handleError(_0x98ccf6,null));};exports[_0x4cf3('0x40')]=function(_0x488dae,_0x1202c6){return db[_0x4cf3('0x39')]['create'](_0x488dae[_0x4cf3('0x41')],{})[_0x4cf3('0x1f')](respondWithResult(_0x1202c6,0xc9))['catch'](handleError(_0x1202c6,null));};exports[_0x4cf3('0x1e')]=function(_0x3376e2,_0x486289){if(_0x3376e2['body']['id']){delete _0x3376e2[_0x4cf3('0x41')]['id'];}return db[_0x4cf3('0x39')][_0x4cf3('0x3f')]({'where':{'id':_0x3376e2['params']['id']}})[_0x4cf3('0x1f')](handleEntityNotFound(_0x486289,null))[_0x4cf3('0x1f')](saveUpdates(_0x3376e2[_0x4cf3('0x41')],null))[_0x4cf3('0x1f')](respondWithResult(_0x486289,null))[_0x4cf3('0x3c')](handleError(_0x486289,null));};exports['destroy']=function(_0x5e635b,_0x1ed8ca){return db[_0x4cf3('0x39')][_0x4cf3('0x3f')]({'where':{'id':_0x5e635b['params']['id']}})['then'](handleEntityNotFound(_0x1ed8ca,null))[_0x4cf3('0x1f')](removeEntity(_0x1ed8ca,null))['catch'](handleError(_0x1ed8ca,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 23e6138..812fdf7 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 _0xc3c4=['./faxApplication.attributes','exports','define','fax_applications','util','../../config/logger','api','moment','path','rimraf'];(function(_0xea91ce,_0x44e887){var _0x142d27=function(_0x3970d3){while(--_0x3970d3){_0xea91ce['push'](_0xea91ce['shift']());}};_0x142d27(++_0x44e887);}(_0xc3c4,0x126));var _0x4c3c=function(_0x5d3da9,_0x5a4656){_0x5d3da9=_0x5d3da9-0x0;var _0x4d6dca=_0xc3c4[_0x5d3da9];return _0x4d6dca;};'use strict';var _=require('lodash');var util=require(_0x4c3c('0x0'));var logger=require(_0x4c3c('0x1'))(_0x4c3c('0x2'));var moment=require(_0x4c3c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4c3c('0x4'));var rimraf=require(_0x4c3c('0x5'));var config=require('../../config/environment');var attributes=require(_0x4c3c('0x6'));module[_0x4c3c('0x7')]=function(_0x11f22d,_0x1785b7){return _0x11f22d[_0x4c3c('0x8')]('FaxApplication',attributes,{'tableName':_0x4c3c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x44da=['path','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication','fax_applications','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0x44da,0x93));var _0xa44d=function(_0x214202,_0x50fc70){_0x214202=_0x214202-0x0;var _0x4991af=_0x44da[_0x214202];return _0x4991af;};'use strict';var _=require(_0xa44d('0x0'));var util=require(_0xa44d('0x1'));var logger=require(_0xa44d('0x2'))(_0xa44d('0x3'));var moment=require(_0xa44d('0x4'));var BPromise=require(_0xa44d('0x5'));var rp=require(_0xa44d('0x6'));var fs=require('fs');var path=require(_0xa44d('0x7'));var rimraf=require('rimraf');var config=require(_0xa44d('0x8'));var attributes=require(_0xa44d('0x9'));module[_0xa44d('0xa')]=function(_0x11aa23,_0x3d9972){return _0x11aa23[_0xa44d('0xb')](_0xa44d('0xc'),attributes,{'tableName':_0xa44d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','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 af16ae9..ff05af5 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 _0x2c7b=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','update','body','options','raw','attributes','limit','UpdateFaxApplication','lodash','util','bluebird','randomstring'];(function(_0x44d0b5,_0x57122f){var _0x325e20=function(_0x350e8e){while(--_0x350e8e){_0x44d0b5['push'](_0x44d0b5['shift']());}};_0x325e20(++_0x57122f);}(_0x2c7b,0x1af));var _0xb2c7=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x2c7b[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0xb2c7('0x0'));var util=require(_0xb2c7('0x1'));var moment=require('moment');var BPromise=require(_0xb2c7('0x2'));var rs=require(_0xb2c7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb2c7('0x4'));var logger=require(_0xb2c7('0x5'))(_0xb2c7('0x6'));var config=require(_0xb2c7('0x7'));var jayson=require(_0xb2c7('0x8'));var client=jayson['client'][_0xb2c7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x27d6f,_0x3bd2c7,_0x50f7b5){return new BPromise(function(_0x1076c0,_0x55f679){return client[_0xb2c7('0xa')](_0x27d6f,_0x50f7b5)[_0xb2c7('0xb')](function(_0x364572){logger['info'](_0xb2c7('0xc'),_0x3bd2c7,_0xb2c7('0xd'));logger[_0xb2c7('0xe')](_0xb2c7('0xf'),_0x3bd2c7,_0xb2c7('0xd'),JSON[_0xb2c7('0x10')](_0x364572));if(_0x364572[_0xb2c7('0x11')]){if(_0x364572['error'][_0xb2c7('0x12')]===0x1f4){logger[_0xb2c7('0x11')](_0xb2c7('0xc'),_0x3bd2c7,_0x364572[_0xb2c7('0x11')][_0xb2c7('0x13')]);return _0x55f679(_0x364572['error']['message']);}logger['error'](_0xb2c7('0xc'),_0x3bd2c7,_0x364572['error'][_0xb2c7('0x13')]);return _0x1076c0(_0x364572[_0xb2c7('0x11')][_0xb2c7('0x13')]);}else{logger[_0xb2c7('0x14')]('FaxApplication,\x20%s,\x20%s',_0x3bd2c7,'request\x20sent');_0x1076c0(_0x364572['result'][_0xb2c7('0x13')]);}})[_0xb2c7('0x15')](function(_0x56729f){logger[_0xb2c7('0x11')](_0xb2c7('0xc'),_0x3bd2c7,_0x56729f);_0x55f679(_0x56729f);});});}exports['UpdateFaxApplication']=function(_0x2cd409){var _0x1ba79d=this;return new Promise(function(_0x41b5f9,_0xbc55df){return db['FaxApplication'][_0xb2c7('0x16')](_0x2cd409[_0xb2c7('0x17')],{'raw':_0x2cd409[_0xb2c7('0x18')]?_0x2cd409[_0xb2c7('0x18')][_0xb2c7('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2cd409[_0xb2c7('0x18')]?_0x2cd409[_0xb2c7('0x18')]['where']||null:null,'attributes':_0x2cd409[_0xb2c7('0x18')]?_0x2cd409['options'][_0xb2c7('0x1a')]||null:null,'limit':_0x2cd409[_0xb2c7('0x18')]?_0x2cd409[_0xb2c7('0x18')][_0xb2c7('0x1b')]||null:null})[_0xb2c7('0xb')](function(_0x25dd46){logger['info']('UpdateFaxApplication',_0x2cd409);logger['debug'](_0xb2c7('0x1c'),_0x2cd409,JSON['stringify'](_0x25dd46));_0x41b5f9(_0x25dd46);})[_0xb2c7('0x15')](function(_0x21516f){logger['error'](_0xb2c7('0x1c'),_0x21516f[_0xb2c7('0x13')],_0x2cd409);_0xbc55df(_0x1ba79d[_0xb2c7('0x11')](0x1f4,_0x21516f[_0xb2c7('0x13')]));});});}; \ No newline at end of file +var _0xf273=['attributes','limit','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxApplication,\x20%s,\x20%s','message','result','UpdateFaxApplication','FaxApplication','body','options'];(function(_0x3a0547,_0x326ff4){var _0x4db884=function(_0x355a2c){while(--_0x355a2c){_0x3a0547['push'](_0x3a0547['shift']());}};_0x4db884(++_0x326ff4);}(_0xf273,0xce));var _0x3f27=function(_0x2b94a1,_0x134a4d){_0x2b94a1=_0x2b94a1-0x0;var _0x3a7615=_0xf273[_0x2b94a1];return _0x3a7615;};'use strict';var _=require(_0x3f27('0x0'));var util=require(_0x3f27('0x1'));var moment=require(_0x3f27('0x2'));var BPromise=require(_0x3f27('0x3'));var rs=require(_0x3f27('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3f27('0x5'))['db'];var utils=require(_0x3f27('0x6'));var logger=require(_0x3f27('0x7'))(_0x3f27('0x8'));var config=require(_0x3f27('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3f27('0xa')][_0x3f27('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x30854a,_0x4eaa55,_0x581c9e){return new BPromise(function(_0x2a5338,_0x892cc){return client[_0x3f27('0xc')](_0x30854a,_0x581c9e)[_0x3f27('0xd')](function(_0x1eb6c6){logger['info']('FaxApplication,\x20%s,\x20%s',_0x4eaa55,_0x3f27('0xe'));logger['debug'](_0x3f27('0xf'),_0x4eaa55,_0x3f27('0xe'),JSON[_0x3f27('0x10')](_0x1eb6c6));if(_0x1eb6c6[_0x3f27('0x11')]){if(_0x1eb6c6[_0x3f27('0x11')][_0x3f27('0x12')]===0x1f4){logger[_0x3f27('0x11')](_0x3f27('0x13'),_0x4eaa55,_0x1eb6c6[_0x3f27('0x11')][_0x3f27('0x14')]);return _0x892cc(_0x1eb6c6[_0x3f27('0x11')]['message']);}logger[_0x3f27('0x11')](_0x3f27('0x13'),_0x4eaa55,_0x1eb6c6['error'][_0x3f27('0x14')]);return _0x2a5338(_0x1eb6c6[_0x3f27('0x11')][_0x3f27('0x14')]);}else{logger['info'](_0x3f27('0x13'),_0x4eaa55,'request\x20sent');_0x2a5338(_0x1eb6c6[_0x3f27('0x15')]['message']);}})['catch'](function(_0x197ad4){logger[_0x3f27('0x11')](_0x3f27('0x13'),_0x4eaa55,_0x197ad4);_0x892cc(_0x197ad4);});});}exports[_0x3f27('0x16')]=function(_0x11bbe8){var _0x396536=this;return new Promise(function(_0x26f141,_0x253772){return db[_0x3f27('0x17')]['update'](_0x11bbe8[_0x3f27('0x18')],{'raw':_0x11bbe8['options']?_0x11bbe8['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11bbe8[_0x3f27('0x19')]?_0x11bbe8[_0x3f27('0x19')]['where']||null:null,'attributes':_0x11bbe8[_0x3f27('0x19')]?_0x11bbe8[_0x3f27('0x19')][_0x3f27('0x1a')]||null:null,'limit':_0x11bbe8['options']?_0x11bbe8['options'][_0x3f27('0x1b')]||null:null})[_0x3f27('0xd')](function(_0x1003fe){logger['info']('UpdateFaxApplication',_0x11bbe8);logger[_0x3f27('0x1c')](_0x3f27('0x16'),_0x11bbe8,JSON[_0x3f27('0x10')](_0x1003fe));_0x26f141(_0x1003fe);})['catch'](function(_0x71f74c){logger[_0x3f27('0x11')](_0x3f27('0x16'),_0x71f74c[_0x3f27('0x14')],_0x11bbe8);_0x253772(_0x396536[_0x3f27('0x11')](0x1f4,_0x71f74c[_0x3f27('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index d2cdc89..445e5be 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 _0x80ed=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer'];(function(_0x43a37c,_0x25a567){var _0x5d1d40=function(_0x3ec673){while(--_0x3ec673){_0x43a37c['push'](_0x43a37c['shift']());}};_0x5d1d40(++_0x25a567);}(_0x80ed,0x11c));var _0xd80e=function(_0x35e05f,_0x2d6122){_0x35e05f=_0x35e05f-0x0;var _0x13591d=_0x80ed[_0x35e05f];return _0x13591d;};'use strict';var multer=require(_0xd80e('0x0'));var util=require('util');var path=require(_0xd80e('0x1'));var timeout=require(_0xd80e('0x2'));var express=require(_0xd80e('0x3'));var router=express['Router']();var fs_extra=require(_0xd80e('0x4'));var auth=require(_0xd80e('0x5'));var interaction=require(_0xd80e('0x6'));var config=require(_0xd80e('0x7'));var controller=require('./faxApplication.controller');router[_0xd80e('0x8')]('/',auth[_0xd80e('0x9')](),controller[_0xd80e('0xa')]);router['get'](_0xd80e('0xb'),auth[_0xd80e('0x9')](),controller[_0xd80e('0xc')]);router[_0xd80e('0xd')]('/',auth[_0xd80e('0x9')](),controller[_0xd80e('0xe')]);router[_0xd80e('0xf')](_0xd80e('0xb'),auth[_0xd80e('0x9')](),controller[_0xd80e('0x10')]);router['delete'](_0xd80e('0xb'),auth[_0xd80e('0x9')](),controller[_0xd80e('0x11')]);module[_0xd80e('0x12')]=router; \ No newline at end of file +var _0xb688=['show','post','create','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','index','/:id','isAuthenticated'];(function(_0x4bfac3,_0x58324d){var _0x15f0f2=function(_0xf0c511){while(--_0xf0c511){_0x4bfac3['push'](_0x4bfac3['shift']());}};_0x15f0f2(++_0x58324d);}(_0xb688,0xcf));var _0x8b68=function(_0x1f1391,_0x52ba35){_0x1f1391=_0x1f1391-0x0;var _0x38c0c9=_0xb688[_0x1f1391];return _0x38c0c9;};'use strict';var multer=require('multer');var util=require(_0x8b68('0x0'));var path=require(_0x8b68('0x1'));var timeout=require(_0x8b68('0x2'));var express=require(_0x8b68('0x3'));var router=express[_0x8b68('0x4')]();var fs_extra=require(_0x8b68('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var controller=require(_0x8b68('0x8'));router[_0x8b68('0x9')]('/',auth['isAuthenticated'](),controller[_0x8b68('0xa')]);router['get'](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xd')]);router[_0x8b68('0xe')]('/',auth[_0x8b68('0xc')](),controller[_0x8b68('0xf')]);router[_0x8b68('0x10')](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x11')]);router[_0x8b68('0x12')](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller['destroy']);module[_0x8b68('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 46d4827..0028bae 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 _0x5727=['out','DATE','ENUM','sequelize','exports','BOOLEAN','STRING'];(function(_0x2f769e,_0x33e588){var _0x89d8ba=function(_0x3af8c3){while(--_0x3af8c3){_0x2f769e['push'](_0x2f769e['shift']());}};_0x89d8ba(++_0x33e588);}(_0x5727,0xb2));var _0x7572=function(_0x144c51,_0x9327f0){_0x144c51=_0x144c51-0x0;var _0x24653f=_0x5727[_0x144c51];return _0x24653f;};'use strict';var Sequelize=require(_0x7572('0x0'));module[_0x7572('0x1')]={'closed':{'type':Sequelize[_0x7572('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x7572('0x3')]},'secondDisposition':{'type':Sequelize[_0x7572('0x3')]},'thirdDisposition':{'type':Sequelize[_0x7572('0x3')]},'note':{'type':Sequelize[_0x7572('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0x7572('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x7572('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x7572('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x7572('0x6')]('in',_0x7572('0x4')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x9209=['BOOLEAN','DATE','STRING','out','ENUM','sequelize','exports'];(function(_0x4b0f49,_0x111df0){var _0xa17ed6=function(_0x325e9a){while(--_0x325e9a){_0x4b0f49['push'](_0x4b0f49['shift']());}};_0xa17ed6(++_0x111df0);}(_0x9209,0x98));var _0x9920=function(_0x24812b,_0x1dfe1e){_0x24812b=_0x24812b-0x0;var _0x5b817e=_0x9209[_0x24812b];return _0x5b817e;};'use strict';var Sequelize=require(_0x9920('0x0'));module[_0x9920('0x1')]={'closed':{'type':Sequelize[_0x9920('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9920('0x3')]},'disposition':{'type':Sequelize[_0x9920('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x9920('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x9920('0x3')]},'fax':{'type':Sequelize[_0x9920('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x9920('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9920('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x9920('0x6')]('in',_0x9920('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 810d0db..9f6c072 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 _0xa749=['Tag','union','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','start','some','isEmpty','where','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','FaxAccountId','i.FaxAccountId\x20IS\x20NOT\x20NULL','role','agent','user','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','catch','params','includeAll','include','options','create','destroy','describe','addMessage','omit','getMessages','FaxMessage','pick','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','ids','spread','findAll','faxInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','basename','existsSync','pipe','createWriteStream','log','err','unlinkSync','sendStatus','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','to-csv','fs-extra','lodash','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','redis','./faxInteraction.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','end','error','stack','name','send','map','TagIds','Tags','split','forEach','push','index','FaxInteraction','rawAttributes','fieldName','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','field','color','tools_tags','u.id','u.fullname','ui.FaxInteractionId','from','users','u.id\x20=\x20ui.UserId','select','fax_interactions','left_join','cm_contacts','o.id\x20=\x20i.UserId','fax_accounts','fax_messages','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text'];(function(_0x380fa9,_0x5123eb){var _0x4f2532=function(_0x4bde43){while(--_0x4bde43){_0x380fa9['push'](_0x380fa9['shift']());}};_0x4f2532(++_0x5123eb);}(_0xa749,0x150));var _0x9a74=function(_0x236119,_0x52cb57){_0x236119=_0x236119-0x0;var _0x1f015d=_0xa749[_0x236119];return _0x1f015d;};'use strict';var emlformat=require(_0x9a74('0x0'));var rimraf=require(_0x9a74('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9a74('0x2'));var rp=require('request-promise');var moment=require(_0x9a74('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9a74('0x4'));var util=require(_0x9a74('0x5'));var path=require(_0x9a74('0x6'));var sox=require('sox');var csv=require(_0x9a74('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9a74('0x8'));var _=require(_0x9a74('0x9'));var squel=require(_0x9a74('0xa'));var crypto=require('crypto');var jsforce=require(_0x9a74('0xb'));var deskjs=require(_0x9a74('0xc'));var toCsv=require(_0x9a74('0x7'));var querystring=require(_0x9a74('0xd'));var Papa=require(_0x9a74('0xe'));var Redis=require(_0x9a74('0xf'));var authService=require(_0x9a74('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9a74('0x11'));var hardwareService=require(_0x9a74('0x12'));var logger=require(_0x9a74('0x13'))(_0x9a74('0x14'));var utils=require(_0x9a74('0x15'));var config=require(_0x9a74('0x16'));var licenseUtil=require(_0x9a74('0x17'));var db=require(_0x9a74('0x18'))['db'];config[_0x9a74('0x19')]=_['defaults'](config[_0x9a74('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9a74('0x19')]));require(_0x9a74('0x1a'))[_0x9a74('0x1b')](socket);function respondWithStatusCode(_0x19fd5e,_0x36894d){_0x36894d=_0x36894d||0xcc;return function(_0x1caa43){if(_0x1caa43){return _0x19fd5e['sendStatus'](_0x36894d);}return _0x19fd5e[_0x9a74('0x1c')](_0x36894d)['end']();};}function respondWithResult(_0x277f87,_0x49942d){_0x49942d=_0x49942d||0xc8;return function(_0xd66eb2){if(_0xd66eb2){return _0x277f87[_0x9a74('0x1c')](_0x49942d)[_0x9a74('0x1d')](_0xd66eb2);}};}function respondWithFilteredResult(_0x266f43,_0x1209f0){return function(_0x5b4d2d){if(_0x5b4d2d){var _0x4157f9=typeof _0x1209f0[_0x9a74('0x1e')]===_0x9a74('0x1f')&&typeof _0x1209f0[_0x9a74('0x20')]===_0x9a74('0x1f');var _0x35ea0e=_0x5b4d2d[_0x9a74('0x21')];var _0x3d9e27=_0x4157f9?0x0:_0x1209f0[_0x9a74('0x1e')];var _0x52fb57=_0x4157f9?_0x5b4d2d['count']:_0x1209f0[_0x9a74('0x1e')]+_0x1209f0[_0x9a74('0x20')];var _0x5dca85;if(_0x52fb57>=_0x35ea0e){_0x52fb57=_0x35ea0e;_0x5dca85=0xc8;}else{_0x5dca85=0xce;}_0x266f43[_0x9a74('0x1c')](_0x5dca85);return _0x266f43[_0x9a74('0x22')](_0x9a74('0x23'),_0x3d9e27+'-'+_0x52fb57+'/'+_0x35ea0e)[_0x9a74('0x1d')](_0x5b4d2d);}return null;};}function patchUpdates(_0x318b4c){return function(_0x3da4b6){try{jsonpatch[_0x9a74('0x24')](_0x3da4b6,_0x318b4c,!![]);}catch(_0x594193){return BPromise['reject'](_0x594193);}return _0x3da4b6[_0x9a74('0x25')]();};}function saveUpdates(_0x255d43,_0x5a0793){return function(_0x5bc9ef){if(_0x5bc9ef){return _0x5bc9ef[_0x9a74('0x26')](_0x255d43)[_0x9a74('0x27')](function(_0x343d2c){return _0x343d2c;});}return null;};}function removeEntity(_0x30a13c,_0x29ec0d){return function(_0x2a0ec7){if(_0x2a0ec7){return _0x2a0ec7['destroy']()[_0x9a74('0x27')](function(){_0x30a13c[_0x9a74('0x1c')](0xcc)[_0x9a74('0x28')]();});}};}function handleEntityNotFound(_0x40f0b7,_0x2faca1){return function(_0x119e51){if(!_0x119e51){_0x40f0b7['sendStatus'](0x194);}return _0x119e51;};}function handleError(_0x5c6fe3,_0x32bf0c){_0x32bf0c=_0x32bf0c||0x1f4;return function(_0x4a1ab3){logger[_0x9a74('0x29')](_0x4a1ab3[_0x9a74('0x2a')]);if(_0x4a1ab3[_0x9a74('0x2b')]){delete _0x4a1ab3[_0x9a74('0x2b')];}_0x5c6fe3[_0x9a74('0x1c')](_0x32bf0c)[_0x9a74('0x2c')](_0x4a1ab3);};}function getInteractionUsers(_0x4c556d,_0x33364e){return new BPromise(function(_0x38a0ca,_0x3544d6){try{if(_0x33364e[_0x4c556d['id']]){_0x4c556d['Users']=_[_0x9a74('0x2d')](_0x33364e[_0x4c556d['id']],function(_0x582f25){return{'id':_0x582f25['id'],'fullname':_0x582f25['fullname']};});}}catch(_0x4acda9){_0x3544d6(_0x4acda9);}_0x38a0ca(_0x4c556d);});}function getInteractionTags(_0x20ed3f,_0x4822be){return new BPromise(function(_0x1d8984,_0x45b2b6){try{if(_0x20ed3f[_0x9a74('0x2e')]){_0x20ed3f[_0x9a74('0x2f')]=[];_0x20ed3f[_0x9a74('0x2e')][_0x9a74('0x30')](',')[_0x9a74('0x31')](function(_0x42ce83){_0x20ed3f[_0x9a74('0x2f')][_0x9a74('0x32')](_0x4822be[_0x42ce83]);});}delete _0x20ed3f[_0x9a74('0x2e')];}catch(_0x54a90a){_0x45b2b6(_0x54a90a);}_0x1d8984(_0x20ed3f);});}function updateFaxInteraction(_0x55bcc4,_0x171191,_0x5420ad){return new BPromise(function(_0x5b7671,_0x530f64){return getInteractionUsers(_0x55bcc4,_0x5420ad)['then'](function(_0x369c99){return getInteractionTags(_0x369c99,_0x171191);})['then'](function(_0x2fd50e){_0x5b7671(_0x2fd50e);})['catch'](function(_0x1c37b7){_0x530f64(_0x1c37b7);});});}exports[_0x9a74('0x33')]=function(_0x37484e,_0x202462){var _0x105276={},_0xbd45af={},_0x444439={'count':0x0,'rows':[]};var _0x5c4345=_['map'](db[_0x9a74('0x34')][_0x9a74('0x35')],function(_0x3e539d){return{'name':_0x3e539d[_0x9a74('0x36')],'type':_0x3e539d['type'][_0x9a74('0x37')]};});_0xbd45af['model']=_[_0x9a74('0x2d')](_0x5c4345,_0x9a74('0x2b'));_0xbd45af[_0x9a74('0x38')]=_[_0x9a74('0x39')](_0x37484e['query']);_0xbd45af['filters']=_['intersection'](_0xbd45af[_0x9a74('0x3a')],_0xbd45af['query']);_0x105276[_0x9a74('0x3b')]=_[_0x9a74('0x3c')](_0xbd45af['model'],qs[_0x9a74('0x3d')](_0x37484e[_0x9a74('0x38')][_0x9a74('0x3d')]));_0x105276['attributes']=_0x105276['attributes'][_0x9a74('0x3e')]?_0x105276[_0x9a74('0x3b')]:_0xbd45af[_0x9a74('0x3a')];if(!_0x37484e['query'][_0x9a74('0x3f')](_0x9a74('0x40'))){_0x105276['limit']=qs[_0x9a74('0x20')](_0x37484e['query'][_0x9a74('0x20')]);_0x105276[_0x9a74('0x1e')]=qs[_0x9a74('0x1e')](_0x37484e[_0x9a74('0x38')][_0x9a74('0x1e')]);}_0x105276[_0x9a74('0x41')]=qs[_0x9a74('0x42')](_0x37484e[_0x9a74('0x38')][_0x9a74('0x42')]);_0x105276['where']=qs[_0x9a74('0x43')](_['pick'](_0x37484e[_0x9a74('0x38')],_0xbd45af['filters']),_0x5c4345);var _0x38a13e=[];var _0x4e34a1=squel['select']()[_0x9a74('0x44')]('id')['field']('name')['field'](_0x9a74('0x45'))['from'](_0x9a74('0x46'));var _0x134fa6=squel['select']()['field'](_0x9a74('0x47'))[_0x9a74('0x44')](_0x9a74('0x48'))[_0x9a74('0x44')](_0x9a74('0x49'))[_0x9a74('0x4a')]('user_has_fax_interactions','ui')['left_join'](_0x9a74('0x4b'),'u',_0x9a74('0x4c'));var _0xaa52a5=squel[_0x9a74('0x4d')]()[_0x9a74('0x4a')](_0x9a74('0x4e'),'i')[_0x9a74('0x4f')](_0x9a74('0x50'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x9a74('0x4f')]('users','o',_0x9a74('0x51'))[_0x9a74('0x4f')](_0x9a74('0x52'),'a','a.id\x20=\x20i.FaxAccountId')[_0x9a74('0x4f')](_0x9a74('0x53'),'me','me.FaxInteractionId\x20=\x20i.id')['left_join'](_0x9a74('0x54'),'it',_0x9a74('0x55'))[_0x9a74('0x4f')]('tools_tags','t',_0x9a74('0x56'));var _0x297bea=squel[_0x9a74('0x57')]();var _0x31ae8e=[];var _0x5bdcd4=squel[_0x9a74('0x57')]();var _0x3480f6;if(_0x37484e['query'][_0x9a74('0x58')]){_0x3480f6=as[_0x9a74('0x59')](_0x37484e[_0x9a74('0x38')][_0x9a74('0x58')]);var _0x176857=_0x3480f6[_0x9a74('0x5a')];for(var _0x36ffa6=0x0;_0x36ffa6<_0x3480f6[_0x9a74('0x5b')][_0x9a74('0x3e')];_0x36ffa6++){var _0x504b89=_0x3480f6[_0x9a74('0x5b')][_0x36ffa6];var _0x879ef6='i';var _0x41db5e=_[_0x9a74('0x5c')](_0x5c4345,[_0x9a74('0x2b'),_0x504b89[_0x9a74('0x44')]]);if(!_0x41db5e){switch(_0x504b89[_0x9a74('0x44')]){case _0x9a74('0x5d'):if(_0x504b89['value']==0x1){_0xaa52a5[_0x9a74('0x5e')]('`'+_0x504b89['field']+_0x9a74('0x5f'));}else{_0xaa52a5[_0x9a74('0x5e')]('`'+_0x504b89[_0x9a74('0x44')]+_0x9a74('0x60'));}break;case'Contact':if(_0x504b89['operator']===_0x9a74('0x61')){if(_0x504b89[_0x9a74('0x62')][_0x9a74('0x30')]('\x20')['length']>0x1){_0x297bea[_0x176857](_0x9a74('0x63'),qs[_0x9a74('0x64')](_0x504b89[_0x9a74('0x62')]),null);}else{var _0x4ba50a='%'+_0x504b89[_0x9a74('0x62')]+'%';_0x297bea[_0x176857](_0x9a74('0x65'),_0x4ba50a,_0x4ba50a,_0x4ba50a);}}else{_0x41db5e=_['find'](_0x5c4345,['name',_0x9a74('0x66')]);_0x504b89[_0x9a74('0x44')]=_0x9a74('0x66');_0x1657dc=as[_0x9a74('0x67')](_0x879ef6,_0x41db5e[_0x9a74('0x68')],_0x504b89);_0x297bea[_0x176857](_0x1657dc[_0x9a74('0x69')],_0x1657dc[_0x9a74('0x62')]['start'],_0x1657dc[_0x9a74('0x62')][_0x9a74('0x28')]);}break;case _0x9a74('0x6a'):var _0x4a46bb=_0x504b89[_0x9a74('0x62')][_0x9a74('0x30')](',')[_0x9a74('0x2d')](function(_0x57e313){return Number(_0x57e313);});_0x4a46bb[_0x9a74('0x31')](function(_0x21552e){_0x5bdcd4['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x21552e+',%');});_0x31ae8e=_[_0x9a74('0x6b')](_0x31ae8e,_0x4a46bb);break;case'User':if(_0x504b89[_0x9a74('0x6c')]===_0x9a74('0x61')){_0x297bea[_0x176857](_0x9a74('0x6d'),'%'+_0x504b89['value']+'%',null);}else{_0x41db5e=_[_0x9a74('0x5c')](_0x5c4345,[_0x9a74('0x2b'),_0x9a74('0x6e')]);_0x504b89['field']=_0x9a74('0x6e');_0x1657dc=as[_0x9a74('0x67')](_0x879ef6,_0x41db5e[_0x9a74('0x68')],_0x504b89);_0x297bea[_0x176857](_0x1657dc[_0x9a74('0x69')],_0x1657dc[_0x9a74('0x62')]['start'],_0x1657dc[_0x9a74('0x62')][_0x9a74('0x28')]);}break;case _0x9a74('0x6f'):_0x1657dc=as[_0x9a74('0x67')]('me',null,_0x504b89);_0x297bea[_0x176857](_0x1657dc[_0x9a74('0x69')],_0x1657dc[_0x9a74('0x62')]['start'],_0x1657dc[_0x9a74('0x62')][_0x9a74('0x28')]);break;}}else{var _0x1657dc=as[_0x9a74('0x67')](_0x879ef6,_0x41db5e[_0x9a74('0x68')],_0x504b89);_0x297bea[_0x176857](_0x1657dc[_0x9a74('0x69')],_0x1657dc[_0x9a74('0x62')][_0x9a74('0x70')],_0x1657dc[_0x9a74('0x62')][_0x9a74('0x28')]);}}}else{var _0x580165=_(_0x37484e[_0x9a74('0x38')])[_0x9a74('0x39')]()['map'](function(_0x48964c){return _[_0x9a74('0x71')](_0x5c4345,[_0x9a74('0x2b'),_0x48964c])?_0x48964c:undefined;})['compact']()['value']();if(!_[_0x9a74('0x72')](_0x580165)){_0x580165['forEach'](function(_0x28d849){if(_0x28d849==='FaxAccountId'){_0xaa52a5[_0x9a74('0x73')](_0x9a74('0x74'),[][_0x9a74('0x75')](_0x37484e['query'][_0x28d849]));}else if(_0x28d849===_0x9a74('0x76')){var _0x258602=JSON[_0x9a74('0x77')](_0x37484e[_0x9a74('0x38')][_0x28d849])[_0x9a74('0x78')];var _0x102a44=JSON['parse'](_0x37484e['query'][_0x28d849])[_0x9a74('0x79')];_0xaa52a5[_0x9a74('0x73')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x258602,_0x102a44);}else{if(_0x37484e[_0x9a74('0x38')][_0x28d849]===_0x9a74('0x7a')){_0xaa52a5[_0x9a74('0x73')]('i.'+_0x28d849+_0x9a74('0x7b'));}else{_0xaa52a5[_0x9a74('0x73')]('i.'+_0x28d849+'\x20=\x20?',_0x37484e[_0x9a74('0x38')][_0x28d849]);}}});}if(_0x37484e['query'][_0x9a74('0x7c')]){if(_0x37484e[_0x9a74('0x38')]['read']==0x1){_0xaa52a5[_0x9a74('0x5e')](_0x9a74('0x7d'));}else{_0xaa52a5[_0x9a74('0x5e')](_0x9a74('0x7e'));}}if(_0x37484e['query'][_0x9a74('0x7f')]){_0x31ae8e=_[_0x9a74('0x80')](_0x37484e['query']['tag'])?_0x37484e[_0x9a74('0x38')][_0x9a74('0x7f')]:new Array(_0x37484e[_0x9a74('0x38')][_0x9a74('0x7f')]);_0x31ae8e['forEach'](function(_0x35d2ea){_0x5bdcd4['or'](_0x9a74('0x81'),'%,'+_0x35d2ea+',%');});}if(_0x37484e[_0x9a74('0x38')][_0x9a74('0x82')]){var _0x55e68b=_0x37484e[_0x9a74('0x38')][_0x9a74('0x82')][_0x9a74('0x83')]('\x5c','\x5c\x5c')[_0x9a74('0x83')](/'/g,'\x27\x27');if(qs[_0x9a74('0x84')](_0x55e68b)){_0x297bea['or']('i.id\x20LIKE\x20?',_0x55e68b+'%')['or'](_0x9a74('0x85'),_0x55e68b+'%');}_0x297bea['or'](_0x9a74('0x86'),_0x55e68b+'%');}}_0xaa52a5[_0x9a74('0x73')](_0x297bea);_0xaa52a5[_0x9a74('0x87')]('i.id');var _0x291e26={'type':db[_0x9a74('0x88')][_0x9a74('0x89')][_0x9a74('0x8a')],'raw':!![]};var _0x42800f=_0xaa52a5[_0x9a74('0x8b')]();_0x42800f[_0x9a74('0x44')]('i.id');_0x42800f['field'](_0x9a74('0x8c'),_0x9a74('0x5d'));if(_0x105276[_0x9a74('0x41')]){_0x105276[_0x9a74('0x41')][_0x9a74('0x31')](function(_0x261105){var _0x5b4d20=_0x261105[0x0]===_0x9a74('0x8d')?_0x261105[0x0]:'i.'+_0x261105[0x0];_0xaa52a5['order'](_0x5b4d20,_0x261105[0x1]===_0x9a74('0x8e')?![]:!![]);});}if(!_['isEmpty'](_0x31ae8e)){_0xaa52a5[_0x9a74('0x5e')](_0x5bdcd4);_0x42800f['where'](_0x9a74('0x8f'),_0x31ae8e);}BPromise[_0x9a74('0x90')]()[_0x9a74('0x27')](function(){if(!_0x3480f6){if(_0x37484e[_0x9a74('0x38')][_0x9a74('0x91')])return;_0x42800f[_0x9a74('0x73')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0xaa52a5[_0x9a74('0x73')](_0x9a74('0x92'));return;}if(_0x37484e['user'][_0x9a74('0x93')]!==_0x9a74('0x94'))return;return _0x37484e[_0x9a74('0x95')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0x9a74('0x27')](function(_0x478bf8){if(_[_0x9a74('0x72')](_0x478bf8)){_0x42800f['where'](_0x9a74('0x96'));_0xaa52a5[_0x9a74('0x73')](_0x9a74('0x96'));}else{_0x42800f[_0x9a74('0x73')](_0x9a74('0x74'),_[_0x9a74('0x2d')](_0x478bf8,'id'));_0xaa52a5[_0x9a74('0x73')](_0x9a74('0x74'),_[_0x9a74('0x2d')](_0x478bf8,'id'));}});})[_0x9a74('0x27')](function(){if(_0x37484e[_0x9a74('0x95')][_0x9a74('0x93')]===_0x9a74('0x94')&&!_0x3480f6&&!_0x37484e['query'][_0x9a74('0x91')])return[];return db[_0x9a74('0x97')][_0x9a74('0x38')](_0x42800f[_0x9a74('0x98')](),_0x291e26);})['then'](function(_0x59dc3a){_0x444439[_0x9a74('0x21')]=_0x59dc3a[_0x9a74('0x3e')];if(_0x444439[_0x9a74('0x21')]===0x0)return[];return db[_0x9a74('0x97')][_0x9a74('0x38')](_0x4e34a1[_0x9a74('0x98')](),_0x291e26)['then'](function(_0x149265){_0x38a13e=_['keyBy'](_0x149265,'id');_0x291e26=_[_0x9a74('0x99')](_0x291e26,{'model':db[_0x9a74('0x34')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x37484e[_0x9a74('0x38')]['fields']){_0x105276['attributes'][_0x9a74('0x31')](function(_0x503f95){_0xaa52a5[_0x9a74('0x44')]('i.'+_0x503f95);});}else{_0xaa52a5[_0x9a74('0x44')](_0x9a74('0x8c'),_0x9a74('0x5d'));_0xaa52a5[_0x9a74('0x44')](_0x9a74('0x9a'),_0x9a74('0x9b'));_0xaa52a5[_0x9a74('0x44')](_0x9a74('0x9c'),_0x9a74('0x9d'));_0xaa52a5[_0x9a74('0x44')](_0x9a74('0x9e'),_0x9a74('0x8d'));_0xaa52a5[_0x9a74('0x44')](_0x9a74('0x9f'));_0xaa52a5[_0x9a74('0x44')](_0x9a74('0xa0'),_0x9a74('0xa1'));_0xaa52a5[_0x9a74('0x44')](_0x9a74('0xa2'),'Contact.lastName');_0xaa52a5[_0x9a74('0x44')](_0x9a74('0xa3'),'Contact.email');_0xaa52a5[_0x9a74('0x44')](_0x9a74('0xa4'),_0x9a74('0xa5'));_0xaa52a5[_0x9a74('0x44')](_0x9a74('0xa6'),_0x9a74('0xa7'));_0xaa52a5[_0x9a74('0x44')](_0x9a74('0xa8'),_0x9a74('0xa9'));_0xaa52a5['field'](_0x9a74('0xaa'),_0x9a74('0xab'));_0xaa52a5[_0x9a74('0x44')]('o.internal',_0x9a74('0xac'));_0xaa52a5[_0x9a74('0x44')](_0x9a74('0xad'),'TagIds');}if(_0x105276[_0x9a74('0x20')])_0xaa52a5[_0x9a74('0x20')](_0x105276[_0x9a74('0x20')]);if(_0x105276['offset'])_0xaa52a5['offset'](_0x105276[_0x9a74('0x1e')]);return db['sequelize'][_0x9a74('0x38')](_0xaa52a5[_0x9a74('0x98')](),_0x291e26);})[_0x9a74('0x27')](function(_0x2cdf07){if(_0x2cdf07[_0x9a74('0x3e')]>0x0)_0x134fa6[_0x9a74('0x73')](_0x9a74('0xae'),_[_0x9a74('0x2d')](_0x2cdf07,'id'));return db[_0x9a74('0x97')][_0x9a74('0x38')](_0x134fa6['toString'](),_0x291e26)['then'](function(_0x288de7){var _0x13942b=_[_0x9a74('0xaf')](_0x288de7,_0x9a74('0xb0'));var _0x1be9d8=[];_0x2cdf07['forEach'](function(_0x2d2de7){_0x1be9d8[_0x9a74('0x32')](updateFaxInteraction(_0x2d2de7,_0x38a13e,_0x13942b));});return BPromise[_0x9a74('0xb1')](_0x1be9d8);});});})[_0x9a74('0x27')](function(_0x110999){_0x444439['rows']=_0x110999;return _0x444439;})[_0x9a74('0x27')](respondWithFilteredResult(_0x202462,_0x105276))[_0x9a74('0xb2')](handleError(_0x202462,null));};exports['show']=function(_0xb58451,_0x33cd5c){var _0x761647={'raw':![],'where':{'id':_0xb58451[_0x9a74('0xb3')]['id']}},_0x5d0f69={};_0x5d0f69[_0x9a74('0x3a')]=_['keys'](db[_0x9a74('0x34')][_0x9a74('0x35')]);_0x5d0f69[_0x9a74('0x38')]=_[_0x9a74('0x39')](_0xb58451['query']);_0x5d0f69[_0x9a74('0x43')]=_['intersection'](_0x5d0f69['model'],_0x5d0f69[_0x9a74('0x38')]);_0x761647[_0x9a74('0x3b')]=_[_0x9a74('0x3c')](_0x5d0f69['model'],qs[_0x9a74('0x3d')](_0xb58451[_0x9a74('0x38')][_0x9a74('0x3d')]));_0x761647[_0x9a74('0x3b')]=_0x761647[_0x9a74('0x3b')][_0x9a74('0x3e')]?_0x761647['attributes']:_0x5d0f69[_0x9a74('0x3a')];if(_0xb58451[_0x9a74('0x38')][_0x9a74('0xb4')]){_0x761647[_0x9a74('0xb5')]=[{'all':!![]}];}_0x761647=_['merge']({},_0x761647,_0xb58451[_0x9a74('0xb6')]);return db[_0x9a74('0x34')][_0x9a74('0x5c')](_0x761647)[_0x9a74('0x27')](handleEntityNotFound(_0x33cd5c,null))['then'](respondWithResult(_0x33cd5c,null))[_0x9a74('0xb2')](handleError(_0x33cd5c,null));};exports[_0x9a74('0xb7')]=function(_0x54a908,_0x1b63e4){return db[_0x9a74('0x34')][_0x9a74('0xb7')](_0x54a908[_0x9a74('0x6f')],{})[_0x9a74('0x27')](respondWithResult(_0x1b63e4,0xc9))[_0x9a74('0xb2')](handleError(_0x1b63e4,null));};exports[_0x9a74('0x26')]=function(_0x2bb5a3,_0x4f3697){if(_0x2bb5a3[_0x9a74('0x6f')]['id']){delete _0x2bb5a3[_0x9a74('0x6f')]['id'];}return db[_0x9a74('0x34')][_0x9a74('0x5c')]({'where':{'id':_0x2bb5a3[_0x9a74('0xb3')]['id']}})[_0x9a74('0x27')](handleEntityNotFound(_0x4f3697,null))[_0x9a74('0x27')](saveUpdates(_0x2bb5a3[_0x9a74('0x6f')],null))[_0x9a74('0x27')](respondWithResult(_0x4f3697,null))[_0x9a74('0xb2')](handleError(_0x4f3697,null));};exports[_0x9a74('0xb8')]=function(_0x2320b9,_0xcba3c6){return db[_0x9a74('0x34')][_0x9a74('0x5c')]({'where':{'id':_0x2320b9[_0x9a74('0xb3')]['id']}})[_0x9a74('0x27')](handleEntityNotFound(_0xcba3c6,null))[_0x9a74('0x27')](removeEntity(_0xcba3c6,null))['catch'](handleError(_0xcba3c6,null));};exports[_0x9a74('0xb9')]=function(_0x385ecd,_0x368b84){return db[_0x9a74('0x34')]['describe']()[_0x9a74('0x27')](respondWithResult(_0x368b84,null))[_0x9a74('0xb2')](handleError(_0x368b84,null));};exports[_0x9a74('0xba')]=function(_0x1c97c2,_0x5d436f,_0x4dade5){return db['FaxMessage'][_0x9a74('0x5c')]({'where':{'id':_0x1c97c2[_0x9a74('0xb3')]['id']}})[_0x9a74('0x27')](handleEntityNotFound(_0x5d436f,null))[_0x9a74('0x27')](function(_0x98e660){if(_0x98e660){return _0x98e660[_0x9a74('0xba')](_0x1c97c2['body']['ids'],_[_0x9a74('0xbb')](_0x1c97c2[_0x9a74('0x6f')],['ids','id'])||{});}})['then'](respondWithResult(_0x5d436f,null))[_0x9a74('0xb2')](handleError(_0x5d436f,null));};exports[_0x9a74('0xbc')]=function(_0x6e6338,_0x19cd7e,_0x2cf186){var _0x1b151c={'raw':![],'where':{}};var _0x5cc672={};var _0x5ed4f7={'count':0x0,'rows':[]};return db[_0x9a74('0x34')]['findOne']({'where':{'id':_0x6e6338['params']['id']}})[_0x9a74('0x27')](handleEntityNotFound(_0x19cd7e,null))['then'](function(_0xeb74da){if(_0xeb74da){_0x5cc672[_0x9a74('0x3a')]=_[_0x9a74('0x39')](db[_0x9a74('0xbd')][_0x9a74('0x35')]);_0x5cc672['query']=_['keys'](_0x6e6338[_0x9a74('0x38')]);_0x5cc672[_0x9a74('0x43')]=_[_0x9a74('0x3c')](_0x5cc672['model'],_0x5cc672[_0x9a74('0x38')]);_0x1b151c['attributes']=_[_0x9a74('0x3c')](_0x5cc672[_0x9a74('0x3a')],qs[_0x9a74('0x3d')](_0x6e6338['query'][_0x9a74('0x3d')]));_0x1b151c[_0x9a74('0x3b')]=_0x1b151c[_0x9a74('0x3b')]['length']?_0x1b151c[_0x9a74('0x3b')]:_0x5cc672[_0x9a74('0x3a')];if(!_0x6e6338[_0x9a74('0x38')][_0x9a74('0x3f')]('nolimit')){_0x1b151c[_0x9a74('0x20')]=qs[_0x9a74('0x20')](_0x6e6338[_0x9a74('0x38')]['limit']);_0x1b151c[_0x9a74('0x1e')]=qs[_0x9a74('0x1e')](_0x6e6338[_0x9a74('0x38')][_0x9a74('0x1e')]);}_0x1b151c[_0x9a74('0x41')]=qs['sort'](_0x6e6338[_0x9a74('0x38')]['sort']);_0x1b151c[_0x9a74('0x73')]=qs[_0x9a74('0x43')](_[_0x9a74('0xbe')](_0x6e6338[_0x9a74('0x38')],_0x5cc672[_0x9a74('0x43')]));_0x1b151c['where']['FaxInteractionId']=_0xeb74da['id'];if(_0x6e6338[_0x9a74('0x38')][_0x9a74('0x82')]){_0x1b151c['where']=_[_0x9a74('0x99')](_0x1b151c[_0x9a74('0x73')],{'$or':_['map'](_0x1b151c['attributes'],function(_0x470c83){var _0x5509a9={};_0x5509a9[_0x470c83]={'$like':'%'+_0x6e6338[_0x9a74('0x38')]['filter']+'%'};return _0x5509a9;})});}if(_0x6e6338['query'][_0x9a74('0x78')]){var _0x15b9b1=_0x6e6338['query'][_0x9a74('0x78')][_0x9a74('0x30')](',');var _0x52e877={};_0x52e877[_0x15b9b1[0x0]]={'$gte':moment(_0x15b9b1[0x1])[_0x9a74('0xbf')](_0x9a74('0xc0'))};_0x1b151c[_0x9a74('0x73')]=_[_0x9a74('0x99')](_0x1b151c['where'],_0x52e877);}_0x1b151c=_[_0x9a74('0x99')]({},_0x1b151c,_0x6e6338[_0x9a74('0xb6')]);return db[_0x9a74('0xbd')][_0x9a74('0x21')]({'where':_0x1b151c[_0x9a74('0x73')]})[_0x9a74('0x27')](function(_0x2a02b0){_0x5ed4f7[_0x9a74('0x21')]=_0x2a02b0;if(_0x6e6338[_0x9a74('0x38')][_0x9a74('0xb4')]){_0x1b151c[_0x9a74('0xb5')]=[{'all':!![]}];}return db[_0x9a74('0xbd')]['findAll'](_0x1b151c);})[_0x9a74('0x27')](function(_0x10de26){_0x5ed4f7[_0x9a74('0xc1')]=_0x10de26;return _0x5ed4f7;});}})[_0x9a74('0x27')](respondWithFilteredResult(_0x19cd7e,_0x1b151c))[_0x9a74('0xb2')](handleError(_0x19cd7e,null));};exports[_0x9a74('0xc2')]=function(_0x17b17e,_0x46c124,_0x5d7ea7){return db[_0x9a74('0x34')]['find']({'where':{'id':_0x17b17e[_0x9a74('0xb3')]['id']}})[_0x9a74('0x27')](handleEntityNotFound(_0x46c124,null))[_0x9a74('0x27')](function(_0x3e8040){if(_0x3e8040){return _0x3e8040['setTags'](_0x17b17e[_0x9a74('0x6f')][_0x9a74('0xc3')],_[_0x9a74('0xbb')](_0x17b17e[_0x9a74('0x6f')],[_0x9a74('0xc3'),'id'])||{})[_0x9a74('0xc4')](function(){return db['Tag'][_0x9a74('0xc5')]({'attributes':['id',_0x9a74('0x2b'),_0x9a74('0x45')],'where':{'id':_0x17b17e[_0x9a74('0x6f')][_0x9a74('0xc3')]}});})[_0x9a74('0x27')](function(_0x2ec60f){socket['emit'](_0x9a74('0xc6'),{'id':Number(_0x17b17e[_0x9a74('0xb3')]['id']),'tags':_0x2ec60f||[]});return{'id':Number(_0x17b17e['params']['id']),'tags':_0x2ec60f||[]};});}})[_0x9a74('0x27')](respondWithResult(_0x46c124,null))[_0x9a74('0xb2')](handleError(_0x46c124,null));};exports[_0x9a74('0xc7')]=function(_0x497a88,_0x1fc701,_0x782592){return db[_0x9a74('0x34')]['find']({'where':{'id':_0x497a88[_0x9a74('0xb3')]['id']}})[_0x9a74('0x27')](handleEntityNotFound(_0x1fc701,null))['then'](function(_0x3d62c7){if(_0x3d62c7){return _0x3d62c7[_0x9a74('0xc7')](_0x497a88[_0x9a74('0x38')]['ids']);}})[_0x9a74('0x27')](respondWithStatusCode(_0x1fc701,null))[_0x9a74('0xb2')](handleError(_0x1fc701,null));};exports[_0x9a74('0xc8')]=function(_0x4e04d5,_0x57b39f){var _0x1604c4=moment()[_0x9a74('0xc9')]()[_0x9a74('0x98')]();var _0x367106=path[_0x9a74('0xca')](config[_0x9a74('0xcb')],_0x9a74('0xcc'),_0x9a74('0xcd'),_0x9a74('0xce'));var _0x4b22e5=path[_0x9a74('0xca')](config[_0x9a74('0xcb')],_0x9a74('0xcc'),_0x9a74('0xcd'),_0x9a74('0xcf'));var _0x26fd58=path[_0x9a74('0xca')](_0x367106,_0x1604c4);var _0x42c8f5=util['format'](_0x9a74('0xd0'),_0x4e04d5[_0x9a74('0xb3')]['id'],_0x1604c4);var _0x37c7b0=path[_0x9a74('0xca')](_0x367106,_0x42c8f5);var _0x58b9a7=[];_0x58b9a7[_0x9a74('0x32')]({'model':db[_0x9a74('0xd1')],'as':_0x9a74('0xd1'),'raw':!![]});var _0x43961f=[{'model':db[_0x9a74('0xbd')],'as':'Messages','attributes':['id','body','createdAt'],'include':_0x58b9a7}];return db[_0x9a74('0x34')][_0x9a74('0x5c')]({'where':{'id':_0x4e04d5['params']['id']},'include':_0x43961f})[_0x9a74('0x27')](handleEntityNotFound(_0x57b39f,null))[_0x9a74('0x27')](function(_0x56f24a){if(_0x56f24a&&_0x56f24a[_0x9a74('0xd2')]){var _0x42ea83=_0x56f24a[_0x9a74('0xd3')]({'plain':!![]});fs[_0x9a74('0xd4')](_0x26fd58);for(var _0x451c83=0x0;_0x451c83<_0x42ea83[_0x9a74('0xd2')][_0x9a74('0x3e')];_0x451c83++){var _0x223fdf=_0x42ea83['Messages'][_0x451c83][_0x9a74('0xd1')];if(_0x223fdf){var _0x2765a5=path[_0x9a74('0xca')](_0x4b22e5,_0x223fdf[_0x9a74('0xd5')]);if(fs[_0x9a74('0xd6')](_0x2765a5)){fs['createReadStream'](_0x2765a5)[_0x9a74('0xd7')](fs[_0x9a74('0xd8')](path[_0x9a74('0xca')](_0x26fd58,_0x223fdf[_0x9a74('0xd5')])));}}}return BPromise['resolve']()[_0x9a74('0x27')](function(){return new BPromise(function(_0x3dd500,_0x3c33b6){zipdir(_0x26fd58,{'saveTo':_0x37c7b0},function(_0xf3cc90,_0x35bd90){if(_0xf3cc90)return _0x3c33b6(_0xf3cc90);return _0x3dd500(_0x35bd90);});})['then'](function(){return new BPromise(function(_0xd49b7,_0x3dc497){rimraf(_0x26fd58,function(_0x26a558){if(_0x26a558)_0x3dc497(_0x26a558);return _0xd49b7();});});})[_0x9a74('0x27')](function(){return _0x57b39f[_0x9a74('0xc8')](_0x37c7b0,_0x42c8f5,function(_0x48e4ff){if(_0x48e4ff){console[_0x9a74('0xd9')](_0x9a74('0xda'),_0x48e4ff);}else{fs[_0x9a74('0xdb')](_0x37c7b0);}});});});}else{return _0x57b39f[_0x9a74('0xdc')](0xc8);}})[_0x9a74('0xb2')](handleError(_0x57b39f,null));}; \ No newline at end of file +var _0xce31=['merge','FaxInteraction','unreadMessages','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','show','params','includeAll','include','options','find','create','body','update','describe','addMessage','omit','ids','getMessages','nolimit','sort','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','findAll','addTags','setTags','emit','removeTags','download','unix','join','server','files','tmp','root','attachments','Attachment','Messages','basename','existsSync','pipe','createWriteStream','resolve','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','destroy','then','stack','name','send','Users','map','fullname','TagIds','split','forEach','Tags','push','catch','index','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','filters','pick','select','field','color','u.id','u.fullname','ui.FaxInteractionId','from','user_has_fax_interactions','left_join','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.FaxAccountId','fax_interaction_has_tags','tools_tags','expr','search','sqlOperator','conditions','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','compact','isEmpty','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','where','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','FaxAccountId','i.FaxAccountId\x20IS\x20NOT\x20NULL','role','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','toString','sequelize','keyBy'];(function(_0x8b9a2e,_0x2ae0a0){var _0x3d0d97=function(_0x48a5ab){while(--_0x48a5ab){_0x8b9a2e['push'](_0x8b9a2e['shift']());}};_0x3d0d97(++_0x2ae0a0);}(_0xce31,0x1e7));var _0x1ce3=function(_0x3bfe95,_0x51f19a){_0x3bfe95=_0x3bfe95-0x0;var _0x47da0d=_0xce31[_0x3bfe95];return _0x47da0d;};'use strict';var emlformat=require(_0x1ce3('0x0'));var rimraf=require(_0x1ce3('0x1'));var zipdir=require(_0x1ce3('0x2'));var jsonpatch=require(_0x1ce3('0x3'));var rp=require(_0x1ce3('0x4'));var moment=require(_0x1ce3('0x5'));var BPromise=require(_0x1ce3('0x6'));var Mustache=require(_0x1ce3('0x7'));var util=require('util');var path=require(_0x1ce3('0x8'));var sox=require('sox');var csv=require(_0x1ce3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1ce3('0xa'));var _=require(_0x1ce3('0xb'));var squel=require(_0x1ce3('0xc'));var crypto=require(_0x1ce3('0xd'));var jsforce=require(_0x1ce3('0xe'));var deskjs=require(_0x1ce3('0xf'));var toCsv=require(_0x1ce3('0x9'));var querystring=require(_0x1ce3('0x10'));var Papa=require(_0x1ce3('0x11'));var Redis=require(_0x1ce3('0x12'));var authService=require(_0x1ce3('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x1ce3('0x14'));var hardwareService=require(_0x1ce3('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1ce3('0x16'));var db=require(_0x1ce3('0x17'))['db'];config[_0x1ce3('0x18')]=_[_0x1ce3('0x19')](config[_0x1ce3('0x18')],{'host':_0x1ce3('0x1a'),'port':0x18eb});var socket=require(_0x1ce3('0x1b'))(new Redis(config[_0x1ce3('0x18')]));require(_0x1ce3('0x1c'))[_0x1ce3('0x1d')](socket);function respondWithStatusCode(_0x425f28,_0x2ff336){_0x2ff336=_0x2ff336||0xcc;return function(_0x82c3b1){if(_0x82c3b1){return _0x425f28[_0x1ce3('0x1e')](_0x2ff336);}return _0x425f28[_0x1ce3('0x1f')](_0x2ff336)[_0x1ce3('0x20')]();};}function respondWithResult(_0xfe1eee,_0x1e8560){_0x1e8560=_0x1e8560||0xc8;return function(_0x288468){if(_0x288468){return _0xfe1eee[_0x1ce3('0x1f')](_0x1e8560)[_0x1ce3('0x21')](_0x288468);}};}function respondWithFilteredResult(_0x35bba3,_0x26815f){return function(_0x58ddf5){if(_0x58ddf5){var _0x377a51=typeof _0x26815f[_0x1ce3('0x22')]===_0x1ce3('0x23')&&typeof _0x26815f[_0x1ce3('0x24')]==='undefined';var _0xbdfc1e=_0x58ddf5[_0x1ce3('0x25')];var _0x307fd0=_0x377a51?0x0:_0x26815f['offset'];var _0x51d274=_0x377a51?_0x58ddf5[_0x1ce3('0x25')]:_0x26815f['offset']+_0x26815f[_0x1ce3('0x24')];var _0x42c94e;if(_0x51d274>=_0xbdfc1e){_0x51d274=_0xbdfc1e;_0x42c94e=0xc8;}else{_0x42c94e=0xce;}_0x35bba3['status'](_0x42c94e);return _0x35bba3[_0x1ce3('0x26')]('Content-Range',_0x307fd0+'-'+_0x51d274+'/'+_0xbdfc1e)['json'](_0x58ddf5);}return null;};}function patchUpdates(_0x5510c3){return function(_0x7d858d){try{jsonpatch['apply'](_0x7d858d,_0x5510c3,!![]);}catch(_0x1bc800){return BPromise[_0x1ce3('0x27')](_0x1bc800);}return _0x7d858d['save']();};}function saveUpdates(_0x321d13,_0x177b28){return function(_0x153723){if(_0x153723){return _0x153723['update'](_0x321d13)['then'](function(_0x15587b){return _0x15587b;});}return null;};}function removeEntity(_0x3842ab,_0x2b0cf0){return function(_0x1c70a0){if(_0x1c70a0){return _0x1c70a0[_0x1ce3('0x28')]()[_0x1ce3('0x29')](function(){_0x3842ab['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x11bbcf,_0x65df28){return function(_0x1aa304){if(!_0x1aa304){_0x11bbcf[_0x1ce3('0x1e')](0x194);}return _0x1aa304;};}function handleError(_0x3bc154,_0x2b9c9d){_0x2b9c9d=_0x2b9c9d||0x1f4;return function(_0x43256f){logger['error'](_0x43256f[_0x1ce3('0x2a')]);if(_0x43256f[_0x1ce3('0x2b')]){delete _0x43256f[_0x1ce3('0x2b')];}_0x3bc154[_0x1ce3('0x1f')](_0x2b9c9d)[_0x1ce3('0x2c')](_0x43256f);};}function getInteractionUsers(_0x1ca444,_0x3b32be){return new BPromise(function(_0xa8cc4b,_0x91ecf4){try{if(_0x3b32be[_0x1ca444['id']]){_0x1ca444[_0x1ce3('0x2d')]=_[_0x1ce3('0x2e')](_0x3b32be[_0x1ca444['id']],function(_0x171e69){return{'id':_0x171e69['id'],'fullname':_0x171e69[_0x1ce3('0x2f')]};});}}catch(_0x38908e){_0x91ecf4(_0x38908e);}_0xa8cc4b(_0x1ca444);});}function getInteractionTags(_0x9a0c6d,_0x58af9e){return new BPromise(function(_0x4d6dc7,_0x17931a){try{if(_0x9a0c6d[_0x1ce3('0x30')]){_0x9a0c6d['Tags']=[];_0x9a0c6d['TagIds'][_0x1ce3('0x31')](',')[_0x1ce3('0x32')](function(_0x48d3de){_0x9a0c6d[_0x1ce3('0x33')][_0x1ce3('0x34')](_0x58af9e[_0x48d3de]);});}delete _0x9a0c6d['TagIds'];}catch(_0x2e9ec5){_0x17931a(_0x2e9ec5);}_0x4d6dc7(_0x9a0c6d);});}function updateFaxInteraction(_0x3f5dab,_0x4c743c,_0x2b5dde){return new BPromise(function(_0x1065b7,_0x53278b){return getInteractionUsers(_0x3f5dab,_0x2b5dde)['then'](function(_0x5f7cfa){return getInteractionTags(_0x5f7cfa,_0x4c743c);})[_0x1ce3('0x29')](function(_0x4ea789){_0x1065b7(_0x4ea789);})[_0x1ce3('0x35')](function(_0x12ec59){_0x53278b(_0x12ec59);});});}exports[_0x1ce3('0x36')]=function(_0x354603,_0x26fd7d){var _0x410802={},_0x226be5={},_0x8a0148={'count':0x0,'rows':[]};var _0x27cdd2=_[_0x1ce3('0x2e')](db['FaxInteraction'][_0x1ce3('0x37')],function(_0x950524){return{'name':_0x950524['fieldName'],'type':_0x950524[_0x1ce3('0x38')]['key']};});_0x226be5[_0x1ce3('0x39')]=_[_0x1ce3('0x2e')](_0x27cdd2,_0x1ce3('0x2b'));_0x226be5[_0x1ce3('0x3a')]=_[_0x1ce3('0x3b')](_0x354603[_0x1ce3('0x3a')]);_0x226be5['filters']=_[_0x1ce3('0x3c')](_0x226be5[_0x1ce3('0x39')],_0x226be5[_0x1ce3('0x3a')]);_0x410802[_0x1ce3('0x3d')]=_[_0x1ce3('0x3c')](_0x226be5[_0x1ce3('0x39')],qs['fields'](_0x354603['query'][_0x1ce3('0x3e')]));_0x410802[_0x1ce3('0x3d')]=_0x410802['attributes'][_0x1ce3('0x3f')]?_0x410802[_0x1ce3('0x3d')]:_0x226be5[_0x1ce3('0x39')];if(!_0x354603['query'][_0x1ce3('0x40')]('nolimit')){_0x410802[_0x1ce3('0x24')]=qs[_0x1ce3('0x24')](_0x354603['query'][_0x1ce3('0x24')]);_0x410802[_0x1ce3('0x22')]=qs[_0x1ce3('0x22')](_0x354603['query'][_0x1ce3('0x22')]);}_0x410802[_0x1ce3('0x41')]=qs['sort'](_0x354603['query']['sort']);_0x410802['where']=qs[_0x1ce3('0x42')](_[_0x1ce3('0x43')](_0x354603['query'],_0x226be5[_0x1ce3('0x42')]),_0x27cdd2);var _0x3c16ba=[];var _0x4774bb=squel[_0x1ce3('0x44')]()['field']('id')[_0x1ce3('0x45')]('name')['field'](_0x1ce3('0x46'))['from']('tools_tags');var _0x7b987a=squel[_0x1ce3('0x44')]()[_0x1ce3('0x45')](_0x1ce3('0x47'))['field'](_0x1ce3('0x48'))[_0x1ce3('0x45')](_0x1ce3('0x49'))[_0x1ce3('0x4a')](_0x1ce3('0x4b'),'ui')[_0x1ce3('0x4c')]('users','u','u.id\x20=\x20ui.UserId');var _0x2cc9c2=squel[_0x1ce3('0x44')]()[_0x1ce3('0x4a')](_0x1ce3('0x4d'),'i')[_0x1ce3('0x4c')](_0x1ce3('0x4e'),'c',_0x1ce3('0x4f'))['left_join']('users','o',_0x1ce3('0x50'))[_0x1ce3('0x4c')]('fax_accounts','a',_0x1ce3('0x51'))[_0x1ce3('0x4c')]('fax_messages','me','me.FaxInteractionId\x20=\x20i.id')[_0x1ce3('0x4c')](_0x1ce3('0x52'),'it','it.FaxInteractionId\x20=\x20i.id')[_0x1ce3('0x4c')](_0x1ce3('0x53'),'t','t.id\x20=\x20it.TagId');var _0x33681e=squel['expr']();var _0x139c9c=[];var _0x19056d=squel[_0x1ce3('0x54')]();var _0x1d1b07;if(_0x354603[_0x1ce3('0x3a')][_0x1ce3('0x55')]){_0x1d1b07=as['parseSearch'](_0x354603[_0x1ce3('0x3a')]['search']);var _0x5ee4d4=_0x1d1b07[_0x1ce3('0x56')];for(var _0x470726=0x0;_0x470726<_0x1d1b07[_0x1ce3('0x57')][_0x1ce3('0x3f')];_0x470726++){var _0x364499=_0x1d1b07[_0x1ce3('0x57')][_0x470726];var _0x4a6526='i';var _0x4f5a0f=_['find'](_0x27cdd2,[_0x1ce3('0x2b'),_0x364499[_0x1ce3('0x45')]]);if(!_0x4f5a0f){switch(_0x364499[_0x1ce3('0x45')]){case'unreadMessages':if(_0x364499['value']==0x1){_0x2cc9c2[_0x1ce3('0x58')]('`'+_0x364499[_0x1ce3('0x45')]+_0x1ce3('0x59'));}else{_0x2cc9c2[_0x1ce3('0x58')]('`'+_0x364499[_0x1ce3('0x45')]+_0x1ce3('0x5a'));}break;case _0x1ce3('0x5b'):if(_0x364499[_0x1ce3('0x5c')]===_0x1ce3('0x5d')){if(_0x364499[_0x1ce3('0x5e')][_0x1ce3('0x31')]('\x20')[_0x1ce3('0x3f')]>0x1){_0x33681e[_0x5ee4d4](_0x1ce3('0x5f'),qs[_0x1ce3('0x60')](_0x364499[_0x1ce3('0x5e')]),null);}else{var _0x7a63aa='%'+_0x364499['value']+'%';_0x33681e[_0x5ee4d4](_0x1ce3('0x61'),_0x7a63aa,_0x7a63aa,_0x7a63aa);}}else{_0x4f5a0f=_['find'](_0x27cdd2,[_0x1ce3('0x2b'),'ContactId']);_0x364499[_0x1ce3('0x45')]=_0x1ce3('0x62');_0x1ca43e=as[_0x1ce3('0x63')](_0x4a6526,_0x4f5a0f[_0x1ce3('0x38')],_0x364499);_0x33681e[_0x5ee4d4](_0x1ca43e[_0x1ce3('0x64')],_0x1ca43e[_0x1ce3('0x5e')][_0x1ce3('0x65')],_0x1ca43e['value'][_0x1ce3('0x20')]);}break;case _0x1ce3('0x66'):var _0x27a1a1=_0x364499[_0x1ce3('0x5e')][_0x1ce3('0x31')](',')[_0x1ce3('0x2e')](function(_0x478d72){return Number(_0x478d72);});_0x27a1a1['forEach'](function(_0x42b440){_0x19056d['or'](_0x1ce3('0x67'),'%,'+_0x42b440+',%');});_0x139c9c=_[_0x1ce3('0x68')](_0x139c9c,_0x27a1a1);break;case _0x1ce3('0x69'):if(_0x364499['operator']==='$substring'){_0x33681e[_0x5ee4d4](_0x1ce3('0x6a'),'%'+_0x364499[_0x1ce3('0x5e')]+'%',null);}else{_0x4f5a0f=_['find'](_0x27cdd2,[_0x1ce3('0x2b'),_0x1ce3('0x6b')]);_0x364499['field']=_0x1ce3('0x6b');_0x1ca43e=as[_0x1ce3('0x63')](_0x4a6526,_0x4f5a0f[_0x1ce3('0x38')],_0x364499);_0x33681e[_0x5ee4d4](_0x1ca43e[_0x1ce3('0x64')],_0x1ca43e[_0x1ce3('0x5e')][_0x1ce3('0x65')],_0x1ca43e[_0x1ce3('0x5e')][_0x1ce3('0x20')]);}break;case'body':_0x1ca43e=as[_0x1ce3('0x63')]('me',null,_0x364499);_0x33681e[_0x5ee4d4](_0x1ca43e[_0x1ce3('0x64')],_0x1ca43e['value'][_0x1ce3('0x65')],_0x1ca43e[_0x1ce3('0x5e')][_0x1ce3('0x20')]);break;}}else{var _0x1ca43e=as[_0x1ce3('0x63')](_0x4a6526,_0x4f5a0f[_0x1ce3('0x38')],_0x364499);_0x33681e[_0x5ee4d4](_0x1ca43e['text'],_0x1ca43e['value'][_0x1ce3('0x65')],_0x1ca43e[_0x1ce3('0x5e')][_0x1ce3('0x20')]);}}}else{var _0x2f1416=_(_0x354603[_0x1ce3('0x3a')])['keys']()[_0x1ce3('0x2e')](function(_0x2a30e0){return _['some'](_0x27cdd2,[_0x1ce3('0x2b'),_0x2a30e0])?_0x2a30e0:undefined;})[_0x1ce3('0x6c')]()[_0x1ce3('0x5e')]();if(!_[_0x1ce3('0x6d')](_0x2f1416)){_0x2f1416[_0x1ce3('0x32')](function(_0x352f4c){if(_0x352f4c==='FaxAccountId'){_0x2cc9c2['where'](_0x1ce3('0x6e'),[][_0x1ce3('0x6f')](_0x354603[_0x1ce3('0x3a')][_0x352f4c]));}else if(_0x352f4c===_0x1ce3('0x70')){var _0x552fdb=JSON[_0x1ce3('0x71')](_0x354603['query'][_0x352f4c])[_0x1ce3('0x72')];var _0x3c12ac=JSON['parse'](_0x354603[_0x1ce3('0x3a')][_0x352f4c])[_0x1ce3('0x73')];_0x2cc9c2['where'](_0x1ce3('0x74'),_0x552fdb,_0x3c12ac);}else{if(_0x354603[_0x1ce3('0x3a')][_0x352f4c]===_0x1ce3('0x75')){_0x2cc9c2[_0x1ce3('0x76')]('i.'+_0x352f4c+'\x20IS\x20NULL');}else{_0x2cc9c2[_0x1ce3('0x76')]('i.'+_0x352f4c+'\x20=\x20?',_0x354603[_0x1ce3('0x3a')][_0x352f4c]);}}});}if(_0x354603[_0x1ce3('0x3a')][_0x1ce3('0x77')]){if(_0x354603[_0x1ce3('0x3a')]['read']==0x1){_0x2cc9c2[_0x1ce3('0x58')]('`unreadMessages`\x20=\x200');}else{_0x2cc9c2[_0x1ce3('0x58')](_0x1ce3('0x78'));}}if(_0x354603['query'][_0x1ce3('0x79')]){_0x139c9c=_[_0x1ce3('0x7a')](_0x354603[_0x1ce3('0x3a')][_0x1ce3('0x79')])?_0x354603[_0x1ce3('0x3a')][_0x1ce3('0x79')]:new Array(_0x354603[_0x1ce3('0x3a')][_0x1ce3('0x79')]);_0x139c9c[_0x1ce3('0x32')](function(_0x4c3d41){_0x19056d['or'](_0x1ce3('0x67'),'%,'+_0x4c3d41+',%');});}if(_0x354603[_0x1ce3('0x3a')][_0x1ce3('0x7b')]){var _0x32d95a=_0x354603[_0x1ce3('0x3a')]['filter'][_0x1ce3('0x7c')]('\x5c','\x5c\x5c')[_0x1ce3('0x7c')](/'/g,'\x27\x27');if(qs[_0x1ce3('0x7d')](_0x32d95a)){_0x33681e['or'](_0x1ce3('0x7e'),_0x32d95a+'%')['or'](_0x1ce3('0x7f'),_0x32d95a+'%');}_0x33681e['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x32d95a+'%');}}_0x2cc9c2['where'](_0x33681e);_0x2cc9c2[_0x1ce3('0x80')](_0x1ce3('0x81'));var _0x405bcf={'type':db[_0x1ce3('0x82')]['QueryTypes'][_0x1ce3('0x83')],'raw':!![]};var _0x325f16=_0x2cc9c2[_0x1ce3('0x84')]();_0x325f16[_0x1ce3('0x45')](_0x1ce3('0x81'));_0x325f16[_0x1ce3('0x45')](_0x1ce3('0x85'),'unreadMessages');if(_0x410802[_0x1ce3('0x41')]){_0x410802[_0x1ce3('0x41')][_0x1ce3('0x32')](function(_0x530857){var _0x78e6f9=_0x530857[0x0]===_0x1ce3('0x86')?_0x530857[0x0]:'i.'+_0x530857[0x0];_0x2cc9c2['order'](_0x78e6f9,_0x530857[0x1]===_0x1ce3('0x87')?![]:!![]);});}if(!_[_0x1ce3('0x6d')](_0x139c9c)){_0x2cc9c2[_0x1ce3('0x58')](_0x19056d);_0x325f16[_0x1ce3('0x76')](_0x1ce3('0x88'),_0x139c9c);}BPromise['resolve']()[_0x1ce3('0x29')](function(){if(!_0x1d1b07){if(_0x354603['query'][_0x1ce3('0x89')])return;_0x325f16[_0x1ce3('0x76')](_0x1ce3('0x8a'));_0x2cc9c2[_0x1ce3('0x76')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x354603['user'][_0x1ce3('0x8b')]!==_0x1ce3('0x8c'))return;return _0x354603['user'][_0x1ce3('0x8d')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3698b2){if(_[_0x1ce3('0x6d')](_0x3698b2)){_0x325f16['where'](_0x1ce3('0x8e'));_0x2cc9c2[_0x1ce3('0x76')]('i.FaxAccountId\x20IS\x20NULL');}else{_0x325f16[_0x1ce3('0x76')](_0x1ce3('0x6e'),_[_0x1ce3('0x2e')](_0x3698b2,'id'));_0x2cc9c2[_0x1ce3('0x76')](_0x1ce3('0x6e'),_[_0x1ce3('0x2e')](_0x3698b2,'id'));}});})['then'](function(){if(_0x354603['user'][_0x1ce3('0x8b')]===_0x1ce3('0x8c')&&!_0x1d1b07&&!_0x354603['query']['FaxAccountId'])return[];return db['sequelize'][_0x1ce3('0x3a')](_0x325f16[_0x1ce3('0x8f')](),_0x405bcf);})[_0x1ce3('0x29')](function(_0x9b889d){_0x8a0148[_0x1ce3('0x25')]=_0x9b889d[_0x1ce3('0x3f')];if(_0x8a0148[_0x1ce3('0x25')]===0x0)return[];return db[_0x1ce3('0x90')]['query'](_0x4774bb[_0x1ce3('0x8f')](),_0x405bcf)[_0x1ce3('0x29')](function(_0x1c6392){_0x3c16ba=_[_0x1ce3('0x91')](_0x1c6392,'id');_0x405bcf=_[_0x1ce3('0x92')](_0x405bcf,{'model':db[_0x1ce3('0x93')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x354603[_0x1ce3('0x3a')][_0x1ce3('0x3e')]){_0x410802[_0x1ce3('0x3d')][_0x1ce3('0x32')](function(_0x5df5d3){_0x2cc9c2[_0x1ce3('0x45')]('i.'+_0x5df5d3);});}else{_0x2cc9c2[_0x1ce3('0x45')](_0x1ce3('0x85'),_0x1ce3('0x94'));_0x2cc9c2[_0x1ce3('0x45')](_0x1ce3('0x95'),'Account.key');_0x2cc9c2[_0x1ce3('0x45')](_0x1ce3('0x96'),_0x1ce3('0x97'));_0x2cc9c2[_0x1ce3('0x45')]('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',_0x1ce3('0x86'));_0x2cc9c2[_0x1ce3('0x45')](_0x1ce3('0x98'));_0x2cc9c2[_0x1ce3('0x45')](_0x1ce3('0x99'),_0x1ce3('0x9a'));_0x2cc9c2[_0x1ce3('0x45')](_0x1ce3('0x9b'),_0x1ce3('0x9c'));_0x2cc9c2[_0x1ce3('0x45')]('c.email',_0x1ce3('0x9d'));_0x2cc9c2['field'](_0x1ce3('0x9e'),_0x1ce3('0x9f'));_0x2cc9c2[_0x1ce3('0x45')](_0x1ce3('0xa0'),_0x1ce3('0xa1'));_0x2cc9c2[_0x1ce3('0x45')](_0x1ce3('0xa2'),_0x1ce3('0xa3'));_0x2cc9c2[_0x1ce3('0x45')](_0x1ce3('0xa4'),_0x1ce3('0xa5'));_0x2cc9c2[_0x1ce3('0x45')]('o.internal',_0x1ce3('0xa6'));_0x2cc9c2[_0x1ce3('0x45')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x1ce3('0x30'));}if(_0x410802[_0x1ce3('0x24')])_0x2cc9c2[_0x1ce3('0x24')](_0x410802['limit']);if(_0x410802[_0x1ce3('0x22')])_0x2cc9c2['offset'](_0x410802[_0x1ce3('0x22')]);return db['sequelize'][_0x1ce3('0x3a')](_0x2cc9c2['toString'](),_0x405bcf);})['then'](function(_0x569f1f){if(_0x569f1f['length']>0x0)_0x7b987a['where'](_0x1ce3('0xa7'),_[_0x1ce3('0x2e')](_0x569f1f,'id'));return db[_0x1ce3('0x90')]['query'](_0x7b987a[_0x1ce3('0x8f')](),_0x405bcf)[_0x1ce3('0x29')](function(_0x47deb8){var _0x1d63a4=_[_0x1ce3('0xa8')](_0x47deb8,_0x1ce3('0xa9'));var _0x5a7baf=[];_0x569f1f[_0x1ce3('0x32')](function(_0x13099d){_0x5a7baf[_0x1ce3('0x34')](updateFaxInteraction(_0x13099d,_0x3c16ba,_0x1d63a4));});return BPromise['all'](_0x5a7baf);});});})['then'](function(_0x58cfa9){_0x8a0148['rows']=_0x58cfa9;return _0x8a0148;})['then'](respondWithFilteredResult(_0x26fd7d,_0x410802))['catch'](handleError(_0x26fd7d,null));};exports[_0x1ce3('0xaa')]=function(_0x2079f0,_0x45f471){var _0x187c16={'raw':![],'where':{'id':_0x2079f0[_0x1ce3('0xab')]['id']}},_0x1f824c={};_0x1f824c['model']=_[_0x1ce3('0x3b')](db[_0x1ce3('0x93')][_0x1ce3('0x37')]);_0x1f824c[_0x1ce3('0x3a')]=_['keys'](_0x2079f0[_0x1ce3('0x3a')]);_0x1f824c[_0x1ce3('0x42')]=_[_0x1ce3('0x3c')](_0x1f824c[_0x1ce3('0x39')],_0x1f824c[_0x1ce3('0x3a')]);_0x187c16[_0x1ce3('0x3d')]=_['intersection'](_0x1f824c['model'],qs['fields'](_0x2079f0['query'][_0x1ce3('0x3e')]));_0x187c16[_0x1ce3('0x3d')]=_0x187c16[_0x1ce3('0x3d')][_0x1ce3('0x3f')]?_0x187c16[_0x1ce3('0x3d')]:_0x1f824c['model'];if(_0x2079f0[_0x1ce3('0x3a')][_0x1ce3('0xac')]){_0x187c16[_0x1ce3('0xad')]=[{'all':!![]}];}_0x187c16=_[_0x1ce3('0x92')]({},_0x187c16,_0x2079f0[_0x1ce3('0xae')]);return db[_0x1ce3('0x93')][_0x1ce3('0xaf')](_0x187c16)[_0x1ce3('0x29')](handleEntityNotFound(_0x45f471,null))['then'](respondWithResult(_0x45f471,null))['catch'](handleError(_0x45f471,null));};exports['create']=function(_0x1ac087,_0x138903){return db[_0x1ce3('0x93')][_0x1ce3('0xb0')](_0x1ac087[_0x1ce3('0xb1')],{})[_0x1ce3('0x29')](respondWithResult(_0x138903,0xc9))[_0x1ce3('0x35')](handleError(_0x138903,null));};exports[_0x1ce3('0xb2')]=function(_0xc154fe,_0x324d5e){if(_0xc154fe[_0x1ce3('0xb1')]['id']){delete _0xc154fe['body']['id'];}return db[_0x1ce3('0x93')][_0x1ce3('0xaf')]({'where':{'id':_0xc154fe[_0x1ce3('0xab')]['id']}})['then'](handleEntityNotFound(_0x324d5e,null))[_0x1ce3('0x29')](saveUpdates(_0xc154fe[_0x1ce3('0xb1')],null))[_0x1ce3('0x29')](respondWithResult(_0x324d5e,null))['catch'](handleError(_0x324d5e,null));};exports['destroy']=function(_0x321154,_0x4edc1d){return db[_0x1ce3('0x93')]['find']({'where':{'id':_0x321154[_0x1ce3('0xab')]['id']}})[_0x1ce3('0x29')](handleEntityNotFound(_0x4edc1d,null))[_0x1ce3('0x29')](removeEntity(_0x4edc1d,null))['catch'](handleError(_0x4edc1d,null));};exports['describe']=function(_0x51fe51,_0x2b300c){return db[_0x1ce3('0x93')][_0x1ce3('0xb3')]()[_0x1ce3('0x29')](respondWithResult(_0x2b300c,null))['catch'](handleError(_0x2b300c,null));};exports[_0x1ce3('0xb4')]=function(_0x427bae,_0x299df,_0x50904a){return db['FaxMessage'][_0x1ce3('0xaf')]({'where':{'id':_0x427bae['params']['id']}})[_0x1ce3('0x29')](handleEntityNotFound(_0x299df,null))['then'](function(_0x49672c){if(_0x49672c){return _0x49672c[_0x1ce3('0xb4')](_0x427bae[_0x1ce3('0xb1')]['ids'],_[_0x1ce3('0xb5')](_0x427bae[_0x1ce3('0xb1')],[_0x1ce3('0xb6'),'id'])||{});}})[_0x1ce3('0x29')](respondWithResult(_0x299df,null))['catch'](handleError(_0x299df,null));};exports[_0x1ce3('0xb7')]=function(_0x354dd4,_0x29d385,_0x37948f){var _0x1f9f3b={'raw':![],'where':{}};var _0x21e236={};var _0x48cfb7={'count':0x0,'rows':[]};return db[_0x1ce3('0x93')]['findOne']({'where':{'id':_0x354dd4['params']['id']}})['then'](handleEntityNotFound(_0x29d385,null))[_0x1ce3('0x29')](function(_0x1faaed){if(_0x1faaed){_0x21e236[_0x1ce3('0x39')]=_['keys'](db['FaxMessage'][_0x1ce3('0x37')]);_0x21e236[_0x1ce3('0x3a')]=_[_0x1ce3('0x3b')](_0x354dd4[_0x1ce3('0x3a')]);_0x21e236[_0x1ce3('0x42')]=_[_0x1ce3('0x3c')](_0x21e236[_0x1ce3('0x39')],_0x21e236['query']);_0x1f9f3b[_0x1ce3('0x3d')]=_[_0x1ce3('0x3c')](_0x21e236[_0x1ce3('0x39')],qs['fields'](_0x354dd4[_0x1ce3('0x3a')]['fields']));_0x1f9f3b['attributes']=_0x1f9f3b[_0x1ce3('0x3d')][_0x1ce3('0x3f')]?_0x1f9f3b[_0x1ce3('0x3d')]:_0x21e236[_0x1ce3('0x39')];if(!_0x354dd4[_0x1ce3('0x3a')][_0x1ce3('0x40')](_0x1ce3('0xb8'))){_0x1f9f3b[_0x1ce3('0x24')]=qs[_0x1ce3('0x24')](_0x354dd4[_0x1ce3('0x3a')][_0x1ce3('0x24')]);_0x1f9f3b[_0x1ce3('0x22')]=qs[_0x1ce3('0x22')](_0x354dd4[_0x1ce3('0x3a')][_0x1ce3('0x22')]);}_0x1f9f3b[_0x1ce3('0x41')]=qs[_0x1ce3('0xb9')](_0x354dd4[_0x1ce3('0x3a')][_0x1ce3('0xb9')]);_0x1f9f3b['where']=qs[_0x1ce3('0x42')](_['pick'](_0x354dd4[_0x1ce3('0x3a')],_0x21e236['filters']));_0x1f9f3b[_0x1ce3('0x76')][_0x1ce3('0xa9')]=_0x1faaed['id'];if(_0x354dd4[_0x1ce3('0x3a')]['filter']){_0x1f9f3b['where']=_[_0x1ce3('0x92')](_0x1f9f3b[_0x1ce3('0x76')],{'$or':_[_0x1ce3('0x2e')](_0x1f9f3b['attributes'],function(_0x455d43){var _0xc68fce={};_0xc68fce[_0x455d43]={'$like':'%'+_0x354dd4[_0x1ce3('0x3a')][_0x1ce3('0x7b')]+'%'};return _0xc68fce;})});}if(_0x354dd4[_0x1ce3('0x3a')]['$gte']){var _0x5d31b7=_0x354dd4[_0x1ce3('0x3a')][_0x1ce3('0x72')][_0x1ce3('0x31')](',');var _0xe8ac45={};_0xe8ac45[_0x5d31b7[0x0]]={'$gte':moment(_0x5d31b7[0x1])[_0x1ce3('0xba')](_0x1ce3('0xbb'))};_0x1f9f3b['where']=_[_0x1ce3('0x92')](_0x1f9f3b[_0x1ce3('0x76')],_0xe8ac45);}_0x1f9f3b=_['merge']({},_0x1f9f3b,_0x354dd4['options']);return db[_0x1ce3('0xbc')][_0x1ce3('0x25')]({'where':_0x1f9f3b[_0x1ce3('0x76')]})[_0x1ce3('0x29')](function(_0x3b5131){_0x48cfb7['count']=_0x3b5131;if(_0x354dd4['query']['includeAll']){_0x1f9f3b['include']=[{'all':!![]}];}return db[_0x1ce3('0xbc')][_0x1ce3('0xbd')](_0x1f9f3b);})[_0x1ce3('0x29')](function(_0x3c7f4e){_0x48cfb7['rows']=_0x3c7f4e;return _0x48cfb7;});}})['then'](respondWithFilteredResult(_0x29d385,_0x1f9f3b))[_0x1ce3('0x35')](handleError(_0x29d385,null));};exports[_0x1ce3('0xbe')]=function(_0x5f0696,_0x2d725b,_0x560085){return db[_0x1ce3('0x93')][_0x1ce3('0xaf')]({'where':{'id':_0x5f0696['params']['id']}})['then'](handleEntityNotFound(_0x2d725b,null))[_0x1ce3('0x29')](function(_0x1954fb){if(_0x1954fb){return _0x1954fb[_0x1ce3('0xbf')](_0x5f0696[_0x1ce3('0xb1')][_0x1ce3('0xb6')],_['omit'](_0x5f0696['body'],[_0x1ce3('0xb6'),'id'])||{})['spread'](function(){return db[_0x1ce3('0x66')][_0x1ce3('0xbd')]({'attributes':['id','name',_0x1ce3('0x46')],'where':{'id':_0x5f0696[_0x1ce3('0xb1')]['ids']}});})[_0x1ce3('0x29')](function(_0x4a8de0){socket[_0x1ce3('0xc0')]('faxInteractionTags:save',{'id':Number(_0x5f0696[_0x1ce3('0xab')]['id']),'tags':_0x4a8de0||[]});return{'id':Number(_0x5f0696[_0x1ce3('0xab')]['id']),'tags':_0x4a8de0||[]};});}})[_0x1ce3('0x29')](respondWithResult(_0x2d725b,null))['catch'](handleError(_0x2d725b,null));};exports[_0x1ce3('0xc1')]=function(_0x3862bb,_0x50c482,_0x501db7){return db[_0x1ce3('0x93')][_0x1ce3('0xaf')]({'where':{'id':_0x3862bb[_0x1ce3('0xab')]['id']}})[_0x1ce3('0x29')](handleEntityNotFound(_0x50c482,null))[_0x1ce3('0x29')](function(_0x405273){if(_0x405273){return _0x405273['removeTags'](_0x3862bb[_0x1ce3('0x3a')][_0x1ce3('0xb6')]);}})[_0x1ce3('0x29')](respondWithStatusCode(_0x50c482,null))['catch'](handleError(_0x50c482,null));};exports[_0x1ce3('0xc2')]=function(_0x18dd59,_0x51d560){var _0x4b8963=moment()[_0x1ce3('0xc3')]()[_0x1ce3('0x8f')]();var _0x6dd34e=path[_0x1ce3('0xc4')](config['root'],_0x1ce3('0xc5'),_0x1ce3('0xc6'),_0x1ce3('0xc7'));var _0x4c929c=path[_0x1ce3('0xc4')](config[_0x1ce3('0xc8')],_0x1ce3('0xc5'),_0x1ce3('0xc6'),_0x1ce3('0xc9'));var _0x118961=path[_0x1ce3('0xc4')](_0x6dd34e,_0x4b8963);var _0x538f00=util['format']('transcript-%d-%s.zip',_0x18dd59[_0x1ce3('0xab')]['id'],_0x4b8963);var _0x5d6066=path[_0x1ce3('0xc4')](_0x6dd34e,_0x538f00);var _0x4263c5=[];_0x4263c5[_0x1ce3('0x34')]({'model':db[_0x1ce3('0xca')],'as':_0x1ce3('0xca'),'raw':!![]});var _0xddc5bf=[{'model':db[_0x1ce3('0xbc')],'as':_0x1ce3('0xcb'),'attributes':['id',_0x1ce3('0xb1'),_0x1ce3('0x70')],'include':_0x4263c5}];return db['FaxInteraction']['find']({'where':{'id':_0x18dd59[_0x1ce3('0xab')]['id']},'include':_0xddc5bf})[_0x1ce3('0x29')](handleEntityNotFound(_0x51d560,null))[_0x1ce3('0x29')](function(_0x5412d8){if(_0x5412d8&&_0x5412d8[_0x1ce3('0xcb')]){var _0x13fecd=_0x5412d8['get']({'plain':!![]});fs['mkdirSync'](_0x118961);for(var _0x33dd2c=0x0;_0x33dd2c<_0x13fecd[_0x1ce3('0xcb')][_0x1ce3('0x3f')];_0x33dd2c++){var _0x5959de=_0x13fecd['Messages'][_0x33dd2c][_0x1ce3('0xca')];if(_0x5959de){var _0x339723=path['join'](_0x4c929c,_0x5959de[_0x1ce3('0xcc')]);if(fs[_0x1ce3('0xcd')](_0x339723)){fs['createReadStream'](_0x339723)[_0x1ce3('0xce')](fs[_0x1ce3('0xcf')](path[_0x1ce3('0xc4')](_0x118961,_0x5959de[_0x1ce3('0xcc')])));}}}return BPromise[_0x1ce3('0xd0')]()['then'](function(){return new BPromise(function(_0x364f09,_0x6889b9){zipdir(_0x118961,{'saveTo':_0x5d6066},function(_0x537ad2,_0x552361){if(_0x537ad2)return _0x6889b9(_0x537ad2);return _0x364f09(_0x552361);});})[_0x1ce3('0x29')](function(){return new BPromise(function(_0x2f03f6,_0x35df9f){rimraf(_0x118961,function(_0x3a3ea1){if(_0x3a3ea1)_0x35df9f(_0x3a3ea1);return _0x2f03f6();});});})['then'](function(){return _0x51d560['download'](_0x5d6066,_0x538f00,function(_0x5cd239){if(_0x5cd239){console['log'](_0x1ce3('0xd1'),_0x5cd239);}else{fs[_0x1ce3('0xd2')](_0x5d6066);}});});});}else{return _0x51d560['sendStatus'](0xc8);}})[_0x1ce3('0x35')](handleError(_0x51d560,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 8f15a19..dbad49f 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 _0x2ac5=['setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','emit','catch','hasOwnProperty','exports','events','../../mysqldb','FaxInteraction','FaxMessage'];(function(_0x17de8f,_0x2d5177){var _0xc19ec4=function(_0x3424c0){while(--_0x3424c0){_0x17de8f['push'](_0x17de8f['shift']());}};_0xc19ec4(++_0x2d5177);}(_0x2ac5,0x152));var _0x52ac=function(_0x1c0f41,_0x26d95d){_0x1c0f41=_0x1c0f41-0x0;var _0x369a9f=_0x2ac5[_0x1c0f41];return _0x369a9f;};'use strict';var EventEmitter=require(_0x52ac('0x0'));var FaxInteraction=require(_0x52ac('0x1'))['db'][_0x52ac('0x2')];var FaxMessage=require(_0x52ac('0x1'))['db'][_0x52ac('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x52ac('0x4')](0x0);var events={'afterCreate':_0x52ac('0x5'),'afterUpdate':_0x52ac('0x6'),'afterDestroy':_0x52ac('0x7')};function emitEvent(_0x4b1a52){return function(_0x1d0d3d,_0x552318,_0x6d6c11){_0x1d0d3d[_0x52ac('0x8')]({'attributes':['id'],'raw':!![]})[_0x52ac('0x9')](function(_0x5e7c24){_0x1d0d3d[_0x52ac('0xa')](_0x52ac('0xb'),_0x5e7c24['map'](function(_0x1cf6b6){return{'id':_0x1cf6b6['id']};}));return FaxMessage[_0x52ac('0xc')]({'where':{'FaxInteractionId':_0x1d0d3d['id'],'direction':'in','read':![]},'raw':!![]});})[_0x52ac('0x9')](function(_0x3c86a5){_0x1d0d3d[_0x52ac('0xa')](_0x52ac('0xd'),_0x3c86a5['length']);FaxInteractionEvents[_0x52ac('0xe')](_0x4b1a52+':'+_0x1d0d3d['id'],_0x1d0d3d);FaxInteractionEvents[_0x52ac('0xe')](_0x4b1a52,_0x1d0d3d);_0x6d6c11(null);})[_0x52ac('0xf')](_0x6d6c11(null));};}for(var e in events){if(events[_0x52ac('0x10')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x52ac('0x11')]=FaxInteractionEvents; \ No newline at end of file +var _0x6cc8=['catch','exports','events','FaxInteraction','../../mysqldb','save','update','remove','getUsers','setDataValue','Users','map','findAll','then','unreadMessages','length','emit'];(function(_0x224f93,_0x965b78){var _0x1ca9ac=function(_0x26e34a){while(--_0x26e34a){_0x224f93['push'](_0x224f93['shift']());}};_0x1ca9ac(++_0x965b78);}(_0x6cc8,0x1bc));var _0x86cc=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0x6cc8[_0x424a9a];return _0xa7831c;};'use strict';var EventEmitter=require(_0x86cc('0x0'));var FaxInteraction=require('../../mysqldb')['db'][_0x86cc('0x1')];var FaxMessage=require(_0x86cc('0x2'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x86cc('0x3'),'afterUpdate':_0x86cc('0x4'),'afterDestroy':_0x86cc('0x5')};function emitEvent(_0x3ef3d0){return function(_0xb56e0c,_0x5407a8,_0x2d897e){_0xb56e0c[_0x86cc('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x293323){_0xb56e0c[_0x86cc('0x7')](_0x86cc('0x8'),_0x293323[_0x86cc('0x9')](function(_0x39693e){return{'id':_0x39693e['id']};}));return FaxMessage[_0x86cc('0xa')]({'where':{'FaxInteractionId':_0xb56e0c['id'],'direction':'in','read':![]},'raw':!![]});})[_0x86cc('0xb')](function(_0x380a20){_0xb56e0c[_0x86cc('0x7')](_0x86cc('0xc'),_0x380a20[_0x86cc('0xd')]);FaxInteractionEvents[_0x86cc('0xe')](_0x3ef3d0+':'+_0xb56e0c['id'],_0xb56e0c);FaxInteractionEvents[_0x86cc('0xe')](_0x3ef3d0,_0xb56e0c);_0x2d897e(null);})[_0x86cc('0xf')](_0x2d897e(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x86cc('0x10')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index a4747f0..f5bd647 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 _0xb4f1=['changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./faxInteraction.attributes','exports','FaxInteraction'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xb4f1,0x115));var _0x1b4f=function(_0xf3dabf,_0x5595fa){_0xf3dabf=_0xf3dabf-0x0;var _0x23eed3=_0xb4f1[_0xf3dabf];return _0x23eed3;};'use strict';var _=require(_0x1b4f('0x0'));var util=require(_0x1b4f('0x1'));var logger=require(_0x1b4f('0x2'))(_0x1b4f('0x3'));var moment=require(_0x1b4f('0x4'));var BPromise=require(_0x1b4f('0x5'));var rp=require(_0x1b4f('0x6'));var fs=require('fs');var path=require(_0x1b4f('0x7'));var rimraf=require('rimraf');var config=require(_0x1b4f('0x8'));var attributes=require(_0x1b4f('0x9'));module[_0x1b4f('0xa')]=function(_0x80e143,_0x2826a4){return _0x80e143['define'](_0x1b4f('0xb'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x7e1ef0,_0x178fa7,_0x6842e){if(_0x7e1ef0[_0x1b4f('0xc')](_0x1b4f('0xd'))){_0x7e1ef0[_0x1b4f('0xe')]=moment()[_0x1b4f('0xf')](_0x1b4f('0x10'));}_0x6842e(null,_0x7e1ef0);}}});}; \ No newline at end of file +var _0xe03f=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','define','fax_interactions','closed','closedAt','format','lodash','util'];(function(_0x331c8f,_0x2bdf00){var _0x2c7a21=function(_0x22ad02){while(--_0x22ad02){_0x331c8f['push'](_0x331c8f['shift']());}};_0x2c7a21(++_0x2bdf00);}(_0xe03f,0xa3));var _0xfe03=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe03f[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xfe03('0x0'));var util=require(_0xfe03('0x1'));var logger=require(_0xfe03('0x2'))(_0xfe03('0x3'));var moment=require('moment');var BPromise=require(_0xfe03('0x4'));var rp=require(_0xfe03('0x5'));var fs=require('fs');var path=require(_0xfe03('0x6'));var rimraf=require(_0xfe03('0x7'));var config=require(_0xfe03('0x8'));var attributes=require(_0xfe03('0x9'));module['exports']=function(_0x3bd5f7,_0x23570e){return _0x3bd5f7[_0xfe03('0xa')]('FaxInteraction',attributes,{'tableName':_0xfe03('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1ec5be,_0x594ae6,_0x188b49){if(_0x1ec5be['changed'](_0xfe03('0xc'))){_0x1ec5be[_0xfe03('0xd')]=moment()[_0xfe03('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x188b49(null,_0x1ec5be);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index d4bcae0..9a4fd1c 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 _0x3ce1=['omit','spread','AddTags','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis','socket.io-emitter','request','then','info','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','FaxInteraction,\x20%s,\x20%s','message','result','catch','FaxInteraction','update','body','options','attributes','limit','UpdateFaxInteraction','stringify','AddTagsToFaxInteraction','find','where','addTags','ids'];(function(_0x4ff8b4,_0xc41b9){var _0x1d78c4=function(_0x43d80b){while(--_0x43d80b){_0x4ff8b4['push'](_0x4ff8b4['shift']());}};_0x1d78c4(++_0xc41b9);}(_0x3ce1,0x174));var _0x13ce=function(_0x40ef86,_0x59688b){_0x40ef86=_0x40ef86-0x0;var _0x42fb3e=_0x3ce1[_0x40ef86];return _0x42fb3e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x13ce('0x0'));var BPromise=require(_0x13ce('0x1'));var rs=require(_0x13ce('0x2'));var fs=require('fs');var Redis=require(_0x13ce('0x3'));var db=require(_0x13ce('0x4'))['db'];var utils=require(_0x13ce('0x5'));var logger=require(_0x13ce('0x6'))(_0x13ce('0x7'));var config=require(_0x13ce('0x8'));var jayson=require(_0x13ce('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x13ce('0xa')](config[_0x13ce('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x13ce('0xc'))(new Redis(config[_0x13ce('0xb')]));require('./faxInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x1e99b0,_0x428f69,_0x5ae303){return new BPromise(function(_0x3e5279,_0x33f88c){return client[_0x13ce('0xd')](_0x1e99b0,_0x5ae303)[_0x13ce('0xe')](function(_0x106716){logger[_0x13ce('0xf')]('FaxInteraction,\x20%s,\x20%s',_0x428f69,_0x13ce('0x10'));logger[_0x13ce('0x11')](_0x13ce('0x12'),_0x428f69,_0x13ce('0x10'),JSON['stringify'](_0x106716));if(_0x106716['error']){if(_0x106716[_0x13ce('0x13')][_0x13ce('0x14')]===0x1f4){logger[_0x13ce('0x13')](_0x13ce('0x15'),_0x428f69,_0x106716[_0x13ce('0x13')][_0x13ce('0x16')]);return _0x33f88c(_0x106716[_0x13ce('0x13')]['message']);}logger[_0x13ce('0x13')](_0x13ce('0x15'),_0x428f69,_0x106716['error'][_0x13ce('0x16')]);return _0x3e5279(_0x106716[_0x13ce('0x13')][_0x13ce('0x16')]);}else{logger['info'](_0x13ce('0x15'),_0x428f69,_0x13ce('0x10'));_0x3e5279(_0x106716[_0x13ce('0x17')][_0x13ce('0x16')]);}})[_0x13ce('0x18')](function(_0x2c21b7){logger[_0x13ce('0x13')](_0x13ce('0x15'),_0x428f69,_0x2c21b7);_0x33f88c(_0x2c21b7);});});}exports['UpdateFaxInteraction']=function(_0x321cca){var _0x362cb9=this;return new Promise(function(_0x2a7949,_0x46cf76){return db[_0x13ce('0x19')][_0x13ce('0x1a')](_0x321cca[_0x13ce('0x1b')],{'raw':_0x321cca[_0x13ce('0x1c')]?_0x321cca[_0x13ce('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x321cca['options']?_0x321cca[_0x13ce('0x1c')]['where']||null:null,'attributes':_0x321cca['options']?_0x321cca[_0x13ce('0x1c')][_0x13ce('0x1d')]||null:null,'limit':_0x321cca[_0x13ce('0x1c')]?_0x321cca[_0x13ce('0x1c')][_0x13ce('0x1e')]||null:null})['then'](function(_0x4483a1){logger[_0x13ce('0xf')](_0x13ce('0x1f'),_0x321cca);logger[_0x13ce('0x11')](_0x13ce('0x1f'),_0x321cca,JSON[_0x13ce('0x20')](_0x4483a1));_0x2a7949(_0x4483a1);})[_0x13ce('0x18')](function(_0x248d91){logger[_0x13ce('0x13')](_0x13ce('0x1f'),_0x248d91['message'],_0x321cca);_0x46cf76(_0x362cb9[_0x13ce('0x13')](0x1f4,_0x248d91[_0x13ce('0x16')]));});});};exports[_0x13ce('0x21')]=function(_0x23fd74){return new Promise(function(_0x282f7c,_0x4efe16){return db[_0x13ce('0x19')][_0x13ce('0x22')]({'where':_0x23fd74[_0x13ce('0x1c')]?_0x23fd74[_0x13ce('0x1c')][_0x13ce('0x23')]||null:null})[_0x13ce('0xe')](function(_0x4338f1){if(_0x4338f1){return _0x4338f1[_0x13ce('0x24')](_0x23fd74['body'][_0x13ce('0x25')],_[_0x13ce('0x26')](_0x23fd74[_0x13ce('0x1b')],[_0x13ce('0x25'),'id'])||{});}})[_0x13ce('0x27')](function(_0x44eca4){logger[_0x13ce('0xf')](_0x13ce('0x28'),_0x23fd74);logger[_0x13ce('0x11')](_0x13ce('0x28'),_0x23fd74,JSON[_0x13ce('0x20')](_0x44eca4));_0x282f7c(_0x44eca4);})[_0x13ce('0x18')](function(_0x15481f){logger[_0x13ce('0x13')](_0x13ce('0x28'),_0x15481f['message'],_0x23fd74);_0x4efe16(_this[_0x13ce('0x13')](0x1f4,_0x15481f[_0x13ce('0x16')]));});});}; \ No newline at end of file +var _0x3c7c=['FaxInteraction,\x20%s,\x20%s','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','update','options','raw','where','attributes','limit','UpdateFaxInteraction','FaxInteraction','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./faxInteraction.socket','request','then','info'];(function(_0x4dcc2d,_0x422839){var _0x1bbd79=function(_0x173341){while(--_0x173341){_0x4dcc2d['push'](_0x4dcc2d['shift']());}};_0x1bbd79(++_0x422839);}(_0x3c7c,0x1cf));var _0xc3c7=function(_0x3e6141,_0x4e159d){_0x3e6141=_0x3e6141-0x0;var _0x3d207=_0x3c7c[_0x3e6141];return _0x3d207;};'use strict';var _=require(_0xc3c7('0x0'));var util=require(_0xc3c7('0x1'));var moment=require(_0xc3c7('0x2'));var BPromise=require('bluebird');var rs=require(_0xc3c7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc3c7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc3c7('0x5'))(_0xc3c7('0x6'));var config=require(_0xc3c7('0x7'));var jayson=require(_0xc3c7('0x8'));var client=jayson[_0xc3c7('0x9')]['http']({'port':0x232a});config[_0xc3c7('0xa')]=_[_0xc3c7('0xb')](config[_0xc3c7('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xc3c7('0xc'))(new Redis(config[_0xc3c7('0xa')]));require(_0xc3c7('0xd'))['register'](socket);function respondWithRpcPromise(_0x5053eb,_0xf796c,_0xc4c4e0){return new BPromise(function(_0x464f19,_0x599bdc){return client[_0xc3c7('0xe')](_0x5053eb,_0xc4c4e0)[_0xc3c7('0xf')](function(_0x45a344){logger[_0xc3c7('0x10')](_0xc3c7('0x11'),_0xf796c,'request\x20sent');logger[_0xc3c7('0x12')](_0xc3c7('0x13'),_0xf796c,_0xc3c7('0x14'),JSON[_0xc3c7('0x15')](_0x45a344));if(_0x45a344[_0xc3c7('0x16')]){if(_0x45a344['error'][_0xc3c7('0x17')]===0x1f4){logger[_0xc3c7('0x16')](_0xc3c7('0x11'),_0xf796c,_0x45a344[_0xc3c7('0x16')]['message']);return _0x599bdc(_0x45a344[_0xc3c7('0x16')][_0xc3c7('0x18')]);}logger['error'](_0xc3c7('0x11'),_0xf796c,_0x45a344[_0xc3c7('0x16')]['message']);return _0x464f19(_0x45a344['error'][_0xc3c7('0x18')]);}else{logger[_0xc3c7('0x10')](_0xc3c7('0x11'),_0xf796c,_0xc3c7('0x14'));_0x464f19(_0x45a344['result'][_0xc3c7('0x18')]);}})[_0xc3c7('0x19')](function(_0x582442){logger[_0xc3c7('0x16')]('FaxInteraction,\x20%s,\x20%s',_0xf796c,_0x582442);_0x599bdc(_0x582442);});});}exports['UpdateFaxInteraction']=function(_0x12d7b9){var _0x1251b2=this;return new Promise(function(_0x476938,_0x43f01b){return db['FaxInteraction'][_0xc3c7('0x1a')](_0x12d7b9['body'],{'raw':_0x12d7b9[_0xc3c7('0x1b')]?_0x12d7b9[_0xc3c7('0x1b')][_0xc3c7('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12d7b9[_0xc3c7('0x1b')]?_0x12d7b9['options'][_0xc3c7('0x1d')]||null:null,'attributes':_0x12d7b9['options']?_0x12d7b9['options'][_0xc3c7('0x1e')]||null:null,'limit':_0x12d7b9['options']?_0x12d7b9[_0xc3c7('0x1b')][_0xc3c7('0x1f')]||null:null})[_0xc3c7('0xf')](function(_0x5735e2){logger[_0xc3c7('0x10')](_0xc3c7('0x20'),_0x12d7b9);logger[_0xc3c7('0x12')](_0xc3c7('0x20'),_0x12d7b9,JSON[_0xc3c7('0x15')](_0x5735e2));_0x476938(_0x5735e2);})[_0xc3c7('0x19')](function(_0x345f03){logger[_0xc3c7('0x16')]('UpdateFaxInteraction',_0x345f03[_0xc3c7('0x18')],_0x12d7b9);_0x43f01b(_0x1251b2[_0xc3c7('0x16')](0x1f4,_0x345f03[_0xc3c7('0x18')]));});});};exports['AddTagsToFaxInteraction']=function(_0x17a686){return new Promise(function(_0x51166f,_0x5d1175){return db[_0xc3c7('0x21')]['find']({'where':_0x17a686[_0xc3c7('0x1b')]?_0x17a686['options']['where']||null:null})[_0xc3c7('0xf')](function(_0x15d591){if(_0x15d591){return _0x15d591[_0xc3c7('0x22')](_0x17a686[_0xc3c7('0x23')][_0xc3c7('0x24')],_[_0xc3c7('0x25')](_0x17a686[_0xc3c7('0x23')],['ids','id'])||{});}})[_0xc3c7('0x26')](function(_0x23fa93){logger[_0xc3c7('0x10')](_0xc3c7('0x27'),_0x17a686);logger[_0xc3c7('0x12')](_0xc3c7('0x27'),_0x17a686,JSON[_0xc3c7('0x15')](_0x23fa93));_0x51166f(_0x23fa93);})['catch'](function(_0x353695){logger[_0xc3c7('0x16')]('AddTags',_0x353695[_0xc3c7('0x18')],_0x17a686);_0x5d1175(_this[_0xc3c7('0x16')](0x1f4,_0x353695[_0xc3c7('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index a47064e..f1a5fbb 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 _0x073d=['update','emit','removeListener','register','faxInteraction:','./faxInteraction.events','save','remove'];(function(_0x47144b,_0x50f0c1){var _0x132297=function(_0x484b93){while(--_0x484b93){_0x47144b['push'](_0x47144b['shift']());}};_0x132297(++_0x50f0c1);}(_0x073d,0x1e5));var _0xd073=function(_0x3712e2,_0x32d752){_0x3712e2=_0x3712e2-0x0;var _0x1faff4=_0x073d[_0x3712e2];return _0x1faff4;};'use strict';var FaxInteractionEvents=require(_0xd073('0x0'));var events=[_0xd073('0x1'),_0xd073('0x2'),_0xd073('0x3')];function createListener(_0x3cc57b,_0x2510e6){return function(_0x2b0453){_0x2510e6[_0xd073('0x4')](_0x3cc57b,_0x2b0453);};}function removeListener(_0x2dcdd0,_0x26b8da){return function(){FaxInteractionEvents[_0xd073('0x5')](_0x2dcdd0,_0x26b8da);};}exports[_0xd073('0x6')]=function(_0x10368c){for(var _0x167ef0=0x0,_0x24a766=events['length'];_0x167ef0<_0x24a766;_0x167ef0++){var _0x30149d=events[_0x167ef0];var _0x37f8fa=createListener(_0xd073('0x7')+_0x30149d,_0x10368c);FaxInteractionEvents['on'](_0x30149d,_0x37f8fa);}}; \ No newline at end of file +var _0xd636=['./faxInteraction.events','remove','emit','removeListener','register'];(function(_0x27ad09,_0x49fc53){var _0xd80b27=function(_0x148139){while(--_0x148139){_0x27ad09['push'](_0x27ad09['shift']());}};_0xd80b27(++_0x49fc53);}(_0xd636,0x1c7));var _0x6d63=function(_0x5bf8da,_0x5ba8e6){_0x5bf8da=_0x5bf8da-0x0;var _0x10b4ce=_0xd636[_0x5bf8da];return _0x10b4ce;};'use strict';var FaxInteractionEvents=require(_0x6d63('0x0'));var events=['save',_0x6d63('0x1'),'update'];function createListener(_0x2c48ad,_0x534301){return function(_0x397d3f){_0x534301[_0x6d63('0x2')](_0x2c48ad,_0x397d3f);};}function removeListener(_0x442496,_0x4cd0f0){return function(){FaxInteractionEvents[_0x6d63('0x3')](_0x442496,_0x4cd0f0);};}exports[_0x6d63('0x4')]=function(_0x1daf95){for(var _0x4a7aae=0x0,_0x5cefc0=events['length'];_0x4a7aae<_0x5cefc0;_0x4a7aae++){var _0x5648ff=events[_0x4a7aae];var _0x598726=createListener('faxInteraction:'+_0x5648ff,_0x1daf95);FaxInteractionEvents['on'](_0x5648ff,_0x598726);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 0f8a9df..684c094 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 _0x02ea=['exports','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/messages','getMessages','download','post','create','addMessage','/:id/tags','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','removeTags'];(function(_0x12ef2e,_0x412417){var _0x582975=function(_0x1cdd64){while(--_0x1cdd64){_0x12ef2e['push'](_0x12ef2e['shift']());}};_0x582975(++_0x412417);}(_0x02ea,0x135));var _0xa02e=function(_0x1ed116,_0x23bc80){_0x1ed116=_0x1ed116-0x0;var _0x574066=_0x02ea[_0x1ed116];return _0x574066;};'use strict';var multer=require('multer');var util=require(_0xa02e('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa02e('0x1')]();var fs_extra=require(_0xa02e('0x2'));var auth=require(_0xa02e('0x3'));var interaction=require(_0xa02e('0x4'));var config=require(_0xa02e('0x5'));var controller=require('./faxInteraction.controller');router[_0xa02e('0x6')]('/',auth[_0xa02e('0x7')](),controller['index']);router[_0xa02e('0x6')]('/describe',auth[_0xa02e('0x7')](),controller['describe']);router[_0xa02e('0x6')](_0xa02e('0x8'),auth[_0xa02e('0x7')](),controller[_0xa02e('0x9')]);router[_0xa02e('0x6')](_0xa02e('0xa'),auth['isAuthenticated'](),controller[_0xa02e('0xb')]);router[_0xa02e('0x6')]('/:id/download',auth[_0xa02e('0x7')](),controller[_0xa02e('0xc')]);router[_0xa02e('0xd')]('/',auth['isAuthenticated'](),controller[_0xa02e('0xe')]);router['post'](_0xa02e('0xa'),auth['isAuthenticated'](),controller[_0xa02e('0xf')]);router[_0xa02e('0xd')](_0xa02e('0x10'),auth[_0xa02e('0x7')](),interaction['tracked'](_0xa02e('0x11'),_0xa02e('0x12')),controller[_0xa02e('0x13')]);router[_0xa02e('0x14')](_0xa02e('0x8'),auth[_0xa02e('0x7')](),interaction['tracked']('fax',_0xa02e('0x15')),controller[_0xa02e('0x16')]);router[_0xa02e('0x17')](_0xa02e('0x8'),auth[_0xa02e('0x7')](),interaction['tracked'](_0xa02e('0x11'),_0xa02e('0x18')),controller[_0xa02e('0x19')]);router[_0xa02e('0x17')](_0xa02e('0x10'),auth['isAuthenticated'](),controller[_0xa02e('0x1a')]);module[_0xa02e('0x1b')]=router; \ No newline at end of file +var _0x4f97=['faxinteraction:update','update','delete','faxinteraction:destroy','destroy','removeTags','multer','util','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','post','create','/:id/tags','tracked','put','/:id','fax'];(function(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_0x4f97,0x132));var _0x74f9=function(_0x48cb2e,_0x5b2d58){_0x48cb2e=_0x48cb2e-0x0;var _0x4c5a2c=_0x4f97[_0x48cb2e];return _0x4c5a2c;};'use strict';var multer=require(_0x74f9('0x0'));var util=require(_0x74f9('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x74f9('0x2'));var auth=require(_0x74f9('0x3'));var interaction=require(_0x74f9('0x4'));var config=require(_0x74f9('0x5'));var controller=require(_0x74f9('0x6'));router[_0x74f9('0x7')]('/',auth[_0x74f9('0x8')](),controller[_0x74f9('0x9')]);router[_0x74f9('0x7')](_0x74f9('0xa'),auth[_0x74f9('0x8')](),controller[_0x74f9('0xb')]);router['get']('/:id',auth[_0x74f9('0x8')](),controller[_0x74f9('0xc')]);router[_0x74f9('0x7')](_0x74f9('0xd'),auth['isAuthenticated'](),controller[_0x74f9('0xe')]);router[_0x74f9('0x7')](_0x74f9('0xf'),auth[_0x74f9('0x8')](),controller[_0x74f9('0x10')]);router[_0x74f9('0x11')]('/',auth[_0x74f9('0x8')](),controller[_0x74f9('0x12')]);router[_0x74f9('0x11')](_0x74f9('0xd'),auth[_0x74f9('0x8')](),controller['addMessage']);router['post'](_0x74f9('0x13'),auth[_0x74f9('0x8')](),interaction[_0x74f9('0x14')]('fax','faxinteraction:addtags'),controller['addTags']);router[_0x74f9('0x15')](_0x74f9('0x16'),auth[_0x74f9('0x8')](),interaction[_0x74f9('0x14')](_0x74f9('0x17'),_0x74f9('0x18')),controller[_0x74f9('0x19')]);router[_0x74f9('0x1a')]('/:id',auth['isAuthenticated'](),interaction[_0x74f9('0x14')](_0x74f9('0x17'),_0x74f9('0x1b')),controller[_0x74f9('0x1c')]);router[_0x74f9('0x1a')](_0x74f9('0x13'),auth['isAuthenticated'](),controller[_0x74f9('0x1d')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 0815e77..9007557 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 _0x8f37=['TEXT','ENUM','out','DATE','sequelize','exports'];(function(_0x3f7356,_0x2c907f){var _0x52b78a=function(_0x2aa045){while(--_0x2aa045){_0x3f7356['push'](_0x3f7356['shift']());}};_0x52b78a(++_0x2c907f);}(_0x8f37,0x190));var _0x78f3=function(_0x5ec015,_0x1fb586){_0x5ec015=_0x5ec015-0x0;var _0x26d841=_0x8f37[_0x5ec015];return _0x26d841;};'use strict';var Sequelize=require(_0x78f3('0x0'));module[_0x78f3('0x1')]={'body':{'type':Sequelize[_0x78f3('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x78f3('0x3')]('in',_0x78f3('0x4')),'defaultValue':_0x78f3('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x78f3('0x5')]}}; \ No newline at end of file +var _0xfa2b=['exports','TEXT','medium','BOOLEAN','ENUM','out','DATE','sequelize'];(function(_0x3c60fc,_0x593ef5){var _0x495fd2=function(_0x33e7ea){while(--_0x33e7ea){_0x3c60fc['push'](_0x3c60fc['shift']());}};_0x495fd2(++_0x593ef5);}(_0xfa2b,0x1b7));var _0xbfa2=function(_0x4c63ed,_0x35e8d4){_0x4c63ed=_0x4c63ed-0x0;var _0x2b2fe2=_0xfa2b[_0x4c63ed];return _0x2b2fe2;};'use strict';var Sequelize=require(_0xbfa2('0x0'));module[_0xbfa2('0x1')]={'body':{'type':Sequelize[_0xbfa2('0x2')](_0xbfa2('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xbfa2('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xbfa2('0x5')]('in',_0xbfa2('0x6')),'defaultValue':_0xbfa2('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xbfa2('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0xbfa2('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 480b812..d83fb05 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 _0xcb88=['Attachment','findOne','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','files','attachments','eml-format','zip-dir','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','FaxMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','show','intersection','find','body','params','describe','fax-interactions','accept','read','readAt','format','UserId','user','agent','FaxInteraction','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','email','manual','interface','SIP/%s','channel','event','EventManager','fax','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','RejectMessage','rejectMessage','contact','internal','create'];(function(_0x31157b,_0x6b2fe1){var _0x19dd21=function(_0x1a19be){while(--_0x1a19be){_0x31157b['push'](_0x31157b['shift']());}};_0x19dd21(++_0x6b2fe1);}(_0xcb88,0x1cc));var _0x8cb8=function(_0x2c9bec,_0x1d7bd0){_0x2c9bec=_0x2c9bec-0x0;var _0x1ab136=_0xcb88[_0x2c9bec];return _0x1ab136;};'use strict';var emlformat=require(_0x8cb8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8cb8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8cb8('0x2'));var BPromise=require(_0x8cb8('0x3'));var Mustache=require(_0x8cb8('0x4'));var util=require('util');var path=require(_0x8cb8('0x5'));var sox=require(_0x8cb8('0x6'));var csv=require('to-csv');var ejs=require(_0x8cb8('0x7'));var fs=require('fs');var fs_extra=require(_0x8cb8('0x8'));var _=require(_0x8cb8('0x9'));var squel=require('squel');var crypto=require(_0x8cb8('0xa'));var jsforce=require(_0x8cb8('0xb'));var deskjs=require(_0x8cb8('0xc'));var toCsv=require('to-csv');var querystring=require(_0x8cb8('0xd'));var Papa=require('papaparse');var Redis=require(_0x8cb8('0xe'));var authService=require(_0x8cb8('0xf'));var qs=require(_0x8cb8('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8cb8('0x11'));var logger=require(_0x8cb8('0x12'))(_0x8cb8('0x13'));var utils=require(_0x8cb8('0x14'));var config=require(_0x8cb8('0x15'));var licenseUtil=require(_0x8cb8('0x16'));var db=require(_0x8cb8('0x17'))['db'];config[_0x8cb8('0x18')]=_[_0x8cb8('0x19')](config['redis'],{'host':_0x8cb8('0x1a'),'port':0x18eb});var socket=require(_0x8cb8('0x1b'))(new Redis(config[_0x8cb8('0x18')]));require(_0x8cb8('0x1c'))[_0x8cb8('0x1d')](socket);var jayson=require(_0x8cb8('0x1e'));var client=jayson[_0x8cb8('0x1f')][_0x8cb8('0x20')]({'port':0x232c});var client9002=jayson[_0x8cb8('0x1f')][_0x8cb8('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x50dcb0,_0x239e35,_0xf31133,_0xd864a2){return new BPromise(function(_0x43947a,_0x5bbe8e){var _0x579815=_0xd864a2||client;return _0x579815[_0x8cb8('0x21')](_0x50dcb0,_0xf31133)[_0x8cb8('0x22')](function(_0x2450f8){logger[_0x8cb8('0x23')](_0x8cb8('0x24'),_0x239e35,'request\x20sent');logger[_0x8cb8('0x25')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x239e35,_0x8cb8('0x26'),JSON['stringify'](_0x2450f8));if(_0x2450f8[_0x8cb8('0x27')]){if(_0x2450f8[_0x8cb8('0x27')][_0x8cb8('0x28')]===0x1f4){logger[_0x8cb8('0x27')](_0x8cb8('0x24'),_0x239e35,_0x2450f8[_0x8cb8('0x27')][_0x8cb8('0x29')]);return _0x5bbe8e(_0x2450f8[_0x8cb8('0x27')]['message']);}logger[_0x8cb8('0x27')](_0x8cb8('0x24'),_0x239e35,_0x2450f8[_0x8cb8('0x27')][_0x8cb8('0x29')]);return _0x43947a(_0x2450f8[_0x8cb8('0x27')][_0x8cb8('0x29')]);}else{logger[_0x8cb8('0x23')](_0x8cb8('0x24'),_0x239e35,_0x8cb8('0x26'));_0x43947a(_0x2450f8[_0x8cb8('0x2a')]['message']);}})[_0x8cb8('0x2b')](function(_0x535e08){logger[_0x8cb8('0x27')](_0x8cb8('0x24'),_0x239e35,_0x535e08);_0x5bbe8e(_0x535e08);});});}function respondWithStatusCode(_0x28ad4a,_0x4043f7){_0x4043f7=_0x4043f7||0xcc;return function(_0x4d368f){if(_0x4d368f){return _0x28ad4a[_0x8cb8('0x2c')](_0x4043f7);}return _0x28ad4a[_0x8cb8('0x2d')](_0x4043f7)[_0x8cb8('0x2e')]();};}function respondWithResult(_0x19b64b,_0x47873a){_0x47873a=_0x47873a||0xc8;return function(_0x35fc56){if(_0x35fc56){return _0x19b64b[_0x8cb8('0x2d')](_0x47873a)[_0x8cb8('0x2f')](_0x35fc56);}};}function respondWithFilteredResult(_0x5449a9,_0x34b6f3){return function(_0x50a768){if(_0x50a768){var _0x4714de=typeof _0x34b6f3[_0x8cb8('0x30')]===_0x8cb8('0x31')&&typeof _0x34b6f3['limit']===_0x8cb8('0x31');var _0xdd72fb=_0x50a768['count'];var _0xceedc=_0x4714de?0x0:_0x34b6f3[_0x8cb8('0x30')];var _0x1b8fef=_0x4714de?_0x50a768[_0x8cb8('0x32')]:_0x34b6f3[_0x8cb8('0x30')]+_0x34b6f3['limit'];var _0x5736e0;if(_0x1b8fef>=_0xdd72fb){_0x1b8fef=_0xdd72fb;_0x5736e0=0xc8;}else{_0x5736e0=0xce;}_0x5449a9['status'](_0x5736e0);return _0x5449a9[_0x8cb8('0x33')](_0x8cb8('0x34'),_0xceedc+'-'+_0x1b8fef+'/'+_0xdd72fb)['json'](_0x50a768);}return null;};}function patchUpdates(_0x41e50a){return function(_0x7420bf){try{jsonpatch[_0x8cb8('0x35')](_0x7420bf,_0x41e50a,!![]);}catch(_0x524d85){return BPromise[_0x8cb8('0x36')](_0x524d85);}return _0x7420bf[_0x8cb8('0x37')]();};}function saveUpdates(_0x2e5452,_0x4f3823){return function(_0x1c877d){if(_0x1c877d){return _0x1c877d[_0x8cb8('0x38')](_0x2e5452)[_0x8cb8('0x22')](function(_0x31b71f){return _0x31b71f;});}return null;};}function removeEntity(_0x4ea3a3,_0x106174){return function(_0x130eaf){if(_0x130eaf){return _0x130eaf[_0x8cb8('0x39')]()[_0x8cb8('0x22')](function(){_0x4ea3a3[_0x8cb8('0x2d')](0xcc)[_0x8cb8('0x2e')]();});}};}function handleEntityNotFound(_0x4321f3,_0x3d1af6){return function(_0x82216f){if(!_0x82216f){_0x4321f3['sendStatus'](0x194);}return _0x82216f;};}function handleError(_0x1e9384,_0x5c78ed){_0x5c78ed=_0x5c78ed||0x1f4;return function(_0x4699cc){logger[_0x8cb8('0x27')](_0x4699cc[_0x8cb8('0x3a')]);if(_0x4699cc[_0x8cb8('0x3b')]){delete _0x4699cc['name'];}_0x1e9384[_0x8cb8('0x2d')](_0x5c78ed)[_0x8cb8('0x3c')](_0x4699cc);};}exports[_0x8cb8('0x3d')]=function(_0x2338be,_0x5ed4c2){var _0x33929a={},_0x37ff08={},_0x3fa0f7={'count':0x0,'rows':[]};var _0x3308b8=_[_0x8cb8('0x3e')](db[_0x8cb8('0x3f')][_0x8cb8('0x40')],function(_0x3a93f2){return{'name':_0x3a93f2[_0x8cb8('0x41')],'type':_0x3a93f2[_0x8cb8('0x42')][_0x8cb8('0x43')]};});_0x37ff08[_0x8cb8('0x44')]=_[_0x8cb8('0x3e')](_0x3308b8,_0x8cb8('0x3b'));_0x37ff08[_0x8cb8('0x45')]=_[_0x8cb8('0x46')](_0x2338be[_0x8cb8('0x45')]);_0x37ff08[_0x8cb8('0x47')]=_['intersection'](_0x37ff08[_0x8cb8('0x44')],_0x37ff08['query']);_0x33929a['attributes']=_['intersection'](_0x37ff08['model'],qs[_0x8cb8('0x48')](_0x2338be[_0x8cb8('0x45')][_0x8cb8('0x48')]));_0x33929a[_0x8cb8('0x49')]=_0x33929a[_0x8cb8('0x49')][_0x8cb8('0x4a')]?_0x33929a[_0x8cb8('0x49')]:_0x37ff08['model'];if(!_0x2338be['query'][_0x8cb8('0x4b')](_0x8cb8('0x4c'))){_0x33929a[_0x8cb8('0x4d')]=qs[_0x8cb8('0x4d')](_0x2338be[_0x8cb8('0x45')]['limit']);_0x33929a['offset']=qs['offset'](_0x2338be['query'][_0x8cb8('0x30')]);}_0x33929a[_0x8cb8('0x4e')]=qs[_0x8cb8('0x4f')](_0x2338be[_0x8cb8('0x45')]['sort']);_0x33929a[_0x8cb8('0x50')]=qs[_0x8cb8('0x47')](_[_0x8cb8('0x51')](_0x2338be[_0x8cb8('0x45')],_0x37ff08[_0x8cb8('0x47')]),_0x3308b8);if(_0x2338be[_0x8cb8('0x45')][_0x8cb8('0x52')]){_0x33929a[_0x8cb8('0x50')]=_[_0x8cb8('0x53')](_0x33929a['where'],{'$or':_[_0x8cb8('0x3e')](_0x3308b8,function(_0x2a6232){if(_0x2a6232[_0x8cb8('0x42')]!==_0x8cb8('0x54')){var _0x252bb2={};_0x252bb2[_0x2a6232[_0x8cb8('0x3b')]]={'$like':'%'+_0x2338be['query'][_0x8cb8('0x52')]+'%'};return _0x252bb2;}})});}_0x33929a=_[_0x8cb8('0x53')]({},_0x33929a,_0x2338be['options']);var _0x5144d7={'where':_0x33929a[_0x8cb8('0x50')]};return db[_0x8cb8('0x3f')][_0x8cb8('0x32')](_0x5144d7)[_0x8cb8('0x22')](function(_0x1b3bbd){_0x3fa0f7['count']=_0x1b3bbd;if(_0x2338be[_0x8cb8('0x45')][_0x8cb8('0x55')]){_0x33929a['include']=[{'all':!![]}];}return db['FaxMessage'][_0x8cb8('0x56')](_0x33929a);})[_0x8cb8('0x22')](function(_0x2e5438){_0x3fa0f7['rows']=_0x2e5438;return _0x3fa0f7;})[_0x8cb8('0x22')](respondWithFilteredResult(_0x5ed4c2,_0x33929a))[_0x8cb8('0x2b')](handleError(_0x5ed4c2,null));};exports[_0x8cb8('0x57')]=function(_0x374934,_0x36002f){var _0x40e73f={'raw':!![],'where':{'id':_0x374934['params']['id']}},_0x1a8d86={};_0x1a8d86[_0x8cb8('0x44')]=_[_0x8cb8('0x46')](db[_0x8cb8('0x3f')][_0x8cb8('0x40')]);_0x1a8d86[_0x8cb8('0x45')]=_[_0x8cb8('0x46')](_0x374934[_0x8cb8('0x45')]);_0x1a8d86[_0x8cb8('0x47')]=_[_0x8cb8('0x58')](_0x1a8d86[_0x8cb8('0x44')],_0x1a8d86[_0x8cb8('0x45')]);_0x40e73f[_0x8cb8('0x49')]=_[_0x8cb8('0x58')](_0x1a8d86['model'],qs[_0x8cb8('0x48')](_0x374934[_0x8cb8('0x45')]['fields']));_0x40e73f[_0x8cb8('0x49')]=_0x40e73f[_0x8cb8('0x49')][_0x8cb8('0x4a')]?_0x40e73f['attributes']:_0x1a8d86[_0x8cb8('0x44')];if(_0x374934[_0x8cb8('0x45')][_0x8cb8('0x55')]){_0x40e73f['include']=[{'all':!![]}];}_0x40e73f=_[_0x8cb8('0x53')]({},_0x40e73f,_0x374934['options']);return db[_0x8cb8('0x3f')][_0x8cb8('0x59')](_0x40e73f)[_0x8cb8('0x22')](handleEntityNotFound(_0x36002f,null))[_0x8cb8('0x22')](respondWithResult(_0x36002f,null))[_0x8cb8('0x2b')](handleError(_0x36002f,null));};exports[_0x8cb8('0x38')]=function(_0x4fc297,_0x25a0c7){if(_0x4fc297[_0x8cb8('0x5a')]['id']){delete _0x4fc297[_0x8cb8('0x5a')]['id'];}return db[_0x8cb8('0x3f')]['find']({'where':{'id':_0x4fc297[_0x8cb8('0x5b')]['id']}})[_0x8cb8('0x22')](handleEntityNotFound(_0x25a0c7,null))[_0x8cb8('0x22')](saveUpdates(_0x4fc297[_0x8cb8('0x5a')],null))[_0x8cb8('0x22')](respondWithResult(_0x25a0c7,null))[_0x8cb8('0x2b')](handleError(_0x25a0c7,null));};exports[_0x8cb8('0x39')]=function(_0xe67399,_0x3a464d){return db[_0x8cb8('0x3f')][_0x8cb8('0x59')]({'where':{'id':_0xe67399[_0x8cb8('0x5b')]['id']}})['then'](handleEntityNotFound(_0x3a464d,null))[_0x8cb8('0x22')](removeEntity(_0x3a464d,null))[_0x8cb8('0x2b')](handleError(_0x3a464d,null));};exports['describe']=function(_0x45ad72,_0x4a9fe0){return db[_0x8cb8('0x3f')][_0x8cb8('0x5c')]()[_0x8cb8('0x22')](respondWithResult(_0x4a9fe0,null))['catch'](handleError(_0x4a9fe0,null));};var interaction_log=require(_0x8cb8('0x12'))(_0x8cb8('0x5d'));exports[_0x8cb8('0x5e')]=function(_0x2e5d55,_0xeeb13,_0x177394){var _0x5780e5={'agent':{},'channel':'fax'};if(_0x2e5d55[_0x8cb8('0x5a')]['id']){delete _0x2e5d55['body']['id'];}_0x2e5d55[_0x8cb8('0x5a')][_0x8cb8('0x5f')]=!![];_0x2e5d55[_0x8cb8('0x5a')][_0x8cb8('0x60')]=moment()[_0x8cb8('0x61')]('YYYY-MM-DD\x20HH:mm:ss');_0x2e5d55[_0x8cb8('0x5a')][_0x8cb8('0x62')]=_0x2e5d55['body'][_0x8cb8('0x62')]||_0x2e5d55[_0x8cb8('0x63')]['id'];_0x5780e5[_0x8cb8('0x64')]['id']=_0x2e5d55[_0x8cb8('0x5a')][_0x8cb8('0x62')];return db[_0x8cb8('0x3f')][_0x8cb8('0x59')]({'where':{'id':_0x2e5d55[_0x8cb8('0x5b')]['id'],'UserId':null}})[_0x8cb8('0x22')](handleEntityNotFound(_0xeeb13,null))['then'](saveUpdates(_0x2e5d55['body'],null))[_0x8cb8('0x22')](function(_0x5a2b75){if(_0x5a2b75){_0x5780e5[_0x8cb8('0x29')]=_0x5a2b75['get']({'plain':!![]});return db[_0x8cb8('0x65')][_0x8cb8('0x59')]({'where':{'id':_0x5a2b75['FaxInteractionId']}});}return null;})[_0x8cb8('0x22')](handleEntityNotFound(_0xeeb13,null))[_0x8cb8('0x22')](function(_0x26c1c5){if(_0x26c1c5){return _0x26c1c5[_0x8cb8('0x38')]({'UserId':_0x2e5d55['body'][_0x8cb8('0x62')],'read1stAt':_[_0x8cb8('0x66')](_0x26c1c5[_0x8cb8('0x67')])?moment()[_0x8cb8('0x61')](_0x8cb8('0x68')):undefined});}return null;})[_0x8cb8('0x22')](function(_0x1f5278){if(_0x1f5278){_0x5780e5['interaction']=_0x1f5278[_0x8cb8('0x69')]({'plain':!![]});interaction_log[_0x8cb8('0x23')](_0x8cb8('0x6a'),_0x2e5d55[_0x8cb8('0x63')]['id'],_0x2e5d55[_0x8cb8('0x63')][_0x8cb8('0x3b')],_0x2e5d55['user'][_0x8cb8('0x6b')],_0x5780e5[_0x8cb8('0x6c')]['id'],_0x2e5d55[_0x8cb8('0x5a')]?JSON['stringify'](_0x2e5d55[_0x8cb8('0x5a')]):_0x8cb8('0x6d'));return respondWithRpcPromise(_0x8cb8('0x6e'),_0x8cb8('0x6f'),_0x5780e5);}return null;})[_0x8cb8('0x22')](function(_0x30ff6a){var _0x5e2758=_0x8cb8('0x70')+_0x30ff6a[_0x8cb8('0x29')][_0x8cb8('0x71')];return db[_0x8cb8('0x72')][_0x8cb8('0x45')](_0x5e2758,{'type':db[_0x8cb8('0x73')][_0x8cb8('0x74')][_0x8cb8('0x75')],'raw':!![]})['then'](function(_0xb631dc){return _0xb631dc;});})[_0x8cb8('0x22')](function(_0x3ec6e8){if(_0x3ec6e8){_0x5780e5[_0x8cb8('0x29')]['contact']=_0x3ec6e8[0x0];if(!_0x2e5d55[_0x8cb8('0x5a')][_0x8cb8('0x62')])return;return db[_0x8cb8('0x76')][_0x8cb8('0x59')]({'where':{'id':_0x2e5d55[_0x8cb8('0x5a')][_0x8cb8('0x62')],'role':'agent'},'attributes':['id','name',_0x8cb8('0x77'),_0x8cb8('0x78'),'internal'],'raw':!![]});}return null;})[_0x8cb8('0x22')](function(_0x244b5){if(!_0x244b5)return null;_0x5780e5[_0x8cb8('0x29')][_0x8cb8('0x64')]=_0x244b5;return _0x5780e5;})[_0x8cb8('0x22')](function(_0x24e246){if(_0x24e246){if(_0x2e5d55['body'][_0x8cb8('0x79')]){_0x5780e5[_0x8cb8('0x29')][_0x8cb8('0x7a')]=util[_0x8cb8('0x61')](_0x8cb8('0x7b'),_0x2e5d55[_0x8cb8('0x63')][_0x8cb8('0x3b')]);_0x5780e5['message'][_0x8cb8('0x7c')]=_0x5780e5[_0x8cb8('0x7c')];_0x5780e5['message'][_0x8cb8('0x7d')]=_0x8cb8('0x5e');return respondWithRpcPromise(_0x8cb8('0x7e'),_0x8cb8('0x7e'),{'event':'acceptmessage','message':_0x5780e5[_0x8cb8('0x29')]},client9002)[_0x8cb8('0x22')](function(){return _0x5780e5;});}return _0x5780e5;}return null;})[_0x8cb8('0x22')](respondWithResult(_0xeeb13,null))[_0x8cb8('0x2b')](handleError(_0xeeb13,null));};var interaction_log=require('../../config/logger')(_0x8cb8('0x5d'));exports['reject']=function(_0x1599ac,_0x504eaa,_0x4ee598){var _0x4e5d7c={'agent':{},'channel':_0x8cb8('0x7f')};if(_0x1599ac[_0x8cb8('0x5a')]['id']){delete _0x1599ac[_0x8cb8('0x5a')]['id'];}_0x1599ac[_0x8cb8('0x5a')][_0x8cb8('0x62')]=_0x1599ac[_0x8cb8('0x5a')]['UserId']||_0x1599ac['user']['id'];_0x4e5d7c[_0x8cb8('0x64')]['id']=_0x1599ac[_0x8cb8('0x5a')][_0x8cb8('0x62')];return db[_0x8cb8('0x3f')][_0x8cb8('0x59')]({'where':{'id':_0x1599ac[_0x8cb8('0x5b')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x504eaa,null))[_0x8cb8('0x22')](function(_0x5303fd){if(_0x5303fd){_0x4e5d7c[_0x8cb8('0x29')]=_0x5303fd['get']({'plain':!![]});return db[_0x8cb8('0x65')][_0x8cb8('0x59')]({'where':{'id':_0x5303fd[_0x8cb8('0x80')]}});}return null;})[_0x8cb8('0x22')](handleEntityNotFound(_0x504eaa,null))[_0x8cb8('0x22')](function(_0x1d381d){if(_0x1d381d){_0x4e5d7c[_0x8cb8('0x6c')]=_0x1d381d[_0x8cb8('0x69')]({'plain':!![]});interaction_log[_0x8cb8('0x23')](_0x8cb8('0x81'),_0x1599ac['user']['id'],_0x1599ac[_0x8cb8('0x63')][_0x8cb8('0x3b')],_0x1599ac[_0x8cb8('0x63')][_0x8cb8('0x6b')],_0x4e5d7c[_0x8cb8('0x6c')]['id'],_0x1599ac[_0x8cb8('0x5a')]?JSON[_0x8cb8('0x82')](_0x1599ac[_0x8cb8('0x5a')]):_0x8cb8('0x6d'));return respondWithRpcPromise(_0x8cb8('0x83'),_0x8cb8('0x84'),_0x4e5d7c);}return null;})[_0x8cb8('0x22')](function(_0x1e86b1){var _0x1560c3='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1e86b1['message']['ContactId'];return db[_0x8cb8('0x72')][_0x8cb8('0x45')](_0x1560c3,{'type':db[_0x8cb8('0x73')][_0x8cb8('0x74')][_0x8cb8('0x75')],'raw':!![]})['then'](function(_0x4060d7){return _0x4060d7;});})['then'](function(_0x528dea){if(_0x528dea){_0x4e5d7c['message'][_0x8cb8('0x85')]=_0x528dea[0x0];if(!_0x1599ac[_0x8cb8('0x5a')][_0x8cb8('0x62')])return;return db[_0x8cb8('0x76')][_0x8cb8('0x59')]({'where':{'id':_0x1599ac[_0x8cb8('0x5a')][_0x8cb8('0x62')],'role':_0x8cb8('0x64')},'attributes':['id',_0x8cb8('0x3b'),'fullname',_0x8cb8('0x78'),_0x8cb8('0x86')],'raw':!![]});}return null;})[_0x8cb8('0x22')](function(_0x3cdc1c){if(!_0x3cdc1c)return null;_0x4e5d7c[_0x8cb8('0x29')][_0x8cb8('0x64')]=_0x3cdc1c;return _0x4e5d7c;})[_0x8cb8('0x22')](function(_0x505981){if(_0x505981){_0x505981[_0x8cb8('0x29')][_0x8cb8('0x7a')]=util['format'](_0x8cb8('0x7b'),_0x1599ac[_0x8cb8('0x63')][_0x8cb8('0x3b')]);_0x505981['message'][_0x8cb8('0x7c')]=_0x4e5d7c[_0x8cb8('0x7c')];_0x505981[_0x8cb8('0x29')][_0x8cb8('0x7d')]='reject';respondWithRpcPromise(_0x8cb8('0x7e'),'EventManager',{'event':'rejectmessage','message':_0x505981[_0x8cb8('0x29')]},client9002);return _0x4e5d7c;}return null;})[_0x8cb8('0x22')](respondWithResult(_0x504eaa,null))[_0x8cb8('0x2b')](handleError(_0x504eaa,null));};exports[_0x8cb8('0x87')]=function(_0x1c4300,_0xdb3fef){var _0x2b1d02;return db['FaxMessage']['create'](_0x1c4300[_0x8cb8('0x5a')],{})[_0x8cb8('0x22')](function(_0x48b557){_0x2b1d02=_0x48b557;return db['CmContact']['findOne']({'where':{'id':_0x2b1d02[_0x8cb8('0x71')]}});})[_0x8cb8('0x22')](function(_0x585880){if(_[_0x8cb8('0x66')](_0x585880)){return;}else{_0x2b1d02[_0x8cb8('0x7f')]=_0x585880['fax'];return db[_0x8cb8('0x88')][_0x8cb8('0x89')]({'where':{'id':_0x2b1d02[_0x8cb8('0x8a')]}});}})[_0x8cb8('0x22')](function(_0x51c236){return respondWithRpcPromise('SendFax',_0x8cb8('0x8b'),{'FaxAccountId':_[_0x8cb8('0x66')](_0x1c4300['body'])?undefined:_0x1c4300[_0x8cb8('0x5a')][_0x8cb8('0x8c')],'path':_[_0x8cb8('0x66')](_0x51c236)?undefined:util['format'](_0x8cb8('0x8d'),_0x51c236[_0x8cb8('0x8e')]),'fax':_['isNil'](_0x2b1d02[_0x8cb8('0x7f')])?undefined:_0x2b1d02[_0x8cb8('0x7f')],'AttachmentId':_0x2b1d02[_0x8cb8('0x8a')]},client9002);})[_0x8cb8('0x22')](respondWithResult(_0xdb3fef,0xc9))[_0x8cb8('0x2b')](handleError(_0xdb3fef,null));};exports[_0x8cb8('0x8f')]=function(_0x5befad,_0x59f035){var _0x5b2e14=path[_0x8cb8('0x90')](config[_0x8cb8('0x91')],_0x8cb8('0x92'),_0x8cb8('0x93'),_0x8cb8('0x94'));return db[_0x8cb8('0x3f')][_0x8cb8('0x59')]({'where':{'id':_0x5befad[_0x8cb8('0x5b')]['id']},'include':[{'model':db[_0x8cb8('0x88')],'as':_0x8cb8('0x88')}]})['then'](handleEntityNotFound(_0x59f035,null))[_0x8cb8('0x22')](function(_0x5e8d16){if(_0x5e8d16){return _0x59f035['download'](path[_0x8cb8('0x90')](_0x5b2e14,_0x5e8d16[_0x8cb8('0x88')][_0x8cb8('0x8e')]));}})[_0x8cb8('0x2b')](handleError(_0x59f035,null));}; \ No newline at end of file +var _0x0b11=['key','query','keys','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','options','FaxMessage','findAll','show','params','includeAll','include','update','body','find','describe','fax-interactions','fax','read','readAt','UserId','FaxInteraction','isNil','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','interaction','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','contact','User','agent','email','internal','manual','interface','channel','event','accept','EventManager','acceptmessage','../../config/logger','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','ContactId','sequelize','Sequelize','fullname','SIP/%s','reject','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','server','files','join','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxMessage.socket','client','http','then','FaxMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','json','limit','count','offset','set','apply','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','type'];(function(_0x45d598,_0x3a4750){var _0x5dbe8c=function(_0x4eaa56){while(--_0x4eaa56){_0x45d598['push'](_0x45d598['shift']());}};_0x5dbe8c(++_0x3a4750);}(_0x0b11,0x170));var _0x10b1=function(_0x24ea39,_0x382106){_0x24ea39=_0x24ea39-0x0;var _0x9cd11e=_0x0b11[_0x24ea39];return _0x9cd11e;};'use strict';var emlformat=require(_0x10b1('0x0'));var rimraf=require(_0x10b1('0x1'));var zipdir=require(_0x10b1('0x2'));var jsonpatch=require(_0x10b1('0x3'));var rp=require(_0x10b1('0x4'));var moment=require(_0x10b1('0x5'));var BPromise=require(_0x10b1('0x6'));var Mustache=require(_0x10b1('0x7'));var util=require(_0x10b1('0x8'));var path=require('path');var sox=require(_0x10b1('0x9'));var csv=require(_0x10b1('0xa'));var ejs=require(_0x10b1('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x10b1('0xc'));var squel=require('squel');var crypto=require(_0x10b1('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x10b1('0xe'));var toCsv=require('to-csv');var querystring=require(_0x10b1('0xf'));var Papa=require(_0x10b1('0x10'));var Redis=require(_0x10b1('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x10b1('0x12'));var hardwareService=require(_0x10b1('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x10b1('0x14'));var config=require(_0x10b1('0x15'));var licenseUtil=require(_0x10b1('0x16'));var db=require(_0x10b1('0x17'))['db'];config[_0x10b1('0x18')]=_[_0x10b1('0x19')](config[_0x10b1('0x18')],{'host':_0x10b1('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x10b1('0x1b'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x10b1('0x1c')][_0x10b1('0x1d')]({'port':0x232c});var client9002=jayson[_0x10b1('0x1c')][_0x10b1('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x227364,_0xffa3ba,_0x2d4109,_0x4cb50e){return new BPromise(function(_0x33343c,_0x44c56a){var _0x1e0c4f=_0x4cb50e||client;return _0x1e0c4f['request'](_0x227364,_0x2d4109)[_0x10b1('0x1e')](function(_0x1629d3){logger['info'](_0x10b1('0x1f'),_0xffa3ba,_0x10b1('0x20'));logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0xffa3ba,'request\x20sent',JSON[_0x10b1('0x21')](_0x1629d3));if(_0x1629d3[_0x10b1('0x22')]){if(_0x1629d3[_0x10b1('0x22')][_0x10b1('0x23')]===0x1f4){logger[_0x10b1('0x22')](_0x10b1('0x1f'),_0xffa3ba,_0x1629d3[_0x10b1('0x22')]['message']);return _0x44c56a(_0x1629d3[_0x10b1('0x22')]['message']);}logger[_0x10b1('0x22')]('FaxMessage,\x20%s,\x20%s',_0xffa3ba,_0x1629d3[_0x10b1('0x22')]['message']);return _0x33343c(_0x1629d3[_0x10b1('0x22')][_0x10b1('0x24')]);}else{logger[_0x10b1('0x25')](_0x10b1('0x1f'),_0xffa3ba,'request\x20sent');_0x33343c(_0x1629d3[_0x10b1('0x26')][_0x10b1('0x24')]);}})[_0x10b1('0x27')](function(_0x4b0fc9){logger[_0x10b1('0x22')](_0x10b1('0x1f'),_0xffa3ba,_0x4b0fc9);_0x44c56a(_0x4b0fc9);});});}function respondWithStatusCode(_0x3b00e2,_0x3963bd){_0x3963bd=_0x3963bd||0xcc;return function(_0xc56c7e){if(_0xc56c7e){return _0x3b00e2[_0x10b1('0x28')](_0x3963bd);}return _0x3b00e2[_0x10b1('0x29')](_0x3963bd)['end']();};}function respondWithResult(_0x2c3366,_0x187caf){_0x187caf=_0x187caf||0xc8;return function(_0x3dcd89){if(_0x3dcd89){return _0x2c3366[_0x10b1('0x29')](_0x187caf)[_0x10b1('0x2a')](_0x3dcd89);}};}function respondWithFilteredResult(_0x5bfcbc,_0x975b15){return function(_0x17cb07){if(_0x17cb07){var _0x3daebf=typeof _0x975b15['offset']==='undefined'&&typeof _0x975b15[_0x10b1('0x2b')]==='undefined';var _0x3c60c3=_0x17cb07[_0x10b1('0x2c')];var _0x414a62=_0x3daebf?0x0:_0x975b15[_0x10b1('0x2d')];var _0x2e315f=_0x3daebf?_0x17cb07['count']:_0x975b15[_0x10b1('0x2d')]+_0x975b15[_0x10b1('0x2b')];var _0x5133a6;if(_0x2e315f>=_0x3c60c3){_0x2e315f=_0x3c60c3;_0x5133a6=0xc8;}else{_0x5133a6=0xce;}_0x5bfcbc[_0x10b1('0x29')](_0x5133a6);return _0x5bfcbc[_0x10b1('0x2e')]('Content-Range',_0x414a62+'-'+_0x2e315f+'/'+_0x3c60c3)[_0x10b1('0x2a')](_0x17cb07);}return null;};}function patchUpdates(_0x22ae03){return function(_0x36b13a){try{jsonpatch[_0x10b1('0x2f')](_0x36b13a,_0x22ae03,!![]);}catch(_0x544926){return BPromise['reject'](_0x544926);}return _0x36b13a['save']();};}function saveUpdates(_0x16d6e7,_0x22ec6e){return function(_0x22fef3){if(_0x22fef3){return _0x22fef3['update'](_0x16d6e7)['then'](function(_0x2b5ced){return _0x2b5ced;});}return null;};}function removeEntity(_0x29751d,_0x25df89){return function(_0x1abcdb){if(_0x1abcdb){return _0x1abcdb[_0x10b1('0x30')]()[_0x10b1('0x1e')](function(){_0x29751d[_0x10b1('0x29')](0xcc)[_0x10b1('0x31')]();});}};}function handleEntityNotFound(_0xda042c,_0x3c9a5f){return function(_0x42d28e){if(!_0x42d28e){_0xda042c[_0x10b1('0x28')](0x194);}return _0x42d28e;};}function handleError(_0x2972bd,_0x580337){_0x580337=_0x580337||0x1f4;return function(_0x41021f){logger['error'](_0x41021f[_0x10b1('0x32')]);if(_0x41021f[_0x10b1('0x33')]){delete _0x41021f[_0x10b1('0x33')];}_0x2972bd[_0x10b1('0x29')](_0x580337)[_0x10b1('0x34')](_0x41021f);};}exports[_0x10b1('0x35')]=function(_0x184ecb,_0x18fd56){var _0x22427f={},_0x382e82={},_0x54de4e={'count':0x0,'rows':[]};var _0x200894=_[_0x10b1('0x36')](db['FaxMessage'][_0x10b1('0x37')],function(_0x5c1c7c){return{'name':_0x5c1c7c[_0x10b1('0x38')],'type':_0x5c1c7c[_0x10b1('0x39')][_0x10b1('0x3a')]};});_0x382e82['model']=_[_0x10b1('0x36')](_0x200894,'name');_0x382e82[_0x10b1('0x3b')]=_[_0x10b1('0x3c')](_0x184ecb[_0x10b1('0x3b')]);_0x382e82['filters']=_['intersection'](_0x382e82['model'],_0x382e82[_0x10b1('0x3b')]);_0x22427f[_0x10b1('0x3d')]=_[_0x10b1('0x3e')](_0x382e82[_0x10b1('0x3f')],qs['fields'](_0x184ecb['query'][_0x10b1('0x40')]));_0x22427f[_0x10b1('0x3d')]=_0x22427f[_0x10b1('0x3d')][_0x10b1('0x41')]?_0x22427f['attributes']:_0x382e82[_0x10b1('0x3f')];if(!_0x184ecb[_0x10b1('0x3b')][_0x10b1('0x42')](_0x10b1('0x43'))){_0x22427f['limit']=qs[_0x10b1('0x2b')](_0x184ecb[_0x10b1('0x3b')][_0x10b1('0x2b')]);_0x22427f[_0x10b1('0x2d')]=qs[_0x10b1('0x2d')](_0x184ecb['query'][_0x10b1('0x2d')]);}_0x22427f[_0x10b1('0x44')]=qs[_0x10b1('0x45')](_0x184ecb[_0x10b1('0x3b')][_0x10b1('0x45')]);_0x22427f[_0x10b1('0x46')]=qs[_0x10b1('0x47')](_[_0x10b1('0x48')](_0x184ecb[_0x10b1('0x3b')],_0x382e82['filters']),_0x200894);if(_0x184ecb[_0x10b1('0x3b')][_0x10b1('0x49')]){_0x22427f[_0x10b1('0x46')]=_['merge'](_0x22427f[_0x10b1('0x46')],{'$or':_[_0x10b1('0x36')](_0x200894,function(_0x3ec64f){if(_0x3ec64f[_0x10b1('0x39')]!==_0x10b1('0x4a')){var _0x2a451c={};_0x2a451c[_0x3ec64f[_0x10b1('0x33')]]={'$like':'%'+_0x184ecb[_0x10b1('0x3b')][_0x10b1('0x49')]+'%'};return _0x2a451c;}})});}_0x22427f=_['merge']({},_0x22427f,_0x184ecb[_0x10b1('0x4b')]);var _0x4cb4c7={'where':_0x22427f[_0x10b1('0x46')]};return db[_0x10b1('0x4c')]['count'](_0x4cb4c7)['then'](function(_0x5d716d){_0x54de4e['count']=_0x5d716d;if(_0x184ecb[_0x10b1('0x3b')]['includeAll']){_0x22427f['include']=[{'all':!![]}];}return db[_0x10b1('0x4c')][_0x10b1('0x4d')](_0x22427f);})['then'](function(_0x520689){_0x54de4e['rows']=_0x520689;return _0x54de4e;})[_0x10b1('0x1e')](respondWithFilteredResult(_0x18fd56,_0x22427f))[_0x10b1('0x27')](handleError(_0x18fd56,null));};exports[_0x10b1('0x4e')]=function(_0xbf20b5,_0x3fa59e){var _0x8f2dcb={'raw':!![],'where':{'id':_0xbf20b5[_0x10b1('0x4f')]['id']}},_0x281cf0={};_0x281cf0['model']=_['keys'](db[_0x10b1('0x4c')][_0x10b1('0x37')]);_0x281cf0[_0x10b1('0x3b')]=_[_0x10b1('0x3c')](_0xbf20b5['query']);_0x281cf0[_0x10b1('0x47')]=_[_0x10b1('0x3e')](_0x281cf0[_0x10b1('0x3f')],_0x281cf0[_0x10b1('0x3b')]);_0x8f2dcb[_0x10b1('0x3d')]=_[_0x10b1('0x3e')](_0x281cf0[_0x10b1('0x3f')],qs[_0x10b1('0x40')](_0xbf20b5['query'][_0x10b1('0x40')]));_0x8f2dcb[_0x10b1('0x3d')]=_0x8f2dcb[_0x10b1('0x3d')][_0x10b1('0x41')]?_0x8f2dcb['attributes']:_0x281cf0[_0x10b1('0x3f')];if(_0xbf20b5[_0x10b1('0x3b')][_0x10b1('0x50')]){_0x8f2dcb[_0x10b1('0x51')]=[{'all':!![]}];}_0x8f2dcb=_['merge']({},_0x8f2dcb,_0xbf20b5['options']);return db[_0x10b1('0x4c')]['find'](_0x8f2dcb)[_0x10b1('0x1e')](handleEntityNotFound(_0x3fa59e,null))[_0x10b1('0x1e')](respondWithResult(_0x3fa59e,null))[_0x10b1('0x27')](handleError(_0x3fa59e,null));};exports[_0x10b1('0x52')]=function(_0x36f248,_0x284934){if(_0x36f248[_0x10b1('0x53')]['id']){delete _0x36f248['body']['id'];}return db[_0x10b1('0x4c')]['find']({'where':{'id':_0x36f248[_0x10b1('0x4f')]['id']}})[_0x10b1('0x1e')](handleEntityNotFound(_0x284934,null))[_0x10b1('0x1e')](saveUpdates(_0x36f248[_0x10b1('0x53')],null))[_0x10b1('0x1e')](respondWithResult(_0x284934,null))[_0x10b1('0x27')](handleError(_0x284934,null));};exports[_0x10b1('0x30')]=function(_0x44f348,_0x2559ce){return db[_0x10b1('0x4c')][_0x10b1('0x54')]({'where':{'id':_0x44f348[_0x10b1('0x4f')]['id']}})[_0x10b1('0x1e')](handleEntityNotFound(_0x2559ce,null))[_0x10b1('0x1e')](removeEntity(_0x2559ce,null))[_0x10b1('0x27')](handleError(_0x2559ce,null));};exports[_0x10b1('0x55')]=function(_0x54af99,_0x237f04){return db[_0x10b1('0x4c')]['describe']()['then'](respondWithResult(_0x237f04,null))[_0x10b1('0x27')](handleError(_0x237f04,null));};var interaction_log=require('../../config/logger')(_0x10b1('0x56'));exports['accept']=function(_0x6ccb1a,_0x468cf7,_0x426529){var _0x500706={'agent':{},'channel':_0x10b1('0x57')};if(_0x6ccb1a[_0x10b1('0x53')]['id']){delete _0x6ccb1a['body']['id'];}_0x6ccb1a[_0x10b1('0x53')][_0x10b1('0x58')]=!![];_0x6ccb1a[_0x10b1('0x53')][_0x10b1('0x59')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x6ccb1a[_0x10b1('0x53')][_0x10b1('0x5a')]=_0x6ccb1a['body'][_0x10b1('0x5a')]||_0x6ccb1a['user']['id'];_0x500706['agent']['id']=_0x6ccb1a[_0x10b1('0x53')][_0x10b1('0x5a')];return db[_0x10b1('0x4c')]['find']({'where':{'id':_0x6ccb1a['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x468cf7,null))[_0x10b1('0x1e')](saveUpdates(_0x6ccb1a[_0x10b1('0x53')],null))[_0x10b1('0x1e')](function(_0x2e597a){if(_0x2e597a){_0x500706[_0x10b1('0x24')]=_0x2e597a['get']({'plain':!![]});return db[_0x10b1('0x5b')][_0x10b1('0x54')]({'where':{'id':_0x2e597a['FaxInteractionId']}});}return null;})[_0x10b1('0x1e')](handleEntityNotFound(_0x468cf7,null))['then'](function(_0x2b4c33){if(_0x2b4c33){return _0x2b4c33[_0x10b1('0x52')]({'UserId':_0x6ccb1a['body'][_0x10b1('0x5a')],'read1stAt':_[_0x10b1('0x5c')](_0x2b4c33[_0x10b1('0x5d')])?moment()[_0x10b1('0x5e')](_0x10b1('0x5f')):undefined});}return null;})[_0x10b1('0x1e')](function(_0x53f5b4){if(_0x53f5b4){_0x500706[_0x10b1('0x60')]=_0x53f5b4[_0x10b1('0x61')]({'plain':!![]});interaction_log[_0x10b1('0x25')](_0x10b1('0x62'),_0x6ccb1a[_0x10b1('0x63')]['id'],_0x6ccb1a[_0x10b1('0x63')][_0x10b1('0x33')],_0x6ccb1a['user']['role'],_0x500706['interaction']['id'],_0x6ccb1a[_0x10b1('0x53')]?JSON[_0x10b1('0x21')](_0x6ccb1a[_0x10b1('0x53')]):_0x10b1('0x64'));return respondWithRpcPromise(_0x10b1('0x65'),_0x10b1('0x66'),_0x500706);}return null;})[_0x10b1('0x1e')](function(_0x753f22){var _0x4a073c=_0x10b1('0x67')+_0x753f22['message']['ContactId'];return db['sequelize']['query'](_0x4a073c,{'type':db['Sequelize'][_0x10b1('0x68')]['SELECT'],'raw':!![]})[_0x10b1('0x1e')](function(_0x10e662){return _0x10e662;});})['then'](function(_0x178e83){if(_0x178e83){_0x500706['message'][_0x10b1('0x69')]=_0x178e83[0x0];if(!_0x6ccb1a['body'][_0x10b1('0x5a')])return;return db[_0x10b1('0x6a')][_0x10b1('0x54')]({'where':{'id':_0x6ccb1a[_0x10b1('0x53')]['UserId'],'role':_0x10b1('0x6b')},'attributes':['id',_0x10b1('0x33'),'fullname',_0x10b1('0x6c'),_0x10b1('0x6d')],'raw':!![]});}return null;})['then'](function(_0x4c71d6){if(!_0x4c71d6)return null;_0x500706[_0x10b1('0x24')][_0x10b1('0x6b')]=_0x4c71d6;return _0x500706;})[_0x10b1('0x1e')](function(_0x29aee9){if(_0x29aee9){if(_0x6ccb1a[_0x10b1('0x53')][_0x10b1('0x6e')]){_0x500706[_0x10b1('0x24')][_0x10b1('0x6f')]=util['format']('SIP/%s',_0x6ccb1a[_0x10b1('0x63')][_0x10b1('0x33')]);_0x500706[_0x10b1('0x24')][_0x10b1('0x70')]=_0x500706[_0x10b1('0x70')];_0x500706[_0x10b1('0x24')][_0x10b1('0x71')]=_0x10b1('0x72');return respondWithRpcPromise(_0x10b1('0x73'),_0x10b1('0x73'),{'event':_0x10b1('0x74'),'message':_0x500706['message']},client9002)[_0x10b1('0x1e')](function(){return _0x500706;});}return _0x500706;}return null;})[_0x10b1('0x1e')](respondWithResult(_0x468cf7,null))['catch'](handleError(_0x468cf7,null));};var interaction_log=require(_0x10b1('0x75'))(_0x10b1('0x56'));exports['reject']=function(_0x569ce0,_0x7b2a6f,_0x63319e){var _0x53300b={'agent':{},'channel':'fax'};if(_0x569ce0[_0x10b1('0x53')]['id']){delete _0x569ce0[_0x10b1('0x53')]['id'];}_0x569ce0[_0x10b1('0x53')][_0x10b1('0x5a')]=_0x569ce0[_0x10b1('0x53')][_0x10b1('0x5a')]||_0x569ce0[_0x10b1('0x63')]['id'];_0x53300b[_0x10b1('0x6b')]['id']=_0x569ce0[_0x10b1('0x53')][_0x10b1('0x5a')];return db[_0x10b1('0x4c')][_0x10b1('0x54')]({'where':{'id':_0x569ce0[_0x10b1('0x4f')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x7b2a6f,null))[_0x10b1('0x1e')](function(_0x4716f4){if(_0x4716f4){_0x53300b[_0x10b1('0x24')]=_0x4716f4[_0x10b1('0x61')]({'plain':!![]});return db['FaxInteraction'][_0x10b1('0x54')]({'where':{'id':_0x4716f4['FaxInteractionId']}});}return null;})[_0x10b1('0x1e')](handleEntityNotFound(_0x7b2a6f,null))[_0x10b1('0x1e')](function(_0x2de13f){if(_0x2de13f){_0x53300b[_0x10b1('0x60')]=_0x2de13f[_0x10b1('0x61')]({'plain':!![]});interaction_log[_0x10b1('0x25')](_0x10b1('0x76'),_0x569ce0['user']['id'],_0x569ce0[_0x10b1('0x63')]['name'],_0x569ce0['user'][_0x10b1('0x77')],_0x53300b[_0x10b1('0x60')]['id'],_0x569ce0[_0x10b1('0x53')]?JSON[_0x10b1('0x21')](_0x569ce0['body']):'null');return respondWithRpcPromise(_0x10b1('0x78'),_0x10b1('0x79'),_0x53300b);}return null;})[_0x10b1('0x1e')](function(_0x154c11){var _0x1fdcc2=_0x10b1('0x67')+_0x154c11[_0x10b1('0x24')][_0x10b1('0x7a')];return db[_0x10b1('0x7b')][_0x10b1('0x3b')](_0x1fdcc2,{'type':db[_0x10b1('0x7c')][_0x10b1('0x68')]['SELECT'],'raw':!![]})[_0x10b1('0x1e')](function(_0x2458de){return _0x2458de;});})['then'](function(_0x2e602a){if(_0x2e602a){_0x53300b[_0x10b1('0x24')][_0x10b1('0x69')]=_0x2e602a[0x0];if(!_0x569ce0['body'][_0x10b1('0x5a')])return;return db[_0x10b1('0x6a')]['find']({'where':{'id':_0x569ce0[_0x10b1('0x53')][_0x10b1('0x5a')],'role':'agent'},'attributes':['id',_0x10b1('0x33'),_0x10b1('0x7d'),'email',_0x10b1('0x6d')],'raw':!![]});}return null;})[_0x10b1('0x1e')](function(_0x378740){if(!_0x378740)return null;_0x53300b[_0x10b1('0x24')]['agent']=_0x378740;return _0x53300b;})['then'](function(_0x49e893){if(_0x49e893){_0x49e893[_0x10b1('0x24')]['interface']=util[_0x10b1('0x5e')](_0x10b1('0x7e'),_0x569ce0[_0x10b1('0x63')][_0x10b1('0x33')]);_0x49e893[_0x10b1('0x24')]['channel']=_0x53300b['channel'];_0x49e893[_0x10b1('0x24')]['event']=_0x10b1('0x7f');respondWithRpcPromise(_0x10b1('0x73'),'EventManager',{'event':_0x10b1('0x80'),'message':_0x49e893['message']},client9002);return _0x53300b;}return null;})[_0x10b1('0x1e')](respondWithResult(_0x7b2a6f,null))['catch'](handleError(_0x7b2a6f,null));};exports['create']=function(_0x4c1541,_0x54069f){var _0x236fb0;return db[_0x10b1('0x4c')][_0x10b1('0x81')](_0x4c1541[_0x10b1('0x53')],{})[_0x10b1('0x1e')](function(_0x48a4a2){_0x236fb0=_0x48a4a2;return db[_0x10b1('0x82')][_0x10b1('0x83')]({'where':{'id':_0x236fb0[_0x10b1('0x7a')]}});})[_0x10b1('0x1e')](function(_0x304bc2){if(_['isNil'](_0x304bc2)){return;}else{_0x236fb0['fax']=_0x304bc2[_0x10b1('0x57')];return db[_0x10b1('0x84')]['findOne']({'where':{'id':_0x236fb0[_0x10b1('0x85')]}});}})[_0x10b1('0x1e')](function(_0x15bd64){return respondWithRpcPromise(_0x10b1('0x86'),_0x10b1('0x86'),{'FaxAccountId':_[_0x10b1('0x5c')](_0x4c1541['body'])?undefined:_0x4c1541[_0x10b1('0x53')][_0x10b1('0x87')],'path':_[_0x10b1('0x5c')](_0x15bd64)?undefined:util[_0x10b1('0x5e')](_0x10b1('0x88'),_0x15bd64[_0x10b1('0x89')]),'fax':_[_0x10b1('0x5c')](_0x236fb0[_0x10b1('0x57')])?undefined:_0x236fb0[_0x10b1('0x57')],'AttachmentId':_0x236fb0[_0x10b1('0x85')]},client9002);})[_0x10b1('0x1e')](respondWithResult(_0x54069f,0xc9))[_0x10b1('0x27')](handleError(_0x54069f,null));};exports[_0x10b1('0x8a')]=function(_0x489495,_0x1b057a){var _0x19671a=path['join'](config['root'],_0x10b1('0x8b'),_0x10b1('0x8c'),'attachments');return db[_0x10b1('0x4c')][_0x10b1('0x54')]({'where':{'id':_0x489495[_0x10b1('0x4f')]['id']},'include':[{'model':db[_0x10b1('0x84')],'as':_0x10b1('0x84')}]})[_0x10b1('0x1e')](handleEntityNotFound(_0x1b057a,null))[_0x10b1('0x1e')](function(_0x301a87){if(_0x301a87){return _0x1b057a['download'](path[_0x10b1('0x8d')](_0x19671a,_0x301a87[_0x10b1('0x84')][_0x10b1('0x89')]));}})[_0x10b1('0x27')](handleError(_0x1b057a,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index dd3f6fa..5adb37b 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 _0x292c=['hook','exports','events','FaxMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x29183b,_0x8296f3){var _0x3cdbbf=function(_0x5d3909){while(--_0x5d3909){_0x29183b['push'](_0x29183b['shift']());}};_0x3cdbbf(++_0x8296f3);}(_0x292c,0x66));var _0xc292=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0x292c[_0x4e1d03];return _0x362d4b;};'use strict';var EventEmitter=require(_0xc292('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0xc292('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xc292('0x2')](0x0);var events={'afterCreate':_0xc292('0x3'),'afterUpdate':_0xc292('0x4'),'afterDestroy':_0xc292('0x5')};function emitEvent(_0x50b478){return function(_0x1f14f9,_0x536154,_0x516f54){FaxMessageEvents[_0xc292('0x6')](_0x50b478+':'+_0x1f14f9['id'],_0x1f14f9);FaxMessageEvents[_0xc292('0x6')](_0x50b478,_0x1f14f9);_0x516f54(null);};}for(var e in events){if(events[_0xc292('0x7')](e)){var event=events[e];FaxMessage[_0xc292('0x8')](e,emitEvent(event));}}module[_0xc292('0x9')]=FaxMessageEvents; \ No newline at end of file +var _0x00e0=['emit','hook','exports','events','../../mysqldb','FaxMessage','save','remove'];(function(_0x6a9b04,_0x23c98c){var _0x1e2b26=function(_0x5277ca){while(--_0x5277ca){_0x6a9b04['push'](_0x6a9b04['shift']());}};_0x1e2b26(++_0x23c98c);}(_0x00e0,0x1e3));var _0x000e=function(_0x118815,_0x1dbafe){_0x118815=_0x118815-0x0;var _0x1f59b8=_0x00e0[_0x118815];return _0x1f59b8;};'use strict';var EventEmitter=require(_0x000e('0x0'));var FaxMessage=require(_0x000e('0x1'))['db'][_0x000e('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x000e('0x3'),'afterUpdate':'update','afterDestroy':_0x000e('0x4')};function emitEvent(_0x54d3ca){return function(_0x556ee0,_0x54a9c2,_0x5316d9){FaxMessageEvents[_0x000e('0x5')](_0x54d3ca+':'+_0x556ee0['id'],_0x556ee0);FaxMessageEvents[_0x000e('0x5')](_0x54d3ca,_0x556ee0);_0x5316d9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0x000e('0x6')](e,emitEvent(event));}}module[_0x000e('0x7')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 31ab81f..4bc9102 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 _0x670e=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxMessage.attributes','exports','define','fax_messages','fti_fax_messages','body','FULLTEXT','models','get','direction','out','secret','isNil','UserId','findOne','FaxInteractionId','then','update','toLowerCase','catch','utf8mb4','utf8mb4_unicode_ci'];(function(_0x15f125,_0x2f759d){var _0x27da70=function(_0x5eac57){while(--_0x5eac57){_0x15f125['push'](_0x15f125['shift']());}};_0x27da70(++_0x2f759d);}(_0x670e,0x174));var _0xe670=function(_0x2ffac0,_0x19e68d){_0x2ffac0=_0x2ffac0-0x0;var _0x2beda9=_0x670e[_0x2ffac0];return _0x2beda9;};'use strict';var _=require(_0xe670('0x0'));var util=require(_0xe670('0x1'));var logger=require(_0xe670('0x2'))(_0xe670('0x3'));var moment=require(_0xe670('0x4'));var BPromise=require(_0xe670('0x5'));var rp=require(_0xe670('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe670('0x7'));var config=require(_0xe670('0x8'));var attributes=require(_0xe670('0x9'));module[_0xe670('0xa')]=function(_0x5d078e,_0xfa8eb7){return _0x5d078e[_0xe670('0xb')]('FaxMessage',attributes,{'tableName':_0xe670('0xc'),'paranoid':![],'indexes':[{'name':_0xe670('0xd'),'fields':[_0xe670('0xe')],'type':_0xe670('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1fd14a,_0x390228,_0x2c97ea){var _0x1bf8dd=_0x5d078e[_0xe670('0x10')];var _0x50504b=_0x1fd14a[_0xe670('0x11')]({'plain':!![]});if(_0x50504b[_0xe670('0x12')]['toLowerCase']()==='in'||_0x50504b[_0xe670('0x12')]['toLowerCase']()===_0xe670('0x13')&&!_0x50504b[_0xe670('0x14')]&&!_[_0xe670('0x15')](_0x50504b[_0xe670('0x16')])){_0x1bf8dd['FaxInteraction'][_0xe670('0x17')]({'where':{'id':_0x50504b[_0xe670('0x18')]}})[_0xe670('0x19')](function(_0x544020){if(_0x544020){_0x544020[_0xe670('0x1a')]({'lastMsgAt':_0x50504b['createdAt'],'lastMsgDirection':_0x50504b[_0xe670('0x12')][_0xe670('0x1b')]()});}})[_0xe670('0x1c')](function(_0xffb54a){console['error'](_0xffb54a);});}_0x2c97ea();}},'charset':_0xe670('0x1d'),'collate':_0xe670('0x1e')});}; \ No newline at end of file +var _0x47f4=['request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','define','FaxMessage','fax_messages','body','FULLTEXT','models','direction','toLowerCase','out','isNil','UserId','FaxInteraction','findOne','createdAt','catch','lodash','util','api','moment','bluebird'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x47f4,0x91));var _0x447f=function(_0x17b8f3,_0x1aab6a){_0x17b8f3=_0x17b8f3-0x0;var _0x509cc8=_0x47f4[_0x17b8f3];return _0x509cc8;};'use strict';var _=require(_0x447f('0x0'));var util=require(_0x447f('0x1'));var logger=require('../../config/logger')(_0x447f('0x2'));var moment=require(_0x447f('0x3'));var BPromise=require(_0x447f('0x4'));var rp=require(_0x447f('0x5'));var fs=require('fs');var path=require(_0x447f('0x6'));var rimraf=require(_0x447f('0x7'));var config=require(_0x447f('0x8'));var attributes=require(_0x447f('0x9'));module['exports']=function(_0x4c9add,_0x55dab6){return _0x4c9add[_0x447f('0xa')](_0x447f('0xb'),attributes,{'tableName':_0x447f('0xc'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x447f('0xd')],'type':_0x447f('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x6c32ce,_0x1e9fe4,_0x215d99){var _0x37741c=_0x4c9add[_0x447f('0xf')];var _0xac9c70=_0x6c32ce['get']({'plain':!![]});if(_0xac9c70[_0x447f('0x10')][_0x447f('0x11')]()==='in'||_0xac9c70[_0x447f('0x10')][_0x447f('0x11')]()===_0x447f('0x12')&&!_0xac9c70['secret']&&!_[_0x447f('0x13')](_0xac9c70[_0x447f('0x14')])){_0x37741c[_0x447f('0x15')][_0x447f('0x16')]({'where':{'id':_0xac9c70['FaxInteractionId']}})['then'](function(_0x46378e){if(_0x46378e){_0x46378e['update']({'lastMsgAt':_0xac9c70[_0x447f('0x17')],'lastMsgDirection':_0xac9c70[_0x447f('0x10')][_0x447f('0x11')]()});}})[_0x447f('0x18')](function(_0x227900){console['error'](_0x227900);});}_0x215d99();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index fdb2f1f..6a93287 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 _0x5fd1=['debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateFaxMessage','FaxMessage','create','body','raw','catch','UpdateFaxMessage','options','where','attributes','limit','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5fd1,0x155));var _0x15fd=function(_0x3682ad,_0x3d954f){_0x3682ad=_0x3682ad-0x0;var _0x212ff3=_0x5fd1[_0x3682ad];return _0x212ff3;};'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});config[_0x15fd('0xa')]=_[_0x15fd('0xb')](config['redis'],{'host':_0x15fd('0xc'),'port':0x18eb});var socket=require(_0x15fd('0xd'))(new Redis(config[_0x15fd('0xa')]));require('./faxMessage.socket')[_0x15fd('0xe')](socket);function respondWithRpcPromise(_0x5c9c63,_0x3dfdbb,_0x250457){return new BPromise(function(_0x4c226a,_0x4883fd){return client['request'](_0x5c9c63,_0x250457)[_0x15fd('0xf')](function(_0x2a4d55){logger[_0x15fd('0x10')](_0x15fd('0x11'),_0x3dfdbb,_0x15fd('0x12'));logger[_0x15fd('0x13')](_0x15fd('0x14'),_0x3dfdbb,_0x15fd('0x12'),JSON[_0x15fd('0x15')](_0x2a4d55));if(_0x2a4d55['error']){if(_0x2a4d55['error']['code']===0x1f4){logger[_0x15fd('0x16')](_0x15fd('0x11'),_0x3dfdbb,_0x2a4d55[_0x15fd('0x16')][_0x15fd('0x17')]);return _0x4883fd(_0x2a4d55[_0x15fd('0x16')][_0x15fd('0x17')]);}logger[_0x15fd('0x16')](_0x15fd('0x11'),_0x3dfdbb,_0x2a4d55['error']['message']);return _0x4c226a(_0x2a4d55[_0x15fd('0x16')]['message']);}else{logger[_0x15fd('0x10')]('FaxMessage,\x20%s,\x20%s',_0x3dfdbb,_0x15fd('0x12'));_0x4c226a(_0x2a4d55[_0x15fd('0x18')][_0x15fd('0x17')]);}})['catch'](function(_0x367c36){logger[_0x15fd('0x16')](_0x15fd('0x11'),_0x3dfdbb,_0x367c36);_0x4883fd(_0x367c36);});});}exports[_0x15fd('0x19')]=function(_0x2fb919){var _0x36a90e=this;return new Promise(function(_0x3761db,_0x2f46f1){return db[_0x15fd('0x1a')][_0x15fd('0x1b')](_0x2fb919[_0x15fd('0x1c')],{'raw':_0x2fb919['options']?_0x2fb919['options'][_0x15fd('0x1d')]===undefined?!![]:![]:!![]})[_0x15fd('0xf')](function(_0x252a1c){logger[_0x15fd('0x10')](_0x15fd('0x19'),_0x2fb919);logger[_0x15fd('0x13')](_0x15fd('0x19'),_0x2fb919,JSON['stringify'](_0x252a1c));_0x3761db(_0x252a1c);})[_0x15fd('0x1e')](function(_0x2d19ac){logger[_0x15fd('0x16')]('CreateFaxMessage',_0x2d19ac[_0x15fd('0x17')],_0x2fb919);_0x2f46f1(_0x36a90e['error'](0x1f4,_0x2d19ac[_0x15fd('0x17')]));});});};exports[_0x15fd('0x1f')]=function(_0x21601d){var _0x4c9708=this;return new Promise(function(_0x16b87c,_0x1cbf2c){return db[_0x15fd('0x1a')]['update'](_0x21601d[_0x15fd('0x1c')],{'raw':_0x21601d['options']?_0x21601d[_0x15fd('0x20')][_0x15fd('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21601d[_0x15fd('0x20')]?_0x21601d[_0x15fd('0x20')][_0x15fd('0x21')]||null:null,'attributes':_0x21601d[_0x15fd('0x20')]?_0x21601d[_0x15fd('0x20')][_0x15fd('0x22')]||null:null,'limit':_0x21601d[_0x15fd('0x20')]?_0x21601d[_0x15fd('0x20')][_0x15fd('0x23')]||null:null})['then'](function(_0x47c22c){logger[_0x15fd('0x10')]('UpdateFaxMessage',_0x21601d);logger[_0x15fd('0x13')](_0x15fd('0x1f'),_0x21601d,JSON['stringify'](_0x47c22c));_0x16b87c(_0x47c22c);})[_0x15fd('0x1e')](function(_0x197d15){logger['error'](_0x15fd('0x1f'),_0x197d15[_0x15fd('0x17')],_0x21601d);_0x1cbf2c(_0x4c9708[_0x15fd('0x16')](0x1f4,_0x197d15[_0x15fd('0x17')]));});});}; \ No newline at end of file +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(_0x3f8282,_0x11b607){var _0x50f918=function(_0x3a37de){while(--_0x3a37de){_0x3f8282['push'](_0x3f8282['shift']());}};_0x50f918(++_0x11b607);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x5e72dc,_0xa12f95){_0x5e72dc=_0x5e72dc-0x0;var _0x197a74=_0xd0bb[_0x5e72dc];return _0x197a74;};'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 diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 99a53a9..a9ffd9b 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 _0xc2a9=['faxMessage:','save','emit','removeListener','length'];(function(_0x13b35d,_0x3ae11c){var _0x321790=function(_0x642c10){while(--_0x642c10){_0x13b35d['push'](_0x13b35d['shift']());}};_0x321790(++_0x3ae11c);}(_0xc2a9,0xe2));var _0x9c2a=function(_0x331400,_0x1db9fa){_0x331400=_0x331400-0x0;var _0x2c3c19=_0xc2a9[_0x331400];return _0x2c3c19;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0x9c2a('0x0'),'remove','update'];function createListener(_0x5e05b1,_0xacf9f){return function(_0x587e41){_0xacf9f[_0x9c2a('0x1')](_0x5e05b1,_0x587e41);};}function removeListener(_0x58ecf7,_0x2dbeb4){return function(){FaxMessageEvents[_0x9c2a('0x2')](_0x58ecf7,_0x2dbeb4);};}exports['register']=function(_0xa56676){for(var _0x4e9ef4=0x0,_0x1ee478=events[_0x9c2a('0x3')];_0x4e9ef4<_0x1ee478;_0x4e9ef4++){var _0x8d1fee=events[_0x4e9ef4];var _0x107523=createListener(_0x9c2a('0x4')+_0x8d1fee,_0xa56676);FaxMessageEvents['on'](_0x8d1fee,_0x107523);}}; \ No newline at end of file +var _0x4738=['length','./faxMessage.events','save','remove','emit','removeListener'];(function(_0x18943e,_0xabd276){var _0x28f90f=function(_0xd32d76){while(--_0xd32d76){_0x18943e['push'](_0x18943e['shift']());}};_0x28f90f(++_0xabd276);}(_0x4738,0xa9));var _0x8473=function(_0x3a53b7,_0x9042ac){_0x3a53b7=_0x3a53b7-0x0;var _0x21ad09=_0x4738[_0x3a53b7];return _0x21ad09;};'use strict';var FaxMessageEvents=require(_0x8473('0x0'));var events=[_0x8473('0x1'),_0x8473('0x2'),'update'];function createListener(_0x1545c3,_0x31e187){return function(_0x276b72){_0x31e187[_0x8473('0x3')](_0x1545c3,_0x276b72);};}function removeListener(_0x2269a6,_0x1044b2){return function(){FaxMessageEvents[_0x8473('0x4')](_0x2269a6,_0x1044b2);};}exports['register']=function(_0x584a07){for(var _0x27e523=0x0,_0x33d762=events[_0x8473('0x5')];_0x27e523<_0x33d762;_0x27e523++){var _0x2f5808=events[_0x27e523];var _0x367d33=createListener('faxMessage:'+_0x2f5808,_0x584a07);FaxMessageEvents['on'](_0x2f5808,_0x367d33);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 42d433f..d7e0ed2 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 _0xa5fa=['accept','/:id/reject','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','download','tracked','faxmessage:create','create','put'];(function(_0x16bfe3,_0x359e77){var _0x19de7b=function(_0x1a630e){while(--_0x1a630e){_0x16bfe3['push'](_0x16bfe3['shift']());}};_0x19de7b(++_0x359e77);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x4eaafe,_0x5d6567){_0x4eaafe=_0x4eaafe-0x0;var _0x4efb4e=_0xa5fa[_0x4eaafe];return _0x4efb4e;};'use strict';var multer=require('multer');var util=require(_0xaa5f('0x0'));var path=require(_0xaa5f('0x1'));var timeout=require(_0xaa5f('0x2'));var express=require(_0xaa5f('0x3'));var router=express['Router']();var fs_extra=require(_0xaa5f('0x4'));var auth=require(_0xaa5f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xaa5f('0x6'));var controller=require(_0xaa5f('0x7'));router[_0xaa5f('0x8')]('/',auth[_0xaa5f('0x9')](),controller[_0xaa5f('0xa')]);router[_0xaa5f('0x8')](_0xaa5f('0xb'),auth[_0xaa5f('0x9')](),controller[_0xaa5f('0xc')]);router[_0xaa5f('0x8')](_0xaa5f('0xd'),auth['isAuthenticated'](),controller[_0xaa5f('0xe')]);router[_0xaa5f('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0xaa5f('0xf')]);router['post']('/',auth['isAuthenticated'](),interaction[_0xaa5f('0x10')]('fax',_0xaa5f('0x11')),controller[_0xaa5f('0x12')]);router[_0xaa5f('0x13')](_0xaa5f('0xd'),auth[_0xaa5f('0x9')](),controller['update']);router[_0xaa5f('0x13')]('/:id/accept',auth[_0xaa5f('0x9')](),controller[_0xaa5f('0x14')]);router[_0xaa5f('0x13')](_0xaa5f('0x15'),auth[_0xaa5f('0x9')](),controller['reject']);router['delete'](_0xaa5f('0xd'),auth[_0xaa5f('0x9')](),controller[_0xaa5f('0x16')]);module[_0xaa5f('0x17')]=router; \ No newline at end of file +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(_0x4f9507,_0x291aa0){var _0x175959=function(_0x565d6e){while(--_0x565d6e){_0x4f9507['push'](_0x4f9507['shift']());}};_0x175959(++_0x291aa0);}(_0x4ded,0x116));var _0xd4de=function(_0x598e27,_0x2e11ef){_0x598e27=_0x598e27-0x0;var _0x159732=_0x4ded[_0x598e27];return _0x159732;};'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 2e1d9c2..dc26eb8 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 _0x9e69=['exports','STRING','name','ENUM','rrmemory','roundrobin','INTEGER'];(function(_0x3b781c,_0x511716){var _0x4073a7=function(_0x5b1259){while(--_0x5b1259){_0x3b781c['push'](_0x3b781c['shift']());}};_0x4073a7(++_0x511716);}(_0x9e69,0x150));var _0x99e6=function(_0x4f3e18,_0x135ef2){_0x4f3e18=_0x4f3e18-0x0;var _0x5b5094=_0x9e69[_0x4f3e18];return _0x5b5094;};'use strict';var Sequelize=require('sequelize');module[_0x99e6('0x0')]={'name':{'type':Sequelize[_0x99e6('0x1')],'unique':_0x99e6('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x99e6('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x99e6('0x3')](_0x99e6('0x4'),'beepall',_0x99e6('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x99e6('0x6')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe1c1=['beepall','roundrobin','INTEGER','sequelize','exports','STRING','ENUM','rrmemory'];(function(_0x189d2b,_0x2ca52d){var _0x2864a9=function(_0x237013){while(--_0x237013){_0x189d2b['push'](_0x189d2b['shift']());}};_0x2864a9(++_0x2ca52d);}(_0xe1c1,0x14b));var _0x1e1c=function(_0x5cbf0e,_0x4cd140){_0x5cbf0e=_0x5cbf0e-0x0;var _0x1c76f8=_0xe1c1[_0x5cbf0e];return _0x1c76f8;};'use strict';var Sequelize=require(_0x1e1c('0x0'));module[_0x1e1c('0x1')]={'name':{'type':Sequelize[_0x1e1c('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1e1c('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1e1c('0x3')](_0x1e1c('0x4'),_0x1e1c('0x5'),_0x1e1c('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x1e1c('0x7')],'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 c77487a..43220ef 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 _0x411c=['addAgents','spread','userFaxQueue:save','isArray','userFaxQueue:remove','getAgents','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','FaxQueues','destroy','error','name','index','map','FaxQueue','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','order','sort','where','pick','filter','include','findAll','catch','show','params','length','includeAll','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','UserProfileResource','describe','getMembers','findOne','UserFaxQueue','hasOwnProperty','nolimit','FaxQueueId','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','rows','SIP','getTeams','Team','addTeams','User','online','interface','flatMap','Agents','sequelize','transaction','each','forEach','emit','removeTeams','ids','tq.TeamId','from','team_has_fax_queues','user_has_teams','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','union','value','removeAgents'];(function(_0x4b9978,_0x58eb71){var _0x42f0e5=function(_0x4ff5dc){while(--_0x4ff5dc){_0x4b9978['push'](_0x4b9978['shift']());}};_0x42f0e5(++_0x58eb71);}(_0x411c,0x93));var _0xc411=function(_0x21628b,_0x522d9f){_0x21628b=_0x21628b-0x0;var _0x5e49a2=_0x411c[_0x21628b];return _0x5e49a2;};'use strict';var emlformat=require(_0xc411('0x0'));var rimraf=require(_0xc411('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc411('0x2'));var moment=require('moment');var BPromise=require(_0xc411('0x3'));var Mustache=require(_0xc411('0x4'));var util=require(_0xc411('0x5'));var path=require(_0xc411('0x6'));var sox=require(_0xc411('0x7'));var csv=require(_0xc411('0x8'));var ejs=require(_0xc411('0x9'));var fs=require('fs');var fs_extra=require(_0xc411('0xa'));var _=require(_0xc411('0xb'));var squel=require(_0xc411('0xc'));var crypto=require(_0xc411('0xd'));var jsforce=require(_0xc411('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc411('0x8'));var querystring=require(_0xc411('0xf'));var Papa=require(_0xc411('0x10'));var Redis=require(_0xc411('0x11'));var authService=require(_0xc411('0x12'));var qs=require(_0xc411('0x13'));var as=require(_0xc411('0x14'));var hardwareService=require(_0xc411('0x15'));var logger=require(_0xc411('0x16'))(_0xc411('0x17'));var utils=require(_0xc411('0x18'));var config=require(_0xc411('0x19'));var licenseUtil=require(_0xc411('0x1a'));var db=require(_0xc411('0x1b'))['db'];config[_0xc411('0x1c')]=_[_0xc411('0x1d')](config[_0xc411('0x1c')],{'host':_0xc411('0x1e'),'port':0x18eb});var socket=require(_0xc411('0x1f'))(new Redis(config['redis']));require(_0xc411('0x20'))[_0xc411('0x21')](socket);function respondWithStatusCode(_0x793a24,_0x36b1c4){_0x36b1c4=_0x36b1c4||0xcc;return function(_0x5520b4){if(_0x5520b4){return _0x793a24[_0xc411('0x22')](_0x36b1c4);}return _0x793a24[_0xc411('0x23')](_0x36b1c4)[_0xc411('0x24')]();};}function respondWithResult(_0x1b894d,_0x211de4){_0x211de4=_0x211de4||0xc8;return function(_0x43145b){if(_0x43145b){return _0x1b894d[_0xc411('0x23')](_0x211de4)[_0xc411('0x25')](_0x43145b);}};}function respondWithFilteredResult(_0x30c7da,_0x123389){return function(_0x199adb){if(_0x199adb){var _0x14264c=typeof _0x123389[_0xc411('0x26')]===_0xc411('0x27')&&typeof _0x123389[_0xc411('0x28')]===_0xc411('0x27');var _0x5abdbd=_0x199adb[_0xc411('0x29')];var _0x7da9cb=_0x14264c?0x0:_0x123389['offset'];var _0x2d54df=_0x14264c?_0x199adb[_0xc411('0x29')]:_0x123389[_0xc411('0x26')]+_0x123389['limit'];var _0x40f110;if(_0x2d54df>=_0x5abdbd){_0x2d54df=_0x5abdbd;_0x40f110=0xc8;}else{_0x40f110=0xce;}_0x30c7da[_0xc411('0x23')](_0x40f110);return _0x30c7da[_0xc411('0x2a')](_0xc411('0x2b'),_0x7da9cb+'-'+_0x2d54df+'/'+_0x5abdbd)['json'](_0x199adb);}return null;};}function patchUpdates(_0x3379da){return function(_0x4f7425){try{jsonpatch[_0xc411('0x2c')](_0x4f7425,_0x3379da,!![]);}catch(_0x29696b){return BPromise[_0xc411('0x2d')](_0x29696b);}return _0x4f7425[_0xc411('0x2e')]();};}function saveUpdates(_0x90c930,_0xcc2159){return function(_0x82cfe8){if(_0x82cfe8){return _0x82cfe8[_0xc411('0x2f')](_0x90c930)[_0xc411('0x30')](function(_0x2e12ba){return _0x2e12ba;});}return null;};}function removeEntity(_0x41aeb6,_0x34d3c0){return function(_0x1d1dba){if(_0x1d1dba){return _0x1d1dba['destroy']()[_0xc411('0x30')](function(){var _0xbd5c19=_0x1d1dba[_0xc411('0x31')]({'plain':!![]});var _0x45b413=_0xc411('0x32');return db['UserProfileResource'][_0xc411('0x33')]({'where':{'type':_0x45b413,'resourceId':_0xbd5c19['id']}})[_0xc411('0x30')](function(){return _0x1d1dba;});})[_0xc411('0x30')](function(){_0x41aeb6[_0xc411('0x23')](0xcc)[_0xc411('0x24')]();});}};}function handleEntityNotFound(_0x25c652,_0x42a1cb){return function(_0x1282eb){if(!_0x1282eb){_0x25c652[_0xc411('0x22')](0x194);}return _0x1282eb;};}function handleError(_0x309772,_0x5056a2){_0x5056a2=_0x5056a2||0x1f4;return function(_0x2aa7ec){logger[_0xc411('0x34')](_0x2aa7ec['stack']);if(_0x2aa7ec[_0xc411('0x35')]){delete _0x2aa7ec[_0xc411('0x35')];}_0x309772[_0xc411('0x23')](_0x5056a2)['send'](_0x2aa7ec);};}exports[_0xc411('0x36')]=function(_0x512609,_0x309437){var _0x7b84af={},_0x1bf10a={},_0x1f65dc={'count':0x0,'rows':[]};var _0x45a1a4=_[_0xc411('0x37')](db[_0xc411('0x38')][_0xc411('0x39')],function(_0x373d96){return{'name':_0x373d96[_0xc411('0x3a')],'type':_0x373d96['type'][_0xc411('0x3b')]};});_0x1bf10a['model']=_[_0xc411('0x37')](_0x45a1a4,_0xc411('0x35'));_0x1bf10a[_0xc411('0x3c')]=_[_0xc411('0x3d')](_0x512609[_0xc411('0x3c')]);_0x1bf10a[_0xc411('0x3e')]=_[_0xc411('0x3f')](_0x1bf10a['model'],_0x1bf10a['query']);_0x7b84af['attributes']=_[_0xc411('0x3f')](_0x1bf10a[_0xc411('0x40')],qs[_0xc411('0x41')](_0x512609[_0xc411('0x3c')][_0xc411('0x41')]));_0x7b84af['attributes']=_0x7b84af[_0xc411('0x42')]['length']?_0x7b84af['attributes']:_0x1bf10a[_0xc411('0x40')];if(!_0x512609[_0xc411('0x3c')]['hasOwnProperty']('nolimit')){_0x7b84af[_0xc411('0x28')]=qs[_0xc411('0x28')](_0x512609['query']['limit']);_0x7b84af[_0xc411('0x26')]=qs[_0xc411('0x26')](_0x512609['query']['offset']);}_0x7b84af[_0xc411('0x43')]=qs[_0xc411('0x44')](_0x512609['query'][_0xc411('0x44')]);_0x7b84af[_0xc411('0x45')]=qs['filters'](_[_0xc411('0x46')](_0x512609[_0xc411('0x3c')],_0x1bf10a[_0xc411('0x3e')]),_0x45a1a4);if(_0x512609['query']['filter']){_0x7b84af[_0xc411('0x45')]=_['merge'](_0x7b84af[_0xc411('0x45')],{'$or':_[_0xc411('0x37')](_0x45a1a4,function(_0x187b27){if(_0x187b27['type']!=='VIRTUAL'){var _0x4c0cd4={};_0x4c0cd4[_0x187b27[_0xc411('0x35')]]={'$like':'%'+_0x512609['query'][_0xc411('0x47')]+'%'};return _0x4c0cd4;}})});}_0x7b84af=_['merge']({},_0x7b84af,_0x512609['options']);var _0x22a66b={'where':_0x7b84af[_0xc411('0x45')]};return db[_0xc411('0x38')][_0xc411('0x29')](_0x22a66b)[_0xc411('0x30')](function(_0x59a0b5){_0x1f65dc[_0xc411('0x29')]=_0x59a0b5;if(_0x512609[_0xc411('0x3c')]['includeAll']){_0x7b84af[_0xc411('0x48')]=[{'all':!![]}];}return db['FaxQueue'][_0xc411('0x49')](_0x7b84af);})[_0xc411('0x30')](function(_0x2d352d){_0x1f65dc['rows']=_0x2d352d;return _0x1f65dc;})[_0xc411('0x30')](respondWithFilteredResult(_0x309437,_0x7b84af))[_0xc411('0x4a')](handleError(_0x309437,null));};exports[_0xc411('0x4b')]=function(_0x3bab77,_0x56f62b){var _0xfd189={'raw':!![],'where':{'id':_0x3bab77[_0xc411('0x4c')]['id']}},_0x574372={};_0x574372[_0xc411('0x40')]=_[_0xc411('0x3d')](db[_0xc411('0x38')][_0xc411('0x39')]);_0x574372[_0xc411('0x3c')]=_['keys'](_0x3bab77[_0xc411('0x3c')]);_0x574372['filters']=_[_0xc411('0x3f')](_0x574372[_0xc411('0x40')],_0x574372[_0xc411('0x3c')]);_0xfd189['attributes']=_[_0xc411('0x3f')](_0x574372['model'],qs['fields'](_0x3bab77[_0xc411('0x3c')][_0xc411('0x41')]));_0xfd189[_0xc411('0x42')]=_0xfd189[_0xc411('0x42')][_0xc411('0x4d')]?_0xfd189['attributes']:_0x574372['model'];if(_0x3bab77['query'][_0xc411('0x4e')]){_0xfd189[_0xc411('0x48')]=[{'all':!![]}];}_0xfd189=_[_0xc411('0x4f')]({},_0xfd189,_0x3bab77[_0xc411('0x50')]);return db[_0xc411('0x38')][_0xc411('0x51')](_0xfd189)[_0xc411('0x30')](handleEntityNotFound(_0x56f62b,null))['then'](respondWithResult(_0x56f62b,null))[_0xc411('0x4a')](handleError(_0x56f62b,null));};exports['create']=function(_0x1bbd99,_0x580a48){return db[_0xc411('0x38')][_0xc411('0x52')](_0x1bbd99[_0xc411('0x53')],{})[_0xc411('0x30')](function(_0xc8a4dd){var _0x3dd7fa=_0x1bbd99[_0xc411('0x54')][_0xc411('0x31')]({'plain':!![]});if(!_0x3dd7fa)throw new Error(_0xc411('0x55'));if(_0x3dd7fa['role']==='user'){var _0x1c2bf1=_0xc8a4dd[_0xc411('0x31')]({'plain':!![]});var _0xe40e85='FaxQueues';return db[_0xc411('0x56')]['find']({'where':{'name':_0xe40e85,'userProfileId':_0x3dd7fa['userProfileId']},'raw':!![]})[_0xc411('0x30')](function(_0x2ce39d){if(_0x2ce39d&&_0x2ce39d['autoAssociation']===0x0){return db[_0xc411('0x57')][_0xc411('0x52')]({'name':_0x1c2bf1[_0xc411('0x35')],'resourceId':_0x1c2bf1['id'],'type':_0x2ce39d[_0xc411('0x35')],'sectionId':_0x2ce39d['id']},{})[_0xc411('0x30')](function(){return _0xc8a4dd;});}else{return _0xc8a4dd;}})['catch'](function(_0x1ab070){logger[_0xc411('0x34')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1ab070);throw _0x1ab070;});}return _0xc8a4dd;})[_0xc411('0x30')](respondWithResult(_0x580a48,0xc9))[_0xc411('0x4a')](handleError(_0x580a48,null));};exports[_0xc411('0x2f')]=function(_0x4107a7,_0x1707d3){if(_0x4107a7[_0xc411('0x53')]['id']){delete _0x4107a7[_0xc411('0x53')]['id'];}return db[_0xc411('0x38')][_0xc411('0x51')]({'where':{'id':_0x4107a7[_0xc411('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1707d3,null))[_0xc411('0x30')](saveUpdates(_0x4107a7[_0xc411('0x53')],null))['then'](respondWithResult(_0x1707d3,null))[_0xc411('0x4a')](handleError(_0x1707d3,null));};exports[_0xc411('0x33')]=function(_0x1c82db,_0x3c895f){return db[_0xc411('0x38')]['find']({'where':{'id':_0x1c82db[_0xc411('0x4c')]['id']}})[_0xc411('0x30')](handleEntityNotFound(_0x3c895f,null))[_0xc411('0x30')](removeEntity(_0x3c895f,null))[_0xc411('0x4a')](handleError(_0x3c895f,null));};exports[_0xc411('0x58')]=function(_0xd31d16,_0x181651){return db['FaxQueue'][_0xc411('0x58')]()[_0xc411('0x30')](respondWithResult(_0x181651,null))[_0xc411('0x4a')](handleError(_0x181651,null));};exports[_0xc411('0x59')]=function(_0x4cd1a0,_0x1b38cd,_0x3c1f3c){var _0x302ff9={'raw':!![],'where':{}},_0x300eef={},_0x1b4d14;return db[_0xc411('0x38')][_0xc411('0x5a')]({'where':{'id':_0x4cd1a0[_0xc411('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1b38cd,null))[_0xc411('0x30')](function(_0x505312){if(_0x505312){_0x1b4d14=_0x505312['get']({'plain':!![]});_0x300eef['model']=_[_0xc411('0x3d')](db[_0xc411('0x5b')][_0xc411('0x39')]);_0x300eef[_0xc411('0x3c')]=_[_0xc411('0x3d')](_0x4cd1a0['query']);_0x300eef[_0xc411('0x3e')]=_['intersection'](_0x300eef[_0xc411('0x40')],_0x300eef['query']);_0x302ff9[_0xc411('0x42')]=_[_0xc411('0x3f')](_0x300eef['model'],qs[_0xc411('0x41')](_0x4cd1a0[_0xc411('0x3c')]['fields']));_0x302ff9['attributes']=_0x302ff9['attributes'][_0xc411('0x4d')]?_0x302ff9[_0xc411('0x42')]:_0x300eef['model'];if(!_0x4cd1a0[_0xc411('0x3c')][_0xc411('0x5c')](_0xc411('0x5d'))){_0x302ff9['limit']=qs[_0xc411('0x28')](_0x4cd1a0[_0xc411('0x3c')][_0xc411('0x28')]);_0x302ff9[_0xc411('0x26')]=qs[_0xc411('0x26')](_0x4cd1a0[_0xc411('0x3c')][_0xc411('0x26')]);}_0x302ff9['order']=qs[_0xc411('0x44')](_0x4cd1a0[_0xc411('0x3c')]['sort']);_0x302ff9['where']=qs[_0xc411('0x3e')](_[_0xc411('0x46')](_0x4cd1a0[_0xc411('0x3c')],_0x300eef[_0xc411('0x3e')]));_0x302ff9['where'][_0xc411('0x5e')]=_0x505312['id'];if(_0x4cd1a0[_0xc411('0x3c')]['filter']){_0x302ff9[_0xc411('0x45')]=_[_0xc411('0x4f')](_0x302ff9[_0xc411('0x45')],{'$or':_[_0xc411('0x37')](_0x302ff9[_0xc411('0x42')],function(_0x3abc9d){var _0x50df7e={};_0x50df7e[_0x3abc9d]={'$like':'%'+_0x4cd1a0[_0xc411('0x3c')][_0xc411('0x47')]+'%'};return _0x50df7e;})});}_0x302ff9=_[_0xc411('0x4f')]({},_0x302ff9,_0x4cd1a0['options']);return db[_0xc411('0x5b')][_0xc411('0x49')](_0x302ff9);}})['then'](function(_0x56ae99){if(_0x56ae99){return db['User'][_0xc411('0x5f')]({'where':{'id':_[_0xc411('0x37')](_0x56ae99,_0xc411('0x60')),'role':_0xc411('0x61')},'attributes':['id',_0xc411('0x35'),_0xc411('0x62'),_0xc411('0x63'),_0xc411('0x64')]});}})[_0xc411('0x30')](function(_0x383d5b){if(_0x383d5b){return{'count':_0x383d5b[_0xc411('0x29')],'rows':_[_0xc411('0x37')](_0x383d5b[_0xc411('0x65')],function(_0x13a249){return{'membername':_0x13a249[_0xc411('0x35')],'UserId':_0x13a249['id'],'queue_name':_0x1b4d14[_0xc411('0x35')],'FaxQueueId':_0x1b4d14['id'],'interface':util['format']('%s/%s',_0xc411('0x66'),_0x13a249[_0xc411('0x35')]),'penalty':0x0,'paused':_0x13a249['faxPause'],'createdAt':_0x13a249[_0xc411('0x64')],'updatedAt':_0x13a249['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xc411('0x30')](respondWithFilteredResult(_0x1b38cd,_0x302ff9))[_0xc411('0x4a')](handleError(_0x1b38cd,null));};exports[_0xc411('0x67')]=function(_0x589076,_0xb2086e,_0xe6645){var _0x5bacd1={};var _0x276ce6={};var _0xf75828;var _0x26ec90;return db[_0xc411('0x38')][_0xc411('0x5a')]({'where':{'id':_0x589076[_0xc411('0x4c')]['id']}})[_0xc411('0x30')](handleEntityNotFound(_0xb2086e,null))[_0xc411('0x30')](function(_0x1e34f3){if(_0x1e34f3){_0xf75828=_0x1e34f3;_0x276ce6[_0xc411('0x40')]=_['keys'](db[_0xc411('0x68')][_0xc411('0x39')]);_0x276ce6[_0xc411('0x3c')]=_['keys'](_0x589076[_0xc411('0x3c')]);_0x276ce6[_0xc411('0x3e')]=_[_0xc411('0x3f')](_0x276ce6[_0xc411('0x40')],_0x276ce6[_0xc411('0x3c')]);_0x5bacd1[_0xc411('0x42')]=_[_0xc411('0x3f')](_0x276ce6[_0xc411('0x40')],qs[_0xc411('0x41')](_0x589076[_0xc411('0x3c')][_0xc411('0x41')]));_0x5bacd1['attributes']=_0x5bacd1[_0xc411('0x42')]['length']?_0x5bacd1['attributes']:_0x276ce6[_0xc411('0x40')];_0x5bacd1[_0xc411('0x43')]=qs[_0xc411('0x44')](_0x589076[_0xc411('0x3c')][_0xc411('0x44')]);_0x5bacd1[_0xc411('0x45')]=qs[_0xc411('0x3e')](_[_0xc411('0x46')](_0x589076[_0xc411('0x3c')],_0x276ce6[_0xc411('0x3e')]));if(_0x589076[_0xc411('0x3c')][_0xc411('0x47')]){_0x5bacd1[_0xc411('0x45')]=_[_0xc411('0x4f')](_0x5bacd1['where'],{'$or':_[_0xc411('0x37')](_0x5bacd1[_0xc411('0x42')],function(_0x57ffb3){var _0x38a423={};_0x38a423[_0x57ffb3]={'$like':'%'+_0x589076[_0xc411('0x3c')]['filter']+'%'};return _0x38a423;})});}_0x5bacd1=_[_0xc411('0x4f')]({},_0x5bacd1,_0x589076[_0xc411('0x50')]);return _0xf75828[_0xc411('0x67')](_0x5bacd1);}})[_0xc411('0x30')](function(_0x36f8ec){if(_0x36f8ec){_0x26ec90=_0x36f8ec[_0xc411('0x4d')];if(!_0x589076[_0xc411('0x3c')][_0xc411('0x5c')](_0xc411('0x5d'))){_0x5bacd1['limit']=qs[_0xc411('0x28')](_0x589076[_0xc411('0x3c')][_0xc411('0x28')]);_0x5bacd1[_0xc411('0x26')]=qs[_0xc411('0x26')](_0x589076[_0xc411('0x3c')][_0xc411('0x26')]);}return _0xf75828[_0xc411('0x67')](_0x5bacd1);}})['then'](function(_0x45c001){if(_0x45c001){return _0x45c001?{'count':_0x26ec90,'rows':_0x45c001}:null;}})['then'](respondWithResult(_0xb2086e,null))[_0xc411('0x4a')](handleError(_0xb2086e,null));};exports[_0xc411('0x69')]=function(_0x2c214c,_0x5aa007,_0x390aca){var _0x2c23f1=_0x2c214c['body']['ids'];return db['Team']['findAll']({'where':{'id':_0x2c23f1},'attributes':['id'],'include':[{'model':db[_0xc411('0x6a')],'as':'Agents','attributes':['id',_0xc411('0x35'),_0xc411('0x6b'),'voicePause',_0xc411('0x6c')],'raw':!![]}]})[_0xc411('0x30')](function(_0x1c8d72){if(_0x1c8d72){var _0x110b49=_[_0xc411('0x6d')](_0x1c8d72,function(_0x277f31){var _0x3f1e63=_0x277f31[_0xc411('0x31')]({'plain':!![]});return _0x3f1e63[_0xc411('0x6e')];});return db[_0xc411('0x38')][_0xc411('0x51')]({'where':{'id':_0x2c214c['params']['id']}})[_0xc411('0x30')](function(_0x1852b0){return db[_0xc411('0x6f')][_0xc411('0x70')](function(_0x32220e){return _0x1852b0['addTeams'](_0x2c23f1,{'transaction':_0x32220e})[_0xc411('0x30')](function(){return BPromise[_0xc411('0x71')](_0x110b49,function(_0x48cdae){return db[_0xc411('0x5b')]['findOrCreate']({'where':{'UserId':_0x48cdae['id'],'FaxQueueId':_0x2c214c[_0xc411('0x4c')]['id']},'transaction':_0x32220e});});})[_0xc411('0x30')](function(){_0x110b49[_0xc411('0x72')](function(_0x16a4f5){socket[_0xc411('0x73')]('userFaxQueue:save',{'UserId':_0x16a4f5['id'],'FaxQueueId':_0x1852b0['id']});});});});});}})['then'](respondWithStatusCode(_0x5aa007,null))[_0xc411('0x4a')](handleError(_0x5aa007,null));};exports[_0xc411('0x74')]=function(_0xd957f1,_0x4686fd,_0x8f8443){return db[_0xc411('0x68')][_0xc411('0x49')]({'where':{'id':_0xd957f1[_0xc411('0x3c')][_0xc411('0x75')]},'attributes':['id'],'include':[{'model':db[_0xc411('0x6a')],'as':_0xc411('0x6e'),'attributes':['id'],'raw':!![]}]})[_0xc411('0x30')](handleEntityNotFound(_0x4686fd,null))[_0xc411('0x30')](function(_0x4046f5){var _0x1df7de=_['map'](_0x4046f5,'id');var _0x1322b2=[];var _0x2cc817=[];var _0x2b9da8=squel['select']();_0x2b9da8['field'](_0xc411('0x76'))[_0xc411('0x77')](_0xc411('0x78'),'tq')['join'](_0xc411('0x79'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xc411('0x45')](_0xc411('0x7a'),_0xd957f1[_0xc411('0x4c')]['id']);for(var _0x45fcc3=0x0;_0x45fcc3<_0x4046f5['length'];_0x45fcc3+=0x1){let _0x2e13e1=_0x4046f5[_0x45fcc3];for(var _0x471b42=0x0;_0x471b42<_0x2e13e1[_0xc411('0x6e')][_0xc411('0x4d')];_0x471b42+=0x1){let _0x3f7728=_0x2e13e1['Agents'][_0x471b42];var _0xdd9937=_0x2b9da8[_0xc411('0x7b')]();_0xdd9937['where'](_0xc411('0x7c'),_0x3f7728['id']);_0x2cc817[_0xc411('0x7d')](db[_0xc411('0x6f')]['query'](_0xdd9937[_0xc411('0x7e')](),{'type':db[_0xc411('0x6f')][_0xc411('0x7f')][_0xc411('0x80')]})[_0xc411('0x30')](function(_0x24fbd4){if(_0x24fbd4[_0xc411('0x4d')]===0x1){return _0x3f7728['id'];}else{var _0x4b528b=_[_0xc411('0x81')](_[_0xc411('0x37')](_0x24fbd4,_0xc411('0x82')),function(_0x743d28){return _[_0xc411('0x83')](_0x1df7de,_0x743d28);});if(_0x4b528b){return _0x3f7728['id'];}}}));}}return BPromise['all'](_0x2cc817)[_0xc411('0x30')](function(_0x197e6d){_0x1322b2=_(_0x1322b2)[_0xc411('0x84')](_0x197e6d)['compact']()[_0xc411('0x85')]();return db[_0xc411('0x38')][_0xc411('0x51')]({'where':{'id':_0xd957f1[_0xc411('0x4c')]['id']}})[_0xc411('0x30')](function(_0x319b09){return db[_0xc411('0x6f')][_0xc411('0x70')](function(_0x5c2d1a){return _0x319b09[_0xc411('0x74')](_0xd957f1[_0xc411('0x3c')]['ids'],{'transaction':_0x5c2d1a})[_0xc411('0x30')](function(){if(!_['isEmpty'](_0x1322b2)){return _0x319b09[_0xc411('0x86')](_0x1322b2,{'transaction':_0x5c2d1a});}})[_0xc411('0x30')](function(){_0x1322b2[_0xc411('0x72')](function(_0x5ddfed){socket[_0xc411('0x73')]('userFaxQueue:remove',{'UserId':_0x5ddfed,'FaxQueueId':_0x319b09['id']});});});});});});})[_0xc411('0x30')](respondWithStatusCode(_0x4686fd,null))[_0xc411('0x4a')](handleError(_0x4686fd,null));};exports[_0xc411('0x87')]=function(_0x4c89ce,_0x50eb0c,_0xb56102){return db[_0xc411('0x38')]['find']({'where':{'id':_0x4c89ce[_0xc411('0x4c')]['id']}})[_0xc411('0x30')](handleEntityNotFound(_0x50eb0c,null))['then'](function(_0xdf5f07){if(_0xdf5f07){return _0xdf5f07['addAgents'](_0x4c89ce[_0xc411('0x53')][_0xc411('0x75')],_['omit'](_0x4c89ce['body'],['ids','id'])||{})[_0xc411('0x88')](function(_0x46288d){for(var _0x3ec4d3=0x0;_0x3ec4d3<_0x4c89ce[_0xc411('0x53')][_0xc411('0x75')]['length'];_0x3ec4d3+=0x1){socket[_0xc411('0x73')](_0xc411('0x89'),{'UserId':Number(_0x4c89ce['body'][_0xc411('0x75')][_0x3ec4d3]),'FaxQueueId':Number(_0x4c89ce[_0xc411('0x4c')]['id'])});}return _0x46288d;});}})[_0xc411('0x30')](respondWithResult(_0x50eb0c,null))[_0xc411('0x4a')](handleError(_0x50eb0c,null));};exports['removeAgents']=function(_0x36637a,_0x79506f,_0x404f11){return db[_0xc411('0x38')][_0xc411('0x51')]({'where':{'id':_0x36637a['params']['id']}})[_0xc411('0x30')](handleEntityNotFound(_0x79506f,null))['then'](function(_0x2fd753){if(_0x2fd753){return _0x2fd753[_0xc411('0x86')](_0x36637a[_0xc411('0x3c')][_0xc411('0x75')])[_0xc411('0x30')](function(){if(_[_0xc411('0x8a')](_0x36637a['query'][_0xc411('0x75')])){for(var _0x372bd6=0x0;_0x372bd6<_0x36637a['query'][_0xc411('0x75')][_0xc411('0x4d')];_0x372bd6+=0x1){socket[_0xc411('0x73')](_0xc411('0x8b'),{'UserId':Number(_0x36637a['query'][_0xc411('0x75')][_0x372bd6]),'FaxQueueId':Number(_0x36637a[_0xc411('0x4c')]['id'])});}}else{socket['emit'](_0xc411('0x8b'),{'UserId':Number(_0x36637a[_0xc411('0x3c')]['ids']),'FaxQueueId':Number(_0x36637a[_0xc411('0x4c')]['id'])});}});}})[_0xc411('0x30')](respondWithStatusCode(_0x79506f,null))['catch'](handleError(_0x79506f,null));};exports['getAgents']=function(_0x17f8f0,_0x1609bd,_0x364846){var _0x1a41cd={};var _0x24c2d0={};var _0x587491;var _0x49a5eb;return db[_0xc411('0x38')]['findOne']({'where':{'id':_0x17f8f0[_0xc411('0x4c')]['id']}})[_0xc411('0x30')](handleEntityNotFound(_0x1609bd,null))[_0xc411('0x30')](function(_0x40e731){if(_0x40e731){_0x587491=_0x40e731;_0x24c2d0['model']=_['keys'](db['User'][_0xc411('0x39')]);_0x24c2d0[_0xc411('0x3c')]=_[_0xc411('0x3d')](_0x17f8f0[_0xc411('0x3c')]);_0x24c2d0[_0xc411('0x3e')]=_[_0xc411('0x3f')](_0x24c2d0[_0xc411('0x40')],_0x24c2d0[_0xc411('0x3c')]);_0x1a41cd['attributes']=_[_0xc411('0x3f')](_0x24c2d0['model'],qs[_0xc411('0x41')](_0x17f8f0[_0xc411('0x3c')]['fields']));_0x1a41cd[_0xc411('0x42')]=_0x1a41cd[_0xc411('0x42')][_0xc411('0x4d')]?_0x1a41cd[_0xc411('0x42')]:_0x24c2d0[_0xc411('0x40')];_0x1a41cd[_0xc411('0x43')]=qs[_0xc411('0x44')](_0x17f8f0['query'][_0xc411('0x44')]);_0x1a41cd['where']=qs[_0xc411('0x3e')](_[_0xc411('0x46')](_0x17f8f0[_0xc411('0x3c')],_0x24c2d0[_0xc411('0x3e')]));if(_0x17f8f0[_0xc411('0x3c')][_0xc411('0x47')]){_0x1a41cd[_0xc411('0x45')]=_[_0xc411('0x4f')](_0x1a41cd['where'],{'$or':_[_0xc411('0x37')](_0x1a41cd['attributes'],function(_0x5169ed){var _0x2139b9={};_0x2139b9[_0x5169ed]={'$like':'%'+_0x17f8f0['query'][_0xc411('0x47')]+'%'};return _0x2139b9;})});}_0x1a41cd=_[_0xc411('0x4f')]({},_0x1a41cd,_0x17f8f0[_0xc411('0x50')]);return _0x587491[_0xc411('0x8c')](_0x1a41cd);}})[_0xc411('0x30')](function(_0x793238){if(_0x793238){_0x49a5eb=_0x793238[_0xc411('0x4d')];if(!_0x17f8f0[_0xc411('0x3c')][_0xc411('0x5c')]('nolimit')){_0x1a41cd[_0xc411('0x28')]=qs[_0xc411('0x28')](_0x17f8f0[_0xc411('0x3c')]['limit']);_0x1a41cd['offset']=qs[_0xc411('0x26')](_0x17f8f0[_0xc411('0x3c')][_0xc411('0x26')]);}return _0x587491['getAgents'](_0x1a41cd);}})[_0xc411('0x30')](function(_0x2d0408){if(_0x2d0408){return _0x2d0408?{'count':_0x49a5eb,'rows':_0x2d0408}:null;}})[_0xc411('0x30')](respondWithResult(_0x1609bd,null))['catch'](handleError(_0x1609bd,null));}; \ No newline at end of file +var _0x7478=['findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','field','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','push','toString','SELECT','every','includes','compact','value','removeAgents','userFaxQueue:remove','addAgents','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','FaxQueues','destroy','error','stack','index','map','FaxQueue','fieldName','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','rawAttributes','create','body','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','UserFaxQueue','User','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','%s/%s','SIP','getTeams','findOne','Team','ids','findAll','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','each'];(function(_0x16120e,_0x1d1329){var _0x10cac0=function(_0xdfc6e3){while(--_0xdfc6e3){_0x16120e['push'](_0x16120e['shift']());}};_0x10cac0(++_0x1d1329);}(_0x7478,0x1bb));var _0x8747=function(_0x4fc650,_0x46f514){_0x4fc650=_0x4fc650-0x0;var _0xcaac3d=_0x7478[_0x4fc650];return _0xcaac3d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8747('0x0'));var zipdir=require(_0x8747('0x1'));var jsonpatch=require(_0x8747('0x2'));var rp=require(_0x8747('0x3'));var moment=require(_0x8747('0x4'));var BPromise=require(_0x8747('0x5'));var Mustache=require(_0x8747('0x6'));var util=require(_0x8747('0x7'));var path=require(_0x8747('0x8'));var sox=require(_0x8747('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8747('0xa'));var _=require(_0x8747('0xb'));var squel=require(_0x8747('0xc'));var crypto=require(_0x8747('0xd'));var jsforce=require(_0x8747('0xe'));var deskjs=require(_0x8747('0xf'));var toCsv=require(_0x8747('0x10'));var querystring=require(_0x8747('0x11'));var Papa=require(_0x8747('0x12'));var Redis=require('ioredis');var authService=require(_0x8747('0x13'));var qs=require(_0x8747('0x14'));var as=require(_0x8747('0x15'));var hardwareService=require(_0x8747('0x16'));var logger=require('../../config/logger')(_0x8747('0x17'));var utils=require(_0x8747('0x18'));var config=require(_0x8747('0x19'));var licenseUtil=require(_0x8747('0x1a'));var db=require(_0x8747('0x1b'))['db'];config[_0x8747('0x1c')]=_[_0x8747('0x1d')](config[_0x8747('0x1c')],{'host':_0x8747('0x1e'),'port':0x18eb});var socket=require(_0x8747('0x1f'))(new Redis(config[_0x8747('0x1c')]));require(_0x8747('0x20'))['register'](socket);function respondWithStatusCode(_0x45e2fb,_0x2c7a88){_0x2c7a88=_0x2c7a88||0xcc;return function(_0x5f594c){if(_0x5f594c){return _0x45e2fb[_0x8747('0x21')](_0x2c7a88);}return _0x45e2fb[_0x8747('0x22')](_0x2c7a88)[_0x8747('0x23')]();};}function respondWithResult(_0x17e25b,_0x3086e0){_0x3086e0=_0x3086e0||0xc8;return function(_0x3ee720){if(_0x3ee720){return _0x17e25b['status'](_0x3086e0)[_0x8747('0x24')](_0x3ee720);}};}function respondWithFilteredResult(_0x5940ba,_0x56c4fc){return function(_0x3010e2){if(_0x3010e2){var _0x7aa8fe=typeof _0x56c4fc[_0x8747('0x25')]===_0x8747('0x26')&&typeof _0x56c4fc[_0x8747('0x27')]==='undefined';var _0x44e27a=_0x3010e2[_0x8747('0x28')];var _0xab9ebf=_0x7aa8fe?0x0:_0x56c4fc['offset'];var _0x3734f0=_0x7aa8fe?_0x3010e2['count']:_0x56c4fc[_0x8747('0x25')]+_0x56c4fc['limit'];var _0x5ea2f9;if(_0x3734f0>=_0x44e27a){_0x3734f0=_0x44e27a;_0x5ea2f9=0xc8;}else{_0x5ea2f9=0xce;}_0x5940ba[_0x8747('0x22')](_0x5ea2f9);return _0x5940ba[_0x8747('0x29')](_0x8747('0x2a'),_0xab9ebf+'-'+_0x3734f0+'/'+_0x44e27a)['json'](_0x3010e2);}return null;};}function patchUpdates(_0xf8bafe){return function(_0x586293){try{jsonpatch['apply'](_0x586293,_0xf8bafe,!![]);}catch(_0x850112){return BPromise[_0x8747('0x2b')](_0x850112);}return _0x586293[_0x8747('0x2c')]();};}function saveUpdates(_0x7756d9,_0x1afbc0){return function(_0x35b140){if(_0x35b140){return _0x35b140[_0x8747('0x2d')](_0x7756d9)[_0x8747('0x2e')](function(_0x25cecc){return _0x25cecc;});}return null;};}function removeEntity(_0x3e81fb,_0x5ee1f0){return function(_0x1eb2bf){if(_0x1eb2bf){return _0x1eb2bf['destroy']()['then'](function(){var _0x3af3cf=_0x1eb2bf[_0x8747('0x2f')]({'plain':!![]});var _0x16a25f=_0x8747('0x30');return db['UserProfileResource'][_0x8747('0x31')]({'where':{'type':_0x16a25f,'resourceId':_0x3af3cf['id']}})[_0x8747('0x2e')](function(){return _0x1eb2bf;});})[_0x8747('0x2e')](function(){_0x3e81fb[_0x8747('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c2f87,_0x554725){return function(_0x4fd608){if(!_0x4fd608){_0x5c2f87[_0x8747('0x21')](0x194);}return _0x4fd608;};}function handleError(_0xac7b59,_0x4105b6){_0x4105b6=_0x4105b6||0x1f4;return function(_0x3f8868){logger[_0x8747('0x32')](_0x3f8868[_0x8747('0x33')]);if(_0x3f8868['name']){delete _0x3f8868['name'];}_0xac7b59[_0x8747('0x22')](_0x4105b6)['send'](_0x3f8868);};}exports[_0x8747('0x34')]=function(_0x107996,_0xb21410){var _0x273073={},_0xa8f49c={},_0x557cec={'count':0x0,'rows':[]};var _0x14066c=_[_0x8747('0x35')](db[_0x8747('0x36')]['rawAttributes'],function(_0x8fe419){return{'name':_0x8fe419[_0x8747('0x37')],'type':_0x8fe419['type']['key']};});_0xa8f49c[_0x8747('0x38')]=_[_0x8747('0x35')](_0x14066c,_0x8747('0x39'));_0xa8f49c[_0x8747('0x3a')]=_[_0x8747('0x3b')](_0x107996[_0x8747('0x3a')]);_0xa8f49c[_0x8747('0x3c')]=_[_0x8747('0x3d')](_0xa8f49c['model'],_0xa8f49c[_0x8747('0x3a')]);_0x273073[_0x8747('0x3e')]=_[_0x8747('0x3d')](_0xa8f49c[_0x8747('0x38')],qs['fields'](_0x107996[_0x8747('0x3a')][_0x8747('0x3f')]));_0x273073[_0x8747('0x3e')]=_0x273073['attributes'][_0x8747('0x40')]?_0x273073[_0x8747('0x3e')]:_0xa8f49c[_0x8747('0x38')];if(!_0x107996[_0x8747('0x3a')][_0x8747('0x41')](_0x8747('0x42'))){_0x273073[_0x8747('0x27')]=qs[_0x8747('0x27')](_0x107996[_0x8747('0x3a')][_0x8747('0x27')]);_0x273073[_0x8747('0x25')]=qs[_0x8747('0x25')](_0x107996[_0x8747('0x3a')][_0x8747('0x25')]);}_0x273073[_0x8747('0x43')]=qs[_0x8747('0x44')](_0x107996['query'][_0x8747('0x44')]);_0x273073[_0x8747('0x45')]=qs[_0x8747('0x3c')](_[_0x8747('0x46')](_0x107996[_0x8747('0x3a')],_0xa8f49c['filters']),_0x14066c);if(_0x107996['query']['filter']){_0x273073[_0x8747('0x45')]=_[_0x8747('0x47')](_0x273073[_0x8747('0x45')],{'$or':_[_0x8747('0x35')](_0x14066c,function(_0x49b1a5){if(_0x49b1a5[_0x8747('0x48')]!==_0x8747('0x49')){var _0x4d4a2b={};_0x4d4a2b[_0x49b1a5[_0x8747('0x39')]]={'$like':'%'+_0x107996[_0x8747('0x3a')][_0x8747('0x4a')]+'%'};return _0x4d4a2b;}})});}_0x273073=_['merge']({},_0x273073,_0x107996[_0x8747('0x4b')]);var _0x5434ab={'where':_0x273073[_0x8747('0x45')]};return db[_0x8747('0x36')][_0x8747('0x28')](_0x5434ab)[_0x8747('0x2e')](function(_0x647117){_0x557cec[_0x8747('0x28')]=_0x647117;if(_0x107996[_0x8747('0x3a')][_0x8747('0x4c')]){_0x273073[_0x8747('0x4d')]=[{'all':!![]}];}return db[_0x8747('0x36')]['findAll'](_0x273073);})[_0x8747('0x2e')](function(_0x297cae){_0x557cec[_0x8747('0x4e')]=_0x297cae;return _0x557cec;})['then'](respondWithFilteredResult(_0xb21410,_0x273073))[_0x8747('0x4f')](handleError(_0xb21410,null));};exports[_0x8747('0x50')]=function(_0x1b7e65,_0x5bb447){var _0x53708d={'raw':!![],'where':{'id':_0x1b7e65[_0x8747('0x51')]['id']}},_0x6dba69={};_0x6dba69[_0x8747('0x38')]=_[_0x8747('0x3b')](db[_0x8747('0x36')][_0x8747('0x52')]);_0x6dba69[_0x8747('0x3a')]=_[_0x8747('0x3b')](_0x1b7e65[_0x8747('0x3a')]);_0x6dba69['filters']=_[_0x8747('0x3d')](_0x6dba69[_0x8747('0x38')],_0x6dba69['query']);_0x53708d['attributes']=_[_0x8747('0x3d')](_0x6dba69['model'],qs[_0x8747('0x3f')](_0x1b7e65[_0x8747('0x3a')][_0x8747('0x3f')]));_0x53708d[_0x8747('0x3e')]=_0x53708d[_0x8747('0x3e')][_0x8747('0x40')]?_0x53708d[_0x8747('0x3e')]:_0x6dba69[_0x8747('0x38')];if(_0x1b7e65['query'][_0x8747('0x4c')]){_0x53708d['include']=[{'all':!![]}];}_0x53708d=_[_0x8747('0x47')]({},_0x53708d,_0x1b7e65[_0x8747('0x4b')]);return db['FaxQueue']['find'](_0x53708d)['then'](handleEntityNotFound(_0x5bb447,null))[_0x8747('0x2e')](respondWithResult(_0x5bb447,null))['catch'](handleError(_0x5bb447,null));};exports['create']=function(_0x5497bf,_0x1bcda3){return db['FaxQueue'][_0x8747('0x53')](_0x5497bf[_0x8747('0x54')],{})[_0x8747('0x2e')](function(_0x6b8626){var _0x522641=_0x5497bf[_0x8747('0x55')][_0x8747('0x2f')]({'plain':!![]});if(!_0x522641)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x522641['role']===_0x8747('0x55')){var _0x29606e=_0x6b8626[_0x8747('0x2f')]({'plain':!![]});var _0x319f32=_0x8747('0x30');return db[_0x8747('0x56')][_0x8747('0x57')]({'where':{'name':_0x319f32,'userProfileId':_0x522641[_0x8747('0x58')]},'raw':!![]})['then'](function(_0x22b7c7){if(_0x22b7c7&&_0x22b7c7[_0x8747('0x59')]===0x0){return db[_0x8747('0x5a')][_0x8747('0x53')]({'name':_0x29606e['name'],'resourceId':_0x29606e['id'],'type':_0x22b7c7[_0x8747('0x39')],'sectionId':_0x22b7c7['id']},{})[_0x8747('0x2e')](function(){return _0x6b8626;});}else{return _0x6b8626;}})[_0x8747('0x4f')](function(_0x3c4c0d){logger[_0x8747('0x32')](_0x8747('0x5b'),_0x3c4c0d);throw _0x3c4c0d;});}return _0x6b8626;})['then'](respondWithResult(_0x1bcda3,0xc9))[_0x8747('0x4f')](handleError(_0x1bcda3,null));};exports[_0x8747('0x2d')]=function(_0x3d42ec,_0xdd226d){if(_0x3d42ec[_0x8747('0x54')]['id']){delete _0x3d42ec[_0x8747('0x54')]['id'];}return db['FaxQueue']['find']({'where':{'id':_0x3d42ec['params']['id']}})['then'](handleEntityNotFound(_0xdd226d,null))[_0x8747('0x2e')](saveUpdates(_0x3d42ec['body'],null))[_0x8747('0x2e')](respondWithResult(_0xdd226d,null))[_0x8747('0x4f')](handleError(_0xdd226d,null));};exports[_0x8747('0x31')]=function(_0x52ffc1,_0x3c1a51){return db[_0x8747('0x36')]['find']({'where':{'id':_0x52ffc1[_0x8747('0x51')]['id']}})[_0x8747('0x2e')](handleEntityNotFound(_0x3c1a51,null))[_0x8747('0x2e')](removeEntity(_0x3c1a51,null))[_0x8747('0x4f')](handleError(_0x3c1a51,null));};exports['describe']=function(_0xc2f663,_0x260a6b){return db['FaxQueue'][_0x8747('0x5c')]()[_0x8747('0x2e')](respondWithResult(_0x260a6b,null))['catch'](handleError(_0x260a6b,null));};exports['getMembers']=function(_0x42897c,_0x263714,_0x34a022){var _0x50bfe4={'raw':!![],'where':{}},_0x1f2af4={},_0x4106d1;return db[_0x8747('0x36')]['findOne']({'where':{'id':_0x42897c[_0x8747('0x51')]['id']}})[_0x8747('0x2e')](handleEntityNotFound(_0x263714,null))[_0x8747('0x2e')](function(_0x384352){if(_0x384352){_0x4106d1=_0x384352['get']({'plain':!![]});_0x1f2af4['model']=_[_0x8747('0x3b')](db[_0x8747('0x5d')][_0x8747('0x52')]);_0x1f2af4[_0x8747('0x3a')]=_[_0x8747('0x3b')](_0x42897c[_0x8747('0x3a')]);_0x1f2af4[_0x8747('0x3c')]=_[_0x8747('0x3d')](_0x1f2af4[_0x8747('0x38')],_0x1f2af4[_0x8747('0x3a')]);_0x50bfe4[_0x8747('0x3e')]=_[_0x8747('0x3d')](_0x1f2af4[_0x8747('0x38')],qs[_0x8747('0x3f')](_0x42897c['query'][_0x8747('0x3f')]));_0x50bfe4['attributes']=_0x50bfe4[_0x8747('0x3e')][_0x8747('0x40')]?_0x50bfe4[_0x8747('0x3e')]:_0x1f2af4['model'];if(!_0x42897c['query'][_0x8747('0x41')]('nolimit')){_0x50bfe4['limit']=qs['limit'](_0x42897c['query'][_0x8747('0x27')]);_0x50bfe4[_0x8747('0x25')]=qs[_0x8747('0x25')](_0x42897c['query'][_0x8747('0x25')]);}_0x50bfe4['order']=qs[_0x8747('0x44')](_0x42897c[_0x8747('0x3a')][_0x8747('0x44')]);_0x50bfe4['where']=qs['filters'](_[_0x8747('0x46')](_0x42897c[_0x8747('0x3a')],_0x1f2af4['filters']));_0x50bfe4[_0x8747('0x45')]['FaxQueueId']=_0x384352['id'];if(_0x42897c[_0x8747('0x3a')][_0x8747('0x4a')]){_0x50bfe4[_0x8747('0x45')]=_[_0x8747('0x47')](_0x50bfe4['where'],{'$or':_[_0x8747('0x35')](_0x50bfe4[_0x8747('0x3e')],function(_0x1a7a7b){var _0x87e31f={};_0x87e31f[_0x1a7a7b]={'$like':'%'+_0x42897c[_0x8747('0x3a')]['filter']+'%'};return _0x87e31f;})});}_0x50bfe4=_[_0x8747('0x47')]({},_0x50bfe4,_0x42897c[_0x8747('0x4b')]);return db[_0x8747('0x5d')]['findAll'](_0x50bfe4);}})['then'](function(_0x290961){if(_0x290961){return db[_0x8747('0x5e')][_0x8747('0x5f')]({'where':{'id':_[_0x8747('0x35')](_0x290961,_0x8747('0x60')),'role':_0x8747('0x61')},'attributes':['id','name',_0x8747('0x62'),_0x8747('0x63'),_0x8747('0x64')]});}})[_0x8747('0x2e')](function(_0x4145d9){if(_0x4145d9){return{'count':_0x4145d9['count'],'rows':_[_0x8747('0x35')](_0x4145d9['rows'],function(_0xfa532e){return{'membername':_0xfa532e[_0x8747('0x39')],'UserId':_0xfa532e['id'],'queue_name':_0x4106d1[_0x8747('0x39')],'FaxQueueId':_0x4106d1['id'],'interface':util['format'](_0x8747('0x65'),_0x8747('0x66'),_0xfa532e[_0x8747('0x39')]),'penalty':0x0,'paused':_0xfa532e[_0x8747('0x62')],'createdAt':_0xfa532e['createdAt'],'updatedAt':_0xfa532e[_0x8747('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8747('0x2e')](respondWithFilteredResult(_0x263714,_0x50bfe4))[_0x8747('0x4f')](handleError(_0x263714,null));};exports[_0x8747('0x67')]=function(_0x18814c,_0x3afd3a,_0x24e7f5){var _0x384070={};var _0x1b1239={};var _0x574ee3;var _0x260018;return db[_0x8747('0x36')][_0x8747('0x68')]({'where':{'id':_0x18814c[_0x8747('0x51')]['id']}})['then'](handleEntityNotFound(_0x3afd3a,null))[_0x8747('0x2e')](function(_0x11cb43){if(_0x11cb43){_0x574ee3=_0x11cb43;_0x1b1239[_0x8747('0x38')]=_[_0x8747('0x3b')](db[_0x8747('0x69')][_0x8747('0x52')]);_0x1b1239[_0x8747('0x3a')]=_[_0x8747('0x3b')](_0x18814c[_0x8747('0x3a')]);_0x1b1239[_0x8747('0x3c')]=_[_0x8747('0x3d')](_0x1b1239[_0x8747('0x38')],_0x1b1239[_0x8747('0x3a')]);_0x384070[_0x8747('0x3e')]=_['intersection'](_0x1b1239[_0x8747('0x38')],qs['fields'](_0x18814c[_0x8747('0x3a')][_0x8747('0x3f')]));_0x384070['attributes']=_0x384070[_0x8747('0x3e')][_0x8747('0x40')]?_0x384070['attributes']:_0x1b1239['model'];_0x384070['order']=qs['sort'](_0x18814c[_0x8747('0x3a')][_0x8747('0x44')]);_0x384070['where']=qs[_0x8747('0x3c')](_['pick'](_0x18814c[_0x8747('0x3a')],_0x1b1239[_0x8747('0x3c')]));if(_0x18814c[_0x8747('0x3a')]['filter']){_0x384070['where']=_[_0x8747('0x47')](_0x384070[_0x8747('0x45')],{'$or':_[_0x8747('0x35')](_0x384070[_0x8747('0x3e')],function(_0x3c332e){var _0x438bfe={};_0x438bfe[_0x3c332e]={'$like':'%'+_0x18814c[_0x8747('0x3a')]['filter']+'%'};return _0x438bfe;})});}_0x384070=_[_0x8747('0x47')]({},_0x384070,_0x18814c[_0x8747('0x4b')]);return _0x574ee3[_0x8747('0x67')](_0x384070);}})[_0x8747('0x2e')](function(_0x37bf9e){if(_0x37bf9e){_0x260018=_0x37bf9e['length'];if(!_0x18814c[_0x8747('0x3a')][_0x8747('0x41')](_0x8747('0x42'))){_0x384070[_0x8747('0x27')]=qs[_0x8747('0x27')](_0x18814c[_0x8747('0x3a')][_0x8747('0x27')]);_0x384070[_0x8747('0x25')]=qs['offset'](_0x18814c['query']['offset']);}return _0x574ee3['getTeams'](_0x384070);}})[_0x8747('0x2e')](function(_0x406b38){if(_0x406b38){return _0x406b38?{'count':_0x260018,'rows':_0x406b38}:null;}})[_0x8747('0x2e')](respondWithResult(_0x3afd3a,null))[_0x8747('0x4f')](handleError(_0x3afd3a,null));};exports['addTeams']=function(_0x30560b,_0x372295,_0x424686){var _0x1671b8=_0x30560b[_0x8747('0x54')][_0x8747('0x6a')];return db['Team'][_0x8747('0x6b')]({'where':{'id':_0x1671b8},'attributes':['id'],'include':[{'model':db[_0x8747('0x5e')],'as':_0x8747('0x6c'),'attributes':['id',_0x8747('0x39'),_0x8747('0x6d'),_0x8747('0x6e'),_0x8747('0x6f')],'raw':!![]}]})[_0x8747('0x2e')](function(_0x75470d){if(_0x75470d){var _0x1ec3ea=_[_0x8747('0x70')](_0x75470d,function(_0x5536b1){var _0x10ec42=_0x5536b1['get']({'plain':!![]});return _0x10ec42[_0x8747('0x6c')];});return db['FaxQueue'][_0x8747('0x57')]({'where':{'id':_0x30560b[_0x8747('0x51')]['id']}})[_0x8747('0x2e')](function(_0x580d40){return db[_0x8747('0x71')][_0x8747('0x72')](function(_0x3a8125){return _0x580d40[_0x8747('0x73')](_0x1671b8,{'transaction':_0x3a8125})['then'](function(){return BPromise[_0x8747('0x74')](_0x1ec3ea,function(_0x258a88){return db['UserFaxQueue'][_0x8747('0x75')]({'where':{'UserId':_0x258a88['id'],'FaxQueueId':_0x30560b['params']['id']},'transaction':_0x3a8125});});})['then'](function(){_0x1ec3ea[_0x8747('0x76')](function(_0x5de044){socket[_0x8747('0x77')](_0x8747('0x78'),{'UserId':_0x5de044['id'],'FaxQueueId':_0x580d40['id']});});});});});}})['then'](respondWithStatusCode(_0x372295,null))[_0x8747('0x4f')](handleError(_0x372295,null));};exports[_0x8747('0x79')]=function(_0x31a20f,_0x5cf2be,_0x506e2a){return db[_0x8747('0x69')][_0x8747('0x6b')]({'where':{'id':_0x31a20f['query'][_0x8747('0x6a')]},'attributes':['id'],'include':[{'model':db[_0x8747('0x5e')],'as':_0x8747('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x8747('0x2e')](handleEntityNotFound(_0x5cf2be,null))[_0x8747('0x2e')](function(_0x21655c){var _0x2f7d05=_[_0x8747('0x35')](_0x21655c,'id');var _0x5eda46=[];var _0x3a5213=[];var _0x4f3ac3=squel['select']();_0x4f3ac3[_0x8747('0x7a')](_0x8747('0x7b'))[_0x8747('0x7c')]('team_has_fax_queues','tq')[_0x8747('0x7d')]('user_has_teams','ut',_0x8747('0x7e'))[_0x8747('0x45')](_0x8747('0x7f'),_0x31a20f[_0x8747('0x51')]['id']);for(var _0x2afbfc=0x0;_0x2afbfc<_0x21655c['length'];_0x2afbfc+=0x1){let _0x2eca97=_0x21655c[_0x2afbfc];for(var _0x44f6cd=0x0;_0x44f6cd<_0x2eca97['Agents']['length'];_0x44f6cd+=0x1){let _0x72e575=_0x2eca97[_0x8747('0x6c')][_0x44f6cd];var _0x596154=_0x4f3ac3['clone']();_0x596154['where']('ut.UserId\x20=\x20?',_0x72e575['id']);_0x3a5213[_0x8747('0x80')](db[_0x8747('0x71')][_0x8747('0x3a')](_0x596154[_0x8747('0x81')](),{'type':db[_0x8747('0x71')]['QueryTypes'][_0x8747('0x82')]})[_0x8747('0x2e')](function(_0x3e81cc){if(_0x3e81cc[_0x8747('0x40')]===0x1){return _0x72e575['id'];}else{var _0x5c2991=_[_0x8747('0x83')](_[_0x8747('0x35')](_0x3e81cc,'TeamId'),function(_0x4871be){return _[_0x8747('0x84')](_0x2f7d05,_0x4871be);});if(_0x5c2991){return _0x72e575['id'];}}}));}}return BPromise['all'](_0x3a5213)['then'](function(_0x476354){_0x5eda46=_(_0x5eda46)['union'](_0x476354)[_0x8747('0x85')]()[_0x8747('0x86')]();return db[_0x8747('0x36')]['find']({'where':{'id':_0x31a20f[_0x8747('0x51')]['id']}})[_0x8747('0x2e')](function(_0x24c494){return db['sequelize'][_0x8747('0x72')](function(_0xf22fe3){return _0x24c494[_0x8747('0x79')](_0x31a20f[_0x8747('0x3a')][_0x8747('0x6a')],{'transaction':_0xf22fe3})[_0x8747('0x2e')](function(){if(!_['isEmpty'](_0x5eda46)){return _0x24c494[_0x8747('0x87')](_0x5eda46,{'transaction':_0xf22fe3});}})['then'](function(){_0x5eda46[_0x8747('0x76')](function(_0x5b56aa){socket[_0x8747('0x77')](_0x8747('0x88'),{'UserId':_0x5b56aa,'FaxQueueId':_0x24c494['id']});});});});});});})[_0x8747('0x2e')](respondWithStatusCode(_0x5cf2be,null))[_0x8747('0x4f')](handleError(_0x5cf2be,null));};exports[_0x8747('0x89')]=function(_0x17e939,_0xd232d4,_0x205bba){return db['FaxQueue'][_0x8747('0x57')]({'where':{'id':_0x17e939[_0x8747('0x51')]['id']}})[_0x8747('0x2e')](handleEntityNotFound(_0xd232d4,null))[_0x8747('0x2e')](function(_0x3973f5){if(_0x3973f5){return _0x3973f5[_0x8747('0x89')](_0x17e939[_0x8747('0x54')]['ids'],_['omit'](_0x17e939[_0x8747('0x54')],[_0x8747('0x6a'),'id'])||{})['spread'](function(_0x2f9ab6){for(var _0x45f40e=0x0;_0x45f40e<_0x17e939['body'][_0x8747('0x6a')][_0x8747('0x40')];_0x45f40e+=0x1){socket[_0x8747('0x77')](_0x8747('0x78'),{'UserId':Number(_0x17e939[_0x8747('0x54')][_0x8747('0x6a')][_0x45f40e]),'FaxQueueId':Number(_0x17e939[_0x8747('0x51')]['id'])});}return _0x2f9ab6;});}})[_0x8747('0x2e')](respondWithResult(_0xd232d4,null))['catch'](handleError(_0xd232d4,null));};exports[_0x8747('0x87')]=function(_0x2b2611,_0x20602a,_0x3db40a){return db[_0x8747('0x36')][_0x8747('0x57')]({'where':{'id':_0x2b2611[_0x8747('0x51')]['id']}})['then'](handleEntityNotFound(_0x20602a,null))['then'](function(_0x36aaf2){if(_0x36aaf2){return _0x36aaf2[_0x8747('0x87')](_0x2b2611[_0x8747('0x3a')][_0x8747('0x6a')])[_0x8747('0x2e')](function(){if(_[_0x8747('0x8a')](_0x2b2611[_0x8747('0x3a')][_0x8747('0x6a')])){for(var _0x26ec05=0x0;_0x26ec05<_0x2b2611[_0x8747('0x3a')][_0x8747('0x6a')][_0x8747('0x40')];_0x26ec05+=0x1){socket[_0x8747('0x77')](_0x8747('0x88'),{'UserId':Number(_0x2b2611[_0x8747('0x3a')]['ids'][_0x26ec05]),'FaxQueueId':Number(_0x2b2611[_0x8747('0x51')]['id'])});}}else{socket[_0x8747('0x77')]('userFaxQueue:remove',{'UserId':Number(_0x2b2611[_0x8747('0x3a')][_0x8747('0x6a')]),'FaxQueueId':Number(_0x2b2611[_0x8747('0x51')]['id'])});}});}})[_0x8747('0x2e')](respondWithStatusCode(_0x20602a,null))['catch'](handleError(_0x20602a,null));};exports['getAgents']=function(_0x12b34d,_0x412a1a,_0x164e77){var _0x1e7e71={};var _0x85540a={};var _0x3edd60;var _0x371a86;return db['FaxQueue']['findOne']({'where':{'id':_0x12b34d[_0x8747('0x51')]['id']}})[_0x8747('0x2e')](handleEntityNotFound(_0x412a1a,null))[_0x8747('0x2e')](function(_0x4775e0){if(_0x4775e0){_0x3edd60=_0x4775e0;_0x85540a[_0x8747('0x38')]=_[_0x8747('0x3b')](db[_0x8747('0x5e')][_0x8747('0x52')]);_0x85540a[_0x8747('0x3a')]=_[_0x8747('0x3b')](_0x12b34d[_0x8747('0x3a')]);_0x85540a[_0x8747('0x3c')]=_[_0x8747('0x3d')](_0x85540a[_0x8747('0x38')],_0x85540a[_0x8747('0x3a')]);_0x1e7e71[_0x8747('0x3e')]=_[_0x8747('0x3d')](_0x85540a[_0x8747('0x38')],qs['fields'](_0x12b34d[_0x8747('0x3a')][_0x8747('0x3f')]));_0x1e7e71[_0x8747('0x3e')]=_0x1e7e71['attributes'][_0x8747('0x40')]?_0x1e7e71[_0x8747('0x3e')]:_0x85540a['model'];_0x1e7e71[_0x8747('0x43')]=qs[_0x8747('0x44')](_0x12b34d['query']['sort']);_0x1e7e71['where']=qs['filters'](_[_0x8747('0x46')](_0x12b34d[_0x8747('0x3a')],_0x85540a[_0x8747('0x3c')]));if(_0x12b34d['query'][_0x8747('0x4a')]){_0x1e7e71[_0x8747('0x45')]=_['merge'](_0x1e7e71[_0x8747('0x45')],{'$or':_[_0x8747('0x35')](_0x1e7e71[_0x8747('0x3e')],function(_0x1467b0){var _0x5d8fd9={};_0x5d8fd9[_0x1467b0]={'$like':'%'+_0x12b34d['query'][_0x8747('0x4a')]+'%'};return _0x5d8fd9;})});}_0x1e7e71=_[_0x8747('0x47')]({},_0x1e7e71,_0x12b34d[_0x8747('0x4b')]);return _0x3edd60[_0x8747('0x8b')](_0x1e7e71);}})['then'](function(_0x293644){if(_0x293644){_0x371a86=_0x293644[_0x8747('0x40')];if(!_0x12b34d[_0x8747('0x3a')]['hasOwnProperty'](_0x8747('0x42'))){_0x1e7e71[_0x8747('0x27')]=qs['limit'](_0x12b34d['query']['limit']);_0x1e7e71[_0x8747('0x25')]=qs['offset'](_0x12b34d['query'][_0x8747('0x25')]);}return _0x3edd60[_0x8747('0x8b')](_0x1e7e71);}})[_0x8747('0x2e')](function(_0x4625fb){if(_0x4625fb){return _0x4625fb?{'count':_0x371a86,'rows':_0x4625fb}:null;}})[_0x8747('0x2e')](respondWithResult(_0x412a1a,null))[_0x8747('0x4f')](handleError(_0x412a1a,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 8a1e4f3..f1c2d78 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 _0x4d5e=['hook','exports','events','../../mysqldb','FaxQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x45c43f,_0x343b96){var _0x39fc3e=function(_0x492eb9){while(--_0x492eb9){_0x45c43f['push'](_0x45c43f['shift']());}};_0x39fc3e(++_0x343b96);}(_0x4d5e,0x1db));var _0xe4d5=function(_0xf03404,_0x54b2ad){_0xf03404=_0xf03404-0x0;var _0x10eb4e=_0x4d5e[_0xf03404];return _0x10eb4e;};'use strict';var EventEmitter=require(_0xe4d5('0x0'));var FaxQueue=require(_0xe4d5('0x1'))['db'][_0xe4d5('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xe4d5('0x3')](0x0);var events={'afterCreate':_0xe4d5('0x4'),'afterUpdate':_0xe4d5('0x5'),'afterDestroy':_0xe4d5('0x6')};function emitEvent(_0x501582){return function(_0x2316ad,_0x3d9334,_0x50ec5a){FaxQueueEvents['emit'](_0x501582+':'+_0x2316ad['id'],_0x2316ad);FaxQueueEvents[_0xe4d5('0x7')](_0x501582,_0x2316ad);_0x50ec5a(null);};}for(var e in events){if(events[_0xe4d5('0x8')](e)){var event=events[e];FaxQueue[_0xe4d5('0x9')](e,emitEvent(event));}}module[_0xe4d5('0xa')]=FaxQueueEvents; \ No newline at end of file +var _0x82db=['emit','hasOwnProperty','hook','../../mysqldb','FaxQueue','setMaxListeners','remove'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x82db,0x145));var _0xb82d=function(_0x5a949e,_0x21c7f8){_0x5a949e=_0x5a949e-0x0;var _0x216033=_0x82db[_0x5a949e];return _0x216033;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0xb82d('0x0'))['db'][_0xb82d('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xb82d('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xb82d('0x3')};function emitEvent(_0x59a31d){return function(_0x3eb1e6,_0x129c23,_0x285826){FaxQueueEvents[_0xb82d('0x4')](_0x59a31d+':'+_0x3eb1e6['id'],_0x3eb1e6);FaxQueueEvents[_0xb82d('0x4')](_0x59a31d,_0x3eb1e6);_0x285826(null);};}for(var e in events){if(events[_0xb82d('0x5')](e)){var event=events[e];FaxQueue[_0xb82d('0x6')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 02d8c86..869a0e1 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 _0x1d79=['moment','request-promise','path','rimraf','./faxQueue.attributes','exports','define','lodash','util','../../config/logger'];(function(_0x327f7d,_0x186a9a){var _0x3e4046=function(_0x176ce8){while(--_0x176ce8){_0x327f7d['push'](_0x327f7d['shift']());}};_0x3e4046(++_0x186a9a);}(_0x1d79,0x18d));var _0x91d7=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1d79[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x91d7('0x0'));var util=require(_0x91d7('0x1'));var logger=require(_0x91d7('0x2'))('api');var moment=require(_0x91d7('0x3'));var BPromise=require('bluebird');var rp=require(_0x91d7('0x4'));var fs=require('fs');var path=require(_0x91d7('0x5'));var rimraf=require(_0x91d7('0x6'));var config=require('../../config/environment');var attributes=require(_0x91d7('0x7'));module[_0x91d7('0x8')]=function(_0x265cfa,_0x49a792){return _0x265cfa[_0x91d7('0x9')]('FaxQueue',attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb546=['lodash','util','../../config/logger','api','moment','path','rimraf','exports','define','FaxQueue'];(function(_0x59943d,_0x2e751b){var _0x46ace9=function(_0xfbd5f2){while(--_0xfbd5f2){_0x59943d['push'](_0x59943d['shift']());}};_0x46ace9(++_0x2e751b);}(_0xb546,0x6e));var _0x6b54=function(_0x2e44cf,_0x16f684){_0x2e44cf=_0x2e44cf-0x0;var _0x361268=_0xb546[_0x2e44cf];return _0x361268;};'use strict';var _=require(_0x6b54('0x0'));var util=require(_0x6b54('0x1'));var logger=require(_0x6b54('0x2'))(_0x6b54('0x3'));var moment=require(_0x6b54('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6b54('0x5'));var rimraf=require(_0x6b54('0x6'));var config=require('../../config/environment');var attributes=require('./faxQueue.attributes');module[_0x6b54('0x7')]=function(_0x1d9ec7,_0x38cb75){return _0x1d9ec7[_0x6b54('0x8')](_0x6b54('0x9'),attributes,{'tableName':'fax_queues','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 66424c4..c09cba5 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 _0x516a=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetFaxQueue','FaxQueue','options','raw','where','include','map','model','attributes','debug','stringify','find','ShowFaxQueue','lodash','util','moment'];(function(_0x461a42,_0x282c5b){var _0x38a8a5=function(_0x44d2ad){while(--_0x44d2ad){_0x461a42['push'](_0x461a42['shift']());}};_0x38a8a5(++_0x282c5b);}(_0x516a,0x1cb));var _0xa516=function(_0x5a2837,_0x67be2d){_0x5a2837=_0x5a2837-0x0;var _0x534f71=_0x516a[_0x5a2837];return _0x534f71;};'use strict';var _=require(_0xa516('0x0'));var util=require(_0xa516('0x1'));var moment=require(_0xa516('0x2'));var BPromise=require(_0xa516('0x3'));var rs=require(_0xa516('0x4'));var fs=require('fs');var Redis=require(_0xa516('0x5'));var db=require(_0xa516('0x6'))['db'];var utils=require(_0xa516('0x7'));var logger=require('../../config/logger')(_0xa516('0x8'));var config=require(_0xa516('0x9'));var jayson=require(_0xa516('0xa'));var client=jayson[_0xa516('0xb')][_0xa516('0xc')]({'port':0x232a});config[_0xa516('0xd')]=_[_0xa516('0xe')](config['redis'],{'host':_0xa516('0xf'),'port':0x18eb});var socket=require(_0xa516('0x10'))(new Redis(config['redis']));require('./faxQueue.socket')[_0xa516('0x11')](socket);function respondWithRpcPromise(_0x51aa7e,_0x437705,_0x1ec580){return new BPromise(function(_0x372820,_0x5129be){return client[_0xa516('0x12')](_0x51aa7e,_0x1ec580)[_0xa516('0x13')](function(_0x5c60a5){logger[_0xa516('0x14')](_0xa516('0x15'),_0x437705,_0xa516('0x16'));logger['debug'](_0xa516('0x17'),_0x437705,'request\x20sent',JSON['stringify'](_0x5c60a5));if(_0x5c60a5[_0xa516('0x18')]){if(_0x5c60a5[_0xa516('0x18')][_0xa516('0x19')]===0x1f4){logger[_0xa516('0x18')]('FaxQueue,\x20%s,\x20%s',_0x437705,_0x5c60a5['error'][_0xa516('0x1a')]);return _0x5129be(_0x5c60a5[_0xa516('0x18')][_0xa516('0x1a')]);}logger[_0xa516('0x18')]('FaxQueue,\x20%s,\x20%s',_0x437705,_0x5c60a5[_0xa516('0x18')]['message']);return _0x372820(_0x5c60a5['error'][_0xa516('0x1a')]);}else{logger[_0xa516('0x14')](_0xa516('0x15'),_0x437705,_0xa516('0x16'));_0x372820(_0x5c60a5[_0xa516('0x1b')][_0xa516('0x1a')]);}})[_0xa516('0x1c')](function(_0x1e2c29){logger['error'](_0xa516('0x15'),_0x437705,_0x1e2c29);_0x5129be(_0x1e2c29);});});}exports[_0xa516('0x1d')]=function(_0x198d2d){var _0x4d1dc7=this;return new Promise(function(_0x4fbabe,_0x17d148){return db[_0xa516('0x1e')]['findAll']({'raw':_0x198d2d[_0xa516('0x1f')]?_0x198d2d['options'][_0xa516('0x20')]===undefined?!![]:![]:!![],'where':_0x198d2d[_0xa516('0x1f')]?_0x198d2d[_0xa516('0x1f')][_0xa516('0x21')]||null:null,'attributes':_0x198d2d[_0xa516('0x1f')]?_0x198d2d[_0xa516('0x1f')]['attributes']||null:null,'limit':_0x198d2d[_0xa516('0x1f')]?_0x198d2d[_0xa516('0x1f')]['limit']||null:null,'include':_0x198d2d[_0xa516('0x1f')]?_0x198d2d[_0xa516('0x1f')][_0xa516('0x22')]?_[_0xa516('0x23')](_0x198d2d['options'][_0xa516('0x22')],function(_0x1f1ffd){return{'model':db[_0x1f1ffd[_0xa516('0x24')]],'as':_0x1f1ffd['as'],'attributes':_0x1f1ffd[_0xa516('0x25')],'include':_0x1f1ffd[_0xa516('0x22')]?_[_0xa516('0x23')](_0x1f1ffd['include'],function(_0x5810fa){return{'model':db[_0x5810fa[_0xa516('0x24')]],'as':_0x5810fa['as'],'attributes':_0x5810fa[_0xa516('0x25')],'include':_0x5810fa['include']?_['map'](_0x5810fa[_0xa516('0x22')],function(_0x6fa0c5){return{'model':db[_0x6fa0c5[_0xa516('0x24')]],'as':_0x6fa0c5['as'],'attributes':_0x6fa0c5['attributes']};}):[]};}):[]};}):[]:[]})[_0xa516('0x13')](function(_0x2bee77){logger[_0xa516('0x14')](_0xa516('0x1d'),_0x198d2d);logger[_0xa516('0x26')](_0xa516('0x1d'),_0x198d2d,JSON[_0xa516('0x27')](_0x2bee77));_0x4fbabe(_0x2bee77);})[_0xa516('0x1c')](function(_0x5168a2){logger['error'](_0xa516('0x1d'),_0x5168a2[_0xa516('0x1a')],_0x198d2d);_0x17d148(_0x4d1dc7[_0xa516('0x18')](0x1f4,_0x5168a2[_0xa516('0x1a')]));});});};exports['ShowFaxQueue']=function(_0x48cfe3){var _0x4d7c35=this;return new Promise(function(_0x596063,_0x228bc7){return db['FaxQueue'][_0xa516('0x28')]({'raw':_0x48cfe3[_0xa516('0x1f')]?_0x48cfe3[_0xa516('0x1f')][_0xa516('0x20')]===undefined?!![]:![]:!![],'where':_0x48cfe3[_0xa516('0x1f')]?_0x48cfe3[_0xa516('0x1f')][_0xa516('0x21')]||null:null,'attributes':_0x48cfe3[_0xa516('0x1f')]?_0x48cfe3[_0xa516('0x1f')][_0xa516('0x25')]||null:null,'include':_0x48cfe3[_0xa516('0x1f')]?_0x48cfe3[_0xa516('0x1f')][_0xa516('0x22')]?_[_0xa516('0x23')](_0x48cfe3[_0xa516('0x1f')][_0xa516('0x22')],function(_0x24f00e){return{'model':db[_0x24f00e[_0xa516('0x24')]],'as':_0x24f00e['as'],'attributes':_0x24f00e[_0xa516('0x25')],'include':_0x24f00e['include']?_['map'](_0x24f00e[_0xa516('0x22')],function(_0x224b04){return{'model':db[_0x224b04[_0xa516('0x24')]],'as':_0x224b04['as'],'attributes':_0x224b04[_0xa516('0x25')],'include':_0x224b04[_0xa516('0x22')]?_[_0xa516('0x23')](_0x224b04['include'],function(_0x4371b4){return{'model':db[_0x4371b4[_0xa516('0x24')]],'as':_0x4371b4['as'],'attributes':_0x4371b4['attributes']};}):[]};}):[]};}):[]:[]})[_0xa516('0x13')](function(_0x1c7057){logger[_0xa516('0x14')](_0xa516('0x29'),_0x48cfe3);logger[_0xa516('0x26')](_0xa516('0x29'),_0x48cfe3,JSON[_0xa516('0x27')](_0x1c7057));_0x596063(_0x1c7057);})[_0xa516('0x1c')](function(_0x414ac3){logger[_0xa516('0x18')](_0xa516('0x29'),_0x414ac3[_0xa516('0x1a')],_0x48cfe3);_0x228bc7(_0x4d7c35['error'](0x1f4,_0x414ac3['message']));});});}; \ No newline at end of file +var _0xba00=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','GetFaxQueue','findAll','options','where','attributes','limit','map','include','model','stringify','ShowFaxQueue','FaxQueue','raw'];(function(_0x57c72c,_0x328cda){var _0x49464b=function(_0x2c0368){while(--_0x2c0368){_0x57c72c['push'](_0x57c72c['shift']());}};_0x49464b(++_0x328cda);}(_0xba00,0x1d9));var _0x0ba0=function(_0x9dc489,_0x1b2f03){_0x9dc489=_0x9dc489-0x0;var _0x557f6e=_0xba00[_0x9dc489];return _0x557f6e;};'use strict';var _=require(_0x0ba0('0x0'));var util=require(_0x0ba0('0x1'));var moment=require(_0x0ba0('0x2'));var BPromise=require(_0x0ba0('0x3'));var rs=require(_0x0ba0('0x4'));var fs=require('fs');var Redis=require(_0x0ba0('0x5'));var db=require(_0x0ba0('0x6'))['db'];var utils=require(_0x0ba0('0x7'));var logger=require(_0x0ba0('0x8'))(_0x0ba0('0x9'));var config=require(_0x0ba0('0xa'));var jayson=require(_0x0ba0('0xb'));var client=jayson[_0x0ba0('0xc')][_0x0ba0('0xd')]({'port':0x232a});config[_0x0ba0('0xe')]=_[_0x0ba0('0xf')](config[_0x0ba0('0xe')],{'host':_0x0ba0('0x10'),'port':0x18eb});var socket=require(_0x0ba0('0x11'))(new Redis(config['redis']));require('./faxQueue.socket')[_0x0ba0('0x12')](socket);function respondWithRpcPromise(_0xab0583,_0xb10b0e,_0x4f2818){return new BPromise(function(_0x3e3d1c,_0x1dc69e){return client[_0x0ba0('0x13')](_0xab0583,_0x4f2818)[_0x0ba0('0x14')](function(_0x3b4cbc){logger['info'](_0x0ba0('0x15'),_0xb10b0e,_0x0ba0('0x16'));logger[_0x0ba0('0x17')](_0x0ba0('0x18'),_0xb10b0e,_0x0ba0('0x16'),JSON['stringify'](_0x3b4cbc));if(_0x3b4cbc[_0x0ba0('0x19')]){if(_0x3b4cbc[_0x0ba0('0x19')][_0x0ba0('0x1a')]===0x1f4){logger['error'](_0x0ba0('0x15'),_0xb10b0e,_0x3b4cbc[_0x0ba0('0x19')][_0x0ba0('0x1b')]);return _0x1dc69e(_0x3b4cbc[_0x0ba0('0x19')][_0x0ba0('0x1b')]);}logger['error'](_0x0ba0('0x15'),_0xb10b0e,_0x3b4cbc[_0x0ba0('0x19')][_0x0ba0('0x1b')]);return _0x3e3d1c(_0x3b4cbc[_0x0ba0('0x19')][_0x0ba0('0x1b')]);}else{logger[_0x0ba0('0x1c')]('FaxQueue,\x20%s,\x20%s',_0xb10b0e,_0x0ba0('0x16'));_0x3e3d1c(_0x3b4cbc['result'][_0x0ba0('0x1b')]);}})[_0x0ba0('0x1d')](function(_0x2faa1b){logger[_0x0ba0('0x19')](_0x0ba0('0x15'),_0xb10b0e,_0x2faa1b);_0x1dc69e(_0x2faa1b);});});}exports[_0x0ba0('0x1e')]=function(_0x556d17){var _0x15d8b6=this;return new Promise(function(_0xe39e66,_0x952c9f){return db['FaxQueue'][_0x0ba0('0x1f')]({'raw':_0x556d17['options']?_0x556d17[_0x0ba0('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x556d17[_0x0ba0('0x20')]?_0x556d17[_0x0ba0('0x20')][_0x0ba0('0x21')]||null:null,'attributes':_0x556d17[_0x0ba0('0x20')]?_0x556d17['options'][_0x0ba0('0x22')]||null:null,'limit':_0x556d17[_0x0ba0('0x20')]?_0x556d17[_0x0ba0('0x20')][_0x0ba0('0x23')]||null:null,'include':_0x556d17[_0x0ba0('0x20')]?_0x556d17[_0x0ba0('0x20')]['include']?_[_0x0ba0('0x24')](_0x556d17[_0x0ba0('0x20')][_0x0ba0('0x25')],function(_0x2099da){return{'model':db[_0x2099da[_0x0ba0('0x26')]],'as':_0x2099da['as'],'attributes':_0x2099da[_0x0ba0('0x22')],'include':_0x2099da[_0x0ba0('0x25')]?_['map'](_0x2099da[_0x0ba0('0x25')],function(_0x80323a){return{'model':db[_0x80323a[_0x0ba0('0x26')]],'as':_0x80323a['as'],'attributes':_0x80323a['attributes'],'include':_0x80323a[_0x0ba0('0x25')]?_['map'](_0x80323a['include'],function(_0x4c88a9){return{'model':db[_0x4c88a9[_0x0ba0('0x26')]],'as':_0x4c88a9['as'],'attributes':_0x4c88a9[_0x0ba0('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2b0afb){logger[_0x0ba0('0x1c')]('GetFaxQueue',_0x556d17);logger[_0x0ba0('0x17')](_0x0ba0('0x1e'),_0x556d17,JSON[_0x0ba0('0x27')](_0x2b0afb));_0xe39e66(_0x2b0afb);})[_0x0ba0('0x1d')](function(_0x3c82c2){logger[_0x0ba0('0x19')]('GetFaxQueue',_0x3c82c2[_0x0ba0('0x1b')],_0x556d17);_0x952c9f(_0x15d8b6[_0x0ba0('0x19')](0x1f4,_0x3c82c2[_0x0ba0('0x1b')]));});});};exports[_0x0ba0('0x28')]=function(_0x21b6ec){var _0x486528=this;return new Promise(function(_0x4d3cb1,_0x4dc6bd){return db[_0x0ba0('0x29')]['find']({'raw':_0x21b6ec[_0x0ba0('0x20')]?_0x21b6ec[_0x0ba0('0x20')][_0x0ba0('0x2a')]===undefined?!![]:![]:!![],'where':_0x21b6ec[_0x0ba0('0x20')]?_0x21b6ec[_0x0ba0('0x20')][_0x0ba0('0x21')]||null:null,'attributes':_0x21b6ec[_0x0ba0('0x20')]?_0x21b6ec[_0x0ba0('0x20')][_0x0ba0('0x22')]||null:null,'include':_0x21b6ec[_0x0ba0('0x20')]?_0x21b6ec[_0x0ba0('0x20')][_0x0ba0('0x25')]?_[_0x0ba0('0x24')](_0x21b6ec[_0x0ba0('0x20')]['include'],function(_0x317d4e){return{'model':db[_0x317d4e[_0x0ba0('0x26')]],'as':_0x317d4e['as'],'attributes':_0x317d4e[_0x0ba0('0x22')],'include':_0x317d4e[_0x0ba0('0x25')]?_['map'](_0x317d4e[_0x0ba0('0x25')],function(_0x5d81c4){return{'model':db[_0x5d81c4[_0x0ba0('0x26')]],'as':_0x5d81c4['as'],'attributes':_0x5d81c4['attributes'],'include':_0x5d81c4[_0x0ba0('0x25')]?_[_0x0ba0('0x24')](_0x5d81c4[_0x0ba0('0x25')],function(_0x29b616){return{'model':db[_0x29b616[_0x0ba0('0x26')]],'as':_0x29b616['as'],'attributes':_0x29b616[_0x0ba0('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0ba0('0x14')](function(_0xc2c0ef){logger['info']('ShowFaxQueue',_0x21b6ec);logger[_0x0ba0('0x17')]('ShowFaxQueue',_0x21b6ec,JSON[_0x0ba0('0x27')](_0xc2c0ef));_0x4d3cb1(_0xc2c0ef);})[_0x0ba0('0x1d')](function(_0x5e2d6f){logger[_0x0ba0('0x19')]('ShowFaxQueue',_0x5e2d6f[_0x0ba0('0x1b')],_0x21b6ec);_0x4dc6bd(_0x486528[_0x0ba0('0x19')](0x1f4,_0x5e2d6f[_0x0ba0('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index f0c00bc..3fb091a 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 _0x2411=['faxQueue:','save','remove','update','removeListener','register'];(function(_0x4dee16,_0x599bf4){var _0xe688a9=function(_0x2a6a2a){while(--_0x2a6a2a){_0x4dee16['push'](_0x4dee16['shift']());}};_0xe688a9(++_0x599bf4);}(_0x2411,0x175));var _0x1241=function(_0x4e93a9,_0x413f30){_0x4e93a9=_0x4e93a9-0x0;var _0x43013c=_0x2411[_0x4e93a9];return _0x43013c;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0x1241('0x0'),_0x1241('0x1'),_0x1241('0x2')];function createListener(_0x22f54f,_0x32eeb2){return function(_0x28dac6){_0x32eeb2['emit'](_0x22f54f,_0x28dac6);};}function removeListener(_0x151bae,_0x88409d){return function(){FaxQueueEvents[_0x1241('0x3')](_0x151bae,_0x88409d);};}exports[_0x1241('0x4')]=function(_0x3b2074){for(var _0x1f9d02=0x0,_0x358ebb=events['length'];_0x1f9d02<_0x358ebb;_0x1f9d02++){var _0x309200=events[_0x1f9d02];var _0x136400=createListener(_0x1241('0x5')+_0x309200,_0x3b2074);FaxQueueEvents['on'](_0x309200,_0x136400);}}; \ No newline at end of file +var _0x3631=['length','faxQueue:','save','remove','emit','removeListener','register'];(function(_0x328b1c,_0xec0b4f){var _0x4dbeaa=function(_0x432519){while(--_0x432519){_0x328b1c['push'](_0x328b1c['shift']());}};_0x4dbeaa(++_0xec0b4f);}(_0x3631,0x1ec));var _0x1363=function(_0x1c31ff,_0x4d7927){_0x1c31ff=_0x1c31ff-0x0;var _0x1c657a=_0x3631[_0x1c31ff];return _0x1c657a;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0x1363('0x0'),_0x1363('0x1'),'update'];function createListener(_0x4cb4e9,_0x504469){return function(_0x193fd1){_0x504469[_0x1363('0x2')](_0x4cb4e9,_0x193fd1);};}function removeListener(_0x42983b,_0x3ed418){return function(){FaxQueueEvents[_0x1363('0x3')](_0x42983b,_0x3ed418);};}exports[_0x1363('0x4')]=function(_0x89ef87){for(var _0x110741=0x0,_0x2de635=events[_0x1363('0x5')];_0x110741<_0x2de635;_0x110741++){var _0x567f04=events[_0x110741];var _0x1e9c0d=createListener(_0x1363('0x6')+_0x567f04,_0x89ef87);FaxQueueEvents['on'](_0x567f04,_0x1e9c0d);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index f4ad5d9..a42a5b3 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 _0x9a5a=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','index','/describe','isAuthenticated','describe','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','addTeams','addAgents','put','/:id','delete','removeTeams','exports','multer','util'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x9a5a,0x194));var _0xa9a5=function(_0x181f5f,_0x1f4572){_0x181f5f=_0x181f5f-0x0;var _0x9861c0=_0x9a5a[_0x181f5f];return _0x9861c0;};'use strict';var multer=require(_0xa9a5('0x0'));var util=require(_0xa9a5('0x1'));var path=require(_0xa9a5('0x2'));var timeout=require(_0xa9a5('0x3'));var express=require(_0xa9a5('0x4'));var router=express['Router']();var fs_extra=require(_0xa9a5('0x5'));var auth=require(_0xa9a5('0x6'));var interaction=require(_0xa9a5('0x7'));var config=require(_0xa9a5('0x8'));var controller=require(_0xa9a5('0x9'));router[_0xa9a5('0xa')]('/',auth['isAuthenticated'](),controller[_0xa9a5('0xb')]);router[_0xa9a5('0xa')](_0xa9a5('0xc'),auth[_0xa9a5('0xd')](),controller[_0xa9a5('0xe')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xa9a5('0xf')]);router[_0xa9a5('0xa')](_0xa9a5('0x10'),auth[_0xa9a5('0xd')](),controller[_0xa9a5('0x11')]);router[_0xa9a5('0xa')](_0xa9a5('0x12'),auth['isAuthenticated'](),controller['getTeams']);router['get'](_0xa9a5('0x13'),auth[_0xa9a5('0xd')](),controller[_0xa9a5('0x14')]);router[_0xa9a5('0x15')]('/',auth[_0xa9a5('0xd')](),controller['create']);router[_0xa9a5('0x15')](_0xa9a5('0x12'),auth[_0xa9a5('0xd')](),controller[_0xa9a5('0x16')]);router[_0xa9a5('0x15')](_0xa9a5('0x13'),auth['isAuthenticated'](),controller[_0xa9a5('0x17')]);router[_0xa9a5('0x18')](_0xa9a5('0x19'),auth[_0xa9a5('0xd')](),controller['update']);router[_0xa9a5('0x1a')](_0xa9a5('0x19'),auth[_0xa9a5('0xd')](),controller['destroy']);router[_0xa9a5('0x1a')]('/:id/teams',auth['isAuthenticated'](),controller[_0xa9a5('0x1b')]);router[_0xa9a5('0x1a')]('/:id/users',auth[_0xa9a5('0xd')](),controller['removeAgents']);module[_0xa9a5('0x1c')]=router; \ No newline at end of file +var _0x794b=['/describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeAgents','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x4dd7d7,_0x3eab2e){var _0x1abd98=function(_0x295831){while(--_0x295831){_0x4dd7d7['push'](_0x4dd7d7['shift']());}};_0x1abd98(++_0x3eab2e);}(_0x794b,0x1c2));var _0xb794=function(_0x52f82c,_0x201c03){_0x52f82c=_0x52f82c-0x0;var _0x329918=_0x794b[_0x52f82c];return _0x329918;};'use strict';var multer=require(_0xb794('0x0'));var util=require(_0xb794('0x1'));var path=require('path');var timeout=require(_0xb794('0x2'));var express=require(_0xb794('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb794('0x4'));var interaction=require(_0xb794('0x5'));var config=require('../../config/environment');var controller=require('./faxQueue.controller');router[_0xb794('0x6')]('/',auth[_0xb794('0x7')](),controller[_0xb794('0x8')]);router[_0xb794('0x6')](_0xb794('0x9'),auth[_0xb794('0x7')](),controller['describe']);router[_0xb794('0x6')](_0xb794('0xa'),auth[_0xb794('0x7')](),controller[_0xb794('0xb')]);router[_0xb794('0x6')](_0xb794('0xc'),auth[_0xb794('0x7')](),controller[_0xb794('0xd')]);router[_0xb794('0x6')](_0xb794('0xe'),auth[_0xb794('0x7')](),controller[_0xb794('0xf')]);router[_0xb794('0x6')](_0xb794('0x10'),auth[_0xb794('0x7')](),controller[_0xb794('0x11')]);router[_0xb794('0x12')]('/',auth[_0xb794('0x7')](),controller[_0xb794('0x13')]);router[_0xb794('0x12')](_0xb794('0xe'),auth['isAuthenticated'](),controller[_0xb794('0x14')]);router[_0xb794('0x12')](_0xb794('0x10'),auth[_0xb794('0x7')](),controller[_0xb794('0x15')]);router[_0xb794('0x16')]('/:id',auth[_0xb794('0x7')](),controller[_0xb794('0x17')]);router['delete'](_0xb794('0xa'),auth[_0xb794('0x7')](),controller['destroy']);router[_0xb794('0x18')](_0xb794('0xe'),auth[_0xb794('0x7')](),controller['removeTeams']);router[_0xb794('0x18')](_0xb794('0x10'),auth['isAuthenticated'](),controller[_0xb794('0x19')]);module[_0xb794('0x1a')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 41fa267..2871252 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 _0x42b1=['STRING','DATE','sequelize'];(function(_0x53e3de,_0x13da7b){var _0x7b905b=function(_0x29b56a){while(--_0x29b56a){_0x53e3de['push'](_0x53e3de['shift']());}};_0x7b905b(++_0x13da7b);}(_0x42b1,0x164));var _0x142b=function(_0x4ddd1c,_0xad744c){_0x4ddd1c=_0x4ddd1c-0x0;var _0x3842c5=_0x42b1[_0x4ddd1c];return _0x3842c5;};'use strict';var moment=require('moment');var Sequelize=require(_0x142b('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x142b('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x142b('0x2')]},'acceptAt':{'type':Sequelize[_0x142b('0x2')]},'exitAt':{'type':Sequelize[_0x142b('0x2')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x36f3=['STRING','DATE','sequelize','exports'];(function(_0x2b79ae,_0x68f40){var _0x267e8a=function(_0x1da99c){while(--_0x1da99c){_0x2b79ae['push'](_0x2b79ae['shift']());}};_0x267e8a(++_0x68f40);}(_0x36f3,0xe6));var _0x336f=function(_0x4f6f84,_0x31e197){_0x4f6f84=_0x4f6f84-0x0;var _0x20d989=_0x36f3[_0x4f6f84];return _0x20d989;};'use strict';var moment=require('moment');var Sequelize=require(_0x336f('0x0'));module[_0x336f('0x1')]={'uniqueid':{'type':Sequelize[_0x336f('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x336f('0x2')]},'joinAt':{'type':Sequelize[_0x336f('0x3')]},'leaveAt':{'type':Sequelize[_0x336f('0x3')]},'acceptAt':{'type':Sequelize[_0x336f('0x3')]},'exitAt':{'type':Sequelize[_0x336f('0x3')]},'reason':{'type':Sequelize[_0x336f('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 851057c..fb8b450 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 _0xa1b9=['update','then','destroy','stack','name','send','index','map','FaxQueueReport','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','rawAttributes','find','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','reject','save'];(function(_0x3b03a5,_0x3dcd9b){var _0x503d2c=function(_0x35e566){while(--_0x35e566){_0x3b03a5['push'](_0x3b03a5['shift']());}};_0x503d2c(++_0x3dcd9b);}(_0xa1b9,0x71));var _0x9a1b=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa1b9[_0x5b78e8];return _0xf2c321;};'use strict';var emlformat=require(_0x9a1b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9a1b('0x1'));var jsonpatch=require(_0x9a1b('0x2'));var rp=require(_0x9a1b('0x3'));var moment=require(_0x9a1b('0x4'));var BPromise=require(_0x9a1b('0x5'));var Mustache=require(_0x9a1b('0x6'));var util=require(_0x9a1b('0x7'));var path=require('path');var sox=require(_0x9a1b('0x8'));var csv=require(_0x9a1b('0x9'));var ejs=require(_0x9a1b('0xa'));var fs=require('fs');var fs_extra=require(_0x9a1b('0xb'));var _=require('lodash');var squel=require(_0x9a1b('0xc'));var crypto=require('crypto');var jsforce=require(_0x9a1b('0xd'));var deskjs=require(_0x9a1b('0xe'));var toCsv=require(_0x9a1b('0x9'));var querystring=require(_0x9a1b('0xf'));var Papa=require(_0x9a1b('0x10'));var Redis=require('ioredis');var authService=require(_0x9a1b('0x11'));var qs=require(_0x9a1b('0x12'));var as=require(_0x9a1b('0x13'));var hardwareService=require(_0x9a1b('0x14'));var logger=require(_0x9a1b('0x15'))(_0x9a1b('0x16'));var utils=require(_0x9a1b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x9a1b('0x18'));var db=require(_0x9a1b('0x19'))['db'];function respondWithStatusCode(_0x27062b,_0x5ee9d3){_0x5ee9d3=_0x5ee9d3||0xcc;return function(_0x1d016d){if(_0x1d016d){return _0x27062b[_0x9a1b('0x1a')](_0x5ee9d3);}return _0x27062b[_0x9a1b('0x1b')](_0x5ee9d3)[_0x9a1b('0x1c')]();};}function respondWithResult(_0x390ad9,_0x157b6f){_0x157b6f=_0x157b6f||0xc8;return function(_0x3fe388){if(_0x3fe388){return _0x390ad9[_0x9a1b('0x1b')](_0x157b6f)[_0x9a1b('0x1d')](_0x3fe388);}};}function respondWithFilteredResult(_0x101622,_0x5c397f){return function(_0x357cd9){if(_0x357cd9){var _0x2440fc=typeof _0x5c397f['offset']===_0x9a1b('0x1e')&&typeof _0x5c397f[_0x9a1b('0x1f')]===_0x9a1b('0x1e');var _0x1a7324=_0x357cd9[_0x9a1b('0x20')];var _0x478626=_0x2440fc?0x0:_0x5c397f[_0x9a1b('0x21')];var _0x599325=_0x2440fc?_0x357cd9[_0x9a1b('0x20')]:_0x5c397f[_0x9a1b('0x21')]+_0x5c397f[_0x9a1b('0x1f')];var _0x1f1dea;if(_0x599325>=_0x1a7324){_0x599325=_0x1a7324;_0x1f1dea=0xc8;}else{_0x1f1dea=0xce;}_0x101622[_0x9a1b('0x1b')](_0x1f1dea);return _0x101622['set'](_0x9a1b('0x22'),_0x478626+'-'+_0x599325+'/'+_0x1a7324)[_0x9a1b('0x1d')](_0x357cd9);}return null;};}function patchUpdates(_0x36c95c){return function(_0x1977a7){try{jsonpatch['apply'](_0x1977a7,_0x36c95c,!![]);}catch(_0x2ccb02){return BPromise[_0x9a1b('0x23')](_0x2ccb02);}return _0x1977a7[_0x9a1b('0x24')]();};}function saveUpdates(_0x13f828,_0x1c9ab3){return function(_0x327cac){if(_0x327cac){return _0x327cac[_0x9a1b('0x25')](_0x13f828)[_0x9a1b('0x26')](function(_0xb6b23a){return _0xb6b23a;});}return null;};}function removeEntity(_0x37971c,_0x5841c1){return function(_0x2439e9){if(_0x2439e9){return _0x2439e9[_0x9a1b('0x27')]()[_0x9a1b('0x26')](function(){_0x37971c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b0ff3,_0x52fce9){return function(_0x17704b){if(!_0x17704b){_0x3b0ff3['sendStatus'](0x194);}return _0x17704b;};}function handleError(_0x5e65ce,_0x48e736){_0x48e736=_0x48e736||0x1f4;return function(_0x432a3d){logger['error'](_0x432a3d[_0x9a1b('0x28')]);if(_0x432a3d[_0x9a1b('0x29')]){delete _0x432a3d[_0x9a1b('0x29')];}_0x5e65ce[_0x9a1b('0x1b')](_0x48e736)[_0x9a1b('0x2a')](_0x432a3d);};}exports[_0x9a1b('0x2b')]=function(_0x1c13d6,_0x1453c4){var _0x4070aa={},_0x2d9ca8={},_0x56f3e8={'count':0x0,'rows':[]};var _0x5735a4=_[_0x9a1b('0x2c')](db[_0x9a1b('0x2d')]['rawAttributes'],function(_0x14ea6b){return{'name':_0x14ea6b[_0x9a1b('0x2e')],'type':_0x14ea6b[_0x9a1b('0x2f')][_0x9a1b('0x30')]};});_0x2d9ca8[_0x9a1b('0x31')]=_[_0x9a1b('0x2c')](_0x5735a4,_0x9a1b('0x29'));_0x2d9ca8[_0x9a1b('0x32')]=_[_0x9a1b('0x33')](_0x1c13d6['query']);_0x2d9ca8[_0x9a1b('0x34')]=_['intersection'](_0x2d9ca8[_0x9a1b('0x31')],_0x2d9ca8[_0x9a1b('0x32')]);_0x4070aa[_0x9a1b('0x35')]=_[_0x9a1b('0x36')](_0x2d9ca8['model'],qs[_0x9a1b('0x37')](_0x1c13d6[_0x9a1b('0x32')][_0x9a1b('0x37')]));_0x4070aa[_0x9a1b('0x35')]=_0x4070aa[_0x9a1b('0x35')][_0x9a1b('0x38')]?_0x4070aa[_0x9a1b('0x35')]:_0x2d9ca8[_0x9a1b('0x31')];if(!_0x1c13d6[_0x9a1b('0x32')]['hasOwnProperty'](_0x9a1b('0x39'))){_0x4070aa[_0x9a1b('0x1f')]=qs[_0x9a1b('0x1f')](_0x1c13d6[_0x9a1b('0x32')][_0x9a1b('0x1f')]);_0x4070aa[_0x9a1b('0x21')]=qs[_0x9a1b('0x21')](_0x1c13d6['query'][_0x9a1b('0x21')]);}_0x4070aa[_0x9a1b('0x3a')]=qs[_0x9a1b('0x3b')](_0x1c13d6[_0x9a1b('0x32')][_0x9a1b('0x3b')]);_0x4070aa[_0x9a1b('0x3c')]=qs[_0x9a1b('0x34')](_[_0x9a1b('0x3d')](_0x1c13d6[_0x9a1b('0x32')],_0x2d9ca8['filters']),_0x5735a4);if(_0x1c13d6[_0x9a1b('0x32')][_0x9a1b('0x3e')]){_0x4070aa['where']=_[_0x9a1b('0x3f')](_0x4070aa[_0x9a1b('0x3c')],{'$or':_['map'](_0x5735a4,function(_0x47bf8e){if(_0x47bf8e['type']!==_0x9a1b('0x40')){var _0x2adbb9={};_0x2adbb9[_0x47bf8e[_0x9a1b('0x29')]]={'$like':'%'+_0x1c13d6[_0x9a1b('0x32')][_0x9a1b('0x3e')]+'%'};return _0x2adbb9;}})});}_0x4070aa=_['merge']({},_0x4070aa,_0x1c13d6[_0x9a1b('0x41')]);var _0xfa7f44={'where':_0x4070aa[_0x9a1b('0x3c')]};return db[_0x9a1b('0x2d')][_0x9a1b('0x20')](_0xfa7f44)[_0x9a1b('0x26')](function(_0x2faeeb){_0x56f3e8['count']=_0x2faeeb;if(_0x1c13d6[_0x9a1b('0x32')][_0x9a1b('0x42')]){_0x4070aa['include']=[{'all':!![]}];}return db[_0x9a1b('0x2d')][_0x9a1b('0x43')](_0x4070aa);})[_0x9a1b('0x26')](function(_0x69c499){_0x56f3e8['rows']=_0x69c499;return _0x56f3e8;})[_0x9a1b('0x26')](respondWithFilteredResult(_0x1453c4,_0x4070aa))[_0x9a1b('0x44')](handleError(_0x1453c4,null));};exports[_0x9a1b('0x45')]=function(_0x3ddcf6,_0x1863d8){var _0x18a606={'raw':!![],'where':{'id':_0x3ddcf6[_0x9a1b('0x46')]['id']}},_0x515bb8={};_0x515bb8[_0x9a1b('0x31')]=_[_0x9a1b('0x33')](db['FaxQueueReport'][_0x9a1b('0x47')]);_0x515bb8[_0x9a1b('0x32')]=_[_0x9a1b('0x33')](_0x3ddcf6[_0x9a1b('0x32')]);_0x515bb8[_0x9a1b('0x34')]=_[_0x9a1b('0x36')](_0x515bb8[_0x9a1b('0x31')],_0x515bb8['query']);_0x18a606[_0x9a1b('0x35')]=_[_0x9a1b('0x36')](_0x515bb8[_0x9a1b('0x31')],qs[_0x9a1b('0x37')](_0x3ddcf6['query'][_0x9a1b('0x37')]));_0x18a606[_0x9a1b('0x35')]=_0x18a606[_0x9a1b('0x35')][_0x9a1b('0x38')]?_0x18a606[_0x9a1b('0x35')]:_0x515bb8[_0x9a1b('0x31')];if(_0x3ddcf6[_0x9a1b('0x32')]['includeAll']){_0x18a606['include']=[{'all':!![]}];}_0x18a606=_[_0x9a1b('0x3f')]({},_0x18a606,_0x3ddcf6[_0x9a1b('0x41')]);return db['FaxQueueReport'][_0x9a1b('0x48')](_0x18a606)[_0x9a1b('0x26')](handleEntityNotFound(_0x1863d8,null))[_0x9a1b('0x26')](respondWithResult(_0x1863d8,null))['catch'](handleError(_0x1863d8,null));};exports['create']=function(_0x4a98c1,_0x31b879){return db[_0x9a1b('0x2d')]['create'](_0x4a98c1[_0x9a1b('0x49')],{})[_0x9a1b('0x26')](respondWithResult(_0x31b879,0xc9))['catch'](handleError(_0x31b879,null));};exports['update']=function(_0x23e3b8,_0x2ff4b5){if(_0x23e3b8['body']['id']){delete _0x23e3b8[_0x9a1b('0x49')]['id'];}return db[_0x9a1b('0x2d')][_0x9a1b('0x48')]({'where':{'id':_0x23e3b8[_0x9a1b('0x46')]['id']}})['then'](handleEntityNotFound(_0x2ff4b5,null))['then'](saveUpdates(_0x23e3b8['body'],null))[_0x9a1b('0x26')](respondWithResult(_0x2ff4b5,null))[_0x9a1b('0x44')](handleError(_0x2ff4b5,null));};exports[_0x9a1b('0x27')]=function(_0x3f9c17,_0x1a608a){return db[_0x9a1b('0x2d')][_0x9a1b('0x48')]({'where':{'id':_0x3f9c17[_0x9a1b('0x46')]['id']}})[_0x9a1b('0x26')](handleEntityNotFound(_0x1a608a,null))[_0x9a1b('0x26')](removeEntity(_0x1a608a,null))[_0x9a1b('0x44')](handleError(_0x1a608a,null));};exports[_0x9a1b('0x4a')]=function(_0x719389,_0x2bc22a){return db['FaxQueueReport']['describe']()[_0x9a1b('0x26')](respondWithResult(_0x2bc22a,null))[_0x9a1b('0x44')](handleError(_0x2bc22a,null));}; \ No newline at end of file +var _0x8696=['intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','show','params','keys','find','catch','create','body','update','destroy','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','stack','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','type','key','model','query','filters'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8696,0x143));var _0x6869=function(_0x5b20f1,_0x1409e4){_0x5b20f1=_0x5b20f1-0x0;var _0x4e57c5=_0x8696[_0x5b20f1];return _0x4e57c5;};'use strict';var emlformat=require(_0x6869('0x0'));var rimraf=require(_0x6869('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6869('0x2'));var rp=require('request-promise');var moment=require(_0x6869('0x3'));var BPromise=require(_0x6869('0x4'));var Mustache=require(_0x6869('0x5'));var util=require('util');var path=require(_0x6869('0x6'));var sox=require('sox');var csv=require(_0x6869('0x7'));var ejs=require(_0x6869('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6869('0x9'));var crypto=require(_0x6869('0xa'));var jsforce=require(_0x6869('0xb'));var deskjs=require(_0x6869('0xc'));var toCsv=require(_0x6869('0x7'));var querystring=require(_0x6869('0xd'));var Papa=require(_0x6869('0xe'));var Redis=require('ioredis');var authService=require(_0x6869('0xf'));var qs=require(_0x6869('0x10'));var as=require(_0x6869('0x11'));var hardwareService=require(_0x6869('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x6869('0x13'));var licenseUtil=require(_0x6869('0x14'));var db=require(_0x6869('0x15'))['db'];function respondWithStatusCode(_0x470a8d,_0x42958f){_0x42958f=_0x42958f||0xcc;return function(_0x5936ef){if(_0x5936ef){return _0x470a8d[_0x6869('0x16')](_0x42958f);}return _0x470a8d[_0x6869('0x17')](_0x42958f)['end']();};}function respondWithResult(_0xc603fc,_0x3d5c59){_0x3d5c59=_0x3d5c59||0xc8;return function(_0x1fda61){if(_0x1fda61){return _0xc603fc['status'](_0x3d5c59)[_0x6869('0x18')](_0x1fda61);}};}function respondWithFilteredResult(_0x4f943b,_0x16f86f){return function(_0x4e5705){if(_0x4e5705){var _0x143f04=typeof _0x16f86f[_0x6869('0x19')]===_0x6869('0x1a')&&typeof _0x16f86f[_0x6869('0x1b')]==='undefined';var _0x7d83d0=_0x4e5705[_0x6869('0x1c')];var _0x36da1f=_0x143f04?0x0:_0x16f86f['offset'];var _0x327094=_0x143f04?_0x4e5705[_0x6869('0x1c')]:_0x16f86f['offset']+_0x16f86f['limit'];var _0x333809;if(_0x327094>=_0x7d83d0){_0x327094=_0x7d83d0;_0x333809=0xc8;}else{_0x333809=0xce;}_0x4f943b['status'](_0x333809);return _0x4f943b[_0x6869('0x1d')](_0x6869('0x1e'),_0x36da1f+'-'+_0x327094+'/'+_0x7d83d0)['json'](_0x4e5705);}return null;};}function patchUpdates(_0x19259a){return function(_0x18b29e){try{jsonpatch['apply'](_0x18b29e,_0x19259a,!![]);}catch(_0x23d1a8){return BPromise[_0x6869('0x1f')](_0x23d1a8);}return _0x18b29e[_0x6869('0x20')]();};}function saveUpdates(_0x45c0ce,_0xb775a7){return function(_0x22c5cf){if(_0x22c5cf){return _0x22c5cf['update'](_0x45c0ce)['then'](function(_0x64583e){return _0x64583e;});}return null;};}function removeEntity(_0x1dc71e,_0x35f962){return function(_0x4e37ff){if(_0x4e37ff){return _0x4e37ff['destroy']()[_0x6869('0x21')](function(){_0x1dc71e[_0x6869('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44e798,_0x2daf47){return function(_0x1c82c6){if(!_0x1c82c6){_0x44e798['sendStatus'](0x194);}return _0x1c82c6;};}function handleError(_0x52c46d,_0x2da99d){_0x2da99d=_0x2da99d||0x1f4;return function(_0xceb447){logger['error'](_0xceb447[_0x6869('0x22')]);if(_0xceb447[_0x6869('0x23')]){delete _0xceb447[_0x6869('0x23')];}_0x52c46d[_0x6869('0x17')](_0x2da99d)[_0x6869('0x24')](_0xceb447);};}exports[_0x6869('0x25')]=function(_0x551650,_0x4825ca){var _0x39bb7e={},_0x1bfba2={},_0x138da8={'count':0x0,'rows':[]};var _0x21240f=_[_0x6869('0x26')](db[_0x6869('0x27')][_0x6869('0x28')],function(_0x4c735f){return{'name':_0x4c735f[_0x6869('0x29')],'type':_0x4c735f[_0x6869('0x2a')][_0x6869('0x2b')]};});_0x1bfba2[_0x6869('0x2c')]=_[_0x6869('0x26')](_0x21240f,_0x6869('0x23'));_0x1bfba2[_0x6869('0x2d')]=_['keys'](_0x551650['query']);_0x1bfba2[_0x6869('0x2e')]=_[_0x6869('0x2f')](_0x1bfba2[_0x6869('0x2c')],_0x1bfba2[_0x6869('0x2d')]);_0x39bb7e['attributes']=_[_0x6869('0x2f')](_0x1bfba2[_0x6869('0x2c')],qs[_0x6869('0x30')](_0x551650[_0x6869('0x2d')][_0x6869('0x30')]));_0x39bb7e[_0x6869('0x31')]=_0x39bb7e[_0x6869('0x31')][_0x6869('0x32')]?_0x39bb7e['attributes']:_0x1bfba2[_0x6869('0x2c')];if(!_0x551650[_0x6869('0x2d')][_0x6869('0x33')](_0x6869('0x34'))){_0x39bb7e[_0x6869('0x1b')]=qs['limit'](_0x551650['query'][_0x6869('0x1b')]);_0x39bb7e[_0x6869('0x19')]=qs['offset'](_0x551650[_0x6869('0x2d')]['offset']);}_0x39bb7e[_0x6869('0x35')]=qs[_0x6869('0x36')](_0x551650[_0x6869('0x2d')]['sort']);_0x39bb7e['where']=qs[_0x6869('0x2e')](_[_0x6869('0x37')](_0x551650[_0x6869('0x2d')],_0x1bfba2['filters']),_0x21240f);if(_0x551650['query'][_0x6869('0x38')]){_0x39bb7e[_0x6869('0x39')]=_[_0x6869('0x3a')](_0x39bb7e[_0x6869('0x39')],{'$or':_[_0x6869('0x26')](_0x21240f,function(_0x7cdbc6){if(_0x7cdbc6[_0x6869('0x2a')]!==_0x6869('0x3b')){var _0x3e9d04={};_0x3e9d04[_0x7cdbc6[_0x6869('0x23')]]={'$like':'%'+_0x551650[_0x6869('0x2d')][_0x6869('0x38')]+'%'};return _0x3e9d04;}})});}_0x39bb7e=_[_0x6869('0x3a')]({},_0x39bb7e,_0x551650[_0x6869('0x3c')]);var _0x28383d={'where':_0x39bb7e[_0x6869('0x39')]};return db[_0x6869('0x27')][_0x6869('0x1c')](_0x28383d)['then'](function(_0x442e75){_0x138da8[_0x6869('0x1c')]=_0x442e75;if(_0x551650[_0x6869('0x2d')][_0x6869('0x3d')]){_0x39bb7e[_0x6869('0x3e')]=[{'all':!![]}];}return db[_0x6869('0x27')]['findAll'](_0x39bb7e);})[_0x6869('0x21')](function(_0x1d223c){_0x138da8[_0x6869('0x3f')]=_0x1d223c;return _0x138da8;})['then'](respondWithFilteredResult(_0x4825ca,_0x39bb7e))['catch'](handleError(_0x4825ca,null));};exports[_0x6869('0x40')]=function(_0x56bb6d,_0x419ef2){var _0x18faae={'raw':!![],'where':{'id':_0x56bb6d[_0x6869('0x41')]['id']}},_0x462a4f={};_0x462a4f['model']=_[_0x6869('0x42')](db['FaxQueueReport'][_0x6869('0x28')]);_0x462a4f[_0x6869('0x2d')]=_[_0x6869('0x42')](_0x56bb6d[_0x6869('0x2d')]);_0x462a4f[_0x6869('0x2e')]=_[_0x6869('0x2f')](_0x462a4f[_0x6869('0x2c')],_0x462a4f[_0x6869('0x2d')]);_0x18faae[_0x6869('0x31')]=_[_0x6869('0x2f')](_0x462a4f['model'],qs[_0x6869('0x30')](_0x56bb6d[_0x6869('0x2d')]['fields']));_0x18faae['attributes']=_0x18faae[_0x6869('0x31')][_0x6869('0x32')]?_0x18faae[_0x6869('0x31')]:_0x462a4f[_0x6869('0x2c')];if(_0x56bb6d[_0x6869('0x2d')]['includeAll']){_0x18faae[_0x6869('0x3e')]=[{'all':!![]}];}_0x18faae=_[_0x6869('0x3a')]({},_0x18faae,_0x56bb6d[_0x6869('0x3c')]);return db['FaxQueueReport'][_0x6869('0x43')](_0x18faae)[_0x6869('0x21')](handleEntityNotFound(_0x419ef2,null))[_0x6869('0x21')](respondWithResult(_0x419ef2,null))[_0x6869('0x44')](handleError(_0x419ef2,null));};exports[_0x6869('0x45')]=function(_0x822aac,_0x153633){return db[_0x6869('0x27')][_0x6869('0x45')](_0x822aac[_0x6869('0x46')],{})[_0x6869('0x21')](respondWithResult(_0x153633,0xc9))[_0x6869('0x44')](handleError(_0x153633,null));};exports[_0x6869('0x47')]=function(_0x50719c,_0x1b8109){if(_0x50719c[_0x6869('0x46')]['id']){delete _0x50719c[_0x6869('0x46')]['id'];}return db['FaxQueueReport'][_0x6869('0x43')]({'where':{'id':_0x50719c[_0x6869('0x41')]['id']}})['then'](handleEntityNotFound(_0x1b8109,null))['then'](saveUpdates(_0x50719c[_0x6869('0x46')],null))[_0x6869('0x21')](respondWithResult(_0x1b8109,null))['catch'](handleError(_0x1b8109,null));};exports[_0x6869('0x48')]=function(_0x1f7fc0,_0x5d3ba4){return db[_0x6869('0x27')][_0x6869('0x43')]({'where':{'id':_0x1f7fc0[_0x6869('0x41')]['id']}})[_0x6869('0x21')](handleEntityNotFound(_0x5d3ba4,null))[_0x6869('0x21')](removeEntity(_0x5d3ba4,null))[_0x6869('0x44')](handleError(_0x5d3ba4,null));};exports[_0x6869('0x49')]=function(_0x3d640d,_0x2d5c08){return db[_0x6869('0x27')][_0x6869('0x49')]()[_0x6869('0x21')](respondWithResult(_0x2d5c08,null))[_0x6869('0x44')](handleError(_0x2d5c08,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 1f6aa73..dfc0721 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 _0xe14b=['bluebird','path','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','lodash','util','moment'];(function(_0x2ee3b9,_0x201d1b){var _0xd2e6b2=function(_0x158043){while(--_0x158043){_0x2ee3b9['push'](_0x2ee3b9['shift']());}};_0xd2e6b2(++_0x201d1b);}(_0xe14b,0x93));var _0xbe14=function(_0x1c8fb1,_0x5089c6){_0x1c8fb1=_0x1c8fb1-0x0;var _0x16df76=_0xe14b[_0x1c8fb1];return _0x16df76;};'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 +var _0x5fab=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue','uniqueid','lodash','util','api'];(function(_0x11e35d,_0x55ad07){var _0x308818=function(_0x48c737){while(--_0x48c737){_0x11e35d['push'](_0x11e35d['shift']());}};_0x308818(++_0x55ad07);}(_0x5fab,0x177));var _0xb5fa=function(_0x292ecc,_0x2ed340){_0x292ecc=_0x292ecc-0x0;var _0x59aabc=_0x5fab[_0x292ecc];return _0x59aabc;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[{'name':_0xb5fa('0xd'),'fields':['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 4e0a56e..62cfe42 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 _0xd245=['../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent','stringify','error','code','FaxQueueReport,\x20%s,\x20%s','message','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','debug','UpdateFaxQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x38c21f,_0x5d27a5){var _0x2e1b03=function(_0x70cc69){while(--_0x70cc69){_0x38c21f['push'](_0x38c21f['shift']());}};_0x2e1b03(++_0x5d27a5);}(_0xd245,0xa2));var _0x5d24=function(_0x384231,_0x50be41){_0x384231=_0x384231-0x0;var _0x2480bf=_0xd245[_0x384231];return _0x2480bf;};'use strict';var _=require(_0x5d24('0x0'));var util=require(_0x5d24('0x1'));var moment=require(_0x5d24('0x2'));var BPromise=require(_0x5d24('0x3'));var rs=require(_0x5d24('0x4'));var fs=require('fs');var Redis=require(_0x5d24('0x5'));var db=require(_0x5d24('0x6'))['db'];var utils=require(_0x5d24('0x7'));var logger=require(_0x5d24('0x8'))(_0x5d24('0x9'));var config=require(_0x5d24('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x5d24('0xb')][_0x5d24('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x21e230,_0x2e5fa7,_0x4f7d91){return new BPromise(function(_0x57296c,_0x29d5b4){return client['request'](_0x21e230,_0x4f7d91)[_0x5d24('0xd')](function(_0x579438){logger[_0x5d24('0xe')]('FaxQueueReport,\x20%s,\x20%s',_0x2e5fa7,'request\x20sent');logger['debug']('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x2e5fa7,_0x5d24('0xf'),JSON[_0x5d24('0x10')](_0x579438));if(_0x579438['error']){if(_0x579438[_0x5d24('0x11')][_0x5d24('0x12')]===0x1f4){logger[_0x5d24('0x11')](_0x5d24('0x13'),_0x2e5fa7,_0x579438[_0x5d24('0x11')][_0x5d24('0x14')]);return _0x29d5b4(_0x579438[_0x5d24('0x11')][_0x5d24('0x14')]);}logger[_0x5d24('0x11')](_0x5d24('0x13'),_0x2e5fa7,_0x579438[_0x5d24('0x11')][_0x5d24('0x14')]);return _0x57296c(_0x579438[_0x5d24('0x11')]['message']);}else{logger[_0x5d24('0xe')](_0x5d24('0x13'),_0x2e5fa7,'request\x20sent');_0x57296c(_0x579438['result']['message']);}})[_0x5d24('0x15')](function(_0x56c19c){logger['error'](_0x5d24('0x13'),_0x2e5fa7,_0x56c19c);_0x29d5b4(_0x56c19c);});});}exports[_0x5d24('0x16')]=function(_0x3ed988){var _0x1d7667=this;return new Promise(function(_0x5c05ca,_0x19392f){return db[_0x5d24('0x17')][_0x5d24('0x18')](_0x3ed988[_0x5d24('0x19')],{'raw':_0x3ed988[_0x5d24('0x1a')]?_0x3ed988[_0x5d24('0x1a')][_0x5d24('0x1b')]===undefined?!![]:![]:!![]})[_0x5d24('0xd')](function(_0x21c772){logger[_0x5d24('0xe')](_0x5d24('0x16'),_0x3ed988);logger[_0x5d24('0x1c')](_0x5d24('0x16'),_0x3ed988,JSON['stringify'](_0x21c772));_0x5c05ca(_0x21c772);})[_0x5d24('0x15')](function(_0x3d58de){logger['error']('CreateFaxQueueReport',_0x3d58de[_0x5d24('0x14')],_0x3ed988);_0x19392f(_0x1d7667[_0x5d24('0x11')](0x1f4,_0x3d58de[_0x5d24('0x14')]));});});};exports[_0x5d24('0x1d')]=function(_0x512858){var _0x5ec8b1=this;return new Promise(function(_0x26c53c,_0x44b5dc){return db[_0x5d24('0x17')][_0x5d24('0x1e')](_0x512858[_0x5d24('0x19')],{'raw':_0x512858[_0x5d24('0x1a')]?_0x512858[_0x5d24('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x512858['options']?_0x512858['options'][_0x5d24('0x1f')]||null:null,'attributes':_0x512858[_0x5d24('0x1a')]?_0x512858['options'][_0x5d24('0x20')]||null:null,'limit':_0x512858['options']?_0x512858['options'][_0x5d24('0x21')]||null:null})[_0x5d24('0xd')](function(_0x1b4c35){logger['info'](_0x5d24('0x1d'),_0x512858);logger[_0x5d24('0x1c')]('UpdateFaxQueueReport',_0x512858,JSON[_0x5d24('0x10')](_0x1b4c35));_0x26c53c(_0x1b4c35);})[_0x5d24('0x15')](function(_0x451448){logger[_0x5d24('0x11')](_0x5d24('0x1d'),_0x451448[_0x5d24('0x14')],_0x512858);_0x44b5dc(_0x5ec8b1[_0x5d24('0x11')](0x1f4,_0x451448['message']));});});}; \ No newline at end of file +var _0x549b=['http','then','info','FaxQueueReport,\x20%s,\x20%s','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','CreateFaxQueueReport','FaxQueueReport','create','body','options','stringify','UpdateFaxQueueReport','update','raw','where','attributes','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0x5b71bf,_0x2728d9){var _0x3d7335=function(_0x14ac30){while(--_0x14ac30){_0x5b71bf['push'](_0x5b71bf['shift']());}};_0x3d7335(++_0x2728d9);}(_0x549b,0x142));var _0xb549=function(_0x32f9e6,_0x55ed80){_0x32f9e6=_0x32f9e6-0x0;var _0x11a5ea=_0x549b[_0x32f9e6];return _0x11a5ea;};'use strict';var _=require(_0xb549('0x0'));var util=require('util');var moment=require(_0xb549('0x1'));var BPromise=require(_0xb549('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb549('0x3'))['db'];var utils=require(_0xb549('0x4'));var logger=require(_0xb549('0x5'))(_0xb549('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb549('0x7')][_0xb549('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x312d28,_0x395f4f,_0x2973b9){return new BPromise(function(_0x487390,_0x30954b){return client['request'](_0x312d28,_0x2973b9)[_0xb549('0x9')](function(_0x5939bf){logger[_0xb549('0xa')](_0xb549('0xb'),_0x395f4f,'request\x20sent');logger[_0xb549('0xc')](_0xb549('0xd'),_0x395f4f,'request\x20sent',JSON['stringify'](_0x5939bf));if(_0x5939bf['error']){if(_0x5939bf[_0xb549('0xe')][_0xb549('0xf')]===0x1f4){logger[_0xb549('0xe')](_0xb549('0xb'),_0x395f4f,_0x5939bf[_0xb549('0xe')]['message']);return _0x30954b(_0x5939bf['error']['message']);}logger[_0xb549('0xe')](_0xb549('0xb'),_0x395f4f,_0x5939bf[_0xb549('0xe')][_0xb549('0x10')]);return _0x487390(_0x5939bf[_0xb549('0xe')][_0xb549('0x10')]);}else{logger[_0xb549('0xa')](_0xb549('0xb'),_0x395f4f,_0xb549('0x11'));_0x487390(_0x5939bf[_0xb549('0x12')][_0xb549('0x10')]);}})['catch'](function(_0x44980d){logger[_0xb549('0xe')](_0xb549('0xb'),_0x395f4f,_0x44980d);_0x30954b(_0x44980d);});});}exports[_0xb549('0x13')]=function(_0x52d9e9){var _0x354237=this;return new Promise(function(_0x1bb01c,_0x48cc6c){return db[_0xb549('0x14')][_0xb549('0x15')](_0x52d9e9[_0xb549('0x16')],{'raw':_0x52d9e9['options']?_0x52d9e9[_0xb549('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xb549('0x9')](function(_0x34b5f7){logger[_0xb549('0xa')](_0xb549('0x13'),_0x52d9e9);logger['debug'](_0xb549('0x13'),_0x52d9e9,JSON[_0xb549('0x18')](_0x34b5f7));_0x1bb01c(_0x34b5f7);})['catch'](function(_0x3a82b0){logger[_0xb549('0xe')](_0xb549('0x13'),_0x3a82b0[_0xb549('0x10')],_0x52d9e9);_0x48cc6c(_0x354237[_0xb549('0xe')](0x1f4,_0x3a82b0[_0xb549('0x10')]));});});};exports[_0xb549('0x19')]=function(_0x9ebb5a){var _0x453648=this;return new Promise(function(_0x53bbd3,_0xf7f7c4){return db[_0xb549('0x14')][_0xb549('0x1a')](_0x9ebb5a[_0xb549('0x16')],{'raw':_0x9ebb5a[_0xb549('0x17')]?_0x9ebb5a['options'][_0xb549('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x9ebb5a[_0xb549('0x17')]?_0x9ebb5a[_0xb549('0x17')][_0xb549('0x1c')]||null:null,'attributes':_0x9ebb5a[_0xb549('0x17')]?_0x9ebb5a[_0xb549('0x17')][_0xb549('0x1d')]||null:null,'limit':_0x9ebb5a[_0xb549('0x17')]?_0x9ebb5a[_0xb549('0x17')]['limit']||null:null})[_0xb549('0x9')](function(_0x4c50d0){logger[_0xb549('0xa')]('UpdateFaxQueueReport',_0x9ebb5a);logger[_0xb549('0xc')](_0xb549('0x19'),_0x9ebb5a,JSON[_0xb549('0x18')](_0x4c50d0));_0x53bbd3(_0x4c50d0);})['catch'](function(_0x3d32cb){logger['error'](_0xb549('0x19'),_0x3d32cb[_0xb549('0x10')],_0x9ebb5a);_0xf7f7c4(_0x453648[_0xb549('0xe')](0x1f4,_0x3d32cb[_0xb549('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 8d86028..162c97a 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 _0xe027=['Router','fs-extra','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/:id','post','put','update','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x1ccfd8,_0x5a3002){var _0xc05115=function(_0x177d4c){while(--_0x177d4c){_0x1ccfd8['push'](_0x1ccfd8['shift']());}};_0xc05115(++_0x5a3002);}(_0xe027,0x106));var _0x7e02=function(_0x953f37,_0x3e761e){_0x953f37=_0x953f37-0x0;var _0x1f75c6=_0xe027[_0x953f37];return _0x1f75c6;};'use strict';var multer=require(_0x7e02('0x0'));var util=require('util');var path=require(_0x7e02('0x1'));var timeout=require(_0x7e02('0x2'));var express=require(_0x7e02('0x3'));var router=express[_0x7e02('0x4')]();var fs_extra=require(_0x7e02('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7e02('0x6'));var config=require(_0x7e02('0x7'));var controller=require(_0x7e02('0x8'));router[_0x7e02('0x9')]('/',auth[_0x7e02('0xa')](),controller[_0x7e02('0xb')]);router['get']('/describe',auth[_0x7e02('0xa')](),controller['describe']);router[_0x7e02('0x9')](_0x7e02('0xc'),auth[_0x7e02('0xa')](),controller['show']);router[_0x7e02('0xd')]('/',auth[_0x7e02('0xa')](),controller['create']);router[_0x7e02('0xe')](_0x7e02('0xc'),auth[_0x7e02('0xa')](),controller[_0x7e02('0xf')]);router[_0x7e02('0x10')](_0x7e02('0xc'),auth['isAuthenticated'](),controller[_0x7e02('0x11')]);module[_0x7e02('0x12')]=router; \ No newline at end of file +var _0x1652=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','multer','util'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0x1652,0x18a));var _0x2165=function(_0x59dccc,_0x184c1c){_0x59dccc=_0x59dccc-0x0;var _0xc97bcb=_0x1652[_0x59dccc];return _0xc97bcb;};'use strict';var multer=require(_0x2165('0x0'));var util=require(_0x2165('0x1'));var path=require(_0x2165('0x2'));var timeout=require(_0x2165('0x3'));var express=require(_0x2165('0x4'));var router=express[_0x2165('0x5')]();var fs_extra=require(_0x2165('0x6'));var auth=require(_0x2165('0x7'));var interaction=require(_0x2165('0x8'));var config=require(_0x2165('0x9'));var controller=require('./faxQueueReport.controller');router[_0x2165('0xa')]('/',auth[_0x2165('0xb')](),controller[_0x2165('0xc')]);router['get'](_0x2165('0xd'),auth[_0x2165('0xb')](),controller[_0x2165('0xe')]);router[_0x2165('0xa')](_0x2165('0xf'),auth[_0x2165('0xb')](),controller[_0x2165('0x10')]);router[_0x2165('0x11')]('/',auth['isAuthenticated'](),controller[_0x2165('0x12')]);router[_0x2165('0x13')]('/:id',auth[_0x2165('0xb')](),controller[_0x2165('0x14')]);router[_0x2165('0x15')]('/:id',auth[_0x2165('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 9540583..c449085 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 _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x3f9584,_0x5ab12c){var _0x9d54c=function(_0x2882df){while(--_0x2882df){_0x3f9584['push'](_0x3f9584['shift']());}};_0x9d54c(++_0x5ab12c);}(_0xb43b,0x1b2));var _0xbb43=function(_0x462e0a,_0x1600b2){_0x462e0a=_0x462e0a-0x0;var _0x4191ab=_0xb43b[_0x462e0a];return _0x4191ab;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file +var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x1505e5,_0x5cc291){var _0x5b1dcd=function(_0x18bfe5){while(--_0x18bfe5){_0x1505e5['push'](_0x1505e5['shift']());}};_0x5b1dcd(++_0x5cc291);}(_0x34e8,0x12c));var _0x834e=function(_0x3065f3,_0xf8a1ec){_0x3065f3=_0x3065f3-0x0;var _0x4b2ea7=_0x34e8[_0x3065f3];return _0x4b2ea7;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 8a9d35e..74d478a 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 _0xbce6=['offset','set','Content-Range','apply','reject','then','destroy','error','name','send','map','FaxTransferReport','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','limit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','catch','show','params','keys','length','find','create','update','body','describe','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count'];(function(_0x49873e,_0x4eea44){var _0x59876a=function(_0x267a00){while(--_0x267a00){_0x49873e['push'](_0x49873e['shift']());}};_0x59876a(++_0x4eea44);}(_0xbce6,0xbd));var _0x6bce=function(_0x1ffd47,_0x33f9ad){_0x1ffd47=_0x1ffd47-0x0;var _0x5f3d74=_0xbce6[_0x1ffd47];return _0x5f3d74;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6bce('0x0'));var zipdir=require(_0x6bce('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6bce('0x2'));var BPromise=require(_0x6bce('0x3'));var Mustache=require(_0x6bce('0x4'));var util=require(_0x6bce('0x5'));var path=require(_0x6bce('0x6'));var sox=require('sox');var csv=require(_0x6bce('0x7'));var ejs=require(_0x6bce('0x8'));var fs=require('fs');var fs_extra=require(_0x6bce('0x9'));var _=require(_0x6bce('0xa'));var squel=require(_0x6bce('0xb'));var crypto=require(_0x6bce('0xc'));var jsforce=require(_0x6bce('0xd'));var deskjs=require(_0x6bce('0xe'));var toCsv=require(_0x6bce('0x7'));var querystring=require(_0x6bce('0xf'));var Papa=require('papaparse');var Redis=require(_0x6bce('0x10'));var authService=require(_0x6bce('0x11'));var qs=require(_0x6bce('0x12'));var as=require(_0x6bce('0x13'));var hardwareService=require(_0x6bce('0x14'));var logger=require(_0x6bce('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x6bce('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x6bce('0x17'))['db'];function respondWithStatusCode(_0x465d8a,_0x74b0b0){_0x74b0b0=_0x74b0b0||0xcc;return function(_0x1141e7){if(_0x1141e7){return _0x465d8a[_0x6bce('0x18')](_0x74b0b0);}return _0x465d8a[_0x6bce('0x19')](_0x74b0b0)[_0x6bce('0x1a')]();};}function respondWithResult(_0x35da3f,_0x4ef753){_0x4ef753=_0x4ef753||0xc8;return function(_0x377796){if(_0x377796){return _0x35da3f['status'](_0x4ef753)[_0x6bce('0x1b')](_0x377796);}};}function respondWithFilteredResult(_0x37e70b,_0x59398a){return function(_0x325fad){if(_0x325fad){var _0x2c8d38=typeof _0x59398a['offset']===_0x6bce('0x1c')&&typeof _0x59398a['limit']===_0x6bce('0x1c');var _0x57a18f=_0x325fad[_0x6bce('0x1d')];var _0x535adf=_0x2c8d38?0x0:_0x59398a[_0x6bce('0x1e')];var _0x3d380d=_0x2c8d38?_0x325fad['count']:_0x59398a[_0x6bce('0x1e')]+_0x59398a['limit'];var _0x1f3d36;if(_0x3d380d>=_0x57a18f){_0x3d380d=_0x57a18f;_0x1f3d36=0xc8;}else{_0x1f3d36=0xce;}_0x37e70b[_0x6bce('0x19')](_0x1f3d36);return _0x37e70b[_0x6bce('0x1f')](_0x6bce('0x20'),_0x535adf+'-'+_0x3d380d+'/'+_0x57a18f)['json'](_0x325fad);}return null;};}function patchUpdates(_0x4ceb7d){return function(_0x1e6f0c){try{jsonpatch[_0x6bce('0x21')](_0x1e6f0c,_0x4ceb7d,!![]);}catch(_0x56a65a){return BPromise[_0x6bce('0x22')](_0x56a65a);}return _0x1e6f0c['save']();};}function saveUpdates(_0x51341,_0x1529ad){return function(_0x22c769){if(_0x22c769){return _0x22c769['update'](_0x51341)[_0x6bce('0x23')](function(_0x591058){return _0x591058;});}return null;};}function removeEntity(_0x33a8fc,_0x465a60){return function(_0x1dcf87){if(_0x1dcf87){return _0x1dcf87[_0x6bce('0x24')]()[_0x6bce('0x23')](function(){_0x33a8fc[_0x6bce('0x19')](0xcc)[_0x6bce('0x1a')]();});}};}function handleEntityNotFound(_0x201b31,_0x5139bd){return function(_0x596040){if(!_0x596040){_0x201b31['sendStatus'](0x194);}return _0x596040;};}function handleError(_0x129d70,_0x418dcb){_0x418dcb=_0x418dcb||0x1f4;return function(_0x394e88){logger[_0x6bce('0x25')](_0x394e88['stack']);if(_0x394e88[_0x6bce('0x26')]){delete _0x394e88[_0x6bce('0x26')];}_0x129d70[_0x6bce('0x19')](_0x418dcb)[_0x6bce('0x27')](_0x394e88);};}exports['index']=function(_0x282dcd,_0x557180){var _0x253476={},_0x496fc8={},_0x52f9ea={'count':0x0,'rows':[]};var _0x1213c8=_[_0x6bce('0x28')](db[_0x6bce('0x29')]['rawAttributes'],function(_0x2579a7){return{'name':_0x2579a7[_0x6bce('0x2a')],'type':_0x2579a7[_0x6bce('0x2b')][_0x6bce('0x2c')]};});_0x496fc8[_0x6bce('0x2d')]=_[_0x6bce('0x28')](_0x1213c8,'name');_0x496fc8[_0x6bce('0x2e')]=_['keys'](_0x282dcd[_0x6bce('0x2e')]);_0x496fc8[_0x6bce('0x2f')]=_[_0x6bce('0x30')](_0x496fc8[_0x6bce('0x2d')],_0x496fc8[_0x6bce('0x2e')]);_0x253476['attributes']=_['intersection'](_0x496fc8[_0x6bce('0x2d')],qs[_0x6bce('0x31')](_0x282dcd[_0x6bce('0x2e')][_0x6bce('0x31')]));_0x253476[_0x6bce('0x32')]=_0x253476['attributes']['length']?_0x253476['attributes']:_0x496fc8['model'];if(!_0x282dcd[_0x6bce('0x2e')][_0x6bce('0x33')]('nolimit')){_0x253476[_0x6bce('0x34')]=qs[_0x6bce('0x34')](_0x282dcd[_0x6bce('0x2e')][_0x6bce('0x34')]);_0x253476['offset']=qs[_0x6bce('0x1e')](_0x282dcd[_0x6bce('0x2e')][_0x6bce('0x1e')]);}_0x253476[_0x6bce('0x35')]=qs['sort'](_0x282dcd[_0x6bce('0x2e')][_0x6bce('0x36')]);_0x253476['where']=qs[_0x6bce('0x2f')](_[_0x6bce('0x37')](_0x282dcd[_0x6bce('0x2e')],_0x496fc8[_0x6bce('0x2f')]),_0x1213c8);if(_0x282dcd[_0x6bce('0x2e')][_0x6bce('0x38')]){_0x253476[_0x6bce('0x39')]=_['merge'](_0x253476[_0x6bce('0x39')],{'$or':_[_0x6bce('0x28')](_0x1213c8,function(_0x319c0b){if(_0x319c0b['type']!=='VIRTUAL'){var _0xff0240={};_0xff0240[_0x319c0b[_0x6bce('0x26')]]={'$like':'%'+_0x282dcd[_0x6bce('0x2e')][_0x6bce('0x38')]+'%'};return _0xff0240;}})});}_0x253476=_[_0x6bce('0x3a')]({},_0x253476,_0x282dcd[_0x6bce('0x3b')]);var _0x2860b9={'where':_0x253476['where']};return db[_0x6bce('0x29')][_0x6bce('0x1d')](_0x2860b9)[_0x6bce('0x23')](function(_0x196367){_0x52f9ea[_0x6bce('0x1d')]=_0x196367;if(_0x282dcd[_0x6bce('0x2e')][_0x6bce('0x3c')]){_0x253476[_0x6bce('0x3d')]=[{'all':!![]}];}return db[_0x6bce('0x29')][_0x6bce('0x3e')](_0x253476);})['then'](function(_0x5e480f){_0x52f9ea['rows']=_0x5e480f;return _0x52f9ea;})['then'](respondWithFilteredResult(_0x557180,_0x253476))[_0x6bce('0x3f')](handleError(_0x557180,null));};exports[_0x6bce('0x40')]=function(_0x1b2b73,_0x5258e7){var _0x199d64={'raw':!![],'where':{'id':_0x1b2b73[_0x6bce('0x41')]['id']}},_0x459705={};_0x459705['model']=_[_0x6bce('0x42')](db[_0x6bce('0x29')]['rawAttributes']);_0x459705[_0x6bce('0x2e')]=_[_0x6bce('0x42')](_0x1b2b73['query']);_0x459705['filters']=_['intersection'](_0x459705[_0x6bce('0x2d')],_0x459705[_0x6bce('0x2e')]);_0x199d64[_0x6bce('0x32')]=_[_0x6bce('0x30')](_0x459705[_0x6bce('0x2d')],qs[_0x6bce('0x31')](_0x1b2b73['query'][_0x6bce('0x31')]));_0x199d64['attributes']=_0x199d64[_0x6bce('0x32')][_0x6bce('0x43')]?_0x199d64[_0x6bce('0x32')]:_0x459705[_0x6bce('0x2d')];if(_0x1b2b73[_0x6bce('0x2e')][_0x6bce('0x3c')]){_0x199d64['include']=[{'all':!![]}];}_0x199d64=_['merge']({},_0x199d64,_0x1b2b73['options']);return db[_0x6bce('0x29')][_0x6bce('0x44')](_0x199d64)[_0x6bce('0x23')](handleEntityNotFound(_0x5258e7,null))[_0x6bce('0x23')](respondWithResult(_0x5258e7,null))[_0x6bce('0x3f')](handleError(_0x5258e7,null));};exports[_0x6bce('0x45')]=function(_0x18fee0,_0x4b169c){return db[_0x6bce('0x29')]['create'](_0x18fee0['body'],{})['then'](respondWithResult(_0x4b169c,0xc9))['catch'](handleError(_0x4b169c,null));};exports[_0x6bce('0x46')]=function(_0x109a51,_0x5b1003){if(_0x109a51[_0x6bce('0x47')]['id']){delete _0x109a51['body']['id'];}return db[_0x6bce('0x29')][_0x6bce('0x44')]({'where':{'id':_0x109a51[_0x6bce('0x41')]['id']}})[_0x6bce('0x23')](handleEntityNotFound(_0x5b1003,null))[_0x6bce('0x23')](saveUpdates(_0x109a51['body'],null))[_0x6bce('0x23')](respondWithResult(_0x5b1003,null))[_0x6bce('0x3f')](handleError(_0x5b1003,null));};exports[_0x6bce('0x24')]=function(_0x207458,_0xc820c7){return db[_0x6bce('0x29')][_0x6bce('0x44')]({'where':{'id':_0x207458[_0x6bce('0x41')]['id']}})['then'](handleEntityNotFound(_0xc820c7,null))[_0x6bce('0x23')](removeEntity(_0xc820c7,null))[_0x6bce('0x3f')](handleError(_0xc820c7,null));};exports[_0x6bce('0x48')]=function(_0x34af01,_0x536f2f){return db[_0x6bce('0x29')][_0x6bce('0x48')]()['then'](respondWithResult(_0x536f2f,null))['catch'](handleError(_0x536f2f,null));}; \ No newline at end of file +var _0x7c8d=['include','findAll','rows','catch','show','includeAll','create','body','params','find','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','stack','name','index','map','FaxTransferReport','rawAttributes','type','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x57c47f,_0x124826){var _0x14af0f=function(_0x492bf9){while(--_0x492bf9){_0x57c47f['push'](_0x57c47f['shift']());}};_0x14af0f(++_0x124826);}(_0x7c8d,0xa3));var _0xd7c8=function(_0x574049,_0x19c285){_0x574049=_0x574049-0x0;var _0x15dbad=_0x7c8d[_0x574049];return _0x15dbad;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd7c8('0x0'));var zipdir=require(_0xd7c8('0x1'));var jsonpatch=require(_0xd7c8('0x2'));var rp=require('request-promise');var moment=require(_0xd7c8('0x3'));var BPromise=require(_0xd7c8('0x4'));var Mustache=require(_0xd7c8('0x5'));var util=require(_0xd7c8('0x6'));var path=require(_0xd7c8('0x7'));var sox=require(_0xd7c8('0x8'));var csv=require(_0xd7c8('0x9'));var ejs=require(_0xd7c8('0xa'));var fs=require('fs');var fs_extra=require(_0xd7c8('0xb'));var _=require(_0xd7c8('0xc'));var squel=require('squel');var crypto=require(_0xd7c8('0xd'));var jsforce=require(_0xd7c8('0xe'));var deskjs=require(_0xd7c8('0xf'));var toCsv=require(_0xd7c8('0x9'));var querystring=require(_0xd7c8('0x10'));var Papa=require(_0xd7c8('0x11'));var Redis=require(_0xd7c8('0x12'));var authService=require(_0xd7c8('0x13'));var qs=require(_0xd7c8('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd7c8('0x15'));var logger=require(_0xd7c8('0x16'))(_0xd7c8('0x17'));var utils=require(_0xd7c8('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xd7c8('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a0fba,_0x1f4234){_0x1f4234=_0x1f4234||0xcc;return function(_0x4f1166){if(_0x4f1166){return _0x1a0fba[_0xd7c8('0x1a')](_0x1f4234);}return _0x1a0fba[_0xd7c8('0x1b')](_0x1f4234)[_0xd7c8('0x1c')]();};}function respondWithResult(_0x2ea2a2,_0x4e2b83){_0x4e2b83=_0x4e2b83||0xc8;return function(_0x48fdf7){if(_0x48fdf7){return _0x2ea2a2[_0xd7c8('0x1b')](_0x4e2b83)[_0xd7c8('0x1d')](_0x48fdf7);}};}function respondWithFilteredResult(_0x133285,_0x3fefdc){return function(_0x2efd0b){if(_0x2efd0b){var _0x18e168=typeof _0x3fefdc[_0xd7c8('0x1e')]===_0xd7c8('0x1f')&&typeof _0x3fefdc[_0xd7c8('0x20')]==='undefined';var _0x11c938=_0x2efd0b[_0xd7c8('0x21')];var _0x2cf29d=_0x18e168?0x0:_0x3fefdc[_0xd7c8('0x1e')];var _0x564978=_0x18e168?_0x2efd0b['count']:_0x3fefdc['offset']+_0x3fefdc[_0xd7c8('0x20')];var _0x2ec91a;if(_0x564978>=_0x11c938){_0x564978=_0x11c938;_0x2ec91a=0xc8;}else{_0x2ec91a=0xce;}_0x133285[_0xd7c8('0x1b')](_0x2ec91a);return _0x133285[_0xd7c8('0x22')]('Content-Range',_0x2cf29d+'-'+_0x564978+'/'+_0x11c938)[_0xd7c8('0x1d')](_0x2efd0b);}return null;};}function patchUpdates(_0x316e6f){return function(_0x587ed2){try{jsonpatch[_0xd7c8('0x23')](_0x587ed2,_0x316e6f,!![]);}catch(_0x1f7798){return BPromise['reject'](_0x1f7798);}return _0x587ed2[_0xd7c8('0x24')]();};}function saveUpdates(_0x3f2447,_0x53fc31){return function(_0x53f122){if(_0x53f122){return _0x53f122[_0xd7c8('0x25')](_0x3f2447)[_0xd7c8('0x26')](function(_0x9cf339){return _0x9cf339;});}return null;};}function removeEntity(_0x1e71f3,_0x290e81){return function(_0x866db1){if(_0x866db1){return _0x866db1[_0xd7c8('0x27')]()[_0xd7c8('0x26')](function(){_0x1e71f3[_0xd7c8('0x1b')](0xcc)[_0xd7c8('0x1c')]();});}};}function handleEntityNotFound(_0x1082e2,_0x5ac68f){return function(_0x3c57ca){if(!_0x3c57ca){_0x1082e2['sendStatus'](0x194);}return _0x3c57ca;};}function handleError(_0x46fbb7,_0x283592){_0x283592=_0x283592||0x1f4;return function(_0x3c711d){logger[_0xd7c8('0x28')](_0x3c711d[_0xd7c8('0x29')]);if(_0x3c711d['name']){delete _0x3c711d[_0xd7c8('0x2a')];}_0x46fbb7[_0xd7c8('0x1b')](_0x283592)['send'](_0x3c711d);};}exports[_0xd7c8('0x2b')]=function(_0x248f61,_0x32db0b){var _0x59bb95={},_0x5c8088={},_0x295695={'count':0x0,'rows':[]};var _0x11fc1d=_[_0xd7c8('0x2c')](db[_0xd7c8('0x2d')][_0xd7c8('0x2e')],function(_0x4fee54){return{'name':_0x4fee54['fieldName'],'type':_0x4fee54[_0xd7c8('0x2f')]['key']};});_0x5c8088[_0xd7c8('0x30')]=_['map'](_0x11fc1d,_0xd7c8('0x2a'));_0x5c8088['query']=_[_0xd7c8('0x31')](_0x248f61[_0xd7c8('0x32')]);_0x5c8088[_0xd7c8('0x33')]=_[_0xd7c8('0x34')](_0x5c8088[_0xd7c8('0x30')],_0x5c8088['query']);_0x59bb95[_0xd7c8('0x35')]=_['intersection'](_0x5c8088[_0xd7c8('0x30')],qs[_0xd7c8('0x36')](_0x248f61[_0xd7c8('0x32')]['fields']));_0x59bb95[_0xd7c8('0x35')]=_0x59bb95[_0xd7c8('0x35')][_0xd7c8('0x37')]?_0x59bb95[_0xd7c8('0x35')]:_0x5c8088[_0xd7c8('0x30')];if(!_0x248f61['query']['hasOwnProperty'](_0xd7c8('0x38'))){_0x59bb95[_0xd7c8('0x20')]=qs['limit'](_0x248f61[_0xd7c8('0x32')][_0xd7c8('0x20')]);_0x59bb95[_0xd7c8('0x1e')]=qs['offset'](_0x248f61[_0xd7c8('0x32')][_0xd7c8('0x1e')]);}_0x59bb95[_0xd7c8('0x39')]=qs[_0xd7c8('0x3a')](_0x248f61[_0xd7c8('0x32')][_0xd7c8('0x3a')]);_0x59bb95[_0xd7c8('0x3b')]=qs['filters'](_[_0xd7c8('0x3c')](_0x248f61[_0xd7c8('0x32')],_0x5c8088['filters']),_0x11fc1d);if(_0x248f61[_0xd7c8('0x32')][_0xd7c8('0x3d')]){_0x59bb95['where']=_[_0xd7c8('0x3e')](_0x59bb95[_0xd7c8('0x3b')],{'$or':_[_0xd7c8('0x2c')](_0x11fc1d,function(_0xe8d913){if(_0xe8d913['type']!==_0xd7c8('0x3f')){var _0x39853d={};_0x39853d[_0xe8d913[_0xd7c8('0x2a')]]={'$like':'%'+_0x248f61[_0xd7c8('0x32')][_0xd7c8('0x3d')]+'%'};return _0x39853d;}})});}_0x59bb95=_[_0xd7c8('0x3e')]({},_0x59bb95,_0x248f61[_0xd7c8('0x40')]);var _0x4ec75c={'where':_0x59bb95[_0xd7c8('0x3b')]};return db[_0xd7c8('0x2d')][_0xd7c8('0x21')](_0x4ec75c)[_0xd7c8('0x26')](function(_0x1a73c2){_0x295695['count']=_0x1a73c2;if(_0x248f61[_0xd7c8('0x32')]['includeAll']){_0x59bb95[_0xd7c8('0x41')]=[{'all':!![]}];}return db[_0xd7c8('0x2d')][_0xd7c8('0x42')](_0x59bb95);})[_0xd7c8('0x26')](function(_0x4497e1){_0x295695[_0xd7c8('0x43')]=_0x4497e1;return _0x295695;})[_0xd7c8('0x26')](respondWithFilteredResult(_0x32db0b,_0x59bb95))[_0xd7c8('0x44')](handleError(_0x32db0b,null));};exports[_0xd7c8('0x45')]=function(_0x597664,_0x4586fd){var _0x456e15={'raw':!![],'where':{'id':_0x597664['params']['id']}},_0x3bd63c={};_0x3bd63c[_0xd7c8('0x30')]=_['keys'](db[_0xd7c8('0x2d')][_0xd7c8('0x2e')]);_0x3bd63c['query']=_[_0xd7c8('0x31')](_0x597664[_0xd7c8('0x32')]);_0x3bd63c[_0xd7c8('0x33')]=_[_0xd7c8('0x34')](_0x3bd63c[_0xd7c8('0x30')],_0x3bd63c[_0xd7c8('0x32')]);_0x456e15[_0xd7c8('0x35')]=_['intersection'](_0x3bd63c[_0xd7c8('0x30')],qs[_0xd7c8('0x36')](_0x597664[_0xd7c8('0x32')][_0xd7c8('0x36')]));_0x456e15[_0xd7c8('0x35')]=_0x456e15[_0xd7c8('0x35')][_0xd7c8('0x37')]?_0x456e15[_0xd7c8('0x35')]:_0x3bd63c['model'];if(_0x597664['query'][_0xd7c8('0x46')]){_0x456e15[_0xd7c8('0x41')]=[{'all':!![]}];}_0x456e15=_['merge']({},_0x456e15,_0x597664[_0xd7c8('0x40')]);return db[_0xd7c8('0x2d')]['find'](_0x456e15)[_0xd7c8('0x26')](handleEntityNotFound(_0x4586fd,null))[_0xd7c8('0x26')](respondWithResult(_0x4586fd,null))[_0xd7c8('0x44')](handleError(_0x4586fd,null));};exports[_0xd7c8('0x47')]=function(_0x30262a,_0x161c16){return db['FaxTransferReport']['create'](_0x30262a[_0xd7c8('0x48')],{})['then'](respondWithResult(_0x161c16,0xc9))[_0xd7c8('0x44')](handleError(_0x161c16,null));};exports['update']=function(_0x440be2,_0x2904a0){if(_0x440be2['body']['id']){delete _0x440be2['body']['id'];}return db[_0xd7c8('0x2d')]['find']({'where':{'id':_0x440be2[_0xd7c8('0x49')]['id']}})['then'](handleEntityNotFound(_0x2904a0,null))[_0xd7c8('0x26')](saveUpdates(_0x440be2['body'],null))[_0xd7c8('0x26')](respondWithResult(_0x2904a0,null))[_0xd7c8('0x44')](handleError(_0x2904a0,null));};exports[_0xd7c8('0x27')]=function(_0x150e3f,_0x136e8c){return db['FaxTransferReport'][_0xd7c8('0x4a')]({'where':{'id':_0x150e3f[_0xd7c8('0x49')]['id']}})[_0xd7c8('0x26')](handleEntityNotFound(_0x136e8c,null))[_0xd7c8('0x26')](removeEntity(_0x136e8c,null))[_0xd7c8('0x44')](handleError(_0x136e8c,null));};exports[_0xd7c8('0x4b')]=function(_0x1c34b9,_0x3adbc8){return db[_0xd7c8('0x2d')][_0xd7c8('0x4b')]()[_0xd7c8('0x26')](respondWithResult(_0x3adbc8,null))[_0xd7c8('0x44')](handleError(_0x3adbc8,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 7b008a3..f1fee71 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 _0xf767=['../../config/logger','api','moment','bluebird','./faxTransferReport.attributes','exports','define','FaxTransferReport','uniqueid'];(function(_0x2261ce,_0x9ed8b6){var _0x524640=function(_0x3cbb90){while(--_0x3cbb90){_0x2261ce['push'](_0x2261ce['shift']());}};_0x524640(++_0x9ed8b6);}(_0xf767,0x183));var _0x7f76=function(_0x1526e1,_0x5ed5a5){_0x1526e1=_0x1526e1-0x0;var _0x249a1e=_0xf767[_0x1526e1];return _0x249a1e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7f76('0x0'))(_0x7f76('0x1'));var moment=require(_0x7f76('0x2'));var BPromise=require(_0x7f76('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7f76('0x4'));module[_0x7f76('0x5')]=function(_0x5e8527,_0x509376){return _0x5e8527[_0x7f76('0x6')](_0x7f76('0x7'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x7f76('0x8'),'fields':[_0x7f76('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9e9a=['api','moment','request-promise','path','rimraf','../../config/environment','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x32dd8f,_0x2f36f9){var _0x54c94c=function(_0x38d1bd){while(--_0x38d1bd){_0x32dd8f['push'](_0x32dd8f['shift']());}};_0x54c94c(++_0x2f36f9);}(_0x9e9a,0x89));var _0xa9e9=function(_0x5673c6,_0xc302ec){_0x5673c6=_0x5673c6-0x0;var _0x130bd9=_0x9e9a[_0x5673c6];return _0x130bd9;};'use strict';var _=require(_0xa9e9('0x0'));var util=require(_0xa9e9('0x1'));var logger=require(_0xa9e9('0x2'))(_0xa9e9('0x3'));var moment=require(_0xa9e9('0x4'));var BPromise=require('bluebird');var rp=require(_0xa9e9('0x5'));var fs=require('fs');var path=require(_0xa9e9('0x6'));var rimraf=require(_0xa9e9('0x7'));var config=require(_0xa9e9('0x8'));var attributes=require('./faxTransferReport.attributes');module[_0xa9e9('0x9')]=function(_0x42e760,_0x33978b){return _0x42e760[_0xa9e9('0xa')](_0xa9e9('0xb'),attributes,{'tableName':_0xa9e9('0xc'),'paranoid':![],'indexes':[{'name':_0xa9e9('0xd'),'fields':[_0xa9e9('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index a3a1474..5e23d61 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 _0x546f=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis'];(function(_0x44078c,_0x293288){var _0x28c938=function(_0x3f3ee7){while(--_0x3f3ee7){_0x44078c['push'](_0x44078c['shift']());}};_0x28c938(++_0x293288);}(_0x546f,0x11b));var _0xf546=function(_0x2da1f9,_0x5e4269){_0x2da1f9=_0x2da1f9-0x0;var _0x22ef92=_0x546f[_0x2da1f9];return _0x22ef92;};'use strict';var _=require(_0xf546('0x0'));var util=require(_0xf546('0x1'));var moment=require(_0xf546('0x2'));var BPromise=require('bluebird');var rs=require(_0xf546('0x3'));var fs=require('fs');var Redis=require(_0xf546('0x4'));var db=require(_0xf546('0x5'))['db'];var utils=require(_0xf546('0x6'));var logger=require(_0xf546('0x7'))(_0xf546('0x8'));var config=require(_0xf546('0x9'));var jayson=require(_0xf546('0xa'));var client=jayson[_0xf546('0xb')][_0xf546('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4e3e48,_0x2c262b,_0x91704d){return new BPromise(function(_0x2d1ec0,_0x491790){return client[_0xf546('0xd')](_0x4e3e48,_0x91704d)[_0xf546('0xe')](function(_0x59b2a1){logger[_0xf546('0xf')](_0xf546('0x10'),_0x2c262b,'request\x20sent');logger['debug'](_0xf546('0x11'),_0x2c262b,_0xf546('0x12'),JSON[_0xf546('0x13')](_0x59b2a1));if(_0x59b2a1['error']){if(_0x59b2a1[_0xf546('0x14')][_0xf546('0x15')]===0x1f4){logger[_0xf546('0x14')](_0xf546('0x10'),_0x2c262b,_0x59b2a1[_0xf546('0x14')][_0xf546('0x16')]);return _0x491790(_0x59b2a1['error'][_0xf546('0x16')]);}logger['error'](_0xf546('0x10'),_0x2c262b,_0x59b2a1[_0xf546('0x14')][_0xf546('0x16')]);return _0x2d1ec0(_0x59b2a1[_0xf546('0x14')][_0xf546('0x16')]);}else{logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x2c262b,_0xf546('0x12'));_0x2d1ec0(_0x59b2a1[_0xf546('0x17')][_0xf546('0x16')]);}})['catch'](function(_0x25d8ba){logger[_0xf546('0x14')](_0xf546('0x10'),_0x2c262b,_0x25d8ba);_0x491790(_0x25d8ba);});});} \ No newline at end of file +var _0x60a5=['error','code','message','info','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xcc6ce4,_0x2979cf){var _0x29566e=function(_0x4811bd){while(--_0x4811bd){_0xcc6ce4['push'](_0xcc6ce4['shift']());}};_0x29566e(++_0x2979cf);}(_0x60a5,0x10d));var _0x560a=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x60a5[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require(_0x560a('0x0'));var util=require(_0x560a('0x1'));var moment=require('moment');var BPromise=require(_0x560a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x560a('0x3'));var db=require(_0x560a('0x4'))['db'];var utils=require(_0x560a('0x5'));var logger=require(_0x560a('0x6'))('rpc');var config=require(_0x560a('0x7'));var jayson=require(_0x560a('0x8'));var client=jayson[_0x560a('0x9')][_0x560a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x462bc0,_0x5f13ca,_0x3cb453){return new BPromise(function(_0xbb6c21,_0x52e444){return client['request'](_0x462bc0,_0x3cb453)[_0x560a('0xb')](function(_0x4a6b82){logger['info'](_0x560a('0xc'),_0x5f13ca,_0x560a('0xd'));logger[_0x560a('0xe')](_0x560a('0xf'),_0x5f13ca,_0x560a('0xd'),JSON[_0x560a('0x10')](_0x4a6b82));if(_0x4a6b82[_0x560a('0x11')]){if(_0x4a6b82['error'][_0x560a('0x12')]===0x1f4){logger['error'](_0x560a('0xc'),_0x5f13ca,_0x4a6b82['error'][_0x560a('0x13')]);return _0x52e444(_0x4a6b82[_0x560a('0x11')][_0x560a('0x13')]);}logger[_0x560a('0x11')](_0x560a('0xc'),_0x5f13ca,_0x4a6b82[_0x560a('0x11')]['message']);return _0xbb6c21(_0x4a6b82['error'][_0x560a('0x13')]);}else{logger[_0x560a('0x14')](_0x560a('0xc'),_0x5f13ca,_0x560a('0xd'));_0xbb6c21(_0x4a6b82['result'][_0x560a('0x13')]);}})[_0x560a('0x15')](function(_0x4fbfbf){logger[_0x560a('0x11')](_0x560a('0xc'),_0x5f13ca,_0x4fbfbf);_0x52e444(_0x4fbfbf);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 97916e1..38ffd6c 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 _0xdff5=['get','isAuthenticated','/describe','show','post','create','/:id','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./faxTransferReport.controller'];(function(_0x4594e2,_0x25da51){var _0x4be202=function(_0x2ca967){while(--_0x2ca967){_0x4594e2['push'](_0x4594e2['shift']());}};_0x4be202(++_0x25da51);}(_0xdff5,0xf3));var _0x5dff=function(_0x172469,_0x20863b){_0x172469=_0x172469-0x0;var _0x402191=_0xdff5[_0x172469];return _0x402191;};'use strict';var multer=require(_0x5dff('0x0'));var util=require(_0x5dff('0x1'));var path=require(_0x5dff('0x2'));var timeout=require(_0x5dff('0x3'));var express=require(_0x5dff('0x4'));var router=express[_0x5dff('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5dff('0x6'));var interaction=require(_0x5dff('0x7'));var config=require('../../config/environment');var controller=require(_0x5dff('0x8'));router[_0x5dff('0x9')]('/',auth[_0x5dff('0xa')](),controller['index']);router[_0x5dff('0x9')](_0x5dff('0xb'),auth[_0x5dff('0xa')](),controller['describe']);router[_0x5dff('0x9')]('/:id',auth[_0x5dff('0xa')](),controller[_0x5dff('0xc')]);router[_0x5dff('0xd')]('/',auth[_0x5dff('0xa')](),controller[_0x5dff('0xe')]);router['put'](_0x5dff('0xf'),auth[_0x5dff('0xa')](),controller['update']);router[_0x5dff('0x10')]('/:id',auth[_0x5dff('0xa')](),controller[_0x5dff('0x11')]);module['exports']=router; \ No newline at end of file +var _0xbc39=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','create','put','update','delete','destroy','exports','multer'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xbc39,0x1cd));var _0x9bc3=function(_0x8f7cb6,_0xf929c8){_0x8f7cb6=_0x8f7cb6-0x0;var _0xf4d3a1=_0xbc39[_0x8f7cb6];return _0xf4d3a1;};'use strict';var multer=require(_0x9bc3('0x0'));var util=require('util');var path=require(_0x9bc3('0x1'));var timeout=require(_0x9bc3('0x2'));var express=require(_0x9bc3('0x3'));var router=express[_0x9bc3('0x4')]();var fs_extra=require(_0x9bc3('0x5'));var auth=require(_0x9bc3('0x6'));var interaction=require(_0x9bc3('0x7'));var config=require('../../config/environment');var controller=require(_0x9bc3('0x8'));router[_0x9bc3('0x9')]('/',auth['isAuthenticated'](),controller[_0x9bc3('0xa')]);router[_0x9bc3('0x9')](_0x9bc3('0xb'),auth[_0x9bc3('0xc')](),controller[_0x9bc3('0xd')]);router[_0x9bc3('0x9')](_0x9bc3('0xe'),auth['isAuthenticated'](),controller[_0x9bc3('0xf')]);router['post']('/',auth[_0x9bc3('0xc')](),controller[_0x9bc3('0x10')]);router[_0x9bc3('0x11')](_0x9bc3('0xe'),auth[_0x9bc3('0xc')](),controller[_0x9bc3('0x12')]);router[_0x9bc3('0x13')](_0x9bc3('0xe'),auth[_0x9bc3('0xc')](),controller[_0x9bc3('0x14')]);module[_0x9bc3('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index e07c207..1ef0f84 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 _0x6ee0=['util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer'];(function(_0x70bfba,_0x1cba2e){var _0x35008e=function(_0x3fa798){while(--_0x3fa798){_0x70bfba['push'](_0x70bfba['shift']());}};_0x35008e(++_0x1cba2e);}(_0x6ee0,0x167));var _0x06ee=function(_0x3f39ac,_0x338b37){_0x3f39ac=_0x3f39ac-0x0;var _0x547100=_0x6ee0[_0x3f39ac];return _0x547100;};'use strict';var multer=require(_0x06ee('0x0'));var util=require(_0x06ee('0x1'));var path=require(_0x06ee('0x2'));var timeout=require(_0x06ee('0x3'));var express=require(_0x06ee('0x4'));var router=express[_0x06ee('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x06ee('0x6'));var config=require(_0x06ee('0x7'));var controller=require(_0x06ee('0x8'));router[_0x06ee('0x9')]('/',auth[_0x06ee('0xa')](),controller[_0x06ee('0xb')]);router[_0x06ee('0x9')](_0x06ee('0xc'),auth[_0x06ee('0xa')](),controller['show']);router[_0x06ee('0x9')](_0x06ee('0xd'),auth[_0x06ee('0xa')](),controller['getConfigurations']);router[_0x06ee('0x9')](_0x06ee('0xe'),auth[_0x06ee('0xa')](),controller[_0x06ee('0xf')]);router[_0x06ee('0x10')]('/',auth[_0x06ee('0xa')](),controller[_0x06ee('0x11')]);router[_0x06ee('0x10')]('/:id/configurations',auth[_0x06ee('0xa')](),controller[_0x06ee('0x12')]);router[_0x06ee('0x13')](_0x06ee('0xc'),auth['isAuthenticated'](),controller[_0x06ee('0x14')]);router[_0x06ee('0x15')](_0x06ee('0xc'),auth[_0x06ee('0xa')](),controller[_0x06ee('0x16')]);module[_0x06ee('0x17')]=router; \ No newline at end of file +var _0xae6d=['post','create','/:id/configurations','addConfiguration','put','/:id','update','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','index','isAuthenticated','show','getConfigurations','/:id/fields','getFields'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0xae6d,0x181));var _0xdae6=function(_0x2b4d01,_0x4c6044){_0x2b4d01=_0x2b4d01-0x0;var _0x4195d7=_0xae6d[_0x2b4d01];return _0x4195d7;};'use strict';var multer=require('multer');var util=require(_0xdae6('0x0'));var path=require('path');var timeout=require(_0xdae6('0x1'));var express=require('express');var router=express[_0xdae6('0x2')]();var fs_extra=require(_0xdae6('0x3'));var auth=require(_0xdae6('0x4'));var interaction=require(_0xdae6('0x5'));var config=require(_0xdae6('0x6'));var controller=require(_0xdae6('0x7'));router[_0xdae6('0x8')]('/',auth['isAuthenticated'](),controller[_0xdae6('0x9')]);router[_0xdae6('0x8')]('/:id',auth[_0xdae6('0xa')](),controller[_0xdae6('0xb')]);router[_0xdae6('0x8')]('/:id/configurations',auth[_0xdae6('0xa')](),controller[_0xdae6('0xc')]);router['get'](_0xdae6('0xd'),auth[_0xdae6('0xa')](),controller[_0xdae6('0xe')]);router[_0xdae6('0xf')]('/',auth[_0xdae6('0xa')](),controller[_0xdae6('0x10')]);router[_0xdae6('0xf')](_0xdae6('0x11'),auth[_0xdae6('0xa')](),controller[_0xdae6('0x12')]);router[_0xdae6('0x13')](_0xdae6('0x14'),auth[_0xdae6('0xa')](),controller[_0xdae6('0x15')]);router[_0xdae6('0x16')](_0xdae6('0x14'),auth[_0xdae6('0xa')](),controller[_0xdae6('0x17')]);module[_0xdae6('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 6ddbc9b..1039ec6 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 _0x2f4b=['basic','newTab','integrationTab','sequelize','STRING','ENUM'];(function(_0x4ff448,_0x490275){var _0x287263=function(_0x4a5d78){while(--_0x4a5d78){_0x4ff448['push'](_0x4ff448['shift']());}};_0x287263(++_0x490275);}(_0x2f4b,0x135));var _0xb2f4=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x2f4b[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0xb2f4('0x0'));module['exports']={'name':{'type':Sequelize[_0xb2f4('0x1')]},'description':{'type':Sequelize[_0xb2f4('0x1')]},'username':{'type':Sequelize[_0xb2f4('0x1')]},'remoteUri':{'type':Sequelize[_0xb2f4('0x1')]},'authType':{'type':Sequelize[_0xb2f4('0x2')](_0xb2f4('0x3')),'defaultValue':_0xb2f4('0x3')},'password':{'type':Sequelize[_0xb2f4('0x1')]},'consumerKey':{'type':Sequelize[_0xb2f4('0x1')]},'consumerSecret':{'type':Sequelize[_0xb2f4('0x1')]},'token':{'type':Sequelize[_0xb2f4('0x1')]},'tokenSecret':{'type':Sequelize[_0xb2f4('0x1')]},'serverUrl':{'type':Sequelize[_0xb2f4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xb2f4('0x2')]('integrationTab',_0xb2f4('0x4')),'defaultValue':_0xb2f4('0x5')}}; \ No newline at end of file +var _0x6e23=['ENUM','basic','integrationTab','newTab','exports','STRING'];(function(_0x54f863,_0x15f82d){var _0xc08dff=function(_0x925ae){while(--_0x925ae){_0x54f863['push'](_0x54f863['shift']());}};_0xc08dff(++_0x15f82d);}(_0x6e23,0x1cc));var _0x36e2=function(_0x45afdb,_0x426cd3){_0x45afdb=_0x45afdb-0x0;var _0x4e534f=_0x6e23[_0x45afdb];return _0x4e534f;};'use strict';var Sequelize=require('sequelize');module[_0x36e2('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x36e2('0x1')]},'authType':{'type':Sequelize[_0x36e2('0x2')](_0x36e2('0x3')),'defaultValue':_0x36e2('0x3')},'password':{'type':Sequelize[_0x36e2('0x1')]},'consumerKey':{'type':Sequelize[_0x36e2('0x1')]},'consumerSecret':{'type':Sequelize[_0x36e2('0x1')]},'token':{'type':Sequelize[_0x36e2('0x1')]},'tokenSecret':{'type':Sequelize[_0x36e2('0x1')]},'serverUrl':{'type':Sequelize[_0x36e2('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x36e2('0x2')](_0x36e2('0x4'),_0x36e2('0x5')),'defaultValue':_0x36e2('0x4')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 87a008c..4904a44 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 _0xd85c=['consumerKey','consumerSecret','token','GET','format','%s/custom_fields','application/json','authType','basic','headers','Authorization','%s:%s','toString','base64','_embedded','entries','active','label','test','error','getFields,\x20%s,\x20%s,\x20%s','stringify','statusCode','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','map','DeskAccount','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','catch','params','keys','include','find','create','body','getConfigurations','findOne','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','DeskConfiguration','DeskField','getFields','priority','remoteUri','username','password'];(function(_0x126fb9,_0x122c59){var _0xc8a3b1=function(_0x355744){while(--_0x355744){_0x126fb9['push'](_0x126fb9['shift']());}};_0xc8a3b1(++_0x122c59);}(_0xd85c,0x16d));var _0xcd85=function(_0x353890,_0x11c483){_0x353890=_0x353890-0x0;var _0x33eff3=_0xd85c[_0x353890];return _0x33eff3;};'use strict';var emlformat=require(_0xcd85('0x0'));var rimraf=require(_0xcd85('0x1'));var zipdir=require(_0xcd85('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcd85('0x3'));var moment=require(_0xcd85('0x4'));var BPromise=require(_0xcd85('0x5'));var Mustache=require(_0xcd85('0x6'));var util=require(_0xcd85('0x7'));var path=require(_0xcd85('0x8'));var sox=require(_0xcd85('0x9'));var csv=require(_0xcd85('0xa'));var ejs=require(_0xcd85('0xb'));var fs=require('fs');var fs_extra=require(_0xcd85('0xc'));var _=require(_0xcd85('0xd'));var squel=require('squel');var crypto=require(_0xcd85('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xcd85('0xa'));var querystring=require('querystring');var Papa=require(_0xcd85('0xf'));var Redis=require(_0xcd85('0x10'));var authService=require(_0xcd85('0x11'));var qs=require(_0xcd85('0x12'));var as=require(_0xcd85('0x13'));var hardwareService=require(_0xcd85('0x14'));var logger=require(_0xcd85('0x15'))('api');var utils=require(_0xcd85('0x16'));var config=require(_0xcd85('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xcd85('0x18'))['db'];var integrations=require(_0xcd85('0x19'));function respondWithStatusCode(_0x5d5062,_0x47e42b){_0x47e42b=_0x47e42b||0xcc;return function(_0x122e7e){if(_0x122e7e){return _0x5d5062[_0xcd85('0x1a')](_0x47e42b);}return _0x5d5062[_0xcd85('0x1b')](_0x47e42b)[_0xcd85('0x1c')]();};}function respondWithResult(_0x4f883d,_0x483ff5){_0x483ff5=_0x483ff5||0xc8;return function(_0x230196){if(_0x230196){return _0x4f883d[_0xcd85('0x1b')](_0x483ff5)['json'](_0x230196);}};}function respondWithFilteredResult(_0x3804f1,_0x1cfd54){return function(_0x485573){if(_0x485573){var _0x558707=typeof _0x1cfd54[_0xcd85('0x1d')]==='undefined'&&typeof _0x1cfd54[_0xcd85('0x1e')]===_0xcd85('0x1f');var _0x4e50b7=_0x485573[_0xcd85('0x20')];var _0x155b39=_0x558707?0x0:_0x1cfd54['offset'];var _0x5a79e8=_0x558707?_0x485573[_0xcd85('0x20')]:_0x1cfd54[_0xcd85('0x1d')]+_0x1cfd54[_0xcd85('0x1e')];var _0x4e417c;if(_0x5a79e8>=_0x4e50b7){_0x5a79e8=_0x4e50b7;_0x4e417c=0xc8;}else{_0x4e417c=0xce;}_0x3804f1[_0xcd85('0x1b')](_0x4e417c);return _0x3804f1[_0xcd85('0x21')](_0xcd85('0x22'),_0x155b39+'-'+_0x5a79e8+'/'+_0x4e50b7)[_0xcd85('0x23')](_0x485573);}return null;};}function patchUpdates(_0x51d720){return function(_0x4e301a){try{jsonpatch[_0xcd85('0x24')](_0x4e301a,_0x51d720,!![]);}catch(_0x1dd1fc){return BPromise[_0xcd85('0x25')](_0x1dd1fc);}return _0x4e301a[_0xcd85('0x26')]();};}function saveUpdates(_0x253d14,_0x265c82){return function(_0x4309c7){if(_0x4309c7){return _0x4309c7[_0xcd85('0x27')](_0x253d14)[_0xcd85('0x28')](function(_0x3ea636){return _0x3ea636;});}return null;};}function removeEntity(_0x836b02,_0x40cb92){return function(_0x13f7c5){if(_0x13f7c5){return _0x13f7c5[_0xcd85('0x29')]()[_0xcd85('0x28')](function(){_0x836b02[_0xcd85('0x1b')](0xcc)[_0xcd85('0x1c')]();});}};}function handleEntityNotFound(_0x263bb2,_0x223190){return function(_0x5cd0ae){if(!_0x5cd0ae){_0x263bb2[_0xcd85('0x1a')](0x194);}return _0x5cd0ae;};}function handleError(_0x5e27a6,_0xde42f2){_0xde42f2=_0xde42f2||0x1f4;return function(_0x373e94){logger['error'](_0x373e94[_0xcd85('0x2a')]);if(_0x373e94[_0xcd85('0x2b')]){delete _0x373e94[_0xcd85('0x2b')];}_0x5e27a6[_0xcd85('0x1b')](_0xde42f2)[_0xcd85('0x2c')](_0x373e94);};}exports['index']=function(_0x2b144c,_0x436a55){var _0x530592={},_0x2e08c2={},_0x333ada={'count':0x0,'rows':[]};var _0x3fd18c=_[_0xcd85('0x2d')](db[_0xcd85('0x2e')][_0xcd85('0x2f')],function(_0x4569f8){return{'name':_0x4569f8[_0xcd85('0x30')],'type':_0x4569f8[_0xcd85('0x31')][_0xcd85('0x32')]};});_0x2e08c2[_0xcd85('0x33')]=_[_0xcd85('0x2d')](_0x3fd18c,_0xcd85('0x2b'));_0x2e08c2[_0xcd85('0x34')]=_['keys'](_0x2b144c[_0xcd85('0x34')]);_0x2e08c2['filters']=_[_0xcd85('0x35')](_0x2e08c2[_0xcd85('0x33')],_0x2e08c2[_0xcd85('0x34')]);_0x530592[_0xcd85('0x36')]=_[_0xcd85('0x35')](_0x2e08c2['model'],qs[_0xcd85('0x37')](_0x2b144c['query'][_0xcd85('0x37')]));_0x530592[_0xcd85('0x36')]=_0x530592[_0xcd85('0x36')][_0xcd85('0x38')]?_0x530592[_0xcd85('0x36')]:_0x2e08c2[_0xcd85('0x33')];if(!_0x2b144c[_0xcd85('0x34')][_0xcd85('0x39')](_0xcd85('0x3a'))){_0x530592['limit']=qs[_0xcd85('0x1e')](_0x2b144c[_0xcd85('0x34')]['limit']);_0x530592[_0xcd85('0x1d')]=qs[_0xcd85('0x1d')](_0x2b144c[_0xcd85('0x34')][_0xcd85('0x1d')]);}_0x530592[_0xcd85('0x3b')]=qs[_0xcd85('0x3c')](_0x2b144c[_0xcd85('0x34')]['sort']);_0x530592[_0xcd85('0x3d')]=qs[_0xcd85('0x3e')](_[_0xcd85('0x3f')](_0x2b144c[_0xcd85('0x34')],_0x2e08c2['filters']),_0x3fd18c);if(_0x2b144c['query'][_0xcd85('0x40')]){_0x530592[_0xcd85('0x3d')]=_[_0xcd85('0x41')](_0x530592[_0xcd85('0x3d')],{'$or':_['map'](_0x3fd18c,function(_0x259906){if(_0x259906[_0xcd85('0x31')]!==_0xcd85('0x42')){var _0x519454={};_0x519454[_0x259906['name']]={'$like':'%'+_0x2b144c[_0xcd85('0x34')]['filter']+'%'};return _0x519454;}})});}_0x530592=_[_0xcd85('0x41')]({},_0x530592,_0x2b144c[_0xcd85('0x43')]);var _0x13819f={'where':_0x530592['where']};return db[_0xcd85('0x2e')][_0xcd85('0x20')](_0x13819f)[_0xcd85('0x28')](function(_0x37a614){_0x333ada[_0xcd85('0x20')]=_0x37a614;if(_0x2b144c['query'][_0xcd85('0x44')]){_0x530592['include']=[{'all':!![]}];}return db['DeskAccount']['findAll'](_0x530592);})[_0xcd85('0x28')](function(_0x4d4e78){_0x333ada['rows']=_0x4d4e78;return _0x333ada;})[_0xcd85('0x28')](respondWithFilteredResult(_0x436a55,_0x530592))[_0xcd85('0x45')](handleError(_0x436a55,null));};exports['show']=function(_0x28a3fa,_0x58cb7e){var _0x117066={'raw':![],'where':{'id':_0x28a3fa[_0xcd85('0x46')]['id']}},_0x2288ca={};_0x2288ca['model']=_[_0xcd85('0x47')](db['DeskAccount'][_0xcd85('0x2f')]);_0x2288ca[_0xcd85('0x34')]=_[_0xcd85('0x47')](_0x28a3fa[_0xcd85('0x34')]);_0x2288ca[_0xcd85('0x3e')]=_[_0xcd85('0x35')](_0x2288ca[_0xcd85('0x33')],_0x2288ca[_0xcd85('0x34')]);_0x117066['attributes']=_[_0xcd85('0x35')](_0x2288ca[_0xcd85('0x33')],qs[_0xcd85('0x37')](_0x28a3fa[_0xcd85('0x34')][_0xcd85('0x37')]));_0x117066[_0xcd85('0x36')]=_0x117066[_0xcd85('0x36')]['length']?_0x117066[_0xcd85('0x36')]:_0x2288ca[_0xcd85('0x33')];if(_0x28a3fa[_0xcd85('0x34')][_0xcd85('0x44')]){_0x117066[_0xcd85('0x48')]=[{'all':!![]}];}_0x117066=_[_0xcd85('0x41')]({},_0x117066,_0x28a3fa[_0xcd85('0x43')]);return db[_0xcd85('0x2e')][_0xcd85('0x49')](_0x117066)[_0xcd85('0x28')](handleEntityNotFound(_0x58cb7e,null))['then'](respondWithResult(_0x58cb7e,null))[_0xcd85('0x45')](handleError(_0x58cb7e,null));};exports[_0xcd85('0x4a')]=function(_0x26e75a,_0x2d2610){return db['DeskAccount'][_0xcd85('0x4a')](_0x26e75a[_0xcd85('0x4b')],{})[_0xcd85('0x28')](respondWithResult(_0x2d2610,0xc9))[_0xcd85('0x45')](handleError(_0x2d2610,null));};exports[_0xcd85('0x27')]=function(_0x476564,_0x439220){if(_0x476564[_0xcd85('0x4b')]['id']){delete _0x476564[_0xcd85('0x4b')]['id'];}return db[_0xcd85('0x2e')][_0xcd85('0x49')]({'where':{'id':_0x476564[_0xcd85('0x46')]['id']}})[_0xcd85('0x28')](handleEntityNotFound(_0x439220,null))['then'](saveUpdates(_0x476564[_0xcd85('0x4b')],null))[_0xcd85('0x28')](respondWithResult(_0x439220,null))['catch'](handleError(_0x439220,null));};exports[_0xcd85('0x29')]=function(_0x375c21,_0x44865c){return db[_0xcd85('0x2e')][_0xcd85('0x49')]({'where':{'id':_0x375c21[_0xcd85('0x46')]['id']}})[_0xcd85('0x28')](handleEntityNotFound(_0x44865c,null))['then'](removeEntity(_0x44865c,null))[_0xcd85('0x45')](handleError(_0x44865c,null));};exports[_0xcd85('0x4c')]=function(_0x10c2cd,_0x28b18d,_0x42e549){var _0x44eaea={};var _0x2ed34b={};var _0x43e281;var _0x5b0448;return db[_0xcd85('0x2e')][_0xcd85('0x4d')]({'where':{'id':_0x10c2cd['params']['id']}})[_0xcd85('0x28')](handleEntityNotFound(_0x28b18d,null))[_0xcd85('0x28')](function(_0x471c71){if(_0x471c71){_0x43e281=_0x471c71;_0x2ed34b['model']=_[_0xcd85('0x47')](db['DeskConfiguration'][_0xcd85('0x2f')]);_0x2ed34b['query']=_['keys'](_0x10c2cd['query']);_0x2ed34b[_0xcd85('0x3e')]=_['intersection'](_0x2ed34b[_0xcd85('0x33')],_0x2ed34b[_0xcd85('0x34')]);_0x44eaea[_0xcd85('0x36')]=_[_0xcd85('0x35')](_0x2ed34b[_0xcd85('0x33')],qs[_0xcd85('0x37')](_0x10c2cd[_0xcd85('0x34')][_0xcd85('0x37')]));_0x44eaea[_0xcd85('0x36')]=_0x44eaea[_0xcd85('0x36')][_0xcd85('0x38')]?_0x44eaea[_0xcd85('0x36')]:_0x2ed34b[_0xcd85('0x33')];_0x44eaea[_0xcd85('0x3b')]=qs['sort'](_0x10c2cd['query'][_0xcd85('0x3c')]);_0x44eaea['where']=qs[_0xcd85('0x3e')](_['pick'](_0x10c2cd['query'],_0x2ed34b['filters']));if(_0x10c2cd[_0xcd85('0x34')][_0xcd85('0x40')]){_0x44eaea[_0xcd85('0x3d')]=_[_0xcd85('0x41')](_0x44eaea[_0xcd85('0x3d')],{'$or':_[_0xcd85('0x2d')](_0x44eaea[_0xcd85('0x36')],function(_0x48f183){var _0x353561={};_0x353561[_0x48f183]={'$like':'%'+_0x10c2cd[_0xcd85('0x34')][_0xcd85('0x40')]+'%'};return _0x353561;})});}_0x44eaea=_[_0xcd85('0x41')]({},_0x44eaea,_0x10c2cd[_0xcd85('0x43')]);return _0x43e281[_0xcd85('0x4c')](_0x44eaea);}})['then'](function(_0x5eaafc){if(_0x5eaafc){_0x5b0448=_0x5eaafc[_0xcd85('0x38')];if(!_0x10c2cd[_0xcd85('0x34')][_0xcd85('0x39')](_0xcd85('0x3a'))){_0x44eaea['limit']=qs['limit'](_0x10c2cd[_0xcd85('0x34')][_0xcd85('0x1e')]);_0x44eaea['offset']=qs[_0xcd85('0x1d')](_0x10c2cd['query'][_0xcd85('0x1d')]);}return _0x43e281[_0xcd85('0x4c')](_0x44eaea);}})[_0xcd85('0x28')](function(_0x7f0554){if(_0x7f0554){return _0x7f0554?{'count':_0x5b0448,'rows':_0x7f0554}:null;}})[_0xcd85('0x28')](respondWithResult(_0x28b18d,null))[_0xcd85('0x45')](handleError(_0x28b18d,null));};exports[_0xcd85('0x4e')]=function(_0x182852,_0x558418,_0x591a69){if(_0x182852[_0xcd85('0x4b')]['id']){delete _0x182852[_0xcd85('0x4b')]['id'];}return db[_0xcd85('0x2e')][_0xcd85('0x4d')]({'where':{'id':_0x182852[_0xcd85('0x46')]['id']}})[_0xcd85('0x28')](handleEntityNotFound(_0x558418,null))['then'](function(_0x17ad33){if(_0x17ad33){_0x182852[_0xcd85('0x4b')][_0xcd85('0x4f')]=_0x17ad33['id'];_0x182852['body'][_0xcd85('0x50')]=integrations[_0xcd85('0x51')](_0x182852[_0xcd85('0x4b')]['channel'],_0x182852['body'][_0xcd85('0x31')]);_0x182852[_0xcd85('0x4b')][_0xcd85('0x52')]=integrations[_0xcd85('0x53')](_0x182852['body']['channel'],_0x182852[_0xcd85('0x4b')][_0xcd85('0x31')]);return db[_0xcd85('0x54')][_0xcd85('0x4a')](_0x182852[_0xcd85('0x4b')],{'include':[{'model':db['DeskField'],'as':'Subjects'},{'model':db[_0xcd85('0x55')],'as':_0xcd85('0x52')}]});}return null;})[_0xcd85('0x28')](respondWithResult(_0x558418,null))['catch'](handleError(_0x558418,null));};exports[_0xcd85('0x56')]=function(_0x1ac0ca,_0x5c7025,_0x473914){var _0x4d6f96=[{'name':_0xcd85('0x57'),'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 _0xc6ed7e='';return db['DeskAccount'][_0xcd85('0x4d')]({'where':{'id':_0x1ac0ca['params']['id']},'attributes':['id',_0xcd85('0x58'),'authType',_0xcd85('0x59'),_0xcd85('0x5a'),_0xcd85('0x5b'),_0xcd85('0x5c'),_0xcd85('0x5d'),'tokenSecret']})[_0xcd85('0x28')](handleEntityNotFound(_0x5c7025,null))[_0xcd85('0x28')](function(_0x558508){if(_0x558508){_0xc6ed7e=_0x558508[_0xcd85('0x58')];var _0x1a4716=_0xc6ed7e['slice'](-0x1);if(_0x1a4716==='/'){_0xc6ed7e=_0xc6ed7e['substring'](0x0,_0xc6ed7e['lastIndexOf'](_0x1a4716));}var _0x294adc={'method':_0xcd85('0x5e'),'uri':util[_0xcd85('0x5f')](_0xcd85('0x60'),_0xc6ed7e),'headers':{'Content-Type':_0xcd85('0x61'),'Accept':_0xcd85('0x61')},'json':!![]};if(_0x558508[_0xcd85('0x62')]===_0xcd85('0x63')){_0x294adc[_0xcd85('0x64')][_0xcd85('0x65')]=util[_0xcd85('0x5f')]('Basic\x20%s',new Buffer(util[_0xcd85('0x5f')](_0xcd85('0x66'),_0x558508['username'],_0x558508[_0xcd85('0x5a')]))[_0xcd85('0x67')](_0xcd85('0x68')));}return rp(_0x294adc)[_0xcd85('0x28')](function(_0x1c5c17){return _0x4d6f96['concat'](_['map'](_0x1c5c17[_0xcd85('0x69')][_0xcd85('0x6a')],function(_0x33eaad){return{'id':_0x33eaad[_0xcd85('0x2b')],'name':_0x33eaad[_0xcd85('0x2b')],'type':_0x33eaad['type'],'active':_0x33eaad[_0xcd85('0x6b')],'label':_0x33eaad[_0xcd85('0x6c')],'custom':!![]};}));});}})[_0xcd85('0x28')](function(_0x267da7){return{'count':_0x267da7['length'],'rows':_0x267da7};})[_0xcd85('0x28')](respondWithResult(_0x5c7025,null))[_0xcd85('0x45')](function(_0xeab170){var _0x31a33e=_0x1ac0ca[_0xcd85('0x34')][_0xcd85('0x6d')]?0x1f4:_0xeab170['statusCode']||0x1f4;logger[_0xcd85('0x6e')](_0xcd85('0x6f'),_0xcd85('0x56'),_0x31a33e,JSON[_0xcd85('0x70')](_0xeab170));delete _0xeab170[_0xcd85('0x2b')];if(_0x31a33e===0x191){_0x31a33e=0x190;}_0x5c7025['status'](_0x31a33e)[_0xcd85('0x2c')](_0x1ac0ca[_0xcd85('0x34')]['test']?{'message':'Wrong\x20credentials','statusCode':_0xeab170[_0xcd85('0x71')]}:_0xeab170);});}; \ No newline at end of file +var _0x4b42=['active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','update','then','error','stack','name','index','map','rawAttributes','type','key','model','intersection','attributes','fields','hasOwnProperty','nolimit','query','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','DeskAccount','includeAll','include','catch','show','params','keys','find','create','body','destroy','getConfigurations','findOne','DeskConfiguration','length','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','priority','remoteUri','username','consumerKey','consumerSecret','token','tokenSecret','slice','GET','%s/custom_fields','application/json','authType','headers','Authorization','format','Basic\x20%s','%s:%s','password','base64','concat','_embedded'];(function(_0x2033aa,_0x1395d5){var _0x17ecc0=function(_0x137325){while(--_0x137325){_0x2033aa['push'](_0x2033aa['shift']());}};_0x17ecc0(++_0x1395d5);}(_0x4b42,0x77));var _0x24b4=function(_0x621c08,_0x3ef909){_0x621c08=_0x621c08-0x0;var _0x8ba56a=_0x4b42[_0x621c08];return _0x8ba56a;};'use strict';var emlformat=require(_0x24b4('0x0'));var rimraf=require(_0x24b4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x24b4('0x2'));var rp=require(_0x24b4('0x3'));var moment=require(_0x24b4('0x4'));var BPromise=require(_0x24b4('0x5'));var Mustache=require(_0x24b4('0x6'));var util=require(_0x24b4('0x7'));var path=require(_0x24b4('0x8'));var sox=require(_0x24b4('0x9'));var csv=require(_0x24b4('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x24b4('0xb'));var _=require(_0x24b4('0xc'));var squel=require(_0x24b4('0xd'));var crypto=require('crypto');var jsforce=require(_0x24b4('0xe'));var deskjs=require(_0x24b4('0xf'));var toCsv=require(_0x24b4('0xa'));var querystring=require(_0x24b4('0x10'));var Papa=require('papaparse');var Redis=require(_0x24b4('0x11'));var authService=require(_0x24b4('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x24b4('0x13'));var hardwareService=require(_0x24b4('0x14'));var logger=require(_0x24b4('0x15'))(_0x24b4('0x16'));var utils=require(_0x24b4('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x24b4('0x18'));var db=require(_0x24b4('0x19'))['db'];var integrations=require(_0x24b4('0x1a'));function respondWithStatusCode(_0x4a1419,_0x55474a){_0x55474a=_0x55474a||0xcc;return function(_0x5ee7fa){if(_0x5ee7fa){return _0x4a1419[_0x24b4('0x1b')](_0x55474a);}return _0x4a1419[_0x24b4('0x1c')](_0x55474a)[_0x24b4('0x1d')]();};}function respondWithResult(_0x4ada8c,_0x40a2c5){_0x40a2c5=_0x40a2c5||0xc8;return function(_0x111461){if(_0x111461){return _0x4ada8c[_0x24b4('0x1c')](_0x40a2c5)[_0x24b4('0x1e')](_0x111461);}};}function respondWithFilteredResult(_0x3d5cf3,_0x1fa1c0){return function(_0x113c84){if(_0x113c84){var _0x2c2287=typeof _0x1fa1c0[_0x24b4('0x1f')]===_0x24b4('0x20')&&typeof _0x1fa1c0[_0x24b4('0x21')]===_0x24b4('0x20');var _0x322e64=_0x113c84[_0x24b4('0x22')];var _0x3882d8=_0x2c2287?0x0:_0x1fa1c0[_0x24b4('0x1f')];var _0x452ea9=_0x2c2287?_0x113c84['count']:_0x1fa1c0['offset']+_0x1fa1c0['limit'];var _0x5d3ad1;if(_0x452ea9>=_0x322e64){_0x452ea9=_0x322e64;_0x5d3ad1=0xc8;}else{_0x5d3ad1=0xce;}_0x3d5cf3[_0x24b4('0x1c')](_0x5d3ad1);return _0x3d5cf3['set']('Content-Range',_0x3882d8+'-'+_0x452ea9+'/'+_0x322e64)['json'](_0x113c84);}return null;};}function patchUpdates(_0x33470c){return function(_0x2a6974){try{jsonpatch[_0x24b4('0x23')](_0x2a6974,_0x33470c,!![]);}catch(_0x1fb774){return BPromise[_0x24b4('0x24')](_0x1fb774);}return _0x2a6974['save']();};}function saveUpdates(_0x44961e,_0x3bdd57){return function(_0x605dd2){if(_0x605dd2){return _0x605dd2[_0x24b4('0x25')](_0x44961e)[_0x24b4('0x26')](function(_0x12b9f2){return _0x12b9f2;});}return null;};}function removeEntity(_0x4c1a11,_0x2ed600){return function(_0x2257b2){if(_0x2257b2){return _0x2257b2['destroy']()[_0x24b4('0x26')](function(){_0x4c1a11[_0x24b4('0x1c')](0xcc)[_0x24b4('0x1d')]();});}};}function handleEntityNotFound(_0x444078,_0x22f93c){return function(_0xf62802){if(!_0xf62802){_0x444078[_0x24b4('0x1b')](0x194);}return _0xf62802;};}function handleError(_0x562899,_0x22d629){_0x22d629=_0x22d629||0x1f4;return function(_0x42d902){logger[_0x24b4('0x27')](_0x42d902[_0x24b4('0x28')]);if(_0x42d902[_0x24b4('0x29')]){delete _0x42d902[_0x24b4('0x29')];}_0x562899[_0x24b4('0x1c')](_0x22d629)['send'](_0x42d902);};}exports[_0x24b4('0x2a')]=function(_0x3a617a,_0x439cc7){var _0x1e1c6c={},_0x22d980={},_0x3cf517={'count':0x0,'rows':[]};var _0x6bc578=_[_0x24b4('0x2b')](db['DeskAccount'][_0x24b4('0x2c')],function(_0x1574cf){return{'name':_0x1574cf['fieldName'],'type':_0x1574cf[_0x24b4('0x2d')][_0x24b4('0x2e')]};});_0x22d980[_0x24b4('0x2f')]=_[_0x24b4('0x2b')](_0x6bc578,_0x24b4('0x29'));_0x22d980['query']=_['keys'](_0x3a617a['query']);_0x22d980['filters']=_[_0x24b4('0x30')](_0x22d980['model'],_0x22d980['query']);_0x1e1c6c[_0x24b4('0x31')]=_['intersection'](_0x22d980[_0x24b4('0x2f')],qs[_0x24b4('0x32')](_0x3a617a['query'][_0x24b4('0x32')]));_0x1e1c6c[_0x24b4('0x31')]=_0x1e1c6c['attributes']['length']?_0x1e1c6c['attributes']:_0x22d980[_0x24b4('0x2f')];if(!_0x3a617a['query'][_0x24b4('0x33')](_0x24b4('0x34'))){_0x1e1c6c[_0x24b4('0x21')]=qs[_0x24b4('0x21')](_0x3a617a[_0x24b4('0x35')][_0x24b4('0x21')]);_0x1e1c6c[_0x24b4('0x1f')]=qs['offset'](_0x3a617a[_0x24b4('0x35')]['offset']);}_0x1e1c6c[_0x24b4('0x36')]=qs['sort'](_0x3a617a[_0x24b4('0x35')][_0x24b4('0x37')]);_0x1e1c6c['where']=qs[_0x24b4('0x38')](_[_0x24b4('0x39')](_0x3a617a[_0x24b4('0x35')],_0x22d980[_0x24b4('0x38')]),_0x6bc578);if(_0x3a617a[_0x24b4('0x35')][_0x24b4('0x3a')]){_0x1e1c6c[_0x24b4('0x3b')]=_[_0x24b4('0x3c')](_0x1e1c6c[_0x24b4('0x3b')],{'$or':_['map'](_0x6bc578,function(_0x3665bc){if(_0x3665bc[_0x24b4('0x2d')]!==_0x24b4('0x3d')){var _0x534c59={};_0x534c59[_0x3665bc[_0x24b4('0x29')]]={'$like':'%'+_0x3a617a['query'][_0x24b4('0x3a')]+'%'};return _0x534c59;}})});}_0x1e1c6c=_[_0x24b4('0x3c')]({},_0x1e1c6c,_0x3a617a[_0x24b4('0x3e')]);var _0x1281c4={'where':_0x1e1c6c[_0x24b4('0x3b')]};return db[_0x24b4('0x3f')][_0x24b4('0x22')](_0x1281c4)[_0x24b4('0x26')](function(_0x46bed1){_0x3cf517[_0x24b4('0x22')]=_0x46bed1;if(_0x3a617a[_0x24b4('0x35')][_0x24b4('0x40')]){_0x1e1c6c[_0x24b4('0x41')]=[{'all':!![]}];}return db['DeskAccount']['findAll'](_0x1e1c6c);})[_0x24b4('0x26')](function(_0x5f27f7){_0x3cf517['rows']=_0x5f27f7;return _0x3cf517;})[_0x24b4('0x26')](respondWithFilteredResult(_0x439cc7,_0x1e1c6c))[_0x24b4('0x42')](handleError(_0x439cc7,null));};exports[_0x24b4('0x43')]=function(_0xf1e419,_0x4f8f23){var _0x2199c7={'raw':![],'where':{'id':_0xf1e419[_0x24b4('0x44')]['id']}},_0x24dca5={};_0x24dca5[_0x24b4('0x2f')]=_[_0x24b4('0x45')](db[_0x24b4('0x3f')]['rawAttributes']);_0x24dca5[_0x24b4('0x35')]=_['keys'](_0xf1e419[_0x24b4('0x35')]);_0x24dca5[_0x24b4('0x38')]=_[_0x24b4('0x30')](_0x24dca5[_0x24b4('0x2f')],_0x24dca5['query']);_0x2199c7[_0x24b4('0x31')]=_[_0x24b4('0x30')](_0x24dca5[_0x24b4('0x2f')],qs[_0x24b4('0x32')](_0xf1e419[_0x24b4('0x35')]['fields']));_0x2199c7[_0x24b4('0x31')]=_0x2199c7[_0x24b4('0x31')]['length']?_0x2199c7[_0x24b4('0x31')]:_0x24dca5[_0x24b4('0x2f')];if(_0xf1e419[_0x24b4('0x35')]['includeAll']){_0x2199c7[_0x24b4('0x41')]=[{'all':!![]}];}_0x2199c7=_[_0x24b4('0x3c')]({},_0x2199c7,_0xf1e419['options']);return db[_0x24b4('0x3f')][_0x24b4('0x46')](_0x2199c7)[_0x24b4('0x26')](handleEntityNotFound(_0x4f8f23,null))['then'](respondWithResult(_0x4f8f23,null))[_0x24b4('0x42')](handleError(_0x4f8f23,null));};exports['create']=function(_0x4ed8c1,_0x387d30){return db['DeskAccount'][_0x24b4('0x47')](_0x4ed8c1[_0x24b4('0x48')],{})['then'](respondWithResult(_0x387d30,0xc9))[_0x24b4('0x42')](handleError(_0x387d30,null));};exports[_0x24b4('0x25')]=function(_0x588335,_0x20c35b){if(_0x588335[_0x24b4('0x48')]['id']){delete _0x588335['body']['id'];}return db[_0x24b4('0x3f')]['find']({'where':{'id':_0x588335['params']['id']}})[_0x24b4('0x26')](handleEntityNotFound(_0x20c35b,null))['then'](saveUpdates(_0x588335[_0x24b4('0x48')],null))[_0x24b4('0x26')](respondWithResult(_0x20c35b,null))[_0x24b4('0x42')](handleError(_0x20c35b,null));};exports[_0x24b4('0x49')]=function(_0x161d69,_0x44f953){return db[_0x24b4('0x3f')][_0x24b4('0x46')]({'where':{'id':_0x161d69['params']['id']}})[_0x24b4('0x26')](handleEntityNotFound(_0x44f953,null))['then'](removeEntity(_0x44f953,null))[_0x24b4('0x42')](handleError(_0x44f953,null));};exports[_0x24b4('0x4a')]=function(_0x47ae0c,_0x46ae5e,_0x33c85e){var _0x124fd8={};var _0x3de819={};var _0x21fb71;var _0x1581c1;return db[_0x24b4('0x3f')][_0x24b4('0x4b')]({'where':{'id':_0x47ae0c['params']['id']}})[_0x24b4('0x26')](handleEntityNotFound(_0x46ae5e,null))[_0x24b4('0x26')](function(_0x3b6860){if(_0x3b6860){_0x21fb71=_0x3b6860;_0x3de819[_0x24b4('0x2f')]=_[_0x24b4('0x45')](db[_0x24b4('0x4c')][_0x24b4('0x2c')]);_0x3de819[_0x24b4('0x35')]=_[_0x24b4('0x45')](_0x47ae0c[_0x24b4('0x35')]);_0x3de819[_0x24b4('0x38')]=_[_0x24b4('0x30')](_0x3de819['model'],_0x3de819[_0x24b4('0x35')]);_0x124fd8['attributes']=_['intersection'](_0x3de819['model'],qs[_0x24b4('0x32')](_0x47ae0c[_0x24b4('0x35')]['fields']));_0x124fd8[_0x24b4('0x31')]=_0x124fd8[_0x24b4('0x31')][_0x24b4('0x4d')]?_0x124fd8[_0x24b4('0x31')]:_0x3de819[_0x24b4('0x2f')];_0x124fd8[_0x24b4('0x36')]=qs[_0x24b4('0x37')](_0x47ae0c[_0x24b4('0x35')][_0x24b4('0x37')]);_0x124fd8[_0x24b4('0x3b')]=qs[_0x24b4('0x38')](_[_0x24b4('0x39')](_0x47ae0c[_0x24b4('0x35')],_0x3de819[_0x24b4('0x38')]));if(_0x47ae0c[_0x24b4('0x35')][_0x24b4('0x3a')]){_0x124fd8['where']=_[_0x24b4('0x3c')](_0x124fd8[_0x24b4('0x3b')],{'$or':_[_0x24b4('0x2b')](_0x124fd8[_0x24b4('0x31')],function(_0x393091){var _0x1aef29={};_0x1aef29[_0x393091]={'$like':'%'+_0x47ae0c[_0x24b4('0x35')]['filter']+'%'};return _0x1aef29;})});}_0x124fd8=_['merge']({},_0x124fd8,_0x47ae0c['options']);return _0x21fb71[_0x24b4('0x4a')](_0x124fd8);}})['then'](function(_0x55535f){if(_0x55535f){_0x1581c1=_0x55535f[_0x24b4('0x4d')];if(!_0x47ae0c[_0x24b4('0x35')][_0x24b4('0x33')](_0x24b4('0x34'))){_0x124fd8[_0x24b4('0x21')]=qs[_0x24b4('0x21')](_0x47ae0c[_0x24b4('0x35')]['limit']);_0x124fd8[_0x24b4('0x1f')]=qs[_0x24b4('0x1f')](_0x47ae0c[_0x24b4('0x35')][_0x24b4('0x1f')]);}return _0x21fb71[_0x24b4('0x4a')](_0x124fd8);}})[_0x24b4('0x26')](function(_0x412662){if(_0x412662){return _0x412662?{'count':_0x1581c1,'rows':_0x412662}:null;}})[_0x24b4('0x26')](respondWithResult(_0x46ae5e,null))[_0x24b4('0x42')](handleError(_0x46ae5e,null));};exports[_0x24b4('0x4e')]=function(_0x14d2ee,_0xb4660b,_0x4d6e82){if(_0x14d2ee[_0x24b4('0x48')]['id']){delete _0x14d2ee[_0x24b4('0x48')]['id'];}return db['DeskAccount'][_0x24b4('0x4b')]({'where':{'id':_0x14d2ee['params']['id']}})[_0x24b4('0x26')](handleEntityNotFound(_0xb4660b,null))['then'](function(_0x2c6696){if(_0x2c6696){_0x14d2ee[_0x24b4('0x48')][_0x24b4('0x4f')]=_0x2c6696['id'];_0x14d2ee[_0x24b4('0x48')][_0x24b4('0x50')]=integrations[_0x24b4('0x51')](_0x14d2ee[_0x24b4('0x48')][_0x24b4('0x52')],_0x14d2ee[_0x24b4('0x48')]['type']);_0x14d2ee[_0x24b4('0x48')][_0x24b4('0x53')]=integrations[_0x24b4('0x54')](_0x14d2ee['body'][_0x24b4('0x52')],_0x14d2ee[_0x24b4('0x48')][_0x24b4('0x2d')]);return db[_0x24b4('0x4c')][_0x24b4('0x47')](_0x14d2ee['body'],{'include':[{'model':db[_0x24b4('0x55')],'as':_0x24b4('0x50')},{'model':db[_0x24b4('0x55')],'as':_0x24b4('0x53')}]});}return null;})['then'](respondWithResult(_0xb4660b,null))[_0x24b4('0x42')](handleError(_0xb4660b,null));};exports['getFields']=function(_0xeb3453,_0x13c87c,_0x2df178){var _0x1015ab=[{'name':_0x24b4('0x56'),'label':_0x24b4('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 _0x418b1e='';return db[_0x24b4('0x3f')][_0x24b4('0x4b')]({'where':{'id':_0xeb3453['params']['id']},'attributes':['id',_0x24b4('0x57'),'authType',_0x24b4('0x58'),'password',_0x24b4('0x59'),_0x24b4('0x5a'),_0x24b4('0x5b'),_0x24b4('0x5c')]})[_0x24b4('0x26')](handleEntityNotFound(_0x13c87c,null))[_0x24b4('0x26')](function(_0x57dfa7){if(_0x57dfa7){_0x418b1e=_0x57dfa7[_0x24b4('0x57')];var _0x39c14b=_0x418b1e[_0x24b4('0x5d')](-0x1);if(_0x39c14b==='/'){_0x418b1e=_0x418b1e['substring'](0x0,_0x418b1e['lastIndexOf'](_0x39c14b));}var _0x3a9648={'method':_0x24b4('0x5e'),'uri':util['format'](_0x24b4('0x5f'),_0x418b1e),'headers':{'Content-Type':_0x24b4('0x60'),'Accept':_0x24b4('0x60')},'json':!![]};if(_0x57dfa7[_0x24b4('0x61')]==='basic'){_0x3a9648[_0x24b4('0x62')][_0x24b4('0x63')]=util[_0x24b4('0x64')](_0x24b4('0x65'),new Buffer(util[_0x24b4('0x64')](_0x24b4('0x66'),_0x57dfa7[_0x24b4('0x58')],_0x57dfa7[_0x24b4('0x67')]))['toString'](_0x24b4('0x68')));}return rp(_0x3a9648)[_0x24b4('0x26')](function(_0x461989){return _0x1015ab[_0x24b4('0x69')](_[_0x24b4('0x2b')](_0x461989[_0x24b4('0x6a')]['entries'],function(_0x49a301){return{'id':_0x49a301[_0x24b4('0x29')],'name':_0x49a301[_0x24b4('0x29')],'type':_0x49a301[_0x24b4('0x2d')],'active':_0x49a301[_0x24b4('0x6b')],'label':_0x49a301[_0x24b4('0x6c')],'custom':!![]};}));});}})[_0x24b4('0x26')](function(_0x370688){return{'count':_0x370688[_0x24b4('0x4d')],'rows':_0x370688};})[_0x24b4('0x26')](respondWithResult(_0x13c87c,null))[_0x24b4('0x42')](function(_0x14739e){var _0x4e3ba1=_0xeb3453[_0x24b4('0x35')][_0x24b4('0x6d')]?0x1f4:_0x14739e[_0x24b4('0x6e')]||0x1f4;logger[_0x24b4('0x27')](_0x24b4('0x6f'),'getFields',_0x4e3ba1,JSON['stringify'](_0x14739e));delete _0x14739e[_0x24b4('0x29')];if(_0x4e3ba1===0x191){_0x4e3ba1=0x190;}_0x13c87c[_0x24b4('0x1c')](_0x4e3ba1)[_0x24b4('0x70')](_0xeb3453[_0x24b4('0x35')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x14739e[_0x24b4('0x6e')]}:_0x14739e);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 903e02a..a371317 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 _0x1f08=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','int_desk_accounts','lodash','util'];(function(_0x383494,_0x2070d2){var _0x2485e5=function(_0x37c52e){while(--_0x37c52e){_0x383494['push'](_0x383494['shift']());}};_0x2485e5(++_0x2070d2);}(_0x1f08,0x7c));var _0x81f0=function(_0x1387b2,_0x6f097b){_0x1387b2=_0x1387b2-0x0;var _0x4c6dcf=_0x1f08[_0x1387b2];return _0x4c6dcf;};'use strict';var _=require(_0x81f0('0x0'));var util=require(_0x81f0('0x1'));var logger=require(_0x81f0('0x2'))(_0x81f0('0x3'));var moment=require(_0x81f0('0x4'));var BPromise=require(_0x81f0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x81f0('0x6'));var rimraf=require(_0x81f0('0x7'));var config=require(_0x81f0('0x8'));var attributes=require(_0x81f0('0x9'));var integrations=require(_0x81f0('0xa'));module[_0x81f0('0xb')]=function(_0x471d36,_0x485146){return _0x471d36[_0x81f0('0xc')]('DeskAccount',attributes,{'tableName':_0x81f0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdc66=['lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','int_desk_accounts'];(function(_0x259499,_0x37cd95){var _0x253b1c=function(_0x32989d){while(--_0x32989d){_0x259499['push'](_0x259499['shift']());}};_0x253b1c(++_0x37cd95);}(_0xdc66,0x15c));var _0x6dc6=function(_0x34022f,_0x21134c){_0x34022f=_0x34022f-0x0;var _0x1bebdf=_0xdc66[_0x34022f];return _0x1bebdf;};'use strict';var _=require(_0x6dc6('0x0'));var util=require(_0x6dc6('0x1'));var logger=require(_0x6dc6('0x2'))('api');var moment=require(_0x6dc6('0x3'));var BPromise=require(_0x6dc6('0x4'));var rp=require(_0x6dc6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6dc6('0x6'));var config=require(_0x6dc6('0x7'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0x6dc6('0x8'));module[_0x6dc6('0x9')]=function(_0x34de39,_0x433154){return _0x34de39[_0x6dc6('0xa')]('DeskAccount',attributes,{'tableName':_0x6dc6('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 22ac411..7a6973f 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 _0x35cf=['find','where','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','GetDeskAccount','findAll','options','raw','limit','include','map','attributes','model','then','ShowDeskAccount','DeskAccount'];(function(_0x34c570,_0x3a95a6){var _0xae81e9=function(_0x6c142d){while(--_0x6c142d){_0x34c570['push'](_0x34c570['shift']());}};_0xae81e9(++_0x3a95a6);}(_0x35cf,0x122));var _0xf35c=function(_0x209e12,_0x2ce907){_0x209e12=_0x209e12-0x0;var _0x3f5b89=_0x35cf[_0x209e12];return _0x3f5b89;};'use strict';var _=require(_0xf35c('0x0'));var util=require(_0xf35c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf35c('0x2'));var fs=require('fs');var Redis=require(_0xf35c('0x3'));var db=require(_0xf35c('0x4'))['db'];var utils=require(_0xf35c('0x5'));var logger=require(_0xf35c('0x6'))('rpc');var config=require(_0xf35c('0x7'));var jayson=require(_0xf35c('0x8'));var client=jayson[_0xf35c('0x9')][_0xf35c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b570d,_0x2ccee3,_0x59d456){return new BPromise(function(_0x261a0b,_0x103a72){return client['request'](_0x3b570d,_0x59d456)['then'](function(_0x30c5e8){logger[_0xf35c('0xb')](_0xf35c('0xc'),_0x2ccee3,'request\x20sent');logger[_0xf35c('0xd')](_0xf35c('0xe'),_0x2ccee3,'request\x20sent',JSON[_0xf35c('0xf')](_0x30c5e8));if(_0x30c5e8[_0xf35c('0x10')]){if(_0x30c5e8[_0xf35c('0x10')][_0xf35c('0x11')]===0x1f4){logger[_0xf35c('0x10')]('DeskAccount,\x20%s,\x20%s',_0x2ccee3,_0x30c5e8[_0xf35c('0x10')]['message']);return _0x103a72(_0x30c5e8[_0xf35c('0x10')][_0xf35c('0x12')]);}logger[_0xf35c('0x10')](_0xf35c('0xc'),_0x2ccee3,_0x30c5e8[_0xf35c('0x10')][_0xf35c('0x12')]);return _0x261a0b(_0x30c5e8[_0xf35c('0x10')][_0xf35c('0x12')]);}else{logger[_0xf35c('0xb')]('DeskAccount,\x20%s,\x20%s',_0x2ccee3,_0xf35c('0x13'));_0x261a0b(_0x30c5e8[_0xf35c('0x14')][_0xf35c('0x12')]);}})[_0xf35c('0x15')](function(_0x21413b){logger[_0xf35c('0x10')](_0xf35c('0xc'),_0x2ccee3,_0x21413b);_0x103a72(_0x21413b);});});}exports[_0xf35c('0x16')]=function(_0x339207){var _0x2ad04f=this;return new Promise(function(_0x5afcfe,_0x10ccdd){return db['DeskAccount'][_0xf35c('0x17')]({'raw':_0x339207[_0xf35c('0x18')]?_0x339207[_0xf35c('0x18')][_0xf35c('0x19')]===undefined?!![]:![]:!![],'where':_0x339207[_0xf35c('0x18')]?_0x339207[_0xf35c('0x18')]['where']||null:null,'attributes':_0x339207[_0xf35c('0x18')]?_0x339207['options']['attributes']||null:null,'limit':_0x339207[_0xf35c('0x18')]?_0x339207[_0xf35c('0x18')][_0xf35c('0x1a')]||null:null,'include':_0x339207[_0xf35c('0x18')]?_0x339207['options'][_0xf35c('0x1b')]?_[_0xf35c('0x1c')](_0x339207[_0xf35c('0x18')]['include'],function(_0x315c68){return{'model':db[_0x315c68['model']],'as':_0x315c68['as'],'attributes':_0x315c68[_0xf35c('0x1d')],'include':_0x315c68[_0xf35c('0x1b')]?_[_0xf35c('0x1c')](_0x315c68[_0xf35c('0x1b')],function(_0x2c23f3){return{'model':db[_0x2c23f3[_0xf35c('0x1e')]],'as':_0x2c23f3['as'],'attributes':_0x2c23f3[_0xf35c('0x1d')],'include':_0x2c23f3[_0xf35c('0x1b')]?_[_0xf35c('0x1c')](_0x2c23f3['include'],function(_0x39fe7b){return{'model':db[_0x39fe7b['model']],'as':_0x39fe7b['as'],'attributes':_0x39fe7b[_0xf35c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf35c('0x1f')](function(_0x277298){logger['info'](_0xf35c('0x16'),_0x339207);logger[_0xf35c('0xd')](_0xf35c('0x16'),_0x339207,JSON[_0xf35c('0xf')](_0x277298));_0x5afcfe(_0x277298);})[_0xf35c('0x15')](function(_0x41f6ea){logger[_0xf35c('0x10')](_0xf35c('0x16'),_0x41f6ea[_0xf35c('0x12')],_0x339207);_0x10ccdd(_0x2ad04f[_0xf35c('0x10')](0x1f4,_0x41f6ea[_0xf35c('0x12')]));});});};exports[_0xf35c('0x20')]=function(_0x29bd52){var _0x2efa58=this;return new Promise(function(_0x42b0df,_0x133bc4){return db[_0xf35c('0x21')][_0xf35c('0x22')]({'raw':_0x29bd52['options']?_0x29bd52[_0xf35c('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x29bd52[_0xf35c('0x18')]?_0x29bd52[_0xf35c('0x18')][_0xf35c('0x23')]||null:null,'attributes':_0x29bd52[_0xf35c('0x18')]?_0x29bd52[_0xf35c('0x18')]['attributes']||null:null,'include':_0x29bd52[_0xf35c('0x18')]?_0x29bd52[_0xf35c('0x18')][_0xf35c('0x1b')]?_[_0xf35c('0x1c')](_0x29bd52[_0xf35c('0x18')][_0xf35c('0x1b')],function(_0x50f47f){return{'model':db[_0x50f47f['model']],'as':_0x50f47f['as'],'attributes':_0x50f47f[_0xf35c('0x1d')],'include':_0x50f47f[_0xf35c('0x1b')]?_['map'](_0x50f47f[_0xf35c('0x1b')],function(_0x16cebe){return{'model':db[_0x16cebe[_0xf35c('0x1e')]],'as':_0x16cebe['as'],'attributes':_0x16cebe[_0xf35c('0x1d')],'include':_0x16cebe['include']?_['map'](_0x16cebe[_0xf35c('0x1b')],function(_0xaff12d){return{'model':db[_0xaff12d[_0xf35c('0x1e')]],'as':_0xaff12d['as'],'attributes':_0xaff12d[_0xf35c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf35c('0x1f')](function(_0x4b4d41){logger['info'](_0xf35c('0x20'),_0x29bd52);logger[_0xf35c('0xd')]('ShowDeskAccount',_0x29bd52,JSON[_0xf35c('0xf')](_0x4b4d41));_0x42b0df(_0x4b4d41);})[_0xf35c('0x15')](function(_0x445b1c){logger[_0xf35c('0x10')](_0xf35c('0x20'),_0x445b1c[_0xf35c('0x12')],_0x29bd52);_0x133bc4(_0x2efa58['error'](0x1f4,_0x445b1c[_0xf35c('0x12')]));});});}; \ No newline at end of file +var _0x2af8=['model','map','then','debug','ShowDeskAccount','find','where','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','stringify','error','code','DeskAccount,\x20%s,\x20%s','message','result','catch','GetDeskAccount','DeskAccount','options','raw','attributes','limit','include'];(function(_0x325827,_0x8a25b8){var _0x3742f6=function(_0x55e824){while(--_0x55e824){_0x325827['push'](_0x325827['shift']());}};_0x3742f6(++_0x8a25b8);}(_0x2af8,0x1d5));var _0x82af=function(_0x46ede1,_0x4b3481){_0x46ede1=_0x46ede1-0x0;var _0x136b75=_0x2af8[_0x46ede1];return _0x136b75;};'use strict';var _=require('lodash');var util=require(_0x82af('0x0'));var moment=require('moment');var BPromise=require(_0x82af('0x1'));var rs=require(_0x82af('0x2'));var fs=require('fs');var Redis=require(_0x82af('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x82af('0x4'));var logger=require('../../config/logger')(_0x82af('0x5'));var config=require(_0x82af('0x6'));var jayson=require(_0x82af('0x7'));var client=jayson[_0x82af('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48e0b8,_0x1e34d5,_0x1d0559){return new BPromise(function(_0xb8b1f1,_0x55969e){return client[_0x82af('0x9')](_0x48e0b8,_0x1d0559)['then'](function(_0x20c928){logger[_0x82af('0xa')]('DeskAccount,\x20%s,\x20%s',_0x1e34d5,_0x82af('0xb'));logger['debug']('DeskAccount,\x20%s,\x20%s,\x20%s',_0x1e34d5,_0x82af('0xb'),JSON[_0x82af('0xc')](_0x20c928));if(_0x20c928[_0x82af('0xd')]){if(_0x20c928[_0x82af('0xd')][_0x82af('0xe')]===0x1f4){logger['error'](_0x82af('0xf'),_0x1e34d5,_0x20c928[_0x82af('0xd')]['message']);return _0x55969e(_0x20c928[_0x82af('0xd')]['message']);}logger[_0x82af('0xd')](_0x82af('0xf'),_0x1e34d5,_0x20c928[_0x82af('0xd')][_0x82af('0x10')]);return _0xb8b1f1(_0x20c928[_0x82af('0xd')][_0x82af('0x10')]);}else{logger[_0x82af('0xa')](_0x82af('0xf'),_0x1e34d5,_0x82af('0xb'));_0xb8b1f1(_0x20c928[_0x82af('0x11')][_0x82af('0x10')]);}})[_0x82af('0x12')](function(_0x2158ed){logger[_0x82af('0xd')](_0x82af('0xf'),_0x1e34d5,_0x2158ed);_0x55969e(_0x2158ed);});});}exports[_0x82af('0x13')]=function(_0x5d6b78){var _0x23b81d=this;return new Promise(function(_0x10471a,_0x39546b){return db[_0x82af('0x14')]['findAll']({'raw':_0x5d6b78[_0x82af('0x15')]?_0x5d6b78[_0x82af('0x15')][_0x82af('0x16')]===undefined?!![]:![]:!![],'where':_0x5d6b78[_0x82af('0x15')]?_0x5d6b78['options']['where']||null:null,'attributes':_0x5d6b78[_0x82af('0x15')]?_0x5d6b78[_0x82af('0x15')][_0x82af('0x17')]||null:null,'limit':_0x5d6b78[_0x82af('0x15')]?_0x5d6b78[_0x82af('0x15')][_0x82af('0x18')]||null:null,'include':_0x5d6b78[_0x82af('0x15')]?_0x5d6b78[_0x82af('0x15')][_0x82af('0x19')]?_['map'](_0x5d6b78[_0x82af('0x15')][_0x82af('0x19')],function(_0x172406){return{'model':db[_0x172406[_0x82af('0x1a')]],'as':_0x172406['as'],'attributes':_0x172406[_0x82af('0x17')],'include':_0x172406[_0x82af('0x19')]?_[_0x82af('0x1b')](_0x172406[_0x82af('0x19')],function(_0x58e372){return{'model':db[_0x58e372[_0x82af('0x1a')]],'as':_0x58e372['as'],'attributes':_0x58e372[_0x82af('0x17')],'include':_0x58e372[_0x82af('0x19')]?_[_0x82af('0x1b')](_0x58e372[_0x82af('0x19')],function(_0xfc54bc){return{'model':db[_0xfc54bc[_0x82af('0x1a')]],'as':_0xfc54bc['as'],'attributes':_0xfc54bc['attributes']};}):[]};}):[]};}):[]:[]})[_0x82af('0x1c')](function(_0x498f8f){logger['info'](_0x82af('0x13'),_0x5d6b78);logger[_0x82af('0x1d')](_0x82af('0x13'),_0x5d6b78,JSON[_0x82af('0xc')](_0x498f8f));_0x10471a(_0x498f8f);})['catch'](function(_0x3a5766){logger[_0x82af('0xd')]('GetDeskAccount',_0x3a5766[_0x82af('0x10')],_0x5d6b78);_0x39546b(_0x23b81d['error'](0x1f4,_0x3a5766[_0x82af('0x10')]));});});};exports[_0x82af('0x1e')]=function(_0x15e782){var _0x1a1dd0=this;return new Promise(function(_0x510952,_0x3a04a5){return db[_0x82af('0x14')][_0x82af('0x1f')]({'raw':_0x15e782[_0x82af('0x15')]?_0x15e782[_0x82af('0x15')][_0x82af('0x16')]===undefined?!![]:![]:!![],'where':_0x15e782[_0x82af('0x15')]?_0x15e782[_0x82af('0x15')][_0x82af('0x20')]||null:null,'attributes':_0x15e782[_0x82af('0x15')]?_0x15e782['options'][_0x82af('0x17')]||null:null,'include':_0x15e782[_0x82af('0x15')]?_0x15e782[_0x82af('0x15')][_0x82af('0x19')]?_[_0x82af('0x1b')](_0x15e782[_0x82af('0x15')][_0x82af('0x19')],function(_0xd31293){return{'model':db[_0xd31293[_0x82af('0x1a')]],'as':_0xd31293['as'],'attributes':_0xd31293[_0x82af('0x17')],'include':_0xd31293[_0x82af('0x19')]?_[_0x82af('0x1b')](_0xd31293[_0x82af('0x19')],function(_0x2062a2){return{'model':db[_0x2062a2[_0x82af('0x1a')]],'as':_0x2062a2['as'],'attributes':_0x2062a2[_0x82af('0x17')],'include':_0x2062a2[_0x82af('0x19')]?_[_0x82af('0x1b')](_0x2062a2['include'],function(_0x28a171){return{'model':db[_0x28a171['model']],'as':_0x28a171['as'],'attributes':_0x28a171[_0x82af('0x17')]};}):[]};}):[]};}):[]:[]})[_0x82af('0x1c')](function(_0x1a83fb){logger[_0x82af('0xa')]('ShowDeskAccount',_0x15e782);logger['debug'](_0x82af('0x1e'),_0x15e782,JSON[_0x82af('0xc')](_0x1a83fb));_0x510952(_0x1a83fb);})[_0x82af('0x12')](function(_0x142adb){logger[_0x82af('0xd')](_0x82af('0x1e'),_0x142adb['message'],_0x15e782);_0x3a04a5(_0x1a1dd0[_0x82af('0xd')](0x1f4,_0x142adb[_0x82af('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 361b6cb..25153b1 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 _0x34e8=['../../config/environment','./intDeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2135d3,_0x152021){var _0x4d18c8=function(_0x17a8d3){while(--_0x17a8d3){_0x2135d3['push'](_0x2135d3['shift']());}};_0x4d18c8(++_0x152021);}(_0x34e8,0x12c));var _0x834e=function(_0x233399,_0x39e146){_0x233399=_0x233399-0x0;var _0x1da82a=_0x34e8[_0x233399];return _0x1da82a;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xa')](_0x834e('0xf'),auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0xa')](_0x834e('0x11'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0xa')](_0x834e('0x13'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);router[_0x834e('0xa')](_0x834e('0x15'),auth['isAuthenticated'](),controller[_0x834e('0x16')]);router[_0x834e('0x17')]('/',auth['isAuthenticated'](),controller[_0x834e('0x18')]);router[_0x834e('0x17')](_0x834e('0x15'),auth[_0x834e('0xd')](),controller['setTags']);router[_0x834e('0x19')](_0x834e('0xc'),auth['isAuthenticated'](),controller[_0x834e('0x1a')]);router['delete'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller['destroy']);module[_0x834e('0x1b')]=router; \ No newline at end of file +var _0x9c44=['destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intDeskConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','/:id/tags','post','setTags','put','update'];(function(_0x4df35e,_0x3b6a73){var _0x3e3bdd=function(_0x5dcf35){while(--_0x5dcf35){_0x4df35e['push'](_0x4df35e['shift']());}};_0x3e3bdd(++_0x3b6a73);}(_0x9c44,0x178));var _0x49c4=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x9c44[_0x5608a3];return _0x1ed50a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['show']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['get']('/:id/subjects',auth[_0x49c4('0x7')](),controller[_0x49c4('0xd')]);router['get'](_0x49c4('0xe'),auth[_0x49c4('0x7')](),controller['getDescriptions']);router['get'](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller['getTags']);router[_0x49c4('0x10')]('/',auth[_0x49c4('0x7')](),controller['create']);router[_0x49c4('0x10')](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x11')]);router[_0x49c4('0x12')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x13')]);router['delete'](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);module[_0x49c4('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 0bd43f2..5823118 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 _0x2f72=['exports','STRING','sequelize'];(function(_0x25fd78,_0x122c90){var _0x1200f2=function(_0x24d056){while(--_0x24d056){_0x25fd78['push'](_0x25fd78['shift']());}};_0x1200f2(++_0x122c90);}(_0x2f72,0x80));var _0x22f7=function(_0x55494a,_0x1c2701){_0x55494a=_0x55494a-0x0;var _0x2f38ee=_0x2f72[_0x55494a];return _0x2f38ee;};'use strict';var Sequelize=require(_0x22f7('0x0'));module[_0x22f7('0x1')]={'name':{'type':Sequelize[_0x22f7('0x2')]},'description':{'type':Sequelize[_0x22f7('0x2')]}}; \ No newline at end of file +var _0x7439=['STRING'];(function(_0xcfc44,_0x179bc1){var _0x307a25=function(_0x2b64de){while(--_0x2b64de){_0xcfc44['push'](_0xcfc44['shift']());}};_0x307a25(++_0x179bc1);}(_0x7439,0x95));var _0x9743=function(_0x285102,_0x5be94e){_0x285102=_0x285102-0x0;var _0x3edcc0=_0x7439[_0x285102];return _0x3edcc0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9743('0x0')]},'description':{'type':Sequelize[_0x9743('0x0')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index cc15ea7..2a0ed47 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 _0xc79e=['offset','limit','count','set','Content-Range','apply','reject','save','then','destroy','stack','name','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','DeskConfiguration','findAll','catch','show','params','includeAll','include','find','body','getFields','findOne','getSubjects','DeskField','getDescriptions','getTags','setTags','ids','eml-format','zip-dir','request-promise','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json'];(function(_0xbf55e0,_0x4d0a2a){var _0x43f51b=function(_0x93e352){while(--_0x93e352){_0xbf55e0['push'](_0xbf55e0['shift']());}};_0x43f51b(++_0x4d0a2a);}(_0xc79e,0x7e));var _0xec79=function(_0x10a2ea,_0x487cf2){_0x10a2ea=_0x10a2ea-0x0;var _0x347b66=_0xc79e[_0x10a2ea];return _0x347b66;};'use strict';var emlformat=require(_0xec79('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xec79('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xec79('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xec79('0x3'));var util=require(_0xec79('0x4'));var path=require(_0xec79('0x5'));var sox=require(_0xec79('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xec79('0x7'));var _=require(_0xec79('0x8'));var squel=require(_0xec79('0x9'));var crypto=require(_0xec79('0xa'));var jsforce=require(_0xec79('0xb'));var deskjs=require(_0xec79('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xec79('0xd'));var Redis=require('ioredis');var authService=require(_0xec79('0xe'));var qs=require(_0xec79('0xf'));var as=require(_0xec79('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xec79('0x11'))(_0xec79('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xec79('0x13'));var db=require(_0xec79('0x14'))['db'];function respondWithStatusCode(_0x56cc9a,_0xc76b6e){_0xc76b6e=_0xc76b6e||0xcc;return function(_0x1ba3ed){if(_0x1ba3ed){return _0x56cc9a[_0xec79('0x15')](_0xc76b6e);}return _0x56cc9a[_0xec79('0x16')](_0xc76b6e)['end']();};}function respondWithResult(_0x1d4150,_0x6e8660){_0x6e8660=_0x6e8660||0xc8;return function(_0x427141){if(_0x427141){return _0x1d4150[_0xec79('0x16')](_0x6e8660)[_0xec79('0x17')](_0x427141);}};}function respondWithFilteredResult(_0x3a3196,_0x31d6a1){return function(_0x58211d){if(_0x58211d){var _0x4eed3e=typeof _0x31d6a1[_0xec79('0x18')]==='undefined'&&typeof _0x31d6a1[_0xec79('0x19')]==='undefined';var _0x1c7a7b=_0x58211d['count'];var _0x19569c=_0x4eed3e?0x0:_0x31d6a1[_0xec79('0x18')];var _0x3f8d72=_0x4eed3e?_0x58211d[_0xec79('0x1a')]:_0x31d6a1[_0xec79('0x18')]+_0x31d6a1[_0xec79('0x19')];var _0x30cc0c;if(_0x3f8d72>=_0x1c7a7b){_0x3f8d72=_0x1c7a7b;_0x30cc0c=0xc8;}else{_0x30cc0c=0xce;}_0x3a3196[_0xec79('0x16')](_0x30cc0c);return _0x3a3196[_0xec79('0x1b')](_0xec79('0x1c'),_0x19569c+'-'+_0x3f8d72+'/'+_0x1c7a7b)['json'](_0x58211d);}return null;};}function patchUpdates(_0x52376d){return function(_0xdb33dd){try{jsonpatch[_0xec79('0x1d')](_0xdb33dd,_0x52376d,!![]);}catch(_0x3d9775){return BPromise[_0xec79('0x1e')](_0x3d9775);}return _0xdb33dd[_0xec79('0x1f')]();};}function saveUpdates(_0xe598dd,_0x32f27c){return function(_0x58e046){if(_0x58e046){return _0x58e046['update'](_0xe598dd)[_0xec79('0x20')](function(_0x32f9d7){return _0x32f9d7;});}return null;};}function removeEntity(_0x210d2d,_0x5e6343){return function(_0x101590){if(_0x101590){return _0x101590[_0xec79('0x21')]()[_0xec79('0x20')](function(){_0x210d2d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xa30cc0,_0x3c09fb){return function(_0xe03997){if(!_0xe03997){_0xa30cc0['sendStatus'](0x194);}return _0xe03997;};}function handleError(_0x2b08bb,_0x1b73aa){_0x1b73aa=_0x1b73aa||0x1f4;return function(_0x4a4080){logger['error'](_0x4a4080[_0xec79('0x22')]);if(_0x4a4080[_0xec79('0x23')]){delete _0x4a4080['name'];}_0x2b08bb[_0xec79('0x16')](_0x1b73aa)['send'](_0x4a4080);};}exports['index']=function(_0x8259a4,_0x4980b0){var _0x5f2d7a={},_0x5920f5={},_0x1318cc={'count':0x0,'rows':[]};var _0x260975=_[_0xec79('0x24')](db['DeskConfiguration'][_0xec79('0x25')],function(_0x30b2db){return{'name':_0x30b2db[_0xec79('0x26')],'type':_0x30b2db[_0xec79('0x27')]['key']};});_0x5920f5[_0xec79('0x28')]=_['map'](_0x260975,_0xec79('0x23'));_0x5920f5[_0xec79('0x29')]=_[_0xec79('0x2a')](_0x8259a4['query']);_0x5920f5[_0xec79('0x2b')]=_[_0xec79('0x2c')](_0x5920f5[_0xec79('0x28')],_0x5920f5[_0xec79('0x29')]);_0x5f2d7a[_0xec79('0x2d')]=_[_0xec79('0x2c')](_0x5920f5[_0xec79('0x28')],qs[_0xec79('0x2e')](_0x8259a4[_0xec79('0x29')]['fields']));_0x5f2d7a[_0xec79('0x2d')]=_0x5f2d7a[_0xec79('0x2d')][_0xec79('0x2f')]?_0x5f2d7a['attributes']:_0x5920f5['model'];if(!_0x8259a4[_0xec79('0x29')][_0xec79('0x30')](_0xec79('0x31'))){_0x5f2d7a[_0xec79('0x19')]=qs[_0xec79('0x19')](_0x8259a4['query'][_0xec79('0x19')]);_0x5f2d7a['offset']=qs[_0xec79('0x18')](_0x8259a4[_0xec79('0x29')][_0xec79('0x18')]);}_0x5f2d7a[_0xec79('0x32')]=qs['sort'](_0x8259a4['query'][_0xec79('0x33')]);_0x5f2d7a[_0xec79('0x34')]=qs[_0xec79('0x2b')](_[_0xec79('0x35')](_0x8259a4[_0xec79('0x29')],_0x5920f5[_0xec79('0x2b')]),_0x260975);if(_0x8259a4[_0xec79('0x29')]['filter']){_0x5f2d7a[_0xec79('0x34')]=_[_0xec79('0x36')](_0x5f2d7a[_0xec79('0x34')],{'$or':_[_0xec79('0x24')](_0x260975,function(_0x28de85){if(_0x28de85[_0xec79('0x27')]!==_0xec79('0x37')){var _0x592559={};_0x592559[_0x28de85[_0xec79('0x23')]]={'$like':'%'+_0x8259a4[_0xec79('0x29')][_0xec79('0x38')]+'%'};return _0x592559;}})});}_0x5f2d7a=_[_0xec79('0x36')]({},_0x5f2d7a,_0x8259a4[_0xec79('0x39')]);var _0x3861e0={'where':_0x5f2d7a[_0xec79('0x34')]};return db['DeskConfiguration'][_0xec79('0x1a')](_0x3861e0)[_0xec79('0x20')](function(_0x2cb8eb){_0x1318cc[_0xec79('0x1a')]=_0x2cb8eb;if(_0x8259a4['query']['includeAll']){_0x5f2d7a['include']=[{'all':!![]}];}return db[_0xec79('0x3a')][_0xec79('0x3b')](_0x5f2d7a);})[_0xec79('0x20')](function(_0x104387){_0x1318cc['rows']=_0x104387;return _0x1318cc;})['then'](respondWithFilteredResult(_0x4980b0,_0x5f2d7a))[_0xec79('0x3c')](handleError(_0x4980b0,null));};exports[_0xec79('0x3d')]=function(_0x236461,_0x410dbc){var _0xab602b={'raw':![],'where':{'id':_0x236461[_0xec79('0x3e')]['id']}},_0x247011={};_0x247011[_0xec79('0x28')]=_[_0xec79('0x2a')](db[_0xec79('0x3a')]['rawAttributes']);_0x247011[_0xec79('0x29')]=_[_0xec79('0x2a')](_0x236461[_0xec79('0x29')]);_0x247011[_0xec79('0x2b')]=_[_0xec79('0x2c')](_0x247011[_0xec79('0x28')],_0x247011['query']);_0xab602b[_0xec79('0x2d')]=_['intersection'](_0x247011[_0xec79('0x28')],qs[_0xec79('0x2e')](_0x236461['query'][_0xec79('0x2e')]));_0xab602b[_0xec79('0x2d')]=_0xab602b[_0xec79('0x2d')][_0xec79('0x2f')]?_0xab602b['attributes']:_0x247011[_0xec79('0x28')];if(_0x236461[_0xec79('0x29')][_0xec79('0x3f')]){_0xab602b[_0xec79('0x40')]=[{'all':!![]}];}_0xab602b=_[_0xec79('0x36')]({},_0xab602b,_0x236461[_0xec79('0x39')]);return db[_0xec79('0x3a')][_0xec79('0x41')](_0xab602b)[_0xec79('0x20')](handleEntityNotFound(_0x410dbc,null))[_0xec79('0x20')](respondWithResult(_0x410dbc,null))[_0xec79('0x3c')](handleError(_0x410dbc,null));};exports['create']=function(_0x1d8ce8,_0x1cf8bc){return db[_0xec79('0x3a')]['create'](_0x1d8ce8['body'],{})[_0xec79('0x20')](respondWithResult(_0x1cf8bc,0xc9))[_0xec79('0x3c')](handleError(_0x1cf8bc,null));};exports['update']=function(_0x5654e7,_0x41f151){if(_0x5654e7[_0xec79('0x42')]['id']){delete _0x5654e7[_0xec79('0x42')]['id'];}return db[_0xec79('0x3a')][_0xec79('0x41')]({'where':{'id':_0x5654e7[_0xec79('0x3e')]['id']}})[_0xec79('0x20')](handleEntityNotFound(_0x41f151,null))[_0xec79('0x20')](saveUpdates(_0x5654e7[_0xec79('0x42')],null))['then'](respondWithResult(_0x41f151,null))[_0xec79('0x3c')](handleError(_0x41f151,null));};exports[_0xec79('0x21')]=function(_0x167ee4,_0x57c28d){return db[_0xec79('0x3a')]['find']({'where':{'id':_0x167ee4[_0xec79('0x3e')]['id']}})[_0xec79('0x20')](handleEntityNotFound(_0x57c28d,null))[_0xec79('0x20')](removeEntity(_0x57c28d,null))[_0xec79('0x3c')](handleError(_0x57c28d,null));};exports[_0xec79('0x43')]=function(_0x577f54,_0x4c6c19,_0x292334){var _0x3cce05={};var _0x3ca848={};var _0x12ad01;var _0x398a0f;return db[_0xec79('0x3a')][_0xec79('0x44')]({'where':{'id':_0x577f54['params']['id']}})[_0xec79('0x20')](handleEntityNotFound(_0x4c6c19,null))[_0xec79('0x20')](function(_0x3b39e2){if(_0x3b39e2){_0x12ad01=_0x3b39e2;_0x3ca848[_0xec79('0x28')]=_['keys'](db['DeskField']['rawAttributes']);_0x3ca848[_0xec79('0x29')]=_[_0xec79('0x2a')](_0x577f54[_0xec79('0x29')]);_0x3ca848['filters']=_[_0xec79('0x2c')](_0x3ca848[_0xec79('0x28')],_0x3ca848[_0xec79('0x29')]);_0x3cce05[_0xec79('0x2d')]=_[_0xec79('0x2c')](_0x3ca848[_0xec79('0x28')],qs[_0xec79('0x2e')](_0x577f54[_0xec79('0x29')][_0xec79('0x2e')]));_0x3cce05[_0xec79('0x2d')]=_0x3cce05[_0xec79('0x2d')][_0xec79('0x2f')]?_0x3cce05['attributes']:_0x3ca848['model'];_0x3cce05['order']=qs[_0xec79('0x33')](_0x577f54[_0xec79('0x29')][_0xec79('0x33')]);_0x3cce05['where']=qs[_0xec79('0x2b')](_[_0xec79('0x35')](_0x577f54[_0xec79('0x29')],_0x3ca848[_0xec79('0x2b')]));if(_0x577f54['query'][_0xec79('0x38')]){_0x3cce05[_0xec79('0x34')]=_['merge'](_0x3cce05[_0xec79('0x34')],{'$or':_['map'](_0x3cce05[_0xec79('0x2d')],function(_0x3972ee){var _0x6989db={};_0x6989db[_0x3972ee]={'$like':'%'+_0x577f54['query'][_0xec79('0x38')]+'%'};return _0x6989db;})});}_0x3cce05=_[_0xec79('0x36')]({},_0x3cce05,_0x577f54[_0xec79('0x39')]);return _0x12ad01[_0xec79('0x43')](_0x3cce05);}})[_0xec79('0x20')](function(_0x58233c){if(_0x58233c){_0x398a0f=_0x58233c[_0xec79('0x2f')];if(!_0x577f54[_0xec79('0x29')][_0xec79('0x30')](_0xec79('0x31'))){_0x3cce05[_0xec79('0x19')]=qs[_0xec79('0x19')](_0x577f54[_0xec79('0x29')]['limit']);_0x3cce05[_0xec79('0x18')]=qs[_0xec79('0x18')](_0x577f54[_0xec79('0x29')]['offset']);}return _0x12ad01['getFields'](_0x3cce05);}})[_0xec79('0x20')](function(_0x404dfe){if(_0x404dfe){return _0x404dfe?{'count':_0x398a0f,'rows':_0x404dfe}:null;}})[_0xec79('0x20')](respondWithResult(_0x4c6c19,null))['catch'](handleError(_0x4c6c19,null));};exports[_0xec79('0x45')]=function(_0x521143,_0x1f0cb0,_0x5360ce){var _0x2e5173={};var _0x46351e={};var _0x2abebd;var _0x5bd308;return db['DeskConfiguration'][_0xec79('0x44')]({'where':{'id':_0x521143[_0xec79('0x3e')]['id']}})[_0xec79('0x20')](handleEntityNotFound(_0x1f0cb0,null))[_0xec79('0x20')](function(_0xe43b83){if(_0xe43b83){_0x2abebd=_0xe43b83;_0x46351e[_0xec79('0x28')]=_[_0xec79('0x2a')](db[_0xec79('0x46')][_0xec79('0x25')]);_0x46351e['query']=_[_0xec79('0x2a')](_0x521143[_0xec79('0x29')]);_0x46351e[_0xec79('0x2b')]=_[_0xec79('0x2c')](_0x46351e[_0xec79('0x28')],_0x46351e['query']);_0x2e5173[_0xec79('0x2d')]=_[_0xec79('0x2c')](_0x46351e[_0xec79('0x28')],qs[_0xec79('0x2e')](_0x521143[_0xec79('0x29')][_0xec79('0x2e')]));_0x2e5173[_0xec79('0x2d')]=_0x2e5173[_0xec79('0x2d')][_0xec79('0x2f')]?_0x2e5173[_0xec79('0x2d')]:_0x46351e[_0xec79('0x28')];_0x2e5173[_0xec79('0x32')]=qs[_0xec79('0x33')](_0x521143[_0xec79('0x29')][_0xec79('0x33')]);_0x2e5173['where']=qs['filters'](_[_0xec79('0x35')](_0x521143['query'],_0x46351e[_0xec79('0x2b')]));if(_0x521143['query'][_0xec79('0x38')]){_0x2e5173[_0xec79('0x34')]=_[_0xec79('0x36')](_0x2e5173[_0xec79('0x34')],{'$or':_[_0xec79('0x24')](_0x2e5173['attributes'],function(_0x5be919){var _0x5cf271={};_0x5cf271[_0x5be919]={'$like':'%'+_0x521143[_0xec79('0x29')][_0xec79('0x38')]+'%'};return _0x5cf271;})});}_0x2e5173=_[_0xec79('0x36')]({},_0x2e5173,_0x521143[_0xec79('0x39')]);return _0x2abebd[_0xec79('0x45')](_0x2e5173);}})[_0xec79('0x20')](function(_0x5b0167){if(_0x5b0167){_0x5bd308=_0x5b0167[_0xec79('0x2f')];if(!_0x521143[_0xec79('0x29')]['hasOwnProperty'](_0xec79('0x31'))){_0x2e5173[_0xec79('0x19')]=qs[_0xec79('0x19')](_0x521143[_0xec79('0x29')][_0xec79('0x19')]);_0x2e5173[_0xec79('0x18')]=qs[_0xec79('0x18')](_0x521143[_0xec79('0x29')]['offset']);}return _0x2abebd[_0xec79('0x45')](_0x2e5173);}})['then'](function(_0x4b667c){if(_0x4b667c){return _0x4b667c?{'count':_0x5bd308,'rows':_0x4b667c}:null;}})['then'](respondWithResult(_0x1f0cb0,null))[_0xec79('0x3c')](handleError(_0x1f0cb0,null));};exports[_0xec79('0x47')]=function(_0x1998c4,_0x5ed84c,_0x2c5ebf){var _0x4ef473={};var _0x3c3ee0={};var _0x47dff6;var _0x1c1dc5;return db[_0xec79('0x3a')]['findOne']({'where':{'id':_0x1998c4[_0xec79('0x3e')]['id']}})['then'](handleEntityNotFound(_0x5ed84c,null))[_0xec79('0x20')](function(_0x1fbabe){if(_0x1fbabe){_0x47dff6=_0x1fbabe;_0x3c3ee0[_0xec79('0x28')]=_[_0xec79('0x2a')](db[_0xec79('0x46')][_0xec79('0x25')]);_0x3c3ee0[_0xec79('0x29')]=_['keys'](_0x1998c4['query']);_0x3c3ee0[_0xec79('0x2b')]=_[_0xec79('0x2c')](_0x3c3ee0[_0xec79('0x28')],_0x3c3ee0[_0xec79('0x29')]);_0x4ef473['attributes']=_[_0xec79('0x2c')](_0x3c3ee0['model'],qs[_0xec79('0x2e')](_0x1998c4['query'][_0xec79('0x2e')]));_0x4ef473[_0xec79('0x2d')]=_0x4ef473['attributes'][_0xec79('0x2f')]?_0x4ef473[_0xec79('0x2d')]:_0x3c3ee0['model'];_0x4ef473['order']=qs[_0xec79('0x33')](_0x1998c4['query'][_0xec79('0x33')]);_0x4ef473[_0xec79('0x34')]=qs[_0xec79('0x2b')](_['pick'](_0x1998c4[_0xec79('0x29')],_0x3c3ee0[_0xec79('0x2b')]));if(_0x1998c4[_0xec79('0x29')][_0xec79('0x38')]){_0x4ef473[_0xec79('0x34')]=_[_0xec79('0x36')](_0x4ef473[_0xec79('0x34')],{'$or':_[_0xec79('0x24')](_0x4ef473[_0xec79('0x2d')],function(_0x29c819){var _0x4513d0={};_0x4513d0[_0x29c819]={'$like':'%'+_0x1998c4[_0xec79('0x29')][_0xec79('0x38')]+'%'};return _0x4513d0;})});}_0x4ef473=_[_0xec79('0x36')]({},_0x4ef473,_0x1998c4[_0xec79('0x39')]);return _0x47dff6[_0xec79('0x47')](_0x4ef473);}})['then'](function(_0x2f5d0d){if(_0x2f5d0d){_0x1c1dc5=_0x2f5d0d['length'];if(!_0x1998c4[_0xec79('0x29')][_0xec79('0x30')](_0xec79('0x31'))){_0x4ef473[_0xec79('0x19')]=qs[_0xec79('0x19')](_0x1998c4['query']['limit']);_0x4ef473['offset']=qs['offset'](_0x1998c4[_0xec79('0x29')][_0xec79('0x18')]);}return _0x47dff6[_0xec79('0x47')](_0x4ef473);}})[_0xec79('0x20')](function(_0x56296d){if(_0x56296d){return _0x56296d?{'count':_0x1c1dc5,'rows':_0x56296d}:null;}})[_0xec79('0x20')](respondWithResult(_0x5ed84c,null))[_0xec79('0x3c')](handleError(_0x5ed84c,null));};exports['getTags']=function(_0x40763f,_0x588838,_0x51984e){var _0xe4729={};var _0x12e772={};var _0x52fef7;var _0x1ee68c;return db[_0xec79('0x3a')]['findOne']({'where':{'id':_0x40763f['params']['id']}})[_0xec79('0x20')](handleEntityNotFound(_0x588838,null))['then'](function(_0x42e504){if(_0x42e504){_0x52fef7=_0x42e504;_0x12e772['model']=_[_0xec79('0x2a')](db['Tag'][_0xec79('0x25')]);_0x12e772[_0xec79('0x29')]=_[_0xec79('0x2a')](_0x40763f[_0xec79('0x29')]);_0x12e772[_0xec79('0x2b')]=_[_0xec79('0x2c')](_0x12e772['model'],_0x12e772[_0xec79('0x29')]);_0xe4729['attributes']=_[_0xec79('0x2c')](_0x12e772[_0xec79('0x28')],qs[_0xec79('0x2e')](_0x40763f[_0xec79('0x29')][_0xec79('0x2e')]));_0xe4729[_0xec79('0x2d')]=_0xe4729[_0xec79('0x2d')]['length']?_0xe4729[_0xec79('0x2d')]:_0x12e772[_0xec79('0x28')];_0xe4729[_0xec79('0x32')]=qs['sort'](_0x40763f[_0xec79('0x29')][_0xec79('0x33')]);_0xe4729[_0xec79('0x34')]=qs[_0xec79('0x2b')](_['pick'](_0x40763f[_0xec79('0x29')],_0x12e772['filters']));if(_0x40763f[_0xec79('0x29')][_0xec79('0x38')]){_0xe4729[_0xec79('0x34')]=_[_0xec79('0x36')](_0xe4729[_0xec79('0x34')],{'$or':_[_0xec79('0x24')](_0xe4729['attributes'],function(_0x57d728){var _0x374cae={};_0x374cae[_0x57d728]={'$like':'%'+_0x40763f['query'][_0xec79('0x38')]+'%'};return _0x374cae;})});}_0xe4729=_[_0xec79('0x36')]({},_0xe4729,_0x40763f[_0xec79('0x39')]);return _0x52fef7[_0xec79('0x48')](_0xe4729);}})['then'](function(_0x253426){if(_0x253426){_0x1ee68c=_0x253426['length'];if(!_0x40763f['query'][_0xec79('0x30')]('nolimit')){_0xe4729['limit']=qs[_0xec79('0x19')](_0x40763f['query']['limit']);_0xe4729['offset']=qs[_0xec79('0x18')](_0x40763f['query'][_0xec79('0x18')]);}return _0x52fef7[_0xec79('0x48')](_0xe4729);}})['then'](function(_0x492d9a){if(_0x492d9a){return _0x492d9a?{'count':_0x1ee68c,'rows':_0x492d9a}:null;}})['then'](respondWithResult(_0x588838,null))[_0xec79('0x3c')](handleError(_0x588838,null));};exports[_0xec79('0x49')]=function(_0x3f90f7,_0x1a5ee8,_0x3b6349){if(_0x3f90f7[_0xec79('0x42')]['id']){delete _0x3f90f7['body']['id'];}return db[_0xec79('0x3a')][_0xec79('0x44')]({'where':{'id':_0x3f90f7[_0xec79('0x3e')]['id']}})[_0xec79('0x20')](handleEntityNotFound(_0x1a5ee8,null))[_0xec79('0x20')](function(_0x23886a){if(_0x23886a){return _0x23886a[_0xec79('0x49')](_0x3f90f7[_0xec79('0x42')][_0xec79('0x4a')]||[]);}return null;})[_0xec79('0x20')](respondWithResult(_0x1a5ee8,null))[_0xec79('0x3c')](handleError(_0x1a5ee8,null));}; \ No newline at end of file +var _0x4fdb=['findAll','catch','params','fields','include','find','create','body','findOne','getFields','getSubjects','DeskField','getDescriptions','getTags','Tag','setTags','ids','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','DeskConfiguration','includeAll'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x4fdb,0x10d));var _0xb4fd=function(_0x25a8cc,_0x285a99){_0x25a8cc=_0x25a8cc-0x0;var _0x17d8ea=_0x4fdb[_0x25a8cc];return _0x17d8ea;};'use strict';var emlformat=require(_0xb4fd('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb4fd('0x1'));var rp=require(_0xb4fd('0x2'));var moment=require(_0xb4fd('0x3'));var BPromise=require(_0xb4fd('0x4'));var Mustache=require('mustache');var util=require(_0xb4fd('0x5'));var path=require(_0xb4fd('0x6'));var sox=require(_0xb4fd('0x7'));var csv=require(_0xb4fd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb4fd('0x9'));var squel=require(_0xb4fd('0xa'));var crypto=require(_0xb4fd('0xb'));var jsforce=require(_0xb4fd('0xc'));var deskjs=require(_0xb4fd('0xd'));var toCsv=require(_0xb4fd('0x8'));var querystring=require(_0xb4fd('0xe'));var Papa=require(_0xb4fd('0xf'));var Redis=require(_0xb4fd('0x10'));var authService=require(_0xb4fd('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb4fd('0x12'));var hardwareService=require(_0xb4fd('0x13'));var logger=require(_0xb4fd('0x14'))(_0xb4fd('0x15'));var utils=require(_0xb4fd('0x16'));var config=require(_0xb4fd('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb4fd('0x18'))['db'];function respondWithStatusCode(_0x497e7f,_0x1cbbba){_0x1cbbba=_0x1cbbba||0xcc;return function(_0x5b76ac){if(_0x5b76ac){return _0x497e7f[_0xb4fd('0x19')](_0x1cbbba);}return _0x497e7f['status'](_0x1cbbba)[_0xb4fd('0x1a')]();};}function respondWithResult(_0x4d2a2a,_0x2d2632){_0x2d2632=_0x2d2632||0xc8;return function(_0x4af5de){if(_0x4af5de){return _0x4d2a2a['status'](_0x2d2632)[_0xb4fd('0x1b')](_0x4af5de);}};}function respondWithFilteredResult(_0xd3816d,_0x5935d0){return function(_0x53ed95){if(_0x53ed95){var _0x5f19ce=typeof _0x5935d0[_0xb4fd('0x1c')]==='undefined'&&typeof _0x5935d0['limit']===_0xb4fd('0x1d');var _0x27a44e=_0x53ed95[_0xb4fd('0x1e')];var _0x1a44a0=_0x5f19ce?0x0:_0x5935d0[_0xb4fd('0x1c')];var _0x368395=_0x5f19ce?_0x53ed95[_0xb4fd('0x1e')]:_0x5935d0['offset']+_0x5935d0[_0xb4fd('0x1f')];var _0x1c10a6;if(_0x368395>=_0x27a44e){_0x368395=_0x27a44e;_0x1c10a6=0xc8;}else{_0x1c10a6=0xce;}_0xd3816d[_0xb4fd('0x20')](_0x1c10a6);return _0xd3816d[_0xb4fd('0x21')](_0xb4fd('0x22'),_0x1a44a0+'-'+_0x368395+'/'+_0x27a44e)[_0xb4fd('0x1b')](_0x53ed95);}return null;};}function patchUpdates(_0x2e3d9e){return function(_0x2d8e6c){try{jsonpatch[_0xb4fd('0x23')](_0x2d8e6c,_0x2e3d9e,!![]);}catch(_0x470a4d){return BPromise['reject'](_0x470a4d);}return _0x2d8e6c[_0xb4fd('0x24')]();};}function saveUpdates(_0x5ae242,_0x2ed200){return function(_0x469cb7){if(_0x469cb7){return _0x469cb7[_0xb4fd('0x25')](_0x5ae242)[_0xb4fd('0x26')](function(_0x3603cb){return _0x3603cb;});}return null;};}function removeEntity(_0x5abb2d,_0x51c822){return function(_0x41f6ab){if(_0x41f6ab){return _0x41f6ab[_0xb4fd('0x27')]()[_0xb4fd('0x26')](function(){_0x5abb2d['status'](0xcc)[_0xb4fd('0x1a')]();});}};}function handleEntityNotFound(_0x388836,_0x5a6365){return function(_0x133897){if(!_0x133897){_0x388836['sendStatus'](0x194);}return _0x133897;};}function handleError(_0x2feded,_0x7d6377){_0x7d6377=_0x7d6377||0x1f4;return function(_0x2e5d8f){logger[_0xb4fd('0x28')](_0x2e5d8f[_0xb4fd('0x29')]);if(_0x2e5d8f['name']){delete _0x2e5d8f[_0xb4fd('0x2a')];}_0x2feded[_0xb4fd('0x20')](_0x7d6377)[_0xb4fd('0x2b')](_0x2e5d8f);};}exports['index']=function(_0x322f27,_0xd84ac6){var _0x240e0e={},_0x469810={},_0x579161={'count':0x0,'rows':[]};var _0x3c42b6=_[_0xb4fd('0x2c')](db['DeskConfiguration'][_0xb4fd('0x2d')],function(_0x326168){return{'name':_0x326168[_0xb4fd('0x2e')],'type':_0x326168['type']['key']};});_0x469810[_0xb4fd('0x2f')]=_[_0xb4fd('0x2c')](_0x3c42b6,_0xb4fd('0x2a'));_0x469810[_0xb4fd('0x30')]=_[_0xb4fd('0x31')](_0x322f27[_0xb4fd('0x30')]);_0x469810['filters']=_['intersection'](_0x469810[_0xb4fd('0x2f')],_0x469810[_0xb4fd('0x30')]);_0x240e0e['attributes']=_[_0xb4fd('0x32')](_0x469810['model'],qs['fields'](_0x322f27[_0xb4fd('0x30')]['fields']));_0x240e0e[_0xb4fd('0x33')]=_0x240e0e['attributes'][_0xb4fd('0x34')]?_0x240e0e[_0xb4fd('0x33')]:_0x469810[_0xb4fd('0x2f')];if(!_0x322f27[_0xb4fd('0x30')][_0xb4fd('0x35')](_0xb4fd('0x36'))){_0x240e0e[_0xb4fd('0x1f')]=qs[_0xb4fd('0x1f')](_0x322f27[_0xb4fd('0x30')][_0xb4fd('0x1f')]);_0x240e0e['offset']=qs[_0xb4fd('0x1c')](_0x322f27[_0xb4fd('0x30')][_0xb4fd('0x1c')]);}_0x240e0e[_0xb4fd('0x37')]=qs[_0xb4fd('0x38')](_0x322f27['query']['sort']);_0x240e0e[_0xb4fd('0x39')]=qs[_0xb4fd('0x3a')](_[_0xb4fd('0x3b')](_0x322f27[_0xb4fd('0x30')],_0x469810[_0xb4fd('0x3a')]),_0x3c42b6);if(_0x322f27[_0xb4fd('0x30')]['filter']){_0x240e0e[_0xb4fd('0x39')]=_[_0xb4fd('0x3c')](_0x240e0e[_0xb4fd('0x39')],{'$or':_['map'](_0x3c42b6,function(_0x29ce16){if(_0x29ce16[_0xb4fd('0x3d')]!==_0xb4fd('0x3e')){var _0x1ec4a0={};_0x1ec4a0[_0x29ce16['name']]={'$like':'%'+_0x322f27['query'][_0xb4fd('0x3f')]+'%'};return _0x1ec4a0;}})});}_0x240e0e=_[_0xb4fd('0x3c')]({},_0x240e0e,_0x322f27[_0xb4fd('0x40')]);var _0x487749={'where':_0x240e0e[_0xb4fd('0x39')]};return db[_0xb4fd('0x41')][_0xb4fd('0x1e')](_0x487749)[_0xb4fd('0x26')](function(_0x1c1f49){_0x579161[_0xb4fd('0x1e')]=_0x1c1f49;if(_0x322f27[_0xb4fd('0x30')][_0xb4fd('0x42')]){_0x240e0e['include']=[{'all':!![]}];}return db[_0xb4fd('0x41')][_0xb4fd('0x43')](_0x240e0e);})[_0xb4fd('0x26')](function(_0x3eff88){_0x579161['rows']=_0x3eff88;return _0x579161;})['then'](respondWithFilteredResult(_0xd84ac6,_0x240e0e))[_0xb4fd('0x44')](handleError(_0xd84ac6,null));};exports['show']=function(_0x2d4859,_0x445d6b){var _0x47d2d9={'raw':![],'where':{'id':_0x2d4859[_0xb4fd('0x45')]['id']}},_0x2dcfc6={};_0x2dcfc6[_0xb4fd('0x2f')]=_[_0xb4fd('0x31')](db[_0xb4fd('0x41')][_0xb4fd('0x2d')]);_0x2dcfc6[_0xb4fd('0x30')]=_[_0xb4fd('0x31')](_0x2d4859['query']);_0x2dcfc6[_0xb4fd('0x3a')]=_[_0xb4fd('0x32')](_0x2dcfc6['model'],_0x2dcfc6[_0xb4fd('0x30')]);_0x47d2d9[_0xb4fd('0x33')]=_[_0xb4fd('0x32')](_0x2dcfc6[_0xb4fd('0x2f')],qs[_0xb4fd('0x46')](_0x2d4859[_0xb4fd('0x30')][_0xb4fd('0x46')]));_0x47d2d9[_0xb4fd('0x33')]=_0x47d2d9[_0xb4fd('0x33')][_0xb4fd('0x34')]?_0x47d2d9[_0xb4fd('0x33')]:_0x2dcfc6[_0xb4fd('0x2f')];if(_0x2d4859['query']['includeAll']){_0x47d2d9[_0xb4fd('0x47')]=[{'all':!![]}];}_0x47d2d9=_[_0xb4fd('0x3c')]({},_0x47d2d9,_0x2d4859[_0xb4fd('0x40')]);return db[_0xb4fd('0x41')][_0xb4fd('0x48')](_0x47d2d9)[_0xb4fd('0x26')](handleEntityNotFound(_0x445d6b,null))['then'](respondWithResult(_0x445d6b,null))['catch'](handleError(_0x445d6b,null));};exports['create']=function(_0x483bab,_0x311efd){return db['DeskConfiguration'][_0xb4fd('0x49')](_0x483bab[_0xb4fd('0x4a')],{})[_0xb4fd('0x26')](respondWithResult(_0x311efd,0xc9))[_0xb4fd('0x44')](handleError(_0x311efd,null));};exports[_0xb4fd('0x25')]=function(_0x4f651b,_0x1d8e8a){if(_0x4f651b[_0xb4fd('0x4a')]['id']){delete _0x4f651b[_0xb4fd('0x4a')]['id'];}return db[_0xb4fd('0x41')][_0xb4fd('0x48')]({'where':{'id':_0x4f651b[_0xb4fd('0x45')]['id']}})['then'](handleEntityNotFound(_0x1d8e8a,null))[_0xb4fd('0x26')](saveUpdates(_0x4f651b['body'],null))[_0xb4fd('0x26')](respondWithResult(_0x1d8e8a,null))[_0xb4fd('0x44')](handleError(_0x1d8e8a,null));};exports[_0xb4fd('0x27')]=function(_0x37f4e5,_0x348446){return db[_0xb4fd('0x41')][_0xb4fd('0x48')]({'where':{'id':_0x37f4e5[_0xb4fd('0x45')]['id']}})[_0xb4fd('0x26')](handleEntityNotFound(_0x348446,null))[_0xb4fd('0x26')](removeEntity(_0x348446,null))[_0xb4fd('0x44')](handleError(_0x348446,null));};exports['getFields']=function(_0x4a5ea6,_0x548f62,_0xcdd928){var _0x2b7f85={};var _0xca1fec={};var _0x2703e8;var _0x3b573e;return db[_0xb4fd('0x41')][_0xb4fd('0x4b')]({'where':{'id':_0x4a5ea6[_0xb4fd('0x45')]['id']}})[_0xb4fd('0x26')](handleEntityNotFound(_0x548f62,null))['then'](function(_0x99078b){if(_0x99078b){_0x2703e8=_0x99078b;_0xca1fec[_0xb4fd('0x2f')]=_[_0xb4fd('0x31')](db['DeskField'][_0xb4fd('0x2d')]);_0xca1fec[_0xb4fd('0x30')]=_[_0xb4fd('0x31')](_0x4a5ea6[_0xb4fd('0x30')]);_0xca1fec[_0xb4fd('0x3a')]=_['intersection'](_0xca1fec[_0xb4fd('0x2f')],_0xca1fec[_0xb4fd('0x30')]);_0x2b7f85[_0xb4fd('0x33')]=_[_0xb4fd('0x32')](_0xca1fec[_0xb4fd('0x2f')],qs['fields'](_0x4a5ea6[_0xb4fd('0x30')][_0xb4fd('0x46')]));_0x2b7f85[_0xb4fd('0x33')]=_0x2b7f85['attributes'][_0xb4fd('0x34')]?_0x2b7f85[_0xb4fd('0x33')]:_0xca1fec['model'];_0x2b7f85[_0xb4fd('0x37')]=qs[_0xb4fd('0x38')](_0x4a5ea6['query']['sort']);_0x2b7f85[_0xb4fd('0x39')]=qs[_0xb4fd('0x3a')](_[_0xb4fd('0x3b')](_0x4a5ea6['query'],_0xca1fec[_0xb4fd('0x3a')]));if(_0x4a5ea6[_0xb4fd('0x30')]['filter']){_0x2b7f85[_0xb4fd('0x39')]=_[_0xb4fd('0x3c')](_0x2b7f85[_0xb4fd('0x39')],{'$or':_[_0xb4fd('0x2c')](_0x2b7f85[_0xb4fd('0x33')],function(_0x48cdea){var _0x2d69d0={};_0x2d69d0[_0x48cdea]={'$like':'%'+_0x4a5ea6['query'][_0xb4fd('0x3f')]+'%'};return _0x2d69d0;})});}_0x2b7f85=_[_0xb4fd('0x3c')]({},_0x2b7f85,_0x4a5ea6[_0xb4fd('0x40')]);return _0x2703e8[_0xb4fd('0x4c')](_0x2b7f85);}})[_0xb4fd('0x26')](function(_0x1ce87c){if(_0x1ce87c){_0x3b573e=_0x1ce87c['length'];if(!_0x4a5ea6[_0xb4fd('0x30')]['hasOwnProperty'](_0xb4fd('0x36'))){_0x2b7f85[_0xb4fd('0x1f')]=qs['limit'](_0x4a5ea6[_0xb4fd('0x30')]['limit']);_0x2b7f85[_0xb4fd('0x1c')]=qs[_0xb4fd('0x1c')](_0x4a5ea6[_0xb4fd('0x30')][_0xb4fd('0x1c')]);}return _0x2703e8['getFields'](_0x2b7f85);}})['then'](function(_0x4d375f){if(_0x4d375f){return _0x4d375f?{'count':_0x3b573e,'rows':_0x4d375f}:null;}})[_0xb4fd('0x26')](respondWithResult(_0x548f62,null))[_0xb4fd('0x44')](handleError(_0x548f62,null));};exports[_0xb4fd('0x4d')]=function(_0x488344,_0x10403a,_0x42750f){var _0x5f01f5={};var _0x19afba={};var _0x34c28d;var _0x3306a7;return db['DeskConfiguration'][_0xb4fd('0x4b')]({'where':{'id':_0x488344[_0xb4fd('0x45')]['id']}})[_0xb4fd('0x26')](handleEntityNotFound(_0x10403a,null))['then'](function(_0xeba819){if(_0xeba819){_0x34c28d=_0xeba819;_0x19afba[_0xb4fd('0x2f')]=_[_0xb4fd('0x31')](db[_0xb4fd('0x4e')][_0xb4fd('0x2d')]);_0x19afba[_0xb4fd('0x30')]=_[_0xb4fd('0x31')](_0x488344[_0xb4fd('0x30')]);_0x19afba[_0xb4fd('0x3a')]=_[_0xb4fd('0x32')](_0x19afba[_0xb4fd('0x2f')],_0x19afba[_0xb4fd('0x30')]);_0x5f01f5['attributes']=_[_0xb4fd('0x32')](_0x19afba['model'],qs['fields'](_0x488344['query'][_0xb4fd('0x46')]));_0x5f01f5['attributes']=_0x5f01f5[_0xb4fd('0x33')]['length']?_0x5f01f5[_0xb4fd('0x33')]:_0x19afba[_0xb4fd('0x2f')];_0x5f01f5[_0xb4fd('0x37')]=qs[_0xb4fd('0x38')](_0x488344[_0xb4fd('0x30')][_0xb4fd('0x38')]);_0x5f01f5[_0xb4fd('0x39')]=qs[_0xb4fd('0x3a')](_[_0xb4fd('0x3b')](_0x488344[_0xb4fd('0x30')],_0x19afba['filters']));if(_0x488344[_0xb4fd('0x30')][_0xb4fd('0x3f')]){_0x5f01f5[_0xb4fd('0x39')]=_[_0xb4fd('0x3c')](_0x5f01f5[_0xb4fd('0x39')],{'$or':_[_0xb4fd('0x2c')](_0x5f01f5[_0xb4fd('0x33')],function(_0x49a52a){var _0x270489={};_0x270489[_0x49a52a]={'$like':'%'+_0x488344[_0xb4fd('0x30')][_0xb4fd('0x3f')]+'%'};return _0x270489;})});}_0x5f01f5=_[_0xb4fd('0x3c')]({},_0x5f01f5,_0x488344['options']);return _0x34c28d['getSubjects'](_0x5f01f5);}})[_0xb4fd('0x26')](function(_0xcb3c7c){if(_0xcb3c7c){_0x3306a7=_0xcb3c7c['length'];if(!_0x488344[_0xb4fd('0x30')]['hasOwnProperty']('nolimit')){_0x5f01f5[_0xb4fd('0x1f')]=qs[_0xb4fd('0x1f')](_0x488344[_0xb4fd('0x30')]['limit']);_0x5f01f5[_0xb4fd('0x1c')]=qs[_0xb4fd('0x1c')](_0x488344[_0xb4fd('0x30')]['offset']);}return _0x34c28d['getSubjects'](_0x5f01f5);}})['then'](function(_0xc3e6cc){if(_0xc3e6cc){return _0xc3e6cc?{'count':_0x3306a7,'rows':_0xc3e6cc}:null;}})[_0xb4fd('0x26')](respondWithResult(_0x10403a,null))['catch'](handleError(_0x10403a,null));};exports[_0xb4fd('0x4f')]=function(_0x3e940b,_0x41f8ae,_0x2ce4c8){var _0x4f5f67={};var _0x2d0555={};var _0x4d106c;var _0x357aab;return db[_0xb4fd('0x41')]['findOne']({'where':{'id':_0x3e940b[_0xb4fd('0x45')]['id']}})[_0xb4fd('0x26')](handleEntityNotFound(_0x41f8ae,null))[_0xb4fd('0x26')](function(_0x637580){if(_0x637580){_0x4d106c=_0x637580;_0x2d0555['model']=_[_0xb4fd('0x31')](db[_0xb4fd('0x4e')]['rawAttributes']);_0x2d0555[_0xb4fd('0x30')]=_[_0xb4fd('0x31')](_0x3e940b[_0xb4fd('0x30')]);_0x2d0555['filters']=_[_0xb4fd('0x32')](_0x2d0555[_0xb4fd('0x2f')],_0x2d0555[_0xb4fd('0x30')]);_0x4f5f67[_0xb4fd('0x33')]=_[_0xb4fd('0x32')](_0x2d0555[_0xb4fd('0x2f')],qs[_0xb4fd('0x46')](_0x3e940b[_0xb4fd('0x30')][_0xb4fd('0x46')]));_0x4f5f67[_0xb4fd('0x33')]=_0x4f5f67['attributes'][_0xb4fd('0x34')]?_0x4f5f67[_0xb4fd('0x33')]:_0x2d0555['model'];_0x4f5f67['order']=qs[_0xb4fd('0x38')](_0x3e940b['query']['sort']);_0x4f5f67['where']=qs['filters'](_[_0xb4fd('0x3b')](_0x3e940b['query'],_0x2d0555[_0xb4fd('0x3a')]));if(_0x3e940b[_0xb4fd('0x30')][_0xb4fd('0x3f')]){_0x4f5f67['where']=_[_0xb4fd('0x3c')](_0x4f5f67[_0xb4fd('0x39')],{'$or':_[_0xb4fd('0x2c')](_0x4f5f67['attributes'],function(_0x5ce42e){var _0x4a5e98={};_0x4a5e98[_0x5ce42e]={'$like':'%'+_0x3e940b['query']['filter']+'%'};return _0x4a5e98;})});}_0x4f5f67=_['merge']({},_0x4f5f67,_0x3e940b[_0xb4fd('0x40')]);return _0x4d106c[_0xb4fd('0x4f')](_0x4f5f67);}})[_0xb4fd('0x26')](function(_0x4b87a2){if(_0x4b87a2){_0x357aab=_0x4b87a2[_0xb4fd('0x34')];if(!_0x3e940b['query'][_0xb4fd('0x35')](_0xb4fd('0x36'))){_0x4f5f67[_0xb4fd('0x1f')]=qs[_0xb4fd('0x1f')](_0x3e940b[_0xb4fd('0x30')][_0xb4fd('0x1f')]);_0x4f5f67[_0xb4fd('0x1c')]=qs[_0xb4fd('0x1c')](_0x3e940b[_0xb4fd('0x30')][_0xb4fd('0x1c')]);}return _0x4d106c['getDescriptions'](_0x4f5f67);}})[_0xb4fd('0x26')](function(_0x395436){if(_0x395436){return _0x395436?{'count':_0x357aab,'rows':_0x395436}:null;}})['then'](respondWithResult(_0x41f8ae,null))['catch'](handleError(_0x41f8ae,null));};exports[_0xb4fd('0x50')]=function(_0x3a9eb2,_0x1f385d,_0xfb4309){var _0x166fc0={};var _0x5ce8de={};var _0xc510ba;var _0x371406;return db[_0xb4fd('0x41')][_0xb4fd('0x4b')]({'where':{'id':_0x3a9eb2[_0xb4fd('0x45')]['id']}})['then'](handleEntityNotFound(_0x1f385d,null))[_0xb4fd('0x26')](function(_0x121871){if(_0x121871){_0xc510ba=_0x121871;_0x5ce8de[_0xb4fd('0x2f')]=_[_0xb4fd('0x31')](db[_0xb4fd('0x51')]['rawAttributes']);_0x5ce8de[_0xb4fd('0x30')]=_[_0xb4fd('0x31')](_0x3a9eb2[_0xb4fd('0x30')]);_0x5ce8de['filters']=_[_0xb4fd('0x32')](_0x5ce8de[_0xb4fd('0x2f')],_0x5ce8de[_0xb4fd('0x30')]);_0x166fc0[_0xb4fd('0x33')]=_[_0xb4fd('0x32')](_0x5ce8de[_0xb4fd('0x2f')],qs['fields'](_0x3a9eb2['query'][_0xb4fd('0x46')]));_0x166fc0[_0xb4fd('0x33')]=_0x166fc0[_0xb4fd('0x33')]['length']?_0x166fc0[_0xb4fd('0x33')]:_0x5ce8de['model'];_0x166fc0['order']=qs[_0xb4fd('0x38')](_0x3a9eb2[_0xb4fd('0x30')][_0xb4fd('0x38')]);_0x166fc0[_0xb4fd('0x39')]=qs[_0xb4fd('0x3a')](_['pick'](_0x3a9eb2[_0xb4fd('0x30')],_0x5ce8de[_0xb4fd('0x3a')]));if(_0x3a9eb2[_0xb4fd('0x30')][_0xb4fd('0x3f')]){_0x166fc0['where']=_[_0xb4fd('0x3c')](_0x166fc0[_0xb4fd('0x39')],{'$or':_[_0xb4fd('0x2c')](_0x166fc0[_0xb4fd('0x33')],function(_0x46cc84){var _0x693888={};_0x693888[_0x46cc84]={'$like':'%'+_0x3a9eb2[_0xb4fd('0x30')]['filter']+'%'};return _0x693888;})});}_0x166fc0=_[_0xb4fd('0x3c')]({},_0x166fc0,_0x3a9eb2['options']);return _0xc510ba[_0xb4fd('0x50')](_0x166fc0);}})[_0xb4fd('0x26')](function(_0x2cd28a){if(_0x2cd28a){_0x371406=_0x2cd28a[_0xb4fd('0x34')];if(!_0x3a9eb2[_0xb4fd('0x30')][_0xb4fd('0x35')]('nolimit')){_0x166fc0[_0xb4fd('0x1f')]=qs[_0xb4fd('0x1f')](_0x3a9eb2[_0xb4fd('0x30')]['limit']);_0x166fc0[_0xb4fd('0x1c')]=qs[_0xb4fd('0x1c')](_0x3a9eb2[_0xb4fd('0x30')][_0xb4fd('0x1c')]);}return _0xc510ba[_0xb4fd('0x50')](_0x166fc0);}})[_0xb4fd('0x26')](function(_0x9f6d06){if(_0x9f6d06){return _0x9f6d06?{'count':_0x371406,'rows':_0x9f6d06}:null;}})['then'](respondWithResult(_0x1f385d,null))['catch'](handleError(_0x1f385d,null));};exports[_0xb4fd('0x52')]=function(_0x3f318a,_0xcd8832,_0xaa583e){if(_0x3f318a[_0xb4fd('0x4a')]['id']){delete _0x3f318a[_0xb4fd('0x4a')]['id'];}return db[_0xb4fd('0x41')][_0xb4fd('0x4b')]({'where':{'id':_0x3f318a[_0xb4fd('0x45')]['id']}})[_0xb4fd('0x26')](handleEntityNotFound(_0xcd8832,null))[_0xb4fd('0x26')](function(_0x24219a){if(_0x24219a){return _0x24219a[_0xb4fd('0x52')](_0x3f318a['body'][_0xb4fd('0x53')]||[]);}return null;})['then'](respondWithResult(_0xcd8832,null))[_0xb4fd('0x44')](handleError(_0xcd8832,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index bf04552..8f292cb 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 _0x9949=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration'];(function(_0x202d24,_0x5e8641){var _0x2b3a8e=function(_0x4c7c4a){while(--_0x4c7c4a){_0x202d24['push'](_0x202d24['shift']());}};_0x2b3a8e(++_0x5e8641);}(_0x9949,0x1ad));var _0x9994=function(_0x1318b9,_0x3d9844){_0x1318b9=_0x1318b9-0x0;var _0x1ee487=_0x9949[_0x1318b9];return _0x1ee487;};'use strict';var _=require(_0x9994('0x0'));var util=require(_0x9994('0x1'));var logger=require(_0x9994('0x2'))('api');var moment=require(_0x9994('0x3'));var BPromise=require(_0x9994('0x4'));var rp=require(_0x9994('0x5'));var fs=require('fs');var path=require(_0x9994('0x6'));var rimraf=require(_0x9994('0x7'));var config=require(_0x9994('0x8'));var attributes=require(_0x9994('0x9'));module[_0x9994('0xa')]=function(_0x35f528,_0x99582f){return _0x35f528[_0x9994('0xb')](_0x9994('0xc'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9033=['../../config/logger','moment','bluebird','request-promise','../../config/environment','./intDeskConfiguration.attributes','define','DeskConfiguration','int_desk_configurations','lodash','util'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0x9033,0x1b6));var _0x3903=function(_0x5be0ef,_0x4875ee){_0x5be0ef=_0x5be0ef-0x0;var _0x55e448=_0x9033[_0x5be0ef];return _0x55e448;};'use strict';var _=require(_0x3903('0x0'));var util=require(_0x3903('0x1'));var logger=require(_0x3903('0x2'))('api');var moment=require(_0x3903('0x3'));var BPromise=require(_0x3903('0x4'));var rp=require(_0x3903('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3903('0x6'));var attributes=require(_0x3903('0x7'));module['exports']=function(_0x33ed5f,_0x39e5be){return _0x33ed5f[_0x3903('0x8')](_0x3903('0x9'),attributes,{'tableName':_0x3903('0xa'),'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 62d7e14..c1df810 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 _0x762e=['DeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x31a3b4,_0x4c5524){var _0x32c04b=function(_0x51d863){while(--_0x51d863){_0x31a3b4['push'](_0x31a3b4['shift']());}};_0x32c04b(++_0x4c5524);}(_0x762e,0xea));var _0xe762=function(_0x1b7500,_0x2eb0ed){_0x1b7500=_0x1b7500-0x0;var _0x12f833=_0x762e[_0x1b7500];return _0x12f833;};'use strict';var _=require(_0xe762('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe762('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe762('0x2'))['db'];var utils=require(_0xe762('0x3'));var logger=require(_0xe762('0x4'))('rpc');var config=require(_0xe762('0x5'));var jayson=require(_0xe762('0x6'));var client=jayson[_0xe762('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f4726,_0x7a1740,_0x2511ad){return new BPromise(function(_0xf20548,_0x26a4fc){return client[_0xe762('0x8')](_0x1f4726,_0x2511ad)['then'](function(_0x50dd96){logger[_0xe762('0x9')](_0xe762('0xa'),_0x7a1740,_0xe762('0xb'));logger[_0xe762('0xc')](_0xe762('0xd'),_0x7a1740,_0xe762('0xb'),JSON['stringify'](_0x50dd96));if(_0x50dd96[_0xe762('0xe')]){if(_0x50dd96[_0xe762('0xe')][_0xe762('0xf')]===0x1f4){logger['error'](_0xe762('0xa'),_0x7a1740,_0x50dd96['error'][_0xe762('0x10')]);return _0x26a4fc(_0x50dd96['error'][_0xe762('0x10')]);}logger[_0xe762('0xe')](_0xe762('0xa'),_0x7a1740,_0x50dd96['error']['message']);return _0xf20548(_0x50dd96[_0xe762('0xe')][_0xe762('0x10')]);}else{logger[_0xe762('0x9')](_0xe762('0xa'),_0x7a1740,_0xe762('0xb'));_0xf20548(_0x50dd96[_0xe762('0x11')][_0xe762('0x10')]);}})[_0xe762('0x12')](function(_0x531587){logger[_0xe762('0xe')](_0xe762('0xa'),_0x7a1740,_0x531587);_0x26a4fc(_0x531587);});});} \ No newline at end of file +var _0xbd9e=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','debug','request\x20sent','error','message','result','catch','moment','randomstring'];(function(_0x2ab79b,_0xb88e5b){var _0x9a3251=function(_0x63383b){while(--_0x63383b){_0x2ab79b['push'](_0x2ab79b['shift']());}};_0x9a3251(++_0xb88e5b);}(_0xbd9e,0x108));var _0xebd9=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xbd9e[_0x4709c0];return _0x13348b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xebd9('0x0'));var BPromise=require('bluebird');var rs=require(_0xebd9('0x1'));var fs=require('fs');var Redis=require(_0xebd9('0x2'));var db=require(_0xebd9('0x3'))['db'];var utils=require(_0xebd9('0x4'));var logger=require(_0xebd9('0x5'))('rpc');var config=require(_0xebd9('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xebd9('0x7')][_0xebd9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xe1bf09,_0x23c503,_0x285c28){return new BPromise(function(_0x1f7734,_0x55e858){return client[_0xebd9('0x9')](_0xe1bf09,_0x285c28)[_0xebd9('0xa')](function(_0x12d27a){logger[_0xebd9('0xb')](_0xebd9('0xc'),_0x23c503,'request\x20sent');logger[_0xebd9('0xd')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x23c503,_0xebd9('0xe'),JSON['stringify'](_0x12d27a));if(_0x12d27a[_0xebd9('0xf')]){if(_0x12d27a[_0xebd9('0xf')]['code']===0x1f4){logger[_0xebd9('0xf')](_0xebd9('0xc'),_0x23c503,_0x12d27a['error'][_0xebd9('0x10')]);return _0x55e858(_0x12d27a[_0xebd9('0xf')][_0xebd9('0x10')]);}logger[_0xebd9('0xf')]('DeskConfiguration,\x20%s,\x20%s',_0x23c503,_0x12d27a[_0xebd9('0xf')][_0xebd9('0x10')]);return _0x1f7734(_0x12d27a[_0xebd9('0xf')][_0xebd9('0x10')]);}else{logger[_0xebd9('0xb')](_0xebd9('0xc'),_0x23c503,_0xebd9('0xe'));_0x1f7734(_0x12d27a[_0xebd9('0x11')][_0xebd9('0x10')]);}})[_0xebd9('0x12')](function(_0x37cdf3){logger[_0xebd9('0xf')](_0xebd9('0xc'),_0x23c503,_0x37cdf3);_0x55e858(_0x37cdf3);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 0200d1b..0611a33 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 _0x659b=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','show','post','create','put','/:id','update'];(function(_0x53431a,_0x5be6fd){var _0x40f61b=function(_0x56f5f5){while(--_0x56f5f5){_0x53431a['push'](_0x53431a['shift']());}};_0x40f61b(++_0x5be6fd);}(_0x659b,0x7a));var _0xb659=function(_0x58aac6,_0x12394c){_0x58aac6=_0x58aac6-0x0;var _0x59a1e2=_0x659b[_0x58aac6];return _0x59a1e2;};'use strict';var multer=require(_0xb659('0x0'));var util=require(_0xb659('0x1'));var path=require(_0xb659('0x2'));var timeout=require(_0xb659('0x3'));var express=require(_0xb659('0x4'));var router=express[_0xb659('0x5')]();var fs_extra=require(_0xb659('0x6'));var auth=require(_0xb659('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xb659('0x8'));var controller=require(_0xb659('0x9'));router[_0xb659('0xa')]('/',auth[_0xb659('0xb')](),controller['index']);router[_0xb659('0xa')]('/:id',auth[_0xb659('0xb')](),controller[_0xb659('0xc')]);router[_0xb659('0xd')]('/',auth[_0xb659('0xb')](),controller[_0xb659('0xe')]);router[_0xb659('0xf')](_0xb659('0x10'),auth[_0xb659('0xb')](),controller[_0xb659('0x11')]);router['delete'](_0xb659('0x10'),auth['isAuthenticated'](),controller[_0xb659('0x12')]);module[_0xb659('0x13')]=router; \ No newline at end of file +var _0xe67c=['create','put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskField.controller','index','get','/:id','isAuthenticated','show','post'];(function(_0x53b07e,_0x3bc254){var _0x5490b7=function(_0xd2e262){while(--_0xd2e262){_0x53b07e['push'](_0x53b07e['shift']());}};_0x5490b7(++_0x3bc254);}(_0xe67c,0x1a9));var _0xce67=function(_0x282610,_0x58da4a){_0x282610=_0x282610-0x0;var _0x2af03d=_0xe67c[_0x282610];return _0x2af03d;};'use strict';var multer=require(_0xce67('0x0'));var util=require(_0xce67('0x1'));var path=require('path');var timeout=require(_0xce67('0x2'));var express=require(_0xce67('0x3'));var router=express[_0xce67('0x4')]();var fs_extra=require(_0xce67('0x5'));var auth=require(_0xce67('0x6'));var interaction=require(_0xce67('0x7'));var config=require('../../config/environment');var controller=require(_0xce67('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xce67('0x9')]);router[_0xce67('0xa')](_0xce67('0xb'),auth[_0xce67('0xc')](),controller[_0xce67('0xd')]);router[_0xce67('0xe')]('/',auth[_0xce67('0xc')](),controller[_0xce67('0xf')]);router[_0xce67('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xce67('0x11')]);router['delete'](_0xce67('0xb'),auth[_0xce67('0xc')](),controller[_0xce67('0x12')]);module[_0xce67('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index e4710ee..69f8c81 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 _0x4526=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','ENUM','string'];(function(_0x2f3614,_0x4683c9){var _0x5851eb=function(_0x2c9e03){while(--_0x2c9e03){_0x2f3614['push'](_0x2f3614['shift']());}};_0x5851eb(++_0x4683c9);}(_0x4526,0x1b6));var _0x6452=function(_0x32e7ca,_0x31360a){_0x32e7ca=_0x32e7ca-0x0;var _0x1b4d58=_0x4526[_0x32e7ca];return _0x1b4d58;};'use strict';var Sequelize=require(_0x6452('0x0'));module['exports']={'type':{'type':Sequelize[_0x6452('0x1')](_0x6452('0x2'),_0x6452('0x3'),_0x6452('0x4'),_0x6452('0x5'),_0x6452('0x6')),'defaultValue':_0x6452('0x2')},'content':{'type':Sequelize[_0x6452('0x7')]},'key':{'type':Sequelize[_0x6452('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x6452('0x2'),_0x6452('0x3'),_0x6452('0x4'))},'keyContent':{'type':Sequelize[_0x6452('0x7')]},'idField':{'type':Sequelize[_0x6452('0x7')]},'nameField':{'type':Sequelize[_0x6452('0x7')]},'customField':{'type':Sequelize[_0x6452('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6452('0x7')]}}; \ No newline at end of file +var _0x13cb=['string','STRING','variable','customVariable','BOOLEAN','sequelize','exports','ENUM','keyValue','picklist'];(function(_0x3932eb,_0x43b210){var _0x5316e5=function(_0x1744e8){while(--_0x1744e8){_0x3932eb['push'](_0x3932eb['shift']());}};_0x5316e5(++_0x43b210);}(_0x13cb,0xff));var _0xb13c=function(_0x3dfea6,_0x5cd685){_0x3dfea6=_0x3dfea6-0x0;var _0x567aca=_0x13cb[_0x3dfea6];return _0x567aca;};'use strict';var Sequelize=require(_0xb13c('0x0'));module[_0xb13c('0x1')]={'type':{'type':Sequelize[_0xb13c('0x2')]('string','variable','customVariable',_0xb13c('0x3'),_0xb13c('0x4')),'defaultValue':_0xb13c('0x5')},'content':{'type':Sequelize[_0xb13c('0x6')]},'key':{'type':Sequelize[_0xb13c('0x6')]},'keyType':{'type':Sequelize[_0xb13c('0x2')](_0xb13c('0x5'),_0xb13c('0x7'),_0xb13c('0x8'))},'keyContent':{'type':Sequelize[_0xb13c('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xb13c('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index d9172b2..00f5596 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 _0xa6bb=['intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','findAll','rows','catch','params','keys','include','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','limit','Content-Range','apply','reject','update','then','error','stack','name','index','DeskField','type','model','map','query'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xa6bb,0x12c));var _0xba6b=function(_0x45b1c6,_0x195c7d){_0x45b1c6=_0x45b1c6-0x0;var _0x3d66a0=_0xa6bb[_0x45b1c6];return _0x3d66a0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xba6b('0x0'));var zipdir=require(_0xba6b('0x1'));var jsonpatch=require(_0xba6b('0x2'));var rp=require(_0xba6b('0x3'));var moment=require(_0xba6b('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xba6b('0x5'));var path=require(_0xba6b('0x6'));var sox=require(_0xba6b('0x7'));var csv=require(_0xba6b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xba6b('0x9'));var squel=require(_0xba6b('0xa'));var crypto=require(_0xba6b('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xba6b('0x8'));var querystring=require(_0xba6b('0xc'));var Papa=require(_0xba6b('0xd'));var Redis=require(_0xba6b('0xe'));var authService=require(_0xba6b('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xba6b('0x10'));var hardwareService=require(_0xba6b('0x11'));var logger=require(_0xba6b('0x12'))('api');var utils=require(_0xba6b('0x13'));var config=require(_0xba6b('0x14'));var licenseUtil=require(_0xba6b('0x15'));var db=require(_0xba6b('0x16'))['db'];function respondWithStatusCode(_0x55b6ab,_0x1e8473){_0x1e8473=_0x1e8473||0xcc;return function(_0x5b1d28){if(_0x5b1d28){return _0x55b6ab[_0xba6b('0x17')](_0x1e8473);}return _0x55b6ab[_0xba6b('0x18')](_0x1e8473)[_0xba6b('0x19')]();};}function respondWithResult(_0x15d4e2,_0x32144e){_0x32144e=_0x32144e||0xc8;return function(_0x53ec00){if(_0x53ec00){return _0x15d4e2[_0xba6b('0x18')](_0x32144e)[_0xba6b('0x1a')](_0x53ec00);}};}function respondWithFilteredResult(_0x50b58a,_0x16c3d0){return function(_0x1d280e){if(_0x1d280e){var _0x52b2ff=typeof _0x16c3d0['offset']===_0xba6b('0x1b')&&typeof _0x16c3d0['limit']==='undefined';var _0x5a553c=_0x1d280e['count'];var _0x4be059=_0x52b2ff?0x0:_0x16c3d0[_0xba6b('0x1c')];var _0x34aa97=_0x52b2ff?_0x1d280e[_0xba6b('0x1d')]:_0x16c3d0[_0xba6b('0x1c')]+_0x16c3d0[_0xba6b('0x1e')];var _0x15d1d2;if(_0x34aa97>=_0x5a553c){_0x34aa97=_0x5a553c;_0x15d1d2=0xc8;}else{_0x15d1d2=0xce;}_0x50b58a[_0xba6b('0x18')](_0x15d1d2);return _0x50b58a['set'](_0xba6b('0x1f'),_0x4be059+'-'+_0x34aa97+'/'+_0x5a553c)['json'](_0x1d280e);}return null;};}function patchUpdates(_0x54a392){return function(_0x13beca){try{jsonpatch[_0xba6b('0x20')](_0x13beca,_0x54a392,!![]);}catch(_0x3905ae){return BPromise[_0xba6b('0x21')](_0x3905ae);}return _0x13beca['save']();};}function saveUpdates(_0xa632cb,_0x436623){return function(_0x548c1b){if(_0x548c1b){return _0x548c1b[_0xba6b('0x22')](_0xa632cb)[_0xba6b('0x23')](function(_0x82b68f){return _0x82b68f;});}return null;};}function removeEntity(_0x12e4e6,_0x426641){return function(_0x5c2845){if(_0x5c2845){return _0x5c2845['destroy']()['then'](function(){_0x12e4e6['status'](0xcc)[_0xba6b('0x19')]();});}};}function handleEntityNotFound(_0x2525f8,_0x2f5343){return function(_0x39f052){if(!_0x39f052){_0x2525f8[_0xba6b('0x17')](0x194);}return _0x39f052;};}function handleError(_0x32375c,_0x591102){_0x591102=_0x591102||0x1f4;return function(_0x876e58){logger[_0xba6b('0x24')](_0x876e58[_0xba6b('0x25')]);if(_0x876e58['name']){delete _0x876e58[_0xba6b('0x26')];}_0x32375c[_0xba6b('0x18')](_0x591102)['send'](_0x876e58);};}exports[_0xba6b('0x27')]=function(_0x25d5e6,_0xea9fbc){var _0x41a0e0={},_0x506f14={},_0x506447={'count':0x0,'rows':[]};var _0x18a4c1=_['map'](db[_0xba6b('0x28')]['rawAttributes'],function(_0x1a6b93){return{'name':_0x1a6b93['fieldName'],'type':_0x1a6b93[_0xba6b('0x29')]['key']};});_0x506f14[_0xba6b('0x2a')]=_[_0xba6b('0x2b')](_0x18a4c1,_0xba6b('0x26'));_0x506f14[_0xba6b('0x2c')]=_['keys'](_0x25d5e6[_0xba6b('0x2c')]);_0x506f14['filters']=_['intersection'](_0x506f14[_0xba6b('0x2a')],_0x506f14[_0xba6b('0x2c')]);_0x41a0e0['attributes']=_[_0xba6b('0x2d')](_0x506f14['model'],qs['fields'](_0x25d5e6[_0xba6b('0x2c')][_0xba6b('0x2e')]));_0x41a0e0[_0xba6b('0x2f')]=_0x41a0e0[_0xba6b('0x2f')][_0xba6b('0x30')]?_0x41a0e0['attributes']:_0x506f14[_0xba6b('0x2a')];if(!_0x25d5e6[_0xba6b('0x2c')][_0xba6b('0x31')](_0xba6b('0x32'))){_0x41a0e0[_0xba6b('0x1e')]=qs[_0xba6b('0x1e')](_0x25d5e6[_0xba6b('0x2c')][_0xba6b('0x1e')]);_0x41a0e0[_0xba6b('0x1c')]=qs['offset'](_0x25d5e6[_0xba6b('0x2c')][_0xba6b('0x1c')]);}_0x41a0e0[_0xba6b('0x33')]=qs[_0xba6b('0x34')](_0x25d5e6['query']['sort']);_0x41a0e0[_0xba6b('0x35')]=qs[_0xba6b('0x36')](_[_0xba6b('0x37')](_0x25d5e6[_0xba6b('0x2c')],_0x506f14['filters']),_0x18a4c1);if(_0x25d5e6[_0xba6b('0x2c')][_0xba6b('0x38')]){_0x41a0e0['where']=_[_0xba6b('0x39')](_0x41a0e0['where'],{'$or':_[_0xba6b('0x2b')](_0x18a4c1,function(_0x36df21){if(_0x36df21[_0xba6b('0x29')]!=='VIRTUAL'){var _0x26c479={};_0x26c479[_0x36df21[_0xba6b('0x26')]]={'$like':'%'+_0x25d5e6['query'][_0xba6b('0x38')]+'%'};return _0x26c479;}})});}_0x41a0e0=_['merge']({},_0x41a0e0,_0x25d5e6[_0xba6b('0x3a')]);var _0x5cc07e={'where':_0x41a0e0[_0xba6b('0x35')]};return db['DeskField'][_0xba6b('0x1d')](_0x5cc07e)['then'](function(_0x37dcb6){_0x506447[_0xba6b('0x1d')]=_0x37dcb6;if(_0x25d5e6[_0xba6b('0x2c')][_0xba6b('0x3b')]){_0x41a0e0['include']=[{'all':!![]}];}return db[_0xba6b('0x28')][_0xba6b('0x3c')](_0x41a0e0);})[_0xba6b('0x23')](function(_0x31fe5a){_0x506447[_0xba6b('0x3d')]=_0x31fe5a;return _0x506447;})['then'](respondWithFilteredResult(_0xea9fbc,_0x41a0e0))[_0xba6b('0x3e')](handleError(_0xea9fbc,null));};exports['show']=function(_0x1f229b,_0x7cb298){var _0x5b710a={'raw':!![],'where':{'id':_0x1f229b[_0xba6b('0x3f')]['id']}},_0x57e9b5={};_0x57e9b5[_0xba6b('0x2a')]=_[_0xba6b('0x40')](db[_0xba6b('0x28')]['rawAttributes']);_0x57e9b5[_0xba6b('0x2c')]=_[_0xba6b('0x40')](_0x1f229b[_0xba6b('0x2c')]);_0x57e9b5[_0xba6b('0x36')]=_['intersection'](_0x57e9b5[_0xba6b('0x2a')],_0x57e9b5[_0xba6b('0x2c')]);_0x5b710a[_0xba6b('0x2f')]=_[_0xba6b('0x2d')](_0x57e9b5[_0xba6b('0x2a')],qs[_0xba6b('0x2e')](_0x1f229b['query'][_0xba6b('0x2e')]));_0x5b710a[_0xba6b('0x2f')]=_0x5b710a[_0xba6b('0x2f')]['length']?_0x5b710a[_0xba6b('0x2f')]:_0x57e9b5[_0xba6b('0x2a')];if(_0x1f229b[_0xba6b('0x2c')][_0xba6b('0x3b')]){_0x5b710a[_0xba6b('0x41')]=[{'all':!![]}];}_0x5b710a=_[_0xba6b('0x39')]({},_0x5b710a,_0x1f229b[_0xba6b('0x3a')]);return db[_0xba6b('0x28')]['find'](_0x5b710a)[_0xba6b('0x23')](handleEntityNotFound(_0x7cb298,null))[_0xba6b('0x23')](respondWithResult(_0x7cb298,null))[_0xba6b('0x3e')](handleError(_0x7cb298,null));};exports['create']=function(_0x2d231e,_0x37172b){return db[_0xba6b('0x28')][_0xba6b('0x42')](_0x2d231e[_0xba6b('0x43')],{})[_0xba6b('0x23')](respondWithResult(_0x37172b,0xc9))[_0xba6b('0x3e')](handleError(_0x37172b,null));};exports[_0xba6b('0x22')]=function(_0x2dea62,_0x5035b3){if(_0x2dea62[_0xba6b('0x43')]['id']){delete _0x2dea62[_0xba6b('0x43')]['id'];}return db[_0xba6b('0x28')][_0xba6b('0x44')]({'where':{'id':_0x2dea62[_0xba6b('0x3f')]['id']}})[_0xba6b('0x23')](handleEntityNotFound(_0x5035b3,null))[_0xba6b('0x23')](saveUpdates(_0x2dea62[_0xba6b('0x43')],null))[_0xba6b('0x23')](respondWithResult(_0x5035b3,null))[_0xba6b('0x3e')](handleError(_0x5035b3,null));};exports['destroy']=function(_0x40c0ea,_0x36d3db){return db['DeskField'][_0xba6b('0x44')]({'where':{'id':_0x40c0ea[_0xba6b('0x3f')]['id']}})[_0xba6b('0x23')](handleEntityNotFound(_0x36d3db,null))['then'](removeEntity(_0x36d3db,null))[_0xba6b('0x3e')](handleError(_0x36d3db,null));}; \ No newline at end of file +var _0x7409=['reject','update','then','destroy','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','DeskField','includeAll','include','findAll','rows','catch','merge','options','create','body','find','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','end','json','offset','limit','undefined','count','status','set','Content-Range','apply'];(function(_0x9f7ddb,_0x41c79f){var _0x164dd1=function(_0x1f7646){while(--_0x1f7646){_0x9f7ddb['push'](_0x9f7ddb['shift']());}};_0x164dd1(++_0x41c79f);}(_0x7409,0x6e));var _0x9740=function(_0x13b329,_0x5f2ca7){_0x13b329=_0x13b329-0x0;var _0x2c01bb=_0x7409[_0x13b329];return _0x2c01bb;};'use strict';var emlformat=require(_0x9740('0x0'));var rimraf=require(_0x9740('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9740('0x2'));var rp=require(_0x9740('0x3'));var moment=require(_0x9740('0x4'));var BPromise=require(_0x9740('0x5'));var Mustache=require(_0x9740('0x6'));var util=require(_0x9740('0x7'));var path=require(_0x9740('0x8'));var sox=require(_0x9740('0x9'));var csv=require(_0x9740('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9740('0xb'));var _=require(_0x9740('0xc'));var squel=require(_0x9740('0xd'));var crypto=require('crypto');var jsforce=require(_0x9740('0xe'));var deskjs=require(_0x9740('0xf'));var toCsv=require(_0x9740('0xa'));var querystring=require('querystring');var Papa=require(_0x9740('0x10'));var Redis=require('ioredis');var authService=require(_0x9740('0x11'));var qs=require(_0x9740('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9740('0x13'));var utils=require(_0x9740('0x14'));var config=require(_0x9740('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5263b3,_0x5a6773){_0x5a6773=_0x5a6773||0xcc;return function(_0x4adaae){if(_0x4adaae){return _0x5263b3['sendStatus'](_0x5a6773);}return _0x5263b3['status'](_0x5a6773)[_0x9740('0x16')]();};}function respondWithResult(_0x4d50ad,_0x495051){_0x495051=_0x495051||0xc8;return function(_0x12f130){if(_0x12f130){return _0x4d50ad['status'](_0x495051)[_0x9740('0x17')](_0x12f130);}};}function respondWithFilteredResult(_0x1d4aa8,_0x3c20ec){return function(_0x217a52){if(_0x217a52){var _0x480af9=typeof _0x3c20ec[_0x9740('0x18')]==='undefined'&&typeof _0x3c20ec[_0x9740('0x19')]===_0x9740('0x1a');var _0x8bf9df=_0x217a52[_0x9740('0x1b')];var _0x22843a=_0x480af9?0x0:_0x3c20ec[_0x9740('0x18')];var _0xd5d590=_0x480af9?_0x217a52[_0x9740('0x1b')]:_0x3c20ec[_0x9740('0x18')]+_0x3c20ec['limit'];var _0x28e655;if(_0xd5d590>=_0x8bf9df){_0xd5d590=_0x8bf9df;_0x28e655=0xc8;}else{_0x28e655=0xce;}_0x1d4aa8[_0x9740('0x1c')](_0x28e655);return _0x1d4aa8[_0x9740('0x1d')](_0x9740('0x1e'),_0x22843a+'-'+_0xd5d590+'/'+_0x8bf9df)[_0x9740('0x17')](_0x217a52);}return null;};}function patchUpdates(_0xdf62fc){return function(_0x3a785c){try{jsonpatch[_0x9740('0x1f')](_0x3a785c,_0xdf62fc,!![]);}catch(_0x56766c){return BPromise[_0x9740('0x20')](_0x56766c);}return _0x3a785c['save']();};}function saveUpdates(_0x1f8a78,_0x46d768){return function(_0x1af88e){if(_0x1af88e){return _0x1af88e[_0x9740('0x21')](_0x1f8a78)[_0x9740('0x22')](function(_0x34af43){return _0x34af43;});}return null;};}function removeEntity(_0x4e4627,_0x2550f2){return function(_0x192ab9){if(_0x192ab9){return _0x192ab9[_0x9740('0x23')]()[_0x9740('0x22')](function(){_0x4e4627[_0x9740('0x1c')](0xcc)[_0x9740('0x16')]();});}};}function handleEntityNotFound(_0x15aa2f,_0x278510){return function(_0x11ee90){if(!_0x11ee90){_0x15aa2f['sendStatus'](0x194);}return _0x11ee90;};}function handleError(_0xfb0753,_0x577323){_0x577323=_0x577323||0x1f4;return function(_0x4e5074){logger['error'](_0x4e5074['stack']);if(_0x4e5074[_0x9740('0x24')]){delete _0x4e5074[_0x9740('0x24')];}_0xfb0753[_0x9740('0x1c')](_0x577323)['send'](_0x4e5074);};}exports[_0x9740('0x25')]=function(_0x353630,_0x311e1b){var _0x4483a3={},_0x4cdccd={},_0x3bfa1f={'count':0x0,'rows':[]};var _0x3c826d=_[_0x9740('0x26')](db['DeskField'][_0x9740('0x27')],function(_0x3f6800){return{'name':_0x3f6800[_0x9740('0x28')],'type':_0x3f6800[_0x9740('0x29')][_0x9740('0x2a')]};});_0x4cdccd[_0x9740('0x2b')]=_[_0x9740('0x26')](_0x3c826d,_0x9740('0x24'));_0x4cdccd[_0x9740('0x2c')]=_[_0x9740('0x2d')](_0x353630['query']);_0x4cdccd[_0x9740('0x2e')]=_[_0x9740('0x2f')](_0x4cdccd[_0x9740('0x2b')],_0x4cdccd[_0x9740('0x2c')]);_0x4483a3[_0x9740('0x30')]=_[_0x9740('0x2f')](_0x4cdccd['model'],qs[_0x9740('0x31')](_0x353630['query']['fields']));_0x4483a3[_0x9740('0x30')]=_0x4483a3[_0x9740('0x30')][_0x9740('0x32')]?_0x4483a3[_0x9740('0x30')]:_0x4cdccd[_0x9740('0x2b')];if(!_0x353630['query'][_0x9740('0x33')](_0x9740('0x34'))){_0x4483a3[_0x9740('0x19')]=qs[_0x9740('0x19')](_0x353630[_0x9740('0x2c')][_0x9740('0x19')]);_0x4483a3[_0x9740('0x18')]=qs[_0x9740('0x18')](_0x353630[_0x9740('0x2c')][_0x9740('0x18')]);}_0x4483a3[_0x9740('0x35')]=qs[_0x9740('0x36')](_0x353630[_0x9740('0x2c')][_0x9740('0x36')]);_0x4483a3[_0x9740('0x37')]=qs[_0x9740('0x2e')](_[_0x9740('0x38')](_0x353630[_0x9740('0x2c')],_0x4cdccd[_0x9740('0x2e')]),_0x3c826d);if(_0x353630[_0x9740('0x2c')][_0x9740('0x39')]){_0x4483a3[_0x9740('0x37')]=_['merge'](_0x4483a3[_0x9740('0x37')],{'$or':_['map'](_0x3c826d,function(_0x221ff5){if(_0x221ff5[_0x9740('0x29')]!==_0x9740('0x3a')){var _0x3612a1={};_0x3612a1[_0x221ff5[_0x9740('0x24')]]={'$like':'%'+_0x353630[_0x9740('0x2c')][_0x9740('0x39')]+'%'};return _0x3612a1;}})});}_0x4483a3=_['merge']({},_0x4483a3,_0x353630['options']);var _0x54018a={'where':_0x4483a3[_0x9740('0x37')]};return db[_0x9740('0x3b')][_0x9740('0x1b')](_0x54018a)[_0x9740('0x22')](function(_0x38b1d9){_0x3bfa1f['count']=_0x38b1d9;if(_0x353630[_0x9740('0x2c')][_0x9740('0x3c')]){_0x4483a3[_0x9740('0x3d')]=[{'all':!![]}];}return db[_0x9740('0x3b')][_0x9740('0x3e')](_0x4483a3);})[_0x9740('0x22')](function(_0x4c5860){_0x3bfa1f[_0x9740('0x3f')]=_0x4c5860;return _0x3bfa1f;})[_0x9740('0x22')](respondWithFilteredResult(_0x311e1b,_0x4483a3))[_0x9740('0x40')](handleError(_0x311e1b,null));};exports['show']=function(_0x536b61,_0x62bf4e){var _0x199cd3={'raw':!![],'where':{'id':_0x536b61['params']['id']}},_0xcd85b3={};_0xcd85b3[_0x9740('0x2b')]=_[_0x9740('0x2d')](db[_0x9740('0x3b')]['rawAttributes']);_0xcd85b3[_0x9740('0x2c')]=_[_0x9740('0x2d')](_0x536b61[_0x9740('0x2c')]);_0xcd85b3[_0x9740('0x2e')]=_[_0x9740('0x2f')](_0xcd85b3['model'],_0xcd85b3[_0x9740('0x2c')]);_0x199cd3[_0x9740('0x30')]=_[_0x9740('0x2f')](_0xcd85b3['model'],qs[_0x9740('0x31')](_0x536b61[_0x9740('0x2c')]['fields']));_0x199cd3[_0x9740('0x30')]=_0x199cd3[_0x9740('0x30')][_0x9740('0x32')]?_0x199cd3[_0x9740('0x30')]:_0xcd85b3['model'];if(_0x536b61[_0x9740('0x2c')][_0x9740('0x3c')]){_0x199cd3[_0x9740('0x3d')]=[{'all':!![]}];}_0x199cd3=_[_0x9740('0x41')]({},_0x199cd3,_0x536b61[_0x9740('0x42')]);return db[_0x9740('0x3b')]['find'](_0x199cd3)[_0x9740('0x22')](handleEntityNotFound(_0x62bf4e,null))[_0x9740('0x22')](respondWithResult(_0x62bf4e,null))[_0x9740('0x40')](handleError(_0x62bf4e,null));};exports[_0x9740('0x43')]=function(_0x53e84b,_0x16d114){return db[_0x9740('0x3b')]['create'](_0x53e84b[_0x9740('0x44')],{})[_0x9740('0x22')](respondWithResult(_0x16d114,0xc9))[_0x9740('0x40')](handleError(_0x16d114,null));};exports['update']=function(_0xac3ed,_0x45df52){if(_0xac3ed[_0x9740('0x44')]['id']){delete _0xac3ed[_0x9740('0x44')]['id'];}return db[_0x9740('0x3b')][_0x9740('0x45')]({'where':{'id':_0xac3ed['params']['id']}})[_0x9740('0x22')](handleEntityNotFound(_0x45df52,null))[_0x9740('0x22')](saveUpdates(_0xac3ed[_0x9740('0x44')],null))[_0x9740('0x22')](respondWithResult(_0x45df52,null))['catch'](handleError(_0x45df52,null));};exports[_0x9740('0x23')]=function(_0x33e4e2,_0x41f7cb){return db['DeskField']['find']({'where':{'id':_0x33e4e2[_0x9740('0x46')]['id']}})[_0x9740('0x22')](handleEntityNotFound(_0x41f7cb,null))[_0x9740('0x22')](removeEntity(_0x41f7cb,null))['catch'](handleError(_0x41f7cb,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 7c28d8a..c9b7ea3 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 _0x7504=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','desk_unique_index','idField','util'];(function(_0x544039,_0xd3d293){var _0x4a6bbf=function(_0xf3230e){while(--_0xf3230e){_0x544039['push'](_0x544039['shift']());}};_0x4a6bbf(++_0xd3d293);}(_0x7504,0x95));var _0x4750=function(_0x1892e5,_0x42bf77){_0x1892e5=_0x1892e5-0x0;var _0x56fd2e=_0x7504[_0x1892e5];return _0x56fd2e;};'use strict';var _=require('lodash');var util=require(_0x4750('0x0'));var logger=require(_0x4750('0x1'))('api');var moment=require(_0x4750('0x2'));var BPromise=require(_0x4750('0x3'));var rp=require(_0x4750('0x4'));var fs=require('fs');var path=require(_0x4750('0x5'));var rimraf=require(_0x4750('0x6'));var config=require(_0x4750('0x7'));var attributes=require(_0x4750('0x8'));module[_0x4750('0x9')]=function(_0x5c9797,_0x5d8010){return _0x5c9797[_0x4750('0xa')](_0x4750('0xb'),attributes,{'tableName':_0x4750('0xc'),'paranoid':![],'indexes':[{'name':_0x4750('0xd'),'fields':[_0x4750('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9e74=['exports','idField','lodash','../../config/logger','bluebird','request-promise','path','./intDeskField.attributes'];(function(_0x5867cc,_0x1057fa){var _0x2965d2=function(_0x40bdd2){while(--_0x40bdd2){_0x5867cc['push'](_0x5867cc['shift']());}};_0x2965d2(++_0x1057fa);}(_0x9e74,0xba));var _0x49e7=function(_0x309a4c,_0x456826){_0x309a4c=_0x309a4c-0x0;var _0x325efc=_0x9e74[_0x309a4c];return _0x325efc;};'use strict';var _=require(_0x49e7('0x0'));var util=require('util');var logger=require(_0x49e7('0x1'))('api');var moment=require('moment');var BPromise=require(_0x49e7('0x2'));var rp=require(_0x49e7('0x3'));var fs=require('fs');var path=require(_0x49e7('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49e7('0x5'));module[_0x49e7('0x6')]=function(_0x3239dd,_0x544c7b){return _0x3239dd['define']('DeskField',attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0x49e7('0x7'),'FieldId'],'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 61562f2..5741b2b 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 _0x3aa1=['DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','request','info','DeskField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3dfb56,_0xfe844d){var _0x5e6e1b=function(_0x4e002f){while(--_0x4e002f){_0x3dfb56['push'](_0x3dfb56['shift']());}};_0x5e6e1b(++_0xfe844d);}(_0x3aa1,0x1ab));var _0x13aa=function(_0x279742,_0x1e2c40){_0x279742=_0x279742-0x0;var _0x302021=_0x3aa1[_0x279742];return _0x302021;};'use strict';var _=require('lodash');var util=require(_0x13aa('0x0'));var moment=require('moment');var BPromise=require(_0x13aa('0x1'));var rs=require(_0x13aa('0x2'));var fs=require('fs');var Redis=require(_0x13aa('0x3'));var db=require(_0x13aa('0x4'))['db'];var utils=require(_0x13aa('0x5'));var logger=require(_0x13aa('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x13aa('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x39bfd8,_0x1febca,_0x455768){return new BPromise(function(_0x21935e,_0x10038a){return client[_0x13aa('0x8')](_0x39bfd8,_0x455768)['then'](function(_0x45a517){logger[_0x13aa('0x9')](_0x13aa('0xa'),_0x1febca,_0x13aa('0xb'));logger[_0x13aa('0xc')](_0x13aa('0xd'),_0x1febca,_0x13aa('0xb'),JSON[_0x13aa('0xe')](_0x45a517));if(_0x45a517['error']){if(_0x45a517[_0x13aa('0xf')][_0x13aa('0x10')]===0x1f4){logger[_0x13aa('0xf')](_0x13aa('0xa'),_0x1febca,_0x45a517[_0x13aa('0xf')]['message']);return _0x10038a(_0x45a517[_0x13aa('0xf')]['message']);}logger['error'](_0x13aa('0xa'),_0x1febca,_0x45a517['error'][_0x13aa('0x11')]);return _0x21935e(_0x45a517[_0x13aa('0xf')][_0x13aa('0x11')]);}else{logger[_0x13aa('0x9')]('DeskField,\x20%s,\x20%s',_0x1febca,_0x13aa('0xb'));_0x21935e(_0x45a517[_0x13aa('0x12')]['message']);}})[_0x13aa('0x13')](function(_0x103eab){logger[_0x13aa('0xf')](_0x13aa('0xa'),_0x1febca,_0x103eab);_0x10038a(_0x103eab);});});} \ No newline at end of file +var _0x6c66=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','debug','DeskField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','DeskField,\x20%s,\x20%s','message','util','randomstring'];(function(_0x51b0dc,_0x5307b7){var _0x13fa89=function(_0x2c880f){while(--_0x2c880f){_0x51b0dc['push'](_0x51b0dc['shift']());}};_0x13fa89(++_0x5307b7);}(_0x6c66,0x18a));var _0x66c6=function(_0x158ad3,_0x4a4494){_0x158ad3=_0x158ad3-0x0;var _0x15eb0e=_0x6c66[_0x158ad3];return _0x15eb0e;};'use strict';var _=require('lodash');var util=require(_0x66c6('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x66c6('0x1'));var fs=require('fs');var Redis=require(_0x66c6('0x2'));var db=require(_0x66c6('0x3'))['db'];var utils=require(_0x66c6('0x4'));var logger=require('../../config/logger')(_0x66c6('0x5'));var config=require(_0x66c6('0x6'));var jayson=require(_0x66c6('0x7'));var client=jayson['client'][_0x66c6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4f782e,_0x20e943,_0x481d1a){return new BPromise(function(_0x5cb624,_0x4b7dd9){return client[_0x66c6('0x9')](_0x4f782e,_0x481d1a)['then'](function(_0x47d420){logger[_0x66c6('0xa')]('DeskField,\x20%s,\x20%s',_0x20e943,'request\x20sent');logger[_0x66c6('0xb')](_0x66c6('0xc'),_0x20e943,_0x66c6('0xd'),JSON['stringify'](_0x47d420));if(_0x47d420[_0x66c6('0xe')]){if(_0x47d420[_0x66c6('0xe')][_0x66c6('0xf')]===0x1f4){logger[_0x66c6('0xe')](_0x66c6('0x10'),_0x20e943,_0x47d420['error']['message']);return _0x4b7dd9(_0x47d420['error']['message']);}logger[_0x66c6('0xe')](_0x66c6('0x10'),_0x20e943,_0x47d420[_0x66c6('0xe')][_0x66c6('0x11')]);return _0x5cb624(_0x47d420[_0x66c6('0xe')][_0x66c6('0x11')]);}else{logger[_0x66c6('0xa')](_0x66c6('0x10'),_0x20e943,'request\x20sent');_0x5cb624(_0x47d420['result']['message']);}})['catch'](function(_0x21bfa6){logger[_0x66c6('0xe')](_0x66c6('0x10'),_0x20e943,_0x21bfa6);_0x4b7dd9(_0x21bfa6);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index bfb7c8f..f4b4423 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 _0x523d=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','/:id','isAuthenticated','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','update','destroy'];(function(_0x16031d,_0x49d429){var _0x318f0f=function(_0x3be6e2){while(--_0x3be6e2){_0x16031d['push'](_0x16031d['shift']());}};_0x318f0f(++_0x49d429);}(_0x523d,0x177));var _0xd523=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x523d[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xd523('0x0'));var util=require(_0xd523('0x1'));var path=require('path');var timeout=require(_0xd523('0x2'));var express=require(_0xd523('0x3'));var router=express[_0xd523('0x4')]();var fs_extra=require(_0xd523('0x5'));var auth=require(_0xd523('0x6'));var interaction=require(_0xd523('0x7'));var config=require(_0xd523('0x8'));var controller=require(_0xd523('0x9'));router[_0xd523('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd523('0xa')](_0xd523('0xb'),auth[_0xd523('0xc')](),controller['show']);router['get'](_0xd523('0xd'),auth[_0xd523('0xc')](),controller[_0xd523('0xe')]);router[_0xd523('0xa')]('/:id/fields',auth[_0xd523('0xc')](),controller[_0xd523('0xf')]);router[_0xd523('0x10')]('/',auth[_0xd523('0xc')](),controller[_0xd523('0x11')]);router[_0xd523('0x10')](_0xd523('0xd'),auth[_0xd523('0xc')](),controller[_0xd523('0x12')]);router['put'](_0xd523('0xb'),auth[_0xd523('0xc')](),controller[_0xd523('0x13')]);router['delete']('/:id',auth[_0xd523('0xc')](),controller[_0xd523('0x14')]);module[_0xd523('0x15')]=router; \ No newline at end of file +var _0xfbc2=['index','/:id','show','/:id/configurations','getConfigurations','post','create','addConfiguration','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated'];(function(_0x270adf,_0x1daaa3){var _0x29eda9=function(_0x40afec){while(--_0x40afec){_0x270adf['push'](_0x270adf['shift']());}};_0x29eda9(++_0x1daaa3);}(_0xfbc2,0x192));var _0x2fbc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfbc2[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x2fbc('0x0'));var util=require(_0x2fbc('0x1'));var path=require(_0x2fbc('0x2'));var timeout=require(_0x2fbc('0x3'));var express=require(_0x2fbc('0x4'));var router=express[_0x2fbc('0x5')]();var fs_extra=require(_0x2fbc('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x2fbc('0x7'));var config=require(_0x2fbc('0x8'));var controller=require(_0x2fbc('0x9'));router[_0x2fbc('0xa')]('/',auth[_0x2fbc('0xb')](),controller[_0x2fbc('0xc')]);router['get'](_0x2fbc('0xd'),auth[_0x2fbc('0xb')](),controller[_0x2fbc('0xe')]);router[_0x2fbc('0xa')](_0x2fbc('0xf'),auth[_0x2fbc('0xb')](),controller[_0x2fbc('0x10')]);router[_0x2fbc('0xa')]('/:id/fields',auth[_0x2fbc('0xb')](),controller['getFields']);router[_0x2fbc('0x11')]('/',auth[_0x2fbc('0xb')](),controller[_0x2fbc('0x12')]);router[_0x2fbc('0x11')](_0x2fbc('0xf'),auth[_0x2fbc('0xb')](),controller[_0x2fbc('0x13')]);router['put'](_0x2fbc('0xd'),auth['isAuthenticated'](),controller[_0x2fbc('0x14')]);router[_0x2fbc('0x15')]('/:id',auth[_0x2fbc('0xb')](),controller['destroy']);module[_0x2fbc('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 99d2317..c4b690a 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 _0x6c6f=['STRING','sequelize'];(function(_0x491eac,_0x1c27d1){var _0xebf9eb=function(_0x41c6eb){while(--_0x41c6eb){_0x491eac['push'](_0x491eac['shift']());}};_0xebf9eb(++_0x1c27d1);}(_0x6c6f,0x10b));var _0xf6c6=function(_0x5d3371,_0x1ac75a){_0x5d3371=_0x5d3371-0x0;var _0x4066db=_0x6c6f[_0x5d3371];return _0x4066db;};'use strict';var Sequelize=require(_0xf6c6('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xf6c6('0x1')]},'password':{'type':Sequelize[_0xf6c6('0x1')]},'remoteUri':{'type':Sequelize[_0xf6c6('0x1')]},'tenantId':{'type':Sequelize[_0xf6c6('0x1')]},'clientId':{'type':Sequelize[_0xf6c6('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xf6c6('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xf6c6('0x1')]}}; \ No newline at end of file +var _0xd144=['STRING','sequelize','exports'];(function(_0x1fbd5c,_0x1b17a6){var _0x4cda1a=function(_0x118358){while(--_0x118358){_0x1fbd5c['push'](_0x1fbd5c['shift']());}};_0x4cda1a(++_0x1b17a6);}(_0xd144,0x97));var _0x4d14=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd144[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4d14('0x0'));module[_0x4d14('0x1')]={'name':{'type':Sequelize[_0x4d14('0x2')]},'username':{'type':Sequelize[_0x4d14('0x2')]},'password':{'type':Sequelize[_0x4d14('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0x4d14('0x2')]},'clientId':{'type':Sequelize[_0x4d14('0x2')]},'clientSecret':{'type':Sequelize[_0x4d14('0x2')]},'serverUrl':{'type':Sequelize[_0x4d14('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 29d74f3..56ece9a 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 _0x24a6=['find','create','body','findOne','Dynamics365Configuration','getConfigurations','nolimit','Subjects','getSubjects','channel','Descriptions','Dynamics365Field','getFields','ticketType','PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contractdetailidname','createdbyexternalpartyname','createdbyname','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','slainvokedidname','slaname','socialprofileidname','statuscode','subjectidname','timezoneruleversionnumber','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','tenantId','slice','substring','lastIndexOf','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','clientId','clientSecret','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','4.0','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','error','stack','send','Wrong\x20credentials','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','DisplayName',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','name','Dynamics365Account','fieldName','type','key','map','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','rawAttributes','length'];(function(_0x1479d3,_0x2e81a9){var _0x45cfbc=function(_0x922fc7){while(--_0x922fc7){_0x1479d3['push'](_0x1479d3['shift']());}};_0x45cfbc(++_0x2e81a9);}(_0x24a6,0x14f));var _0x624a=function(_0x235643,_0x5ad6c6){_0x235643=_0x235643-0x0;var _0x520e96=_0x24a6[_0x235643];return _0x520e96;};'use strict';var emlformat=require(_0x624a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x624a('0x1'));var jsonpatch=require(_0x624a('0x2'));var rp=require(_0x624a('0x3'));var moment=require(_0x624a('0x4'));var BPromise=require(_0x624a('0x5'));var Mustache=require(_0x624a('0x6'));var util=require(_0x624a('0x7'));var path=require(_0x624a('0x8'));var sox=require(_0x624a('0x9'));var csv=require(_0x624a('0xa'));var ejs=require(_0x624a('0xb'));var fs=require('fs');var fs_extra=require(_0x624a('0xc'));var _=require(_0x624a('0xd'));var squel=require(_0x624a('0xe'));var crypto=require(_0x624a('0xf'));var jsforce=require(_0x624a('0x10'));var deskjs=require(_0x624a('0x11'));var toCsv=require(_0x624a('0xa'));var querystring=require(_0x624a('0x12'));var Papa=require(_0x624a('0x13'));var Redis=require(_0x624a('0x14'));var authService=require(_0x624a('0x15'));var qs=require(_0x624a('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x624a('0x17'))(_0x624a('0x18'));var utils=require(_0x624a('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x624a('0x1a'));var db=require(_0x624a('0x1b'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x50d1aa,_0x5406ce){_0x5406ce=_0x5406ce||0xcc;return function(_0x10080e){if(_0x10080e){return _0x50d1aa['sendStatus'](_0x5406ce);}return _0x50d1aa[_0x624a('0x1c')](_0x5406ce)[_0x624a('0x1d')]();};}function respondWithResult(_0xe310b4,_0x1e6ffd){_0x1e6ffd=_0x1e6ffd||0xc8;return function(_0x547e4f){if(_0x547e4f){return _0xe310b4[_0x624a('0x1c')](_0x1e6ffd)['json'](_0x547e4f);}};}function respondWithFilteredResult(_0x424200,_0x195bfc){return function(_0x53005e){if(_0x53005e){var _0x201751=typeof _0x195bfc[_0x624a('0x1e')]===_0x624a('0x1f')&&typeof _0x195bfc[_0x624a('0x20')]===_0x624a('0x1f');var _0x158b72=_0x53005e[_0x624a('0x21')];var _0x32d6a0=_0x201751?0x0:_0x195bfc[_0x624a('0x1e')];var _0x4721ac=_0x201751?_0x53005e['count']:_0x195bfc[_0x624a('0x1e')]+_0x195bfc['limit'];var _0x387b79;if(_0x4721ac>=_0x158b72){_0x4721ac=_0x158b72;_0x387b79=0xc8;}else{_0x387b79=0xce;}_0x424200['status'](_0x387b79);return _0x424200[_0x624a('0x22')](_0x624a('0x23'),_0x32d6a0+'-'+_0x4721ac+'/'+_0x158b72)[_0x624a('0x24')](_0x53005e);}return null;};}function patchUpdates(_0x200fdc){return function(_0x1c6f64){try{jsonpatch['apply'](_0x1c6f64,_0x200fdc,!![]);}catch(_0x3f459a){return BPromise[_0x624a('0x25')](_0x3f459a);}return _0x1c6f64[_0x624a('0x26')]();};}function saveUpdates(_0x22beca,_0x5dfeec){return function(_0x1a673b){if(_0x1a673b){return _0x1a673b[_0x624a('0x27')](_0x22beca)[_0x624a('0x28')](function(_0x4ba881){return _0x4ba881;});}return null;};}function removeEntity(_0x4aee03,_0x56834b){return function(_0x29257b){if(_0x29257b){return _0x29257b[_0x624a('0x29')]()[_0x624a('0x28')](function(){_0x4aee03[_0x624a('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ca99b,_0x2234dc){return function(_0x15ba91){if(!_0x15ba91){_0x5ca99b['sendStatus'](0x194);}return _0x15ba91;};}function handleError(_0xd0730c,_0x19b8a6){_0x19b8a6=_0x19b8a6||0x1f4;return function(_0x534c41){logger['error'](_0x534c41['stack']);if(_0x534c41[_0x624a('0x2a')]){delete _0x534c41[_0x624a('0x2a')];}_0xd0730c['status'](_0x19b8a6)['send'](_0x534c41);};}exports['index']=function(_0x422c20,_0x35c8d0){var _0x4dab19={},_0x55dff7={},_0x16178d={'count':0x0,'rows':[]};var _0x1ba339=_['map'](db[_0x624a('0x2b')]['rawAttributes'],function(_0x209ca5){return{'name':_0x209ca5[_0x624a('0x2c')],'type':_0x209ca5[_0x624a('0x2d')][_0x624a('0x2e')]};});_0x55dff7['model']=_[_0x624a('0x2f')](_0x1ba339,_0x624a('0x2a'));_0x55dff7['query']=_[_0x624a('0x30')](_0x422c20[_0x624a('0x31')]);_0x55dff7[_0x624a('0x32')]=_[_0x624a('0x33')](_0x55dff7[_0x624a('0x34')],_0x55dff7[_0x624a('0x31')]);_0x4dab19['attributes']=_['intersection'](_0x55dff7[_0x624a('0x34')],qs[_0x624a('0x35')](_0x422c20[_0x624a('0x31')]['fields']));_0x4dab19[_0x624a('0x36')]=_0x4dab19['attributes']['length']?_0x4dab19['attributes']:_0x55dff7[_0x624a('0x34')];if(!_0x422c20['query'][_0x624a('0x37')]('nolimit')){_0x4dab19[_0x624a('0x20')]=qs['limit'](_0x422c20['query'][_0x624a('0x20')]);_0x4dab19[_0x624a('0x1e')]=qs[_0x624a('0x1e')](_0x422c20[_0x624a('0x31')][_0x624a('0x1e')]);}_0x4dab19[_0x624a('0x38')]=qs[_0x624a('0x39')](_0x422c20[_0x624a('0x31')][_0x624a('0x39')]);_0x4dab19[_0x624a('0x3a')]=qs['filters'](_[_0x624a('0x3b')](_0x422c20[_0x624a('0x31')],_0x55dff7[_0x624a('0x32')]),_0x1ba339);if(_0x422c20[_0x624a('0x31')][_0x624a('0x3c')]){_0x4dab19['where']=_[_0x624a('0x3d')](_0x4dab19[_0x624a('0x3a')],{'$or':_[_0x624a('0x2f')](_0x1ba339,function(_0x2af5dc){if(_0x2af5dc[_0x624a('0x2d')]!==_0x624a('0x3e')){var _0x51499c={};_0x51499c[_0x2af5dc[_0x624a('0x2a')]]={'$like':'%'+_0x422c20[_0x624a('0x31')][_0x624a('0x3c')]+'%'};return _0x51499c;}})});}_0x4dab19=_['merge']({},_0x4dab19,_0x422c20[_0x624a('0x3f')]);var _0x561c1e={'where':_0x4dab19['where']};return db[_0x624a('0x2b')][_0x624a('0x21')](_0x561c1e)[_0x624a('0x28')](function(_0x4e0d70){_0x16178d['count']=_0x4e0d70;if(_0x422c20[_0x624a('0x31')][_0x624a('0x40')]){_0x4dab19['include']=[{'all':!![]}];}return db[_0x624a('0x2b')][_0x624a('0x41')](_0x4dab19);})['then'](function(_0x475b3f){_0x16178d[_0x624a('0x42')]=_0x475b3f;return _0x16178d;})[_0x624a('0x28')](respondWithFilteredResult(_0x35c8d0,_0x4dab19))[_0x624a('0x43')](handleError(_0x35c8d0,null));};exports['show']=function(_0x577ec5,_0x48e061){var _0x23168b={'raw':![],'where':{'id':_0x577ec5[_0x624a('0x44')]['id']}},_0x19de37={};_0x19de37[_0x624a('0x34')]=_[_0x624a('0x30')](db[_0x624a('0x2b')][_0x624a('0x45')]);_0x19de37['query']=_[_0x624a('0x30')](_0x577ec5[_0x624a('0x31')]);_0x19de37['filters']=_['intersection'](_0x19de37[_0x624a('0x34')],_0x19de37['query']);_0x23168b[_0x624a('0x36')]=_[_0x624a('0x33')](_0x19de37[_0x624a('0x34')],qs['fields'](_0x577ec5[_0x624a('0x31')][_0x624a('0x35')]));_0x23168b[_0x624a('0x36')]=_0x23168b[_0x624a('0x36')][_0x624a('0x46')]?_0x23168b['attributes']:_0x19de37[_0x624a('0x34')];if(_0x577ec5[_0x624a('0x31')][_0x624a('0x40')]){_0x23168b['include']=[{'all':!![]}];}_0x23168b=_[_0x624a('0x3d')]({},_0x23168b,_0x577ec5[_0x624a('0x3f')]);return db[_0x624a('0x2b')][_0x624a('0x47')](_0x23168b)[_0x624a('0x28')](handleEntityNotFound(_0x48e061,null))[_0x624a('0x28')](respondWithResult(_0x48e061,null))['catch'](handleError(_0x48e061,null));};exports[_0x624a('0x48')]=function(_0x519bce,_0x5a45b0){return db['Dynamics365Account'][_0x624a('0x48')](_0x519bce[_0x624a('0x49')],{})[_0x624a('0x28')](respondWithResult(_0x5a45b0,0xc9))[_0x624a('0x43')](handleError(_0x5a45b0,null));};exports['update']=function(_0x18c318,_0x4283ff){if(_0x18c318[_0x624a('0x49')]['id']){delete _0x18c318['body']['id'];}return db['Dynamics365Account'][_0x624a('0x47')]({'where':{'id':_0x18c318[_0x624a('0x44')]['id']}})[_0x624a('0x28')](handleEntityNotFound(_0x4283ff,null))[_0x624a('0x28')](saveUpdates(_0x18c318[_0x624a('0x49')],null))[_0x624a('0x28')](respondWithResult(_0x4283ff,null))['catch'](handleError(_0x4283ff,null));};exports[_0x624a('0x29')]=function(_0x47422e,_0x4ca80b){return db[_0x624a('0x2b')][_0x624a('0x47')]({'where':{'id':_0x47422e[_0x624a('0x44')]['id']}})[_0x624a('0x28')](handleEntityNotFound(_0x4ca80b,null))[_0x624a('0x28')](removeEntity(_0x4ca80b,null))[_0x624a('0x43')](handleError(_0x4ca80b,null));};exports['getConfigurations']=function(_0x8cb341,_0x4091f7,_0x584168){var _0x16cd1e={};var _0x280c30={};var _0x13bb41;var _0x52fc4e;return db[_0x624a('0x2b')][_0x624a('0x4a')]({'where':{'id':_0x8cb341[_0x624a('0x44')]['id']}})['then'](handleEntityNotFound(_0x4091f7,null))['then'](function(_0x590c83){if(_0x590c83){_0x13bb41=_0x590c83;_0x280c30[_0x624a('0x34')]=_[_0x624a('0x30')](db[_0x624a('0x4b')][_0x624a('0x45')]);_0x280c30[_0x624a('0x31')]=_['keys'](_0x8cb341[_0x624a('0x31')]);_0x280c30[_0x624a('0x32')]=_[_0x624a('0x33')](_0x280c30[_0x624a('0x34')],_0x280c30['query']);_0x16cd1e['attributes']=_[_0x624a('0x33')](_0x280c30[_0x624a('0x34')],qs['fields'](_0x8cb341['query'][_0x624a('0x35')]));_0x16cd1e[_0x624a('0x36')]=_0x16cd1e[_0x624a('0x36')]['length']?_0x16cd1e['attributes']:_0x280c30[_0x624a('0x34')];_0x16cd1e['order']=qs[_0x624a('0x39')](_0x8cb341[_0x624a('0x31')][_0x624a('0x39')]);_0x16cd1e[_0x624a('0x3a')]=qs['filters'](_[_0x624a('0x3b')](_0x8cb341[_0x624a('0x31')],_0x280c30[_0x624a('0x32')]));if(_0x8cb341[_0x624a('0x31')][_0x624a('0x3c')]){_0x16cd1e['where']=_[_0x624a('0x3d')](_0x16cd1e[_0x624a('0x3a')],{'$or':_[_0x624a('0x2f')](_0x16cd1e[_0x624a('0x36')],function(_0x21b73a){var _0x4b31bb={};_0x4b31bb[_0x21b73a]={'$like':'%'+_0x8cb341[_0x624a('0x31')]['filter']+'%'};return _0x4b31bb;})});}_0x16cd1e=_[_0x624a('0x3d')]({},_0x16cd1e,_0x8cb341[_0x624a('0x3f')]);return _0x13bb41[_0x624a('0x4c')](_0x16cd1e);}})[_0x624a('0x28')](function(_0x316fbe){if(_0x316fbe){_0x52fc4e=_0x316fbe[_0x624a('0x46')];if(!_0x8cb341[_0x624a('0x31')][_0x624a('0x37')](_0x624a('0x4d'))){_0x16cd1e['limit']=qs[_0x624a('0x20')](_0x8cb341[_0x624a('0x31')][_0x624a('0x20')]);_0x16cd1e[_0x624a('0x1e')]=qs[_0x624a('0x1e')](_0x8cb341['query']['offset']);}return _0x13bb41['getConfigurations'](_0x16cd1e);}})[_0x624a('0x28')](function(_0x501db3){if(_0x501db3){return _0x501db3?{'count':_0x52fc4e,'rows':_0x501db3}:null;}})[_0x624a('0x28')](respondWithResult(_0x4091f7,null))['catch'](handleError(_0x4091f7,null));};exports['addConfiguration']=function(_0x230bf3,_0x2d8513,_0xea678e){if(_0x230bf3['body']['id']){delete _0x230bf3[_0x624a('0x49')]['id'];}return db[_0x624a('0x2b')]['findOne']({'where':{'id':_0x230bf3['params']['id']}})[_0x624a('0x28')](handleEntityNotFound(_0x2d8513,null))[_0x624a('0x28')](function(_0x1ad121){if(_0x1ad121){_0x230bf3[_0x624a('0x49')]['AccountId']=_0x1ad121['id'];_0x230bf3[_0x624a('0x49')][_0x624a('0x4e')]=integrations[_0x624a('0x4f')](_0x230bf3['body'][_0x624a('0x50')],_0x230bf3[_0x624a('0x49')][_0x624a('0x2d')]);_0x230bf3[_0x624a('0x49')][_0x624a('0x51')]=integrations['getDescriptions'](_0x230bf3[_0x624a('0x49')][_0x624a('0x50')],_0x230bf3[_0x624a('0x49')][_0x624a('0x2d')]);return db[_0x624a('0x4b')][_0x624a('0x48')](_0x230bf3[_0x624a('0x49')],{'include':[{'model':db['Dynamics365Field'],'as':_0x624a('0x4e')},{'model':db[_0x624a('0x52')],'as':_0x624a('0x51')}]});}return null;})[_0x624a('0x28')](respondWithResult(_0x2d8513,null))[_0x624a('0x43')](handleError(_0x2d8513,null));};exports[_0x624a('0x53')]=function(_0x46a53f,_0x3f98aa,_0x5eae90){var _0x2de6d6=_0x46a53f[_0x624a('0x31')][_0x624a('0x54')];var _0x1c67c7=_0x2de6d6==='incident'?'Incident':_0x624a('0x55');var _0x75b962='';var _0x50033d='';var _0x3e32b9='';var _0x413e28='';var _0x17b7aa='';var _0x17c0a8='';var _0x177619='';var _0x3f90d0='';var _0x2723f6=[_0x624a('0x56'),_0x624a('0x57'),_0x624a('0x58'),_0x624a('0x59'),_0x624a('0x5a'),_0x624a('0x5b'),'phonenumber','regardingobjectid',_0x624a('0x5c'),_0x624a('0x5d')];var _0x4e76c6=[_0x624a('0x5e'),_0x624a('0x5f'),_0x624a('0x60'),_0x624a('0x61'),'contactidname','contactidyominame',_0x624a('0x62'),'contractidname',_0x624a('0x63'),'createdbyexternalpartyyominame',_0x624a('0x64'),'createdbyyominame',_0x624a('0x65'),_0x624a('0x66'),_0x624a('0x67'),_0x624a('0x68'),_0x624a('0x69'),_0x624a('0x6a'),_0x624a('0x6b'),_0x624a('0x6c'),_0x624a('0x6d'),_0x624a('0x6e'),'escalatedon',_0x624a('0x6f'),_0x624a('0x70'),_0x624a('0x71'),_0x624a('0x72'),_0x624a('0x73'),_0x624a('0x74'),'lastonholdtime','masteridname',_0x624a('0x75'),_0x624a('0x76'),_0x624a('0x77'),_0x624a('0x78'),_0x624a('0x79'),'modifiedonbehalfbyname',_0x624a('0x7a'),'msdyn_incidenttypename','msdyn_iotalertname',_0x624a('0x7b'),_0x624a('0x7c'),_0x624a('0x7d'),_0x624a('0x7e'),_0x624a('0x7f'),_0x624a('0x80'),_0x624a('0x81'),_0x624a('0x82'),_0x624a('0x83'),_0x624a('0x84'),_0x624a('0x85'),_0x624a('0x86'),_0x624a('0x87'),_0x624a('0x88'),_0x624a('0x89'),_0x624a('0x8a'),'responsiblecontactidyominame','sentimentvalue',_0x624a('0x8b'),_0x624a('0x8c'),_0x624a('0x8d'),'statecode',_0x624a('0x8e'),_0x624a('0x8f'),'ticketnumber',_0x624a('0x90'),'transactioncurrencyidname',_0x624a('0x91'),_0x624a('0x92'),_0x624a('0x93')];var _0x36ec56=_0x2723f6[_0x624a('0x94')](_0x4e76c6);return db[_0x624a('0x2b')][_0x624a('0x4a')]({'where':{'id':_0x46a53f[_0x624a('0x44')]['id']},'attributes':['id',_0x624a('0x95'),_0x624a('0x96'),_0x624a('0x97'),_0x624a('0x98'),'clientId','clientSecret']})['then'](handleEntityNotFound(_0x3f98aa,null))[_0x624a('0x28')](function(_0xcfdf42){if(_0xcfdf42){_0x3f90d0=_0xcfdf42[_0x624a('0x97')];var _0x2c4b27=_0x3f90d0[_0x624a('0x99')](-0x1);if(_0x2c4b27==='/'){_0x3f90d0=_0x3f90d0[_0x624a('0x9a')](0x0,_0x3f90d0[_0x624a('0x9b')](_0x2c4b27));}_0x177619=util['format'](_0x624a('0x9c'),_0x3f90d0);var _0x4e28e8={'method':_0x624a('0x9d'),'uri':_0x624a('0x9e')+_0xcfdf42['tenantId']+'/oauth2/token','form':{'client_id':_0xcfdf42[_0x624a('0x9f')],'resource':_0x3f90d0,'username':_0xcfdf42[_0x624a('0x95')],'password':_0xcfdf42[_0x624a('0x96')],'grant_type':_0x624a('0x96'),'client_secret':_0xcfdf42[_0x624a('0xa0')]},'json':!![]};return rp(_0x4e28e8);}})['then'](function(_0x873010){_0x17c0a8=_0x873010[_0x624a('0xa1')];var _0x39884d={'method':_0x624a('0xa2'),'uri':encodeURI(_0x177619+_0x624a('0xa3')+_0x1c67c7+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x17c0a8,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x39884d);})['then'](function(_0x375f19){var _0x2c91ab=_0x375f19['value'][0x0];var _0x645f3c=_0x2c91ab[_0x624a('0xa4')];var _0x3add36={'method':'GET','uri':_0x177619+_0x624a('0xa5')+_0x645f3c+_0x624a('0xa6'),'headers':{'Authorization':_0x624a('0xa7')+_0x17c0a8,'If-None-Match':null,'OData-Version':_0x624a('0xa8')},'json':!![]};return rp(_0x3add36);})['then'](function(_0x577f9a){_0x75b962=_0x577f9a;_0x50033d=_0x75b962['Attributes'];_0x50033d=_[_0x624a('0xa9')](_0x50033d,function(_0x410ec3){return!_0x36ec56[_0x624a('0xaa')](_0x410ec3[_0x624a('0xab')]);});var _0x1ddd16=[];var _0x2e6c31=[];_0x50033d[_0x624a('0xac')](function(_0x434379){if(_0x434379[_0x624a('0xad')]){var _0x9181b4=_0x434379[_0x624a('0xad')][_0x624a('0x9a')](_0x434379[_0x624a('0xad')]['lastIndexOf']('.')+0x1);if(_0x9181b4===_0x624a('0xae')){_0x1ddd16[_0x624a('0xaf')](getSelectList(_0x177619,_0x2de6d6,_0x2e6c31,_0x75b962['MetadataId'],_0x434379[_0x624a('0xa4')],_0x17c0a8));}}});return Promise[_0x624a('0xb0')](_0x1ddd16);})[_0x624a('0x28')](function(_0xa6b97e){_0x3e32b9=_0xa6b97e[0x0];var _0x138545=[];var _0x3ebfec=[];_0x50033d['forEach'](function(_0x3ee775){if(!_[_0x624a('0xb1')](_0x3ee775[_0x624a('0xad')])){var _0x135e95=_0x3ee775['@odata.type'][_0x624a('0x9a')](_0x3ee775[_0x624a('0xad')][_0x624a('0x9b')]('.')+0x1);if(_0x135e95==='BooleanAttributeMetadata'){_0x138545[_0x624a('0xaf')](getBooleanList(_0x177619,_0x2de6d6,_0x3ebfec,_0x75b962['MetadataId'],_0x3ee775[_0x624a('0xa4')],_0x17c0a8));}}});return Promise[_0x624a('0xb0')](_0x138545);})[_0x624a('0x28')](function(_0x3b408a){_0x413e28=_0x3b408a[0x0];var _0x345838=[];var _0x59880c=[];_0x50033d[_0x624a('0xac')](function(_0x2d9b78){if(_0x2d9b78[_0x624a('0xad')]){var _0x1a6082=_0x2d9b78[_0x624a('0xad')]['substring'](_0x2d9b78['@odata.type'][_0x624a('0x9b')]('.')+0x1);if(_0x1a6082===_0x624a('0xb2')||_0x1a6082===_0x624a('0xb3')||_0x1a6082===_0x624a('0xb4')||_0x1a6082==='IntegerAttributeMetadata'||_0x1a6082==='MemoAttributeMetadata'||_0x1a6082===_0x624a('0xb5')||_0x1a6082===_0x624a('0xb6')||_0x1a6082==='EntityNameAttributeMetadata'||_0x1a6082===_0x624a('0xb7')||_0x1a6082===_0x624a('0xb8')){_0x345838[_0x624a('0xaf')](getInputList(_0x177619,_0x2de6d6,_0x1a6082,_0x59880c,_0x75b962[_0x624a('0xa4')],_0x2d9b78['MetadataId'],_0x17c0a8));}}});return Promise[_0x624a('0xb0')](_0x345838);})[_0x624a('0x28')](function(_0x44c050){_0x17b7aa=_0x44c050[0x0];var _0x319a1e=_0x3e32b9[_0x624a('0x94')](_0x413e28)['concat'](_0x17b7aa);var _0x38c891={'count':_0x319a1e[_0x624a('0x46')],'rows':_0x319a1e};return _0x38c891;})[_0x624a('0x28')](respondWithResult(_0x3f98aa,null))[_0x624a('0x43')](function(_0x3a58dc){var _0x2db549=_0x46a53f['query'][_0x624a('0xb9')]?0x1f4:_0x3a58dc[_0x624a('0xba')]||0x1f4;logger[_0x624a('0xbb')](_0x3a58dc[_0x624a('0xbc')]);delete _0x3a58dc['name'];if(_0x2db549===0x191){_0x2db549=0x190;}_0x3f98aa[_0x624a('0x1c')](_0x2db549)[_0x624a('0xbd')](_0x46a53f[_0x624a('0x31')][_0x624a('0xb9')]?{'message':_0x624a('0xbe'),'statusCode':_0x3a58dc[_0x624a('0xba')]}:_0x3a58dc);});};function getSelectList(_0x18ed9a,_0x15cfaa,_0x826673,_0x1c7c55,_0x418413,_0x6e8b2a){var _0x298317={'method':_0x624a('0xa2'),'uri':_0x18ed9a+'EntityDefinitions('+_0x1c7c55+')/Attributes('+_0x418413+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x624a('0xbf'),'headers':{'Authorization':_0x624a('0xa7')+_0x6e8b2a,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x298317)['then'](function(_0x8ebda7){var _0x1f0f72=[];var _0x5629e1=_0x8ebda7[_0x624a('0xc0')][_0x624a('0xc1')];_0x5629e1[_0x624a('0xac')](function(_0x45745c){_0x1f0f72[_0x624a('0xaf')]({'name':_0x45745c[_0x624a('0xc2')][_0x624a('0xc3')][_0x624a('0xc2')],'value':String(_0x45745c['Value'])});});var _0x1c4f9b={'id':_0x15cfaa+'_'+_0x8ebda7[_0x624a('0xab')],'name':_0x8ebda7[_0x624a('0xc4')][_0x624a('0xc3')]['Label'],'custom':![],'options':_0x1f0f72};_0x826673[_0x624a('0xaf')](_0x1c4f9b);return _0x826673;});}function getBooleanList(_0x330815,_0xa8d61b,_0xc8d94b,_0xb4bd30,_0x4edc2a,_0x31906b){var _0x28bf53={'method':_0x624a('0xa2'),'uri':_0x330815+_0x624a('0xa5')+_0xb4bd30+_0x624a('0xc5')+_0x4edc2a+_0x624a('0xc6'),'headers':{'Authorization':_0x624a('0xa7')+_0x31906b,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x28bf53)[_0x624a('0x28')](function(_0x1d0c36){var _0x49b1f4=[];_0x49b1f4[_0x624a('0xaf')]({'name':_0x1d0c36['OptionSet'][_0x624a('0xc7')][_0x624a('0xc2')][_0x624a('0xc3')]['Label'],'value':_0x624a('0xc8')},{'name':_0x1d0c36['OptionSet'][_0x624a('0xc9')][_0x624a('0xc2')][_0x624a('0xc3')][_0x624a('0xc2')],'value':_0x624a('0xca')});var _0x35d003={'id':_0xa8d61b+'_'+_0x1d0c36[_0x624a('0xab')],'name':_0x1d0c36[_0x624a('0xc4')][_0x624a('0xc3')][_0x624a('0xc2')],'custom':![],'options':_0x49b1f4};_0xc8d94b[_0x624a('0xaf')](_0x35d003);return _0xc8d94b;});}function getInputList(_0x5bdb86,_0x559ba3,_0x1d7e63,_0x58156c,_0x1df59d,_0x7d0ccb,_0x30a7c6){var _0x5ce822={'method':_0x624a('0xa2'),'uri':_0x5bdb86+'EntityDefinitions('+_0x1df59d+_0x624a('0xc5')+_0x7d0ccb+')/Microsoft.Dynamics.CRM.'+_0x1d7e63+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x624a('0xa7')+_0x30a7c6,'If-None-Match':null,'OData-Version':_0x624a('0xa8')},'json':!![]};return rp(_0x5ce822)['then'](function(_0x4e6541){var _0x17e409={'id':_0x559ba3+'_'+_0x4e6541[_0x624a('0xab')],'name':_0x4e6541['DisplayName'][_0x624a('0xc3')]?_0x4e6541[_0x624a('0xc4')][_0x624a('0xc3')]['Label']:_0x4e6541[_0x624a('0xab')],'custom':![],'options':[]};_0x58156c[_0x624a('0xaf')](_0x17e409);return _0x58156c;});} \ No newline at end of file +var _0x6a88=['sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','includeAll','Dynamics365Account','findAll','rows','catch','show','params','include','merge','find','create','body','getConfigurations','findOne','Dynamics365Configuration','length','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','ticketType','incident','Incident','PhoneCall','title','description','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_url','exchangerate','firstresponsebykpiidname','importsequencenumber','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','onholdtime','overriddencreatedon','owneridtype','owneridyominame','primarycontactidname','primarycontactidyominame','prioritycodename','productserialnumber','resolveby','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','versionnumber','concat','password','remoteUri','clientId','clientSecret','slice','lastIndexOf','format','%s/api/data/v9.0/','https://login.microsoftonline.com/','tenantId','/oauth2/token','access_token','GET','Bearer\x20','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','4.0','Attributes','remove','LogicalName','forEach','@odata.type','substring','PicklistAttributeMetadata','push','all','BooleanAttributeMetadata','StringAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','DecimalAttributeMetadata','test','statusCode','Wrong\x20credentials',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','UserLocalizedLabel','Label','DisplayName',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','limit','count','set','Content-Range','reject','update','then','destroy'];(function(_0x405be0,_0x59975c){var _0x487b38=function(_0x327719){while(--_0x327719){_0x405be0['push'](_0x405be0['shift']());}};_0x487b38(++_0x59975c);}(_0x6a88,0xa9));var _0x86a8=function(_0x215acd,_0x410e3d){_0x215acd=_0x215acd-0x0;var _0x42739c=_0x6a88[_0x215acd];return _0x42739c;};'use strict';var emlformat=require(_0x86a8('0x0'));var rimraf=require(_0x86a8('0x1'));var zipdir=require(_0x86a8('0x2'));var jsonpatch=require(_0x86a8('0x3'));var rp=require(_0x86a8('0x4'));var moment=require(_0x86a8('0x5'));var BPromise=require(_0x86a8('0x6'));var Mustache=require('mustache');var util=require(_0x86a8('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x86a8('0x8'));var ejs=require(_0x86a8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x86a8('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x86a8('0xb'));var deskjs=require(_0x86a8('0xc'));var toCsv=require('to-csv');var querystring=require(_0x86a8('0xd'));var Papa=require(_0x86a8('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x86a8('0xf'));var as=require(_0x86a8('0x10'));var hardwareService=require(_0x86a8('0x11'));var logger=require(_0x86a8('0x12'))(_0x86a8('0x13'));var utils=require(_0x86a8('0x14'));var config=require(_0x86a8('0x15'));var licenseUtil=require(_0x86a8('0x16'));var db=require(_0x86a8('0x17'))['db'];var integrations=require(_0x86a8('0x18'));function respondWithStatusCode(_0x4f9e2d,_0x2d9f37){_0x2d9f37=_0x2d9f37||0xcc;return function(_0x4f1887){if(_0x4f1887){return _0x4f9e2d['sendStatus'](_0x2d9f37);}return _0x4f9e2d[_0x86a8('0x19')](_0x2d9f37)[_0x86a8('0x1a')]();};}function respondWithResult(_0x5d5b9d,_0x520697){_0x520697=_0x520697||0xc8;return function(_0x4f8076){if(_0x4f8076){return _0x5d5b9d[_0x86a8('0x19')](_0x520697)[_0x86a8('0x1b')](_0x4f8076);}};}function respondWithFilteredResult(_0x507fef,_0xb3e0d){return function(_0x4007cd){if(_0x4007cd){var _0xe871bb=typeof _0xb3e0d[_0x86a8('0x1c')]==='undefined'&&typeof _0xb3e0d[_0x86a8('0x1d')]==='undefined';var _0x13d387=_0x4007cd[_0x86a8('0x1e')];var _0x4a2916=_0xe871bb?0x0:_0xb3e0d[_0x86a8('0x1c')];var _0x4644a6=_0xe871bb?_0x4007cd[_0x86a8('0x1e')]:_0xb3e0d[_0x86a8('0x1c')]+_0xb3e0d[_0x86a8('0x1d')];var _0x89133a;if(_0x4644a6>=_0x13d387){_0x4644a6=_0x13d387;_0x89133a=0xc8;}else{_0x89133a=0xce;}_0x507fef['status'](_0x89133a);return _0x507fef[_0x86a8('0x1f')](_0x86a8('0x20'),_0x4a2916+'-'+_0x4644a6+'/'+_0x13d387)[_0x86a8('0x1b')](_0x4007cd);}return null;};}function patchUpdates(_0x20e4a6){return function(_0x513c22){try{jsonpatch['apply'](_0x513c22,_0x20e4a6,!![]);}catch(_0x9f78de){return BPromise[_0x86a8('0x21')](_0x9f78de);}return _0x513c22['save']();};}function saveUpdates(_0x455f83,_0x299b01){return function(_0x4b0abf){if(_0x4b0abf){return _0x4b0abf[_0x86a8('0x22')](_0x455f83)[_0x86a8('0x23')](function(_0x5eb4df){return _0x5eb4df;});}return null;};}function removeEntity(_0x42a7f2,_0x34578a){return function(_0x472e70){if(_0x472e70){return _0x472e70[_0x86a8('0x24')]()['then'](function(){_0x42a7f2[_0x86a8('0x19')](0xcc)[_0x86a8('0x1a')]();});}};}function handleEntityNotFound(_0x2b6c1d,_0x403c51){return function(_0x3eca17){if(!_0x3eca17){_0x2b6c1d[_0x86a8('0x25')](0x194);}return _0x3eca17;};}function handleError(_0x1991fe,_0x503613){_0x503613=_0x503613||0x1f4;return function(_0x5d3924){logger[_0x86a8('0x26')](_0x5d3924['stack']);if(_0x5d3924['name']){delete _0x5d3924[_0x86a8('0x27')];}_0x1991fe[_0x86a8('0x19')](_0x503613)[_0x86a8('0x28')](_0x5d3924);};}exports[_0x86a8('0x29')]=function(_0x35230,_0x35147b){var _0x1acd7a={},_0x5bc0d8={},_0x1fd166={'count':0x0,'rows':[]};var _0x3ddded=_[_0x86a8('0x2a')](db['Dynamics365Account'][_0x86a8('0x2b')],function(_0x397791){return{'name':_0x397791[_0x86a8('0x2c')],'type':_0x397791[_0x86a8('0x2d')][_0x86a8('0x2e')]};});_0x5bc0d8[_0x86a8('0x2f')]=_[_0x86a8('0x2a')](_0x3ddded,_0x86a8('0x27'));_0x5bc0d8[_0x86a8('0x30')]=_[_0x86a8('0x31')](_0x35230[_0x86a8('0x30')]);_0x5bc0d8['filters']=_['intersection'](_0x5bc0d8['model'],_0x5bc0d8[_0x86a8('0x30')]);_0x1acd7a[_0x86a8('0x32')]=_[_0x86a8('0x33')](_0x5bc0d8[_0x86a8('0x2f')],qs[_0x86a8('0x34')](_0x35230[_0x86a8('0x30')][_0x86a8('0x34')]));_0x1acd7a[_0x86a8('0x32')]=_0x1acd7a[_0x86a8('0x32')]['length']?_0x1acd7a[_0x86a8('0x32')]:_0x5bc0d8[_0x86a8('0x2f')];if(!_0x35230['query'][_0x86a8('0x35')](_0x86a8('0x36'))){_0x1acd7a['limit']=qs[_0x86a8('0x1d')](_0x35230[_0x86a8('0x30')]['limit']);_0x1acd7a[_0x86a8('0x1c')]=qs[_0x86a8('0x1c')](_0x35230[_0x86a8('0x30')]['offset']);}_0x1acd7a[_0x86a8('0x37')]=qs[_0x86a8('0x38')](_0x35230[_0x86a8('0x30')]['sort']);_0x1acd7a[_0x86a8('0x39')]=qs['filters'](_['pick'](_0x35230[_0x86a8('0x30')],_0x5bc0d8[_0x86a8('0x3a')]),_0x3ddded);if(_0x35230[_0x86a8('0x30')][_0x86a8('0x3b')]){_0x1acd7a[_0x86a8('0x39')]=_['merge'](_0x1acd7a[_0x86a8('0x39')],{'$or':_[_0x86a8('0x2a')](_0x3ddded,function(_0x3a3db1){if(_0x3a3db1['type']!=='VIRTUAL'){var _0x41adbb={};_0x41adbb[_0x3a3db1['name']]={'$like':'%'+_0x35230[_0x86a8('0x30')][_0x86a8('0x3b')]+'%'};return _0x41adbb;}})});}_0x1acd7a=_['merge']({},_0x1acd7a,_0x35230['options']);var _0x5010c8={'where':_0x1acd7a[_0x86a8('0x39')]};return db['Dynamics365Account']['count'](_0x5010c8)[_0x86a8('0x23')](function(_0x2e9786){_0x1fd166[_0x86a8('0x1e')]=_0x2e9786;if(_0x35230['query'][_0x86a8('0x3c')]){_0x1acd7a['include']=[{'all':!![]}];}return db[_0x86a8('0x3d')][_0x86a8('0x3e')](_0x1acd7a);})[_0x86a8('0x23')](function(_0x315f37){_0x1fd166[_0x86a8('0x3f')]=_0x315f37;return _0x1fd166;})['then'](respondWithFilteredResult(_0x35147b,_0x1acd7a))[_0x86a8('0x40')](handleError(_0x35147b,null));};exports[_0x86a8('0x41')]=function(_0xa69656,_0xe5f7e){var _0x1fff1e={'raw':![],'where':{'id':_0xa69656[_0x86a8('0x42')]['id']}},_0x30d53b={};_0x30d53b['model']=_['keys'](db[_0x86a8('0x3d')][_0x86a8('0x2b')]);_0x30d53b[_0x86a8('0x30')]=_[_0x86a8('0x31')](_0xa69656[_0x86a8('0x30')]);_0x30d53b[_0x86a8('0x3a')]=_['intersection'](_0x30d53b['model'],_0x30d53b['query']);_0x1fff1e[_0x86a8('0x32')]=_[_0x86a8('0x33')](_0x30d53b['model'],qs['fields'](_0xa69656[_0x86a8('0x30')]['fields']));_0x1fff1e[_0x86a8('0x32')]=_0x1fff1e['attributes']['length']?_0x1fff1e[_0x86a8('0x32')]:_0x30d53b[_0x86a8('0x2f')];if(_0xa69656[_0x86a8('0x30')][_0x86a8('0x3c')]){_0x1fff1e[_0x86a8('0x43')]=[{'all':!![]}];}_0x1fff1e=_[_0x86a8('0x44')]({},_0x1fff1e,_0xa69656['options']);return db[_0x86a8('0x3d')][_0x86a8('0x45')](_0x1fff1e)['then'](handleEntityNotFound(_0xe5f7e,null))[_0x86a8('0x23')](respondWithResult(_0xe5f7e,null))[_0x86a8('0x40')](handleError(_0xe5f7e,null));};exports[_0x86a8('0x46')]=function(_0x5cc9d7,_0x350d2f){return db['Dynamics365Account'][_0x86a8('0x46')](_0x5cc9d7[_0x86a8('0x47')],{})[_0x86a8('0x23')](respondWithResult(_0x350d2f,0xc9))['catch'](handleError(_0x350d2f,null));};exports[_0x86a8('0x22')]=function(_0x257f39,_0x33c028){if(_0x257f39['body']['id']){delete _0x257f39[_0x86a8('0x47')]['id'];}return db['Dynamics365Account']['find']({'where':{'id':_0x257f39[_0x86a8('0x42')]['id']}})[_0x86a8('0x23')](handleEntityNotFound(_0x33c028,null))[_0x86a8('0x23')](saveUpdates(_0x257f39['body'],null))[_0x86a8('0x23')](respondWithResult(_0x33c028,null))[_0x86a8('0x40')](handleError(_0x33c028,null));};exports[_0x86a8('0x24')]=function(_0xd7615d,_0x1505bf){return db['Dynamics365Account'][_0x86a8('0x45')]({'where':{'id':_0xd7615d['params']['id']}})[_0x86a8('0x23')](handleEntityNotFound(_0x1505bf,null))['then'](removeEntity(_0x1505bf,null))[_0x86a8('0x40')](handleError(_0x1505bf,null));};exports[_0x86a8('0x48')]=function(_0x1524bf,_0x2d9db1,_0x2a45fd){var _0x18d8c4={};var _0x226df6={};var _0x50e610;var _0x5c17df;return db[_0x86a8('0x3d')][_0x86a8('0x49')]({'where':{'id':_0x1524bf['params']['id']}})[_0x86a8('0x23')](handleEntityNotFound(_0x2d9db1,null))[_0x86a8('0x23')](function(_0xc3cba0){if(_0xc3cba0){_0x50e610=_0xc3cba0;_0x226df6[_0x86a8('0x2f')]=_[_0x86a8('0x31')](db[_0x86a8('0x4a')][_0x86a8('0x2b')]);_0x226df6[_0x86a8('0x30')]=_['keys'](_0x1524bf[_0x86a8('0x30')]);_0x226df6[_0x86a8('0x3a')]=_[_0x86a8('0x33')](_0x226df6[_0x86a8('0x2f')],_0x226df6[_0x86a8('0x30')]);_0x18d8c4[_0x86a8('0x32')]=_[_0x86a8('0x33')](_0x226df6[_0x86a8('0x2f')],qs['fields'](_0x1524bf['query'][_0x86a8('0x34')]));_0x18d8c4[_0x86a8('0x32')]=_0x18d8c4['attributes'][_0x86a8('0x4b')]?_0x18d8c4[_0x86a8('0x32')]:_0x226df6[_0x86a8('0x2f')];_0x18d8c4[_0x86a8('0x37')]=qs[_0x86a8('0x38')](_0x1524bf['query'][_0x86a8('0x38')]);_0x18d8c4[_0x86a8('0x39')]=qs[_0x86a8('0x3a')](_[_0x86a8('0x4c')](_0x1524bf[_0x86a8('0x30')],_0x226df6['filters']));if(_0x1524bf['query'][_0x86a8('0x3b')]){_0x18d8c4[_0x86a8('0x39')]=_[_0x86a8('0x44')](_0x18d8c4[_0x86a8('0x39')],{'$or':_[_0x86a8('0x2a')](_0x18d8c4[_0x86a8('0x32')],function(_0x1ed034){var _0x66786a={};_0x66786a[_0x1ed034]={'$like':'%'+_0x1524bf[_0x86a8('0x30')][_0x86a8('0x3b')]+'%'};return _0x66786a;})});}_0x18d8c4=_[_0x86a8('0x44')]({},_0x18d8c4,_0x1524bf['options']);return _0x50e610[_0x86a8('0x48')](_0x18d8c4);}})[_0x86a8('0x23')](function(_0xc233ea){if(_0xc233ea){_0x5c17df=_0xc233ea['length'];if(!_0x1524bf[_0x86a8('0x30')]['hasOwnProperty'](_0x86a8('0x36'))){_0x18d8c4['limit']=qs['limit'](_0x1524bf[_0x86a8('0x30')]['limit']);_0x18d8c4[_0x86a8('0x1c')]=qs[_0x86a8('0x1c')](_0x1524bf[_0x86a8('0x30')]['offset']);}return _0x50e610['getConfigurations'](_0x18d8c4);}})[_0x86a8('0x23')](function(_0x350a94){if(_0x350a94){return _0x350a94?{'count':_0x5c17df,'rows':_0x350a94}:null;}})[_0x86a8('0x23')](respondWithResult(_0x2d9db1,null))['catch'](handleError(_0x2d9db1,null));};exports[_0x86a8('0x4d')]=function(_0x4c76c9,_0xf8b3b9,_0x35bceb){if(_0x4c76c9[_0x86a8('0x47')]['id']){delete _0x4c76c9[_0x86a8('0x47')]['id'];}return db['Dynamics365Account'][_0x86a8('0x49')]({'where':{'id':_0x4c76c9[_0x86a8('0x42')]['id']}})[_0x86a8('0x23')](handleEntityNotFound(_0xf8b3b9,null))['then'](function(_0x4c1717){if(_0x4c1717){_0x4c76c9[_0x86a8('0x47')][_0x86a8('0x4e')]=_0x4c1717['id'];_0x4c76c9['body'][_0x86a8('0x4f')]=integrations[_0x86a8('0x50')](_0x4c76c9[_0x86a8('0x47')][_0x86a8('0x51')],_0x4c76c9[_0x86a8('0x47')][_0x86a8('0x2d')]);_0x4c76c9['body'][_0x86a8('0x52')]=integrations[_0x86a8('0x53')](_0x4c76c9[_0x86a8('0x47')][_0x86a8('0x51')],_0x4c76c9[_0x86a8('0x47')][_0x86a8('0x2d')]);return db[_0x86a8('0x4a')][_0x86a8('0x46')](_0x4c76c9[_0x86a8('0x47')],{'include':[{'model':db[_0x86a8('0x54')],'as':_0x86a8('0x4f')},{'model':db[_0x86a8('0x54')],'as':_0x86a8('0x52')}]});}return null;})[_0x86a8('0x23')](respondWithResult(_0xf8b3b9,null))[_0x86a8('0x40')](handleError(_0xf8b3b9,null));};exports['getFields']=function(_0x332805,_0x1a751e,_0x413627){var _0xaa3a63=_0x332805[_0x86a8('0x30')][_0x86a8('0x55')];var _0x335ca8=_0xaa3a63===_0x86a8('0x56')?_0x86a8('0x57'):_0x86a8('0x58');var _0x281347='';var _0x6a6362='';var _0x5d5e='';var _0x4054ea='';var _0x316617='';var _0x13b554='';var _0x44560f='';var _0x27a756='';var _0x1bf39d=[_0x86a8('0x59'),_0x86a8('0x5a'),'customerid',_0x86a8('0x5b'),_0x86a8('0x5c'),_0x86a8('0x5d'),_0x86a8('0x5e'),_0x86a8('0x5f'),_0x86a8('0x60'),_0x86a8('0x61')];var _0xc24b1d=[_0x86a8('0x62'),_0x86a8('0x63'),_0x86a8('0x64'),_0x86a8('0x65'),_0x86a8('0x66'),_0x86a8('0x67'),_0x86a8('0x68'),_0x86a8('0x69'),_0x86a8('0x6a'),_0x86a8('0x6b'),_0x86a8('0x6c'),_0x86a8('0x6d'),_0x86a8('0x6e'),_0x86a8('0x6f'),_0x86a8('0x70'),_0x86a8('0x71'),_0x86a8('0x72'),_0x86a8('0x73'),_0x86a8('0x74'),_0x86a8('0x75'),'entityimage_timestamp',_0x86a8('0x76'),'escalatedon',_0x86a8('0x77'),_0x86a8('0x78'),'followupby',_0x86a8('0x79'),'influencescore','kbarticleidname',_0x86a8('0x7a'),_0x86a8('0x7b'),'modifiedbyexternalpartyname',_0x86a8('0x7c'),_0x86a8('0x7d'),_0x86a8('0x7e'),_0x86a8('0x7f'),_0x86a8('0x80'),_0x86a8('0x81'),_0x86a8('0x82'),_0x86a8('0x83'),'numberofchildincidents',_0x86a8('0x84'),_0x86a8('0x85'),'owneridname',_0x86a8('0x86'),_0x86a8('0x87'),'parentcaseidname',_0x86a8('0x88'),_0x86a8('0x89'),_0x86a8('0x8a'),'productidname',_0x86a8('0x8b'),_0x86a8('0x8c'),'resolvebykpiidname',_0x86a8('0x8d'),_0x86a8('0x8e'),_0x86a8('0x8f'),_0x86a8('0x90'),_0x86a8('0x91'),_0x86a8('0x92'),'socialprofileidname',_0x86a8('0x93'),_0x86a8('0x94'),_0x86a8('0x95'),_0x86a8('0x96'),_0x86a8('0x97'),_0x86a8('0x98'),'traversedpath','utcconversiontimezonecode',_0x86a8('0x99')];var _0xc0c8bf=_0x1bf39d[_0x86a8('0x9a')](_0xc24b1d);return db[_0x86a8('0x3d')][_0x86a8('0x49')]({'where':{'id':_0x332805[_0x86a8('0x42')]['id']},'attributes':['id','username',_0x86a8('0x9b'),_0x86a8('0x9c'),'tenantId',_0x86a8('0x9d'),_0x86a8('0x9e')]})[_0x86a8('0x23')](handleEntityNotFound(_0x1a751e,null))[_0x86a8('0x23')](function(_0x528b91){if(_0x528b91){_0x27a756=_0x528b91[_0x86a8('0x9c')];var _0x1ed8dd=_0x27a756[_0x86a8('0x9f')](-0x1);if(_0x1ed8dd==='/'){_0x27a756=_0x27a756['substring'](0x0,_0x27a756[_0x86a8('0xa0')](_0x1ed8dd));}_0x44560f=util[_0x86a8('0xa1')](_0x86a8('0xa2'),_0x27a756);var _0x2c36ce={'method':'POST','uri':_0x86a8('0xa3')+_0x528b91[_0x86a8('0xa4')]+_0x86a8('0xa5'),'form':{'client_id':_0x528b91[_0x86a8('0x9d')],'resource':_0x27a756,'username':_0x528b91['username'],'password':_0x528b91[_0x86a8('0x9b')],'grant_type':'password','client_secret':_0x528b91[_0x86a8('0x9e')]},'json':!![]};return rp(_0x2c36ce);}})['then'](function(_0x5ed77b){_0x13b554=_0x5ed77b[_0x86a8('0xa6')];var _0x2984af={'method':_0x86a8('0xa7'),'uri':encodeURI(_0x44560f+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x335ca8+'\x27'),'headers':{'Authorization':_0x86a8('0xa8')+_0x13b554,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2984af);})[_0x86a8('0x23')](function(_0x422a20){var _0x3a7b1a=_0x422a20[_0x86a8('0xa9')][0x0];var _0x4f9a17=_0x3a7b1a[_0x86a8('0xaa')];var _0x5d6e25={'method':_0x86a8('0xa7'),'uri':_0x44560f+_0x86a8('0xab')+_0x4f9a17+_0x86a8('0xac'),'headers':{'Authorization':_0x86a8('0xa8')+_0x13b554,'If-None-Match':null,'OData-Version':_0x86a8('0xad')},'json':!![]};return rp(_0x5d6e25);})[_0x86a8('0x23')](function(_0x1bc6fe){_0x281347=_0x1bc6fe;_0x6a6362=_0x281347[_0x86a8('0xae')];_0x6a6362=_[_0x86a8('0xaf')](_0x6a6362,function(_0x1f8e51){return!_0xc0c8bf['includes'](_0x1f8e51[_0x86a8('0xb0')]);});var _0x2a0b37=[];var _0x20c468=[];_0x6a6362[_0x86a8('0xb1')](function(_0x533455){if(_0x533455['@odata.type']){var _0x2c143f=_0x533455[_0x86a8('0xb2')][_0x86a8('0xb3')](_0x533455[_0x86a8('0xb2')]['lastIndexOf']('.')+0x1);if(_0x2c143f===_0x86a8('0xb4')){_0x2a0b37[_0x86a8('0xb5')](getSelectList(_0x44560f,_0xaa3a63,_0x20c468,_0x281347['MetadataId'],_0x533455['MetadataId'],_0x13b554));}}});return Promise[_0x86a8('0xb6')](_0x2a0b37);})[_0x86a8('0x23')](function(_0x1bf333){_0x5d5e=_0x1bf333[0x0];var _0x124844=[];var _0x4913e0=[];_0x6a6362[_0x86a8('0xb1')](function(_0x1c723f){if(!_['isNil'](_0x1c723f['@odata.type'])){var _0x5b33d9=_0x1c723f['@odata.type'][_0x86a8('0xb3')](_0x1c723f['@odata.type']['lastIndexOf']('.')+0x1);if(_0x5b33d9===_0x86a8('0xb7')){_0x124844[_0x86a8('0xb5')](getBooleanList(_0x44560f,_0xaa3a63,_0x4913e0,_0x281347[_0x86a8('0xaa')],_0x1c723f[_0x86a8('0xaa')],_0x13b554));}}});return Promise[_0x86a8('0xb6')](_0x124844);})['then'](function(_0x15b707){_0x4054ea=_0x15b707[0x0];var _0x1f1ce1=[];var _0x2f21fc=[];_0x6a6362['forEach'](function(_0x19a9fa){if(_0x19a9fa['@odata.type']){var _0x34340b=_0x19a9fa[_0x86a8('0xb2')][_0x86a8('0xb3')](_0x19a9fa[_0x86a8('0xb2')][_0x86a8('0xa0')]('.')+0x1);if(_0x34340b===_0x86a8('0xb8')||_0x34340b==='DoubleAttributeMetadata'||_0x34340b===_0x86a8('0xb9')||_0x34340b===_0x86a8('0xba')||_0x34340b===_0x86a8('0xbb')||_0x34340b===_0x86a8('0xbc')||_0x34340b==='StatusAttributeMetadata'||_0x34340b==='EntityNameAttributeMetadata'||_0x34340b==='StateAttributeMetadata'||_0x34340b===_0x86a8('0xbd')){_0x1f1ce1[_0x86a8('0xb5')](getInputList(_0x44560f,_0xaa3a63,_0x34340b,_0x2f21fc,_0x281347[_0x86a8('0xaa')],_0x19a9fa[_0x86a8('0xaa')],_0x13b554));}}});return Promise[_0x86a8('0xb6')](_0x1f1ce1);})['then'](function(_0x2ee0ef){_0x316617=_0x2ee0ef[0x0];var _0x399ddb=_0x5d5e['concat'](_0x4054ea)[_0x86a8('0x9a')](_0x316617);var _0x463fe3={'count':_0x399ddb[_0x86a8('0x4b')],'rows':_0x399ddb};return _0x463fe3;})['then'](respondWithResult(_0x1a751e,null))['catch'](function(_0x322811){var _0x5891c5=_0x332805[_0x86a8('0x30')][_0x86a8('0xbe')]?0x1f4:_0x322811[_0x86a8('0xbf')]||0x1f4;logger[_0x86a8('0x26')](_0x322811['stack']);delete _0x322811['name'];if(_0x5891c5===0x191){_0x5891c5=0x190;}_0x1a751e[_0x86a8('0x19')](_0x5891c5)['send'](_0x332805['query'][_0x86a8('0xbe')]?{'message':_0x86a8('0xc0'),'statusCode':_0x322811[_0x86a8('0xbf')]}:_0x322811);});};function getSelectList(_0x33ec74,_0x345e81,_0xc1965b,_0x79ba0,_0x22898a,_0x46b11b){var _0xb5f637={'method':_0x86a8('0xa7'),'uri':_0x33ec74+_0x86a8('0xab')+_0x79ba0+')/Attributes('+_0x22898a+_0x86a8('0xc1')+_0x86a8('0xc2'),'headers':{'Authorization':_0x86a8('0xa8')+_0x46b11b,'If-None-Match':null,'OData-Version':_0x86a8('0xad')},'json':!![]};return rp(_0xb5f637)[_0x86a8('0x23')](function(_0x1ac006){var _0x901a17=[];var _0x2960e5=_0x1ac006['OptionSet'][_0x86a8('0xc3')];_0x2960e5[_0x86a8('0xb1')](function(_0x323f7a){_0x901a17[_0x86a8('0xb5')]({'name':_0x323f7a['Label'][_0x86a8('0xc4')][_0x86a8('0xc5')],'value':String(_0x323f7a['Value'])});});var _0x352e5f={'id':_0x345e81+'_'+_0x1ac006['LogicalName'],'name':_0x1ac006[_0x86a8('0xc6')][_0x86a8('0xc4')]['Label'],'custom':![],'options':_0x901a17};_0xc1965b[_0x86a8('0xb5')](_0x352e5f);return _0xc1965b;});}function getBooleanList(_0x55b3f6,_0x153a86,_0x4ab7bf,_0x579a87,_0x380b18,_0x3e010c){var _0x2f4f72={'method':'GET','uri':_0x55b3f6+_0x86a8('0xab')+_0x579a87+_0x86a8('0xc7')+_0x380b18+_0x86a8('0xc8'),'headers':{'Authorization':_0x86a8('0xa8')+_0x3e010c,'If-None-Match':null,'OData-Version':_0x86a8('0xad')},'json':!![]};return rp(_0x2f4f72)['then'](function(_0x3d962a){var _0x250952=[];_0x250952[_0x86a8('0xb5')]({'name':_0x3d962a['OptionSet']['TrueOption']['Label'][_0x86a8('0xc4')][_0x86a8('0xc5')],'value':_0x86a8('0xc9')},{'name':_0x3d962a['OptionSet'][_0x86a8('0xca')][_0x86a8('0xc5')][_0x86a8('0xc4')][_0x86a8('0xc5')],'value':_0x86a8('0xcb')});var _0x4ceee6={'id':_0x153a86+'_'+_0x3d962a[_0x86a8('0xb0')],'name':_0x3d962a[_0x86a8('0xc6')][_0x86a8('0xc4')]['Label'],'custom':![],'options':_0x250952};_0x4ab7bf[_0x86a8('0xb5')](_0x4ceee6);return _0x4ab7bf;});}function getInputList(_0x374960,_0x2825c0,_0x2edbd9,_0x4fe9d2,_0x1f24b9,_0x75f546,_0x55597d){var _0xa667b={'method':_0x86a8('0xa7'),'uri':_0x374960+_0x86a8('0xab')+_0x1f24b9+_0x86a8('0xc7')+_0x75f546+_0x86a8('0xcc')+_0x2edbd9+_0x86a8('0xcd'),'headers':{'Authorization':_0x86a8('0xa8')+_0x55597d,'If-None-Match':null,'OData-Version':_0x86a8('0xad')},'json':!![]};return rp(_0xa667b)[_0x86a8('0x23')](function(_0x20ab23){var _0xb31b09={'id':_0x2825c0+'_'+_0x20ab23[_0x86a8('0xb0')],'name':_0x20ab23[_0x86a8('0xc6')][_0x86a8('0xc4')]?_0x20ab23[_0x86a8('0xc6')][_0x86a8('0xc4')][_0x86a8('0xc5')]:_0x20ab23[_0x86a8('0xb0')],'custom':![],'options':[]};_0x4fe9d2['push'](_0xb31b09);return _0x4fe9d2;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 9e3fa13..554b0d6 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 _0x757a=['Dynamics365Account','int_dynamics365_accounts','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x3e237d,_0x5229af){var _0x4d7c2=function(_0x28622a){while(--_0x28622a){_0x3e237d['push'](_0x3e237d['shift']());}};_0x4d7c2(++_0x5229af);}(_0x757a,0xde));var _0xa757=function(_0x321e98,_0x17359c){_0x321e98=_0x321e98-0x0;var _0x2892d5=_0x757a[_0x321e98];return _0x2892d5;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));var integrations=require(_0xa757('0x7'));module['exports']=function(_0xae0e7c,_0x4343b6){return _0xae0e7c['define'](_0xa757('0x8'),attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x757a=['Dynamics365Account','int_dynamics365_accounts','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x3f9509,_0x5e2e19){var _0x59b340=function(_0x5765bc){while(--_0x5765bc){_0x3f9509['push'](_0x3f9509['shift']());}};_0x59b340(++_0x5e2e19);}(_0x757a,0xde));var _0xa757=function(_0x290d43,_0x5ef7cf){_0x290d43=_0x290d43-0x0;var _0x226fda=_0x757a[_0x290d43];return _0x226fda;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));var integrations=require(_0xa757('0x7'));module['exports']=function(_0xae0e7c,_0x4343b6){return _0xae0e7c['define'](_0xa757('0x8'),attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index bd647eb..aafb271 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 _0xd26f=['message','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes','limit','include','map','model','then','stringify','ShowDynamics365Account','find','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x4673ca,_0x270810){var _0x4ef7a7=function(_0x44b228){while(--_0x44b228){_0x4673ca['push'](_0x4673ca['shift']());}};_0x4ef7a7(++_0x270810);}(_0xd26f,0x131));var _0xfd26=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0xd26f[_0x550d12];return _0x12103d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfd26('0x0'));var BPromise=require(_0xfd26('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfd26('0x2'));var db=require(_0xfd26('0x3'))['db'];var utils=require(_0xfd26('0x4'));var logger=require(_0xfd26('0x5'))(_0xfd26('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfd26('0x7')][_0xfd26('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1cb30e,_0x1a4b6d,_0x5efaa4){return new BPromise(function(_0x1a69fa,_0x34bbda){return client['request'](_0x1cb30e,_0x5efaa4)['then'](function(_0x4e5efe){logger[_0xfd26('0x9')](_0xfd26('0xa'),_0x1a4b6d,_0xfd26('0xb'));logger['debug'](_0xfd26('0xc'),_0x1a4b6d,_0xfd26('0xb'),JSON['stringify'](_0x4e5efe));if(_0x4e5efe[_0xfd26('0xd')]){if(_0x4e5efe[_0xfd26('0xd')][_0xfd26('0xe')]===0x1f4){logger[_0xfd26('0xd')](_0xfd26('0xa'),_0x1a4b6d,_0x4e5efe['error'][_0xfd26('0xf')]);return _0x34bbda(_0x4e5efe[_0xfd26('0xd')]['message']);}logger[_0xfd26('0xd')](_0xfd26('0xa'),_0x1a4b6d,_0x4e5efe[_0xfd26('0xd')][_0xfd26('0xf')]);return _0x1a69fa(_0x4e5efe[_0xfd26('0xd')][_0xfd26('0xf')]);}else{logger[_0xfd26('0x9')](_0xfd26('0xa'),_0x1a4b6d,'request\x20sent');_0x1a69fa(_0x4e5efe['result'][_0xfd26('0xf')]);}})[_0xfd26('0x10')](function(_0xbb541f){logger[_0xfd26('0xd')](_0xfd26('0xa'),_0x1a4b6d,_0xbb541f);_0x34bbda(_0xbb541f);});});}exports[_0xfd26('0x11')]=function(_0x193d88){var _0x47fb1a=this;return new Promise(function(_0x4955c0,_0x516f49){return db[_0xfd26('0x12')][_0xfd26('0x13')]({'raw':_0x193d88[_0xfd26('0x14')]?_0x193d88[_0xfd26('0x14')][_0xfd26('0x15')]===undefined?!![]:![]:!![],'where':_0x193d88[_0xfd26('0x14')]?_0x193d88[_0xfd26('0x14')][_0xfd26('0x16')]||null:null,'attributes':_0x193d88[_0xfd26('0x14')]?_0x193d88[_0xfd26('0x14')][_0xfd26('0x17')]||null:null,'limit':_0x193d88[_0xfd26('0x14')]?_0x193d88[_0xfd26('0x14')][_0xfd26('0x18')]||null:null,'include':_0x193d88['options']?_0x193d88[_0xfd26('0x14')][_0xfd26('0x19')]?_[_0xfd26('0x1a')](_0x193d88[_0xfd26('0x14')][_0xfd26('0x19')],function(_0x119398){return{'model':db[_0x119398['model']],'as':_0x119398['as'],'attributes':_0x119398[_0xfd26('0x17')],'include':_0x119398[_0xfd26('0x19')]?_[_0xfd26('0x1a')](_0x119398[_0xfd26('0x19')],function(_0x185b6e){return{'model':db[_0x185b6e[_0xfd26('0x1b')]],'as':_0x185b6e['as'],'attributes':_0x185b6e['attributes'],'include':_0x185b6e[_0xfd26('0x19')]?_[_0xfd26('0x1a')](_0x185b6e[_0xfd26('0x19')],function(_0x21a175){return{'model':db[_0x21a175[_0xfd26('0x1b')]],'as':_0x21a175['as'],'attributes':_0x21a175[_0xfd26('0x17')]};}):[]};}):[]};}):[]:[]})[_0xfd26('0x1c')](function(_0x3b9c07){logger[_0xfd26('0x9')](_0xfd26('0x11'),_0x193d88);logger['debug']('GetDynamics365Account',_0x193d88,JSON[_0xfd26('0x1d')](_0x3b9c07));_0x4955c0(_0x3b9c07);})['catch'](function(_0x3a7b6a){logger['error'](_0xfd26('0x11'),_0x3a7b6a['message'],_0x193d88);_0x516f49(_0x47fb1a[_0xfd26('0xd')](0x1f4,_0x3a7b6a[_0xfd26('0xf')]));});});};exports[_0xfd26('0x1e')]=function(_0x1d3a26){var _0x210362=this;return new Promise(function(_0x4bf4a6,_0xe3ab2){return db[_0xfd26('0x12')][_0xfd26('0x1f')]({'raw':_0x1d3a26[_0xfd26('0x14')]?_0x1d3a26[_0xfd26('0x14')][_0xfd26('0x15')]===undefined?!![]:![]:!![],'where':_0x1d3a26['options']?_0x1d3a26[_0xfd26('0x14')][_0xfd26('0x16')]||null:null,'attributes':_0x1d3a26[_0xfd26('0x14')]?_0x1d3a26[_0xfd26('0x14')]['attributes']||null:null,'include':_0x1d3a26[_0xfd26('0x14')]?_0x1d3a26[_0xfd26('0x14')][_0xfd26('0x19')]?_['map'](_0x1d3a26['options']['include'],function(_0x15c905){return{'model':db[_0x15c905['model']],'as':_0x15c905['as'],'attributes':_0x15c905[_0xfd26('0x17')],'include':_0x15c905[_0xfd26('0x19')]?_[_0xfd26('0x1a')](_0x15c905[_0xfd26('0x19')],function(_0x5c1a8b){return{'model':db[_0x5c1a8b['model']],'as':_0x5c1a8b['as'],'attributes':_0x5c1a8b['attributes'],'include':_0x5c1a8b['include']?_['map'](_0x5c1a8b[_0xfd26('0x19')],function(_0x23deba){return{'model':db[_0x23deba[_0xfd26('0x1b')]],'as':_0x23deba['as'],'attributes':_0x23deba['attributes']};}):[]};}):[]};}):[]:[]})[_0xfd26('0x1c')](function(_0x240887){logger['info'](_0xfd26('0x1e'),_0x1d3a26);logger['debug'](_0xfd26('0x1e'),_0x1d3a26,JSON['stringify'](_0x240887));_0x4bf4a6(_0x240887);})[_0xfd26('0x10')](function(_0x5613ef){logger['error'](_0xfd26('0x1e'),_0x5613ef['message'],_0x1d3a26);_0xe3ab2(_0x210362[_0xfd26('0xd')](0x1f4,_0x5613ef[_0xfd26('0xf')]));});});}; \ No newline at end of file +var _0xb3f0=['Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetDynamics365Account','Dynamics365Account','options','raw','where','attributes','limit','include','map','ShowDynamics365Account','find','model','debug','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x58b6c7,_0x3bf35e){var _0x5f50d0=function(_0x532e10){while(--_0x532e10){_0x58b6c7['push'](_0x58b6c7['shift']());}};_0x5f50d0(++_0x3bf35e);}(_0xb3f0,0x135));var _0x0b3f=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xb3f0[_0x3c4737];return _0x2bb926;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0b3f('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0b3f('0x1'));var db=require(_0x0b3f('0x2'))['db'];var utils=require(_0x0b3f('0x3'));var logger=require(_0x0b3f('0x4'))('rpc');var config=require(_0x0b3f('0x5'));var jayson=require(_0x0b3f('0x6'));var client=jayson[_0x0b3f('0x7')][_0x0b3f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x855b00,_0x312bb6,_0x49a9ca){return new BPromise(function(_0x347668,_0xffb331){return client['request'](_0x855b00,_0x49a9ca)[_0x0b3f('0x9')](function(_0x5e2f58){logger[_0x0b3f('0xa')](_0x0b3f('0xb'),_0x312bb6,_0x0b3f('0xc'));logger['debug'](_0x0b3f('0xd'),_0x312bb6,_0x0b3f('0xc'),JSON[_0x0b3f('0xe')](_0x5e2f58));if(_0x5e2f58[_0x0b3f('0xf')]){if(_0x5e2f58[_0x0b3f('0xf')][_0x0b3f('0x10')]===0x1f4){logger[_0x0b3f('0xf')](_0x0b3f('0xb'),_0x312bb6,_0x5e2f58[_0x0b3f('0xf')][_0x0b3f('0x11')]);return _0xffb331(_0x5e2f58[_0x0b3f('0xf')][_0x0b3f('0x11')]);}logger[_0x0b3f('0xf')](_0x0b3f('0xb'),_0x312bb6,_0x5e2f58['error'][_0x0b3f('0x11')]);return _0x347668(_0x5e2f58['error'][_0x0b3f('0x11')]);}else{logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x312bb6,_0x0b3f('0xc'));_0x347668(_0x5e2f58['result']['message']);}})[_0x0b3f('0x12')](function(_0x342824){logger[_0x0b3f('0xf')](_0x0b3f('0xb'),_0x312bb6,_0x342824);_0xffb331(_0x342824);});});}exports[_0x0b3f('0x13')]=function(_0x73c04c){var _0x3f52b9=this;return new Promise(function(_0x4a8c87,_0x464cb0){return db[_0x0b3f('0x14')]['findAll']({'raw':_0x73c04c['options']?_0x73c04c[_0x0b3f('0x15')][_0x0b3f('0x16')]===undefined?!![]:![]:!![],'where':_0x73c04c[_0x0b3f('0x15')]?_0x73c04c[_0x0b3f('0x15')][_0x0b3f('0x17')]||null:null,'attributes':_0x73c04c[_0x0b3f('0x15')]?_0x73c04c[_0x0b3f('0x15')][_0x0b3f('0x18')]||null:null,'limit':_0x73c04c[_0x0b3f('0x15')]?_0x73c04c[_0x0b3f('0x15')][_0x0b3f('0x19')]||null:null,'include':_0x73c04c['options']?_0x73c04c[_0x0b3f('0x15')][_0x0b3f('0x1a')]?_[_0x0b3f('0x1b')](_0x73c04c[_0x0b3f('0x15')][_0x0b3f('0x1a')],function(_0x284026){return{'model':db[_0x284026['model']],'as':_0x284026['as'],'attributes':_0x284026[_0x0b3f('0x18')],'include':_0x284026[_0x0b3f('0x1a')]?_[_0x0b3f('0x1b')](_0x284026['include'],function(_0x5d4d38){return{'model':db[_0x5d4d38['model']],'as':_0x5d4d38['as'],'attributes':_0x5d4d38[_0x0b3f('0x18')],'include':_0x5d4d38['include']?_['map'](_0x5d4d38[_0x0b3f('0x1a')],function(_0x43fbd4){return{'model':db[_0x43fbd4['model']],'as':_0x43fbd4['as'],'attributes':_0x43fbd4['attributes']};}):[]};}):[]};}):[]:[]})[_0x0b3f('0x9')](function(_0x35ec71){logger[_0x0b3f('0xa')](_0x0b3f('0x13'),_0x73c04c);logger['debug'](_0x0b3f('0x13'),_0x73c04c,JSON[_0x0b3f('0xe')](_0x35ec71));_0x4a8c87(_0x35ec71);})[_0x0b3f('0x12')](function(_0x48ffca){logger['error'](_0x0b3f('0x13'),_0x48ffca['message'],_0x73c04c);_0x464cb0(_0x3f52b9[_0x0b3f('0xf')](0x1f4,_0x48ffca[_0x0b3f('0x11')]));});});};exports[_0x0b3f('0x1c')]=function(_0x36b02a){var _0x364aa8=this;return new Promise(function(_0x4af1dd,_0x4c3709){return db['Dynamics365Account'][_0x0b3f('0x1d')]({'raw':_0x36b02a[_0x0b3f('0x15')]?_0x36b02a[_0x0b3f('0x15')][_0x0b3f('0x16')]===undefined?!![]:![]:!![],'where':_0x36b02a[_0x0b3f('0x15')]?_0x36b02a[_0x0b3f('0x15')]['where']||null:null,'attributes':_0x36b02a[_0x0b3f('0x15')]?_0x36b02a[_0x0b3f('0x15')][_0x0b3f('0x18')]||null:null,'include':_0x36b02a['options']?_0x36b02a[_0x0b3f('0x15')]['include']?_[_0x0b3f('0x1b')](_0x36b02a[_0x0b3f('0x15')][_0x0b3f('0x1a')],function(_0x995bf3){return{'model':db[_0x995bf3[_0x0b3f('0x1e')]],'as':_0x995bf3['as'],'attributes':_0x995bf3[_0x0b3f('0x18')],'include':_0x995bf3['include']?_[_0x0b3f('0x1b')](_0x995bf3['include'],function(_0x42dcbf){return{'model':db[_0x42dcbf['model']],'as':_0x42dcbf['as'],'attributes':_0x42dcbf[_0x0b3f('0x18')],'include':_0x42dcbf[_0x0b3f('0x1a')]?_[_0x0b3f('0x1b')](_0x42dcbf[_0x0b3f('0x1a')],function(_0x1ab2a0){return{'model':db[_0x1ab2a0[_0x0b3f('0x1e')]],'as':_0x1ab2a0['as'],'attributes':_0x1ab2a0['attributes']};}):[]};}):[]};}):[]:[]})[_0x0b3f('0x9')](function(_0x17bd3f){logger[_0x0b3f('0xa')](_0x0b3f('0x1c'),_0x36b02a);logger[_0x0b3f('0x1f')](_0x0b3f('0x1c'),_0x36b02a,JSON[_0x0b3f('0xe')](_0x17bd3f));_0x4af1dd(_0x17bd3f);})[_0x0b3f('0x12')](function(_0x454d66){logger[_0x0b3f('0xf')]('ShowDynamics365Account',_0x454d66[_0x0b3f('0x11')],_0x36b02a);_0x4c3709(_0x364aa8[_0x0b3f('0xf')](0x1f4,_0x454d66[_0x0b3f('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 036567c..33195d0 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 _0x2558=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/:id','isAuthenticated','show','get','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update'];(function(_0x3c2fb1,_0x26cb88){var _0x5b7ef4=function(_0x359d4a){while(--_0x359d4a){_0x3c2fb1['push'](_0x3c2fb1['shift']());}};_0x5b7ef4(++_0x26cb88);}(_0x2558,0x1a0));var _0x8255=function(_0x2ecc19,_0x52ab36){_0x2ecc19=_0x2ecc19-0x0;var _0x26bd96=_0x2558[_0x2ecc19];return _0x26bd96;};'use strict';var multer=require('multer');var util=require(_0x8255('0x0'));var path=require(_0x8255('0x1'));var timeout=require(_0x8255('0x2'));var express=require(_0x8255('0x3'));var router=express[_0x8255('0x4')]();var fs_extra=require(_0x8255('0x5'));var auth=require(_0x8255('0x6'));var interaction=require(_0x8255('0x7'));var config=require(_0x8255('0x8'));var controller=require('./intDynamics365Configuration.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x8255('0x9')]);router['get'](_0x8255('0xa'),auth[_0x8255('0xb')](),controller[_0x8255('0xc')]);router['get']('/:id/fields',auth[_0x8255('0xb')](),controller['getFields']);router[_0x8255('0xd')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x8255('0xe')]);router[_0x8255('0xd')](_0x8255('0xf'),auth[_0x8255('0xb')](),controller[_0x8255('0x10')]);router[_0x8255('0x11')]('/',auth[_0x8255('0xb')](),controller[_0x8255('0x12')]);router[_0x8255('0x13')](_0x8255('0xa'),auth[_0x8255('0xb')](),controller[_0x8255('0x14')]);router['delete'](_0x8255('0xa'),auth[_0x8255('0xb')](),controller[_0x8255('0x15')]);module[_0x8255('0x16')]=router; \ No newline at end of file +var _0x49db=['/:id','show','/:id/fields','isAuthenticated','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Configuration.controller','index','get'];(function(_0x503306,_0x356f2f){var _0x44a99d=function(_0x1a6ec4){while(--_0x1a6ec4){_0x503306['push'](_0x503306['shift']());}};_0x44a99d(++_0x356f2f);}(_0x49db,0xc5));var _0xb49d=function(_0x3bd0d5,_0x5114dc){_0x3bd0d5=_0x3bd0d5-0x0;var _0x238921=_0x49db[_0x3bd0d5];return _0x238921;};'use strict';var multer=require(_0xb49d('0x0'));var util=require(_0xb49d('0x1'));var path=require(_0xb49d('0x2'));var timeout=require(_0xb49d('0x3'));var express=require(_0xb49d('0x4'));var router=express['Router']();var fs_extra=require(_0xb49d('0x5'));var auth=require(_0xb49d('0x6'));var interaction=require(_0xb49d('0x7'));var config=require('../../config/environment');var controller=require(_0xb49d('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xb49d('0x9')]);router[_0xb49d('0xa')](_0xb49d('0xb'),auth['isAuthenticated'](),controller[_0xb49d('0xc')]);router[_0xb49d('0xa')](_0xb49d('0xd'),auth[_0xb49d('0xe')](),controller[_0xb49d('0xf')]);router[_0xb49d('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xb49d('0x10')]);router[_0xb49d('0xa')](_0xb49d('0x11'),auth[_0xb49d('0xe')](),controller[_0xb49d('0x12')]);router[_0xb49d('0x13')]('/',auth[_0xb49d('0xe')](),controller[_0xb49d('0x14')]);router[_0xb49d('0x15')]('/:id',auth[_0xb49d('0xe')](),controller[_0xb49d('0x16')]);router[_0xb49d('0x17')](_0xb49d('0xb'),auth['isAuthenticated'](),controller[_0xb49d('0x18')]);module[_0xb49d('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 a162ce0..f66392e 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 _0x18a4=['incident','phonecall','STRING'];(function(_0x599a74,_0x34bb1e){var _0x5c7d9f=function(_0x45ae0b){while(--_0x45ae0b){_0x599a74['push'](_0x599a74['shift']());}};_0x5c7d9f(++_0x34bb1e);}(_0x18a4,0x188));var _0x418a=function(_0xa756e8,_0x49b65f){_0xa756e8=_0xa756e8-0x0;var _0x3c57ca=_0x18a4[_0xa756e8];return _0x3c57ca;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x418a('0x0')]},'description':{'type':Sequelize[_0x418a('0x0')]},'ticketType':{'type':Sequelize['ENUM'](_0x418a('0x1'),_0x418a('0x2')),'defaultValue':_0x418a('0x1')}}; \ No newline at end of file +var _0x3cf9=['STRING','ENUM','incident','sequelize','exports'];(function(_0x11ecea,_0xac684e){var _0x3c033b=function(_0x5926a1){while(--_0x5926a1){_0x11ecea['push'](_0x11ecea['shift']());}};_0x3c033b(++_0xac684e);}(_0x3cf9,0xd5));var _0x93cf=function(_0x31b557,_0x4561c4){_0x31b557=_0x31b557-0x0;var _0x3767af=_0x3cf9[_0x31b557];return _0x3767af;};'use strict';var Sequelize=require(_0x93cf('0x0'));module[_0x93cf('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x93cf('0x2')]},'ticketType':{'type':Sequelize[_0x93cf('0x3')](_0x93cf('0x4'),'phonecall'),'defaultValue':'incident'}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index ee04d28..8048f92 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 _0x1aa5=['offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filters','filter','merge','VIRTUAL','Dynamics365Configuration','includeAll','findAll','rows','catch','show','params','keys','include','options','find','create','body','getFields','findOne','Dynamics365Field','order','getSubjects','nolimit','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x511e04,_0x237dab){var _0x2b1b1c=function(_0x4b7411){while(--_0x4b7411){_0x511e04['push'](_0x511e04['shift']());}};_0x2b1b1c(++_0x237dab);}(_0x1aa5,0x85));var _0x51aa=function(_0x544d0d,_0x4182b8){_0x544d0d=_0x544d0d-0x0;var _0x305339=_0x1aa5[_0x544d0d];return _0x305339;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x51aa('0x0'));var zipdir=require(_0x51aa('0x1'));var jsonpatch=require(_0x51aa('0x2'));var rp=require(_0x51aa('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x51aa('0x4'));var util=require('util');var path=require(_0x51aa('0x5'));var sox=require(_0x51aa('0x6'));var csv=require(_0x51aa('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x51aa('0x8'));var _=require(_0x51aa('0x9'));var squel=require('squel');var crypto=require(_0x51aa('0xa'));var jsforce=require(_0x51aa('0xb'));var deskjs=require(_0x51aa('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x51aa('0xd'));var Redis=require(_0x51aa('0xe'));var authService=require(_0x51aa('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x51aa('0x10'));var hardwareService=require(_0x51aa('0x11'));var logger=require(_0x51aa('0x12'))(_0x51aa('0x13'));var utils=require('../../config/utils');var config=require(_0x51aa('0x14'));var licenseUtil=require(_0x51aa('0x15'));var db=require(_0x51aa('0x16'))['db'];function respondWithStatusCode(_0x20fe24,_0x51a851){_0x51a851=_0x51a851||0xcc;return function(_0xfad8fd){if(_0xfad8fd){return _0x20fe24[_0x51aa('0x17')](_0x51a851);}return _0x20fe24[_0x51aa('0x18')](_0x51a851)[_0x51aa('0x19')]();};}function respondWithResult(_0x939a69,_0x4925ce){_0x4925ce=_0x4925ce||0xc8;return function(_0x37eb22){if(_0x37eb22){return _0x939a69['status'](_0x4925ce)[_0x51aa('0x1a')](_0x37eb22);}};}function respondWithFilteredResult(_0x241d17,_0x55cc54){return function(_0x413fc9){if(_0x413fc9){var _0x775ea7=typeof _0x55cc54[_0x51aa('0x1b')]===_0x51aa('0x1c')&&typeof _0x55cc54['limit']===_0x51aa('0x1c');var _0x35a531=_0x413fc9[_0x51aa('0x1d')];var _0x4cabec=_0x775ea7?0x0:_0x55cc54[_0x51aa('0x1b')];var _0x3eb445=_0x775ea7?_0x413fc9[_0x51aa('0x1d')]:_0x55cc54['offset']+_0x55cc54[_0x51aa('0x1e')];var _0x59fbc4;if(_0x3eb445>=_0x35a531){_0x3eb445=_0x35a531;_0x59fbc4=0xc8;}else{_0x59fbc4=0xce;}_0x241d17[_0x51aa('0x18')](_0x59fbc4);return _0x241d17[_0x51aa('0x1f')](_0x51aa('0x20'),_0x4cabec+'-'+_0x3eb445+'/'+_0x35a531)[_0x51aa('0x1a')](_0x413fc9);}return null;};}function patchUpdates(_0x3d7b91){return function(_0x1df4f4){try{jsonpatch[_0x51aa('0x21')](_0x1df4f4,_0x3d7b91,!![]);}catch(_0x4ddc68){return BPromise[_0x51aa('0x22')](_0x4ddc68);}return _0x1df4f4['save']();};}function saveUpdates(_0x556c85,_0x1d47a1){return function(_0x291ee4){if(_0x291ee4){return _0x291ee4[_0x51aa('0x23')](_0x556c85)[_0x51aa('0x24')](function(_0xb132e7){return _0xb132e7;});}return null;};}function removeEntity(_0x1da364,_0x2f6127){return function(_0x42c74a){if(_0x42c74a){return _0x42c74a[_0x51aa('0x25')]()[_0x51aa('0x24')](function(){_0x1da364['status'](0xcc)[_0x51aa('0x19')]();});}};}function handleEntityNotFound(_0x43e075,_0x486df9){return function(_0x2bb3a8){if(!_0x2bb3a8){_0x43e075['sendStatus'](0x194);}return _0x2bb3a8;};}function handleError(_0x2d54aa,_0x317cc8){_0x317cc8=_0x317cc8||0x1f4;return function(_0x36b46e){logger['error'](_0x36b46e[_0x51aa('0x26')]);if(_0x36b46e[_0x51aa('0x27')]){delete _0x36b46e[_0x51aa('0x27')];}_0x2d54aa[_0x51aa('0x18')](_0x317cc8)[_0x51aa('0x28')](_0x36b46e);};}exports['index']=function(_0x492cb8,_0x30fcfc){var _0x169d69={},_0x522feb={},_0x3ac93e={'count':0x0,'rows':[]};var _0x35fab4=_[_0x51aa('0x29')](db['Dynamics365Configuration'][_0x51aa('0x2a')],function(_0xfe1dbd){return{'name':_0xfe1dbd[_0x51aa('0x2b')],'type':_0xfe1dbd[_0x51aa('0x2c')][_0x51aa('0x2d')]};});_0x522feb[_0x51aa('0x2e')]=_[_0x51aa('0x29')](_0x35fab4,_0x51aa('0x27'));_0x522feb[_0x51aa('0x2f')]=_['keys'](_0x492cb8[_0x51aa('0x2f')]);_0x522feb['filters']=_['intersection'](_0x522feb[_0x51aa('0x2e')],_0x522feb['query']);_0x169d69[_0x51aa('0x30')]=_[_0x51aa('0x31')](_0x522feb['model'],qs[_0x51aa('0x32')](_0x492cb8[_0x51aa('0x2f')][_0x51aa('0x32')]));_0x169d69[_0x51aa('0x30')]=_0x169d69[_0x51aa('0x30')][_0x51aa('0x33')]?_0x169d69[_0x51aa('0x30')]:_0x522feb[_0x51aa('0x2e')];if(!_0x492cb8[_0x51aa('0x2f')][_0x51aa('0x34')]('nolimit')){_0x169d69[_0x51aa('0x1e')]=qs[_0x51aa('0x1e')](_0x492cb8[_0x51aa('0x2f')][_0x51aa('0x1e')]);_0x169d69[_0x51aa('0x1b')]=qs[_0x51aa('0x1b')](_0x492cb8['query'][_0x51aa('0x1b')]);}_0x169d69['order']=qs[_0x51aa('0x35')](_0x492cb8[_0x51aa('0x2f')]['sort']);_0x169d69[_0x51aa('0x36')]=qs['filters'](_[_0x51aa('0x37')](_0x492cb8['query'],_0x522feb[_0x51aa('0x38')]),_0x35fab4);if(_0x492cb8[_0x51aa('0x2f')][_0x51aa('0x39')]){_0x169d69[_0x51aa('0x36')]=_[_0x51aa('0x3a')](_0x169d69['where'],{'$or':_[_0x51aa('0x29')](_0x35fab4,function(_0x8a4063){if(_0x8a4063[_0x51aa('0x2c')]!==_0x51aa('0x3b')){var _0x1a074a={};_0x1a074a[_0x8a4063[_0x51aa('0x27')]]={'$like':'%'+_0x492cb8[_0x51aa('0x2f')][_0x51aa('0x39')]+'%'};return _0x1a074a;}})});}_0x169d69=_[_0x51aa('0x3a')]({},_0x169d69,_0x492cb8['options']);var _0x10ad8a={'where':_0x169d69[_0x51aa('0x36')]};return db[_0x51aa('0x3c')][_0x51aa('0x1d')](_0x10ad8a)[_0x51aa('0x24')](function(_0x432bd9){_0x3ac93e[_0x51aa('0x1d')]=_0x432bd9;if(_0x492cb8['query'][_0x51aa('0x3d')]){_0x169d69['include']=[{'all':!![]}];}return db[_0x51aa('0x3c')][_0x51aa('0x3e')](_0x169d69);})[_0x51aa('0x24')](function(_0x46e264){_0x3ac93e[_0x51aa('0x3f')]=_0x46e264;return _0x3ac93e;})['then'](respondWithFilteredResult(_0x30fcfc,_0x169d69))[_0x51aa('0x40')](handleError(_0x30fcfc,null));};exports[_0x51aa('0x41')]=function(_0x2f441a,_0x127aeb){var _0x23eeca={'raw':![],'where':{'id':_0x2f441a[_0x51aa('0x42')]['id']}},_0x50f141={};_0x50f141['model']=_[_0x51aa('0x43')](db[_0x51aa('0x3c')][_0x51aa('0x2a')]);_0x50f141[_0x51aa('0x2f')]=_['keys'](_0x2f441a[_0x51aa('0x2f')]);_0x50f141[_0x51aa('0x38')]=_[_0x51aa('0x31')](_0x50f141['model'],_0x50f141[_0x51aa('0x2f')]);_0x23eeca[_0x51aa('0x30')]=_[_0x51aa('0x31')](_0x50f141[_0x51aa('0x2e')],qs[_0x51aa('0x32')](_0x2f441a[_0x51aa('0x2f')]['fields']));_0x23eeca['attributes']=_0x23eeca['attributes']['length']?_0x23eeca[_0x51aa('0x30')]:_0x50f141[_0x51aa('0x2e')];if(_0x2f441a[_0x51aa('0x2f')][_0x51aa('0x3d')]){_0x23eeca[_0x51aa('0x44')]=[{'all':!![]}];}_0x23eeca=_[_0x51aa('0x3a')]({},_0x23eeca,_0x2f441a[_0x51aa('0x45')]);return db[_0x51aa('0x3c')][_0x51aa('0x46')](_0x23eeca)[_0x51aa('0x24')](handleEntityNotFound(_0x127aeb,null))[_0x51aa('0x24')](respondWithResult(_0x127aeb,null))[_0x51aa('0x40')](handleError(_0x127aeb,null));};exports[_0x51aa('0x47')]=function(_0x380091,_0x161e3d){return db[_0x51aa('0x3c')][_0x51aa('0x47')](_0x380091[_0x51aa('0x48')],{})['then'](respondWithResult(_0x161e3d,0xc9))[_0x51aa('0x40')](handleError(_0x161e3d,null));};exports[_0x51aa('0x23')]=function(_0x311b6a,_0x38968a){if(_0x311b6a['body']['id']){delete _0x311b6a['body']['id'];}return db[_0x51aa('0x3c')][_0x51aa('0x46')]({'where':{'id':_0x311b6a[_0x51aa('0x42')]['id']}})[_0x51aa('0x24')](handleEntityNotFound(_0x38968a,null))[_0x51aa('0x24')](saveUpdates(_0x311b6a[_0x51aa('0x48')],null))[_0x51aa('0x24')](respondWithResult(_0x38968a,null))[_0x51aa('0x40')](handleError(_0x38968a,null));};exports[_0x51aa('0x25')]=function(_0x287034,_0x5b3ecb){return db[_0x51aa('0x3c')][_0x51aa('0x46')]({'where':{'id':_0x287034[_0x51aa('0x42')]['id']}})[_0x51aa('0x24')](handleEntityNotFound(_0x5b3ecb,null))[_0x51aa('0x24')](removeEntity(_0x5b3ecb,null))[_0x51aa('0x40')](handleError(_0x5b3ecb,null));};exports[_0x51aa('0x49')]=function(_0x80122a,_0x3eb688,_0x1bfbbe){var _0x317e34={};var _0xbe867c={};var _0x1ca70d;var _0x58b145;return db[_0x51aa('0x3c')][_0x51aa('0x4a')]({'where':{'id':_0x80122a[_0x51aa('0x42')]['id']}})['then'](handleEntityNotFound(_0x3eb688,null))[_0x51aa('0x24')](function(_0x4748c1){if(_0x4748c1){_0x1ca70d=_0x4748c1;_0xbe867c[_0x51aa('0x2e')]=_[_0x51aa('0x43')](db[_0x51aa('0x4b')]['rawAttributes']);_0xbe867c['query']=_[_0x51aa('0x43')](_0x80122a[_0x51aa('0x2f')]);_0xbe867c['filters']=_['intersection'](_0xbe867c['model'],_0xbe867c[_0x51aa('0x2f')]);_0x317e34[_0x51aa('0x30')]=_[_0x51aa('0x31')](_0xbe867c[_0x51aa('0x2e')],qs[_0x51aa('0x32')](_0x80122a[_0x51aa('0x2f')][_0x51aa('0x32')]));_0x317e34[_0x51aa('0x30')]=_0x317e34[_0x51aa('0x30')][_0x51aa('0x33')]?_0x317e34[_0x51aa('0x30')]:_0xbe867c['model'];_0x317e34[_0x51aa('0x4c')]=qs['sort'](_0x80122a[_0x51aa('0x2f')][_0x51aa('0x35')]);_0x317e34[_0x51aa('0x36')]=qs[_0x51aa('0x38')](_[_0x51aa('0x37')](_0x80122a[_0x51aa('0x2f')],_0xbe867c[_0x51aa('0x38')]));if(_0x80122a[_0x51aa('0x2f')]['filter']){_0x317e34[_0x51aa('0x36')]=_[_0x51aa('0x3a')](_0x317e34[_0x51aa('0x36')],{'$or':_[_0x51aa('0x29')](_0x317e34['attributes'],function(_0x4379bc){var _0x55d6bf={};_0x55d6bf[_0x4379bc]={'$like':'%'+_0x80122a[_0x51aa('0x2f')][_0x51aa('0x39')]+'%'};return _0x55d6bf;})});}_0x317e34=_['merge']({},_0x317e34,_0x80122a['options']);return _0x1ca70d[_0x51aa('0x49')](_0x317e34);}})['then'](function(_0x383033){if(_0x383033){_0x58b145=_0x383033[_0x51aa('0x33')];if(!_0x80122a['query'][_0x51aa('0x34')]('nolimit')){_0x317e34[_0x51aa('0x1e')]=qs[_0x51aa('0x1e')](_0x80122a[_0x51aa('0x2f')]['limit']);_0x317e34[_0x51aa('0x1b')]=qs[_0x51aa('0x1b')](_0x80122a[_0x51aa('0x2f')]['offset']);}return _0x1ca70d[_0x51aa('0x49')](_0x317e34);}})[_0x51aa('0x24')](function(_0x1c6056){if(_0x1c6056){return _0x1c6056?{'count':_0x58b145,'rows':_0x1c6056}:null;}})[_0x51aa('0x24')](respondWithResult(_0x3eb688,null))['catch'](handleError(_0x3eb688,null));};exports[_0x51aa('0x4d')]=function(_0x5156cf,_0x568e08,_0x300139){var _0xa6a9d7={};var _0x557e6d={};var _0x596b35;var _0x4483d5;return db['Dynamics365Configuration'][_0x51aa('0x4a')]({'where':{'id':_0x5156cf[_0x51aa('0x42')]['id']}})['then'](handleEntityNotFound(_0x568e08,null))[_0x51aa('0x24')](function(_0x341d3a){if(_0x341d3a){_0x596b35=_0x341d3a;_0x557e6d[_0x51aa('0x2e')]=_[_0x51aa('0x43')](db[_0x51aa('0x4b')][_0x51aa('0x2a')]);_0x557e6d[_0x51aa('0x2f')]=_[_0x51aa('0x43')](_0x5156cf[_0x51aa('0x2f')]);_0x557e6d[_0x51aa('0x38')]=_[_0x51aa('0x31')](_0x557e6d[_0x51aa('0x2e')],_0x557e6d[_0x51aa('0x2f')]);_0xa6a9d7[_0x51aa('0x30')]=_[_0x51aa('0x31')](_0x557e6d[_0x51aa('0x2e')],qs['fields'](_0x5156cf[_0x51aa('0x2f')][_0x51aa('0x32')]));_0xa6a9d7['attributes']=_0xa6a9d7['attributes']['length']?_0xa6a9d7[_0x51aa('0x30')]:_0x557e6d['model'];_0xa6a9d7['order']=qs['sort'](_0x5156cf[_0x51aa('0x2f')][_0x51aa('0x35')]);_0xa6a9d7[_0x51aa('0x36')]=qs[_0x51aa('0x38')](_[_0x51aa('0x37')](_0x5156cf[_0x51aa('0x2f')],_0x557e6d[_0x51aa('0x38')]));if(_0x5156cf[_0x51aa('0x2f')][_0x51aa('0x39')]){_0xa6a9d7[_0x51aa('0x36')]=_[_0x51aa('0x3a')](_0xa6a9d7[_0x51aa('0x36')],{'$or':_[_0x51aa('0x29')](_0xa6a9d7[_0x51aa('0x30')],function(_0x37e0b0){var _0x1f09b2={};_0x1f09b2[_0x37e0b0]={'$like':'%'+_0x5156cf['query'][_0x51aa('0x39')]+'%'};return _0x1f09b2;})});}_0xa6a9d7=_[_0x51aa('0x3a')]({},_0xa6a9d7,_0x5156cf[_0x51aa('0x45')]);return _0x596b35[_0x51aa('0x4d')](_0xa6a9d7);}})[_0x51aa('0x24')](function(_0xf2f43f){if(_0xf2f43f){_0x4483d5=_0xf2f43f[_0x51aa('0x33')];if(!_0x5156cf[_0x51aa('0x2f')][_0x51aa('0x34')](_0x51aa('0x4e'))){_0xa6a9d7[_0x51aa('0x1e')]=qs[_0x51aa('0x1e')](_0x5156cf[_0x51aa('0x2f')][_0x51aa('0x1e')]);_0xa6a9d7[_0x51aa('0x1b')]=qs[_0x51aa('0x1b')](_0x5156cf['query'][_0x51aa('0x1b')]);}return _0x596b35[_0x51aa('0x4d')](_0xa6a9d7);}})[_0x51aa('0x24')](function(_0x4a0838){if(_0x4a0838){return _0x4a0838?{'count':_0x4483d5,'rows':_0x4a0838}:null;}})[_0x51aa('0x24')](respondWithResult(_0x568e08,null))[_0x51aa('0x40')](handleError(_0x568e08,null));};exports[_0x51aa('0x4f')]=function(_0x1a9b11,_0x108c79,_0x5d62ac){var _0x4cc09a={};var _0x2a28ae={};var _0x15b4fd;var _0x18d6cf;return db[_0x51aa('0x3c')][_0x51aa('0x4a')]({'where':{'id':_0x1a9b11[_0x51aa('0x42')]['id']}})['then'](handleEntityNotFound(_0x108c79,null))[_0x51aa('0x24')](function(_0x3fc614){if(_0x3fc614){_0x15b4fd=_0x3fc614;_0x2a28ae[_0x51aa('0x2e')]=_[_0x51aa('0x43')](db[_0x51aa('0x4b')][_0x51aa('0x2a')]);_0x2a28ae[_0x51aa('0x2f')]=_[_0x51aa('0x43')](_0x1a9b11[_0x51aa('0x2f')]);_0x2a28ae[_0x51aa('0x38')]=_[_0x51aa('0x31')](_0x2a28ae[_0x51aa('0x2e')],_0x2a28ae[_0x51aa('0x2f')]);_0x4cc09a['attributes']=_['intersection'](_0x2a28ae['model'],qs[_0x51aa('0x32')](_0x1a9b11[_0x51aa('0x2f')][_0x51aa('0x32')]));_0x4cc09a[_0x51aa('0x30')]=_0x4cc09a['attributes'][_0x51aa('0x33')]?_0x4cc09a[_0x51aa('0x30')]:_0x2a28ae[_0x51aa('0x2e')];_0x4cc09a[_0x51aa('0x4c')]=qs[_0x51aa('0x35')](_0x1a9b11[_0x51aa('0x2f')][_0x51aa('0x35')]);_0x4cc09a[_0x51aa('0x36')]=qs[_0x51aa('0x38')](_[_0x51aa('0x37')](_0x1a9b11[_0x51aa('0x2f')],_0x2a28ae[_0x51aa('0x38')]));if(_0x1a9b11[_0x51aa('0x2f')][_0x51aa('0x39')]){_0x4cc09a[_0x51aa('0x36')]=_[_0x51aa('0x3a')](_0x4cc09a[_0x51aa('0x36')],{'$or':_[_0x51aa('0x29')](_0x4cc09a[_0x51aa('0x30')],function(_0x40e91e){var _0x5f8864={};_0x5f8864[_0x40e91e]={'$like':'%'+_0x1a9b11[_0x51aa('0x2f')][_0x51aa('0x39')]+'%'};return _0x5f8864;})});}_0x4cc09a=_['merge']({},_0x4cc09a,_0x1a9b11[_0x51aa('0x45')]);return _0x15b4fd[_0x51aa('0x4f')](_0x4cc09a);}})[_0x51aa('0x24')](function(_0x34ae4a){if(_0x34ae4a){_0x18d6cf=_0x34ae4a[_0x51aa('0x33')];if(!_0x1a9b11[_0x51aa('0x2f')][_0x51aa('0x34')](_0x51aa('0x4e'))){_0x4cc09a[_0x51aa('0x1e')]=qs[_0x51aa('0x1e')](_0x1a9b11[_0x51aa('0x2f')][_0x51aa('0x1e')]);_0x4cc09a['offset']=qs[_0x51aa('0x1b')](_0x1a9b11[_0x51aa('0x2f')][_0x51aa('0x1b')]);}return _0x15b4fd['getDescriptions'](_0x4cc09a);}})[_0x51aa('0x24')](function(_0x8b4692){if(_0x8b4692){return _0x8b4692?{'count':_0x18d6cf,'rows':_0x8b4692}:null;}})['then'](respondWithResult(_0x108c79,null))[_0x51aa('0x40')](handleError(_0x108c79,null));}; \ No newline at end of file +var _0x362c=['undefined','count','limit','status','set','Content-Range','apply','save','update','then','destroy','send','index','map','Dynamics365Configuration','fieldName','type','model','name','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','fields','catch','create','body','find','params','Dynamics365Field','getFields','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset'];(function(_0x11ec04,_0x55f4fe){var _0x45bbed=function(_0x5e6912){while(--_0x5e6912){_0x11ec04['push'](_0x11ec04['shift']());}};_0x45bbed(++_0x55f4fe);}(_0x362c,0x12d));var _0xc362=function(_0x12314a,_0x18626f){_0x12314a=_0x12314a-0x0;var _0x4c36a7=_0x362c[_0x12314a];return _0x4c36a7;};'use strict';var emlformat=require(_0xc362('0x0'));var rimraf=require(_0xc362('0x1'));var zipdir=require(_0xc362('0x2'));var jsonpatch=require(_0xc362('0x3'));var rp=require(_0xc362('0x4'));var moment=require(_0xc362('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc362('0x6'));var util=require(_0xc362('0x7'));var path=require(_0xc362('0x8'));var sox=require(_0xc362('0x9'));var csv=require(_0xc362('0xa'));var ejs=require(_0xc362('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xc362('0xc'));var jsforce=require(_0xc362('0xd'));var deskjs=require(_0xc362('0xe'));var toCsv=require(_0xc362('0xa'));var querystring=require(_0xc362('0xf'));var Papa=require(_0xc362('0x10'));var Redis=require(_0xc362('0x11'));var authService=require(_0xc362('0x12'));var qs=require(_0xc362('0x13'));var as=require(_0xc362('0x14'));var hardwareService=require(_0xc362('0x15'));var logger=require('../../config/logger')(_0xc362('0x16'));var utils=require(_0xc362('0x17'));var config=require(_0xc362('0x18'));var licenseUtil=require(_0xc362('0x19'));var db=require(_0xc362('0x1a'))['db'];function respondWithStatusCode(_0x410d4e,_0x19f5b1){_0x19f5b1=_0x19f5b1||0xcc;return function(_0x234012){if(_0x234012){return _0x410d4e[_0xc362('0x1b')](_0x19f5b1);}return _0x410d4e['status'](_0x19f5b1)[_0xc362('0x1c')]();};}function respondWithResult(_0x52ab9b,_0x21bcd5){_0x21bcd5=_0x21bcd5||0xc8;return function(_0x567f40){if(_0x567f40){return _0x52ab9b['status'](_0x21bcd5)[_0xc362('0x1d')](_0x567f40);}};}function respondWithFilteredResult(_0xc3b015,_0x2949a3){return function(_0x5ea1f1){if(_0x5ea1f1){var _0x2ae8c5=typeof _0x2949a3[_0xc362('0x1e')]==='undefined'&&typeof _0x2949a3['limit']===_0xc362('0x1f');var _0x1dc350=_0x5ea1f1[_0xc362('0x20')];var _0x3c6b1d=_0x2ae8c5?0x0:_0x2949a3['offset'];var _0x417161=_0x2ae8c5?_0x5ea1f1[_0xc362('0x20')]:_0x2949a3[_0xc362('0x1e')]+_0x2949a3[_0xc362('0x21')];var _0x46f554;if(_0x417161>=_0x1dc350){_0x417161=_0x1dc350;_0x46f554=0xc8;}else{_0x46f554=0xce;}_0xc3b015[_0xc362('0x22')](_0x46f554);return _0xc3b015[_0xc362('0x23')](_0xc362('0x24'),_0x3c6b1d+'-'+_0x417161+'/'+_0x1dc350)[_0xc362('0x1d')](_0x5ea1f1);}return null;};}function patchUpdates(_0x42a8f3){return function(_0x587c1b){try{jsonpatch[_0xc362('0x25')](_0x587c1b,_0x42a8f3,!![]);}catch(_0x7c500){return BPromise['reject'](_0x7c500);}return _0x587c1b[_0xc362('0x26')]();};}function saveUpdates(_0x200b78,_0x397b6f){return function(_0x44076b){if(_0x44076b){return _0x44076b[_0xc362('0x27')](_0x200b78)[_0xc362('0x28')](function(_0x9d7187){return _0x9d7187;});}return null;};}function removeEntity(_0x15a98d,_0x45b056){return function(_0x415e07){if(_0x415e07){return _0x415e07[_0xc362('0x29')]()[_0xc362('0x28')](function(){_0x15a98d[_0xc362('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8ab451,_0x8509fd){return function(_0x449775){if(!_0x449775){_0x8ab451[_0xc362('0x1b')](0x194);}return _0x449775;};}function handleError(_0x390c76,_0x1500bd){_0x1500bd=_0x1500bd||0x1f4;return function(_0x2da461){logger['error'](_0x2da461['stack']);if(_0x2da461['name']){delete _0x2da461['name'];}_0x390c76[_0xc362('0x22')](_0x1500bd)[_0xc362('0x2a')](_0x2da461);};}exports[_0xc362('0x2b')]=function(_0x515de5,_0x9f7142){var _0x3c05e3={},_0x48394f={},_0x23ecc2={'count':0x0,'rows':[]};var _0x2e6f93=_[_0xc362('0x2c')](db[_0xc362('0x2d')]['rawAttributes'],function(_0x1905e1){return{'name':_0x1905e1[_0xc362('0x2e')],'type':_0x1905e1[_0xc362('0x2f')]['key']};});_0x48394f[_0xc362('0x30')]=_[_0xc362('0x2c')](_0x2e6f93,_0xc362('0x31'));_0x48394f[_0xc362('0x32')]=_[_0xc362('0x33')](_0x515de5['query']);_0x48394f[_0xc362('0x34')]=_[_0xc362('0x35')](_0x48394f[_0xc362('0x30')],_0x48394f[_0xc362('0x32')]);_0x3c05e3[_0xc362('0x36')]=_[_0xc362('0x35')](_0x48394f[_0xc362('0x30')],qs['fields'](_0x515de5[_0xc362('0x32')]['fields']));_0x3c05e3[_0xc362('0x36')]=_0x3c05e3['attributes'][_0xc362('0x37')]?_0x3c05e3[_0xc362('0x36')]:_0x48394f[_0xc362('0x30')];if(!_0x515de5['query'][_0xc362('0x38')](_0xc362('0x39'))){_0x3c05e3[_0xc362('0x21')]=qs['limit'](_0x515de5['query'][_0xc362('0x21')]);_0x3c05e3[_0xc362('0x1e')]=qs[_0xc362('0x1e')](_0x515de5[_0xc362('0x32')][_0xc362('0x1e')]);}_0x3c05e3[_0xc362('0x3a')]=qs[_0xc362('0x3b')](_0x515de5[_0xc362('0x32')][_0xc362('0x3b')]);_0x3c05e3['where']=qs[_0xc362('0x34')](_[_0xc362('0x3c')](_0x515de5['query'],_0x48394f['filters']),_0x2e6f93);if(_0x515de5[_0xc362('0x32')][_0xc362('0x3d')]){_0x3c05e3[_0xc362('0x3e')]=_[_0xc362('0x3f')](_0x3c05e3[_0xc362('0x3e')],{'$or':_[_0xc362('0x2c')](_0x2e6f93,function(_0x77c8d4){if(_0x77c8d4[_0xc362('0x2f')]!==_0xc362('0x40')){var _0xbe9cc1={};_0xbe9cc1[_0x77c8d4[_0xc362('0x31')]]={'$like':'%'+_0x515de5[_0xc362('0x32')]['filter']+'%'};return _0xbe9cc1;}})});}_0x3c05e3=_[_0xc362('0x3f')]({},_0x3c05e3,_0x515de5[_0xc362('0x41')]);var _0x361e80={'where':_0x3c05e3[_0xc362('0x3e')]};return db[_0xc362('0x2d')][_0xc362('0x20')](_0x361e80)['then'](function(_0x58fffd){_0x23ecc2[_0xc362('0x20')]=_0x58fffd;if(_0x515de5[_0xc362('0x32')][_0xc362('0x42')]){_0x3c05e3[_0xc362('0x43')]=[{'all':!![]}];}return db[_0xc362('0x2d')][_0xc362('0x44')](_0x3c05e3);})[_0xc362('0x28')](function(_0x4915e0){_0x23ecc2[_0xc362('0x45')]=_0x4915e0;return _0x23ecc2;})[_0xc362('0x28')](respondWithFilteredResult(_0x9f7142,_0x3c05e3))['catch'](handleError(_0x9f7142,null));};exports[_0xc362('0x46')]=function(_0x49482e,_0x4b0037){var _0xae7360={'raw':![],'where':{'id':_0x49482e['params']['id']}},_0x52cdfa={};_0x52cdfa[_0xc362('0x30')]=_[_0xc362('0x33')](db[_0xc362('0x2d')][_0xc362('0x47')]);_0x52cdfa[_0xc362('0x32')]=_[_0xc362('0x33')](_0x49482e[_0xc362('0x32')]);_0x52cdfa['filters']=_[_0xc362('0x35')](_0x52cdfa['model'],_0x52cdfa[_0xc362('0x32')]);_0xae7360[_0xc362('0x36')]=_['intersection'](_0x52cdfa[_0xc362('0x30')],qs[_0xc362('0x48')](_0x49482e[_0xc362('0x32')][_0xc362('0x48')]));_0xae7360[_0xc362('0x36')]=_0xae7360[_0xc362('0x36')][_0xc362('0x37')]?_0xae7360[_0xc362('0x36')]:_0x52cdfa[_0xc362('0x30')];if(_0x49482e[_0xc362('0x32')][_0xc362('0x42')]){_0xae7360[_0xc362('0x43')]=[{'all':!![]}];}_0xae7360=_[_0xc362('0x3f')]({},_0xae7360,_0x49482e[_0xc362('0x41')]);return db['Dynamics365Configuration']['find'](_0xae7360)[_0xc362('0x28')](handleEntityNotFound(_0x4b0037,null))['then'](respondWithResult(_0x4b0037,null))[_0xc362('0x49')](handleError(_0x4b0037,null));};exports[_0xc362('0x4a')]=function(_0x5e1d7e,_0x87fed6){return db[_0xc362('0x2d')][_0xc362('0x4a')](_0x5e1d7e['body'],{})['then'](respondWithResult(_0x87fed6,0xc9))['catch'](handleError(_0x87fed6,null));};exports[_0xc362('0x27')]=function(_0x284084,_0x91ef93){if(_0x284084[_0xc362('0x4b')]['id']){delete _0x284084[_0xc362('0x4b')]['id'];}return db[_0xc362('0x2d')][_0xc362('0x4c')]({'where':{'id':_0x284084[_0xc362('0x4d')]['id']}})['then'](handleEntityNotFound(_0x91ef93,null))[_0xc362('0x28')](saveUpdates(_0x284084[_0xc362('0x4b')],null))[_0xc362('0x28')](respondWithResult(_0x91ef93,null))[_0xc362('0x49')](handleError(_0x91ef93,null));};exports['destroy']=function(_0x1b915e,_0x2fa0c1){return db['Dynamics365Configuration'][_0xc362('0x4c')]({'where':{'id':_0x1b915e['params']['id']}})[_0xc362('0x28')](handleEntityNotFound(_0x2fa0c1,null))[_0xc362('0x28')](removeEntity(_0x2fa0c1,null))[_0xc362('0x49')](handleError(_0x2fa0c1,null));};exports['getFields']=function(_0x46244b,_0x6f8c46,_0x1e07fe){var _0x559b89={};var _0x1cc7a6={};var _0x3ee6e3;var _0x120a84;return db[_0xc362('0x2d')]['findOne']({'where':{'id':_0x46244b['params']['id']}})[_0xc362('0x28')](handleEntityNotFound(_0x6f8c46,null))[_0xc362('0x28')](function(_0x5ea26a){if(_0x5ea26a){_0x3ee6e3=_0x5ea26a;_0x1cc7a6[_0xc362('0x30')]=_[_0xc362('0x33')](db[_0xc362('0x4e')][_0xc362('0x47')]);_0x1cc7a6[_0xc362('0x32')]=_[_0xc362('0x33')](_0x46244b['query']);_0x1cc7a6[_0xc362('0x34')]=_[_0xc362('0x35')](_0x1cc7a6[_0xc362('0x30')],_0x1cc7a6[_0xc362('0x32')]);_0x559b89[_0xc362('0x36')]=_['intersection'](_0x1cc7a6[_0xc362('0x30')],qs[_0xc362('0x48')](_0x46244b[_0xc362('0x32')][_0xc362('0x48')]));_0x559b89[_0xc362('0x36')]=_0x559b89[_0xc362('0x36')][_0xc362('0x37')]?_0x559b89[_0xc362('0x36')]:_0x1cc7a6['model'];_0x559b89['order']=qs[_0xc362('0x3b')](_0x46244b[_0xc362('0x32')][_0xc362('0x3b')]);_0x559b89['where']=qs[_0xc362('0x34')](_[_0xc362('0x3c')](_0x46244b[_0xc362('0x32')],_0x1cc7a6['filters']));if(_0x46244b[_0xc362('0x32')][_0xc362('0x3d')]){_0x559b89[_0xc362('0x3e')]=_[_0xc362('0x3f')](_0x559b89['where'],{'$or':_['map'](_0x559b89['attributes'],function(_0x5d5b67){var _0x31e3f3={};_0x31e3f3[_0x5d5b67]={'$like':'%'+_0x46244b[_0xc362('0x32')]['filter']+'%'};return _0x31e3f3;})});}_0x559b89=_[_0xc362('0x3f')]({},_0x559b89,_0x46244b[_0xc362('0x41')]);return _0x3ee6e3[_0xc362('0x4f')](_0x559b89);}})[_0xc362('0x28')](function(_0x2eea6a){if(_0x2eea6a){_0x120a84=_0x2eea6a[_0xc362('0x37')];if(!_0x46244b[_0xc362('0x32')][_0xc362('0x38')]('nolimit')){_0x559b89['limit']=qs[_0xc362('0x21')](_0x46244b['query'][_0xc362('0x21')]);_0x559b89['offset']=qs[_0xc362('0x1e')](_0x46244b[_0xc362('0x32')][_0xc362('0x1e')]);}return _0x3ee6e3['getFields'](_0x559b89);}})[_0xc362('0x28')](function(_0x414d6f){if(_0x414d6f){return _0x414d6f?{'count':_0x120a84,'rows':_0x414d6f}:null;}})[_0xc362('0x28')](respondWithResult(_0x6f8c46,null))[_0xc362('0x49')](handleError(_0x6f8c46,null));};exports[_0xc362('0x50')]=function(_0x42481c,_0x3ea152,_0x1ccee3){var _0x407f92={};var _0xf05c7f={};var _0x52a48f;var _0x30f2a7;return db[_0xc362('0x2d')][_0xc362('0x51')]({'where':{'id':_0x42481c['params']['id']}})[_0xc362('0x28')](handleEntityNotFound(_0x3ea152,null))['then'](function(_0x588123){if(_0x588123){_0x52a48f=_0x588123;_0xf05c7f['model']=_[_0xc362('0x33')](db['Dynamics365Field'][_0xc362('0x47')]);_0xf05c7f['query']=_[_0xc362('0x33')](_0x42481c[_0xc362('0x32')]);_0xf05c7f[_0xc362('0x34')]=_['intersection'](_0xf05c7f['model'],_0xf05c7f[_0xc362('0x32')]);_0x407f92['attributes']=_[_0xc362('0x35')](_0xf05c7f[_0xc362('0x30')],qs[_0xc362('0x48')](_0x42481c[_0xc362('0x32')]['fields']));_0x407f92[_0xc362('0x36')]=_0x407f92[_0xc362('0x36')][_0xc362('0x37')]?_0x407f92[_0xc362('0x36')]:_0xf05c7f[_0xc362('0x30')];_0x407f92[_0xc362('0x3a')]=qs[_0xc362('0x3b')](_0x42481c[_0xc362('0x32')][_0xc362('0x3b')]);_0x407f92[_0xc362('0x3e')]=qs[_0xc362('0x34')](_[_0xc362('0x3c')](_0x42481c[_0xc362('0x32')],_0xf05c7f['filters']));if(_0x42481c[_0xc362('0x32')][_0xc362('0x3d')]){_0x407f92[_0xc362('0x3e')]=_[_0xc362('0x3f')](_0x407f92[_0xc362('0x3e')],{'$or':_[_0xc362('0x2c')](_0x407f92['attributes'],function(_0x31b9d6){var _0x12369e={};_0x12369e[_0x31b9d6]={'$like':'%'+_0x42481c[_0xc362('0x32')][_0xc362('0x3d')]+'%'};return _0x12369e;})});}_0x407f92=_['merge']({},_0x407f92,_0x42481c[_0xc362('0x41')]);return _0x52a48f['getSubjects'](_0x407f92);}})[_0xc362('0x28')](function(_0x4df483){if(_0x4df483){_0x30f2a7=_0x4df483[_0xc362('0x37')];if(!_0x42481c[_0xc362('0x32')][_0xc362('0x38')](_0xc362('0x39'))){_0x407f92[_0xc362('0x21')]=qs[_0xc362('0x21')](_0x42481c[_0xc362('0x32')][_0xc362('0x21')]);_0x407f92['offset']=qs[_0xc362('0x1e')](_0x42481c[_0xc362('0x32')]['offset']);}return _0x52a48f['getSubjects'](_0x407f92);}})[_0xc362('0x28')](function(_0x32e7cf){if(_0x32e7cf){return _0x32e7cf?{'count':_0x30f2a7,'rows':_0x32e7cf}:null;}})[_0xc362('0x28')](respondWithResult(_0x3ea152,null))['catch'](handleError(_0x3ea152,null));};exports['getDescriptions']=function(_0x58bcfb,_0xcc06c,_0x430750){var _0x56e248={};var _0x171d3c={};var _0x1e7697;var _0x5179ce;return db['Dynamics365Configuration'][_0xc362('0x51')]({'where':{'id':_0x58bcfb[_0xc362('0x4d')]['id']}})[_0xc362('0x28')](handleEntityNotFound(_0xcc06c,null))['then'](function(_0x1ddb2a){if(_0x1ddb2a){_0x1e7697=_0x1ddb2a;_0x171d3c[_0xc362('0x30')]=_[_0xc362('0x33')](db['Dynamics365Field'][_0xc362('0x47')]);_0x171d3c[_0xc362('0x32')]=_[_0xc362('0x33')](_0x58bcfb[_0xc362('0x32')]);_0x171d3c[_0xc362('0x34')]=_['intersection'](_0x171d3c[_0xc362('0x30')],_0x171d3c[_0xc362('0x32')]);_0x56e248[_0xc362('0x36')]=_[_0xc362('0x35')](_0x171d3c[_0xc362('0x30')],qs['fields'](_0x58bcfb[_0xc362('0x32')][_0xc362('0x48')]));_0x56e248[_0xc362('0x36')]=_0x56e248[_0xc362('0x36')][_0xc362('0x37')]?_0x56e248[_0xc362('0x36')]:_0x171d3c[_0xc362('0x30')];_0x56e248[_0xc362('0x3a')]=qs[_0xc362('0x3b')](_0x58bcfb[_0xc362('0x32')]['sort']);_0x56e248[_0xc362('0x3e')]=qs['filters'](_[_0xc362('0x3c')](_0x58bcfb[_0xc362('0x32')],_0x171d3c['filters']));if(_0x58bcfb['query'][_0xc362('0x3d')]){_0x56e248[_0xc362('0x3e')]=_['merge'](_0x56e248[_0xc362('0x3e')],{'$or':_['map'](_0x56e248[_0xc362('0x36')],function(_0x4353cc){var _0x3a214e={};_0x3a214e[_0x4353cc]={'$like':'%'+_0x58bcfb[_0xc362('0x32')][_0xc362('0x3d')]+'%'};return _0x3a214e;})});}_0x56e248=_[_0xc362('0x3f')]({},_0x56e248,_0x58bcfb['options']);return _0x1e7697['getDescriptions'](_0x56e248);}})[_0xc362('0x28')](function(_0xbc9347){if(_0xbc9347){_0x5179ce=_0xbc9347[_0xc362('0x37')];if(!_0x58bcfb[_0xc362('0x32')][_0xc362('0x38')](_0xc362('0x39'))){_0x56e248['limit']=qs[_0xc362('0x21')](_0x58bcfb[_0xc362('0x32')][_0xc362('0x21')]);_0x56e248[_0xc362('0x1e')]=qs[_0xc362('0x1e')](_0x58bcfb['query'][_0xc362('0x1e')]);}return _0x1e7697[_0xc362('0x52')](_0x56e248);}})[_0xc362('0x28')](function(_0x4d091e){if(_0x4d091e){return _0x4d091e?{'count':_0x5179ce,'rows':_0x4d091e}:null;}})[_0xc362('0x28')](respondWithResult(_0xcc06c,null))['catch'](handleError(_0xcc06c,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 0389000..c1169f6 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 _0x84ab=['request-promise','path','../../config/environment','./intDynamics365Configuration.attributes','exports','Dynamics365Configuration','lodash','util','../../config/logger','api','moment'];(function(_0x5400b9,_0xded326){var _0x3871fb=function(_0x51e3f2){while(--_0x51e3f2){_0x5400b9['push'](_0x5400b9['shift']());}};_0x3871fb(++_0xded326);}(_0x84ab,0x12f));var _0xb84a=function(_0x4914e2,_0x48be8f){_0x4914e2=_0x4914e2-0x0;var _0x2dcd07=_0x84ab[_0x4914e2];return _0x2dcd07;};'use strict';var _=require(_0xb84a('0x0'));var util=require(_0xb84a('0x1'));var logger=require(_0xb84a('0x2'))(_0xb84a('0x3'));var moment=require(_0xb84a('0x4'));var BPromise=require('bluebird');var rp=require(_0xb84a('0x5'));var fs=require('fs');var path=require(_0xb84a('0x6'));var rimraf=require('rimraf');var config=require(_0xb84a('0x7'));var attributes=require(_0xb84a('0x8'));module[_0xb84a('0x9')]=function(_0x5b9def,_0x521a64){return _0x5b9def['define'](_0xb84a('0xa'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x70e0=['int_dynamics365_configurations','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./intDynamics365Configuration.attributes'];(function(_0x1b1516,_0x17a510){var _0x14902e=function(_0x573007){while(--_0x573007){_0x1b1516['push'](_0x1b1516['shift']());}};_0x14902e(++_0x17a510);}(_0x70e0,0x17b));var _0x070e=function(_0x4347e6,_0x2a1433){_0x4347e6=_0x4347e6-0x0;var _0x6d8730=_0x70e0[_0x4347e6];return _0x6d8730;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('Dynamics365Configuration',attributes,{'tableName':_0x070e('0x8'),'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 be96adf..868c944 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 _0x707b=['code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xdbd4f7,_0x4e3bdd){var _0x5c3f9d=function(_0xa7a35a){while(--_0xa7a35a){_0xdbd4f7['push'](_0xdbd4f7['shift']());}};_0x5c3f9d(++_0x4e3bdd);}(_0x707b,0x191));var _0xb707=function(_0x5751e6,_0x125e5e){_0x5751e6=_0x5751e6-0x0;var _0x4199e4=_0x707b[_0x5751e6];return _0x4199e4;};'use strict';var _=require(_0xb707('0x0'));var util=require('util');var moment=require(_0xb707('0x1'));var BPromise=require(_0xb707('0x2'));var rs=require(_0xb707('0x3'));var fs=require('fs');var Redis=require(_0xb707('0x4'));var db=require(_0xb707('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb707('0x6'))('rpc');var config=require(_0xb707('0x7'));var jayson=require(_0xb707('0x8'));var client=jayson['client'][_0xb707('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x366237,_0x5eff60,_0x1d29ba){return new BPromise(function(_0x57ae70,_0xf1600d){return client['request'](_0x366237,_0x1d29ba)[_0xb707('0xa')](function(_0x13f546){logger['info'](_0xb707('0xb'),_0x5eff60,_0xb707('0xc'));logger[_0xb707('0xd')](_0xb707('0xe'),_0x5eff60,'request\x20sent',JSON[_0xb707('0xf')](_0x13f546));if(_0x13f546['error']){if(_0x13f546[_0xb707('0x10')][_0xb707('0x11')]===0x1f4){logger['error'](_0xb707('0xb'),_0x5eff60,_0x13f546[_0xb707('0x10')][_0xb707('0x12')]);return _0xf1600d(_0x13f546[_0xb707('0x10')][_0xb707('0x12')]);}logger[_0xb707('0x10')](_0xb707('0xb'),_0x5eff60,_0x13f546[_0xb707('0x10')]['message']);return _0x57ae70(_0x13f546[_0xb707('0x10')][_0xb707('0x12')]);}else{logger[_0xb707('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5eff60,_0xb707('0xc'));_0x57ae70(_0x13f546[_0xb707('0x14')][_0xb707('0x12')]);}})[_0xb707('0x15')](function(_0x2e7d96){logger[_0xb707('0x10')](_0xb707('0xb'),_0x5eff60,_0x2e7d96);_0xf1600d(_0x2e7d96);});});} \ No newline at end of file +var _0xb1cf=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x1b70e3,_0x3a15b1){var _0x1452ab=function(_0x692883){while(--_0x692883){_0x1b70e3['push'](_0x1b70e3['shift']());}};_0x1452ab(++_0x3a15b1);}(_0xb1cf,0xe8));var _0xfb1c=function(_0x132d9e,_0x1475d7){_0x132d9e=_0x132d9e-0x0;var _0x4337a4=_0xb1cf[_0x132d9e];return _0x4337a4;};'use strict';var _=require(_0xfb1c('0x0'));var util=require(_0xfb1c('0x1'));var moment=require('moment');var BPromise=require(_0xfb1c('0x2'));var rs=require(_0xfb1c('0x3'));var fs=require('fs');var Redis=require(_0xfb1c('0x4'));var db=require(_0xfb1c('0x5'))['db'];var utils=require(_0xfb1c('0x6'));var logger=require(_0xfb1c('0x7'))(_0xfb1c('0x8'));var config=require('../../config/environment');var jayson=require(_0xfb1c('0x9'));var client=jayson[_0xfb1c('0xa')][_0xfb1c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x419204,_0x533fa3,_0xe976a6){return new BPromise(function(_0x45e1c7,_0x594d1b){return client[_0xfb1c('0xc')](_0x419204,_0xe976a6)[_0xfb1c('0xd')](function(_0x225077){logger[_0xfb1c('0xe')](_0xfb1c('0xf'),_0x533fa3,_0xfb1c('0x10'));logger[_0xfb1c('0x11')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x533fa3,_0xfb1c('0x10'),JSON[_0xfb1c('0x12')](_0x225077));if(_0x225077['error']){if(_0x225077[_0xfb1c('0x13')]['code']===0x1f4){logger['error'](_0xfb1c('0xf'),_0x533fa3,_0x225077[_0xfb1c('0x13')][_0xfb1c('0x14')]);return _0x594d1b(_0x225077[_0xfb1c('0x13')][_0xfb1c('0x14')]);}logger['error'](_0xfb1c('0xf'),_0x533fa3,_0x225077[_0xfb1c('0x13')][_0xfb1c('0x14')]);return _0x45e1c7(_0x225077[_0xfb1c('0x13')][_0xfb1c('0x14')]);}else{logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x533fa3,_0xfb1c('0x10'));_0x45e1c7(_0x225077[_0xfb1c('0x15')][_0xfb1c('0x14')]);}})[_0xfb1c('0x16')](function(_0x4e2ac1){logger['error'](_0xfb1c('0xf'),_0x533fa3,_0x4e2ac1);_0x594d1b(_0x4e2ac1);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 70eed4c..63686e4 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 _0x6dc2=['create','delete','destroy','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show'];(function(_0x5696d1,_0x45af09){var _0x258c01=function(_0x2d24d5){while(--_0x2d24d5){_0x5696d1['push'](_0x5696d1['shift']());}};_0x258c01(++_0x45af09);}(_0x6dc2,0xae));var _0x26dc=function(_0x4453bd,_0xe773a){_0x4453bd=_0x4453bd-0x0;var _0x5e8ed8=_0x6dc2[_0x4453bd];return _0x5e8ed8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x26dc('0x0'));var timeout=require(_0x26dc('0x1'));var express=require(_0x26dc('0x2'));var router=express['Router']();var fs_extra=require(_0x26dc('0x3'));var auth=require(_0x26dc('0x4'));var interaction=require(_0x26dc('0x5'));var config=require(_0x26dc('0x6'));var controller=require(_0x26dc('0x7'));router[_0x26dc('0x8')]('/',auth[_0x26dc('0x9')](),controller[_0x26dc('0xa')]);router[_0x26dc('0x8')](_0x26dc('0xb'),auth[_0x26dc('0x9')](),controller[_0x26dc('0xc')]);router['post']('/',auth[_0x26dc('0x9')](),controller[_0x26dc('0xd')]);router['put'](_0x26dc('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x26dc('0xe')](_0x26dc('0xb'),auth[_0x26dc('0x9')](),controller[_0x26dc('0xf')]);module[_0x26dc('0x10')]=router; \ No newline at end of file +var _0x94a3=['isAuthenticated','index','get','/:id','show','post','create','put','update','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5077ae,_0x264609){var _0x2293a2=function(_0x1581ef){while(--_0x1581ef){_0x5077ae['push'](_0x5077ae['shift']());}};_0x2293a2(++_0x264609);}(_0x94a3,0x76));var _0x394a=function(_0x16b13c,_0x4d08a9){_0x16b13c=_0x16b13c-0x0;var _0x307344=_0x94a3[_0x16b13c];return _0x307344;};'use strict';var multer=require('multer');var util=require(_0x394a('0x0'));var path=require(_0x394a('0x1'));var timeout=require(_0x394a('0x2'));var express=require(_0x394a('0x3'));var router=express[_0x394a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x394a('0x5'));var interaction=require(_0x394a('0x6'));var config=require(_0x394a('0x7'));var controller=require('./intDynamics365Field.controller');router['get']('/',auth[_0x394a('0x8')](),controller[_0x394a('0x9')]);router[_0x394a('0xa')](_0x394a('0xb'),auth[_0x394a('0x8')](),controller[_0x394a('0xc')]);router[_0x394a('0xd')]('/',auth['isAuthenticated'](),controller[_0x394a('0xe')]);router[_0x394a('0xf')](_0x394a('0xb'),auth[_0x394a('0x8')](),controller[_0x394a('0x10')]);router['delete']('/:id',auth[_0x394a('0x8')](),controller[_0x394a('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 45beaa4..d7bbe1d 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 _0x9b38=['variable','customVariable','keyValue','picklist','string','STRING','sequelize'];(function(_0x2f168e,_0x3c923c){var _0x5ee694=function(_0x12fdfa){while(--_0x12fdfa){_0x2f168e['push'](_0x2f168e['shift']());}};_0x5ee694(++_0x3c923c);}(_0x9b38,0x1e2));var _0x89b3=function(_0x565eae,_0x176003){_0x565eae=_0x565eae-0x0;var _0x38744d=_0x9b38[_0x565eae];return _0x38744d;};'use strict';var Sequelize=require(_0x89b3('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string',_0x89b3('0x1'),_0x89b3('0x2'),_0x89b3('0x3'),_0x89b3('0x4')),'defaultValue':_0x89b3('0x5')},'content':{'type':Sequelize[_0x89b3('0x6')]},'key':{'type':Sequelize[_0x89b3('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x89b3('0x5'),_0x89b3('0x1'),_0x89b3('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x89b3('0x6')]},'nameField':{'type':Sequelize[_0x89b3('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x89b3('0x6')]}}; \ No newline at end of file +var _0x2f28=['exports','ENUM','string','variable','customVariable','picklist','STRING','BOOLEAN'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0x2f28,0x1b0));var _0x82f2=function(_0x297a2f,_0x12efa4){_0x297a2f=_0x297a2f-0x0;var _0x4399c6=_0x2f28[_0x297a2f];return _0x4399c6;};'use strict';var Sequelize=require('sequelize');module[_0x82f2('0x0')]={'type':{'type':Sequelize[_0x82f2('0x1')](_0x82f2('0x2'),_0x82f2('0x3'),_0x82f2('0x4'),'keyValue',_0x82f2('0x5')),'defaultValue':_0x82f2('0x2')},'content':{'type':Sequelize[_0x82f2('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x82f2('0x1')](_0x82f2('0x2'),'variable',_0x82f2('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x82f2('0x6')]},'nameField':{'type':Sequelize[_0x82f2('0x6')]},'customField':{'type':Sequelize[_0x82f2('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x82f2('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 3c4c63c..5b76110 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 _0x04bf=['find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','then','destroy','error','stack','name','index','rawAttributes','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','options','Dynamics365Field','includeAll','include','findAll','rows','show','params','catch','create','body','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x04bf,0x95));var _0xf04b=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x04bf[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require(_0xf04b('0x0'));var rimraf=require(_0xf04b('0x1'));var zipdir=require(_0xf04b('0x2'));var jsonpatch=require(_0xf04b('0x3'));var rp=require(_0xf04b('0x4'));var moment=require('moment');var BPromise=require(_0xf04b('0x5'));var Mustache=require('mustache');var util=require(_0xf04b('0x6'));var path=require(_0xf04b('0x7'));var sox=require(_0xf04b('0x8'));var csv=require(_0xf04b('0x9'));var ejs=require(_0xf04b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf04b('0xb'));var crypto=require(_0xf04b('0xc'));var jsforce=require(_0xf04b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf04b('0x9'));var querystring=require(_0xf04b('0xe'));var Papa=require(_0xf04b('0xf'));var Redis=require(_0xf04b('0x10'));var authService=require(_0xf04b('0x11'));var qs=require(_0xf04b('0x12'));var as=require(_0xf04b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf04b('0x14'))('api');var utils=require(_0xf04b('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf04b('0x16'));var db=require(_0xf04b('0x17'))['db'];function respondWithStatusCode(_0x28c0f6,_0x4a10f3){_0x4a10f3=_0x4a10f3||0xcc;return function(_0x116e86){if(_0x116e86){return _0x28c0f6[_0xf04b('0x18')](_0x4a10f3);}return _0x28c0f6[_0xf04b('0x19')](_0x4a10f3)[_0xf04b('0x1a')]();};}function respondWithResult(_0x4abe47,_0x20bc72){_0x20bc72=_0x20bc72||0xc8;return function(_0xdb89ed){if(_0xdb89ed){return _0x4abe47['status'](_0x20bc72)[_0xf04b('0x1b')](_0xdb89ed);}};}function respondWithFilteredResult(_0x470051,_0x11d977){return function(_0x257528){if(_0x257528){var _0x521c65=typeof _0x11d977[_0xf04b('0x1c')]===_0xf04b('0x1d')&&typeof _0x11d977['limit']===_0xf04b('0x1d');var _0x12db9a=_0x257528[_0xf04b('0x1e')];var _0x32c616=_0x521c65?0x0:_0x11d977[_0xf04b('0x1c')];var _0x413c76=_0x521c65?_0x257528[_0xf04b('0x1e')]:_0x11d977[_0xf04b('0x1c')]+_0x11d977[_0xf04b('0x1f')];var _0x550785;if(_0x413c76>=_0x12db9a){_0x413c76=_0x12db9a;_0x550785=0xc8;}else{_0x550785=0xce;}_0x470051[_0xf04b('0x19')](_0x550785);return _0x470051[_0xf04b('0x20')](_0xf04b('0x21'),_0x32c616+'-'+_0x413c76+'/'+_0x12db9a)[_0xf04b('0x1b')](_0x257528);}return null;};}function patchUpdates(_0x315baa){return function(_0xbf53d6){try{jsonpatch[_0xf04b('0x22')](_0xbf53d6,_0x315baa,!![]);}catch(_0x7baef0){return BPromise['reject'](_0x7baef0);}return _0xbf53d6['save']();};}function saveUpdates(_0x2d31f3,_0x33db76){return function(_0x3971f2){if(_0x3971f2){return _0x3971f2['update'](_0x2d31f3)[_0xf04b('0x23')](function(_0x58fdcc){return _0x58fdcc;});}return null;};}function removeEntity(_0x44d325,_0x108f66){return function(_0x1fbe16){if(_0x1fbe16){return _0x1fbe16[_0xf04b('0x24')]()[_0xf04b('0x23')](function(){_0x44d325['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x248ecc,_0x3625e7){return function(_0x159b1c){if(!_0x159b1c){_0x248ecc['sendStatus'](0x194);}return _0x159b1c;};}function handleError(_0x43e248,_0x502699){_0x502699=_0x502699||0x1f4;return function(_0x26ad7b){logger[_0xf04b('0x25')](_0x26ad7b[_0xf04b('0x26')]);if(_0x26ad7b[_0xf04b('0x27')]){delete _0x26ad7b[_0xf04b('0x27')];}_0x43e248[_0xf04b('0x19')](_0x502699)['send'](_0x26ad7b);};}exports[_0xf04b('0x28')]=function(_0x5778d9,_0x1cd9c4){var _0x262348={},_0x3f8bf8={},_0x10384d={'count':0x0,'rows':[]};var _0x359b5d=_['map'](db['Dynamics365Field'][_0xf04b('0x29')],function(_0x2abe71){return{'name':_0x2abe71['fieldName'],'type':_0x2abe71['type'][_0xf04b('0x2a')]};});_0x3f8bf8[_0xf04b('0x2b')]=_[_0xf04b('0x2c')](_0x359b5d,'name');_0x3f8bf8['query']=_[_0xf04b('0x2d')](_0x5778d9[_0xf04b('0x2e')]);_0x3f8bf8[_0xf04b('0x2f')]=_[_0xf04b('0x30')](_0x3f8bf8['model'],_0x3f8bf8[_0xf04b('0x2e')]);_0x262348[_0xf04b('0x31')]=_['intersection'](_0x3f8bf8[_0xf04b('0x2b')],qs[_0xf04b('0x32')](_0x5778d9['query'][_0xf04b('0x32')]));_0x262348[_0xf04b('0x31')]=_0x262348[_0xf04b('0x31')][_0xf04b('0x33')]?_0x262348[_0xf04b('0x31')]:_0x3f8bf8[_0xf04b('0x2b')];if(!_0x5778d9[_0xf04b('0x2e')][_0xf04b('0x34')](_0xf04b('0x35'))){_0x262348['limit']=qs[_0xf04b('0x1f')](_0x5778d9[_0xf04b('0x2e')]['limit']);_0x262348[_0xf04b('0x1c')]=qs[_0xf04b('0x1c')](_0x5778d9[_0xf04b('0x2e')][_0xf04b('0x1c')]);}_0x262348[_0xf04b('0x36')]=qs[_0xf04b('0x37')](_0x5778d9[_0xf04b('0x2e')][_0xf04b('0x37')]);_0x262348['where']=qs[_0xf04b('0x2f')](_[_0xf04b('0x38')](_0x5778d9[_0xf04b('0x2e')],_0x3f8bf8[_0xf04b('0x2f')]),_0x359b5d);if(_0x5778d9[_0xf04b('0x2e')][_0xf04b('0x39')]){_0x262348[_0xf04b('0x3a')]=_[_0xf04b('0x3b')](_0x262348[_0xf04b('0x3a')],{'$or':_[_0xf04b('0x2c')](_0x359b5d,function(_0x9dcb79){if(_0x9dcb79[_0xf04b('0x3c')]!=='VIRTUAL'){var _0x58aa16={};_0x58aa16[_0x9dcb79[_0xf04b('0x27')]]={'$like':'%'+_0x5778d9[_0xf04b('0x2e')][_0xf04b('0x39')]+'%'};return _0x58aa16;}})});}_0x262348=_[_0xf04b('0x3b')]({},_0x262348,_0x5778d9[_0xf04b('0x3d')]);var _0x18f215={'where':_0x262348['where']};return db[_0xf04b('0x3e')][_0xf04b('0x1e')](_0x18f215)[_0xf04b('0x23')](function(_0x54a96d){_0x10384d[_0xf04b('0x1e')]=_0x54a96d;if(_0x5778d9['query'][_0xf04b('0x3f')]){_0x262348[_0xf04b('0x40')]=[{'all':!![]}];}return db[_0xf04b('0x3e')][_0xf04b('0x41')](_0x262348);})[_0xf04b('0x23')](function(_0xd5daef){_0x10384d[_0xf04b('0x42')]=_0xd5daef;return _0x10384d;})[_0xf04b('0x23')](respondWithFilteredResult(_0x1cd9c4,_0x262348))['catch'](handleError(_0x1cd9c4,null));};exports[_0xf04b('0x43')]=function(_0x59b588,_0x25647c){var _0x256032={'raw':!![],'where':{'id':_0x59b588[_0xf04b('0x44')]['id']}},_0x58cc9b={};_0x58cc9b[_0xf04b('0x2b')]=_['keys'](db['Dynamics365Field'][_0xf04b('0x29')]);_0x58cc9b[_0xf04b('0x2e')]=_['keys'](_0x59b588[_0xf04b('0x2e')]);_0x58cc9b['filters']=_[_0xf04b('0x30')](_0x58cc9b[_0xf04b('0x2b')],_0x58cc9b[_0xf04b('0x2e')]);_0x256032[_0xf04b('0x31')]=_[_0xf04b('0x30')](_0x58cc9b[_0xf04b('0x2b')],qs[_0xf04b('0x32')](_0x59b588[_0xf04b('0x2e')][_0xf04b('0x32')]));_0x256032[_0xf04b('0x31')]=_0x256032[_0xf04b('0x31')]['length']?_0x256032[_0xf04b('0x31')]:_0x58cc9b[_0xf04b('0x2b')];if(_0x59b588[_0xf04b('0x2e')][_0xf04b('0x3f')]){_0x256032['include']=[{'all':!![]}];}_0x256032=_[_0xf04b('0x3b')]({},_0x256032,_0x59b588[_0xf04b('0x3d')]);return db[_0xf04b('0x3e')]['find'](_0x256032)['then'](handleEntityNotFound(_0x25647c,null))[_0xf04b('0x23')](respondWithResult(_0x25647c,null))[_0xf04b('0x45')](handleError(_0x25647c,null));};exports[_0xf04b('0x46')]=function(_0x4b5f00,_0x29e89c){return db[_0xf04b('0x3e')][_0xf04b('0x46')](_0x4b5f00[_0xf04b('0x47')],{})[_0xf04b('0x23')](respondWithResult(_0x29e89c,0xc9))[_0xf04b('0x45')](handleError(_0x29e89c,null));};exports[_0xf04b('0x48')]=function(_0xb574e,_0x5c8db9){if(_0xb574e[_0xf04b('0x47')]['id']){delete _0xb574e['body']['id'];}return db[_0xf04b('0x3e')][_0xf04b('0x49')]({'where':{'id':_0xb574e[_0xf04b('0x44')]['id']}})[_0xf04b('0x23')](handleEntityNotFound(_0x5c8db9,null))['then'](saveUpdates(_0xb574e['body'],null))[_0xf04b('0x23')](respondWithResult(_0x5c8db9,null))[_0xf04b('0x45')](handleError(_0x5c8db9,null));};exports['destroy']=function(_0x1f3ca8,_0x1a3e6b){return db[_0xf04b('0x3e')][_0xf04b('0x49')]({'where':{'id':_0x1f3ca8['params']['id']}})['then'](handleEntityNotFound(_0x1a3e6b,null))[_0xf04b('0x23')](removeEntity(_0x1a3e6b,null))[_0xf04b('0x45')](handleError(_0x1a3e6b,null));}; \ No newline at end of file +var _0xabf9=['desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','save','then','destroy','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','rows','catch','show','params','fields','length','include','options','find','create','body','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce'];(function(_0x1c529a,_0x458410){var _0x4c7777=function(_0x4af680){while(--_0x4af680){_0x1c529a['push'](_0x1c529a['shift']());}};_0x4c7777(++_0x458410);}(_0xabf9,0x88));var _0x9abf=function(_0x2a8217,_0x1857ed){_0x2a8217=_0x2a8217-0x0;var _0x191234=_0xabf9[_0x2a8217];return _0x191234;};'use strict';var emlformat=require(_0x9abf('0x0'));var rimraf=require(_0x9abf('0x1'));var zipdir=require(_0x9abf('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9abf('0x3'));var moment=require(_0x9abf('0x4'));var BPromise=require(_0x9abf('0x5'));var Mustache=require(_0x9abf('0x6'));var util=require(_0x9abf('0x7'));var path=require(_0x9abf('0x8'));var sox=require(_0x9abf('0x9'));var csv=require(_0x9abf('0xa'));var ejs=require(_0x9abf('0xb'));var fs=require('fs');var fs_extra=require(_0x9abf('0xc'));var _=require(_0x9abf('0xd'));var squel=require(_0x9abf('0xe'));var crypto=require('crypto');var jsforce=require(_0x9abf('0xf'));var deskjs=require(_0x9abf('0x10'));var toCsv=require(_0x9abf('0xa'));var querystring=require(_0x9abf('0x11'));var Papa=require(_0x9abf('0x12'));var Redis=require(_0x9abf('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x9abf('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9abf('0x15'))(_0x9abf('0x16'));var utils=require(_0x9abf('0x17'));var config=require(_0x9abf('0x18'));var licenseUtil=require(_0x9abf('0x19'));var db=require(_0x9abf('0x1a'))['db'];function respondWithStatusCode(_0x5f2a00,_0x1a7c8a){_0x1a7c8a=_0x1a7c8a||0xcc;return function(_0x13c48d){if(_0x13c48d){return _0x5f2a00['sendStatus'](_0x1a7c8a);}return _0x5f2a00[_0x9abf('0x1b')](_0x1a7c8a)[_0x9abf('0x1c')]();};}function respondWithResult(_0x9b9553,_0x2aa08a){_0x2aa08a=_0x2aa08a||0xc8;return function(_0x1a1279){if(_0x1a1279){return _0x9b9553[_0x9abf('0x1b')](_0x2aa08a)[_0x9abf('0x1d')](_0x1a1279);}};}function respondWithFilteredResult(_0x4de040,_0x501b3f){return function(_0x444e48){if(_0x444e48){var _0x33c27f=typeof _0x501b3f[_0x9abf('0x1e')]===_0x9abf('0x1f')&&typeof _0x501b3f[_0x9abf('0x20')]===_0x9abf('0x1f');var _0x5e5f0a=_0x444e48[_0x9abf('0x21')];var _0xfeb6c7=_0x33c27f?0x0:_0x501b3f[_0x9abf('0x1e')];var _0x5ad685=_0x33c27f?_0x444e48[_0x9abf('0x21')]:_0x501b3f[_0x9abf('0x1e')]+_0x501b3f['limit'];var _0x24fc9d;if(_0x5ad685>=_0x5e5f0a){_0x5ad685=_0x5e5f0a;_0x24fc9d=0xc8;}else{_0x24fc9d=0xce;}_0x4de040[_0x9abf('0x1b')](_0x24fc9d);return _0x4de040[_0x9abf('0x22')]('Content-Range',_0xfeb6c7+'-'+_0x5ad685+'/'+_0x5e5f0a)[_0x9abf('0x1d')](_0x444e48);}return null;};}function patchUpdates(_0x10b50b){return function(_0x377bf4){try{jsonpatch[_0x9abf('0x23')](_0x377bf4,_0x10b50b,!![]);}catch(_0x4ef080){return BPromise['reject'](_0x4ef080);}return _0x377bf4[_0x9abf('0x24')]();};}function saveUpdates(_0x217481,_0xb6dbb){return function(_0x53eb94){if(_0x53eb94){return _0x53eb94['update'](_0x217481)[_0x9abf('0x25')](function(_0x20ccb0){return _0x20ccb0;});}return null;};}function removeEntity(_0x271382,_0xa2ef20){return function(_0x55a152){if(_0x55a152){return _0x55a152[_0x9abf('0x26')]()[_0x9abf('0x25')](function(){_0x271382[_0x9abf('0x1b')](0xcc)[_0x9abf('0x1c')]();});}};}function handleEntityNotFound(_0x1d5012,_0x391698){return function(_0x491d9d){if(!_0x491d9d){_0x1d5012['sendStatus'](0x194);}return _0x491d9d;};}function handleError(_0x2e2c6b,_0x4a9be6){_0x4a9be6=_0x4a9be6||0x1f4;return function(_0x10ddeb){logger['error'](_0x10ddeb['stack']);if(_0x10ddeb[_0x9abf('0x27')]){delete _0x10ddeb[_0x9abf('0x27')];}_0x2e2c6b[_0x9abf('0x1b')](_0x4a9be6)[_0x9abf('0x28')](_0x10ddeb);};}exports[_0x9abf('0x29')]=function(_0x55ae9a,_0x380ae1){var _0x300c63={},_0x406965={},_0x48c0ba={'count':0x0,'rows':[]};var _0x25a1a0=_[_0x9abf('0x2a')](db[_0x9abf('0x2b')][_0x9abf('0x2c')],function(_0x1db125){return{'name':_0x1db125[_0x9abf('0x2d')],'type':_0x1db125[_0x9abf('0x2e')][_0x9abf('0x2f')]};});_0x406965[_0x9abf('0x30')]=_[_0x9abf('0x2a')](_0x25a1a0,_0x9abf('0x27'));_0x406965['query']=_[_0x9abf('0x31')](_0x55ae9a[_0x9abf('0x32')]);_0x406965['filters']=_[_0x9abf('0x33')](_0x406965[_0x9abf('0x30')],_0x406965[_0x9abf('0x32')]);_0x300c63[_0x9abf('0x34')]=_[_0x9abf('0x33')](_0x406965[_0x9abf('0x30')],qs['fields'](_0x55ae9a[_0x9abf('0x32')]['fields']));_0x300c63[_0x9abf('0x34')]=_0x300c63['attributes']['length']?_0x300c63[_0x9abf('0x34')]:_0x406965[_0x9abf('0x30')];if(!_0x55ae9a['query'][_0x9abf('0x35')](_0x9abf('0x36'))){_0x300c63[_0x9abf('0x20')]=qs[_0x9abf('0x20')](_0x55ae9a[_0x9abf('0x32')][_0x9abf('0x20')]);_0x300c63['offset']=qs[_0x9abf('0x1e')](_0x55ae9a[_0x9abf('0x32')]['offset']);}_0x300c63[_0x9abf('0x37')]=qs['sort'](_0x55ae9a[_0x9abf('0x32')][_0x9abf('0x38')]);_0x300c63[_0x9abf('0x39')]=qs[_0x9abf('0x3a')](_[_0x9abf('0x3b')](_0x55ae9a['query'],_0x406965['filters']),_0x25a1a0);if(_0x55ae9a['query'][_0x9abf('0x3c')]){_0x300c63[_0x9abf('0x39')]=_[_0x9abf('0x3d')](_0x300c63[_0x9abf('0x39')],{'$or':_[_0x9abf('0x2a')](_0x25a1a0,function(_0x47330b){if(_0x47330b[_0x9abf('0x2e')]!==_0x9abf('0x3e')){var _0x2647b3={};_0x2647b3[_0x47330b[_0x9abf('0x27')]]={'$like':'%'+_0x55ae9a[_0x9abf('0x32')]['filter']+'%'};return _0x2647b3;}})});}_0x300c63=_[_0x9abf('0x3d')]({},_0x300c63,_0x55ae9a['options']);var _0x252aa4={'where':_0x300c63[_0x9abf('0x39')]};return db['Dynamics365Field'][_0x9abf('0x21')](_0x252aa4)[_0x9abf('0x25')](function(_0x4cf2d0){_0x48c0ba[_0x9abf('0x21')]=_0x4cf2d0;if(_0x55ae9a[_0x9abf('0x32')][_0x9abf('0x3f')]){_0x300c63['include']=[{'all':!![]}];}return db[_0x9abf('0x2b')]['findAll'](_0x300c63);})[_0x9abf('0x25')](function(_0x35fede){_0x48c0ba[_0x9abf('0x40')]=_0x35fede;return _0x48c0ba;})['then'](respondWithFilteredResult(_0x380ae1,_0x300c63))[_0x9abf('0x41')](handleError(_0x380ae1,null));};exports[_0x9abf('0x42')]=function(_0x49969b,_0x2fe0d1){var _0x3ddbba={'raw':!![],'where':{'id':_0x49969b[_0x9abf('0x43')]['id']}},_0x2d8e83={};_0x2d8e83[_0x9abf('0x30')]=_[_0x9abf('0x31')](db[_0x9abf('0x2b')][_0x9abf('0x2c')]);_0x2d8e83[_0x9abf('0x32')]=_[_0x9abf('0x31')](_0x49969b[_0x9abf('0x32')]);_0x2d8e83[_0x9abf('0x3a')]=_['intersection'](_0x2d8e83[_0x9abf('0x30')],_0x2d8e83[_0x9abf('0x32')]);_0x3ddbba[_0x9abf('0x34')]=_['intersection'](_0x2d8e83[_0x9abf('0x30')],qs[_0x9abf('0x44')](_0x49969b[_0x9abf('0x32')][_0x9abf('0x44')]));_0x3ddbba[_0x9abf('0x34')]=_0x3ddbba[_0x9abf('0x34')][_0x9abf('0x45')]?_0x3ddbba[_0x9abf('0x34')]:_0x2d8e83[_0x9abf('0x30')];if(_0x49969b[_0x9abf('0x32')]['includeAll']){_0x3ddbba[_0x9abf('0x46')]=[{'all':!![]}];}_0x3ddbba=_['merge']({},_0x3ddbba,_0x49969b[_0x9abf('0x47')]);return db[_0x9abf('0x2b')][_0x9abf('0x48')](_0x3ddbba)['then'](handleEntityNotFound(_0x2fe0d1,null))[_0x9abf('0x25')](respondWithResult(_0x2fe0d1,null))[_0x9abf('0x41')](handleError(_0x2fe0d1,null));};exports[_0x9abf('0x49')]=function(_0x60ec22,_0x349f49){return db[_0x9abf('0x2b')][_0x9abf('0x49')](_0x60ec22[_0x9abf('0x4a')],{})[_0x9abf('0x25')](respondWithResult(_0x349f49,0xc9))[_0x9abf('0x41')](handleError(_0x349f49,null));};exports[_0x9abf('0x4b')]=function(_0x49fd73,_0x338903){if(_0x49fd73[_0x9abf('0x4a')]['id']){delete _0x49fd73[_0x9abf('0x4a')]['id'];}return db[_0x9abf('0x2b')][_0x9abf('0x48')]({'where':{'id':_0x49fd73[_0x9abf('0x43')]['id']}})[_0x9abf('0x25')](handleEntityNotFound(_0x338903,null))['then'](saveUpdates(_0x49fd73[_0x9abf('0x4a')],null))[_0x9abf('0x25')](respondWithResult(_0x338903,null))[_0x9abf('0x41')](handleError(_0x338903,null));};exports[_0x9abf('0x26')]=function(_0xb215b2,_0x5bf7c9){return db[_0x9abf('0x2b')]['find']({'where':{'id':_0xb215b2[_0x9abf('0x43')]['id']}})[_0x9abf('0x25')](handleEntityNotFound(_0x5bf7c9,null))['then'](removeEntity(_0x5bf7c9,null))[_0x9abf('0x41')](handleError(_0x5bf7c9,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 66e8690..f45caed 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 _0x831f=['FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','Dynamics365Field','int_dynamics365_fields','idField'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x831f,0x79));var _0xf831=function(_0x1f88f0,_0x2dc0ac){_0x1f88f0=_0x1f88f0-0x0;var _0x3684f5=_0x831f[_0x1f88f0];return _0x3684f5;};'use strict';var _=require(_0xf831('0x0'));var util=require(_0xf831('0x1'));var logger=require(_0xf831('0x2'))(_0xf831('0x3'));var moment=require(_0xf831('0x4'));var BPromise=require('bluebird');var rp=require(_0xf831('0x5'));var fs=require('fs');var path=require(_0xf831('0x6'));var rimraf=require(_0xf831('0x7'));var config=require(_0xf831('0x8'));var attributes=require(_0xf831('0x9'));module[_0xf831('0xa')]=function(_0x2b3104,_0x1e4d4c){return _0x2b3104['define'](_0xf831('0xb'),attributes,{'tableName':_0xf831('0xc'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0xf831('0xd'),_0xf831('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4278=['int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./intDynamics365Field.attributes','Dynamics365Field'];(function(_0x545b6a,_0x38b96b){var _0x5387b7=function(_0x2b7287){while(--_0x2b7287){_0x545b6a['push'](_0x545b6a['shift']());}};_0x5387b7(++_0x38b96b);}(_0x4278,0x170));var _0x8427=function(_0x56bac5,_0x158daf){_0x56bac5=_0x56bac5-0x0;var _0x54d752=_0x4278[_0x56bac5];return _0x54d752;};'use strict';var _=require(_0x8427('0x0'));var util=require(_0x8427('0x1'));var logger=require(_0x8427('0x2'))(_0x8427('0x3'));var moment=require(_0x8427('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8427('0x5'));var rimraf=require(_0x8427('0x6'));var config=require(_0x8427('0x7'));var attributes=require(_0x8427('0x8'));module['exports']=function(_0x305e15,_0x9e1c0){return _0x305e15['define'](_0x8427('0x9'),attributes,{'tableName':_0x8427('0xa'),'paranoid':![],'indexes':[{'name':_0x8427('0xb'),'fields':[_0x8427('0xc'),_0x8427('0xd')],'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 071d2a3..33ab41b 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 _0xf236=['then','info','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','Dynamics365Field,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf236,0x1ee));var _0x6f23=function(_0x470b0a,_0x2889d6){_0x470b0a=_0x470b0a-0x0;var _0x4463f6=_0xf236[_0x470b0a];return _0x4463f6;};'use strict';var _=require('lodash');var util=require(_0x6f23('0x0'));var moment=require(_0x6f23('0x1'));var BPromise=require(_0x6f23('0x2'));var rs=require(_0x6f23('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6f23('0x4'));var logger=require(_0x6f23('0x5'))(_0x6f23('0x6'));var config=require(_0x6f23('0x7'));var jayson=require(_0x6f23('0x8'));var client=jayson[_0x6f23('0x9')][_0x6f23('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b077e,_0x192ca4,_0x22140f){return new BPromise(function(_0x529642,_0x5ef650){return client[_0x6f23('0xb')](_0x2b077e,_0x22140f)[_0x6f23('0xc')](function(_0x2630c2){logger[_0x6f23('0xd')]('Dynamics365Field,\x20%s,\x20%s',_0x192ca4,_0x6f23('0xe'));logger[_0x6f23('0xf')](_0x6f23('0x10'),_0x192ca4,_0x6f23('0xe'),JSON[_0x6f23('0x11')](_0x2630c2));if(_0x2630c2[_0x6f23('0x12')]){if(_0x2630c2['error']['code']===0x1f4){logger['error'](_0x6f23('0x13'),_0x192ca4,_0x2630c2['error'][_0x6f23('0x14')]);return _0x5ef650(_0x2630c2[_0x6f23('0x12')][_0x6f23('0x14')]);}logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x192ca4,_0x2630c2['error'][_0x6f23('0x14')]);return _0x529642(_0x2630c2[_0x6f23('0x12')][_0x6f23('0x14')]);}else{logger['info'](_0x6f23('0x13'),_0x192ca4,_0x6f23('0xe'));_0x529642(_0x2630c2['result'][_0x6f23('0x14')]);}})[_0x6f23('0x15')](function(_0xebeff7){logger[_0x6f23('0x12')](_0x6f23('0x13'),_0x192ca4,_0xebeff7);_0x5ef650(_0xebeff7);});});} \ No newline at end of file +var _0x3488=['debug','stringify','error','message','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent'];(function(_0xe6cd1d,_0x43d689){var _0xa2924e=function(_0x312465){while(--_0x312465){_0xe6cd1d['push'](_0xe6cd1d['shift']());}};_0xa2924e(++_0x43d689);}(_0x3488,0x147));var _0x8348=function(_0x1a150c,_0x35facb){_0x1a150c=_0x1a150c-0x0;var _0x29cde7=_0x3488[_0x1a150c];return _0x29cde7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8348('0x0'));var BPromise=require(_0x8348('0x1'));var rs=require(_0x8348('0x2'));var fs=require('fs');var Redis=require(_0x8348('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8348('0x4'))('rpc');var config=require(_0x8348('0x5'));var jayson=require(_0x8348('0x6'));var client=jayson[_0x8348('0x7')][_0x8348('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1aeeb5,_0x46879a,_0x1e6c04){return new BPromise(function(_0x2e3b33,_0x9cfd78){return client[_0x8348('0x9')](_0x1aeeb5,_0x1e6c04)['then'](function(_0x5ebe9e){logger[_0x8348('0xa')](_0x8348('0xb'),_0x46879a,_0x8348('0xc'));logger[_0x8348('0xd')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x46879a,'request\x20sent',JSON[_0x8348('0xe')](_0x5ebe9e));if(_0x5ebe9e[_0x8348('0xf')]){if(_0x5ebe9e[_0x8348('0xf')]['code']===0x1f4){logger[_0x8348('0xf')](_0x8348('0xb'),_0x46879a,_0x5ebe9e[_0x8348('0xf')][_0x8348('0x10')]);return _0x9cfd78(_0x5ebe9e[_0x8348('0xf')][_0x8348('0x10')]);}logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x46879a,_0x5ebe9e['error']['message']);return _0x2e3b33(_0x5ebe9e[_0x8348('0xf')]['message']);}else{logger[_0x8348('0xa')](_0x8348('0xb'),_0x46879a,_0x8348('0xc'));_0x2e3b33(_0x5ebe9e['result']['message']);}})['catch'](function(_0xeddee2){logger[_0x8348('0xf')]('Dynamics365Field,\x20%s,\x20%s',_0x46879a,_0xeddee2);_0x9cfd78(_0xeddee2);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index bc6e4ed..7038021 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 _0x0c5f=['../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','isAuthenticated','/:id','get','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','delete','destroy','exports','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x3e4cca,_0x195314){var _0x37d4b7=function(_0x4ef241){while(--_0x4ef241){_0x3e4cca['push'](_0x3e4cca['shift']());}};_0x37d4b7(++_0x195314);}(_0x0c5f,0xd7));var _0xf0c5=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0c5f[_0x122ef9];return _0x42fba0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf0c5('0x0'));var timeout=require('connect-timeout');var express=require(_0xf0c5('0x1'));var router=express[_0xf0c5('0x2')]();var fs_extra=require(_0xf0c5('0x3'));var auth=require(_0xf0c5('0x4'));var interaction=require(_0xf0c5('0x5'));var config=require(_0xf0c5('0x6'));var controller=require(_0xf0c5('0x7'));router['get']('/',auth[_0xf0c5('0x8')](),controller['index']);router['get'](_0xf0c5('0x9'),auth[_0xf0c5('0x8')](),controller['show']);router[_0xf0c5('0xa')](_0xf0c5('0xb'),auth[_0xf0c5('0x8')](),controller[_0xf0c5('0xc')]);router[_0xf0c5('0xa')](_0xf0c5('0xd'),auth[_0xf0c5('0x8')](),controller['getFields']);router[_0xf0c5('0xe')]('/',auth[_0xf0c5('0x8')](),controller[_0xf0c5('0xf')]);router[_0xf0c5('0xe')](_0xf0c5('0xb'),auth[_0xf0c5('0x8')](),controller[_0xf0c5('0x10')]);router[_0xf0c5('0x11')](_0xf0c5('0x9'),auth['isAuthenticated'](),controller[_0xf0c5('0x12')]);router[_0xf0c5('0x13')](_0xf0c5('0x9'),auth['isAuthenticated'](),controller[_0xf0c5('0x14')]);module[_0xf0c5('0x15')]=router; \ No newline at end of file +var _0xbc0f=['put','/:id','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','show','getConfigurations','post','/:id/configurations','addConfiguration'];(function(_0x5be068,_0x18b0b8){var _0x5bc2a5=function(_0x22d7b6){while(--_0x22d7b6){_0x5be068['push'](_0x5be068['shift']());}};_0x5bc2a5(++_0x18b0b8);}(_0xbc0f,0xf5));var _0xfbc0=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0xbc0f[_0x20589d];return _0x422de9;};'use strict';var multer=require('multer');var util=require(_0xfbc0('0x0'));var path=require(_0xfbc0('0x1'));var timeout=require(_0xfbc0('0x2'));var express=require(_0xfbc0('0x3'));var router=express[_0xfbc0('0x4')]();var fs_extra=require(_0xfbc0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfbc0('0x6'));var config=require('../../config/environment');var controller=require('./intFreshdeskAccount.controller');router[_0xfbc0('0x7')]('/',auth[_0xfbc0('0x8')](),controller[_0xfbc0('0x9')]);router[_0xfbc0('0x7')]('/:id',auth[_0xfbc0('0x8')](),controller[_0xfbc0('0xa')]);router['get']('/:id/configurations',auth['isAuthenticated'](),controller[_0xfbc0('0xb')]);router[_0xfbc0('0x7')]('/:id/fields',auth[_0xfbc0('0x8')](),controller['getFields']);router[_0xfbc0('0xc')]('/',auth[_0xfbc0('0x8')](),controller['create']);router[_0xfbc0('0xc')](_0xfbc0('0xd'),auth['isAuthenticated'](),controller[_0xfbc0('0xe')]);router[_0xfbc0('0xf')](_0xfbc0('0x10'),auth['isAuthenticated'](),controller[_0xfbc0('0x11')]);router[_0xfbc0('0x12')](_0xfbc0('0x10'),auth['isAuthenticated'](),controller[_0xfbc0('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 47335d7..43af5aa 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 _0x5fdc=['sequelize','exports','STRING','username','remoteUri'];(function(_0x4052c0,_0x4271ab){var _0x296f04=function(_0x5373fc){while(--_0x5373fc){_0x4052c0['push'](_0x4052c0['shift']());}};_0x296f04(++_0x4271ab);}(_0x5fdc,0x127));var _0xc5fd=function(_0x13194a,_0x91bc83){_0x13194a=_0x13194a-0x0;var _0xd7ae50=_0x5fdc[_0x13194a];return _0xd7ae50;};'use strict';var Sequelize=require(_0xc5fd('0x0'));module[_0xc5fd('0x1')]={'name':{'type':Sequelize[_0xc5fd('0x2')]},'description':{'type':Sequelize[_0xc5fd('0x2')]},'username':{'type':Sequelize[_0xc5fd('0x2')],'unique':_0xc5fd('0x3')},'apiKey':{'type':Sequelize[_0xc5fd('0x2')]},'remoteUri':{'type':Sequelize[_0xc5fd('0x2')],'unique':_0xc5fd('0x4')},'serverUrl':{'type':Sequelize[_0xc5fd('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x1967=['STRING','username','remoteUri','exports'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0x1967,0x173));var _0x7196=function(_0x44a6cf,_0x26bea6){_0x44a6cf=_0x44a6cf-0x0;var _0x1c9b87=_0x1967[_0x44a6cf];return _0x1c9b87;};'use strict';var Sequelize=require('sequelize');module[_0x7196('0x0')]={'name':{'type':Sequelize[_0x7196('0x1')]},'description':{'type':Sequelize[_0x7196('0x1')]},'username':{'type':Sequelize[_0x7196('0x1')],'unique':_0x7196('0x2')},'apiKey':{'type':Sequelize[_0x7196('0x1')]},'remoteUri':{'type':Sequelize[_0x7196('0x1')],'unique':_0x7196('0x3')},'serverUrl':{'type':Sequelize[_0x7196('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 65c509d..7b2bc68 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 _0xe3ed=['lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','toString','base64','requester','subject','agent','description','priority','group','source','company','remove','includes','default','custom_dropdown','choices','capitalize','test','getFields','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','set','apply','reject','save','update','then','destroy','end','error','name','index','FreshdeskAccount','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','options','count','includeAll','findAll','rows','catch','params','rawAttributes','include','create','body','find','getConfigurations','findOne','FreshdeskConfiguration','addConfiguration','Subjects','getSubjects','getDescriptions','FreshdeskField','remoteUri','apiKey','slice','substring'];(function(_0x29d68b,_0x21a0fb){var _0x4fea2e=function(_0x10df34){while(--_0x10df34){_0x29d68b['push'](_0x29d68b['shift']());}};_0x4fea2e(++_0x21a0fb);}(_0xe3ed,0x8d));var _0xde3e=function(_0x47d818,_0x1e2ba2){_0x47d818=_0x47d818-0x0;var _0x86b94f=_0xe3ed[_0x47d818];return _0x86b94f;};'use strict';var emlformat=require(_0xde3e('0x0'));var rimraf=require(_0xde3e('0x1'));var zipdir=require(_0xde3e('0x2'));var jsonpatch=require(_0xde3e('0x3'));var rp=require(_0xde3e('0x4'));var moment=require(_0xde3e('0x5'));var BPromise=require(_0xde3e('0x6'));var Mustache=require(_0xde3e('0x7'));var util=require('util');var path=require(_0xde3e('0x8'));var sox=require(_0xde3e('0x9'));var csv=require('to-csv');var ejs=require(_0xde3e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xde3e('0xb'));var squel=require(_0xde3e('0xc'));var crypto=require('crypto');var jsforce=require(_0xde3e('0xd'));var deskjs=require(_0xde3e('0xe'));var toCsv=require(_0xde3e('0xf'));var querystring=require(_0xde3e('0x10'));var Papa=require(_0xde3e('0x11'));var Redis=require('ioredis');var authService=require(_0xde3e('0x12'));var qs=require(_0xde3e('0x13'));var as=require(_0xde3e('0x14'));var hardwareService=require(_0xde3e('0x15'));var logger=require('../../config/logger')(_0xde3e('0x16'));var utils=require(_0xde3e('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xde3e('0x18'));var db=require(_0xde3e('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x22ffc2,_0x4e0f23){_0x4e0f23=_0x4e0f23||0xcc;return function(_0x2cdf9c){if(_0x2cdf9c){return _0x22ffc2[_0xde3e('0x1a')](_0x4e0f23);}return _0x22ffc2[_0xde3e('0x1b')](_0x4e0f23)['end']();};}function respondWithResult(_0x167fa7,_0x1fee7b){_0x1fee7b=_0x1fee7b||0xc8;return function(_0x5ddb5a){if(_0x5ddb5a){return _0x167fa7['status'](_0x1fee7b)[_0xde3e('0x1c')](_0x5ddb5a);}};}function respondWithFilteredResult(_0x11db96,_0x6543f7){return function(_0x552fc4){if(_0x552fc4){var _0x5d4cd9=typeof _0x6543f7[_0xde3e('0x1d')]==='undefined'&&typeof _0x6543f7['limit']===_0xde3e('0x1e');var _0x1c8c82=_0x552fc4['count'];var _0x460d69=_0x5d4cd9?0x0:_0x6543f7[_0xde3e('0x1d')];var _0x264603=_0x5d4cd9?_0x552fc4['count']:_0x6543f7['offset']+_0x6543f7['limit'];var _0xf12c37;if(_0x264603>=_0x1c8c82){_0x264603=_0x1c8c82;_0xf12c37=0xc8;}else{_0xf12c37=0xce;}_0x11db96[_0xde3e('0x1b')](_0xf12c37);return _0x11db96[_0xde3e('0x1f')]('Content-Range',_0x460d69+'-'+_0x264603+'/'+_0x1c8c82)[_0xde3e('0x1c')](_0x552fc4);}return null;};}function patchUpdates(_0x11dd22){return function(_0x41808c){try{jsonpatch[_0xde3e('0x20')](_0x41808c,_0x11dd22,!![]);}catch(_0x2adb17){return BPromise[_0xde3e('0x21')](_0x2adb17);}return _0x41808c[_0xde3e('0x22')]();};}function saveUpdates(_0x1eda88,_0x443e8d){return function(_0x5a1c6c){if(_0x5a1c6c){return _0x5a1c6c[_0xde3e('0x23')](_0x1eda88)[_0xde3e('0x24')](function(_0x37615f){return _0x37615f;});}return null;};}function removeEntity(_0x57df9e,_0x361511){return function(_0x179189){if(_0x179189){return _0x179189[_0xde3e('0x25')]()['then'](function(){_0x57df9e[_0xde3e('0x1b')](0xcc)[_0xde3e('0x26')]();});}};}function handleEntityNotFound(_0x1d9432,_0xd795ac){return function(_0x19a8be){if(!_0x19a8be){_0x1d9432['sendStatus'](0x194);}return _0x19a8be;};}function handleError(_0x5313cb,_0x6c0db0){_0x6c0db0=_0x6c0db0||0x1f4;return function(_0x27ee92){logger[_0xde3e('0x27')](_0x27ee92['stack']);if(_0x27ee92[_0xde3e('0x28')]){delete _0x27ee92[_0xde3e('0x28')];}_0x5313cb['status'](_0x6c0db0)['send'](_0x27ee92);};}exports[_0xde3e('0x29')]=function(_0x3c83c8,_0x582c8d){var _0x2e4c62={},_0x5b5433={},_0x46db9d={'count':0x0,'rows':[]};var _0x5d4742=_['map'](db[_0xde3e('0x2a')]['rawAttributes'],function(_0x49c77a){return{'name':_0x49c77a[_0xde3e('0x2b')],'type':_0x49c77a[_0xde3e('0x2c')][_0xde3e('0x2d')]};});_0x5b5433[_0xde3e('0x2e')]=_[_0xde3e('0x2f')](_0x5d4742,_0xde3e('0x28'));_0x5b5433[_0xde3e('0x30')]=_[_0xde3e('0x31')](_0x3c83c8[_0xde3e('0x30')]);_0x5b5433[_0xde3e('0x32')]=_[_0xde3e('0x33')](_0x5b5433[_0xde3e('0x2e')],_0x5b5433[_0xde3e('0x30')]);_0x2e4c62[_0xde3e('0x34')]=_[_0xde3e('0x33')](_0x5b5433[_0xde3e('0x2e')],qs[_0xde3e('0x35')](_0x3c83c8['query'][_0xde3e('0x35')]));_0x2e4c62[_0xde3e('0x34')]=_0x2e4c62[_0xde3e('0x34')][_0xde3e('0x36')]?_0x2e4c62[_0xde3e('0x34')]:_0x5b5433[_0xde3e('0x2e')];if(!_0x3c83c8[_0xde3e('0x30')][_0xde3e('0x37')]('nolimit')){_0x2e4c62['limit']=qs[_0xde3e('0x38')](_0x3c83c8['query']['limit']);_0x2e4c62[_0xde3e('0x1d')]=qs[_0xde3e('0x1d')](_0x3c83c8[_0xde3e('0x30')][_0xde3e('0x1d')]);}_0x2e4c62[_0xde3e('0x39')]=qs[_0xde3e('0x3a')](_0x3c83c8['query']['sort']);_0x2e4c62[_0xde3e('0x3b')]=qs[_0xde3e('0x32')](_[_0xde3e('0x3c')](_0x3c83c8[_0xde3e('0x30')],_0x5b5433[_0xde3e('0x32')]),_0x5d4742);if(_0x3c83c8[_0xde3e('0x30')]['filter']){_0x2e4c62[_0xde3e('0x3b')]=_['merge'](_0x2e4c62[_0xde3e('0x3b')],{'$or':_[_0xde3e('0x2f')](_0x5d4742,function(_0x213564){if(_0x213564[_0xde3e('0x2c')]!=='VIRTUAL'){var _0x41a3c8={};_0x41a3c8[_0x213564[_0xde3e('0x28')]]={'$like':'%'+_0x3c83c8['query'][_0xde3e('0x3d')]+'%'};return _0x41a3c8;}})});}_0x2e4c62=_[_0xde3e('0x3e')]({},_0x2e4c62,_0x3c83c8[_0xde3e('0x3f')]);var _0x3afad0={'where':_0x2e4c62[_0xde3e('0x3b')]};return db[_0xde3e('0x2a')][_0xde3e('0x40')](_0x3afad0)[_0xde3e('0x24')](function(_0x83aca8){_0x46db9d[_0xde3e('0x40')]=_0x83aca8;if(_0x3c83c8['query'][_0xde3e('0x41')]){_0x2e4c62['include']=[{'all':!![]}];}return db[_0xde3e('0x2a')][_0xde3e('0x42')](_0x2e4c62);})[_0xde3e('0x24')](function(_0x41785d){_0x46db9d[_0xde3e('0x43')]=_0x41785d;return _0x46db9d;})[_0xde3e('0x24')](respondWithFilteredResult(_0x582c8d,_0x2e4c62))[_0xde3e('0x44')](handleError(_0x582c8d,null));};exports['show']=function(_0x23dc36,_0x1ae831){var _0x2d2ab7={'raw':![],'where':{'id':_0x23dc36[_0xde3e('0x45')]['id']}},_0x568217={};_0x568217[_0xde3e('0x2e')]=_[_0xde3e('0x31')](db['FreshdeskAccount'][_0xde3e('0x46')]);_0x568217[_0xde3e('0x30')]=_[_0xde3e('0x31')](_0x23dc36[_0xde3e('0x30')]);_0x568217['filters']=_[_0xde3e('0x33')](_0x568217[_0xde3e('0x2e')],_0x568217['query']);_0x2d2ab7[_0xde3e('0x34')]=_[_0xde3e('0x33')](_0x568217[_0xde3e('0x2e')],qs['fields'](_0x23dc36[_0xde3e('0x30')]['fields']));_0x2d2ab7['attributes']=_0x2d2ab7['attributes']['length']?_0x2d2ab7[_0xde3e('0x34')]:_0x568217[_0xde3e('0x2e')];if(_0x23dc36[_0xde3e('0x30')]['includeAll']){_0x2d2ab7[_0xde3e('0x47')]=[{'all':!![]}];}_0x2d2ab7=_['merge']({},_0x2d2ab7,_0x23dc36[_0xde3e('0x3f')]);return db['FreshdeskAccount']['find'](_0x2d2ab7)[_0xde3e('0x24')](handleEntityNotFound(_0x1ae831,null))['then'](respondWithResult(_0x1ae831,null))['catch'](handleError(_0x1ae831,null));};exports[_0xde3e('0x48')]=function(_0xbe6f36,_0x634a7a){return db[_0xde3e('0x2a')][_0xde3e('0x48')](_0xbe6f36[_0xde3e('0x49')],{})['then'](respondWithResult(_0x634a7a,0xc9))['catch'](handleError(_0x634a7a,null));};exports[_0xde3e('0x23')]=function(_0x66449d,_0x2f2001){if(_0x66449d['body']['id']){delete _0x66449d[_0xde3e('0x49')]['id'];}return db[_0xde3e('0x2a')]['find']({'where':{'id':_0x66449d[_0xde3e('0x45')]['id']}})[_0xde3e('0x24')](handleEntityNotFound(_0x2f2001,null))[_0xde3e('0x24')](saveUpdates(_0x66449d['body'],null))[_0xde3e('0x24')](respondWithResult(_0x2f2001,null))[_0xde3e('0x44')](handleError(_0x2f2001,null));};exports[_0xde3e('0x25')]=function(_0x652b39,_0x341f73){return db[_0xde3e('0x2a')][_0xde3e('0x4a')]({'where':{'id':_0x652b39[_0xde3e('0x45')]['id']}})['then'](handleEntityNotFound(_0x341f73,null))[_0xde3e('0x24')](removeEntity(_0x341f73,null))['catch'](handleError(_0x341f73,null));};exports[_0xde3e('0x4b')]=function(_0x450343,_0x3cbf58,_0x2e1fd7){var _0x2a9054={};var _0x2e4b24={};var _0x4b25c6;var _0x3118fd;return db['FreshdeskAccount'][_0xde3e('0x4c')]({'where':{'id':_0x450343[_0xde3e('0x45')]['id']}})[_0xde3e('0x24')](handleEntityNotFound(_0x3cbf58,null))['then'](function(_0x556025){if(_0x556025){_0x4b25c6=_0x556025;_0x2e4b24[_0xde3e('0x2e')]=_[_0xde3e('0x31')](db[_0xde3e('0x4d')][_0xde3e('0x46')]);_0x2e4b24[_0xde3e('0x30')]=_[_0xde3e('0x31')](_0x450343[_0xde3e('0x30')]);_0x2e4b24[_0xde3e('0x32')]=_[_0xde3e('0x33')](_0x2e4b24[_0xde3e('0x2e')],_0x2e4b24[_0xde3e('0x30')]);_0x2a9054['attributes']=_[_0xde3e('0x33')](_0x2e4b24['model'],qs[_0xde3e('0x35')](_0x450343[_0xde3e('0x30')][_0xde3e('0x35')]));_0x2a9054[_0xde3e('0x34')]=_0x2a9054['attributes'][_0xde3e('0x36')]?_0x2a9054[_0xde3e('0x34')]:_0x2e4b24[_0xde3e('0x2e')];_0x2a9054[_0xde3e('0x39')]=qs[_0xde3e('0x3a')](_0x450343[_0xde3e('0x30')][_0xde3e('0x3a')]);_0x2a9054[_0xde3e('0x3b')]=qs[_0xde3e('0x32')](_[_0xde3e('0x3c')](_0x450343[_0xde3e('0x30')],_0x2e4b24[_0xde3e('0x32')]));if(_0x450343[_0xde3e('0x30')]['filter']){_0x2a9054[_0xde3e('0x3b')]=_[_0xde3e('0x3e')](_0x2a9054[_0xde3e('0x3b')],{'$or':_[_0xde3e('0x2f')](_0x2a9054[_0xde3e('0x34')],function(_0x22def6){var _0x2dd312={};_0x2dd312[_0x22def6]={'$like':'%'+_0x450343[_0xde3e('0x30')]['filter']+'%'};return _0x2dd312;})});}_0x2a9054=_[_0xde3e('0x3e')]({},_0x2a9054,_0x450343[_0xde3e('0x3f')]);return _0x4b25c6[_0xde3e('0x4b')](_0x2a9054);}})[_0xde3e('0x24')](function(_0x1d6ba2){if(_0x1d6ba2){_0x3118fd=_0x1d6ba2[_0xde3e('0x36')];if(!_0x450343[_0xde3e('0x30')]['hasOwnProperty']('nolimit')){_0x2a9054['limit']=qs[_0xde3e('0x38')](_0x450343[_0xde3e('0x30')][_0xde3e('0x38')]);_0x2a9054[_0xde3e('0x1d')]=qs[_0xde3e('0x1d')](_0x450343[_0xde3e('0x30')][_0xde3e('0x1d')]);}return _0x4b25c6[_0xde3e('0x4b')](_0x2a9054);}})[_0xde3e('0x24')](function(_0x1f52e7){if(_0x1f52e7){return _0x1f52e7?{'count':_0x3118fd,'rows':_0x1f52e7}:null;}})['then'](respondWithResult(_0x3cbf58,null))[_0xde3e('0x44')](handleError(_0x3cbf58,null));};exports[_0xde3e('0x4e')]=function(_0x4c1e6c,_0x4a154f,_0x169051){if(_0x4c1e6c[_0xde3e('0x49')]['id']){delete _0x4c1e6c[_0xde3e('0x49')]['id'];}return db[_0xde3e('0x2a')][_0xde3e('0x4c')]({'where':{'id':_0x4c1e6c[_0xde3e('0x45')]['id']}})[_0xde3e('0x24')](handleEntityNotFound(_0x4a154f,null))[_0xde3e('0x24')](function(_0x44844c){if(_0x44844c){_0x4c1e6c[_0xde3e('0x49')]['AccountId']=_0x44844c['id'];_0x4c1e6c[_0xde3e('0x49')][_0xde3e('0x4f')]=integrations[_0xde3e('0x50')](_0x4c1e6c['body']['channel'],_0x4c1e6c[_0xde3e('0x49')]['type']);_0x4c1e6c[_0xde3e('0x49')]['Descriptions']=integrations[_0xde3e('0x51')](_0x4c1e6c[_0xde3e('0x49')]['channel'],_0x4c1e6c['body'][_0xde3e('0x2c')]);return db['FreshdeskConfiguration'][_0xde3e('0x48')](_0x4c1e6c[_0xde3e('0x49')],{'include':[{'model':db[_0xde3e('0x52')],'as':'Subjects'},{'model':db['FreshdeskField'],'as':'Descriptions'}]});}return null;})[_0xde3e('0x24')](respondWithResult(_0x4a154f,null))[_0xde3e('0x44')](handleError(_0x4a154f,null));};exports['getFields']=function(_0x35395a,_0x54ab58,_0x4907e9){var _0x3a7775='';return db[_0xde3e('0x2a')][_0xde3e('0x4c')]({'where':{'id':_0x35395a['params']['id']},'attributes':['id',_0xde3e('0x53'),_0xde3e('0x54')]})['then'](handleEntityNotFound(_0x54ab58,null))[_0xde3e('0x24')](function(_0x1a5e3e){if(_0x1a5e3e){_0x3a7775=_0x1a5e3e[_0xde3e('0x53')];var _0x4b9dec=_0x3a7775[_0xde3e('0x55')](-0x1);if(_0x4b9dec==='/'){_0x3a7775=_0x3a7775[_0xde3e('0x56')](0x0,_0x3a7775[_0xde3e('0x57')](_0x4b9dec));}return rp({'method':_0xde3e('0x58'),'uri':util[_0xde3e('0x59')](_0xde3e('0x5a'),_0x3a7775,_0xde3e('0x5b')),'headers':{'Authorization':util[_0xde3e('0x59')](_0xde3e('0x5c'),new Buffer(util['format']('%s:X',_0x1a5e3e[_0xde3e('0x54')]))[_0xde3e('0x5d')](_0xde3e('0x5e')))},'json':!![]});}})[_0xde3e('0x24')](function(_0x5bc57a){if(_0x5bc57a){var _0x2867a5=[_0xde3e('0x5f'),_0xde3e('0x60'),_0xde3e('0x61'),_0xde3e('0x62'),_0xde3e('0x1b'),_0xde3e('0x63'),_0xde3e('0x64'),_0xde3e('0x65'),'ticket_type',_0xde3e('0x64'),_0xde3e('0x66')];_[_0xde3e('0x67')](_0x5bc57a,function(_0x230c48){return _0x2867a5[_0xde3e('0x68')](_0x230c48[_0xde3e('0x28')])||!_0x230c48[_0xde3e('0x69')]&&_0x230c48['type']!=='custom_text'&&_0x230c48[_0xde3e('0x2c')]!==_0xde3e('0x6a');});return{'count':_0x5bc57a['length'],'rows':_['map'](_0x5bc57a,function(_0x26f746){return{'id':_0x26f746[_0xde3e('0x28')],'name':_0x26f746['label'],'custom':!_0x26f746[_0xde3e('0x69')],'options':_0x26f746[_0xde3e('0x6b')]?_[_0xde3e('0x2f')](_0x26f746[_0xde3e('0x6b')],function(_0x5b0bfe){return{'name':_[_0xde3e('0x6c')](_0x5b0bfe),'value':_0x5b0bfe};}):[]};})};}})[_0xde3e('0x24')](respondWithResult(_0x54ab58,null))['catch'](function(_0x1d4d9d){var _0x5ce470=_0x35395a[_0xde3e('0x30')][_0xde3e('0x6d')]?0x1f4:_0x1d4d9d['statusCode']||0x1f4;logger[_0xde3e('0x27')]('getFields,\x20%s,\x20%s,\x20%s',_0xde3e('0x6e'),_0x5ce470,JSON[_0xde3e('0x6f')](_0x1d4d9d));delete _0x1d4d9d[_0xde3e('0x28')];if(_0x5ce470===0x191){_0x5ce470=0x190;}_0x54ab58[_0xde3e('0x1b')](_0x5ce470)['send'](_0x35395a['query']['test']?{'message':_0xde3e('0x70'),'statusCode':_0x1d4d9d[_0xde3e('0x71')]}:_0x1d4d9d);});}; \ No newline at end of file +var _0xe890=['save','update','destroy','then','end','sendStatus','error','stack','name','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','FreshdeskConfiguration','getFields','remoteUri','apiKey','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','description','group','source','ticket_type','company','remove','includes','default','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x59a81e,_0x283bd8){var _0x460a18=function(_0xeb47a5){while(--_0xeb47a5){_0x59a81e['push'](_0x59a81e['shift']());}};_0x460a18(++_0x283bd8);}(_0xe890,0x1a6));var _0x0e89=function(_0x320fb6,_0x5a5bb5){_0x320fb6=_0x320fb6-0x0;var _0x29cefe=_0xe890[_0x320fb6];return _0x29cefe;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0e89('0x0'));var jsonpatch=require(_0x0e89('0x1'));var rp=require(_0x0e89('0x2'));var moment=require(_0x0e89('0x3'));var BPromise=require(_0x0e89('0x4'));var Mustache=require(_0x0e89('0x5'));var util=require(_0x0e89('0x6'));var path=require(_0x0e89('0x7'));var sox=require(_0x0e89('0x8'));var csv=require(_0x0e89('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0e89('0xa'));var squel=require(_0x0e89('0xb'));var crypto=require('crypto');var jsforce=require(_0x0e89('0xc'));var deskjs=require(_0x0e89('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0e89('0xe'));var Papa=require(_0x0e89('0xf'));var Redis=require(_0x0e89('0x10'));var authService=require(_0x0e89('0x11'));var qs=require(_0x0e89('0x12'));var as=require(_0x0e89('0x13'));var hardwareService=require(_0x0e89('0x14'));var logger=require(_0x0e89('0x15'))(_0x0e89('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x0e89('0x17'));function respondWithStatusCode(_0x43bf31,_0x3447cb){_0x3447cb=_0x3447cb||0xcc;return function(_0x4330a3){if(_0x4330a3){return _0x43bf31['sendStatus'](_0x3447cb);}return _0x43bf31['status'](_0x3447cb)['end']();};}function respondWithResult(_0x15cd84,_0x28b23c){_0x28b23c=_0x28b23c||0xc8;return function(_0x45cd03){if(_0x45cd03){return _0x15cd84[_0x0e89('0x18')](_0x28b23c)[_0x0e89('0x19')](_0x45cd03);}};}function respondWithFilteredResult(_0x211cad,_0x167c7b){return function(_0x45e31f){if(_0x45e31f){var _0x295be8=typeof _0x167c7b[_0x0e89('0x1a')]===_0x0e89('0x1b')&&typeof _0x167c7b[_0x0e89('0x1c')]===_0x0e89('0x1b');var _0x4493a3=_0x45e31f[_0x0e89('0x1d')];var _0x9cf6c4=_0x295be8?0x0:_0x167c7b[_0x0e89('0x1a')];var _0x40eb1d=_0x295be8?_0x45e31f[_0x0e89('0x1d')]:_0x167c7b[_0x0e89('0x1a')]+_0x167c7b[_0x0e89('0x1c')];var _0x56c12a;if(_0x40eb1d>=_0x4493a3){_0x40eb1d=_0x4493a3;_0x56c12a=0xc8;}else{_0x56c12a=0xce;}_0x211cad[_0x0e89('0x18')](_0x56c12a);return _0x211cad[_0x0e89('0x1e')](_0x0e89('0x1f'),_0x9cf6c4+'-'+_0x40eb1d+'/'+_0x4493a3)[_0x0e89('0x19')](_0x45e31f);}return null;};}function patchUpdates(_0x361291){return function(_0x35ac2a){try{jsonpatch[_0x0e89('0x20')](_0x35ac2a,_0x361291,!![]);}catch(_0x200469){return BPromise[_0x0e89('0x21')](_0x200469);}return _0x35ac2a[_0x0e89('0x22')]();};}function saveUpdates(_0x2c641d,_0x18dd88){return function(_0x4768d6){if(_0x4768d6){return _0x4768d6[_0x0e89('0x23')](_0x2c641d)['then'](function(_0x5e5463){return _0x5e5463;});}return null;};}function removeEntity(_0x59fffe,_0x1ad62c){return function(_0x8d02e2){if(_0x8d02e2){return _0x8d02e2[_0x0e89('0x24')]()[_0x0e89('0x25')](function(){_0x59fffe['status'](0xcc)[_0x0e89('0x26')]();});}};}function handleEntityNotFound(_0x2d6e9b,_0x3cf50c){return function(_0x4b6f00){if(!_0x4b6f00){_0x2d6e9b[_0x0e89('0x27')](0x194);}return _0x4b6f00;};}function handleError(_0x589ed1,_0x2a378a){_0x2a378a=_0x2a378a||0x1f4;return function(_0x30c0f4){logger[_0x0e89('0x28')](_0x30c0f4[_0x0e89('0x29')]);if(_0x30c0f4[_0x0e89('0x2a')]){delete _0x30c0f4[_0x0e89('0x2a')];}_0x589ed1[_0x0e89('0x18')](_0x2a378a)['send'](_0x30c0f4);};}exports[_0x0e89('0x2b')]=function(_0x14b857,_0xf1ebac){var _0x18cfb5={},_0x174ed9={},_0x7584db={'count':0x0,'rows':[]};var _0x502452=_[_0x0e89('0x2c')](db[_0x0e89('0x2d')][_0x0e89('0x2e')],function(_0x521587){return{'name':_0x521587[_0x0e89('0x2f')],'type':_0x521587[_0x0e89('0x30')][_0x0e89('0x31')]};});_0x174ed9[_0x0e89('0x32')]=_['map'](_0x502452,_0x0e89('0x2a'));_0x174ed9[_0x0e89('0x33')]=_[_0x0e89('0x34')](_0x14b857[_0x0e89('0x33')]);_0x174ed9['filters']=_[_0x0e89('0x35')](_0x174ed9[_0x0e89('0x32')],_0x174ed9[_0x0e89('0x33')]);_0x18cfb5[_0x0e89('0x36')]=_[_0x0e89('0x35')](_0x174ed9[_0x0e89('0x32')],qs[_0x0e89('0x37')](_0x14b857['query'][_0x0e89('0x37')]));_0x18cfb5[_0x0e89('0x36')]=_0x18cfb5[_0x0e89('0x36')][_0x0e89('0x38')]?_0x18cfb5[_0x0e89('0x36')]:_0x174ed9['model'];if(!_0x14b857[_0x0e89('0x33')][_0x0e89('0x39')](_0x0e89('0x3a'))){_0x18cfb5[_0x0e89('0x1c')]=qs[_0x0e89('0x1c')](_0x14b857['query'][_0x0e89('0x1c')]);_0x18cfb5[_0x0e89('0x1a')]=qs[_0x0e89('0x1a')](_0x14b857[_0x0e89('0x33')][_0x0e89('0x1a')]);}_0x18cfb5[_0x0e89('0x3b')]=qs[_0x0e89('0x3c')](_0x14b857[_0x0e89('0x33')]['sort']);_0x18cfb5['where']=qs['filters'](_[_0x0e89('0x3d')](_0x14b857[_0x0e89('0x33')],_0x174ed9[_0x0e89('0x3e')]),_0x502452);if(_0x14b857['query'][_0x0e89('0x3f')]){_0x18cfb5[_0x0e89('0x40')]=_[_0x0e89('0x41')](_0x18cfb5[_0x0e89('0x40')],{'$or':_[_0x0e89('0x2c')](_0x502452,function(_0x5984e2){if(_0x5984e2['type']!==_0x0e89('0x42')){var _0x280291={};_0x280291[_0x5984e2[_0x0e89('0x2a')]]={'$like':'%'+_0x14b857[_0x0e89('0x33')][_0x0e89('0x3f')]+'%'};return _0x280291;}})});}_0x18cfb5=_[_0x0e89('0x41')]({},_0x18cfb5,_0x14b857[_0x0e89('0x43')]);var _0x38692f={'where':_0x18cfb5[_0x0e89('0x40')]};return db[_0x0e89('0x2d')][_0x0e89('0x1d')](_0x38692f)[_0x0e89('0x25')](function(_0x1ed0f0){_0x7584db[_0x0e89('0x1d')]=_0x1ed0f0;if(_0x14b857[_0x0e89('0x33')][_0x0e89('0x44')]){_0x18cfb5[_0x0e89('0x45')]=[{'all':!![]}];}return db[_0x0e89('0x2d')][_0x0e89('0x46')](_0x18cfb5);})[_0x0e89('0x25')](function(_0x1f477a){_0x7584db[_0x0e89('0x47')]=_0x1f477a;return _0x7584db;})[_0x0e89('0x25')](respondWithFilteredResult(_0xf1ebac,_0x18cfb5))[_0x0e89('0x48')](handleError(_0xf1ebac,null));};exports[_0x0e89('0x49')]=function(_0x4cbd0a,_0x205898){var _0x399a2e={'raw':![],'where':{'id':_0x4cbd0a[_0x0e89('0x4a')]['id']}},_0x1d38b2={};_0x1d38b2[_0x0e89('0x32')]=_[_0x0e89('0x34')](db[_0x0e89('0x2d')][_0x0e89('0x2e')]);_0x1d38b2[_0x0e89('0x33')]=_[_0x0e89('0x34')](_0x4cbd0a[_0x0e89('0x33')]);_0x1d38b2[_0x0e89('0x3e')]=_[_0x0e89('0x35')](_0x1d38b2[_0x0e89('0x32')],_0x1d38b2[_0x0e89('0x33')]);_0x399a2e[_0x0e89('0x36')]=_[_0x0e89('0x35')](_0x1d38b2[_0x0e89('0x32')],qs[_0x0e89('0x37')](_0x4cbd0a[_0x0e89('0x33')][_0x0e89('0x37')]));_0x399a2e[_0x0e89('0x36')]=_0x399a2e[_0x0e89('0x36')][_0x0e89('0x38')]?_0x399a2e['attributes']:_0x1d38b2[_0x0e89('0x32')];if(_0x4cbd0a[_0x0e89('0x33')][_0x0e89('0x44')]){_0x399a2e[_0x0e89('0x45')]=[{'all':!![]}];}_0x399a2e=_[_0x0e89('0x41')]({},_0x399a2e,_0x4cbd0a[_0x0e89('0x43')]);return db['FreshdeskAccount'][_0x0e89('0x4b')](_0x399a2e)['then'](handleEntityNotFound(_0x205898,null))['then'](respondWithResult(_0x205898,null))['catch'](handleError(_0x205898,null));};exports[_0x0e89('0x4c')]=function(_0x2f2971,_0x313db9){return db['FreshdeskAccount']['create'](_0x2f2971[_0x0e89('0x4d')],{})['then'](respondWithResult(_0x313db9,0xc9))[_0x0e89('0x48')](handleError(_0x313db9,null));};exports['update']=function(_0x249431,_0x5d0b35){if(_0x249431['body']['id']){delete _0x249431[_0x0e89('0x4d')]['id'];}return db[_0x0e89('0x2d')]['find']({'where':{'id':_0x249431[_0x0e89('0x4a')]['id']}})[_0x0e89('0x25')](handleEntityNotFound(_0x5d0b35,null))[_0x0e89('0x25')](saveUpdates(_0x249431[_0x0e89('0x4d')],null))[_0x0e89('0x25')](respondWithResult(_0x5d0b35,null))[_0x0e89('0x48')](handleError(_0x5d0b35,null));};exports[_0x0e89('0x24')]=function(_0x24249a,_0x124241){return db[_0x0e89('0x2d')][_0x0e89('0x4b')]({'where':{'id':_0x24249a[_0x0e89('0x4a')]['id']}})['then'](handleEntityNotFound(_0x124241,null))[_0x0e89('0x25')](removeEntity(_0x124241,null))[_0x0e89('0x48')](handleError(_0x124241,null));};exports[_0x0e89('0x4e')]=function(_0x2c4752,_0x507ce3,_0x4feba5){var _0x54457a={};var _0x24134c={};var _0xf7dbee;var _0x25a9d9;return db[_0x0e89('0x2d')]['findOne']({'where':{'id':_0x2c4752[_0x0e89('0x4a')]['id']}})['then'](handleEntityNotFound(_0x507ce3,null))[_0x0e89('0x25')](function(_0x2d31b2){if(_0x2d31b2){_0xf7dbee=_0x2d31b2;_0x24134c[_0x0e89('0x32')]=_[_0x0e89('0x34')](db['FreshdeskConfiguration'][_0x0e89('0x2e')]);_0x24134c[_0x0e89('0x33')]=_['keys'](_0x2c4752[_0x0e89('0x33')]);_0x24134c[_0x0e89('0x3e')]=_['intersection'](_0x24134c['model'],_0x24134c['query']);_0x54457a[_0x0e89('0x36')]=_[_0x0e89('0x35')](_0x24134c['model'],qs['fields'](_0x2c4752[_0x0e89('0x33')][_0x0e89('0x37')]));_0x54457a[_0x0e89('0x36')]=_0x54457a[_0x0e89('0x36')]['length']?_0x54457a[_0x0e89('0x36')]:_0x24134c[_0x0e89('0x32')];_0x54457a[_0x0e89('0x3b')]=qs[_0x0e89('0x3c')](_0x2c4752['query'][_0x0e89('0x3c')]);_0x54457a[_0x0e89('0x40')]=qs[_0x0e89('0x3e')](_['pick'](_0x2c4752[_0x0e89('0x33')],_0x24134c[_0x0e89('0x3e')]));if(_0x2c4752[_0x0e89('0x33')][_0x0e89('0x3f')]){_0x54457a['where']=_[_0x0e89('0x41')](_0x54457a[_0x0e89('0x40')],{'$or':_[_0x0e89('0x2c')](_0x54457a[_0x0e89('0x36')],function(_0x35c45f){var _0x31a8ff={};_0x31a8ff[_0x35c45f]={'$like':'%'+_0x2c4752[_0x0e89('0x33')]['filter']+'%'};return _0x31a8ff;})});}_0x54457a=_[_0x0e89('0x41')]({},_0x54457a,_0x2c4752[_0x0e89('0x43')]);return _0xf7dbee[_0x0e89('0x4e')](_0x54457a);}})[_0x0e89('0x25')](function(_0x2e1441){if(_0x2e1441){_0x25a9d9=_0x2e1441[_0x0e89('0x38')];if(!_0x2c4752[_0x0e89('0x33')][_0x0e89('0x39')](_0x0e89('0x3a'))){_0x54457a[_0x0e89('0x1c')]=qs[_0x0e89('0x1c')](_0x2c4752[_0x0e89('0x33')][_0x0e89('0x1c')]);_0x54457a['offset']=qs['offset'](_0x2c4752['query'][_0x0e89('0x1a')]);}return _0xf7dbee[_0x0e89('0x4e')](_0x54457a);}})[_0x0e89('0x25')](function(_0xf71b88){if(_0xf71b88){return _0xf71b88?{'count':_0x25a9d9,'rows':_0xf71b88}:null;}})['then'](respondWithResult(_0x507ce3,null))[_0x0e89('0x48')](handleError(_0x507ce3,null));};exports[_0x0e89('0x4f')]=function(_0x28f05b,_0x51c6a1,_0x31fb58){if(_0x28f05b[_0x0e89('0x4d')]['id']){delete _0x28f05b[_0x0e89('0x4d')]['id'];}return db[_0x0e89('0x2d')]['findOne']({'where':{'id':_0x28f05b[_0x0e89('0x4a')]['id']}})[_0x0e89('0x25')](handleEntityNotFound(_0x51c6a1,null))[_0x0e89('0x25')](function(_0x40dd6d){if(_0x40dd6d){_0x28f05b[_0x0e89('0x4d')][_0x0e89('0x50')]=_0x40dd6d['id'];_0x28f05b[_0x0e89('0x4d')][_0x0e89('0x51')]=integrations[_0x0e89('0x52')](_0x28f05b[_0x0e89('0x4d')]['channel'],_0x28f05b[_0x0e89('0x4d')][_0x0e89('0x30')]);_0x28f05b[_0x0e89('0x4d')][_0x0e89('0x53')]=integrations[_0x0e89('0x54')](_0x28f05b['body'][_0x0e89('0x55')],_0x28f05b[_0x0e89('0x4d')]['type']);return db[_0x0e89('0x56')][_0x0e89('0x4c')](_0x28f05b['body'],{'include':[{'model':db['FreshdeskField'],'as':'Subjects'},{'model':db['FreshdeskField'],'as':_0x0e89('0x53')}]});}return null;})[_0x0e89('0x25')](respondWithResult(_0x51c6a1,null))['catch'](handleError(_0x51c6a1,null));};exports[_0x0e89('0x57')]=function(_0x411c03,_0x16a12e,_0x58adfa){var _0x21abda='';return db[_0x0e89('0x2d')]['findOne']({'where':{'id':_0x411c03[_0x0e89('0x4a')]['id']},'attributes':['id',_0x0e89('0x58'),_0x0e89('0x59')]})[_0x0e89('0x25')](handleEntityNotFound(_0x16a12e,null))[_0x0e89('0x25')](function(_0x22a78f){if(_0x22a78f){_0x21abda=_0x22a78f[_0x0e89('0x58')];var _0x4dc7d3=_0x21abda['slice'](-0x1);if(_0x4dc7d3==='/'){_0x21abda=_0x21abda['substring'](0x0,_0x21abda['lastIndexOf'](_0x4dc7d3));}return rp({'method':'GET','uri':util[_0x0e89('0x5a')](_0x0e89('0x5b'),_0x21abda,_0x0e89('0x5c')),'headers':{'Authorization':util['format'](_0x0e89('0x5d'),new Buffer(util['format'](_0x0e89('0x5e'),_0x22a78f[_0x0e89('0x59')]))[_0x0e89('0x5f')](_0x0e89('0x60')))},'json':!![]});}})[_0x0e89('0x25')](function(_0x2fa558){if(_0x2fa558){var _0x152f8f=[_0x0e89('0x61'),_0x0e89('0x62'),_0x0e89('0x63'),_0x0e89('0x64'),_0x0e89('0x18'),'priority',_0x0e89('0x65'),_0x0e89('0x66'),_0x0e89('0x67'),_0x0e89('0x65'),_0x0e89('0x68')];_[_0x0e89('0x69')](_0x2fa558,function(_0x1b4ad6){return _0x152f8f[_0x0e89('0x6a')](_0x1b4ad6[_0x0e89('0x2a')])||!_0x1b4ad6[_0x0e89('0x6b')]&&_0x1b4ad6['type']!=='custom_text'&&_0x1b4ad6[_0x0e89('0x30')]!=='custom_dropdown';});return{'count':_0x2fa558[_0x0e89('0x38')],'rows':_[_0x0e89('0x2c')](_0x2fa558,function(_0x3adea7){return{'id':_0x3adea7[_0x0e89('0x2a')],'name':_0x3adea7['label'],'custom':!_0x3adea7[_0x0e89('0x6b')],'options':_0x3adea7[_0x0e89('0x6c')]?_[_0x0e89('0x2c')](_0x3adea7['choices'],function(_0xfaac03){return{'name':_[_0x0e89('0x6d')](_0xfaac03),'value':_0xfaac03};}):[]};})};}})[_0x0e89('0x25')](respondWithResult(_0x16a12e,null))[_0x0e89('0x48')](function(_0x2d42bc){var _0x3da749=_0x411c03[_0x0e89('0x33')][_0x0e89('0x6e')]?0x1f4:_0x2d42bc[_0x0e89('0x6f')]||0x1f4;logger['error'](_0x0e89('0x70'),_0x0e89('0x57'),_0x3da749,JSON[_0x0e89('0x71')](_0x2d42bc));delete _0x2d42bc[_0x0e89('0x2a')];if(_0x3da749===0x191){_0x3da749=0x190;}_0x16a12e[_0x0e89('0x18')](_0x3da749)['send'](_0x411c03[_0x0e89('0x33')][_0x0e89('0x6e')]?{'message':'Wrong\x20credentials','statusCode':_0x2d42bc['statusCode']}:_0x2d42bc);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 5b454de..2199778 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 _0xd449=['int_freshdesk_accounts','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x274638,_0x578968){var _0x5755df=function(_0x3227d5){while(--_0x3227d5){_0x274638['push'](_0x274638['shift']());}};_0x5755df(++_0x578968);}(_0xd449,0x175));var _0x9d44=function(_0x5e42a7,_0x3eba35){_0x5e42a7=_0x5e42a7-0x0;var _0x36d21b=_0xd449[_0x5e42a7];return _0x36d21b;};'use strict';var _=require('lodash');var util=require(_0x9d44('0x0'));var logger=require(_0x9d44('0x1'))(_0x9d44('0x2'));var moment=require(_0x9d44('0x3'));var BPromise=require('bluebird');var rp=require(_0x9d44('0x4'));var fs=require('fs');var path=require(_0x9d44('0x5'));var rimraf=require('rimraf');var config=require(_0x9d44('0x6'));var attributes=require(_0x9d44('0x7'));var integrations=require(_0x9d44('0x8'));module[_0x9d44('0x9')]=function(_0x4a2678,_0x23153d){return _0x4a2678[_0x9d44('0xa')]('FreshdeskAccount',attributes,{'tableName':_0x9d44('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x683b=['bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','define','FreshdeskAccount','int_freshdesk_accounts','api','moment'];(function(_0xd454b1,_0x2bdfbf){var _0x4b9a04=function(_0x1e578c){while(--_0x1e578c){_0xd454b1['push'](_0xd454b1['shift']());}};_0x4b9a04(++_0x2bdfbf);}(_0x683b,0x6c));var _0xb683=function(_0x1697ae,_0x3146cc){_0x1697ae=_0x1697ae-0x0;var _0x4bcb04=_0x683b[_0x1697ae];return _0x4bcb04;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xb683('0x0'));var moment=require(_0xb683('0x1'));var BPromise=require(_0xb683('0x2'));var rp=require(_0xb683('0x3'));var fs=require('fs');var path=require(_0xb683('0x4'));var rimraf=require(_0xb683('0x5'));var config=require(_0xb683('0x6'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0xb683('0x7'));module['exports']=function(_0x3ba2d6,_0x55b521){return _0x3ba2d6[_0xb683('0x8')](_0xb683('0x9'),attributes,{'tableName':_0xb683('0xa'),'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 619b5ea..08ee0ef 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 _0x8098=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','FreshdeskAccount','options','raw','where','attributes','limit','include','map','model','GetFreshdeskAccount','ShowFreshdeskAccount','find'];(function(_0x399251,_0x3188da){var _0x41cc5c=function(_0x5819ec){while(--_0x5819ec){_0x399251['push'](_0x399251['shift']());}};_0x41cc5c(++_0x3188da);}(_0x8098,0x1ba));var _0x8809=function(_0x199c16,_0x577ee8){_0x199c16=_0x199c16-0x0;var _0x490c09=_0x8098[_0x199c16];return _0x490c09;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8809('0x0'));var BPromise=require(_0x8809('0x1'));var rs=require(_0x8809('0x2'));var fs=require('fs');var Redis=require(_0x8809('0x3'));var db=require(_0x8809('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8809('0x5'))(_0x8809('0x6'));var config=require(_0x8809('0x7'));var jayson=require(_0x8809('0x8'));var client=jayson['client'][_0x8809('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2af39c,_0x54880c,_0x3f4bee){return new BPromise(function(_0x3fd084,_0x181e8b){return client[_0x8809('0xa')](_0x2af39c,_0x3f4bee)[_0x8809('0xb')](function(_0x34f85f){logger[_0x8809('0xc')](_0x8809('0xd'),_0x54880c,_0x8809('0xe'));logger[_0x8809('0xf')](_0x8809('0x10'),_0x54880c,_0x8809('0xe'),JSON[_0x8809('0x11')](_0x34f85f));if(_0x34f85f[_0x8809('0x12')]){if(_0x34f85f[_0x8809('0x12')][_0x8809('0x13')]===0x1f4){logger['error'](_0x8809('0xd'),_0x54880c,_0x34f85f[_0x8809('0x12')]['message']);return _0x181e8b(_0x34f85f[_0x8809('0x12')][_0x8809('0x14')]);}logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x54880c,_0x34f85f[_0x8809('0x12')][_0x8809('0x14')]);return _0x3fd084(_0x34f85f[_0x8809('0x12')][_0x8809('0x14')]);}else{logger[_0x8809('0xc')](_0x8809('0xd'),_0x54880c,_0x8809('0xe'));_0x3fd084(_0x34f85f['result'][_0x8809('0x14')]);}})[_0x8809('0x15')](function(_0x494814){logger[_0x8809('0x12')](_0x8809('0xd'),_0x54880c,_0x494814);_0x181e8b(_0x494814);});});}exports['GetFreshdeskAccount']=function(_0x3b0562){var _0x8ec527=this;return new Promise(function(_0x7ec1a6,_0x17289e){return db[_0x8809('0x16')]['findAll']({'raw':_0x3b0562['options']?_0x3b0562[_0x8809('0x17')][_0x8809('0x18')]===undefined?!![]:![]:!![],'where':_0x3b0562[_0x8809('0x17')]?_0x3b0562[_0x8809('0x17')][_0x8809('0x19')]||null:null,'attributes':_0x3b0562[_0x8809('0x17')]?_0x3b0562[_0x8809('0x17')][_0x8809('0x1a')]||null:null,'limit':_0x3b0562[_0x8809('0x17')]?_0x3b0562[_0x8809('0x17')][_0x8809('0x1b')]||null:null,'include':_0x3b0562[_0x8809('0x17')]?_0x3b0562[_0x8809('0x17')]['include']?_['map'](_0x3b0562[_0x8809('0x17')][_0x8809('0x1c')],function(_0x521840){return{'model':db[_0x521840['model']],'as':_0x521840['as'],'attributes':_0x521840['attributes'],'include':_0x521840[_0x8809('0x1c')]?_[_0x8809('0x1d')](_0x521840[_0x8809('0x1c')],function(_0x2bbf26){return{'model':db[_0x2bbf26[_0x8809('0x1e')]],'as':_0x2bbf26['as'],'attributes':_0x2bbf26[_0x8809('0x1a')],'include':_0x2bbf26[_0x8809('0x1c')]?_[_0x8809('0x1d')](_0x2bbf26[_0x8809('0x1c')],function(_0x6e5dc8){return{'model':db[_0x6e5dc8[_0x8809('0x1e')]],'as':_0x6e5dc8['as'],'attributes':_0x6e5dc8[_0x8809('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5c7cbf){logger[_0x8809('0xc')](_0x8809('0x1f'),_0x3b0562);logger['debug'](_0x8809('0x1f'),_0x3b0562,JSON[_0x8809('0x11')](_0x5c7cbf));_0x7ec1a6(_0x5c7cbf);})[_0x8809('0x15')](function(_0x296187){logger[_0x8809('0x12')]('GetFreshdeskAccount',_0x296187[_0x8809('0x14')],_0x3b0562);_0x17289e(_0x8ec527['error'](0x1f4,_0x296187[_0x8809('0x14')]));});});};exports[_0x8809('0x20')]=function(_0x5f5d5d){var _0x2c505c=this;return new Promise(function(_0x4cd927,_0x1e3edf){return db[_0x8809('0x16')][_0x8809('0x21')]({'raw':_0x5f5d5d[_0x8809('0x17')]?_0x5f5d5d[_0x8809('0x17')][_0x8809('0x18')]===undefined?!![]:![]:!![],'where':_0x5f5d5d['options']?_0x5f5d5d['options'][_0x8809('0x19')]||null:null,'attributes':_0x5f5d5d[_0x8809('0x17')]?_0x5f5d5d[_0x8809('0x17')][_0x8809('0x1a')]||null:null,'include':_0x5f5d5d[_0x8809('0x17')]?_0x5f5d5d['options'][_0x8809('0x1c')]?_['map'](_0x5f5d5d['options'][_0x8809('0x1c')],function(_0x5efc32){return{'model':db[_0x5efc32[_0x8809('0x1e')]],'as':_0x5efc32['as'],'attributes':_0x5efc32['attributes'],'include':_0x5efc32[_0x8809('0x1c')]?_[_0x8809('0x1d')](_0x5efc32[_0x8809('0x1c')],function(_0x85ebcd){return{'model':db[_0x85ebcd[_0x8809('0x1e')]],'as':_0x85ebcd['as'],'attributes':_0x85ebcd[_0x8809('0x1a')],'include':_0x85ebcd['include']?_[_0x8809('0x1d')](_0x85ebcd[_0x8809('0x1c')],function(_0x5b7b13){return{'model':db[_0x5b7b13[_0x8809('0x1e')]],'as':_0x5b7b13['as'],'attributes':_0x5b7b13[_0x8809('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8809('0xb')](function(_0x2f584f){logger[_0x8809('0xc')](_0x8809('0x20'),_0x5f5d5d);logger['debug'](_0x8809('0x20'),_0x5f5d5d,JSON[_0x8809('0x11')](_0x2f584f));_0x4cd927(_0x2f584f);})[_0x8809('0x15')](function(_0x2af931){logger[_0x8809('0x12')](_0x8809('0x20'),_0x2af931[_0x8809('0x14')],_0x5f5d5d);_0x1e3edf(_0x2c505c[_0x8809('0x12')](0x1f4,_0x2af931['message']));});});}; \ No newline at end of file +var _0x6de9=['limit','include','map','model','find','ShowFreshdeskAccount','lodash','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes'];(function(_0x407797,_0x291ec6){var _0x619fd4=function(_0x347f48){while(--_0x347f48){_0x407797['push'](_0x407797['shift']());}};_0x619fd4(++_0x291ec6);}(_0x6de9,0x1cd));var _0x96de=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6de9[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x96de('0x0'));var util=require('util');var moment=require(_0x96de('0x1'));var BPromise=require('bluebird');var rs=require(_0x96de('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x96de('0x3'))['db'];var utils=require(_0x96de('0x4'));var logger=require('../../config/logger')(_0x96de('0x5'));var config=require(_0x96de('0x6'));var jayson=require(_0x96de('0x7'));var client=jayson[_0x96de('0x8')][_0x96de('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x9ccbcf,_0x58f816,_0x6b804d){return new BPromise(function(_0x30cab9,_0x3a01b5){return client[_0x96de('0xa')](_0x9ccbcf,_0x6b804d)[_0x96de('0xb')](function(_0x5ed01f){logger[_0x96de('0xc')](_0x96de('0xd'),_0x58f816,_0x96de('0xe'));logger[_0x96de('0xf')](_0x96de('0x10'),_0x58f816,_0x96de('0xe'),JSON[_0x96de('0x11')](_0x5ed01f));if(_0x5ed01f[_0x96de('0x12')]){if(_0x5ed01f['error'][_0x96de('0x13')]===0x1f4){logger['error'](_0x96de('0xd'),_0x58f816,_0x5ed01f['error'][_0x96de('0x14')]);return _0x3a01b5(_0x5ed01f['error']['message']);}logger[_0x96de('0x12')]('FreshdeskAccount,\x20%s,\x20%s',_0x58f816,_0x5ed01f[_0x96de('0x12')][_0x96de('0x14')]);return _0x30cab9(_0x5ed01f[_0x96de('0x12')]['message']);}else{logger[_0x96de('0xc')](_0x96de('0xd'),_0x58f816,_0x96de('0xe'));_0x30cab9(_0x5ed01f['result'][_0x96de('0x14')]);}})[_0x96de('0x15')](function(_0x59917b){logger[_0x96de('0x12')](_0x96de('0xd'),_0x58f816,_0x59917b);_0x3a01b5(_0x59917b);});});}exports[_0x96de('0x16')]=function(_0x2fa752){var _0x46cbdb=this;return new Promise(function(_0x58b22d,_0x3f3b3f){return db[_0x96de('0x17')][_0x96de('0x18')]({'raw':_0x2fa752[_0x96de('0x19')]?_0x2fa752[_0x96de('0x19')][_0x96de('0x1a')]===undefined?!![]:![]:!![],'where':_0x2fa752[_0x96de('0x19')]?_0x2fa752['options'][_0x96de('0x1b')]||null:null,'attributes':_0x2fa752[_0x96de('0x19')]?_0x2fa752[_0x96de('0x19')][_0x96de('0x1c')]||null:null,'limit':_0x2fa752[_0x96de('0x19')]?_0x2fa752[_0x96de('0x19')][_0x96de('0x1d')]||null:null,'include':_0x2fa752['options']?_0x2fa752[_0x96de('0x19')][_0x96de('0x1e')]?_[_0x96de('0x1f')](_0x2fa752[_0x96de('0x19')]['include'],function(_0x4c28cc){return{'model':db[_0x4c28cc[_0x96de('0x20')]],'as':_0x4c28cc['as'],'attributes':_0x4c28cc[_0x96de('0x1c')],'include':_0x4c28cc['include']?_['map'](_0x4c28cc[_0x96de('0x1e')],function(_0x59b818){return{'model':db[_0x59b818[_0x96de('0x20')]],'as':_0x59b818['as'],'attributes':_0x59b818[_0x96de('0x1c')],'include':_0x59b818[_0x96de('0x1e')]?_[_0x96de('0x1f')](_0x59b818[_0x96de('0x1e')],function(_0x552b91){return{'model':db[_0x552b91[_0x96de('0x20')]],'as':_0x552b91['as'],'attributes':_0x552b91['attributes']};}):[]};}):[]};}):[]:[]})[_0x96de('0xb')](function(_0x30033f){logger[_0x96de('0xc')](_0x96de('0x16'),_0x2fa752);logger[_0x96de('0xf')]('GetFreshdeskAccount',_0x2fa752,JSON[_0x96de('0x11')](_0x30033f));_0x58b22d(_0x30033f);})['catch'](function(_0x50652d){logger['error'](_0x96de('0x16'),_0x50652d[_0x96de('0x14')],_0x2fa752);_0x3f3b3f(_0x46cbdb[_0x96de('0x12')](0x1f4,_0x50652d[_0x96de('0x14')]));});});};exports['ShowFreshdeskAccount']=function(_0x4b3a01){var _0x2d9a67=this;return new Promise(function(_0x328109,_0x37fda2){return db[_0x96de('0x17')][_0x96de('0x21')]({'raw':_0x4b3a01['options']?_0x4b3a01[_0x96de('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4b3a01['options']?_0x4b3a01[_0x96de('0x19')]['where']||null:null,'attributes':_0x4b3a01[_0x96de('0x19')]?_0x4b3a01[_0x96de('0x19')][_0x96de('0x1c')]||null:null,'include':_0x4b3a01[_0x96de('0x19')]?_0x4b3a01['options'][_0x96de('0x1e')]?_[_0x96de('0x1f')](_0x4b3a01[_0x96de('0x19')][_0x96de('0x1e')],function(_0x242ec6){return{'model':db[_0x242ec6['model']],'as':_0x242ec6['as'],'attributes':_0x242ec6['attributes'],'include':_0x242ec6[_0x96de('0x1e')]?_[_0x96de('0x1f')](_0x242ec6[_0x96de('0x1e')],function(_0x5b1f8e){return{'model':db[_0x5b1f8e[_0x96de('0x20')]],'as':_0x5b1f8e['as'],'attributes':_0x5b1f8e[_0x96de('0x1c')],'include':_0x5b1f8e[_0x96de('0x1e')]?_[_0x96de('0x1f')](_0x5b1f8e[_0x96de('0x1e')],function(_0x1ada41){return{'model':db[_0x1ada41[_0x96de('0x20')]],'as':_0x1ada41['as'],'attributes':_0x1ada41['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x47d171){logger[_0x96de('0xc')](_0x96de('0x22'),_0x4b3a01);logger[_0x96de('0xf')](_0x96de('0x22'),_0x4b3a01,JSON[_0x96de('0x11')](_0x47d171));_0x328109(_0x47d171);})[_0x96de('0x15')](function(_0x2fa097){logger['error'](_0x96de('0x22'),_0x2fa097['message'],_0x4b3a01);_0x37fda2(_0x2d9a67[_0x96de('0x12')](0x1f4,_0x2fa097[_0x96de('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 49f661d..e55b753 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 _0x7598=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','/:id/descriptions','/:id/tags','getTags','post','setTags','update','delete','destroy','exports','util','path'];(function(_0x4cc03b,_0x299f1c){var _0xf0358c=function(_0x3d0da8){while(--_0x3d0da8){_0x4cc03b['push'](_0x4cc03b['shift']());}};_0xf0358c(++_0x299f1c);}(_0x7598,0x106));var _0x8759=function(_0x43eb88,_0x93d4e1){_0x43eb88=_0x43eb88-0x0;var _0x387881=_0x7598[_0x43eb88];return _0x387881;};'use strict';var multer=require('multer');var util=require(_0x8759('0x0'));var path=require(_0x8759('0x1'));var timeout=require('connect-timeout');var express=require(_0x8759('0x2'));var router=express[_0x8759('0x3')]();var fs_extra=require(_0x8759('0x4'));var auth=require(_0x8759('0x5'));var interaction=require(_0x8759('0x6'));var config=require(_0x8759('0x7'));var controller=require(_0x8759('0x8'));router[_0x8759('0x9')]('/',auth[_0x8759('0xa')](),controller[_0x8759('0xb')]);router[_0x8759('0x9')](_0x8759('0xc'),auth[_0x8759('0xa')](),controller[_0x8759('0xd')]);router[_0x8759('0x9')]('/:id/fields',auth[_0x8759('0xa')](),controller['getFields']);router[_0x8759('0x9')](_0x8759('0xe'),auth[_0x8759('0xa')](),controller['getSubjects']);router[_0x8759('0x9')](_0x8759('0xf'),auth[_0x8759('0xa')](),controller['getDescriptions']);router['get'](_0x8759('0x10'),auth[_0x8759('0xa')](),controller[_0x8759('0x11')]);router['post']('/',auth[_0x8759('0xa')](),controller['create']);router[_0x8759('0x12')]('/:id/tags',auth[_0x8759('0xa')](),controller[_0x8759('0x13')]);router['put'](_0x8759('0xc'),auth[_0x8759('0xa')](),controller[_0x8759('0x14')]);router[_0x8759('0x15')](_0x8759('0xc'),auth[_0x8759('0xa')](),controller[_0x8759('0x16')]);module[_0x8759('0x17')]=router; \ No newline at end of file +var _0x6374=['get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1c9b8a,_0x1e1776){var _0x35a99d=function(_0x3bb9ef){while(--_0x3bb9ef){_0x1c9b8a['push'](_0x1c9b8a['shift']());}};_0x35a99d(++_0x1e1776);}(_0x6374,0x126));var _0x4637=function(_0x195a13,_0x36cf06){_0x195a13=_0x195a13-0x0;var _0x3ffc97=_0x6374[_0x195a13];return _0x3ffc97;};'use strict';var multer=require(_0x4637('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4637('0x1'));var express=require(_0x4637('0x2'));var router=express[_0x4637('0x3')]();var fs_extra=require(_0x4637('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4637('0x5'));var config=require('../../config/environment');var controller=require('./intFreshdeskConfiguration.controller');router[_0x4637('0x6')]('/',auth[_0x4637('0x7')](),controller['index']);router['get'](_0x4637('0x8'),auth[_0x4637('0x7')](),controller[_0x4637('0x9')]);router[_0x4637('0x6')](_0x4637('0xa'),auth[_0x4637('0x7')](),controller[_0x4637('0xb')]);router[_0x4637('0x6')](_0x4637('0xc'),auth['isAuthenticated'](),controller[_0x4637('0xd')]);router[_0x4637('0x6')](_0x4637('0xe'),auth[_0x4637('0x7')](),controller[_0x4637('0xf')]);router[_0x4637('0x6')](_0x4637('0x10'),auth[_0x4637('0x7')](),controller[_0x4637('0x11')]);router[_0x4637('0x12')]('/',auth['isAuthenticated'](),controller[_0x4637('0x13')]);router[_0x4637('0x12')](_0x4637('0x10'),auth[_0x4637('0x7')](),controller[_0x4637('0x14')]);router['put'](_0x4637('0x8'),auth[_0x4637('0x7')](),controller[_0x4637('0x15')]);router[_0x4637('0x16')](_0x4637('0x8'),auth[_0x4637('0x7')](),controller[_0x4637('0x17')]);module[_0x4637('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 40a108c..6c79f85 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 _0x74bb=['sequelize','STRING'];(function(_0x350a64,_0x592f1d){var _0x445cc0=function(_0x15496f){while(--_0x15496f){_0x350a64['push'](_0x350a64['shift']());}};_0x445cc0(++_0x592f1d);}(_0x74bb,0xa2));var _0xb74b=function(_0x59e893,_0x3adcb9){_0x59e893=_0x59e893-0x0;var _0x56046e=_0x74bb[_0x59e893];return _0x56046e;};'use strict';var Sequelize=require(_0xb74b('0x0'));module['exports']={'name':{'type':Sequelize[_0xb74b('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb3d9=['exports','STRING','sequelize'];(function(_0x1c5ab8,_0x2a2525){var _0x553807=function(_0x34aa91){while(--_0x34aa91){_0x1c5ab8['push'](_0x1c5ab8['shift']());}};_0x553807(++_0x2a2525);}(_0xb3d9,0x1e8));var _0x9b3d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb3d9[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x9b3d('0x0'));module[_0x9b3d('0x1')]={'name':{'type':Sequelize[_0x9b3d('0x2')]},'description':{'type':Sequelize[_0x9b3d('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 75179fc..e37deaf 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 _0xaa31=['apply','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','FreshdeskConfiguration','include','findAll','rows','catch','keys','length','create','body','params','find','getFields','findOne','getSubjects','FreshdeskField','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range'];(function(_0x54f7c4,_0x458526){var _0x1ba6d4=function(_0xf7d362){while(--_0xf7d362){_0x54f7c4['push'](_0x54f7c4['shift']());}};_0x1ba6d4(++_0x458526);}(_0xaa31,0x128));var _0x1aa3=function(_0xef8146,_0x459c34){_0xef8146=_0xef8146-0x0;var _0x5a6cb0=_0xaa31[_0xef8146];return _0x5a6cb0;};'use strict';var emlformat=require(_0x1aa3('0x0'));var rimraf=require(_0x1aa3('0x1'));var zipdir=require(_0x1aa3('0x2'));var jsonpatch=require(_0x1aa3('0x3'));var rp=require('request-promise');var moment=require(_0x1aa3('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1aa3('0x5'));var path=require(_0x1aa3('0x6'));var sox=require(_0x1aa3('0x7'));var csv=require('to-csv');var ejs=require(_0x1aa3('0x8'));var fs=require('fs');var fs_extra=require(_0x1aa3('0x9'));var _=require(_0x1aa3('0xa'));var squel=require('squel');var crypto=require(_0x1aa3('0xb'));var jsforce=require(_0x1aa3('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1aa3('0xd'));var querystring=require(_0x1aa3('0xe'));var Papa=require(_0x1aa3('0xf'));var Redis=require(_0x1aa3('0x10'));var authService=require(_0x1aa3('0x11'));var qs=require(_0x1aa3('0x12'));var as=require(_0x1aa3('0x13'));var hardwareService=require(_0x1aa3('0x14'));var logger=require(_0x1aa3('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x1aa3('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x1aa3('0x17'))['db'];function respondWithStatusCode(_0x2874bf,_0x2dfd87){_0x2dfd87=_0x2dfd87||0xcc;return function(_0x5dda20){if(_0x5dda20){return _0x2874bf[_0x1aa3('0x18')](_0x2dfd87);}return _0x2874bf[_0x1aa3('0x19')](_0x2dfd87)['end']();};}function respondWithResult(_0x584a71,_0x453c36){_0x453c36=_0x453c36||0xc8;return function(_0x402812){if(_0x402812){return _0x584a71[_0x1aa3('0x19')](_0x453c36)[_0x1aa3('0x1a')](_0x402812);}};}function respondWithFilteredResult(_0x21bdba,_0x6dd2b0){return function(_0x2136ad){if(_0x2136ad){var _0xce1851=typeof _0x6dd2b0[_0x1aa3('0x1b')]===_0x1aa3('0x1c')&&typeof _0x6dd2b0[_0x1aa3('0x1d')]===_0x1aa3('0x1c');var _0x237275=_0x2136ad['count'];var _0x38e748=_0xce1851?0x0:_0x6dd2b0['offset'];var _0x5c686e=_0xce1851?_0x2136ad[_0x1aa3('0x1e')]:_0x6dd2b0[_0x1aa3('0x1b')]+_0x6dd2b0[_0x1aa3('0x1d')];var _0xedf2d2;if(_0x5c686e>=_0x237275){_0x5c686e=_0x237275;_0xedf2d2=0xc8;}else{_0xedf2d2=0xce;}_0x21bdba['status'](_0xedf2d2);return _0x21bdba['set'](_0x1aa3('0x1f'),_0x38e748+'-'+_0x5c686e+'/'+_0x237275)[_0x1aa3('0x1a')](_0x2136ad);}return null;};}function patchUpdates(_0x32b2c4){return function(_0x384b9d){try{jsonpatch[_0x1aa3('0x20')](_0x384b9d,_0x32b2c4,!![]);}catch(_0x586c48){return BPromise[_0x1aa3('0x21')](_0x586c48);}return _0x384b9d[_0x1aa3('0x22')]();};}function saveUpdates(_0x4da6a4,_0x19ac90){return function(_0x4604b4){if(_0x4604b4){return _0x4604b4[_0x1aa3('0x23')](_0x4da6a4)[_0x1aa3('0x24')](function(_0xe94851){return _0xe94851;});}return null;};}function removeEntity(_0x5223ed,_0x46a37d){return function(_0x42668f){if(_0x42668f){return _0x42668f[_0x1aa3('0x25')]()[_0x1aa3('0x24')](function(){_0x5223ed[_0x1aa3('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5719c0,_0x225ae7){return function(_0x59df20){if(!_0x59df20){_0x5719c0[_0x1aa3('0x18')](0x194);}return _0x59df20;};}function handleError(_0x1ee55e,_0x5f2fb6){_0x5f2fb6=_0x5f2fb6||0x1f4;return function(_0x1d9885){logger[_0x1aa3('0x26')](_0x1d9885[_0x1aa3('0x27')]);if(_0x1d9885[_0x1aa3('0x28')]){delete _0x1d9885['name'];}_0x1ee55e[_0x1aa3('0x19')](_0x5f2fb6)['send'](_0x1d9885);};}exports[_0x1aa3('0x29')]=function(_0x5b1738,_0x43342d){var _0x2cfe74={},_0x41bdcb={},_0x5270f3={'count':0x0,'rows':[]};var _0x11b7bd=_[_0x1aa3('0x2a')](db['FreshdeskConfiguration'][_0x1aa3('0x2b')],function(_0x5a440e){return{'name':_0x5a440e[_0x1aa3('0x2c')],'type':_0x5a440e[_0x1aa3('0x2d')][_0x1aa3('0x2e')]};});_0x41bdcb[_0x1aa3('0x2f')]=_[_0x1aa3('0x2a')](_0x11b7bd,'name');_0x41bdcb['query']=_['keys'](_0x5b1738[_0x1aa3('0x30')]);_0x41bdcb[_0x1aa3('0x31')]=_[_0x1aa3('0x32')](_0x41bdcb[_0x1aa3('0x2f')],_0x41bdcb[_0x1aa3('0x30')]);_0x2cfe74[_0x1aa3('0x33')]=_[_0x1aa3('0x32')](_0x41bdcb['model'],qs['fields'](_0x5b1738[_0x1aa3('0x30')][_0x1aa3('0x34')]));_0x2cfe74[_0x1aa3('0x33')]=_0x2cfe74['attributes']['length']?_0x2cfe74[_0x1aa3('0x33')]:_0x41bdcb[_0x1aa3('0x2f')];if(!_0x5b1738[_0x1aa3('0x30')][_0x1aa3('0x35')](_0x1aa3('0x36'))){_0x2cfe74[_0x1aa3('0x1d')]=qs[_0x1aa3('0x1d')](_0x5b1738[_0x1aa3('0x30')][_0x1aa3('0x1d')]);_0x2cfe74[_0x1aa3('0x1b')]=qs[_0x1aa3('0x1b')](_0x5b1738[_0x1aa3('0x30')][_0x1aa3('0x1b')]);}_0x2cfe74[_0x1aa3('0x37')]=qs['sort'](_0x5b1738[_0x1aa3('0x30')][_0x1aa3('0x38')]);_0x2cfe74[_0x1aa3('0x39')]=qs['filters'](_[_0x1aa3('0x3a')](_0x5b1738[_0x1aa3('0x30')],_0x41bdcb[_0x1aa3('0x31')]),_0x11b7bd);if(_0x5b1738[_0x1aa3('0x30')]['filter']){_0x2cfe74[_0x1aa3('0x39')]=_[_0x1aa3('0x3b')](_0x2cfe74['where'],{'$or':_['map'](_0x11b7bd,function(_0x3a00ad){if(_0x3a00ad['type']!==_0x1aa3('0x3c')){var _0x2c7ec8={};_0x2c7ec8[_0x3a00ad[_0x1aa3('0x28')]]={'$like':'%'+_0x5b1738[_0x1aa3('0x30')][_0x1aa3('0x3d')]+'%'};return _0x2c7ec8;}})});}_0x2cfe74=_[_0x1aa3('0x3b')]({},_0x2cfe74,_0x5b1738[_0x1aa3('0x3e')]);var _0x52d501={'where':_0x2cfe74[_0x1aa3('0x39')]};return db[_0x1aa3('0x3f')][_0x1aa3('0x1e')](_0x52d501)[_0x1aa3('0x24')](function(_0x4f08de){_0x5270f3[_0x1aa3('0x1e')]=_0x4f08de;if(_0x5b1738[_0x1aa3('0x30')]['includeAll']){_0x2cfe74[_0x1aa3('0x40')]=[{'all':!![]}];}return db[_0x1aa3('0x3f')][_0x1aa3('0x41')](_0x2cfe74);})[_0x1aa3('0x24')](function(_0x14d7c6){_0x5270f3[_0x1aa3('0x42')]=_0x14d7c6;return _0x5270f3;})[_0x1aa3('0x24')](respondWithFilteredResult(_0x43342d,_0x2cfe74))[_0x1aa3('0x43')](handleError(_0x43342d,null));};exports['show']=function(_0x316b30,_0x6695f5){var _0x8a27dc={'raw':![],'where':{'id':_0x316b30['params']['id']}},_0xda2b92={};_0xda2b92[_0x1aa3('0x2f')]=_[_0x1aa3('0x44')](db[_0x1aa3('0x3f')]['rawAttributes']);_0xda2b92[_0x1aa3('0x30')]=_[_0x1aa3('0x44')](_0x316b30['query']);_0xda2b92[_0x1aa3('0x31')]=_[_0x1aa3('0x32')](_0xda2b92[_0x1aa3('0x2f')],_0xda2b92[_0x1aa3('0x30')]);_0x8a27dc['attributes']=_[_0x1aa3('0x32')](_0xda2b92[_0x1aa3('0x2f')],qs[_0x1aa3('0x34')](_0x316b30['query'][_0x1aa3('0x34')]));_0x8a27dc[_0x1aa3('0x33')]=_0x8a27dc[_0x1aa3('0x33')][_0x1aa3('0x45')]?_0x8a27dc[_0x1aa3('0x33')]:_0xda2b92[_0x1aa3('0x2f')];if(_0x316b30['query']['includeAll']){_0x8a27dc[_0x1aa3('0x40')]=[{'all':!![]}];}_0x8a27dc=_[_0x1aa3('0x3b')]({},_0x8a27dc,_0x316b30['options']);return db[_0x1aa3('0x3f')]['find'](_0x8a27dc)[_0x1aa3('0x24')](handleEntityNotFound(_0x6695f5,null))[_0x1aa3('0x24')](respondWithResult(_0x6695f5,null))['catch'](handleError(_0x6695f5,null));};exports[_0x1aa3('0x46')]=function(_0x315a57,_0x18a230){return db[_0x1aa3('0x3f')]['create'](_0x315a57[_0x1aa3('0x47')],{})[_0x1aa3('0x24')](respondWithResult(_0x18a230,0xc9))[_0x1aa3('0x43')](handleError(_0x18a230,null));};exports['update']=function(_0x27072e,_0x51260e){if(_0x27072e[_0x1aa3('0x47')]['id']){delete _0x27072e[_0x1aa3('0x47')]['id'];}return db[_0x1aa3('0x3f')]['find']({'where':{'id':_0x27072e[_0x1aa3('0x48')]['id']}})['then'](handleEntityNotFound(_0x51260e,null))[_0x1aa3('0x24')](saveUpdates(_0x27072e[_0x1aa3('0x47')],null))[_0x1aa3('0x24')](respondWithResult(_0x51260e,null))[_0x1aa3('0x43')](handleError(_0x51260e,null));};exports['destroy']=function(_0xd6f910,_0x4f1e1b){return db[_0x1aa3('0x3f')][_0x1aa3('0x49')]({'where':{'id':_0xd6f910[_0x1aa3('0x48')]['id']}})[_0x1aa3('0x24')](handleEntityNotFound(_0x4f1e1b,null))[_0x1aa3('0x24')](removeEntity(_0x4f1e1b,null))['catch'](handleError(_0x4f1e1b,null));};exports[_0x1aa3('0x4a')]=function(_0x4de2a7,_0x56ff4f,_0x5ce92f){var _0x2a78e5={};var _0x1aef69={};var _0x507545;var _0x3a1f43;return db[_0x1aa3('0x3f')][_0x1aa3('0x4b')]({'where':{'id':_0x4de2a7['params']['id']}})[_0x1aa3('0x24')](handleEntityNotFound(_0x56ff4f,null))[_0x1aa3('0x24')](function(_0x1ef20b){if(_0x1ef20b){_0x507545=_0x1ef20b;_0x1aef69[_0x1aa3('0x2f')]=_['keys'](db['FreshdeskField'][_0x1aa3('0x2b')]);_0x1aef69['query']=_[_0x1aa3('0x44')](_0x4de2a7[_0x1aa3('0x30')]);_0x1aef69['filters']=_[_0x1aa3('0x32')](_0x1aef69['model'],_0x1aef69[_0x1aa3('0x30')]);_0x2a78e5[_0x1aa3('0x33')]=_[_0x1aa3('0x32')](_0x1aef69[_0x1aa3('0x2f')],qs[_0x1aa3('0x34')](_0x4de2a7[_0x1aa3('0x30')]['fields']));_0x2a78e5['attributes']=_0x2a78e5['attributes']['length']?_0x2a78e5[_0x1aa3('0x33')]:_0x1aef69[_0x1aa3('0x2f')];_0x2a78e5[_0x1aa3('0x37')]=qs[_0x1aa3('0x38')](_0x4de2a7['query'][_0x1aa3('0x38')]);_0x2a78e5[_0x1aa3('0x39')]=qs[_0x1aa3('0x31')](_[_0x1aa3('0x3a')](_0x4de2a7[_0x1aa3('0x30')],_0x1aef69[_0x1aa3('0x31')]));if(_0x4de2a7[_0x1aa3('0x30')]['filter']){_0x2a78e5['where']=_[_0x1aa3('0x3b')](_0x2a78e5['where'],{'$or':_[_0x1aa3('0x2a')](_0x2a78e5[_0x1aa3('0x33')],function(_0x3ab7cf){var _0x59911b={};_0x59911b[_0x3ab7cf]={'$like':'%'+_0x4de2a7[_0x1aa3('0x30')]['filter']+'%'};return _0x59911b;})});}_0x2a78e5=_[_0x1aa3('0x3b')]({},_0x2a78e5,_0x4de2a7[_0x1aa3('0x3e')]);return _0x507545[_0x1aa3('0x4a')](_0x2a78e5);}})[_0x1aa3('0x24')](function(_0x17ab43){if(_0x17ab43){_0x3a1f43=_0x17ab43[_0x1aa3('0x45')];if(!_0x4de2a7[_0x1aa3('0x30')]['hasOwnProperty'](_0x1aa3('0x36'))){_0x2a78e5[_0x1aa3('0x1d')]=qs[_0x1aa3('0x1d')](_0x4de2a7[_0x1aa3('0x30')]['limit']);_0x2a78e5[_0x1aa3('0x1b')]=qs[_0x1aa3('0x1b')](_0x4de2a7[_0x1aa3('0x30')][_0x1aa3('0x1b')]);}return _0x507545[_0x1aa3('0x4a')](_0x2a78e5);}})['then'](function(_0x2a92c9){if(_0x2a92c9){return _0x2a92c9?{'count':_0x3a1f43,'rows':_0x2a92c9}:null;}})[_0x1aa3('0x24')](respondWithResult(_0x56ff4f,null))['catch'](handleError(_0x56ff4f,null));};exports[_0x1aa3('0x4c')]=function(_0x2a7cfa,_0x46afa1,_0x3e0d22){var _0x53ae16={};var _0x3cea60={};var _0x2b5a2c;var _0x2f8402;return db[_0x1aa3('0x3f')][_0x1aa3('0x4b')]({'where':{'id':_0x2a7cfa['params']['id']}})['then'](handleEntityNotFound(_0x46afa1,null))[_0x1aa3('0x24')](function(_0x7adadc){if(_0x7adadc){_0x2b5a2c=_0x7adadc;_0x3cea60[_0x1aa3('0x2f')]=_[_0x1aa3('0x44')](db[_0x1aa3('0x4d')][_0x1aa3('0x2b')]);_0x3cea60[_0x1aa3('0x30')]=_[_0x1aa3('0x44')](_0x2a7cfa[_0x1aa3('0x30')]);_0x3cea60[_0x1aa3('0x31')]=_[_0x1aa3('0x32')](_0x3cea60[_0x1aa3('0x2f')],_0x3cea60[_0x1aa3('0x30')]);_0x53ae16[_0x1aa3('0x33')]=_[_0x1aa3('0x32')](_0x3cea60['model'],qs['fields'](_0x2a7cfa[_0x1aa3('0x30')][_0x1aa3('0x34')]));_0x53ae16[_0x1aa3('0x33')]=_0x53ae16[_0x1aa3('0x33')]['length']?_0x53ae16[_0x1aa3('0x33')]:_0x3cea60[_0x1aa3('0x2f')];_0x53ae16[_0x1aa3('0x37')]=qs[_0x1aa3('0x38')](_0x2a7cfa[_0x1aa3('0x30')][_0x1aa3('0x38')]);_0x53ae16[_0x1aa3('0x39')]=qs[_0x1aa3('0x31')](_[_0x1aa3('0x3a')](_0x2a7cfa[_0x1aa3('0x30')],_0x3cea60['filters']));if(_0x2a7cfa[_0x1aa3('0x30')][_0x1aa3('0x3d')]){_0x53ae16[_0x1aa3('0x39')]=_[_0x1aa3('0x3b')](_0x53ae16['where'],{'$or':_[_0x1aa3('0x2a')](_0x53ae16[_0x1aa3('0x33')],function(_0xcd735e){var _0x5ed430={};_0x5ed430[_0xcd735e]={'$like':'%'+_0x2a7cfa['query'][_0x1aa3('0x3d')]+'%'};return _0x5ed430;})});}_0x53ae16=_[_0x1aa3('0x3b')]({},_0x53ae16,_0x2a7cfa[_0x1aa3('0x3e')]);return _0x2b5a2c[_0x1aa3('0x4c')](_0x53ae16);}})[_0x1aa3('0x24')](function(_0x1a1bf0){if(_0x1a1bf0){_0x2f8402=_0x1a1bf0[_0x1aa3('0x45')];if(!_0x2a7cfa[_0x1aa3('0x30')]['hasOwnProperty']('nolimit')){_0x53ae16['limit']=qs[_0x1aa3('0x1d')](_0x2a7cfa['query'][_0x1aa3('0x1d')]);_0x53ae16[_0x1aa3('0x1b')]=qs[_0x1aa3('0x1b')](_0x2a7cfa[_0x1aa3('0x30')][_0x1aa3('0x1b')]);}return _0x2b5a2c[_0x1aa3('0x4c')](_0x53ae16);}})[_0x1aa3('0x24')](function(_0x2a000b){if(_0x2a000b){return _0x2a000b?{'count':_0x2f8402,'rows':_0x2a000b}:null;}})[_0x1aa3('0x24')](respondWithResult(_0x46afa1,null))[_0x1aa3('0x43')](handleError(_0x46afa1,null));};exports[_0x1aa3('0x4e')]=function(_0x5f4426,_0x745f73,_0x4cc241){var _0x38d3c0={};var _0x45b99c={};var _0x865286;var _0x38c7d6;return db[_0x1aa3('0x3f')][_0x1aa3('0x4b')]({'where':{'id':_0x5f4426[_0x1aa3('0x48')]['id']}})[_0x1aa3('0x24')](handleEntityNotFound(_0x745f73,null))['then'](function(_0x23a2a3){if(_0x23a2a3){_0x865286=_0x23a2a3;_0x45b99c[_0x1aa3('0x2f')]=_[_0x1aa3('0x44')](db[_0x1aa3('0x4d')]['rawAttributes']);_0x45b99c[_0x1aa3('0x30')]=_['keys'](_0x5f4426['query']);_0x45b99c[_0x1aa3('0x31')]=_[_0x1aa3('0x32')](_0x45b99c[_0x1aa3('0x2f')],_0x45b99c['query']);_0x38d3c0['attributes']=_[_0x1aa3('0x32')](_0x45b99c[_0x1aa3('0x2f')],qs[_0x1aa3('0x34')](_0x5f4426[_0x1aa3('0x30')][_0x1aa3('0x34')]));_0x38d3c0[_0x1aa3('0x33')]=_0x38d3c0[_0x1aa3('0x33')][_0x1aa3('0x45')]?_0x38d3c0[_0x1aa3('0x33')]:_0x45b99c[_0x1aa3('0x2f')];_0x38d3c0[_0x1aa3('0x37')]=qs['sort'](_0x5f4426['query'][_0x1aa3('0x38')]);_0x38d3c0[_0x1aa3('0x39')]=qs[_0x1aa3('0x31')](_['pick'](_0x5f4426['query'],_0x45b99c[_0x1aa3('0x31')]));if(_0x5f4426[_0x1aa3('0x30')][_0x1aa3('0x3d')]){_0x38d3c0[_0x1aa3('0x39')]=_[_0x1aa3('0x3b')](_0x38d3c0[_0x1aa3('0x39')],{'$or':_[_0x1aa3('0x2a')](_0x38d3c0[_0x1aa3('0x33')],function(_0x23d77b){var _0x59d162={};_0x59d162[_0x23d77b]={'$like':'%'+_0x5f4426[_0x1aa3('0x30')][_0x1aa3('0x3d')]+'%'};return _0x59d162;})});}_0x38d3c0=_[_0x1aa3('0x3b')]({},_0x38d3c0,_0x5f4426['options']);return _0x865286[_0x1aa3('0x4e')](_0x38d3c0);}})[_0x1aa3('0x24')](function(_0x2134ee){if(_0x2134ee){_0x38c7d6=_0x2134ee[_0x1aa3('0x45')];if(!_0x5f4426[_0x1aa3('0x30')][_0x1aa3('0x35')](_0x1aa3('0x36'))){_0x38d3c0[_0x1aa3('0x1d')]=qs['limit'](_0x5f4426['query']['limit']);_0x38d3c0[_0x1aa3('0x1b')]=qs[_0x1aa3('0x1b')](_0x5f4426[_0x1aa3('0x30')][_0x1aa3('0x1b')]);}return _0x865286[_0x1aa3('0x4e')](_0x38d3c0);}})[_0x1aa3('0x24')](function(_0x277d4c){if(_0x277d4c){return _0x277d4c?{'count':_0x38c7d6,'rows':_0x277d4c}:null;}})[_0x1aa3('0x24')](respondWithResult(_0x745f73,null))[_0x1aa3('0x43')](handleError(_0x745f73,null));};exports['getTags']=function(_0xe65834,_0x50f287,_0x15cd93){var _0x5ba558={};var _0x5e41fa={};var _0x195fc5;var _0x2ea400;return db[_0x1aa3('0x3f')][_0x1aa3('0x4b')]({'where':{'id':_0xe65834[_0x1aa3('0x48')]['id']}})[_0x1aa3('0x24')](handleEntityNotFound(_0x50f287,null))[_0x1aa3('0x24')](function(_0x1d3cfb){if(_0x1d3cfb){_0x195fc5=_0x1d3cfb;_0x5e41fa[_0x1aa3('0x2f')]=_['keys'](db['Tag']['rawAttributes']);_0x5e41fa[_0x1aa3('0x30')]=_['keys'](_0xe65834[_0x1aa3('0x30')]);_0x5e41fa[_0x1aa3('0x31')]=_[_0x1aa3('0x32')](_0x5e41fa['model'],_0x5e41fa[_0x1aa3('0x30')]);_0x5ba558[_0x1aa3('0x33')]=_[_0x1aa3('0x32')](_0x5e41fa['model'],qs[_0x1aa3('0x34')](_0xe65834['query'][_0x1aa3('0x34')]));_0x5ba558[_0x1aa3('0x33')]=_0x5ba558[_0x1aa3('0x33')][_0x1aa3('0x45')]?_0x5ba558[_0x1aa3('0x33')]:_0x5e41fa[_0x1aa3('0x2f')];_0x5ba558[_0x1aa3('0x37')]=qs['sort'](_0xe65834['query'][_0x1aa3('0x38')]);_0x5ba558[_0x1aa3('0x39')]=qs['filters'](_[_0x1aa3('0x3a')](_0xe65834['query'],_0x5e41fa[_0x1aa3('0x31')]));if(_0xe65834[_0x1aa3('0x30')][_0x1aa3('0x3d')]){_0x5ba558[_0x1aa3('0x39')]=_[_0x1aa3('0x3b')](_0x5ba558['where'],{'$or':_['map'](_0x5ba558[_0x1aa3('0x33')],function(_0x1f6587){var _0x1d4854={};_0x1d4854[_0x1f6587]={'$like':'%'+_0xe65834[_0x1aa3('0x30')][_0x1aa3('0x3d')]+'%'};return _0x1d4854;})});}_0x5ba558=_[_0x1aa3('0x3b')]({},_0x5ba558,_0xe65834[_0x1aa3('0x3e')]);return _0x195fc5[_0x1aa3('0x4f')](_0x5ba558);}})[_0x1aa3('0x24')](function(_0x1938b5){if(_0x1938b5){_0x2ea400=_0x1938b5['length'];if(!_0xe65834[_0x1aa3('0x30')][_0x1aa3('0x35')](_0x1aa3('0x36'))){_0x5ba558[_0x1aa3('0x1d')]=qs[_0x1aa3('0x1d')](_0xe65834[_0x1aa3('0x30')][_0x1aa3('0x1d')]);_0x5ba558[_0x1aa3('0x1b')]=qs['offset'](_0xe65834[_0x1aa3('0x30')][_0x1aa3('0x1b')]);}return _0x195fc5[_0x1aa3('0x4f')](_0x5ba558);}})['then'](function(_0x38729c){if(_0x38729c){return _0x38729c?{'count':_0x2ea400,'rows':_0x38729c}:null;}})[_0x1aa3('0x24')](respondWithResult(_0x50f287,null))['catch'](handleError(_0x50f287,null));};exports[_0x1aa3('0x50')]=function(_0x1a5a6e,_0x218757,_0x10e680){if(_0x1a5a6e['body']['id']){delete _0x1a5a6e[_0x1aa3('0x47')]['id'];}return db[_0x1aa3('0x3f')][_0x1aa3('0x4b')]({'where':{'id':_0x1a5a6e['params']['id']}})[_0x1aa3('0x24')](handleEntityNotFound(_0x218757,null))[_0x1aa3('0x24')](function(_0xae50e6){if(_0xae50e6){return _0xae50e6[_0x1aa3('0x50')](_0x1a5a6e[_0x1aa3('0x47')][_0x1aa3('0x51')]||[]);}return null;})['then'](respondWithResult(_0x218757,null))['catch'](handleError(_0x218757,null));}; \ No newline at end of file +var _0xafce=['getFields','hasOwnProperty','getSubjects','findOne','pick','getDescriptions','getTags','setTags','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','json','undefined','limit','offset','status','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','name','send','index','FreshdeskConfiguration','rawAttributes','fieldName','key','map','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','filter','where','merge','type','VIRTUAL','count','includeAll','include','findAll','catch','show','params','options','find','create','body','FreshdeskField'];(function(_0x24aa8a,_0x3d2adf){var _0x3e7324=function(_0xf01b79){while(--_0xf01b79){_0x24aa8a['push'](_0x24aa8a['shift']());}};_0x3e7324(++_0x3d2adf);}(_0xafce,0x1a7));var _0xeafc=function(_0x522174,_0x3e8952){_0x522174=_0x522174-0x0;var _0x5b4809=_0xafce[_0x522174];return _0x5b4809;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeafc('0x0'));var zipdir=require(_0xeafc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xeafc('0x2'));var moment=require('moment');var BPromise=require(_0xeafc('0x3'));var Mustache=require(_0xeafc('0x4'));var util=require('util');var path=require(_0xeafc('0x5'));var sox=require(_0xeafc('0x6'));var csv=require(_0xeafc('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xeafc('0x8'));var _=require(_0xeafc('0x9'));var squel=require(_0xeafc('0xa'));var crypto=require(_0xeafc('0xb'));var jsforce=require(_0xeafc('0xc'));var deskjs=require(_0xeafc('0xd'));var toCsv=require(_0xeafc('0x7'));var querystring=require(_0xeafc('0xe'));var Papa=require('papaparse');var Redis=require(_0xeafc('0xf'));var authService=require(_0xeafc('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xeafc('0x11'));var hardwareService=require(_0xeafc('0x12'));var logger=require(_0xeafc('0x13'))('api');var utils=require(_0xeafc('0x14'));var config=require(_0xeafc('0x15'));var licenseUtil=require(_0xeafc('0x16'));var db=require(_0xeafc('0x17'))['db'];function respondWithStatusCode(_0x4bf54e,_0x3988c7){_0x3988c7=_0x3988c7||0xcc;return function(_0x218267){if(_0x218267){return _0x4bf54e['sendStatus'](_0x3988c7);}return _0x4bf54e['status'](_0x3988c7)['end']();};}function respondWithResult(_0x400993,_0x3df731){_0x3df731=_0x3df731||0xc8;return function(_0x21a646){if(_0x21a646){return _0x400993['status'](_0x3df731)[_0xeafc('0x18')](_0x21a646);}};}function respondWithFilteredResult(_0x5aaac6,_0x4aeead){return function(_0x12e280){if(_0x12e280){var _0x5a9610=typeof _0x4aeead['offset']===_0xeafc('0x19')&&typeof _0x4aeead[_0xeafc('0x1a')]===_0xeafc('0x19');var _0x24d738=_0x12e280['count'];var _0x310ba3=_0x5a9610?0x0:_0x4aeead[_0xeafc('0x1b')];var _0x192e72=_0x5a9610?_0x12e280['count']:_0x4aeead['offset']+_0x4aeead[_0xeafc('0x1a')];var _0x2a385d;if(_0x192e72>=_0x24d738){_0x192e72=_0x24d738;_0x2a385d=0xc8;}else{_0x2a385d=0xce;}_0x5aaac6[_0xeafc('0x1c')](_0x2a385d);return _0x5aaac6['set'](_0xeafc('0x1d'),_0x310ba3+'-'+_0x192e72+'/'+_0x24d738)['json'](_0x12e280);}return null;};}function patchUpdates(_0x419c0e){return function(_0x45e4f7){try{jsonpatch[_0xeafc('0x1e')](_0x45e4f7,_0x419c0e,!![]);}catch(_0x2eea31){return BPromise[_0xeafc('0x1f')](_0x2eea31);}return _0x45e4f7[_0xeafc('0x20')]();};}function saveUpdates(_0x55e084,_0x4a7fab){return function(_0x14ba47){if(_0x14ba47){return _0x14ba47[_0xeafc('0x21')](_0x55e084)[_0xeafc('0x22')](function(_0x591adf){return _0x591adf;});}return null;};}function removeEntity(_0x48263c,_0x2afc72){return function(_0x57337a){if(_0x57337a){return _0x57337a[_0xeafc('0x23')]()[_0xeafc('0x22')](function(){_0x48263c[_0xeafc('0x1c')](0xcc)[_0xeafc('0x24')]();});}};}function handleEntityNotFound(_0x45b270,_0x2e1579){return function(_0x16f3ea){if(!_0x16f3ea){_0x45b270[_0xeafc('0x25')](0x194);}return _0x16f3ea;};}function handleError(_0x3868f5,_0x296753){_0x296753=_0x296753||0x1f4;return function(_0xbee51d){logger[_0xeafc('0x26')](_0xbee51d['stack']);if(_0xbee51d['name']){delete _0xbee51d[_0xeafc('0x27')];}_0x3868f5[_0xeafc('0x1c')](_0x296753)[_0xeafc('0x28')](_0xbee51d);};}exports[_0xeafc('0x29')]=function(_0x53fd45,_0x3edf70){var _0x164757={},_0x3ac73f={},_0x3e9af8={'count':0x0,'rows':[]};var _0x378afc=_['map'](db[_0xeafc('0x2a')][_0xeafc('0x2b')],function(_0x196709){return{'name':_0x196709[_0xeafc('0x2c')],'type':_0x196709['type'][_0xeafc('0x2d')]};});_0x3ac73f['model']=_[_0xeafc('0x2e')](_0x378afc,_0xeafc('0x27'));_0x3ac73f[_0xeafc('0x2f')]=_[_0xeafc('0x30')](_0x53fd45[_0xeafc('0x2f')]);_0x3ac73f[_0xeafc('0x31')]=_[_0xeafc('0x32')](_0x3ac73f['model'],_0x3ac73f[_0xeafc('0x2f')]);_0x164757[_0xeafc('0x33')]=_[_0xeafc('0x32')](_0x3ac73f[_0xeafc('0x34')],qs[_0xeafc('0x35')](_0x53fd45['query'][_0xeafc('0x35')]));_0x164757[_0xeafc('0x33')]=_0x164757[_0xeafc('0x33')][_0xeafc('0x36')]?_0x164757['attributes']:_0x3ac73f[_0xeafc('0x34')];if(!_0x53fd45[_0xeafc('0x2f')]['hasOwnProperty'](_0xeafc('0x37'))){_0x164757[_0xeafc('0x1a')]=qs['limit'](_0x53fd45['query'][_0xeafc('0x1a')]);_0x164757[_0xeafc('0x1b')]=qs[_0xeafc('0x1b')](_0x53fd45['query'][_0xeafc('0x1b')]);}_0x164757[_0xeafc('0x38')]=qs[_0xeafc('0x39')](_0x53fd45[_0xeafc('0x2f')][_0xeafc('0x39')]);_0x164757['where']=qs['filters'](_['pick'](_0x53fd45[_0xeafc('0x2f')],_0x3ac73f['filters']),_0x378afc);if(_0x53fd45['query'][_0xeafc('0x3a')]){_0x164757[_0xeafc('0x3b')]=_[_0xeafc('0x3c')](_0x164757[_0xeafc('0x3b')],{'$or':_['map'](_0x378afc,function(_0x4e1ece){if(_0x4e1ece[_0xeafc('0x3d')]!==_0xeafc('0x3e')){var _0xce1068={};_0xce1068[_0x4e1ece[_0xeafc('0x27')]]={'$like':'%'+_0x53fd45['query'][_0xeafc('0x3a')]+'%'};return _0xce1068;}})});}_0x164757=_[_0xeafc('0x3c')]({},_0x164757,_0x53fd45['options']);var _0x1f663f={'where':_0x164757[_0xeafc('0x3b')]};return db[_0xeafc('0x2a')][_0xeafc('0x3f')](_0x1f663f)['then'](function(_0x101fcd){_0x3e9af8[_0xeafc('0x3f')]=_0x101fcd;if(_0x53fd45[_0xeafc('0x2f')][_0xeafc('0x40')]){_0x164757[_0xeafc('0x41')]=[{'all':!![]}];}return db[_0xeafc('0x2a')][_0xeafc('0x42')](_0x164757);})['then'](function(_0x4cb0dd){_0x3e9af8['rows']=_0x4cb0dd;return _0x3e9af8;})[_0xeafc('0x22')](respondWithFilteredResult(_0x3edf70,_0x164757))[_0xeafc('0x43')](handleError(_0x3edf70,null));};exports[_0xeafc('0x44')]=function(_0x5f3bef,_0xdb5f0f){var _0x2a5ef8={'raw':![],'where':{'id':_0x5f3bef[_0xeafc('0x45')]['id']}},_0xeca720={};_0xeca720[_0xeafc('0x34')]=_[_0xeafc('0x30')](db[_0xeafc('0x2a')][_0xeafc('0x2b')]);_0xeca720['query']=_[_0xeafc('0x30')](_0x5f3bef[_0xeafc('0x2f')]);_0xeca720[_0xeafc('0x31')]=_[_0xeafc('0x32')](_0xeca720[_0xeafc('0x34')],_0xeca720[_0xeafc('0x2f')]);_0x2a5ef8['attributes']=_[_0xeafc('0x32')](_0xeca720[_0xeafc('0x34')],qs['fields'](_0x5f3bef[_0xeafc('0x2f')][_0xeafc('0x35')]));_0x2a5ef8[_0xeafc('0x33')]=_0x2a5ef8['attributes'][_0xeafc('0x36')]?_0x2a5ef8[_0xeafc('0x33')]:_0xeca720[_0xeafc('0x34')];if(_0x5f3bef['query']['includeAll']){_0x2a5ef8[_0xeafc('0x41')]=[{'all':!![]}];}_0x2a5ef8=_['merge']({},_0x2a5ef8,_0x5f3bef[_0xeafc('0x46')]);return db[_0xeafc('0x2a')][_0xeafc('0x47')](_0x2a5ef8)['then'](handleEntityNotFound(_0xdb5f0f,null))['then'](respondWithResult(_0xdb5f0f,null))[_0xeafc('0x43')](handleError(_0xdb5f0f,null));};exports[_0xeafc('0x48')]=function(_0x35b489,_0x436194){return db[_0xeafc('0x2a')]['create'](_0x35b489[_0xeafc('0x49')],{})[_0xeafc('0x22')](respondWithResult(_0x436194,0xc9))['catch'](handleError(_0x436194,null));};exports[_0xeafc('0x21')]=function(_0xe18144,_0x5d3bc0){if(_0xe18144['body']['id']){delete _0xe18144['body']['id'];}return db['FreshdeskConfiguration'][_0xeafc('0x47')]({'where':{'id':_0xe18144['params']['id']}})[_0xeafc('0x22')](handleEntityNotFound(_0x5d3bc0,null))[_0xeafc('0x22')](saveUpdates(_0xe18144[_0xeafc('0x49')],null))['then'](respondWithResult(_0x5d3bc0,null))['catch'](handleError(_0x5d3bc0,null));};exports['destroy']=function(_0x44f3db,_0x1b3265){return db[_0xeafc('0x2a')][_0xeafc('0x47')]({'where':{'id':_0x44f3db[_0xeafc('0x45')]['id']}})[_0xeafc('0x22')](handleEntityNotFound(_0x1b3265,null))[_0xeafc('0x22')](removeEntity(_0x1b3265,null))['catch'](handleError(_0x1b3265,null));};exports['getFields']=function(_0x29d160,_0x49026c,_0x17cf7e){var _0x109131={};var _0x206796={};var _0x33e9f7;var _0x30fcb4;return db[_0xeafc('0x2a')]['findOne']({'where':{'id':_0x29d160[_0xeafc('0x45')]['id']}})[_0xeafc('0x22')](handleEntityNotFound(_0x49026c,null))['then'](function(_0x9b61ee){if(_0x9b61ee){_0x33e9f7=_0x9b61ee;_0x206796[_0xeafc('0x34')]=_['keys'](db[_0xeafc('0x4a')][_0xeafc('0x2b')]);_0x206796[_0xeafc('0x2f')]=_[_0xeafc('0x30')](_0x29d160['query']);_0x206796[_0xeafc('0x31')]=_['intersection'](_0x206796[_0xeafc('0x34')],_0x206796[_0xeafc('0x2f')]);_0x109131[_0xeafc('0x33')]=_[_0xeafc('0x32')](_0x206796[_0xeafc('0x34')],qs[_0xeafc('0x35')](_0x29d160[_0xeafc('0x2f')][_0xeafc('0x35')]));_0x109131['attributes']=_0x109131[_0xeafc('0x33')]['length']?_0x109131[_0xeafc('0x33')]:_0x206796[_0xeafc('0x34')];_0x109131[_0xeafc('0x38')]=qs[_0xeafc('0x39')](_0x29d160['query'][_0xeafc('0x39')]);_0x109131[_0xeafc('0x3b')]=qs['filters'](_['pick'](_0x29d160['query'],_0x206796['filters']));if(_0x29d160[_0xeafc('0x2f')]['filter']){_0x109131[_0xeafc('0x3b')]=_[_0xeafc('0x3c')](_0x109131[_0xeafc('0x3b')],{'$or':_[_0xeafc('0x2e')](_0x109131[_0xeafc('0x33')],function(_0x44bf8f){var _0xbc69ab={};_0xbc69ab[_0x44bf8f]={'$like':'%'+_0x29d160[_0xeafc('0x2f')][_0xeafc('0x3a')]+'%'};return _0xbc69ab;})});}_0x109131=_[_0xeafc('0x3c')]({},_0x109131,_0x29d160[_0xeafc('0x46')]);return _0x33e9f7[_0xeafc('0x4b')](_0x109131);}})['then'](function(_0x516662){if(_0x516662){_0x30fcb4=_0x516662[_0xeafc('0x36')];if(!_0x29d160[_0xeafc('0x2f')][_0xeafc('0x4c')](_0xeafc('0x37'))){_0x109131[_0xeafc('0x1a')]=qs[_0xeafc('0x1a')](_0x29d160[_0xeafc('0x2f')][_0xeafc('0x1a')]);_0x109131[_0xeafc('0x1b')]=qs[_0xeafc('0x1b')](_0x29d160[_0xeafc('0x2f')]['offset']);}return _0x33e9f7['getFields'](_0x109131);}})[_0xeafc('0x22')](function(_0x4a20bf){if(_0x4a20bf){return _0x4a20bf?{'count':_0x30fcb4,'rows':_0x4a20bf}:null;}})[_0xeafc('0x22')](respondWithResult(_0x49026c,null))[_0xeafc('0x43')](handleError(_0x49026c,null));};exports[_0xeafc('0x4d')]=function(_0x2d41c0,_0xc022ab,_0x2ddf52){var _0x45c8d5={};var _0xda0a4={};var _0x4c74ca;var _0x2b3992;return db[_0xeafc('0x2a')][_0xeafc('0x4e')]({'where':{'id':_0x2d41c0[_0xeafc('0x45')]['id']}})[_0xeafc('0x22')](handleEntityNotFound(_0xc022ab,null))[_0xeafc('0x22')](function(_0x97b800){if(_0x97b800){_0x4c74ca=_0x97b800;_0xda0a4[_0xeafc('0x34')]=_[_0xeafc('0x30')](db[_0xeafc('0x4a')][_0xeafc('0x2b')]);_0xda0a4[_0xeafc('0x2f')]=_['keys'](_0x2d41c0['query']);_0xda0a4[_0xeafc('0x31')]=_['intersection'](_0xda0a4[_0xeafc('0x34')],_0xda0a4[_0xeafc('0x2f')]);_0x45c8d5[_0xeafc('0x33')]=_[_0xeafc('0x32')](_0xda0a4[_0xeafc('0x34')],qs[_0xeafc('0x35')](_0x2d41c0[_0xeafc('0x2f')][_0xeafc('0x35')]));_0x45c8d5['attributes']=_0x45c8d5['attributes']['length']?_0x45c8d5[_0xeafc('0x33')]:_0xda0a4[_0xeafc('0x34')];_0x45c8d5[_0xeafc('0x38')]=qs[_0xeafc('0x39')](_0x2d41c0[_0xeafc('0x2f')][_0xeafc('0x39')]);_0x45c8d5['where']=qs[_0xeafc('0x31')](_[_0xeafc('0x4f')](_0x2d41c0[_0xeafc('0x2f')],_0xda0a4[_0xeafc('0x31')]));if(_0x2d41c0[_0xeafc('0x2f')][_0xeafc('0x3a')]){_0x45c8d5[_0xeafc('0x3b')]=_[_0xeafc('0x3c')](_0x45c8d5['where'],{'$or':_['map'](_0x45c8d5[_0xeafc('0x33')],function(_0x3ba554){var _0x54cd8b={};_0x54cd8b[_0x3ba554]={'$like':'%'+_0x2d41c0[_0xeafc('0x2f')][_0xeafc('0x3a')]+'%'};return _0x54cd8b;})});}_0x45c8d5=_['merge']({},_0x45c8d5,_0x2d41c0[_0xeafc('0x46')]);return _0x4c74ca[_0xeafc('0x4d')](_0x45c8d5);}})[_0xeafc('0x22')](function(_0x5f4f95){if(_0x5f4f95){_0x2b3992=_0x5f4f95['length'];if(!_0x2d41c0[_0xeafc('0x2f')]['hasOwnProperty'](_0xeafc('0x37'))){_0x45c8d5[_0xeafc('0x1a')]=qs[_0xeafc('0x1a')](_0x2d41c0[_0xeafc('0x2f')][_0xeafc('0x1a')]);_0x45c8d5[_0xeafc('0x1b')]=qs['offset'](_0x2d41c0['query']['offset']);}return _0x4c74ca['getSubjects'](_0x45c8d5);}})[_0xeafc('0x22')](function(_0x27c875){if(_0x27c875){return _0x27c875?{'count':_0x2b3992,'rows':_0x27c875}:null;}})[_0xeafc('0x22')](respondWithResult(_0xc022ab,null))[_0xeafc('0x43')](handleError(_0xc022ab,null));};exports[_0xeafc('0x50')]=function(_0x146098,_0x1c35c5,_0x267ae3){var _0x3c876f={};var _0x54772c={};var _0x4a6ff3;var _0xb0a038;return db[_0xeafc('0x2a')][_0xeafc('0x4e')]({'where':{'id':_0x146098[_0xeafc('0x45')]['id']}})[_0xeafc('0x22')](handleEntityNotFound(_0x1c35c5,null))[_0xeafc('0x22')](function(_0x18021e){if(_0x18021e){_0x4a6ff3=_0x18021e;_0x54772c[_0xeafc('0x34')]=_['keys'](db[_0xeafc('0x4a')][_0xeafc('0x2b')]);_0x54772c[_0xeafc('0x2f')]=_[_0xeafc('0x30')](_0x146098[_0xeafc('0x2f')]);_0x54772c[_0xeafc('0x31')]=_[_0xeafc('0x32')](_0x54772c[_0xeafc('0x34')],_0x54772c[_0xeafc('0x2f')]);_0x3c876f[_0xeafc('0x33')]=_[_0xeafc('0x32')](_0x54772c[_0xeafc('0x34')],qs[_0xeafc('0x35')](_0x146098[_0xeafc('0x2f')]['fields']));_0x3c876f[_0xeafc('0x33')]=_0x3c876f['attributes'][_0xeafc('0x36')]?_0x3c876f[_0xeafc('0x33')]:_0x54772c[_0xeafc('0x34')];_0x3c876f[_0xeafc('0x38')]=qs['sort'](_0x146098[_0xeafc('0x2f')][_0xeafc('0x39')]);_0x3c876f[_0xeafc('0x3b')]=qs[_0xeafc('0x31')](_[_0xeafc('0x4f')](_0x146098[_0xeafc('0x2f')],_0x54772c[_0xeafc('0x31')]));if(_0x146098[_0xeafc('0x2f')][_0xeafc('0x3a')]){_0x3c876f[_0xeafc('0x3b')]=_[_0xeafc('0x3c')](_0x3c876f[_0xeafc('0x3b')],{'$or':_[_0xeafc('0x2e')](_0x3c876f['attributes'],function(_0x5d663a){var _0x2e1812={};_0x2e1812[_0x5d663a]={'$like':'%'+_0x146098[_0xeafc('0x2f')][_0xeafc('0x3a')]+'%'};return _0x2e1812;})});}_0x3c876f=_[_0xeafc('0x3c')]({},_0x3c876f,_0x146098['options']);return _0x4a6ff3[_0xeafc('0x50')](_0x3c876f);}})[_0xeafc('0x22')](function(_0x18751e){if(_0x18751e){_0xb0a038=_0x18751e[_0xeafc('0x36')];if(!_0x146098['query'][_0xeafc('0x4c')](_0xeafc('0x37'))){_0x3c876f[_0xeafc('0x1a')]=qs[_0xeafc('0x1a')](_0x146098['query'][_0xeafc('0x1a')]);_0x3c876f['offset']=qs[_0xeafc('0x1b')](_0x146098[_0xeafc('0x2f')]['offset']);}return _0x4a6ff3[_0xeafc('0x50')](_0x3c876f);}})[_0xeafc('0x22')](function(_0x136473){if(_0x136473){return _0x136473?{'count':_0xb0a038,'rows':_0x136473}:null;}})[_0xeafc('0x22')](respondWithResult(_0x1c35c5,null))['catch'](handleError(_0x1c35c5,null));};exports[_0xeafc('0x51')]=function(_0x5a6514,_0x3051f2,_0x1985bf){var _0x5a6194={};var _0x19f0f0={};var _0x4d7447;var _0x34891e;return db[_0xeafc('0x2a')][_0xeafc('0x4e')]({'where':{'id':_0x5a6514[_0xeafc('0x45')]['id']}})[_0xeafc('0x22')](handleEntityNotFound(_0x3051f2,null))[_0xeafc('0x22')](function(_0x1e064b){if(_0x1e064b){_0x4d7447=_0x1e064b;_0x19f0f0['model']=_[_0xeafc('0x30')](db['Tag']['rawAttributes']);_0x19f0f0[_0xeafc('0x2f')]=_['keys'](_0x5a6514[_0xeafc('0x2f')]);_0x19f0f0['filters']=_[_0xeafc('0x32')](_0x19f0f0[_0xeafc('0x34')],_0x19f0f0[_0xeafc('0x2f')]);_0x5a6194['attributes']=_[_0xeafc('0x32')](_0x19f0f0[_0xeafc('0x34')],qs[_0xeafc('0x35')](_0x5a6514['query']['fields']));_0x5a6194[_0xeafc('0x33')]=_0x5a6194[_0xeafc('0x33')][_0xeafc('0x36')]?_0x5a6194[_0xeafc('0x33')]:_0x19f0f0[_0xeafc('0x34')];_0x5a6194[_0xeafc('0x38')]=qs[_0xeafc('0x39')](_0x5a6514[_0xeafc('0x2f')][_0xeafc('0x39')]);_0x5a6194[_0xeafc('0x3b')]=qs['filters'](_[_0xeafc('0x4f')](_0x5a6514[_0xeafc('0x2f')],_0x19f0f0[_0xeafc('0x31')]));if(_0x5a6514[_0xeafc('0x2f')][_0xeafc('0x3a')]){_0x5a6194['where']=_[_0xeafc('0x3c')](_0x5a6194[_0xeafc('0x3b')],{'$or':_[_0xeafc('0x2e')](_0x5a6194[_0xeafc('0x33')],function(_0x1482ad){var _0x1e5524={};_0x1e5524[_0x1482ad]={'$like':'%'+_0x5a6514[_0xeafc('0x2f')][_0xeafc('0x3a')]+'%'};return _0x1e5524;})});}_0x5a6194=_[_0xeafc('0x3c')]({},_0x5a6194,_0x5a6514[_0xeafc('0x46')]);return _0x4d7447[_0xeafc('0x51')](_0x5a6194);}})[_0xeafc('0x22')](function(_0xd40a0c){if(_0xd40a0c){_0x34891e=_0xd40a0c['length'];if(!_0x5a6514[_0xeafc('0x2f')][_0xeafc('0x4c')](_0xeafc('0x37'))){_0x5a6194[_0xeafc('0x1a')]=qs[_0xeafc('0x1a')](_0x5a6514[_0xeafc('0x2f')][_0xeafc('0x1a')]);_0x5a6194[_0xeafc('0x1b')]=qs[_0xeafc('0x1b')](_0x5a6514[_0xeafc('0x2f')][_0xeafc('0x1b')]);}return _0x4d7447[_0xeafc('0x51')](_0x5a6194);}})[_0xeafc('0x22')](function(_0x19e3a5){if(_0x19e3a5){return _0x19e3a5?{'count':_0x34891e,'rows':_0x19e3a5}:null;}})[_0xeafc('0x22')](respondWithResult(_0x3051f2,null))[_0xeafc('0x43')](handleError(_0x3051f2,null));};exports[_0xeafc('0x52')]=function(_0x3ff29b,_0x2a760a,_0x2045b8){if(_0x3ff29b[_0xeafc('0x49')]['id']){delete _0x3ff29b[_0xeafc('0x49')]['id'];}return db[_0xeafc('0x2a')][_0xeafc('0x4e')]({'where':{'id':_0x3ff29b[_0xeafc('0x45')]['id']}})[_0xeafc('0x22')](handleEntityNotFound(_0x2a760a,null))[_0xeafc('0x22')](function(_0x17a275){if(_0x17a275){return _0x17a275[_0xeafc('0x52')](_0x3ff29b['body']['ids']||[]);}return null;})[_0xeafc('0x22')](respondWithResult(_0x2a760a,null))['catch'](handleError(_0x2a760a,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index b436113..5fcdb49 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 _0xb201=['util','../../config/logger','api','request-promise','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash'];(function(_0xb50908,_0x34bae3){var _0x5bee69=function(_0x2b9b20){while(--_0x2b9b20){_0xb50908['push'](_0xb50908['shift']());}};_0x5bee69(++_0x34bae3);}(_0xb201,0xe3));var _0x1b20=function(_0xc5a76e,_0x2b37f7){_0xc5a76e=_0xc5a76e-0x0;var _0x3dcbb6=_0xb201[_0xc5a76e];return _0x3dcbb6;};'use strict';var _=require(_0x1b20('0x0'));var util=require(_0x1b20('0x1'));var logger=require(_0x1b20('0x2'))(_0x1b20('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1b20('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1b20('0x5'));var config=require(_0x1b20('0x6'));var attributes=require(_0x1b20('0x7'));module[_0x1b20('0x8')]=function(_0x1186a9,_0x3b26bc){return _0x1186a9[_0x1b20('0x9')](_0x1b20('0xa'),attributes,{'tableName':_0x1b20('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4899=['request-promise','path','rimraf','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','api','moment','bluebird'];(function(_0x38550,_0x1e36a6){var _0x556e2c=function(_0x20777a){while(--_0x20777a){_0x38550['push'](_0x38550['shift']());}};_0x556e2c(++_0x1e36a6);}(_0x4899,0x119));var _0x9489=function(_0x2858ed,_0xf08b01){_0x2858ed=_0x2858ed-0x0;var _0x5504a8=_0x4899[_0x2858ed];return _0x5504a8;};'use strict';var _=require(_0x9489('0x0'));var util=require(_0x9489('0x1'));var logger=require('../../config/logger')(_0x9489('0x2'));var moment=require(_0x9489('0x3'));var BPromise=require(_0x9489('0x4'));var rp=require(_0x9489('0x5'));var fs=require('fs');var path=require(_0x9489('0x6'));var rimraf=require(_0x9489('0x7'));var config=require('../../config/environment');var attributes=require(_0x9489('0x8'));module[_0x9489('0x9')]=function(_0x53ec02,_0x2dcf2b){return _0x53ec02[_0x9489('0xa')](_0x9489('0xb'),attributes,{'tableName':_0x9489('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 842b672..163a8cb 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 _0xa682=['stringify','error','message','result','lodash','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshdeskConfiguration,\x20%s,\x20%s','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2a51a4,_0x4fb2ff){var _0x1499ca=function(_0x357950){while(--_0x357950){_0x2a51a4['push'](_0x2a51a4['shift']());}};_0x1499ca(++_0x4fb2ff);}(_0xa682,0x121));var _0x2a68=function(_0xfe1471,_0x4880ac){_0xfe1471=_0xfe1471-0x0;var _0x40d289=_0xa682[_0xfe1471];return _0x40d289;};'use strict';var _=require(_0x2a68('0x0'));var util=require('util');var moment=require(_0x2a68('0x1'));var BPromise=require(_0x2a68('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2a68('0x3'))['db'];var utils=require(_0x2a68('0x4'));var logger=require('../../config/logger')(_0x2a68('0x5'));var config=require(_0x2a68('0x6'));var jayson=require(_0x2a68('0x7'));var client=jayson[_0x2a68('0x8')][_0x2a68('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x9de827,_0x4735e0,_0x18389f){return new BPromise(function(_0x50a22e,_0x5a7e42){return client['request'](_0x9de827,_0x18389f)[_0x2a68('0xa')](function(_0x23544a){logger[_0x2a68('0xb')](_0x2a68('0xc'),_0x4735e0,'request\x20sent');logger['debug'](_0x2a68('0xd'),_0x4735e0,_0x2a68('0xe'),JSON[_0x2a68('0xf')](_0x23544a));if(_0x23544a[_0x2a68('0x10')]){if(_0x23544a[_0x2a68('0x10')]['code']===0x1f4){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x4735e0,_0x23544a[_0x2a68('0x10')]['message']);return _0x5a7e42(_0x23544a[_0x2a68('0x10')][_0x2a68('0x11')]);}logger[_0x2a68('0x10')](_0x2a68('0xc'),_0x4735e0,_0x23544a[_0x2a68('0x10')][_0x2a68('0x11')]);return _0x50a22e(_0x23544a['error'][_0x2a68('0x11')]);}else{logger[_0x2a68('0xb')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x4735e0,_0x2a68('0xe'));_0x50a22e(_0x23544a[_0x2a68('0x12')]['message']);}})['catch'](function(_0x2c8adb){logger[_0x2a68('0x10')](_0x2a68('0xc'),_0x4735e0,_0x2c8adb);_0x5a7e42(_0x2c8adb);});});} \ No newline at end of file +var _0x42d1=['then','info','FreshdeskConfiguration,\x20%s,\x20%s','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','request'];(function(_0x3419cd,_0x1bb730){var _0x80c4b0=function(_0x23a880){while(--_0x23a880){_0x3419cd['push'](_0x3419cd['shift']());}};_0x80c4b0(++_0x1bb730);}(_0x42d1,0xd0));var _0x142d=function(_0x138426,_0x5dc601){_0x138426=_0x138426-0x0;var _0x23df97=_0x42d1[_0x138426];return _0x23df97;};'use strict';var _=require('lodash');var util=require(_0x142d('0x0'));var moment=require(_0x142d('0x1'));var BPromise=require(_0x142d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x142d('0x3'));var db=require(_0x142d('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x142d('0x5'));var config=require('../../config/environment');var jayson=require(_0x142d('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x520046,_0x5877f9,_0x1975af){return new BPromise(function(_0x1413f7,_0x584286){return client[_0x142d('0x7')](_0x520046,_0x1975af)[_0x142d('0x8')](function(_0x4c28fc){logger[_0x142d('0x9')](_0x142d('0xa'),_0x5877f9,'request\x20sent');logger['debug'](_0x142d('0xb'),_0x5877f9,_0x142d('0xc'),JSON[_0x142d('0xd')](_0x4c28fc));if(_0x4c28fc[_0x142d('0xe')]){if(_0x4c28fc[_0x142d('0xe')][_0x142d('0xf')]===0x1f4){logger[_0x142d('0xe')](_0x142d('0xa'),_0x5877f9,_0x4c28fc['error'][_0x142d('0x10')]);return _0x584286(_0x4c28fc[_0x142d('0xe')][_0x142d('0x10')]);}logger[_0x142d('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5877f9,_0x4c28fc[_0x142d('0xe')]['message']);return _0x1413f7(_0x4c28fc[_0x142d('0xe')][_0x142d('0x10')]);}else{logger[_0x142d('0x9')](_0x142d('0xa'),_0x5877f9,'request\x20sent');_0x1413f7(_0x4c28fc['result']['message']);}})[_0x142d('0x11')](function(_0x496cc4){logger['error'](_0x142d('0xa'),_0x5877f9,_0x496cc4);_0x584286(_0x496cc4);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index e1dff64..c42de38 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 _0x219f=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskField.controller','get','index','isAuthenticated','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x6f7c73,_0x4d79f0){var _0x4aa18f=function(_0x3bcf88){while(--_0x3bcf88){_0x6f7c73['push'](_0x6f7c73['shift']());}};_0x4aa18f(++_0x4d79f0);}(_0x219f,0x167));var _0xf219=function(_0x532228,_0x3272fd){_0x532228=_0x532228-0x0;var _0x216fd3=_0x219f[_0x532228];return _0x216fd3;};'use strict';var multer=require(_0xf219('0x0'));var util=require('util');var path=require(_0xf219('0x1'));var timeout=require('connect-timeout');var express=require(_0xf219('0x2'));var router=express[_0xf219('0x3')]();var fs_extra=require(_0xf219('0x4'));var auth=require(_0xf219('0x5'));var interaction=require(_0xf219('0x6'));var config=require('../../config/environment');var controller=require(_0xf219('0x7'));router[_0xf219('0x8')]('/',auth['isAuthenticated'](),controller[_0xf219('0x9')]);router[_0xf219('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xf219('0xa')](),controller[_0xf219('0xb')]);router[_0xf219('0xc')](_0xf219('0xd'),auth[_0xf219('0xa')](),controller[_0xf219('0xe')]);router[_0xf219('0xf')](_0xf219('0xd'),auth[_0xf219('0xa')](),controller[_0xf219('0x10')]);module[_0xf219('0x11')]=router; \ No newline at end of file +var _0xa5cd=['../../config/environment','index','/:id','isAuthenticated','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3d27a,_0x31311d){var _0x314fd7=function(_0x20ac55){while(--_0x20ac55){_0x3d27a['push'](_0x3d27a['shift']());}};_0x314fd7(++_0x31311d);}(_0xa5cd,0x14e));var _0xda5c=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xa5cd[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0xda5c('0x0'));var util=require(_0xda5c('0x1'));var path=require(_0xda5c('0x2'));var timeout=require(_0xda5c('0x3'));var express=require(_0xda5c('0x4'));var router=express[_0xda5c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xda5c('0x6'));var interaction=require(_0xda5c('0x7'));var config=require(_0xda5c('0x8'));var controller=require('./intFreshdeskField.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xda5c('0x9')]);router['get'](_0xda5c('0xa'),auth[_0xda5c('0xb')](),controller[_0xda5c('0xc')]);router[_0xda5c('0xd')]('/',auth[_0xda5c('0xb')](),controller[_0xda5c('0xe')]);router[_0xda5c('0xf')](_0xda5c('0xa'),auth[_0xda5c('0xb')](),controller[_0xda5c('0x10')]);router['delete'](_0xda5c('0xa'),auth[_0xda5c('0xb')](),controller[_0xda5c('0x11')]);module[_0xda5c('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 06d5253..b173237 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 _0x1f5d=['keyValue','string','STRING','sequelize','exports','customVariable'];(function(_0x40dc91,_0x25f021){var _0x566f91=function(_0x46742e){while(--_0x46742e){_0x40dc91['push'](_0x40dc91['shift']());}};_0x566f91(++_0x25f021);}(_0x1f5d,0x141));var _0xd1f5=function(_0x585133,_0x2412a1){_0x585133=_0x585133-0x0;var _0x18254a=_0x1f5d[_0x585133];return _0x18254a;};'use strict';var Sequelize=require(_0xd1f5('0x0'));module[_0xd1f5('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable',_0xd1f5('0x2'),_0xd1f5('0x3'),'picklist'),'defaultValue':_0xd1f5('0x4')},'content':{'type':Sequelize[_0xd1f5('0x5')]},'key':{'type':Sequelize[_0xd1f5('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0xd1f5('0x4'),'variable',_0xd1f5('0x2'))},'keyContent':{'type':Sequelize[_0xd1f5('0x5')]},'idField':{'type':Sequelize[_0xd1f5('0x5')]},'nameField':{'type':Sequelize[_0xd1f5('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd1f5('0x5')]}}; \ No newline at end of file +var _0xaa9f=['picklist','STRING','customVariable','sequelize','exports','ENUM','string','variable'];(function(_0x588f9e,_0x4d1ac3){var _0x48252e=function(_0x16e104){while(--_0x16e104){_0x588f9e['push'](_0x588f9e['shift']());}};_0x48252e(++_0x4d1ac3);}(_0xaa9f,0x1d3));var _0xfaa9=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xaa9f[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0xfaa9('0x0'));module[_0xfaa9('0x1')]={'type':{'type':Sequelize[_0xfaa9('0x2')](_0xfaa9('0x3'),_0xfaa9('0x4'),'customVariable','keyValue',_0xfaa9('0x5')),'defaultValue':_0xfaa9('0x3')},'content':{'type':Sequelize[_0xfaa9('0x6')]},'key':{'type':Sequelize[_0xfaa9('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xfaa9('0x3'),_0xfaa9('0x4'),_0xfaa9('0x7'))},'keyContent':{'type':Sequelize[_0xfaa9('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xfaa9('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xfaa9('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 79472dd..e60cada 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 _0x5ff3=['json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','sendStatus','error','name','index','map','FreshdeskField','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','include','findAll','rows','show','keys','rawAttributes','find','catch','create','body','params','destroy','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../mysqldb','status','end'];(function(_0x38daf4,_0x43be28){var _0x168476=function(_0xcd95f7){while(--_0xcd95f7){_0x38daf4['push'](_0x38daf4['shift']());}};_0x168476(++_0x43be28);}(_0x5ff3,0x17d));var _0x35ff=function(_0x5109f9,_0x359a84){_0x5109f9=_0x5109f9-0x0;var _0x179727=_0x5ff3[_0x5109f9];return _0x179727;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x35ff('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35ff('0x1'));var rp=require('request-promise');var moment=require(_0x35ff('0x2'));var BPromise=require(_0x35ff('0x3'));var Mustache=require(_0x35ff('0x4'));var util=require(_0x35ff('0x5'));var path=require('path');var sox=require(_0x35ff('0x6'));var csv=require(_0x35ff('0x7'));var ejs=require(_0x35ff('0x8'));var fs=require('fs');var fs_extra=require(_0x35ff('0x9'));var _=require(_0x35ff('0xa'));var squel=require('squel');var crypto=require(_0x35ff('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x35ff('0xc'));var toCsv=require(_0x35ff('0x7'));var querystring=require(_0x35ff('0xd'));var Papa=require('papaparse');var Redis=require(_0x35ff('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x35ff('0xf'));var as=require(_0x35ff('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x35ff('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x35ff('0x12'))['db'];function respondWithStatusCode(_0x3c5f4b,_0x5bda40){_0x5bda40=_0x5bda40||0xcc;return function(_0x842930){if(_0x842930){return _0x3c5f4b['sendStatus'](_0x5bda40);}return _0x3c5f4b[_0x35ff('0x13')](_0x5bda40)[_0x35ff('0x14')]();};}function respondWithResult(_0x3db454,_0x4d1d41){_0x4d1d41=_0x4d1d41||0xc8;return function(_0xff8ac){if(_0xff8ac){return _0x3db454[_0x35ff('0x13')](_0x4d1d41)[_0x35ff('0x15')](_0xff8ac);}};}function respondWithFilteredResult(_0x3e24dd,_0x438199){return function(_0x3dff65){if(_0x3dff65){var _0x2d4a88=typeof _0x438199[_0x35ff('0x16')]===_0x35ff('0x17')&&typeof _0x438199[_0x35ff('0x18')]===_0x35ff('0x17');var _0x3430e2=_0x3dff65[_0x35ff('0x19')];var _0x16c803=_0x2d4a88?0x0:_0x438199[_0x35ff('0x16')];var _0x5f470e=_0x2d4a88?_0x3dff65[_0x35ff('0x19')]:_0x438199[_0x35ff('0x16')]+_0x438199[_0x35ff('0x18')];var _0x1c0d8c;if(_0x5f470e>=_0x3430e2){_0x5f470e=_0x3430e2;_0x1c0d8c=0xc8;}else{_0x1c0d8c=0xce;}_0x3e24dd['status'](_0x1c0d8c);return _0x3e24dd['set'](_0x35ff('0x1a'),_0x16c803+'-'+_0x5f470e+'/'+_0x3430e2)[_0x35ff('0x15')](_0x3dff65);}return null;};}function patchUpdates(_0x4c8dd4){return function(_0x238f65){try{jsonpatch[_0x35ff('0x1b')](_0x238f65,_0x4c8dd4,!![]);}catch(_0x3a87bc){return BPromise[_0x35ff('0x1c')](_0x3a87bc);}return _0x238f65['save']();};}function saveUpdates(_0x3d60b4,_0x55274b){return function(_0x7cc20a){if(_0x7cc20a){return _0x7cc20a[_0x35ff('0x1d')](_0x3d60b4)[_0x35ff('0x1e')](function(_0x16a5a0){return _0x16a5a0;});}return null;};}function removeEntity(_0x396cc2,_0x2b3782){return function(_0x347cec){if(_0x347cec){return _0x347cec['destroy']()[_0x35ff('0x1e')](function(){_0x396cc2[_0x35ff('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x426e4e,_0x5ad0c6){return function(_0x4c46b7){if(!_0x4c46b7){_0x426e4e[_0x35ff('0x1f')](0x194);}return _0x4c46b7;};}function handleError(_0x9e2789,_0x95b9e2){_0x95b9e2=_0x95b9e2||0x1f4;return function(_0x11a5eb){logger[_0x35ff('0x20')](_0x11a5eb['stack']);if(_0x11a5eb[_0x35ff('0x21')]){delete _0x11a5eb[_0x35ff('0x21')];}_0x9e2789[_0x35ff('0x13')](_0x95b9e2)['send'](_0x11a5eb);};}exports[_0x35ff('0x22')]=function(_0x1f51c5,_0x3b4331){var _0x6d5407={},_0x47fcb5={},_0x61b554={'count':0x0,'rows':[]};var _0x1afc98=_[_0x35ff('0x23')](db[_0x35ff('0x24')]['rawAttributes'],function(_0x3f9440){return{'name':_0x3f9440['fieldName'],'type':_0x3f9440[_0x35ff('0x25')][_0x35ff('0x26')]};});_0x47fcb5[_0x35ff('0x27')]=_[_0x35ff('0x23')](_0x1afc98,'name');_0x47fcb5[_0x35ff('0x28')]=_['keys'](_0x1f51c5[_0x35ff('0x28')]);_0x47fcb5[_0x35ff('0x29')]=_['intersection'](_0x47fcb5['model'],_0x47fcb5[_0x35ff('0x28')]);_0x6d5407[_0x35ff('0x2a')]=_['intersection'](_0x47fcb5[_0x35ff('0x27')],qs[_0x35ff('0x2b')](_0x1f51c5['query'][_0x35ff('0x2b')]));_0x6d5407[_0x35ff('0x2a')]=_0x6d5407[_0x35ff('0x2a')][_0x35ff('0x2c')]?_0x6d5407[_0x35ff('0x2a')]:_0x47fcb5[_0x35ff('0x27')];if(!_0x1f51c5[_0x35ff('0x28')][_0x35ff('0x2d')](_0x35ff('0x2e'))){_0x6d5407[_0x35ff('0x18')]=qs[_0x35ff('0x18')](_0x1f51c5[_0x35ff('0x28')][_0x35ff('0x18')]);_0x6d5407['offset']=qs[_0x35ff('0x16')](_0x1f51c5['query'][_0x35ff('0x16')]);}_0x6d5407[_0x35ff('0x2f')]=qs[_0x35ff('0x30')](_0x1f51c5[_0x35ff('0x28')][_0x35ff('0x30')]);_0x6d5407['where']=qs[_0x35ff('0x29')](_[_0x35ff('0x31')](_0x1f51c5[_0x35ff('0x28')],_0x47fcb5[_0x35ff('0x29')]),_0x1afc98);if(_0x1f51c5[_0x35ff('0x28')]['filter']){_0x6d5407[_0x35ff('0x32')]=_[_0x35ff('0x33')](_0x6d5407[_0x35ff('0x32')],{'$or':_['map'](_0x1afc98,function(_0x4b98d2){if(_0x4b98d2[_0x35ff('0x25')]!==_0x35ff('0x34')){var _0x1f2a53={};_0x1f2a53[_0x4b98d2[_0x35ff('0x21')]]={'$like':'%'+_0x1f51c5[_0x35ff('0x28')][_0x35ff('0x35')]+'%'};return _0x1f2a53;}})});}_0x6d5407=_[_0x35ff('0x33')]({},_0x6d5407,_0x1f51c5[_0x35ff('0x36')]);var _0x5dc229={'where':_0x6d5407['where']};return db['FreshdeskField'][_0x35ff('0x19')](_0x5dc229)[_0x35ff('0x1e')](function(_0x10088a){_0x61b554[_0x35ff('0x19')]=_0x10088a;if(_0x1f51c5[_0x35ff('0x28')]['includeAll']){_0x6d5407[_0x35ff('0x37')]=[{'all':!![]}];}return db[_0x35ff('0x24')][_0x35ff('0x38')](_0x6d5407);})[_0x35ff('0x1e')](function(_0x117ee6){_0x61b554[_0x35ff('0x39')]=_0x117ee6;return _0x61b554;})['then'](respondWithFilteredResult(_0x3b4331,_0x6d5407))['catch'](handleError(_0x3b4331,null));};exports[_0x35ff('0x3a')]=function(_0x1fb1ed,_0x14d741){var _0x21b123={'raw':!![],'where':{'id':_0x1fb1ed['params']['id']}},_0x4b1e3e={};_0x4b1e3e[_0x35ff('0x27')]=_[_0x35ff('0x3b')](db[_0x35ff('0x24')][_0x35ff('0x3c')]);_0x4b1e3e[_0x35ff('0x28')]=_[_0x35ff('0x3b')](_0x1fb1ed[_0x35ff('0x28')]);_0x4b1e3e['filters']=_['intersection'](_0x4b1e3e[_0x35ff('0x27')],_0x4b1e3e[_0x35ff('0x28')]);_0x21b123[_0x35ff('0x2a')]=_['intersection'](_0x4b1e3e[_0x35ff('0x27')],qs[_0x35ff('0x2b')](_0x1fb1ed['query']['fields']));_0x21b123[_0x35ff('0x2a')]=_0x21b123['attributes'][_0x35ff('0x2c')]?_0x21b123[_0x35ff('0x2a')]:_0x4b1e3e['model'];if(_0x1fb1ed[_0x35ff('0x28')]['includeAll']){_0x21b123['include']=[{'all':!![]}];}_0x21b123=_[_0x35ff('0x33')]({},_0x21b123,_0x1fb1ed[_0x35ff('0x36')]);return db[_0x35ff('0x24')][_0x35ff('0x3d')](_0x21b123)[_0x35ff('0x1e')](handleEntityNotFound(_0x14d741,null))[_0x35ff('0x1e')](respondWithResult(_0x14d741,null))[_0x35ff('0x3e')](handleError(_0x14d741,null));};exports[_0x35ff('0x3f')]=function(_0x10a290,_0xee99f9){return db[_0x35ff('0x24')][_0x35ff('0x3f')](_0x10a290['body'],{})[_0x35ff('0x1e')](respondWithResult(_0xee99f9,0xc9))[_0x35ff('0x3e')](handleError(_0xee99f9,null));};exports[_0x35ff('0x1d')]=function(_0x2d26e2,_0x506def){if(_0x2d26e2['body']['id']){delete _0x2d26e2[_0x35ff('0x40')]['id'];}return db['FreshdeskField'][_0x35ff('0x3d')]({'where':{'id':_0x2d26e2[_0x35ff('0x41')]['id']}})[_0x35ff('0x1e')](handleEntityNotFound(_0x506def,null))[_0x35ff('0x1e')](saveUpdates(_0x2d26e2[_0x35ff('0x40')],null))[_0x35ff('0x1e')](respondWithResult(_0x506def,null))[_0x35ff('0x3e')](handleError(_0x506def,null));};exports[_0x35ff('0x42')]=function(_0x3be5fc,_0x535cc8){return db['FreshdeskField'][_0x35ff('0x3d')]({'where':{'id':_0x3be5fc['params']['id']}})[_0x35ff('0x1e')](handleEntityNotFound(_0x535cc8,null))[_0x35ff('0x1e')](removeEntity(_0x535cc8,null))[_0x35ff('0x3e')](handleError(_0x535cc8,null));}; \ No newline at end of file +var _0x049e=['moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','Content-Range','json','reject','save','update','then','error','stack','index','map','FreshdeskField','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','name','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','destroy','eml-format','rimraf','fast-json-patch'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0x049e,0x16a));var _0xe049=function(_0xdad237,_0x361a1d){_0xdad237=_0xdad237-0x0;var _0x15c575=_0x049e[_0xdad237];return _0x15c575;};'use strict';var emlformat=require(_0xe049('0x0'));var rimraf=require(_0xe049('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe049('0x2'));var rp=require('request-promise');var moment=require(_0xe049('0x3'));var BPromise=require(_0xe049('0x4'));var Mustache=require(_0xe049('0x5'));var util=require(_0xe049('0x6'));var path=require(_0xe049('0x7'));var sox=require('sox');var csv=require(_0xe049('0x8'));var ejs=require(_0xe049('0x9'));var fs=require('fs');var fs_extra=require(_0xe049('0xa'));var _=require(_0xe049('0xb'));var squel=require(_0xe049('0xc'));var crypto=require(_0xe049('0xd'));var jsforce=require(_0xe049('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe049('0x8'));var querystring=require(_0xe049('0xf'));var Papa=require(_0xe049('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe049('0x11'));var as=require(_0xe049('0x12'));var hardwareService=require(_0xe049('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xe049('0x14'));var licenseUtil=require(_0xe049('0x15'));var db=require(_0xe049('0x16'))['db'];function respondWithStatusCode(_0x359931,_0x301c7e){_0x301c7e=_0x301c7e||0xcc;return function(_0x1021e7){if(_0x1021e7){return _0x359931[_0xe049('0x17')](_0x301c7e);}return _0x359931[_0xe049('0x18')](_0x301c7e)['end']();};}function respondWithResult(_0x20c286,_0x3f4a57){_0x3f4a57=_0x3f4a57||0xc8;return function(_0x3924a4){if(_0x3924a4){return _0x20c286[_0xe049('0x18')](_0x3f4a57)['json'](_0x3924a4);}};}function respondWithFilteredResult(_0x3a539b,_0xcc35b6){return function(_0x5c90fd){if(_0x5c90fd){var _0x388be0=typeof _0xcc35b6[_0xe049('0x19')]==='undefined'&&typeof _0xcc35b6[_0xe049('0x1a')]===_0xe049('0x1b');var _0x5d435b=_0x5c90fd[_0xe049('0x1c')];var _0x54c303=_0x388be0?0x0:_0xcc35b6['offset'];var _0x3cbbeb=_0x388be0?_0x5c90fd['count']:_0xcc35b6['offset']+_0xcc35b6[_0xe049('0x1a')];var _0x1092ec;if(_0x3cbbeb>=_0x5d435b){_0x3cbbeb=_0x5d435b;_0x1092ec=0xc8;}else{_0x1092ec=0xce;}_0x3a539b['status'](_0x1092ec);return _0x3a539b['set'](_0xe049('0x1d'),_0x54c303+'-'+_0x3cbbeb+'/'+_0x5d435b)[_0xe049('0x1e')](_0x5c90fd);}return null;};}function patchUpdates(_0x1d2f5b){return function(_0x430421){try{jsonpatch['apply'](_0x430421,_0x1d2f5b,!![]);}catch(_0x572f29){return BPromise[_0xe049('0x1f')](_0x572f29);}return _0x430421[_0xe049('0x20')]();};}function saveUpdates(_0x572a80,_0x36a03b){return function(_0x3f14eb){if(_0x3f14eb){return _0x3f14eb[_0xe049('0x21')](_0x572a80)['then'](function(_0x197358){return _0x197358;});}return null;};}function removeEntity(_0x3b0f54,_0x4c7492){return function(_0x4848c9){if(_0x4848c9){return _0x4848c9['destroy']()[_0xe049('0x22')](function(){_0x3b0f54['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1aafd1,_0x1efbbe){return function(_0x53620b){if(!_0x53620b){_0x1aafd1[_0xe049('0x17')](0x194);}return _0x53620b;};}function handleError(_0x181432,_0x3e5c7f){_0x3e5c7f=_0x3e5c7f||0x1f4;return function(_0x423ba4){logger[_0xe049('0x23')](_0x423ba4[_0xe049('0x24')]);if(_0x423ba4['name']){delete _0x423ba4['name'];}_0x181432[_0xe049('0x18')](_0x3e5c7f)['send'](_0x423ba4);};}exports[_0xe049('0x25')]=function(_0x495d33,_0x3c50c3){var _0x2b79dc={},_0x5adcd6={},_0x432a6e={'count':0x0,'rows':[]};var _0x364630=_[_0xe049('0x26')](db[_0xe049('0x27')][_0xe049('0x28')],function(_0x4055fc){return{'name':_0x4055fc[_0xe049('0x29')],'type':_0x4055fc[_0xe049('0x2a')][_0xe049('0x2b')]};});_0x5adcd6[_0xe049('0x2c')]=_[_0xe049('0x26')](_0x364630,'name');_0x5adcd6[_0xe049('0x2d')]=_[_0xe049('0x2e')](_0x495d33['query']);_0x5adcd6['filters']=_['intersection'](_0x5adcd6['model'],_0x5adcd6[_0xe049('0x2d')]);_0x2b79dc[_0xe049('0x2f')]=_[_0xe049('0x30')](_0x5adcd6[_0xe049('0x2c')],qs[_0xe049('0x31')](_0x495d33['query'][_0xe049('0x31')]));_0x2b79dc[_0xe049('0x2f')]=_0x2b79dc[_0xe049('0x2f')][_0xe049('0x32')]?_0x2b79dc[_0xe049('0x2f')]:_0x5adcd6['model'];if(!_0x495d33[_0xe049('0x2d')]['hasOwnProperty'](_0xe049('0x33'))){_0x2b79dc['limit']=qs[_0xe049('0x1a')](_0x495d33[_0xe049('0x2d')][_0xe049('0x1a')]);_0x2b79dc[_0xe049('0x19')]=qs[_0xe049('0x19')](_0x495d33[_0xe049('0x2d')][_0xe049('0x19')]);}_0x2b79dc[_0xe049('0x34')]=qs[_0xe049('0x35')](_0x495d33[_0xe049('0x2d')][_0xe049('0x35')]);_0x2b79dc['where']=qs[_0xe049('0x36')](_[_0xe049('0x37')](_0x495d33[_0xe049('0x2d')],_0x5adcd6[_0xe049('0x36')]),_0x364630);if(_0x495d33[_0xe049('0x2d')][_0xe049('0x38')]){_0x2b79dc[_0xe049('0x39')]=_[_0xe049('0x3a')](_0x2b79dc['where'],{'$or':_[_0xe049('0x26')](_0x364630,function(_0x14bea3){if(_0x14bea3[_0xe049('0x2a')]!==_0xe049('0x3b')){var _0x5e9613={};_0x5e9613[_0x14bea3[_0xe049('0x3c')]]={'$like':'%'+_0x495d33[_0xe049('0x2d')][_0xe049('0x38')]+'%'};return _0x5e9613;}})});}_0x2b79dc=_[_0xe049('0x3a')]({},_0x2b79dc,_0x495d33[_0xe049('0x3d')]);var _0x54d5dd={'where':_0x2b79dc[_0xe049('0x39')]};return db[_0xe049('0x27')][_0xe049('0x1c')](_0x54d5dd)['then'](function(_0x28ae88){_0x432a6e['count']=_0x28ae88;if(_0x495d33['query'][_0xe049('0x3e')]){_0x2b79dc['include']=[{'all':!![]}];}return db[_0xe049('0x27')][_0xe049('0x3f')](_0x2b79dc);})[_0xe049('0x22')](function(_0xe4f184){_0x432a6e[_0xe049('0x40')]=_0xe4f184;return _0x432a6e;})['then'](respondWithFilteredResult(_0x3c50c3,_0x2b79dc))[_0xe049('0x41')](handleError(_0x3c50c3,null));};exports[_0xe049('0x42')]=function(_0x5e2374,_0x546137){var _0x29915f={'raw':!![],'where':{'id':_0x5e2374[_0xe049('0x43')]['id']}},_0x20d264={};_0x20d264[_0xe049('0x2c')]=_[_0xe049('0x2e')](db[_0xe049('0x27')]['rawAttributes']);_0x20d264[_0xe049('0x2d')]=_[_0xe049('0x2e')](_0x5e2374['query']);_0x20d264[_0xe049('0x36')]=_[_0xe049('0x30')](_0x20d264[_0xe049('0x2c')],_0x20d264[_0xe049('0x2d')]);_0x29915f[_0xe049('0x2f')]=_['intersection'](_0x20d264['model'],qs[_0xe049('0x31')](_0x5e2374[_0xe049('0x2d')][_0xe049('0x31')]));_0x29915f[_0xe049('0x2f')]=_0x29915f[_0xe049('0x2f')][_0xe049('0x32')]?_0x29915f['attributes']:_0x20d264[_0xe049('0x2c')];if(_0x5e2374[_0xe049('0x2d')]['includeAll']){_0x29915f[_0xe049('0x44')]=[{'all':!![]}];}_0x29915f=_['merge']({},_0x29915f,_0x5e2374[_0xe049('0x3d')]);return db['FreshdeskField'][_0xe049('0x45')](_0x29915f)['then'](handleEntityNotFound(_0x546137,null))[_0xe049('0x22')](respondWithResult(_0x546137,null))[_0xe049('0x41')](handleError(_0x546137,null));};exports[_0xe049('0x46')]=function(_0x1e3daf,_0x22eeb1){return db['FreshdeskField'][_0xe049('0x46')](_0x1e3daf[_0xe049('0x47')],{})[_0xe049('0x22')](respondWithResult(_0x22eeb1,0xc9))[_0xe049('0x41')](handleError(_0x22eeb1,null));};exports[_0xe049('0x21')]=function(_0x3c15a2,_0x12f9b8){if(_0x3c15a2[_0xe049('0x47')]['id']){delete _0x3c15a2[_0xe049('0x47')]['id'];}return db['FreshdeskField']['find']({'where':{'id':_0x3c15a2[_0xe049('0x43')]['id']}})[_0xe049('0x22')](handleEntityNotFound(_0x12f9b8,null))[_0xe049('0x22')](saveUpdates(_0x3c15a2[_0xe049('0x47')],null))[_0xe049('0x22')](respondWithResult(_0x12f9b8,null))[_0xe049('0x41')](handleError(_0x12f9b8,null));};exports[_0xe049('0x48')]=function(_0x2e4dce,_0x23692f){return db[_0xe049('0x27')][_0xe049('0x45')]({'where':{'id':_0x2e4dce['params']['id']}})[_0xe049('0x22')](handleEntityNotFound(_0x23692f,null))[_0xe049('0x22')](removeEntity(_0x23692f,null))[_0xe049('0x41')](handleError(_0x23692f,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index bd5bd96..8c987e6 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 _0xb2f4=['bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0x3bbb82,_0x132a9d){var _0x594c0c=function(_0x53533f){while(--_0x53533f){_0x3bbb82['push'](_0x3bbb82['shift']());}};_0x594c0c(++_0x132a9d);}(_0xb2f4,0x14f));var _0x4b2f=function(_0x380df2,_0x281a15){_0x380df2=_0x380df2-0x0;var _0x47f4df=_0xb2f4[_0x380df2];return _0x47f4df;};'use strict';var _=require(_0x4b2f('0x0'));var util=require(_0x4b2f('0x1'));var logger=require(_0x4b2f('0x2'))(_0x4b2f('0x3'));var moment=require(_0x4b2f('0x4'));var BPromise=require(_0x4b2f('0x5'));var rp=require(_0x4b2f('0x6'));var fs=require('fs');var path=require(_0x4b2f('0x7'));var rimraf=require(_0x4b2f('0x8'));var config=require(_0x4b2f('0x9'));var attributes=require(_0x4b2f('0xa'));module[_0x4b2f('0xb')]=function(_0x316ad4,_0x24ea9d){return _0x316ad4[_0x4b2f('0xc')]('FreshdeskField',attributes,{'tableName':_0x4b2f('0xd'),'paranoid':![],'indexes':[{'name':_0x4b2f('0xe'),'fields':[_0x4b2f('0xf'),_0x4b2f('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x802c=['FieldId','lodash','util','../../config/logger','bluebird','request-promise','path','../../config/environment','./intFreshdeskField.attributes','exports','define','int_freshdesk_fields','freshdesk_unique_index','idField'];(function(_0xd3a70d,_0xf80e35){var _0xf89f3b=function(_0x3c04af){while(--_0x3c04af){_0xd3a70d['push'](_0xd3a70d['shift']());}};_0xf89f3b(++_0xf80e35);}(_0x802c,0x1dd));var _0xc802=function(_0x9a3e43,_0x82f59a){_0x9a3e43=_0x9a3e43-0x0;var _0x3c655b=_0x802c[_0x9a3e43];return _0x3c655b;};'use strict';var _=require(_0xc802('0x0'));var util=require(_0xc802('0x1'));var logger=require(_0xc802('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc802('0x3'));var rp=require(_0xc802('0x4'));var fs=require('fs');var path=require(_0xc802('0x5'));var rimraf=require('rimraf');var config=require(_0xc802('0x6'));var attributes=require(_0xc802('0x7'));module[_0xc802('0x8')]=function(_0x4157c5,_0x399225){return _0x4157c5[_0xc802('0x9')]('FreshdeskField',attributes,{'tableName':_0xc802('0xa'),'paranoid':![],'indexes':[{'name':_0xc802('0xb'),'fields':[_0xc802('0xc'),_0xc802('0xd')],'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 a4f03f9..33ae51e 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 _0xdb25=['message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskField,\x20%s,\x20%s'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xdb25,0x1d0));var _0x5db2=function(_0x27f3ed,_0x16a8b1){_0x27f3ed=_0x27f3ed-0x0;var _0x26266e=_0xdb25[_0x27f3ed];return _0x26266e;};'use strict';var _=require(_0x5db2('0x0'));var util=require('util');var moment=require(_0x5db2('0x1'));var BPromise=require(_0x5db2('0x2'));var rs=require(_0x5db2('0x3'));var fs=require('fs');var Redis=require(_0x5db2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5db2('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x5db2('0x6'));var jayson=require(_0x5db2('0x7'));var client=jayson[_0x5db2('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x491bd3,_0x3e29a2,_0x1ad750){return new BPromise(function(_0x592b08,_0x3ee249){return client[_0x5db2('0x9')](_0x491bd3,_0x1ad750)[_0x5db2('0xa')](function(_0x194d68){logger[_0x5db2('0xb')]('FreshdeskField,\x20%s,\x20%s',_0x3e29a2,_0x5db2('0xc'));logger[_0x5db2('0xd')](_0x5db2('0xe'),_0x3e29a2,_0x5db2('0xc'),JSON[_0x5db2('0xf')](_0x194d68));if(_0x194d68[_0x5db2('0x10')]){if(_0x194d68[_0x5db2('0x10')][_0x5db2('0x11')]===0x1f4){logger[_0x5db2('0x10')](_0x5db2('0x12'),_0x3e29a2,_0x194d68['error'][_0x5db2('0x13')]);return _0x3ee249(_0x194d68['error']['message']);}logger[_0x5db2('0x10')]('FreshdeskField,\x20%s,\x20%s',_0x3e29a2,_0x194d68['error']['message']);return _0x592b08(_0x194d68['error'][_0x5db2('0x13')]);}else{logger[_0x5db2('0xb')]('FreshdeskField,\x20%s,\x20%s',_0x3e29a2,_0x5db2('0xc'));_0x592b08(_0x194d68['result']['message']);}})[_0x5db2('0x14')](function(_0x4df309){logger[_0x5db2('0x10')](_0x5db2('0x12'),_0x3e29a2,_0x4df309);_0x3ee249(_0x4df309);});});} \ No newline at end of file +var _0xdc39=['info','FreshdeskField,\x20%s,\x20%s','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','http','request','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdc39,0xb1));var _0x9dc3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdc39[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9dc3('0x0'));var util=require(_0x9dc3('0x1'));var moment=require(_0x9dc3('0x2'));var BPromise=require(_0x9dc3('0x3'));var rs=require(_0x9dc3('0x4'));var fs=require('fs');var Redis=require(_0x9dc3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9dc3('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x9dc3('0x7'));var jayson=require(_0x9dc3('0x8'));var client=jayson['client'][_0x9dc3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x51e12a,_0x586d51,_0xb2f92e){return new BPromise(function(_0x327e05,_0x25e0c0){return client[_0x9dc3('0xa')](_0x51e12a,_0xb2f92e)[_0x9dc3('0xb')](function(_0x372319){logger[_0x9dc3('0xc')](_0x9dc3('0xd'),_0x586d51,'request\x20sent');logger['debug'](_0x9dc3('0xe'),_0x586d51,_0x9dc3('0xf'),JSON[_0x9dc3('0x10')](_0x372319));if(_0x372319[_0x9dc3('0x11')]){if(_0x372319[_0x9dc3('0x11')][_0x9dc3('0x12')]===0x1f4){logger['error'](_0x9dc3('0xd'),_0x586d51,_0x372319[_0x9dc3('0x11')][_0x9dc3('0x13')]);return _0x25e0c0(_0x372319[_0x9dc3('0x11')]['message']);}logger[_0x9dc3('0x11')]('FreshdeskField,\x20%s,\x20%s',_0x586d51,_0x372319[_0x9dc3('0x11')][_0x9dc3('0x13')]);return _0x327e05(_0x372319[_0x9dc3('0x11')]['message']);}else{logger[_0x9dc3('0xc')](_0x9dc3('0xd'),_0x586d51,'request\x20sent');_0x327e05(_0x372319[_0x9dc3('0x14')]['message']);}})['catch'](function(_0x48d079){logger[_0x9dc3('0x11')](_0x9dc3('0xd'),_0x586d51,_0x48d079);_0x25e0c0(_0x48d079);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index a4be3e4..99064b5 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 _0xd8b0=['/:id','update','delete','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put'];(function(_0x529996,_0x45fa5c){var _0x19e85c=function(_0x284311){while(--_0x284311){_0x529996['push'](_0x529996['shift']());}};_0x19e85c(++_0x45fa5c);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./intFreshsalesAccount.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x9')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')]('/',auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['post'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);router[_0x0d8b('0x12')](_0x0d8b('0x13'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x14')]);router[_0x0d8b('0x15')](_0x0d8b('0x13'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x16')]);module[_0x0d8b('0x17')]=router; \ No newline at end of file +var _0x9c00=['create','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','/:id','isAuthenticated','show','getConfigurations','/:id/fields','getFields','post'];(function(_0x354107,_0x1e828c){var _0x54252e=function(_0x193a67){while(--_0x193a67){_0x354107['push'](_0x354107['shift']());}};_0x54252e(++_0x1e828c);}(_0x9c00,0x1a0));var _0x09c0=function(_0x5dac60,_0x2a3533){_0x5dac60=_0x5dac60-0x0;var _0x4ffd5c=_0x9c00[_0x5dac60];return _0x4ffd5c;};'use strict';var multer=require(_0x09c0('0x0'));var util=require(_0x09c0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x09c0('0x2'));var router=express[_0x09c0('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x09c0('0x4'));var interaction=require(_0x09c0('0x5'));var config=require(_0x09c0('0x6'));var controller=require(_0x09c0('0x7'));router[_0x09c0('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x09c0('0x8')](_0x09c0('0x9'),auth[_0x09c0('0xa')](),controller[_0x09c0('0xb')]);router[_0x09c0('0x8')]('/:id/configurations',auth[_0x09c0('0xa')](),controller[_0x09c0('0xc')]);router[_0x09c0('0x8')](_0x09c0('0xd'),auth[_0x09c0('0xa')](),controller[_0x09c0('0xe')]);router[_0x09c0('0xf')]('/',auth[_0x09c0('0xa')](),controller[_0x09c0('0x10')]);router[_0x09c0('0xf')](_0x09c0('0x11'),auth[_0x09c0('0xa')](),controller[_0x09c0('0x12')]);router[_0x09c0('0x13')](_0x09c0('0x9'),auth[_0x09c0('0xa')](),controller[_0x09c0('0x14')]);router[_0x09c0('0x15')](_0x09c0('0x9'),auth[_0x09c0('0xa')](),controller[_0x09c0('0x16')]);module[_0x09c0('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 873a27f..3a87636 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 _0xffd6=['exports','STRING','username','sequelize'];(function(_0x382a9c,_0x23045b){var _0x4b0e43=function(_0xbddbf1){while(--_0xbddbf1){_0x382a9c['push'](_0x382a9c['shift']());}};_0x4b0e43(++_0x23045b);}(_0xffd6,0x97));var _0x6ffd=function(_0x4bb581,_0x6f7037){_0x4bb581=_0x4bb581-0x0;var _0x316bf5=_0xffd6[_0x4bb581];return _0x316bf5;};'use strict';var Sequelize=require(_0x6ffd('0x0'));module[_0x6ffd('0x1')]={'name':{'type':Sequelize[_0x6ffd('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x6ffd('0x3')},'apiKey':{'type':Sequelize[_0x6ffd('0x2')]},'remoteUri':{'type':Sequelize[_0x6ffd('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x6ffd('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x1a85=['STRING','remoteUri'];(function(_0x1b02bb,_0x3d9fde){var _0x131245=function(_0x2fd1d8){while(--_0x2fd1d8){_0x1b02bb['push'](_0x1b02bb['shift']());}};_0x131245(++_0x3d9fde);}(_0x1a85,0x178));var _0x51a8=function(_0x4c630b,_0x25f8ef){_0x4c630b=_0x4c630b-0x0;var _0x181259=_0x1a85[_0x4c630b];return _0x181259;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x51a8('0x0')]},'description':{'type':Sequelize[_0x51a8('0x0')]},'username':{'type':Sequelize[_0x51a8('0x0')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x51a8('0x0')],'unique':_0x51a8('0x1')},'serverUrl':{'type':Sequelize[_0x51a8('0x0')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 3552170..0e62271 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 _0xe1a0=['order','sort','filters','pick','where','merge','VIRTUAL','filter','includeAll','include','rows','catch','show','params','keys','rawAttributes','options','create','body','FreshsalesConfiguration','getConfigurations','nolimit','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','getFields','remoteUri','apiKey','username','slice','substring','lastIndexOf','format','users','email','Requested\x20Resource\x20not\x20Found','test','stringify','send','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','offset','undefined','count','limit','set','json','apply','reject','save','update','destroy','then','end','error','name','index','map','FreshsalesAccount','fieldName','type','model','intersection','attributes','fields','length','query','hasOwnProperty'];(function(_0x121b71,_0x8bd4fc){var _0x327fdc=function(_0x891855){while(--_0x891855){_0x121b71['push'](_0x121b71['shift']());}};_0x327fdc(++_0x8bd4fc);}(_0xe1a0,0x154));var _0x0e1a=function(_0x4d21ff,_0x19d202){_0x4d21ff=_0x4d21ff-0x0;var _0x22b554=_0xe1a0[_0x4d21ff];return _0x22b554;};'use strict';var emlformat=require(_0x0e1a('0x0'));var rimraf=require(_0x0e1a('0x1'));var zipdir=require(_0x0e1a('0x2'));var jsonpatch=require(_0x0e1a('0x3'));var rp=require(_0x0e1a('0x4'));var moment=require(_0x0e1a('0x5'));var BPromise=require(_0x0e1a('0x6'));var Mustache=require(_0x0e1a('0x7'));var util=require('util');var path=require('path');var sox=require(_0x0e1a('0x8'));var csv=require(_0x0e1a('0x9'));var ejs=require(_0x0e1a('0xa'));var fs=require('fs');var fs_extra=require(_0x0e1a('0xb'));var _=require(_0x0e1a('0xc'));var squel=require(_0x0e1a('0xd'));var crypto=require(_0x0e1a('0xe'));var jsforce=require(_0x0e1a('0xf'));var deskjs=require(_0x0e1a('0x10'));var toCsv=require('to-csv');var querystring=require(_0x0e1a('0x11'));var Papa=require(_0x0e1a('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0e1a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0e1a('0x14'));var logger=require(_0x0e1a('0x15'))(_0x0e1a('0x16'));var utils=require(_0x0e1a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x0e1a('0x18'));var db=require(_0x0e1a('0x19'))['db'];var integrations=require(_0x0e1a('0x1a'));function respondWithStatusCode(_0x88bee6,_0xd7476){_0xd7476=_0xd7476||0xcc;return function(_0x302469){if(_0x302469){return _0x88bee6[_0x0e1a('0x1b')](_0xd7476);}return _0x88bee6[_0x0e1a('0x1c')](_0xd7476)['end']();};}function respondWithResult(_0x3876bc,_0xea2e2){_0xea2e2=_0xea2e2||0xc8;return function(_0x4399e3){if(_0x4399e3){return _0x3876bc[_0x0e1a('0x1c')](_0xea2e2)['json'](_0x4399e3);}};}function respondWithFilteredResult(_0x2ef7b4,_0x2cf13c){return function(_0x5c696b){if(_0x5c696b){var _0x5b304a=typeof _0x2cf13c[_0x0e1a('0x1d')]===_0x0e1a('0x1e')&&typeof _0x2cf13c['limit']==='undefined';var _0x313324=_0x5c696b[_0x0e1a('0x1f')];var _0x5c917f=_0x5b304a?0x0:_0x2cf13c[_0x0e1a('0x1d')];var _0x524391=_0x5b304a?_0x5c696b['count']:_0x2cf13c[_0x0e1a('0x1d')]+_0x2cf13c[_0x0e1a('0x20')];var _0x9661d8;if(_0x524391>=_0x313324){_0x524391=_0x313324;_0x9661d8=0xc8;}else{_0x9661d8=0xce;}_0x2ef7b4[_0x0e1a('0x1c')](_0x9661d8);return _0x2ef7b4[_0x0e1a('0x21')]('Content-Range',_0x5c917f+'-'+_0x524391+'/'+_0x313324)[_0x0e1a('0x22')](_0x5c696b);}return null;};}function patchUpdates(_0x13744d){return function(_0x56716b){try{jsonpatch[_0x0e1a('0x23')](_0x56716b,_0x13744d,!![]);}catch(_0x12c1bd){return BPromise[_0x0e1a('0x24')](_0x12c1bd);}return _0x56716b[_0x0e1a('0x25')]();};}function saveUpdates(_0xd8d753,_0x3a2243){return function(_0x4afb4e){if(_0x4afb4e){return _0x4afb4e[_0x0e1a('0x26')](_0xd8d753)['then'](function(_0x59c657){return _0x59c657;});}return null;};}function removeEntity(_0x4a8644,_0x39a487){return function(_0x4e39c1){if(_0x4e39c1){return _0x4e39c1[_0x0e1a('0x27')]()[_0x0e1a('0x28')](function(){_0x4a8644['status'](0xcc)[_0x0e1a('0x29')]();});}};}function handleEntityNotFound(_0x2e34b8,_0x5c29b3){return function(_0x224c12){if(!_0x224c12){_0x2e34b8[_0x0e1a('0x1b')](0x194);}return _0x224c12;};}function handleError(_0x133be8,_0xe9e9ad){_0xe9e9ad=_0xe9e9ad||0x1f4;return function(_0x4a51b7){logger[_0x0e1a('0x2a')](_0x4a51b7['stack']);if(_0x4a51b7[_0x0e1a('0x2b')]){delete _0x4a51b7[_0x0e1a('0x2b')];}_0x133be8[_0x0e1a('0x1c')](_0xe9e9ad)['send'](_0x4a51b7);};}exports[_0x0e1a('0x2c')]=function(_0x125cbd,_0x5d1d5e){var _0x49981a={},_0x285776={},_0x388a62={'count':0x0,'rows':[]};var _0x5846fd=_[_0x0e1a('0x2d')](db[_0x0e1a('0x2e')]['rawAttributes'],function(_0x296697){return{'name':_0x296697[_0x0e1a('0x2f')],'type':_0x296697[_0x0e1a('0x30')]['key']};});_0x285776[_0x0e1a('0x31')]=_[_0x0e1a('0x2d')](_0x5846fd,_0x0e1a('0x2b'));_0x285776['query']=_['keys'](_0x125cbd['query']);_0x285776['filters']=_[_0x0e1a('0x32')](_0x285776['model'],_0x285776['query']);_0x49981a[_0x0e1a('0x33')]=_[_0x0e1a('0x32')](_0x285776['model'],qs[_0x0e1a('0x34')](_0x125cbd['query']['fields']));_0x49981a[_0x0e1a('0x33')]=_0x49981a[_0x0e1a('0x33')][_0x0e1a('0x35')]?_0x49981a['attributes']:_0x285776[_0x0e1a('0x31')];if(!_0x125cbd[_0x0e1a('0x36')][_0x0e1a('0x37')]('nolimit')){_0x49981a[_0x0e1a('0x20')]=qs[_0x0e1a('0x20')](_0x125cbd[_0x0e1a('0x36')][_0x0e1a('0x20')]);_0x49981a[_0x0e1a('0x1d')]=qs['offset'](_0x125cbd[_0x0e1a('0x36')][_0x0e1a('0x1d')]);}_0x49981a[_0x0e1a('0x38')]=qs[_0x0e1a('0x39')](_0x125cbd[_0x0e1a('0x36')][_0x0e1a('0x39')]);_0x49981a['where']=qs[_0x0e1a('0x3a')](_[_0x0e1a('0x3b')](_0x125cbd[_0x0e1a('0x36')],_0x285776['filters']),_0x5846fd);if(_0x125cbd[_0x0e1a('0x36')]['filter']){_0x49981a[_0x0e1a('0x3c')]=_[_0x0e1a('0x3d')](_0x49981a[_0x0e1a('0x3c')],{'$or':_[_0x0e1a('0x2d')](_0x5846fd,function(_0x1dc76d){if(_0x1dc76d[_0x0e1a('0x30')]!==_0x0e1a('0x3e')){var _0x4ccd8d={};_0x4ccd8d[_0x1dc76d[_0x0e1a('0x2b')]]={'$like':'%'+_0x125cbd['query'][_0x0e1a('0x3f')]+'%'};return _0x4ccd8d;}})});}_0x49981a=_[_0x0e1a('0x3d')]({},_0x49981a,_0x125cbd['options']);var _0xdc5ca={'where':_0x49981a[_0x0e1a('0x3c')]};return db[_0x0e1a('0x2e')][_0x0e1a('0x1f')](_0xdc5ca)[_0x0e1a('0x28')](function(_0x189d12){_0x388a62[_0x0e1a('0x1f')]=_0x189d12;if(_0x125cbd[_0x0e1a('0x36')][_0x0e1a('0x40')]){_0x49981a[_0x0e1a('0x41')]=[{'all':!![]}];}return db[_0x0e1a('0x2e')]['findAll'](_0x49981a);})[_0x0e1a('0x28')](function(_0x1c01fe){_0x388a62[_0x0e1a('0x42')]=_0x1c01fe;return _0x388a62;})[_0x0e1a('0x28')](respondWithFilteredResult(_0x5d1d5e,_0x49981a))[_0x0e1a('0x43')](handleError(_0x5d1d5e,null));};exports[_0x0e1a('0x44')]=function(_0x514494,_0x344834){var _0x5871da={'raw':![],'where':{'id':_0x514494[_0x0e1a('0x45')]['id']}},_0x3c0b7d={};_0x3c0b7d['model']=_[_0x0e1a('0x46')](db[_0x0e1a('0x2e')][_0x0e1a('0x47')]);_0x3c0b7d[_0x0e1a('0x36')]=_[_0x0e1a('0x46')](_0x514494[_0x0e1a('0x36')]);_0x3c0b7d[_0x0e1a('0x3a')]=_[_0x0e1a('0x32')](_0x3c0b7d[_0x0e1a('0x31')],_0x3c0b7d[_0x0e1a('0x36')]);_0x5871da[_0x0e1a('0x33')]=_['intersection'](_0x3c0b7d[_0x0e1a('0x31')],qs['fields'](_0x514494['query'][_0x0e1a('0x34')]));_0x5871da[_0x0e1a('0x33')]=_0x5871da['attributes'][_0x0e1a('0x35')]?_0x5871da['attributes']:_0x3c0b7d['model'];if(_0x514494['query'][_0x0e1a('0x40')]){_0x5871da['include']=[{'all':!![]}];}_0x5871da=_[_0x0e1a('0x3d')]({},_0x5871da,_0x514494[_0x0e1a('0x48')]);return db[_0x0e1a('0x2e')]['find'](_0x5871da)[_0x0e1a('0x28')](handleEntityNotFound(_0x344834,null))[_0x0e1a('0x28')](respondWithResult(_0x344834,null))['catch'](handleError(_0x344834,null));};exports['create']=function(_0x2ffc8c,_0x513b89){return db[_0x0e1a('0x2e')][_0x0e1a('0x49')](_0x2ffc8c[_0x0e1a('0x4a')],{})['then'](respondWithResult(_0x513b89,0xc9))[_0x0e1a('0x43')](handleError(_0x513b89,null));};exports[_0x0e1a('0x26')]=function(_0x20ee1c,_0x10bf59){if(_0x20ee1c['body']['id']){delete _0x20ee1c[_0x0e1a('0x4a')]['id'];}return db['FreshsalesAccount']['find']({'where':{'id':_0x20ee1c[_0x0e1a('0x45')]['id']}})[_0x0e1a('0x28')](handleEntityNotFound(_0x10bf59,null))['then'](saveUpdates(_0x20ee1c[_0x0e1a('0x4a')],null))[_0x0e1a('0x28')](respondWithResult(_0x10bf59,null))[_0x0e1a('0x43')](handleError(_0x10bf59,null));};exports['destroy']=function(_0x563d51,_0x5a2e8b){return db['FreshsalesAccount']['find']({'where':{'id':_0x563d51[_0x0e1a('0x45')]['id']}})[_0x0e1a('0x28')](handleEntityNotFound(_0x5a2e8b,null))[_0x0e1a('0x28')](removeEntity(_0x5a2e8b,null))['catch'](handleError(_0x5a2e8b,null));};exports['getConfigurations']=function(_0x13ae7c,_0x29e930,_0x3352ff){var _0x5da50c={};var _0x29c42f={};var _0x161069;var _0x1f59e2;return db[_0x0e1a('0x2e')]['findOne']({'where':{'id':_0x13ae7c[_0x0e1a('0x45')]['id']}})[_0x0e1a('0x28')](handleEntityNotFound(_0x29e930,null))['then'](function(_0x4aafa6){if(_0x4aafa6){_0x161069=_0x4aafa6;_0x29c42f[_0x0e1a('0x31')]=_[_0x0e1a('0x46')](db[_0x0e1a('0x4b')][_0x0e1a('0x47')]);_0x29c42f[_0x0e1a('0x36')]=_[_0x0e1a('0x46')](_0x13ae7c[_0x0e1a('0x36')]);_0x29c42f[_0x0e1a('0x3a')]=_[_0x0e1a('0x32')](_0x29c42f['model'],_0x29c42f['query']);_0x5da50c['attributes']=_[_0x0e1a('0x32')](_0x29c42f[_0x0e1a('0x31')],qs[_0x0e1a('0x34')](_0x13ae7c['query'][_0x0e1a('0x34')]));_0x5da50c[_0x0e1a('0x33')]=_0x5da50c[_0x0e1a('0x33')][_0x0e1a('0x35')]?_0x5da50c['attributes']:_0x29c42f['model'];_0x5da50c[_0x0e1a('0x38')]=qs[_0x0e1a('0x39')](_0x13ae7c[_0x0e1a('0x36')][_0x0e1a('0x39')]);_0x5da50c[_0x0e1a('0x3c')]=qs[_0x0e1a('0x3a')](_[_0x0e1a('0x3b')](_0x13ae7c[_0x0e1a('0x36')],_0x29c42f[_0x0e1a('0x3a')]));if(_0x13ae7c[_0x0e1a('0x36')][_0x0e1a('0x3f')]){_0x5da50c['where']=_[_0x0e1a('0x3d')](_0x5da50c['where'],{'$or':_[_0x0e1a('0x2d')](_0x5da50c[_0x0e1a('0x33')],function(_0x3cce18){var _0x95df76={};_0x95df76[_0x3cce18]={'$like':'%'+_0x13ae7c[_0x0e1a('0x36')][_0x0e1a('0x3f')]+'%'};return _0x95df76;})});}_0x5da50c=_[_0x0e1a('0x3d')]({},_0x5da50c,_0x13ae7c['options']);return _0x161069[_0x0e1a('0x4c')](_0x5da50c);}})[_0x0e1a('0x28')](function(_0x5b66f4){if(_0x5b66f4){_0x1f59e2=_0x5b66f4['length'];if(!_0x13ae7c[_0x0e1a('0x36')][_0x0e1a('0x37')](_0x0e1a('0x4d'))){_0x5da50c[_0x0e1a('0x20')]=qs[_0x0e1a('0x20')](_0x13ae7c[_0x0e1a('0x36')][_0x0e1a('0x20')]);_0x5da50c[_0x0e1a('0x1d')]=qs[_0x0e1a('0x1d')](_0x13ae7c[_0x0e1a('0x36')][_0x0e1a('0x1d')]);}return _0x161069[_0x0e1a('0x4c')](_0x5da50c);}})[_0x0e1a('0x28')](function(_0x1951f7){if(_0x1951f7){return _0x1951f7?{'count':_0x1f59e2,'rows':_0x1951f7}:null;}})[_0x0e1a('0x28')](respondWithResult(_0x29e930,null))[_0x0e1a('0x43')](handleError(_0x29e930,null));};exports[_0x0e1a('0x4e')]=function(_0x26034a,_0x398538,_0x492657){if(_0x26034a['body']['id']){delete _0x26034a[_0x0e1a('0x4a')]['id'];}return db[_0x0e1a('0x2e')]['findOne']({'where':{'id':_0x26034a[_0x0e1a('0x45')]['id']}})[_0x0e1a('0x28')](handleEntityNotFound(_0x398538,null))['then'](function(_0x2406a5){if(_0x2406a5){_0x26034a[_0x0e1a('0x4a')][_0x0e1a('0x4f')]=_0x2406a5['id'];_0x26034a[_0x0e1a('0x4a')]['Subjects']=integrations[_0x0e1a('0x50')](_0x26034a[_0x0e1a('0x4a')][_0x0e1a('0x51')],_0x26034a[_0x0e1a('0x4a')][_0x0e1a('0x30')]);_0x26034a[_0x0e1a('0x4a')][_0x0e1a('0x52')]=integrations[_0x0e1a('0x53')](_0x26034a[_0x0e1a('0x4a')][_0x0e1a('0x51')],_0x26034a[_0x0e1a('0x4a')][_0x0e1a('0x30')]);return db[_0x0e1a('0x4b')][_0x0e1a('0x49')](_0x26034a['body'],{'include':[{'model':db['FreshsalesField'],'as':'Subjects'},{'model':db['FreshsalesField'],'as':_0x0e1a('0x52')}]});}return null;})[_0x0e1a('0x28')](respondWithResult(_0x398538,null))[_0x0e1a('0x43')](handleError(_0x398538,null));};exports[_0x0e1a('0x54')]=function(_0x50e5b8,_0x527134,_0x2c4630){var _0x37034a='';var _0x5be79c='';return db['FreshsalesAccount']['findOne']({'where':{'id':_0x50e5b8[_0x0e1a('0x45')]['id']},'attributes':['id','username',_0x0e1a('0x55'),_0x0e1a('0x56')]})[_0x0e1a('0x28')](handleEntityNotFound(_0x527134,null))[_0x0e1a('0x28')](function(_0x363fc2){if(_0x363fc2){_0x5be79c=_0x363fc2[_0x0e1a('0x57')];_0x37034a=_0x363fc2['remoteUri'];var _0x490269=_0x363fc2[_0x0e1a('0x55')][_0x0e1a('0x58')](-0x1);if(_0x490269==='/'){_0x37034a=_0x37034a[_0x0e1a('0x59')](0x0,_0x37034a[_0x0e1a('0x5a')](_0x490269));}return rp({'method':'GET','uri':util[_0x0e1a('0x5b')]('%s%s',_0x37034a,'/api/selector/owners'),'headers':{'Authorization':'Token\x20token='+_0x363fc2['apiKey']},'json':!![]});}})[_0x0e1a('0x28')](function(_0x4fc98a){if(_0x4fc98a){var _0x1d4796=_0x4fc98a[_0x0e1a('0x5c')];var _0x3cdf31=![];var _0x3829af=null;for(_0x3829af=0x0;_0x3829af<_0x1d4796[_0x0e1a('0x35')];_0x3829af++){if(_0x1d4796[_0x3829af][_0x0e1a('0x5d')]===_0x5be79c){_0x3cdf31=!![];}}if(_0x3cdf31){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x0e1a('0x5e')});}}})[_0x0e1a('0x28')](respondWithResult(_0x527134,null))[_0x0e1a('0x43')](function(_0x123b02){var _0xc01f3=_0x50e5b8[_0x0e1a('0x36')][_0x0e1a('0x5f')]?0x1f4:_0x123b02['statusCode']||0x1f4;logger[_0x0e1a('0x2a')]('getFields,\x20%s,\x20%s,\x20%s',_0x0e1a('0x54'),_0xc01f3,JSON[_0x0e1a('0x60')](_0x123b02));delete _0x123b02[_0x0e1a('0x2b')];if(_0xc01f3===0x191){_0xc01f3=0x190;}_0x527134['status'](_0xc01f3)[_0x0e1a('0x61')](_0x50e5b8[_0x0e1a('0x36')][_0x0e1a('0x5f')]?{'message':'Wrong\x20credentials','statusCode':_0x123b02[_0x0e1a('0x62')]}:_0x123b02);});}; \ No newline at end of file +var _0xd611=['squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject','save','update','then','stack','name','index','map','FreshsalesAccount','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','include','rows','params','includeAll','options','find','catch','create','body','destroy','getConfigurations','findOne','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','FreshsalesField','Subjects','getFields','remoteUri','username','slice','substring','GET','format','/api/selector/owners','Token\x20token=','apiKey','email','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x4b630,_0x151f86){var _0x24f855=function(_0x2ead2a){while(--_0x2ead2a){_0x4b630['push'](_0x4b630['shift']());}};_0x24f855(++_0x151f86);}(_0xd611,0xb8));var _0x1d61=function(_0x30061f,_0x333731){_0x30061f=_0x30061f-0x0;var _0x4d76bf=_0xd611[_0x30061f];return _0x4d76bf;};'use strict';var emlformat=require(_0x1d61('0x0'));var rimraf=require(_0x1d61('0x1'));var zipdir=require(_0x1d61('0x2'));var jsonpatch=require(_0x1d61('0x3'));var rp=require(_0x1d61('0x4'));var moment=require(_0x1d61('0x5'));var BPromise=require(_0x1d61('0x6'));var Mustache=require(_0x1d61('0x7'));var util=require(_0x1d61('0x8'));var path=require(_0x1d61('0x9'));var sox=require(_0x1d61('0xa'));var csv=require(_0x1d61('0xb'));var ejs=require(_0x1d61('0xc'));var fs=require('fs');var fs_extra=require(_0x1d61('0xd'));var _=require('lodash');var squel=require(_0x1d61('0xe'));var crypto=require(_0x1d61('0xf'));var jsforce=require(_0x1d61('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x1d61('0xb'));var querystring=require('querystring');var Papa=require(_0x1d61('0x11'));var Redis=require(_0x1d61('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x1d61('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1d61('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1d61('0x15'));var config=require(_0x1d61('0x16'));var licenseUtil=require(_0x1d61('0x17'));var db=require(_0x1d61('0x18'))['db'];var integrations=require(_0x1d61('0x19'));function respondWithStatusCode(_0xd1aa62,_0x535323){_0x535323=_0x535323||0xcc;return function(_0x11286c){if(_0x11286c){return _0xd1aa62[_0x1d61('0x1a')](_0x535323);}return _0xd1aa62[_0x1d61('0x1b')](_0x535323)[_0x1d61('0x1c')]();};}function respondWithResult(_0x554629,_0x6d90bc){_0x6d90bc=_0x6d90bc||0xc8;return function(_0x4e1b02){if(_0x4e1b02){return _0x554629['status'](_0x6d90bc)[_0x1d61('0x1d')](_0x4e1b02);}};}function respondWithFilteredResult(_0x4f1e63,_0x379bf2){return function(_0x49dd9e){if(_0x49dd9e){var _0x4c96bc=typeof _0x379bf2[_0x1d61('0x1e')]==='undefined'&&typeof _0x379bf2['limit']==='undefined';var _0x5098=_0x49dd9e['count'];var _0x14aabe=_0x4c96bc?0x0:_0x379bf2[_0x1d61('0x1e')];var _0x163a7e=_0x4c96bc?_0x49dd9e[_0x1d61('0x1f')]:_0x379bf2[_0x1d61('0x1e')]+_0x379bf2[_0x1d61('0x20')];var _0xae248a;if(_0x163a7e>=_0x5098){_0x163a7e=_0x5098;_0xae248a=0xc8;}else{_0xae248a=0xce;}_0x4f1e63[_0x1d61('0x1b')](_0xae248a);return _0x4f1e63[_0x1d61('0x21')](_0x1d61('0x22'),_0x14aabe+'-'+_0x163a7e+'/'+_0x5098)[_0x1d61('0x1d')](_0x49dd9e);}return null;};}function patchUpdates(_0x492323){return function(_0x2d0fc6){try{jsonpatch[_0x1d61('0x23')](_0x2d0fc6,_0x492323,!![]);}catch(_0x2db547){return BPromise[_0x1d61('0x24')](_0x2db547);}return _0x2d0fc6[_0x1d61('0x25')]();};}function saveUpdates(_0x1b959f,_0x14caed){return function(_0x311241){if(_0x311241){return _0x311241[_0x1d61('0x26')](_0x1b959f)[_0x1d61('0x27')](function(_0x187aac){return _0x187aac;});}return null;};}function removeEntity(_0xe6cb89,_0x42bf40){return function(_0x3b3658){if(_0x3b3658){return _0x3b3658['destroy']()[_0x1d61('0x27')](function(){_0xe6cb89[_0x1d61('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43e1d5,_0x43856e){return function(_0x35210b){if(!_0x35210b){_0x43e1d5[_0x1d61('0x1a')](0x194);}return _0x35210b;};}function handleError(_0x2876b0,_0x1d858d){_0x1d858d=_0x1d858d||0x1f4;return function(_0x1bed1c){logger['error'](_0x1bed1c[_0x1d61('0x28')]);if(_0x1bed1c[_0x1d61('0x29')]){delete _0x1bed1c[_0x1d61('0x29')];}_0x2876b0['status'](_0x1d858d)['send'](_0x1bed1c);};}exports[_0x1d61('0x2a')]=function(_0x1db9b0,_0x30fdad){var _0x2dcfd8={},_0xedca83={},_0x335f35={'count':0x0,'rows':[]};var _0x1f5b74=_[_0x1d61('0x2b')](db[_0x1d61('0x2c')][_0x1d61('0x2d')],function(_0x1f73d7){return{'name':_0x1f73d7[_0x1d61('0x2e')],'type':_0x1f73d7[_0x1d61('0x2f')]['key']};});_0xedca83[_0x1d61('0x30')]=_['map'](_0x1f5b74,'name');_0xedca83['query']=_[_0x1d61('0x31')](_0x1db9b0[_0x1d61('0x32')]);_0xedca83[_0x1d61('0x33')]=_[_0x1d61('0x34')](_0xedca83[_0x1d61('0x30')],_0xedca83[_0x1d61('0x32')]);_0x2dcfd8['attributes']=_[_0x1d61('0x34')](_0xedca83[_0x1d61('0x30')],qs[_0x1d61('0x35')](_0x1db9b0[_0x1d61('0x32')][_0x1d61('0x35')]));_0x2dcfd8[_0x1d61('0x36')]=_0x2dcfd8['attributes'][_0x1d61('0x37')]?_0x2dcfd8['attributes']:_0xedca83['model'];if(!_0x1db9b0[_0x1d61('0x32')]['hasOwnProperty'](_0x1d61('0x38'))){_0x2dcfd8['limit']=qs['limit'](_0x1db9b0[_0x1d61('0x32')][_0x1d61('0x20')]);_0x2dcfd8[_0x1d61('0x1e')]=qs[_0x1d61('0x1e')](_0x1db9b0[_0x1d61('0x32')][_0x1d61('0x1e')]);}_0x2dcfd8[_0x1d61('0x39')]=qs['sort'](_0x1db9b0[_0x1d61('0x32')][_0x1d61('0x3a')]);_0x2dcfd8[_0x1d61('0x3b')]=qs[_0x1d61('0x33')](_[_0x1d61('0x3c')](_0x1db9b0[_0x1d61('0x32')],_0xedca83[_0x1d61('0x33')]),_0x1f5b74);if(_0x1db9b0[_0x1d61('0x32')][_0x1d61('0x3d')]){_0x2dcfd8[_0x1d61('0x3b')]=_[_0x1d61('0x3e')](_0x2dcfd8[_0x1d61('0x3b')],{'$or':_[_0x1d61('0x2b')](_0x1f5b74,function(_0xfc2f61){if(_0xfc2f61[_0x1d61('0x2f')]!=='VIRTUAL'){var _0x20ad9a={};_0x20ad9a[_0xfc2f61[_0x1d61('0x29')]]={'$like':'%'+_0x1db9b0[_0x1d61('0x32')][_0x1d61('0x3d')]+'%'};return _0x20ad9a;}})});}_0x2dcfd8=_[_0x1d61('0x3e')]({},_0x2dcfd8,_0x1db9b0['options']);var _0x517e7b={'where':_0x2dcfd8[_0x1d61('0x3b')]};return db['FreshsalesAccount']['count'](_0x517e7b)['then'](function(_0x1a5238){_0x335f35['count']=_0x1a5238;if(_0x1db9b0[_0x1d61('0x32')]['includeAll']){_0x2dcfd8[_0x1d61('0x3f')]=[{'all':!![]}];}return db[_0x1d61('0x2c')]['findAll'](_0x2dcfd8);})['then'](function(_0x477a2d){_0x335f35[_0x1d61('0x40')]=_0x477a2d;return _0x335f35;})['then'](respondWithFilteredResult(_0x30fdad,_0x2dcfd8))['catch'](handleError(_0x30fdad,null));};exports['show']=function(_0x385888,_0x3c458e){var _0x46077f={'raw':![],'where':{'id':_0x385888[_0x1d61('0x41')]['id']}},_0x174cf7={};_0x174cf7['model']=_['keys'](db[_0x1d61('0x2c')][_0x1d61('0x2d')]);_0x174cf7[_0x1d61('0x32')]=_['keys'](_0x385888[_0x1d61('0x32')]);_0x174cf7[_0x1d61('0x33')]=_[_0x1d61('0x34')](_0x174cf7[_0x1d61('0x30')],_0x174cf7[_0x1d61('0x32')]);_0x46077f[_0x1d61('0x36')]=_[_0x1d61('0x34')](_0x174cf7['model'],qs[_0x1d61('0x35')](_0x385888[_0x1d61('0x32')][_0x1d61('0x35')]));_0x46077f[_0x1d61('0x36')]=_0x46077f[_0x1d61('0x36')][_0x1d61('0x37')]?_0x46077f[_0x1d61('0x36')]:_0x174cf7['model'];if(_0x385888[_0x1d61('0x32')][_0x1d61('0x42')]){_0x46077f['include']=[{'all':!![]}];}_0x46077f=_['merge']({},_0x46077f,_0x385888[_0x1d61('0x43')]);return db[_0x1d61('0x2c')][_0x1d61('0x44')](_0x46077f)[_0x1d61('0x27')](handleEntityNotFound(_0x3c458e,null))[_0x1d61('0x27')](respondWithResult(_0x3c458e,null))[_0x1d61('0x45')](handleError(_0x3c458e,null));};exports[_0x1d61('0x46')]=function(_0x1f3f81,_0xcb66bf){return db[_0x1d61('0x2c')]['create'](_0x1f3f81['body'],{})[_0x1d61('0x27')](respondWithResult(_0xcb66bf,0xc9))[_0x1d61('0x45')](handleError(_0xcb66bf,null));};exports[_0x1d61('0x26')]=function(_0x26aab9,_0x2e39e6){if(_0x26aab9[_0x1d61('0x47')]['id']){delete _0x26aab9[_0x1d61('0x47')]['id'];}return db[_0x1d61('0x2c')][_0x1d61('0x44')]({'where':{'id':_0x26aab9[_0x1d61('0x41')]['id']}})[_0x1d61('0x27')](handleEntityNotFound(_0x2e39e6,null))['then'](saveUpdates(_0x26aab9[_0x1d61('0x47')],null))['then'](respondWithResult(_0x2e39e6,null))[_0x1d61('0x45')](handleError(_0x2e39e6,null));};exports[_0x1d61('0x48')]=function(_0x2a81d3,_0x4c1cc8){return db['FreshsalesAccount'][_0x1d61('0x44')]({'where':{'id':_0x2a81d3[_0x1d61('0x41')]['id']}})[_0x1d61('0x27')](handleEntityNotFound(_0x4c1cc8,null))[_0x1d61('0x27')](removeEntity(_0x4c1cc8,null))[_0x1d61('0x45')](handleError(_0x4c1cc8,null));};exports[_0x1d61('0x49')]=function(_0x21b552,_0xe46020,_0x571291){var _0x443325={};var _0x491635={};var _0x43389d;var _0xd79dc8;return db[_0x1d61('0x2c')][_0x1d61('0x4a')]({'where':{'id':_0x21b552['params']['id']}})[_0x1d61('0x27')](handleEntityNotFound(_0xe46020,null))[_0x1d61('0x27')](function(_0x518a52){if(_0x518a52){_0x43389d=_0x518a52;_0x491635[_0x1d61('0x30')]=_[_0x1d61('0x31')](db['FreshsalesConfiguration'][_0x1d61('0x2d')]);_0x491635['query']=_[_0x1d61('0x31')](_0x21b552[_0x1d61('0x32')]);_0x491635[_0x1d61('0x33')]=_[_0x1d61('0x34')](_0x491635[_0x1d61('0x30')],_0x491635[_0x1d61('0x32')]);_0x443325['attributes']=_[_0x1d61('0x34')](_0x491635['model'],qs['fields'](_0x21b552[_0x1d61('0x32')][_0x1d61('0x35')]));_0x443325[_0x1d61('0x36')]=_0x443325[_0x1d61('0x36')]['length']?_0x443325['attributes']:_0x491635[_0x1d61('0x30')];_0x443325[_0x1d61('0x39')]=qs[_0x1d61('0x3a')](_0x21b552[_0x1d61('0x32')][_0x1d61('0x3a')]);_0x443325[_0x1d61('0x3b')]=qs[_0x1d61('0x33')](_[_0x1d61('0x3c')](_0x21b552[_0x1d61('0x32')],_0x491635['filters']));if(_0x21b552['query'][_0x1d61('0x3d')]){_0x443325['where']=_['merge'](_0x443325[_0x1d61('0x3b')],{'$or':_[_0x1d61('0x2b')](_0x443325['attributes'],function(_0x29c1a9){var _0x407853={};_0x407853[_0x29c1a9]={'$like':'%'+_0x21b552[_0x1d61('0x32')]['filter']+'%'};return _0x407853;})});}_0x443325=_[_0x1d61('0x3e')]({},_0x443325,_0x21b552[_0x1d61('0x43')]);return _0x43389d[_0x1d61('0x49')](_0x443325);}})[_0x1d61('0x27')](function(_0x46a1f2){if(_0x46a1f2){_0xd79dc8=_0x46a1f2[_0x1d61('0x37')];if(!_0x21b552['query']['hasOwnProperty'](_0x1d61('0x38'))){_0x443325[_0x1d61('0x20')]=qs[_0x1d61('0x20')](_0x21b552['query'][_0x1d61('0x20')]);_0x443325['offset']=qs[_0x1d61('0x1e')](_0x21b552[_0x1d61('0x32')][_0x1d61('0x1e')]);}return _0x43389d[_0x1d61('0x49')](_0x443325);}})[_0x1d61('0x27')](function(_0x14d558){if(_0x14d558){return _0x14d558?{'count':_0xd79dc8,'rows':_0x14d558}:null;}})[_0x1d61('0x27')](respondWithResult(_0xe46020,null))[_0x1d61('0x45')](handleError(_0xe46020,null));};exports[_0x1d61('0x4b')]=function(_0x4a619e,_0x87fbd1,_0x34d67e){if(_0x4a619e[_0x1d61('0x47')]['id']){delete _0x4a619e[_0x1d61('0x47')]['id'];}return db[_0x1d61('0x2c')][_0x1d61('0x4a')]({'where':{'id':_0x4a619e[_0x1d61('0x41')]['id']}})[_0x1d61('0x27')](handleEntityNotFound(_0x87fbd1,null))['then'](function(_0x4ddbd7){if(_0x4ddbd7){_0x4a619e[_0x1d61('0x47')][_0x1d61('0x4c')]=_0x4ddbd7['id'];_0x4a619e[_0x1d61('0x47')]['Subjects']=integrations[_0x1d61('0x4d')](_0x4a619e[_0x1d61('0x47')]['channel'],_0x4a619e[_0x1d61('0x47')][_0x1d61('0x2f')]);_0x4a619e[_0x1d61('0x47')][_0x1d61('0x4e')]=integrations[_0x1d61('0x4f')](_0x4a619e[_0x1d61('0x47')]['channel'],_0x4a619e[_0x1d61('0x47')][_0x1d61('0x2f')]);return db['FreshsalesConfiguration']['create'](_0x4a619e[_0x1d61('0x47')],{'include':[{'model':db[_0x1d61('0x50')],'as':_0x1d61('0x51')},{'model':db[_0x1d61('0x50')],'as':_0x1d61('0x4e')}]});}return null;})[_0x1d61('0x27')](respondWithResult(_0x87fbd1,null))['catch'](handleError(_0x87fbd1,null));};exports[_0x1d61('0x52')]=function(_0x48727b,_0x2c66bc,_0x5c176f){var _0x3bfd3e='';var _0x283bfb='';return db[_0x1d61('0x2c')]['findOne']({'where':{'id':_0x48727b[_0x1d61('0x41')]['id']},'attributes':['id','username',_0x1d61('0x53'),'apiKey']})[_0x1d61('0x27')](handleEntityNotFound(_0x2c66bc,null))[_0x1d61('0x27')](function(_0x3d1239){if(_0x3d1239){_0x283bfb=_0x3d1239[_0x1d61('0x54')];_0x3bfd3e=_0x3d1239[_0x1d61('0x53')];var _0x33b587=_0x3d1239[_0x1d61('0x53')][_0x1d61('0x55')](-0x1);if(_0x33b587==='/'){_0x3bfd3e=_0x3bfd3e[_0x1d61('0x56')](0x0,_0x3bfd3e['lastIndexOf'](_0x33b587));}return rp({'method':_0x1d61('0x57'),'uri':util[_0x1d61('0x58')]('%s%s',_0x3bfd3e,_0x1d61('0x59')),'headers':{'Authorization':_0x1d61('0x5a')+_0x3d1239[_0x1d61('0x5b')]},'json':!![]});}})['then'](function(_0x78a0e6){if(_0x78a0e6){var _0x35245a=_0x78a0e6['users'];var _0x27c831=![];var _0x497c37=null;for(_0x497c37=0x0;_0x497c37<_0x35245a['length'];_0x497c37++){if(_0x35245a[_0x497c37][_0x1d61('0x5c')]===_0x283bfb){_0x27c831=!![];}}if(_0x27c831){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x1d61('0x27')](respondWithResult(_0x2c66bc,null))[_0x1d61('0x45')](function(_0x4f1292){var _0x2bb9e3=_0x48727b['query'][_0x1d61('0x5d')]?0x1f4:_0x4f1292[_0x1d61('0x5e')]||0x1f4;logger['error'](_0x1d61('0x5f'),'getFields',_0x2bb9e3,JSON[_0x1d61('0x60')](_0x4f1292));delete _0x4f1292[_0x1d61('0x29')];if(_0x2bb9e3===0x191){_0x2bb9e3=0x190;}_0x2c66bc[_0x1d61('0x1b')](_0x2bb9e3)[_0x1d61('0x61')](_0x48727b['query']['test']?{'message':_0x1d61('0x62'),'statusCode':_0x4f1292['statusCode']}:_0x4f1292);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 4ed4b17..4f39b88 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 _0xb145=['request-promise','path','rimraf','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','util','../../config/logger','api','moment','bluebird'];(function(_0x323abb,_0x37c6ce){var _0x18f2ce=function(_0xfb6565){while(--_0xfb6565){_0x323abb['push'](_0x323abb['shift']());}};_0x18f2ce(++_0x37c6ce);}(_0xb145,0xa3));var _0x5b14=function(_0x367310,_0x460860){_0x367310=_0x367310-0x0;var _0x22bce5=_0xb145[_0x367310];return _0x22bce5;};'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'));var integrations=require(_0x5b14('0x9'));module[_0x5b14('0xa')]=function(_0x4d82ad,_0x50fd91){return _0x4d82ad[_0x5b14('0xb')](_0x5b14('0xc'),attributes,{'tableName':_0x5b14('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3a6d=['api','moment','bluebird','request-promise','path','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','FreshsalesAccount','int_freshsales_accounts','lodash','util'];(function(_0x335549,_0x58caa2){var _0x18ec8a=function(_0x52dcc4){while(--_0x52dcc4){_0x335549['push'](_0x335549['shift']());}};_0x18ec8a(++_0x58caa2);}(_0x3a6d,0x143));var _0xd3a6=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x3a6d[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0xd3a6('0x0'));var util=require(_0xd3a6('0x1'));var logger=require('../../config/logger')(_0xd3a6('0x2'));var moment=require(_0xd3a6('0x3'));var BPromise=require(_0xd3a6('0x4'));var rp=require(_0xd3a6('0x5'));var fs=require('fs');var path=require(_0xd3a6('0x6'));var rimraf=require('rimraf');var config=require(_0xd3a6('0x7'));var attributes=require(_0xd3a6('0x8'));var integrations=require(_0xd3a6('0x9'));module[_0xd3a6('0xa')]=function(_0x25b042,_0x282cb1){return _0x25b042['define'](_0xd3a6('0xb'),attributes,{'tableName':_0xd3a6('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 00866ee..41d23aa 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 _0x1893=['request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','include','map','model','catch','ShowFreshsalesAccount','find','then','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','FreshsalesAccount,\x20%s,\x20%s'];(function(_0x16d097,_0x570971){var _0x5a3779=function(_0x18f389){while(--_0x18f389){_0x16d097['push'](_0x16d097['shift']());}};_0x5a3779(++_0x570971);}(_0x1893,0xa2));var _0x3189=function(_0x3813ad,_0x2eff01){_0x3813ad=_0x3813ad-0x0;var _0x16ed55=_0x1893[_0x3813ad];return _0x16ed55;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3189('0x0'));var BPromise=require(_0x3189('0x1'));var rs=require(_0x3189('0x2'));var fs=require('fs');var Redis=require(_0x3189('0x3'));var db=require(_0x3189('0x4'))['db'];var utils=require(_0x3189('0x5'));var logger=require(_0x3189('0x6'))('rpc');var config=require(_0x3189('0x7'));var jayson=require(_0x3189('0x8'));var client=jayson[_0x3189('0x9')][_0x3189('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x77c566,_0x118970,_0x14d84b){return new BPromise(function(_0x1f6764,_0x5312a3){return client[_0x3189('0xb')](_0x77c566,_0x14d84b)['then'](function(_0x127449){logger['info'](_0x3189('0xc'),_0x118970,_0x3189('0xd'));logger[_0x3189('0xe')](_0x3189('0xf'),_0x118970,'request\x20sent',JSON[_0x3189('0x10')](_0x127449));if(_0x127449[_0x3189('0x11')]){if(_0x127449[_0x3189('0x11')][_0x3189('0x12')]===0x1f4){logger[_0x3189('0x11')]('FreshsalesAccount,\x20%s,\x20%s',_0x118970,_0x127449[_0x3189('0x11')][_0x3189('0x13')]);return _0x5312a3(_0x127449[_0x3189('0x11')][_0x3189('0x13')]);}logger[_0x3189('0x11')](_0x3189('0xc'),_0x118970,_0x127449[_0x3189('0x11')][_0x3189('0x13')]);return _0x1f6764(_0x127449['error'][_0x3189('0x13')]);}else{logger[_0x3189('0x14')](_0x3189('0xc'),_0x118970,_0x3189('0xd'));_0x1f6764(_0x127449['result'][_0x3189('0x13')]);}})['catch'](function(_0x55f432){logger[_0x3189('0x11')]('FreshsalesAccount,\x20%s,\x20%s',_0x118970,_0x55f432);_0x5312a3(_0x55f432);});});}exports[_0x3189('0x15')]=function(_0xf8aed7){var _0x22c7ba=this;return new Promise(function(_0x9905c4,_0x4c4d9b){return db[_0x3189('0x16')][_0x3189('0x17')]({'raw':_0xf8aed7[_0x3189('0x18')]?_0xf8aed7['options'][_0x3189('0x19')]===undefined?!![]:![]:!![],'where':_0xf8aed7[_0x3189('0x18')]?_0xf8aed7[_0x3189('0x18')][_0x3189('0x1a')]||null:null,'attributes':_0xf8aed7[_0x3189('0x18')]?_0xf8aed7['options'][_0x3189('0x1b')]||null:null,'limit':_0xf8aed7[_0x3189('0x18')]?_0xf8aed7[_0x3189('0x18')]['limit']||null:null,'include':_0xf8aed7[_0x3189('0x18')]?_0xf8aed7['options'][_0x3189('0x1c')]?_[_0x3189('0x1d')](_0xf8aed7[_0x3189('0x18')][_0x3189('0x1c')],function(_0x1cbe33){return{'model':db[_0x1cbe33[_0x3189('0x1e')]],'as':_0x1cbe33['as'],'attributes':_0x1cbe33['attributes'],'include':_0x1cbe33['include']?_[_0x3189('0x1d')](_0x1cbe33[_0x3189('0x1c')],function(_0x1dc1c8){return{'model':db[_0x1dc1c8[_0x3189('0x1e')]],'as':_0x1dc1c8['as'],'attributes':_0x1dc1c8[_0x3189('0x1b')],'include':_0x1dc1c8[_0x3189('0x1c')]?_[_0x3189('0x1d')](_0x1dc1c8[_0x3189('0x1c')],function(_0x17b540){return{'model':db[_0x17b540[_0x3189('0x1e')]],'as':_0x17b540['as'],'attributes':_0x17b540['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5aa34a){logger[_0x3189('0x14')](_0x3189('0x15'),_0xf8aed7);logger[_0x3189('0xe')](_0x3189('0x15'),_0xf8aed7,JSON[_0x3189('0x10')](_0x5aa34a));_0x9905c4(_0x5aa34a);})[_0x3189('0x1f')](function(_0x4d453a){logger[_0x3189('0x11')](_0x3189('0x15'),_0x4d453a['message'],_0xf8aed7);_0x4c4d9b(_0x22c7ba[_0x3189('0x11')](0x1f4,_0x4d453a[_0x3189('0x13')]));});});};exports[_0x3189('0x20')]=function(_0x5c7a36){var _0x168dc2=this;return new Promise(function(_0x32bba1,_0x23798e){return db['FreshsalesAccount'][_0x3189('0x21')]({'raw':_0x5c7a36[_0x3189('0x18')]?_0x5c7a36['options'][_0x3189('0x19')]===undefined?!![]:![]:!![],'where':_0x5c7a36[_0x3189('0x18')]?_0x5c7a36[_0x3189('0x18')][_0x3189('0x1a')]||null:null,'attributes':_0x5c7a36[_0x3189('0x18')]?_0x5c7a36['options']['attributes']||null:null,'include':_0x5c7a36[_0x3189('0x18')]?_0x5c7a36['options'][_0x3189('0x1c')]?_[_0x3189('0x1d')](_0x5c7a36[_0x3189('0x18')][_0x3189('0x1c')],function(_0x231d72){return{'model':db[_0x231d72[_0x3189('0x1e')]],'as':_0x231d72['as'],'attributes':_0x231d72[_0x3189('0x1b')],'include':_0x231d72[_0x3189('0x1c')]?_[_0x3189('0x1d')](_0x231d72['include'],function(_0x453e4b){return{'model':db[_0x453e4b[_0x3189('0x1e')]],'as':_0x453e4b['as'],'attributes':_0x453e4b[_0x3189('0x1b')],'include':_0x453e4b[_0x3189('0x1c')]?_[_0x3189('0x1d')](_0x453e4b[_0x3189('0x1c')],function(_0xd1ee0){return{'model':db[_0xd1ee0['model']],'as':_0xd1ee0['as'],'attributes':_0xd1ee0['attributes']};}):[]};}):[]};}):[]:[]})[_0x3189('0x22')](function(_0x580064){logger[_0x3189('0x14')](_0x3189('0x20'),_0x5c7a36);logger['debug'](_0x3189('0x20'),_0x5c7a36,JSON[_0x3189('0x10')](_0x580064));_0x32bba1(_0x580064);})[_0x3189('0x1f')](function(_0x254135){logger['error'](_0x3189('0x20'),_0x254135['message'],_0x5c7a36);_0x23798e(_0x168dc2['error'](0x1f4,_0x254135[_0x3189('0x13')]));});});}; \ No newline at end of file +var _0xdf55=['FreshsalesAccount,\x20%s,\x20%s','message','info','result','catch','GetFreshsalesAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','stringify','ShowFreshsalesAccount','FreshsalesAccount','find','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xdf55,0x83));var _0x5df5=function(_0x5eb180,_0x127912){_0x5eb180=_0x5eb180-0x0;var _0xc5f79c=_0xdf55[_0x5eb180];return _0xc5f79c;};'use strict';var _=require(_0x5df5('0x0'));var util=require(_0x5df5('0x1'));var moment=require('moment');var BPromise=require(_0x5df5('0x2'));var rs=require(_0x5df5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5df5('0x4'))['db'];var utils=require(_0x5df5('0x5'));var logger=require(_0x5df5('0x6'))('rpc');var config=require(_0x5df5('0x7'));var jayson=require(_0x5df5('0x8'));var client=jayson[_0x5df5('0x9')][_0x5df5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9b8756,_0x2b7ed9,_0x4722a2){return new BPromise(function(_0x3743f3,_0x4d43a3){return client[_0x5df5('0xb')](_0x9b8756,_0x4722a2)[_0x5df5('0xc')](function(_0x41941e){logger['info']('FreshsalesAccount,\x20%s,\x20%s',_0x2b7ed9,_0x5df5('0xd'));logger['debug'](_0x5df5('0xe'),_0x2b7ed9,_0x5df5('0xd'),JSON['stringify'](_0x41941e));if(_0x41941e['error']){if(_0x41941e[_0x5df5('0xf')][_0x5df5('0x10')]===0x1f4){logger[_0x5df5('0xf')](_0x5df5('0x11'),_0x2b7ed9,_0x41941e[_0x5df5('0xf')][_0x5df5('0x12')]);return _0x4d43a3(_0x41941e[_0x5df5('0xf')][_0x5df5('0x12')]);}logger[_0x5df5('0xf')](_0x5df5('0x11'),_0x2b7ed9,_0x41941e['error'][_0x5df5('0x12')]);return _0x3743f3(_0x41941e['error'][_0x5df5('0x12')]);}else{logger[_0x5df5('0x13')](_0x5df5('0x11'),_0x2b7ed9,_0x5df5('0xd'));_0x3743f3(_0x41941e[_0x5df5('0x14')]['message']);}})[_0x5df5('0x15')](function(_0x457205){logger['error'](_0x5df5('0x11'),_0x2b7ed9,_0x457205);_0x4d43a3(_0x457205);});});}exports[_0x5df5('0x16')]=function(_0xb7e1c2){var _0x44f700=this;return new Promise(function(_0x215d59,_0x4b499d){return db['FreshsalesAccount'][_0x5df5('0x17')]({'raw':_0xb7e1c2['options']?_0xb7e1c2[_0x5df5('0x18')][_0x5df5('0x19')]===undefined?!![]:![]:!![],'where':_0xb7e1c2[_0x5df5('0x18')]?_0xb7e1c2[_0x5df5('0x18')][_0x5df5('0x1a')]||null:null,'attributes':_0xb7e1c2['options']?_0xb7e1c2[_0x5df5('0x18')][_0x5df5('0x1b')]||null:null,'limit':_0xb7e1c2[_0x5df5('0x18')]?_0xb7e1c2[_0x5df5('0x18')][_0x5df5('0x1c')]||null:null,'include':_0xb7e1c2[_0x5df5('0x18')]?_0xb7e1c2['options'][_0x5df5('0x1d')]?_[_0x5df5('0x1e')](_0xb7e1c2[_0x5df5('0x18')][_0x5df5('0x1d')],function(_0x5ca542){return{'model':db[_0x5ca542[_0x5df5('0x1f')]],'as':_0x5ca542['as'],'attributes':_0x5ca542[_0x5df5('0x1b')],'include':_0x5ca542[_0x5df5('0x1d')]?_['map'](_0x5ca542['include'],function(_0x532923){return{'model':db[_0x532923[_0x5df5('0x1f')]],'as':_0x532923['as'],'attributes':_0x532923[_0x5df5('0x1b')],'include':_0x532923[_0x5df5('0x1d')]?_[_0x5df5('0x1e')](_0x532923[_0x5df5('0x1d')],function(_0x1fd83c){return{'model':db[_0x1fd83c[_0x5df5('0x1f')]],'as':_0x1fd83c['as'],'attributes':_0x1fd83c[_0x5df5('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x18bb61){logger['info'](_0x5df5('0x16'),_0xb7e1c2);logger[_0x5df5('0x20')]('GetFreshsalesAccount',_0xb7e1c2,JSON[_0x5df5('0x21')](_0x18bb61));_0x215d59(_0x18bb61);})['catch'](function(_0xd2b213){logger['error'](_0x5df5('0x16'),_0xd2b213['message'],_0xb7e1c2);_0x4b499d(_0x44f700[_0x5df5('0xf')](0x1f4,_0xd2b213['message']));});});};exports[_0x5df5('0x22')]=function(_0x47bebb){var _0x4784ca=this;return new Promise(function(_0x485484,_0xf445de){return db[_0x5df5('0x23')][_0x5df5('0x24')]({'raw':_0x47bebb[_0x5df5('0x18')]?_0x47bebb[_0x5df5('0x18')][_0x5df5('0x19')]===undefined?!![]:![]:!![],'where':_0x47bebb[_0x5df5('0x18')]?_0x47bebb['options']['where']||null:null,'attributes':_0x47bebb[_0x5df5('0x18')]?_0x47bebb[_0x5df5('0x18')][_0x5df5('0x1b')]||null:null,'include':_0x47bebb[_0x5df5('0x18')]?_0x47bebb[_0x5df5('0x18')][_0x5df5('0x1d')]?_['map'](_0x47bebb[_0x5df5('0x18')][_0x5df5('0x1d')],function(_0x2f1001){return{'model':db[_0x2f1001[_0x5df5('0x1f')]],'as':_0x2f1001['as'],'attributes':_0x2f1001['attributes'],'include':_0x2f1001[_0x5df5('0x1d')]?_['map'](_0x2f1001[_0x5df5('0x1d')],function(_0x394676){return{'model':db[_0x394676['model']],'as':_0x394676['as'],'attributes':_0x394676[_0x5df5('0x1b')],'include':_0x394676['include']?_[_0x5df5('0x1e')](_0x394676[_0x5df5('0x1d')],function(_0x4697c2){return{'model':db[_0x4697c2[_0x5df5('0x1f')]],'as':_0x4697c2['as'],'attributes':_0x4697c2['attributes']};}):[]};}):[]};}):[]:[]})[_0x5df5('0xc')](function(_0x2e7e64){logger[_0x5df5('0x13')](_0x5df5('0x22'),_0x47bebb);logger['debug'](_0x5df5('0x22'),_0x47bebb,JSON[_0x5df5('0x21')](_0x2e7e64));_0x485484(_0x2e7e64);})[_0x5df5('0x15')](function(_0x18b597){logger[_0x5df5('0xf')](_0x5df5('0x22'),_0x18b597[_0x5df5('0x12')],_0x47bebb);_0xf445de(_0x4784ca['error'](0x1f4,_0x18b597[_0x5df5('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 02633ea..580f37d 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 _0x458c=['destroy','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','index','get','show','/:id/subjects','isAuthenticated','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','create','update','delete','/:id'];(function(_0x3c9bdf,_0x3b30cd){var _0x5664a6=function(_0x4ea55c){while(--_0x4ea55c){_0x3c9bdf['push'](_0x3c9bdf['shift']());}};_0x5664a6(++_0x3b30cd);}(_0x458c,0x12d));var _0xc458=function(_0x45c48f,_0x4aa891){_0x45c48f=_0x45c48f-0x0;var _0xaf5037=_0x458c[_0x45c48f];return _0xaf5037;};'use strict';var multer=require('multer');var util=require(_0xc458('0x0'));var path=require(_0xc458('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc458('0x2')]();var fs_extra=require(_0xc458('0x3'));var auth=require(_0xc458('0x4'));var interaction=require(_0xc458('0x5'));var config=require('../../config/environment');var controller=require('./intFreshsalesConfiguration.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xc458('0x6')]);router[_0xc458('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xc458('0x8')]);router['get'](_0xc458('0x9'),auth[_0xc458('0xa')](),controller[_0xc458('0xb')]);router['get'](_0xc458('0xc'),auth[_0xc458('0xa')](),controller[_0xc458('0xd')]);router['get'](_0xc458('0xe'),auth['isAuthenticated'](),controller[_0xc458('0xf')]);router[_0xc458('0x10')]('/',auth['isAuthenticated'](),controller[_0xc458('0x11')]);router['put']('/:id',auth[_0xc458('0xa')](),controller[_0xc458('0x12')]);router[_0xc458('0x13')](_0xc458('0x14'),auth['isAuthenticated'](),controller[_0xc458('0x15')]);module[_0xc458('0x16')]=router; \ No newline at end of file +var _0x5774=['post','put','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getFields'];(function(_0x20eca9,_0x3323bb){var _0x1b6f68=function(_0x272e3a){while(--_0x272e3a){_0x20eca9['push'](_0x20eca9['shift']());}};_0x1b6f68(++_0x3323bb);}(_0x5774,0x145));var _0x4577=function(_0x2e5390,_0x2a191d){_0x2e5390=_0x2e5390-0x0;var _0x4b898c=_0x5774[_0x2e5390];return _0x4b898c;};'use strict';var multer=require(_0x4577('0x0'));var util=require(_0x4577('0x1'));var path=require(_0x4577('0x2'));var timeout=require(_0x4577('0x3'));var express=require(_0x4577('0x4'));var router=express[_0x4577('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4577('0x6'));var interaction=require(_0x4577('0x7'));var config=require(_0x4577('0x8'));var controller=require(_0x4577('0x9'));router[_0x4577('0xa')]('/',auth[_0x4577('0xb')](),controller[_0x4577('0xc')]);router['get'](_0x4577('0xd'),auth['isAuthenticated'](),controller[_0x4577('0xe')]);router['get'](_0x4577('0xf'),auth[_0x4577('0xb')](),controller[_0x4577('0x10')]);router[_0x4577('0xa')](_0x4577('0x11'),auth[_0x4577('0xb')](),controller[_0x4577('0x12')]);router[_0x4577('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0x4577('0x13')]);router[_0x4577('0x14')]('/',auth[_0x4577('0xb')](),controller['create']);router[_0x4577('0x15')](_0x4577('0xd'),auth[_0x4577('0xb')](),controller['update']);router['delete']('/:id',auth[_0x4577('0xb')](),controller[_0x4577('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 2552b5d..56b109d 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 _0x8497=['STRING','exports'];(function(_0x3872f9,_0x4d9ccd){var _0x10e421=function(_0x4a3a14){while(--_0x4a3a14){_0x3872f9['push'](_0x3872f9['shift']());}};_0x10e421(++_0x4d9ccd);}(_0x8497,0xc1));var _0x7849=function(_0x171fc4,_0x7ec171){_0x171fc4=_0x171fc4-0x0;var _0x3aee00=_0x8497[_0x171fc4];return _0x3aee00;};'use strict';var Sequelize=require('sequelize');module[_0x7849('0x0')]={'name':{'type':Sequelize[_0x7849('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x454b=['sequelize','exports','STRING'];(function(_0x33e4b7,_0x4834ec){var _0x543197=function(_0x37653b){while(--_0x37653b){_0x33e4b7['push'](_0x33e4b7['shift']());}};_0x543197(++_0x4834ec);}(_0x454b,0x8a));var _0xb454=function(_0x1deee5,_0x1d4485){_0x1deee5=_0x1deee5-0x0;var _0x1d6c3a=_0x454b[_0x1deee5];return _0x1d6c3a;};'use strict';var Sequelize=require(_0xb454('0x0'));module[_0xb454('0x1')]={'name':{'type':Sequelize[_0xb454('0x2')]},'description':{'type':Sequelize[_0xb454('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 9e70072..b86eb13 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 _0x7a8d=['../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','FreshsalesConfiguration','include','findAll','rows','catch','show','params','includeAll','create','body','find','findOne','FreshsalesField','getSubjects','getDescriptions','getFields','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x7a8d,0x185));var _0xd7a8=function(_0x41eac7,_0x825acf){_0x41eac7=_0x41eac7-0x0;var _0x27a606=_0x7a8d[_0x41eac7];return _0x27a606;};'use strict';var emlformat=require(_0xd7a8('0x0'));var rimraf=require(_0xd7a8('0x1'));var zipdir=require(_0xd7a8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd7a8('0x3'));var moment=require('moment');var BPromise=require(_0xd7a8('0x4'));var Mustache=require(_0xd7a8('0x5'));var util=require('util');var path=require(_0xd7a8('0x6'));var sox=require(_0xd7a8('0x7'));var csv=require(_0xd7a8('0x8'));var ejs=require(_0xd7a8('0x9'));var fs=require('fs');var fs_extra=require(_0xd7a8('0xa'));var _=require('lodash');var squel=require(_0xd7a8('0xb'));var crypto=require(_0xd7a8('0xc'));var jsforce=require(_0xd7a8('0xd'));var deskjs=require(_0xd7a8('0xe'));var toCsv=require(_0xd7a8('0x8'));var querystring=require(_0xd7a8('0xf'));var Papa=require(_0xd7a8('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd7a8('0x11'));var as=require(_0xd7a8('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd7a8('0x13'))(_0xd7a8('0x14'));var utils=require('../../config/utils');var config=require(_0xd7a8('0x15'));var licenseUtil=require(_0xd7a8('0x16'));var db=require(_0xd7a8('0x17'))['db'];function respondWithStatusCode(_0x3e223b,_0x5ee930){_0x5ee930=_0x5ee930||0xcc;return function(_0x55b5af){if(_0x55b5af){return _0x3e223b['sendStatus'](_0x5ee930);}return _0x3e223b[_0xd7a8('0x18')](_0x5ee930)[_0xd7a8('0x19')]();};}function respondWithResult(_0x2a3da5,_0x1a726a){_0x1a726a=_0x1a726a||0xc8;return function(_0xeb3405){if(_0xeb3405){return _0x2a3da5['status'](_0x1a726a)[_0xd7a8('0x1a')](_0xeb3405);}};}function respondWithFilteredResult(_0x4bd8a4,_0x279f19){return function(_0x330cb9){if(_0x330cb9){var _0x2ce4c7=typeof _0x279f19[_0xd7a8('0x1b')]===_0xd7a8('0x1c')&&typeof _0x279f19[_0xd7a8('0x1d')]===_0xd7a8('0x1c');var _0x2548e6=_0x330cb9[_0xd7a8('0x1e')];var _0x299e92=_0x2ce4c7?0x0:_0x279f19[_0xd7a8('0x1b')];var _0x236032=_0x2ce4c7?_0x330cb9[_0xd7a8('0x1e')]:_0x279f19[_0xd7a8('0x1b')]+_0x279f19[_0xd7a8('0x1d')];var _0x259d44;if(_0x236032>=_0x2548e6){_0x236032=_0x2548e6;_0x259d44=0xc8;}else{_0x259d44=0xce;}_0x4bd8a4['status'](_0x259d44);return _0x4bd8a4[_0xd7a8('0x1f')](_0xd7a8('0x20'),_0x299e92+'-'+_0x236032+'/'+_0x2548e6)[_0xd7a8('0x1a')](_0x330cb9);}return null;};}function patchUpdates(_0x315364){return function(_0xef0bbd){try{jsonpatch[_0xd7a8('0x21')](_0xef0bbd,_0x315364,!![]);}catch(_0x379b36){return BPromise[_0xd7a8('0x22')](_0x379b36);}return _0xef0bbd['save']();};}function saveUpdates(_0x2f2dff,_0x11a093){return function(_0x32140a){if(_0x32140a){return _0x32140a[_0xd7a8('0x23')](_0x2f2dff)[_0xd7a8('0x24')](function(_0x2d8ec8){return _0x2d8ec8;});}return null;};}function removeEntity(_0xcfed4f,_0x2c8827){return function(_0x39c80f){if(_0x39c80f){return _0x39c80f[_0xd7a8('0x25')]()[_0xd7a8('0x24')](function(){_0xcfed4f[_0xd7a8('0x18')](0xcc)[_0xd7a8('0x19')]();});}};}function handleEntityNotFound(_0x2744ee,_0x1191d0){return function(_0x7116d3){if(!_0x7116d3){_0x2744ee[_0xd7a8('0x26')](0x194);}return _0x7116d3;};}function handleError(_0x277f7e,_0x31d79d){_0x31d79d=_0x31d79d||0x1f4;return function(_0x406e8e){logger[_0xd7a8('0x27')](_0x406e8e[_0xd7a8('0x28')]);if(_0x406e8e[_0xd7a8('0x29')]){delete _0x406e8e['name'];}_0x277f7e['status'](_0x31d79d)[_0xd7a8('0x2a')](_0x406e8e);};}exports[_0xd7a8('0x2b')]=function(_0x28831c,_0x2b5e5b){var _0xad1358={},_0x21109c={},_0xa145a9={'count':0x0,'rows':[]};var _0x40fedd=_[_0xd7a8('0x2c')](db['FreshsalesConfiguration'][_0xd7a8('0x2d')],function(_0x27e79f){return{'name':_0x27e79f['fieldName'],'type':_0x27e79f[_0xd7a8('0x2e')][_0xd7a8('0x2f')]};});_0x21109c[_0xd7a8('0x30')]=_[_0xd7a8('0x2c')](_0x40fedd,_0xd7a8('0x29'));_0x21109c['query']=_[_0xd7a8('0x31')](_0x28831c['query']);_0x21109c['filters']=_[_0xd7a8('0x32')](_0x21109c[_0xd7a8('0x30')],_0x21109c[_0xd7a8('0x33')]);_0xad1358[_0xd7a8('0x34')]=_[_0xd7a8('0x32')](_0x21109c[_0xd7a8('0x30')],qs[_0xd7a8('0x35')](_0x28831c[_0xd7a8('0x33')][_0xd7a8('0x35')]));_0xad1358[_0xd7a8('0x34')]=_0xad1358['attributes'][_0xd7a8('0x36')]?_0xad1358[_0xd7a8('0x34')]:_0x21109c['model'];if(!_0x28831c['query'][_0xd7a8('0x37')](_0xd7a8('0x38'))){_0xad1358['limit']=qs[_0xd7a8('0x1d')](_0x28831c[_0xd7a8('0x33')][_0xd7a8('0x1d')]);_0xad1358[_0xd7a8('0x1b')]=qs[_0xd7a8('0x1b')](_0x28831c[_0xd7a8('0x33')][_0xd7a8('0x1b')]);}_0xad1358[_0xd7a8('0x39')]=qs['sort'](_0x28831c[_0xd7a8('0x33')][_0xd7a8('0x3a')]);_0xad1358[_0xd7a8('0x3b')]=qs[_0xd7a8('0x3c')](_[_0xd7a8('0x3d')](_0x28831c[_0xd7a8('0x33')],_0x21109c[_0xd7a8('0x3c')]),_0x40fedd);if(_0x28831c[_0xd7a8('0x33')]['filter']){_0xad1358['where']=_[_0xd7a8('0x3e')](_0xad1358['where'],{'$or':_[_0xd7a8('0x2c')](_0x40fedd,function(_0x39ceb1){if(_0x39ceb1[_0xd7a8('0x2e')]!==_0xd7a8('0x3f')){var _0x3a0843={};_0x3a0843[_0x39ceb1['name']]={'$like':'%'+_0x28831c[_0xd7a8('0x33')][_0xd7a8('0x40')]+'%'};return _0x3a0843;}})});}_0xad1358=_[_0xd7a8('0x3e')]({},_0xad1358,_0x28831c[_0xd7a8('0x41')]);var _0x3a26c={'where':_0xad1358['where']};return db[_0xd7a8('0x42')][_0xd7a8('0x1e')](_0x3a26c)[_0xd7a8('0x24')](function(_0x1128ad){_0xa145a9[_0xd7a8('0x1e')]=_0x1128ad;if(_0x28831c[_0xd7a8('0x33')]['includeAll']){_0xad1358[_0xd7a8('0x43')]=[{'all':!![]}];}return db[_0xd7a8('0x42')][_0xd7a8('0x44')](_0xad1358);})[_0xd7a8('0x24')](function(_0x263b6e){_0xa145a9[_0xd7a8('0x45')]=_0x263b6e;return _0xa145a9;})[_0xd7a8('0x24')](respondWithFilteredResult(_0x2b5e5b,_0xad1358))[_0xd7a8('0x46')](handleError(_0x2b5e5b,null));};exports[_0xd7a8('0x47')]=function(_0x2ab73d,_0x1fb82c){var _0x945292={'raw':![],'where':{'id':_0x2ab73d[_0xd7a8('0x48')]['id']}},_0x22272f={};_0x22272f[_0xd7a8('0x30')]=_['keys'](db[_0xd7a8('0x42')][_0xd7a8('0x2d')]);_0x22272f['query']=_[_0xd7a8('0x31')](_0x2ab73d[_0xd7a8('0x33')]);_0x22272f[_0xd7a8('0x3c')]=_[_0xd7a8('0x32')](_0x22272f[_0xd7a8('0x30')],_0x22272f[_0xd7a8('0x33')]);_0x945292['attributes']=_[_0xd7a8('0x32')](_0x22272f[_0xd7a8('0x30')],qs[_0xd7a8('0x35')](_0x2ab73d[_0xd7a8('0x33')][_0xd7a8('0x35')]));_0x945292[_0xd7a8('0x34')]=_0x945292[_0xd7a8('0x34')][_0xd7a8('0x36')]?_0x945292[_0xd7a8('0x34')]:_0x22272f['model'];if(_0x2ab73d['query'][_0xd7a8('0x49')]){_0x945292['include']=[{'all':!![]}];}_0x945292=_[_0xd7a8('0x3e')]({},_0x945292,_0x2ab73d[_0xd7a8('0x41')]);return db[_0xd7a8('0x42')]['find'](_0x945292)[_0xd7a8('0x24')](handleEntityNotFound(_0x1fb82c,null))['then'](respondWithResult(_0x1fb82c,null))[_0xd7a8('0x46')](handleError(_0x1fb82c,null));};exports['create']=function(_0x470b02,_0x46898f){return db['FreshsalesConfiguration'][_0xd7a8('0x4a')](_0x470b02['body'],{})['then'](respondWithResult(_0x46898f,0xc9))[_0xd7a8('0x46')](handleError(_0x46898f,null));};exports[_0xd7a8('0x23')]=function(_0x3daffc,_0x3812f9){if(_0x3daffc[_0xd7a8('0x4b')]['id']){delete _0x3daffc['body']['id'];}return db[_0xd7a8('0x42')][_0xd7a8('0x4c')]({'where':{'id':_0x3daffc[_0xd7a8('0x48')]['id']}})[_0xd7a8('0x24')](handleEntityNotFound(_0x3812f9,null))[_0xd7a8('0x24')](saveUpdates(_0x3daffc[_0xd7a8('0x4b')],null))[_0xd7a8('0x24')](respondWithResult(_0x3812f9,null))['catch'](handleError(_0x3812f9,null));};exports[_0xd7a8('0x25')]=function(_0x5de325,_0x57e2c2){return db[_0xd7a8('0x42')]['find']({'where':{'id':_0x5de325[_0xd7a8('0x48')]['id']}})['then'](handleEntityNotFound(_0x57e2c2,null))['then'](removeEntity(_0x57e2c2,null))[_0xd7a8('0x46')](handleError(_0x57e2c2,null));};exports['getSubjects']=function(_0x185ec7,_0x525b91,_0x1e7b3c){var _0x17eccf={};var _0x4133ab={};var _0x5c91b2;var _0x51f26b;return db[_0xd7a8('0x42')][_0xd7a8('0x4d')]({'where':{'id':_0x185ec7[_0xd7a8('0x48')]['id']}})[_0xd7a8('0x24')](handleEntityNotFound(_0x525b91,null))[_0xd7a8('0x24')](function(_0x458267){if(_0x458267){_0x5c91b2=_0x458267;_0x4133ab[_0xd7a8('0x30')]=_['keys'](db[_0xd7a8('0x4e')]['rawAttributes']);_0x4133ab[_0xd7a8('0x33')]=_['keys'](_0x185ec7[_0xd7a8('0x33')]);_0x4133ab[_0xd7a8('0x3c')]=_[_0xd7a8('0x32')](_0x4133ab[_0xd7a8('0x30')],_0x4133ab[_0xd7a8('0x33')]);_0x17eccf[_0xd7a8('0x34')]=_[_0xd7a8('0x32')](_0x4133ab['model'],qs[_0xd7a8('0x35')](_0x185ec7[_0xd7a8('0x33')][_0xd7a8('0x35')]));_0x17eccf[_0xd7a8('0x34')]=_0x17eccf['attributes'][_0xd7a8('0x36')]?_0x17eccf[_0xd7a8('0x34')]:_0x4133ab[_0xd7a8('0x30')];_0x17eccf['order']=qs['sort'](_0x185ec7[_0xd7a8('0x33')][_0xd7a8('0x3a')]);_0x17eccf['where']=qs[_0xd7a8('0x3c')](_[_0xd7a8('0x3d')](_0x185ec7['query'],_0x4133ab[_0xd7a8('0x3c')]));if(_0x185ec7['query'][_0xd7a8('0x40')]){_0x17eccf[_0xd7a8('0x3b')]=_['merge'](_0x17eccf[_0xd7a8('0x3b')],{'$or':_['map'](_0x17eccf['attributes'],function(_0x3a4b6e){var _0x547117={};_0x547117[_0x3a4b6e]={'$like':'%'+_0x185ec7[_0xd7a8('0x33')][_0xd7a8('0x40')]+'%'};return _0x547117;})});}_0x17eccf=_[_0xd7a8('0x3e')]({},_0x17eccf,_0x185ec7[_0xd7a8('0x41')]);return _0x5c91b2[_0xd7a8('0x4f')](_0x17eccf);}})['then'](function(_0x180022){if(_0x180022){_0x51f26b=_0x180022[_0xd7a8('0x36')];if(!_0x185ec7['query']['hasOwnProperty'](_0xd7a8('0x38'))){_0x17eccf[_0xd7a8('0x1d')]=qs[_0xd7a8('0x1d')](_0x185ec7[_0xd7a8('0x33')][_0xd7a8('0x1d')]);_0x17eccf['offset']=qs[_0xd7a8('0x1b')](_0x185ec7[_0xd7a8('0x33')][_0xd7a8('0x1b')]);}return _0x5c91b2[_0xd7a8('0x4f')](_0x17eccf);}})[_0xd7a8('0x24')](function(_0x8453e7){if(_0x8453e7){return _0x8453e7?{'count':_0x51f26b,'rows':_0x8453e7}:null;}})[_0xd7a8('0x24')](respondWithResult(_0x525b91,null))[_0xd7a8('0x46')](handleError(_0x525b91,null));};exports[_0xd7a8('0x50')]=function(_0xc548d0,_0x98ba86,_0x32ac56){var _0x50b548={};var _0xe919e2={};var _0x14d8a4;var _0x17b976;return db[_0xd7a8('0x42')][_0xd7a8('0x4d')]({'where':{'id':_0xc548d0['params']['id']}})[_0xd7a8('0x24')](handleEntityNotFound(_0x98ba86,null))[_0xd7a8('0x24')](function(_0x262b56){if(_0x262b56){_0x14d8a4=_0x262b56;_0xe919e2[_0xd7a8('0x30')]=_['keys'](db[_0xd7a8('0x4e')][_0xd7a8('0x2d')]);_0xe919e2[_0xd7a8('0x33')]=_[_0xd7a8('0x31')](_0xc548d0[_0xd7a8('0x33')]);_0xe919e2[_0xd7a8('0x3c')]=_[_0xd7a8('0x32')](_0xe919e2[_0xd7a8('0x30')],_0xe919e2['query']);_0x50b548['attributes']=_[_0xd7a8('0x32')](_0xe919e2['model'],qs[_0xd7a8('0x35')](_0xc548d0['query'][_0xd7a8('0x35')]));_0x50b548[_0xd7a8('0x34')]=_0x50b548[_0xd7a8('0x34')][_0xd7a8('0x36')]?_0x50b548['attributes']:_0xe919e2[_0xd7a8('0x30')];_0x50b548['order']=qs[_0xd7a8('0x3a')](_0xc548d0[_0xd7a8('0x33')][_0xd7a8('0x3a')]);_0x50b548[_0xd7a8('0x3b')]=qs[_0xd7a8('0x3c')](_[_0xd7a8('0x3d')](_0xc548d0[_0xd7a8('0x33')],_0xe919e2[_0xd7a8('0x3c')]));if(_0xc548d0[_0xd7a8('0x33')][_0xd7a8('0x40')]){_0x50b548[_0xd7a8('0x3b')]=_[_0xd7a8('0x3e')](_0x50b548[_0xd7a8('0x3b')],{'$or':_[_0xd7a8('0x2c')](_0x50b548[_0xd7a8('0x34')],function(_0x31a82b){var _0x33dd88={};_0x33dd88[_0x31a82b]={'$like':'%'+_0xc548d0[_0xd7a8('0x33')][_0xd7a8('0x40')]+'%'};return _0x33dd88;})});}_0x50b548=_[_0xd7a8('0x3e')]({},_0x50b548,_0xc548d0['options']);return _0x14d8a4[_0xd7a8('0x50')](_0x50b548);}})[_0xd7a8('0x24')](function(_0x2b47cb){if(_0x2b47cb){_0x17b976=_0x2b47cb[_0xd7a8('0x36')];if(!_0xc548d0['query'][_0xd7a8('0x37')](_0xd7a8('0x38'))){_0x50b548[_0xd7a8('0x1d')]=qs[_0xd7a8('0x1d')](_0xc548d0[_0xd7a8('0x33')][_0xd7a8('0x1d')]);_0x50b548['offset']=qs['offset'](_0xc548d0[_0xd7a8('0x33')][_0xd7a8('0x1b')]);}return _0x14d8a4[_0xd7a8('0x50')](_0x50b548);}})[_0xd7a8('0x24')](function(_0x33812e){if(_0x33812e){return _0x33812e?{'count':_0x17b976,'rows':_0x33812e}:null;}})[_0xd7a8('0x24')](respondWithResult(_0x98ba86,null))[_0xd7a8('0x46')](handleError(_0x98ba86,null));};exports[_0xd7a8('0x51')]=function(_0xfe8863,_0x60f0e2,_0x5017ce){var _0x4b83a5={};var _0x541c0f={};var _0x4bf10c;var _0x1212a6;return db[_0xd7a8('0x42')][_0xd7a8('0x4d')]({'where':{'id':_0xfe8863[_0xd7a8('0x48')]['id']}})[_0xd7a8('0x24')](handleEntityNotFound(_0x60f0e2,null))[_0xd7a8('0x24')](function(_0x26bf0e){if(_0x26bf0e){_0x4bf10c=_0x26bf0e;_0x541c0f[_0xd7a8('0x30')]=_[_0xd7a8('0x31')](db[_0xd7a8('0x4e')][_0xd7a8('0x2d')]);_0x541c0f[_0xd7a8('0x33')]=_[_0xd7a8('0x31')](_0xfe8863['query']);_0x541c0f[_0xd7a8('0x3c')]=_['intersection'](_0x541c0f[_0xd7a8('0x30')],_0x541c0f['query']);_0x4b83a5['attributes']=_[_0xd7a8('0x32')](_0x541c0f[_0xd7a8('0x30')],qs['fields'](_0xfe8863['query'][_0xd7a8('0x35')]));_0x4b83a5[_0xd7a8('0x34')]=_0x4b83a5['attributes'][_0xd7a8('0x36')]?_0x4b83a5['attributes']:_0x541c0f['model'];_0x4b83a5[_0xd7a8('0x39')]=qs[_0xd7a8('0x3a')](_0xfe8863['query'][_0xd7a8('0x3a')]);_0x4b83a5[_0xd7a8('0x3b')]=qs[_0xd7a8('0x3c')](_['pick'](_0xfe8863['query'],_0x541c0f['filters']));if(_0xfe8863[_0xd7a8('0x33')][_0xd7a8('0x40')]){_0x4b83a5[_0xd7a8('0x3b')]=_[_0xd7a8('0x3e')](_0x4b83a5['where'],{'$or':_[_0xd7a8('0x2c')](_0x4b83a5[_0xd7a8('0x34')],function(_0x514615){var _0x351c21={};_0x351c21[_0x514615]={'$like':'%'+_0xfe8863[_0xd7a8('0x33')][_0xd7a8('0x40')]+'%'};return _0x351c21;})});}_0x4b83a5=_[_0xd7a8('0x3e')]({},_0x4b83a5,_0xfe8863[_0xd7a8('0x41')]);return _0x4bf10c['getFields'](_0x4b83a5);}})[_0xd7a8('0x24')](function(_0x34d198){if(_0x34d198){_0x1212a6=_0x34d198[_0xd7a8('0x36')];if(!_0xfe8863['query'][_0xd7a8('0x37')](_0xd7a8('0x38'))){_0x4b83a5[_0xd7a8('0x1d')]=qs[_0xd7a8('0x1d')](_0xfe8863['query'][_0xd7a8('0x1d')]);_0x4b83a5[_0xd7a8('0x1b')]=qs[_0xd7a8('0x1b')](_0xfe8863['query'][_0xd7a8('0x1b')]);}return _0x4bf10c['getFields'](_0x4b83a5);}})[_0xd7a8('0x24')](function(_0x2b9e66){if(_0x2b9e66){return _0x2b9e66?{'count':_0x1212a6,'rows':_0x2b9e66}:null;}})[_0xd7a8('0x24')](respondWithResult(_0x60f0e2,null))[_0xd7a8('0x46')](handleError(_0x60f0e2,null));}; \ No newline at end of file +var _0x0245=['attributes','fields','length','query','nolimit','order','sort','where','filter','merge','options','include','rows','catch','show','params','includeAll','find','create','body','update','findOne','FreshsalesField','pick','getSubjects','hasOwnProperty','getDescriptions','getFields','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../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','Content-Range','reject','save','then','destroy','error','name','send','map','FreshsalesConfiguration','rawAttributes','key','model','keys','filters','intersection'];(function(_0x4ffd20,_0x1e83b6){var _0x49b5e2=function(_0xfdd1a6){while(--_0xfdd1a6){_0x4ffd20['push'](_0x4ffd20['shift']());}};_0x49b5e2(++_0x1e83b6);}(_0x0245,0x6a));var _0x5024=function(_0x1a6893,_0x2cf99f){_0x1a6893=_0x1a6893-0x0;var _0x5d26a1=_0x0245[_0x1a6893];return _0x5d26a1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5024('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5024('0x1'));var rp=require(_0x5024('0x2'));var moment=require(_0x5024('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5024('0x4'));var util=require(_0x5024('0x5'));var path=require(_0x5024('0x6'));var sox=require(_0x5024('0x7'));var csv=require(_0x5024('0x8'));var ejs=require(_0x5024('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5024('0xa'));var squel=require(_0x5024('0xb'));var crypto=require(_0x5024('0xc'));var jsforce=require(_0x5024('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5024('0x8'));var querystring=require(_0x5024('0xe'));var Papa=require(_0x5024('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5024('0x10'));var as=require(_0x5024('0x11'));var hardwareService=require(_0x5024('0x12'));var logger=require(_0x5024('0x13'))(_0x5024('0x14'));var utils=require(_0x5024('0x15'));var config=require(_0x5024('0x16'));var licenseUtil=require(_0x5024('0x17'));var db=require(_0x5024('0x18'))['db'];function respondWithStatusCode(_0x573c61,_0x3e0733){_0x3e0733=_0x3e0733||0xcc;return function(_0xa9a1ce){if(_0xa9a1ce){return _0x573c61[_0x5024('0x19')](_0x3e0733);}return _0x573c61['status'](_0x3e0733)[_0x5024('0x1a')]();};}function respondWithResult(_0x785258,_0xcff19f){_0xcff19f=_0xcff19f||0xc8;return function(_0x2910b3){if(_0x2910b3){return _0x785258[_0x5024('0x1b')](_0xcff19f)[_0x5024('0x1c')](_0x2910b3);}};}function respondWithFilteredResult(_0x479108,_0x3419fd){return function(_0x30d845){if(_0x30d845){var _0x2f07f6=typeof _0x3419fd[_0x5024('0x1d')]===_0x5024('0x1e')&&typeof _0x3419fd[_0x5024('0x1f')]===_0x5024('0x1e');var _0xc7f0fc=_0x30d845['count'];var _0x5d6ccc=_0x2f07f6?0x0:_0x3419fd[_0x5024('0x1d')];var _0x4c19de=_0x2f07f6?_0x30d845[_0x5024('0x20')]:_0x3419fd['offset']+_0x3419fd[_0x5024('0x1f')];var _0x2b51f6;if(_0x4c19de>=_0xc7f0fc){_0x4c19de=_0xc7f0fc;_0x2b51f6=0xc8;}else{_0x2b51f6=0xce;}_0x479108[_0x5024('0x1b')](_0x2b51f6);return _0x479108[_0x5024('0x21')](_0x5024('0x22'),_0x5d6ccc+'-'+_0x4c19de+'/'+_0xc7f0fc)[_0x5024('0x1c')](_0x30d845);}return null;};}function patchUpdates(_0x22cd01){return function(_0x4adf99){try{jsonpatch['apply'](_0x4adf99,_0x22cd01,!![]);}catch(_0x558e54){return BPromise[_0x5024('0x23')](_0x558e54);}return _0x4adf99[_0x5024('0x24')]();};}function saveUpdates(_0x24f1d2,_0x165ae9){return function(_0x54d1b6){if(_0x54d1b6){return _0x54d1b6['update'](_0x24f1d2)[_0x5024('0x25')](function(_0x3568a7){return _0x3568a7;});}return null;};}function removeEntity(_0x21002a,_0x40bb49){return function(_0xb4f44a){if(_0xb4f44a){return _0xb4f44a[_0x5024('0x26')]()['then'](function(){_0x21002a['status'](0xcc)[_0x5024('0x1a')]();});}};}function handleEntityNotFound(_0x558659,_0x32c6bf){return function(_0x69a1d5){if(!_0x69a1d5){_0x558659[_0x5024('0x19')](0x194);}return _0x69a1d5;};}function handleError(_0x5fa952,_0x373072){_0x373072=_0x373072||0x1f4;return function(_0x2f627e){logger[_0x5024('0x27')](_0x2f627e['stack']);if(_0x2f627e[_0x5024('0x28')]){delete _0x2f627e[_0x5024('0x28')];}_0x5fa952['status'](_0x373072)[_0x5024('0x29')](_0x2f627e);};}exports['index']=function(_0x3e5034,_0x1c0fbd){var _0x2b22d6={},_0x54b9d9={},_0x54414b={'count':0x0,'rows':[]};var _0x5351f7=_[_0x5024('0x2a')](db[_0x5024('0x2b')][_0x5024('0x2c')],function(_0xe0eb45){return{'name':_0xe0eb45['fieldName'],'type':_0xe0eb45['type'][_0x5024('0x2d')]};});_0x54b9d9[_0x5024('0x2e')]=_['map'](_0x5351f7,_0x5024('0x28'));_0x54b9d9['query']=_[_0x5024('0x2f')](_0x3e5034['query']);_0x54b9d9[_0x5024('0x30')]=_[_0x5024('0x31')](_0x54b9d9['model'],_0x54b9d9['query']);_0x2b22d6[_0x5024('0x32')]=_[_0x5024('0x31')](_0x54b9d9['model'],qs[_0x5024('0x33')](_0x3e5034['query'][_0x5024('0x33')]));_0x2b22d6[_0x5024('0x32')]=_0x2b22d6[_0x5024('0x32')][_0x5024('0x34')]?_0x2b22d6[_0x5024('0x32')]:_0x54b9d9[_0x5024('0x2e')];if(!_0x3e5034[_0x5024('0x35')]['hasOwnProperty'](_0x5024('0x36'))){_0x2b22d6[_0x5024('0x1f')]=qs['limit'](_0x3e5034[_0x5024('0x35')][_0x5024('0x1f')]);_0x2b22d6[_0x5024('0x1d')]=qs[_0x5024('0x1d')](_0x3e5034[_0x5024('0x35')]['offset']);}_0x2b22d6[_0x5024('0x37')]=qs[_0x5024('0x38')](_0x3e5034[_0x5024('0x35')]['sort']);_0x2b22d6['where']=qs[_0x5024('0x30')](_['pick'](_0x3e5034['query'],_0x54b9d9['filters']),_0x5351f7);if(_0x3e5034[_0x5024('0x35')]['filter']){_0x2b22d6[_0x5024('0x39')]=_['merge'](_0x2b22d6['where'],{'$or':_[_0x5024('0x2a')](_0x5351f7,function(_0xd1b636){if(_0xd1b636['type']!=='VIRTUAL'){var _0xe7bb09={};_0xe7bb09[_0xd1b636[_0x5024('0x28')]]={'$like':'%'+_0x3e5034['query'][_0x5024('0x3a')]+'%'};return _0xe7bb09;}})});}_0x2b22d6=_[_0x5024('0x3b')]({},_0x2b22d6,_0x3e5034[_0x5024('0x3c')]);var _0x14b904={'where':_0x2b22d6[_0x5024('0x39')]};return db[_0x5024('0x2b')][_0x5024('0x20')](_0x14b904)[_0x5024('0x25')](function(_0x49dcb3){_0x54414b[_0x5024('0x20')]=_0x49dcb3;if(_0x3e5034[_0x5024('0x35')]['includeAll']){_0x2b22d6[_0x5024('0x3d')]=[{'all':!![]}];}return db[_0x5024('0x2b')]['findAll'](_0x2b22d6);})[_0x5024('0x25')](function(_0x2350e7){_0x54414b[_0x5024('0x3e')]=_0x2350e7;return _0x54414b;})[_0x5024('0x25')](respondWithFilteredResult(_0x1c0fbd,_0x2b22d6))[_0x5024('0x3f')](handleError(_0x1c0fbd,null));};exports[_0x5024('0x40')]=function(_0x293554,_0x7e8e94){var _0x336918={'raw':![],'where':{'id':_0x293554[_0x5024('0x41')]['id']}},_0x2f1e9a={};_0x2f1e9a['model']=_[_0x5024('0x2f')](db[_0x5024('0x2b')][_0x5024('0x2c')]);_0x2f1e9a['query']=_[_0x5024('0x2f')](_0x293554[_0x5024('0x35')]);_0x2f1e9a[_0x5024('0x30')]=_[_0x5024('0x31')](_0x2f1e9a[_0x5024('0x2e')],_0x2f1e9a[_0x5024('0x35')]);_0x336918[_0x5024('0x32')]=_['intersection'](_0x2f1e9a[_0x5024('0x2e')],qs[_0x5024('0x33')](_0x293554[_0x5024('0x35')][_0x5024('0x33')]));_0x336918['attributes']=_0x336918[_0x5024('0x32')][_0x5024('0x34')]?_0x336918[_0x5024('0x32')]:_0x2f1e9a['model'];if(_0x293554['query'][_0x5024('0x42')]){_0x336918[_0x5024('0x3d')]=[{'all':!![]}];}_0x336918=_[_0x5024('0x3b')]({},_0x336918,_0x293554[_0x5024('0x3c')]);return db[_0x5024('0x2b')][_0x5024('0x43')](_0x336918)[_0x5024('0x25')](handleEntityNotFound(_0x7e8e94,null))[_0x5024('0x25')](respondWithResult(_0x7e8e94,null))[_0x5024('0x3f')](handleError(_0x7e8e94,null));};exports[_0x5024('0x44')]=function(_0x5c8905,_0x46436b){return db[_0x5024('0x2b')][_0x5024('0x44')](_0x5c8905[_0x5024('0x45')],{})[_0x5024('0x25')](respondWithResult(_0x46436b,0xc9))[_0x5024('0x3f')](handleError(_0x46436b,null));};exports[_0x5024('0x46')]=function(_0x377409,_0x58eebb){if(_0x377409[_0x5024('0x45')]['id']){delete _0x377409[_0x5024('0x45')]['id'];}return db[_0x5024('0x2b')]['find']({'where':{'id':_0x377409[_0x5024('0x41')]['id']}})['then'](handleEntityNotFound(_0x58eebb,null))[_0x5024('0x25')](saveUpdates(_0x377409[_0x5024('0x45')],null))[_0x5024('0x25')](respondWithResult(_0x58eebb,null))[_0x5024('0x3f')](handleError(_0x58eebb,null));};exports[_0x5024('0x26')]=function(_0xc3243b,_0x21e4b3){return db[_0x5024('0x2b')][_0x5024('0x43')]({'where':{'id':_0xc3243b[_0x5024('0x41')]['id']}})[_0x5024('0x25')](handleEntityNotFound(_0x21e4b3,null))[_0x5024('0x25')](removeEntity(_0x21e4b3,null))[_0x5024('0x3f')](handleError(_0x21e4b3,null));};exports['getSubjects']=function(_0x272d45,_0x1c18ba,_0x575b10){var _0x1f8800={};var _0x20a78f={};var _0x197497;var _0x20980f;return db[_0x5024('0x2b')][_0x5024('0x47')]({'where':{'id':_0x272d45[_0x5024('0x41')]['id']}})['then'](handleEntityNotFound(_0x1c18ba,null))[_0x5024('0x25')](function(_0x357268){if(_0x357268){_0x197497=_0x357268;_0x20a78f[_0x5024('0x2e')]=_[_0x5024('0x2f')](db[_0x5024('0x48')]['rawAttributes']);_0x20a78f['query']=_[_0x5024('0x2f')](_0x272d45[_0x5024('0x35')]);_0x20a78f[_0x5024('0x30')]=_['intersection'](_0x20a78f[_0x5024('0x2e')],_0x20a78f['query']);_0x1f8800['attributes']=_[_0x5024('0x31')](_0x20a78f[_0x5024('0x2e')],qs[_0x5024('0x33')](_0x272d45['query'][_0x5024('0x33')]));_0x1f8800[_0x5024('0x32')]=_0x1f8800[_0x5024('0x32')]['length']?_0x1f8800[_0x5024('0x32')]:_0x20a78f['model'];_0x1f8800[_0x5024('0x37')]=qs[_0x5024('0x38')](_0x272d45[_0x5024('0x35')]['sort']);_0x1f8800['where']=qs[_0x5024('0x30')](_[_0x5024('0x49')](_0x272d45['query'],_0x20a78f[_0x5024('0x30')]));if(_0x272d45[_0x5024('0x35')]['filter']){_0x1f8800[_0x5024('0x39')]=_[_0x5024('0x3b')](_0x1f8800[_0x5024('0x39')],{'$or':_['map'](_0x1f8800['attributes'],function(_0x55814f){var _0x44f5a5={};_0x44f5a5[_0x55814f]={'$like':'%'+_0x272d45[_0x5024('0x35')][_0x5024('0x3a')]+'%'};return _0x44f5a5;})});}_0x1f8800=_[_0x5024('0x3b')]({},_0x1f8800,_0x272d45['options']);return _0x197497[_0x5024('0x4a')](_0x1f8800);}})['then'](function(_0xd195bf){if(_0xd195bf){_0x20980f=_0xd195bf[_0x5024('0x34')];if(!_0x272d45[_0x5024('0x35')][_0x5024('0x4b')]('nolimit')){_0x1f8800[_0x5024('0x1f')]=qs[_0x5024('0x1f')](_0x272d45[_0x5024('0x35')]['limit']);_0x1f8800[_0x5024('0x1d')]=qs[_0x5024('0x1d')](_0x272d45[_0x5024('0x35')]['offset']);}return _0x197497[_0x5024('0x4a')](_0x1f8800);}})[_0x5024('0x25')](function(_0x92f165){if(_0x92f165){return _0x92f165?{'count':_0x20980f,'rows':_0x92f165}:null;}})[_0x5024('0x25')](respondWithResult(_0x1c18ba,null))[_0x5024('0x3f')](handleError(_0x1c18ba,null));};exports[_0x5024('0x4c')]=function(_0x22712e,_0x2c43ba,_0x2a780c){var _0xada112={};var _0x36b480={};var _0x2e6667;var _0xf42830;return db[_0x5024('0x2b')]['findOne']({'where':{'id':_0x22712e[_0x5024('0x41')]['id']}})[_0x5024('0x25')](handleEntityNotFound(_0x2c43ba,null))[_0x5024('0x25')](function(_0x5b975e){if(_0x5b975e){_0x2e6667=_0x5b975e;_0x36b480['model']=_[_0x5024('0x2f')](db[_0x5024('0x48')][_0x5024('0x2c')]);_0x36b480['query']=_[_0x5024('0x2f')](_0x22712e[_0x5024('0x35')]);_0x36b480[_0x5024('0x30')]=_[_0x5024('0x31')](_0x36b480[_0x5024('0x2e')],_0x36b480['query']);_0xada112[_0x5024('0x32')]=_[_0x5024('0x31')](_0x36b480[_0x5024('0x2e')],qs[_0x5024('0x33')](_0x22712e[_0x5024('0x35')][_0x5024('0x33')]));_0xada112['attributes']=_0xada112[_0x5024('0x32')][_0x5024('0x34')]?_0xada112[_0x5024('0x32')]:_0x36b480['model'];_0xada112[_0x5024('0x37')]=qs['sort'](_0x22712e['query'][_0x5024('0x38')]);_0xada112[_0x5024('0x39')]=qs['filters'](_[_0x5024('0x49')](_0x22712e['query'],_0x36b480[_0x5024('0x30')]));if(_0x22712e[_0x5024('0x35')]['filter']){_0xada112['where']=_[_0x5024('0x3b')](_0xada112['where'],{'$or':_['map'](_0xada112['attributes'],function(_0x131a04){var _0x31248d={};_0x31248d[_0x131a04]={'$like':'%'+_0x22712e[_0x5024('0x35')]['filter']+'%'};return _0x31248d;})});}_0xada112=_['merge']({},_0xada112,_0x22712e['options']);return _0x2e6667[_0x5024('0x4c')](_0xada112);}})[_0x5024('0x25')](function(_0x6adef4){if(_0x6adef4){_0xf42830=_0x6adef4['length'];if(!_0x22712e[_0x5024('0x35')][_0x5024('0x4b')]('nolimit')){_0xada112[_0x5024('0x1f')]=qs['limit'](_0x22712e[_0x5024('0x35')]['limit']);_0xada112[_0x5024('0x1d')]=qs[_0x5024('0x1d')](_0x22712e['query'][_0x5024('0x1d')]);}return _0x2e6667['getDescriptions'](_0xada112);}})[_0x5024('0x25')](function(_0x4b850c){if(_0x4b850c){return _0x4b850c?{'count':_0xf42830,'rows':_0x4b850c}:null;}})[_0x5024('0x25')](respondWithResult(_0x2c43ba,null))[_0x5024('0x3f')](handleError(_0x2c43ba,null));};exports[_0x5024('0x4d')]=function(_0x78b79,_0xc8883c,_0xeb326b){var _0x4ee8e2={};var _0x4e6aa7={};var _0x49a2ab;var _0xfecb29;return db[_0x5024('0x2b')][_0x5024('0x47')]({'where':{'id':_0x78b79[_0x5024('0x41')]['id']}})[_0x5024('0x25')](handleEntityNotFound(_0xc8883c,null))['then'](function(_0x4f3810){if(_0x4f3810){_0x49a2ab=_0x4f3810;_0x4e6aa7[_0x5024('0x2e')]=_[_0x5024('0x2f')](db[_0x5024('0x48')][_0x5024('0x2c')]);_0x4e6aa7[_0x5024('0x35')]=_[_0x5024('0x2f')](_0x78b79[_0x5024('0x35')]);_0x4e6aa7['filters']=_[_0x5024('0x31')](_0x4e6aa7[_0x5024('0x2e')],_0x4e6aa7[_0x5024('0x35')]);_0x4ee8e2[_0x5024('0x32')]=_['intersection'](_0x4e6aa7['model'],qs['fields'](_0x78b79[_0x5024('0x35')][_0x5024('0x33')]));_0x4ee8e2[_0x5024('0x32')]=_0x4ee8e2[_0x5024('0x32')][_0x5024('0x34')]?_0x4ee8e2[_0x5024('0x32')]:_0x4e6aa7[_0x5024('0x2e')];_0x4ee8e2[_0x5024('0x37')]=qs['sort'](_0x78b79[_0x5024('0x35')]['sort']);_0x4ee8e2[_0x5024('0x39')]=qs[_0x5024('0x30')](_[_0x5024('0x49')](_0x78b79[_0x5024('0x35')],_0x4e6aa7[_0x5024('0x30')]));if(_0x78b79[_0x5024('0x35')][_0x5024('0x3a')]){_0x4ee8e2[_0x5024('0x39')]=_[_0x5024('0x3b')](_0x4ee8e2[_0x5024('0x39')],{'$or':_[_0x5024('0x2a')](_0x4ee8e2[_0x5024('0x32')],function(_0x360396){var _0x2cf53c={};_0x2cf53c[_0x360396]={'$like':'%'+_0x78b79[_0x5024('0x35')][_0x5024('0x3a')]+'%'};return _0x2cf53c;})});}_0x4ee8e2=_[_0x5024('0x3b')]({},_0x4ee8e2,_0x78b79[_0x5024('0x3c')]);return _0x49a2ab[_0x5024('0x4d')](_0x4ee8e2);}})[_0x5024('0x25')](function(_0x3e7ba1){if(_0x3e7ba1){_0xfecb29=_0x3e7ba1[_0x5024('0x34')];if(!_0x78b79[_0x5024('0x35')]['hasOwnProperty']('nolimit')){_0x4ee8e2[_0x5024('0x1f')]=qs[_0x5024('0x1f')](_0x78b79[_0x5024('0x35')][_0x5024('0x1f')]);_0x4ee8e2[_0x5024('0x1d')]=qs[_0x5024('0x1d')](_0x78b79[_0x5024('0x35')][_0x5024('0x1d')]);}return _0x49a2ab[_0x5024('0x4d')](_0x4ee8e2);}})[_0x5024('0x25')](function(_0x3bd50b){if(_0x3bd50b){return _0x3bd50b?{'count':_0xfecb29,'rows':_0x3bd50b}:null;}})['then'](respondWithResult(_0xc8883c,null))[_0x5024('0x3f')](handleError(_0xc8883c,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index d6ad82e..92985c9 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 _0xb111=['api','bluebird','request-promise','path','exports','define','int_freshsales_configurations','lodash','util','../../config/logger'];(function(_0x302f55,_0x31872f){var _0x55ca94=function(_0x477ac3){while(--_0x477ac3){_0x302f55['push'](_0x302f55['shift']());}};_0x55ca94(++_0x31872f);}(_0xb111,0x1bf));var _0x1b11=function(_0x2506ac,_0xf002b5){_0x2506ac=_0x2506ac-0x0;var _0xa99340=_0xb111[_0x2506ac];return _0xa99340;};'use strict';var _=require(_0x1b11('0x0'));var util=require(_0x1b11('0x1'));var logger=require(_0x1b11('0x2'))(_0x1b11('0x3'));var moment=require('moment');var BPromise=require(_0x1b11('0x4'));var rp=require(_0x1b11('0x5'));var fs=require('fs');var path=require(_0x1b11('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intFreshsalesConfiguration.attributes');module[_0x1b11('0x7')]=function(_0x2021b5,_0xd5789f){return _0x2021b5[_0x1b11('0x8')]('FreshsalesConfiguration',attributes,{'tableName':_0x1b11('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa7a0=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','define','int_freshsales_configurations'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa7a0,0x111));var _0x0a7a=function(_0x199a61,_0x1b4c50){_0x199a61=_0x199a61-0x0;var _0x4693f4=_0xa7a0[_0x199a61];return _0x4693f4;};'use strict';var _=require(_0x0a7a('0x0'));var util=require(_0x0a7a('0x1'));var logger=require(_0x0a7a('0x2'))(_0x0a7a('0x3'));var moment=require(_0x0a7a('0x4'));var BPromise=require(_0x0a7a('0x5'));var rp=require(_0x0a7a('0x6'));var fs=require('fs');var path=require(_0x0a7a('0x7'));var rimraf=require(_0x0a7a('0x8'));var config=require(_0x0a7a('0x9'));var attributes=require(_0x0a7a('0xa'));module['exports']=function(_0x13f36f,_0x4ea1c8){return _0x13f36f[_0x0a7a('0xb')]('FreshsalesConfiguration',attributes,{'tableName':_0x0a7a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index e57dfe2..d42873b 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 _0xeb7c=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3c2501,_0x3cc108){var _0x52ac41=function(_0x6d60a8){while(--_0x6d60a8){_0x3c2501['push'](_0x3c2501['shift']());}};_0x52ac41(++_0x3cc108);}(_0xeb7c,0x101));var _0xceb7=function(_0x1c61c0,_0x2085e8){_0x1c61c0=_0x1c61c0-0x0;var _0x43ca03=_0xeb7c[_0x1c61c0];return _0x43ca03;};'use strict';var _=require(_0xceb7('0x0'));var util=require(_0xceb7('0x1'));var moment=require(_0xceb7('0x2'));var BPromise=require(_0xceb7('0x3'));var rs=require(_0xceb7('0x4'));var fs=require('fs');var Redis=require(_0xceb7('0x5'));var db=require(_0xceb7('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xceb7('0x7'))(_0xceb7('0x8'));var config=require('../../config/environment');var jayson=require(_0xceb7('0x9'));var client=jayson['client'][_0xceb7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x285b57,_0x38c7e1,_0x2da802){return new BPromise(function(_0x188e12,_0x33b039){return client['request'](_0x285b57,_0x2da802)[_0xceb7('0xb')](function(_0x4f2fd6){logger[_0xceb7('0xc')](_0xceb7('0xd'),_0x38c7e1,_0xceb7('0xe'));logger[_0xceb7('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x38c7e1,_0xceb7('0xe'),JSON['stringify'](_0x4f2fd6));if(_0x4f2fd6['error']){if(_0x4f2fd6[_0xceb7('0x10')][_0xceb7('0x11')]===0x1f4){logger[_0xceb7('0x10')](_0xceb7('0xd'),_0x38c7e1,_0x4f2fd6[_0xceb7('0x10')][_0xceb7('0x12')]);return _0x33b039(_0x4f2fd6[_0xceb7('0x10')]['message']);}logger['error'](_0xceb7('0xd'),_0x38c7e1,_0x4f2fd6[_0xceb7('0x10')][_0xceb7('0x12')]);return _0x188e12(_0x4f2fd6['error'][_0xceb7('0x12')]);}else{logger[_0xceb7('0xc')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x38c7e1,_0xceb7('0xe'));_0x188e12(_0x4f2fd6[_0xceb7('0x13')][_0xceb7('0x12')]);}})[_0xceb7('0x14')](function(_0x15dd50){logger[_0xceb7('0x10')](_0xceb7('0xd'),_0x38c7e1,_0x15dd50);_0x33b039(_0x15dd50);});});} \ No newline at end of file +var _0x3719=['request','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','code','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x4b9514,_0x3caf7d){var _0x192d80=function(_0x530cee){while(--_0x530cee){_0x4b9514['push'](_0x4b9514['shift']());}};_0x192d80(++_0x3caf7d);}(_0x3719,0xdb));var _0x9371=function(_0x550276,_0xe91137){_0x550276=_0x550276-0x0;var _0x542fcb=_0x3719[_0x550276];return _0x542fcb;};'use strict';var _=require(_0x9371('0x0'));var util=require(_0x9371('0x1'));var moment=require(_0x9371('0x2'));var BPromise=require(_0x9371('0x3'));var rs=require(_0x9371('0x4'));var fs=require('fs');var Redis=require(_0x9371('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9371('0x6'));var logger=require(_0x9371('0x7'))('rpc');var config=require(_0x9371('0x8'));var jayson=require(_0x9371('0x9'));var client=jayson[_0x9371('0xa')][_0x9371('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x55e0d7,_0x17ddcd,_0x91fa15){return new BPromise(function(_0x3fb3cc,_0x5ab4f1){return client[_0x9371('0xc')](_0x55e0d7,_0x91fa15)['then'](function(_0x1bba6a){logger[_0x9371('0xd')](_0x9371('0xe'),_0x17ddcd,_0x9371('0xf'));logger[_0x9371('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x17ddcd,_0x9371('0xf'),JSON['stringify'](_0x1bba6a));if(_0x1bba6a['error']){if(_0x1bba6a['error'][_0x9371('0x11')]===0x1f4){logger[_0x9371('0x12')](_0x9371('0xe'),_0x17ddcd,_0x1bba6a[_0x9371('0x12')][_0x9371('0x13')]);return _0x5ab4f1(_0x1bba6a[_0x9371('0x12')]['message']);}logger[_0x9371('0x12')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x17ddcd,_0x1bba6a[_0x9371('0x12')][_0x9371('0x13')]);return _0x3fb3cc(_0x1bba6a[_0x9371('0x12')][_0x9371('0x13')]);}else{logger[_0x9371('0xd')](_0x9371('0xe'),_0x17ddcd,_0x9371('0xf'));_0x3fb3cc(_0x1bba6a[_0x9371('0x14')][_0x9371('0x13')]);}})['catch'](function(_0x4bc04d){logger[_0x9371('0x12')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x17ddcd,_0x4bc04d);_0x5ab4f1(_0x4bc04d);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 1202517..be83a40 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 _0x0eec=['get','index','/:id','isAuthenticated','show','post','put','update','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x426076,_0xfdf5d2){var _0x1e9565=function(_0x38832a){while(--_0x38832a){_0x426076['push'](_0x426076['shift']());}};_0x1e9565(++_0xfdf5d2);}(_0x0eec,0xac));var _0xc0ee=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0eec[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xc0ee('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc0ee('0x1'));var express=require(_0xc0ee('0x2'));var router=express[_0xc0ee('0x3')]();var fs_extra=require(_0xc0ee('0x4'));var auth=require(_0xc0ee('0x5'));var interaction=require(_0xc0ee('0x6'));var config=require(_0xc0ee('0x7'));var controller=require('./intFreshsalesField.controller');router[_0xc0ee('0x8')]('/',auth['isAuthenticated'](),controller[_0xc0ee('0x9')]);router[_0xc0ee('0x8')](_0xc0ee('0xa'),auth[_0xc0ee('0xb')](),controller[_0xc0ee('0xc')]);router[_0xc0ee('0xd')]('/',auth[_0xc0ee('0xb')](),controller['create']);router[_0xc0ee('0xe')](_0xc0ee('0xa'),auth[_0xc0ee('0xb')](),controller[_0xc0ee('0xf')]);router[_0xc0ee('0x10')](_0xc0ee('0xa'),auth[_0xc0ee('0xb')](),controller['destroy']);module[_0xc0ee('0x11')]=router; \ No newline at end of file +var _0x5b05=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','index','get','/:id','isAuthenticated','show','create','put','delete','destroy','exports'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x5b05,0x190));var _0x55b0=function(_0x12e29a,_0x3479a5){_0x12e29a=_0x12e29a-0x0;var _0x1d1062=_0x5b05[_0x12e29a];return _0x1d1062;};'use strict';var multer=require('multer');var util=require(_0x55b0('0x0'));var path=require(_0x55b0('0x1'));var timeout=require(_0x55b0('0x2'));var express=require(_0x55b0('0x3'));var router=express[_0x55b0('0x4')]();var fs_extra=require(_0x55b0('0x5'));var auth=require(_0x55b0('0x6'));var interaction=require(_0x55b0('0x7'));var config=require(_0x55b0('0x8'));var controller=require(_0x55b0('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x55b0('0xa')]);router[_0x55b0('0xb')](_0x55b0('0xc'),auth[_0x55b0('0xd')](),controller[_0x55b0('0xe')]);router['post']('/',auth[_0x55b0('0xd')](),controller[_0x55b0('0xf')]);router[_0x55b0('0x10')](_0x55b0('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x55b0('0x11')](_0x55b0('0xc'),auth[_0x55b0('0xd')](),controller[_0x55b0('0x12')]);module[_0x55b0('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index e558e5e..ec81363 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 _0x05a3=['ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize'];(function(_0x1f5249,_0x5c4c86){var _0x20e223=function(_0x15eb45){while(--_0x15eb45){_0x1f5249['push'](_0x1f5249['shift']());}};_0x20e223(++_0x5c4c86);}(_0x05a3,0x17f));var _0x305a=function(_0x4d29a3,_0x4162fb){_0x4d29a3=_0x4d29a3-0x0;var _0x565bcf=_0x05a3[_0x4d29a3];return _0x565bcf;};'use strict';var Sequelize=require(_0x305a('0x0'));module['exports']={'type':{'type':Sequelize[_0x305a('0x1')](_0x305a('0x2'),_0x305a('0x3'),_0x305a('0x4'),_0x305a('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x305a('0x6')]},'key':{'type':Sequelize[_0x305a('0x6')]},'keyType':{'type':Sequelize[_0x305a('0x1')](_0x305a('0x2'),_0x305a('0x3'),_0x305a('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x305a('0x6')]},'nameField':{'type':Sequelize[_0x305a('0x6')]},'customField':{'type':Sequelize[_0x305a('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xcccd=['variable','customVariable','keyValue','picklist','STRING','string','BOOLEAN','sequelize','exports'];(function(_0x2b5b44,_0x17189c){var _0x32cb66=function(_0x4ce183){while(--_0x4ce183){_0x2b5b44['push'](_0x2b5b44['shift']());}};_0x32cb66(++_0x17189c);}(_0xcccd,0x181));var _0xdccc=function(_0x1a362a,_0x532d2e){_0x1a362a=_0x1a362a-0x0;var _0x1c6fc4=_0xcccd[_0x1a362a];return _0x1c6fc4;};'use strict';var Sequelize=require(_0xdccc('0x0'));module[_0xdccc('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0xdccc('0x2'),_0xdccc('0x3'),_0xdccc('0x4'),_0xdccc('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xdccc('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xdccc('0x7'),_0xdccc('0x2'),_0xdccc('0x3'))},'keyContent':{'type':Sequelize[_0xdccc('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xdccc('0x6')]},'customField':{'type':Sequelize[_0xdccc('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 7c1553c..2a99d39 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 _0x0b07=['moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','FreshsalesField','fieldName','type','key','model','query','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','length','create','body','find','params','rimraf','zip-dir','fast-json-patch'];(function(_0x3fe052,_0x3ed7aa){var _0x49d60f=function(_0x5ec19e){while(--_0x5ec19e){_0x3fe052['push'](_0x3fe052['shift']());}};_0x49d60f(++_0x3ed7aa);}(_0x0b07,0x1b3));var _0x70b0=function(_0x1d5a32,_0x47974a){_0x1d5a32=_0x1d5a32-0x0;var _0x361ca0=_0x0b07[_0x1d5a32];return _0x361ca0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x70b0('0x0'));var zipdir=require(_0x70b0('0x1'));var jsonpatch=require(_0x70b0('0x2'));var rp=require('request-promise');var moment=require(_0x70b0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x70b0('0x4'));var util=require(_0x70b0('0x5'));var path=require(_0x70b0('0x6'));var sox=require(_0x70b0('0x7'));var csv=require(_0x70b0('0x8'));var ejs=require(_0x70b0('0x9'));var fs=require('fs');var fs_extra=require(_0x70b0('0xa'));var _=require('lodash');var squel=require(_0x70b0('0xb'));var crypto=require('crypto');var jsforce=require(_0x70b0('0xc'));var deskjs=require(_0x70b0('0xd'));var toCsv=require(_0x70b0('0x8'));var querystring=require(_0x70b0('0xe'));var Papa=require(_0x70b0('0xf'));var Redis=require('ioredis');var authService=require(_0x70b0('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x70b0('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x70b0('0x12'))(_0x70b0('0x13'));var utils=require(_0x70b0('0x14'));var config=require(_0x70b0('0x15'));var licenseUtil=require(_0x70b0('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x576900,_0x430314){_0x430314=_0x430314||0xcc;return function(_0x5df74b){if(_0x5df74b){return _0x576900[_0x70b0('0x17')](_0x430314);}return _0x576900['status'](_0x430314)[_0x70b0('0x18')]();};}function respondWithResult(_0x187171,_0x207e62){_0x207e62=_0x207e62||0xc8;return function(_0x4b2cf6){if(_0x4b2cf6){return _0x187171[_0x70b0('0x19')](_0x207e62)['json'](_0x4b2cf6);}};}function respondWithFilteredResult(_0x373487,_0x207836){return function(_0x491fac){if(_0x491fac){var _0x417efe=typeof _0x207836[_0x70b0('0x1a')]===_0x70b0('0x1b')&&typeof _0x207836[_0x70b0('0x1c')]===_0x70b0('0x1b');var _0x18bb52=_0x491fac[_0x70b0('0x1d')];var _0x5868c0=_0x417efe?0x0:_0x207836[_0x70b0('0x1a')];var _0x34a601=_0x417efe?_0x491fac[_0x70b0('0x1d')]:_0x207836['offset']+_0x207836[_0x70b0('0x1c')];var _0x279cb7;if(_0x34a601>=_0x18bb52){_0x34a601=_0x18bb52;_0x279cb7=0xc8;}else{_0x279cb7=0xce;}_0x373487[_0x70b0('0x19')](_0x279cb7);return _0x373487['set'](_0x70b0('0x1e'),_0x5868c0+'-'+_0x34a601+'/'+_0x18bb52)['json'](_0x491fac);}return null;};}function patchUpdates(_0x2650c6){return function(_0x37d1c4){try{jsonpatch[_0x70b0('0x1f')](_0x37d1c4,_0x2650c6,!![]);}catch(_0x209eea){return BPromise[_0x70b0('0x20')](_0x209eea);}return _0x37d1c4[_0x70b0('0x21')]();};}function saveUpdates(_0x23ace5,_0x3996d8){return function(_0x15bb54){if(_0x15bb54){return _0x15bb54[_0x70b0('0x22')](_0x23ace5)[_0x70b0('0x23')](function(_0x573f3b){return _0x573f3b;});}return null;};}function removeEntity(_0x55a76f,_0x4eb1d3){return function(_0x3ed30e){if(_0x3ed30e){return _0x3ed30e[_0x70b0('0x24')]()['then'](function(){_0x55a76f['status'](0xcc)[_0x70b0('0x18')]();});}};}function handleEntityNotFound(_0x7cee28,_0x517706){return function(_0x3e55f8){if(!_0x3e55f8){_0x7cee28[_0x70b0('0x17')](0x194);}return _0x3e55f8;};}function handleError(_0x1fb2a6,_0x1bba14){_0x1bba14=_0x1bba14||0x1f4;return function(_0x5c06e1){logger[_0x70b0('0x25')](_0x5c06e1[_0x70b0('0x26')]);if(_0x5c06e1[_0x70b0('0x27')]){delete _0x5c06e1[_0x70b0('0x27')];}_0x1fb2a6[_0x70b0('0x19')](_0x1bba14)['send'](_0x5c06e1);};}exports[_0x70b0('0x28')]=function(_0xf0920f,_0x4844a2){var _0x2a7237={},_0x3c1c86={},_0x1deaa6={'count':0x0,'rows':[]};var _0x50df3d=_[_0x70b0('0x29')](db[_0x70b0('0x2a')]['rawAttributes'],function(_0x351c9d){return{'name':_0x351c9d[_0x70b0('0x2b')],'type':_0x351c9d[_0x70b0('0x2c')][_0x70b0('0x2d')]};});_0x3c1c86[_0x70b0('0x2e')]=_[_0x70b0('0x29')](_0x50df3d,_0x70b0('0x27'));_0x3c1c86[_0x70b0('0x2f')]=_['keys'](_0xf0920f[_0x70b0('0x2f')]);_0x3c1c86[_0x70b0('0x30')]=_[_0x70b0('0x31')](_0x3c1c86[_0x70b0('0x2e')],_0x3c1c86[_0x70b0('0x2f')]);_0x2a7237['attributes']=_[_0x70b0('0x31')](_0x3c1c86[_0x70b0('0x2e')],qs[_0x70b0('0x32')](_0xf0920f[_0x70b0('0x2f')][_0x70b0('0x32')]));_0x2a7237[_0x70b0('0x33')]=_0x2a7237[_0x70b0('0x33')]['length']?_0x2a7237[_0x70b0('0x33')]:_0x3c1c86[_0x70b0('0x2e')];if(!_0xf0920f[_0x70b0('0x2f')]['hasOwnProperty'](_0x70b0('0x34'))){_0x2a7237[_0x70b0('0x1c')]=qs[_0x70b0('0x1c')](_0xf0920f[_0x70b0('0x2f')][_0x70b0('0x1c')]);_0x2a7237[_0x70b0('0x1a')]=qs[_0x70b0('0x1a')](_0xf0920f['query'][_0x70b0('0x1a')]);}_0x2a7237[_0x70b0('0x35')]=qs[_0x70b0('0x36')](_0xf0920f[_0x70b0('0x2f')]['sort']);_0x2a7237[_0x70b0('0x37')]=qs[_0x70b0('0x30')](_[_0x70b0('0x38')](_0xf0920f['query'],_0x3c1c86[_0x70b0('0x30')]),_0x50df3d);if(_0xf0920f[_0x70b0('0x2f')][_0x70b0('0x39')]){_0x2a7237['where']=_['merge'](_0x2a7237[_0x70b0('0x37')],{'$or':_[_0x70b0('0x29')](_0x50df3d,function(_0x854ef){if(_0x854ef[_0x70b0('0x2c')]!=='VIRTUAL'){var _0x49d022={};_0x49d022[_0x854ef[_0x70b0('0x27')]]={'$like':'%'+_0xf0920f['query'][_0x70b0('0x39')]+'%'};return _0x49d022;}})});}_0x2a7237=_[_0x70b0('0x3a')]({},_0x2a7237,_0xf0920f[_0x70b0('0x3b')]);var _0x5d81ce={'where':_0x2a7237[_0x70b0('0x37')]};return db[_0x70b0('0x2a')][_0x70b0('0x1d')](_0x5d81ce)[_0x70b0('0x23')](function(_0x4ae6fc){_0x1deaa6[_0x70b0('0x1d')]=_0x4ae6fc;if(_0xf0920f[_0x70b0('0x2f')][_0x70b0('0x3c')]){_0x2a7237[_0x70b0('0x3d')]=[{'all':!![]}];}return db[_0x70b0('0x2a')][_0x70b0('0x3e')](_0x2a7237);})['then'](function(_0x5e9a5b){_0x1deaa6[_0x70b0('0x3f')]=_0x5e9a5b;return _0x1deaa6;})[_0x70b0('0x23')](respondWithFilteredResult(_0x4844a2,_0x2a7237))[_0x70b0('0x40')](handleError(_0x4844a2,null));};exports[_0x70b0('0x41')]=function(_0x3dafd3,_0x5143a0){var _0x3f61af={'raw':!![],'where':{'id':_0x3dafd3['params']['id']}},_0x3e6fb9={};_0x3e6fb9[_0x70b0('0x2e')]=_[_0x70b0('0x42')](db[_0x70b0('0x2a')][_0x70b0('0x43')]);_0x3e6fb9[_0x70b0('0x2f')]=_[_0x70b0('0x42')](_0x3dafd3[_0x70b0('0x2f')]);_0x3e6fb9[_0x70b0('0x30')]=_['intersection'](_0x3e6fb9[_0x70b0('0x2e')],_0x3e6fb9[_0x70b0('0x2f')]);_0x3f61af[_0x70b0('0x33')]=_['intersection'](_0x3e6fb9[_0x70b0('0x2e')],qs[_0x70b0('0x32')](_0x3dafd3[_0x70b0('0x2f')][_0x70b0('0x32')]));_0x3f61af[_0x70b0('0x33')]=_0x3f61af['attributes'][_0x70b0('0x44')]?_0x3f61af['attributes']:_0x3e6fb9[_0x70b0('0x2e')];if(_0x3dafd3[_0x70b0('0x2f')][_0x70b0('0x3c')]){_0x3f61af[_0x70b0('0x3d')]=[{'all':!![]}];}_0x3f61af=_[_0x70b0('0x3a')]({},_0x3f61af,_0x3dafd3[_0x70b0('0x3b')]);return db[_0x70b0('0x2a')]['find'](_0x3f61af)['then'](handleEntityNotFound(_0x5143a0,null))['then'](respondWithResult(_0x5143a0,null))[_0x70b0('0x40')](handleError(_0x5143a0,null));};exports[_0x70b0('0x45')]=function(_0x219026,_0x199f22){return db[_0x70b0('0x2a')][_0x70b0('0x45')](_0x219026['body'],{})['then'](respondWithResult(_0x199f22,0xc9))[_0x70b0('0x40')](handleError(_0x199f22,null));};exports[_0x70b0('0x22')]=function(_0x9254d9,_0x575077){if(_0x9254d9['body']['id']){delete _0x9254d9[_0x70b0('0x46')]['id'];}return db[_0x70b0('0x2a')][_0x70b0('0x47')]({'where':{'id':_0x9254d9[_0x70b0('0x48')]['id']}})[_0x70b0('0x23')](handleEntityNotFound(_0x575077,null))['then'](saveUpdates(_0x9254d9[_0x70b0('0x46')],null))[_0x70b0('0x23')](respondWithResult(_0x575077,null))[_0x70b0('0x40')](handleError(_0x575077,null));};exports[_0x70b0('0x24')]=function(_0x502318,_0x1243fc){return db[_0x70b0('0x2a')][_0x70b0('0x47')]({'where':{'id':_0x502318[_0x70b0('0x48')]['id']}})['then'](handleEntityNotFound(_0x1243fc,null))['then'](removeEntity(_0x1243fc,null))[_0x70b0('0x40')](handleError(_0x1243fc,null));}; \ No newline at end of file +var _0x9b06=['zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','reject','then','error','name','index','FreshsalesField','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','includeAll','findAll','rows','show','params','find','create','body','destroy','catch','eml-format'];(function(_0x2fdce0,_0x496242){var _0x36f07e=function(_0x44c8c6){while(--_0x44c8c6){_0x2fdce0['push'](_0x2fdce0['shift']());}};_0x36f07e(++_0x496242);}(_0x9b06,0x153));var _0x69b0=function(_0x20b7af,_0x53c3e9){_0x20b7af=_0x20b7af-0x0;var _0x5daa63=_0x9b06[_0x20b7af];return _0x5daa63;};'use strict';var emlformat=require(_0x69b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x69b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x69b0('0x2'));var moment=require(_0x69b0('0x3'));var BPromise=require(_0x69b0('0x4'));var Mustache=require(_0x69b0('0x5'));var util=require('util');var path=require(_0x69b0('0x6'));var sox=require(_0x69b0('0x7'));var csv=require(_0x69b0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x69b0('0x9'));var _=require(_0x69b0('0xa'));var squel=require('squel');var crypto=require(_0x69b0('0xb'));var jsforce=require(_0x69b0('0xc'));var deskjs=require(_0x69b0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x69b0('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x69b0('0xf'));var hardwareService=require(_0x69b0('0x10'));var logger=require(_0x69b0('0x11'))(_0x69b0('0x12'));var utils=require(_0x69b0('0x13'));var config=require(_0x69b0('0x14'));var licenseUtil=require(_0x69b0('0x15'));var db=require(_0x69b0('0x16'))['db'];function respondWithStatusCode(_0x4ff3fc,_0x3feb74){_0x3feb74=_0x3feb74||0xcc;return function(_0x5da1e0){if(_0x5da1e0){return _0x4ff3fc[_0x69b0('0x17')](_0x3feb74);}return _0x4ff3fc[_0x69b0('0x18')](_0x3feb74)[_0x69b0('0x19')]();};}function respondWithResult(_0x5668ce,_0x40a635){_0x40a635=_0x40a635||0xc8;return function(_0x26034d){if(_0x26034d){return _0x5668ce[_0x69b0('0x18')](_0x40a635)[_0x69b0('0x1a')](_0x26034d);}};}function respondWithFilteredResult(_0xb6f355,_0x848e42){return function(_0x3cbf0b){if(_0x3cbf0b){var _0x1ab23e=typeof _0x848e42[_0x69b0('0x1b')]==='undefined'&&typeof _0x848e42[_0x69b0('0x1c')]===_0x69b0('0x1d');var _0x539b25=_0x3cbf0b['count'];var _0x264ac5=_0x1ab23e?0x0:_0x848e42['offset'];var _0x5f3b1b=_0x1ab23e?_0x3cbf0b[_0x69b0('0x1e')]:_0x848e42['offset']+_0x848e42[_0x69b0('0x1c')];var _0x4e9855;if(_0x5f3b1b>=_0x539b25){_0x5f3b1b=_0x539b25;_0x4e9855=0xc8;}else{_0x4e9855=0xce;}_0xb6f355['status'](_0x4e9855);return _0xb6f355['set'](_0x69b0('0x1f'),_0x264ac5+'-'+_0x5f3b1b+'/'+_0x539b25)['json'](_0x3cbf0b);}return null;};}function patchUpdates(_0x6b1fc2){return function(_0x37295b){try{jsonpatch['apply'](_0x37295b,_0x6b1fc2,!![]);}catch(_0x2fd49d){return BPromise[_0x69b0('0x20')](_0x2fd49d);}return _0x37295b['save']();};}function saveUpdates(_0x24f4ff,_0x130fed){return function(_0x5e69f7){if(_0x5e69f7){return _0x5e69f7['update'](_0x24f4ff)[_0x69b0('0x21')](function(_0x1633d0){return _0x1633d0;});}return null;};}function removeEntity(_0x14f325,_0x5d3bde){return function(_0x4a8f50){if(_0x4a8f50){return _0x4a8f50['destroy']()[_0x69b0('0x21')](function(){_0x14f325[_0x69b0('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x542b3,_0xda5ecb){return function(_0x505367){if(!_0x505367){_0x542b3['sendStatus'](0x194);}return _0x505367;};}function handleError(_0x1f9bcf,_0x3a1e72){_0x3a1e72=_0x3a1e72||0x1f4;return function(_0x16db8e){logger[_0x69b0('0x22')](_0x16db8e['stack']);if(_0x16db8e[_0x69b0('0x23')]){delete _0x16db8e[_0x69b0('0x23')];}_0x1f9bcf[_0x69b0('0x18')](_0x3a1e72)['send'](_0x16db8e);};}exports[_0x69b0('0x24')]=function(_0x1ba8f7,_0xc0a5e5){var _0xcbab9d={},_0x5bdcb2={},_0xdf041e={'count':0x0,'rows':[]};var _0x7f2415=_['map'](db[_0x69b0('0x25')][_0x69b0('0x26')],function(_0x2b65d6){return{'name':_0x2b65d6[_0x69b0('0x27')],'type':_0x2b65d6[_0x69b0('0x28')][_0x69b0('0x29')]};});_0x5bdcb2[_0x69b0('0x2a')]=_[_0x69b0('0x2b')](_0x7f2415,_0x69b0('0x23'));_0x5bdcb2['query']=_[_0x69b0('0x2c')](_0x1ba8f7[_0x69b0('0x2d')]);_0x5bdcb2[_0x69b0('0x2e')]=_[_0x69b0('0x2f')](_0x5bdcb2['model'],_0x5bdcb2['query']);_0xcbab9d[_0x69b0('0x30')]=_[_0x69b0('0x2f')](_0x5bdcb2['model'],qs[_0x69b0('0x31')](_0x1ba8f7[_0x69b0('0x2d')][_0x69b0('0x31')]));_0xcbab9d['attributes']=_0xcbab9d['attributes'][_0x69b0('0x32')]?_0xcbab9d[_0x69b0('0x30')]:_0x5bdcb2[_0x69b0('0x2a')];if(!_0x1ba8f7[_0x69b0('0x2d')][_0x69b0('0x33')](_0x69b0('0x34'))){_0xcbab9d[_0x69b0('0x1c')]=qs['limit'](_0x1ba8f7[_0x69b0('0x2d')][_0x69b0('0x1c')]);_0xcbab9d[_0x69b0('0x1b')]=qs[_0x69b0('0x1b')](_0x1ba8f7[_0x69b0('0x2d')]['offset']);}_0xcbab9d[_0x69b0('0x35')]=qs[_0x69b0('0x36')](_0x1ba8f7[_0x69b0('0x2d')]['sort']);_0xcbab9d[_0x69b0('0x37')]=qs[_0x69b0('0x2e')](_[_0x69b0('0x38')](_0x1ba8f7[_0x69b0('0x2d')],_0x5bdcb2[_0x69b0('0x2e')]),_0x7f2415);if(_0x1ba8f7['query'][_0x69b0('0x39')]){_0xcbab9d['where']=_['merge'](_0xcbab9d[_0x69b0('0x37')],{'$or':_['map'](_0x7f2415,function(_0x118989){if(_0x118989[_0x69b0('0x28')]!=='VIRTUAL'){var _0x827746={};_0x827746[_0x118989[_0x69b0('0x23')]]={'$like':'%'+_0x1ba8f7[_0x69b0('0x2d')]['filter']+'%'};return _0x827746;}})});}_0xcbab9d=_['merge']({},_0xcbab9d,_0x1ba8f7['options']);var _0x29ed8a={'where':_0xcbab9d[_0x69b0('0x37')]};return db[_0x69b0('0x25')][_0x69b0('0x1e')](_0x29ed8a)['then'](function(_0x2eabad){_0xdf041e['count']=_0x2eabad;if(_0x1ba8f7[_0x69b0('0x2d')][_0x69b0('0x3a')]){_0xcbab9d['include']=[{'all':!![]}];}return db[_0x69b0('0x25')][_0x69b0('0x3b')](_0xcbab9d);})[_0x69b0('0x21')](function(_0x38d520){_0xdf041e[_0x69b0('0x3c')]=_0x38d520;return _0xdf041e;})[_0x69b0('0x21')](respondWithFilteredResult(_0xc0a5e5,_0xcbab9d))['catch'](handleError(_0xc0a5e5,null));};exports[_0x69b0('0x3d')]=function(_0x32334c,_0x4f6086){var _0x59306d={'raw':!![],'where':{'id':_0x32334c[_0x69b0('0x3e')]['id']}},_0x17bda9={};_0x17bda9[_0x69b0('0x2a')]=_[_0x69b0('0x2c')](db['FreshsalesField'][_0x69b0('0x26')]);_0x17bda9[_0x69b0('0x2d')]=_['keys'](_0x32334c[_0x69b0('0x2d')]);_0x17bda9[_0x69b0('0x2e')]=_[_0x69b0('0x2f')](_0x17bda9[_0x69b0('0x2a')],_0x17bda9[_0x69b0('0x2d')]);_0x59306d['attributes']=_['intersection'](_0x17bda9[_0x69b0('0x2a')],qs[_0x69b0('0x31')](_0x32334c['query'][_0x69b0('0x31')]));_0x59306d[_0x69b0('0x30')]=_0x59306d[_0x69b0('0x30')][_0x69b0('0x32')]?_0x59306d[_0x69b0('0x30')]:_0x17bda9[_0x69b0('0x2a')];if(_0x32334c[_0x69b0('0x2d')][_0x69b0('0x3a')]){_0x59306d['include']=[{'all':!![]}];}_0x59306d=_['merge']({},_0x59306d,_0x32334c['options']);return db[_0x69b0('0x25')][_0x69b0('0x3f')](_0x59306d)['then'](handleEntityNotFound(_0x4f6086,null))[_0x69b0('0x21')](respondWithResult(_0x4f6086,null))['catch'](handleError(_0x4f6086,null));};exports[_0x69b0('0x40')]=function(_0x567eee,_0x99d260){return db[_0x69b0('0x25')]['create'](_0x567eee['body'],{})[_0x69b0('0x21')](respondWithResult(_0x99d260,0xc9))['catch'](handleError(_0x99d260,null));};exports['update']=function(_0x482ec1,_0x875ad2){if(_0x482ec1[_0x69b0('0x41')]['id']){delete _0x482ec1[_0x69b0('0x41')]['id'];}return db[_0x69b0('0x25')][_0x69b0('0x3f')]({'where':{'id':_0x482ec1[_0x69b0('0x3e')]['id']}})[_0x69b0('0x21')](handleEntityNotFound(_0x875ad2,null))[_0x69b0('0x21')](saveUpdates(_0x482ec1['body'],null))[_0x69b0('0x21')](respondWithResult(_0x875ad2,null))['catch'](handleError(_0x875ad2,null));};exports[_0x69b0('0x42')]=function(_0x427450,_0x3a25db){return db[_0x69b0('0x25')][_0x69b0('0x3f')]({'where':{'id':_0x427450[_0x69b0('0x3e')]['id']}})[_0x69b0('0x21')](handleEntityNotFound(_0x3a25db,null))[_0x69b0('0x21')](removeEntity(_0x3a25db,null))[_0x69b0('0x43')](handleError(_0x3a25db,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index ee4f206..e535aab 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 _0x0b63=['FreshsalesField','freshsales_unique_index','FieldId','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshsalesField.attributes','exports'];(function(_0x28ab01,_0x4fae50){var _0x56e061=function(_0x5124df){while(--_0x5124df){_0x28ab01['push'](_0x28ab01['shift']());}};_0x56e061(++_0x4fae50);}(_0x0b63,0xe7));var _0x30b6=function(_0x2daa74,_0x1ef7a9){_0x2daa74=_0x2daa74-0x0;var _0x454b8e=_0x0b63[_0x2daa74];return _0x454b8e;};'use strict';var _=require(_0x30b6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x30b6('0x1'));var moment=require(_0x30b6('0x2'));var BPromise=require(_0x30b6('0x3'));var rp=require(_0x30b6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x30b6('0x5'));var config=require(_0x30b6('0x6'));var attributes=require(_0x30b6('0x7'));module[_0x30b6('0x8')]=function(_0x2670c6,_0x2fddeb){return _0x2670c6['define'](_0x30b6('0x9'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0x30b6('0xa'),'fields':['idField',_0x30b6('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0b63=['FreshsalesField','freshsales_unique_index','FieldId','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshsalesField.attributes','exports'];(function(_0x38c444,_0x5ec309){var _0x1107fc=function(_0x421aa5){while(--_0x421aa5){_0x38c444['push'](_0x38c444['shift']());}};_0x1107fc(++_0x5ec309);}(_0x0b63,0xe7));var _0x30b6=function(_0x110b3c,_0x31d292){_0x110b3c=_0x110b3c-0x0;var _0x2ba902=_0x0b63[_0x110b3c];return _0x2ba902;};'use strict';var _=require(_0x30b6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x30b6('0x1'));var moment=require(_0x30b6('0x2'));var BPromise=require(_0x30b6('0x3'));var rp=require(_0x30b6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x30b6('0x5'));var config=require(_0x30b6('0x6'));var attributes=require(_0x30b6('0x7'));module[_0x30b6('0x8')]=function(_0x2670c6,_0x2fddeb){return _0x2670c6['define'](_0x30b6('0x9'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0x30b6('0xa'),'fields':['idField',_0x30b6('0xb')],'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 5078229..d9ce904 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 _0x5d58=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x234995,_0x48c007){var _0x5115f0=function(_0x7f8704){while(--_0x7f8704){_0x234995['push'](_0x234995['shift']());}};_0x5115f0(++_0x48c007);}(_0x5d58,0x187));var _0x85d5=function(_0xc4558,_0x3bf609){_0xc4558=_0xc4558-0x0;var _0x2f7d01=_0x5d58[_0xc4558];return _0x2f7d01;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x85d5('0x0'));var db=require(_0x85d5('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x85d5('0x2'))(_0x85d5('0x3'));var config=require('../../config/environment');var jayson=require(_0x85d5('0x4'));var client=jayson[_0x85d5('0x5')][_0x85d5('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x46e7b4,_0x5f47ec,_0x98c963){return new BPromise(function(_0x3fecca,_0x4ca293){return client[_0x85d5('0x7')](_0x46e7b4,_0x98c963)['then'](function(_0x1098be){logger[_0x85d5('0x8')](_0x85d5('0x9'),_0x5f47ec,'request\x20sent');logger['debug']('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x5f47ec,_0x85d5('0xa'),JSON[_0x85d5('0xb')](_0x1098be));if(_0x1098be[_0x85d5('0xc')]){if(_0x1098be[_0x85d5('0xc')][_0x85d5('0xd')]===0x1f4){logger[_0x85d5('0xc')](_0x85d5('0x9'),_0x5f47ec,_0x1098be['error']['message']);return _0x4ca293(_0x1098be['error'][_0x85d5('0xe')]);}logger[_0x85d5('0xc')](_0x85d5('0x9'),_0x5f47ec,_0x1098be[_0x85d5('0xc')][_0x85d5('0xe')]);return _0x3fecca(_0x1098be[_0x85d5('0xc')][_0x85d5('0xe')]);}else{logger['info'](_0x85d5('0x9'),_0x5f47ec,_0x85d5('0xa'));_0x3fecca(_0x1098be[_0x85d5('0xf')][_0x85d5('0xe')]);}})[_0x85d5('0x10')](function(_0x3dc83c){logger[_0x85d5('0xc')](_0x85d5('0x9'),_0x5f47ec,_0x3dc83c);_0x4ca293(_0x3dc83c);});});} \ No newline at end of file +var _0x524e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','moment','bluebird'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x524e,0x15e));var _0xe524=function(_0xf10295,_0x3ca87e){_0xf10295=_0xf10295-0x0;var _0x4f0555=_0x524e[_0xf10295];return _0x4f0555;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe524('0x0'));var BPromise=require(_0xe524('0x1'));var rs=require(_0xe524('0x2'));var fs=require('fs');var Redis=require(_0xe524('0x3'));var db=require(_0xe524('0x4'))['db'];var utils=require(_0xe524('0x5'));var logger=require(_0xe524('0x6'))(_0xe524('0x7'));var config=require(_0xe524('0x8'));var jayson=require(_0xe524('0x9'));var client=jayson['client'][_0xe524('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41e1a3,_0x347bed,_0x533c14){return new BPromise(function(_0x384935,_0x3e4cda){return client[_0xe524('0xb')](_0x41e1a3,_0x533c14)[_0xe524('0xc')](function(_0x991924){logger[_0xe524('0xd')](_0xe524('0xe'),_0x347bed,_0xe524('0xf'));logger[_0xe524('0x10')](_0xe524('0x11'),_0x347bed,_0xe524('0xf'),JSON[_0xe524('0x12')](_0x991924));if(_0x991924[_0xe524('0x13')]){if(_0x991924[_0xe524('0x13')][_0xe524('0x14')]===0x1f4){logger[_0xe524('0x13')]('FreshsalesField,\x20%s,\x20%s',_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x3e4cda(_0x991924[_0xe524('0x13')][_0xe524('0x15')]);}logger[_0xe524('0x13')](_0xe524('0xe'),_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x384935(_0x991924['error'][_0xe524('0x15')]);}else{logger[_0xe524('0xd')]('FreshsalesField,\x20%s,\x20%s',_0x347bed,_0xe524('0xf'));_0x384935(_0x991924['result'][_0xe524('0x15')]);}})['catch'](function(_0x29a031){logger['error']('FreshsalesField,\x20%s,\x20%s',_0x347bed,_0x29a031);_0x3e4cda(_0x29a031);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 99e40fc..6df5158 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x335f76,_0x3c89af){var _0x336ff8=function(_0x3d935d){while(--_0x3d935d){_0x335f76['push'](_0x335f76['shift']());}};_0x336ff8(++_0x3c89af);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x26ab81,_0x43e7bc){var _0x56ed81=function(_0xd583d0){while(--_0xd583d0){_0x26ab81['push'](_0x26ab81['shift']());}};_0x56ed81(++_0x43e7bc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'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 e36202e..a0c8e5f 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 _0x15e8=['STRING','username','ENUM','integrationTab','newTab','exports'];(function(_0x41d45e,_0x38de05){var _0x5ce9cc=function(_0x48a7ae){while(--_0x48a7ae){_0x41d45e['push'](_0x41d45e['shift']());}};_0x5ce9cc(++_0x38de05);}(_0x15e8,0x13d));var _0x815e=function(_0x1d00eb,_0x3386de){_0x1d00eb=_0x1d00eb-0x0;var _0x4dd547=_0x15e8[_0x1d00eb];return _0x4dd547;};'use strict';var Sequelize=require('sequelize');module[_0x815e('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x815e('0x1')]},'username':{'type':Sequelize[_0x815e('0x1')],'unique':_0x815e('0x2')},'remoteUri':{'type':Sequelize[_0x815e('0x1')]},'password':{'type':Sequelize[_0x815e('0x1')]},'clientId':{'type':Sequelize[_0x815e('0x1')]},'clientSecret':{'type':Sequelize[_0x815e('0x1')]},'securityToken':{'type':Sequelize[_0x815e('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x815e('0x3')](_0x815e('0x4'),_0x815e('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xc429=['username','ENUM','integrationTab','newTab','sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc429,0x1ba));var _0x9c42=function(_0x305b20,_0x5e57e9){_0x305b20=_0x305b20-0x0;var _0x26d64a=_0xc429[_0x305b20];return _0x26d64a;};'use strict';var Sequelize=require(_0x9c42('0x0'));module['exports']={'name':{'type':Sequelize[_0x9c42('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x9c42('0x2')},'remoteUri':{'type':Sequelize[_0x9c42('0x1')]},'password':{'type':Sequelize[_0x9c42('0x1')]},'clientId':{'type':Sequelize[_0x9c42('0x1')]},'clientSecret':{'type':Sequelize[_0x9c42('0x1')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x9c42('0x3')](_0x9c42('0x4'),_0x9c42('0x5')),'defaultValue':_0x9c42('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 21283d3..b522c76 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 _0xe241=['update','then','destroy','error','stack','name','map','SalesforceAccount','rawAttributes','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','create','body','catch','find','findOne','SalesforceConfiguration','getConfigurations','addConfiguration','Subjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','username','password','securityToken','slice','lastIndexOf','login','concat','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Description','int','picklist','email','textarea','includes','label','custom','picklistValues','value','boolean','true','false','test','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','save'];(function(_0x3b96cf,_0x1592f2){var _0x2e315a=function(_0x21fa50){while(--_0x21fa50){_0x3b96cf['push'](_0x3b96cf['shift']());}};_0x2e315a(++_0x1592f2);}(_0xe241,0xcc));var _0x1e24=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xe241[_0x4ae6ef];return _0x3cbb4e;};'use strict';var emlformat=require(_0x1e24('0x0'));var rimraf=require(_0x1e24('0x1'));var zipdir=require(_0x1e24('0x2'));var jsonpatch=require(_0x1e24('0x3'));var rp=require(_0x1e24('0x4'));var moment=require('moment');var BPromise=require(_0x1e24('0x5'));var Mustache=require(_0x1e24('0x6'));var util=require(_0x1e24('0x7'));var path=require(_0x1e24('0x8'));var sox=require(_0x1e24('0x9'));var csv=require('to-csv');var ejs=require(_0x1e24('0xa'));var fs=require('fs');var fs_extra=require(_0x1e24('0xb'));var _=require('lodash');var squel=require(_0x1e24('0xc'));var crypto=require(_0x1e24('0xd'));var jsforce=require(_0x1e24('0xe'));var deskjs=require(_0x1e24('0xf'));var toCsv=require(_0x1e24('0x10'));var querystring=require(_0x1e24('0x11'));var Papa=require(_0x1e24('0x12'));var Redis=require('ioredis');var authService=require(_0x1e24('0x13'));var qs=require(_0x1e24('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1e24('0x15'));var logger=require('../../config/logger')(_0x1e24('0x16'));var utils=require(_0x1e24('0x17'));var config=require(_0x1e24('0x18'));var licenseUtil=require(_0x1e24('0x19'));var db=require('../../mysqldb')['db'];var integrations=require(_0x1e24('0x1a'));function respondWithStatusCode(_0x26d847,_0x160576){_0x160576=_0x160576||0xcc;return function(_0x327d09){if(_0x327d09){return _0x26d847[_0x1e24('0x1b')](_0x160576);}return _0x26d847[_0x1e24('0x1c')](_0x160576)[_0x1e24('0x1d')]();};}function respondWithResult(_0x2c4bef,_0x55a14c){_0x55a14c=_0x55a14c||0xc8;return function(_0x5b821c){if(_0x5b821c){return _0x2c4bef[_0x1e24('0x1c')](_0x55a14c)['json'](_0x5b821c);}};}function respondWithFilteredResult(_0x12ed5c,_0x3ff109){return function(_0x1538b1){if(_0x1538b1){var _0x3d9e7b=typeof _0x3ff109[_0x1e24('0x1e')]===_0x1e24('0x1f')&&typeof _0x3ff109['limit']==='undefined';var _0x42eb68=_0x1538b1[_0x1e24('0x20')];var _0x426686=_0x3d9e7b?0x0:_0x3ff109['offset'];var _0x51772d=_0x3d9e7b?_0x1538b1[_0x1e24('0x20')]:_0x3ff109[_0x1e24('0x1e')]+_0x3ff109[_0x1e24('0x21')];var _0x50ce04;if(_0x51772d>=_0x42eb68){_0x51772d=_0x42eb68;_0x50ce04=0xc8;}else{_0x50ce04=0xce;}_0x12ed5c[_0x1e24('0x1c')](_0x50ce04);return _0x12ed5c[_0x1e24('0x22')](_0x1e24('0x23'),_0x426686+'-'+_0x51772d+'/'+_0x42eb68)[_0x1e24('0x24')](_0x1538b1);}return null;};}function patchUpdates(_0x1088ac){return function(_0x24777a){try{jsonpatch['apply'](_0x24777a,_0x1088ac,!![]);}catch(_0x50103a){return BPromise['reject'](_0x50103a);}return _0x24777a[_0x1e24('0x25')]();};}function saveUpdates(_0x227c78,_0x51bbc6){return function(_0x2b2be0){if(_0x2b2be0){return _0x2b2be0[_0x1e24('0x26')](_0x227c78)[_0x1e24('0x27')](function(_0x2b1390){return _0x2b1390;});}return null;};}function removeEntity(_0x47c5a1,_0x4c7a8b){return function(_0x5f4b6d){if(_0x5f4b6d){return _0x5f4b6d[_0x1e24('0x28')]()['then'](function(){_0x47c5a1['status'](0xcc)[_0x1e24('0x1d')]();});}};}function handleEntityNotFound(_0x56ba76,_0x3f3666){return function(_0x3ed5f5){if(!_0x3ed5f5){_0x56ba76['sendStatus'](0x194);}return _0x3ed5f5;};}function handleError(_0x2cbf32,_0x22b3ad){_0x22b3ad=_0x22b3ad||0x1f4;return function(_0x5e2b88){logger[_0x1e24('0x29')](_0x5e2b88[_0x1e24('0x2a')]);if(_0x5e2b88[_0x1e24('0x2b')]){delete _0x5e2b88['name'];}_0x2cbf32[_0x1e24('0x1c')](_0x22b3ad)['send'](_0x5e2b88);};}exports['index']=function(_0xad7c70,_0x5c19d9){var _0x5db350={},_0x384c49={},_0x3fba19={'count':0x0,'rows':[]};var _0x1417eb=_[_0x1e24('0x2c')](db[_0x1e24('0x2d')][_0x1e24('0x2e')],function(_0x1d65b4){return{'name':_0x1d65b4['fieldName'],'type':_0x1d65b4[_0x1e24('0x2f')][_0x1e24('0x30')]};});_0x384c49['model']=_[_0x1e24('0x2c')](_0x1417eb,'name');_0x384c49[_0x1e24('0x31')]=_['keys'](_0xad7c70[_0x1e24('0x31')]);_0x384c49['filters']=_[_0x1e24('0x32')](_0x384c49[_0x1e24('0x33')],_0x384c49[_0x1e24('0x31')]);_0x5db350[_0x1e24('0x34')]=_[_0x1e24('0x32')](_0x384c49['model'],qs[_0x1e24('0x35')](_0xad7c70[_0x1e24('0x31')][_0x1e24('0x35')]));_0x5db350[_0x1e24('0x34')]=_0x5db350[_0x1e24('0x34')][_0x1e24('0x36')]?_0x5db350['attributes']:_0x384c49['model'];if(!_0xad7c70['query'][_0x1e24('0x37')](_0x1e24('0x38'))){_0x5db350[_0x1e24('0x21')]=qs[_0x1e24('0x21')](_0xad7c70[_0x1e24('0x31')]['limit']);_0x5db350[_0x1e24('0x1e')]=qs[_0x1e24('0x1e')](_0xad7c70[_0x1e24('0x31')][_0x1e24('0x1e')]);}_0x5db350[_0x1e24('0x39')]=qs[_0x1e24('0x3a')](_0xad7c70[_0x1e24('0x31')][_0x1e24('0x3a')]);_0x5db350[_0x1e24('0x3b')]=qs['filters'](_[_0x1e24('0x3c')](_0xad7c70['query'],_0x384c49[_0x1e24('0x3d')]),_0x1417eb);if(_0xad7c70['query'][_0x1e24('0x3e')]){_0x5db350[_0x1e24('0x3b')]=_[_0x1e24('0x3f')](_0x5db350['where'],{'$or':_[_0x1e24('0x2c')](_0x1417eb,function(_0x27c155){if(_0x27c155[_0x1e24('0x2f')]!==_0x1e24('0x40')){var _0x4fcc08={};_0x4fcc08[_0x27c155[_0x1e24('0x2b')]]={'$like':'%'+_0xad7c70[_0x1e24('0x31')]['filter']+'%'};return _0x4fcc08;}})});}_0x5db350=_[_0x1e24('0x3f')]({},_0x5db350,_0xad7c70[_0x1e24('0x41')]);var _0x3170bf={'where':_0x5db350[_0x1e24('0x3b')]};return db['SalesforceAccount'][_0x1e24('0x20')](_0x3170bf)[_0x1e24('0x27')](function(_0x5664e4){_0x3fba19[_0x1e24('0x20')]=_0x5664e4;if(_0xad7c70['query'][_0x1e24('0x42')]){_0x5db350[_0x1e24('0x43')]=[{'all':!![]}];}return db[_0x1e24('0x2d')][_0x1e24('0x44')](_0x5db350);})['then'](function(_0x117db8){_0x3fba19[_0x1e24('0x45')]=_0x117db8;return _0x3fba19;})[_0x1e24('0x27')](respondWithFilteredResult(_0x5c19d9,_0x5db350))['catch'](handleError(_0x5c19d9,null));};exports[_0x1e24('0x46')]=function(_0x6cb8f6,_0x445f60){var _0x1ae78c={'raw':![],'where':{'id':_0x6cb8f6[_0x1e24('0x47')]['id']}},_0x38227b={};_0x38227b[_0x1e24('0x33')]=_[_0x1e24('0x48')](db['SalesforceAccount']['rawAttributes']);_0x38227b['query']=_[_0x1e24('0x48')](_0x6cb8f6[_0x1e24('0x31')]);_0x38227b['filters']=_[_0x1e24('0x32')](_0x38227b['model'],_0x38227b['query']);_0x1ae78c['attributes']=_[_0x1e24('0x32')](_0x38227b[_0x1e24('0x33')],qs[_0x1e24('0x35')](_0x6cb8f6['query'][_0x1e24('0x35')]));_0x1ae78c[_0x1e24('0x34')]=_0x1ae78c[_0x1e24('0x34')][_0x1e24('0x36')]?_0x1ae78c[_0x1e24('0x34')]:_0x38227b[_0x1e24('0x33')];if(_0x6cb8f6[_0x1e24('0x31')][_0x1e24('0x42')]){_0x1ae78c[_0x1e24('0x43')]=[{'all':!![]}];}_0x1ae78c=_[_0x1e24('0x3f')]({},_0x1ae78c,_0x6cb8f6[_0x1e24('0x41')]);return db[_0x1e24('0x2d')]['find'](_0x1ae78c)[_0x1e24('0x27')](handleEntityNotFound(_0x445f60,null))['then'](respondWithResult(_0x445f60,null))['catch'](handleError(_0x445f60,null));};exports['create']=function(_0x3ba21d,_0x365ee9){return db[_0x1e24('0x2d')][_0x1e24('0x49')](_0x3ba21d[_0x1e24('0x4a')],{})[_0x1e24('0x27')](respondWithResult(_0x365ee9,0xc9))[_0x1e24('0x4b')](handleError(_0x365ee9,null));};exports[_0x1e24('0x26')]=function(_0x34173c,_0x143ec6){if(_0x34173c[_0x1e24('0x4a')]['id']){delete _0x34173c[_0x1e24('0x4a')]['id'];}return db['SalesforceAccount'][_0x1e24('0x4c')]({'where':{'id':_0x34173c['params']['id']}})['then'](handleEntityNotFound(_0x143ec6,null))[_0x1e24('0x27')](saveUpdates(_0x34173c[_0x1e24('0x4a')],null))[_0x1e24('0x27')](respondWithResult(_0x143ec6,null))['catch'](handleError(_0x143ec6,null));};exports[_0x1e24('0x28')]=function(_0x39e766,_0x3225d0){return db[_0x1e24('0x2d')][_0x1e24('0x4c')]({'where':{'id':_0x39e766[_0x1e24('0x47')]['id']}})[_0x1e24('0x27')](handleEntityNotFound(_0x3225d0,null))[_0x1e24('0x27')](removeEntity(_0x3225d0,null))[_0x1e24('0x4b')](handleError(_0x3225d0,null));};exports['getConfigurations']=function(_0x36cc6e,_0x36b856,_0x51dce9){var _0x49c1ff={};var _0x49b790={};var _0x509086;var _0x315f63;return db[_0x1e24('0x2d')][_0x1e24('0x4d')]({'where':{'id':_0x36cc6e[_0x1e24('0x47')]['id']}})[_0x1e24('0x27')](handleEntityNotFound(_0x36b856,null))[_0x1e24('0x27')](function(_0x3b5fdd){if(_0x3b5fdd){_0x509086=_0x3b5fdd;_0x49b790[_0x1e24('0x33')]=_[_0x1e24('0x48')](db[_0x1e24('0x4e')][_0x1e24('0x2e')]);_0x49b790[_0x1e24('0x31')]=_[_0x1e24('0x48')](_0x36cc6e[_0x1e24('0x31')]);_0x49b790[_0x1e24('0x3d')]=_[_0x1e24('0x32')](_0x49b790['model'],_0x49b790['query']);_0x49c1ff[_0x1e24('0x34')]=_['intersection'](_0x49b790[_0x1e24('0x33')],qs[_0x1e24('0x35')](_0x36cc6e[_0x1e24('0x31')]['fields']));_0x49c1ff['attributes']=_0x49c1ff[_0x1e24('0x34')][_0x1e24('0x36')]?_0x49c1ff['attributes']:_0x49b790[_0x1e24('0x33')];_0x49c1ff['order']=qs['sort'](_0x36cc6e[_0x1e24('0x31')]['sort']);_0x49c1ff[_0x1e24('0x3b')]=qs[_0x1e24('0x3d')](_[_0x1e24('0x3c')](_0x36cc6e[_0x1e24('0x31')],_0x49b790[_0x1e24('0x3d')]));if(_0x36cc6e[_0x1e24('0x31')]['filter']){_0x49c1ff[_0x1e24('0x3b')]=_['merge'](_0x49c1ff[_0x1e24('0x3b')],{'$or':_[_0x1e24('0x2c')](_0x49c1ff[_0x1e24('0x34')],function(_0x551759){var _0x894227={};_0x894227[_0x551759]={'$like':'%'+_0x36cc6e[_0x1e24('0x31')]['filter']+'%'};return _0x894227;})});}_0x49c1ff=_['merge']({},_0x49c1ff,_0x36cc6e[_0x1e24('0x41')]);return _0x509086[_0x1e24('0x4f')](_0x49c1ff);}})[_0x1e24('0x27')](function(_0x311b60){if(_0x311b60){_0x315f63=_0x311b60[_0x1e24('0x36')];if(!_0x36cc6e[_0x1e24('0x31')][_0x1e24('0x37')](_0x1e24('0x38'))){_0x49c1ff[_0x1e24('0x21')]=qs['limit'](_0x36cc6e[_0x1e24('0x31')][_0x1e24('0x21')]);_0x49c1ff['offset']=qs['offset'](_0x36cc6e[_0x1e24('0x31')][_0x1e24('0x1e')]);}return _0x509086[_0x1e24('0x4f')](_0x49c1ff);}})['then'](function(_0x19dc3c){if(_0x19dc3c){return _0x19dc3c?{'count':_0x315f63,'rows':_0x19dc3c}:null;}})[_0x1e24('0x27')](respondWithResult(_0x36b856,null))[_0x1e24('0x4b')](handleError(_0x36b856,null));};exports[_0x1e24('0x50')]=function(_0x27f790,_0x2f6b97,_0xf1ef0d){if(_0x27f790[_0x1e24('0x4a')]['id']){delete _0x27f790['body']['id'];}return db[_0x1e24('0x2d')][_0x1e24('0x4d')]({'where':{'id':_0x27f790[_0x1e24('0x47')]['id']}})[_0x1e24('0x27')](handleEntityNotFound(_0x2f6b97,null))[_0x1e24('0x27')](function(_0x35ebd8){if(_0x35ebd8){_0x27f790['body']['AccountId']=_0x35ebd8['id'];_0x27f790[_0x1e24('0x4a')][_0x1e24('0x51')]=integrations['getSubjects'](_0x27f790['body'][_0x1e24('0x52')],_0x27f790[_0x1e24('0x4a')][_0x1e24('0x2f')]);_0x27f790[_0x1e24('0x4a')][_0x1e24('0x53')]=integrations[_0x1e24('0x54')](_0x27f790[_0x1e24('0x4a')][_0x1e24('0x52')],_0x27f790[_0x1e24('0x4a')][_0x1e24('0x2f')]);return db[_0x1e24('0x4e')][_0x1e24('0x49')](_0x27f790['body'],{'include':[{'model':db[_0x1e24('0x55')],'as':'Subjects'},{'model':db[_0x1e24('0x55')],'as':_0x1e24('0x53')}]});}return null;})[_0x1e24('0x27')](respondWithResult(_0x2f6b97,null))['catch'](handleError(_0x2f6b97,null));};exports[_0x1e24('0x56')]=function(_0x1d78d6,_0x36193b,_0xac2760){var _0x2bc087;var _0x45302e='';var _0x28da6b=_0x1e24('0x57');return db[_0x1e24('0x2d')]['findOne']({'where':{'id':_0x1d78d6[_0x1e24('0x47')]['id']},'attributes':['id',_0x1e24('0x58'),_0x1e24('0x59'),_0x1e24('0x5a'),_0x1e24('0x5b'),_0x1e24('0x5c'),_0x1e24('0x5d')]})['then'](handleEntityNotFound(_0x36193b,null))['then'](function(_0x1978cd){if(_0x1978cd){_0x45302e=_0x1978cd[_0x1e24('0x58')];var _0x50ee19=_0x45302e[_0x1e24('0x5e')](-0x1);if(_0x50ee19==='/'){_0x45302e=_0x45302e['substring'](0x0,_0x45302e[_0x1e24('0x5f')](_0x50ee19));}_0x2bc087=new jsforce['Connection']({'oauth2':{'loginUrl':_0x45302e,'clientId':_0x1978cd[_0x1e24('0x59')],'clientSecret':_0x1978cd[_0x1e24('0x5a')]}});return _0x2bc087[_0x1e24('0x60')](_0x1978cd[_0x1e24('0x5b')],_0x1978cd[_0x1e24('0x5c')][_0x1e24('0x61')](_0x1978cd[_0x1e24('0x5d')]));}})['then'](function(_0x2e6c08){if(_0x2e6c08){if(!_['isNil'](_0x1d78d6[_0x1e24('0x31')][_0x1e24('0x62')])){_0x28da6b=_0x1d78d6[_0x1e24('0x31')][_0x1e24('0x62')];}return _0x2bc087[_0x1e24('0x63')](_0x28da6b)[_0x1e24('0x64')]();}})[_0x1e24('0x27')](function(_0x126f8e){var _0x10e596=[_0x1e24('0x65'),_0x1e24('0x66'),_0x1e24('0x67'),_0x1e24('0x68'),'Subject',_0x1e24('0x69')];var _0x109289=['string',_0x1e24('0x6a'),_0x1e24('0x6b'),'boolean',_0x1e24('0x6c'),_0x1e24('0x6d'),'phone'];if(_0x126f8e){_['remove'](_0x126f8e[_0x1e24('0x35')],function(_0x4cadfd){return _0x10e596['includes'](_0x4cadfd[_0x1e24('0x2b')])||!_0x109289[_0x1e24('0x6e')](_0x4cadfd['type']);});return{'count':_0x126f8e[_0x1e24('0x35')][_0x1e24('0x36')],'rows':_[_0x1e24('0x2c')](_0x126f8e['fields'],function(_0x2fee95){return{'id':_0x2fee95[_0x1e24('0x2b')],'name':_0x2fee95[_0x1e24('0x6f')],'custom':_0x2fee95[_0x1e24('0x70')],'options':_0x2fee95[_0x1e24('0x71')][_0x1e24('0x36')]>0x0?_[_0x1e24('0x2c')](_0x2fee95[_0x1e24('0x71')],function(_0x427e0d){return{'name':_0x427e0d[_0x1e24('0x6f')],'value':_0x427e0d[_0x1e24('0x72')]};}):_0x2fee95[_0x1e24('0x2f')]==_0x1e24('0x73')?[{'name':'True','value':_0x1e24('0x74')},{'name':'False','value':_0x1e24('0x75')}]:[]};})};}})[_0x1e24('0x27')](respondWithResult(_0x36193b,null))['catch'](function(_0x501758){var _0xc97f1f=_0x1d78d6[_0x1e24('0x31')][_0x1e24('0x76')]?0x1f4:_0x501758['statusCode']||0x1f4;logger[_0x1e24('0x29')]('getFields,\x20%s,\x20%s,\x20%s',_0x1e24('0x56'),_0xc97f1f,JSON[_0x1e24('0x77')](_0x501758));delete _0x501758[_0x1e24('0x2b')];if(_0xc97f1f===0x191){_0xc97f1f=0x190;}_0x36193b[_0x1e24('0x1c')](_0xc97f1f)['send'](_0x1d78d6[_0x1e24('0x31')]['test']?{'message':_0x1e24('0x78'),'statusCode':_0x501758['statusCode']}:_0x501758);});}; \ No newline at end of file +var _0x9300=['email','textarea','phone','remove','includes','label','picklistValues','value','boolean','True','true','False','false','test','statusCode','stringify','send','rimraf','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','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','../../config/license/util','../../components/integrations/configuration','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','destroy','then','end','sendStatus','error','stack','name','index','map','SalesforceAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','rows','show','params','rawAttributes','find','catch','create','body','SalesforceConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','findOne','remoteUri','clientId','clientSecret','username','securityToken','substring','lastIndexOf','Connection','login','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','string'];(function(_0x41cf16,_0x17ff65){var _0x54c205=function(_0x7136f){while(--_0x7136f){_0x41cf16['push'](_0x41cf16['shift']());}};_0x54c205(++_0x17ff65);}(_0x9300,0x107));var _0x0930=function(_0x1e2080,_0x53283b){_0x1e2080=_0x1e2080-0x0;var _0x260111=_0x9300[_0x1e2080];return _0x260111;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0930('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0930('0x1'));var moment=require(_0x0930('0x2'));var BPromise=require(_0x0930('0x3'));var Mustache=require(_0x0930('0x4'));var util=require(_0x0930('0x5'));var path=require('path');var sox=require(_0x0930('0x6'));var csv=require('to-csv');var ejs=require(_0x0930('0x7'));var fs=require('fs');var fs_extra=require(_0x0930('0x8'));var _=require(_0x0930('0x9'));var squel=require(_0x0930('0xa'));var crypto=require('crypto');var jsforce=require(_0x0930('0xb'));var deskjs=require(_0x0930('0xc'));var toCsv=require(_0x0930('0xd'));var querystring=require(_0x0930('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0930('0xf'));var qs=require(_0x0930('0x10'));var as=require(_0x0930('0x11'));var hardwareService=require(_0x0930('0x12'));var logger=require(_0x0930('0x13'))(_0x0930('0x14'));var utils=require(_0x0930('0x15'));var config=require(_0x0930('0x16'));var licenseUtil=require(_0x0930('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x0930('0x18'));function respondWithStatusCode(_0x4d5ce9,_0x3e0f70){_0x3e0f70=_0x3e0f70||0xcc;return function(_0x3c5e2a){if(_0x3c5e2a){return _0x4d5ce9['sendStatus'](_0x3e0f70);}return _0x4d5ce9[_0x0930('0x19')](_0x3e0f70)['end']();};}function respondWithResult(_0x13132d,_0x161505){_0x161505=_0x161505||0xc8;return function(_0x1365f2){if(_0x1365f2){return _0x13132d['status'](_0x161505)['json'](_0x1365f2);}};}function respondWithFilteredResult(_0x36e7b2,_0x39b4c0){return function(_0x2a253b){if(_0x2a253b){var _0x3d46f4=typeof _0x39b4c0[_0x0930('0x1a')]===_0x0930('0x1b')&&typeof _0x39b4c0[_0x0930('0x1c')]==='undefined';var _0x21fb15=_0x2a253b['count'];var _0xf24dac=_0x3d46f4?0x0:_0x39b4c0['offset'];var _0xf28c38=_0x3d46f4?_0x2a253b[_0x0930('0x1d')]:_0x39b4c0[_0x0930('0x1a')]+_0x39b4c0[_0x0930('0x1c')];var _0xa4c27d;if(_0xf28c38>=_0x21fb15){_0xf28c38=_0x21fb15;_0xa4c27d=0xc8;}else{_0xa4c27d=0xce;}_0x36e7b2['status'](_0xa4c27d);return _0x36e7b2['set'](_0x0930('0x1e'),_0xf24dac+'-'+_0xf28c38+'/'+_0x21fb15)[_0x0930('0x1f')](_0x2a253b);}return null;};}function patchUpdates(_0x3d74b1){return function(_0x190610){try{jsonpatch[_0x0930('0x20')](_0x190610,_0x3d74b1,!![]);}catch(_0x11bf59){return BPromise[_0x0930('0x21')](_0x11bf59);}return _0x190610[_0x0930('0x22')]();};}function saveUpdates(_0x32fdf3,_0x5dae4e){return function(_0x17b64f){if(_0x17b64f){return _0x17b64f[_0x0930('0x23')](_0x32fdf3)['then'](function(_0x406a1f){return _0x406a1f;});}return null;};}function removeEntity(_0x1879df,_0x2619dd){return function(_0x56b325){if(_0x56b325){return _0x56b325[_0x0930('0x24')]()[_0x0930('0x25')](function(){_0x1879df['status'](0xcc)[_0x0930('0x26')]();});}};}function handleEntityNotFound(_0x38ce2d,_0x5b1ff7){return function(_0x54586a){if(!_0x54586a){_0x38ce2d[_0x0930('0x27')](0x194);}return _0x54586a;};}function handleError(_0x633867,_0x5dceed){_0x5dceed=_0x5dceed||0x1f4;return function(_0xdf4029){logger[_0x0930('0x28')](_0xdf4029[_0x0930('0x29')]);if(_0xdf4029[_0x0930('0x2a')]){delete _0xdf4029[_0x0930('0x2a')];}_0x633867[_0x0930('0x19')](_0x5dceed)['send'](_0xdf4029);};}exports[_0x0930('0x2b')]=function(_0x363aaa,_0x35e4b9){var _0x5e24b2={},_0x4d2d3f={},_0xf4087b={'count':0x0,'rows':[]};var _0x1835f4=_[_0x0930('0x2c')](db[_0x0930('0x2d')]['rawAttributes'],function(_0x4e5408){return{'name':_0x4e5408[_0x0930('0x2e')],'type':_0x4e5408[_0x0930('0x2f')][_0x0930('0x30')]};});_0x4d2d3f[_0x0930('0x31')]=_[_0x0930('0x2c')](_0x1835f4,_0x0930('0x2a'));_0x4d2d3f[_0x0930('0x32')]=_[_0x0930('0x33')](_0x363aaa['query']);_0x4d2d3f[_0x0930('0x34')]=_[_0x0930('0x35')](_0x4d2d3f['model'],_0x4d2d3f[_0x0930('0x32')]);_0x5e24b2[_0x0930('0x36')]=_['intersection'](_0x4d2d3f['model'],qs[_0x0930('0x37')](_0x363aaa['query'][_0x0930('0x37')]));_0x5e24b2['attributes']=_0x5e24b2[_0x0930('0x36')][_0x0930('0x38')]?_0x5e24b2[_0x0930('0x36')]:_0x4d2d3f['model'];if(!_0x363aaa['query'][_0x0930('0x39')](_0x0930('0x3a'))){_0x5e24b2[_0x0930('0x1c')]=qs[_0x0930('0x1c')](_0x363aaa[_0x0930('0x32')][_0x0930('0x1c')]);_0x5e24b2['offset']=qs[_0x0930('0x1a')](_0x363aaa[_0x0930('0x32')][_0x0930('0x1a')]);}_0x5e24b2[_0x0930('0x3b')]=qs[_0x0930('0x3c')](_0x363aaa[_0x0930('0x32')][_0x0930('0x3c')]);_0x5e24b2[_0x0930('0x3d')]=qs[_0x0930('0x34')](_[_0x0930('0x3e')](_0x363aaa['query'],_0x4d2d3f[_0x0930('0x34')]),_0x1835f4);if(_0x363aaa[_0x0930('0x32')]['filter']){_0x5e24b2[_0x0930('0x3d')]=_['merge'](_0x5e24b2[_0x0930('0x3d')],{'$or':_['map'](_0x1835f4,function(_0x1b6b9f){if(_0x1b6b9f[_0x0930('0x2f')]!==_0x0930('0x3f')){var _0x172820={};_0x172820[_0x1b6b9f[_0x0930('0x2a')]]={'$like':'%'+_0x363aaa[_0x0930('0x32')][_0x0930('0x40')]+'%'};return _0x172820;}})});}_0x5e24b2=_[_0x0930('0x41')]({},_0x5e24b2,_0x363aaa[_0x0930('0x42')]);var _0x471400={'where':_0x5e24b2[_0x0930('0x3d')]};return db[_0x0930('0x2d')][_0x0930('0x1d')](_0x471400)['then'](function(_0x307b77){_0xf4087b['count']=_0x307b77;if(_0x363aaa[_0x0930('0x32')][_0x0930('0x43')]){_0x5e24b2[_0x0930('0x44')]=[{'all':!![]}];}return db['SalesforceAccount']['findAll'](_0x5e24b2);})['then'](function(_0x13777c){_0xf4087b[_0x0930('0x45')]=_0x13777c;return _0xf4087b;})[_0x0930('0x25')](respondWithFilteredResult(_0x35e4b9,_0x5e24b2))['catch'](handleError(_0x35e4b9,null));};exports[_0x0930('0x46')]=function(_0x3c60c4,_0x545023){var _0x50b0cc={'raw':![],'where':{'id':_0x3c60c4[_0x0930('0x47')]['id']}},_0x3ef747={};_0x3ef747[_0x0930('0x31')]=_[_0x0930('0x33')](db['SalesforceAccount'][_0x0930('0x48')]);_0x3ef747[_0x0930('0x32')]=_[_0x0930('0x33')](_0x3c60c4[_0x0930('0x32')]);_0x3ef747['filters']=_['intersection'](_0x3ef747[_0x0930('0x31')],_0x3ef747[_0x0930('0x32')]);_0x50b0cc[_0x0930('0x36')]=_[_0x0930('0x35')](_0x3ef747[_0x0930('0x31')],qs[_0x0930('0x37')](_0x3c60c4[_0x0930('0x32')][_0x0930('0x37')]));_0x50b0cc[_0x0930('0x36')]=_0x50b0cc[_0x0930('0x36')][_0x0930('0x38')]?_0x50b0cc[_0x0930('0x36')]:_0x3ef747[_0x0930('0x31')];if(_0x3c60c4[_0x0930('0x32')][_0x0930('0x43')]){_0x50b0cc[_0x0930('0x44')]=[{'all':!![]}];}_0x50b0cc=_[_0x0930('0x41')]({},_0x50b0cc,_0x3c60c4['options']);return db[_0x0930('0x2d')][_0x0930('0x49')](_0x50b0cc)['then'](handleEntityNotFound(_0x545023,null))[_0x0930('0x25')](respondWithResult(_0x545023,null))[_0x0930('0x4a')](handleError(_0x545023,null));};exports[_0x0930('0x4b')]=function(_0x2d1a02,_0x39622f){return db[_0x0930('0x2d')][_0x0930('0x4b')](_0x2d1a02[_0x0930('0x4c')],{})['then'](respondWithResult(_0x39622f,0xc9))['catch'](handleError(_0x39622f,null));};exports[_0x0930('0x23')]=function(_0x2f7e93,_0x2bc9ad){if(_0x2f7e93[_0x0930('0x4c')]['id']){delete _0x2f7e93[_0x0930('0x4c')]['id'];}return db[_0x0930('0x2d')][_0x0930('0x49')]({'where':{'id':_0x2f7e93[_0x0930('0x47')]['id']}})['then'](handleEntityNotFound(_0x2bc9ad,null))['then'](saveUpdates(_0x2f7e93[_0x0930('0x4c')],null))['then'](respondWithResult(_0x2bc9ad,null))[_0x0930('0x4a')](handleError(_0x2bc9ad,null));};exports[_0x0930('0x24')]=function(_0xc79a24,_0x43fbf8){return db['SalesforceAccount'][_0x0930('0x49')]({'where':{'id':_0xc79a24['params']['id']}})[_0x0930('0x25')](handleEntityNotFound(_0x43fbf8,null))[_0x0930('0x25')](removeEntity(_0x43fbf8,null))[_0x0930('0x4a')](handleError(_0x43fbf8,null));};exports['getConfigurations']=function(_0x2f76d9,_0x889a00,_0x1d16cf){var _0x57af24={};var _0x1a5a32={};var _0x224c72;var _0x212208;return db['SalesforceAccount']['findOne']({'where':{'id':_0x2f76d9['params']['id']}})['then'](handleEntityNotFound(_0x889a00,null))[_0x0930('0x25')](function(_0x2e39fd){if(_0x2e39fd){_0x224c72=_0x2e39fd;_0x1a5a32[_0x0930('0x31')]=_['keys'](db[_0x0930('0x4d')][_0x0930('0x48')]);_0x1a5a32[_0x0930('0x32')]=_[_0x0930('0x33')](_0x2f76d9[_0x0930('0x32')]);_0x1a5a32[_0x0930('0x34')]=_[_0x0930('0x35')](_0x1a5a32[_0x0930('0x31')],_0x1a5a32[_0x0930('0x32')]);_0x57af24[_0x0930('0x36')]=_['intersection'](_0x1a5a32[_0x0930('0x31')],qs['fields'](_0x2f76d9[_0x0930('0x32')][_0x0930('0x37')]));_0x57af24[_0x0930('0x36')]=_0x57af24['attributes']['length']?_0x57af24['attributes']:_0x1a5a32['model'];_0x57af24[_0x0930('0x3b')]=qs[_0x0930('0x3c')](_0x2f76d9[_0x0930('0x32')][_0x0930('0x3c')]);_0x57af24['where']=qs[_0x0930('0x34')](_[_0x0930('0x3e')](_0x2f76d9[_0x0930('0x32')],_0x1a5a32[_0x0930('0x34')]));if(_0x2f76d9[_0x0930('0x32')]['filter']){_0x57af24[_0x0930('0x3d')]=_[_0x0930('0x41')](_0x57af24[_0x0930('0x3d')],{'$or':_[_0x0930('0x2c')](_0x57af24['attributes'],function(_0x16d4c8){var _0x4b05cf={};_0x4b05cf[_0x16d4c8]={'$like':'%'+_0x2f76d9[_0x0930('0x32')]['filter']+'%'};return _0x4b05cf;})});}_0x57af24=_['merge']({},_0x57af24,_0x2f76d9[_0x0930('0x42')]);return _0x224c72['getConfigurations'](_0x57af24);}})['then'](function(_0x5a682b){if(_0x5a682b){_0x212208=_0x5a682b[_0x0930('0x38')];if(!_0x2f76d9['query'][_0x0930('0x39')](_0x0930('0x3a'))){_0x57af24[_0x0930('0x1c')]=qs[_0x0930('0x1c')](_0x2f76d9[_0x0930('0x32')][_0x0930('0x1c')]);_0x57af24[_0x0930('0x1a')]=qs['offset'](_0x2f76d9[_0x0930('0x32')]['offset']);}return _0x224c72[_0x0930('0x4e')](_0x57af24);}})[_0x0930('0x25')](function(_0x224bcd){if(_0x224bcd){return _0x224bcd?{'count':_0x212208,'rows':_0x224bcd}:null;}})[_0x0930('0x25')](respondWithResult(_0x889a00,null))['catch'](handleError(_0x889a00,null));};exports[_0x0930('0x4f')]=function(_0x35dfff,_0x57b583,_0x25705c){if(_0x35dfff[_0x0930('0x4c')]['id']){delete _0x35dfff[_0x0930('0x4c')]['id'];}return db['SalesforceAccount']['findOne']({'where':{'id':_0x35dfff['params']['id']}})[_0x0930('0x25')](handleEntityNotFound(_0x57b583,null))[_0x0930('0x25')](function(_0x39c250){if(_0x39c250){_0x35dfff[_0x0930('0x4c')][_0x0930('0x50')]=_0x39c250['id'];_0x35dfff[_0x0930('0x4c')][_0x0930('0x51')]=integrations[_0x0930('0x52')](_0x35dfff[_0x0930('0x4c')][_0x0930('0x53')],_0x35dfff[_0x0930('0x4c')]['type']);_0x35dfff[_0x0930('0x4c')][_0x0930('0x54')]=integrations[_0x0930('0x55')](_0x35dfff[_0x0930('0x4c')][_0x0930('0x53')],_0x35dfff[_0x0930('0x4c')][_0x0930('0x2f')]);return db[_0x0930('0x4d')][_0x0930('0x4b')](_0x35dfff[_0x0930('0x4c')],{'include':[{'model':db[_0x0930('0x56')],'as':_0x0930('0x51')},{'model':db[_0x0930('0x56')],'as':_0x0930('0x54')}]});}return null;})[_0x0930('0x25')](respondWithResult(_0x57b583,null))['catch'](handleError(_0x57b583,null));};exports[_0x0930('0x57')]=function(_0x1be36e,_0x57d483,_0x5a228f){var _0x583724;var _0x145dc8='';var _0x46c880='Task';return db[_0x0930('0x2d')][_0x0930('0x58')]({'where':{'id':_0x1be36e[_0x0930('0x47')]['id']},'attributes':['id',_0x0930('0x59'),_0x0930('0x5a'),_0x0930('0x5b'),_0x0930('0x5c'),'password',_0x0930('0x5d')]})[_0x0930('0x25')](handleEntityNotFound(_0x57d483,null))['then'](function(_0x43fa0f){if(_0x43fa0f){_0x145dc8=_0x43fa0f['remoteUri'];var _0x17365f=_0x145dc8['slice'](-0x1);if(_0x17365f==='/'){_0x145dc8=_0x145dc8[_0x0930('0x5e')](0x0,_0x145dc8[_0x0930('0x5f')](_0x17365f));}_0x583724=new jsforce[(_0x0930('0x60'))]({'oauth2':{'loginUrl':_0x145dc8,'clientId':_0x43fa0f[_0x0930('0x5a')],'clientSecret':_0x43fa0f[_0x0930('0x5b')]}});return _0x583724[_0x0930('0x61')](_0x43fa0f[_0x0930('0x5c')],_0x43fa0f['password']['concat'](_0x43fa0f[_0x0930('0x5d')]));}})[_0x0930('0x25')](function(_0x8705af){if(_0x8705af){if(!_['isNil'](_0x1be36e[_0x0930('0x32')][_0x0930('0x62')])){_0x46c880=_0x1be36e[_0x0930('0x32')][_0x0930('0x62')];}return _0x583724[_0x0930('0x63')](_0x46c880)[_0x0930('0x64')]();}})[_0x0930('0x25')](function(_0x10af39){var _0x1fc432=[_0x0930('0x65'),_0x0930('0x66'),_0x0930('0x67'),_0x0930('0x68'),'Subject','Description'];var _0x2c6626=[_0x0930('0x69'),'int','picklist','boolean',_0x0930('0x6a'),_0x0930('0x6b'),_0x0930('0x6c')];if(_0x10af39){_[_0x0930('0x6d')](_0x10af39[_0x0930('0x37')],function(_0x1ea778){return _0x1fc432[_0x0930('0x6e')](_0x1ea778[_0x0930('0x2a')])||!_0x2c6626[_0x0930('0x6e')](_0x1ea778[_0x0930('0x2f')]);});return{'count':_0x10af39['fields'][_0x0930('0x38')],'rows':_[_0x0930('0x2c')](_0x10af39['fields'],function(_0x21801e){return{'id':_0x21801e[_0x0930('0x2a')],'name':_0x21801e[_0x0930('0x6f')],'custom':_0x21801e['custom'],'options':_0x21801e[_0x0930('0x70')][_0x0930('0x38')]>0x0?_[_0x0930('0x2c')](_0x21801e[_0x0930('0x70')],function(_0x4e6cc0){return{'name':_0x4e6cc0[_0x0930('0x6f')],'value':_0x4e6cc0[_0x0930('0x71')]};}):_0x21801e[_0x0930('0x2f')]==_0x0930('0x72')?[{'name':_0x0930('0x73'),'value':_0x0930('0x74')},{'name':_0x0930('0x75'),'value':_0x0930('0x76')}]:[]};})};}})['then'](respondWithResult(_0x57d483,null))[_0x0930('0x4a')](function(_0x4fce50){var _0x3c31dd=_0x1be36e[_0x0930('0x32')][_0x0930('0x77')]?0x1f4:_0x4fce50[_0x0930('0x78')]||0x1f4;logger[_0x0930('0x28')]('getFields,\x20%s,\x20%s,\x20%s',_0x0930('0x57'),_0x3c31dd,JSON[_0x0930('0x79')](_0x4fce50));delete _0x4fce50[_0x0930('0x2a')];if(_0x3c31dd===0x191){_0x3c31dd=0x190;}_0x57d483[_0x0930('0x19')](_0x3c31dd)[_0x0930('0x7a')](_0x1be36e[_0x0930('0x32')][_0x0930('0x77')]?{'message':'Wrong\x20credentials','statusCode':_0x4fce50[_0x0930('0x78')]}:_0x4fce50);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index d237915..8640eb3 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 _0xadb8=['path','rimraf','../../config/environment','./intSalesforceAccount.attributes','exports','define','SalesforceAccount','int_salesforce_accounts','../../config/logger','moment','bluebird','request-promise'];(function(_0x3ff6c6,_0x5be87a){var _0x533eb2=function(_0x2585ec){while(--_0x2585ec){_0x3ff6c6['push'](_0x3ff6c6['shift']());}};_0x533eb2(++_0x5be87a);}(_0xadb8,0x1d0));var _0x8adb=function(_0x211fef,_0x4ab716){_0x211fef=_0x211fef-0x0;var _0x5447bf=_0xadb8[_0x211fef];return _0x5447bf;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8adb('0x0'))('api');var moment=require(_0x8adb('0x1'));var BPromise=require(_0x8adb('0x2'));var rp=require(_0x8adb('0x3'));var fs=require('fs');var path=require(_0x8adb('0x4'));var rimraf=require(_0x8adb('0x5'));var config=require(_0x8adb('0x6'));var attributes=require(_0x8adb('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x8adb('0x8')]=function(_0x1a5f36,_0x9f435){return _0x1a5f36[_0x8adb('0x9')](_0x8adb('0xa'),attributes,{'tableName':_0x8adb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c5e=['SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','../../components/integrations/configuration','exports'];(function(_0x432707,_0xf0f34c){var _0x340b83=function(_0x52ee21){while(--_0x52ee21){_0x432707['push'](_0x432707['shift']());}};_0x340b83(++_0xf0f34c);}(_0x9c5e,0x9c));var _0xe9c5=function(_0x10c59e,_0x49e436){_0x10c59e=_0x10c59e-0x0;var _0x451438=_0x9c5e[_0x10c59e];return _0x451438;};'use strict';var _=require(_0xe9c5('0x0'));var util=require(_0xe9c5('0x1'));var logger=require(_0xe9c5('0x2'))(_0xe9c5('0x3'));var moment=require(_0xe9c5('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe9c5('0x5'));var config=require(_0xe9c5('0x6'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0xe9c5('0x7'));module[_0xe9c5('0x8')]=function(_0x1e6a31,_0x6f6045){return _0x1e6a31['define'](_0xe9c5('0x9'),attributes,{'tableName':_0xe9c5('0xa'),'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 7a4d574..7f5a4a9 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 _0x9a0d=['client','http','request','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','attributes','limit','map','include','model','stringify','ShowSalesforceAccount','find','where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x150ce1,_0x26110d){var _0x58e09b=function(_0x2338db){while(--_0x2338db){_0x150ce1['push'](_0x150ce1['shift']());}};_0x58e09b(++_0x26110d);}(_0x9a0d,0x1ee));var _0xd9a0=function(_0x138d06,_0x33edf2){_0x138d06=_0x138d06-0x0;var _0x1a01eb=_0x9a0d[_0x138d06];return _0x1a01eb;};'use strict';var _=require(_0xd9a0('0x0'));var util=require('util');var moment=require(_0xd9a0('0x1'));var BPromise=require(_0xd9a0('0x2'));var rs=require(_0xd9a0('0x3'));var fs=require('fs');var Redis=require(_0xd9a0('0x4'));var db=require(_0xd9a0('0x5'))['db'];var utils=require(_0xd9a0('0x6'));var logger=require(_0xd9a0('0x7'))('rpc');var config=require(_0xd9a0('0x8'));var jayson=require(_0xd9a0('0x9'));var client=jayson[_0xd9a0('0xa')][_0xd9a0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4862de,_0x422d77,_0x3e3e27){return new BPromise(function(_0x2a0560,_0x17e5fc){return client[_0xd9a0('0xc')](_0x4862de,_0x3e3e27)['then'](function(_0x116c0e){logger[_0xd9a0('0xd')](_0xd9a0('0xe'),_0x422d77,_0xd9a0('0xf'));logger[_0xd9a0('0x10')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x422d77,_0xd9a0('0xf'),JSON['stringify'](_0x116c0e));if(_0x116c0e['error']){if(_0x116c0e[_0xd9a0('0x11')][_0xd9a0('0x12')]===0x1f4){logger[_0xd9a0('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0x422d77,_0x116c0e['error'][_0xd9a0('0x13')]);return _0x17e5fc(_0x116c0e[_0xd9a0('0x11')][_0xd9a0('0x13')]);}logger[_0xd9a0('0x11')](_0xd9a0('0xe'),_0x422d77,_0x116c0e[_0xd9a0('0x11')][_0xd9a0('0x13')]);return _0x2a0560(_0x116c0e[_0xd9a0('0x11')][_0xd9a0('0x13')]);}else{logger[_0xd9a0('0xd')](_0xd9a0('0xe'),_0x422d77,_0xd9a0('0xf'));_0x2a0560(_0x116c0e[_0xd9a0('0x14')][_0xd9a0('0x13')]);}})[_0xd9a0('0x15')](function(_0x50b08c){logger['error'](_0xd9a0('0xe'),_0x422d77,_0x50b08c);_0x17e5fc(_0x50b08c);});});}exports[_0xd9a0('0x16')]=function(_0x3448f2){var _0x70720d=this;return new Promise(function(_0x531645,_0x150129){return db[_0xd9a0('0x17')][_0xd9a0('0x18')]({'raw':_0x3448f2['options']?_0x3448f2[_0xd9a0('0x19')][_0xd9a0('0x1a')]===undefined?!![]:![]:!![],'where':_0x3448f2['options']?_0x3448f2['options']['where']||null:null,'attributes':_0x3448f2['options']?_0x3448f2[_0xd9a0('0x19')][_0xd9a0('0x1b')]||null:null,'limit':_0x3448f2[_0xd9a0('0x19')]?_0x3448f2[_0xd9a0('0x19')][_0xd9a0('0x1c')]||null:null,'include':_0x3448f2['options']?_0x3448f2[_0xd9a0('0x19')]['include']?_[_0xd9a0('0x1d')](_0x3448f2[_0xd9a0('0x19')][_0xd9a0('0x1e')],function(_0x14caea){return{'model':db[_0x14caea[_0xd9a0('0x1f')]],'as':_0x14caea['as'],'attributes':_0x14caea['attributes'],'include':_0x14caea['include']?_[_0xd9a0('0x1d')](_0x14caea[_0xd9a0('0x1e')],function(_0x5e0daf){return{'model':db[_0x5e0daf[_0xd9a0('0x1f')]],'as':_0x5e0daf['as'],'attributes':_0x5e0daf[_0xd9a0('0x1b')],'include':_0x5e0daf[_0xd9a0('0x1e')]?_[_0xd9a0('0x1d')](_0x5e0daf[_0xd9a0('0x1e')],function(_0x37c7ed){return{'model':db[_0x37c7ed['model']],'as':_0x37c7ed['as'],'attributes':_0x37c7ed[_0xd9a0('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x550ae1){logger[_0xd9a0('0xd')](_0xd9a0('0x16'),_0x3448f2);logger[_0xd9a0('0x10')](_0xd9a0('0x16'),_0x3448f2,JSON[_0xd9a0('0x20')](_0x550ae1));_0x531645(_0x550ae1);})['catch'](function(_0x1f93ac){logger['error'](_0xd9a0('0x16'),_0x1f93ac[_0xd9a0('0x13')],_0x3448f2);_0x150129(_0x70720d[_0xd9a0('0x11')](0x1f4,_0x1f93ac[_0xd9a0('0x13')]));});});};exports[_0xd9a0('0x21')]=function(_0x205f92){var _0x2f3ab6=this;return new Promise(function(_0x519936,_0x5e485e){return db[_0xd9a0('0x17')][_0xd9a0('0x22')]({'raw':_0x205f92[_0xd9a0('0x19')]?_0x205f92[_0xd9a0('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x205f92[_0xd9a0('0x19')]?_0x205f92[_0xd9a0('0x19')][_0xd9a0('0x23')]||null:null,'attributes':_0x205f92[_0xd9a0('0x19')]?_0x205f92[_0xd9a0('0x19')][_0xd9a0('0x1b')]||null:null,'include':_0x205f92['options']?_0x205f92[_0xd9a0('0x19')][_0xd9a0('0x1e')]?_[_0xd9a0('0x1d')](_0x205f92[_0xd9a0('0x19')][_0xd9a0('0x1e')],function(_0x1b2912){return{'model':db[_0x1b2912[_0xd9a0('0x1f')]],'as':_0x1b2912['as'],'attributes':_0x1b2912['attributes'],'include':_0x1b2912['include']?_[_0xd9a0('0x1d')](_0x1b2912[_0xd9a0('0x1e')],function(_0x136379){return{'model':db[_0x136379[_0xd9a0('0x1f')]],'as':_0x136379['as'],'attributes':_0x136379[_0xd9a0('0x1b')],'include':_0x136379['include']?_['map'](_0x136379[_0xd9a0('0x1e')],function(_0x4b3408){return{'model':db[_0x4b3408[_0xd9a0('0x1f')]],'as':_0x4b3408['as'],'attributes':_0x4b3408['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4e9b3e){logger['info'](_0xd9a0('0x21'),_0x205f92);logger[_0xd9a0('0x10')](_0xd9a0('0x21'),_0x205f92,JSON['stringify'](_0x4e9b3e));_0x519936(_0x4e9b3e);})[_0xd9a0('0x15')](function(_0x49d275){logger[_0xd9a0('0x11')](_0xd9a0('0x21'),_0x49d275[_0xd9a0('0x13')],_0x205f92);_0x5e485e(_0x2f3ab6[_0xd9a0('0x11')](0x1f4,_0x49d275['message']));});});}; \ No newline at end of file +var _0x0d71=['error','code','SalesforceAccount,\x20%s,\x20%s','message','info','request\x20sent','catch','SalesforceAccount','findAll','options','raw','attributes','limit','include','map','model','GetSalesforceAccount','stringify','where','ShowSalesforceAccount','debug','lodash','util','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SalesforceAccount,\x20%s,\x20%s,\x20%s'];(function(_0x14ddd2,_0x228b93){var _0x40beee=function(_0xbb1453){while(--_0xbb1453){_0x14ddd2['push'](_0x14ddd2['shift']());}};_0x40beee(++_0x228b93);}(_0x0d71,0x1a1));var _0x10d7=function(_0x23dfea,_0x486550){_0x23dfea=_0x23dfea-0x0;var _0x26151c=_0x0d71[_0x23dfea];return _0x26151c;};'use strict';var _=require(_0x10d7('0x0'));var util=require(_0x10d7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x10d7('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x10d7('0x3'))(_0x10d7('0x4'));var config=require(_0x10d7('0x5'));var jayson=require(_0x10d7('0x6'));var client=jayson[_0x10d7('0x7')][_0x10d7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x7f3ef4,_0x4689bf,_0x278c30){return new BPromise(function(_0x1ea995,_0x42198a){return client[_0x10d7('0x9')](_0x7f3ef4,_0x278c30)[_0x10d7('0xa')](function(_0x1dbd70){logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x4689bf,'request\x20sent');logger['debug'](_0x10d7('0xb'),_0x4689bf,'request\x20sent',JSON['stringify'](_0x1dbd70));if(_0x1dbd70[_0x10d7('0xc')]){if(_0x1dbd70['error'][_0x10d7('0xd')]===0x1f4){logger[_0x10d7('0xc')](_0x10d7('0xe'),_0x4689bf,_0x1dbd70[_0x10d7('0xc')]['message']);return _0x42198a(_0x1dbd70[_0x10d7('0xc')][_0x10d7('0xf')]);}logger[_0x10d7('0xc')](_0x10d7('0xe'),_0x4689bf,_0x1dbd70[_0x10d7('0xc')]['message']);return _0x1ea995(_0x1dbd70['error'][_0x10d7('0xf')]);}else{logger[_0x10d7('0x10')](_0x10d7('0xe'),_0x4689bf,_0x10d7('0x11'));_0x1ea995(_0x1dbd70['result'][_0x10d7('0xf')]);}})[_0x10d7('0x12')](function(_0x1822fb){logger[_0x10d7('0xc')]('SalesforceAccount,\x20%s,\x20%s',_0x4689bf,_0x1822fb);_0x42198a(_0x1822fb);});});}exports['GetSalesforceAccount']=function(_0xe45083){var _0x4510e8=this;return new Promise(function(_0x14f029,_0x143865){return db[_0x10d7('0x13')][_0x10d7('0x14')]({'raw':_0xe45083[_0x10d7('0x15')]?_0xe45083[_0x10d7('0x15')][_0x10d7('0x16')]===undefined?!![]:![]:!![],'where':_0xe45083[_0x10d7('0x15')]?_0xe45083[_0x10d7('0x15')]['where']||null:null,'attributes':_0xe45083[_0x10d7('0x15')]?_0xe45083['options'][_0x10d7('0x17')]||null:null,'limit':_0xe45083[_0x10d7('0x15')]?_0xe45083[_0x10d7('0x15')][_0x10d7('0x18')]||null:null,'include':_0xe45083[_0x10d7('0x15')]?_0xe45083['options'][_0x10d7('0x19')]?_[_0x10d7('0x1a')](_0xe45083[_0x10d7('0x15')][_0x10d7('0x19')],function(_0x108973){return{'model':db[_0x108973[_0x10d7('0x1b')]],'as':_0x108973['as'],'attributes':_0x108973[_0x10d7('0x17')],'include':_0x108973[_0x10d7('0x19')]?_[_0x10d7('0x1a')](_0x108973[_0x10d7('0x19')],function(_0x2a1aed){return{'model':db[_0x2a1aed[_0x10d7('0x1b')]],'as':_0x2a1aed['as'],'attributes':_0x2a1aed['attributes'],'include':_0x2a1aed[_0x10d7('0x19')]?_['map'](_0x2a1aed[_0x10d7('0x19')],function(_0xc498aa){return{'model':db[_0xc498aa[_0x10d7('0x1b')]],'as':_0xc498aa['as'],'attributes':_0xc498aa[_0x10d7('0x17')]};}):[]};}):[]};}):[]:[]})[_0x10d7('0xa')](function(_0x5144cf){logger[_0x10d7('0x10')]('GetSalesforceAccount',_0xe45083);logger['debug'](_0x10d7('0x1c'),_0xe45083,JSON[_0x10d7('0x1d')](_0x5144cf));_0x14f029(_0x5144cf);})[_0x10d7('0x12')](function(_0x53e561){logger[_0x10d7('0xc')](_0x10d7('0x1c'),_0x53e561[_0x10d7('0xf')],_0xe45083);_0x143865(_0x4510e8['error'](0x1f4,_0x53e561[_0x10d7('0xf')]));});});};exports['ShowSalesforceAccount']=function(_0x153a6a){var _0x54ffcd=this;return new Promise(function(_0x440f4d,_0x458b0f){return db[_0x10d7('0x13')]['find']({'raw':_0x153a6a[_0x10d7('0x15')]?_0x153a6a['options']['raw']===undefined?!![]:![]:!![],'where':_0x153a6a[_0x10d7('0x15')]?_0x153a6a[_0x10d7('0x15')][_0x10d7('0x1e')]||null:null,'attributes':_0x153a6a[_0x10d7('0x15')]?_0x153a6a[_0x10d7('0x15')][_0x10d7('0x17')]||null:null,'include':_0x153a6a['options']?_0x153a6a[_0x10d7('0x15')][_0x10d7('0x19')]?_[_0x10d7('0x1a')](_0x153a6a['options']['include'],function(_0x48fa1f){return{'model':db[_0x48fa1f['model']],'as':_0x48fa1f['as'],'attributes':_0x48fa1f['attributes'],'include':_0x48fa1f[_0x10d7('0x19')]?_['map'](_0x48fa1f[_0x10d7('0x19')],function(_0x335dd7){return{'model':db[_0x335dd7[_0x10d7('0x1b')]],'as':_0x335dd7['as'],'attributes':_0x335dd7[_0x10d7('0x17')],'include':_0x335dd7[_0x10d7('0x19')]?_[_0x10d7('0x1a')](_0x335dd7['include'],function(_0x5080a8){return{'model':db[_0x5080a8[_0x10d7('0x1b')]],'as':_0x5080a8['as'],'attributes':_0x5080a8[_0x10d7('0x17')]};}):[]};}):[]};}):[]:[]})[_0x10d7('0xa')](function(_0xce71de){logger[_0x10d7('0x10')](_0x10d7('0x1f'),_0x153a6a);logger[_0x10d7('0x20')](_0x10d7('0x1f'),_0x153a6a,JSON['stringify'](_0xce71de));_0x440f4d(_0xce71de);})[_0x10d7('0x12')](function(_0x4a1b8d){logger['error']('ShowSalesforceAccount',_0x4a1b8d[_0x10d7('0xf')],_0x153a6a);_0x458b0f(_0x54ffcd[_0x10d7('0xc')](0x1f4,_0x4a1b8d[_0x10d7('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 9470da4..678270d 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0xdb28,0x106));var _0x8db2=function(_0x2437fb,_0x1fb0ee){_0x2437fb=_0x2437fb-0x0;var _0x53c809=_0xdb28[_0x2437fb];return _0x53c809;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router; \ No newline at end of file +var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xdb28,0x106));var _0x8db2=function(_0x56b7f8,_0x3cc9d8){_0x56b7f8=_0x56b7f8-0x0;var _0x118c67=_0xdb28[_0x56b7f8];return _0x118c67;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 0cb9323..343f207 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 _0x197c=['account','sequelize','exports','STRING','ENUM','Task','Case','contact','lead','account_contact_lead','contact_lead','nothing'];(function(_0x395cea,_0x1d3b1e){var _0x15576b=function(_0x36399e){while(--_0x36399e){_0x395cea['push'](_0x395cea['shift']());}};_0x15576b(++_0x1d3b1e);}(_0x197c,0xc1));var _0xc197=function(_0x10a00b,_0x2a3c2a){_0x10a00b=_0x10a00b-0x0;var _0x349213=_0x197c[_0x10a00b];return _0x349213;};'use strict';var Sequelize=require(_0xc197('0x0'));module[_0xc197('0x1')]={'name':{'type':Sequelize[_0xc197('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xc197('0x3')](_0xc197('0x4'),_0xc197('0x5')),'defaultValue':_0xc197('0x4')},'moduleSearch':{'type':Sequelize[_0xc197('0x3')]('contact_lead',_0xc197('0x6'),_0xc197('0x7'),_0xc197('0x8'),'account'),'defaultValue':_0xc197('0x9')},'moduleCreate':{'type':Sequelize[_0xc197('0x3')](_0xc197('0xa'),_0xc197('0x6'),_0xc197('0x7'),_0xc197('0xb')),'defaultValue':_0xc197('0x7')},'leadId':{'type':Sequelize[_0xc197('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0xc197('0x2')]},'additionalSearchContact':{'type':Sequelize[_0xc197('0x2')]},'additionalSearchLead':{'type':Sequelize[_0xc197('0x2')]}}; \ No newline at end of file +var _0x65d4=['Task','Case','contact_lead','contact','account_contact_lead','account','nothing','lead','STRING','ENUM'];(function(_0x51b354,_0x7cc20c){var _0x1e8dda=function(_0x34a735){while(--_0x34a735){_0x51b354['push'](_0x51b354['shift']());}};_0x1e8dda(++_0x7cc20c);}(_0x65d4,0x8a));var _0x465d=function(_0x2a9c43,_0x203953){_0x2a9c43=_0x2a9c43-0x0;var _0x15c81c=_0x65d4[_0x2a9c43];return _0x15c81c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x465d('0x0')]},'description':{'type':Sequelize[_0x465d('0x0')]},'ticketType':{'type':Sequelize[_0x465d('0x1')](_0x465d('0x2'),_0x465d('0x3')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0x465d('0x1')](_0x465d('0x4'),_0x465d('0x5'),'lead',_0x465d('0x6'),_0x465d('0x7')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0x465d('0x1')](_0x465d('0x8'),_0x465d('0x5'),_0x465d('0x9'),_0x465d('0x7')),'defaultValue':'lead'},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0x465d('0x0')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 5b7dcb7..6a434d4 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 _0x83f1=['find','create','body','findOne','SalesforceField','getFields','nolimit','catch','getSubjects','getDescriptions','rimraf','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','then','include','findAll','rows','show','params','keys','includeAll'];(function(_0x29db98,_0x546288){var _0x1ea00a=function(_0x378d55){while(--_0x378d55){_0x29db98['push'](_0x29db98['shift']());}};_0x1ea00a(++_0x546288);}(_0x83f1,0xa8));var _0x183f=function(_0x27a239,_0x2531bd){_0x27a239=_0x27a239-0x0;var _0x26c6f9=_0x83f1[_0x27a239];return _0x26c6f9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x183f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x183f('0x1'));var rp=require(_0x183f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x183f('0x3'));var util=require('util');var path=require(_0x183f('0x4'));var sox=require(_0x183f('0x5'));var csv=require(_0x183f('0x6'));var ejs=require(_0x183f('0x7'));var fs=require('fs');var fs_extra=require(_0x183f('0x8'));var _=require('lodash');var squel=require(_0x183f('0x9'));var crypto=require('crypto');var jsforce=require(_0x183f('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x183f('0xb'));var Redis=require(_0x183f('0xc'));var authService=require(_0x183f('0xd'));var qs=require(_0x183f('0xe'));var as=require(_0x183f('0xf'));var hardwareService=require(_0x183f('0x10'));var logger=require('../../config/logger')(_0x183f('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x183f('0x12'));var db=require(_0x183f('0x13'))['db'];function respondWithStatusCode(_0x125f8c,_0x5c25eb){_0x5c25eb=_0x5c25eb||0xcc;return function(_0x2e41aa){if(_0x2e41aa){return _0x125f8c[_0x183f('0x14')](_0x5c25eb);}return _0x125f8c[_0x183f('0x15')](_0x5c25eb)[_0x183f('0x16')]();};}function respondWithResult(_0xfbafbb,_0x21155c){_0x21155c=_0x21155c||0xc8;return function(_0x2b5827){if(_0x2b5827){return _0xfbafbb[_0x183f('0x15')](_0x21155c)[_0x183f('0x17')](_0x2b5827);}};}function respondWithFilteredResult(_0x5ec14d,_0x410293){return function(_0x5a6747){if(_0x5a6747){var _0x4a0d4f=typeof _0x410293[_0x183f('0x18')]===_0x183f('0x19')&&typeof _0x410293[_0x183f('0x1a')]===_0x183f('0x19');var _0x16953f=_0x5a6747[_0x183f('0x1b')];var _0x5b8d07=_0x4a0d4f?0x0:_0x410293['offset'];var _0x1fa418=_0x4a0d4f?_0x5a6747[_0x183f('0x1b')]:_0x410293[_0x183f('0x18')]+_0x410293['limit'];var _0xfcb735;if(_0x1fa418>=_0x16953f){_0x1fa418=_0x16953f;_0xfcb735=0xc8;}else{_0xfcb735=0xce;}_0x5ec14d['status'](_0xfcb735);return _0x5ec14d[_0x183f('0x1c')](_0x183f('0x1d'),_0x5b8d07+'-'+_0x1fa418+'/'+_0x16953f)[_0x183f('0x17')](_0x5a6747);}return null;};}function patchUpdates(_0x3addd4){return function(_0x1ad46a){try{jsonpatch[_0x183f('0x1e')](_0x1ad46a,_0x3addd4,!![]);}catch(_0x4d0c26){return BPromise[_0x183f('0x1f')](_0x4d0c26);}return _0x1ad46a[_0x183f('0x20')]();};}function saveUpdates(_0x11cdae,_0x26950a){return function(_0x39b8d3){if(_0x39b8d3){return _0x39b8d3[_0x183f('0x21')](_0x11cdae)['then'](function(_0x5d8b6f){return _0x5d8b6f;});}return null;};}function removeEntity(_0x15f744,_0x4e75a6){return function(_0x1f1881){if(_0x1f1881){return _0x1f1881[_0x183f('0x22')]()['then'](function(){_0x15f744['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ba657,_0xe248e4){return function(_0x46cf3b){if(!_0x46cf3b){_0x5ba657['sendStatus'](0x194);}return _0x46cf3b;};}function handleError(_0x291327,_0x149cfc){_0x149cfc=_0x149cfc||0x1f4;return function(_0x513f18){logger[_0x183f('0x23')](_0x513f18[_0x183f('0x24')]);if(_0x513f18[_0x183f('0x25')]){delete _0x513f18['name'];}_0x291327[_0x183f('0x15')](_0x149cfc)[_0x183f('0x26')](_0x513f18);};}exports[_0x183f('0x27')]=function(_0x4c235c,_0x889644){var _0x3de834={},_0x2a8868={},_0x256b2c={'count':0x0,'rows':[]};var _0x405d61=_[_0x183f('0x28')](db[_0x183f('0x29')][_0x183f('0x2a')],function(_0x401435){return{'name':_0x401435[_0x183f('0x2b')],'type':_0x401435[_0x183f('0x2c')]['key']};});_0x2a8868['model']=_[_0x183f('0x28')](_0x405d61,_0x183f('0x25'));_0x2a8868[_0x183f('0x2d')]=_['keys'](_0x4c235c['query']);_0x2a8868[_0x183f('0x2e')]=_[_0x183f('0x2f')](_0x2a8868[_0x183f('0x30')],_0x2a8868[_0x183f('0x2d')]);_0x3de834[_0x183f('0x31')]=_[_0x183f('0x2f')](_0x2a8868[_0x183f('0x30')],qs[_0x183f('0x32')](_0x4c235c[_0x183f('0x2d')][_0x183f('0x32')]));_0x3de834[_0x183f('0x31')]=_0x3de834['attributes'][_0x183f('0x33')]?_0x3de834[_0x183f('0x31')]:_0x2a8868[_0x183f('0x30')];if(!_0x4c235c['query'][_0x183f('0x34')]('nolimit')){_0x3de834[_0x183f('0x1a')]=qs[_0x183f('0x1a')](_0x4c235c[_0x183f('0x2d')][_0x183f('0x1a')]);_0x3de834[_0x183f('0x18')]=qs['offset'](_0x4c235c[_0x183f('0x2d')][_0x183f('0x18')]);}_0x3de834[_0x183f('0x35')]=qs['sort'](_0x4c235c['query'][_0x183f('0x36')]);_0x3de834[_0x183f('0x37')]=qs['filters'](_[_0x183f('0x38')](_0x4c235c[_0x183f('0x2d')],_0x2a8868[_0x183f('0x2e')]),_0x405d61);if(_0x4c235c['query'][_0x183f('0x39')]){_0x3de834['where']=_[_0x183f('0x3a')](_0x3de834[_0x183f('0x37')],{'$or':_[_0x183f('0x28')](_0x405d61,function(_0x2f5e50){if(_0x2f5e50[_0x183f('0x2c')]!==_0x183f('0x3b')){var _0x4e557f={};_0x4e557f[_0x2f5e50['name']]={'$like':'%'+_0x4c235c['query'][_0x183f('0x39')]+'%'};return _0x4e557f;}})});}_0x3de834=_[_0x183f('0x3a')]({},_0x3de834,_0x4c235c[_0x183f('0x3c')]);var _0x418867={'where':_0x3de834[_0x183f('0x37')]};return db['SalesforceConfiguration'][_0x183f('0x1b')](_0x418867)[_0x183f('0x3d')](function(_0x1ff558){_0x256b2c[_0x183f('0x1b')]=_0x1ff558;if(_0x4c235c['query']['includeAll']){_0x3de834[_0x183f('0x3e')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x183f('0x3f')](_0x3de834);})[_0x183f('0x3d')](function(_0x4821d3){_0x256b2c[_0x183f('0x40')]=_0x4821d3;return _0x256b2c;})['then'](respondWithFilteredResult(_0x889644,_0x3de834))['catch'](handleError(_0x889644,null));};exports[_0x183f('0x41')]=function(_0x529e65,_0x556766){var _0x7f865d={'raw':![],'where':{'id':_0x529e65[_0x183f('0x42')]['id']}},_0x53c751={};_0x53c751['model']=_[_0x183f('0x43')](db[_0x183f('0x29')]['rawAttributes']);_0x53c751[_0x183f('0x2d')]=_[_0x183f('0x43')](_0x529e65['query']);_0x53c751[_0x183f('0x2e')]=_[_0x183f('0x2f')](_0x53c751[_0x183f('0x30')],_0x53c751['query']);_0x7f865d[_0x183f('0x31')]=_[_0x183f('0x2f')](_0x53c751[_0x183f('0x30')],qs['fields'](_0x529e65[_0x183f('0x2d')][_0x183f('0x32')]));_0x7f865d['attributes']=_0x7f865d[_0x183f('0x31')]['length']?_0x7f865d[_0x183f('0x31')]:_0x53c751[_0x183f('0x30')];if(_0x529e65['query'][_0x183f('0x44')]){_0x7f865d[_0x183f('0x3e')]=[{'all':!![]}];}_0x7f865d=_[_0x183f('0x3a')]({},_0x7f865d,_0x529e65[_0x183f('0x3c')]);return db['SalesforceConfiguration'][_0x183f('0x45')](_0x7f865d)[_0x183f('0x3d')](handleEntityNotFound(_0x556766,null))[_0x183f('0x3d')](respondWithResult(_0x556766,null))['catch'](handleError(_0x556766,null));};exports['create']=function(_0x4fc826,_0x4b3203){return db['SalesforceConfiguration'][_0x183f('0x46')](_0x4fc826[_0x183f('0x47')],{})[_0x183f('0x3d')](respondWithResult(_0x4b3203,0xc9))['catch'](handleError(_0x4b3203,null));};exports[_0x183f('0x21')]=function(_0x3c086a,_0x2d93b4){if(_0x3c086a['body']['id']){delete _0x3c086a[_0x183f('0x47')]['id'];}return db[_0x183f('0x29')][_0x183f('0x45')]({'where':{'id':_0x3c086a[_0x183f('0x42')]['id']}})['then'](handleEntityNotFound(_0x2d93b4,null))[_0x183f('0x3d')](saveUpdates(_0x3c086a[_0x183f('0x47')],null))[_0x183f('0x3d')](respondWithResult(_0x2d93b4,null))['catch'](handleError(_0x2d93b4,null));};exports[_0x183f('0x22')]=function(_0x5ac385,_0x58d21b){return db['SalesforceConfiguration'][_0x183f('0x45')]({'where':{'id':_0x5ac385[_0x183f('0x42')]['id']}})[_0x183f('0x3d')](handleEntityNotFound(_0x58d21b,null))[_0x183f('0x3d')](removeEntity(_0x58d21b,null))['catch'](handleError(_0x58d21b,null));};exports['getFields']=function(_0x3e1bdd,_0x1ab71f,_0x20fbee){var _0x275c3f={};var _0x5bf410={};var _0x1e808c;var _0x351cb5;return db[_0x183f('0x29')][_0x183f('0x48')]({'where':{'id':_0x3e1bdd['params']['id']}})['then'](handleEntityNotFound(_0x1ab71f,null))['then'](function(_0x11bf26){if(_0x11bf26){_0x1e808c=_0x11bf26;_0x5bf410['model']=_['keys'](db[_0x183f('0x49')]['rawAttributes']);_0x5bf410['query']=_[_0x183f('0x43')](_0x3e1bdd['query']);_0x5bf410['filters']=_[_0x183f('0x2f')](_0x5bf410[_0x183f('0x30')],_0x5bf410['query']);_0x275c3f[_0x183f('0x31')]=_[_0x183f('0x2f')](_0x5bf410[_0x183f('0x30')],qs['fields'](_0x3e1bdd[_0x183f('0x2d')][_0x183f('0x32')]));_0x275c3f['attributes']=_0x275c3f[_0x183f('0x31')][_0x183f('0x33')]?_0x275c3f[_0x183f('0x31')]:_0x5bf410[_0x183f('0x30')];_0x275c3f[_0x183f('0x35')]=qs[_0x183f('0x36')](_0x3e1bdd['query'][_0x183f('0x36')]);_0x275c3f[_0x183f('0x37')]=qs['filters'](_['pick'](_0x3e1bdd[_0x183f('0x2d')],_0x5bf410[_0x183f('0x2e')]));if(_0x3e1bdd[_0x183f('0x2d')][_0x183f('0x39')]){_0x275c3f['where']=_['merge'](_0x275c3f[_0x183f('0x37')],{'$or':_[_0x183f('0x28')](_0x275c3f[_0x183f('0x31')],function(_0x387ecd){var _0x333a04={};_0x333a04[_0x387ecd]={'$like':'%'+_0x3e1bdd[_0x183f('0x2d')][_0x183f('0x39')]+'%'};return _0x333a04;})});}_0x275c3f=_['merge']({},_0x275c3f,_0x3e1bdd[_0x183f('0x3c')]);return _0x1e808c[_0x183f('0x4a')](_0x275c3f);}})[_0x183f('0x3d')](function(_0x4c3519){if(_0x4c3519){_0x351cb5=_0x4c3519[_0x183f('0x33')];if(!_0x3e1bdd[_0x183f('0x2d')][_0x183f('0x34')](_0x183f('0x4b'))){_0x275c3f['limit']=qs[_0x183f('0x1a')](_0x3e1bdd['query'][_0x183f('0x1a')]);_0x275c3f[_0x183f('0x18')]=qs[_0x183f('0x18')](_0x3e1bdd[_0x183f('0x2d')]['offset']);}return _0x1e808c[_0x183f('0x4a')](_0x275c3f);}})[_0x183f('0x3d')](function(_0x3f0bfd){if(_0x3f0bfd){return _0x3f0bfd?{'count':_0x351cb5,'rows':_0x3f0bfd}:null;}})[_0x183f('0x3d')](respondWithResult(_0x1ab71f,null))[_0x183f('0x4c')](handleError(_0x1ab71f,null));};exports[_0x183f('0x4d')]=function(_0x5bbe06,_0x2d725f,_0x3ca12a){var _0x45efcb={};var _0x16e2fb={};var _0x4057e6;var _0x31d49c;return db[_0x183f('0x29')][_0x183f('0x48')]({'where':{'id':_0x5bbe06[_0x183f('0x42')]['id']}})[_0x183f('0x3d')](handleEntityNotFound(_0x2d725f,null))[_0x183f('0x3d')](function(_0x455e11){if(_0x455e11){_0x4057e6=_0x455e11;_0x16e2fb[_0x183f('0x30')]=_[_0x183f('0x43')](db[_0x183f('0x49')][_0x183f('0x2a')]);_0x16e2fb['query']=_[_0x183f('0x43')](_0x5bbe06[_0x183f('0x2d')]);_0x16e2fb[_0x183f('0x2e')]=_[_0x183f('0x2f')](_0x16e2fb[_0x183f('0x30')],_0x16e2fb[_0x183f('0x2d')]);_0x45efcb['attributes']=_['intersection'](_0x16e2fb[_0x183f('0x30')],qs[_0x183f('0x32')](_0x5bbe06[_0x183f('0x2d')][_0x183f('0x32')]));_0x45efcb['attributes']=_0x45efcb[_0x183f('0x31')]['length']?_0x45efcb[_0x183f('0x31')]:_0x16e2fb[_0x183f('0x30')];_0x45efcb[_0x183f('0x35')]=qs[_0x183f('0x36')](_0x5bbe06['query'][_0x183f('0x36')]);_0x45efcb['where']=qs[_0x183f('0x2e')](_[_0x183f('0x38')](_0x5bbe06['query'],_0x16e2fb[_0x183f('0x2e')]));if(_0x5bbe06[_0x183f('0x2d')]['filter']){_0x45efcb[_0x183f('0x37')]=_[_0x183f('0x3a')](_0x45efcb['where'],{'$or':_['map'](_0x45efcb[_0x183f('0x31')],function(_0x1e71f5){var _0x5d6267={};_0x5d6267[_0x1e71f5]={'$like':'%'+_0x5bbe06[_0x183f('0x2d')][_0x183f('0x39')]+'%'};return _0x5d6267;})});}_0x45efcb=_[_0x183f('0x3a')]({},_0x45efcb,_0x5bbe06[_0x183f('0x3c')]);return _0x4057e6[_0x183f('0x4d')](_0x45efcb);}})['then'](function(_0x184545){if(_0x184545){_0x31d49c=_0x184545[_0x183f('0x33')];if(!_0x5bbe06['query'][_0x183f('0x34')](_0x183f('0x4b'))){_0x45efcb[_0x183f('0x1a')]=qs['limit'](_0x5bbe06[_0x183f('0x2d')][_0x183f('0x1a')]);_0x45efcb[_0x183f('0x18')]=qs[_0x183f('0x18')](_0x5bbe06[_0x183f('0x2d')][_0x183f('0x18')]);}return _0x4057e6[_0x183f('0x4d')](_0x45efcb);}})[_0x183f('0x3d')](function(_0x26547d){if(_0x26547d){return _0x26547d?{'count':_0x31d49c,'rows':_0x26547d}:null;}})[_0x183f('0x3d')](respondWithResult(_0x2d725f,null))[_0x183f('0x4c')](handleError(_0x2d725f,null));};exports['getDescriptions']=function(_0x211830,_0x4b3c46,_0x2a77c6){var _0x13b600={};var _0x189caa={};var _0x1217b8;var _0x559513;return db[_0x183f('0x29')][_0x183f('0x48')]({'where':{'id':_0x211830[_0x183f('0x42')]['id']}})[_0x183f('0x3d')](handleEntityNotFound(_0x4b3c46,null))[_0x183f('0x3d')](function(_0x3e9beb){if(_0x3e9beb){_0x1217b8=_0x3e9beb;_0x189caa['model']=_[_0x183f('0x43')](db[_0x183f('0x49')][_0x183f('0x2a')]);_0x189caa[_0x183f('0x2d')]=_['keys'](_0x211830[_0x183f('0x2d')]);_0x189caa[_0x183f('0x2e')]=_[_0x183f('0x2f')](_0x189caa[_0x183f('0x30')],_0x189caa['query']);_0x13b600[_0x183f('0x31')]=_[_0x183f('0x2f')](_0x189caa['model'],qs[_0x183f('0x32')](_0x211830['query'][_0x183f('0x32')]));_0x13b600['attributes']=_0x13b600[_0x183f('0x31')][_0x183f('0x33')]?_0x13b600[_0x183f('0x31')]:_0x189caa[_0x183f('0x30')];_0x13b600['order']=qs[_0x183f('0x36')](_0x211830['query'][_0x183f('0x36')]);_0x13b600[_0x183f('0x37')]=qs[_0x183f('0x2e')](_['pick'](_0x211830[_0x183f('0x2d')],_0x189caa[_0x183f('0x2e')]));if(_0x211830[_0x183f('0x2d')]['filter']){_0x13b600[_0x183f('0x37')]=_['merge'](_0x13b600[_0x183f('0x37')],{'$or':_[_0x183f('0x28')](_0x13b600[_0x183f('0x31')],function(_0x3ca480){var _0x565eb8={};_0x565eb8[_0x3ca480]={'$like':'%'+_0x211830['query'][_0x183f('0x39')]+'%'};return _0x565eb8;})});}_0x13b600=_[_0x183f('0x3a')]({},_0x13b600,_0x211830[_0x183f('0x3c')]);return _0x1217b8[_0x183f('0x4e')](_0x13b600);}})[_0x183f('0x3d')](function(_0x41d364){if(_0x41d364){_0x559513=_0x41d364[_0x183f('0x33')];if(!_0x211830[_0x183f('0x2d')][_0x183f('0x34')]('nolimit')){_0x13b600[_0x183f('0x1a')]=qs[_0x183f('0x1a')](_0x211830[_0x183f('0x2d')]['limit']);_0x13b600['offset']=qs['offset'](_0x211830[_0x183f('0x2d')][_0x183f('0x18')]);}return _0x1217b8[_0x183f('0x4e')](_0x13b600);}})[_0x183f('0x3d')](function(_0x1b2361){if(_0x1b2361){return _0x1b2361?{'count':_0x559513,'rows':_0x1b2361}:null;}})[_0x183f('0x3d')](respondWithResult(_0x4b3c46,null))[_0x183f('0x4c')](handleError(_0x4b3c46,null));}; \ No newline at end of file +var _0xd421=['bluebird','mustache','util','path','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','SalesforceConfiguration','rawAttributes','fieldName','type','key','map','query','keys','model','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','intersection','length','include','create','body','find','params','getFields','findOne','SalesforceField','order','pick','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment'];(function(_0x1c5f82,_0x38419d){var _0x5d7aa4=function(_0x3922c1){while(--_0x3922c1){_0x1c5f82['push'](_0x1c5f82['shift']());}};_0x5d7aa4(++_0x38419d);}(_0xd421,0x195));var _0x1d42=function(_0x4f3364,_0x40a2d0){_0x4f3364=_0x4f3364-0x0;var _0x289e25=_0xd421[_0x4f3364];return _0x289e25;};'use strict';var emlformat=require(_0x1d42('0x0'));var rimraf=require(_0x1d42('0x1'));var zipdir=require(_0x1d42('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1d42('0x3'));var moment=require(_0x1d42('0x4'));var BPromise=require(_0x1d42('0x5'));var Mustache=require(_0x1d42('0x6'));var util=require(_0x1d42('0x7'));var path=require(_0x1d42('0x8'));var sox=require('sox');var csv=require(_0x1d42('0x9'));var ejs=require(_0x1d42('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x1d42('0xb'));var jsforce=require(_0x1d42('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1d42('0x9'));var querystring=require(_0x1d42('0xd'));var Papa=require(_0x1d42('0xe'));var Redis=require(_0x1d42('0xf'));var authService=require(_0x1d42('0x10'));var qs=require(_0x1d42('0x11'));var as=require(_0x1d42('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1d42('0x13'))(_0x1d42('0x14'));var utils=require('../../config/utils');var config=require(_0x1d42('0x15'));var licenseUtil=require(_0x1d42('0x16'));var db=require(_0x1d42('0x17'))['db'];function respondWithStatusCode(_0x2fff62,_0x2d8c06){_0x2d8c06=_0x2d8c06||0xcc;return function(_0x549490){if(_0x549490){return _0x2fff62[_0x1d42('0x18')](_0x2d8c06);}return _0x2fff62[_0x1d42('0x19')](_0x2d8c06)['end']();};}function respondWithResult(_0x208bb5,_0x1463b7){_0x1463b7=_0x1463b7||0xc8;return function(_0x3ef0b6){if(_0x3ef0b6){return _0x208bb5[_0x1d42('0x19')](_0x1463b7)[_0x1d42('0x1a')](_0x3ef0b6);}};}function respondWithFilteredResult(_0xc5e3c0,_0x18e6b9){return function(_0x225253){if(_0x225253){var _0x596222=typeof _0x18e6b9[_0x1d42('0x1b')]===_0x1d42('0x1c')&&typeof _0x18e6b9[_0x1d42('0x1d')]===_0x1d42('0x1c');var _0xd77cf6=_0x225253['count'];var _0x4218e8=_0x596222?0x0:_0x18e6b9[_0x1d42('0x1b')];var _0x19d787=_0x596222?_0x225253['count']:_0x18e6b9['offset']+_0x18e6b9['limit'];var _0x5375f3;if(_0x19d787>=_0xd77cf6){_0x19d787=_0xd77cf6;_0x5375f3=0xc8;}else{_0x5375f3=0xce;}_0xc5e3c0[_0x1d42('0x19')](_0x5375f3);return _0xc5e3c0[_0x1d42('0x1e')]('Content-Range',_0x4218e8+'-'+_0x19d787+'/'+_0xd77cf6)[_0x1d42('0x1a')](_0x225253);}return null;};}function patchUpdates(_0x49bd47){return function(_0x40a820){try{jsonpatch[_0x1d42('0x1f')](_0x40a820,_0x49bd47,!![]);}catch(_0x3287ba){return BPromise[_0x1d42('0x20')](_0x3287ba);}return _0x40a820[_0x1d42('0x21')]();};}function saveUpdates(_0x5b0df7,_0x5850b9){return function(_0x5f05e6){if(_0x5f05e6){return _0x5f05e6[_0x1d42('0x22')](_0x5b0df7)[_0x1d42('0x23')](function(_0x2f59a8){return _0x2f59a8;});}return null;};}function removeEntity(_0x1aa792,_0x3b74f5){return function(_0x4bb346){if(_0x4bb346){return _0x4bb346[_0x1d42('0x24')]()['then'](function(){_0x1aa792[_0x1d42('0x19')](0xcc)[_0x1d42('0x25')]();});}};}function handleEntityNotFound(_0x4b74bf,_0x44cb4b){return function(_0x3e5911){if(!_0x3e5911){_0x4b74bf['sendStatus'](0x194);}return _0x3e5911;};}function handleError(_0x23b5cf,_0x23c84c){_0x23c84c=_0x23c84c||0x1f4;return function(_0x362327){logger[_0x1d42('0x26')](_0x362327[_0x1d42('0x27')]);if(_0x362327[_0x1d42('0x28')]){delete _0x362327['name'];}_0x23b5cf[_0x1d42('0x19')](_0x23c84c)[_0x1d42('0x29')](_0x362327);};}exports[_0x1d42('0x2a')]=function(_0x4889a7,_0x44ed7a){var _0x256327={},_0x5987f7={},_0x5275ef={'count':0x0,'rows':[]};var _0x587a16=_['map'](db[_0x1d42('0x2b')][_0x1d42('0x2c')],function(_0x42e966){return{'name':_0x42e966[_0x1d42('0x2d')],'type':_0x42e966[_0x1d42('0x2e')][_0x1d42('0x2f')]};});_0x5987f7['model']=_[_0x1d42('0x30')](_0x587a16,'name');_0x5987f7[_0x1d42('0x31')]=_[_0x1d42('0x32')](_0x4889a7[_0x1d42('0x31')]);_0x5987f7['filters']=_['intersection'](_0x5987f7[_0x1d42('0x33')],_0x5987f7['query']);_0x256327[_0x1d42('0x34')]=_['intersection'](_0x5987f7['model'],qs[_0x1d42('0x35')](_0x4889a7[_0x1d42('0x31')][_0x1d42('0x35')]));_0x256327[_0x1d42('0x34')]=_0x256327[_0x1d42('0x34')]['length']?_0x256327[_0x1d42('0x34')]:_0x5987f7[_0x1d42('0x33')];if(!_0x4889a7['query'][_0x1d42('0x36')](_0x1d42('0x37'))){_0x256327[_0x1d42('0x1d')]=qs[_0x1d42('0x1d')](_0x4889a7[_0x1d42('0x31')][_0x1d42('0x1d')]);_0x256327['offset']=qs[_0x1d42('0x1b')](_0x4889a7[_0x1d42('0x31')][_0x1d42('0x1b')]);}_0x256327['order']=qs[_0x1d42('0x38')](_0x4889a7['query'][_0x1d42('0x38')]);_0x256327[_0x1d42('0x39')]=qs[_0x1d42('0x3a')](_['pick'](_0x4889a7[_0x1d42('0x31')],_0x5987f7[_0x1d42('0x3a')]),_0x587a16);if(_0x4889a7[_0x1d42('0x31')][_0x1d42('0x3b')]){_0x256327['where']=_[_0x1d42('0x3c')](_0x256327['where'],{'$or':_[_0x1d42('0x30')](_0x587a16,function(_0xf8ef0){if(_0xf8ef0[_0x1d42('0x2e')]!==_0x1d42('0x3d')){var _0x15aa3d={};_0x15aa3d[_0xf8ef0['name']]={'$like':'%'+_0x4889a7[_0x1d42('0x31')]['filter']+'%'};return _0x15aa3d;}})});}_0x256327=_[_0x1d42('0x3c')]({},_0x256327,_0x4889a7[_0x1d42('0x3e')]);var _0x1efccd={'where':_0x256327[_0x1d42('0x39')]};return db['SalesforceConfiguration']['count'](_0x1efccd)['then'](function(_0x9cbc1f){_0x5275ef['count']=_0x9cbc1f;if(_0x4889a7[_0x1d42('0x31')][_0x1d42('0x3f')]){_0x256327['include']=[{'all':!![]}];}return db[_0x1d42('0x2b')][_0x1d42('0x40')](_0x256327);})['then'](function(_0x59235d){_0x5275ef[_0x1d42('0x41')]=_0x59235d;return _0x5275ef;})[_0x1d42('0x23')](respondWithFilteredResult(_0x44ed7a,_0x256327))[_0x1d42('0x42')](handleError(_0x44ed7a,null));};exports[_0x1d42('0x43')]=function(_0x37ee29,_0x57d8e8){var _0x28c497={'raw':![],'where':{'id':_0x37ee29['params']['id']}},_0x522ff3={};_0x522ff3[_0x1d42('0x33')]=_[_0x1d42('0x32')](db['SalesforceConfiguration'][_0x1d42('0x2c')]);_0x522ff3[_0x1d42('0x31')]=_[_0x1d42('0x32')](_0x37ee29[_0x1d42('0x31')]);_0x522ff3[_0x1d42('0x3a')]=_[_0x1d42('0x44')](_0x522ff3[_0x1d42('0x33')],_0x522ff3[_0x1d42('0x31')]);_0x28c497['attributes']=_[_0x1d42('0x44')](_0x522ff3[_0x1d42('0x33')],qs[_0x1d42('0x35')](_0x37ee29[_0x1d42('0x31')][_0x1d42('0x35')]));_0x28c497['attributes']=_0x28c497[_0x1d42('0x34')][_0x1d42('0x45')]?_0x28c497[_0x1d42('0x34')]:_0x522ff3[_0x1d42('0x33')];if(_0x37ee29[_0x1d42('0x31')][_0x1d42('0x3f')]){_0x28c497[_0x1d42('0x46')]=[{'all':!![]}];}_0x28c497=_[_0x1d42('0x3c')]({},_0x28c497,_0x37ee29[_0x1d42('0x3e')]);return db[_0x1d42('0x2b')]['find'](_0x28c497)[_0x1d42('0x23')](handleEntityNotFound(_0x57d8e8,null))[_0x1d42('0x23')](respondWithResult(_0x57d8e8,null))[_0x1d42('0x42')](handleError(_0x57d8e8,null));};exports[_0x1d42('0x47')]=function(_0x4f51f6,_0x4faa70){return db[_0x1d42('0x2b')]['create'](_0x4f51f6[_0x1d42('0x48')],{})['then'](respondWithResult(_0x4faa70,0xc9))[_0x1d42('0x42')](handleError(_0x4faa70,null));};exports['update']=function(_0x5309f8,_0x3a78a6){if(_0x5309f8['body']['id']){delete _0x5309f8[_0x1d42('0x48')]['id'];}return db['SalesforceConfiguration'][_0x1d42('0x49')]({'where':{'id':_0x5309f8[_0x1d42('0x4a')]['id']}})[_0x1d42('0x23')](handleEntityNotFound(_0x3a78a6,null))[_0x1d42('0x23')](saveUpdates(_0x5309f8['body'],null))['then'](respondWithResult(_0x3a78a6,null))[_0x1d42('0x42')](handleError(_0x3a78a6,null));};exports[_0x1d42('0x24')]=function(_0x3f866f,_0x521d81){return db[_0x1d42('0x2b')][_0x1d42('0x49')]({'where':{'id':_0x3f866f[_0x1d42('0x4a')]['id']}})[_0x1d42('0x23')](handleEntityNotFound(_0x521d81,null))['then'](removeEntity(_0x521d81,null))['catch'](handleError(_0x521d81,null));};exports[_0x1d42('0x4b')]=function(_0x2a69b0,_0x19627a,_0x290c50){var _0x10060f={};var _0x3d217a={};var _0xeb29a7;var _0x5c86f6;return db[_0x1d42('0x2b')][_0x1d42('0x4c')]({'where':{'id':_0x2a69b0['params']['id']}})[_0x1d42('0x23')](handleEntityNotFound(_0x19627a,null))['then'](function(_0x51359b){if(_0x51359b){_0xeb29a7=_0x51359b;_0x3d217a[_0x1d42('0x33')]=_['keys'](db[_0x1d42('0x4d')][_0x1d42('0x2c')]);_0x3d217a['query']=_[_0x1d42('0x32')](_0x2a69b0[_0x1d42('0x31')]);_0x3d217a[_0x1d42('0x3a')]=_[_0x1d42('0x44')](_0x3d217a['model'],_0x3d217a[_0x1d42('0x31')]);_0x10060f[_0x1d42('0x34')]=_[_0x1d42('0x44')](_0x3d217a[_0x1d42('0x33')],qs['fields'](_0x2a69b0[_0x1d42('0x31')][_0x1d42('0x35')]));_0x10060f[_0x1d42('0x34')]=_0x10060f['attributes'][_0x1d42('0x45')]?_0x10060f[_0x1d42('0x34')]:_0x3d217a['model'];_0x10060f[_0x1d42('0x4e')]=qs[_0x1d42('0x38')](_0x2a69b0[_0x1d42('0x31')][_0x1d42('0x38')]);_0x10060f[_0x1d42('0x39')]=qs[_0x1d42('0x3a')](_[_0x1d42('0x4f')](_0x2a69b0[_0x1d42('0x31')],_0x3d217a[_0x1d42('0x3a')]));if(_0x2a69b0[_0x1d42('0x31')][_0x1d42('0x3b')]){_0x10060f[_0x1d42('0x39')]=_['merge'](_0x10060f[_0x1d42('0x39')],{'$or':_['map'](_0x10060f[_0x1d42('0x34')],function(_0x1eab70){var _0x26a8cd={};_0x26a8cd[_0x1eab70]={'$like':'%'+_0x2a69b0['query'][_0x1d42('0x3b')]+'%'};return _0x26a8cd;})});}_0x10060f=_[_0x1d42('0x3c')]({},_0x10060f,_0x2a69b0[_0x1d42('0x3e')]);return _0xeb29a7[_0x1d42('0x4b')](_0x10060f);}})[_0x1d42('0x23')](function(_0x7b4d2f){if(_0x7b4d2f){_0x5c86f6=_0x7b4d2f['length'];if(!_0x2a69b0['query']['hasOwnProperty'](_0x1d42('0x37'))){_0x10060f['limit']=qs[_0x1d42('0x1d')](_0x2a69b0['query']['limit']);_0x10060f[_0x1d42('0x1b')]=qs[_0x1d42('0x1b')](_0x2a69b0[_0x1d42('0x31')][_0x1d42('0x1b')]);}return _0xeb29a7[_0x1d42('0x4b')](_0x10060f);}})[_0x1d42('0x23')](function(_0x4361aa){if(_0x4361aa){return _0x4361aa?{'count':_0x5c86f6,'rows':_0x4361aa}:null;}})[_0x1d42('0x23')](respondWithResult(_0x19627a,null))[_0x1d42('0x42')](handleError(_0x19627a,null));};exports[_0x1d42('0x50')]=function(_0x4f28b0,_0x378e8d,_0x3617c2){var _0x5699e5={};var _0x43070b={};var _0x231a8d;var _0xa003ba;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x4f28b0[_0x1d42('0x4a')]['id']}})[_0x1d42('0x23')](handleEntityNotFound(_0x378e8d,null))['then'](function(_0x124d8e){if(_0x124d8e){_0x231a8d=_0x124d8e;_0x43070b[_0x1d42('0x33')]=_[_0x1d42('0x32')](db[_0x1d42('0x4d')][_0x1d42('0x2c')]);_0x43070b[_0x1d42('0x31')]=_[_0x1d42('0x32')](_0x4f28b0[_0x1d42('0x31')]);_0x43070b[_0x1d42('0x3a')]=_['intersection'](_0x43070b[_0x1d42('0x33')],_0x43070b[_0x1d42('0x31')]);_0x5699e5['attributes']=_['intersection'](_0x43070b[_0x1d42('0x33')],qs[_0x1d42('0x35')](_0x4f28b0[_0x1d42('0x31')][_0x1d42('0x35')]));_0x5699e5[_0x1d42('0x34')]=_0x5699e5[_0x1d42('0x34')][_0x1d42('0x45')]?_0x5699e5['attributes']:_0x43070b[_0x1d42('0x33')];_0x5699e5[_0x1d42('0x4e')]=qs['sort'](_0x4f28b0['query'][_0x1d42('0x38')]);_0x5699e5[_0x1d42('0x39')]=qs[_0x1d42('0x3a')](_[_0x1d42('0x4f')](_0x4f28b0['query'],_0x43070b[_0x1d42('0x3a')]));if(_0x4f28b0[_0x1d42('0x31')][_0x1d42('0x3b')]){_0x5699e5[_0x1d42('0x39')]=_[_0x1d42('0x3c')](_0x5699e5['where'],{'$or':_[_0x1d42('0x30')](_0x5699e5['attributes'],function(_0x28b7d0){var _0x4ef6d5={};_0x4ef6d5[_0x28b7d0]={'$like':'%'+_0x4f28b0[_0x1d42('0x31')]['filter']+'%'};return _0x4ef6d5;})});}_0x5699e5=_[_0x1d42('0x3c')]({},_0x5699e5,_0x4f28b0[_0x1d42('0x3e')]);return _0x231a8d[_0x1d42('0x50')](_0x5699e5);}})[_0x1d42('0x23')](function(_0x5a72cb){if(_0x5a72cb){_0xa003ba=_0x5a72cb[_0x1d42('0x45')];if(!_0x4f28b0[_0x1d42('0x31')][_0x1d42('0x36')](_0x1d42('0x37'))){_0x5699e5[_0x1d42('0x1d')]=qs['limit'](_0x4f28b0['query'][_0x1d42('0x1d')]);_0x5699e5['offset']=qs[_0x1d42('0x1b')](_0x4f28b0[_0x1d42('0x31')][_0x1d42('0x1b')]);}return _0x231a8d[_0x1d42('0x50')](_0x5699e5);}})[_0x1d42('0x23')](function(_0x2f812c){if(_0x2f812c){return _0x2f812c?{'count':_0xa003ba,'rows':_0x2f812c}:null;}})[_0x1d42('0x23')](respondWithResult(_0x378e8d,null))[_0x1d42('0x42')](handleError(_0x378e8d,null));};exports[_0x1d42('0x51')]=function(_0x5e786e,_0x56fb20,_0x515601){var _0xecb292={};var _0x3021fa={};var _0x309f8d;var _0x12ac55;return db['SalesforceConfiguration'][_0x1d42('0x4c')]({'where':{'id':_0x5e786e['params']['id']}})[_0x1d42('0x23')](handleEntityNotFound(_0x56fb20,null))[_0x1d42('0x23')](function(_0x42df14){if(_0x42df14){_0x309f8d=_0x42df14;_0x3021fa[_0x1d42('0x33')]=_['keys'](db['SalesforceField']['rawAttributes']);_0x3021fa[_0x1d42('0x31')]=_[_0x1d42('0x32')](_0x5e786e[_0x1d42('0x31')]);_0x3021fa[_0x1d42('0x3a')]=_['intersection'](_0x3021fa[_0x1d42('0x33')],_0x3021fa[_0x1d42('0x31')]);_0xecb292[_0x1d42('0x34')]=_[_0x1d42('0x44')](_0x3021fa[_0x1d42('0x33')],qs[_0x1d42('0x35')](_0x5e786e['query']['fields']));_0xecb292[_0x1d42('0x34')]=_0xecb292[_0x1d42('0x34')][_0x1d42('0x45')]?_0xecb292['attributes']:_0x3021fa[_0x1d42('0x33')];_0xecb292[_0x1d42('0x4e')]=qs[_0x1d42('0x38')](_0x5e786e['query'][_0x1d42('0x38')]);_0xecb292['where']=qs[_0x1d42('0x3a')](_['pick'](_0x5e786e[_0x1d42('0x31')],_0x3021fa[_0x1d42('0x3a')]));if(_0x5e786e['query'][_0x1d42('0x3b')]){_0xecb292[_0x1d42('0x39')]=_[_0x1d42('0x3c')](_0xecb292[_0x1d42('0x39')],{'$or':_[_0x1d42('0x30')](_0xecb292['attributes'],function(_0x34d5fc){var _0x1fb113={};_0x1fb113[_0x34d5fc]={'$like':'%'+_0x5e786e['query']['filter']+'%'};return _0x1fb113;})});}_0xecb292=_[_0x1d42('0x3c')]({},_0xecb292,_0x5e786e[_0x1d42('0x3e')]);return _0x309f8d[_0x1d42('0x51')](_0xecb292);}})['then'](function(_0x174b8d){if(_0x174b8d){_0x12ac55=_0x174b8d[_0x1d42('0x45')];if(!_0x5e786e[_0x1d42('0x31')][_0x1d42('0x36')](_0x1d42('0x37'))){_0xecb292[_0x1d42('0x1d')]=qs[_0x1d42('0x1d')](_0x5e786e['query'][_0x1d42('0x1d')]);_0xecb292[_0x1d42('0x1b')]=qs['offset'](_0x5e786e['query'][_0x1d42('0x1b')]);}return _0x309f8d[_0x1d42('0x51')](_0xecb292);}})['then'](function(_0xd93a0b){if(_0xd93a0b){return _0xd93a0b?{'count':_0x12ac55,'rows':_0xd93a0b}:null;}})[_0x1d42('0x23')](respondWithResult(_0x56fb20,null))[_0x1d42('0x42')](handleError(_0x56fb20,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 03b6dcd..3c48537 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 _0x0f9a=['path','rimraf','./intSalesforceConfiguration.attributes','exports','SalesforceConfiguration','int_salesforce_configurations','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x37725a,_0x57438c){var _0x2e15de=function(_0x356e58){while(--_0x356e58){_0x37725a['push'](_0x37725a['shift']());}};_0x2e15de(++_0x57438c);}(_0x0f9a,0x14a));var _0xa0f9=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x0f9a[_0xbca1b1];return _0x4e1686;};'use strict';var _=require('lodash');var util=require(_0xa0f9('0x0'));var logger=require(_0xa0f9('0x1'))(_0xa0f9('0x2'));var moment=require(_0xa0f9('0x3'));var BPromise=require(_0xa0f9('0x4'));var rp=require(_0xa0f9('0x5'));var fs=require('fs');var path=require(_0xa0f9('0x6'));var rimraf=require(_0xa0f9('0x7'));var config=require('../../config/environment');var attributes=require(_0xa0f9('0x8'));module[_0xa0f9('0x9')]=function(_0x5ef62a,_0x4dd6b9){return _0x5ef62a['define'](_0xa0f9('0xa'),attributes,{'tableName':_0xa0f9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5c47=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x5c47,0xc8));var _0x75c4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5c47[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x75c4('0x0'));var util=require(_0x75c4('0x1'));var logger=require(_0x75c4('0x2'))('api');var moment=require(_0x75c4('0x3'));var BPromise=require(_0x75c4('0x4'));var rp=require(_0x75c4('0x5'));var fs=require('fs');var path=require(_0x75c4('0x6'));var rimraf=require(_0x75c4('0x7'));var config=require(_0x75c4('0x8'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0x75c4('0x9')]=function(_0x4ac729,_0x32ce9e){return _0x4ac729['define']('SalesforceConfiguration',attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index 11bc33c..871c3f3 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 _0xdb92=['error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x355ce8,_0x5f1d0a){var _0x1db8b8=function(_0x277eb2){while(--_0x277eb2){_0x355ce8['push'](_0x355ce8['shift']());}};_0x1db8b8(++_0x5f1d0a);}(_0xdb92,0xea));var _0x2db9=function(_0x20813a,_0x3a3212){_0x20813a=_0x20813a-0x0;var _0x269542=_0xdb92[_0x20813a];return _0x269542;};'use strict';var _=require(_0x2db9('0x0'));var util=require(_0x2db9('0x1'));var moment=require('moment');var BPromise=require(_0x2db9('0x2'));var rs=require(_0x2db9('0x3'));var fs=require('fs');var Redis=require(_0x2db9('0x4'));var db=require(_0x2db9('0x5'))['db'];var utils=require(_0x2db9('0x6'));var logger=require('../../config/logger')(_0x2db9('0x7'));var config=require(_0x2db9('0x8'));var jayson=require(_0x2db9('0x9'));var client=jayson[_0x2db9('0xa')][_0x2db9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1edc02,_0x2f2490,_0x395fcc){return new BPromise(function(_0x2b9deb,_0x4fa44f){return client[_0x2db9('0xc')](_0x1edc02,_0x395fcc)['then'](function(_0x4989fa){logger[_0x2db9('0xd')](_0x2db9('0xe'),_0x2f2490,_0x2db9('0xf'));logger[_0x2db9('0x10')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x2f2490,_0x2db9('0xf'),JSON[_0x2db9('0x11')](_0x4989fa));if(_0x4989fa[_0x2db9('0x12')]){if(_0x4989fa[_0x2db9('0x12')]['code']===0x1f4){logger[_0x2db9('0x12')](_0x2db9('0xe'),_0x2f2490,_0x4989fa[_0x2db9('0x12')][_0x2db9('0x13')]);return _0x4fa44f(_0x4989fa[_0x2db9('0x12')][_0x2db9('0x13')]);}logger[_0x2db9('0x12')](_0x2db9('0xe'),_0x2f2490,_0x4989fa[_0x2db9('0x12')][_0x2db9('0x13')]);return _0x2b9deb(_0x4989fa[_0x2db9('0x12')][_0x2db9('0x13')]);}else{logger[_0x2db9('0xd')](_0x2db9('0xe'),_0x2f2490,'request\x20sent');_0x2b9deb(_0x4989fa['result'][_0x2db9('0x13')]);}})[_0x2db9('0x14')](function(_0x2c1bb5){logger[_0x2db9('0x12')](_0x2db9('0xe'),_0x2f2490,_0x2c1bb5);_0x4fa44f(_0x2c1bb5);});});} \ No newline at end of file +var _0x66af=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x4424b2,_0x561242){var _0x378557=function(_0x2654c6){while(--_0x2654c6){_0x4424b2['push'](_0x4424b2['shift']());}};_0x378557(++_0x561242);}(_0x66af,0xbe));var _0xf66a=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x66af[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0xf66a('0x0'));var util=require('util');var moment=require(_0xf66a('0x1'));var BPromise=require(_0xf66a('0x2'));var rs=require(_0xf66a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf66a('0x4'))['db'];var utils=require(_0xf66a('0x5'));var logger=require(_0xf66a('0x6'))(_0xf66a('0x7'));var config=require(_0xf66a('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x536882,_0x1a6c34,_0x2ac2d5){return new BPromise(function(_0x52b329,_0x10bc2d){return client['request'](_0x536882,_0x2ac2d5)[_0xf66a('0x9')](function(_0x414345){logger[_0xf66a('0xa')](_0xf66a('0xb'),_0x1a6c34,_0xf66a('0xc'));logger['debug']('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x1a6c34,_0xf66a('0xc'),JSON[_0xf66a('0xd')](_0x414345));if(_0x414345[_0xf66a('0xe')]){if(_0x414345[_0xf66a('0xe')][_0xf66a('0xf')]===0x1f4){logger[_0xf66a('0xe')](_0xf66a('0xb'),_0x1a6c34,_0x414345[_0xf66a('0xe')][_0xf66a('0x10')]);return _0x10bc2d(_0x414345['error'][_0xf66a('0x10')]);}logger[_0xf66a('0xe')](_0xf66a('0xb'),_0x1a6c34,_0x414345[_0xf66a('0xe')][_0xf66a('0x10')]);return _0x52b329(_0x414345[_0xf66a('0xe')][_0xf66a('0x10')]);}else{logger[_0xf66a('0xa')](_0xf66a('0xb'),_0x1a6c34,_0xf66a('0xc'));_0x52b329(_0x414345[_0xf66a('0x11')][_0xf66a('0x10')]);}})[_0xf66a('0x12')](function(_0xaffb49){logger['error'](_0xf66a('0xb'),_0x1a6c34,_0xaffb49);_0x10bc2d(_0xaffb49);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 88b85ea..b53918d 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 _0x213f=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','isAuthenticated','index','get','/:id','show','create','put','update','delete','destroy','exports','path'];(function(_0x5bf46c,_0x1fe508){var _0x5a37c4=function(_0x2cf2c3){while(--_0x2cf2c3){_0x5bf46c['push'](_0x5bf46c['shift']());}};_0x5a37c4(++_0x1fe508);}(_0x213f,0x18b));var _0xf213=function(_0x11d7dc,_0x2ccadc){_0x11d7dc=_0x11d7dc-0x0;var _0x2565fd=_0x213f[_0x11d7dc];return _0x2565fd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf213('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf213('0x1')]();var fs_extra=require(_0xf213('0x2'));var auth=require(_0xf213('0x3'));var interaction=require(_0xf213('0x4'));var config=require(_0xf213('0x5'));var controller=require(_0xf213('0x6'));router['get']('/',auth[_0xf213('0x7')](),controller[_0xf213('0x8')]);router[_0xf213('0x9')](_0xf213('0xa'),auth['isAuthenticated'](),controller[_0xf213('0xb')]);router['post']('/',auth[_0xf213('0x7')](),controller[_0xf213('0xc')]);router[_0xf213('0xd')](_0xf213('0xa'),auth[_0xf213('0x7')](),controller[_0xf213('0xe')]);router[_0xf213('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xf213('0x10')]);module[_0xf213('0x11')]=router; \ No newline at end of file +var _0x9937=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id','create','update','delete','destroy'];(function(_0x3f0b30,_0x159bc8){var _0x2748a5=function(_0x3b42cc){while(--_0x3b42cc){_0x3f0b30['push'](_0x3f0b30['shift']());}};_0x2748a5(++_0x159bc8);}(_0x9937,0x1c9));var _0x7993=function(_0x4a6a5e,_0x1eaf95){_0x4a6a5e=_0x4a6a5e-0x0;var _0x342604=_0x9937[_0x4a6a5e];return _0x342604;};'use strict';var multer=require(_0x7993('0x0'));var util=require(_0x7993('0x1'));var path=require('path');var timeout=require(_0x7993('0x2'));var express=require(_0x7993('0x3'));var router=express[_0x7993('0x4')]();var fs_extra=require(_0x7993('0x5'));var auth=require(_0x7993('0x6'));var interaction=require(_0x7993('0x7'));var config=require(_0x7993('0x8'));var controller=require(_0x7993('0x9'));router[_0x7993('0xa')]('/',auth[_0x7993('0xb')](),controller[_0x7993('0xc')]);router[_0x7993('0xa')](_0x7993('0xd'),auth[_0x7993('0xb')](),controller['show']);router['post']('/',auth[_0x7993('0xb')](),controller[_0x7993('0xe')]);router['put']('/:id',auth[_0x7993('0xb')](),controller[_0x7993('0xf')]);router[_0x7993('0x10')](_0x7993('0xd'),auth[_0x7993('0xb')](),controller[_0x7993('0x11')]);module[_0x7993('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index e31f5bf..0f34754 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 _0x705f=['exports','ENUM','string','customVariable','keyValue','STRING','variable','sequelize'];(function(_0xf07428,_0x1ebe43){var _0x3fe667=function(_0x3f20dc){while(--_0x3f20dc){_0xf07428['push'](_0xf07428['shift']());}};_0x3fe667(++_0x1ebe43);}(_0x705f,0xc7));var _0xf705=function(_0x158cfc,_0x3ff9e0){_0x158cfc=_0x158cfc-0x0;var _0x38baee=_0x705f[_0x158cfc];return _0x38baee;};'use strict';var Sequelize=require(_0xf705('0x0'));module[_0xf705('0x1')]={'type':{'type':Sequelize[_0xf705('0x2')](_0xf705('0x3'),'variable',_0xf705('0x4'),_0xf705('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xf705('0x6')]},'keyType':{'type':Sequelize[_0xf705('0x2')](_0xf705('0x3'),_0xf705('0x7'),_0xf705('0x4'))},'keyContent':{'type':Sequelize[_0xf705('0x6')]},'idField':{'type':Sequelize[_0xf705('0x6')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd015=['STRING','sequelize','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0xf0880f,_0x400389){var _0x10f7f6=function(_0x38c069){while(--_0x38c069){_0xf0880f['push'](_0xf0880f['shift']());}};_0x10f7f6(++_0x400389);}(_0xd015,0x161));var _0x5d01=function(_0x5aecee,_0x8bb05b){_0x5aecee=_0x5aecee-0x0;var _0x1d3d6b=_0xd015[_0x5aecee];return _0x1d3d6b;};'use strict';var Sequelize=require(_0x5d01('0x0'));module['exports']={'type':{'type':Sequelize[_0x5d01('0x1')](_0x5d01('0x2'),_0x5d01('0x3'),_0x5d01('0x4'),_0x5d01('0x5'),_0x5d01('0x6')),'defaultValue':_0x5d01('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x5d01('0x2'),_0x5d01('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x5d01('0x7')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x5d01('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 8de4304..9f3e449 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 _0xb85c=['include','findAll','rows','catch','show','params','intersection','create','body','find','rimraf','fast-json-patch','moment','mustache','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','options','includeAll'];(function(_0x16e66b,_0x2b65eb){var _0x42751a=function(_0x21bed9){while(--_0x21bed9){_0x16e66b['push'](_0x16e66b['shift']());}};_0x42751a(++_0x2b65eb);}(_0xb85c,0x168));var _0xcb85=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0xb85c[_0x4d8ed9];return _0x1e2140;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcb85('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcb85('0x1'));var rp=require('request-promise');var moment=require(_0xcb85('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xcb85('0x3'));var util=require('util');var path=require(_0xcb85('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xcb85('0x5'));var fs=require('fs');var fs_extra=require(_0xcb85('0x6'));var _=require(_0xcb85('0x7'));var squel=require(_0xcb85('0x8'));var crypto=require('crypto');var jsforce=require(_0xcb85('0x9'));var deskjs=require(_0xcb85('0xa'));var toCsv=require(_0xcb85('0xb'));var querystring=require(_0xcb85('0xc'));var Papa=require(_0xcb85('0xd'));var Redis=require(_0xcb85('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xcb85('0xf'));var as=require(_0xcb85('0x10'));var hardwareService=require(_0xcb85('0x11'));var logger=require(_0xcb85('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xcb85('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xcb85('0x14'))['db'];function respondWithStatusCode(_0x58ab7c,_0x1fe88f){_0x1fe88f=_0x1fe88f||0xcc;return function(_0x44f51a){if(_0x44f51a){return _0x58ab7c['sendStatus'](_0x1fe88f);}return _0x58ab7c[_0xcb85('0x15')](_0x1fe88f)['end']();};}function respondWithResult(_0x40b02e,_0x234807){_0x234807=_0x234807||0xc8;return function(_0x68a99d){if(_0x68a99d){return _0x40b02e[_0xcb85('0x15')](_0x234807)[_0xcb85('0x16')](_0x68a99d);}};}function respondWithFilteredResult(_0x32966f,_0x54455d){return function(_0x3a262f){if(_0x3a262f){var _0x5ca19c=typeof _0x54455d[_0xcb85('0x17')]===_0xcb85('0x18')&&typeof _0x54455d[_0xcb85('0x19')]==='undefined';var _0xbacda6=_0x3a262f[_0xcb85('0x1a')];var _0x54e9d8=_0x5ca19c?0x0:_0x54455d['offset'];var _0x52ef0a=_0x5ca19c?_0x3a262f[_0xcb85('0x1a')]:_0x54455d[_0xcb85('0x17')]+_0x54455d[_0xcb85('0x19')];var _0x16f3c8;if(_0x52ef0a>=_0xbacda6){_0x52ef0a=_0xbacda6;_0x16f3c8=0xc8;}else{_0x16f3c8=0xce;}_0x32966f[_0xcb85('0x15')](_0x16f3c8);return _0x32966f['set']('Content-Range',_0x54e9d8+'-'+_0x52ef0a+'/'+_0xbacda6)[_0xcb85('0x16')](_0x3a262f);}return null;};}function patchUpdates(_0x5a23ec){return function(_0x40c8a6){try{jsonpatch[_0xcb85('0x1b')](_0x40c8a6,_0x5a23ec,!![]);}catch(_0x11f3cf){return BPromise[_0xcb85('0x1c')](_0x11f3cf);}return _0x40c8a6[_0xcb85('0x1d')]();};}function saveUpdates(_0x181219,_0x5ee0b0){return function(_0x53d357){if(_0x53d357){return _0x53d357[_0xcb85('0x1e')](_0x181219)[_0xcb85('0x1f')](function(_0x5393e1){return _0x5393e1;});}return null;};}function removeEntity(_0x2f8014,_0x4fb5c5){return function(_0x28c488){if(_0x28c488){return _0x28c488[_0xcb85('0x20')]()[_0xcb85('0x1f')](function(){_0x2f8014[_0xcb85('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36e1a4,_0x1a6f11){return function(_0x2d5dc6){if(!_0x2d5dc6){_0x36e1a4[_0xcb85('0x21')](0x194);}return _0x2d5dc6;};}function handleError(_0x27b13,_0x3a14e4){_0x3a14e4=_0x3a14e4||0x1f4;return function(_0x42b045){logger['error'](_0x42b045[_0xcb85('0x22')]);if(_0x42b045['name']){delete _0x42b045[_0xcb85('0x23')];}_0x27b13['status'](_0x3a14e4)[_0xcb85('0x24')](_0x42b045);};}exports[_0xcb85('0x25')]=function(_0xbe9df3,_0x59c584){var _0x467a03={},_0x549ac7={},_0x429599={'count':0x0,'rows':[]};var _0x3e6218=_[_0xcb85('0x26')](db[_0xcb85('0x27')][_0xcb85('0x28')],function(_0x5c7c40){return{'name':_0x5c7c40[_0xcb85('0x29')],'type':_0x5c7c40[_0xcb85('0x2a')][_0xcb85('0x2b')]};});_0x549ac7[_0xcb85('0x2c')]=_[_0xcb85('0x26')](_0x3e6218,_0xcb85('0x23'));_0x549ac7[_0xcb85('0x2d')]=_[_0xcb85('0x2e')](_0xbe9df3[_0xcb85('0x2d')]);_0x549ac7[_0xcb85('0x2f')]=_['intersection'](_0x549ac7[_0xcb85('0x2c')],_0x549ac7[_0xcb85('0x2d')]);_0x467a03[_0xcb85('0x30')]=_['intersection'](_0x549ac7[_0xcb85('0x2c')],qs[_0xcb85('0x31')](_0xbe9df3[_0xcb85('0x2d')][_0xcb85('0x31')]));_0x467a03[_0xcb85('0x30')]=_0x467a03[_0xcb85('0x30')][_0xcb85('0x32')]?_0x467a03[_0xcb85('0x30')]:_0x549ac7['model'];if(!_0xbe9df3[_0xcb85('0x2d')][_0xcb85('0x33')]('nolimit')){_0x467a03[_0xcb85('0x19')]=qs[_0xcb85('0x19')](_0xbe9df3[_0xcb85('0x2d')][_0xcb85('0x19')]);_0x467a03['offset']=qs[_0xcb85('0x17')](_0xbe9df3['query']['offset']);}_0x467a03[_0xcb85('0x34')]=qs[_0xcb85('0x35')](_0xbe9df3[_0xcb85('0x2d')][_0xcb85('0x35')]);_0x467a03['where']=qs[_0xcb85('0x2f')](_['pick'](_0xbe9df3['query'],_0x549ac7['filters']),_0x3e6218);if(_0xbe9df3[_0xcb85('0x2d')][_0xcb85('0x36')]){_0x467a03[_0xcb85('0x37')]=_[_0xcb85('0x38')](_0x467a03[_0xcb85('0x37')],{'$or':_[_0xcb85('0x26')](_0x3e6218,function(_0x14c890){if(_0x14c890[_0xcb85('0x2a')]!==_0xcb85('0x39')){var _0x4c3b17={};_0x4c3b17[_0x14c890[_0xcb85('0x23')]]={'$like':'%'+_0xbe9df3[_0xcb85('0x2d')][_0xcb85('0x36')]+'%'};return _0x4c3b17;}})});}_0x467a03=_[_0xcb85('0x38')]({},_0x467a03,_0xbe9df3[_0xcb85('0x3a')]);var _0x277a12={'where':_0x467a03[_0xcb85('0x37')]};return db[_0xcb85('0x27')][_0xcb85('0x1a')](_0x277a12)['then'](function(_0x521e3c){_0x429599[_0xcb85('0x1a')]=_0x521e3c;if(_0xbe9df3[_0xcb85('0x2d')][_0xcb85('0x3b')]){_0x467a03[_0xcb85('0x3c')]=[{'all':!![]}];}return db['SalesforceField'][_0xcb85('0x3d')](_0x467a03);})[_0xcb85('0x1f')](function(_0x10d574){_0x429599[_0xcb85('0x3e')]=_0x10d574;return _0x429599;})[_0xcb85('0x1f')](respondWithFilteredResult(_0x59c584,_0x467a03))[_0xcb85('0x3f')](handleError(_0x59c584,null));};exports[_0xcb85('0x40')]=function(_0x53155c,_0xde35ea){var _0x228951={'raw':!![],'where':{'id':_0x53155c[_0xcb85('0x41')]['id']}},_0x5c607e={};_0x5c607e[_0xcb85('0x2c')]=_[_0xcb85('0x2e')](db[_0xcb85('0x27')][_0xcb85('0x28')]);_0x5c607e[_0xcb85('0x2d')]=_[_0xcb85('0x2e')](_0x53155c[_0xcb85('0x2d')]);_0x5c607e[_0xcb85('0x2f')]=_['intersection'](_0x5c607e[_0xcb85('0x2c')],_0x5c607e[_0xcb85('0x2d')]);_0x228951[_0xcb85('0x30')]=_[_0xcb85('0x42')](_0x5c607e['model'],qs[_0xcb85('0x31')](_0x53155c['query'][_0xcb85('0x31')]));_0x228951[_0xcb85('0x30')]=_0x228951[_0xcb85('0x30')][_0xcb85('0x32')]?_0x228951[_0xcb85('0x30')]:_0x5c607e['model'];if(_0x53155c[_0xcb85('0x2d')][_0xcb85('0x3b')]){_0x228951[_0xcb85('0x3c')]=[{'all':!![]}];}_0x228951=_['merge']({},_0x228951,_0x53155c[_0xcb85('0x3a')]);return db[_0xcb85('0x27')]['find'](_0x228951)['then'](handleEntityNotFound(_0xde35ea,null))[_0xcb85('0x1f')](respondWithResult(_0xde35ea,null))[_0xcb85('0x3f')](handleError(_0xde35ea,null));};exports[_0xcb85('0x43')]=function(_0x2573b6,_0xaa8f3){return db['SalesforceField']['create'](_0x2573b6['body'],{})[_0xcb85('0x1f')](respondWithResult(_0xaa8f3,0xc9))[_0xcb85('0x3f')](handleError(_0xaa8f3,null));};exports[_0xcb85('0x1e')]=function(_0x3c692c,_0x27284f){if(_0x3c692c[_0xcb85('0x44')]['id']){delete _0x3c692c['body']['id'];}return db[_0xcb85('0x27')][_0xcb85('0x45')]({'where':{'id':_0x3c692c[_0xcb85('0x41')]['id']}})[_0xcb85('0x1f')](handleEntityNotFound(_0x27284f,null))['then'](saveUpdates(_0x3c692c[_0xcb85('0x44')],null))['then'](respondWithResult(_0x27284f,null))[_0xcb85('0x3f')](handleError(_0x27284f,null));};exports[_0xcb85('0x20')]=function(_0x554296,_0x23a68d){return db['SalesforceField'][_0xcb85('0x45')]({'where':{'id':_0x554296[_0xcb85('0x41')]['id']}})['then'](handleEntityNotFound(_0x23a68d,null))[_0xcb85('0x1f')](removeEntity(_0x23a68d,null))[_0xcb85('0x3f')](handleError(_0x23a68d,null));}; \ No newline at end of file +var _0xa7dd=['squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','update','then','error','stack','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','where','pick','filter','VIRTUAL','include','findAll','show','params','length','merge','options','find','catch','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra'];(function(_0x5235dd,_0x3f91cf){var _0x13059d=function(_0x355a98){while(--_0x355a98){_0x5235dd['push'](_0x5235dd['shift']());}};_0x13059d(++_0x3f91cf);}(_0xa7dd,0x157));var _0xda7d=function(_0x54d6f4,_0x1ee463){_0x54d6f4=_0x54d6f4-0x0;var _0xb1489e=_0xa7dd[_0x54d6f4];return _0xb1489e;};'use strict';var emlformat=require(_0xda7d('0x0'));var rimraf=require(_0xda7d('0x1'));var zipdir=require(_0xda7d('0x2'));var jsonpatch=require(_0xda7d('0x3'));var rp=require(_0xda7d('0x4'));var moment=require(_0xda7d('0x5'));var BPromise=require(_0xda7d('0x6'));var Mustache=require('mustache');var util=require(_0xda7d('0x7'));var path=require(_0xda7d('0x8'));var sox=require('sox');var csv=require(_0xda7d('0x9'));var ejs=require(_0xda7d('0xa'));var fs=require('fs');var fs_extra=require(_0xda7d('0xb'));var _=require('lodash');var squel=require(_0xda7d('0xc'));var crypto=require('crypto');var jsforce=require(_0xda7d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xda7d('0x9'));var querystring=require(_0xda7d('0xe'));var Papa=require(_0xda7d('0xf'));var Redis=require(_0xda7d('0x10'));var authService=require(_0xda7d('0x11'));var qs=require(_0xda7d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xda7d('0x13'));var utils=require(_0xda7d('0x14'));var config=require(_0xda7d('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d5366,_0x5867b6){_0x5867b6=_0x5867b6||0xcc;return function(_0x2394b7){if(_0x2394b7){return _0x2d5366[_0xda7d('0x16')](_0x5867b6);}return _0x2d5366[_0xda7d('0x17')](_0x5867b6)[_0xda7d('0x18')]();};}function respondWithResult(_0x335ebc,_0x4fa96d){_0x4fa96d=_0x4fa96d||0xc8;return function(_0x779ad4){if(_0x779ad4){return _0x335ebc[_0xda7d('0x17')](_0x4fa96d)[_0xda7d('0x19')](_0x779ad4);}};}function respondWithFilteredResult(_0x3690a6,_0x2eb83b){return function(_0x36d4be){if(_0x36d4be){var _0xf788b6=typeof _0x2eb83b[_0xda7d('0x1a')]===_0xda7d('0x1b')&&typeof _0x2eb83b[_0xda7d('0x1c')]==='undefined';var _0x5dc3ff=_0x36d4be[_0xda7d('0x1d')];var _0xf693b0=_0xf788b6?0x0:_0x2eb83b[_0xda7d('0x1a')];var _0x3adaca=_0xf788b6?_0x36d4be[_0xda7d('0x1d')]:_0x2eb83b[_0xda7d('0x1a')]+_0x2eb83b[_0xda7d('0x1c')];var _0x48bf65;if(_0x3adaca>=_0x5dc3ff){_0x3adaca=_0x5dc3ff;_0x48bf65=0xc8;}else{_0x48bf65=0xce;}_0x3690a6[_0xda7d('0x17')](_0x48bf65);return _0x3690a6['set']('Content-Range',_0xf693b0+'-'+_0x3adaca+'/'+_0x5dc3ff)[_0xda7d('0x19')](_0x36d4be);}return null;};}function patchUpdates(_0x3d060f){return function(_0x4e3f51){try{jsonpatch[_0xda7d('0x1e')](_0x4e3f51,_0x3d060f,!![]);}catch(_0x377431){return BPromise[_0xda7d('0x1f')](_0x377431);}return _0x4e3f51['save']();};}function saveUpdates(_0x3692ae,_0x2f601b){return function(_0x354c7c){if(_0x354c7c){return _0x354c7c[_0xda7d('0x20')](_0x3692ae)['then'](function(_0x1e4bea){return _0x1e4bea;});}return null;};}function removeEntity(_0x3ac84f,_0x458d73){return function(_0x4c434f){if(_0x4c434f){return _0x4c434f['destroy']()[_0xda7d('0x21')](function(){_0x3ac84f[_0xda7d('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4eaae4,_0x138620){return function(_0x54ee8a){if(!_0x54ee8a){_0x4eaae4[_0xda7d('0x16')](0x194);}return _0x54ee8a;};}function handleError(_0x1df056,_0x1f803a){_0x1f803a=_0x1f803a||0x1f4;return function(_0x45c33e){logger[_0xda7d('0x22')](_0x45c33e[_0xda7d('0x23')]);if(_0x45c33e[_0xda7d('0x24')]){delete _0x45c33e[_0xda7d('0x24')];}_0x1df056[_0xda7d('0x17')](_0x1f803a)[_0xda7d('0x25')](_0x45c33e);};}exports[_0xda7d('0x26')]=function(_0x108322,_0x5a81be){var _0x538ba4={},_0x3db981={},_0x3d5748={'count':0x0,'rows':[]};var _0x269e02=_[_0xda7d('0x27')](db[_0xda7d('0x28')][_0xda7d('0x29')],function(_0x405cf0){return{'name':_0x405cf0[_0xda7d('0x2a')],'type':_0x405cf0[_0xda7d('0x2b')][_0xda7d('0x2c')]};});_0x3db981[_0xda7d('0x2d')]=_['map'](_0x269e02,_0xda7d('0x24'));_0x3db981[_0xda7d('0x2e')]=_[_0xda7d('0x2f')](_0x108322[_0xda7d('0x2e')]);_0x3db981[_0xda7d('0x30')]=_['intersection'](_0x3db981[_0xda7d('0x2d')],_0x3db981['query']);_0x538ba4[_0xda7d('0x31')]=_[_0xda7d('0x32')](_0x3db981['model'],qs[_0xda7d('0x33')](_0x108322['query'][_0xda7d('0x33')]));_0x538ba4[_0xda7d('0x31')]=_0x538ba4[_0xda7d('0x31')]['length']?_0x538ba4[_0xda7d('0x31')]:_0x3db981[_0xda7d('0x2d')];if(!_0x108322['query'][_0xda7d('0x34')](_0xda7d('0x35'))){_0x538ba4[_0xda7d('0x1c')]=qs['limit'](_0x108322[_0xda7d('0x2e')][_0xda7d('0x1c')]);_0x538ba4['offset']=qs['offset'](_0x108322[_0xda7d('0x2e')][_0xda7d('0x1a')]);}_0x538ba4[_0xda7d('0x36')]=qs['sort'](_0x108322[_0xda7d('0x2e')]['sort']);_0x538ba4[_0xda7d('0x37')]=qs[_0xda7d('0x30')](_[_0xda7d('0x38')](_0x108322[_0xda7d('0x2e')],_0x3db981[_0xda7d('0x30')]),_0x269e02);if(_0x108322['query'][_0xda7d('0x39')]){_0x538ba4['where']=_['merge'](_0x538ba4[_0xda7d('0x37')],{'$or':_[_0xda7d('0x27')](_0x269e02,function(_0x57db60){if(_0x57db60[_0xda7d('0x2b')]!==_0xda7d('0x3a')){var _0x37b288={};_0x37b288[_0x57db60[_0xda7d('0x24')]]={'$like':'%'+_0x108322[_0xda7d('0x2e')][_0xda7d('0x39')]+'%'};return _0x37b288;}})});}_0x538ba4=_['merge']({},_0x538ba4,_0x108322['options']);var _0x2f566c={'where':_0x538ba4['where']};return db[_0xda7d('0x28')][_0xda7d('0x1d')](_0x2f566c)[_0xda7d('0x21')](function(_0x502f1f){_0x3d5748[_0xda7d('0x1d')]=_0x502f1f;if(_0x108322['query']['includeAll']){_0x538ba4[_0xda7d('0x3b')]=[{'all':!![]}];}return db['SalesforceField'][_0xda7d('0x3c')](_0x538ba4);})[_0xda7d('0x21')](function(_0x3151b6){_0x3d5748['rows']=_0x3151b6;return _0x3d5748;})[_0xda7d('0x21')](respondWithFilteredResult(_0x5a81be,_0x538ba4))['catch'](handleError(_0x5a81be,null));};exports[_0xda7d('0x3d')]=function(_0xe760bc,_0x4bde0c){var _0x2c0557={'raw':!![],'where':{'id':_0xe760bc[_0xda7d('0x3e')]['id']}},_0x16fc6b={};_0x16fc6b[_0xda7d('0x2d')]=_[_0xda7d('0x2f')](db[_0xda7d('0x28')][_0xda7d('0x29')]);_0x16fc6b[_0xda7d('0x2e')]=_[_0xda7d('0x2f')](_0xe760bc[_0xda7d('0x2e')]);_0x16fc6b['filters']=_[_0xda7d('0x32')](_0x16fc6b[_0xda7d('0x2d')],_0x16fc6b['query']);_0x2c0557[_0xda7d('0x31')]=_['intersection'](_0x16fc6b[_0xda7d('0x2d')],qs['fields'](_0xe760bc[_0xda7d('0x2e')]['fields']));_0x2c0557[_0xda7d('0x31')]=_0x2c0557['attributes'][_0xda7d('0x3f')]?_0x2c0557[_0xda7d('0x31')]:_0x16fc6b[_0xda7d('0x2d')];if(_0xe760bc[_0xda7d('0x2e')]['includeAll']){_0x2c0557[_0xda7d('0x3b')]=[{'all':!![]}];}_0x2c0557=_[_0xda7d('0x40')]({},_0x2c0557,_0xe760bc[_0xda7d('0x41')]);return db[_0xda7d('0x28')][_0xda7d('0x42')](_0x2c0557)[_0xda7d('0x21')](handleEntityNotFound(_0x4bde0c,null))[_0xda7d('0x21')](respondWithResult(_0x4bde0c,null))[_0xda7d('0x43')](handleError(_0x4bde0c,null));};exports[_0xda7d('0x44')]=function(_0x5ca16e,_0x475b4c){return db['SalesforceField'][_0xda7d('0x44')](_0x5ca16e[_0xda7d('0x45')],{})[_0xda7d('0x21')](respondWithResult(_0x475b4c,0xc9))[_0xda7d('0x43')](handleError(_0x475b4c,null));};exports[_0xda7d('0x20')]=function(_0x5c0126,_0x28dacb){if(_0x5c0126[_0xda7d('0x45')]['id']){delete _0x5c0126[_0xda7d('0x45')]['id'];}return db[_0xda7d('0x28')][_0xda7d('0x42')]({'where':{'id':_0x5c0126['params']['id']}})[_0xda7d('0x21')](handleEntityNotFound(_0x28dacb,null))[_0xda7d('0x21')](saveUpdates(_0x5c0126['body'],null))['then'](respondWithResult(_0x28dacb,null))['catch'](handleError(_0x28dacb,null));};exports[_0xda7d('0x46')]=function(_0x478188,_0x26e837){return db[_0xda7d('0x28')][_0xda7d('0x42')]({'where':{'id':_0x478188[_0xda7d('0x3e')]['id']}})['then'](handleEntityNotFound(_0x26e837,null))[_0xda7d('0x21')](removeEntity(_0x26e837,null))[_0xda7d('0x43')](handleError(_0x26e837,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 900d3a5..27992a9 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 _0xcdef=['SalesforceField','int_salesforce_fields','salesforce_unique_index','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0xcdef,0x11b));var _0xfcde=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xcdef[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xfcde('0x0'));var util=require('util');var logger=require(_0xfcde('0x1'))(_0xfcde('0x2'));var moment=require(_0xfcde('0x3'));var BPromise=require(_0xfcde('0x4'));var rp=require(_0xfcde('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfcde('0x6'));var config=require('../../config/environment');var attributes=require('./intSalesforceField.attributes');module['exports']=function(_0x548b5a,_0x4cf982){return _0x548b5a['define'](_0xfcde('0x7'),attributes,{'tableName':_0xfcde('0x8'),'paranoid':![],'indexes':[{'name':_0xfcde('0x9'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe8f5=['moment','bluebird','request-promise','path','../../config/environment','./intSalesforceField.attributes','exports','SalesforceField','idField','FieldId','lodash','util','../../config/logger','api'];(function(_0x130ceb,_0x587407){var _0x6fee25=function(_0x1fb28c){while(--_0x1fb28c){_0x130ceb['push'](_0x130ceb['shift']());}};_0x6fee25(++_0x587407);}(_0xe8f5,0x6c));var _0x5e8f=function(_0x26d453,_0x316f50){_0x26d453=_0x26d453-0x0;var _0x42aaa1=_0xe8f5[_0x26d453];return _0x42aaa1;};'use strict';var _=require(_0x5e8f('0x0'));var util=require(_0x5e8f('0x1'));var logger=require(_0x5e8f('0x2'))(_0x5e8f('0x3'));var moment=require(_0x5e8f('0x4'));var BPromise=require(_0x5e8f('0x5'));var rp=require(_0x5e8f('0x6'));var fs=require('fs');var path=require(_0x5e8f('0x7'));var rimraf=require('rimraf');var config=require(_0x5e8f('0x8'));var attributes=require(_0x5e8f('0x9'));module[_0x5e8f('0xa')]=function(_0x47f3a6,_0x4719ad){return _0x47f3a6['define'](_0x5e8f('0xb'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x5e8f('0xc'),_0x5e8f('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 69c01d0..6fa3f44 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 _0x9f35=['bluebird','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceField,\x20%s,\x20%s','message','result','catch','lodash','util','moment'];(function(_0x3f540f,_0x53006f){var _0xfc95a6=function(_0xeca93){while(--_0xeca93){_0x3f540f['push'](_0x3f540f['shift']());}};_0xfc95a6(++_0x53006f);}(_0x9f35,0x18c));var _0x59f3=function(_0x22b826,_0x5e4207){_0x22b826=_0x22b826-0x0;var _0x2d863e=_0x9f35[_0x22b826];return _0x2d863e;};'use strict';var _=require(_0x59f3('0x0'));var util=require(_0x59f3('0x1'));var moment=require(_0x59f3('0x2'));var BPromise=require(_0x59f3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x59f3('0x4'));var logger=require(_0x59f3('0x5'))(_0x59f3('0x6'));var config=require('../../config/environment');var jayson=require(_0x59f3('0x7'));var client=jayson[_0x59f3('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3fb590,_0x546d2b,_0x261cd5){return new BPromise(function(_0x1eedb6,_0x1d1b1d){return client[_0x59f3('0x9')](_0x3fb590,_0x261cd5)[_0x59f3('0xa')](function(_0x1a6c16){logger[_0x59f3('0xb')]('SalesforceField,\x20%s,\x20%s',_0x546d2b,'request\x20sent');logger[_0x59f3('0xc')](_0x59f3('0xd'),_0x546d2b,'request\x20sent',JSON[_0x59f3('0xe')](_0x1a6c16));if(_0x1a6c16[_0x59f3('0xf')]){if(_0x1a6c16[_0x59f3('0xf')][_0x59f3('0x10')]===0x1f4){logger[_0x59f3('0xf')](_0x59f3('0x11'),_0x546d2b,_0x1a6c16['error'][_0x59f3('0x12')]);return _0x1d1b1d(_0x1a6c16['error']['message']);}logger[_0x59f3('0xf')](_0x59f3('0x11'),_0x546d2b,_0x1a6c16[_0x59f3('0xf')][_0x59f3('0x12')]);return _0x1eedb6(_0x1a6c16[_0x59f3('0xf')]['message']);}else{logger[_0x59f3('0xb')](_0x59f3('0x11'),_0x546d2b,'request\x20sent');_0x1eedb6(_0x1a6c16[_0x59f3('0x13')][_0x59f3('0x12')]);}})[_0x59f3('0x14')](function(_0x43c79f){logger[_0x59f3('0xf')](_0x59f3('0x11'),_0x546d2b,_0x43c79f);_0x1d1b1d(_0x43c79f);});});} \ No newline at end of file +var _0x8778=['../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','info','SalesforceField,\x20%s,\x20%s','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','moment','bluebird'];(function(_0x2b9a71,_0x39e387){var _0x1320bb=function(_0x25e0c1){while(--_0x25e0c1){_0x2b9a71['push'](_0x2b9a71['shift']());}};_0x1320bb(++_0x39e387);}(_0x8778,0x162));var _0x8877=function(_0x1f8539,_0x9178b){_0x1f8539=_0x1f8539-0x0;var _0x375d4e=_0x8778[_0x1f8539];return _0x375d4e;};'use strict';var _=require(_0x8877('0x0'));var util=require('util');var moment=require(_0x8877('0x1'));var BPromise=require(_0x8877('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8877('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x8877('0x4'))(_0x8877('0x5'));var config=require(_0x8877('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x8877('0x7')][_0x8877('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x51ae98,_0x235df7,_0x302e8c){return new BPromise(function(_0x36aca6,_0x50e16c){return client[_0x8877('0x9')](_0x51ae98,_0x302e8c)['then'](function(_0x3df356){logger[_0x8877('0xa')](_0x8877('0xb'),_0x235df7,'request\x20sent');logger[_0x8877('0xc')](_0x8877('0xd'),_0x235df7,'request\x20sent',JSON[_0x8877('0xe')](_0x3df356));if(_0x3df356[_0x8877('0xf')]){if(_0x3df356[_0x8877('0xf')][_0x8877('0x10')]===0x1f4){logger[_0x8877('0xf')]('SalesforceField,\x20%s,\x20%s',_0x235df7,_0x3df356[_0x8877('0xf')][_0x8877('0x11')]);return _0x50e16c(_0x3df356[_0x8877('0xf')][_0x8877('0x11')]);}logger[_0x8877('0xf')](_0x8877('0xb'),_0x235df7,_0x3df356['error'][_0x8877('0x11')]);return _0x36aca6(_0x3df356[_0x8877('0xf')][_0x8877('0x11')]);}else{logger[_0x8877('0xa')](_0x8877('0xb'),_0x235df7,_0x8877('0x12'));_0x36aca6(_0x3df356[_0x8877('0x13')][_0x8877('0x11')]);}})[_0x8877('0x14')](function(_0x4b09b5){logger['error'](_0x8877('0xb'),_0x235df7,_0x4b09b5);_0x50e16c(_0x4b09b5);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index accd6dc..daa279d 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 _0xd138=['get','getFields','post','put','update','delete','destroy','exports','multer','util','path','fs-extra','../../config/environment','/:id','isAuthenticated','show','/:id/configurations','getConfigurations'];(function(_0x1f146c,_0xfb86d6){var _0x2354fb=function(_0x2078d0){while(--_0x2078d0){_0x1f146c['push'](_0x1f146c['shift']());}};_0x2354fb(++_0xfb86d6);}(_0xd138,0x1dc));var _0x8d13=function(_0x4b627a,_0x390c28){_0x4b627a=_0x4b627a-0x0;var _0x2fe234=_0xd138[_0x4b627a];return _0x2fe234;};'use strict';var multer=require(_0x8d13('0x0'));var util=require(_0x8d13('0x1'));var path=require(_0x8d13('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x8d13('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8d13('0x4'));var controller=require('./intServicenowAccount.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x8d13('0x5'),auth[_0x8d13('0x6')](),controller[_0x8d13('0x7')]);router['get'](_0x8d13('0x8'),auth['isAuthenticated'](),controller[_0x8d13('0x9')]);router[_0x8d13('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0x8d13('0xb')]);router[_0x8d13('0xc')]('/',auth[_0x8d13('0x6')](),controller['create']);router[_0x8d13('0xc')](_0x8d13('0x8'),auth[_0x8d13('0x6')](),controller['addConfiguration']);router[_0x8d13('0xd')](_0x8d13('0x5'),auth[_0x8d13('0x6')](),controller[_0x8d13('0xe')]);router[_0x8d13('0xf')](_0x8d13('0x5'),auth[_0x8d13('0x6')](),controller[_0x8d13('0x10')]);module[_0x8d13('0x11')]=router; \ No newline at end of file +var _0x5a68=['get','show','/:id/configurations','getConfigurations','/:id/fields','post','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','isAuthenticated','index'];(function(_0x1246af,_0x477bc9){var _0x5d9762=function(_0x259c6c){while(--_0x259c6c){_0x1246af['push'](_0x1246af['shift']());}};_0x5d9762(++_0x477bc9);}(_0x5a68,0x1ae));var _0x85a6=function(_0x279027,_0x465dbe){_0x279027=_0x279027-0x0;var _0x154355=_0x5a68[_0x279027];return _0x154355;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85a6('0x0'));var timeout=require(_0x85a6('0x1'));var express=require(_0x85a6('0x2'));var router=express[_0x85a6('0x3')]();var fs_extra=require(_0x85a6('0x4'));var auth=require(_0x85a6('0x5'));var interaction=require(_0x85a6('0x6'));var config=require(_0x85a6('0x7'));var controller=require(_0x85a6('0x8'));router['get']('/',auth[_0x85a6('0x9')](),controller[_0x85a6('0xa')]);router[_0x85a6('0xb')]('/:id',auth[_0x85a6('0x9')](),controller[_0x85a6('0xc')]);router[_0x85a6('0xb')](_0x85a6('0xd'),auth[_0x85a6('0x9')](),controller[_0x85a6('0xe')]);router[_0x85a6('0xb')](_0x85a6('0xf'),auth[_0x85a6('0x9')](),controller['getFields']);router[_0x85a6('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x85a6('0xd'),auth['isAuthenticated'](),controller['addConfiguration']);router['put']('/:id',auth[_0x85a6('0x9')](),controller[_0x85a6('0x11')]);router[_0x85a6('0x12')]('/:id',auth[_0x85a6('0x9')](),controller[_0x85a6('0x13')]);module[_0x85a6('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 1868e6e..0b8224d 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 _0xadb7=['remoteUri','sequelize','exports','STRING','username'];(function(_0x1ef746,_0x57effb){var _0x2ea2a5=function(_0x508c40){while(--_0x508c40){_0x1ef746['push'](_0x1ef746['shift']());}};_0x2ea2a5(++_0x57effb);}(_0xadb7,0x1b9));var _0x7adb=function(_0x4ac370,_0x190fba){_0x4ac370=_0x4ac370-0x0;var _0x5824f8=_0xadb7[_0x4ac370];return _0x5824f8;};'use strict';var Sequelize=require(_0x7adb('0x0'));module[_0x7adb('0x1')]={'name':{'type':Sequelize[_0x7adb('0x2')]},'description':{'type':Sequelize[_0x7adb('0x2')]},'username':{'type':Sequelize[_0x7adb('0x2')],'unique':_0x7adb('0x3')},'password':{'type':Sequelize[_0x7adb('0x2')]},'email':{'type':Sequelize[_0x7adb('0x2')]},'remoteUri':{'type':Sequelize[_0x7adb('0x2')],'unique':_0x7adb('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x2413=['sequelize','exports','STRING','username','remoteUri'];(function(_0x157abe,_0x59c772){var _0x1a46f5=function(_0x4d7d3d){while(--_0x4d7d3d){_0x157abe['push'](_0x157abe['shift']());}};_0x1a46f5(++_0x59c772);}(_0x2413,0xe1));var _0x3241=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x2413[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x3241('0x0'));module[_0x3241('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3241('0x2')]},'username':{'type':Sequelize[_0x3241('0x2')],'unique':_0x3241('0x3')},'password':{'type':Sequelize[_0x3241('0x2')]},'email':{'type':Sequelize[_0x3241('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x3241('0x4')},'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 5b85b12..fb11a85 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 _0xc43c=['sys_updated_by','opened_by','user_input','sys_created_on','state','sys_created_by','calendar_stc','cmdb_ci','impact','active','work_notes_list','business_service','priority','rfc','time_worked','expected_start','group_list','work_end','resolved_at','caller_id','approval_set','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','company','reassignment_count','activity_due','assigned_to','approval','comments_and_work_notes','due_date','reopen_count','sys_tags','escalation','upon_approval','username','remoteUri','lastIndexOf','format','%s/api/now/table/','password','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','push','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','test','statusCode','error','False','sys_choice?sysparm_query=name=incident^element=','inactive','false','value','eml-format','zip-dir','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','json','apply','reject','save','destroy','then','stack','name','send','index','map','ServicenowAccount','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','length','find','create','body','update','params','getConfigurations','findOne','ServicenowConfiguration','sort','pick','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','hold_reason','knowledge','subcategory','close_code','notify','incident_state','severity','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','resolved_by'];(function(_0x28d8c7,_0x585fe6){var _0x379e68=function(_0x406f22){while(--_0x406f22){_0x28d8c7['push'](_0x28d8c7['shift']());}};_0x379e68(++_0x585fe6);}(_0xc43c,0x1ab));var _0xcc43=function(_0x19e00d,_0x183dbc){_0x19e00d=_0x19e00d-0x0;var _0x1ed889=_0xc43c[_0x19e00d];return _0x1ed889;};'use strict';var emlformat=require(_0xcc43('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcc43('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcc43('0x2'));var moment=require(_0xcc43('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xcc43('0x4'));var util=require(_0xcc43('0x5'));var path=require(_0xcc43('0x6'));var sox=require('sox');var csv=require(_0xcc43('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcc43('0x8'));var _=require(_0xcc43('0x9'));var squel=require(_0xcc43('0xa'));var crypto=require(_0xcc43('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xcc43('0xc'));var Papa=require(_0xcc43('0xd'));var Redis=require(_0xcc43('0xe'));var authService=require(_0xcc43('0xf'));var qs=require(_0xcc43('0x10'));var as=require(_0xcc43('0x11'));var hardwareService=require(_0xcc43('0x12'));var logger=require(_0xcc43('0x13'))('api');var utils=require(_0xcc43('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xcc43('0x15'));var db=require(_0xcc43('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5b0947,_0x4830f3){_0x4830f3=_0x4830f3||0xcc;return function(_0x3656bb){if(_0x3656bb){return _0x5b0947['sendStatus'](_0x4830f3);}return _0x5b0947[_0xcc43('0x17')](_0x4830f3)[_0xcc43('0x18')]();};}function respondWithResult(_0xcd22d9,_0x527fbe){_0x527fbe=_0x527fbe||0xc8;return function(_0x44b5e8){if(_0x44b5e8){return _0xcd22d9['status'](_0x527fbe)['json'](_0x44b5e8);}};}function respondWithFilteredResult(_0x1bbecd,_0x22e4b8){return function(_0x5386b1){if(_0x5386b1){var _0x25be6d=typeof _0x22e4b8[_0xcc43('0x19')]===_0xcc43('0x1a')&&typeof _0x22e4b8[_0xcc43('0x1b')]==='undefined';var _0x1b2a2a=_0x5386b1[_0xcc43('0x1c')];var _0x282774=_0x25be6d?0x0:_0x22e4b8[_0xcc43('0x19')];var _0x53a601=_0x25be6d?_0x5386b1[_0xcc43('0x1c')]:_0x22e4b8[_0xcc43('0x19')]+_0x22e4b8[_0xcc43('0x1b')];var _0x3dba29;if(_0x53a601>=_0x1b2a2a){_0x53a601=_0x1b2a2a;_0x3dba29=0xc8;}else{_0x3dba29=0xce;}_0x1bbecd[_0xcc43('0x17')](_0x3dba29);return _0x1bbecd[_0xcc43('0x1d')]('Content-Range',_0x282774+'-'+_0x53a601+'/'+_0x1b2a2a)[_0xcc43('0x1e')](_0x5386b1);}return null;};}function patchUpdates(_0x11689f){return function(_0x27f9ad){try{jsonpatch[_0xcc43('0x1f')](_0x27f9ad,_0x11689f,!![]);}catch(_0x50b923){return BPromise[_0xcc43('0x20')](_0x50b923);}return _0x27f9ad[_0xcc43('0x21')]();};}function saveUpdates(_0x187419,_0x2f5dea){return function(_0x428b86){if(_0x428b86){return _0x428b86['update'](_0x187419)['then'](function(_0x1cb1fe){return _0x1cb1fe;});}return null;};}function removeEntity(_0x55dfdb,_0x237bb3){return function(_0x2218fe){if(_0x2218fe){return _0x2218fe[_0xcc43('0x22')]()[_0xcc43('0x23')](function(){_0x55dfdb[_0xcc43('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b0163,_0x4d43f8){return function(_0x1923d7){if(!_0x1923d7){_0x4b0163['sendStatus'](0x194);}return _0x1923d7;};}function handleError(_0x555528,_0x114dcf){_0x114dcf=_0x114dcf||0x1f4;return function(_0x81e57e){logger['error'](_0x81e57e[_0xcc43('0x24')]);if(_0x81e57e[_0xcc43('0x25')]){delete _0x81e57e['name'];}_0x555528[_0xcc43('0x17')](_0x114dcf)[_0xcc43('0x26')](_0x81e57e);};}exports[_0xcc43('0x27')]=function(_0x2bf7f0,_0x15d8ff){var _0x5c518a={},_0x31774c={},_0x29decd={'count':0x0,'rows':[]};var _0x8e6286=_[_0xcc43('0x28')](db[_0xcc43('0x29')][_0xcc43('0x2a')],function(_0x5142ea){return{'name':_0x5142ea['fieldName'],'type':_0x5142ea[_0xcc43('0x2b')][_0xcc43('0x2c')]};});_0x31774c[_0xcc43('0x2d')]=_['map'](_0x8e6286,'name');_0x31774c[_0xcc43('0x2e')]=_[_0xcc43('0x2f')](_0x2bf7f0[_0xcc43('0x2e')]);_0x31774c[_0xcc43('0x30')]=_[_0xcc43('0x31')](_0x31774c[_0xcc43('0x2d')],_0x31774c[_0xcc43('0x2e')]);_0x5c518a[_0xcc43('0x32')]=_[_0xcc43('0x31')](_0x31774c['model'],qs[_0xcc43('0x33')](_0x2bf7f0[_0xcc43('0x2e')][_0xcc43('0x33')]));_0x5c518a[_0xcc43('0x32')]=_0x5c518a[_0xcc43('0x32')]['length']?_0x5c518a['attributes']:_0x31774c[_0xcc43('0x2d')];if(!_0x2bf7f0[_0xcc43('0x2e')][_0xcc43('0x34')](_0xcc43('0x35'))){_0x5c518a[_0xcc43('0x1b')]=qs[_0xcc43('0x1b')](_0x2bf7f0[_0xcc43('0x2e')][_0xcc43('0x1b')]);_0x5c518a[_0xcc43('0x19')]=qs[_0xcc43('0x19')](_0x2bf7f0[_0xcc43('0x2e')][_0xcc43('0x19')]);}_0x5c518a[_0xcc43('0x36')]=qs['sort'](_0x2bf7f0['query']['sort']);_0x5c518a['where']=qs[_0xcc43('0x30')](_['pick'](_0x2bf7f0[_0xcc43('0x2e')],_0x31774c[_0xcc43('0x30')]),_0x8e6286);if(_0x2bf7f0[_0xcc43('0x2e')][_0xcc43('0x37')]){_0x5c518a['where']=_['merge'](_0x5c518a[_0xcc43('0x38')],{'$or':_[_0xcc43('0x28')](_0x8e6286,function(_0x5a5fcb){if(_0x5a5fcb[_0xcc43('0x2b')]!==_0xcc43('0x39')){var _0xd59c2b={};_0xd59c2b[_0x5a5fcb['name']]={'$like':'%'+_0x2bf7f0[_0xcc43('0x2e')]['filter']+'%'};return _0xd59c2b;}})});}_0x5c518a=_[_0xcc43('0x3a')]({},_0x5c518a,_0x2bf7f0[_0xcc43('0x3b')]);var _0x41f742={'where':_0x5c518a[_0xcc43('0x38')]};return db[_0xcc43('0x29')][_0xcc43('0x1c')](_0x41f742)['then'](function(_0x368111){_0x29decd[_0xcc43('0x1c')]=_0x368111;if(_0x2bf7f0[_0xcc43('0x2e')][_0xcc43('0x3c')]){_0x5c518a[_0xcc43('0x3d')]=[{'all':!![]}];}return db[_0xcc43('0x29')][_0xcc43('0x3e')](_0x5c518a);})[_0xcc43('0x23')](function(_0x495f6a){_0x29decd[_0xcc43('0x3f')]=_0x495f6a;return _0x29decd;})['then'](respondWithFilteredResult(_0x15d8ff,_0x5c518a))[_0xcc43('0x40')](handleError(_0x15d8ff,null));};exports[_0xcc43('0x41')]=function(_0x341fdb,_0x4f95de){var _0x5c6b6={'raw':![],'where':{'id':_0x341fdb['params']['id']}},_0x9397f8={};_0x9397f8[_0xcc43('0x2d')]=_[_0xcc43('0x2f')](db[_0xcc43('0x29')][_0xcc43('0x2a')]);_0x9397f8[_0xcc43('0x2e')]=_[_0xcc43('0x2f')](_0x341fdb[_0xcc43('0x2e')]);_0x9397f8['filters']=_[_0xcc43('0x31')](_0x9397f8[_0xcc43('0x2d')],_0x9397f8['query']);_0x5c6b6[_0xcc43('0x32')]=_['intersection'](_0x9397f8[_0xcc43('0x2d')],qs[_0xcc43('0x33')](_0x341fdb[_0xcc43('0x2e')][_0xcc43('0x33')]));_0x5c6b6[_0xcc43('0x32')]=_0x5c6b6['attributes'][_0xcc43('0x42')]?_0x5c6b6[_0xcc43('0x32')]:_0x9397f8[_0xcc43('0x2d')];if(_0x341fdb[_0xcc43('0x2e')][_0xcc43('0x3c')]){_0x5c6b6[_0xcc43('0x3d')]=[{'all':!![]}];}_0x5c6b6=_[_0xcc43('0x3a')]({},_0x5c6b6,_0x341fdb[_0xcc43('0x3b')]);return db['ServicenowAccount'][_0xcc43('0x43')](_0x5c6b6)[_0xcc43('0x23')](handleEntityNotFound(_0x4f95de,null))[_0xcc43('0x23')](respondWithResult(_0x4f95de,null))[_0xcc43('0x40')](handleError(_0x4f95de,null));};exports[_0xcc43('0x44')]=function(_0x325f36,_0x6293ca){return db[_0xcc43('0x29')]['create'](_0x325f36[_0xcc43('0x45')],{})['then'](respondWithResult(_0x6293ca,0xc9))[_0xcc43('0x40')](handleError(_0x6293ca,null));};exports[_0xcc43('0x46')]=function(_0x841648,_0x3fc409){if(_0x841648[_0xcc43('0x45')]['id']){delete _0x841648[_0xcc43('0x45')]['id'];}return db[_0xcc43('0x29')][_0xcc43('0x43')]({'where':{'id':_0x841648[_0xcc43('0x47')]['id']}})['then'](handleEntityNotFound(_0x3fc409,null))[_0xcc43('0x23')](saveUpdates(_0x841648[_0xcc43('0x45')],null))[_0xcc43('0x23')](respondWithResult(_0x3fc409,null))[_0xcc43('0x40')](handleError(_0x3fc409,null));};exports[_0xcc43('0x22')]=function(_0x561efa,_0x55a1e0){return db[_0xcc43('0x29')]['find']({'where':{'id':_0x561efa[_0xcc43('0x47')]['id']}})[_0xcc43('0x23')](handleEntityNotFound(_0x55a1e0,null))['then'](removeEntity(_0x55a1e0,null))['catch'](handleError(_0x55a1e0,null));};exports[_0xcc43('0x48')]=function(_0x635e5d,_0x1c904,_0x19e730){var _0x1967dc={};var _0x20ed4a={};var _0x1abb03;var _0x3f35dd;return db[_0xcc43('0x29')][_0xcc43('0x49')]({'where':{'id':_0x635e5d[_0xcc43('0x47')]['id']}})['then'](handleEntityNotFound(_0x1c904,null))[_0xcc43('0x23')](function(_0x3afe6a){if(_0x3afe6a){_0x1abb03=_0x3afe6a;_0x20ed4a[_0xcc43('0x2d')]=_[_0xcc43('0x2f')](db[_0xcc43('0x4a')][_0xcc43('0x2a')]);_0x20ed4a[_0xcc43('0x2e')]=_[_0xcc43('0x2f')](_0x635e5d[_0xcc43('0x2e')]);_0x20ed4a['filters']=_['intersection'](_0x20ed4a['model'],_0x20ed4a[_0xcc43('0x2e')]);_0x1967dc[_0xcc43('0x32')]=_['intersection'](_0x20ed4a[_0xcc43('0x2d')],qs[_0xcc43('0x33')](_0x635e5d[_0xcc43('0x2e')][_0xcc43('0x33')]));_0x1967dc[_0xcc43('0x32')]=_0x1967dc['attributes'][_0xcc43('0x42')]?_0x1967dc['attributes']:_0x20ed4a[_0xcc43('0x2d')];_0x1967dc[_0xcc43('0x36')]=qs[_0xcc43('0x4b')](_0x635e5d['query'][_0xcc43('0x4b')]);_0x1967dc[_0xcc43('0x38')]=qs[_0xcc43('0x30')](_[_0xcc43('0x4c')](_0x635e5d[_0xcc43('0x2e')],_0x20ed4a[_0xcc43('0x30')]));if(_0x635e5d['query'][_0xcc43('0x37')]){_0x1967dc[_0xcc43('0x38')]=_[_0xcc43('0x3a')](_0x1967dc['where'],{'$or':_['map'](_0x1967dc[_0xcc43('0x32')],function(_0x509fd5){var _0x1ebd13={};_0x1ebd13[_0x509fd5]={'$like':'%'+_0x635e5d[_0xcc43('0x2e')][_0xcc43('0x37')]+'%'};return _0x1ebd13;})});}_0x1967dc=_[_0xcc43('0x3a')]({},_0x1967dc,_0x635e5d[_0xcc43('0x3b')]);return _0x1abb03[_0xcc43('0x48')](_0x1967dc);}})[_0xcc43('0x23')](function(_0x3f08b6){if(_0x3f08b6){_0x3f35dd=_0x3f08b6['length'];if(!_0x635e5d[_0xcc43('0x2e')][_0xcc43('0x34')](_0xcc43('0x35'))){_0x1967dc[_0xcc43('0x1b')]=qs[_0xcc43('0x1b')](_0x635e5d[_0xcc43('0x2e')]['limit']);_0x1967dc['offset']=qs[_0xcc43('0x19')](_0x635e5d[_0xcc43('0x2e')][_0xcc43('0x19')]);}return _0x1abb03[_0xcc43('0x48')](_0x1967dc);}})[_0xcc43('0x23')](function(_0x75fb82){if(_0x75fb82){return _0x75fb82?{'count':_0x3f35dd,'rows':_0x75fb82}:null;}})[_0xcc43('0x23')](respondWithResult(_0x1c904,null))[_0xcc43('0x40')](handleError(_0x1c904,null));};exports['addConfiguration']=function(_0x45a577,_0x2099a2,_0x31eedf){if(_0x45a577[_0xcc43('0x45')]['id']){delete _0x45a577[_0xcc43('0x45')]['id'];}return db['ServicenowAccount'][_0xcc43('0x49')]({'where':{'id':_0x45a577[_0xcc43('0x47')]['id']}})[_0xcc43('0x23')](handleEntityNotFound(_0x2099a2,null))['then'](function(_0x2c2ba9){if(_0x2c2ba9){_0x45a577['body'][_0xcc43('0x4d')]=_0x2c2ba9['id'];_0x45a577[_0xcc43('0x45')][_0xcc43('0x4e')]=integrations[_0xcc43('0x4f')](_0x45a577[_0xcc43('0x45')][_0xcc43('0x50')],_0x45a577[_0xcc43('0x45')][_0xcc43('0x2b')]);_0x45a577[_0xcc43('0x45')][_0xcc43('0x51')]=integrations[_0xcc43('0x52')](_0x45a577['body'][_0xcc43('0x50')],_0x45a577[_0xcc43('0x45')][_0xcc43('0x2b')]);return db[_0xcc43('0x4a')][_0xcc43('0x44')](_0x45a577[_0xcc43('0x45')],{'include':[{'model':db[_0xcc43('0x53')],'as':_0xcc43('0x4e')},{'model':db['ServicenowField'],'as':_0xcc43('0x51')}]});}return null;})['then'](respondWithResult(_0x2099a2,null))['catch'](handleError(_0x2099a2,null));};exports[_0xcc43('0x54')]=function(_0x3073f7,_0x491c15,_0x50785c){var _0x3a0023=['made_sla',_0xcc43('0x55'),_0xcc43('0x56'),_0xcc43('0x57'),_0xcc43('0x58'),_0xcc43('0x59'),_0xcc43('0x5a'),_0xcc43('0x5b'),_0xcc43('0x5c')];var _0x168e72=[_0xcc43('0x5d'),'made_sla',_0xcc43('0x5e'),_0xcc43('0x5f'),_0xcc43('0x60'),_0xcc43('0x61'),_0xcc43('0x62'),'hold_reason',_0xcc43('0x63'),'number',_0xcc43('0x64'),_0xcc43('0x65'),_0xcc43('0x66'),_0xcc43('0x67'),_0xcc43('0x68'),'sys_domain',_0xcc43('0x69'),_0xcc43('0x6a'),_0xcc43('0x56'),_0xcc43('0x36'),_0xcc43('0x6b'),'closed_at',_0xcc43('0x6c'),'delivery_plan',_0xcc43('0x6d'),_0xcc43('0x6e'),_0xcc43('0x6f'),_0xcc43('0x70'),_0xcc43('0x71'),'sys_domain_path',_0xcc43('0x72'),_0xcc43('0x73'),_0xcc43('0x74'),'opened_at','business_duration',_0xcc43('0x75'),_0xcc43('0x76'),'reopened_time',_0xcc43('0x77'),_0xcc43('0x78'),_0xcc43('0x79'),'subcategory','work_notes','short_description',_0xcc43('0x58'),_0xcc43('0x7a'),_0xcc43('0x7b'),_0xcc43('0x7c'),_0xcc43('0x7d'),_0xcc43('0x7e'),_0xcc43('0x7f'),_0xcc43('0x80'),'calendar_duration',_0xcc43('0x59'),'sys_class_name',_0xcc43('0x81'),_0xcc43('0x82'),_0xcc43('0x83'),_0xcc43('0x84'),_0xcc43('0x85'),_0xcc43('0x86'),_0xcc43('0x87'),'incident_state',_0xcc43('0x88'),'problem_id',_0xcc43('0x89'),_0xcc43('0x8a'),_0xcc43('0x8b'),_0xcc43('0x8c'),_0xcc43('0x5b'),'comments','sla_due',_0xcc43('0x8d'),_0xcc43('0x8e'),_0xcc43('0x8f'),'sys_mod_count',_0xcc43('0x90'),_0xcc43('0x91'),_0xcc43('0x92'),_0xcc43('0x93'),'correlation_id','location','category'];var _0x28a9f6='';var _0x3d68ec='';var _0x3a9d91=[];var _0x2e9e12='';var _0x55779b='';var _0x4b476d=[];var _0x556ef1='';var _0x2a521a='';var _0x442d23={};var _0x5175fb='';return db['ServicenowAccount'][_0xcc43('0x49')]({'where':{'id':_0x3073f7[_0xcc43('0x47')]['id']},'attributes':['id',_0xcc43('0x94'),'password','email',_0xcc43('0x95'),'serverUrl']})[_0xcc43('0x23')](handleEntityNotFound(_0x491c15,null))[_0xcc43('0x23')](function(_0x2cc111){if(_0x2cc111){_0x5175fb=_0x2cc111[_0xcc43('0x95')];var _0x3a8d9a=_0x5175fb['slice'](-0x1);if(_0x3a8d9a==='/'){_0x5175fb=_0x5175fb['substring'](0x0,_0x5175fb[_0xcc43('0x96')](_0x3a8d9a));}_0x2a521a=util[_0xcc43('0x97')]('%s/api/now/doc/table/schema/',_0x5175fb);_0x556ef1=util['format'](_0xcc43('0x98'),_0x5175fb);_0x442d23={'user':_0x2cc111[_0xcc43('0x94')],'pass':_0x2cc111[_0xcc43('0x99')]};var _0x4ace63={'method':_0xcc43('0x9a'),'uri':_0x2a521a+_0xcc43('0x9b'),'auth':_0x442d23,'json':!![]};return rp(_0x4ace63);}})[_0xcc43('0x23')](function(_0x357dfb){if(_0x357dfb[_0xcc43('0x9c')][_0xcc43('0x42')]>0x0){_0x28a9f6=_0x357dfb[_0xcc43('0x9c')];}console[_0xcc43('0x9d')](_0xcc43('0x9e'),_0x28a9f6);_0x4b476d=[];_0x3d68ec=Object[_0xcc43('0x9f')]([],_0x28a9f6);_[_0xcc43('0xa0')](_0x3d68ec,function(_0x1b01cc){return!_0x3a0023[_0xcc43('0xa1')](_0x1b01cc[_0xcc43('0x25')]);});_0x3d68ec[_0xcc43('0xa2')](function(_0x641088){var _0x153d2a=createFieldObject(_0x556ef1,_0x442d23,_0x641088[_0xcc43('0xa3')],_0x641088[_0xcc43('0x25')],_0x641088[_0xcc43('0xa4')],![]);_0x4b476d[_0xcc43('0xa5')](_0x153d2a);});return Promise['all'](_0x4b476d);})[_0xcc43('0x23')](function(_0x4e2b3e){_0x3a9d91=_0x4e2b3e;_0x2e9e12=Object[_0xcc43('0x9f')]([],_0x28a9f6);console['log']('TCL:\x20_object',_0x28a9f6);_[_0xcc43('0xa0')](_0x2e9e12,function(_0x2084a1){return _0x168e72[_0xcc43('0xa1')](_0x2084a1[_0xcc43('0x25')]);});console[_0xcc43('0x9d')](_0xcc43('0xa6'),_0x2e9e12);_0x4b476d=[];_0x2e9e12['forEach'](function(_0x5f17ec){var _0x29e6aa=createFieldObject(_0x556ef1,_0x442d23,_0x5f17ec[_0xcc43('0xa3')],_0x5f17ec[_0xcc43('0x25')],_0x5f17ec[_0xcc43('0xa4')],!![]);_0x4b476d[_0xcc43('0xa5')](_0x29e6aa);});return Promise['all'](_0x4b476d);})[_0xcc43('0x23')](function(_0x35e3b4){_0x55779b=_0x35e3b4;var _0x85e8b7=_0x3a9d91[_0xcc43('0xa7')](_0x55779b);return{'count':_0x85e8b7['length'],'rows':_0x85e8b7};})[_0xcc43('0x23')](respondWithResult(_0x491c15,null))[_0xcc43('0x40')](function(_0x44dca4){console[_0xcc43('0x9d')]('ServiceNow\x20error:\x20'+_0x44dca4);var _0x8f7156=_0x3073f7['query'][_0xcc43('0xa8')]?0x1f4:_0x44dca4[_0xcc43('0xa9')]||0x1f4;logger[_0xcc43('0xaa')](_0x44dca4[_0xcc43('0x24')]);delete _0x44dca4[_0xcc43('0x25')];if(_0x8f7156===0x191){_0x8f7156=0x190;}_0x491c15[_0xcc43('0x17')](_0x8f7156)['send'](_0x3073f7['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x44dca4[_0xcc43('0xa9')]}:_0x44dca4);});};function createFieldObject(_0x3cdf8f,_0x2f94e1,_0xa83c22,_0x2c392a,_0x24f618,_0x10a8ef){return new Promise(function(_0x448f82,_0x1fae68){var _0x5b5694={'id':_0x2c392a,'name':_0x24f618,'custom':_0x10a8ef};if(_0xa83c22==='boolean'){_0x5b5694[_0xcc43('0x3b')]=[{'name':'True','value':'true'},{'name':_0xcc43('0xab'),'value':'false'}];_0x448f82(_0x5b5694);}else{var _0x518eed={'method':_0xcc43('0x9a'),'uri':_0x3cdf8f+_0xcc43('0xac')+_0x2c392a,'auth':_0x2f94e1,'json':!![]};return rp(_0x518eed)[_0xcc43('0x23')](function(_0x430670){var _0x42de78=[];if(_0x430670[_0xcc43('0x9c')][_0xcc43('0x42')]>0x0){_0x430670['result'][_0xcc43('0xa2')](function(_0x1be3c9){if(_0x1be3c9[_0xcc43('0xad')]===_0xcc43('0xae')){var _0x4b37f1={'name':_0x1be3c9[_0xcc43('0xa4')],'value':_0x1be3c9[_0xcc43('0xaf')]};_0x42de78['push'](_0x4b37f1);}});}_0x5b5694[_0xcc43('0x3b')]=_0x42de78;if(_0x5b5694[_0xcc43('0x3b')][_0xcc43('0x42')]>0x0){_0x448f82(_0x5b5694);}else{if(_0x10a8ef==![]){_0x448f82();}else{_0x448f82(_0x5b5694);}}});}});} \ No newline at end of file +var _0x6c70=['boolean','True','true','false','sys_choice?sysparm_query=name=incident^element=','value','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ServicenowAccount','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','merge','find','create','body','params','getConfigurations','findOne','ServicenowConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','close_code','notify','incident_state','severity','category','caused_by','upon_reject','sys_updated_on','child_incidents','approval_history','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','closed_at','cmdb_ci','delivery_plan','business_service','priority','rfc','opened_at','business_duration','group_list','work_end','reopened_time','approval_set','subcategory','work_notes','short_description','correlation_display','assignment_group','business_stc','additional_assignee_list','description','sys_class_name','closed_by','follow_up','parent_incident','contact_type','reopened_by','problem_id','company','reassignment_count','activity_due','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','password','email','serverUrl','remoteUri','slice','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','label','push','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','internalType','all','concat','test','statusCode','Wrong\x20credentials'];(function(_0x4e6f86,_0x30397c){var _0x50cdc9=function(_0x121d2b){while(--_0x121d2b){_0x4e6f86['push'](_0x4e6f86['shift']());}};_0x50cdc9(++_0x30397c);}(_0x6c70,0x178));var _0x06c7=function(_0x55abd9,_0x1148af){_0x55abd9=_0x55abd9-0x0;var _0x3e5669=_0x6c70[_0x55abd9];return _0x3e5669;};'use strict';var emlformat=require(_0x06c7('0x0'));var rimraf=require(_0x06c7('0x1'));var zipdir=require(_0x06c7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x06c7('0x3'));var moment=require(_0x06c7('0x4'));var BPromise=require(_0x06c7('0x5'));var Mustache=require(_0x06c7('0x6'));var util=require(_0x06c7('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x06c7('0x8'));var _=require(_0x06c7('0x9'));var squel=require(_0x06c7('0xa'));var crypto=require(_0x06c7('0xb'));var jsforce=require(_0x06c7('0xc'));var deskjs=require(_0x06c7('0xd'));var toCsv=require(_0x06c7('0xe'));var querystring=require(_0x06c7('0xf'));var Papa=require(_0x06c7('0x10'));var Redis=require(_0x06c7('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x06c7('0x12'));var as=require(_0x06c7('0x13'));var hardwareService=require(_0x06c7('0x14'));var logger=require(_0x06c7('0x15'))(_0x06c7('0x16'));var utils=require(_0x06c7('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x06c7('0x18'));var db=require(_0x06c7('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0xd697f6,_0x3a056d){_0x3a056d=_0x3a056d||0xcc;return function(_0x158037){if(_0x158037){return _0xd697f6[_0x06c7('0x1a')](_0x3a056d);}return _0xd697f6[_0x06c7('0x1b')](_0x3a056d)['end']();};}function respondWithResult(_0x48d23e,_0x4f0ea1){_0x4f0ea1=_0x4f0ea1||0xc8;return function(_0x402bd7){if(_0x402bd7){return _0x48d23e[_0x06c7('0x1b')](_0x4f0ea1)[_0x06c7('0x1c')](_0x402bd7);}};}function respondWithFilteredResult(_0x531315,_0x33d94d){return function(_0x27d8ed){if(_0x27d8ed){var _0x1ba140=typeof _0x33d94d[_0x06c7('0x1d')]===_0x06c7('0x1e')&&typeof _0x33d94d[_0x06c7('0x1f')]===_0x06c7('0x1e');var _0x53928e=_0x27d8ed[_0x06c7('0x20')];var _0x128e7b=_0x1ba140?0x0:_0x33d94d['offset'];var _0x16978d=_0x1ba140?_0x27d8ed[_0x06c7('0x20')]:_0x33d94d[_0x06c7('0x1d')]+_0x33d94d[_0x06c7('0x1f')];var _0x4788d8;if(_0x16978d>=_0x53928e){_0x16978d=_0x53928e;_0x4788d8=0xc8;}else{_0x4788d8=0xce;}_0x531315[_0x06c7('0x1b')](_0x4788d8);return _0x531315['set'](_0x06c7('0x21'),_0x128e7b+'-'+_0x16978d+'/'+_0x53928e)[_0x06c7('0x1c')](_0x27d8ed);}return null;};}function patchUpdates(_0x42caf4){return function(_0xa70c83){try{jsonpatch[_0x06c7('0x22')](_0xa70c83,_0x42caf4,!![]);}catch(_0x4a4dc8){return BPromise[_0x06c7('0x23')](_0x4a4dc8);}return _0xa70c83[_0x06c7('0x24')]();};}function saveUpdates(_0xb0018d,_0x4b6675){return function(_0x3e3fcf){if(_0x3e3fcf){return _0x3e3fcf[_0x06c7('0x25')](_0xb0018d)[_0x06c7('0x26')](function(_0x502707){return _0x502707;});}return null;};}function removeEntity(_0x872af4,_0x4b7c6f){return function(_0x265690){if(_0x265690){return _0x265690[_0x06c7('0x27')]()[_0x06c7('0x26')](function(){_0x872af4[_0x06c7('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x276659,_0x6075e3){return function(_0x34b2f5){if(!_0x34b2f5){_0x276659['sendStatus'](0x194);}return _0x34b2f5;};}function handleError(_0x5ebc67,_0x5b5578){_0x5b5578=_0x5b5578||0x1f4;return function(_0x1d8e38){logger[_0x06c7('0x28')](_0x1d8e38[_0x06c7('0x29')]);if(_0x1d8e38['name']){delete _0x1d8e38[_0x06c7('0x2a')];}_0x5ebc67['status'](_0x5b5578)[_0x06c7('0x2b')](_0x1d8e38);};}exports[_0x06c7('0x2c')]=function(_0x302a38,_0x3eb73c){var _0x4b21a7={},_0x27ff4e={},_0x340f96={'count':0x0,'rows':[]};var _0x450569=_[_0x06c7('0x2d')](db[_0x06c7('0x2e')]['rawAttributes'],function(_0x30a762){return{'name':_0x30a762['fieldName'],'type':_0x30a762[_0x06c7('0x2f')][_0x06c7('0x30')]};});_0x27ff4e[_0x06c7('0x31')]=_[_0x06c7('0x2d')](_0x450569,_0x06c7('0x2a'));_0x27ff4e[_0x06c7('0x32')]=_[_0x06c7('0x33')](_0x302a38[_0x06c7('0x32')]);_0x27ff4e[_0x06c7('0x34')]=_[_0x06c7('0x35')](_0x27ff4e[_0x06c7('0x31')],_0x27ff4e[_0x06c7('0x32')]);_0x4b21a7[_0x06c7('0x36')]=_['intersection'](_0x27ff4e['model'],qs[_0x06c7('0x37')](_0x302a38[_0x06c7('0x32')][_0x06c7('0x37')]));_0x4b21a7['attributes']=_0x4b21a7[_0x06c7('0x36')][_0x06c7('0x38')]?_0x4b21a7['attributes']:_0x27ff4e['model'];if(!_0x302a38[_0x06c7('0x32')][_0x06c7('0x39')](_0x06c7('0x3a'))){_0x4b21a7['limit']=qs[_0x06c7('0x1f')](_0x302a38[_0x06c7('0x32')]['limit']);_0x4b21a7[_0x06c7('0x1d')]=qs['offset'](_0x302a38[_0x06c7('0x32')][_0x06c7('0x1d')]);}_0x4b21a7[_0x06c7('0x3b')]=qs[_0x06c7('0x3c')](_0x302a38['query'][_0x06c7('0x3c')]);_0x4b21a7[_0x06c7('0x3d')]=qs[_0x06c7('0x34')](_[_0x06c7('0x3e')](_0x302a38[_0x06c7('0x32')],_0x27ff4e[_0x06c7('0x34')]),_0x450569);if(_0x302a38[_0x06c7('0x32')][_0x06c7('0x3f')]){_0x4b21a7[_0x06c7('0x3d')]=_['merge'](_0x4b21a7[_0x06c7('0x3d')],{'$or':_[_0x06c7('0x2d')](_0x450569,function(_0x4af231){if(_0x4af231[_0x06c7('0x2f')]!==_0x06c7('0x40')){var _0x2f6f8b={};_0x2f6f8b[_0x4af231[_0x06c7('0x2a')]]={'$like':'%'+_0x302a38[_0x06c7('0x32')]['filter']+'%'};return _0x2f6f8b;}})});}_0x4b21a7=_['merge']({},_0x4b21a7,_0x302a38[_0x06c7('0x41')]);var _0x94c72f={'where':_0x4b21a7[_0x06c7('0x3d')]};return db[_0x06c7('0x2e')]['count'](_0x94c72f)[_0x06c7('0x26')](function(_0x1c5bb7){_0x340f96[_0x06c7('0x20')]=_0x1c5bb7;if(_0x302a38[_0x06c7('0x32')][_0x06c7('0x42')]){_0x4b21a7[_0x06c7('0x43')]=[{'all':!![]}];}return db[_0x06c7('0x2e')][_0x06c7('0x44')](_0x4b21a7);})['then'](function(_0x460f80){_0x340f96[_0x06c7('0x45')]=_0x460f80;return _0x340f96;})[_0x06c7('0x26')](respondWithFilteredResult(_0x3eb73c,_0x4b21a7))[_0x06c7('0x46')](handleError(_0x3eb73c,null));};exports[_0x06c7('0x47')]=function(_0x235149,_0x9270b9){var _0x4d24e4={'raw':![],'where':{'id':_0x235149['params']['id']}},_0x1c23a1={};_0x1c23a1['model']=_[_0x06c7('0x33')](db[_0x06c7('0x2e')][_0x06c7('0x48')]);_0x1c23a1[_0x06c7('0x32')]=_[_0x06c7('0x33')](_0x235149[_0x06c7('0x32')]);_0x1c23a1[_0x06c7('0x34')]=_[_0x06c7('0x35')](_0x1c23a1[_0x06c7('0x31')],_0x1c23a1['query']);_0x4d24e4[_0x06c7('0x36')]=_['intersection'](_0x1c23a1[_0x06c7('0x31')],qs['fields'](_0x235149[_0x06c7('0x32')][_0x06c7('0x37')]));_0x4d24e4['attributes']=_0x4d24e4[_0x06c7('0x36')][_0x06c7('0x38')]?_0x4d24e4[_0x06c7('0x36')]:_0x1c23a1[_0x06c7('0x31')];if(_0x235149[_0x06c7('0x32')][_0x06c7('0x42')]){_0x4d24e4['include']=[{'all':!![]}];}_0x4d24e4=_[_0x06c7('0x49')]({},_0x4d24e4,_0x235149[_0x06c7('0x41')]);return db[_0x06c7('0x2e')][_0x06c7('0x4a')](_0x4d24e4)[_0x06c7('0x26')](handleEntityNotFound(_0x9270b9,null))[_0x06c7('0x26')](respondWithResult(_0x9270b9,null))[_0x06c7('0x46')](handleError(_0x9270b9,null));};exports[_0x06c7('0x4b')]=function(_0x2e28a3,_0x1e6bcf){return db[_0x06c7('0x2e')][_0x06c7('0x4b')](_0x2e28a3['body'],{})[_0x06c7('0x26')](respondWithResult(_0x1e6bcf,0xc9))[_0x06c7('0x46')](handleError(_0x1e6bcf,null));};exports[_0x06c7('0x25')]=function(_0x54a965,_0x1111cf){if(_0x54a965[_0x06c7('0x4c')]['id']){delete _0x54a965['body']['id'];}return db[_0x06c7('0x2e')][_0x06c7('0x4a')]({'where':{'id':_0x54a965[_0x06c7('0x4d')]['id']}})[_0x06c7('0x26')](handleEntityNotFound(_0x1111cf,null))['then'](saveUpdates(_0x54a965['body'],null))[_0x06c7('0x26')](respondWithResult(_0x1111cf,null))[_0x06c7('0x46')](handleError(_0x1111cf,null));};exports['destroy']=function(_0x2026b6,_0x336376){return db['ServicenowAccount'][_0x06c7('0x4a')]({'where':{'id':_0x2026b6[_0x06c7('0x4d')]['id']}})[_0x06c7('0x26')](handleEntityNotFound(_0x336376,null))[_0x06c7('0x26')](removeEntity(_0x336376,null))[_0x06c7('0x46')](handleError(_0x336376,null));};exports[_0x06c7('0x4e')]=function(_0x18de5b,_0xb3d8db,_0xb58c95){var _0x2c3511={};var _0x987ea8={};var _0x24b047;var _0x45de88;return db[_0x06c7('0x2e')][_0x06c7('0x4f')]({'where':{'id':_0x18de5b[_0x06c7('0x4d')]['id']}})[_0x06c7('0x26')](handleEntityNotFound(_0xb3d8db,null))[_0x06c7('0x26')](function(_0xfce497){if(_0xfce497){_0x24b047=_0xfce497;_0x987ea8[_0x06c7('0x31')]=_[_0x06c7('0x33')](db[_0x06c7('0x50')][_0x06c7('0x48')]);_0x987ea8[_0x06c7('0x32')]=_[_0x06c7('0x33')](_0x18de5b[_0x06c7('0x32')]);_0x987ea8[_0x06c7('0x34')]=_[_0x06c7('0x35')](_0x987ea8['model'],_0x987ea8[_0x06c7('0x32')]);_0x2c3511[_0x06c7('0x36')]=_['intersection'](_0x987ea8[_0x06c7('0x31')],qs[_0x06c7('0x37')](_0x18de5b[_0x06c7('0x32')]['fields']));_0x2c3511[_0x06c7('0x36')]=_0x2c3511[_0x06c7('0x36')]['length']?_0x2c3511[_0x06c7('0x36')]:_0x987ea8[_0x06c7('0x31')];_0x2c3511['order']=qs[_0x06c7('0x3c')](_0x18de5b[_0x06c7('0x32')][_0x06c7('0x3c')]);_0x2c3511['where']=qs['filters'](_[_0x06c7('0x3e')](_0x18de5b[_0x06c7('0x32')],_0x987ea8[_0x06c7('0x34')]));if(_0x18de5b[_0x06c7('0x32')][_0x06c7('0x3f')]){_0x2c3511[_0x06c7('0x3d')]=_[_0x06c7('0x49')](_0x2c3511['where'],{'$or':_[_0x06c7('0x2d')](_0x2c3511[_0x06c7('0x36')],function(_0x21b2e9){var _0x234bab={};_0x234bab[_0x21b2e9]={'$like':'%'+_0x18de5b[_0x06c7('0x32')][_0x06c7('0x3f')]+'%'};return _0x234bab;})});}_0x2c3511=_[_0x06c7('0x49')]({},_0x2c3511,_0x18de5b[_0x06c7('0x41')]);return _0x24b047[_0x06c7('0x4e')](_0x2c3511);}})[_0x06c7('0x26')](function(_0x8cdf64){if(_0x8cdf64){_0x45de88=_0x8cdf64[_0x06c7('0x38')];if(!_0x18de5b[_0x06c7('0x32')]['hasOwnProperty']('nolimit')){_0x2c3511['limit']=qs[_0x06c7('0x1f')](_0x18de5b[_0x06c7('0x32')][_0x06c7('0x1f')]);_0x2c3511['offset']=qs['offset'](_0x18de5b[_0x06c7('0x32')][_0x06c7('0x1d')]);}return _0x24b047[_0x06c7('0x4e')](_0x2c3511);}})[_0x06c7('0x26')](function(_0x2eb6a0){if(_0x2eb6a0){return _0x2eb6a0?{'count':_0x45de88,'rows':_0x2eb6a0}:null;}})[_0x06c7('0x26')](respondWithResult(_0xb3d8db,null))[_0x06c7('0x46')](handleError(_0xb3d8db,null));};exports[_0x06c7('0x51')]=function(_0x3c4e37,_0x265da0,_0x3bb94a){if(_0x3c4e37[_0x06c7('0x4c')]['id']){delete _0x3c4e37['body']['id'];}return db[_0x06c7('0x2e')][_0x06c7('0x4f')]({'where':{'id':_0x3c4e37[_0x06c7('0x4d')]['id']}})[_0x06c7('0x26')](handleEntityNotFound(_0x265da0,null))[_0x06c7('0x26')](function(_0x4e1800){if(_0x4e1800){_0x3c4e37[_0x06c7('0x4c')][_0x06c7('0x52')]=_0x4e1800['id'];_0x3c4e37['body'][_0x06c7('0x53')]=integrations[_0x06c7('0x54')](_0x3c4e37[_0x06c7('0x4c')][_0x06c7('0x55')],_0x3c4e37[_0x06c7('0x4c')][_0x06c7('0x2f')]);_0x3c4e37[_0x06c7('0x4c')][_0x06c7('0x56')]=integrations[_0x06c7('0x57')](_0x3c4e37[_0x06c7('0x4c')][_0x06c7('0x55')],_0x3c4e37['body']['type']);return db[_0x06c7('0x50')][_0x06c7('0x4b')](_0x3c4e37['body'],{'include':[{'model':db[_0x06c7('0x58')],'as':_0x06c7('0x53')},{'model':db[_0x06c7('0x58')],'as':_0x06c7('0x56')}]});}return null;})['then'](respondWithResult(_0x265da0,null))[_0x06c7('0x46')](handleError(_0x265da0,null));};exports[_0x06c7('0x59')]=function(_0x5bd78b,_0x1e8caa,_0x364147){var _0x116d2a=[_0x06c7('0x5a'),_0x06c7('0x5b'),_0x06c7('0x5c'),'subcategory',_0x06c7('0x5d'),_0x06c7('0x5e'),_0x06c7('0x5f'),_0x06c7('0x60'),_0x06c7('0x61')];var _0x273d86=['parent','made_sla',_0x06c7('0x62'),'watch_list',_0x06c7('0x63'),_0x06c7('0x64'),_0x06c7('0x65'),_0x06c7('0x5b'),_0x06c7('0x66'),'number','resolved_by',_0x06c7('0x67'),_0x06c7('0x68'),_0x06c7('0x69'),_0x06c7('0x6a'),_0x06c7('0x6b'),_0x06c7('0x6c'),'sys_created_by','knowledge',_0x06c7('0x3b'),'calendar_stc',_0x06c7('0x6d'),_0x06c7('0x6e'),_0x06c7('0x6f'),'impact','active','work_notes_list',_0x06c7('0x70'),_0x06c7('0x71'),'sys_domain_path',_0x06c7('0x72'),'time_worked','expected_start',_0x06c7('0x73'),_0x06c7('0x74'),_0x06c7('0x75'),_0x06c7('0x76'),_0x06c7('0x77'),'resolved_at','caller_id',_0x06c7('0x78'),_0x06c7('0x79'),_0x06c7('0x7a'),_0x06c7('0x7b'),_0x06c7('0x5d'),_0x06c7('0x7c'),'delivery_task','work_start',_0x06c7('0x7d'),_0x06c7('0x7e'),_0x06c7('0x7f'),_0x06c7('0x80'),'calendar_duration',_0x06c7('0x5e'),_0x06c7('0x81'),'close_notes',_0x06c7('0x82'),_0x06c7('0x83'),_0x06c7('0x84'),'sys_id',_0x06c7('0x85'),_0x06c7('0x86'),_0x06c7('0x5f'),'urgency',_0x06c7('0x87'),_0x06c7('0x88'),_0x06c7('0x89'),_0x06c7('0x8a'),'assigned_to',_0x06c7('0x60'),'comments',_0x06c7('0x8b'),_0x06c7('0x8c'),_0x06c7('0x8d'),_0x06c7('0x8e'),_0x06c7('0x8f'),_0x06c7('0x90'),_0x06c7('0x91'),_0x06c7('0x92'),_0x06c7('0x93'),_0x06c7('0x94'),_0x06c7('0x95'),_0x06c7('0x61')];var _0x5e2514='';var _0x5089f3='';var _0x560221=[];var _0x34f9ca='';var _0x3dda9f='';var _0x2e9039=[];var _0x20a3a3='';var _0x10dd35='';var _0x41a1f7={};var _0x12c60c='';return db[_0x06c7('0x2e')][_0x06c7('0x4f')]({'where':{'id':_0x5bd78b[_0x06c7('0x4d')]['id']},'attributes':['id',_0x06c7('0x96'),_0x06c7('0x97'),_0x06c7('0x98'),'remoteUri',_0x06c7('0x99')]})['then'](handleEntityNotFound(_0x1e8caa,null))[_0x06c7('0x26')](function(_0x6a6a18){if(_0x6a6a18){_0x12c60c=_0x6a6a18[_0x06c7('0x9a')];var _0x9c59e4=_0x12c60c[_0x06c7('0x9b')](-0x1);if(_0x9c59e4==='/'){_0x12c60c=_0x12c60c['substring'](0x0,_0x12c60c[_0x06c7('0x9c')](_0x9c59e4));}_0x10dd35=util[_0x06c7('0x9d')](_0x06c7('0x9e'),_0x12c60c);_0x20a3a3=util[_0x06c7('0x9d')](_0x06c7('0x9f'),_0x12c60c);_0x41a1f7={'user':_0x6a6a18['username'],'pass':_0x6a6a18['password']};var _0x28382={'method':_0x06c7('0xa0'),'uri':_0x10dd35+_0x06c7('0xa1'),'auth':_0x41a1f7,'json':!![]};return rp(_0x28382);}})[_0x06c7('0x26')](function(_0x15c9eb){if(_0x15c9eb[_0x06c7('0xa2')][_0x06c7('0x38')]>0x0){_0x5e2514=_0x15c9eb[_0x06c7('0xa2')];}console[_0x06c7('0xa3')](_0x06c7('0xa4'),_0x5e2514);_0x2e9039=[];_0x5089f3=Object[_0x06c7('0xa5')]([],_0x5e2514);_[_0x06c7('0xa6')](_0x5089f3,function(_0x5d3ea2){return!_0x116d2a[_0x06c7('0xa7')](_0x5d3ea2[_0x06c7('0x2a')]);});_0x5089f3['forEach'](function(_0x573ad9){var _0x2e2f55=createFieldObject(_0x20a3a3,_0x41a1f7,_0x573ad9['internalType'],_0x573ad9['name'],_0x573ad9[_0x06c7('0xa8')],![]);_0x2e9039[_0x06c7('0xa9')](_0x2e2f55);});return Promise['all'](_0x2e9039);})[_0x06c7('0x26')](function(_0x9d1a27){_0x560221=_0x9d1a27;_0x34f9ca=Object['assign']([],_0x5e2514);console[_0x06c7('0xa3')](_0x06c7('0xaa'),_0x5e2514);_['remove'](_0x34f9ca,function(_0x5c136e){return _0x273d86[_0x06c7('0xa7')](_0x5c136e[_0x06c7('0x2a')]);});console[_0x06c7('0xa3')](_0x06c7('0xab'),_0x34f9ca);_0x2e9039=[];_0x34f9ca[_0x06c7('0xac')](function(_0x226c21){var _0xccde32=createFieldObject(_0x20a3a3,_0x41a1f7,_0x226c21[_0x06c7('0xad')],_0x226c21['name'],_0x226c21[_0x06c7('0xa8')],!![]);_0x2e9039[_0x06c7('0xa9')](_0xccde32);});return Promise[_0x06c7('0xae')](_0x2e9039);})[_0x06c7('0x26')](function(_0x425a8c){_0x3dda9f=_0x425a8c;var _0x293d13=_0x560221[_0x06c7('0xaf')](_0x3dda9f);return{'count':_0x293d13['length'],'rows':_0x293d13};})[_0x06c7('0x26')](respondWithResult(_0x1e8caa,null))[_0x06c7('0x46')](function(_0x588fb8){console[_0x06c7('0xa3')]('ServiceNow\x20error:\x20'+_0x588fb8);var _0x593479=_0x5bd78b['query'][_0x06c7('0xb0')]?0x1f4:_0x588fb8[_0x06c7('0xb1')]||0x1f4;logger['error'](_0x588fb8[_0x06c7('0x29')]);delete _0x588fb8['name'];if(_0x593479===0x191){_0x593479=0x190;}_0x1e8caa[_0x06c7('0x1b')](_0x593479)['send'](_0x5bd78b[_0x06c7('0x32')][_0x06c7('0xb0')]?{'message':_0x06c7('0xb2'),'statusCode':_0x588fb8['statusCode']}:_0x588fb8);});};function createFieldObject(_0x3199bb,_0x578357,_0x596151,_0x1f63e2,_0x5f4c89,_0x418604){return new Promise(function(_0x820d26,_0x43a784){var _0x59ef41={'id':_0x1f63e2,'name':_0x5f4c89,'custom':_0x418604};if(_0x596151===_0x06c7('0xb3')){_0x59ef41[_0x06c7('0x41')]=[{'name':_0x06c7('0xb4'),'value':_0x06c7('0xb5')},{'name':'False','value':_0x06c7('0xb6')}];_0x820d26(_0x59ef41);}else{var _0x10a7b7={'method':_0x06c7('0xa0'),'uri':_0x3199bb+_0x06c7('0xb7')+_0x1f63e2,'auth':_0x578357,'json':!![]};return rp(_0x10a7b7)[_0x06c7('0x26')](function(_0x557ab4){var _0xdf37dc=[];if(_0x557ab4[_0x06c7('0xa2')][_0x06c7('0x38')]>0x0){_0x557ab4[_0x06c7('0xa2')][_0x06c7('0xac')](function(_0xd7f88c){if(_0xd7f88c['inactive']===_0x06c7('0xb6')){var _0x2c0f14={'name':_0xd7f88c[_0x06c7('0xa8')],'value':_0xd7f88c[_0x06c7('0xb8')]};_0xdf37dc[_0x06c7('0xa9')](_0x2c0f14);}});}_0x59ef41[_0x06c7('0x41')]=_0xdf37dc;if(_0x59ef41[_0x06c7('0x41')][_0x06c7('0x38')]>0x0){_0x820d26(_0x59ef41);}else{if(_0x418604==![]){_0x820d26();}else{_0x820d26(_0x59ef41);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index feeb181..ba4002d 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 _0x5496=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','ServicenowAccount','int_servicenow_accounts','lodash'];(function(_0x256b72,_0x340985){var _0x2183e3=function(_0xf7fd37){while(--_0xf7fd37){_0x256b72['push'](_0x256b72['shift']());}};_0x2183e3(++_0x340985);}(_0x5496,0x175));var _0x6549=function(_0x277354,_0xbcfe2b){_0x277354=_0x277354-0x0;var _0x12d2b4=_0x5496[_0x277354];return _0x12d2b4;};'use strict';var _=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var logger=require(_0x6549('0x2'))(_0x6549('0x3'));var moment=require(_0x6549('0x4'));var BPromise=require('bluebird');var rp=require(_0x6549('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6549('0x6'));var config=require(_0x6549('0x7'));var attributes=require(_0x6549('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x43cb17,_0x1d8cea){return _0x43cb17['define'](_0x6549('0x9'),attributes,{'tableName':_0x6549('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1883=['../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x233de7,_0x109f02){var _0x26940c=function(_0x474b79){while(--_0x474b79){_0x233de7['push'](_0x233de7['shift']());}};_0x26940c(++_0x109f02);}(_0x1883,0xab));var _0x3188=function(_0x3c023e,_0x5585c9){_0x3c023e=_0x3c023e-0x0;var _0x1877ce=_0x1883[_0x3c023e];return _0x1877ce;};'use strict';var _=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var logger=require(_0x3188('0x2'))(_0x3188('0x3'));var moment=require(_0x3188('0x4'));var BPromise=require(_0x3188('0x5'));var rp=require(_0x3188('0x6'));var fs=require('fs');var path=require(_0x3188('0x7'));var rimraf=require(_0x3188('0x8'));var config=require(_0x3188('0x9'));var attributes=require(_0x3188('0xa'));var integrations=require(_0x3188('0xb'));module[_0x3188('0xc')]=function(_0x33b62d,_0x24f2f1){return _0x33b62d[_0x3188('0xd')](_0x3188('0xe'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 139088f..33f86fc 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 _0x0265=['options','raw','where','limit','include','model','attributes','map','debug','stringify','find','ShowServicenowAccount','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetServicenowAccount','ServicenowAccount'];(function(_0x48c4d3,_0x589372){var _0x210893=function(_0x829e7c){while(--_0x829e7c){_0x48c4d3['push'](_0x48c4d3['shift']());}};_0x210893(++_0x589372);}(_0x0265,0x90));var _0x5026=function(_0x31c82f,_0x2d7fc1){_0x31c82f=_0x31c82f-0x0;var _0x419d13=_0x0265[_0x31c82f];return _0x419d13;};'use strict';var _=require('lodash');var util=require(_0x5026('0x0'));var moment=require('moment');var BPromise=require(_0x5026('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5026('0x2'));var db=require(_0x5026('0x3'))['db'];var utils=require(_0x5026('0x4'));var logger=require(_0x5026('0x5'))(_0x5026('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x5026('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x16aaa2,_0x4d7010,_0x2c4b44){return new BPromise(function(_0x30b079,_0x353aaf){return client[_0x5026('0x8')](_0x16aaa2,_0x2c4b44)[_0x5026('0x9')](function(_0x48515f){logger[_0x5026('0xa')](_0x5026('0xb'),_0x4d7010,_0x5026('0xc'));logger['debug'](_0x5026('0xd'),_0x4d7010,_0x5026('0xc'),JSON['stringify'](_0x48515f));if(_0x48515f[_0x5026('0xe')]){if(_0x48515f[_0x5026('0xe')][_0x5026('0xf')]===0x1f4){logger[_0x5026('0xe')](_0x5026('0xb'),_0x4d7010,_0x48515f[_0x5026('0xe')][_0x5026('0x10')]);return _0x353aaf(_0x48515f[_0x5026('0xe')][_0x5026('0x10')]);}logger['error'](_0x5026('0xb'),_0x4d7010,_0x48515f['error'][_0x5026('0x10')]);return _0x30b079(_0x48515f[_0x5026('0xe')][_0x5026('0x10')]);}else{logger[_0x5026('0xa')](_0x5026('0xb'),_0x4d7010,_0x5026('0xc'));_0x30b079(_0x48515f[_0x5026('0x11')][_0x5026('0x10')]);}})[_0x5026('0x12')](function(_0x50a0f7){logger[_0x5026('0xe')](_0x5026('0xb'),_0x4d7010,_0x50a0f7);_0x353aaf(_0x50a0f7);});});}exports[_0x5026('0x13')]=function(_0x4f59eb){var _0x48cf80=this;return new Promise(function(_0x572a97,_0x2ecefd){return db[_0x5026('0x14')]['findAll']({'raw':_0x4f59eb['options']?_0x4f59eb[_0x5026('0x15')][_0x5026('0x16')]===undefined?!![]:![]:!![],'where':_0x4f59eb[_0x5026('0x15')]?_0x4f59eb[_0x5026('0x15')][_0x5026('0x17')]||null:null,'attributes':_0x4f59eb[_0x5026('0x15')]?_0x4f59eb[_0x5026('0x15')]['attributes']||null:null,'limit':_0x4f59eb[_0x5026('0x15')]?_0x4f59eb[_0x5026('0x15')][_0x5026('0x18')]||null:null,'include':_0x4f59eb[_0x5026('0x15')]?_0x4f59eb[_0x5026('0x15')][_0x5026('0x19')]?_['map'](_0x4f59eb[_0x5026('0x15')][_0x5026('0x19')],function(_0x40d836){return{'model':db[_0x40d836[_0x5026('0x1a')]],'as':_0x40d836['as'],'attributes':_0x40d836[_0x5026('0x1b')],'include':_0x40d836[_0x5026('0x19')]?_[_0x5026('0x1c')](_0x40d836['include'],function(_0x1652d2){return{'model':db[_0x1652d2[_0x5026('0x1a')]],'as':_0x1652d2['as'],'attributes':_0x1652d2[_0x5026('0x1b')],'include':_0x1652d2[_0x5026('0x19')]?_[_0x5026('0x1c')](_0x1652d2[_0x5026('0x19')],function(_0x23e498){return{'model':db[_0x23e498[_0x5026('0x1a')]],'as':_0x23e498['as'],'attributes':_0x23e498[_0x5026('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5026('0x9')](function(_0x5c569b){logger[_0x5026('0xa')](_0x5026('0x13'),_0x4f59eb);logger[_0x5026('0x1d')]('GetServicenowAccount',_0x4f59eb,JSON[_0x5026('0x1e')](_0x5c569b));_0x572a97(_0x5c569b);})[_0x5026('0x12')](function(_0x214bb5){logger[_0x5026('0xe')](_0x5026('0x13'),_0x214bb5['message'],_0x4f59eb);_0x2ecefd(_0x48cf80[_0x5026('0xe')](0x1f4,_0x214bb5[_0x5026('0x10')]));});});};exports['ShowServicenowAccount']=function(_0x12690b){var _0x3018d4=this;return new Promise(function(_0x3d7a69,_0x486cf7){return db[_0x5026('0x14')][_0x5026('0x1f')]({'raw':_0x12690b['options']?_0x12690b['options'][_0x5026('0x16')]===undefined?!![]:![]:!![],'where':_0x12690b[_0x5026('0x15')]?_0x12690b['options'][_0x5026('0x17')]||null:null,'attributes':_0x12690b['options']?_0x12690b[_0x5026('0x15')][_0x5026('0x1b')]||null:null,'include':_0x12690b['options']?_0x12690b[_0x5026('0x15')]['include']?_[_0x5026('0x1c')](_0x12690b[_0x5026('0x15')]['include'],function(_0x486638){return{'model':db[_0x486638['model']],'as':_0x486638['as'],'attributes':_0x486638[_0x5026('0x1b')],'include':_0x486638['include']?_[_0x5026('0x1c')](_0x486638[_0x5026('0x19')],function(_0x3d86f4){return{'model':db[_0x3d86f4['model']],'as':_0x3d86f4['as'],'attributes':_0x3d86f4[_0x5026('0x1b')],'include':_0x3d86f4[_0x5026('0x19')]?_[_0x5026('0x1c')](_0x3d86f4[_0x5026('0x19')],function(_0x2dda82){return{'model':db[_0x2dda82[_0x5026('0x1a')]],'as':_0x2dda82['as'],'attributes':_0x2dda82[_0x5026('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5026('0x9')](function(_0x4b937d){logger[_0x5026('0xa')]('ShowServicenowAccount',_0x12690b);logger[_0x5026('0x1d')](_0x5026('0x20'),_0x12690b,JSON['stringify'](_0x4b937d));_0x3d7a69(_0x4b937d);})['catch'](function(_0x1ac7a4){logger[_0x5026('0xe')]('ShowServicenowAccount',_0x1ac7a4[_0x5026('0x10')],_0x12690b);_0x486cf7(_0x3018d4['error'](0x1f4,_0x1ac7a4[_0x5026('0x10')]));});});}; \ No newline at end of file +var _0xd2c0=['info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetServicenowAccount','ServicenowAccount','options','raw','limit','map','include','model','attributes','stringify','ShowServicenowAccount','where','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','http','then'];(function(_0xd7f015,_0x577d1e){var _0x469cfa=function(_0x534727){while(--_0x534727){_0xd7f015['push'](_0xd7f015['shift']());}};_0x469cfa(++_0x577d1e);}(_0xd2c0,0x176));var _0x0d2c=function(_0x22801f,_0x437721){_0x22801f=_0x22801f-0x0;var _0x5cee0c=_0xd2c0[_0x22801f];return _0x5cee0c;};'use strict';var _=require(_0x0d2c('0x0'));var util=require(_0x0d2c('0x1'));var moment=require(_0x0d2c('0x2'));var BPromise=require('bluebird');var rs=require(_0x0d2c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0d2c('0x4'));var logger=require(_0x0d2c('0x5'))(_0x0d2c('0x6'));var config=require(_0x0d2c('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0d2c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x17a91c,_0x335523,_0x5ee805){return new BPromise(function(_0x16b305,_0x377c81){return client['request'](_0x17a91c,_0x5ee805)[_0x0d2c('0x9')](function(_0xf5d0db){logger[_0x0d2c('0xa')](_0x0d2c('0xb'),_0x335523,_0x0d2c('0xc'));logger[_0x0d2c('0xd')](_0x0d2c('0xe'),_0x335523,_0x0d2c('0xc'),JSON['stringify'](_0xf5d0db));if(_0xf5d0db[_0x0d2c('0xf')]){if(_0xf5d0db[_0x0d2c('0xf')][_0x0d2c('0x10')]===0x1f4){logger[_0x0d2c('0xf')](_0x0d2c('0xb'),_0x335523,_0xf5d0db[_0x0d2c('0xf')][_0x0d2c('0x11')]);return _0x377c81(_0xf5d0db[_0x0d2c('0xf')][_0x0d2c('0x11')]);}logger[_0x0d2c('0xf')](_0x0d2c('0xb'),_0x335523,_0xf5d0db[_0x0d2c('0xf')]['message']);return _0x16b305(_0xf5d0db[_0x0d2c('0xf')][_0x0d2c('0x11')]);}else{logger[_0x0d2c('0xa')]('ServicenowAccount,\x20%s,\x20%s',_0x335523,'request\x20sent');_0x16b305(_0xf5d0db[_0x0d2c('0x12')]['message']);}})[_0x0d2c('0x13')](function(_0x2baaa7){logger[_0x0d2c('0xf')](_0x0d2c('0xb'),_0x335523,_0x2baaa7);_0x377c81(_0x2baaa7);});});}exports[_0x0d2c('0x14')]=function(_0x336596){var _0xb85cdd=this;return new Promise(function(_0x1a0d05,_0x1f9cee){return db[_0x0d2c('0x15')]['findAll']({'raw':_0x336596[_0x0d2c('0x16')]?_0x336596[_0x0d2c('0x16')][_0x0d2c('0x17')]===undefined?!![]:![]:!![],'where':_0x336596['options']?_0x336596[_0x0d2c('0x16')]['where']||null:null,'attributes':_0x336596[_0x0d2c('0x16')]?_0x336596['options']['attributes']||null:null,'limit':_0x336596['options']?_0x336596[_0x0d2c('0x16')][_0x0d2c('0x18')]||null:null,'include':_0x336596[_0x0d2c('0x16')]?_0x336596[_0x0d2c('0x16')]['include']?_[_0x0d2c('0x19')](_0x336596[_0x0d2c('0x16')][_0x0d2c('0x1a')],function(_0x1aad3a){return{'model':db[_0x1aad3a[_0x0d2c('0x1b')]],'as':_0x1aad3a['as'],'attributes':_0x1aad3a[_0x0d2c('0x1c')],'include':_0x1aad3a[_0x0d2c('0x1a')]?_[_0x0d2c('0x19')](_0x1aad3a[_0x0d2c('0x1a')],function(_0x5c41b1){return{'model':db[_0x5c41b1[_0x0d2c('0x1b')]],'as':_0x5c41b1['as'],'attributes':_0x5c41b1[_0x0d2c('0x1c')],'include':_0x5c41b1[_0x0d2c('0x1a')]?_[_0x0d2c('0x19')](_0x5c41b1[_0x0d2c('0x1a')],function(_0x2494bc){return{'model':db[_0x2494bc['model']],'as':_0x2494bc['as'],'attributes':_0x2494bc[_0x0d2c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0d2c('0x9')](function(_0x163a88){logger[_0x0d2c('0xa')]('GetServicenowAccount',_0x336596);logger[_0x0d2c('0xd')]('GetServicenowAccount',_0x336596,JSON[_0x0d2c('0x1d')](_0x163a88));_0x1a0d05(_0x163a88);})[_0x0d2c('0x13')](function(_0x308fd3){logger[_0x0d2c('0xf')](_0x0d2c('0x14'),_0x308fd3[_0x0d2c('0x11')],_0x336596);_0x1f9cee(_0xb85cdd['error'](0x1f4,_0x308fd3[_0x0d2c('0x11')]));});});};exports[_0x0d2c('0x1e')]=function(_0x31669b){var _0xbb1ee7=this;return new Promise(function(_0x4c22c9,_0x2f91c0){return db[_0x0d2c('0x15')]['find']({'raw':_0x31669b['options']?_0x31669b[_0x0d2c('0x16')][_0x0d2c('0x17')]===undefined?!![]:![]:!![],'where':_0x31669b[_0x0d2c('0x16')]?_0x31669b[_0x0d2c('0x16')][_0x0d2c('0x1f')]||null:null,'attributes':_0x31669b[_0x0d2c('0x16')]?_0x31669b[_0x0d2c('0x16')]['attributes']||null:null,'include':_0x31669b[_0x0d2c('0x16')]?_0x31669b[_0x0d2c('0x16')]['include']?_[_0x0d2c('0x19')](_0x31669b[_0x0d2c('0x16')][_0x0d2c('0x1a')],function(_0x342292){return{'model':db[_0x342292[_0x0d2c('0x1b')]],'as':_0x342292['as'],'attributes':_0x342292[_0x0d2c('0x1c')],'include':_0x342292[_0x0d2c('0x1a')]?_['map'](_0x342292[_0x0d2c('0x1a')],function(_0x2e0242){return{'model':db[_0x2e0242[_0x0d2c('0x1b')]],'as':_0x2e0242['as'],'attributes':_0x2e0242['attributes'],'include':_0x2e0242[_0x0d2c('0x1a')]?_[_0x0d2c('0x19')](_0x2e0242[_0x0d2c('0x1a')],function(_0x27f37c){return{'model':db[_0x27f37c[_0x0d2c('0x1b')]],'as':_0x27f37c['as'],'attributes':_0x27f37c[_0x0d2c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0d2c('0x9')](function(_0x223133){logger[_0x0d2c('0xa')]('ShowServicenowAccount',_0x31669b);logger[_0x0d2c('0xd')](_0x0d2c('0x1e'),_0x31669b,JSON['stringify'](_0x223133));_0x4c22c9(_0x223133);})[_0x0d2c('0x13')](function(_0xebbfad){logger[_0x0d2c('0xf')](_0x0d2c('0x1e'),_0xebbfad[_0x0d2c('0x11')],_0x31669b);_0x2f91c0(_0xbb1ee7[_0x0d2c('0xf')](0x1f4,_0xebbfad[_0x0d2c('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 9d0a568..215459e 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 _0xefe9=['/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xefe9,0x1d2));var _0x9efe=function(_0x4b9b90,_0x954d2f){_0x4b9b90=_0x4b9b90-0x0;var _0x46ea74=_0xefe9[_0x4b9b90];return _0x46ea74;};'use strict';var multer=require(_0x9efe('0x0'));var util=require(_0x9efe('0x1'));var path=require(_0x9efe('0x2'));var timeout=require(_0x9efe('0x3'));var express=require(_0x9efe('0x4'));var router=express['Router']();var fs_extra=require(_0x9efe('0x5'));var auth=require(_0x9efe('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9efe('0x7'));var controller=require(_0x9efe('0x8'));router[_0x9efe('0x9')]('/',auth[_0x9efe('0xa')](),controller[_0x9efe('0xb')]);router[_0x9efe('0x9')](_0x9efe('0xc'),auth[_0x9efe('0xa')](),controller[_0x9efe('0xd')]);router[_0x9efe('0x9')](_0x9efe('0xe'),auth['isAuthenticated'](),controller[_0x9efe('0xf')]);router[_0x9efe('0x9')](_0x9efe('0x10'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x9efe('0x9')](_0x9efe('0x11'),auth[_0x9efe('0xa')](),controller[_0x9efe('0x12')]);router['post']('/',auth[_0x9efe('0xa')](),controller[_0x9efe('0x13')]);router[_0x9efe('0x14')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x9efe('0x15')](_0x9efe('0xc'),auth[_0x9efe('0xa')](),controller[_0x9efe('0x16')]);module[_0x9efe('0x17')]=router; \ No newline at end of file +var _0x8b6f=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x1e36b1,_0x5a4b67){var _0x4952c2=function(_0x57a83f){while(--_0x57a83f){_0x1e36b1['push'](_0x1e36b1['shift']());}};_0x4952c2(++_0x5a4b67);}(_0x8b6f,0x1a3));var _0xf8b6=function(_0x4c63ee,_0x1f719d){_0x4c63ee=_0x4c63ee-0x0;var _0x172087=_0x8b6f[_0x4c63ee];return _0x172087;};'use strict';var multer=require(_0xf8b6('0x0'));var util=require(_0xf8b6('0x1'));var path=require(_0xf8b6('0x2'));var timeout=require(_0xf8b6('0x3'));var express=require('express');var router=express[_0xf8b6('0x4')]();var fs_extra=require(_0xf8b6('0x5'));var auth=require(_0xf8b6('0x6'));var interaction=require(_0xf8b6('0x7'));var config=require(_0xf8b6('0x8'));var controller=require('./intServicenowConfiguration.controller');router[_0xf8b6('0x9')]('/',auth[_0xf8b6('0xa')](),controller[_0xf8b6('0xb')]);router['get']('/:id',auth[_0xf8b6('0xa')](),controller[_0xf8b6('0xc')]);router[_0xf8b6('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0xf8b6('0xd')]);router[_0xf8b6('0x9')](_0xf8b6('0xe'),auth[_0xf8b6('0xa')](),controller[_0xf8b6('0xf')]);router[_0xf8b6('0x9')]('/:id/descriptions',auth[_0xf8b6('0xa')](),controller[_0xf8b6('0x10')]);router[_0xf8b6('0x11')]('/',auth[_0xf8b6('0xa')](),controller[_0xf8b6('0x12')]);router[_0xf8b6('0x13')](_0xf8b6('0x14'),auth[_0xf8b6('0xa')](),controller[_0xf8b6('0x15')]);router[_0xf8b6('0x16')]('/:id',auth[_0xf8b6('0xa')](),controller[_0xf8b6('0x17')]);module[_0xf8b6('0x18')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 0b2c01f..9655bcb 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 _0xa63c=['STRING','sequelize','exports'];(function(_0x49f7d5,_0x21ea58){var _0x4256ec=function(_0x46d121){while(--_0x46d121){_0x49f7d5['push'](_0x49f7d5['shift']());}};_0x4256ec(++_0x21ea58);}(_0xa63c,0x1ab));var _0xca63=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa63c[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xca63('0x0'));module[_0xca63('0x1')]={'name':{'type':Sequelize[_0xca63('0x2')]},'description':{'type':Sequelize[_0xca63('0x2')]}}; \ No newline at end of file +var _0xa770=['STRING','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa770,0xf3));var _0x0a77=function(_0x3f2045,_0x406aad){_0x3f2045=_0x3f2045-0x0;var _0x4721f0=_0xa770[_0x3f2045];return _0x4721f0;};'use strict';var Sequelize=require('sequelize');module[_0x0a77('0x0')]={'name':{'type':Sequelize[_0x0a77('0x1')]},'description':{'type':Sequelize[_0x0a77('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index ec56bfc..08c5676 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 _0xd6c2=['querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','end','error','name','send','index','map','ServicenowConfiguration','rawAttributes','model','query','keys','filters','fields','attributes','length','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','params','intersection','include','options','find','catch','create','body','getFields','findOne','order','hasOwnProperty','getSubjects','getDescriptions','ServicenowField','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js'];(function(_0x2b7389,_0x58311b){var _0xe5d9da=function(_0xecec75){while(--_0xecec75){_0x2b7389['push'](_0x2b7389['shift']());}};_0xe5d9da(++_0x58311b);}(_0xd6c2,0x172));var _0x2d6c=function(_0x203f03,_0x4fe4a5){_0x203f03=_0x203f03-0x0;var _0x2ec2a5=_0xd6c2[_0x203f03];return _0x2ec2a5;};'use strict';var emlformat=require(_0x2d6c('0x0'));var rimraf=require(_0x2d6c('0x1'));var zipdir=require(_0x2d6c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2d6c('0x3'));var moment=require(_0x2d6c('0x4'));var BPromise=require(_0x2d6c('0x5'));var Mustache=require('mustache');var util=require(_0x2d6c('0x6'));var path=require(_0x2d6c('0x7'));var sox=require(_0x2d6c('0x8'));var csv=require(_0x2d6c('0x9'));var ejs=require(_0x2d6c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2d6c('0xb'));var squel=require('squel');var crypto=require(_0x2d6c('0xc'));var jsforce=require(_0x2d6c('0xd'));var deskjs=require(_0x2d6c('0xe'));var toCsv=require(_0x2d6c('0x9'));var querystring=require(_0x2d6c('0xf'));var Papa=require('papaparse');var Redis=require(_0x2d6c('0x10'));var authService=require(_0x2d6c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2d6c('0x12'));var hardwareService=require(_0x2d6c('0x13'));var logger=require(_0x2d6c('0x14'))(_0x2d6c('0x15'));var utils=require(_0x2d6c('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2d6c('0x17'))['db'];function respondWithStatusCode(_0x47a290,_0x19dd81){_0x19dd81=_0x19dd81||0xcc;return function(_0x5dd63c){if(_0x5dd63c){return _0x47a290[_0x2d6c('0x18')](_0x19dd81);}return _0x47a290[_0x2d6c('0x19')](_0x19dd81)['end']();};}function respondWithResult(_0x31b5a6,_0x3264f5){_0x3264f5=_0x3264f5||0xc8;return function(_0x5e80db){if(_0x5e80db){return _0x31b5a6[_0x2d6c('0x19')](_0x3264f5)['json'](_0x5e80db);}};}function respondWithFilteredResult(_0x1cc8bb,_0x1839b3){return function(_0x12446f){if(_0x12446f){var _0x20b4a5=typeof _0x1839b3[_0x2d6c('0x1a')]===_0x2d6c('0x1b')&&typeof _0x1839b3[_0x2d6c('0x1c')]===_0x2d6c('0x1b');var _0x3aba5b=_0x12446f[_0x2d6c('0x1d')];var _0x1ad69f=_0x20b4a5?0x0:_0x1839b3[_0x2d6c('0x1a')];var _0x5d7e63=_0x20b4a5?_0x12446f[_0x2d6c('0x1d')]:_0x1839b3[_0x2d6c('0x1a')]+_0x1839b3[_0x2d6c('0x1c')];var _0x52a6ad;if(_0x5d7e63>=_0x3aba5b){_0x5d7e63=_0x3aba5b;_0x52a6ad=0xc8;}else{_0x52a6ad=0xce;}_0x1cc8bb[_0x2d6c('0x19')](_0x52a6ad);return _0x1cc8bb[_0x2d6c('0x1e')](_0x2d6c('0x1f'),_0x1ad69f+'-'+_0x5d7e63+'/'+_0x3aba5b)[_0x2d6c('0x20')](_0x12446f);}return null;};}function patchUpdates(_0x196599){return function(_0x485d7f){try{jsonpatch['apply'](_0x485d7f,_0x196599,!![]);}catch(_0x37deda){return BPromise[_0x2d6c('0x21')](_0x37deda);}return _0x485d7f[_0x2d6c('0x22')]();};}function saveUpdates(_0x4aeb23,_0x23cc97){return function(_0x4eb2a0){if(_0x4eb2a0){return _0x4eb2a0[_0x2d6c('0x23')](_0x4aeb23)[_0x2d6c('0x24')](function(_0x43427a){return _0x43427a;});}return null;};}function removeEntity(_0x288b19,_0x2890fc){return function(_0x583102){if(_0x583102){return _0x583102[_0x2d6c('0x25')]()[_0x2d6c('0x24')](function(){_0x288b19[_0x2d6c('0x19')](0xcc)[_0x2d6c('0x26')]();});}};}function handleEntityNotFound(_0x3274ab,_0x161250){return function(_0x1a7879){if(!_0x1a7879){_0x3274ab['sendStatus'](0x194);}return _0x1a7879;};}function handleError(_0x431135,_0x46e144){_0x46e144=_0x46e144||0x1f4;return function(_0x22ad2e){logger[_0x2d6c('0x27')](_0x22ad2e['stack']);if(_0x22ad2e[_0x2d6c('0x28')]){delete _0x22ad2e[_0x2d6c('0x28')];}_0x431135[_0x2d6c('0x19')](_0x46e144)[_0x2d6c('0x29')](_0x22ad2e);};}exports[_0x2d6c('0x2a')]=function(_0x2b42c1,_0x298050){var _0x171be3={},_0x2e33dc={},_0x2b584a={'count':0x0,'rows':[]};var _0x334c48=_[_0x2d6c('0x2b')](db[_0x2d6c('0x2c')][_0x2d6c('0x2d')],function(_0x5283a8){return{'name':_0x5283a8['fieldName'],'type':_0x5283a8['type']['key']};});_0x2e33dc[_0x2d6c('0x2e')]=_[_0x2d6c('0x2b')](_0x334c48,_0x2d6c('0x28'));_0x2e33dc[_0x2d6c('0x2f')]=_[_0x2d6c('0x30')](_0x2b42c1[_0x2d6c('0x2f')]);_0x2e33dc[_0x2d6c('0x31')]=_['intersection'](_0x2e33dc[_0x2d6c('0x2e')],_0x2e33dc[_0x2d6c('0x2f')]);_0x171be3['attributes']=_['intersection'](_0x2e33dc[_0x2d6c('0x2e')],qs[_0x2d6c('0x32')](_0x2b42c1[_0x2d6c('0x2f')][_0x2d6c('0x32')]));_0x171be3[_0x2d6c('0x33')]=_0x171be3[_0x2d6c('0x33')][_0x2d6c('0x34')]?_0x171be3[_0x2d6c('0x33')]:_0x2e33dc[_0x2d6c('0x2e')];if(!_0x2b42c1[_0x2d6c('0x2f')]['hasOwnProperty'](_0x2d6c('0x35'))){_0x171be3[_0x2d6c('0x1c')]=qs['limit'](_0x2b42c1[_0x2d6c('0x2f')]['limit']);_0x171be3[_0x2d6c('0x1a')]=qs[_0x2d6c('0x1a')](_0x2b42c1['query']['offset']);}_0x171be3['order']=qs[_0x2d6c('0x36')](_0x2b42c1['query']['sort']);_0x171be3[_0x2d6c('0x37')]=qs[_0x2d6c('0x31')](_[_0x2d6c('0x38')](_0x2b42c1[_0x2d6c('0x2f')],_0x2e33dc[_0x2d6c('0x31')]),_0x334c48);if(_0x2b42c1[_0x2d6c('0x2f')][_0x2d6c('0x39')]){_0x171be3[_0x2d6c('0x37')]=_[_0x2d6c('0x3a')](_0x171be3[_0x2d6c('0x37')],{'$or':_[_0x2d6c('0x2b')](_0x334c48,function(_0x168655){if(_0x168655[_0x2d6c('0x3b')]!==_0x2d6c('0x3c')){var _0x541da2={};_0x541da2[_0x168655[_0x2d6c('0x28')]]={'$like':'%'+_0x2b42c1['query'][_0x2d6c('0x39')]+'%'};return _0x541da2;}})});}_0x171be3=_[_0x2d6c('0x3a')]({},_0x171be3,_0x2b42c1['options']);var _0x715899={'where':_0x171be3[_0x2d6c('0x37')]};return db[_0x2d6c('0x2c')][_0x2d6c('0x1d')](_0x715899)[_0x2d6c('0x24')](function(_0x41c270){_0x2b584a['count']=_0x41c270;if(_0x2b42c1[_0x2d6c('0x2f')][_0x2d6c('0x3d')]){_0x171be3['include']=[{'all':!![]}];}return db[_0x2d6c('0x2c')]['findAll'](_0x171be3);})[_0x2d6c('0x24')](function(_0x50e5b6){_0x2b584a['rows']=_0x50e5b6;return _0x2b584a;})[_0x2d6c('0x24')](respondWithFilteredResult(_0x298050,_0x171be3))['catch'](handleError(_0x298050,null));};exports['show']=function(_0x299262,_0x81f0ef){var _0x3791d7={'raw':![],'where':{'id':_0x299262[_0x2d6c('0x3e')]['id']}},_0x20c38c={};_0x20c38c[_0x2d6c('0x2e')]=_[_0x2d6c('0x30')](db[_0x2d6c('0x2c')][_0x2d6c('0x2d')]);_0x20c38c['query']=_[_0x2d6c('0x30')](_0x299262[_0x2d6c('0x2f')]);_0x20c38c[_0x2d6c('0x31')]=_[_0x2d6c('0x3f')](_0x20c38c[_0x2d6c('0x2e')],_0x20c38c[_0x2d6c('0x2f')]);_0x3791d7[_0x2d6c('0x33')]=_[_0x2d6c('0x3f')](_0x20c38c[_0x2d6c('0x2e')],qs[_0x2d6c('0x32')](_0x299262[_0x2d6c('0x2f')][_0x2d6c('0x32')]));_0x3791d7[_0x2d6c('0x33')]=_0x3791d7[_0x2d6c('0x33')][_0x2d6c('0x34')]?_0x3791d7[_0x2d6c('0x33')]:_0x20c38c[_0x2d6c('0x2e')];if(_0x299262[_0x2d6c('0x2f')][_0x2d6c('0x3d')]){_0x3791d7[_0x2d6c('0x40')]=[{'all':!![]}];}_0x3791d7=_[_0x2d6c('0x3a')]({},_0x3791d7,_0x299262[_0x2d6c('0x41')]);return db[_0x2d6c('0x2c')][_0x2d6c('0x42')](_0x3791d7)[_0x2d6c('0x24')](handleEntityNotFound(_0x81f0ef,null))['then'](respondWithResult(_0x81f0ef,null))[_0x2d6c('0x43')](handleError(_0x81f0ef,null));};exports['create']=function(_0x394c2b,_0x3aeab0){return db[_0x2d6c('0x2c')][_0x2d6c('0x44')](_0x394c2b[_0x2d6c('0x45')],{})['then'](respondWithResult(_0x3aeab0,0xc9))[_0x2d6c('0x43')](handleError(_0x3aeab0,null));};exports['update']=function(_0x3671ed,_0xf29307){if(_0x3671ed[_0x2d6c('0x45')]['id']){delete _0x3671ed['body']['id'];}return db['ServicenowConfiguration'][_0x2d6c('0x42')]({'where':{'id':_0x3671ed['params']['id']}})['then'](handleEntityNotFound(_0xf29307,null))[_0x2d6c('0x24')](saveUpdates(_0x3671ed[_0x2d6c('0x45')],null))['then'](respondWithResult(_0xf29307,null))[_0x2d6c('0x43')](handleError(_0xf29307,null));};exports['destroy']=function(_0x1df6a2,_0x2c3379){return db[_0x2d6c('0x2c')][_0x2d6c('0x42')]({'where':{'id':_0x1df6a2['params']['id']}})['then'](handleEntityNotFound(_0x2c3379,null))[_0x2d6c('0x24')](removeEntity(_0x2c3379,null))[_0x2d6c('0x43')](handleError(_0x2c3379,null));};exports[_0x2d6c('0x46')]=function(_0x216a91,_0x480a17,_0x138b3f){var _0x1c1da7={};var _0x3d9377={};var _0x3ed8ae;var _0x24f472;return db[_0x2d6c('0x2c')][_0x2d6c('0x47')]({'where':{'id':_0x216a91[_0x2d6c('0x3e')]['id']}})[_0x2d6c('0x24')](handleEntityNotFound(_0x480a17,null))[_0x2d6c('0x24')](function(_0x40fda5){if(_0x40fda5){_0x3ed8ae=_0x40fda5;_0x3d9377[_0x2d6c('0x2e')]=_[_0x2d6c('0x30')](db['ServicenowField'][_0x2d6c('0x2d')]);_0x3d9377[_0x2d6c('0x2f')]=_[_0x2d6c('0x30')](_0x216a91[_0x2d6c('0x2f')]);_0x3d9377['filters']=_[_0x2d6c('0x3f')](_0x3d9377[_0x2d6c('0x2e')],_0x3d9377['query']);_0x1c1da7['attributes']=_[_0x2d6c('0x3f')](_0x3d9377['model'],qs[_0x2d6c('0x32')](_0x216a91['query']['fields']));_0x1c1da7['attributes']=_0x1c1da7[_0x2d6c('0x33')][_0x2d6c('0x34')]?_0x1c1da7[_0x2d6c('0x33')]:_0x3d9377[_0x2d6c('0x2e')];_0x1c1da7[_0x2d6c('0x48')]=qs[_0x2d6c('0x36')](_0x216a91[_0x2d6c('0x2f')][_0x2d6c('0x36')]);_0x1c1da7['where']=qs[_0x2d6c('0x31')](_[_0x2d6c('0x38')](_0x216a91[_0x2d6c('0x2f')],_0x3d9377['filters']));if(_0x216a91[_0x2d6c('0x2f')]['filter']){_0x1c1da7['where']=_[_0x2d6c('0x3a')](_0x1c1da7['where'],{'$or':_[_0x2d6c('0x2b')](_0x1c1da7['attributes'],function(_0x52d289){var _0x236baa={};_0x236baa[_0x52d289]={'$like':'%'+_0x216a91[_0x2d6c('0x2f')][_0x2d6c('0x39')]+'%'};return _0x236baa;})});}_0x1c1da7=_[_0x2d6c('0x3a')]({},_0x1c1da7,_0x216a91[_0x2d6c('0x41')]);return _0x3ed8ae[_0x2d6c('0x46')](_0x1c1da7);}})[_0x2d6c('0x24')](function(_0xe4d51f){if(_0xe4d51f){_0x24f472=_0xe4d51f[_0x2d6c('0x34')];if(!_0x216a91['query'][_0x2d6c('0x49')](_0x2d6c('0x35'))){_0x1c1da7[_0x2d6c('0x1c')]=qs[_0x2d6c('0x1c')](_0x216a91['query'][_0x2d6c('0x1c')]);_0x1c1da7['offset']=qs[_0x2d6c('0x1a')](_0x216a91[_0x2d6c('0x2f')]['offset']);}return _0x3ed8ae[_0x2d6c('0x46')](_0x1c1da7);}})['then'](function(_0x49667c){if(_0x49667c){return _0x49667c?{'count':_0x24f472,'rows':_0x49667c}:null;}})['then'](respondWithResult(_0x480a17,null))[_0x2d6c('0x43')](handleError(_0x480a17,null));};exports[_0x2d6c('0x4a')]=function(_0x57686a,_0x395a13,_0x1e4d9d){var _0x383347={};var _0xf9a157={};var _0x32b671;var _0x28278e;return db[_0x2d6c('0x2c')][_0x2d6c('0x47')]({'where':{'id':_0x57686a['params']['id']}})['then'](handleEntityNotFound(_0x395a13,null))[_0x2d6c('0x24')](function(_0x2d87d6){if(_0x2d87d6){_0x32b671=_0x2d87d6;_0xf9a157[_0x2d6c('0x2e')]=_[_0x2d6c('0x30')](db['ServicenowField'][_0x2d6c('0x2d')]);_0xf9a157[_0x2d6c('0x2f')]=_['keys'](_0x57686a[_0x2d6c('0x2f')]);_0xf9a157[_0x2d6c('0x31')]=_[_0x2d6c('0x3f')](_0xf9a157['model'],_0xf9a157[_0x2d6c('0x2f')]);_0x383347[_0x2d6c('0x33')]=_[_0x2d6c('0x3f')](_0xf9a157[_0x2d6c('0x2e')],qs[_0x2d6c('0x32')](_0x57686a[_0x2d6c('0x2f')][_0x2d6c('0x32')]));_0x383347['attributes']=_0x383347[_0x2d6c('0x33')][_0x2d6c('0x34')]?_0x383347[_0x2d6c('0x33')]:_0xf9a157[_0x2d6c('0x2e')];_0x383347[_0x2d6c('0x48')]=qs[_0x2d6c('0x36')](_0x57686a['query'][_0x2d6c('0x36')]);_0x383347[_0x2d6c('0x37')]=qs[_0x2d6c('0x31')](_[_0x2d6c('0x38')](_0x57686a[_0x2d6c('0x2f')],_0xf9a157[_0x2d6c('0x31')]));if(_0x57686a[_0x2d6c('0x2f')][_0x2d6c('0x39')]){_0x383347[_0x2d6c('0x37')]=_[_0x2d6c('0x3a')](_0x383347[_0x2d6c('0x37')],{'$or':_['map'](_0x383347[_0x2d6c('0x33')],function(_0x220428){var _0x3e3832={};_0x3e3832[_0x220428]={'$like':'%'+_0x57686a['query'][_0x2d6c('0x39')]+'%'};return _0x3e3832;})});}_0x383347=_[_0x2d6c('0x3a')]({},_0x383347,_0x57686a[_0x2d6c('0x41')]);return _0x32b671['getSubjects'](_0x383347);}})[_0x2d6c('0x24')](function(_0x14b460){if(_0x14b460){_0x28278e=_0x14b460[_0x2d6c('0x34')];if(!_0x57686a[_0x2d6c('0x2f')]['hasOwnProperty'](_0x2d6c('0x35'))){_0x383347[_0x2d6c('0x1c')]=qs[_0x2d6c('0x1c')](_0x57686a[_0x2d6c('0x2f')][_0x2d6c('0x1c')]);_0x383347[_0x2d6c('0x1a')]=qs['offset'](_0x57686a[_0x2d6c('0x2f')][_0x2d6c('0x1a')]);}return _0x32b671[_0x2d6c('0x4a')](_0x383347);}})[_0x2d6c('0x24')](function(_0x31f236){if(_0x31f236){return _0x31f236?{'count':_0x28278e,'rows':_0x31f236}:null;}})['then'](respondWithResult(_0x395a13,null))[_0x2d6c('0x43')](handleError(_0x395a13,null));};exports[_0x2d6c('0x4b')]=function(_0x17b8b9,_0x3c02e7,_0x153f39){var _0x3ab516={};var _0x3bfa9a={};var _0x506a0d;var _0x2f64df;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x17b8b9['params']['id']}})[_0x2d6c('0x24')](handleEntityNotFound(_0x3c02e7,null))[_0x2d6c('0x24')](function(_0x4dfbaa){if(_0x4dfbaa){_0x506a0d=_0x4dfbaa;_0x3bfa9a[_0x2d6c('0x2e')]=_['keys'](db[_0x2d6c('0x4c')][_0x2d6c('0x2d')]);_0x3bfa9a[_0x2d6c('0x2f')]=_[_0x2d6c('0x30')](_0x17b8b9[_0x2d6c('0x2f')]);_0x3bfa9a[_0x2d6c('0x31')]=_[_0x2d6c('0x3f')](_0x3bfa9a[_0x2d6c('0x2e')],_0x3bfa9a['query']);_0x3ab516[_0x2d6c('0x33')]=_[_0x2d6c('0x3f')](_0x3bfa9a[_0x2d6c('0x2e')],qs[_0x2d6c('0x32')](_0x17b8b9[_0x2d6c('0x2f')]['fields']));_0x3ab516[_0x2d6c('0x33')]=_0x3ab516[_0x2d6c('0x33')][_0x2d6c('0x34')]?_0x3ab516['attributes']:_0x3bfa9a[_0x2d6c('0x2e')];_0x3ab516['order']=qs['sort'](_0x17b8b9[_0x2d6c('0x2f')][_0x2d6c('0x36')]);_0x3ab516[_0x2d6c('0x37')]=qs[_0x2d6c('0x31')](_[_0x2d6c('0x38')](_0x17b8b9[_0x2d6c('0x2f')],_0x3bfa9a[_0x2d6c('0x31')]));if(_0x17b8b9[_0x2d6c('0x2f')][_0x2d6c('0x39')]){_0x3ab516[_0x2d6c('0x37')]=_[_0x2d6c('0x3a')](_0x3ab516['where'],{'$or':_[_0x2d6c('0x2b')](_0x3ab516[_0x2d6c('0x33')],function(_0x29877b){var _0x48d4ae={};_0x48d4ae[_0x29877b]={'$like':'%'+_0x17b8b9[_0x2d6c('0x2f')][_0x2d6c('0x39')]+'%'};return _0x48d4ae;})});}_0x3ab516=_[_0x2d6c('0x3a')]({},_0x3ab516,_0x17b8b9[_0x2d6c('0x41')]);return _0x506a0d[_0x2d6c('0x4b')](_0x3ab516);}})[_0x2d6c('0x24')](function(_0x2ba70e){if(_0x2ba70e){_0x2f64df=_0x2ba70e[_0x2d6c('0x34')];if(!_0x17b8b9['query'][_0x2d6c('0x49')]('nolimit')){_0x3ab516[_0x2d6c('0x1c')]=qs[_0x2d6c('0x1c')](_0x17b8b9['query'][_0x2d6c('0x1c')]);_0x3ab516[_0x2d6c('0x1a')]=qs[_0x2d6c('0x1a')](_0x17b8b9[_0x2d6c('0x2f')][_0x2d6c('0x1a')]);}return _0x506a0d['getDescriptions'](_0x3ab516);}})['then'](function(_0x4fe97f){if(_0x4fe97f){return _0x4fe97f?{'count':_0x2f64df,'rows':_0x4fe97f}:null;}})['then'](respondWithResult(_0x3c02e7,null))[_0x2d6c('0x43')](handleError(_0x3c02e7,null));}; \ No newline at end of file +var _0xa724=['include','findAll','rows','catch','show','params','find','create','body','getFields','findOne','ServicenowField','fields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','moment','mustache','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','ServicenowConfiguration','includeAll'];(function(_0x1bfc4c,_0x13383e){var _0x141d23=function(_0x15a68c){while(--_0x15a68c){_0x1bfc4c['push'](_0x1bfc4c['shift']());}};_0x141d23(++_0x13383e);}(_0xa724,0xab));var _0x4a72=function(_0x4ee702,_0x2e01c8){_0x4ee702=_0x4ee702-0x0;var _0x1df171=_0xa724[_0x4ee702];return _0x1df171;};'use strict';var emlformat=require(_0x4a72('0x0'));var rimraf=require(_0x4a72('0x1'));var zipdir=require(_0x4a72('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4a72('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4a72('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x4a72('0x5'));var ejs=require(_0x4a72('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4a72('0x7'));var squel=require('squel');var crypto=require(_0x4a72('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x4a72('0x9'));var toCsv=require(_0x4a72('0x5'));var querystring=require(_0x4a72('0xa'));var Papa=require(_0x4a72('0xb'));var Redis=require(_0x4a72('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x4a72('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4a72('0xe'));var logger=require(_0x4a72('0xf'))(_0x4a72('0x10'));var utils=require(_0x4a72('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x4a72('0x12'));var db=require(_0x4a72('0x13'))['db'];function respondWithStatusCode(_0x3c57f7,_0x545321){_0x545321=_0x545321||0xcc;return function(_0x340e59){if(_0x340e59){return _0x3c57f7[_0x4a72('0x14')](_0x545321);}return _0x3c57f7[_0x4a72('0x15')](_0x545321)[_0x4a72('0x16')]();};}function respondWithResult(_0x299a9a,_0x5164bd){_0x5164bd=_0x5164bd||0xc8;return function(_0xac29b){if(_0xac29b){return _0x299a9a['status'](_0x5164bd)[_0x4a72('0x17')](_0xac29b);}};}function respondWithFilteredResult(_0x1da244,_0x185c0e){return function(_0x52fc45){if(_0x52fc45){var _0x26119f=typeof _0x185c0e[_0x4a72('0x18')]===_0x4a72('0x19')&&typeof _0x185c0e['limit']===_0x4a72('0x19');var _0x54ea32=_0x52fc45[_0x4a72('0x1a')];var _0x1e6ca5=_0x26119f?0x0:_0x185c0e[_0x4a72('0x18')];var _0x13b23c=_0x26119f?_0x52fc45[_0x4a72('0x1a')]:_0x185c0e[_0x4a72('0x18')]+_0x185c0e['limit'];var _0x2df11b;if(_0x13b23c>=_0x54ea32){_0x13b23c=_0x54ea32;_0x2df11b=0xc8;}else{_0x2df11b=0xce;}_0x1da244[_0x4a72('0x15')](_0x2df11b);return _0x1da244['set'](_0x4a72('0x1b'),_0x1e6ca5+'-'+_0x13b23c+'/'+_0x54ea32)[_0x4a72('0x17')](_0x52fc45);}return null;};}function patchUpdates(_0x445bd3){return function(_0x416cfb){try{jsonpatch[_0x4a72('0x1c')](_0x416cfb,_0x445bd3,!![]);}catch(_0x4cdecd){return BPromise['reject'](_0x4cdecd);}return _0x416cfb[_0x4a72('0x1d')]();};}function saveUpdates(_0xd35751,_0x16c625){return function(_0x4afee2){if(_0x4afee2){return _0x4afee2[_0x4a72('0x1e')](_0xd35751)[_0x4a72('0x1f')](function(_0x165aed){return _0x165aed;});}return null;};}function removeEntity(_0x2217b0,_0x226ed3){return function(_0x510f22){if(_0x510f22){return _0x510f22[_0x4a72('0x20')]()[_0x4a72('0x1f')](function(){_0x2217b0[_0x4a72('0x15')](0xcc)[_0x4a72('0x16')]();});}};}function handleEntityNotFound(_0x4a9a60,_0xf7dc00){return function(_0x3e985d){if(!_0x3e985d){_0x4a9a60[_0x4a72('0x14')](0x194);}return _0x3e985d;};}function handleError(_0x1e6769,_0x4cb568){_0x4cb568=_0x4cb568||0x1f4;return function(_0x5a1c75){logger[_0x4a72('0x21')](_0x5a1c75[_0x4a72('0x22')]);if(_0x5a1c75[_0x4a72('0x23')]){delete _0x5a1c75[_0x4a72('0x23')];}_0x1e6769[_0x4a72('0x15')](_0x4cb568)[_0x4a72('0x24')](_0x5a1c75);};}exports[_0x4a72('0x25')]=function(_0x1ca776,_0x340eec){var _0x9982ab={},_0x259ea6={},_0x110a40={'count':0x0,'rows':[]};var _0x1f5c85=_[_0x4a72('0x26')](db['ServicenowConfiguration'][_0x4a72('0x27')],function(_0x14ef0d){return{'name':_0x14ef0d[_0x4a72('0x28')],'type':_0x14ef0d[_0x4a72('0x29')][_0x4a72('0x2a')]};});_0x259ea6[_0x4a72('0x2b')]=_[_0x4a72('0x26')](_0x1f5c85,_0x4a72('0x23'));_0x259ea6[_0x4a72('0x2c')]=_[_0x4a72('0x2d')](_0x1ca776['query']);_0x259ea6[_0x4a72('0x2e')]=_['intersection'](_0x259ea6[_0x4a72('0x2b')],_0x259ea6[_0x4a72('0x2c')]);_0x9982ab[_0x4a72('0x2f')]=_[_0x4a72('0x30')](_0x259ea6[_0x4a72('0x2b')],qs['fields'](_0x1ca776['query']['fields']));_0x9982ab['attributes']=_0x9982ab['attributes'][_0x4a72('0x31')]?_0x9982ab['attributes']:_0x259ea6['model'];if(!_0x1ca776[_0x4a72('0x2c')][_0x4a72('0x32')](_0x4a72('0x33'))){_0x9982ab[_0x4a72('0x34')]=qs[_0x4a72('0x34')](_0x1ca776[_0x4a72('0x2c')]['limit']);_0x9982ab[_0x4a72('0x18')]=qs['offset'](_0x1ca776[_0x4a72('0x2c')]['offset']);}_0x9982ab[_0x4a72('0x35')]=qs[_0x4a72('0x36')](_0x1ca776[_0x4a72('0x2c')][_0x4a72('0x36')]);_0x9982ab[_0x4a72('0x37')]=qs[_0x4a72('0x2e')](_[_0x4a72('0x38')](_0x1ca776[_0x4a72('0x2c')],_0x259ea6['filters']),_0x1f5c85);if(_0x1ca776[_0x4a72('0x2c')][_0x4a72('0x39')]){_0x9982ab['where']=_['merge'](_0x9982ab[_0x4a72('0x37')],{'$or':_['map'](_0x1f5c85,function(_0x1e7162){if(_0x1e7162[_0x4a72('0x29')]!==_0x4a72('0x3a')){var _0x190853={};_0x190853[_0x1e7162[_0x4a72('0x23')]]={'$like':'%'+_0x1ca776[_0x4a72('0x2c')][_0x4a72('0x39')]+'%'};return _0x190853;}})});}_0x9982ab=_[_0x4a72('0x3b')]({},_0x9982ab,_0x1ca776[_0x4a72('0x3c')]);var _0x2ce00a={'where':_0x9982ab[_0x4a72('0x37')]};return db[_0x4a72('0x3d')][_0x4a72('0x1a')](_0x2ce00a)[_0x4a72('0x1f')](function(_0x304df0){_0x110a40[_0x4a72('0x1a')]=_0x304df0;if(_0x1ca776[_0x4a72('0x2c')][_0x4a72('0x3e')]){_0x9982ab[_0x4a72('0x3f')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x4a72('0x40')](_0x9982ab);})[_0x4a72('0x1f')](function(_0x7d1cda){_0x110a40[_0x4a72('0x41')]=_0x7d1cda;return _0x110a40;})[_0x4a72('0x1f')](respondWithFilteredResult(_0x340eec,_0x9982ab))[_0x4a72('0x42')](handleError(_0x340eec,null));};exports[_0x4a72('0x43')]=function(_0x269243,_0x3f019b){var _0x45fcd2={'raw':![],'where':{'id':_0x269243[_0x4a72('0x44')]['id']}},_0x1a5592={};_0x1a5592['model']=_['keys'](db[_0x4a72('0x3d')][_0x4a72('0x27')]);_0x1a5592['query']=_[_0x4a72('0x2d')](_0x269243[_0x4a72('0x2c')]);_0x1a5592[_0x4a72('0x2e')]=_[_0x4a72('0x30')](_0x1a5592[_0x4a72('0x2b')],_0x1a5592[_0x4a72('0x2c')]);_0x45fcd2['attributes']=_['intersection'](_0x1a5592[_0x4a72('0x2b')],qs['fields'](_0x269243[_0x4a72('0x2c')]['fields']));_0x45fcd2[_0x4a72('0x2f')]=_0x45fcd2[_0x4a72('0x2f')][_0x4a72('0x31')]?_0x45fcd2['attributes']:_0x1a5592['model'];if(_0x269243[_0x4a72('0x2c')][_0x4a72('0x3e')]){_0x45fcd2['include']=[{'all':!![]}];}_0x45fcd2=_[_0x4a72('0x3b')]({},_0x45fcd2,_0x269243[_0x4a72('0x3c')]);return db[_0x4a72('0x3d')][_0x4a72('0x45')](_0x45fcd2)[_0x4a72('0x1f')](handleEntityNotFound(_0x3f019b,null))[_0x4a72('0x1f')](respondWithResult(_0x3f019b,null))[_0x4a72('0x42')](handleError(_0x3f019b,null));};exports['create']=function(_0x3e7143,_0x25c1cd){return db[_0x4a72('0x3d')][_0x4a72('0x46')](_0x3e7143[_0x4a72('0x47')],{})['then'](respondWithResult(_0x25c1cd,0xc9))[_0x4a72('0x42')](handleError(_0x25c1cd,null));};exports[_0x4a72('0x1e')]=function(_0x5a1bb4,_0x5bc5de){if(_0x5a1bb4[_0x4a72('0x47')]['id']){delete _0x5a1bb4[_0x4a72('0x47')]['id'];}return db[_0x4a72('0x3d')][_0x4a72('0x45')]({'where':{'id':_0x5a1bb4[_0x4a72('0x44')]['id']}})['then'](handleEntityNotFound(_0x5bc5de,null))[_0x4a72('0x1f')](saveUpdates(_0x5a1bb4[_0x4a72('0x47')],null))[_0x4a72('0x1f')](respondWithResult(_0x5bc5de,null))[_0x4a72('0x42')](handleError(_0x5bc5de,null));};exports[_0x4a72('0x20')]=function(_0x30227d,_0x181b45){return db[_0x4a72('0x3d')]['find']({'where':{'id':_0x30227d['params']['id']}})[_0x4a72('0x1f')](handleEntityNotFound(_0x181b45,null))[_0x4a72('0x1f')](removeEntity(_0x181b45,null))['catch'](handleError(_0x181b45,null));};exports[_0x4a72('0x48')]=function(_0x262644,_0x3a49e6,_0x2ec3ab){var _0x14723e={};var _0x3a2122={};var _0x14051a;var _0x533bf4;return db[_0x4a72('0x3d')][_0x4a72('0x49')]({'where':{'id':_0x262644[_0x4a72('0x44')]['id']}})['then'](handleEntityNotFound(_0x3a49e6,null))['then'](function(_0x58e0c2){if(_0x58e0c2){_0x14051a=_0x58e0c2;_0x3a2122[_0x4a72('0x2b')]=_['keys'](db[_0x4a72('0x4a')][_0x4a72('0x27')]);_0x3a2122[_0x4a72('0x2c')]=_[_0x4a72('0x2d')](_0x262644['query']);_0x3a2122['filters']=_[_0x4a72('0x30')](_0x3a2122['model'],_0x3a2122[_0x4a72('0x2c')]);_0x14723e[_0x4a72('0x2f')]=_[_0x4a72('0x30')](_0x3a2122['model'],qs[_0x4a72('0x4b')](_0x262644[_0x4a72('0x2c')]['fields']));_0x14723e[_0x4a72('0x2f')]=_0x14723e[_0x4a72('0x2f')]['length']?_0x14723e[_0x4a72('0x2f')]:_0x3a2122[_0x4a72('0x2b')];_0x14723e['order']=qs[_0x4a72('0x36')](_0x262644[_0x4a72('0x2c')]['sort']);_0x14723e[_0x4a72('0x37')]=qs[_0x4a72('0x2e')](_[_0x4a72('0x38')](_0x262644[_0x4a72('0x2c')],_0x3a2122[_0x4a72('0x2e')]));if(_0x262644['query'][_0x4a72('0x39')]){_0x14723e[_0x4a72('0x37')]=_[_0x4a72('0x3b')](_0x14723e[_0x4a72('0x37')],{'$or':_[_0x4a72('0x26')](_0x14723e[_0x4a72('0x2f')],function(_0x51502f){var _0x4677e7={};_0x4677e7[_0x51502f]={'$like':'%'+_0x262644[_0x4a72('0x2c')][_0x4a72('0x39')]+'%'};return _0x4677e7;})});}_0x14723e=_[_0x4a72('0x3b')]({},_0x14723e,_0x262644['options']);return _0x14051a[_0x4a72('0x48')](_0x14723e);}})[_0x4a72('0x1f')](function(_0x47ccde){if(_0x47ccde){_0x533bf4=_0x47ccde[_0x4a72('0x31')];if(!_0x262644[_0x4a72('0x2c')][_0x4a72('0x32')](_0x4a72('0x33'))){_0x14723e[_0x4a72('0x34')]=qs[_0x4a72('0x34')](_0x262644[_0x4a72('0x2c')][_0x4a72('0x34')]);_0x14723e[_0x4a72('0x18')]=qs[_0x4a72('0x18')](_0x262644['query'][_0x4a72('0x18')]);}return _0x14051a[_0x4a72('0x48')](_0x14723e);}})[_0x4a72('0x1f')](function(_0x5dcb04){if(_0x5dcb04){return _0x5dcb04?{'count':_0x533bf4,'rows':_0x5dcb04}:null;}})[_0x4a72('0x1f')](respondWithResult(_0x3a49e6,null))[_0x4a72('0x42')](handleError(_0x3a49e6,null));};exports['getSubjects']=function(_0x289009,_0x28c2ae,_0x41ec3d){var _0x53b7ac={};var _0x5de280={};var _0x594a99;var _0x43bf32;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x289009[_0x4a72('0x44')]['id']}})[_0x4a72('0x1f')](handleEntityNotFound(_0x28c2ae,null))['then'](function(_0x10215e){if(_0x10215e){_0x594a99=_0x10215e;_0x5de280[_0x4a72('0x2b')]=_[_0x4a72('0x2d')](db[_0x4a72('0x4a')][_0x4a72('0x27')]);_0x5de280[_0x4a72('0x2c')]=_['keys'](_0x289009[_0x4a72('0x2c')]);_0x5de280[_0x4a72('0x2e')]=_[_0x4a72('0x30')](_0x5de280[_0x4a72('0x2b')],_0x5de280['query']);_0x53b7ac[_0x4a72('0x2f')]=_[_0x4a72('0x30')](_0x5de280['model'],qs['fields'](_0x289009[_0x4a72('0x2c')][_0x4a72('0x4b')]));_0x53b7ac['attributes']=_0x53b7ac[_0x4a72('0x2f')]['length']?_0x53b7ac[_0x4a72('0x2f')]:_0x5de280[_0x4a72('0x2b')];_0x53b7ac[_0x4a72('0x35')]=qs[_0x4a72('0x36')](_0x289009[_0x4a72('0x2c')][_0x4a72('0x36')]);_0x53b7ac[_0x4a72('0x37')]=qs[_0x4a72('0x2e')](_[_0x4a72('0x38')](_0x289009[_0x4a72('0x2c')],_0x5de280[_0x4a72('0x2e')]));if(_0x289009['query']['filter']){_0x53b7ac[_0x4a72('0x37')]=_[_0x4a72('0x3b')](_0x53b7ac['where'],{'$or':_[_0x4a72('0x26')](_0x53b7ac[_0x4a72('0x2f')],function(_0x8232b9){var _0x1aa325={};_0x1aa325[_0x8232b9]={'$like':'%'+_0x289009['query']['filter']+'%'};return _0x1aa325;})});}_0x53b7ac=_[_0x4a72('0x3b')]({},_0x53b7ac,_0x289009['options']);return _0x594a99[_0x4a72('0x4c')](_0x53b7ac);}})[_0x4a72('0x1f')](function(_0x97ff63){if(_0x97ff63){_0x43bf32=_0x97ff63[_0x4a72('0x31')];if(!_0x289009[_0x4a72('0x2c')][_0x4a72('0x32')](_0x4a72('0x33'))){_0x53b7ac[_0x4a72('0x34')]=qs[_0x4a72('0x34')](_0x289009['query']['limit']);_0x53b7ac[_0x4a72('0x18')]=qs[_0x4a72('0x18')](_0x289009['query'][_0x4a72('0x18')]);}return _0x594a99[_0x4a72('0x4c')](_0x53b7ac);}})[_0x4a72('0x1f')](function(_0x538416){if(_0x538416){return _0x538416?{'count':_0x43bf32,'rows':_0x538416}:null;}})[_0x4a72('0x1f')](respondWithResult(_0x28c2ae,null))[_0x4a72('0x42')](handleError(_0x28c2ae,null));};exports[_0x4a72('0x4d')]=function(_0x2896f2,_0x510e2d,_0x5e5ec9){var _0x43cd50={};var _0x5209ed={};var _0x46c4b2;var _0x3ec6c2;return db[_0x4a72('0x3d')][_0x4a72('0x49')]({'where':{'id':_0x2896f2['params']['id']}})['then'](handleEntityNotFound(_0x510e2d,null))[_0x4a72('0x1f')](function(_0x12db7b){if(_0x12db7b){_0x46c4b2=_0x12db7b;_0x5209ed[_0x4a72('0x2b')]=_['keys'](db[_0x4a72('0x4a')][_0x4a72('0x27')]);_0x5209ed[_0x4a72('0x2c')]=_[_0x4a72('0x2d')](_0x2896f2['query']);_0x5209ed['filters']=_[_0x4a72('0x30')](_0x5209ed['model'],_0x5209ed[_0x4a72('0x2c')]);_0x43cd50[_0x4a72('0x2f')]=_[_0x4a72('0x30')](_0x5209ed['model'],qs['fields'](_0x2896f2[_0x4a72('0x2c')][_0x4a72('0x4b')]));_0x43cd50[_0x4a72('0x2f')]=_0x43cd50[_0x4a72('0x2f')][_0x4a72('0x31')]?_0x43cd50['attributes']:_0x5209ed[_0x4a72('0x2b')];_0x43cd50['order']=qs['sort'](_0x2896f2['query'][_0x4a72('0x36')]);_0x43cd50['where']=qs['filters'](_[_0x4a72('0x38')](_0x2896f2[_0x4a72('0x2c')],_0x5209ed[_0x4a72('0x2e')]));if(_0x2896f2[_0x4a72('0x2c')][_0x4a72('0x39')]){_0x43cd50[_0x4a72('0x37')]=_['merge'](_0x43cd50[_0x4a72('0x37')],{'$or':_[_0x4a72('0x26')](_0x43cd50[_0x4a72('0x2f')],function(_0x356a06){var _0x401163={};_0x401163[_0x356a06]={'$like':'%'+_0x2896f2[_0x4a72('0x2c')][_0x4a72('0x39')]+'%'};return _0x401163;})});}_0x43cd50=_[_0x4a72('0x3b')]({},_0x43cd50,_0x2896f2[_0x4a72('0x3c')]);return _0x46c4b2[_0x4a72('0x4d')](_0x43cd50);}})[_0x4a72('0x1f')](function(_0x1620b7){if(_0x1620b7){_0x3ec6c2=_0x1620b7[_0x4a72('0x31')];if(!_0x2896f2['query']['hasOwnProperty'](_0x4a72('0x33'))){_0x43cd50[_0x4a72('0x34')]=qs[_0x4a72('0x34')](_0x2896f2[_0x4a72('0x2c')][_0x4a72('0x34')]);_0x43cd50[_0x4a72('0x18')]=qs[_0x4a72('0x18')](_0x2896f2[_0x4a72('0x2c')]['offset']);}return _0x46c4b2[_0x4a72('0x4d')](_0x43cd50);}})[_0x4a72('0x1f')](function(_0x32b1ab){if(_0x32b1ab){return _0x32b1ab?{'count':_0x3ec6c2,'rows':_0x32b1ab}:null;}})[_0x4a72('0x1f')](respondWithResult(_0x510e2d,null))[_0x4a72('0x42')](handleError(_0x510e2d,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 06d4ac2..18e85c6 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 _0xfef3=['./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x1131d6,_0x11257a){var _0x3a4e6e=function(_0x21acf7){while(--_0x21acf7){_0x1131d6['push'](_0x1131d6['shift']());}};_0x3a4e6e(++_0x11257a);}(_0xfef3,0x118));var _0x3fef=function(_0x11a7c9,_0x2de6e8){_0x11a7c9=_0x11a7c9-0x0;var _0x2bf3d8=_0xfef3[_0x11a7c9];return _0x2bf3d8;};'use strict';var _=require(_0x3fef('0x0'));var util=require('util');var logger=require(_0x3fef('0x1'))('api');var moment=require(_0x3fef('0x2'));var BPromise=require(_0x3fef('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3fef('0x4'));var rimraf=require(_0x3fef('0x5'));var config=require('../../config/environment');var attributes=require(_0x3fef('0x6'));module[_0x3fef('0x7')]=function(_0x5dd9fb,_0x319a2a){return _0x5dd9fb[_0x3fef('0x8')](_0x3fef('0x9'),attributes,{'tableName':_0x3fef('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ba6=['bluebird','request-promise','path','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','../../config/logger','moment'];(function(_0x5b06b8,_0x4445d9){var _0x34102d=function(_0x26da13){while(--_0x26da13){_0x5b06b8['push'](_0x5b06b8['shift']());}};_0x34102d(++_0x4445d9);}(_0x8ba6,0x11b));var _0x68ba=function(_0x55dbcb,_0x40e02a){_0x55dbcb=_0x55dbcb-0x0;var _0xe66167=_0x8ba6[_0x55dbcb];return _0xe66167;};'use strict';var _=require(_0x68ba('0x0'));var util=require('util');var logger=require(_0x68ba('0x1'))('api');var moment=require(_0x68ba('0x2'));var BPromise=require(_0x68ba('0x3'));var rp=require(_0x68ba('0x4'));var fs=require('fs');var path=require(_0x68ba('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x68ba('0x6'));module[_0x68ba('0x7')]=function(_0x14f5f6,_0x183957){return _0x14f5f6[_0x68ba('0x8')](_0x68ba('0x9'),attributes,{'tableName':_0x68ba('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index de5e255..bb9f318 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 _0xb032=['then','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0xb032,0x84));var _0x2b03=function(_0x5e9a69,_0x40c0ec){_0x5e9a69=_0x5e9a69-0x0;var _0x5979c8=_0xb032[_0x5e9a69];return _0x5979c8;};'use strict';var _=require(_0x2b03('0x0'));var util=require('util');var moment=require(_0x2b03('0x1'));var BPromise=require(_0x2b03('0x2'));var rs=require(_0x2b03('0x3'));var fs=require('fs');var Redis=require(_0x2b03('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2b03('0x5'));var logger=require(_0x2b03('0x6'))(_0x2b03('0x7'));var config=require(_0x2b03('0x8'));var jayson=require(_0x2b03('0x9'));var client=jayson[_0x2b03('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14db2a,_0x2f811b,_0x369212){return new BPromise(function(_0x24cc52,_0x4df225){return client[_0x2b03('0xb')](_0x14db2a,_0x369212)[_0x2b03('0xc')](function(_0xe323d6){logger['info'](_0x2b03('0xd'),_0x2f811b,_0x2b03('0xe'));logger[_0x2b03('0xf')](_0x2b03('0x10'),_0x2f811b,_0x2b03('0xe'),JSON[_0x2b03('0x11')](_0xe323d6));if(_0xe323d6[_0x2b03('0x12')]){if(_0xe323d6[_0x2b03('0x12')][_0x2b03('0x13')]===0x1f4){logger[_0x2b03('0x12')](_0x2b03('0xd'),_0x2f811b,_0xe323d6['error'][_0x2b03('0x14')]);return _0x4df225(_0xe323d6[_0x2b03('0x12')][_0x2b03('0x14')]);}logger[_0x2b03('0x12')](_0x2b03('0xd'),_0x2f811b,_0xe323d6[_0x2b03('0x12')][_0x2b03('0x14')]);return _0x24cc52(_0xe323d6[_0x2b03('0x12')][_0x2b03('0x14')]);}else{logger[_0x2b03('0x15')](_0x2b03('0xd'),_0x2f811b,_0x2b03('0xe'));_0x24cc52(_0xe323d6[_0x2b03('0x16')][_0x2b03('0x14')]);}})[_0x2b03('0x17')](function(_0x1bb2b7){logger[_0x2b03('0x12')](_0x2b03('0xd'),_0x2f811b,_0x1bb2b7);_0x4df225(_0x1bb2b7);});});} \ No newline at end of file +var _0x598f=['ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x28bc89,_0x1edcd4){var _0x31aaa2=function(_0x3182a8){while(--_0x3182a8){_0x28bc89['push'](_0x28bc89['shift']());}};_0x31aaa2(++_0x1edcd4);}(_0x598f,0x1cf));var _0xf598=function(_0x4e5eff,_0x2926a9){_0x4e5eff=_0x4e5eff-0x0;var _0x256654=_0x598f[_0x4e5eff];return _0x256654;};'use strict';var _=require(_0xf598('0x0'));var util=require(_0xf598('0x1'));var moment=require(_0xf598('0x2'));var BPromise=require(_0xf598('0x3'));var rs=require(_0xf598('0x4'));var fs=require('fs');var Redis=require(_0xf598('0x5'));var db=require(_0xf598('0x6'))['db'];var utils=require(_0xf598('0x7'));var logger=require(_0xf598('0x8'))(_0xf598('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf598('0xa')][_0xf598('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3583f1,_0x1ce068,_0x8141e){return new BPromise(function(_0x2eebae,_0x5ca40f){return client[_0xf598('0xc')](_0x3583f1,_0x8141e)['then'](function(_0x475ddf){logger[_0xf598('0xd')](_0xf598('0xe'),_0x1ce068,_0xf598('0xf'));logger[_0xf598('0x10')](_0xf598('0x11'),_0x1ce068,_0xf598('0xf'),JSON[_0xf598('0x12')](_0x475ddf));if(_0x475ddf['error']){if(_0x475ddf[_0xf598('0x13')][_0xf598('0x14')]===0x1f4){logger[_0xf598('0x13')](_0xf598('0xe'),_0x1ce068,_0x475ddf[_0xf598('0x13')]['message']);return _0x5ca40f(_0x475ddf['error'][_0xf598('0x15')]);}logger[_0xf598('0x13')](_0xf598('0xe'),_0x1ce068,_0x475ddf[_0xf598('0x13')][_0xf598('0x15')]);return _0x2eebae(_0x475ddf['error'][_0xf598('0x15')]);}else{logger[_0xf598('0xd')](_0xf598('0xe'),_0x1ce068,_0xf598('0xf'));_0x2eebae(_0x475ddf[_0xf598('0x16')]['message']);}})[_0xf598('0x17')](function(_0x23824d){logger[_0xf598('0x13')](_0xf598('0xe'),_0x1ce068,_0x23824d);_0x5ca40f(_0x23824d);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 4e1e970..296cf12 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 _0xdd07=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','create','put','update','delete','multer','util'];(function(_0x4a9475,_0x59726c){var _0x250070=function(_0x5b13c4){while(--_0x5b13c4){_0x4a9475['push'](_0x4a9475['shift']());}};_0x250070(++_0x59726c);}(_0xdd07,0xb9));var _0x7dd0=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xdd07[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x7dd0('0x0'));var util=require(_0x7dd0('0x1'));var path=require('path');var timeout=require(_0x7dd0('0x2'));var express=require('express');var router=express[_0x7dd0('0x3')]();var fs_extra=require(_0x7dd0('0x4'));var auth=require(_0x7dd0('0x5'));var interaction=require(_0x7dd0('0x6'));var config=require(_0x7dd0('0x7'));var controller=require(_0x7dd0('0x8'));router[_0x7dd0('0x9')]('/',auth[_0x7dd0('0xa')](),controller[_0x7dd0('0xb')]);router[_0x7dd0('0x9')](_0x7dd0('0xc'),auth[_0x7dd0('0xa')](),controller['show']);router['post']('/',auth[_0x7dd0('0xa')](),controller[_0x7dd0('0xd')]);router[_0x7dd0('0xe')]('/:id',auth[_0x7dd0('0xa')](),controller[_0x7dd0('0xf')]);router[_0x7dd0('0x10')](_0x7dd0('0xc'),auth[_0x7dd0('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x8fcb=['update','delete','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','post','create','put'];(function(_0x2996f5,_0x37d2f6){var _0x41c2cf=function(_0x550892){while(--_0x550892){_0x2996f5['push'](_0x2996f5['shift']());}};_0x41c2cf(++_0x37d2f6);}(_0x8fcb,0xa5));var _0xb8fc=function(_0x18b69b,_0x54a37b){_0x18b69b=_0x18b69b-0x0;var _0x1ed8cc=_0x8fcb[_0x18b69b];return _0x1ed8cc;};'use strict';var multer=require(_0xb8fc('0x0'));var util=require('util');var path=require(_0xb8fc('0x1'));var timeout=require(_0xb8fc('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb8fc('0x3'));var auth=require(_0xb8fc('0x4'));var interaction=require(_0xb8fc('0x5'));var config=require(_0xb8fc('0x6'));var controller=require(_0xb8fc('0x7'));router[_0xb8fc('0x8')]('/',auth[_0xb8fc('0x9')](),controller[_0xb8fc('0xa')]);router[_0xb8fc('0x8')](_0xb8fc('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xb8fc('0xc')]('/',auth['isAuthenticated'](),controller[_0xb8fc('0xd')]);router[_0xb8fc('0xe')](_0xb8fc('0xb'),auth['isAuthenticated'](),controller[_0xb8fc('0xf')]);router[_0xb8fc('0x10')]('/:id',auth[_0xb8fc('0x9')](),controller['destroy']);module[_0xb8fc('0x11')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 413d45f..d9415ac 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 _0x9afa=['picklist','STRING','ENUM','string','sequelize','exports','customVariable','keyValue'];(function(_0x123f8e,_0x4c3886){var _0x53782c=function(_0x3b5ad4){while(--_0x3b5ad4){_0x123f8e['push'](_0x123f8e['shift']());}};_0x53782c(++_0x4c3886);}(_0x9afa,0x1d4));var _0xa9af=function(_0x59fa5c,_0x46020a){_0x59fa5c=_0x59fa5c-0x0;var _0x1d12ee=_0x9afa[_0x59fa5c];return _0x1d12ee;};'use strict';var Sequelize=require(_0xa9af('0x0'));module[_0xa9af('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable',_0xa9af('0x2'),_0xa9af('0x3'),_0xa9af('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xa9af('0x5')]},'key':{'type':Sequelize[_0xa9af('0x5')]},'keyType':{'type':Sequelize[_0xa9af('0x6')](_0xa9af('0x7'),'variable',_0xa9af('0x2'))},'keyContent':{'type':Sequelize[_0xa9af('0x5')]},'idField':{'type':Sequelize[_0xa9af('0x5')]},'nameField':{'type':Sequelize[_0xa9af('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe1c4=['keyValue','picklist','string','STRING','variable','BOOLEAN','sequelize','exports','ENUM','customVariable'];(function(_0x4e2108,_0x22bb3b){var _0x5d7c77=function(_0x30896c){while(--_0x30896c){_0x4e2108['push'](_0x4e2108['shift']());}};_0x5d7c77(++_0x22bb3b);}(_0xe1c4,0x196));var _0x4e1c=function(_0x3477c4,_0x309176){_0x3477c4=_0x3477c4-0x0;var _0xb1b1b5=_0xe1c4[_0x3477c4];return _0xb1b1b5;};'use strict';var Sequelize=require(_0x4e1c('0x0'));module[_0x4e1c('0x1')]={'type':{'type':Sequelize[_0x4e1c('0x2')]('string','variable',_0x4e1c('0x3'),_0x4e1c('0x4'),_0x4e1c('0x5')),'defaultValue':_0x4e1c('0x6')},'content':{'type':Sequelize[_0x4e1c('0x7')]},'key':{'type':Sequelize[_0x4e1c('0x7')]},'keyType':{'type':Sequelize[_0x4e1c('0x2')](_0x4e1c('0x6'),_0x4e1c('0x8'),'customVariable')},'keyContent':{'type':Sequelize[_0x4e1c('0x7')]},'idField':{'type':Sequelize[_0x4e1c('0x7')]},'nameField':{'type':Sequelize[_0x4e1c('0x7')]},'customField':{'type':Sequelize[_0x4e1c('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4e1c('0x7')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 5946475..8eaf014 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 _0xb464=['attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','include','findAll','rows','catch','show','params','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0xb464,0x1e4));var _0x4b46=function(_0x38fb0d,_0x52b5db){_0x38fb0d=_0x38fb0d-0x0;var _0x30a5d6=_0xb464[_0x38fb0d];return _0x30a5d6;};'use strict';var emlformat=require(_0x4b46('0x0'));var rimraf=require(_0x4b46('0x1'));var zipdir=require(_0x4b46('0x2'));var jsonpatch=require(_0x4b46('0x3'));var rp=require(_0x4b46('0x4'));var moment=require('moment');var BPromise=require(_0x4b46('0x5'));var Mustache=require(_0x4b46('0x6'));var util=require(_0x4b46('0x7'));var path=require(_0x4b46('0x8'));var sox=require(_0x4b46('0x9'));var csv=require(_0x4b46('0xa'));var ejs=require(_0x4b46('0xb'));var fs=require('fs');var fs_extra=require(_0x4b46('0xc'));var _=require('lodash');var squel=require(_0x4b46('0xd'));var crypto=require(_0x4b46('0xe'));var jsforce=require(_0x4b46('0xf'));var deskjs=require(_0x4b46('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4b46('0x11'));var Redis=require(_0x4b46('0x12'));var authService=require(_0x4b46('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4b46('0x14'));var logger=require(_0x4b46('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x4b46('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x4b46('0x17'))['db'];function respondWithStatusCode(_0x2b8d93,_0x5a8cde){_0x5a8cde=_0x5a8cde||0xcc;return function(_0xf75edd){if(_0xf75edd){return _0x2b8d93[_0x4b46('0x18')](_0x5a8cde);}return _0x2b8d93['status'](_0x5a8cde)[_0x4b46('0x19')]();};}function respondWithResult(_0x1a4c89,_0x38eb68){_0x38eb68=_0x38eb68||0xc8;return function(_0x581226){if(_0x581226){return _0x1a4c89[_0x4b46('0x1a')](_0x38eb68)[_0x4b46('0x1b')](_0x581226);}};}function respondWithFilteredResult(_0x45f613,_0x5c6d32){return function(_0x3de9e9){if(_0x3de9e9){var _0x652ec2=typeof _0x5c6d32[_0x4b46('0x1c')]===_0x4b46('0x1d')&&typeof _0x5c6d32[_0x4b46('0x1e')]===_0x4b46('0x1d');var _0x46ead8=_0x3de9e9['count'];var _0x3e97cf=_0x652ec2?0x0:_0x5c6d32[_0x4b46('0x1c')];var _0x967735=_0x652ec2?_0x3de9e9['count']:_0x5c6d32[_0x4b46('0x1c')]+_0x5c6d32['limit'];var _0x44495b;if(_0x967735>=_0x46ead8){_0x967735=_0x46ead8;_0x44495b=0xc8;}else{_0x44495b=0xce;}_0x45f613[_0x4b46('0x1a')](_0x44495b);return _0x45f613[_0x4b46('0x1f')](_0x4b46('0x20'),_0x3e97cf+'-'+_0x967735+'/'+_0x46ead8)[_0x4b46('0x1b')](_0x3de9e9);}return null;};}function patchUpdates(_0x425767){return function(_0x32115b){try{jsonpatch[_0x4b46('0x21')](_0x32115b,_0x425767,!![]);}catch(_0x5eeaf1){return BPromise[_0x4b46('0x22')](_0x5eeaf1);}return _0x32115b[_0x4b46('0x23')]();};}function saveUpdates(_0x118eb3,_0x21c761){return function(_0x2af835){if(_0x2af835){return _0x2af835[_0x4b46('0x24')](_0x118eb3)[_0x4b46('0x25')](function(_0x1fda19){return _0x1fda19;});}return null;};}function removeEntity(_0x274928,_0x3ba4d1){return function(_0x5a537c){if(_0x5a537c){return _0x5a537c[_0x4b46('0x26')]()['then'](function(){_0x274928[_0x4b46('0x1a')](0xcc)[_0x4b46('0x19')]();});}};}function handleEntityNotFound(_0x1a1cd8,_0x6a30fd){return function(_0x4d8b50){if(!_0x4d8b50){_0x1a1cd8[_0x4b46('0x18')](0x194);}return _0x4d8b50;};}function handleError(_0x319ec9,_0x5dd5c2){_0x5dd5c2=_0x5dd5c2||0x1f4;return function(_0x1ea841){logger[_0x4b46('0x27')](_0x1ea841[_0x4b46('0x28')]);if(_0x1ea841[_0x4b46('0x29')]){delete _0x1ea841[_0x4b46('0x29')];}_0x319ec9['status'](_0x5dd5c2)[_0x4b46('0x2a')](_0x1ea841);};}exports[_0x4b46('0x2b')]=function(_0x3316c9,_0xda11cd){var _0x29b13c={},_0x2e6b0c={},_0x1774cd={'count':0x0,'rows':[]};var _0x3831ab=_[_0x4b46('0x2c')](db[_0x4b46('0x2d')][_0x4b46('0x2e')],function(_0x339c7d){return{'name':_0x339c7d[_0x4b46('0x2f')],'type':_0x339c7d[_0x4b46('0x30')][_0x4b46('0x31')]};});_0x2e6b0c['model']=_['map'](_0x3831ab,_0x4b46('0x29'));_0x2e6b0c[_0x4b46('0x32')]=_[_0x4b46('0x33')](_0x3316c9[_0x4b46('0x32')]);_0x2e6b0c[_0x4b46('0x34')]=_[_0x4b46('0x35')](_0x2e6b0c[_0x4b46('0x36')],_0x2e6b0c[_0x4b46('0x32')]);_0x29b13c[_0x4b46('0x37')]=_[_0x4b46('0x35')](_0x2e6b0c[_0x4b46('0x36')],qs[_0x4b46('0x38')](_0x3316c9[_0x4b46('0x32')]['fields']));_0x29b13c[_0x4b46('0x37')]=_0x29b13c[_0x4b46('0x37')]['length']?_0x29b13c['attributes']:_0x2e6b0c[_0x4b46('0x36')];if(!_0x3316c9[_0x4b46('0x32')][_0x4b46('0x39')](_0x4b46('0x3a'))){_0x29b13c[_0x4b46('0x1e')]=qs[_0x4b46('0x1e')](_0x3316c9[_0x4b46('0x32')]['limit']);_0x29b13c['offset']=qs['offset'](_0x3316c9['query']['offset']);}_0x29b13c[_0x4b46('0x3b')]=qs[_0x4b46('0x3c')](_0x3316c9[_0x4b46('0x32')][_0x4b46('0x3c')]);_0x29b13c[_0x4b46('0x3d')]=qs['filters'](_['pick'](_0x3316c9[_0x4b46('0x32')],_0x2e6b0c[_0x4b46('0x34')]),_0x3831ab);if(_0x3316c9[_0x4b46('0x32')][_0x4b46('0x3e')]){_0x29b13c['where']=_[_0x4b46('0x3f')](_0x29b13c[_0x4b46('0x3d')],{'$or':_[_0x4b46('0x2c')](_0x3831ab,function(_0x14b238){if(_0x14b238[_0x4b46('0x30')]!==_0x4b46('0x40')){var _0x445fa0={};_0x445fa0[_0x14b238[_0x4b46('0x29')]]={'$like':'%'+_0x3316c9['query']['filter']+'%'};return _0x445fa0;}})});}_0x29b13c=_[_0x4b46('0x3f')]({},_0x29b13c,_0x3316c9[_0x4b46('0x41')]);var _0xfe3f2={'where':_0x29b13c[_0x4b46('0x3d')]};return db[_0x4b46('0x2d')][_0x4b46('0x42')](_0xfe3f2)['then'](function(_0x5de03a){_0x1774cd[_0x4b46('0x42')]=_0x5de03a;if(_0x3316c9[_0x4b46('0x32')]['includeAll']){_0x29b13c[_0x4b46('0x43')]=[{'all':!![]}];}return db[_0x4b46('0x2d')][_0x4b46('0x44')](_0x29b13c);})['then'](function(_0xb96090){_0x1774cd[_0x4b46('0x45')]=_0xb96090;return _0x1774cd;})[_0x4b46('0x25')](respondWithFilteredResult(_0xda11cd,_0x29b13c))[_0x4b46('0x46')](handleError(_0xda11cd,null));};exports[_0x4b46('0x47')]=function(_0xc31ca5,_0x2373fa){var _0x260759={'raw':!![],'where':{'id':_0xc31ca5[_0x4b46('0x48')]['id']}},_0x1c75dc={};_0x1c75dc['model']=_[_0x4b46('0x33')](db[_0x4b46('0x2d')][_0x4b46('0x2e')]);_0x1c75dc[_0x4b46('0x32')]=_[_0x4b46('0x33')](_0xc31ca5[_0x4b46('0x32')]);_0x1c75dc['filters']=_[_0x4b46('0x35')](_0x1c75dc['model'],_0x1c75dc[_0x4b46('0x32')]);_0x260759[_0x4b46('0x37')]=_[_0x4b46('0x35')](_0x1c75dc['model'],qs['fields'](_0xc31ca5[_0x4b46('0x32')][_0x4b46('0x38')]));_0x260759['attributes']=_0x260759[_0x4b46('0x37')][_0x4b46('0x49')]?_0x260759[_0x4b46('0x37')]:_0x1c75dc[_0x4b46('0x36')];if(_0xc31ca5[_0x4b46('0x32')]['includeAll']){_0x260759[_0x4b46('0x43')]=[{'all':!![]}];}_0x260759=_[_0x4b46('0x3f')]({},_0x260759,_0xc31ca5[_0x4b46('0x41')]);return db[_0x4b46('0x2d')][_0x4b46('0x4a')](_0x260759)['then'](handleEntityNotFound(_0x2373fa,null))[_0x4b46('0x25')](respondWithResult(_0x2373fa,null))[_0x4b46('0x46')](handleError(_0x2373fa,null));};exports[_0x4b46('0x4b')]=function(_0x1f100b,_0x51a617){return db[_0x4b46('0x2d')][_0x4b46('0x4b')](_0x1f100b[_0x4b46('0x4c')],{})[_0x4b46('0x25')](respondWithResult(_0x51a617,0xc9))[_0x4b46('0x46')](handleError(_0x51a617,null));};exports[_0x4b46('0x24')]=function(_0x2989e2,_0x162828){if(_0x2989e2[_0x4b46('0x4c')]['id']){delete _0x2989e2[_0x4b46('0x4c')]['id'];}return db[_0x4b46('0x2d')][_0x4b46('0x4a')]({'where':{'id':_0x2989e2[_0x4b46('0x48')]['id']}})[_0x4b46('0x25')](handleEntityNotFound(_0x162828,null))[_0x4b46('0x25')](saveUpdates(_0x2989e2['body'],null))['then'](respondWithResult(_0x162828,null))[_0x4b46('0x46')](handleError(_0x162828,null));};exports[_0x4b46('0x26')]=function(_0x323bc6,_0xbb9541){return db[_0x4b46('0x2d')][_0x4b46('0x4a')]({'where':{'id':_0x323bc6['params']['id']}})[_0x4b46('0x25')](handleEntityNotFound(_0xbb9541,null))[_0x4b46('0x25')](removeEntity(_0xbb9541,null))[_0x4b46('0x46')](handleError(_0xbb9541,null));}; \ No newline at end of file +var _0xb7a7=['sort','where','pick','filter','VIRTUAL','merge','include','findAll','catch','params','length','includeAll','options','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit'];(function(_0x45c50f,_0x59d3ed){var _0x4f8476=function(_0x4eb78d){while(--_0x4eb78d){_0x45c50f['push'](_0x45c50f['shift']());}};_0x4f8476(++_0x59d3ed);}(_0xb7a7,0x1cc));var _0x7b7a=function(_0x43af85,_0x275b44){_0x43af85=_0x43af85-0x0;var _0x55aca2=_0xb7a7[_0x43af85];return _0x55aca2;};'use strict';var emlformat=require(_0x7b7a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7b7a('0x1'));var jsonpatch=require(_0x7b7a('0x2'));var rp=require(_0x7b7a('0x3'));var moment=require(_0x7b7a('0x4'));var BPromise=require(_0x7b7a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7b7a('0x6'));var sox=require(_0x7b7a('0x7'));var csv=require(_0x7b7a('0x8'));var ejs=require(_0x7b7a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7b7a('0xa'));var squel=require('squel');var crypto=require(_0x7b7a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7b7a('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7b7a('0xd'));var Redis=require(_0x7b7a('0xe'));var authService=require(_0x7b7a('0xf'));var qs=require(_0x7b7a('0x10'));var as=require(_0x7b7a('0x11'));var hardwareService=require(_0x7b7a('0x12'));var logger=require(_0x7b7a('0x13'))(_0x7b7a('0x14'));var utils=require(_0x7b7a('0x15'));var config=require(_0x7b7a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x7b7a('0x17'))['db'];function respondWithStatusCode(_0x1cbcdb,_0x2cdbb5){_0x2cdbb5=_0x2cdbb5||0xcc;return function(_0x25b0d6){if(_0x25b0d6){return _0x1cbcdb[_0x7b7a('0x18')](_0x2cdbb5);}return _0x1cbcdb[_0x7b7a('0x19')](_0x2cdbb5)[_0x7b7a('0x1a')]();};}function respondWithResult(_0x3ec8b1,_0x3c1da6){_0x3c1da6=_0x3c1da6||0xc8;return function(_0x206cf5){if(_0x206cf5){return _0x3ec8b1[_0x7b7a('0x19')](_0x3c1da6)['json'](_0x206cf5);}};}function respondWithFilteredResult(_0x48822c,_0x30025b){return function(_0x2ee6bf){if(_0x2ee6bf){var _0x40a96c=typeof _0x30025b[_0x7b7a('0x1b')]===_0x7b7a('0x1c')&&typeof _0x30025b[_0x7b7a('0x1d')]===_0x7b7a('0x1c');var _0x56394b=_0x2ee6bf[_0x7b7a('0x1e')];var _0xb2405a=_0x40a96c?0x0:_0x30025b[_0x7b7a('0x1b')];var _0x5c82c8=_0x40a96c?_0x2ee6bf['count']:_0x30025b[_0x7b7a('0x1b')]+_0x30025b[_0x7b7a('0x1d')];var _0x5544a4;if(_0x5c82c8>=_0x56394b){_0x5c82c8=_0x56394b;_0x5544a4=0xc8;}else{_0x5544a4=0xce;}_0x48822c[_0x7b7a('0x19')](_0x5544a4);return _0x48822c[_0x7b7a('0x1f')](_0x7b7a('0x20'),_0xb2405a+'-'+_0x5c82c8+'/'+_0x56394b)[_0x7b7a('0x21')](_0x2ee6bf);}return null;};}function patchUpdates(_0x2009eb){return function(_0x508176){try{jsonpatch['apply'](_0x508176,_0x2009eb,!![]);}catch(_0x3c874a){return BPromise[_0x7b7a('0x22')](_0x3c874a);}return _0x508176[_0x7b7a('0x23')]();};}function saveUpdates(_0x544236,_0x478165){return function(_0x4d09d6){if(_0x4d09d6){return _0x4d09d6[_0x7b7a('0x24')](_0x544236)[_0x7b7a('0x25')](function(_0x201d88){return _0x201d88;});}return null;};}function removeEntity(_0x2758a3,_0x526055){return function(_0x73893b){if(_0x73893b){return _0x73893b[_0x7b7a('0x26')]()['then'](function(){_0x2758a3[_0x7b7a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x170a8d,_0x506918){return function(_0x5b8fd7){if(!_0x5b8fd7){_0x170a8d['sendStatus'](0x194);}return _0x5b8fd7;};}function handleError(_0x1c8883,_0x537406){_0x537406=_0x537406||0x1f4;return function(_0x3e7125){logger[_0x7b7a('0x27')](_0x3e7125[_0x7b7a('0x28')]);if(_0x3e7125[_0x7b7a('0x29')]){delete _0x3e7125[_0x7b7a('0x29')];}_0x1c8883['status'](_0x537406)[_0x7b7a('0x2a')](_0x3e7125);};}exports[_0x7b7a('0x2b')]=function(_0xd0ee71,_0x278bfc){var _0x40b8b9={},_0x135d20={},_0x322beb={'count':0x0,'rows':[]};var _0x51d1ac=_[_0x7b7a('0x2c')](db[_0x7b7a('0x2d')][_0x7b7a('0x2e')],function(_0x48cb6c){return{'name':_0x48cb6c[_0x7b7a('0x2f')],'type':_0x48cb6c[_0x7b7a('0x30')]['key']};});_0x135d20[_0x7b7a('0x31')]=_['map'](_0x51d1ac,_0x7b7a('0x29'));_0x135d20[_0x7b7a('0x32')]=_[_0x7b7a('0x33')](_0xd0ee71[_0x7b7a('0x32')]);_0x135d20[_0x7b7a('0x34')]=_[_0x7b7a('0x35')](_0x135d20[_0x7b7a('0x31')],_0x135d20['query']);_0x40b8b9[_0x7b7a('0x36')]=_[_0x7b7a('0x35')](_0x135d20[_0x7b7a('0x31')],qs[_0x7b7a('0x37')](_0xd0ee71[_0x7b7a('0x32')]['fields']));_0x40b8b9[_0x7b7a('0x36')]=_0x40b8b9[_0x7b7a('0x36')]['length']?_0x40b8b9[_0x7b7a('0x36')]:_0x135d20[_0x7b7a('0x31')];if(!_0xd0ee71[_0x7b7a('0x32')][_0x7b7a('0x38')](_0x7b7a('0x39'))){_0x40b8b9[_0x7b7a('0x1d')]=qs['limit'](_0xd0ee71[_0x7b7a('0x32')][_0x7b7a('0x1d')]);_0x40b8b9[_0x7b7a('0x1b')]=qs[_0x7b7a('0x1b')](_0xd0ee71[_0x7b7a('0x32')][_0x7b7a('0x1b')]);}_0x40b8b9['order']=qs[_0x7b7a('0x3a')](_0xd0ee71['query']['sort']);_0x40b8b9[_0x7b7a('0x3b')]=qs[_0x7b7a('0x34')](_[_0x7b7a('0x3c')](_0xd0ee71[_0x7b7a('0x32')],_0x135d20[_0x7b7a('0x34')]),_0x51d1ac);if(_0xd0ee71['query'][_0x7b7a('0x3d')]){_0x40b8b9['where']=_['merge'](_0x40b8b9[_0x7b7a('0x3b')],{'$or':_[_0x7b7a('0x2c')](_0x51d1ac,function(_0x337df4){if(_0x337df4[_0x7b7a('0x30')]!==_0x7b7a('0x3e')){var _0x9e2203={};_0x9e2203[_0x337df4['name']]={'$like':'%'+_0xd0ee71['query'][_0x7b7a('0x3d')]+'%'};return _0x9e2203;}})});}_0x40b8b9=_[_0x7b7a('0x3f')]({},_0x40b8b9,_0xd0ee71['options']);var _0x561b9e={'where':_0x40b8b9[_0x7b7a('0x3b')]};return db['ServicenowField'][_0x7b7a('0x1e')](_0x561b9e)[_0x7b7a('0x25')](function(_0x41569c){_0x322beb[_0x7b7a('0x1e')]=_0x41569c;if(_0xd0ee71['query']['includeAll']){_0x40b8b9[_0x7b7a('0x40')]=[{'all':!![]}];}return db['ServicenowField'][_0x7b7a('0x41')](_0x40b8b9);})[_0x7b7a('0x25')](function(_0x50664c){_0x322beb['rows']=_0x50664c;return _0x322beb;})[_0x7b7a('0x25')](respondWithFilteredResult(_0x278bfc,_0x40b8b9))[_0x7b7a('0x42')](handleError(_0x278bfc,null));};exports['show']=function(_0x49774e,_0x43e235){var _0x482523={'raw':!![],'where':{'id':_0x49774e[_0x7b7a('0x43')]['id']}},_0x13268c={};_0x13268c[_0x7b7a('0x31')]=_['keys'](db[_0x7b7a('0x2d')]['rawAttributes']);_0x13268c[_0x7b7a('0x32')]=_[_0x7b7a('0x33')](_0x49774e[_0x7b7a('0x32')]);_0x13268c[_0x7b7a('0x34')]=_[_0x7b7a('0x35')](_0x13268c[_0x7b7a('0x31')],_0x13268c['query']);_0x482523[_0x7b7a('0x36')]=_['intersection'](_0x13268c[_0x7b7a('0x31')],qs[_0x7b7a('0x37')](_0x49774e['query'][_0x7b7a('0x37')]));_0x482523[_0x7b7a('0x36')]=_0x482523[_0x7b7a('0x36')][_0x7b7a('0x44')]?_0x482523[_0x7b7a('0x36')]:_0x13268c[_0x7b7a('0x31')];if(_0x49774e[_0x7b7a('0x32')][_0x7b7a('0x45')]){_0x482523[_0x7b7a('0x40')]=[{'all':!![]}];}_0x482523=_[_0x7b7a('0x3f')]({},_0x482523,_0x49774e[_0x7b7a('0x46')]);return db[_0x7b7a('0x2d')][_0x7b7a('0x47')](_0x482523)['then'](handleEntityNotFound(_0x43e235,null))['then'](respondWithResult(_0x43e235,null))['catch'](handleError(_0x43e235,null));};exports[_0x7b7a('0x48')]=function(_0x4a6bd1,_0x1ce859){return db[_0x7b7a('0x2d')][_0x7b7a('0x48')](_0x4a6bd1[_0x7b7a('0x49')],{})[_0x7b7a('0x25')](respondWithResult(_0x1ce859,0xc9))[_0x7b7a('0x42')](handleError(_0x1ce859,null));};exports[_0x7b7a('0x24')]=function(_0x4875ad,_0x403952){if(_0x4875ad['body']['id']){delete _0x4875ad[_0x7b7a('0x49')]['id'];}return db[_0x7b7a('0x2d')][_0x7b7a('0x47')]({'where':{'id':_0x4875ad[_0x7b7a('0x43')]['id']}})[_0x7b7a('0x25')](handleEntityNotFound(_0x403952,null))['then'](saveUpdates(_0x4875ad['body'],null))[_0x7b7a('0x25')](respondWithResult(_0x403952,null))['catch'](handleError(_0x403952,null));};exports[_0x7b7a('0x26')]=function(_0x45a3dc,_0x29040d){return db['ServicenowField'][_0x7b7a('0x47')]({'where':{'id':_0x45a3dc[_0x7b7a('0x43')]['id']}})[_0x7b7a('0x25')](handleEntityNotFound(_0x29040d,null))['then'](removeEntity(_0x29040d,null))['catch'](handleError(_0x29040d,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 3108150..3849145 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 _0x899c=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','int_servicenow_fields','idField'];(function(_0x1994f1,_0x2a8b7e){var _0x37cece=function(_0x5ae0ed){while(--_0x5ae0ed){_0x1994f1['push'](_0x1994f1['shift']());}};_0x37cece(++_0x2a8b7e);}(_0x899c,0xe4));var _0xc899=function(_0x28c7a7,_0x55a356){_0x28c7a7=_0x28c7a7-0x0;var _0x50610f=_0x899c[_0x28c7a7];return _0x50610f;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xc899('0x0'));var moment=require(_0xc899('0x1'));var BPromise=require(_0xc899('0x2'));var rp=require(_0xc899('0x3'));var fs=require('fs');var path=require(_0xc899('0x4'));var rimraf=require(_0xc899('0x5'));var config=require(_0xc899('0x6'));var attributes=require(_0xc899('0x7'));module[_0xc899('0x8')]=function(_0x3235be,_0x103cbf){return _0x3235be[_0xc899('0x9')]('ServicenowField',attributes,{'tableName':_0xc899('0xa'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0xc899('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3c72=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','FieldId','lodash','util'];(function(_0x436adf,_0x3f410a){var _0x3b0ae6=function(_0x1b0662){while(--_0x1b0662){_0x436adf['push'](_0x436adf['shift']());}};_0x3b0ae6(++_0x3f410a);}(_0x3c72,0x1ee));var _0x23c7=function(_0x9ba619,_0x50745e){_0x9ba619=_0x9ba619-0x0;var _0x345138=_0x3c72[_0x9ba619];return _0x345138;};'use strict';var _=require(_0x23c7('0x0'));var util=require(_0x23c7('0x1'));var logger=require(_0x23c7('0x2'))('api');var moment=require(_0x23c7('0x3'));var BPromise=require(_0x23c7('0x4'));var rp=require(_0x23c7('0x5'));var fs=require('fs');var path=require(_0x23c7('0x6'));var rimraf=require(_0x23c7('0x7'));var config=require(_0x23c7('0x8'));var attributes=require(_0x23c7('0x9'));module[_0x23c7('0xa')]=function(_0x35a17d,_0x19372a){return _0x35a17d[_0x23c7('0xb')](_0x23c7('0xc'),attributes,{'tableName':_0x23c7('0xd'),'paranoid':![],'indexes':[{'name':_0x23c7('0xe'),'fields':['idField',_0x23c7('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index 9bc1aa7..4af7ea9 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 _0xac4a=['ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xac4a,0x13f));var _0xaac4=function(_0x4dac70,_0x500afa){_0x4dac70=_0x4dac70-0x0;var _0x457210=_0xac4a[_0x4dac70];return _0x457210;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('ServicenowField,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('ServicenowField,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});} \ No newline at end of file +var _0x9bde=['code','message','ServicenowField,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x473f55,_0xbbef6c){var _0x2525b9=function(_0x423449){while(--_0x423449){_0x473f55['push'](_0x473f55['shift']());}};_0x2525b9(++_0xbbef6c);}(_0x9bde,0xe1));var _0xe9bd=function(_0x73d2d1,_0x2242bf){_0x73d2d1=_0x73d2d1-0x0;var _0x3b82f0=_0x9bde[_0x73d2d1];return _0x3b82f0;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var moment=require('moment');var BPromise=require(_0xe9bd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9bd('0x2'));var db=require(_0xe9bd('0x3'))['db'];var utils=require(_0xe9bd('0x4'));var logger=require(_0xe9bd('0x5'))(_0xe9bd('0x6'));var config=require(_0xe9bd('0x7'));var jayson=require(_0xe9bd('0x8'));var client=jayson['client'][_0xe9bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f18fe,_0x22a438,_0xa66ae2){return new BPromise(function(_0x2d5c75,_0x3ef9e3){return client[_0xe9bd('0xa')](_0x5f18fe,_0xa66ae2)[_0xe9bd('0xb')](function(_0x439abc){logger[_0xe9bd('0xc')]('ServicenowField,\x20%s,\x20%s',_0x22a438,'request\x20sent');logger[_0xe9bd('0xd')](_0xe9bd('0xe'),_0x22a438,_0xe9bd('0xf'),JSON['stringify'](_0x439abc));if(_0x439abc[_0xe9bd('0x10')]){if(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x11')]===0x1f4){logger[_0xe9bd('0x10')]('ServicenowField,\x20%s,\x20%s',_0x22a438,_0x439abc[_0xe9bd('0x10')]['message']);return _0x3ef9e3(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}logger[_0xe9bd('0x10')]('ServicenowField,\x20%s,\x20%s',_0x22a438,_0x439abc['error'][_0xe9bd('0x12')]);return _0x2d5c75(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}else{logger[_0xe9bd('0xc')](_0xe9bd('0x13'),_0x22a438,_0xe9bd('0xf'));_0x2d5c75(_0x439abc[_0xe9bd('0x14')]['message']);}})[_0xe9bd('0x15')](function(_0x464a1b){logger[_0xe9bd('0x10')]('ServicenowField,\x20%s,\x20%s',_0x22a438,_0x464a1b);_0x3ef9e3(_0x464a1b);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 852fcf8..a9e011f 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(_0x5caa45,_0x1ee715){var _0xd15322=function(_0x4aa4ac){while(--_0x4aa4ac){_0x5caa45['push'](_0x5caa45['shift']());}};_0xd15322(++_0x1ee715);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +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(_0x7238d5,_0x16e730){var _0x3b6206=function(_0x464769){while(--_0x464769){_0x7238d5['push'](_0x7238d5['shift']());}};_0x3b6206(++_0x16e730);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'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 0fd451f..093a743 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(_0x1aabd0,_0x483cf0){var _0x37063f=function(_0x909e77){while(--_0x909e77){_0x1aabd0['push'](_0x1aabd0['shift']());}};_0x37063f(++_0x483cf0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'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(_0x23a916,_0x14026e){var _0x2128a5=function(_0x668c0f){while(--_0x668c0f){_0x23a916['push'](_0x23a916['shift']());}};_0x2128a5(++_0x14026e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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 2ee6f8c..fc49445 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 _0x195e=['Invalid\x20Login','Password\x20Expired','/service/v4_1/rest.php','get_module_fields','Calls','values','module_fields','endsWith','value','getFields,\x20%s,\x20%s,\x20%s','getFields','send','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','SugarcrmAccount','include','findAll','rows','params','keys','length','options','create','body','catch','find','findOne','getConfigurations','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmConfiguration','SugarcrmField','assigned_user_id','description','date_start','duration_hours','duration_minutes','parent_id','parent_name','direction','substring','lastIndexOf','format','%s%s','JSON','stringify','username','password','PLAIN','xCALLY\x20Motion\x20Integration'];(function(_0x1a7550,_0x1edace){var _0x426e22=function(_0x1c10a1){while(--_0x1c10a1){_0x1a7550['push'](_0x1a7550['shift']());}};_0x426e22(++_0x1edace);}(_0x195e,0x1db));var _0xe195=function(_0x5113e0,_0x56cb81){_0x5113e0=_0x5113e0-0x0;var _0x9551e5=_0x195e[_0x5113e0];return _0x9551e5;};'use strict';var emlformat=require(_0xe195('0x0'));var rimraf=require(_0xe195('0x1'));var zipdir=require(_0xe195('0x2'));var jsonpatch=require(_0xe195('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe195('0x4'));var util=require(_0xe195('0x5'));var path=require('path');var sox=require(_0xe195('0x6'));var csv=require(_0xe195('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe195('0x8'));var squel=require(_0xe195('0x9'));var crypto=require(_0xe195('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xe195('0xb'));var toCsv=require(_0xe195('0x7'));var querystring=require(_0xe195('0xc'));var Papa=require(_0xe195('0xd'));var Redis=require('ioredis');var authService=require(_0xe195('0xe'));var qs=require(_0xe195('0xf'));var as=require(_0xe195('0x10'));var hardwareService=require(_0xe195('0x11'));var logger=require(_0xe195('0x12'))('api');var utils=require(_0xe195('0x13'));var config=require(_0xe195('0x14'));var licenseUtil=require(_0xe195('0x15'));var db=require(_0xe195('0x16'))['db'];var integrations=require(_0xe195('0x17'));function respondWithStatusCode(_0x1176b1,_0x1e3f8e){_0x1e3f8e=_0x1e3f8e||0xcc;return function(_0xcc7510){if(_0xcc7510){return _0x1176b1[_0xe195('0x18')](_0x1e3f8e);}return _0x1176b1[_0xe195('0x19')](_0x1e3f8e)[_0xe195('0x1a')]();};}function respondWithResult(_0x1d530d,_0x3d3f50){_0x3d3f50=_0x3d3f50||0xc8;return function(_0x132421){if(_0x132421){return _0x1d530d[_0xe195('0x19')](_0x3d3f50)['json'](_0x132421);}};}function respondWithFilteredResult(_0x2a9efe,_0x5d261b){return function(_0x458a4c){if(_0x458a4c){var _0x5c0909=typeof _0x5d261b[_0xe195('0x1b')]===_0xe195('0x1c')&&typeof _0x5d261b[_0xe195('0x1d')]===_0xe195('0x1c');var _0x3c3bac=_0x458a4c[_0xe195('0x1e')];var _0x3137bb=_0x5c0909?0x0:_0x5d261b[_0xe195('0x1b')];var _0x1d9b35=_0x5c0909?_0x458a4c['count']:_0x5d261b[_0xe195('0x1b')]+_0x5d261b['limit'];var _0x2c3ecb;if(_0x1d9b35>=_0x3c3bac){_0x1d9b35=_0x3c3bac;_0x2c3ecb=0xc8;}else{_0x2c3ecb=0xce;}_0x2a9efe[_0xe195('0x19')](_0x2c3ecb);return _0x2a9efe[_0xe195('0x1f')]('Content-Range',_0x3137bb+'-'+_0x1d9b35+'/'+_0x3c3bac)['json'](_0x458a4c);}return null;};}function patchUpdates(_0x359107){return function(_0x17e220){try{jsonpatch[_0xe195('0x20')](_0x17e220,_0x359107,!![]);}catch(_0x5d819e){return BPromise[_0xe195('0x21')](_0x5d819e);}return _0x17e220[_0xe195('0x22')]();};}function saveUpdates(_0x504f9e,_0x1dd88f){return function(_0x536bbe){if(_0x536bbe){return _0x536bbe[_0xe195('0x23')](_0x504f9e)[_0xe195('0x24')](function(_0x292bce){return _0x292bce;});}return null;};}function removeEntity(_0x1aa72b,_0x56ba2c){return function(_0x53247f){if(_0x53247f){return _0x53247f[_0xe195('0x25')]()[_0xe195('0x24')](function(){_0x1aa72b[_0xe195('0x19')](0xcc)[_0xe195('0x1a')]();});}};}function handleEntityNotFound(_0x7150c6,_0x452543){return function(_0x40070a){if(!_0x40070a){_0x7150c6[_0xe195('0x18')](0x194);}return _0x40070a;};}function handleError(_0xf180a1,_0x466585){_0x466585=_0x466585||0x1f4;return function(_0xd0e8c0){logger['error'](_0xd0e8c0['stack']);if(_0xd0e8c0[_0xe195('0x26')]){delete _0xd0e8c0['name'];}_0xf180a1['status'](_0x466585)['send'](_0xd0e8c0);};}exports[_0xe195('0x27')]=function(_0x59de1,_0x26fb6d){var _0x17c3f0={},_0x18601d={},_0x1a6f11={'count':0x0,'rows':[]};var _0x38399c=_[_0xe195('0x28')](db['SugarcrmAccount'][_0xe195('0x29')],function(_0x2f91b6){return{'name':_0x2f91b6[_0xe195('0x2a')],'type':_0x2f91b6[_0xe195('0x2b')][_0xe195('0x2c')]};});_0x18601d[_0xe195('0x2d')]=_[_0xe195('0x28')](_0x38399c,_0xe195('0x26'));_0x18601d[_0xe195('0x2e')]=_['keys'](_0x59de1[_0xe195('0x2e')]);_0x18601d[_0xe195('0x2f')]=_[_0xe195('0x30')](_0x18601d[_0xe195('0x2d')],_0x18601d[_0xe195('0x2e')]);_0x17c3f0[_0xe195('0x31')]=_['intersection'](_0x18601d[_0xe195('0x2d')],qs[_0xe195('0x32')](_0x59de1[_0xe195('0x2e')][_0xe195('0x32')]));_0x17c3f0[_0xe195('0x31')]=_0x17c3f0['attributes']['length']?_0x17c3f0[_0xe195('0x31')]:_0x18601d[_0xe195('0x2d')];if(!_0x59de1[_0xe195('0x2e')][_0xe195('0x33')](_0xe195('0x34'))){_0x17c3f0[_0xe195('0x1d')]=qs['limit'](_0x59de1[_0xe195('0x2e')][_0xe195('0x1d')]);_0x17c3f0[_0xe195('0x1b')]=qs[_0xe195('0x1b')](_0x59de1['query']['offset']);}_0x17c3f0[_0xe195('0x35')]=qs[_0xe195('0x36')](_0x59de1[_0xe195('0x2e')][_0xe195('0x36')]);_0x17c3f0[_0xe195('0x37')]=qs[_0xe195('0x2f')](_[_0xe195('0x38')](_0x59de1['query'],_0x18601d['filters']),_0x38399c);if(_0x59de1[_0xe195('0x2e')]['filter']){_0x17c3f0[_0xe195('0x37')]=_['merge'](_0x17c3f0[_0xe195('0x37')],{'$or':_[_0xe195('0x28')](_0x38399c,function(_0x15a35c){if(_0x15a35c[_0xe195('0x2b')]!==_0xe195('0x39')){var _0x431a17={};_0x431a17[_0x15a35c[_0xe195('0x26')]]={'$like':'%'+_0x59de1['query'][_0xe195('0x3a')]+'%'};return _0x431a17;}})});}_0x17c3f0=_[_0xe195('0x3b')]({},_0x17c3f0,_0x59de1['options']);var _0x5d9929={'where':_0x17c3f0[_0xe195('0x37')]};return db[_0xe195('0x3c')][_0xe195('0x1e')](_0x5d9929)['then'](function(_0x2ba034){_0x1a6f11['count']=_0x2ba034;if(_0x59de1['query']['includeAll']){_0x17c3f0[_0xe195('0x3d')]=[{'all':!![]}];}return db[_0xe195('0x3c')][_0xe195('0x3e')](_0x17c3f0);})[_0xe195('0x24')](function(_0x5b68ea){_0x1a6f11[_0xe195('0x3f')]=_0x5b68ea;return _0x1a6f11;})[_0xe195('0x24')](respondWithFilteredResult(_0x26fb6d,_0x17c3f0))['catch'](handleError(_0x26fb6d,null));};exports['show']=function(_0x10ffef,_0x5d7087){var _0x2c43a6={'raw':![],'where':{'id':_0x10ffef[_0xe195('0x40')]['id']}},_0x4a9635={};_0x4a9635['model']=_['keys'](db[_0xe195('0x3c')]['rawAttributes']);_0x4a9635['query']=_[_0xe195('0x41')](_0x10ffef[_0xe195('0x2e')]);_0x4a9635[_0xe195('0x2f')]=_[_0xe195('0x30')](_0x4a9635[_0xe195('0x2d')],_0x4a9635[_0xe195('0x2e')]);_0x2c43a6[_0xe195('0x31')]=_[_0xe195('0x30')](_0x4a9635[_0xe195('0x2d')],qs[_0xe195('0x32')](_0x10ffef['query']['fields']));_0x2c43a6[_0xe195('0x31')]=_0x2c43a6[_0xe195('0x31')][_0xe195('0x42')]?_0x2c43a6[_0xe195('0x31')]:_0x4a9635['model'];if(_0x10ffef['query']['includeAll']){_0x2c43a6[_0xe195('0x3d')]=[{'all':!![]}];}_0x2c43a6=_['merge']({},_0x2c43a6,_0x10ffef[_0xe195('0x43')]);return db['SugarcrmAccount']['find'](_0x2c43a6)[_0xe195('0x24')](handleEntityNotFound(_0x5d7087,null))[_0xe195('0x24')](respondWithResult(_0x5d7087,null))['catch'](handleError(_0x5d7087,null));};exports['create']=function(_0x56b534,_0x37d339){return db[_0xe195('0x3c')][_0xe195('0x44')](_0x56b534[_0xe195('0x45')],{})[_0xe195('0x24')](respondWithResult(_0x37d339,0xc9))[_0xe195('0x46')](handleError(_0x37d339,null));};exports[_0xe195('0x23')]=function(_0x5a8ffd,_0x1ab991){if(_0x5a8ffd['body']['id']){delete _0x5a8ffd['body']['id'];}return db[_0xe195('0x3c')][_0xe195('0x47')]({'where':{'id':_0x5a8ffd[_0xe195('0x40')]['id']}})[_0xe195('0x24')](handleEntityNotFound(_0x1ab991,null))['then'](saveUpdates(_0x5a8ffd[_0xe195('0x45')],null))[_0xe195('0x24')](respondWithResult(_0x1ab991,null))[_0xe195('0x46')](handleError(_0x1ab991,null));};exports[_0xe195('0x25')]=function(_0x3e4f86,_0x46aa67){return db[_0xe195('0x3c')]['find']({'where':{'id':_0x3e4f86[_0xe195('0x40')]['id']}})['then'](handleEntityNotFound(_0x46aa67,null))[_0xe195('0x24')](removeEntity(_0x46aa67,null))[_0xe195('0x46')](handleError(_0x46aa67,null));};exports['getConfigurations']=function(_0x4c4c15,_0x33bae5,_0x536bf9){var _0x4d6a02={};var _0x17768d={};var _0x511ffc;var _0x4d7290;return db[_0xe195('0x3c')][_0xe195('0x48')]({'where':{'id':_0x4c4c15[_0xe195('0x40')]['id']}})[_0xe195('0x24')](handleEntityNotFound(_0x33bae5,null))[_0xe195('0x24')](function(_0x4f0103){if(_0x4f0103){_0x511ffc=_0x4f0103;_0x17768d[_0xe195('0x2d')]=_[_0xe195('0x41')](db['SugarcrmConfiguration'][_0xe195('0x29')]);_0x17768d['query']=_[_0xe195('0x41')](_0x4c4c15[_0xe195('0x2e')]);_0x17768d[_0xe195('0x2f')]=_[_0xe195('0x30')](_0x17768d['model'],_0x17768d['query']);_0x4d6a02[_0xe195('0x31')]=_[_0xe195('0x30')](_0x17768d[_0xe195('0x2d')],qs[_0xe195('0x32')](_0x4c4c15[_0xe195('0x2e')][_0xe195('0x32')]));_0x4d6a02[_0xe195('0x31')]=_0x4d6a02[_0xe195('0x31')]['length']?_0x4d6a02[_0xe195('0x31')]:_0x17768d[_0xe195('0x2d')];_0x4d6a02['order']=qs[_0xe195('0x36')](_0x4c4c15['query'][_0xe195('0x36')]);_0x4d6a02[_0xe195('0x37')]=qs[_0xe195('0x2f')](_[_0xe195('0x38')](_0x4c4c15[_0xe195('0x2e')],_0x17768d[_0xe195('0x2f')]));if(_0x4c4c15[_0xe195('0x2e')][_0xe195('0x3a')]){_0x4d6a02['where']=_[_0xe195('0x3b')](_0x4d6a02[_0xe195('0x37')],{'$or':_['map'](_0x4d6a02[_0xe195('0x31')],function(_0x1fef8c){var _0x5167e7={};_0x5167e7[_0x1fef8c]={'$like':'%'+_0x4c4c15[_0xe195('0x2e')]['filter']+'%'};return _0x5167e7;})});}_0x4d6a02=_['merge']({},_0x4d6a02,_0x4c4c15[_0xe195('0x43')]);return _0x511ffc[_0xe195('0x49')](_0x4d6a02);}})[_0xe195('0x24')](function(_0x503bf2){if(_0x503bf2){_0x4d7290=_0x503bf2[_0xe195('0x42')];if(!_0x4c4c15[_0xe195('0x2e')][_0xe195('0x33')](_0xe195('0x34'))){_0x4d6a02['limit']=qs[_0xe195('0x1d')](_0x4c4c15[_0xe195('0x2e')][_0xe195('0x1d')]);_0x4d6a02['offset']=qs[_0xe195('0x1b')](_0x4c4c15[_0xe195('0x2e')][_0xe195('0x1b')]);}return _0x511ffc[_0xe195('0x49')](_0x4d6a02);}})[_0xe195('0x24')](function(_0x221af2){if(_0x221af2){return _0x221af2?{'count':_0x4d7290,'rows':_0x221af2}:null;}})[_0xe195('0x24')](respondWithResult(_0x33bae5,null))[_0xe195('0x46')](handleError(_0x33bae5,null));};exports['addConfiguration']=function(_0x4d239a,_0x91cb50,_0x4b7141){if(_0x4d239a[_0xe195('0x45')]['id']){delete _0x4d239a['body']['id'];}return db[_0xe195('0x3c')][_0xe195('0x48')]({'where':{'id':_0x4d239a[_0xe195('0x40')]['id']}})[_0xe195('0x24')](handleEntityNotFound(_0x91cb50,null))[_0xe195('0x24')](function(_0x4d9879){if(_0x4d9879){_0x4d239a[_0xe195('0x45')][_0xe195('0x4a')]=_0x4d9879['id'];_0x4d239a[_0xe195('0x45')][_0xe195('0x4b')]=integrations[_0xe195('0x4c')](_0x4d239a['body'][_0xe195('0x4d')],_0x4d239a[_0xe195('0x45')][_0xe195('0x2b')]);_0x4d239a['body'][_0xe195('0x4e')]=integrations[_0xe195('0x4f')](_0x4d239a[_0xe195('0x45')][_0xe195('0x4d')],_0x4d239a['body']['type']);return db[_0xe195('0x50')][_0xe195('0x44')](_0x4d239a[_0xe195('0x45')],{'include':[{'model':db['SugarcrmField'],'as':'Subjects'},{'model':db[_0xe195('0x51')],'as':_0xe195('0x4e')}]});}return null;})[_0xe195('0x24')](respondWithResult(_0x91cb50,null))[_0xe195('0x46')](handleError(_0x91cb50,null));};exports['getFields']=function(_0x398193,_0x68c045,_0x51b364){var _0x43b0b1='';var _0x416a8c=['id','name',_0xe195('0x52'),'created_by',_0xe195('0x53'),_0xe195('0x54'),_0xe195('0x55'),_0xe195('0x56'),_0xe195('0x57'),'parent_type',_0xe195('0x58'),_0xe195('0x59')];return db[_0xe195('0x3c')][_0xe195('0x48')]({'where':{'id':_0x398193[_0xe195('0x40')]['id']},'attributes':['id','username','password','remoteUri']})['then'](handleEntityNotFound(_0x68c045,null))[_0xe195('0x24')](function(_0x4ece66){if(_0x4ece66){_0x43b0b1=_0x4ece66['remoteUri'];var _0x2d018a=_0x43b0b1['slice'](-0x1);if(_0x2d018a==='/'){_0x43b0b1=_0x43b0b1[_0xe195('0x5a')](0x0,_0x43b0b1[_0xe195('0x5b')](_0x2d018a));}return rp({'method':'POST','uri':util[_0xe195('0x5c')](_0xe195('0x5d'),_0x43b0b1,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'login','input_type':'JSON','response_type':_0xe195('0x5e'),'rest_data':JSON[_0xe195('0x5f')]({'user_auth':{'user_name':_0x4ece66[_0xe195('0x60')],'password':_0x4ece66[_0xe195('0x61')],'encryption':_0xe195('0x62')},'application':_0xe195('0x63')})}});}})['then'](function(_0x13b97c){if(_0x13b97c&&_0x13b97c[_0xe195('0x26')]!==_0xe195('0x64')&&_0x13b97c[_0xe195('0x26')]!==_0xe195('0x65')){return rp({'method':'POST','uri':util[_0xe195('0x5c')](_0xe195('0x5d'),_0x43b0b1,_0xe195('0x66')),'json':!![],'form':{'method':_0xe195('0x67'),'input_type':_0xe195('0x5e'),'response_type':_0xe195('0x5e'),'rest_data':JSON[_0xe195('0x5f')]({'session':_0x13b97c['id'],'module_name':_0xe195('0x68')})}})[_0xe195('0x24')](function(_0xbb6fdc){if(_0xbb6fdc){var _0x2390a8=_[_0xe195('0x69')](_0xbb6fdc[_0xe195('0x6a')]);_['remove'](_0x2390a8,function(_0x1cbbf1){return _0x416a8c['includes'](_0x1cbbf1['name']);});return{'count':_0x2390a8[_0xe195('0x42')],'rows':_['map'](_0x2390a8,function(_0x57edb5){return{'id':_0x57edb5['name'],'name':_0x57edb5['label'],'custom':_[_0xe195('0x6b')](_0x57edb5[_0xe195('0x26')],'_c')?!![]:![],'options':_0x57edb5[_0xe195('0x43')]?_[_0xe195('0x28')](_['values'](_0x57edb5['options']),function(_0x34d422){return{'name':_0x34d422[_0xe195('0x6c')],'value':_0x34d422[_0xe195('0x26')]};}):[]};})};}})[_0xe195('0x24')](respondWithResult(_0x68c045,null))['catch'](function(_0x2a8a8b){var _0x1e3f33=_0x398193[_0xe195('0x2e')]['test']?0x1f4:_0x2a8a8b['statusCode']||0x1f4;logger['error'](_0xe195('0x6d'),_0xe195('0x6e'),_0x1e3f33,JSON[_0xe195('0x5f')](_0x2a8a8b));delete _0x2a8a8b[_0xe195('0x26')];if(_0x1e3f33===0x191){_0x1e3f33=0x190;}_0x68c045[_0xe195('0x19')](_0x1e3f33)[_0xe195('0x6f')](_0x398193[_0xe195('0x2e')][_0xe195('0x70')]?{'message':_0xe195('0x71'),'statusCode':_0x2a8a8b[_0xe195('0x72')]}:_0x2a8a8b);});}else{var _0xbe61d9=0x1f4;_0x68c045[_0xe195('0x19')](_0xbe61d9)[_0xe195('0x6f')]({'message':_0xe195('0x71'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x138c=['password','PLAIN','xCALLY\x20Motion\x20Integration','POST','format','Calls','values','remove','label','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','send','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','index','map','SugarcrmAccount','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','keys','find','create','body','params','findOne','length','getConfigurations','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmConfiguration','SugarcrmField','description','date_start','duration_hours','duration_minutes','parent_type','parent_name','username','remoteUri','substring','lastIndexOf','%s%s','JSON','stringify'];(function(_0x3b231a,_0x53a00d){var _0x18d67a=function(_0x5e14c6){while(--_0x5e14c6){_0x3b231a['push'](_0x3b231a['shift']());}};_0x18d67a(++_0x53a00d);}(_0x138c,0x1d0));var _0xc138=function(_0x30611c,_0x4e5682){_0x30611c=_0x30611c-0x0;var _0x3c4467=_0x138c[_0x30611c];return _0x3c4467;};'use strict';var emlformat=require(_0xc138('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc138('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc138('0x2'));var moment=require(_0xc138('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc138('0x4'));var util=require(_0xc138('0x5'));var path=require(_0xc138('0x6'));var sox=require(_0xc138('0x7'));var csv=require(_0xc138('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc138('0x9'));var _=require('lodash');var squel=require(_0xc138('0xa'));var crypto=require(_0xc138('0xb'));var jsforce=require(_0xc138('0xc'));var deskjs=require(_0xc138('0xd'));var toCsv=require(_0xc138('0x8'));var querystring=require('querystring');var Papa=require(_0xc138('0xe'));var Redis=require('ioredis');var authService=require(_0xc138('0xf'));var qs=require(_0xc138('0x10'));var as=require(_0xc138('0x11'));var hardwareService=require(_0xc138('0x12'));var logger=require('../../config/logger')(_0xc138('0x13'));var utils=require('../../config/utils');var config=require(_0xc138('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xc138('0x15'))['db'];var integrations=require(_0xc138('0x16'));function respondWithStatusCode(_0x30b54e,_0x3d1eb6){_0x3d1eb6=_0x3d1eb6||0xcc;return function(_0xd93fd6){if(_0xd93fd6){return _0x30b54e[_0xc138('0x17')](_0x3d1eb6);}return _0x30b54e[_0xc138('0x18')](_0x3d1eb6)[_0xc138('0x19')]();};}function respondWithResult(_0x14ae05,_0x10a03d){_0x10a03d=_0x10a03d||0xc8;return function(_0x79c77a){if(_0x79c77a){return _0x14ae05[_0xc138('0x18')](_0x10a03d)['json'](_0x79c77a);}};}function respondWithFilteredResult(_0x2a1118,_0x2de626){return function(_0x2d7917){if(_0x2d7917){var _0x4b598d=typeof _0x2de626[_0xc138('0x1a')]==='undefined'&&typeof _0x2de626[_0xc138('0x1b')]===_0xc138('0x1c');var _0x46e29f=_0x2d7917['count'];var _0x500b2f=_0x4b598d?0x0:_0x2de626[_0xc138('0x1a')];var _0xca6c7f=_0x4b598d?_0x2d7917[_0xc138('0x1d')]:_0x2de626[_0xc138('0x1a')]+_0x2de626[_0xc138('0x1b')];var _0x5cd2d1;if(_0xca6c7f>=_0x46e29f){_0xca6c7f=_0x46e29f;_0x5cd2d1=0xc8;}else{_0x5cd2d1=0xce;}_0x2a1118[_0xc138('0x18')](_0x5cd2d1);return _0x2a1118[_0xc138('0x1e')](_0xc138('0x1f'),_0x500b2f+'-'+_0xca6c7f+'/'+_0x46e29f)[_0xc138('0x20')](_0x2d7917);}return null;};}function patchUpdates(_0x3fbb6e){return function(_0x12215f){try{jsonpatch[_0xc138('0x21')](_0x12215f,_0x3fbb6e,!![]);}catch(_0x44bfd){return BPromise[_0xc138('0x22')](_0x44bfd);}return _0x12215f[_0xc138('0x23')]();};}function saveUpdates(_0x20774d,_0x4b33d4){return function(_0x15047f){if(_0x15047f){return _0x15047f[_0xc138('0x24')](_0x20774d)[_0xc138('0x25')](function(_0x304d46){return _0x304d46;});}return null;};}function removeEntity(_0xe0993,_0x165f34){return function(_0x3034f9){if(_0x3034f9){return _0x3034f9[_0xc138('0x26')]()[_0xc138('0x25')](function(){_0xe0993['status'](0xcc)[_0xc138('0x19')]();});}};}function handleEntityNotFound(_0x3a5077,_0x34bab0){return function(_0x12821a){if(!_0x12821a){_0x3a5077[_0xc138('0x17')](0x194);}return _0x12821a;};}function handleError(_0x1e3dec,_0x20dc54){_0x20dc54=_0x20dc54||0x1f4;return function(_0x46f5d7){logger[_0xc138('0x27')](_0x46f5d7['stack']);if(_0x46f5d7[_0xc138('0x28')]){delete _0x46f5d7[_0xc138('0x28')];}_0x1e3dec[_0xc138('0x18')](_0x20dc54)['send'](_0x46f5d7);};}exports[_0xc138('0x29')]=function(_0x15777a,_0x328ac4){var _0xa03a4e={},_0xe19be2={},_0x64cd60={'count':0x0,'rows':[]};var _0xc10b6c=_[_0xc138('0x2a')](db[_0xc138('0x2b')][_0xc138('0x2c')],function(_0x389e0e){return{'name':_0x389e0e['fieldName'],'type':_0x389e0e[_0xc138('0x2d')][_0xc138('0x2e')]};});_0xe19be2[_0xc138('0x2f')]=_[_0xc138('0x2a')](_0xc10b6c,_0xc138('0x28'));_0xe19be2[_0xc138('0x30')]=_['keys'](_0x15777a['query']);_0xe19be2[_0xc138('0x31')]=_[_0xc138('0x32')](_0xe19be2[_0xc138('0x2f')],_0xe19be2[_0xc138('0x30')]);_0xa03a4e[_0xc138('0x33')]=_[_0xc138('0x32')](_0xe19be2[_0xc138('0x2f')],qs[_0xc138('0x34')](_0x15777a[_0xc138('0x30')]['fields']));_0xa03a4e['attributes']=_0xa03a4e[_0xc138('0x33')]['length']?_0xa03a4e['attributes']:_0xe19be2[_0xc138('0x2f')];if(!_0x15777a[_0xc138('0x30')][_0xc138('0x35')](_0xc138('0x36'))){_0xa03a4e[_0xc138('0x1b')]=qs['limit'](_0x15777a[_0xc138('0x30')][_0xc138('0x1b')]);_0xa03a4e['offset']=qs[_0xc138('0x1a')](_0x15777a[_0xc138('0x30')][_0xc138('0x1a')]);}_0xa03a4e['order']=qs[_0xc138('0x37')](_0x15777a['query'][_0xc138('0x37')]);_0xa03a4e[_0xc138('0x38')]=qs[_0xc138('0x31')](_[_0xc138('0x39')](_0x15777a[_0xc138('0x30')],_0xe19be2[_0xc138('0x31')]),_0xc10b6c);if(_0x15777a[_0xc138('0x30')][_0xc138('0x3a')]){_0xa03a4e[_0xc138('0x38')]=_[_0xc138('0x3b')](_0xa03a4e[_0xc138('0x38')],{'$or':_[_0xc138('0x2a')](_0xc10b6c,function(_0x5a16f8){if(_0x5a16f8[_0xc138('0x2d')]!==_0xc138('0x3c')){var _0x158ecd={};_0x158ecd[_0x5a16f8[_0xc138('0x28')]]={'$like':'%'+_0x15777a[_0xc138('0x30')][_0xc138('0x3a')]+'%'};return _0x158ecd;}})});}_0xa03a4e=_[_0xc138('0x3b')]({},_0xa03a4e,_0x15777a[_0xc138('0x3d')]);var _0x34bea1={'where':_0xa03a4e[_0xc138('0x38')]};return db['SugarcrmAccount'][_0xc138('0x1d')](_0x34bea1)[_0xc138('0x25')](function(_0x3196d4){_0x64cd60['count']=_0x3196d4;if(_0x15777a['query'][_0xc138('0x3e')]){_0xa03a4e[_0xc138('0x3f')]=[{'all':!![]}];}return db[_0xc138('0x2b')]['findAll'](_0xa03a4e);})[_0xc138('0x25')](function(_0x5afc59){_0x64cd60[_0xc138('0x40')]=_0x5afc59;return _0x64cd60;})[_0xc138('0x25')](respondWithFilteredResult(_0x328ac4,_0xa03a4e))[_0xc138('0x41')](handleError(_0x328ac4,null));};exports[_0xc138('0x42')]=function(_0x2d47f2,_0x2bdad9){var _0x966bc2={'raw':![],'where':{'id':_0x2d47f2['params']['id']}},_0x392b92={};_0x392b92[_0xc138('0x2f')]=_[_0xc138('0x43')](db[_0xc138('0x2b')][_0xc138('0x2c')]);_0x392b92[_0xc138('0x30')]=_[_0xc138('0x43')](_0x2d47f2[_0xc138('0x30')]);_0x392b92['filters']=_[_0xc138('0x32')](_0x392b92[_0xc138('0x2f')],_0x392b92[_0xc138('0x30')]);_0x966bc2[_0xc138('0x33')]=_['intersection'](_0x392b92[_0xc138('0x2f')],qs[_0xc138('0x34')](_0x2d47f2[_0xc138('0x30')]['fields']));_0x966bc2[_0xc138('0x33')]=_0x966bc2[_0xc138('0x33')]['length']?_0x966bc2[_0xc138('0x33')]:_0x392b92[_0xc138('0x2f')];if(_0x2d47f2[_0xc138('0x30')][_0xc138('0x3e')]){_0x966bc2[_0xc138('0x3f')]=[{'all':!![]}];}_0x966bc2=_[_0xc138('0x3b')]({},_0x966bc2,_0x2d47f2['options']);return db[_0xc138('0x2b')][_0xc138('0x44')](_0x966bc2)[_0xc138('0x25')](handleEntityNotFound(_0x2bdad9,null))[_0xc138('0x25')](respondWithResult(_0x2bdad9,null))[_0xc138('0x41')](handleError(_0x2bdad9,null));};exports[_0xc138('0x45')]=function(_0x520741,_0x34019b){return db[_0xc138('0x2b')][_0xc138('0x45')](_0x520741[_0xc138('0x46')],{})[_0xc138('0x25')](respondWithResult(_0x34019b,0xc9))[_0xc138('0x41')](handleError(_0x34019b,null));};exports[_0xc138('0x24')]=function(_0x4f8f79,_0x59a92b){if(_0x4f8f79[_0xc138('0x46')]['id']){delete _0x4f8f79[_0xc138('0x46')]['id'];}return db[_0xc138('0x2b')][_0xc138('0x44')]({'where':{'id':_0x4f8f79[_0xc138('0x47')]['id']}})[_0xc138('0x25')](handleEntityNotFound(_0x59a92b,null))[_0xc138('0x25')](saveUpdates(_0x4f8f79[_0xc138('0x46')],null))[_0xc138('0x25')](respondWithResult(_0x59a92b,null))[_0xc138('0x41')](handleError(_0x59a92b,null));};exports[_0xc138('0x26')]=function(_0x4a17bc,_0x1175e2){return db[_0xc138('0x2b')]['find']({'where':{'id':_0x4a17bc[_0xc138('0x47')]['id']}})[_0xc138('0x25')](handleEntityNotFound(_0x1175e2,null))[_0xc138('0x25')](removeEntity(_0x1175e2,null))['catch'](handleError(_0x1175e2,null));};exports['getConfigurations']=function(_0x470e69,_0x2f2820,_0x27f266){var _0xbdf6b8={};var _0x5d89a6={};var _0x42e635;var _0x57da0e;return db[_0xc138('0x2b')][_0xc138('0x48')]({'where':{'id':_0x470e69[_0xc138('0x47')]['id']}})[_0xc138('0x25')](handleEntityNotFound(_0x2f2820,null))[_0xc138('0x25')](function(_0x346683){if(_0x346683){_0x42e635=_0x346683;_0x5d89a6[_0xc138('0x2f')]=_['keys'](db['SugarcrmConfiguration'][_0xc138('0x2c')]);_0x5d89a6['query']=_[_0xc138('0x43')](_0x470e69[_0xc138('0x30')]);_0x5d89a6['filters']=_['intersection'](_0x5d89a6[_0xc138('0x2f')],_0x5d89a6[_0xc138('0x30')]);_0xbdf6b8['attributes']=_[_0xc138('0x32')](_0x5d89a6[_0xc138('0x2f')],qs['fields'](_0x470e69['query'][_0xc138('0x34')]));_0xbdf6b8[_0xc138('0x33')]=_0xbdf6b8['attributes'][_0xc138('0x49')]?_0xbdf6b8[_0xc138('0x33')]:_0x5d89a6[_0xc138('0x2f')];_0xbdf6b8['order']=qs[_0xc138('0x37')](_0x470e69[_0xc138('0x30')][_0xc138('0x37')]);_0xbdf6b8[_0xc138('0x38')]=qs[_0xc138('0x31')](_[_0xc138('0x39')](_0x470e69['query'],_0x5d89a6['filters']));if(_0x470e69['query'][_0xc138('0x3a')]){_0xbdf6b8[_0xc138('0x38')]=_[_0xc138('0x3b')](_0xbdf6b8[_0xc138('0x38')],{'$or':_['map'](_0xbdf6b8['attributes'],function(_0x36ab17){var _0x169cce={};_0x169cce[_0x36ab17]={'$like':'%'+_0x470e69[_0xc138('0x30')][_0xc138('0x3a')]+'%'};return _0x169cce;})});}_0xbdf6b8=_[_0xc138('0x3b')]({},_0xbdf6b8,_0x470e69[_0xc138('0x3d')]);return _0x42e635[_0xc138('0x4a')](_0xbdf6b8);}})[_0xc138('0x25')](function(_0x278d42){if(_0x278d42){_0x57da0e=_0x278d42[_0xc138('0x49')];if(!_0x470e69['query'][_0xc138('0x35')](_0xc138('0x36'))){_0xbdf6b8[_0xc138('0x1b')]=qs[_0xc138('0x1b')](_0x470e69['query']['limit']);_0xbdf6b8[_0xc138('0x1a')]=qs[_0xc138('0x1a')](_0x470e69[_0xc138('0x30')][_0xc138('0x1a')]);}return _0x42e635[_0xc138('0x4a')](_0xbdf6b8);}})[_0xc138('0x25')](function(_0x4f91c6){if(_0x4f91c6){return _0x4f91c6?{'count':_0x57da0e,'rows':_0x4f91c6}:null;}})[_0xc138('0x25')](respondWithResult(_0x2f2820,null))[_0xc138('0x41')](handleError(_0x2f2820,null));};exports[_0xc138('0x4b')]=function(_0x30a8c3,_0x3f8a24,_0x37cd49){if(_0x30a8c3[_0xc138('0x46')]['id']){delete _0x30a8c3[_0xc138('0x46')]['id'];}return db[_0xc138('0x2b')]['findOne']({'where':{'id':_0x30a8c3['params']['id']}})['then'](handleEntityNotFound(_0x3f8a24,null))['then'](function(_0xaf55c8){if(_0xaf55c8){_0x30a8c3['body']['AccountId']=_0xaf55c8['id'];_0x30a8c3[_0xc138('0x46')][_0xc138('0x4c')]=integrations[_0xc138('0x4d')](_0x30a8c3[_0xc138('0x46')][_0xc138('0x4e')],_0x30a8c3[_0xc138('0x46')]['type']);_0x30a8c3['body'][_0xc138('0x4f')]=integrations[_0xc138('0x50')](_0x30a8c3['body'][_0xc138('0x4e')],_0x30a8c3['body']['type']);return db[_0xc138('0x51')][_0xc138('0x45')](_0x30a8c3['body'],{'include':[{'model':db[_0xc138('0x52')],'as':_0xc138('0x4c')},{'model':db[_0xc138('0x52')],'as':_0xc138('0x4f')}]});}return null;})[_0xc138('0x25')](respondWithResult(_0x3f8a24,null))['catch'](handleError(_0x3f8a24,null));};exports['getFields']=function(_0x20cc66,_0x452d22,_0x3a9a57){var _0x506f58='';var _0x4b09f0=['id',_0xc138('0x28'),'assigned_user_id','created_by',_0xc138('0x53'),_0xc138('0x54'),_0xc138('0x55'),_0xc138('0x56'),'parent_id',_0xc138('0x57'),_0xc138('0x58'),'direction'];return db[_0xc138('0x2b')]['findOne']({'where':{'id':_0x20cc66[_0xc138('0x47')]['id']},'attributes':['id',_0xc138('0x59'),'password',_0xc138('0x5a')]})['then'](handleEntityNotFound(_0x452d22,null))[_0xc138('0x25')](function(_0xe0468d){if(_0xe0468d){_0x506f58=_0xe0468d[_0xc138('0x5a')];var _0x4f3195=_0x506f58['slice'](-0x1);if(_0x4f3195==='/'){_0x506f58=_0x506f58[_0xc138('0x5b')](0x0,_0x506f58[_0xc138('0x5c')](_0x4f3195));}return rp({'method':'POST','uri':util['format'](_0xc138('0x5d'),_0x506f58,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'login','input_type':_0xc138('0x5e'),'response_type':_0xc138('0x5e'),'rest_data':JSON[_0xc138('0x5f')]({'user_auth':{'user_name':_0xe0468d[_0xc138('0x59')],'password':_0xe0468d[_0xc138('0x60')],'encryption':_0xc138('0x61')},'application':_0xc138('0x62')})}});}})[_0xc138('0x25')](function(_0x5934f6){if(_0x5934f6&&_0x5934f6[_0xc138('0x28')]!=='Invalid\x20Login'&&_0x5934f6[_0xc138('0x28')]!=='Password\x20Expired'){return rp({'method':_0xc138('0x63'),'uri':util[_0xc138('0x64')](_0xc138('0x5d'),_0x506f58,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'get_module_fields','input_type':_0xc138('0x5e'),'response_type':_0xc138('0x5e'),'rest_data':JSON['stringify']({'session':_0x5934f6['id'],'module_name':_0xc138('0x65')})}})[_0xc138('0x25')](function(_0x33083b){if(_0x33083b){var _0x5a9a01=_[_0xc138('0x66')](_0x33083b['module_fields']);_[_0xc138('0x67')](_0x5a9a01,function(_0x2c82dd){return _0x4b09f0['includes'](_0x2c82dd[_0xc138('0x28')]);});return{'count':_0x5a9a01[_0xc138('0x49')],'rows':_[_0xc138('0x2a')](_0x5a9a01,function(_0x4c610b){return{'id':_0x4c610b[_0xc138('0x28')],'name':_0x4c610b[_0xc138('0x68')],'custom':_[_0xc138('0x69')](_0x4c610b[_0xc138('0x28')],'_c')?!![]:![],'options':_0x4c610b[_0xc138('0x3d')]?_['map'](_['values'](_0x4c610b['options']),function(_0x599cd5){return{'name':_0x599cd5[_0xc138('0x6a')],'value':_0x599cd5['name']};}):[]};})};}})[_0xc138('0x25')](respondWithResult(_0x452d22,null))[_0xc138('0x41')](function(_0x35b57c){var _0x535978=_0x20cc66['query'][_0xc138('0x6b')]?0x1f4:_0x35b57c[_0xc138('0x6c')]||0x1f4;logger['error'](_0xc138('0x6d'),'getFields',_0x535978,JSON[_0xc138('0x5f')](_0x35b57c));delete _0x35b57c[_0xc138('0x28')];if(_0x535978===0x191){_0x535978=0x190;}_0x452d22['status'](_0x535978)['send'](_0x20cc66['query'][_0xc138('0x6b')]?{'message':_0xc138('0x6e'),'statusCode':_0x35b57c['statusCode']}:_0x35b57c);});}else{var _0x3867f4=0x1f4;_0x452d22[_0xc138('0x18')](_0x3867f4)[_0xc138('0x6f')]({'message':_0xc138('0x6e'),'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 64df89b..895bf3f 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 _0x4171=['path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','define','SugarcrmAccount','../../config/logger','moment','bluebird'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4171,0xcf));var _0x1417=function(_0x68f811,_0x3cb9e6){_0x68f811=_0x68f811-0x0;var _0x43f7c2=_0x4171[_0x68f811];return _0x43f7c2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1417('0x0'))('api');var moment=require(_0x1417('0x1'));var BPromise=require(_0x1417('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1417('0x3'));var rimraf=require(_0x1417('0x4'));var config=require(_0x1417('0x5'));var attributes=require(_0x1417('0x6'));var integrations=require(_0x1417('0x7'));module['exports']=function(_0x48e296,_0x130817){return _0x48e296[_0x1417('0x8')](_0x1417('0x9'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5a3e=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intSugarcrmAccount.attributes'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5a3e,0xbd));var _0xe5a3=function(_0x59fc26,_0x4dda73){_0x59fc26=_0x59fc26-0x0;var _0x14e27e=_0x5a3e[_0x59fc26];return _0x14e27e;};'use strict';var _=require('lodash');var util=require(_0xe5a3('0x0'));var logger=require(_0xe5a3('0x1'))(_0xe5a3('0x2'));var moment=require(_0xe5a3('0x3'));var BPromise=require(_0xe5a3('0x4'));var rp=require(_0xe5a3('0x5'));var fs=require('fs');var path=require(_0xe5a3('0x6'));var rimraf=require(_0xe5a3('0x7'));var config=require('../../config/environment');var attributes=require(_0xe5a3('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x49c41f,_0x1df7b3){return _0x49c41f['define']('SugarcrmAccount',attributes,{'tableName':'int_sugarcrm_accounts','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 4627c34..91b26cc 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 _0x033a=['http','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','where','attributes','limit','map','include','model','ShowSugarcrmAccount','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x41453c,_0x241b3d){var _0x39f9d5=function(_0x28c1a1){while(--_0x28c1a1){_0x41453c['push'](_0x41453c['shift']());}};_0x39f9d5(++_0x241b3d);}(_0x033a,0xd7));var _0xa033=function(_0x310504,_0x26ad95){_0x310504=_0x310504-0x0;var _0x5b36d0=_0x033a[_0x310504];return _0x5b36d0;};'use strict';var _=require(_0xa033('0x0'));var util=require(_0xa033('0x1'));var moment=require(_0xa033('0x2'));var BPromise=require(_0xa033('0x3'));var rs=require(_0xa033('0x4'));var fs=require('fs');var Redis=require(_0xa033('0x5'));var db=require(_0xa033('0x6'))['db'];var utils=require(_0xa033('0x7'));var logger=require(_0xa033('0x8'))(_0xa033('0x9'));var config=require(_0xa033('0xa'));var jayson=require(_0xa033('0xb'));var client=jayson[_0xa033('0xc')][_0xa033('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x8cc5c5,_0x1f979a,_0x29cc4e){return new BPromise(function(_0x4876ba,_0x49df3e){return client['request'](_0x8cc5c5,_0x29cc4e)[_0xa033('0xe')](function(_0x3aa5cb){logger['info'](_0xa033('0xf'),_0x1f979a,_0xa033('0x10'));logger[_0xa033('0x11')](_0xa033('0x12'),_0x1f979a,'request\x20sent',JSON[_0xa033('0x13')](_0x3aa5cb));if(_0x3aa5cb[_0xa033('0x14')]){if(_0x3aa5cb[_0xa033('0x14')][_0xa033('0x15')]===0x1f4){logger[_0xa033('0x14')](_0xa033('0xf'),_0x1f979a,_0x3aa5cb[_0xa033('0x14')][_0xa033('0x16')]);return _0x49df3e(_0x3aa5cb['error'][_0xa033('0x16')]);}logger[_0xa033('0x14')](_0xa033('0xf'),_0x1f979a,_0x3aa5cb['error'][_0xa033('0x16')]);return _0x4876ba(_0x3aa5cb[_0xa033('0x14')]['message']);}else{logger[_0xa033('0x17')](_0xa033('0xf'),_0x1f979a,_0xa033('0x10'));_0x4876ba(_0x3aa5cb['result'][_0xa033('0x16')]);}})[_0xa033('0x18')](function(_0x3abc8e){logger[_0xa033('0x14')]('SugarcrmAccount,\x20%s,\x20%s',_0x1f979a,_0x3abc8e);_0x49df3e(_0x3abc8e);});});}exports[_0xa033('0x19')]=function(_0x3df52b){var _0x54ac98=this;return new Promise(function(_0x34e018,_0x33b481){return db[_0xa033('0x1a')][_0xa033('0x1b')]({'raw':_0x3df52b[_0xa033('0x1c')]?_0x3df52b[_0xa033('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x3df52b['options']?_0x3df52b[_0xa033('0x1c')][_0xa033('0x1d')]||null:null,'attributes':_0x3df52b[_0xa033('0x1c')]?_0x3df52b[_0xa033('0x1c')][_0xa033('0x1e')]||null:null,'limit':_0x3df52b[_0xa033('0x1c')]?_0x3df52b[_0xa033('0x1c')][_0xa033('0x1f')]||null:null,'include':_0x3df52b['options']?_0x3df52b[_0xa033('0x1c')]['include']?_[_0xa033('0x20')](_0x3df52b[_0xa033('0x1c')][_0xa033('0x21')],function(_0x3d88e1){return{'model':db[_0x3d88e1[_0xa033('0x22')]],'as':_0x3d88e1['as'],'attributes':_0x3d88e1[_0xa033('0x1e')],'include':_0x3d88e1[_0xa033('0x21')]?_[_0xa033('0x20')](_0x3d88e1[_0xa033('0x21')],function(_0x3e3dc9){return{'model':db[_0x3e3dc9['model']],'as':_0x3e3dc9['as'],'attributes':_0x3e3dc9[_0xa033('0x1e')],'include':_0x3e3dc9[_0xa033('0x21')]?_[_0xa033('0x20')](_0x3e3dc9[_0xa033('0x21')],function(_0x11d014){return{'model':db[_0x11d014[_0xa033('0x22')]],'as':_0x11d014['as'],'attributes':_0x11d014[_0xa033('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa033('0xe')](function(_0x4d22d7){logger[_0xa033('0x17')](_0xa033('0x19'),_0x3df52b);logger[_0xa033('0x11')](_0xa033('0x19'),_0x3df52b,JSON[_0xa033('0x13')](_0x4d22d7));_0x34e018(_0x4d22d7);})[_0xa033('0x18')](function(_0x12d4e3){logger[_0xa033('0x14')](_0xa033('0x19'),_0x12d4e3['message'],_0x3df52b);_0x33b481(_0x54ac98['error'](0x1f4,_0x12d4e3['message']));});});};exports[_0xa033('0x23')]=function(_0x9dc315){var _0x3e9af9=this;return new Promise(function(_0x3806b4,_0x139870){return db[_0xa033('0x1a')][_0xa033('0x24')]({'raw':_0x9dc315[_0xa033('0x1c')]?_0x9dc315['options'][_0xa033('0x25')]===undefined?!![]:![]:!![],'where':_0x9dc315[_0xa033('0x1c')]?_0x9dc315[_0xa033('0x1c')][_0xa033('0x1d')]||null:null,'attributes':_0x9dc315['options']?_0x9dc315[_0xa033('0x1c')]['attributes']||null:null,'include':_0x9dc315[_0xa033('0x1c')]?_0x9dc315[_0xa033('0x1c')][_0xa033('0x21')]?_['map'](_0x9dc315[_0xa033('0x1c')][_0xa033('0x21')],function(_0x1e5173){return{'model':db[_0x1e5173[_0xa033('0x22')]],'as':_0x1e5173['as'],'attributes':_0x1e5173['attributes'],'include':_0x1e5173[_0xa033('0x21')]?_[_0xa033('0x20')](_0x1e5173[_0xa033('0x21')],function(_0x36aa5c){return{'model':db[_0x36aa5c[_0xa033('0x22')]],'as':_0x36aa5c['as'],'attributes':_0x36aa5c[_0xa033('0x1e')],'include':_0x36aa5c[_0xa033('0x21')]?_[_0xa033('0x20')](_0x36aa5c[_0xa033('0x21')],function(_0x40ebb4){return{'model':db[_0x40ebb4[_0xa033('0x22')]],'as':_0x40ebb4['as'],'attributes':_0x40ebb4[_0xa033('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x313489){logger[_0xa033('0x17')]('ShowSugarcrmAccount',_0x9dc315);logger[_0xa033('0x11')](_0xa033('0x23'),_0x9dc315,JSON[_0xa033('0x13')](_0x313489));_0x3806b4(_0x313489);})[_0xa033('0x18')](function(_0x1823f8){logger[_0xa033('0x14')](_0xa033('0x23'),_0x1823f8[_0xa033('0x16')],_0x9dc315);_0x139870(_0x3e9af9[_0xa033('0x14')](0x1f4,_0x1823f8['message']));});});}; \ No newline at end of file +var _0x2b7c=['util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','where','attributes','limit','include','map','model','info','stringify','find','ShowSugarcrmAccount'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x2b7c,0x66));var _0xc2b7=function(_0x46e72e,_0x263ba1){_0x46e72e=_0x46e72e-0x0;var _0x2dee62=_0x2b7c[_0x46e72e];return _0x2dee62;};'use strict';var _=require('lodash');var util=require(_0xc2b7('0x0'));var moment=require(_0xc2b7('0x1'));var BPromise=require('bluebird');var rs=require(_0xc2b7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc2b7('0x3'))['db'];var utils=require(_0xc2b7('0x4'));var logger=require(_0xc2b7('0x5'))(_0xc2b7('0x6'));var config=require(_0xc2b7('0x7'));var jayson=require(_0xc2b7('0x8'));var client=jayson['client'][_0xc2b7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2eabad,_0x19a304,_0x24984c){return new BPromise(function(_0x4ca994,_0x5e2474){return client['request'](_0x2eabad,_0x24984c)[_0xc2b7('0xa')](function(_0x37c397){logger['info'](_0xc2b7('0xb'),_0x19a304,_0xc2b7('0xc'));logger[_0xc2b7('0xd')](_0xc2b7('0xe'),_0x19a304,_0xc2b7('0xc'),JSON['stringify'](_0x37c397));if(_0x37c397[_0xc2b7('0xf')]){if(_0x37c397[_0xc2b7('0xf')][_0xc2b7('0x10')]===0x1f4){logger['error'](_0xc2b7('0xb'),_0x19a304,_0x37c397[_0xc2b7('0xf')][_0xc2b7('0x11')]);return _0x5e2474(_0x37c397[_0xc2b7('0xf')][_0xc2b7('0x11')]);}logger[_0xc2b7('0xf')](_0xc2b7('0xb'),_0x19a304,_0x37c397[_0xc2b7('0xf')][_0xc2b7('0x11')]);return _0x4ca994(_0x37c397[_0xc2b7('0xf')][_0xc2b7('0x11')]);}else{logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x19a304,_0xc2b7('0xc'));_0x4ca994(_0x37c397[_0xc2b7('0x12')][_0xc2b7('0x11')]);}})[_0xc2b7('0x13')](function(_0x5f0523){logger[_0xc2b7('0xf')](_0xc2b7('0xb'),_0x19a304,_0x5f0523);_0x5e2474(_0x5f0523);});});}exports[_0xc2b7('0x14')]=function(_0x22e7d9){var _0x245660=this;return new Promise(function(_0x13e761,_0x47bd4e){return db[_0xc2b7('0x15')][_0xc2b7('0x16')]({'raw':_0x22e7d9['options']?_0x22e7d9[_0xc2b7('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x22e7d9[_0xc2b7('0x17')]?_0x22e7d9[_0xc2b7('0x17')][_0xc2b7('0x18')]||null:null,'attributes':_0x22e7d9['options']?_0x22e7d9[_0xc2b7('0x17')][_0xc2b7('0x19')]||null:null,'limit':_0x22e7d9[_0xc2b7('0x17')]?_0x22e7d9['options'][_0xc2b7('0x1a')]||null:null,'include':_0x22e7d9[_0xc2b7('0x17')]?_0x22e7d9['options'][_0xc2b7('0x1b')]?_[_0xc2b7('0x1c')](_0x22e7d9['options']['include'],function(_0x444ecd){return{'model':db[_0x444ecd[_0xc2b7('0x1d')]],'as':_0x444ecd['as'],'attributes':_0x444ecd['attributes'],'include':_0x444ecd[_0xc2b7('0x1b')]?_['map'](_0x444ecd['include'],function(_0x91991f){return{'model':db[_0x91991f['model']],'as':_0x91991f['as'],'attributes':_0x91991f[_0xc2b7('0x19')],'include':_0x91991f[_0xc2b7('0x1b')]?_['map'](_0x91991f['include'],function(_0x1a905a){return{'model':db[_0x1a905a[_0xc2b7('0x1d')]],'as':_0x1a905a['as'],'attributes':_0x1a905a['attributes']};}):[]};}):[]};}):[]:[]})[_0xc2b7('0xa')](function(_0x50a783){logger[_0xc2b7('0x1e')](_0xc2b7('0x14'),_0x22e7d9);logger[_0xc2b7('0xd')](_0xc2b7('0x14'),_0x22e7d9,JSON[_0xc2b7('0x1f')](_0x50a783));_0x13e761(_0x50a783);})[_0xc2b7('0x13')](function(_0x29f12c){logger[_0xc2b7('0xf')](_0xc2b7('0x14'),_0x29f12c[_0xc2b7('0x11')],_0x22e7d9);_0x47bd4e(_0x245660['error'](0x1f4,_0x29f12c[_0xc2b7('0x11')]));});});};exports['ShowSugarcrmAccount']=function(_0x43026f){var _0x50b07d=this;return new Promise(function(_0x410357,_0x3b5cac){return db[_0xc2b7('0x15')][_0xc2b7('0x20')]({'raw':_0x43026f[_0xc2b7('0x17')]?_0x43026f[_0xc2b7('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x43026f[_0xc2b7('0x17')]?_0x43026f['options'][_0xc2b7('0x18')]||null:null,'attributes':_0x43026f[_0xc2b7('0x17')]?_0x43026f['options'][_0xc2b7('0x19')]||null:null,'include':_0x43026f['options']?_0x43026f['options'][_0xc2b7('0x1b')]?_[_0xc2b7('0x1c')](_0x43026f[_0xc2b7('0x17')]['include'],function(_0x2c157d){return{'model':db[_0x2c157d[_0xc2b7('0x1d')]],'as':_0x2c157d['as'],'attributes':_0x2c157d[_0xc2b7('0x19')],'include':_0x2c157d['include']?_[_0xc2b7('0x1c')](_0x2c157d[_0xc2b7('0x1b')],function(_0x299aae){return{'model':db[_0x299aae['model']],'as':_0x299aae['as'],'attributes':_0x299aae[_0xc2b7('0x19')],'include':_0x299aae['include']?_[_0xc2b7('0x1c')](_0x299aae[_0xc2b7('0x1b')],function(_0x31b27a){return{'model':db[_0x31b27a[_0xc2b7('0x1d')]],'as':_0x31b27a['as'],'attributes':_0x31b27a[_0xc2b7('0x19')]};}):[]};}):[]};}):[]:[]})[_0xc2b7('0xa')](function(_0x5d60aa){logger['info'](_0xc2b7('0x21'),_0x43026f);logger['debug'](_0xc2b7('0x21'),_0x43026f,JSON[_0xc2b7('0x1f')](_0x5d60aa));_0x410357(_0x5d60aa);})[_0xc2b7('0x13')](function(_0x3f0226){logger[_0xc2b7('0xf')](_0xc2b7('0x21'),_0x3f0226[_0xc2b7('0x11')],_0x43026f);_0x3b5cac(_0x50b07d[_0xc2b7('0xf')](0x1f4,_0x3f0226['message']));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index a1befcb..754aea0 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 _0x36bc=['/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmConfiguration.controller','isAuthenticated','/:id','show','get','/:id/fields'];(function(_0x2e913b,_0x4b7071){var _0x173899=function(_0x2a7d22){while(--_0x2a7d22){_0x2e913b['push'](_0x2e913b['shift']());}};_0x173899(++_0x4b7071);}(_0x36bc,0x1a8));var _0xc36b=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x36bc[_0xbb091];return _0x467a04;};'use strict';var multer=require(_0xc36b('0x0'));var util=require('util');var path=require(_0xc36b('0x1'));var timeout=require(_0xc36b('0x2'));var express=require(_0xc36b('0x3'));var router=express['Router']();var fs_extra=require(_0xc36b('0x4'));var auth=require(_0xc36b('0x5'));var interaction=require(_0xc36b('0x6'));var config=require('../../config/environment');var controller=require(_0xc36b('0x7'));router['get']('/',auth[_0xc36b('0x8')](),controller['index']);router['get'](_0xc36b('0x9'),auth[_0xc36b('0x8')](),controller[_0xc36b('0xa')]);router[_0xc36b('0xb')](_0xc36b('0xc'),auth[_0xc36b('0x8')](),controller['getFields']);router[_0xc36b('0xb')](_0xc36b('0xd'),auth[_0xc36b('0x8')](),controller[_0xc36b('0xe')]);router['get'](_0xc36b('0xf'),auth[_0xc36b('0x8')](),controller[_0xc36b('0x10')]);router['post']('/',auth[_0xc36b('0x8')](),controller[_0xc36b('0x11')]);router[_0xc36b('0x12')](_0xc36b('0x9'),auth['isAuthenticated'](),controller[_0xc36b('0x13')]);router[_0xc36b('0x14')](_0xc36b('0x9'),auth[_0xc36b('0x8')](),controller[_0xc36b('0x15')]);module[_0xc36b('0x16')]=router; \ No newline at end of file +var _0xbe19=['delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','/:id','get','/:id/fields','/:id/descriptions','getDescriptions','post','create','put','update'];(function(_0x339a9d,_0x403f5d){var _0x274cf8=function(_0x3908ae){while(--_0x3908ae){_0x339a9d['push'](_0x339a9d['shift']());}};_0x274cf8(++_0x403f5d);}(_0xbe19,0x1e6));var _0x9be1=function(_0xd373a4,_0x151ec8){_0xd373a4=_0xd373a4-0x0;var _0x43ed20=_0xbe19[_0xd373a4];return _0x43ed20;};'use strict';var multer=require(_0x9be1('0x0'));var util=require('util');var path=require(_0x9be1('0x1'));var timeout=require(_0x9be1('0x2'));var express=require('express');var router=express[_0x9be1('0x3')]();var fs_extra=require(_0x9be1('0x4'));var auth=require(_0x9be1('0x5'));var interaction=require(_0x9be1('0x6'));var config=require('../../config/environment');var controller=require('./intSugarcrmConfiguration.controller');router['get']('/',auth[_0x9be1('0x7')](),controller[_0x9be1('0x8')]);router['get'](_0x9be1('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x9be1('0xa')](_0x9be1('0xb'),auth[_0x9be1('0x7')](),controller['getFields']);router[_0x9be1('0xa')]('/:id/subjects',auth[_0x9be1('0x7')](),controller['getSubjects']);router[_0x9be1('0xa')](_0x9be1('0xc'),auth[_0x9be1('0x7')](),controller[_0x9be1('0xd')]);router[_0x9be1('0xe')]('/',auth[_0x9be1('0x7')](),controller[_0x9be1('0xf')]);router[_0x9be1('0x10')](_0x9be1('0x9'),auth[_0x9be1('0x7')](),controller[_0x9be1('0x11')]);router[_0x9be1('0x12')](_0x9be1('0x9'),auth[_0x9be1('0x7')](),controller[_0x9be1('0x13')]);module[_0x9be1('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 1611570..09f23ac 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 _0x1a57=['STRING','exports'];(function(_0x367361,_0x311488){var _0x195d2d=function(_0x2b20a4){while(--_0x2b20a4){_0x367361['push'](_0x367361['shift']());}};_0x195d2d(++_0x311488);}(_0x1a57,0x1bf));var _0x71a5=function(_0x44694f,_0x3ce45b){_0x44694f=_0x44694f-0x0;var _0x2b0e70=_0x1a57[_0x44694f];return _0x2b0e70;};'use strict';var Sequelize=require('sequelize');module[_0x71a5('0x0')]={'name':{'type':Sequelize[_0x71a5('0x1')]},'description':{'type':Sequelize[_0x71a5('0x1')]}}; \ No newline at end of file +var _0xd827=['STRING','exports'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xd827,0x75));var _0x7d82=function(_0x13a0d6,_0x9a1972){_0x13a0d6=_0x13a0d6-0x0;var _0x241df1=_0xd827[_0x13a0d6];return _0x241df1;};'use strict';var Sequelize=require('sequelize');module[_0x7d82('0x0')]={'name':{'type':Sequelize[_0x7d82('0x1')]},'description':{'type':Sequelize[_0x7d82('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 23778c3..8ee4536 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 _0x52af=['squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','count','limit','set','reject','save','update','then','destroy','status','sendStatus','error','stack','name','send','index','map','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','VIRTUAL','options','SugarcrmConfiguration','includeAll','findAll','rows','catch','show','params','keys','length','include','find','create','body','getFields','SugarcrmField','rawAttributes','getSubjects','findOne','pick','getDescriptions','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash'];(function(_0x8ded35,_0x148864){var _0x1f5408=function(_0x50ad22){while(--_0x50ad22){_0x8ded35['push'](_0x8ded35['shift']());}};_0x1f5408(++_0x148864);}(_0x52af,0xe7));var _0xf52a=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x52af[_0x7e2eb0];return _0xd92de4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf52a('0x0'));var rp=require(_0xf52a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf52a('0x2'));var util=require(_0xf52a('0x3'));var path=require(_0xf52a('0x4'));var sox=require('sox');var csv=require(_0xf52a('0x5'));var ejs=require(_0xf52a('0x6'));var fs=require('fs');var fs_extra=require(_0xf52a('0x7'));var _=require(_0xf52a('0x8'));var squel=require(_0xf52a('0x9'));var crypto=require(_0xf52a('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xf52a('0xb'));var toCsv=require(_0xf52a('0x5'));var querystring=require(_0xf52a('0xc'));var Papa=require(_0xf52a('0xd'));var Redis=require('ioredis');var authService=require(_0xf52a('0xe'));var qs=require(_0xf52a('0xf'));var as=require(_0xf52a('0x10'));var hardwareService=require(_0xf52a('0x11'));var logger=require(_0xf52a('0x12'))(_0xf52a('0x13'));var utils=require(_0xf52a('0x14'));var config=require(_0xf52a('0x15'));var licenseUtil=require(_0xf52a('0x16'));var db=require(_0xf52a('0x17'))['db'];function respondWithStatusCode(_0x4e3fe5,_0x4bb142){_0x4bb142=_0x4bb142||0xcc;return function(_0x1b2eff){if(_0x1b2eff){return _0x4e3fe5['sendStatus'](_0x4bb142);}return _0x4e3fe5['status'](_0x4bb142)[_0xf52a('0x18')]();};}function respondWithResult(_0x2a1708,_0x2f2cbf){_0x2f2cbf=_0x2f2cbf||0xc8;return function(_0x887880){if(_0x887880){return _0x2a1708['status'](_0x2f2cbf)[_0xf52a('0x19')](_0x887880);}};}function respondWithFilteredResult(_0x32032f,_0x2aa5a2){return function(_0x442a85){if(_0x442a85){var _0x18368b=typeof _0x2aa5a2[_0xf52a('0x1a')]==='undefined'&&typeof _0x2aa5a2['limit']==='undefined';var _0x32d173=_0x442a85[_0xf52a('0x1b')];var _0x2f590a=_0x18368b?0x0:_0x2aa5a2[_0xf52a('0x1a')];var _0x1ba641=_0x18368b?_0x442a85[_0xf52a('0x1b')]:_0x2aa5a2['offset']+_0x2aa5a2[_0xf52a('0x1c')];var _0x518980;if(_0x1ba641>=_0x32d173){_0x1ba641=_0x32d173;_0x518980=0xc8;}else{_0x518980=0xce;}_0x32032f['status'](_0x518980);return _0x32032f[_0xf52a('0x1d')]('Content-Range',_0x2f590a+'-'+_0x1ba641+'/'+_0x32d173)[_0xf52a('0x19')](_0x442a85);}return null;};}function patchUpdates(_0x3e4d18){return function(_0x314963){try{jsonpatch['apply'](_0x314963,_0x3e4d18,!![]);}catch(_0x4600e7){return BPromise[_0xf52a('0x1e')](_0x4600e7);}return _0x314963[_0xf52a('0x1f')]();};}function saveUpdates(_0x1e694b,_0x3820b0){return function(_0x16e1cc){if(_0x16e1cc){return _0x16e1cc[_0xf52a('0x20')](_0x1e694b)[_0xf52a('0x21')](function(_0xd5e0a1){return _0xd5e0a1;});}return null;};}function removeEntity(_0x5ed6cc,_0x516518){return function(_0x57a41b){if(_0x57a41b){return _0x57a41b[_0xf52a('0x22')]()[_0xf52a('0x21')](function(){_0x5ed6cc[_0xf52a('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf57803,_0xa055dd){return function(_0x53413f){if(!_0x53413f){_0xf57803[_0xf52a('0x24')](0x194);}return _0x53413f;};}function handleError(_0x3f19fb,_0xfd203c){_0xfd203c=_0xfd203c||0x1f4;return function(_0x31ef85){logger[_0xf52a('0x25')](_0x31ef85[_0xf52a('0x26')]);if(_0x31ef85['name']){delete _0x31ef85[_0xf52a('0x27')];}_0x3f19fb[_0xf52a('0x23')](_0xfd203c)[_0xf52a('0x28')](_0x31ef85);};}exports[_0xf52a('0x29')]=function(_0x7c130c,_0x2208dc){var _0x1764f1={},_0xa878b8={},_0x2ba7b6={'count':0x0,'rows':[]};var _0x4df835=_[_0xf52a('0x2a')](db['SugarcrmConfiguration']['rawAttributes'],function(_0x1b1654){return{'name':_0x1b1654['fieldName'],'type':_0x1b1654['type'][_0xf52a('0x2b')]};});_0xa878b8[_0xf52a('0x2c')]=_[_0xf52a('0x2a')](_0x4df835,_0xf52a('0x27'));_0xa878b8['query']=_['keys'](_0x7c130c[_0xf52a('0x2d')]);_0xa878b8[_0xf52a('0x2e')]=_[_0xf52a('0x2f')](_0xa878b8['model'],_0xa878b8[_0xf52a('0x2d')]);_0x1764f1[_0xf52a('0x30')]=_[_0xf52a('0x2f')](_0xa878b8[_0xf52a('0x2c')],qs[_0xf52a('0x31')](_0x7c130c[_0xf52a('0x2d')]['fields']));_0x1764f1[_0xf52a('0x30')]=_0x1764f1['attributes']['length']?_0x1764f1['attributes']:_0xa878b8['model'];if(!_0x7c130c[_0xf52a('0x2d')][_0xf52a('0x32')](_0xf52a('0x33'))){_0x1764f1['limit']=qs[_0xf52a('0x1c')](_0x7c130c[_0xf52a('0x2d')][_0xf52a('0x1c')]);_0x1764f1[_0xf52a('0x1a')]=qs[_0xf52a('0x1a')](_0x7c130c['query']['offset']);}_0x1764f1[_0xf52a('0x34')]=qs[_0xf52a('0x35')](_0x7c130c[_0xf52a('0x2d')][_0xf52a('0x35')]);_0x1764f1['where']=qs[_0xf52a('0x2e')](_['pick'](_0x7c130c[_0xf52a('0x2d')],_0xa878b8[_0xf52a('0x2e')]),_0x4df835);if(_0x7c130c[_0xf52a('0x2d')][_0xf52a('0x36')]){_0x1764f1[_0xf52a('0x37')]=_[_0xf52a('0x38')](_0x1764f1[_0xf52a('0x37')],{'$or':_[_0xf52a('0x2a')](_0x4df835,function(_0x16bea7){if(_0x16bea7[_0xf52a('0x39')]!==_0xf52a('0x3a')){var _0x2d5e48={};_0x2d5e48[_0x16bea7[_0xf52a('0x27')]]={'$like':'%'+_0x7c130c[_0xf52a('0x2d')]['filter']+'%'};return _0x2d5e48;}})});}_0x1764f1=_['merge']({},_0x1764f1,_0x7c130c[_0xf52a('0x3b')]);var _0x19d4f0={'where':_0x1764f1['where']};return db[_0xf52a('0x3c')][_0xf52a('0x1b')](_0x19d4f0)[_0xf52a('0x21')](function(_0x2fe892){_0x2ba7b6[_0xf52a('0x1b')]=_0x2fe892;if(_0x7c130c['query'][_0xf52a('0x3d')]){_0x1764f1['include']=[{'all':!![]}];}return db[_0xf52a('0x3c')][_0xf52a('0x3e')](_0x1764f1);})[_0xf52a('0x21')](function(_0x21e49f){_0x2ba7b6[_0xf52a('0x3f')]=_0x21e49f;return _0x2ba7b6;})[_0xf52a('0x21')](respondWithFilteredResult(_0x2208dc,_0x1764f1))[_0xf52a('0x40')](handleError(_0x2208dc,null));};exports[_0xf52a('0x41')]=function(_0x1acf7a,_0x4f9c1e){var _0x430e88={'raw':![],'where':{'id':_0x1acf7a[_0xf52a('0x42')]['id']}},_0x559b25={};_0x559b25['model']=_[_0xf52a('0x43')](db[_0xf52a('0x3c')]['rawAttributes']);_0x559b25[_0xf52a('0x2d')]=_[_0xf52a('0x43')](_0x1acf7a[_0xf52a('0x2d')]);_0x559b25[_0xf52a('0x2e')]=_['intersection'](_0x559b25[_0xf52a('0x2c')],_0x559b25[_0xf52a('0x2d')]);_0x430e88[_0xf52a('0x30')]=_[_0xf52a('0x2f')](_0x559b25[_0xf52a('0x2c')],qs[_0xf52a('0x31')](_0x1acf7a[_0xf52a('0x2d')][_0xf52a('0x31')]));_0x430e88[_0xf52a('0x30')]=_0x430e88[_0xf52a('0x30')][_0xf52a('0x44')]?_0x430e88[_0xf52a('0x30')]:_0x559b25[_0xf52a('0x2c')];if(_0x1acf7a[_0xf52a('0x2d')][_0xf52a('0x3d')]){_0x430e88[_0xf52a('0x45')]=[{'all':!![]}];}_0x430e88=_[_0xf52a('0x38')]({},_0x430e88,_0x1acf7a['options']);return db[_0xf52a('0x3c')][_0xf52a('0x46')](_0x430e88)['then'](handleEntityNotFound(_0x4f9c1e,null))[_0xf52a('0x21')](respondWithResult(_0x4f9c1e,null))[_0xf52a('0x40')](handleError(_0x4f9c1e,null));};exports['create']=function(_0x11138f,_0x3d138f){return db[_0xf52a('0x3c')][_0xf52a('0x47')](_0x11138f[_0xf52a('0x48')],{})[_0xf52a('0x21')](respondWithResult(_0x3d138f,0xc9))[_0xf52a('0x40')](handleError(_0x3d138f,null));};exports[_0xf52a('0x20')]=function(_0x5ab9c1,_0x1e80fd){if(_0x5ab9c1[_0xf52a('0x48')]['id']){delete _0x5ab9c1[_0xf52a('0x48')]['id'];}return db[_0xf52a('0x3c')][_0xf52a('0x46')]({'where':{'id':_0x5ab9c1['params']['id']}})[_0xf52a('0x21')](handleEntityNotFound(_0x1e80fd,null))[_0xf52a('0x21')](saveUpdates(_0x5ab9c1[_0xf52a('0x48')],null))['then'](respondWithResult(_0x1e80fd,null))[_0xf52a('0x40')](handleError(_0x1e80fd,null));};exports[_0xf52a('0x22')]=function(_0x3ea604,_0x117666){return db[_0xf52a('0x3c')][_0xf52a('0x46')]({'where':{'id':_0x3ea604['params']['id']}})[_0xf52a('0x21')](handleEntityNotFound(_0x117666,null))['then'](removeEntity(_0x117666,null))[_0xf52a('0x40')](handleError(_0x117666,null));};exports[_0xf52a('0x49')]=function(_0x3baf22,_0x1e5ad3,_0xf5819b){var _0x3420db={};var _0x38bf74={};var _0x5da9cf;var _0x1cb173;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x3baf22[_0xf52a('0x42')]['id']}})[_0xf52a('0x21')](handleEntityNotFound(_0x1e5ad3,null))['then'](function(_0x2594b8){if(_0x2594b8){_0x5da9cf=_0x2594b8;_0x38bf74[_0xf52a('0x2c')]=_[_0xf52a('0x43')](db[_0xf52a('0x4a')][_0xf52a('0x4b')]);_0x38bf74['query']=_['keys'](_0x3baf22[_0xf52a('0x2d')]);_0x38bf74[_0xf52a('0x2e')]=_['intersection'](_0x38bf74[_0xf52a('0x2c')],_0x38bf74[_0xf52a('0x2d')]);_0x3420db['attributes']=_[_0xf52a('0x2f')](_0x38bf74[_0xf52a('0x2c')],qs[_0xf52a('0x31')](_0x3baf22['query'][_0xf52a('0x31')]));_0x3420db['attributes']=_0x3420db[_0xf52a('0x30')]['length']?_0x3420db['attributes']:_0x38bf74[_0xf52a('0x2c')];_0x3420db[_0xf52a('0x34')]=qs[_0xf52a('0x35')](_0x3baf22[_0xf52a('0x2d')][_0xf52a('0x35')]);_0x3420db['where']=qs[_0xf52a('0x2e')](_['pick'](_0x3baf22['query'],_0x38bf74[_0xf52a('0x2e')]));if(_0x3baf22['query'][_0xf52a('0x36')]){_0x3420db[_0xf52a('0x37')]=_['merge'](_0x3420db[_0xf52a('0x37')],{'$or':_[_0xf52a('0x2a')](_0x3420db[_0xf52a('0x30')],function(_0x416a54){var _0x3d2576={};_0x3d2576[_0x416a54]={'$like':'%'+_0x3baf22[_0xf52a('0x2d')][_0xf52a('0x36')]+'%'};return _0x3d2576;})});}_0x3420db=_[_0xf52a('0x38')]({},_0x3420db,_0x3baf22[_0xf52a('0x3b')]);return _0x5da9cf[_0xf52a('0x49')](_0x3420db);}})[_0xf52a('0x21')](function(_0x7cb40){if(_0x7cb40){_0x1cb173=_0x7cb40['length'];if(!_0x3baf22[_0xf52a('0x2d')]['hasOwnProperty'](_0xf52a('0x33'))){_0x3420db[_0xf52a('0x1c')]=qs[_0xf52a('0x1c')](_0x3baf22[_0xf52a('0x2d')][_0xf52a('0x1c')]);_0x3420db[_0xf52a('0x1a')]=qs[_0xf52a('0x1a')](_0x3baf22['query'][_0xf52a('0x1a')]);}return _0x5da9cf[_0xf52a('0x49')](_0x3420db);}})[_0xf52a('0x21')](function(_0x2888bd){if(_0x2888bd){return _0x2888bd?{'count':_0x1cb173,'rows':_0x2888bd}:null;}})[_0xf52a('0x21')](respondWithResult(_0x1e5ad3,null))[_0xf52a('0x40')](handleError(_0x1e5ad3,null));};exports[_0xf52a('0x4c')]=function(_0x29bb0c,_0x13e2fc,_0x26a230){var _0x148cf3={};var _0x1dfc64={};var _0x63c5b6;var _0x5240fa;return db['SugarcrmConfiguration'][_0xf52a('0x4d')]({'where':{'id':_0x29bb0c['params']['id']}})['then'](handleEntityNotFound(_0x13e2fc,null))['then'](function(_0x50e12f){if(_0x50e12f){_0x63c5b6=_0x50e12f;_0x1dfc64[_0xf52a('0x2c')]=_[_0xf52a('0x43')](db['SugarcrmField']['rawAttributes']);_0x1dfc64['query']=_[_0xf52a('0x43')](_0x29bb0c[_0xf52a('0x2d')]);_0x1dfc64['filters']=_['intersection'](_0x1dfc64[_0xf52a('0x2c')],_0x1dfc64[_0xf52a('0x2d')]);_0x148cf3[_0xf52a('0x30')]=_['intersection'](_0x1dfc64[_0xf52a('0x2c')],qs[_0xf52a('0x31')](_0x29bb0c[_0xf52a('0x2d')]['fields']));_0x148cf3[_0xf52a('0x30')]=_0x148cf3[_0xf52a('0x30')]['length']?_0x148cf3[_0xf52a('0x30')]:_0x1dfc64[_0xf52a('0x2c')];_0x148cf3['order']=qs[_0xf52a('0x35')](_0x29bb0c[_0xf52a('0x2d')][_0xf52a('0x35')]);_0x148cf3[_0xf52a('0x37')]=qs['filters'](_[_0xf52a('0x4e')](_0x29bb0c['query'],_0x1dfc64[_0xf52a('0x2e')]));if(_0x29bb0c[_0xf52a('0x2d')][_0xf52a('0x36')]){_0x148cf3['where']=_['merge'](_0x148cf3['where'],{'$or':_['map'](_0x148cf3[_0xf52a('0x30')],function(_0x3487c5){var _0x184290={};_0x184290[_0x3487c5]={'$like':'%'+_0x29bb0c[_0xf52a('0x2d')][_0xf52a('0x36')]+'%'};return _0x184290;})});}_0x148cf3=_[_0xf52a('0x38')]({},_0x148cf3,_0x29bb0c[_0xf52a('0x3b')]);return _0x63c5b6[_0xf52a('0x4c')](_0x148cf3);}})['then'](function(_0x2c671a){if(_0x2c671a){_0x5240fa=_0x2c671a[_0xf52a('0x44')];if(!_0x29bb0c['query'][_0xf52a('0x32')](_0xf52a('0x33'))){_0x148cf3[_0xf52a('0x1c')]=qs[_0xf52a('0x1c')](_0x29bb0c[_0xf52a('0x2d')][_0xf52a('0x1c')]);_0x148cf3['offset']=qs[_0xf52a('0x1a')](_0x29bb0c[_0xf52a('0x2d')]['offset']);}return _0x63c5b6[_0xf52a('0x4c')](_0x148cf3);}})[_0xf52a('0x21')](function(_0x519297){if(_0x519297){return _0x519297?{'count':_0x5240fa,'rows':_0x519297}:null;}})[_0xf52a('0x21')](respondWithResult(_0x13e2fc,null))[_0xf52a('0x40')](handleError(_0x13e2fc,null));};exports['getDescriptions']=function(_0x228fd0,_0x593a6a,_0x275f5e){var _0x385336={};var _0x10a69a={};var _0x8fb063;var _0x1dc7f0;return db[_0xf52a('0x3c')][_0xf52a('0x4d')]({'where':{'id':_0x228fd0['params']['id']}})[_0xf52a('0x21')](handleEntityNotFound(_0x593a6a,null))['then'](function(_0x540a64){if(_0x540a64){_0x8fb063=_0x540a64;_0x10a69a[_0xf52a('0x2c')]=_['keys'](db[_0xf52a('0x4a')][_0xf52a('0x4b')]);_0x10a69a[_0xf52a('0x2d')]=_['keys'](_0x228fd0[_0xf52a('0x2d')]);_0x10a69a[_0xf52a('0x2e')]=_[_0xf52a('0x2f')](_0x10a69a[_0xf52a('0x2c')],_0x10a69a[_0xf52a('0x2d')]);_0x385336['attributes']=_[_0xf52a('0x2f')](_0x10a69a[_0xf52a('0x2c')],qs[_0xf52a('0x31')](_0x228fd0[_0xf52a('0x2d')][_0xf52a('0x31')]));_0x385336[_0xf52a('0x30')]=_0x385336[_0xf52a('0x30')][_0xf52a('0x44')]?_0x385336['attributes']:_0x10a69a[_0xf52a('0x2c')];_0x385336[_0xf52a('0x34')]=qs[_0xf52a('0x35')](_0x228fd0[_0xf52a('0x2d')][_0xf52a('0x35')]);_0x385336[_0xf52a('0x37')]=qs[_0xf52a('0x2e')](_[_0xf52a('0x4e')](_0x228fd0[_0xf52a('0x2d')],_0x10a69a[_0xf52a('0x2e')]));if(_0x228fd0[_0xf52a('0x2d')][_0xf52a('0x36')]){_0x385336[_0xf52a('0x37')]=_[_0xf52a('0x38')](_0x385336['where'],{'$or':_[_0xf52a('0x2a')](_0x385336[_0xf52a('0x30')],function(_0x52c4aa){var _0x574bdb={};_0x574bdb[_0x52c4aa]={'$like':'%'+_0x228fd0[_0xf52a('0x2d')][_0xf52a('0x36')]+'%'};return _0x574bdb;})});}_0x385336=_['merge']({},_0x385336,_0x228fd0[_0xf52a('0x3b')]);return _0x8fb063[_0xf52a('0x4f')](_0x385336);}})['then'](function(_0x4b08e0){if(_0x4b08e0){_0x1dc7f0=_0x4b08e0['length'];if(!_0x228fd0[_0xf52a('0x2d')][_0xf52a('0x32')]('nolimit')){_0x385336[_0xf52a('0x1c')]=qs[_0xf52a('0x1c')](_0x228fd0[_0xf52a('0x2d')][_0xf52a('0x1c')]);_0x385336[_0xf52a('0x1a')]=qs[_0xf52a('0x1a')](_0x228fd0[_0xf52a('0x2d')][_0xf52a('0x1a')]);}return _0x8fb063[_0xf52a('0x4f')](_0x385336);}})[_0xf52a('0x21')](function(_0x3c78b9){if(_0x3c78b9){return _0x3c78b9?{'count':_0x1dc7f0,'rows':_0x3c78b9}:null;}})[_0xf52a('0x21')](respondWithResult(_0x593a6a,null))['catch'](handleError(_0x593a6a,null));}; \ No newline at end of file +var _0xa1c0=['fields','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','keys','length','options','find','create','body','getFields','findOne','filter','nolimit','getSubjects','SugarcrmField','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','save','update','then','destroy','error','stack','name','send','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','model','query','filters','attributes','intersection'];(function(_0x5d0812,_0xb31d42){var _0x20addf=function(_0x425889){while(--_0x425889){_0x5d0812['push'](_0x5d0812['shift']());}};_0x20addf(++_0xb31d42);}(_0xa1c0,0x1c9));var _0x0a1c=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xa1c0[_0x13d07a];return _0x5ee0ee;};'use strict';var emlformat=require(_0x0a1c('0x0'));var rimraf=require(_0x0a1c('0x1'));var zipdir=require(_0x0a1c('0x2'));var jsonpatch=require(_0x0a1c('0x3'));var rp=require(_0x0a1c('0x4'));var moment=require(_0x0a1c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0a1c('0x6'));var util=require(_0x0a1c('0x7'));var path=require(_0x0a1c('0x8'));var sox=require(_0x0a1c('0x9'));var csv=require(_0x0a1c('0xa'));var ejs=require(_0x0a1c('0xb'));var fs=require('fs');var fs_extra=require(_0x0a1c('0xc'));var _=require(_0x0a1c('0xd'));var squel=require(_0x0a1c('0xe'));var crypto=require(_0x0a1c('0xf'));var jsforce=require(_0x0a1c('0x10'));var deskjs=require(_0x0a1c('0x11'));var toCsv=require(_0x0a1c('0xa'));var querystring=require(_0x0a1c('0x12'));var Papa=require(_0x0a1c('0x13'));var Redis=require(_0x0a1c('0x14'));var authService=require(_0x0a1c('0x15'));var qs=require(_0x0a1c('0x16'));var as=require(_0x0a1c('0x17'));var hardwareService=require(_0x0a1c('0x18'));var logger=require(_0x0a1c('0x19'))(_0x0a1c('0x1a'));var utils=require(_0x0a1c('0x1b'));var config=require(_0x0a1c('0x1c'));var licenseUtil=require(_0x0a1c('0x1d'));var db=require(_0x0a1c('0x1e'))['db'];function respondWithStatusCode(_0x5b36d1,_0x2782ce){_0x2782ce=_0x2782ce||0xcc;return function(_0x1a36c6){if(_0x1a36c6){return _0x5b36d1[_0x0a1c('0x1f')](_0x2782ce);}return _0x5b36d1[_0x0a1c('0x20')](_0x2782ce)[_0x0a1c('0x21')]();};}function respondWithResult(_0x5c5a2d,_0x1d40ed){_0x1d40ed=_0x1d40ed||0xc8;return function(_0x3a57b5){if(_0x3a57b5){return _0x5c5a2d[_0x0a1c('0x20')](_0x1d40ed)['json'](_0x3a57b5);}};}function respondWithFilteredResult(_0x393a52,_0x547464){return function(_0x5187c3){if(_0x5187c3){var _0xc4d69=typeof _0x547464[_0x0a1c('0x22')]===_0x0a1c('0x23')&&typeof _0x547464[_0x0a1c('0x24')]===_0x0a1c('0x23');var _0x140dd3=_0x5187c3[_0x0a1c('0x25')];var _0x5eb827=_0xc4d69?0x0:_0x547464[_0x0a1c('0x22')];var _0x1e6491=_0xc4d69?_0x5187c3[_0x0a1c('0x25')]:_0x547464[_0x0a1c('0x22')]+_0x547464[_0x0a1c('0x24')];var _0x525935;if(_0x1e6491>=_0x140dd3){_0x1e6491=_0x140dd3;_0x525935=0xc8;}else{_0x525935=0xce;}_0x393a52[_0x0a1c('0x20')](_0x525935);return _0x393a52[_0x0a1c('0x26')]('Content-Range',_0x5eb827+'-'+_0x1e6491+'/'+_0x140dd3)[_0x0a1c('0x27')](_0x5187c3);}return null;};}function patchUpdates(_0x2a9e45){return function(_0x418b57){try{jsonpatch['apply'](_0x418b57,_0x2a9e45,!![]);}catch(_0x5e972b){return BPromise['reject'](_0x5e972b);}return _0x418b57[_0x0a1c('0x28')]();};}function saveUpdates(_0x33859c,_0x46c909){return function(_0x2cac8a){if(_0x2cac8a){return _0x2cac8a[_0x0a1c('0x29')](_0x33859c)[_0x0a1c('0x2a')](function(_0x5bab69){return _0x5bab69;});}return null;};}function removeEntity(_0x56b0e8,_0x4a8574){return function(_0x5686e0){if(_0x5686e0){return _0x5686e0[_0x0a1c('0x2b')]()[_0x0a1c('0x2a')](function(){_0x56b0e8[_0x0a1c('0x20')](0xcc)[_0x0a1c('0x21')]();});}};}function handleEntityNotFound(_0x310665,_0x4badf9){return function(_0x320527){if(!_0x320527){_0x310665[_0x0a1c('0x1f')](0x194);}return _0x320527;};}function handleError(_0x3f4390,_0x35dafc){_0x35dafc=_0x35dafc||0x1f4;return function(_0x1e4eaa){logger[_0x0a1c('0x2c')](_0x1e4eaa[_0x0a1c('0x2d')]);if(_0x1e4eaa[_0x0a1c('0x2e')]){delete _0x1e4eaa[_0x0a1c('0x2e')];}_0x3f4390[_0x0a1c('0x20')](_0x35dafc)[_0x0a1c('0x2f')](_0x1e4eaa);};}exports[_0x0a1c('0x30')]=function(_0x279ae9,_0x3c7533){var _0x293885={},_0x30eb38={},_0x260aa1={'count':0x0,'rows':[]};var _0x1ec03e=_[_0x0a1c('0x31')](db[_0x0a1c('0x32')][_0x0a1c('0x33')],function(_0x2e2b82){return{'name':_0x2e2b82[_0x0a1c('0x34')],'type':_0x2e2b82[_0x0a1c('0x35')]['key']};});_0x30eb38[_0x0a1c('0x36')]=_[_0x0a1c('0x31')](_0x1ec03e,_0x0a1c('0x2e'));_0x30eb38[_0x0a1c('0x37')]=_['keys'](_0x279ae9['query']);_0x30eb38[_0x0a1c('0x38')]=_['intersection'](_0x30eb38[_0x0a1c('0x36')],_0x30eb38['query']);_0x293885[_0x0a1c('0x39')]=_[_0x0a1c('0x3a')](_0x30eb38[_0x0a1c('0x36')],qs[_0x0a1c('0x3b')](_0x279ae9[_0x0a1c('0x37')][_0x0a1c('0x3b')]));_0x293885[_0x0a1c('0x39')]=_0x293885['attributes']['length']?_0x293885[_0x0a1c('0x39')]:_0x30eb38[_0x0a1c('0x36')];if(!_0x279ae9[_0x0a1c('0x37')][_0x0a1c('0x3c')]('nolimit')){_0x293885['limit']=qs[_0x0a1c('0x24')](_0x279ae9[_0x0a1c('0x37')]['limit']);_0x293885[_0x0a1c('0x22')]=qs[_0x0a1c('0x22')](_0x279ae9[_0x0a1c('0x37')][_0x0a1c('0x22')]);}_0x293885[_0x0a1c('0x3d')]=qs['sort'](_0x279ae9[_0x0a1c('0x37')][_0x0a1c('0x3e')]);_0x293885[_0x0a1c('0x3f')]=qs['filters'](_[_0x0a1c('0x40')](_0x279ae9[_0x0a1c('0x37')],_0x30eb38[_0x0a1c('0x38')]),_0x1ec03e);if(_0x279ae9[_0x0a1c('0x37')]['filter']){_0x293885[_0x0a1c('0x3f')]=_[_0x0a1c('0x41')](_0x293885[_0x0a1c('0x3f')],{'$or':_[_0x0a1c('0x31')](_0x1ec03e,function(_0x324895){if(_0x324895[_0x0a1c('0x35')]!==_0x0a1c('0x42')){var _0x385e83={};_0x385e83[_0x324895[_0x0a1c('0x2e')]]={'$like':'%'+_0x279ae9[_0x0a1c('0x37')]['filter']+'%'};return _0x385e83;}})});}_0x293885=_[_0x0a1c('0x41')]({},_0x293885,_0x279ae9['options']);var _0x3a6b38={'where':_0x293885['where']};return db[_0x0a1c('0x32')][_0x0a1c('0x25')](_0x3a6b38)[_0x0a1c('0x2a')](function(_0x4cc692){_0x260aa1['count']=_0x4cc692;if(_0x279ae9[_0x0a1c('0x37')][_0x0a1c('0x43')]){_0x293885[_0x0a1c('0x44')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x0a1c('0x45')](_0x293885);})[_0x0a1c('0x2a')](function(_0x404ebb){_0x260aa1[_0x0a1c('0x46')]=_0x404ebb;return _0x260aa1;})[_0x0a1c('0x2a')](respondWithFilteredResult(_0x3c7533,_0x293885))[_0x0a1c('0x47')](handleError(_0x3c7533,null));};exports['show']=function(_0x1bfe45,_0x222242){var _0x16f568={'raw':![],'where':{'id':_0x1bfe45[_0x0a1c('0x48')]['id']}},_0x244ee1={};_0x244ee1['model']=_[_0x0a1c('0x49')](db[_0x0a1c('0x32')]['rawAttributes']);_0x244ee1['query']=_[_0x0a1c('0x49')](_0x1bfe45[_0x0a1c('0x37')]);_0x244ee1['filters']=_[_0x0a1c('0x3a')](_0x244ee1['model'],_0x244ee1[_0x0a1c('0x37')]);_0x16f568[_0x0a1c('0x39')]=_[_0x0a1c('0x3a')](_0x244ee1[_0x0a1c('0x36')],qs['fields'](_0x1bfe45['query'][_0x0a1c('0x3b')]));_0x16f568[_0x0a1c('0x39')]=_0x16f568['attributes'][_0x0a1c('0x4a')]?_0x16f568[_0x0a1c('0x39')]:_0x244ee1[_0x0a1c('0x36')];if(_0x1bfe45[_0x0a1c('0x37')][_0x0a1c('0x43')]){_0x16f568[_0x0a1c('0x44')]=[{'all':!![]}];}_0x16f568=_[_0x0a1c('0x41')]({},_0x16f568,_0x1bfe45[_0x0a1c('0x4b')]);return db['SugarcrmConfiguration'][_0x0a1c('0x4c')](_0x16f568)[_0x0a1c('0x2a')](handleEntityNotFound(_0x222242,null))['then'](respondWithResult(_0x222242,null))['catch'](handleError(_0x222242,null));};exports['create']=function(_0x347549,_0x300a00){return db[_0x0a1c('0x32')][_0x0a1c('0x4d')](_0x347549[_0x0a1c('0x4e')],{})[_0x0a1c('0x2a')](respondWithResult(_0x300a00,0xc9))['catch'](handleError(_0x300a00,null));};exports['update']=function(_0x17f1f5,_0x3b9136){if(_0x17f1f5[_0x0a1c('0x4e')]['id']){delete _0x17f1f5[_0x0a1c('0x4e')]['id'];}return db[_0x0a1c('0x32')][_0x0a1c('0x4c')]({'where':{'id':_0x17f1f5[_0x0a1c('0x48')]['id']}})[_0x0a1c('0x2a')](handleEntityNotFound(_0x3b9136,null))[_0x0a1c('0x2a')](saveUpdates(_0x17f1f5[_0x0a1c('0x4e')],null))['then'](respondWithResult(_0x3b9136,null))[_0x0a1c('0x47')](handleError(_0x3b9136,null));};exports['destroy']=function(_0x41bd8d,_0xe1f5d5){return db[_0x0a1c('0x32')][_0x0a1c('0x4c')]({'where':{'id':_0x41bd8d[_0x0a1c('0x48')]['id']}})[_0x0a1c('0x2a')](handleEntityNotFound(_0xe1f5d5,null))[_0x0a1c('0x2a')](removeEntity(_0xe1f5d5,null))['catch'](handleError(_0xe1f5d5,null));};exports[_0x0a1c('0x4f')]=function(_0x153601,_0x460f61,_0xd97cd){var _0x2354a6={};var _0x48b1c7={};var _0x4498e8;var _0x36ba4e;return db[_0x0a1c('0x32')][_0x0a1c('0x50')]({'where':{'id':_0x153601[_0x0a1c('0x48')]['id']}})[_0x0a1c('0x2a')](handleEntityNotFound(_0x460f61,null))['then'](function(_0x73e1a3){if(_0x73e1a3){_0x4498e8=_0x73e1a3;_0x48b1c7[_0x0a1c('0x36')]=_[_0x0a1c('0x49')](db['SugarcrmField'][_0x0a1c('0x33')]);_0x48b1c7['query']=_[_0x0a1c('0x49')](_0x153601['query']);_0x48b1c7[_0x0a1c('0x38')]=_[_0x0a1c('0x3a')](_0x48b1c7[_0x0a1c('0x36')],_0x48b1c7[_0x0a1c('0x37')]);_0x2354a6['attributes']=_['intersection'](_0x48b1c7[_0x0a1c('0x36')],qs['fields'](_0x153601['query'][_0x0a1c('0x3b')]));_0x2354a6[_0x0a1c('0x39')]=_0x2354a6[_0x0a1c('0x39')]['length']?_0x2354a6[_0x0a1c('0x39')]:_0x48b1c7['model'];_0x2354a6['order']=qs[_0x0a1c('0x3e')](_0x153601[_0x0a1c('0x37')][_0x0a1c('0x3e')]);_0x2354a6['where']=qs[_0x0a1c('0x38')](_['pick'](_0x153601[_0x0a1c('0x37')],_0x48b1c7[_0x0a1c('0x38')]));if(_0x153601[_0x0a1c('0x37')][_0x0a1c('0x51')]){_0x2354a6['where']=_[_0x0a1c('0x41')](_0x2354a6[_0x0a1c('0x3f')],{'$or':_['map'](_0x2354a6[_0x0a1c('0x39')],function(_0x50cc5a){var _0x4cb0de={};_0x4cb0de[_0x50cc5a]={'$like':'%'+_0x153601[_0x0a1c('0x37')][_0x0a1c('0x51')]+'%'};return _0x4cb0de;})});}_0x2354a6=_[_0x0a1c('0x41')]({},_0x2354a6,_0x153601[_0x0a1c('0x4b')]);return _0x4498e8[_0x0a1c('0x4f')](_0x2354a6);}})[_0x0a1c('0x2a')](function(_0x51218e){if(_0x51218e){_0x36ba4e=_0x51218e['length'];if(!_0x153601[_0x0a1c('0x37')]['hasOwnProperty'](_0x0a1c('0x52'))){_0x2354a6[_0x0a1c('0x24')]=qs['limit'](_0x153601[_0x0a1c('0x37')][_0x0a1c('0x24')]);_0x2354a6[_0x0a1c('0x22')]=qs[_0x0a1c('0x22')](_0x153601['query']['offset']);}return _0x4498e8[_0x0a1c('0x4f')](_0x2354a6);}})[_0x0a1c('0x2a')](function(_0x9c1dc5){if(_0x9c1dc5){return _0x9c1dc5?{'count':_0x36ba4e,'rows':_0x9c1dc5}:null;}})[_0x0a1c('0x2a')](respondWithResult(_0x460f61,null))['catch'](handleError(_0x460f61,null));};exports[_0x0a1c('0x53')]=function(_0x2b92db,_0x153101,_0x75dd67){var _0x202474={};var _0x583f3e={};var _0x1aaf63;var _0x2a946a;return db[_0x0a1c('0x32')]['findOne']({'where':{'id':_0x2b92db['params']['id']}})['then'](handleEntityNotFound(_0x153101,null))[_0x0a1c('0x2a')](function(_0xcdcd04){if(_0xcdcd04){_0x1aaf63=_0xcdcd04;_0x583f3e[_0x0a1c('0x36')]=_[_0x0a1c('0x49')](db[_0x0a1c('0x54')][_0x0a1c('0x33')]);_0x583f3e['query']=_[_0x0a1c('0x49')](_0x2b92db['query']);_0x583f3e['filters']=_[_0x0a1c('0x3a')](_0x583f3e[_0x0a1c('0x36')],_0x583f3e[_0x0a1c('0x37')]);_0x202474[_0x0a1c('0x39')]=_[_0x0a1c('0x3a')](_0x583f3e[_0x0a1c('0x36')],qs[_0x0a1c('0x3b')](_0x2b92db[_0x0a1c('0x37')][_0x0a1c('0x3b')]));_0x202474[_0x0a1c('0x39')]=_0x202474[_0x0a1c('0x39')]['length']?_0x202474[_0x0a1c('0x39')]:_0x583f3e[_0x0a1c('0x36')];_0x202474[_0x0a1c('0x3d')]=qs[_0x0a1c('0x3e')](_0x2b92db[_0x0a1c('0x37')][_0x0a1c('0x3e')]);_0x202474[_0x0a1c('0x3f')]=qs[_0x0a1c('0x38')](_['pick'](_0x2b92db['query'],_0x583f3e['filters']));if(_0x2b92db[_0x0a1c('0x37')][_0x0a1c('0x51')]){_0x202474[_0x0a1c('0x3f')]=_[_0x0a1c('0x41')](_0x202474[_0x0a1c('0x3f')],{'$or':_[_0x0a1c('0x31')](_0x202474[_0x0a1c('0x39')],function(_0x4b8be8){var _0x35d6ee={};_0x35d6ee[_0x4b8be8]={'$like':'%'+_0x2b92db[_0x0a1c('0x37')][_0x0a1c('0x51')]+'%'};return _0x35d6ee;})});}_0x202474=_[_0x0a1c('0x41')]({},_0x202474,_0x2b92db[_0x0a1c('0x4b')]);return _0x1aaf63[_0x0a1c('0x53')](_0x202474);}})[_0x0a1c('0x2a')](function(_0xb9dc3c){if(_0xb9dc3c){_0x2a946a=_0xb9dc3c[_0x0a1c('0x4a')];if(!_0x2b92db[_0x0a1c('0x37')]['hasOwnProperty'](_0x0a1c('0x52'))){_0x202474[_0x0a1c('0x24')]=qs['limit'](_0x2b92db['query'][_0x0a1c('0x24')]);_0x202474[_0x0a1c('0x22')]=qs['offset'](_0x2b92db[_0x0a1c('0x37')][_0x0a1c('0x22')]);}return _0x1aaf63['getSubjects'](_0x202474);}})['then'](function(_0x218a28){if(_0x218a28){return _0x218a28?{'count':_0x2a946a,'rows':_0x218a28}:null;}})['then'](respondWithResult(_0x153101,null))['catch'](handleError(_0x153101,null));};exports['getDescriptions']=function(_0x11d135,_0x2ae740,_0x4bb30f){var _0x4ee428={};var _0x216858={};var _0x53e5f6;var _0x482558;return db[_0x0a1c('0x32')][_0x0a1c('0x50')]({'where':{'id':_0x11d135[_0x0a1c('0x48')]['id']}})[_0x0a1c('0x2a')](handleEntityNotFound(_0x2ae740,null))[_0x0a1c('0x2a')](function(_0x118707){if(_0x118707){_0x53e5f6=_0x118707;_0x216858[_0x0a1c('0x36')]=_[_0x0a1c('0x49')](db[_0x0a1c('0x54')][_0x0a1c('0x33')]);_0x216858['query']=_[_0x0a1c('0x49')](_0x11d135[_0x0a1c('0x37')]);_0x216858[_0x0a1c('0x38')]=_[_0x0a1c('0x3a')](_0x216858[_0x0a1c('0x36')],_0x216858[_0x0a1c('0x37')]);_0x4ee428[_0x0a1c('0x39')]=_[_0x0a1c('0x3a')](_0x216858['model'],qs['fields'](_0x11d135['query'][_0x0a1c('0x3b')]));_0x4ee428[_0x0a1c('0x39')]=_0x4ee428[_0x0a1c('0x39')]['length']?_0x4ee428['attributes']:_0x216858[_0x0a1c('0x36')];_0x4ee428['order']=qs[_0x0a1c('0x3e')](_0x11d135['query']['sort']);_0x4ee428[_0x0a1c('0x3f')]=qs['filters'](_[_0x0a1c('0x40')](_0x11d135[_0x0a1c('0x37')],_0x216858[_0x0a1c('0x38')]));if(_0x11d135[_0x0a1c('0x37')][_0x0a1c('0x51')]){_0x4ee428['where']=_['merge'](_0x4ee428[_0x0a1c('0x3f')],{'$or':_['map'](_0x4ee428[_0x0a1c('0x39')],function(_0x9e2b13){var _0x421076={};_0x421076[_0x9e2b13]={'$like':'%'+_0x11d135[_0x0a1c('0x37')][_0x0a1c('0x51')]+'%'};return _0x421076;})});}_0x4ee428=_[_0x0a1c('0x41')]({},_0x4ee428,_0x11d135['options']);return _0x53e5f6[_0x0a1c('0x55')](_0x4ee428);}})['then'](function(_0x3678fa){if(_0x3678fa){_0x482558=_0x3678fa[_0x0a1c('0x4a')];if(!_0x11d135['query'][_0x0a1c('0x3c')](_0x0a1c('0x52'))){_0x4ee428[_0x0a1c('0x24')]=qs[_0x0a1c('0x24')](_0x11d135[_0x0a1c('0x37')]['limit']);_0x4ee428[_0x0a1c('0x22')]=qs['offset'](_0x11d135[_0x0a1c('0x37')][_0x0a1c('0x22')]);}return _0x53e5f6['getDescriptions'](_0x4ee428);}})[_0x0a1c('0x2a')](function(_0x1f3556){if(_0x1f3556){return _0x1f3556?{'count':_0x482558,'rows':_0x1f3556}:null;}})[_0x0a1c('0x2a')](respondWithResult(_0x2ae740,null))[_0x0a1c('0x47')](handleError(_0x2ae740,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 7ccec03..0f91bab 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 _0x6b3a=['moment','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','api'];(function(_0x2c482b,_0x3fe3d3){var _0xb774b8=function(_0x145425){while(--_0x145425){_0x2c482b['push'](_0x2c482b['shift']());}};_0xb774b8(++_0x3fe3d3);}(_0x6b3a,0xbf));var _0xa6b3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6b3a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa6b3('0x0'));var util=require(_0xa6b3('0x1'));var logger=require(_0xa6b3('0x2'))(_0xa6b3('0x3'));var moment=require(_0xa6b3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa6b3('0x5'));var rimraf=require(_0xa6b3('0x6'));var config=require(_0xa6b3('0x7'));var attributes=require(_0xa6b3('0x8'));module[_0xa6b3('0x9')]=function(_0x5db83a,_0x3cc6d8){return _0x5db83a[_0xa6b3('0xa')](_0xa6b3('0xb'),attributes,{'tableName':_0xa6b3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x25f5=['rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','SugarcrmConfiguration','int_sugarcrm_configurations','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3b150c,_0x2f93f8){var _0x5cd414=function(_0x26305e){while(--_0x26305e){_0x3b150c['push'](_0x3b150c['shift']());}};_0x5cd414(++_0x2f93f8);}(_0x25f5,0x117));var _0x525f=function(_0x2f6e2d,_0x3ba8a5){_0x2f6e2d=_0x2f6e2d-0x0;var _0x3d122c=_0x25f5[_0x2f6e2d];return _0x3d122c;};'use strict';var _=require('lodash');var util=require(_0x525f('0x0'));var logger=require(_0x525f('0x1'))(_0x525f('0x2'));var moment=require(_0x525f('0x3'));var BPromise=require(_0x525f('0x4'));var rp=require(_0x525f('0x5'));var fs=require('fs');var path=require(_0x525f('0x6'));var rimraf=require(_0x525f('0x7'));var config=require(_0x525f('0x8'));var attributes=require(_0x525f('0x9'));module[_0x525f('0xa')]=function(_0x5bb9db,_0x2a5f6c){return _0x5bb9db['define'](_0x525f('0xb'),attributes,{'tableName':_0x525f('0xc'),'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 29497ce..a681ba7 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 _0x8dc1=['bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util'];(function(_0x2c53c8,_0x3f4592){var _0x10e6a2=function(_0x373f2c){while(--_0x373f2c){_0x2c53c8['push'](_0x2c53c8['shift']());}};_0x10e6a2(++_0x3f4592);}(_0x8dc1,0x1b7));var _0x18dc=function(_0x23bf67,_0x564d3d){_0x23bf67=_0x23bf67-0x0;var _0x8f2df5=_0x8dc1[_0x23bf67];return _0x8f2df5;};'use strict';var _=require('lodash');var util=require(_0x18dc('0x0'));var moment=require('moment');var BPromise=require(_0x18dc('0x1'));var rs=require(_0x18dc('0x2'));var fs=require('fs');var Redis=require(_0x18dc('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x18dc('0x4'));var logger=require('../../config/logger')(_0x18dc('0x5'));var config=require(_0x18dc('0x6'));var jayson=require(_0x18dc('0x7'));var client=jayson[_0x18dc('0x8')][_0x18dc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x444945,_0x599132,_0x347161){return new BPromise(function(_0x2292cd,_0x10d638){return client[_0x18dc('0xa')](_0x444945,_0x347161)[_0x18dc('0xb')](function(_0x2a9b64){logger[_0x18dc('0xc')](_0x18dc('0xd'),_0x599132,_0x18dc('0xe'));logger[_0x18dc('0xf')](_0x18dc('0x10'),_0x599132,_0x18dc('0xe'),JSON[_0x18dc('0x11')](_0x2a9b64));if(_0x2a9b64[_0x18dc('0x12')]){if(_0x2a9b64[_0x18dc('0x12')][_0x18dc('0x13')]===0x1f4){logger[_0x18dc('0x12')](_0x18dc('0xd'),_0x599132,_0x2a9b64[_0x18dc('0x12')][_0x18dc('0x14')]);return _0x10d638(_0x2a9b64['error'][_0x18dc('0x14')]);}logger[_0x18dc('0x12')](_0x18dc('0xd'),_0x599132,_0x2a9b64[_0x18dc('0x12')][_0x18dc('0x14')]);return _0x2292cd(_0x2a9b64[_0x18dc('0x12')][_0x18dc('0x14')]);}else{logger[_0x18dc('0xc')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x599132,_0x18dc('0xe'));_0x2292cd(_0x2a9b64['result'][_0x18dc('0x14')]);}})[_0x18dc('0x15')](function(_0x217e8e){logger[_0x18dc('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x599132,_0x217e8e);_0x10d638(_0x217e8e);});});} \ No newline at end of file +var _0xd1ea=['../../config/environment','jayson/promise','client','http','request','then','SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x147e56,_0x2efae8){var _0x40c49c=function(_0x380aaa){while(--_0x380aaa){_0x147e56['push'](_0x147e56['shift']());}};_0x40c49c(++_0x2efae8);}(_0xd1ea,0x1d8));var _0xad1e=function(_0x556c31,_0x27f18a){_0x556c31=_0x556c31-0x0;var _0x954887=_0xd1ea[_0x556c31];return _0x954887;};'use strict';var _=require(_0xad1e('0x0'));var util=require(_0xad1e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xad1e('0x2'));var fs=require('fs');var Redis=require(_0xad1e('0x3'));var db=require(_0xad1e('0x4'))['db'];var utils=require(_0xad1e('0x5'));var logger=require(_0xad1e('0x6'))(_0xad1e('0x7'));var config=require(_0xad1e('0x8'));var jayson=require(_0xad1e('0x9'));var client=jayson[_0xad1e('0xa')][_0xad1e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f1394,_0x431199,_0x3b62b0){return new BPromise(function(_0x5f5a87,_0xae8ab0){return client[_0xad1e('0xc')](_0x4f1394,_0x3b62b0)[_0xad1e('0xd')](function(_0x5765aa){logger['info'](_0xad1e('0xe'),_0x431199,'request\x20sent');logger[_0xad1e('0xf')](_0xad1e('0x10'),_0x431199,_0xad1e('0x11'),JSON[_0xad1e('0x12')](_0x5765aa));if(_0x5765aa['error']){if(_0x5765aa[_0xad1e('0x13')]['code']===0x1f4){logger[_0xad1e('0x13')](_0xad1e('0xe'),_0x431199,_0x5765aa[_0xad1e('0x13')][_0xad1e('0x14')]);return _0xae8ab0(_0x5765aa['error']['message']);}logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x431199,_0x5765aa[_0xad1e('0x13')][_0xad1e('0x14')]);return _0x5f5a87(_0x5765aa[_0xad1e('0x13')][_0xad1e('0x14')]);}else{logger[_0xad1e('0x15')](_0xad1e('0xe'),_0x431199,_0xad1e('0x11'));_0x5f5a87(_0x5765aa[_0xad1e('0x16')][_0xad1e('0x14')]);}})[_0xad1e('0x17')](function(_0x4553eb){logger[_0xad1e('0x13')](_0xad1e('0xe'),_0x431199,_0x4553eb);_0xae8ab0(_0x4553eb);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 19e0ef1..44cd765 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 _0x7f5f=['./intSugarcrmField.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','multer','util','connect-timeout','Router','fs-extra','../../config/environment'];(function(_0x1d2773,_0x4915f7){var _0xb4640d=function(_0x27a8c9){while(--_0x27a8c9){_0x1d2773['push'](_0x1d2773['shift']());}};_0xb4640d(++_0x4915f7);}(_0x7f5f,0x15a));var _0xf7f5=function(_0xfd9e4e,_0x287c72){_0xfd9e4e=_0xfd9e4e-0x0;var _0x148917=_0x7f5f[_0xfd9e4e];return _0x148917;};'use strict';var multer=require(_0xf7f5('0x0'));var util=require(_0xf7f5('0x1'));var path=require('path');var timeout=require(_0xf7f5('0x2'));var express=require('express');var router=express[_0xf7f5('0x3')]();var fs_extra=require(_0xf7f5('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf7f5('0x5'));var controller=require(_0xf7f5('0x6'));router[_0xf7f5('0x7')]('/',auth[_0xf7f5('0x8')](),controller[_0xf7f5('0x9')]);router['get'](_0xf7f5('0xa'),auth[_0xf7f5('0x8')](),controller['show']);router[_0xf7f5('0xb')]('/',auth[_0xf7f5('0x8')](),controller[_0xf7f5('0xc')]);router[_0xf7f5('0xd')](_0xf7f5('0xa'),auth[_0xf7f5('0x8')](),controller[_0xf7f5('0xe')]);router[_0xf7f5('0xf')](_0xf7f5('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1536=['exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy'];(function(_0x59de41,_0x8bf2d8){var _0x299577=function(_0x3543d7){while(--_0x3543d7){_0x59de41['push'](_0x59de41['shift']());}};_0x299577(++_0x8bf2d8);}(_0x1536,0xbf));var _0x6153=function(_0x5ca0e8,_0x358c37){_0x5ca0e8=_0x5ca0e8-0x0;var _0x182c46=_0x1536[_0x5ca0e8];return _0x182c46;};'use strict';var multer=require(_0x6153('0x0'));var util=require('util');var path=require(_0x6153('0x1'));var timeout=require(_0x6153('0x2'));var express=require('express');var router=express[_0x6153('0x3')]();var fs_extra=require(_0x6153('0x4'));var auth=require(_0x6153('0x5'));var interaction=require(_0x6153('0x6'));var config=require(_0x6153('0x7'));var controller=require('./intSugarcrmField.controller');router[_0x6153('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6153('0x8')](_0x6153('0x9'),auth[_0x6153('0xa')](),controller[_0x6153('0xb')]);router[_0x6153('0xc')]('/',auth['isAuthenticated'](),controller[_0x6153('0xd')]);router[_0x6153('0xe')](_0x6153('0x9'),auth['isAuthenticated'](),controller[_0x6153('0xf')]);router[_0x6153('0x10')](_0x6153('0x9'),auth[_0x6153('0xa')](),controller[_0x6153('0x11')]);module[_0x6153('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 33f1855..bfad621 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 _0xa2f9=['STRING','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x56da54,_0x4dd4c5){var _0x4acd7f=function(_0x53238b){while(--_0x53238b){_0x56da54['push'](_0x56da54['shift']());}};_0x4acd7f(++_0x4dd4c5);}(_0xa2f9,0x12a));var _0x9a2f=function(_0xe6e78c,_0x582369){_0xe6e78c=_0xe6e78c-0x0;var _0x2a09c8=_0xa2f9[_0xe6e78c];return _0x2a09c8;};'use strict';var Sequelize=require(_0x9a2f('0x0'));module[_0x9a2f('0x1')]={'type':{'type':Sequelize[_0x9a2f('0x2')](_0x9a2f('0x3'),_0x9a2f('0x4'),_0x9a2f('0x5'),_0x9a2f('0x6'),_0x9a2f('0x7')),'defaultValue':_0x9a2f('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x9a2f('0x8')]},'keyType':{'type':Sequelize[_0x9a2f('0x2')]('string',_0x9a2f('0x4'),_0x9a2f('0x5'))},'keyContent':{'type':Sequelize[_0x9a2f('0x8')]},'idField':{'type':Sequelize[_0x9a2f('0x8')]},'nameField':{'type':Sequelize[_0x9a2f('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9a2f('0x8')]}}; \ No newline at end of file +var _0xea40=['string','STRING','variable','BOOLEAN','sequelize','ENUM','customVariable','keyValue','picklist'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xea40,0x151));var _0x0ea4=function(_0x27685e,_0x845417){_0x27685e=_0x27685e-0x0;var _0x224a6f=_0xea40[_0x27685e];return _0x224a6f;};'use strict';var Sequelize=require(_0x0ea4('0x0'));module['exports']={'type':{'type':Sequelize[_0x0ea4('0x1')]('string','variable',_0x0ea4('0x2'),_0x0ea4('0x3'),_0x0ea4('0x4')),'defaultValue':_0x0ea4('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x0ea4('0x6')]},'keyType':{'type':Sequelize[_0x0ea4('0x1')](_0x0ea4('0x5'),_0x0ea4('0x7'),_0x0ea4('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x0ea4('0x6')]},'nameField':{'type':Sequelize[_0x0ea4('0x6')]},'customField':{'type':Sequelize[_0x0ea4('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0ea4('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 96cc9f5..db53101 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 _0x46ce=['destroy','error','stack','name','send','map','SugarcrmField','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','params','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','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','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','update','then'];(function(_0x43c8a8,_0x5917bf){var _0x548de6=function(_0x4ab272){while(--_0x4ab272){_0x43c8a8['push'](_0x43c8a8['shift']());}};_0x548de6(++_0x5917bf);}(_0x46ce,0x101));var _0xe46c=function(_0x109920,_0x36102e){_0x109920=_0x109920-0x0;var _0x4ed9f5=_0x46ce[_0x109920];return _0x4ed9f5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe46c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe46c('0x1'));var moment=require(_0xe46c('0x2'));var BPromise=require(_0xe46c('0x3'));var Mustache=require(_0xe46c('0x4'));var util=require('util');var path=require(_0xe46c('0x5'));var sox=require(_0xe46c('0x6'));var csv=require(_0xe46c('0x7'));var ejs=require(_0xe46c('0x8'));var fs=require('fs');var fs_extra=require(_0xe46c('0x9'));var _=require('lodash');var squel=require(_0xe46c('0xa'));var crypto=require('crypto');var jsforce=require(_0xe46c('0xb'));var deskjs=require(_0xe46c('0xc'));var toCsv=require(_0xe46c('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe46c('0xd'));var authService=require(_0xe46c('0xe'));var qs=require(_0xe46c('0xf'));var as=require(_0xe46c('0x10'));var hardwareService=require(_0xe46c('0x11'));var logger=require(_0xe46c('0x12'))(_0xe46c('0x13'));var utils=require(_0xe46c('0x14'));var config=require(_0xe46c('0x15'));var licenseUtil=require(_0xe46c('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x143afb,_0x312476){_0x312476=_0x312476||0xcc;return function(_0x46c17a){if(_0x46c17a){return _0x143afb[_0xe46c('0x17')](_0x312476);}return _0x143afb[_0xe46c('0x18')](_0x312476)[_0xe46c('0x19')]();};}function respondWithResult(_0x227c9c,_0x143388){_0x143388=_0x143388||0xc8;return function(_0x45edc0){if(_0x45edc0){return _0x227c9c[_0xe46c('0x18')](_0x143388)[_0xe46c('0x1a')](_0x45edc0);}};}function respondWithFilteredResult(_0x5c5d97,_0x25ea0a){return function(_0x3408d1){if(_0x3408d1){var _0xa26891=typeof _0x25ea0a[_0xe46c('0x1b')]===_0xe46c('0x1c')&&typeof _0x25ea0a[_0xe46c('0x1d')]==='undefined';var _0x6c0f29=_0x3408d1[_0xe46c('0x1e')];var _0x3dcd1d=_0xa26891?0x0:_0x25ea0a[_0xe46c('0x1b')];var _0x51da07=_0xa26891?_0x3408d1[_0xe46c('0x1e')]:_0x25ea0a['offset']+_0x25ea0a[_0xe46c('0x1d')];var _0x531acb;if(_0x51da07>=_0x6c0f29){_0x51da07=_0x6c0f29;_0x531acb=0xc8;}else{_0x531acb=0xce;}_0x5c5d97[_0xe46c('0x18')](_0x531acb);return _0x5c5d97[_0xe46c('0x1f')]('Content-Range',_0x3dcd1d+'-'+_0x51da07+'/'+_0x6c0f29)[_0xe46c('0x1a')](_0x3408d1);}return null;};}function patchUpdates(_0x317da2){return function(_0x34a76e){try{jsonpatch[_0xe46c('0x20')](_0x34a76e,_0x317da2,!![]);}catch(_0x538929){return BPromise['reject'](_0x538929);}return _0x34a76e['save']();};}function saveUpdates(_0x1c36e5,_0xe98462){return function(_0x44ff59){if(_0x44ff59){return _0x44ff59[_0xe46c('0x21')](_0x1c36e5)[_0xe46c('0x22')](function(_0x4d5021){return _0x4d5021;});}return null;};}function removeEntity(_0x2fc75e,_0x2cba5b){return function(_0x1615e9){if(_0x1615e9){return _0x1615e9[_0xe46c('0x23')]()[_0xe46c('0x22')](function(){_0x2fc75e[_0xe46c('0x18')](0xcc)[_0xe46c('0x19')]();});}};}function handleEntityNotFound(_0x25e606,_0x2aca2a){return function(_0x3ec373){if(!_0x3ec373){_0x25e606['sendStatus'](0x194);}return _0x3ec373;};}function handleError(_0x4bb5cb,_0x3f2872){_0x3f2872=_0x3f2872||0x1f4;return function(_0x4c2591){logger[_0xe46c('0x24')](_0x4c2591[_0xe46c('0x25')]);if(_0x4c2591[_0xe46c('0x26')]){delete _0x4c2591[_0xe46c('0x26')];}_0x4bb5cb[_0xe46c('0x18')](_0x3f2872)[_0xe46c('0x27')](_0x4c2591);};}exports['index']=function(_0x204084,_0x299c82){var _0x50c1ab={},_0x2c9191={},_0x21a172={'count':0x0,'rows':[]};var _0x11418c=_[_0xe46c('0x28')](db[_0xe46c('0x29')][_0xe46c('0x2a')],function(_0x25e116){return{'name':_0x25e116[_0xe46c('0x2b')],'type':_0x25e116[_0xe46c('0x2c')][_0xe46c('0x2d')]};});_0x2c9191[_0xe46c('0x2e')]=_[_0xe46c('0x28')](_0x11418c,_0xe46c('0x26'));_0x2c9191[_0xe46c('0x2f')]=_['keys'](_0x204084['query']);_0x2c9191[_0xe46c('0x30')]=_[_0xe46c('0x31')](_0x2c9191[_0xe46c('0x2e')],_0x2c9191[_0xe46c('0x2f')]);_0x50c1ab[_0xe46c('0x32')]=_['intersection'](_0x2c9191['model'],qs[_0xe46c('0x33')](_0x204084[_0xe46c('0x2f')][_0xe46c('0x33')]));_0x50c1ab[_0xe46c('0x32')]=_0x50c1ab[_0xe46c('0x32')][_0xe46c('0x34')]?_0x50c1ab['attributes']:_0x2c9191['model'];if(!_0x204084[_0xe46c('0x2f')][_0xe46c('0x35')](_0xe46c('0x36'))){_0x50c1ab[_0xe46c('0x1d')]=qs[_0xe46c('0x1d')](_0x204084[_0xe46c('0x2f')][_0xe46c('0x1d')]);_0x50c1ab[_0xe46c('0x1b')]=qs[_0xe46c('0x1b')](_0x204084[_0xe46c('0x2f')]['offset']);}_0x50c1ab[_0xe46c('0x37')]=qs['sort'](_0x204084[_0xe46c('0x2f')][_0xe46c('0x38')]);_0x50c1ab[_0xe46c('0x39')]=qs[_0xe46c('0x30')](_['pick'](_0x204084[_0xe46c('0x2f')],_0x2c9191['filters']),_0x11418c);if(_0x204084[_0xe46c('0x2f')][_0xe46c('0x3a')]){_0x50c1ab[_0xe46c('0x39')]=_['merge'](_0x50c1ab[_0xe46c('0x39')],{'$or':_['map'](_0x11418c,function(_0x1bf4b3){if(_0x1bf4b3[_0xe46c('0x2c')]!==_0xe46c('0x3b')){var _0x5bdccc={};_0x5bdccc[_0x1bf4b3[_0xe46c('0x26')]]={'$like':'%'+_0x204084[_0xe46c('0x2f')]['filter']+'%'};return _0x5bdccc;}})});}_0x50c1ab=_[_0xe46c('0x3c')]({},_0x50c1ab,_0x204084[_0xe46c('0x3d')]);var _0x57bfa0={'where':_0x50c1ab['where']};return db['SugarcrmField']['count'](_0x57bfa0)[_0xe46c('0x22')](function(_0x4931f6){_0x21a172[_0xe46c('0x1e')]=_0x4931f6;if(_0x204084[_0xe46c('0x2f')][_0xe46c('0x3e')]){_0x50c1ab[_0xe46c('0x3f')]=[{'all':!![]}];}return db['SugarcrmField'][_0xe46c('0x40')](_0x50c1ab);})[_0xe46c('0x22')](function(_0x420e41){_0x21a172[_0xe46c('0x41')]=_0x420e41;return _0x21a172;})[_0xe46c('0x22')](respondWithFilteredResult(_0x299c82,_0x50c1ab))[_0xe46c('0x42')](handleError(_0x299c82,null));};exports[_0xe46c('0x43')]=function(_0xe6db9c,_0xd9ca09){var _0x2e0ad1={'raw':!![],'where':{'id':_0xe6db9c['params']['id']}},_0x38ad3d={};_0x38ad3d[_0xe46c('0x2e')]=_[_0xe46c('0x44')](db[_0xe46c('0x29')][_0xe46c('0x2a')]);_0x38ad3d[_0xe46c('0x2f')]=_[_0xe46c('0x44')](_0xe6db9c[_0xe46c('0x2f')]);_0x38ad3d[_0xe46c('0x30')]=_[_0xe46c('0x31')](_0x38ad3d[_0xe46c('0x2e')],_0x38ad3d['query']);_0x2e0ad1[_0xe46c('0x32')]=_[_0xe46c('0x31')](_0x38ad3d[_0xe46c('0x2e')],qs['fields'](_0xe6db9c[_0xe46c('0x2f')]['fields']));_0x2e0ad1[_0xe46c('0x32')]=_0x2e0ad1[_0xe46c('0x32')][_0xe46c('0x34')]?_0x2e0ad1[_0xe46c('0x32')]:_0x38ad3d[_0xe46c('0x2e')];if(_0xe6db9c[_0xe46c('0x2f')][_0xe46c('0x3e')]){_0x2e0ad1[_0xe46c('0x3f')]=[{'all':!![]}];}_0x2e0ad1=_[_0xe46c('0x3c')]({},_0x2e0ad1,_0xe6db9c['options']);return db['SugarcrmField'][_0xe46c('0x45')](_0x2e0ad1)[_0xe46c('0x22')](handleEntityNotFound(_0xd9ca09,null))[_0xe46c('0x22')](respondWithResult(_0xd9ca09,null))[_0xe46c('0x42')](handleError(_0xd9ca09,null));};exports[_0xe46c('0x46')]=function(_0x7c48f8,_0x37fe8f){return db[_0xe46c('0x29')]['create'](_0x7c48f8[_0xe46c('0x47')],{})[_0xe46c('0x22')](respondWithResult(_0x37fe8f,0xc9))[_0xe46c('0x42')](handleError(_0x37fe8f,null));};exports[_0xe46c('0x21')]=function(_0x3e6312,_0x44ecff){if(_0x3e6312[_0xe46c('0x47')]['id']){delete _0x3e6312[_0xe46c('0x47')]['id'];}return db[_0xe46c('0x29')][_0xe46c('0x45')]({'where':{'id':_0x3e6312[_0xe46c('0x48')]['id']}})[_0xe46c('0x22')](handleEntityNotFound(_0x44ecff,null))[_0xe46c('0x22')](saveUpdates(_0x3e6312[_0xe46c('0x47')],null))[_0xe46c('0x22')](respondWithResult(_0x44ecff,null))[_0xe46c('0x42')](handleError(_0x44ecff,null));};exports[_0xe46c('0x23')]=function(_0x405427,_0x1519de){return db['SugarcrmField'][_0xe46c('0x45')]({'where':{'id':_0x405427[_0xe46c('0x48')]['id']}})['then'](handleEntityNotFound(_0x1519de,null))['then'](removeEntity(_0x1519de,null))[_0xe46c('0x42')](handleError(_0x1519de,null));}; \ No newline at end of file +var _0x8e1c=['squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','index','map','SugarcrmField','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','catch','show','params','rawAttributes','create','body','find','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash'];(function(_0x3afd7b,_0x224dcd){var _0x3a9dd5=function(_0x4cdf8b){while(--_0x4cdf8b){_0x3afd7b['push'](_0x3afd7b['shift']());}};_0x3a9dd5(++_0x224dcd);}(_0x8e1c,0xc0));var _0xc8e1=function(_0x10dac7,_0x3ed996){_0x10dac7=_0x10dac7-0x0;var _0x1bffb6=_0x8e1c[_0x10dac7];return _0x1bffb6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc8e1('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc8e1('0x1'));var BPromise=require(_0xc8e1('0x2'));var Mustache=require(_0xc8e1('0x3'));var util=require('util');var path=require(_0xc8e1('0x4'));var sox=require(_0xc8e1('0x5'));var csv=require(_0xc8e1('0x6'));var ejs=require(_0xc8e1('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc8e1('0x8'));var squel=require(_0xc8e1('0x9'));var crypto=require(_0xc8e1('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xc8e1('0xb'));var toCsv=require(_0xc8e1('0x6'));var querystring=require('querystring');var Papa=require(_0xc8e1('0xc'));var Redis=require('ioredis');var authService=require(_0xc8e1('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xc8e1('0xe'));var hardwareService=require(_0xc8e1('0xf'));var logger=require(_0xc8e1('0x10'))(_0xc8e1('0x11'));var utils=require('../../config/utils');var config=require(_0xc8e1('0x12'));var licenseUtil=require(_0xc8e1('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b9ff2,_0x5dcbeb){_0x5dcbeb=_0x5dcbeb||0xcc;return function(_0x545206){if(_0x545206){return _0x2b9ff2[_0xc8e1('0x14')](_0x5dcbeb);}return _0x2b9ff2[_0xc8e1('0x15')](_0x5dcbeb)['end']();};}function respondWithResult(_0x2b15cc,_0x29e0e1){_0x29e0e1=_0x29e0e1||0xc8;return function(_0x1fab71){if(_0x1fab71){return _0x2b15cc[_0xc8e1('0x15')](_0x29e0e1)[_0xc8e1('0x16')](_0x1fab71);}};}function respondWithFilteredResult(_0x12c6bd,_0x39be1f){return function(_0x477511){if(_0x477511){var _0x39976d=typeof _0x39be1f[_0xc8e1('0x17')]==='undefined'&&typeof _0x39be1f[_0xc8e1('0x18')]==='undefined';var _0x211840=_0x477511['count'];var _0x282b66=_0x39976d?0x0:_0x39be1f['offset'];var _0x5624eb=_0x39976d?_0x477511[_0xc8e1('0x19')]:_0x39be1f[_0xc8e1('0x17')]+_0x39be1f['limit'];var _0x2d1475;if(_0x5624eb>=_0x211840){_0x5624eb=_0x211840;_0x2d1475=0xc8;}else{_0x2d1475=0xce;}_0x12c6bd['status'](_0x2d1475);return _0x12c6bd['set'](_0xc8e1('0x1a'),_0x282b66+'-'+_0x5624eb+'/'+_0x211840)['json'](_0x477511);}return null;};}function patchUpdates(_0x1d8291){return function(_0x13a244){try{jsonpatch[_0xc8e1('0x1b')](_0x13a244,_0x1d8291,!![]);}catch(_0x2fb8e1){return BPromise[_0xc8e1('0x1c')](_0x2fb8e1);}return _0x13a244[_0xc8e1('0x1d')]();};}function saveUpdates(_0xb8f330,_0x47a9fa){return function(_0x4a95da){if(_0x4a95da){return _0x4a95da[_0xc8e1('0x1e')](_0xb8f330)[_0xc8e1('0x1f')](function(_0x56d45c){return _0x56d45c;});}return null;};}function removeEntity(_0x3b7e8a,_0x25ef63){return function(_0x54a23e){if(_0x54a23e){return _0x54a23e[_0xc8e1('0x20')]()[_0xc8e1('0x1f')](function(){_0x3b7e8a[_0xc8e1('0x15')](0xcc)[_0xc8e1('0x21')]();});}};}function handleEntityNotFound(_0x5f2491,_0x4966d3){return function(_0x4866a3){if(!_0x4866a3){_0x5f2491['sendStatus'](0x194);}return _0x4866a3;};}function handleError(_0x29d08c,_0x273995){_0x273995=_0x273995||0x1f4;return function(_0x11d55c){logger[_0xc8e1('0x22')](_0x11d55c[_0xc8e1('0x23')]);if(_0x11d55c['name']){delete _0x11d55c['name'];}_0x29d08c['status'](_0x273995)['send'](_0x11d55c);};}exports[_0xc8e1('0x24')]=function(_0xc3e081,_0x13988a){var _0x4692db={},_0x2fb523={},_0x1ac059={'count':0x0,'rows':[]};var _0x290c55=_[_0xc8e1('0x25')](db[_0xc8e1('0x26')]['rawAttributes'],function(_0x1552ac){return{'name':_0x1552ac[_0xc8e1('0x27')],'type':_0x1552ac[_0xc8e1('0x28')]['key']};});_0x2fb523[_0xc8e1('0x29')]=_[_0xc8e1('0x25')](_0x290c55,_0xc8e1('0x2a'));_0x2fb523[_0xc8e1('0x2b')]=_[_0xc8e1('0x2c')](_0xc3e081[_0xc8e1('0x2b')]);_0x2fb523[_0xc8e1('0x2d')]=_[_0xc8e1('0x2e')](_0x2fb523[_0xc8e1('0x29')],_0x2fb523[_0xc8e1('0x2b')]);_0x4692db[_0xc8e1('0x2f')]=_['intersection'](_0x2fb523[_0xc8e1('0x29')],qs[_0xc8e1('0x30')](_0xc3e081[_0xc8e1('0x2b')][_0xc8e1('0x30')]));_0x4692db[_0xc8e1('0x2f')]=_0x4692db[_0xc8e1('0x2f')][_0xc8e1('0x31')]?_0x4692db[_0xc8e1('0x2f')]:_0x2fb523[_0xc8e1('0x29')];if(!_0xc3e081[_0xc8e1('0x2b')][_0xc8e1('0x32')](_0xc8e1('0x33'))){_0x4692db[_0xc8e1('0x18')]=qs[_0xc8e1('0x18')](_0xc3e081[_0xc8e1('0x2b')][_0xc8e1('0x18')]);_0x4692db[_0xc8e1('0x17')]=qs[_0xc8e1('0x17')](_0xc3e081['query'][_0xc8e1('0x17')]);}_0x4692db['order']=qs[_0xc8e1('0x34')](_0xc3e081[_0xc8e1('0x2b')][_0xc8e1('0x34')]);_0x4692db[_0xc8e1('0x35')]=qs[_0xc8e1('0x2d')](_[_0xc8e1('0x36')](_0xc3e081['query'],_0x2fb523[_0xc8e1('0x2d')]),_0x290c55);if(_0xc3e081['query'][_0xc8e1('0x37')]){_0x4692db['where']=_[_0xc8e1('0x38')](_0x4692db[_0xc8e1('0x35')],{'$or':_[_0xc8e1('0x25')](_0x290c55,function(_0x41778e){if(_0x41778e[_0xc8e1('0x28')]!==_0xc8e1('0x39')){var _0x51301d={};_0x51301d[_0x41778e[_0xc8e1('0x2a')]]={'$like':'%'+_0xc3e081[_0xc8e1('0x2b')][_0xc8e1('0x37')]+'%'};return _0x51301d;}})});}_0x4692db=_[_0xc8e1('0x38')]({},_0x4692db,_0xc3e081['options']);var _0x2a0336={'where':_0x4692db[_0xc8e1('0x35')]};return db[_0xc8e1('0x26')][_0xc8e1('0x19')](_0x2a0336)[_0xc8e1('0x1f')](function(_0x1d0a65){_0x1ac059[_0xc8e1('0x19')]=_0x1d0a65;if(_0xc3e081[_0xc8e1('0x2b')][_0xc8e1('0x3a')]){_0x4692db[_0xc8e1('0x3b')]=[{'all':!![]}];}return db['SugarcrmField']['findAll'](_0x4692db);})[_0xc8e1('0x1f')](function(_0x1c39c0){_0x1ac059['rows']=_0x1c39c0;return _0x1ac059;})['then'](respondWithFilteredResult(_0x13988a,_0x4692db))[_0xc8e1('0x3c')](handleError(_0x13988a,null));};exports[_0xc8e1('0x3d')]=function(_0x50e295,_0x55b76a){var _0x277505={'raw':!![],'where':{'id':_0x50e295[_0xc8e1('0x3e')]['id']}},_0xcc2ea7={};_0xcc2ea7['model']=_[_0xc8e1('0x2c')](db[_0xc8e1('0x26')][_0xc8e1('0x3f')]);_0xcc2ea7[_0xc8e1('0x2b')]=_[_0xc8e1('0x2c')](_0x50e295['query']);_0xcc2ea7[_0xc8e1('0x2d')]=_[_0xc8e1('0x2e')](_0xcc2ea7[_0xc8e1('0x29')],_0xcc2ea7[_0xc8e1('0x2b')]);_0x277505['attributes']=_[_0xc8e1('0x2e')](_0xcc2ea7[_0xc8e1('0x29')],qs[_0xc8e1('0x30')](_0x50e295[_0xc8e1('0x2b')][_0xc8e1('0x30')]));_0x277505[_0xc8e1('0x2f')]=_0x277505[_0xc8e1('0x2f')][_0xc8e1('0x31')]?_0x277505[_0xc8e1('0x2f')]:_0xcc2ea7[_0xc8e1('0x29')];if(_0x50e295['query']['includeAll']){_0x277505[_0xc8e1('0x3b')]=[{'all':!![]}];}_0x277505=_[_0xc8e1('0x38')]({},_0x277505,_0x50e295['options']);return db['SugarcrmField']['find'](_0x277505)['then'](handleEntityNotFound(_0x55b76a,null))[_0xc8e1('0x1f')](respondWithResult(_0x55b76a,null))[_0xc8e1('0x3c')](handleError(_0x55b76a,null));};exports[_0xc8e1('0x40')]=function(_0x1ccb24,_0x17c1aa){return db[_0xc8e1('0x26')][_0xc8e1('0x40')](_0x1ccb24[_0xc8e1('0x41')],{})['then'](respondWithResult(_0x17c1aa,0xc9))[_0xc8e1('0x3c')](handleError(_0x17c1aa,null));};exports[_0xc8e1('0x1e')]=function(_0x30206d,_0x295222){if(_0x30206d[_0xc8e1('0x41')]['id']){delete _0x30206d[_0xc8e1('0x41')]['id'];}return db[_0xc8e1('0x26')][_0xc8e1('0x42')]({'where':{'id':_0x30206d[_0xc8e1('0x3e')]['id']}})['then'](handleEntityNotFound(_0x295222,null))[_0xc8e1('0x1f')](saveUpdates(_0x30206d[_0xc8e1('0x41')],null))[_0xc8e1('0x1f')](respondWithResult(_0x295222,null))[_0xc8e1('0x3c')](handleError(_0x295222,null));};exports[_0xc8e1('0x20')]=function(_0x298ee8,_0x592b44){return db[_0xc8e1('0x26')][_0xc8e1('0x42')]({'where':{'id':_0x298ee8[_0xc8e1('0x3e')]['id']}})[_0xc8e1('0x1f')](handleEntityNotFound(_0x592b44,null))[_0xc8e1('0x1f')](removeEntity(_0x592b44,null))[_0xc8e1('0x3c')](handleError(_0x592b44,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 04c2bbd..8493ee9 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 _0x84f6=['define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x54cec2,_0x5dd20f){var _0x26dbbd=function(_0x1e5bc2){while(--_0x1e5bc2){_0x54cec2['push'](_0x54cec2['shift']());}};_0x26dbbd(++_0x5dd20f);}(_0x84f6,0x1d4));var _0x684f=function(_0x375492,_0x4ed149){_0x375492=_0x375492-0x0;var _0x18ba5b=_0x84f6[_0x375492];return _0x18ba5b;};'use strict';var _=require('lodash');var util=require(_0x684f('0x0'));var logger=require(_0x684f('0x1'))(_0x684f('0x2'));var moment=require('moment');var BPromise=require(_0x684f('0x3'));var rp=require(_0x684f('0x4'));var fs=require('fs');var path=require(_0x684f('0x5'));var rimraf=require(_0x684f('0x6'));var config=require(_0x684f('0x7'));var attributes=require('./intSugarcrmField.attributes');module['exports']=function(_0x3b8ab7,_0x3091c9){return _0x3b8ab7[_0x684f('0x8')](_0x684f('0x9'),attributes,{'tableName':_0x684f('0xa'),'paranoid':![],'indexes':[{'name':_0x684f('0xb'),'fields':[_0x684f('0xc'),_0x684f('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x20d5=['util','../../config/logger','moment','bluebird','path','../../config/environment','exports','define','SugarcrmField','idField','FieldId','lodash'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0x20d5,0x8f));var _0x520d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x20d5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x520d('0x0'));var util=require(_0x520d('0x1'));var logger=require(_0x520d('0x2'))('api');var moment=require(_0x520d('0x3'));var BPromise=require(_0x520d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x520d('0x5'));var rimraf=require('rimraf');var config=require(_0x520d('0x6'));var attributes=require('./intSugarcrmField.attributes');module[_0x520d('0x7')]=function(_0xaa2847,_0x429168){return _0xaa2847[_0x520d('0x8')](_0x520d('0x9'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x520d('0xa'),_0x520d('0xb')],'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 82f3669..230d336 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 _0x9831=['SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x3d59ee,_0x193901){var _0x5e4582=function(_0x3e16b9){while(--_0x3e16b9){_0x3d59ee['push'](_0x3d59ee['shift']());}};_0x5e4582(++_0x193901);}(_0x9831,0xb9));var _0x1983=function(_0x2f6e5a,_0xfa394f){_0x2f6e5a=_0x2f6e5a-0x0;var _0x3773ea=_0x9831[_0x2f6e5a];return _0x3773ea;};'use strict';var _=require(_0x1983('0x0'));var util=require(_0x1983('0x1'));var moment=require('moment');var BPromise=require(_0x1983('0x2'));var rs=require(_0x1983('0x3'));var fs=require('fs');var Redis=require(_0x1983('0x4'));var db=require(_0x1983('0x5'))['db'];var utils=require(_0x1983('0x6'));var logger=require(_0x1983('0x7'))(_0x1983('0x8'));var config=require(_0x1983('0x9'));var jayson=require(_0x1983('0xa'));var client=jayson[_0x1983('0xb')][_0x1983('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x8a0678,_0x27421a,_0x38b1cf){return new BPromise(function(_0x2a60e8,_0x37f755){return client[_0x1983('0xd')](_0x8a0678,_0x38b1cf)[_0x1983('0xe')](function(_0x1fa94b){logger['info'](_0x1983('0xf'),_0x27421a,_0x1983('0x10'));logger[_0x1983('0x11')](_0x1983('0x12'),_0x27421a,'request\x20sent',JSON['stringify'](_0x1fa94b));if(_0x1fa94b[_0x1983('0x13')]){if(_0x1fa94b[_0x1983('0x13')][_0x1983('0x14')]===0x1f4){logger[_0x1983('0x13')]('SugarcrmField,\x20%s,\x20%s',_0x27421a,_0x1fa94b[_0x1983('0x13')][_0x1983('0x15')]);return _0x37f755(_0x1fa94b['error'][_0x1983('0x15')]);}logger['error'](_0x1983('0xf'),_0x27421a,_0x1fa94b['error'][_0x1983('0x15')]);return _0x2a60e8(_0x1fa94b[_0x1983('0x13')][_0x1983('0x15')]);}else{logger[_0x1983('0x16')](_0x1983('0xf'),_0x27421a,'request\x20sent');_0x2a60e8(_0x1fa94b[_0x1983('0x17')]['message']);}})[_0x1983('0x18')](function(_0x79ad99){logger['error']('SugarcrmField,\x20%s,\x20%s',_0x27421a,_0x79ad99);_0x37f755(_0x79ad99);});});} \ No newline at end of file +var _0x8ef3=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','error','code','SugarcrmField,\x20%s,\x20%s','message','info','result','catch','moment'];(function(_0x30c2ae,_0x4c98a2){var _0x1ee1cc=function(_0x165922){while(--_0x165922){_0x30c2ae['push'](_0x30c2ae['shift']());}};_0x1ee1cc(++_0x4c98a2);}(_0x8ef3,0x125));var _0x38ef=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x8ef3[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x38ef('0x0'));var BPromise=require(_0x38ef('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x38ef('0x2'));var db=require(_0x38ef('0x3'))['db'];var utils=require(_0x38ef('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x38ef('0x5'));var jayson=require(_0x38ef('0x6'));var client=jayson[_0x38ef('0x7')][_0x38ef('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4edf31,_0x1ba06f,_0x22007a){return new BPromise(function(_0x5867cd,_0xee3adf){return client[_0x38ef('0x9')](_0x4edf31,_0x22007a)[_0x38ef('0xa')](function(_0x1b1fd8){logger['info']('SugarcrmField,\x20%s,\x20%s',_0x1ba06f,_0x38ef('0xb'));logger[_0x38ef('0xc')](_0x38ef('0xd'),_0x1ba06f,_0x38ef('0xb'),JSON['stringify'](_0x1b1fd8));if(_0x1b1fd8[_0x38ef('0xe')]){if(_0x1b1fd8[_0x38ef('0xe')][_0x38ef('0xf')]===0x1f4){logger[_0x38ef('0xe')](_0x38ef('0x10'),_0x1ba06f,_0x1b1fd8['error']['message']);return _0xee3adf(_0x1b1fd8[_0x38ef('0xe')][_0x38ef('0x11')]);}logger[_0x38ef('0xe')](_0x38ef('0x10'),_0x1ba06f,_0x1b1fd8[_0x38ef('0xe')]['message']);return _0x5867cd(_0x1b1fd8[_0x38ef('0xe')][_0x38ef('0x11')]);}else{logger[_0x38ef('0x12')](_0x38ef('0x10'),_0x1ba06f,_0x38ef('0xb'));_0x5867cd(_0x1b1fd8[_0x38ef('0x13')][_0x38ef('0x11')]);}})[_0x38ef('0x14')](function(_0x4392a7){logger[_0x38ef('0xe')](_0x38ef('0x10'),_0x1ba06f,_0x4392a7);_0xee3adf(_0x4392a7);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 6ba1daf..17e8ebc 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 _0x4a81=['util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','get','show','/:id/configurations','/:id/fields','getFields','create','post','addConfiguration','put','/:id','delete','destroy','multer'];(function(_0x56b034,_0xb96f9b){var _0x25f338=function(_0x4134cd){while(--_0x4134cd){_0x56b034['push'](_0x56b034['shift']());}};_0x25f338(++_0xb96f9b);}(_0x4a81,0x1b7));var _0x14a8=function(_0x4c00b0,_0x14f19c){_0x4c00b0=_0x4c00b0-0x0;var _0x56787b=_0x4a81[_0x4c00b0];return _0x56787b;};'use strict';var multer=require(_0x14a8('0x0'));var util=require(_0x14a8('0x1'));var path=require(_0x14a8('0x2'));var timeout=require(_0x14a8('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x14a8('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x14a8('0x5'));var config=require(_0x14a8('0x6'));var controller=require('./intVtigerAccount.controller');router['get']('/',auth[_0x14a8('0x7')](),controller['index']);router[_0x14a8('0x8')]('/:id',auth[_0x14a8('0x7')](),controller[_0x14a8('0x9')]);router[_0x14a8('0x8')](_0x14a8('0xa'),auth[_0x14a8('0x7')](),controller['getConfigurations']);router['get'](_0x14a8('0xb'),auth[_0x14a8('0x7')](),controller[_0x14a8('0xc')]);router['post']('/',auth[_0x14a8('0x7')](),controller[_0x14a8('0xd')]);router[_0x14a8('0xe')](_0x14a8('0xa'),auth[_0x14a8('0x7')](),controller[_0x14a8('0xf')]);router[_0x14a8('0x10')](_0x14a8('0x11'),auth['isAuthenticated'](),controller['update']);router[_0x14a8('0x12')](_0x14a8('0x11'),auth['isAuthenticated'](),controller[_0x14a8('0x13')]);module['exports']=router; \ No newline at end of file +var _0x4f29=['/:id','isAuthenticated','show','getFields','post','/:id/configurations','addConfiguration','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get'];(function(_0x1b2422,_0x1e98d4){var _0x376573=function(_0x5db41b){while(--_0x5db41b){_0x1b2422['push'](_0x1b2422['shift']());}};_0x376573(++_0x1e98d4);}(_0x4f29,0xfd));var _0x94f2=function(_0x4e5f49,_0x159d3d){_0x4e5f49=_0x4e5f49-0x0;var _0x19a4e7=_0x4f29[_0x4e5f49];return _0x19a4e7;};'use strict';var multer=require('multer');var util=require(_0x94f2('0x0'));var path=require(_0x94f2('0x1'));var timeout=require(_0x94f2('0x2'));var express=require(_0x94f2('0x3'));var router=express[_0x94f2('0x4')]();var fs_extra=require(_0x94f2('0x5'));var auth=require(_0x94f2('0x6'));var interaction=require(_0x94f2('0x7'));var config=require(_0x94f2('0x8'));var controller=require(_0x94f2('0x9'));router[_0x94f2('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x94f2('0xa')](_0x94f2('0xb'),auth[_0x94f2('0xc')](),controller[_0x94f2('0xd')]);router[_0x94f2('0xa')]('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router[_0x94f2('0xa')]('/:id/fields',auth[_0x94f2('0xc')](),controller[_0x94f2('0xe')]);router[_0x94f2('0xf')]('/',auth[_0x94f2('0xc')](),controller['create']);router[_0x94f2('0xf')](_0x94f2('0x10'),auth[_0x94f2('0xc')](),controller[_0x94f2('0x11')]);router[_0x94f2('0x12')](_0x94f2('0xb'),auth[_0x94f2('0xc')](),controller['update']);router[_0x94f2('0x13')]('/:id',auth[_0x94f2('0xc')](),controller[_0x94f2('0x14')]);module[_0x94f2('0x15')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 0357c3a..d838e36 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 _0x81f2=['STRING','HelpDesk','exports'];(function(_0x210157,_0x27d65a){var _0x3b44a2=function(_0x378824){while(--_0x378824){_0x210157['push'](_0x210157['shift']());}};_0x3b44a2(++_0x27d65a);}(_0x81f2,0x1d9));var _0x281f=function(_0x41a4bb,_0x36b115){_0x41a4bb=_0x41a4bb-0x0;var _0x4d4239=_0x81f2[_0x41a4bb];return _0x4d4239;};'use strict';var Sequelize=require('sequelize');module[_0x281f('0x0')]={'name':{'type':Sequelize[_0x281f('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x281f('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x281f('0x1')],'allowNull':![],'defaultValue':_0x281f('0x2')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x281f('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x281f('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x4515=['STRING','HelpDesk'];(function(_0x1fd1e5,_0x5048dc){var _0x3a73b5=function(_0x26fb7e){while(--_0x26fb7e){_0x1fd1e5['push'](_0x1fd1e5['shift']());}};_0x3a73b5(++_0x5048dc);}(_0x4515,0x90));var _0x5451=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x4515[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x5451('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x5451('0x0')]},'username':{'type':Sequelize[_0x5451('0x0')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x5451('0x0')],'allowNull':![],'defaultValue':_0x5451('0x1')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0x5451('0x0')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 625e1cc..350a28b 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 _0x3423=['moduleName','remoteUri','serverUrl','slice','substring','lastIndexOf','%s/webservice.php','POST','result','token','success','describe','autogenerated','reference','owner','remove','includes','editable','label','startsWith','cf_','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','zip-dir','bluebird','mustache','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','reject','then','destroy','error','stack','send','map','VtigerAccount','key','model','query','keys','filters','intersection','attributes','fields','length','limit','order','sort','where','pick','filter','merge','name','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','update','findOne','VtigerConfiguration','rawAttributes','hasOwnProperty','nolimit','getConfigurations','addConfiguration','AccountId','Subjects','type','Descriptions','getDescriptions','channel','VtigerField','md5','getFields','username'];(function(_0x3c71cd,_0x2961ba){var _0x5c8372=function(_0x1327fc){while(--_0x1327fc){_0x3c71cd['push'](_0x3c71cd['shift']());}};_0x5c8372(++_0x2961ba);}(_0x3423,0x1ee));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3342('0x0'));var zipdir=require(_0x3342('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3342('0x2'));var Mustache=require(_0x3342('0x3'));var util=require('util');var path=require(_0x3342('0x4'));var sox=require(_0x3342('0x5'));var csv=require(_0x3342('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3342('0x7'));var _=require('lodash');var squel=require(_0x3342('0x8'));var crypto=require('crypto');var jsforce=require(_0x3342('0x9'));var deskjs=require(_0x3342('0xa'));var toCsv=require(_0x3342('0x6'));var querystring=require(_0x3342('0xb'));var Papa=require('papaparse');var Redis=require(_0x3342('0xc'));var authService=require(_0x3342('0xd'));var qs=require(_0x3342('0xe'));var as=require(_0x3342('0xf'));var hardwareService=require(_0x3342('0x10'));var logger=require(_0x3342('0x11'))(_0x3342('0x12'));var utils=require('../../config/utils');var config=require(_0x3342('0x13'));var licenseUtil=require(_0x3342('0x14'));var db=require(_0x3342('0x15'))['db'];var integrations=require(_0x3342('0x16'));function respondWithStatusCode(_0x2a9b7d,_0x3c5e64){_0x3c5e64=_0x3c5e64||0xcc;return function(_0x28a4ad){if(_0x28a4ad){return _0x2a9b7d[_0x3342('0x17')](_0x3c5e64);}return _0x2a9b7d[_0x3342('0x18')](_0x3c5e64)[_0x3342('0x19')]();};}function respondWithResult(_0x269d61,_0x3aaac0){_0x3aaac0=_0x3aaac0||0xc8;return function(_0x46956e){if(_0x46956e){return _0x269d61['status'](_0x3aaac0)[_0x3342('0x1a')](_0x46956e);}};}function respondWithFilteredResult(_0x108481,_0x35068a){return function(_0x1e56e7){if(_0x1e56e7){var _0x3cc27e=typeof _0x35068a['offset']==='undefined'&&typeof _0x35068a['limit']===_0x3342('0x1b');var _0x28eba1=_0x1e56e7[_0x3342('0x1c')];var _0x9862=_0x3cc27e?0x0:_0x35068a[_0x3342('0x1d')];var _0x363854=_0x3cc27e?_0x1e56e7[_0x3342('0x1c')]:_0x35068a[_0x3342('0x1d')]+_0x35068a['limit'];var _0x205976;if(_0x363854>=_0x28eba1){_0x363854=_0x28eba1;_0x205976=0xc8;}else{_0x205976=0xce;}_0x108481['status'](_0x205976);return _0x108481[_0x3342('0x1e')](_0x3342('0x1f'),_0x9862+'-'+_0x363854+'/'+_0x28eba1)[_0x3342('0x1a')](_0x1e56e7);}return null;};}function patchUpdates(_0x59eccd){return function(_0x2043fc){try{jsonpatch['apply'](_0x2043fc,_0x59eccd,!![]);}catch(_0x133269){return BPromise[_0x3342('0x20')](_0x133269);}return _0x2043fc['save']();};}function saveUpdates(_0x18cf4d,_0x2d4ef0){return function(_0x48f220){if(_0x48f220){return _0x48f220['update'](_0x18cf4d)[_0x3342('0x21')](function(_0x388773){return _0x388773;});}return null;};}function removeEntity(_0x596bf0,_0xd97e9){return function(_0x1264e9){if(_0x1264e9){return _0x1264e9[_0x3342('0x22')]()[_0x3342('0x21')](function(){_0x596bf0[_0x3342('0x18')](0xcc)[_0x3342('0x19')]();});}};}function handleEntityNotFound(_0x1cfb59,_0x474fb6){return function(_0x33e970){if(!_0x33e970){_0x1cfb59[_0x3342('0x17')](0x194);}return _0x33e970;};}function handleError(_0x3ba461,_0x586271){_0x586271=_0x586271||0x1f4;return function(_0x28e8be){logger[_0x3342('0x23')](_0x28e8be[_0x3342('0x24')]);if(_0x28e8be['name']){delete _0x28e8be['name'];}_0x3ba461[_0x3342('0x18')](_0x586271)[_0x3342('0x25')](_0x28e8be);};}exports['index']=function(_0x3f16ef,_0x5f04fa){var _0x371cb9={},_0x4214aa={},_0x5295eb={'count':0x0,'rows':[]};var _0x121ce2=_[_0x3342('0x26')](db[_0x3342('0x27')]['rawAttributes'],function(_0x2175c7){return{'name':_0x2175c7['fieldName'],'type':_0x2175c7['type'][_0x3342('0x28')]};});_0x4214aa[_0x3342('0x29')]=_[_0x3342('0x26')](_0x121ce2,'name');_0x4214aa[_0x3342('0x2a')]=_[_0x3342('0x2b')](_0x3f16ef['query']);_0x4214aa[_0x3342('0x2c')]=_[_0x3342('0x2d')](_0x4214aa[_0x3342('0x29')],_0x4214aa[_0x3342('0x2a')]);_0x371cb9[_0x3342('0x2e')]=_[_0x3342('0x2d')](_0x4214aa[_0x3342('0x29')],qs[_0x3342('0x2f')](_0x3f16ef[_0x3342('0x2a')]['fields']));_0x371cb9[_0x3342('0x2e')]=_0x371cb9[_0x3342('0x2e')][_0x3342('0x30')]?_0x371cb9[_0x3342('0x2e')]:_0x4214aa[_0x3342('0x29')];if(!_0x3f16ef[_0x3342('0x2a')]['hasOwnProperty']('nolimit')){_0x371cb9[_0x3342('0x31')]=qs[_0x3342('0x31')](_0x3f16ef[_0x3342('0x2a')]['limit']);_0x371cb9[_0x3342('0x1d')]=qs[_0x3342('0x1d')](_0x3f16ef[_0x3342('0x2a')][_0x3342('0x1d')]);}_0x371cb9[_0x3342('0x32')]=qs[_0x3342('0x33')](_0x3f16ef[_0x3342('0x2a')]['sort']);_0x371cb9[_0x3342('0x34')]=qs[_0x3342('0x2c')](_[_0x3342('0x35')](_0x3f16ef[_0x3342('0x2a')],_0x4214aa['filters']),_0x121ce2);if(_0x3f16ef[_0x3342('0x2a')][_0x3342('0x36')]){_0x371cb9[_0x3342('0x34')]=_[_0x3342('0x37')](_0x371cb9['where'],{'$or':_[_0x3342('0x26')](_0x121ce2,function(_0x3e6018){if(_0x3e6018['type']!=='VIRTUAL'){var _0x4b3c7a={};_0x4b3c7a[_0x3e6018[_0x3342('0x38')]]={'$like':'%'+_0x3f16ef[_0x3342('0x2a')]['filter']+'%'};return _0x4b3c7a;}})});}_0x371cb9=_[_0x3342('0x37')]({},_0x371cb9,_0x3f16ef[_0x3342('0x39')]);var _0x4758ec={'where':_0x371cb9['where']};return db[_0x3342('0x27')][_0x3342('0x1c')](_0x4758ec)[_0x3342('0x21')](function(_0x29d3e4){_0x5295eb['count']=_0x29d3e4;if(_0x3f16ef[_0x3342('0x2a')][_0x3342('0x3a')]){_0x371cb9[_0x3342('0x3b')]=[{'all':!![]}];}return db[_0x3342('0x27')][_0x3342('0x3c')](_0x371cb9);})[_0x3342('0x21')](function(_0x536a32){_0x5295eb[_0x3342('0x3d')]=_0x536a32;return _0x5295eb;})[_0x3342('0x21')](respondWithFilteredResult(_0x5f04fa,_0x371cb9))['catch'](handleError(_0x5f04fa,null));};exports[_0x3342('0x3e')]=function(_0x417516,_0x5c417b){var _0x3cf9c7={'raw':![],'where':{'id':_0x417516[_0x3342('0x3f')]['id']}},_0x54d1ab={};_0x54d1ab['model']=_[_0x3342('0x2b')](db['VtigerAccount']['rawAttributes']);_0x54d1ab[_0x3342('0x2a')]=_[_0x3342('0x2b')](_0x417516['query']);_0x54d1ab[_0x3342('0x2c')]=_[_0x3342('0x2d')](_0x54d1ab['model'],_0x54d1ab[_0x3342('0x2a')]);_0x3cf9c7[_0x3342('0x2e')]=_['intersection'](_0x54d1ab[_0x3342('0x29')],qs[_0x3342('0x2f')](_0x417516['query'][_0x3342('0x2f')]));_0x3cf9c7['attributes']=_0x3cf9c7[_0x3342('0x2e')][_0x3342('0x30')]?_0x3cf9c7[_0x3342('0x2e')]:_0x54d1ab[_0x3342('0x29')];if(_0x417516['query'][_0x3342('0x3a')]){_0x3cf9c7['include']=[{'all':!![]}];}_0x3cf9c7=_['merge']({},_0x3cf9c7,_0x417516[_0x3342('0x39')]);return db[_0x3342('0x27')][_0x3342('0x40')](_0x3cf9c7)[_0x3342('0x21')](handleEntityNotFound(_0x5c417b,null))[_0x3342('0x21')](respondWithResult(_0x5c417b,null))[_0x3342('0x41')](handleError(_0x5c417b,null));};exports[_0x3342('0x42')]=function(_0x2dae00,_0x401cd4){return db['VtigerAccount'][_0x3342('0x42')](_0x2dae00[_0x3342('0x43')],{})[_0x3342('0x21')](respondWithResult(_0x401cd4,0xc9))[_0x3342('0x41')](handleError(_0x401cd4,null));};exports[_0x3342('0x44')]=function(_0x4487f2,_0x13b254){if(_0x4487f2[_0x3342('0x43')]['id']){delete _0x4487f2[_0x3342('0x43')]['id'];}return db[_0x3342('0x27')][_0x3342('0x40')]({'where':{'id':_0x4487f2['params']['id']}})[_0x3342('0x21')](handleEntityNotFound(_0x13b254,null))[_0x3342('0x21')](saveUpdates(_0x4487f2['body'],null))[_0x3342('0x21')](respondWithResult(_0x13b254,null))[_0x3342('0x41')](handleError(_0x13b254,null));};exports['destroy']=function(_0x596986,_0x65a196){return db['VtigerAccount'][_0x3342('0x40')]({'where':{'id':_0x596986[_0x3342('0x3f')]['id']}})[_0x3342('0x21')](handleEntityNotFound(_0x65a196,null))['then'](removeEntity(_0x65a196,null))[_0x3342('0x41')](handleError(_0x65a196,null));};exports['getConfigurations']=function(_0x2c9a7a,_0x40b05e,_0x1d921d){var _0x36e09a={};var _0xeab102={};var _0x47ff55;var _0x4f533c;return db[_0x3342('0x27')][_0x3342('0x45')]({'where':{'id':_0x2c9a7a['params']['id']}})[_0x3342('0x21')](handleEntityNotFound(_0x40b05e,null))[_0x3342('0x21')](function(_0x4cb1bc){if(_0x4cb1bc){_0x47ff55=_0x4cb1bc;_0xeab102[_0x3342('0x29')]=_[_0x3342('0x2b')](db[_0x3342('0x46')][_0x3342('0x47')]);_0xeab102['query']=_[_0x3342('0x2b')](_0x2c9a7a['query']);_0xeab102[_0x3342('0x2c')]=_[_0x3342('0x2d')](_0xeab102[_0x3342('0x29')],_0xeab102['query']);_0x36e09a[_0x3342('0x2e')]=_[_0x3342('0x2d')](_0xeab102[_0x3342('0x29')],qs[_0x3342('0x2f')](_0x2c9a7a[_0x3342('0x2a')][_0x3342('0x2f')]));_0x36e09a[_0x3342('0x2e')]=_0x36e09a[_0x3342('0x2e')][_0x3342('0x30')]?_0x36e09a[_0x3342('0x2e')]:_0xeab102[_0x3342('0x29')];_0x36e09a['order']=qs[_0x3342('0x33')](_0x2c9a7a[_0x3342('0x2a')]['sort']);_0x36e09a[_0x3342('0x34')]=qs[_0x3342('0x2c')](_[_0x3342('0x35')](_0x2c9a7a['query'],_0xeab102[_0x3342('0x2c')]));if(_0x2c9a7a[_0x3342('0x2a')]['filter']){_0x36e09a[_0x3342('0x34')]=_[_0x3342('0x37')](_0x36e09a[_0x3342('0x34')],{'$or':_[_0x3342('0x26')](_0x36e09a[_0x3342('0x2e')],function(_0x8a66b0){var _0x5b720c={};_0x5b720c[_0x8a66b0]={'$like':'%'+_0x2c9a7a[_0x3342('0x2a')][_0x3342('0x36')]+'%'};return _0x5b720c;})});}_0x36e09a=_[_0x3342('0x37')]({},_0x36e09a,_0x2c9a7a[_0x3342('0x39')]);return _0x47ff55['getConfigurations'](_0x36e09a);}})['then'](function(_0x2df9e0){if(_0x2df9e0){_0x4f533c=_0x2df9e0['length'];if(!_0x2c9a7a[_0x3342('0x2a')][_0x3342('0x48')](_0x3342('0x49'))){_0x36e09a['limit']=qs[_0x3342('0x31')](_0x2c9a7a['query']['limit']);_0x36e09a[_0x3342('0x1d')]=qs[_0x3342('0x1d')](_0x2c9a7a[_0x3342('0x2a')][_0x3342('0x1d')]);}return _0x47ff55[_0x3342('0x4a')](_0x36e09a);}})[_0x3342('0x21')](function(_0x3bffaa){if(_0x3bffaa){return _0x3bffaa?{'count':_0x4f533c,'rows':_0x3bffaa}:null;}})[_0x3342('0x21')](respondWithResult(_0x40b05e,null))['catch'](handleError(_0x40b05e,null));};exports[_0x3342('0x4b')]=function(_0x2c2547,_0x230f2c,_0x20e3f4){if(_0x2c2547[_0x3342('0x43')]['id']){delete _0x2c2547['body']['id'];}return db[_0x3342('0x27')][_0x3342('0x45')]({'where':{'id':_0x2c2547[_0x3342('0x3f')]['id']}})[_0x3342('0x21')](handleEntityNotFound(_0x230f2c,null))[_0x3342('0x21')](function(_0x46713d){if(_0x46713d){_0x2c2547[_0x3342('0x43')][_0x3342('0x4c')]=_0x46713d['id'];_0x2c2547[_0x3342('0x43')][_0x3342('0x4d')]=integrations['getSubjects'](_0x2c2547[_0x3342('0x43')]['channel'],_0x2c2547[_0x3342('0x43')][_0x3342('0x4e')]);_0x2c2547[_0x3342('0x43')][_0x3342('0x4f')]=integrations[_0x3342('0x50')](_0x2c2547[_0x3342('0x43')][_0x3342('0x51')],_0x2c2547[_0x3342('0x43')][_0x3342('0x4e')]);return db[_0x3342('0x46')][_0x3342('0x42')](_0x2c2547['body'],{'include':[{'model':db[_0x3342('0x52')],'as':_0x3342('0x4d')},{'model':db[_0x3342('0x52')],'as':_0x3342('0x4f')}]});}return null;})['then'](respondWithResult(_0x230f2c,null))[_0x3342('0x41')](handleError(_0x230f2c,null));};var md5=require(_0x3342('0x53'));exports[_0x3342('0x54')]=function(_0x6d82ce,_0x9a1cea,_0x54a3c7){var _0x110778=null;var _0x12dde8=null;var _0x55350b=null;var _0x3c4e8e=null;var _0x3f3767='';return db[_0x3342('0x27')][_0x3342('0x45')]({'where':{'id':_0x6d82ce[_0x3342('0x3f')]['id']},'attributes':['id',_0x3342('0x38'),_0x3342('0x55'),'description',_0x3342('0x56'),_0x3342('0x57'),_0x3342('0x58'),'accessKey']})[_0x3342('0x21')](handleEntityNotFound(_0x9a1cea,null))[_0x3342('0x21')](function(_0x343c37){if(_0x343c37){_0x110778=_0x343c37[_0x3342('0x55')];_0x12dde8=_0x343c37['accessKey'];_0x55350b=_0x343c37[_0x3342('0x56')];_0x3f3767=_0x343c37[_0x3342('0x57')];var _0x27a640=_0x3f3767[_0x3342('0x59')](-0x1);if(_0x27a640==='/'){_0x3f3767=_0x3f3767[_0x3342('0x5a')](0x0,_0x3f3767[_0x3342('0x5b')](_0x27a640));}_0x3c4e8e=util['format'](_0x3342('0x5c'),_0x3f3767);var _0x2ac436={'method':'GET','uri':_0x3c4e8e,'qs':{'operation':'getchallenge','username':_0x343c37[_0x3342('0x55')]},'json':!![]};return rp(_0x2ac436);}})[_0x3342('0x21')](function(_0x2781f1){if(_0x2781f1['success']){var _0x23b726={'method':_0x3342('0x5d'),'uri':_0x3c4e8e,'form':{'operation':'login','username':_0x110778,'accessKey':md5(_0x2781f1[_0x3342('0x5e')][_0x3342('0x5f')]+_0x12dde8)},'json':!![]};return rp(_0x23b726);}})[_0x3342('0x21')](function(_0x5c89c7){if(_0x5c89c7[_0x3342('0x60')]){var _0x51b42a={'method':'GET','uri':_0x3c4e8e,'qs':{'operation':_0x3342('0x61'),'username':_0x110778,'sessionName':_0x5c89c7[_0x3342('0x5e')]['sessionName'],'elementType':_0x55350b},'json':!![]};return rp(_0x51b42a);}})[_0x3342('0x21')](function(_0x5bd694){if(_0x5bd694['success']){var _0x2f353a=[_0x3342('0x62'),_0x3342('0x63'),_0x3342('0x64')];_[_0x3342('0x65')](_0x5bd694[_0x3342('0x5e')]['fields'],function(_0x41de42){return _0x2f353a[_0x3342('0x66')](_0x41de42[_0x3342('0x4e')][_0x3342('0x38')]);});_[_0x3342('0x65')](_0x5bd694[_0x3342('0x5e')][_0x3342('0x2f')],function(_0xaf3505){return _0xaf3505[_0x3342('0x67')]==='false';});return{'count':_0x5bd694[_0x3342('0x5e')][_0x3342('0x2f')][_0x3342('0x30')],'rows':_['map'](_0x5bd694['result'][_0x3342('0x2f')],function(_0x4def90){return{'id':_0x4def90[_0x3342('0x38')],'name':_0x4def90[_0x3342('0x68')],'custom':_[_0x3342('0x69')](_0x4def90[_0x3342('0x38')],_0x3342('0x6a'))?!![]:![],'options':_0x4def90[_0x3342('0x4e')][_0x3342('0x38')]==='picklist'&&_0x4def90['type']['picklistValues'][_0x3342('0x30')]>0x0?_[_0x3342('0x26')](_0x4def90['type'][_0x3342('0x6b')],function(_0x4bceba){return{'name':_0x4bceba[_0x3342('0x68')],'value':_0x4bceba[_0x3342('0x6c')]};}):[]};})};}})['then'](respondWithResult(_0x9a1cea,null))['catch'](function(_0x2f39bd){console[_0x3342('0x6d')](_0x3342('0x6e')+_0x2f39bd);var _0x3b1fe7=_0x6d82ce['query'][_0x3342('0x6f')]?0x1f4:_0x2f39bd[_0x3342('0x70')]||0x1f4;logger['error'](_0x3342('0x71'),_0x3342('0x54'),_0x3b1fe7,JSON[_0x3342('0x72')](_0x2f39bd));delete _0x2f39bd[_0x3342('0x38')];if(_0x3b1fe7===0x191){_0x3b1fe7=0x190;}_0x9a1cea[_0x3342('0x18')](_0x3b1fe7)['send'](_0x6d82ce[_0x3342('0x2a')][_0x3342('0x6f')]?{'message':_0x3342('0x73'),'statusCode':_0x2f39bd[_0x3342('0x70')]}:_0x2f39bd);});}; \ No newline at end of file +var _0xe517=['remoteUri','accessKey','lastIndexOf','format','%s/webservice.php','GET','getchallenge','POST','login','result','token','success','sessionName','autogenerated','reference','owner','includes','remove','false','startsWith','picklist','picklistValues','label','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','eml-format','zip-dir','request-promise','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','count','Content-Range','apply','save','update','then','destroy','error','name','send','index','map','VtigerAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','rawAttributes','find','catch','create','body','getConfigurations','findOne','VtigerConfiguration','pick','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','VtigerField','username','description','moduleName'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xe517,0x185));var _0x7e51=function(_0xbe2275,_0x280329){_0xbe2275=_0xbe2275-0x0;var _0x12663a=_0xe517[_0xbe2275];return _0x12663a;};'use strict';var emlformat=require(_0x7e51('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7e51('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7e51('0x2'));var moment=require('moment');var BPromise=require(_0x7e51('0x3'));var Mustache=require(_0x7e51('0x4'));var util=require('util');var path=require('path');var sox=require(_0x7e51('0x5'));var csv=require('to-csv');var ejs=require(_0x7e51('0x6'));var fs=require('fs');var fs_extra=require(_0x7e51('0x7'));var _=require(_0x7e51('0x8'));var squel=require(_0x7e51('0x9'));var crypto=require(_0x7e51('0xa'));var jsforce=require(_0x7e51('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x7e51('0xc'));var querystring=require(_0x7e51('0xd'));var Papa=require(_0x7e51('0xe'));var Redis=require(_0x7e51('0xf'));var authService=require(_0x7e51('0x10'));var qs=require(_0x7e51('0x11'));var as=require(_0x7e51('0x12'));var hardwareService=require(_0x7e51('0x13'));var logger=require(_0x7e51('0x14'))(_0x7e51('0x15'));var utils=require(_0x7e51('0x16'));var config=require(_0x7e51('0x17'));var licenseUtil=require(_0x7e51('0x18'));var db=require(_0x7e51('0x19'))['db'];var integrations=require(_0x7e51('0x1a'));function respondWithStatusCode(_0x29f6d4,_0x46ca18){_0x46ca18=_0x46ca18||0xcc;return function(_0x5b1004){if(_0x5b1004){return _0x29f6d4[_0x7e51('0x1b')](_0x46ca18);}return _0x29f6d4['status'](_0x46ca18)[_0x7e51('0x1c')]();};}function respondWithResult(_0x296aee,_0xcd1504){_0xcd1504=_0xcd1504||0xc8;return function(_0x1316bf){if(_0x1316bf){return _0x296aee[_0x7e51('0x1d')](_0xcd1504)[_0x7e51('0x1e')](_0x1316bf);}};}function respondWithFilteredResult(_0x588604,_0x325e3e){return function(_0x516a62){if(_0x516a62){var _0x8de5a2=typeof _0x325e3e[_0x7e51('0x1f')]===_0x7e51('0x20')&&typeof _0x325e3e['limit']==='undefined';var _0x22b908=_0x516a62[_0x7e51('0x21')];var _0x35fabb=_0x8de5a2?0x0:_0x325e3e['offset'];var _0x277c4d=_0x8de5a2?_0x516a62[_0x7e51('0x21')]:_0x325e3e[_0x7e51('0x1f')]+_0x325e3e['limit'];var _0x21559b;if(_0x277c4d>=_0x22b908){_0x277c4d=_0x22b908;_0x21559b=0xc8;}else{_0x21559b=0xce;}_0x588604[_0x7e51('0x1d')](_0x21559b);return _0x588604['set'](_0x7e51('0x22'),_0x35fabb+'-'+_0x277c4d+'/'+_0x22b908)[_0x7e51('0x1e')](_0x516a62);}return null;};}function patchUpdates(_0x42d323){return function(_0x320041){try{jsonpatch[_0x7e51('0x23')](_0x320041,_0x42d323,!![]);}catch(_0x352370){return BPromise['reject'](_0x352370);}return _0x320041[_0x7e51('0x24')]();};}function saveUpdates(_0x1375cd,_0x4b650c){return function(_0xb4677f){if(_0xb4677f){return _0xb4677f[_0x7e51('0x25')](_0x1375cd)[_0x7e51('0x26')](function(_0x4e3fa5){return _0x4e3fa5;});}return null;};}function removeEntity(_0x134e12,_0x5ef055){return function(_0x5d0e0a){if(_0x5d0e0a){return _0x5d0e0a[_0x7e51('0x27')]()['then'](function(){_0x134e12[_0x7e51('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1bd600,_0x2db641){return function(_0x4cef10){if(!_0x4cef10){_0x1bd600['sendStatus'](0x194);}return _0x4cef10;};}function handleError(_0xf11b7d,_0x43140f){_0x43140f=_0x43140f||0x1f4;return function(_0x5c448b){logger[_0x7e51('0x28')](_0x5c448b['stack']);if(_0x5c448b[_0x7e51('0x29')]){delete _0x5c448b[_0x7e51('0x29')];}_0xf11b7d[_0x7e51('0x1d')](_0x43140f)[_0x7e51('0x2a')](_0x5c448b);};}exports[_0x7e51('0x2b')]=function(_0x2ca9d6,_0x262dc5){var _0x4c5aaf={},_0x4f0f25={},_0x3efaa9={'count':0x0,'rows':[]};var _0x2aa530=_[_0x7e51('0x2c')](db[_0x7e51('0x2d')]['rawAttributes'],function(_0x2664a5){return{'name':_0x2664a5[_0x7e51('0x2e')],'type':_0x2664a5[_0x7e51('0x2f')][_0x7e51('0x30')]};});_0x4f0f25[_0x7e51('0x31')]=_['map'](_0x2aa530,_0x7e51('0x29'));_0x4f0f25[_0x7e51('0x32')]=_[_0x7e51('0x33')](_0x2ca9d6[_0x7e51('0x32')]);_0x4f0f25[_0x7e51('0x34')]=_[_0x7e51('0x35')](_0x4f0f25[_0x7e51('0x31')],_0x4f0f25['query']);_0x4c5aaf[_0x7e51('0x36')]=_[_0x7e51('0x35')](_0x4f0f25['model'],qs[_0x7e51('0x37')](_0x2ca9d6['query'][_0x7e51('0x37')]));_0x4c5aaf[_0x7e51('0x36')]=_0x4c5aaf[_0x7e51('0x36')][_0x7e51('0x38')]?_0x4c5aaf[_0x7e51('0x36')]:_0x4f0f25['model'];if(!_0x2ca9d6['query'][_0x7e51('0x39')](_0x7e51('0x3a'))){_0x4c5aaf['limit']=qs[_0x7e51('0x3b')](_0x2ca9d6[_0x7e51('0x32')][_0x7e51('0x3b')]);_0x4c5aaf[_0x7e51('0x1f')]=qs[_0x7e51('0x1f')](_0x2ca9d6['query']['offset']);}_0x4c5aaf[_0x7e51('0x3c')]=qs[_0x7e51('0x3d')](_0x2ca9d6[_0x7e51('0x32')][_0x7e51('0x3d')]);_0x4c5aaf[_0x7e51('0x3e')]=qs[_0x7e51('0x34')](_['pick'](_0x2ca9d6['query'],_0x4f0f25[_0x7e51('0x34')]),_0x2aa530);if(_0x2ca9d6[_0x7e51('0x32')][_0x7e51('0x3f')]){_0x4c5aaf[_0x7e51('0x3e')]=_[_0x7e51('0x40')](_0x4c5aaf[_0x7e51('0x3e')],{'$or':_[_0x7e51('0x2c')](_0x2aa530,function(_0x231895){if(_0x231895[_0x7e51('0x2f')]!==_0x7e51('0x41')){var _0x30b9fa={};_0x30b9fa[_0x231895[_0x7e51('0x29')]]={'$like':'%'+_0x2ca9d6[_0x7e51('0x32')]['filter']+'%'};return _0x30b9fa;}})});}_0x4c5aaf=_[_0x7e51('0x40')]({},_0x4c5aaf,_0x2ca9d6[_0x7e51('0x42')]);var _0x1b37a0={'where':_0x4c5aaf[_0x7e51('0x3e')]};return db['VtigerAccount'][_0x7e51('0x21')](_0x1b37a0)[_0x7e51('0x26')](function(_0xd46ec8){_0x3efaa9[_0x7e51('0x21')]=_0xd46ec8;if(_0x2ca9d6[_0x7e51('0x32')][_0x7e51('0x43')]){_0x4c5aaf[_0x7e51('0x44')]=[{'all':!![]}];}return db[_0x7e51('0x2d')][_0x7e51('0x45')](_0x4c5aaf);})[_0x7e51('0x26')](function(_0x2f663f){_0x3efaa9[_0x7e51('0x46')]=_0x2f663f;return _0x3efaa9;})[_0x7e51('0x26')](respondWithFilteredResult(_0x262dc5,_0x4c5aaf))['catch'](handleError(_0x262dc5,null));};exports['show']=function(_0x304c4e,_0xbfa791){var _0x200706={'raw':![],'where':{'id':_0x304c4e[_0x7e51('0x47')]['id']}},_0x46560f={};_0x46560f[_0x7e51('0x31')]=_[_0x7e51('0x33')](db[_0x7e51('0x2d')][_0x7e51('0x48')]);_0x46560f[_0x7e51('0x32')]=_[_0x7e51('0x33')](_0x304c4e[_0x7e51('0x32')]);_0x46560f['filters']=_['intersection'](_0x46560f[_0x7e51('0x31')],_0x46560f[_0x7e51('0x32')]);_0x200706['attributes']=_[_0x7e51('0x35')](_0x46560f[_0x7e51('0x31')],qs[_0x7e51('0x37')](_0x304c4e[_0x7e51('0x32')]['fields']));_0x200706['attributes']=_0x200706[_0x7e51('0x36')][_0x7e51('0x38')]?_0x200706[_0x7e51('0x36')]:_0x46560f['model'];if(_0x304c4e[_0x7e51('0x32')][_0x7e51('0x43')]){_0x200706[_0x7e51('0x44')]=[{'all':!![]}];}_0x200706=_['merge']({},_0x200706,_0x304c4e[_0x7e51('0x42')]);return db[_0x7e51('0x2d')][_0x7e51('0x49')](_0x200706)[_0x7e51('0x26')](handleEntityNotFound(_0xbfa791,null))[_0x7e51('0x26')](respondWithResult(_0xbfa791,null))[_0x7e51('0x4a')](handleError(_0xbfa791,null));};exports[_0x7e51('0x4b')]=function(_0x17bddd,_0xea8963){return db[_0x7e51('0x2d')][_0x7e51('0x4b')](_0x17bddd[_0x7e51('0x4c')],{})[_0x7e51('0x26')](respondWithResult(_0xea8963,0xc9))[_0x7e51('0x4a')](handleError(_0xea8963,null));};exports[_0x7e51('0x25')]=function(_0x338a0c,_0x35710d){if(_0x338a0c[_0x7e51('0x4c')]['id']){delete _0x338a0c[_0x7e51('0x4c')]['id'];}return db[_0x7e51('0x2d')][_0x7e51('0x49')]({'where':{'id':_0x338a0c[_0x7e51('0x47')]['id']}})['then'](handleEntityNotFound(_0x35710d,null))[_0x7e51('0x26')](saveUpdates(_0x338a0c['body'],null))[_0x7e51('0x26')](respondWithResult(_0x35710d,null))[_0x7e51('0x4a')](handleError(_0x35710d,null));};exports[_0x7e51('0x27')]=function(_0x236b13,_0x419cfe){return db['VtigerAccount']['find']({'where':{'id':_0x236b13[_0x7e51('0x47')]['id']}})[_0x7e51('0x26')](handleEntityNotFound(_0x419cfe,null))['then'](removeEntity(_0x419cfe,null))[_0x7e51('0x4a')](handleError(_0x419cfe,null));};exports[_0x7e51('0x4d')]=function(_0x3cd91a,_0x408291,_0x5d5ea5){var _0xef5354={};var _0x5f2981={};var _0x7f34ab;var _0x496004;return db[_0x7e51('0x2d')][_0x7e51('0x4e')]({'where':{'id':_0x3cd91a['params']['id']}})['then'](handleEntityNotFound(_0x408291,null))[_0x7e51('0x26')](function(_0x4dda02){if(_0x4dda02){_0x7f34ab=_0x4dda02;_0x5f2981[_0x7e51('0x31')]=_[_0x7e51('0x33')](db[_0x7e51('0x4f')][_0x7e51('0x48')]);_0x5f2981['query']=_[_0x7e51('0x33')](_0x3cd91a['query']);_0x5f2981[_0x7e51('0x34')]=_['intersection'](_0x5f2981['model'],_0x5f2981[_0x7e51('0x32')]);_0xef5354['attributes']=_[_0x7e51('0x35')](_0x5f2981['model'],qs[_0x7e51('0x37')](_0x3cd91a[_0x7e51('0x32')][_0x7e51('0x37')]));_0xef5354['attributes']=_0xef5354[_0x7e51('0x36')][_0x7e51('0x38')]?_0xef5354[_0x7e51('0x36')]:_0x5f2981['model'];_0xef5354[_0x7e51('0x3c')]=qs[_0x7e51('0x3d')](_0x3cd91a[_0x7e51('0x32')][_0x7e51('0x3d')]);_0xef5354[_0x7e51('0x3e')]=qs[_0x7e51('0x34')](_[_0x7e51('0x50')](_0x3cd91a[_0x7e51('0x32')],_0x5f2981['filters']));if(_0x3cd91a['query']['filter']){_0xef5354[_0x7e51('0x3e')]=_['merge'](_0xef5354[_0x7e51('0x3e')],{'$or':_[_0x7e51('0x2c')](_0xef5354[_0x7e51('0x36')],function(_0x5d9a99){var _0x4857c6={};_0x4857c6[_0x5d9a99]={'$like':'%'+_0x3cd91a['query']['filter']+'%'};return _0x4857c6;})});}_0xef5354=_[_0x7e51('0x40')]({},_0xef5354,_0x3cd91a[_0x7e51('0x42')]);return _0x7f34ab[_0x7e51('0x4d')](_0xef5354);}})[_0x7e51('0x26')](function(_0xcbd186){if(_0xcbd186){_0x496004=_0xcbd186[_0x7e51('0x38')];if(!_0x3cd91a[_0x7e51('0x32')]['hasOwnProperty'](_0x7e51('0x3a'))){_0xef5354[_0x7e51('0x3b')]=qs[_0x7e51('0x3b')](_0x3cd91a[_0x7e51('0x32')][_0x7e51('0x3b')]);_0xef5354[_0x7e51('0x1f')]=qs[_0x7e51('0x1f')](_0x3cd91a[_0x7e51('0x32')][_0x7e51('0x1f')]);}return _0x7f34ab[_0x7e51('0x4d')](_0xef5354);}})[_0x7e51('0x26')](function(_0x4861cf){if(_0x4861cf){return _0x4861cf?{'count':_0x496004,'rows':_0x4861cf}:null;}})[_0x7e51('0x26')](respondWithResult(_0x408291,null))[_0x7e51('0x4a')](handleError(_0x408291,null));};exports[_0x7e51('0x51')]=function(_0x422b30,_0x3ab85c,_0x56523e){if(_0x422b30[_0x7e51('0x4c')]['id']){delete _0x422b30['body']['id'];}return db['VtigerAccount'][_0x7e51('0x4e')]({'where':{'id':_0x422b30['params']['id']}})[_0x7e51('0x26')](handleEntityNotFound(_0x3ab85c,null))[_0x7e51('0x26')](function(_0x1f3e07){if(_0x1f3e07){_0x422b30['body'][_0x7e51('0x52')]=_0x1f3e07['id'];_0x422b30[_0x7e51('0x4c')]['Subjects']=integrations[_0x7e51('0x53')](_0x422b30['body'][_0x7e51('0x54')],_0x422b30[_0x7e51('0x4c')][_0x7e51('0x2f')]);_0x422b30[_0x7e51('0x4c')][_0x7e51('0x55')]=integrations[_0x7e51('0x56')](_0x422b30[_0x7e51('0x4c')]['channel'],_0x422b30['body'][_0x7e51('0x2f')]);return db[_0x7e51('0x4f')][_0x7e51('0x4b')](_0x422b30[_0x7e51('0x4c')],{'include':[{'model':db['VtigerField'],'as':'Subjects'},{'model':db[_0x7e51('0x57')],'as':_0x7e51('0x55')}]});}return null;})[_0x7e51('0x26')](respondWithResult(_0x3ab85c,null))[_0x7e51('0x4a')](handleError(_0x3ab85c,null));};var md5=require('md5');exports['getFields']=function(_0x4d9c40,_0x294521,_0x21e791){var _0x56ae2d=null;var _0x44add7=null;var _0x32698f=null;var _0x1a02db=null;var _0xfbaca1='';return db[_0x7e51('0x2d')][_0x7e51('0x4e')]({'where':{'id':_0x4d9c40['params']['id']},'attributes':['id',_0x7e51('0x29'),_0x7e51('0x58'),_0x7e51('0x59'),_0x7e51('0x5a'),_0x7e51('0x5b'),'serverUrl',_0x7e51('0x5c')]})[_0x7e51('0x26')](handleEntityNotFound(_0x294521,null))[_0x7e51('0x26')](function(_0x501b78){if(_0x501b78){_0x56ae2d=_0x501b78[_0x7e51('0x58')];_0x44add7=_0x501b78[_0x7e51('0x5c')];_0x32698f=_0x501b78[_0x7e51('0x5a')];_0xfbaca1=_0x501b78[_0x7e51('0x5b')];var _0x39600b=_0xfbaca1['slice'](-0x1);if(_0x39600b==='/'){_0xfbaca1=_0xfbaca1['substring'](0x0,_0xfbaca1[_0x7e51('0x5d')](_0x39600b));}_0x1a02db=util[_0x7e51('0x5e')](_0x7e51('0x5f'),_0xfbaca1);var _0x22f32c={'method':_0x7e51('0x60'),'uri':_0x1a02db,'qs':{'operation':_0x7e51('0x61'),'username':_0x501b78['username']},'json':!![]};return rp(_0x22f32c);}})[_0x7e51('0x26')](function(_0x16f91c){if(_0x16f91c['success']){var _0x4eb56e={'method':_0x7e51('0x62'),'uri':_0x1a02db,'form':{'operation':_0x7e51('0x63'),'username':_0x56ae2d,'accessKey':md5(_0x16f91c[_0x7e51('0x64')][_0x7e51('0x65')]+_0x44add7)},'json':!![]};return rp(_0x4eb56e);}})[_0x7e51('0x26')](function(_0x4fe683){if(_0x4fe683[_0x7e51('0x66')]){var _0x3bdebb={'method':_0x7e51('0x60'),'uri':_0x1a02db,'qs':{'operation':'describe','username':_0x56ae2d,'sessionName':_0x4fe683[_0x7e51('0x64')][_0x7e51('0x67')],'elementType':_0x32698f},'json':!![]};return rp(_0x3bdebb);}})['then'](function(_0x4813d6){if(_0x4813d6[_0x7e51('0x66')]){var _0x1ac56a=[_0x7e51('0x68'),_0x7e51('0x69'),_0x7e51('0x6a')];_['remove'](_0x4813d6[_0x7e51('0x64')][_0x7e51('0x37')],function(_0x2365d3){return _0x1ac56a[_0x7e51('0x6b')](_0x2365d3[_0x7e51('0x2f')][_0x7e51('0x29')]);});_[_0x7e51('0x6c')](_0x4813d6[_0x7e51('0x64')][_0x7e51('0x37')],function(_0x39cbec){return _0x39cbec['editable']===_0x7e51('0x6d');});return{'count':_0x4813d6[_0x7e51('0x64')][_0x7e51('0x37')][_0x7e51('0x38')],'rows':_[_0x7e51('0x2c')](_0x4813d6[_0x7e51('0x64')][_0x7e51('0x37')],function(_0x3aea12){return{'id':_0x3aea12[_0x7e51('0x29')],'name':_0x3aea12['label'],'custom':_[_0x7e51('0x6e')](_0x3aea12[_0x7e51('0x29')],'cf_')?!![]:![],'options':_0x3aea12[_0x7e51('0x2f')]['name']===_0x7e51('0x6f')&&_0x3aea12['type'][_0x7e51('0x70')][_0x7e51('0x38')]>0x0?_['map'](_0x3aea12[_0x7e51('0x2f')][_0x7e51('0x70')],function(_0x46b87c){return{'name':_0x46b87c[_0x7e51('0x71')],'value':_0x46b87c[_0x7e51('0x72')]};}):[]};})};}})[_0x7e51('0x26')](respondWithResult(_0x294521,null))[_0x7e51('0x4a')](function(_0x402a4a){console['log']('vTiger\x20error:\x20'+_0x402a4a);var _0x1f98b9=_0x4d9c40[_0x7e51('0x32')][_0x7e51('0x73')]?0x1f4:_0x402a4a[_0x7e51('0x74')]||0x1f4;logger[_0x7e51('0x28')](_0x7e51('0x75'),_0x7e51('0x76'),_0x1f98b9,JSON[_0x7e51('0x77')](_0x402a4a));delete _0x402a4a[_0x7e51('0x29')];if(_0x1f98b9===0x191){_0x1f98b9=0x190;}_0x294521[_0x7e51('0x1d')](_0x1f98b9)[_0x7e51('0x2a')](_0x4d9c40[_0x7e51('0x32')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x402a4a[_0x7e51('0x74')]}:_0x402a4a);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 7162b98..ee8f388 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 _0xbeb9=['../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x4af856,_0x3990fd){var _0xdb6d15=function(_0x45af83){while(--_0x45af83){_0x4af856['push'](_0x4af856['shift']());}};_0xdb6d15(++_0x3990fd);}(_0xbeb9,0x19d));var _0x9beb=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xbeb9[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x9beb('0x0'));var util=require(_0x9beb('0x1'));var logger=require(_0x9beb('0x2'))(_0x9beb('0x3'));var moment=require('moment');var BPromise=require(_0x9beb('0x4'));var rp=require(_0x9beb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9beb('0x6'));var config=require(_0x9beb('0x7'));var attributes=require(_0x9beb('0x8'));var integrations=require(_0x9beb('0x9'));module[_0x9beb('0xa')]=function(_0x47cfd2,_0x3e0eb4){return _0x47cfd2[_0x9beb('0xb')](_0x9beb('0xc'),attributes,{'tableName':_0x9beb('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x758e=['VtigerAccount','int_vtiger_accounts','lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x22a9b7,_0x58e5d4){var _0x8a8568=function(_0x271479){while(--_0x271479){_0x22a9b7['push'](_0x22a9b7['shift']());}};_0x8a8568(++_0x58e5d4);}(_0x758e,0xec));var _0xe758=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x758e[_0x618414];return _0x21c19a;};'use strict';var _=require(_0xe758('0x0'));var util=require('util');var logger=require(_0xe758('0x1'))(_0xe758('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe758('0x3'));var fs=require('fs');var path=require(_0xe758('0x4'));var rimraf=require(_0xe758('0x5'));var config=require(_0xe758('0x6'));var attributes=require(_0xe758('0x7'));var integrations=require(_0xe758('0x8'));module[_0xe758('0x9')]=function(_0x24c237,_0x45f39b){return _0x24c237[_0xe758('0xa')](_0xe758('0xb'),attributes,{'tableName':_0xe758('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 5d252d2..b6190c4 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 _0x0972=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetVtigerAccount','VtigerAccount','findAll','options','raw','attributes','limit','include','map','model','catch','find','where','ShowVtigerAccount','util','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0x1f1590,_0x37dd0){var _0x1f19fe=function(_0x267e6f){while(--_0x267e6f){_0x1f1590['push'](_0x1f1590['shift']());}};_0x1f19fe(++_0x37dd0);}(_0x0972,0x64));var _0x2097=function(_0x30617c,_0x3b3fdb){_0x30617c=_0x30617c-0x0;var _0x44d5ef=_0x0972[_0x30617c];return _0x44d5ef;};'use strict';var _=require('lodash');var util=require(_0x2097('0x0'));var moment=require('moment');var BPromise=require(_0x2097('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2097('0x2'));var db=require(_0x2097('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2097('0x4'))(_0x2097('0x5'));var config=require(_0x2097('0x6'));var jayson=require(_0x2097('0x7'));var client=jayson[_0x2097('0x8')][_0x2097('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b4f21,_0x59739f,_0x332aac){return new BPromise(function(_0x1e661a,_0x11d263){return client[_0x2097('0xa')](_0x2b4f21,_0x332aac)[_0x2097('0xb')](function(_0x59d947){logger[_0x2097('0xc')](_0x2097('0xd'),_0x59739f,_0x2097('0xe'));logger[_0x2097('0xf')](_0x2097('0x10'),_0x59739f,_0x2097('0xe'),JSON[_0x2097('0x11')](_0x59d947));if(_0x59d947[_0x2097('0x12')]){if(_0x59d947[_0x2097('0x12')][_0x2097('0x13')]===0x1f4){logger[_0x2097('0x12')](_0x2097('0xd'),_0x59739f,_0x59d947[_0x2097('0x12')][_0x2097('0x14')]);return _0x11d263(_0x59d947[_0x2097('0x12')][_0x2097('0x14')]);}logger[_0x2097('0x12')](_0x2097('0xd'),_0x59739f,_0x59d947[_0x2097('0x12')][_0x2097('0x14')]);return _0x1e661a(_0x59d947['error'][_0x2097('0x14')]);}else{logger[_0x2097('0xc')]('VtigerAccount,\x20%s,\x20%s',_0x59739f,'request\x20sent');_0x1e661a(_0x59d947['result'][_0x2097('0x14')]);}})['catch'](function(_0x28c35c){logger[_0x2097('0x12')](_0x2097('0xd'),_0x59739f,_0x28c35c);_0x11d263(_0x28c35c);});});}exports[_0x2097('0x15')]=function(_0x44c584){var _0x53e2b4=this;return new Promise(function(_0x324652,_0x140094){return db[_0x2097('0x16')][_0x2097('0x17')]({'raw':_0x44c584[_0x2097('0x18')]?_0x44c584[_0x2097('0x18')][_0x2097('0x19')]===undefined?!![]:![]:!![],'where':_0x44c584[_0x2097('0x18')]?_0x44c584['options']['where']||null:null,'attributes':_0x44c584[_0x2097('0x18')]?_0x44c584['options'][_0x2097('0x1a')]||null:null,'limit':_0x44c584[_0x2097('0x18')]?_0x44c584['options'][_0x2097('0x1b')]||null:null,'include':_0x44c584['options']?_0x44c584[_0x2097('0x18')][_0x2097('0x1c')]?_[_0x2097('0x1d')](_0x44c584[_0x2097('0x18')][_0x2097('0x1c')],function(_0x35047b){return{'model':db[_0x35047b['model']],'as':_0x35047b['as'],'attributes':_0x35047b[_0x2097('0x1a')],'include':_0x35047b['include']?_[_0x2097('0x1d')](_0x35047b[_0x2097('0x1c')],function(_0x345875){return{'model':db[_0x345875[_0x2097('0x1e')]],'as':_0x345875['as'],'attributes':_0x345875['attributes'],'include':_0x345875[_0x2097('0x1c')]?_[_0x2097('0x1d')](_0x345875['include'],function(_0x1229fc){return{'model':db[_0x1229fc['model']],'as':_0x1229fc['as'],'attributes':_0x1229fc[_0x2097('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xbc0339){logger[_0x2097('0xc')](_0x2097('0x15'),_0x44c584);logger[_0x2097('0xf')](_0x2097('0x15'),_0x44c584,JSON[_0x2097('0x11')](_0xbc0339));_0x324652(_0xbc0339);})[_0x2097('0x1f')](function(_0x4b443d){logger[_0x2097('0x12')](_0x2097('0x15'),_0x4b443d['message'],_0x44c584);_0x140094(_0x53e2b4[_0x2097('0x12')](0x1f4,_0x4b443d[_0x2097('0x14')]));});});};exports['ShowVtigerAccount']=function(_0x4d0916){var _0x312c77=this;return new Promise(function(_0x11b051,_0x1649c8){return db[_0x2097('0x16')][_0x2097('0x20')]({'raw':_0x4d0916[_0x2097('0x18')]?_0x4d0916['options'][_0x2097('0x19')]===undefined?!![]:![]:!![],'where':_0x4d0916['options']?_0x4d0916[_0x2097('0x18')][_0x2097('0x21')]||null:null,'attributes':_0x4d0916[_0x2097('0x18')]?_0x4d0916[_0x2097('0x18')][_0x2097('0x1a')]||null:null,'include':_0x4d0916[_0x2097('0x18')]?_0x4d0916[_0x2097('0x18')][_0x2097('0x1c')]?_[_0x2097('0x1d')](_0x4d0916['options'][_0x2097('0x1c')],function(_0x40baed){return{'model':db[_0x40baed[_0x2097('0x1e')]],'as':_0x40baed['as'],'attributes':_0x40baed['attributes'],'include':_0x40baed[_0x2097('0x1c')]?_[_0x2097('0x1d')](_0x40baed[_0x2097('0x1c')],function(_0x396162){return{'model':db[_0x396162['model']],'as':_0x396162['as'],'attributes':_0x396162['attributes'],'include':_0x396162['include']?_[_0x2097('0x1d')](_0x396162[_0x2097('0x1c')],function(_0x4123b7){return{'model':db[_0x4123b7[_0x2097('0x1e')]],'as':_0x4123b7['as'],'attributes':_0x4123b7[_0x2097('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2097('0xb')](function(_0x49b724){logger[_0x2097('0xc')](_0x2097('0x22'),_0x4d0916);logger[_0x2097('0xf')](_0x2097('0x22'),_0x4d0916,JSON[_0x2097('0x11')](_0x49b724));_0x11b051(_0x49b724);})[_0x2097('0x1f')](function(_0x52b937){logger[_0x2097('0x12')](_0x2097('0x22'),_0x52b937[_0x2097('0x14')],_0x4d0916);_0x1649c8(_0x312c77['error'](0x1f4,_0x52b937['message']));});});}; \ No newline at end of file +var _0x13f6=['debug','stringify','error','code','message','info','result','GetVtigerAccount','VtigerAccount','findAll','options','limit','include','map','model','attributes','ShowVtigerAccount','find','raw','where','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','VtigerAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x2264b7,_0x5a3536){var _0x22680e=function(_0x466520){while(--_0x466520){_0x2264b7['push'](_0x2264b7['shift']());}};_0x22680e(++_0x5a3536);}(_0x13f6,0x124));var _0x613f=function(_0x12ee31,_0x4fb176){_0x12ee31=_0x12ee31-0x0;var _0x5ede94=_0x13f6[_0x12ee31];return _0x5ede94;};'use strict';var _=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x613f('0x2'));var fs=require('fs');var Redis=require(_0x613f('0x3'));var db=require(_0x613f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x613f('0x5'))(_0x613f('0x6'));var config=require(_0x613f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x613f('0x8')][_0x613f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5618fa,_0x4b546b,_0x5a84f2){return new BPromise(function(_0x5c93c0,_0x2d5973){return client[_0x613f('0xa')](_0x5618fa,_0x5a84f2)[_0x613f('0xb')](function(_0x35b672){logger['info'](_0x613f('0xc'),_0x4b546b,_0x613f('0xd'));logger[_0x613f('0xe')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x4b546b,_0x613f('0xd'),JSON[_0x613f('0xf')](_0x35b672));if(_0x35b672[_0x613f('0x10')]){if(_0x35b672['error'][_0x613f('0x11')]===0x1f4){logger[_0x613f('0x10')]('VtigerAccount,\x20%s,\x20%s',_0x4b546b,_0x35b672['error']['message']);return _0x2d5973(_0x35b672[_0x613f('0x10')][_0x613f('0x12')]);}logger[_0x613f('0x10')](_0x613f('0xc'),_0x4b546b,_0x35b672[_0x613f('0x10')][_0x613f('0x12')]);return _0x5c93c0(_0x35b672[_0x613f('0x10')][_0x613f('0x12')]);}else{logger[_0x613f('0x13')](_0x613f('0xc'),_0x4b546b,'request\x20sent');_0x5c93c0(_0x35b672[_0x613f('0x14')]['message']);}})['catch'](function(_0x1bc605){logger[_0x613f('0x10')]('VtigerAccount,\x20%s,\x20%s',_0x4b546b,_0x1bc605);_0x2d5973(_0x1bc605);});});}exports[_0x613f('0x15')]=function(_0x4f9dae){var _0x62ebfe=this;return new Promise(function(_0x1e5a11,_0x431266){return db[_0x613f('0x16')][_0x613f('0x17')]({'raw':_0x4f9dae[_0x613f('0x18')]?_0x4f9dae['options']['raw']===undefined?!![]:![]:!![],'where':_0x4f9dae[_0x613f('0x18')]?_0x4f9dae['options']['where']||null:null,'attributes':_0x4f9dae[_0x613f('0x18')]?_0x4f9dae[_0x613f('0x18')]['attributes']||null:null,'limit':_0x4f9dae[_0x613f('0x18')]?_0x4f9dae[_0x613f('0x18')][_0x613f('0x19')]||null:null,'include':_0x4f9dae['options']?_0x4f9dae['options'][_0x613f('0x1a')]?_[_0x613f('0x1b')](_0x4f9dae[_0x613f('0x18')]['include'],function(_0x41104e){return{'model':db[_0x41104e[_0x613f('0x1c')]],'as':_0x41104e['as'],'attributes':_0x41104e[_0x613f('0x1d')],'include':_0x41104e[_0x613f('0x1a')]?_[_0x613f('0x1b')](_0x41104e['include'],function(_0x30fb15){return{'model':db[_0x30fb15[_0x613f('0x1c')]],'as':_0x30fb15['as'],'attributes':_0x30fb15['attributes'],'include':_0x30fb15[_0x613f('0x1a')]?_[_0x613f('0x1b')](_0x30fb15[_0x613f('0x1a')],function(_0x4a878d){return{'model':db[_0x4a878d['model']],'as':_0x4a878d['as'],'attributes':_0x4a878d['attributes']};}):[]};}):[]};}):[]:[]})[_0x613f('0xb')](function(_0x594c28){logger[_0x613f('0x13')](_0x613f('0x15'),_0x4f9dae);logger['debug'](_0x613f('0x15'),_0x4f9dae,JSON[_0x613f('0xf')](_0x594c28));_0x1e5a11(_0x594c28);})['catch'](function(_0x4cff5d){logger['error'](_0x613f('0x15'),_0x4cff5d[_0x613f('0x12')],_0x4f9dae);_0x431266(_0x62ebfe[_0x613f('0x10')](0x1f4,_0x4cff5d['message']));});});};exports[_0x613f('0x1e')]=function(_0x439478){var _0xd335a6=this;return new Promise(function(_0x19bb8f,_0x4f8500){return db[_0x613f('0x16')][_0x613f('0x1f')]({'raw':_0x439478[_0x613f('0x18')]?_0x439478[_0x613f('0x18')][_0x613f('0x20')]===undefined?!![]:![]:!![],'where':_0x439478[_0x613f('0x18')]?_0x439478['options'][_0x613f('0x21')]||null:null,'attributes':_0x439478[_0x613f('0x18')]?_0x439478[_0x613f('0x18')]['attributes']||null:null,'include':_0x439478[_0x613f('0x18')]?_0x439478['options'][_0x613f('0x1a')]?_[_0x613f('0x1b')](_0x439478[_0x613f('0x18')][_0x613f('0x1a')],function(_0x2bceaa){return{'model':db[_0x2bceaa[_0x613f('0x1c')]],'as':_0x2bceaa['as'],'attributes':_0x2bceaa['attributes'],'include':_0x2bceaa[_0x613f('0x1a')]?_[_0x613f('0x1b')](_0x2bceaa[_0x613f('0x1a')],function(_0x25b2e4){return{'model':db[_0x25b2e4[_0x613f('0x1c')]],'as':_0x25b2e4['as'],'attributes':_0x25b2e4['attributes'],'include':_0x25b2e4['include']?_['map'](_0x25b2e4[_0x613f('0x1a')],function(_0x72c804){return{'model':db[_0x72c804[_0x613f('0x1c')]],'as':_0x72c804['as'],'attributes':_0x72c804[_0x613f('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fc02e){logger[_0x613f('0x13')]('ShowVtigerAccount',_0x439478);logger[_0x613f('0xe')]('ShowVtigerAccount',_0x439478,JSON[_0x613f('0xf')](_0x2fc02e));_0x19bb8f(_0x2fc02e);})['catch'](function(_0x36dfd4){logger['error'](_0x613f('0x1e'),_0x36dfd4[_0x613f('0x12')],_0x439478);_0x4f8500(_0xd335a6[_0x613f('0x10')](0x1f4,_0x36dfd4['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index bc824ed..df11fc7 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 _0x4d39=['fs-extra','../../components/interaction/service','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','getDescriptions','post','create','put','delete','destroy','exports','path','connect-timeout'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x4d39,0xb2));var _0x94d3=function(_0x17b3d2,_0x4507a4){_0x17b3d2=_0x17b3d2-0x0;var _0x285ddf=_0x4d39[_0x17b3d2];return _0x285ddf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x94d3('0x0'));var timeout=require(_0x94d3('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x94d3('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x94d3('0x3'));var config=require('../../config/environment');var controller=require('./intVtigerConfiguration.controller');router[_0x94d3('0x4')]('/',auth[_0x94d3('0x5')](),controller[_0x94d3('0x6')]);router['get'](_0x94d3('0x7'),auth[_0x94d3('0x5')](),controller['show']);router['get'](_0x94d3('0x8'),auth['isAuthenticated'](),controller[_0x94d3('0x9')]);router[_0x94d3('0x4')](_0x94d3('0xa'),auth[_0x94d3('0x5')](),controller['getSubjects']);router[_0x94d3('0x4')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x94d3('0xb')]);router[_0x94d3('0xc')]('/',auth['isAuthenticated'](),controller[_0x94d3('0xd')]);router[_0x94d3('0xe')](_0x94d3('0x7'),auth['isAuthenticated'](),controller['update']);router[_0x94d3('0xf')](_0x94d3('0x7'),auth[_0x94d3('0x5')](),controller[_0x94d3('0x10')]);module[_0x94d3('0x11')]=router; \ No newline at end of file +var _0x9e80=['update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put'];(function(_0x22162f,_0xd4f930){var _0x4b8403=function(_0x3953e4){while(--_0x3953e4){_0x22162f['push'](_0x22162f['shift']());}};_0x4b8403(++_0xd4f930);}(_0x9e80,0x17d));var _0x09e8=function(_0xe13bd6,_0x33869a){_0xe13bd6=_0xe13bd6-0x0;var _0x409eda=_0x9e80[_0xe13bd6];return _0x409eda;};'use strict';var multer=require(_0x09e8('0x0'));var util=require('util');var path=require(_0x09e8('0x1'));var timeout=require('connect-timeout');var express=require(_0x09e8('0x2'));var router=express[_0x09e8('0x3')]();var fs_extra=require(_0x09e8('0x4'));var auth=require(_0x09e8('0x5'));var interaction=require(_0x09e8('0x6'));var config=require(_0x09e8('0x7'));var controller=require('./intVtigerConfiguration.controller');router[_0x09e8('0x8')]('/',auth[_0x09e8('0x9')](),controller['index']);router[_0x09e8('0x8')](_0x09e8('0xa'),auth[_0x09e8('0x9')](),controller['show']);router[_0x09e8('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0x09e8('0xb')]);router['get'](_0x09e8('0xc'),auth['isAuthenticated'](),controller[_0x09e8('0xd')]);router[_0x09e8('0x8')](_0x09e8('0xe'),auth[_0x09e8('0x9')](),controller[_0x09e8('0xf')]);router[_0x09e8('0x10')]('/',auth[_0x09e8('0x9')](),controller['create']);router[_0x09e8('0x11')](_0x09e8('0xa'),auth['isAuthenticated'](),controller[_0x09e8('0x12')]);router['delete'](_0x09e8('0xa'),auth[_0x09e8('0x9')](),controller[_0x09e8('0x13')]);module[_0x09e8('0x14')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index af3eb52..7e6c2f1 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 _0xf7cd=['exports','STRING','sequelize'];(function(_0x54b062,_0x264bb5){var _0x255e41=function(_0x3c7e6f){while(--_0x3c7e6f){_0x54b062['push'](_0x54b062['shift']());}};_0x255e41(++_0x264bb5);}(_0xf7cd,0x122));var _0xdf7c=function(_0x4a0c50,_0x57e9a1){_0x4a0c50=_0x4a0c50-0x0;var _0x5b8b5a=_0xf7cd[_0x4a0c50];return _0x5b8b5a;};'use strict';var Sequelize=require(_0xdf7c('0x0'));module[_0xdf7c('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xdf7c('0x2')]}}; \ No newline at end of file +var _0x5ffb=['sequelize','exports','STRING'];(function(_0x497d7c,_0x376f95){var _0x9a970e=function(_0x386d64){while(--_0x386d64){_0x497d7c['push'](_0x497d7c['shift']());}};_0x9a970e(++_0x376f95);}(_0x5ffb,0xd5));var _0xb5ff=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x5ffb[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0xb5ff('0x0'));module[_0xb5ff('0x1')]={'name':{'type':Sequelize[_0xb5ff('0x2')]},'description':{'type':Sequelize[_0xb5ff('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index e13a709..587eb76 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 _0x357b=['hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','getFields','findOne','filter','getSubjects','VtigerField','getDescriptions','eml-format','rimraf','fast-json-patch','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','keys','intersection','query','fields','attributes'];(function(_0xdd5b46,_0x1ee134){var _0xbd60bc=function(_0x461687){while(--_0x461687){_0xdd5b46['push'](_0xdd5b46['shift']());}};_0xbd60bc(++_0x1ee134);}(_0x357b,0x164));var _0xb357=function(_0x4872a8,_0x51271a){_0x4872a8=_0x4872a8-0x0;var _0x5a435c=_0x357b[_0x4872a8];return _0x5a435c;};'use strict';var emlformat=require(_0xb357('0x0'));var rimraf=require(_0xb357('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb357('0x2'));var rp=require('request-promise');var moment=require(_0xb357('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb357('0x4'));var util=require('util');var path=require(_0xb357('0x5'));var sox=require(_0xb357('0x6'));var csv=require('to-csv');var ejs=require(_0xb357('0x7'));var fs=require('fs');var fs_extra=require(_0xb357('0x8'));var _=require(_0xb357('0x9'));var squel=require(_0xb357('0xa'));var crypto=require('crypto');var jsforce=require(_0xb357('0xb'));var deskjs=require(_0xb357('0xc'));var toCsv=require(_0xb357('0xd'));var querystring=require(_0xb357('0xe'));var Papa=require(_0xb357('0xf'));var Redis=require(_0xb357('0x10'));var authService=require(_0xb357('0x11'));var qs=require(_0xb357('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb357('0x13'));var logger=require('../../config/logger')(_0xb357('0x14'));var utils=require('../../config/utils');var config=require(_0xb357('0x15'));var licenseUtil=require(_0xb357('0x16'));var db=require(_0xb357('0x17'))['db'];function respondWithStatusCode(_0x9fe438,_0x22107a){_0x22107a=_0x22107a||0xcc;return function(_0xd3c7bc){if(_0xd3c7bc){return _0x9fe438[_0xb357('0x18')](_0x22107a);}return _0x9fe438['status'](_0x22107a)[_0xb357('0x19')]();};}function respondWithResult(_0x48d388,_0x4214d5){_0x4214d5=_0x4214d5||0xc8;return function(_0x357474){if(_0x357474){return _0x48d388[_0xb357('0x1a')](_0x4214d5)[_0xb357('0x1b')](_0x357474);}};}function respondWithFilteredResult(_0x4f5fec,_0x2ea922){return function(_0x2ed5c7){if(_0x2ed5c7){var _0x3159ca=typeof _0x2ea922[_0xb357('0x1c')]===_0xb357('0x1d')&&typeof _0x2ea922['limit']==='undefined';var _0x47da91=_0x2ed5c7[_0xb357('0x1e')];var _0x2f1536=_0x3159ca?0x0:_0x2ea922[_0xb357('0x1c')];var _0x4a0201=_0x3159ca?_0x2ed5c7[_0xb357('0x1e')]:_0x2ea922[_0xb357('0x1c')]+_0x2ea922['limit'];var _0x36c3f5;if(_0x4a0201>=_0x47da91){_0x4a0201=_0x47da91;_0x36c3f5=0xc8;}else{_0x36c3f5=0xce;}_0x4f5fec[_0xb357('0x1a')](_0x36c3f5);return _0x4f5fec[_0xb357('0x1f')](_0xb357('0x20'),_0x2f1536+'-'+_0x4a0201+'/'+_0x47da91)[_0xb357('0x1b')](_0x2ed5c7);}return null;};}function patchUpdates(_0x2e15e5){return function(_0x18b8aa){try{jsonpatch[_0xb357('0x21')](_0x18b8aa,_0x2e15e5,!![]);}catch(_0x301c1e){return BPromise['reject'](_0x301c1e);}return _0x18b8aa[_0xb357('0x22')]();};}function saveUpdates(_0x23c16d,_0x50a80e){return function(_0x17adde){if(_0x17adde){return _0x17adde[_0xb357('0x23')](_0x23c16d)[_0xb357('0x24')](function(_0x486762){return _0x486762;});}return null;};}function removeEntity(_0x974d00,_0x5072da){return function(_0x3d45e7){if(_0x3d45e7){return _0x3d45e7[_0xb357('0x25')]()['then'](function(){_0x974d00[_0xb357('0x1a')](0xcc)[_0xb357('0x19')]();});}};}function handleEntityNotFound(_0x377be2,_0x1cb70a){return function(_0x4fc13b){if(!_0x4fc13b){_0x377be2[_0xb357('0x18')](0x194);}return _0x4fc13b;};}function handleError(_0x313b13,_0x3dd495){_0x3dd495=_0x3dd495||0x1f4;return function(_0x3d2ae3){logger[_0xb357('0x26')](_0x3d2ae3['stack']);if(_0x3d2ae3['name']){delete _0x3d2ae3[_0xb357('0x27')];}_0x313b13[_0xb357('0x1a')](_0x3dd495)[_0xb357('0x28')](_0x3d2ae3);};}exports[_0xb357('0x29')]=function(_0x1cc5d5,_0x5b5a4c){var _0x249edd={},_0xca613a={},_0x86bb44={'count':0x0,'rows':[]};var _0x1ac6a4=_[_0xb357('0x2a')](db[_0xb357('0x2b')][_0xb357('0x2c')],function(_0x2ca1d7){return{'name':_0x2ca1d7[_0xb357('0x2d')],'type':_0x2ca1d7[_0xb357('0x2e')][_0xb357('0x2f')]};});_0xca613a[_0xb357('0x30')]=_[_0xb357('0x2a')](_0x1ac6a4,_0xb357('0x27'));_0xca613a['query']=_[_0xb357('0x31')](_0x1cc5d5['query']);_0xca613a['filters']=_[_0xb357('0x32')](_0xca613a['model'],_0xca613a[_0xb357('0x33')]);_0x249edd['attributes']=_['intersection'](_0xca613a['model'],qs[_0xb357('0x34')](_0x1cc5d5[_0xb357('0x33')][_0xb357('0x34')]));_0x249edd[_0xb357('0x35')]=_0x249edd['attributes']['length']?_0x249edd[_0xb357('0x35')]:_0xca613a[_0xb357('0x30')];if(!_0x1cc5d5[_0xb357('0x33')][_0xb357('0x36')](_0xb357('0x37'))){_0x249edd[_0xb357('0x38')]=qs['limit'](_0x1cc5d5[_0xb357('0x33')][_0xb357('0x38')]);_0x249edd[_0xb357('0x1c')]=qs[_0xb357('0x1c')](_0x1cc5d5[_0xb357('0x33')][_0xb357('0x1c')]);}_0x249edd[_0xb357('0x39')]=qs[_0xb357('0x3a')](_0x1cc5d5[_0xb357('0x33')][_0xb357('0x3a')]);_0x249edd[_0xb357('0x3b')]=qs[_0xb357('0x3c')](_[_0xb357('0x3d')](_0x1cc5d5[_0xb357('0x33')],_0xca613a[_0xb357('0x3c')]),_0x1ac6a4);if(_0x1cc5d5[_0xb357('0x33')]['filter']){_0x249edd[_0xb357('0x3b')]=_[_0xb357('0x3e')](_0x249edd[_0xb357('0x3b')],{'$or':_['map'](_0x1ac6a4,function(_0x3b35cf){if(_0x3b35cf[_0xb357('0x2e')]!==_0xb357('0x3f')){var _0x44cef9={};_0x44cef9[_0x3b35cf[_0xb357('0x27')]]={'$like':'%'+_0x1cc5d5['query']['filter']+'%'};return _0x44cef9;}})});}_0x249edd=_['merge']({},_0x249edd,_0x1cc5d5[_0xb357('0x40')]);var _0x16cfe6={'where':_0x249edd['where']};return db[_0xb357('0x2b')][_0xb357('0x1e')](_0x16cfe6)[_0xb357('0x24')](function(_0x4098ac){_0x86bb44['count']=_0x4098ac;if(_0x1cc5d5[_0xb357('0x33')][_0xb357('0x41')]){_0x249edd[_0xb357('0x42')]=[{'all':!![]}];}return db[_0xb357('0x2b')][_0xb357('0x43')](_0x249edd);})['then'](function(_0x37d509){_0x86bb44[_0xb357('0x44')]=_0x37d509;return _0x86bb44;})[_0xb357('0x24')](respondWithFilteredResult(_0x5b5a4c,_0x249edd))[_0xb357('0x45')](handleError(_0x5b5a4c,null));};exports[_0xb357('0x46')]=function(_0x5c717a,_0x431215){var _0x1ab3c9={'raw':![],'where':{'id':_0x5c717a[_0xb357('0x47')]['id']}},_0x7b1b13={};_0x7b1b13[_0xb357('0x30')]=_[_0xb357('0x31')](db[_0xb357('0x2b')][_0xb357('0x2c')]);_0x7b1b13[_0xb357('0x33')]=_[_0xb357('0x31')](_0x5c717a[_0xb357('0x33')]);_0x7b1b13[_0xb357('0x3c')]=_[_0xb357('0x32')](_0x7b1b13['model'],_0x7b1b13[_0xb357('0x33')]);_0x1ab3c9[_0xb357('0x35')]=_['intersection'](_0x7b1b13[_0xb357('0x30')],qs[_0xb357('0x34')](_0x5c717a[_0xb357('0x33')][_0xb357('0x34')]));_0x1ab3c9[_0xb357('0x35')]=_0x1ab3c9[_0xb357('0x35')][_0xb357('0x48')]?_0x1ab3c9[_0xb357('0x35')]:_0x7b1b13[_0xb357('0x30')];if(_0x5c717a[_0xb357('0x33')][_0xb357('0x41')]){_0x1ab3c9[_0xb357('0x42')]=[{'all':!![]}];}_0x1ab3c9=_['merge']({},_0x1ab3c9,_0x5c717a[_0xb357('0x40')]);return db[_0xb357('0x2b')][_0xb357('0x49')](_0x1ab3c9)[_0xb357('0x24')](handleEntityNotFound(_0x431215,null))[_0xb357('0x24')](respondWithResult(_0x431215,null))[_0xb357('0x45')](handleError(_0x431215,null));};exports['create']=function(_0x1de398,_0x5050c9){return db['VtigerConfiguration'][_0xb357('0x4a')](_0x1de398[_0xb357('0x4b')],{})['then'](respondWithResult(_0x5050c9,0xc9))[_0xb357('0x45')](handleError(_0x5050c9,null));};exports[_0xb357('0x23')]=function(_0x5f56c8,_0x5d10e2){if(_0x5f56c8['body']['id']){delete _0x5f56c8[_0xb357('0x4b')]['id'];}return db[_0xb357('0x2b')][_0xb357('0x49')]({'where':{'id':_0x5f56c8[_0xb357('0x47')]['id']}})[_0xb357('0x24')](handleEntityNotFound(_0x5d10e2,null))[_0xb357('0x24')](saveUpdates(_0x5f56c8[_0xb357('0x4b')],null))[_0xb357('0x24')](respondWithResult(_0x5d10e2,null))[_0xb357('0x45')](handleError(_0x5d10e2,null));};exports['destroy']=function(_0xa05bde,_0x1135fd){return db[_0xb357('0x2b')][_0xb357('0x49')]({'where':{'id':_0xa05bde[_0xb357('0x47')]['id']}})[_0xb357('0x24')](handleEntityNotFound(_0x1135fd,null))['then'](removeEntity(_0x1135fd,null))[_0xb357('0x45')](handleError(_0x1135fd,null));};exports[_0xb357('0x4c')]=function(_0x551c0b,_0x520ea4,_0x322f5a){var _0x5a78c6={};var _0x392c9a={};var _0x9f5c86;var _0x26397b;return db[_0xb357('0x2b')][_0xb357('0x4d')]({'where':{'id':_0x551c0b[_0xb357('0x47')]['id']}})['then'](handleEntityNotFound(_0x520ea4,null))[_0xb357('0x24')](function(_0x51ec22){if(_0x51ec22){_0x9f5c86=_0x51ec22;_0x392c9a['model']=_[_0xb357('0x31')](db['VtigerField'][_0xb357('0x2c')]);_0x392c9a[_0xb357('0x33')]=_['keys'](_0x551c0b['query']);_0x392c9a[_0xb357('0x3c')]=_[_0xb357('0x32')](_0x392c9a[_0xb357('0x30')],_0x392c9a[_0xb357('0x33')]);_0x5a78c6[_0xb357('0x35')]=_[_0xb357('0x32')](_0x392c9a[_0xb357('0x30')],qs[_0xb357('0x34')](_0x551c0b[_0xb357('0x33')]['fields']));_0x5a78c6[_0xb357('0x35')]=_0x5a78c6[_0xb357('0x35')][_0xb357('0x48')]?_0x5a78c6['attributes']:_0x392c9a[_0xb357('0x30')];_0x5a78c6[_0xb357('0x39')]=qs[_0xb357('0x3a')](_0x551c0b[_0xb357('0x33')]['sort']);_0x5a78c6[_0xb357('0x3b')]=qs[_0xb357('0x3c')](_[_0xb357('0x3d')](_0x551c0b['query'],_0x392c9a[_0xb357('0x3c')]));if(_0x551c0b[_0xb357('0x33')][_0xb357('0x4e')]){_0x5a78c6[_0xb357('0x3b')]=_[_0xb357('0x3e')](_0x5a78c6['where'],{'$or':_[_0xb357('0x2a')](_0x5a78c6[_0xb357('0x35')],function(_0x488ffa){var _0x76b10f={};_0x76b10f[_0x488ffa]={'$like':'%'+_0x551c0b[_0xb357('0x33')][_0xb357('0x4e')]+'%'};return _0x76b10f;})});}_0x5a78c6=_[_0xb357('0x3e')]({},_0x5a78c6,_0x551c0b[_0xb357('0x40')]);return _0x9f5c86[_0xb357('0x4c')](_0x5a78c6);}})[_0xb357('0x24')](function(_0x14acbe){if(_0x14acbe){_0x26397b=_0x14acbe[_0xb357('0x48')];if(!_0x551c0b['query']['hasOwnProperty'](_0xb357('0x37'))){_0x5a78c6[_0xb357('0x38')]=qs['limit'](_0x551c0b[_0xb357('0x33')][_0xb357('0x38')]);_0x5a78c6[_0xb357('0x1c')]=qs[_0xb357('0x1c')](_0x551c0b['query'][_0xb357('0x1c')]);}return _0x9f5c86[_0xb357('0x4c')](_0x5a78c6);}})[_0xb357('0x24')](function(_0x378a83){if(_0x378a83){return _0x378a83?{'count':_0x26397b,'rows':_0x378a83}:null;}})[_0xb357('0x24')](respondWithResult(_0x520ea4,null))[_0xb357('0x45')](handleError(_0x520ea4,null));};exports[_0xb357('0x4f')]=function(_0x14818d,_0x26098d,_0x184bf1){var _0xb2ff57={};var _0x31e9e6={};var _0x46561f;var _0x4a2cce;return db[_0xb357('0x2b')][_0xb357('0x4d')]({'where':{'id':_0x14818d['params']['id']}})[_0xb357('0x24')](handleEntityNotFound(_0x26098d,null))[_0xb357('0x24')](function(_0x17fce4){if(_0x17fce4){_0x46561f=_0x17fce4;_0x31e9e6[_0xb357('0x30')]=_[_0xb357('0x31')](db[_0xb357('0x50')][_0xb357('0x2c')]);_0x31e9e6[_0xb357('0x33')]=_[_0xb357('0x31')](_0x14818d[_0xb357('0x33')]);_0x31e9e6[_0xb357('0x3c')]=_['intersection'](_0x31e9e6[_0xb357('0x30')],_0x31e9e6[_0xb357('0x33')]);_0xb2ff57[_0xb357('0x35')]=_[_0xb357('0x32')](_0x31e9e6[_0xb357('0x30')],qs['fields'](_0x14818d['query']['fields']));_0xb2ff57['attributes']=_0xb2ff57[_0xb357('0x35')][_0xb357('0x48')]?_0xb2ff57[_0xb357('0x35')]:_0x31e9e6[_0xb357('0x30')];_0xb2ff57[_0xb357('0x39')]=qs[_0xb357('0x3a')](_0x14818d[_0xb357('0x33')][_0xb357('0x3a')]);_0xb2ff57[_0xb357('0x3b')]=qs['filters'](_[_0xb357('0x3d')](_0x14818d[_0xb357('0x33')],_0x31e9e6[_0xb357('0x3c')]));if(_0x14818d[_0xb357('0x33')][_0xb357('0x4e')]){_0xb2ff57['where']=_['merge'](_0xb2ff57[_0xb357('0x3b')],{'$or':_[_0xb357('0x2a')](_0xb2ff57['attributes'],function(_0x8f2d37){var _0x123f08={};_0x123f08[_0x8f2d37]={'$like':'%'+_0x14818d['query']['filter']+'%'};return _0x123f08;})});}_0xb2ff57=_[_0xb357('0x3e')]({},_0xb2ff57,_0x14818d[_0xb357('0x40')]);return _0x46561f[_0xb357('0x4f')](_0xb2ff57);}})[_0xb357('0x24')](function(_0x15e045){if(_0x15e045){_0x4a2cce=_0x15e045['length'];if(!_0x14818d[_0xb357('0x33')][_0xb357('0x36')](_0xb357('0x37'))){_0xb2ff57[_0xb357('0x38')]=qs[_0xb357('0x38')](_0x14818d[_0xb357('0x33')][_0xb357('0x38')]);_0xb2ff57[_0xb357('0x1c')]=qs['offset'](_0x14818d[_0xb357('0x33')][_0xb357('0x1c')]);}return _0x46561f[_0xb357('0x4f')](_0xb2ff57);}})[_0xb357('0x24')](function(_0x15a6ce){if(_0x15a6ce){return _0x15a6ce?{'count':_0x4a2cce,'rows':_0x15a6ce}:null;}})[_0xb357('0x24')](respondWithResult(_0x26098d,null))[_0xb357('0x45')](handleError(_0x26098d,null));};exports['getDescriptions']=function(_0x2f9960,_0x4969aa,_0x3e8d45){var _0x30b351={};var _0xc3e09e={};var _0x1c956f;var _0x578bec;return db['VtigerConfiguration'][_0xb357('0x4d')]({'where':{'id':_0x2f9960[_0xb357('0x47')]['id']}})[_0xb357('0x24')](handleEntityNotFound(_0x4969aa,null))[_0xb357('0x24')](function(_0xfa3717){if(_0xfa3717){_0x1c956f=_0xfa3717;_0xc3e09e[_0xb357('0x30')]=_[_0xb357('0x31')](db['VtigerField'][_0xb357('0x2c')]);_0xc3e09e[_0xb357('0x33')]=_['keys'](_0x2f9960[_0xb357('0x33')]);_0xc3e09e[_0xb357('0x3c')]=_[_0xb357('0x32')](_0xc3e09e[_0xb357('0x30')],_0xc3e09e[_0xb357('0x33')]);_0x30b351[_0xb357('0x35')]=_[_0xb357('0x32')](_0xc3e09e['model'],qs[_0xb357('0x34')](_0x2f9960[_0xb357('0x33')][_0xb357('0x34')]));_0x30b351['attributes']=_0x30b351[_0xb357('0x35')][_0xb357('0x48')]?_0x30b351[_0xb357('0x35')]:_0xc3e09e[_0xb357('0x30')];_0x30b351[_0xb357('0x39')]=qs['sort'](_0x2f9960[_0xb357('0x33')][_0xb357('0x3a')]);_0x30b351['where']=qs[_0xb357('0x3c')](_['pick'](_0x2f9960[_0xb357('0x33')],_0xc3e09e[_0xb357('0x3c')]));if(_0x2f9960[_0xb357('0x33')][_0xb357('0x4e')]){_0x30b351[_0xb357('0x3b')]=_['merge'](_0x30b351[_0xb357('0x3b')],{'$or':_['map'](_0x30b351[_0xb357('0x35')],function(_0x427cc5){var _0x2778f4={};_0x2778f4[_0x427cc5]={'$like':'%'+_0x2f9960[_0xb357('0x33')][_0xb357('0x4e')]+'%'};return _0x2778f4;})});}_0x30b351=_[_0xb357('0x3e')]({},_0x30b351,_0x2f9960[_0xb357('0x40')]);return _0x1c956f['getDescriptions'](_0x30b351);}})[_0xb357('0x24')](function(_0x25567d){if(_0x25567d){_0x578bec=_0x25567d[_0xb357('0x48')];if(!_0x2f9960[_0xb357('0x33')][_0xb357('0x36')](_0xb357('0x37'))){_0x30b351[_0xb357('0x38')]=qs['limit'](_0x2f9960[_0xb357('0x33')][_0xb357('0x38')]);_0x30b351[_0xb357('0x1c')]=qs['offset'](_0x2f9960['query'][_0xb357('0x1c')]);}return _0x1c956f[_0xb357('0x51')](_0x30b351);}})[_0xb357('0x24')](function(_0xaf115a){if(_0xaf115a){return _0xaf115a?{'count':_0x578bec,'rows':_0xaf115a}:null;}})[_0xb357('0x24')](respondWithResult(_0x4969aa,null))[_0xb357('0x45')](handleError(_0x4969aa,null));}; \ No newline at end of file +var _0x06e5=['name','index','VtigerConfiguration','rawAttributes','fieldName','type','map','keys','query','filters','model','intersection','fields','attributes','length','sort','where','merge','filter','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','destroy','getFields','findOne','VtigerField','order','pick','hasOwnProperty','nolimit','getSubjects','getDescriptions','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','end','error','stack'];(function(_0x41f31b,_0x5e999e){var _0x12cfa7=function(_0x462eb3){while(--_0x462eb3){_0x41f31b['push'](_0x41f31b['shift']());}};_0x12cfa7(++_0x5e999e);}(_0x06e5,0xc6));var _0x506e=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x06e5[_0x273c39];return _0x46d6b5;};'use strict';var emlformat=require(_0x506e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x506e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x506e('0x2'));var moment=require(_0x506e('0x3'));var BPromise=require(_0x506e('0x4'));var Mustache=require(_0x506e('0x5'));var util=require(_0x506e('0x6'));var path=require(_0x506e('0x7'));var sox=require(_0x506e('0x8'));var csv=require(_0x506e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x506e('0xa'));var _=require(_0x506e('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x506e('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x506e('0xd'));var Papa=require(_0x506e('0xe'));var Redis=require(_0x506e('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x506e('0x10'));var as=require(_0x506e('0x11'));var hardwareService=require(_0x506e('0x12'));var logger=require('../../config/logger')(_0x506e('0x13'));var utils=require(_0x506e('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x506e('0x15'));var db=require(_0x506e('0x16'))['db'];function respondWithStatusCode(_0x3978b3,_0x4f098b){_0x4f098b=_0x4f098b||0xcc;return function(_0x36d426){if(_0x36d426){return _0x3978b3[_0x506e('0x17')](_0x4f098b);}return _0x3978b3[_0x506e('0x18')](_0x4f098b)['end']();};}function respondWithResult(_0x3e72bb,_0x5ab8a9){_0x5ab8a9=_0x5ab8a9||0xc8;return function(_0x22887c){if(_0x22887c){return _0x3e72bb[_0x506e('0x18')](_0x5ab8a9)[_0x506e('0x19')](_0x22887c);}};}function respondWithFilteredResult(_0x24c113,_0x179c76){return function(_0x2439d6){if(_0x2439d6){var _0x208f75=typeof _0x179c76[_0x506e('0x1a')]===_0x506e('0x1b')&&typeof _0x179c76[_0x506e('0x1c')]===_0x506e('0x1b');var _0xa361fb=_0x2439d6[_0x506e('0x1d')];var _0x28eeeb=_0x208f75?0x0:_0x179c76[_0x506e('0x1a')];var _0x3d57d7=_0x208f75?_0x2439d6[_0x506e('0x1d')]:_0x179c76[_0x506e('0x1a')]+_0x179c76[_0x506e('0x1c')];var _0x1646bf;if(_0x3d57d7>=_0xa361fb){_0x3d57d7=_0xa361fb;_0x1646bf=0xc8;}else{_0x1646bf=0xce;}_0x24c113[_0x506e('0x18')](_0x1646bf);return _0x24c113['set'](_0x506e('0x1e'),_0x28eeeb+'-'+_0x3d57d7+'/'+_0xa361fb)[_0x506e('0x19')](_0x2439d6);}return null;};}function patchUpdates(_0x309449){return function(_0x159291){try{jsonpatch[_0x506e('0x1f')](_0x159291,_0x309449,!![]);}catch(_0x444dd0){return BPromise[_0x506e('0x20')](_0x444dd0);}return _0x159291[_0x506e('0x21')]();};}function saveUpdates(_0x996ba8,_0x4d79b7){return function(_0x525ef3){if(_0x525ef3){return _0x525ef3[_0x506e('0x22')](_0x996ba8)[_0x506e('0x23')](function(_0x223ef8){return _0x223ef8;});}return null;};}function removeEntity(_0x25e605,_0x5bcebf){return function(_0x35e058){if(_0x35e058){return _0x35e058['destroy']()[_0x506e('0x23')](function(){_0x25e605['status'](0xcc)[_0x506e('0x24')]();});}};}function handleEntityNotFound(_0x222afe,_0x51d797){return function(_0x2f4dac){if(!_0x2f4dac){_0x222afe[_0x506e('0x17')](0x194);}return _0x2f4dac;};}function handleError(_0x4b4812,_0x236536){_0x236536=_0x236536||0x1f4;return function(_0x333e2f){logger[_0x506e('0x25')](_0x333e2f[_0x506e('0x26')]);if(_0x333e2f[_0x506e('0x27')]){delete _0x333e2f[_0x506e('0x27')];}_0x4b4812[_0x506e('0x18')](_0x236536)['send'](_0x333e2f);};}exports[_0x506e('0x28')]=function(_0x43ed88,_0x4aab0a){var _0x109ca4={},_0x109f80={},_0x51cc4f={'count':0x0,'rows':[]};var _0x2b21ea=_['map'](db[_0x506e('0x29')][_0x506e('0x2a')],function(_0x3516af){return{'name':_0x3516af[_0x506e('0x2b')],'type':_0x3516af[_0x506e('0x2c')]['key']};});_0x109f80['model']=_[_0x506e('0x2d')](_0x2b21ea,_0x506e('0x27'));_0x109f80['query']=_[_0x506e('0x2e')](_0x43ed88[_0x506e('0x2f')]);_0x109f80[_0x506e('0x30')]=_['intersection'](_0x109f80[_0x506e('0x31')],_0x109f80[_0x506e('0x2f')]);_0x109ca4['attributes']=_[_0x506e('0x32')](_0x109f80['model'],qs['fields'](_0x43ed88['query'][_0x506e('0x33')]));_0x109ca4['attributes']=_0x109ca4[_0x506e('0x34')][_0x506e('0x35')]?_0x109ca4['attributes']:_0x109f80['model'];if(!_0x43ed88[_0x506e('0x2f')]['hasOwnProperty']('nolimit')){_0x109ca4[_0x506e('0x1c')]=qs[_0x506e('0x1c')](_0x43ed88['query'][_0x506e('0x1c')]);_0x109ca4[_0x506e('0x1a')]=qs[_0x506e('0x1a')](_0x43ed88[_0x506e('0x2f')][_0x506e('0x1a')]);}_0x109ca4['order']=qs[_0x506e('0x36')](_0x43ed88[_0x506e('0x2f')][_0x506e('0x36')]);_0x109ca4[_0x506e('0x37')]=qs[_0x506e('0x30')](_['pick'](_0x43ed88['query'],_0x109f80['filters']),_0x2b21ea);if(_0x43ed88['query']['filter']){_0x109ca4['where']=_[_0x506e('0x38')](_0x109ca4[_0x506e('0x37')],{'$or':_[_0x506e('0x2d')](_0x2b21ea,function(_0x439584){if(_0x439584[_0x506e('0x2c')]!=='VIRTUAL'){var _0x30b3ed={};_0x30b3ed[_0x439584['name']]={'$like':'%'+_0x43ed88[_0x506e('0x2f')][_0x506e('0x39')]+'%'};return _0x30b3ed;}})});}_0x109ca4=_[_0x506e('0x38')]({},_0x109ca4,_0x43ed88[_0x506e('0x3a')]);var _0x55b0fe={'where':_0x109ca4[_0x506e('0x37')]};return db[_0x506e('0x29')][_0x506e('0x1d')](_0x55b0fe)[_0x506e('0x23')](function(_0x341cce){_0x51cc4f[_0x506e('0x1d')]=_0x341cce;if(_0x43ed88[_0x506e('0x2f')][_0x506e('0x3b')]){_0x109ca4['include']=[{'all':!![]}];}return db[_0x506e('0x29')][_0x506e('0x3c')](_0x109ca4);})['then'](function(_0x35b28d){_0x51cc4f[_0x506e('0x3d')]=_0x35b28d;return _0x51cc4f;})['then'](respondWithFilteredResult(_0x4aab0a,_0x109ca4))[_0x506e('0x3e')](handleError(_0x4aab0a,null));};exports[_0x506e('0x3f')]=function(_0x56d16a,_0x3104d7){var _0x3a8c73={'raw':![],'where':{'id':_0x56d16a[_0x506e('0x40')]['id']}},_0x9739de={};_0x9739de['model']=_[_0x506e('0x2e')](db[_0x506e('0x29')]['rawAttributes']);_0x9739de[_0x506e('0x2f')]=_[_0x506e('0x2e')](_0x56d16a['query']);_0x9739de[_0x506e('0x30')]=_[_0x506e('0x32')](_0x9739de['model'],_0x9739de[_0x506e('0x2f')]);_0x3a8c73[_0x506e('0x34')]=_[_0x506e('0x32')](_0x9739de[_0x506e('0x31')],qs[_0x506e('0x33')](_0x56d16a['query'][_0x506e('0x33')]));_0x3a8c73['attributes']=_0x3a8c73['attributes'][_0x506e('0x35')]?_0x3a8c73[_0x506e('0x34')]:_0x9739de['model'];if(_0x56d16a[_0x506e('0x2f')][_0x506e('0x3b')]){_0x3a8c73[_0x506e('0x41')]=[{'all':!![]}];}_0x3a8c73=_[_0x506e('0x38')]({},_0x3a8c73,_0x56d16a[_0x506e('0x3a')]);return db[_0x506e('0x29')][_0x506e('0x42')](_0x3a8c73)['then'](handleEntityNotFound(_0x3104d7,null))[_0x506e('0x23')](respondWithResult(_0x3104d7,null))[_0x506e('0x3e')](handleError(_0x3104d7,null));};exports[_0x506e('0x43')]=function(_0x116734,_0x5729ab){return db[_0x506e('0x29')][_0x506e('0x43')](_0x116734[_0x506e('0x44')],{})[_0x506e('0x23')](respondWithResult(_0x5729ab,0xc9))[_0x506e('0x3e')](handleError(_0x5729ab,null));};exports['update']=function(_0x40f897,_0x5a1110){if(_0x40f897['body']['id']){delete _0x40f897[_0x506e('0x44')]['id'];}return db['VtigerConfiguration'][_0x506e('0x42')]({'where':{'id':_0x40f897['params']['id']}})[_0x506e('0x23')](handleEntityNotFound(_0x5a1110,null))['then'](saveUpdates(_0x40f897[_0x506e('0x44')],null))['then'](respondWithResult(_0x5a1110,null))[_0x506e('0x3e')](handleError(_0x5a1110,null));};exports[_0x506e('0x45')]=function(_0x2d44d1,_0x88e545){return db[_0x506e('0x29')]['find']({'where':{'id':_0x2d44d1[_0x506e('0x40')]['id']}})['then'](handleEntityNotFound(_0x88e545,null))[_0x506e('0x23')](removeEntity(_0x88e545,null))[_0x506e('0x3e')](handleError(_0x88e545,null));};exports[_0x506e('0x46')]=function(_0x1cbde5,_0x5b771f,_0x3052f8){var _0x41b070={};var _0xbe8060={};var _0x539010;var _0x220a91;return db[_0x506e('0x29')][_0x506e('0x47')]({'where':{'id':_0x1cbde5[_0x506e('0x40')]['id']}})[_0x506e('0x23')](handleEntityNotFound(_0x5b771f,null))[_0x506e('0x23')](function(_0x502d4b){if(_0x502d4b){_0x539010=_0x502d4b;_0xbe8060[_0x506e('0x31')]=_[_0x506e('0x2e')](db[_0x506e('0x48')][_0x506e('0x2a')]);_0xbe8060['query']=_['keys'](_0x1cbde5[_0x506e('0x2f')]);_0xbe8060[_0x506e('0x30')]=_[_0x506e('0x32')](_0xbe8060[_0x506e('0x31')],_0xbe8060[_0x506e('0x2f')]);_0x41b070['attributes']=_[_0x506e('0x32')](_0xbe8060['model'],qs['fields'](_0x1cbde5[_0x506e('0x2f')][_0x506e('0x33')]));_0x41b070[_0x506e('0x34')]=_0x41b070[_0x506e('0x34')]['length']?_0x41b070[_0x506e('0x34')]:_0xbe8060[_0x506e('0x31')];_0x41b070[_0x506e('0x49')]=qs['sort'](_0x1cbde5['query']['sort']);_0x41b070[_0x506e('0x37')]=qs[_0x506e('0x30')](_[_0x506e('0x4a')](_0x1cbde5['query'],_0xbe8060[_0x506e('0x30')]));if(_0x1cbde5[_0x506e('0x2f')][_0x506e('0x39')]){_0x41b070['where']=_[_0x506e('0x38')](_0x41b070[_0x506e('0x37')],{'$or':_[_0x506e('0x2d')](_0x41b070[_0x506e('0x34')],function(_0x50bbcc){var _0x32e5a8={};_0x32e5a8[_0x50bbcc]={'$like':'%'+_0x1cbde5[_0x506e('0x2f')][_0x506e('0x39')]+'%'};return _0x32e5a8;})});}_0x41b070=_[_0x506e('0x38')]({},_0x41b070,_0x1cbde5[_0x506e('0x3a')]);return _0x539010[_0x506e('0x46')](_0x41b070);}})[_0x506e('0x23')](function(_0x4b8e80){if(_0x4b8e80){_0x220a91=_0x4b8e80[_0x506e('0x35')];if(!_0x1cbde5[_0x506e('0x2f')][_0x506e('0x4b')](_0x506e('0x4c'))){_0x41b070[_0x506e('0x1c')]=qs[_0x506e('0x1c')](_0x1cbde5['query'][_0x506e('0x1c')]);_0x41b070['offset']=qs[_0x506e('0x1a')](_0x1cbde5[_0x506e('0x2f')][_0x506e('0x1a')]);}return _0x539010[_0x506e('0x46')](_0x41b070);}})['then'](function(_0x3f04f1){if(_0x3f04f1){return _0x3f04f1?{'count':_0x220a91,'rows':_0x3f04f1}:null;}})['then'](respondWithResult(_0x5b771f,null))[_0x506e('0x3e')](handleError(_0x5b771f,null));};exports[_0x506e('0x4d')]=function(_0x3035b3,_0x281b29,_0x596be4){var _0x32c7cc={};var _0x21ebcf={};var _0x2ac49b;var _0x145c53;return db[_0x506e('0x29')][_0x506e('0x47')]({'where':{'id':_0x3035b3['params']['id']}})[_0x506e('0x23')](handleEntityNotFound(_0x281b29,null))[_0x506e('0x23')](function(_0x29abfd){if(_0x29abfd){_0x2ac49b=_0x29abfd;_0x21ebcf['model']=_[_0x506e('0x2e')](db[_0x506e('0x48')][_0x506e('0x2a')]);_0x21ebcf['query']=_[_0x506e('0x2e')](_0x3035b3[_0x506e('0x2f')]);_0x21ebcf['filters']=_['intersection'](_0x21ebcf[_0x506e('0x31')],_0x21ebcf[_0x506e('0x2f')]);_0x32c7cc['attributes']=_[_0x506e('0x32')](_0x21ebcf[_0x506e('0x31')],qs[_0x506e('0x33')](_0x3035b3['query'][_0x506e('0x33')]));_0x32c7cc['attributes']=_0x32c7cc[_0x506e('0x34')][_0x506e('0x35')]?_0x32c7cc[_0x506e('0x34')]:_0x21ebcf[_0x506e('0x31')];_0x32c7cc[_0x506e('0x49')]=qs[_0x506e('0x36')](_0x3035b3['query']['sort']);_0x32c7cc[_0x506e('0x37')]=qs[_0x506e('0x30')](_[_0x506e('0x4a')](_0x3035b3[_0x506e('0x2f')],_0x21ebcf['filters']));if(_0x3035b3[_0x506e('0x2f')][_0x506e('0x39')]){_0x32c7cc[_0x506e('0x37')]=_[_0x506e('0x38')](_0x32c7cc['where'],{'$or':_['map'](_0x32c7cc[_0x506e('0x34')],function(_0x3223e6){var _0x58bb49={};_0x58bb49[_0x3223e6]={'$like':'%'+_0x3035b3[_0x506e('0x2f')][_0x506e('0x39')]+'%'};return _0x58bb49;})});}_0x32c7cc=_[_0x506e('0x38')]({},_0x32c7cc,_0x3035b3[_0x506e('0x3a')]);return _0x2ac49b[_0x506e('0x4d')](_0x32c7cc);}})['then'](function(_0x3a30a4){if(_0x3a30a4){_0x145c53=_0x3a30a4[_0x506e('0x35')];if(!_0x3035b3['query'][_0x506e('0x4b')](_0x506e('0x4c'))){_0x32c7cc['limit']=qs['limit'](_0x3035b3['query'][_0x506e('0x1c')]);_0x32c7cc['offset']=qs[_0x506e('0x1a')](_0x3035b3[_0x506e('0x2f')][_0x506e('0x1a')]);}return _0x2ac49b[_0x506e('0x4d')](_0x32c7cc);}})[_0x506e('0x23')](function(_0x159faa){if(_0x159faa){return _0x159faa?{'count':_0x145c53,'rows':_0x159faa}:null;}})['then'](respondWithResult(_0x281b29,null))[_0x506e('0x3e')](handleError(_0x281b29,null));};exports['getDescriptions']=function(_0x14a60f,_0x59a287,_0x15f1cc){var _0x457255={};var _0xbb2767={};var _0xa15da9;var _0x299f08;return db['VtigerConfiguration'][_0x506e('0x47')]({'where':{'id':_0x14a60f[_0x506e('0x40')]['id']}})['then'](handleEntityNotFound(_0x59a287,null))[_0x506e('0x23')](function(_0x46a8b7){if(_0x46a8b7){_0xa15da9=_0x46a8b7;_0xbb2767['model']=_['keys'](db['VtigerField']['rawAttributes']);_0xbb2767[_0x506e('0x2f')]=_[_0x506e('0x2e')](_0x14a60f['query']);_0xbb2767[_0x506e('0x30')]=_['intersection'](_0xbb2767['model'],_0xbb2767[_0x506e('0x2f')]);_0x457255[_0x506e('0x34')]=_[_0x506e('0x32')](_0xbb2767[_0x506e('0x31')],qs[_0x506e('0x33')](_0x14a60f[_0x506e('0x2f')][_0x506e('0x33')]));_0x457255[_0x506e('0x34')]=_0x457255[_0x506e('0x34')]['length']?_0x457255['attributes']:_0xbb2767['model'];_0x457255['order']=qs['sort'](_0x14a60f[_0x506e('0x2f')][_0x506e('0x36')]);_0x457255[_0x506e('0x37')]=qs['filters'](_[_0x506e('0x4a')](_0x14a60f[_0x506e('0x2f')],_0xbb2767['filters']));if(_0x14a60f[_0x506e('0x2f')][_0x506e('0x39')]){_0x457255[_0x506e('0x37')]=_[_0x506e('0x38')](_0x457255[_0x506e('0x37')],{'$or':_[_0x506e('0x2d')](_0x457255[_0x506e('0x34')],function(_0x524c0b){var _0x5decac={};_0x5decac[_0x524c0b]={'$like':'%'+_0x14a60f[_0x506e('0x2f')][_0x506e('0x39')]+'%'};return _0x5decac;})});}_0x457255=_[_0x506e('0x38')]({},_0x457255,_0x14a60f[_0x506e('0x3a')]);return _0xa15da9[_0x506e('0x4e')](_0x457255);}})[_0x506e('0x23')](function(_0x4840db){if(_0x4840db){_0x299f08=_0x4840db['length'];if(!_0x14a60f[_0x506e('0x2f')]['hasOwnProperty'](_0x506e('0x4c'))){_0x457255[_0x506e('0x1c')]=qs['limit'](_0x14a60f[_0x506e('0x2f')][_0x506e('0x1c')]);_0x457255['offset']=qs[_0x506e('0x1a')](_0x14a60f[_0x506e('0x2f')][_0x506e('0x1a')]);}return _0xa15da9[_0x506e('0x4e')](_0x457255);}})[_0x506e('0x23')](function(_0x59a7e5){if(_0x59a7e5){return _0x59a7e5?{'count':_0x299f08,'rows':_0x59a7e5}:null;}})[_0x506e('0x23')](respondWithResult(_0x59a287,null))[_0x506e('0x3e')](handleError(_0x59a287,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index b96daa7..fc33253 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 _0x6e1f=['./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x2a57be,_0x5534eb){var _0x5018b8=function(_0x5a1b6e){while(--_0x5a1b6e){_0x2a57be['push'](_0x2a57be['shift']());}};_0x5018b8(++_0x5534eb);}(_0x6e1f,0x1cc));var _0xf6e1=function(_0x569cbb,_0x111eb4){_0x569cbb=_0x569cbb-0x0;var _0x39dc33=_0x6e1f[_0x569cbb];return _0x39dc33;};'use strict';var _=require(_0xf6e1('0x0'));var util=require(_0xf6e1('0x1'));var logger=require(_0xf6e1('0x2'))('api');var moment=require(_0xf6e1('0x3'));var BPromise=require(_0xf6e1('0x4'));var rp=require(_0xf6e1('0x5'));var fs=require('fs');var path=require(_0xf6e1('0x6'));var rimraf=require('rimraf');var config=require(_0xf6e1('0x7'));var attributes=require(_0xf6e1('0x8'));module[_0xf6e1('0x9')]=function(_0x2576fd,_0x3a9d47){return _0x2576fd[_0xf6e1('0xa')](_0xf6e1('0xb'),attributes,{'tableName':_0xf6e1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x71c3=['moment','bluebird','path','rimraf','../../config/environment','exports','define','VtigerConfiguration','util','../../config/logger'];(function(_0x36753f,_0x1d08ef){var _0x28b64d=function(_0x7101a9){while(--_0x7101a9){_0x36753f['push'](_0x36753f['shift']());}};_0x28b64d(++_0x1d08ef);}(_0x71c3,0x1a2));var _0x371c=function(_0x5ea02c,_0x35ea64){_0x5ea02c=_0x5ea02c-0x0;var _0x140dce=_0x71c3[_0x5ea02c];return _0x140dce;};'use strict';var _=require('lodash');var util=require(_0x371c('0x0'));var logger=require(_0x371c('0x1'))('api');var moment=require(_0x371c('0x2'));var BPromise=require(_0x371c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x371c('0x4'));var rimraf=require(_0x371c('0x5'));var config=require(_0x371c('0x6'));var attributes=require('./intVtigerConfiguration.attributes');module[_0x371c('0x7')]=function(_0x4501d1,_0x21339d){return _0x4501d1[_0x371c('0x8')](_0x371c('0x9'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index a2505be..4617f68 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 _0x9388=['debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','VtigerConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x12a679,_0x1d6edd){var _0x1454d7=function(_0xe726f){while(--_0xe726f){_0x12a679['push'](_0x12a679['shift']());}};_0x1454d7(++_0x1d6edd);}(_0x9388,0x1e8));var _0x8938=function(_0x5a4567,_0x3d85fe){_0x5a4567=_0x5a4567-0x0;var _0x14fa61=_0x9388[_0x5a4567];return _0x14fa61;};'use strict';var _=require(_0x8938('0x0'));var util=require(_0x8938('0x1'));var moment=require(_0x8938('0x2'));var BPromise=require(_0x8938('0x3'));var rs=require(_0x8938('0x4'));var fs=require('fs');var Redis=require(_0x8938('0x5'));var db=require(_0x8938('0x6'))['db'];var utils=require(_0x8938('0x7'));var logger=require(_0x8938('0x8'))(_0x8938('0x9'));var config=require('../../config/environment');var jayson=require(_0x8938('0xa'));var client=jayson[_0x8938('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bb30b,_0x1c1d23,_0x4c8e24){return new BPromise(function(_0x12dcc9,_0x35a9a5){return client[_0x8938('0xc')](_0x5bb30b,_0x4c8e24)[_0x8938('0xd')](function(_0x2230e2){logger['info'](_0x8938('0xe'),_0x1c1d23,_0x8938('0xf'));logger[_0x8938('0x10')](_0x8938('0x11'),_0x1c1d23,_0x8938('0xf'),JSON[_0x8938('0x12')](_0x2230e2));if(_0x2230e2[_0x8938('0x13')]){if(_0x2230e2[_0x8938('0x13')][_0x8938('0x14')]===0x1f4){logger[_0x8938('0x13')](_0x8938('0xe'),_0x1c1d23,_0x2230e2[_0x8938('0x13')][_0x8938('0x15')]);return _0x35a9a5(_0x2230e2[_0x8938('0x13')][_0x8938('0x15')]);}logger[_0x8938('0x13')]('VtigerConfiguration,\x20%s,\x20%s',_0x1c1d23,_0x2230e2['error']['message']);return _0x12dcc9(_0x2230e2['error'][_0x8938('0x15')]);}else{logger[_0x8938('0x16')]('VtigerConfiguration,\x20%s,\x20%s',_0x1c1d23,_0x8938('0xf'));_0x12dcc9(_0x2230e2[_0x8938('0x17')][_0x8938('0x15')]);}})['catch'](function(_0xa5f933){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x1c1d23,_0xa5f933);_0x35a9a5(_0xa5f933);});});} \ No newline at end of file +var _0xe443=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','VtigerConfiguration,\x20%s,\x20%s','lodash','util'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0xe443,0xee));var _0x3e44=function(_0x539b8f,_0x28d6bd){_0x539b8f=_0x539b8f-0x0;var _0x1b813e=_0xe443[_0x539b8f];return _0x1b813e;};'use strict';var _=require(_0x3e44('0x0'));var util=require(_0x3e44('0x1'));var moment=require(_0x3e44('0x2'));var BPromise=require(_0x3e44('0x3'));var rs=require(_0x3e44('0x4'));var fs=require('fs');var Redis=require(_0x3e44('0x5'));var db=require(_0x3e44('0x6'))['db'];var utils=require(_0x3e44('0x7'));var logger=require(_0x3e44('0x8'))(_0x3e44('0x9'));var config=require('../../config/environment');var jayson=require(_0x3e44('0xa'));var client=jayson[_0x3e44('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1310d8,_0x54b970,_0x3b30ce){return new BPromise(function(_0x115c79,_0x26d0aa){return client[_0x3e44('0xc')](_0x1310d8,_0x3b30ce)[_0x3e44('0xd')](function(_0x873541){logger[_0x3e44('0xe')]('VtigerConfiguration,\x20%s,\x20%s',_0x54b970,'request\x20sent');logger[_0x3e44('0xf')](_0x3e44('0x10'),_0x54b970,'request\x20sent',JSON[_0x3e44('0x11')](_0x873541));if(_0x873541[_0x3e44('0x12')]){if(_0x873541[_0x3e44('0x12')][_0x3e44('0x13')]===0x1f4){logger[_0x3e44('0x12')]('VtigerConfiguration,\x20%s,\x20%s',_0x54b970,_0x873541[_0x3e44('0x12')]['message']);return _0x26d0aa(_0x873541[_0x3e44('0x12')][_0x3e44('0x14')]);}logger[_0x3e44('0x12')]('VtigerConfiguration,\x20%s,\x20%s',_0x54b970,_0x873541[_0x3e44('0x12')][_0x3e44('0x14')]);return _0x115c79(_0x873541[_0x3e44('0x12')][_0x3e44('0x14')]);}else{logger[_0x3e44('0xe')]('VtigerConfiguration,\x20%s,\x20%s',_0x54b970,_0x3e44('0x15'));_0x115c79(_0x873541['result'][_0x3e44('0x14')]);}})[_0x3e44('0x16')](function(_0x131ca9){logger[_0x3e44('0x12')](_0x3e44('0x17'),_0x54b970,_0x131ca9);_0x26d0aa(_0x131ca9);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 88a47b9..82dea01 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 _0x2bc8=['create','put','update','destroy','multer','path','connect-timeout','express','../../components/interaction/service','index','get','/:id','isAuthenticated','post'];(function(_0x5aba89,_0x1b008a){var _0x10ce7d=function(_0x2f7dc5){while(--_0x2f7dc5){_0x5aba89['push'](_0x5aba89['shift']());}};_0x10ce7d(++_0x1b008a);}(_0x2bc8,0x82));var _0x82bc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2bc8[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x82bc('0x0'));var util=require('util');var path=require(_0x82bc('0x1'));var timeout=require(_0x82bc('0x2'));var express=require(_0x82bc('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x82bc('0x4'));var config=require('../../config/environment');var controller=require('./intVtigerField.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x82bc('0x5')]);router[_0x82bc('0x6')](_0x82bc('0x7'),auth[_0x82bc('0x8')](),controller['show']);router[_0x82bc('0x9')]('/',auth['isAuthenticated'](),controller[_0x82bc('0xa')]);router[_0x82bc('0xb')](_0x82bc('0x7'),auth['isAuthenticated'](),controller[_0x82bc('0xc')]);router['delete']('/:id',auth[_0x82bc('0x8')](),controller[_0x82bc('0xd')]);module['exports']=router; \ No newline at end of file +var _0x5f84=['Router','fs-extra','../../config/environment','./intVtigerField.controller','isAuthenticated','get','show','post','create','put','/:id','delete','exports','multer','util','path','express'];(function(_0x4e385a,_0x29eee3){var _0x4922eb=function(_0x28364e){while(--_0x28364e){_0x4e385a['push'](_0x4e385a['shift']());}};_0x4922eb(++_0x29eee3);}(_0x5f84,0x84));var _0x45f8=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5f84[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x45f8('0x0'));var util=require(_0x45f8('0x1'));var path=require(_0x45f8('0x2'));var timeout=require('connect-timeout');var express=require(_0x45f8('0x3'));var router=express[_0x45f8('0x4')]();var fs_extra=require(_0x45f8('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x45f8('0x6'));var controller=require(_0x45f8('0x7'));router['get']('/',auth[_0x45f8('0x8')](),controller['index']);router[_0x45f8('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x45f8('0xa')]);router[_0x45f8('0xb')]('/',auth[_0x45f8('0x8')](),controller[_0x45f8('0xc')]);router[_0x45f8('0xd')](_0x45f8('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x45f8('0xf')](_0x45f8('0xe'),auth[_0x45f8('0x8')](),controller['destroy']);module[_0x45f8('0x10')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index d5693f7..77369d1 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 _0x8bcc=['customVariable','keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x5db5cf,_0x168562){var _0x2f13fa=function(_0x4a9985){while(--_0x4a9985){_0x5db5cf['push'](_0x5db5cf['shift']());}};_0x2f13fa(++_0x168562);}(_0x8bcc,0x199));var _0xc8bc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8bcc[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc8bc('0x0'));module[_0xc8bc('0x1')]={'type':{'type':Sequelize[_0xc8bc('0x2')](_0xc8bc('0x3'),_0xc8bc('0x4'),_0xc8bc('0x5'),_0xc8bc('0x6'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xc8bc('0x7')]},'key':{'type':Sequelize[_0xc8bc('0x7')]},'keyType':{'type':Sequelize[_0xc8bc('0x2')](_0xc8bc('0x3'),_0xc8bc('0x4'),_0xc8bc('0x5'))},'keyContent':{'type':Sequelize[_0xc8bc('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xc8bc('0x7')]},'customField':{'type':Sequelize[_0xc8bc('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc8bc('0x7')]}}; \ No newline at end of file +var _0x7960=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','sequelize'];(function(_0x395155,_0x192ffd){var _0x179767=function(_0xb18ee3){while(--_0xb18ee3){_0x395155['push'](_0x395155['shift']());}};_0x179767(++_0x192ffd);}(_0x7960,0xff));var _0x0796=function(_0x45eb8e,_0x125376){_0x45eb8e=_0x45eb8e-0x0;var _0xf408ad=_0x7960[_0x45eb8e];return _0xf408ad;};'use strict';var Sequelize=require(_0x0796('0x0'));module['exports']={'type':{'type':Sequelize[_0x0796('0x1')](_0x0796('0x2'),_0x0796('0x3'),_0x0796('0x4'),_0x0796('0x5'),_0x0796('0x6')),'defaultValue':_0x0796('0x2')},'content':{'type':Sequelize[_0x0796('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string','variable',_0x0796('0x4'))},'keyContent':{'type':Sequelize[_0x0796('0x7')]},'idField':{'type':Sequelize[_0x0796('0x7')]},'nameField':{'type':Sequelize[_0x0796('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 9917dd8..bc6c5aa 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 _0x06cb=['jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','name','index','VtigerField','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','find','create','catch','body','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0x06cb,0xd5));var _0xb06c=function(_0x432a2a,_0x56943d){_0x432a2a=_0x432a2a-0x0;var _0x5925c5=_0x06cb[_0x432a2a];return _0x5925c5;};'use strict';var emlformat=require(_0xb06c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb06c('0x1'));var rp=require(_0xb06c('0x2'));var moment=require(_0xb06c('0x3'));var BPromise=require(_0xb06c('0x4'));var Mustache=require(_0xb06c('0x5'));var util=require(_0xb06c('0x6'));var path=require(_0xb06c('0x7'));var sox=require(_0xb06c('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb06c('0x9'));var squel=require(_0xb06c('0xa'));var crypto=require(_0xb06c('0xb'));var jsforce=require(_0xb06c('0xc'));var deskjs=require(_0xb06c('0xd'));var toCsv=require(_0xb06c('0xe'));var querystring=require(_0xb06c('0xf'));var Papa=require(_0xb06c('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb06c('0x11'));var hardwareService=require(_0xb06c('0x12'));var logger=require(_0xb06c('0x13'))(_0xb06c('0x14'));var utils=require(_0xb06c('0x15'));var config=require(_0xb06c('0x16'));var licenseUtil=require(_0xb06c('0x17'));var db=require(_0xb06c('0x18'))['db'];function respondWithStatusCode(_0x225e53,_0xa3ea2c){_0xa3ea2c=_0xa3ea2c||0xcc;return function(_0x3884e7){if(_0x3884e7){return _0x225e53['sendStatus'](_0xa3ea2c);}return _0x225e53[_0xb06c('0x19')](_0xa3ea2c)[_0xb06c('0x1a')]();};}function respondWithResult(_0x46ed8c,_0x116433){_0x116433=_0x116433||0xc8;return function(_0x2178a4){if(_0x2178a4){return _0x46ed8c[_0xb06c('0x19')](_0x116433)[_0xb06c('0x1b')](_0x2178a4);}};}function respondWithFilteredResult(_0x54f816,_0x37d31d){return function(_0x1ff78b){if(_0x1ff78b){var _0x299939=typeof _0x37d31d[_0xb06c('0x1c')]===_0xb06c('0x1d')&&typeof _0x37d31d[_0xb06c('0x1e')]===_0xb06c('0x1d');var _0x40bc25=_0x1ff78b[_0xb06c('0x1f')];var _0x1b39c8=_0x299939?0x0:_0x37d31d[_0xb06c('0x1c')];var _0x49a6a6=_0x299939?_0x1ff78b['count']:_0x37d31d['offset']+_0x37d31d[_0xb06c('0x1e')];var _0x2ba204;if(_0x49a6a6>=_0x40bc25){_0x49a6a6=_0x40bc25;_0x2ba204=0xc8;}else{_0x2ba204=0xce;}_0x54f816[_0xb06c('0x19')](_0x2ba204);return _0x54f816[_0xb06c('0x20')](_0xb06c('0x21'),_0x1b39c8+'-'+_0x49a6a6+'/'+_0x40bc25)['json'](_0x1ff78b);}return null;};}function patchUpdates(_0x1b805c){return function(_0x2b4b83){try{jsonpatch[_0xb06c('0x22')](_0x2b4b83,_0x1b805c,!![]);}catch(_0x15bbd0){return BPromise[_0xb06c('0x23')](_0x15bbd0);}return _0x2b4b83[_0xb06c('0x24')]();};}function saveUpdates(_0x1bd5a8,_0x54723d){return function(_0x1f8c49){if(_0x1f8c49){return _0x1f8c49[_0xb06c('0x25')](_0x1bd5a8)[_0xb06c('0x26')](function(_0x419f20){return _0x419f20;});}return null;};}function removeEntity(_0x28b263,_0x4eb6b7){return function(_0x497756){if(_0x497756){return _0x497756[_0xb06c('0x27')]()[_0xb06c('0x26')](function(){_0x28b263[_0xb06c('0x19')](0xcc)[_0xb06c('0x1a')]();});}};}function handleEntityNotFound(_0x126b46,_0x13a405){return function(_0x4d9973){if(!_0x4d9973){_0x126b46[_0xb06c('0x28')](0x194);}return _0x4d9973;};}function handleError(_0x4e1b50,_0x1b4621){_0x1b4621=_0x1b4621||0x1f4;return function(_0x3615e8){logger['error'](_0x3615e8['stack']);if(_0x3615e8[_0xb06c('0x29')]){delete _0x3615e8[_0xb06c('0x29')];}_0x4e1b50[_0xb06c('0x19')](_0x1b4621)['send'](_0x3615e8);};}exports[_0xb06c('0x2a')]=function(_0x34e427,_0x31d8fe){var _0xf38401={},_0x3e2d75={},_0x212607={'count':0x0,'rows':[]};var _0x313d9f=_['map'](db[_0xb06c('0x2b')][_0xb06c('0x2c')],function(_0x573d6a){return{'name':_0x573d6a[_0xb06c('0x2d')],'type':_0x573d6a[_0xb06c('0x2e')][_0xb06c('0x2f')]};});_0x3e2d75[_0xb06c('0x30')]=_[_0xb06c('0x31')](_0x313d9f,_0xb06c('0x29'));_0x3e2d75[_0xb06c('0x32')]=_[_0xb06c('0x33')](_0x34e427[_0xb06c('0x32')]);_0x3e2d75[_0xb06c('0x34')]=_[_0xb06c('0x35')](_0x3e2d75[_0xb06c('0x30')],_0x3e2d75[_0xb06c('0x32')]);_0xf38401['attributes']=_[_0xb06c('0x35')](_0x3e2d75[_0xb06c('0x30')],qs[_0xb06c('0x36')](_0x34e427['query'][_0xb06c('0x36')]));_0xf38401[_0xb06c('0x37')]=_0xf38401[_0xb06c('0x37')][_0xb06c('0x38')]?_0xf38401['attributes']:_0x3e2d75[_0xb06c('0x30')];if(!_0x34e427[_0xb06c('0x32')][_0xb06c('0x39')](_0xb06c('0x3a'))){_0xf38401['limit']=qs[_0xb06c('0x1e')](_0x34e427[_0xb06c('0x32')]['limit']);_0xf38401['offset']=qs['offset'](_0x34e427[_0xb06c('0x32')]['offset']);}_0xf38401['order']=qs['sort'](_0x34e427[_0xb06c('0x32')][_0xb06c('0x3b')]);_0xf38401[_0xb06c('0x3c')]=qs[_0xb06c('0x34')](_[_0xb06c('0x3d')](_0x34e427['query'],_0x3e2d75[_0xb06c('0x34')]),_0x313d9f);if(_0x34e427[_0xb06c('0x32')][_0xb06c('0x3e')]){_0xf38401[_0xb06c('0x3c')]=_[_0xb06c('0x3f')](_0xf38401['where'],{'$or':_['map'](_0x313d9f,function(_0x7a2a65){if(_0x7a2a65[_0xb06c('0x2e')]!==_0xb06c('0x40')){var _0xfa6e1f={};_0xfa6e1f[_0x7a2a65[_0xb06c('0x29')]]={'$like':'%'+_0x34e427[_0xb06c('0x32')]['filter']+'%'};return _0xfa6e1f;}})});}_0xf38401=_[_0xb06c('0x3f')]({},_0xf38401,_0x34e427['options']);var _0x2b3547={'where':_0xf38401['where']};return db['VtigerField'][_0xb06c('0x1f')](_0x2b3547)['then'](function(_0x2cdc4){_0x212607[_0xb06c('0x1f')]=_0x2cdc4;if(_0x34e427[_0xb06c('0x32')][_0xb06c('0x41')]){_0xf38401[_0xb06c('0x42')]=[{'all':!![]}];}return db[_0xb06c('0x2b')][_0xb06c('0x43')](_0xf38401);})[_0xb06c('0x26')](function(_0x34ed15){_0x212607[_0xb06c('0x44')]=_0x34ed15;return _0x212607;})[_0xb06c('0x26')](respondWithFilteredResult(_0x31d8fe,_0xf38401))['catch'](handleError(_0x31d8fe,null));};exports[_0xb06c('0x45')]=function(_0x1a3e80,_0x3c976a){var _0x18abad={'raw':!![],'where':{'id':_0x1a3e80[_0xb06c('0x46')]['id']}},_0x5146f8={};_0x5146f8[_0xb06c('0x30')]=_['keys'](db[_0xb06c('0x2b')][_0xb06c('0x2c')]);_0x5146f8['query']=_[_0xb06c('0x33')](_0x1a3e80[_0xb06c('0x32')]);_0x5146f8['filters']=_[_0xb06c('0x35')](_0x5146f8['model'],_0x5146f8[_0xb06c('0x32')]);_0x18abad[_0xb06c('0x37')]=_['intersection'](_0x5146f8[_0xb06c('0x30')],qs['fields'](_0x1a3e80[_0xb06c('0x32')][_0xb06c('0x36')]));_0x18abad[_0xb06c('0x37')]=_0x18abad[_0xb06c('0x37')][_0xb06c('0x38')]?_0x18abad['attributes']:_0x5146f8[_0xb06c('0x30')];if(_0x1a3e80['query']['includeAll']){_0x18abad[_0xb06c('0x42')]=[{'all':!![]}];}_0x18abad=_[_0xb06c('0x3f')]({},_0x18abad,_0x1a3e80['options']);return db[_0xb06c('0x2b')][_0xb06c('0x47')](_0x18abad)[_0xb06c('0x26')](handleEntityNotFound(_0x3c976a,null))[_0xb06c('0x26')](respondWithResult(_0x3c976a,null))['catch'](handleError(_0x3c976a,null));};exports['create']=function(_0x38f27c,_0xac4322){return db[_0xb06c('0x2b')][_0xb06c('0x48')](_0x38f27c['body'],{})['then'](respondWithResult(_0xac4322,0xc9))[_0xb06c('0x49')](handleError(_0xac4322,null));};exports[_0xb06c('0x25')]=function(_0xbc0c18,_0x597a5f){if(_0xbc0c18[_0xb06c('0x4a')]['id']){delete _0xbc0c18[_0xb06c('0x4a')]['id'];}return db[_0xb06c('0x2b')][_0xb06c('0x47')]({'where':{'id':_0xbc0c18['params']['id']}})['then'](handleEntityNotFound(_0x597a5f,null))[_0xb06c('0x26')](saveUpdates(_0xbc0c18[_0xb06c('0x4a')],null))[_0xb06c('0x26')](respondWithResult(_0x597a5f,null))[_0xb06c('0x49')](handleError(_0x597a5f,null));};exports[_0xb06c('0x27')]=function(_0x44ff10,_0x145f47){return db[_0xb06c('0x2b')][_0xb06c('0x47')]({'where':{'id':_0x44ff10['params']['id']}})[_0xb06c('0x26')](handleEntityNotFound(_0x145f47,null))[_0xb06c('0x26')](removeEntity(_0x145f47,null))[_0xb06c('0x49')](handleError(_0x145f47,null));}; \ No newline at end of file +var _0xfab5=['desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','error','send','map','rawAttributes','fieldName','type','key','model','name','keys','query','filters','intersection','attributes','fields','length','nolimit','order','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','VtigerField','find','create','params','body','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xfab5,0x1ea));var _0x5fab=function(_0x2fa876,_0x5b27f4){_0x2fa876=_0x2fa876-0x0;var _0x1d5c8c=_0xfab5[_0x2fa876];return _0x1d5c8c;};'use strict';var emlformat=require(_0x5fab('0x0'));var rimraf=require(_0x5fab('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5fab('0x2'));var moment=require(_0x5fab('0x3'));var BPromise=require(_0x5fab('0x4'));var Mustache=require(_0x5fab('0x5'));var util=require(_0x5fab('0x6'));var path=require(_0x5fab('0x7'));var sox=require('sox');var csv=require(_0x5fab('0x8'));var ejs=require(_0x5fab('0x9'));var fs=require('fs');var fs_extra=require(_0x5fab('0xa'));var _=require(_0x5fab('0xb'));var squel=require(_0x5fab('0xc'));var crypto=require('crypto');var jsforce=require(_0x5fab('0xd'));var deskjs=require(_0x5fab('0xe'));var toCsv=require(_0x5fab('0x8'));var querystring=require(_0x5fab('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5fab('0x10'));var qs=require(_0x5fab('0x11'));var as=require(_0x5fab('0x12'));var hardwareService=require(_0x5fab('0x13'));var logger=require(_0x5fab('0x14'))('api');var utils=require(_0x5fab('0x15'));var config=require(_0x5fab('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3f2ab8,_0x244f54){_0x244f54=_0x244f54||0xcc;return function(_0x59c8e2){if(_0x59c8e2){return _0x3f2ab8[_0x5fab('0x17')](_0x244f54);}return _0x3f2ab8[_0x5fab('0x18')](_0x244f54)[_0x5fab('0x19')]();};}function respondWithResult(_0x420c8f,_0x19c4d7){_0x19c4d7=_0x19c4d7||0xc8;return function(_0x50f938){if(_0x50f938){return _0x420c8f['status'](_0x19c4d7)[_0x5fab('0x1a')](_0x50f938);}};}function respondWithFilteredResult(_0xb673e5,_0x13302c){return function(_0x2970a6){if(_0x2970a6){var _0x2b673d=typeof _0x13302c['offset']==='undefined'&&typeof _0x13302c[_0x5fab('0x1b')]==='undefined';var _0x2dd628=_0x2970a6[_0x5fab('0x1c')];var _0x15f918=_0x2b673d?0x0:_0x13302c[_0x5fab('0x1d')];var _0x39b0d9=_0x2b673d?_0x2970a6['count']:_0x13302c['offset']+_0x13302c['limit'];var _0x445567;if(_0x39b0d9>=_0x2dd628){_0x39b0d9=_0x2dd628;_0x445567=0xc8;}else{_0x445567=0xce;}_0xb673e5[_0x5fab('0x18')](_0x445567);return _0xb673e5[_0x5fab('0x1e')](_0x5fab('0x1f'),_0x15f918+'-'+_0x39b0d9+'/'+_0x2dd628)[_0x5fab('0x1a')](_0x2970a6);}return null;};}function patchUpdates(_0x1d9488){return function(_0x410679){try{jsonpatch[_0x5fab('0x20')](_0x410679,_0x1d9488,!![]);}catch(_0x407615){return BPromise['reject'](_0x407615);}return _0x410679[_0x5fab('0x21')]();};}function saveUpdates(_0x45b9aa,_0xb9c8b4){return function(_0x3b19f1){if(_0x3b19f1){return _0x3b19f1[_0x5fab('0x22')](_0x45b9aa)[_0x5fab('0x23')](function(_0xd024d0){return _0xd024d0;});}return null;};}function removeEntity(_0x4eb221,_0x286047){return function(_0x47a42c){if(_0x47a42c){return _0x47a42c[_0x5fab('0x24')]()[_0x5fab('0x23')](function(){_0x4eb221['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x312d60,_0x509278){return function(_0x26ddc9){if(!_0x26ddc9){_0x312d60[_0x5fab('0x17')](0x194);}return _0x26ddc9;};}function handleError(_0x2a8d4,_0x55a553){_0x55a553=_0x55a553||0x1f4;return function(_0x25fa21){logger[_0x5fab('0x25')](_0x25fa21['stack']);if(_0x25fa21['name']){delete _0x25fa21['name'];}_0x2a8d4[_0x5fab('0x18')](_0x55a553)[_0x5fab('0x26')](_0x25fa21);};}exports['index']=function(_0x4eb045,_0xf1acdf){var _0x40395a={},_0x5f4d40={},_0x32214c={'count':0x0,'rows':[]};var _0x59f20f=_[_0x5fab('0x27')](db['VtigerField'][_0x5fab('0x28')],function(_0x30fe37){return{'name':_0x30fe37[_0x5fab('0x29')],'type':_0x30fe37[_0x5fab('0x2a')][_0x5fab('0x2b')]};});_0x5f4d40[_0x5fab('0x2c')]=_[_0x5fab('0x27')](_0x59f20f,_0x5fab('0x2d'));_0x5f4d40['query']=_[_0x5fab('0x2e')](_0x4eb045[_0x5fab('0x2f')]);_0x5f4d40[_0x5fab('0x30')]=_[_0x5fab('0x31')](_0x5f4d40[_0x5fab('0x2c')],_0x5f4d40[_0x5fab('0x2f')]);_0x40395a[_0x5fab('0x32')]=_[_0x5fab('0x31')](_0x5f4d40[_0x5fab('0x2c')],qs[_0x5fab('0x33')](_0x4eb045['query'][_0x5fab('0x33')]));_0x40395a['attributes']=_0x40395a[_0x5fab('0x32')][_0x5fab('0x34')]?_0x40395a[_0x5fab('0x32')]:_0x5f4d40[_0x5fab('0x2c')];if(!_0x4eb045[_0x5fab('0x2f')]['hasOwnProperty'](_0x5fab('0x35'))){_0x40395a[_0x5fab('0x1b')]=qs[_0x5fab('0x1b')](_0x4eb045[_0x5fab('0x2f')][_0x5fab('0x1b')]);_0x40395a[_0x5fab('0x1d')]=qs[_0x5fab('0x1d')](_0x4eb045[_0x5fab('0x2f')][_0x5fab('0x1d')]);}_0x40395a[_0x5fab('0x36')]=qs['sort'](_0x4eb045[_0x5fab('0x2f')]['sort']);_0x40395a['where']=qs[_0x5fab('0x30')](_[_0x5fab('0x37')](_0x4eb045[_0x5fab('0x2f')],_0x5f4d40[_0x5fab('0x30')]),_0x59f20f);if(_0x4eb045[_0x5fab('0x2f')][_0x5fab('0x38')]){_0x40395a[_0x5fab('0x39')]=_['merge'](_0x40395a[_0x5fab('0x39')],{'$or':_[_0x5fab('0x27')](_0x59f20f,function(_0x3ec1a8){if(_0x3ec1a8[_0x5fab('0x2a')]!==_0x5fab('0x3a')){var _0x392d5a={};_0x392d5a[_0x3ec1a8[_0x5fab('0x2d')]]={'$like':'%'+_0x4eb045[_0x5fab('0x2f')][_0x5fab('0x38')]+'%'};return _0x392d5a;}})});}_0x40395a=_[_0x5fab('0x3b')]({},_0x40395a,_0x4eb045[_0x5fab('0x3c')]);var _0x2df2d4={'where':_0x40395a['where']};return db['VtigerField']['count'](_0x2df2d4)['then'](function(_0x40e7a2){_0x32214c[_0x5fab('0x1c')]=_0x40e7a2;if(_0x4eb045[_0x5fab('0x2f')][_0x5fab('0x3d')]){_0x40395a[_0x5fab('0x3e')]=[{'all':!![]}];}return db['VtigerField'][_0x5fab('0x3f')](_0x40395a);})['then'](function(_0x938027){_0x32214c[_0x5fab('0x40')]=_0x938027;return _0x32214c;})['then'](respondWithFilteredResult(_0xf1acdf,_0x40395a))[_0x5fab('0x41')](handleError(_0xf1acdf,null));};exports[_0x5fab('0x42')]=function(_0x33cae0,_0x12c8ed){var _0xd3238f={'raw':!![],'where':{'id':_0x33cae0['params']['id']}},_0x24dd19={};_0x24dd19['model']=_[_0x5fab('0x2e')](db[_0x5fab('0x43')][_0x5fab('0x28')]);_0x24dd19[_0x5fab('0x2f')]=_[_0x5fab('0x2e')](_0x33cae0[_0x5fab('0x2f')]);_0x24dd19[_0x5fab('0x30')]=_[_0x5fab('0x31')](_0x24dd19[_0x5fab('0x2c')],_0x24dd19[_0x5fab('0x2f')]);_0xd3238f[_0x5fab('0x32')]=_[_0x5fab('0x31')](_0x24dd19['model'],qs[_0x5fab('0x33')](_0x33cae0[_0x5fab('0x2f')]['fields']));_0xd3238f[_0x5fab('0x32')]=_0xd3238f[_0x5fab('0x32')][_0x5fab('0x34')]?_0xd3238f[_0x5fab('0x32')]:_0x24dd19[_0x5fab('0x2c')];if(_0x33cae0[_0x5fab('0x2f')][_0x5fab('0x3d')]){_0xd3238f[_0x5fab('0x3e')]=[{'all':!![]}];}_0xd3238f=_[_0x5fab('0x3b')]({},_0xd3238f,_0x33cae0[_0x5fab('0x3c')]);return db[_0x5fab('0x43')][_0x5fab('0x44')](_0xd3238f)['then'](handleEntityNotFound(_0x12c8ed,null))['then'](respondWithResult(_0x12c8ed,null))['catch'](handleError(_0x12c8ed,null));};exports[_0x5fab('0x45')]=function(_0xdeedd4,_0x442a0a){return db[_0x5fab('0x43')]['create'](_0xdeedd4['body'],{})[_0x5fab('0x23')](respondWithResult(_0x442a0a,0xc9))[_0x5fab('0x41')](handleError(_0x442a0a,null));};exports[_0x5fab('0x22')]=function(_0x5ce646,_0xf161f5){if(_0x5ce646['body']['id']){delete _0x5ce646['body']['id'];}return db[_0x5fab('0x43')][_0x5fab('0x44')]({'where':{'id':_0x5ce646[_0x5fab('0x46')]['id']}})['then'](handleEntityNotFound(_0xf161f5,null))[_0x5fab('0x23')](saveUpdates(_0x5ce646[_0x5fab('0x47')],null))[_0x5fab('0x23')](respondWithResult(_0xf161f5,null))[_0x5fab('0x41')](handleError(_0xf161f5,null));};exports[_0x5fab('0x24')]=function(_0x1e090f,_0x2de883){return db['VtigerField'][_0x5fab('0x44')]({'where':{'id':_0x1e090f[_0x5fab('0x46')]['id']}})['then'](handleEntityNotFound(_0x2de883,null))[_0x5fab('0x23')](removeEntity(_0x2de883,null))[_0x5fab('0x41')](handleError(_0x2de883,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 1f3f75e..a16a827 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 _0xe843=['api','moment','bluebird','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','idField','FieldId','lodash','util','../../config/logger'];(function(_0x1b54ec,_0x2e6cdc){var _0x4c9373=function(_0x5e74a3){while(--_0x5e74a3){_0x1b54ec['push'](_0x1b54ec['shift']());}};_0x4c9373(++_0x2e6cdc);}(_0xe843,0x13d));var _0x3e84=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe843[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x3e84('0x0'));var util=require(_0x3e84('0x1'));var logger=require(_0x3e84('0x2'))(_0x3e84('0x3'));var moment=require(_0x3e84('0x4'));var BPromise=require(_0x3e84('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3e84('0x6'));var rimraf=require(_0x3e84('0x7'));var config=require(_0x3e84('0x8'));var attributes=require(_0x3e84('0x9'));module[_0x3e84('0xa')]=function(_0x5cb38a,_0x27c4c3){return _0x5cb38a[_0x3e84('0xb')](_0x3e84('0xc'),attributes,{'tableName':_0x3e84('0xd'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x3e84('0xe'),_0x3e84('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa775=['util','api','moment','bluebird','path','rimraf','../../config/environment','exports','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash'];(function(_0x2e75c8,_0x43557b){var _0x4ebdd0=function(_0x308628){while(--_0x308628){_0x2e75c8['push'](_0x2e75c8['shift']());}};_0x4ebdd0(++_0x43557b);}(_0xa775,0x1e9));var _0x5a77=function(_0x16b408,_0x4ad155){_0x16b408=_0x16b408-0x0;var _0x7928e3=_0xa775[_0x16b408];return _0x7928e3;};'use strict';var _=require(_0x5a77('0x0'));var util=require(_0x5a77('0x1'));var logger=require('../../config/logger')(_0x5a77('0x2'));var moment=require(_0x5a77('0x3'));var BPromise=require(_0x5a77('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5a77('0x5'));var rimraf=require(_0x5a77('0x6'));var config=require(_0x5a77('0x7'));var attributes=require('./intVtigerField.attributes');module[_0x5a77('0x8')]=function(_0x1e2af6,_0x2aaf79){return _0x1e2af6['define'](_0x5a77('0x9'),attributes,{'tableName':_0x5a77('0xa'),'paranoid':![],'indexes':[{'name':_0x5a77('0xb'),'fields':[_0x5a77('0xc'),_0x5a77('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index 278bcc1..894b769 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 _0x7e33=['error','code','message','info','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5c5c52,_0x36d085){var _0x4229ff=function(_0x3806df){while(--_0x3806df){_0x5c5c52['push'](_0x5c5c52['shift']());}};_0x4229ff(++_0x36d085);}(_0x7e33,0xd4));var _0x37e3=function(_0x5ecf94,_0x26289d){_0x5ecf94=_0x5ecf94-0x0;var _0x807052=_0x7e33[_0x5ecf94];return _0x807052;};'use strict';var _=require('lodash');var util=require(_0x37e3('0x0'));var moment=require(_0x37e3('0x1'));var BPromise=require(_0x37e3('0x2'));var rs=require(_0x37e3('0x3'));var fs=require('fs');var Redis=require(_0x37e3('0x4'));var db=require(_0x37e3('0x5'))['db'];var utils=require(_0x37e3('0x6'));var logger=require(_0x37e3('0x7'))(_0x37e3('0x8'));var config=require(_0x37e3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x37e3('0xa')][_0x37e3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4290fc,_0x40da02,_0x292bbd){return new BPromise(function(_0xca73f0,_0x1a884d){return client[_0x37e3('0xc')](_0x4290fc,_0x292bbd)['then'](function(_0x460954){logger['info'](_0x37e3('0xd'),_0x40da02,_0x37e3('0xe'));logger[_0x37e3('0xf')](_0x37e3('0x10'),_0x40da02,'request\x20sent',JSON[_0x37e3('0x11')](_0x460954));if(_0x460954['error']){if(_0x460954[_0x37e3('0x12')][_0x37e3('0x13')]===0x1f4){logger[_0x37e3('0x12')](_0x37e3('0xd'),_0x40da02,_0x460954[_0x37e3('0x12')][_0x37e3('0x14')]);return _0x1a884d(_0x460954[_0x37e3('0x12')][_0x37e3('0x14')]);}logger[_0x37e3('0x12')](_0x37e3('0xd'),_0x40da02,_0x460954['error'][_0x37e3('0x14')]);return _0xca73f0(_0x460954['error'][_0x37e3('0x14')]);}else{logger[_0x37e3('0x15')]('VtigerField,\x20%s,\x20%s',_0x40da02,_0x37e3('0xe'));_0xca73f0(_0x460954[_0x37e3('0x16')][_0x37e3('0x14')]);}})['catch'](function(_0x569eff){logger[_0x37e3('0x12')](_0x37e3('0xd'),_0x40da02,_0x569eff);_0x1a884d(_0x569eff);});});} \ No newline at end of file +var _0x0241=['rpc','../../config/environment','http','request','info','VtigerField,\x20%s,\x20%s','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','error','code','message','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x21974f,_0x3c5749){var _0xb485bf=function(_0x1fba70){while(--_0x1fba70){_0x21974f['push'](_0x21974f['shift']());}};_0xb485bf(++_0x3c5749);}(_0x0241,0x65));var _0x1024=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x0241[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x1024('0x0'));var util=require('util');var moment=require(_0x1024('0x1'));var BPromise=require(_0x1024('0x2'));var rs=require(_0x1024('0x3'));var fs=require('fs');var Redis=require(_0x1024('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1024('0x5'));var logger=require(_0x1024('0x6'))(_0x1024('0x7'));var config=require(_0x1024('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1024('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d2ae0,_0x3dcfc3,_0x2cd22f){return new BPromise(function(_0x5c3ee8,_0x556a04){return client[_0x1024('0xa')](_0x4d2ae0,_0x2cd22f)['then'](function(_0x4b8860){logger[_0x1024('0xb')](_0x1024('0xc'),_0x3dcfc3,_0x1024('0xd'));logger['debug'](_0x1024('0xe'),_0x3dcfc3,_0x1024('0xd'),JSON['stringify'](_0x4b8860));if(_0x4b8860[_0x1024('0xf')]){if(_0x4b8860[_0x1024('0xf')][_0x1024('0x10')]===0x1f4){logger['error'](_0x1024('0xc'),_0x3dcfc3,_0x4b8860['error']['message']);return _0x556a04(_0x4b8860[_0x1024('0xf')][_0x1024('0x11')]);}logger[_0x1024('0xf')](_0x1024('0xc'),_0x3dcfc3,_0x4b8860[_0x1024('0xf')][_0x1024('0x11')]);return _0x5c3ee8(_0x4b8860[_0x1024('0xf')][_0x1024('0x11')]);}else{logger[_0x1024('0xb')]('VtigerField,\x20%s,\x20%s',_0x3dcfc3,_0x1024('0xd'));_0x5c3ee8(_0x4b8860['result'][_0x1024('0x11')]);}})['catch'](function(_0x5e7022){logger[_0x1024('0xf')](_0x1024('0xc'),_0x3dcfc3,_0x5e7022);_0x556a04(_0x5e7022);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 4da73e8..6115cdc 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 _0x0007=['isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskAccount.controller','get'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x0007,0x1ee));var _0x7000=function(_0x574ce3,_0x59eef4){_0x574ce3=_0x574ce3-0x0;var _0x3447a0=_0x0007[_0x574ce3];return _0x3447a0;};'use strict';var multer=require(_0x7000('0x0'));var util=require(_0x7000('0x1'));var path=require(_0x7000('0x2'));var timeout=require('connect-timeout');var express=require(_0x7000('0x3'));var router=express[_0x7000('0x4')]();var fs_extra=require(_0x7000('0x5'));var auth=require(_0x7000('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7000('0x7'));var controller=require(_0x7000('0x8'));router[_0x7000('0x9')]('/',auth[_0x7000('0xa')](),controller[_0x7000('0xb')]);router[_0x7000('0x9')](_0x7000('0xc'),auth['isAuthenticated'](),controller[_0x7000('0xd')]);router[_0x7000('0x9')](_0x7000('0xe'),auth[_0x7000('0xa')](),controller[_0x7000('0xf')]);router[_0x7000('0x9')]('/:id/fields',auth[_0x7000('0xa')](),controller[_0x7000('0x10')]);router[_0x7000('0x11')]('/',auth[_0x7000('0xa')](),controller[_0x7000('0x12')]);router[_0x7000('0x11')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x7000('0x13')]);router[_0x7000('0x14')](_0x7000('0xc'),auth['isAuthenticated'](),controller[_0x7000('0x15')]);router[_0x7000('0x16')]('/:id',auth[_0x7000('0xa')](),controller[_0x7000('0x17')]);module['exports']=router; \ No newline at end of file +var _0x158e=['../../config/environment','./intZendeskAccount.controller','get','/:id','show','/:id/configurations','isAuthenticated','/:id/fields','post','put','update','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x158e,0x72));var _0xe158=function(_0x1c3b96,_0x47cb28){_0x1c3b96=_0x1c3b96-0x0;var _0x40a34d=_0x158e[_0x1c3b96];return _0x40a34d;};'use strict';var multer=require(_0xe158('0x0'));var util=require(_0xe158('0x1'));var path=require(_0xe158('0x2'));var timeout=require('connect-timeout');var express=require(_0xe158('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe158('0x4'));var interaction=require(_0xe158('0x5'));var config=require(_0xe158('0x6'));var controller=require(_0xe158('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xe158('0x8')](_0xe158('0x9'),auth['isAuthenticated'](),controller[_0xe158('0xa')]);router[_0xe158('0x8')](_0xe158('0xb'),auth[_0xe158('0xc')](),controller['getConfigurations']);router[_0xe158('0x8')](_0xe158('0xd'),auth['isAuthenticated'](),controller['getFields']);router[_0xe158('0xe')]('/',auth[_0xe158('0xc')](),controller['create']);router[_0xe158('0xe')](_0xe158('0xb'),auth[_0xe158('0xc')](),controller['addConfiguration']);router[_0xe158('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xe158('0x10')]);router[_0xe158('0x11')](_0xe158('0x9'),auth[_0xe158('0xc')](),controller[_0xe158('0x12')]);module[_0xe158('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index b8060c8..eb1fc8b 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 _0x1623=['password','integrationTab','newTab','sequelize','STRING','username','ENUM','token'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1623,0xab));var _0x3162=function(_0x8aced0,_0x33103a){_0x8aced0=_0x8aced0-0x0;var _0x53e205=_0x1623[_0x8aced0];return _0x53e205;};'use strict';var Sequelize=require(_0x3162('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3162('0x1')]},'username':{'type':Sequelize[_0x3162('0x1')],'unique':_0x3162('0x2')},'password':{'type':Sequelize[_0x3162('0x1')]},'token':{'type':Sequelize[_0x3162('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x3162('0x3')]('password',_0x3162('0x4')),'defaultValue':_0x3162('0x5')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x3162('0x3')](_0x3162('0x6'),_0x3162('0x7')),'defaultValue':_0x3162('0x6')}}; \ No newline at end of file +var _0x1261=['ENUM','password','integrationTab','newTab','exports','STRING','username','remoteUri'];(function(_0x2e1be4,_0x4884c2){var _0x1347b6=function(_0x535c54){while(--_0x535c54){_0x2e1be4['push'](_0x2e1be4['shift']());}};_0x1347b6(++_0x4884c2);}(_0x1261,0x144));var _0x1126=function(_0x104b35,_0x13f218){_0x104b35=_0x104b35-0x0;var _0x55584d=_0x1261[_0x104b35];return _0x55584d;};'use strict';var Sequelize=require('sequelize');module[_0x1126('0x0')]={'name':{'type':Sequelize[_0x1126('0x1')]},'description':{'type':Sequelize[_0x1126('0x1')]},'username':{'type':Sequelize[_0x1126('0x1')],'unique':_0x1126('0x2')},'password':{'type':Sequelize[_0x1126('0x1')]},'token':{'type':Sequelize[_0x1126('0x1')]},'remoteUri':{'type':Sequelize[_0x1126('0x1')],'unique':_0x1126('0x3')},'authType':{'type':Sequelize[_0x1126('0x4')]('password','token'),'defaultValue':_0x1126('0x5')},'serverUrl':{'type':Sequelize[_0x1126('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x1126('0x6'),_0x1126('0x7')),'defaultValue':_0x1126('0x6')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 223deb9..4e62d9e 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 _0x4cf8=['sort','where','pick','filter','merge','VIRTUAL','include','rows','catch','params','options','find','create','body','ZendeskConfiguration','fields','getConfigurations','nolimit','findOne','Subjects','channel','ZendeskField','username','password','token','authType','remoteUri','slice','substring','format','ticket_fields','headers','Basic\x20%s','base64','toString','Unknown\x20authentication\x20type','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','ZendeskAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','order'];(function(_0x27f614,_0x2b0fdc){var _0x533fe0=function(_0x2f42f5){while(--_0x2f42f5){_0x27f614['push'](_0x27f614['shift']());}};_0x533fe0(++_0x2b0fdc);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x51e79c,_0x51485e){_0x51e79c=_0x51e79c-0x0;var _0x2467be=_0x4cf8[_0x51e79c];return _0x2467be;};'use strict';var emlformat=require(_0x84cf('0x0'));var rimraf=require(_0x84cf('0x1'));var zipdir=require(_0x84cf('0x2'));var jsonpatch=require(_0x84cf('0x3'));var rp=require(_0x84cf('0x4'));var moment=require(_0x84cf('0x5'));var BPromise=require(_0x84cf('0x6'));var Mustache=require(_0x84cf('0x7'));var util=require(_0x84cf('0x8'));var path=require(_0x84cf('0x9'));var sox=require(_0x84cf('0xa'));var csv=require(_0x84cf('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x84cf('0xc'));var squel=require('squel');var crypto=require(_0x84cf('0xd'));var jsforce=require(_0x84cf('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x84cf('0xb'));var querystring=require(_0x84cf('0xf'));var Papa=require('papaparse');var Redis=require(_0x84cf('0x10'));var authService=require(_0x84cf('0x11'));var qs=require(_0x84cf('0x12'));var as=require(_0x84cf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x84cf('0x14'))(_0x84cf('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x84cf('0x16'));var db=require(_0x84cf('0x17'))['db'];var integrations=require(_0x84cf('0x18'));function respondWithStatusCode(_0x33f83e,_0x172d04){_0x172d04=_0x172d04||0xcc;return function(_0x214ca0){if(_0x214ca0){return _0x33f83e[_0x84cf('0x19')](_0x172d04);}return _0x33f83e[_0x84cf('0x1a')](_0x172d04)[_0x84cf('0x1b')]();};}function respondWithResult(_0x250a19,_0x2fc41f){_0x2fc41f=_0x2fc41f||0xc8;return function(_0x385027){if(_0x385027){return _0x250a19[_0x84cf('0x1a')](_0x2fc41f)[_0x84cf('0x1c')](_0x385027);}};}function respondWithFilteredResult(_0x27261b,_0x167c3e){return function(_0x464e70){if(_0x464e70){var _0x240edf=typeof _0x167c3e[_0x84cf('0x1d')]==='undefined'&&typeof _0x167c3e[_0x84cf('0x1e')]===_0x84cf('0x1f');var _0xfa6641=_0x464e70[_0x84cf('0x20')];var _0x1dad1a=_0x240edf?0x0:_0x167c3e[_0x84cf('0x1d')];var _0xe6b5b6=_0x240edf?_0x464e70['count']:_0x167c3e['offset']+_0x167c3e[_0x84cf('0x1e')];var _0x1990c7;if(_0xe6b5b6>=_0xfa6641){_0xe6b5b6=_0xfa6641;_0x1990c7=0xc8;}else{_0x1990c7=0xce;}_0x27261b[_0x84cf('0x1a')](_0x1990c7);return _0x27261b[_0x84cf('0x21')](_0x84cf('0x22'),_0x1dad1a+'-'+_0xe6b5b6+'/'+_0xfa6641)['json'](_0x464e70);}return null;};}function patchUpdates(_0x39a37b){return function(_0x448b5d){try{jsonpatch[_0x84cf('0x23')](_0x448b5d,_0x39a37b,!![]);}catch(_0x33b72e){return BPromise[_0x84cf('0x24')](_0x33b72e);}return _0x448b5d['save']();};}function saveUpdates(_0x42fa45,_0x160f86){return function(_0x475b19){if(_0x475b19){return _0x475b19[_0x84cf('0x25')](_0x42fa45)[_0x84cf('0x26')](function(_0x29e9e1){return _0x29e9e1;});}return null;};}function removeEntity(_0x7feb4,_0x4c9d1c){return function(_0x2b2c90){if(_0x2b2c90){return _0x2b2c90[_0x84cf('0x27')]()[_0x84cf('0x26')](function(){_0x7feb4[_0x84cf('0x1a')](0xcc)[_0x84cf('0x1b')]();});}};}function handleEntityNotFound(_0x44d4bf,_0x3c7eda){return function(_0xa44c81){if(!_0xa44c81){_0x44d4bf[_0x84cf('0x19')](0x194);}return _0xa44c81;};}function handleError(_0x6797c0,_0x5179c1){_0x5179c1=_0x5179c1||0x1f4;return function(_0x83f20b){logger[_0x84cf('0x28')](_0x83f20b[_0x84cf('0x29')]);if(_0x83f20b[_0x84cf('0x2a')]){delete _0x83f20b['name'];}_0x6797c0[_0x84cf('0x1a')](_0x5179c1)['send'](_0x83f20b);};}exports[_0x84cf('0x2b')]=function(_0x4092fd,_0x43b41b){var _0xc15298={},_0x51adcf={},_0x20de4b={'count':0x0,'rows':[]};var _0x2e4653=_[_0x84cf('0x2c')](db[_0x84cf('0x2d')][_0x84cf('0x2e')],function(_0x31dbf5){return{'name':_0x31dbf5[_0x84cf('0x2f')],'type':_0x31dbf5[_0x84cf('0x30')][_0x84cf('0x31')]};});_0x51adcf['model']=_['map'](_0x2e4653,_0x84cf('0x2a'));_0x51adcf[_0x84cf('0x32')]=_[_0x84cf('0x33')](_0x4092fd[_0x84cf('0x32')]);_0x51adcf[_0x84cf('0x34')]=_[_0x84cf('0x35')](_0x51adcf[_0x84cf('0x36')],_0x51adcf[_0x84cf('0x32')]);_0xc15298['attributes']=_[_0x84cf('0x35')](_0x51adcf[_0x84cf('0x36')],qs['fields'](_0x4092fd[_0x84cf('0x32')]['fields']));_0xc15298[_0x84cf('0x37')]=_0xc15298[_0x84cf('0x37')][_0x84cf('0x38')]?_0xc15298[_0x84cf('0x37')]:_0x51adcf[_0x84cf('0x36')];if(!_0x4092fd['query'][_0x84cf('0x39')]('nolimit')){_0xc15298['limit']=qs[_0x84cf('0x1e')](_0x4092fd[_0x84cf('0x32')]['limit']);_0xc15298[_0x84cf('0x1d')]=qs[_0x84cf('0x1d')](_0x4092fd[_0x84cf('0x32')][_0x84cf('0x1d')]);}_0xc15298[_0x84cf('0x3a')]=qs[_0x84cf('0x3b')](_0x4092fd['query'][_0x84cf('0x3b')]);_0xc15298[_0x84cf('0x3c')]=qs[_0x84cf('0x34')](_[_0x84cf('0x3d')](_0x4092fd[_0x84cf('0x32')],_0x51adcf[_0x84cf('0x34')]),_0x2e4653);if(_0x4092fd['query'][_0x84cf('0x3e')]){_0xc15298['where']=_[_0x84cf('0x3f')](_0xc15298[_0x84cf('0x3c')],{'$or':_[_0x84cf('0x2c')](_0x2e4653,function(_0x373d62){if(_0x373d62[_0x84cf('0x30')]!==_0x84cf('0x40')){var _0x263ceb={};_0x263ceb[_0x373d62[_0x84cf('0x2a')]]={'$like':'%'+_0x4092fd[_0x84cf('0x32')]['filter']+'%'};return _0x263ceb;}})});}_0xc15298=_[_0x84cf('0x3f')]({},_0xc15298,_0x4092fd['options']);var _0xfb50c1={'where':_0xc15298[_0x84cf('0x3c')]};return db['ZendeskAccount'][_0x84cf('0x20')](_0xfb50c1)['then'](function(_0x3b248a){_0x20de4b['count']=_0x3b248a;if(_0x4092fd[_0x84cf('0x32')]['includeAll']){_0xc15298[_0x84cf('0x41')]=[{'all':!![]}];}return db[_0x84cf('0x2d')]['findAll'](_0xc15298);})[_0x84cf('0x26')](function(_0x426ddb){_0x20de4b[_0x84cf('0x42')]=_0x426ddb;return _0x20de4b;})['then'](respondWithFilteredResult(_0x43b41b,_0xc15298))[_0x84cf('0x43')](handleError(_0x43b41b,null));};exports['show']=function(_0x1c84e0,_0x58b539){var _0x56b0e5={'raw':![],'where':{'id':_0x1c84e0[_0x84cf('0x44')]['id']}},_0x59c4d7={};_0x59c4d7[_0x84cf('0x36')]=_['keys'](db[_0x84cf('0x2d')]['rawAttributes']);_0x59c4d7[_0x84cf('0x32')]=_[_0x84cf('0x33')](_0x1c84e0['query']);_0x59c4d7[_0x84cf('0x34')]=_['intersection'](_0x59c4d7[_0x84cf('0x36')],_0x59c4d7['query']);_0x56b0e5['attributes']=_['intersection'](_0x59c4d7['model'],qs['fields'](_0x1c84e0['query']['fields']));_0x56b0e5[_0x84cf('0x37')]=_0x56b0e5[_0x84cf('0x37')][_0x84cf('0x38')]?_0x56b0e5[_0x84cf('0x37')]:_0x59c4d7['model'];if(_0x1c84e0[_0x84cf('0x32')]['includeAll']){_0x56b0e5[_0x84cf('0x41')]=[{'all':!![]}];}_0x56b0e5=_[_0x84cf('0x3f')]({},_0x56b0e5,_0x1c84e0[_0x84cf('0x45')]);return db[_0x84cf('0x2d')][_0x84cf('0x46')](_0x56b0e5)[_0x84cf('0x26')](handleEntityNotFound(_0x58b539,null))['then'](respondWithResult(_0x58b539,null))[_0x84cf('0x43')](handleError(_0x58b539,null));};exports[_0x84cf('0x47')]=function(_0x4a4cf7,_0xb2b8ae){return db[_0x84cf('0x2d')][_0x84cf('0x47')](_0x4a4cf7['body'],{})['then'](respondWithResult(_0xb2b8ae,0xc9))['catch'](handleError(_0xb2b8ae,null));};exports[_0x84cf('0x25')]=function(_0x104421,_0x25d4f8){if(_0x104421[_0x84cf('0x48')]['id']){delete _0x104421[_0x84cf('0x48')]['id'];}return db[_0x84cf('0x2d')]['find']({'where':{'id':_0x104421[_0x84cf('0x44')]['id']}})['then'](handleEntityNotFound(_0x25d4f8,null))[_0x84cf('0x26')](saveUpdates(_0x104421['body'],null))['then'](respondWithResult(_0x25d4f8,null))[_0x84cf('0x43')](handleError(_0x25d4f8,null));};exports[_0x84cf('0x27')]=function(_0x426df1,_0x55e24e){return db['ZendeskAccount'][_0x84cf('0x46')]({'where':{'id':_0x426df1[_0x84cf('0x44')]['id']}})[_0x84cf('0x26')](handleEntityNotFound(_0x55e24e,null))[_0x84cf('0x26')](removeEntity(_0x55e24e,null))[_0x84cf('0x43')](handleError(_0x55e24e,null));};exports['getConfigurations']=function(_0xcfe28f,_0x225fc2,_0x5e4af1){var _0x33145e={};var _0x5baea8={};var _0x4fd496;var _0x147194;return db[_0x84cf('0x2d')]['findOne']({'where':{'id':_0xcfe28f['params']['id']}})[_0x84cf('0x26')](handleEntityNotFound(_0x225fc2,null))[_0x84cf('0x26')](function(_0x2f739a){if(_0x2f739a){_0x4fd496=_0x2f739a;_0x5baea8[_0x84cf('0x36')]=_[_0x84cf('0x33')](db[_0x84cf('0x49')][_0x84cf('0x2e')]);_0x5baea8[_0x84cf('0x32')]=_['keys'](_0xcfe28f[_0x84cf('0x32')]);_0x5baea8[_0x84cf('0x34')]=_['intersection'](_0x5baea8['model'],_0x5baea8[_0x84cf('0x32')]);_0x33145e[_0x84cf('0x37')]=_[_0x84cf('0x35')](_0x5baea8[_0x84cf('0x36')],qs[_0x84cf('0x4a')](_0xcfe28f[_0x84cf('0x32')][_0x84cf('0x4a')]));_0x33145e['attributes']=_0x33145e[_0x84cf('0x37')]['length']?_0x33145e[_0x84cf('0x37')]:_0x5baea8['model'];_0x33145e[_0x84cf('0x3a')]=qs[_0x84cf('0x3b')](_0xcfe28f['query'][_0x84cf('0x3b')]);_0x33145e[_0x84cf('0x3c')]=qs['filters'](_[_0x84cf('0x3d')](_0xcfe28f['query'],_0x5baea8['filters']));if(_0xcfe28f['query']['filter']){_0x33145e[_0x84cf('0x3c')]=_[_0x84cf('0x3f')](_0x33145e[_0x84cf('0x3c')],{'$or':_[_0x84cf('0x2c')](_0x33145e['attributes'],function(_0x32aa8b){var _0x3c1c55={};_0x3c1c55[_0x32aa8b]={'$like':'%'+_0xcfe28f['query'][_0x84cf('0x3e')]+'%'};return _0x3c1c55;})});}_0x33145e=_[_0x84cf('0x3f')]({},_0x33145e,_0xcfe28f[_0x84cf('0x45')]);return _0x4fd496[_0x84cf('0x4b')](_0x33145e);}})[_0x84cf('0x26')](function(_0x273711){if(_0x273711){_0x147194=_0x273711[_0x84cf('0x38')];if(!_0xcfe28f[_0x84cf('0x32')]['hasOwnProperty'](_0x84cf('0x4c'))){_0x33145e['limit']=qs[_0x84cf('0x1e')](_0xcfe28f[_0x84cf('0x32')][_0x84cf('0x1e')]);_0x33145e[_0x84cf('0x1d')]=qs[_0x84cf('0x1d')](_0xcfe28f['query'][_0x84cf('0x1d')]);}return _0x4fd496[_0x84cf('0x4b')](_0x33145e);}})[_0x84cf('0x26')](function(_0x4ebb4b){if(_0x4ebb4b){return _0x4ebb4b?{'count':_0x147194,'rows':_0x4ebb4b}:null;}})[_0x84cf('0x26')](respondWithResult(_0x225fc2,null))[_0x84cf('0x43')](handleError(_0x225fc2,null));};exports['addConfiguration']=function(_0x84d9cb,_0x482958,_0x26f8d4){if(_0x84d9cb[_0x84cf('0x48')]['id']){delete _0x84d9cb['body']['id'];}return db[_0x84cf('0x2d')][_0x84cf('0x4d')]({'where':{'id':_0x84d9cb['params']['id']}})[_0x84cf('0x26')](handleEntityNotFound(_0x482958,null))[_0x84cf('0x26')](function(_0x262ae1){if(_0x262ae1){_0x84d9cb[_0x84cf('0x48')]['AccountId']=_0x262ae1['id'];_0x84d9cb[_0x84cf('0x48')][_0x84cf('0x4e')]=integrations['getSubjects'](_0x84d9cb['body']['channel'],_0x84d9cb[_0x84cf('0x48')][_0x84cf('0x30')]);_0x84d9cb[_0x84cf('0x48')]['Descriptions']=integrations['getDescriptions'](_0x84d9cb[_0x84cf('0x48')][_0x84cf('0x4f')],_0x84d9cb[_0x84cf('0x48')][_0x84cf('0x30')]);return db[_0x84cf('0x49')][_0x84cf('0x47')](_0x84d9cb[_0x84cf('0x48')],{'include':[{'model':db[_0x84cf('0x50')],'as':'Subjects'},{'model':db[_0x84cf('0x50')],'as':'Descriptions'}]});}return null;})[_0x84cf('0x26')](respondWithResult(_0x482958,null))[_0x84cf('0x43')](handleError(_0x482958,null));};exports['getFields']=function(_0x5b154a,_0x282c17,_0x31e622){var _0x373a25='';return db[_0x84cf('0x2d')][_0x84cf('0x4d')]({'where':{'id':_0x5b154a['params']['id']},'attributes':['id',_0x84cf('0x51'),_0x84cf('0x52'),_0x84cf('0x53'),_0x84cf('0x54'),'remoteUri']})[_0x84cf('0x26')](handleEntityNotFound(_0x282c17,null))['then'](function(_0x4bfa38){if(_0x4bfa38){_0x373a25=_0x4bfa38[_0x84cf('0x55')];var _0x292202=_0x373a25[_0x84cf('0x56')](-0x1);if(_0x292202==='/'){_0x373a25=_0x373a25[_0x84cf('0x57')](0x0,_0x373a25['lastIndexOf'](_0x292202));}var _0x5c8e79={'method':'GET','uri':util[_0x84cf('0x58')]('%s/%s',_0x373a25,_0x84cf('0x59')),'json':!![]};switch(_0x4bfa38[_0x84cf('0x54')]){case _0x84cf('0x52'):_0x5c8e79[_0x84cf('0x5a')]={'Authorization':util['format'](_0x84cf('0x5b'),new Buffer(util[_0x84cf('0x58')]('%s:%s',_0x4bfa38[_0x84cf('0x51')],_0x4bfa38['password']))['toString'](_0x84cf('0x5c')))};break;case _0x84cf('0x53'):_0x5c8e79['headers']={'Authorization':util['format'](_0x84cf('0x5b'),new Buffer(util['format']('%s/token:%s',_0x4bfa38['username'],_0x4bfa38[_0x84cf('0x53')]))[_0x84cf('0x5d')](_0x84cf('0x5c')))};break;default:throw new db['Sequelize']['ValidationError'](_0x84cf('0x5e'));}return rp(_0x5c8e79);}})[_0x84cf('0x26')](function(_0x4393a0){if(_0x4393a0){var _0x4686e2=['subject','description','group',_0x84cf('0x5f')];_[_0x84cf('0x60')](_0x4393a0[_0x84cf('0x59')],function(_0x4fc2f2){return _0x4686e2[_0x84cf('0x61')](_0x4fc2f2[_0x84cf('0x30')]);});return{'count':_0x4393a0[_0x84cf('0x59')][_0x84cf('0x38')],'rows':_[_0x84cf('0x2c')](_0x4393a0['ticket_fields'],function(_0x1ffa84){return{'id':_0x1ffa84['id'],'name':_0x1ffa84[_0x84cf('0x62')]>0x7?_0x1ffa84[_0x84cf('0x63')]:_0x1ffa84['type'],'custom':_0x1ffa84[_0x84cf('0x62')]>0x7?!![]:![],'options':_0x1ffa84[_0x84cf('0x64')]?_0x1ffa84['system_field_options']:_0x1ffa84[_0x84cf('0x65')]?_0x1ffa84[_0x84cf('0x65')]:[]};})};}})[_0x84cf('0x26')](respondWithResult(_0x282c17,null))[_0x84cf('0x43')](function(_0x538a77){var _0x4f1fbb=_0x5b154a[_0x84cf('0x32')][_0x84cf('0x66')]?0x1f4:_0x538a77['statusCode']||0x1f4;logger['error'](_0x84cf('0x67'),_0x84cf('0x68'),_0x4f1fbb,JSON[_0x84cf('0x69')](_0x538a77));delete _0x538a77[_0x84cf('0x2a')];if(_0x4f1fbb===0x191){_0x4f1fbb=0x190;}_0x282c17[_0x84cf('0x1a')](_0x4f1fbb)[_0x84cf('0x6a')](_0x5b154a[_0x84cf('0x32')][_0x84cf('0x66')]?{'message':'Wrong\x20credentials','statusCode':_0x538a77[_0x84cf('0x6b')]}:_0x538a77);});}; \ No newline at end of file +var _0xf290=['fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','set','Content-Range','update','then','destroy','sendStatus','send','ZendeskAccount','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','name','options','count','include','findAll','rows','catch','show','params','keys','rawAttributes','length','includeAll','create','body','find','getConfigurations','findOne','nolimit','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','username','authType','remoteUri','lastIndexOf','%s/%s','password','headers','format','%s:%s','toString','token','Basic\x20%s','%s/token:%s','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','includes','ticket_fields','position','title','system_field_options','custom_field_options','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv'];(function(_0x274fba,_0x176c9c){var _0x29e13e=function(_0x163e5f){while(--_0x163e5f){_0x274fba['push'](_0x274fba['shift']());}};_0x29e13e(++_0x176c9c);}(_0xf290,0xde));var _0x0f29=function(_0x3ed054,_0x4d4f16){_0x3ed054=_0x3ed054-0x0;var _0x16dd95=_0xf290[_0x3ed054];return _0x16dd95;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0f29('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0f29('0x1'));var rp=require('request-promise');var moment=require(_0x0f29('0x2'));var BPromise=require(_0x0f29('0x3'));var Mustache=require(_0x0f29('0x4'));var util=require(_0x0f29('0x5'));var path=require(_0x0f29('0x6'));var sox=require('sox');var csv=require(_0x0f29('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0f29('0x8'));var _=require(_0x0f29('0x9'));var squel=require(_0x0f29('0xa'));var crypto=require(_0x0f29('0xb'));var jsforce=require(_0x0f29('0xc'));var deskjs=require(_0x0f29('0xd'));var toCsv=require(_0x0f29('0x7'));var querystring=require(_0x0f29('0xe'));var Papa=require(_0x0f29('0xf'));var Redis=require(_0x0f29('0x10'));var authService=require(_0x0f29('0x11'));var qs=require(_0x0f29('0x12'));var as=require(_0x0f29('0x13'));var hardwareService=require(_0x0f29('0x14'));var logger=require(_0x0f29('0x15'))('api');var utils=require(_0x0f29('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0f29('0x17'));var db=require(_0x0f29('0x18'))['db'];var integrations=require(_0x0f29('0x19'));function respondWithStatusCode(_0x222c42,_0x195424){_0x195424=_0x195424||0xcc;return function(_0x2d2573){if(_0x2d2573){return _0x222c42['sendStatus'](_0x195424);}return _0x222c42[_0x0f29('0x1a')](_0x195424)[_0x0f29('0x1b')]();};}function respondWithResult(_0x2bb7b8,_0x368984){_0x368984=_0x368984||0xc8;return function(_0x234856){if(_0x234856){return _0x2bb7b8[_0x0f29('0x1a')](_0x368984)[_0x0f29('0x1c')](_0x234856);}};}function respondWithFilteredResult(_0x69df36,_0x547404){return function(_0x4ac37d){if(_0x4ac37d){var _0x2be27f=typeof _0x547404[_0x0f29('0x1d')]===_0x0f29('0x1e')&&typeof _0x547404[_0x0f29('0x1f')]==='undefined';var _0x122bfa=_0x4ac37d['count'];var _0x17b994=_0x2be27f?0x0:_0x547404['offset'];var _0x5ddc74=_0x2be27f?_0x4ac37d['count']:_0x547404[_0x0f29('0x1d')]+_0x547404[_0x0f29('0x1f')];var _0x13e8ff;if(_0x5ddc74>=_0x122bfa){_0x5ddc74=_0x122bfa;_0x13e8ff=0xc8;}else{_0x13e8ff=0xce;}_0x69df36[_0x0f29('0x1a')](_0x13e8ff);return _0x69df36[_0x0f29('0x20')](_0x0f29('0x21'),_0x17b994+'-'+_0x5ddc74+'/'+_0x122bfa)[_0x0f29('0x1c')](_0x4ac37d);}return null;};}function patchUpdates(_0x4888b6){return function(_0x49d954){try{jsonpatch['apply'](_0x49d954,_0x4888b6,!![]);}catch(_0x5ab592){return BPromise['reject'](_0x5ab592);}return _0x49d954['save']();};}function saveUpdates(_0x38a1ce,_0x4a9dd8){return function(_0x563d15){if(_0x563d15){return _0x563d15[_0x0f29('0x22')](_0x38a1ce)[_0x0f29('0x23')](function(_0x346db8){return _0x346db8;});}return null;};}function removeEntity(_0x3402dc,_0x29ca73){return function(_0x568ad9){if(_0x568ad9){return _0x568ad9[_0x0f29('0x24')]()['then'](function(){_0x3402dc[_0x0f29('0x1a')](0xcc)[_0x0f29('0x1b')]();});}};}function handleEntityNotFound(_0x23c09e,_0x28cfaa){return function(_0x57667b){if(!_0x57667b){_0x23c09e[_0x0f29('0x25')](0x194);}return _0x57667b;};}function handleError(_0x540d72,_0x58b201){_0x58b201=_0x58b201||0x1f4;return function(_0x92876){logger['error'](_0x92876['stack']);if(_0x92876['name']){delete _0x92876['name'];}_0x540d72[_0x0f29('0x1a')](_0x58b201)[_0x0f29('0x26')](_0x92876);};}exports['index']=function(_0x1fc4fd,_0x2ab528){var _0x274c9d={},_0x51e7dc={},_0x56e729={'count':0x0,'rows':[]};var _0x37ebcc=_['map'](db[_0x0f29('0x27')]['rawAttributes'],function(_0x526364){return{'name':_0x526364[_0x0f29('0x28')],'type':_0x526364[_0x0f29('0x29')][_0x0f29('0x2a')]};});_0x51e7dc[_0x0f29('0x2b')]=_['map'](_0x37ebcc,'name');_0x51e7dc[_0x0f29('0x2c')]=_['keys'](_0x1fc4fd['query']);_0x51e7dc[_0x0f29('0x2d')]=_['intersection'](_0x51e7dc[_0x0f29('0x2b')],_0x51e7dc['query']);_0x274c9d['attributes']=_[_0x0f29('0x2e')](_0x51e7dc[_0x0f29('0x2b')],qs[_0x0f29('0x2f')](_0x1fc4fd[_0x0f29('0x2c')][_0x0f29('0x2f')]));_0x274c9d['attributes']=_0x274c9d[_0x0f29('0x30')]['length']?_0x274c9d[_0x0f29('0x30')]:_0x51e7dc[_0x0f29('0x2b')];if(!_0x1fc4fd[_0x0f29('0x2c')][_0x0f29('0x31')]('nolimit')){_0x274c9d[_0x0f29('0x1f')]=qs[_0x0f29('0x1f')](_0x1fc4fd['query'][_0x0f29('0x1f')]);_0x274c9d[_0x0f29('0x1d')]=qs['offset'](_0x1fc4fd['query'][_0x0f29('0x1d')]);}_0x274c9d[_0x0f29('0x32')]=qs[_0x0f29('0x33')](_0x1fc4fd[_0x0f29('0x2c')][_0x0f29('0x33')]);_0x274c9d[_0x0f29('0x34')]=qs['filters'](_[_0x0f29('0x35')](_0x1fc4fd['query'],_0x51e7dc[_0x0f29('0x2d')]),_0x37ebcc);if(_0x1fc4fd['query'][_0x0f29('0x36')]){_0x274c9d[_0x0f29('0x34')]=_[_0x0f29('0x37')](_0x274c9d['where'],{'$or':_['map'](_0x37ebcc,function(_0x16a9eb){if(_0x16a9eb['type']!==_0x0f29('0x38')){var _0x3f49f8={};_0x3f49f8[_0x16a9eb[_0x0f29('0x39')]]={'$like':'%'+_0x1fc4fd[_0x0f29('0x2c')][_0x0f29('0x36')]+'%'};return _0x3f49f8;}})});}_0x274c9d=_['merge']({},_0x274c9d,_0x1fc4fd[_0x0f29('0x3a')]);var _0xf77c66={'where':_0x274c9d[_0x0f29('0x34')]};return db[_0x0f29('0x27')][_0x0f29('0x3b')](_0xf77c66)[_0x0f29('0x23')](function(_0xac4fb2){_0x56e729[_0x0f29('0x3b')]=_0xac4fb2;if(_0x1fc4fd[_0x0f29('0x2c')]['includeAll']){_0x274c9d[_0x0f29('0x3c')]=[{'all':!![]}];}return db[_0x0f29('0x27')][_0x0f29('0x3d')](_0x274c9d);})[_0x0f29('0x23')](function(_0x504908){_0x56e729[_0x0f29('0x3e')]=_0x504908;return _0x56e729;})[_0x0f29('0x23')](respondWithFilteredResult(_0x2ab528,_0x274c9d))[_0x0f29('0x3f')](handleError(_0x2ab528,null));};exports[_0x0f29('0x40')]=function(_0x185493,_0x56062d){var _0x410c59={'raw':![],'where':{'id':_0x185493[_0x0f29('0x41')]['id']}},_0x245bf9={};_0x245bf9['model']=_[_0x0f29('0x42')](db[_0x0f29('0x27')][_0x0f29('0x43')]);_0x245bf9[_0x0f29('0x2c')]=_[_0x0f29('0x42')](_0x185493[_0x0f29('0x2c')]);_0x245bf9[_0x0f29('0x2d')]=_[_0x0f29('0x2e')](_0x245bf9['model'],_0x245bf9['query']);_0x410c59['attributes']=_[_0x0f29('0x2e')](_0x245bf9[_0x0f29('0x2b')],qs[_0x0f29('0x2f')](_0x185493[_0x0f29('0x2c')][_0x0f29('0x2f')]));_0x410c59[_0x0f29('0x30')]=_0x410c59['attributes'][_0x0f29('0x44')]?_0x410c59['attributes']:_0x245bf9[_0x0f29('0x2b')];if(_0x185493['query'][_0x0f29('0x45')]){_0x410c59[_0x0f29('0x3c')]=[{'all':!![]}];}_0x410c59=_[_0x0f29('0x37')]({},_0x410c59,_0x185493[_0x0f29('0x3a')]);return db[_0x0f29('0x27')]['find'](_0x410c59)[_0x0f29('0x23')](handleEntityNotFound(_0x56062d,null))[_0x0f29('0x23')](respondWithResult(_0x56062d,null))[_0x0f29('0x3f')](handleError(_0x56062d,null));};exports['create']=function(_0x14b747,_0x563fe2){return db['ZendeskAccount'][_0x0f29('0x46')](_0x14b747[_0x0f29('0x47')],{})[_0x0f29('0x23')](respondWithResult(_0x563fe2,0xc9))[_0x0f29('0x3f')](handleError(_0x563fe2,null));};exports[_0x0f29('0x22')]=function(_0x335435,_0x5e3546){if(_0x335435[_0x0f29('0x47')]['id']){delete _0x335435[_0x0f29('0x47')]['id'];}return db[_0x0f29('0x27')][_0x0f29('0x48')]({'where':{'id':_0x335435[_0x0f29('0x41')]['id']}})[_0x0f29('0x23')](handleEntityNotFound(_0x5e3546,null))[_0x0f29('0x23')](saveUpdates(_0x335435[_0x0f29('0x47')],null))[_0x0f29('0x23')](respondWithResult(_0x5e3546,null))[_0x0f29('0x3f')](handleError(_0x5e3546,null));};exports['destroy']=function(_0x5e4479,_0xa6231e){return db[_0x0f29('0x27')][_0x0f29('0x48')]({'where':{'id':_0x5e4479[_0x0f29('0x41')]['id']}})['then'](handleEntityNotFound(_0xa6231e,null))[_0x0f29('0x23')](removeEntity(_0xa6231e,null))[_0x0f29('0x3f')](handleError(_0xa6231e,null));};exports[_0x0f29('0x49')]=function(_0x30387c,_0xbf8f22,_0x2b3797){var _0x277ced={};var _0x59aeb9={};var _0x17f33;var _0x6c1800;return db[_0x0f29('0x27')][_0x0f29('0x4a')]({'where':{'id':_0x30387c[_0x0f29('0x41')]['id']}})[_0x0f29('0x23')](handleEntityNotFound(_0xbf8f22,null))['then'](function(_0x8c9780){if(_0x8c9780){_0x17f33=_0x8c9780;_0x59aeb9[_0x0f29('0x2b')]=_[_0x0f29('0x42')](db['ZendeskConfiguration'][_0x0f29('0x43')]);_0x59aeb9['query']=_[_0x0f29('0x42')](_0x30387c['query']);_0x59aeb9[_0x0f29('0x2d')]=_[_0x0f29('0x2e')](_0x59aeb9['model'],_0x59aeb9[_0x0f29('0x2c')]);_0x277ced[_0x0f29('0x30')]=_[_0x0f29('0x2e')](_0x59aeb9['model'],qs[_0x0f29('0x2f')](_0x30387c['query'][_0x0f29('0x2f')]));_0x277ced[_0x0f29('0x30')]=_0x277ced['attributes'][_0x0f29('0x44')]?_0x277ced[_0x0f29('0x30')]:_0x59aeb9['model'];_0x277ced[_0x0f29('0x32')]=qs['sort'](_0x30387c[_0x0f29('0x2c')]['sort']);_0x277ced[_0x0f29('0x34')]=qs[_0x0f29('0x2d')](_[_0x0f29('0x35')](_0x30387c['query'],_0x59aeb9[_0x0f29('0x2d')]));if(_0x30387c[_0x0f29('0x2c')][_0x0f29('0x36')]){_0x277ced[_0x0f29('0x34')]=_['merge'](_0x277ced[_0x0f29('0x34')],{'$or':_['map'](_0x277ced[_0x0f29('0x30')],function(_0x5159ac){var _0x1a4c57={};_0x1a4c57[_0x5159ac]={'$like':'%'+_0x30387c[_0x0f29('0x2c')][_0x0f29('0x36')]+'%'};return _0x1a4c57;})});}_0x277ced=_[_0x0f29('0x37')]({},_0x277ced,_0x30387c[_0x0f29('0x3a')]);return _0x17f33[_0x0f29('0x49')](_0x277ced);}})[_0x0f29('0x23')](function(_0x536ab1){if(_0x536ab1){_0x6c1800=_0x536ab1[_0x0f29('0x44')];if(!_0x30387c['query'][_0x0f29('0x31')](_0x0f29('0x4b'))){_0x277ced[_0x0f29('0x1f')]=qs['limit'](_0x30387c[_0x0f29('0x2c')][_0x0f29('0x1f')]);_0x277ced[_0x0f29('0x1d')]=qs[_0x0f29('0x1d')](_0x30387c[_0x0f29('0x2c')]['offset']);}return _0x17f33['getConfigurations'](_0x277ced);}})[_0x0f29('0x23')](function(_0x441fe8){if(_0x441fe8){return _0x441fe8?{'count':_0x6c1800,'rows':_0x441fe8}:null;}})[_0x0f29('0x23')](respondWithResult(_0xbf8f22,null))['catch'](handleError(_0xbf8f22,null));};exports['addConfiguration']=function(_0xebd543,_0x204a27,_0x280433){if(_0xebd543['body']['id']){delete _0xebd543['body']['id'];}return db['ZendeskAccount'][_0x0f29('0x4a')]({'where':{'id':_0xebd543[_0x0f29('0x41')]['id']}})['then'](handleEntityNotFound(_0x204a27,null))[_0x0f29('0x23')](function(_0x1c5eb4){if(_0x1c5eb4){_0xebd543['body'][_0x0f29('0x4c')]=_0x1c5eb4['id'];_0xebd543['body'][_0x0f29('0x4d')]=integrations[_0x0f29('0x4e')](_0xebd543['body'][_0x0f29('0x4f')],_0xebd543[_0x0f29('0x47')][_0x0f29('0x29')]);_0xebd543[_0x0f29('0x47')][_0x0f29('0x50')]=integrations[_0x0f29('0x51')](_0xebd543['body'][_0x0f29('0x4f')],_0xebd543[_0x0f29('0x47')][_0x0f29('0x29')]);return db['ZendeskConfiguration'][_0x0f29('0x46')](_0xebd543[_0x0f29('0x47')],{'include':[{'model':db['ZendeskField'],'as':_0x0f29('0x4d')},{'model':db['ZendeskField'],'as':_0x0f29('0x50')}]});}return null;})[_0x0f29('0x23')](respondWithResult(_0x204a27,null))[_0x0f29('0x3f')](handleError(_0x204a27,null));};exports['getFields']=function(_0x3c46d7,_0x1c0cb2,_0x2325cf){var _0x1a7d0c='';return db[_0x0f29('0x27')][_0x0f29('0x4a')]({'where':{'id':_0x3c46d7['params']['id']},'attributes':['id',_0x0f29('0x52'),'password','token',_0x0f29('0x53'),_0x0f29('0x54')]})['then'](handleEntityNotFound(_0x1c0cb2,null))[_0x0f29('0x23')](function(_0x1668a3){if(_0x1668a3){_0x1a7d0c=_0x1668a3['remoteUri'];var _0x5767b3=_0x1a7d0c['slice'](-0x1);if(_0x5767b3==='/'){_0x1a7d0c=_0x1a7d0c['substring'](0x0,_0x1a7d0c[_0x0f29('0x55')](_0x5767b3));}var _0x353472={'method':'GET','uri':util['format'](_0x0f29('0x56'),_0x1a7d0c,'ticket_fields'),'json':!![]};switch(_0x1668a3[_0x0f29('0x53')]){case _0x0f29('0x57'):_0x353472[_0x0f29('0x58')]={'Authorization':util[_0x0f29('0x59')]('Basic\x20%s',new Buffer(util[_0x0f29('0x59')](_0x0f29('0x5a'),_0x1668a3[_0x0f29('0x52')],_0x1668a3[_0x0f29('0x57')]))[_0x0f29('0x5b')]('base64'))};break;case _0x0f29('0x5c'):_0x353472[_0x0f29('0x58')]={'Authorization':util[_0x0f29('0x59')](_0x0f29('0x5d'),new Buffer(util[_0x0f29('0x59')](_0x0f29('0x5e'),_0x1668a3[_0x0f29('0x52')],_0x1668a3[_0x0f29('0x5c')]))[_0x0f29('0x5b')](_0x0f29('0x5f')))};break;default:throw new db[(_0x0f29('0x60'))][(_0x0f29('0x61'))](_0x0f29('0x62'));}return rp(_0x353472);}})[_0x0f29('0x23')](function(_0x46a8c1){if(_0x46a8c1){var _0x58f4cc=[_0x0f29('0x63'),_0x0f29('0x64'),_0x0f29('0x65'),_0x0f29('0x66')];_['remove'](_0x46a8c1['ticket_fields'],function(_0x5c0695){return _0x58f4cc[_0x0f29('0x67')](_0x5c0695[_0x0f29('0x29')]);});return{'count':_0x46a8c1['ticket_fields'][_0x0f29('0x44')],'rows':_['map'](_0x46a8c1[_0x0f29('0x68')],function(_0x5548dd){return{'id':_0x5548dd['id'],'name':_0x5548dd[_0x0f29('0x69')]>0x7?_0x5548dd[_0x0f29('0x6a')]:_0x5548dd[_0x0f29('0x29')],'custom':_0x5548dd['position']>0x7?!![]:![],'options':_0x5548dd[_0x0f29('0x6b')]?_0x5548dd['system_field_options']:_0x5548dd['custom_field_options']?_0x5548dd[_0x0f29('0x6c')]:[]};})};}})['then'](respondWithResult(_0x1c0cb2,null))[_0x0f29('0x3f')](function(_0x2b4390){var _0x55b810=_0x3c46d7[_0x0f29('0x2c')][_0x0f29('0x6d')]?0x1f4:_0x2b4390[_0x0f29('0x6e')]||0x1f4;logger[_0x0f29('0x6f')](_0x0f29('0x70'),_0x0f29('0x71'),_0x55b810,JSON[_0x0f29('0x72')](_0x2b4390));delete _0x2b4390[_0x0f29('0x39')];if(_0x55b810===0x191){_0x55b810=0x190;}_0x1c0cb2['status'](_0x55b810)[_0x0f29('0x26')](_0x3c46d7[_0x0f29('0x2c')][_0x0f29('0x6d')]?{'message':'Wrong\x20credentials','statusCode':_0x2b4390[_0x0f29('0x6e')]}:_0x2b4390);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index e2616cd..aca3cd2 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 _0xaead=['bluebird','request-promise','rimraf','exports','define','ZendeskAccount','int_zendesk_accounts','util','api'];(function(_0xf285c1,_0x420382){var _0x1598a0=function(_0x3e96df){while(--_0x3e96df){_0xf285c1['push'](_0xf285c1['shift']());}};_0x1598a0(++_0x420382);}(_0xaead,0x97));var _0xdaea=function(_0x4c43bc,_0x2a48c7){_0x4c43bc=_0x4c43bc-0x0;var _0x247a74=_0xaead[_0x4c43bc];return _0x247a74;};'use strict';var _=require('lodash');var util=require(_0xdaea('0x0'));var logger=require('../../config/logger')(_0xdaea('0x1'));var moment=require('moment');var BPromise=require(_0xdaea('0x2'));var rp=require(_0xdaea('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdaea('0x4'));var config=require('../../config/environment');var attributes=require('./intZendeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xdaea('0x5')]=function(_0x575663,_0x2bdaa6){return _0x575663[_0xdaea('0x6')](_0xdaea('0x7'),attributes,{'tableName':_0xdaea('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x814f=['exports','int_zendesk_accounts','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration'];(function(_0x840b91,_0x3419a6){var _0x4318f5=function(_0x5def97){while(--_0x5def97){_0x840b91['push'](_0x840b91['shift']());}};_0x4318f5(++_0x3419a6);}(_0x814f,0x178));var _0xf814=function(_0x1f8e23,_0x149b2e){_0x1f8e23=_0x1f8e23-0x0;var _0x7d87c1=_0x814f[_0x1f8e23];return _0x7d87c1;};'use strict';var _=require(_0xf814('0x0'));var util=require(_0xf814('0x1'));var logger=require(_0xf814('0x2'))('api');var moment=require(_0xf814('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf814('0x4'));var rimraf=require(_0xf814('0x5'));var config=require(_0xf814('0x6'));var attributes=require(_0xf814('0x7'));var integrations=require(_0xf814('0x8'));module[_0xf814('0x9')]=function(_0x2e6161,_0x43008a){return _0x2e6161['define']('ZendeskAccount',attributes,{'tableName':_0xf814('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index 061a450..95eac64 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 _0x14e4=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowZendeskAccount','find'];(function(_0x3f9395,_0x1632ab){var _0x469b9e=function(_0x3161b3){while(--_0x3161b3){_0x3f9395['push'](_0x3f9395['shift']());}};_0x469b9e(++_0x1632ab);}(_0x14e4,0x144));var _0x414e=function(_0x21c7b0,_0x1ca2e3){_0x21c7b0=_0x21c7b0-0x0;var _0x2907f1=_0x14e4[_0x21c7b0];return _0x2907f1;};'use strict';var _=require(_0x414e('0x0'));var util=require(_0x414e('0x1'));var moment=require(_0x414e('0x2'));var BPromise=require(_0x414e('0x3'));var rs=require(_0x414e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x414e('0x5'))['db'];var utils=require(_0x414e('0x6'));var logger=require(_0x414e('0x7'))(_0x414e('0x8'));var config=require('../../config/environment');var jayson=require(_0x414e('0x9'));var client=jayson[_0x414e('0xa')][_0x414e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ca803,_0x466fac,_0x2f1da7){return new BPromise(function(_0x540f36,_0x1043a6){return client['request'](_0x4ca803,_0x2f1da7)[_0x414e('0xc')](function(_0x1e291e){logger[_0x414e('0xd')](_0x414e('0xe'),_0x466fac,_0x414e('0xf'));logger[_0x414e('0x10')](_0x414e('0x11'),_0x466fac,_0x414e('0xf'),JSON[_0x414e('0x12')](_0x1e291e));if(_0x1e291e[_0x414e('0x13')]){if(_0x1e291e[_0x414e('0x13')][_0x414e('0x14')]===0x1f4){logger['error'](_0x414e('0xe'),_0x466fac,_0x1e291e[_0x414e('0x13')][_0x414e('0x15')]);return _0x1043a6(_0x1e291e[_0x414e('0x13')][_0x414e('0x15')]);}logger[_0x414e('0x13')](_0x414e('0xe'),_0x466fac,_0x1e291e['error'][_0x414e('0x15')]);return _0x540f36(_0x1e291e[_0x414e('0x13')][_0x414e('0x15')]);}else{logger[_0x414e('0xd')]('ZendeskAccount,\x20%s,\x20%s',_0x466fac,_0x414e('0xf'));_0x540f36(_0x1e291e['result']['message']);}})[_0x414e('0x16')](function(_0x3e7b64){logger[_0x414e('0x13')](_0x414e('0xe'),_0x466fac,_0x3e7b64);_0x1043a6(_0x3e7b64);});});}exports[_0x414e('0x17')]=function(_0xe3420a){var _0x51ef3d=this;return new Promise(function(_0x1a20ed,_0x435c08){return db[_0x414e('0x18')][_0x414e('0x19')]({'raw':_0xe3420a[_0x414e('0x1a')]?_0xe3420a[_0x414e('0x1a')][_0x414e('0x1b')]===undefined?!![]:![]:!![],'where':_0xe3420a[_0x414e('0x1a')]?_0xe3420a['options'][_0x414e('0x1c')]||null:null,'attributes':_0xe3420a['options']?_0xe3420a[_0x414e('0x1a')][_0x414e('0x1d')]||null:null,'limit':_0xe3420a[_0x414e('0x1a')]?_0xe3420a[_0x414e('0x1a')][_0x414e('0x1e')]||null:null,'include':_0xe3420a[_0x414e('0x1a')]?_0xe3420a['options'][_0x414e('0x1f')]?_[_0x414e('0x20')](_0xe3420a[_0x414e('0x1a')][_0x414e('0x1f')],function(_0x45551e){return{'model':db[_0x45551e['model']],'as':_0x45551e['as'],'attributes':_0x45551e[_0x414e('0x1d')],'include':_0x45551e['include']?_[_0x414e('0x20')](_0x45551e[_0x414e('0x1f')],function(_0x2eeaad){return{'model':db[_0x2eeaad['model']],'as':_0x2eeaad['as'],'attributes':_0x2eeaad['attributes'],'include':_0x2eeaad[_0x414e('0x1f')]?_['map'](_0x2eeaad[_0x414e('0x1f')],function(_0x5720b0){return{'model':db[_0x5720b0[_0x414e('0x21')]],'as':_0x5720b0['as'],'attributes':_0x5720b0['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x275582){logger[_0x414e('0xd')](_0x414e('0x17'),_0xe3420a);logger[_0x414e('0x10')]('GetZendeskAccount',_0xe3420a,JSON['stringify'](_0x275582));_0x1a20ed(_0x275582);})[_0x414e('0x16')](function(_0x574fd9){logger[_0x414e('0x13')](_0x414e('0x17'),_0x574fd9[_0x414e('0x15')],_0xe3420a);_0x435c08(_0x51ef3d['error'](0x1f4,_0x574fd9[_0x414e('0x15')]));});});};exports[_0x414e('0x22')]=function(_0x1d33df){var _0x2dc774=this;return new Promise(function(_0x220db8,_0x3bb586){return db[_0x414e('0x18')][_0x414e('0x23')]({'raw':_0x1d33df['options']?_0x1d33df[_0x414e('0x1a')][_0x414e('0x1b')]===undefined?!![]:![]:!![],'where':_0x1d33df['options']?_0x1d33df[_0x414e('0x1a')]['where']||null:null,'attributes':_0x1d33df[_0x414e('0x1a')]?_0x1d33df[_0x414e('0x1a')][_0x414e('0x1d')]||null:null,'include':_0x1d33df[_0x414e('0x1a')]?_0x1d33df[_0x414e('0x1a')][_0x414e('0x1f')]?_[_0x414e('0x20')](_0x1d33df[_0x414e('0x1a')][_0x414e('0x1f')],function(_0x519888){return{'model':db[_0x519888[_0x414e('0x21')]],'as':_0x519888['as'],'attributes':_0x519888[_0x414e('0x1d')],'include':_0x519888[_0x414e('0x1f')]?_[_0x414e('0x20')](_0x519888['include'],function(_0x16fb90){return{'model':db[_0x16fb90[_0x414e('0x21')]],'as':_0x16fb90['as'],'attributes':_0x16fb90['attributes'],'include':_0x16fb90['include']?_[_0x414e('0x20')](_0x16fb90[_0x414e('0x1f')],function(_0x2005de){return{'model':db[_0x2005de[_0x414e('0x21')]],'as':_0x2005de['as'],'attributes':_0x2005de[_0x414e('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x414e('0xc')](function(_0x20540b){logger[_0x414e('0xd')](_0x414e('0x22'),_0x1d33df);logger[_0x414e('0x10')](_0x414e('0x22'),_0x1d33df,JSON[_0x414e('0x12')](_0x20540b));_0x220db8(_0x20540b);})['catch'](function(_0x2d0f00){logger[_0x414e('0x13')]('ShowZendeskAccount',_0x2d0f00[_0x414e('0x15')],_0x1d33df);_0x3bb586(_0x2dc774[_0x414e('0x13')](0x1f4,_0x2d0f00[_0x414e('0x15')]));});});}; \ No newline at end of file +var _0x5655=['raw','options','attributes','limit','include','map','model','GetZendeskAccount','stringify','find','where','ShowZendeskAccount','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','message','catch','ZendeskAccount','findAll'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x5655,0x135));var _0x5565=function(_0x448a5a,_0x314738){_0x448a5a=_0x448a5a-0x0;var _0x1380d8=_0x5655[_0x448a5a];return _0x1380d8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5565('0x0'));var BPromise=require(_0x5565('0x1'));var rs=require(_0x5565('0x2'));var fs=require('fs');var Redis=require(_0x5565('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5565('0x4'));var logger=require(_0x5565('0x5'))(_0x5565('0x6'));var config=require('../../config/environment');var jayson=require(_0x5565('0x7'));var client=jayson['client'][_0x5565('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4ff572,_0x530acf,_0x238dda){return new BPromise(function(_0x2293b4,_0x250a2d){return client[_0x5565('0x9')](_0x4ff572,_0x238dda)[_0x5565('0xa')](function(_0xbae1ce){logger[_0x5565('0xb')](_0x5565('0xc'),_0x530acf,_0x5565('0xd'));logger[_0x5565('0xe')](_0x5565('0xf'),_0x530acf,_0x5565('0xd'),JSON['stringify'](_0xbae1ce));if(_0xbae1ce[_0x5565('0x10')]){if(_0xbae1ce[_0x5565('0x10')]['code']===0x1f4){logger[_0x5565('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x530acf,_0xbae1ce[_0x5565('0x10')][_0x5565('0x11')]);return _0x250a2d(_0xbae1ce['error'][_0x5565('0x11')]);}logger[_0x5565('0x10')](_0x5565('0xc'),_0x530acf,_0xbae1ce[_0x5565('0x10')][_0x5565('0x11')]);return _0x2293b4(_0xbae1ce[_0x5565('0x10')]['message']);}else{logger[_0x5565('0xb')]('ZendeskAccount,\x20%s,\x20%s',_0x530acf,'request\x20sent');_0x2293b4(_0xbae1ce['result']['message']);}})[_0x5565('0x12')](function(_0x30c9bd){logger[_0x5565('0x10')](_0x5565('0xc'),_0x530acf,_0x30c9bd);_0x250a2d(_0x30c9bd);});});}exports['GetZendeskAccount']=function(_0x34815a){var _0x291bb3=this;return new Promise(function(_0x1bea06,_0xb370de){return db[_0x5565('0x13')][_0x5565('0x14')]({'raw':_0x34815a['options']?_0x34815a['options'][_0x5565('0x15')]===undefined?!![]:![]:!![],'where':_0x34815a[_0x5565('0x16')]?_0x34815a['options']['where']||null:null,'attributes':_0x34815a[_0x5565('0x16')]?_0x34815a[_0x5565('0x16')][_0x5565('0x17')]||null:null,'limit':_0x34815a[_0x5565('0x16')]?_0x34815a[_0x5565('0x16')][_0x5565('0x18')]||null:null,'include':_0x34815a[_0x5565('0x16')]?_0x34815a[_0x5565('0x16')][_0x5565('0x19')]?_[_0x5565('0x1a')](_0x34815a[_0x5565('0x16')][_0x5565('0x19')],function(_0x439f04){return{'model':db[_0x439f04['model']],'as':_0x439f04['as'],'attributes':_0x439f04[_0x5565('0x17')],'include':_0x439f04[_0x5565('0x19')]?_['map'](_0x439f04['include'],function(_0x665916){return{'model':db[_0x665916[_0x5565('0x1b')]],'as':_0x665916['as'],'attributes':_0x665916[_0x5565('0x17')],'include':_0x665916['include']?_['map'](_0x665916[_0x5565('0x19')],function(_0x1d5d54){return{'model':db[_0x1d5d54[_0x5565('0x1b')]],'as':_0x1d5d54['as'],'attributes':_0x1d5d54[_0x5565('0x17')]};}):[]};}):[]};}):[]:[]})[_0x5565('0xa')](function(_0x2741c8){logger[_0x5565('0xb')](_0x5565('0x1c'),_0x34815a);logger[_0x5565('0xe')](_0x5565('0x1c'),_0x34815a,JSON[_0x5565('0x1d')](_0x2741c8));_0x1bea06(_0x2741c8);})['catch'](function(_0x1b0057){logger[_0x5565('0x10')]('GetZendeskAccount',_0x1b0057['message'],_0x34815a);_0xb370de(_0x291bb3[_0x5565('0x10')](0x1f4,_0x1b0057[_0x5565('0x11')]));});});};exports['ShowZendeskAccount']=function(_0x11c6ad){var _0x28c336=this;return new Promise(function(_0x3dd9e3,_0x55d285){return db[_0x5565('0x13')][_0x5565('0x1e')]({'raw':_0x11c6ad[_0x5565('0x16')]?_0x11c6ad['options'][_0x5565('0x15')]===undefined?!![]:![]:!![],'where':_0x11c6ad['options']?_0x11c6ad[_0x5565('0x16')][_0x5565('0x1f')]||null:null,'attributes':_0x11c6ad[_0x5565('0x16')]?_0x11c6ad[_0x5565('0x16')][_0x5565('0x17')]||null:null,'include':_0x11c6ad[_0x5565('0x16')]?_0x11c6ad['options']['include']?_['map'](_0x11c6ad[_0x5565('0x16')][_0x5565('0x19')],function(_0x516193){return{'model':db[_0x516193[_0x5565('0x1b')]],'as':_0x516193['as'],'attributes':_0x516193[_0x5565('0x17')],'include':_0x516193[_0x5565('0x19')]?_[_0x5565('0x1a')](_0x516193['include'],function(_0x3274d4){return{'model':db[_0x3274d4[_0x5565('0x1b')]],'as':_0x3274d4['as'],'attributes':_0x3274d4[_0x5565('0x17')],'include':_0x3274d4['include']?_[_0x5565('0x1a')](_0x3274d4[_0x5565('0x19')],function(_0x30b5ee){return{'model':db[_0x30b5ee['model']],'as':_0x30b5ee['as'],'attributes':_0x30b5ee['attributes']};}):[]};}):[]};}):[]:[]})[_0x5565('0xa')](function(_0x3bc694){logger[_0x5565('0xb')]('ShowZendeskAccount',_0x11c6ad);logger['debug'](_0x5565('0x20'),_0x11c6ad,JSON[_0x5565('0x1d')](_0x3bc694));_0x3dd9e3(_0x3bc694);})['catch'](function(_0x185cb9){logger[_0x5565('0x10')](_0x5565('0x20'),_0x185cb9['message'],_0x11c6ad);_0x55d285(_0x28c336[_0x5565('0x10')](0x1f4,_0x185cb9[_0x5565('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 5f81b51..25226f4 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/tags','getTags','post','create','setTags','put','/:id','delete','destroy','exports','multer','util'];(function(_0x5866d1,_0xa6dc72){var _0x30071f=function(_0x482390){while(--_0x482390){_0x5866d1['push'](_0x5866d1['shift']());}};_0x30071f(++_0xa6dc72);}(_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'));var controller=require('./intZendeskConfiguration.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x9')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0x9')]('/:id/descriptions',auth[_0x0d8b('0x7')](),controller['getDescriptions']);router[_0x0d8b('0x9')](_0x0d8b('0xf'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x10')]);router[_0x0d8b('0x11')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x11')](_0x0d8b('0xf'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x13')]);router[_0x0d8b('0x14')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller['update']);router[_0x0d8b('0x16')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x17')]);module[_0x0d8b('0x18')]=router; \ No newline at end of file +var _0x4024=['util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id/fields','getDescriptions','/:id/tags','getTags','create','post','setTags','put','/:id','update','delete','destroy','exports','multer'];(function(_0x2341c6,_0x3af092){var _0x54c34d=function(_0x3091f9){while(--_0x3091f9){_0x2341c6['push'](_0x2341c6['shift']());}};_0x54c34d(++_0x3af092);}(_0x4024,0x89));var _0x4402=function(_0x4a6c58,_0x23108a){_0x4a6c58=_0x4a6c58-0x0;var _0x322d07=_0x4024[_0x4a6c58];return _0x322d07;};'use strict';var multer=require(_0x4402('0x0'));var util=require(_0x4402('0x1'));var path=require('path');var timeout=require(_0x4402('0x2'));var express=require(_0x4402('0x3'));var router=express['Router']();var fs_extra=require(_0x4402('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4402('0x5'));var config=require(_0x4402('0x6'));var controller=require('./intZendeskConfiguration.controller');router['get']('/',auth[_0x4402('0x7')](),controller[_0x4402('0x8')]);router[_0x4402('0x9')]('/:id',auth[_0x4402('0x7')](),controller['show']);router['get'](_0x4402('0xa'),auth['isAuthenticated'](),controller['getFields']);router[_0x4402('0x9')]('/:id/subjects',auth[_0x4402('0x7')](),controller['getSubjects']);router[_0x4402('0x9')]('/:id/descriptions',auth[_0x4402('0x7')](),controller[_0x4402('0xb')]);router['get'](_0x4402('0xc'),auth[_0x4402('0x7')](),controller[_0x4402('0xd')]);router['post']('/',auth[_0x4402('0x7')](),controller[_0x4402('0xe')]);router[_0x4402('0xf')](_0x4402('0xc'),auth[_0x4402('0x7')](),controller[_0x4402('0x10')]);router[_0x4402('0x11')](_0x4402('0x12'),auth[_0x4402('0x7')](),controller[_0x4402('0x13')]);router[_0x4402('0x14')](_0x4402('0x12'),auth[_0x4402('0x7')](),controller[_0x4402('0x15')]);module[_0x4402('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 6781de5..8365106 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 _0xd6b8=['STRING','sequelize','exports'];(function(_0x33d4a2,_0x2baaf4){var _0x2c793f=function(_0x414303){while(--_0x414303){_0x33d4a2['push'](_0x33d4a2['shift']());}};_0x2c793f(++_0x2baaf4);}(_0xd6b8,0x1ea));var _0x8d6b=function(_0x41a9ab,_0x34a3d3){_0x41a9ab=_0x41a9ab-0x0;var _0x5d27c0=_0xd6b8[_0x41a9ab];return _0x5d27c0;};'use strict';var Sequelize=require(_0x8d6b('0x0'));module[_0x8d6b('0x1')]={'name':{'type':Sequelize[_0x8d6b('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd566=['sequelize','exports','STRING'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0xd566,0x138));var _0x6d56=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xd566[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0x6d56('0x0'));module[_0x6d56('0x1')]={'name':{'type':Sequelize[_0x6d56('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index c5b7283..03cbb11 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 _0x7255=['request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','then','destroy','end','stack','send','index','rawAttributes','fieldName','key','model','map','name','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','ZendeskConfiguration','includeAll','include','rows','catch','show','params','fields','length','create','body','find','getFields','findOne','ZendeskField','getSubjects','getDescriptions','getTags','ids','eml-format','rimraf','fast-json-patch'];(function(_0x2e34bb,_0x15450c){var _0x2b6b7d=function(_0x5afaf9){while(--_0x5afaf9){_0x2e34bb['push'](_0x2e34bb['shift']());}};_0x2b6b7d(++_0x15450c);}(_0x7255,0xf3));var _0x5725=function(_0x279d06,_0x3bc312){_0x279d06=_0x279d06-0x0;var _0x2f997b=_0x7255[_0x279d06];return _0x2f997b;};'use strict';var emlformat=require(_0x5725('0x0'));var rimraf=require(_0x5725('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5725('0x2'));var rp=require(_0x5725('0x3'));var moment=require(_0x5725('0x4'));var BPromise=require(_0x5725('0x5'));var Mustache=require(_0x5725('0x6'));var util=require('util');var path=require(_0x5725('0x7'));var sox=require(_0x5725('0x8'));var csv=require(_0x5725('0x9'));var ejs=require(_0x5725('0xa'));var fs=require('fs');var fs_extra=require(_0x5725('0xb'));var _=require(_0x5725('0xc'));var squel=require(_0x5725('0xd'));var crypto=require('crypto');var jsforce=require(_0x5725('0xe'));var deskjs=require(_0x5725('0xf'));var toCsv=require(_0x5725('0x9'));var querystring=require(_0x5725('0x10'));var Papa=require('papaparse');var Redis=require(_0x5725('0x11'));var authService=require(_0x5725('0x12'));var qs=require(_0x5725('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5725('0x14'));var logger=require(_0x5725('0x15'))(_0x5725('0x16'));var utils=require(_0x5725('0x17'));var config=require(_0x5725('0x18'));var licenseUtil=require(_0x5725('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d9b66,_0x4b7e29){_0x4b7e29=_0x4b7e29||0xcc;return function(_0x2a865b){if(_0x2a865b){return _0x3d9b66[_0x5725('0x1a')](_0x4b7e29);}return _0x3d9b66[_0x5725('0x1b')](_0x4b7e29)['end']();};}function respondWithResult(_0xa2d3d3,_0x1a0084){_0x1a0084=_0x1a0084||0xc8;return function(_0x885542){if(_0x885542){return _0xa2d3d3['status'](_0x1a0084)['json'](_0x885542);}};}function respondWithFilteredResult(_0x425ea8,_0x20edd5){return function(_0x4fde9f){if(_0x4fde9f){var _0x24aa1c=typeof _0x20edd5[_0x5725('0x1c')]==='undefined'&&typeof _0x20edd5[_0x5725('0x1d')]===_0x5725('0x1e');var _0x5efb36=_0x4fde9f[_0x5725('0x1f')];var _0x91b8dd=_0x24aa1c?0x0:_0x20edd5['offset'];var _0x2b5717=_0x24aa1c?_0x4fde9f[_0x5725('0x1f')]:_0x20edd5[_0x5725('0x1c')]+_0x20edd5[_0x5725('0x1d')];var _0x656cd5;if(_0x2b5717>=_0x5efb36){_0x2b5717=_0x5efb36;_0x656cd5=0xc8;}else{_0x656cd5=0xce;}_0x425ea8['status'](_0x656cd5);return _0x425ea8[_0x5725('0x20')](_0x5725('0x21'),_0x91b8dd+'-'+_0x2b5717+'/'+_0x5efb36)[_0x5725('0x22')](_0x4fde9f);}return null;};}function patchUpdates(_0x2bb596){return function(_0x329442){try{jsonpatch['apply'](_0x329442,_0x2bb596,!![]);}catch(_0x43e5d){return BPromise['reject'](_0x43e5d);}return _0x329442['save']();};}function saveUpdates(_0x211e7d,_0x4e7025){return function(_0x1ba7f3){if(_0x1ba7f3){return _0x1ba7f3['update'](_0x211e7d)[_0x5725('0x23')](function(_0x3811ac){return _0x3811ac;});}return null;};}function removeEntity(_0x35c29c,_0x2fd1ef){return function(_0x294285){if(_0x294285){return _0x294285[_0x5725('0x24')]()['then'](function(){_0x35c29c[_0x5725('0x1b')](0xcc)[_0x5725('0x25')]();});}};}function handleEntityNotFound(_0x132365,_0x56c9e6){return function(_0x48f0d9){if(!_0x48f0d9){_0x132365[_0x5725('0x1a')](0x194);}return _0x48f0d9;};}function handleError(_0x2692b0,_0x230d47){_0x230d47=_0x230d47||0x1f4;return function(_0xbdd49b){logger['error'](_0xbdd49b[_0x5725('0x26')]);if(_0xbdd49b['name']){delete _0xbdd49b['name'];}_0x2692b0['status'](_0x230d47)[_0x5725('0x27')](_0xbdd49b);};}exports[_0x5725('0x28')]=function(_0x5c5fec,_0x3ff696){var _0x7a1b87={},_0x25f54c={},_0x4e5410={'count':0x0,'rows':[]};var _0x22d878=_['map'](db['ZendeskConfiguration'][_0x5725('0x29')],function(_0x379e18){return{'name':_0x379e18[_0x5725('0x2a')],'type':_0x379e18['type'][_0x5725('0x2b')]};});_0x25f54c[_0x5725('0x2c')]=_[_0x5725('0x2d')](_0x22d878,_0x5725('0x2e'));_0x25f54c['query']=_[_0x5725('0x2f')](_0x5c5fec[_0x5725('0x30')]);_0x25f54c[_0x5725('0x31')]=_[_0x5725('0x32')](_0x25f54c['model'],_0x25f54c[_0x5725('0x30')]);_0x7a1b87[_0x5725('0x33')]=_[_0x5725('0x32')](_0x25f54c['model'],qs['fields'](_0x5c5fec['query']['fields']));_0x7a1b87[_0x5725('0x33')]=_0x7a1b87[_0x5725('0x33')]['length']?_0x7a1b87[_0x5725('0x33')]:_0x25f54c[_0x5725('0x2c')];if(!_0x5c5fec[_0x5725('0x30')][_0x5725('0x34')](_0x5725('0x35'))){_0x7a1b87['limit']=qs[_0x5725('0x1d')](_0x5c5fec[_0x5725('0x30')][_0x5725('0x1d')]);_0x7a1b87[_0x5725('0x1c')]=qs['offset'](_0x5c5fec[_0x5725('0x30')][_0x5725('0x1c')]);}_0x7a1b87[_0x5725('0x36')]=qs[_0x5725('0x37')](_0x5c5fec['query'][_0x5725('0x37')]);_0x7a1b87[_0x5725('0x38')]=qs['filters'](_[_0x5725('0x39')](_0x5c5fec[_0x5725('0x30')],_0x25f54c[_0x5725('0x31')]),_0x22d878);if(_0x5c5fec[_0x5725('0x30')][_0x5725('0x3a')]){_0x7a1b87[_0x5725('0x38')]=_['merge'](_0x7a1b87[_0x5725('0x38')],{'$or':_[_0x5725('0x2d')](_0x22d878,function(_0x5170a2){if(_0x5170a2[_0x5725('0x3b')]!==_0x5725('0x3c')){var _0x1eb8e1={};_0x1eb8e1[_0x5170a2[_0x5725('0x2e')]]={'$like':'%'+_0x5c5fec[_0x5725('0x30')][_0x5725('0x3a')]+'%'};return _0x1eb8e1;}})});}_0x7a1b87=_[_0x5725('0x3d')]({},_0x7a1b87,_0x5c5fec[_0x5725('0x3e')]);var _0x42891e={'where':_0x7a1b87['where']};return db[_0x5725('0x3f')][_0x5725('0x1f')](_0x42891e)[_0x5725('0x23')](function(_0x75142f){_0x4e5410['count']=_0x75142f;if(_0x5c5fec[_0x5725('0x30')][_0x5725('0x40')]){_0x7a1b87[_0x5725('0x41')]=[{'all':!![]}];}return db[_0x5725('0x3f')]['findAll'](_0x7a1b87);})[_0x5725('0x23')](function(_0x9dd08f){_0x4e5410[_0x5725('0x42')]=_0x9dd08f;return _0x4e5410;})[_0x5725('0x23')](respondWithFilteredResult(_0x3ff696,_0x7a1b87))[_0x5725('0x43')](handleError(_0x3ff696,null));};exports[_0x5725('0x44')]=function(_0x3ba41a,_0x2a86a9){var _0x2597d0={'raw':![],'where':{'id':_0x3ba41a[_0x5725('0x45')]['id']}},_0x4aac71={};_0x4aac71['model']=_[_0x5725('0x2f')](db['ZendeskConfiguration'][_0x5725('0x29')]);_0x4aac71[_0x5725('0x30')]=_['keys'](_0x3ba41a['query']);_0x4aac71[_0x5725('0x31')]=_[_0x5725('0x32')](_0x4aac71['model'],_0x4aac71['query']);_0x2597d0[_0x5725('0x33')]=_['intersection'](_0x4aac71[_0x5725('0x2c')],qs[_0x5725('0x46')](_0x3ba41a[_0x5725('0x30')]['fields']));_0x2597d0[_0x5725('0x33')]=_0x2597d0[_0x5725('0x33')][_0x5725('0x47')]?_0x2597d0['attributes']:_0x4aac71[_0x5725('0x2c')];if(_0x3ba41a['query'][_0x5725('0x40')]){_0x2597d0['include']=[{'all':!![]}];}_0x2597d0=_[_0x5725('0x3d')]({},_0x2597d0,_0x3ba41a[_0x5725('0x3e')]);return db['ZendeskConfiguration']['find'](_0x2597d0)['then'](handleEntityNotFound(_0x2a86a9,null))[_0x5725('0x23')](respondWithResult(_0x2a86a9,null))[_0x5725('0x43')](handleError(_0x2a86a9,null));};exports[_0x5725('0x48')]=function(_0x141d13,_0x493c9c){return db[_0x5725('0x3f')][_0x5725('0x48')](_0x141d13['body'],{})[_0x5725('0x23')](respondWithResult(_0x493c9c,0xc9))[_0x5725('0x43')](handleError(_0x493c9c,null));};exports['update']=function(_0x5199f4,_0x482afa){if(_0x5199f4[_0x5725('0x49')]['id']){delete _0x5199f4[_0x5725('0x49')]['id'];}return db[_0x5725('0x3f')][_0x5725('0x4a')]({'where':{'id':_0x5199f4[_0x5725('0x45')]['id']}})[_0x5725('0x23')](handleEntityNotFound(_0x482afa,null))['then'](saveUpdates(_0x5199f4['body'],null))[_0x5725('0x23')](respondWithResult(_0x482afa,null))[_0x5725('0x43')](handleError(_0x482afa,null));};exports['destroy']=function(_0x51bd16,_0xd4d471){return db[_0x5725('0x3f')][_0x5725('0x4a')]({'where':{'id':_0x51bd16[_0x5725('0x45')]['id']}})[_0x5725('0x23')](handleEntityNotFound(_0xd4d471,null))[_0x5725('0x23')](removeEntity(_0xd4d471,null))[_0x5725('0x43')](handleError(_0xd4d471,null));};exports[_0x5725('0x4b')]=function(_0xc0e7f,_0x510582,_0x30be93){var _0x286299={};var _0x133ead={};var _0x36e474;var _0x5d213e;return db[_0x5725('0x3f')][_0x5725('0x4c')]({'where':{'id':_0xc0e7f[_0x5725('0x45')]['id']}})[_0x5725('0x23')](handleEntityNotFound(_0x510582,null))['then'](function(_0x2649c0){if(_0x2649c0){_0x36e474=_0x2649c0;_0x133ead[_0x5725('0x2c')]=_[_0x5725('0x2f')](db[_0x5725('0x4d')][_0x5725('0x29')]);_0x133ead[_0x5725('0x30')]=_[_0x5725('0x2f')](_0xc0e7f[_0x5725('0x30')]);_0x133ead[_0x5725('0x31')]=_[_0x5725('0x32')](_0x133ead['model'],_0x133ead[_0x5725('0x30')]);_0x286299[_0x5725('0x33')]=_['intersection'](_0x133ead[_0x5725('0x2c')],qs[_0x5725('0x46')](_0xc0e7f['query']['fields']));_0x286299[_0x5725('0x33')]=_0x286299[_0x5725('0x33')]['length']?_0x286299['attributes']:_0x133ead['model'];_0x286299['order']=qs[_0x5725('0x37')](_0xc0e7f[_0x5725('0x30')][_0x5725('0x37')]);_0x286299[_0x5725('0x38')]=qs[_0x5725('0x31')](_[_0x5725('0x39')](_0xc0e7f[_0x5725('0x30')],_0x133ead[_0x5725('0x31')]));if(_0xc0e7f[_0x5725('0x30')][_0x5725('0x3a')]){_0x286299[_0x5725('0x38')]=_[_0x5725('0x3d')](_0x286299[_0x5725('0x38')],{'$or':_[_0x5725('0x2d')](_0x286299[_0x5725('0x33')],function(_0x26d970){var _0x37978e={};_0x37978e[_0x26d970]={'$like':'%'+_0xc0e7f['query'][_0x5725('0x3a')]+'%'};return _0x37978e;})});}_0x286299=_['merge']({},_0x286299,_0xc0e7f[_0x5725('0x3e')]);return _0x36e474[_0x5725('0x4b')](_0x286299);}})[_0x5725('0x23')](function(_0x35e5a5){if(_0x35e5a5){_0x5d213e=_0x35e5a5[_0x5725('0x47')];if(!_0xc0e7f[_0x5725('0x30')][_0x5725('0x34')](_0x5725('0x35'))){_0x286299[_0x5725('0x1d')]=qs[_0x5725('0x1d')](_0xc0e7f[_0x5725('0x30')][_0x5725('0x1d')]);_0x286299['offset']=qs[_0x5725('0x1c')](_0xc0e7f[_0x5725('0x30')]['offset']);}return _0x36e474['getFields'](_0x286299);}})[_0x5725('0x23')](function(_0x1e3ba2){if(_0x1e3ba2){return _0x1e3ba2?{'count':_0x5d213e,'rows':_0x1e3ba2}:null;}})[_0x5725('0x23')](respondWithResult(_0x510582,null))[_0x5725('0x43')](handleError(_0x510582,null));};exports[_0x5725('0x4e')]=function(_0x20f47c,_0x742a2a,_0x3688a1){var _0x575555={};var _0x5995ea={};var _0x4ab6fd;var _0xcbf376;return db[_0x5725('0x3f')][_0x5725('0x4c')]({'where':{'id':_0x20f47c[_0x5725('0x45')]['id']}})[_0x5725('0x23')](handleEntityNotFound(_0x742a2a,null))[_0x5725('0x23')](function(_0x393529){if(_0x393529){_0x4ab6fd=_0x393529;_0x5995ea[_0x5725('0x2c')]=_[_0x5725('0x2f')](db[_0x5725('0x4d')][_0x5725('0x29')]);_0x5995ea[_0x5725('0x30')]=_['keys'](_0x20f47c['query']);_0x5995ea[_0x5725('0x31')]=_[_0x5725('0x32')](_0x5995ea[_0x5725('0x2c')],_0x5995ea[_0x5725('0x30')]);_0x575555[_0x5725('0x33')]=_[_0x5725('0x32')](_0x5995ea[_0x5725('0x2c')],qs[_0x5725('0x46')](_0x20f47c[_0x5725('0x30')][_0x5725('0x46')]));_0x575555[_0x5725('0x33')]=_0x575555['attributes']['length']?_0x575555[_0x5725('0x33')]:_0x5995ea[_0x5725('0x2c')];_0x575555[_0x5725('0x36')]=qs[_0x5725('0x37')](_0x20f47c[_0x5725('0x30')][_0x5725('0x37')]);_0x575555['where']=qs[_0x5725('0x31')](_['pick'](_0x20f47c[_0x5725('0x30')],_0x5995ea[_0x5725('0x31')]));if(_0x20f47c['query']['filter']){_0x575555['where']=_[_0x5725('0x3d')](_0x575555['where'],{'$or':_['map'](_0x575555[_0x5725('0x33')],function(_0x363424){var _0xcf236e={};_0xcf236e[_0x363424]={'$like':'%'+_0x20f47c[_0x5725('0x30')][_0x5725('0x3a')]+'%'};return _0xcf236e;})});}_0x575555=_['merge']({},_0x575555,_0x20f47c['options']);return _0x4ab6fd[_0x5725('0x4e')](_0x575555);}})[_0x5725('0x23')](function(_0x21868b){if(_0x21868b){_0xcbf376=_0x21868b['length'];if(!_0x20f47c['query']['hasOwnProperty'](_0x5725('0x35'))){_0x575555['limit']=qs[_0x5725('0x1d')](_0x20f47c[_0x5725('0x30')]['limit']);_0x575555[_0x5725('0x1c')]=qs[_0x5725('0x1c')](_0x20f47c[_0x5725('0x30')]['offset']);}return _0x4ab6fd[_0x5725('0x4e')](_0x575555);}})[_0x5725('0x23')](function(_0x4f3349){if(_0x4f3349){return _0x4f3349?{'count':_0xcbf376,'rows':_0x4f3349}:null;}})['then'](respondWithResult(_0x742a2a,null))['catch'](handleError(_0x742a2a,null));};exports[_0x5725('0x4f')]=function(_0x470489,_0x43ad7e,_0x2d2c25){var _0x335c2a={};var _0x16e73f={};var _0x493bc7;var _0xb7fa3;return db[_0x5725('0x3f')][_0x5725('0x4c')]({'where':{'id':_0x470489[_0x5725('0x45')]['id']}})[_0x5725('0x23')](handleEntityNotFound(_0x43ad7e,null))['then'](function(_0x1920ba){if(_0x1920ba){_0x493bc7=_0x1920ba;_0x16e73f[_0x5725('0x2c')]=_[_0x5725('0x2f')](db[_0x5725('0x4d')][_0x5725('0x29')]);_0x16e73f['query']=_[_0x5725('0x2f')](_0x470489[_0x5725('0x30')]);_0x16e73f[_0x5725('0x31')]=_[_0x5725('0x32')](_0x16e73f[_0x5725('0x2c')],_0x16e73f[_0x5725('0x30')]);_0x335c2a[_0x5725('0x33')]=_[_0x5725('0x32')](_0x16e73f[_0x5725('0x2c')],qs['fields'](_0x470489[_0x5725('0x30')][_0x5725('0x46')]));_0x335c2a[_0x5725('0x33')]=_0x335c2a[_0x5725('0x33')]['length']?_0x335c2a[_0x5725('0x33')]:_0x16e73f[_0x5725('0x2c')];_0x335c2a['order']=qs['sort'](_0x470489[_0x5725('0x30')][_0x5725('0x37')]);_0x335c2a[_0x5725('0x38')]=qs['filters'](_[_0x5725('0x39')](_0x470489['query'],_0x16e73f[_0x5725('0x31')]));if(_0x470489[_0x5725('0x30')]['filter']){_0x335c2a[_0x5725('0x38')]=_[_0x5725('0x3d')](_0x335c2a['where'],{'$or':_[_0x5725('0x2d')](_0x335c2a[_0x5725('0x33')],function(_0x33325a){var _0x57b8d7={};_0x57b8d7[_0x33325a]={'$like':'%'+_0x470489[_0x5725('0x30')][_0x5725('0x3a')]+'%'};return _0x57b8d7;})});}_0x335c2a=_[_0x5725('0x3d')]({},_0x335c2a,_0x470489[_0x5725('0x3e')]);return _0x493bc7[_0x5725('0x4f')](_0x335c2a);}})[_0x5725('0x23')](function(_0x3f8780){if(_0x3f8780){_0xb7fa3=_0x3f8780['length'];if(!_0x470489[_0x5725('0x30')][_0x5725('0x34')](_0x5725('0x35'))){_0x335c2a[_0x5725('0x1d')]=qs[_0x5725('0x1d')](_0x470489[_0x5725('0x30')][_0x5725('0x1d')]);_0x335c2a[_0x5725('0x1c')]=qs[_0x5725('0x1c')](_0x470489['query']['offset']);}return _0x493bc7[_0x5725('0x4f')](_0x335c2a);}})[_0x5725('0x23')](function(_0x34c0d0){if(_0x34c0d0){return _0x34c0d0?{'count':_0xb7fa3,'rows':_0x34c0d0}:null;}})[_0x5725('0x23')](respondWithResult(_0x43ad7e,null))[_0x5725('0x43')](handleError(_0x43ad7e,null));};exports[_0x5725('0x50')]=function(_0x56fce4,_0x5f04dc,_0x28f2ff){var _0x31e21f={};var _0x409f4f={};var _0x5e93ca;var _0x402784;return db[_0x5725('0x3f')][_0x5725('0x4c')]({'where':{'id':_0x56fce4['params']['id']}})[_0x5725('0x23')](handleEntityNotFound(_0x5f04dc,null))[_0x5725('0x23')](function(_0x2647b3){if(_0x2647b3){_0x5e93ca=_0x2647b3;_0x409f4f['model']=_[_0x5725('0x2f')](db['Tag'][_0x5725('0x29')]);_0x409f4f[_0x5725('0x30')]=_['keys'](_0x56fce4[_0x5725('0x30')]);_0x409f4f[_0x5725('0x31')]=_[_0x5725('0x32')](_0x409f4f['model'],_0x409f4f[_0x5725('0x30')]);_0x31e21f[_0x5725('0x33')]=_[_0x5725('0x32')](_0x409f4f[_0x5725('0x2c')],qs['fields'](_0x56fce4[_0x5725('0x30')]['fields']));_0x31e21f['attributes']=_0x31e21f[_0x5725('0x33')][_0x5725('0x47')]?_0x31e21f['attributes']:_0x409f4f[_0x5725('0x2c')];_0x31e21f[_0x5725('0x36')]=qs[_0x5725('0x37')](_0x56fce4['query'][_0x5725('0x37')]);_0x31e21f[_0x5725('0x38')]=qs[_0x5725('0x31')](_['pick'](_0x56fce4['query'],_0x409f4f[_0x5725('0x31')]));if(_0x56fce4[_0x5725('0x30')]['filter']){_0x31e21f[_0x5725('0x38')]=_[_0x5725('0x3d')](_0x31e21f[_0x5725('0x38')],{'$or':_['map'](_0x31e21f[_0x5725('0x33')],function(_0x2f36bc){var _0xa79041={};_0xa79041[_0x2f36bc]={'$like':'%'+_0x56fce4[_0x5725('0x30')]['filter']+'%'};return _0xa79041;})});}_0x31e21f=_[_0x5725('0x3d')]({},_0x31e21f,_0x56fce4[_0x5725('0x3e')]);return _0x5e93ca['getTags'](_0x31e21f);}})['then'](function(_0x439905){if(_0x439905){_0x402784=_0x439905[_0x5725('0x47')];if(!_0x56fce4[_0x5725('0x30')]['hasOwnProperty'](_0x5725('0x35'))){_0x31e21f[_0x5725('0x1d')]=qs[_0x5725('0x1d')](_0x56fce4[_0x5725('0x30')]['limit']);_0x31e21f['offset']=qs[_0x5725('0x1c')](_0x56fce4[_0x5725('0x30')][_0x5725('0x1c')]);}return _0x5e93ca[_0x5725('0x50')](_0x31e21f);}})['then'](function(_0x126b62){if(_0x126b62){return _0x126b62?{'count':_0x402784,'rows':_0x126b62}:null;}})['then'](respondWithResult(_0x5f04dc,null))[_0x5725('0x43')](handleError(_0x5f04dc,null));};exports['setTags']=function(_0x3ea909,_0x1ff6fa,_0x3054c0){if(_0x3ea909['body']['id']){delete _0x3ea909[_0x5725('0x49')]['id'];}return db['ZendeskConfiguration'][_0x5725('0x4c')]({'where':{'id':_0x3ea909['params']['id']}})['then'](handleEntityNotFound(_0x1ff6fa,null))[_0x5725('0x23')](function(_0x237b3a){if(_0x237b3a){return _0x237b3a['setTags'](_0x3ea909['body'][_0x5725('0x51')]||[]);}return null;})[_0x5725('0x23')](respondWithResult(_0x1ff6fa,null))['catch'](handleError(_0x1ff6fa,null));}; \ No newline at end of file +var _0xa4e5=['length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','create','update','body','find','findOne','ZendeskField','getFields','getSubjects','order','getDescriptions','getTags','Tag','setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','map','ZendeskConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x1e52bf,_0x4cfa32){var _0x2fdc63=function(_0x243d06){while(--_0x243d06){_0x1e52bf['push'](_0x1e52bf['shift']());}};_0x2fdc63(++_0x4cfa32);}(_0xa4e5,0xd0));var _0x5a4e=function(_0x14191b,_0x2b3064){_0x14191b=_0x14191b-0x0;var _0x9e33eb=_0xa4e5[_0x14191b];return _0x9e33eb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5a4e('0x0'));var zipdir=require(_0x5a4e('0x1'));var jsonpatch=require(_0x5a4e('0x2'));var rp=require(_0x5a4e('0x3'));var moment=require(_0x5a4e('0x4'));var BPromise=require(_0x5a4e('0x5'));var Mustache=require('mustache');var util=require(_0x5a4e('0x6'));var path=require(_0x5a4e('0x7'));var sox=require(_0x5a4e('0x8'));var csv=require(_0x5a4e('0x9'));var ejs=require(_0x5a4e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5a4e('0xb'));var squel=require(_0x5a4e('0xc'));var crypto=require(_0x5a4e('0xd'));var jsforce=require(_0x5a4e('0xe'));var deskjs=require(_0x5a4e('0xf'));var toCsv=require(_0x5a4e('0x9'));var querystring=require(_0x5a4e('0x10'));var Papa=require(_0x5a4e('0x11'));var Redis=require(_0x5a4e('0x12'));var authService=require(_0x5a4e('0x13'));var qs=require(_0x5a4e('0x14'));var as=require(_0x5a4e('0x15'));var hardwareService=require(_0x5a4e('0x16'));var logger=require('../../config/logger')(_0x5a4e('0x17'));var utils=require(_0x5a4e('0x18'));var config=require(_0x5a4e('0x19'));var licenseUtil=require(_0x5a4e('0x1a'));var db=require(_0x5a4e('0x1b'))['db'];function respondWithStatusCode(_0xc9f753,_0x587e57){_0x587e57=_0x587e57||0xcc;return function(_0x55712d){if(_0x55712d){return _0xc9f753[_0x5a4e('0x1c')](_0x587e57);}return _0xc9f753['status'](_0x587e57)[_0x5a4e('0x1d')]();};}function respondWithResult(_0x1a6d6c,_0x5a487c){_0x5a487c=_0x5a487c||0xc8;return function(_0x19fba4){if(_0x19fba4){return _0x1a6d6c[_0x5a4e('0x1e')](_0x5a487c)[_0x5a4e('0x1f')](_0x19fba4);}};}function respondWithFilteredResult(_0x9fcb35,_0x22d6a9){return function(_0x208703){if(_0x208703){var _0x24ced7=typeof _0x22d6a9['offset']===_0x5a4e('0x20')&&typeof _0x22d6a9[_0x5a4e('0x21')]===_0x5a4e('0x20');var _0x35ea1f=_0x208703[_0x5a4e('0x22')];var _0x2a703d=_0x24ced7?0x0:_0x22d6a9[_0x5a4e('0x23')];var _0x143d1f=_0x24ced7?_0x208703[_0x5a4e('0x22')]:_0x22d6a9[_0x5a4e('0x23')]+_0x22d6a9['limit'];var _0x496f3a;if(_0x143d1f>=_0x35ea1f){_0x143d1f=_0x35ea1f;_0x496f3a=0xc8;}else{_0x496f3a=0xce;}_0x9fcb35[_0x5a4e('0x1e')](_0x496f3a);return _0x9fcb35[_0x5a4e('0x24')](_0x5a4e('0x25'),_0x2a703d+'-'+_0x143d1f+'/'+_0x35ea1f)[_0x5a4e('0x1f')](_0x208703);}return null;};}function patchUpdates(_0x1ec8ce){return function(_0x51c4a1){try{jsonpatch[_0x5a4e('0x26')](_0x51c4a1,_0x1ec8ce,!![]);}catch(_0x31109f){return BPromise[_0x5a4e('0x27')](_0x31109f);}return _0x51c4a1[_0x5a4e('0x28')]();};}function saveUpdates(_0x3c2efb,_0x41e04e){return function(_0x174032){if(_0x174032){return _0x174032['update'](_0x3c2efb)['then'](function(_0x59dc8f){return _0x59dc8f;});}return null;};}function removeEntity(_0x4e009a,_0x37b750){return function(_0x4dea28){if(_0x4dea28){return _0x4dea28[_0x5a4e('0x29')]()[_0x5a4e('0x2a')](function(){_0x4e009a[_0x5a4e('0x1e')](0xcc)[_0x5a4e('0x1d')]();});}};}function handleEntityNotFound(_0x4f7bcc,_0xbb19e1){return function(_0x3ffc47){if(!_0x3ffc47){_0x4f7bcc[_0x5a4e('0x1c')](0x194);}return _0x3ffc47;};}function handleError(_0x20a040,_0x3056a7){_0x3056a7=_0x3056a7||0x1f4;return function(_0x30d4db){logger[_0x5a4e('0x2b')](_0x30d4db[_0x5a4e('0x2c')]);if(_0x30d4db[_0x5a4e('0x2d')]){delete _0x30d4db[_0x5a4e('0x2d')];}_0x20a040[_0x5a4e('0x1e')](_0x3056a7)[_0x5a4e('0x2e')](_0x30d4db);};}exports['index']=function(_0x21ac74,_0x5b9503){var _0x1cc398={},_0x38cc7d={},_0x28ccf6={'count':0x0,'rows':[]};var _0x3f464c=_[_0x5a4e('0x2f')](db[_0x5a4e('0x30')][_0x5a4e('0x31')],function(_0x51d772){return{'name':_0x51d772['fieldName'],'type':_0x51d772[_0x5a4e('0x32')][_0x5a4e('0x33')]};});_0x38cc7d[_0x5a4e('0x34')]=_[_0x5a4e('0x2f')](_0x3f464c,_0x5a4e('0x2d'));_0x38cc7d[_0x5a4e('0x35')]=_[_0x5a4e('0x36')](_0x21ac74[_0x5a4e('0x35')]);_0x38cc7d[_0x5a4e('0x37')]=_[_0x5a4e('0x38')](_0x38cc7d['model'],_0x38cc7d[_0x5a4e('0x35')]);_0x1cc398[_0x5a4e('0x39')]=_[_0x5a4e('0x38')](_0x38cc7d['model'],qs[_0x5a4e('0x3a')](_0x21ac74[_0x5a4e('0x35')][_0x5a4e('0x3a')]));_0x1cc398[_0x5a4e('0x39')]=_0x1cc398[_0x5a4e('0x39')][_0x5a4e('0x3b')]?_0x1cc398[_0x5a4e('0x39')]:_0x38cc7d[_0x5a4e('0x34')];if(!_0x21ac74[_0x5a4e('0x35')][_0x5a4e('0x3c')](_0x5a4e('0x3d'))){_0x1cc398['limit']=qs[_0x5a4e('0x21')](_0x21ac74[_0x5a4e('0x35')][_0x5a4e('0x21')]);_0x1cc398[_0x5a4e('0x23')]=qs[_0x5a4e('0x23')](_0x21ac74['query']['offset']);}_0x1cc398['order']=qs[_0x5a4e('0x3e')](_0x21ac74[_0x5a4e('0x35')][_0x5a4e('0x3e')]);_0x1cc398['where']=qs[_0x5a4e('0x37')](_[_0x5a4e('0x3f')](_0x21ac74[_0x5a4e('0x35')],_0x38cc7d[_0x5a4e('0x37')]),_0x3f464c);if(_0x21ac74['query'][_0x5a4e('0x40')]){_0x1cc398[_0x5a4e('0x41')]=_[_0x5a4e('0x42')](_0x1cc398[_0x5a4e('0x41')],{'$or':_[_0x5a4e('0x2f')](_0x3f464c,function(_0x3bb19a){if(_0x3bb19a['type']!==_0x5a4e('0x43')){var _0x4d1c59={};_0x4d1c59[_0x3bb19a['name']]={'$like':'%'+_0x21ac74[_0x5a4e('0x35')]['filter']+'%'};return _0x4d1c59;}})});}_0x1cc398=_['merge']({},_0x1cc398,_0x21ac74[_0x5a4e('0x44')]);var _0x39fadc={'where':_0x1cc398[_0x5a4e('0x41')]};return db[_0x5a4e('0x30')][_0x5a4e('0x22')](_0x39fadc)[_0x5a4e('0x2a')](function(_0x525ac8){_0x28ccf6[_0x5a4e('0x22')]=_0x525ac8;if(_0x21ac74['query'][_0x5a4e('0x45')]){_0x1cc398[_0x5a4e('0x46')]=[{'all':!![]}];}return db[_0x5a4e('0x30')][_0x5a4e('0x47')](_0x1cc398);})[_0x5a4e('0x2a')](function(_0x2ae010){_0x28ccf6['rows']=_0x2ae010;return _0x28ccf6;})[_0x5a4e('0x2a')](respondWithFilteredResult(_0x5b9503,_0x1cc398))[_0x5a4e('0x48')](handleError(_0x5b9503,null));};exports[_0x5a4e('0x49')]=function(_0x37a98a,_0x407f50){var _0xc2461={'raw':![],'where':{'id':_0x37a98a[_0x5a4e('0x4a')]['id']}},_0x1419b4={};_0x1419b4[_0x5a4e('0x34')]=_[_0x5a4e('0x36')](db['ZendeskConfiguration'][_0x5a4e('0x31')]);_0x1419b4[_0x5a4e('0x35')]=_['keys'](_0x37a98a[_0x5a4e('0x35')]);_0x1419b4[_0x5a4e('0x37')]=_[_0x5a4e('0x38')](_0x1419b4[_0x5a4e('0x34')],_0x1419b4[_0x5a4e('0x35')]);_0xc2461['attributes']=_[_0x5a4e('0x38')](_0x1419b4[_0x5a4e('0x34')],qs['fields'](_0x37a98a[_0x5a4e('0x35')][_0x5a4e('0x3a')]));_0xc2461['attributes']=_0xc2461[_0x5a4e('0x39')][_0x5a4e('0x3b')]?_0xc2461['attributes']:_0x1419b4['model'];if(_0x37a98a['query']['includeAll']){_0xc2461['include']=[{'all':!![]}];}_0xc2461=_[_0x5a4e('0x42')]({},_0xc2461,_0x37a98a[_0x5a4e('0x44')]);return db[_0x5a4e('0x30')]['find'](_0xc2461)['then'](handleEntityNotFound(_0x407f50,null))['then'](respondWithResult(_0x407f50,null))[_0x5a4e('0x48')](handleError(_0x407f50,null));};exports[_0x5a4e('0x4b')]=function(_0x85eb31,_0x5e817e){return db[_0x5a4e('0x30')][_0x5a4e('0x4b')](_0x85eb31['body'],{})[_0x5a4e('0x2a')](respondWithResult(_0x5e817e,0xc9))['catch'](handleError(_0x5e817e,null));};exports[_0x5a4e('0x4c')]=function(_0x188093,_0x24e784){if(_0x188093[_0x5a4e('0x4d')]['id']){delete _0x188093['body']['id'];}return db[_0x5a4e('0x30')][_0x5a4e('0x4e')]({'where':{'id':_0x188093[_0x5a4e('0x4a')]['id']}})['then'](handleEntityNotFound(_0x24e784,null))[_0x5a4e('0x2a')](saveUpdates(_0x188093[_0x5a4e('0x4d')],null))['then'](respondWithResult(_0x24e784,null))[_0x5a4e('0x48')](handleError(_0x24e784,null));};exports[_0x5a4e('0x29')]=function(_0xafc1fe,_0x150ae8){return db[_0x5a4e('0x30')][_0x5a4e('0x4e')]({'where':{'id':_0xafc1fe[_0x5a4e('0x4a')]['id']}})[_0x5a4e('0x2a')](handleEntityNotFound(_0x150ae8,null))[_0x5a4e('0x2a')](removeEntity(_0x150ae8,null))[_0x5a4e('0x48')](handleError(_0x150ae8,null));};exports['getFields']=function(_0x53f614,_0x5d8d02,_0x3153a7){var _0xed0542={};var _0x383775={};var _0x3a001;var _0x321eb7;return db['ZendeskConfiguration'][_0x5a4e('0x4f')]({'where':{'id':_0x53f614[_0x5a4e('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5d8d02,null))[_0x5a4e('0x2a')](function(_0x239e3c){if(_0x239e3c){_0x3a001=_0x239e3c;_0x383775['model']=_['keys'](db[_0x5a4e('0x50')]['rawAttributes']);_0x383775[_0x5a4e('0x35')]=_[_0x5a4e('0x36')](_0x53f614[_0x5a4e('0x35')]);_0x383775[_0x5a4e('0x37')]=_[_0x5a4e('0x38')](_0x383775[_0x5a4e('0x34')],_0x383775['query']);_0xed0542[_0x5a4e('0x39')]=_[_0x5a4e('0x38')](_0x383775[_0x5a4e('0x34')],qs[_0x5a4e('0x3a')](_0x53f614[_0x5a4e('0x35')][_0x5a4e('0x3a')]));_0xed0542[_0x5a4e('0x39')]=_0xed0542[_0x5a4e('0x39')]['length']?_0xed0542[_0x5a4e('0x39')]:_0x383775[_0x5a4e('0x34')];_0xed0542['order']=qs['sort'](_0x53f614[_0x5a4e('0x35')][_0x5a4e('0x3e')]);_0xed0542[_0x5a4e('0x41')]=qs[_0x5a4e('0x37')](_[_0x5a4e('0x3f')](_0x53f614[_0x5a4e('0x35')],_0x383775['filters']));if(_0x53f614['query'][_0x5a4e('0x40')]){_0xed0542['where']=_[_0x5a4e('0x42')](_0xed0542['where'],{'$or':_['map'](_0xed0542['attributes'],function(_0x101dab){var _0x4fac01={};_0x4fac01[_0x101dab]={'$like':'%'+_0x53f614[_0x5a4e('0x35')][_0x5a4e('0x40')]+'%'};return _0x4fac01;})});}_0xed0542=_[_0x5a4e('0x42')]({},_0xed0542,_0x53f614[_0x5a4e('0x44')]);return _0x3a001[_0x5a4e('0x51')](_0xed0542);}})['then'](function(_0xd83f97){if(_0xd83f97){_0x321eb7=_0xd83f97[_0x5a4e('0x3b')];if(!_0x53f614[_0x5a4e('0x35')][_0x5a4e('0x3c')](_0x5a4e('0x3d'))){_0xed0542[_0x5a4e('0x21')]=qs[_0x5a4e('0x21')](_0x53f614[_0x5a4e('0x35')][_0x5a4e('0x21')]);_0xed0542[_0x5a4e('0x23')]=qs['offset'](_0x53f614[_0x5a4e('0x35')][_0x5a4e('0x23')]);}return _0x3a001['getFields'](_0xed0542);}})[_0x5a4e('0x2a')](function(_0x1899de){if(_0x1899de){return _0x1899de?{'count':_0x321eb7,'rows':_0x1899de}:null;}})[_0x5a4e('0x2a')](respondWithResult(_0x5d8d02,null))[_0x5a4e('0x48')](handleError(_0x5d8d02,null));};exports[_0x5a4e('0x52')]=function(_0x3b2c99,_0x439724,_0x42bc22){var _0x289e9b={};var _0x1d3bc5={};var _0x1fb5c3;var _0x4edd3a;return db['ZendeskConfiguration'][_0x5a4e('0x4f')]({'where':{'id':_0x3b2c99[_0x5a4e('0x4a')]['id']}})['then'](handleEntityNotFound(_0x439724,null))[_0x5a4e('0x2a')](function(_0xba212){if(_0xba212){_0x1fb5c3=_0xba212;_0x1d3bc5[_0x5a4e('0x34')]=_[_0x5a4e('0x36')](db['ZendeskField'][_0x5a4e('0x31')]);_0x1d3bc5['query']=_[_0x5a4e('0x36')](_0x3b2c99[_0x5a4e('0x35')]);_0x1d3bc5[_0x5a4e('0x37')]=_[_0x5a4e('0x38')](_0x1d3bc5[_0x5a4e('0x34')],_0x1d3bc5[_0x5a4e('0x35')]);_0x289e9b[_0x5a4e('0x39')]=_[_0x5a4e('0x38')](_0x1d3bc5[_0x5a4e('0x34')],qs[_0x5a4e('0x3a')](_0x3b2c99[_0x5a4e('0x35')][_0x5a4e('0x3a')]));_0x289e9b['attributes']=_0x289e9b[_0x5a4e('0x39')][_0x5a4e('0x3b')]?_0x289e9b[_0x5a4e('0x39')]:_0x1d3bc5[_0x5a4e('0x34')];_0x289e9b[_0x5a4e('0x53')]=qs[_0x5a4e('0x3e')](_0x3b2c99[_0x5a4e('0x35')][_0x5a4e('0x3e')]);_0x289e9b['where']=qs[_0x5a4e('0x37')](_[_0x5a4e('0x3f')](_0x3b2c99[_0x5a4e('0x35')],_0x1d3bc5[_0x5a4e('0x37')]));if(_0x3b2c99[_0x5a4e('0x35')]['filter']){_0x289e9b[_0x5a4e('0x41')]=_[_0x5a4e('0x42')](_0x289e9b[_0x5a4e('0x41')],{'$or':_[_0x5a4e('0x2f')](_0x289e9b[_0x5a4e('0x39')],function(_0x11710e){var _0x4e3acd={};_0x4e3acd[_0x11710e]={'$like':'%'+_0x3b2c99[_0x5a4e('0x35')][_0x5a4e('0x40')]+'%'};return _0x4e3acd;})});}_0x289e9b=_[_0x5a4e('0x42')]({},_0x289e9b,_0x3b2c99[_0x5a4e('0x44')]);return _0x1fb5c3[_0x5a4e('0x52')](_0x289e9b);}})['then'](function(_0x372c06){if(_0x372c06){_0x4edd3a=_0x372c06[_0x5a4e('0x3b')];if(!_0x3b2c99['query'][_0x5a4e('0x3c')]('nolimit')){_0x289e9b[_0x5a4e('0x21')]=qs['limit'](_0x3b2c99[_0x5a4e('0x35')][_0x5a4e('0x21')]);_0x289e9b[_0x5a4e('0x23')]=qs[_0x5a4e('0x23')](_0x3b2c99[_0x5a4e('0x35')][_0x5a4e('0x23')]);}return _0x1fb5c3[_0x5a4e('0x52')](_0x289e9b);}})[_0x5a4e('0x2a')](function(_0x24e88d){if(_0x24e88d){return _0x24e88d?{'count':_0x4edd3a,'rows':_0x24e88d}:null;}})[_0x5a4e('0x2a')](respondWithResult(_0x439724,null))['catch'](handleError(_0x439724,null));};exports[_0x5a4e('0x54')]=function(_0x4f5764,_0x38e21c,_0x1b0022){var _0x469671={};var _0x55c295={};var _0x1e24b2;var _0x30efd0;return db[_0x5a4e('0x30')][_0x5a4e('0x4f')]({'where':{'id':_0x4f5764['params']['id']}})['then'](handleEntityNotFound(_0x38e21c,null))['then'](function(_0x2fa6f4){if(_0x2fa6f4){_0x1e24b2=_0x2fa6f4;_0x55c295['model']=_[_0x5a4e('0x36')](db['ZendeskField']['rawAttributes']);_0x55c295[_0x5a4e('0x35')]=_[_0x5a4e('0x36')](_0x4f5764[_0x5a4e('0x35')]);_0x55c295[_0x5a4e('0x37')]=_[_0x5a4e('0x38')](_0x55c295[_0x5a4e('0x34')],_0x55c295[_0x5a4e('0x35')]);_0x469671['attributes']=_[_0x5a4e('0x38')](_0x55c295[_0x5a4e('0x34')],qs[_0x5a4e('0x3a')](_0x4f5764[_0x5a4e('0x35')]['fields']));_0x469671['attributes']=_0x469671[_0x5a4e('0x39')]['length']?_0x469671[_0x5a4e('0x39')]:_0x55c295[_0x5a4e('0x34')];_0x469671[_0x5a4e('0x53')]=qs[_0x5a4e('0x3e')](_0x4f5764['query'][_0x5a4e('0x3e')]);_0x469671['where']=qs[_0x5a4e('0x37')](_[_0x5a4e('0x3f')](_0x4f5764[_0x5a4e('0x35')],_0x55c295[_0x5a4e('0x37')]));if(_0x4f5764['query'][_0x5a4e('0x40')]){_0x469671[_0x5a4e('0x41')]=_[_0x5a4e('0x42')](_0x469671[_0x5a4e('0x41')],{'$or':_[_0x5a4e('0x2f')](_0x469671['attributes'],function(_0x36e84b){var _0xc24ba8={};_0xc24ba8[_0x36e84b]={'$like':'%'+_0x4f5764[_0x5a4e('0x35')][_0x5a4e('0x40')]+'%'};return _0xc24ba8;})});}_0x469671=_[_0x5a4e('0x42')]({},_0x469671,_0x4f5764[_0x5a4e('0x44')]);return _0x1e24b2['getDescriptions'](_0x469671);}})['then'](function(_0x49ccf1){if(_0x49ccf1){_0x30efd0=_0x49ccf1[_0x5a4e('0x3b')];if(!_0x4f5764[_0x5a4e('0x35')][_0x5a4e('0x3c')](_0x5a4e('0x3d'))){_0x469671[_0x5a4e('0x21')]=qs['limit'](_0x4f5764[_0x5a4e('0x35')][_0x5a4e('0x21')]);_0x469671[_0x5a4e('0x23')]=qs[_0x5a4e('0x23')](_0x4f5764[_0x5a4e('0x35')][_0x5a4e('0x23')]);}return _0x1e24b2['getDescriptions'](_0x469671);}})[_0x5a4e('0x2a')](function(_0x37ec21){if(_0x37ec21){return _0x37ec21?{'count':_0x30efd0,'rows':_0x37ec21}:null;}})[_0x5a4e('0x2a')](respondWithResult(_0x38e21c,null))[_0x5a4e('0x48')](handleError(_0x38e21c,null));};exports[_0x5a4e('0x55')]=function(_0x5f2755,_0xf24a5e,_0x26a509){var _0x2c8e59={};var _0x48f0b7={};var _0x43f814;var _0x26d3e5;return db[_0x5a4e('0x30')]['findOne']({'where':{'id':_0x5f2755[_0x5a4e('0x4a')]['id']}})[_0x5a4e('0x2a')](handleEntityNotFound(_0xf24a5e,null))['then'](function(_0x502d04){if(_0x502d04){_0x43f814=_0x502d04;_0x48f0b7[_0x5a4e('0x34')]=_[_0x5a4e('0x36')](db[_0x5a4e('0x56')][_0x5a4e('0x31')]);_0x48f0b7['query']=_[_0x5a4e('0x36')](_0x5f2755[_0x5a4e('0x35')]);_0x48f0b7[_0x5a4e('0x37')]=_[_0x5a4e('0x38')](_0x48f0b7[_0x5a4e('0x34')],_0x48f0b7['query']);_0x2c8e59[_0x5a4e('0x39')]=_[_0x5a4e('0x38')](_0x48f0b7[_0x5a4e('0x34')],qs[_0x5a4e('0x3a')](_0x5f2755[_0x5a4e('0x35')]['fields']));_0x2c8e59[_0x5a4e('0x39')]=_0x2c8e59[_0x5a4e('0x39')][_0x5a4e('0x3b')]?_0x2c8e59[_0x5a4e('0x39')]:_0x48f0b7[_0x5a4e('0x34')];_0x2c8e59['order']=qs['sort'](_0x5f2755['query'][_0x5a4e('0x3e')]);_0x2c8e59[_0x5a4e('0x41')]=qs[_0x5a4e('0x37')](_['pick'](_0x5f2755[_0x5a4e('0x35')],_0x48f0b7['filters']));if(_0x5f2755[_0x5a4e('0x35')][_0x5a4e('0x40')]){_0x2c8e59[_0x5a4e('0x41')]=_[_0x5a4e('0x42')](_0x2c8e59[_0x5a4e('0x41')],{'$or':_['map'](_0x2c8e59[_0x5a4e('0x39')],function(_0x2310ab){var _0x2b25eb={};_0x2b25eb[_0x2310ab]={'$like':'%'+_0x5f2755['query']['filter']+'%'};return _0x2b25eb;})});}_0x2c8e59=_['merge']({},_0x2c8e59,_0x5f2755[_0x5a4e('0x44')]);return _0x43f814[_0x5a4e('0x55')](_0x2c8e59);}})[_0x5a4e('0x2a')](function(_0x561242){if(_0x561242){_0x26d3e5=_0x561242[_0x5a4e('0x3b')];if(!_0x5f2755[_0x5a4e('0x35')][_0x5a4e('0x3c')](_0x5a4e('0x3d'))){_0x2c8e59['limit']=qs[_0x5a4e('0x21')](_0x5f2755[_0x5a4e('0x35')]['limit']);_0x2c8e59[_0x5a4e('0x23')]=qs[_0x5a4e('0x23')](_0x5f2755[_0x5a4e('0x35')]['offset']);}return _0x43f814[_0x5a4e('0x55')](_0x2c8e59);}})[_0x5a4e('0x2a')](function(_0x2aff9c){if(_0x2aff9c){return _0x2aff9c?{'count':_0x26d3e5,'rows':_0x2aff9c}:null;}})[_0x5a4e('0x2a')](respondWithResult(_0xf24a5e,null))[_0x5a4e('0x48')](handleError(_0xf24a5e,null));};exports[_0x5a4e('0x57')]=function(_0x52505d,_0x2ed5a0,_0x4ebb1a){if(_0x52505d[_0x5a4e('0x4d')]['id']){delete _0x52505d[_0x5a4e('0x4d')]['id'];}return db[_0x5a4e('0x30')]['findOne']({'where':{'id':_0x52505d[_0x5a4e('0x4a')]['id']}})[_0x5a4e('0x2a')](handleEntityNotFound(_0x2ed5a0,null))[_0x5a4e('0x2a')](function(_0x2601bc){if(_0x2601bc){return _0x2601bc[_0x5a4e('0x57')](_0x52505d[_0x5a4e('0x4d')][_0x5a4e('0x58')]||[]);}return null;})[_0x5a4e('0x2a')](respondWithResult(_0x2ed5a0,null))[_0x5a4e('0x48')](handleError(_0x2ed5a0,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 15ca6b0..9d7802a 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 _0xd4f4=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','define','ZendeskConfiguration','int_zendesk_configurations','lodash'];(function(_0x3bab09,_0x217c29){var _0x164376=function(_0x277730){while(--_0x277730){_0x3bab09['push'](_0x3bab09['shift']());}};_0x164376(++_0x217c29);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x1016df,_0x384371){_0x1016df=_0x1016df-0x0;var _0x45e3ac=_0xd4f4[_0x1016df];return _0x45e3ac;};'use strict';var _=require(_0x4d4f('0x0'));var util=require(_0x4d4f('0x1'));var logger=require(_0x4d4f('0x2'))(_0x4d4f('0x3'));var moment=require(_0x4d4f('0x4'));var BPromise=require(_0x4d4f('0x5'));var rp=require(_0x4d4f('0x6'));var fs=require('fs');var path=require(_0x4d4f('0x7'));var rimraf=require(_0x4d4f('0x8'));var config=require(_0x4d4f('0x9'));var attributes=require(_0x4d4f('0xa'));module['exports']=function(_0x5f451b,_0x5e38d2){return _0x5f451b[_0x4d4f('0xb')](_0x4d4f('0xc'),attributes,{'tableName':_0x4d4f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0598=['ZendeskConfiguration','int_zendesk_configurations','lodash','util','api','request-promise','path','exports'];(function(_0x1e6e4e,_0x2b1b09){var _0x3d746b=function(_0x4483dd){while(--_0x4483dd){_0x1e6e4e['push'](_0x1e6e4e['shift']());}};_0x3d746b(++_0x2b1b09);}(_0x0598,0x92));var _0x8059=function(_0x153943,_0x410d23){_0x153943=_0x153943-0x0;var _0x1702a3=_0x0598[_0x153943];return _0x1702a3;};'use strict';var _=require(_0x8059('0x0'));var util=require(_0x8059('0x1'));var logger=require('../../config/logger')(_0x8059('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8059('0x3'));var fs=require('fs');var path=require(_0x8059('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intZendeskConfiguration.attributes');module[_0x8059('0x5')]=function(_0xa7d7c1,_0x512c0f){return _0xa7d7c1['define'](_0x8059('0x6'),attributes,{'tableName':_0x8059('0x7'),'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 45dfc56..987348f 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 _0x511f=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','bluebird','../../mysqldb'];(function(_0x2615de,_0x479786){var _0x14bb5a=function(_0x29e032){while(--_0x29e032){_0x2615de['push'](_0x2615de['shift']());}};_0x14bb5a(++_0x479786);}(_0x511f,0x1a0));var _0xf511=function(_0x50d741,_0x5789e4){_0x50d741=_0x50d741-0x0;var _0x3b8086=_0x511f[_0x50d741];return _0x3b8086;};'use strict';var _=require(_0xf511('0x0'));var util=require(_0xf511('0x1'));var moment=require('moment');var BPromise=require(_0xf511('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf511('0x3'))['db'];var utils=require(_0xf511('0x4'));var logger=require(_0xf511('0x5'))(_0xf511('0x6'));var config=require(_0xf511('0x7'));var jayson=require(_0xf511('0x8'));var client=jayson[_0xf511('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a9cce,_0x50f70b,_0xefdfe3){return new BPromise(function(_0x30f0ad,_0x3be115){return client[_0xf511('0xa')](_0x3a9cce,_0xefdfe3)[_0xf511('0xb')](function(_0x4f8dc7){logger[_0xf511('0xc')](_0xf511('0xd'),_0x50f70b,_0xf511('0xe'));logger[_0xf511('0xf')](_0xf511('0x10'),_0x50f70b,'request\x20sent',JSON[_0xf511('0x11')](_0x4f8dc7));if(_0x4f8dc7['error']){if(_0x4f8dc7[_0xf511('0x12')][_0xf511('0x13')]===0x1f4){logger[_0xf511('0x12')]('ZendeskConfiguration,\x20%s,\x20%s',_0x50f70b,_0x4f8dc7[_0xf511('0x12')][_0xf511('0x14')]);return _0x3be115(_0x4f8dc7['error'][_0xf511('0x14')]);}logger[_0xf511('0x12')](_0xf511('0xd'),_0x50f70b,_0x4f8dc7['error'][_0xf511('0x14')]);return _0x30f0ad(_0x4f8dc7[_0xf511('0x12')]['message']);}else{logger[_0xf511('0xc')](_0xf511('0xd'),_0x50f70b,_0xf511('0xe'));_0x30f0ad(_0x4f8dc7['result'][_0xf511('0x14')]);}})['catch'](function(_0x1f3ce8){logger[_0xf511('0x12')](_0xf511('0xd'),_0x50f70b,_0x1f3ce8);_0x3be115(_0x1f3ce8);});});} \ No newline at end of file +var _0x7b4e=['ZendeskConfiguration,\x20%s,\x20%s','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7b4e,0x120));var _0xe7b4=function(_0x4f12b1,_0x3ed71d){_0x4f12b1=_0x4f12b1-0x0;var _0x54d002=_0x7b4e[_0x4f12b1];return _0x54d002;};'use strict';var _=require(_0xe7b4('0x0'));var util=require(_0xe7b4('0x1'));var moment=require('moment');var BPromise=require(_0xe7b4('0x2'));var rs=require(_0xe7b4('0x3'));var fs=require('fs');var Redis=require(_0xe7b4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe7b4('0x5'));var logger=require(_0xe7b4('0x6'))('rpc');var config=require(_0xe7b4('0x7'));var jayson=require(_0xe7b4('0x8'));var client=jayson['client'][_0xe7b4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x49a15d,_0x1c0c5e,_0x2949c6){return new BPromise(function(_0x17f0a1,_0x370dd1){return client['request'](_0x49a15d,_0x2949c6)[_0xe7b4('0xa')](function(_0x4a5a2a){logger[_0xe7b4('0xb')](_0xe7b4('0xc'),_0x1c0c5e,'request\x20sent');logger['debug'](_0xe7b4('0xd'),_0x1c0c5e,_0xe7b4('0xe'),JSON[_0xe7b4('0xf')](_0x4a5a2a));if(_0x4a5a2a[_0xe7b4('0x10')]){if(_0x4a5a2a['error'][_0xe7b4('0x11')]===0x1f4){logger['error'](_0xe7b4('0xc'),_0x1c0c5e,_0x4a5a2a[_0xe7b4('0x10')][_0xe7b4('0x12')]);return _0x370dd1(_0x4a5a2a[_0xe7b4('0x10')][_0xe7b4('0x12')]);}logger[_0xe7b4('0x10')](_0xe7b4('0xc'),_0x1c0c5e,_0x4a5a2a[_0xe7b4('0x10')][_0xe7b4('0x12')]);return _0x17f0a1(_0x4a5a2a[_0xe7b4('0x10')]['message']);}else{logger[_0xe7b4('0xb')](_0xe7b4('0xc'),_0x1c0c5e,'request\x20sent');_0x17f0a1(_0x4a5a2a['result'][_0xe7b4('0x12')]);}})[_0xe7b4('0x13')](function(_0x2932a7){logger['error'](_0xe7b4('0xc'),_0x1c0c5e,_0x2932a7);_0x370dd1(_0x2932a7);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 8502730..80a35d2 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 _0xc8c6=['put','update','/:id','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskField.controller','get','isAuthenticated','index','show','create'];(function(_0x34b9a2,_0x305f6d){var _0x401ee2=function(_0xae6c53){while(--_0xae6c53){_0x34b9a2['push'](_0x34b9a2['shift']());}};_0x401ee2(++_0x305f6d);}(_0xc8c6,0x103));var _0x6c8c=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0xc8c6[_0xc8a931];return _0x28bd27;};'use strict';var multer=require(_0x6c8c('0x0'));var util=require(_0x6c8c('0x1'));var path=require(_0x6c8c('0x2'));var timeout=require('connect-timeout');var express=require(_0x6c8c('0x3'));var router=express['Router']();var fs_extra=require(_0x6c8c('0x4'));var auth=require(_0x6c8c('0x5'));var interaction=require(_0x6c8c('0x6'));var config=require('../../config/environment');var controller=require(_0x6c8c('0x7'));router[_0x6c8c('0x8')]('/',auth[_0x6c8c('0x9')](),controller[_0x6c8c('0xa')]);router[_0x6c8c('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x6c8c('0xb')]);router['post']('/',auth[_0x6c8c('0x9')](),controller[_0x6c8c('0xc')]);router[_0x6c8c('0xd')]('/:id',auth[_0x6c8c('0x9')](),controller[_0x6c8c('0xe')]);router['delete'](_0x6c8c('0xf'),auth[_0x6c8c('0x9')](),controller['destroy']);module[_0x6c8c('0x10')]=router; \ No newline at end of file +var _0xf51a=['../../config/environment','./intZendeskField.controller','isAuthenticated','index','get','/:id','show','post','put','update','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x28fa3c,_0x3f7121){var _0x542bbf=function(_0x256c34){while(--_0x256c34){_0x28fa3c['push'](_0x28fa3c['shift']());}};_0x542bbf(++_0x3f7121);}(_0xf51a,0xae));var _0xaf51=function(_0x2b7fd3,_0x17556d){_0x2b7fd3=_0x2b7fd3-0x0;var _0x1bd260=_0xf51a[_0x2b7fd3];return _0x1bd260;};'use strict';var multer=require(_0xaf51('0x0'));var util=require('util');var path=require(_0xaf51('0x1'));var timeout=require(_0xaf51('0x2'));var express=require('express');var router=express[_0xaf51('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xaf51('0x4'));var interaction=require(_0xaf51('0x5'));var config=require(_0xaf51('0x6'));var controller=require(_0xaf51('0x7'));router['get']('/',auth[_0xaf51('0x8')](),controller[_0xaf51('0x9')]);router[_0xaf51('0xa')](_0xaf51('0xb'),auth[_0xaf51('0x8')](),controller[_0xaf51('0xc')]);router[_0xaf51('0xd')]('/',auth[_0xaf51('0x8')](),controller['create']);router[_0xaf51('0xe')](_0xaf51('0xb'),auth[_0xaf51('0x8')](),controller[_0xaf51('0xf')]);router['delete'](_0xaf51('0xb'),auth['isAuthenticated'](),controller[_0xaf51('0x10')]);module[_0xaf51('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index bd5d54e..9e9c439 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 _0x524e=['sequelize','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x24be16,_0x41939c){var _0x1630b4=function(_0x35eab8){while(--_0x35eab8){_0x24be16['push'](_0x24be16['shift']());}};_0x1630b4(++_0x41939c);}(_0x524e,0x98));var _0xe524=function(_0x2728ba,_0x8e9253){_0x2728ba=_0x2728ba-0x0;var _0x4e9c3b=_0x524e[_0x2728ba];return _0x4e9c3b;};'use strict';var Sequelize=require(_0xe524('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xe524('0x1'),_0xe524('0x2'),_0xe524('0x3'),_0xe524('0x4'),_0xe524('0x5')),'defaultValue':_0xe524('0x1')},'content':{'type':Sequelize[_0xe524('0x6')]},'key':{'type':Sequelize[_0xe524('0x6')]},'keyType':{'type':Sequelize['ENUM']('string','variable',_0xe524('0x3'))},'keyContent':{'type':Sequelize[_0xe524('0x6')]},'idField':{'type':Sequelize[_0xe524('0x6')]},'nameField':{'type':Sequelize[_0xe524('0x6')]},'customField':{'type':Sequelize[_0xe524('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe524('0x6')]}}; \ No newline at end of file +var _0xc938=['string','variable','customVariable','keyValue','picklist','STRING','sequelize','exports','ENUM'];(function(_0x633415,_0x3a2fab){var _0xf8ff45=function(_0x313cf7){while(--_0x313cf7){_0x633415['push'](_0x633415['shift']());}};_0xf8ff45(++_0x3a2fab);}(_0xc938,0xf0));var _0x8c93=function(_0x53031c,_0xdde2b8){_0x53031c=_0x53031c-0x0;var _0x5662cd=_0xc938[_0x53031c];return _0x5662cd;};'use strict';var Sequelize=require(_0x8c93('0x0'));module[_0x8c93('0x1')]={'type':{'type':Sequelize[_0x8c93('0x2')](_0x8c93('0x3'),_0x8c93('0x4'),_0x8c93('0x5'),_0x8c93('0x6'),_0x8c93('0x7')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x8c93('0x8')]},'keyType':{'type':Sequelize[_0x8c93('0x2')](_0x8c93('0x3'),_0x8c93('0x4'),_0x8c93('0x5'))},'keyContent':{'type':Sequelize[_0x8c93('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x8c93('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8c93('0x8')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index ab63d5c..80986f6 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 _0xaf80=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','ZendeskField','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','options','include','findAll','rows','show','includeAll','catch','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service'];(function(_0x4a8c28,_0x2b0254){var _0x1ee153=function(_0xb8cf9e){while(--_0xb8cf9e){_0x4a8c28['push'](_0x4a8c28['shift']());}};_0x1ee153(++_0x2b0254);}(_0xaf80,0x1ef));var _0x0af8=function(_0x1d80c1,_0x15353a){_0x1d80c1=_0x1d80c1-0x0;var _0x529dd0=_0xaf80[_0x1d80c1];return _0x529dd0;};'use strict';var emlformat=require(_0x0af8('0x0'));var rimraf=require(_0x0af8('0x1'));var zipdir=require(_0x0af8('0x2'));var jsonpatch=require(_0x0af8('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0af8('0x4'));var util=require(_0x0af8('0x5'));var path=require(_0x0af8('0x6'));var sox=require(_0x0af8('0x7'));var csv=require(_0x0af8('0x8'));var ejs=require(_0x0af8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0af8('0xa'));var crypto=require('crypto');var jsforce=require(_0x0af8('0xb'));var deskjs=require(_0x0af8('0xc'));var toCsv=require(_0x0af8('0x8'));var querystring=require('querystring');var Papa=require(_0x0af8('0xd'));var Redis=require(_0x0af8('0xe'));var authService=require(_0x0af8('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0af8('0x10'));var logger=require(_0x0af8('0x11'))(_0x0af8('0x12'));var utils=require(_0x0af8('0x13'));var config=require(_0x0af8('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x0af8('0x15'))['db'];function respondWithStatusCode(_0x2d5892,_0x465135){_0x465135=_0x465135||0xcc;return function(_0x31d390){if(_0x31d390){return _0x2d5892[_0x0af8('0x16')](_0x465135);}return _0x2d5892[_0x0af8('0x17')](_0x465135)[_0x0af8('0x18')]();};}function respondWithResult(_0x58a9a8,_0x58ef18){_0x58ef18=_0x58ef18||0xc8;return function(_0x420432){if(_0x420432){return _0x58a9a8[_0x0af8('0x17')](_0x58ef18)[_0x0af8('0x19')](_0x420432);}};}function respondWithFilteredResult(_0x216f0b,_0x2a42a4){return function(_0x1997b8){if(_0x1997b8){var _0x4755cb=typeof _0x2a42a4[_0x0af8('0x1a')]==='undefined'&&typeof _0x2a42a4['limit']==='undefined';var _0x3294ce=_0x1997b8[_0x0af8('0x1b')];var _0x54e946=_0x4755cb?0x0:_0x2a42a4[_0x0af8('0x1a')];var _0x230a68=_0x4755cb?_0x1997b8[_0x0af8('0x1b')]:_0x2a42a4['offset']+_0x2a42a4['limit'];var _0x50b8fa;if(_0x230a68>=_0x3294ce){_0x230a68=_0x3294ce;_0x50b8fa=0xc8;}else{_0x50b8fa=0xce;}_0x216f0b[_0x0af8('0x17')](_0x50b8fa);return _0x216f0b[_0x0af8('0x1c')]('Content-Range',_0x54e946+'-'+_0x230a68+'/'+_0x3294ce)[_0x0af8('0x19')](_0x1997b8);}return null;};}function patchUpdates(_0x4891e6){return function(_0x5cbf28){try{jsonpatch[_0x0af8('0x1d')](_0x5cbf28,_0x4891e6,!![]);}catch(_0x2e0b36){return BPromise[_0x0af8('0x1e')](_0x2e0b36);}return _0x5cbf28[_0x0af8('0x1f')]();};}function saveUpdates(_0x162e95,_0x52778f){return function(_0x592523){if(_0x592523){return _0x592523[_0x0af8('0x20')](_0x162e95)[_0x0af8('0x21')](function(_0x4b0492){return _0x4b0492;});}return null;};}function removeEntity(_0x300474,_0x320d0c){return function(_0x404b25){if(_0x404b25){return _0x404b25[_0x0af8('0x22')]()[_0x0af8('0x21')](function(){_0x300474['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c6306,_0x3b2a80){return function(_0x359583){if(!_0x359583){_0x1c6306[_0x0af8('0x16')](0x194);}return _0x359583;};}function handleError(_0x510efc,_0x500fd5){_0x500fd5=_0x500fd5||0x1f4;return function(_0x315ad){logger[_0x0af8('0x23')](_0x315ad[_0x0af8('0x24')]);if(_0x315ad[_0x0af8('0x25')]){delete _0x315ad[_0x0af8('0x25')];}_0x510efc[_0x0af8('0x17')](_0x500fd5)[_0x0af8('0x26')](_0x315ad);};}exports['index']=function(_0x34aa8b,_0xf898cc){var _0x1a7fdf={},_0x20eab4={},_0x1b94cf={'count':0x0,'rows':[]};var _0x231230=_[_0x0af8('0x27')](db[_0x0af8('0x28')][_0x0af8('0x29')],function(_0x270b49){return{'name':_0x270b49[_0x0af8('0x2a')],'type':_0x270b49['type'][_0x0af8('0x2b')]};});_0x20eab4['model']=_[_0x0af8('0x27')](_0x231230,'name');_0x20eab4[_0x0af8('0x2c')]=_[_0x0af8('0x2d')](_0x34aa8b['query']);_0x20eab4[_0x0af8('0x2e')]=_[_0x0af8('0x2f')](_0x20eab4[_0x0af8('0x30')],_0x20eab4['query']);_0x1a7fdf[_0x0af8('0x31')]=_[_0x0af8('0x2f')](_0x20eab4[_0x0af8('0x30')],qs['fields'](_0x34aa8b[_0x0af8('0x2c')][_0x0af8('0x32')]));_0x1a7fdf[_0x0af8('0x31')]=_0x1a7fdf[_0x0af8('0x31')][_0x0af8('0x33')]?_0x1a7fdf[_0x0af8('0x31')]:_0x20eab4['model'];if(!_0x34aa8b[_0x0af8('0x2c')][_0x0af8('0x34')](_0x0af8('0x35'))){_0x1a7fdf[_0x0af8('0x36')]=qs[_0x0af8('0x36')](_0x34aa8b[_0x0af8('0x2c')][_0x0af8('0x36')]);_0x1a7fdf[_0x0af8('0x1a')]=qs[_0x0af8('0x1a')](_0x34aa8b[_0x0af8('0x2c')][_0x0af8('0x1a')]);}_0x1a7fdf[_0x0af8('0x37')]=qs['sort'](_0x34aa8b[_0x0af8('0x2c')][_0x0af8('0x38')]);_0x1a7fdf[_0x0af8('0x39')]=qs[_0x0af8('0x2e')](_[_0x0af8('0x3a')](_0x34aa8b[_0x0af8('0x2c')],_0x20eab4[_0x0af8('0x2e')]),_0x231230);if(_0x34aa8b['query'][_0x0af8('0x3b')]){_0x1a7fdf[_0x0af8('0x39')]=_[_0x0af8('0x3c')](_0x1a7fdf['where'],{'$or':_[_0x0af8('0x27')](_0x231230,function(_0x1082de){if(_0x1082de[_0x0af8('0x3d')]!=='VIRTUAL'){var _0x6781fe={};_0x6781fe[_0x1082de[_0x0af8('0x25')]]={'$like':'%'+_0x34aa8b[_0x0af8('0x2c')][_0x0af8('0x3b')]+'%'};return _0x6781fe;}})});}_0x1a7fdf=_[_0x0af8('0x3c')]({},_0x1a7fdf,_0x34aa8b[_0x0af8('0x3e')]);var _0x258872={'where':_0x1a7fdf['where']};return db['ZendeskField'][_0x0af8('0x1b')](_0x258872)[_0x0af8('0x21')](function(_0x5bc8f5){_0x1b94cf[_0x0af8('0x1b')]=_0x5bc8f5;if(_0x34aa8b[_0x0af8('0x2c')]['includeAll']){_0x1a7fdf[_0x0af8('0x3f')]=[{'all':!![]}];}return db['ZendeskField'][_0x0af8('0x40')](_0x1a7fdf);})[_0x0af8('0x21')](function(_0x510bec){_0x1b94cf[_0x0af8('0x41')]=_0x510bec;return _0x1b94cf;})[_0x0af8('0x21')](respondWithFilteredResult(_0xf898cc,_0x1a7fdf))['catch'](handleError(_0xf898cc,null));};exports[_0x0af8('0x42')]=function(_0x496ea4,_0x2e15ec){var _0x423eee={'raw':!![],'where':{'id':_0x496ea4['params']['id']}},_0x141d2f={};_0x141d2f['model']=_[_0x0af8('0x2d')](db[_0x0af8('0x28')][_0x0af8('0x29')]);_0x141d2f[_0x0af8('0x2c')]=_['keys'](_0x496ea4[_0x0af8('0x2c')]);_0x141d2f[_0x0af8('0x2e')]=_[_0x0af8('0x2f')](_0x141d2f['model'],_0x141d2f[_0x0af8('0x2c')]);_0x423eee[_0x0af8('0x31')]=_['intersection'](_0x141d2f[_0x0af8('0x30')],qs['fields'](_0x496ea4[_0x0af8('0x2c')]['fields']));_0x423eee['attributes']=_0x423eee['attributes'][_0x0af8('0x33')]?_0x423eee['attributes']:_0x141d2f[_0x0af8('0x30')];if(_0x496ea4['query'][_0x0af8('0x43')]){_0x423eee[_0x0af8('0x3f')]=[{'all':!![]}];}_0x423eee=_[_0x0af8('0x3c')]({},_0x423eee,_0x496ea4[_0x0af8('0x3e')]);return db[_0x0af8('0x28')]['find'](_0x423eee)['then'](handleEntityNotFound(_0x2e15ec,null))[_0x0af8('0x21')](respondWithResult(_0x2e15ec,null))[_0x0af8('0x44')](handleError(_0x2e15ec,null));};exports[_0x0af8('0x45')]=function(_0x24a104,_0x3d86e2){return db[_0x0af8('0x28')][_0x0af8('0x45')](_0x24a104['body'],{})['then'](respondWithResult(_0x3d86e2,0xc9))[_0x0af8('0x44')](handleError(_0x3d86e2,null));};exports[_0x0af8('0x20')]=function(_0x394525,_0x3c57dd){if(_0x394525['body']['id']){delete _0x394525[_0x0af8('0x46')]['id'];}return db[_0x0af8('0x28')][_0x0af8('0x47')]({'where':{'id':_0x394525[_0x0af8('0x48')]['id']}})[_0x0af8('0x21')](handleEntityNotFound(_0x3c57dd,null))[_0x0af8('0x21')](saveUpdates(_0x394525['body'],null))[_0x0af8('0x21')](respondWithResult(_0x3c57dd,null))['catch'](handleError(_0x3c57dd,null));};exports[_0x0af8('0x22')]=function(_0x4a43e3,_0xeddce9){return db[_0x0af8('0x28')][_0x0af8('0x47')]({'where':{'id':_0x4a43e3['params']['id']}})[_0x0af8('0x21')](handleEntityNotFound(_0xeddce9,null))[_0x0af8('0x21')](removeEntity(_0xeddce9,null))['catch'](handleError(_0xeddce9,null));}; \ No newline at end of file +var _0xb36c=['map','ZendeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','sendStatus','error','name','send','index'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb36c,0xbc));var _0xcb36=function(_0x7e8c5d,_0x4d883d){_0x7e8c5d=_0x7e8c5d-0x0;var _0x19f8e4=_0xb36c[_0x7e8c5d];return _0x19f8e4;};'use strict';var emlformat=require(_0xcb36('0x0'));var rimraf=require(_0xcb36('0x1'));var zipdir=require(_0xcb36('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcb36('0x3'));var moment=require(_0xcb36('0x4'));var BPromise=require(_0xcb36('0x5'));var Mustache=require(_0xcb36('0x6'));var util=require(_0xcb36('0x7'));var path=require(_0xcb36('0x8'));var sox=require(_0xcb36('0x9'));var csv=require(_0xcb36('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcb36('0xb'));var _=require('lodash');var squel=require(_0xcb36('0xc'));var crypto=require(_0xcb36('0xd'));var jsforce=require(_0xcb36('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xcb36('0xa'));var querystring=require(_0xcb36('0xf'));var Papa=require('papaparse');var Redis=require(_0xcb36('0x10'));var authService=require(_0xcb36('0x11'));var qs=require(_0xcb36('0x12'));var as=require(_0xcb36('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcb36('0x14'))(_0xcb36('0x15'));var utils=require(_0xcb36('0x16'));var config=require(_0xcb36('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xcb36('0x18'))['db'];function respondWithStatusCode(_0x4bcfdd,_0xd8e85c){_0xd8e85c=_0xd8e85c||0xcc;return function(_0x53cdb4){if(_0x53cdb4){return _0x4bcfdd['sendStatus'](_0xd8e85c);}return _0x4bcfdd['status'](_0xd8e85c)[_0xcb36('0x19')]();};}function respondWithResult(_0x2ffc63,_0x4676ae){_0x4676ae=_0x4676ae||0xc8;return function(_0x47d8ec){if(_0x47d8ec){return _0x2ffc63[_0xcb36('0x1a')](_0x4676ae)[_0xcb36('0x1b')](_0x47d8ec);}};}function respondWithFilteredResult(_0x39ec31,_0x164e90){return function(_0x49f7ef){if(_0x49f7ef){var _0x128bde=typeof _0x164e90[_0xcb36('0x1c')]===_0xcb36('0x1d')&&typeof _0x164e90[_0xcb36('0x1e')]===_0xcb36('0x1d');var _0x28ff4e=_0x49f7ef[_0xcb36('0x1f')];var _0x7ed4c5=_0x128bde?0x0:_0x164e90['offset'];var _0x3abc2f=_0x128bde?_0x49f7ef[_0xcb36('0x1f')]:_0x164e90['offset']+_0x164e90[_0xcb36('0x1e')];var _0x3cd2fd;if(_0x3abc2f>=_0x28ff4e){_0x3abc2f=_0x28ff4e;_0x3cd2fd=0xc8;}else{_0x3cd2fd=0xce;}_0x39ec31[_0xcb36('0x1a')](_0x3cd2fd);return _0x39ec31[_0xcb36('0x20')](_0xcb36('0x21'),_0x7ed4c5+'-'+_0x3abc2f+'/'+_0x28ff4e)[_0xcb36('0x1b')](_0x49f7ef);}return null;};}function patchUpdates(_0x2ee5f3){return function(_0x20e23a){try{jsonpatch[_0xcb36('0x22')](_0x20e23a,_0x2ee5f3,!![]);}catch(_0x233567){return BPromise['reject'](_0x233567);}return _0x20e23a['save']();};}function saveUpdates(_0x4d5717,_0x3df4bf){return function(_0x2ccbbf){if(_0x2ccbbf){return _0x2ccbbf[_0xcb36('0x23')](_0x4d5717)[_0xcb36('0x24')](function(_0x57f4d0){return _0x57f4d0;});}return null;};}function removeEntity(_0x43ed39,_0x4739c4){return function(_0x2ec2cd){if(_0x2ec2cd){return _0x2ec2cd[_0xcb36('0x25')]()[_0xcb36('0x24')](function(){_0x43ed39[_0xcb36('0x1a')](0xcc)[_0xcb36('0x19')]();});}};}function handleEntityNotFound(_0x4eecf8,_0x16f28d){return function(_0x326d7b){if(!_0x326d7b){_0x4eecf8[_0xcb36('0x26')](0x194);}return _0x326d7b;};}function handleError(_0x1aa43f,_0x29c6c2){_0x29c6c2=_0x29c6c2||0x1f4;return function(_0xa25675){logger[_0xcb36('0x27')](_0xa25675['stack']);if(_0xa25675[_0xcb36('0x28')]){delete _0xa25675[_0xcb36('0x28')];}_0x1aa43f[_0xcb36('0x1a')](_0x29c6c2)[_0xcb36('0x29')](_0xa25675);};}exports[_0xcb36('0x2a')]=function(_0x2ff9cc,_0x233878){var _0x36f5cb={},_0x5629b9={},_0x103bd5={'count':0x0,'rows':[]};var _0x5eb3c9=_[_0xcb36('0x2b')](db[_0xcb36('0x2c')][_0xcb36('0x2d')],function(_0x5855cb){return{'name':_0x5855cb[_0xcb36('0x2e')],'type':_0x5855cb[_0xcb36('0x2f')][_0xcb36('0x30')]};});_0x5629b9[_0xcb36('0x31')]=_[_0xcb36('0x2b')](_0x5eb3c9,_0xcb36('0x28'));_0x5629b9[_0xcb36('0x32')]=_[_0xcb36('0x33')](_0x2ff9cc[_0xcb36('0x32')]);_0x5629b9[_0xcb36('0x34')]=_[_0xcb36('0x35')](_0x5629b9[_0xcb36('0x31')],_0x5629b9[_0xcb36('0x32')]);_0x36f5cb[_0xcb36('0x36')]=_['intersection'](_0x5629b9[_0xcb36('0x31')],qs[_0xcb36('0x37')](_0x2ff9cc[_0xcb36('0x32')][_0xcb36('0x37')]));_0x36f5cb[_0xcb36('0x36')]=_0x36f5cb[_0xcb36('0x36')][_0xcb36('0x38')]?_0x36f5cb[_0xcb36('0x36')]:_0x5629b9[_0xcb36('0x31')];if(!_0x2ff9cc[_0xcb36('0x32')][_0xcb36('0x39')](_0xcb36('0x3a'))){_0x36f5cb[_0xcb36('0x1e')]=qs[_0xcb36('0x1e')](_0x2ff9cc[_0xcb36('0x32')][_0xcb36('0x1e')]);_0x36f5cb[_0xcb36('0x1c')]=qs[_0xcb36('0x1c')](_0x2ff9cc[_0xcb36('0x32')]['offset']);}_0x36f5cb[_0xcb36('0x3b')]=qs[_0xcb36('0x3c')](_0x2ff9cc[_0xcb36('0x32')][_0xcb36('0x3c')]);_0x36f5cb[_0xcb36('0x3d')]=qs[_0xcb36('0x34')](_[_0xcb36('0x3e')](_0x2ff9cc[_0xcb36('0x32')],_0x5629b9[_0xcb36('0x34')]),_0x5eb3c9);if(_0x2ff9cc[_0xcb36('0x32')][_0xcb36('0x3f')]){_0x36f5cb['where']=_[_0xcb36('0x40')](_0x36f5cb[_0xcb36('0x3d')],{'$or':_['map'](_0x5eb3c9,function(_0x1a8440){if(_0x1a8440['type']!==_0xcb36('0x41')){var _0x27b646={};_0x27b646[_0x1a8440[_0xcb36('0x28')]]={'$like':'%'+_0x2ff9cc['query'][_0xcb36('0x3f')]+'%'};return _0x27b646;}})});}_0x36f5cb=_[_0xcb36('0x40')]({},_0x36f5cb,_0x2ff9cc[_0xcb36('0x42')]);var _0x42a322={'where':_0x36f5cb[_0xcb36('0x3d')]};return db[_0xcb36('0x2c')][_0xcb36('0x1f')](_0x42a322)[_0xcb36('0x24')](function(_0x18ce2e){_0x103bd5[_0xcb36('0x1f')]=_0x18ce2e;if(_0x2ff9cc[_0xcb36('0x32')]['includeAll']){_0x36f5cb[_0xcb36('0x43')]=[{'all':!![]}];}return db[_0xcb36('0x2c')][_0xcb36('0x44')](_0x36f5cb);})[_0xcb36('0x24')](function(_0x1e9971){_0x103bd5[_0xcb36('0x45')]=_0x1e9971;return _0x103bd5;})[_0xcb36('0x24')](respondWithFilteredResult(_0x233878,_0x36f5cb))['catch'](handleError(_0x233878,null));};exports[_0xcb36('0x46')]=function(_0x4dd70d,_0x5b345e){var _0x49dc0c={'raw':!![],'where':{'id':_0x4dd70d[_0xcb36('0x47')]['id']}},_0x39222e={};_0x39222e[_0xcb36('0x31')]=_[_0xcb36('0x33')](db['ZendeskField']['rawAttributes']);_0x39222e[_0xcb36('0x32')]=_[_0xcb36('0x33')](_0x4dd70d[_0xcb36('0x32')]);_0x39222e[_0xcb36('0x34')]=_[_0xcb36('0x35')](_0x39222e[_0xcb36('0x31')],_0x39222e[_0xcb36('0x32')]);_0x49dc0c[_0xcb36('0x36')]=_[_0xcb36('0x35')](_0x39222e['model'],qs[_0xcb36('0x37')](_0x4dd70d['query'][_0xcb36('0x37')]));_0x49dc0c['attributes']=_0x49dc0c[_0xcb36('0x36')][_0xcb36('0x38')]?_0x49dc0c['attributes']:_0x39222e[_0xcb36('0x31')];if(_0x4dd70d['query'][_0xcb36('0x48')]){_0x49dc0c[_0xcb36('0x43')]=[{'all':!![]}];}_0x49dc0c=_['merge']({},_0x49dc0c,_0x4dd70d[_0xcb36('0x42')]);return db[_0xcb36('0x2c')][_0xcb36('0x49')](_0x49dc0c)['then'](handleEntityNotFound(_0x5b345e,null))['then'](respondWithResult(_0x5b345e,null))[_0xcb36('0x4a')](handleError(_0x5b345e,null));};exports[_0xcb36('0x4b')]=function(_0x5ec58e,_0x55fcee){return db['ZendeskField'][_0xcb36('0x4b')](_0x5ec58e['body'],{})[_0xcb36('0x24')](respondWithResult(_0x55fcee,0xc9))[_0xcb36('0x4a')](handleError(_0x55fcee,null));};exports[_0xcb36('0x23')]=function(_0x3ddfd1,_0xe4005d){if(_0x3ddfd1[_0xcb36('0x4c')]['id']){delete _0x3ddfd1[_0xcb36('0x4c')]['id'];}return db['ZendeskField'][_0xcb36('0x49')]({'where':{'id':_0x3ddfd1[_0xcb36('0x47')]['id']}})[_0xcb36('0x24')](handleEntityNotFound(_0xe4005d,null))['then'](saveUpdates(_0x3ddfd1[_0xcb36('0x4c')],null))[_0xcb36('0x24')](respondWithResult(_0xe4005d,null))['catch'](handleError(_0xe4005d,null));};exports[_0xcb36('0x25')]=function(_0x1d5f4e,_0x5b6532){return db[_0xcb36('0x2c')][_0xcb36('0x49')]({'where':{'id':_0x1d5f4e[_0xcb36('0x47')]['id']}})[_0xcb36('0x24')](handleEntityNotFound(_0x5b6532,null))[_0xcb36('0x24')](removeEntity(_0x5b6532,null))[_0xcb36('0x4a')](handleError(_0x5b6532,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 34095b5..e75f69f 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 _0xd91f=['define','ZendeskField','int_zendesk_fields','zendesk_unique_index','FieldId','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports'];(function(_0xa7a66b,_0x59a98f){var _0x1fd05a=function(_0x1ca86d){while(--_0x1ca86d){_0xa7a66b['push'](_0xa7a66b['shift']());}};_0x1fd05a(++_0x59a98f);}(_0xd91f,0x75));var _0xfd91=function(_0xe719ec,_0x5a280e){_0xe719ec=_0xe719ec-0x0;var _0x4842a1=_0xd91f[_0xe719ec];return _0x4842a1;};'use strict';var _=require(_0xfd91('0x0'));var util=require('util');var logger=require(_0xfd91('0x1'))('api');var moment=require(_0xfd91('0x2'));var BPromise=require('bluebird');var rp=require(_0xfd91('0x3'));var fs=require('fs');var path=require(_0xfd91('0x4'));var rimraf=require(_0xfd91('0x5'));var config=require(_0xfd91('0x6'));var attributes=require(_0xfd91('0x7'));module[_0xfd91('0x8')]=function(_0x59b918,_0x3405c6){return _0x59b918[_0xfd91('0x9')](_0xfd91('0xa'),attributes,{'tableName':_0xfd91('0xb'),'paranoid':![],'indexes':[{'name':_0xfd91('0xc'),'fields':['idField',_0xfd91('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xae15=['exports','define','ZendeskField','int_zendesk_fields','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0xae15,0xc5));var _0x5ae1=function(_0x32cf2d,_0x4e687a){_0x32cf2d=_0x32cf2d-0x0;var _0x3b9e34=_0xae15[_0x32cf2d];return _0x3b9e34;};'use strict';var _=require(_0x5ae1('0x0'));var util=require(_0x5ae1('0x1'));var logger=require(_0x5ae1('0x2'))(_0x5ae1('0x3'));var moment=require('moment');var BPromise=require(_0x5ae1('0x4'));var rp=require(_0x5ae1('0x5'));var fs=require('fs');var path=require(_0x5ae1('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intZendeskField.attributes');module[_0x5ae1('0x7')]=function(_0x22c2b0,_0x2c2011){return _0x22c2b0[_0x5ae1('0x8')](_0x5ae1('0x9'),attributes,{'tableName':_0x5ae1('0xa'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':['idField',_0x5ae1('0xb')],'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 d42789c..c4cf2f3 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 _0x2e1f=['debug','stringify','error','code','ZendeskField,\x20%s,\x20%s','message','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2e1f,0xee));var _0xf2e1=function(_0x264545,_0x214037){_0x264545=_0x264545-0x0;var _0x114d10=_0x2e1f[_0x264545];return _0x114d10;};'use strict';var _=require(_0xf2e1('0x0'));var util=require(_0xf2e1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf2e1('0x2'));var fs=require('fs');var Redis=require(_0xf2e1('0x3'));var db=require(_0xf2e1('0x4'))['db'];var utils=require(_0xf2e1('0x5'));var logger=require(_0xf2e1('0x6'))(_0xf2e1('0x7'));var config=require(_0xf2e1('0x8'));var jayson=require(_0xf2e1('0x9'));var client=jayson['client'][_0xf2e1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a282d,_0x501770,_0x212373){return new BPromise(function(_0x594e24,_0x162f0f){return client[_0xf2e1('0xb')](_0x3a282d,_0x212373)['then'](function(_0x1cb8c5){logger[_0xf2e1('0xc')]('ZendeskField,\x20%s,\x20%s',_0x501770,_0xf2e1('0xd'));logger[_0xf2e1('0xe')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x501770,'request\x20sent',JSON[_0xf2e1('0xf')](_0x1cb8c5));if(_0x1cb8c5[_0xf2e1('0x10')]){if(_0x1cb8c5[_0xf2e1('0x10')][_0xf2e1('0x11')]===0x1f4){logger[_0xf2e1('0x10')](_0xf2e1('0x12'),_0x501770,_0x1cb8c5[_0xf2e1('0x10')][_0xf2e1('0x13')]);return _0x162f0f(_0x1cb8c5[_0xf2e1('0x10')][_0xf2e1('0x13')]);}logger[_0xf2e1('0x10')](_0xf2e1('0x12'),_0x501770,_0x1cb8c5[_0xf2e1('0x10')][_0xf2e1('0x13')]);return _0x594e24(_0x1cb8c5[_0xf2e1('0x10')][_0xf2e1('0x13')]);}else{logger[_0xf2e1('0xc')](_0xf2e1('0x12'),_0x501770,_0xf2e1('0xd'));_0x594e24(_0x1cb8c5['result'][_0xf2e1('0x13')]);}})[_0xf2e1('0x14')](function(_0x5facc3){logger['error'](_0xf2e1('0x12'),_0x501770,_0x5facc3);_0x162f0f(_0x5facc3);});});} \ No newline at end of file +var _0x4b84=['lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','stringify','error','code','ZendeskField,\x20%s,\x20%s','message','result','catch'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x4b84,0x165));var _0x44b8=function(_0x4b1032,_0x36952e){_0x4b1032=_0x4b1032-0x0;var _0x5a1d55=_0x4b84[_0x4b1032];return _0x5a1d55;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var moment=require(_0x44b8('0x2'));var BPromise=require(_0x44b8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x44b8('0x4'));var logger=require(_0x44b8('0x5'))(_0x44b8('0x6'));var config=require(_0x44b8('0x7'));var jayson=require(_0x44b8('0x8'));var client=jayson[_0x44b8('0x9')][_0x44b8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x101276,_0x288142,_0x11f0b7){return new BPromise(function(_0x54ec55,_0x3174b4){return client['request'](_0x101276,_0x11f0b7)['then'](function(_0x27a4fa){logger[_0x44b8('0xb')]('ZendeskField,\x20%s,\x20%s',_0x288142,_0x44b8('0xc'));logger[_0x44b8('0xd')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x288142,_0x44b8('0xc'),JSON[_0x44b8('0xe')](_0x27a4fa));if(_0x27a4fa[_0x44b8('0xf')]){if(_0x27a4fa[_0x44b8('0xf')][_0x44b8('0x10')]===0x1f4){logger[_0x44b8('0xf')](_0x44b8('0x11'),_0x288142,_0x27a4fa[_0x44b8('0xf')][_0x44b8('0x12')]);return _0x3174b4(_0x27a4fa['error']['message']);}logger['error'](_0x44b8('0x11'),_0x288142,_0x27a4fa['error'][_0x44b8('0x12')]);return _0x54ec55(_0x27a4fa['error']['message']);}else{logger['info']('ZendeskField,\x20%s,\x20%s',_0x288142,'request\x20sent');_0x54ec55(_0x27a4fa[_0x44b8('0x13')][_0x44b8('0x12')]);}})[_0x44b8('0x14')](function(_0x495df8){logger[_0x44b8('0xf')](_0x44b8('0x11'),_0x288142,_0x495df8);_0x3174b4(_0x495df8);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 8944577..bbfea75 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 _0xa338=['put','update','delete','exports','express','Router','fs-extra','../../components/interaction/service','./intZohoAccount.controller','isAuthenticated','/:id','show','get','getConfigurations','/:id/fields','getFields','post','addConfiguration'];(function(_0x4b0290,_0x188c34){var _0x4bd9f4=function(_0x357f3f){while(--_0x357f3f){_0x4b0290['push'](_0x4b0290['shift']());}};_0x4bd9f4(++_0x188c34);}(_0xa338,0xa6));var _0x8a33=function(_0x5483c3,_0x418d8d){_0x5483c3=_0x5483c3-0x0;var _0x19ef72=_0xa338[_0x5483c3];return _0x19ef72;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8a33('0x0'));var router=express[_0x8a33('0x1')]();var fs_extra=require(_0x8a33('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x8a33('0x3'));var config=require('../../config/environment');var controller=require(_0x8a33('0x4'));router['get']('/',auth[_0x8a33('0x5')](),controller['index']);router['get'](_0x8a33('0x6'),auth[_0x8a33('0x5')](),controller[_0x8a33('0x7')]);router[_0x8a33('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x8a33('0x9')]);router[_0x8a33('0x8')](_0x8a33('0xa'),auth['isAuthenticated'](),controller[_0x8a33('0xb')]);router['post']('/',auth[_0x8a33('0x5')](),controller['create']);router[_0x8a33('0xc')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x8a33('0xd')]);router[_0x8a33('0xe')](_0x8a33('0x6'),auth[_0x8a33('0x5')](),controller[_0x8a33('0xf')]);router[_0x8a33('0x10')](_0x8a33('0x6'),auth[_0x8a33('0x5')](),controller['destroy']);module[_0x8a33('0x11')]=router; \ No newline at end of file +var _0xf339=['delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','put'];(function(_0x40dedf,_0x4ac27b){var _0x459ce3=function(_0x302930){while(--_0x302930){_0x40dedf['push'](_0x40dedf['shift']());}};_0x459ce3(++_0x4ac27b);}(_0xf339,0x67));var _0x9f33=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf339[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x9f33('0x0'));var util=require(_0x9f33('0x1'));var path=require('path');var timeout=require(_0x9f33('0x2'));var express=require(_0x9f33('0x3'));var router=express[_0x9f33('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9f33('0x5'));var config=require(_0x9f33('0x6'));var controller=require(_0x9f33('0x7'));router[_0x9f33('0x8')]('/',auth[_0x9f33('0x9')](),controller[_0x9f33('0xa')]);router[_0x9f33('0x8')](_0x9f33('0xb'),auth[_0x9f33('0x9')](),controller[_0x9f33('0xc')]);router[_0x9f33('0x8')](_0x9f33('0xd'),auth[_0x9f33('0x9')](),controller[_0x9f33('0xe')]);router[_0x9f33('0x8')](_0x9f33('0xf'),auth[_0x9f33('0x9')](),controller['getFields']);router['post']('/',auth[_0x9f33('0x9')](),controller['create']);router['post'](_0x9f33('0xd'),auth[_0x9f33('0x9')](),controller['addConfiguration']);router[_0x9f33('0x10')](_0x9f33('0xb'),auth[_0x9f33('0x9')](),controller['update']);router[_0x9f33('0x11')](_0x9f33('0xb'),auth['isAuthenticated'](),controller[_0x9f33('0x12')]);module[_0x9f33('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index e3eff40..462d333 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 _0x4522=['STRING'];(function(_0x20fa11,_0x48b0ca){var _0x2759c1=function(_0x45ac84){while(--_0x45ac84){_0x20fa11['push'](_0x20fa11['shift']());}};_0x2759c1(++_0x48b0ca);}(_0x4522,0x1a0));var _0x2452=function(_0x1feb85,_0x64e1fb){_0x1feb85=_0x1feb85-0x0;var _0x4487c2=_0x4522[_0x1feb85];return _0x4487c2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x2452('0x0')]},'description':{'type':Sequelize[_0x2452('0x0')]},'host':{'type':Sequelize[_0x2452('0x0')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x2452('0x0')]},'clientSecret':{'type':Sequelize[_0x2452('0x0')]},'serverUrl':{'type':Sequelize[_0x2452('0x0')],'allowNull':![]},'code':{'type':Sequelize[_0x2452('0x0')]},'refreshToken':{'type':Sequelize[_0x2452('0x0')]}}; \ No newline at end of file +var _0x4b84=['STRING','sequelize','exports'];(function(_0x118fb2,_0x122eb6){var _0x82f064=function(_0x4820fa){while(--_0x4820fa){_0x118fb2['push'](_0x118fb2['shift']());}};_0x82f064(++_0x122eb6);}(_0x4b84,0x1cc));var _0x44b8=function(_0xbbfe59,_0x46067f){_0xbbfe59=_0xbbfe59-0x0;var _0x28a2a4=_0x4b84[_0xbbfe59];return _0x28a2a4;};'use strict';var Sequelize=require(_0x44b8('0x0'));module[_0x44b8('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x44b8('0x2')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x44b8('0x2')]},'serverUrl':{'type':Sequelize[_0x44b8('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x44b8('0x2')]},'refreshToken':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 6849010..7eacdb9 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 _0x047d=['update','then','destroy','error','stack','name','send','map','ZohoAccount','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','filter','merge','options','rows','catch','keys','includeAll','include','find','create','body','params','findOne','ZohoConfiguration','length','order','pick','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','ZohoField','Descriptions','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','getFields','serverUrl','host','zoho.eu','com','slice','substring','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','Owner','Description','Call_Duration','Call_Result','Call_Type','remove','includes','api_name','push','display_label','picklist','pick_list_values','test','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0x047d,0x150));var _0xd047=function(_0x48f30b,_0x35066d){_0x48f30b=_0x48f30b-0x0;var _0x1fc587=_0x047d[_0x48f30b];return _0x1fc587;};'use strict';var emlformat=require(_0xd047('0x0'));var rimraf=require(_0xd047('0x1'));var zipdir=require(_0xd047('0x2'));var jsonpatch=require(_0xd047('0x3'));var rp=require(_0xd047('0x4'));var moment=require(_0xd047('0x5'));var BPromise=require(_0xd047('0x6'));var Mustache=require(_0xd047('0x7'));var util=require(_0xd047('0x8'));var path=require(_0xd047('0x9'));var sox=require('sox');var csv=require(_0xd047('0xa'));var ejs=require(_0xd047('0xb'));var fs=require('fs');var fs_extra=require(_0xd047('0xc'));var _=require(_0xd047('0xd'));var squel=require(_0xd047('0xe'));var crypto=require(_0xd047('0xf'));var jsforce=require(_0xd047('0x10'));var deskjs=require(_0xd047('0x11'));var toCsv=require(_0xd047('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd047('0x12'));var hardwareService=require(_0xd047('0x13'));var logger=require(_0xd047('0x14'))(_0xd047('0x15'));var utils=require(_0xd047('0x16'));var config=require(_0xd047('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xd047('0x18'))['db'];var integrations=require(_0xd047('0x19'));function respondWithStatusCode(_0x2f3b21,_0x1d7eb5){_0x1d7eb5=_0x1d7eb5||0xcc;return function(_0x4bd2ab){if(_0x4bd2ab){return _0x2f3b21[_0xd047('0x1a')](_0x1d7eb5);}return _0x2f3b21[_0xd047('0x1b')](_0x1d7eb5)[_0xd047('0x1c')]();};}function respondWithResult(_0x4117c8,_0x4840e3){_0x4840e3=_0x4840e3||0xc8;return function(_0x139d19){if(_0x139d19){return _0x4117c8[_0xd047('0x1b')](_0x4840e3)[_0xd047('0x1d')](_0x139d19);}};}function respondWithFilteredResult(_0x2ebfb7,_0x1e8b6b){return function(_0x51d08d){if(_0x51d08d){var _0x2e4428=typeof _0x1e8b6b[_0xd047('0x1e')]===_0xd047('0x1f')&&typeof _0x1e8b6b[_0xd047('0x20')]==='undefined';var _0x394373=_0x51d08d[_0xd047('0x21')];var _0x1ddc7b=_0x2e4428?0x0:_0x1e8b6b[_0xd047('0x1e')];var _0x23a177=_0x2e4428?_0x51d08d[_0xd047('0x21')]:_0x1e8b6b[_0xd047('0x1e')]+_0x1e8b6b[_0xd047('0x20')];var _0x22e76c;if(_0x23a177>=_0x394373){_0x23a177=_0x394373;_0x22e76c=0xc8;}else{_0x22e76c=0xce;}_0x2ebfb7[_0xd047('0x1b')](_0x22e76c);return _0x2ebfb7[_0xd047('0x22')](_0xd047('0x23'),_0x1ddc7b+'-'+_0x23a177+'/'+_0x394373)[_0xd047('0x1d')](_0x51d08d);}return null;};}function patchUpdates(_0x1c05e9){return function(_0x51f55f){try{jsonpatch[_0xd047('0x24')](_0x51f55f,_0x1c05e9,!![]);}catch(_0x58ca9e){return BPromise[_0xd047('0x25')](_0x58ca9e);}return _0x51f55f[_0xd047('0x26')]();};}function saveUpdates(_0x1cc9c0,_0x1f070b){return function(_0x328b39){if(_0x328b39){return _0x328b39[_0xd047('0x27')](_0x1cc9c0)[_0xd047('0x28')](function(_0x4d7866){return _0x4d7866;});}return null;};}function removeEntity(_0x37c506,_0x13c666){return function(_0x607e78){if(_0x607e78){return _0x607e78[_0xd047('0x29')]()[_0xd047('0x28')](function(){_0x37c506[_0xd047('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xaa474b,_0x27e5fd){return function(_0x46076a){if(!_0x46076a){_0xaa474b['sendStatus'](0x194);}return _0x46076a;};}function handleError(_0x46c8e9,_0x3484fb){_0x3484fb=_0x3484fb||0x1f4;return function(_0x1dc0d7){logger[_0xd047('0x2a')](_0x1dc0d7[_0xd047('0x2b')]);if(_0x1dc0d7[_0xd047('0x2c')]){delete _0x1dc0d7['name'];}_0x46c8e9[_0xd047('0x1b')](_0x3484fb)[_0xd047('0x2d')](_0x1dc0d7);};}exports['index']=function(_0x52e4b1,_0x571e52){var _0x3fe158={},_0xcac2c9={},_0x3b0f4d={'count':0x0,'rows':[]};var _0x41b435=_[_0xd047('0x2e')](db[_0xd047('0x2f')][_0xd047('0x30')],function(_0x277910){return{'name':_0x277910['fieldName'],'type':_0x277910[_0xd047('0x31')][_0xd047('0x32')]};});_0xcac2c9[_0xd047('0x33')]=_[_0xd047('0x2e')](_0x41b435,_0xd047('0x2c'));_0xcac2c9[_0xd047('0x34')]=_['keys'](_0x52e4b1[_0xd047('0x34')]);_0xcac2c9[_0xd047('0x35')]=_[_0xd047('0x36')](_0xcac2c9['model'],_0xcac2c9['query']);_0x3fe158[_0xd047('0x37')]=_[_0xd047('0x36')](_0xcac2c9[_0xd047('0x33')],qs[_0xd047('0x38')](_0x52e4b1[_0xd047('0x34')][_0xd047('0x38')]));_0x3fe158['attributes']=_0x3fe158[_0xd047('0x37')]['length']?_0x3fe158[_0xd047('0x37')]:_0xcac2c9[_0xd047('0x33')];if(!_0x52e4b1[_0xd047('0x34')][_0xd047('0x39')]('nolimit')){_0x3fe158[_0xd047('0x20')]=qs[_0xd047('0x20')](_0x52e4b1[_0xd047('0x34')]['limit']);_0x3fe158[_0xd047('0x1e')]=qs[_0xd047('0x1e')](_0x52e4b1[_0xd047('0x34')][_0xd047('0x1e')]);}_0x3fe158['order']=qs['sort'](_0x52e4b1[_0xd047('0x34')][_0xd047('0x3a')]);_0x3fe158[_0xd047('0x3b')]=qs[_0xd047('0x35')](_['pick'](_0x52e4b1[_0xd047('0x34')],_0xcac2c9[_0xd047('0x35')]),_0x41b435);if(_0x52e4b1[_0xd047('0x34')][_0xd047('0x3c')]){_0x3fe158['where']=_['merge'](_0x3fe158['where'],{'$or':_[_0xd047('0x2e')](_0x41b435,function(_0x504763){if(_0x504763['type']!=='VIRTUAL'){var _0x2cca61={};_0x2cca61[_0x504763[_0xd047('0x2c')]]={'$like':'%'+_0x52e4b1[_0xd047('0x34')]['filter']+'%'};return _0x2cca61;}})});}_0x3fe158=_[_0xd047('0x3d')]({},_0x3fe158,_0x52e4b1[_0xd047('0x3e')]);var _0x580973={'where':_0x3fe158[_0xd047('0x3b')]};return db[_0xd047('0x2f')]['count'](_0x580973)[_0xd047('0x28')](function(_0x1897e8){_0x3b0f4d[_0xd047('0x21')]=_0x1897e8;if(_0x52e4b1[_0xd047('0x34')]['includeAll']){_0x3fe158['include']=[{'all':!![]}];}return db[_0xd047('0x2f')]['findAll'](_0x3fe158);})[_0xd047('0x28')](function(_0x201b4d){_0x3b0f4d[_0xd047('0x3f')]=_0x201b4d;return _0x3b0f4d;})['then'](respondWithFilteredResult(_0x571e52,_0x3fe158))[_0xd047('0x40')](handleError(_0x571e52,null));};exports['show']=function(_0x183a04,_0x39536d){var _0x1ccad2={'raw':![],'where':{'id':_0x183a04['params']['id']}},_0x407bbc={};_0x407bbc[_0xd047('0x33')]=_[_0xd047('0x41')](db[_0xd047('0x2f')][_0xd047('0x30')]);_0x407bbc['query']=_[_0xd047('0x41')](_0x183a04[_0xd047('0x34')]);_0x407bbc[_0xd047('0x35')]=_['intersection'](_0x407bbc[_0xd047('0x33')],_0x407bbc['query']);_0x1ccad2[_0xd047('0x37')]=_['intersection'](_0x407bbc[_0xd047('0x33')],qs['fields'](_0x183a04['query'][_0xd047('0x38')]));_0x1ccad2['attributes']=_0x1ccad2[_0xd047('0x37')]['length']?_0x1ccad2['attributes']:_0x407bbc['model'];if(_0x183a04[_0xd047('0x34')][_0xd047('0x42')]){_0x1ccad2[_0xd047('0x43')]=[{'all':!![]}];}_0x1ccad2=_[_0xd047('0x3d')]({},_0x1ccad2,_0x183a04[_0xd047('0x3e')]);return db[_0xd047('0x2f')][_0xd047('0x44')](_0x1ccad2)['then'](handleEntityNotFound(_0x39536d,null))[_0xd047('0x28')](respondWithResult(_0x39536d,null))['catch'](handleError(_0x39536d,null));};exports['create']=function(_0x3a6006,_0x4345c3){return db[_0xd047('0x2f')][_0xd047('0x45')](_0x3a6006['body'],{})['then'](respondWithResult(_0x4345c3,0xc9))[_0xd047('0x40')](handleError(_0x4345c3,null));};exports[_0xd047('0x27')]=function(_0x5e5006,_0x5b9a92){if(_0x5e5006[_0xd047('0x46')]['id']){delete _0x5e5006[_0xd047('0x46')]['id'];}return db['ZohoAccount'][_0xd047('0x44')]({'where':{'id':_0x5e5006[_0xd047('0x47')]['id']}})['then'](handleEntityNotFound(_0x5b9a92,null))[_0xd047('0x28')](saveUpdates(_0x5e5006[_0xd047('0x46')],null))['then'](respondWithResult(_0x5b9a92,null))[_0xd047('0x40')](handleError(_0x5b9a92,null));};exports[_0xd047('0x29')]=function(_0xb48eef,_0x3d6d1b){return db[_0xd047('0x2f')][_0xd047('0x44')]({'where':{'id':_0xb48eef[_0xd047('0x47')]['id']}})['then'](handleEntityNotFound(_0x3d6d1b,null))[_0xd047('0x28')](removeEntity(_0x3d6d1b,null))[_0xd047('0x40')](handleError(_0x3d6d1b,null));};exports['getConfigurations']=function(_0x679e57,_0x2f4c5e,_0x339ec4){var _0x27484c={};var _0x1994a7={};var _0x34c507;var _0xf9788;return db[_0xd047('0x2f')][_0xd047('0x48')]({'where':{'id':_0x679e57[_0xd047('0x47')]['id']}})[_0xd047('0x28')](handleEntityNotFound(_0x2f4c5e,null))[_0xd047('0x28')](function(_0x56a075){if(_0x56a075){_0x34c507=_0x56a075;_0x1994a7[_0xd047('0x33')]=_[_0xd047('0x41')](db[_0xd047('0x49')][_0xd047('0x30')]);_0x1994a7['query']=_[_0xd047('0x41')](_0x679e57[_0xd047('0x34')]);_0x1994a7[_0xd047('0x35')]=_['intersection'](_0x1994a7[_0xd047('0x33')],_0x1994a7[_0xd047('0x34')]);_0x27484c[_0xd047('0x37')]=_[_0xd047('0x36')](_0x1994a7[_0xd047('0x33')],qs[_0xd047('0x38')](_0x679e57['query'][_0xd047('0x38')]));_0x27484c[_0xd047('0x37')]=_0x27484c[_0xd047('0x37')][_0xd047('0x4a')]?_0x27484c['attributes']:_0x1994a7['model'];_0x27484c[_0xd047('0x4b')]=qs['sort'](_0x679e57[_0xd047('0x34')][_0xd047('0x3a')]);_0x27484c[_0xd047('0x3b')]=qs['filters'](_[_0xd047('0x4c')](_0x679e57[_0xd047('0x34')],_0x1994a7[_0xd047('0x35')]));if(_0x679e57[_0xd047('0x34')][_0xd047('0x3c')]){_0x27484c['where']=_[_0xd047('0x3d')](_0x27484c[_0xd047('0x3b')],{'$or':_[_0xd047('0x2e')](_0x27484c['attributes'],function(_0x1d6910){var _0x49c59b={};_0x49c59b[_0x1d6910]={'$like':'%'+_0x679e57[_0xd047('0x34')]['filter']+'%'};return _0x49c59b;})});}_0x27484c=_[_0xd047('0x3d')]({},_0x27484c,_0x679e57[_0xd047('0x3e')]);return _0x34c507['getConfigurations'](_0x27484c);}})[_0xd047('0x28')](function(_0x122acd){if(_0x122acd){_0xf9788=_0x122acd[_0xd047('0x4a')];if(!_0x679e57[_0xd047('0x34')][_0xd047('0x39')]('nolimit')){_0x27484c['limit']=qs[_0xd047('0x20')](_0x679e57[_0xd047('0x34')]['limit']);_0x27484c[_0xd047('0x1e')]=qs['offset'](_0x679e57[_0xd047('0x34')][_0xd047('0x1e')]);}return _0x34c507[_0xd047('0x4d')](_0x27484c);}})['then'](function(_0x432cf5){if(_0x432cf5){return _0x432cf5?{'count':_0xf9788,'rows':_0x432cf5}:null;}})[_0xd047('0x28')](respondWithResult(_0x2f4c5e,null))[_0xd047('0x40')](handleError(_0x2f4c5e,null));};exports[_0xd047('0x4e')]=function(_0x1e2e54,_0x39eec9,_0x19fa6f){if(_0x1e2e54[_0xd047('0x46')]['id']){delete _0x1e2e54[_0xd047('0x46')]['id'];}return db['ZohoAccount'][_0xd047('0x48')]({'where':{'id':_0x1e2e54[_0xd047('0x47')]['id']}})[_0xd047('0x28')](handleEntityNotFound(_0x39eec9,null))[_0xd047('0x28')](function(_0x10403e){if(_0x10403e){_0x1e2e54[_0xd047('0x46')][_0xd047('0x4f')]=_0x10403e['id'];_0x1e2e54[_0xd047('0x46')][_0xd047('0x50')]=integrations[_0xd047('0x51')](_0x1e2e54[_0xd047('0x46')][_0xd047('0x52')],_0x1e2e54[_0xd047('0x46')][_0xd047('0x31')]);_0x1e2e54[_0xd047('0x46')]['Descriptions']=integrations['getDescriptions'](_0x1e2e54[_0xd047('0x46')][_0xd047('0x52')],_0x1e2e54[_0xd047('0x46')][_0xd047('0x31')]);return db[_0xd047('0x49')][_0xd047('0x45')](_0x1e2e54[_0xd047('0x46')],{'include':[{'model':db[_0xd047('0x53')],'as':_0xd047('0x50')},{'model':db['ZohoField'],'as':_0xd047('0x54')}]});}return null;})[_0xd047('0x28')](respondWithResult(_0x39eec9,null))['catch'](handleError(_0x39eec9,null));};function getAccessToken(_0x47ac6f){return new Promise(function(_0x32783c,_0x4ba648){var _0x2dd130;switch(_0x47ac6f[_0xd047('0x55')]){case'US':_0x2dd130=_0xd047('0x56');break;case'AU':_0x2dd130='https://accounts.zoho.com.au';break;case'EU':_0x2dd130=_0xd047('0x57');break;case'IN':_0x2dd130=_0xd047('0x58');break;case'CN':_0x2dd130='https://accounts.zoho.com.cn';break;default:_0x2dd130='https://accounts.zoho.eu';break;}var _0x44a660={'method':_0xd047('0x59'),'uri':_0x2dd130+_0xd047('0x5a'),'qs':{'refresh_token':_0x47ac6f[_0xd047('0x5b')],'client_id':_0x47ac6f[_0xd047('0x5c')],'client_secret':_0x47ac6f[_0xd047('0x5d')],'grant_type':_0xd047('0x5e')},'json':!![]};return rp(_0x44a660)['then'](function(_0x5600e3){if(_0x5600e3[_0xd047('0x5f')]){_0x32783c(_0x5600e3[_0xd047('0x5f')]);}else{_0x4ba648('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0xd047('0x40')](function(_0x25c4c3){_0x4ba648(_0x25c4c3);});});}exports[_0xd047('0x60')]=function(_0x8b1956,_0x161ce4,_0x8ac82b){var _0xe178f9,_0x152a6e,_0x5b2677,_0x26335d,_0x2b3553;return db[_0xd047('0x2f')][_0xd047('0x48')]({'where':{'id':_0x8b1956[_0xd047('0x47')]['id']},'attributes':['id','host',_0xd047('0x55'),_0xd047('0x5c'),'clientSecret',_0xd047('0x61'),'code',_0xd047('0x5b')]})[_0xd047('0x28')](handleEntityNotFound(_0x161ce4,null))[_0xd047('0x28')](function(_0x2a76fd){_0x2b3553=_0x2a76fd;_0xe178f9=_0x2b3553[_0xd047('0x62')];_0x152a6e=_0xe178f9===_0xd047('0x63')?'eu':_0xd047('0x64');_0x5b2677=_0x2b3553[_0xd047('0x61')];var _0x514377=_0x5b2677[_0xd047('0x65')](-0x1);if(_0x514377==='/'||_0x514377==='\x5c'||_0x514377===':'){_0x5b2677=_0x5b2677[_0xd047('0x66')](0x0,_0x5b2677['lastIndexOf'](_0x514377));}if(!_0x2b3553[_0xd047('0x5b')]){throw new Error(_0xd047('0x67'));}return getAccessToken(_0x2b3553);})[_0xd047('0x28')](function(_0x3eefd2){if(_0x3eefd2){return rp({'method':_0xd047('0x68'),'uri':util[_0xd047('0x69')](_0xd047('0x6a'),_0x152a6e),'qs':{'module':'Calls'},'headers':{'Authorization':_0xd047('0x6b')+_0x3eefd2},'json':!![]});}})['then'](function(_0x120290){if(_0x120290){if(_0x120290[_0xd047('0x6c')]&&_0x120290[_0xd047('0x6c')][_0xd047('0x2a')]){throw new Error(_0x120290[_0xd047('0x6c')]['error']['message']);}var _0x20a017=[];var _0x1cce72=[];var _0x32ec9c=[_0xd047('0x6d'),'Subject',_0xd047('0x6e'),'WhoId',_0xd047('0x6f'),_0xd047('0x70'),'Call_Start_Time',_0xd047('0x71')];_0x1cce72=_[_0xd047('0x72')](_0x120290[_0xd047('0x38')],function(_0x2f4da8){return _0x32ec9c[_0xd047('0x73')](_0x2f4da8[_0xd047('0x74')]);});for(var _0x10f658=0x0;_0x10f658<_0x1cce72[_0xd047('0x4a')];_0x10f658++){if(_0x1cce72[_0x10f658]['system_mandatory']===![]){_0x20a017[_0xd047('0x75')]({'id':_0x1cce72[_0x10f658]['id'],'name':_0x1cce72[_0x10f658][_0xd047('0x76')],'custom':_0x1cce72[_0x10f658]['custom_field'],'options':_0x1cce72[_0x10f658]['data_type']===_0xd047('0x77')&&_0x1cce72[_0x10f658][_0xd047('0x78')][_0xd047('0x4a')]>-0x1?_[_0xd047('0x2e')](_0x1cce72[_0x10f658]['pick_list_values'],function(_0x1aed43){return{'name':_0x1aed43,'value':_0x1aed43};}):[]});}}return{'count':_0x20a017['length'],'rows':_0x20a017};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x161ce4,null))[_0xd047('0x40')](function(_0x10a02f){var _0x52cdf7=_0x8b1956[_0xd047('0x34')][_0xd047('0x79')]?0x1f4:_0x10a02f['statusCode']||0x1f4;logger[_0xd047('0x2a')]('getFields,\x20%s,\x20%s,\x20%s',_0xd047('0x60'),_0x52cdf7,JSON[_0xd047('0x7a')](_0x10a02f));delete _0x10a02f[_0xd047('0x2c')];if(_0x52cdf7===0x191){_0x52cdf7=0x190;}_0x161ce4[_0xd047('0x1b')](_0x52cdf7)[_0xd047('0x2d')](_0x8b1956[_0xd047('0x34')][_0xd047('0x79')]?{'message':_0xd047('0x7b'),'statusCode':_0x10a02f[_0xd047('0x7c')]}:_0x10a02f);});}; \ No newline at end of file +var _0x74e1=['../../components/integrations/configuration','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ZohoAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','includeAll','include','rows','show','params','options','catch','create','body','find','getConfigurations','ZohoConfiguration','order','pick','nolimit','findOne','AccountId','channel','Descriptions','getDescriptions','ZohoField','Subjects','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','getFields','host','com','serverUrl','substring','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','WhoId','Call_Result','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0x74e1,0xe3));var _0x174e=function(_0xb9c016,_0x198c6a){_0xb9c016=_0xb9c016-0x0;var _0xb396a7=_0x74e1[_0xb9c016];return _0xb396a7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x174e('0x0'));var jsonpatch=require(_0x174e('0x1'));var rp=require('request-promise');var moment=require(_0x174e('0x2'));var BPromise=require(_0x174e('0x3'));var Mustache=require('mustache');var util=require(_0x174e('0x4'));var path=require(_0x174e('0x5'));var sox=require(_0x174e('0x6'));var csv=require('to-csv');var ejs=require(_0x174e('0x7'));var fs=require('fs');var fs_extra=require(_0x174e('0x8'));var _=require(_0x174e('0x9'));var squel=require(_0x174e('0xa'));var crypto=require('crypto');var jsforce=require(_0x174e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x174e('0xc'));var querystring=require(_0x174e('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x174e('0xe'));var qs=require(_0x174e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x174e('0x10'));var logger=require(_0x174e('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x174e('0x12'));var licenseUtil=require(_0x174e('0x13'));var db=require(_0x174e('0x14'))['db'];var integrations=require(_0x174e('0x15'));function respondWithStatusCode(_0x235e9e,_0x4de63b){_0x4de63b=_0x4de63b||0xcc;return function(_0x5c2b49){if(_0x5c2b49){return _0x235e9e['sendStatus'](_0x4de63b);}return _0x235e9e[_0x174e('0x16')](_0x4de63b)[_0x174e('0x17')]();};}function respondWithResult(_0x298d1e,_0x246695){_0x246695=_0x246695||0xc8;return function(_0x3c80c3){if(_0x3c80c3){return _0x298d1e['status'](_0x246695)[_0x174e('0x18')](_0x3c80c3);}};}function respondWithFilteredResult(_0x56e4bc,_0x12f551){return function(_0x60d27){if(_0x60d27){var _0xe187b=typeof _0x12f551[_0x174e('0x19')]===_0x174e('0x1a')&&typeof _0x12f551['limit']===_0x174e('0x1a');var _0x567464=_0x60d27[_0x174e('0x1b')];var _0x1464c1=_0xe187b?0x0:_0x12f551[_0x174e('0x19')];var _0x37a33d=_0xe187b?_0x60d27['count']:_0x12f551[_0x174e('0x19')]+_0x12f551[_0x174e('0x1c')];var _0x17f2b4;if(_0x37a33d>=_0x567464){_0x37a33d=_0x567464;_0x17f2b4=0xc8;}else{_0x17f2b4=0xce;}_0x56e4bc[_0x174e('0x16')](_0x17f2b4);return _0x56e4bc[_0x174e('0x1d')](_0x174e('0x1e'),_0x1464c1+'-'+_0x37a33d+'/'+_0x567464)[_0x174e('0x18')](_0x60d27);}return null;};}function patchUpdates(_0x57fe6a){return function(_0x384860){try{jsonpatch['apply'](_0x384860,_0x57fe6a,!![]);}catch(_0x2cf5d5){return BPromise[_0x174e('0x1f')](_0x2cf5d5);}return _0x384860[_0x174e('0x20')]();};}function saveUpdates(_0x29eb5b,_0xa71944){return function(_0xd85d5a){if(_0xd85d5a){return _0xd85d5a[_0x174e('0x21')](_0x29eb5b)[_0x174e('0x22')](function(_0x19f82f){return _0x19f82f;});}return null;};}function removeEntity(_0x2bb9d5,_0x2ff9c8){return function(_0x5b9591){if(_0x5b9591){return _0x5b9591[_0x174e('0x23')]()[_0x174e('0x22')](function(){_0x2bb9d5[_0x174e('0x16')](0xcc)[_0x174e('0x17')]();});}};}function handleEntityNotFound(_0x5c6521,_0x5e7da9){return function(_0x364052){if(!_0x364052){_0x5c6521[_0x174e('0x24')](0x194);}return _0x364052;};}function handleError(_0x47d719,_0x1d87db){_0x1d87db=_0x1d87db||0x1f4;return function(_0x18c326){logger[_0x174e('0x25')](_0x18c326[_0x174e('0x26')]);if(_0x18c326[_0x174e('0x27')]){delete _0x18c326[_0x174e('0x27')];}_0x47d719[_0x174e('0x16')](_0x1d87db)[_0x174e('0x28')](_0x18c326);};}exports[_0x174e('0x29')]=function(_0x2d9aae,_0x154d6e){var _0xd71ca8={},_0x2ca1b9={},_0x65d6a3={'count':0x0,'rows':[]};var _0x491727=_[_0x174e('0x2a')](db[_0x174e('0x2b')][_0x174e('0x2c')],function(_0x1d3c70){return{'name':_0x1d3c70[_0x174e('0x2d')],'type':_0x1d3c70[_0x174e('0x2e')]['key']};});_0x2ca1b9[_0x174e('0x2f')]=_[_0x174e('0x2a')](_0x491727,'name');_0x2ca1b9[_0x174e('0x30')]=_[_0x174e('0x31')](_0x2d9aae[_0x174e('0x30')]);_0x2ca1b9[_0x174e('0x32')]=_[_0x174e('0x33')](_0x2ca1b9[_0x174e('0x2f')],_0x2ca1b9[_0x174e('0x30')]);_0xd71ca8[_0x174e('0x34')]=_['intersection'](_0x2ca1b9[_0x174e('0x2f')],qs['fields'](_0x2d9aae['query'][_0x174e('0x35')]));_0xd71ca8[_0x174e('0x34')]=_0xd71ca8['attributes'][_0x174e('0x36')]?_0xd71ca8[_0x174e('0x34')]:_0x2ca1b9['model'];if(!_0x2d9aae[_0x174e('0x30')][_0x174e('0x37')]('nolimit')){_0xd71ca8[_0x174e('0x1c')]=qs[_0x174e('0x1c')](_0x2d9aae[_0x174e('0x30')]['limit']);_0xd71ca8['offset']=qs['offset'](_0x2d9aae[_0x174e('0x30')][_0x174e('0x19')]);}_0xd71ca8['order']=qs[_0x174e('0x38')](_0x2d9aae[_0x174e('0x30')][_0x174e('0x38')]);_0xd71ca8[_0x174e('0x39')]=qs['filters'](_['pick'](_0x2d9aae[_0x174e('0x30')],_0x2ca1b9[_0x174e('0x32')]),_0x491727);if(_0x2d9aae[_0x174e('0x30')][_0x174e('0x3a')]){_0xd71ca8['where']=_[_0x174e('0x3b')](_0xd71ca8['where'],{'$or':_[_0x174e('0x2a')](_0x491727,function(_0xccccfb){if(_0xccccfb['type']!==_0x174e('0x3c')){var _0x402860={};_0x402860[_0xccccfb['name']]={'$like':'%'+_0x2d9aae[_0x174e('0x30')][_0x174e('0x3a')]+'%'};return _0x402860;}})});}_0xd71ca8=_['merge']({},_0xd71ca8,_0x2d9aae['options']);var _0x3a3778={'where':_0xd71ca8[_0x174e('0x39')]};return db[_0x174e('0x2b')][_0x174e('0x1b')](_0x3a3778)[_0x174e('0x22')](function(_0x53dea5){_0x65d6a3['count']=_0x53dea5;if(_0x2d9aae[_0x174e('0x30')][_0x174e('0x3d')]){_0xd71ca8[_0x174e('0x3e')]=[{'all':!![]}];}return db[_0x174e('0x2b')]['findAll'](_0xd71ca8);})[_0x174e('0x22')](function(_0x294449){_0x65d6a3[_0x174e('0x3f')]=_0x294449;return _0x65d6a3;})[_0x174e('0x22')](respondWithFilteredResult(_0x154d6e,_0xd71ca8))['catch'](handleError(_0x154d6e,null));};exports[_0x174e('0x40')]=function(_0x5d6437,_0x589987){var _0x327298={'raw':![],'where':{'id':_0x5d6437[_0x174e('0x41')]['id']}},_0x5b4b50={};_0x5b4b50[_0x174e('0x2f')]=_[_0x174e('0x31')](db[_0x174e('0x2b')][_0x174e('0x2c')]);_0x5b4b50['query']=_['keys'](_0x5d6437[_0x174e('0x30')]);_0x5b4b50['filters']=_['intersection'](_0x5b4b50[_0x174e('0x2f')],_0x5b4b50[_0x174e('0x30')]);_0x327298['attributes']=_[_0x174e('0x33')](_0x5b4b50['model'],qs['fields'](_0x5d6437[_0x174e('0x30')]['fields']));_0x327298['attributes']=_0x327298['attributes'][_0x174e('0x36')]?_0x327298[_0x174e('0x34')]:_0x5b4b50['model'];if(_0x5d6437[_0x174e('0x30')]['includeAll']){_0x327298[_0x174e('0x3e')]=[{'all':!![]}];}_0x327298=_[_0x174e('0x3b')]({},_0x327298,_0x5d6437[_0x174e('0x42')]);return db[_0x174e('0x2b')]['find'](_0x327298)[_0x174e('0x22')](handleEntityNotFound(_0x589987,null))[_0x174e('0x22')](respondWithResult(_0x589987,null))[_0x174e('0x43')](handleError(_0x589987,null));};exports[_0x174e('0x44')]=function(_0x40d200,_0xb3c63a){return db[_0x174e('0x2b')][_0x174e('0x44')](_0x40d200[_0x174e('0x45')],{})[_0x174e('0x22')](respondWithResult(_0xb3c63a,0xc9))[_0x174e('0x43')](handleError(_0xb3c63a,null));};exports['update']=function(_0x2e20dc,_0x36bc8d){if(_0x2e20dc[_0x174e('0x45')]['id']){delete _0x2e20dc['body']['id'];}return db[_0x174e('0x2b')]['find']({'where':{'id':_0x2e20dc['params']['id']}})[_0x174e('0x22')](handleEntityNotFound(_0x36bc8d,null))[_0x174e('0x22')](saveUpdates(_0x2e20dc[_0x174e('0x45')],null))[_0x174e('0x22')](respondWithResult(_0x36bc8d,null))[_0x174e('0x43')](handleError(_0x36bc8d,null));};exports['destroy']=function(_0x4d6fc8,_0x14ce78){return db[_0x174e('0x2b')][_0x174e('0x46')]({'where':{'id':_0x4d6fc8[_0x174e('0x41')]['id']}})[_0x174e('0x22')](handleEntityNotFound(_0x14ce78,null))['then'](removeEntity(_0x14ce78,null))[_0x174e('0x43')](handleError(_0x14ce78,null));};exports[_0x174e('0x47')]=function(_0x120695,_0x267749,_0x110ef4){var _0x2de473={};var _0x3cf2f7={};var _0x1dbf8e;var _0x146f6d;return db[_0x174e('0x2b')]['findOne']({'where':{'id':_0x120695[_0x174e('0x41')]['id']}})[_0x174e('0x22')](handleEntityNotFound(_0x267749,null))[_0x174e('0x22')](function(_0x11f4f4){if(_0x11f4f4){_0x1dbf8e=_0x11f4f4;_0x3cf2f7[_0x174e('0x2f')]=_['keys'](db[_0x174e('0x48')][_0x174e('0x2c')]);_0x3cf2f7[_0x174e('0x30')]=_['keys'](_0x120695[_0x174e('0x30')]);_0x3cf2f7[_0x174e('0x32')]=_['intersection'](_0x3cf2f7[_0x174e('0x2f')],_0x3cf2f7['query']);_0x2de473['attributes']=_['intersection'](_0x3cf2f7[_0x174e('0x2f')],qs[_0x174e('0x35')](_0x120695[_0x174e('0x30')][_0x174e('0x35')]));_0x2de473[_0x174e('0x34')]=_0x2de473[_0x174e('0x34')][_0x174e('0x36')]?_0x2de473[_0x174e('0x34')]:_0x3cf2f7['model'];_0x2de473[_0x174e('0x49')]=qs[_0x174e('0x38')](_0x120695[_0x174e('0x30')][_0x174e('0x38')]);_0x2de473[_0x174e('0x39')]=qs[_0x174e('0x32')](_[_0x174e('0x4a')](_0x120695[_0x174e('0x30')],_0x3cf2f7['filters']));if(_0x120695['query'][_0x174e('0x3a')]){_0x2de473[_0x174e('0x39')]=_[_0x174e('0x3b')](_0x2de473[_0x174e('0x39')],{'$or':_[_0x174e('0x2a')](_0x2de473['attributes'],function(_0x3a8b29){var _0x42916d={};_0x42916d[_0x3a8b29]={'$like':'%'+_0x120695[_0x174e('0x30')]['filter']+'%'};return _0x42916d;})});}_0x2de473=_[_0x174e('0x3b')]({},_0x2de473,_0x120695[_0x174e('0x42')]);return _0x1dbf8e[_0x174e('0x47')](_0x2de473);}})['then'](function(_0x4a267c){if(_0x4a267c){_0x146f6d=_0x4a267c[_0x174e('0x36')];if(!_0x120695[_0x174e('0x30')][_0x174e('0x37')](_0x174e('0x4b'))){_0x2de473[_0x174e('0x1c')]=qs['limit'](_0x120695[_0x174e('0x30')][_0x174e('0x1c')]);_0x2de473[_0x174e('0x19')]=qs['offset'](_0x120695['query']['offset']);}return _0x1dbf8e[_0x174e('0x47')](_0x2de473);}})[_0x174e('0x22')](function(_0x517819){if(_0x517819){return _0x517819?{'count':_0x146f6d,'rows':_0x517819}:null;}})['then'](respondWithResult(_0x267749,null))['catch'](handleError(_0x267749,null));};exports['addConfiguration']=function(_0x45f577,_0x8b41cb,_0x24f524){if(_0x45f577['body']['id']){delete _0x45f577[_0x174e('0x45')]['id'];}return db[_0x174e('0x2b')][_0x174e('0x4c')]({'where':{'id':_0x45f577[_0x174e('0x41')]['id']}})[_0x174e('0x22')](handleEntityNotFound(_0x8b41cb,null))[_0x174e('0x22')](function(_0x3d646c){if(_0x3d646c){_0x45f577[_0x174e('0x45')][_0x174e('0x4d')]=_0x3d646c['id'];_0x45f577[_0x174e('0x45')]['Subjects']=integrations['getSubjects'](_0x45f577[_0x174e('0x45')][_0x174e('0x4e')],_0x45f577[_0x174e('0x45')][_0x174e('0x2e')]);_0x45f577[_0x174e('0x45')][_0x174e('0x4f')]=integrations[_0x174e('0x50')](_0x45f577[_0x174e('0x45')][_0x174e('0x4e')],_0x45f577[_0x174e('0x45')]['type']);return db['ZohoConfiguration']['create'](_0x45f577[_0x174e('0x45')],{'include':[{'model':db[_0x174e('0x51')],'as':_0x174e('0x52')},{'model':db[_0x174e('0x51')],'as':_0x174e('0x4f')}]});}return null;})[_0x174e('0x22')](respondWithResult(_0x8b41cb,null))[_0x174e('0x43')](handleError(_0x8b41cb,null));};function getAccessToken(_0x50f64f){return new Promise(function(_0x1521b9,_0xc6aa83){var _0x2bf57f;switch(_0x50f64f[_0x174e('0x53')]){case'US':_0x2bf57f='https://accounts.zoho.com';break;case'AU':_0x2bf57f=_0x174e('0x54');break;case'EU':_0x2bf57f=_0x174e('0x55');break;case'IN':_0x2bf57f='https://accounts.zoho.in';break;case'CN':_0x2bf57f='https://accounts.zoho.com.cn';break;default:_0x2bf57f=_0x174e('0x55');break;}var _0x7495f9={'method':_0x174e('0x56'),'uri':_0x2bf57f+_0x174e('0x57'),'qs':{'refresh_token':_0x50f64f[_0x174e('0x58')],'client_id':_0x50f64f[_0x174e('0x59')],'client_secret':_0x50f64f[_0x174e('0x5a')],'grant_type':_0x174e('0x5b')},'json':!![]};return rp(_0x7495f9)[_0x174e('0x22')](function(_0x5dcbb3){if(_0x5dcbb3[_0x174e('0x5c')]){_0x1521b9(_0x5dcbb3[_0x174e('0x5c')]);}else{_0xc6aa83('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0x174e('0x43')](function(_0x4360f1){_0xc6aa83(_0x4360f1);});});}exports[_0x174e('0x5d')]=function(_0x3146d6,_0x3b5416,_0x370d79){var _0x54230b,_0x5370cb,_0x38797a,_0x5c75f5,_0x210c33;return db[_0x174e('0x2b')][_0x174e('0x4c')]({'where':{'id':_0x3146d6[_0x174e('0x41')]['id']},'attributes':['id',_0x174e('0x5e'),'zone',_0x174e('0x59'),_0x174e('0x5a'),'serverUrl','code',_0x174e('0x58')]})[_0x174e('0x22')](handleEntityNotFound(_0x3b5416,null))['then'](function(_0x20fa0d){_0x210c33=_0x20fa0d;_0x54230b=_0x210c33[_0x174e('0x5e')];_0x5370cb=_0x54230b==='zoho.eu'?'eu':_0x174e('0x5f');_0x38797a=_0x210c33[_0x174e('0x60')];var _0xb9e35f=_0x38797a['slice'](-0x1);if(_0xb9e35f==='/'||_0xb9e35f==='\x5c'||_0xb9e35f===':'){_0x38797a=_0x38797a[_0x174e('0x61')](0x0,_0x38797a['lastIndexOf'](_0xb9e35f));}if(!_0x210c33[_0x174e('0x58')]){throw new Error(_0x174e('0x62'));}return getAccessToken(_0x210c33);})['then'](function(_0x12bcc4){if(_0x12bcc4){return rp({'method':_0x174e('0x63'),'uri':util[_0x174e('0x64')](_0x174e('0x65'),_0x5370cb),'qs':{'module':_0x174e('0x66')},'headers':{'Authorization':_0x174e('0x67')+_0x12bcc4},'json':!![]});}})[_0x174e('0x22')](function(_0xe68844){if(_0xe68844){if(_0xe68844[_0x174e('0x68')]&&_0xe68844[_0x174e('0x68')]['error']){throw new Error(_0xe68844[_0x174e('0x68')][_0x174e('0x25')][_0x174e('0x69')]);}var _0x38f654=[];var _0x4a4071=[];var _0x3d68d3=[_0x174e('0x6a'),_0x174e('0x6b'),_0x174e('0x6c'),_0x174e('0x6d'),'Call_Duration',_0x174e('0x6e'),'Call_Start_Time','Call_Type'];_0x4a4071=_['remove'](_0xe68844[_0x174e('0x35')],function(_0x4284fe){return _0x3d68d3[_0x174e('0x6f')](_0x4284fe[_0x174e('0x70')]);});for(var _0x1780d9=0x0;_0x1780d9<_0x4a4071[_0x174e('0x36')];_0x1780d9++){if(_0x4a4071[_0x1780d9][_0x174e('0x71')]===![]){_0x38f654[_0x174e('0x72')]({'id':_0x4a4071[_0x1780d9]['id'],'name':_0x4a4071[_0x1780d9][_0x174e('0x73')],'custom':_0x4a4071[_0x1780d9][_0x174e('0x74')],'options':_0x4a4071[_0x1780d9][_0x174e('0x75')]===_0x174e('0x76')&&_0x4a4071[_0x1780d9]['pick_list_values']['length']>-0x1?_['map'](_0x4a4071[_0x1780d9]['pick_list_values'],function(_0x4a151a){return{'name':_0x4a151a,'value':_0x4a151a};}):[]});}}return{'count':_0x38f654['length'],'rows':_0x38f654};}else{return{'count':0x0,'rows':[]};}})[_0x174e('0x22')](respondWithResult(_0x3b5416,null))[_0x174e('0x43')](function(_0x187da2){var _0x59c27f=_0x3146d6[_0x174e('0x30')][_0x174e('0x77')]?0x1f4:_0x187da2[_0x174e('0x78')]||0x1f4;logger[_0x174e('0x25')](_0x174e('0x79'),_0x174e('0x5d'),_0x59c27f,JSON[_0x174e('0x7a')](_0x187da2));delete _0x187da2['name'];if(_0x59c27f===0x191){_0x59c27f=0x190;}_0x3b5416[_0x174e('0x16')](_0x59c27f)[_0x174e('0x28')](_0x3146d6[_0x174e('0x30')][_0x174e('0x77')]?{'message':_0x174e('0x7b'),'statusCode':_0x187da2[_0x174e('0x78')]}:_0x187da2);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 6493b05..1e34254 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 _0xd028=['refreshToken','lodash','api','moment','bluebird','path','rimraf','../../config/environment','./intZohoAccount.attributes','exports','define','int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret','host','slice','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','application/x-www-form-urlencoded','parse','refresh_token','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','code','substring','lastIndexOf','authorization_code','then'];(function(_0x1ea279,_0x260b59){var _0x34b047=function(_0x46ded8){while(--_0x46ded8){_0x1ea279['push'](_0x1ea279['shift']());}};_0x34b047(++_0x260b59);}(_0xd028,0x1cf));var _0x8d02=function(_0x5ada76,_0x28992e){_0x5ada76=_0x5ada76-0x0;var _0x56aaa6=_0xd028[_0x5ada76];return _0x56aaa6;};'use strict';var _=require(_0x8d02('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8d02('0x1'));var moment=require(_0x8d02('0x2'));var BPromise=require(_0x8d02('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8d02('0x4'));var rimraf=require(_0x8d02('0x5'));var config=require(_0x8d02('0x6'));var attributes=require(_0x8d02('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x8d02('0x8')]=function(_0xb5cc7,_0x5f5b23){return _0xb5cc7[_0x8d02('0x9')]('ZohoAccount',attributes,{'tableName':_0x8d02('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5cfe34,_0x30f060,_0x9a20f4){if(_0x5cfe34[_0x8d02('0xb')](_0x8d02('0xc'))||_0x5cfe34['changed'](_0x8d02('0xd'))||_0x5cfe34[_0x8d02('0xb')](_0x8d02('0xe'))||_0x5cfe34['changed'](_0x8d02('0xf'))||_0x5cfe34[_0x8d02('0xb')]('code')||_0x5cfe34['changed'](_0x8d02('0x10'))){var _0x4f1cd3,_0x1eaf2c;_0x4f1cd3=_0x5cfe34[_0x8d02('0xd')];var _0x20d80d=_0x4f1cd3[_0x8d02('0x11')](-0x1);if(_0x20d80d==='/'||_0x20d80d==='\x5c'||_0x20d80d===':'){_0x4f1cd3=_0x4f1cd3['substring'](0x0,_0x4f1cd3['lastIndexOf'](_0x20d80d));}switch(_0x5cfe34[_0x8d02('0xc')]){case'US':_0x1eaf2c=_0x8d02('0x12');break;case'AU':_0x1eaf2c=_0x8d02('0x13');break;case'IN':_0x1eaf2c=_0x8d02('0x14');break;case'CN':_0x1eaf2c=_0x8d02('0x15');break;default:_0x1eaf2c=_0x8d02('0x16');break;}var _0x4a0c28={'method':_0x8d02('0x17'),'uri':_0x1eaf2c+_0x8d02('0x18'),'form':{'grant_type':'authorization_code','client_id':_0x5cfe34[_0x8d02('0xe')],'client_secret':_0x5cfe34[_0x8d02('0xf')],'redirect_uri':_0x5cfe34[_0x8d02('0xd')],'code':_0x5cfe34['code']},'headers':{'Content-Type':_0x8d02('0x19')}};return rp(_0x4a0c28)['then'](function(_0x32da70){var _0x44f674=JSON[_0x8d02('0x1a')](_0x32da70);if(_0x44f674[_0x8d02('0x1b')]){_0x5cfe34['refreshToken']=_0x44f674['refresh_token'];logger[_0x8d02('0x1c')](util[_0x8d02('0x1d')](_0x8d02('0x1e'),_0x5cfe34[_0x8d02('0x1f')],_0x5cfe34['id']));}else{logger[_0x8d02('0x20')](util[_0x8d02('0x1d')](_0x8d02('0x21'),_0x5cfe34[_0x8d02('0x1f')],_0x5cfe34['id']),util[_0x8d02('0x22')](_0x44f674,{'showHidden':![],'depth':null}));}return _0x9a20f4(null,_0x30f060);})[_0x8d02('0x23')](function(_0x5ce1c6){logger['error'](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5cfe34[_0x8d02('0x1f')],_0x5cfe34['id']),util[_0x8d02('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0x9a20f4(_0x5ce1c6);});}else{return _0x9a20f4(null,_0x30f060);}},'beforeUpdate':function(_0x1f93d6,_0x5cb92b,_0x36fcf8){if(_0x1f93d6['changed'](_0x8d02('0xc'))||_0x1f93d6[_0x8d02('0xb')](_0x8d02('0xd'))||_0x1f93d6[_0x8d02('0xb')]('clientId')||_0x1f93d6[_0x8d02('0xb')](_0x8d02('0xf'))||_0x1f93d6['changed'](_0x8d02('0x24'))||_0x1f93d6[_0x8d02('0xb')]('host')){var _0x33dad0,_0xa438a3;_0x33dad0=_0x1f93d6[_0x8d02('0xd')];var _0x2e28b3=_0x33dad0['slice'](-0x1);if(_0x2e28b3==='/'||_0x2e28b3==='\x5c'||_0x2e28b3===':'){_0x33dad0=_0x33dad0[_0x8d02('0x25')](0x0,_0x33dad0[_0x8d02('0x26')](_0x2e28b3));}switch(_0x1f93d6['zone']){case'US':_0xa438a3=_0x8d02('0x12');break;case'AU':_0xa438a3=_0x8d02('0x13');break;case'IN':_0xa438a3='https://accounts.zoho.in';break;case'CN':_0xa438a3=_0x8d02('0x15');break;default:_0xa438a3=_0x8d02('0x16');break;}var _0x1ffb30={'method':_0x8d02('0x17'),'uri':_0xa438a3+'/oauth/v2/token','form':{'grant_type':_0x8d02('0x27'),'client_id':_0x1f93d6[_0x8d02('0xe')],'client_secret':_0x1f93d6[_0x8d02('0xf')],'redirect_uri':_0x1f93d6[_0x8d02('0xd')],'code':_0x1f93d6[_0x8d02('0x24')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x1ffb30)[_0x8d02('0x28')](function(_0x650814){var _0x44e8c8=JSON['parse'](_0x650814);if(_0x44e8c8[_0x8d02('0x1b')]){_0x1f93d6[_0x8d02('0x29')]=_0x44e8c8[_0x8d02('0x1b')];logger['info'](util[_0x8d02('0x1d')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x1f93d6[_0x8d02('0x1f')],_0x1f93d6['id']));}else{logger['error'](util[_0x8d02('0x1d')](_0x8d02('0x21'),_0x1f93d6[_0x8d02('0x1f')],_0x1f93d6['id']),util['inspect'](_0x44e8c8,{'showHidden':![],'depth':null}));}return _0x36fcf8(null,_0x5cb92b);})[_0x8d02('0x23')](function(_0x2bf194){logger[_0x8d02('0x20')](util[_0x8d02('0x1d')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x1f93d6[_0x8d02('0x1f')],_0x1f93d6['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x36fcf8(_0x2bf194);});}else{return _0x36fcf8(null,_0x5cb92b);}}}});}; \ No newline at end of file +var _0x9d8f=['clientId','clientSecret','code','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','POST','authorization_code','serverUrl','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','name','error','format','inspect','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','https://accounts.zoho.com.cn','/oauth/v2/token','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','zone'];(function(_0x11457e,_0x46b8b7){var _0x42994a=function(_0x118853){while(--_0x118853){_0x11457e['push'](_0x11457e['shift']());}};_0x42994a(++_0x46b8b7);}(_0x9d8f,0xa0));var _0xf9d8=function(_0x48b324,_0x5731eb){_0x48b324=_0x48b324-0x0;var _0x4ba7eb=_0x9d8f[_0x48b324];return _0x4ba7eb;};'use strict';var _=require(_0xf9d8('0x0'));var util=require('util');var logger=require(_0xf9d8('0x1'))(_0xf9d8('0x2'));var moment=require(_0xf9d8('0x3'));var BPromise=require(_0xf9d8('0x4'));var rp=require(_0xf9d8('0x5'));var fs=require('fs');var path=require(_0xf9d8('0x6'));var rimraf=require(_0xf9d8('0x7'));var config=require(_0xf9d8('0x8'));var attributes=require('./intZohoAccount.attributes');var integrations=require(_0xf9d8('0x9'));module[_0xf9d8('0xa')]=function(_0x3f6181,_0x42ec68){return _0x3f6181[_0xf9d8('0xb')](_0xf9d8('0xc'),attributes,{'tableName':_0xf9d8('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0xd0e395,_0x236982,_0x239279){if(_0xd0e395[_0xf9d8('0xe')](_0xf9d8('0xf'))||_0xd0e395[_0xf9d8('0xe')]('serverUrl')||_0xd0e395[_0xf9d8('0xe')](_0xf9d8('0x10'))||_0xd0e395['changed'](_0xf9d8('0x11'))||_0xd0e395['changed'](_0xf9d8('0x12'))||_0xd0e395[_0xf9d8('0xe')]('host')){var _0x1a9388,_0x3d4b04;_0x1a9388=_0xd0e395['serverUrl'];var _0x398ae6=_0x1a9388[_0xf9d8('0x13')](-0x1);if(_0x398ae6==='/'||_0x398ae6==='\x5c'||_0x398ae6===':'){_0x1a9388=_0x1a9388[_0xf9d8('0x14')](0x0,_0x1a9388[_0xf9d8('0x15')](_0x398ae6));}switch(_0xd0e395[_0xf9d8('0xf')]){case'US':_0x3d4b04=_0xf9d8('0x16');break;case'AU':_0x3d4b04=_0xf9d8('0x17');break;case'IN':_0x3d4b04=_0xf9d8('0x18');break;case'CN':_0x3d4b04='https://accounts.zoho.com.cn';break;default:_0x3d4b04=_0xf9d8('0x19');break;}var _0x146abb={'method':_0xf9d8('0x1a'),'uri':_0x3d4b04+'/oauth/v2/token','form':{'grant_type':_0xf9d8('0x1b'),'client_id':_0xd0e395['clientId'],'client_secret':_0xd0e395['clientSecret'],'redirect_uri':_0xd0e395[_0xf9d8('0x1c')],'code':_0xd0e395[_0xf9d8('0x12')]},'headers':{'Content-Type':_0xf9d8('0x1d')}};return rp(_0x146abb)[_0xf9d8('0x1e')](function(_0x553173){var _0x4e53ca=JSON[_0xf9d8('0x1f')](_0x553173);if(_0x4e53ca[_0xf9d8('0x20')]){_0xd0e395[_0xf9d8('0x21')]=_0x4e53ca[_0xf9d8('0x20')];logger[_0xf9d8('0x22')](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0xd0e395[_0xf9d8('0x23')],_0xd0e395['id']));}else{logger[_0xf9d8('0x24')](util[_0xf9d8('0x25')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0xd0e395[_0xf9d8('0x23')],_0xd0e395['id']),util[_0xf9d8('0x26')](_0x4e53ca,{'showHidden':![],'depth':null}));}return _0x239279(null,_0x236982);})[_0xf9d8('0x27')](function(_0xc9105c){logger['error'](util[_0xf9d8('0x25')](_0xf9d8('0x28'),_0xd0e395[_0xf9d8('0x23')],_0xd0e395['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x239279(_0xc9105c);});}else{return _0x239279(null,_0x236982);}},'beforeUpdate':function(_0x4a2eaf,_0x43859e,_0x3bbe04){if(_0x4a2eaf[_0xf9d8('0xe')](_0xf9d8('0xf'))||_0x4a2eaf['changed'](_0xf9d8('0x1c'))||_0x4a2eaf[_0xf9d8('0xe')](_0xf9d8('0x10'))||_0x4a2eaf['changed']('clientSecret')||_0x4a2eaf['changed'](_0xf9d8('0x12'))||_0x4a2eaf['changed']('host')){var _0xa1fc0b,_0x431ec3;_0xa1fc0b=_0x4a2eaf[_0xf9d8('0x1c')];var _0x59cf70=_0xa1fc0b[_0xf9d8('0x13')](-0x1);if(_0x59cf70==='/'||_0x59cf70==='\x5c'||_0x59cf70===':'){_0xa1fc0b=_0xa1fc0b['substring'](0x0,_0xa1fc0b[_0xf9d8('0x15')](_0x59cf70));}switch(_0x4a2eaf['zone']){case'US':_0x431ec3=_0xf9d8('0x16');break;case'AU':_0x431ec3='https://accounts.zoho.com.au';break;case'IN':_0x431ec3=_0xf9d8('0x18');break;case'CN':_0x431ec3=_0xf9d8('0x29');break;default:_0x431ec3='https://accounts.zoho.eu';break;}var _0x5807ab={'method':_0xf9d8('0x1a'),'uri':_0x431ec3+_0xf9d8('0x2a'),'form':{'grant_type':_0xf9d8('0x1b'),'client_id':_0x4a2eaf[_0xf9d8('0x10')],'client_secret':_0x4a2eaf[_0xf9d8('0x11')],'redirect_uri':_0x4a2eaf['serverUrl'],'code':_0x4a2eaf['code']},'headers':{'Content-Type':_0xf9d8('0x1d')}};return rp(_0x5807ab)[_0xf9d8('0x1e')](function(_0xcbfe19){var _0x5ce188=JSON[_0xf9d8('0x1f')](_0xcbfe19);if(_0x5ce188[_0xf9d8('0x20')]){_0x4a2eaf['refreshToken']=_0x5ce188['refresh_token'];logger['info'](util['format'](_0xf9d8('0x2b'),_0x4a2eaf[_0xf9d8('0x23')],_0x4a2eaf['id']));}else{logger[_0xf9d8('0x24')](util['format'](_0xf9d8('0x28'),_0x4a2eaf['name'],_0x4a2eaf['id']),util[_0xf9d8('0x26')](_0x5ce188,{'showHidden':![],'depth':null}));}return _0x3bbe04(null,_0x43859e);})[_0xf9d8('0x27')](function(_0x5a4b38){logger[_0xf9d8('0x24')](util[_0xf9d8('0x25')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4a2eaf['name'],_0x4a2eaf['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x3bbe04(_0x5a4b38);});}else{return _0x3bbe04(null,_0x43859e);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 64da27b..177520c 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 _0x288a=['limit','include','map','model','debug','ShowZohoAccount','ZohoAccount','raw','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetZohoAccount','findAll','options','where','attributes'];(function(_0x4ac50f,_0xce9588){var _0x4b98fb=function(_0x19dee4){while(--_0x19dee4){_0x4ac50f['push'](_0x4ac50f['shift']());}};_0x4b98fb(++_0xce9588);}(_0x288a,0x188));var _0xa288=function(_0x4bef16,_0x5383bb){_0x4bef16=_0x4bef16-0x0;var _0x47b213=_0x288a[_0x4bef16];return _0x47b213;};'use strict';var _=require('lodash');var util=require(_0xa288('0x0'));var moment=require(_0xa288('0x1'));var BPromise=require(_0xa288('0x2'));var rs=require(_0xa288('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa288('0x4'));var logger=require('../../config/logger')(_0xa288('0x5'));var config=require(_0xa288('0x6'));var jayson=require(_0xa288('0x7'));var client=jayson['client'][_0xa288('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xaee90c,_0x156720,_0x57f445){return new BPromise(function(_0x14e4a6,_0x1e8412){return client[_0xa288('0x9')](_0xaee90c,_0x57f445)[_0xa288('0xa')](function(_0x1a0c06){logger[_0xa288('0xb')](_0xa288('0xc'),_0x156720,_0xa288('0xd'));logger['debug']('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x156720,'request\x20sent',JSON[_0xa288('0xe')](_0x1a0c06));if(_0x1a0c06[_0xa288('0xf')]){if(_0x1a0c06['error'][_0xa288('0x10')]===0x1f4){logger[_0xa288('0xf')](_0xa288('0xc'),_0x156720,_0x1a0c06[_0xa288('0xf')][_0xa288('0x11')]);return _0x1e8412(_0x1a0c06[_0xa288('0xf')][_0xa288('0x11')]);}logger[_0xa288('0xf')](_0xa288('0xc'),_0x156720,_0x1a0c06[_0xa288('0xf')][_0xa288('0x11')]);return _0x14e4a6(_0x1a0c06[_0xa288('0xf')][_0xa288('0x11')]);}else{logger[_0xa288('0xb')](_0xa288('0xc'),_0x156720,_0xa288('0xd'));_0x14e4a6(_0x1a0c06['result'][_0xa288('0x11')]);}})[_0xa288('0x12')](function(_0x299ede){logger[_0xa288('0xf')](_0xa288('0xc'),_0x156720,_0x299ede);_0x1e8412(_0x299ede);});});}exports[_0xa288('0x13')]=function(_0x49d93c){var _0x2adc53=this;return new Promise(function(_0x3f14b7,_0x56bd2d){return db['ZohoAccount'][_0xa288('0x14')]({'raw':_0x49d93c[_0xa288('0x15')]?_0x49d93c[_0xa288('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x49d93c[_0xa288('0x15')]?_0x49d93c[_0xa288('0x15')][_0xa288('0x16')]||null:null,'attributes':_0x49d93c['options']?_0x49d93c[_0xa288('0x15')][_0xa288('0x17')]||null:null,'limit':_0x49d93c[_0xa288('0x15')]?_0x49d93c[_0xa288('0x15')][_0xa288('0x18')]||null:null,'include':_0x49d93c['options']?_0x49d93c['options'][_0xa288('0x19')]?_[_0xa288('0x1a')](_0x49d93c[_0xa288('0x15')][_0xa288('0x19')],function(_0x4895bb){return{'model':db[_0x4895bb[_0xa288('0x1b')]],'as':_0x4895bb['as'],'attributes':_0x4895bb[_0xa288('0x17')],'include':_0x4895bb[_0xa288('0x19')]?_[_0xa288('0x1a')](_0x4895bb[_0xa288('0x19')],function(_0x23f7b8){return{'model':db[_0x23f7b8[_0xa288('0x1b')]],'as':_0x23f7b8['as'],'attributes':_0x23f7b8[_0xa288('0x17')],'include':_0x23f7b8[_0xa288('0x19')]?_[_0xa288('0x1a')](_0x23f7b8[_0xa288('0x19')],function(_0xffc6b4){return{'model':db[_0xffc6b4[_0xa288('0x1b')]],'as':_0xffc6b4['as'],'attributes':_0xffc6b4[_0xa288('0x17')]};}):[]};}):[]};}):[]:[]})[_0xa288('0xa')](function(_0x5878fb){logger['info'](_0xa288('0x13'),_0x49d93c);logger[_0xa288('0x1c')](_0xa288('0x13'),_0x49d93c,JSON[_0xa288('0xe')](_0x5878fb));_0x3f14b7(_0x5878fb);})[_0xa288('0x12')](function(_0x3bbbc8){logger[_0xa288('0xf')](_0xa288('0x13'),_0x3bbbc8[_0xa288('0x11')],_0x49d93c);_0x56bd2d(_0x2adc53[_0xa288('0xf')](0x1f4,_0x3bbbc8[_0xa288('0x11')]));});});};exports[_0xa288('0x1d')]=function(_0xba620d){var _0x307c5b=this;return new Promise(function(_0x1c0b93,_0x3080d8){return db[_0xa288('0x1e')]['find']({'raw':_0xba620d[_0xa288('0x15')]?_0xba620d['options'][_0xa288('0x1f')]===undefined?!![]:![]:!![],'where':_0xba620d[_0xa288('0x15')]?_0xba620d[_0xa288('0x15')]['where']||null:null,'attributes':_0xba620d[_0xa288('0x15')]?_0xba620d[_0xa288('0x15')][_0xa288('0x17')]||null:null,'include':_0xba620d[_0xa288('0x15')]?_0xba620d[_0xa288('0x15')][_0xa288('0x19')]?_[_0xa288('0x1a')](_0xba620d[_0xa288('0x15')][_0xa288('0x19')],function(_0x5b37f8){return{'model':db[_0x5b37f8['model']],'as':_0x5b37f8['as'],'attributes':_0x5b37f8['attributes'],'include':_0x5b37f8[_0xa288('0x19')]?_['map'](_0x5b37f8[_0xa288('0x19')],function(_0x15f103){return{'model':db[_0x15f103[_0xa288('0x1b')]],'as':_0x15f103['as'],'attributes':_0x15f103[_0xa288('0x17')],'include':_0x15f103[_0xa288('0x19')]?_[_0xa288('0x1a')](_0x15f103['include'],function(_0x5b0a8b){return{'model':db[_0x5b0a8b['model']],'as':_0x5b0a8b['as'],'attributes':_0x5b0a8b[_0xa288('0x17')]};}):[]};}):[]};}):[]:[]})[_0xa288('0xa')](function(_0x539821){logger[_0xa288('0xb')](_0xa288('0x1d'),_0xba620d);logger['debug'](_0xa288('0x1d'),_0xba620d,JSON[_0xa288('0xe')](_0x539821));_0x1c0b93(_0x539821);})[_0xa288('0x12')](function(_0xc80e41){logger[_0xa288('0xf')](_0xa288('0x1d'),_0xc80e41['message'],_0xba620d);_0x3080d8(_0x307c5b[_0xa288('0xf')](0x1f4,_0xc80e41[_0xa288('0x11')]));});});}; \ No newline at end of file +var _0x3914=['info','ZohoAccount,\x20%s,\x20%s','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','limit','include','map','model','ShowZohoAccount','find','attributes','then','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x19324e,_0x35cc43){var _0xcfde4c=function(_0x58d362){while(--_0x58d362){_0x19324e['push'](_0x19324e['shift']());}};_0xcfde4c(++_0x35cc43);}(_0x3914,0xeb));var _0x4391=function(_0x1ca29f,_0x318ac5){_0x1ca29f=_0x1ca29f-0x0;var _0x576c3b=_0x3914[_0x1ca29f];return _0x576c3b;};'use strict';var _=require(_0x4391('0x0'));var util=require(_0x4391('0x1'));var moment=require('moment');var BPromise=require(_0x4391('0x2'));var rs=require(_0x4391('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4391('0x4'))['db'];var utils=require(_0x4391('0x5'));var logger=require(_0x4391('0x6'))('rpc');var config=require(_0x4391('0x7'));var jayson=require(_0x4391('0x8'));var client=jayson['client'][_0x4391('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x49819d,_0x4733a2,_0x5c32ac){return new BPromise(function(_0x378c09,_0x17bcfb){return client['request'](_0x49819d,_0x5c32ac)['then'](function(_0x3d6693){logger[_0x4391('0xa')](_0x4391('0xb'),_0x4733a2,'request\x20sent');logger[_0x4391('0xc')](_0x4391('0xd'),_0x4733a2,_0x4391('0xe'),JSON[_0x4391('0xf')](_0x3d6693));if(_0x3d6693['error']){if(_0x3d6693[_0x4391('0x10')][_0x4391('0x11')]===0x1f4){logger[_0x4391('0x10')](_0x4391('0xb'),_0x4733a2,_0x3d6693[_0x4391('0x10')][_0x4391('0x12')]);return _0x17bcfb(_0x3d6693[_0x4391('0x10')][_0x4391('0x12')]);}logger['error'](_0x4391('0xb'),_0x4733a2,_0x3d6693[_0x4391('0x10')][_0x4391('0x12')]);return _0x378c09(_0x3d6693[_0x4391('0x10')]['message']);}else{logger[_0x4391('0xa')]('ZohoAccount,\x20%s,\x20%s',_0x4733a2,_0x4391('0xe'));_0x378c09(_0x3d6693[_0x4391('0x13')][_0x4391('0x12')]);}})[_0x4391('0x14')](function(_0x2a79a4){logger[_0x4391('0x10')](_0x4391('0xb'),_0x4733a2,_0x2a79a4);_0x17bcfb(_0x2a79a4);});});}exports[_0x4391('0x15')]=function(_0x58a311){var _0x4cfa6b=this;return new Promise(function(_0x2ecb23,_0x4da0b0){return db[_0x4391('0x16')][_0x4391('0x17')]({'raw':_0x58a311[_0x4391('0x18')]?_0x58a311[_0x4391('0x18')][_0x4391('0x19')]===undefined?!![]:![]:!![],'where':_0x58a311['options']?_0x58a311['options'][_0x4391('0x1a')]||null:null,'attributes':_0x58a311[_0x4391('0x18')]?_0x58a311[_0x4391('0x18')]['attributes']||null:null,'limit':_0x58a311[_0x4391('0x18')]?_0x58a311[_0x4391('0x18')][_0x4391('0x1b')]||null:null,'include':_0x58a311[_0x4391('0x18')]?_0x58a311['options'][_0x4391('0x1c')]?_[_0x4391('0x1d')](_0x58a311[_0x4391('0x18')][_0x4391('0x1c')],function(_0x24e16c){return{'model':db[_0x24e16c[_0x4391('0x1e')]],'as':_0x24e16c['as'],'attributes':_0x24e16c['attributes'],'include':_0x24e16c[_0x4391('0x1c')]?_[_0x4391('0x1d')](_0x24e16c[_0x4391('0x1c')],function(_0x333ca6){return{'model':db[_0x333ca6['model']],'as':_0x333ca6['as'],'attributes':_0x333ca6['attributes'],'include':_0x333ca6[_0x4391('0x1c')]?_[_0x4391('0x1d')](_0x333ca6[_0x4391('0x1c')],function(_0x197408){return{'model':db[_0x197408[_0x4391('0x1e')]],'as':_0x197408['as'],'attributes':_0x197408['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ee253){logger['info'](_0x4391('0x15'),_0x58a311);logger[_0x4391('0xc')](_0x4391('0x15'),_0x58a311,JSON[_0x4391('0xf')](_0x4ee253));_0x2ecb23(_0x4ee253);})['catch'](function(_0x34059f){logger[_0x4391('0x10')](_0x4391('0x15'),_0x34059f[_0x4391('0x12')],_0x58a311);_0x4da0b0(_0x4cfa6b[_0x4391('0x10')](0x1f4,_0x34059f['message']));});});};exports[_0x4391('0x1f')]=function(_0x3edb24){var _0x19b5d1=this;return new Promise(function(_0x2b5a06,_0x237d61){return db[_0x4391('0x16')][_0x4391('0x20')]({'raw':_0x3edb24[_0x4391('0x18')]?_0x3edb24[_0x4391('0x18')][_0x4391('0x19')]===undefined?!![]:![]:!![],'where':_0x3edb24[_0x4391('0x18')]?_0x3edb24['options'][_0x4391('0x1a')]||null:null,'attributes':_0x3edb24['options']?_0x3edb24[_0x4391('0x18')]['attributes']||null:null,'include':_0x3edb24['options']?_0x3edb24[_0x4391('0x18')][_0x4391('0x1c')]?_[_0x4391('0x1d')](_0x3edb24[_0x4391('0x18')][_0x4391('0x1c')],function(_0x3fca2a){return{'model':db[_0x3fca2a[_0x4391('0x1e')]],'as':_0x3fca2a['as'],'attributes':_0x3fca2a['attributes'],'include':_0x3fca2a[_0x4391('0x1c')]?_['map'](_0x3fca2a[_0x4391('0x1c')],function(_0x5c58d0){return{'model':db[_0x5c58d0[_0x4391('0x1e')]],'as':_0x5c58d0['as'],'attributes':_0x5c58d0[_0x4391('0x21')],'include':_0x5c58d0[_0x4391('0x1c')]?_[_0x4391('0x1d')](_0x5c58d0[_0x4391('0x1c')],function(_0x4696c8){return{'model':db[_0x4696c8[_0x4391('0x1e')]],'as':_0x4696c8['as'],'attributes':_0x4696c8[_0x4391('0x21')]};}):[]};}):[]};}):[]:[]})[_0x4391('0x22')](function(_0x1b4fab){logger[_0x4391('0xa')](_0x4391('0x1f'),_0x3edb24);logger[_0x4391('0xc')](_0x4391('0x1f'),_0x3edb24,JSON[_0x4391('0xf')](_0x1b4fab));_0x2b5a06(_0x1b4fab);})[_0x4391('0x14')](function(_0x7f513a){logger[_0x4391('0x10')]('ShowZohoAccount',_0x7f513a['message'],_0x3edb24);_0x237d61(_0x19b5d1[_0x4391('0x10')](0x1f4,_0x7f513a[_0x4391('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index ba30fbb..b14fe41 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 _0xe94f=['/:id','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index'];(function(_0x3cc9d9,_0x69ed38){var _0x1a425d=function(_0x44d109){while(--_0x44d109){_0x3cc9d9['push'](_0x3cc9d9['shift']());}};_0x1a425d(++_0x69ed38);}(_0xe94f,0xfb));var _0xfe94=function(_0x4c0622,_0x5dacaf){_0x4c0622=_0x4c0622-0x0;var _0x1799d8=_0xe94f[_0x4c0622];return _0x1799d8;};'use strict';var multer=require(_0xfe94('0x0'));var util=require(_0xfe94('0x1'));var path=require(_0xfe94('0x2'));var timeout=require(_0xfe94('0x3'));var express=require(_0xfe94('0x4'));var router=express[_0xfe94('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xfe94('0x6'));var interaction=require(_0xfe94('0x7'));var config=require(_0xfe94('0x8'));var controller=require(_0xfe94('0x9'));router[_0xfe94('0xa')]('/',auth[_0xfe94('0xb')](),controller[_0xfe94('0xc')]);router[_0xfe94('0xa')](_0xfe94('0xd'),auth[_0xfe94('0xb')](),controller['show']);router[_0xfe94('0xa')](_0xfe94('0xe'),auth[_0xfe94('0xb')](),controller[_0xfe94('0xf')]);router[_0xfe94('0xa')](_0xfe94('0x10'),auth[_0xfe94('0xb')](),controller[_0xfe94('0x11')]);router[_0xfe94('0xa')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xfe94('0x12')]);router['post']('/',auth[_0xfe94('0xb')](),controller[_0xfe94('0x13')]);router['put'](_0xfe94('0xd'),auth[_0xfe94('0xb')](),controller[_0xfe94('0x14')]);router['delete'](_0xfe94('0xd'),auth[_0xfe94('0xb')](),controller['destroy']);module[_0xfe94('0x15')]=router; \ No newline at end of file +var _0x722d=['getDescriptions','post','put','update','delete','/:id','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x514fb2,_0x594018){var _0x4977c6=function(_0x6b105d){while(--_0x6b105d){_0x514fb2['push'](_0x514fb2['shift']());}};_0x4977c6(++_0x594018);}(_0x722d,0xe8));var _0xd722=function(_0x4a48cf,_0x5f1870){_0x4a48cf=_0x4a48cf-0x0;var _0x24a970=_0x722d[_0x4a48cf];return _0x24a970;};'use strict';var multer=require(_0xd722('0x0'));var util=require(_0xd722('0x1'));var path=require(_0xd722('0x2'));var timeout=require(_0xd722('0x3'));var express=require('express');var router=express[_0xd722('0x4')]();var fs_extra=require(_0xd722('0x5'));var auth=require(_0xd722('0x6'));var interaction=require(_0xd722('0x7'));var config=require('../../config/environment');var controller=require(_0xd722('0x8'));router[_0xd722('0x9')]('/',auth[_0xd722('0xa')](),controller[_0xd722('0xb')]);router['get']('/:id',auth[_0xd722('0xa')](),controller[_0xd722('0xc')]);router['get'](_0xd722('0xd'),auth[_0xd722('0xa')](),controller[_0xd722('0xe')]);router['get'](_0xd722('0xf'),auth[_0xd722('0xa')](),controller[_0xd722('0x10')]);router[_0xd722('0x9')](_0xd722('0x11'),auth[_0xd722('0xa')](),controller[_0xd722('0x12')]);router[_0xd722('0x13')]('/',auth[_0xd722('0xa')](),controller['create']);router[_0xd722('0x14')]('/:id',auth[_0xd722('0xa')](),controller[_0xd722('0x15')]);router[_0xd722('0x16')](_0xd722('0x17'),auth[_0xd722('0xa')](),controller['destroy']);module[_0xd722('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 2029e1a..e98551e 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 _0xfd0f=['exports','ENUM','lead','contact','contact_lead','STRING','sequelize'];(function(_0x3fc0ba,_0x599b3e){var _0x2ecb22=function(_0x306914){while(--_0x306914){_0x3fc0ba['push'](_0x3fc0ba['shift']());}};_0x2ecb22(++_0x599b3e);}(_0xfd0f,0x1b8));var _0xffd0=function(_0x5c472c,_0x77fab5){_0x5c472c=_0x5c472c-0x0;var _0x28def7=_0xfd0f[_0x5c472c];return _0x28def7;};'use strict';var Sequelize=require(_0xffd0('0x0'));module[_0xffd0('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0xffd0('0x2')](_0xffd0('0x3'),_0xffd0('0x4'),'nothing'),'defaultValue':_0xffd0('0x3')},'moduleSearch':{'type':Sequelize['ENUM'](_0xffd0('0x5'),_0xffd0('0x4'),_0xffd0('0x3')),'defaultValue':_0xffd0('0x5')},'description':{'type':Sequelize[_0xffd0('0x6')]}}; \ No newline at end of file +var _0x184a=['nothing','ENUM','contact_lead','sequelize','exports','STRING','lead','contact'];(function(_0x57ca7f,_0x4e94f3){var _0x417383=function(_0x1e66bb){while(--_0x1e66bb){_0x57ca7f['push'](_0x57ca7f['shift']());}};_0x417383(++_0x4e94f3);}(_0x184a,0xdb));var _0xa184=function(_0x42500c,_0xf1819f){_0x42500c=_0x42500c-0x0;var _0x5104fb=_0x184a[_0x42500c];return _0x5104fb;};'use strict';var Sequelize=require(_0xa184('0x0'));module[_0xa184('0x1')]={'name':{'type':Sequelize[_0xa184('0x2')]},'moduleCreate':{'type':Sequelize['ENUM'](_0xa184('0x3'),_0xa184('0x4'),_0xa184('0x5')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0xa184('0x6')](_0xa184('0x7'),_0xa184('0x4'),_0xa184('0x3')),'defaultValue':_0xa184('0x7')},'description':{'type':Sequelize[_0xa184('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 0e57107..c2ae393 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 _0xb67a=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','reject','update','then','name','index','map','ZohoConfiguration','rawAttributes','fieldName','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','destroy','getFields','findOne','ZohoField','order','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api'];(function(_0x4bc235,_0x17570f){var _0x403090=function(_0x552a7a){while(--_0x552a7a){_0x4bc235['push'](_0x4bc235['shift']());}};_0x403090(++_0x17570f);}(_0xb67a,0x1c9));var _0xab67=function(_0x7ff21e,_0x36ea9b){_0x7ff21e=_0x7ff21e-0x0;var _0x571cd5=_0xb67a[_0x7ff21e];return _0x571cd5;};'use strict';var emlformat=require(_0xab67('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xab67('0x1'));var jsonpatch=require(_0xab67('0x2'));var rp=require(_0xab67('0x3'));var moment=require(_0xab67('0x4'));var BPromise=require(_0xab67('0x5'));var Mustache=require(_0xab67('0x6'));var util=require('util');var path=require(_0xab67('0x7'));var sox=require(_0xab67('0x8'));var csv=require(_0xab67('0x9'));var ejs=require(_0xab67('0xa'));var fs=require('fs');var fs_extra=require(_0xab67('0xb'));var _=require(_0xab67('0xc'));var squel=require(_0xab67('0xd'));var crypto=require(_0xab67('0xe'));var jsforce=require(_0xab67('0xf'));var deskjs=require(_0xab67('0x10'));var toCsv=require(_0xab67('0x9'));var querystring=require('querystring');var Papa=require(_0xab67('0x11'));var Redis=require(_0xab67('0x12'));var authService=require(_0xab67('0x13'));var qs=require(_0xab67('0x14'));var as=require(_0xab67('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xab67('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xab67('0x17'));var db=require(_0xab67('0x18'))['db'];function respondWithStatusCode(_0x2c331c,_0x2464d2){_0x2464d2=_0x2464d2||0xcc;return function(_0x12ad6a){if(_0x12ad6a){return _0x2c331c[_0xab67('0x19')](_0x2464d2);}return _0x2c331c[_0xab67('0x1a')](_0x2464d2)[_0xab67('0x1b')]();};}function respondWithResult(_0xcab64e,_0x674a6a){_0x674a6a=_0x674a6a||0xc8;return function(_0x5fc986){if(_0x5fc986){return _0xcab64e[_0xab67('0x1a')](_0x674a6a)[_0xab67('0x1c')](_0x5fc986);}};}function respondWithFilteredResult(_0x3a365b,_0x4a314c){return function(_0x263519){if(_0x263519){var _0x1cc464=typeof _0x4a314c['offset']===_0xab67('0x1d')&&typeof _0x4a314c['limit']===_0xab67('0x1d');var _0x31bdec=_0x263519['count'];var _0x1ae7de=_0x1cc464?0x0:_0x4a314c[_0xab67('0x1e')];var _0x370e69=_0x1cc464?_0x263519[_0xab67('0x1f')]:_0x4a314c[_0xab67('0x1e')]+_0x4a314c[_0xab67('0x20')];var _0x2e4e77;if(_0x370e69>=_0x31bdec){_0x370e69=_0x31bdec;_0x2e4e77=0xc8;}else{_0x2e4e77=0xce;}_0x3a365b[_0xab67('0x1a')](_0x2e4e77);return _0x3a365b[_0xab67('0x21')](_0xab67('0x22'),_0x1ae7de+'-'+_0x370e69+'/'+_0x31bdec)[_0xab67('0x1c')](_0x263519);}return null;};}function patchUpdates(_0x26cb77){return function(_0x52ca75){try{jsonpatch[_0xab67('0x23')](_0x52ca75,_0x26cb77,!![]);}catch(_0x24f131){return BPromise[_0xab67('0x24')](_0x24f131);}return _0x52ca75['save']();};}function saveUpdates(_0x2e68a9,_0x4295ac){return function(_0x250591){if(_0x250591){return _0x250591[_0xab67('0x25')](_0x2e68a9)['then'](function(_0x5877ad){return _0x5877ad;});}return null;};}function removeEntity(_0x479eda,_0x57c09b){return function(_0xeebd15){if(_0xeebd15){return _0xeebd15['destroy']()[_0xab67('0x26')](function(){_0x479eda[_0xab67('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a297b,_0x309894){return function(_0x3a59f0){if(!_0x3a59f0){_0x5a297b['sendStatus'](0x194);}return _0x3a59f0;};}function handleError(_0x457e91,_0x59d69f){_0x59d69f=_0x59d69f||0x1f4;return function(_0x3bc2e8){logger['error'](_0x3bc2e8['stack']);if(_0x3bc2e8['name']){delete _0x3bc2e8[_0xab67('0x27')];}_0x457e91[_0xab67('0x1a')](_0x59d69f)['send'](_0x3bc2e8);};}exports[_0xab67('0x28')]=function(_0x1993d8,_0x1f0d62){var _0x17587a={},_0x46a4ec={},_0x40b0e4={'count':0x0,'rows':[]};var _0x299bde=_[_0xab67('0x29')](db[_0xab67('0x2a')][_0xab67('0x2b')],function(_0x505632){return{'name':_0x505632[_0xab67('0x2c')],'type':_0x505632['type']['key']};});_0x46a4ec[_0xab67('0x2d')]=_['map'](_0x299bde,_0xab67('0x27'));_0x46a4ec[_0xab67('0x2e')]=_['keys'](_0x1993d8[_0xab67('0x2e')]);_0x46a4ec[_0xab67('0x2f')]=_[_0xab67('0x30')](_0x46a4ec[_0xab67('0x2d')],_0x46a4ec[_0xab67('0x2e')]);_0x17587a['attributes']=_[_0xab67('0x30')](_0x46a4ec[_0xab67('0x2d')],qs['fields'](_0x1993d8[_0xab67('0x2e')][_0xab67('0x31')]));_0x17587a[_0xab67('0x32')]=_0x17587a['attributes'][_0xab67('0x33')]?_0x17587a['attributes']:_0x46a4ec[_0xab67('0x2d')];if(!_0x1993d8[_0xab67('0x2e')][_0xab67('0x34')](_0xab67('0x35'))){_0x17587a[_0xab67('0x20')]=qs[_0xab67('0x20')](_0x1993d8['query'][_0xab67('0x20')]);_0x17587a[_0xab67('0x1e')]=qs[_0xab67('0x1e')](_0x1993d8['query']['offset']);}_0x17587a['order']=qs[_0xab67('0x36')](_0x1993d8[_0xab67('0x2e')]['sort']);_0x17587a[_0xab67('0x37')]=qs[_0xab67('0x2f')](_[_0xab67('0x38')](_0x1993d8[_0xab67('0x2e')],_0x46a4ec[_0xab67('0x2f')]),_0x299bde);if(_0x1993d8[_0xab67('0x2e')]['filter']){_0x17587a[_0xab67('0x37')]=_[_0xab67('0x39')](_0x17587a['where'],{'$or':_[_0xab67('0x29')](_0x299bde,function(_0x1c21ed){if(_0x1c21ed[_0xab67('0x3a')]!==_0xab67('0x3b')){var _0x552156={};_0x552156[_0x1c21ed[_0xab67('0x27')]]={'$like':'%'+_0x1993d8['query'][_0xab67('0x3c')]+'%'};return _0x552156;}})});}_0x17587a=_[_0xab67('0x39')]({},_0x17587a,_0x1993d8[_0xab67('0x3d')]);var _0x1b547f={'where':_0x17587a['where']};return db['ZohoConfiguration'][_0xab67('0x1f')](_0x1b547f)[_0xab67('0x26')](function(_0x56ff0f){_0x40b0e4['count']=_0x56ff0f;if(_0x1993d8[_0xab67('0x2e')][_0xab67('0x3e')]){_0x17587a[_0xab67('0x3f')]=[{'all':!![]}];}return db[_0xab67('0x2a')][_0xab67('0x40')](_0x17587a);})['then'](function(_0x282c99){_0x40b0e4[_0xab67('0x41')]=_0x282c99;return _0x40b0e4;})[_0xab67('0x26')](respondWithFilteredResult(_0x1f0d62,_0x17587a))['catch'](handleError(_0x1f0d62,null));};exports[_0xab67('0x42')]=function(_0x8fe941,_0x46f713){var _0x12a3a3={'raw':![],'where':{'id':_0x8fe941[_0xab67('0x43')]['id']}},_0x58098f={};_0x58098f[_0xab67('0x2d')]=_[_0xab67('0x44')](db[_0xab67('0x2a')]['rawAttributes']);_0x58098f[_0xab67('0x2e')]=_[_0xab67('0x44')](_0x8fe941[_0xab67('0x2e')]);_0x58098f[_0xab67('0x2f')]=_['intersection'](_0x58098f[_0xab67('0x2d')],_0x58098f[_0xab67('0x2e')]);_0x12a3a3[_0xab67('0x32')]=_['intersection'](_0x58098f[_0xab67('0x2d')],qs[_0xab67('0x31')](_0x8fe941['query'][_0xab67('0x31')]));_0x12a3a3[_0xab67('0x32')]=_0x12a3a3[_0xab67('0x32')][_0xab67('0x33')]?_0x12a3a3['attributes']:_0x58098f['model'];if(_0x8fe941[_0xab67('0x2e')][_0xab67('0x3e')]){_0x12a3a3[_0xab67('0x3f')]=[{'all':!![]}];}_0x12a3a3=_[_0xab67('0x39')]({},_0x12a3a3,_0x8fe941['options']);return db['ZohoConfiguration'][_0xab67('0x45')](_0x12a3a3)[_0xab67('0x26')](handleEntityNotFound(_0x46f713,null))[_0xab67('0x26')](respondWithResult(_0x46f713,null))[_0xab67('0x46')](handleError(_0x46f713,null));};exports[_0xab67('0x47')]=function(_0x597ba6,_0x540a3f){return db[_0xab67('0x2a')]['create'](_0x597ba6[_0xab67('0x48')],{})[_0xab67('0x26')](respondWithResult(_0x540a3f,0xc9))[_0xab67('0x46')](handleError(_0x540a3f,null));};exports[_0xab67('0x25')]=function(_0x2d50c0,_0x3b1c67){if(_0x2d50c0['body']['id']){delete _0x2d50c0['body']['id'];}return db['ZohoConfiguration'][_0xab67('0x45')]({'where':{'id':_0x2d50c0[_0xab67('0x43')]['id']}})['then'](handleEntityNotFound(_0x3b1c67,null))[_0xab67('0x26')](saveUpdates(_0x2d50c0[_0xab67('0x48')],null))[_0xab67('0x26')](respondWithResult(_0x3b1c67,null))[_0xab67('0x46')](handleError(_0x3b1c67,null));};exports[_0xab67('0x49')]=function(_0x4d0b0c,_0x17ef09){return db[_0xab67('0x2a')][_0xab67('0x45')]({'where':{'id':_0x4d0b0c[_0xab67('0x43')]['id']}})[_0xab67('0x26')](handleEntityNotFound(_0x17ef09,null))[_0xab67('0x26')](removeEntity(_0x17ef09,null))[_0xab67('0x46')](handleError(_0x17ef09,null));};exports[_0xab67('0x4a')]=function(_0x1e5d13,_0x52303b,_0x1a4b84){var _0x530103={};var _0xd396a9={};var _0x5691fd;var _0x37e0c6;return db[_0xab67('0x2a')][_0xab67('0x4b')]({'where':{'id':_0x1e5d13['params']['id']}})[_0xab67('0x26')](handleEntityNotFound(_0x52303b,null))[_0xab67('0x26')](function(_0x1197ff){if(_0x1197ff){_0x5691fd=_0x1197ff;_0xd396a9[_0xab67('0x2d')]=_['keys'](db[_0xab67('0x4c')][_0xab67('0x2b')]);_0xd396a9[_0xab67('0x2e')]=_[_0xab67('0x44')](_0x1e5d13[_0xab67('0x2e')]);_0xd396a9[_0xab67('0x2f')]=_[_0xab67('0x30')](_0xd396a9['model'],_0xd396a9[_0xab67('0x2e')]);_0x530103['attributes']=_[_0xab67('0x30')](_0xd396a9[_0xab67('0x2d')],qs[_0xab67('0x31')](_0x1e5d13[_0xab67('0x2e')][_0xab67('0x31')]));_0x530103[_0xab67('0x32')]=_0x530103[_0xab67('0x32')][_0xab67('0x33')]?_0x530103['attributes']:_0xd396a9['model'];_0x530103[_0xab67('0x4d')]=qs[_0xab67('0x36')](_0x1e5d13[_0xab67('0x2e')][_0xab67('0x36')]);_0x530103['where']=qs['filters'](_[_0xab67('0x38')](_0x1e5d13[_0xab67('0x2e')],_0xd396a9[_0xab67('0x2f')]));if(_0x1e5d13['query'][_0xab67('0x3c')]){_0x530103[_0xab67('0x37')]=_[_0xab67('0x39')](_0x530103[_0xab67('0x37')],{'$or':_[_0xab67('0x29')](_0x530103[_0xab67('0x32')],function(_0x44abf1){var _0x94858b={};_0x94858b[_0x44abf1]={'$like':'%'+_0x1e5d13[_0xab67('0x2e')]['filter']+'%'};return _0x94858b;})});}_0x530103=_['merge']({},_0x530103,_0x1e5d13['options']);return _0x5691fd['getFields'](_0x530103);}})[_0xab67('0x26')](function(_0x59dd9e){if(_0x59dd9e){_0x37e0c6=_0x59dd9e[_0xab67('0x33')];if(!_0x1e5d13[_0xab67('0x2e')]['hasOwnProperty'](_0xab67('0x35'))){_0x530103[_0xab67('0x20')]=qs['limit'](_0x1e5d13[_0xab67('0x2e')][_0xab67('0x20')]);_0x530103['offset']=qs[_0xab67('0x1e')](_0x1e5d13[_0xab67('0x2e')][_0xab67('0x1e')]);}return _0x5691fd[_0xab67('0x4a')](_0x530103);}})['then'](function(_0x226cf8){if(_0x226cf8){return _0x226cf8?{'count':_0x37e0c6,'rows':_0x226cf8}:null;}})[_0xab67('0x26')](respondWithResult(_0x52303b,null))[_0xab67('0x46')](handleError(_0x52303b,null));};exports[_0xab67('0x4e')]=function(_0x31f21f,_0x7de885,_0x52c866){var _0x195099={};var _0x204912={};var _0x3a9e72;var _0x4f557c;return db[_0xab67('0x2a')][_0xab67('0x4b')]({'where':{'id':_0x31f21f[_0xab67('0x43')]['id']}})['then'](handleEntityNotFound(_0x7de885,null))[_0xab67('0x26')](function(_0xafcc37){if(_0xafcc37){_0x3a9e72=_0xafcc37;_0x204912[_0xab67('0x2d')]=_[_0xab67('0x44')](db[_0xab67('0x4c')][_0xab67('0x2b')]);_0x204912[_0xab67('0x2e')]=_[_0xab67('0x44')](_0x31f21f[_0xab67('0x2e')]);_0x204912[_0xab67('0x2f')]=_['intersection'](_0x204912[_0xab67('0x2d')],_0x204912[_0xab67('0x2e')]);_0x195099[_0xab67('0x32')]=_[_0xab67('0x30')](_0x204912[_0xab67('0x2d')],qs[_0xab67('0x31')](_0x31f21f[_0xab67('0x2e')][_0xab67('0x31')]));_0x195099['attributes']=_0x195099['attributes'][_0xab67('0x33')]?_0x195099['attributes']:_0x204912['model'];_0x195099['order']=qs[_0xab67('0x36')](_0x31f21f[_0xab67('0x2e')][_0xab67('0x36')]);_0x195099['where']=qs[_0xab67('0x2f')](_[_0xab67('0x38')](_0x31f21f[_0xab67('0x2e')],_0x204912[_0xab67('0x2f')]));if(_0x31f21f['query'][_0xab67('0x3c')]){_0x195099['where']=_[_0xab67('0x39')](_0x195099[_0xab67('0x37')],{'$or':_[_0xab67('0x29')](_0x195099[_0xab67('0x32')],function(_0xe9904f){var _0x59a617={};_0x59a617[_0xe9904f]={'$like':'%'+_0x31f21f[_0xab67('0x2e')]['filter']+'%'};return _0x59a617;})});}_0x195099=_[_0xab67('0x39')]({},_0x195099,_0x31f21f[_0xab67('0x3d')]);return _0x3a9e72[_0xab67('0x4e')](_0x195099);}})[_0xab67('0x26')](function(_0x4d9ee3){if(_0x4d9ee3){_0x4f557c=_0x4d9ee3[_0xab67('0x33')];if(!_0x31f21f[_0xab67('0x2e')][_0xab67('0x34')](_0xab67('0x35'))){_0x195099['limit']=qs[_0xab67('0x20')](_0x31f21f[_0xab67('0x2e')][_0xab67('0x20')]);_0x195099['offset']=qs[_0xab67('0x1e')](_0x31f21f[_0xab67('0x2e')][_0xab67('0x1e')]);}return _0x3a9e72['getSubjects'](_0x195099);}})[_0xab67('0x26')](function(_0x3d2ed1){if(_0x3d2ed1){return _0x3d2ed1?{'count':_0x4f557c,'rows':_0x3d2ed1}:null;}})[_0xab67('0x26')](respondWithResult(_0x7de885,null))[_0xab67('0x46')](handleError(_0x7de885,null));};exports[_0xab67('0x4f')]=function(_0x90799d,_0x3bff5e,_0x1b8ad3){var _0x5b0e6a={};var _0x1e320f={};var _0x9174c9;var _0x48f3e7;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x90799d[_0xab67('0x43')]['id']}})[_0xab67('0x26')](handleEntityNotFound(_0x3bff5e,null))[_0xab67('0x26')](function(_0x4eb208){if(_0x4eb208){_0x9174c9=_0x4eb208;_0x1e320f[_0xab67('0x2d')]=_[_0xab67('0x44')](db[_0xab67('0x4c')][_0xab67('0x2b')]);_0x1e320f[_0xab67('0x2e')]=_['keys'](_0x90799d[_0xab67('0x2e')]);_0x1e320f[_0xab67('0x2f')]=_[_0xab67('0x30')](_0x1e320f[_0xab67('0x2d')],_0x1e320f[_0xab67('0x2e')]);_0x5b0e6a['attributes']=_['intersection'](_0x1e320f[_0xab67('0x2d')],qs['fields'](_0x90799d[_0xab67('0x2e')][_0xab67('0x31')]));_0x5b0e6a[_0xab67('0x32')]=_0x5b0e6a['attributes'][_0xab67('0x33')]?_0x5b0e6a['attributes']:_0x1e320f[_0xab67('0x2d')];_0x5b0e6a[_0xab67('0x4d')]=qs[_0xab67('0x36')](_0x90799d[_0xab67('0x2e')][_0xab67('0x36')]);_0x5b0e6a['where']=qs[_0xab67('0x2f')](_[_0xab67('0x38')](_0x90799d[_0xab67('0x2e')],_0x1e320f[_0xab67('0x2f')]));if(_0x90799d[_0xab67('0x2e')][_0xab67('0x3c')]){_0x5b0e6a[_0xab67('0x37')]=_[_0xab67('0x39')](_0x5b0e6a[_0xab67('0x37')],{'$or':_[_0xab67('0x29')](_0x5b0e6a['attributes'],function(_0x2772e5){var _0x4d420c={};_0x4d420c[_0x2772e5]={'$like':'%'+_0x90799d[_0xab67('0x2e')]['filter']+'%'};return _0x4d420c;})});}_0x5b0e6a=_[_0xab67('0x39')]({},_0x5b0e6a,_0x90799d[_0xab67('0x3d')]);return _0x9174c9[_0xab67('0x4f')](_0x5b0e6a);}})['then'](function(_0x1cf267){if(_0x1cf267){_0x48f3e7=_0x1cf267[_0xab67('0x33')];if(!_0x90799d['query'][_0xab67('0x34')](_0xab67('0x35'))){_0x5b0e6a['limit']=qs[_0xab67('0x20')](_0x90799d[_0xab67('0x2e')][_0xab67('0x20')]);_0x5b0e6a[_0xab67('0x1e')]=qs[_0xab67('0x1e')](_0x90799d['query'][_0xab67('0x1e')]);}return _0x9174c9[_0xab67('0x4f')](_0x5b0e6a);}})['then'](function(_0xa17e6f){if(_0xa17e6f){return _0xa17e6f?{'count':_0x48f3e7,'rows':_0xa17e6f}:null;}})[_0xab67('0x26')](respondWithResult(_0x3bff5e,null))['catch'](handleError(_0x3bff5e,null));}; \ No newline at end of file +var _0x8547=['fieldName','type','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','intersection','include','find','create','body','params','getFields','findOne','ZohoField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','update','destroy','then','stack','name','send','index','map','ZohoConfiguration','rawAttributes'];(function(_0x1157ac,_0x5f3dcd){var _0x49de5d=function(_0x3d6e11){while(--_0x3d6e11){_0x1157ac['push'](_0x1157ac['shift']());}};_0x49de5d(++_0x5f3dcd);}(_0x8547,0x1b8));var _0x7854=function(_0x3651b7,_0x1fadbe){_0x3651b7=_0x3651b7-0x0;var _0xc7f8f9=_0x8547[_0x3651b7];return _0xc7f8f9;};'use strict';var emlformat=require(_0x7854('0x0'));var rimraf=require(_0x7854('0x1'));var zipdir=require(_0x7854('0x2'));var jsonpatch=require(_0x7854('0x3'));var rp=require('request-promise');var moment=require(_0x7854('0x4'));var BPromise=require(_0x7854('0x5'));var Mustache=require(_0x7854('0x6'));var util=require('util');var path=require(_0x7854('0x7'));var sox=require(_0x7854('0x8'));var csv=require('to-csv');var ejs=require(_0x7854('0x9'));var fs=require('fs');var fs_extra=require(_0x7854('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7854('0xb'));var jsforce=require(_0x7854('0xc'));var deskjs=require(_0x7854('0xd'));var toCsv=require(_0x7854('0xe'));var querystring=require(_0x7854('0xf'));var Papa=require('papaparse');var Redis=require(_0x7854('0x10'));var authService=require(_0x7854('0x11'));var qs=require(_0x7854('0x12'));var as=require(_0x7854('0x13'));var hardwareService=require(_0x7854('0x14'));var logger=require(_0x7854('0x15'))(_0x7854('0x16'));var utils=require('../../config/utils');var config=require(_0x7854('0x17'));var licenseUtil=require(_0x7854('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d0a5a,_0x40b649){_0x40b649=_0x40b649||0xcc;return function(_0x980164){if(_0x980164){return _0x3d0a5a[_0x7854('0x19')](_0x40b649);}return _0x3d0a5a[_0x7854('0x1a')](_0x40b649)[_0x7854('0x1b')]();};}function respondWithResult(_0xb35764,_0x461209){_0x461209=_0x461209||0xc8;return function(_0x1a68bf){if(_0x1a68bf){return _0xb35764[_0x7854('0x1a')](_0x461209)[_0x7854('0x1c')](_0x1a68bf);}};}function respondWithFilteredResult(_0x138dae,_0x562ea6){return function(_0x2840d6){if(_0x2840d6){var _0x2bedff=typeof _0x562ea6[_0x7854('0x1d')]==='undefined'&&typeof _0x562ea6['limit']===_0x7854('0x1e');var _0x67328d=_0x2840d6[_0x7854('0x1f')];var _0x3e9a16=_0x2bedff?0x0:_0x562ea6[_0x7854('0x1d')];var _0x548067=_0x2bedff?_0x2840d6[_0x7854('0x1f')]:_0x562ea6[_0x7854('0x1d')]+_0x562ea6[_0x7854('0x20')];var _0x47190d;if(_0x548067>=_0x67328d){_0x548067=_0x67328d;_0x47190d=0xc8;}else{_0x47190d=0xce;}_0x138dae[_0x7854('0x1a')](_0x47190d);return _0x138dae[_0x7854('0x21')]('Content-Range',_0x3e9a16+'-'+_0x548067+'/'+_0x67328d)[_0x7854('0x1c')](_0x2840d6);}return null;};}function patchUpdates(_0x593ac3){return function(_0x3bcd8e){try{jsonpatch[_0x7854('0x22')](_0x3bcd8e,_0x593ac3,!![]);}catch(_0xd1ae08){return BPromise[_0x7854('0x23')](_0xd1ae08);}return _0x3bcd8e['save']();};}function saveUpdates(_0x362af2,_0x25c54b){return function(_0x38e423){if(_0x38e423){return _0x38e423[_0x7854('0x24')](_0x362af2)['then'](function(_0x115b50){return _0x115b50;});}return null;};}function removeEntity(_0x549c40,_0x46ed71){return function(_0x446068){if(_0x446068){return _0x446068[_0x7854('0x25')]()[_0x7854('0x26')](function(){_0x549c40[_0x7854('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x450870,_0x5359f4){return function(_0x570528){if(!_0x570528){_0x450870[_0x7854('0x19')](0x194);}return _0x570528;};}function handleError(_0x56ac4e,_0x10adc9){_0x10adc9=_0x10adc9||0x1f4;return function(_0x3b1505){logger['error'](_0x3b1505[_0x7854('0x27')]);if(_0x3b1505[_0x7854('0x28')]){delete _0x3b1505['name'];}_0x56ac4e[_0x7854('0x1a')](_0x10adc9)[_0x7854('0x29')](_0x3b1505);};}exports[_0x7854('0x2a')]=function(_0x4d07fd,_0xe3953a){var _0x50e4d5={},_0x480f1a={},_0x678636={'count':0x0,'rows':[]};var _0x336665=_[_0x7854('0x2b')](db[_0x7854('0x2c')][_0x7854('0x2d')],function(_0x49daba){return{'name':_0x49daba[_0x7854('0x2e')],'type':_0x49daba[_0x7854('0x2f')][_0x7854('0x30')]};});_0x480f1a[_0x7854('0x31')]=_['map'](_0x336665,_0x7854('0x28'));_0x480f1a['query']=_[_0x7854('0x32')](_0x4d07fd[_0x7854('0x33')]);_0x480f1a[_0x7854('0x34')]=_['intersection'](_0x480f1a['model'],_0x480f1a[_0x7854('0x33')]);_0x50e4d5[_0x7854('0x35')]=_['intersection'](_0x480f1a[_0x7854('0x31')],qs[_0x7854('0x36')](_0x4d07fd['query'][_0x7854('0x36')]));_0x50e4d5[_0x7854('0x35')]=_0x50e4d5['attributes'][_0x7854('0x37')]?_0x50e4d5['attributes']:_0x480f1a['model'];if(!_0x4d07fd[_0x7854('0x33')][_0x7854('0x38')](_0x7854('0x39'))){_0x50e4d5[_0x7854('0x20')]=qs[_0x7854('0x20')](_0x4d07fd[_0x7854('0x33')][_0x7854('0x20')]);_0x50e4d5[_0x7854('0x1d')]=qs[_0x7854('0x1d')](_0x4d07fd['query'][_0x7854('0x1d')]);}_0x50e4d5[_0x7854('0x3a')]=qs[_0x7854('0x3b')](_0x4d07fd[_0x7854('0x33')]['sort']);_0x50e4d5[_0x7854('0x3c')]=qs[_0x7854('0x34')](_[_0x7854('0x3d')](_0x4d07fd[_0x7854('0x33')],_0x480f1a['filters']),_0x336665);if(_0x4d07fd['query'][_0x7854('0x3e')]){_0x50e4d5[_0x7854('0x3c')]=_[_0x7854('0x3f')](_0x50e4d5['where'],{'$or':_['map'](_0x336665,function(_0x913205){if(_0x913205[_0x7854('0x2f')]!=='VIRTUAL'){var _0x20f769={};_0x20f769[_0x913205[_0x7854('0x28')]]={'$like':'%'+_0x4d07fd['query'][_0x7854('0x3e')]+'%'};return _0x20f769;}})});}_0x50e4d5=_[_0x7854('0x3f')]({},_0x50e4d5,_0x4d07fd[_0x7854('0x40')]);var _0x4a6f3e={'where':_0x50e4d5[_0x7854('0x3c')]};return db[_0x7854('0x2c')]['count'](_0x4a6f3e)[_0x7854('0x26')](function(_0x3cb988){_0x678636[_0x7854('0x1f')]=_0x3cb988;if(_0x4d07fd['query'][_0x7854('0x41')]){_0x50e4d5['include']=[{'all':!![]}];}return db[_0x7854('0x2c')][_0x7854('0x42')](_0x50e4d5);})['then'](function(_0x34bba4){_0x678636[_0x7854('0x43')]=_0x34bba4;return _0x678636;})[_0x7854('0x26')](respondWithFilteredResult(_0xe3953a,_0x50e4d5))[_0x7854('0x44')](handleError(_0xe3953a,null));};exports[_0x7854('0x45')]=function(_0xfe3e05,_0x462cd5){var _0x3b039d={'raw':![],'where':{'id':_0xfe3e05['params']['id']}},_0x503ba8={};_0x503ba8[_0x7854('0x31')]=_[_0x7854('0x32')](db[_0x7854('0x2c')][_0x7854('0x2d')]);_0x503ba8['query']=_[_0x7854('0x32')](_0xfe3e05[_0x7854('0x33')]);_0x503ba8[_0x7854('0x34')]=_[_0x7854('0x46')](_0x503ba8[_0x7854('0x31')],_0x503ba8[_0x7854('0x33')]);_0x3b039d[_0x7854('0x35')]=_[_0x7854('0x46')](_0x503ba8['model'],qs[_0x7854('0x36')](_0xfe3e05[_0x7854('0x33')][_0x7854('0x36')]));_0x3b039d['attributes']=_0x3b039d[_0x7854('0x35')][_0x7854('0x37')]?_0x3b039d[_0x7854('0x35')]:_0x503ba8['model'];if(_0xfe3e05[_0x7854('0x33')][_0x7854('0x41')]){_0x3b039d[_0x7854('0x47')]=[{'all':!![]}];}_0x3b039d=_['merge']({},_0x3b039d,_0xfe3e05[_0x7854('0x40')]);return db[_0x7854('0x2c')][_0x7854('0x48')](_0x3b039d)[_0x7854('0x26')](handleEntityNotFound(_0x462cd5,null))['then'](respondWithResult(_0x462cd5,null))[_0x7854('0x44')](handleError(_0x462cd5,null));};exports['create']=function(_0x528c11,_0x3cf362){return db[_0x7854('0x2c')][_0x7854('0x49')](_0x528c11[_0x7854('0x4a')],{})[_0x7854('0x26')](respondWithResult(_0x3cf362,0xc9))['catch'](handleError(_0x3cf362,null));};exports[_0x7854('0x24')]=function(_0x484af4,_0x59e26c){if(_0x484af4[_0x7854('0x4a')]['id']){delete _0x484af4[_0x7854('0x4a')]['id'];}return db['ZohoConfiguration']['find']({'where':{'id':_0x484af4[_0x7854('0x4b')]['id']}})[_0x7854('0x26')](handleEntityNotFound(_0x59e26c,null))[_0x7854('0x26')](saveUpdates(_0x484af4['body'],null))[_0x7854('0x26')](respondWithResult(_0x59e26c,null))[_0x7854('0x44')](handleError(_0x59e26c,null));};exports[_0x7854('0x25')]=function(_0x37c5ea,_0x436741){return db['ZohoConfiguration']['find']({'where':{'id':_0x37c5ea[_0x7854('0x4b')]['id']}})[_0x7854('0x26')](handleEntityNotFound(_0x436741,null))[_0x7854('0x26')](removeEntity(_0x436741,null))[_0x7854('0x44')](handleError(_0x436741,null));};exports[_0x7854('0x4c')]=function(_0x50312f,_0x1057a9,_0x3017cc){var _0x37e1a1={};var _0x4ed3f0={};var _0x30fe8d;var _0x14ae5c;return db[_0x7854('0x2c')][_0x7854('0x4d')]({'where':{'id':_0x50312f['params']['id']}})[_0x7854('0x26')](handleEntityNotFound(_0x1057a9,null))[_0x7854('0x26')](function(_0x1747be){if(_0x1747be){_0x30fe8d=_0x1747be;_0x4ed3f0[_0x7854('0x31')]=_[_0x7854('0x32')](db[_0x7854('0x4e')][_0x7854('0x2d')]);_0x4ed3f0[_0x7854('0x33')]=_[_0x7854('0x32')](_0x50312f[_0x7854('0x33')]);_0x4ed3f0[_0x7854('0x34')]=_[_0x7854('0x46')](_0x4ed3f0['model'],_0x4ed3f0['query']);_0x37e1a1[_0x7854('0x35')]=_[_0x7854('0x46')](_0x4ed3f0[_0x7854('0x31')],qs[_0x7854('0x36')](_0x50312f[_0x7854('0x33')][_0x7854('0x36')]));_0x37e1a1[_0x7854('0x35')]=_0x37e1a1[_0x7854('0x35')]['length']?_0x37e1a1[_0x7854('0x35')]:_0x4ed3f0[_0x7854('0x31')];_0x37e1a1['order']=qs[_0x7854('0x3b')](_0x50312f[_0x7854('0x33')][_0x7854('0x3b')]);_0x37e1a1[_0x7854('0x3c')]=qs[_0x7854('0x34')](_[_0x7854('0x3d')](_0x50312f[_0x7854('0x33')],_0x4ed3f0[_0x7854('0x34')]));if(_0x50312f['query'][_0x7854('0x3e')]){_0x37e1a1['where']=_['merge'](_0x37e1a1[_0x7854('0x3c')],{'$or':_[_0x7854('0x2b')](_0x37e1a1[_0x7854('0x35')],function(_0x4635a6){var _0x536bc6={};_0x536bc6[_0x4635a6]={'$like':'%'+_0x50312f[_0x7854('0x33')][_0x7854('0x3e')]+'%'};return _0x536bc6;})});}_0x37e1a1=_[_0x7854('0x3f')]({},_0x37e1a1,_0x50312f[_0x7854('0x40')]);return _0x30fe8d[_0x7854('0x4c')](_0x37e1a1);}})[_0x7854('0x26')](function(_0x1431fc){if(_0x1431fc){_0x14ae5c=_0x1431fc[_0x7854('0x37')];if(!_0x50312f[_0x7854('0x33')]['hasOwnProperty']('nolimit')){_0x37e1a1[_0x7854('0x20')]=qs['limit'](_0x50312f[_0x7854('0x33')][_0x7854('0x20')]);_0x37e1a1['offset']=qs[_0x7854('0x1d')](_0x50312f[_0x7854('0x33')]['offset']);}return _0x30fe8d[_0x7854('0x4c')](_0x37e1a1);}})[_0x7854('0x26')](function(_0x5dffbf){if(_0x5dffbf){return _0x5dffbf?{'count':_0x14ae5c,'rows':_0x5dffbf}:null;}})[_0x7854('0x26')](respondWithResult(_0x1057a9,null))[_0x7854('0x44')](handleError(_0x1057a9,null));};exports[_0x7854('0x4f')]=function(_0x5ba569,_0x149985,_0x1a98d1){var _0x369a27={};var _0xb297e6={};var _0x50e9b8;var _0x4b943f;return db['ZohoConfiguration'][_0x7854('0x4d')]({'where':{'id':_0x5ba569[_0x7854('0x4b')]['id']}})[_0x7854('0x26')](handleEntityNotFound(_0x149985,null))[_0x7854('0x26')](function(_0x361ff1){if(_0x361ff1){_0x50e9b8=_0x361ff1;_0xb297e6['model']=_[_0x7854('0x32')](db['ZohoField']['rawAttributes']);_0xb297e6['query']=_[_0x7854('0x32')](_0x5ba569['query']);_0xb297e6[_0x7854('0x34')]=_[_0x7854('0x46')](_0xb297e6['model'],_0xb297e6[_0x7854('0x33')]);_0x369a27[_0x7854('0x35')]=_[_0x7854('0x46')](_0xb297e6['model'],qs['fields'](_0x5ba569[_0x7854('0x33')][_0x7854('0x36')]));_0x369a27[_0x7854('0x35')]=_0x369a27[_0x7854('0x35')][_0x7854('0x37')]?_0x369a27[_0x7854('0x35')]:_0xb297e6[_0x7854('0x31')];_0x369a27[_0x7854('0x3a')]=qs[_0x7854('0x3b')](_0x5ba569[_0x7854('0x33')]['sort']);_0x369a27[_0x7854('0x3c')]=qs[_0x7854('0x34')](_[_0x7854('0x3d')](_0x5ba569[_0x7854('0x33')],_0xb297e6[_0x7854('0x34')]));if(_0x5ba569['query'][_0x7854('0x3e')]){_0x369a27[_0x7854('0x3c')]=_[_0x7854('0x3f')](_0x369a27[_0x7854('0x3c')],{'$or':_[_0x7854('0x2b')](_0x369a27['attributes'],function(_0x3ccdfe){var _0x2d3487={};_0x2d3487[_0x3ccdfe]={'$like':'%'+_0x5ba569['query']['filter']+'%'};return _0x2d3487;})});}_0x369a27=_[_0x7854('0x3f')]({},_0x369a27,_0x5ba569['options']);return _0x50e9b8[_0x7854('0x4f')](_0x369a27);}})[_0x7854('0x26')](function(_0x468298){if(_0x468298){_0x4b943f=_0x468298['length'];if(!_0x5ba569['query']['hasOwnProperty'](_0x7854('0x39'))){_0x369a27['limit']=qs[_0x7854('0x20')](_0x5ba569[_0x7854('0x33')][_0x7854('0x20')]);_0x369a27[_0x7854('0x1d')]=qs['offset'](_0x5ba569['query'][_0x7854('0x1d')]);}return _0x50e9b8[_0x7854('0x4f')](_0x369a27);}})[_0x7854('0x26')](function(_0x341a08){if(_0x341a08){return _0x341a08?{'count':_0x4b943f,'rows':_0x341a08}:null;}})[_0x7854('0x26')](respondWithResult(_0x149985,null))[_0x7854('0x44')](handleError(_0x149985,null));};exports[_0x7854('0x50')]=function(_0x499715,_0x444a06,_0x525182){var _0xb283e8={};var _0x9c9bb={};var _0x5a0977;var _0x520376;return db[_0x7854('0x2c')][_0x7854('0x4d')]({'where':{'id':_0x499715[_0x7854('0x4b')]['id']}})['then'](handleEntityNotFound(_0x444a06,null))['then'](function(_0xc9512a){if(_0xc9512a){_0x5a0977=_0xc9512a;_0x9c9bb[_0x7854('0x31')]=_['keys'](db['ZohoField'][_0x7854('0x2d')]);_0x9c9bb[_0x7854('0x33')]=_[_0x7854('0x32')](_0x499715[_0x7854('0x33')]);_0x9c9bb['filters']=_[_0x7854('0x46')](_0x9c9bb['model'],_0x9c9bb['query']);_0xb283e8[_0x7854('0x35')]=_['intersection'](_0x9c9bb[_0x7854('0x31')],qs[_0x7854('0x36')](_0x499715[_0x7854('0x33')][_0x7854('0x36')]));_0xb283e8[_0x7854('0x35')]=_0xb283e8[_0x7854('0x35')]['length']?_0xb283e8[_0x7854('0x35')]:_0x9c9bb['model'];_0xb283e8[_0x7854('0x3a')]=qs[_0x7854('0x3b')](_0x499715[_0x7854('0x33')][_0x7854('0x3b')]);_0xb283e8['where']=qs['filters'](_[_0x7854('0x3d')](_0x499715[_0x7854('0x33')],_0x9c9bb[_0x7854('0x34')]));if(_0x499715[_0x7854('0x33')]['filter']){_0xb283e8['where']=_[_0x7854('0x3f')](_0xb283e8[_0x7854('0x3c')],{'$or':_[_0x7854('0x2b')](_0xb283e8[_0x7854('0x35')],function(_0xc1709){var _0x2b282f={};_0x2b282f[_0xc1709]={'$like':'%'+_0x499715['query'][_0x7854('0x3e')]+'%'};return _0x2b282f;})});}_0xb283e8=_[_0x7854('0x3f')]({},_0xb283e8,_0x499715[_0x7854('0x40')]);return _0x5a0977['getDescriptions'](_0xb283e8);}})['then'](function(_0x2b1c10){if(_0x2b1c10){_0x520376=_0x2b1c10[_0x7854('0x37')];if(!_0x499715[_0x7854('0x33')][_0x7854('0x38')]('nolimit')){_0xb283e8[_0x7854('0x20')]=qs['limit'](_0x499715[_0x7854('0x33')][_0x7854('0x20')]);_0xb283e8['offset']=qs['offset'](_0x499715[_0x7854('0x33')]['offset']);}return _0x5a0977[_0x7854('0x50')](_0xb283e8);}})['then'](function(_0x15d12d){if(_0x15d12d){return _0x15d12d?{'count':_0x520376,'rows':_0x15d12d}:null;}})[_0x7854('0x26')](respondWithResult(_0x444a06,null))['catch'](handleError(_0x444a06,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 174f5cf..bd98b5b 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 _0x156b=['ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','define'];(function(_0x2b3800,_0x586d01){var _0x25a792=function(_0x515835){while(--_0x515835){_0x2b3800['push'](_0x2b3800['shift']());}};_0x25a792(++_0x586d01);}(_0x156b,0x146));var _0xb156=function(_0x299eb8,_0x2a3c76){_0x299eb8=_0x299eb8-0x0;var _0x59ee49=_0x156b[_0x299eb8];return _0x59ee49;};'use strict';var _=require(_0xb156('0x0'));var util=require(_0xb156('0x1'));var logger=require(_0xb156('0x2'))(_0xb156('0x3'));var moment=require(_0xb156('0x4'));var BPromise=require(_0xb156('0x5'));var rp=require(_0xb156('0x6'));var fs=require('fs');var path=require(_0xb156('0x7'));var rimraf=require(_0xb156('0x8'));var config=require('../../config/environment');var attributes=require('./intZohoConfiguration.attributes');module['exports']=function(_0x3a45f3,_0x543681){return _0x3a45f3[_0xb156('0x9')](_0xb156('0xa'),attributes,{'tableName':_0xb156('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd021=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','lodash','util'];(function(_0x43aac1,_0x181944){var _0x3cc143=function(_0x553e07){while(--_0x553e07){_0x43aac1['push'](_0x43aac1['shift']());}};_0x3cc143(++_0x181944);}(_0xd021,0x186));var _0x1d02=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd021[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x1d02('0x0'));var util=require(_0x1d02('0x1'));var logger=require(_0x1d02('0x2'))(_0x1d02('0x3'));var moment=require(_0x1d02('0x4'));var BPromise=require(_0x1d02('0x5'));var rp=require(_0x1d02('0x6'));var fs=require('fs');var path=require(_0x1d02('0x7'));var rimraf=require(_0x1d02('0x8'));var config=require(_0x1d02('0x9'));var attributes=require(_0x1d02('0xa'));module[_0x1d02('0xb')]=function(_0x23d259,_0x54ac53){return _0x23d259[_0x1d02('0xc')](_0x1d02('0xd'),attributes,{'tableName':'int_zoho_configurations','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 e20e45a..efc3d9e 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 _0x6326=['request\x20sent','debug','stringify','error','code','message','result','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s'];(function(_0x1e9b13,_0x78c34b){var _0x27254f=function(_0x3aa64d){while(--_0x3aa64d){_0x1e9b13['push'](_0x1e9b13['shift']());}};_0x27254f(++_0x78c34b);}(_0x6326,0x197));var _0x6632=function(_0x173e75,_0x50ea70){_0x173e75=_0x173e75-0x0;var _0x4fd13f=_0x6326[_0x173e75];return _0x4fd13f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6632('0x0'));var BPromise=require('bluebird');var rs=require(_0x6632('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6632('0x2'))['db'];var utils=require(_0x6632('0x3'));var logger=require(_0x6632('0x4'))('rpc');var config=require(_0x6632('0x5'));var jayson=require(_0x6632('0x6'));var client=jayson[_0x6632('0x7')][_0x6632('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xd24a74,_0x422b8e,_0x33815e){return new BPromise(function(_0x34b186,_0x14ef40){return client[_0x6632('0x9')](_0xd24a74,_0x33815e)[_0x6632('0xa')](function(_0x585741){logger[_0x6632('0xb')](_0x6632('0xc'),_0x422b8e,_0x6632('0xd'));logger[_0x6632('0xe')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x422b8e,_0x6632('0xd'),JSON[_0x6632('0xf')](_0x585741));if(_0x585741[_0x6632('0x10')]){if(_0x585741['error'][_0x6632('0x11')]===0x1f4){logger['error'](_0x6632('0xc'),_0x422b8e,_0x585741[_0x6632('0x10')][_0x6632('0x12')]);return _0x14ef40(_0x585741[_0x6632('0x10')][_0x6632('0x12')]);}logger[_0x6632('0x10')](_0x6632('0xc'),_0x422b8e,_0x585741[_0x6632('0x10')][_0x6632('0x12')]);return _0x34b186(_0x585741[_0x6632('0x10')]['message']);}else{logger[_0x6632('0xb')](_0x6632('0xc'),_0x422b8e,_0x6632('0xd'));_0x34b186(_0x585741[_0x6632('0x13')][_0x6632('0x12')]);}})['catch'](function(_0x51e521){logger[_0x6632('0x10')](_0x6632('0xc'),_0x422b8e,_0x51e521);_0x14ef40(_0x51e521);});});} \ No newline at end of file +var _0x9385=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ZohoConfiguration,\x20%s,\x20%s'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x9385,0x13a));var _0x5938=function(_0x49c824,_0x18e9be){_0x49c824=_0x49c824-0x0;var _0x29dc99=_0x9385[_0x49c824];return _0x29dc99;};'use strict';var _=require(_0x5938('0x0'));var util=require(_0x5938('0x1'));var moment=require('moment');var BPromise=require(_0x5938('0x2'));var rs=require(_0x5938('0x3'));var fs=require('fs');var Redis=require(_0x5938('0x4'));var db=require(_0x5938('0x5'))['db'];var utils=require(_0x5938('0x6'));var logger=require(_0x5938('0x7'))(_0x5938('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5938('0x9')][_0x5938('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x42dedc,_0x1f4171,_0x48b4e3){return new BPromise(function(_0x35d068,_0x27fc80){return client[_0x5938('0xb')](_0x42dedc,_0x48b4e3)[_0x5938('0xc')](function(_0x3e37b7){logger[_0x5938('0xd')]('ZohoConfiguration,\x20%s,\x20%s',_0x1f4171,_0x5938('0xe'));logger[_0x5938('0xf')](_0x5938('0x10'),_0x1f4171,_0x5938('0xe'),JSON[_0x5938('0x11')](_0x3e37b7));if(_0x3e37b7[_0x5938('0x12')]){if(_0x3e37b7[_0x5938('0x12')][_0x5938('0x13')]===0x1f4){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x1f4171,_0x3e37b7['error'][_0x5938('0x14')]);return _0x27fc80(_0x3e37b7[_0x5938('0x12')]['message']);}logger[_0x5938('0x12')](_0x5938('0x15'),_0x1f4171,_0x3e37b7[_0x5938('0x12')]['message']);return _0x35d068(_0x3e37b7[_0x5938('0x12')][_0x5938('0x14')]);}else{logger[_0x5938('0xd')]('ZohoConfiguration,\x20%s,\x20%s',_0x1f4171,'request\x20sent');_0x35d068(_0x3e37b7[_0x5938('0x16')][_0x5938('0x14')]);}})[_0x5938('0x17')](function(_0x518188){logger[_0x5938('0x12')](_0x5938('0x15'),_0x1f4171,_0x518188);_0x27fc80(_0x518188);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 8cfd087..5f8979e 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 _0xcf73=['fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoField.controller','get','index','isAuthenticated','create','update','delete','destroy','util','path','connect-timeout','express','Router'];(function(_0x10359d,_0x5588d8){var _0x72924e=function(_0xad24e3){while(--_0xad24e3){_0x10359d['push'](_0x10359d['shift']());}};_0x72924e(++_0x5588d8);}(_0xcf73,0x10b));var _0x3cf7=function(_0xd0775,_0x29656d){_0xd0775=_0xd0775-0x0;var _0x1658fa=_0xcf73[_0xd0775];return _0x1658fa;};'use strict';var multer=require('multer');var util=require(_0x3cf7('0x0'));var path=require(_0x3cf7('0x1'));var timeout=require(_0x3cf7('0x2'));var express=require(_0x3cf7('0x3'));var router=express[_0x3cf7('0x4')]();var fs_extra=require(_0x3cf7('0x5'));var auth=require(_0x3cf7('0x6'));var interaction=require(_0x3cf7('0x7'));var config=require('../../config/environment');var controller=require(_0x3cf7('0x8'));router[_0x3cf7('0x9')]('/',auth['isAuthenticated'](),controller[_0x3cf7('0xa')]);router[_0x3cf7('0x9')]('/:id',auth[_0x3cf7('0xb')](),controller['show']);router['post']('/',auth[_0x3cf7('0xb')](),controller[_0x3cf7('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x3cf7('0xd')]);router[_0x3cf7('0xe')]('/:id',auth[_0x3cf7('0xb')](),controller[_0x3cf7('0xf')]);module['exports']=router; \ No newline at end of file +var _0xe4ec=['show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','isAuthenticated','index','/:id'];(function(_0x18fb16,_0x45edbc){var _0x147b0d=function(_0x5b1b00){while(--_0x5b1b00){_0x18fb16['push'](_0x18fb16['shift']());}};_0x147b0d(++_0x45edbc);}(_0xe4ec,0x139));var _0xce4e=function(_0x3eec2f,_0x88fa8a){_0x3eec2f=_0x3eec2f-0x0;var _0x3fda72=_0xe4ec[_0x3eec2f];return _0x3fda72;};'use strict';var multer=require(_0xce4e('0x0'));var util=require(_0xce4e('0x1'));var path=require(_0xce4e('0x2'));var timeout=require(_0xce4e('0x3'));var express=require(_0xce4e('0x4'));var router=express[_0xce4e('0x5')]();var fs_extra=require(_0xce4e('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xce4e('0x7'));var config=require('../../config/environment');var controller=require('./intZohoField.controller');router['get']('/',auth[_0xce4e('0x8')](),controller[_0xce4e('0x9')]);router['get'](_0xce4e('0xa'),auth[_0xce4e('0x8')](),controller[_0xce4e('0xb')]);router[_0xce4e('0xc')]('/',auth[_0xce4e('0x8')](),controller[_0xce4e('0xd')]);router['put'](_0xce4e('0xa'),auth[_0xce4e('0x8')](),controller[_0xce4e('0xe')]);router[_0xce4e('0xf')](_0xce4e('0xa'),auth['isAuthenticated'](),controller[_0xce4e('0x10')]);module[_0xce4e('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index c5c21ab..9e87420 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 _0xf186=['STRING','BOOLEAN','sequelize','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x2595a0,_0x1f734e){var _0xa5821a=function(_0x55173b){while(--_0x55173b){_0x2595a0['push'](_0x2595a0['shift']());}};_0xa5821a(++_0x1f734e);}(_0xf186,0x1df));var _0x6f18=function(_0x365600,_0x566b90){_0x365600=_0x365600-0x0;var _0x56f128=_0xf186[_0x365600];return _0x56f128;};'use strict';var Sequelize=require(_0x6f18('0x0'));module['exports']={'type':{'type':Sequelize[_0x6f18('0x1')](_0x6f18('0x2'),_0x6f18('0x3'),_0x6f18('0x4'),_0x6f18('0x5'),_0x6f18('0x6')),'defaultValue':_0x6f18('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x6f18('0x7')]},'keyType':{'type':Sequelize[_0x6f18('0x1')](_0x6f18('0x2'),_0x6f18('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x6f18('0x7')]},'idField':{'type':Sequelize[_0x6f18('0x7')]},'nameField':{'type':Sequelize[_0x6f18('0x7')]},'customField':{'type':Sequelize[_0x6f18('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6f18('0x7')]}}; \ No newline at end of file +var _0x0d01=['customVariable','keyValue','STRING','string','variable','BOOLEAN','sequelize','ENUM'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0d01,0xae));var _0x10d0=function(_0x1679c7,_0x38dda1){_0x1679c7=_0x1679c7-0x0;var _0x43bb56=_0x0d01[_0x1679c7];return _0x43bb56;};'use strict';var Sequelize=require(_0x10d0('0x0'));module['exports']={'type':{'type':Sequelize[_0x10d0('0x1')]('string','variable',_0x10d0('0x2'),_0x10d0('0x3'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x10d0('0x4')]},'key':{'type':Sequelize[_0x10d0('0x4')]},'keyType':{'type':Sequelize[_0x10d0('0x1')](_0x10d0('0x5'),_0x10d0('0x6'),_0x10d0('0x2'))},'keyContent':{'type':Sequelize[_0x10d0('0x4')]},'idField':{'type':Sequelize[_0x10d0('0x4')]},'nameField':{'type':Sequelize[_0x10d0('0x4')]},'customField':{'type':Sequelize[_0x10d0('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 860a744..bb300fe 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 _0x13c9=['sort','where','pick','filter','merge','VIRTUAL','options','ZohoField','includeAll','include','findAll','rows','catch','params','find','create','body','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','order'];(function(_0x472c77,_0x2e49cc){var _0x122da1=function(_0x124f23){while(--_0x124f23){_0x472c77['push'](_0x472c77['shift']());}};_0x122da1(++_0x2e49cc);}(_0x13c9,0x1c1));var _0x913c=function(_0x5a9bc7,_0x2b6611){_0x5a9bc7=_0x5a9bc7-0x0;var _0x3d6dd9=_0x13c9[_0x5a9bc7];return _0x3d6dd9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x913c('0x0'));var zipdir=require(_0x913c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x913c('0x2'));var moment=require(_0x913c('0x3'));var BPromise=require(_0x913c('0x4'));var Mustache=require('mustache');var util=require(_0x913c('0x5'));var path=require(_0x913c('0x6'));var sox=require(_0x913c('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x913c('0x8'));var _=require('lodash');var squel=require(_0x913c('0x9'));var crypto=require(_0x913c('0xa'));var jsforce=require(_0x913c('0xb'));var deskjs=require(_0x913c('0xc'));var toCsv=require(_0x913c('0xd'));var querystring=require(_0x913c('0xe'));var Papa=require(_0x913c('0xf'));var Redis=require(_0x913c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x913c('0x11'));var as=require(_0x913c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x913c('0x13'))(_0x913c('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x913c('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53e215,_0x28f048){_0x28f048=_0x28f048||0xcc;return function(_0x1edfef){if(_0x1edfef){return _0x53e215[_0x913c('0x16')](_0x28f048);}return _0x53e215['status'](_0x28f048)[_0x913c('0x17')]();};}function respondWithResult(_0x292d24,_0x42d6ce){_0x42d6ce=_0x42d6ce||0xc8;return function(_0x294a7e){if(_0x294a7e){return _0x292d24[_0x913c('0x18')](_0x42d6ce)['json'](_0x294a7e);}};}function respondWithFilteredResult(_0x2b12fa,_0x5f4791){return function(_0x21e73c){if(_0x21e73c){var _0x488602=typeof _0x5f4791[_0x913c('0x19')]==='undefined'&&typeof _0x5f4791[_0x913c('0x1a')]===_0x913c('0x1b');var _0x380707=_0x21e73c[_0x913c('0x1c')];var _0x5f4aa5=_0x488602?0x0:_0x5f4791['offset'];var _0x4cca44=_0x488602?_0x21e73c[_0x913c('0x1c')]:_0x5f4791['offset']+_0x5f4791[_0x913c('0x1a')];var _0x4fa1e8;if(_0x4cca44>=_0x380707){_0x4cca44=_0x380707;_0x4fa1e8=0xc8;}else{_0x4fa1e8=0xce;}_0x2b12fa['status'](_0x4fa1e8);return _0x2b12fa[_0x913c('0x1d')](_0x913c('0x1e'),_0x5f4aa5+'-'+_0x4cca44+'/'+_0x380707)[_0x913c('0x1f')](_0x21e73c);}return null;};}function patchUpdates(_0x3218b7){return function(_0x54abf1){try{jsonpatch[_0x913c('0x20')](_0x54abf1,_0x3218b7,!![]);}catch(_0x17cbd2){return BPromise[_0x913c('0x21')](_0x17cbd2);}return _0x54abf1[_0x913c('0x22')]();};}function saveUpdates(_0x11ce83,_0x59ac77){return function(_0x101213){if(_0x101213){return _0x101213[_0x913c('0x23')](_0x11ce83)[_0x913c('0x24')](function(_0x31bea0){return _0x31bea0;});}return null;};}function removeEntity(_0xf81001,_0xcf4b43){return function(_0x51fa29){if(_0x51fa29){return _0x51fa29[_0x913c('0x25')]()['then'](function(){_0xf81001['status'](0xcc)[_0x913c('0x17')]();});}};}function handleEntityNotFound(_0x4bd3fa,_0x3eadc6){return function(_0x30c89a){if(!_0x30c89a){_0x4bd3fa[_0x913c('0x16')](0x194);}return _0x30c89a;};}function handleError(_0x44b586,_0x2093c0){_0x2093c0=_0x2093c0||0x1f4;return function(_0x5d1023){logger[_0x913c('0x26')](_0x5d1023['stack']);if(_0x5d1023[_0x913c('0x27')]){delete _0x5d1023[_0x913c('0x27')];}_0x44b586[_0x913c('0x18')](_0x2093c0)[_0x913c('0x28')](_0x5d1023);};}exports[_0x913c('0x29')]=function(_0x2a5af0,_0x53cd99){var _0x4e65b3={},_0xf06d83={},_0x312bf1={'count':0x0,'rows':[]};var _0x4efc8e=_[_0x913c('0x2a')](db['ZohoField'][_0x913c('0x2b')],function(_0x4f026a){return{'name':_0x4f026a['fieldName'],'type':_0x4f026a[_0x913c('0x2c')][_0x913c('0x2d')]};});_0xf06d83[_0x913c('0x2e')]=_[_0x913c('0x2a')](_0x4efc8e,_0x913c('0x27'));_0xf06d83[_0x913c('0x2f')]=_[_0x913c('0x30')](_0x2a5af0['query']);_0xf06d83[_0x913c('0x31')]=_[_0x913c('0x32')](_0xf06d83[_0x913c('0x2e')],_0xf06d83[_0x913c('0x2f')]);_0x4e65b3[_0x913c('0x33')]=_[_0x913c('0x32')](_0xf06d83[_0x913c('0x2e')],qs[_0x913c('0x34')](_0x2a5af0[_0x913c('0x2f')]['fields']));_0x4e65b3[_0x913c('0x33')]=_0x4e65b3[_0x913c('0x33')][_0x913c('0x35')]?_0x4e65b3[_0x913c('0x33')]:_0xf06d83[_0x913c('0x2e')];if(!_0x2a5af0[_0x913c('0x2f')]['hasOwnProperty']('nolimit')){_0x4e65b3['limit']=qs[_0x913c('0x1a')](_0x2a5af0[_0x913c('0x2f')]['limit']);_0x4e65b3[_0x913c('0x19')]=qs[_0x913c('0x19')](_0x2a5af0[_0x913c('0x2f')][_0x913c('0x19')]);}_0x4e65b3[_0x913c('0x36')]=qs[_0x913c('0x37')](_0x2a5af0['query']['sort']);_0x4e65b3[_0x913c('0x38')]=qs[_0x913c('0x31')](_[_0x913c('0x39')](_0x2a5af0[_0x913c('0x2f')],_0xf06d83[_0x913c('0x31')]),_0x4efc8e);if(_0x2a5af0[_0x913c('0x2f')][_0x913c('0x3a')]){_0x4e65b3[_0x913c('0x38')]=_[_0x913c('0x3b')](_0x4e65b3[_0x913c('0x38')],{'$or':_[_0x913c('0x2a')](_0x4efc8e,function(_0x3c4804){if(_0x3c4804[_0x913c('0x2c')]!==_0x913c('0x3c')){var _0x30085d={};_0x30085d[_0x3c4804[_0x913c('0x27')]]={'$like':'%'+_0x2a5af0['query'][_0x913c('0x3a')]+'%'};return _0x30085d;}})});}_0x4e65b3=_['merge']({},_0x4e65b3,_0x2a5af0[_0x913c('0x3d')]);var _0x2a92a3={'where':_0x4e65b3[_0x913c('0x38')]};return db[_0x913c('0x3e')]['count'](_0x2a92a3)['then'](function(_0x399fe0){_0x312bf1[_0x913c('0x1c')]=_0x399fe0;if(_0x2a5af0[_0x913c('0x2f')][_0x913c('0x3f')]){_0x4e65b3[_0x913c('0x40')]=[{'all':!![]}];}return db[_0x913c('0x3e')][_0x913c('0x41')](_0x4e65b3);})[_0x913c('0x24')](function(_0x389e72){_0x312bf1[_0x913c('0x42')]=_0x389e72;return _0x312bf1;})[_0x913c('0x24')](respondWithFilteredResult(_0x53cd99,_0x4e65b3))[_0x913c('0x43')](handleError(_0x53cd99,null));};exports['show']=function(_0x2938b1,_0x1ddcbb){var _0x428f2b={'raw':!![],'where':{'id':_0x2938b1[_0x913c('0x44')]['id']}},_0x430eff={};_0x430eff[_0x913c('0x2e')]=_[_0x913c('0x30')](db[_0x913c('0x3e')][_0x913c('0x2b')]);_0x430eff[_0x913c('0x2f')]=_[_0x913c('0x30')](_0x2938b1[_0x913c('0x2f')]);_0x430eff[_0x913c('0x31')]=_[_0x913c('0x32')](_0x430eff['model'],_0x430eff[_0x913c('0x2f')]);_0x428f2b[_0x913c('0x33')]=_['intersection'](_0x430eff[_0x913c('0x2e')],qs[_0x913c('0x34')](_0x2938b1['query'][_0x913c('0x34')]));_0x428f2b[_0x913c('0x33')]=_0x428f2b[_0x913c('0x33')][_0x913c('0x35')]?_0x428f2b[_0x913c('0x33')]:_0x430eff[_0x913c('0x2e')];if(_0x2938b1['query'][_0x913c('0x3f')]){_0x428f2b[_0x913c('0x40')]=[{'all':!![]}];}_0x428f2b=_[_0x913c('0x3b')]({},_0x428f2b,_0x2938b1[_0x913c('0x3d')]);return db[_0x913c('0x3e')][_0x913c('0x45')](_0x428f2b)[_0x913c('0x24')](handleEntityNotFound(_0x1ddcbb,null))[_0x913c('0x24')](respondWithResult(_0x1ddcbb,null))['catch'](handleError(_0x1ddcbb,null));};exports[_0x913c('0x46')]=function(_0xe8d785,_0x18b0bf){return db[_0x913c('0x3e')][_0x913c('0x46')](_0xe8d785[_0x913c('0x47')],{})[_0x913c('0x24')](respondWithResult(_0x18b0bf,0xc9))[_0x913c('0x43')](handleError(_0x18b0bf,null));};exports[_0x913c('0x23')]=function(_0x4492ea,_0x57dd8f){if(_0x4492ea[_0x913c('0x47')]['id']){delete _0x4492ea['body']['id'];}return db[_0x913c('0x3e')]['find']({'where':{'id':_0x4492ea['params']['id']}})[_0x913c('0x24')](handleEntityNotFound(_0x57dd8f,null))[_0x913c('0x24')](saveUpdates(_0x4492ea[_0x913c('0x47')],null))[_0x913c('0x24')](respondWithResult(_0x57dd8f,null))[_0x913c('0x43')](handleError(_0x57dd8f,null));};exports[_0x913c('0x25')]=function(_0x43e329,_0x2f616c){return db[_0x913c('0x3e')][_0x913c('0x45')]({'where':{'id':_0x43e329[_0x913c('0x44')]['id']}})[_0x913c('0x24')](handleEntityNotFound(_0x2f616c,null))[_0x913c('0x24')](removeEntity(_0x2f616c,null))['catch'](handleError(_0x2f616c,null));}; \ No newline at end of file +var _0xb528=['undefined','limit','count','set','json','apply','save','update','then','end','error','name','send','index','map','ZohoField','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','VIRTUAL','merge','includeAll','catch','show','include','options','find','create','body','params','destroy','eml-format','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/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','offset'];(function(_0x576de0,_0xd8c40b){var _0x624f4=function(_0x11b823){while(--_0x11b823){_0x576de0['push'](_0x576de0['shift']());}};_0x624f4(++_0xd8c40b);}(_0xb528,0x18e));var _0x8b52=function(_0x591609,_0x17f33a){_0x591609=_0x591609-0x0;var _0x18d5c5=_0xb528[_0x591609];return _0x18d5c5;};'use strict';var emlformat=require(_0x8b52('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8b52('0x1'));var jsonpatch=require(_0x8b52('0x2'));var rp=require('request-promise');var moment=require(_0x8b52('0x3'));var BPromise=require(_0x8b52('0x4'));var Mustache=require(_0x8b52('0x5'));var util=require(_0x8b52('0x6'));var path=require('path');var sox=require(_0x8b52('0x7'));var csv=require(_0x8b52('0x8'));var ejs=require(_0x8b52('0x9'));var fs=require('fs');var fs_extra=require(_0x8b52('0xa'));var _=require(_0x8b52('0xb'));var squel=require(_0x8b52('0xc'));var crypto=require('crypto');var jsforce=require(_0x8b52('0xd'));var deskjs=require(_0x8b52('0xe'));var toCsv=require(_0x8b52('0x8'));var querystring=require(_0x8b52('0xf'));var Papa=require(_0x8b52('0x10'));var Redis=require(_0x8b52('0x11'));var authService=require(_0x8b52('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x8b52('0x13'));var hardwareService=require(_0x8b52('0x14'));var logger=require(_0x8b52('0x15'))(_0x8b52('0x16'));var utils=require(_0x8b52('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x8b52('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xfa6f12,_0x258679){_0x258679=_0x258679||0xcc;return function(_0x14d0b4){if(_0x14d0b4){return _0xfa6f12[_0x8b52('0x19')](_0x258679);}return _0xfa6f12[_0x8b52('0x1a')](_0x258679)['end']();};}function respondWithResult(_0x58fdeb,_0x1b8af1){_0x1b8af1=_0x1b8af1||0xc8;return function(_0x5aa886){if(_0x5aa886){return _0x58fdeb['status'](_0x1b8af1)['json'](_0x5aa886);}};}function respondWithFilteredResult(_0x1bd2cf,_0x2c5eff){return function(_0x5145c2){if(_0x5145c2){var _0x387372=typeof _0x2c5eff[_0x8b52('0x1b')]===_0x8b52('0x1c')&&typeof _0x2c5eff[_0x8b52('0x1d')]==='undefined';var _0x360a56=_0x5145c2[_0x8b52('0x1e')];var _0x4cd77f=_0x387372?0x0:_0x2c5eff[_0x8b52('0x1b')];var _0x159100=_0x387372?_0x5145c2[_0x8b52('0x1e')]:_0x2c5eff[_0x8b52('0x1b')]+_0x2c5eff['limit'];var _0x46fdc0;if(_0x159100>=_0x360a56){_0x159100=_0x360a56;_0x46fdc0=0xc8;}else{_0x46fdc0=0xce;}_0x1bd2cf[_0x8b52('0x1a')](_0x46fdc0);return _0x1bd2cf[_0x8b52('0x1f')]('Content-Range',_0x4cd77f+'-'+_0x159100+'/'+_0x360a56)[_0x8b52('0x20')](_0x5145c2);}return null;};}function patchUpdates(_0x5ca8eb){return function(_0x3e16e3){try{jsonpatch[_0x8b52('0x21')](_0x3e16e3,_0x5ca8eb,!![]);}catch(_0x5082ef){return BPromise['reject'](_0x5082ef);}return _0x3e16e3[_0x8b52('0x22')]();};}function saveUpdates(_0x2014b0,_0x10e656){return function(_0x31f49f){if(_0x31f49f){return _0x31f49f[_0x8b52('0x23')](_0x2014b0)['then'](function(_0x29cf35){return _0x29cf35;});}return null;};}function removeEntity(_0x494aef,_0x2391be){return function(_0x36f902){if(_0x36f902){return _0x36f902['destroy']()[_0x8b52('0x24')](function(){_0x494aef[_0x8b52('0x1a')](0xcc)[_0x8b52('0x25')]();});}};}function handleEntityNotFound(_0x2a048a,_0x18ac61){return function(_0x422af6){if(!_0x422af6){_0x2a048a[_0x8b52('0x19')](0x194);}return _0x422af6;};}function handleError(_0x5a75ef,_0x19730e){_0x19730e=_0x19730e||0x1f4;return function(_0x45b58a){logger[_0x8b52('0x26')](_0x45b58a['stack']);if(_0x45b58a['name']){delete _0x45b58a[_0x8b52('0x27')];}_0x5a75ef['status'](_0x19730e)[_0x8b52('0x28')](_0x45b58a);};}exports[_0x8b52('0x29')]=function(_0x323964,_0x2b2874){var _0x1d3a8e={},_0xf3ccd5={},_0x5c8b11={'count':0x0,'rows':[]};var _0x16606e=_[_0x8b52('0x2a')](db[_0x8b52('0x2b')]['rawAttributes'],function(_0x5047e2){return{'name':_0x5047e2[_0x8b52('0x2c')],'type':_0x5047e2[_0x8b52('0x2d')]['key']};});_0xf3ccd5['model']=_['map'](_0x16606e,_0x8b52('0x27'));_0xf3ccd5[_0x8b52('0x2e')]=_[_0x8b52('0x2f')](_0x323964[_0x8b52('0x2e')]);_0xf3ccd5[_0x8b52('0x30')]=_[_0x8b52('0x31')](_0xf3ccd5[_0x8b52('0x32')],_0xf3ccd5[_0x8b52('0x2e')]);_0x1d3a8e[_0x8b52('0x33')]=_[_0x8b52('0x31')](_0xf3ccd5[_0x8b52('0x32')],qs['fields'](_0x323964[_0x8b52('0x2e')][_0x8b52('0x34')]));_0x1d3a8e[_0x8b52('0x33')]=_0x1d3a8e[_0x8b52('0x33')][_0x8b52('0x35')]?_0x1d3a8e[_0x8b52('0x33')]:_0xf3ccd5[_0x8b52('0x32')];if(!_0x323964[_0x8b52('0x2e')]['hasOwnProperty'](_0x8b52('0x36'))){_0x1d3a8e[_0x8b52('0x1d')]=qs['limit'](_0x323964[_0x8b52('0x2e')][_0x8b52('0x1d')]);_0x1d3a8e[_0x8b52('0x1b')]=qs[_0x8b52('0x1b')](_0x323964[_0x8b52('0x2e')][_0x8b52('0x1b')]);}_0x1d3a8e[_0x8b52('0x37')]=qs[_0x8b52('0x38')](_0x323964[_0x8b52('0x2e')][_0x8b52('0x38')]);_0x1d3a8e[_0x8b52('0x39')]=qs['filters'](_['pick'](_0x323964['query'],_0xf3ccd5['filters']),_0x16606e);if(_0x323964[_0x8b52('0x2e')][_0x8b52('0x3a')]){_0x1d3a8e['where']=_['merge'](_0x1d3a8e['where'],{'$or':_[_0x8b52('0x2a')](_0x16606e,function(_0x43e481){if(_0x43e481[_0x8b52('0x2d')]!==_0x8b52('0x3b')){var _0x19ff1e={};_0x19ff1e[_0x43e481[_0x8b52('0x27')]]={'$like':'%'+_0x323964[_0x8b52('0x2e')]['filter']+'%'};return _0x19ff1e;}})});}_0x1d3a8e=_[_0x8b52('0x3c')]({},_0x1d3a8e,_0x323964['options']);var _0x2b99d8={'where':_0x1d3a8e['where']};return db[_0x8b52('0x2b')]['count'](_0x2b99d8)[_0x8b52('0x24')](function(_0xa8adf8){_0x5c8b11['count']=_0xa8adf8;if(_0x323964[_0x8b52('0x2e')][_0x8b52('0x3d')]){_0x1d3a8e['include']=[{'all':!![]}];}return db[_0x8b52('0x2b')]['findAll'](_0x1d3a8e);})[_0x8b52('0x24')](function(_0x404901){_0x5c8b11['rows']=_0x404901;return _0x5c8b11;})[_0x8b52('0x24')](respondWithFilteredResult(_0x2b2874,_0x1d3a8e))[_0x8b52('0x3e')](handleError(_0x2b2874,null));};exports[_0x8b52('0x3f')]=function(_0x357055,_0x1e3467){var _0x4b504a={'raw':!![],'where':{'id':_0x357055['params']['id']}},_0x543d5e={};_0x543d5e[_0x8b52('0x32')]=_[_0x8b52('0x2f')](db[_0x8b52('0x2b')]['rawAttributes']);_0x543d5e[_0x8b52('0x2e')]=_[_0x8b52('0x2f')](_0x357055[_0x8b52('0x2e')]);_0x543d5e[_0x8b52('0x30')]=_[_0x8b52('0x31')](_0x543d5e[_0x8b52('0x32')],_0x543d5e[_0x8b52('0x2e')]);_0x4b504a[_0x8b52('0x33')]=_[_0x8b52('0x31')](_0x543d5e['model'],qs[_0x8b52('0x34')](_0x357055[_0x8b52('0x2e')][_0x8b52('0x34')]));_0x4b504a[_0x8b52('0x33')]=_0x4b504a[_0x8b52('0x33')]['length']?_0x4b504a[_0x8b52('0x33')]:_0x543d5e[_0x8b52('0x32')];if(_0x357055[_0x8b52('0x2e')]['includeAll']){_0x4b504a[_0x8b52('0x40')]=[{'all':!![]}];}_0x4b504a=_['merge']({},_0x4b504a,_0x357055[_0x8b52('0x41')]);return db['ZohoField'][_0x8b52('0x42')](_0x4b504a)['then'](handleEntityNotFound(_0x1e3467,null))['then'](respondWithResult(_0x1e3467,null))[_0x8b52('0x3e')](handleError(_0x1e3467,null));};exports[_0x8b52('0x43')]=function(_0x2006f1,_0xaae85b){return db[_0x8b52('0x2b')][_0x8b52('0x43')](_0x2006f1[_0x8b52('0x44')],{})[_0x8b52('0x24')](respondWithResult(_0xaae85b,0xc9))[_0x8b52('0x3e')](handleError(_0xaae85b,null));};exports[_0x8b52('0x23')]=function(_0x4f98dc,_0x40dfd3){if(_0x4f98dc[_0x8b52('0x44')]['id']){delete _0x4f98dc[_0x8b52('0x44')]['id'];}return db[_0x8b52('0x2b')][_0x8b52('0x42')]({'where':{'id':_0x4f98dc[_0x8b52('0x45')]['id']}})[_0x8b52('0x24')](handleEntityNotFound(_0x40dfd3,null))['then'](saveUpdates(_0x4f98dc[_0x8b52('0x44')],null))[_0x8b52('0x24')](respondWithResult(_0x40dfd3,null))[_0x8b52('0x3e')](handleError(_0x40dfd3,null));};exports[_0x8b52('0x46')]=function(_0xe431a5,_0x59733d){return db[_0x8b52('0x2b')][_0x8b52('0x42')]({'where':{'id':_0xe431a5[_0x8b52('0x45')]['id']}})[_0x8b52('0x24')](handleEntityNotFound(_0x59733d,null))['then'](removeEntity(_0x59733d,null))[_0x8b52('0x3e')](handleError(_0x59733d,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 008c050..29db1dc 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 _0xd117=['bluebird','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0x1d2d23,_0x3751a7){var _0x2e5d46=function(_0x29dbd0){while(--_0x29dbd0){_0x1d2d23['push'](_0x1d2d23['shift']());}};_0x2e5d46(++_0x3751a7);}(_0xd117,0x182));var _0x7d11=function(_0x27250c,_0x3e6637){_0x27250c=_0x27250c-0x0;var _0x7e3095=_0xd117[_0x27250c];return _0x7e3095;};'use strict';var _=require(_0x7d11('0x0'));var util=require(_0x7d11('0x1'));var logger=require(_0x7d11('0x2'))(_0x7d11('0x3'));var moment=require(_0x7d11('0x4'));var BPromise=require(_0x7d11('0x5'));var rp=require(_0x7d11('0x6'));var fs=require('fs');var path=require(_0x7d11('0x7'));var rimraf=require(_0x7d11('0x8'));var config=require(_0x7d11('0x9'));var attributes=require(_0x7d11('0xa'));module[_0x7d11('0xb')]=function(_0x27d7e8,_0x40c3c4){return _0x27d7e8[_0x7d11('0xc')](_0x7d11('0xd'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0x7d11('0xe'),'fields':[_0x7d11('0xf'),_0x7d11('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0120=['rimraf','../../config/environment','./intZohoField.attributes','exports','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x29c3a0,_0x32be87){var _0x430f8a=function(_0x4143d9){while(--_0x4143d9){_0x29c3a0['push'](_0x29c3a0['shift']());}};_0x430f8a(++_0x32be87);}(_0x0120,0x6f));var _0x0012=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x0120[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0012('0x0'));var util=require(_0x0012('0x1'));var logger=require(_0x0012('0x2'))(_0x0012('0x3'));var moment=require(_0x0012('0x4'));var BPromise=require(_0x0012('0x5'));var rp=require(_0x0012('0x6'));var fs=require('fs');var path=require(_0x0012('0x7'));var rimraf=require(_0x0012('0x8'));var config=require(_0x0012('0x9'));var attributes=require(_0x0012('0xa'));module[_0x0012('0xb')]=function(_0x4eaa5b,_0x4b396c){return _0x4eaa5b['define'](_0x0012('0xc'),attributes,{'tableName':_0x0012('0xd'),'paranoid':![],'indexes':[{'name':_0x0012('0xe'),'fields':[_0x0012('0xf'),_0x0012('0x10')],'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 8f6d2f0..84f24b9 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 _0xdf2a=['request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','ZohoField,\x20%s,\x20%s'];(function(_0x3a99f4,_0x2a81c1){var _0xea0b42=function(_0x41f533){while(--_0x41f533){_0x3a99f4['push'](_0x3a99f4['shift']());}};_0xea0b42(++_0x2a81c1);}(_0xdf2a,0x16e));var _0xadf2=function(_0x630d45,_0x1f2401){_0x630d45=_0x630d45-0x0;var _0x23b899=_0xdf2a[_0x630d45];return _0x23b899;};'use strict';var _=require('lodash');var util=require(_0xadf2('0x0'));var moment=require(_0xadf2('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xadf2('0x2'));var db=require(_0xadf2('0x3'))['db'];var utils=require(_0xadf2('0x4'));var logger=require('../../config/logger')(_0xadf2('0x5'));var config=require(_0xadf2('0x6'));var jayson=require(_0xadf2('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5ac36,_0x50c825,_0x3eb09f){return new BPromise(function(_0x34b91c,_0x4f3e32){return client[_0xadf2('0x8')](_0x5ac36,_0x3eb09f)[_0xadf2('0x9')](function(_0x1dc804){logger[_0xadf2('0xa')](_0xadf2('0xb'),_0x50c825,_0xadf2('0xc'));logger[_0xadf2('0xd')](_0xadf2('0xe'),_0x50c825,_0xadf2('0xc'),JSON[_0xadf2('0xf')](_0x1dc804));if(_0x1dc804[_0xadf2('0x10')]){if(_0x1dc804[_0xadf2('0x10')][_0xadf2('0x11')]===0x1f4){logger[_0xadf2('0x10')]('ZohoField,\x20%s,\x20%s',_0x50c825,_0x1dc804[_0xadf2('0x10')]['message']);return _0x4f3e32(_0x1dc804['error']['message']);}logger[_0xadf2('0x10')](_0xadf2('0xb'),_0x50c825,_0x1dc804[_0xadf2('0x10')]['message']);return _0x34b91c(_0x1dc804[_0xadf2('0x10')][_0xadf2('0x12')]);}else{logger[_0xadf2('0xa')]('ZohoField,\x20%s,\x20%s',_0x50c825,'request\x20sent');_0x34b91c(_0x1dc804[_0xadf2('0x13')]['message']);}})[_0xadf2('0x14')](function(_0x5e171f){logger[_0xadf2('0x10')](_0xadf2('0xb'),_0x50c825,_0x5e171f);_0x4f3e32(_0x5e171f);});});} \ No newline at end of file +var _0x26b7=['info','request\x20sent','error','code','message','ZohoField,\x20%s,\x20%s','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then'];(function(_0x4f6172,_0x5daca2){var _0x1252c1=function(_0x1f8ff2){while(--_0x1f8ff2){_0x4f6172['push'](_0x4f6172['shift']());}};_0x1252c1(++_0x5daca2);}(_0x26b7,0x133));var _0x726b=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x26b7[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0x726b('0x0'));var util=require('util');var moment=require(_0x726b('0x1'));var BPromise=require(_0x726b('0x2'));var rs=require(_0x726b('0x3'));var fs=require('fs');var Redis=require(_0x726b('0x4'));var db=require(_0x726b('0x5'))['db'];var utils=require(_0x726b('0x6'));var logger=require(_0x726b('0x7'))(_0x726b('0x8'));var config=require(_0x726b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x726b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e0080,_0x1f5f6d,_0xdb88e6){return new BPromise(function(_0x190ab7,_0x582a64){return client[_0x726b('0xb')](_0x5e0080,_0xdb88e6)[_0x726b('0xc')](function(_0x4a21df){logger[_0x726b('0xd')]('ZohoField,\x20%s,\x20%s',_0x1f5f6d,'request\x20sent');logger['debug']('ZohoField,\x20%s,\x20%s,\x20%s',_0x1f5f6d,_0x726b('0xe'),JSON['stringify'](_0x4a21df));if(_0x4a21df[_0x726b('0xf')]){if(_0x4a21df[_0x726b('0xf')][_0x726b('0x10')]===0x1f4){logger[_0x726b('0xf')]('ZohoField,\x20%s,\x20%s',_0x1f5f6d,_0x4a21df[_0x726b('0xf')]['message']);return _0x582a64(_0x4a21df[_0x726b('0xf')][_0x726b('0x11')]);}logger[_0x726b('0xf')](_0x726b('0x12'),_0x1f5f6d,_0x4a21df[_0x726b('0xf')]['message']);return _0x190ab7(_0x4a21df[_0x726b('0xf')][_0x726b('0x11')]);}else{logger[_0x726b('0xd')](_0x726b('0x12'),_0x1f5f6d,_0x726b('0xe'));_0x190ab7(_0x4a21df['result']['message']);}})[_0x726b('0x13')](function(_0x258f5b){logger[_0x726b('0xf')](_0x726b('0x12'),_0x1f5f6d,_0x258f5b);_0x582a64(_0x258f5b);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 561e7af..4e98acb 100644 --- a/server/api/integration/index.js +++ b/server/api/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x24d0a2,_0x3d3ff3){var _0x10e950=function(_0xff96e2){while(--_0xff96e2){_0x24d0a2['push'](_0x24d0a2['shift']());}};_0x10e950(++_0x3d3ff3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x1c6397,_0x5d82db){var _0x42d2ea=function(_0x455759){while(--_0x455759){_0x1c6397['push'](_0x1c6397['shift']());}};_0x42d2ea(++_0x5d82db);}(_0xedd9,0xfc));var _0x9edd=function(_0x7e9167,_0x27917a){_0x7e9167=_0x7e9167-0x0;var _0x42160d=_0xedd9[_0x7e9167];return _0x42160d;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 41b1808..041258d 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 _0x2be1=['STRING','unique_name_and_version','app.js','INTEGER','BOOLEAN','state','sequelize','exports'];(function(_0x5dfd74,_0x27247f){var _0x351a61=function(_0x1da21b){while(--_0x1da21b){_0x5dfd74['push'](_0x5dfd74['shift']());}};_0x351a61(++_0x27247f);}(_0x2be1,0x196));var _0x12be=function(_0x27c3f0,_0x198aa2){_0x27c3f0=_0x27c3f0-0x0;var _0x11e51c=_0x2be1[_0x27c3f0];return _0x11e51c;};'use strict';var Sequelize=require(_0x12be('0x0'));module[_0x12be('0x1')]={'name':{'type':Sequelize[_0x12be('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x12be('0x3')},'main':{'type':Sequelize[_0x12be('0x2')],'defaultValue':_0x12be('0x4')},'filename':{'type':Sequelize[_0x12be('0x2')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x12be('0x2')]},'size':{'type':Sequelize[_0x12be('0x5')]},'active':{'type':Sequelize[_0x12be('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0x12be('0x2')]},'logo':{'type':Sequelize[_0x12be('0x2')]},'state':{'type':Sequelize[_0x12be('0x2')],'unique':_0x12be('0x7')},'description':{'type':Sequelize[_0x12be('0x2')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x12be('0x2')]},'link':{'type':Sequelize[_0x12be('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0x93b5=['STRING','unique_name_and_version','app.js','BOOLEAN','state','sequelize','exports'];(function(_0x36704c,_0x465f0d){var _0x4afa4d=function(_0x364166){while(--_0x364166){_0x36704c['push'](_0x36704c['shift']());}};_0x4afa4d(++_0x465f0d);}(_0x93b5,0x178));var _0x593b=function(_0x1309c8,_0x399bb7){_0x1309c8=_0x1309c8-0x0;var _0x206711=_0x93b5[_0x1309c8];return _0x206711;};'use strict';var Sequelize=require(_0x593b('0x0'));module[_0x593b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x593b('0x2')],'allowNull':![],'unique':_0x593b('0x3')},'main':{'type':Sequelize[_0x593b('0x2')],'defaultValue':_0x593b('0x4')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x593b('0x2')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x593b('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x593b('0x2')]},'logo':{'type':Sequelize[_0x593b('0x2')]},'state':{'type':Sequelize[_0x593b('0x2')],'unique':_0x593b('0x6')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x593b('0x2')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 56ce974..7628e89 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 _0x57ca=['bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','end','sendStatus','error','stack','name','index','map','Integration','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','findAll','params','find','catch','create','body','rimraf','zip-dir','request-promise','moment'];(function(_0x348e7d,_0x17c567){var _0x25ef1d=function(_0x2596a1){while(--_0x2596a1){_0x348e7d['push'](_0x348e7d['shift']());}};_0x25ef1d(++_0x17c567);}(_0x57ca,0x108));var _0xa57c=function(_0x154749,_0x4a64f6){_0x154749=_0x154749-0x0;var _0x17ed14=_0x57ca[_0x154749];return _0x17ed14;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa57c('0x0'));var zipdir=require(_0xa57c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa57c('0x2'));var moment=require(_0xa57c('0x3'));var BPromise=require(_0xa57c('0x4'));var Mustache=require(_0xa57c('0x5'));var util=require(_0xa57c('0x6'));var path=require('path');var sox=require(_0xa57c('0x7'));var csv=require(_0xa57c('0x8'));var ejs=require(_0xa57c('0x9'));var fs=require('fs');var fs_extra=require(_0xa57c('0xa'));var _=require(_0xa57c('0xb'));var squel=require(_0xa57c('0xc'));var crypto=require(_0xa57c('0xd'));var jsforce=require(_0xa57c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa57c('0x8'));var querystring=require('querystring');var Papa=require(_0xa57c('0xf'));var Redis=require(_0xa57c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa57c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa57c('0x12'));var logger=require(_0xa57c('0x13'))('api');var utils=require(_0xa57c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa57c('0x15'));var db=require(_0xa57c('0x16'))['db'];function respondWithStatusCode(_0x1f2bb5,_0x9e25bf){_0x9e25bf=_0x9e25bf||0xcc;return function(_0x205e72){if(_0x205e72){return _0x1f2bb5['sendStatus'](_0x9e25bf);}return _0x1f2bb5[_0xa57c('0x17')](_0x9e25bf)['end']();};}function respondWithResult(_0x30d23d,_0x3d5995){_0x3d5995=_0x3d5995||0xc8;return function(_0x30940d){if(_0x30940d){return _0x30d23d[_0xa57c('0x17')](_0x3d5995)[_0xa57c('0x18')](_0x30940d);}};}function respondWithFilteredResult(_0x37a323,_0x3f900a){return function(_0x4b4bdb){if(_0x4b4bdb){var _0x26607a=typeof _0x3f900a[_0xa57c('0x19')]===_0xa57c('0x1a')&&typeof _0x3f900a['limit']===_0xa57c('0x1a');var _0x5f33f1=_0x4b4bdb[_0xa57c('0x1b')];var _0x3d781d=_0x26607a?0x0:_0x3f900a[_0xa57c('0x19')];var _0xe3d505=_0x26607a?_0x4b4bdb[_0xa57c('0x1b')]:_0x3f900a[_0xa57c('0x19')]+_0x3f900a[_0xa57c('0x1c')];var _0x595c7a;if(_0xe3d505>=_0x5f33f1){_0xe3d505=_0x5f33f1;_0x595c7a=0xc8;}else{_0x595c7a=0xce;}_0x37a323['status'](_0x595c7a);return _0x37a323[_0xa57c('0x1d')]('Content-Range',_0x3d781d+'-'+_0xe3d505+'/'+_0x5f33f1)['json'](_0x4b4bdb);}return null;};}function patchUpdates(_0x418415){return function(_0xa5b314){try{jsonpatch[_0xa57c('0x1e')](_0xa5b314,_0x418415,!![]);}catch(_0x23bec0){return BPromise['reject'](_0x23bec0);}return _0xa5b314[_0xa57c('0x1f')]();};}function saveUpdates(_0x25715f,_0x34d1bc){return function(_0x2213b2){if(_0x2213b2){return _0x2213b2[_0xa57c('0x20')](_0x25715f)[_0xa57c('0x21')](function(_0x1e0192){return _0x1e0192;});}return null;};}function removeEntity(_0x42038e,_0x2e99ed){return function(_0xdf65dd){if(_0xdf65dd){return _0xdf65dd[_0xa57c('0x22')]()[_0xa57c('0x21')](function(){_0x42038e[_0xa57c('0x17')](0xcc)[_0xa57c('0x23')]();});}};}function handleEntityNotFound(_0x431bec,_0x511a26){return function(_0x2db443){if(!_0x2db443){_0x431bec[_0xa57c('0x24')](0x194);}return _0x2db443;};}function handleError(_0x27884d,_0x5228b9){_0x5228b9=_0x5228b9||0x1f4;return function(_0x315ad7){logger[_0xa57c('0x25')](_0x315ad7[_0xa57c('0x26')]);if(_0x315ad7[_0xa57c('0x27')]){delete _0x315ad7[_0xa57c('0x27')];}_0x27884d[_0xa57c('0x17')](_0x5228b9)['send'](_0x315ad7);};}exports[_0xa57c('0x28')]=function(_0x4c1478,_0x54a18b){var _0x257661={},_0x7d10ec={},_0x5a3e03={'count':0x0,'rows':[]};var _0x12898b=_[_0xa57c('0x29')](db[_0xa57c('0x2a')]['rawAttributes'],function(_0xd779f1){return{'name':_0xd779f1['fieldName'],'type':_0xd779f1[_0xa57c('0x2b')]['key']};});_0x7d10ec[_0xa57c('0x2c')]=_['map'](_0x12898b,_0xa57c('0x27'));_0x7d10ec['query']=_[_0xa57c('0x2d')](_0x4c1478[_0xa57c('0x2e')]);_0x7d10ec[_0xa57c('0x2f')]=_[_0xa57c('0x30')](_0x7d10ec[_0xa57c('0x2c')],_0x7d10ec[_0xa57c('0x2e')]);_0x257661[_0xa57c('0x31')]=_['intersection'](_0x7d10ec[_0xa57c('0x2c')],qs['fields'](_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x32')]));_0x257661[_0xa57c('0x31')]=_0x257661['attributes'][_0xa57c('0x33')]?_0x257661['attributes']:_0x7d10ec[_0xa57c('0x2c')];if(!_0x4c1478['query'][_0xa57c('0x34')]('nolimit')){_0x257661[_0xa57c('0x1c')]=qs[_0xa57c('0x1c')](_0x4c1478['query'][_0xa57c('0x1c')]);_0x257661['offset']=qs[_0xa57c('0x19')](_0x4c1478['query'][_0xa57c('0x19')]);}_0x257661[_0xa57c('0x35')]=qs[_0xa57c('0x36')](_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x36')]);_0x257661[_0xa57c('0x37')]=qs['filters'](_['pick'](_0x4c1478[_0xa57c('0x2e')],_0x7d10ec[_0xa57c('0x2f')]),_0x12898b);if(_0x4c1478[_0xa57c('0x2e')]['filter']){_0x257661[_0xa57c('0x37')]=_['merge'](_0x257661[_0xa57c('0x37')],{'$or':_[_0xa57c('0x29')](_0x12898b,function(_0x5c8256){if(_0x5c8256['type']!=='VIRTUAL'){var _0x3be888={};_0x3be888[_0x5c8256[_0xa57c('0x27')]]={'$like':'%'+_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x38')]+'%'};return _0x3be888;}})});}_0x257661=_[_0xa57c('0x39')]({},_0x257661,_0x4c1478[_0xa57c('0x3a')]);var _0x5a444a={'where':_0x257661[_0xa57c('0x37')]};return db[_0xa57c('0x2a')]['count'](_0x5a444a)['then'](function(_0x5e10b){_0x5a3e03[_0xa57c('0x1b')]=_0x5e10b;if(_0x4c1478['query'][_0xa57c('0x3b')]){_0x257661[_0xa57c('0x3c')]=[{'all':!![]}];}return db[_0xa57c('0x2a')][_0xa57c('0x3d')](_0x257661);})[_0xa57c('0x21')](function(_0x43c1d7){_0x5a3e03['rows']=_0x43c1d7;return _0x5a3e03;})[_0xa57c('0x21')](respondWithFilteredResult(_0x54a18b,_0x257661))['catch'](handleError(_0x54a18b,null));};exports['show']=function(_0x5b3300,_0x520383){var _0x588199={'raw':![],'where':{'id':_0x5b3300[_0xa57c('0x3e')]['id']}},_0x39b20f={};_0x39b20f[_0xa57c('0x2c')]=_['keys'](db['Integration']['rawAttributes']);_0x39b20f[_0xa57c('0x2e')]=_[_0xa57c('0x2d')](_0x5b3300[_0xa57c('0x2e')]);_0x39b20f[_0xa57c('0x2f')]=_[_0xa57c('0x30')](_0x39b20f[_0xa57c('0x2c')],_0x39b20f['query']);_0x588199[_0xa57c('0x31')]=_[_0xa57c('0x30')](_0x39b20f[_0xa57c('0x2c')],qs[_0xa57c('0x32')](_0x5b3300[_0xa57c('0x2e')][_0xa57c('0x32')]));_0x588199['attributes']=_0x588199[_0xa57c('0x31')][_0xa57c('0x33')]?_0x588199[_0xa57c('0x31')]:_0x39b20f[_0xa57c('0x2c')];if(_0x5b3300[_0xa57c('0x2e')]['includeAll']){_0x588199[_0xa57c('0x3c')]=[{'all':!![]}];}_0x588199=_[_0xa57c('0x39')]({},_0x588199,_0x5b3300[_0xa57c('0x3a')]);return db[_0xa57c('0x2a')][_0xa57c('0x3f')](_0x588199)[_0xa57c('0x21')](handleEntityNotFound(_0x520383,null))['then'](respondWithResult(_0x520383,null))[_0xa57c('0x40')](handleError(_0x520383,null));};exports[_0xa57c('0x41')]=function(_0x247906,_0x44ea0a){return db[_0xa57c('0x2a')][_0xa57c('0x41')](_0x247906['body'],{})['then'](respondWithResult(_0x44ea0a,0xc9))['catch'](handleError(_0x44ea0a,null));};exports['update']=function(_0x232675,_0x49492f){if(_0x232675[_0xa57c('0x42')]['id']){delete _0x232675[_0xa57c('0x42')]['id'];}return db['Integration'][_0xa57c('0x3f')]({'where':{'id':_0x232675[_0xa57c('0x3e')]['id']}})[_0xa57c('0x21')](handleEntityNotFound(_0x49492f,null))[_0xa57c('0x21')](saveUpdates(_0x232675[_0xa57c('0x42')],null))['then'](respondWithResult(_0x49492f,null))[_0xa57c('0x40')](handleError(_0x49492f,null));};exports[_0xa57c('0x22')]=function(_0x4584e8,_0xd57bac){return db[_0xa57c('0x2a')]['find']({'where':{'id':_0x4584e8[_0xa57c('0x3e')]['id']}})['then'](handleEntityNotFound(_0xd57bac,null))['then'](removeEntity(_0xd57bac,null))[_0xa57c('0x40')](handleError(_0xd57bac,null));}; \ No newline at end of file +var _0x6d38=['sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','keys','filters','intersection','create','catch','body','find','params','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','Integration','rawAttributes','type','key','model','query','attributes','fields','length','hasOwnProperty','order'];(function(_0x3fb2d4,_0x44a3a8){var _0x4cfd9a=function(_0x35f723){while(--_0x35f723){_0x3fb2d4['push'](_0x3fb2d4['shift']());}};_0x4cfd9a(++_0x44a3a8);}(_0x6d38,0x1ef));var _0x86d3=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x6d38[_0x3ab9ee];return _0x82ee88;};'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['Integration'][_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')](_0x412d0e['body'],{})[_0x86d3('0x20')](respondWithResult(_0xd20863,0xc9))[_0x86d3('0x40')](handleError(_0xd20863,null));};exports[_0x86d3('0x1f')]=function(_0x14fa58,_0x369b75){if(_0x14fa58[_0x86d3('0x41')]['id']){delete _0x14fa58[_0x86d3('0x41')]['id'];}return db[_0x86d3('0x26')][_0x86d3('0x42')]({'where':{'id':_0x14fa58[_0x86d3('0x43')]['id']}})[_0x86d3('0x20')](handleEntityNotFound(_0x369b75,null))[_0x86d3('0x20')](saveUpdates(_0x14fa58['body'],null))[_0x86d3('0x20')](respondWithResult(_0x369b75,null))[_0x86d3('0x40')](handleError(_0x369b75,null));};exports['destroy']=function(_0x43290d,_0x23a6ee){return db[_0x86d3('0x26')][_0x86d3('0x42')]({'where':{'id':_0x43290d[_0x86d3('0x43')]['id']}})[_0x86d3('0x20')](handleEntityNotFound(_0x23a6ee,null))['then'](removeEntity(_0x23a6ee,null))['catch'](handleError(_0x23a6ee,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index d674140..bc9e93d 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 _0xe842=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Integration','integrations','lodash','util','../../config/logger','api'];(function(_0x486986,_0x366cd2){var _0x3ed0c0=function(_0x4bad4b){while(--_0x4bad4b){_0x486986['push'](_0x486986['shift']());}};_0x3ed0c0(++_0x366cd2);}(_0xe842,0xce));var _0x2e84=function(_0x3144b3,_0x45f961){_0x3144b3=_0x3144b3-0x0;var _0x2517a9=_0xe842[_0x3144b3];return _0x2517a9;};'use strict';var _=require(_0x2e84('0x0'));var util=require(_0x2e84('0x1'));var logger=require(_0x2e84('0x2'))(_0x2e84('0x3'));var moment=require(_0x2e84('0x4'));var BPromise=require(_0x2e84('0x5'));var rp=require(_0x2e84('0x6'));var fs=require('fs');var path=require(_0x2e84('0x7'));var rimraf=require(_0x2e84('0x8'));var config=require(_0x2e84('0x9'));var attributes=require('./integration.attributes');module[_0x2e84('0xa')]=function(_0x508cde,_0x36a3cc){return _0x508cde[_0x2e84('0xb')](_0x2e84('0xc'),attributes,{'tableName':_0x2e84('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8310=['./integration.attributes','exports','define','integrations','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x2a4a9d,_0x1f6a3f){var _0x2c7879=function(_0x3b6fa6){while(--_0x3b6fa6){_0x2a4a9d['push'](_0x2a4a9d['shift']());}};_0x2c7879(++_0x1f6a3f);}(_0x8310,0x143));var _0x0831=function(_0x4a45b4,_0x59804f){_0x4a45b4=_0x4a45b4-0x0;var _0x1a99c9=_0x8310[_0x4a45b4];return _0x1a99c9;};'use strict';var _=require(_0x0831('0x0'));var util=require(_0x0831('0x1'));var logger=require(_0x0831('0x2'))('api');var moment=require(_0x0831('0x3'));var BPromise=require(_0x0831('0x4'));var rp=require(_0x0831('0x5'));var fs=require('fs');var path=require(_0x0831('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0831('0x7'));module[_0x0831('0x8')]=function(_0x37a315,_0x4e6a21){return _0x37a315[_0x0831('0x9')]('Integration',attributes,{'tableName':_0x0831('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 2258c53..9790794 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 _0x896e=['Integration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x2dda4d,_0x46d702){var _0x4580f4=function(_0x2c1989){while(--_0x2c1989){_0x2dda4d['push'](_0x2dda4d['shift']());}};_0x4580f4(++_0x46d702);}(_0x896e,0x1e9));var _0xe896=function(_0x4fcdcc,_0xd90c11){_0x4fcdcc=_0x4fcdcc-0x0;var _0x3f60c4=_0x896e[_0x4fcdcc];return _0x3f60c4;};'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')]('Integration,\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')]('Integration,\x20%s,\x20%s',_0x3b902c,_0x57f04b);_0x5a1909(_0x57f04b);});});} \ No newline at end of file +var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x1eb402,_0x164f02){var _0x577f76=function(_0x10efd0){while(--_0x10efd0){_0x1eb402['push'](_0x1eb402['shift']());}};_0x577f76(++_0x164f02);}(_0xadb5,0xad));var _0x5adb=function(_0x35c9e6,_0x23245f){_0x35c9e6=_0x35c9e6-0x0;var _0x5d1509=_0xadb5[_0x35c9e6];return _0x5d1509;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('Integration,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index f75d0b8..5fb1b46 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 _0x2542=['put','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post'];(function(_0x51b851,_0x5d059b){var _0x4f8362=function(_0x2ded43){while(--_0x2ded43){_0x51b851['push'](_0x51b851['shift']());}};_0x4f8362(++_0x5d059b);}(_0x2542,0x169));var _0x2254=function(_0x1583e0,_0x9eed2e){_0x1583e0=_0x1583e0-0x0;var _0x3ccde5=_0x2542[_0x1583e0];return _0x3ccde5;};'use strict';var multer=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var path=require(_0x2254('0x2'));var timeout=require(_0x2254('0x3'));var express=require('express');var router=express[_0x2254('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2254('0x5'));var interaction=require(_0x2254('0x6'));var config=require(_0x2254('0x7'));var controller=require(_0x2254('0x8'));router[_0x2254('0x9')]('/',auth['isAuthenticated'](),controller[_0x2254('0xa')]);router[_0x2254('0x9')](_0x2254('0xb'),auth[_0x2254('0xc')](),controller[_0x2254('0xd')]);router[_0x2254('0x9')](_0x2254('0xe'),auth[_0x2254('0xc')](),controller[_0x2254('0xf')]);router[_0x2254('0x10')]('/',auth[_0x2254('0xc')](),controller['create']);router[_0x2254('0x11')](_0x2254('0xe'),auth[_0x2254('0xc')](),controller[_0x2254('0x12')]);router['delete']('/:id',auth[_0x2254('0xc')](),controller[_0x2254('0x13')]);module[_0x2254('0x14')]=router; \ No newline at end of file +var _0xadb5=['delete','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update'];(function(_0x55b460,_0x497077){var _0x3ac537=function(_0xd709b3){while(--_0xd709b3){_0x55b460['push'](_0x55b460['shift']());}};_0x3ac537(++_0x497077);}(_0xadb5,0xad));var _0x5adb=function(_0x2588bb,_0x30f9eb){_0x2588bb=_0x2588bb-0x0;var _0x172704=_0xadb5[_0x2588bb];return _0x172704;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./integrationReport.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0xf')]);router['put']('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller['destroy']);module[_0x5adb('0x12')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 1f7dec1..6bec6ec 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 _0x5bf5=['INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED','sequelize','STRING'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x5bf5,0x17f));var _0x55bf=function(_0x3c93fe,_0x216ea7){_0x3c93fe=_0x3c93fe-0x0;var _0xdb6c4a=_0x5bf5[_0x3c93fe];return _0xdb6c4a;};'use strict';var Sequelize=require(_0x55bf('0x0'));module['exports']={'integration':{'type':Sequelize[_0x55bf('0x1')]},'eventChannel':{'type':Sequelize[_0x55bf('0x1')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x55bf('0x2')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x55bf('0x1')]},'calleridname':{'type':Sequelize[_0x55bf('0x1')]},'queue':{'type':Sequelize[_0x55bf('0x1')]},'interface':{'type':Sequelize[_0x55bf('0x1')]},'membername':{'type':Sequelize[_0x55bf('0x1')]},'agentcalledAt':{'type':Sequelize[_0x55bf('0x3')]},'agentconnectAt':{'type':Sequelize[_0x55bf('0x3')]},'holdtime':{'type':Sequelize[_0x55bf('0x2')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0x55bf('0x2')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x55bf('0x2')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0x55bf('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x55bf('0x3')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x55bf('0x3')]},'lastevent':{'type':Sequelize[_0x55bf('0x1')]},'channel':{'type':Sequelize[_0x55bf('0x1')]},'channelstate':{'type':Sequelize[_0x55bf('0x2')]},'channelstatedesc':{'type':Sequelize[_0x55bf('0x1')]},'connectedlinenum':{'type':Sequelize[_0x55bf('0x1')]},'connectedlinename':{'type':Sequelize[_0x55bf('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x55bf('0x1')]},'context':{'type':Sequelize[_0x55bf('0x1')]},'exten':{'type':Sequelize[_0x55bf('0x1')]},'priority':{'type':Sequelize[_0x55bf('0x1')]},'destchannel':{'type':Sequelize[_0x55bf('0x1')]},'destchannelstate':{'type':Sequelize[_0x55bf('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x55bf('0x1')]},'destcalleridnum':{'type':Sequelize[_0x55bf('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x55bf('0x1')]},'destlanguage':{'type':Sequelize[_0x55bf('0x1')]},'destaccountcode':{'type':Sequelize[_0x55bf('0x1')]},'destcontext':{'type':Sequelize[_0x55bf('0x1')]},'destexten':{'type':Sequelize[_0x55bf('0x1')]},'destpriority':{'type':Sequelize[_0x55bf('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x55bf('0x1')]},'subject':{'type':Sequelize[_0x55bf('0x1')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x55bf('0x1')]},'cc':{'type':Sequelize[_0x55bf('0x1')]},'attachment':{'type':Sequelize[_0x55bf('0x5')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x55bf('0x5')]},'status':{'type':Sequelize[_0x55bf('0x6')](_0x55bf('0x7'),_0x55bf('0x8'),_0x55bf('0x9'),_0x55bf('0xa'))},'url':{'type':Sequelize[_0x55bf('0x1')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0x55bf('0x2')]}}; \ No newline at end of file +var _0x43a1=['sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','SENT','SENDING','RECEIVED','FAILED'];(function(_0x5dfc2a,_0x1a953f){var _0x3f1a71=function(_0x15916){while(--_0x15916){_0x5dfc2a['push'](_0x5dfc2a['shift']());}};_0x3f1a71(++_0x1a953f);}(_0x43a1,0xbb));var _0x143a=function(_0x38ccfa,_0x2704fc){_0x38ccfa=_0x38ccfa-0x0;var _0x5bf386=_0x43a1[_0x38ccfa];return _0x5bf386;};'use strict';var Sequelize=require(_0x143a('0x0'));module[_0x143a('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x143a('0x2')]},'ticketId':{'type':Sequelize[_0x143a('0x2')]},'integrationId':{'type':Sequelize[_0x143a('0x3')]},'contacts':{'type':Sequelize[_0x143a('0x2')]},'uniqueid':{'type':Sequelize[_0x143a('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x143a('0x2')]},'queue':{'type':Sequelize[_0x143a('0x2')]},'interface':{'type':Sequelize[_0x143a('0x2')]},'membername':{'type':Sequelize[_0x143a('0x2')]},'agentcalledAt':{'type':Sequelize[_0x143a('0x4')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x143a('0x3')]},'agentcomplete':{'type':Sequelize[_0x143a('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x143a('0x4')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x143a('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x143a('0x2')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x143a('0x4')]},'agentdump':{'type':Sequelize[_0x143a('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x143a('0x3')]},'channelstatedesc':{'type':Sequelize[_0x143a('0x2')]},'connectedlinenum':{'type':Sequelize[_0x143a('0x2')]},'connectedlinename':{'type':Sequelize[_0x143a('0x2')]},'language':{'type':Sequelize[_0x143a('0x2')]},'accountcode':{'type':Sequelize[_0x143a('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x143a('0x2')]},'priority':{'type':Sequelize[_0x143a('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x143a('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x143a('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x143a('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x143a('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x143a('0x2')]},'destlanguage':{'type':Sequelize[_0x143a('0x2')]},'destaccountcode':{'type':Sequelize[_0x143a('0x2')]},'destcontext':{'type':Sequelize[_0x143a('0x2')]},'destexten':{'type':Sequelize[_0x143a('0x2')]},'destpriority':{'type':Sequelize[_0x143a('0x2')]},'destuniqueid':{'type':Sequelize[_0x143a('0x2')]},'messageId':{'type':Sequelize[_0x143a('0x2')]},'inReplyTo':{'type':Sequelize[_0x143a('0x2')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x143a('0x2')]},'cc':{'type':Sequelize[_0x143a('0x2')]},'attachment':{'type':Sequelize[_0x143a('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x143a('0x6')]},'status':{'type':Sequelize['ENUM'](_0x143a('0x7'),_0x143a('0x8'),_0x143a('0x9'),_0x143a('0xa'))},'url':{'type':Sequelize[_0x143a('0x2')]},'app':{'type':Sequelize[_0x143a('0x2')]},'appdata':{'type':Sequelize[_0x143a('0x2')]},'projectId':{'type':Sequelize[_0x143a('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index a6d01e5..6185ae4 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 _0x0dde=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','error','send','index','map','IntegrationReport','rawAttributes','fieldName','model','name','query','keys','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','catch','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0xf5314d,_0x4ee827){var _0x7a0979=function(_0x44f913){while(--_0x44f913){_0xf5314d['push'](_0xf5314d['shift']());}};_0x7a0979(++_0x4ee827);}(_0x0dde,0xc5));var _0xe0dd=function(_0x53cc66,_0x5162fc){_0x53cc66=_0x53cc66-0x0;var _0x6effae=_0x0dde[_0x53cc66];return _0x6effae;};'use strict';var emlformat=require(_0xe0dd('0x0'));var rimraf=require(_0xe0dd('0x1'));var zipdir=require(_0xe0dd('0x2'));var jsonpatch=require(_0xe0dd('0x3'));var rp=require(_0xe0dd('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe0dd('0x5'));var util=require('util');var path=require('path');var sox=require(_0xe0dd('0x6'));var csv=require(_0xe0dd('0x7'));var ejs=require(_0xe0dd('0x8'));var fs=require('fs');var fs_extra=require(_0xe0dd('0x9'));var _=require('lodash');var squel=require(_0xe0dd('0xa'));var crypto=require('crypto');var jsforce=require(_0xe0dd('0xb'));var deskjs=require(_0xe0dd('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe0dd('0xd'));var Papa=require(_0xe0dd('0xe'));var Redis=require(_0xe0dd('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe0dd('0x10'));var as=require(_0xe0dd('0x11'));var hardwareService=require(_0xe0dd('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xe0dd('0x13'));var config=require(_0xe0dd('0x14'));var licenseUtil=require(_0xe0dd('0x15'));var db=require(_0xe0dd('0x16'))['db'];function respondWithStatusCode(_0x2319a0,_0x33f484){_0x33f484=_0x33f484||0xcc;return function(_0x440f5f){if(_0x440f5f){return _0x2319a0[_0xe0dd('0x17')](_0x33f484);}return _0x2319a0['status'](_0x33f484)[_0xe0dd('0x18')]();};}function respondWithResult(_0x4a566d,_0x2631b2){_0x2631b2=_0x2631b2||0xc8;return function(_0x3db1d9){if(_0x3db1d9){return _0x4a566d[_0xe0dd('0x19')](_0x2631b2)[_0xe0dd('0x1a')](_0x3db1d9);}};}function respondWithFilteredResult(_0x53bfd1,_0x16dea5){return function(_0x119d0f){if(_0x119d0f){var _0x349ab9=typeof _0x16dea5[_0xe0dd('0x1b')]==='undefined'&&typeof _0x16dea5[_0xe0dd('0x1c')]===_0xe0dd('0x1d');var _0xd2fb0a=_0x119d0f['count'];var _0xe01a8=_0x349ab9?0x0:_0x16dea5['offset'];var _0xa3a679=_0x349ab9?_0x119d0f[_0xe0dd('0x1e')]:_0x16dea5[_0xe0dd('0x1b')]+_0x16dea5['limit'];var _0x157ba1;if(_0xa3a679>=_0xd2fb0a){_0xa3a679=_0xd2fb0a;_0x157ba1=0xc8;}else{_0x157ba1=0xce;}_0x53bfd1['status'](_0x157ba1);return _0x53bfd1[_0xe0dd('0x1f')](_0xe0dd('0x20'),_0xe01a8+'-'+_0xa3a679+'/'+_0xd2fb0a)[_0xe0dd('0x1a')](_0x119d0f);}return null;};}function patchUpdates(_0x33665b){return function(_0x569062){try{jsonpatch['apply'](_0x569062,_0x33665b,!![]);}catch(_0x32dfab){return BPromise[_0xe0dd('0x21')](_0x32dfab);}return _0x569062['save']();};}function saveUpdates(_0x324427,_0x5499f1){return function(_0x159fb4){if(_0x159fb4){return _0x159fb4[_0xe0dd('0x22')](_0x324427)['then'](function(_0x5462a2){return _0x5462a2;});}return null;};}function removeEntity(_0x56f298,_0x49b3d1){return function(_0xd9da87){if(_0xd9da87){return _0xd9da87['destroy']()[_0xe0dd('0x23')](function(){_0x56f298['status'](0xcc)[_0xe0dd('0x18')]();});}};}function handleEntityNotFound(_0x363d59,_0x4d472d){return function(_0x42441f){if(!_0x42441f){_0x363d59[_0xe0dd('0x17')](0x194);}return _0x42441f;};}function handleError(_0x2bb880,_0x266ccc){_0x266ccc=_0x266ccc||0x1f4;return function(_0x2f070c){logger[_0xe0dd('0x24')](_0x2f070c['stack']);if(_0x2f070c['name']){delete _0x2f070c['name'];}_0x2bb880['status'](_0x266ccc)[_0xe0dd('0x25')](_0x2f070c);};}exports[_0xe0dd('0x26')]=function(_0x4a8c44,_0x1c6170){var _0x154195={},_0x12e019={},_0x52c5f1={'count':0x0,'rows':[]};var _0xa26a75=_[_0xe0dd('0x27')](db[_0xe0dd('0x28')][_0xe0dd('0x29')],function(_0x47f654){return{'name':_0x47f654[_0xe0dd('0x2a')],'type':_0x47f654['type']['key']};});_0x12e019[_0xe0dd('0x2b')]=_[_0xe0dd('0x27')](_0xa26a75,_0xe0dd('0x2c'));_0x12e019[_0xe0dd('0x2d')]=_[_0xe0dd('0x2e')](_0x4a8c44[_0xe0dd('0x2d')]);_0x12e019['filters']=_[_0xe0dd('0x2f')](_0x12e019[_0xe0dd('0x2b')],_0x12e019['query']);_0x154195['attributes']=_[_0xe0dd('0x2f')](_0x12e019[_0xe0dd('0x2b')],qs[_0xe0dd('0x30')](_0x4a8c44[_0xe0dd('0x2d')]['fields']));_0x154195['attributes']=_0x154195['attributes'][_0xe0dd('0x31')]?_0x154195[_0xe0dd('0x32')]:_0x12e019[_0xe0dd('0x2b')];if(!_0x4a8c44[_0xe0dd('0x2d')][_0xe0dd('0x33')](_0xe0dd('0x34'))){_0x154195[_0xe0dd('0x1c')]=qs[_0xe0dd('0x1c')](_0x4a8c44['query'][_0xe0dd('0x1c')]);_0x154195[_0xe0dd('0x1b')]=qs['offset'](_0x4a8c44[_0xe0dd('0x2d')][_0xe0dd('0x1b')]);}_0x154195[_0xe0dd('0x35')]=qs['sort'](_0x4a8c44[_0xe0dd('0x2d')][_0xe0dd('0x36')]);_0x154195[_0xe0dd('0x37')]=qs['filters'](_[_0xe0dd('0x38')](_0x4a8c44[_0xe0dd('0x2d')],_0x12e019[_0xe0dd('0x39')]),_0xa26a75);if(_0x4a8c44[_0xe0dd('0x2d')]['filter']){_0x154195['where']=_[_0xe0dd('0x3a')](_0x154195[_0xe0dd('0x37')],{'$or':_[_0xe0dd('0x27')](_0xa26a75,function(_0x5bd203){if(_0x5bd203['type']!==_0xe0dd('0x3b')){var _0x18ae4e={};_0x18ae4e[_0x5bd203[_0xe0dd('0x2c')]]={'$like':'%'+_0x4a8c44[_0xe0dd('0x2d')][_0xe0dd('0x3c')]+'%'};return _0x18ae4e;}})});}_0x154195=_[_0xe0dd('0x3a')]({},_0x154195,_0x4a8c44[_0xe0dd('0x3d')]);var _0x1416b7={'where':_0x154195[_0xe0dd('0x37')]};return db[_0xe0dd('0x28')][_0xe0dd('0x1e')](_0x1416b7)[_0xe0dd('0x23')](function(_0x37145e){_0x52c5f1[_0xe0dd('0x1e')]=_0x37145e;if(_0x4a8c44[_0xe0dd('0x2d')][_0xe0dd('0x3e')]){_0x154195[_0xe0dd('0x3f')]=[{'all':!![]}];}return db[_0xe0dd('0x28')][_0xe0dd('0x40')](_0x154195);})['then'](function(_0x570ff4){_0x52c5f1[_0xe0dd('0x41')]=_0x570ff4;return _0x52c5f1;})[_0xe0dd('0x23')](respondWithFilteredResult(_0x1c6170,_0x154195))['catch'](handleError(_0x1c6170,null));};exports[_0xe0dd('0x42')]=function(_0x218161,_0x4022a1){var _0x29aee3={'raw':![],'where':{'id':_0x218161[_0xe0dd('0x43')]['id']}},_0x217668={};_0x217668['model']=_[_0xe0dd('0x2e')](db['IntegrationReport'][_0xe0dd('0x29')]);_0x217668['query']=_['keys'](_0x218161[_0xe0dd('0x2d')]);_0x217668[_0xe0dd('0x39')]=_['intersection'](_0x217668['model'],_0x217668['query']);_0x29aee3[_0xe0dd('0x32')]=_['intersection'](_0x217668[_0xe0dd('0x2b')],qs['fields'](_0x218161[_0xe0dd('0x2d')]['fields']));_0x29aee3[_0xe0dd('0x32')]=_0x29aee3[_0xe0dd('0x32')]['length']?_0x29aee3[_0xe0dd('0x32')]:_0x217668[_0xe0dd('0x2b')];if(_0x218161[_0xe0dd('0x2d')][_0xe0dd('0x3e')]){_0x29aee3['include']=[{'all':!![]}];}_0x29aee3=_[_0xe0dd('0x3a')]({},_0x29aee3,_0x218161[_0xe0dd('0x3d')]);return db[_0xe0dd('0x28')]['find'](_0x29aee3)[_0xe0dd('0x23')](handleEntityNotFound(_0x4022a1,null))[_0xe0dd('0x23')](respondWithResult(_0x4022a1,null))[_0xe0dd('0x44')](handleError(_0x4022a1,null));};exports['create']=function(_0xe75abc,_0xe8665){return db[_0xe0dd('0x28')]['create'](_0xe75abc['body'],{})['then'](respondWithResult(_0xe8665,0xc9))[_0xe0dd('0x44')](handleError(_0xe8665,null));};exports['update']=function(_0x44a116,_0x202aad){if(_0x44a116[_0xe0dd('0x45')]['id']){delete _0x44a116[_0xe0dd('0x45')]['id'];}return db['IntegrationReport'][_0xe0dd('0x46')]({'where':{'id':_0x44a116[_0xe0dd('0x43')]['id']}})['then'](handleEntityNotFound(_0x202aad,null))[_0xe0dd('0x23')](saveUpdates(_0x44a116[_0xe0dd('0x45')],null))[_0xe0dd('0x23')](respondWithResult(_0x202aad,null))['catch'](handleError(_0x202aad,null));};exports['destroy']=function(_0x18b81f,_0x397301){return db[_0xe0dd('0x28')][_0xe0dd('0x46')]({'where':{'id':_0x18b81f[_0xe0dd('0x43')]['id']}})[_0xe0dd('0x23')](handleEntityNotFound(_0x397301,null))['then'](removeEntity(_0x397301,null))[_0xe0dd('0x44')](handleError(_0x397301,null));};exports[_0xe0dd('0x47')]=function(_0x137008,_0x2066b2){return db[_0xe0dd('0x28')]['describe']()[_0xe0dd('0x23')](respondWithResult(_0x2066b2,null))[_0xe0dd('0x44')](handleError(_0x2066b2,null));}; \ No newline at end of file +var _0x2894=['type','key','model','query','keys','filters','intersection','fields','length','attributes','nolimit','where','pick','merge','VIRTUAL','options','IntegrationReport','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName'];(function(_0x5f58bb,_0x3f0bad){var _0xcc672d=function(_0x4a0765){while(--_0x4a0765){_0x5f58bb['push'](_0x5f58bb['shift']());}};_0xcc672d(++_0x3f0bad);}(_0x2894,0x189));var _0x4289=function(_0x1dfa63,_0x362bd4){_0x1dfa63=_0x1dfa63-0x0;var _0x26f2a9=_0x2894[_0x1dfa63];return _0x26f2a9;};'use strict';var emlformat=require(_0x4289('0x0'));var rimraf=require(_0x4289('0x1'));var zipdir=require(_0x4289('0x2'));var jsonpatch=require(_0x4289('0x3'));var rp=require(_0x4289('0x4'));var moment=require(_0x4289('0x5'));var BPromise=require(_0x4289('0x6'));var Mustache=require(_0x4289('0x7'));var util=require('util');var path=require(_0x4289('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4289('0x9'));var fs=require('fs');var fs_extra=require(_0x4289('0xa'));var _=require(_0x4289('0xb'));var squel=require(_0x4289('0xc'));var crypto=require('crypto');var jsforce=require(_0x4289('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4289('0xe'));var querystring=require('querystring');var Papa=require(_0x4289('0xf'));var Redis=require(_0x4289('0x10'));var authService=require(_0x4289('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4289('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4289('0x13'))('api');var utils=require(_0x4289('0x14'));var config=require(_0x4289('0x15'));var licenseUtil=require(_0x4289('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x491f93,_0x3b4901){_0x3b4901=_0x3b4901||0xcc;return function(_0x32edb5){if(_0x32edb5){return _0x491f93[_0x4289('0x17')](_0x3b4901);}return _0x491f93[_0x4289('0x18')](_0x3b4901)[_0x4289('0x19')]();};}function respondWithResult(_0x307a91,_0x2c571b){_0x2c571b=_0x2c571b||0xc8;return function(_0x436d68){if(_0x436d68){return _0x307a91[_0x4289('0x18')](_0x2c571b)['json'](_0x436d68);}};}function respondWithFilteredResult(_0x1b09cd,_0x26ac82){return function(_0x10d6ef){if(_0x10d6ef){var _0x3726bc=typeof _0x26ac82[_0x4289('0x1a')]==='undefined'&&typeof _0x26ac82['limit']===_0x4289('0x1b');var _0x51680e=_0x10d6ef[_0x4289('0x1c')];var _0x33f5c9=_0x3726bc?0x0:_0x26ac82['offset'];var _0x382a79=_0x3726bc?_0x10d6ef[_0x4289('0x1c')]:_0x26ac82[_0x4289('0x1a')]+_0x26ac82[_0x4289('0x1d')];var _0x52fb0f;if(_0x382a79>=_0x51680e){_0x382a79=_0x51680e;_0x52fb0f=0xc8;}else{_0x52fb0f=0xce;}_0x1b09cd['status'](_0x52fb0f);return _0x1b09cd[_0x4289('0x1e')](_0x4289('0x1f'),_0x33f5c9+'-'+_0x382a79+'/'+_0x51680e)[_0x4289('0x20')](_0x10d6ef);}return null;};}function patchUpdates(_0x5efefb){return function(_0x1e6c86){try{jsonpatch[_0x4289('0x21')](_0x1e6c86,_0x5efefb,!![]);}catch(_0x121a52){return BPromise['reject'](_0x121a52);}return _0x1e6c86[_0x4289('0x22')]();};}function saveUpdates(_0x4154f2,_0x195f77){return function(_0x51a115){if(_0x51a115){return _0x51a115[_0x4289('0x23')](_0x4154f2)[_0x4289('0x24')](function(_0xf5104e){return _0xf5104e;});}return null;};}function removeEntity(_0x1f1abf,_0x57e300){return function(_0x9542dc){if(_0x9542dc){return _0x9542dc[_0x4289('0x25')]()['then'](function(){_0x1f1abf[_0x4289('0x18')](0xcc)[_0x4289('0x19')]();});}};}function handleEntityNotFound(_0x1cc4d3,_0x226ce2){return function(_0x4a03ae){if(!_0x4a03ae){_0x1cc4d3[_0x4289('0x17')](0x194);}return _0x4a03ae;};}function handleError(_0x20864d,_0x1161d5){_0x1161d5=_0x1161d5||0x1f4;return function(_0xd42ab6){logger[_0x4289('0x26')](_0xd42ab6[_0x4289('0x27')]);if(_0xd42ab6[_0x4289('0x28')]){delete _0xd42ab6[_0x4289('0x28')];}_0x20864d['status'](_0x1161d5)[_0x4289('0x29')](_0xd42ab6);};}exports['index']=function(_0x4d8189,_0x380ed5){var _0x5b5dc0={},_0x1d9f44={},_0x2c4f60={'count':0x0,'rows':[]};var _0xdeadff=_[_0x4289('0x2a')](db['IntegrationReport'][_0x4289('0x2b')],function(_0x28100d){return{'name':_0x28100d[_0x4289('0x2c')],'type':_0x28100d[_0x4289('0x2d')][_0x4289('0x2e')]};});_0x1d9f44[_0x4289('0x2f')]=_[_0x4289('0x2a')](_0xdeadff,_0x4289('0x28'));_0x1d9f44[_0x4289('0x30')]=_[_0x4289('0x31')](_0x4d8189[_0x4289('0x30')]);_0x1d9f44[_0x4289('0x32')]=_[_0x4289('0x33')](_0x1d9f44[_0x4289('0x2f')],_0x1d9f44['query']);_0x5b5dc0['attributes']=_['intersection'](_0x1d9f44[_0x4289('0x2f')],qs[_0x4289('0x34')](_0x4d8189[_0x4289('0x30')][_0x4289('0x34')]));_0x5b5dc0['attributes']=_0x5b5dc0['attributes'][_0x4289('0x35')]?_0x5b5dc0[_0x4289('0x36')]:_0x1d9f44[_0x4289('0x2f')];if(!_0x4d8189[_0x4289('0x30')]['hasOwnProperty'](_0x4289('0x37'))){_0x5b5dc0['limit']=qs['limit'](_0x4d8189[_0x4289('0x30')]['limit']);_0x5b5dc0['offset']=qs[_0x4289('0x1a')](_0x4d8189[_0x4289('0x30')][_0x4289('0x1a')]);}_0x5b5dc0['order']=qs['sort'](_0x4d8189[_0x4289('0x30')]['sort']);_0x5b5dc0[_0x4289('0x38')]=qs[_0x4289('0x32')](_[_0x4289('0x39')](_0x4d8189[_0x4289('0x30')],_0x1d9f44[_0x4289('0x32')]),_0xdeadff);if(_0x4d8189['query']['filter']){_0x5b5dc0[_0x4289('0x38')]=_[_0x4289('0x3a')](_0x5b5dc0[_0x4289('0x38')],{'$or':_[_0x4289('0x2a')](_0xdeadff,function(_0x24aff3){if(_0x24aff3[_0x4289('0x2d')]!==_0x4289('0x3b')){var _0x5eca8e={};_0x5eca8e[_0x24aff3['name']]={'$like':'%'+_0x4d8189[_0x4289('0x30')]['filter']+'%'};return _0x5eca8e;}})});}_0x5b5dc0=_['merge']({},_0x5b5dc0,_0x4d8189[_0x4289('0x3c')]);var _0xd5da60={'where':_0x5b5dc0[_0x4289('0x38')]};return db[_0x4289('0x3d')]['count'](_0xd5da60)[_0x4289('0x24')](function(_0x494f5e){_0x2c4f60[_0x4289('0x1c')]=_0x494f5e;if(_0x4d8189[_0x4289('0x30')][_0x4289('0x3e')]){_0x5b5dc0[_0x4289('0x3f')]=[{'all':!![]}];}return db[_0x4289('0x3d')][_0x4289('0x40')](_0x5b5dc0);})[_0x4289('0x24')](function(_0x2c1ae9){_0x2c4f60[_0x4289('0x41')]=_0x2c1ae9;return _0x2c4f60;})[_0x4289('0x24')](respondWithFilteredResult(_0x380ed5,_0x5b5dc0))['catch'](handleError(_0x380ed5,null));};exports[_0x4289('0x42')]=function(_0x329911,_0x1b8188){var _0x5cdc1b={'raw':![],'where':{'id':_0x329911[_0x4289('0x43')]['id']}},_0x40f22c={};_0x40f22c[_0x4289('0x2f')]=_[_0x4289('0x31')](db[_0x4289('0x3d')][_0x4289('0x2b')]);_0x40f22c[_0x4289('0x30')]=_[_0x4289('0x31')](_0x329911['query']);_0x40f22c[_0x4289('0x32')]=_['intersection'](_0x40f22c[_0x4289('0x2f')],_0x40f22c['query']);_0x5cdc1b['attributes']=_[_0x4289('0x33')](_0x40f22c['model'],qs[_0x4289('0x34')](_0x329911[_0x4289('0x30')][_0x4289('0x34')]));_0x5cdc1b[_0x4289('0x36')]=_0x5cdc1b[_0x4289('0x36')][_0x4289('0x35')]?_0x5cdc1b[_0x4289('0x36')]:_0x40f22c['model'];if(_0x329911[_0x4289('0x30')][_0x4289('0x3e')]){_0x5cdc1b[_0x4289('0x3f')]=[{'all':!![]}];}_0x5cdc1b=_[_0x4289('0x3a')]({},_0x5cdc1b,_0x329911[_0x4289('0x3c')]);return db['IntegrationReport'][_0x4289('0x44')](_0x5cdc1b)[_0x4289('0x24')](handleEntityNotFound(_0x1b8188,null))['then'](respondWithResult(_0x1b8188,null))[_0x4289('0x45')](handleError(_0x1b8188,null));};exports[_0x4289('0x46')]=function(_0x552f4f,_0x2e98fa){return db['IntegrationReport']['create'](_0x552f4f[_0x4289('0x47')],{})['then'](respondWithResult(_0x2e98fa,0xc9))[_0x4289('0x45')](handleError(_0x2e98fa,null));};exports['update']=function(_0xa0e80a,_0x1af469){if(_0xa0e80a[_0x4289('0x47')]['id']){delete _0xa0e80a[_0x4289('0x47')]['id'];}return db[_0x4289('0x3d')][_0x4289('0x44')]({'where':{'id':_0xa0e80a[_0x4289('0x43')]['id']}})[_0x4289('0x24')](handleEntityNotFound(_0x1af469,null))[_0x4289('0x24')](saveUpdates(_0xa0e80a[_0x4289('0x47')],null))[_0x4289('0x24')](respondWithResult(_0x1af469,null))[_0x4289('0x45')](handleError(_0x1af469,null));};exports[_0x4289('0x25')]=function(_0x41a636,_0x3551b0){return db[_0x4289('0x3d')]['find']({'where':{'id':_0x41a636[_0x4289('0x43')]['id']}})['then'](handleEntityNotFound(_0x3551b0,null))['then'](removeEntity(_0x3551b0,null))['catch'](handleError(_0x3551b0,null));};exports[_0x4289('0x48')]=function(_0x1dc170,_0x8e0040){return db[_0x4289('0x3d')][_0x4289('0x48')]()[_0x4289('0x24')](respondWithResult(_0x8e0040,null))[_0x4289('0x45')](handleError(_0x8e0040,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 441cd58..c27ae97 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 _0x9ffb=['IntegrationReport','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x4561dc,_0xc869){var _0x814679=function(_0x110477){while(--_0x110477){_0x4561dc['push'](_0x4561dc['shift']());}};_0x814679(++_0xc869);}(_0x9ffb,0xdd));var _0xb9ff=function(_0x52233d,_0x3a9c4f){_0x52233d=_0x52233d-0x0;var _0x4432c5=_0x9ffb[_0x52233d];return _0x4432c5;};'use strict';var _=require(_0xb9ff('0x0'));var util=require(_0xb9ff('0x1'));var logger=require(_0xb9ff('0x2'))('api');var moment=require(_0xb9ff('0x3'));var BPromise=require('bluebird');var rp=require(_0xb9ff('0x4'));var fs=require('fs');var path=require(_0xb9ff('0x5'));var rimraf=require(_0xb9ff('0x6'));var config=require(_0xb9ff('0x7'));var attributes=require('./integrationReport.attributes');module[_0xb9ff('0x8')]=function(_0x435c90,_0x1e8b2c){return _0x435c90[_0xb9ff('0x9')](_0xb9ff('0xa'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeef4=['./integrationReport.attributes','exports','IntegrationReport','report_integration','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment'];(function(_0x39f0ae,_0x5a2ec6){var _0x5ebdf0=function(_0x2e6c05){while(--_0x2e6c05){_0x39f0ae['push'](_0x39f0ae['shift']());}};_0x5ebdf0(++_0x5a2ec6);}(_0xeef4,0x7d));var _0x4eef=function(_0x1e081a,_0x482d6b){_0x1e081a=_0x1e081a-0x0;var _0x428209=_0xeef4[_0x1e081a];return _0x428209;};'use strict';var _=require('lodash');var util=require(_0x4eef('0x0'));var logger=require(_0x4eef('0x1'))(_0x4eef('0x2'));var moment=require('moment');var BPromise=require(_0x4eef('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4eef('0x4'));var rimraf=require(_0x4eef('0x5'));var config=require(_0x4eef('0x6'));var attributes=require(_0x4eef('0x7'));module[_0x4eef('0x8')]=function(_0x42e54a,_0x39616d){return _0x42e54a['define'](_0x4eef('0x9'),attributes,{'tableName':_0x4eef('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 718e5e1..8b6c78c 100644 --- a/server/api/integrationReport/integrationReport.rpc.js +++ b/server/api/integrationReport/integrationReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc2c7=['../../config/logger','jayson/promise','client','http','request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0xc2c7,0x134));var _0x7c2c=function(_0x1aeaa9,_0xba18e){_0x1aeaa9=_0x1aeaa9-0x0;var _0x5413bd=_0xc2c7[_0x1aeaa9];return _0x5413bd;};'use strict';var _=require('lodash');var util=require(_0x7c2c('0x0'));var moment=require(_0x7c2c('0x1'));var BPromise=require(_0x7c2c('0x2'));var rs=require(_0x7c2c('0x3'));var fs=require('fs');var Redis=require(_0x7c2c('0x4'));var db=require(_0x7c2c('0x5'))['db'];var utils=require(_0x7c2c('0x6'));var logger=require(_0x7c2c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7c2c('0x8'));var client=jayson[_0x7c2c('0x9')][_0x7c2c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54f027,_0x4abe93,_0x5a1027){return new BPromise(function(_0x2274cd,_0x29638d){return client[_0x7c2c('0xb')](_0x54f027,_0x5a1027)[_0x7c2c('0xc')](function(_0x279cff){logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));logger[_0x7c2c('0xf')](_0x7c2c('0x10'),_0x4abe93,_0x7c2c('0xe'),JSON[_0x7c2c('0x11')](_0x279cff));if(_0x279cff[_0x7c2c('0x12')]){if(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x13')]===0x1f4){logger[_0x7c2c('0x12')](_0x7c2c('0xd'),_0x4abe93,_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);return _0x29638d(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}logger[_0x7c2c('0x12')]('IntegrationReport,\x20%s,\x20%s',_0x4abe93,_0x279cff['error'][_0x7c2c('0x14')]);return _0x2274cd(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}else{logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));_0x2274cd(_0x279cff['result'][_0x7c2c('0x14')]);}})['catch'](function(_0x1aa355){logger['error'](_0x7c2c('0xd'),_0x4abe93,_0x1aa355);_0x29638d(_0x1aa355);});});} \ No newline at end of file +var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x34d823,_0x2d20b0){var _0x1eb90c=function(_0x43eda6){while(--_0x43eda6){_0x34d823['push'](_0x34d823['shift']());}};_0x1eb90c(++_0x2d20b0);}(_0xadb5,0xad));var _0x5adb=function(_0x54cb94,_0x18df59){_0x54cb94=_0x54cb94-0x0;var _0x3ac7eb=_0xadb5[_0x54cb94];return _0x3ac7eb;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('IntegrationReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index c222832..8676e15 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 _0x5a9e=['show','/:id/sub_intervals','isAuthenticated','getIntervals','create','post','/:id/sub_intervals/create_many','addIntervals','put','/:id','delete','destroy','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index'];(function(_0x53b4cc,_0x43ed3b){var _0x12efa1=function(_0x4b78e2){while(--_0x4b78e2){_0x53b4cc['push'](_0x53b4cc['shift']());}};_0x12efa1(++_0x43ed3b);}(_0x5a9e,0xbd));var _0xe5a9=function(_0x430459,_0x58519c){_0x430459=_0x430459-0x0;var _0x3a2439=_0x5a9e[_0x430459];return _0x3a2439;};'use strict';var multer=require('multer');var util=require(_0xe5a9('0x0'));var path=require(_0xe5a9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe5a9('0x2')]();var fs_extra=require(_0xe5a9('0x3'));var auth=require(_0xe5a9('0x4'));var interaction=require(_0xe5a9('0x5'));var config=require(_0xe5a9('0x6'));var controller=require('./interval.controller');router[_0xe5a9('0x7')]('/',auth['isAuthenticated'](),controller[_0xe5a9('0x8')]);router[_0xe5a9('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xe5a9('0x9')]);router[_0xe5a9('0x7')](_0xe5a9('0xa'),auth[_0xe5a9('0xb')](),controller[_0xe5a9('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe5a9('0xd')]);router['post'](_0xe5a9('0xa'),auth['isAuthenticated'](),controller['addInterval']);router[_0xe5a9('0xe')](_0xe5a9('0xf'),auth[_0xe5a9('0xb')](),controller[_0xe5a9('0x10')]);router[_0xe5a9('0x11')](_0xe5a9('0x12'),auth[_0xe5a9('0xb')](),controller['update']);router[_0xe5a9('0x13')](_0xe5a9('0x12'),auth[_0xe5a9('0xb')](),controller[_0xe5a9('0x14')]);module[_0xe5a9('0x15')]=router; \ No newline at end of file +var _0x3efa=['isAuthenticated','/:id','show','/:id/sub_intervals','getIntervals','post','/:id/sub_intervals/create_many','addIntervals','put','update','delete','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./interval.controller','get'];(function(_0x549949,_0x32c1e3){var _0x5a15fd=function(_0x1b6009){while(--_0x1b6009){_0x549949['push'](_0x549949['shift']());}};_0x5a15fd(++_0x32c1e3);}(_0x3efa,0x147));var _0xa3ef=function(_0x46d1fe,_0x5799cc){_0x46d1fe=_0x46d1fe-0x0;var _0xb4c964=_0x3efa[_0x46d1fe];return _0xb4c964;};'use strict';var multer=require('multer');var util=require(_0xa3ef('0x0'));var path=require('path');var timeout=require(_0xa3ef('0x1'));var express=require(_0xa3ef('0x2'));var router=express[_0xa3ef('0x3')]();var fs_extra=require(_0xa3ef('0x4'));var auth=require(_0xa3ef('0x5'));var interaction=require(_0xa3ef('0x6'));var config=require('../../config/environment');var controller=require(_0xa3ef('0x7'));router[_0xa3ef('0x8')]('/',auth[_0xa3ef('0x9')](),controller['index']);router[_0xa3ef('0x8')](_0xa3ef('0xa'),auth['isAuthenticated'](),controller[_0xa3ef('0xb')]);router[_0xa3ef('0x8')](_0xa3ef('0xc'),auth[_0xa3ef('0x9')](),controller[_0xa3ef('0xd')]);router[_0xa3ef('0xe')]('/',auth[_0xa3ef('0x9')](),controller['create']);router['post'](_0xa3ef('0xc'),auth[_0xa3ef('0x9')](),controller['addInterval']);router[_0xa3ef('0xe')](_0xa3ef('0xf'),auth['isAuthenticated'](),controller[_0xa3ef('0x10')]);router[_0xa3ef('0x11')](_0xa3ef('0xa'),auth[_0xa3ef('0x9')](),controller[_0xa3ef('0x12')]);router[_0xa3ef('0x13')]('/:id',auth[_0xa3ef('0x9')](),controller['destroy']);module[_0xa3ef('0x14')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index f674470..9cef045 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 _0xb284=['STRING','sequelize','exports'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0xb284,0x76));var _0x4b28=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb284[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x4b28('0x0'));module[_0x4b28('0x1')]={'name':{'type':Sequelize[_0x4b28('0x2')]},'description':{'type':Sequelize[_0x4b28('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0xd5d7=['STRING','sequelize'];(function(_0xe80e5c,_0x38e90a){var _0x2bff61=function(_0x29203e){while(--_0x29203e){_0xe80e5c['push'](_0xe80e5c['shift']());}};_0x2bff61(++_0x38e90a);}(_0xd5d7,0x1f1));var _0x7d5d=function(_0x487425,_0x53e274){_0x487425=_0x487425-0x0;var _0x4b426b=_0xd5d7[_0x487425];return _0x4b426b;};'use strict';var Sequelize=require(_0x7d5d('0x0'));module['exports']={'name':{'type':Sequelize[_0x7d5d('0x1')]},'description':{'type':Sequelize[_0x7d5d('0x1')]},'interval':{'type':Sequelize[_0x7d5d('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 73ee7b2..d4a1e43 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 _0x8d66=['update','then','destroy','get','Intervals','UserProfileResource','end','error','stack','name','index','Interval','rawAttributes','type','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','rows','show','params','length','include','find','catch','create','body','user','UserProfileSection','autoAssociation','getIntervals','findOne','nolimit','addIntervals','sequelize','transaction','IntervalId','findAll','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','json','apply','reject'];(function(_0xf87bbf,_0x3180af){var _0x322140=function(_0xb03a01){while(--_0xb03a01){_0xf87bbf['push'](_0xf87bbf['shift']());}};_0x322140(++_0x3180af);}(_0x8d66,0xda));var _0x68d6=function(_0x1e611f,_0x432715){_0x1e611f=_0x1e611f-0x0;var _0x411867=_0x8d66[_0x1e611f];return _0x411867;};'use strict';var emlformat=require(_0x68d6('0x0'));var rimraf=require(_0x68d6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x68d6('0x2'));var rp=require(_0x68d6('0x3'));var moment=require('moment');var BPromise=require(_0x68d6('0x4'));var Mustache=require(_0x68d6('0x5'));var util=require(_0x68d6('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x68d6('0x7'));var ejs=require(_0x68d6('0x8'));var fs=require('fs');var fs_extra=require(_0x68d6('0x9'));var _=require(_0x68d6('0xa'));var squel=require('squel');var crypto=require(_0x68d6('0xb'));var jsforce=require(_0x68d6('0xc'));var deskjs=require(_0x68d6('0xd'));var toCsv=require(_0x68d6('0x7'));var querystring=require(_0x68d6('0xe'));var Papa=require(_0x68d6('0xf'));var Redis=require(_0x68d6('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x68d6('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x68d6('0x12'));var config=require(_0x68d6('0x13'));var licenseUtil=require(_0x68d6('0x14'));var db=require(_0x68d6('0x15'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x2f36b1,_0x2b4c39){_0x2b4c39=_0x2b4c39||0xcc;return function(_0x1f9614){if(_0x1f9614){return _0x2f36b1[_0x68d6('0x16')](_0x2b4c39);}return _0x2f36b1[_0x68d6('0x17')](_0x2b4c39)['end']();};}function respondWithResult(_0x4cbb6d,_0x4f58c5){_0x4f58c5=_0x4f58c5||0xc8;return function(_0x224599){if(_0x224599){return _0x4cbb6d['status'](_0x4f58c5)['json'](_0x224599);}};}function respondWithFilteredResult(_0xd92a2d,_0x5caf67){return function(_0x1d350b){if(_0x1d350b){var _0x54f11e=typeof _0x5caf67[_0x68d6('0x18')]===_0x68d6('0x19')&&typeof _0x5caf67[_0x68d6('0x1a')]===_0x68d6('0x19');var _0xe3fba6=_0x1d350b[_0x68d6('0x1b')];var _0x53d978=_0x54f11e?0x0:_0x5caf67['offset'];var _0x5163b2=_0x54f11e?_0x1d350b[_0x68d6('0x1b')]:_0x5caf67[_0x68d6('0x18')]+_0x5caf67[_0x68d6('0x1a')];var _0x212b11;if(_0x5163b2>=_0xe3fba6){_0x5163b2=_0xe3fba6;_0x212b11=0xc8;}else{_0x212b11=0xce;}_0xd92a2d[_0x68d6('0x17')](_0x212b11);return _0xd92a2d['set']('Content-Range',_0x53d978+'-'+_0x5163b2+'/'+_0xe3fba6)[_0x68d6('0x1c')](_0x1d350b);}return null;};}function patchUpdates(_0x3ede94){return function(_0xee6d15){try{jsonpatch[_0x68d6('0x1d')](_0xee6d15,_0x3ede94,!![]);}catch(_0x479423){return BPromise[_0x68d6('0x1e')](_0x479423);}return _0xee6d15['save']();};}function saveUpdates(_0x4a0868,_0x35f302){return function(_0x36a0b5){if(_0x36a0b5){return _0x36a0b5[_0x68d6('0x1f')](_0x4a0868)[_0x68d6('0x20')](function(_0x3ace90){return _0x3ace90;});}return null;};}function removeEntity(_0x1d7b07,_0x37c411){return function(_0x2e77a8){if(_0x2e77a8){return _0x2e77a8[_0x68d6('0x21')]()['then'](function(){var _0x413747=_0x2e77a8[_0x68d6('0x22')]({'plain':!![]});var _0x527f31=_0x68d6('0x23');return db[_0x68d6('0x24')]['destroy']({'where':{'type':_0x527f31,'resourceId':_0x413747['id']}})[_0x68d6('0x20')](function(){return _0x2e77a8;});})[_0x68d6('0x20')](function(){_0x1d7b07['status'](0xcc)[_0x68d6('0x25')]();});}};}function handleEntityNotFound(_0x5665d0,_0x4db7d8){return function(_0x5f4e5c){if(!_0x5f4e5c){_0x5665d0[_0x68d6('0x16')](0x194);}return _0x5f4e5c;};}function handleError(_0x15fa4e,_0x313cb3){_0x313cb3=_0x313cb3||0x1f4;return function(_0x4b0002){logger[_0x68d6('0x26')](_0x4b0002[_0x68d6('0x27')]);if(_0x4b0002[_0x68d6('0x28')]){delete _0x4b0002['name'];}_0x15fa4e[_0x68d6('0x17')](_0x313cb3)['send'](_0x4b0002);};}exports[_0x68d6('0x29')]=function(_0x2d9a45,_0x1bf5fd){var _0x47b9eb={},_0x4748ac={},_0x4fe58d={'count':0x0,'rows':[]};var _0x3ac411=_['map'](db[_0x68d6('0x2a')][_0x68d6('0x2b')],function(_0x3f7ad3){return{'name':_0x3f7ad3['fieldName'],'type':_0x3f7ad3[_0x68d6('0x2c')][_0x68d6('0x2d')]};});_0x4748ac[_0x68d6('0x2e')]=_[_0x68d6('0x2f')](_0x3ac411,'name');_0x4748ac[_0x68d6('0x30')]=_[_0x68d6('0x31')](_0x2d9a45[_0x68d6('0x30')]);_0x4748ac['filters']=_[_0x68d6('0x32')](_0x4748ac[_0x68d6('0x2e')],_0x4748ac[_0x68d6('0x30')]);_0x47b9eb[_0x68d6('0x33')]=_[_0x68d6('0x32')](_0x4748ac[_0x68d6('0x2e')],qs[_0x68d6('0x34')](_0x2d9a45[_0x68d6('0x30')][_0x68d6('0x34')]));_0x47b9eb[_0x68d6('0x33')]=_0x47b9eb[_0x68d6('0x33')]['length']?_0x47b9eb[_0x68d6('0x33')]:_0x4748ac[_0x68d6('0x2e')];if(!_0x2d9a45[_0x68d6('0x30')][_0x68d6('0x35')]('nolimit')){_0x47b9eb['limit']=qs['limit'](_0x2d9a45[_0x68d6('0x30')][_0x68d6('0x1a')]);_0x47b9eb[_0x68d6('0x18')]=qs[_0x68d6('0x18')](_0x2d9a45[_0x68d6('0x30')][_0x68d6('0x18')]);}_0x47b9eb[_0x68d6('0x36')]=qs[_0x68d6('0x37')](_0x2d9a45[_0x68d6('0x30')][_0x68d6('0x37')]);_0x47b9eb['where']=qs['filters'](_['pick'](_0x2d9a45[_0x68d6('0x30')],_0x4748ac[_0x68d6('0x38')]),_0x3ac411);if(_0x2d9a45[_0x68d6('0x30')][_0x68d6('0x39')]){_0x47b9eb[_0x68d6('0x3a')]=_['merge'](_0x47b9eb[_0x68d6('0x3a')],{'$or':_['map'](_0x3ac411,function(_0x4dfd40){if(_0x4dfd40['type']!==_0x68d6('0x3b')){var _0x133c2d={};_0x133c2d[_0x4dfd40[_0x68d6('0x28')]]={'$like':'%'+_0x2d9a45[_0x68d6('0x30')][_0x68d6('0x39')]+'%'};return _0x133c2d;}})});}_0x47b9eb=_[_0x68d6('0x3c')]({},_0x47b9eb,_0x2d9a45[_0x68d6('0x3d')]);var _0x280997={'where':_0x47b9eb['where']};return db[_0x68d6('0x2a')][_0x68d6('0x1b')](_0x280997)['then'](function(_0x425432){_0x4fe58d[_0x68d6('0x1b')]=_0x425432;if(_0x2d9a45[_0x68d6('0x30')][_0x68d6('0x3e')]){_0x47b9eb['include']=[{'all':!![]}];}return db[_0x68d6('0x2a')]['findAll'](_0x47b9eb);})[_0x68d6('0x20')](function(_0x3040bb){_0x4fe58d[_0x68d6('0x3f')]=_0x3040bb;return _0x4fe58d;})[_0x68d6('0x20')](respondWithFilteredResult(_0x1bf5fd,_0x47b9eb))['catch'](handleError(_0x1bf5fd,null));};exports[_0x68d6('0x40')]=function(_0x4331be,_0x15076c){var _0x4d35c2={'raw':!![],'where':{'id':_0x4331be[_0x68d6('0x41')]['id']}},_0x517d1b={};_0x517d1b['model']=_[_0x68d6('0x31')](db[_0x68d6('0x2a')]['rawAttributes']);_0x517d1b[_0x68d6('0x30')]=_[_0x68d6('0x31')](_0x4331be[_0x68d6('0x30')]);_0x517d1b[_0x68d6('0x38')]=_['intersection'](_0x517d1b[_0x68d6('0x2e')],_0x517d1b['query']);_0x4d35c2[_0x68d6('0x33')]=_[_0x68d6('0x32')](_0x517d1b[_0x68d6('0x2e')],qs[_0x68d6('0x34')](_0x4331be['query'][_0x68d6('0x34')]));_0x4d35c2[_0x68d6('0x33')]=_0x4d35c2['attributes'][_0x68d6('0x42')]?_0x4d35c2['attributes']:_0x517d1b['model'];if(_0x4331be[_0x68d6('0x30')][_0x68d6('0x3e')]){_0x4d35c2[_0x68d6('0x43')]=[{'all':!![]}];}_0x4d35c2=_[_0x68d6('0x3c')]({},_0x4d35c2,_0x4331be[_0x68d6('0x3d')]);return db[_0x68d6('0x2a')][_0x68d6('0x44')](_0x4d35c2)['then'](handleEntityNotFound(_0x15076c,null))[_0x68d6('0x20')](respondWithResult(_0x15076c,null))[_0x68d6('0x45')](handleError(_0x15076c,null));};exports[_0x68d6('0x46')]=function(_0x244b53,_0x45a3b4){return db[_0x68d6('0x2a')]['create'](_0x244b53[_0x68d6('0x47')],{})[_0x68d6('0x20')](function(_0x3b37b8){var _0x3a1786=_0x244b53[_0x68d6('0x48')][_0x68d6('0x22')]({'plain':!![]});if(!_0x3a1786)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3a1786['role']===_0x68d6('0x48')){var _0x1168cf=_0x3b37b8[_0x68d6('0x22')]({'plain':!![]});var _0x5f027c=_0x68d6('0x23');return db[_0x68d6('0x49')][_0x68d6('0x44')]({'where':{'name':_0x5f027c,'userProfileId':_0x3a1786['userProfileId']},'raw':!![]})[_0x68d6('0x20')](function(_0x29120f){if(_0x29120f&&_0x29120f[_0x68d6('0x4a')]===0x0){return db[_0x68d6('0x24')][_0x68d6('0x46')]({'name':_0x1168cf[_0x68d6('0x28')],'resourceId':_0x1168cf['id'],'type':_0x29120f[_0x68d6('0x28')],'sectionId':_0x29120f['id']},{})['then'](function(){return _0x3b37b8;});}else{return _0x3b37b8;}})[_0x68d6('0x45')](function(_0x52091c){logger[_0x68d6('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x52091c);throw _0x52091c;});}return _0x3b37b8;})[_0x68d6('0x20')](respondWithResult(_0x45a3b4,0xc9))['catch'](handleError(_0x45a3b4,null));};exports[_0x68d6('0x1f')]=function(_0x331ed4,_0x3e3220){if(_0x331ed4[_0x68d6('0x47')]['id']){delete _0x331ed4[_0x68d6('0x47')]['id'];}return db['Interval'][_0x68d6('0x44')]({'where':{'id':_0x331ed4[_0x68d6('0x41')]['id']}})[_0x68d6('0x20')](handleEntityNotFound(_0x3e3220,null))[_0x68d6('0x20')](saveUpdates(_0x331ed4[_0x68d6('0x47')],null))['then'](respondWithResult(_0x3e3220,null))[_0x68d6('0x45')](handleError(_0x3e3220,null));};exports['destroy']=function(_0x3c5eee,_0x3e56d5){return db[_0x68d6('0x2a')][_0x68d6('0x44')]({'where':{'id':_0x3c5eee['params']['id']}})[_0x68d6('0x20')](handleEntityNotFound(_0x3e56d5,null))[_0x68d6('0x20')](removeEntity(_0x3e56d5,null))['catch'](handleError(_0x3e56d5,null));};exports['addInterval']=function(_0x5a8736,_0x3d6a33,_0x2a97dc){if(_0x5a8736[_0x68d6('0x47')]['id']){delete _0x5a8736[_0x68d6('0x47')]['id'];}return db[_0x68d6('0x2a')]['find']({'where':{'id':_0x5a8736[_0x68d6('0x41')]['id']}})[_0x68d6('0x20')](handleEntityNotFound(_0x3d6a33,null))[_0x68d6('0x20')](function(_0x53750a){if(_0x53750a){_0x5a8736[_0x68d6('0x47')]['IntervalId']=_0x53750a['id'];return db[_0x68d6('0x2a')][_0x68d6('0x46')](_0x5a8736[_0x68d6('0x47')]);}})['then'](respondWithResult(_0x3d6a33,null))[_0x68d6('0x45')](handleError(_0x3d6a33,null));};exports[_0x68d6('0x4b')]=function(_0x44c4b3,_0x31998d,_0x537da5){var _0x232a75={};var _0xc603df={};var _0x4b09fc;var _0x1798c9;return db[_0x68d6('0x2a')][_0x68d6('0x4c')]({'where':{'id':_0x44c4b3[_0x68d6('0x41')]['id']}})['then'](handleEntityNotFound(_0x31998d,null))[_0x68d6('0x20')](function(_0x2ddd02){if(_0x2ddd02){_0x4b09fc=_0x2ddd02;_0xc603df[_0x68d6('0x2e')]=_['keys'](db[_0x68d6('0x2a')][_0x68d6('0x2b')]);_0xc603df['query']=_[_0x68d6('0x31')](_0x44c4b3[_0x68d6('0x30')]);_0xc603df[_0x68d6('0x38')]=_[_0x68d6('0x32')](_0xc603df[_0x68d6('0x2e')],_0xc603df['query']);_0x232a75[_0x68d6('0x33')]=_[_0x68d6('0x32')](_0xc603df[_0x68d6('0x2e')],qs[_0x68d6('0x34')](_0x44c4b3[_0x68d6('0x30')][_0x68d6('0x34')]));_0x232a75[_0x68d6('0x33')]=_0x232a75[_0x68d6('0x33')][_0x68d6('0x42')]?_0x232a75[_0x68d6('0x33')]:_0xc603df[_0x68d6('0x2e')];_0x232a75['order']=qs[_0x68d6('0x37')](_0x44c4b3[_0x68d6('0x30')][_0x68d6('0x37')]);_0x232a75['where']=qs[_0x68d6('0x38')](_['pick'](_0x44c4b3[_0x68d6('0x30')],_0xc603df[_0x68d6('0x38')]));if(_0x44c4b3[_0x68d6('0x30')][_0x68d6('0x39')]){_0x232a75[_0x68d6('0x3a')]=_[_0x68d6('0x3c')](_0x232a75[_0x68d6('0x3a')],{'$or':_[_0x68d6('0x2f')](_0x232a75[_0x68d6('0x33')],function(_0x3531a0){var _0xff1e47={};_0xff1e47[_0x3531a0]={'$like':'%'+_0x44c4b3[_0x68d6('0x30')][_0x68d6('0x39')]+'%'};return _0xff1e47;})});}_0x232a75=_[_0x68d6('0x3c')]({},_0x232a75,_0x44c4b3[_0x68d6('0x3d')]);return _0x4b09fc['getIntervals'](_0x232a75);}})[_0x68d6('0x20')](function(_0x4ea4ce){if(_0x4ea4ce){_0x1798c9=_0x4ea4ce[_0x68d6('0x42')];if(!_0x44c4b3[_0x68d6('0x30')]['hasOwnProperty'](_0x68d6('0x4d'))){_0x232a75[_0x68d6('0x1a')]=qs['limit'](_0x44c4b3[_0x68d6('0x30')][_0x68d6('0x1a')]);_0x232a75[_0x68d6('0x18')]=qs[_0x68d6('0x18')](_0x44c4b3[_0x68d6('0x30')][_0x68d6('0x18')]);}return _0x4b09fc[_0x68d6('0x4b')](_0x232a75);}})[_0x68d6('0x20')](function(_0x13eed4){if(_0x13eed4){return _0x13eed4?{'count':_0x1798c9,'rows':_0x13eed4}:null;}})[_0x68d6('0x20')](respondWithResult(_0x31998d,null))[_0x68d6('0x45')](handleError(_0x31998d,null));};exports[_0x68d6('0x4e')]=function(_0x3407fb,_0x556bc9,_0x5e2011){return db[_0x68d6('0x2a')][_0x68d6('0x4c')]({'where':{'id':_0x3407fb['params']['id']}})[_0x68d6('0x20')](handleEntityNotFound(_0x556bc9,null))[_0x68d6('0x20')](function(_0x2b5233){if(_0x2b5233){return db[_0x68d6('0x4f')][_0x68d6('0x50')](function(_0x255c78){return db[_0x68d6('0x2a')]['destroy']({'where':{'IntervalId':_0x3407fb[_0x68d6('0x41')]['id']},'transaction':_0x255c78})[_0x68d6('0x20')](function(_0xea9722){var _0x29520b=_[_0x68d6('0x2f')](_0x3407fb[_0x68d6('0x47')],function(_0x51b9a2){delete _0x51b9a2['id'];_0x51b9a2[_0x68d6('0x51')]=_0x3407fb['params']['id'];return _0x51b9a2;});return db[_0x68d6('0x2a')]['bulkCreate'](_0x29520b,{'transaction':_0x255c78});});})['then'](function(){return db[_0x68d6('0x2a')][_0x68d6('0x52')]({'where':{'IntervalId':_0x3407fb[_0x68d6('0x41')]['id']}});});}})[_0x68d6('0x20')](respondWithResult(_0x556bc9,null))['catch'](handleError(_0x556bc9,null));}; \ No newline at end of file +var _0xedc3=['addInterval','IntervalId','findOne','getIntervals','addIntervals','sequelize','transaction','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','Intervals','UserProfileResource','sendStatus','error','stack','name','send','index','map','fieldName','type','key','keys','query','intersection','model','fields','attributes','hasOwnProperty','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','Interval','includeAll','include','rows','catch','show','params','rawAttributes','length','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'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xedc3,0x6c));var _0x3edc=function(_0x47727f,_0x44da61){_0x47727f=_0x47727f-0x0;var _0x3e23e3=_0xedc3[_0x47727f];return _0x3e23e3;};'use strict';var emlformat=require(_0x3edc('0x0'));var rimraf=require(_0x3edc('0x1'));var zipdir=require(_0x3edc('0x2'));var jsonpatch=require(_0x3edc('0x3'));var rp=require(_0x3edc('0x4'));var moment=require(_0x3edc('0x5'));var BPromise=require(_0x3edc('0x6'));var Mustache=require(_0x3edc('0x7'));var util=require(_0x3edc('0x8'));var path=require(_0x3edc('0x9'));var sox=require(_0x3edc('0xa'));var csv=require('to-csv');var ejs=require(_0x3edc('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3edc('0xc'));var squel=require(_0x3edc('0xd'));var crypto=require(_0x3edc('0xe'));var jsforce=require(_0x3edc('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x3edc('0x10'));var querystring=require('querystring');var Papa=require(_0x3edc('0x11'));var Redis=require(_0x3edc('0x12'));var authService=require(_0x3edc('0x13'));var qs=require(_0x3edc('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3edc('0x15'));var logger=require(_0x3edc('0x16'))(_0x3edc('0x17'));var utils=require(_0x3edc('0x18'));var config=require(_0x3edc('0x19'));var licenseUtil=require(_0x3edc('0x1a'));var db=require(_0x3edc('0x1b'))['db'];var extensions=require(_0x3edc('0x1c'));function respondWithStatusCode(_0x1b2241,_0x1d42cd){_0x1d42cd=_0x1d42cd||0xcc;return function(_0x4b05ad){if(_0x4b05ad){return _0x1b2241['sendStatus'](_0x1d42cd);}return _0x1b2241[_0x3edc('0x1d')](_0x1d42cd)[_0x3edc('0x1e')]();};}function respondWithResult(_0x38422c,_0x364c1f){_0x364c1f=_0x364c1f||0xc8;return function(_0x4249d4){if(_0x4249d4){return _0x38422c[_0x3edc('0x1d')](_0x364c1f)[_0x3edc('0x1f')](_0x4249d4);}};}function respondWithFilteredResult(_0x21cf8a,_0x24ef22){return function(_0x5a7f91){if(_0x5a7f91){var _0xd4a2f4=typeof _0x24ef22[_0x3edc('0x20')]===_0x3edc('0x21')&&typeof _0x24ef22[_0x3edc('0x22')]===_0x3edc('0x21');var _0x2ead04=_0x5a7f91[_0x3edc('0x23')];var _0x4bf057=_0xd4a2f4?0x0:_0x24ef22[_0x3edc('0x20')];var _0x4e6c18=_0xd4a2f4?_0x5a7f91[_0x3edc('0x23')]:_0x24ef22[_0x3edc('0x20')]+_0x24ef22['limit'];var _0x404576;if(_0x4e6c18>=_0x2ead04){_0x4e6c18=_0x2ead04;_0x404576=0xc8;}else{_0x404576=0xce;}_0x21cf8a[_0x3edc('0x1d')](_0x404576);return _0x21cf8a[_0x3edc('0x24')](_0x3edc('0x25'),_0x4bf057+'-'+_0x4e6c18+'/'+_0x2ead04)[_0x3edc('0x1f')](_0x5a7f91);}return null;};}function patchUpdates(_0x4ccc05){return function(_0x203a11){try{jsonpatch[_0x3edc('0x26')](_0x203a11,_0x4ccc05,!![]);}catch(_0x465470){return BPromise[_0x3edc('0x27')](_0x465470);}return _0x203a11[_0x3edc('0x28')]();};}function saveUpdates(_0x4a41b2,_0x4c5895){return function(_0x28102a){if(_0x28102a){return _0x28102a[_0x3edc('0x29')](_0x4a41b2)['then'](function(_0x55bec6){return _0x55bec6;});}return null;};}function removeEntity(_0x254918,_0x164eb7){return function(_0x280046){if(_0x280046){return _0x280046[_0x3edc('0x2a')]()[_0x3edc('0x2b')](function(){var _0x33ab32=_0x280046[_0x3edc('0x2c')]({'plain':!![]});var _0x541c4d=_0x3edc('0x2d');return db[_0x3edc('0x2e')][_0x3edc('0x2a')]({'where':{'type':_0x541c4d,'resourceId':_0x33ab32['id']}})[_0x3edc('0x2b')](function(){return _0x280046;});})[_0x3edc('0x2b')](function(){_0x254918[_0x3edc('0x1d')](0xcc)[_0x3edc('0x1e')]();});}};}function handleEntityNotFound(_0x5cead8,_0x129351){return function(_0x417e94){if(!_0x417e94){_0x5cead8[_0x3edc('0x2f')](0x194);}return _0x417e94;};}function handleError(_0xdafc0e,_0x4f3114){_0x4f3114=_0x4f3114||0x1f4;return function(_0x29de17){logger[_0x3edc('0x30')](_0x29de17[_0x3edc('0x31')]);if(_0x29de17[_0x3edc('0x32')]){delete _0x29de17['name'];}_0xdafc0e[_0x3edc('0x1d')](_0x4f3114)[_0x3edc('0x33')](_0x29de17);};}exports[_0x3edc('0x34')]=function(_0x30d197,_0x1dbfa0){var _0x5a0790={},_0x197e80={},_0x20aae9={'count':0x0,'rows':[]};var _0x5669b8=_[_0x3edc('0x35')](db['Interval']['rawAttributes'],function(_0x5ad9c5){return{'name':_0x5ad9c5[_0x3edc('0x36')],'type':_0x5ad9c5[_0x3edc('0x37')][_0x3edc('0x38')]};});_0x197e80['model']=_['map'](_0x5669b8,'name');_0x197e80['query']=_[_0x3edc('0x39')](_0x30d197['query']);_0x197e80['filters']=_['intersection'](_0x197e80['model'],_0x197e80[_0x3edc('0x3a')]);_0x5a0790['attributes']=_[_0x3edc('0x3b')](_0x197e80[_0x3edc('0x3c')],qs[_0x3edc('0x3d')](_0x30d197[_0x3edc('0x3a')][_0x3edc('0x3d')]));_0x5a0790[_0x3edc('0x3e')]=_0x5a0790['attributes']['length']?_0x5a0790['attributes']:_0x197e80[_0x3edc('0x3c')];if(!_0x30d197[_0x3edc('0x3a')][_0x3edc('0x3f')]('nolimit')){_0x5a0790[_0x3edc('0x22')]=qs[_0x3edc('0x22')](_0x30d197['query']['limit']);_0x5a0790[_0x3edc('0x20')]=qs[_0x3edc('0x20')](_0x30d197[_0x3edc('0x3a')][_0x3edc('0x20')]);}_0x5a0790[_0x3edc('0x40')]=qs[_0x3edc('0x41')](_0x30d197[_0x3edc('0x3a')][_0x3edc('0x41')]);_0x5a0790['where']=qs[_0x3edc('0x42')](_[_0x3edc('0x43')](_0x30d197[_0x3edc('0x3a')],_0x197e80[_0x3edc('0x42')]),_0x5669b8);if(_0x30d197[_0x3edc('0x3a')][_0x3edc('0x44')]){_0x5a0790[_0x3edc('0x45')]=_[_0x3edc('0x46')](_0x5a0790['where'],{'$or':_['map'](_0x5669b8,function(_0x364a6c){if(_0x364a6c[_0x3edc('0x37')]!==_0x3edc('0x47')){var _0xe7d112={};_0xe7d112[_0x364a6c[_0x3edc('0x32')]]={'$like':'%'+_0x30d197[_0x3edc('0x3a')][_0x3edc('0x44')]+'%'};return _0xe7d112;}})});}_0x5a0790=_['merge']({},_0x5a0790,_0x30d197[_0x3edc('0x48')]);var _0x4adc52={'where':_0x5a0790[_0x3edc('0x45')]};return db[_0x3edc('0x49')]['count'](_0x4adc52)[_0x3edc('0x2b')](function(_0x456ac3){_0x20aae9[_0x3edc('0x23')]=_0x456ac3;if(_0x30d197['query'][_0x3edc('0x4a')]){_0x5a0790[_0x3edc('0x4b')]=[{'all':!![]}];}return db['Interval']['findAll'](_0x5a0790);})['then'](function(_0x47908c){_0x20aae9[_0x3edc('0x4c')]=_0x47908c;return _0x20aae9;})['then'](respondWithFilteredResult(_0x1dbfa0,_0x5a0790))[_0x3edc('0x4d')](handleError(_0x1dbfa0,null));};exports[_0x3edc('0x4e')]=function(_0x3bda66,_0x363130){var _0x2a4257={'raw':!![],'where':{'id':_0x3bda66[_0x3edc('0x4f')]['id']}},_0x3a45c9={};_0x3a45c9['model']=_[_0x3edc('0x39')](db[_0x3edc('0x49')][_0x3edc('0x50')]);_0x3a45c9[_0x3edc('0x3a')]=_[_0x3edc('0x39')](_0x3bda66[_0x3edc('0x3a')]);_0x3a45c9[_0x3edc('0x42')]=_[_0x3edc('0x3b')](_0x3a45c9[_0x3edc('0x3c')],_0x3a45c9['query']);_0x2a4257[_0x3edc('0x3e')]=_[_0x3edc('0x3b')](_0x3a45c9['model'],qs[_0x3edc('0x3d')](_0x3bda66[_0x3edc('0x3a')][_0x3edc('0x3d')]));_0x2a4257['attributes']=_0x2a4257['attributes'][_0x3edc('0x51')]?_0x2a4257[_0x3edc('0x3e')]:_0x3a45c9[_0x3edc('0x3c')];if(_0x3bda66[_0x3edc('0x3a')][_0x3edc('0x4a')]){_0x2a4257[_0x3edc('0x4b')]=[{'all':!![]}];}_0x2a4257=_['merge']({},_0x2a4257,_0x3bda66[_0x3edc('0x48')]);return db['Interval'][_0x3edc('0x52')](_0x2a4257)[_0x3edc('0x2b')](handleEntityNotFound(_0x363130,null))[_0x3edc('0x2b')](respondWithResult(_0x363130,null))[_0x3edc('0x4d')](handleError(_0x363130,null));};exports['create']=function(_0x5e9caf,_0x39af66){return db['Interval'][_0x3edc('0x53')](_0x5e9caf[_0x3edc('0x54')],{})[_0x3edc('0x2b')](function(_0xa15359){var _0x5826d1=_0x5e9caf[_0x3edc('0x55')][_0x3edc('0x2c')]({'plain':!![]});if(!_0x5826d1)throw new Error(_0x3edc('0x56'));if(_0x5826d1[_0x3edc('0x57')]===_0x3edc('0x55')){var _0x3f81c1=_0xa15359[_0x3edc('0x2c')]({'plain':!![]});var _0xb8121e='Intervals';return db[_0x3edc('0x58')][_0x3edc('0x52')]({'where':{'name':_0xb8121e,'userProfileId':_0x5826d1[_0x3edc('0x59')]},'raw':!![]})[_0x3edc('0x2b')](function(_0x1ad66c){if(_0x1ad66c&&_0x1ad66c[_0x3edc('0x5a')]===0x0){return db[_0x3edc('0x2e')]['create']({'name':_0x3f81c1['name'],'resourceId':_0x3f81c1['id'],'type':_0x1ad66c[_0x3edc('0x32')],'sectionId':_0x1ad66c['id']},{})[_0x3edc('0x2b')](function(){return _0xa15359;});}else{return _0xa15359;}})[_0x3edc('0x4d')](function(_0xdb72b4){logger[_0x3edc('0x30')](_0x3edc('0x5b'),_0xdb72b4);throw _0xdb72b4;});}return _0xa15359;})[_0x3edc('0x2b')](respondWithResult(_0x39af66,0xc9))['catch'](handleError(_0x39af66,null));};exports['update']=function(_0x2624d6,_0x110271){if(_0x2624d6[_0x3edc('0x54')]['id']){delete _0x2624d6['body']['id'];}return db[_0x3edc('0x49')]['find']({'where':{'id':_0x2624d6[_0x3edc('0x4f')]['id']}})[_0x3edc('0x2b')](handleEntityNotFound(_0x110271,null))[_0x3edc('0x2b')](saveUpdates(_0x2624d6[_0x3edc('0x54')],null))['then'](respondWithResult(_0x110271,null))[_0x3edc('0x4d')](handleError(_0x110271,null));};exports[_0x3edc('0x2a')]=function(_0x2dafbb,_0x3711b3){return db[_0x3edc('0x49')][_0x3edc('0x52')]({'where':{'id':_0x2dafbb[_0x3edc('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3711b3,null))[_0x3edc('0x2b')](removeEntity(_0x3711b3,null))['catch'](handleError(_0x3711b3,null));};exports[_0x3edc('0x5c')]=function(_0x2d02f3,_0x48ed48,_0x3ae45d){if(_0x2d02f3[_0x3edc('0x54')]['id']){delete _0x2d02f3[_0x3edc('0x54')]['id'];}return db[_0x3edc('0x49')][_0x3edc('0x52')]({'where':{'id':_0x2d02f3[_0x3edc('0x4f')]['id']}})[_0x3edc('0x2b')](handleEntityNotFound(_0x48ed48,null))['then'](function(_0x1c5cad){if(_0x1c5cad){_0x2d02f3['body'][_0x3edc('0x5d')]=_0x1c5cad['id'];return db['Interval']['create'](_0x2d02f3[_0x3edc('0x54')]);}})['then'](respondWithResult(_0x48ed48,null))[_0x3edc('0x4d')](handleError(_0x48ed48,null));};exports['getIntervals']=function(_0x5a6d0a,_0x2d8158,_0x270781){var _0x176773={};var _0x14c560={};var _0x13a828;var _0x2d11c0;return db[_0x3edc('0x49')][_0x3edc('0x5e')]({'where':{'id':_0x5a6d0a[_0x3edc('0x4f')]['id']}})[_0x3edc('0x2b')](handleEntityNotFound(_0x2d8158,null))[_0x3edc('0x2b')](function(_0x509407){if(_0x509407){_0x13a828=_0x509407;_0x14c560[_0x3edc('0x3c')]=_[_0x3edc('0x39')](db['Interval'][_0x3edc('0x50')]);_0x14c560[_0x3edc('0x3a')]=_['keys'](_0x5a6d0a[_0x3edc('0x3a')]);_0x14c560['filters']=_[_0x3edc('0x3b')](_0x14c560[_0x3edc('0x3c')],_0x14c560['query']);_0x176773[_0x3edc('0x3e')]=_[_0x3edc('0x3b')](_0x14c560['model'],qs['fields'](_0x5a6d0a['query'][_0x3edc('0x3d')]));_0x176773[_0x3edc('0x3e')]=_0x176773[_0x3edc('0x3e')][_0x3edc('0x51')]?_0x176773[_0x3edc('0x3e')]:_0x14c560[_0x3edc('0x3c')];_0x176773['order']=qs['sort'](_0x5a6d0a['query']['sort']);_0x176773[_0x3edc('0x45')]=qs[_0x3edc('0x42')](_[_0x3edc('0x43')](_0x5a6d0a[_0x3edc('0x3a')],_0x14c560[_0x3edc('0x42')]));if(_0x5a6d0a[_0x3edc('0x3a')]['filter']){_0x176773[_0x3edc('0x45')]=_['merge'](_0x176773['where'],{'$or':_['map'](_0x176773[_0x3edc('0x3e')],function(_0x26f701){var _0x8ec6dd={};_0x8ec6dd[_0x26f701]={'$like':'%'+_0x5a6d0a[_0x3edc('0x3a')][_0x3edc('0x44')]+'%'};return _0x8ec6dd;})});}_0x176773=_[_0x3edc('0x46')]({},_0x176773,_0x5a6d0a[_0x3edc('0x48')]);return _0x13a828['getIntervals'](_0x176773);}})[_0x3edc('0x2b')](function(_0x4ae87d){if(_0x4ae87d){_0x2d11c0=_0x4ae87d['length'];if(!_0x5a6d0a[_0x3edc('0x3a')]['hasOwnProperty']('nolimit')){_0x176773[_0x3edc('0x22')]=qs[_0x3edc('0x22')](_0x5a6d0a['query'][_0x3edc('0x22')]);_0x176773['offset']=qs[_0x3edc('0x20')](_0x5a6d0a[_0x3edc('0x3a')]['offset']);}return _0x13a828[_0x3edc('0x5f')](_0x176773);}})[_0x3edc('0x2b')](function(_0x3ad724){if(_0x3ad724){return _0x3ad724?{'count':_0x2d11c0,'rows':_0x3ad724}:null;}})['then'](respondWithResult(_0x2d8158,null))[_0x3edc('0x4d')](handleError(_0x2d8158,null));};exports[_0x3edc('0x60')]=function(_0x1b7a10,_0xfe916f,_0xb32a3a){return db[_0x3edc('0x49')][_0x3edc('0x5e')]({'where':{'id':_0x1b7a10[_0x3edc('0x4f')]['id']}})[_0x3edc('0x2b')](handleEntityNotFound(_0xfe916f,null))[_0x3edc('0x2b')](function(_0x269bbd){if(_0x269bbd){return db[_0x3edc('0x61')][_0x3edc('0x62')](function(_0x9a3220){return db[_0x3edc('0x49')][_0x3edc('0x2a')]({'where':{'IntervalId':_0x1b7a10[_0x3edc('0x4f')]['id']},'transaction':_0x9a3220})['then'](function(_0x13a2fa){var _0x374218=_[_0x3edc('0x35')](_0x1b7a10[_0x3edc('0x54')],function(_0x4ded72){delete _0x4ded72['id'];_0x4ded72[_0x3edc('0x5d')]=_0x1b7a10[_0x3edc('0x4f')]['id'];return _0x4ded72;});return db[_0x3edc('0x49')][_0x3edc('0x63')](_0x374218,{'transaction':_0x9a3220});});})[_0x3edc('0x2b')](function(){return db[_0x3edc('0x49')]['findAll']({'where':{'IntervalId':_0x1b7a10['params']['id']}});});}})[_0x3edc('0x2b')](respondWithResult(_0xfe916f,null))['catch'](handleError(_0xfe916f,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 34b9bb9..9079599 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 _0x041e=['Interval','tools_intervals','rewrite','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/extensions/rewrite','exports','define'];(function(_0x320cf5,_0x2dc6b1){var _0x411545=function(_0x4fc8f9){while(--_0x4fc8f9){_0x320cf5['push'](_0x320cf5['shift']());}};_0x411545(++_0x2dc6b1);}(_0x041e,0x73));var _0xe041=function(_0x3d194d,_0x1a245f){_0x3d194d=_0x3d194d-0x0;var _0x284729=_0x041e[_0x3d194d];return _0x284729;};'use strict';var _=require(_0xe041('0x0'));var util=require(_0xe041('0x1'));var logger=require(_0xe041('0x2'))(_0xe041('0x3'));var moment=require(_0xe041('0x4'));var BPromise=require(_0xe041('0x5'));var rp=require(_0xe041('0x6'));var fs=require('fs');var path=require(_0xe041('0x7'));var rimraf=require(_0xe041('0x8'));var config=require(_0xe041('0x9'));var attributes=require('./interval.attributes');var extensions=require(_0xe041('0xa'));module[_0xe041('0xb')]=function(_0x44af5f,_0x5c8b1e){return _0x44af5f[_0xe041('0xc')](_0xe041('0xd'),attributes,{'tableName':_0xe041('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x576e38,_0x23a7b1){extensions[_0xe041('0xf')](_0x44af5f,_0x576e38);},'afterBulkCreate':function(_0x330a44,_0x1aeff8,_0xa7dd2a){_0xa7dd2a();extensions[_0xe041('0xf')](_0x44af5f,_0x330a44[0x0]);},'afterUpdate':function(_0x57ce26,_0x4bb76e){extensions[_0xe041('0xf')](_0x44af5f,_0x57ce26);},'afterDestroy':function(_0x556b50,_0x258a75){extensions['rewrite'](_0x44af5f,_0x556b50);}}});}; \ No newline at end of file +var _0x54ad=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define','Interval','tools_intervals','rewrite'];(function(_0x4eb0c1,_0x400e3d){var _0x27250e=function(_0x4d8bda){while(--_0x4d8bda){_0x4eb0c1['push'](_0x4eb0c1['shift']());}};_0x27250e(++_0x400e3d);}(_0x54ad,0xf0));var _0xd54a=function(_0x126d93,_0x171bc7){_0x126d93=_0x126d93-0x0;var _0x8f869a=_0x54ad[_0x126d93];return _0x8f869a;};'use strict';var _=require(_0xd54a('0x0'));var util=require(_0xd54a('0x1'));var logger=require(_0xd54a('0x2'))(_0xd54a('0x3'));var moment=require(_0xd54a('0x4'));var BPromise=require(_0xd54a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd54a('0x6'));var rimraf=require(_0xd54a('0x7'));var config=require(_0xd54a('0x8'));var attributes=require(_0xd54a('0x9'));var extensions=require(_0xd54a('0xa'));module[_0xd54a('0xb')]=function(_0xc5f599,_0x3f4cc5){return _0xc5f599[_0xd54a('0xc')](_0xd54a('0xd'),attributes,{'tableName':_0xd54a('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x411983,_0x342ecd){extensions['rewrite'](_0xc5f599,_0x411983);},'afterBulkCreate':function(_0x6766e0,_0x880a45,_0x2f8b83){_0x2f8b83();extensions['rewrite'](_0xc5f599,_0x6766e0[0x0]);},'afterUpdate':function(_0x2906d8,_0x5d6a56){extensions[_0xd54a('0xf')](_0xc5f599,_0x2906d8);},'afterDestroy':function(_0x172133,_0x3bbb0e){extensions[_0xd54a('0xf')](_0xc5f599,_0x172133);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 538c390..14370fa 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(_0xb301d4,_0x27ed18){var _0x3b5bde=function(_0x1fbc5f){while(--_0x1fbc5f){_0xb301d4['push'](_0xb301d4['shift']());}};_0x3b5bde(++_0x27ed18);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'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(_0x280ae7,_0x456fb1){var _0x418b9e=function(_0x4d730d){while(--_0x4d730d){_0x280ae7['push'](_0x280ae7['shift']());}};_0x418b9e(++_0x456fb1);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'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 85df365..2309753 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 _0x5f66=['send','exports','Router','./jira.controller','post','isAuthenticated'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0x5f66,0x1a0));var _0x65f6=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x5f66[_0x173441];return _0x2423a8;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);module[_0x65f6('0x5')]=router; \ No newline at end of file +var _0x5f2f=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0x4955c3,_0x2c647d){var _0x172377=function(_0x3f3555){while(--_0x3f3555){_0x4955c3['push'](_0x4955c3['shift']());}};_0x172377(++_0x2c647d);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4376f6,_0x447752){_0x4376f6=_0x4376f6-0x0;var _0x391727=_0x5f2f[_0x4376f6];return _0x391727;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);module[_0xf5f2('0x7')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 8fc4cb1..268bfdd 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 _0x91bd=['customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','POST','application/json','Basic\x20','toString','base64','request','setEncoding','utf8','data','end','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','write','openIssue','body','headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','https','api','MOTGUI','summary','\x20from\x20','description','stringify','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken'];(function(_0x3ea454,_0x2e63b0){var _0x1a4c00=function(_0x19eede){while(--_0x19eede){_0x3ea454['push'](_0x3ea454['shift']());}};_0x1a4c00(++_0x2e63b0);}(_0x91bd,0x1b3));var _0xd91b=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0x91bd[_0x2adbeb];return _0x5e18a6;};'use strict';var BPromise=require(_0xd91b('0x0'));var https=require(_0xd91b('0x1'));var logger=require('../../config/logger')(_0xd91b('0x2'));var USERNAME='support';var PASSWORD='3eAmWpBVP0';function openIssue(_0x4c7f2b,_0x1427d8){var _0x542d63={'fields':{'project':{'key':_0x4c7f2b['key']||_0xd91b('0x3')},'summary':(_0x4c7f2b[_0xd91b('0x4')]||'Report')+_0xd91b('0x5')+_0x4c7f2b['ip'],'description':_0x4c7f2b[_0xd91b('0x6')]||JSON[_0xd91b('0x7')](_0x4c7f2b),'issuetype':{'name':_0x4c7f2b['issuetype']||'Bug'}}};_0x542d63[_0xd91b('0x8')][_0xd91b('0x9')]=_0x4c7f2b[_0xd91b('0xa')];_0x542d63[_0xd91b('0x8')][_0xd91b('0xb')]=_0x4c7f2b[_0xd91b('0xc')];_0x542d63[_0xd91b('0x8')][_0xd91b('0xd')]=_0x4c7f2b[_0xd91b('0xe')];_0x542d63[_0xd91b('0x8')][_0xd91b('0xf')]=_0x4c7f2b[_0xd91b('0x10')];_0x542d63[_0xd91b('0x8')][_0xd91b('0x11')]=_0x4c7f2b[_0xd91b('0x12')];_0x542d63[_0xd91b('0x8')][_0xd91b('0x13')]=_0x4c7f2b['ip'];var _0x4ceb2d={'host':_0xd91b('0x14'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0xd91b('0x15'),'timeout':0x4e20,'headers':{'Content-Type':_0xd91b('0x16'),'Authorization':_0xd91b('0x17')+new Buffer(USERNAME+':'+PASSWORD)[_0xd91b('0x18')](_0xd91b('0x19'))}};var _0x431b06=JSON[_0xd91b('0x7')](_0x542d63);var _0x515ff3=https[_0xd91b('0x1a')](_0x4ceb2d,function(_0x3d500b){_0x3d500b[_0xd91b('0x1b')](_0xd91b('0x1c'));var _0x4fd445='';_0x3d500b['on'](_0xd91b('0x1d'),function(_0x33d8ec){_0x4fd445+=_0x33d8ec;});_0x3d500b['on'](_0xd91b('0x1e'),function(){if(_0x1427d8){return _0x1427d8[_0xd91b('0x1f')](_0x3d500b[_0xd91b('0x20')])[_0xd91b('0x21')](JSON[_0xd91b('0x22')](_0x4fd445));}});});_0x515ff3['on'](_0xd91b('0x23'),function(_0xd4e1e8){if(_0x1427d8){return _0x1427d8['status'](0x1f4)['json']({'errors':[{'message':_0xd91b('0x24'),'type':'api.jira'}]});}});_0x515ff3[_0xd91b('0x25')](_0x431b06);_0x515ff3[_0xd91b('0x1e')]();}exports[_0xd91b('0x26')]=openIssue;exports['send']=function(_0x281f5e,_0xc35a3e){_0x281f5e[_0xd91b('0x27')]['ip']=_0x281f5e[_0xd91b('0x28')][_0xd91b('0x29')]||_0x281f5e[_0xd91b('0x2a')][_0xd91b('0x2b')]||_0x281f5e['socket']['remoteAddress']||_0x281f5e[_0xd91b('0x2a')][_0xd91b('0x2c')][_0xd91b('0x2b')];return openIssue(_0x281f5e[_0xd91b('0x27')],_0xc35a3e);}; \ No newline at end of file +var _0x8753=['/rest/api/2/issue','application/json','toString','base64','setEncoding','utf8','data','end','status','statusCode','json','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','body','x-forwarded-for','remoteAddress','connection','socket','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','description','issuetype','Bug','fields','customfield_11500','email','oldToken','newToken','customfield_11504','reason','customfield_10102','track.xcallymotion.com'];(function(_0x147da4,_0x2f1ef4){var _0x17d513=function(_0x39bfcb){while(--_0x39bfcb){_0x147da4['push'](_0x147da4['shift']());}};_0x17d513(++_0x2f1ef4);}(_0x8753,0xe6));var _0x3875=function(_0x3bc964,_0x47b300){_0x3bc964=_0x3bc964-0x0;var _0x47f293=_0x8753[_0x3bc964];return _0x47f293;};'use strict';var BPromise=require(_0x3875('0x0'));var https=require(_0x3875('0x1'));var logger=require(_0x3875('0x2'))(_0x3875('0x3'));var USERNAME=_0x3875('0x4');var PASSWORD=_0x3875('0x5');function openIssue(_0x5f0281,_0x1fdcfc){var _0x366fa3={'fields':{'project':{'key':_0x5f0281[_0x3875('0x6')]||_0x3875('0x7')},'summary':(_0x5f0281[_0x3875('0x8')]||_0x3875('0x9'))+'\x20from\x20'+_0x5f0281['ip'],'description':_0x5f0281[_0x3875('0xa')]||JSON['stringify'](_0x5f0281),'issuetype':{'name':_0x5f0281[_0x3875('0xb')]||_0x3875('0xc')}}};_0x366fa3[_0x3875('0xd')][_0x3875('0xe')]=_0x5f0281[_0x3875('0xf')];_0x366fa3[_0x3875('0xd')]['customfield_11501']=_0x5f0281[_0x3875('0x10')];_0x366fa3['fields']['customfield_11502']=_0x5f0281[_0x3875('0x11')];_0x366fa3['fields']['customfield_11503']=_0x5f0281['name'];_0x366fa3['fields'][_0x3875('0x12')]=_0x5f0281[_0x3875('0x13')];_0x366fa3[_0x3875('0xd')][_0x3875('0x14')]=_0x5f0281['ip'];var _0x1bd966={'host':_0x3875('0x15'),'port':0x1bb,'path':_0x3875('0x16'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0x3875('0x17'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x3875('0x18')](_0x3875('0x19'))}};var _0x4db0f0=JSON['stringify'](_0x366fa3);var _0x12e197=https['request'](_0x1bd966,function(_0x247833){_0x247833[_0x3875('0x1a')](_0x3875('0x1b'));var _0x29f591='';_0x247833['on'](_0x3875('0x1c'),function(_0x2b8dbf){_0x29f591+=_0x2b8dbf;});_0x247833['on'](_0x3875('0x1d'),function(){if(_0x1fdcfc){return _0x1fdcfc[_0x3875('0x1e')](_0x247833[_0x3875('0x1f')])[_0x3875('0x20')](JSON['parse'](_0x29f591));}});});_0x12e197['on'](_0x3875('0x21'),function(_0xf30a11){if(_0x1fdcfc){return _0x1fdcfc[_0x3875('0x1e')](0x1f4)[_0x3875('0x20')]({'errors':[{'message':_0x3875('0x22'),'type':_0x3875('0x23')}]});}});_0x12e197[_0x3875('0x24')](_0x4db0f0);_0x12e197['end']();}exports['openIssue']=openIssue;exports['send']=function(_0x30fd93,_0x2e0399){_0x30fd93[_0x3875('0x25')]['ip']=_0x30fd93['headers'][_0x3875('0x26')]||_0x30fd93['connection'][_0x3875('0x27')]||_0x30fd93['socket'][_0x3875('0x27')]||_0x30fd93[_0x3875('0x28')][_0x3875('0x29')][_0x3875('0x27')];return openIssue(_0x30fd93[_0x3875('0x25')],_0x2e0399);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 5cb3790..14b976e 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 _0x750a=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','exports','util','express','Router'];(function(_0x4b9cd5,_0x55aee4){var _0x58f242=function(_0x4ea72c){while(--_0x4ea72c){_0x4b9cd5['push'](_0x4b9cd5['shift']());}};_0x58f242(++_0x55aee4);}(_0x750a,0x140));var _0xa750=function(_0x527986,_0x3726f7){_0x527986=_0x527986-0x0;var _0x45abd9=_0x750a[_0x527986];return _0x45abd9;};'use strict';var multer=require('multer');var util=require(_0xa750('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa750('0x1'));var router=express[_0xa750('0x2')]();var fs_extra=require(_0xa750('0x3'));var auth=require(_0xa750('0x4'));var interaction=require(_0xa750('0x5'));var config=require(_0xa750('0x6'));var controller=require(_0xa750('0x7'));router[_0xa750('0x8')]('/',auth[_0xa750('0x9')](),controller[_0xa750('0xa')]);router[_0xa750('0x8')](_0xa750('0xb'),auth[_0xa750('0x9')](),controller['describe']);router['get'](_0xa750('0xc'),auth['isAuthenticated'](),controller[_0xa750('0xd')]);router[_0xa750('0xe')]('/',auth['isAuthenticated'](),controller[_0xa750('0xf')]);router[_0xa750('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xa750('0x11')]);router['delete'](_0xa750('0xc'),auth[_0xa750('0x9')](),controller['destroy']);module[_0xa750('0x12')]=router; \ No newline at end of file +var _0x55e0=['./jscriptyAnswerReport.controller','get','isAuthenticated','describe','/:id','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x590938,_0x4c31c1){var _0x300c23=function(_0x29301e){while(--_0x29301e){_0x590938['push'](_0x590938['shift']());}};_0x300c23(++_0x4c31c1);}(_0x55e0,0xdc));var _0x055e=function(_0x352cc7,_0x202916){_0x352cc7=_0x352cc7-0x0;var _0x2eb52b=_0x55e0[_0x352cc7];return _0x2eb52b;};'use strict';var multer=require(_0x055e('0x0'));var util=require(_0x055e('0x1'));var path=require(_0x055e('0x2'));var timeout=require(_0x055e('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x055e('0x4'));var auth=require(_0x055e('0x5'));var interaction=require(_0x055e('0x6'));var config=require(_0x055e('0x7'));var controller=require(_0x055e('0x8'));router[_0x055e('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x055e('0x9')]('/describe',auth[_0x055e('0xa')](),controller[_0x055e('0xb')]);router[_0x055e('0x9')](_0x055e('0xc'),auth[_0x055e('0xa')](),controller['show']);router[_0x055e('0xd')]('/',auth[_0x055e('0xa')](),controller[_0x055e('0xe')]);router[_0x055e('0xf')](_0x055e('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x055e('0x10')]('/:id',auth[_0x055e('0xa')](),controller[_0x055e('0x11')]);module[_0x055e('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index eed4f47..0adb926 100644 --- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js +++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x7a54,0x106));var _0x47a5=function(_0x1e88e9,_0x4d42bf){_0x1e88e9=_0x1e88e9-0x0;var _0x3edbda=_0x7a54[_0x1e88e9];return _0x3edbda;};'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(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x7a54,0x106));var _0x47a5=function(_0xaf7b2c,_0xbb9ac3){_0xaf7b2c=_0xaf7b2c-0x0;var _0x46c275=_0x7a54[_0xaf7b2c];return _0x46c275;};'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 7971694..76c6efc 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 _0xfc17=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','stack','name','index','JscriptyAnswerReport','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','rows','show','params','rawAttributes','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel'];(function(_0x219f28,_0x19bba4){var _0x202646=function(_0x36d924){while(--_0x36d924){_0x219f28['push'](_0x219f28['shift']());}};_0x202646(++_0x19bba4);}(_0xfc17,0x1b4));var _0x7fc1=function(_0x3d5260,_0x5dd5eb){_0x3d5260=_0x3d5260-0x0;var _0x24b423=_0xfc17[_0x3d5260];return _0x24b423;};'use strict';var emlformat=require(_0x7fc1('0x0'));var rimraf=require(_0x7fc1('0x1'));var zipdir=require(_0x7fc1('0x2'));var jsonpatch=require(_0x7fc1('0x3'));var rp=require('request-promise');var moment=require(_0x7fc1('0x4'));var BPromise=require(_0x7fc1('0x5'));var Mustache=require(_0x7fc1('0x6'));var util=require(_0x7fc1('0x7'));var path=require(_0x7fc1('0x8'));var sox=require(_0x7fc1('0x9'));var csv=require('to-csv');var ejs=require(_0x7fc1('0xa'));var fs=require('fs');var fs_extra=require(_0x7fc1('0xb'));var _=require(_0x7fc1('0xc'));var squel=require(_0x7fc1('0xd'));var crypto=require(_0x7fc1('0xe'));var jsforce=require(_0x7fc1('0xf'));var deskjs=require(_0x7fc1('0x10'));var toCsv=require('to-csv');var querystring=require(_0x7fc1('0x11'));var Papa=require(_0x7fc1('0x12'));var Redis=require(_0x7fc1('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x7fc1('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7fc1('0x15'))(_0x7fc1('0x16'));var utils=require(_0x7fc1('0x17'));var config=require(_0x7fc1('0x18'));var licenseUtil=require(_0x7fc1('0x19'));var db=require(_0x7fc1('0x1a'))['db'];function respondWithStatusCode(_0x53277f,_0x3a7c8e){_0x3a7c8e=_0x3a7c8e||0xcc;return function(_0x902325){if(_0x902325){return _0x53277f[_0x7fc1('0x1b')](_0x3a7c8e);}return _0x53277f[_0x7fc1('0x1c')](_0x3a7c8e)[_0x7fc1('0x1d')]();};}function respondWithResult(_0x5651f2,_0x54a204){_0x54a204=_0x54a204||0xc8;return function(_0x881462){if(_0x881462){return _0x5651f2[_0x7fc1('0x1c')](_0x54a204)[_0x7fc1('0x1e')](_0x881462);}};}function respondWithFilteredResult(_0x391de7,_0x432825){return function(_0x3c4671){if(_0x3c4671){var _0x3d8e82=typeof _0x432825[_0x7fc1('0x1f')]===_0x7fc1('0x20')&&typeof _0x432825[_0x7fc1('0x21')]==='undefined';var _0x419170=_0x3c4671['count'];var _0x30fc04=_0x3d8e82?0x0:_0x432825[_0x7fc1('0x1f')];var _0x535ae1=_0x3d8e82?_0x3c4671[_0x7fc1('0x22')]:_0x432825[_0x7fc1('0x1f')]+_0x432825['limit'];var _0x25d384;if(_0x535ae1>=_0x419170){_0x535ae1=_0x419170;_0x25d384=0xc8;}else{_0x25d384=0xce;}_0x391de7[_0x7fc1('0x1c')](_0x25d384);return _0x391de7[_0x7fc1('0x23')](_0x7fc1('0x24'),_0x30fc04+'-'+_0x535ae1+'/'+_0x419170)[_0x7fc1('0x1e')](_0x3c4671);}return null;};}function patchUpdates(_0x1c249d){return function(_0x3e7c92){try{jsonpatch[_0x7fc1('0x25')](_0x3e7c92,_0x1c249d,!![]);}catch(_0x327569){return BPromise[_0x7fc1('0x26')](_0x327569);}return _0x3e7c92['save']();};}function saveUpdates(_0x49a44f,_0x2390b8){return function(_0x5e10cd){if(_0x5e10cd){return _0x5e10cd[_0x7fc1('0x27')](_0x49a44f)[_0x7fc1('0x28')](function(_0x253ae9){return _0x253ae9;});}return null;};}function removeEntity(_0x3683f4,_0x56c5d6){return function(_0x38b5b5){if(_0x38b5b5){return _0x38b5b5[_0x7fc1('0x29')]()[_0x7fc1('0x28')](function(){_0x3683f4['status'](0xcc)[_0x7fc1('0x1d')]();});}};}function handleEntityNotFound(_0x252b18,_0x5ddc11){return function(_0x4b24d6){if(!_0x4b24d6){_0x252b18[_0x7fc1('0x1b')](0x194);}return _0x4b24d6;};}function handleError(_0x293a2a,_0x1f58ca){_0x1f58ca=_0x1f58ca||0x1f4;return function(_0x2ae7db){logger['error'](_0x2ae7db[_0x7fc1('0x2a')]);if(_0x2ae7db[_0x7fc1('0x2b')]){delete _0x2ae7db[_0x7fc1('0x2b')];}_0x293a2a[_0x7fc1('0x1c')](_0x1f58ca)['send'](_0x2ae7db);};}exports[_0x7fc1('0x2c')]=function(_0x583e60,_0x1f7fce){var _0x22a3c1={},_0x34ec70={},_0x231913={'count':0x0,'rows':[]};var _0x2317f5=_['map'](db[_0x7fc1('0x2d')]['rawAttributes'],function(_0x55b4f1){return{'name':_0x55b4f1[_0x7fc1('0x2e')],'type':_0x55b4f1[_0x7fc1('0x2f')][_0x7fc1('0x30')]};});_0x34ec70[_0x7fc1('0x31')]=_[_0x7fc1('0x32')](_0x2317f5,_0x7fc1('0x2b'));_0x34ec70[_0x7fc1('0x33')]=_[_0x7fc1('0x34')](_0x583e60[_0x7fc1('0x33')]);_0x34ec70[_0x7fc1('0x35')]=_[_0x7fc1('0x36')](_0x34ec70[_0x7fc1('0x31')],_0x34ec70[_0x7fc1('0x33')]);_0x22a3c1[_0x7fc1('0x37')]=_[_0x7fc1('0x36')](_0x34ec70[_0x7fc1('0x31')],qs['fields'](_0x583e60[_0x7fc1('0x33')][_0x7fc1('0x38')]));_0x22a3c1[_0x7fc1('0x37')]=_0x22a3c1[_0x7fc1('0x37')][_0x7fc1('0x39')]?_0x22a3c1[_0x7fc1('0x37')]:_0x34ec70['model'];if(!_0x583e60[_0x7fc1('0x33')][_0x7fc1('0x3a')]('nolimit')){_0x22a3c1[_0x7fc1('0x21')]=qs[_0x7fc1('0x21')](_0x583e60[_0x7fc1('0x33')][_0x7fc1('0x21')]);_0x22a3c1[_0x7fc1('0x1f')]=qs['offset'](_0x583e60['query'][_0x7fc1('0x1f')]);}_0x22a3c1[_0x7fc1('0x3b')]=qs[_0x7fc1('0x3c')](_0x583e60[_0x7fc1('0x33')][_0x7fc1('0x3c')]);_0x22a3c1[_0x7fc1('0x3d')]=qs[_0x7fc1('0x35')](_[_0x7fc1('0x3e')](_0x583e60['query'],_0x34ec70[_0x7fc1('0x35')]),_0x2317f5);if(_0x583e60[_0x7fc1('0x33')]['filter']){_0x22a3c1[_0x7fc1('0x3d')]=_[_0x7fc1('0x3f')](_0x22a3c1[_0x7fc1('0x3d')],{'$or':_['map'](_0x2317f5,function(_0x57ef4c){if(_0x57ef4c[_0x7fc1('0x2f')]!==_0x7fc1('0x40')){var _0xafc8b0={};_0xafc8b0[_0x57ef4c['name']]={'$like':'%'+_0x583e60['query']['filter']+'%'};return _0xafc8b0;}})});}_0x22a3c1=_[_0x7fc1('0x3f')]({},_0x22a3c1,_0x583e60[_0x7fc1('0x41')]);var _0x32607c={'where':_0x22a3c1[_0x7fc1('0x3d')]};return db['JscriptyAnswerReport']['count'](_0x32607c)[_0x7fc1('0x28')](function(_0xf26d98){_0x231913[_0x7fc1('0x22')]=_0xf26d98;if(_0x583e60['query']['includeAll']){_0x22a3c1['include']=[{'all':!![]}];}return db['JscriptyAnswerReport']['findAll'](_0x22a3c1);})[_0x7fc1('0x28')](function(_0x54749f){_0x231913[_0x7fc1('0x42')]=_0x54749f;return _0x231913;})[_0x7fc1('0x28')](respondWithFilteredResult(_0x1f7fce,_0x22a3c1))['catch'](handleError(_0x1f7fce,null));};exports[_0x7fc1('0x43')]=function(_0x16ad03,_0x111d51){var _0x3282dd={'raw':!![],'where':{'id':_0x16ad03[_0x7fc1('0x44')]['id']}},_0x56b853={};_0x56b853['model']=_[_0x7fc1('0x34')](db[_0x7fc1('0x2d')][_0x7fc1('0x45')]);_0x56b853[_0x7fc1('0x33')]=_['keys'](_0x16ad03[_0x7fc1('0x33')]);_0x56b853[_0x7fc1('0x35')]=_['intersection'](_0x56b853[_0x7fc1('0x31')],_0x56b853[_0x7fc1('0x33')]);_0x3282dd['attributes']=_[_0x7fc1('0x36')](_0x56b853[_0x7fc1('0x31')],qs['fields'](_0x16ad03[_0x7fc1('0x33')][_0x7fc1('0x38')]));_0x3282dd[_0x7fc1('0x37')]=_0x3282dd['attributes'][_0x7fc1('0x39')]?_0x3282dd[_0x7fc1('0x37')]:_0x56b853[_0x7fc1('0x31')];if(_0x16ad03[_0x7fc1('0x33')]['includeAll']){_0x3282dd['include']=[{'all':!![]}];}_0x3282dd=_[_0x7fc1('0x3f')]({},_0x3282dd,_0x16ad03[_0x7fc1('0x41')]);return db[_0x7fc1('0x2d')][_0x7fc1('0x46')](_0x3282dd)[_0x7fc1('0x28')](handleEntityNotFound(_0x111d51,null))[_0x7fc1('0x28')](respondWithResult(_0x111d51,null))[_0x7fc1('0x47')](handleError(_0x111d51,null));};exports[_0x7fc1('0x48')]=function(_0x419ea1,_0x4c4606){return db['JscriptyAnswerReport']['create'](_0x419ea1[_0x7fc1('0x49')],{})[_0x7fc1('0x28')](respondWithResult(_0x4c4606,0xc9))[_0x7fc1('0x47')](handleError(_0x4c4606,null));};exports[_0x7fc1('0x27')]=function(_0x4bcd63,_0xafd821){if(_0x4bcd63[_0x7fc1('0x49')]['id']){delete _0x4bcd63[_0x7fc1('0x49')]['id'];}return db[_0x7fc1('0x2d')]['find']({'where':{'id':_0x4bcd63[_0x7fc1('0x44')]['id']}})[_0x7fc1('0x28')](handleEntityNotFound(_0xafd821,null))[_0x7fc1('0x28')](saveUpdates(_0x4bcd63[_0x7fc1('0x49')],null))[_0x7fc1('0x28')](respondWithResult(_0xafd821,null))[_0x7fc1('0x47')](handleError(_0xafd821,null));};exports[_0x7fc1('0x29')]=function(_0x4d27db,_0x3d5f40){return db['JscriptyAnswerReport'][_0x7fc1('0x46')]({'where':{'id':_0x4d27db['params']['id']}})[_0x7fc1('0x28')](handleEntityNotFound(_0x3d5f40,null))[_0x7fc1('0x28')](removeEntity(_0x3d5f40,null))['catch'](handleError(_0x3d5f40,null));};exports[_0x7fc1('0x4a')]=function(_0x3b492a,_0x509959){return db[_0x7fc1('0x2d')][_0x7fc1('0x4a')]()[_0x7fc1('0x28')](respondWithResult(_0x509959,null))[_0x7fc1('0x47')](handleError(_0x509959,null));}; \ No newline at end of file +var _0xd5b2=['status','end','offset','limit','undefined','count','set','Content-Range','json','reject','save','update','then','stack','name','send','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','include','catch','show','params','fields','find','create','body','destroy','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','fs-extra','squel','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'];(function(_0x25c0e5,_0x328d11){var _0x3b3dfc=function(_0x31f526){while(--_0x31f526){_0x25c0e5['push'](_0x25c0e5['shift']());}};_0x3b3dfc(++_0x328d11);}(_0xd5b2,0x10e));var _0x2d5b=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xd5b2[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2d5b('0x0'));var zipdir=require(_0x2d5b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2d5b('0x2'));var moment=require(_0x2d5b('0x3'));var BPromise=require(_0x2d5b('0x4'));var Mustache=require(_0x2d5b('0x5'));var util=require(_0x2d5b('0x6'));var path=require(_0x2d5b('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2d5b('0x8'));var _=require('lodash');var squel=require(_0x2d5b('0x9'));var crypto=require('crypto');var jsforce=require(_0x2d5b('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x2d5b('0xb'));var querystring=require(_0x2d5b('0xc'));var Papa=require(_0x2d5b('0xd'));var Redis=require(_0x2d5b('0xe'));var authService=require(_0x2d5b('0xf'));var qs=require(_0x2d5b('0x10'));var as=require(_0x2d5b('0x11'));var hardwareService=require(_0x2d5b('0x12'));var logger=require(_0x2d5b('0x13'))(_0x2d5b('0x14'));var utils=require(_0x2d5b('0x15'));var config=require(_0x2d5b('0x16'));var licenseUtil=require(_0x2d5b('0x17'));var db=require(_0x2d5b('0x18'))['db'];function respondWithStatusCode(_0x594fad,_0x4a45b6){_0x4a45b6=_0x4a45b6||0xcc;return function(_0x327b75){if(_0x327b75){return _0x594fad[_0x2d5b('0x19')](_0x4a45b6);}return _0x594fad[_0x2d5b('0x1a')](_0x4a45b6)[_0x2d5b('0x1b')]();};}function respondWithResult(_0x40ec2c,_0x461969){_0x461969=_0x461969||0xc8;return function(_0x48d993){if(_0x48d993){return _0x40ec2c[_0x2d5b('0x1a')](_0x461969)['json'](_0x48d993);}};}function respondWithFilteredResult(_0x1a5624,_0x3ffe86){return function(_0x5e22bf){if(_0x5e22bf){var _0x1c5ee6=typeof _0x3ffe86[_0x2d5b('0x1c')]==='undefined'&&typeof _0x3ffe86[_0x2d5b('0x1d')]===_0x2d5b('0x1e');var _0x4cecb5=_0x5e22bf[_0x2d5b('0x1f')];var _0x2d4715=_0x1c5ee6?0x0:_0x3ffe86[_0x2d5b('0x1c')];var _0x8c32cc=_0x1c5ee6?_0x5e22bf[_0x2d5b('0x1f')]:_0x3ffe86[_0x2d5b('0x1c')]+_0x3ffe86[_0x2d5b('0x1d')];var _0x4f81db;if(_0x8c32cc>=_0x4cecb5){_0x8c32cc=_0x4cecb5;_0x4f81db=0xc8;}else{_0x4f81db=0xce;}_0x1a5624[_0x2d5b('0x1a')](_0x4f81db);return _0x1a5624[_0x2d5b('0x20')](_0x2d5b('0x21'),_0x2d4715+'-'+_0x8c32cc+'/'+_0x4cecb5)[_0x2d5b('0x22')](_0x5e22bf);}return null;};}function patchUpdates(_0x4a5201){return function(_0x13a713){try{jsonpatch['apply'](_0x13a713,_0x4a5201,!![]);}catch(_0xc3bd09){return BPromise[_0x2d5b('0x23')](_0xc3bd09);}return _0x13a713[_0x2d5b('0x24')]();};}function saveUpdates(_0x1f4902,_0x4521b3){return function(_0x52cd78){if(_0x52cd78){return _0x52cd78[_0x2d5b('0x25')](_0x1f4902)[_0x2d5b('0x26')](function(_0x5e93a5){return _0x5e93a5;});}return null;};}function removeEntity(_0x4e8372,_0x30336e){return function(_0x3089ac){if(_0x3089ac){return _0x3089ac['destroy']()['then'](function(){_0x4e8372[_0x2d5b('0x1a')](0xcc)[_0x2d5b('0x1b')]();});}};}function handleEntityNotFound(_0x52363c,_0x1cb328){return function(_0x1ce508){if(!_0x1ce508){_0x52363c[_0x2d5b('0x19')](0x194);}return _0x1ce508;};}function handleError(_0x110207,_0x365d82){_0x365d82=_0x365d82||0x1f4;return function(_0x51e47c){logger['error'](_0x51e47c[_0x2d5b('0x27')]);if(_0x51e47c[_0x2d5b('0x28')]){delete _0x51e47c[_0x2d5b('0x28')];}_0x110207[_0x2d5b('0x1a')](_0x365d82)[_0x2d5b('0x29')](_0x51e47c);};}exports['index']=function(_0x8e8fbc,_0x3a3966){var _0x3e30ae={},_0x2254d0={},_0x57a897={'count':0x0,'rows':[]};var _0x4c95ee=_[_0x2d5b('0x2a')](db[_0x2d5b('0x2b')][_0x2d5b('0x2c')],function(_0x19058e){return{'name':_0x19058e[_0x2d5b('0x2d')],'type':_0x19058e[_0x2d5b('0x2e')][_0x2d5b('0x2f')]};});_0x2254d0[_0x2d5b('0x30')]=_['map'](_0x4c95ee,_0x2d5b('0x28'));_0x2254d0['query']=_[_0x2d5b('0x31')](_0x8e8fbc[_0x2d5b('0x32')]);_0x2254d0['filters']=_[_0x2d5b('0x33')](_0x2254d0[_0x2d5b('0x30')],_0x2254d0[_0x2d5b('0x32')]);_0x3e30ae[_0x2d5b('0x34')]=_[_0x2d5b('0x33')](_0x2254d0[_0x2d5b('0x30')],qs['fields'](_0x8e8fbc[_0x2d5b('0x32')]['fields']));_0x3e30ae['attributes']=_0x3e30ae['attributes'][_0x2d5b('0x35')]?_0x3e30ae[_0x2d5b('0x34')]:_0x2254d0[_0x2d5b('0x30')];if(!_0x8e8fbc[_0x2d5b('0x32')][_0x2d5b('0x36')](_0x2d5b('0x37'))){_0x3e30ae[_0x2d5b('0x1d')]=qs['limit'](_0x8e8fbc['query'][_0x2d5b('0x1d')]);_0x3e30ae[_0x2d5b('0x1c')]=qs[_0x2d5b('0x1c')](_0x8e8fbc['query'][_0x2d5b('0x1c')]);}_0x3e30ae[_0x2d5b('0x38')]=qs['sort'](_0x8e8fbc[_0x2d5b('0x32')][_0x2d5b('0x39')]);_0x3e30ae[_0x2d5b('0x3a')]=qs[_0x2d5b('0x3b')](_['pick'](_0x8e8fbc['query'],_0x2254d0[_0x2d5b('0x3b')]),_0x4c95ee);if(_0x8e8fbc['query'][_0x2d5b('0x3c')]){_0x3e30ae[_0x2d5b('0x3a')]=_[_0x2d5b('0x3d')](_0x3e30ae[_0x2d5b('0x3a')],{'$or':_[_0x2d5b('0x2a')](_0x4c95ee,function(_0x292d02){if(_0x292d02[_0x2d5b('0x2e')]!==_0x2d5b('0x3e')){var _0x24b0e7={};_0x24b0e7[_0x292d02['name']]={'$like':'%'+_0x8e8fbc[_0x2d5b('0x32')]['filter']+'%'};return _0x24b0e7;}})});}_0x3e30ae=_[_0x2d5b('0x3d')]({},_0x3e30ae,_0x8e8fbc[_0x2d5b('0x3f')]);var _0x3bc415={'where':_0x3e30ae[_0x2d5b('0x3a')]};return db[_0x2d5b('0x2b')][_0x2d5b('0x1f')](_0x3bc415)[_0x2d5b('0x26')](function(_0xa324c4){_0x57a897[_0x2d5b('0x1f')]=_0xa324c4;if(_0x8e8fbc[_0x2d5b('0x32')]['includeAll']){_0x3e30ae[_0x2d5b('0x40')]=[{'all':!![]}];}return db[_0x2d5b('0x2b')]['findAll'](_0x3e30ae);})[_0x2d5b('0x26')](function(_0x28302e){_0x57a897['rows']=_0x28302e;return _0x57a897;})[_0x2d5b('0x26')](respondWithFilteredResult(_0x3a3966,_0x3e30ae))[_0x2d5b('0x41')](handleError(_0x3a3966,null));};exports[_0x2d5b('0x42')]=function(_0x3aa43d,_0x39786b){var _0x1187ca={'raw':!![],'where':{'id':_0x3aa43d[_0x2d5b('0x43')]['id']}},_0x4129c8={};_0x4129c8['model']=_[_0x2d5b('0x31')](db[_0x2d5b('0x2b')]['rawAttributes']);_0x4129c8[_0x2d5b('0x32')]=_[_0x2d5b('0x31')](_0x3aa43d[_0x2d5b('0x32')]);_0x4129c8['filters']=_[_0x2d5b('0x33')](_0x4129c8[_0x2d5b('0x30')],_0x4129c8[_0x2d5b('0x32')]);_0x1187ca[_0x2d5b('0x34')]=_['intersection'](_0x4129c8[_0x2d5b('0x30')],qs['fields'](_0x3aa43d['query'][_0x2d5b('0x44')]));_0x1187ca[_0x2d5b('0x34')]=_0x1187ca[_0x2d5b('0x34')]['length']?_0x1187ca[_0x2d5b('0x34')]:_0x4129c8['model'];if(_0x3aa43d[_0x2d5b('0x32')]['includeAll']){_0x1187ca[_0x2d5b('0x40')]=[{'all':!![]}];}_0x1187ca=_[_0x2d5b('0x3d')]({},_0x1187ca,_0x3aa43d[_0x2d5b('0x3f')]);return db[_0x2d5b('0x2b')][_0x2d5b('0x45')](_0x1187ca)[_0x2d5b('0x26')](handleEntityNotFound(_0x39786b,null))[_0x2d5b('0x26')](respondWithResult(_0x39786b,null))['catch'](handleError(_0x39786b,null));};exports[_0x2d5b('0x46')]=function(_0x157262,_0x35d1d6){return db[_0x2d5b('0x2b')][_0x2d5b('0x46')](_0x157262[_0x2d5b('0x47')],{})[_0x2d5b('0x26')](respondWithResult(_0x35d1d6,0xc9))[_0x2d5b('0x41')](handleError(_0x35d1d6,null));};exports[_0x2d5b('0x25')]=function(_0x5a5d28,_0x40ee6b){if(_0x5a5d28[_0x2d5b('0x47')]['id']){delete _0x5a5d28[_0x2d5b('0x47')]['id'];}return db[_0x2d5b('0x2b')]['find']({'where':{'id':_0x5a5d28[_0x2d5b('0x43')]['id']}})[_0x2d5b('0x26')](handleEntityNotFound(_0x40ee6b,null))['then'](saveUpdates(_0x5a5d28['body'],null))[_0x2d5b('0x26')](respondWithResult(_0x40ee6b,null))[_0x2d5b('0x41')](handleError(_0x40ee6b,null));};exports[_0x2d5b('0x48')]=function(_0x325f07,_0x4d246e){return db[_0x2d5b('0x2b')]['find']({'where':{'id':_0x325f07['params']['id']}})[_0x2d5b('0x26')](handleEntityNotFound(_0x4d246e,null))[_0x2d5b('0x26')](removeEntity(_0x4d246e,null))[_0x2d5b('0x41')](handleError(_0x4d246e,null));};exports[_0x2d5b('0x49')]=function(_0x5b6dd2,_0xa8f865){return db[_0x2d5b('0x2b')][_0x2d5b('0x49')]()['then'](respondWithResult(_0xa8f865,null))[_0x2d5b('0x41')](handleError(_0xa8f865,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index aef4f9e..6fe8c24 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 _0x1768=['path','rimraf','../../config/environment','exports','JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','api','moment'];(function(_0x4f9617,_0x16a10a){var _0x55b7d0=function(_0x43824a){while(--_0x43824a){_0x4f9617['push'](_0x4f9617['shift']());}};_0x55b7d0(++_0x16a10a);}(_0x1768,0xf8));var _0x8176=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x1768[_0x12fc8d];return _0x3f9d04;};'use strict';var _=require(_0x8176('0x0'));var util=require(_0x8176('0x1'));var logger=require(_0x8176('0x2'))(_0x8176('0x3'));var moment=require(_0x8176('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8176('0x5'));var rimraf=require(_0x8176('0x6'));var config=require(_0x8176('0x7'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0x8176('0x8')]=function(_0x3ca651,_0xedf805){return _0x3ca651['define'](_0x8176('0x9'),attributes,{'tableName':_0x8176('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc9a8=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','report_jscripty_answers','lodash'];(function(_0xbc1a4b,_0x4dfbe4){var _0x108b87=function(_0x409062){while(--_0x409062){_0xbc1a4b['push'](_0xbc1a4b['shift']());}};_0x108b87(++_0x4dfbe4);}(_0xc9a8,0x133));var _0x8c9a=function(_0x26b622,_0x237e9e){_0x26b622=_0x26b622-0x0;var _0x58a028=_0xc9a8[_0x26b622];return _0x58a028;};'use strict';var _=require(_0x8c9a('0x0'));var util=require('util');var logger=require(_0x8c9a('0x1'))(_0x8c9a('0x2'));var moment=require('moment');var BPromise=require(_0x8c9a('0x3'));var rp=require(_0x8c9a('0x4'));var fs=require('fs');var path=require(_0x8c9a('0x5'));var rimraf=require(_0x8c9a('0x6'));var config=require(_0x8c9a('0x7'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0x8c9a('0x8')]=function(_0x56337e,_0x3353c8){return _0x56337e[_0x8c9a('0x9')]('JscriptyAnswerReport',attributes,{'tableName':_0x8c9a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index 79248e4..f2aec61 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 _0xdb6d=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','JscriptyAnswerReport,\x20%s,\x20%s','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash','util','moment','bluebird'];(function(_0x7d5b1b,_0x20e692){var _0x51988c=function(_0x4b8e77){while(--_0x4b8e77){_0x7d5b1b['push'](_0x7d5b1b['shift']());}};_0x51988c(++_0x20e692);}(_0xdb6d,0xe6));var _0xddb6=function(_0x352f6b,_0x368cf0){_0x352f6b=_0x352f6b-0x0;var _0x10df19=_0xdb6d[_0x352f6b];return _0x10df19;};'use strict';var _=require(_0xddb6('0x0'));var util=require(_0xddb6('0x1'));var moment=require(_0xddb6('0x2'));var BPromise=require(_0xddb6('0x3'));var rs=require(_0xddb6('0x4'));var fs=require('fs');var Redis=require(_0xddb6('0x5'));var db=require(_0xddb6('0x6'))['db'];var utils=require(_0xddb6('0x7'));var logger=require(_0xddb6('0x8'))(_0xddb6('0x9'));var config=require(_0xddb6('0xa'));var jayson=require(_0xddb6('0xb'));var client=jayson[_0xddb6('0xc')][_0xddb6('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xa3bed3,_0x22925f,_0x385b5d){return new BPromise(function(_0xb40652,_0x387bbc){return client[_0xddb6('0xe')](_0xa3bed3,_0x385b5d)[_0xddb6('0xf')](function(_0x244585){logger['info'](_0xddb6('0x10'),_0x22925f,'request\x20sent');logger[_0xddb6('0x11')](_0xddb6('0x12'),_0x22925f,_0xddb6('0x13'),JSON[_0xddb6('0x14')](_0x244585));if(_0x244585[_0xddb6('0x15')]){if(_0x244585[_0xddb6('0x15')]['code']===0x1f4){logger[_0xddb6('0x15')](_0xddb6('0x10'),_0x22925f,_0x244585[_0xddb6('0x15')][_0xddb6('0x16')]);return _0x387bbc(_0x244585['error'][_0xddb6('0x16')]);}logger[_0xddb6('0x15')](_0xddb6('0x10'),_0x22925f,_0x244585['error'][_0xddb6('0x16')]);return _0xb40652(_0x244585[_0xddb6('0x15')][_0xddb6('0x16')]);}else{logger[_0xddb6('0x17')](_0xddb6('0x10'),_0x22925f,_0xddb6('0x13'));_0xb40652(_0x244585[_0xddb6('0x18')][_0xddb6('0x16')]);}})[_0xddb6('0x19')](function(_0x440658){logger[_0xddb6('0x15')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x22925f,_0x440658);_0x387bbc(_0x440658);});});} \ No newline at end of file +var _0x5887=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x12d573,_0x20ae28){var _0x5c7071=function(_0x16ea02){while(--_0x16ea02){_0x12d573['push'](_0x12d573['shift']());}};_0x5c7071(++_0x20ae28);}(_0x5887,0x1d5));var _0x7588=function(_0x321575,_0x458292){_0x321575=_0x321575-0x0;var _0x147fc3=_0x5887[_0x321575];return _0x147fc3;};'use strict';var _=require(_0x7588('0x0'));var util=require(_0x7588('0x1'));var moment=require(_0x7588('0x2'));var BPromise=require(_0x7588('0x3'));var rs=require(_0x7588('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7588('0x5'))['db'];var utils=require(_0x7588('0x6'));var logger=require(_0x7588('0x7'))(_0x7588('0x8'));var config=require(_0x7588('0x9'));var jayson=require(_0x7588('0xa'));var client=jayson[_0x7588('0xb')][_0x7588('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2b3e72,_0x41e559,_0x1498b4){return new BPromise(function(_0x1172df,_0x3bf04f){return client[_0x7588('0xd')](_0x2b3e72,_0x1498b4)[_0x7588('0xe')](function(_0x3034c6){logger[_0x7588('0xf')](_0x7588('0x10'),_0x41e559,_0x7588('0x11'));logger[_0x7588('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x41e559,_0x7588('0x11'),JSON[_0x7588('0x13')](_0x3034c6));if(_0x3034c6[_0x7588('0x14')]){if(_0x3034c6[_0x7588('0x14')][_0x7588('0x15')]===0x1f4){logger[_0x7588('0x14')](_0x7588('0x10'),_0x41e559,_0x3034c6[_0x7588('0x14')]['message']);return _0x3bf04f(_0x3034c6[_0x7588('0x14')]['message']);}logger[_0x7588('0x14')](_0x7588('0x10'),_0x41e559,_0x3034c6[_0x7588('0x14')]['message']);return _0x1172df(_0x3034c6[_0x7588('0x14')][_0x7588('0x16')]);}else{logger[_0x7588('0xf')](_0x7588('0x10'),_0x41e559,_0x7588('0x11'));_0x1172df(_0x3034c6[_0x7588('0x17')][_0x7588('0x16')]);}})[_0x7588('0x18')](function(_0x2906e5){logger[_0x7588('0x14')](_0x7588('0x10'),_0x41e559,_0x2906e5);_0x3bf04f(_0x2906e5);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index c898a63..60d7b3f 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 _0x786e=['getSummary','post','create','/:id/clone','clone','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','isAuthenticated','index','get','/:id','show','getSessions','/:id/answers','getAnswers','/:id/summary'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x786e,0x1d4));var _0xe786=function(_0x38e870,_0x3d2e6a){_0x38e870=_0x38e870-0x0;var _0x2dabbe=_0x786e[_0x38e870];return _0x2dabbe;};'use strict';var multer=require(_0xe786('0x0'));var util=require(_0xe786('0x1'));var path=require('path');var timeout=require(_0xe786('0x2'));var express=require(_0xe786('0x3'));var router=express[_0xe786('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe786('0x5'));var interaction=require(_0xe786('0x6'));var config=require(_0xe786('0x7'));var controller=require(_0xe786('0x8'));router['get']('/',auth[_0xe786('0x9')](),controller[_0xe786('0xa')]);router[_0xe786('0xb')](_0xe786('0xc'),auth[_0xe786('0x9')](),controller[_0xe786('0xd')]);router[_0xe786('0xb')]('/:id/sessions',auth[_0xe786('0x9')](),controller[_0xe786('0xe')]);router[_0xe786('0xb')](_0xe786('0xf'),auth['isAuthenticated'](),controller[_0xe786('0x10')]);router['get'](_0xe786('0x11'),auth[_0xe786('0x9')](),timeout('30s'),controller[_0xe786('0x12')]);router[_0xe786('0x13')]('/',auth['isAuthenticated'](),controller[_0xe786('0x14')]);router['post'](_0xe786('0x15'),auth[_0xe786('0x9')](),controller[_0xe786('0x16')]);router[_0xe786('0x17')]('/:id',auth[_0xe786('0x9')](),controller['update']);router[_0xe786('0x18')](_0xe786('0xc'),auth['isAuthenticated'](),controller[_0xe786('0x19')]);module[_0xe786('0x1a')]=router; \ No newline at end of file +var _0x4f78=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','show','/:id/sessions','/:id/answers','getAnswers','30s','getSummary','create','/:id/clone','clone','put','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x102ff9,_0x907658){var _0x24fa97=function(_0x3622ff){while(--_0x3622ff){_0x102ff9['push'](_0x102ff9['shift']());}};_0x24fa97(++_0x907658);}(_0x4f78,0x132));var _0x84f7=function(_0x2a972c,_0x2f8026){_0x2a972c=_0x2a972c-0x0;var _0xc3c903=_0x4f78[_0x2a972c];return _0xc3c903;};'use strict';var multer=require(_0x84f7('0x0'));var util=require(_0x84f7('0x1'));var path=require(_0x84f7('0x2'));var timeout=require(_0x84f7('0x3'));var express=require(_0x84f7('0x4'));var router=express[_0x84f7('0x5')]();var fs_extra=require(_0x84f7('0x6'));var auth=require(_0x84f7('0x7'));var interaction=require(_0x84f7('0x8'));var config=require(_0x84f7('0x9'));var controller=require(_0x84f7('0xa'));router[_0x84f7('0xb')]('/',auth[_0x84f7('0xc')](),controller['index']);router[_0x84f7('0xb')]('/:id',auth[_0x84f7('0xc')](),controller[_0x84f7('0xd')]);router[_0x84f7('0xb')](_0x84f7('0xe'),auth[_0x84f7('0xc')](),controller['getSessions']);router[_0x84f7('0xb')](_0x84f7('0xf'),auth[_0x84f7('0xc')](),controller[_0x84f7('0x10')]);router[_0x84f7('0xb')]('/:id/summary',auth['isAuthenticated'](),timeout(_0x84f7('0x11')),controller[_0x84f7('0x12')]);router['post']('/',auth[_0x84f7('0xc')](),controller[_0x84f7('0x13')]);router['post'](_0x84f7('0x14'),auth[_0x84f7('0xc')](),controller[_0x84f7('0x15')]);router[_0x84f7('0x16')](_0x84f7('0x17'),auth[_0x84f7('0xc')](),controller['update']);router['delete'](_0x84f7('0x17'),auth[_0x84f7('0xc')](),controller[_0x84f7('0x18')]);module[_0x84f7('0x19')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index a8eb509..d840655 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 _0xcf46=['lodash','util','exports','STRING','TEXT','isObjectLike','setDataValue','stringify','isString','formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','name','BOOLEAN','sequelize'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xcf46,0xaf));var _0x6cf4=function(_0x34db39,_0x10c78c){_0x34db39=_0x34db39-0x0;var _0x140567=_0xcf46[_0x34db39];return _0x140567;};'use strict';var Sequelize=require(_0x6cf4('0x0'));var _=require(_0x6cf4('0x1'));var util=require(_0x6cf4('0x2'));module[_0x6cf4('0x3')]={'name':{'type':Sequelize[_0x6cf4('0x4')],'unique':'name'},'description':{'type':Sequelize[_0x6cf4('0x4')]},'formData':{'type':Sequelize[_0x6cf4('0x5')]('long'),'set':function(_0x353dad){if(_[_0x6cf4('0x6')](_0x353dad)){this[_0x6cf4('0x7')]('formData',JSON[_0x6cf4('0x8')](_0x353dad));}else if(_[_0x6cf4('0x9')](_0x353dad)){this[_0x6cf4('0x7')](_0x6cf4('0xa'),_0x353dad);}else{this[_0x6cf4('0x7')](_0x6cf4('0xa'),util[_0x6cf4('0xb')](_0x6cf4('0xc'),this[_0x6cf4('0xd')](_0x6cf4('0xe'))||'',this[_0x6cf4('0xd')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x6cf4('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x6cf4('0xf')],'defaultValue':![]}}; \ No newline at end of file +var _0xdfab=['getDataValue','BOOLEAN','lodash','util','name','STRING','TEXT','isObjectLike','formData','stringify','isString','setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}'];(function(_0x175a55,_0x4082fd){var _0x167adf=function(_0x18ef07){while(--_0x18ef07){_0x175a55['push'](_0x175a55['shift']());}};_0x167adf(++_0x4082fd);}(_0xdfab,0x80));var _0xbdfa=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0xdfab[_0x24f31b];return _0x488401;};'use strict';var Sequelize=require('sequelize');var _=require(_0xbdfa('0x0'));var util=require(_0xbdfa('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xbdfa('0x2')},'description':{'type':Sequelize[_0xbdfa('0x3')]},'formData':{'type':Sequelize[_0xbdfa('0x4')]('long'),'set':function(_0x3e959e){if(_[_0xbdfa('0x5')](_0x3e959e)){this['setDataValue'](_0xbdfa('0x6'),JSON[_0xbdfa('0x7')](_0x3e959e));}else if(_[_0xbdfa('0x8')](_0x3e959e)){this[_0xbdfa('0x9')](_0xbdfa('0x6'),_0x3e959e);}else{this[_0xbdfa('0x9')](_0xbdfa('0x6'),util[_0xbdfa('0xa')](_0xbdfa('0xb'),this[_0xbdfa('0xc')](_0xbdfa('0x2'))||'',this[_0xbdfa('0xc')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xbdfa('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xbdfa('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 dac1be9..dcdc0af 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 _0x0699=['text/csv','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','apply','reject','save','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','options','count','include','catch','show','params','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Projects','UserProfileSection','autoAssociation','clone','omit','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','JscriptySessionReport','nolimit','findAll','rows','getAnswers','findOne','JscriptyAnswerReport','pick','ProjectId','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','questionId','question','YYYY-MM-DD\x20HH:mm:ss','answer','push','isEmpty','now','writeFileSync','format','setHeader'];(function(_0x27ff8d,_0x57f86c){var _0x15a95b=function(_0x2e591c){while(--_0x2e591c){_0x27ff8d['push'](_0x27ff8d['shift']());}};_0x15a95b(++_0x57f86c);}(_0x0699,0x1db));var _0x9069=function(_0x5ac348,_0x13d18c){_0x5ac348=_0x5ac348-0x0;var _0x4a490c=_0x0699[_0x5ac348];return _0x4a490c;};'use strict';var emlformat=require(_0x9069('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9069('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9069('0x2'));var moment=require(_0x9069('0x3'));var BPromise=require(_0x9069('0x4'));var Mustache=require(_0x9069('0x5'));var util=require('util');var path=require(_0x9069('0x6'));var sox=require(_0x9069('0x7'));var csv=require(_0x9069('0x8'));var ejs=require(_0x9069('0x9'));var fs=require('fs');var fs_extra=require(_0x9069('0xa'));var _=require(_0x9069('0xb'));var squel=require(_0x9069('0xc'));var crypto=require(_0x9069('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9069('0x8'));var querystring=require(_0x9069('0xe'));var Papa=require(_0x9069('0xf'));var Redis=require(_0x9069('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9069('0x11'));var as=require(_0x9069('0x12'));var hardwareService=require(_0x9069('0x13'));var logger=require(_0x9069('0x14'))(_0x9069('0x15'));var utils=require(_0x9069('0x16'));var config=require(_0x9069('0x17'));var licenseUtil=require(_0x9069('0x18'));var db=require(_0x9069('0x19'))['db'];function respondWithStatusCode(_0x5d47ae,_0x46537d){_0x46537d=_0x46537d||0xcc;return function(_0x195996){if(_0x195996){return _0x5d47ae['sendStatus'](_0x46537d);}return _0x5d47ae[_0x9069('0x1a')](_0x46537d)[_0x9069('0x1b')]();};}function respondWithResult(_0xef9ddc,_0x41fe2c){_0x41fe2c=_0x41fe2c||0xc8;return function(_0x505c57){if(_0x505c57){return _0xef9ddc['status'](_0x41fe2c)[_0x9069('0x1c')](_0x505c57);}};}function respondWithFilteredResult(_0x596ea0,_0x3a23ce){return function(_0x3118ec){if(_0x3118ec){var _0x1864bc=typeof _0x3a23ce['offset']===_0x9069('0x1d')&&typeof _0x3a23ce[_0x9069('0x1e')]===_0x9069('0x1d');var _0x147788=_0x3118ec['count'];var _0x346b07=_0x1864bc?0x0:_0x3a23ce[_0x9069('0x1f')];var _0xb2bc45=_0x1864bc?_0x3118ec['count']:_0x3a23ce[_0x9069('0x1f')]+_0x3a23ce['limit'];var _0x28637c;if(_0xb2bc45>=_0x147788){_0xb2bc45=_0x147788;_0x28637c=0xc8;}else{_0x28637c=0xce;}_0x596ea0[_0x9069('0x1a')](_0x28637c);return _0x596ea0['set']('Content-Range',_0x346b07+'-'+_0xb2bc45+'/'+_0x147788)[_0x9069('0x1c')](_0x3118ec);}return null;};}function patchUpdates(_0x5d805a){return function(_0x574275){try{jsonpatch[_0x9069('0x20')](_0x574275,_0x5d805a,!![]);}catch(_0x2d0d91){return BPromise[_0x9069('0x21')](_0x2d0d91);}return _0x574275[_0x9069('0x22')]();};}function saveUpdates(_0x372875,_0x45157e){return function(_0xfc92e7){if(_0xfc92e7){return _0xfc92e7['update'](_0x372875)[_0x9069('0x23')](function(_0x2300e9){return _0x2300e9;});}return null;};}function removeEntity(_0x56de68,_0x326ba4){return function(_0x4b7d9e){if(_0x4b7d9e){return _0x4b7d9e[_0x9069('0x24')]()[_0x9069('0x23')](function(){var _0xc72b88=_0x4b7d9e[_0x9069('0x25')]({'plain':!![]});var _0x2a8f86='Projects';return db[_0x9069('0x26')][_0x9069('0x24')]({'where':{'type':_0x2a8f86,'resourceId':_0xc72b88['id']}})['then'](function(){return _0x4b7d9e;});})[_0x9069('0x23')](function(){_0x56de68['status'](0xcc)[_0x9069('0x1b')]();});}};}function handleEntityNotFound(_0x380c7e,_0x52a107){return function(_0x5dcdaa){if(!_0x5dcdaa){_0x380c7e[_0x9069('0x27')](0x194);}return _0x5dcdaa;};}function handleError(_0x2728b4,_0x327613){_0x327613=_0x327613||0x1f4;return function(_0x13d226){logger[_0x9069('0x28')](_0x13d226[_0x9069('0x29')]);if(_0x13d226[_0x9069('0x2a')]){delete _0x13d226[_0x9069('0x2a')];}_0x2728b4[_0x9069('0x1a')](_0x327613)[_0x9069('0x2b')](_0x13d226);};}exports[_0x9069('0x2c')]=function(_0x5d3155,_0x13c769){var _0x51591f={},_0x1dee34={},_0x935844={'count':0x0,'rows':[]};var _0x4b84cb=_[_0x9069('0x2d')](db[_0x9069('0x2e')][_0x9069('0x2f')],function(_0x1220de){return{'name':_0x1220de[_0x9069('0x30')],'type':_0x1220de[_0x9069('0x31')][_0x9069('0x32')]};});_0x1dee34[_0x9069('0x33')]=_[_0x9069('0x2d')](_0x4b84cb,_0x9069('0x2a'));_0x1dee34['query']=_[_0x9069('0x34')](_0x5d3155[_0x9069('0x35')]);_0x1dee34['filters']=_[_0x9069('0x36')](_0x1dee34['model'],_0x1dee34['query']);_0x51591f[_0x9069('0x37')]=_[_0x9069('0x36')](_0x1dee34[_0x9069('0x33')],qs[_0x9069('0x38')](_0x5d3155[_0x9069('0x35')]['fields']));_0x51591f['attributes']=_0x51591f[_0x9069('0x37')][_0x9069('0x39')]?_0x51591f[_0x9069('0x37')]:_0x1dee34['model'];if(!_0x5d3155[_0x9069('0x35')][_0x9069('0x3a')]('nolimit')){_0x51591f[_0x9069('0x1e')]=qs['limit'](_0x5d3155[_0x9069('0x35')][_0x9069('0x1e')]);_0x51591f[_0x9069('0x1f')]=qs['offset'](_0x5d3155[_0x9069('0x35')]['offset']);}_0x51591f[_0x9069('0x3b')]=qs[_0x9069('0x3c')](_0x5d3155[_0x9069('0x35')]['sort']);_0x51591f[_0x9069('0x3d')]=qs[_0x9069('0x3e')](_['pick'](_0x5d3155['query'],_0x1dee34[_0x9069('0x3e')]),_0x4b84cb);if(_0x5d3155[_0x9069('0x35')][_0x9069('0x3f')]){_0x51591f[_0x9069('0x3d')]=_[_0x9069('0x40')](_0x51591f[_0x9069('0x3d')],{'$or':_[_0x9069('0x2d')](_0x4b84cb,function(_0x4b2e9b){if(_0x4b2e9b[_0x9069('0x31')]!=='VIRTUAL'){var _0x3800de={};_0x3800de[_0x4b2e9b[_0x9069('0x2a')]]={'$like':'%'+_0x5d3155[_0x9069('0x35')][_0x9069('0x3f')]+'%'};return _0x3800de;}})});}_0x51591f=_[_0x9069('0x40')]({},_0x51591f,_0x5d3155[_0x9069('0x41')]);var _0x5e7a31={'where':_0x51591f['where']};return db[_0x9069('0x2e')][_0x9069('0x42')](_0x5e7a31)[_0x9069('0x23')](function(_0x58e082){_0x935844[_0x9069('0x42')]=_0x58e082;if(_0x5d3155['query']['includeAll']){_0x51591f[_0x9069('0x43')]=[{'all':!![]}];}return db[_0x9069('0x2e')]['findAll'](_0x51591f);})['then'](function(_0x4ff4b9){_0x935844['rows']=_0x4ff4b9;return _0x935844;})[_0x9069('0x23')](respondWithFilteredResult(_0x13c769,_0x51591f))[_0x9069('0x44')](handleError(_0x13c769,null));};exports[_0x9069('0x45')]=function(_0x2313a8,_0x5948f4){var _0x5ba8bd={'raw':![],'where':{'id':_0x2313a8[_0x9069('0x46')]['id']}},_0x275ba2={};_0x275ba2[_0x9069('0x33')]=_['keys'](db['JscriptyProject']['rawAttributes']);_0x275ba2[_0x9069('0x35')]=_[_0x9069('0x34')](_0x2313a8['query']);_0x275ba2[_0x9069('0x3e')]=_[_0x9069('0x36')](_0x275ba2[_0x9069('0x33')],_0x275ba2[_0x9069('0x35')]);_0x5ba8bd[_0x9069('0x37')]=_['intersection'](_0x275ba2['model'],qs[_0x9069('0x38')](_0x2313a8[_0x9069('0x35')][_0x9069('0x38')]));_0x5ba8bd[_0x9069('0x37')]=_0x5ba8bd['attributes'][_0x9069('0x39')]?_0x5ba8bd[_0x9069('0x37')]:_0x275ba2[_0x9069('0x33')];if(_0x2313a8['query'][_0x9069('0x47')]){_0x5ba8bd[_0x9069('0x43')]=[{'all':!![]}];}_0x5ba8bd=_[_0x9069('0x40')]({},_0x5ba8bd,_0x2313a8[_0x9069('0x41')]);return db[_0x9069('0x2e')][_0x9069('0x48')](_0x5ba8bd)['then'](handleEntityNotFound(_0x5948f4,null))[_0x9069('0x23')](respondWithResult(_0x5948f4,null))['catch'](handleError(_0x5948f4,null));};exports[_0x9069('0x49')]=function(_0x2598be,_0x54e2ce){return db['JscriptyProject'][_0x9069('0x49')](_0x2598be[_0x9069('0x4a')],{})['then'](function(_0x5b26cb){var _0x4ab37e=_0x2598be['user'][_0x9069('0x25')]({'plain':!![]});if(!_0x4ab37e)throw new Error(_0x9069('0x4b'));if(_0x4ab37e[_0x9069('0x4c')]===_0x9069('0x4d')){var _0x2e8f2c=_0x5b26cb[_0x9069('0x25')]({'plain':!![]});var _0x16c91c=_0x9069('0x4e');return db[_0x9069('0x4f')][_0x9069('0x48')]({'where':{'name':_0x16c91c,'userProfileId':_0x4ab37e['userProfileId']},'raw':!![]})[_0x9069('0x23')](function(_0x6a081e){if(_0x6a081e&&_0x6a081e[_0x9069('0x50')]===0x0){return db['UserProfileResource'][_0x9069('0x49')]({'name':_0x2e8f2c[_0x9069('0x2a')],'resourceId':_0x2e8f2c['id'],'type':_0x6a081e['name'],'sectionId':_0x6a081e['id']},{})['then'](function(){return _0x5b26cb;});}else{return _0x5b26cb;}})[_0x9069('0x44')](function(_0x13136e){logger[_0x9069('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13136e);throw _0x13136e;});}return _0x5b26cb;})[_0x9069('0x23')](respondWithResult(_0x54e2ce,0xc9))[_0x9069('0x44')](handleError(_0x54e2ce,null));};exports[_0x9069('0x51')]=function(_0x2f7c9f,_0x23383c){var _0x43da52={'where':{'id':_0x2f7c9f[_0x9069('0x46')]['id']}},_0x336f7a={};_0x336f7a[_0x9069('0x33')]=_[_0x9069('0x34')](db[_0x9069('0x2e')][_0x9069('0x2f')]);_0x43da52[_0x9069('0x37')]=_[_0x9069('0x36')](_0x336f7a[_0x9069('0x33')],qs[_0x9069('0x38')](_0x2f7c9f[_0x9069('0x35')][_0x9069('0x38')]));_0x43da52[_0x9069('0x37')]=_0x43da52['attributes'][_0x9069('0x39')]?_0x43da52['attributes']:_0x336f7a[_0x9069('0x33')];if(_0x2f7c9f['query']['includeAll']){_0x43da52[_0x9069('0x43')]=[{'all':!![]}];}_0x43da52=_[_0x9069('0x40')]({},_0x43da52,_0x2f7c9f[_0x9069('0x41')]);return db['JscriptyProject']['find'](_0x43da52)[_0x9069('0x23')](handleEntityNotFound(_0x23383c,null))[_0x9069('0x23')](function(_0x5e5b3f){if(_0x5e5b3f){var _0x436fe3=_0x5e5b3f[_0x9069('0x25')]({'plain':!![]});_0x436fe3=qs[_0x9069('0x52')](_0x436fe3,['id',_0x9069('0x53'),'updatedAt']);_0x2f7c9f[_0x9069('0x4a')]=_[_0x9069('0x52')](_0x2f7c9f['body'],['id',_0x9069('0x53'),_0x9069('0x54')]);return db[_0x9069('0x2e')]['create'](_[_0x9069('0x40')](_0x436fe3,_0x2f7c9f[_0x9069('0x4a')]),{'include':_0x2f7c9f['query'][_0x9069('0x47')]?[{'all':!![]}]:undefined})[_0x9069('0x23')](function(_0x33dcf1){var _0xf9718f=_0x2f7c9f['user'][_0x9069('0x25')]({'plain':!![]});if(!_0xf9718f)throw new Error(_0x9069('0x4b'));if(_0xf9718f['role']===_0x9069('0x4d')){var _0x42c483=_0x33dcf1['get']({'plain':!![]});var _0x5e6a37=_0x9069('0x4e');return db['UserProfileSection'][_0x9069('0x48')]({'where':{'name':_0x5e6a37,'userProfileId':_0xf9718f['userProfileId']},'raw':!![]})[_0x9069('0x23')](function(_0x2f3fe0){if(_0x2f3fe0&&_0x2f3fe0[_0x9069('0x50')]===0x0){return db[_0x9069('0x26')][_0x9069('0x49')]({'name':_0x42c483[_0x9069('0x2a')],'resourceId':_0x42c483['id'],'type':_0x2f3fe0['name'],'sectionId':_0x2f3fe0['id']},{})[_0x9069('0x23')](function(){return _0x33dcf1;});}else{return _0x33dcf1;}})[_0x9069('0x44')](function(_0x1ac8cb){logger[_0x9069('0x28')](_0x9069('0x55'),_0x1ac8cb);throw _0x1ac8cb;});}return _0x33dcf1;});}})['then'](respondWithResult(_0x23383c,0xc9))['catch'](handleError(_0x23383c,null));};exports[_0x9069('0x56')]=function(_0x11784d,_0x3e24bc){if(_0x11784d[_0x9069('0x4a')]['id']){delete _0x11784d[_0x9069('0x4a')]['id'];}return db[_0x9069('0x2e')][_0x9069('0x48')]({'where':{'id':_0x11784d[_0x9069('0x46')]['id']}})['then'](handleEntityNotFound(_0x3e24bc,null))['then'](saveUpdates(_0x11784d[_0x9069('0x4a')],null))[_0x9069('0x23')](respondWithResult(_0x3e24bc,null))['catch'](handleError(_0x3e24bc,null));};exports[_0x9069('0x24')]=function(_0x4808e3,_0x315176){return db[_0x9069('0x2e')]['find']({'where':{'id':_0x4808e3[_0x9069('0x46')]['id']}})['then'](handleEntityNotFound(_0x315176,null))['then'](removeEntity(_0x315176,null))[_0x9069('0x44')](handleError(_0x315176,null));};exports['getSessions']=function(_0x5b9942,_0x5734e6,_0x3cb0c5){var _0x3a4ab2={'raw':!![],'where':{}};var _0x54ba25={};var _0x4130f6={'count':0x0,'rows':[]};return db[_0x9069('0x2e')]['findOne']({'where':{'id':_0x5b9942[_0x9069('0x46')]['id']}})[_0x9069('0x23')](handleEntityNotFound(_0x5734e6,null))[_0x9069('0x23')](function(_0x4f4bc7){if(_0x4f4bc7){_0x54ba25[_0x9069('0x33')]=_[_0x9069('0x34')](db[_0x9069('0x57')]['rawAttributes']);_0x54ba25[_0x9069('0x35')]=_[_0x9069('0x34')](_0x5b9942[_0x9069('0x35')]);_0x54ba25['filters']=_[_0x9069('0x36')](_0x54ba25[_0x9069('0x33')],_0x54ba25[_0x9069('0x35')]);_0x3a4ab2['attributes']=_[_0x9069('0x36')](_0x54ba25[_0x9069('0x33')],qs[_0x9069('0x38')](_0x5b9942[_0x9069('0x35')][_0x9069('0x38')]));_0x3a4ab2[_0x9069('0x37')]=_0x3a4ab2['attributes'][_0x9069('0x39')]?_0x3a4ab2['attributes']:_0x54ba25[_0x9069('0x33')];if(!_0x5b9942[_0x9069('0x35')][_0x9069('0x3a')](_0x9069('0x58'))){_0x3a4ab2['limit']=qs[_0x9069('0x1e')](_0x5b9942[_0x9069('0x35')][_0x9069('0x1e')]);_0x3a4ab2[_0x9069('0x1f')]=qs['offset'](_0x5b9942[_0x9069('0x35')]['offset']);}_0x3a4ab2[_0x9069('0x3b')]=qs[_0x9069('0x3c')](_0x5b9942[_0x9069('0x35')][_0x9069('0x3c')]);_0x3a4ab2['where']=qs[_0x9069('0x3e')](_['pick'](_0x5b9942[_0x9069('0x35')],_0x54ba25[_0x9069('0x3e')]));_0x3a4ab2[_0x9069('0x3d')]['ProjectId']=_0x4f4bc7['id'];if(_0x5b9942[_0x9069('0x35')]['filter']){_0x3a4ab2[_0x9069('0x3d')]=_[_0x9069('0x40')](_0x3a4ab2[_0x9069('0x3d')],{'$or':_['map'](_0x3a4ab2['attributes'],function(_0x25f148){var _0xc13ef5={};_0xc13ef5[_0x25f148]={'$like':'%'+_0x5b9942['query'][_0x9069('0x3f')]+'%'};return _0xc13ef5;})});}_0x3a4ab2=_[_0x9069('0x40')]({},_0x3a4ab2,_0x5b9942['options']);return db[_0x9069('0x57')][_0x9069('0x42')]({'where':_0x3a4ab2[_0x9069('0x3d')]})[_0x9069('0x23')](function(_0x1fca34){_0x4130f6['count']=_0x1fca34;if(_0x5b9942['query'][_0x9069('0x47')]){_0x3a4ab2['include']=[{'all':!![]}];}return db[_0x9069('0x57')][_0x9069('0x59')](_0x3a4ab2);})[_0x9069('0x23')](function(_0x2ec177){_0x4130f6[_0x9069('0x5a')]=_0x2ec177;return _0x4130f6;});}})[_0x9069('0x23')](respondWithFilteredResult(_0x5734e6,_0x3a4ab2))[_0x9069('0x44')](handleError(_0x5734e6,null));};exports[_0x9069('0x5b')]=function(_0xeb4f3b,_0x2ac7d3,_0x292f2e){var _0x2e756f={'raw':!![],'where':{}};var _0x4cc456={};var _0x1dfb67={'count':0x0,'rows':[]};return db[_0x9069('0x2e')][_0x9069('0x5c')]({'where':{'id':_0xeb4f3b['params']['id']}})['then'](handleEntityNotFound(_0x2ac7d3,null))[_0x9069('0x23')](function(_0xbef43f){if(_0xbef43f){_0x4cc456['model']=_['keys'](db[_0x9069('0x5d')][_0x9069('0x2f')]);_0x4cc456[_0x9069('0x35')]=_[_0x9069('0x34')](_0xeb4f3b['query']);_0x4cc456[_0x9069('0x3e')]=_[_0x9069('0x36')](_0x4cc456[_0x9069('0x33')],_0x4cc456[_0x9069('0x35')]);_0x2e756f[_0x9069('0x37')]=_[_0x9069('0x36')](_0x4cc456[_0x9069('0x33')],qs[_0x9069('0x38')](_0xeb4f3b['query'][_0x9069('0x38')]));_0x2e756f[_0x9069('0x37')]=_0x2e756f[_0x9069('0x37')]['length']?_0x2e756f[_0x9069('0x37')]:_0x4cc456[_0x9069('0x33')];if(!_0xeb4f3b[_0x9069('0x35')][_0x9069('0x3a')](_0x9069('0x58'))){_0x2e756f[_0x9069('0x1e')]=qs[_0x9069('0x1e')](_0xeb4f3b[_0x9069('0x35')][_0x9069('0x1e')]);_0x2e756f[_0x9069('0x1f')]=qs[_0x9069('0x1f')](_0xeb4f3b[_0x9069('0x35')][_0x9069('0x1f')]);}_0x2e756f[_0x9069('0x3b')]=qs['sort'](_0xeb4f3b[_0x9069('0x35')][_0x9069('0x3c')]);_0x2e756f[_0x9069('0x3d')]=qs['filters'](_[_0x9069('0x5e')](_0xeb4f3b[_0x9069('0x35')],_0x4cc456['filters']));_0x2e756f[_0x9069('0x3d')][_0x9069('0x5f')]=_0xbef43f['id'];if(_0xeb4f3b['query'][_0x9069('0x3f')]){_0x2e756f[_0x9069('0x3d')]=_[_0x9069('0x40')](_0x2e756f['where'],{'$or':_[_0x9069('0x2d')](_0x2e756f[_0x9069('0x37')],function(_0x2a5449){var _0x29ce28={};_0x29ce28[_0x2a5449]={'$like':'%'+_0xeb4f3b[_0x9069('0x35')]['filter']+'%'};return _0x29ce28;})});}_0x2e756f=_[_0x9069('0x40')]({},_0x2e756f,_0xeb4f3b['options']);return db['JscriptyAnswerReport'][_0x9069('0x42')]({'where':_0x2e756f[_0x9069('0x3d')]})[_0x9069('0x23')](function(_0x42b265){_0x1dfb67[_0x9069('0x42')]=_0x42b265;if(_0xeb4f3b['query'][_0x9069('0x47')]){_0x2e756f['include']=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x9069('0x59')](_0x2e756f);})[_0x9069('0x23')](function(_0x133c0f){_0x1dfb67['rows']=_0x133c0f;return _0x1dfb67;});}})[_0x9069('0x23')](respondWithFilteredResult(_0x2ac7d3,_0x2e756f))['catch'](handleError(_0x2ac7d3,null));};function char(_0x2db3f6){return'number'===typeof _0x2db3f6?String[_0x9069('0x60')][_0x9069('0x20')](null,arguments):_0x2db3f6;}function needsEncapsulation(_0x24d7cc){return!!_0x24d7cc&&(_0x24d7cc['toString']()['indexOf'](char(0xd))>=0x0||_0x24d7cc[_0x9069('0x61')]()['indexOf'](char(0xa))>=0x0||_0x24d7cc[_0x9069('0x61')]()[_0x9069('0x62')](char(0x2c))>=0x0||_0x24d7cc[_0x9069('0x61')]()[_0x9069('0x62')](char(0x22))>=0x0);}function encapsulate(_0x125da1){var _0x1d6602=char(0x22),_0x27e95b='\x5c'+char(0x22),_0x33206c=_0x125da1['toString']()[_0x9069('0x63')](new RegExp(_0x1d6602,'g'),_0x27e95b);return _0x1d6602+_0x33206c+_0x1d6602;}exports[_0x9069('0x64')]=function(_0x2acdb0,_0x2b6b22,_0x311383){var _0x5f2640,_0x4621b7;var _0x46f2ff={'where':{'ProjectId':_0x2acdb0[_0x9069('0x46')]['id']}};if(_0x2acdb0['query'][_0x9069('0x65')]){_0x46f2ff['where'][_0x9069('0x66')]=JSON[_0x9069('0x67')](_0x2acdb0[_0x9069('0x35')][_0x9069('0x65')]);}return db[_0x9069('0x57')]['findAll'](_0x46f2ff)[_0x9069('0x23')](handleEntityNotFound(_0x2b6b22,null))[_0x9069('0x23')](function(_0xe4e026){if(_0xe4e026){_0x5f2640=_0xe4e026;return db[_0x9069('0x68')][_0x9069('0x59')]({'where':{'SessionId':{'$in':_[_0x9069('0x2d')](_0x5f2640,'id')},'ProjectId':_0x2acdb0[_0x9069('0x46')]['id']},'order':'-createdAt'});}})['then'](handleEntityNotFound(_0x2b6b22,null))['then'](function(_0x101908){if(_0x101908){_0x4621b7=_0x101908;var _0xae5442={};for(var _0x179985=0x0,_0x33a334=_0x4621b7[_0x9069('0x39')];_0x179985<_0x33a334;_0x179985++){if(!_0xae5442[_0x9069('0x3a')](_0x4621b7[_0x179985][_0x9069('0x69')])){_0xae5442[_0x4621b7[_0x179985][_0x9069('0x69')]]=needsEncapsulation(_0x4621b7[_0x179985][_0x9069('0x6a')])?encapsulate(_0x4621b7[_0x179985][_0x9069('0x6a')]):_0x4621b7[_0x179985][_0x9069('0x6a')];}}var _0x23f3f2=[],_0x4ba920={};for(var _0x523be3=0x0,_0x3387d3=_0x5f2640[_0x9069('0x39')];_0x523be3<_0x3387d3;_0x523be3++){_0x4ba920={'ProjectId':_0x2acdb0[_0x9069('0x46')]['id'],'SessionId':_0x5f2640[_0x523be3]['id'],'StartTime':moment(_0x5f2640[_0x523be3]['starttime'])['format'](_0x9069('0x6b'))};for(var _0x20b360=0x0,_0x5c4344=_0x4621b7[_0x9069('0x39')];_0x20b360<_0x5c4344;_0x20b360++){if(_0x4621b7[_0x20b360]['SessionId']==_0x5f2640[_0x523be3]['id']&&_0xae5442['hasOwnProperty'](_0x4621b7[_0x20b360][_0x9069('0x69')])){_0x4ba920[_0xae5442[_0x4621b7[_0x20b360][_0x9069('0x69')]]]=_0x4621b7[_0x20b360][_0x9069('0x6c')];}}for(var _0x258ead in _0xae5442){if(!_0x4ba920[_0x9069('0x3a')](_0xae5442[_0x258ead])){_0x4ba920[_0xae5442[_0x258ead]]=null;}}_0x23f3f2[_0x9069('0x6d')](_0x4ba920);}return _0x23f3f2;}})[_0x9069('0x23')](function(_0x4799e8){if(!_[_0x9069('0x6e')](_0x4799e8)){var _0x2e010d=toCsv(_0x4799e8);var _0x4d6d5c=Date[_0x9069('0x6f')]();fs[_0x9069('0x70')](util[_0x9069('0x71')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x2acdb0[_0x9069('0x46')]['id'],_0x4d6d5c),_0x2e010d);_0x2b6b22[_0x9069('0x72')]('Content-disposition','attachment;\x20filename='+util[_0x9069('0x71')]('Jscripty_Project_%d_Summary_%s.csv',_0x2acdb0[_0x9069('0x46')]['id'],_0x4d6d5c));_0x2b6b22['setHeader']('Content-type',_0x9069('0x73'));return _0x2b6b22[_0x9069('0x74')](util[_0x9069('0x71')](_0x9069('0x75'),_0x2acdb0[_0x9069('0x46')]['id'],_0x4d6d5c));}else{return _0x2b6b22[_0x9069('0x27')](0xcc);}})[_0x9069('0x44')](handleError(_0x2b6b22,null));}; \ No newline at end of file +var _0x945d=['jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','get','Projects','UserProfileResource','then','error','name','map','JscriptyProject','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','omit','updatedAt','createdAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getSessions','findOne','JscriptySessionReport','order','ProjectId','filter','getAnswers','JscriptyAnswerReport','number','toString','indexOf','getSummary','parse','startTime','JscriptyQuestionReport','-createdAt','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','questionId','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','download','eml-format','rimraf','fast-json-patch','mustache','util','path','sox','to-csv','ejs','squel'];(function(_0x9ea926,_0x32b1b2){var _0x129b2a=function(_0x278c47){while(--_0x278c47){_0x9ea926['push'](_0x9ea926['shift']());}};_0x129b2a(++_0x32b1b2);}(_0x945d,0xe2));var _0xd945=function(_0x4db540,_0x39ee9e){_0x4db540=_0x4db540-0x0;var _0x415fee=_0x945d[_0x4db540];return _0x415fee;};'use strict';var emlformat=require(_0xd945('0x0'));var rimraf=require(_0xd945('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd945('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd945('0x3'));var util=require(_0xd945('0x4'));var path=require(_0xd945('0x5'));var sox=require(_0xd945('0x6'));var csv=require(_0xd945('0x7'));var ejs=require(_0xd945('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd945('0x9'));var crypto=require('crypto');var jsforce=require(_0xd945('0xa'));var deskjs=require(_0xd945('0xb'));var toCsv=require(_0xd945('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd945('0xc'));var authService=require(_0xd945('0xd'));var qs=require(_0xd945('0xe'));var as=require(_0xd945('0xf'));var hardwareService=require(_0xd945('0x10'));var logger=require(_0xd945('0x11'))(_0xd945('0x12'));var utils=require('../../config/utils');var config=require(_0xd945('0x13'));var licenseUtil=require(_0xd945('0x14'));var db=require(_0xd945('0x15'))['db'];function respondWithStatusCode(_0x1450c4,_0x445994){_0x445994=_0x445994||0xcc;return function(_0x2e6e0d){if(_0x2e6e0d){return _0x1450c4[_0xd945('0x16')](_0x445994);}return _0x1450c4[_0xd945('0x17')](_0x445994)[_0xd945('0x18')]();};}function respondWithResult(_0x22fa06,_0x5d56ef){_0x5d56ef=_0x5d56ef||0xc8;return function(_0x4adbb8){if(_0x4adbb8){return _0x22fa06['status'](_0x5d56ef)['json'](_0x4adbb8);}};}function respondWithFilteredResult(_0x9c6fc8,_0x57936a){return function(_0x322b16){if(_0x322b16){var _0x5dde99=typeof _0x57936a[_0xd945('0x19')]===_0xd945('0x1a')&&typeof _0x57936a['limit']==='undefined';var _0x41abc5=_0x322b16[_0xd945('0x1b')];var _0x5e5a85=_0x5dde99?0x0:_0x57936a[_0xd945('0x19')];var _0x50f35b=_0x5dde99?_0x322b16[_0xd945('0x1b')]:_0x57936a['offset']+_0x57936a['limit'];var _0x1146d2;if(_0x50f35b>=_0x41abc5){_0x50f35b=_0x41abc5;_0x1146d2=0xc8;}else{_0x1146d2=0xce;}_0x9c6fc8[_0xd945('0x17')](_0x1146d2);return _0x9c6fc8[_0xd945('0x1c')](_0xd945('0x1d'),_0x5e5a85+'-'+_0x50f35b+'/'+_0x41abc5)[_0xd945('0x1e')](_0x322b16);}return null;};}function patchUpdates(_0x13788b){return function(_0x873615){try{jsonpatch[_0xd945('0x1f')](_0x873615,_0x13788b,!![]);}catch(_0x4cfb2b){return BPromise[_0xd945('0x20')](_0x4cfb2b);}return _0x873615[_0xd945('0x21')]();};}function saveUpdates(_0x331b6,_0x5a962d){return function(_0x11f10f){if(_0x11f10f){return _0x11f10f[_0xd945('0x22')](_0x331b6)['then'](function(_0x257880){return _0x257880;});}return null;};}function removeEntity(_0x32ee55,_0x157013){return function(_0x4ed7fe){if(_0x4ed7fe){return _0x4ed7fe[_0xd945('0x23')]()['then'](function(){var _0x283723=_0x4ed7fe[_0xd945('0x24')]({'plain':!![]});var _0x48520e=_0xd945('0x25');return db[_0xd945('0x26')]['destroy']({'where':{'type':_0x48520e,'resourceId':_0x283723['id']}})[_0xd945('0x27')](function(){return _0x4ed7fe;});})['then'](function(){_0x32ee55[_0xd945('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12d304,_0x93dc17){return function(_0x5032c2){if(!_0x5032c2){_0x12d304['sendStatus'](0x194);}return _0x5032c2;};}function handleError(_0x4a8662,_0x3476e5){_0x3476e5=_0x3476e5||0x1f4;return function(_0x2da25b){logger[_0xd945('0x28')](_0x2da25b['stack']);if(_0x2da25b[_0xd945('0x29')]){delete _0x2da25b[_0xd945('0x29')];}_0x4a8662[_0xd945('0x17')](_0x3476e5)['send'](_0x2da25b);};}exports['index']=function(_0x56a054,_0x22a18d){var _0x41fd31={},_0x2391fe={},_0x20a32e={'count':0x0,'rows':[]};var _0x39fa21=_[_0xd945('0x2a')](db[_0xd945('0x2b')]['rawAttributes'],function(_0x47b708){return{'name':_0x47b708[_0xd945('0x2c')],'type':_0x47b708[_0xd945('0x2d')][_0xd945('0x2e')]};});_0x2391fe[_0xd945('0x2f')]=_['map'](_0x39fa21,'name');_0x2391fe[_0xd945('0x30')]=_[_0xd945('0x31')](_0x56a054[_0xd945('0x30')]);_0x2391fe[_0xd945('0x32')]=_[_0xd945('0x33')](_0x2391fe[_0xd945('0x2f')],_0x2391fe[_0xd945('0x30')]);_0x41fd31[_0xd945('0x34')]=_[_0xd945('0x33')](_0x2391fe['model'],qs[_0xd945('0x35')](_0x56a054[_0xd945('0x30')][_0xd945('0x35')]));_0x41fd31[_0xd945('0x34')]=_0x41fd31[_0xd945('0x34')][_0xd945('0x36')]?_0x41fd31[_0xd945('0x34')]:_0x2391fe['model'];if(!_0x56a054[_0xd945('0x30')][_0xd945('0x37')](_0xd945('0x38'))){_0x41fd31[_0xd945('0x39')]=qs[_0xd945('0x39')](_0x56a054[_0xd945('0x30')][_0xd945('0x39')]);_0x41fd31[_0xd945('0x19')]=qs[_0xd945('0x19')](_0x56a054[_0xd945('0x30')]['offset']);}_0x41fd31['order']=qs[_0xd945('0x3a')](_0x56a054[_0xd945('0x30')][_0xd945('0x3a')]);_0x41fd31[_0xd945('0x3b')]=qs['filters'](_[_0xd945('0x3c')](_0x56a054[_0xd945('0x30')],_0x2391fe[_0xd945('0x32')]),_0x39fa21);if(_0x56a054['query']['filter']){_0x41fd31[_0xd945('0x3b')]=_['merge'](_0x41fd31[_0xd945('0x3b')],{'$or':_[_0xd945('0x2a')](_0x39fa21,function(_0x5b4660){if(_0x5b4660['type']!==_0xd945('0x3d')){var _0x32dc84={};_0x32dc84[_0x5b4660[_0xd945('0x29')]]={'$like':'%'+_0x56a054[_0xd945('0x30')]['filter']+'%'};return _0x32dc84;}})});}_0x41fd31=_[_0xd945('0x3e')]({},_0x41fd31,_0x56a054[_0xd945('0x3f')]);var _0x1cffc0={'where':_0x41fd31[_0xd945('0x3b')]};return db['JscriptyProject']['count'](_0x1cffc0)[_0xd945('0x27')](function(_0xe1e865){_0x20a32e['count']=_0xe1e865;if(_0x56a054[_0xd945('0x30')][_0xd945('0x40')]){_0x41fd31['include']=[{'all':!![]}];}return db[_0xd945('0x2b')][_0xd945('0x41')](_0x41fd31);})[_0xd945('0x27')](function(_0x1f2b4c){_0x20a32e[_0xd945('0x42')]=_0x1f2b4c;return _0x20a32e;})[_0xd945('0x27')](respondWithFilteredResult(_0x22a18d,_0x41fd31))[_0xd945('0x43')](handleError(_0x22a18d,null));};exports[_0xd945('0x44')]=function(_0x4c1630,_0x5c7dcf){var _0x59dfde={'raw':![],'where':{'id':_0x4c1630[_0xd945('0x45')]['id']}},_0x1ad29c={};_0x1ad29c[_0xd945('0x2f')]=_[_0xd945('0x31')](db[_0xd945('0x2b')][_0xd945('0x46')]);_0x1ad29c['query']=_[_0xd945('0x31')](_0x4c1630[_0xd945('0x30')]);_0x1ad29c['filters']=_[_0xd945('0x33')](_0x1ad29c[_0xd945('0x2f')],_0x1ad29c[_0xd945('0x30')]);_0x59dfde[_0xd945('0x34')]=_[_0xd945('0x33')](_0x1ad29c[_0xd945('0x2f')],qs['fields'](_0x4c1630['query']['fields']));_0x59dfde[_0xd945('0x34')]=_0x59dfde['attributes']['length']?_0x59dfde[_0xd945('0x34')]:_0x1ad29c[_0xd945('0x2f')];if(_0x4c1630[_0xd945('0x30')]['includeAll']){_0x59dfde[_0xd945('0x47')]=[{'all':!![]}];}_0x59dfde=_[_0xd945('0x3e')]({},_0x59dfde,_0x4c1630[_0xd945('0x3f')]);return db['JscriptyProject'][_0xd945('0x48')](_0x59dfde)[_0xd945('0x27')](handleEntityNotFound(_0x5c7dcf,null))['then'](respondWithResult(_0x5c7dcf,null))[_0xd945('0x43')](handleError(_0x5c7dcf,null));};exports[_0xd945('0x49')]=function(_0xa794b1,_0x32d998){return db[_0xd945('0x2b')][_0xd945('0x49')](_0xa794b1[_0xd945('0x4a')],{})[_0xd945('0x27')](function(_0xdcfa70){var _0x355758=_0xa794b1[_0xd945('0x4b')][_0xd945('0x24')]({'plain':!![]});if(!_0x355758)throw new Error(_0xd945('0x4c'));if(_0x355758[_0xd945('0x4d')]===_0xd945('0x4b')){var _0xa40220=_0xdcfa70['get']({'plain':!![]});var _0x12f207=_0xd945('0x25');return db[_0xd945('0x4e')]['find']({'where':{'name':_0x12f207,'userProfileId':_0x355758[_0xd945('0x4f')]},'raw':!![]})['then'](function(_0x13b9ea){if(_0x13b9ea&&_0x13b9ea[_0xd945('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0xa40220[_0xd945('0x29')],'resourceId':_0xa40220['id'],'type':_0x13b9ea[_0xd945('0x29')],'sectionId':_0x13b9ea['id']},{})[_0xd945('0x27')](function(){return _0xdcfa70;});}else{return _0xdcfa70;}})[_0xd945('0x43')](function(_0x21e310){logger[_0xd945('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x21e310);throw _0x21e310;});}return _0xdcfa70;})[_0xd945('0x27')](respondWithResult(_0x32d998,0xc9))[_0xd945('0x43')](handleError(_0x32d998,null));};exports['clone']=function(_0x5b73ec,_0x136363){var _0x37e048={'where':{'id':_0x5b73ec[_0xd945('0x45')]['id']}},_0x3cdbcc={};_0x3cdbcc[_0xd945('0x2f')]=_[_0xd945('0x31')](db[_0xd945('0x2b')][_0xd945('0x46')]);_0x37e048[_0xd945('0x34')]=_[_0xd945('0x33')](_0x3cdbcc[_0xd945('0x2f')],qs[_0xd945('0x35')](_0x5b73ec[_0xd945('0x30')][_0xd945('0x35')]));_0x37e048[_0xd945('0x34')]=_0x37e048[_0xd945('0x34')][_0xd945('0x36')]?_0x37e048['attributes']:_0x3cdbcc['model'];if(_0x5b73ec[_0xd945('0x30')]['includeAll']){_0x37e048[_0xd945('0x47')]=[{'all':!![]}];}_0x37e048=_[_0xd945('0x3e')]({},_0x37e048,_0x5b73ec[_0xd945('0x3f')]);return db[_0xd945('0x2b')][_0xd945('0x48')](_0x37e048)[_0xd945('0x27')](handleEntityNotFound(_0x136363,null))[_0xd945('0x27')](function(_0x13e6ce){if(_0x13e6ce){var _0x8e84fb=_0x13e6ce['get']({'plain':!![]});_0x8e84fb=qs[_0xd945('0x51')](_0x8e84fb,['id','createdAt',_0xd945('0x52')]);_0x5b73ec[_0xd945('0x4a')]=_[_0xd945('0x51')](_0x5b73ec[_0xd945('0x4a')],['id',_0xd945('0x53'),_0xd945('0x52')]);return db['JscriptyProject'][_0xd945('0x49')](_[_0xd945('0x3e')](_0x8e84fb,_0x5b73ec[_0xd945('0x4a')]),{'include':_0x5b73ec[_0xd945('0x30')][_0xd945('0x40')]?[{'all':!![]}]:undefined})[_0xd945('0x27')](function(_0x3f3ffb){var _0x52f82a=_0x5b73ec['user'][_0xd945('0x24')]({'plain':!![]});if(!_0x52f82a)throw new Error(_0xd945('0x4c'));if(_0x52f82a['role']===_0xd945('0x4b')){var _0x53778b=_0x3f3ffb[_0xd945('0x24')]({'plain':!![]});var _0x3a0476=_0xd945('0x25');return db['UserProfileSection']['find']({'where':{'name':_0x3a0476,'userProfileId':_0x52f82a['userProfileId']},'raw':!![]})['then'](function(_0xa614d0){if(_0xa614d0&&_0xa614d0[_0xd945('0x50')]===0x0){return db['UserProfileResource'][_0xd945('0x49')]({'name':_0x53778b[_0xd945('0x29')],'resourceId':_0x53778b['id'],'type':_0xa614d0['name'],'sectionId':_0xa614d0['id']},{})[_0xd945('0x27')](function(){return _0x3f3ffb;});}else{return _0x3f3ffb;}})[_0xd945('0x43')](function(_0x4fc987){logger[_0xd945('0x28')](_0xd945('0x54'),_0x4fc987);throw _0x4fc987;});}return _0x3f3ffb;});}})[_0xd945('0x27')](respondWithResult(_0x136363,0xc9))[_0xd945('0x43')](handleError(_0x136363,null));};exports['update']=function(_0x97b4a,_0x3f61f4){if(_0x97b4a[_0xd945('0x4a')]['id']){delete _0x97b4a[_0xd945('0x4a')]['id'];}return db[_0xd945('0x2b')]['find']({'where':{'id':_0x97b4a['params']['id']}})[_0xd945('0x27')](handleEntityNotFound(_0x3f61f4,null))[_0xd945('0x27')](saveUpdates(_0x97b4a[_0xd945('0x4a')],null))['then'](respondWithResult(_0x3f61f4,null))[_0xd945('0x43')](handleError(_0x3f61f4,null));};exports[_0xd945('0x23')]=function(_0x4b6fb2,_0x306ac3){return db[_0xd945('0x2b')][_0xd945('0x48')]({'where':{'id':_0x4b6fb2['params']['id']}})['then'](handleEntityNotFound(_0x306ac3,null))['then'](removeEntity(_0x306ac3,null))[_0xd945('0x43')](handleError(_0x306ac3,null));};exports[_0xd945('0x55')]=function(_0x4b32d5,_0x57831a,_0x4a1fd2){var _0x7cf3bc={'raw':!![],'where':{}};var _0x3f4709={};var _0x6b1932={'count':0x0,'rows':[]};return db[_0xd945('0x2b')][_0xd945('0x56')]({'where':{'id':_0x4b32d5[_0xd945('0x45')]['id']}})['then'](handleEntityNotFound(_0x57831a,null))['then'](function(_0x3c6556){if(_0x3c6556){_0x3f4709['model']=_[_0xd945('0x31')](db[_0xd945('0x57')][_0xd945('0x46')]);_0x3f4709[_0xd945('0x30')]=_[_0xd945('0x31')](_0x4b32d5[_0xd945('0x30')]);_0x3f4709[_0xd945('0x32')]=_[_0xd945('0x33')](_0x3f4709['model'],_0x3f4709[_0xd945('0x30')]);_0x7cf3bc[_0xd945('0x34')]=_[_0xd945('0x33')](_0x3f4709[_0xd945('0x2f')],qs[_0xd945('0x35')](_0x4b32d5[_0xd945('0x30')]['fields']));_0x7cf3bc['attributes']=_0x7cf3bc[_0xd945('0x34')][_0xd945('0x36')]?_0x7cf3bc[_0xd945('0x34')]:_0x3f4709[_0xd945('0x2f')];if(!_0x4b32d5['query'][_0xd945('0x37')](_0xd945('0x38'))){_0x7cf3bc[_0xd945('0x39')]=qs[_0xd945('0x39')](_0x4b32d5[_0xd945('0x30')][_0xd945('0x39')]);_0x7cf3bc[_0xd945('0x19')]=qs[_0xd945('0x19')](_0x4b32d5[_0xd945('0x30')][_0xd945('0x19')]);}_0x7cf3bc[_0xd945('0x58')]=qs[_0xd945('0x3a')](_0x4b32d5['query'][_0xd945('0x3a')]);_0x7cf3bc[_0xd945('0x3b')]=qs[_0xd945('0x32')](_[_0xd945('0x3c')](_0x4b32d5['query'],_0x3f4709[_0xd945('0x32')]));_0x7cf3bc[_0xd945('0x3b')][_0xd945('0x59')]=_0x3c6556['id'];if(_0x4b32d5[_0xd945('0x30')][_0xd945('0x5a')]){_0x7cf3bc['where']=_[_0xd945('0x3e')](_0x7cf3bc[_0xd945('0x3b')],{'$or':_[_0xd945('0x2a')](_0x7cf3bc[_0xd945('0x34')],function(_0x19c655){var _0x4cd5cc={};_0x4cd5cc[_0x19c655]={'$like':'%'+_0x4b32d5[_0xd945('0x30')][_0xd945('0x5a')]+'%'};return _0x4cd5cc;})});}_0x7cf3bc=_[_0xd945('0x3e')]({},_0x7cf3bc,_0x4b32d5[_0xd945('0x3f')]);return db[_0xd945('0x57')][_0xd945('0x1b')]({'where':_0x7cf3bc[_0xd945('0x3b')]})['then'](function(_0x303308){_0x6b1932['count']=_0x303308;if(_0x4b32d5['query'][_0xd945('0x40')]){_0x7cf3bc['include']=[{'all':!![]}];}return db[_0xd945('0x57')]['findAll'](_0x7cf3bc);})[_0xd945('0x27')](function(_0x3014f6){_0x6b1932[_0xd945('0x42')]=_0x3014f6;return _0x6b1932;});}})['then'](respondWithFilteredResult(_0x57831a,_0x7cf3bc))[_0xd945('0x43')](handleError(_0x57831a,null));};exports[_0xd945('0x5b')]=function(_0x5d0f94,_0x515d30,_0x5a57a5){var _0x482d6d={'raw':!![],'where':{}};var _0x3c003c={};var _0x42ed2c={'count':0x0,'rows':[]};return db[_0xd945('0x2b')][_0xd945('0x56')]({'where':{'id':_0x5d0f94[_0xd945('0x45')]['id']}})[_0xd945('0x27')](handleEntityNotFound(_0x515d30,null))[_0xd945('0x27')](function(_0x5b050e){if(_0x5b050e){_0x3c003c[_0xd945('0x2f')]=_['keys'](db['JscriptyAnswerReport']['rawAttributes']);_0x3c003c['query']=_['keys'](_0x5d0f94[_0xd945('0x30')]);_0x3c003c[_0xd945('0x32')]=_[_0xd945('0x33')](_0x3c003c[_0xd945('0x2f')],_0x3c003c[_0xd945('0x30')]);_0x482d6d[_0xd945('0x34')]=_['intersection'](_0x3c003c['model'],qs['fields'](_0x5d0f94[_0xd945('0x30')][_0xd945('0x35')]));_0x482d6d[_0xd945('0x34')]=_0x482d6d[_0xd945('0x34')][_0xd945('0x36')]?_0x482d6d[_0xd945('0x34')]:_0x3c003c[_0xd945('0x2f')];if(!_0x5d0f94[_0xd945('0x30')][_0xd945('0x37')](_0xd945('0x38'))){_0x482d6d['limit']=qs[_0xd945('0x39')](_0x5d0f94[_0xd945('0x30')][_0xd945('0x39')]);_0x482d6d[_0xd945('0x19')]=qs['offset'](_0x5d0f94[_0xd945('0x30')]['offset']);}_0x482d6d['order']=qs[_0xd945('0x3a')](_0x5d0f94['query']['sort']);_0x482d6d[_0xd945('0x3b')]=qs[_0xd945('0x32')](_[_0xd945('0x3c')](_0x5d0f94[_0xd945('0x30')],_0x3c003c[_0xd945('0x32')]));_0x482d6d[_0xd945('0x3b')][_0xd945('0x59')]=_0x5b050e['id'];if(_0x5d0f94[_0xd945('0x30')][_0xd945('0x5a')]){_0x482d6d[_0xd945('0x3b')]=_[_0xd945('0x3e')](_0x482d6d[_0xd945('0x3b')],{'$or':_[_0xd945('0x2a')](_0x482d6d[_0xd945('0x34')],function(_0x1b356c){var _0x5a651d={};_0x5a651d[_0x1b356c]={'$like':'%'+_0x5d0f94[_0xd945('0x30')][_0xd945('0x5a')]+'%'};return _0x5a651d;})});}_0x482d6d=_[_0xd945('0x3e')]({},_0x482d6d,_0x5d0f94['options']);return db[_0xd945('0x5c')][_0xd945('0x1b')]({'where':_0x482d6d['where']})[_0xd945('0x27')](function(_0x471839){_0x42ed2c[_0xd945('0x1b')]=_0x471839;if(_0x5d0f94[_0xd945('0x30')][_0xd945('0x40')]){_0x482d6d[_0xd945('0x47')]=[{'all':!![]}];}return db[_0xd945('0x5c')][_0xd945('0x41')](_0x482d6d);})[_0xd945('0x27')](function(_0x27ee5a){_0x42ed2c[_0xd945('0x42')]=_0x27ee5a;return _0x42ed2c;});}})[_0xd945('0x27')](respondWithFilteredResult(_0x515d30,_0x482d6d))[_0xd945('0x43')](handleError(_0x515d30,null));};function char(_0x473716){return _0xd945('0x5d')===typeof _0x473716?String['fromCharCode'][_0xd945('0x1f')](null,arguments):_0x473716;}function needsEncapsulation(_0x4dbed9){return!!_0x4dbed9&&(_0x4dbed9['toString']()['indexOf'](char(0xd))>=0x0||_0x4dbed9[_0xd945('0x5e')]()[_0xd945('0x5f')](char(0xa))>=0x0||_0x4dbed9[_0xd945('0x5e')]()[_0xd945('0x5f')](char(0x2c))>=0x0||_0x4dbed9[_0xd945('0x5e')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x566e88){var _0x24487d=char(0x22),_0x27443b='\x5c'+char(0x22),_0x57a2bb=_0x566e88[_0xd945('0x5e')]()['replace'](new RegExp(_0x24487d,'g'),_0x27443b);return _0x24487d+_0x57a2bb+_0x24487d;}exports[_0xd945('0x60')]=function(_0x213bd5,_0x42a282,_0x39e44b){var _0x5aba5a,_0x48b4e9;var _0x5c096a={'where':{'ProjectId':_0x213bd5[_0xd945('0x45')]['id']}};if(_0x213bd5['query']['startTime']){_0x5c096a[_0xd945('0x3b')]['starttime']=JSON[_0xd945('0x61')](_0x213bd5[_0xd945('0x30')][_0xd945('0x62')]);}return db['JscriptySessionReport'][_0xd945('0x41')](_0x5c096a)[_0xd945('0x27')](handleEntityNotFound(_0x42a282,null))['then'](function(_0x260cb7){if(_0x260cb7){_0x5aba5a=_0x260cb7;return db[_0xd945('0x63')][_0xd945('0x41')]({'where':{'SessionId':{'$in':_['map'](_0x5aba5a,'id')},'ProjectId':_0x213bd5[_0xd945('0x45')]['id']},'order':_0xd945('0x64')});}})[_0xd945('0x27')](handleEntityNotFound(_0x42a282,null))[_0xd945('0x27')](function(_0x52a88c){if(_0x52a88c){_0x48b4e9=_0x52a88c;var _0x10102d={};for(var _0x94906c=0x0,_0x4fcce0=_0x48b4e9[_0xd945('0x36')];_0x94906c<_0x4fcce0;_0x94906c++){if(!_0x10102d['hasOwnProperty'](_0x48b4e9[_0x94906c]['questionId'])){_0x10102d[_0x48b4e9[_0x94906c]['questionId']]=needsEncapsulation(_0x48b4e9[_0x94906c][_0xd945('0x65')])?encapsulate(_0x48b4e9[_0x94906c]['question']):_0x48b4e9[_0x94906c][_0xd945('0x65')];}}var _0x4d8b5f=[],_0x267017={};for(var _0x3b1ccd=0x0,_0x122e9e=_0x5aba5a[_0xd945('0x36')];_0x3b1ccd<_0x122e9e;_0x3b1ccd++){_0x267017={'ProjectId':_0x213bd5[_0xd945('0x45')]['id'],'SessionId':_0x5aba5a[_0x3b1ccd]['id'],'StartTime':moment(_0x5aba5a[_0x3b1ccd]['starttime'])[_0xd945('0x66')](_0xd945('0x67'))};for(var _0x12847f=0x0,_0xa9744b=_0x48b4e9[_0xd945('0x36')];_0x12847f<_0xa9744b;_0x12847f++){if(_0x48b4e9[_0x12847f][_0xd945('0x68')]==_0x5aba5a[_0x3b1ccd]['id']&&_0x10102d[_0xd945('0x37')](_0x48b4e9[_0x12847f][_0xd945('0x69')])){_0x267017[_0x10102d[_0x48b4e9[_0x12847f][_0xd945('0x69')]]]=_0x48b4e9[_0x12847f][_0xd945('0x6a')];}}for(var _0x4c8eee in _0x10102d){if(!_0x267017[_0xd945('0x37')](_0x10102d[_0x4c8eee])){_0x267017[_0x10102d[_0x4c8eee]]=null;}}_0x4d8b5f[_0xd945('0x6b')](_0x267017);}return _0x4d8b5f;}})[_0xd945('0x27')](function(_0x26fffe){if(!_[_0xd945('0x6c')](_0x26fffe)){var _0x38e901=toCsv(_0x26fffe);var _0x223e9f=Date[_0xd945('0x6d')]();fs[_0xd945('0x6e')](util[_0xd945('0x66')](_0xd945('0x6f'),_0x213bd5['params']['id'],_0x223e9f),_0x38e901);_0x42a282[_0xd945('0x70')](_0xd945('0x71'),_0xd945('0x72')+util[_0xd945('0x66')](_0xd945('0x73'),_0x213bd5[_0xd945('0x45')]['id'],_0x223e9f));_0x42a282[_0xd945('0x70')](_0xd945('0x74'),'text/csv');return _0x42a282[_0xd945('0x75')](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x213bd5[_0xd945('0x45')]['id'],_0x223e9f));}else{return _0x42a282['sendStatus'](0xcc);}})[_0xd945('0x43')](handleError(_0x42a282,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index e246e30..42478b8 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 _0x29d4=['moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject','lodash','../../config/logger','api'];(function(_0x108333,_0x24f712){var _0x4eb8be=function(_0x3dc1a7){while(--_0x3dc1a7){_0x108333['push'](_0x108333['shift']());}};_0x4eb8be(++_0x24f712);}(_0x29d4,0x1a1));var _0x429d=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0x29d4[_0xea8947];return _0x2455e9;};'use strict';var _=require(_0x429d('0x0'));var util=require('util');var logger=require(_0x429d('0x1'))(_0x429d('0x2'));var moment=require(_0x429d('0x3'));var BPromise=require(_0x429d('0x4'));var rp=require(_0x429d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x429d('0x6'));var config=require(_0x429d('0x7'));var attributes=require(_0x429d('0x8'));module[_0x429d('0x9')]=function(_0x1c55aa,_0xa71445){return _0x1c55aa[_0x429d('0xa')](_0x429d('0xb'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2d17=['define','jscripty_projects','lodash','util','api','moment','request-promise','path','../../config/environment','exports'];(function(_0x2c2a92,_0x220eed){var _0x406996=function(_0x53b4a1){while(--_0x53b4a1){_0x2c2a92['push'](_0x2c2a92['shift']());}};_0x406996(++_0x220eed);}(_0x2d17,0x17e));var _0x72d1=function(_0x131077,_0x8975ae){_0x131077=_0x131077-0x0;var _0x5d3b12=_0x2d17[_0x131077];return _0x5d3b12;};'use strict';var _=require(_0x72d1('0x0'));var util=require(_0x72d1('0x1'));var logger=require('../../config/logger')(_0x72d1('0x2'));var moment=require(_0x72d1('0x3'));var BPromise=require('bluebird');var rp=require(_0x72d1('0x4'));var fs=require('fs');var path=require(_0x72d1('0x5'));var rimraf=require('rimraf');var config=require(_0x72d1('0x6'));var attributes=require('./jscriptyProject.attributes');module[_0x72d1('0x7')]=function(_0x50f551,_0x139ba0){return _0x50f551[_0x72d1('0x8')]('JscriptyProject',attributes,{'tableName':_0x72d1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index c2a2f88..3732c08 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 _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s'];(function(_0x5a776c,_0x225df6){var _0x176265=function(_0x439ffc){while(--_0x439ffc){_0x5a776c['push'](_0x5a776c['shift']());}};_0x176265(++_0x225df6);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x21af3a,_0x386e1d){_0x21af3a=_0x21af3a-0x0;var _0x268a49=_0xcb91[_0x21af3a];return _0x268a49;};'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')]('JscriptyProject,\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 _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','JscriptyProject,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0xd0e8b,_0x1a1d45){var _0x4f1e61=function(_0x2d8c9d){while(--_0x2d8c9d){_0xd0e8b['push'](_0xd0e8b['shift']());}};_0x4f1e61(++_0x1a1d45);}(_0x9c44,0x178));var _0x49c4=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x9c44[_0x422905];return _0x33dc6c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 2759f41..e3ff7cb 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 _0x4e9d=['../../components/auth/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','delete','exports','path','express','Router','fs-extra'];(function(_0x309f92,_0x32938e){var _0x298625=function(_0x2ca5f2){while(--_0x2ca5f2){_0x309f92['push'](_0x309f92['shift']());}};_0x298625(++_0x32938e);}(_0x4e9d,0x1ac));var _0xd4e9=function(_0x2b18c9,_0x49659f){_0x2b18c9=_0x2b18c9-0x0;var _0x8b913c=_0x4e9d[_0x2b18c9];return _0x8b913c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd4e9('0x0'));var timeout=require('connect-timeout');var express=require(_0xd4e9('0x1'));var router=express[_0xd4e9('0x2')]();var fs_extra=require(_0xd4e9('0x3'));var auth=require(_0xd4e9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd4e9('0x5'));var controller=require(_0xd4e9('0x6'));router[_0xd4e9('0x7')]('/',auth[_0xd4e9('0x8')](),controller[_0xd4e9('0x9')]);router[_0xd4e9('0x7')](_0xd4e9('0xa'),auth[_0xd4e9('0x8')](),controller[_0xd4e9('0xb')]);router['get'](_0xd4e9('0xc'),auth['isAuthenticated'](),controller[_0xd4e9('0xd')]);router[_0xd4e9('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd4e9('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd4e9('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xd4e9('0x11')]=router; \ No newline at end of file +var _0xd766=['isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0xf9d7b7,_0x49387d){var _0x33f181=function(_0x1b1cda){while(--_0x1b1cda){_0xf9d7b7['push'](_0xf9d7b7['shift']());}};_0x33f181(++_0x49387d);}(_0xd766,0xfe));var _0x6d76=function(_0x53f964,_0x3b52b8){_0x53f964=_0x53f964-0x0;var _0x17be6c=_0xd766[_0x53f964];return _0x17be6c;};'use strict';var multer=require('multer');var util=require(_0x6d76('0x0'));var path=require(_0x6d76('0x1'));var timeout=require(_0x6d76('0x2'));var express=require(_0x6d76('0x3'));var router=express[_0x6d76('0x4')]();var fs_extra=require(_0x6d76('0x5'));var auth=require(_0x6d76('0x6'));var interaction=require(_0x6d76('0x7'));var config=require(_0x6d76('0x8'));var controller=require('./jscriptyQuestionReport.controller');router[_0x6d76('0x9')]('/',auth[_0x6d76('0xa')](),controller[_0x6d76('0xb')]);router[_0x6d76('0x9')](_0x6d76('0xc'),auth[_0x6d76('0xa')](),controller[_0x6d76('0xd')]);router['get'](_0x6d76('0xe'),auth[_0x6d76('0xa')](),controller[_0x6d76('0xf')]);router[_0x6d76('0x10')]('/',auth['isAuthenticated'](),controller[_0x6d76('0x11')]);router[_0x6d76('0x12')](_0x6d76('0xe'),auth[_0x6d76('0xa')](),controller[_0x6d76('0x13')]);router[_0x6d76('0x14')](_0x6d76('0xe'),auth['isAuthenticated'](),controller[_0x6d76('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 3b266be..324c315 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(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x7a54,0x106));var _0x47a5=function(_0x5532fc,_0x54fdd7){_0x5532fc=_0x5532fc-0x0;var _0x106414=_0x7a54[_0x5532fc];return _0x106414;};'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(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x7a54,0x106));var _0x47a5=function(_0xdf8577,_0x2c7ff3){_0xdf8577=_0xdf8577-0x0;var _0x204560=_0x7a54[_0xdf8577];return _0x204560;};'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 f76a020..2ac77a3 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 _0x9895=['count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','filters','pick','filter','where','merge','options','JscriptyQuestionReport','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','../../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'];(function(_0x2b1e9d,_0x27d9c6){var _0x512473=function(_0x332872){while(--_0x332872){_0x2b1e9d['push'](_0x2b1e9d['shift']());}};_0x512473(++_0x27d9c6);}(_0x9895,0x113));var _0x5989=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x9895[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0x5989('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5989('0x1'));var jsonpatch=require(_0x5989('0x2'));var rp=require(_0x5989('0x3'));var moment=require(_0x5989('0x4'));var BPromise=require(_0x5989('0x5'));var Mustache=require('mustache');var util=require(_0x5989('0x6'));var path=require(_0x5989('0x7'));var sox=require(_0x5989('0x8'));var csv=require(_0x5989('0x9'));var ejs=require(_0x5989('0xa'));var fs=require('fs');var fs_extra=require(_0x5989('0xb'));var _=require('lodash');var squel=require(_0x5989('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5989('0xd'));var toCsv=require(_0x5989('0x9'));var querystring=require(_0x5989('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5989('0xf'));var qs=require(_0x5989('0x10'));var as=require(_0x5989('0x11'));var hardwareService=require(_0x5989('0x12'));var logger=require('../../config/logger')(_0x5989('0x13'));var utils=require(_0x5989('0x14'));var config=require(_0x5989('0x15'));var licenseUtil=require(_0x5989('0x16'));var db=require(_0x5989('0x17'))['db'];function respondWithStatusCode(_0x568c76,_0x132e0c){_0x132e0c=_0x132e0c||0xcc;return function(_0x139e14){if(_0x139e14){return _0x568c76['sendStatus'](_0x132e0c);}return _0x568c76[_0x5989('0x18')](_0x132e0c)[_0x5989('0x19')]();};}function respondWithResult(_0x454c82,_0x1b89ee){_0x1b89ee=_0x1b89ee||0xc8;return function(_0x53e311){if(_0x53e311){return _0x454c82[_0x5989('0x18')](_0x1b89ee)[_0x5989('0x1a')](_0x53e311);}};}function respondWithFilteredResult(_0x31542c,_0x10da02){return function(_0x2cbb02){if(_0x2cbb02){var _0x3d4b18=typeof _0x10da02[_0x5989('0x1b')]===_0x5989('0x1c')&&typeof _0x10da02['limit']==='undefined';var _0x1f597e=_0x2cbb02[_0x5989('0x1d')];var _0x2042c7=_0x3d4b18?0x0:_0x10da02[_0x5989('0x1b')];var _0x373b50=_0x3d4b18?_0x2cbb02[_0x5989('0x1d')]:_0x10da02['offset']+_0x10da02['limit'];var _0x3d9a9c;if(_0x373b50>=_0x1f597e){_0x373b50=_0x1f597e;_0x3d9a9c=0xc8;}else{_0x3d9a9c=0xce;}_0x31542c['status'](_0x3d9a9c);return _0x31542c[_0x5989('0x1e')](_0x5989('0x1f'),_0x2042c7+'-'+_0x373b50+'/'+_0x1f597e)[_0x5989('0x1a')](_0x2cbb02);}return null;};}function patchUpdates(_0x6360e0){return function(_0x2b4669){try{jsonpatch['apply'](_0x2b4669,_0x6360e0,!![]);}catch(_0x173a65){return BPromise[_0x5989('0x20')](_0x173a65);}return _0x2b4669[_0x5989('0x21')]();};}function saveUpdates(_0x5630df,_0xf793f7){return function(_0x41f498){if(_0x41f498){return _0x41f498[_0x5989('0x22')](_0x5630df)[_0x5989('0x23')](function(_0x4d354b){return _0x4d354b;});}return null;};}function removeEntity(_0x24649c,_0x3eda1f){return function(_0x138997){if(_0x138997){return _0x138997[_0x5989('0x24')]()['then'](function(){_0x24649c[_0x5989('0x18')](0xcc)[_0x5989('0x19')]();});}};}function handleEntityNotFound(_0x280484,_0x3757d1){return function(_0x3e1707){if(!_0x3e1707){_0x280484[_0x5989('0x25')](0x194);}return _0x3e1707;};}function handleError(_0x35ef80,_0x474098){_0x474098=_0x474098||0x1f4;return function(_0x403b6c){logger[_0x5989('0x26')](_0x403b6c[_0x5989('0x27')]);if(_0x403b6c['name']){delete _0x403b6c[_0x5989('0x28')];}_0x35ef80[_0x5989('0x18')](_0x474098)[_0x5989('0x29')](_0x403b6c);};}exports[_0x5989('0x2a')]=function(_0x3c695a,_0x567af7){var _0x3d4603={},_0xbed24c={},_0x5b941a={'count':0x0,'rows':[]};var _0x2cc8db=_[_0x5989('0x2b')](db['JscriptyQuestionReport'][_0x5989('0x2c')],function(_0x130336){return{'name':_0x130336[_0x5989('0x2d')],'type':_0x130336['type'][_0x5989('0x2e')]};});_0xbed24c['model']=_[_0x5989('0x2b')](_0x2cc8db,_0x5989('0x28'));_0xbed24c[_0x5989('0x2f')]=_[_0x5989('0x30')](_0x3c695a[_0x5989('0x2f')]);_0xbed24c['filters']=_['intersection'](_0xbed24c[_0x5989('0x31')],_0xbed24c[_0x5989('0x2f')]);_0x3d4603[_0x5989('0x32')]=_[_0x5989('0x33')](_0xbed24c[_0x5989('0x31')],qs[_0x5989('0x34')](_0x3c695a[_0x5989('0x2f')][_0x5989('0x34')]));_0x3d4603[_0x5989('0x32')]=_0x3d4603[_0x5989('0x32')][_0x5989('0x35')]?_0x3d4603[_0x5989('0x32')]:_0xbed24c[_0x5989('0x31')];if(!_0x3c695a['query'][_0x5989('0x36')]('nolimit')){_0x3d4603['limit']=qs[_0x5989('0x37')](_0x3c695a[_0x5989('0x2f')][_0x5989('0x37')]);_0x3d4603[_0x5989('0x1b')]=qs[_0x5989('0x1b')](_0x3c695a[_0x5989('0x2f')][_0x5989('0x1b')]);}_0x3d4603[_0x5989('0x38')]=qs['sort'](_0x3c695a[_0x5989('0x2f')][_0x5989('0x39')]);_0x3d4603['where']=qs[_0x5989('0x3a')](_[_0x5989('0x3b')](_0x3c695a[_0x5989('0x2f')],_0xbed24c['filters']),_0x2cc8db);if(_0x3c695a[_0x5989('0x2f')][_0x5989('0x3c')]){_0x3d4603[_0x5989('0x3d')]=_['merge'](_0x3d4603[_0x5989('0x3d')],{'$or':_[_0x5989('0x2b')](_0x2cc8db,function(_0x2f5de1){if(_0x2f5de1['type']!=='VIRTUAL'){var _0x4b233c={};_0x4b233c[_0x2f5de1['name']]={'$like':'%'+_0x3c695a[_0x5989('0x2f')][_0x5989('0x3c')]+'%'};return _0x4b233c;}})});}_0x3d4603=_[_0x5989('0x3e')]({},_0x3d4603,_0x3c695a[_0x5989('0x3f')]);var _0x6dafa4={'where':_0x3d4603[_0x5989('0x3d')]};return db[_0x5989('0x40')][_0x5989('0x1d')](_0x6dafa4)[_0x5989('0x23')](function(_0x29a37e){_0x5b941a[_0x5989('0x1d')]=_0x29a37e;if(_0x3c695a[_0x5989('0x2f')][_0x5989('0x41')]){_0x3d4603[_0x5989('0x42')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x5989('0x43')](_0x3d4603);})[_0x5989('0x23')](function(_0xecbe76){_0x5b941a[_0x5989('0x44')]=_0xecbe76;return _0x5b941a;})[_0x5989('0x23')](respondWithFilteredResult(_0x567af7,_0x3d4603))[_0x5989('0x45')](handleError(_0x567af7,null));};exports[_0x5989('0x46')]=function(_0x3bfc8c,_0x30d856){var _0xdecb5={'raw':!![],'where':{'id':_0x3bfc8c[_0x5989('0x47')]['id']}},_0x270d5c={};_0x270d5c['model']=_[_0x5989('0x30')](db['JscriptyQuestionReport'][_0x5989('0x2c')]);_0x270d5c[_0x5989('0x2f')]=_[_0x5989('0x30')](_0x3bfc8c['query']);_0x270d5c[_0x5989('0x3a')]=_['intersection'](_0x270d5c['model'],_0x270d5c[_0x5989('0x2f')]);_0xdecb5['attributes']=_[_0x5989('0x33')](_0x270d5c[_0x5989('0x31')],qs['fields'](_0x3bfc8c['query'][_0x5989('0x34')]));_0xdecb5[_0x5989('0x32')]=_0xdecb5[_0x5989('0x32')][_0x5989('0x35')]?_0xdecb5[_0x5989('0x32')]:_0x270d5c[_0x5989('0x31')];if(_0x3bfc8c[_0x5989('0x2f')][_0x5989('0x41')]){_0xdecb5[_0x5989('0x42')]=[{'all':!![]}];}_0xdecb5=_[_0x5989('0x3e')]({},_0xdecb5,_0x3bfc8c[_0x5989('0x3f')]);return db[_0x5989('0x40')][_0x5989('0x48')](_0xdecb5)[_0x5989('0x23')](handleEntityNotFound(_0x30d856,null))[_0x5989('0x23')](respondWithResult(_0x30d856,null))[_0x5989('0x45')](handleError(_0x30d856,null));};exports[_0x5989('0x49')]=function(_0x132032,_0x149b3e){return db[_0x5989('0x40')][_0x5989('0x49')](_0x132032[_0x5989('0x4a')],{})['then'](respondWithResult(_0x149b3e,0xc9))[_0x5989('0x45')](handleError(_0x149b3e,null));};exports[_0x5989('0x22')]=function(_0x2ad8d8,_0x32ae66){if(_0x2ad8d8['body']['id']){delete _0x2ad8d8[_0x5989('0x4a')]['id'];}return db[_0x5989('0x40')][_0x5989('0x48')]({'where':{'id':_0x2ad8d8[_0x5989('0x47')]['id']}})['then'](handleEntityNotFound(_0x32ae66,null))['then'](saveUpdates(_0x2ad8d8[_0x5989('0x4a')],null))[_0x5989('0x23')](respondWithResult(_0x32ae66,null))[_0x5989('0x45')](handleError(_0x32ae66,null));};exports[_0x5989('0x24')]=function(_0x2a5ffd,_0x1a5215){return db[_0x5989('0x40')][_0x5989('0x48')]({'where':{'id':_0x2a5ffd[_0x5989('0x47')]['id']}})[_0x5989('0x23')](handleEntityNotFound(_0x1a5215,null))[_0x5989('0x23')](removeEntity(_0x1a5215,null))['catch'](handleError(_0x1a5215,null));};exports[_0x5989('0x4b')]=function(_0x3e8769,_0x343cb4){return db['JscriptyQuestionReport'][_0x5989('0x4b')]()[_0x5989('0x23')](respondWithResult(_0x343cb4,null))[_0x5989('0x45')](handleError(_0x343cb4,null));}; \ No newline at end of file +var _0xd999=['stack','name','index','map','JscriptyQuestionReport','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','end','offset','undefined','limit','count','status','set','Content-Range','json','reject','save','then','destroy','sendStatus','error'];(function(_0x289e64,_0x5adb3c){var _0x30246c=function(_0x1bf7f6){while(--_0x1bf7f6){_0x289e64['push'](_0x289e64['shift']());}};_0x30246c(++_0x5adb3c);}(_0xd999,0x1f3));var _0x9d99=function(_0x43d0dd,_0x1bd3d2){_0x43d0dd=_0x43d0dd-0x0;var _0x233879=_0xd999[_0x43d0dd];return _0x233879;};'use strict';var emlformat=require(_0x9d99('0x0'));var rimraf=require(_0x9d99('0x1'));var zipdir=require(_0x9d99('0x2'));var jsonpatch=require(_0x9d99('0x3'));var rp=require(_0x9d99('0x4'));var moment=require(_0x9d99('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9d99('0x6'));var util=require(_0x9d99('0x7'));var path=require(_0x9d99('0x8'));var sox=require(_0x9d99('0x9'));var csv=require(_0x9d99('0xa'));var ejs=require(_0x9d99('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9d99('0xc'));var squel=require(_0x9d99('0xd'));var crypto=require('crypto');var jsforce=require(_0x9d99('0xe'));var deskjs=require(_0x9d99('0xf'));var toCsv=require(_0x9d99('0xa'));var querystring=require(_0x9d99('0x10'));var Papa=require(_0x9d99('0x11'));var Redis=require(_0x9d99('0x12'));var authService=require(_0x9d99('0x13'));var qs=require(_0x9d99('0x14'));var as=require(_0x9d99('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9d99('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9d99('0x17'));var db=require(_0x9d99('0x18'))['db'];function respondWithStatusCode(_0x5eb737,_0x1df392){_0x1df392=_0x1df392||0xcc;return function(_0x31fe76){if(_0x31fe76){return _0x5eb737['sendStatus'](_0x1df392);}return _0x5eb737['status'](_0x1df392)[_0x9d99('0x19')]();};}function respondWithResult(_0x397d3a,_0x48bfeb){_0x48bfeb=_0x48bfeb||0xc8;return function(_0x406a50){if(_0x406a50){return _0x397d3a['status'](_0x48bfeb)['json'](_0x406a50);}};}function respondWithFilteredResult(_0x205352,_0x458b6a){return function(_0x5b2875){if(_0x5b2875){var _0x2a374f=typeof _0x458b6a[_0x9d99('0x1a')]===_0x9d99('0x1b')&&typeof _0x458b6a[_0x9d99('0x1c')]===_0x9d99('0x1b');var _0x342a89=_0x5b2875['count'];var _0x3d5dec=_0x2a374f?0x0:_0x458b6a['offset'];var _0x3552ea=_0x2a374f?_0x5b2875[_0x9d99('0x1d')]:_0x458b6a[_0x9d99('0x1a')]+_0x458b6a['limit'];var _0x8403e5;if(_0x3552ea>=_0x342a89){_0x3552ea=_0x342a89;_0x8403e5=0xc8;}else{_0x8403e5=0xce;}_0x205352[_0x9d99('0x1e')](_0x8403e5);return _0x205352[_0x9d99('0x1f')](_0x9d99('0x20'),_0x3d5dec+'-'+_0x3552ea+'/'+_0x342a89)[_0x9d99('0x21')](_0x5b2875);}return null;};}function patchUpdates(_0x4463fe){return function(_0x3cb912){try{jsonpatch['apply'](_0x3cb912,_0x4463fe,!![]);}catch(_0x11e774){return BPromise[_0x9d99('0x22')](_0x11e774);}return _0x3cb912[_0x9d99('0x23')]();};}function saveUpdates(_0x29e15e,_0x23a12b){return function(_0xee49f0){if(_0xee49f0){return _0xee49f0['update'](_0x29e15e)[_0x9d99('0x24')](function(_0x246765){return _0x246765;});}return null;};}function removeEntity(_0x46df6b,_0xbdfd4a){return function(_0x4c8968){if(_0x4c8968){return _0x4c8968[_0x9d99('0x25')]()['then'](function(){_0x46df6b[_0x9d99('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0xea0250,_0x38b7d8){return function(_0x2ad390){if(!_0x2ad390){_0xea0250[_0x9d99('0x26')](0x194);}return _0x2ad390;};}function handleError(_0x1045ca,_0x526062){_0x526062=_0x526062||0x1f4;return function(_0x812698){logger[_0x9d99('0x27')](_0x812698[_0x9d99('0x28')]);if(_0x812698[_0x9d99('0x29')]){delete _0x812698[_0x9d99('0x29')];}_0x1045ca['status'](_0x526062)['send'](_0x812698);};}exports[_0x9d99('0x2a')]=function(_0x3ac4d3,_0x21c5bd){var _0x5179a4={},_0x413578={},_0x4918f3={'count':0x0,'rows':[]};var _0xb364f=_[_0x9d99('0x2b')](db[_0x9d99('0x2c')][_0x9d99('0x2d')],function(_0x3c4ea6){return{'name':_0x3c4ea6[_0x9d99('0x2e')],'type':_0x3c4ea6['type'][_0x9d99('0x2f')]};});_0x413578[_0x9d99('0x30')]=_[_0x9d99('0x2b')](_0xb364f,'name');_0x413578[_0x9d99('0x31')]=_[_0x9d99('0x32')](_0x3ac4d3[_0x9d99('0x31')]);_0x413578['filters']=_[_0x9d99('0x33')](_0x413578['model'],_0x413578[_0x9d99('0x31')]);_0x5179a4[_0x9d99('0x34')]=_[_0x9d99('0x33')](_0x413578['model'],qs[_0x9d99('0x35')](_0x3ac4d3[_0x9d99('0x31')][_0x9d99('0x35')]));_0x5179a4[_0x9d99('0x34')]=_0x5179a4[_0x9d99('0x34')][_0x9d99('0x36')]?_0x5179a4['attributes']:_0x413578[_0x9d99('0x30')];if(!_0x3ac4d3[_0x9d99('0x31')]['hasOwnProperty'](_0x9d99('0x37'))){_0x5179a4[_0x9d99('0x1c')]=qs[_0x9d99('0x1c')](_0x3ac4d3[_0x9d99('0x31')][_0x9d99('0x1c')]);_0x5179a4[_0x9d99('0x1a')]=qs[_0x9d99('0x1a')](_0x3ac4d3[_0x9d99('0x31')][_0x9d99('0x1a')]);}_0x5179a4[_0x9d99('0x38')]=qs[_0x9d99('0x39')](_0x3ac4d3[_0x9d99('0x31')][_0x9d99('0x39')]);_0x5179a4[_0x9d99('0x3a')]=qs[_0x9d99('0x3b')](_[_0x9d99('0x3c')](_0x3ac4d3[_0x9d99('0x31')],_0x413578[_0x9d99('0x3b')]),_0xb364f);if(_0x3ac4d3[_0x9d99('0x31')][_0x9d99('0x3d')]){_0x5179a4[_0x9d99('0x3a')]=_[_0x9d99('0x3e')](_0x5179a4[_0x9d99('0x3a')],{'$or':_[_0x9d99('0x2b')](_0xb364f,function(_0x5e20aa){if(_0x5e20aa[_0x9d99('0x3f')]!==_0x9d99('0x40')){var _0x4efc9d={};_0x4efc9d[_0x5e20aa[_0x9d99('0x29')]]={'$like':'%'+_0x3ac4d3[_0x9d99('0x31')][_0x9d99('0x3d')]+'%'};return _0x4efc9d;}})});}_0x5179a4=_[_0x9d99('0x3e')]({},_0x5179a4,_0x3ac4d3[_0x9d99('0x41')]);var _0xa97b73={'where':_0x5179a4[_0x9d99('0x3a')]};return db[_0x9d99('0x2c')][_0x9d99('0x1d')](_0xa97b73)[_0x9d99('0x24')](function(_0x591e73){_0x4918f3[_0x9d99('0x1d')]=_0x591e73;if(_0x3ac4d3[_0x9d99('0x31')][_0x9d99('0x42')]){_0x5179a4[_0x9d99('0x43')]=[{'all':!![]}];}return db[_0x9d99('0x2c')][_0x9d99('0x44')](_0x5179a4);})[_0x9d99('0x24')](function(_0xd4bf0f){_0x4918f3['rows']=_0xd4bf0f;return _0x4918f3;})[_0x9d99('0x24')](respondWithFilteredResult(_0x21c5bd,_0x5179a4))[_0x9d99('0x45')](handleError(_0x21c5bd,null));};exports[_0x9d99('0x46')]=function(_0x174711,_0x13f862){var _0x54b2b9={'raw':!![],'where':{'id':_0x174711[_0x9d99('0x47')]['id']}},_0x1fbb30={};_0x1fbb30[_0x9d99('0x30')]=_[_0x9d99('0x32')](db[_0x9d99('0x2c')][_0x9d99('0x2d')]);_0x1fbb30[_0x9d99('0x31')]=_[_0x9d99('0x32')](_0x174711['query']);_0x1fbb30[_0x9d99('0x3b')]=_[_0x9d99('0x33')](_0x1fbb30[_0x9d99('0x30')],_0x1fbb30[_0x9d99('0x31')]);_0x54b2b9[_0x9d99('0x34')]=_[_0x9d99('0x33')](_0x1fbb30[_0x9d99('0x30')],qs['fields'](_0x174711[_0x9d99('0x31')][_0x9d99('0x35')]));_0x54b2b9[_0x9d99('0x34')]=_0x54b2b9[_0x9d99('0x34')]['length']?_0x54b2b9[_0x9d99('0x34')]:_0x1fbb30[_0x9d99('0x30')];if(_0x174711['query']['includeAll']){_0x54b2b9[_0x9d99('0x43')]=[{'all':!![]}];}_0x54b2b9=_[_0x9d99('0x3e')]({},_0x54b2b9,_0x174711[_0x9d99('0x41')]);return db[_0x9d99('0x2c')][_0x9d99('0x48')](_0x54b2b9)[_0x9d99('0x24')](handleEntityNotFound(_0x13f862,null))[_0x9d99('0x24')](respondWithResult(_0x13f862,null))['catch'](handleError(_0x13f862,null));};exports[_0x9d99('0x49')]=function(_0x1bc7ac,_0x4be3fc){return db['JscriptyQuestionReport'][_0x9d99('0x49')](_0x1bc7ac[_0x9d99('0x4a')],{})[_0x9d99('0x24')](respondWithResult(_0x4be3fc,0xc9))[_0x9d99('0x45')](handleError(_0x4be3fc,null));};exports[_0x9d99('0x4b')]=function(_0x420416,_0x578ba9){if(_0x420416[_0x9d99('0x4a')]['id']){delete _0x420416[_0x9d99('0x4a')]['id'];}return db['JscriptyQuestionReport']['find']({'where':{'id':_0x420416[_0x9d99('0x47')]['id']}})[_0x9d99('0x24')](handleEntityNotFound(_0x578ba9,null))['then'](saveUpdates(_0x420416['body'],null))[_0x9d99('0x24')](respondWithResult(_0x578ba9,null))[_0x9d99('0x45')](handleError(_0x578ba9,null));};exports[_0x9d99('0x25')]=function(_0x5bef39,_0x1399cf){return db[_0x9d99('0x2c')][_0x9d99('0x48')]({'where':{'id':_0x5bef39[_0x9d99('0x47')]['id']}})[_0x9d99('0x24')](handleEntityNotFound(_0x1399cf,null))[_0x9d99('0x24')](removeEntity(_0x1399cf,null))[_0x9d99('0x45')](handleError(_0x1399cf,null));};exports[_0x9d99('0x4c')]=function(_0x333f46,_0x952dc2){return db[_0x9d99('0x2c')][_0x9d99('0x4c')]()[_0x9d99('0x24')](respondWithResult(_0x952dc2,null))['catch'](handleError(_0x952dc2,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index ca041a3..f5710f8 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 _0xd917=['rimraf','./jscriptyQuestionReport.attributes','define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','bluebird','request-promise'];(function(_0x3c049c,_0xc6a23c){var _0x1c85f7=function(_0x37d604){while(--_0x37d604){_0x3c049c['push'](_0x3c049c['shift']());}};_0x1c85f7(++_0xc6a23c);}(_0xd917,0x68));var _0x7d91=function(_0x3d3f14,_0x4fedf9){_0x3d3f14=_0x3d3f14-0x0;var _0x2e66e5=_0xd917[_0x3d3f14];return _0x2e66e5;};'use strict';var _=require(_0x7d91('0x0'));var util=require(_0x7d91('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x7d91('0x2'));var rp=require(_0x7d91('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7d91('0x4'));var config=require('../../config/environment');var attributes=require(_0x7d91('0x5'));module['exports']=function(_0x3daf19,_0xf30140){return _0x3daf19[_0x7d91('0x6')](_0x7d91('0x7'),attributes,{'tableName':_0x7d91('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5b89=['path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','api','bluebird','request-promise'];(function(_0xf214e6,_0x6a8fca){var _0x5cdfbe=function(_0x53cf93){while(--_0x53cf93){_0xf214e6['push'](_0xf214e6['shift']());}};_0x5cdfbe(++_0x6a8fca);}(_0x5b89,0xb1));var _0x95b8=function(_0x13ac10,_0x46e79e){_0x13ac10=_0x13ac10-0x0;var _0x28eda2=_0x5b89[_0x13ac10];return _0x28eda2;};'use strict';var _=require(_0x95b8('0x0'));var util=require(_0x95b8('0x1'));var logger=require('../../config/logger')(_0x95b8('0x2'));var moment=require('moment');var BPromise=require(_0x95b8('0x3'));var rp=require(_0x95b8('0x4'));var fs=require('fs');var path=require(_0x95b8('0x5'));var rimraf=require(_0x95b8('0x6'));var config=require(_0x95b8('0x7'));var attributes=require(_0x95b8('0x8'));module[_0x95b8('0x9')]=function(_0x46c571,_0x41d156){return _0x46c571[_0x95b8('0xa')](_0x95b8('0xb'),attributes,{'tableName':_0x95b8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index 05f1202..29b9ab4 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 _0x28e4=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x34e5f1,_0x2007a3){var _0x1588f8=function(_0x217b9a){while(--_0x217b9a){_0x34e5f1['push'](_0x34e5f1['shift']());}};_0x1588f8(++_0x2007a3);}(_0x28e4,0xc7));var _0x428e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28e4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x428e('0x0'));var util=require('util');var moment=require(_0x428e('0x1'));var BPromise=require(_0x428e('0x2'));var rs=require(_0x428e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x428e('0x4'))['db'];var utils=require(_0x428e('0x5'));var logger=require(_0x428e('0x6'))(_0x428e('0x7'));var config=require(_0x428e('0x8'));var jayson=require(_0x428e('0x9'));var client=jayson[_0x428e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2aea6a,_0x2daeb5,_0x229bd9){return new BPromise(function(_0x58d0cc,_0x21c271){return client[_0x428e('0xb')](_0x2aea6a,_0x229bd9)[_0x428e('0xc')](function(_0x15fb60){logger['info'](_0x428e('0xd'),_0x2daeb5,_0x428e('0xe'));logger[_0x428e('0xf')](_0x428e('0x10'),_0x2daeb5,'request\x20sent',JSON['stringify'](_0x15fb60));if(_0x15fb60[_0x428e('0x11')]){if(_0x15fb60[_0x428e('0x11')][_0x428e('0x12')]===0x1f4){logger[_0x428e('0x11')](_0x428e('0xd'),_0x2daeb5,_0x15fb60[_0x428e('0x11')]['message']);return _0x21c271(_0x15fb60['error'][_0x428e('0x13')]);}logger[_0x428e('0x11')](_0x428e('0xd'),_0x2daeb5,_0x15fb60[_0x428e('0x11')]['message']);return _0x58d0cc(_0x15fb60['error'][_0x428e('0x13')]);}else{logger['info'](_0x428e('0xd'),_0x2daeb5,_0x428e('0xe'));_0x58d0cc(_0x15fb60[_0x428e('0x14')][_0x428e('0x13')]);}})[_0x428e('0x15')](function(_0x1a526d){logger[_0x428e('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2daeb5,_0x1a526d);_0x21c271(_0x1a526d);});});} \ No newline at end of file +var _0x8dc0=['request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','JscriptyQuestionReport,\x20%s,\x20%s','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message'];(function(_0x2bcec7,_0x242aa1){var _0x2f2eef=function(_0x4263fb){while(--_0x4263fb){_0x2bcec7['push'](_0x2bcec7['shift']());}};_0x2f2eef(++_0x242aa1);}(_0x8dc0,0xa4));var _0x08dc=function(_0x1c8cc6,_0x411e5c){_0x1c8cc6=_0x1c8cc6-0x0;var _0x522936=_0x8dc0[_0x1c8cc6];return _0x522936;};'use strict';var _=require(_0x08dc('0x0'));var util=require(_0x08dc('0x1'));var moment=require(_0x08dc('0x2'));var BPromise=require('bluebird');var rs=require(_0x08dc('0x3'));var fs=require('fs');var Redis=require(_0x08dc('0x4'));var db=require(_0x08dc('0x5'))['db'];var utils=require(_0x08dc('0x6'));var logger=require('../../config/logger')(_0x08dc('0x7'));var config=require(_0x08dc('0x8'));var jayson=require(_0x08dc('0x9'));var client=jayson[_0x08dc('0xa')][_0x08dc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33fdeb,_0x35cc24,_0x4becb4){return new BPromise(function(_0x389289,_0x41e38f){return client[_0x08dc('0xc')](_0x33fdeb,_0x4becb4)['then'](function(_0x26c9c9){logger['info'](_0x08dc('0xd'),_0x35cc24,'request\x20sent');logger[_0x08dc('0xe')](_0x08dc('0xf'),_0x35cc24,'request\x20sent',JSON[_0x08dc('0x10')](_0x26c9c9));if(_0x26c9c9['error']){if(_0x26c9c9['error'][_0x08dc('0x11')]===0x1f4){logger[_0x08dc('0x12')](_0x08dc('0xd'),_0x35cc24,_0x26c9c9[_0x08dc('0x12')][_0x08dc('0x13')]);return _0x41e38f(_0x26c9c9[_0x08dc('0x12')][_0x08dc('0x13')]);}logger[_0x08dc('0x12')](_0x08dc('0xd'),_0x35cc24,_0x26c9c9[_0x08dc('0x12')][_0x08dc('0x13')]);return _0x389289(_0x26c9c9[_0x08dc('0x12')][_0x08dc('0x13')]);}else{logger['info'](_0x08dc('0xd'),_0x35cc24,_0x08dc('0x14'));_0x389289(_0x26c9c9[_0x08dc('0x15')][_0x08dc('0x13')]);}})[_0x08dc('0x16')](function(_0x535511){logger[_0x08dc('0x12')](_0x08dc('0xd'),_0x35cc24,_0x535511);_0x41e38f(_0x535511);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 1326f09..3ab06ed 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 _0xa75a=['create','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','/:id','show','/:id/questions','getQuestions','post'];(function(_0x558ac9,_0x2cbe01){var _0x30f7c7=function(_0x245572){while(--_0x245572){_0x558ac9['push'](_0x558ac9['shift']());}};_0x30f7c7(++_0x2cbe01);}(_0xa75a,0xc2));var _0xaa75=function(_0x5a2a22,_0x1f3dc8){_0x5a2a22=_0x5a2a22-0x0;var _0xf9f942=_0xa75a[_0x5a2a22];return _0xf9f942;};'use strict';var multer=require(_0xaa75('0x0'));var util=require(_0xaa75('0x1'));var path=require(_0xaa75('0x2'));var timeout=require('connect-timeout');var express=require(_0xaa75('0x3'));var router=express[_0xaa75('0x4')]();var fs_extra=require(_0xaa75('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xaa75('0x6'));var config=require(_0xaa75('0x7'));var controller=require(_0xaa75('0x8'));router[_0xaa75('0x9')]('/',auth[_0xaa75('0xa')](),controller['index']);router['get']('/describe',auth[_0xaa75('0xa')](),controller['describe']);router[_0xaa75('0x9')](_0xaa75('0xb'),auth[_0xaa75('0xa')](),controller[_0xaa75('0xc')]);router[_0xaa75('0x9')](_0xaa75('0xd'),auth[_0xaa75('0xa')](),controller[_0xaa75('0xe')]);router[_0xaa75('0xf')]('/',auth[_0xaa75('0xa')](),controller[_0xaa75('0x10')]);router[_0xaa75('0x11')](_0xaa75('0xb'),auth['isAuthenticated'](),controller[_0xaa75('0x12')]);router[_0xaa75('0x13')](_0xaa75('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xaa75('0x14')]=router; \ No newline at end of file +var _0xfabc=['./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/questions','getQuestions','create','update','delete','destroy','exports','multer','util','path','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3ccfe6,_0x56a8eb){var _0xc8a9bb=function(_0x138d57){while(--_0x138d57){_0x3ccfe6['push'](_0x3ccfe6['shift']());}};_0xc8a9bb(++_0x56a8eb);}(_0xfabc,0x1f2));var _0xcfab=function(_0x2eadc0,_0x161a98){_0x2eadc0=_0x2eadc0-0x0;var _0x5658ce=_0xfabc[_0x2eadc0];return _0x5658ce;};'use strict';var multer=require(_0xcfab('0x0'));var util=require(_0xcfab('0x1'));var path=require(_0xcfab('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xcfab('0x3'));var interaction=require(_0xcfab('0x4'));var config=require(_0xcfab('0x5'));var controller=require(_0xcfab('0x6'));router[_0xcfab('0x7')]('/',auth[_0xcfab('0x8')](),controller[_0xcfab('0x9')]);router['get'](_0xcfab('0xa'),auth['isAuthenticated'](),controller[_0xcfab('0xb')]);router['get'](_0xcfab('0xc'),auth[_0xcfab('0x8')](),controller[_0xcfab('0xd')]);router[_0xcfab('0x7')](_0xcfab('0xe'),auth[_0xcfab('0x8')](),controller[_0xcfab('0xf')]);router['post']('/',auth[_0xcfab('0x8')](),controller[_0xcfab('0x10')]);router['put'](_0xcfab('0xc'),auth['isAuthenticated'](),controller[_0xcfab('0x11')]);router[_0xcfab('0x12')](_0xcfab('0xc'),auth[_0xcfab('0x8')](),controller[_0xcfab('0x13')]);module[_0xcfab('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 6ac2272..402e7d1 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 _0x5b4c=['STRING','BOOLEAN','moment','exports','setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','DATE'];(function(_0x5da27f,_0x504b76){var _0x54a3fb=function(_0x3b65a8){while(--_0x3b65a8){_0x5da27f['push'](_0x5da27f['shift']());}};_0x54a3fb(++_0x504b76);}(_0x5b4c,0x17e));var _0xc5b4=function(_0x4a37c9,_0x2f98e6){_0x4a37c9=_0x4a37c9-0x0;var _0x4f771e=_0x5b4c[_0x4a37c9];return _0x4f771e;};'use strict';var moment=require(_0xc5b4('0x0'));var Sequelize=require('sequelize');module[_0xc5b4('0x1')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x2fc425){this[_0xc5b4('0x2')](_0xc5b4('0x3'),_0x2fc425);this[_0xc5b4('0x2')](_0xc5b4('0x4'),moment()[_0xc5b4('0x5')](_0xc5b4('0x6')));}},'endtime':{'type':Sequelize[_0xc5b4('0x7')]},'membername':{'type':Sequelize[_0xc5b4('0x8')]},'projectname':{'type':Sequelize[_0xc5b4('0x8')]},'queue':{'type':Sequelize[_0xc5b4('0x8')]},'uniqueid':{'type':Sequelize[_0xc5b4('0x8')]},'calleridname':{'type':Sequelize[_0xc5b4('0x8')]},'calleridnum':{'type':Sequelize[_0xc5b4('0x8')]},'completed':{'type':Sequelize[_0xc5b4('0x9')],'defaultValue':![]}}; \ No newline at end of file +var _0x651d=['setDataValue','starttime','endtime','STRING','BOOLEAN','DATE'];(function(_0x2bc793,_0x35b8c7){var _0xb57419=function(_0x275a5e){while(--_0x275a5e){_0x2bc793['push'](_0x2bc793['shift']());}};_0xb57419(++_0x35b8c7);}(_0x651d,0x71));var _0xd651=function(_0x31eb67,_0x9bc8c0){_0x31eb67=_0x31eb67-0x0;var _0x2a8cb8=_0x651d[_0x31eb67];return _0x2a8cb8;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'starttime':{'type':Sequelize[_0xd651('0x0')],'set':function(_0x1bed0d){this[_0xd651('0x1')](_0xd651('0x2'),_0x1bed0d);this[_0xd651('0x1')](_0xd651('0x3'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0xd651('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xd651('0x4')]},'uniqueid':{'type':Sequelize[_0xd651('0x4')]},'calleridname':{'type':Sequelize[_0xd651('0x4')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0xd651('0x5')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index b0ab0f9..dd3c413 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 _0x5927=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','type','VIRTUAL','JscriptySessionReport','includeAll','rows','catch','show','params','include','options','find','create','body','describe','getQuestions','JscriptyQuestionReport','SessionId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters'];(function(_0x1cf311,_0xa92991){var _0x1b3f71=function(_0x471e18){while(--_0x471e18){_0x1cf311['push'](_0x1cf311['shift']());}};_0x1b3f71(++_0xa92991);}(_0x5927,0x10a));var _0x7592=function(_0x31880d,_0x4f0ff3){_0x31880d=_0x31880d-0x0;var _0x423823=_0x5927[_0x31880d];return _0x423823;};'use strict';var emlformat=require(_0x7592('0x0'));var rimraf=require(_0x7592('0x1'));var zipdir=require(_0x7592('0x2'));var jsonpatch=require(_0x7592('0x3'));var rp=require(_0x7592('0x4'));var moment=require(_0x7592('0x5'));var BPromise=require(_0x7592('0x6'));var Mustache=require('mustache');var util=require(_0x7592('0x7'));var path=require('path');var sox=require(_0x7592('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7592('0x9'));var _=require(_0x7592('0xa'));var squel=require('squel');var crypto=require(_0x7592('0xb'));var jsforce=require(_0x7592('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7592('0xd'));var Papa=require(_0x7592('0xe'));var Redis=require(_0x7592('0xf'));var authService=require(_0x7592('0x10'));var qs=require(_0x7592('0x11'));var as=require(_0x7592('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7592('0x13'));var utils=require(_0x7592('0x14'));var config=require(_0x7592('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x252b3e,_0x3e04ce){_0x3e04ce=_0x3e04ce||0xcc;return function(_0x47c662){if(_0x47c662){return _0x252b3e[_0x7592('0x16')](_0x3e04ce);}return _0x252b3e[_0x7592('0x17')](_0x3e04ce)[_0x7592('0x18')]();};}function respondWithResult(_0x256681,_0x12b53f){_0x12b53f=_0x12b53f||0xc8;return function(_0x2e3901){if(_0x2e3901){return _0x256681[_0x7592('0x17')](_0x12b53f)[_0x7592('0x19')](_0x2e3901);}};}function respondWithFilteredResult(_0x3f3cb9,_0x1a419e){return function(_0x3157c7){if(_0x3157c7){var _0x361ac9=typeof _0x1a419e[_0x7592('0x1a')]==='undefined'&&typeof _0x1a419e[_0x7592('0x1b')]===_0x7592('0x1c');var _0x13e16f=_0x3157c7['count'];var _0x4261ed=_0x361ac9?0x0:_0x1a419e[_0x7592('0x1a')];var _0x35c02b=_0x361ac9?_0x3157c7[_0x7592('0x1d')]:_0x1a419e[_0x7592('0x1a')]+_0x1a419e[_0x7592('0x1b')];var _0x2e62ff;if(_0x35c02b>=_0x13e16f){_0x35c02b=_0x13e16f;_0x2e62ff=0xc8;}else{_0x2e62ff=0xce;}_0x3f3cb9['status'](_0x2e62ff);return _0x3f3cb9['set'](_0x7592('0x1e'),_0x4261ed+'-'+_0x35c02b+'/'+_0x13e16f)[_0x7592('0x19')](_0x3157c7);}return null;};}function patchUpdates(_0x2ec8e3){return function(_0x58ca66){try{jsonpatch[_0x7592('0x1f')](_0x58ca66,_0x2ec8e3,!![]);}catch(_0x1c2c1c){return BPromise[_0x7592('0x20')](_0x1c2c1c);}return _0x58ca66[_0x7592('0x21')]();};}function saveUpdates(_0x5858d0,_0x2f9e60){return function(_0x409f90){if(_0x409f90){return _0x409f90[_0x7592('0x22')](_0x5858d0)[_0x7592('0x23')](function(_0x3ae150){return _0x3ae150;});}return null;};}function removeEntity(_0x12607c,_0x442368){return function(_0x4b26a4){if(_0x4b26a4){return _0x4b26a4[_0x7592('0x24')]()['then'](function(){_0x12607c[_0x7592('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3dc08d,_0x145492){return function(_0x515f91){if(!_0x515f91){_0x3dc08d['sendStatus'](0x194);}return _0x515f91;};}function handleError(_0x5c5504,_0x3b3500){_0x3b3500=_0x3b3500||0x1f4;return function(_0x51d1f7){logger[_0x7592('0x25')](_0x51d1f7[_0x7592('0x26')]);if(_0x51d1f7[_0x7592('0x27')]){delete _0x51d1f7['name'];}_0x5c5504[_0x7592('0x17')](_0x3b3500)[_0x7592('0x28')](_0x51d1f7);};}exports[_0x7592('0x29')]=function(_0x487624,_0x574ec8){var _0x1da51d={},_0x2d6dec={},_0x58a867={'count':0x0,'rows':[]};var _0x3fcd1a=_[_0x7592('0x2a')](db['JscriptySessionReport'][_0x7592('0x2b')],function(_0x105f60){return{'name':_0x105f60[_0x7592('0x2c')],'type':_0x105f60['type'][_0x7592('0x2d')]};});_0x2d6dec[_0x7592('0x2e')]=_[_0x7592('0x2a')](_0x3fcd1a,_0x7592('0x27'));_0x2d6dec[_0x7592('0x2f')]=_[_0x7592('0x30')](_0x487624['query']);_0x2d6dec[_0x7592('0x31')]=_[_0x7592('0x32')](_0x2d6dec[_0x7592('0x2e')],_0x2d6dec[_0x7592('0x2f')]);_0x1da51d[_0x7592('0x33')]=_['intersection'](_0x2d6dec[_0x7592('0x2e')],qs[_0x7592('0x34')](_0x487624[_0x7592('0x2f')][_0x7592('0x34')]));_0x1da51d[_0x7592('0x33')]=_0x1da51d['attributes'][_0x7592('0x35')]?_0x1da51d['attributes']:_0x2d6dec['model'];if(!_0x487624[_0x7592('0x2f')][_0x7592('0x36')](_0x7592('0x37'))){_0x1da51d['limit']=qs[_0x7592('0x1b')](_0x487624[_0x7592('0x2f')][_0x7592('0x1b')]);_0x1da51d[_0x7592('0x1a')]=qs[_0x7592('0x1a')](_0x487624['query']['offset']);}_0x1da51d[_0x7592('0x38')]=qs[_0x7592('0x39')](_0x487624['query']['sort']);_0x1da51d['where']=qs[_0x7592('0x31')](_['pick'](_0x487624[_0x7592('0x2f')],_0x2d6dec['filters']),_0x3fcd1a);if(_0x487624[_0x7592('0x2f')][_0x7592('0x3a')]){_0x1da51d['where']=_[_0x7592('0x3b')](_0x1da51d[_0x7592('0x3c')],{'$or':_[_0x7592('0x2a')](_0x3fcd1a,function(_0x53e074){if(_0x53e074[_0x7592('0x3d')]!==_0x7592('0x3e')){var _0x560499={};_0x560499[_0x53e074[_0x7592('0x27')]]={'$like':'%'+_0x487624[_0x7592('0x2f')][_0x7592('0x3a')]+'%'};return _0x560499;}})});}_0x1da51d=_[_0x7592('0x3b')]({},_0x1da51d,_0x487624['options']);var _0x5cc57b={'where':_0x1da51d[_0x7592('0x3c')]};return db[_0x7592('0x3f')][_0x7592('0x1d')](_0x5cc57b)[_0x7592('0x23')](function(_0x575790){_0x58a867[_0x7592('0x1d')]=_0x575790;if(_0x487624[_0x7592('0x2f')][_0x7592('0x40')]){_0x1da51d['include']=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x1da51d);})['then'](function(_0x4571ca){_0x58a867[_0x7592('0x41')]=_0x4571ca;return _0x58a867;})['then'](respondWithFilteredResult(_0x574ec8,_0x1da51d))[_0x7592('0x42')](handleError(_0x574ec8,null));};exports[_0x7592('0x43')]=function(_0x1066cd,_0x82f2d8){var _0x19d2d6={'raw':!![],'where':{'id':_0x1066cd[_0x7592('0x44')]['id']}},_0x5f1e25={};_0x5f1e25[_0x7592('0x2e')]=_[_0x7592('0x30')](db[_0x7592('0x3f')]['rawAttributes']);_0x5f1e25[_0x7592('0x2f')]=_['keys'](_0x1066cd[_0x7592('0x2f')]);_0x5f1e25['filters']=_[_0x7592('0x32')](_0x5f1e25[_0x7592('0x2e')],_0x5f1e25[_0x7592('0x2f')]);_0x19d2d6[_0x7592('0x33')]=_['intersection'](_0x5f1e25[_0x7592('0x2e')],qs[_0x7592('0x34')](_0x1066cd['query'][_0x7592('0x34')]));_0x19d2d6[_0x7592('0x33')]=_0x19d2d6['attributes'][_0x7592('0x35')]?_0x19d2d6['attributes']:_0x5f1e25['model'];if(_0x1066cd[_0x7592('0x2f')][_0x7592('0x40')]){_0x19d2d6[_0x7592('0x45')]=[{'all':!![]}];}_0x19d2d6=_['merge']({},_0x19d2d6,_0x1066cd[_0x7592('0x46')]);return db[_0x7592('0x3f')][_0x7592('0x47')](_0x19d2d6)[_0x7592('0x23')](handleEntityNotFound(_0x82f2d8,null))[_0x7592('0x23')](respondWithResult(_0x82f2d8,null))['catch'](handleError(_0x82f2d8,null));};exports[_0x7592('0x48')]=function(_0x40ce65,_0x348990){return db[_0x7592('0x3f')][_0x7592('0x48')](_0x40ce65[_0x7592('0x49')],{})[_0x7592('0x23')](respondWithResult(_0x348990,0xc9))[_0x7592('0x42')](handleError(_0x348990,null));};exports[_0x7592('0x22')]=function(_0xc34ad5,_0x4d6b85){if(_0xc34ad5[_0x7592('0x49')]['id']){delete _0xc34ad5[_0x7592('0x49')]['id'];}return db[_0x7592('0x3f')][_0x7592('0x47')]({'where':{'id':_0xc34ad5[_0x7592('0x44')]['id']}})[_0x7592('0x23')](handleEntityNotFound(_0x4d6b85,null))[_0x7592('0x23')](saveUpdates(_0xc34ad5[_0x7592('0x49')],null))[_0x7592('0x23')](respondWithResult(_0x4d6b85,null))[_0x7592('0x42')](handleError(_0x4d6b85,null));};exports[_0x7592('0x24')]=function(_0x5dbdde,_0x35fd92){return db[_0x7592('0x3f')][_0x7592('0x47')]({'where':{'id':_0x5dbdde[_0x7592('0x44')]['id']}})[_0x7592('0x23')](handleEntityNotFound(_0x35fd92,null))[_0x7592('0x23')](removeEntity(_0x35fd92,null))[_0x7592('0x42')](handleError(_0x35fd92,null));};exports[_0x7592('0x4a')]=function(_0x1ff057,_0x9f31e4){return db[_0x7592('0x3f')][_0x7592('0x4a')]()[_0x7592('0x23')](respondWithResult(_0x9f31e4,null))['catch'](handleError(_0x9f31e4,null));};exports[_0x7592('0x4b')]=function(_0x655fd3,_0x2d0fbf,_0x43f8ea){var _0x30bde1={'raw':!![],'where':{}};var _0x1c1a06={};var _0xe34c4c={'count':0x0,'rows':[]};return db['JscriptySessionReport']['findOne']({'where':{'id':_0x655fd3[_0x7592('0x44')]['id']}})['then'](handleEntityNotFound(_0x2d0fbf,null))[_0x7592('0x23')](function(_0x233157){if(_0x233157){_0x1c1a06[_0x7592('0x2e')]=_['keys'](db[_0x7592('0x4c')]['rawAttributes']);_0x1c1a06[_0x7592('0x2f')]=_['keys'](_0x655fd3[_0x7592('0x2f')]);_0x1c1a06[_0x7592('0x31')]=_[_0x7592('0x32')](_0x1c1a06[_0x7592('0x2e')],_0x1c1a06['query']);_0x30bde1['attributes']=_['intersection'](_0x1c1a06[_0x7592('0x2e')],qs['fields'](_0x655fd3[_0x7592('0x2f')][_0x7592('0x34')]));_0x30bde1[_0x7592('0x33')]=_0x30bde1['attributes'][_0x7592('0x35')]?_0x30bde1[_0x7592('0x33')]:_0x1c1a06[_0x7592('0x2e')];if(!_0x655fd3[_0x7592('0x2f')][_0x7592('0x36')](_0x7592('0x37'))){_0x30bde1[_0x7592('0x1b')]=qs['limit'](_0x655fd3[_0x7592('0x2f')][_0x7592('0x1b')]);_0x30bde1[_0x7592('0x1a')]=qs[_0x7592('0x1a')](_0x655fd3[_0x7592('0x2f')]['offset']);}_0x30bde1['order']=qs['sort'](_0x655fd3[_0x7592('0x2f')][_0x7592('0x39')]);_0x30bde1[_0x7592('0x3c')]=qs[_0x7592('0x31')](_['pick'](_0x655fd3[_0x7592('0x2f')],_0x1c1a06[_0x7592('0x31')]));_0x30bde1[_0x7592('0x3c')][_0x7592('0x4d')]=_0x233157['id'];if(_0x655fd3[_0x7592('0x2f')][_0x7592('0x3a')]){_0x30bde1[_0x7592('0x3c')]=_[_0x7592('0x3b')](_0x30bde1[_0x7592('0x3c')],{'$or':_[_0x7592('0x2a')](_0x30bde1['attributes'],function(_0x26ccb3){var _0x725ffa={};_0x725ffa[_0x26ccb3]={'$like':'%'+_0x655fd3[_0x7592('0x2f')][_0x7592('0x3a')]+'%'};return _0x725ffa;})});}_0x30bde1=_[_0x7592('0x3b')]({},_0x30bde1,_0x655fd3[_0x7592('0x46')]);return db[_0x7592('0x4c')]['count']({'where':_0x30bde1[_0x7592('0x3c')]})[_0x7592('0x23')](function(_0x3cf71f){_0xe34c4c[_0x7592('0x1d')]=_0x3cf71f;if(_0x655fd3[_0x7592('0x2f')]['includeAll']){_0x30bde1[_0x7592('0x45')]=[{'all':!![]}];}return db[_0x7592('0x4c')][_0x7592('0x4e')](_0x30bde1);})[_0x7592('0x23')](function(_0x236302){_0xe34c4c[_0x7592('0x41')]=_0x236302;return _0xe34c4c;});}})[_0x7592('0x23')](respondWithFilteredResult(_0x2d0fbf,_0x30bde1))[_0x7592('0x42')](handleError(_0x2d0fbf,null));}; \ No newline at end of file +var _0x1f73=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','SessionId','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','JscriptySessionReport','fieldName','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x443a39,_0x4509c1){var _0x53ebe8=function(_0x861b1e){while(--_0x861b1e){_0x443a39['push'](_0x443a39['shift']());}};_0x53ebe8(++_0x4509c1);}(_0x1f73,0x6e));var _0x31f7=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x1f73[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0x31f7('0x0'));var rimraf=require(_0x31f7('0x1'));var zipdir=require(_0x31f7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x31f7('0x3'));var moment=require(_0x31f7('0x4'));var BPromise=require(_0x31f7('0x5'));var Mustache=require(_0x31f7('0x6'));var util=require(_0x31f7('0x7'));var path=require(_0x31f7('0x8'));var sox=require(_0x31f7('0x9'));var csv=require(_0x31f7('0xa'));var ejs=require(_0x31f7('0xb'));var fs=require('fs');var fs_extra=require(_0x31f7('0xc'));var _=require(_0x31f7('0xd'));var squel=require('squel');var crypto=require(_0x31f7('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x31f7('0xf'));var toCsv=require(_0x31f7('0xa'));var querystring=require('querystring');var Papa=require(_0x31f7('0x10'));var Redis=require(_0x31f7('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x31f7('0x12'));var as=require(_0x31f7('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x31f7('0x14'))(_0x31f7('0x15'));var utils=require(_0x31f7('0x16'));var config=require(_0x31f7('0x17'));var licenseUtil=require(_0x31f7('0x18'));var db=require(_0x31f7('0x19'))['db'];function respondWithStatusCode(_0x1b419b,_0x2f5d06){_0x2f5d06=_0x2f5d06||0xcc;return function(_0x51363b){if(_0x51363b){return _0x1b419b[_0x31f7('0x1a')](_0x2f5d06);}return _0x1b419b[_0x31f7('0x1b')](_0x2f5d06)['end']();};}function respondWithResult(_0x5a35aa,_0x291d99){_0x291d99=_0x291d99||0xc8;return function(_0x241972){if(_0x241972){return _0x5a35aa[_0x31f7('0x1b')](_0x291d99)[_0x31f7('0x1c')](_0x241972);}};}function respondWithFilteredResult(_0x13334f,_0x4c6713){return function(_0x363e52){if(_0x363e52){var _0x18ddf0=typeof _0x4c6713[_0x31f7('0x1d')]===_0x31f7('0x1e')&&typeof _0x4c6713[_0x31f7('0x1f')]===_0x31f7('0x1e');var _0x1e4bc7=_0x363e52[_0x31f7('0x20')];var _0x28af05=_0x18ddf0?0x0:_0x4c6713[_0x31f7('0x1d')];var _0x22b776=_0x18ddf0?_0x363e52[_0x31f7('0x20')]:_0x4c6713[_0x31f7('0x1d')]+_0x4c6713[_0x31f7('0x1f')];var _0x1a0fde;if(_0x22b776>=_0x1e4bc7){_0x22b776=_0x1e4bc7;_0x1a0fde=0xc8;}else{_0x1a0fde=0xce;}_0x13334f[_0x31f7('0x1b')](_0x1a0fde);return _0x13334f['set'](_0x31f7('0x21'),_0x28af05+'-'+_0x22b776+'/'+_0x1e4bc7)[_0x31f7('0x1c')](_0x363e52);}return null;};}function patchUpdates(_0x3e0f27){return function(_0x54f35d){try{jsonpatch[_0x31f7('0x22')](_0x54f35d,_0x3e0f27,!![]);}catch(_0xbcc1e1){return BPromise[_0x31f7('0x23')](_0xbcc1e1);}return _0x54f35d[_0x31f7('0x24')]();};}function saveUpdates(_0x2cee14,_0xa21153){return function(_0x31dc06){if(_0x31dc06){return _0x31dc06[_0x31f7('0x25')](_0x2cee14)[_0x31f7('0x26')](function(_0x3845af){return _0x3845af;});}return null;};}function removeEntity(_0x4b12a5,_0x27ff54){return function(_0x401841){if(_0x401841){return _0x401841[_0x31f7('0x27')]()[_0x31f7('0x26')](function(){_0x4b12a5[_0x31f7('0x1b')](0xcc)[_0x31f7('0x28')]();});}};}function handleEntityNotFound(_0x453626,_0x3722ab){return function(_0x56e131){if(!_0x56e131){_0x453626['sendStatus'](0x194);}return _0x56e131;};}function handleError(_0x3dd7c3,_0x5be980){_0x5be980=_0x5be980||0x1f4;return function(_0xdc1c0){logger['error'](_0xdc1c0[_0x31f7('0x29')]);if(_0xdc1c0[_0x31f7('0x2a')]){delete _0xdc1c0[_0x31f7('0x2a')];}_0x3dd7c3['status'](_0x5be980)[_0x31f7('0x2b')](_0xdc1c0);};}exports[_0x31f7('0x2c')]=function(_0x3d38c1,_0x4206c4){var _0x40ab8a={},_0x12506d={},_0x1560ee={'count':0x0,'rows':[]};var _0x3086a0=_[_0x31f7('0x2d')](db[_0x31f7('0x2e')]['rawAttributes'],function(_0x23c173){return{'name':_0x23c173[_0x31f7('0x2f')],'type':_0x23c173[_0x31f7('0x30')][_0x31f7('0x31')]};});_0x12506d[_0x31f7('0x32')]=_[_0x31f7('0x2d')](_0x3086a0,_0x31f7('0x2a'));_0x12506d[_0x31f7('0x33')]=_[_0x31f7('0x34')](_0x3d38c1[_0x31f7('0x33')]);_0x12506d[_0x31f7('0x35')]=_[_0x31f7('0x36')](_0x12506d[_0x31f7('0x32')],_0x12506d[_0x31f7('0x33')]);_0x40ab8a[_0x31f7('0x37')]=_[_0x31f7('0x36')](_0x12506d['model'],qs[_0x31f7('0x38')](_0x3d38c1[_0x31f7('0x33')]['fields']));_0x40ab8a[_0x31f7('0x37')]=_0x40ab8a['attributes'][_0x31f7('0x39')]?_0x40ab8a[_0x31f7('0x37')]:_0x12506d['model'];if(!_0x3d38c1[_0x31f7('0x33')][_0x31f7('0x3a')](_0x31f7('0x3b'))){_0x40ab8a[_0x31f7('0x1f')]=qs[_0x31f7('0x1f')](_0x3d38c1[_0x31f7('0x33')][_0x31f7('0x1f')]);_0x40ab8a[_0x31f7('0x1d')]=qs[_0x31f7('0x1d')](_0x3d38c1[_0x31f7('0x33')][_0x31f7('0x1d')]);}_0x40ab8a[_0x31f7('0x3c')]=qs[_0x31f7('0x3d')](_0x3d38c1['query']['sort']);_0x40ab8a[_0x31f7('0x3e')]=qs['filters'](_[_0x31f7('0x3f')](_0x3d38c1[_0x31f7('0x33')],_0x12506d[_0x31f7('0x35')]),_0x3086a0);if(_0x3d38c1['query'][_0x31f7('0x40')]){_0x40ab8a['where']=_[_0x31f7('0x41')](_0x40ab8a['where'],{'$or':_['map'](_0x3086a0,function(_0x30506d){if(_0x30506d['type']!=='VIRTUAL'){var _0xe621f9={};_0xe621f9[_0x30506d['name']]={'$like':'%'+_0x3d38c1[_0x31f7('0x33')][_0x31f7('0x40')]+'%'};return _0xe621f9;}})});}_0x40ab8a=_['merge']({},_0x40ab8a,_0x3d38c1[_0x31f7('0x42')]);var _0x4478c2={'where':_0x40ab8a[_0x31f7('0x3e')]};return db[_0x31f7('0x2e')][_0x31f7('0x20')](_0x4478c2)['then'](function(_0x4d0c61){_0x1560ee['count']=_0x4d0c61;if(_0x3d38c1[_0x31f7('0x33')][_0x31f7('0x43')]){_0x40ab8a[_0x31f7('0x44')]=[{'all':!![]}];}return db[_0x31f7('0x2e')][_0x31f7('0x45')](_0x40ab8a);})[_0x31f7('0x26')](function(_0x68d468){_0x1560ee[_0x31f7('0x46')]=_0x68d468;return _0x1560ee;})[_0x31f7('0x26')](respondWithFilteredResult(_0x4206c4,_0x40ab8a))[_0x31f7('0x47')](handleError(_0x4206c4,null));};exports[_0x31f7('0x48')]=function(_0x591624,_0xb78248){var _0x457e25={'raw':!![],'where':{'id':_0x591624[_0x31f7('0x49')]['id']}},_0x1c1a9d={};_0x1c1a9d['model']=_['keys'](db[_0x31f7('0x2e')][_0x31f7('0x4a')]);_0x1c1a9d[_0x31f7('0x33')]=_['keys'](_0x591624[_0x31f7('0x33')]);_0x1c1a9d[_0x31f7('0x35')]=_[_0x31f7('0x36')](_0x1c1a9d['model'],_0x1c1a9d[_0x31f7('0x33')]);_0x457e25['attributes']=_['intersection'](_0x1c1a9d[_0x31f7('0x32')],qs[_0x31f7('0x38')](_0x591624[_0x31f7('0x33')][_0x31f7('0x38')]));_0x457e25[_0x31f7('0x37')]=_0x457e25[_0x31f7('0x37')][_0x31f7('0x39')]?_0x457e25[_0x31f7('0x37')]:_0x1c1a9d[_0x31f7('0x32')];if(_0x591624['query']['includeAll']){_0x457e25[_0x31f7('0x44')]=[{'all':!![]}];}_0x457e25=_[_0x31f7('0x41')]({},_0x457e25,_0x591624[_0x31f7('0x42')]);return db['JscriptySessionReport'][_0x31f7('0x4b')](_0x457e25)[_0x31f7('0x26')](handleEntityNotFound(_0xb78248,null))[_0x31f7('0x26')](respondWithResult(_0xb78248,null))[_0x31f7('0x47')](handleError(_0xb78248,null));};exports['create']=function(_0x153a6f,_0x3e6ebd){return db[_0x31f7('0x2e')][_0x31f7('0x4c')](_0x153a6f['body'],{})[_0x31f7('0x26')](respondWithResult(_0x3e6ebd,0xc9))[_0x31f7('0x47')](handleError(_0x3e6ebd,null));};exports[_0x31f7('0x25')]=function(_0x55add4,_0x404341){if(_0x55add4[_0x31f7('0x4d')]['id']){delete _0x55add4['body']['id'];}return db[_0x31f7('0x2e')]['find']({'where':{'id':_0x55add4[_0x31f7('0x49')]['id']}})['then'](handleEntityNotFound(_0x404341,null))['then'](saveUpdates(_0x55add4[_0x31f7('0x4d')],null))[_0x31f7('0x26')](respondWithResult(_0x404341,null))[_0x31f7('0x47')](handleError(_0x404341,null));};exports['destroy']=function(_0x55f5d8,_0x396729){return db[_0x31f7('0x2e')]['find']({'where':{'id':_0x55f5d8[_0x31f7('0x49')]['id']}})[_0x31f7('0x26')](handleEntityNotFound(_0x396729,null))[_0x31f7('0x26')](removeEntity(_0x396729,null))[_0x31f7('0x47')](handleError(_0x396729,null));};exports['describe']=function(_0x1e4804,_0x1bd8a2){return db[_0x31f7('0x2e')][_0x31f7('0x4e')]()['then'](respondWithResult(_0x1bd8a2,null))[_0x31f7('0x47')](handleError(_0x1bd8a2,null));};exports[_0x31f7('0x4f')]=function(_0x1f26c0,_0x135ff1,_0x3540b3){var _0x4d2686={'raw':!![],'where':{}};var _0x167fb8={};var _0x2e6000={'count':0x0,'rows':[]};return db[_0x31f7('0x2e')][_0x31f7('0x50')]({'where':{'id':_0x1f26c0[_0x31f7('0x49')]['id']}})[_0x31f7('0x26')](handleEntityNotFound(_0x135ff1,null))[_0x31f7('0x26')](function(_0x230bce){if(_0x230bce){_0x167fb8[_0x31f7('0x32')]=_[_0x31f7('0x34')](db[_0x31f7('0x51')][_0x31f7('0x4a')]);_0x167fb8['query']=_[_0x31f7('0x34')](_0x1f26c0[_0x31f7('0x33')]);_0x167fb8['filters']=_[_0x31f7('0x36')](_0x167fb8['model'],_0x167fb8['query']);_0x4d2686[_0x31f7('0x37')]=_[_0x31f7('0x36')](_0x167fb8[_0x31f7('0x32')],qs['fields'](_0x1f26c0[_0x31f7('0x33')][_0x31f7('0x38')]));_0x4d2686[_0x31f7('0x37')]=_0x4d2686[_0x31f7('0x37')][_0x31f7('0x39')]?_0x4d2686['attributes']:_0x167fb8[_0x31f7('0x32')];if(!_0x1f26c0[_0x31f7('0x33')][_0x31f7('0x3a')](_0x31f7('0x3b'))){_0x4d2686[_0x31f7('0x1f')]=qs[_0x31f7('0x1f')](_0x1f26c0[_0x31f7('0x33')]['limit']);_0x4d2686[_0x31f7('0x1d')]=qs[_0x31f7('0x1d')](_0x1f26c0['query'][_0x31f7('0x1d')]);}_0x4d2686[_0x31f7('0x3c')]=qs[_0x31f7('0x3d')](_0x1f26c0[_0x31f7('0x33')][_0x31f7('0x3d')]);_0x4d2686[_0x31f7('0x3e')]=qs[_0x31f7('0x35')](_[_0x31f7('0x3f')](_0x1f26c0[_0x31f7('0x33')],_0x167fb8[_0x31f7('0x35')]));_0x4d2686['where'][_0x31f7('0x52')]=_0x230bce['id'];if(_0x1f26c0[_0x31f7('0x33')][_0x31f7('0x40')]){_0x4d2686[_0x31f7('0x3e')]=_['merge'](_0x4d2686[_0x31f7('0x3e')],{'$or':_[_0x31f7('0x2d')](_0x4d2686[_0x31f7('0x37')],function(_0x2b1656){var _0x16d995={};_0x16d995[_0x2b1656]={'$like':'%'+_0x1f26c0['query'][_0x31f7('0x40')]+'%'};return _0x16d995;})});}_0x4d2686=_[_0x31f7('0x41')]({},_0x4d2686,_0x1f26c0[_0x31f7('0x42')]);return db[_0x31f7('0x51')]['count']({'where':_0x4d2686[_0x31f7('0x3e')]})[_0x31f7('0x26')](function(_0x3e9a07){_0x2e6000[_0x31f7('0x20')]=_0x3e9a07;if(_0x1f26c0[_0x31f7('0x33')][_0x31f7('0x43')]){_0x4d2686[_0x31f7('0x44')]=[{'all':!![]}];}return db[_0x31f7('0x51')][_0x31f7('0x45')](_0x4d2686);})[_0x31f7('0x26')](function(_0x3c9301){_0x2e6000['rows']=_0x3c9301;return _0x2e6000;});}})[_0x31f7('0x26')](respondWithFilteredResult(_0x135ff1,_0x4d2686))[_0x31f7('0x47')](handleError(_0x135ff1,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 52d361f..65ecec0 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 _0x46ed=['lodash','util','api','moment','bluebird','path','rimraf','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x46ed,0x168));var _0xd46e=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x46ed[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var logger=require('../../config/logger')(_0xd46e('0x2'));var moment=require(_0xd46e('0x3'));var BPromise=require(_0xd46e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd46e('0x5'));var rimraf=require(_0xd46e('0x6'));var config=require('../../config/environment');var attributes=require(_0xd46e('0x7'));module[_0xd46e('0x8')]=function(_0x160bcf,_0x25cf78){return _0x160bcf[_0xd46e('0x9')](_0xd46e('0xa'),attributes,{'tableName':_0xd46e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcd59=['bluebird','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','api','moment'];(function(_0x1204a4,_0xee6c6e){var _0x13c23c=function(_0x15b44f){while(--_0x15b44f){_0x1204a4['push'](_0x1204a4['shift']());}};_0x13c23c(++_0xee6c6e);}(_0xcd59,0x14b));var _0x9cd5=function(_0x1acf4d,_0x271e6b){_0x1acf4d=_0x1acf4d-0x0;var _0x2880a0=_0xcd59[_0x1acf4d];return _0x2880a0;};'use strict';var _=require(_0x9cd5('0x0'));var util=require(_0x9cd5('0x1'));var logger=require(_0x9cd5('0x2'))(_0x9cd5('0x3'));var moment=require(_0x9cd5('0x4'));var BPromise=require(_0x9cd5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9cd5('0x6'));var rimraf=require(_0x9cd5('0x7'));var config=require(_0x9cd5('0x8'));var attributes=require(_0x9cd5('0x9'));module[_0x9cd5('0xa')]=function(_0x2db192,_0x46277c){return _0x2db192[_0x9cd5('0xb')](_0x9cd5('0xc'),attributes,{'tableName':_0x9cd5('0xd'),'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 5c97943..6d6b2d2 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 _0x8e3f=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x493150,_0x107958){var _0x3fe8da=function(_0xce7a75){while(--_0xce7a75){_0x493150['push'](_0x493150['shift']());}};_0x3fe8da(++_0x107958);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x8e3f[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xf8e3('0x0'));var util=require(_0xf8e3('0x1'));var moment=require(_0xf8e3('0x2'));var BPromise=require('bluebird');var rs=require(_0xf8e3('0x3'));var fs=require('fs');var Redis=require(_0xf8e3('0x4'));var db=require(_0xf8e3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf8e3('0x6'))(_0xf8e3('0x7'));var config=require('../../config/environment');var jayson=require(_0xf8e3('0x8'));var client=jayson[_0xf8e3('0x9')][_0xf8e3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ee9f3,_0x4e9e57,_0x4504dd){return new BPromise(function(_0x2e39b7,_0x17f56c){return client[_0xf8e3('0xb')](_0x1ee9f3,_0x4504dd)[_0xf8e3('0xc')](function(_0x4055e2){logger[_0xf8e3('0xd')](_0xf8e3('0xe'),_0x4e9e57,_0xf8e3('0xf'));logger[_0xf8e3('0x10')](_0xf8e3('0x11'),_0x4e9e57,_0xf8e3('0xf'),JSON['stringify'](_0x4055e2));if(_0x4055e2[_0xf8e3('0x12')]){if(_0x4055e2[_0xf8e3('0x12')][_0xf8e3('0x13')]===0x1f4){logger['error'](_0xf8e3('0xe'),_0x4e9e57,_0x4055e2[_0xf8e3('0x12')][_0xf8e3('0x14')]);return _0x17f56c(_0x4055e2[_0xf8e3('0x12')]['message']);}logger[_0xf8e3('0x12')](_0xf8e3('0xe'),_0x4e9e57,_0x4055e2[_0xf8e3('0x12')]['message']);return _0x2e39b7(_0x4055e2[_0xf8e3('0x12')]['message']);}else{logger[_0xf8e3('0xd')](_0xf8e3('0xe'),_0x4e9e57,_0xf8e3('0xf'));_0x2e39b7(_0x4055e2['result']['message']);}})[_0xf8e3('0x15')](function(_0x385dde){logger[_0xf8e3('0x12')](_0xf8e3('0xe'),_0x4e9e57,_0x385dde);_0x17f56c(_0x385dde);});});} \ No newline at end of file +var _0x6d11=['message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','JscriptySessionReport,\x20%s,\x20%s','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0xbb692b,_0x4c5f6f){var _0x48eaf2=function(_0x27e433){while(--_0x27e433){_0xbb692b['push'](_0xbb692b['shift']());}};_0x48eaf2(++_0x4c5f6f);}(_0x6d11,0xbf));var _0x16d1=function(_0x2d26c2,_0x26a9db){_0x2d26c2=_0x2d26c2-0x0;var _0x10675e=_0x6d11[_0x2d26c2];return _0x10675e;};'use strict';var _=require(_0x16d1('0x0'));var util=require(_0x16d1('0x1'));var moment=require(_0x16d1('0x2'));var BPromise=require('bluebird');var rs=require(_0x16d1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x16d1('0x4'))['db'];var utils=require(_0x16d1('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x16d1('0x6'));var jayson=require(_0x16d1('0x7'));var client=jayson[_0x16d1('0x8')][_0x16d1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1009dc,_0x150217,_0x19390d){return new BPromise(function(_0x5d0e3f,_0x58a7a2){return client['request'](_0x1009dc,_0x19390d)[_0x16d1('0xa')](function(_0xcfbb15){logger[_0x16d1('0xb')](_0x16d1('0xc'),_0x150217,'request\x20sent');logger[_0x16d1('0xd')](_0x16d1('0xe'),_0x150217,_0x16d1('0xf'),JSON[_0x16d1('0x10')](_0xcfbb15));if(_0xcfbb15[_0x16d1('0x11')]){if(_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x12')]===0x1f4){logger[_0x16d1('0x11')]('JscriptySessionReport,\x20%s,\x20%s',_0x150217,_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);return _0x58a7a2(_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);}logger[_0x16d1('0x11')]('JscriptySessionReport,\x20%s,\x20%s',_0x150217,_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);return _0x5d0e3f(_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);}else{logger[_0x16d1('0xb')](_0x16d1('0xc'),_0x150217,_0x16d1('0xf'));_0x5d0e3f(_0xcfbb15['result'][_0x16d1('0x13')]);}})[_0x16d1('0x14')](function(_0x555b2d){logger['error'](_0x16d1('0xc'),_0x150217,_0x555b2d);_0x58a7a2(_0x555b2d);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 092a59a..f48f8aa 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 _0x83c8=['index','put','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x83c8,0x8a));var _0x883c=function(_0x48b810,_0x173a5e){_0x48b810=_0x48b810-0x0;var _0x23c17d=_0x83c8[_0x48b810];return _0x23c17d;};'use strict';var multer=require(_0x883c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x883c('0x1'));var express=require('express');var router=express[_0x883c('0x2')]();var fs_extra=require(_0x883c('0x3'));var auth=require(_0x883c('0x4'));var interaction=require(_0x883c('0x5'));var config=require('../../config/environment');var controller=require('./license.controller');router['get']('/',controller[_0x883c('0x6')]);router[_0x883c('0x7')]('/:id',auth['isAuthenticated'](),controller['update']);module[_0x883c('0x8')]=router; \ No newline at end of file +var _0x70d8=['update','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./license.controller','put','/:id','isAuthenticated'];(function(_0x3c2587,_0x303282){var _0x4e8fd4=function(_0x28c917){while(--_0x28c917){_0x3c2587['push'](_0x3c2587['shift']());}};_0x4e8fd4(++_0x303282);}(_0x70d8,0xa9));var _0x870d=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x70d8[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x870d('0x0'));var util=require(_0x870d('0x1'));var path=require(_0x870d('0x2'));var timeout=require(_0x870d('0x3'));var express=require(_0x870d('0x4'));var router=express[_0x870d('0x5')]();var fs_extra=require(_0x870d('0x6'));var auth=require(_0x870d('0x7'));var interaction=require(_0x870d('0x8'));var config=require('../../config/environment');var controller=require(_0x870d('0x9'));router['get']('/',controller['index']);router[_0x870d('0xa')](_0x870d('0xb'),auth[_0x870d('0xc')](),controller[_0x870d('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 6e6b335..56d5c7b 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 _0xb80f=['TEXT','STRING','INTEGER','exports'];(function(_0x375aea,_0x5e07f6){var _0x51de20=function(_0x2c4e7e){while(--_0x2c4e7e){_0x375aea['push'](_0x375aea['shift']());}};_0x51de20(++_0x5e07f6);}(_0xb80f,0x193));var _0xfb80=function(_0x1ce599,_0x3f08fb){_0x1ce599=_0x1ce599-0x0;var _0x19d4e7=_0xb80f[_0x1ce599];return _0x19d4e7;};'use strict';var Sequelize=require('sequelize');module[_0xfb80('0x0')]={'license':{'type':Sequelize[_0xfb80('0x1')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xfb80('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0xfb80('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc636=['TEXT','STRING','exports'];(function(_0x28d348,_0x55a79a){var _0xb06217=function(_0x4e8618){while(--_0x4e8618){_0x28d348['push'](_0x28d348['shift']());}};_0xb06217(++_0x55a79a);}(_0xc636,0x1e8));var _0x6c63=function(_0x1e4944,_0x246939){_0x1e4944=_0x1e4944-0x0;var _0x31f89d=_0xc636[_0x1e4944];return _0x31f89d;};'use strict';var Sequelize=require('sequelize');module[_0x6c63('0x0')]={'license':{'type':Sequelize[_0x6c63('0x1')]},'data1':{'type':Sequelize[_0x6c63('0x2')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 59aa3ea..f3dcda6 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 _0xf494=['fields','length','merge','options','getLicense','body','License','find','params','get','key','demo','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','error','stack','name','../../config/license/util','index','model','rawAttributes','query','keys','filters','intersection','attributes'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0xf494,0x1c6));var _0x4f49=function(_0x55bd50,_0x1d1cc7){_0x55bd50=_0x55bd50-0x0;var _0x30fba0=_0xf494[_0x55bd50];return _0x30fba0;};'use strict';var emlformat=require(_0x4f49('0x0'));var rimraf=require(_0x4f49('0x1'));var zipdir=require(_0x4f49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f49('0x3'));var moment=require(_0x4f49('0x4'));var BPromise=require(_0x4f49('0x5'));var Mustache=require(_0x4f49('0x6'));var util=require(_0x4f49('0x7'));var path=require(_0x4f49('0x8'));var sox=require(_0x4f49('0x9'));var csv=require(_0x4f49('0xa'));var ejs=require(_0x4f49('0xb'));var fs=require('fs');var fs_extra=require(_0x4f49('0xc'));var _=require(_0x4f49('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4f49('0xe'));var deskjs=require(_0x4f49('0xf'));var toCsv=require(_0x4f49('0xa'));var querystring=require(_0x4f49('0x10'));var Papa=require(_0x4f49('0x11'));var Redis=require(_0x4f49('0x12'));var authService=require(_0x4f49('0x13'));var qs=require(_0x4f49('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f49('0x15'));var logger=require(_0x4f49('0x16'))('api');var utils=require(_0x4f49('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4f49('0x18'))['db'];function respondWithStatusCode(_0x12527d,_0x4bf89f){_0x4bf89f=_0x4bf89f||0xcc;return function(_0x1e1c37){if(_0x1e1c37){return _0x12527d[_0x4f49('0x19')](_0x4bf89f);}return _0x12527d[_0x4f49('0x1a')](_0x4bf89f)[_0x4f49('0x1b')]();};}function respondWithResult(_0x1a0f1e,_0x2f0131){_0x2f0131=_0x2f0131||0xc8;return function(_0xfdb477){if(_0xfdb477){return _0x1a0f1e['status'](_0x2f0131)[_0x4f49('0x1c')](_0xfdb477);}};}function respondWithFilteredResult(_0x1f2d0d,_0x415e83){return function(_0x5878f4){if(_0x5878f4){var _0x5bdfaf=typeof _0x415e83[_0x4f49('0x1d')]===_0x4f49('0x1e')&&typeof _0x415e83[_0x4f49('0x1f')]==='undefined';var _0x1dccfd=_0x5878f4[_0x4f49('0x20')];var _0x4e85df=_0x5bdfaf?0x0:_0x415e83['offset'];var _0x5bb23b=_0x5bdfaf?_0x5878f4['count']:_0x415e83['offset']+_0x415e83[_0x4f49('0x1f')];var _0x1834f4;if(_0x5bb23b>=_0x1dccfd){_0x5bb23b=_0x1dccfd;_0x1834f4=0xc8;}else{_0x1834f4=0xce;}_0x1f2d0d[_0x4f49('0x1a')](_0x1834f4);return _0x1f2d0d[_0x4f49('0x21')]('Content-Range',_0x4e85df+'-'+_0x5bb23b+'/'+_0x1dccfd)[_0x4f49('0x1c')](_0x5878f4);}return null;};}function patchUpdates(_0x2aed27){return function(_0x197a49){try{jsonpatch[_0x4f49('0x22')](_0x197a49,_0x2aed27,!![]);}catch(_0xea82f8){return BPromise['reject'](_0xea82f8);}return _0x197a49[_0x4f49('0x23')]();};}function saveUpdates(_0x357446,_0x3ae590){return function(_0x53b57d){if(_0x53b57d){return _0x53b57d[_0x4f49('0x24')](_0x357446)[_0x4f49('0x25')](function(_0x32ca7b){return _0x32ca7b;});}return null;};}function removeEntity(_0x43c458,_0x9d30aa){return function(_0x36187b){if(_0x36187b){return _0x36187b['destroy']()['then'](function(){_0x43c458[_0x4f49('0x1a')](0xcc)[_0x4f49('0x1b')]();});}};}function handleEntityNotFound(_0x4fedbb,_0x408552){return function(_0x2c1519){if(!_0x2c1519){_0x4fedbb[_0x4f49('0x19')](0x194);}return _0x2c1519;};}function handleError(_0x525950,_0xc54070){_0xc54070=_0xc54070||0x1f4;return function(_0x2eed1c){logger[_0x4f49('0x26')](_0x2eed1c[_0x4f49('0x27')]);if(_0x2eed1c[_0x4f49('0x28')]){delete _0x2eed1c[_0x4f49('0x28')];}_0x525950['status'](_0xc54070)['send'](_0x2eed1c);};}var utilLicense=require(_0x4f49('0x29'));exports[_0x4f49('0x2a')]=function(_0x605c91,_0x560050){var _0x3cbfbd={'raw':!![],'where':{'id':0x1}},_0x206203={};_0x206203[_0x4f49('0x2b')]=_['keys'](db['License'][_0x4f49('0x2c')]);_0x206203[_0x4f49('0x2d')]=_[_0x4f49('0x2e')](_0x605c91['query']);_0x206203[_0x4f49('0x2f')]=_[_0x4f49('0x30')](_0x206203[_0x4f49('0x2b')],_0x206203[_0x4f49('0x2d')]);_0x3cbfbd[_0x4f49('0x31')]=_[_0x4f49('0x30')](_0x206203[_0x4f49('0x2b')],qs[_0x4f49('0x32')](_0x605c91[_0x4f49('0x2d')][_0x4f49('0x32')]));_0x3cbfbd[_0x4f49('0x31')]=_0x3cbfbd[_0x4f49('0x31')][_0x4f49('0x33')]?_0x3cbfbd[_0x4f49('0x31')]:_0x206203[_0x4f49('0x2b')];_0x3cbfbd=_[_0x4f49('0x34')]({},_0x3cbfbd,_0x605c91[_0x4f49('0x35')]);return utilLicense[_0x4f49('0x36')](_0x3cbfbd)[_0x4f49('0x25')](respondWithResult(_0x560050,null))['catch'](handleError(_0x560050,null));};exports[_0x4f49('0x24')]=function(_0x46b7ba,_0x24f568){if(_0x46b7ba[_0x4f49('0x37')]['id']){delete _0x46b7ba[_0x4f49('0x37')]['id'];}return db[_0x4f49('0x38')][_0x4f49('0x39')]({'where':{'id':_0x46b7ba[_0x4f49('0x3a')]['id']}})[_0x4f49('0x25')](handleEntityNotFound(_0x24f568,null))[_0x4f49('0x25')](function(_0x44e6a0){var _0x343365=_0x44e6a0[_0x4f49('0x3b')]({'plain':!![]});return utilLicense['checkLicense'](_0x343365,_0x46b7ba[_0x4f49('0x37')][_0x4f49('0x3c')]);})[_0x4f49('0x25')](function(_0x26014f){if(!_0x26014f[_0x4f49('0x3d')]){return saveUpdates(_0x46b7ba[_0x4f49('0x37')],null);}return _0x26014f;})[_0x4f49('0x25')](respondWithResult(_0x24f568,null))[_0x4f49('0x3e')](handleError(_0x24f568,null));}; \ No newline at end of file +var _0x326f=['sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','stack','name','send','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','options','getLicense','catch','body','License','find','checkLicense','key','demo','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x326f,0xd1));var _0xf326=function(_0x4fd08b,_0x301dad){_0x4fd08b=_0x4fd08b-0x0;var _0x218547=_0x326f[_0x4fd08b];return _0x218547;};'use strict';var emlformat=require(_0xf326('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf326('0x1'));var rp=require(_0xf326('0x2'));var moment=require(_0xf326('0x3'));var BPromise=require(_0xf326('0x4'));var Mustache=require(_0xf326('0x5'));var util=require(_0xf326('0x6'));var path=require(_0xf326('0x7'));var sox=require(_0xf326('0x8'));var csv=require(_0xf326('0x9'));var ejs=require(_0xf326('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf326('0xb'));var squel=require(_0xf326('0xc'));var crypto=require(_0xf326('0xd'));var jsforce=require(_0xf326('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf326('0xf'));var Redis=require(_0xf326('0x10'));var authService=require(_0xf326('0x11'));var qs=require(_0xf326('0x12'));var as=require(_0xf326('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf326('0x14'))('api');var utils=require(_0xf326('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf326('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3162f9,_0x9ed463){_0x9ed463=_0x9ed463||0xcc;return function(_0x4b3966){if(_0x4b3966){return _0x3162f9[_0xf326('0x17')](_0x9ed463);}return _0x3162f9[_0xf326('0x18')](_0x9ed463)[_0xf326('0x19')]();};}function respondWithResult(_0x17a098,_0x5c8483){_0x5c8483=_0x5c8483||0xc8;return function(_0x45c1b6){if(_0x45c1b6){return _0x17a098['status'](_0x5c8483)['json'](_0x45c1b6);}};}function respondWithFilteredResult(_0xdf21d9,_0x11f6d2){return function(_0x1f2e5a){if(_0x1f2e5a){var _0xa63d1a=typeof _0x11f6d2[_0xf326('0x1a')]===_0xf326('0x1b')&&typeof _0x11f6d2[_0xf326('0x1c')]===_0xf326('0x1b');var _0x5a682a=_0x1f2e5a[_0xf326('0x1d')];var _0x453100=_0xa63d1a?0x0:_0x11f6d2[_0xf326('0x1a')];var _0x31ffb9=_0xa63d1a?_0x1f2e5a[_0xf326('0x1d')]:_0x11f6d2[_0xf326('0x1a')]+_0x11f6d2['limit'];var _0x4a5b6c;if(_0x31ffb9>=_0x5a682a){_0x31ffb9=_0x5a682a;_0x4a5b6c=0xc8;}else{_0x4a5b6c=0xce;}_0xdf21d9['status'](_0x4a5b6c);return _0xdf21d9[_0xf326('0x1e')](_0xf326('0x1f'),_0x453100+'-'+_0x31ffb9+'/'+_0x5a682a)['json'](_0x1f2e5a);}return null;};}function patchUpdates(_0x4cabce){return function(_0x128c68){try{jsonpatch['apply'](_0x128c68,_0x4cabce,!![]);}catch(_0x5b6d3c){return BPromise[_0xf326('0x20')](_0x5b6d3c);}return _0x128c68[_0xf326('0x21')]();};}function saveUpdates(_0x549b46,_0x5aa184){return function(_0x19b8ba){if(_0x19b8ba){return _0x19b8ba[_0xf326('0x22')](_0x549b46)['then'](function(_0x337ed5){return _0x337ed5;});}return null;};}function removeEntity(_0x1b9039,_0x43c53e){return function(_0x295752){if(_0x295752){return _0x295752[_0xf326('0x23')]()[_0xf326('0x24')](function(){_0x1b9039['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f31f6,_0x520d85){return function(_0x1a2c4e){if(!_0x1a2c4e){_0x4f31f6[_0xf326('0x17')](0x194);}return _0x1a2c4e;};}function handleError(_0x1ff2b5,_0x148953){_0x148953=_0x148953||0x1f4;return function(_0x410237){logger['error'](_0x410237[_0xf326('0x25')]);if(_0x410237[_0xf326('0x26')]){delete _0x410237[_0xf326('0x26')];}_0x1ff2b5['status'](_0x148953)[_0xf326('0x27')](_0x410237);};}var utilLicense=require('../../config/license/util');exports['index']=function(_0x6a8e89,_0x1ae23a){var _0x2fa28e={'raw':!![],'where':{'id':0x1}},_0x5dbe63={};_0x5dbe63[_0xf326('0x28')]=_[_0xf326('0x29')](db['License'][_0xf326('0x2a')]);_0x5dbe63[_0xf326('0x2b')]=_[_0xf326('0x29')](_0x6a8e89[_0xf326('0x2b')]);_0x5dbe63[_0xf326('0x2c')]=_[_0xf326('0x2d')](_0x5dbe63[_0xf326('0x28')],_0x5dbe63[_0xf326('0x2b')]);_0x2fa28e[_0xf326('0x2e')]=_[_0xf326('0x2d')](_0x5dbe63['model'],qs[_0xf326('0x2f')](_0x6a8e89[_0xf326('0x2b')][_0xf326('0x2f')]));_0x2fa28e['attributes']=_0x2fa28e[_0xf326('0x2e')][_0xf326('0x30')]?_0x2fa28e[_0xf326('0x2e')]:_0x5dbe63['model'];_0x2fa28e=_['merge']({},_0x2fa28e,_0x6a8e89[_0xf326('0x31')]);return utilLicense[_0xf326('0x32')](_0x2fa28e)[_0xf326('0x24')](respondWithResult(_0x1ae23a,null))[_0xf326('0x33')](handleError(_0x1ae23a,null));};exports[_0xf326('0x22')]=function(_0x2e8a64,_0x62585a){if(_0x2e8a64[_0xf326('0x34')]['id']){delete _0x2e8a64['body']['id'];}return db[_0xf326('0x35')][_0xf326('0x36')]({'where':{'id':_0x2e8a64['params']['id']}})[_0xf326('0x24')](handleEntityNotFound(_0x62585a,null))['then'](function(_0xce1cbb){var _0x481b64=_0xce1cbb['get']({'plain':!![]});return utilLicense[_0xf326('0x37')](_0x481b64,_0x2e8a64['body'][_0xf326('0x38')]);})['then'](function(_0x310dbb){if(!_0x310dbb[_0xf326('0x39')]){return saveUpdates(_0x2e8a64[_0xf326('0x34')],null);}return _0x310dbb;})['then'](respondWithResult(_0x62585a,null))[_0xf326('0x33')](handleError(_0x62585a,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 96f420f..ac54bb4 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 _0x00df=['./license.attributes','define','License','license','util','api','moment','request-promise','path','../../config/environment'];(function(_0x41f7b2,_0x58547b){var _0x19ec6d=function(_0x11f687){while(--_0x11f687){_0x41f7b2['push'](_0x41f7b2['shift']());}};_0x19ec6d(++_0x58547b);}(_0x00df,0x11c));var _0xf00d=function(_0x12882e,_0x468db5){_0x12882e=_0x12882e-0x0;var _0x141b26=_0x00df[_0x12882e];return _0x141b26;};'use strict';var _=require('lodash');var util=require(_0xf00d('0x0'));var logger=require('../../config/logger')(_0xf00d('0x1'));var moment=require(_0xf00d('0x2'));var BPromise=require('bluebird');var rp=require(_0xf00d('0x3'));var fs=require('fs');var path=require(_0xf00d('0x4'));var rimraf=require('rimraf');var config=require(_0xf00d('0x5'));var attributes=require(_0xf00d('0x6'));module['exports']=function(_0x5b0d81,_0x2a52c3){return _0x5b0d81[_0xf00d('0x7')](_0xf00d('0x8'),attributes,{'tableName':_0xf00d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1e43=['api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','license','lodash','util','../../config/logger'];(function(_0x3746fe,_0x30b6b0){var _0xb3093d=function(_0x424b01){while(--_0x424b01){_0x3746fe['push'](_0x3746fe['shift']());}};_0xb3093d(++_0x30b6b0);}(_0x1e43,0x168));var _0x31e4=function(_0x163742,_0x467e36){_0x163742=_0x163742-0x0;var _0x1152ac=_0x1e43[_0x163742];return _0x1152ac;};'use strict';var _=require(_0x31e4('0x0'));var util=require(_0x31e4('0x1'));var logger=require(_0x31e4('0x2'))(_0x31e4('0x3'));var moment=require(_0x31e4('0x4'));var BPromise=require(_0x31e4('0x5'));var rp=require(_0x31e4('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x31e4('0x7'));var config=require(_0x31e4('0x8'));var attributes=require('./license.attributes');module[_0x31e4('0x9')]=function(_0x54ab39,_0x50fefc){return _0x54ab39['define']('License',attributes,{'tableName':_0x31e4('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 b9bb5fb..87ad8c5 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 _0xdd36=['code','License,\x20%s,\x20%s','message','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x11af1c,_0x21d5e4){var _0x32602b=function(_0xffe6dd){while(--_0xffe6dd){_0x11af1c['push'](_0x11af1c['shift']());}};_0x32602b(++_0x21d5e4);}(_0xdd36,0x8f));var _0x6dd3=function(_0x1f7d17,_0x96ee5f){_0x1f7d17=_0x1f7d17-0x0;var _0x38850d=_0xdd36[_0x1f7d17];return _0x38850d;};'use strict';var _=require(_0x6dd3('0x0'));var util=require(_0x6dd3('0x1'));var moment=require(_0x6dd3('0x2'));var BPromise=require('bluebird');var rs=require(_0x6dd3('0x3'));var fs=require('fs');var Redis=require(_0x6dd3('0x4'));var db=require(_0x6dd3('0x5'))['db'];var utils=require(_0x6dd3('0x6'));var logger=require('../../config/logger')(_0x6dd3('0x7'));var config=require(_0x6dd3('0x8'));var jayson=require(_0x6dd3('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x16c6fb,_0x1065eb,_0x1b483e){return new BPromise(function(_0x1b197e,_0x27102e){return client[_0x6dd3('0xa')](_0x16c6fb,_0x1b483e)[_0x6dd3('0xb')](function(_0x5b5081){logger[_0x6dd3('0xc')]('License,\x20%s,\x20%s',_0x1065eb,'request\x20sent');logger['debug'](_0x6dd3('0xd'),_0x1065eb,_0x6dd3('0xe'),JSON[_0x6dd3('0xf')](_0x5b5081));if(_0x5b5081[_0x6dd3('0x10')]){if(_0x5b5081[_0x6dd3('0x10')][_0x6dd3('0x11')]===0x1f4){logger[_0x6dd3('0x10')](_0x6dd3('0x12'),_0x1065eb,_0x5b5081[_0x6dd3('0x10')][_0x6dd3('0x13')]);return _0x27102e(_0x5b5081['error'][_0x6dd3('0x13')]);}logger['error']('License,\x20%s,\x20%s',_0x1065eb,_0x5b5081[_0x6dd3('0x10')][_0x6dd3('0x13')]);return _0x1b197e(_0x5b5081[_0x6dd3('0x10')][_0x6dd3('0x13')]);}else{logger['info'](_0x6dd3('0x12'),_0x1065eb,_0x6dd3('0xe'));_0x1b197e(_0x5b5081['result']['message']);}})['catch'](function(_0x1276d5){logger[_0x6dd3('0x10')](_0x6dd3('0x12'),_0x1065eb,_0x1276d5);_0x27102e(_0x1276d5);});});} \ No newline at end of file +var _0xf6e4=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0xb7b6e4,_0x62c865){var _0x3ad7ae=function(_0x144a6c){while(--_0x144a6c){_0xb7b6e4['push'](_0xb7b6e4['shift']());}};_0x3ad7ae(++_0x62c865);}(_0xf6e4,0x14b));var _0x4f6e=function(_0x4546bd,_0x336d32){_0x4546bd=_0x4546bd-0x0;var _0xb1756f=_0xf6e4[_0x4546bd];return _0xb1756f;};'use strict';var _=require(_0x4f6e('0x0'));var util=require(_0x4f6e('0x1'));var moment=require(_0x4f6e('0x2'));var BPromise=require(_0x4f6e('0x3'));var rs=require(_0x4f6e('0x4'));var fs=require('fs');var Redis=require(_0x4f6e('0x5'));var db=require(_0x4f6e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4f6e('0x7'))(_0x4f6e('0x8'));var config=require(_0x4f6e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4f6e('0xa')][_0x4f6e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5eccd7,_0x418809,_0x25c9d5){return new BPromise(function(_0x1f59f1,_0x28136a){return client[_0x4f6e('0xc')](_0x5eccd7,_0x25c9d5)[_0x4f6e('0xd')](function(_0x23d460){logger[_0x4f6e('0xe')](_0x4f6e('0xf'),_0x418809,_0x4f6e('0x10'));logger[_0x4f6e('0x11')](_0x4f6e('0x12'),_0x418809,_0x4f6e('0x10'),JSON[_0x4f6e('0x13')](_0x23d460));if(_0x23d460['error']){if(_0x23d460[_0x4f6e('0x14')][_0x4f6e('0x15')]===0x1f4){logger[_0x4f6e('0x14')](_0x4f6e('0xf'),_0x418809,_0x23d460[_0x4f6e('0x14')][_0x4f6e('0x16')]);return _0x28136a(_0x23d460['error'][_0x4f6e('0x16')]);}logger[_0x4f6e('0x14')](_0x4f6e('0xf'),_0x418809,_0x23d460[_0x4f6e('0x14')]['message']);return _0x1f59f1(_0x23d460[_0x4f6e('0x14')][_0x4f6e('0x16')]);}else{logger[_0x4f6e('0xe')](_0x4f6e('0xf'),_0x418809,_0x4f6e('0x10'));_0x1f59f1(_0x23d460[_0x4f6e('0x17')]['message']);}})['catch'](function(_0x3085c5){logger[_0x4f6e('0x14')]('License,\x20%s,\x20%s',_0x418809,_0x3085c5);_0x28136a(_0x3085c5);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 241bbe1..b385f4a 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 _0x195e=['getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','create','/:id/in_servers','addImap','addSmtp','addAgents','put','/:id','update','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','multer','path','express','fs-extra','../../components/auth/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','/:id/dispositions','getDispositions','getAnswers','getImap','/:id/out_servers','/:id/interactions'];(function(_0x312230,_0x16192b){var _0x307572=function(_0x41a70b){while(--_0x41a70b){_0x312230['push'](_0x312230['shift']());}};_0x307572(++_0x16192b);}(_0x195e,0x1bf));var _0xe195=function(_0x2cfc94,_0xcf3d5b){_0x2cfc94=_0x2cfc94-0x0;var _0x3ac30a=_0x195e[_0x2cfc94];return _0x3ac30a;};'use strict';var multer=require(_0xe195('0x0'));var util=require('util');var path=require(_0xe195('0x1'));var timeout=require('connect-timeout');var express=require(_0xe195('0x2'));var router=express['Router']();var fs_extra=require(_0xe195('0x3'));var auth=require(_0xe195('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe195('0x5'));var controller=require(_0xe195('0x6'));router[_0xe195('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe195('0x7')]('/describe',auth[_0xe195('0x8')](),controller['describe']);router['get']('/:id',auth[_0xe195('0x8')](),controller['show']);router['get'](_0xe195('0x9'),auth[_0xe195('0x8')](),controller[_0xe195('0xa')]);router['get']('/:id/canned_answers',auth[_0xe195('0x8')](),controller[_0xe195('0xb')]);router[_0xe195('0x7')]('/:id/in_servers',auth[_0xe195('0x8')](),controller[_0xe195('0xc')]);router[_0xe195('0x7')](_0xe195('0xd'),auth[_0xe195('0x8')](),controller['getSmtp']);router['get'](_0xe195('0xe'),auth[_0xe195('0x8')](),controller[_0xe195('0xf')]);router[_0xe195('0x7')](_0xe195('0x10'),auth[_0xe195('0x8')](),controller[_0xe195('0x11')]);router[_0xe195('0x7')](_0xe195('0x12'),auth[_0xe195('0x8')](),controller[_0xe195('0x13')]);router[_0xe195('0x7')](_0xe195('0x14'),auth[_0xe195('0x8')](),controller['verifySmtp']);router[_0xe195('0x7')](_0xe195('0x15'),auth[_0xe195('0x8')](),controller[_0xe195('0x16')]);router[_0xe195('0x17')](_0xe195('0x9'),auth[_0xe195('0x8')](),controller[_0xe195('0x18')]);router[_0xe195('0x17')](_0xe195('0x19'),auth[_0xe195('0x8')](),controller[_0xe195('0x1a')]);router[_0xe195('0x17')]('/',auth[_0xe195('0x8')](),controller[_0xe195('0x1b')]);router[_0xe195('0x17')](_0xe195('0x1c'),auth[_0xe195('0x8')](),controller[_0xe195('0x1d')]);router[_0xe195('0x17')](_0xe195('0xd'),auth['isAuthenticated'](),controller[_0xe195('0x1e')]);router[_0xe195('0x17')](_0xe195('0xe'),auth['isAuthenticated'](),controller['addInteraction']);router[_0xe195('0x17')](_0xe195('0x10'),auth[_0xe195('0x8')](),controller['addApplications']);router[_0xe195('0x17')]('/:id/send',auth[_0xe195('0x8')](),controller['send']);router[_0xe195('0x17')](_0xe195('0x15'),auth[_0xe195('0x8')](),controller[_0xe195('0x1f')]);router[_0xe195('0x20')](_0xe195('0x21'),auth[_0xe195('0x8')](),controller[_0xe195('0x22')]);router[_0xe195('0x23')](_0xe195('0x9'),auth[_0xe195('0x8')](),controller[_0xe195('0x24')]);router['delete'](_0xe195('0x19'),auth['isAuthenticated'](),controller[_0xe195('0x25')]);router['delete'](_0xe195('0x1c'),auth[_0xe195('0x8')](),controller[_0xe195('0x26')]);router[_0xe195('0x23')]('/:id/out_servers',auth[_0xe195('0x8')](),controller[_0xe195('0x27')]);router[_0xe195('0x23')](_0xe195('0x21'),auth[_0xe195('0x8')](),controller[_0xe195('0x28')]);router[_0xe195('0x23')](_0xe195('0x15'),auth[_0xe195('0x8')](),controller[_0xe195('0x29')]);module['exports']=router; \ No newline at end of file +var _0x7798=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','addDisposition','addAnswer','create','addImap','addSmtp','addApplications','/:id/send','put','update','delete','removeDispositions','removeAnswers','removeSmtp','destroy','removeAgents','multer','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7798,0xb6));var _0x8779=function(_0x2eb094,_0x421568){_0x2eb094=_0x2eb094-0x0;var _0xb12c3=_0x7798[_0x2eb094];return _0xb12c3;};'use strict';var multer=require(_0x8779('0x0'));var util=require(_0x8779('0x1'));var path=require(_0x8779('0x2'));var timeout=require(_0x8779('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8779('0x4'));var auth=require(_0x8779('0x5'));var interaction=require(_0x8779('0x6'));var config=require(_0x8779('0x7'));var controller=require('./mailAccount.controller');router[_0x8779('0x8')]('/',auth[_0x8779('0x9')](),controller[_0x8779('0xa')]);router[_0x8779('0x8')](_0x8779('0xb'),auth[_0x8779('0x9')](),controller[_0x8779('0xc')]);router[_0x8779('0x8')](_0x8779('0xd'),auth[_0x8779('0x9')](),controller[_0x8779('0xe')]);router['get'](_0x8779('0xf'),auth[_0x8779('0x9')](),controller['getDispositions']);router[_0x8779('0x8')](_0x8779('0x10'),auth[_0x8779('0x9')](),controller[_0x8779('0x11')]);router[_0x8779('0x8')](_0x8779('0x12'),auth[_0x8779('0x9')](),controller[_0x8779('0x13')]);router['get'](_0x8779('0x14'),auth[_0x8779('0x9')](),controller[_0x8779('0x15')]);router[_0x8779('0x8')](_0x8779('0x16'),auth[_0x8779('0x9')](),controller[_0x8779('0x17')]);router[_0x8779('0x8')](_0x8779('0x18'),auth[_0x8779('0x9')](),controller['getApplications']);router['get'](_0x8779('0x19'),auth[_0x8779('0x9')](),controller[_0x8779('0x1a')]);router[_0x8779('0x8')](_0x8779('0x1b'),auth[_0x8779('0x9')](),controller[_0x8779('0x1c')]);router[_0x8779('0x8')](_0x8779('0x1d'),auth[_0x8779('0x9')](),controller[_0x8779('0x1e')]);router[_0x8779('0x1f')]('/:id/dispositions',auth[_0x8779('0x9')](),controller[_0x8779('0x20')]);router[_0x8779('0x1f')](_0x8779('0x10'),auth[_0x8779('0x9')](),controller[_0x8779('0x21')]);router['post']('/',auth[_0x8779('0x9')](),controller[_0x8779('0x22')]);router[_0x8779('0x1f')](_0x8779('0x12'),auth['isAuthenticated'](),controller[_0x8779('0x23')]);router['post'](_0x8779('0x14'),auth[_0x8779('0x9')](),controller[_0x8779('0x24')]);router[_0x8779('0x1f')](_0x8779('0x16'),auth[_0x8779('0x9')](),controller['addInteraction']);router[_0x8779('0x1f')]('/:id/applications',auth[_0x8779('0x9')](),controller[_0x8779('0x25')]);router[_0x8779('0x1f')](_0x8779('0x26'),auth[_0x8779('0x9')](),controller['send']);router['post'](_0x8779('0x1d'),auth[_0x8779('0x9')](),controller['addAgents']);router[_0x8779('0x27')](_0x8779('0xd'),auth[_0x8779('0x9')](),controller[_0x8779('0x28')]);router[_0x8779('0x29')](_0x8779('0xf'),auth[_0x8779('0x9')](),controller[_0x8779('0x2a')]);router[_0x8779('0x29')](_0x8779('0x10'),auth['isAuthenticated'](),controller[_0x8779('0x2b')]);router[_0x8779('0x29')](_0x8779('0x12'),auth[_0x8779('0x9')](),controller['removeImap']);router[_0x8779('0x29')]('/:id/out_servers',auth[_0x8779('0x9')](),controller[_0x8779('0x2c')]);router[_0x8779('0x29')]('/:id',auth[_0x8779('0x9')](),controller[_0x8779('0x2d')]);router[_0x8779('0x29')](_0x8779('0x1d'),auth['isAuthenticated'](),controller[_0x8779('0x2e')]);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 704a20a..47dd542 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 _0x33c5=['mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue'];(function(_0x28f0b6,_0x290a14){var _0x44156e=function(_0x4e57de){while(--_0x4e57de){_0x28f0b6['push'](_0x28f0b6['shift']());}};_0x44156e(++_0x290a14);}(_0x33c5,0xe6));var _0x533c=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0x33c5[_0x494d1f];return _0x457b6e;};'use strict';var Sequelize=require('sequelize');module[_0x533c('0x0')]={'description':{'type':Sequelize[_0x533c('0x1')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x533c('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x533c('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x533c('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x533c('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x533c('0x3')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x533c('0x1')],'allowNull':![],'defaultValue':_0x533c('0x4')},'fontSize':{'type':Sequelize[_0x533c('0x5')](0x2)[_0x533c('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x533c('0x3')],'defaultValue':function(){return _0x533c('0x7');}},'notificationSound':{'type':Sequelize[_0x533c('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x533c('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x533c('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x533c('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x533c('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x533c('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x533c('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x533c('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x533c('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x533c('0x2')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x6eeb6d){if(!_0x6eeb6d)this[_0x533c('0x9')](_0x533c('0xa'),null);this[_0x533c('0x9')](_0x533c('0xb'),_0x6eeb6d);}}}; \ No newline at end of file +var _0x5fd1=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED'];(function(_0x23d246,_0xbcd3aa){var _0x297fdc=function(_0x57edc7){while(--_0x57edc7){_0x23d246['push'](_0x23d246['shift']());}};_0x297fdc(++_0xbcd3aa);}(_0x5fd1,0x155));var _0x15fd=function(_0x52cbc6,_0x3a9e07){_0x52cbc6=_0x52cbc6-0x0;var _0x5b7ee5=_0x5fd1[_0x52cbc6];return _0x5b7ee5;};'use strict';var Sequelize=require(_0x15fd('0x0'));module['exports']={'description':{'type':Sequelize[_0x15fd('0x1')]},'name':{'type':Sequelize[_0x15fd('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x15fd('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x15fd('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x15fd('0x3')]},'markAsUnread':{'type':Sequelize[_0x15fd('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x15fd('0x4')},'fontSize':{'type':Sequelize[_0x15fd('0x5')](0x2)[_0x15fd('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x15fd('0x3')],'defaultValue':function(){return _0x15fd('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x15fd('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x15fd('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x15fd('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x15fd('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x15fd('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x15fd('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4ebde5){if(!_0x4ebde5)this[_0x15fd('0x9')](_0x15fd('0xa'),null);this[_0x15fd('0x9')](_0x15fd('0xb'),_0x4ebde5);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 56b0a1e..0bfb41c 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 _0x6525=['bulkCreate','findAndCountAll','priority','getApplications','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','List','Contacts','updatedAt','DESC','from','%s\x20<%s>','attachments','join','auth','secure','SendMail','sendMail','List\x20not\x20found','messageId','subject','attach','out','Interaction','Messages','verifySmtp','Sequelize','ValidationError','addAgents','omit','spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','User','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','jsforce','desk.js','papaparse','html-to-text','juice','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./mailAccount.socket','register','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','sendStatus','status','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','stack','name','send','index','Imap','MailServerOut','Pause','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','show','params','Smtp','mandatoryDispositionPause','MailAccount','find','body','MailServerIn','describe','addDisposition','MailAccountId','create','findOne','Disposition','pick','findAll','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','email','ListId','isNil','active','description','cservice','user','cuser','password','pass','cpassword','authentication','host','port','service','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MailAccounts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','addInteraction','getInteractions','MailInteraction','CmContact','Contact','Owner','fullname','internal','color','addApplications','sequelize','transaction','MailApplication'];(function(_0x4b215e,_0x159f2b){var _0x416b25=function(_0x285c4f){while(--_0x285c4f){_0x4b215e['push'](_0x4b215e['shift']());}};_0x416b25(++_0x159f2b);}(_0x6525,0x1ac));var _0x5652=function(_0x21c69c,_0x1b7535){_0x21c69c=_0x21c69c-0x0;var _0x2acd03=_0x6525[_0x21c69c];return _0x2acd03;};'use strict';var emlformat=require(_0x5652('0x0'));var rimraf=require(_0x5652('0x1'));var zipdir=require(_0x5652('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5652('0x3'));var Mustache=require(_0x5652('0x4'));var util=require(_0x5652('0x5'));var path=require(_0x5652('0x6'));var sox=require(_0x5652('0x7'));var csv=require(_0x5652('0x8'));var ejs=require(_0x5652('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(_0x5652('0xa'));var deskjs=require(_0x5652('0xb'));var toCsv=require(_0x5652('0x8'));var querystring=require('querystring');var Papa=require(_0x5652('0xc'));var htmlToText=require(_0x5652('0xd'));var juice=require(_0x5652('0xe'));var Redis=require(_0x5652('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5652('0x10'));var logger=require(_0x5652('0x11'))('api');var utils=require(_0x5652('0x12'));var config=require(_0x5652('0x13'));var licenseUtil=require(_0x5652('0x14'));var db=require(_0x5652('0x15'))['db'];config[_0x5652('0x16')]=_[_0x5652('0x17')](config[_0x5652('0x16')],{'host':_0x5652('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5652('0x16')]));require(_0x5652('0x19'))[_0x5652('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x5652('0x1b')][_0x5652('0x1c')]({'port':0x232b});function respondWithRpcPromise(_0x5583f9,_0x5b977e,_0x2e2454,_0x2ff898){return new BPromise(function(_0x59597a,_0x3acca9){var _0x36bc43=_0x2ff898||client;return _0x36bc43['request'](_0x5583f9,_0x2e2454)[_0x5652('0x1d')](function(_0x2fad71){logger[_0x5652('0x1e')](_0x5652('0x1f'),_0x5b977e,_0x5652('0x20'));logger[_0x5652('0x21')](_0x5652('0x22'),_0x5b977e,'request\x20sent',JSON[_0x5652('0x23')](_0x2fad71));if(_0x2fad71['error']){if(_0x2fad71[_0x5652('0x24')][_0x5652('0x25')]===0x1f4){logger[_0x5652('0x24')](_0x5652('0x1f'),_0x5b977e,_0x2fad71[_0x5652('0x24')][_0x5652('0x26')]);return _0x3acca9(_0x2fad71[_0x5652('0x24')][_0x5652('0x26')]);}logger[_0x5652('0x24')](_0x5652('0x1f'),_0x5b977e,_0x2fad71[_0x5652('0x24')][_0x5652('0x26')]);return _0x59597a(_0x2fad71['error'][_0x5652('0x26')]);}else{logger['info'](_0x5652('0x1f'),_0x5b977e,_0x5652('0x20'));_0x59597a(_0x2fad71[_0x5652('0x27')]['message']);}})[_0x5652('0x28')](function(_0x1a1ade){logger[_0x5652('0x24')]('MailAccount,\x20%s,\x20%s',_0x5b977e,_0x1a1ade);_0x3acca9(_0x1a1ade);});});}function respondWithStatusCode(_0xe1871a,_0x509d9c){_0x509d9c=_0x509d9c||0xcc;return function(_0x13c12e){if(_0x13c12e){return _0xe1871a[_0x5652('0x29')](_0x509d9c);}return _0xe1871a['status'](_0x509d9c)['end']();};}function respondWithResult(_0x3ee3ae,_0x231ca9){_0x231ca9=_0x231ca9||0xc8;return function(_0x5f3ea2){if(_0x5f3ea2){return _0x3ee3ae[_0x5652('0x2a')](_0x231ca9)['json'](_0x5f3ea2);}};}function respondWithFilteredResult(_0x2af6ca,_0x2de10c){return function(_0x204661){if(_0x204661){var _0x4c6557=typeof _0x2de10c['offset']===_0x5652('0x2b')&&typeof _0x2de10c[_0x5652('0x2c')]==='undefined';var _0x202beb=_0x204661[_0x5652('0x2d')];var _0x58bf07=_0x4c6557?0x0:_0x2de10c[_0x5652('0x2e')];var _0x426c1f=_0x4c6557?_0x204661[_0x5652('0x2d')]:_0x2de10c[_0x5652('0x2e')]+_0x2de10c[_0x5652('0x2c')];var _0x195954;if(_0x426c1f>=_0x202beb){_0x426c1f=_0x202beb;_0x195954=0xc8;}else{_0x195954=0xce;}_0x2af6ca[_0x5652('0x2a')](_0x195954);return _0x2af6ca[_0x5652('0x2f')](_0x5652('0x30'),_0x58bf07+'-'+_0x426c1f+'/'+_0x202beb)['json'](_0x204661);}return null;};}function patchUpdates(_0x15e39d){return function(_0x4be8a3){try{jsonpatch[_0x5652('0x31')](_0x4be8a3,_0x15e39d,!![]);}catch(_0x596d93){return BPromise[_0x5652('0x32')](_0x596d93);}return _0x4be8a3[_0x5652('0x33')]();};}function saveUpdates(_0x334269,_0x5e140e){return function(_0x58ca08){if(_0x58ca08){return _0x58ca08[_0x5652('0x34')](_0x334269)[_0x5652('0x1d')](function(_0x46f1ae){return _0x46f1ae;});}return null;};}function removeEntity(_0x2160e7,_0x6330e9){return function(_0x5d76c7){if(_0x5d76c7){return _0x5d76c7[_0x5652('0x35')]()[_0x5652('0x1d')](function(){var _0x1c3e33=_0x5d76c7[_0x5652('0x36')]({'plain':!![]});var _0x4acbf9='MailAccounts';return db[_0x5652('0x37')][_0x5652('0x35')]({'where':{'type':_0x4acbf9,'resourceId':_0x1c3e33['id']}})['then'](function(){return _0x5d76c7;});})[_0x5652('0x1d')](function(){_0x2160e7[_0x5652('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x598c75,_0x33e8eb){return function(_0x43a3b5){if(!_0x43a3b5){_0x598c75[_0x5652('0x29')](0x194);}return _0x43a3b5;};}function handleError(_0x193153,_0x5b946f){_0x5b946f=_0x5b946f||0x1f4;return function(_0x1e0a32){logger[_0x5652('0x24')](_0x1e0a32[_0x5652('0x38')]);if(_0x1e0a32[_0x5652('0x39')]){delete _0x1e0a32['name'];}_0x193153['status'](_0x5b946f)[_0x5652('0x3a')](_0x1e0a32);};}exports[_0x5652('0x3b')]=function(_0x34f31e,_0x528515){var _0x8a9ebe={'include':[{'model':db['MailServerIn'],'as':_0x5652('0x3c')},{'model':db[_0x5652('0x3d')],'as':'Smtp'},{'model':db[_0x5652('0x3e')],'as':'mandatoryDispositionPause'}]},_0x52901b={},_0x830499={'count':0x0,'rows':[]};var _0x24de86=_[_0x5652('0x3f')](db['MailAccount'][_0x5652('0x40')],function(_0x27993d){return{'name':_0x27993d[_0x5652('0x41')],'type':_0x27993d[_0x5652('0x42')][_0x5652('0x43')]};});_0x52901b[_0x5652('0x44')]=_[_0x5652('0x3f')](_0x24de86,_0x5652('0x39'));_0x52901b[_0x5652('0x45')]=_[_0x5652('0x46')](_0x34f31e[_0x5652('0x45')]);_0x52901b['filters']=_['intersection'](_0x52901b[_0x5652('0x44')],_0x52901b[_0x5652('0x45')]);_0x8a9ebe[_0x5652('0x47')]=_[_0x5652('0x48')](_0x52901b[_0x5652('0x44')],qs[_0x5652('0x49')](_0x34f31e[_0x5652('0x45')][_0x5652('0x49')]));_0x8a9ebe[_0x5652('0x47')]=_0x8a9ebe[_0x5652('0x47')][_0x5652('0x4a')]?_0x8a9ebe[_0x5652('0x47')]:_0x52901b['model'];if(!_0x34f31e['query'][_0x5652('0x4b')](_0x5652('0x4c'))){_0x8a9ebe[_0x5652('0x2c')]=qs['limit'](_0x34f31e[_0x5652('0x45')][_0x5652('0x2c')]);_0x8a9ebe[_0x5652('0x2e')]=qs[_0x5652('0x2e')](_0x34f31e['query'][_0x5652('0x2e')]);}_0x8a9ebe[_0x5652('0x4d')]=qs['sort'](_0x34f31e[_0x5652('0x45')][_0x5652('0x4e')]);_0x8a9ebe[_0x5652('0x4f')]=qs['filters'](_['pick'](_0x34f31e['query'],_0x52901b[_0x5652('0x50')]),_0x24de86);if(_0x34f31e[_0x5652('0x45')][_0x5652('0x51')]){_0x8a9ebe[_0x5652('0x4f')]=_[_0x5652('0x52')](_0x8a9ebe[_0x5652('0x4f')],{'$or':_[_0x5652('0x3f')](_0x24de86,function(_0x1eb5ec){if(_0x1eb5ec[_0x5652('0x42')]!==_0x5652('0x53')){var _0x3449ae={};_0x3449ae[_0x1eb5ec[_0x5652('0x39')]]={'$like':'%'+_0x34f31e['query'][_0x5652('0x51')]+'%'};return _0x3449ae;}})});}_0x8a9ebe=_['merge']({},_0x8a9ebe,_0x34f31e[_0x5652('0x54')]);var _0x4e1f53={'where':_0x8a9ebe[_0x5652('0x4f')]};return db['MailAccount'][_0x5652('0x2d')](_0x4e1f53)[_0x5652('0x1d')](function(_0x370be4){_0x830499['count']=_0x370be4;if(_0x34f31e[_0x5652('0x45')][_0x5652('0x55')]){_0x8a9ebe[_0x5652('0x56')]=[{'all':!![]}];}return db['MailAccount']['findAll'](_0x8a9ebe);})[_0x5652('0x1d')](function(_0x4d42f1){_0x830499['rows']=_0x4d42f1;return _0x830499;})[_0x5652('0x1d')](respondWithFilteredResult(_0x528515,_0x8a9ebe))['catch'](handleError(_0x528515,null));};exports[_0x5652('0x57')]=function(_0x5b4f27,_0x40982c){var _0x5084a0={'raw':![],'where':{'id':_0x5b4f27[_0x5652('0x58')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x5652('0x3c')},{'model':db[_0x5652('0x3d')],'as':_0x5652('0x59')},{'model':db[_0x5652('0x3e')],'as':_0x5652('0x5a')}]},_0xf244a7={};_0xf244a7[_0x5652('0x44')]=_[_0x5652('0x46')](db[_0x5652('0x5b')][_0x5652('0x40')]);_0xf244a7[_0x5652('0x45')]=_['keys'](_0x5b4f27[_0x5652('0x45')]);_0xf244a7[_0x5652('0x50')]=_['intersection'](_0xf244a7['model'],_0xf244a7['query']);_0x5084a0['attributes']=_[_0x5652('0x48')](_0xf244a7[_0x5652('0x44')],qs[_0x5652('0x49')](_0x5b4f27[_0x5652('0x45')]['fields']));_0x5084a0[_0x5652('0x47')]=_0x5084a0[_0x5652('0x47')]['length']?_0x5084a0[_0x5652('0x47')]:_0xf244a7[_0x5652('0x44')];if(_0x5b4f27[_0x5652('0x45')][_0x5652('0x55')]){_0x5084a0['include']=[{'all':!![]}];}_0x5084a0=_['merge']({},_0x5084a0,_0x5b4f27[_0x5652('0x54')]);return db['MailAccount'][_0x5652('0x5c')](_0x5084a0)[_0x5652('0x1d')](handleEntityNotFound(_0x40982c,null))['then'](respondWithResult(_0x40982c,null))[_0x5652('0x28')](handleError(_0x40982c,null));};exports[_0x5652('0x34')]=function(_0x16bf9e,_0x37ee46){if(_0x16bf9e[_0x5652('0x5d')]['id']){delete _0x16bf9e[_0x5652('0x5d')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x16bf9e[_0x5652('0x58')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x5652('0x3c')},{'model':db[_0x5652('0x3d')],'as':_0x5652('0x59')},{'model':db[_0x5652('0x3e')],'as':_0x5652('0x5a')}]})[_0x5652('0x1d')](handleEntityNotFound(_0x37ee46,null))['then'](saveUpdates(_0x16bf9e[_0x5652('0x5d')],null))[_0x5652('0x1d')](function(_0x45d7d6){if(_0x45d7d6&&_0x16bf9e[_0x5652('0x5d')][_0x5652('0x3c')]){return db[_0x5652('0x5e')][_0x5652('0x34')](_0x16bf9e[_0x5652('0x5d')][_0x5652('0x3c')],{'where':{'MailAccountId':_0x45d7d6['id']}})[_0x5652('0x1d')](function(){return _0x45d7d6;});}return _0x45d7d6;})[_0x5652('0x1d')](function(_0x459dcc){if(_0x459dcc&&_0x16bf9e['body'][_0x5652('0x59')]){return db['MailServerOut'][_0x5652('0x34')](_0x16bf9e[_0x5652('0x5d')][_0x5652('0x59')],{'where':{'MailAccountId':_0x459dcc['id']}})[_0x5652('0x1d')](function(){return _0x459dcc;});}return _0x459dcc;})[_0x5652('0x1d')](respondWithResult(_0x37ee46,null))[_0x5652('0x28')](handleError(_0x37ee46,null));};exports[_0x5652('0x5f')]=function(_0x153f08,_0x4d5837){return db['MailAccount'][_0x5652('0x5f')]()[_0x5652('0x1d')](respondWithResult(_0x4d5837,null))['catch'](handleError(_0x4d5837,null));};exports[_0x5652('0x60')]=function(_0xcb1d0a,_0x5286e0,_0xc9abda){if(_0xcb1d0a[_0x5652('0x5d')]['id']){delete _0xcb1d0a['body']['id'];}return db[_0x5652('0x5b')][_0x5652('0x5c')]({'where':{'id':_0xcb1d0a[_0x5652('0x58')]['id']}})[_0x5652('0x1d')](handleEntityNotFound(_0x5286e0,null))['then'](function(_0x2f22e7){if(_0x2f22e7){_0xcb1d0a[_0x5652('0x5d')][_0x5652('0x61')]=_0x2f22e7['id'];return db['Disposition'][_0x5652('0x62')](_0xcb1d0a[_0x5652('0x5d')]);}})[_0x5652('0x1d')](respondWithResult(_0x5286e0,null))['catch'](handleError(_0x5286e0,null));};exports['getDispositions']=function(_0x48e896,_0x5e9947,_0x8bc928){var _0x1c0013={'raw':![],'where':{}};var _0x3d593a={};var _0x4d4800={'count':0x0,'rows':[]};return db['MailAccount'][_0x5652('0x63')]({'where':{'id':_0x48e896[_0x5652('0x58')]['id']}})['then'](handleEntityNotFound(_0x5e9947,null))[_0x5652('0x1d')](function(_0x1072b5){if(_0x1072b5){_0x3d593a['model']=_[_0x5652('0x46')](db[_0x5652('0x64')][_0x5652('0x40')]);_0x3d593a['query']=_['keys'](_0x48e896[_0x5652('0x45')]);_0x3d593a['filters']=_[_0x5652('0x48')](_0x3d593a[_0x5652('0x44')],_0x3d593a[_0x5652('0x45')]);_0x1c0013[_0x5652('0x47')]=_[_0x5652('0x48')](_0x3d593a[_0x5652('0x44')],qs[_0x5652('0x49')](_0x48e896[_0x5652('0x45')][_0x5652('0x49')]));_0x1c0013['attributes']=_0x1c0013['attributes'][_0x5652('0x4a')]?_0x1c0013[_0x5652('0x47')]:_0x3d593a[_0x5652('0x44')];if(!_0x48e896[_0x5652('0x45')][_0x5652('0x4b')]('nolimit')){_0x1c0013[_0x5652('0x2c')]=qs[_0x5652('0x2c')](_0x48e896[_0x5652('0x45')]['limit']);_0x1c0013[_0x5652('0x2e')]=qs[_0x5652('0x2e')](_0x48e896[_0x5652('0x45')][_0x5652('0x2e')]);}_0x1c0013[_0x5652('0x4d')]=qs[_0x5652('0x4e')](_0x48e896[_0x5652('0x45')][_0x5652('0x4e')]);_0x1c0013[_0x5652('0x4f')]=qs[_0x5652('0x50')](_[_0x5652('0x65')](_0x48e896['query'],_0x3d593a[_0x5652('0x50')]));_0x1c0013[_0x5652('0x4f')][_0x5652('0x61')]=_0x1072b5['id'];if(_0x48e896[_0x5652('0x45')][_0x5652('0x51')]){_0x1c0013[_0x5652('0x4f')]=_['merge'](_0x1c0013[_0x5652('0x4f')],{'$or':_[_0x5652('0x3f')](_0x1c0013[_0x5652('0x47')],function(_0x5a44a6){var _0x18d51b={};_0x18d51b[_0x5a44a6]={'$like':'%'+_0x48e896['query'][_0x5652('0x51')]+'%'};return _0x18d51b;})});}_0x1c0013=_[_0x5652('0x52')]({},_0x1c0013,_0x48e896[_0x5652('0x54')]);return db[_0x5652('0x64')][_0x5652('0x2d')]({'where':_0x1c0013[_0x5652('0x4f')]})[_0x5652('0x1d')](function(_0x59eb06){_0x4d4800[_0x5652('0x2d')]=_0x59eb06;if(_0x48e896[_0x5652('0x45')]['includeAll']){_0x1c0013[_0x5652('0x56')]=[{'all':!![]}];}return db['Disposition'][_0x5652('0x66')](_0x1c0013);})['then'](function(_0x939fce){_0x4d4800[_0x5652('0x67')]=_0x939fce;return _0x4d4800;});}})['then'](respondWithFilteredResult(_0x5e9947,_0x1c0013))['catch'](handleError(_0x5e9947,null));};exports[_0x5652('0x68')]=function(_0x17d57b,_0x1776f8,_0x3fc920){return db['MailAccount']['find']({'where':{'id':_0x17d57b[_0x5652('0x58')]['id']}})[_0x5652('0x1d')](handleEntityNotFound(_0x1776f8,null))['then'](function(_0x2c4f58){if(_0x2c4f58){return _0x2c4f58['removeDispositions'](_0x17d57b[_0x5652('0x45')][_0x5652('0x69')]);}})[_0x5652('0x1d')](respondWithStatusCode(_0x1776f8,null))[_0x5652('0x28')](handleError(_0x1776f8,null));};exports[_0x5652('0x6a')]=function(_0x50b429,_0x3a9fdf,_0x42b046){if(_0x50b429['body']['id']){delete _0x50b429[_0x5652('0x5d')]['id'];}return db[_0x5652('0x5b')]['find']({'where':{'id':_0x50b429['params']['id']}})[_0x5652('0x1d')](handleEntityNotFound(_0x3a9fdf,null))[_0x5652('0x1d')](function(_0x14d744){if(_0x14d744){_0x50b429[_0x5652('0x5d')][_0x5652('0x61')]=_0x14d744['id'];return db[_0x5652('0x6b')][_0x5652('0x62')](_0x50b429['body']);}})[_0x5652('0x1d')](respondWithResult(_0x3a9fdf,null))[_0x5652('0x28')](handleError(_0x3a9fdf,null));};exports[_0x5652('0x6c')]=function(_0x2e0538,_0x2a495c,_0x4b333e){var _0xcf009a={'raw':![],'where':{}};var _0x3eedfe={};var _0x17a8a4={'count':0x0,'rows':[]};return db[_0x5652('0x5b')][_0x5652('0x63')]({'where':{'id':_0x2e0538[_0x5652('0x58')]['id']}})[_0x5652('0x1d')](handleEntityNotFound(_0x2a495c,null))[_0x5652('0x1d')](function(_0x1bd162){if(_0x1bd162){_0x3eedfe[_0x5652('0x44')]=_[_0x5652('0x46')](db['CannedAnswer']['rawAttributes']);_0x3eedfe[_0x5652('0x45')]=_['keys'](_0x2e0538['query']);_0x3eedfe[_0x5652('0x50')]=_[_0x5652('0x48')](_0x3eedfe[_0x5652('0x44')],_0x3eedfe['query']);_0xcf009a[_0x5652('0x47')]=_['intersection'](_0x3eedfe[_0x5652('0x44')],qs['fields'](_0x2e0538['query'][_0x5652('0x49')]));_0xcf009a[_0x5652('0x47')]=_0xcf009a[_0x5652('0x47')]['length']?_0xcf009a[_0x5652('0x47')]:_0x3eedfe['model'];if(!_0x2e0538[_0x5652('0x45')][_0x5652('0x4b')](_0x5652('0x4c'))){_0xcf009a[_0x5652('0x2c')]=qs['limit'](_0x2e0538['query'][_0x5652('0x2c')]);_0xcf009a[_0x5652('0x2e')]=qs['offset'](_0x2e0538[_0x5652('0x45')][_0x5652('0x2e')]);}_0xcf009a['order']=qs[_0x5652('0x4e')](_0x2e0538[_0x5652('0x45')][_0x5652('0x4e')]);_0xcf009a['where']=qs[_0x5652('0x50')](_['pick'](_0x2e0538['query'],_0x3eedfe[_0x5652('0x50')]));_0xcf009a[_0x5652('0x4f')][_0x5652('0x61')]=_0x1bd162['id'];if(_0x2e0538[_0x5652('0x45')][_0x5652('0x51')]){_0xcf009a[_0x5652('0x4f')]=_[_0x5652('0x52')](_0xcf009a[_0x5652('0x4f')],{'$or':_[_0x5652('0x3f')](_0xcf009a[_0x5652('0x47')],function(_0x42426f){var _0x1a73ff={};_0x1a73ff[_0x42426f]={'$like':'%'+_0x2e0538[_0x5652('0x45')][_0x5652('0x51')]+'%'};return _0x1a73ff;})});}_0xcf009a=_[_0x5652('0x52')]({},_0xcf009a,_0x2e0538[_0x5652('0x54')]);return db[_0x5652('0x6b')][_0x5652('0x2d')]({'where':_0xcf009a[_0x5652('0x4f')]})[_0x5652('0x1d')](function(_0x4fc3b8){_0x17a8a4[_0x5652('0x2d')]=_0x4fc3b8;if(_0x2e0538[_0x5652('0x45')]['includeAll']){_0xcf009a[_0x5652('0x56')]=[{'all':!![]}];}return db[_0x5652('0x6b')][_0x5652('0x66')](_0xcf009a);})[_0x5652('0x1d')](function(_0x5d5adf){_0x17a8a4[_0x5652('0x67')]=_0x5d5adf;return _0x17a8a4;});}})[_0x5652('0x1d')](respondWithFilteredResult(_0x2a495c,_0xcf009a))[_0x5652('0x28')](handleError(_0x2a495c,null));};exports['removeAnswers']=function(_0xede866,_0x41b539,_0x22a4fc){return db[_0x5652('0x5b')]['find']({'where':{'id':_0xede866[_0x5652('0x58')]['id']}})[_0x5652('0x1d')](handleEntityNotFound(_0x41b539,null))[_0x5652('0x1d')](function(_0x259b1e){if(_0x259b1e){return _0x259b1e['removeAnswers'](_0xede866['query']['ids']);}})[_0x5652('0x1d')](respondWithStatusCode(_0x41b539,null))[_0x5652('0x28')](handleError(_0x41b539,null));};exports[_0x5652('0x62')]=function(_0x5bd8bf,_0x27797c){var _0x123091={'name':_0x5bd8bf['body'][_0x5652('0x39')],'key':_0x5bd8bf['body'][_0x5652('0x43')],'email':_0x5bd8bf[_0x5652('0x5d')][_0x5652('0x6d')],'ListId':_0x5bd8bf[_0x5652('0x5d')][_0x5652('0x6e')],'active':!_[_0x5652('0x6f')](_0x5bd8bf['body'][_0x5652('0x70')])?_0x5bd8bf[_0x5652('0x5d')][_0x5652('0x70')]:!![],'description':_0x5bd8bf['body'][_0x5652('0x71')]||null,'Imap':{},'Smtp':{}};if(_[_0x5652('0x6f')](_0x5bd8bf[_0x5652('0x5d')][_0x5652('0x72')])){if(_0x5bd8bf[_0x5652('0x5d')]['cauthentication']){_0x123091[_0x5652('0x3c')][_0x5652('0x73')]=_0x123091[_0x5652('0x59')][_0x5652('0x73')]=_0x5bd8bf[_0x5652('0x5d')][_0x5652('0x74')];_0x123091[_0x5652('0x3c')][_0x5652('0x75')]=_0x123091[_0x5652('0x59')][_0x5652('0x76')]=_0x5bd8bf[_0x5652('0x5d')][_0x5652('0x77')];}else{_0x123091[_0x5652('0x3c')][_0x5652('0x78')]=_0x123091[_0x5652('0x59')]['authentication']=![];}_0x123091[_0x5652('0x3c')][_0x5652('0x79')]=_0x5bd8bf[_0x5652('0x5d')]['Imap'][_0x5652('0x79')];_0x123091[_0x5652('0x3c')][_0x5652('0x7a')]=_0x5bd8bf[_0x5652('0x5d')][_0x5652('0x3c')]['port'];_0x123091[_0x5652('0x59')][_0x5652('0x79')]=_0x5bd8bf['body'][_0x5652('0x59')][_0x5652('0x79')];_0x123091[_0x5652('0x59')][_0x5652('0x7a')]=_0x5bd8bf['body'][_0x5652('0x59')][_0x5652('0x7a')];}else{_0x123091[_0x5652('0x3c')][_0x5652('0x7b')]=_0x123091[_0x5652('0x59')][_0x5652('0x7b')]=_0x5bd8bf[_0x5652('0x5d')][_0x5652('0x72')];_0x123091[_0x5652('0x3c')][_0x5652('0x73')]=_0x123091[_0x5652('0x59')]['user']=_0x5bd8bf['body'][_0x5652('0x74')];_0x123091[_0x5652('0x3c')][_0x5652('0x75')]=_0x123091['Smtp'][_0x5652('0x76')]=_0x5bd8bf[_0x5652('0x5d')][_0x5652('0x77')];}return db[_0x5652('0x5b')][_0x5652('0x62')](_0x123091,{'include':[{'model':db['MailServerOut'],'as':_0x5652('0x59')},{'model':db[_0x5652('0x5e')],'as':_0x5652('0x3c')}]})[_0x5652('0x1d')](function(_0x359221){var _0x34da72=_0x5bd8bf[_0x5652('0x73')][_0x5652('0x36')]({'plain':!![]});if(!_0x34da72)throw new Error(_0x5652('0x7c'));if(_0x34da72[_0x5652('0x7d')]===_0x5652('0x73')){var _0x4e80f5=_0x359221[_0x5652('0x36')]({'plain':!![]});return db[_0x5652('0x7e')][_0x5652('0x5c')]({'where':{'name':_0x5652('0x7f'),'userProfileId':_0x34da72[_0x5652('0x80')]},'raw':!![]})['then'](function(_0x1bb302){if(_0x1bb302&&_0x1bb302[_0x5652('0x81')]===0x0){return db[_0x5652('0x37')]['create']({'name':_0x4e80f5[_0x5652('0x39')],'resourceId':_0x4e80f5['id'],'type':_0x1bb302[_0x5652('0x39')],'sectionId':_0x1bb302['id']},{})[_0x5652('0x1d')](function(){return _0x359221;});}else{return _0x359221;}})[_0x5652('0x28')](function(_0x4e6825){logger[_0x5652('0x24')](_0x5652('0x82'),_0x4e6825);throw _0x4e6825;});}return _0x359221;})[_0x5652('0x1d')](respondWithResult(_0x27797c,0xc9))[_0x5652('0x28')](handleError(_0x27797c,null));};exports[_0x5652('0x83')]=function(_0x5e812d,_0x397fb5,_0x5dd031){return db[_0x5652('0x5b')][_0x5652('0x63')]({'where':{'id':_0x5e812d[_0x5652('0x58')]['id']}})['then'](handleEntityNotFound(_0x397fb5,null))[_0x5652('0x1d')](function(_0x5a8b76){if(_0x5a8b76){return _0x5a8b76[_0x5652('0x83')]();}return null;})['then'](respondWithResult(_0x397fb5,null))[_0x5652('0x28')](handleError(_0x397fb5,null));};exports[_0x5652('0x84')]=function(_0x49347b,_0x1efe1a,_0x34a6bf){if(_0x49347b[_0x5652('0x5d')]['id']){delete _0x49347b['body']['id'];}return db[_0x5652('0x5b')][_0x5652('0x5c')]({'where':{'id':_0x49347b[_0x5652('0x58')]['id']}})['then'](handleEntityNotFound(_0x1efe1a,null))[_0x5652('0x1d')](function(_0x265af0){if(_0x265af0){_0x49347b[_0x5652('0x5d')][_0x5652('0x61')]=_0x265af0['id'];return db[_0x5652('0x5e')][_0x5652('0x62')](_0x49347b[_0x5652('0x5d')]);}})[_0x5652('0x1d')](respondWithResult(_0x1efe1a,null))[_0x5652('0x28')](handleError(_0x1efe1a,null));};exports[_0x5652('0x85')]=function(_0x2322a4,_0x1ef37f,_0x29cf3a){return db[_0x5652('0x5b')][_0x5652('0x63')]({'where':{'id':_0x2322a4[_0x5652('0x58')]['id']}})[_0x5652('0x1d')](handleEntityNotFound(_0x1ef37f,null))[_0x5652('0x1d')](function(_0x380103){if(_0x380103){return _0x380103[_0x5652('0x86')](null);}return null;})[_0x5652('0x1d')](respondWithStatusCode(_0x1ef37f,null))[_0x5652('0x28')](handleError(_0x1ef37f,null));};exports[_0x5652('0x87')]=function(_0x236a1f,_0x293b16,_0x4d8165){return db[_0x5652('0x5b')][_0x5652('0x63')]({'where':{'id':_0x236a1f['params']['id']}})['then'](handleEntityNotFound(_0x293b16,null))['then'](function(_0x4461f5){if(_0x4461f5){return _0x4461f5[_0x5652('0x87')]();}return null;})[_0x5652('0x1d')](respondWithResult(_0x293b16,null))[_0x5652('0x28')](handleError(_0x293b16,null));};exports[_0x5652('0x88')]=function(_0x3e8d21,_0x3de32c,_0x2595b7){if(_0x3e8d21[_0x5652('0x5d')]['id']){delete _0x3e8d21[_0x5652('0x5d')]['id'];}return db[_0x5652('0x5b')][_0x5652('0x5c')]({'where':{'id':_0x3e8d21[_0x5652('0x58')]['id']}})[_0x5652('0x1d')](handleEntityNotFound(_0x3de32c,null))[_0x5652('0x1d')](function(_0x58650f){if(_0x58650f){_0x3e8d21[_0x5652('0x5d')][_0x5652('0x61')]=_0x58650f['id'];return db['MailServerOut']['create'](_0x3e8d21['body']);}})['then'](respondWithResult(_0x3de32c,null))[_0x5652('0x28')](handleError(_0x3de32c,null));};exports[_0x5652('0x89')]=function(_0x56fae7,_0x2f8cb3,_0xc73ad5){return db[_0x5652('0x5b')][_0x5652('0x63')]({'where':{'id':_0x56fae7[_0x5652('0x58')]['id']}})['then'](handleEntityNotFound(_0x2f8cb3,null))[_0x5652('0x1d')](function(_0x2943c3){if(_0x2943c3){return _0x2943c3['setSmtp'](null);}return null;})[_0x5652('0x1d')](respondWithStatusCode(_0x2f8cb3,null))[_0x5652('0x28')](handleError(_0x2f8cb3,null));};exports[_0x5652('0x8a')]=function(_0x5cb7e3,_0x3b6c9a,_0x8bfb6e){return db['MailInteraction'][_0x5652('0x5c')]({'where':{'id':_0x5cb7e3['params']['id']}})[_0x5652('0x1d')](handleEntityNotFound(_0x3b6c9a,null))[_0x5652('0x1d')](function(_0x3f17f6){if(_0x3f17f6){return _0x3f17f6[_0x5652('0x8a')](_0x5cb7e3[_0x5652('0x5d')][_0x5652('0x69')],_['omit'](_0x5cb7e3[_0x5652('0x5d')],['ids','id'])||{});}})['then'](respondWithResult(_0x3b6c9a,null))[_0x5652('0x28')](handleError(_0x3b6c9a,null));};exports[_0x5652('0x8b')]=function(_0x809603,_0x5ee0a8,_0x3fd891){var _0x2c7693={'raw':![],'where':{}};var _0x157839={};var _0x33caf9={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x809603[_0x5652('0x58')]['id']}})['then'](handleEntityNotFound(_0x5ee0a8,null))[_0x5652('0x1d')](function(_0x2f9dc7){if(_0x2f9dc7){_0x157839[_0x5652('0x44')]=_[_0x5652('0x46')](db[_0x5652('0x8c')][_0x5652('0x40')]);_0x157839[_0x5652('0x45')]=_['keys'](_0x809603[_0x5652('0x45')]);_0x157839['filters']=_[_0x5652('0x48')](_0x157839[_0x5652('0x44')],_0x157839['query']);_0x2c7693['attributes']=_[_0x5652('0x48')](_0x157839[_0x5652('0x44')],qs[_0x5652('0x49')](_0x809603[_0x5652('0x45')]['fields']));_0x2c7693['attributes']=_0x2c7693[_0x5652('0x47')][_0x5652('0x4a')]?_0x2c7693[_0x5652('0x47')]:_0x157839[_0x5652('0x44')];if(!_0x809603[_0x5652('0x45')][_0x5652('0x4b')](_0x5652('0x4c'))){_0x2c7693['limit']=qs[_0x5652('0x2c')](_0x809603[_0x5652('0x45')][_0x5652('0x2c')]);_0x2c7693[_0x5652('0x2e')]=qs['offset'](_0x809603[_0x5652('0x45')][_0x5652('0x2e')]);}_0x2c7693['order']=qs[_0x5652('0x4e')](_0x809603[_0x5652('0x45')]['sort']);_0x2c7693[_0x5652('0x4f')]=qs[_0x5652('0x50')](_['pick'](_0x809603[_0x5652('0x45')],_0x157839[_0x5652('0x50')]));_0x2c7693[_0x5652('0x4f')][_0x5652('0x61')]=_0x2f9dc7['id'];if(_0x809603['query'][_0x5652('0x51')]){_0x2c7693[_0x5652('0x4f')]=_['merge'](_0x2c7693[_0x5652('0x4f')],{'$or':_[_0x5652('0x3f')](_0x2c7693[_0x5652('0x47')],function(_0x543c35){var _0x383e2a={};_0x383e2a[_0x543c35]={'$like':'%'+_0x809603['query'][_0x5652('0x51')]+'%'};return _0x383e2a;})});}_0x2c7693=_[_0x5652('0x52')]({},_0x2c7693,_0x809603[_0x5652('0x54')]);return db['MailInteraction']['count']({'where':_0x2c7693[_0x5652('0x4f')]})[_0x5652('0x1d')](function(_0xf1c2c9){_0x33caf9['count']=_0xf1c2c9;if(_0x809603[_0x5652('0x45')][_0x5652('0x55')]){_0x2c7693[_0x5652('0x56')]=[{'model':db[_0x5652('0x8d')],'as':_0x5652('0x8e'),'required':![]},{'model':db['User'],'as':_0x5652('0x8f'),'attributes':[_0x5652('0x39'),_0x5652('0x90'),_0x5652('0x91')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x5652('0x39'),_0x5652('0x92')],'where':_0x809603[_0x5652('0x45')]['tag']?{'id':_0x809603[_0x5652('0x45')]['tag']}:undefined,'required':_0x809603['query']['tag']?!![]:![]}];}return db[_0x5652('0x8c')][_0x5652('0x66')](_0x2c7693);})['then'](function(_0x23476c){_0x33caf9[_0x5652('0x67')]=_0x23476c;return _0x33caf9;});}})[_0x5652('0x1d')](respondWithFilteredResult(_0x5ee0a8,_0x2c7693))['catch'](handleError(_0x5ee0a8,null));};exports[_0x5652('0x93')]=function(_0x49c2d2,_0x55f481,_0x14ef17){return db[_0x5652('0x5b')][_0x5652('0x63')]({'where':{'id':_0x49c2d2['params']['id']}})['then'](handleEntityNotFound(_0x55f481,null))[_0x5652('0x1d')](function(_0x189dd2){if(_0x189dd2){return db[_0x5652('0x94')][_0x5652('0x95')](function(_0x125ee1){return db[_0x5652('0x96')][_0x5652('0x35')]({'where':{'MailAccountId':_0x49c2d2[_0x5652('0x58')]['id']},'transaction':_0x125ee1})['then'](function(_0x5b2a7d){var _0x271ea2=_[_0x5652('0x3f')](_0x49c2d2['body'],function(_0xffc656){_0xffc656[_0x5652('0x61')]=_0x49c2d2[_0x5652('0x58')]['id'];return _0xffc656;});return db[_0x5652('0x96')][_0x5652('0x97')](_0x271ea2,{'transaction':_0x125ee1});});})[_0x5652('0x1d')](function(){return db['MailApplication'][_0x5652('0x98')]({'where':{'MailAccountId':_0x49c2d2[_0x5652('0x58')]['id']},'order':_0x5652('0x99')});});}})['then'](respondWithResult(_0x55f481,null))['catch'](handleError(_0x55f481,null));};exports['getApplications']=function(_0x246aea,_0x15df02,_0x4df6d0){var _0x30caa4={};var _0x16240d={};var _0x40ca38;var _0x438f12;return db[_0x5652('0x5b')][_0x5652('0x63')]({'where':{'id':_0x246aea[_0x5652('0x58')]['id']}})['then'](handleEntityNotFound(_0x15df02,null))[_0x5652('0x1d')](function(_0x16b640){if(_0x16b640){_0x40ca38=_0x16b640;_0x16240d[_0x5652('0x44')]=_[_0x5652('0x46')](db[_0x5652('0x96')][_0x5652('0x40')]);_0x16240d[_0x5652('0x45')]=_[_0x5652('0x46')](_0x246aea[_0x5652('0x45')]);_0x16240d['filters']=_['intersection'](_0x16240d[_0x5652('0x44')],_0x16240d['query']);_0x30caa4[_0x5652('0x47')]=_[_0x5652('0x48')](_0x16240d[_0x5652('0x44')],qs['fields'](_0x246aea[_0x5652('0x45')][_0x5652('0x49')]));_0x30caa4[_0x5652('0x47')]=_0x30caa4[_0x5652('0x47')][_0x5652('0x4a')]?_0x30caa4[_0x5652('0x47')]:_0x16240d[_0x5652('0x44')];_0x30caa4[_0x5652('0x4d')]=qs[_0x5652('0x4e')](_0x246aea[_0x5652('0x45')][_0x5652('0x4e')]);_0x30caa4[_0x5652('0x4f')]=qs['filters'](_[_0x5652('0x65')](_0x246aea[_0x5652('0x45')],_0x16240d[_0x5652('0x50')]));if(_0x246aea[_0x5652('0x45')][_0x5652('0x51')]){_0x30caa4[_0x5652('0x4f')]=_['merge'](_0x30caa4['where'],{'$or':_['map'](_0x30caa4[_0x5652('0x47')],function(_0xa4a76){var _0xe23357={};_0xe23357[_0xa4a76]={'$like':'%'+_0x246aea[_0x5652('0x45')]['filter']+'%'};return _0xe23357;})});}_0x30caa4=_['merge']({},_0x30caa4,_0x246aea[_0x5652('0x54')]);return _0x40ca38['getApplications'](_0x30caa4);}})['then'](function(_0x42e3ba){if(_0x42e3ba){_0x438f12=_0x42e3ba[_0x5652('0x4a')];if(!_0x246aea['query'][_0x5652('0x4b')]('nolimit')){_0x30caa4[_0x5652('0x2c')]=qs[_0x5652('0x2c')](_0x246aea[_0x5652('0x45')]['limit']);_0x30caa4[_0x5652('0x2e')]=qs[_0x5652('0x2e')](_0x246aea['query'][_0x5652('0x2e')]);}return _0x40ca38[_0x5652('0x9a')](_0x30caa4);}})[_0x5652('0x1d')](function(_0x785885){if(_0x785885){return _0x785885?{'count':_0x438f12,'rows':_0x785885}:null;}})[_0x5652('0x1d')](respondWithResult(_0x15df02,null))[_0x5652('0x28')](handleError(_0x15df02,null));};exports[_0x5652('0x9b')]=function(_0xf2a9ad,_0x2c6f58,_0x299e22){var _0x28caef={'raw':!![],'where':{}};var _0xf9c03e={};var _0x158df6={'count':0x0,'rows':[]};return db[_0x5652('0x5b')][_0x5652('0x63')]({'where':{'id':_0xf2a9ad['params']['id']}})[_0x5652('0x1d')](handleEntityNotFound(_0x2c6f58,null))[_0x5652('0x1d')](function(_0xbc58dd){if(_0xbc58dd){_0xf9c03e['model']=_[_0x5652('0x46')](db['MailMessage'][_0x5652('0x40')]);_0xf9c03e[_0x5652('0x45')]=_[_0x5652('0x46')](_0xf2a9ad[_0x5652('0x45')]);_0xf9c03e['filters']=_[_0x5652('0x48')](_0xf9c03e[_0x5652('0x44')],_0xf9c03e[_0x5652('0x45')]);_0x28caef[_0x5652('0x47')]=_[_0x5652('0x48')](_0xf9c03e[_0x5652('0x44')],qs[_0x5652('0x49')](_0xf2a9ad['query'][_0x5652('0x49')]));_0x28caef['attributes']=_0x28caef[_0x5652('0x47')][_0x5652('0x4a')]?_0x28caef['attributes']:_0xf9c03e[_0x5652('0x44')];if(!_0xf2a9ad[_0x5652('0x45')][_0x5652('0x4b')]('nolimit')){_0x28caef['limit']=qs[_0x5652('0x2c')](_0xf2a9ad[_0x5652('0x45')][_0x5652('0x2c')]);_0x28caef[_0x5652('0x2e')]=qs[_0x5652('0x2e')](_0xf2a9ad['query'][_0x5652('0x2e')]);}_0x28caef[_0x5652('0x4d')]=qs[_0x5652('0x4e')](_0xf2a9ad[_0x5652('0x45')]['sort']);_0x28caef[_0x5652('0x4f')]=qs[_0x5652('0x50')](_[_0x5652('0x65')](_0xf2a9ad['query'],_0xf9c03e['filters']));_0x28caef[_0x5652('0x4f')][_0x5652('0x61')]=_0xbc58dd['id'];if(_0xf2a9ad[_0x5652('0x45')][_0x5652('0x51')]){_0x28caef['where']=_[_0x5652('0x52')](_0x28caef[_0x5652('0x4f')],{'$or':_[_0x5652('0x3f')](_0x28caef['attributes'],function(_0x22c7ca){var _0xc8b9bd={};_0xc8b9bd[_0x22c7ca]={'$like':'%'+_0xf2a9ad[_0x5652('0x45')][_0x5652('0x51')]+'%'};return _0xc8b9bd;})});}if(_0xf2a9ad[_0x5652('0x45')][_0x5652('0x9c')]){var _0x31cbf8=_0xf2a9ad[_0x5652('0x45')][_0x5652('0x9c')][_0x5652('0x9d')](',');var _0x8facf3={};_0x8facf3[_0x31cbf8[0x0]]={'$gte':moment(_0x31cbf8[0x1])[_0x5652('0x9e')](_0x5652('0x9f'))};_0x28caef['where']=_[_0x5652('0x52')](_0x28caef[_0x5652('0x4f')],_0x8facf3);}_0x28caef=_['merge']({},_0x28caef,_0xf2a9ad[_0x5652('0x54')]);return db[_0x5652('0xa0')]['count']({'where':_0x28caef['where']})[_0x5652('0x1d')](function(_0x48110e){_0x158df6['count']=_0x48110e;if(_0xf2a9ad['query'][_0x5652('0x55')]){_0x28caef[_0x5652('0x56')]=[{'all':!![]}];}return db[_0x5652('0xa0')]['findAll'](_0x28caef);})[_0x5652('0x1d')](function(_0x2eb4bd){if(_0xf2a9ad[_0x5652('0x45')][_0x5652('0xa1')]==='true'){for(var _0x4f1665=0x0;_0x4f1665<_0x2eb4bd[_0x5652('0x4a')];_0x4f1665++){_0x2eb4bd[_0x4f1665][_0x5652('0x5d')]=juice(_0x2eb4bd[_0x4f1665]['body']);}}_0x158df6[_0x5652('0x67')]=_0x2eb4bd;return _0x158df6;});}})[_0x5652('0x1d')](respondWithFilteredResult(_0x2c6f58,_0x28caef))['catch'](handleError(_0x2c6f58,null));};exports[_0x5652('0x3a')]=function(_0x46e375,_0x1f9a73,_0x327da6){var _0x1bda5c,_0x372471={},_0x21b9b8;if(_0x46e375['body']['to']){_0x21b9b8=_0x46e375[_0x5652('0x5d')]['to'][_0x5652('0x9d')](',')[0x0];}return db[_0x5652('0x5b')]['find']({'where':{'id':_0x46e375[_0x5652('0x58')]['id']},'include':[{'model':db['CmList'],'as':_0x5652('0xa2'),'include':[{'model':db[_0x5652('0x8d')],'as':_0x5652('0xa3'),'where':{'email':_0x21b9b8},'limit':0x1,'order':[[_0x5652('0xa4'),_0x5652('0xa5')]]}]},{'model':db[_0x5652('0x3d')],'as':_0x5652('0x59'),'raw':!![]}]})[_0x5652('0x1d')](handleEntityNotFound(_0x1f9a73,null))[_0x5652('0x1d')](function(_0x158fec){if(_0x158fec){_0x1bda5c=_0x158fec;if(_0x158fec[_0x5652('0x59')]){if(_['isNil'](_0x46e375[_0x5652('0x5d')][_0x5652('0xa6')])){_0x46e375[_0x5652('0x5d')][_0x5652('0xa6')]=util[_0x5652('0x9e')](_0x5652('0xa7'),_0x158fec[_0x5652('0x39')],_0x158fec[_0x5652('0x6d')]||_0x158fec[_0x5652('0x59')]['user']);}if(_0x46e375[_0x5652('0x5d')][_0x5652('0xa8')]&&_0x46e375[_0x5652('0x5d')]['attachments'][_0x5652('0x4a')]){for(var _0x26cfb8=0x0;_0x26cfb8<_0x46e375['body'][_0x5652('0xa8')][_0x5652('0x4a')];_0x26cfb8+=0x1){_0x46e375[_0x5652('0x5d')][_0x5652('0xa8')][_0x26cfb8]={'filename':_0x46e375[_0x5652('0x5d')][_0x5652('0xa8')][_0x26cfb8][_0x5652('0x39')],'path':path[_0x5652('0xa9')](config['root'],'server/files/attachments',_0x46e375[_0x5652('0x5d')][_0x5652('0xa8')][_0x26cfb8]['basename'])};}}var _0x26ebd1={'tls':{'rejectUnauthorized':![]}};if(_[_0x5652('0x6f')](_0x158fec[_0x5652('0x59')][_0x5652('0x7b')])){if(_0x158fec['Smtp'][_0x5652('0x78')]){_0x26ebd1[_0x5652('0xaa')]={'user':_0x158fec['Smtp'][_0x5652('0x73')],'pass':_0x158fec[_0x5652('0x59')][_0x5652('0x76')]};}_0x26ebd1[_0x5652('0x79')]=_0x158fec[_0x5652('0x59')]['host'];_0x26ebd1[_0x5652('0x7a')]=_0x158fec[_0x5652('0x59')][_0x5652('0x7a')];_0x26ebd1[_0x5652('0xab')]=_0x158fec[_0x5652('0x59')]['secure'];}else{_0x26ebd1[_0x5652('0x7b')]=_0x158fec[_0x5652('0x59')][_0x5652('0x7b')];_0x26ebd1[_0x5652('0xaa')]={'user':_0x158fec['Smtp'][_0x5652('0x73')],'pass':_0x158fec[_0x5652('0x59')][_0x5652('0x76')]};}return respondWithRpcPromise(_0x5652('0xac'),_0x5652('0xad'),{'account':_0x26ebd1,'message':_0x46e375[_0x5652('0x5d')]});}else{throw new Error(_0x5652('0xae'));}}})[_0x5652('0x1d')](function(_0x1f9c0b){if(_0x1f9c0b){_0x372471=_0x1f9c0b;if(_0x1bda5c[_0x5652('0xa2')]){if(_0x1bda5c[_0x5652('0xa2')]['Contacts'][_0x5652('0x4a')]){return _0x1bda5c[_0x5652('0xa2')][_0x5652('0xa3')][0x0];}else{return db[_0x5652('0x8d')][_0x5652('0x62')](_[_0x5652('0x17')](_0x46e375[_0x5652('0x5d')],{'firstName':_0x46e375[_0x5652('0x5d')]['to'],'email':_0x46e375['body']['to'],'phone':_0x46e375[_0x5652('0x5d')]['to'],'ListId':_0x1bda5c[_0x5652('0x6e')]}));}}else{throw new Error(_0x5652('0xae'));}}})['then'](function(_0x1495d4){if(_0x1495d4){var _0x5e314e={'UserId':_0x46e375[_0x5652('0x73')]['id'],'ContactId':_0x1495d4['id'],'MailAccountId':_0x1bda5c['id'],'inReplyTo':_0x372471[_0x5652('0xaf')],'to':_0x46e375['body']['from'],'cc':_0x46e375['body']['cc'],'subject':_0x46e375[_0x5652('0x5d')][_0x5652('0xb0')],'attach':_0x46e375['body'][_0x5652('0xb1')],'firstMsgDirection':'out','lastMsgAt':moment()[_0x5652('0x9e')](_0x5652('0x9f')),'lastMsgDirection':_0x5652('0xb2'),'Messages':[_['merge'](_0x46e375[_0x5652('0x5d')],{'messageId':_0x372471[_0x5652('0xaf')],'sentAt':moment()[_0x5652('0x9e')](_0x5652('0x9f')),'read':!![],'MailAccountId':_0x1bda5c['id'],'UserId':_0x46e375[_0x5652('0x73')]['id'],'ContactId':_0x1495d4['id']})]};if(_0x46e375[_0x5652('0x5d')][_0x5652('0xb3')]){_0x5e314e=_[_0x5652('0x52')](_0x5e314e,_0x46e375['body'][_0x5652('0xb3')]);}return db['MailInteraction'][_0x5652('0x62')](_0x5e314e,{'include':[{'model':db[_0x5652('0xa0')],'as':_0x5652('0xb4')}]});}})[_0x5652('0x1d')](respondWithResult(_0x1f9a73,null))[_0x5652('0x28')](handleError(_0x1f9a73,null));};exports[_0x5652('0xb5')]=function(_0x19cdb5,_0x249b04,_0x2d37b0){return db[_0x5652('0x5b')][_0x5652('0x5c')]({'where':{'id':_0x19cdb5[_0x5652('0x58')]['id']},'include':[{'model':db[_0x5652('0x3d')],'as':_0x5652('0x59'),'raw':!![]}]})[_0x5652('0x1d')](handleEntityNotFound(_0x249b04,null))[_0x5652('0x1d')](function(_0x44b14a){if(_0x44b14a&&_0x44b14a['Smtp']){var _0xb4531={'id':_0x44b14a['id'],'tls':{'rejectUnauthorized':![]}};if(_0x44b14a[_0x5652('0x59')]['service']){_0xb4531[_0x5652('0x7b')]=_0x44b14a[_0x5652('0x59')][_0x5652('0x7b')];}else{_0xb4531[_0x5652('0x79')]=_0x44b14a[_0x5652('0x59')][_0x5652('0x79')];_0xb4531[_0x5652('0x7a')]=_0x44b14a['Smtp'][_0x5652('0x7a')];_0xb4531['secure']=_0x44b14a[_0x5652('0x59')]['secure'];}if(_0x44b14a[_0x5652('0x59')][_0x5652('0x78')]){_0xb4531[_0x5652('0xaa')]={'user':_0x44b14a['Smtp'][_0x5652('0x73')],'pass':_0x44b14a['Smtp']['pass']};}return respondWithRpcPromise('VerifySmtp',_0x5652('0xb5'),{'account':_0xb4531});}})[_0x5652('0x1d')](respondWithResult(_0x249b04,null))[_0x5652('0x28')](handleError(_0x249b04,null));};exports[_0x5652('0x35')]=function(_0x4813fd,_0x132411){return db[_0x5652('0x5b')]['find']({'where':{'id':_0x4813fd[_0x5652('0x58')]['id']}})['then'](handleEntityNotFound(_0x132411,null))[_0x5652('0x1d')](function(_0x5847fe){if(_0x5847fe&&_0x5847fe[_0x5652('0x7b')]){throw new db[(_0x5652('0xb6'))][(_0x5652('0xb7'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x5847fe;})[_0x5652('0x1d')](removeEntity(_0x132411,null))[_0x5652('0x28')](handleError(_0x132411,null));};exports[_0x5652('0xb8')]=function(_0x43a6e1,_0x198f8c,_0x2d99f6){return db[_0x5652('0x5b')][_0x5652('0x5c')]({'where':{'id':_0x43a6e1[_0x5652('0x58')]['id']}})[_0x5652('0x1d')](handleEntityNotFound(_0x198f8c,null))['then'](function(_0x2a13a1){if(_0x2a13a1){return _0x2a13a1[_0x5652('0xb8')](_0x43a6e1[_0x5652('0x5d')][_0x5652('0x69')],_[_0x5652('0xb9')](_0x43a6e1[_0x5652('0x5d')],[_0x5652('0x69'),'id'])||{})[_0x5652('0xba')](function(_0x3930b6){for(var _0xaccb34=0x0;_0xaccb34<_0x43a6e1['body']['ids'][_0x5652('0x4a')];_0xaccb34+=0x1){socket[_0x5652('0xbb')](_0x5652('0xbc'),{'UserId':Number(_0x43a6e1['body'][_0x5652('0x69')][_0xaccb34]),'MailAccountId':Number(_0x43a6e1[_0x5652('0x58')]['id'])});}return _0x3930b6;});}})['then'](respondWithResult(_0x198f8c,null))[_0x5652('0x28')](handleError(_0x198f8c,null));};exports[_0x5652('0xbd')]=function(_0x241a7e,_0x275f84,_0x29cc05){return db['MailAccount'][_0x5652('0x5c')]({'where':{'id':_0x241a7e[_0x5652('0x58')]['id']}})[_0x5652('0x1d')](handleEntityNotFound(_0x275f84,null))['then'](function(_0x11457f){if(_0x11457f){return _0x11457f[_0x5652('0xbd')](_0x241a7e[_0x5652('0x45')]['ids'])[_0x5652('0x1d')](function(){if(_['isArray'](_0x241a7e['query'][_0x5652('0x69')])){for(var _0x46ff13=0x0;_0x46ff13<_0x241a7e[_0x5652('0x45')][_0x5652('0x69')][_0x5652('0x4a')];_0x46ff13+=0x1){socket[_0x5652('0xbb')](_0x5652('0xbe'),{'UserId':Number(_0x241a7e[_0x5652('0x45')][_0x5652('0x69')][_0x46ff13]),'MailAccountId':Number(_0x241a7e[_0x5652('0x58')]['id'])});}}else{socket[_0x5652('0xbb')](_0x5652('0xbe'),{'UserId':Number(_0x241a7e['query'][_0x5652('0x69')]),'MailAccountId':Number(_0x241a7e['params']['id'])});}});}})[_0x5652('0x1d')](respondWithStatusCode(_0x275f84,null))[_0x5652('0x28')](handleError(_0x275f84,null));};exports[_0x5652('0xbf')]=function(_0x825266,_0x1f17d9,_0x55a60b){var _0x89f96e={};var _0x3a689e={};var _0x311303;var _0x3bf2bb;return db['MailAccount'][_0x5652('0x63')]({'where':{'id':_0x825266[_0x5652('0x58')]['id']}})[_0x5652('0x1d')](handleEntityNotFound(_0x1f17d9,null))[_0x5652('0x1d')](function(_0xc6a2bb){if(_0xc6a2bb){_0x311303=_0xc6a2bb;_0x3a689e['model']=_[_0x5652('0x46')](db[_0x5652('0xc0')][_0x5652('0x40')]);_0x3a689e[_0x5652('0x45')]=_[_0x5652('0x46')](_0x825266[_0x5652('0x45')]);_0x3a689e['filters']=_['intersection'](_0x3a689e['model'],_0x3a689e[_0x5652('0x45')]);_0x89f96e[_0x5652('0x47')]=_[_0x5652('0x48')](_0x3a689e[_0x5652('0x44')],qs[_0x5652('0x49')](_0x825266[_0x5652('0x45')][_0x5652('0x49')]));_0x89f96e['attributes']=_0x89f96e['attributes'][_0x5652('0x4a')]?_0x89f96e[_0x5652('0x47')]:_0x3a689e['model'];_0x89f96e['order']=qs['sort'](_0x825266['query'][_0x5652('0x4e')]);_0x89f96e[_0x5652('0x4f')]=qs[_0x5652('0x50')](_[_0x5652('0x65')](_0x825266['query'],_0x3a689e[_0x5652('0x50')]));if(_0x825266[_0x5652('0x45')][_0x5652('0x51')]){_0x89f96e[_0x5652('0x4f')]=_[_0x5652('0x52')](_0x89f96e[_0x5652('0x4f')],{'$or':_[_0x5652('0x3f')](_0x89f96e[_0x5652('0x47')],function(_0x142619){var _0x1bbe04={};_0x1bbe04[_0x142619]={'$like':'%'+_0x825266['query'][_0x5652('0x51')]+'%'};return _0x1bbe04;})});}_0x89f96e=_[_0x5652('0x52')]({},_0x89f96e,_0x825266[_0x5652('0x54')]);return _0x311303[_0x5652('0xbf')](_0x89f96e);}})[_0x5652('0x1d')](function(_0x523f0d){if(_0x523f0d){_0x3bf2bb=_0x523f0d[_0x5652('0x4a')];if(!_0x825266[_0x5652('0x45')][_0x5652('0x4b')](_0x5652('0x4c'))){_0x89f96e[_0x5652('0x2c')]=qs[_0x5652('0x2c')](_0x825266[_0x5652('0x45')]['limit']);_0x89f96e[_0x5652('0x2e')]=qs[_0x5652('0x2e')](_0x825266[_0x5652('0x45')][_0x5652('0x2e')]);}return _0x311303['getAgents'](_0x89f96e);}})[_0x5652('0x1d')](function(_0x5921f0){if(_0x5921f0){return _0x5921f0?{'count':_0x3bf2bb,'rows':_0x5921f0}:null;}})[_0x5652('0x1d')](respondWithResult(_0x1f17d9,null))[_0x5652('0x28')](handleError(_0x1f17d9,null));}; \ No newline at end of file +var _0xd716=['findOne','Disposition','nolimit','removeDispositions','addAnswer','CannedAnswer','create','getAnswers','removeAnswers','ids','email','isNil','active','description','cservice','cauthentication','user','password','cpassword','host','port','service','cuser','pass','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','CmContact','User','Owner','fullname','internal','Tag','Tags','tag','addApplications','sequelize','transaction','MailApplication','bulkCreate','priority','getApplications','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','CmList','List','Contacts','updatedAt','from','attachments','join','root','server/files/attachments','basename','auth','secure','SendMail','sendMail','List\x20not\x20found','ListId','messageId','attach','Interaction','Messages','verifySmtp','authentication','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','removeAgents','isArray','userMailAccount:remove','getAgents','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','html-to-text','juice','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','http','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','save','update','get','MailAccounts','UserProfileResource','destroy','stack','index','MailServerOut','Pause','MailAccount','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','VIRTUAL','options','include','findAll','rows','catch','Smtp','rawAttributes','includeAll','find','params','MailServerIn','Imap','mandatoryDispositionPause','body','describe','addDisposition','MailAccountId','getDispositions'];(function(_0x567a92,_0xec96a4){var _0x2fb615=function(_0x10fc8a){while(--_0x10fc8a){_0x567a92['push'](_0x567a92['shift']());}};_0x2fb615(++_0xec96a4);}(_0xd716,0x1e1));var _0x6d71=function(_0x46f1a6,_0xc7a582){_0x46f1a6=_0x46f1a6-0x0;var _0x38429a=_0xd716[_0x46f1a6];return _0x38429a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6d71('0x0'));var rp=require(_0x6d71('0x1'));var moment=require('moment');var BPromise=require(_0x6d71('0x2'));var Mustache=require(_0x6d71('0x3'));var util=require(_0x6d71('0x4'));var path=require('path');var sox=require(_0x6d71('0x5'));var csv=require(_0x6d71('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d71('0x7'));var _=require(_0x6d71('0x8'));var squel=require(_0x6d71('0x9'));var crypto=require('crypto');var jsforce=require(_0x6d71('0xa'));var deskjs=require(_0x6d71('0xb'));var toCsv=require(_0x6d71('0x6'));var querystring=require('querystring');var Papa=require(_0x6d71('0xc'));var htmlToText=require(_0x6d71('0xd'));var juice=require(_0x6d71('0xe'));var Redis=require(_0x6d71('0xf'));var authService=require(_0x6d71('0x10'));var qs=require(_0x6d71('0x11'));var as=require(_0x6d71('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6d71('0x13'))(_0x6d71('0x14'));var utils=require(_0x6d71('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6d71('0x16'));var db=require(_0x6d71('0x17'))['db'];config[_0x6d71('0x18')]=_[_0x6d71('0x19')](config[_0x6d71('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x6d71('0x1a'))(new Redis(config[_0x6d71('0x18')]));require('./mailAccount.socket')[_0x6d71('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x6d71('0x1c')]({'port':0x232b});function respondWithRpcPromise(_0x530850,_0x23c8e3,_0x5aebbf,_0x17fe83){return new BPromise(function(_0x2b6818,_0x2bcd76){var _0x423390=_0x17fe83||client;return _0x423390[_0x6d71('0x1d')](_0x530850,_0x5aebbf)[_0x6d71('0x1e')](function(_0x563d17){logger['info'](_0x6d71('0x1f'),_0x23c8e3,_0x6d71('0x20'));logger[_0x6d71('0x21')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x23c8e3,_0x6d71('0x20'),JSON[_0x6d71('0x22')](_0x563d17));if(_0x563d17[_0x6d71('0x23')]){if(_0x563d17['error'][_0x6d71('0x24')]===0x1f4){logger[_0x6d71('0x23')](_0x6d71('0x1f'),_0x23c8e3,_0x563d17[_0x6d71('0x23')][_0x6d71('0x25')]);return _0x2bcd76(_0x563d17[_0x6d71('0x23')][_0x6d71('0x25')]);}logger[_0x6d71('0x23')](_0x6d71('0x1f'),_0x23c8e3,_0x563d17[_0x6d71('0x23')][_0x6d71('0x25')]);return _0x2b6818(_0x563d17[_0x6d71('0x23')][_0x6d71('0x25')]);}else{logger[_0x6d71('0x26')]('MailAccount,\x20%s,\x20%s',_0x23c8e3,_0x6d71('0x20'));_0x2b6818(_0x563d17[_0x6d71('0x27')]['message']);}})['catch'](function(_0x3df7f1){logger[_0x6d71('0x23')]('MailAccount,\x20%s,\x20%s',_0x23c8e3,_0x3df7f1);_0x2bcd76(_0x3df7f1);});});}function respondWithStatusCode(_0x181d6e,_0x58eeb1){_0x58eeb1=_0x58eeb1||0xcc;return function(_0x2de3d3){if(_0x2de3d3){return _0x181d6e[_0x6d71('0x28')](_0x58eeb1);}return _0x181d6e[_0x6d71('0x29')](_0x58eeb1)[_0x6d71('0x2a')]();};}function respondWithResult(_0x2c0923,_0x19c942){_0x19c942=_0x19c942||0xc8;return function(_0xd0a9fd){if(_0xd0a9fd){return _0x2c0923['status'](_0x19c942)['json'](_0xd0a9fd);}};}function respondWithFilteredResult(_0x4a2021,_0x4139a4){return function(_0x537733){if(_0x537733){var _0x467d23=typeof _0x4139a4[_0x6d71('0x2b')]==='undefined'&&typeof _0x4139a4[_0x6d71('0x2c')]===_0x6d71('0x2d');var _0x2b83b8=_0x537733[_0x6d71('0x2e')];var _0x4a7519=_0x467d23?0x0:_0x4139a4[_0x6d71('0x2b')];var _0x106027=_0x467d23?_0x537733[_0x6d71('0x2e')]:_0x4139a4[_0x6d71('0x2b')]+_0x4139a4[_0x6d71('0x2c')];var _0x139da3;if(_0x106027>=_0x2b83b8){_0x106027=_0x2b83b8;_0x139da3=0xc8;}else{_0x139da3=0xce;}_0x4a2021['status'](_0x139da3);return _0x4a2021[_0x6d71('0x2f')]('Content-Range',_0x4a7519+'-'+_0x106027+'/'+_0x2b83b8)[_0x6d71('0x30')](_0x537733);}return null;};}function patchUpdates(_0x2f4413){return function(_0x54f26f){try{jsonpatch[_0x6d71('0x31')](_0x54f26f,_0x2f4413,!![]);}catch(_0xcdb81c){return BPromise[_0x6d71('0x32')](_0xcdb81c);}return _0x54f26f[_0x6d71('0x33')]();};}function saveUpdates(_0x3ff306,_0x50d4db){return function(_0x1c1c3c){if(_0x1c1c3c){return _0x1c1c3c[_0x6d71('0x34')](_0x3ff306)[_0x6d71('0x1e')](function(_0x4e82bd){return _0x4e82bd;});}return null;};}function removeEntity(_0x360e97,_0x1c14ee){return function(_0x4c47e9){if(_0x4c47e9){return _0x4c47e9['destroy']()['then'](function(){var _0x53c0c1=_0x4c47e9[_0x6d71('0x35')]({'plain':!![]});var _0x50d268=_0x6d71('0x36');return db[_0x6d71('0x37')][_0x6d71('0x38')]({'where':{'type':_0x50d268,'resourceId':_0x53c0c1['id']}})['then'](function(){return _0x4c47e9;});})[_0x6d71('0x1e')](function(){_0x360e97['status'](0xcc)[_0x6d71('0x2a')]();});}};}function handleEntityNotFound(_0x4fbd83,_0x3375e8){return function(_0x48ef95){if(!_0x48ef95){_0x4fbd83[_0x6d71('0x28')](0x194);}return _0x48ef95;};}function handleError(_0x59fabb,_0xa331fd){_0xa331fd=_0xa331fd||0x1f4;return function(_0x270ff4){logger[_0x6d71('0x23')](_0x270ff4[_0x6d71('0x39')]);if(_0x270ff4['name']){delete _0x270ff4['name'];}_0x59fabb[_0x6d71('0x29')](_0xa331fd)['send'](_0x270ff4);};}exports[_0x6d71('0x3a')]=function(_0xd26dc3,_0x551884){var _0x1a6574={'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db[_0x6d71('0x3b')],'as':'Smtp'},{'model':db[_0x6d71('0x3c')],'as':'mandatoryDispositionPause'}]},_0x1dfdb2={},_0x2fa9a9={'count':0x0,'rows':[]};var _0x55d753=_['map'](db[_0x6d71('0x3d')]['rawAttributes'],function(_0x11a852){return{'name':_0x11a852[_0x6d71('0x3e')],'type':_0x11a852[_0x6d71('0x3f')][_0x6d71('0x40')]};});_0x1dfdb2[_0x6d71('0x41')]=_['map'](_0x55d753,_0x6d71('0x42'));_0x1dfdb2[_0x6d71('0x43')]=_[_0x6d71('0x44')](_0xd26dc3[_0x6d71('0x43')]);_0x1dfdb2[_0x6d71('0x45')]=_[_0x6d71('0x46')](_0x1dfdb2[_0x6d71('0x41')],_0x1dfdb2[_0x6d71('0x43')]);_0x1a6574[_0x6d71('0x47')]=_['intersection'](_0x1dfdb2['model'],qs[_0x6d71('0x48')](_0xd26dc3[_0x6d71('0x43')]['fields']));_0x1a6574['attributes']=_0x1a6574['attributes'][_0x6d71('0x49')]?_0x1a6574['attributes']:_0x1dfdb2[_0x6d71('0x41')];if(!_0xd26dc3[_0x6d71('0x43')][_0x6d71('0x4a')]('nolimit')){_0x1a6574[_0x6d71('0x2c')]=qs[_0x6d71('0x2c')](_0xd26dc3['query'][_0x6d71('0x2c')]);_0x1a6574[_0x6d71('0x2b')]=qs[_0x6d71('0x2b')](_0xd26dc3['query'][_0x6d71('0x2b')]);}_0x1a6574[_0x6d71('0x4b')]=qs[_0x6d71('0x4c')](_0xd26dc3[_0x6d71('0x43')]['sort']);_0x1a6574[_0x6d71('0x4d')]=qs['filters'](_[_0x6d71('0x4e')](_0xd26dc3['query'],_0x1dfdb2[_0x6d71('0x45')]),_0x55d753);if(_0xd26dc3['query'][_0x6d71('0x4f')]){_0x1a6574['where']=_[_0x6d71('0x50')](_0x1a6574[_0x6d71('0x4d')],{'$or':_[_0x6d71('0x51')](_0x55d753,function(_0x1f42bf){if(_0x1f42bf[_0x6d71('0x3f')]!==_0x6d71('0x52')){var _0x333ffc={};_0x333ffc[_0x1f42bf[_0x6d71('0x42')]]={'$like':'%'+_0xd26dc3[_0x6d71('0x43')][_0x6d71('0x4f')]+'%'};return _0x333ffc;}})});}_0x1a6574=_[_0x6d71('0x50')]({},_0x1a6574,_0xd26dc3[_0x6d71('0x53')]);var _0x40ad9e={'where':_0x1a6574[_0x6d71('0x4d')]};return db[_0x6d71('0x3d')][_0x6d71('0x2e')](_0x40ad9e)[_0x6d71('0x1e')](function(_0x7d602f){_0x2fa9a9[_0x6d71('0x2e')]=_0x7d602f;if(_0xd26dc3[_0x6d71('0x43')]['includeAll']){_0x1a6574[_0x6d71('0x54')]=[{'all':!![]}];}return db[_0x6d71('0x3d')][_0x6d71('0x55')](_0x1a6574);})[_0x6d71('0x1e')](function(_0x65f7d2){_0x2fa9a9[_0x6d71('0x56')]=_0x65f7d2;return _0x2fa9a9;})[_0x6d71('0x1e')](respondWithFilteredResult(_0x551884,_0x1a6574))[_0x6d71('0x57')](handleError(_0x551884,null));};exports['show']=function(_0x3ade2f,_0x2104be){var _0x4ff5b7={'raw':![],'where':{'id':_0x3ade2f['params']['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db[_0x6d71('0x3b')],'as':_0x6d71('0x58')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x562615={};_0x562615['model']=_[_0x6d71('0x44')](db[_0x6d71('0x3d')][_0x6d71('0x59')]);_0x562615[_0x6d71('0x43')]=_[_0x6d71('0x44')](_0x3ade2f[_0x6d71('0x43')]);_0x562615[_0x6d71('0x45')]=_[_0x6d71('0x46')](_0x562615[_0x6d71('0x41')],_0x562615[_0x6d71('0x43')]);_0x4ff5b7['attributes']=_[_0x6d71('0x46')](_0x562615['model'],qs['fields'](_0x3ade2f[_0x6d71('0x43')][_0x6d71('0x48')]));_0x4ff5b7[_0x6d71('0x47')]=_0x4ff5b7[_0x6d71('0x47')]['length']?_0x4ff5b7['attributes']:_0x562615[_0x6d71('0x41')];if(_0x3ade2f[_0x6d71('0x43')][_0x6d71('0x5a')]){_0x4ff5b7[_0x6d71('0x54')]=[{'all':!![]}];}_0x4ff5b7=_[_0x6d71('0x50')]({},_0x4ff5b7,_0x3ade2f[_0x6d71('0x53')]);return db['MailAccount']['find'](_0x4ff5b7)['then'](handleEntityNotFound(_0x2104be,null))['then'](respondWithResult(_0x2104be,null))[_0x6d71('0x57')](handleError(_0x2104be,null));};exports['update']=function(_0x14248b,_0x4164a3){if(_0x14248b['body']['id']){delete _0x14248b['body']['id'];}return db[_0x6d71('0x3d')][_0x6d71('0x5b')]({'where':{'id':_0x14248b[_0x6d71('0x5c')]['id']},'include':[{'model':db[_0x6d71('0x5d')],'as':_0x6d71('0x5e')},{'model':db[_0x6d71('0x3b')],'as':_0x6d71('0x58')},{'model':db[_0x6d71('0x3c')],'as':_0x6d71('0x5f')}]})[_0x6d71('0x1e')](handleEntityNotFound(_0x4164a3,null))[_0x6d71('0x1e')](saveUpdates(_0x14248b[_0x6d71('0x60')],null))['then'](function(_0x38b3e5){if(_0x38b3e5&&_0x14248b['body'][_0x6d71('0x5e')]){return db[_0x6d71('0x5d')]['update'](_0x14248b['body'][_0x6d71('0x5e')],{'where':{'MailAccountId':_0x38b3e5['id']}})[_0x6d71('0x1e')](function(){return _0x38b3e5;});}return _0x38b3e5;})[_0x6d71('0x1e')](function(_0x38eabb){if(_0x38eabb&&_0x14248b[_0x6d71('0x60')][_0x6d71('0x58')]){return db['MailServerOut'][_0x6d71('0x34')](_0x14248b[_0x6d71('0x60')][_0x6d71('0x58')],{'where':{'MailAccountId':_0x38eabb['id']}})[_0x6d71('0x1e')](function(){return _0x38eabb;});}return _0x38eabb;})[_0x6d71('0x1e')](respondWithResult(_0x4164a3,null))[_0x6d71('0x57')](handleError(_0x4164a3,null));};exports['describe']=function(_0x2e6da2,_0x5eef2a){return db['MailAccount'][_0x6d71('0x61')]()[_0x6d71('0x1e')](respondWithResult(_0x5eef2a,null))[_0x6d71('0x57')](handleError(_0x5eef2a,null));};exports[_0x6d71('0x62')]=function(_0x4499f6,_0x473e06,_0x4641ff){if(_0x4499f6[_0x6d71('0x60')]['id']){delete _0x4499f6[_0x6d71('0x60')]['id'];}return db[_0x6d71('0x3d')][_0x6d71('0x5b')]({'where':{'id':_0x4499f6['params']['id']}})[_0x6d71('0x1e')](handleEntityNotFound(_0x473e06,null))['then'](function(_0x58b40a){if(_0x58b40a){_0x4499f6['body'][_0x6d71('0x63')]=_0x58b40a['id'];return db['Disposition']['create'](_0x4499f6[_0x6d71('0x60')]);}})['then'](respondWithResult(_0x473e06,null))[_0x6d71('0x57')](handleError(_0x473e06,null));};exports[_0x6d71('0x64')]=function(_0x4d4181,_0x79e6d5,_0x38c105){var _0x625fec={'raw':![],'where':{}};var _0x14f216={};var _0x555b7b={'count':0x0,'rows':[]};return db['MailAccount'][_0x6d71('0x65')]({'where':{'id':_0x4d4181[_0x6d71('0x5c')]['id']}})['then'](handleEntityNotFound(_0x79e6d5,null))['then'](function(_0x59a415){if(_0x59a415){_0x14f216[_0x6d71('0x41')]=_['keys'](db[_0x6d71('0x66')]['rawAttributes']);_0x14f216[_0x6d71('0x43')]=_[_0x6d71('0x44')](_0x4d4181[_0x6d71('0x43')]);_0x14f216[_0x6d71('0x45')]=_[_0x6d71('0x46')](_0x14f216[_0x6d71('0x41')],_0x14f216['query']);_0x625fec[_0x6d71('0x47')]=_[_0x6d71('0x46')](_0x14f216[_0x6d71('0x41')],qs[_0x6d71('0x48')](_0x4d4181['query'][_0x6d71('0x48')]));_0x625fec[_0x6d71('0x47')]=_0x625fec['attributes'][_0x6d71('0x49')]?_0x625fec[_0x6d71('0x47')]:_0x14f216['model'];if(!_0x4d4181['query'][_0x6d71('0x4a')](_0x6d71('0x67'))){_0x625fec['limit']=qs[_0x6d71('0x2c')](_0x4d4181[_0x6d71('0x43')][_0x6d71('0x2c')]);_0x625fec[_0x6d71('0x2b')]=qs[_0x6d71('0x2b')](_0x4d4181['query'][_0x6d71('0x2b')]);}_0x625fec['order']=qs['sort'](_0x4d4181[_0x6d71('0x43')][_0x6d71('0x4c')]);_0x625fec['where']=qs[_0x6d71('0x45')](_[_0x6d71('0x4e')](_0x4d4181[_0x6d71('0x43')],_0x14f216['filters']));_0x625fec[_0x6d71('0x4d')][_0x6d71('0x63')]=_0x59a415['id'];if(_0x4d4181[_0x6d71('0x43')][_0x6d71('0x4f')]){_0x625fec['where']=_['merge'](_0x625fec[_0x6d71('0x4d')],{'$or':_[_0x6d71('0x51')](_0x625fec[_0x6d71('0x47')],function(_0x2f006f){var _0x5013a4={};_0x5013a4[_0x2f006f]={'$like':'%'+_0x4d4181[_0x6d71('0x43')][_0x6d71('0x4f')]+'%'};return _0x5013a4;})});}_0x625fec=_[_0x6d71('0x50')]({},_0x625fec,_0x4d4181[_0x6d71('0x53')]);return db[_0x6d71('0x66')][_0x6d71('0x2e')]({'where':_0x625fec['where']})[_0x6d71('0x1e')](function(_0x3a773f){_0x555b7b[_0x6d71('0x2e')]=_0x3a773f;if(_0x4d4181[_0x6d71('0x43')][_0x6d71('0x5a')]){_0x625fec[_0x6d71('0x54')]=[{'all':!![]}];}return db[_0x6d71('0x66')][_0x6d71('0x55')](_0x625fec);})[_0x6d71('0x1e')](function(_0x4c5f06){_0x555b7b['rows']=_0x4c5f06;return _0x555b7b;});}})['then'](respondWithFilteredResult(_0x79e6d5,_0x625fec))[_0x6d71('0x57')](handleError(_0x79e6d5,null));};exports[_0x6d71('0x68')]=function(_0xae9ca8,_0x4c0b8e,_0x31a8a7){return db[_0x6d71('0x3d')]['find']({'where':{'id':_0xae9ca8['params']['id']}})[_0x6d71('0x1e')](handleEntityNotFound(_0x4c0b8e,null))[_0x6d71('0x1e')](function(_0x13bcd8){if(_0x13bcd8){return _0x13bcd8[_0x6d71('0x68')](_0xae9ca8[_0x6d71('0x43')]['ids']);}})[_0x6d71('0x1e')](respondWithStatusCode(_0x4c0b8e,null))[_0x6d71('0x57')](handleError(_0x4c0b8e,null));};exports[_0x6d71('0x69')]=function(_0x104e72,_0x54ad9f,_0x52e226){if(_0x104e72[_0x6d71('0x60')]['id']){delete _0x104e72[_0x6d71('0x60')]['id'];}return db['MailAccount'][_0x6d71('0x5b')]({'where':{'id':_0x104e72['params']['id']}})['then'](handleEntityNotFound(_0x54ad9f,null))['then'](function(_0x109b19){if(_0x109b19){_0x104e72[_0x6d71('0x60')][_0x6d71('0x63')]=_0x109b19['id'];return db[_0x6d71('0x6a')][_0x6d71('0x6b')](_0x104e72['body']);}})['then'](respondWithResult(_0x54ad9f,null))[_0x6d71('0x57')](handleError(_0x54ad9f,null));};exports[_0x6d71('0x6c')]=function(_0xc7926a,_0x38e8ad,_0x12266f){var _0x4ecd12={'raw':![],'where':{}};var _0x9add2b={};var _0x64089f={'count':0x0,'rows':[]};return db[_0x6d71('0x3d')][_0x6d71('0x65')]({'where':{'id':_0xc7926a[_0x6d71('0x5c')]['id']}})['then'](handleEntityNotFound(_0x38e8ad,null))[_0x6d71('0x1e')](function(_0x46e853){if(_0x46e853){_0x9add2b[_0x6d71('0x41')]=_[_0x6d71('0x44')](db[_0x6d71('0x6a')][_0x6d71('0x59')]);_0x9add2b[_0x6d71('0x43')]=_[_0x6d71('0x44')](_0xc7926a[_0x6d71('0x43')]);_0x9add2b[_0x6d71('0x45')]=_[_0x6d71('0x46')](_0x9add2b[_0x6d71('0x41')],_0x9add2b[_0x6d71('0x43')]);_0x4ecd12[_0x6d71('0x47')]=_[_0x6d71('0x46')](_0x9add2b[_0x6d71('0x41')],qs['fields'](_0xc7926a['query']['fields']));_0x4ecd12[_0x6d71('0x47')]=_0x4ecd12[_0x6d71('0x47')][_0x6d71('0x49')]?_0x4ecd12[_0x6d71('0x47')]:_0x9add2b[_0x6d71('0x41')];if(!_0xc7926a[_0x6d71('0x43')]['hasOwnProperty'](_0x6d71('0x67'))){_0x4ecd12[_0x6d71('0x2c')]=qs['limit'](_0xc7926a[_0x6d71('0x43')]['limit']);_0x4ecd12[_0x6d71('0x2b')]=qs['offset'](_0xc7926a[_0x6d71('0x43')][_0x6d71('0x2b')]);}_0x4ecd12[_0x6d71('0x4b')]=qs[_0x6d71('0x4c')](_0xc7926a[_0x6d71('0x43')][_0x6d71('0x4c')]);_0x4ecd12[_0x6d71('0x4d')]=qs[_0x6d71('0x45')](_[_0x6d71('0x4e')](_0xc7926a['query'],_0x9add2b['filters']));_0x4ecd12['where']['MailAccountId']=_0x46e853['id'];if(_0xc7926a[_0x6d71('0x43')][_0x6d71('0x4f')]){_0x4ecd12[_0x6d71('0x4d')]=_[_0x6d71('0x50')](_0x4ecd12[_0x6d71('0x4d')],{'$or':_[_0x6d71('0x51')](_0x4ecd12['attributes'],function(_0x444835){var _0x1c5012={};_0x1c5012[_0x444835]={'$like':'%'+_0xc7926a['query'][_0x6d71('0x4f')]+'%'};return _0x1c5012;})});}_0x4ecd12=_[_0x6d71('0x50')]({},_0x4ecd12,_0xc7926a['options']);return db[_0x6d71('0x6a')][_0x6d71('0x2e')]({'where':_0x4ecd12['where']})[_0x6d71('0x1e')](function(_0x1f2fc9){_0x64089f[_0x6d71('0x2e')]=_0x1f2fc9;if(_0xc7926a[_0x6d71('0x43')][_0x6d71('0x5a')]){_0x4ecd12[_0x6d71('0x54')]=[{'all':!![]}];}return db['CannedAnswer'][_0x6d71('0x55')](_0x4ecd12);})['then'](function(_0x1deade){_0x64089f['rows']=_0x1deade;return _0x64089f;});}})[_0x6d71('0x1e')](respondWithFilteredResult(_0x38e8ad,_0x4ecd12))[_0x6d71('0x57')](handleError(_0x38e8ad,null));};exports[_0x6d71('0x6d')]=function(_0x4bc33c,_0x4492dd,_0x49c561){return db[_0x6d71('0x3d')][_0x6d71('0x5b')]({'where':{'id':_0x4bc33c[_0x6d71('0x5c')]['id']}})[_0x6d71('0x1e')](handleEntityNotFound(_0x4492dd,null))[_0x6d71('0x1e')](function(_0x380e76){if(_0x380e76){return _0x380e76[_0x6d71('0x6d')](_0x4bc33c[_0x6d71('0x43')][_0x6d71('0x6e')]);}})[_0x6d71('0x1e')](respondWithStatusCode(_0x4492dd,null))['catch'](handleError(_0x4492dd,null));};exports[_0x6d71('0x6b')]=function(_0x34dc21,_0x271b60){var _0x2623bd={'name':_0x34dc21[_0x6d71('0x60')][_0x6d71('0x42')],'key':_0x34dc21['body']['key'],'email':_0x34dc21['body'][_0x6d71('0x6f')],'ListId':_0x34dc21['body']['ListId'],'active':!_[_0x6d71('0x70')](_0x34dc21['body'][_0x6d71('0x71')])?_0x34dc21[_0x6d71('0x60')][_0x6d71('0x71')]:!![],'description':_0x34dc21[_0x6d71('0x60')][_0x6d71('0x72')]||null,'Imap':{},'Smtp':{}};if(_['isNil'](_0x34dc21['body'][_0x6d71('0x73')])){if(_0x34dc21[_0x6d71('0x60')][_0x6d71('0x74')]){_0x2623bd['Imap'][_0x6d71('0x75')]=_0x2623bd['Smtp']['user']=_0x34dc21[_0x6d71('0x60')]['cuser'];_0x2623bd[_0x6d71('0x5e')][_0x6d71('0x76')]=_0x2623bd[_0x6d71('0x58')]['pass']=_0x34dc21[_0x6d71('0x60')][_0x6d71('0x77')];}else{_0x2623bd[_0x6d71('0x5e')]['authentication']=_0x2623bd[_0x6d71('0x58')]['authentication']=![];}_0x2623bd[_0x6d71('0x5e')][_0x6d71('0x78')]=_0x34dc21[_0x6d71('0x60')][_0x6d71('0x5e')][_0x6d71('0x78')];_0x2623bd[_0x6d71('0x5e')][_0x6d71('0x79')]=_0x34dc21[_0x6d71('0x60')]['Imap'][_0x6d71('0x79')];_0x2623bd[_0x6d71('0x58')][_0x6d71('0x78')]=_0x34dc21['body'][_0x6d71('0x58')][_0x6d71('0x78')];_0x2623bd['Smtp'][_0x6d71('0x79')]=_0x34dc21[_0x6d71('0x60')][_0x6d71('0x58')][_0x6d71('0x79')];}else{_0x2623bd[_0x6d71('0x5e')]['service']=_0x2623bd[_0x6d71('0x58')][_0x6d71('0x7a')]=_0x34dc21[_0x6d71('0x60')][_0x6d71('0x73')];_0x2623bd[_0x6d71('0x5e')]['user']=_0x2623bd[_0x6d71('0x58')]['user']=_0x34dc21[_0x6d71('0x60')][_0x6d71('0x7b')];_0x2623bd[_0x6d71('0x5e')][_0x6d71('0x76')]=_0x2623bd[_0x6d71('0x58')][_0x6d71('0x7c')]=_0x34dc21[_0x6d71('0x60')][_0x6d71('0x77')];}return db['MailAccount']['create'](_0x2623bd,{'include':[{'model':db[_0x6d71('0x3b')],'as':_0x6d71('0x58')},{'model':db[_0x6d71('0x5d')],'as':_0x6d71('0x5e')}]})[_0x6d71('0x1e')](function(_0x56d3e9){var _0x2cb2f4=_0x34dc21[_0x6d71('0x75')][_0x6d71('0x35')]({'plain':!![]});if(!_0x2cb2f4)throw new Error(_0x6d71('0x7d'));if(_0x2cb2f4['role']===_0x6d71('0x75')){var _0x7f9d24=_0x56d3e9[_0x6d71('0x35')]({'plain':!![]});return db[_0x6d71('0x7e')][_0x6d71('0x5b')]({'where':{'name':_0x6d71('0x36'),'userProfileId':_0x2cb2f4['userProfileId']},'raw':!![]})[_0x6d71('0x1e')](function(_0xc6ad06){if(_0xc6ad06&&_0xc6ad06[_0x6d71('0x7f')]===0x0){return db['UserProfileResource'][_0x6d71('0x6b')]({'name':_0x7f9d24[_0x6d71('0x42')],'resourceId':_0x7f9d24['id'],'type':_0xc6ad06[_0x6d71('0x42')],'sectionId':_0xc6ad06['id']},{})[_0x6d71('0x1e')](function(){return _0x56d3e9;});}else{return _0x56d3e9;}})[_0x6d71('0x57')](function(_0x4914e3){logger['error'](_0x6d71('0x80'),_0x4914e3);throw _0x4914e3;});}return _0x56d3e9;})[_0x6d71('0x1e')](respondWithResult(_0x271b60,0xc9))[_0x6d71('0x57')](handleError(_0x271b60,null));};exports[_0x6d71('0x81')]=function(_0x6a1d3b,_0x5dab99,_0x50e969){return db[_0x6d71('0x3d')][_0x6d71('0x65')]({'where':{'id':_0x6a1d3b[_0x6d71('0x5c')]['id']}})[_0x6d71('0x1e')](handleEntityNotFound(_0x5dab99,null))[_0x6d71('0x1e')](function(_0x1a86e9){if(_0x1a86e9){return _0x1a86e9['getImap']();}return null;})[_0x6d71('0x1e')](respondWithResult(_0x5dab99,null))['catch'](handleError(_0x5dab99,null));};exports[_0x6d71('0x82')]=function(_0x744a12,_0x25192a,_0x1c809c){if(_0x744a12[_0x6d71('0x60')]['id']){delete _0x744a12[_0x6d71('0x60')]['id'];}return db[_0x6d71('0x3d')][_0x6d71('0x5b')]({'where':{'id':_0x744a12[_0x6d71('0x5c')]['id']}})[_0x6d71('0x1e')](handleEntityNotFound(_0x25192a,null))[_0x6d71('0x1e')](function(_0x187679){if(_0x187679){_0x744a12[_0x6d71('0x60')][_0x6d71('0x63')]=_0x187679['id'];return db['MailServerIn'][_0x6d71('0x6b')](_0x744a12[_0x6d71('0x60')]);}})[_0x6d71('0x1e')](respondWithResult(_0x25192a,null))[_0x6d71('0x57')](handleError(_0x25192a,null));};exports[_0x6d71('0x83')]=function(_0x5b7524,_0x57c5b1,_0x297645){return db[_0x6d71('0x3d')][_0x6d71('0x65')]({'where':{'id':_0x5b7524['params']['id']}})[_0x6d71('0x1e')](handleEntityNotFound(_0x57c5b1,null))['then'](function(_0x31c487){if(_0x31c487){return _0x31c487[_0x6d71('0x84')](null);}return null;})['then'](respondWithStatusCode(_0x57c5b1,null))[_0x6d71('0x57')](handleError(_0x57c5b1,null));};exports[_0x6d71('0x85')]=function(_0x14c132,_0x118572,_0x19ff11){return db[_0x6d71('0x3d')]['findOne']({'where':{'id':_0x14c132[_0x6d71('0x5c')]['id']}})[_0x6d71('0x1e')](handleEntityNotFound(_0x118572,null))[_0x6d71('0x1e')](function(_0x17d5de){if(_0x17d5de){return _0x17d5de[_0x6d71('0x85')]();}return null;})[_0x6d71('0x1e')](respondWithResult(_0x118572,null))['catch'](handleError(_0x118572,null));};exports['addSmtp']=function(_0x58ad5f,_0x3d91e9,_0x510ade){if(_0x58ad5f[_0x6d71('0x60')]['id']){delete _0x58ad5f[_0x6d71('0x60')]['id'];}return db[_0x6d71('0x3d')][_0x6d71('0x5b')]({'where':{'id':_0x58ad5f[_0x6d71('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3d91e9,null))['then'](function(_0x34242c){if(_0x34242c){_0x58ad5f['body']['MailAccountId']=_0x34242c['id'];return db[_0x6d71('0x3b')][_0x6d71('0x6b')](_0x58ad5f[_0x6d71('0x60')]);}})[_0x6d71('0x1e')](respondWithResult(_0x3d91e9,null))[_0x6d71('0x57')](handleError(_0x3d91e9,null));};exports[_0x6d71('0x86')]=function(_0x5cb262,_0x130ade,_0x1fd062){return db[_0x6d71('0x3d')][_0x6d71('0x65')]({'where':{'id':_0x5cb262['params']['id']}})[_0x6d71('0x1e')](handleEntityNotFound(_0x130ade,null))[_0x6d71('0x1e')](function(_0x154cac){if(_0x154cac){return _0x154cac[_0x6d71('0x87')](null);}return null;})[_0x6d71('0x1e')](respondWithStatusCode(_0x130ade,null))[_0x6d71('0x57')](handleError(_0x130ade,null));};exports[_0x6d71('0x88')]=function(_0x542713,_0x5e5c93,_0x337292){return db[_0x6d71('0x89')][_0x6d71('0x5b')]({'where':{'id':_0x542713[_0x6d71('0x5c')]['id']}})[_0x6d71('0x1e')](handleEntityNotFound(_0x5e5c93,null))[_0x6d71('0x1e')](function(_0x4ef3de){if(_0x4ef3de){return _0x4ef3de['addInteraction'](_0x542713['body']['ids'],_[_0x6d71('0x8a')](_0x542713['body'],[_0x6d71('0x6e'),'id'])||{});}})['then'](respondWithResult(_0x5e5c93,null))[_0x6d71('0x57')](handleError(_0x5e5c93,null));};exports['getInteractions']=function(_0xc64b64,_0x518bdd,_0xb5584f){var _0x23deaa={'raw':![],'where':{}};var _0x4a6c94={};var _0x251acf={'count':0x0,'rows':[]};return db[_0x6d71('0x3d')]['findOne']({'where':{'id':_0xc64b64[_0x6d71('0x5c')]['id']}})[_0x6d71('0x1e')](handleEntityNotFound(_0x518bdd,null))[_0x6d71('0x1e')](function(_0x134d7c){if(_0x134d7c){_0x4a6c94[_0x6d71('0x41')]=_[_0x6d71('0x44')](db[_0x6d71('0x89')]['rawAttributes']);_0x4a6c94[_0x6d71('0x43')]=_['keys'](_0xc64b64['query']);_0x4a6c94[_0x6d71('0x45')]=_[_0x6d71('0x46')](_0x4a6c94[_0x6d71('0x41')],_0x4a6c94[_0x6d71('0x43')]);_0x23deaa[_0x6d71('0x47')]=_[_0x6d71('0x46')](_0x4a6c94[_0x6d71('0x41')],qs[_0x6d71('0x48')](_0xc64b64['query'][_0x6d71('0x48')]));_0x23deaa[_0x6d71('0x47')]=_0x23deaa['attributes'][_0x6d71('0x49')]?_0x23deaa[_0x6d71('0x47')]:_0x4a6c94['model'];if(!_0xc64b64['query'][_0x6d71('0x4a')](_0x6d71('0x67'))){_0x23deaa[_0x6d71('0x2c')]=qs['limit'](_0xc64b64['query'][_0x6d71('0x2c')]);_0x23deaa['offset']=qs[_0x6d71('0x2b')](_0xc64b64['query'][_0x6d71('0x2b')]);}_0x23deaa[_0x6d71('0x4b')]=qs[_0x6d71('0x4c')](_0xc64b64[_0x6d71('0x43')][_0x6d71('0x4c')]);_0x23deaa[_0x6d71('0x4d')]=qs[_0x6d71('0x45')](_[_0x6d71('0x4e')](_0xc64b64['query'],_0x4a6c94['filters']));_0x23deaa[_0x6d71('0x4d')][_0x6d71('0x63')]=_0x134d7c['id'];if(_0xc64b64[_0x6d71('0x43')]['filter']){_0x23deaa[_0x6d71('0x4d')]=_[_0x6d71('0x50')](_0x23deaa[_0x6d71('0x4d')],{'$or':_[_0x6d71('0x51')](_0x23deaa[_0x6d71('0x47')],function(_0x1e0a15){var _0x2fd559={};_0x2fd559[_0x1e0a15]={'$like':'%'+_0xc64b64[_0x6d71('0x43')]['filter']+'%'};return _0x2fd559;})});}_0x23deaa=_[_0x6d71('0x50')]({},_0x23deaa,_0xc64b64['options']);return db[_0x6d71('0x89')][_0x6d71('0x2e')]({'where':_0x23deaa['where']})[_0x6d71('0x1e')](function(_0x2479b3){_0x251acf[_0x6d71('0x2e')]=_0x2479b3;if(_0xc64b64['query'][_0x6d71('0x5a')]){_0x23deaa['include']=[{'model':db[_0x6d71('0x8b')],'as':'Contact','required':![]},{'model':db[_0x6d71('0x8c')],'as':_0x6d71('0x8d'),'attributes':[_0x6d71('0x42'),_0x6d71('0x8e'),_0x6d71('0x8f')],'required':![]},{'model':db[_0x6d71('0x90')],'as':_0x6d71('0x91'),'attributes':['id',_0x6d71('0x42'),'color'],'where':_0xc64b64[_0x6d71('0x43')][_0x6d71('0x92')]?{'id':_0xc64b64[_0x6d71('0x43')][_0x6d71('0x92')]}:undefined,'required':_0xc64b64['query'][_0x6d71('0x92')]?!![]:![]}];}return db['MailInteraction'][_0x6d71('0x55')](_0x23deaa);})[_0x6d71('0x1e')](function(_0x32feee){_0x251acf['rows']=_0x32feee;return _0x251acf;});}})['then'](respondWithFilteredResult(_0x518bdd,_0x23deaa))['catch'](handleError(_0x518bdd,null));};exports[_0x6d71('0x93')]=function(_0xc646ab,_0x10b6d6,_0x14f28b){return db[_0x6d71('0x3d')][_0x6d71('0x65')]({'where':{'id':_0xc646ab[_0x6d71('0x5c')]['id']}})[_0x6d71('0x1e')](handleEntityNotFound(_0x10b6d6,null))['then'](function(_0x4e3c74){if(_0x4e3c74){return db[_0x6d71('0x94')][_0x6d71('0x95')](function(_0x1f989f){return db[_0x6d71('0x96')][_0x6d71('0x38')]({'where':{'MailAccountId':_0xc646ab[_0x6d71('0x5c')]['id']},'transaction':_0x1f989f})['then'](function(_0x5016d7){var _0x5d5838=_[_0x6d71('0x51')](_0xc646ab[_0x6d71('0x60')],function(_0x110cad){_0x110cad[_0x6d71('0x63')]=_0xc646ab[_0x6d71('0x5c')]['id'];return _0x110cad;});return db[_0x6d71('0x96')][_0x6d71('0x97')](_0x5d5838,{'transaction':_0x1f989f});});})['then'](function(){return db['MailApplication']['findAndCountAll']({'where':{'MailAccountId':_0xc646ab[_0x6d71('0x5c')]['id']},'order':_0x6d71('0x98')});});}})[_0x6d71('0x1e')](respondWithResult(_0x10b6d6,null))[_0x6d71('0x57')](handleError(_0x10b6d6,null));};exports['getApplications']=function(_0x4339fc,_0x548dcf,_0x5798ca){var _0x5c2196={};var _0x10887d={};var _0x2cb1bf;var _0x432125;return db['MailAccount'][_0x6d71('0x65')]({'where':{'id':_0x4339fc[_0x6d71('0x5c')]['id']}})[_0x6d71('0x1e')](handleEntityNotFound(_0x548dcf,null))['then'](function(_0x4825ae){if(_0x4825ae){_0x2cb1bf=_0x4825ae;_0x10887d[_0x6d71('0x41')]=_[_0x6d71('0x44')](db[_0x6d71('0x96')]['rawAttributes']);_0x10887d[_0x6d71('0x43')]=_[_0x6d71('0x44')](_0x4339fc[_0x6d71('0x43')]);_0x10887d['filters']=_['intersection'](_0x10887d[_0x6d71('0x41')],_0x10887d[_0x6d71('0x43')]);_0x5c2196[_0x6d71('0x47')]=_[_0x6d71('0x46')](_0x10887d[_0x6d71('0x41')],qs[_0x6d71('0x48')](_0x4339fc[_0x6d71('0x43')][_0x6d71('0x48')]));_0x5c2196[_0x6d71('0x47')]=_0x5c2196['attributes']['length']?_0x5c2196[_0x6d71('0x47')]:_0x10887d[_0x6d71('0x41')];_0x5c2196[_0x6d71('0x4b')]=qs[_0x6d71('0x4c')](_0x4339fc[_0x6d71('0x43')][_0x6d71('0x4c')]);_0x5c2196[_0x6d71('0x4d')]=qs['filters'](_[_0x6d71('0x4e')](_0x4339fc['query'],_0x10887d[_0x6d71('0x45')]));if(_0x4339fc[_0x6d71('0x43')][_0x6d71('0x4f')]){_0x5c2196[_0x6d71('0x4d')]=_[_0x6d71('0x50')](_0x5c2196[_0x6d71('0x4d')],{'$or':_[_0x6d71('0x51')](_0x5c2196[_0x6d71('0x47')],function(_0x3ba9fe){var _0x801586={};_0x801586[_0x3ba9fe]={'$like':'%'+_0x4339fc[_0x6d71('0x43')][_0x6d71('0x4f')]+'%'};return _0x801586;})});}_0x5c2196=_[_0x6d71('0x50')]({},_0x5c2196,_0x4339fc[_0x6d71('0x53')]);return _0x2cb1bf['getApplications'](_0x5c2196);}})[_0x6d71('0x1e')](function(_0xa81b63){if(_0xa81b63){_0x432125=_0xa81b63[_0x6d71('0x49')];if(!_0x4339fc[_0x6d71('0x43')]['hasOwnProperty']('nolimit')){_0x5c2196[_0x6d71('0x2c')]=qs['limit'](_0x4339fc[_0x6d71('0x43')][_0x6d71('0x2c')]);_0x5c2196[_0x6d71('0x2b')]=qs[_0x6d71('0x2b')](_0x4339fc[_0x6d71('0x43')][_0x6d71('0x2b')]);}return _0x2cb1bf[_0x6d71('0x99')](_0x5c2196);}})[_0x6d71('0x1e')](function(_0x13f5ea){if(_0x13f5ea){return _0x13f5ea?{'count':_0x432125,'rows':_0x13f5ea}:null;}})[_0x6d71('0x1e')](respondWithResult(_0x548dcf,null))[_0x6d71('0x57')](handleError(_0x548dcf,null));};exports[_0x6d71('0x9a')]=function(_0x80edc4,_0x555bbb,_0x4fc083){var _0x1a785e={'raw':!![],'where':{}};var _0x205389={};var _0x3cd74b={'count':0x0,'rows':[]};return db[_0x6d71('0x3d')][_0x6d71('0x65')]({'where':{'id':_0x80edc4['params']['id']}})[_0x6d71('0x1e')](handleEntityNotFound(_0x555bbb,null))[_0x6d71('0x1e')](function(_0x3d83a9){if(_0x3d83a9){_0x205389[_0x6d71('0x41')]=_['keys'](db['MailMessage'][_0x6d71('0x59')]);_0x205389[_0x6d71('0x43')]=_[_0x6d71('0x44')](_0x80edc4['query']);_0x205389[_0x6d71('0x45')]=_[_0x6d71('0x46')](_0x205389[_0x6d71('0x41')],_0x205389[_0x6d71('0x43')]);_0x1a785e[_0x6d71('0x47')]=_[_0x6d71('0x46')](_0x205389[_0x6d71('0x41')],qs['fields'](_0x80edc4[_0x6d71('0x43')]['fields']));_0x1a785e[_0x6d71('0x47')]=_0x1a785e[_0x6d71('0x47')][_0x6d71('0x49')]?_0x1a785e[_0x6d71('0x47')]:_0x205389['model'];if(!_0x80edc4[_0x6d71('0x43')][_0x6d71('0x4a')](_0x6d71('0x67'))){_0x1a785e[_0x6d71('0x2c')]=qs[_0x6d71('0x2c')](_0x80edc4[_0x6d71('0x43')][_0x6d71('0x2c')]);_0x1a785e[_0x6d71('0x2b')]=qs['offset'](_0x80edc4[_0x6d71('0x43')][_0x6d71('0x2b')]);}_0x1a785e[_0x6d71('0x4b')]=qs[_0x6d71('0x4c')](_0x80edc4['query'][_0x6d71('0x4c')]);_0x1a785e[_0x6d71('0x4d')]=qs[_0x6d71('0x45')](_[_0x6d71('0x4e')](_0x80edc4[_0x6d71('0x43')],_0x205389[_0x6d71('0x45')]));_0x1a785e[_0x6d71('0x4d')]['MailAccountId']=_0x3d83a9['id'];if(_0x80edc4[_0x6d71('0x43')][_0x6d71('0x4f')]){_0x1a785e['where']=_['merge'](_0x1a785e['where'],{'$or':_[_0x6d71('0x51')](_0x1a785e['attributes'],function(_0x1e3946){var _0x414bc4={};_0x414bc4[_0x1e3946]={'$like':'%'+_0x80edc4[_0x6d71('0x43')][_0x6d71('0x4f')]+'%'};return _0x414bc4;})});}if(_0x80edc4['query']['$gte']){var _0x4ba3c8=_0x80edc4[_0x6d71('0x43')][_0x6d71('0x9b')][_0x6d71('0x9c')](',');var _0x462c0c={};_0x462c0c[_0x4ba3c8[0x0]]={'$gte':moment(_0x4ba3c8[0x1])[_0x6d71('0x9d')](_0x6d71('0x9e'))};_0x1a785e['where']=_['merge'](_0x1a785e[_0x6d71('0x4d')],_0x462c0c);}_0x1a785e=_[_0x6d71('0x50')]({},_0x1a785e,_0x80edc4[_0x6d71('0x53')]);return db['MailMessage']['count']({'where':_0x1a785e[_0x6d71('0x4d')]})[_0x6d71('0x1e')](function(_0x555318){_0x3cd74b[_0x6d71('0x2e')]=_0x555318;if(_0x80edc4[_0x6d71('0x43')]['includeAll']){_0x1a785e[_0x6d71('0x54')]=[{'all':!![]}];}return db[_0x6d71('0x9f')][_0x6d71('0x55')](_0x1a785e);})['then'](function(_0x2986a9){if(_0x80edc4[_0x6d71('0x43')][_0x6d71('0xa0')]==='true'){for(var _0x3e4b21=0x0;_0x3e4b21<_0x2986a9['length'];_0x3e4b21++){_0x2986a9[_0x3e4b21]['body']=juice(_0x2986a9[_0x3e4b21][_0x6d71('0x60')]);}}_0x3cd74b[_0x6d71('0x56')]=_0x2986a9;return _0x3cd74b;});}})[_0x6d71('0x1e')](respondWithFilteredResult(_0x555bbb,_0x1a785e))[_0x6d71('0x57')](handleError(_0x555bbb,null));};exports['send']=function(_0x374a44,_0x1f1934,_0x90eeb9){var _0xf914ff,_0xd288c8={},_0x2dd100;if(_0x374a44[_0x6d71('0x60')]['to']){_0x2dd100=_0x374a44['body']['to'][_0x6d71('0x9c')](',')[0x0];}return db[_0x6d71('0x3d')][_0x6d71('0x5b')]({'where':{'id':_0x374a44[_0x6d71('0x5c')]['id']},'include':[{'model':db[_0x6d71('0xa1')],'as':_0x6d71('0xa2'),'include':[{'model':db['CmContact'],'as':_0x6d71('0xa3'),'where':{'email':_0x2dd100},'limit':0x1,'order':[[_0x6d71('0xa4'),'DESC']]}]},{'model':db[_0x6d71('0x3b')],'as':_0x6d71('0x58'),'raw':!![]}]})[_0x6d71('0x1e')](handleEntityNotFound(_0x1f1934,null))['then'](function(_0x273dee){if(_0x273dee){_0xf914ff=_0x273dee;if(_0x273dee[_0x6d71('0x58')]){if(_[_0x6d71('0x70')](_0x374a44['body'][_0x6d71('0xa5')])){_0x374a44[_0x6d71('0x60')][_0x6d71('0xa5')]=util[_0x6d71('0x9d')]('%s\x20<%s>',_0x273dee[_0x6d71('0x42')],_0x273dee['email']||_0x273dee[_0x6d71('0x58')][_0x6d71('0x75')]);}if(_0x374a44['body'][_0x6d71('0xa6')]&&_0x374a44[_0x6d71('0x60')][_0x6d71('0xa6')]['length']){for(var _0x2afda5=0x0;_0x2afda5<_0x374a44['body'][_0x6d71('0xa6')][_0x6d71('0x49')];_0x2afda5+=0x1){_0x374a44[_0x6d71('0x60')][_0x6d71('0xa6')][_0x2afda5]={'filename':_0x374a44[_0x6d71('0x60')][_0x6d71('0xa6')][_0x2afda5]['name'],'path':path[_0x6d71('0xa7')](config[_0x6d71('0xa8')],_0x6d71('0xa9'),_0x374a44['body'][_0x6d71('0xa6')][_0x2afda5][_0x6d71('0xaa')])};}}var _0x34079d={'tls':{'rejectUnauthorized':![]}};if(_[_0x6d71('0x70')](_0x273dee[_0x6d71('0x58')][_0x6d71('0x7a')])){if(_0x273dee[_0x6d71('0x58')]['authentication']){_0x34079d[_0x6d71('0xab')]={'user':_0x273dee[_0x6d71('0x58')]['user'],'pass':_0x273dee[_0x6d71('0x58')]['pass']};}_0x34079d['host']=_0x273dee[_0x6d71('0x58')][_0x6d71('0x78')];_0x34079d[_0x6d71('0x79')]=_0x273dee[_0x6d71('0x58')]['port'];_0x34079d[_0x6d71('0xac')]=_0x273dee['Smtp'][_0x6d71('0xac')];}else{_0x34079d[_0x6d71('0x7a')]=_0x273dee[_0x6d71('0x58')]['service'];_0x34079d[_0x6d71('0xab')]={'user':_0x273dee['Smtp'][_0x6d71('0x75')],'pass':_0x273dee[_0x6d71('0x58')][_0x6d71('0x7c')]};}return respondWithRpcPromise(_0x6d71('0xad'),_0x6d71('0xae'),{'account':_0x34079d,'message':_0x374a44[_0x6d71('0x60')]});}else{throw new Error(_0x6d71('0xaf'));}}})[_0x6d71('0x1e')](function(_0x5ae119){if(_0x5ae119){_0xd288c8=_0x5ae119;if(_0xf914ff[_0x6d71('0xa2')]){if(_0xf914ff[_0x6d71('0xa2')]['Contacts'][_0x6d71('0x49')]){return _0xf914ff[_0x6d71('0xa2')][_0x6d71('0xa3')][0x0];}else{return db[_0x6d71('0x8b')][_0x6d71('0x6b')](_[_0x6d71('0x19')](_0x374a44[_0x6d71('0x60')],{'firstName':_0x374a44[_0x6d71('0x60')]['to'],'email':_0x374a44[_0x6d71('0x60')]['to'],'phone':_0x374a44['body']['to'],'ListId':_0xf914ff[_0x6d71('0xb0')]}));}}else{throw new Error(_0x6d71('0xaf'));}}})[_0x6d71('0x1e')](function(_0x50898e){if(_0x50898e){var _0xb0d8c2={'UserId':_0x374a44[_0x6d71('0x75')]['id'],'ContactId':_0x50898e['id'],'MailAccountId':_0xf914ff['id'],'inReplyTo':_0xd288c8[_0x6d71('0xb1')],'to':_0x374a44[_0x6d71('0x60')]['from'],'cc':_0x374a44[_0x6d71('0x60')]['cc'],'subject':_0x374a44[_0x6d71('0x60')]['subject'],'attach':_0x374a44[_0x6d71('0x60')][_0x6d71('0xb2')],'firstMsgDirection':'out','lastMsgAt':moment()[_0x6d71('0x9d')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'out','Messages':[_[_0x6d71('0x50')](_0x374a44[_0x6d71('0x60')],{'messageId':_0xd288c8[_0x6d71('0xb1')],'sentAt':moment()[_0x6d71('0x9d')](_0x6d71('0x9e')),'read':!![],'MailAccountId':_0xf914ff['id'],'UserId':_0x374a44[_0x6d71('0x75')]['id'],'ContactId':_0x50898e['id']})]};if(_0x374a44[_0x6d71('0x60')][_0x6d71('0xb3')]){_0xb0d8c2=_[_0x6d71('0x50')](_0xb0d8c2,_0x374a44['body'][_0x6d71('0xb3')]);}return db[_0x6d71('0x89')]['create'](_0xb0d8c2,{'include':[{'model':db[_0x6d71('0x9f')],'as':_0x6d71('0xb4')}]});}})[_0x6d71('0x1e')](respondWithResult(_0x1f1934,null))['catch'](handleError(_0x1f1934,null));};exports[_0x6d71('0xb5')]=function(_0x563915,_0x2e79d7,_0x47f0b9){return db[_0x6d71('0x3d')]['find']({'where':{'id':_0x563915[_0x6d71('0x5c')]['id']},'include':[{'model':db[_0x6d71('0x3b')],'as':_0x6d71('0x58'),'raw':!![]}]})[_0x6d71('0x1e')](handleEntityNotFound(_0x2e79d7,null))[_0x6d71('0x1e')](function(_0x641554){if(_0x641554&&_0x641554[_0x6d71('0x58')]){var _0x1adc88={'id':_0x641554['id'],'tls':{'rejectUnauthorized':![]}};if(_0x641554['Smtp'][_0x6d71('0x7a')]){_0x1adc88[_0x6d71('0x7a')]=_0x641554[_0x6d71('0x58')][_0x6d71('0x7a')];}else{_0x1adc88[_0x6d71('0x78')]=_0x641554[_0x6d71('0x58')][_0x6d71('0x78')];_0x1adc88[_0x6d71('0x79')]=_0x641554['Smtp'][_0x6d71('0x79')];_0x1adc88['secure']=_0x641554[_0x6d71('0x58')]['secure'];}if(_0x641554['Smtp'][_0x6d71('0xb6')]){_0x1adc88['auth']={'user':_0x641554[_0x6d71('0x58')][_0x6d71('0x75')],'pass':_0x641554[_0x6d71('0x58')][_0x6d71('0x7c')]};}return respondWithRpcPromise(_0x6d71('0xb7'),'verifySmtp',{'account':_0x1adc88});}})['then'](respondWithResult(_0x2e79d7,null))[_0x6d71('0x57')](handleError(_0x2e79d7,null));};exports['destroy']=function(_0x2be355,_0x217be2){return db[_0x6d71('0x3d')]['find']({'where':{'id':_0x2be355[_0x6d71('0x5c')]['id']}})[_0x6d71('0x1e')](handleEntityNotFound(_0x217be2,null))[_0x6d71('0x1e')](function(_0x4b9d38){if(_0x4b9d38&&_0x4b9d38[_0x6d71('0x7a')]){throw new db[(_0x6d71('0xb8'))][(_0x6d71('0xb9'))](_0x6d71('0xba'));}return _0x4b9d38;})[_0x6d71('0x1e')](removeEntity(_0x217be2,null))[_0x6d71('0x57')](handleError(_0x217be2,null));};exports[_0x6d71('0xbb')]=function(_0x5dd2af,_0x16f8ba,_0xcd253c){return db[_0x6d71('0x3d')][_0x6d71('0x5b')]({'where':{'id':_0x5dd2af['params']['id']}})[_0x6d71('0x1e')](handleEntityNotFound(_0x16f8ba,null))[_0x6d71('0x1e')](function(_0x2eb015){if(_0x2eb015){return _0x2eb015[_0x6d71('0xbb')](_0x5dd2af[_0x6d71('0x60')][_0x6d71('0x6e')],_['omit'](_0x5dd2af[_0x6d71('0x60')],['ids','id'])||{})[_0x6d71('0xbc')](function(_0x3a8fdf){for(var _0x51ccb5=0x0;_0x51ccb5<_0x5dd2af['body']['ids'][_0x6d71('0x49')];_0x51ccb5+=0x1){socket[_0x6d71('0xbd')]('userMailAccount:save',{'UserId':Number(_0x5dd2af[_0x6d71('0x60')][_0x6d71('0x6e')][_0x51ccb5]),'MailAccountId':Number(_0x5dd2af[_0x6d71('0x5c')]['id'])});}return _0x3a8fdf;});}})[_0x6d71('0x1e')](respondWithResult(_0x16f8ba,null))['catch'](handleError(_0x16f8ba,null));};exports[_0x6d71('0xbe')]=function(_0x667c6,_0x71f2ec,_0x501891){return db['MailAccount'][_0x6d71('0x5b')]({'where':{'id':_0x667c6['params']['id']}})[_0x6d71('0x1e')](handleEntityNotFound(_0x71f2ec,null))[_0x6d71('0x1e')](function(_0x4ff4e2){if(_0x4ff4e2){return _0x4ff4e2[_0x6d71('0xbe')](_0x667c6['query'][_0x6d71('0x6e')])[_0x6d71('0x1e')](function(){if(_[_0x6d71('0xbf')](_0x667c6[_0x6d71('0x43')][_0x6d71('0x6e')])){for(var _0x3097c3=0x0;_0x3097c3<_0x667c6[_0x6d71('0x43')][_0x6d71('0x6e')][_0x6d71('0x49')];_0x3097c3+=0x1){socket[_0x6d71('0xbd')]('userMailAccount:remove',{'UserId':Number(_0x667c6['query'][_0x6d71('0x6e')][_0x3097c3]),'MailAccountId':Number(_0x667c6['params']['id'])});}}else{socket[_0x6d71('0xbd')](_0x6d71('0xc0'),{'UserId':Number(_0x667c6[_0x6d71('0x43')][_0x6d71('0x6e')]),'MailAccountId':Number(_0x667c6[_0x6d71('0x5c')]['id'])});}});}})[_0x6d71('0x1e')](respondWithStatusCode(_0x71f2ec,null))[_0x6d71('0x57')](handleError(_0x71f2ec,null));};exports[_0x6d71('0xc1')]=function(_0x3f38a8,_0x5256df,_0x47797e){var _0x5155d4={};var _0x3f0a70={};var _0xf530ce;var _0x50f74f;return db[_0x6d71('0x3d')][_0x6d71('0x65')]({'where':{'id':_0x3f38a8[_0x6d71('0x5c')]['id']}})[_0x6d71('0x1e')](handleEntityNotFound(_0x5256df,null))[_0x6d71('0x1e')](function(_0x1ccc30){if(_0x1ccc30){_0xf530ce=_0x1ccc30;_0x3f0a70[_0x6d71('0x41')]=_[_0x6d71('0x44')](db[_0x6d71('0x8c')][_0x6d71('0x59')]);_0x3f0a70[_0x6d71('0x43')]=_[_0x6d71('0x44')](_0x3f38a8[_0x6d71('0x43')]);_0x3f0a70[_0x6d71('0x45')]=_[_0x6d71('0x46')](_0x3f0a70['model'],_0x3f0a70['query']);_0x5155d4['attributes']=_[_0x6d71('0x46')](_0x3f0a70['model'],qs[_0x6d71('0x48')](_0x3f38a8[_0x6d71('0x43')][_0x6d71('0x48')]));_0x5155d4[_0x6d71('0x47')]=_0x5155d4[_0x6d71('0x47')][_0x6d71('0x49')]?_0x5155d4[_0x6d71('0x47')]:_0x3f0a70[_0x6d71('0x41')];_0x5155d4[_0x6d71('0x4b')]=qs[_0x6d71('0x4c')](_0x3f38a8['query'][_0x6d71('0x4c')]);_0x5155d4[_0x6d71('0x4d')]=qs['filters'](_[_0x6d71('0x4e')](_0x3f38a8['query'],_0x3f0a70['filters']));if(_0x3f38a8['query'][_0x6d71('0x4f')]){_0x5155d4['where']=_['merge'](_0x5155d4[_0x6d71('0x4d')],{'$or':_[_0x6d71('0x51')](_0x5155d4[_0x6d71('0x47')],function(_0x24dd22){var _0x5c125f={};_0x5c125f[_0x24dd22]={'$like':'%'+_0x3f38a8[_0x6d71('0x43')][_0x6d71('0x4f')]+'%'};return _0x5c125f;})});}_0x5155d4=_[_0x6d71('0x50')]({},_0x5155d4,_0x3f38a8[_0x6d71('0x53')]);return _0xf530ce[_0x6d71('0xc1')](_0x5155d4);}})[_0x6d71('0x1e')](function(_0x16a9e4){if(_0x16a9e4){_0x50f74f=_0x16a9e4[_0x6d71('0x49')];if(!_0x3f38a8[_0x6d71('0x43')]['hasOwnProperty'](_0x6d71('0x67'))){_0x5155d4['limit']=qs[_0x6d71('0x2c')](_0x3f38a8[_0x6d71('0x43')]['limit']);_0x5155d4[_0x6d71('0x2b')]=qs['offset'](_0x3f38a8[_0x6d71('0x43')][_0x6d71('0x2b')]);}return _0xf530ce[_0x6d71('0xc1')](_0x5155d4);}})[_0x6d71('0x1e')](function(_0x1fbf67){if(_0x1fbf67){return _0x1fbf67?{'count':_0x50f74f,'rows':_0x1fbf67}:null;}})['then'](respondWithResult(_0x5256df,null))[_0x6d71('0x57')](handleError(_0x5256df,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index eb4b7a0..7988d00 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 _0x6d5e=['MailAccount','setMaxListeners','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x33b2e9,_0x3b20ef){var _0x18cb55=function(_0xe24ba7){while(--_0xe24ba7){_0x33b2e9['push'](_0x33b2e9['shift']());}};_0x18cb55(++_0x3b20ef);}(_0x6d5e,0x103));var _0xe6d5=function(_0x19d36a,_0x41aa74){_0x19d36a=_0x19d36a-0x0;var _0x3ac96e=_0x6d5e[_0x19d36a];return _0x3ac96e;};'use strict';var EventEmitter=require(_0xe6d5('0x0'));var MailAccount=require(_0xe6d5('0x1'))['db'][_0xe6d5('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xe6d5('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe6d5('0x4'),'afterDestroy':_0xe6d5('0x5')};function emitEvent(_0x37033a){return function(_0x55595e,_0x3db670,_0x2d3422){MailAccountEvents[_0xe6d5('0x6')](_0x37033a+':'+_0x55595e['id'],_0x55595e);MailAccountEvents['emit'](_0x37033a,_0x55595e);_0x2d3422(null);};}for(var e in events){if(events[_0xe6d5('0x7')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0xe6d5('0x8')]=MailAccountEvents; \ No newline at end of file +var _0x9048=['emit','hasOwnProperty','hook','exports','events','MailAccount','remove'];(function(_0x557fd2,_0x2c0a7a){var _0x1b54a2=function(_0x2e439b){while(--_0x2e439b){_0x557fd2['push'](_0x557fd2['shift']());}};_0x1b54a2(++_0x2c0a7a);}(_0x9048,0xf2));var _0x8904=function(_0x2c58e5,_0x39eac2){_0x2c58e5=_0x2c58e5-0x0;var _0x52a613=_0x9048[_0x2c58e5];return _0x52a613;};'use strict';var EventEmitter=require(_0x8904('0x0'));var MailAccount=require('../../mysqldb')['db'][_0x8904('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x8904('0x2')};function emitEvent(_0x3d1deb){return function(_0x5a26af,_0xe46820,_0x1de7df){MailAccountEvents[_0x8904('0x3')](_0x3d1deb+':'+_0x5a26af['id'],_0x5a26af);MailAccountEvents[_0x8904('0x3')](_0x3d1deb,_0x5a26af);_0x1de7df(null);};}for(var e in events){if(events[_0x8904('0x4')](e)){var event=events[e];MailAccount[_0x8904('0x5')](e,emitEvent(event));}}module[_0x8904('0x6')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index b7fa050..adf9285 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 _0xb27e=['path','rimraf','../../config/environment','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','util','api','moment'];(function(_0x41203c,_0x14a6de){var _0x579b41=function(_0x379f36){while(--_0x379f36){_0x41203c['push'](_0x41203c['shift']());}};_0x579b41(++_0x14a6de);}(_0xb27e,0xe4));var _0xeb27=function(_0x730e87,_0x16aca0){_0x730e87=_0x730e87-0x0;var _0x31aae2=_0xb27e[_0x730e87];return _0x31aae2;};'use strict';var _=require('lodash');var util=require(_0xeb27('0x0'));var logger=require('../../config/logger')(_0xeb27('0x1'));var moment=require(_0xeb27('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeb27('0x3'));var rimraf=require(_0xeb27('0x4'));var config=require(_0xeb27('0x5'));var attributes=require(_0xeb27('0x6'));module[_0xeb27('0x7')]=function(_0x346cf9,_0x408612){return _0x346cf9[_0xeb27('0x8')](_0xeb27('0x9'),attributes,{'tableName':_0xeb27('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2901=['define','MailAccount','mail_accounts','../../config/logger','moment','path','../../config/environment'];(function(_0x2893fd,_0x1a5b7e){var _0x1041d0=function(_0x39fc8f){while(--_0x39fc8f){_0x2893fd['push'](_0x2893fd['shift']());}};_0x1041d0(++_0x1a5b7e);}(_0x2901,0x17d));var _0x1290=function(_0xc54316,_0x892df1){_0xc54316=_0xc54316-0x0;var _0x4b6b5c=_0x2901[_0xc54316];return _0x4b6b5c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1290('0x0'))('api');var moment=require(_0x1290('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1290('0x2'));var rimraf=require('rimraf');var config=require(_0x1290('0x3'));var attributes=require('./mailAccount.attributes');module['exports']=function(_0x1ebbf5,_0x375f70){return _0x1ebbf5[_0x1290('0x4')](_0x1290('0x5'),attributes,{'tableName':_0x1290('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 462d782..cc0ab65 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 _0x8bb2=['update','interaction','created','attachments','originTo','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachments','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','redis','localhost','register','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetMailAccount','MailAccount','findAll','options','where','attributes','limit','include','map','model','debug','ShowMailAccount','find','NotifyMailAccount','mail','keys','rawAttributes','createdAt','updatedAt','CompanyId','ListId','body','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Contacts','DESC','MailServerOut','get','account','applications','Applications','list','asc','autoclose','push','length','close','*,*,*,*','create','List\x20not\x20found','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Contact\x20not\x20found'];(function(_0x22d4fd,_0x1ef268){var _0x443d9f=function(_0x1c0874){while(--_0x1c0874){_0x22d4fd['push'](_0x22d4fd['shift']());}};_0x443d9f(++_0x1ef268);}(_0x8bb2,0x1a3));var _0x28bb=function(_0x3cbe1c,_0x4bcabd){_0x3cbe1c=_0x3cbe1c-0x0;var _0x5ee08b=_0x8bb2[_0x3cbe1c];return _0x5ee08b;};'use strict';var _=require(_0x28bb('0x0'));var util=require(_0x28bb('0x1'));var moment=require(_0x28bb('0x2'));var BPromise=require(_0x28bb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x28bb('0x4'));var db=require(_0x28bb('0x5'))['db'];var utils=require(_0x28bb('0x6'));var logger=require(_0x28bb('0x7'))(_0x28bb('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x28bb('0x9')]({'port':0x232c});config[_0x28bb('0xa')]=_['defaults'](config[_0x28bb('0xa')],{'host':_0x28bb('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x28bb('0xa')]));require('./mailAccount.socket')[_0x28bb('0xc')](socket);function respondWithRpcPromise(_0x1fd8c5,_0xb4ba85,_0x2798a5){return new BPromise(function(_0x2273af,_0x51b931){return client[_0x28bb('0xd')](_0x1fd8c5,_0x2798a5)[_0x28bb('0xe')](function(_0x33d031){logger['info'](_0x28bb('0xf'),_0xb4ba85,_0x28bb('0x10'));logger['debug'](_0x28bb('0x11'),_0xb4ba85,_0x28bb('0x10'),JSON[_0x28bb('0x12')](_0x33d031));if(_0x33d031['error']){if(_0x33d031[_0x28bb('0x13')]['code']===0x1f4){logger[_0x28bb('0x13')]('MailAccount,\x20%s,\x20%s',_0xb4ba85,_0x33d031[_0x28bb('0x13')][_0x28bb('0x14')]);return _0x51b931(_0x33d031[_0x28bb('0x13')][_0x28bb('0x14')]);}logger[_0x28bb('0x13')](_0x28bb('0xf'),_0xb4ba85,_0x33d031[_0x28bb('0x13')]['message']);return _0x2273af(_0x33d031[_0x28bb('0x13')][_0x28bb('0x14')]);}else{logger[_0x28bb('0x15')]('MailAccount,\x20%s,\x20%s',_0xb4ba85,'request\x20sent');_0x2273af(_0x33d031[_0x28bb('0x16')][_0x28bb('0x14')]);}})[_0x28bb('0x17')](function(_0x57d0a2){logger[_0x28bb('0x13')]('MailAccount,\x20%s,\x20%s',_0xb4ba85,_0x57d0a2);_0x51b931(_0x57d0a2);});});}exports[_0x28bb('0x18')]=function(_0x15bfda){var _0x55511d=this;return new Promise(function(_0x14d2c5,_0x4173cd){return db[_0x28bb('0x19')][_0x28bb('0x1a')]({'raw':_0x15bfda[_0x28bb('0x1b')]?_0x15bfda[_0x28bb('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x15bfda[_0x28bb('0x1b')]?_0x15bfda[_0x28bb('0x1b')][_0x28bb('0x1c')]||null:null,'attributes':_0x15bfda[_0x28bb('0x1b')]?_0x15bfda['options'][_0x28bb('0x1d')]||null:null,'limit':_0x15bfda['options']?_0x15bfda['options'][_0x28bb('0x1e')]||null:null,'include':_0x15bfda[_0x28bb('0x1b')]?_0x15bfda[_0x28bb('0x1b')][_0x28bb('0x1f')]?_[_0x28bb('0x20')](_0x15bfda[_0x28bb('0x1b')][_0x28bb('0x1f')],function(_0x21f492){return{'model':db[_0x21f492[_0x28bb('0x21')]],'as':_0x21f492['as'],'attributes':_0x21f492[_0x28bb('0x1d')],'include':_0x21f492['include']?_['map'](_0x21f492[_0x28bb('0x1f')],function(_0x3fd996){return{'model':db[_0x3fd996[_0x28bb('0x21')]],'as':_0x3fd996['as'],'attributes':_0x3fd996['attributes'],'include':_0x3fd996[_0x28bb('0x1f')]?_['map'](_0x3fd996[_0x28bb('0x1f')],function(_0x258075){return{'model':db[_0x258075[_0x28bb('0x21')]],'as':_0x258075['as'],'attributes':_0x258075[_0x28bb('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x28bb('0xe')](function(_0xb9ef07){logger[_0x28bb('0x15')]('GetMailAccount',_0x15bfda);logger[_0x28bb('0x22')](_0x28bb('0x18'),_0x15bfda,JSON[_0x28bb('0x12')](_0xb9ef07));_0x14d2c5(_0xb9ef07);})[_0x28bb('0x17')](function(_0x1d555d){logger[_0x28bb('0x13')]('GetMailAccount',_0x1d555d[_0x28bb('0x14')],_0x15bfda);_0x4173cd(_0x55511d[_0x28bb('0x13')](0x1f4,_0x1d555d[_0x28bb('0x14')]));});});};exports[_0x28bb('0x23')]=function(_0x1a4afa){var _0x5dab41=this;return new Promise(function(_0x20eccf,_0x9315bd){return db[_0x28bb('0x19')][_0x28bb('0x24')]({'raw':_0x1a4afa[_0x28bb('0x1b')]?_0x1a4afa['options']['raw']===undefined?!![]:![]:!![],'where':_0x1a4afa[_0x28bb('0x1b')]?_0x1a4afa[_0x28bb('0x1b')][_0x28bb('0x1c')]||null:null,'attributes':_0x1a4afa[_0x28bb('0x1b')]?_0x1a4afa['options'][_0x28bb('0x1d')]||null:null,'include':_0x1a4afa[_0x28bb('0x1b')]?_0x1a4afa[_0x28bb('0x1b')][_0x28bb('0x1f')]?_[_0x28bb('0x20')](_0x1a4afa[_0x28bb('0x1b')]['include'],function(_0x1bc119){return{'model':db[_0x1bc119['model']],'as':_0x1bc119['as'],'attributes':_0x1bc119[_0x28bb('0x1d')],'include':_0x1bc119[_0x28bb('0x1f')]?_[_0x28bb('0x20')](_0x1bc119[_0x28bb('0x1f')],function(_0x4c3ec5){return{'model':db[_0x4c3ec5[_0x28bb('0x21')]],'as':_0x4c3ec5['as'],'attributes':_0x4c3ec5['attributes'],'include':_0x4c3ec5['include']?_[_0x28bb('0x20')](_0x4c3ec5[_0x28bb('0x1f')],function(_0x50c5c1){return{'model':db[_0x50c5c1['model']],'as':_0x50c5c1['as'],'attributes':_0x50c5c1[_0x28bb('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x28bb('0xe')](function(_0x3254ad){logger[_0x28bb('0x15')](_0x28bb('0x23'),_0x1a4afa);logger['debug'](_0x28bb('0x23'),_0x1a4afa,JSON[_0x28bb('0x12')](_0x3254ad));_0x20eccf(_0x3254ad);})[_0x28bb('0x17')](function(_0x1ccd80){logger[_0x28bb('0x13')](_0x28bb('0x23'),_0x1ccd80[_0x28bb('0x14')],_0x1a4afa);_0x9315bd(_0x5dab41[_0x28bb('0x13')](0x1f4,_0x1ccd80[_0x28bb('0x14')]));});});};exports[_0x28bb('0x25')]=function(_0x49b198){var _0x5c6599=this;return new Promise(function(_0x251498,_0x128899){var _0x508845={'body':_0x49b198['body'],'channel':_0x28bb('0x26')};var _0x537da1=_['difference'](_[_0x28bb('0x27')](db['CmContact'][_0x28bb('0x28')]),[_0x28bb('0x29'),_0x28bb('0x2a'),_0x28bb('0x2b'),_0x28bb('0x2c')]);var _0x2cf38a=![];if(_0x49b198[_0x28bb('0x2d')]['id']){delete _0x49b198[_0x28bb('0x2d')]['id'];}if(_['isNil'](_0x49b198[_0x28bb('0x2d')][_0x28bb('0x2e')])){return _0x128899(_0x5c6599[_0x28bb('0x13')](0x1f4,_0x28bb('0x2f')));}if(_[_0x28bb('0x30')](_0x49b198[_0x28bb('0x2d')][_0x28bb('0x2d')])||_0x49b198[_0x28bb('0x2d')][_0x28bb('0x2d')]===''){return _0x128899(_0x5c6599[_0x28bb('0x13')](0x1f4,_0x28bb('0x31')));}if(_[_0x28bb('0x30')](_0x49b198[_0x28bb('0x2d')][_0x28bb('0x32')])){return _0x128899(_0x5c6599[_0x28bb('0x13')](0x1f4,_0x28bb('0x33')+_0x537da1));}if(!_['includes'](_0x537da1,_0x49b198[_0x28bb('0x2d')][_0x28bb('0x32')])){return _0x128899(_0x5c6599[_0x28bb('0x13')](0x1f4,_0x28bb('0x34')+_0x537da1));}var _0x46af6b={};_0x46af6b[_0x49b198[_0x28bb('0x2d')][_0x28bb('0x32')]]=_0x49b198[_0x28bb('0x2d')]['from'];return db['MailAccount'][_0x28bb('0x24')]({'where':{'id':_0x49b198['account']['id']},'include':[{'model':db[_0x28bb('0x35')],'as':_0x28bb('0x36'),'include':[{'model':db[_0x28bb('0x37')],'as':_0x28bb('0x38'),'where':_0x46af6b,'limit':0x1,'order':[[_0x28bb('0x2a'),_0x28bb('0x39')]]}]},{'model':db['MailApplication'],'as':'Applications'},{'model':db[_0x28bb('0x3a')],'as':'Smtp'}]})[_0x28bb('0xe')](function(_0x56d1c3){if(_0x56d1c3&&_0x56d1c3[_0x28bb('0x36')]){var _0x388617=_0x56d1c3[_0x28bb('0x3b')]({'plain':!![]});_0x508845[_0x28bb('0x3c')]=_['omit'](_0x388617,['Applications',_0x28bb('0x36')]);_0x508845[_0x28bb('0x3d')]=_0x388617[_0x28bb('0x3e')];_0x508845[_0x28bb('0x3f')]=_0x388617['List'];_0x508845[_0x28bb('0x3d')]=_['orderBy'](_0x508845[_0x28bb('0x3d')],['priority'],[_0x28bb('0x40')]);if(_0x508845[_0x28bb('0x3c')]&&_0x508845['account'][_0x28bb('0x41')]){_0x508845[_0x28bb('0x3d')][_0x28bb('0x42')]({'id':0x0,'priority':_0x508845[_0x28bb('0x3d')][_0x28bb('0x43')]+0x1,'app':_0x28bb('0x44'),'appdata':_0x28bb('0x41'),'interval':_0x28bb('0x45')});}if(_0x508845[_0x28bb('0x3c')]['Applications']){delete _0x508845[_0x28bb('0x3c')][_0x28bb('0x3e')];}if(_0x508845[_0x28bb('0x3c')]['List']){delete _0x508845[_0x28bb('0x3c')][_0x28bb('0x36')];}if(_0x388617[_0x28bb('0x36')][_0x28bb('0x38')][_0x28bb('0x43')]){return _0x388617['List'][_0x28bb('0x38')][0x0];}var _0x2b31a6=_['defaults'](_0x49b198[_0x28bb('0x2d')],{'firstName':_0x49b198[_0x28bb('0x2d')][_0x28bb('0x2e')],'ListId':_0x388617[_0x28bb('0x2c')]});_0x2b31a6[_0x49b198['body'][_0x28bb('0x32')]]=_0x49b198[_0x28bb('0x2d')]['from'];return db['CmContact'][_0x28bb('0x46')](_0x2b31a6);}else{throw new Error(_0x28bb('0x47'));}})[_0x28bb('0xe')](function(_0x585c6e){_0x508845['contact']=_0x585c6e;if(_0x585c6e){if(!_0x49b198['body']['message']['messageId']){_0x49b198[_0x28bb('0x2d')]['message'][_0x28bb('0x48')]=rs[_0x28bb('0x49')]()+'\x20'+_0x49b198['body'][_0x28bb('0x14')][_0x28bb('0x2e')];}var _0x5207bb={'ContactId':_0x585c6e['id'],'MailAccountId':_0x49b198['account']['id'],'inReplyTo':_0x49b198[_0x28bb('0x2d')][_0x28bb('0x14')]['messageId'],'to':_0x49b198['body']['message'][_0x28bb('0x2e')],'cc':_0x49b198[_0x28bb('0x2d')][_0x28bb('0x14')]['cc'],'subject':_0x49b198['body'][_0x28bb('0x14')][_0x28bb('0x4a')],'attach':_0x49b198['body'][_0x28bb('0x14')][_0x28bb('0x4b')],'lastMsgAt':moment()[_0x28bb('0x4c')](_0x28bb('0x4d')),'lastMsgDirection':'in'};return db[_0x28bb('0x4e')][_0x28bb('0x24')]({'where':{'closed':![],'MailAccountId':_0x49b198[_0x28bb('0x3c')]['id']},'include':[{'model':db[_0x28bb('0x4f')],'as':'Messages','attributes':['messageId'],'where':{'messageId':_0x49b198[_0x28bb('0x2d')][_0x28bb('0x14')]['inReplyTo']}}]})[_0x28bb('0xe')](function(_0x3ea360){if(_0x3ea360){return[_0x3ea360,![]];}return db[_0x28bb('0x4e')][_0x28bb('0x46')](_0x5207bb)[_0x28bb('0xe')](function(_0x2e0ef8){return[_0x2e0ef8,!![]];});});}else{throw new Error(_0x28bb('0x50'));}})['spread'](function(_0x406cf0,_0x44be73){if(_0x406cf0){_0x2cf38a=_0x44be73;if(!_0x44be73){return _0x406cf0[_0x28bb('0x51')]({'inReplyTo':_0x49b198['body']['message'][_0x28bb('0x48')],'to':_0x49b198[_0x28bb('0x2d')][_0x28bb('0x14')]['from'],'cc':_0x49b198[_0x28bb('0x2d')][_0x28bb('0x14')]['cc'],'subject':_0x49b198[_0x28bb('0x2d')][_0x28bb('0x14')][_0x28bb('0x4a')],'attach':_0x406cf0[_0x28bb('0x4b')]?_0x406cf0['attach']:_0x49b198[_0x28bb('0x2d')][_0x28bb('0x14')][_0x28bb('0x4b')],'substatus':null,'substatusAt':moment()['format'](_0x28bb('0x4d')),'lastMsgAt':moment()[_0x28bb('0x4c')](_0x28bb('0x4d')),'lastMsgDirection':'in'});}else{return _0x406cf0;}}})[_0x28bb('0xe')](function(_0x426ac1){_0x508845[_0x28bb('0x52')]=_0x426ac1[_0x28bb('0x3b')]({'plain':!![]});_0x508845['interaction'][_0x28bb('0x53')]=_0x2cf38a;return db[_0x28bb('0x4f')][_0x28bb('0x46')]({'body':_0x49b198[_0x28bb('0x2d')][_0x28bb('0x2d')],'MailAccountId':_0x49b198[_0x28bb('0x3c')]['id'],'MailInteractionId':_0x426ac1['id'],'direction':'in','ContactId':_0x508845['contact']['id'],'messageId':_0x49b198[_0x28bb('0x2d')][_0x28bb('0x14')][_0x28bb('0x48')],'from':_0x49b198[_0x28bb('0x2d')][_0x28bb('0x14')][_0x28bb('0x2e')],'to':_0x49b198[_0x28bb('0x2d')][_0x28bb('0x14')]['to'],'cc':_0x49b198[_0x28bb('0x2d')][_0x28bb('0x14')]['cc'],'subject':_0x49b198[_0x28bb('0x2d')]['message'][_0x28bb('0x4a')],'attach':_0x49b198[_0x28bb('0x2d')]['message']['attach'],'Attachments':_0x49b198[_0x28bb('0x2d')][_0x28bb('0x14')][_0x28bb('0x54')],'originTo':_0x49b198[_0x28bb('0x2d')][_0x28bb('0x14')][_0x28bb('0x55')],'originCc':_0x49b198[_0x28bb('0x2d')][_0x28bb('0x14')]['originCc'],'bcc':_0x49b198['body'][_0x28bb('0x14')][_0x28bb('0x56')],'ChatWebsiteId':_0x49b198['body'][_0x28bb('0x14')][_0x28bb('0x57')]||null,'originChannel':_0x49b198[_0x28bb('0x2d')][_0x28bb('0x14')][_0x28bb('0x58')]||_0x28bb('0x59'),'ChatOfflineMessageId':_0x49b198['body']['message'][_0x28bb('0x5a')]||null},{'include':[{'model':db['Attachment'],'as':_0x28bb('0x5b')}]});})['then'](function(_0x2d9456){_0x508845[_0x28bb('0x14')]=_0x2d9456;if(_0x508845['interaction'][_0x28bb('0x5c')]){return db[_0x28bb('0x5d')][_0x28bb('0x24')]({'attributes':['id',_0x28bb('0x5e')],'where':{'id':_0x508845[_0x28bb('0x52')]['UserId']}})[_0x28bb('0xe')](function(_0x4d501f){if(_0x4d501f){_0x508845[_0x28bb('0x3d')][_0x28bb('0x5f')]({'id':0x0,'priority':0x0,'app':_0x28bb('0x60'),'appdata':_0x4d501f[_0x28bb('0x5e')]+','+(_0x508845[_0x28bb('0x3c')][_0x28bb('0x61')]||0xa),'interval':_0x28bb('0x45')});}return respondWithRpcPromise(_0x28bb('0x62'),_0x28bb('0x63'),_0x508845);});}return respondWithRpcPromise(_0x28bb('0x62'),'startRouting',_0x508845);})[_0x28bb('0xe')](function(_0x257bcc){_0x251498(_0x257bcc);})[_0x28bb('0x17')](function(_0x227ae9){_0x128899(_0x5c6599[_0x28bb('0x13')](0x1f4,_0x227ae9[_0x28bb('0x14')]));});});}; \ No newline at end of file +var _0x3b7a=['unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','MailAccount','findAll','options','raw','where','attributes','include','map','model','ShowMailAccount','find','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','createdAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','Contacts','DESC','MailApplication','Applications','MailServerOut','Smtp','get','omit','list','applications','orderBy','priority','asc','autoclose','push','length','close','from','create','contact','messageId','generate','attach','format','MailInteraction','MailMessage','inReplyTo','Contact\x20not\x20found','spread','update','subject','YYYY-MM-DD\x20HH:mm:ss','interaction','created','attachments','originTo','originCc','bcc','originChannel','ChatOfflineMessageId','Attachment','Attachments','UserId','name'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x3b7a,0x1c2));var _0xa3b7=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x3b7a[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xa3b7('0x0'));var util=require(_0xa3b7('0x1'));var moment=require('moment');var BPromise=require(_0xa3b7('0x2'));var rs=require(_0xa3b7('0x3'));var fs=require('fs');var Redis=require(_0xa3b7('0x4'));var db=require(_0xa3b7('0x5'))['db'];var utils=require(_0xa3b7('0x6'));var logger=require(_0xa3b7('0x7'))(_0xa3b7('0x8'));var config=require(_0xa3b7('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa3b7('0xa')]({'port':0x232c});config[_0xa3b7('0xb')]=_[_0xa3b7('0xc')](config[_0xa3b7('0xb')],{'host':_0xa3b7('0xd'),'port':0x18eb});var socket=require(_0xa3b7('0xe'))(new Redis(config[_0xa3b7('0xb')]));require(_0xa3b7('0xf'))[_0xa3b7('0x10')](socket);function respondWithRpcPromise(_0x387bfe,_0x1ad025,_0x5ab277){return new BPromise(function(_0x38100f,_0x46e6d0){return client[_0xa3b7('0x11')](_0x387bfe,_0x5ab277)[_0xa3b7('0x12')](function(_0x3e046a){logger[_0xa3b7('0x13')](_0xa3b7('0x14'),_0x1ad025,'request\x20sent');logger[_0xa3b7('0x15')](_0xa3b7('0x16'),_0x1ad025,_0xa3b7('0x17'),JSON[_0xa3b7('0x18')](_0x3e046a));if(_0x3e046a[_0xa3b7('0x19')]){if(_0x3e046a[_0xa3b7('0x19')][_0xa3b7('0x1a')]===0x1f4){logger['error'](_0xa3b7('0x14'),_0x1ad025,_0x3e046a['error'][_0xa3b7('0x1b')]);return _0x46e6d0(_0x3e046a[_0xa3b7('0x19')][_0xa3b7('0x1b')]);}logger[_0xa3b7('0x19')](_0xa3b7('0x14'),_0x1ad025,_0x3e046a[_0xa3b7('0x19')][_0xa3b7('0x1b')]);return _0x38100f(_0x3e046a[_0xa3b7('0x19')][_0xa3b7('0x1b')]);}else{logger[_0xa3b7('0x13')](_0xa3b7('0x14'),_0x1ad025,_0xa3b7('0x17'));_0x38100f(_0x3e046a[_0xa3b7('0x1c')][_0xa3b7('0x1b')]);}})[_0xa3b7('0x1d')](function(_0x1afcdf){logger['error'](_0xa3b7('0x14'),_0x1ad025,_0x1afcdf);_0x46e6d0(_0x1afcdf);});});}exports['GetMailAccount']=function(_0x3bb3fb){var _0x2a3a92=this;return new Promise(function(_0xfd233e,_0x39cd6b){return db[_0xa3b7('0x1e')][_0xa3b7('0x1f')]({'raw':_0x3bb3fb[_0xa3b7('0x20')]?_0x3bb3fb['options'][_0xa3b7('0x21')]===undefined?!![]:![]:!![],'where':_0x3bb3fb[_0xa3b7('0x20')]?_0x3bb3fb[_0xa3b7('0x20')][_0xa3b7('0x22')]||null:null,'attributes':_0x3bb3fb['options']?_0x3bb3fb[_0xa3b7('0x20')][_0xa3b7('0x23')]||null:null,'limit':_0x3bb3fb[_0xa3b7('0x20')]?_0x3bb3fb[_0xa3b7('0x20')]['limit']||null:null,'include':_0x3bb3fb[_0xa3b7('0x20')]?_0x3bb3fb['options'][_0xa3b7('0x24')]?_[_0xa3b7('0x25')](_0x3bb3fb[_0xa3b7('0x20')][_0xa3b7('0x24')],function(_0x4ad210){return{'model':db[_0x4ad210[_0xa3b7('0x26')]],'as':_0x4ad210['as'],'attributes':_0x4ad210[_0xa3b7('0x23')],'include':_0x4ad210[_0xa3b7('0x24')]?_[_0xa3b7('0x25')](_0x4ad210[_0xa3b7('0x24')],function(_0x2592f3){return{'model':db[_0x2592f3['model']],'as':_0x2592f3['as'],'attributes':_0x2592f3[_0xa3b7('0x23')],'include':_0x2592f3[_0xa3b7('0x24')]?_[_0xa3b7('0x25')](_0x2592f3[_0xa3b7('0x24')],function(_0x4e010d){return{'model':db[_0x4e010d[_0xa3b7('0x26')]],'as':_0x4e010d['as'],'attributes':_0x4e010d[_0xa3b7('0x23')]};}):[]};}):[]};}):[]:[]})[_0xa3b7('0x12')](function(_0x20c82e){logger[_0xa3b7('0x13')]('GetMailAccount',_0x3bb3fb);logger[_0xa3b7('0x15')]('GetMailAccount',_0x3bb3fb,JSON['stringify'](_0x20c82e));_0xfd233e(_0x20c82e);})[_0xa3b7('0x1d')](function(_0x2be622){logger['error']('GetMailAccount',_0x2be622[_0xa3b7('0x1b')],_0x3bb3fb);_0x39cd6b(_0x2a3a92[_0xa3b7('0x19')](0x1f4,_0x2be622[_0xa3b7('0x1b')]));});});};exports[_0xa3b7('0x27')]=function(_0x44de1c){var _0x48761f=this;return new Promise(function(_0x57eb60,_0x1fe8a8){return db[_0xa3b7('0x1e')][_0xa3b7('0x28')]({'raw':_0x44de1c[_0xa3b7('0x20')]?_0x44de1c[_0xa3b7('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x44de1c[_0xa3b7('0x20')]?_0x44de1c[_0xa3b7('0x20')][_0xa3b7('0x22')]||null:null,'attributes':_0x44de1c[_0xa3b7('0x20')]?_0x44de1c[_0xa3b7('0x20')][_0xa3b7('0x23')]||null:null,'include':_0x44de1c[_0xa3b7('0x20')]?_0x44de1c['options'][_0xa3b7('0x24')]?_['map'](_0x44de1c['options'][_0xa3b7('0x24')],function(_0x3b8907){return{'model':db[_0x3b8907[_0xa3b7('0x26')]],'as':_0x3b8907['as'],'attributes':_0x3b8907[_0xa3b7('0x23')],'include':_0x3b8907[_0xa3b7('0x24')]?_[_0xa3b7('0x25')](_0x3b8907[_0xa3b7('0x24')],function(_0x3af487){return{'model':db[_0x3af487[_0xa3b7('0x26')]],'as':_0x3af487['as'],'attributes':_0x3af487[_0xa3b7('0x23')],'include':_0x3af487['include']?_[_0xa3b7('0x25')](_0x3af487[_0xa3b7('0x24')],function(_0x164964){return{'model':db[_0x164964['model']],'as':_0x164964['as'],'attributes':_0x164964['attributes']};}):[]};}):[]};}):[]:[]})[_0xa3b7('0x12')](function(_0x5ccd05){logger[_0xa3b7('0x13')](_0xa3b7('0x27'),_0x44de1c);logger['debug'](_0xa3b7('0x27'),_0x44de1c,JSON[_0xa3b7('0x18')](_0x5ccd05));_0x57eb60(_0x5ccd05);})[_0xa3b7('0x1d')](function(_0x345768){logger[_0xa3b7('0x19')](_0xa3b7('0x27'),_0x345768[_0xa3b7('0x1b')],_0x44de1c);_0x1fe8a8(_0x48761f[_0xa3b7('0x19')](0x1f4,_0x345768[_0xa3b7('0x1b')]));});});};exports[_0xa3b7('0x29')]=function(_0x1c17a0){var _0x6b6b92=this;return new Promise(function(_0x423362,_0x1b21c5){var _0xd2feee={'body':_0x1c17a0[_0xa3b7('0x2a')],'channel':_0xa3b7('0x2b')};var _0x446a65=_[_0xa3b7('0x2c')](_[_0xa3b7('0x2d')](db[_0xa3b7('0x2e')][_0xa3b7('0x2f')]),[_0xa3b7('0x30'),'updatedAt',_0xa3b7('0x31'),_0xa3b7('0x32')]);var _0x162f87=![];if(_0x1c17a0[_0xa3b7('0x2a')]['id']){delete _0x1c17a0[_0xa3b7('0x2a')]['id'];}if(_[_0xa3b7('0x33')](_0x1c17a0[_0xa3b7('0x2a')]['from'])){return _0x1b21c5(_0x6b6b92['error'](0x1f4,_0xa3b7('0x34')));}if(_[_0xa3b7('0x33')](_0x1c17a0[_0xa3b7('0x2a')][_0xa3b7('0x2a')])||_0x1c17a0[_0xa3b7('0x2a')][_0xa3b7('0x2a')]===''){return _0x1b21c5(_0x6b6b92[_0xa3b7('0x19')](0x1f4,_0xa3b7('0x35')));}if(_['isNil'](_0x1c17a0['body'][_0xa3b7('0x36')])){return _0x1b21c5(_0x6b6b92[_0xa3b7('0x19')](0x1f4,_0xa3b7('0x37')+_0x446a65));}if(!_[_0xa3b7('0x38')](_0x446a65,_0x1c17a0[_0xa3b7('0x2a')][_0xa3b7('0x36')])){return _0x1b21c5(_0x6b6b92[_0xa3b7('0x19')](0x1f4,_0xa3b7('0x39')+_0x446a65));}var _0xb5b2dc={};_0xb5b2dc[_0x1c17a0[_0xa3b7('0x2a')][_0xa3b7('0x36')]]=_0x1c17a0[_0xa3b7('0x2a')]['from'];return db[_0xa3b7('0x1e')]['find']({'where':{'id':_0x1c17a0[_0xa3b7('0x3a')]['id']},'include':[{'model':db[_0xa3b7('0x3b')],'as':_0xa3b7('0x3c'),'include':[{'model':db['CmContact'],'as':_0xa3b7('0x3d'),'where':_0xb5b2dc,'limit':0x1,'order':[['updatedAt',_0xa3b7('0x3e')]]}]},{'model':db[_0xa3b7('0x3f')],'as':_0xa3b7('0x40')},{'model':db[_0xa3b7('0x41')],'as':_0xa3b7('0x42')}]})[_0xa3b7('0x12')](function(_0x1461d7){if(_0x1461d7&&_0x1461d7[_0xa3b7('0x3c')]){var _0x463835=_0x1461d7[_0xa3b7('0x43')]({'plain':!![]});_0xd2feee['account']=_[_0xa3b7('0x44')](_0x463835,[_0xa3b7('0x40'),_0xa3b7('0x3c')]);_0xd2feee['applications']=_0x463835[_0xa3b7('0x40')];_0xd2feee[_0xa3b7('0x45')]=_0x463835[_0xa3b7('0x3c')];_0xd2feee[_0xa3b7('0x46')]=_[_0xa3b7('0x47')](_0xd2feee['applications'],[_0xa3b7('0x48')],[_0xa3b7('0x49')]);if(_0xd2feee[_0xa3b7('0x3a')]&&_0xd2feee[_0xa3b7('0x3a')][_0xa3b7('0x4a')]){_0xd2feee[_0xa3b7('0x46')][_0xa3b7('0x4b')]({'id':0x0,'priority':_0xd2feee[_0xa3b7('0x46')][_0xa3b7('0x4c')]+0x1,'app':_0xa3b7('0x4d'),'appdata':'autoclose','interval':'*,*,*,*'});}if(_0xd2feee[_0xa3b7('0x3a')][_0xa3b7('0x40')]){delete _0xd2feee[_0xa3b7('0x3a')][_0xa3b7('0x40')];}if(_0xd2feee[_0xa3b7('0x3a')][_0xa3b7('0x3c')]){delete _0xd2feee['account'][_0xa3b7('0x3c')];}if(_0x463835[_0xa3b7('0x3c')][_0xa3b7('0x3d')][_0xa3b7('0x4c')]){return _0x463835[_0xa3b7('0x3c')][_0xa3b7('0x3d')][0x0];}var _0x1f37fe=_['defaults'](_0x1c17a0[_0xa3b7('0x2a')],{'firstName':_0x1c17a0[_0xa3b7('0x2a')][_0xa3b7('0x4e')],'ListId':_0x463835[_0xa3b7('0x32')]});_0x1f37fe[_0x1c17a0[_0xa3b7('0x2a')][_0xa3b7('0x36')]]=_0x1c17a0['body']['from'];return db[_0xa3b7('0x2e')][_0xa3b7('0x4f')](_0x1f37fe);}else{throw new Error('List\x20not\x20found');}})[_0xa3b7('0x12')](function(_0xf07a0c){_0xd2feee[_0xa3b7('0x50')]=_0xf07a0c;if(_0xf07a0c){if(!_0x1c17a0['body'][_0xa3b7('0x1b')][_0xa3b7('0x51')]){_0x1c17a0[_0xa3b7('0x2a')]['message'][_0xa3b7('0x51')]=rs[_0xa3b7('0x52')]()+'\x20'+_0x1c17a0[_0xa3b7('0x2a')][_0xa3b7('0x1b')][_0xa3b7('0x4e')];}var _0x55ba3={'ContactId':_0xf07a0c['id'],'MailAccountId':_0x1c17a0[_0xa3b7('0x3a')]['id'],'inReplyTo':_0x1c17a0[_0xa3b7('0x2a')][_0xa3b7('0x1b')][_0xa3b7('0x51')],'to':_0x1c17a0[_0xa3b7('0x2a')]['message'][_0xa3b7('0x4e')],'cc':_0x1c17a0[_0xa3b7('0x2a')][_0xa3b7('0x1b')]['cc'],'subject':_0x1c17a0[_0xa3b7('0x2a')][_0xa3b7('0x1b')]['subject'],'attach':_0x1c17a0['body'][_0xa3b7('0x1b')][_0xa3b7('0x53')],'lastMsgAt':moment()[_0xa3b7('0x54')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0xa3b7('0x55')][_0xa3b7('0x28')]({'where':{'closed':![],'MailAccountId':_0x1c17a0[_0xa3b7('0x3a')]['id']},'include':[{'model':db[_0xa3b7('0x56')],'as':'Messages','attributes':[_0xa3b7('0x51')],'where':{'messageId':_0x1c17a0[_0xa3b7('0x2a')][_0xa3b7('0x1b')][_0xa3b7('0x57')]}}]})[_0xa3b7('0x12')](function(_0x26fa50){if(_0x26fa50){return[_0x26fa50,![]];}return db[_0xa3b7('0x55')][_0xa3b7('0x4f')](_0x55ba3)[_0xa3b7('0x12')](function(_0x3e5512){return[_0x3e5512,!![]];});});}else{throw new Error(_0xa3b7('0x58'));}})[_0xa3b7('0x59')](function(_0x534359,_0x54c7c5){if(_0x534359){_0x162f87=_0x54c7c5;if(!_0x54c7c5){return _0x534359[_0xa3b7('0x5a')]({'inReplyTo':_0x1c17a0[_0xa3b7('0x2a')][_0xa3b7('0x1b')][_0xa3b7('0x51')],'to':_0x1c17a0['body'][_0xa3b7('0x1b')][_0xa3b7('0x4e')],'cc':_0x1c17a0[_0xa3b7('0x2a')][_0xa3b7('0x1b')]['cc'],'subject':_0x1c17a0[_0xa3b7('0x2a')][_0xa3b7('0x1b')][_0xa3b7('0x5b')],'attach':_0x534359[_0xa3b7('0x53')]?_0x534359['attach']:_0x1c17a0[_0xa3b7('0x2a')][_0xa3b7('0x1b')]['attach'],'substatus':null,'substatusAt':moment()[_0xa3b7('0x54')](_0xa3b7('0x5c')),'lastMsgAt':moment()[_0xa3b7('0x54')](_0xa3b7('0x5c')),'lastMsgDirection':'in'});}else{return _0x534359;}}})[_0xa3b7('0x12')](function(_0x22e1aa){_0xd2feee[_0xa3b7('0x5d')]=_0x22e1aa[_0xa3b7('0x43')]({'plain':!![]});_0xd2feee[_0xa3b7('0x5d')][_0xa3b7('0x5e')]=_0x162f87;return db['MailMessage']['create']({'body':_0x1c17a0[_0xa3b7('0x2a')][_0xa3b7('0x2a')],'MailAccountId':_0x1c17a0[_0xa3b7('0x3a')]['id'],'MailInteractionId':_0x22e1aa['id'],'direction':'in','ContactId':_0xd2feee[_0xa3b7('0x50')]['id'],'messageId':_0x1c17a0[_0xa3b7('0x2a')][_0xa3b7('0x1b')]['messageId'],'from':_0x1c17a0[_0xa3b7('0x2a')][_0xa3b7('0x1b')][_0xa3b7('0x4e')],'to':_0x1c17a0[_0xa3b7('0x2a')]['message']['to'],'cc':_0x1c17a0[_0xa3b7('0x2a')][_0xa3b7('0x1b')]['cc'],'subject':_0x1c17a0[_0xa3b7('0x2a')]['message']['subject'],'attach':_0x1c17a0[_0xa3b7('0x2a')]['message'][_0xa3b7('0x53')],'Attachments':_0x1c17a0['body'][_0xa3b7('0x1b')][_0xa3b7('0x5f')],'originTo':_0x1c17a0['body'][_0xa3b7('0x1b')][_0xa3b7('0x60')],'originCc':_0x1c17a0[_0xa3b7('0x2a')][_0xa3b7('0x1b')][_0xa3b7('0x61')],'bcc':_0x1c17a0[_0xa3b7('0x2a')][_0xa3b7('0x1b')][_0xa3b7('0x62')],'ChatWebsiteId':_0x1c17a0[_0xa3b7('0x2a')][_0xa3b7('0x1b')]['ChatWebsiteId']||null,'originChannel':_0x1c17a0[_0xa3b7('0x2a')][_0xa3b7('0x1b')][_0xa3b7('0x63')]||'Email','ChatOfflineMessageId':_0x1c17a0['body'][_0xa3b7('0x1b')][_0xa3b7('0x64')]||null},{'include':[{'model':db[_0xa3b7('0x65')],'as':_0xa3b7('0x66')}]});})[_0xa3b7('0x12')](function(_0x3a9d74){_0xd2feee[_0xa3b7('0x1b')]=_0x3a9d74;if(_0xd2feee['interaction'][_0xa3b7('0x67')]){return db['User']['find']({'attributes':['id',_0xa3b7('0x68')],'where':{'id':_0xd2feee[_0xa3b7('0x5d')][_0xa3b7('0x67')]}})[_0xa3b7('0x12')](function(_0x185c7a){if(_0x185c7a){_0xd2feee['applications'][_0xa3b7('0x69')]({'id':0x0,'priority':0x0,'app':_0xa3b7('0x6a'),'appdata':_0x185c7a[_0xa3b7('0x68')]+','+(_0xd2feee[_0xa3b7('0x3a')][_0xa3b7('0x6b')]||0xa),'interval':_0xa3b7('0x6c')});}return respondWithRpcPromise(_0xa3b7('0x6d'),_0xa3b7('0x6e'),_0xd2feee);});}return respondWithRpcPromise(_0xa3b7('0x6d'),_0xa3b7('0x6e'),_0xd2feee);})[_0xa3b7('0x12')](function(_0xf04ee8){_0x423362(_0xf04ee8);})[_0xa3b7('0x1d')](function(_0xaef202){_0x1b21c5(_0x6b6b92[_0xa3b7('0x19')](0x1f4,_0xaef202[_0xa3b7('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 6b08e14..c7b935e 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 _0x7309=['remove','emit','register','mailAccount:','save'];(function(_0x2f9467,_0x40576f){var _0x39894c=function(_0x13e344){while(--_0x13e344){_0x2f9467['push'](_0x2f9467['shift']());}};_0x39894c(++_0x40576f);}(_0x7309,0x18f));var _0x9730=function(_0x2d8822,_0xb51a9d){_0x2d8822=_0x2d8822-0x0;var _0x9828a1=_0x7309[_0x2d8822];return _0x9828a1;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0x9730('0x0'),_0x9730('0x1'),'update'];function createListener(_0x447c3b,_0x23df49){return function(_0x41138e){_0x23df49[_0x9730('0x2')](_0x447c3b,_0x41138e);};}function removeListener(_0x13e265,_0x357f7a){return function(){MailAccountEvents['removeListener'](_0x13e265,_0x357f7a);};}exports[_0x9730('0x3')]=function(_0x446466){for(var _0x4c8f5a=0x0,_0x1266bf=events['length'];_0x4c8f5a<_0x1266bf;_0x4c8f5a++){var _0x3163b9=events[_0x4c8f5a];var _0x37e041=createListener(_0x9730('0x4')+_0x3163b9,_0x446466);MailAccountEvents['on'](_0x3163b9,_0x37e041);}}; \ No newline at end of file +var _0x8588=['emit','removeListener','register','length','save','remove','update'];(function(_0xf11df,_0x307bc1){var _0x1d2a84=function(_0x405296){while(--_0x405296){_0xf11df['push'](_0xf11df['shift']());}};_0x1d2a84(++_0x307bc1);}(_0x8588,0x185));var _0x8858=function(_0x4841ef,_0x39b36b){_0x4841ef=_0x4841ef-0x0;var _0x2c7564=_0x8588[_0x4841ef];return _0x2c7564;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0x8858('0x0'),_0x8858('0x1'),_0x8858('0x2')];function createListener(_0x299e33,_0x5c2622){return function(_0x4fb8c3){_0x5c2622[_0x8858('0x3')](_0x299e33,_0x4fb8c3);};}function removeListener(_0x400163,_0x58d0a6){return function(){MailAccountEvents[_0x8858('0x4')](_0x400163,_0x58d0a6);};}exports[_0x8858('0x5')]=function(_0x5d7984){for(var _0x370f4c=0x0,_0x3117b3=events[_0x8858('0x6')];_0x370f4c<_0x3117b3;_0x370f4c++){var _0x5703da=events[_0x370f4c];var _0x550895=createListener('mailAccount:'+_0x5703da,_0x5d7984);MailAccountEvents['on'](_0x5703da,_0x550895);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 56c04e7..59869f6 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 _0x5abd=['/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','isAuthenticated','show','put'];(function(_0x52e40f,_0x239b35){var _0x2291bd=function(_0x143740){while(--_0x143740){_0x52e40f['push'](_0x52e40f['shift']());}};_0x2291bd(++_0x239b35);}(_0x5abd,0x1cd));var _0xd5ab=function(_0x359fe4,_0x50f9e4){_0x359fe4=_0x359fe4-0x0;var _0x32e4a3=_0x5abd[_0x359fe4];return _0x32e4a3;};'use strict';var multer=require(_0xd5ab('0x0'));var util=require(_0xd5ab('0x1'));var path=require(_0xd5ab('0x2'));var timeout=require(_0xd5ab('0x3'));var express=require(_0xd5ab('0x4'));var router=express['Router']();var fs_extra=require(_0xd5ab('0x5'));var auth=require(_0xd5ab('0x6'));var interaction=require(_0xd5ab('0x7'));var config=require(_0xd5ab('0x8'));var controller=require(_0xd5ab('0x9'));router[_0xd5ab('0xa')]('/:id',auth[_0xd5ab('0xb')](),controller[_0xd5ab('0xc')]);router[_0xd5ab('0xd')](_0xd5ab('0xe'),auth['isAuthenticated'](),controller[_0xd5ab('0xf')]);router[_0xd5ab('0x10')](_0xd5ab('0xe'),auth[_0xd5ab('0xb')](),controller[_0xd5ab('0x11')]);module[_0xd5ab('0x12')]=router; \ No newline at end of file +var _0x2c32=['delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','show','put','/:id','isAuthenticated','update'];(function(_0x469a3c,_0x5ebc10){var _0x968f4=function(_0x22403b){while(--_0x22403b){_0x469a3c['push'](_0x469a3c['shift']());}};_0x968f4(++_0x5ebc10);}(_0x2c32,0x1ce));var _0x22c3=function(_0x298e18,_0x241d31){_0x298e18=_0x298e18-0x0;var _0x4dc6df=_0x2c32[_0x298e18];return _0x4dc6df;};'use strict';var multer=require(_0x22c3('0x0'));var util=require(_0x22c3('0x1'));var path=require('path');var timeout=require(_0x22c3('0x2'));var express=require(_0x22c3('0x3'));var router=express['Router']();var fs_extra=require(_0x22c3('0x4'));var auth=require(_0x22c3('0x5'));var interaction=require(_0x22c3('0x6'));var config=require(_0x22c3('0x7'));var controller=require('./mailApplication.controller');router[_0x22c3('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x22c3('0x9')]);router[_0x22c3('0xa')](_0x22c3('0xb'),auth[_0x22c3('0xc')](),controller[_0x22c3('0xd')]);router[_0x22c3('0xe')]('/:id',auth[_0x22c3('0xc')](),controller[_0x22c3('0xf')]);module[_0x22c3('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 437a2e3..70c8fdc 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 _0x5e96=['*,*,*,*','sequelize','INTEGER','STRING','TEXT'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x5e96,0x169));var _0x65e9=function(_0x232a41,_0x51ede7){_0x232a41=_0x232a41-0x0;var _0x47857c=_0x5e96[_0x232a41];return _0x47857c;};'use strict';var Sequelize=require(_0x65e9('0x0'));module['exports']={'priority':{'type':Sequelize[_0x65e9('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x65e9('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x65e9('0x3')]()},'description':{'type':Sequelize[_0x65e9('0x2')]},'interval':{'type':Sequelize[_0x65e9('0x2')],'defaultValue':_0x65e9('0x4')}}; \ No newline at end of file +var _0xc371=['sequelize','INTEGER','TEXT','STRING','*,*,*,*'];(function(_0x1df794,_0x8a3a7d){var _0x4ed8ee=function(_0x119eb7){while(--_0x119eb7){_0x1df794['push'](_0x1df794['shift']());}};_0x4ed8ee(++_0x8a3a7d);}(_0xc371,0xf0));var _0x1c37=function(_0x309bf,_0x2d37ac){_0x309bf=_0x309bf-0x0;var _0xec84b8=_0xc371[_0x309bf];return _0xec84b8;};'use strict';var Sequelize=require(_0x1c37('0x0'));module['exports']={'priority':{'type':Sequelize[_0x1c37('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x1c37('0x2')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x1c37('0x3')],'defaultValue':_0x1c37('0x4')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 8d52245..42bcded 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 _0xbdb7=['update','error','stack','name','send','show','params','model','keys','MailApplication','query','filters','intersection','attributes','length','includeAll','merge','find','then','body','catch','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save'];(function(_0x166d93,_0x301f09){var _0xba708=function(_0x349bf7){while(--_0x349bf7){_0x166d93['push'](_0x166d93['shift']());}};_0xba708(++_0x301f09);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x51f593,_0x38d2ec){_0x51f593=_0x51f593-0x0;var _0x4ccfbf=_0xbdb7[_0x51f593];return _0x4ccfbf;};'use strict';var emlformat=require(_0x7bdb('0x0'));var rimraf=require(_0x7bdb('0x1'));var zipdir=require(_0x7bdb('0x2'));var jsonpatch=require(_0x7bdb('0x3'));var rp=require(_0x7bdb('0x4'));var moment=require(_0x7bdb('0x5'));var BPromise=require(_0x7bdb('0x6'));var Mustache=require(_0x7bdb('0x7'));var util=require(_0x7bdb('0x8'));var path=require('path');var sox=require(_0x7bdb('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7bdb('0xa'));var _=require(_0x7bdb('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7bdb('0xc'));var deskjs=require(_0x7bdb('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7bdb('0xe'));var Redis=require(_0x7bdb('0xf'));var authService=require(_0x7bdb('0x10'));var qs=require(_0x7bdb('0x11'));var as=require(_0x7bdb('0x12'));var hardwareService=require(_0x7bdb('0x13'));var logger=require(_0x7bdb('0x14'))(_0x7bdb('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7bdb('0x16'))['db'];function respondWithStatusCode(_0x25e3cb,_0x496613){_0x496613=_0x496613||0xcc;return function(_0x8d74ff){if(_0x8d74ff){return _0x25e3cb['sendStatus'](_0x496613);}return _0x25e3cb['status'](_0x496613)[_0x7bdb('0x17')]();};}function respondWithResult(_0x46dd4a,_0x4fd91a){_0x4fd91a=_0x4fd91a||0xc8;return function(_0x50eeca){if(_0x50eeca){return _0x46dd4a['status'](_0x4fd91a)[_0x7bdb('0x18')](_0x50eeca);}};}function respondWithFilteredResult(_0x195b2e,_0xe9919f){return function(_0x25d417){if(_0x25d417){var _0x31c909=typeof _0xe9919f[_0x7bdb('0x19')]===_0x7bdb('0x1a')&&typeof _0xe9919f[_0x7bdb('0x1b')]==='undefined';var _0x1c5750=_0x25d417[_0x7bdb('0x1c')];var _0x5723f4=_0x31c909?0x0:_0xe9919f[_0x7bdb('0x19')];var _0x4ffd4b=_0x31c909?_0x25d417[_0x7bdb('0x1c')]:_0xe9919f[_0x7bdb('0x19')]+_0xe9919f['limit'];var _0x3e5f8e;if(_0x4ffd4b>=_0x1c5750){_0x4ffd4b=_0x1c5750;_0x3e5f8e=0xc8;}else{_0x3e5f8e=0xce;}_0x195b2e[_0x7bdb('0x1d')](_0x3e5f8e);return _0x195b2e[_0x7bdb('0x1e')](_0x7bdb('0x1f'),_0x5723f4+'-'+_0x4ffd4b+'/'+_0x1c5750)[_0x7bdb('0x18')](_0x25d417);}return null;};}function patchUpdates(_0x5bfc35){return function(_0x49f353){try{jsonpatch[_0x7bdb('0x20')](_0x49f353,_0x5bfc35,!![]);}catch(_0xcb25f2){return BPromise['reject'](_0xcb25f2);}return _0x49f353[_0x7bdb('0x21')]();};}function saveUpdates(_0x118ea1,_0x346c72){return function(_0x3f53e7){if(_0x3f53e7){return _0x3f53e7[_0x7bdb('0x22')](_0x118ea1)['then'](function(_0x1d37ac){return _0x1d37ac;});}return null;};}function removeEntity(_0xdad53d,_0x40c447){return function(_0x3a456f){if(_0x3a456f){return _0x3a456f['destroy']()['then'](function(){_0xdad53d[_0x7bdb('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47abaf,_0x4a9e02){return function(_0x2abef6){if(!_0x2abef6){_0x47abaf['sendStatus'](0x194);}return _0x2abef6;};}function handleError(_0x2b14bc,_0x72ba69){_0x72ba69=_0x72ba69||0x1f4;return function(_0x3ec129){logger[_0x7bdb('0x23')](_0x3ec129[_0x7bdb('0x24')]);if(_0x3ec129['name']){delete _0x3ec129[_0x7bdb('0x25')];}_0x2b14bc[_0x7bdb('0x1d')](_0x72ba69)[_0x7bdb('0x26')](_0x3ec129);};}exports[_0x7bdb('0x27')]=function(_0x371e8a,_0x2e8e65){var _0x1e9996={'raw':!![],'where':{'id':_0x371e8a[_0x7bdb('0x28')]['id']}},_0xd2d7be={};_0xd2d7be[_0x7bdb('0x29')]=_[_0x7bdb('0x2a')](db[_0x7bdb('0x2b')]['rawAttributes']);_0xd2d7be[_0x7bdb('0x2c')]=_[_0x7bdb('0x2a')](_0x371e8a[_0x7bdb('0x2c')]);_0xd2d7be[_0x7bdb('0x2d')]=_[_0x7bdb('0x2e')](_0xd2d7be['model'],_0xd2d7be[_0x7bdb('0x2c')]);_0x1e9996[_0x7bdb('0x2f')]=_[_0x7bdb('0x2e')](_0xd2d7be[_0x7bdb('0x29')],qs['fields'](_0x371e8a['query']['fields']));_0x1e9996[_0x7bdb('0x2f')]=_0x1e9996['attributes'][_0x7bdb('0x30')]?_0x1e9996['attributes']:_0xd2d7be[_0x7bdb('0x29')];if(_0x371e8a[_0x7bdb('0x2c')][_0x7bdb('0x31')]){_0x1e9996['include']=[{'all':!![]}];}_0x1e9996=_[_0x7bdb('0x32')]({},_0x1e9996,_0x371e8a['options']);return db['MailApplication'][_0x7bdb('0x33')](_0x1e9996)['then'](handleEntityNotFound(_0x2e8e65,null))[_0x7bdb('0x34')](respondWithResult(_0x2e8e65,null))['catch'](handleError(_0x2e8e65,null));};exports['update']=function(_0x206c26,_0x353b26){if(_0x206c26[_0x7bdb('0x35')]['id']){delete _0x206c26[_0x7bdb('0x35')]['id'];}return db[_0x7bdb('0x2b')][_0x7bdb('0x33')]({'where':{'id':_0x206c26['params']['id']}})[_0x7bdb('0x34')](handleEntityNotFound(_0x353b26,null))[_0x7bdb('0x34')](saveUpdates(_0x206c26[_0x7bdb('0x35')],null))[_0x7bdb('0x34')](respondWithResult(_0x353b26,null))[_0x7bdb('0x36')](handleError(_0x353b26,null));};exports[_0x7bdb('0x37')]=function(_0x228340,_0x2587af){return db[_0x7bdb('0x2b')]['find']({'where':{'id':_0x228340['params']['id']}})[_0x7bdb('0x34')](handleEntityNotFound(_0x2587af,null))[_0x7bdb('0x34')](removeEntity(_0x2587af,null))[_0x7bdb('0x36')](handleError(_0x2587af,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(_0x124187,_0x487df7){var _0x562ffc=function(_0x24fdae){while(--_0x24fdae){_0x124187['push'](_0x124187['shift']());}};_0x562ffc(++_0x487df7);}(_0xac4a,0x13f));var _0xaac4=function(_0xeeb42,_0x3bb2c4){_0xeeb42=_0xeeb42-0x0;var _0x54bd31=_0xac4a[_0xeeb42];return _0x54bd31;};'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 892d164..7a1799f 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 _0x65dd=['api','moment','bluebird','request-promise','path','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x65dd,0x1c5));var _0xd65d=function(_0xc1cffa,_0x1e2c88){_0xc1cffa=_0xc1cffa-0x0;var _0x4c349e=_0x65dd[_0xc1cffa];return _0x4c349e;};'use strict';var _=require(_0xd65d('0x0'));var util=require('util');var logger=require(_0xd65d('0x1'))(_0xd65d('0x2'));var moment=require(_0xd65d('0x3'));var BPromise=require(_0xd65d('0x4'));var rp=require(_0xd65d('0x5'));var fs=require('fs');var path=require(_0xd65d('0x6'));var rimraf=require('rimraf');var config=require(_0xd65d('0x7'));var attributes=require(_0xd65d('0x8'));module[_0xd65d('0x9')]=function(_0x564c8e,_0x2df676){return _0x564c8e[_0xd65d('0xa')](_0xd65d('0xb'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xd65d('0xc')});}; \ No newline at end of file +var _0x1c47=['api','moment','bluebird','request-promise','path','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4','lodash','util','../../config/logger'];(function(_0x1d88e8,_0x4ec6f6){var _0x188711=function(_0x5e0436){while(--_0x5e0436){_0x1d88e8['push'](_0x1d88e8['shift']());}};_0x188711(++_0x4ec6f6);}(_0x1c47,0x185));var _0x71c4=function(_0x5a6961,_0xd41ca6){_0x5a6961=_0x5a6961-0x0;var _0x4af0a6=_0x1c47[_0x5a6961];return _0x4af0a6;};'use strict';var _=require(_0x71c4('0x0'));var util=require(_0x71c4('0x1'));var logger=require(_0x71c4('0x2'))(_0x71c4('0x3'));var moment=require(_0x71c4('0x4'));var BPromise=require(_0x71c4('0x5'));var rp=require(_0x71c4('0x6'));var fs=require('fs');var path=require(_0x71c4('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x71c4('0x8'));module[_0x71c4('0x9')]=function(_0x5e33a4,_0x1393b5){return _0x5e33a4[_0x71c4('0xa')](_0x71c4('0xb'),attributes,{'tableName':_0x71c4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x71c4('0xd'),'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 742d43c..9be4609 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 _0xda1d=['debug','stringify','error','code','MailApplication,\x20%s,\x20%s','message','result','catch','UpdateMailApplication','MailApplication','update','options','raw','attributes','limit','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x57df1b,_0x57c7dd){var _0x476a12=function(_0x518e93){while(--_0x518e93){_0x57df1b['push'](_0x57df1b['shift']());}};_0x476a12(++_0x57c7dd);}(_0xda1d,0x9b));var _0xdda1=function(_0x2aec53,_0x41fd7e){_0x2aec53=_0x2aec53-0x0;var _0x2a84fd=_0xda1d[_0x2aec53];return _0x2a84fd;};'use strict';var _=require(_0xdda1('0x0'));var util=require('util');var moment=require(_0xdda1('0x1'));var BPromise=require(_0xdda1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdda1('0x3'))['db'];var utils=require(_0xdda1('0x4'));var logger=require(_0xdda1('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xdda1('0x6'));var client=jayson[_0xdda1('0x7')][_0xdda1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x485ac3,_0x1bb529,_0x52c025){return new BPromise(function(_0x59c50f,_0x45d43f){return client[_0xdda1('0x9')](_0x485ac3,_0x52c025)[_0xdda1('0xa')](function(_0x39635f){logger[_0xdda1('0xb')]('MailApplication,\x20%s,\x20%s',_0x1bb529,_0xdda1('0xc'));logger[_0xdda1('0xd')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x1bb529,_0xdda1('0xc'),JSON[_0xdda1('0xe')](_0x39635f));if(_0x39635f[_0xdda1('0xf')]){if(_0x39635f[_0xdda1('0xf')][_0xdda1('0x10')]===0x1f4){logger[_0xdda1('0xf')](_0xdda1('0x11'),_0x1bb529,_0x39635f['error'][_0xdda1('0x12')]);return _0x45d43f(_0x39635f[_0xdda1('0xf')][_0xdda1('0x12')]);}logger['error'](_0xdda1('0x11'),_0x1bb529,_0x39635f[_0xdda1('0xf')][_0xdda1('0x12')]);return _0x59c50f(_0x39635f[_0xdda1('0xf')][_0xdda1('0x12')]);}else{logger[_0xdda1('0xb')](_0xdda1('0x11'),_0x1bb529,_0xdda1('0xc'));_0x59c50f(_0x39635f[_0xdda1('0x13')][_0xdda1('0x12')]);}})[_0xdda1('0x14')](function(_0x2c4ec2){logger[_0xdda1('0xf')]('MailApplication,\x20%s,\x20%s',_0x1bb529,_0x2c4ec2);_0x45d43f(_0x2c4ec2);});});}exports[_0xdda1('0x15')]=function(_0xf6fa0c){var _0x1ed5c2=this;return new Promise(function(_0x126421,_0xe9e40f){return db[_0xdda1('0x16')][_0xdda1('0x17')](_0xf6fa0c['body'],{'raw':_0xf6fa0c[_0xdda1('0x18')]?_0xf6fa0c[_0xdda1('0x18')][_0xdda1('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf6fa0c[_0xdda1('0x18')]?_0xf6fa0c[_0xdda1('0x18')]['where']||null:null,'attributes':_0xf6fa0c[_0xdda1('0x18')]?_0xf6fa0c[_0xdda1('0x18')][_0xdda1('0x1a')]||null:null,'limit':_0xf6fa0c['options']?_0xf6fa0c[_0xdda1('0x18')][_0xdda1('0x1b')]||null:null})[_0xdda1('0xa')](function(_0x573583){logger[_0xdda1('0xb')](_0xdda1('0x15'),_0xf6fa0c);logger[_0xdda1('0xd')](_0xdda1('0x15'),_0xf6fa0c,JSON[_0xdda1('0xe')](_0x573583));_0x126421(_0x573583);})['catch'](function(_0x53e0a2){logger[_0xdda1('0xf')](_0xdda1('0x15'),_0x53e0a2[_0xdda1('0x12')],_0xf6fa0c);_0xe9e40f(_0x1ed5c2['error'](0x1f4,_0x53e0a2[_0xdda1('0x12')]));});});}; \ No newline at end of file +var _0x9e74=['info','request\x20sent','debug','stringify','error','message','MailApplication,\x20%s,\x20%s','result','catch','UpdateMailApplication','update','body','options','raw','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','http','request','then'];(function(_0x5bd4c8,_0x549ec4){var _0x213330=function(_0x1d7e22){while(--_0x1d7e22){_0x5bd4c8['push'](_0x5bd4c8['shift']());}};_0x213330(++_0x549ec4);}(_0x9e74,0xd5));var _0x49e7=function(_0x5d3d12,_0x546cb5){_0x5d3d12=_0x5d3d12-0x0;var _0x105646=_0x9e74[_0x5d3d12];return _0x105646;};'use strict';var _=require(_0x49e7('0x0'));var util=require('util');var moment=require(_0x49e7('0x1'));var BPromise=require(_0x49e7('0x2'));var rs=require(_0x49e7('0x3'));var fs=require('fs');var Redis=require(_0x49e7('0x4'));var db=require(_0x49e7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x49e7('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x49e7('0x7'));var client=jayson['client'][_0x49e7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5caf48,_0xcf60d7,_0x358cbe){return new BPromise(function(_0x1a933c,_0xaf6fc5){return client[_0x49e7('0x9')](_0x5caf48,_0x358cbe)[_0x49e7('0xa')](function(_0x291c0e){logger[_0x49e7('0xb')]('MailApplication,\x20%s,\x20%s',_0xcf60d7,_0x49e7('0xc'));logger[_0x49e7('0xd')]('MailApplication,\x20%s,\x20%s,\x20%s',_0xcf60d7,_0x49e7('0xc'),JSON[_0x49e7('0xe')](_0x291c0e));if(_0x291c0e[_0x49e7('0xf')]){if(_0x291c0e[_0x49e7('0xf')]['code']===0x1f4){logger['error']('MailApplication,\x20%s,\x20%s',_0xcf60d7,_0x291c0e[_0x49e7('0xf')][_0x49e7('0x10')]);return _0xaf6fc5(_0x291c0e['error'][_0x49e7('0x10')]);}logger[_0x49e7('0xf')](_0x49e7('0x11'),_0xcf60d7,_0x291c0e[_0x49e7('0xf')][_0x49e7('0x10')]);return _0x1a933c(_0x291c0e[_0x49e7('0xf')][_0x49e7('0x10')]);}else{logger[_0x49e7('0xb')](_0x49e7('0x11'),_0xcf60d7,_0x49e7('0xc'));_0x1a933c(_0x291c0e[_0x49e7('0x12')]['message']);}})[_0x49e7('0x13')](function(_0x2fdd50){logger['error'](_0x49e7('0x11'),_0xcf60d7,_0x2fdd50);_0xaf6fc5(_0x2fdd50);});});}exports[_0x49e7('0x14')]=function(_0x531da0){var _0x346857=this;return new Promise(function(_0x30089c,_0x51bb2e){return db['MailApplication'][_0x49e7('0x15')](_0x531da0[_0x49e7('0x16')],{'raw':_0x531da0[_0x49e7('0x17')]?_0x531da0[_0x49e7('0x17')][_0x49e7('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x531da0[_0x49e7('0x17')]?_0x531da0[_0x49e7('0x17')][_0x49e7('0x19')]||null:null,'attributes':_0x531da0[_0x49e7('0x17')]?_0x531da0[_0x49e7('0x17')][_0x49e7('0x1a')]||null:null,'limit':_0x531da0[_0x49e7('0x17')]?_0x531da0[_0x49e7('0x17')][_0x49e7('0x1b')]||null:null})[_0x49e7('0xa')](function(_0x1bd264){logger[_0x49e7('0xb')](_0x49e7('0x14'),_0x531da0);logger[_0x49e7('0xd')]('UpdateMailApplication',_0x531da0,JSON[_0x49e7('0xe')](_0x1bd264));_0x30089c(_0x1bd264);})[_0x49e7('0x13')](function(_0x112af2){logger[_0x49e7('0xf')]('UpdateMailApplication',_0x112af2[_0x49e7('0x10')],_0x531da0);_0x51bb2e(_0x346857[_0x49e7('0xf')](0x1f4,_0x112af2['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index d9649a1..67d7191 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 _0x580e=['post','create','addMessage','/:id/tags','mail','/:id','mailinteraction:update','update','delete','tracked','mailinteraction:destroy','destroy','exports','express','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','index','/describe','isAuthenticated','describe','get','show','/:id/messages','getMessages','/:id/download','download'];(function(_0x19700a,_0x5d55ca){var _0x23ce5d=function(_0x4113e0){while(--_0x4113e0){_0x19700a['push'](_0x19700a['shift']());}};_0x23ce5d(++_0x5d55ca);}(_0x580e,0x1a2));var _0xe580=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x580e[_0x40a045];return _0x1a687c;};'use strict';var express=require(_0xe580('0x0'));var router=express['Router']();var auth=require(_0xe580('0x1'));var interaction=require(_0xe580('0x2'));var controller=require(_0xe580('0x3'));router['get']('/',auth['isAuthenticated'](),controller[_0xe580('0x4')]);router['get'](_0xe580('0x5'),auth[_0xe580('0x6')](),controller[_0xe580('0x7')]);router[_0xe580('0x8')]('/:id',auth[_0xe580('0x6')](),controller[_0xe580('0x9')]);router[_0xe580('0x8')](_0xe580('0xa'),auth[_0xe580('0x6')](),controller[_0xe580('0xb')]);router[_0xe580('0x8')](_0xe580('0xc'),auth[_0xe580('0x6')](),controller[_0xe580('0xd')]);router[_0xe580('0xe')]('/',auth[_0xe580('0x6')](),controller[_0xe580('0xf')]);router[_0xe580('0xe')](_0xe580('0xa'),auth[_0xe580('0x6')](),controller[_0xe580('0x10')]);router['post'](_0xe580('0x11'),auth[_0xe580('0x6')](),interaction['tracked'](_0xe580('0x12'),'mailinteraction:addtags'),controller['addTags']);router['put'](_0xe580('0x13'),auth[_0xe580('0x6')](),interaction['tracked']('mail',_0xe580('0x14')),controller[_0xe580('0x15')]);router[_0xe580('0x16')](_0xe580('0x13'),auth[_0xe580('0x6')](),interaction[_0xe580('0x17')](_0xe580('0x12'),_0xe580('0x18')),controller[_0xe580('0x19')]);router[_0xe580('0x16')]('/:id/tags',auth[_0xe580('0x6')](),controller['removeTags']);module[_0xe580('0x1a')]=router; \ No newline at end of file +var _0xf576=['../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','isAuthenticated','index','get','/describe','describe','show','/:id/messages','getMessages','download','post','create','addMessage','/:id/tags','mail','mailinteraction:addtags','addTags','/:id','tracked','update','delete','mailinteraction:destroy','removeTags','exports','Router'];(function(_0x109467,_0x1f6c9f){var _0xbecab1=function(_0x2ccd6d){while(--_0x2ccd6d){_0x109467['push'](_0x109467['shift']());}};_0xbecab1(++_0x1f6c9f);}(_0xf576,0x6b));var _0x6f57=function(_0x414778,_0x4170d1){_0x414778=_0x414778-0x0;var _0x5cee4c=_0xf576[_0x414778];return _0x5cee4c;};'use strict';var express=require('express');var router=express[_0x6f57('0x0')]();var auth=require(_0x6f57('0x1'));var interaction=require(_0x6f57('0x2'));var controller=require(_0x6f57('0x3'));router['get']('/',auth[_0x6f57('0x4')](),controller[_0x6f57('0x5')]);router[_0x6f57('0x6')](_0x6f57('0x7'),auth[_0x6f57('0x4')](),controller[_0x6f57('0x8')]);router[_0x6f57('0x6')]('/:id',auth[_0x6f57('0x4')](),controller[_0x6f57('0x9')]);router[_0x6f57('0x6')](_0x6f57('0xa'),auth[_0x6f57('0x4')](),controller[_0x6f57('0xb')]);router[_0x6f57('0x6')]('/:id/download',auth[_0x6f57('0x4')](),controller[_0x6f57('0xc')]);router[_0x6f57('0xd')]('/',auth[_0x6f57('0x4')](),controller[_0x6f57('0xe')]);router[_0x6f57('0xd')](_0x6f57('0xa'),auth[_0x6f57('0x4')](),controller[_0x6f57('0xf')]);router[_0x6f57('0xd')](_0x6f57('0x10'),auth[_0x6f57('0x4')](),interaction['tracked'](_0x6f57('0x11'),_0x6f57('0x12')),controller[_0x6f57('0x13')]);router['put'](_0x6f57('0x14'),auth[_0x6f57('0x4')](),interaction[_0x6f57('0x15')]('mail','mailinteraction:update'),controller[_0x6f57('0x16')]);router[_0x6f57('0x17')]('/:id',auth[_0x6f57('0x4')](),interaction[_0x6f57('0x15')](_0x6f57('0x11'),_0x6f57('0x18')),controller['destroy']);router[_0x6f57('0x17')]('/:id/tags',auth[_0x6f57('0x4')](),controller[_0x6f57('0x19')]);module[_0x6f57('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 73eadc4..a39ef28 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 _0x26bb=['BOOLEAN','STRING','TEXT','DATE','ENUM','out','sequelize','iconv'];(function(_0xa94f09,_0x1fa848){var _0x4b538b=function(_0x3a6c7e){while(--_0x3a6c7e){_0xa94f09['push'](_0xa94f09['shift']());}};_0x4b538b(++_0x1fa848);}(_0x26bb,0x8e));var _0xb26b=function(_0x2f7d76,_0x283285){_0x2f7d76=_0x2f7d76-0x0;var _0x2a2570=_0x26bb[_0x2f7d76];return _0x2a2570;};'use strict';var Sequelize=require(_0xb26b('0x0'));var iconv=require(_0xb26b('0x1'));module['exports']={'closed':{'type':Sequelize[_0xb26b('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xb26b('0x3')]},'secondDisposition':{'type':Sequelize[_0xb26b('0x3')]},'thirdDisposition':{'type':Sequelize[_0xb26b('0x3')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0xb26b('0x3')](0x1fe)},'to':{'type':Sequelize[_0xb26b('0x3')]},'cc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize[_0xb26b('0x4')]()},'attach':{'type':Sequelize[_0xb26b('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xb26b('0x5')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0xb26b('0x5')]},'firstMsgDirection':{'type':Sequelize[_0xb26b('0x6')]('in',_0xb26b('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb26b('0x5')]},'lastMsgDirection':{'type':Sequelize[_0xb26b('0x6')]('in',_0xb26b('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xb26b('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xa348=['STRING','TEXT','long','BOOLEAN','DATE','ENUM','out','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa348,0xb2));var _0x8a34=function(_0x472b76,_0x1ceb9e){_0x472b76=_0x472b76-0x0;var _0x251d5b=_0xa348[_0x472b76];return _0x251d5b;};'use strict';var Sequelize=require(_0x8a34('0x0'));var iconv=require('iconv');module[_0x8a34('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x8a34('0x2')]},'thirdDisposition':{'type':Sequelize[_0x8a34('0x2')]},'note':{'type':Sequelize[_0x8a34('0x2')]},'inReplyTo':{'type':Sequelize[_0x8a34('0x2')](0x1fe)},'to':{'type':Sequelize[_0x8a34('0x2')]},'cc':{'type':Sequelize[_0x8a34('0x3')](_0x8a34('0x4'))},'subject':{'type':Sequelize[_0x8a34('0x3')]()},'attach':{'type':Sequelize[_0x8a34('0x5')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x8a34('0x6')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x8a34('0x6')]},'firstMsgDirection':{'type':Sequelize[_0x8a34('0x7')]('in',_0x8a34('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8a34('0x6')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x8a34('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x8a34('0x5')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index f40b0df..1269ab6 100644 --- a/server/api/mailInteraction/mailInteraction.controller.js +++ b/server/api/mailInteraction/mailInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','Setting','enableEmailPreview','all','rows','show','params','includeAll','include','options','create','body','addMessage','ids','omit','getMessages','nolimit','MailInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','true','addTags','setTags','Tag','mailInteractionTags:save','download','join','root','server','tmp','attachments','Attachment','Attachments','subject','Messages','get','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','existsSync','readFileSync','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','util','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','defaults','socket.io-emitter','redis','./mailInteraction.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','send','Users','fullname','Tags','split','forEach','push','TagIds','MailMessage','findOne','out','-id','plainBody','lastMsgText','trimStart','catch','index','MailInteraction','rawAttributes','fieldName','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','sort','filters','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','keys','some','compact','where','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','QueryTypes','SELECT','clone','i.id','order','contactName','DESC','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgDirection','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.MailAccountId','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname'];(function(_0xa2a133,_0x4a1180){var _0xf06e5e=function(_0x480c2a){while(--_0x480c2a){_0xa2a133['push'](_0xa2a133['shift']());}};_0xf06e5e(++_0x4a1180);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x0a9e('0x3'));var path=require('path');var fs=require('fs');var _=require(_0x0a9e('0x4'));var squel=require(_0x0a9e('0x5'));var juice=require(_0x0a9e('0x6'));var Redis=require(_0x0a9e('0x7'));var qs=require(_0x0a9e('0x8'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0x0a9e('0x9'))(_0x0a9e('0xa'));var config=require(_0x0a9e('0xb'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x0a9e('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xd'))(new Redis(config[_0x0a9e('0xe')]));require(_0x0a9e('0xf'))[_0x0a9e('0x10')](socket);function respondWithStatusCode(_0xfeb75b,_0xbd1168){_0xbd1168=_0xbd1168||0xcc;return function(_0x4a4c56){if(_0x4a4c56){return _0xfeb75b['sendStatus'](_0xbd1168);}return _0xfeb75b['status'](_0xbd1168)['end']();};}function respondWithResult(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xc8;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x11')](_0x36471c)[_0x0a9e('0x12')](_0xd5b662);}};}function respondWithFilteredResult(_0x69aeb7,_0x5db4b0){return function(_0x4283ce){if(_0x4283ce){var _0x239b12=typeof _0x5db4b0[_0x0a9e('0x13')]===_0x0a9e('0x14')&&typeof _0x5db4b0[_0x0a9e('0x15')]===_0x0a9e('0x14');var _0x52a03d=_0x4283ce[_0x0a9e('0x16')];var _0x5d0880=_0x239b12?0x0:_0x5db4b0[_0x0a9e('0x13')];var _0x519dfd=_0x239b12?_0x4283ce[_0x0a9e('0x16')]:_0x5db4b0[_0x0a9e('0x13')]+_0x5db4b0['limit'];var _0x225616;if(_0x519dfd>=_0x52a03d){_0x519dfd=_0x52a03d;_0x225616=0xc8;}else{_0x225616=0xce;}_0x69aeb7['status'](_0x225616);return _0x69aeb7[_0x0a9e('0x17')](_0x0a9e('0x18'),_0x5d0880+'-'+_0x519dfd+'/'+_0x52a03d)[_0x0a9e('0x12')](_0x4283ce);}return null;};}function saveUpdates(_0x205fd6){return function(_0x31b1ca){if(_0x31b1ca){return _0x31b1ca[_0x0a9e('0x19')](_0x205fd6)[_0x0a9e('0x1a')](function(_0x20559e){return _0x20559e;});}return null;};}function removeEntity(_0x1314ae){return function(_0x112016){if(_0x112016){return _0x112016[_0x0a9e('0x1b')]()[_0x0a9e('0x1a')](function(){_0x1314ae['status'](0xcc)[_0x0a9e('0x1c')]();});}};}function handleEntityNotFound(_0x155cce){return function(_0x53682f){if(!_0x53682f){_0x155cce[_0x0a9e('0x1d')](0x194);}return _0x53682f;};}function handleError(_0x5a09ef,_0x588269){_0x588269=_0x588269||0x1f4;return function(_0x3a02e1){logger[_0x0a9e('0x1e')](_0x3a02e1[_0x0a9e('0x1f')]);if(_0x3a02e1[_0x0a9e('0x20')]){delete _0x3a02e1['name'];}_0x5a09ef[_0x0a9e('0x11')](_0x588269)[_0x0a9e('0x21')](_0x3a02e1);};}function getInteractionUsers(_0x3b45bc,_0x4d00e6){return new BPromise(function(_0x370d86,_0x42ac8f){try{if(_0x4d00e6[_0x3b45bc['id']]){_0x3b45bc[_0x0a9e('0x22')]=_['map'](_0x4d00e6[_0x3b45bc['id']],function(_0x59181e){return{'id':_0x59181e['id'],'fullname':_0x59181e[_0x0a9e('0x23')]};});}}catch(_0x3a8e58){_0x42ac8f(_0x3a8e58);}_0x370d86(_0x3b45bc);});}function getInteractionTags(_0x40c424,_0x33161b){return new BPromise(function(_0x526cf3,_0x384319){try{if(_0x40c424['TagIds']){_0x40c424[_0x0a9e('0x24')]=[];_0x40c424['TagIds'][_0x0a9e('0x25')](',')[_0x0a9e('0x26')](function(_0x25fba9){_0x40c424[_0x0a9e('0x24')][_0x0a9e('0x27')](_0x33161b[_0x25fba9]);});}delete _0x40c424[_0x0a9e('0x28')];}catch(_0x11c3b6){_0x384319(_0x11c3b6);}_0x526cf3(_0x40c424);});}function getLastMessageText(_0x14de77){return new BPromise(function(_0x5a101a,_0x3652a7){return db[_0x0a9e('0x29')][_0x0a9e('0x2a')]({'where':{'$and':[{'MailInteractionId':_0x14de77['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x0a9e('0x2b')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0x0a9e('0x2c'),'raw':!![]})[_0x0a9e('0x1a')](function(_0x1843b2){if(_0x1843b2&&_0x1843b2[_0x0a9e('0x2d')]){_0x14de77[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x1843b2[_0x0a9e('0x2d')]);}_0x5a101a(_0x14de77);})[_0x0a9e('0x30')](function(_0x1dbde2){_0x3652a7(_0x1dbde2);});});}function updateMailInteraction(_0x540530,_0x426950,_0x5d1e0e,_0x2407f9){return new BPromise(function(_0x3ae878,_0x1122db){return getInteractionUsers(_0x540530,_0x5d1e0e)[_0x0a9e('0x1a')](function(_0x25ce3a){return getInteractionTags(_0x25ce3a,_0x426950);})['then'](function(_0x66c1d2){if(_0x2407f9){_0x3ae878(getLastMessageText(_0x66c1d2));}else{_0x3ae878(_0x66c1d2);}})[_0x0a9e('0x30')](function(_0x40cb85){_0x1122db(_0x40cb85);});});}exports[_0x0a9e('0x31')]=function(_0x2b45ea,_0x409319){var _0x332d35={},_0x39e565={},_0x5583a4={'count':0x0,'rows':[]};var _0x44295a=_['map'](db[_0x0a9e('0x32')][_0x0a9e('0x33')],function(_0x2b7e7f){return{'name':_0x2b7e7f[_0x0a9e('0x34')],'type':_0x2b7e7f['type'][_0x0a9e('0x35')]};});_0x39e565[_0x0a9e('0x36')]=_[_0x0a9e('0x37')](_0x44295a,_0x0a9e('0x20'));_0x39e565['query']=_['keys'](_0x2b45ea[_0x0a9e('0x38')]);_0x39e565['filters']=_[_0x0a9e('0x39')](_0x39e565[_0x0a9e('0x36')],_0x39e565[_0x0a9e('0x38')]);_0x332d35[_0x0a9e('0x3a')]=_['intersection'](_0x39e565[_0x0a9e('0x36')],qs[_0x0a9e('0x3b')](_0x2b45ea[_0x0a9e('0x38')]['fields']));_0x332d35[_0x0a9e('0x3a')]=_0x332d35[_0x0a9e('0x3a')][_0x0a9e('0x3c')]?_0x332d35['attributes']:_0x39e565['model'];if(!_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3d')]('nolimit')){_0x332d35[_0x0a9e('0x15')]=qs[_0x0a9e('0x15')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x15')]);_0x332d35['offset']=qs['offset'](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x13')]);}_0x332d35['order']=qs[_0x0a9e('0x3e')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3e')]);_0x332d35['where']=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x40')](_0x2b45ea[_0x0a9e('0x38')],_0x39e565[_0x0a9e('0x3f')]),_0x44295a);var _0x13cb1f=[];var _0xeaa5e5=squel[_0x0a9e('0x41')]()[_0x0a9e('0x42')]('id')[_0x0a9e('0x42')](_0x0a9e('0x20'))[_0x0a9e('0x42')](_0x0a9e('0x43'))[_0x0a9e('0x44')](_0x0a9e('0x45'));var _0x37f6cc=squel['select']()['field'](_0x0a9e('0x46'))[_0x0a9e('0x42')](_0x0a9e('0x47'))[_0x0a9e('0x42')](_0x0a9e('0x48'))[_0x0a9e('0x44')](_0x0a9e('0x49'),'ui')[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'u',_0x0a9e('0x4c'));var _0x2c2cb0=squel[_0x0a9e('0x41')]()['from'](_0x0a9e('0x4d'),'i')[_0x0a9e('0x4a')](_0x0a9e('0x4e'),'c',_0x0a9e('0x4f'))[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'o',_0x0a9e('0x50'))[_0x0a9e('0x4a')]('mail_accounts','a',_0x0a9e('0x51'))['left_join'](_0x0a9e('0x52'),'me',_0x0a9e('0x53'))[_0x0a9e('0x4a')]('mail_interaction_has_tags','it',_0x0a9e('0x54'))[_0x0a9e('0x4a')](_0x0a9e('0x45'),'t',_0x0a9e('0x55'));var _0x45c845=squel[_0x0a9e('0x56')]();var _0x45bf7f=[];var _0x5bbcde=squel[_0x0a9e('0x56')]();var _0x1bde3c;if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x57')]){_0x1bde3c=as[_0x0a9e('0x58')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x57')]);var _0x19383e=_0x1bde3c[_0x0a9e('0x59')];for(var _0x58a5c2=0x0;_0x58a5c2<_0x1bde3c[_0x0a9e('0x5a')][_0x0a9e('0x3c')];_0x58a5c2++){var _0x4f7240=_0x1bde3c['conditions'][_0x58a5c2];var _0x5ddf84='i';var _0x1adfee=_[_0x0a9e('0x5b')](_0x44295a,[_0x0a9e('0x20'),_0x4f7240[_0x0a9e('0x42')]]);if(!_0x1adfee){switch(_0x4f7240[_0x0a9e('0x42')]){case _0x0a9e('0x5c'):if(_0x4f7240[_0x0a9e('0x5d')]==0x1){_0x2c2cb0[_0x0a9e('0x5e')]('`'+_0x4f7240['field']+'`\x20=\x200');}else{_0x2c2cb0['having']('`'+_0x4f7240[_0x0a9e('0x42')]+_0x0a9e('0x5f'));}break;case _0x0a9e('0x60'):if(_0x4f7240['operator']===_0x0a9e('0x61')){if(_0x4f7240[_0x0a9e('0x5d')]['split']('\x20')['length']>0x1){_0x45c845[_0x19383e](_0x0a9e('0x62'),qs['getFullTextValue'](_0x4f7240[_0x0a9e('0x5d')]),null);}else{var _0x4c3845='%'+_0x4f7240[_0x0a9e('0x5d')]+'%';_0x45c845[_0x19383e](_0x0a9e('0x63'),_0x4c3845,_0x4c3845,_0x4c3845);}}else{_0x1adfee=_[_0x0a9e('0x5b')](_0x44295a,['name',_0x0a9e('0x64')]);_0x4f7240[_0x0a9e('0x42')]='ContactId';_0x2244d6=as['buildExpression'](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6[_0x0a9e('0x66')],_0x2244d6['value'][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}break;case'Tag':var _0xe22ccc=_0x4f7240['value']['split'](',')['map'](function(_0x2da03c){return Number(_0x2da03c);});_0xe22ccc['forEach'](function(_0x2f7092){_0x5bbcde['or'](_0x0a9e('0x68'),'%,'+_0x2f7092+',%');});_0x45bf7f=_[_0x0a9e('0x69')](_0x45bf7f,_0xe22ccc);break;case _0x0a9e('0x6a'):if(_0x4f7240[_0x0a9e('0x6b')]===_0x0a9e('0x61')){_0x45c845[_0x19383e](_0x0a9e('0x6c'),'%'+_0x4f7240[_0x0a9e('0x5d')]+'%',null);}else{_0x1adfee=_['find'](_0x44295a,[_0x0a9e('0x20'),_0x0a9e('0x6d')]);_0x4f7240[_0x0a9e('0x42')]=_0x0a9e('0x6d');_0x2244d6=as[_0x0a9e('0x6e')](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6['text'],_0x2244d6[_0x0a9e('0x5d')][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}break;case'plainBody':_0x2244d6=as[_0x0a9e('0x6e')]('me',null,_0x4f7240);_0x45c845[_0x19383e](_0x2244d6['text'],_0x2244d6['value']['start'],_0x2244d6[_0x0a9e('0x5d')]['end']);break;}}else{var _0x2244d6=as[_0x0a9e('0x6e')](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6[_0x0a9e('0x66')],_0x2244d6[_0x0a9e('0x5d')][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}}}else{var _0x5854cc=_(_0x2b45ea[_0x0a9e('0x38')])[_0x0a9e('0x6f')]()[_0x0a9e('0x37')](function(_0x5adf8f){return _[_0x0a9e('0x70')](_0x44295a,[_0x0a9e('0x20'),_0x5adf8f])?_0x5adf8f:undefined;})[_0x0a9e('0x71')]()[_0x0a9e('0x5d')]();if(!_['isEmpty'](_0x5854cc)){_0x5854cc[_0x0a9e('0x26')](function(_0xe05a5a){if(_0xe05a5a==='MailAccountId'){_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x73'),[][_0x0a9e('0x74')](_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]));}else if(_0xe05a5a===_0x0a9e('0x75')){var _0x4d4a35=JSON[_0x0a9e('0x76')](_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a])[_0x0a9e('0x77')];var _0x47bb43=JSON[_0x0a9e('0x76')](_0x2b45ea['query'][_0xe05a5a])['$lte'];_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x78'),_0x4d4a35,_0x47bb43);}else{if(_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]===_0x0a9e('0x79')){_0x2c2cb0[_0x0a9e('0x72')]('i.'+_0xe05a5a+_0x0a9e('0x7a'));}else{_0x2c2cb0[_0x0a9e('0x72')]('i.'+_0xe05a5a+_0x0a9e('0x7b'),_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]);}}});}if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x7c')]){if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x7c')]==0x1){_0x2c2cb0[_0x0a9e('0x5e')](_0x0a9e('0x7d'));}else{_0x2c2cb0[_0x0a9e('0x5e')](_0x0a9e('0x7e'));}}if(_0x2b45ea[_0x0a9e('0x38')]['tag']){_0x45bf7f=_[_0x0a9e('0x7f')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x80')])?_0x2b45ea['query'][_0x0a9e('0x80')]:new Array(_0x2b45ea[_0x0a9e('0x38')]['tag']);_0x45bf7f[_0x0a9e('0x26')](function(_0x56e31e){_0x5bbcde['or'](_0x0a9e('0x68'),'%,'+_0x56e31e+',%');});}if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x81')]){var _0x4a43a8=_0x2b45ea['query']['filter'][_0x0a9e('0x82')]('\x5c','\x5c\x5c')[_0x0a9e('0x82')](/'/g,'\x27\x27');if(qs[_0x0a9e('0x83')](_0x4a43a8)){_0x45c845['or'](_0x0a9e('0x84'),_0x4a43a8+'%');}else if(qs[_0x0a9e('0x85')](_0x4a43a8)){_0x45c845['or'](_0x0a9e('0x86'),_0x4a43a8+'%');}else{_0x45c845['or'](_0x0a9e('0x87'),qs[_0x0a9e('0x88')](_0x4a43a8))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0a9e('0x88')](_0x4a43a8));}}}_0x2c2cb0[_0x0a9e('0x72')](_0x45c845);_0x2c2cb0[_0x0a9e('0x89')]('i.id');var _0x2bdc44={'type':db['Sequelize'][_0x0a9e('0x8a')][_0x0a9e('0x8b')],'raw':!![]};var _0x4c46c1=_0x2c2cb0[_0x0a9e('0x8c')]();_0x4c46c1[_0x0a9e('0x42')](_0x0a9e('0x8d'));_0x4c46c1[_0x0a9e('0x42')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x0a9e('0x5c'));if(_0x332d35[_0x0a9e('0x8e')]){_0x332d35[_0x0a9e('0x8e')][_0x0a9e('0x26')](function(_0x5b7fc3){var _0x109ccb=_0x5b7fc3[0x0]===_0x0a9e('0x8f')?_0x5b7fc3[0x0]:'i.'+_0x5b7fc3[0x0];_0x2c2cb0[_0x0a9e('0x8e')](_0x109ccb,_0x5b7fc3[0x1]===_0x0a9e('0x90')?![]:!![]);});}if(!_['isEmpty'](_0x45bf7f)){_0x2c2cb0[_0x0a9e('0x5e')](_0x5bbcde);_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x91'),_0x45bf7f);}BPromise[_0x0a9e('0x92')]()[_0x0a9e('0x1a')](function(){if(!_0x1bde3c){if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x93')])return;_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x94'));_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x94'));return;}if(_0x2b45ea[_0x0a9e('0x95')][_0x0a9e('0x96')]!==_0x0a9e('0x97'))return;return _0x2b45ea['user'][_0x0a9e('0x98')]({'attributes':['id'],'raw':!![]})[_0x0a9e('0x1a')](function(_0xc599b3){if(_['isEmpty'](_0xc599b3)){_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x99'));_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x99'));}else{_0x4c46c1['where']('i.MailAccountId\x20IN\x20?',_[_0x0a9e('0x37')](_0xc599b3,'id'));_0x2c2cb0[_0x0a9e('0x72')]('i.MailAccountId\x20IN\x20?',_[_0x0a9e('0x37')](_0xc599b3,'id'));}});})['then'](function(){if(_0x2b45ea[_0x0a9e('0x95')][_0x0a9e('0x96')]==='agent'&&!_0x1bde3c&&!_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x93')])return[];return db[_0x0a9e('0x9a')][_0x0a9e('0x38')](_0x4c46c1[_0x0a9e('0x9b')](),_0x2bdc44);})[_0x0a9e('0x1a')](function(_0x444f1f){_0x5583a4['count']=_0x444f1f[_0x0a9e('0x3c')];if(_0x5583a4[_0x0a9e('0x16')]===0x0)return[];return db[_0x0a9e('0x9a')][_0x0a9e('0x38')](_0xeaa5e5['toString'](),_0x2bdc44)[_0x0a9e('0x1a')](function(_0xf0db1){_0x13cb1f=_['keyBy'](_0xf0db1,'id');_0x2bdc44=_[_0x0a9e('0x9c')](_0x2bdc44,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3b')]){_0x332d35[_0x0a9e('0x3a')][_0x0a9e('0x26')](function(_0x5af453){_0x2c2cb0['field']('i.'+_0x5af453);});}else{_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0x9d'),_0x0a9e('0x5c'));_0x2c2cb0['field'](_0x0a9e('0x9e'),_0x0a9e('0x9f'));_0x2c2cb0['field']('a.mandatoryDisposition',_0x0a9e('0xa0'));_0x2c2cb0['field']('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0x8d'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa1'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa2'));_0x2c2cb0['field'](_0x0a9e('0xa3'));_0x2c2cb0['field'](_0x0a9e('0xa4'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa5'));_0x2c2cb0[_0x0a9e('0x42')]('i.lastMsgAt');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa6'));_0x2c2cb0[_0x0a9e('0x42')]('i.subject');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa7'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa8'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa9'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xaa'));_0x2c2cb0['field'](_0x0a9e('0xab'));_0x2c2cb0[_0x0a9e('0x42')]('i.ContactId');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xac'));_0x2c2cb0[_0x0a9e('0x42')]('i.UserId');_0x2c2cb0[_0x0a9e('0x42')]('c.firstName',_0x0a9e('0xad'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xae'),_0x0a9e('0xaf'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb0'),_0x0a9e('0xb1'));_0x2c2cb0[_0x0a9e('0x42')]('c.phone',_0x0a9e('0xb2'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb3'),_0x0a9e('0xb4'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb5'),_0x0a9e('0xb6'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb7'),_0x0a9e('0xb8'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb9'),_0x0a9e('0xba'));_0x2c2cb0['field'](_0x0a9e('0xbb'),_0x0a9e('0x28'));}if(_0x332d35[_0x0a9e('0x15')])_0x2c2cb0[_0x0a9e('0x15')](_0x332d35[_0x0a9e('0x15')]);if(_0x332d35['offset'])_0x2c2cb0[_0x0a9e('0x13')](_0x332d35[_0x0a9e('0x13')]);return db['sequelize'][_0x0a9e('0x38')](_0x2c2cb0['toString'](),_0x2bdc44);})[_0x0a9e('0x1a')](function(_0x27041d){if(_0x27041d[_0x0a9e('0x3c')]>0x0)_0x37f6cc[_0x0a9e('0x72')]('ui.MailInteractionId\x20IN\x20?',_[_0x0a9e('0x37')](_0x27041d,'id'));return db['sequelize'][_0x0a9e('0x38')](_0x37f6cc[_0x0a9e('0x9b')](),_0x2bdc44)['then'](function(_0x231c6a){var _0x63c9f7=_[_0x0a9e('0xbc')](_0x231c6a,'MailInteractionId');var _0x4c788f=[];return db[_0x0a9e('0xbd')][_0x0a9e('0x2a')]({'attributes':[_0x0a9e('0xbe')],'raw':!![]})[_0x0a9e('0x1a')](function(_0x3f2f40){var _0x2450a8=_0x3f2f40[_0x0a9e('0xbe')];_0x27041d[_0x0a9e('0x26')](function(_0x3f8124){_0x4c788f['push'](updateMailInteraction(_0x3f8124,_0x13cb1f,_0x63c9f7,_0x2450a8));});return BPromise[_0x0a9e('0xbf')](_0x4c788f);});});});})['then'](function(_0x287324){_0x5583a4[_0x0a9e('0xc0')]=_0x287324;return _0x5583a4;})[_0x0a9e('0x1a')](respondWithFilteredResult(_0x409319,_0x332d35))[_0x0a9e('0x30')](handleError(_0x409319,null));};exports[_0x0a9e('0xc1')]=function(_0x4e7273,_0x436313){var _0x4667bf={'raw':![],'where':{'id':_0x4e7273[_0x0a9e('0xc2')]['id']}},_0x2791c5={};_0x2791c5[_0x0a9e('0x36')]=_['keys'](db['MailInteraction'][_0x0a9e('0x33')]);_0x2791c5['query']=_[_0x0a9e('0x6f')](_0x4e7273[_0x0a9e('0x38')]);_0x2791c5[_0x0a9e('0x3f')]=_[_0x0a9e('0x39')](_0x2791c5[_0x0a9e('0x36')],_0x2791c5[_0x0a9e('0x38')]);_0x4667bf['attributes']=_['intersection'](_0x2791c5[_0x0a9e('0x36')],qs['fields'](_0x4e7273[_0x0a9e('0x38')]['fields']));_0x4667bf[_0x0a9e('0x3a')]=_0x4667bf['attributes']['length']?_0x4667bf[_0x0a9e('0x3a')]:_0x2791c5[_0x0a9e('0x36')];if(_0x4e7273['query'][_0x0a9e('0xc3')]){_0x4667bf[_0x0a9e('0xc4')]=[{'all':!![]}];}_0x4667bf=_[_0x0a9e('0x9c')]({},_0x4667bf,_0x4e7273[_0x0a9e('0xc5')]);return db[_0x0a9e('0x32')]['find'](_0x4667bf)['then'](handleEntityNotFound(_0x436313,null))[_0x0a9e('0x1a')](respondWithResult(_0x436313,null))[_0x0a9e('0x30')](handleError(_0x436313,null));};exports[_0x0a9e('0xc6')]=function(_0x24beb6,_0x59303b){return db['MailInteraction'][_0x0a9e('0xc6')](_0x24beb6[_0x0a9e('0xc7')],{})['then'](respondWithResult(_0x59303b,0xc9))[_0x0a9e('0x30')](handleError(_0x59303b,null));};exports[_0x0a9e('0x19')]=function(_0xcacabb,_0x2427d5){if(_0xcacabb[_0x0a9e('0xc7')]['id']){delete _0xcacabb[_0x0a9e('0xc7')]['id'];}return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0xcacabb[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x2427d5,null))['then'](saveUpdates(_0xcacabb[_0x0a9e('0xc7')],null))[_0x0a9e('0x1a')](respondWithResult(_0x2427d5,null))[_0x0a9e('0x30')](handleError(_0x2427d5,null));};exports[_0x0a9e('0x1b')]=function(_0x1d0b02,_0x547e37){return db['MailInteraction'][_0x0a9e('0x5b')]({'where':{'id':_0x1d0b02[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x547e37,null))[_0x0a9e('0x1a')](removeEntity(_0x547e37,null))[_0x0a9e('0x30')](handleError(_0x547e37,null));};exports['describe']=function(_0x1339d0,_0x3c775a){return db[_0x0a9e('0x32')]['describe']()[_0x0a9e('0x1a')](respondWithResult(_0x3c775a,null))['catch'](handleError(_0x3c775a,null));};exports[_0x0a9e('0xc8')]=function(_0x4799d4,_0x25b745){return db[_0x0a9e('0x29')][_0x0a9e('0x5b')]({'where':{'id':_0x4799d4['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x25b745,null))['then'](function(_0x4383da){if(_0x4383da){return _0x4383da[_0x0a9e('0xc8')](_0x4799d4[_0x0a9e('0xc7')][_0x0a9e('0xc9')],_[_0x0a9e('0xca')](_0x4799d4[_0x0a9e('0xc7')],[_0x0a9e('0xc9'),'id'])||{});}})[_0x0a9e('0x1a')](respondWithResult(_0x25b745,null))[_0x0a9e('0x30')](handleError(_0x25b745,null));};exports[_0x0a9e('0xcb')]=function(_0x4262d0,_0xc876d4){var _0x2415fe={'raw':![],'where':{}};var _0x399def={};var _0x98c62c={'count':0x0,'rows':[]};return db[_0x0a9e('0x32')]['findOne']({'where':{'id':_0x4262d0['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0xc876d4,null))['then'](function(_0x1d999b){if(_0x1d999b){_0x399def[_0x0a9e('0x36')]=_['keys'](db[_0x0a9e('0x29')][_0x0a9e('0x33')]);_0x399def[_0x0a9e('0x38')]=_[_0x0a9e('0x6f')](_0x4262d0['query']);_0x399def[_0x0a9e('0x3f')]=_[_0x0a9e('0x39')](_0x399def[_0x0a9e('0x36')],_0x399def[_0x0a9e('0x38')]);_0x2415fe['attributes']=_[_0x0a9e('0x39')](_0x399def[_0x0a9e('0x36')],qs[_0x0a9e('0x3b')](_0x4262d0['query'][_0x0a9e('0x3b')]));_0x2415fe[_0x0a9e('0x3a')]=_0x2415fe[_0x0a9e('0x3a')]['length']?_0x2415fe[_0x0a9e('0x3a')]:_0x399def[_0x0a9e('0x36')];if(!_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x3d')](_0x0a9e('0xcc'))){_0x2415fe['limit']=qs[_0x0a9e('0x15')](_0x4262d0[_0x0a9e('0x38')]['limit']);_0x2415fe[_0x0a9e('0x13')]=qs[_0x0a9e('0x13')](_0x4262d0[_0x0a9e('0x38')]['offset']);}_0x2415fe['order']=qs['sort'](_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x3e')]);_0x2415fe['where']=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x40')](_0x4262d0[_0x0a9e('0x38')],_0x399def['filters']));_0x2415fe[_0x0a9e('0x72')][_0x0a9e('0xcd')]=_0x1d999b['id'];if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x81')]){_0x2415fe[_0x0a9e('0x72')]=_[_0x0a9e('0x9c')](_0x2415fe[_0x0a9e('0x72')],{'$or':_[_0x0a9e('0x37')](_0x2415fe[_0x0a9e('0x3a')],function(_0x5a1848){var _0x43c397={};_0x43c397[_0x5a1848]={'$like':'%'+_0x4262d0['query'][_0x0a9e('0x81')]+'%'};return _0x43c397;})});}if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x77')]){var _0x3cf222=_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x77')]['split'](',');var _0x1a0314={};_0x1a0314[_0x3cf222[0x0]]={'$gte':moment(_0x3cf222[0x1])[_0x0a9e('0xce')](_0x0a9e('0xcf'))};_0x2415fe[_0x0a9e('0x72')]=_['merge'](_0x2415fe[_0x0a9e('0x72')],_0x1a0314);}_0x2415fe=_[_0x0a9e('0x9c')]({},_0x2415fe,_0x4262d0[_0x0a9e('0xc5')]);return db[_0x0a9e('0x29')][_0x0a9e('0x16')]({'where':_0x2415fe[_0x0a9e('0x72')]})[_0x0a9e('0x1a')](function(_0x25931e){_0x98c62c[_0x0a9e('0x16')]=_0x25931e;if(_0x4262d0[_0x0a9e('0x38')]['includeAll']){_0x2415fe[_0x0a9e('0xc4')]=[{'all':!![]}];}return db[_0x0a9e('0x29')][_0x0a9e('0xd0')](_0x2415fe);})[_0x0a9e('0x1a')](function(_0xea8bd1){if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0xd1')]===_0x0a9e('0xd2')){for(var _0x566b90=0x0;_0x566b90<_0xea8bd1[_0x0a9e('0x3c')];_0x566b90++){_0xea8bd1[_0x566b90][_0x0a9e('0xc7')]=juice(_0xea8bd1[_0x566b90][_0x0a9e('0xc7')]);}}_0x98c62c['rows']=_0xea8bd1;return _0x98c62c;});}})[_0x0a9e('0x1a')](respondWithFilteredResult(_0xc876d4,_0x2415fe))[_0x0a9e('0x30')](handleError(_0xc876d4,null));};exports[_0x0a9e('0xd3')]=function(_0x97d5b5,_0x370b5e){return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x97d5b5[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x370b5e,null))[_0x0a9e('0x1a')](function(_0x5a7dad){if(_0x5a7dad){return _0x5a7dad[_0x0a9e('0xd4')](_0x97d5b5[_0x0a9e('0xc7')][_0x0a9e('0xc9')],_[_0x0a9e('0xca')](_0x97d5b5[_0x0a9e('0xc7')],[_0x0a9e('0xc9'),'id'])||{})['spread'](function(){return db[_0x0a9e('0xd5')]['findAll']({'attributes':['id','name','color'],'where':{'id':_0x97d5b5[_0x0a9e('0xc7')][_0x0a9e('0xc9')]}});})[_0x0a9e('0x1a')](function(_0x2a07d0){socket['emit'](_0x0a9e('0xd6'),{'id':Number(_0x97d5b5[_0x0a9e('0xc2')]['id']),'tags':_0x2a07d0||[]});return{'id':Number(_0x97d5b5[_0x0a9e('0xc2')]['id']),'tags':_0x2a07d0||[]};});}})[_0x0a9e('0x1a')](respondWithResult(_0x370b5e,null))[_0x0a9e('0x30')](handleError(_0x370b5e,null));};exports['removeTags']=function(_0x57b1b1,_0x9484c8){return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x57b1b1['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x9484c8,null))[_0x0a9e('0x1a')](function(_0x422f0a){if(_0x422f0a){return _0x422f0a['removeTags'](_0x57b1b1[_0x0a9e('0x38')][_0x0a9e('0xc9')]);}})[_0x0a9e('0x1a')](respondWithStatusCode(_0x9484c8,null))['catch'](handleError(_0x9484c8,null));};exports[_0x0a9e('0xd7')]=function(_0x336b30,_0x3b7213){var _0x549e03=moment()['unix']()['toString']();var _0x3b04fd=path[_0x0a9e('0xd8')](config[_0x0a9e('0xd9')],_0x0a9e('0xda'),'files',_0x0a9e('0xdb'));var _0x532424=path[_0x0a9e('0xd8')](config[_0x0a9e('0xd9')],_0x0a9e('0xda'),'files',_0x0a9e('0xdc'));var _0x33a26c=path[_0x0a9e('0xd8')](_0x3b04fd,_0x549e03);var _0x580dd6=util[_0x0a9e('0xce')]('transcript-%d-%s.zip',_0x336b30[_0x0a9e('0xc2')]['id'],_0x549e03);var _0x5c57e1=path[_0x0a9e('0xd8')](_0x3b04fd,_0x580dd6);var _0x57b7d4=[];if(_0x336b30[_0x0a9e('0x38')][_0x0a9e('0xdc')]){_0x57b7d4[_0x0a9e('0x27')]({'model':db[_0x0a9e('0xdd')],'as':_0x0a9e('0xde'),'raw':!![]});}var _0x251dd9=[{'model':db[_0x0a9e('0x29')],'as':'Messages','attributes':['id',_0x0a9e('0xc7'),_0x0a9e('0x44'),'to','cc','bcc',_0x0a9e('0xdf'),_0x0a9e('0x75')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x57b7d4}];return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x336b30[_0x0a9e('0xc2')]['id']},'include':_0x251dd9})['then'](handleEntityNotFound(_0x3b7213,null))[_0x0a9e('0x1a')](function(_0xf49ed4){if(_0xf49ed4&&_0xf49ed4[_0x0a9e('0xe0')]){var _0x3f0d64=_0xf49ed4[_0x0a9e('0xe1')]({'plain':!![]});fs[_0x0a9e('0xe2')](_0x33a26c);return BPromise[_0x0a9e('0xe3')](_0x3f0d64[_0x0a9e('0xe0')],function(_0x22767f,_0x426c3c){var _0x56e148={'from':_0x22767f[_0x0a9e('0x44')],'to':_0x22767f['to'],'subject':_0x22767f['subject'],'html':_0x22767f[_0x0a9e('0xc7')],'headers':{'Date':moment(_0x22767f[_0x0a9e('0x75')])[_0x0a9e('0xce')](_0x0a9e('0xe4'))},'attachments':[]};if(_0x22767f['cc']){_0x56e148[_0x0a9e('0xe5')]['Cc']=_0x22767f['cc'];}if(_0x22767f[_0x0a9e('0xe6')]){_0x56e148['headers'][_0x0a9e('0xe7')]=_0x22767f[_0x0a9e('0xe6')];}return new BPromise(function(_0x2977a7,_0x55a599){if(_0x22767f[_0x0a9e('0xde')]){for(var _0x402544=0x0;_0x402544<_0x22767f[_0x0a9e('0xde')][_0x0a9e('0x3c')];_0x402544++){var _0x31e1e0=_0x22767f[_0x0a9e('0xde')][_0x402544];var _0x1e93f5=path['join'](_0x532424,_0x31e1e0[_0x0a9e('0xe8')]);if(fs[_0x0a9e('0xe9')](_0x1e93f5)){_0x56e148[_0x0a9e('0xdc')][_0x0a9e('0x27')]({'name':_0x31e1e0[_0x0a9e('0x20')],'contentType':_0x31e1e0[_0x0a9e('0x65')],'data':fs[_0x0a9e('0xea')](_0x1e93f5)});}}}emlformat['build'](_0x56e148,function(_0x5c8720,_0x10aa22){if(_0x5c8720)return _0x55a599(_0x5c8720);fs[_0x0a9e('0xeb')](path[_0x0a9e('0xd8')](_0x33a26c,util[_0x0a9e('0xce')](_0x0a9e('0xec'),_0x426c3c)),_0x10aa22);return _0x2977a7(_0x10aa22);});});})[_0x0a9e('0x1a')](function(){return new BPromise(function(_0x609711,_0x584854){zipdir(_0x33a26c,{'saveTo':_0x5c57e1},function(_0x39ea62,_0x1d7fc4){if(_0x39ea62)return _0x584854(_0x39ea62);return _0x609711(_0x1d7fc4);});})[_0x0a9e('0x1a')](function(){return new BPromise(function(_0x2675a5,_0x1b1757){rimraf(_0x33a26c,function(_0x3c6082){if(_0x3c6082)_0x1b1757(_0x3c6082);return _0x2675a5();});});})[_0x0a9e('0x1a')](function(){return _0x3b7213['download'](_0x5c57e1,_0x580dd6,function(_0x311288){if(!_0x311288)fs[_0x0a9e('0xed')](_0x5c57e1);});});});}else{return _0x3b7213[_0x0a9e('0x1d')](0xc8);}})['catch'](handleError(_0x3b7213,null));}; \ No newline at end of file +var _0xb10b=['Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','findOne','enableEmailPreview','show','params','rawAttributes','includeAll','include','merge','options','create','body','describe','addMessage','ids','omit','getMessages','nolimit','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','rows','spread','emit','mailInteractionTags:save','removeTags','download','unix','join','server','tmp','root','files','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','subject','get','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','existsSync','build','message%d.eml','unlinkSync','eml-format','zip-dir','moment','bluebird','path','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','error','stack','name','send','fullname','TagIds','Tags','split','forEach','push','MailMessage','out','-id','trimStart','plainBody','catch','index','map','MailInteraction','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','field','color','tools_tags','u.id','ui.MailInteractionId','from','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','mail_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','length','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','some','compact','isEmpty','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','isEmail','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','role','getMailAccounts','i.MailAccountId\x20IS\x20NULL','agent','toString','sequelize','keyBy','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.createdAt','i.updatedAt','i.closed','i.attach','i.lastMsgAt','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.ContactId','i.MailAccountId','Contact.firstName','c.email'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0xb10b,0x12a));var _0xbb10=function(_0x430524,_0x23b611){_0x430524=_0x430524-0x0;var _0x3a726d=_0xb10b[_0x430524];return _0x3a726d;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var BPromise=require(_0xbb10('0x3'));var util=require('util');var path=require(_0xbb10('0x4'));var fs=require('fs');var _=require(_0xbb10('0x5'));var squel=require(_0xbb10('0x6'));var juice=require(_0xbb10('0x7'));var Redis=require(_0xbb10('0x8'));var qs=require(_0xbb10('0x9'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0xbb10('0xa'))(_0xbb10('0xb'));var config=require('../../config/environment');var db=require(_0xbb10('0xc'))['db'];config[_0xbb10('0xd')]=_[_0xbb10('0xe')](config[_0xbb10('0xd')],{'host':_0xbb10('0xf'),'port':0x18eb});var socket=require(_0xbb10('0x10'))(new Redis(config[_0xbb10('0xd')]));require(_0xbb10('0x11'))['register'](socket);function respondWithStatusCode(_0x4e47f8,_0x20bd61){_0x20bd61=_0x20bd61||0xcc;return function(_0x118a74){if(_0x118a74){return _0x4e47f8[_0xbb10('0x12')](_0x20bd61);}return _0x4e47f8['status'](_0x20bd61)[_0xbb10('0x13')]();};}function respondWithResult(_0x5be7e0,_0x44fb19){_0x44fb19=_0x44fb19||0xc8;return function(_0x916a32){if(_0x916a32){return _0x5be7e0[_0xbb10('0x14')](_0x44fb19)[_0xbb10('0x15')](_0x916a32);}};}function respondWithFilteredResult(_0x442548,_0x147230){return function(_0x58a612){if(_0x58a612){var _0x26e021=typeof _0x147230[_0xbb10('0x16')]===_0xbb10('0x17')&&typeof _0x147230[_0xbb10('0x18')]===_0xbb10('0x17');var _0x2f2ebf=_0x58a612[_0xbb10('0x19')];var _0x36b5e8=_0x26e021?0x0:_0x147230[_0xbb10('0x16')];var _0x2b184e=_0x26e021?_0x58a612['count']:_0x147230[_0xbb10('0x16')]+_0x147230[_0xbb10('0x18')];var _0x133ac2;if(_0x2b184e>=_0x2f2ebf){_0x2b184e=_0x2f2ebf;_0x133ac2=0xc8;}else{_0x133ac2=0xce;}_0x442548[_0xbb10('0x14')](_0x133ac2);return _0x442548[_0xbb10('0x1a')](_0xbb10('0x1b'),_0x36b5e8+'-'+_0x2b184e+'/'+_0x2f2ebf)[_0xbb10('0x15')](_0x58a612);}return null;};}function saveUpdates(_0x30efc6){return function(_0xbf2906){if(_0xbf2906){return _0xbf2906[_0xbb10('0x1c')](_0x30efc6)['then'](function(_0x5ff0cf){return _0x5ff0cf;});}return null;};}function removeEntity(_0x19f48d){return function(_0x388fab){if(_0x388fab){return _0x388fab[_0xbb10('0x1d')]()[_0xbb10('0x1e')](function(){_0x19f48d[_0xbb10('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12f888){return function(_0x12ef77){if(!_0x12ef77){_0x12f888['sendStatus'](0x194);}return _0x12ef77;};}function handleError(_0x4c4b0d,_0x8e2b97){_0x8e2b97=_0x8e2b97||0x1f4;return function(_0x311abe){logger[_0xbb10('0x1f')](_0x311abe[_0xbb10('0x20')]);if(_0x311abe[_0xbb10('0x21')]){delete _0x311abe[_0xbb10('0x21')];}_0x4c4b0d[_0xbb10('0x14')](_0x8e2b97)[_0xbb10('0x22')](_0x311abe);};}function getInteractionUsers(_0x7f2377,_0x395404){return new BPromise(function(_0x3ba6cd,_0x26ad93){try{if(_0x395404[_0x7f2377['id']]){_0x7f2377['Users']=_['map'](_0x395404[_0x7f2377['id']],function(_0x4fb5e0){return{'id':_0x4fb5e0['id'],'fullname':_0x4fb5e0[_0xbb10('0x23')]};});}}catch(_0x3c5ae7){_0x26ad93(_0x3c5ae7);}_0x3ba6cd(_0x7f2377);});}function getInteractionTags(_0x2c89b9,_0x4e25ff){return new BPromise(function(_0x2fdde9,_0x24d586){try{if(_0x2c89b9[_0xbb10('0x24')]){_0x2c89b9[_0xbb10('0x25')]=[];_0x2c89b9[_0xbb10('0x24')][_0xbb10('0x26')](',')[_0xbb10('0x27')](function(_0x4aabb9){_0x2c89b9[_0xbb10('0x25')][_0xbb10('0x28')](_0x4e25ff[_0x4aabb9]);});}delete _0x2c89b9[_0xbb10('0x24')];}catch(_0x2e0249){_0x24d586(_0x2e0249);}_0x2fdde9(_0x2c89b9);});}function getLastMessageText(_0x1d30aa){return new BPromise(function(_0x2ff4c1,_0x5d5c80){return db[_0xbb10('0x29')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x1d30aa['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xbb10('0x2a')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0xbb10('0x2b'),'raw':!![]})[_0xbb10('0x1e')](function(_0x1b59f9){if(_0x1b59f9&&_0x1b59f9['plainBody']){_0x1d30aa['lastMsgText']=_[_0xbb10('0x2c')](_0x1b59f9[_0xbb10('0x2d')]);}_0x2ff4c1(_0x1d30aa);})['catch'](function(_0x359ad4){_0x5d5c80(_0x359ad4);});});}function updateMailInteraction(_0x37dde7,_0x2f653f,_0x1c0b57,_0x37a83f){return new BPromise(function(_0x138bc6,_0xf85197){return getInteractionUsers(_0x37dde7,_0x1c0b57)['then'](function(_0x25acb3){return getInteractionTags(_0x25acb3,_0x2f653f);})[_0xbb10('0x1e')](function(_0x441d15){if(_0x37a83f){_0x138bc6(getLastMessageText(_0x441d15));}else{_0x138bc6(_0x441d15);}})[_0xbb10('0x2e')](function(_0xfb2c5e){_0xf85197(_0xfb2c5e);});});}exports[_0xbb10('0x2f')]=function(_0x188cbd,_0x10202c){var _0x3c8d7d={},_0x56943c={},_0x2b5352={'count':0x0,'rows':[]};var _0x150107=_[_0xbb10('0x30')](db[_0xbb10('0x31')]['rawAttributes'],function(_0x111762){return{'name':_0x111762['fieldName'],'type':_0x111762['type'][_0xbb10('0x32')]};});_0x56943c[_0xbb10('0x33')]=_[_0xbb10('0x30')](_0x150107,_0xbb10('0x21'));_0x56943c[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x188cbd['query']);_0x56943c[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x56943c['model'],_0x56943c['query']);_0x3c8d7d['attributes']=_[_0xbb10('0x37')](_0x56943c[_0xbb10('0x33')],qs[_0xbb10('0x38')](_0x188cbd['query'][_0xbb10('0x38')]));_0x3c8d7d[_0xbb10('0x39')]=_0x3c8d7d[_0xbb10('0x39')]['length']?_0x3c8d7d[_0xbb10('0x39')]:_0x56943c[_0xbb10('0x33')];if(!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3a')]('nolimit')){_0x3c8d7d[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0x188cbd['query'][_0xbb10('0x18')]);_0x3c8d7d[_0xbb10('0x16')]=qs[_0xbb10('0x16')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x16')]);}_0x3c8d7d[_0xbb10('0x3b')]=qs['sort'](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x3c8d7d[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_['pick'](_0x188cbd[_0xbb10('0x34')],_0x56943c[_0xbb10('0x36')]),_0x150107);var _0x23dc18=[];var _0x403beb=squel['select']()[_0xbb10('0x3e')]('id')[_0xbb10('0x3e')]('name')['field'](_0xbb10('0x3f'))['from'](_0xbb10('0x40'));var _0x180933=squel['select']()[_0xbb10('0x3e')](_0xbb10('0x41'))[_0xbb10('0x3e')]('u.fullname')[_0xbb10('0x3e')](_0xbb10('0x42'))[_0xbb10('0x43')](_0xbb10('0x44'),'ui')[_0xbb10('0x45')](_0xbb10('0x46'),'u',_0xbb10('0x47'));var _0x3efa96=squel[_0xbb10('0x48')]()[_0xbb10('0x43')](_0xbb10('0x49'),'i')[_0xbb10('0x45')]('cm_contacts','c',_0xbb10('0x4a'))[_0xbb10('0x45')]('users','o',_0xbb10('0x4b'))[_0xbb10('0x45')](_0xbb10('0x4c'),'a',_0xbb10('0x4d'))[_0xbb10('0x45')](_0xbb10('0x4e'),'me',_0xbb10('0x4f'))['left_join']('mail_interaction_has_tags','it',_0xbb10('0x50'))[_0xbb10('0x45')](_0xbb10('0x40'),'t','t.id\x20=\x20it.TagId');var _0x5f0c12=squel[_0xbb10('0x51')]();var _0x34cf4e=[];var _0x1bd054=squel[_0xbb10('0x51')]();var _0x10159b;if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]){_0x10159b=as[_0xbb10('0x53')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]);var _0x550111=_0x10159b['sqlOperator'];for(var _0x412e13=0x0;_0x412e13<_0x10159b[_0xbb10('0x54')][_0xbb10('0x55')];_0x412e13++){var _0xb014b0=_0x10159b[_0xbb10('0x54')][_0x412e13];var _0x440f9e='i';var _0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),_0xb014b0[_0xbb10('0x3e')]]);if(!_0x358e7e){switch(_0xb014b0[_0xbb10('0x3e')]){case _0xbb10('0x57'):if(_0xb014b0[_0xbb10('0x58')]==0x1){_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0[_0xbb10('0x3e')]+'`\x20=\x200');}else{_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0['field']+_0xbb10('0x5a'));}break;case _0xbb10('0x5b'):if(_0xb014b0[_0xbb10('0x5c')]===_0xbb10('0x5d')){if(_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')]('\x20')[_0xbb10('0x55')]>0x1){_0x5f0c12[_0x550111](_0xbb10('0x5e'),qs[_0xbb10('0x5f')](_0xb014b0[_0xbb10('0x58')]),null);}else{var _0x44a056='%'+_0xb014b0[_0xbb10('0x58')]+'%';_0x5f0c12[_0x550111](_0xbb10('0x60'),_0x44a056,_0x44a056,_0x44a056);}}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'ContactId']);_0xb014b0[_0xbb10('0x3e')]=_0xbb10('0x61');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')]['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);}break;case _0xbb10('0x65'):var _0x14fed3=_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')](',')[_0xbb10('0x30')](function(_0x12ec18){return Number(_0x12ec18);});_0x14fed3[_0xbb10('0x27')](function(_0x40c4fb){_0x1bd054['or'](_0xbb10('0x66'),'%,'+_0x40c4fb+',%');});_0x34cf4e=_[_0xbb10('0x67')](_0x34cf4e,_0x14fed3);break;case _0xbb10('0x68'):if(_0xb014b0['operator']==='$substring'){_0x5f0c12[_0x550111](_0xbb10('0x69'),'%'+_0xb014b0[_0xbb10('0x58')]+'%',null);}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'UserId']);_0xb014b0['field']=_0xbb10('0x6a');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}break;case _0xbb10('0x2d'):_0x155dc5=as[_0xbb10('0x62')]('me',null,_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5['value']['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);break;}}else{var _0x155dc5=as['buildExpression'](_0x440f9e,_0x358e7e['type'],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}}}else{var _0xa1bbd9=_(_0x188cbd[_0xbb10('0x34')])['keys']()['map'](function(_0x27d7b9){return _[_0xbb10('0x6c')](_0x150107,[_0xbb10('0x21'),_0x27d7b9])?_0x27d7b9:undefined;})[_0xbb10('0x6d')]()['value']();if(!_[_0xbb10('0x6e')](_0xa1bbd9)){_0xa1bbd9[_0xbb10('0x27')](function(_0xa7179d){if(_0xa7179d==='MailAccountId'){_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),[][_0xbb10('0x70')](_0x188cbd['query'][_0xa7179d]));}else if(_0xa7179d===_0xbb10('0x71')){var _0x31e85e=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])['$gte'];var _0x251417=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])[_0xbb10('0x73')];_0x3efa96['where'](_0xbb10('0x74'),_0x31e85e,_0x251417);}else{if(_0x188cbd[_0xbb10('0x34')][_0xa7179d]===_0xbb10('0x75')){_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x76'));}else{_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x77'),_0x188cbd['query'][_0xa7179d]);}}});}if(_0x188cbd['query']['read']){if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x78')]==0x1){_0x3efa96[_0xbb10('0x59')]('`unreadMessages`\x20=\x200');}else{_0x3efa96['having'](_0xbb10('0x79'));}}if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]){_0x34cf4e=_[_0xbb10('0x7b')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')])?_0x188cbd['query'][_0xbb10('0x7a')]:new Array(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]);_0x34cf4e[_0xbb10('0x27')](function(_0x2aaaa6){_0x1bd054['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2aaaa6+',%');});}if(_0x188cbd['query']['filter']){var _0x329da7=_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7c')][_0xbb10('0x7d')]('\x5c','\x5c\x5c')[_0xbb10('0x7d')](/'/g,'\x27\x27');if(qs[_0xbb10('0x7e')](_0x329da7)){_0x5f0c12['or']('i.id\x20LIKE\x20?',_0x329da7+'%');}else if(qs[_0xbb10('0x7f')](_0x329da7)){_0x5f0c12['or']('c.email\x20LIKE\x20?',_0x329da7+'%');}else{_0x5f0c12['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x329da7))['or'](_0xbb10('0x80'),qs[_0xbb10('0x5f')](_0x329da7));}}}_0x3efa96[_0xbb10('0x3d')](_0x5f0c12);_0x3efa96[_0xbb10('0x81')]('i.id');var _0x122d38={'type':db['Sequelize']['QueryTypes'][_0xbb10('0x82')],'raw':!![]};var _0xfe3db0=_0x3efa96[_0xbb10('0x83')]();_0xfe3db0[_0xbb10('0x3e')](_0xbb10('0x84'));_0xfe3db0['field'](_0xbb10('0x85'),_0xbb10('0x57'));if(_0x3c8d7d[_0xbb10('0x3b')]){_0x3c8d7d[_0xbb10('0x3b')][_0xbb10('0x27')](function(_0x27f42f){var _0x174395=_0x27f42f[0x0]==='contactName'?_0x27f42f[0x0]:'i.'+_0x27f42f[0x0];_0x3efa96[_0xbb10('0x3b')](_0x174395,_0x27f42f[0x1]===_0xbb10('0x86')?![]:!![]);});}if(!_[_0xbb10('0x6e')](_0x34cf4e)){_0x3efa96[_0xbb10('0x59')](_0x1bd054);_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x87'),_0x34cf4e);}BPromise[_0xbb10('0x88')]()[_0xbb10('0x1e')](function(){if(!_0x10159b){if(_0x188cbd['query'][_0xbb10('0x89')])return;_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8a'));_0x3efa96['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x188cbd['user'][_0xbb10('0x8b')]!=='agent')return;return _0x188cbd['user'][_0xbb10('0x8c')]({'attributes':['id'],'raw':!![]})[_0xbb10('0x1e')](function(_0x33ff06){if(_[_0xbb10('0x6e')](_0x33ff06)){_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8d'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x8d'));}else{_0xfe3db0[_0xbb10('0x3d')]('i.MailAccountId\x20IN\x20?',_[_0xbb10('0x30')](_0x33ff06,'id'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),_[_0xbb10('0x30')](_0x33ff06,'id'));}});})['then'](function(){if(_0x188cbd['user'][_0xbb10('0x8b')]===_0xbb10('0x8e')&&!_0x10159b&&!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x89')])return[];return db['sequelize'][_0xbb10('0x34')](_0xfe3db0[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0xf7b3e1){_0x2b5352[_0xbb10('0x19')]=_0xf7b3e1['length'];if(_0x2b5352['count']===0x0)return[];return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x403beb[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x256b35){_0x23dc18=_[_0xbb10('0x91')](_0x256b35,'id');_0x122d38=_['merge'](_0x122d38,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x38')]){_0x3c8d7d[_0xbb10('0x39')]['forEach'](function(_0x32d5a5){_0x3efa96[_0xbb10('0x3e')]('i.'+_0x32d5a5);});}else{_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x85'),_0xbb10('0x57'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x92'),_0xbb10('0x93'));_0x3efa96[_0xbb10('0x3e')]('a.mandatoryDisposition',_0xbb10('0x94'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x95'),_0xbb10('0x96'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x84'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x97'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x98'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x99'));_0x3efa96['field']('i.closedAt');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9a'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9b'));_0x3efa96[_0xbb10('0x3e')]('i.lastMsgDirection');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9c'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9d'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9e'));_0x3efa96['field'](_0xbb10('0x9f'));_0x3efa96[_0xbb10('0x3e')]('i.substatus');_0x3efa96[_0xbb10('0x3e')]('i.to');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa0'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa1'));_0x3efa96[_0xbb10('0x3e')]('i.UserId');_0x3efa96[_0xbb10('0x3e')]('c.firstName',_0xbb10('0xa2'));_0x3efa96[_0xbb10('0x3e')]('c.lastName','Contact.lastName');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa3'),_0xbb10('0xa4'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa5'),_0xbb10('0xa6'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa7'),_0xbb10('0xa8'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa9'),'Contact.fax');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xaa'),_0xbb10('0xab'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xac'),_0xbb10('0xad'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xae'),_0xbb10('0x24'));}if(_0x3c8d7d[_0xbb10('0x18')])_0x3efa96[_0xbb10('0x18')](_0x3c8d7d[_0xbb10('0x18')]);if(_0x3c8d7d['offset'])_0x3efa96[_0xbb10('0x16')](_0x3c8d7d['offset']);return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x3efa96[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0x38d369){if(_0x38d369['length']>0x0)_0x180933[_0xbb10('0x3d')](_0xbb10('0xaf'),_[_0xbb10('0x30')](_0x38d369,'id'));return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x180933[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x4bd470){var _0x5cc9d7=_[_0xbb10('0xb0')](_0x4bd470,_0xbb10('0xb1'));var _0x57d5a1=[];return db[_0xbb10('0xb2')][_0xbb10('0xb3')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0xbb10('0x1e')](function(_0xaede56){var _0x5642c3=_0xaede56[_0xbb10('0xb4')];_0x38d369['forEach'](function(_0x34cec7){_0x57d5a1[_0xbb10('0x28')](updateMailInteraction(_0x34cec7,_0x23dc18,_0x5cc9d7,_0x5642c3));});return BPromise['all'](_0x57d5a1);});});});})[_0xbb10('0x1e')](function(_0x28cc74){_0x2b5352['rows']=_0x28cc74;return _0x2b5352;})['then'](respondWithFilteredResult(_0x10202c,_0x3c8d7d))[_0xbb10('0x2e')](handleError(_0x10202c,null));};exports[_0xbb10('0xb5')]=function(_0x3e0e34,_0x3299bc){var _0x3ceb77={'raw':![],'where':{'id':_0x3e0e34[_0xbb10('0xb6')]['id']}},_0x4c3bdc={};_0x4c3bdc[_0xbb10('0x33')]=_[_0xbb10('0x35')](db['MailInteraction'][_0xbb10('0xb7')]);_0x4c3bdc[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x3e0e34[_0xbb10('0x34')]);_0x4c3bdc[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x4c3bdc[_0xbb10('0x33')],_0x4c3bdc[_0xbb10('0x34')]);_0x3ceb77[_0xbb10('0x39')]=_['intersection'](_0x4c3bdc['model'],qs[_0xbb10('0x38')](_0x3e0e34[_0xbb10('0x34')][_0xbb10('0x38')]));_0x3ceb77[_0xbb10('0x39')]=_0x3ceb77[_0xbb10('0x39')][_0xbb10('0x55')]?_0x3ceb77[_0xbb10('0x39')]:_0x4c3bdc[_0xbb10('0x33')];if(_0x3e0e34[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x3ceb77[_0xbb10('0xb9')]=[{'all':!![]}];}_0x3ceb77=_[_0xbb10('0xba')]({},_0x3ceb77,_0x3e0e34[_0xbb10('0xbb')]);return db['MailInteraction'][_0xbb10('0x56')](_0x3ceb77)[_0xbb10('0x1e')](handleEntityNotFound(_0x3299bc,null))[_0xbb10('0x1e')](respondWithResult(_0x3299bc,null))[_0xbb10('0x2e')](handleError(_0x3299bc,null));};exports[_0xbb10('0xbc')]=function(_0xd9284e,_0x4258fc){return db[_0xbb10('0x31')][_0xbb10('0xbc')](_0xd9284e[_0xbb10('0xbd')],{})[_0xbb10('0x1e')](respondWithResult(_0x4258fc,0xc9))['catch'](handleError(_0x4258fc,null));};exports[_0xbb10('0x1c')]=function(_0x5e1ac5,_0x3faaca){if(_0x5e1ac5[_0xbb10('0xbd')]['id']){delete _0x5e1ac5[_0xbb10('0xbd')]['id'];}return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x5e1ac5[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x3faaca,null))[_0xbb10('0x1e')](saveUpdates(_0x5e1ac5['body'],null))[_0xbb10('0x1e')](respondWithResult(_0x3faaca,null))[_0xbb10('0x2e')](handleError(_0x3faaca,null));};exports[_0xbb10('0x1d')]=function(_0x576bb6,_0x2b652c){return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x576bb6[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x2b652c,null))[_0xbb10('0x1e')](removeEntity(_0x2b652c,null))[_0xbb10('0x2e')](handleError(_0x2b652c,null));};exports[_0xbb10('0xbe')]=function(_0x589565,_0x3696b3){return db['MailInteraction'][_0xbb10('0xbe')]()[_0xbb10('0x1e')](respondWithResult(_0x3696b3,null))[_0xbb10('0x2e')](handleError(_0x3696b3,null));};exports[_0xbb10('0xbf')]=function(_0x44c229,_0x40271f){return db[_0xbb10('0x29')]['find']({'where':{'id':_0x44c229[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x40271f,null))['then'](function(_0x1513e0){if(_0x1513e0){return _0x1513e0[_0xbb10('0xbf')](_0x44c229[_0xbb10('0xbd')][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x44c229[_0xbb10('0xbd')],['ids','id'])||{});}})[_0xbb10('0x1e')](respondWithResult(_0x40271f,null))[_0xbb10('0x2e')](handleError(_0x40271f,null));};exports[_0xbb10('0xc2')]=function(_0xb1b7c8,_0x136520){var _0x28127c={'raw':![],'where':{}};var _0x528aff={};var _0xdfdc42={'count':0x0,'rows':[]};return db[_0xbb10('0x31')][_0xbb10('0xb3')]({'where':{'id':_0xb1b7c8[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x136520,null))[_0xbb10('0x1e')](function(_0x2764e1){if(_0x2764e1){_0x528aff['model']=_[_0xbb10('0x35')](db['MailMessage'][_0xbb10('0xb7')]);_0x528aff['query']=_['keys'](_0xb1b7c8[_0xbb10('0x34')]);_0x528aff[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x528aff[_0xbb10('0x33')],_0x528aff[_0xbb10('0x34')]);_0x28127c['attributes']=_[_0xbb10('0x37')](_0x528aff['model'],qs['fields'](_0xb1b7c8['query'][_0xbb10('0x38')]));_0x28127c[_0xbb10('0x39')]=_0x28127c[_0xbb10('0x39')][_0xbb10('0x55')]?_0x28127c[_0xbb10('0x39')]:_0x528aff['model'];if(!_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3a')](_0xbb10('0xc3'))){_0x28127c[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x18')]);_0x28127c['offset']=qs['offset'](_0xb1b7c8['query'][_0xbb10('0x16')]);}_0x28127c[_0xbb10('0x3b')]=qs[_0xbb10('0x3c')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x28127c[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_[_0xbb10('0xc4')](_0xb1b7c8[_0xbb10('0x34')],_0x528aff[_0xbb10('0x36')]));_0x28127c['where']['MailInteractionId']=_0x2764e1['id'];if(_0xb1b7c8['query'][_0xbb10('0x7c')]){_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c['where'],{'$or':_[_0xbb10('0x30')](_0x28127c[_0xbb10('0x39')],function(_0x2c638d){var _0x290280={};_0x290280[_0x2c638d]={'$like':'%'+_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x7c')]+'%'};return _0x290280;})});}if(_0xb1b7c8['query']['$gte']){var _0x356660=_0xb1b7c8['query'][_0xbb10('0xc5')][_0xbb10('0x26')](',');var _0x152ca9={};_0x152ca9[_0x356660[0x0]]={'$gte':moment(_0x356660[0x1])[_0xbb10('0xc6')](_0xbb10('0xc7'))};_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c[_0xbb10('0x3d')],_0x152ca9);}_0x28127c=_[_0xbb10('0xba')]({},_0x28127c,_0xb1b7c8[_0xbb10('0xbb')]);return db['MailMessage'][_0xbb10('0x19')]({'where':_0x28127c['where']})[_0xbb10('0x1e')](function(_0x5547fa){_0xdfdc42[_0xbb10('0x19')]=_0x5547fa;if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x28127c[_0xbb10('0xb9')]=[{'all':!![]}];}return db['MailMessage'][_0xbb10('0xc8')](_0x28127c);})['then'](function(_0xfe1154){if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xc9')]==='true'){for(var _0x298167=0x0;_0x298167<_0xfe1154[_0xbb10('0x55')];_0x298167++){_0xfe1154[_0x298167][_0xbb10('0xbd')]=juice(_0xfe1154[_0x298167][_0xbb10('0xbd')]);}}_0xdfdc42[_0xbb10('0xca')]=_0xfe1154;return _0xdfdc42;});}})[_0xbb10('0x1e')](respondWithFilteredResult(_0x136520,_0x28127c))['catch'](handleError(_0x136520,null));};exports['addTags']=function(_0x522a88,_0x26a752){return db['MailInteraction'][_0xbb10('0x56')]({'where':{'id':_0x522a88['params']['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x26a752,null))[_0xbb10('0x1e')](function(_0x385ad3){if(_0x385ad3){return _0x385ad3['setTags'](_0x522a88['body'][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x522a88[_0xbb10('0xbd')],['ids','id'])||{})[_0xbb10('0xcb')](function(){return db[_0xbb10('0x65')][_0xbb10('0xc8')]({'attributes':['id','name','color'],'where':{'id':_0x522a88['body'][_0xbb10('0xc0')]}});})['then'](function(_0x3dfbcd){socket[_0xbb10('0xcc')](_0xbb10('0xcd'),{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]});return{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]};});}})[_0xbb10('0x1e')](respondWithResult(_0x26a752,null))[_0xbb10('0x2e')](handleError(_0x26a752,null));};exports[_0xbb10('0xce')]=function(_0x2746eb,_0x431792){return db[_0xbb10('0x31')]['find']({'where':{'id':_0x2746eb[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x431792,null))['then'](function(_0x14ef50){if(_0x14ef50){return _0x14ef50['removeTags'](_0x2746eb['query'][_0xbb10('0xc0')]);}})[_0xbb10('0x1e')](respondWithStatusCode(_0x431792,null))[_0xbb10('0x2e')](handleError(_0x431792,null));};exports[_0xbb10('0xcf')]=function(_0x99c4,_0x4ca4ce){var _0x161171=moment()[_0xbb10('0xd0')]()['toString']();var _0xa45726=path[_0xbb10('0xd1')](config['root'],_0xbb10('0xd2'),'files',_0xbb10('0xd3'));var _0x8e8049=path[_0xbb10('0xd1')](config[_0xbb10('0xd4')],_0xbb10('0xd2'),_0xbb10('0xd5'),_0xbb10('0xd6'));var _0x56f902=path[_0xbb10('0xd1')](_0xa45726,_0x161171);var _0x4720a1=util[_0xbb10('0xc6')](_0xbb10('0xd7'),_0x99c4[_0xbb10('0xb6')]['id'],_0x161171);var _0x1301e3=path['join'](_0xa45726,_0x4720a1);var _0x550301=[];if(_0x99c4['query'][_0xbb10('0xd6')]){_0x550301[_0xbb10('0x28')]({'model':db[_0xbb10('0xd8')],'as':_0xbb10('0xd9'),'raw':!![]});}var _0x57700b=[{'model':db[_0xbb10('0x29')],'as':_0xbb10('0xda'),'attributes':['id',_0xbb10('0xbd'),'from','to','cc','bcc',_0xbb10('0xdb'),'createdAt'],'where':{'secret':![]},'order':qs[_0xbb10('0x3c')]('id'),'include':_0x550301}];return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x99c4[_0xbb10('0xb6')]['id']},'include':_0x57700b})[_0xbb10('0x1e')](handleEntityNotFound(_0x4ca4ce,null))[_0xbb10('0x1e')](function(_0x1fe250){if(_0x1fe250&&_0x1fe250['Messages']){var _0x424371=_0x1fe250[_0xbb10('0xdc')]({'plain':!![]});fs['mkdirSync'](_0x56f902);return BPromise[_0xbb10('0xdd')](_0x424371[_0xbb10('0xda')],function(_0x32f261,_0x5b11a2){var _0x4b490a={'from':_0x32f261['from'],'to':_0x32f261['to'],'subject':_0x32f261[_0xbb10('0xdb')],'html':_0x32f261[_0xbb10('0xbd')],'headers':{'Date':moment(_0x32f261['createdAt'])[_0xbb10('0xc6')](_0xbb10('0xde'))},'attachments':[]};if(_0x32f261['cc']){_0x4b490a[_0xbb10('0xdf')]['Cc']=_0x32f261['cc'];}if(_0x32f261[_0xbb10('0xe0')]){_0x4b490a[_0xbb10('0xdf')][_0xbb10('0xe1')]=_0x32f261[_0xbb10('0xe0')];}return new BPromise(function(_0x48f0eb,_0x304603){if(_0x32f261['Attachments']){for(var _0x5a7c4e=0x0;_0x5a7c4e<_0x32f261['Attachments'][_0xbb10('0x55')];_0x5a7c4e++){var _0x572d73=_0x32f261['Attachments'][_0x5a7c4e];var _0x1f09f1=path['join'](_0x8e8049,_0x572d73[_0xbb10('0xe2')]);if(fs[_0xbb10('0xe3')](_0x1f09f1)){_0x4b490a[_0xbb10('0xd6')]['push']({'name':_0x572d73['name'],'contentType':_0x572d73[_0xbb10('0x63')],'data':fs['readFileSync'](_0x1f09f1)});}}}emlformat[_0xbb10('0xe4')](_0x4b490a,function(_0x211172,_0x589ecb){if(_0x211172)return _0x304603(_0x211172);fs['writeFileSync'](path[_0xbb10('0xd1')](_0x56f902,util[_0xbb10('0xc6')](_0xbb10('0xe5'),_0x5b11a2)),_0x589ecb);return _0x48f0eb(_0x589ecb);});});})['then'](function(){return new BPromise(function(_0x4f4aa8,_0x426a4f){zipdir(_0x56f902,{'saveTo':_0x1301e3},function(_0x22f153,_0x4d47cc){if(_0x22f153)return _0x426a4f(_0x22f153);return _0x4f4aa8(_0x4d47cc);});})[_0xbb10('0x1e')](function(){return new BPromise(function(_0x203e5a,_0xe88e90){rimraf(_0x56f902,function(_0x4845b5){if(_0x4845b5)_0xe88e90(_0x4845b5);return _0x203e5a();});});})[_0xbb10('0x1e')](function(){return _0x4ca4ce[_0xbb10('0xcf')](_0x1301e3,_0x4720a1,function(_0x166f4f){if(!_0x166f4f)fs[_0xbb10('0xe6')](_0x1301e3);});});});}else{return _0x4ca4ce[_0xbb10('0x12')](0xc8);}})[_0xbb10('0x2e')](handleError(_0x4ca4ce,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 91c4246..871fc56 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 _0x9a13=['length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','remove','getUsers','Users','findAll','then','setDataValue','unreadMessages'];(function(_0x3b59a6,_0xa95bc5){var _0x3ec4dd=function(_0x5f2aa9){while(--_0x5f2aa9){_0x3b59a6['push'](_0x3b59a6['shift']());}};_0x3ec4dd(++_0xa95bc5);}(_0x9a13,0xc0));var _0x39a1=function(_0x232551,_0x49bcbd){_0x232551=_0x232551-0x0;var _0x5905e2=_0x9a13[_0x232551];return _0x5905e2;};'use strict';var EventEmitter=require(_0x39a1('0x0'));var MailInteraction=require(_0x39a1('0x1'))['db'][_0x39a1('0x2')];var MailMessage=require(_0x39a1('0x1'))['db'][_0x39a1('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x39a1('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x39a1('0x5')};function emitEvent(_0x43fa35){return function(_0x4fa3cc,_0x5b3be6,_0x55c455){_0x4fa3cc[_0x39a1('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x289cc9){_0x4fa3cc['setDataValue'](_0x39a1('0x7'),_0x289cc9['map'](function(_0x22a539){return{'id':_0x22a539['id']};}));return MailMessage[_0x39a1('0x8')]({'where':{'MailInteractionId':_0x4fa3cc['id'],'direction':'in','read':![]},'raw':!![]});})[_0x39a1('0x9')](function(_0x84e5d3){_0x4fa3cc[_0x39a1('0xa')](_0x39a1('0xb'),_0x84e5d3[_0x39a1('0xc')]);MailInteractionEvents[_0x39a1('0xd')](_0x43fa35+':'+_0x4fa3cc['id'],_0x4fa3cc);MailInteractionEvents[_0x39a1('0xd')](_0x43fa35,_0x4fa3cc);_0x55c455(null);})['catch'](_0x55c455(null));};}for(var e in events){if(events[_0x39a1('0xe')](e)){var event=events[e];MailInteraction[_0x39a1('0xf')](e,emitEvent(event));}}module[_0x39a1('0x10')]=MailInteractionEvents; \ No newline at end of file +var _0xaaab=['map','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','MailInteraction','../../mysqldb','MailMessage','setMaxListeners','save','update','then','setDataValue'];(function(_0x44229f,_0x464ab7){var _0x2662a1=function(_0x1e9346){while(--_0x1e9346){_0x44229f['push'](_0x44229f['shift']());}};_0x2662a1(++_0x464ab7);}(_0xaaab,0x187));var _0xbaaa=function(_0x1b3e94,_0x56bd86){_0x1b3e94=_0x1b3e94-0x0;var _0x22c8a5=_0xaaab[_0x1b3e94];return _0x22c8a5;};'use strict';var EventEmitter=require(_0xbaaa('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0xbaaa('0x1')];var MailMessage=require(_0xbaaa('0x2'))['db'][_0xbaaa('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xbaaa('0x4')](0x0);var events={'afterCreate':_0xbaaa('0x5'),'afterUpdate':_0xbaaa('0x6'),'afterDestroy':'remove'};function emitEvent(_0x531ea1){return function(_0x5ac45a,_0x41946c,_0xc70e3d){_0x5ac45a['getUsers']({'attributes':['id'],'raw':!![]})[_0xbaaa('0x7')](function(_0x24c4b3){_0x5ac45a[_0xbaaa('0x8')]('Users',_0x24c4b3[_0xbaaa('0x9')](function(_0x3f60b3){return{'id':_0x3f60b3['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x5ac45a['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbaaa('0x7')](function(_0x288b21){_0x5ac45a[_0xbaaa('0x8')](_0xbaaa('0xa'),_0x288b21[_0xbaaa('0xb')]);MailInteractionEvents[_0xbaaa('0xc')](_0x531ea1+':'+_0x5ac45a['id'],_0x5ac45a);MailInteractionEvents['emit'](_0x531ea1,_0x5ac45a);_0xc70e3d(null);})['catch'](_0xc70e3d(null));};}for(var e in events){if(events[_0xbaaa('0xd')](e)){var event=events[e];MailInteraction[_0xbaaa('0xe')](e,emitEvent(event));}}module[_0xbaaa('0xf')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index d5d626e..ec92993 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 _0x2240=['MailInteraction','mail_interactions','subject','substatusAt','format','closed','closedAt','substatus','YYYY-MM-DD\x20HH:mm:ss','models','get','MailMessage','update','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x1276f9,_0x2539a0){var _0x18a7cc=function(_0x1bb02b){while(--_0x1bb02b){_0x1276f9['push'](_0x1276f9['shift']());}};_0x18a7cc(++_0x2539a0);}(_0x2240,0x18a));var _0x0224=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x2240[_0x17b6e3];return _0x3906f3;};'use strict';var _=require(_0x0224('0x0'));var util=require(_0x0224('0x1'));var logger=require(_0x0224('0x2'))(_0x0224('0x3'));var moment=require(_0x0224('0x4'));var BPromise=require('bluebird');var rp=require(_0x0224('0x5'));var fs=require('fs');var path=require(_0x0224('0x6'));var rimraf=require(_0x0224('0x7'));var config=require(_0x0224('0x8'));var attributes=require('./mailInteraction.attributes');module[_0x0224('0x9')]=function(_0x54360c,_0x2a6e71){return _0x54360c[_0x0224('0xa')](_0x0224('0xb'),attributes,{'tableName':_0x0224('0xc'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x0224('0xd'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x48df85,_0x1597d3,_0x3d5452){if(_0x48df85['substatus']){_0x48df85[_0x0224('0xe')]=moment()[_0x0224('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x48df85[_0x0224('0x10')]){_0x48df85[_0x0224('0x11')]=moment()[_0x0224('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3d5452(null,_0x1597d3);},'beforeUpdate':function(_0x2be8c0,_0x8cf581,_0x3b4f2b){if(_0x2be8c0['changed'](_0x0224('0x12'))){_0x2be8c0[_0x0224('0xe')]=_0x2be8c0[_0x0224('0x12')]?moment()['format'](_0x0224('0x13')):null;}if(_0x2be8c0['changed'](_0x0224('0x10'))){_0x2be8c0['closedAt']=moment()[_0x0224('0xf')]('YYYY-MM-DD\x20HH:mm:ss');_0x2be8c0['substatus']=null;_0x2be8c0['substatusAt']=null;}_0x3b4f2b(null,_0x2be8c0);},'afterUpdate':function(_0x53aaef,_0x3e38a5,_0x8ceadf){var _0x578013=_0x54360c[_0x0224('0x14')];var _0x17e81e=_0x53aaef[_0x0224('0x15')]({'plain':!![]});if(_0x17e81e[_0x0224('0x10')]){return _0x578013[_0x0224('0x16')][_0x0224('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x17e81e['id']}})['then'](function(){_0x8ceadf();})[_0x0224('0x18')](function(_0x260635){_0x8ceadf(_0x260635);});}else{_0x8ceadf();}}},'charset':_0x0224('0x19'),'collate':_0x0224('0x1a')});}; \ No newline at end of file +var _0x9c4d=['bluebird','request-promise','path','./mailInteraction.attributes','exports','define','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','changed','models','get','update','then','catch','utf8mb4_unicode_ci','util','../../config/logger','api','moment'];(function(_0x24bcaa,_0x573fa1){var _0x17d525=function(_0x3a3527){while(--_0x3a3527){_0x24bcaa['push'](_0x24bcaa['shift']());}};_0x17d525(++_0x573fa1);}(_0x9c4d,0x191));var _0xd9c4=function(_0x37f8ef,_0x48c182){_0x37f8ef=_0x37f8ef-0x0;var _0x135464=_0x9c4d[_0x37f8ef];return _0x135464;};'use strict';var _=require('lodash');var util=require(_0xd9c4('0x0'));var logger=require(_0xd9c4('0x1'))(_0xd9c4('0x2'));var moment=require(_0xd9c4('0x3'));var BPromise=require(_0xd9c4('0x4'));var rp=require(_0xd9c4('0x5'));var fs=require('fs');var path=require(_0xd9c4('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd9c4('0x7'));module[_0xd9c4('0x8')]=function(_0x4b14f3,_0xec2238){return _0x4b14f3[_0xd9c4('0x9')]('MailInteraction',attributes,{'tableName':_0xd9c4('0xa'),'paranoid':![],'indexes':[{'name':_0xd9c4('0xb'),'fields':[_0xd9c4('0xc'),'to'],'type':_0xd9c4('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2b0445,_0x2242fc,_0x11b16c){if(_0x2b0445[_0xd9c4('0xe')]){_0x2b0445[_0xd9c4('0xf')]=moment()[_0xd9c4('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x2b0445[_0xd9c4('0x11')]){_0x2b0445[_0xd9c4('0x12')]=moment()[_0xd9c4('0x10')](_0xd9c4('0x13'));}_0x11b16c(null,_0x2242fc);},'beforeUpdate':function(_0x4b5444,_0x2b9e67,_0x443b8a){if(_0x4b5444[_0xd9c4('0x14')](_0xd9c4('0xe'))){_0x4b5444[_0xd9c4('0xf')]=_0x4b5444[_0xd9c4('0xe')]?moment()[_0xd9c4('0x10')](_0xd9c4('0x13')):null;}if(_0x4b5444['changed'](_0xd9c4('0x11'))){_0x4b5444[_0xd9c4('0x12')]=moment()[_0xd9c4('0x10')]('YYYY-MM-DD\x20HH:mm:ss');_0x4b5444[_0xd9c4('0xe')]=null;_0x4b5444['substatusAt']=null;}_0x443b8a(null,_0x4b5444);},'afterUpdate':function(_0x1745f0,_0x363fa5,_0x308d79){var _0x5c8fd9=_0x4b14f3[_0xd9c4('0x15')];var _0x113cca=_0x1745f0[_0xd9c4('0x16')]({'plain':!![]});if(_0x113cca[_0xd9c4('0x11')]){return _0x5c8fd9['MailMessage'][_0xd9c4('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x113cca['id']}})[_0xd9c4('0x18')](function(){_0x308d79();})[_0xd9c4('0x19')](function(_0x4d6296){_0x308d79(_0x4d6296);});}else{_0x308d79();}}},'charset':'utf8mb4','collate':_0xd9c4('0x1a')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 11a1239..1ab89a8 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 _0x4300=['request\x20sent','stringify','error','code','message','result','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','limit','debug','AddTagsToMailInteraction','find','addTags','ids','spread','AddTags','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s'];(function(_0x3d3348,_0x31aac8){var _0x15016e=function(_0x3a85c4){while(--_0x3a85c4){_0x3d3348['push'](_0x3d3348['shift']());}};_0x15016e(++_0x31aac8);}(_0x4300,0x1a6));var _0x0430=function(_0x470ef9,_0x17794b){_0x470ef9=_0x470ef9-0x0;var _0x3260dd=_0x4300[_0x470ef9];return _0x3260dd;};'use strict';var _=require(_0x0430('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0430('0x1'));var db=require(_0x0430('0x2'))['db'];var utils=require(_0x0430('0x3'));var logger=require(_0x0430('0x4'))(_0x0430('0x5'));var config=require('../../config/environment');var jayson=require(_0x0430('0x6'));var client=jayson['client'][_0x0430('0x7')]({'port':0x232a});config['redis']=_[_0x0430('0x8')](config[_0x0430('0x9')],{'host':_0x0430('0xa'),'port':0x18eb});var socket=require(_0x0430('0xb'))(new Redis(config[_0x0430('0x9')]));require(_0x0430('0xc'))[_0x0430('0xd')](socket);function respondWithRpcPromise(_0x3af75c,_0x26bd9d,_0x4972da){return new BPromise(function(_0x1db2e7,_0x364f7f){return client[_0x0430('0xe')](_0x3af75c,_0x4972da)[_0x0430('0xf')](function(_0x45e336){logger[_0x0430('0x10')](_0x0430('0x11'),_0x26bd9d,_0x0430('0x12'));logger['debug']('MailInteraction,\x20%s,\x20%s,\x20%s',_0x26bd9d,_0x0430('0x12'),JSON[_0x0430('0x13')](_0x45e336));if(_0x45e336[_0x0430('0x14')]){if(_0x45e336[_0x0430('0x14')][_0x0430('0x15')]===0x1f4){logger[_0x0430('0x14')](_0x0430('0x11'),_0x26bd9d,_0x45e336['error'][_0x0430('0x16')]);return _0x364f7f(_0x45e336[_0x0430('0x14')][_0x0430('0x16')]);}logger[_0x0430('0x14')]('MailInteraction,\x20%s,\x20%s',_0x26bd9d,_0x45e336['error']['message']);return _0x1db2e7(_0x45e336[_0x0430('0x14')]['message']);}else{logger['info'](_0x0430('0x11'),_0x26bd9d,_0x0430('0x12'));_0x1db2e7(_0x45e336[_0x0430('0x17')][_0x0430('0x16')]);}})[_0x0430('0x18')](function(_0x5ed513){logger['error'](_0x0430('0x11'),_0x26bd9d,_0x5ed513);_0x364f7f(_0x5ed513);});});}exports[_0x0430('0x19')]=function(_0x35ffdb){var _0x39fd58=this;return new Promise(function(_0x5f3c68,_0x4d3af1){return db[_0x0430('0x1a')][_0x0430('0x1b')](_0x35ffdb[_0x0430('0x1c')],{'raw':_0x35ffdb[_0x0430('0x1d')]?_0x35ffdb[_0x0430('0x1d')][_0x0430('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35ffdb['options']?_0x35ffdb[_0x0430('0x1d')][_0x0430('0x1f')]||null:null,'attributes':_0x35ffdb[_0x0430('0x1d')]?_0x35ffdb[_0x0430('0x1d')]['attributes']||null:null,'limit':_0x35ffdb[_0x0430('0x1d')]?_0x35ffdb[_0x0430('0x1d')][_0x0430('0x20')]||null:null})[_0x0430('0xf')](function(_0x133785){logger[_0x0430('0x10')](_0x0430('0x19'),_0x35ffdb);logger[_0x0430('0x21')](_0x0430('0x19'),_0x35ffdb,JSON['stringify'](_0x133785));_0x5f3c68(_0x133785);})[_0x0430('0x18')](function(_0x531611){logger['error'](_0x0430('0x19'),_0x531611[_0x0430('0x16')],_0x35ffdb);_0x4d3af1(_0x39fd58['error'](0x1f4,_0x531611[_0x0430('0x16')]));});});};exports[_0x0430('0x22')]=function(_0x3c0f13){return new Promise(function(_0x3b20d1,_0x2b94e4){return db[_0x0430('0x1a')][_0x0430('0x23')]({'where':_0x3c0f13[_0x0430('0x1d')]?_0x3c0f13[_0x0430('0x1d')]['where']||null:null})['then'](function(_0x5960d2){if(_0x5960d2){return _0x5960d2[_0x0430('0x24')](_0x3c0f13['body'][_0x0430('0x25')],_['omit'](_0x3c0f13['body'],[_0x0430('0x25'),'id'])||{});}})[_0x0430('0x26')](function(_0x22f425){logger[_0x0430('0x10')]('AddTags',_0x3c0f13);logger['debug'](_0x0430('0x27'),_0x3c0f13,JSON[_0x0430('0x13')](_0x22f425));_0x3b20d1(_0x22f425);})['catch'](function(_0x582eec){logger[_0x0430('0x14')](_0x0430('0x27'),_0x582eec[_0x0430('0x16')],_0x3c0f13);_0x2b94e4(_this[_0x0430('0x14')](0x1f4,_0x582eec[_0x0430('0x16')]));});});}; \ No newline at end of file +var _0x7f9e=['raw','where','attributes','limit','AddTagsToMailInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','./mailInteraction.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','MailInteraction,\x20%s,\x20%s','message','result','catch','UpdateMailInteraction','MailInteraction','update','options'];(function(_0x35de68,_0x165ef8){var _0xf70815=function(_0x731b8e){while(--_0x731b8e){_0x35de68['push'](_0x35de68['shift']());}};_0xf70815(++_0x165ef8);}(_0x7f9e,0x90));var _0xe7f9=function(_0x4cbf20,_0x1bfa66){_0x4cbf20=_0x4cbf20-0x0;var _0x582ae4=_0x7f9e[_0x4cbf20];return _0x582ae4;};'use strict';var _=require(_0xe7f9('0x0'));var util=require(_0xe7f9('0x1'));var moment=require(_0xe7f9('0x2'));var BPromise=require(_0xe7f9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe7f9('0x4'));var db=require(_0xe7f9('0x5'))['db'];var utils=require(_0xe7f9('0x6'));var logger=require(_0xe7f9('0x7'))(_0xe7f9('0x8'));var config=require(_0xe7f9('0x9'));var jayson=require(_0xe7f9('0xa'));var client=jayson[_0xe7f9('0xb')]['http']({'port':0x232a});config[_0xe7f9('0xc')]=_['defaults'](config[_0xe7f9('0xc')],{'host':_0xe7f9('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe7f9('0xc')]));require(_0xe7f9('0xe'))[_0xe7f9('0xf')](socket);function respondWithRpcPromise(_0xe59cb2,_0x459e12,_0x59672d){return new BPromise(function(_0x4415f3,_0x36c387){return client[_0xe7f9('0x10')](_0xe59cb2,_0x59672d)[_0xe7f9('0x11')](function(_0x6528cd){logger[_0xe7f9('0x12')]('MailInteraction,\x20%s,\x20%s',_0x459e12,_0xe7f9('0x13'));logger[_0xe7f9('0x14')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x459e12,_0xe7f9('0x13'),JSON[_0xe7f9('0x15')](_0x6528cd));if(_0x6528cd[_0xe7f9('0x16')]){if(_0x6528cd[_0xe7f9('0x16')][_0xe7f9('0x17')]===0x1f4){logger[_0xe7f9('0x16')](_0xe7f9('0x18'),_0x459e12,_0x6528cd[_0xe7f9('0x16')][_0xe7f9('0x19')]);return _0x36c387(_0x6528cd[_0xe7f9('0x16')]['message']);}logger[_0xe7f9('0x16')](_0xe7f9('0x18'),_0x459e12,_0x6528cd[_0xe7f9('0x16')][_0xe7f9('0x19')]);return _0x4415f3(_0x6528cd['error'][_0xe7f9('0x19')]);}else{logger[_0xe7f9('0x12')](_0xe7f9('0x18'),_0x459e12,'request\x20sent');_0x4415f3(_0x6528cd[_0xe7f9('0x1a')][_0xe7f9('0x19')]);}})[_0xe7f9('0x1b')](function(_0x1f15d3){logger[_0xe7f9('0x16')](_0xe7f9('0x18'),_0x459e12,_0x1f15d3);_0x36c387(_0x1f15d3);});});}exports[_0xe7f9('0x1c')]=function(_0x1bc392){var _0x4a4992=this;return new Promise(function(_0x3592fa,_0x25e603){return db[_0xe7f9('0x1d')][_0xe7f9('0x1e')](_0x1bc392['body'],{'raw':_0x1bc392['options']?_0x1bc392[_0xe7f9('0x1f')][_0xe7f9('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1bc392[_0xe7f9('0x1f')]?_0x1bc392[_0xe7f9('0x1f')][_0xe7f9('0x21')]||null:null,'attributes':_0x1bc392[_0xe7f9('0x1f')]?_0x1bc392[_0xe7f9('0x1f')][_0xe7f9('0x22')]||null:null,'limit':_0x1bc392['options']?_0x1bc392[_0xe7f9('0x1f')][_0xe7f9('0x23')]||null:null})[_0xe7f9('0x11')](function(_0x48f245){logger[_0xe7f9('0x12')]('UpdateMailInteraction',_0x1bc392);logger[_0xe7f9('0x14')](_0xe7f9('0x1c'),_0x1bc392,JSON[_0xe7f9('0x15')](_0x48f245));_0x3592fa(_0x48f245);})[_0xe7f9('0x1b')](function(_0x5a930b){logger[_0xe7f9('0x16')](_0xe7f9('0x1c'),_0x5a930b[_0xe7f9('0x19')],_0x1bc392);_0x25e603(_0x4a4992['error'](0x1f4,_0x5a930b[_0xe7f9('0x19')]));});});};exports[_0xe7f9('0x24')]=function(_0x5617cd){return new Promise(function(_0x51d3c8,_0x240e11){return db[_0xe7f9('0x1d')][_0xe7f9('0x25')]({'where':_0x5617cd[_0xe7f9('0x1f')]?_0x5617cd[_0xe7f9('0x1f')][_0xe7f9('0x21')]||null:null})['then'](function(_0x789366){if(_0x789366){return _0x789366[_0xe7f9('0x26')](_0x5617cd[_0xe7f9('0x27')][_0xe7f9('0x28')],_[_0xe7f9('0x29')](_0x5617cd[_0xe7f9('0x27')],[_0xe7f9('0x28'),'id'])||{});}})[_0xe7f9('0x2a')](function(_0x14344a){logger[_0xe7f9('0x12')](_0xe7f9('0x2b'),_0x5617cd);logger[_0xe7f9('0x14')](_0xe7f9('0x2b'),_0x5617cd,JSON[_0xe7f9('0x15')](_0x14344a));_0x51d3c8(_0x14344a);})[_0xe7f9('0x1b')](function(_0x4a2fbe){logger[_0xe7f9('0x16')](_0xe7f9('0x2b'),_0x4a2fbe['message'],_0x5617cd);_0x240e11(_this[_0xe7f9('0x16')](0x1f4,_0x4a2fbe['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index bca6f6b..27858ed 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 _0xae0d=['emit','removeListener','mailInteraction:','./mailInteraction.events','save','remove','update'];(function(_0x43b487,_0x21893a){var _0x2f707a=function(_0x477ee0){while(--_0x477ee0){_0x43b487['push'](_0x43b487['shift']());}};_0x2f707a(++_0x21893a);}(_0xae0d,0x13e));var _0xdae0=function(_0x3f6276,_0x31e9dd){_0x3f6276=_0x3f6276-0x0;var _0x3f7dce=_0xae0d[_0x3f6276];return _0x3f7dce;};'use strict';var MailInteractionEvents=require(_0xdae0('0x0'));var events=[_0xdae0('0x1'),_0xdae0('0x2'),_0xdae0('0x3')];function createListener(_0x365604,_0xd36b38){return function(_0x4f7de9){_0xd36b38[_0xdae0('0x4')](_0x365604,_0x4f7de9);};}function removeListener(_0x119294,_0xa03127){return function(){MailInteractionEvents[_0xdae0('0x5')](_0x119294,_0xa03127);};}exports['register']=function(_0x334f6c){for(var _0x3ed2d8=0x0,_0x49ff85=events['length'];_0x3ed2d8<_0x49ff85;_0x3ed2d8++){var _0x1fb219=events[_0x3ed2d8];var _0x30a7f4=createListener(_0xdae0('0x6')+_0x1fb219,_0x334f6c);MailInteractionEvents['on'](_0x1fb219,_0x30a7f4);}}; \ No newline at end of file +var _0xe1b9=['./mailInteraction.events','save','remove','update','emit','removeListener','register','length','mailInteraction:'];(function(_0x44e50a,_0x1cc4a2){var _0x1b5994=function(_0x29a487){while(--_0x29a487){_0x44e50a['push'](_0x44e50a['shift']());}};_0x1b5994(++_0x1cc4a2);}(_0xe1b9,0x19e));var _0x9e1b=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0xe1b9[_0x1203f];return _0x365f0a;};'use strict';var MailInteractionEvents=require(_0x9e1b('0x0'));var events=[_0x9e1b('0x1'),_0x9e1b('0x2'),_0x9e1b('0x3')];function createListener(_0xee8c58,_0x1d0a04){return function(_0x25b183){_0x1d0a04[_0x9e1b('0x4')](_0xee8c58,_0x25b183);};}function removeListener(_0xec7ba7,_0xbda592){return function(){MailInteractionEvents[_0x9e1b('0x5')](_0xec7ba7,_0xbda592);};}exports[_0x9e1b('0x6')]=function(_0x5bc88e){for(var _0x419fe6=0x0,_0x41f277=events[_0x9e1b('0x7')];_0x419fe6<_0x41f277;_0x419fe6++){var _0xd66e5a=events[_0x419fe6];var _0x507103=createListener(_0x9e1b('0x8')+_0xd66e5a,_0x5bc88e);MailInteractionEvents['on'](_0xd66e5a,_0x507103);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 1a5ba2c..8292605 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 _0xafc2=['update','accept','reject','delete','destroy','exports','multer','connect-timeout','Router','../../components/auth/service','../../config/environment','./mailMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/download','download','post','mailmessage:create','put'];(function(_0x57adb1,_0x4e542c){var _0x2bc74a=function(_0x390fde){while(--_0x390fde){_0x57adb1['push'](_0x57adb1['shift']());}};_0x2bc74a(++_0x4e542c);}(_0xafc2,0x10e));var _0x2afc=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xafc2[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x2afc('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2afc('0x1'));var express=require('express');var router=express[_0x2afc('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x2afc('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x2afc('0x4'));var controller=require(_0x2afc('0x5'));router[_0x2afc('0x6')]('/',auth['isAuthenticated'](),controller[_0x2afc('0x7')]);router[_0x2afc('0x6')](_0x2afc('0x8'),auth[_0x2afc('0x9')](),controller[_0x2afc('0xa')]);router['get'](_0x2afc('0xb'),auth[_0x2afc('0x9')](),controller[_0x2afc('0xc')]);router[_0x2afc('0x6')](_0x2afc('0xd'),auth[_0x2afc('0x9')](),controller[_0x2afc('0xe')]);router[_0x2afc('0xf')]('/',auth[_0x2afc('0x9')](),interaction['tracked']('mail',_0x2afc('0x10')),controller['create']);router[_0x2afc('0x11')](_0x2afc('0xb'),auth['isAuthenticated'](),controller[_0x2afc('0x12')]);router[_0x2afc('0x11')]('/:id/accept',auth[_0x2afc('0x9')](),controller[_0x2afc('0x13')]);router['put']('/:id/reject',auth[_0x2afc('0x9')](),controller[_0x2afc('0x14')]);router[_0x2afc('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x2afc('0x16')]);module[_0x2afc('0x17')]=router; \ No newline at end of file +var _0xf04c=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','download','post','mail','mailmessage:create','create','put','update','/:id/accept','accept','reject','delete','destroy'];(function(_0x48b5e0,_0xb3826){var _0x4287ea=function(_0x14519e){while(--_0x14519e){_0x48b5e0['push'](_0x48b5e0['shift']());}};_0x4287ea(++_0xb3826);}(_0xf04c,0xfd));var _0xcf04=function(_0x4add82,_0x2af3c4){_0x4add82=_0x4add82-0x0;var _0x58a471=_0xf04c[_0x4add82];return _0x58a471;};'use strict';var multer=require(_0xcf04('0x0'));var util=require(_0xcf04('0x1'));var path=require(_0xcf04('0x2'));var timeout=require(_0xcf04('0x3'));var express=require(_0xcf04('0x4'));var router=express['Router']();var fs_extra=require(_0xcf04('0x5'));var auth=require(_0xcf04('0x6'));var interaction=require(_0xcf04('0x7'));var config=require(_0xcf04('0x8'));var controller=require('./mailMessage.controller');router[_0xcf04('0x9')]('/',auth[_0xcf04('0xa')](),controller['index']);router['get'](_0xcf04('0xb'),auth[_0xcf04('0xa')](),controller[_0xcf04('0xc')]);router['get'](_0xcf04('0xd'),auth[_0xcf04('0xa')](),controller[_0xcf04('0xe')]);router['get']('/:id/download',auth[_0xcf04('0xa')](),controller[_0xcf04('0xf')]);router[_0xcf04('0x10')]('/',auth['isAuthenticated'](),interaction['tracked'](_0xcf04('0x11'),_0xcf04('0x12')),controller[_0xcf04('0x13')]);router[_0xcf04('0x14')](_0xcf04('0xd'),auth[_0xcf04('0xa')](),controller[_0xcf04('0x15')]);router[_0xcf04('0x14')](_0xcf04('0x16'),auth[_0xcf04('0xa')](),controller[_0xcf04('0x17')]);router[_0xcf04('0x14')]('/:id/reject',auth[_0xcf04('0xa')](),controller[_0xcf04('0x18')]);router[_0xcf04('0x19')](_0xcf04('0xd'),auth[_0xcf04('0xa')](),controller[_0xcf04('0x1a')]);module[_0xcf04('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 72254ca..5548f81 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 _0x09ac=['BOOLEAN','ENUM','out','STRING','long','DATE','INTEGER','Email','Chat','lodash','exports','TEXT','medium'];(function(_0x40822a,_0x582b60){var _0x357420=function(_0x6cee0b){while(--_0x6cee0b){_0x40822a['push'](_0x40822a['shift']());}};_0x357420(++_0x582b60);}(_0x09ac,0x14e));var _0xc09a=function(_0x2fb511,_0x41cf72){_0x2fb511=_0x2fb511-0x0;var _0x44d001=_0x09ac[_0x2fb511];return _0x44d001;};'use strict';var Sequelize=require('sequelize');var _=require(_0xc09a('0x0'));module[_0xc09a('0x1')]={'body':{'type':Sequelize[_0xc09a('0x2')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xc09a('0x2')](_0xc09a('0x3'))},'read':{'type':Sequelize[_0xc09a('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc09a('0x5')]('in','out'),'defaultValue':_0xc09a('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xc09a('0x7')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize['TEXT']('long')},'cc':{'type':Sequelize[_0xc09a('0x2')](_0xc09a('0x8'))},'bcc':{'type':Sequelize[_0xc09a('0x2')]('long')},'subject':{'type':Sequelize[_0xc09a('0x2')]},'sentAt':{'type':Sequelize[_0xc09a('0x9')]},'attach':{'type':Sequelize[_0xc09a('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xc09a('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xc09a('0x9')]},'originTo':{'type':Sequelize[_0xc09a('0x2')](_0xc09a('0x8'))},'originCc':{'type':Sequelize['TEXT'](_0xc09a('0x8'))},'originChannel':{'type':Sequelize[_0xc09a('0x5')](_0xc09a('0xb'),_0xc09a('0xc')),'defaultValue':_0xc09a('0xb'),'allowNull':![]}}; \ No newline at end of file +var _0x9714=['lodash','exports','TEXT','medium','BOOLEAN','out','STRING','long','DATE','ENUM','Chat','Email','sequelize'];(function(_0x78936d,_0x4b367a){var _0x16d6c7=function(_0x25a710){while(--_0x25a710){_0x78936d['push'](_0x78936d['shift']());}};_0x16d6c7(++_0x4b367a);}(_0x9714,0x151));var _0x4971=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0x9714[_0x3c4737];return _0x2bb926;};'use strict';var Sequelize=require(_0x4971('0x0'));var _=require(_0x4971('0x1'));module[_0x4971('0x2')]={'body':{'type':Sequelize[_0x4971('0x3')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x4971('0x3')](_0x4971('0x4'))},'read':{'type':Sequelize[_0x4971('0x5')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x4971('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x4971('0x7')]},'to':{'type':Sequelize[_0x4971('0x3')]('long')},'cc':{'type':Sequelize['TEXT'](_0x4971('0x8'))},'bcc':{'type':Sequelize[_0x4971('0x3')]('long')},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x4971('0x9')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0x4971('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x4971('0x9')]},'originTo':{'type':Sequelize['TEXT'](_0x4971('0x8'))},'originCc':{'type':Sequelize[_0x4971('0x3')](_0x4971('0x8'))},'originChannel':{'type':Sequelize[_0x4971('0xa')]('Email',_0x4971('0xb')),'defaultValue':_0x4971('0xc'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 757645c..ac71f67 100644 --- a/server/api/mailMessage/mailMessage.controller.js +++ b/server/api/mailMessage/mailMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['params','describe','create','secret','split','MailAccount','MailAccountId','List','CmContact','updatedAt','DESC','MailServerOut','Smtp','isNil','port','secure','authentication','auth','service','user','pass','attachments','join','server/files/attachments','defaults','ListId','List\x20not\x20found','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','readAt','agent','UserId','MailInteraction','MailInteractionId','read1stAt','interaction','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','sequelize','Sequelize','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','reject','fromString','rejectmessage','unix','toString','root','server','files','tmp','message-%s.eml','from','subject','createdAt','headers','bcc','Bcc','Attachments','basename','existsSync','readFileSync','build','download','unlinkSync','moment','bluebird','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','api','../../config/logger','mail-interactions','../../config/environment','redis','localhost','socket.io-emitter','register','client','http','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','json','undefined','limit','count','offset','Content-Range','update','then','destroy','status','end','sendStatus','stack','name','index','map','MailMessage','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','keys','filters','find','body'];(function(_0x1b8281,_0x4d3992){var _0x293345=function(_0x494f7f){while(--_0x494f7f){_0x1b8281['push'](_0x1b8281['shift']());}};_0x293345(++_0x4d3992);}(_0xedd9,0xfc));var _0x9edd=function(_0x18eefa,_0x568c6f){_0x18eefa=_0x18eefa-0x0;var _0x21c3d1=_0xedd9[_0x18eefa];return _0x21c3d1;};'use strict';var emlformat=require('eml-format');var moment=require(_0x9edd('0x0'));var BPromise=require(_0x9edd('0x1'));var util=require(_0x9edd('0x2'));var path=require(_0x9edd('0x3'));var fs=require('fs');var _=require(_0x9edd('0x4'));var Redis=require(_0x9edd('0x5'));var htmlToText=require(_0x9edd('0x6'));var qs=require(_0x9edd('0x7'));var logger=require('../../config/logger')(_0x9edd('0x8'));var interaction_log=require(_0x9edd('0x9'))(_0x9edd('0xa'));var config=require(_0x9edd('0xb'));var db=require('../../mysqldb')['db'];config[_0x9edd('0xc')]=_['defaults'](config[_0x9edd('0xc')],{'host':_0x9edd('0xd'),'port':0x18eb});var socket=require(_0x9edd('0xe'))(new Redis(config[_0x9edd('0xc')]));require('./mailMessage.socket')[_0x9edd('0xf')](socket);var jayson=require('jayson/promise');var client=jayson[_0x9edd('0x10')][_0x9edd('0x11')]({'port':0x232c});var client9003=jayson['client'][_0x9edd('0x11')]({'port':0x232b});var client9002=jayson[_0x9edd('0x10')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30c0d7,_0x1b73d1,_0x25e64c,_0xfd544a){return new BPromise(function(_0x287ddd,_0x3a7b84){var _0xfca576=_0xfd544a||client;return _0xfca576[_0x9edd('0x12')](_0x30c0d7,_0x25e64c)['then'](function(_0x176bfa){logger[_0x9edd('0x13')](_0x9edd('0x14'),_0x1b73d1,_0x9edd('0x15'));logger[_0x9edd('0x16')](_0x9edd('0x17'),_0x1b73d1,_0x9edd('0x15'),JSON[_0x9edd('0x18')](_0x176bfa));if(_0x176bfa['error']){if(_0x176bfa[_0x9edd('0x19')][_0x9edd('0x1a')]===0x1f4){logger[_0x9edd('0x19')]('MailMessage,\x20%s,\x20%s',_0x1b73d1,_0x176bfa[_0x9edd('0x19')][_0x9edd('0x1b')]);return _0x3a7b84(_0x176bfa[_0x9edd('0x19')]['message']);}logger[_0x9edd('0x19')]('MailMessage,\x20%s,\x20%s',_0x1b73d1,_0x176bfa[_0x9edd('0x19')][_0x9edd('0x1b')]);return _0x287ddd(_0x176bfa['error']['message']);}else{logger[_0x9edd('0x13')]('MailMessage,\x20%s,\x20%s',_0x1b73d1,_0x9edd('0x15'));_0x287ddd(_0x176bfa['result']['message']);}})[_0x9edd('0x1c')](function(_0x1c46a8){logger['error']('MailMessage,\x20%s,\x20%s',_0x1b73d1,_0x1c46a8);_0x3a7b84(_0x1c46a8);});});}function respondWithResult(_0x341d67,_0x186186){_0x186186=_0x186186||0xc8;return function(_0x477878){if(_0x477878){return _0x341d67['status'](_0x186186)[_0x9edd('0x1d')](_0x477878);}};}function respondWithFilteredResult(_0x1dca43,_0x44a6c1){return function(_0x2ca65f){if(_0x2ca65f){var _0x339a0d=typeof _0x44a6c1['offset']===_0x9edd('0x1e')&&typeof _0x44a6c1[_0x9edd('0x1f')]===_0x9edd('0x1e');var _0x2f9f86=_0x2ca65f[_0x9edd('0x20')];var _0x4d507f=_0x339a0d?0x0:_0x44a6c1['offset'];var _0x3276ee=_0x339a0d?_0x2ca65f[_0x9edd('0x20')]:_0x44a6c1[_0x9edd('0x21')]+_0x44a6c1[_0x9edd('0x1f')];var _0x3c2227;if(_0x3276ee>=_0x2f9f86){_0x3276ee=_0x2f9f86;_0x3c2227=0xc8;}else{_0x3c2227=0xce;}_0x1dca43['status'](_0x3c2227);return _0x1dca43['set'](_0x9edd('0x22'),_0x4d507f+'-'+_0x3276ee+'/'+_0x2f9f86)[_0x9edd('0x1d')](_0x2ca65f);}return null;};}function saveUpdates(_0x1c762c){return function(_0x52746a){if(_0x52746a){return _0x52746a[_0x9edd('0x23')](_0x1c762c)[_0x9edd('0x24')](function(_0x2ae8dd){return _0x2ae8dd;});}return null;};}function removeEntity(_0x41af53){return function(_0x5eccfb){if(_0x5eccfb){return _0x5eccfb[_0x9edd('0x25')]()[_0x9edd('0x24')](function(){_0x41af53[_0x9edd('0x26')](0xcc)[_0x9edd('0x27')]();});}};}function handleEntityNotFound(_0xbbf08f){return function(_0x42e664){if(!_0x42e664){_0xbbf08f[_0x9edd('0x28')](0x194);}return _0x42e664;};}function handleError(_0x1fba7b,_0x19b6c1){_0x19b6c1=_0x19b6c1||0x1f4;return function(_0x1c2e2b){logger[_0x9edd('0x19')](_0x1c2e2b[_0x9edd('0x29')]);if(_0x1c2e2b[_0x9edd('0x2a')]){delete _0x1c2e2b[_0x9edd('0x2a')];}_0x1fba7b[_0x9edd('0x26')](_0x19b6c1)['send'](_0x1c2e2b);};}exports[_0x9edd('0x2b')]=function(_0x259259,_0x267c74){var _0x5d1707={},_0x2d2f88={},_0x3990fb={'count':0x0,'rows':[]};var _0xde9b13=_[_0x9edd('0x2c')](db[_0x9edd('0x2d')][_0x9edd('0x2e')],function(_0x473068){return{'name':_0x473068[_0x9edd('0x2f')],'type':_0x473068[_0x9edd('0x30')][_0x9edd('0x31')]};});_0x2d2f88[_0x9edd('0x32')]=_[_0x9edd('0x2c')](_0xde9b13,_0x9edd('0x2a'));_0x2d2f88[_0x9edd('0x33')]=_['keys'](_0x259259[_0x9edd('0x33')]);_0x2d2f88['filters']=_[_0x9edd('0x34')](_0x2d2f88[_0x9edd('0x32')],_0x2d2f88[_0x9edd('0x33')]);_0x5d1707[_0x9edd('0x35')]=_[_0x9edd('0x34')](_0x2d2f88['model'],qs[_0x9edd('0x36')](_0x259259[_0x9edd('0x33')][_0x9edd('0x36')]));_0x5d1707[_0x9edd('0x35')]=_0x5d1707[_0x9edd('0x35')][_0x9edd('0x37')]?_0x5d1707[_0x9edd('0x35')]:_0x2d2f88[_0x9edd('0x32')];if(!_0x259259[_0x9edd('0x33')][_0x9edd('0x38')]('nolimit')){_0x5d1707[_0x9edd('0x1f')]=qs['limit'](_0x259259[_0x9edd('0x33')]['limit']);_0x5d1707[_0x9edd('0x21')]=qs[_0x9edd('0x21')](_0x259259[_0x9edd('0x33')]['offset']);}_0x5d1707[_0x9edd('0x39')]=qs[_0x9edd('0x3a')](_0x259259[_0x9edd('0x33')]['sort']);_0x5d1707[_0x9edd('0x3b')]=qs['filters'](_[_0x9edd('0x3c')](_0x259259[_0x9edd('0x33')],_0x2d2f88['filters']),_0xde9b13);if(_0x259259[_0x9edd('0x33')][_0x9edd('0x3d')]){_0x5d1707[_0x9edd('0x3b')]=_[_0x9edd('0x3e')](_0x5d1707['where'],{'$or':_[_0x9edd('0x2c')](_0xde9b13,function(_0x5bbdf8){if(_0x5bbdf8[_0x9edd('0x30')]!==_0x9edd('0x3f')){var _0x587d74={};_0x587d74[_0x5bbdf8[_0x9edd('0x2a')]]={'$like':'%'+_0x259259['query']['filter']+'%'};return _0x587d74;}})});}_0x5d1707=_[_0x9edd('0x3e')]({},_0x5d1707,_0x259259[_0x9edd('0x40')]);var _0x1f276b={'where':_0x5d1707[_0x9edd('0x3b')]};return db[_0x9edd('0x2d')][_0x9edd('0x20')](_0x1f276b)[_0x9edd('0x24')](function(_0x75efbe){_0x3990fb[_0x9edd('0x20')]=_0x75efbe;if(_0x259259[_0x9edd('0x33')][_0x9edd('0x41')]){_0x5d1707[_0x9edd('0x42')]=[{'all':!![]}];}return db[_0x9edd('0x2d')][_0x9edd('0x43')](_0x5d1707);})[_0x9edd('0x24')](function(_0x5416f8){_0x3990fb[_0x9edd('0x44')]=_0x5416f8;return _0x3990fb;})[_0x9edd('0x24')](respondWithFilteredResult(_0x267c74,_0x5d1707))[_0x9edd('0x1c')](handleError(_0x267c74,null));};exports[_0x9edd('0x45')]=function(_0x241929,_0x3ecdfd){var _0x10d41e={'raw':!![],'where':{'id':_0x241929['params']['id']}},_0x4e9ad1={};_0x4e9ad1['model']=_[_0x9edd('0x46')](db['MailMessage'][_0x9edd('0x2e')]);_0x4e9ad1[_0x9edd('0x33')]=_[_0x9edd('0x46')](_0x241929[_0x9edd('0x33')]);_0x4e9ad1[_0x9edd('0x47')]=_['intersection'](_0x4e9ad1[_0x9edd('0x32')],_0x4e9ad1[_0x9edd('0x33')]);_0x10d41e[_0x9edd('0x35')]=_['intersection'](_0x4e9ad1[_0x9edd('0x32')],qs[_0x9edd('0x36')](_0x241929[_0x9edd('0x33')][_0x9edd('0x36')]));_0x10d41e[_0x9edd('0x35')]=_0x10d41e[_0x9edd('0x35')]['length']?_0x10d41e[_0x9edd('0x35')]:_0x4e9ad1[_0x9edd('0x32')];if(_0x241929['query'][_0x9edd('0x41')]){_0x10d41e[_0x9edd('0x42')]=[{'all':!![]}];}_0x10d41e=_['merge']({},_0x10d41e,_0x241929[_0x9edd('0x40')]);return db[_0x9edd('0x2d')][_0x9edd('0x48')](_0x10d41e)['then'](handleEntityNotFound(_0x3ecdfd,null))[_0x9edd('0x24')](respondWithResult(_0x3ecdfd,null))[_0x9edd('0x1c')](handleError(_0x3ecdfd,null));};exports[_0x9edd('0x23')]=function(_0x28c7bd,_0x53f6e3){if(_0x28c7bd[_0x9edd('0x49')]['id']){delete _0x28c7bd[_0x9edd('0x49')]['id'];}return db[_0x9edd('0x2d')]['find']({'where':{'id':_0x28c7bd[_0x9edd('0x4a')]['id']}})[_0x9edd('0x24')](handleEntityNotFound(_0x53f6e3,null))['then'](saveUpdates(_0x28c7bd[_0x9edd('0x49')],null))['then'](respondWithResult(_0x53f6e3,null))[_0x9edd('0x1c')](handleError(_0x53f6e3,null));};exports[_0x9edd('0x25')]=function(_0x24245f,_0x3fcdf5){return db[_0x9edd('0x2d')][_0x9edd('0x48')]({'where':{'id':_0x24245f[_0x9edd('0x4a')]['id']}})[_0x9edd('0x24')](handleEntityNotFound(_0x3fcdf5,null))[_0x9edd('0x24')](removeEntity(_0x3fcdf5,null))[_0x9edd('0x1c')](handleError(_0x3fcdf5,null));};exports[_0x9edd('0x4b')]=function(_0x5a3b1d,_0x161bea){return db[_0x9edd('0x2d')][_0x9edd('0x4b')]()['then'](respondWithResult(_0x161bea,null))[_0x9edd('0x1c')](handleError(_0x161bea,null));};exports['create']=function(_0x54d83d,_0x54ecfa){return db[_0x9edd('0x2d')][_0x9edd('0x4c')](_0x54d83d[_0x9edd('0x49')])[_0x9edd('0x24')](function(_0x48a900){if(_0x48a900){if(_0x48a900['direction']==='out'&&!_0x48a900[_0x9edd('0x4d')]){var _0x5f666b,_0xd5090a,_0x1091ff;if(_0x54d83d[_0x9edd('0x49')]['to']){_0xd5090a=_0x54d83d[_0x9edd('0x49')]['to'][_0x9edd('0x4e')](',')[0x0];}return db[_0x9edd('0x4f')]['findOne']({'where':{'id':_0x48a900[_0x9edd('0x50')]},'include':[{'model':db['CmList'],'as':_0x9edd('0x51'),'include':[{'model':db[_0x9edd('0x52')],'as':'Contacts','where':{'email':_0xd5090a},'limit':0x1,'order':[[_0x9edd('0x53'),_0x9edd('0x54')]]}]},{'model':db[_0x9edd('0x55')],'as':'Smtp','raw':!![]}]})[_0x9edd('0x24')](function(_0x2e1ce3){_0x5f666b=_0x2e1ce3;if(_0x5f666b&&_0x5f666b[_0x9edd('0x56')]){var _0x15ebfa={'tls':{'rejectUnauthorized':![]}};if(_[_0x9edd('0x57')](_0x5f666b[_0x9edd('0x56')]['service'])){_0x15ebfa['host']=_0x5f666b[_0x9edd('0x56')]['host'];_0x15ebfa[_0x9edd('0x58')]=_0x5f666b[_0x9edd('0x56')][_0x9edd('0x58')];_0x15ebfa[_0x9edd('0x59')]=_0x5f666b['Smtp'][_0x9edd('0x59')];if(_0x5f666b['Smtp'][_0x9edd('0x5a')]){_0x15ebfa[_0x9edd('0x5b')]={'user':_0x5f666b[_0x9edd('0x56')]['user'],'pass':_0x5f666b[_0x9edd('0x56')]['pass']};}}else{_0x15ebfa[_0x9edd('0x5c')]=_0x5f666b[_0x9edd('0x56')]['service'];_0x15ebfa[_0x9edd('0x5b')]={'user':_0x5f666b['Smtp'][_0x9edd('0x5d')],'pass':_0x5f666b[_0x9edd('0x56')][_0x9edd('0x5e')]};_0x15ebfa['secure']=_0x5f666b[_0x9edd('0x56')][_0x9edd('0x59')];}if(_0x54d83d[_0x9edd('0x49')][_0x9edd('0x5f')]&&_0x54d83d[_0x9edd('0x49')]['attachments']['length']){for(var _0x2e1a96=0x0;_0x2e1a96<_0x54d83d[_0x9edd('0x49')]['attachments']['length'];_0x2e1a96+=0x1){_0x54d83d['body'][_0x9edd('0x5f')][_0x2e1a96]={'filename':_0x54d83d['body']['attachments'][_0x2e1a96][_0x9edd('0x2a')],'path':path[_0x9edd('0x60')](config['root'],_0x9edd('0x61'),_0x54d83d[_0x9edd('0x49')][_0x9edd('0x5f')][_0x2e1a96]['basename'])};}}_0x1091ff={'account':_0x15ebfa,'message':_0x54d83d[_0x9edd('0x49')]};return;}})['then'](function(){if(_0x5f666b[_0x9edd('0x51')]){if(_0x5f666b[_0x9edd('0x51')]['Contacts'][_0x9edd('0x37')]){return _0x5f666b[_0x9edd('0x51')]['Contacts'][0x0];}else{return db[_0x9edd('0x52')][_0x9edd('0x4c')](_[_0x9edd('0x62')](_0x54d83d[_0x9edd('0x49')],{'firstName':_0x54d83d['body']['to'],'email':_0x54d83d[_0x9edd('0x49')]['to'],'phone':_0x54d83d['body']['to'],'ListId':_0x5f666b[_0x9edd('0x63')]}));}}else{throw new Error(_0x9edd('0x64'));}})[_0x9edd('0x24')](function(){if(_0x1091ff){return respondWithRpcPromise('SendMail',_0x9edd('0x65'),_0x1091ff,client9003)[_0x9edd('0x24')](function(_0x130dba){return _0x48a900[_0x9edd('0x23')]({'read':!![],'messageId':_0x130dba[_0x9edd('0x66')],'sentAt':moment()[_0x9edd('0x67')](_0x9edd('0x68'))});})['catch'](function(_0x5e29d0){logger[_0x9edd('0x19')]('%s',JSON[_0x9edd('0x18')](_0x5e29d0));return _0x48a900;});}return _0x48a900;});}return _0x48a900;}})[_0x9edd('0x24')](respondWithResult(_0x54ecfa,0xc9))[_0x9edd('0x1c')](handleError(_0x54ecfa,null));};exports[_0x9edd('0x69')]=function(_0x52f6f3,_0x2e40c8){var _0x5d56a={'agent':{},'channel':_0x9edd('0x6a')};if(_0x52f6f3['body']['id']){delete _0x52f6f3[_0x9edd('0x49')]['id'];}_0x52f6f3[_0x9edd('0x49')]['read']=!![];_0x52f6f3[_0x9edd('0x49')][_0x9edd('0x6b')]=moment()['format'](_0x9edd('0x68'));_0x52f6f3[_0x9edd('0x49')]['UserId']=_0x52f6f3[_0x9edd('0x49')]['UserId']||_0x52f6f3['user']['id'];_0x5d56a[_0x9edd('0x6c')]['id']=_0x52f6f3[_0x9edd('0x49')][_0x9edd('0x6d')];return db['MailMessage'][_0x9edd('0x48')]({'where':{'id':_0x52f6f3[_0x9edd('0x4a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2e40c8,null))[_0x9edd('0x24')](saveUpdates(_0x52f6f3[_0x9edd('0x49')],null))[_0x9edd('0x24')](function(_0x1ad198){if(_0x1ad198){_0x5d56a['message']=_0x1ad198['get']({'plain':!![]});return db[_0x9edd('0x6e')]['find']({'where':{'id':_0x1ad198[_0x9edd('0x6f')]}});}return null;})[_0x9edd('0x24')](handleEntityNotFound(_0x2e40c8,null))[_0x9edd('0x24')](function(_0x3cfd35){if(_0x3cfd35){return _0x3cfd35[_0x9edd('0x23')]({'UserId':_0x52f6f3[_0x9edd('0x49')][_0x9edd('0x6d')],'read1stAt':_[_0x9edd('0x57')](_0x3cfd35[_0x9edd('0x70')])?moment()['format'](_0x9edd('0x68')):undefined});}return null;})[_0x9edd('0x24')](function(_0x2c7562){if(_0x2c7562){_0x5d56a[_0x9edd('0x71')]=_0x2c7562[_0x9edd('0x72')]({'plain':!![]});interaction_log[_0x9edd('0x13')](_0x9edd('0x73'),_0x52f6f3['user']['id'],_0x52f6f3[_0x9edd('0x5d')][_0x9edd('0x2a')],_0x52f6f3['user'][_0x9edd('0x74')],_0x5d56a[_0x9edd('0x71')]['id'],_0x52f6f3['body']?JSON[_0x9edd('0x18')](_0x52f6f3[_0x9edd('0x49')]):_0x9edd('0x75'));return respondWithRpcPromise('AcceptMessage',_0x9edd('0x76'),_0x5d56a);}return null;})[_0x9edd('0x24')](function(_0x3f04d3){var _0x5a7de3='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3f04d3['message']['ContactId'];return db[_0x9edd('0x77')][_0x9edd('0x33')](_0x5a7de3,{'type':db[_0x9edd('0x78')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x56d794){return _0x56d794;});})[_0x9edd('0x24')](function(_0x20762d){if(_0x20762d){_0x5d56a[_0x9edd('0x1b')][_0x9edd('0x79')]=_0x20762d[0x0];if(!_0x52f6f3[_0x9edd('0x49')][_0x9edd('0x6d')])return;return db[_0x9edd('0x7a')][_0x9edd('0x48')]({'where':{'id':_0x52f6f3[_0x9edd('0x49')][_0x9edd('0x6d')],'role':_0x9edd('0x6c')},'attributes':['id','name',_0x9edd('0x7b'),_0x9edd('0x7c'),_0x9edd('0x7d')],'raw':!![]});}return null;})[_0x9edd('0x24')](function(_0x104afc){if(!_0x104afc)return null;_0x5d56a[_0x9edd('0x1b')][_0x9edd('0x6c')]=_0x104afc;return _0x5d56a;})[_0x9edd('0x24')](function(_0x4a7889){if(_0x4a7889){if(_0x52f6f3['body'][_0x9edd('0x7e')]){_0x5d56a['message'][_0x9edd('0x7f')]=util['format'](_0x9edd('0x80'),_0x52f6f3[_0x9edd('0x5d')]['name']);_0x5d56a[_0x9edd('0x1b')][_0x9edd('0x81')]=_0x5d56a['channel'];_0x5d56a[_0x9edd('0x1b')][_0x9edd('0x82')]=_0x9edd('0x69');_0x5d56a[_0x9edd('0x1b')][_0x9edd('0x49')]=htmlToText['fromString'](_0x5d56a[_0x9edd('0x1b')][_0x9edd('0x49')]);return respondWithRpcPromise(_0x9edd('0x83'),_0x9edd('0x83'),{'event':_0x9edd('0x84'),'message':_0x5d56a['message']},client9002)['then'](function(){return _0x5d56a;});}return _0x5d56a;}return null;})['then'](respondWithResult(_0x2e40c8,null))['catch'](handleError(_0x2e40c8,null));};exports['reject']=function(_0x2da088,_0x5d566e){var _0x58cb3f={'agent':{},'channel':_0x9edd('0x6a')};if(_0x2da088[_0x9edd('0x49')]['id']){delete _0x2da088[_0x9edd('0x49')]['id'];}_0x2da088[_0x9edd('0x49')][_0x9edd('0x6d')]=_0x2da088[_0x9edd('0x49')][_0x9edd('0x6d')]||_0x2da088[_0x9edd('0x5d')]['id'];_0x58cb3f[_0x9edd('0x6c')]['id']=_0x2da088[_0x9edd('0x49')]['UserId'];return db[_0x9edd('0x2d')][_0x9edd('0x48')]({'where':{'id':_0x2da088[_0x9edd('0x4a')]['id'],'UserId':null}})[_0x9edd('0x24')](handleEntityNotFound(_0x5d566e,null))[_0x9edd('0x24')](function(_0x23e925){if(_0x23e925){_0x58cb3f[_0x9edd('0x1b')]=_0x23e925[_0x9edd('0x72')]({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x23e925[_0x9edd('0x6f')]}});}return null;})[_0x9edd('0x24')](handleEntityNotFound(_0x5d566e,null))[_0x9edd('0x24')](function(_0x120d0f){if(_0x120d0f){_0x58cb3f[_0x9edd('0x71')]=_0x120d0f[_0x9edd('0x72')]({'plain':!![]});interaction_log[_0x9edd('0x13')](_0x9edd('0x85'),_0x2da088[_0x9edd('0x5d')]['id'],_0x2da088[_0x9edd('0x5d')][_0x9edd('0x2a')],_0x2da088[_0x9edd('0x5d')][_0x9edd('0x74')],_0x58cb3f[_0x9edd('0x71')]['id'],_0x2da088['body']?JSON[_0x9edd('0x18')](_0x2da088[_0x9edd('0x49')]):'null');return respondWithRpcPromise(_0x9edd('0x86'),_0x9edd('0x87'),_0x58cb3f);}return null;})[_0x9edd('0x24')](function(_0x2b4d4c){var _0x559503=_0x9edd('0x88')+_0x2b4d4c[_0x9edd('0x1b')][_0x9edd('0x89')];return db[_0x9edd('0x77')][_0x9edd('0x33')](_0x559503,{'type':db['Sequelize'][_0x9edd('0x8a')][_0x9edd('0x8b')],'raw':!![]})[_0x9edd('0x24')](function(_0x4633eb){return _0x4633eb;});})[_0x9edd('0x24')](function(_0x59927d){if(_0x59927d){_0x58cb3f['message'][_0x9edd('0x79')]=_0x59927d[0x0];if(!_0x2da088['body'][_0x9edd('0x6d')])return;return db['User'][_0x9edd('0x48')]({'where':{'id':_0x2da088[_0x9edd('0x49')][_0x9edd('0x6d')],'role':_0x9edd('0x6c')},'attributes':['id',_0x9edd('0x2a'),_0x9edd('0x7b'),'email',_0x9edd('0x7d')],'raw':!![]});}return null;})[_0x9edd('0x24')](function(_0x3aae72){if(!_0x3aae72)return null;_0x58cb3f[_0x9edd('0x1b')][_0x9edd('0x6c')]=_0x3aae72;return _0x58cb3f;})[_0x9edd('0x24')](function(_0x2f8fb6){if(_0x2f8fb6){_0x2f8fb6[_0x9edd('0x1b')]['interface']=util[_0x9edd('0x67')](_0x9edd('0x80'),_0x2da088[_0x9edd('0x5d')][_0x9edd('0x2a')]);_0x2f8fb6[_0x9edd('0x1b')][_0x9edd('0x81')]=_0x58cb3f[_0x9edd('0x81')];_0x2f8fb6[_0x9edd('0x1b')][_0x9edd('0x82')]=_0x9edd('0x8c');_0x2f8fb6[_0x9edd('0x1b')][_0x9edd('0x49')]=htmlToText[_0x9edd('0x8d')](_0x58cb3f[_0x9edd('0x1b')][_0x9edd('0x49')]);respondWithRpcPromise(_0x9edd('0x83'),_0x9edd('0x83'),{'event':_0x9edd('0x8e'),'message':_0x2f8fb6[_0x9edd('0x1b')]},client9002);return _0x58cb3f;}return null;})[_0x9edd('0x24')](respondWithResult(_0x5d566e,null))[_0x9edd('0x1c')](handleError(_0x5d566e,null));};exports['download']=function(_0xa704eb,_0x553018){var _0x4ca7e4=moment()[_0x9edd('0x8f')]()[_0x9edd('0x90')]();var _0x220c00=path[_0x9edd('0x60')](config[_0x9edd('0x91')],_0x9edd('0x92'),_0x9edd('0x93'),_0x9edd('0x94'));var _0x3e5a45=path[_0x9edd('0x60')](config['root'],_0x9edd('0x92'),_0x9edd('0x93'),'attachments');var _0x568067=util[_0x9edd('0x67')](_0x9edd('0x95'),_0x4ca7e4);return db[_0x9edd('0x2d')][_0x9edd('0x48')]({'where':{'id':_0xa704eb['params']['id']},'attributes':['id','body',_0x9edd('0x96'),'to','cc','bcc',_0x9edd('0x97'),_0x9edd('0x98')],'include':_0xa704eb[_0x9edd('0x33')]['attachments']?[{'model':db['Attachment'],'as':'Attachments'}]:undefined})[_0x9edd('0x24')](handleEntityNotFound(_0x553018,null))[_0x9edd('0x24')](function(_0x7b0fc8){if(_0x7b0fc8){var _0x5bfbfd=_0x7b0fc8;var _0xb2e72={'from':_0x5bfbfd[_0x9edd('0x96')],'to':_0x5bfbfd['to'],'subject':_0x5bfbfd['subject'],'html':_0x5bfbfd[_0x9edd('0x49')],'headers':{'Date':moment(_0x5bfbfd[_0x9edd('0x98')])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x7b0fc8['cc']){_0xb2e72[_0x9edd('0x99')]['Cc']=_0x7b0fc8['cc'];}if(_0x7b0fc8[_0x9edd('0x9a')]){_0xb2e72['headers'][_0x9edd('0x9b')]=_0x7b0fc8[_0x9edd('0x9a')];}return new BPromise(function(_0x54c6a0,_0x201d76){if(_0x7b0fc8['Attachments']){for(var _0x308a0f=0x0;_0x308a0f<_0x7b0fc8[_0x9edd('0x9c')][_0x9edd('0x37')];_0x308a0f++){var _0x742e13=_0x7b0fc8[_0x9edd('0x9c')][_0x308a0f];var _0x3e6426=path['join'](_0x3e5a45,_0x742e13[_0x9edd('0x9d')]);if(fs[_0x9edd('0x9e')](_0x3e6426)){_0xb2e72[_0x9edd('0x5f')]['push']({'name':_0x742e13[_0x9edd('0x2a')],'contentType':_0x742e13['type'],'data':fs[_0x9edd('0x9f')](_0x3e6426)});}}}emlformat[_0x9edd('0xa0')](_0xb2e72,function(_0x25da04,_0x41b0ea){if(_0x25da04)return _0x201d76(_0x25da04);fs['writeFileSync'](path['join'](_0x220c00,_0x568067),_0x41b0ea);return _0x54c6a0(_0x41b0ea);});});}})['then'](function(_0x12dcfa){if(_0x12dcfa){return _0x553018[_0x9edd('0xa1')](path[_0x9edd('0x60')](_0x220c00,_0x568067),_0x568067,function(_0x50af78){if(!_0x50af78)fs[_0x9edd('0xa2')](path[_0x9edd('0x60')](_0x220c00,_0x568067));});}})[_0x9edd('0x1c')](handleError(_0x553018,null));}; \ No newline at end of file +var _0x9c44=['acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','SELECT','email','internal','manual','SIP/%s','channel','event','EventManager','acceptmessage','MailInteractionId','RejectMessage','rejectMessage','Sequelize','User','fullname','interface','reject','fromString','rejectmessage','unix','toString','join','server','files','tmp','message-%s.eml','from','bcc','subject','Attachment','Attachments','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','existsSync','push','readFileSync','build','writeFileSync','download','bluebird','util','path','lodash','ioredis','html-to-text','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','offset','undefined','count','set','Content-Range','json','update','destroy','end','stack','name','send','index','map','MailMessage','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','length','body','find','create','direction','out','secret','split','MailAccount','findOne','MailAccountId','CmList','CmContact','Contacts','DESC','Smtp','isNil','service','host','port','secure','user','pass','auth','attachments','root','server/files/attachments','basename','List','ListId','List\x20not\x20found','SendMail','sendMail','messageId','accept','mail','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','MailInteraction','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage'];(function(_0x489ded,_0xdf9a07){var _0x467c31=function(_0x4fcf24){while(--_0x4fcf24){_0x489ded['push'](_0x489ded['shift']());}};_0x467c31(++_0xdf9a07);}(_0x9c44,0x178));var _0x49c4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c44[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var moment=require('moment');var BPromise=require(_0x49c4('0x0'));var util=require(_0x49c4('0x1'));var path=require(_0x49c4('0x2'));var fs=require('fs');var _=require(_0x49c4('0x3'));var Redis=require(_0x49c4('0x4'));var htmlToText=require(_0x49c4('0x5'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x49c4('0x6'));var interaction_log=require('../../config/logger')(_0x49c4('0x7'));var config=require(_0x49c4('0x8'));var db=require(_0x49c4('0x9'))['db'];config[_0x49c4('0xa')]=_[_0x49c4('0xb')](config['redis'],{'host':_0x49c4('0xc'),'port':0x18eb});var socket=require(_0x49c4('0xd'))(new Redis(config[_0x49c4('0xa')]));require(_0x49c4('0xe'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x49c4('0xf')][_0x49c4('0x10')]({'port':0x232c});var client9003=jayson['client'][_0x49c4('0x10')]({'port':0x232b});var client9002=jayson[_0x49c4('0xf')]['http']({'port':0x232a});function respondWithRpcPromise(_0x536d42,_0x1d19bf,_0x6d1b08,_0x5487cd){return new BPromise(function(_0x7df3a9,_0x403bfb){var _0x5f2fd9=_0x5487cd||client;return _0x5f2fd9[_0x49c4('0x11')](_0x536d42,_0x6d1b08)[_0x49c4('0x12')](function(_0x21f15a){logger[_0x49c4('0x13')](_0x49c4('0x14'),_0x1d19bf,_0x49c4('0x15'));logger[_0x49c4('0x16')](_0x49c4('0x17'),_0x1d19bf,'request\x20sent',JSON[_0x49c4('0x18')](_0x21f15a));if(_0x21f15a[_0x49c4('0x19')]){if(_0x21f15a[_0x49c4('0x19')][_0x49c4('0x1a')]===0x1f4){logger[_0x49c4('0x19')]('MailMessage,\x20%s,\x20%s',_0x1d19bf,_0x21f15a[_0x49c4('0x19')][_0x49c4('0x1b')]);return _0x403bfb(_0x21f15a['error']['message']);}logger[_0x49c4('0x19')](_0x49c4('0x14'),_0x1d19bf,_0x21f15a[_0x49c4('0x19')]['message']);return _0x7df3a9(_0x21f15a[_0x49c4('0x19')]['message']);}else{logger[_0x49c4('0x13')](_0x49c4('0x14'),_0x1d19bf,_0x49c4('0x15'));_0x7df3a9(_0x21f15a[_0x49c4('0x1c')][_0x49c4('0x1b')]);}})[_0x49c4('0x1d')](function(_0x280893){logger[_0x49c4('0x19')](_0x49c4('0x14'),_0x1d19bf,_0x280893);_0x403bfb(_0x280893);});});}function respondWithResult(_0x578447,_0x527126){_0x527126=_0x527126||0xc8;return function(_0x57f502){if(_0x57f502){return _0x578447[_0x49c4('0x1e')](_0x527126)['json'](_0x57f502);}};}function respondWithFilteredResult(_0x592bb8,_0x2263ae){return function(_0x15581b){if(_0x15581b){var _0x26c640=typeof _0x2263ae[_0x49c4('0x1f')]==='undefined'&&typeof _0x2263ae['limit']===_0x49c4('0x20');var _0x9cb797=_0x15581b['count'];var _0x207358=_0x26c640?0x0:_0x2263ae[_0x49c4('0x1f')];var _0x210159=_0x26c640?_0x15581b[_0x49c4('0x21')]:_0x2263ae['offset']+_0x2263ae['limit'];var _0x449960;if(_0x210159>=_0x9cb797){_0x210159=_0x9cb797;_0x449960=0xc8;}else{_0x449960=0xce;}_0x592bb8['status'](_0x449960);return _0x592bb8[_0x49c4('0x22')](_0x49c4('0x23'),_0x207358+'-'+_0x210159+'/'+_0x9cb797)[_0x49c4('0x24')](_0x15581b);}return null;};}function saveUpdates(_0x372a47){return function(_0x5987ae){if(_0x5987ae){return _0x5987ae[_0x49c4('0x25')](_0x372a47)[_0x49c4('0x12')](function(_0x46e04d){return _0x46e04d;});}return null;};}function removeEntity(_0x4f28a2){return function(_0x6329b3){if(_0x6329b3){return _0x6329b3[_0x49c4('0x26')]()[_0x49c4('0x12')](function(){_0x4f28a2[_0x49c4('0x1e')](0xcc)[_0x49c4('0x27')]();});}};}function handleEntityNotFound(_0x2cbd88){return function(_0x46f7ea){if(!_0x46f7ea){_0x2cbd88['sendStatus'](0x194);}return _0x46f7ea;};}function handleError(_0x4f4495,_0x59eb84){_0x59eb84=_0x59eb84||0x1f4;return function(_0x134928){logger[_0x49c4('0x19')](_0x134928[_0x49c4('0x28')]);if(_0x134928[_0x49c4('0x29')]){delete _0x134928[_0x49c4('0x29')];}_0x4f4495['status'](_0x59eb84)[_0x49c4('0x2a')](_0x134928);};}exports[_0x49c4('0x2b')]=function(_0x2e7a69,_0x24bba9){var _0x58e252={},_0x57a29c={},_0xce57ef={'count':0x0,'rows':[]};var _0x9a1bed=_[_0x49c4('0x2c')](db[_0x49c4('0x2d')][_0x49c4('0x2e')],function(_0x4a0c7a){return{'name':_0x4a0c7a[_0x49c4('0x2f')],'type':_0x4a0c7a[_0x49c4('0x30')][_0x49c4('0x31')]};});_0x57a29c['model']=_['map'](_0x9a1bed,_0x49c4('0x29'));_0x57a29c[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x2e7a69[_0x49c4('0x32')]);_0x57a29c[_0x49c4('0x34')]=_[_0x49c4('0x35')](_0x57a29c[_0x49c4('0x36')],_0x57a29c[_0x49c4('0x32')]);_0x58e252[_0x49c4('0x37')]=_['intersection'](_0x57a29c[_0x49c4('0x36')],qs['fields'](_0x2e7a69[_0x49c4('0x32')][_0x49c4('0x38')]));_0x58e252[_0x49c4('0x37')]=_0x58e252[_0x49c4('0x37')]['length']?_0x58e252[_0x49c4('0x37')]:_0x57a29c[_0x49c4('0x36')];if(!_0x2e7a69[_0x49c4('0x32')]['hasOwnProperty'](_0x49c4('0x39'))){_0x58e252[_0x49c4('0x3a')]=qs[_0x49c4('0x3a')](_0x2e7a69[_0x49c4('0x32')][_0x49c4('0x3a')]);_0x58e252[_0x49c4('0x1f')]=qs[_0x49c4('0x1f')](_0x2e7a69[_0x49c4('0x32')][_0x49c4('0x1f')]);}_0x58e252[_0x49c4('0x3b')]=qs[_0x49c4('0x3c')](_0x2e7a69['query'][_0x49c4('0x3c')]);_0x58e252[_0x49c4('0x3d')]=qs[_0x49c4('0x34')](_[_0x49c4('0x3e')](_0x2e7a69[_0x49c4('0x32')],_0x57a29c[_0x49c4('0x34')]),_0x9a1bed);if(_0x2e7a69[_0x49c4('0x32')][_0x49c4('0x3f')]){_0x58e252[_0x49c4('0x3d')]=_[_0x49c4('0x40')](_0x58e252[_0x49c4('0x3d')],{'$or':_[_0x49c4('0x2c')](_0x9a1bed,function(_0x326142){if(_0x326142['type']!==_0x49c4('0x41')){var _0x49829e={};_0x49829e[_0x326142[_0x49c4('0x29')]]={'$like':'%'+_0x2e7a69[_0x49c4('0x32')][_0x49c4('0x3f')]+'%'};return _0x49829e;}})});}_0x58e252=_[_0x49c4('0x40')]({},_0x58e252,_0x2e7a69[_0x49c4('0x42')]);var _0x281b83={'where':_0x58e252['where']};return db['MailMessage'][_0x49c4('0x21')](_0x281b83)[_0x49c4('0x12')](function(_0x38349b){_0xce57ef[_0x49c4('0x21')]=_0x38349b;if(_0x2e7a69['query'][_0x49c4('0x43')]){_0x58e252[_0x49c4('0x44')]=[{'all':!![]}];}return db[_0x49c4('0x2d')][_0x49c4('0x45')](_0x58e252);})[_0x49c4('0x12')](function(_0x3bde49){_0xce57ef[_0x49c4('0x46')]=_0x3bde49;return _0xce57ef;})[_0x49c4('0x12')](respondWithFilteredResult(_0x24bba9,_0x58e252))[_0x49c4('0x1d')](handleError(_0x24bba9,null));};exports['show']=function(_0x2ad771,_0x4d27d0){var _0x33696e={'raw':!![],'where':{'id':_0x2ad771[_0x49c4('0x47')]['id']}},_0x628423={};_0x628423[_0x49c4('0x36')]=_[_0x49c4('0x33')](db['MailMessage'][_0x49c4('0x2e')]);_0x628423[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x2ad771[_0x49c4('0x32')]);_0x628423[_0x49c4('0x34')]=_[_0x49c4('0x35')](_0x628423[_0x49c4('0x36')],_0x628423['query']);_0x33696e[_0x49c4('0x37')]=_['intersection'](_0x628423[_0x49c4('0x36')],qs[_0x49c4('0x38')](_0x2ad771[_0x49c4('0x32')][_0x49c4('0x38')]));_0x33696e[_0x49c4('0x37')]=_0x33696e[_0x49c4('0x37')][_0x49c4('0x48')]?_0x33696e['attributes']:_0x628423[_0x49c4('0x36')];if(_0x2ad771[_0x49c4('0x32')]['includeAll']){_0x33696e[_0x49c4('0x44')]=[{'all':!![]}];}_0x33696e=_[_0x49c4('0x40')]({},_0x33696e,_0x2ad771[_0x49c4('0x42')]);return db[_0x49c4('0x2d')]['find'](_0x33696e)['then'](handleEntityNotFound(_0x4d27d0,null))[_0x49c4('0x12')](respondWithResult(_0x4d27d0,null))['catch'](handleError(_0x4d27d0,null));};exports[_0x49c4('0x25')]=function(_0x1f941f,_0x3811b2){if(_0x1f941f[_0x49c4('0x49')]['id']){delete _0x1f941f[_0x49c4('0x49')]['id'];}return db[_0x49c4('0x2d')][_0x49c4('0x4a')]({'where':{'id':_0x1f941f['params']['id']}})[_0x49c4('0x12')](handleEntityNotFound(_0x3811b2,null))[_0x49c4('0x12')](saveUpdates(_0x1f941f[_0x49c4('0x49')],null))[_0x49c4('0x12')](respondWithResult(_0x3811b2,null))[_0x49c4('0x1d')](handleError(_0x3811b2,null));};exports[_0x49c4('0x26')]=function(_0x156748,_0x25d174){return db[_0x49c4('0x2d')][_0x49c4('0x4a')]({'where':{'id':_0x156748['params']['id']}})['then'](handleEntityNotFound(_0x25d174,null))[_0x49c4('0x12')](removeEntity(_0x25d174,null))[_0x49c4('0x1d')](handleError(_0x25d174,null));};exports['describe']=function(_0x59a8bc,_0x77163d){return db['MailMessage']['describe']()[_0x49c4('0x12')](respondWithResult(_0x77163d,null))[_0x49c4('0x1d')](handleError(_0x77163d,null));};exports[_0x49c4('0x4b')]=function(_0x38c480,_0x2884ca){return db[_0x49c4('0x2d')][_0x49c4('0x4b')](_0x38c480['body'])[_0x49c4('0x12')](function(_0xcc6a2b){if(_0xcc6a2b){if(_0xcc6a2b[_0x49c4('0x4c')]===_0x49c4('0x4d')&&!_0xcc6a2b[_0x49c4('0x4e')]){var _0xa431d,_0x5d24f3,_0x5c7ddd;if(_0x38c480[_0x49c4('0x49')]['to']){_0x5d24f3=_0x38c480[_0x49c4('0x49')]['to'][_0x49c4('0x4f')](',')[0x0];}return db[_0x49c4('0x50')][_0x49c4('0x51')]({'where':{'id':_0xcc6a2b[_0x49c4('0x52')]},'include':[{'model':db[_0x49c4('0x53')],'as':'List','include':[{'model':db[_0x49c4('0x54')],'as':_0x49c4('0x55'),'where':{'email':_0x5d24f3},'limit':0x1,'order':[['updatedAt',_0x49c4('0x56')]]}]},{'model':db['MailServerOut'],'as':_0x49c4('0x57'),'raw':!![]}]})[_0x49c4('0x12')](function(_0x9eaa84){_0xa431d=_0x9eaa84;if(_0xa431d&&_0xa431d[_0x49c4('0x57')]){var _0x845f7e={'tls':{'rejectUnauthorized':![]}};if(_[_0x49c4('0x58')](_0xa431d[_0x49c4('0x57')][_0x49c4('0x59')])){_0x845f7e['host']=_0xa431d[_0x49c4('0x57')][_0x49c4('0x5a')];_0x845f7e['port']=_0xa431d[_0x49c4('0x57')][_0x49c4('0x5b')];_0x845f7e['secure']=_0xa431d[_0x49c4('0x57')][_0x49c4('0x5c')];if(_0xa431d['Smtp']['authentication']){_0x845f7e['auth']={'user':_0xa431d['Smtp'][_0x49c4('0x5d')],'pass':_0xa431d['Smtp'][_0x49c4('0x5e')]};}}else{_0x845f7e[_0x49c4('0x59')]=_0xa431d['Smtp'][_0x49c4('0x59')];_0x845f7e[_0x49c4('0x5f')]={'user':_0xa431d['Smtp'][_0x49c4('0x5d')],'pass':_0xa431d[_0x49c4('0x57')][_0x49c4('0x5e')]};_0x845f7e[_0x49c4('0x5c')]=_0xa431d['Smtp'][_0x49c4('0x5c')];}if(_0x38c480[_0x49c4('0x49')][_0x49c4('0x60')]&&_0x38c480[_0x49c4('0x49')]['attachments'][_0x49c4('0x48')]){for(var _0x4a93bc=0x0;_0x4a93bc<_0x38c480['body']['attachments']['length'];_0x4a93bc+=0x1){_0x38c480[_0x49c4('0x49')][_0x49c4('0x60')][_0x4a93bc]={'filename':_0x38c480[_0x49c4('0x49')][_0x49c4('0x60')][_0x4a93bc]['name'],'path':path['join'](config[_0x49c4('0x61')],_0x49c4('0x62'),_0x38c480[_0x49c4('0x49')][_0x49c4('0x60')][_0x4a93bc][_0x49c4('0x63')])};}}_0x5c7ddd={'account':_0x845f7e,'message':_0x38c480[_0x49c4('0x49')]};return;}})[_0x49c4('0x12')](function(){if(_0xa431d[_0x49c4('0x64')]){if(_0xa431d['List'][_0x49c4('0x55')]['length']){return _0xa431d[_0x49c4('0x64')][_0x49c4('0x55')][0x0];}else{return db[_0x49c4('0x54')][_0x49c4('0x4b')](_[_0x49c4('0xb')](_0x38c480[_0x49c4('0x49')],{'firstName':_0x38c480[_0x49c4('0x49')]['to'],'email':_0x38c480[_0x49c4('0x49')]['to'],'phone':_0x38c480[_0x49c4('0x49')]['to'],'ListId':_0xa431d[_0x49c4('0x65')]}));}}else{throw new Error(_0x49c4('0x66'));}})[_0x49c4('0x12')](function(){if(_0x5c7ddd){return respondWithRpcPromise(_0x49c4('0x67'),_0x49c4('0x68'),_0x5c7ddd,client9003)[_0x49c4('0x12')](function(_0x453cf2){return _0xcc6a2b[_0x49c4('0x25')]({'read':!![],'messageId':_0x453cf2[_0x49c4('0x69')],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0x49c4('0x1d')](function(_0x16b3e8){logger['error']('%s',JSON[_0x49c4('0x18')](_0x16b3e8));return _0xcc6a2b;});}return _0xcc6a2b;});}return _0xcc6a2b;}})[_0x49c4('0x12')](respondWithResult(_0x2884ca,0xc9))[_0x49c4('0x1d')](handleError(_0x2884ca,null));};exports[_0x49c4('0x6a')]=function(_0x4d6aaa,_0x5a14a5){var _0x4a85d4={'agent':{},'channel':_0x49c4('0x6b')};if(_0x4d6aaa[_0x49c4('0x49')]['id']){delete _0x4d6aaa[_0x49c4('0x49')]['id'];}_0x4d6aaa[_0x49c4('0x49')][_0x49c4('0x6c')]=!![];_0x4d6aaa[_0x49c4('0x49')][_0x49c4('0x6d')]=moment()[_0x49c4('0x6e')](_0x49c4('0x6f'));_0x4d6aaa['body'][_0x49c4('0x70')]=_0x4d6aaa[_0x49c4('0x49')][_0x49c4('0x70')]||_0x4d6aaa['user']['id'];_0x4a85d4[_0x49c4('0x71')]['id']=_0x4d6aaa[_0x49c4('0x49')][_0x49c4('0x70')];return db[_0x49c4('0x2d')][_0x49c4('0x4a')]({'where':{'id':_0x4d6aaa[_0x49c4('0x47')]['id'],'UserId':null}})[_0x49c4('0x12')](handleEntityNotFound(_0x5a14a5,null))[_0x49c4('0x12')](saveUpdates(_0x4d6aaa['body'],null))[_0x49c4('0x12')](function(_0x20e2d5){if(_0x20e2d5){_0x4a85d4[_0x49c4('0x1b')]=_0x20e2d5[_0x49c4('0x72')]({'plain':!![]});return db[_0x49c4('0x73')]['find']({'where':{'id':_0x20e2d5['MailInteractionId']}});}return null;})[_0x49c4('0x12')](handleEntityNotFound(_0x5a14a5,null))['then'](function(_0x34cf49){if(_0x34cf49){return _0x34cf49['update']({'UserId':_0x4d6aaa[_0x49c4('0x49')][_0x49c4('0x70')],'read1stAt':_[_0x49c4('0x58')](_0x34cf49[_0x49c4('0x74')])?moment()['format'](_0x49c4('0x6f')):undefined});}return null;})[_0x49c4('0x12')](function(_0x2ceada){if(_0x2ceada){_0x4a85d4[_0x49c4('0x75')]=_0x2ceada[_0x49c4('0x72')]({'plain':!![]});interaction_log[_0x49c4('0x13')](_0x49c4('0x76'),_0x4d6aaa[_0x49c4('0x5d')]['id'],_0x4d6aaa[_0x49c4('0x5d')][_0x49c4('0x29')],_0x4d6aaa['user'][_0x49c4('0x77')],_0x4a85d4[_0x49c4('0x75')]['id'],_0x4d6aaa['body']?JSON[_0x49c4('0x18')](_0x4d6aaa['body']):_0x49c4('0x78'));return respondWithRpcPromise(_0x49c4('0x79'),_0x49c4('0x7a'),_0x4a85d4);}return null;})[_0x49c4('0x12')](function(_0x2c32c0){var _0x58b90c=_0x49c4('0x7b')+_0x2c32c0[_0x49c4('0x1b')]['ContactId'];return db[_0x49c4('0x7c')][_0x49c4('0x32')](_0x58b90c,{'type':db['Sequelize'][_0x49c4('0x7d')][_0x49c4('0x7e')],'raw':!![]})['then'](function(_0x37fef1){return _0x37fef1;});})[_0x49c4('0x12')](function(_0x25989a){if(_0x25989a){_0x4a85d4[_0x49c4('0x1b')]['contact']=_0x25989a[0x0];if(!_0x4d6aaa[_0x49c4('0x49')][_0x49c4('0x70')])return;return db['User'][_0x49c4('0x4a')]({'where':{'id':_0x4d6aaa['body']['UserId'],'role':_0x49c4('0x71')},'attributes':['id','name','fullname',_0x49c4('0x7f'),_0x49c4('0x80')],'raw':!![]});}return null;})['then'](function(_0x23e684){if(!_0x23e684)return null;_0x4a85d4['message']['agent']=_0x23e684;return _0x4a85d4;})['then'](function(_0x10d107){if(_0x10d107){if(_0x4d6aaa[_0x49c4('0x49')][_0x49c4('0x81')]){_0x4a85d4[_0x49c4('0x1b')]['interface']=util['format'](_0x49c4('0x82'),_0x4d6aaa['user'][_0x49c4('0x29')]);_0x4a85d4['message'][_0x49c4('0x83')]=_0x4a85d4[_0x49c4('0x83')];_0x4a85d4[_0x49c4('0x1b')][_0x49c4('0x84')]=_0x49c4('0x6a');_0x4a85d4[_0x49c4('0x1b')][_0x49c4('0x49')]=htmlToText['fromString'](_0x4a85d4[_0x49c4('0x1b')][_0x49c4('0x49')]);return respondWithRpcPromise(_0x49c4('0x85'),_0x49c4('0x85'),{'event':_0x49c4('0x86'),'message':_0x4a85d4['message']},client9002)[_0x49c4('0x12')](function(){return _0x4a85d4;});}return _0x4a85d4;}return null;})[_0x49c4('0x12')](respondWithResult(_0x5a14a5,null))[_0x49c4('0x1d')](handleError(_0x5a14a5,null));};exports['reject']=function(_0x530ff2,_0xbfff7){var _0x27b31d={'agent':{},'channel':_0x49c4('0x6b')};if(_0x530ff2[_0x49c4('0x49')]['id']){delete _0x530ff2[_0x49c4('0x49')]['id'];}_0x530ff2['body'][_0x49c4('0x70')]=_0x530ff2[_0x49c4('0x49')][_0x49c4('0x70')]||_0x530ff2[_0x49c4('0x5d')]['id'];_0x27b31d['agent']['id']=_0x530ff2['body'][_0x49c4('0x70')];return db[_0x49c4('0x2d')][_0x49c4('0x4a')]({'where':{'id':_0x530ff2[_0x49c4('0x47')]['id'],'UserId':null}})[_0x49c4('0x12')](handleEntityNotFound(_0xbfff7,null))['then'](function(_0x389edb){if(_0x389edb){_0x27b31d[_0x49c4('0x1b')]=_0x389edb[_0x49c4('0x72')]({'plain':!![]});return db[_0x49c4('0x73')][_0x49c4('0x4a')]({'where':{'id':_0x389edb[_0x49c4('0x87')]}});}return null;})['then'](handleEntityNotFound(_0xbfff7,null))[_0x49c4('0x12')](function(_0x1c90ba){if(_0x1c90ba){_0x27b31d[_0x49c4('0x75')]=_0x1c90ba[_0x49c4('0x72')]({'plain':!![]});interaction_log['info']('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x530ff2[_0x49c4('0x5d')]['id'],_0x530ff2['user'][_0x49c4('0x29')],_0x530ff2['user'][_0x49c4('0x77')],_0x27b31d[_0x49c4('0x75')]['id'],_0x530ff2[_0x49c4('0x49')]?JSON[_0x49c4('0x18')](_0x530ff2['body']):'null');return respondWithRpcPromise(_0x49c4('0x88'),_0x49c4('0x89'),_0x27b31d);}return null;})[_0x49c4('0x12')](function(_0x5f0116){var _0x4c0e9c=_0x49c4('0x7b')+_0x5f0116['message']['ContactId'];return db[_0x49c4('0x7c')]['query'](_0x4c0e9c,{'type':db[_0x49c4('0x8a')][_0x49c4('0x7d')]['SELECT'],'raw':!![]})[_0x49c4('0x12')](function(_0x45474e){return _0x45474e;});})['then'](function(_0x5428a9){if(_0x5428a9){_0x27b31d[_0x49c4('0x1b')]['contact']=_0x5428a9[0x0];if(!_0x530ff2[_0x49c4('0x49')][_0x49c4('0x70')])return;return db[_0x49c4('0x8b')][_0x49c4('0x4a')]({'where':{'id':_0x530ff2[_0x49c4('0x49')][_0x49c4('0x70')],'role':_0x49c4('0x71')},'attributes':['id','name',_0x49c4('0x8c'),_0x49c4('0x7f'),_0x49c4('0x80')],'raw':!![]});}return null;})[_0x49c4('0x12')](function(_0x3107c9){if(!_0x3107c9)return null;_0x27b31d['message'][_0x49c4('0x71')]=_0x3107c9;return _0x27b31d;})['then'](function(_0xb66e67){if(_0xb66e67){_0xb66e67[_0x49c4('0x1b')][_0x49c4('0x8d')]=util[_0x49c4('0x6e')]('SIP/%s',_0x530ff2[_0x49c4('0x5d')][_0x49c4('0x29')]);_0xb66e67[_0x49c4('0x1b')][_0x49c4('0x83')]=_0x27b31d[_0x49c4('0x83')];_0xb66e67[_0x49c4('0x1b')]['event']=_0x49c4('0x8e');_0xb66e67['message'][_0x49c4('0x49')]=htmlToText[_0x49c4('0x8f')](_0x27b31d[_0x49c4('0x1b')][_0x49c4('0x49')]);respondWithRpcPromise('EventManager',_0x49c4('0x85'),{'event':_0x49c4('0x90'),'message':_0xb66e67['message']},client9002);return _0x27b31d;}return null;})[_0x49c4('0x12')](respondWithResult(_0xbfff7,null))[_0x49c4('0x1d')](handleError(_0xbfff7,null));};exports['download']=function(_0x562f47,_0x25f1c7){var _0x3e5915=moment()[_0x49c4('0x91')]()[_0x49c4('0x92')]();var _0x32afd4=path[_0x49c4('0x93')](config[_0x49c4('0x61')],_0x49c4('0x94'),_0x49c4('0x95'),_0x49c4('0x96'));var _0x269613=path['join'](config['root'],_0x49c4('0x94'),_0x49c4('0x95'),_0x49c4('0x60'));var _0x5be042=util[_0x49c4('0x6e')](_0x49c4('0x97'),_0x3e5915);return db['MailMessage'][_0x49c4('0x4a')]({'where':{'id':_0x562f47['params']['id']},'attributes':['id',_0x49c4('0x49'),_0x49c4('0x98'),'to','cc',_0x49c4('0x99'),_0x49c4('0x9a'),'createdAt'],'include':_0x562f47[_0x49c4('0x32')][_0x49c4('0x60')]?[{'model':db[_0x49c4('0x9b')],'as':_0x49c4('0x9c')}]:undefined})[_0x49c4('0x12')](handleEntityNotFound(_0x25f1c7,null))['then'](function(_0x5a4e00){if(_0x5a4e00){var _0x5f4d82=_0x5a4e00;var _0x1856c7={'from':_0x5f4d82[_0x49c4('0x98')],'to':_0x5f4d82['to'],'subject':_0x5f4d82[_0x49c4('0x9a')],'html':_0x5f4d82[_0x49c4('0x49')],'headers':{'Date':moment(_0x5f4d82[_0x49c4('0x9d')])['format'](_0x49c4('0x9e'))},'attachments':[]};if(_0x5a4e00['cc']){_0x1856c7[_0x49c4('0x9f')]['Cc']=_0x5a4e00['cc'];}if(_0x5a4e00[_0x49c4('0x99')]){_0x1856c7[_0x49c4('0x9f')]['Bcc']=_0x5a4e00[_0x49c4('0x99')];}return new BPromise(function(_0x5bfccd,_0x10fa42){if(_0x5a4e00[_0x49c4('0x9c')]){for(var _0x2fda4f=0x0;_0x2fda4f<_0x5a4e00['Attachments'][_0x49c4('0x48')];_0x2fda4f++){var _0x9b622d=_0x5a4e00[_0x49c4('0x9c')][_0x2fda4f];var _0x494c7f=path[_0x49c4('0x93')](_0x269613,_0x9b622d[_0x49c4('0x63')]);if(fs[_0x49c4('0xa0')](_0x494c7f)){_0x1856c7['attachments'][_0x49c4('0xa1')]({'name':_0x9b622d['name'],'contentType':_0x9b622d['type'],'data':fs[_0x49c4('0xa2')](_0x494c7f)});}}}emlformat[_0x49c4('0xa3')](_0x1856c7,function(_0x4ef4aa,_0x815b34){if(_0x4ef4aa)return _0x10fa42(_0x4ef4aa);fs[_0x49c4('0xa4')](path[_0x49c4('0x93')](_0x32afd4,_0x5be042),_0x815b34);return _0x5bfccd(_0x815b34);});});}})[_0x49c4('0x12')](function(_0x10f5fc){if(_0x10f5fc){return _0x25f1c7[_0x49c4('0xa5')](path[_0x49c4('0x93')](_0x32afd4,_0x5be042),_0x5be042,function(_0x219133){if(!_0x219133)fs['unlinkSync'](path['join'](_0x32afd4,_0x5be042));});}})[_0x49c4('0x1d')](handleError(_0x25f1c7,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 62fc513..bf308ee 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 _0x2dbe=['events','../../mysqldb','MailMessage','setMaxListeners','remove','emit','hasOwnProperty','exports'];(function(_0x5e55b6,_0x1f20e1){var _0x3854ed=function(_0x3ab0bf){while(--_0x3ab0bf){_0x5e55b6['push'](_0x5e55b6['shift']());}};_0x3854ed(++_0x1f20e1);}(_0x2dbe,0x80));var _0xe2db=function(_0x3d4856,_0x3e36a1){_0x3d4856=_0x3d4856-0x0;var _0x2d99c9=_0x2dbe[_0x3d4856];return _0x2d99c9;};'use strict';var EventEmitter=require(_0xe2db('0x0'));var MailMessage=require(_0xe2db('0x1'))['db'][_0xe2db('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xe2db('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xe2db('0x4')};function emitEvent(_0x4f6405){return function(_0x5b4230,_0x1a777d,_0x1e5533){MailMessageEvents[_0xe2db('0x5')](_0x4f6405+':'+_0x5b4230['id'],_0x5b4230);MailMessageEvents['emit'](_0x4f6405,_0x5b4230);_0x1e5533(null);};}for(var e in events){if(events[_0xe2db('0x6')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0xe2db('0x7')]=MailMessageEvents; \ No newline at end of file +var _0xd92b=['events','../../mysqldb','MailMessage','save','update','emit','hasOwnProperty','hook','exports'];(function(_0xb8a0a2,_0x189a1b){var _0x5d0120=function(_0x1bcb21){while(--_0x1bcb21){_0xb8a0a2['push'](_0xb8a0a2['shift']());}};_0x5d0120(++_0x189a1b);}(_0xd92b,0x132));var _0xbd92=function(_0x4f03fa,_0x31383b){_0x4f03fa=_0x4f03fa-0x0;var _0x2934d8=_0xd92b[_0x4f03fa];return _0x2934d8;};'use strict';var EventEmitter=require(_0xbd92('0x0'));var MailMessage=require(_0xbd92('0x1'))['db'][_0xbd92('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbd92('0x3'),'afterUpdate':_0xbd92('0x4'),'afterDestroy':'remove'};function emitEvent(_0x47c622){return function(_0x147bd7,_0x176869,_0x222e6f){MailMessageEvents[_0xbd92('0x5')](_0x47c622+':'+_0x147bd7['id'],_0x147bd7);MailMessageEvents['emit'](_0x47c622,_0x147bd7);_0x222e6f(null);};}for(var e in events){if(events[_0xbd92('0x6')](e)){var event=events[e];MailMessage[_0xbd92('0x7')](e,emitEvent(event));}}module[_0xbd92('0x8')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index f6e02f6..eea796c 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 _0xbc3a=['then','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','get','direction','toLowerCase','out','isNil','UserId','MailInteraction','findOne','MailInteractionId'];(function(_0x477872,_0x36bfa8){var _0x5c6115=function(_0x42b0bf){while(--_0x42b0bf){_0x477872['push'](_0x477872['shift']());}};_0x5c6115(++_0x36bfa8);}(_0xbc3a,0xb4));var _0xabc3=function(_0x381b7a,_0x12989f){_0x381b7a=_0x381b7a-0x0;var _0x43b539=_0xbc3a[_0x381b7a];return _0x43b539;};'use strict';var _=require(_0xabc3('0x0'));var util=require(_0xabc3('0x1'));var logger=require(_0xabc3('0x2'))(_0xabc3('0x3'));var moment=require(_0xabc3('0x4'));var BPromise=require('bluebird');var rp=require(_0xabc3('0x5'));var htmlToText=require(_0xabc3('0x6'));var fs=require('fs');var path=require(_0xabc3('0x7'));var rimraf=require(_0xabc3('0x8'));var config=require(_0xabc3('0x9'));var attributes=require(_0xabc3('0xa'));module[_0xabc3('0xb')]=function(_0x128aa6,_0x57dc1f){return _0x128aa6[_0xabc3('0xc')](_0xabc3('0xd'),attributes,{'tableName':_0xabc3('0xe'),'paranoid':![],'indexes':[{'name':_0xabc3('0xf'),'fields':['messageId']},{'name':_0xabc3('0x10'),'fields':[_0xabc3('0x11'),_0xabc3('0x12')],'type':_0xabc3('0x13')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x472e14,_0x42dc60,_0x7aaf7d){if(_0x472e14['body']){_0x472e14[_0xabc3('0x11')]=htmlToText['fromString'](_0x472e14[_0xabc3('0x14')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x7aaf7d(null,_0x42dc60);},'afterCreate':function(_0x41099a,_0x3d7644,_0x1e4aec){var _0x50f0a0=_0x128aa6['models'];var _0x1b35d6=_0x41099a[_0xabc3('0x15')]({'plain':!![]});if(_0x1b35d6[_0xabc3('0x16')][_0xabc3('0x17')]()==='in'||_0x1b35d6[_0xabc3('0x16')][_0xabc3('0x17')]()===_0xabc3('0x18')&&!_0x1b35d6['secret']&&!_[_0xabc3('0x19')](_0x1b35d6[_0xabc3('0x1a')])){_0x50f0a0[_0xabc3('0x1b')][_0xabc3('0x1c')]({'where':{'id':_0x1b35d6[_0xabc3('0x1d')]}})[_0xabc3('0x1e')](function(_0x84565){if(_0x84565){_0x84565['update']({'lastMsgAt':_0x1b35d6[_0xabc3('0x1f')],'lastMsgDirection':_0x1b35d6[_0xabc3('0x16')][_0xabc3('0x17')]()});}})[_0xabc3('0x20')](function(_0x26885f){console[_0xabc3('0x21')](_0x26885f);});}_0x1e4aec();}},'charset':'utf8mb4','collate':_0xabc3('0x22')});}; \ No newline at end of file +var _0x67cd=['utf8mb4_unicode_ci','lodash','../../config/logger','api','request-promise','html-to-text','rimraf','../../config/environment','exports','define','MailMessage','mail_messages','fti_mail_messages','plainBody','FULLTEXT','body','fromString','get','direction','toLowerCase','out','UserId','findOne','MailInteractionId','then','createdAt','catch','error'];(function(_0x1fda8a,_0x3792d1){var _0x33d681=function(_0x106ab8){while(--_0x106ab8){_0x1fda8a['push'](_0x1fda8a['shift']());}};_0x33d681(++_0x3792d1);}(_0x67cd,0x1c1));var _0xd67c=function(_0x49fcfb,_0x504dec){_0x49fcfb=_0x49fcfb-0x0;var _0x964926=_0x67cd[_0x49fcfb];return _0x964926;};'use strict';var _=require(_0xd67c('0x0'));var util=require('util');var logger=require(_0xd67c('0x1'))(_0xd67c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd67c('0x3'));var htmlToText=require(_0xd67c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd67c('0x5'));var config=require(_0xd67c('0x6'));var attributes=require('./mailMessage.attributes');module[_0xd67c('0x7')]=function(_0xa0fdfc,_0xb7510f){return _0xa0fdfc[_0xd67c('0x8')](_0xd67c('0x9'),attributes,{'tableName':_0xd67c('0xa'),'paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0xd67c('0xb'),'fields':[_0xd67c('0xc'),'subject'],'type':_0xd67c('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x413185,_0x5a47dd,_0x5b3495){if(_0x413185[_0xd67c('0xe')]){_0x413185['plainBody']=htmlToText[_0xd67c('0xf')](_0x413185[_0xd67c('0xe')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x5b3495(null,_0x5a47dd);},'afterCreate':function(_0x29cdae,_0x295728,_0x2b86e6){var _0x31ad14=_0xa0fdfc['models'];var _0x5e8780=_0x29cdae[_0xd67c('0x10')]({'plain':!![]});if(_0x5e8780['direction']['toLowerCase']()==='in'||_0x5e8780[_0xd67c('0x11')][_0xd67c('0x12')]()===_0xd67c('0x13')&&!_0x5e8780['secret']&&!_['isNil'](_0x5e8780[_0xd67c('0x14')])){_0x31ad14['MailInteraction'][_0xd67c('0x15')]({'where':{'id':_0x5e8780[_0xd67c('0x16')]}})[_0xd67c('0x17')](function(_0x5de391){if(_0x5de391){_0x5de391['update']({'lastMsgAt':_0x5e8780[_0xd67c('0x18')],'lastMsgDirection':_0x5e8780[_0xd67c('0x11')][_0xd67c('0x12')]()});}})[_0xd67c('0x19')](function(_0x8481d2){console[_0xd67c('0x1a')](_0x8481d2);});}_0x2b86e6();}},'charset':'utf8mb4','collate':_0xd67c('0x1b')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index ab60688..9de03a4 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 _0xf7b4=['randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailMessage,\x20%s,\x20%s','message','result','catch','MailMessage','create','body','options','raw','CreateMailMessage','lodash','bluebird'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0xf7b4,0x152));var _0x4f7b=function(_0x1a06c4,_0x17d0e0){_0x1a06c4=_0x1a06c4-0x0;var _0x1bf57b=_0xf7b4[_0x1a06c4];return _0x1bf57b;};'use strict';var _=require(_0x4f7b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4f7b('0x1'));var rs=require(_0x4f7b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4f7b('0x3'));var logger=require(_0x4f7b('0x4'))(_0x4f7b('0x5'));var config=require(_0x4f7b('0x6'));var jayson=require(_0x4f7b('0x7'));var client=jayson[_0x4f7b('0x8')][_0x4f7b('0x9')]({'port':0x232a});config[_0x4f7b('0xa')]=_[_0x4f7b('0xb')](config[_0x4f7b('0xa')],{'host':_0x4f7b('0xc'),'port':0x18eb});var socket=require(_0x4f7b('0xd'))(new Redis(config[_0x4f7b('0xa')]));require('./mailMessage.socket')[_0x4f7b('0xe')](socket);function respondWithRpcPromise(_0x1016e0,_0x479208,_0xdd1aab){return new BPromise(function(_0x3a3d6c,_0x408e01){return client[_0x4f7b('0xf')](_0x1016e0,_0xdd1aab)[_0x4f7b('0x10')](function(_0x55d69f){logger[_0x4f7b('0x11')]('MailMessage,\x20%s,\x20%s',_0x479208,'request\x20sent');logger[_0x4f7b('0x12')](_0x4f7b('0x13'),_0x479208,_0x4f7b('0x14'),JSON[_0x4f7b('0x15')](_0x55d69f));if(_0x55d69f['error']){if(_0x55d69f[_0x4f7b('0x16')][_0x4f7b('0x17')]===0x1f4){logger[_0x4f7b('0x16')](_0x4f7b('0x18'),_0x479208,_0x55d69f[_0x4f7b('0x16')][_0x4f7b('0x19')]);return _0x408e01(_0x55d69f[_0x4f7b('0x16')][_0x4f7b('0x19')]);}logger[_0x4f7b('0x16')](_0x4f7b('0x18'),_0x479208,_0x55d69f[_0x4f7b('0x16')][_0x4f7b('0x19')]);return _0x3a3d6c(_0x55d69f['error'][_0x4f7b('0x19')]);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x479208,_0x4f7b('0x14'));_0x3a3d6c(_0x55d69f[_0x4f7b('0x1a')]['message']);}})[_0x4f7b('0x1b')](function(_0x24c460){logger[_0x4f7b('0x16')](_0x4f7b('0x18'),_0x479208,_0x24c460);_0x408e01(_0x24c460);});});}exports['CreateMailMessage']=function(_0x1daa79){var _0x5adacb=this;return new Promise(function(_0x41cf36,_0x12374b){return db[_0x4f7b('0x1c')][_0x4f7b('0x1d')](_0x1daa79[_0x4f7b('0x1e')],{'raw':_0x1daa79[_0x4f7b('0x1f')]?_0x1daa79[_0x4f7b('0x1f')][_0x4f7b('0x20')]===undefined?!![]:![]:!![]})[_0x4f7b('0x10')](function(_0x5508bd){logger[_0x4f7b('0x11')](_0x4f7b('0x21'),_0x1daa79);logger[_0x4f7b('0x12')]('CreateMailMessage',_0x1daa79,JSON[_0x4f7b('0x15')](_0x5508bd));_0x41cf36(_0x5508bd);})[_0x4f7b('0x1b')](function(_0x5d22f4){logger[_0x4f7b('0x16')]('CreateMailMessage',_0x5d22f4[_0x4f7b('0x19')],_0x1daa79);_0x12374b(_0x5adacb[_0x4f7b('0x16')](0x1f4,_0x5d22f4[_0x4f7b('0x19')]));});});}; \ No newline at end of file +var _0x4888=['code','message','request\x20sent','result','catch','CreateMailMessage','MailMessage','create','body','options','raw','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','./mailMessage.socket','request','then','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','error'];(function(_0x2c1de0,_0x4fc4e3){var _0x208965=function(_0x1a91c8){while(--_0x1a91c8){_0x2c1de0['push'](_0x2c1de0['shift']());}};_0x208965(++_0x4fc4e3);}(_0x4888,0x198));var _0x8488=function(_0xcb785d,_0x29e22d){_0xcb785d=_0xcb785d-0x0;var _0x6e8faf=_0x4888[_0xcb785d];return _0x6e8faf;};'use strict';var _=require('lodash');var util=require(_0x8488('0x0'));var moment=require(_0x8488('0x1'));var BPromise=require(_0x8488('0x2'));var rs=require(_0x8488('0x3'));var fs=require('fs');var Redis=require(_0x8488('0x4'));var db=require(_0x8488('0x5'))['db'];var utils=require(_0x8488('0x6'));var logger=require('../../config/logger')(_0x8488('0x7'));var config=require(_0x8488('0x8'));var jayson=require(_0x8488('0x9'));var client=jayson[_0x8488('0xa')][_0x8488('0xb')]({'port':0x232a});config[_0x8488('0xc')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8488('0xc')]));require(_0x8488('0xd'))['register'](socket);function respondWithRpcPromise(_0x19c994,_0x1334fe,_0x98223){return new BPromise(function(_0x19a2ee,_0x515ea8){return client[_0x8488('0xe')](_0x19c994,_0x98223)[_0x8488('0xf')](function(_0x468896){logger[_0x8488('0x10')](_0x8488('0x11'),_0x1334fe,'request\x20sent');logger[_0x8488('0x12')](_0x8488('0x13'),_0x1334fe,'request\x20sent',JSON['stringify'](_0x468896));if(_0x468896[_0x8488('0x14')]){if(_0x468896['error'][_0x8488('0x15')]===0x1f4){logger['error']('MailMessage,\x20%s,\x20%s',_0x1334fe,_0x468896[_0x8488('0x14')][_0x8488('0x16')]);return _0x515ea8(_0x468896[_0x8488('0x14')][_0x8488('0x16')]);}logger[_0x8488('0x14')](_0x8488('0x11'),_0x1334fe,_0x468896[_0x8488('0x14')]['message']);return _0x19a2ee(_0x468896[_0x8488('0x14')][_0x8488('0x16')]);}else{logger[_0x8488('0x10')](_0x8488('0x11'),_0x1334fe,_0x8488('0x17'));_0x19a2ee(_0x468896[_0x8488('0x18')][_0x8488('0x16')]);}})[_0x8488('0x19')](function(_0x514c31){logger[_0x8488('0x14')](_0x8488('0x11'),_0x1334fe,_0x514c31);_0x515ea8(_0x514c31);});});}exports[_0x8488('0x1a')]=function(_0x3dd93e){var _0x554ec6=this;return new Promise(function(_0x4a1b45,_0x340d6b){return db[_0x8488('0x1b')][_0x8488('0x1c')](_0x3dd93e[_0x8488('0x1d')],{'raw':_0x3dd93e[_0x8488('0x1e')]?_0x3dd93e[_0x8488('0x1e')][_0x8488('0x1f')]===undefined?!![]:![]:!![]})[_0x8488('0xf')](function(_0x39dd43){logger['info'](_0x8488('0x1a'),_0x3dd93e);logger[_0x8488('0x12')](_0x8488('0x1a'),_0x3dd93e,JSON[_0x8488('0x20')](_0x39dd43));_0x4a1b45(_0x39dd43);})[_0x8488('0x19')](function(_0x54ecda){logger['error']('CreateMailMessage',_0x54ecda['message'],_0x3dd93e);_0x340d6b(_0x554ec6[_0x8488('0x14')](0x1f4,_0x54ecda['message']));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index ae0dc39..add95df 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 _0x1cea=['remove','update','emit','length','./mailMessage.events','save'];(function(_0x1b68ff,_0x5e68a2){var _0x4b3b07=function(_0x465dd9){while(--_0x465dd9){_0x1b68ff['push'](_0x1b68ff['shift']());}};_0x4b3b07(++_0x5e68a2);}(_0x1cea,0x142));var _0xa1ce=function(_0x2dc343,_0xf015a2){_0x2dc343=_0x2dc343-0x0;var _0x51eac5=_0x1cea[_0x2dc343];return _0x51eac5;};'use strict';var MailMessageEvents=require(_0xa1ce('0x0'));var events=[_0xa1ce('0x1'),_0xa1ce('0x2'),_0xa1ce('0x3')];function createListener(_0x466fa5,_0x35f617){return function(_0xc8bf2b){_0x35f617[_0xa1ce('0x4')](_0x466fa5,_0xc8bf2b);};}function removeListener(_0x4725b6,_0x3b3c9f){return function(){MailMessageEvents['removeListener'](_0x4725b6,_0x3b3c9f);};}exports['register']=function(_0x5f1fa0){for(var _0xd97ffe=0x0,_0x1cd99f=events[_0xa1ce('0x5')];_0xd97ffe<_0x1cd99f;_0xd97ffe++){var _0xa77293=events[_0xd97ffe];var _0x27e542=createListener('mailMessage:'+_0xa77293,_0x5f1fa0);MailMessageEvents['on'](_0xa77293,_0x27e542);}}; \ No newline at end of file +var _0x2dab=['mailMessage:','./mailMessage.events','save','remove','update','removeListener','register'];(function(_0x220f07,_0xf17a7d){var _0x2c7925=function(_0x3b0e1a){while(--_0x3b0e1a){_0x220f07['push'](_0x220f07['shift']());}};_0x2c7925(++_0xf17a7d);}(_0x2dab,0x120));var _0xb2da=function(_0x52d568,_0x36b414){_0x52d568=_0x52d568-0x0;var _0x1e7bb6=_0x2dab[_0x52d568];return _0x1e7bb6;};'use strict';var MailMessageEvents=require(_0xb2da('0x0'));var events=[_0xb2da('0x1'),_0xb2da('0x2'),_0xb2da('0x3')];function createListener(_0x3bbc49,_0x4b5ae2){return function(_0x19ab19){_0x4b5ae2['emit'](_0x3bbc49,_0x19ab19);};}function removeListener(_0x15df9b,_0x1f7ad6){return function(){MailMessageEvents[_0xb2da('0x4')](_0x15df9b,_0x1f7ad6);};}exports[_0xb2da('0x5')]=function(_0x309b46){for(var _0x3b0e4e=0x0,_0x11f18f=events['length'];_0x3b0e4e<_0x11f18f;_0x3b0e4e++){var _0x1a6e99=events[_0x3b0e4e];var _0x236dbc=createListener(_0xb2da('0x6')+_0x1a6e99,_0x309b46);MailMessageEvents['on'](_0x1a6e99,_0x236dbc);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index fecc363..1207bc8 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 _0x2167=['isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','addTeams','put','delete','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailQueue.controller','get'];(function(_0x2ed6ca,_0x5b5967){var _0x4ddeab=function(_0x3cdad9){while(--_0x3cdad9){_0x2ed6ca['push'](_0x2ed6ca['shift']());}};_0x4ddeab(++_0x5b5967);}(_0x2167,0x66));var _0x7216=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x2167[_0x16d10f];return _0x50c823;};'use strict';var multer=require(_0x7216('0x0'));var util=require(_0x7216('0x1'));var path=require('path');var timeout=require(_0x7216('0x2'));var express=require(_0x7216('0x3'));var router=express[_0x7216('0x4')]();var fs_extra=require(_0x7216('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7216('0x6'));var config=require(_0x7216('0x7'));var controller=require(_0x7216('0x8'));router[_0x7216('0x9')]('/',auth[_0x7216('0xa')](),controller[_0x7216('0xb')]);router[_0x7216('0x9')](_0x7216('0xc'),auth[_0x7216('0xa')](),controller[_0x7216('0xd')]);router[_0x7216('0x9')](_0x7216('0xe'),auth[_0x7216('0xa')](),controller[_0x7216('0xf')]);router[_0x7216('0x9')](_0x7216('0x10'),auth[_0x7216('0xa')](),controller[_0x7216('0x11')]);router[_0x7216('0x9')](_0x7216('0x12'),auth[_0x7216('0xa')](),controller['getTeams']);router[_0x7216('0x9')](_0x7216('0x13'),auth[_0x7216('0xa')](),controller[_0x7216('0x14')]);router[_0x7216('0x15')]('/',auth[_0x7216('0xa')](),controller['create']);router[_0x7216('0x15')](_0x7216('0x12'),auth['isAuthenticated'](),controller[_0x7216('0x16')]);router[_0x7216('0x15')](_0x7216('0x13'),auth[_0x7216('0xa')](),controller['addAgents']);router[_0x7216('0x17')](_0x7216('0xe'),auth[_0x7216('0xa')](),controller['update']);router[_0x7216('0x18')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x7216('0x18')](_0x7216('0x12'),auth['isAuthenticated'](),controller[_0x7216('0x19')]);router[_0x7216('0x18')](_0x7216('0x13'),auth[_0x7216('0xa')](),controller[_0x7216('0x1a')]);module[_0x7216('0x1b')]=router; \ No newline at end of file +var _0x648e=['removeTeams','delete','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put','update','destroy'];(function(_0x46d87a,_0x5183db){var _0x115296=function(_0x880a1c){while(--_0x880a1c){_0x46d87a['push'](_0x46d87a['shift']());}};_0x115296(++_0x5183db);}(_0x648e,0x159));var _0xe648=function(_0x1136df,_0x42a8ff){_0x1136df=_0x1136df-0x0;var _0x212348=_0x648e[_0x1136df];return _0x212348;};'use strict';var multer=require('multer');var util=require(_0xe648('0x0'));var path=require(_0xe648('0x1'));var timeout=require(_0xe648('0x2'));var express=require(_0xe648('0x3'));var router=express[_0xe648('0x4')]();var fs_extra=require(_0xe648('0x5'));var auth=require(_0xe648('0x6'));var interaction=require(_0xe648('0x7'));var config=require(_0xe648('0x8'));var controller=require('./mailQueue.controller');router['get']('/',auth[_0xe648('0x9')](),controller[_0xe648('0xa')]);router[_0xe648('0xb')](_0xe648('0xc'),auth[_0xe648('0x9')](),controller['describe']);router['get'](_0xe648('0xd'),auth[_0xe648('0x9')](),controller[_0xe648('0xe')]);router[_0xe648('0xb')](_0xe648('0xf'),auth[_0xe648('0x9')](),controller[_0xe648('0x10')]);router[_0xe648('0xb')](_0xe648('0x11'),auth[_0xe648('0x9')](),controller[_0xe648('0x12')]);router[_0xe648('0xb')](_0xe648('0x13'),auth[_0xe648('0x9')](),controller[_0xe648('0x14')]);router[_0xe648('0x15')]('/',auth[_0xe648('0x9')](),controller[_0xe648('0x16')]);router[_0xe648('0x15')](_0xe648('0x11'),auth[_0xe648('0x9')](),controller[_0xe648('0x17')]);router[_0xe648('0x15')](_0xe648('0x13'),auth[_0xe648('0x9')](),controller['addAgents']);router[_0xe648('0x18')](_0xe648('0xd'),auth[_0xe648('0x9')](),controller[_0xe648('0x19')]);router['delete'](_0xe648('0xd'),auth[_0xe648('0x9')](),controller[_0xe648('0x1a')]);router['delete']('/:id/teams',auth[_0xe648('0x9')](),controller[_0xe648('0x1b')]);router[_0xe648('0x1c')](_0xe648('0x13'),auth['isAuthenticated'](),controller[_0xe648('0x1d')]);module[_0xe648('0x1e')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 81cb65c..b7107de 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 _0x9ffc=['sequelize','exports','STRING','name','INTEGER','ENUM','beepall'];(function(_0x1da154,_0xc9a712){var _0xa63061=function(_0x592b6b){while(--_0x592b6b){_0x1da154['push'](_0x1da154['shift']());}};_0xa63061(++_0xc9a712);}(_0x9ffc,0xaf));var _0xc9ff=function(_0x4733d3,_0x454290){_0x4733d3=_0x4733d3-0x0;var _0x1b9a44=_0x9ffc[_0x4733d3];return _0x1b9a44;};'use strict';var Sequelize=require(_0xc9ff('0x0'));module[_0xc9ff('0x1')]={'name':{'type':Sequelize[_0xc9ff('0x2')],'unique':_0xc9ff('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc9ff('0x2')]},'timeout':{'type':Sequelize[_0xc9ff('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc9ff('0x5')]('rrmemory',_0xc9ff('0x6'),'roundrobin')}}; \ No newline at end of file +var _0x521a=['beepall','sequelize','exports','INTEGER'];(function(_0x35f871,_0x251c7f){var _0x53df55=function(_0xeada03){while(--_0xeada03){_0x35f871['push'](_0x35f871['shift']());}};_0x53df55(++_0x251c7f);}(_0x521a,0x79));var _0xa521=function(_0x58ff8e,_0x39fe0d){_0x58ff8e=_0x58ff8e-0x0;var _0x701683=_0x521a[_0x58ff8e];return _0x701683;};'use strict';var Sequelize=require(_0xa521('0x0'));module[_0xa521('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xa521('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0xa521('0x3'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 202610a..b6c48a9 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 _0x552c=['catch','show','params','keys','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','error','body','describe','getMembers','findOne','UserMailQueue','MailQueueId','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','%s/%s','SIP','getTeams','ids','Team','Agents','online','voicePause','interface','sequelize','addTeams','each','findOrCreate','forEach','field','tq.TeamId','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','removeTeams','removeAgents','addAgents','spread','emit','userMailQueue:save','isArray','userMailQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','MailQueues','UserProfileResource','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows'];(function(_0x25f3b1,_0x772a11){var _0x9c05eb=function(_0x345f45){while(--_0x345f45){_0x25f3b1['push'](_0x25f3b1['shift']());}};_0x9c05eb(++_0x772a11);}(_0x552c,0xd2));var _0xc552=function(_0x4789e5,_0x2d7e4d){_0x4789e5=_0x4789e5-0x0;var _0x4f2bac=_0x552c[_0x4789e5];return _0x4f2bac;};'use strict';var emlformat=require(_0xc552('0x0'));var rimraf=require(_0xc552('0x1'));var zipdir=require(_0xc552('0x2'));var jsonpatch=require(_0xc552('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc552('0x4'));var Mustache=require('mustache');var util=require(_0xc552('0x5'));var path=require(_0xc552('0x6'));var sox=require(_0xc552('0x7'));var csv=require(_0xc552('0x8'));var ejs=require(_0xc552('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc552('0xa'));var squel=require(_0xc552('0xb'));var crypto=require(_0xc552('0xc'));var jsforce=require(_0xc552('0xd'));var deskjs=require(_0xc552('0xe'));var toCsv=require(_0xc552('0x8'));var querystring=require(_0xc552('0xf'));var Papa=require(_0xc552('0x10'));var Redis=require(_0xc552('0x11'));var authService=require(_0xc552('0x12'));var qs=require(_0xc552('0x13'));var as=require(_0xc552('0x14'));var hardwareService=require(_0xc552('0x15'));var logger=require(_0xc552('0x16'))(_0xc552('0x17'));var utils=require(_0xc552('0x18'));var config=require(_0xc552('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xc552('0x1a'))['db'];config[_0xc552('0x1b')]=_['defaults'](config['redis'],{'host':_0xc552('0x1c'),'port':0x18eb});var socket=require(_0xc552('0x1d'))(new Redis(config[_0xc552('0x1b')]));require(_0xc552('0x1e'))[_0xc552('0x1f')](socket);function respondWithStatusCode(_0x3ed718,_0x12865c){_0x12865c=_0x12865c||0xcc;return function(_0x13f781){if(_0x13f781){return _0x3ed718[_0xc552('0x20')](_0x12865c);}return _0x3ed718[_0xc552('0x21')](_0x12865c)[_0xc552('0x22')]();};}function respondWithResult(_0x221875,_0x8eeeb6){_0x8eeeb6=_0x8eeeb6||0xc8;return function(_0x406241){if(_0x406241){return _0x221875[_0xc552('0x21')](_0x8eeeb6)[_0xc552('0x23')](_0x406241);}};}function respondWithFilteredResult(_0x510b8a,_0x4efd19){return function(_0x306786){if(_0x306786){var _0x196421=typeof _0x4efd19[_0xc552('0x24')]===_0xc552('0x25')&&typeof _0x4efd19[_0xc552('0x26')]===_0xc552('0x25');var _0x2bae51=_0x306786[_0xc552('0x27')];var _0x48ca12=_0x196421?0x0:_0x4efd19[_0xc552('0x24')];var _0x3e92ba=_0x196421?_0x306786[_0xc552('0x27')]:_0x4efd19[_0xc552('0x24')]+_0x4efd19[_0xc552('0x26')];var _0x2ef405;if(_0x3e92ba>=_0x2bae51){_0x3e92ba=_0x2bae51;_0x2ef405=0xc8;}else{_0x2ef405=0xce;}_0x510b8a[_0xc552('0x21')](_0x2ef405);return _0x510b8a[_0xc552('0x28')](_0xc552('0x29'),_0x48ca12+'-'+_0x3e92ba+'/'+_0x2bae51)[_0xc552('0x23')](_0x306786);}return null;};}function patchUpdates(_0x232214){return function(_0x2feb16){try{jsonpatch[_0xc552('0x2a')](_0x2feb16,_0x232214,!![]);}catch(_0x4174cc){return BPromise[_0xc552('0x2b')](_0x4174cc);}return _0x2feb16[_0xc552('0x2c')]();};}function saveUpdates(_0x41e368,_0x4274f8){return function(_0x48ea33){if(_0x48ea33){return _0x48ea33[_0xc552('0x2d')](_0x41e368)[_0xc552('0x2e')](function(_0x4e0ae7){return _0x4e0ae7;});}return null;};}function removeEntity(_0x3a5b43,_0x26e9eb){return function(_0x1df09a){if(_0x1df09a){return _0x1df09a[_0xc552('0x2f')]()[_0xc552('0x2e')](function(){var _0x46ff1c=_0x1df09a[_0xc552('0x30')]({'plain':!![]});var _0x1f497f=_0xc552('0x31');return db[_0xc552('0x32')][_0xc552('0x2f')]({'where':{'type':_0x1f497f,'resourceId':_0x46ff1c['id']}})[_0xc552('0x2e')](function(){return _0x1df09a;});})[_0xc552('0x2e')](function(){_0x3a5b43[_0xc552('0x21')](0xcc)[_0xc552('0x22')]();});}};}function handleEntityNotFound(_0xc555a7,_0x19a088){return function(_0x23c146){if(!_0x23c146){_0xc555a7[_0xc552('0x20')](0x194);}return _0x23c146;};}function handleError(_0x2f8a1b,_0x57614d){_0x57614d=_0x57614d||0x1f4;return function(_0x3f421f){logger['error'](_0x3f421f[_0xc552('0x33')]);if(_0x3f421f[_0xc552('0x34')]){delete _0x3f421f[_0xc552('0x34')];}_0x2f8a1b[_0xc552('0x21')](_0x57614d)[_0xc552('0x35')](_0x3f421f);};}exports[_0xc552('0x36')]=function(_0x22ba9d,_0x409822){var _0x412749={},_0x13c5c4={},_0x58b7d5={'count':0x0,'rows':[]};var _0x3ca96a=_[_0xc552('0x37')](db[_0xc552('0x38')][_0xc552('0x39')],function(_0x54aacc){return{'name':_0x54aacc[_0xc552('0x3a')],'type':_0x54aacc[_0xc552('0x3b')]['key']};});_0x13c5c4[_0xc552('0x3c')]=_[_0xc552('0x37')](_0x3ca96a,'name');_0x13c5c4[_0xc552('0x3d')]=_['keys'](_0x22ba9d[_0xc552('0x3d')]);_0x13c5c4[_0xc552('0x3e')]=_[_0xc552('0x3f')](_0x13c5c4[_0xc552('0x3c')],_0x13c5c4[_0xc552('0x3d')]);_0x412749[_0xc552('0x40')]=_['intersection'](_0x13c5c4[_0xc552('0x3c')],qs[_0xc552('0x41')](_0x22ba9d['query'][_0xc552('0x41')]));_0x412749[_0xc552('0x40')]=_0x412749[_0xc552('0x40')][_0xc552('0x42')]?_0x412749[_0xc552('0x40')]:_0x13c5c4[_0xc552('0x3c')];if(!_0x22ba9d[_0xc552('0x3d')][_0xc552('0x43')](_0xc552('0x44'))){_0x412749[_0xc552('0x26')]=qs[_0xc552('0x26')](_0x22ba9d['query'][_0xc552('0x26')]);_0x412749[_0xc552('0x24')]=qs[_0xc552('0x24')](_0x22ba9d[_0xc552('0x3d')][_0xc552('0x24')]);}_0x412749[_0xc552('0x45')]=qs[_0xc552('0x46')](_0x22ba9d['query'][_0xc552('0x46')]);_0x412749[_0xc552('0x47')]=qs['filters'](_[_0xc552('0x48')](_0x22ba9d[_0xc552('0x3d')],_0x13c5c4[_0xc552('0x3e')]),_0x3ca96a);if(_0x22ba9d['query'][_0xc552('0x49')]){_0x412749['where']=_[_0xc552('0x4a')](_0x412749[_0xc552('0x47')],{'$or':_[_0xc552('0x37')](_0x3ca96a,function(_0xedd976){if(_0xedd976[_0xc552('0x3b')]!=='VIRTUAL'){var _0x2cd915={};_0x2cd915[_0xedd976[_0xc552('0x34')]]={'$like':'%'+_0x22ba9d[_0xc552('0x3d')][_0xc552('0x49')]+'%'};return _0x2cd915;}})});}_0x412749=_[_0xc552('0x4a')]({},_0x412749,_0x22ba9d[_0xc552('0x4b')]);var _0x5daf37={'where':_0x412749[_0xc552('0x47')]};return db[_0xc552('0x38')][_0xc552('0x27')](_0x5daf37)[_0xc552('0x2e')](function(_0x1c05b4){_0x58b7d5[_0xc552('0x27')]=_0x1c05b4;if(_0x22ba9d[_0xc552('0x3d')][_0xc552('0x4c')]){_0x412749[_0xc552('0x4d')]=[{'all':!![]}];}return db[_0xc552('0x38')][_0xc552('0x4e')](_0x412749);})[_0xc552('0x2e')](function(_0xc20c3f){_0x58b7d5[_0xc552('0x4f')]=_0xc20c3f;return _0x58b7d5;})[_0xc552('0x2e')](respondWithFilteredResult(_0x409822,_0x412749))[_0xc552('0x50')](handleError(_0x409822,null));};exports[_0xc552('0x51')]=function(_0x4dbf24,_0x4af1ca){var _0x4b3ea6={'raw':!![],'where':{'id':_0x4dbf24[_0xc552('0x52')]['id']}},_0x5c4307={};_0x5c4307[_0xc552('0x3c')]=_['keys'](db[_0xc552('0x38')][_0xc552('0x39')]);_0x5c4307['query']=_[_0xc552('0x53')](_0x4dbf24[_0xc552('0x3d')]);_0x5c4307[_0xc552('0x3e')]=_['intersection'](_0x5c4307[_0xc552('0x3c')],_0x5c4307['query']);_0x4b3ea6[_0xc552('0x40')]=_['intersection'](_0x5c4307['model'],qs['fields'](_0x4dbf24['query'][_0xc552('0x41')]));_0x4b3ea6[_0xc552('0x40')]=_0x4b3ea6[_0xc552('0x40')]['length']?_0x4b3ea6[_0xc552('0x40')]:_0x5c4307[_0xc552('0x3c')];if(_0x4dbf24['query'][_0xc552('0x4c')]){_0x4b3ea6[_0xc552('0x4d')]=[{'all':!![]}];}_0x4b3ea6=_[_0xc552('0x4a')]({},_0x4b3ea6,_0x4dbf24[_0xc552('0x4b')]);return db[_0xc552('0x38')]['find'](_0x4b3ea6)[_0xc552('0x2e')](handleEntityNotFound(_0x4af1ca,null))[_0xc552('0x2e')](respondWithResult(_0x4af1ca,null))['catch'](handleError(_0x4af1ca,null));};exports[_0xc552('0x54')]=function(_0x5892f5,_0x1e90a4){return db[_0xc552('0x38')][_0xc552('0x54')](_0x5892f5['body'],{})[_0xc552('0x2e')](function(_0xf24529){var _0x44235f=_0x5892f5[_0xc552('0x55')]['get']({'plain':!![]});if(!_0x44235f)throw new Error(_0xc552('0x56'));if(_0x44235f[_0xc552('0x57')]===_0xc552('0x55')){var _0x1aed6a=_0xf24529[_0xc552('0x30')]({'plain':!![]});var _0x48895f=_0xc552('0x31');return db[_0xc552('0x58')][_0xc552('0x59')]({'where':{'name':_0x48895f,'userProfileId':_0x44235f[_0xc552('0x5a')]},'raw':!![]})['then'](function(_0x84b1a){if(_0x84b1a&&_0x84b1a[_0xc552('0x5b')]===0x0){return db[_0xc552('0x32')][_0xc552('0x54')]({'name':_0x1aed6a[_0xc552('0x34')],'resourceId':_0x1aed6a['id'],'type':_0x84b1a['name'],'sectionId':_0x84b1a['id']},{})[_0xc552('0x2e')](function(){return _0xf24529;});}else{return _0xf24529;}})[_0xc552('0x50')](function(_0x3ca733){logger[_0xc552('0x5c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3ca733);throw _0x3ca733;});}return _0xf24529;})[_0xc552('0x2e')](respondWithResult(_0x1e90a4,0xc9))['catch'](handleError(_0x1e90a4,null));};exports[_0xc552('0x2d')]=function(_0x24466e,_0x6f4a0d){if(_0x24466e['body']['id']){delete _0x24466e['body']['id'];}return db[_0xc552('0x38')][_0xc552('0x59')]({'where':{'id':_0x24466e['params']['id']}})['then'](handleEntityNotFound(_0x6f4a0d,null))['then'](saveUpdates(_0x24466e[_0xc552('0x5d')],null))[_0xc552('0x2e')](respondWithResult(_0x6f4a0d,null))[_0xc552('0x50')](handleError(_0x6f4a0d,null));};exports['destroy']=function(_0x401ebc,_0x380ce7){return db[_0xc552('0x38')][_0xc552('0x59')]({'where':{'id':_0x401ebc[_0xc552('0x52')]['id']}})[_0xc552('0x2e')](handleEntityNotFound(_0x380ce7,null))['then'](removeEntity(_0x380ce7,null))[_0xc552('0x50')](handleError(_0x380ce7,null));};exports['describe']=function(_0x56e6c6,_0x1b29af){return db[_0xc552('0x38')][_0xc552('0x5e')]()[_0xc552('0x2e')](respondWithResult(_0x1b29af,null))['catch'](handleError(_0x1b29af,null));};exports[_0xc552('0x5f')]=function(_0x1cf8ad,_0x52597c,_0x3455b6){var _0x217690={'raw':!![],'where':{}},_0x4072a3={},_0x48f936;return db['MailQueue'][_0xc552('0x60')]({'where':{'id':_0x1cf8ad[_0xc552('0x52')]['id']}})['then'](handleEntityNotFound(_0x52597c,null))[_0xc552('0x2e')](function(_0x28ecdc){if(_0x28ecdc){_0x48f936=_0x28ecdc[_0xc552('0x30')]({'plain':!![]});_0x4072a3[_0xc552('0x3c')]=_[_0xc552('0x53')](db[_0xc552('0x61')][_0xc552('0x39')]);_0x4072a3[_0xc552('0x3d')]=_['keys'](_0x1cf8ad['query']);_0x4072a3[_0xc552('0x3e')]=_[_0xc552('0x3f')](_0x4072a3[_0xc552('0x3c')],_0x4072a3[_0xc552('0x3d')]);_0x217690[_0xc552('0x40')]=_[_0xc552('0x3f')](_0x4072a3[_0xc552('0x3c')],qs['fields'](_0x1cf8ad['query'][_0xc552('0x41')]));_0x217690[_0xc552('0x40')]=_0x217690['attributes'][_0xc552('0x42')]?_0x217690[_0xc552('0x40')]:_0x4072a3[_0xc552('0x3c')];if(!_0x1cf8ad[_0xc552('0x3d')][_0xc552('0x43')](_0xc552('0x44'))){_0x217690['limit']=qs[_0xc552('0x26')](_0x1cf8ad[_0xc552('0x3d')][_0xc552('0x26')]);_0x217690[_0xc552('0x24')]=qs[_0xc552('0x24')](_0x1cf8ad['query']['offset']);}_0x217690[_0xc552('0x45')]=qs[_0xc552('0x46')](_0x1cf8ad[_0xc552('0x3d')][_0xc552('0x46')]);_0x217690['where']=qs['filters'](_['pick'](_0x1cf8ad[_0xc552('0x3d')],_0x4072a3['filters']));_0x217690[_0xc552('0x47')][_0xc552('0x62')]=_0x28ecdc['id'];if(_0x1cf8ad[_0xc552('0x3d')][_0xc552('0x49')]){_0x217690[_0xc552('0x47')]=_['merge'](_0x217690[_0xc552('0x47')],{'$or':_['map'](_0x217690['attributes'],function(_0x4fc0a3){var _0x165605={};_0x165605[_0x4fc0a3]={'$like':'%'+_0x1cf8ad[_0xc552('0x3d')]['filter']+'%'};return _0x165605;})});}_0x217690=_[_0xc552('0x4a')]({},_0x217690,_0x1cf8ad[_0xc552('0x4b')]);return db[_0xc552('0x61')][_0xc552('0x4e')](_0x217690);}})[_0xc552('0x2e')](function(_0x171a19){if(_0x171a19){return db[_0xc552('0x63')][_0xc552('0x64')]({'where':{'id':_[_0xc552('0x37')](_0x171a19,_0xc552('0x65')),'role':_0xc552('0x66')},'attributes':['id',_0xc552('0x34'),_0xc552('0x67'),_0xc552('0x68'),_0xc552('0x69')]});}})['then'](function(_0x194024){if(_0x194024){return{'count':_0x194024[_0xc552('0x27')],'rows':_[_0xc552('0x37')](_0x194024[_0xc552('0x4f')],function(_0x5f324a){return{'membername':_0x5f324a['name'],'UserId':_0x5f324a['id'],'queue_name':_0x48f936[_0xc552('0x34')],'MailQueueId':_0x48f936['id'],'interface':util['format'](_0xc552('0x6a'),_0xc552('0x6b'),_0x5f324a[_0xc552('0x34')]),'penalty':0x0,'paused':_0x5f324a[_0xc552('0x67')],'createdAt':_0x5f324a['createdAt'],'updatedAt':_0x5f324a[_0xc552('0x68')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc552('0x2e')](respondWithFilteredResult(_0x52597c,_0x217690))['catch'](handleError(_0x52597c,null));};exports['getTeams']=function(_0x455161,_0x4f85a4,_0x160674){var _0x296f05={};var _0x545b59={};var _0x2ecdcb;var _0x442edb;return db[_0xc552('0x38')]['findOne']({'where':{'id':_0x455161[_0xc552('0x52')]['id']}})[_0xc552('0x2e')](handleEntityNotFound(_0x4f85a4,null))[_0xc552('0x2e')](function(_0x4744f7){if(_0x4744f7){_0x2ecdcb=_0x4744f7;_0x545b59[_0xc552('0x3c')]=_[_0xc552('0x53')](db['Team'][_0xc552('0x39')]);_0x545b59['query']=_[_0xc552('0x53')](_0x455161['query']);_0x545b59[_0xc552('0x3e')]=_['intersection'](_0x545b59[_0xc552('0x3c')],_0x545b59[_0xc552('0x3d')]);_0x296f05['attributes']=_['intersection'](_0x545b59[_0xc552('0x3c')],qs[_0xc552('0x41')](_0x455161['query'][_0xc552('0x41')]));_0x296f05['attributes']=_0x296f05[_0xc552('0x40')]['length']?_0x296f05['attributes']:_0x545b59[_0xc552('0x3c')];_0x296f05[_0xc552('0x45')]=qs[_0xc552('0x46')](_0x455161[_0xc552('0x3d')]['sort']);_0x296f05[_0xc552('0x47')]=qs[_0xc552('0x3e')](_['pick'](_0x455161['query'],_0x545b59[_0xc552('0x3e')]));if(_0x455161[_0xc552('0x3d')]['filter']){_0x296f05[_0xc552('0x47')]=_[_0xc552('0x4a')](_0x296f05[_0xc552('0x47')],{'$or':_['map'](_0x296f05['attributes'],function(_0x5eba02){var _0x2469ba={};_0x2469ba[_0x5eba02]={'$like':'%'+_0x455161[_0xc552('0x3d')][_0xc552('0x49')]+'%'};return _0x2469ba;})});}_0x296f05=_[_0xc552('0x4a')]({},_0x296f05,_0x455161[_0xc552('0x4b')]);return _0x2ecdcb[_0xc552('0x6c')](_0x296f05);}})[_0xc552('0x2e')](function(_0x3bd032){if(_0x3bd032){_0x442edb=_0x3bd032['length'];if(!_0x455161[_0xc552('0x3d')]['hasOwnProperty'](_0xc552('0x44'))){_0x296f05[_0xc552('0x26')]=qs[_0xc552('0x26')](_0x455161[_0xc552('0x3d')][_0xc552('0x26')]);_0x296f05['offset']=qs[_0xc552('0x24')](_0x455161[_0xc552('0x3d')]['offset']);}return _0x2ecdcb['getTeams'](_0x296f05);}})[_0xc552('0x2e')](function(_0x3a86bd){if(_0x3a86bd){return _0x3a86bd?{'count':_0x442edb,'rows':_0x3a86bd}:null;}})[_0xc552('0x2e')](respondWithResult(_0x4f85a4,null))[_0xc552('0x50')](handleError(_0x4f85a4,null));};exports['addTeams']=function(_0x3b2639,_0x502c21,_0x358b81){var _0x4f6ebd=_0x3b2639[_0xc552('0x5d')][_0xc552('0x6d')];return db[_0xc552('0x6e')][_0xc552('0x4e')]({'where':{'id':_0x4f6ebd},'attributes':['id'],'include':[{'model':db[_0xc552('0x63')],'as':_0xc552('0x6f'),'attributes':['id',_0xc552('0x34'),_0xc552('0x70'),_0xc552('0x71'),_0xc552('0x72')],'raw':!![]}]})[_0xc552('0x2e')](function(_0x385596){if(_0x385596){var _0x38e110=_['flatMap'](_0x385596,function(_0x18ee6b){var _0x3657a5=_0x18ee6b[_0xc552('0x30')]({'plain':!![]});return _0x3657a5['Agents'];});return db[_0xc552('0x38')][_0xc552('0x59')]({'where':{'id':_0x3b2639[_0xc552('0x52')]['id']}})[_0xc552('0x2e')](function(_0x540ae5){return db[_0xc552('0x73')]['transaction'](function(_0x1773e1){return _0x540ae5[_0xc552('0x74')](_0x4f6ebd,{'transaction':_0x1773e1})[_0xc552('0x2e')](function(){return BPromise[_0xc552('0x75')](_0x38e110,function(_0x31e4ba){return db[_0xc552('0x61')][_0xc552('0x76')]({'where':{'UserId':_0x31e4ba['id'],'MailQueueId':_0x3b2639[_0xc552('0x52')]['id']},'transaction':_0x1773e1});});})['then'](function(){_0x38e110[_0xc552('0x77')](function(_0x56b890){socket['emit']('userMailQueue:save',{'UserId':_0x56b890['id'],'MailQueueId':_0x540ae5['id']});});});});});}})[_0xc552('0x2e')](respondWithStatusCode(_0x502c21,null))['catch'](handleError(_0x502c21,null));};exports['removeTeams']=function(_0x3dba44,_0x34814a,_0x2f1d71){return db[_0xc552('0x6e')][_0xc552('0x4e')]({'where':{'id':_0x3dba44[_0xc552('0x3d')][_0xc552('0x6d')]},'attributes':['id'],'include':[{'model':db[_0xc552('0x63')],'as':_0xc552('0x6f'),'attributes':['id'],'raw':!![]}]})[_0xc552('0x2e')](handleEntityNotFound(_0x34814a,null))[_0xc552('0x2e')](function(_0xe057d9){var _0x96ef7d=_[_0xc552('0x37')](_0xe057d9,'id');var _0x2e3725=[];var _0x2b53ff=[];var _0x22554d=squel['select']();_0x22554d[_0xc552('0x78')](_0xc552('0x79'))['from'](_0xc552('0x7a'),'tq')['join'](_0xc552('0x7b'),'ut',_0xc552('0x7c'))[_0xc552('0x47')](_0xc552('0x7d'),_0x3dba44[_0xc552('0x52')]['id']);for(var _0x5d326e=0x0;_0x5d326e<_0xe057d9[_0xc552('0x42')];_0x5d326e+=0x1){let _0x4bfacc=_0xe057d9[_0x5d326e];for(var _0x16b5b2=0x0;_0x16b5b2<_0x4bfacc[_0xc552('0x6f')][_0xc552('0x42')];_0x16b5b2+=0x1){let _0x3c9cc1=_0x4bfacc[_0xc552('0x6f')][_0x16b5b2];var _0x4e8fb4=_0x22554d[_0xc552('0x7e')]();_0x4e8fb4[_0xc552('0x47')]('ut.UserId\x20=\x20?',_0x3c9cc1['id']);_0x2b53ff['push'](db[_0xc552('0x73')]['query'](_0x4e8fb4[_0xc552('0x7f')](),{'type':db[_0xc552('0x73')][_0xc552('0x80')][_0xc552('0x81')]})['then'](function(_0x441c97){if(_0x441c97[_0xc552('0x42')]===0x1){return _0x3c9cc1['id'];}else{var _0x15b453=_[_0xc552('0x82')](_[_0xc552('0x37')](_0x441c97,'TeamId'),function(_0x5ad726){return _[_0xc552('0x83')](_0x96ef7d,_0x5ad726);});if(_0x15b453){return _0x3c9cc1['id'];}}}));}}return BPromise[_0xc552('0x84')](_0x2b53ff)['then'](function(_0x238b3a){_0x2e3725=_(_0x2e3725)[_0xc552('0x85')](_0x238b3a)[_0xc552('0x86')]()[_0xc552('0x87')]();return db[_0xc552('0x38')]['find']({'where':{'id':_0x3dba44[_0xc552('0x52')]['id']}})['then'](function(_0xd61bf1){return db[_0xc552('0x73')]['transaction'](function(_0x3f5518){return _0xd61bf1[_0xc552('0x88')](_0x3dba44[_0xc552('0x3d')]['ids'],{'transaction':_0x3f5518})[_0xc552('0x2e')](function(){if(!_['isEmpty'](_0x2e3725)){return _0xd61bf1[_0xc552('0x89')](_0x2e3725,{'transaction':_0x3f5518});}})[_0xc552('0x2e')](function(){_0x2e3725['forEach'](function(_0x302c73){socket['emit']('userMailQueue:remove',{'UserId':_0x302c73,'MailQueueId':_0xd61bf1['id']});});});});});});})[_0xc552('0x2e')](respondWithStatusCode(_0x34814a,null))[_0xc552('0x50')](handleError(_0x34814a,null));};exports[_0xc552('0x8a')]=function(_0x4f1ce1,_0x36b9b1,_0x5be49b){return db[_0xc552('0x38')][_0xc552('0x59')]({'where':{'id':_0x4f1ce1['params']['id']}})['then'](handleEntityNotFound(_0x36b9b1,null))['then'](function(_0x3396b1){if(_0x3396b1){return _0x3396b1[_0xc552('0x8a')](_0x4f1ce1[_0xc552('0x5d')][_0xc552('0x6d')],_['omit'](_0x4f1ce1[_0xc552('0x5d')],[_0xc552('0x6d'),'id'])||{})[_0xc552('0x8b')](function(_0x50260f){for(var _0x14a266=0x0;_0x14a266<_0x4f1ce1[_0xc552('0x5d')][_0xc552('0x6d')][_0xc552('0x42')];_0x14a266+=0x1){socket[_0xc552('0x8c')](_0xc552('0x8d'),{'UserId':Number(_0x4f1ce1[_0xc552('0x5d')][_0xc552('0x6d')][_0x14a266]),'MailQueueId':Number(_0x4f1ce1[_0xc552('0x52')]['id'])});}return _0x50260f;});}})[_0xc552('0x2e')](respondWithResult(_0x36b9b1,null))[_0xc552('0x50')](handleError(_0x36b9b1,null));};exports[_0xc552('0x89')]=function(_0x4f22fb,_0xbd6c6,_0x4c48e2){return db['MailQueue'][_0xc552('0x59')]({'where':{'id':_0x4f22fb[_0xc552('0x52')]['id']}})['then'](handleEntityNotFound(_0xbd6c6,null))['then'](function(_0x38b81f){if(_0x38b81f){return _0x38b81f[_0xc552('0x89')](_0x4f22fb[_0xc552('0x3d')][_0xc552('0x6d')])[_0xc552('0x2e')](function(){if(_[_0xc552('0x8e')](_0x4f22fb[_0xc552('0x3d')][_0xc552('0x6d')])){for(var _0xb69040=0x0;_0xb69040<_0x4f22fb['query']['ids']['length'];_0xb69040+=0x1){socket[_0xc552('0x8c')](_0xc552('0x8f'),{'UserId':Number(_0x4f22fb[_0xc552('0x3d')]['ids'][_0xb69040]),'MailQueueId':Number(_0x4f22fb[_0xc552('0x52')]['id'])});}}else{socket['emit'](_0xc552('0x8f'),{'UserId':Number(_0x4f22fb[_0xc552('0x3d')][_0xc552('0x6d')]),'MailQueueId':Number(_0x4f22fb[_0xc552('0x52')]['id'])});}});}})[_0xc552('0x2e')](respondWithStatusCode(_0xbd6c6,null))[_0xc552('0x50')](handleError(_0xbd6c6,null));};exports[_0xc552('0x90')]=function(_0x473e3f,_0x361a32,_0x2f2831){var _0x3eb7ae={};var _0x18a097={};var _0x5aa542;var _0x338e7f;return db[_0xc552('0x38')]['findOne']({'where':{'id':_0x473e3f[_0xc552('0x52')]['id']}})[_0xc552('0x2e')](handleEntityNotFound(_0x361a32,null))[_0xc552('0x2e')](function(_0x3c3c63){if(_0x3c3c63){_0x5aa542=_0x3c3c63;_0x18a097['model']=_[_0xc552('0x53')](db[_0xc552('0x63')][_0xc552('0x39')]);_0x18a097[_0xc552('0x3d')]=_[_0xc552('0x53')](_0x473e3f[_0xc552('0x3d')]);_0x18a097[_0xc552('0x3e')]=_[_0xc552('0x3f')](_0x18a097[_0xc552('0x3c')],_0x18a097[_0xc552('0x3d')]);_0x3eb7ae['attributes']=_[_0xc552('0x3f')](_0x18a097[_0xc552('0x3c')],qs['fields'](_0x473e3f[_0xc552('0x3d')][_0xc552('0x41')]));_0x3eb7ae['attributes']=_0x3eb7ae[_0xc552('0x40')][_0xc552('0x42')]?_0x3eb7ae[_0xc552('0x40')]:_0x18a097[_0xc552('0x3c')];_0x3eb7ae[_0xc552('0x45')]=qs[_0xc552('0x46')](_0x473e3f[_0xc552('0x3d')][_0xc552('0x46')]);_0x3eb7ae['where']=qs[_0xc552('0x3e')](_['pick'](_0x473e3f[_0xc552('0x3d')],_0x18a097['filters']));if(_0x473e3f[_0xc552('0x3d')][_0xc552('0x49')]){_0x3eb7ae['where']=_[_0xc552('0x4a')](_0x3eb7ae[_0xc552('0x47')],{'$or':_[_0xc552('0x37')](_0x3eb7ae[_0xc552('0x40')],function(_0x30bc4c){var _0x5cb0ba={};_0x5cb0ba[_0x30bc4c]={'$like':'%'+_0x473e3f[_0xc552('0x3d')][_0xc552('0x49')]+'%'};return _0x5cb0ba;})});}_0x3eb7ae=_[_0xc552('0x4a')]({},_0x3eb7ae,_0x473e3f[_0xc552('0x4b')]);return _0x5aa542[_0xc552('0x90')](_0x3eb7ae);}})['then'](function(_0x24a9d3){if(_0x24a9d3){_0x338e7f=_0x24a9d3['length'];if(!_0x473e3f[_0xc552('0x3d')][_0xc552('0x43')](_0xc552('0x44'))){_0x3eb7ae[_0xc552('0x26')]=qs[_0xc552('0x26')](_0x473e3f[_0xc552('0x3d')][_0xc552('0x26')]);_0x3eb7ae['offset']=qs['offset'](_0x473e3f[_0xc552('0x3d')]['offset']);}return _0x5aa542['getAgents'](_0x3eb7ae);}})[_0xc552('0x2e')](function(_0x8675a4){if(_0x8675a4){return _0x8675a4?{'count':_0x338e7f,'rows':_0x8675a4}:null;}})[_0xc552('0x2e')](respondWithResult(_0x361a32,null))[_0xc552('0x50')](handleError(_0x361a32,null));}; \ No newline at end of file +var _0x48dd=['team_has_mail_queues','user_has_teams','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','every','TeamId','includes','all','compact','transaction','isEmpty','removeAgents','emit','userMailQueue:remove','addAgents','spread','userMailQueue:save','isArray','getAgents','User','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailQueue.socket','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','destroy','then','get','MailQueues','UserProfileResource','stack','name','map','MailQueue','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','error','body','describe','getMembers','UserMailQueue','pick','findAndCountAll','agent','mailPause','updatedAt','createdAt','%s/%s','SIP','getTeams','findOne','addTeams','ids','Agents','online','interface','sequelize','each','forEach','removeTeams','Team','select','from'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0x48dd,0x99));var _0xd48d=function(_0x3739fb,_0x2748b6){_0x3739fb=_0x3739fb-0x0;var _0x17ff4c=_0x48dd[_0x3739fb];return _0x17ff4c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd48d('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd48d('0x1'));var moment=require('moment');var BPromise=require(_0xd48d('0x2'));var Mustache=require(_0xd48d('0x3'));var util=require(_0xd48d('0x4'));var path=require('path');var sox=require(_0xd48d('0x5'));var csv=require(_0xd48d('0x6'));var ejs=require(_0xd48d('0x7'));var fs=require('fs');var fs_extra=require(_0xd48d('0x8'));var _=require('lodash');var squel=require(_0xd48d('0x9'));var crypto=require(_0xd48d('0xa'));var jsforce=require(_0xd48d('0xb'));var deskjs=require(_0xd48d('0xc'));var toCsv=require(_0xd48d('0x6'));var querystring=require(_0xd48d('0xd'));var Papa=require(_0xd48d('0xe'));var Redis=require(_0xd48d('0xf'));var authService=require(_0xd48d('0x10'));var qs=require(_0xd48d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd48d('0x12'));var logger=require(_0xd48d('0x13'))(_0xd48d('0x14'));var utils=require('../../config/utils');var config=require(_0xd48d('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xd48d('0x16'))['db'];config[_0xd48d('0x17')]=_['defaults'](config['redis'],{'host':_0xd48d('0x18'),'port':0x18eb});var socket=require(_0xd48d('0x19'))(new Redis(config['redis']));require(_0xd48d('0x1a'))['register'](socket);function respondWithStatusCode(_0x59a97d,_0x285e27){_0x285e27=_0x285e27||0xcc;return function(_0x1e9e1a){if(_0x1e9e1a){return _0x59a97d[_0xd48d('0x1b')](_0x285e27);}return _0x59a97d[_0xd48d('0x1c')](_0x285e27)[_0xd48d('0x1d')]();};}function respondWithResult(_0x8d8377,_0x263941){_0x263941=_0x263941||0xc8;return function(_0x5b5299){if(_0x5b5299){return _0x8d8377[_0xd48d('0x1c')](_0x263941)[_0xd48d('0x1e')](_0x5b5299);}};}function respondWithFilteredResult(_0x13601f,_0x264ec1){return function(_0xf3add2){if(_0xf3add2){var _0x28d4d1=typeof _0x264ec1[_0xd48d('0x1f')]===_0xd48d('0x20')&&typeof _0x264ec1['limit']===_0xd48d('0x20');var _0x11f8a7=_0xf3add2[_0xd48d('0x21')];var _0x8b8844=_0x28d4d1?0x0:_0x264ec1[_0xd48d('0x1f')];var _0x172a09=_0x28d4d1?_0xf3add2[_0xd48d('0x21')]:_0x264ec1[_0xd48d('0x1f')]+_0x264ec1[_0xd48d('0x22')];var _0x23aa93;if(_0x172a09>=_0x11f8a7){_0x172a09=_0x11f8a7;_0x23aa93=0xc8;}else{_0x23aa93=0xce;}_0x13601f[_0xd48d('0x1c')](_0x23aa93);return _0x13601f[_0xd48d('0x23')](_0xd48d('0x24'),_0x8b8844+'-'+_0x172a09+'/'+_0x11f8a7)['json'](_0xf3add2);}return null;};}function patchUpdates(_0x28838d){return function(_0x43836a){try{jsonpatch['apply'](_0x43836a,_0x28838d,!![]);}catch(_0x204f05){return BPromise[_0xd48d('0x25')](_0x204f05);}return _0x43836a['save']();};}function saveUpdates(_0x16eaa9,_0x4bd816){return function(_0x1314df){if(_0x1314df){return _0x1314df[_0xd48d('0x26')](_0x16eaa9)['then'](function(_0x1527e7){return _0x1527e7;});}return null;};}function removeEntity(_0x582d11,_0x2d51c5){return function(_0x2017e4){if(_0x2017e4){return _0x2017e4[_0xd48d('0x27')]()[_0xd48d('0x28')](function(){var _0x3c9f93=_0x2017e4[_0xd48d('0x29')]({'plain':!![]});var _0x3154bd=_0xd48d('0x2a');return db[_0xd48d('0x2b')][_0xd48d('0x27')]({'where':{'type':_0x3154bd,'resourceId':_0x3c9f93['id']}})['then'](function(){return _0x2017e4;});})[_0xd48d('0x28')](function(){_0x582d11[_0xd48d('0x1c')](0xcc)[_0xd48d('0x1d')]();});}};}function handleEntityNotFound(_0x352d52,_0x2d929e){return function(_0x212bb7){if(!_0x212bb7){_0x352d52[_0xd48d('0x1b')](0x194);}return _0x212bb7;};}function handleError(_0x370397,_0x174a79){_0x174a79=_0x174a79||0x1f4;return function(_0x4df21a){logger['error'](_0x4df21a[_0xd48d('0x2c')]);if(_0x4df21a[_0xd48d('0x2d')]){delete _0x4df21a[_0xd48d('0x2d')];}_0x370397[_0xd48d('0x1c')](_0x174a79)['send'](_0x4df21a);};}exports['index']=function(_0x2c655b,_0x3b41d3){var _0x5615aa={},_0x49da11={},_0xbbde2f={'count':0x0,'rows':[]};var _0x2f76c4=_[_0xd48d('0x2e')](db[_0xd48d('0x2f')][_0xd48d('0x30')],function(_0x4f9a85){return{'name':_0x4f9a85[_0xd48d('0x31')],'type':_0x4f9a85[_0xd48d('0x32')][_0xd48d('0x33')]};});_0x49da11[_0xd48d('0x34')]=_[_0xd48d('0x2e')](_0x2f76c4,_0xd48d('0x2d'));_0x49da11['query']=_[_0xd48d('0x35')](_0x2c655b['query']);_0x49da11[_0xd48d('0x36')]=_[_0xd48d('0x37')](_0x49da11[_0xd48d('0x34')],_0x49da11[_0xd48d('0x38')]);_0x5615aa[_0xd48d('0x39')]=_[_0xd48d('0x37')](_0x49da11[_0xd48d('0x34')],qs[_0xd48d('0x3a')](_0x2c655b['query'][_0xd48d('0x3a')]));_0x5615aa[_0xd48d('0x39')]=_0x5615aa['attributes'][_0xd48d('0x3b')]?_0x5615aa[_0xd48d('0x39')]:_0x49da11[_0xd48d('0x34')];if(!_0x2c655b[_0xd48d('0x38')][_0xd48d('0x3c')](_0xd48d('0x3d'))){_0x5615aa['limit']=qs[_0xd48d('0x22')](_0x2c655b['query'][_0xd48d('0x22')]);_0x5615aa['offset']=qs['offset'](_0x2c655b['query'][_0xd48d('0x1f')]);}_0x5615aa[_0xd48d('0x3e')]=qs[_0xd48d('0x3f')](_0x2c655b[_0xd48d('0x38')]['sort']);_0x5615aa[_0xd48d('0x40')]=qs[_0xd48d('0x36')](_['pick'](_0x2c655b[_0xd48d('0x38')],_0x49da11[_0xd48d('0x36')]),_0x2f76c4);if(_0x2c655b[_0xd48d('0x38')][_0xd48d('0x41')]){_0x5615aa[_0xd48d('0x40')]=_[_0xd48d('0x42')](_0x5615aa['where'],{'$or':_[_0xd48d('0x2e')](_0x2f76c4,function(_0x33c13f){if(_0x33c13f[_0xd48d('0x32')]!==_0xd48d('0x43')){var _0x12b0dc={};_0x12b0dc[_0x33c13f['name']]={'$like':'%'+_0x2c655b[_0xd48d('0x38')][_0xd48d('0x41')]+'%'};return _0x12b0dc;}})});}_0x5615aa=_[_0xd48d('0x42')]({},_0x5615aa,_0x2c655b[_0xd48d('0x44')]);var _0x406fdc={'where':_0x5615aa[_0xd48d('0x40')]};return db['MailQueue']['count'](_0x406fdc)[_0xd48d('0x28')](function(_0x5d4e6b){_0xbbde2f[_0xd48d('0x21')]=_0x5d4e6b;if(_0x2c655b[_0xd48d('0x38')][_0xd48d('0x45')]){_0x5615aa['include']=[{'all':!![]}];}return db[_0xd48d('0x2f')][_0xd48d('0x46')](_0x5615aa);})[_0xd48d('0x28')](function(_0x3f35ab){_0xbbde2f[_0xd48d('0x47')]=_0x3f35ab;return _0xbbde2f;})[_0xd48d('0x28')](respondWithFilteredResult(_0x3b41d3,_0x5615aa))[_0xd48d('0x48')](handleError(_0x3b41d3,null));};exports[_0xd48d('0x49')]=function(_0x56b68e,_0xebfe1a){var _0x483221={'raw':!![],'where':{'id':_0x56b68e[_0xd48d('0x4a')]['id']}},_0xb2a119={};_0xb2a119[_0xd48d('0x34')]=_[_0xd48d('0x35')](db['MailQueue'][_0xd48d('0x30')]);_0xb2a119[_0xd48d('0x38')]=_[_0xd48d('0x35')](_0x56b68e[_0xd48d('0x38')]);_0xb2a119[_0xd48d('0x36')]=_['intersection'](_0xb2a119[_0xd48d('0x34')],_0xb2a119[_0xd48d('0x38')]);_0x483221[_0xd48d('0x39')]=_[_0xd48d('0x37')](_0xb2a119[_0xd48d('0x34')],qs[_0xd48d('0x3a')](_0x56b68e['query'][_0xd48d('0x3a')]));_0x483221['attributes']=_0x483221[_0xd48d('0x39')][_0xd48d('0x3b')]?_0x483221[_0xd48d('0x39')]:_0xb2a119[_0xd48d('0x34')];if(_0x56b68e['query'][_0xd48d('0x45')]){_0x483221[_0xd48d('0x4b')]=[{'all':!![]}];}_0x483221=_[_0xd48d('0x42')]({},_0x483221,_0x56b68e[_0xd48d('0x44')]);return db['MailQueue']['find'](_0x483221)[_0xd48d('0x28')](handleEntityNotFound(_0xebfe1a,null))['then'](respondWithResult(_0xebfe1a,null))['catch'](handleError(_0xebfe1a,null));};exports[_0xd48d('0x4c')]=function(_0x5b85b3,_0x24474c){return db[_0xd48d('0x2f')]['create'](_0x5b85b3['body'],{})[_0xd48d('0x28')](function(_0x1ee917){var _0x112bf1=_0x5b85b3[_0xd48d('0x4d')][_0xd48d('0x29')]({'plain':!![]});if(!_0x112bf1)throw new Error(_0xd48d('0x4e'));if(_0x112bf1['role']===_0xd48d('0x4d')){var _0x211b5b=_0x1ee917['get']({'plain':!![]});var _0x257545=_0xd48d('0x2a');return db[_0xd48d('0x4f')][_0xd48d('0x50')]({'where':{'name':_0x257545,'userProfileId':_0x112bf1[_0xd48d('0x51')]},'raw':!![]})[_0xd48d('0x28')](function(_0x2ea015){if(_0x2ea015&&_0x2ea015['autoAssociation']===0x0){return db[_0xd48d('0x2b')][_0xd48d('0x4c')]({'name':_0x211b5b[_0xd48d('0x2d')],'resourceId':_0x211b5b['id'],'type':_0x2ea015['name'],'sectionId':_0x2ea015['id']},{})['then'](function(){return _0x1ee917;});}else{return _0x1ee917;}})['catch'](function(_0x35d4e4){logger[_0xd48d('0x52')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x35d4e4);throw _0x35d4e4;});}return _0x1ee917;})[_0xd48d('0x28')](respondWithResult(_0x24474c,0xc9))[_0xd48d('0x48')](handleError(_0x24474c,null));};exports[_0xd48d('0x26')]=function(_0x247082,_0x3cbbe2){if(_0x247082[_0xd48d('0x53')]['id']){delete _0x247082[_0xd48d('0x53')]['id'];}return db[_0xd48d('0x2f')][_0xd48d('0x50')]({'where':{'id':_0x247082[_0xd48d('0x4a')]['id']}})[_0xd48d('0x28')](handleEntityNotFound(_0x3cbbe2,null))[_0xd48d('0x28')](saveUpdates(_0x247082[_0xd48d('0x53')],null))['then'](respondWithResult(_0x3cbbe2,null))[_0xd48d('0x48')](handleError(_0x3cbbe2,null));};exports['destroy']=function(_0x50869f,_0x476f73){return db[_0xd48d('0x2f')][_0xd48d('0x50')]({'where':{'id':_0x50869f[_0xd48d('0x4a')]['id']}})[_0xd48d('0x28')](handleEntityNotFound(_0x476f73,null))[_0xd48d('0x28')](removeEntity(_0x476f73,null))['catch'](handleError(_0x476f73,null));};exports[_0xd48d('0x54')]=function(_0x484834,_0x491ac0){return db[_0xd48d('0x2f')][_0xd48d('0x54')]()[_0xd48d('0x28')](respondWithResult(_0x491ac0,null))[_0xd48d('0x48')](handleError(_0x491ac0,null));};exports[_0xd48d('0x55')]=function(_0x2a39c6,_0x1ef6dc,_0x25e934){var _0x20cc16={'raw':!![],'where':{}},_0x4bb0ef={},_0x39afc7;return db[_0xd48d('0x2f')]['findOne']({'where':{'id':_0x2a39c6['params']['id']}})[_0xd48d('0x28')](handleEntityNotFound(_0x1ef6dc,null))['then'](function(_0x2667e7){if(_0x2667e7){_0x39afc7=_0x2667e7[_0xd48d('0x29')]({'plain':!![]});_0x4bb0ef[_0xd48d('0x34')]=_[_0xd48d('0x35')](db[_0xd48d('0x56')][_0xd48d('0x30')]);_0x4bb0ef['query']=_[_0xd48d('0x35')](_0x2a39c6[_0xd48d('0x38')]);_0x4bb0ef[_0xd48d('0x36')]=_['intersection'](_0x4bb0ef['model'],_0x4bb0ef[_0xd48d('0x38')]);_0x20cc16[_0xd48d('0x39')]=_[_0xd48d('0x37')](_0x4bb0ef[_0xd48d('0x34')],qs[_0xd48d('0x3a')](_0x2a39c6[_0xd48d('0x38')][_0xd48d('0x3a')]));_0x20cc16[_0xd48d('0x39')]=_0x20cc16[_0xd48d('0x39')][_0xd48d('0x3b')]?_0x20cc16[_0xd48d('0x39')]:_0x4bb0ef[_0xd48d('0x34')];if(!_0x2a39c6[_0xd48d('0x38')][_0xd48d('0x3c')](_0xd48d('0x3d'))){_0x20cc16['limit']=qs[_0xd48d('0x22')](_0x2a39c6[_0xd48d('0x38')]['limit']);_0x20cc16['offset']=qs[_0xd48d('0x1f')](_0x2a39c6[_0xd48d('0x38')][_0xd48d('0x1f')]);}_0x20cc16[_0xd48d('0x3e')]=qs[_0xd48d('0x3f')](_0x2a39c6[_0xd48d('0x38')]['sort']);_0x20cc16[_0xd48d('0x40')]=qs[_0xd48d('0x36')](_[_0xd48d('0x57')](_0x2a39c6[_0xd48d('0x38')],_0x4bb0ef[_0xd48d('0x36')]));_0x20cc16[_0xd48d('0x40')]['MailQueueId']=_0x2667e7['id'];if(_0x2a39c6[_0xd48d('0x38')][_0xd48d('0x41')]){_0x20cc16['where']=_[_0xd48d('0x42')](_0x20cc16[_0xd48d('0x40')],{'$or':_[_0xd48d('0x2e')](_0x20cc16[_0xd48d('0x39')],function(_0x153bed){var _0x25f6e2={};_0x25f6e2[_0x153bed]={'$like':'%'+_0x2a39c6['query']['filter']+'%'};return _0x25f6e2;})});}_0x20cc16=_[_0xd48d('0x42')]({},_0x20cc16,_0x2a39c6['options']);return db[_0xd48d('0x56')][_0xd48d('0x46')](_0x20cc16);}})[_0xd48d('0x28')](function(_0x4b881f){if(_0x4b881f){return db['User'][_0xd48d('0x58')]({'where':{'id':_['map'](_0x4b881f,'UserId'),'role':_0xd48d('0x59')},'attributes':['id',_0xd48d('0x2d'),_0xd48d('0x5a'),_0xd48d('0x5b'),_0xd48d('0x5c')]});}})[_0xd48d('0x28')](function(_0x1d9f40){if(_0x1d9f40){return{'count':_0x1d9f40[_0xd48d('0x21')],'rows':_[_0xd48d('0x2e')](_0x1d9f40['rows'],function(_0x3a60de){return{'membername':_0x3a60de[_0xd48d('0x2d')],'UserId':_0x3a60de['id'],'queue_name':_0x39afc7[_0xd48d('0x2d')],'MailQueueId':_0x39afc7['id'],'interface':util['format'](_0xd48d('0x5d'),_0xd48d('0x5e'),_0x3a60de['name']),'penalty':0x0,'paused':_0x3a60de[_0xd48d('0x5a')],'createdAt':_0x3a60de[_0xd48d('0x5c')],'updatedAt':_0x3a60de[_0xd48d('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xd48d('0x28')](respondWithFilteredResult(_0x1ef6dc,_0x20cc16))[_0xd48d('0x48')](handleError(_0x1ef6dc,null));};exports[_0xd48d('0x5f')]=function(_0x472c45,_0x23f1a1,_0x220b55){var _0x2abe62={};var _0x877e3={};var _0x69e667;var _0x2755e8;return db['MailQueue'][_0xd48d('0x60')]({'where':{'id':_0x472c45[_0xd48d('0x4a')]['id']}})[_0xd48d('0x28')](handleEntityNotFound(_0x23f1a1,null))[_0xd48d('0x28')](function(_0x175c86){if(_0x175c86){_0x69e667=_0x175c86;_0x877e3[_0xd48d('0x34')]=_[_0xd48d('0x35')](db['Team'][_0xd48d('0x30')]);_0x877e3['query']=_['keys'](_0x472c45[_0xd48d('0x38')]);_0x877e3['filters']=_['intersection'](_0x877e3[_0xd48d('0x34')],_0x877e3[_0xd48d('0x38')]);_0x2abe62['attributes']=_['intersection'](_0x877e3[_0xd48d('0x34')],qs[_0xd48d('0x3a')](_0x472c45[_0xd48d('0x38')][_0xd48d('0x3a')]));_0x2abe62[_0xd48d('0x39')]=_0x2abe62[_0xd48d('0x39')][_0xd48d('0x3b')]?_0x2abe62['attributes']:_0x877e3[_0xd48d('0x34')];_0x2abe62['order']=qs[_0xd48d('0x3f')](_0x472c45[_0xd48d('0x38')][_0xd48d('0x3f')]);_0x2abe62[_0xd48d('0x40')]=qs['filters'](_['pick'](_0x472c45['query'],_0x877e3[_0xd48d('0x36')]));if(_0x472c45[_0xd48d('0x38')][_0xd48d('0x41')]){_0x2abe62[_0xd48d('0x40')]=_[_0xd48d('0x42')](_0x2abe62['where'],{'$or':_[_0xd48d('0x2e')](_0x2abe62['attributes'],function(_0x2394bf){var _0x141a5f={};_0x141a5f[_0x2394bf]={'$like':'%'+_0x472c45[_0xd48d('0x38')]['filter']+'%'};return _0x141a5f;})});}_0x2abe62=_[_0xd48d('0x42')]({},_0x2abe62,_0x472c45[_0xd48d('0x44')]);return _0x69e667[_0xd48d('0x5f')](_0x2abe62);}})[_0xd48d('0x28')](function(_0x211c0c){if(_0x211c0c){_0x2755e8=_0x211c0c['length'];if(!_0x472c45['query'][_0xd48d('0x3c')]('nolimit')){_0x2abe62['limit']=qs[_0xd48d('0x22')](_0x472c45['query']['limit']);_0x2abe62[_0xd48d('0x1f')]=qs[_0xd48d('0x1f')](_0x472c45[_0xd48d('0x38')][_0xd48d('0x1f')]);}return _0x69e667[_0xd48d('0x5f')](_0x2abe62);}})[_0xd48d('0x28')](function(_0x1794af){if(_0x1794af){return _0x1794af?{'count':_0x2755e8,'rows':_0x1794af}:null;}})['then'](respondWithResult(_0x23f1a1,null))[_0xd48d('0x48')](handleError(_0x23f1a1,null));};exports[_0xd48d('0x61')]=function(_0x455773,_0x59db67,_0x5087f1){var _0x1dbc35=_0x455773[_0xd48d('0x53')][_0xd48d('0x62')];return db['Team'][_0xd48d('0x46')]({'where':{'id':_0x1dbc35},'attributes':['id'],'include':[{'model':db['User'],'as':_0xd48d('0x63'),'attributes':['id',_0xd48d('0x2d'),_0xd48d('0x64'),'voicePause',_0xd48d('0x65')],'raw':!![]}]})[_0xd48d('0x28')](function(_0x7e04c0){if(_0x7e04c0){var _0x156970=_['flatMap'](_0x7e04c0,function(_0x277fe7){var _0x1ccdb0=_0x277fe7[_0xd48d('0x29')]({'plain':!![]});return _0x1ccdb0[_0xd48d('0x63')];});return db[_0xd48d('0x2f')][_0xd48d('0x50')]({'where':{'id':_0x455773[_0xd48d('0x4a')]['id']}})[_0xd48d('0x28')](function(_0x1e8617){return db[_0xd48d('0x66')]['transaction'](function(_0x4bab02){return _0x1e8617[_0xd48d('0x61')](_0x1dbc35,{'transaction':_0x4bab02})[_0xd48d('0x28')](function(){return BPromise[_0xd48d('0x67')](_0x156970,function(_0x1596a8){return db[_0xd48d('0x56')]['findOrCreate']({'where':{'UserId':_0x1596a8['id'],'MailQueueId':_0x455773['params']['id']},'transaction':_0x4bab02});});})[_0xd48d('0x28')](function(){_0x156970[_0xd48d('0x68')](function(_0x546713){socket['emit']('userMailQueue:save',{'UserId':_0x546713['id'],'MailQueueId':_0x1e8617['id']});});});});});}})[_0xd48d('0x28')](respondWithStatusCode(_0x59db67,null))[_0xd48d('0x48')](handleError(_0x59db67,null));};exports[_0xd48d('0x69')]=function(_0x30ff1d,_0x4dafdb,_0x198264){return db[_0xd48d('0x6a')][_0xd48d('0x46')]({'where':{'id':_0x30ff1d['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xd48d('0x63'),'attributes':['id'],'raw':!![]}]})[_0xd48d('0x28')](handleEntityNotFound(_0x4dafdb,null))['then'](function(_0x13bcca){var _0x3d71e3=_[_0xd48d('0x2e')](_0x13bcca,'id');var _0x466a83=[];var _0x572101=[];var _0x589846=squel[_0xd48d('0x6b')]();_0x589846['field']('tq.TeamId')[_0xd48d('0x6c')](_0xd48d('0x6d'),'tq')['join'](_0xd48d('0x6e'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xd48d('0x6f'),_0x30ff1d['params']['id']);for(var _0x824d78=0x0;_0x824d78<_0x13bcca[_0xd48d('0x3b')];_0x824d78+=0x1){let _0x34438e=_0x13bcca[_0x824d78];for(var _0x1317ce=0x0;_0x1317ce<_0x34438e[_0xd48d('0x63')][_0xd48d('0x3b')];_0x1317ce+=0x1){let _0x4f637d=_0x34438e['Agents'][_0x1317ce];var _0x3df479=_0x589846[_0xd48d('0x70')]();_0x3df479['where'](_0xd48d('0x71'),_0x4f637d['id']);_0x572101['push'](db[_0xd48d('0x66')]['query'](_0x3df479[_0xd48d('0x72')](),{'type':db[_0xd48d('0x66')]['QueryTypes']['SELECT']})['then'](function(_0x2b01ad){if(_0x2b01ad[_0xd48d('0x3b')]===0x1){return _0x4f637d['id'];}else{var _0x4d2488=_[_0xd48d('0x73')](_[_0xd48d('0x2e')](_0x2b01ad,_0xd48d('0x74')),function(_0x538cd4){return _[_0xd48d('0x75')](_0x3d71e3,_0x538cd4);});if(_0x4d2488){return _0x4f637d['id'];}}}));}}return BPromise[_0xd48d('0x76')](_0x572101)['then'](function(_0xb1bfd0){_0x466a83=_(_0x466a83)['union'](_0xb1bfd0)[_0xd48d('0x77')]()['value']();return db[_0xd48d('0x2f')]['find']({'where':{'id':_0x30ff1d[_0xd48d('0x4a')]['id']}})[_0xd48d('0x28')](function(_0x37a515){return db[_0xd48d('0x66')][_0xd48d('0x78')](function(_0xeca7cc){return _0x37a515['removeTeams'](_0x30ff1d['query'][_0xd48d('0x62')],{'transaction':_0xeca7cc})['then'](function(){if(!_[_0xd48d('0x79')](_0x466a83)){return _0x37a515[_0xd48d('0x7a')](_0x466a83,{'transaction':_0xeca7cc});}})['then'](function(){_0x466a83['forEach'](function(_0x794ba6){socket[_0xd48d('0x7b')](_0xd48d('0x7c'),{'UserId':_0x794ba6,'MailQueueId':_0x37a515['id']});});});});});});})[_0xd48d('0x28')](respondWithStatusCode(_0x4dafdb,null))['catch'](handleError(_0x4dafdb,null));};exports[_0xd48d('0x7d')]=function(_0x1f0dd8,_0x49dc48,_0x2a5aa4){return db[_0xd48d('0x2f')][_0xd48d('0x50')]({'where':{'id':_0x1f0dd8[_0xd48d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x49dc48,null))['then'](function(_0x435470){if(_0x435470){return _0x435470['addAgents'](_0x1f0dd8[_0xd48d('0x53')]['ids'],_['omit'](_0x1f0dd8[_0xd48d('0x53')],['ids','id'])||{})[_0xd48d('0x7e')](function(_0x2eaf6c){for(var _0x350e88=0x0;_0x350e88<_0x1f0dd8[_0xd48d('0x53')][_0xd48d('0x62')]['length'];_0x350e88+=0x1){socket['emit'](_0xd48d('0x7f'),{'UserId':Number(_0x1f0dd8[_0xd48d('0x53')][_0xd48d('0x62')][_0x350e88]),'MailQueueId':Number(_0x1f0dd8[_0xd48d('0x4a')]['id'])});}return _0x2eaf6c;});}})[_0xd48d('0x28')](respondWithResult(_0x49dc48,null))[_0xd48d('0x48')](handleError(_0x49dc48,null));};exports[_0xd48d('0x7a')]=function(_0x441b26,_0xb1c2b3,_0x538898){return db['MailQueue'][_0xd48d('0x50')]({'where':{'id':_0x441b26[_0xd48d('0x4a')]['id']}})['then'](handleEntityNotFound(_0xb1c2b3,null))[_0xd48d('0x28')](function(_0x47b4f8){if(_0x47b4f8){return _0x47b4f8[_0xd48d('0x7a')](_0x441b26['query'][_0xd48d('0x62')])['then'](function(){if(_[_0xd48d('0x80')](_0x441b26[_0xd48d('0x38')]['ids'])){for(var _0x8c7142=0x0;_0x8c7142<_0x441b26['query']['ids']['length'];_0x8c7142+=0x1){socket[_0xd48d('0x7b')](_0xd48d('0x7c'),{'UserId':Number(_0x441b26[_0xd48d('0x38')][_0xd48d('0x62')][_0x8c7142]),'MailQueueId':Number(_0x441b26[_0xd48d('0x4a')]['id'])});}}else{socket[_0xd48d('0x7b')]('userMailQueue:remove',{'UserId':Number(_0x441b26[_0xd48d('0x38')][_0xd48d('0x62')]),'MailQueueId':Number(_0x441b26[_0xd48d('0x4a')]['id'])});}});}})[_0xd48d('0x28')](respondWithStatusCode(_0xb1c2b3,null))['catch'](handleError(_0xb1c2b3,null));};exports[_0xd48d('0x81')]=function(_0x19cf87,_0x35dba5,_0x350279){var _0x5cd2ac={};var _0x3bdedf={};var _0x369c02;var _0x4519c2;return db[_0xd48d('0x2f')][_0xd48d('0x60')]({'where':{'id':_0x19cf87[_0xd48d('0x4a')]['id']}})[_0xd48d('0x28')](handleEntityNotFound(_0x35dba5,null))[_0xd48d('0x28')](function(_0x4221e7){if(_0x4221e7){_0x369c02=_0x4221e7;_0x3bdedf[_0xd48d('0x34')]=_[_0xd48d('0x35')](db[_0xd48d('0x82')][_0xd48d('0x30')]);_0x3bdedf[_0xd48d('0x38')]=_['keys'](_0x19cf87['query']);_0x3bdedf[_0xd48d('0x36')]=_[_0xd48d('0x37')](_0x3bdedf['model'],_0x3bdedf[_0xd48d('0x38')]);_0x5cd2ac[_0xd48d('0x39')]=_['intersection'](_0x3bdedf[_0xd48d('0x34')],qs[_0xd48d('0x3a')](_0x19cf87[_0xd48d('0x38')][_0xd48d('0x3a')]));_0x5cd2ac[_0xd48d('0x39')]=_0x5cd2ac[_0xd48d('0x39')][_0xd48d('0x3b')]?_0x5cd2ac[_0xd48d('0x39')]:_0x3bdedf['model'];_0x5cd2ac['order']=qs[_0xd48d('0x3f')](_0x19cf87[_0xd48d('0x38')]['sort']);_0x5cd2ac[_0xd48d('0x40')]=qs[_0xd48d('0x36')](_[_0xd48d('0x57')](_0x19cf87[_0xd48d('0x38')],_0x3bdedf[_0xd48d('0x36')]));if(_0x19cf87[_0xd48d('0x38')][_0xd48d('0x41')]){_0x5cd2ac[_0xd48d('0x40')]=_[_0xd48d('0x42')](_0x5cd2ac[_0xd48d('0x40')],{'$or':_[_0xd48d('0x2e')](_0x5cd2ac['attributes'],function(_0x5e6f1f){var _0x5f454b={};_0x5f454b[_0x5e6f1f]={'$like':'%'+_0x19cf87['query'][_0xd48d('0x41')]+'%'};return _0x5f454b;})});}_0x5cd2ac=_[_0xd48d('0x42')]({},_0x5cd2ac,_0x19cf87[_0xd48d('0x44')]);return _0x369c02['getAgents'](_0x5cd2ac);}})[_0xd48d('0x28')](function(_0x559c33){if(_0x559c33){_0x4519c2=_0x559c33[_0xd48d('0x3b')];if(!_0x19cf87[_0xd48d('0x38')][_0xd48d('0x3c')]('nolimit')){_0x5cd2ac[_0xd48d('0x22')]=qs[_0xd48d('0x22')](_0x19cf87[_0xd48d('0x38')][_0xd48d('0x22')]);_0x5cd2ac['offset']=qs['offset'](_0x19cf87[_0xd48d('0x38')]['offset']);}return _0x369c02[_0xd48d('0x81')](_0x5cd2ac);}})[_0xd48d('0x28')](function(_0x3dd8c0){if(_0x3dd8c0){return _0x3dd8c0?{'count':_0x4519c2,'rows':_0x3dd8c0}:null;}})[_0xd48d('0x28')](respondWithResult(_0x35dba5,null))['catch'](handleError(_0x35dba5,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index e718df8..a776155 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 _0x55be=['hook','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x5699e7,_0xb9ca23){var _0x1e8559=function(_0x127049){while(--_0x127049){_0x5699e7['push'](_0x5699e7['shift']());}};_0x1e8559(++_0xb9ca23);}(_0x55be,0xa3));var _0xe55b=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x55be[_0x167cc1];return _0x10bc4b;};'use strict';var EventEmitter=require(_0xe55b('0x0'));var MailQueue=require(_0xe55b('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xe55b('0x2')](0x0);var events={'afterCreate':_0xe55b('0x3'),'afterUpdate':_0xe55b('0x4'),'afterDestroy':_0xe55b('0x5')};function emitEvent(_0x5a0697){return function(_0x4da932,_0x5aaff8,_0xd19c8a){MailQueueEvents[_0xe55b('0x6')](_0x5a0697+':'+_0x4da932['id'],_0x4da932);MailQueueEvents[_0xe55b('0x6')](_0x5a0697,_0x4da932);_0xd19c8a(null);};}for(var e in events){if(events[_0xe55b('0x7')](e)){var event=events[e];MailQueue[_0xe55b('0x8')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file +var _0x3a59=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','MailQueue'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x3a59,0x181));var _0x93a5=function(_0x31172e,_0xa59e5){_0x31172e=_0x31172e-0x0;var _0x414ada=_0x3a59[_0x31172e];return _0x414ada;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x93a5('0x0'))['db'][_0x93a5('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x93a5('0x2'),'afterUpdate':_0x93a5('0x3'),'afterDestroy':_0x93a5('0x4')};function emitEvent(_0x1ed210){return function(_0x4d21aa,_0x4e7091,_0x30dd3f){MailQueueEvents[_0x93a5('0x5')](_0x1ed210+':'+_0x4d21aa['id'],_0x4d21aa);MailQueueEvents[_0x93a5('0x5')](_0x1ed210,_0x4d21aa);_0x30dd3f(null);};}for(var e in events){if(events[_0x93a5('0x6')](e)){var event=events[e];MailQueue[_0x93a5('0x7')](e,emitEvent(event));}}module[_0x93a5('0x8')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 0029dab..b3f9269 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 _0x6106=['api','moment','bluebird','request-promise','path','rimraf','exports','define','MailQueue','mail_queues','lodash','util','../../config/logger'];(function(_0x65fcb6,_0x1870f6){var _0x52633d=function(_0x2dbd98){while(--_0x2dbd98){_0x65fcb6['push'](_0x65fcb6['shift']());}};_0x52633d(++_0x1870f6);}(_0x6106,0x101));var _0x6610=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x6106[_0x4b7895];return _0x264180;};'use strict';var _=require(_0x6610('0x0'));var util=require(_0x6610('0x1'));var logger=require(_0x6610('0x2'))(_0x6610('0x3'));var moment=require(_0x6610('0x4'));var BPromise=require(_0x6610('0x5'));var rp=require(_0x6610('0x6'));var fs=require('fs');var path=require(_0x6610('0x7'));var rimraf=require(_0x6610('0x8'));var config=require('../../config/environment');var attributes=require('./mailQueue.attributes');module[_0x6610('0x9')]=function(_0x4f869c,_0x1b3370){return _0x4f869c[_0x6610('0xa')](_0x6610('0xb'),attributes,{'tableName':_0x6610('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0c95=['mail_queues','lodash','../../config/logger','api','moment','bluebird','path','../../config/environment','./mailQueue.attributes','exports','define','MailQueue'];(function(_0x3f456a,_0x5e4d6d){var _0x7f997=function(_0x655b88){while(--_0x655b88){_0x3f456a['push'](_0x3f456a['shift']());}};_0x7f997(++_0x5e4d6d);}(_0x0c95,0x139));var _0x50c9=function(_0xca18be,_0x5bbe40){_0xca18be=_0xca18be-0x0;var _0x2815ad=_0x0c95[_0xca18be];return _0x2815ad;};'use strict';var _=require(_0x50c9('0x0'));var util=require('util');var logger=require(_0x50c9('0x1'))(_0x50c9('0x2'));var moment=require(_0x50c9('0x3'));var BPromise=require(_0x50c9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x50c9('0x5'));var rimraf=require('rimraf');var config=require(_0x50c9('0x6'));var attributes=require(_0x50c9('0x7'));module[_0x50c9('0x8')]=function(_0x413ba1,_0x542a7f){return _0x413ba1[_0x50c9('0x9')](_0x50c9('0xa'),attributes,{'tableName':_0x50c9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index 05a7de8..ca240a1 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 _0x7a4f=['socket.io-emitter','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetMailQueue','MailQueue','findAll','options','where','attributes','include','map','model','ShowMailQueue','find','raw','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','redis','defaults','localhost'];(function(_0x5ec02e,_0x11563c){var _0x468bd9=function(_0x4a8de3){while(--_0x4a8de3){_0x5ec02e['push'](_0x5ec02e['shift']());}};_0x468bd9(++_0x11563c);}(_0x7a4f,0x17a));var _0xf7a4=function(_0xc77819,_0x139fdc){_0xc77819=_0xc77819-0x0;var _0x1c9434=_0x7a4f[_0xc77819];return _0x1c9434;};'use strict';var _=require('lodash');var util=require(_0xf7a4('0x0'));var moment=require(_0xf7a4('0x1'));var BPromise=require('bluebird');var rs=require(_0xf7a4('0x2'));var fs=require('fs');var Redis=require(_0xf7a4('0x3'));var db=require(_0xf7a4('0x4'))['db'];var utils=require(_0xf7a4('0x5'));var logger=require('../../config/logger')(_0xf7a4('0x6'));var config=require('../../config/environment');var jayson=require(_0xf7a4('0x7'));var client=jayson[_0xf7a4('0x8')]['http']({'port':0x232a});config[_0xf7a4('0x9')]=_[_0xf7a4('0xa')](config[_0xf7a4('0x9')],{'host':_0xf7a4('0xb'),'port':0x18eb});var socket=require(_0xf7a4('0xc'))(new Redis(config[_0xf7a4('0x9')]));require(_0xf7a4('0xd'))[_0xf7a4('0xe')](socket);function respondWithRpcPromise(_0x2f6f53,_0x180eb9,_0x3285e8){return new BPromise(function(_0x293078,_0x50e94a){return client[_0xf7a4('0xf')](_0x2f6f53,_0x3285e8)[_0xf7a4('0x10')](function(_0x55d31d){logger[_0xf7a4('0x11')](_0xf7a4('0x12'),_0x180eb9,'request\x20sent');logger[_0xf7a4('0x13')](_0xf7a4('0x14'),_0x180eb9,_0xf7a4('0x15'),JSON[_0xf7a4('0x16')](_0x55d31d));if(_0x55d31d[_0xf7a4('0x17')]){if(_0x55d31d[_0xf7a4('0x17')][_0xf7a4('0x18')]===0x1f4){logger[_0xf7a4('0x17')](_0xf7a4('0x12'),_0x180eb9,_0x55d31d['error'][_0xf7a4('0x19')]);return _0x50e94a(_0x55d31d[_0xf7a4('0x17')]['message']);}logger[_0xf7a4('0x17')]('MailQueue,\x20%s,\x20%s',_0x180eb9,_0x55d31d[_0xf7a4('0x17')][_0xf7a4('0x19')]);return _0x293078(_0x55d31d['error']['message']);}else{logger[_0xf7a4('0x11')]('MailQueue,\x20%s,\x20%s',_0x180eb9,_0xf7a4('0x15'));_0x293078(_0x55d31d['result'][_0xf7a4('0x19')]);}})[_0xf7a4('0x1a')](function(_0x400a1c){logger[_0xf7a4('0x17')](_0xf7a4('0x12'),_0x180eb9,_0x400a1c);_0x50e94a(_0x400a1c);});});}exports[_0xf7a4('0x1b')]=function(_0x5acaa8){var _0x42b65b=this;return new Promise(function(_0x18cd81,_0x484677){return db[_0xf7a4('0x1c')][_0xf7a4('0x1d')]({'raw':_0x5acaa8[_0xf7a4('0x1e')]?_0x5acaa8[_0xf7a4('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x5acaa8[_0xf7a4('0x1e')]?_0x5acaa8['options'][_0xf7a4('0x1f')]||null:null,'attributes':_0x5acaa8[_0xf7a4('0x1e')]?_0x5acaa8[_0xf7a4('0x1e')][_0xf7a4('0x20')]||null:null,'limit':_0x5acaa8[_0xf7a4('0x1e')]?_0x5acaa8[_0xf7a4('0x1e')]['limit']||null:null,'include':_0x5acaa8[_0xf7a4('0x1e')]?_0x5acaa8['options'][_0xf7a4('0x21')]?_[_0xf7a4('0x22')](_0x5acaa8['options'][_0xf7a4('0x21')],function(_0x3fce9b){return{'model':db[_0x3fce9b[_0xf7a4('0x23')]],'as':_0x3fce9b['as'],'attributes':_0x3fce9b[_0xf7a4('0x20')],'include':_0x3fce9b[_0xf7a4('0x21')]?_[_0xf7a4('0x22')](_0x3fce9b['include'],function(_0x4cb135){return{'model':db[_0x4cb135[_0xf7a4('0x23')]],'as':_0x4cb135['as'],'attributes':_0x4cb135['attributes'],'include':_0x4cb135['include']?_[_0xf7a4('0x22')](_0x4cb135['include'],function(_0xeef2d5){return{'model':db[_0xeef2d5['model']],'as':_0xeef2d5['as'],'attributes':_0xeef2d5[_0xf7a4('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf7a4('0x10')](function(_0x5f1eb3){logger[_0xf7a4('0x11')](_0xf7a4('0x1b'),_0x5acaa8);logger[_0xf7a4('0x13')](_0xf7a4('0x1b'),_0x5acaa8,JSON['stringify'](_0x5f1eb3));_0x18cd81(_0x5f1eb3);})[_0xf7a4('0x1a')](function(_0x1eea08){logger[_0xf7a4('0x17')](_0xf7a4('0x1b'),_0x1eea08[_0xf7a4('0x19')],_0x5acaa8);_0x484677(_0x42b65b[_0xf7a4('0x17')](0x1f4,_0x1eea08[_0xf7a4('0x19')]));});});};exports[_0xf7a4('0x24')]=function(_0x3b8af7){var _0x5bf888=this;return new Promise(function(_0x5020b7,_0x10f0ec){return db[_0xf7a4('0x1c')][_0xf7a4('0x25')]({'raw':_0x3b8af7[_0xf7a4('0x1e')]?_0x3b8af7[_0xf7a4('0x1e')][_0xf7a4('0x26')]===undefined?!![]:![]:!![],'where':_0x3b8af7[_0xf7a4('0x1e')]?_0x3b8af7[_0xf7a4('0x1e')][_0xf7a4('0x1f')]||null:null,'attributes':_0x3b8af7[_0xf7a4('0x1e')]?_0x3b8af7[_0xf7a4('0x1e')]['attributes']||null:null,'include':_0x3b8af7[_0xf7a4('0x1e')]?_0x3b8af7[_0xf7a4('0x1e')][_0xf7a4('0x21')]?_[_0xf7a4('0x22')](_0x3b8af7[_0xf7a4('0x1e')][_0xf7a4('0x21')],function(_0x5e972c){return{'model':db[_0x5e972c[_0xf7a4('0x23')]],'as':_0x5e972c['as'],'attributes':_0x5e972c[_0xf7a4('0x20')],'include':_0x5e972c[_0xf7a4('0x21')]?_[_0xf7a4('0x22')](_0x5e972c['include'],function(_0x352b2a){return{'model':db[_0x352b2a[_0xf7a4('0x23')]],'as':_0x352b2a['as'],'attributes':_0x352b2a[_0xf7a4('0x20')],'include':_0x352b2a[_0xf7a4('0x21')]?_[_0xf7a4('0x22')](_0x352b2a[_0xf7a4('0x21')],function(_0x52876e){return{'model':db[_0x52876e['model']],'as':_0x52876e['as'],'attributes':_0x52876e[_0xf7a4('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x41285a){logger[_0xf7a4('0x11')](_0xf7a4('0x24'),_0x3b8af7);logger[_0xf7a4('0x13')](_0xf7a4('0x24'),_0x3b8af7,JSON[_0xf7a4('0x16')](_0x41285a));_0x5020b7(_0x41285a);})[_0xf7a4('0x1a')](function(_0x30d598){logger['error'](_0xf7a4('0x24'),_0x30d598[_0xf7a4('0x19')],_0x3b8af7);_0x10f0ec(_0x5bf888['error'](0x1f4,_0x30d598['message']));});});}; \ No newline at end of file +var _0x5f2c=['attributes','limit','include','model','then','stringify','ShowMailQueue','MailQueue','where','map','info','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./mailQueue.socket','register','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','error','message','MailQueue,\x20%s,\x20%s','result','catch','GetMailQueue','options','raw'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0x5f2c,0x80));var _0xc5f2=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x5f2c[_0x5b561d];return _0x431060;};'use strict';var _=require(_0xc5f2('0x0'));var util=require(_0xc5f2('0x1'));var moment=require(_0xc5f2('0x2'));var BPromise=require('bluebird');var rs=require(_0xc5f2('0x3'));var fs=require('fs');var Redis=require(_0xc5f2('0x4'));var db=require(_0xc5f2('0x5'))['db'];var utils=require(_0xc5f2('0x6'));var logger=require(_0xc5f2('0x7'))(_0xc5f2('0x8'));var config=require(_0xc5f2('0x9'));var jayson=require(_0xc5f2('0xa'));var client=jayson['client'][_0xc5f2('0xb')]({'port':0x232a});config[_0xc5f2('0xc')]=_['defaults'](config[_0xc5f2('0xc')],{'host':_0xc5f2('0xd'),'port':0x18eb});var socket=require(_0xc5f2('0xe'))(new Redis(config['redis']));require(_0xc5f2('0xf'))[_0xc5f2('0x10')](socket);function respondWithRpcPromise(_0x8ce299,_0x212a55,_0x2aae8b){return new BPromise(function(_0x3a9234,_0x44a3bd){return client['request'](_0x8ce299,_0x2aae8b)['then'](function(_0x337812){logger['info']('MailQueue,\x20%s,\x20%s',_0x212a55,_0xc5f2('0x11'));logger[_0xc5f2('0x12')](_0xc5f2('0x13'),_0x212a55,_0xc5f2('0x11'),JSON['stringify'](_0x337812));if(_0x337812['error']){if(_0x337812[_0xc5f2('0x14')]['code']===0x1f4){logger[_0xc5f2('0x14')]('MailQueue,\x20%s,\x20%s',_0x212a55,_0x337812[_0xc5f2('0x14')][_0xc5f2('0x15')]);return _0x44a3bd(_0x337812[_0xc5f2('0x14')][_0xc5f2('0x15')]);}logger[_0xc5f2('0x14')](_0xc5f2('0x16'),_0x212a55,_0x337812[_0xc5f2('0x14')][_0xc5f2('0x15')]);return _0x3a9234(_0x337812[_0xc5f2('0x14')]['message']);}else{logger['info'](_0xc5f2('0x16'),_0x212a55,_0xc5f2('0x11'));_0x3a9234(_0x337812[_0xc5f2('0x17')]['message']);}})[_0xc5f2('0x18')](function(_0x1982f8){logger[_0xc5f2('0x14')](_0xc5f2('0x16'),_0x212a55,_0x1982f8);_0x44a3bd(_0x1982f8);});});}exports[_0xc5f2('0x19')]=function(_0xc75780){var _0x2a8e6a=this;return new Promise(function(_0x4b00a9,_0x5a5b5e){return db['MailQueue']['findAll']({'raw':_0xc75780[_0xc5f2('0x1a')]?_0xc75780['options'][_0xc5f2('0x1b')]===undefined?!![]:![]:!![],'where':_0xc75780[_0xc5f2('0x1a')]?_0xc75780[_0xc5f2('0x1a')]['where']||null:null,'attributes':_0xc75780[_0xc5f2('0x1a')]?_0xc75780[_0xc5f2('0x1a')][_0xc5f2('0x1c')]||null:null,'limit':_0xc75780[_0xc5f2('0x1a')]?_0xc75780[_0xc5f2('0x1a')][_0xc5f2('0x1d')]||null:null,'include':_0xc75780[_0xc5f2('0x1a')]?_0xc75780[_0xc5f2('0x1a')][_0xc5f2('0x1e')]?_['map'](_0xc75780[_0xc5f2('0x1a')][_0xc5f2('0x1e')],function(_0x485ce4){return{'model':db[_0x485ce4[_0xc5f2('0x1f')]],'as':_0x485ce4['as'],'attributes':_0x485ce4[_0xc5f2('0x1c')],'include':_0x485ce4['include']?_['map'](_0x485ce4[_0xc5f2('0x1e')],function(_0x828a64){return{'model':db[_0x828a64[_0xc5f2('0x1f')]],'as':_0x828a64['as'],'attributes':_0x828a64[_0xc5f2('0x1c')],'include':_0x828a64['include']?_['map'](_0x828a64[_0xc5f2('0x1e')],function(_0x309561){return{'model':db[_0x309561[_0xc5f2('0x1f')]],'as':_0x309561['as'],'attributes':_0x309561[_0xc5f2('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc5f2('0x20')](function(_0x5c7080){logger['info'](_0xc5f2('0x19'),_0xc75780);logger[_0xc5f2('0x12')]('GetMailQueue',_0xc75780,JSON[_0xc5f2('0x21')](_0x5c7080));_0x4b00a9(_0x5c7080);})[_0xc5f2('0x18')](function(_0x46e3b6){logger['error'](_0xc5f2('0x19'),_0x46e3b6[_0xc5f2('0x15')],_0xc75780);_0x5a5b5e(_0x2a8e6a['error'](0x1f4,_0x46e3b6[_0xc5f2('0x15')]));});});};exports[_0xc5f2('0x22')]=function(_0x350b62){var _0x566a42=this;return new Promise(function(_0x128f38,_0x2c68c3){return db[_0xc5f2('0x23')]['find']({'raw':_0x350b62['options']?_0x350b62[_0xc5f2('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x350b62['options']?_0x350b62[_0xc5f2('0x1a')][_0xc5f2('0x24')]||null:null,'attributes':_0x350b62[_0xc5f2('0x1a')]?_0x350b62[_0xc5f2('0x1a')][_0xc5f2('0x1c')]||null:null,'include':_0x350b62[_0xc5f2('0x1a')]?_0x350b62[_0xc5f2('0x1a')]['include']?_[_0xc5f2('0x25')](_0x350b62[_0xc5f2('0x1a')][_0xc5f2('0x1e')],function(_0x7c5855){return{'model':db[_0x7c5855[_0xc5f2('0x1f')]],'as':_0x7c5855['as'],'attributes':_0x7c5855[_0xc5f2('0x1c')],'include':_0x7c5855['include']?_[_0xc5f2('0x25')](_0x7c5855[_0xc5f2('0x1e')],function(_0x31c10f){return{'model':db[_0x31c10f[_0xc5f2('0x1f')]],'as':_0x31c10f['as'],'attributes':_0x31c10f[_0xc5f2('0x1c')],'include':_0x31c10f['include']?_['map'](_0x31c10f[_0xc5f2('0x1e')],function(_0x43d553){return{'model':db[_0x43d553[_0xc5f2('0x1f')]],'as':_0x43d553['as'],'attributes':_0x43d553[_0xc5f2('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc5f2('0x20')](function(_0x336c1c){logger[_0xc5f2('0x26')](_0xc5f2('0x22'),_0x350b62);logger[_0xc5f2('0x12')](_0xc5f2('0x22'),_0x350b62,JSON['stringify'](_0x336c1c));_0x128f38(_0x336c1c);})[_0xc5f2('0x18')](function(_0x54deeb){logger[_0xc5f2('0x14')](_0xc5f2('0x22'),_0x54deeb[_0xc5f2('0x15')],_0x350b62);_0x2c68c3(_0x566a42[_0xc5f2('0x14')](0x1f4,_0x54deeb[_0xc5f2('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 0a490b2..31c2245 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 _0xb19a=['emit','removeListener','register','length','./mailQueue.events','update'];(function(_0x1a7af5,_0x2b0f1b){var _0x209379=function(_0xb68e9b){while(--_0xb68e9b){_0x1a7af5['push'](_0x1a7af5['shift']());}};_0x209379(++_0x2b0f1b);}(_0xb19a,0xd0));var _0xab19=function(_0xa70c15,_0x11ae29){_0xa70c15=_0xa70c15-0x0;var _0x4b8c1a=_0xb19a[_0xa70c15];return _0x4b8c1a;};'use strict';var MailQueueEvents=require(_0xab19('0x0'));var events=['save','remove',_0xab19('0x1')];function createListener(_0x4b4fa0,_0x5c666f){return function(_0x2ad99b){_0x5c666f[_0xab19('0x2')](_0x4b4fa0,_0x2ad99b);};}function removeListener(_0x20333b,_0x3b7129){return function(){MailQueueEvents[_0xab19('0x3')](_0x20333b,_0x3b7129);};}exports[_0xab19('0x4')]=function(_0x907494){for(var _0x5e77f8=0x0,_0x9d5c1d=events[_0xab19('0x5')];_0x5e77f8<_0x9d5c1d;_0x5e77f8++){var _0x59d282=events[_0x5e77f8];var _0x300038=createListener('mailQueue:'+_0x59d282,_0x907494);MailQueueEvents['on'](_0x59d282,_0x300038);}}; \ No newline at end of file +var _0x3969=['removeListener','register','./mailQueue.events','save','remove','update','emit'];(function(_0x1b3f45,_0x1cda86){var _0x1af490=function(_0x103ef6){while(--_0x103ef6){_0x1b3f45['push'](_0x1b3f45['shift']());}};_0x1af490(++_0x1cda86);}(_0x3969,0x1a6));var _0x9396=function(_0x25570b,_0xaadf07){_0x25570b=_0x25570b-0x0;var _0x523940=_0x3969[_0x25570b];return _0x523940;};'use strict';var MailQueueEvents=require(_0x9396('0x0'));var events=[_0x9396('0x1'),_0x9396('0x2'),_0x9396('0x3')];function createListener(_0x2707e8,_0x5916c3){return function(_0x399bcc){_0x5916c3[_0x9396('0x4')](_0x2707e8,_0x399bcc);};}function removeListener(_0x297f0e,_0x1ebef3){return function(){MailQueueEvents[_0x9396('0x5')](_0x297f0e,_0x1ebef3);};}exports[_0x9396('0x6')]=function(_0x6d1c9e){for(var _0x400021=0x0,_0x5d80ca=events['length'];_0x400021<_0x5d80ca;_0x400021++){var _0x439605=events[_0x400021];var _0x18791e=createListener('mailQueue:'+_0x439605,_0x6d1c9e);MailQueueEvents['on'](_0x439605,_0x18791e);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 0ca9cb2..5ebedf9 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 _0xfb2d=['post','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x29d932,_0x97f2a7){var _0x5cd611=function(_0x33e548){while(--_0x33e548){_0x29d932['push'](_0x29d932['shift']());}};_0x5cd611(++_0x97f2a7);}(_0xfb2d,0xa6));var _0xdfb2=function(_0x5e3701,_0x596265){_0x5e3701=_0x5e3701-0x0;var _0x345dcf=_0xfb2d[_0x5e3701];return _0x345dcf;};'use strict';var multer=require('multer');var util=require(_0xdfb2('0x0'));var path=require(_0xdfb2('0x1'));var timeout=require(_0xdfb2('0x2'));var express=require(_0xdfb2('0x3'));var router=express[_0xdfb2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xdfb2('0x5'));var interaction=require(_0xdfb2('0x6'));var config=require('../../config/environment');var controller=require(_0xdfb2('0x7'));router[_0xdfb2('0x8')]('/',auth[_0xdfb2('0x9')](),controller[_0xdfb2('0xa')]);router[_0xdfb2('0x8')](_0xdfb2('0xb'),auth[_0xdfb2('0x9')](),controller[_0xdfb2('0xc')]);router['get'](_0xdfb2('0xd'),auth[_0xdfb2('0x9')](),controller['show']);router[_0xdfb2('0xe')]('/',auth[_0xdfb2('0x9')](),controller['create']);router[_0xdfb2('0xf')](_0xdfb2('0xd'),auth[_0xdfb2('0x9')](),controller[_0xdfb2('0x10')]);router[_0xdfb2('0x11')](_0xdfb2('0xd'),auth[_0xdfb2('0x9')](),controller[_0xdfb2('0x12')]);module[_0xdfb2('0x13')]=router; \ No newline at end of file +var _0x724a=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailQueueReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','multer','util'];(function(_0x2e2292,_0x1891b8){var _0x4f77ab=function(_0x3e5cb6){while(--_0x3e5cb6){_0x2e2292['push'](_0x2e2292['shift']());}};_0x4f77ab(++_0x1891b8);}(_0x724a,0x1e2));var _0xa724=function(_0x212960,_0x520f14){_0x212960=_0x212960-0x0;var _0x4f5a8a=_0x724a[_0x212960];return _0x4f5a8a;};'use strict';var multer=require(_0xa724('0x0'));var util=require(_0xa724('0x1'));var path=require(_0xa724('0x2'));var timeout=require(_0xa724('0x3'));var express=require(_0xa724('0x4'));var router=express[_0xa724('0x5')]();var fs_extra=require(_0xa724('0x6'));var auth=require(_0xa724('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xa724('0x8'));var controller=require(_0xa724('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xa724('0xa')]);router[_0xa724('0xb')](_0xa724('0xc'),auth[_0xa724('0xd')](),controller[_0xa724('0xe')]);router[_0xa724('0xb')](_0xa724('0xf'),auth[_0xa724('0xd')](),controller[_0xa724('0x10')]);router[_0xa724('0x11')]('/',auth[_0xa724('0xd')](),controller[_0xa724('0x12')]);router[_0xa724('0x13')](_0xa724('0xf'),auth[_0xa724('0xd')](),controller[_0xa724('0x14')]);router['delete'](_0xa724('0xf'),auth[_0xa724('0xd')](),controller[_0xa724('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index ec087ee..bf33e29 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 _0x61df=['DATE','STRING'];(function(_0x4c6ca9,_0x523f2a){var _0x425a41=function(_0x1dc607){while(--_0x1dc607){_0x4c6ca9['push'](_0x4c6ca9['shift']());}};_0x425a41(++_0x523f2a);}(_0x61df,0xbd));var _0xf61d=function(_0x130cf7,_0x2ddb66){_0x130cf7=_0x130cf7-0x0;var _0x31b6f3=_0x61df[_0x130cf7];return _0x31b6f3;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xf61d('0x0')],'allowNull':![]},'from':{'type':Sequelize[_0xf61d('0x0')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xf61d('0x1')]},'acceptAt':{'type':Sequelize[_0xf61d('0x1')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xf61d('0x0')]}}; \ No newline at end of file +var _0xa8ce=['sequelize','exports','STRING','DATE','moment'];(function(_0x4c48ad,_0x117a4a){var _0x1d0ae4=function(_0x22990f){while(--_0x22990f){_0x4c48ad['push'](_0x4c48ad['shift']());}};_0x1d0ae4(++_0x117a4a);}(_0xa8ce,0xc7));var _0xea8c=function(_0x160ac9,_0x324365){_0x160ac9=_0x160ac9-0x0;var _0x16ddb3=_0xa8ce[_0x160ac9];return _0x16ddb3;};'use strict';var moment=require(_0xea8c('0x0'));var Sequelize=require(_0xea8c('0x1'));module[_0xea8c('0x2')]={'uniqueid':{'type':Sequelize[_0xea8c('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xea8c('0x3')]},'joinAt':{'type':Sequelize[_0xea8c('0x4')]},'leaveAt':{'type':Sequelize[_0xea8c('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xea8c('0x4')]},'reason':{'type':Sequelize[_0xea8c('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 1ed2df5..db3812f 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 _0xa6b0=['nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','keys','include','find','create','body','params','describe','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','destroy','then','sendStatus','stack','name','index','map','MailQueueReport','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x9d1e6b,_0x3bdc22){var _0x2b3070=function(_0x4c4ced){while(--_0x4c4ced){_0x9d1e6b['push'](_0x9d1e6b['shift']());}};_0x2b3070(++_0x3bdc22);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x21b707,_0x4d0ec8){_0x21b707=_0x21b707-0x0;var _0x293f40=_0xa6b0[_0x21b707];return _0x293f40;};'use strict';var emlformat=require(_0x0a6b('0x0'));var rimraf=require(_0x0a6b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a6b('0x2'));var moment=require(_0x0a6b('0x3'));var BPromise=require(_0x0a6b('0x4'));var Mustache=require('mustache');var util=require(_0x0a6b('0x5'));var path=require(_0x0a6b('0x6'));var sox=require(_0x0a6b('0x7'));var csv=require(_0x0a6b('0x8'));var ejs=require(_0x0a6b('0x9'));var fs=require('fs');var fs_extra=require(_0x0a6b('0xa'));var _=require(_0x0a6b('0xb'));var squel=require(_0x0a6b('0xc'));var crypto=require(_0x0a6b('0xd'));var jsforce=require(_0x0a6b('0xe'));var deskjs=require(_0x0a6b('0xf'));var toCsv=require(_0x0a6b('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0a6b('0x10'));var authService=require(_0x0a6b('0x11'));var qs=require(_0x0a6b('0x12'));var as=require(_0x0a6b('0x13'));var hardwareService=require(_0x0a6b('0x14'));var logger=require(_0x0a6b('0x15'))(_0x0a6b('0x16'));var utils=require(_0x0a6b('0x17'));var config=require(_0x0a6b('0x18'));var licenseUtil=require(_0x0a6b('0x19'));var db=require(_0x0a6b('0x1a'))['db'];function respondWithStatusCode(_0x890493,_0x244a7d){_0x244a7d=_0x244a7d||0xcc;return function(_0x3cd9a4){if(_0x3cd9a4){return _0x890493['sendStatus'](_0x244a7d);}return _0x890493['status'](_0x244a7d)[_0x0a6b('0x1b')]();};}function respondWithResult(_0x2f27d6,_0x2abc4e){_0x2abc4e=_0x2abc4e||0xc8;return function(_0x177e87){if(_0x177e87){return _0x2f27d6[_0x0a6b('0x1c')](_0x2abc4e)[_0x0a6b('0x1d')](_0x177e87);}};}function respondWithFilteredResult(_0x9bb98e,_0x19e84c){return function(_0x1205a3){if(_0x1205a3){var _0x9d7aba=typeof _0x19e84c['offset']===_0x0a6b('0x1e')&&typeof _0x19e84c[_0x0a6b('0x1f')]==='undefined';var _0x290f7f=_0x1205a3['count'];var _0xcb412=_0x9d7aba?0x0:_0x19e84c[_0x0a6b('0x20')];var _0x2cb10b=_0x9d7aba?_0x1205a3[_0x0a6b('0x21')]:_0x19e84c['offset']+_0x19e84c[_0x0a6b('0x1f')];var _0x296162;if(_0x2cb10b>=_0x290f7f){_0x2cb10b=_0x290f7f;_0x296162=0xc8;}else{_0x296162=0xce;}_0x9bb98e['status'](_0x296162);return _0x9bb98e[_0x0a6b('0x22')](_0x0a6b('0x23'),_0xcb412+'-'+_0x2cb10b+'/'+_0x290f7f)[_0x0a6b('0x1d')](_0x1205a3);}return null;};}function patchUpdates(_0x491936){return function(_0x3ae3f4){try{jsonpatch[_0x0a6b('0x24')](_0x3ae3f4,_0x491936,!![]);}catch(_0x4077c6){return BPromise['reject'](_0x4077c6);}return _0x3ae3f4[_0x0a6b('0x25')]();};}function saveUpdates(_0x531e4c,_0xe4c2b9){return function(_0x5e8206){if(_0x5e8206){return _0x5e8206[_0x0a6b('0x26')](_0x531e4c)['then'](function(_0x1e5065){return _0x1e5065;});}return null;};}function removeEntity(_0xdda188,_0x3d153f){return function(_0x5c77fb){if(_0x5c77fb){return _0x5c77fb[_0x0a6b('0x27')]()[_0x0a6b('0x28')](function(){_0xdda188[_0x0a6b('0x1c')](0xcc)[_0x0a6b('0x1b')]();});}};}function handleEntityNotFound(_0x3b12a2,_0x5b2229){return function(_0x3e6a1d){if(!_0x3e6a1d){_0x3b12a2[_0x0a6b('0x29')](0x194);}return _0x3e6a1d;};}function handleError(_0x19a653,_0x4ce9d4){_0x4ce9d4=_0x4ce9d4||0x1f4;return function(_0x3a9092){logger['error'](_0x3a9092[_0x0a6b('0x2a')]);if(_0x3a9092[_0x0a6b('0x2b')]){delete _0x3a9092[_0x0a6b('0x2b')];}_0x19a653['status'](_0x4ce9d4)['send'](_0x3a9092);};}exports[_0x0a6b('0x2c')]=function(_0xe01bba,_0x1aecc7){var _0x3d649e={},_0x1935a3={},_0x2bbcb1={'count':0x0,'rows':[]};var _0x486f0d=_[_0x0a6b('0x2d')](db[_0x0a6b('0x2e')]['rawAttributes'],function(_0x4744d1){return{'name':_0x4744d1['fieldName'],'type':_0x4744d1['type'][_0x0a6b('0x2f')]};});_0x1935a3[_0x0a6b('0x30')]=_[_0x0a6b('0x2d')](_0x486f0d,_0x0a6b('0x2b'));_0x1935a3[_0x0a6b('0x31')]=_['keys'](_0xe01bba['query']);_0x1935a3[_0x0a6b('0x32')]=_[_0x0a6b('0x33')](_0x1935a3[_0x0a6b('0x30')],_0x1935a3[_0x0a6b('0x31')]);_0x3d649e['attributes']=_[_0x0a6b('0x33')](_0x1935a3[_0x0a6b('0x30')],qs['fields'](_0xe01bba['query'][_0x0a6b('0x34')]));_0x3d649e[_0x0a6b('0x35')]=_0x3d649e['attributes'][_0x0a6b('0x36')]?_0x3d649e[_0x0a6b('0x35')]:_0x1935a3[_0x0a6b('0x30')];if(!_0xe01bba[_0x0a6b('0x31')][_0x0a6b('0x37')](_0x0a6b('0x38'))){_0x3d649e[_0x0a6b('0x1f')]=qs[_0x0a6b('0x1f')](_0xe01bba[_0x0a6b('0x31')][_0x0a6b('0x1f')]);_0x3d649e[_0x0a6b('0x20')]=qs[_0x0a6b('0x20')](_0xe01bba['query'][_0x0a6b('0x20')]);}_0x3d649e[_0x0a6b('0x39')]=qs['sort'](_0xe01bba[_0x0a6b('0x31')][_0x0a6b('0x3a')]);_0x3d649e[_0x0a6b('0x3b')]=qs[_0x0a6b('0x32')](_[_0x0a6b('0x3c')](_0xe01bba[_0x0a6b('0x31')],_0x1935a3[_0x0a6b('0x32')]),_0x486f0d);if(_0xe01bba[_0x0a6b('0x31')][_0x0a6b('0x3d')]){_0x3d649e['where']=_[_0x0a6b('0x3e')](_0x3d649e[_0x0a6b('0x3b')],{'$or':_[_0x0a6b('0x2d')](_0x486f0d,function(_0x2f7e4b){if(_0x2f7e4b[_0x0a6b('0x3f')]!==_0x0a6b('0x40')){var _0x25254d={};_0x25254d[_0x2f7e4b[_0x0a6b('0x2b')]]={'$like':'%'+_0xe01bba[_0x0a6b('0x31')]['filter']+'%'};return _0x25254d;}})});}_0x3d649e=_[_0x0a6b('0x3e')]({},_0x3d649e,_0xe01bba[_0x0a6b('0x41')]);var _0x3aa7d5={'where':_0x3d649e[_0x0a6b('0x3b')]};return db[_0x0a6b('0x2e')][_0x0a6b('0x21')](_0x3aa7d5)[_0x0a6b('0x28')](function(_0x127e20){_0x2bbcb1[_0x0a6b('0x21')]=_0x127e20;if(_0xe01bba['query'][_0x0a6b('0x42')]){_0x3d649e['include']=[{'all':!![]}];}return db['MailQueueReport'][_0x0a6b('0x43')](_0x3d649e);})['then'](function(_0x556a28){_0x2bbcb1[_0x0a6b('0x44')]=_0x556a28;return _0x2bbcb1;})[_0x0a6b('0x28')](respondWithFilteredResult(_0x1aecc7,_0x3d649e))[_0x0a6b('0x45')](handleError(_0x1aecc7,null));};exports['show']=function(_0x445a7b,_0x4d32bf){var _0x531f94={'raw':!![],'where':{'id':_0x445a7b['params']['id']}},_0x1114f1={};_0x1114f1[_0x0a6b('0x30')]=_['keys'](db[_0x0a6b('0x2e')]['rawAttributes']);_0x1114f1['query']=_[_0x0a6b('0x46')](_0x445a7b[_0x0a6b('0x31')]);_0x1114f1[_0x0a6b('0x32')]=_[_0x0a6b('0x33')](_0x1114f1['model'],_0x1114f1[_0x0a6b('0x31')]);_0x531f94[_0x0a6b('0x35')]=_[_0x0a6b('0x33')](_0x1114f1[_0x0a6b('0x30')],qs[_0x0a6b('0x34')](_0x445a7b[_0x0a6b('0x31')][_0x0a6b('0x34')]));_0x531f94['attributes']=_0x531f94[_0x0a6b('0x35')][_0x0a6b('0x36')]?_0x531f94[_0x0a6b('0x35')]:_0x1114f1[_0x0a6b('0x30')];if(_0x445a7b[_0x0a6b('0x31')][_0x0a6b('0x42')]){_0x531f94[_0x0a6b('0x47')]=[{'all':!![]}];}_0x531f94=_[_0x0a6b('0x3e')]({},_0x531f94,_0x445a7b[_0x0a6b('0x41')]);return db['MailQueueReport'][_0x0a6b('0x48')](_0x531f94)[_0x0a6b('0x28')](handleEntityNotFound(_0x4d32bf,null))[_0x0a6b('0x28')](respondWithResult(_0x4d32bf,null))[_0x0a6b('0x45')](handleError(_0x4d32bf,null));};exports[_0x0a6b('0x49')]=function(_0x638ba8,_0x8f1372){return db['MailQueueReport']['create'](_0x638ba8[_0x0a6b('0x4a')],{})[_0x0a6b('0x28')](respondWithResult(_0x8f1372,0xc9))[_0x0a6b('0x45')](handleError(_0x8f1372,null));};exports[_0x0a6b('0x26')]=function(_0x2ca82a,_0x446187){if(_0x2ca82a[_0x0a6b('0x4a')]['id']){delete _0x2ca82a[_0x0a6b('0x4a')]['id'];}return db[_0x0a6b('0x2e')]['find']({'where':{'id':_0x2ca82a[_0x0a6b('0x4b')]['id']}})[_0x0a6b('0x28')](handleEntityNotFound(_0x446187,null))[_0x0a6b('0x28')](saveUpdates(_0x2ca82a[_0x0a6b('0x4a')],null))[_0x0a6b('0x28')](respondWithResult(_0x446187,null))['catch'](handleError(_0x446187,null));};exports[_0x0a6b('0x27')]=function(_0x3fd0df,_0x3aa85f){return db[_0x0a6b('0x2e')][_0x0a6b('0x48')]({'where':{'id':_0x3fd0df[_0x0a6b('0x4b')]['id']}})[_0x0a6b('0x28')](handleEntityNotFound(_0x3aa85f,null))[_0x0a6b('0x28')](removeEntity(_0x3aa85f,null))[_0x0a6b('0x45')](handleError(_0x3aa85f,null));};exports[_0x0a6b('0x4c')]=function(_0x5d8a4f,_0x4c81a7){return db[_0x0a6b('0x2e')]['describe']()[_0x0a6b('0x28')](respondWithResult(_0x4c81a7,null))['catch'](handleError(_0x4c81a7,null));}; \ No newline at end of file +var _0x6343=['VIRTUAL','options','MailQueueReport','then','rows','catch','show','params','keys','includeAll','include','create','body','find','describe','zip-dir','fast-json-patch','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','stack','send','map','rawAttributes','fieldName','type','key','model','name','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','filter','merge'];(function(_0x511b76,_0x4727fa){var _0x5424ff=function(_0x24b7c0){while(--_0x24b7c0){_0x511b76['push'](_0x511b76['shift']());}};_0x5424ff(++_0x4727fa);}(_0x6343,0x168));var _0x3634=function(_0x2cd1e4,_0x3b5fcd){_0x2cd1e4=_0x2cd1e4-0x0;var _0x35e898=_0x6343[_0x2cd1e4];return _0x35e898;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3634('0x0'));var jsonpatch=require(_0x3634('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3634('0x2'));var path=require(_0x3634('0x3'));var sox=require('sox');var csv=require(_0x3634('0x4'));var ejs=require(_0x3634('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3634('0x6'));var squel=require(_0x3634('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3634('0x8'));var toCsv=require(_0x3634('0x4'));var querystring=require(_0x3634('0x9'));var Papa=require(_0x3634('0xa'));var Redis=require(_0x3634('0xb'));var authService=require(_0x3634('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3634('0xd'));var logger=require(_0x3634('0xe'))('api');var utils=require(_0x3634('0xf'));var config=require(_0x3634('0x10'));var licenseUtil=require(_0x3634('0x11'));var db=require(_0x3634('0x12'))['db'];function respondWithStatusCode(_0x1e6a04,_0x151c8c){_0x151c8c=_0x151c8c||0xcc;return function(_0x35ae07){if(_0x35ae07){return _0x1e6a04[_0x3634('0x13')](_0x151c8c);}return _0x1e6a04[_0x3634('0x14')](_0x151c8c)[_0x3634('0x15')]();};}function respondWithResult(_0x299e53,_0x71d09b){_0x71d09b=_0x71d09b||0xc8;return function(_0x7e4801){if(_0x7e4801){return _0x299e53[_0x3634('0x14')](_0x71d09b)['json'](_0x7e4801);}};}function respondWithFilteredResult(_0x167247,_0x48787f){return function(_0x69609d){if(_0x69609d){var _0x18285c=typeof _0x48787f[_0x3634('0x16')]===_0x3634('0x17')&&typeof _0x48787f[_0x3634('0x18')]==='undefined';var _0x3121a3=_0x69609d['count'];var _0x50350d=_0x18285c?0x0:_0x48787f[_0x3634('0x16')];var _0x4b2115=_0x18285c?_0x69609d[_0x3634('0x19')]:_0x48787f[_0x3634('0x16')]+_0x48787f[_0x3634('0x18')];var _0x5603d2;if(_0x4b2115>=_0x3121a3){_0x4b2115=_0x3121a3;_0x5603d2=0xc8;}else{_0x5603d2=0xce;}_0x167247[_0x3634('0x14')](_0x5603d2);return _0x167247[_0x3634('0x1a')]('Content-Range',_0x50350d+'-'+_0x4b2115+'/'+_0x3121a3)[_0x3634('0x1b')](_0x69609d);}return null;};}function patchUpdates(_0x506281){return function(_0x742e56){try{jsonpatch[_0x3634('0x1c')](_0x742e56,_0x506281,!![]);}catch(_0x5b77a7){return BPromise[_0x3634('0x1d')](_0x5b77a7);}return _0x742e56[_0x3634('0x1e')]();};}function saveUpdates(_0x206c8e,_0x505026){return function(_0x22b7ef){if(_0x22b7ef){return _0x22b7ef[_0x3634('0x1f')](_0x206c8e)['then'](function(_0x3936ee){return _0x3936ee;});}return null;};}function removeEntity(_0x596acb,_0x5e9188){return function(_0x3a8c41){if(_0x3a8c41){return _0x3a8c41[_0x3634('0x20')]()['then'](function(){_0x596acb[_0x3634('0x14')](0xcc)[_0x3634('0x15')]();});}};}function handleEntityNotFound(_0x17db44,_0x225ddc){return function(_0x363ca2){if(!_0x363ca2){_0x17db44[_0x3634('0x13')](0x194);}return _0x363ca2;};}function handleError(_0x38e863,_0x4762b1){_0x4762b1=_0x4762b1||0x1f4;return function(_0x22f1f1){logger['error'](_0x22f1f1[_0x3634('0x21')]);if(_0x22f1f1['name']){delete _0x22f1f1['name'];}_0x38e863['status'](_0x4762b1)[_0x3634('0x22')](_0x22f1f1);};}exports['index']=function(_0x3bf28b,_0x12b80e){var _0x49804f={},_0x55a77f={},_0x282f73={'count':0x0,'rows':[]};var _0x5bd4e0=_[_0x3634('0x23')](db['MailQueueReport'][_0x3634('0x24')],function(_0x3d7322){return{'name':_0x3d7322[_0x3634('0x25')],'type':_0x3d7322[_0x3634('0x26')][_0x3634('0x27')]};});_0x55a77f[_0x3634('0x28')]=_[_0x3634('0x23')](_0x5bd4e0,_0x3634('0x29'));_0x55a77f['query']=_['keys'](_0x3bf28b['query']);_0x55a77f[_0x3634('0x2a')]=_['intersection'](_0x55a77f[_0x3634('0x28')],_0x55a77f[_0x3634('0x2b')]);_0x49804f[_0x3634('0x2c')]=_[_0x3634('0x2d')](_0x55a77f[_0x3634('0x28')],qs[_0x3634('0x2e')](_0x3bf28b['query'][_0x3634('0x2e')]));_0x49804f[_0x3634('0x2c')]=_0x49804f[_0x3634('0x2c')][_0x3634('0x2f')]?_0x49804f[_0x3634('0x2c')]:_0x55a77f[_0x3634('0x28')];if(!_0x3bf28b[_0x3634('0x2b')][_0x3634('0x30')](_0x3634('0x31'))){_0x49804f['limit']=qs[_0x3634('0x18')](_0x3bf28b[_0x3634('0x2b')][_0x3634('0x18')]);_0x49804f[_0x3634('0x16')]=qs['offset'](_0x3bf28b[_0x3634('0x2b')][_0x3634('0x16')]);}_0x49804f[_0x3634('0x32')]=qs['sort'](_0x3bf28b['query']['sort']);_0x49804f[_0x3634('0x33')]=qs[_0x3634('0x2a')](_['pick'](_0x3bf28b[_0x3634('0x2b')],_0x55a77f[_0x3634('0x2a')]),_0x5bd4e0);if(_0x3bf28b[_0x3634('0x2b')][_0x3634('0x34')]){_0x49804f[_0x3634('0x33')]=_[_0x3634('0x35')](_0x49804f[_0x3634('0x33')],{'$or':_['map'](_0x5bd4e0,function(_0x416987){if(_0x416987['type']!==_0x3634('0x36')){var _0x3ae966={};_0x3ae966[_0x416987[_0x3634('0x29')]]={'$like':'%'+_0x3bf28b[_0x3634('0x2b')][_0x3634('0x34')]+'%'};return _0x3ae966;}})});}_0x49804f=_['merge']({},_0x49804f,_0x3bf28b[_0x3634('0x37')]);var _0x33af29={'where':_0x49804f[_0x3634('0x33')]};return db[_0x3634('0x38')][_0x3634('0x19')](_0x33af29)[_0x3634('0x39')](function(_0x28c8d0){_0x282f73[_0x3634('0x19')]=_0x28c8d0;if(_0x3bf28b[_0x3634('0x2b')]['includeAll']){_0x49804f['include']=[{'all':!![]}];}return db[_0x3634('0x38')]['findAll'](_0x49804f);})['then'](function(_0x5948db){_0x282f73[_0x3634('0x3a')]=_0x5948db;return _0x282f73;})['then'](respondWithFilteredResult(_0x12b80e,_0x49804f))[_0x3634('0x3b')](handleError(_0x12b80e,null));};exports[_0x3634('0x3c')]=function(_0x53c1ea,_0x505be7){var _0x4896ab={'raw':!![],'where':{'id':_0x53c1ea[_0x3634('0x3d')]['id']}},_0x324970={};_0x324970['model']=_[_0x3634('0x3e')](db[_0x3634('0x38')][_0x3634('0x24')]);_0x324970[_0x3634('0x2b')]=_[_0x3634('0x3e')](_0x53c1ea['query']);_0x324970['filters']=_[_0x3634('0x2d')](_0x324970[_0x3634('0x28')],_0x324970[_0x3634('0x2b')]);_0x4896ab[_0x3634('0x2c')]=_[_0x3634('0x2d')](_0x324970[_0x3634('0x28')],qs['fields'](_0x53c1ea[_0x3634('0x2b')][_0x3634('0x2e')]));_0x4896ab[_0x3634('0x2c')]=_0x4896ab['attributes']['length']?_0x4896ab[_0x3634('0x2c')]:_0x324970[_0x3634('0x28')];if(_0x53c1ea[_0x3634('0x2b')][_0x3634('0x3f')]){_0x4896ab[_0x3634('0x40')]=[{'all':!![]}];}_0x4896ab=_[_0x3634('0x35')]({},_0x4896ab,_0x53c1ea[_0x3634('0x37')]);return db[_0x3634('0x38')]['find'](_0x4896ab)[_0x3634('0x39')](handleEntityNotFound(_0x505be7,null))[_0x3634('0x39')](respondWithResult(_0x505be7,null))[_0x3634('0x3b')](handleError(_0x505be7,null));};exports[_0x3634('0x41')]=function(_0x615276,_0x151654){return db[_0x3634('0x38')][_0x3634('0x41')](_0x615276[_0x3634('0x42')],{})['then'](respondWithResult(_0x151654,0xc9))[_0x3634('0x3b')](handleError(_0x151654,null));};exports[_0x3634('0x1f')]=function(_0x4a4a94,_0x3c356b){if(_0x4a4a94[_0x3634('0x42')]['id']){delete _0x4a4a94[_0x3634('0x42')]['id'];}return db[_0x3634('0x38')][_0x3634('0x43')]({'where':{'id':_0x4a4a94[_0x3634('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3c356b,null))[_0x3634('0x39')](saveUpdates(_0x4a4a94[_0x3634('0x42')],null))[_0x3634('0x39')](respondWithResult(_0x3c356b,null))[_0x3634('0x3b')](handleError(_0x3c356b,null));};exports[_0x3634('0x20')]=function(_0x582475,_0x66f6a4){return db[_0x3634('0x38')]['find']({'where':{'id':_0x582475['params']['id']}})[_0x3634('0x39')](handleEntityNotFound(_0x66f6a4,null))['then'](removeEntity(_0x66f6a4,null))[_0x3634('0x3b')](handleError(_0x66f6a4,null));};exports[_0x3634('0x44')]=function(_0x1943a5,_0x1834a3){return db['MailQueueReport'][_0x3634('0x44')]()[_0x3634('0x39')](respondWithResult(_0x1834a3,null))[_0x3634('0x3b')](handleError(_0x1834a3,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 25c474c..7330d6a 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 _0xa681=['define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./mailQueueReport.attributes','exports'];(function(_0x575847,_0x1c6c06){var _0x5603f1=function(_0x4afbbc){while(--_0x4afbbc){_0x575847['push'](_0x575847['shift']());}};_0x5603f1(++_0x1c6c06);}(_0xa681,0x10e));var _0x1a68=function(_0x94a030,_0x4c16ce){_0x94a030=_0x94a030-0x0;var _0x52b293=_0xa681[_0x94a030];return _0x52b293;};'use strict';var _=require(_0x1a68('0x0'));var util=require(_0x1a68('0x1'));var logger=require(_0x1a68('0x2'))(_0x1a68('0x3'));var moment=require(_0x1a68('0x4'));var BPromise=require(_0x1a68('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1a68('0x6'));var rimraf=require('rimraf');var config=require(_0x1a68('0x7'));var attributes=require(_0x1a68('0x8'));module[_0x1a68('0x9')]=function(_0x154e5d,_0x44ee24){return _0x154e5d[_0x1a68('0xa')](_0x1a68('0xb'),attributes,{'tableName':_0x1a68('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x1a68('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8323=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define','MailQueueReport','uniqueid','lodash','util'];(function(_0x285795,_0xd0ac59){var _0x2d4a9b=function(_0x35566c){while(--_0x35566c){_0x285795['push'](_0x285795['shift']());}};_0x2d4a9b(++_0xd0ac59);}(_0x8323,0x1d2));var _0x3832=function(_0x3c8abd,_0x39d41a){_0x3c8abd=_0x3c8abd-0x0;var _0x47b4c6=_0x8323[_0x3c8abd];return _0x47b4c6;};'use strict';var _=require(_0x3832('0x0'));var util=require(_0x3832('0x1'));var logger=require(_0x3832('0x2'))(_0x3832('0x3'));var moment=require(_0x3832('0x4'));var BPromise=require(_0x3832('0x5'));var rp=require(_0x3832('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3832('0x7'));var config=require(_0x3832('0x8'));var attributes=require('./mailQueueReport.attributes');module['exports']=function(_0x1bb40a,_0x3953e3){return _0x1bb40a[_0x3832('0x9')](_0x3832('0xa'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x3832('0xb'),'fields':[_0x3832('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index b722c37..bd867d8 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['options','raw','UpdateMailQueueReport','where','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailQueueReport,\x20%s,\x20%s','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateMailQueueReport','MailQueueReport','body'];(function(_0x443fe6,_0xcc1e25){var _0x1dfbee=function(_0x4263a0){while(--_0x4263a0){_0x443fe6['push'](_0x443fe6['shift']());}};_0x1dfbee(++_0xcc1e25);}(_0x2ef3,0xba));var _0x32ef=function(_0xcf1b87,_0x8214f){_0xcf1b87=_0xcf1b87-0x0;var _0x3c83ec=_0x2ef3[_0xcf1b87];return _0x3c83ec;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}exports[_0x32ef('0x15')]=function(_0x1a9476){var _0x286bfb=this;return new Promise(function(_0x57863c,_0xbe37f6){return db[_0x32ef('0x16')]['create'](_0x1a9476[_0x32ef('0x17')],{'raw':_0x1a9476[_0x32ef('0x18')]?_0x1a9476[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![]})[_0x32ef('0xb')](function(_0x3aec05){logger['info'](_0x32ef('0x15'),_0x1a9476);logger['debug'](_0x32ef('0x15'),_0x1a9476,JSON[_0x32ef('0x10')](_0x3aec05));_0x57863c(_0x3aec05);})['catch'](function(_0x1af371){logger[_0x32ef('0x11')](_0x32ef('0x15'),_0x1af371['message'],_0x1a9476);_0xbe37f6(_0x286bfb['error'](0x1f4,_0x1af371[_0x32ef('0x13')]));});});};exports[_0x32ef('0x1a')]=function(_0x225feb){var _0x478bef=this;return new Promise(function(_0x59585f,_0x19ea6){return db['MailQueueReport']['update'](_0x225feb[_0x32ef('0x17')],{'raw':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1b')]||null:null,'attributes':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1c')]||null:null,'limit':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')]['limit']||null:null})[_0x32ef('0xb')](function(_0x2f5d06){logger['info'](_0x32ef('0x1a'),_0x225feb);logger[_0x32ef('0x1d')](_0x32ef('0x1a'),_0x225feb,JSON[_0x32ef('0x10')](_0x2f5d06));_0x59585f(_0x2f5d06);})['catch'](function(_0x10e38c){logger[_0x32ef('0x11')](_0x32ef('0x1a'),_0x10e38c[_0x32ef('0x13')],_0x225feb);_0x19ea6(_0x478bef[_0x32ef('0x11')](0x1f4,_0x10e38c[_0x32ef('0x13')]));});});}; \ No newline at end of file +var _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(_0x2466c,_0x56c4e2){var _0x12d3aa=function(_0x46697d){while(--_0x46697d){_0x2466c['push'](_0x2466c['shift']());}};_0x12d3aa(++_0x56c4e2);}(_0x7a54,0x106));var _0x47a5=function(_0x5d5d00,_0x1e83a4){_0x5d5d00=_0x5d5d00-0x0;var _0x1b4f0a=_0x7a54[_0x5d5d00];return _0x1b4f0a;};'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 3ae98d4..8b1d48b 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x1edd51,_0x225edd){var _0x4b835a=function(_0x64daeb){while(--_0x64daeb){_0x1edd51['push'](_0x1edd51['shift']());}};_0x4b835a(++_0x225edd);}(_0xedd9,0xfc));var _0x9edd=function(_0x1bd284,_0x892d2b){_0x1bd284=_0x1bd284-0x0;var _0x81f771=_0xedd9[_0x1bd284];return _0x81f771;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0xcf7b0b,_0x12f924){var _0x564163=function(_0x19ebda){while(--_0x19ebda){_0xcf7b0b['push'](_0xcf7b0b['shift']());}};_0x564163(++_0x12f924);}(_0x70e0,0x17b));var _0x070e=function(_0x1ea55e,_0x11cd77){_0x1ea55e=_0x1ea55e-0x0;var _0x953713=_0x70e0[_0x1ea55e];return _0x953713;};'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 7dca3e7..2ec4b5f 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 _0x4bde=['INBOX','sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x2cccdc,_0x6e213d){var _0x26bd34=function(_0xd172af){while(--_0xd172af){_0x2cccdc['push'](_0x2cccdc['shift']());}};_0x26bd34(++_0x6e213d);}(_0x4bde,0x1b1));var _0xe4bd=function(_0x31fe44,_0x33271b){_0x31fe44=_0x31fe44-0x0;var _0x424745=_0x4bde[_0x31fe44];return _0x424745;};'use strict';var Sequelize=require(_0xe4bd('0x0'));module[_0xe4bd('0x1')]={'description':{'type':Sequelize[_0xe4bd('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xe4bd('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0xe4bd('0x2')]},'password':{'type':Sequelize[_0xe4bd('0x2')]},'port':{'type':Sequelize[_0xe4bd('0x4')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xe4bd('0x2')],'defaultValue':_0xe4bd('0x5')},'connTimeout':{'type':Sequelize[_0xe4bd('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xe4bd('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0xe4bd('0x2')]}}; \ No newline at end of file +var _0x3c81=['sequelize','exports','STRING','BOOLEAN','INBOX','INTEGER'];(function(_0x3be1c5,_0x3e1109){var _0x8669f=function(_0x762c21){while(--_0x762c21){_0x3be1c5['push'](_0x3be1c5['shift']());}};_0x8669f(++_0x3e1109);}(_0x3c81,0x102));var _0x13c8=function(_0x292c40,_0x63f5f6){_0x292c40=_0x292c40-0x0;var _0x27b12a=_0x3c81[_0x292c40];return _0x27b12a;};'use strict';var Sequelize=require(_0x13c8('0x0'));module[_0x13c8('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x13c8('0x2')]},'authentication':{'type':Sequelize[_0x13c8('0x3')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':_0x13c8('0x4')},'connTimeout':{'type':Sequelize[_0x13c8('0x5')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x13c8('0x5')],'defaultValue':0x5},'service':{'type':Sequelize[_0x13c8('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 5bc7663..4590b5c 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 _0xadd5=['exports','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes'];(function(_0x3afff0,_0x165e80){var _0x37b4c7=function(_0x4c51ca){while(--_0x4c51ca){_0x3afff0['push'](_0x3afff0['shift']());}};_0x37b4c7(++_0x165e80);}(_0xadd5,0xc7));var _0x5add=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xadd5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x5add('0x0'));var logger=require(_0x5add('0x1'))(_0x5add('0x2'));var moment=require(_0x5add('0x3'));var BPromise=require(_0x5add('0x4'));var rp=require(_0x5add('0x5'));var fs=require('fs');var path=require(_0x5add('0x6'));var rimraf=require(_0x5add('0x7'));var config=require(_0x5add('0x8'));var attributes=require(_0x5add('0x9'));module[_0x5add('0xa')]=function(_0x13e3e5,_0x302b1e){return _0x13e3e5['define']('MailServerIn',attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4034=['path','rimraf','../../config/environment','./mailServerIn.attributes','exports','mail_servers_in','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1c7b51,_0x4e3ce8){var _0x3a8cee=function(_0x5d93e3){while(--_0x5d93e3){_0x1c7b51['push'](_0x1c7b51['shift']());}};_0x3a8cee(++_0x4e3ce8);}(_0x4034,0x1aa));var _0x4403=function(_0x2adac5,_0x38fea6){_0x2adac5=_0x2adac5-0x0;var _0x1661ab=_0x4034[_0x2adac5];return _0x1661ab;};'use strict';var _=require(_0x4403('0x0'));var util=require('util');var logger=require(_0x4403('0x1'))(_0x4403('0x2'));var moment=require(_0x4403('0x3'));var BPromise=require(_0x4403('0x4'));var rp=require(_0x4403('0x5'));var fs=require('fs');var path=require(_0x4403('0x6'));var rimraf=require(_0x4403('0x7'));var config=require(_0x4403('0x8'));var attributes=require(_0x4403('0x9'));module[_0x4403('0xa')]=function(_0x216e0f,_0x5f6305){return _0x216e0f['define']('MailServerIn',attributes,{'tableName':_0x4403('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 9b41dee..78f6757 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 _0xd0be=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetMailServerIn','MailServerIn','options','raw','attributes','limit','map','include','model'];(function(_0x3d75d4,_0x1952c8){var _0x452e55=function(_0x4a2b4a){while(--_0x4a2b4a){_0x3d75d4['push'](_0x3d75d4['shift']());}};_0x452e55(++_0x1952c8);}(_0xd0be,0x1a0));var _0xed0b=function(_0x2d6d24,_0xaf0aec){_0x2d6d24=_0x2d6d24-0x0;var _0x37607e=_0xd0be[_0x2d6d24];return _0x37607e;};'use strict';var _=require(_0xed0b('0x0'));var util=require(_0xed0b('0x1'));var moment=require(_0xed0b('0x2'));var BPromise=require(_0xed0b('0x3'));var rs=require(_0xed0b('0x4'));var fs=require('fs');var Redis=require(_0xed0b('0x5'));var db=require(_0xed0b('0x6'))['db'];var utils=require(_0xed0b('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xed0b('0x8'));var client=jayson[_0xed0b('0x9')][_0xed0b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x234dcd,_0x20c99d,_0x3b8c09){return new BPromise(function(_0xa4213d,_0x1848f4){return client['request'](_0x234dcd,_0x3b8c09)[_0xed0b('0xb')](function(_0x529957){logger[_0xed0b('0xc')](_0xed0b('0xd'),_0x20c99d,_0xed0b('0xe'));logger[_0xed0b('0xf')](_0xed0b('0x10'),_0x20c99d,_0xed0b('0xe'),JSON[_0xed0b('0x11')](_0x529957));if(_0x529957['error']){if(_0x529957['error'][_0xed0b('0x12')]===0x1f4){logger[_0xed0b('0x13')]('MailServerIn,\x20%s,\x20%s',_0x20c99d,_0x529957['error'][_0xed0b('0x14')]);return _0x1848f4(_0x529957[_0xed0b('0x13')][_0xed0b('0x14')]);}logger[_0xed0b('0x13')](_0xed0b('0xd'),_0x20c99d,_0x529957['error']['message']);return _0xa4213d(_0x529957[_0xed0b('0x13')][_0xed0b('0x14')]);}else{logger['info'](_0xed0b('0xd'),_0x20c99d,_0xed0b('0xe'));_0xa4213d(_0x529957[_0xed0b('0x15')][_0xed0b('0x14')]);}})[_0xed0b('0x16')](function(_0x5aa35b){logger['error'](_0xed0b('0xd'),_0x20c99d,_0x5aa35b);_0x1848f4(_0x5aa35b);});});}exports[_0xed0b('0x17')]=function(_0x444f9b){var _0x3e22d3=this;return new Promise(function(_0x3b9307,_0x12600a){return db[_0xed0b('0x18')]['findAll']({'raw':_0x444f9b[_0xed0b('0x19')]?_0x444f9b[_0xed0b('0x19')][_0xed0b('0x1a')]===undefined?!![]:![]:!![],'where':_0x444f9b[_0xed0b('0x19')]?_0x444f9b[_0xed0b('0x19')]['where']||null:null,'attributes':_0x444f9b[_0xed0b('0x19')]?_0x444f9b[_0xed0b('0x19')][_0xed0b('0x1b')]||null:null,'limit':_0x444f9b['options']?_0x444f9b[_0xed0b('0x19')][_0xed0b('0x1c')]||null:null,'include':_0x444f9b[_0xed0b('0x19')]?_0x444f9b['options']['include']?_[_0xed0b('0x1d')](_0x444f9b[_0xed0b('0x19')][_0xed0b('0x1e')],function(_0x36bc17){return{'model':db[_0x36bc17[_0xed0b('0x1f')]],'as':_0x36bc17['as'],'attributes':_0x36bc17[_0xed0b('0x1b')],'include':_0x36bc17[_0xed0b('0x1e')]?_[_0xed0b('0x1d')](_0x36bc17[_0xed0b('0x1e')],function(_0x7f27a5){return{'model':db[_0x7f27a5[_0xed0b('0x1f')]],'as':_0x7f27a5['as'],'attributes':_0x7f27a5[_0xed0b('0x1b')],'include':_0x7f27a5[_0xed0b('0x1e')]?_['map'](_0x7f27a5['include'],function(_0xf4de62){return{'model':db[_0xf4de62[_0xed0b('0x1f')]],'as':_0xf4de62['as'],'attributes':_0xf4de62[_0xed0b('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xed0b('0xb')](function(_0x54249f){logger[_0xed0b('0xc')](_0xed0b('0x17'),_0x444f9b);logger['debug'](_0xed0b('0x17'),_0x444f9b,JSON['stringify'](_0x54249f));_0x3b9307(_0x54249f);})[_0xed0b('0x16')](function(_0x4896c3){logger[_0xed0b('0x13')]('GetMailServerIn',_0x4896c3['message'],_0x444f9b);_0x12600a(_0x3e22d3[_0xed0b('0x13')](0x1f4,_0x4896c3[_0xed0b('0x14')]));});});}; \ No newline at end of file +var _0x845b=['result','catch','GetMailServerIn','findAll','options','attributes','limit','include','model','map','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','MailServerIn,\x20%s,\x20%s','debug','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x305486,_0x24acd4){var _0xa04940=function(_0x29e866){while(--_0x29e866){_0x305486['push'](_0x305486['shift']());}};_0xa04940(++_0x24acd4);}(_0x845b,0x1ab));var _0xb845=function(_0x2803dc,_0x1cdaf1){_0x2803dc=_0x2803dc-0x0;var _0x552ae4=_0x845b[_0x2803dc];return _0x552ae4;};'use strict';var _=require(_0xb845('0x0'));var util=require(_0xb845('0x1'));var moment=require(_0xb845('0x2'));var BPromise=require(_0xb845('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb845('0x4'));var db=require(_0xb845('0x5'))['db'];var utils=require(_0xb845('0x6'));var logger=require(_0xb845('0x7'))(_0xb845('0x8'));var config=require('../../config/environment');var jayson=require(_0xb845('0x9'));var client=jayson['client'][_0xb845('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x277967,_0x5d18c2,_0x5678dd){return new BPromise(function(_0x578363,_0x379a39){return client[_0xb845('0xb')](_0x277967,_0x5678dd)[_0xb845('0xc')](function(_0x2e62c6){logger[_0xb845('0xd')](_0xb845('0xe'),_0x5d18c2,'request\x20sent');logger[_0xb845('0xf')](_0xb845('0x10'),_0x5d18c2,_0xb845('0x11'),JSON['stringify'](_0x2e62c6));if(_0x2e62c6[_0xb845('0x12')]){if(_0x2e62c6[_0xb845('0x12')][_0xb845('0x13')]===0x1f4){logger[_0xb845('0x12')](_0xb845('0xe'),_0x5d18c2,_0x2e62c6[_0xb845('0x12')][_0xb845('0x14')]);return _0x379a39(_0x2e62c6[_0xb845('0x12')][_0xb845('0x14')]);}logger[_0xb845('0x12')](_0xb845('0xe'),_0x5d18c2,_0x2e62c6[_0xb845('0x12')][_0xb845('0x14')]);return _0x578363(_0x2e62c6[_0xb845('0x12')]['message']);}else{logger[_0xb845('0xd')](_0xb845('0xe'),_0x5d18c2,_0xb845('0x11'));_0x578363(_0x2e62c6[_0xb845('0x15')][_0xb845('0x14')]);}})[_0xb845('0x16')](function(_0x4ce526){logger['error']('MailServerIn,\x20%s,\x20%s',_0x5d18c2,_0x4ce526);_0x379a39(_0x4ce526);});});}exports[_0xb845('0x17')]=function(_0x32af04){var _0x4fd174=this;return new Promise(function(_0x7c1b33,_0x2f2109){return db['MailServerIn'][_0xb845('0x18')]({'raw':_0x32af04[_0xb845('0x19')]?_0x32af04[_0xb845('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x32af04[_0xb845('0x19')]?_0x32af04[_0xb845('0x19')]['where']||null:null,'attributes':_0x32af04[_0xb845('0x19')]?_0x32af04[_0xb845('0x19')][_0xb845('0x1a')]||null:null,'limit':_0x32af04[_0xb845('0x19')]?_0x32af04['options'][_0xb845('0x1b')]||null:null,'include':_0x32af04[_0xb845('0x19')]?_0x32af04[_0xb845('0x19')][_0xb845('0x1c')]?_['map'](_0x32af04[_0xb845('0x19')][_0xb845('0x1c')],function(_0x552dc4){return{'model':db[_0x552dc4[_0xb845('0x1d')]],'as':_0x552dc4['as'],'attributes':_0x552dc4[_0xb845('0x1a')],'include':_0x552dc4[_0xb845('0x1c')]?_[_0xb845('0x1e')](_0x552dc4[_0xb845('0x1c')],function(_0x3f660f){return{'model':db[_0x3f660f['model']],'as':_0x3f660f['as'],'attributes':_0x3f660f[_0xb845('0x1a')],'include':_0x3f660f[_0xb845('0x1c')]?_[_0xb845('0x1e')](_0x3f660f[_0xb845('0x1c')],function(_0x2dd3b1){return{'model':db[_0x2dd3b1[_0xb845('0x1d')]],'as':_0x2dd3b1['as'],'attributes':_0x2dd3b1[_0xb845('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xb845('0xc')](function(_0x3e2046){logger['info'](_0xb845('0x17'),_0x32af04);logger[_0xb845('0xf')](_0xb845('0x17'),_0x32af04,JSON[_0xb845('0x1f')](_0x3e2046));_0x7c1b33(_0x3e2046);})[_0xb845('0x16')](function(_0x3cf904){logger[_0xb845('0x12')](_0xb845('0x17'),_0x3cf904[_0xb845('0x14')],_0x32af04);_0x2f2109(_0x4fd174[_0xb845('0x12')](0x1f4,_0x3cf904['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 7d787e8..235c6a7 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file +var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 184e539..df30114 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 _0x57ff=['sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x2abc3d,_0x48edca){var _0x252745=function(_0x32bb6f){while(--_0x32bb6f){_0x2abc3d['push'](_0x2abc3d['shift']());}};_0x252745(++_0x48edca);}(_0x57ff,0x82));var _0xf57f=function(_0x56a0ba,_0x385c98){_0x56a0ba=_0x56a0ba-0x0;var _0x53e044=_0x57ff[_0x56a0ba];return _0x53e044;};'use strict';var Sequelize=require(_0xf57f('0x0'));module[_0xf57f('0x1')]={'description':{'type':Sequelize[_0xf57f('0x2')]},'host':{'type':Sequelize[_0xf57f('0x2')]},'user':{'type':Sequelize[_0xf57f('0x2')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xf57f('0x3')]},'secure':{'type':Sequelize[_0xf57f('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0xf57f('0x2')]},'authentication':{'type':Sequelize[_0xf57f('0x4')],'defaultValue':!![]}}; \ No newline at end of file +var _0x0b86=['INTEGER','BOOLEAN','sequelize','exports','STRING'];(function(_0x436ca6,_0x5109cf){var _0x30d6d5=function(_0x42ee04){while(--_0x42ee04){_0x436ca6['push'](_0x436ca6['shift']());}};_0x30d6d5(++_0x5109cf);}(_0x0b86,0x129));var _0x60b8=function(_0x5b5a44,_0x5ac308){_0x5b5a44=_0x5b5a44-0x0;var _0x339d7f=_0x0b86[_0x5b5a44];return _0x339d7f;};'use strict';var Sequelize=require(_0x60b8('0x0'));module[_0x60b8('0x1')]={'description':{'type':Sequelize[_0x60b8('0x2')]},'host':{'type':Sequelize[_0x60b8('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x60b8('0x3')]},'secure':{'type':Sequelize[_0x60b8('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x60b8('0x2')]},'authentication':{'type':Sequelize[_0x60b8('0x4')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 8ced33c..23fcc53 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 _0x75c6=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','error','name','send','map','MailServerOut','rawAttributes','type','key','model','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','intersection','length','create','body','find','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x75c6,0x19b));var _0x675c=function(_0xf74ddb,_0x8383bd){_0xf74ddb=_0xf74ddb-0x0;var _0x44e4cd=_0x75c6[_0xf74ddb];return _0x44e4cd;};'use strict';var emlformat=require(_0x675c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x675c('0x1'));var moment=require(_0x675c('0x2'));var BPromise=require(_0x675c('0x3'));var Mustache=require(_0x675c('0x4'));var util=require(_0x675c('0x5'));var path=require(_0x675c('0x6'));var sox=require(_0x675c('0x7'));var csv=require(_0x675c('0x8'));var ejs=require(_0x675c('0x9'));var fs=require('fs');var fs_extra=require(_0x675c('0xa'));var _=require(_0x675c('0xb'));var squel=require('squel');var crypto=require(_0x675c('0xc'));var jsforce=require(_0x675c('0xd'));var deskjs=require(_0x675c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x675c('0xf'));var Papa=require(_0x675c('0x10'));var Redis=require(_0x675c('0x11'));var authService=require(_0x675c('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x675c('0x13'));var logger=require('../../config/logger')(_0x675c('0x14'));var utils=require(_0x675c('0x15'));var config=require(_0x675c('0x16'));var licenseUtil=require(_0x675c('0x17'));var db=require(_0x675c('0x18'))['db'];function respondWithStatusCode(_0x5137db,_0x13d0ca){_0x13d0ca=_0x13d0ca||0xcc;return function(_0x2a9ab3){if(_0x2a9ab3){return _0x5137db[_0x675c('0x19')](_0x13d0ca);}return _0x5137db[_0x675c('0x1a')](_0x13d0ca)[_0x675c('0x1b')]();};}function respondWithResult(_0x2454d7,_0x206fd1){_0x206fd1=_0x206fd1||0xc8;return function(_0xb304ec){if(_0xb304ec){return _0x2454d7['status'](_0x206fd1)[_0x675c('0x1c')](_0xb304ec);}};}function respondWithFilteredResult(_0x57f5e1,_0x472d09){return function(_0x480bb7){if(_0x480bb7){var _0x116452=typeof _0x472d09[_0x675c('0x1d')]===_0x675c('0x1e')&&typeof _0x472d09[_0x675c('0x1f')]===_0x675c('0x1e');var _0xe73a58=_0x480bb7['count'];var _0x198ab3=_0x116452?0x0:_0x472d09[_0x675c('0x1d')];var _0x5c0910=_0x116452?_0x480bb7[_0x675c('0x20')]:_0x472d09[_0x675c('0x1d')]+_0x472d09[_0x675c('0x1f')];var _0x555e66;if(_0x5c0910>=_0xe73a58){_0x5c0910=_0xe73a58;_0x555e66=0xc8;}else{_0x555e66=0xce;}_0x57f5e1['status'](_0x555e66);return _0x57f5e1[_0x675c('0x21')](_0x675c('0x22'),_0x198ab3+'-'+_0x5c0910+'/'+_0xe73a58)['json'](_0x480bb7);}return null;};}function patchUpdates(_0x235610){return function(_0x406477){try{jsonpatch['apply'](_0x406477,_0x235610,!![]);}catch(_0x3324e5){return BPromise['reject'](_0x3324e5);}return _0x406477[_0x675c('0x23')]();};}function saveUpdates(_0x574d14,_0x3fd8aa){return function(_0x1e2c48){if(_0x1e2c48){return _0x1e2c48[_0x675c('0x24')](_0x574d14)['then'](function(_0x2f6a98){return _0x2f6a98;});}return null;};}function removeEntity(_0x1ec21b,_0xd00125){return function(_0x54e991){if(_0x54e991){return _0x54e991['destroy']()[_0x675c('0x25')](function(){_0x1ec21b[_0x675c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c23ee,_0x17f331){return function(_0x31bc9c){if(!_0x31bc9c){_0x5c23ee['sendStatus'](0x194);}return _0x31bc9c;};}function handleError(_0x2dfb9c,_0x4608cd){_0x4608cd=_0x4608cd||0x1f4;return function(_0x537444){logger[_0x675c('0x26')](_0x537444['stack']);if(_0x537444[_0x675c('0x27')]){delete _0x537444['name'];}_0x2dfb9c[_0x675c('0x1a')](_0x4608cd)[_0x675c('0x28')](_0x537444);};}exports['index']=function(_0x338763,_0xc97bcf){var _0x27b67c={},_0xb5eed7={},_0x1c9116={'count':0x0,'rows':[]};var _0x9ce3de=_[_0x675c('0x29')](db[_0x675c('0x2a')][_0x675c('0x2b')],function(_0x25d6cd){return{'name':_0x25d6cd['fieldName'],'type':_0x25d6cd[_0x675c('0x2c')][_0x675c('0x2d')]};});_0xb5eed7[_0x675c('0x2e')]=_[_0x675c('0x29')](_0x9ce3de,_0x675c('0x27'));_0xb5eed7[_0x675c('0x2f')]=_['keys'](_0x338763['query']);_0xb5eed7['filters']=_['intersection'](_0xb5eed7[_0x675c('0x2e')],_0xb5eed7[_0x675c('0x2f')]);_0x27b67c[_0x675c('0x30')]=_['intersection'](_0xb5eed7[_0x675c('0x2e')],qs[_0x675c('0x31')](_0x338763['query'][_0x675c('0x31')]));_0x27b67c[_0x675c('0x30')]=_0x27b67c[_0x675c('0x30')]['length']?_0x27b67c[_0x675c('0x30')]:_0xb5eed7['model'];if(!_0x338763[_0x675c('0x2f')][_0x675c('0x32')](_0x675c('0x33'))){_0x27b67c[_0x675c('0x1f')]=qs['limit'](_0x338763[_0x675c('0x2f')][_0x675c('0x1f')]);_0x27b67c[_0x675c('0x1d')]=qs[_0x675c('0x1d')](_0x338763[_0x675c('0x2f')]['offset']);}_0x27b67c[_0x675c('0x34')]=qs[_0x675c('0x35')](_0x338763[_0x675c('0x2f')]['sort']);_0x27b67c[_0x675c('0x36')]=qs[_0x675c('0x37')](_[_0x675c('0x38')](_0x338763[_0x675c('0x2f')],_0xb5eed7[_0x675c('0x37')]),_0x9ce3de);if(_0x338763[_0x675c('0x2f')][_0x675c('0x39')]){_0x27b67c[_0x675c('0x36')]=_['merge'](_0x27b67c[_0x675c('0x36')],{'$or':_['map'](_0x9ce3de,function(_0x471339){if(_0x471339[_0x675c('0x2c')]!=='VIRTUAL'){var _0x41708d={};_0x41708d[_0x471339[_0x675c('0x27')]]={'$like':'%'+_0x338763[_0x675c('0x2f')][_0x675c('0x39')]+'%'};return _0x41708d;}})});}_0x27b67c=_[_0x675c('0x3a')]({},_0x27b67c,_0x338763[_0x675c('0x3b')]);var _0x520d67={'where':_0x27b67c['where']};return db['MailServerOut']['count'](_0x520d67)[_0x675c('0x25')](function(_0x5e2527){_0x1c9116['count']=_0x5e2527;if(_0x338763['query'][_0x675c('0x3c')]){_0x27b67c[_0x675c('0x3d')]=[{'all':!![]}];}return db[_0x675c('0x2a')][_0x675c('0x3e')](_0x27b67c);})[_0x675c('0x25')](function(_0x4e57f4){_0x1c9116[_0x675c('0x3f')]=_0x4e57f4;return _0x1c9116;})[_0x675c('0x25')](respondWithFilteredResult(_0xc97bcf,_0x27b67c))[_0x675c('0x40')](handleError(_0xc97bcf,null));};exports[_0x675c('0x41')]=function(_0x94c4f6,_0x7f4383){var _0x1b3a32={'raw':!![],'where':{'id':_0x94c4f6[_0x675c('0x42')]['id']}},_0xad69d9={};_0xad69d9[_0x675c('0x2e')]=_['keys'](db[_0x675c('0x2a')][_0x675c('0x2b')]);_0xad69d9[_0x675c('0x2f')]=_['keys'](_0x94c4f6[_0x675c('0x2f')]);_0xad69d9[_0x675c('0x37')]=_[_0x675c('0x43')](_0xad69d9[_0x675c('0x2e')],_0xad69d9[_0x675c('0x2f')]);_0x1b3a32[_0x675c('0x30')]=_['intersection'](_0xad69d9[_0x675c('0x2e')],qs[_0x675c('0x31')](_0x94c4f6[_0x675c('0x2f')][_0x675c('0x31')]));_0x1b3a32[_0x675c('0x30')]=_0x1b3a32[_0x675c('0x30')][_0x675c('0x44')]?_0x1b3a32[_0x675c('0x30')]:_0xad69d9[_0x675c('0x2e')];if(_0x94c4f6[_0x675c('0x2f')][_0x675c('0x3c')]){_0x1b3a32[_0x675c('0x3d')]=[{'all':!![]}];}_0x1b3a32=_['merge']({},_0x1b3a32,_0x94c4f6[_0x675c('0x3b')]);return db[_0x675c('0x2a')]['find'](_0x1b3a32)['then'](handleEntityNotFound(_0x7f4383,null))[_0x675c('0x25')](respondWithResult(_0x7f4383,null))['catch'](handleError(_0x7f4383,null));};exports[_0x675c('0x45')]=function(_0x15554a,_0x57116f){return db['MailServerOut']['create'](_0x15554a[_0x675c('0x46')],{})['then'](respondWithResult(_0x57116f,0xc9))[_0x675c('0x40')](handleError(_0x57116f,null));};exports[_0x675c('0x24')]=function(_0x17088f,_0x562245){if(_0x17088f['body']['id']){delete _0x17088f['body']['id'];}return db[_0x675c('0x2a')][_0x675c('0x47')]({'where':{'id':_0x17088f['params']['id']}})[_0x675c('0x25')](handleEntityNotFound(_0x562245,null))[_0x675c('0x25')](saveUpdates(_0x17088f[_0x675c('0x46')],null))['then'](respondWithResult(_0x562245,null))[_0x675c('0x40')](handleError(_0x562245,null));};exports['destroy']=function(_0xfffa15,_0x36ba70){return db[_0x675c('0x2a')][_0x675c('0x47')]({'where':{'id':_0xfffa15['params']['id']}})[_0x675c('0x25')](handleEntityNotFound(_0x36ba70,null))[_0x675c('0x25')](removeEntity(_0x36ba70,null))['catch'](handleError(_0x36ba70,null));}; \ No newline at end of file +var _0x2ac9=['then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','MailServerOut','includeAll','include','findAll','catch','show','params','fields','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update'];(function(_0x519d1,_0x454e65){var _0x10b9a1=function(_0x39de9e){while(--_0x39de9e){_0x519d1['push'](_0x519d1['shift']());}};_0x10b9a1(++_0x454e65);}(_0x2ac9,0x1e8));var _0x92ac=function(_0xc39c2d,_0x5194c3){_0xc39c2d=_0xc39c2d-0x0;var _0x63c3f2=_0x2ac9[_0xc39c2d];return _0x63c3f2;};'use strict';var emlformat=require(_0x92ac('0x0'));var rimraf=require(_0x92ac('0x1'));var zipdir=require(_0x92ac('0x2'));var jsonpatch=require(_0x92ac('0x3'));var rp=require(_0x92ac('0x4'));var moment=require(_0x92ac('0x5'));var BPromise=require(_0x92ac('0x6'));var Mustache=require(_0x92ac('0x7'));var util=require(_0x92ac('0x8'));var path=require(_0x92ac('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x92ac('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x92ac('0xb'));var crypto=require(_0x92ac('0xc'));var jsforce=require(_0x92ac('0xd'));var deskjs=require(_0x92ac('0xe'));var toCsv=require(_0x92ac('0xf'));var querystring=require(_0x92ac('0x10'));var Papa=require(_0x92ac('0x11'));var Redis=require('ioredis');var authService=require(_0x92ac('0x12'));var qs=require(_0x92ac('0x13'));var as=require(_0x92ac('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x92ac('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x92ac('0x16'));var licenseUtil=require(_0x92ac('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x150e27,_0x482686){_0x482686=_0x482686||0xcc;return function(_0x254562){if(_0x254562){return _0x150e27['sendStatus'](_0x482686);}return _0x150e27[_0x92ac('0x18')](_0x482686)[_0x92ac('0x19')]();};}function respondWithResult(_0x570af9,_0x47bd73){_0x47bd73=_0x47bd73||0xc8;return function(_0x29519d){if(_0x29519d){return _0x570af9['status'](_0x47bd73)[_0x92ac('0x1a')](_0x29519d);}};}function respondWithFilteredResult(_0x44e58a,_0x3327f6){return function(_0x488a95){if(_0x488a95){var _0x2eeca4=typeof _0x3327f6[_0x92ac('0x1b')]===_0x92ac('0x1c')&&typeof _0x3327f6['limit']==='undefined';var _0x2af4d6=_0x488a95[_0x92ac('0x1d')];var _0x123d6f=_0x2eeca4?0x0:_0x3327f6[_0x92ac('0x1b')];var _0x4e42ce=_0x2eeca4?_0x488a95[_0x92ac('0x1d')]:_0x3327f6[_0x92ac('0x1b')]+_0x3327f6[_0x92ac('0x1e')];var _0x1713ce;if(_0x4e42ce>=_0x2af4d6){_0x4e42ce=_0x2af4d6;_0x1713ce=0xc8;}else{_0x1713ce=0xce;}_0x44e58a[_0x92ac('0x18')](_0x1713ce);return _0x44e58a[_0x92ac('0x1f')](_0x92ac('0x20'),_0x123d6f+'-'+_0x4e42ce+'/'+_0x2af4d6)[_0x92ac('0x1a')](_0x488a95);}return null;};}function patchUpdates(_0x42dcf4){return function(_0x1a3a7f){try{jsonpatch[_0x92ac('0x21')](_0x1a3a7f,_0x42dcf4,!![]);}catch(_0x265d4f){return BPromise[_0x92ac('0x22')](_0x265d4f);}return _0x1a3a7f[_0x92ac('0x23')]();};}function saveUpdates(_0x56ee2a,_0x5e1a78){return function(_0xc361d8){if(_0xc361d8){return _0xc361d8[_0x92ac('0x24')](_0x56ee2a)[_0x92ac('0x25')](function(_0x4a71e5){return _0x4a71e5;});}return null;};}function removeEntity(_0x1d2e87,_0x50d25c){return function(_0x5e7cc3){if(_0x5e7cc3){return _0x5e7cc3[_0x92ac('0x26')]()[_0x92ac('0x25')](function(){_0x1d2e87[_0x92ac('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x319dcd,_0x5bc0c2){return function(_0x1502fc){if(!_0x1502fc){_0x319dcd['sendStatus'](0x194);}return _0x1502fc;};}function handleError(_0x44a525,_0x48cfcf){_0x48cfcf=_0x48cfcf||0x1f4;return function(_0x3ad7ae){logger[_0x92ac('0x27')](_0x3ad7ae[_0x92ac('0x28')]);if(_0x3ad7ae[_0x92ac('0x29')]){delete _0x3ad7ae[_0x92ac('0x29')];}_0x44a525[_0x92ac('0x18')](_0x48cfcf)[_0x92ac('0x2a')](_0x3ad7ae);};}exports[_0x92ac('0x2b')]=function(_0x198384,_0x2b3dde){var _0x243e97={},_0x386fca={},_0x223d53={'count':0x0,'rows':[]};var _0x2d5874=_[_0x92ac('0x2c')](db['MailServerOut'][_0x92ac('0x2d')],function(_0x5460f5){return{'name':_0x5460f5['fieldName'],'type':_0x5460f5[_0x92ac('0x2e')][_0x92ac('0x2f')]};});_0x386fca[_0x92ac('0x30')]=_[_0x92ac('0x2c')](_0x2d5874,_0x92ac('0x29'));_0x386fca[_0x92ac('0x31')]=_[_0x92ac('0x32')](_0x198384[_0x92ac('0x31')]);_0x386fca[_0x92ac('0x33')]=_[_0x92ac('0x34')](_0x386fca[_0x92ac('0x30')],_0x386fca[_0x92ac('0x31')]);_0x243e97[_0x92ac('0x35')]=_[_0x92ac('0x34')](_0x386fca[_0x92ac('0x30')],qs['fields'](_0x198384[_0x92ac('0x31')]['fields']));_0x243e97['attributes']=_0x243e97[_0x92ac('0x35')][_0x92ac('0x36')]?_0x243e97[_0x92ac('0x35')]:_0x386fca[_0x92ac('0x30')];if(!_0x198384[_0x92ac('0x31')][_0x92ac('0x37')](_0x92ac('0x38'))){_0x243e97['limit']=qs['limit'](_0x198384['query']['limit']);_0x243e97[_0x92ac('0x1b')]=qs[_0x92ac('0x1b')](_0x198384[_0x92ac('0x31')][_0x92ac('0x1b')]);}_0x243e97[_0x92ac('0x39')]=qs[_0x92ac('0x3a')](_0x198384[_0x92ac('0x31')]['sort']);_0x243e97[_0x92ac('0x3b')]=qs[_0x92ac('0x33')](_['pick'](_0x198384['query'],_0x386fca['filters']),_0x2d5874);if(_0x198384[_0x92ac('0x31')][_0x92ac('0x3c')]){_0x243e97[_0x92ac('0x3b')]=_[_0x92ac('0x3d')](_0x243e97[_0x92ac('0x3b')],{'$or':_[_0x92ac('0x2c')](_0x2d5874,function(_0x367dce){if(_0x367dce['type']!==_0x92ac('0x3e')){var _0x16b0ab={};_0x16b0ab[_0x367dce[_0x92ac('0x29')]]={'$like':'%'+_0x198384[_0x92ac('0x31')][_0x92ac('0x3c')]+'%'};return _0x16b0ab;}})});}_0x243e97=_[_0x92ac('0x3d')]({},_0x243e97,_0x198384[_0x92ac('0x3f')]);var _0x49a610={'where':_0x243e97['where']};return db[_0x92ac('0x40')]['count'](_0x49a610)[_0x92ac('0x25')](function(_0x17c828){_0x223d53[_0x92ac('0x1d')]=_0x17c828;if(_0x198384[_0x92ac('0x31')][_0x92ac('0x41')]){_0x243e97[_0x92ac('0x42')]=[{'all':!![]}];}return db[_0x92ac('0x40')][_0x92ac('0x43')](_0x243e97);})['then'](function(_0x55f35d){_0x223d53['rows']=_0x55f35d;return _0x223d53;})[_0x92ac('0x25')](respondWithFilteredResult(_0x2b3dde,_0x243e97))[_0x92ac('0x44')](handleError(_0x2b3dde,null));};exports[_0x92ac('0x45')]=function(_0x2e707b,_0x45c705){var _0x1a737e={'raw':!![],'where':{'id':_0x2e707b[_0x92ac('0x46')]['id']}},_0x133485={};_0x133485[_0x92ac('0x30')]=_[_0x92ac('0x32')](db[_0x92ac('0x40')][_0x92ac('0x2d')]);_0x133485[_0x92ac('0x31')]=_[_0x92ac('0x32')](_0x2e707b[_0x92ac('0x31')]);_0x133485[_0x92ac('0x33')]=_['intersection'](_0x133485[_0x92ac('0x30')],_0x133485[_0x92ac('0x31')]);_0x1a737e[_0x92ac('0x35')]=_['intersection'](_0x133485[_0x92ac('0x30')],qs[_0x92ac('0x47')](_0x2e707b['query']['fields']));_0x1a737e['attributes']=_0x1a737e[_0x92ac('0x35')][_0x92ac('0x36')]?_0x1a737e['attributes']:_0x133485[_0x92ac('0x30')];if(_0x2e707b[_0x92ac('0x31')][_0x92ac('0x41')]){_0x1a737e['include']=[{'all':!![]}];}_0x1a737e=_[_0x92ac('0x3d')]({},_0x1a737e,_0x2e707b[_0x92ac('0x3f')]);return db[_0x92ac('0x40')][_0x92ac('0x48')](_0x1a737e)[_0x92ac('0x25')](handleEntityNotFound(_0x45c705,null))[_0x92ac('0x25')](respondWithResult(_0x45c705,null))[_0x92ac('0x44')](handleError(_0x45c705,null));};exports[_0x92ac('0x49')]=function(_0x2444d1,_0x3b1bf6){return db['MailServerOut'][_0x92ac('0x49')](_0x2444d1[_0x92ac('0x4a')],{})[_0x92ac('0x25')](respondWithResult(_0x3b1bf6,0xc9))[_0x92ac('0x44')](handleError(_0x3b1bf6,null));};exports[_0x92ac('0x24')]=function(_0x196c38,_0x2ac08a){if(_0x196c38[_0x92ac('0x4a')]['id']){delete _0x196c38[_0x92ac('0x4a')]['id'];}return db[_0x92ac('0x40')][_0x92ac('0x48')]({'where':{'id':_0x196c38['params']['id']}})[_0x92ac('0x25')](handleEntityNotFound(_0x2ac08a,null))['then'](saveUpdates(_0x196c38['body'],null))[_0x92ac('0x25')](respondWithResult(_0x2ac08a,null))[_0x92ac('0x44')](handleError(_0x2ac08a,null));};exports[_0x92ac('0x26')]=function(_0x5e93d3,_0x37b408){return db[_0x92ac('0x40')]['find']({'where':{'id':_0x5e93d3['params']['id']}})[_0x92ac('0x25')](handleEntityNotFound(_0x37b408,null))[_0x92ac('0x25')](removeEntity(_0x37b408,null))[_0x92ac('0x44')](handleError(_0x37b408,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 65dbc9f..62263b3 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 _0x991c=['moment','request-promise','path','rimraf','define','MailServerOut','mail_servers_out','lodash','util','../../config/logger','api'];(function(_0x516ffb,_0x5b5b42){var _0x319667=function(_0x250098){while(--_0x250098){_0x516ffb['push'](_0x516ffb['shift']());}};_0x319667(++_0x5b5b42);}(_0x991c,0x1b4));var _0xc991=function(_0x236c64,_0x9b42dd){_0x236c64=_0x236c64-0x0;var _0x5b35b5=_0x991c[_0x236c64];return _0x5b35b5;};'use strict';var _=require(_0xc991('0x0'));var util=require(_0xc991('0x1'));var logger=require(_0xc991('0x2'))(_0xc991('0x3'));var moment=require(_0xc991('0x4'));var BPromise=require('bluebird');var rp=require(_0xc991('0x5'));var fs=require('fs');var path=require(_0xc991('0x6'));var rimraf=require(_0xc991('0x7'));var config=require('../../config/environment');var attributes=require('./mailServerOut.attributes');module['exports']=function(_0x4f375e,_0x2fc4f0){return _0x4f375e[_0xc991('0x8')](_0xc991('0x9'),attributes,{'tableName':_0xc991('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xad07=['moment','path','rimraf','../../config/environment','exports','define','MailServerOut','lodash','util','api'];(function(_0x4e198a,_0x5a6bad){var _0xb84bfe=function(_0x58d2b2){while(--_0x58d2b2){_0x4e198a['push'](_0x4e198a['shift']());}};_0xb84bfe(++_0x5a6bad);}(_0xad07,0xe3));var _0x7ad0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xad07[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7ad0('0x0'));var util=require(_0x7ad0('0x1'));var logger=require('../../config/logger')(_0x7ad0('0x2'));var moment=require(_0x7ad0('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7ad0('0x4'));var rimraf=require(_0x7ad0('0x5'));var config=require(_0x7ad0('0x6'));var attributes=require('./mailServerOut.attributes');module[_0x7ad0('0x7')]=function(_0x4bff98,_0x5e81bd){return _0x4bff98[_0x7ad0('0x8')](_0x7ad0('0x9'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index ef858cd..1e45ceb 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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailServerOut,\x20%s,\x20%s','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x54d5ba,_0x1f1ba9){var _0x6a592e=function(_0x394f8d){while(--_0x394f8d){_0x54d5ba['push'](_0x54d5ba['shift']());}};_0x6a592e(++_0x1f1ba9);}(_0x2ef3,0xba));var _0x32ef=function(_0x10abcd,_0x2fd20b){_0x10abcd=_0x10abcd-0x0;var _0x22a5f3=_0x2ef3[_0x10abcd];return _0x22a5f3;};'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')]('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ 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(_0x550d43,_0x1811a8){var _0x94d38a=function(_0x5eb351){while(--_0x5eb351){_0x550d43['push'](_0x550d43['shift']());}};_0x94d38a(++_0x1811a8);}(_0x5f2f,0x73));var _0xf5f2=function(_0x516abf,_0x14defb){_0x516abf=_0x516abf-0x0;var _0x2b869b=_0x5f2f[_0x516abf];return _0x2b869b;};'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 dca30ff..2a10823 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 _0x31ec=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','/describe','describe','create','put','update','/:id','destroy','exports','multer','path','Router'];(function(_0x1d57bc,_0x5c92dd){var _0x28b8e6=function(_0x1f6e8a){while(--_0x1f6e8a){_0x1d57bc['push'](_0x1d57bc['shift']());}};_0x28b8e6(++_0x5c92dd);}(_0x31ec,0x141));var _0xc31e=function(_0x1101c9,_0x56ece2){_0x1101c9=_0x1101c9-0x0;var _0x3fef5d=_0x31ec[_0x1101c9];return _0x3fef5d;};'use strict';var multer=require(_0xc31e('0x0'));var util=require('util');var path=require(_0xc31e('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc31e('0x2')]();var fs_extra=require(_0xc31e('0x3'));var auth=require(_0xc31e('0x4'));var interaction=require(_0xc31e('0x5'));var config=require(_0xc31e('0x6'));var controller=require(_0xc31e('0x7'));router[_0xc31e('0x8')]('/',auth[_0xc31e('0x9')](),controller['index']);router['get'](_0xc31e('0xa'),auth[_0xc31e('0x9')](),controller[_0xc31e('0xb')]);router[_0xc31e('0x8')]('/:id',auth[_0xc31e('0x9')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xc31e('0xc')]);router[_0xc31e('0xd')]('/:id',auth[_0xc31e('0x9')](),controller[_0xc31e('0xe')]);router['delete'](_0xc31e('0xf'),auth['isAuthenticated'](),controller[_0xc31e('0x10')]);module[_0xc31e('0x11')]=router; \ No newline at end of file +var _0x286b=['isAuthenticated','index','get','describe','/:id','show','create','put','update','delete','destroy','exports','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller'];(function(_0x3081d0,_0x39f1c1){var _0x12b5c1=function(_0x178a2a){while(--_0x178a2a){_0x3081d0['push'](_0x3081d0['shift']());}};_0x12b5c1(++_0x39f1c1);}(_0x286b,0x13c));var _0xb286=function(_0x27777d,_0x26ac74){_0x27777d=_0x27777d-0x0;var _0x3b821b=_0x286b[_0x27777d];return _0x3b821b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb286('0x0'));var timeout=require('connect-timeout');var express=require(_0xb286('0x1'));var router=express['Router']();var fs_extra=require(_0xb286('0x2'));var auth=require(_0xb286('0x3'));var interaction=require(_0xb286('0x4'));var config=require(_0xb286('0x5'));var controller=require(_0xb286('0x6'));router['get']('/',auth[_0xb286('0x7')](),controller[_0xb286('0x8')]);router[_0xb286('0x9')]('/describe',auth[_0xb286('0x7')](),controller[_0xb286('0xa')]);router['get'](_0xb286('0xb'),auth[_0xb286('0x7')](),controller[_0xb286('0xc')]);router['post']('/',auth[_0xb286('0x7')](),controller[_0xb286('0xd')]);router[_0xb286('0xe')](_0xb286('0xb'),auth[_0xb286('0x7')](),controller[_0xb286('0xf')]);router[_0xb286('0x10')]('/:id',auth[_0xb286('0x7')](),controller[_0xb286('0x11')]);module[_0xb286('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index ed3cbb4..a824d83 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 _0xf072=['STRING','sequelize','exports'];(function(_0x20320f,_0x2280a5){var _0x3c95f0=function(_0x2fa027){while(--_0x2fa027){_0x20320f['push'](_0x20320f['shift']());}};_0x3c95f0(++_0x2280a5);}(_0xf072,0x1cf));var _0x2f07=function(_0x37855b,_0x553fe9){_0x37855b=_0x37855b-0x0;var _0x5b6157=_0xf072[_0x37855b];return _0x5b6157;};'use strict';var Sequelize=require(_0x2f07('0x0'));module[_0x2f07('0x1')]={'name':{'type':Sequelize[_0x2f07('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x2f07('0x2')]}}; \ No newline at end of file +var _0x029b=['name','STRING','sequelize','exports'];(function(_0x11090e,_0x2f1226){var _0x103e19=function(_0x2c73bc){while(--_0x2c73bc){_0x11090e['push'](_0x11090e['shift']());}};_0x103e19(++_0x2f1226);}(_0x029b,0x66));var _0xb029=function(_0x10d4d3,_0xfd0722){_0x10d4d3=_0x10d4d3-0x0;var _0x11068=_0x029b[_0x10d4d3];return _0x11068;};'use strict';var Sequelize=require(_0xb029('0x0'));module[_0xb029('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xb029('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb029('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index b62f749..f89f4e6 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 _0x8aa7=['index','MailSubstatus','fieldName','type','key','map','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','sort','where','filter','VIRTUAL','merge','include','findAll','show','params','rawAttributes','options','catch','body','find','describe','eml-format','rimraf','zip-dir','request-promise','mustache','path','sox','to-csv','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send'];(function(_0x1c6e8e,_0x416a47){var _0x28370e=function(_0x4637bb){while(--_0x4637bb){_0x1c6e8e['push'](_0x1c6e8e['shift']());}};_0x28370e(++_0x416a47);}(_0x8aa7,0x18b));var _0x78aa=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0x8aa7[_0x31cb5f];return _0x586042;};'use strict';var emlformat=require(_0x78aa('0x0'));var rimraf=require(_0x78aa('0x1'));var zipdir=require(_0x78aa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x78aa('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x78aa('0x4'));var util=require('util');var path=require(_0x78aa('0x5'));var sox=require(_0x78aa('0x6'));var csv=require(_0x78aa('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x78aa('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x78aa('0x9'));var deskjs=require(_0x78aa('0xa'));var toCsv=require(_0x78aa('0x7'));var querystring=require(_0x78aa('0xb'));var Papa=require(_0x78aa('0xc'));var Redis=require(_0x78aa('0xd'));var authService=require(_0x78aa('0xe'));var qs=require(_0x78aa('0xf'));var as=require(_0x78aa('0x10'));var hardwareService=require(_0x78aa('0x11'));var logger=require(_0x78aa('0x12'))(_0x78aa('0x13'));var utils=require(_0x78aa('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x78aa('0x15'));var db=require(_0x78aa('0x16'))['db'];function respondWithStatusCode(_0xf914f0,_0x28297b){_0x28297b=_0x28297b||0xcc;return function(_0x561033){if(_0x561033){return _0xf914f0[_0x78aa('0x17')](_0x28297b);}return _0xf914f0[_0x78aa('0x18')](_0x28297b)[_0x78aa('0x19')]();};}function respondWithResult(_0x84f7aa,_0x1edf47){_0x1edf47=_0x1edf47||0xc8;return function(_0x47ecde){if(_0x47ecde){return _0x84f7aa[_0x78aa('0x18')](_0x1edf47)[_0x78aa('0x1a')](_0x47ecde);}};}function respondWithFilteredResult(_0x2e1c05,_0x5d2877){return function(_0x43ba5b){if(_0x43ba5b){var _0x2a3095=typeof _0x5d2877[_0x78aa('0x1b')]===_0x78aa('0x1c')&&typeof _0x5d2877[_0x78aa('0x1d')]==='undefined';var _0x282124=_0x43ba5b[_0x78aa('0x1e')];var _0x2fe622=_0x2a3095?0x0:_0x5d2877[_0x78aa('0x1b')];var _0x368460=_0x2a3095?_0x43ba5b[_0x78aa('0x1e')]:_0x5d2877[_0x78aa('0x1b')]+_0x5d2877[_0x78aa('0x1d')];var _0x1d9b60;if(_0x368460>=_0x282124){_0x368460=_0x282124;_0x1d9b60=0xc8;}else{_0x1d9b60=0xce;}_0x2e1c05[_0x78aa('0x18')](_0x1d9b60);return _0x2e1c05[_0x78aa('0x1f')](_0x78aa('0x20'),_0x2fe622+'-'+_0x368460+'/'+_0x282124)[_0x78aa('0x1a')](_0x43ba5b);}return null;};}function patchUpdates(_0x7a744b){return function(_0x29de6c){try{jsonpatch[_0x78aa('0x21')](_0x29de6c,_0x7a744b,!![]);}catch(_0x2cee50){return BPromise[_0x78aa('0x22')](_0x2cee50);}return _0x29de6c[_0x78aa('0x23')]();};}function saveUpdates(_0x3fc699,_0x115cca){return function(_0x2d80fd){if(_0x2d80fd){return _0x2d80fd[_0x78aa('0x24')](_0x3fc699)[_0x78aa('0x25')](function(_0x1d89c8){return _0x1d89c8;});}return null;};}function removeEntity(_0xc46efa,_0x1f87aa){return function(_0x2237ff){if(_0x2237ff){return _0x2237ff[_0x78aa('0x26')]()[_0x78aa('0x25')](function(){_0xc46efa[_0x78aa('0x18')](0xcc)[_0x78aa('0x19')]();});}};}function handleEntityNotFound(_0x413511,_0x1d2b12){return function(_0x536a33){if(!_0x536a33){_0x413511[_0x78aa('0x17')](0x194);}return _0x536a33;};}function handleError(_0x410bfa,_0xeeb6a7){_0xeeb6a7=_0xeeb6a7||0x1f4;return function(_0xb614e1){logger[_0x78aa('0x27')](_0xb614e1[_0x78aa('0x28')]);if(_0xb614e1[_0x78aa('0x29')]){delete _0xb614e1[_0x78aa('0x29')];}_0x410bfa[_0x78aa('0x18')](_0xeeb6a7)[_0x78aa('0x2a')](_0xb614e1);};}exports[_0x78aa('0x2b')]=function(_0x4e3e9e,_0x269bb3){var _0x2c8615={},_0x5385ce={},_0x5d7d58={'count':0x0,'rows':[]};var _0x4a218a=_['map'](db[_0x78aa('0x2c')]['rawAttributes'],function(_0x46135f){return{'name':_0x46135f[_0x78aa('0x2d')],'type':_0x46135f[_0x78aa('0x2e')][_0x78aa('0x2f')]};});_0x5385ce['model']=_[_0x78aa('0x30')](_0x4a218a,'name');_0x5385ce['query']=_[_0x78aa('0x31')](_0x4e3e9e['query']);_0x5385ce[_0x78aa('0x32')]=_[_0x78aa('0x33')](_0x5385ce[_0x78aa('0x34')],_0x5385ce[_0x78aa('0x35')]);_0x2c8615[_0x78aa('0x36')]=_[_0x78aa('0x33')](_0x5385ce['model'],qs[_0x78aa('0x37')](_0x4e3e9e[_0x78aa('0x35')][_0x78aa('0x37')]));_0x2c8615[_0x78aa('0x36')]=_0x2c8615[_0x78aa('0x36')][_0x78aa('0x38')]?_0x2c8615[_0x78aa('0x36')]:_0x5385ce[_0x78aa('0x34')];if(!_0x4e3e9e[_0x78aa('0x35')][_0x78aa('0x39')]('nolimit')){_0x2c8615['limit']=qs[_0x78aa('0x1d')](_0x4e3e9e[_0x78aa('0x35')]['limit']);_0x2c8615['offset']=qs[_0x78aa('0x1b')](_0x4e3e9e[_0x78aa('0x35')]['offset']);}_0x2c8615['order']=qs['sort'](_0x4e3e9e[_0x78aa('0x35')][_0x78aa('0x3a')]);_0x2c8615[_0x78aa('0x3b')]=qs[_0x78aa('0x32')](_['pick'](_0x4e3e9e[_0x78aa('0x35')],_0x5385ce[_0x78aa('0x32')]),_0x4a218a);if(_0x4e3e9e[_0x78aa('0x35')][_0x78aa('0x3c')]){_0x2c8615[_0x78aa('0x3b')]=_['merge'](_0x2c8615[_0x78aa('0x3b')],{'$or':_['map'](_0x4a218a,function(_0x42efda){if(_0x42efda[_0x78aa('0x2e')]!==_0x78aa('0x3d')){var _0x56378d={};_0x56378d[_0x42efda[_0x78aa('0x29')]]={'$like':'%'+_0x4e3e9e[_0x78aa('0x35')]['filter']+'%'};return _0x56378d;}})});}_0x2c8615=_[_0x78aa('0x3e')]({},_0x2c8615,_0x4e3e9e['options']);var _0x12ba11={'where':_0x2c8615[_0x78aa('0x3b')]};return db[_0x78aa('0x2c')]['count'](_0x12ba11)[_0x78aa('0x25')](function(_0x347428){_0x5d7d58[_0x78aa('0x1e')]=_0x347428;if(_0x4e3e9e[_0x78aa('0x35')]['includeAll']){_0x2c8615[_0x78aa('0x3f')]=[{'all':!![]}];}return db['MailSubstatus'][_0x78aa('0x40')](_0x2c8615);})[_0x78aa('0x25')](function(_0x468cb0){_0x5d7d58['rows']=_0x468cb0;return _0x5d7d58;})['then'](respondWithFilteredResult(_0x269bb3,_0x2c8615))['catch'](handleError(_0x269bb3,null));};exports[_0x78aa('0x41')]=function(_0x437e61,_0x6ed630){var _0x828703={'raw':!![],'where':{'id':_0x437e61[_0x78aa('0x42')]['id']}},_0x1a45b7={};_0x1a45b7[_0x78aa('0x34')]=_[_0x78aa('0x31')](db['MailSubstatus'][_0x78aa('0x43')]);_0x1a45b7[_0x78aa('0x35')]=_[_0x78aa('0x31')](_0x437e61[_0x78aa('0x35')]);_0x1a45b7[_0x78aa('0x32')]=_['intersection'](_0x1a45b7[_0x78aa('0x34')],_0x1a45b7['query']);_0x828703[_0x78aa('0x36')]=_[_0x78aa('0x33')](_0x1a45b7[_0x78aa('0x34')],qs[_0x78aa('0x37')](_0x437e61[_0x78aa('0x35')][_0x78aa('0x37')]));_0x828703[_0x78aa('0x36')]=_0x828703[_0x78aa('0x36')]['length']?_0x828703['attributes']:_0x1a45b7[_0x78aa('0x34')];if(_0x437e61[_0x78aa('0x35')]['includeAll']){_0x828703[_0x78aa('0x3f')]=[{'all':!![]}];}_0x828703=_[_0x78aa('0x3e')]({},_0x828703,_0x437e61[_0x78aa('0x44')]);return db[_0x78aa('0x2c')]['find'](_0x828703)[_0x78aa('0x25')](handleEntityNotFound(_0x6ed630,null))[_0x78aa('0x25')](respondWithResult(_0x6ed630,null))[_0x78aa('0x45')](handleError(_0x6ed630,null));};exports['create']=function(_0x1c789c,_0x199f0d){return db[_0x78aa('0x2c')]['create'](_0x1c789c[_0x78aa('0x46')],{})[_0x78aa('0x25')](respondWithResult(_0x199f0d,0xc9))['catch'](handleError(_0x199f0d,null));};exports[_0x78aa('0x24')]=function(_0x47e691,_0x264ab2){if(_0x47e691[_0x78aa('0x46')]['id']){delete _0x47e691[_0x78aa('0x46')]['id'];}return db[_0x78aa('0x2c')][_0x78aa('0x47')]({'where':{'id':_0x47e691[_0x78aa('0x42')]['id']}})[_0x78aa('0x25')](handleEntityNotFound(_0x264ab2,null))[_0x78aa('0x25')](saveUpdates(_0x47e691[_0x78aa('0x46')],null))[_0x78aa('0x25')](respondWithResult(_0x264ab2,null))[_0x78aa('0x45')](handleError(_0x264ab2,null));};exports[_0x78aa('0x26')]=function(_0x4a1882,_0x2e5e35){return db['MailSubstatus'][_0x78aa('0x47')]({'where':{'id':_0x4a1882[_0x78aa('0x42')]['id']}})[_0x78aa('0x25')](handleEntityNotFound(_0x2e5e35,null))['then'](removeEntity(_0x2e5e35,null))[_0x78aa('0x45')](handleError(_0x2e5e35,null));};exports[_0x78aa('0x48')]=function(_0x1d503,_0x58e4b1){return db[_0x78aa('0x2c')][_0x78aa('0x48')]()['then'](respondWithResult(_0x58e4b1,null))[_0x78aa('0x45')](handleError(_0x58e4b1,null));}; \ No newline at end of file +var _0x35e9=['query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','update','destroy','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','offset','undefined','limit','count','Content-Range','json','reject','then','status','error','stack','name','send','index','map','MailSubstatus','rawAttributes','type','key'];(function(_0x355dbd,_0x213a94){var _0x4c378d=function(_0x50a7de){while(--_0x50a7de){_0x355dbd['push'](_0x355dbd['shift']());}};_0x4c378d(++_0x213a94);}(_0x35e9,0x103));var _0x935e=function(_0x11a6a3,_0x5d2c72){_0x11a6a3=_0x11a6a3-0x0;var _0x20e2b3=_0x35e9[_0x11a6a3];return _0x20e2b3;};'use strict';var emlformat=require(_0x935e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x935e('0x1'));var rp=require(_0x935e('0x2'));var moment=require(_0x935e('0x3'));var BPromise=require(_0x935e('0x4'));var Mustache=require(_0x935e('0x5'));var util=require('util');var path=require(_0x935e('0x6'));var sox=require(_0x935e('0x7'));var csv=require('to-csv');var ejs=require(_0x935e('0x8'));var fs=require('fs');var fs_extra=require(_0x935e('0x9'));var _=require(_0x935e('0xa'));var squel=require(_0x935e('0xb'));var crypto=require(_0x935e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x935e('0xd'));var toCsv=require('to-csv');var querystring=require(_0x935e('0xe'));var Papa=require(_0x935e('0xf'));var Redis=require(_0x935e('0x10'));var authService=require(_0x935e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x935e('0x12'));var hardwareService=require(_0x935e('0x13'));var logger=require('../../config/logger')(_0x935e('0x14'));var utils=require(_0x935e('0x15'));var config=require(_0x935e('0x16'));var licenseUtil=require(_0x935e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf5d48d,_0x406eea){_0x406eea=_0x406eea||0xcc;return function(_0xfed5a9){if(_0xfed5a9){return _0xf5d48d[_0x935e('0x18')](_0x406eea);}return _0xf5d48d['status'](_0x406eea)[_0x935e('0x19')]();};}function respondWithResult(_0x1f2ea7,_0x38e737){_0x38e737=_0x38e737||0xc8;return function(_0x17b0d8){if(_0x17b0d8){return _0x1f2ea7['status'](_0x38e737)['json'](_0x17b0d8);}};}function respondWithFilteredResult(_0x38e3e3,_0x2608d5){return function(_0x2b3a50){if(_0x2b3a50){var _0x26027d=typeof _0x2608d5[_0x935e('0x1a')]===_0x935e('0x1b')&&typeof _0x2608d5[_0x935e('0x1c')]===_0x935e('0x1b');var _0x47dca7=_0x2b3a50['count'];var _0x3ae8cc=_0x26027d?0x0:_0x2608d5['offset'];var _0x21cdd4=_0x26027d?_0x2b3a50[_0x935e('0x1d')]:_0x2608d5['offset']+_0x2608d5['limit'];var _0x37d95e;if(_0x21cdd4>=_0x47dca7){_0x21cdd4=_0x47dca7;_0x37d95e=0xc8;}else{_0x37d95e=0xce;}_0x38e3e3['status'](_0x37d95e);return _0x38e3e3['set'](_0x935e('0x1e'),_0x3ae8cc+'-'+_0x21cdd4+'/'+_0x47dca7)[_0x935e('0x1f')](_0x2b3a50);}return null;};}function patchUpdates(_0x368b65){return function(_0x395ba7){try{jsonpatch['apply'](_0x395ba7,_0x368b65,!![]);}catch(_0x4fe9aa){return BPromise[_0x935e('0x20')](_0x4fe9aa);}return _0x395ba7['save']();};}function saveUpdates(_0x36f4d6,_0x1b8081){return function(_0x2bde85){if(_0x2bde85){return _0x2bde85['update'](_0x36f4d6)[_0x935e('0x21')](function(_0x25fcd4){return _0x25fcd4;});}return null;};}function removeEntity(_0x22c117,_0x18aa72){return function(_0x13e9e0){if(_0x13e9e0){return _0x13e9e0['destroy']()['then'](function(){_0x22c117[_0x935e('0x22')](0xcc)[_0x935e('0x19')]();});}};}function handleEntityNotFound(_0x153dec,_0x5f04bb){return function(_0x1d78b7){if(!_0x1d78b7){_0x153dec[_0x935e('0x18')](0x194);}return _0x1d78b7;};}function handleError(_0x3ba9bb,_0x16267f){_0x16267f=_0x16267f||0x1f4;return function(_0xa20f98){logger[_0x935e('0x23')](_0xa20f98[_0x935e('0x24')]);if(_0xa20f98[_0x935e('0x25')]){delete _0xa20f98[_0x935e('0x25')];}_0x3ba9bb[_0x935e('0x22')](_0x16267f)[_0x935e('0x26')](_0xa20f98);};}exports[_0x935e('0x27')]=function(_0x390f63,_0x31bad0){var _0x4563fc={},_0x4bdd0f={},_0x261e09={'count':0x0,'rows':[]};var _0x27abf4=_[_0x935e('0x28')](db[_0x935e('0x29')][_0x935e('0x2a')],function(_0x302814){return{'name':_0x302814['fieldName'],'type':_0x302814[_0x935e('0x2b')][_0x935e('0x2c')]};});_0x4bdd0f['model']=_['map'](_0x27abf4,_0x935e('0x25'));_0x4bdd0f[_0x935e('0x2d')]=_['keys'](_0x390f63['query']);_0x4bdd0f[_0x935e('0x2e')]=_[_0x935e('0x2f')](_0x4bdd0f[_0x935e('0x30')],_0x4bdd0f[_0x935e('0x2d')]);_0x4563fc['attributes']=_[_0x935e('0x2f')](_0x4bdd0f[_0x935e('0x30')],qs[_0x935e('0x31')](_0x390f63[_0x935e('0x2d')]['fields']));_0x4563fc['attributes']=_0x4563fc[_0x935e('0x32')][_0x935e('0x33')]?_0x4563fc[_0x935e('0x32')]:_0x4bdd0f[_0x935e('0x30')];if(!_0x390f63['query'][_0x935e('0x34')](_0x935e('0x35'))){_0x4563fc[_0x935e('0x1c')]=qs['limit'](_0x390f63['query'][_0x935e('0x1c')]);_0x4563fc['offset']=qs[_0x935e('0x1a')](_0x390f63[_0x935e('0x2d')][_0x935e('0x1a')]);}_0x4563fc[_0x935e('0x36')]=qs['sort'](_0x390f63['query'][_0x935e('0x37')]);_0x4563fc[_0x935e('0x38')]=qs['filters'](_[_0x935e('0x39')](_0x390f63[_0x935e('0x2d')],_0x4bdd0f['filters']),_0x27abf4);if(_0x390f63['query'][_0x935e('0x3a')]){_0x4563fc[_0x935e('0x38')]=_['merge'](_0x4563fc[_0x935e('0x38')],{'$or':_['map'](_0x27abf4,function(_0x9f06b4){if(_0x9f06b4[_0x935e('0x2b')]!==_0x935e('0x3b')){var _0x490c50={};_0x490c50[_0x9f06b4[_0x935e('0x25')]]={'$like':'%'+_0x390f63['query'][_0x935e('0x3a')]+'%'};return _0x490c50;}})});}_0x4563fc=_[_0x935e('0x3c')]({},_0x4563fc,_0x390f63[_0x935e('0x3d')]);var _0x1e98ae={'where':_0x4563fc['where']};return db[_0x935e('0x29')]['count'](_0x1e98ae)['then'](function(_0x3704cf){_0x261e09['count']=_0x3704cf;if(_0x390f63[_0x935e('0x2d')]['includeAll']){_0x4563fc[_0x935e('0x3e')]=[{'all':!![]}];}return db[_0x935e('0x29')][_0x935e('0x3f')](_0x4563fc);})['then'](function(_0x592703){_0x261e09[_0x935e('0x40')]=_0x592703;return _0x261e09;})['then'](respondWithFilteredResult(_0x31bad0,_0x4563fc))[_0x935e('0x41')](handleError(_0x31bad0,null));};exports[_0x935e('0x42')]=function(_0x5f211a,_0x12fb28){var _0x3c66f6={'raw':!![],'where':{'id':_0x5f211a[_0x935e('0x43')]['id']}},_0x4d4cb5={};_0x4d4cb5[_0x935e('0x30')]=_[_0x935e('0x44')](db[_0x935e('0x29')][_0x935e('0x2a')]);_0x4d4cb5[_0x935e('0x2d')]=_[_0x935e('0x44')](_0x5f211a['query']);_0x4d4cb5[_0x935e('0x2e')]=_[_0x935e('0x2f')](_0x4d4cb5[_0x935e('0x30')],_0x4d4cb5[_0x935e('0x2d')]);_0x3c66f6[_0x935e('0x32')]=_[_0x935e('0x2f')](_0x4d4cb5[_0x935e('0x30')],qs[_0x935e('0x31')](_0x5f211a['query'][_0x935e('0x31')]));_0x3c66f6[_0x935e('0x32')]=_0x3c66f6['attributes'][_0x935e('0x33')]?_0x3c66f6['attributes']:_0x4d4cb5[_0x935e('0x30')];if(_0x5f211a[_0x935e('0x2d')][_0x935e('0x45')]){_0x3c66f6[_0x935e('0x3e')]=[{'all':!![]}];}_0x3c66f6=_[_0x935e('0x3c')]({},_0x3c66f6,_0x5f211a[_0x935e('0x3d')]);return db[_0x935e('0x29')][_0x935e('0x46')](_0x3c66f6)[_0x935e('0x21')](handleEntityNotFound(_0x12fb28,null))[_0x935e('0x21')](respondWithResult(_0x12fb28,null))[_0x935e('0x41')](handleError(_0x12fb28,null));};exports[_0x935e('0x47')]=function(_0x2c19bc,_0x4e980f){return db[_0x935e('0x29')]['create'](_0x2c19bc[_0x935e('0x48')],{})[_0x935e('0x21')](respondWithResult(_0x4e980f,0xc9))[_0x935e('0x41')](handleError(_0x4e980f,null));};exports[_0x935e('0x49')]=function(_0x43b763,_0x172a3d){if(_0x43b763[_0x935e('0x48')]['id']){delete _0x43b763[_0x935e('0x48')]['id'];}return db[_0x935e('0x29')][_0x935e('0x46')]({'where':{'id':_0x43b763[_0x935e('0x43')]['id']}})['then'](handleEntityNotFound(_0x172a3d,null))[_0x935e('0x21')](saveUpdates(_0x43b763[_0x935e('0x48')],null))[_0x935e('0x21')](respondWithResult(_0x172a3d,null))['catch'](handleError(_0x172a3d,null));};exports[_0x935e('0x4a')]=function(_0x1bda47,_0x1b2896){return db[_0x935e('0x29')][_0x935e('0x46')]({'where':{'id':_0x1bda47['params']['id']}})[_0x935e('0x21')](handleEntityNotFound(_0x1b2896,null))[_0x935e('0x21')](removeEntity(_0x1b2896,null))[_0x935e('0x41')](handleError(_0x1b2896,null));};exports[_0x935e('0x4b')]=function(_0x3b1932,_0x6d6e3a){return db[_0x935e('0x29')][_0x935e('0x4b')]()[_0x935e('0x21')](respondWithResult(_0x6d6e3a,null))[_0x935e('0x41')](handleError(_0x6d6e3a,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 53c0205..ea512e9 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 _0x962a=['./mailSubstatus.attributes','MailSubstatus','lodash','util','../../config/logger','bluebird','request-promise','path','../../config/environment'];(function(_0x2e20e1,_0x1d55ee){var _0x511295=function(_0x2fe61e){while(--_0x2fe61e){_0x2e20e1['push'](_0x2e20e1['shift']());}};_0x511295(++_0x1d55ee);}(_0x962a,0x14f));var _0xa962=function(_0x54b53c,_0x2d5b3b){_0x54b53c=_0x54b53c-0x0;var _0x4f846e=_0x962a[_0x54b53c];return _0x4f846e;};'use strict';var _=require(_0xa962('0x0'));var util=require(_0xa962('0x1'));var logger=require(_0xa962('0x2'))('api');var moment=require('moment');var BPromise=require(_0xa962('0x3'));var rp=require(_0xa962('0x4'));var fs=require('fs');var path=require(_0xa962('0x5'));var rimraf=require('rimraf');var config=require(_0xa962('0x6'));var attributes=require(_0xa962('0x7'));module['exports']=function(_0x87499b,_0x29b01f){return _0x87499b['define'](_0xa962('0x8'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x111a=['rimraf','./mailSubstatus.attributes','exports','define','lodash','util','../../config/logger','api','request-promise'];(function(_0x804082,_0x36a709){var _0x1ad955=function(_0x139195){while(--_0x139195){_0x804082['push'](_0x804082['shift']());}};_0x1ad955(++_0x36a709);}(_0x111a,0xe5));var _0xa111=function(_0x2d4191,_0x2a43f3){_0x2d4191=_0x2d4191-0x0;var _0x18863f=_0x111a[_0x2d4191];return _0x18863f;};'use strict';var _=require(_0xa111('0x0'));var util=require(_0xa111('0x1'));var logger=require(_0xa111('0x2'))(_0xa111('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa111('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa111('0x5'));var config=require('../../config/environment');var attributes=require(_0xa111('0x6'));module[_0xa111('0x7')]=function(_0x5c3184,_0x1a8e6f){return _0x5c3184[_0xa111('0x8')]('MailSubstatus',attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 34751e5..dae16d9 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 _0x81fa=['error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x22ab6b,_0x578da4){var _0x42b586=function(_0xb82f81){while(--_0xb82f81){_0x22ab6b['push'](_0x22ab6b['shift']());}};_0x42b586(++_0x578da4);}(_0x81fa,0xab));var _0xa81f=function(_0x5eaefe,_0xc72159){_0x5eaefe=_0x5eaefe-0x0;var _0xe64929=_0x81fa[_0x5eaefe];return _0xe64929;};'use strict';var _=require(_0xa81f('0x0'));var util=require(_0xa81f('0x1'));var moment=require(_0xa81f('0x2'));var BPromise=require(_0xa81f('0x3'));var rs=require(_0xa81f('0x4'));var fs=require('fs');var Redis=require(_0xa81f('0x5'));var db=require(_0xa81f('0x6'))['db'];var utils=require(_0xa81f('0x7'));var logger=require(_0xa81f('0x8'))(_0xa81f('0x9'));var config=require('../../config/environment');var jayson=require(_0xa81f('0xa'));var client=jayson['client'][_0xa81f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x483d87,_0x4c227e,_0x440231){return new BPromise(function(_0x2da7d3,_0x32035f){return client[_0xa81f('0xc')](_0x483d87,_0x440231)[_0xa81f('0xd')](function(_0x10abea){logger[_0xa81f('0xe')](_0xa81f('0xf'),_0x4c227e,_0xa81f('0x10'));logger[_0xa81f('0x11')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x4c227e,_0xa81f('0x10'),JSON['stringify'](_0x10abea));if(_0x10abea['error']){if(_0x10abea[_0xa81f('0x12')]['code']===0x1f4){logger[_0xa81f('0x12')](_0xa81f('0xf'),_0x4c227e,_0x10abea[_0xa81f('0x12')][_0xa81f('0x13')]);return _0x32035f(_0x10abea[_0xa81f('0x12')]['message']);}logger[_0xa81f('0x12')]('MailSubstatus,\x20%s,\x20%s',_0x4c227e,_0x10abea[_0xa81f('0x12')][_0xa81f('0x13')]);return _0x2da7d3(_0x10abea['error'][_0xa81f('0x13')]);}else{logger[_0xa81f('0xe')](_0xa81f('0xf'),_0x4c227e,_0xa81f('0x10'));_0x2da7d3(_0x10abea[_0xa81f('0x14')][_0xa81f('0x13')]);}})['catch'](function(_0x2355e2){logger['error'](_0xa81f('0xf'),_0x4c227e,_0x2355e2);_0x32035f(_0x2355e2);});});} \ No newline at end of file +var _0xd73c=['MailSubstatus,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent'];(function(_0x561551,_0x312573){var _0x144d03=function(_0x2edaea){while(--_0x2edaea){_0x561551['push'](_0x561551['shift']());}};_0x144d03(++_0x312573);}(_0xd73c,0x148));var _0xcd73=function(_0x2e5a14,_0x104961){_0x2e5a14=_0x2e5a14-0x0;var _0x3eeb44=_0xd73c[_0x2e5a14];return _0x3eeb44;};'use strict';var _=require(_0xcd73('0x0'));var util=require(_0xcd73('0x1'));var moment=require(_0xcd73('0x2'));var BPromise=require(_0xcd73('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcd73('0x4'));var db=require(_0xcd73('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcd73('0x6'))(_0xcd73('0x7'));var config=require(_0xcd73('0x8'));var jayson=require(_0xcd73('0x9'));var client=jayson[_0xcd73('0xa')][_0xcd73('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5173f2,_0x1b5540,_0x5a9e70){return new BPromise(function(_0x3dc96c,_0x2e09c0){return client[_0xcd73('0xc')](_0x5173f2,_0x5a9e70)[_0xcd73('0xd')](function(_0x1fd760){logger[_0xcd73('0xe')](_0xcd73('0xf'),_0x1b5540,_0xcd73('0x10'));logger['debug'](_0xcd73('0x11'),_0x1b5540,_0xcd73('0x10'),JSON['stringify'](_0x1fd760));if(_0x1fd760['error']){if(_0x1fd760[_0xcd73('0x12')][_0xcd73('0x13')]===0x1f4){logger[_0xcd73('0x12')](_0xcd73('0xf'),_0x1b5540,_0x1fd760[_0xcd73('0x12')][_0xcd73('0x14')]);return _0x2e09c0(_0x1fd760['error'][_0xcd73('0x14')]);}logger[_0xcd73('0x12')]('MailSubstatus,\x20%s,\x20%s',_0x1b5540,_0x1fd760[_0xcd73('0x12')][_0xcd73('0x14')]);return _0x3dc96c(_0x1fd760[_0xcd73('0x12')][_0xcd73('0x14')]);}else{logger['info'](_0xcd73('0xf'),_0x1b5540,_0xcd73('0x10'));_0x3dc96c(_0x1fd760[_0xcd73('0x15')][_0xcd73('0x14')]);}})[_0xcd73('0x16')](function(_0x22dc0a){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x1b5540,_0x22dc0a);_0x2e09c0(_0x22dc0a);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index cd10b29..68ddebd 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 _0x5078=['put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','isAuthenticated','index','get','/describe','/:id','post','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5078,0x100));var _0x8507=function(_0xf8b0d4,_0x13cdd2){_0xf8b0d4=_0xf8b0d4-0x0;var _0x323c68=_0x5078[_0xf8b0d4];return _0x323c68;};'use strict';var multer=require(_0x8507('0x0'));var util=require(_0x8507('0x1'));var path=require('path');var timeout=require(_0x8507('0x2'));var express=require(_0x8507('0x3'));var router=express[_0x8507('0x4')]();var fs_extra=require(_0x8507('0x5'));var auth=require(_0x8507('0x6'));var interaction=require(_0x8507('0x7'));var config=require(_0x8507('0x8'));var controller=require(_0x8507('0x9'));router['get']('/',auth[_0x8507('0xa')](),controller[_0x8507('0xb')]);router[_0x8507('0xc')](_0x8507('0xd'),auth[_0x8507('0xa')](),controller['describe']);router[_0x8507('0xc')](_0x8507('0xe'),auth[_0x8507('0xa')](),controller['show']);router[_0x8507('0xf')]('/',auth['isAuthenticated'](),controller[_0x8507('0x10')]);router[_0x8507('0x11')](_0x8507('0xe'),auth['isAuthenticated'](),controller[_0x8507('0x12')]);router[_0x8507('0x13')]('/:id',auth[_0x8507('0xa')](),controller['destroy']);module[_0x8507('0x14')]=router; \ No newline at end of file +var _0xbf58=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','post','create','/:id','update','delete','destroy','exports','path','connect-timeout','express'];(function(_0x2dc9e5,_0x50ccc4){var _0x53b32d=function(_0x36b662){while(--_0x36b662){_0x2dc9e5['push'](_0x2dc9e5['shift']());}};_0x53b32d(++_0x50ccc4);}(_0xbf58,0x18d));var _0x8bf5=function(_0x1dc38a,_0x3edc95){_0x1dc38a=_0x1dc38a-0x0;var _0x3e093a=_0xbf58[_0x1dc38a];return _0x3e093a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8bf5('0x0'));var timeout=require(_0x8bf5('0x1'));var express=require(_0x8bf5('0x2'));var router=express[_0x8bf5('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8bf5('0x4'));var interaction=require(_0x8bf5('0x5'));var config=require(_0x8bf5('0x6'));var controller=require(_0x8bf5('0x7'));router[_0x8bf5('0x8')]('/',auth[_0x8bf5('0x9')](),controller[_0x8bf5('0xa')]);router[_0x8bf5('0x8')](_0x8bf5('0xb'),auth['isAuthenticated'](),controller[_0x8bf5('0xc')]);router[_0x8bf5('0x8')]('/:id',auth[_0x8bf5('0x9')](),controller['show']);router[_0x8bf5('0xd')]('/',auth['isAuthenticated'](),controller[_0x8bf5('0xe')]);router['put'](_0x8bf5('0xf'),auth[_0x8bf5('0x9')](),controller[_0x8bf5('0x10')]);router[_0x8bf5('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x8bf5('0x12')]);module[_0x8bf5('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 0195a12..691e8eb 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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x15bb1e,_0x1b9b51){var _0x3ebc3c=function(_0x59da22){while(--_0x59da22){_0x15bb1e['push'](_0x15bb1e['shift']());}};_0x3ebc3c(++_0x1b9b51);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5a79e2,_0x319b1a){_0x5a79e2=_0x5a79e2-0x0;var _0x266c45=_0xcb91[_0x5a79e2];return _0x266c45;};'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 +var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0xcdc34f,_0x592405){var _0x2b86b6=function(_0x5b8fd5){while(--_0x5b8fd5){_0xcdc34f['push'](_0xcdc34f['shift']());}};_0x2b86b6(++_0x592405);}(_0xedd9,0xfc));var _0x9edd=function(_0xafe7c2,_0x37b076){_0xafe7c2=_0xafe7c2-0x0;var _0x4919f1=_0xedd9[_0xafe7c2];return _0x4919f1;};'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/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 15ea9cc..573046a 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 _0x59e8=['limit','Content-Range','reject','save','update','then','destroy','sendStatus','error','name','map','MailTransferReport','rawAttributes','type','key','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','options','includeAll','include','findAll','rows','catch','find','create','body','params','describe','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count'];(function(_0x130742,_0x334b19){var _0x3d2391=function(_0x22029d){while(--_0x22029d){_0x130742['push'](_0x130742['shift']());}};_0x3d2391(++_0x334b19);}(_0x59e8,0x138));var _0x859e=function(_0x1fa5ac,_0x815a90){_0x1fa5ac=_0x1fa5ac-0x0;var _0x25cdf3=_0x59e8[_0x1fa5ac];return _0x25cdf3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x859e('0x0'));var rp=require(_0x859e('0x1'));var moment=require('moment');var BPromise=require(_0x859e('0x2'));var Mustache=require('mustache');var util=require(_0x859e('0x3'));var path=require(_0x859e('0x4'));var sox=require(_0x859e('0x5'));var csv=require(_0x859e('0x6'));var ejs=require(_0x859e('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x859e('0x8'));var squel=require(_0x859e('0x9'));var crypto=require(_0x859e('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x859e('0x6'));var querystring=require('querystring');var Papa=require(_0x859e('0xb'));var Redis=require(_0x859e('0xc'));var authService=require(_0x859e('0xd'));var qs=require(_0x859e('0xe'));var as=require(_0x859e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x859e('0x10'))(_0x859e('0x11'));var utils=require(_0x859e('0x12'));var config=require(_0x859e('0x13'));var licenseUtil=require(_0x859e('0x14'));var db=require(_0x859e('0x15'))['db'];function respondWithStatusCode(_0x195643,_0x5c2f05){_0x5c2f05=_0x5c2f05||0xcc;return function(_0xb1a35a){if(_0xb1a35a){return _0x195643['sendStatus'](_0x5c2f05);}return _0x195643[_0x859e('0x16')](_0x5c2f05)[_0x859e('0x17')]();};}function respondWithResult(_0x1f39f8,_0x44e655){_0x44e655=_0x44e655||0xc8;return function(_0x5c212f){if(_0x5c212f){return _0x1f39f8[_0x859e('0x16')](_0x44e655)[_0x859e('0x18')](_0x5c212f);}};}function respondWithFilteredResult(_0x25fe95,_0x1f255f){return function(_0x4e8842){if(_0x4e8842){var _0x370b1a=typeof _0x1f255f[_0x859e('0x19')]===_0x859e('0x1a')&&typeof _0x1f255f['limit']===_0x859e('0x1a');var _0x22d9b7=_0x4e8842[_0x859e('0x1b')];var _0x41e046=_0x370b1a?0x0:_0x1f255f[_0x859e('0x19')];var _0x36c872=_0x370b1a?_0x4e8842[_0x859e('0x1b')]:_0x1f255f[_0x859e('0x19')]+_0x1f255f[_0x859e('0x1c')];var _0xbbea52;if(_0x36c872>=_0x22d9b7){_0x36c872=_0x22d9b7;_0xbbea52=0xc8;}else{_0xbbea52=0xce;}_0x25fe95[_0x859e('0x16')](_0xbbea52);return _0x25fe95['set'](_0x859e('0x1d'),_0x41e046+'-'+_0x36c872+'/'+_0x22d9b7)[_0x859e('0x18')](_0x4e8842);}return null;};}function patchUpdates(_0x150bd8){return function(_0x1649d6){try{jsonpatch['apply'](_0x1649d6,_0x150bd8,!![]);}catch(_0x833a85){return BPromise[_0x859e('0x1e')](_0x833a85);}return _0x1649d6[_0x859e('0x1f')]();};}function saveUpdates(_0x2b2eab,_0x37f2ed){return function(_0x1f9b58){if(_0x1f9b58){return _0x1f9b58[_0x859e('0x20')](_0x2b2eab)[_0x859e('0x21')](function(_0x30fe0d){return _0x30fe0d;});}return null;};}function removeEntity(_0x2bd9cc,_0x5db7b4){return function(_0x1f7961){if(_0x1f7961){return _0x1f7961[_0x859e('0x22')]()[_0x859e('0x21')](function(){_0x2bd9cc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x514c4a,_0x40d9de){return function(_0x18cae8){if(!_0x18cae8){_0x514c4a[_0x859e('0x23')](0x194);}return _0x18cae8;};}function handleError(_0x47dda8,_0x397127){_0x397127=_0x397127||0x1f4;return function(_0x34ae7e){logger[_0x859e('0x24')](_0x34ae7e['stack']);if(_0x34ae7e[_0x859e('0x25')]){delete _0x34ae7e[_0x859e('0x25')];}_0x47dda8[_0x859e('0x16')](_0x397127)['send'](_0x34ae7e);};}exports['index']=function(_0x2dde9d,_0x418c5b){var _0x1084b1={},_0x2fb824={},_0x50b170={'count':0x0,'rows':[]};var _0x1c95db=_[_0x859e('0x26')](db[_0x859e('0x27')][_0x859e('0x28')],function(_0x5bd0b1){return{'name':_0x5bd0b1['fieldName'],'type':_0x5bd0b1[_0x859e('0x29')][_0x859e('0x2a')]};});_0x2fb824['model']=_[_0x859e('0x26')](_0x1c95db,'name');_0x2fb824['query']=_[_0x859e('0x2b')](_0x2dde9d['query']);_0x2fb824[_0x859e('0x2c')]=_[_0x859e('0x2d')](_0x2fb824[_0x859e('0x2e')],_0x2fb824[_0x859e('0x2f')]);_0x1084b1[_0x859e('0x30')]=_[_0x859e('0x2d')](_0x2fb824[_0x859e('0x2e')],qs['fields'](_0x2dde9d[_0x859e('0x2f')][_0x859e('0x31')]));_0x1084b1[_0x859e('0x30')]=_0x1084b1[_0x859e('0x30')][_0x859e('0x32')]?_0x1084b1[_0x859e('0x30')]:_0x2fb824[_0x859e('0x2e')];if(!_0x2dde9d['query'][_0x859e('0x33')](_0x859e('0x34'))){_0x1084b1['limit']=qs[_0x859e('0x1c')](_0x2dde9d['query'][_0x859e('0x1c')]);_0x1084b1[_0x859e('0x19')]=qs[_0x859e('0x19')](_0x2dde9d[_0x859e('0x2f')]['offset']);}_0x1084b1[_0x859e('0x35')]=qs['sort'](_0x2dde9d[_0x859e('0x2f')]['sort']);_0x1084b1[_0x859e('0x36')]=qs[_0x859e('0x2c')](_['pick'](_0x2dde9d['query'],_0x2fb824[_0x859e('0x2c')]),_0x1c95db);if(_0x2dde9d[_0x859e('0x2f')][_0x859e('0x37')]){_0x1084b1[_0x859e('0x36')]=_[_0x859e('0x38')](_0x1084b1[_0x859e('0x36')],{'$or':_['map'](_0x1c95db,function(_0xd0e792){if(_0xd0e792[_0x859e('0x29')]!=='VIRTUAL'){var _0x1d8e9b={};_0x1d8e9b[_0xd0e792['name']]={'$like':'%'+_0x2dde9d[_0x859e('0x2f')]['filter']+'%'};return _0x1d8e9b;}})});}_0x1084b1=_['merge']({},_0x1084b1,_0x2dde9d[_0x859e('0x39')]);var _0x5443dc={'where':_0x1084b1['where']};return db[_0x859e('0x27')][_0x859e('0x1b')](_0x5443dc)['then'](function(_0x3a63c2){_0x50b170[_0x859e('0x1b')]=_0x3a63c2;if(_0x2dde9d[_0x859e('0x2f')][_0x859e('0x3a')]){_0x1084b1[_0x859e('0x3b')]=[{'all':!![]}];}return db[_0x859e('0x27')][_0x859e('0x3c')](_0x1084b1);})[_0x859e('0x21')](function(_0xf49b9d){_0x50b170[_0x859e('0x3d')]=_0xf49b9d;return _0x50b170;})[_0x859e('0x21')](respondWithFilteredResult(_0x418c5b,_0x1084b1))[_0x859e('0x3e')](handleError(_0x418c5b,null));};exports['show']=function(_0x3e2e3d,_0x31ea61){var _0x4f60b8={'raw':!![],'where':{'id':_0x3e2e3d['params']['id']}},_0x1520f2={};_0x1520f2[_0x859e('0x2e')]=_['keys'](db[_0x859e('0x27')][_0x859e('0x28')]);_0x1520f2[_0x859e('0x2f')]=_[_0x859e('0x2b')](_0x3e2e3d['query']);_0x1520f2[_0x859e('0x2c')]=_[_0x859e('0x2d')](_0x1520f2['model'],_0x1520f2[_0x859e('0x2f')]);_0x4f60b8[_0x859e('0x30')]=_['intersection'](_0x1520f2[_0x859e('0x2e')],qs[_0x859e('0x31')](_0x3e2e3d[_0x859e('0x2f')]['fields']));_0x4f60b8[_0x859e('0x30')]=_0x4f60b8[_0x859e('0x30')][_0x859e('0x32')]?_0x4f60b8[_0x859e('0x30')]:_0x1520f2['model'];if(_0x3e2e3d[_0x859e('0x2f')][_0x859e('0x3a')]){_0x4f60b8[_0x859e('0x3b')]=[{'all':!![]}];}_0x4f60b8=_[_0x859e('0x38')]({},_0x4f60b8,_0x3e2e3d[_0x859e('0x39')]);return db[_0x859e('0x27')][_0x859e('0x3f')](_0x4f60b8)['then'](handleEntityNotFound(_0x31ea61,null))[_0x859e('0x21')](respondWithResult(_0x31ea61,null))[_0x859e('0x3e')](handleError(_0x31ea61,null));};exports[_0x859e('0x40')]=function(_0x5a6306,_0x12ed08){return db[_0x859e('0x27')][_0x859e('0x40')](_0x5a6306[_0x859e('0x41')],{})[_0x859e('0x21')](respondWithResult(_0x12ed08,0xc9))[_0x859e('0x3e')](handleError(_0x12ed08,null));};exports[_0x859e('0x20')]=function(_0x43dd8d,_0x520ed3){if(_0x43dd8d[_0x859e('0x41')]['id']){delete _0x43dd8d[_0x859e('0x41')]['id'];}return db['MailTransferReport'][_0x859e('0x3f')]({'where':{'id':_0x43dd8d['params']['id']}})[_0x859e('0x21')](handleEntityNotFound(_0x520ed3,null))['then'](saveUpdates(_0x43dd8d[_0x859e('0x41')],null))[_0x859e('0x21')](respondWithResult(_0x520ed3,null))['catch'](handleError(_0x520ed3,null));};exports[_0x859e('0x22')]=function(_0x7a6b63,_0x5e4c40){return db[_0x859e('0x27')][_0x859e('0x3f')]({'where':{'id':_0x7a6b63[_0x859e('0x42')]['id']}})[_0x859e('0x21')](handleEntityNotFound(_0x5e4c40,null))['then'](removeEntity(_0x5e4c40,null))[_0x859e('0x3e')](handleError(_0x5e4c40,null));};exports[_0x859e('0x43')]=function(_0x427da0,_0x4eb514){return db[_0x859e('0x27')]['describe']()['then'](respondWithResult(_0x4eb514,null))['catch'](handleError(_0x4eb514,null));}; \ No newline at end of file +var _0x08ad=['json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','MailTransferReport','rawAttributes','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','options','includeAll','include','findAll','show','keys','catch','create','body','find','params','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x2849db,_0x3e2c2f){var _0x39afa8=function(_0x325dd1){while(--_0x325dd1){_0x2849db['push'](_0x2849db['shift']());}};_0x39afa8(++_0x3e2c2f);}(_0x08ad,0x19c));var _0xd08a=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x08ad[_0x173441];return _0x2423a8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd08a('0x0'));var jsonpatch=require(_0xd08a('0x1'));var rp=require(_0xd08a('0x2'));var moment=require(_0xd08a('0x3'));var BPromise=require(_0xd08a('0x4'));var Mustache=require(_0xd08a('0x5'));var util=require('util');var path=require(_0xd08a('0x6'));var sox=require(_0xd08a('0x7'));var csv=require('to-csv');var ejs=require(_0xd08a('0x8'));var fs=require('fs');var fs_extra=require(_0xd08a('0x9'));var _=require(_0xd08a('0xa'));var squel=require(_0xd08a('0xb'));var crypto=require(_0xd08a('0xc'));var jsforce=require(_0xd08a('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd08a('0xe'));var Papa=require('papaparse');var Redis=require(_0xd08a('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd08a('0x10'));var logger=require(_0xd08a('0x11'))(_0xd08a('0x12'));var utils=require(_0xd08a('0x13'));var config=require(_0xd08a('0x14'));var licenseUtil=require(_0xd08a('0x15'));var db=require(_0xd08a('0x16'))['db'];function respondWithStatusCode(_0x6251af,_0x4f4268){_0x4f4268=_0x4f4268||0xcc;return function(_0x43ce5c){if(_0x43ce5c){return _0x6251af[_0xd08a('0x17')](_0x4f4268);}return _0x6251af[_0xd08a('0x18')](_0x4f4268)[_0xd08a('0x19')]();};}function respondWithResult(_0x4f485c,_0x3f4239){_0x3f4239=_0x3f4239||0xc8;return function(_0x521103){if(_0x521103){return _0x4f485c[_0xd08a('0x18')](_0x3f4239)[_0xd08a('0x1a')](_0x521103);}};}function respondWithFilteredResult(_0x118259,_0x4fb11b){return function(_0xd9857d){if(_0xd9857d){var _0x4b736a=typeof _0x4fb11b[_0xd08a('0x1b')]===_0xd08a('0x1c')&&typeof _0x4fb11b[_0xd08a('0x1d')]===_0xd08a('0x1c');var _0x124b3a=_0xd9857d['count'];var _0x39ab00=_0x4b736a?0x0:_0x4fb11b['offset'];var _0x27b9eb=_0x4b736a?_0xd9857d[_0xd08a('0x1e')]:_0x4fb11b[_0xd08a('0x1b')]+_0x4fb11b['limit'];var _0x17e146;if(_0x27b9eb>=_0x124b3a){_0x27b9eb=_0x124b3a;_0x17e146=0xc8;}else{_0x17e146=0xce;}_0x118259['status'](_0x17e146);return _0x118259[_0xd08a('0x1f')](_0xd08a('0x20'),_0x39ab00+'-'+_0x27b9eb+'/'+_0x124b3a)['json'](_0xd9857d);}return null;};}function patchUpdates(_0x2ce2e5){return function(_0x4667d5){try{jsonpatch['apply'](_0x4667d5,_0x2ce2e5,!![]);}catch(_0x2fa503){return BPromise[_0xd08a('0x21')](_0x2fa503);}return _0x4667d5[_0xd08a('0x22')]();};}function saveUpdates(_0x445ff8,_0x5e29b1){return function(_0x337b69){if(_0x337b69){return _0x337b69[_0xd08a('0x23')](_0x445ff8)[_0xd08a('0x24')](function(_0x4817c0){return _0x4817c0;});}return null;};}function removeEntity(_0x447110,_0x51ddf2){return function(_0x44918b){if(_0x44918b){return _0x44918b[_0xd08a('0x25')]()[_0xd08a('0x24')](function(){_0x447110['status'](0xcc)[_0xd08a('0x19')]();});}};}function handleEntityNotFound(_0x41417a,_0x4c750f){return function(_0x1e64ef){if(!_0x1e64ef){_0x41417a[_0xd08a('0x17')](0x194);}return _0x1e64ef;};}function handleError(_0x12de68,_0x5d702a){_0x5d702a=_0x5d702a||0x1f4;return function(_0x2f2b76){logger[_0xd08a('0x26')](_0x2f2b76[_0xd08a('0x27')]);if(_0x2f2b76[_0xd08a('0x28')]){delete _0x2f2b76['name'];}_0x12de68[_0xd08a('0x18')](_0x5d702a)[_0xd08a('0x29')](_0x2f2b76);};}exports[_0xd08a('0x2a')]=function(_0x7e9e39,_0x41a9ed){var _0x33d15b={},_0xd26646={},_0x4a72ef={'count':0x0,'rows':[]};var _0x330ae3=_[_0xd08a('0x2b')](db[_0xd08a('0x2c')][_0xd08a('0x2d')],function(_0x3850f9){return{'name':_0x3850f9['fieldName'],'type':_0x3850f9['type']['key']};});_0xd26646['model']=_[_0xd08a('0x2b')](_0x330ae3,_0xd08a('0x28'));_0xd26646[_0xd08a('0x2e')]=_['keys'](_0x7e9e39[_0xd08a('0x2e')]);_0xd26646[_0xd08a('0x2f')]=_[_0xd08a('0x30')](_0xd26646[_0xd08a('0x31')],_0xd26646['query']);_0x33d15b[_0xd08a('0x32')]=_['intersection'](_0xd26646['model'],qs[_0xd08a('0x33')](_0x7e9e39[_0xd08a('0x2e')][_0xd08a('0x33')]));_0x33d15b[_0xd08a('0x32')]=_0x33d15b['attributes']['length']?_0x33d15b[_0xd08a('0x32')]:_0xd26646['model'];if(!_0x7e9e39[_0xd08a('0x2e')][_0xd08a('0x34')](_0xd08a('0x35'))){_0x33d15b[_0xd08a('0x1d')]=qs['limit'](_0x7e9e39[_0xd08a('0x2e')][_0xd08a('0x1d')]);_0x33d15b[_0xd08a('0x1b')]=qs['offset'](_0x7e9e39[_0xd08a('0x2e')][_0xd08a('0x1b')]);}_0x33d15b[_0xd08a('0x36')]=qs[_0xd08a('0x37')](_0x7e9e39[_0xd08a('0x2e')][_0xd08a('0x37')]);_0x33d15b[_0xd08a('0x38')]=qs[_0xd08a('0x2f')](_[_0xd08a('0x39')](_0x7e9e39['query'],_0xd26646[_0xd08a('0x2f')]),_0x330ae3);if(_0x7e9e39[_0xd08a('0x2e')]['filter']){_0x33d15b[_0xd08a('0x38')]=_[_0xd08a('0x3a')](_0x33d15b['where'],{'$or':_['map'](_0x330ae3,function(_0x3d0ae2){if(_0x3d0ae2[_0xd08a('0x3b')]!==_0xd08a('0x3c')){var _0x47e161={};_0x47e161[_0x3d0ae2['name']]={'$like':'%'+_0x7e9e39[_0xd08a('0x2e')]['filter']+'%'};return _0x47e161;}})});}_0x33d15b=_['merge']({},_0x33d15b,_0x7e9e39[_0xd08a('0x3d')]);var _0x408971={'where':_0x33d15b[_0xd08a('0x38')]};return db['MailTransferReport'][_0xd08a('0x1e')](_0x408971)[_0xd08a('0x24')](function(_0xa88707){_0x4a72ef[_0xd08a('0x1e')]=_0xa88707;if(_0x7e9e39['query'][_0xd08a('0x3e')]){_0x33d15b[_0xd08a('0x3f')]=[{'all':!![]}];}return db[_0xd08a('0x2c')][_0xd08a('0x40')](_0x33d15b);})[_0xd08a('0x24')](function(_0x48b35d){_0x4a72ef['rows']=_0x48b35d;return _0x4a72ef;})[_0xd08a('0x24')](respondWithFilteredResult(_0x41a9ed,_0x33d15b))['catch'](handleError(_0x41a9ed,null));};exports[_0xd08a('0x41')]=function(_0x257ad6,_0x2ada9d){var _0x129459={'raw':!![],'where':{'id':_0x257ad6['params']['id']}},_0x26f902={};_0x26f902[_0xd08a('0x31')]=_['keys'](db['MailTransferReport'][_0xd08a('0x2d')]);_0x26f902[_0xd08a('0x2e')]=_[_0xd08a('0x42')](_0x257ad6[_0xd08a('0x2e')]);_0x26f902[_0xd08a('0x2f')]=_['intersection'](_0x26f902[_0xd08a('0x31')],_0x26f902[_0xd08a('0x2e')]);_0x129459[_0xd08a('0x32')]=_['intersection'](_0x26f902['model'],qs[_0xd08a('0x33')](_0x257ad6[_0xd08a('0x2e')][_0xd08a('0x33')]));_0x129459[_0xd08a('0x32')]=_0x129459[_0xd08a('0x32')]['length']?_0x129459['attributes']:_0x26f902[_0xd08a('0x31')];if(_0x257ad6['query']['includeAll']){_0x129459[_0xd08a('0x3f')]=[{'all':!![]}];}_0x129459=_[_0xd08a('0x3a')]({},_0x129459,_0x257ad6[_0xd08a('0x3d')]);return db[_0xd08a('0x2c')]['find'](_0x129459)['then'](handleEntityNotFound(_0x2ada9d,null))[_0xd08a('0x24')](respondWithResult(_0x2ada9d,null))[_0xd08a('0x43')](handleError(_0x2ada9d,null));};exports[_0xd08a('0x44')]=function(_0x343595,_0x3cd923){return db[_0xd08a('0x2c')][_0xd08a('0x44')](_0x343595[_0xd08a('0x45')],{})[_0xd08a('0x24')](respondWithResult(_0x3cd923,0xc9))[_0xd08a('0x43')](handleError(_0x3cd923,null));};exports[_0xd08a('0x23')]=function(_0x591857,_0x287238){if(_0x591857['body']['id']){delete _0x591857[_0xd08a('0x45')]['id'];}return db[_0xd08a('0x2c')][_0xd08a('0x46')]({'where':{'id':_0x591857[_0xd08a('0x47')]['id']}})[_0xd08a('0x24')](handleEntityNotFound(_0x287238,null))[_0xd08a('0x24')](saveUpdates(_0x591857[_0xd08a('0x45')],null))['then'](respondWithResult(_0x287238,null))[_0xd08a('0x43')](handleError(_0x287238,null));};exports[_0xd08a('0x25')]=function(_0x37ded8,_0x11b521){return db[_0xd08a('0x2c')][_0xd08a('0x46')]({'where':{'id':_0x37ded8[_0xd08a('0x47')]['id']}})['then'](handleEntityNotFound(_0x11b521,null))[_0xd08a('0x24')](removeEntity(_0x11b521,null))[_0xd08a('0x43')](handleError(_0x11b521,null));};exports['describe']=function(_0xdf4986,_0x1a5366){return db['MailTransferReport'][_0xd08a('0x48')]()['then'](respondWithResult(_0x1a5366,null))[_0xd08a('0x43')](handleError(_0x1a5366,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 58b79ad..fe2fcba 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 _0xea31=['define','report_mail_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailTransferReport.attributes','exports'];(function(_0x1314d4,_0xb0b16d){var _0x584ba5=function(_0x394269){while(--_0x394269){_0x1314d4['push'](_0x1314d4['shift']());}};_0x584ba5(++_0xb0b16d);}(_0xea31,0x6b));var _0x1ea3=function(_0x30065c,_0x51410a){_0x30065c=_0x30065c-0x0;var _0x446f52=_0xea31[_0x30065c];return _0x446f52;};'use strict';var _=require(_0x1ea3('0x0'));var util=require('util');var logger=require(_0x1ea3('0x1'))(_0x1ea3('0x2'));var moment=require(_0x1ea3('0x3'));var BPromise=require(_0x1ea3('0x4'));var rp=require(_0x1ea3('0x5'));var fs=require('fs');var path=require(_0x1ea3('0x6'));var rimraf=require(_0x1ea3('0x7'));var config=require('../../config/environment');var attributes=require(_0x1ea3('0x8'));module[_0x1ea3('0x9')]=function(_0x6810da,_0x27c695){return _0x6810da[_0x1ea3('0xa')]('MailTransferReport',attributes,{'tableName':_0x1ea3('0xb'),'paranoid':![],'indexes':[{'name':_0x1ea3('0xc'),'fields':[_0x1ea3('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcdc2=['moment','request-promise','path','rimraf','./mailTransferReport.attributes','exports','define','MailTransferReport','uniqueid','lodash','../../config/logger'];(function(_0x403190,_0x627556){var _0x27ef47=function(_0x300295){while(--_0x300295){_0x403190['push'](_0x403190['shift']());}};_0x27ef47(++_0x627556);}(_0xcdc2,0xae));var _0x2cdc=function(_0x56dcd2,_0x434479){_0x56dcd2=_0x56dcd2-0x0;var _0x4e11e6=_0xcdc2[_0x56dcd2];return _0x4e11e6;};'use strict';var _=require(_0x2cdc('0x0'));var util=require('util');var logger=require(_0x2cdc('0x1'))('api');var moment=require(_0x2cdc('0x2'));var BPromise=require('bluebird');var rp=require(_0x2cdc('0x3'));var fs=require('fs');var path=require(_0x2cdc('0x4'));var rimraf=require(_0x2cdc('0x5'));var config=require('../../config/environment');var attributes=require(_0x2cdc('0x6'));module[_0x2cdc('0x7')]=function(_0x221f23,_0x53fce5){return _0x221f23[_0x2cdc('0x8')](_0x2cdc('0x9'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0x2cdc('0xa'),'fields':[_0x2cdc('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 6dd09f5..ef19117 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 _0xff4f=['http','request','then','info','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','error','code','MailTransferReport,\x20%s,\x20%s','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x3a3758,_0x4dd8cf){var _0x1a9234=function(_0x3dda22){while(--_0x3dda22){_0x3a3758['push'](_0x3a3758['shift']());}};_0x1a9234(++_0x4dd8cf);}(_0xff4f,0x156));var _0xfff4=function(_0x35b721,_0xc1366){_0x35b721=_0x35b721-0x0;var _0xfbfa24=_0xff4f[_0x35b721];return _0xfbfa24;};'use strict';var _=require(_0xfff4('0x0'));var util=require(_0xfff4('0x1'));var moment=require(_0xfff4('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfff4('0x3'));var db=require(_0xfff4('0x4'))['db'];var utils=require(_0xfff4('0x5'));var logger=require('../../config/logger')(_0xfff4('0x6'));var config=require(_0xfff4('0x7'));var jayson=require(_0xfff4('0x8'));var client=jayson[_0xfff4('0x9')][_0xfff4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d18ed,_0x5965f9,_0x39c8ed){return new BPromise(function(_0x341589,_0x4e482b){return client[_0xfff4('0xb')](_0x3d18ed,_0x39c8ed)[_0xfff4('0xc')](function(_0x44ac7c){logger[_0xfff4('0xd')]('MailTransferReport,\x20%s,\x20%s',_0x5965f9,_0xfff4('0xe'));logger[_0xfff4('0xf')](_0xfff4('0x10'),_0x5965f9,_0xfff4('0xe'),JSON['stringify'](_0x44ac7c));if(_0x44ac7c[_0xfff4('0x11')]){if(_0x44ac7c[_0xfff4('0x11')][_0xfff4('0x12')]===0x1f4){logger[_0xfff4('0x11')](_0xfff4('0x13'),_0x5965f9,_0x44ac7c[_0xfff4('0x11')][_0xfff4('0x14')]);return _0x4e482b(_0x44ac7c['error'][_0xfff4('0x14')]);}logger[_0xfff4('0x11')](_0xfff4('0x13'),_0x5965f9,_0x44ac7c[_0xfff4('0x11')]['message']);return _0x341589(_0x44ac7c['error'][_0xfff4('0x14')]);}else{logger['info'](_0xfff4('0x13'),_0x5965f9,_0xfff4('0xe'));_0x341589(_0x44ac7c['result'][_0xfff4('0x14')]);}})[_0xfff4('0x15')](function(_0x495dc4){logger[_0xfff4('0x11')](_0xfff4('0x13'),_0x5965f9,_0x495dc4);_0x4e482b(_0x495dc4);});});} \ No newline at end of file +var _0xd756=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','then','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x2eb670,_0x5ab075){var _0x39876d=function(_0x1b21e0){while(--_0x1b21e0){_0x2eb670['push'](_0x2eb670['shift']());}};_0x39876d(++_0x5ab075);}(_0xd756,0x68));var _0x6d75=function(_0x585b63,_0x439a74){_0x585b63=_0x585b63-0x0;var _0x586589=_0xd756[_0x585b63];return _0x586589;};'use strict';var _=require(_0x6d75('0x0'));var util=require(_0x6d75('0x1'));var moment=require(_0x6d75('0x2'));var BPromise=require(_0x6d75('0x3'));var rs=require(_0x6d75('0x4'));var fs=require('fs');var Redis=require(_0x6d75('0x5'));var db=require(_0x6d75('0x6'))['db'];var utils=require(_0x6d75('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x6d75('0x8'));var client=jayson[_0x6d75('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41ea06,_0x18904c,_0x3caaba){return new BPromise(function(_0x3910f2,_0xa5a3d7){return client['request'](_0x41ea06,_0x3caaba)[_0x6d75('0xa')](function(_0x45280e){logger['info'](_0x6d75('0xb'),_0x18904c,_0x6d75('0xc'));logger[_0x6d75('0xd')](_0x6d75('0xe'),_0x18904c,_0x6d75('0xc'),JSON[_0x6d75('0xf')](_0x45280e));if(_0x45280e[_0x6d75('0x10')]){if(_0x45280e[_0x6d75('0x10')][_0x6d75('0x11')]===0x1f4){logger[_0x6d75('0x10')](_0x6d75('0xb'),_0x18904c,_0x45280e[_0x6d75('0x10')][_0x6d75('0x12')]);return _0xa5a3d7(_0x45280e[_0x6d75('0x10')][_0x6d75('0x12')]);}logger[_0x6d75('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x18904c,_0x45280e['error']['message']);return _0x3910f2(_0x45280e[_0x6d75('0x10')][_0x6d75('0x12')]);}else{logger['info']('MailTransferReport,\x20%s,\x20%s',_0x18904c,_0x6d75('0xc'));_0x3910f2(_0x45280e[_0x6d75('0x13')]['message']);}})[_0x6d75('0x14')](function(_0x57308c){logger[_0x6d75('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x18904c,_0x57308c);_0xa5a3d7(_0x57308c);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 30f40cb..f598538 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 _0xdb6b=['../../config/environment','./memberReport.controller','get','isAuthenticated','index','describe','/:id','show','create','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x462c25,_0x8c4f78){var _0x2e57b5=function(_0x1850c3){while(--_0x1850c3){_0x462c25['push'](_0x462c25['shift']());}};_0x2e57b5(++_0x8c4f78);}(_0xdb6b,0x172));var _0xbdb6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xdb6b[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xbdb6('0x0'));var util=require(_0xbdb6('0x1'));var path=require(_0xbdb6('0x2'));var timeout=require(_0xbdb6('0x3'));var express=require(_0xbdb6('0x4'));var router=express['Router']();var fs_extra=require(_0xbdb6('0x5'));var auth=require(_0xbdb6('0x6'));var interaction=require(_0xbdb6('0x7'));var config=require(_0xbdb6('0x8'));var controller=require(_0xbdb6('0x9'));router[_0xbdb6('0xa')]('/',auth[_0xbdb6('0xb')](),controller[_0xbdb6('0xc')]);router['get']('/describe',auth[_0xbdb6('0xb')](),controller[_0xbdb6('0xd')]);router[_0xbdb6('0xa')](_0xbdb6('0xe'),auth[_0xbdb6('0xb')](),controller[_0xbdb6('0xf')]);router['post']('/',auth[_0xbdb6('0xb')](),controller[_0xbdb6('0x10')]);router[_0xbdb6('0x11')](_0xbdb6('0xe'),auth[_0xbdb6('0xb')](),controller[_0xbdb6('0x12')]);router[_0xbdb6('0x13')](_0xbdb6('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0xbdb6('0x14')]=router; \ No newline at end of file +var _0xe922=['path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./memberReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util'];(function(_0x270a54,_0x307ff6){var _0x4d07d0=function(_0x59ac5a){while(--_0x59ac5a){_0x270a54['push'](_0x270a54['shift']());}};_0x4d07d0(++_0x307ff6);}(_0xe922,0x178));var _0x2e92=function(_0xa99357,_0x50ffad){_0xa99357=_0xa99357-0x0;var _0x111875=_0xe922[_0xa99357];return _0x111875;};'use strict';var multer=require(_0x2e92('0x0'));var util=require(_0x2e92('0x1'));var path=require(_0x2e92('0x2'));var timeout=require('connect-timeout');var express=require(_0x2e92('0x3'));var router=express[_0x2e92('0x4')]();var fs_extra=require(_0x2e92('0x5'));var auth=require(_0x2e92('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2e92('0x7'));var controller=require(_0x2e92('0x8'));router[_0x2e92('0x9')]('/',auth[_0x2e92('0xa')](),controller['index']);router['get'](_0x2e92('0xb'),auth[_0x2e92('0xa')](),controller[_0x2e92('0xc')]);router[_0x2e92('0x9')](_0x2e92('0xd'),auth['isAuthenticated'](),controller[_0x2e92('0xe')]);router[_0x2e92('0xf')]('/',auth[_0x2e92('0xa')](),controller[_0x2e92('0x10')]);router[_0x2e92('0x11')]('/:id',auth[_0x2e92('0xa')](),controller['update']);router[_0x2e92('0x12')](_0x2e92('0xd'),auth[_0x2e92('0xa')](),controller[_0x2e92('0x13')]);module[_0x2e92('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 f506637..0ac2d61 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 _0x5640=['diff','seconds','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','talk:[queue]','sequelize','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE'];(function(_0x4fb789,_0x6b8092){var _0x49b5e4=function(_0x256537){while(--_0x256537){_0x4fb789['push'](_0x4fb789['shift']());}};_0x49b5e4(++_0x6b8092);}(_0x5640,0x111));var _0x0564=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x5640[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0x0564('0x0'));var moment=require('moment');module[_0x0564('0x1')]={'channel':{'type':Sequelize[_0x0564('0x2')]},'membername':{'type':Sequelize[_0x0564('0x2')]},'interface':{'type':Sequelize[_0x0564('0x2')]},'type':{'type':Sequelize[_0x0564('0x2')],'defaultValue':_0x0564('0x3'),'comment':_0x0564('0x4')},'duration':{'type':Sequelize[_0x0564('0x5')]},'enterAt':{'type':Sequelize[_0x0564('0x6')]},'exitAt':{'type':Sequelize[_0x0564('0x6')],'set':function(_0x23566f){var _0x1260bf=moment(_0x23566f);var _0x3deac1=moment(this['getDataValue']('enterAt'));var _0x9e3a60=_0x1260bf[_0x0564('0x7')](_0x3deac1,_0x0564('0x8'));this[_0x0564('0x9')]('exitAt',_0x23566f);this[_0x0564('0x9')](_0x0564('0xa'),_0x9e3a60||null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x0564('0xb')},'data2':{'type':Sequelize[_0x0564('0x2')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0x0564('0x2')],'comment':_0x0564('0xc')},'data4':{'type':Sequelize[_0x0564('0x2')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize['STRING'],'comment':_0x0564('0xd')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x0564('0x5')]},'uniqueid':{'type':Sequelize[_0x0564('0x2')]}}; \ No newline at end of file +var _0xa4de=['LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','STRING','DEFAULT\x20PAUSE'];(function(_0x15781b,_0x4db9bb){var _0x20f955=function(_0x636ad0){while(--_0x636ad0){_0x15781b['push'](_0x15781b['shift']());}};_0x20f955(++_0x4db9bb);}(_0xa4de,0x10d));var _0xea4d=function(_0x28eb00,_0x5d6873){_0x28eb00=_0x28eb00-0x0;var _0x4f76aa=_0xa4de[_0x28eb00];return _0x4f76aa;};'use strict';var Sequelize=require(_0xea4d('0x0'));var moment=require('moment');module['exports']={'channel':{'type':Sequelize[_0xea4d('0x1')]},'membername':{'type':Sequelize[_0xea4d('0x1')]},'interface':{'type':Sequelize[_0xea4d('0x1')]},'type':{'type':Sequelize[_0xea4d('0x1')],'defaultValue':_0xea4d('0x2'),'comment':_0xea4d('0x3')},'duration':{'type':Sequelize[_0xea4d('0x4')]},'enterAt':{'type':Sequelize[_0xea4d('0x5')]},'exitAt':{'type':Sequelize[_0xea4d('0x5')],'set':function(_0x24d5fe){var _0x604a6a=moment(_0x24d5fe);var _0x2af8a5=moment(this['getDataValue'](_0xea4d('0x6')));var _0x4f98e8=_0x604a6a[_0xea4d('0x7')](_0x2af8a5,_0xea4d('0x8'));this[_0xea4d('0x9')](_0xea4d('0xa'),_0x24d5fe);this[_0xea4d('0x9')](_0xea4d('0xb'),_0x4f98e8||null);}},'data1':{'type':Sequelize[_0xea4d('0x1')],'comment':_0xea4d('0xc')},'data2':{'type':Sequelize[_0xea4d('0x1')],'comment':_0xea4d('0xd')},'data3':{'type':Sequelize[_0xea4d('0x1')],'comment':_0xea4d('0xe')},'data4':{'type':Sequelize['STRING'],'comment':_0xea4d('0xf')},'data5':{'type':Sequelize[_0xea4d('0x1')],'comment':_0xea4d('0x10')},'role':{'type':Sequelize[_0xea4d('0x1')]},'internal':{'type':Sequelize[_0xea4d('0x4')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index d3d9d86..ca27863 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 _0x34e8=['path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','map','MemberReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','catch','show','params','keys','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x34e8,0x12c));var _0x834e=function(_0x43110e,_0x5cbde2){_0x43110e=_0x43110e-0x0;var _0x2ec1a5=_0x34e8[_0x43110e];return _0x2ec1a5;};'use strict';var emlformat=require(_0x834e('0x0'));var rimraf=require(_0x834e('0x1'));var zipdir=require(_0x834e('0x2'));var jsonpatch=require(_0x834e('0x3'));var rp=require('request-promise');var moment=require(_0x834e('0x4'));var BPromise=require(_0x834e('0x5'));var Mustache=require(_0x834e('0x6'));var util=require(_0x834e('0x7'));var path=require(_0x834e('0x8'));var sox=require(_0x834e('0x9'));var csv=require(_0x834e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x834e('0xb'));var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0xa'));var querystring=require(_0x834e('0x10'));var Papa=require(_0x834e('0x11'));var Redis=require(_0x834e('0x12'));var authService=require(_0x834e('0x13'));var qs=require(_0x834e('0x14'));var as=require(_0x834e('0x15'));var hardwareService=require(_0x834e('0x16'));var logger=require(_0x834e('0x17'))(_0x834e('0x18'));var utils=require(_0x834e('0x19'));var config=require(_0x834e('0x1a'));var licenseUtil=require(_0x834e('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e5b6d,_0x6cd9b9){_0x6cd9b9=_0x6cd9b9||0xcc;return function(_0x58a27e){if(_0x58a27e){return _0x5e5b6d[_0x834e('0x1c')](_0x6cd9b9);}return _0x5e5b6d[_0x834e('0x1d')](_0x6cd9b9)[_0x834e('0x1e')]();};}function respondWithResult(_0x21cc0a,_0x50e860){_0x50e860=_0x50e860||0xc8;return function(_0x43156c){if(_0x43156c){return _0x21cc0a[_0x834e('0x1d')](_0x50e860)['json'](_0x43156c);}};}function respondWithFilteredResult(_0x316205,_0x4a9cdc){return function(_0x38a8cd){if(_0x38a8cd){var _0x36d443=typeof _0x4a9cdc['offset']===_0x834e('0x1f')&&typeof _0x4a9cdc[_0x834e('0x20')]===_0x834e('0x1f');var _0x50b3f6=_0x38a8cd[_0x834e('0x21')];var _0x211e9a=_0x36d443?0x0:_0x4a9cdc[_0x834e('0x22')];var _0xb993a1=_0x36d443?_0x38a8cd[_0x834e('0x21')]:_0x4a9cdc[_0x834e('0x22')]+_0x4a9cdc[_0x834e('0x20')];var _0x595515;if(_0xb993a1>=_0x50b3f6){_0xb993a1=_0x50b3f6;_0x595515=0xc8;}else{_0x595515=0xce;}_0x316205[_0x834e('0x1d')](_0x595515);return _0x316205[_0x834e('0x23')](_0x834e('0x24'),_0x211e9a+'-'+_0xb993a1+'/'+_0x50b3f6)[_0x834e('0x25')](_0x38a8cd);}return null;};}function patchUpdates(_0x4ab05d){return function(_0x45a630){try{jsonpatch[_0x834e('0x26')](_0x45a630,_0x4ab05d,!![]);}catch(_0x5a05c0){return BPromise[_0x834e('0x27')](_0x5a05c0);}return _0x45a630[_0x834e('0x28')]();};}function saveUpdates(_0x8d406e,_0x5c55ca){return function(_0x4e3f48){if(_0x4e3f48){return _0x4e3f48[_0x834e('0x29')](_0x8d406e)[_0x834e('0x2a')](function(_0x589dde){return _0x589dde;});}return null;};}function removeEntity(_0x25ee1d,_0x1dc1e0){return function(_0x58f4fd){if(_0x58f4fd){return _0x58f4fd[_0x834e('0x2b')]()[_0x834e('0x2a')](function(){_0x25ee1d[_0x834e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24fcf7,_0x3e310f){return function(_0x5e1cc5){if(!_0x5e1cc5){_0x24fcf7['sendStatus'](0x194);}return _0x5e1cc5;};}function handleError(_0x1e713a,_0x508a1d){_0x508a1d=_0x508a1d||0x1f4;return function(_0x2826ec){logger[_0x834e('0x2c')](_0x2826ec[_0x834e('0x2d')]);if(_0x2826ec[_0x834e('0x2e')]){delete _0x2826ec[_0x834e('0x2e')];}_0x1e713a[_0x834e('0x1d')](_0x508a1d)['send'](_0x2826ec);};}exports['index']=function(_0x4dc64a,_0x58c1d7){var _0x2c7a8d={},_0x567cea={},_0x106d6a={'count':0x0,'rows':[]};var _0x5dacc1=_[_0x834e('0x2f')](db[_0x834e('0x30')][_0x834e('0x31')],function(_0x1e026a){return{'name':_0x1e026a[_0x834e('0x32')],'type':_0x1e026a[_0x834e('0x33')][_0x834e('0x34')]};});_0x567cea[_0x834e('0x35')]=_[_0x834e('0x2f')](_0x5dacc1,'name');_0x567cea[_0x834e('0x36')]=_['keys'](_0x4dc64a[_0x834e('0x36')]);_0x567cea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],_0x567cea[_0x834e('0x36')]);_0x2c7a8d[_0x834e('0x39')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x4dc64a[_0x834e('0x36')]['fields']));_0x2c7a8d[_0x834e('0x39')]=_0x2c7a8d[_0x834e('0x39')][_0x834e('0x3b')]?_0x2c7a8d[_0x834e('0x39')]:_0x567cea['model'];if(!_0x4dc64a[_0x834e('0x36')][_0x834e('0x3c')]('nolimit')){_0x2c7a8d['limit']=qs['limit'](_0x4dc64a[_0x834e('0x36')][_0x834e('0x20')]);_0x2c7a8d[_0x834e('0x22')]=qs[_0x834e('0x22')](_0x4dc64a[_0x834e('0x36')][_0x834e('0x22')]);}_0x2c7a8d['order']=qs[_0x834e('0x3d')](_0x4dc64a['query'][_0x834e('0x3d')]);_0x2c7a8d[_0x834e('0x3e')]=qs['filters'](_[_0x834e('0x3f')](_0x4dc64a[_0x834e('0x36')],_0x567cea['filters']),_0x5dacc1);if(_0x4dc64a['query'][_0x834e('0x40')]){_0x2c7a8d[_0x834e('0x3e')]=_[_0x834e('0x41')](_0x2c7a8d[_0x834e('0x3e')],{'$or':_[_0x834e('0x2f')](_0x5dacc1,function(_0x4ca43c){if(_0x4ca43c[_0x834e('0x33')]!=='VIRTUAL'){var _0x50c243={};_0x50c243[_0x4ca43c[_0x834e('0x2e')]]={'$like':'%'+_0x4dc64a['query'][_0x834e('0x40')]+'%'};return _0x50c243;}})});}_0x2c7a8d=_[_0x834e('0x41')]({},_0x2c7a8d,_0x4dc64a[_0x834e('0x42')]);var _0x3c59af={'where':_0x2c7a8d[_0x834e('0x3e')]};return db['MemberReport'][_0x834e('0x21')](_0x3c59af)[_0x834e('0x2a')](function(_0x38f266){_0x106d6a['count']=_0x38f266;if(_0x4dc64a[_0x834e('0x36')][_0x834e('0x43')]){_0x2c7a8d['include']=[{'all':!![]}];}return db[_0x834e('0x30')]['findAll'](_0x2c7a8d);})[_0x834e('0x2a')](function(_0x585335){_0x106d6a['rows']=_0x585335;return _0x106d6a;})['then'](respondWithFilteredResult(_0x58c1d7,_0x2c7a8d))[_0x834e('0x44')](handleError(_0x58c1d7,null));};exports[_0x834e('0x45')]=function(_0x3bcbf4,_0xbc1571){var _0x8ad264={'raw':!![],'where':{'id':_0x3bcbf4[_0x834e('0x46')]['id']}},_0x23feea={};_0x23feea['model']=_[_0x834e('0x47')](db['MemberReport'][_0x834e('0x31')]);_0x23feea['query']=_[_0x834e('0x47')](_0x3bcbf4['query']);_0x23feea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x23feea['model'],_0x23feea[_0x834e('0x36')]);_0x8ad264[_0x834e('0x39')]=_[_0x834e('0x38')](_0x23feea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x3bcbf4[_0x834e('0x36')][_0x834e('0x3a')]));_0x8ad264[_0x834e('0x39')]=_0x8ad264[_0x834e('0x39')][_0x834e('0x3b')]?_0x8ad264['attributes']:_0x23feea[_0x834e('0x35')];if(_0x3bcbf4[_0x834e('0x36')]['includeAll']){_0x8ad264[_0x834e('0x48')]=[{'all':!![]}];}_0x8ad264=_[_0x834e('0x41')]({},_0x8ad264,_0x3bcbf4[_0x834e('0x42')]);return db[_0x834e('0x30')][_0x834e('0x49')](_0x8ad264)[_0x834e('0x2a')](handleEntityNotFound(_0xbc1571,null))['then'](respondWithResult(_0xbc1571,null))['catch'](handleError(_0xbc1571,null));};exports[_0x834e('0x4a')]=function(_0x1a5444,_0x30568e){return db[_0x834e('0x30')][_0x834e('0x4a')](_0x1a5444[_0x834e('0x4b')],{})[_0x834e('0x2a')](respondWithResult(_0x30568e,0xc9))[_0x834e('0x44')](handleError(_0x30568e,null));};exports[_0x834e('0x29')]=function(_0x390c45,_0xf02f0d){if(_0x390c45[_0x834e('0x4b')]['id']){delete _0x390c45[_0x834e('0x4b')]['id'];}return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x390c45[_0x834e('0x46')]['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0xf02f0d,null))[_0x834e('0x2a')](saveUpdates(_0x390c45[_0x834e('0x4b')],null))[_0x834e('0x2a')](respondWithResult(_0xf02f0d,null))['catch'](handleError(_0xf02f0d,null));};exports[_0x834e('0x2b')]=function(_0x1f08b9,_0x4e73e0){return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x1f08b9['params']['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0x4e73e0,null))[_0x834e('0x2a')](removeEntity(_0x4e73e0,null))[_0x834e('0x44')](handleError(_0x4e73e0,null));};exports[_0x834e('0x4c')]=function(_0x4288e4,_0xb77aab){return db[_0x834e('0x30')]['describe']()[_0x834e('0x2a')](respondWithResult(_0xb77aab,null))[_0x834e('0x44')](handleError(_0xb77aab,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(_0x45494,_0x1040a5){var _0x2ee547=function(_0x8d38d8){while(--_0x8d38d8){_0x45494['push'](_0x45494['shift']());}};_0x2ee547(++_0x1040a5);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['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 9c98f5a..e5d98e0 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 _0xd20a=['rimraf','./memberReport.attributes','exports','define','report_member','membername_interface','interface','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x4d5a55,_0x434f92){var _0x520249=function(_0x454eb0){while(--_0x454eb0){_0x4d5a55['push'](_0x4d5a55['shift']());}};_0x520249(++_0x434f92);}(_0xd20a,0xcb));var _0xad20=function(_0x1abd98,_0x4efa0b){_0x1abd98=_0x1abd98-0x0;var _0x547194=_0xd20a[_0x1abd98];return _0x547194;};'use strict';var _=require(_0xad20('0x0'));var util=require(_0xad20('0x1'));var logger=require('../../config/logger')(_0xad20('0x2'));var moment=require(_0xad20('0x3'));var BPromise=require(_0xad20('0x4'));var rp=require(_0xad20('0x5'));var fs=require('fs');var path=require(_0xad20('0x6'));var rimraf=require(_0xad20('0x7'));var config=require('../../config/environment');var attributes=require(_0xad20('0x8'));module[_0xad20('0x9')]=function(_0x48a683,_0x21d5c4){return _0x48a683[_0xad20('0xa')]('MemberReport',attributes,{'tableName':_0xad20('0xb'),'paranoid':![],'indexes':[{'name':_0xad20('0xc'),'fields':['membername',_0xad20('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x14f4=['../../config/environment','./memberReport.attributes','exports','define','MemberReport','membername_interface','membername','interface','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x37dc8c,_0x24823f){var _0x4823d4=function(_0x5d4d87){while(--_0x5d4d87){_0x37dc8c['push'](_0x37dc8c['shift']());}};_0x4823d4(++_0x24823f);}(_0x14f4,0x1d9));var _0x414f=function(_0x9373ca,_0x575a43){_0x9373ca=_0x9373ca-0x0;var _0x37eced=_0x14f4[_0x9373ca];return _0x37eced;};'use strict';var _=require('lodash');var util=require(_0x414f('0x0'));var logger=require(_0x414f('0x1'))(_0x414f('0x2'));var moment=require(_0x414f('0x3'));var BPromise=require(_0x414f('0x4'));var rp=require(_0x414f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x414f('0x6'));var config=require(_0x414f('0x7'));var attributes=require(_0x414f('0x8'));module[_0x414f('0x9')]=function(_0x49b714,_0x273f8b){return _0x49b714[_0x414f('0xa')](_0x414f('0xb'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x414f('0xc'),'fields':[_0x414f('0xd'),_0x414f('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index f0e70e6..acca0f1 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 _0xaa48=['result','GetMemberReport','findAll','raw','options','where','attributes','limit','include','model','map','debug','catch','CreateMemberReport','MemberReport','body','UpdateMemberReport','update','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','MemberReport,\x20%s,\x20%s','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x2f5f2b,_0x7112b2){var _0xab6a83=function(_0x35f519){while(--_0x35f519){_0x2f5f2b['push'](_0x2f5f2b['shift']());}};_0xab6a83(++_0x7112b2);}(_0xaa48,0x15a));var _0x8aa4=function(_0x5167d5,_0x4b941f){_0x5167d5=_0x5167d5-0x0;var _0x4c33a8=_0xaa48[_0x5167d5];return _0x4c33a8;};'use strict';var _=require(_0x8aa4('0x0'));var util=require(_0x8aa4('0x1'));var moment=require(_0x8aa4('0x2'));var BPromise=require(_0x8aa4('0x3'));var rs=require(_0x8aa4('0x4'));var fs=require('fs');var Redis=require(_0x8aa4('0x5'));var db=require(_0x8aa4('0x6'))['db'];var utils=require(_0x8aa4('0x7'));var logger=require(_0x8aa4('0x8'))(_0x8aa4('0x9'));var config=require(_0x8aa4('0xa'));var jayson=require(_0x8aa4('0xb'));var client=jayson[_0x8aa4('0xc')][_0x8aa4('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x17bf06,_0x111c1d,_0x37498b){return new BPromise(function(_0xa5c92e,_0x17b04d){return client['request'](_0x17bf06,_0x37498b)[_0x8aa4('0xe')](function(_0x1e7e28){logger['info'](_0x8aa4('0xf'),_0x111c1d,_0x8aa4('0x10'));logger['debug'](_0x8aa4('0x11'),_0x111c1d,_0x8aa4('0x10'),JSON[_0x8aa4('0x12')](_0x1e7e28));if(_0x1e7e28[_0x8aa4('0x13')]){if(_0x1e7e28[_0x8aa4('0x13')][_0x8aa4('0x14')]===0x1f4){logger[_0x8aa4('0x13')](_0x8aa4('0xf'),_0x111c1d,_0x1e7e28[_0x8aa4('0x13')][_0x8aa4('0x15')]);return _0x17b04d(_0x1e7e28['error']['message']);}logger[_0x8aa4('0x13')](_0x8aa4('0xf'),_0x111c1d,_0x1e7e28[_0x8aa4('0x13')][_0x8aa4('0x15')]);return _0xa5c92e(_0x1e7e28[_0x8aa4('0x13')][_0x8aa4('0x15')]);}else{logger[_0x8aa4('0x16')](_0x8aa4('0xf'),_0x111c1d,_0x8aa4('0x10'));_0xa5c92e(_0x1e7e28[_0x8aa4('0x17')]['message']);}})['catch'](function(_0x5d1819){logger[_0x8aa4('0x13')](_0x8aa4('0xf'),_0x111c1d,_0x5d1819);_0x17b04d(_0x5d1819);});});}exports[_0x8aa4('0x18')]=function(_0x37cc28){var _0x5313a6=this;return new Promise(function(_0xa765ce,_0x1659d3){return db['MemberReport'][_0x8aa4('0x19')]({'raw':_0x37cc28['options']?_0x37cc28['options'][_0x8aa4('0x1a')]===undefined?!![]:![]:!![],'where':_0x37cc28['options']?_0x37cc28[_0x8aa4('0x1b')][_0x8aa4('0x1c')]||null:null,'attributes':_0x37cc28['options']?_0x37cc28[_0x8aa4('0x1b')][_0x8aa4('0x1d')]||null:null,'limit':_0x37cc28['options']?_0x37cc28[_0x8aa4('0x1b')][_0x8aa4('0x1e')]||null:null,'include':_0x37cc28[_0x8aa4('0x1b')]?_0x37cc28[_0x8aa4('0x1b')][_0x8aa4('0x1f')]?_['map'](_0x37cc28['options']['include'],function(_0x4984f9){return{'model':db[_0x4984f9[_0x8aa4('0x20')]],'as':_0x4984f9['as'],'attributes':_0x4984f9['attributes'],'include':_0x4984f9[_0x8aa4('0x1f')]?_[_0x8aa4('0x21')](_0x4984f9[_0x8aa4('0x1f')],function(_0x387434){return{'model':db[_0x387434['model']],'as':_0x387434['as'],'attributes':_0x387434['attributes'],'include':_0x387434[_0x8aa4('0x1f')]?_['map'](_0x387434[_0x8aa4('0x1f')],function(_0x4145ed){return{'model':db[_0x4145ed['model']],'as':_0x4145ed['as'],'attributes':_0x4145ed[_0x8aa4('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x39ce27){logger['info'](_0x8aa4('0x18'),_0x37cc28);logger[_0x8aa4('0x22')](_0x8aa4('0x18'),_0x37cc28,JSON[_0x8aa4('0x12')](_0x39ce27));_0xa765ce(_0x39ce27);})[_0x8aa4('0x23')](function(_0x4ba8b8){logger['error']('GetMemberReport',_0x4ba8b8[_0x8aa4('0x15')],_0x37cc28);_0x1659d3(_0x5313a6[_0x8aa4('0x13')](0x1f4,_0x4ba8b8['message']));});});};exports[_0x8aa4('0x24')]=function(_0x1f452e){var _0x3e4595=this;return new Promise(function(_0x3633d1,_0x31443b){return db[_0x8aa4('0x25')]['create'](_0x1f452e[_0x8aa4('0x26')],{'raw':_0x1f452e['options']?_0x1f452e['options'][_0x8aa4('0x1a')]===undefined?!![]:![]:!![]})[_0x8aa4('0xe')](function(_0x1cecce){logger[_0x8aa4('0x16')](_0x8aa4('0x24'),_0x1f452e);logger['debug'](_0x8aa4('0x24'),_0x1f452e,JSON[_0x8aa4('0x12')](_0x1cecce));_0x3633d1(_0x1cecce);})[_0x8aa4('0x23')](function(_0x4ba360){logger['error']('CreateMemberReport',_0x4ba360['message'],_0x1f452e);_0x31443b(_0x3e4595[_0x8aa4('0x13')](0x1f4,_0x4ba360[_0x8aa4('0x15')]));});});};exports[_0x8aa4('0x27')]=function(_0x10d821){var _0x4e3eb0=this;return new Promise(function(_0x5e85a6,_0x1765b7){return db[_0x8aa4('0x25')][_0x8aa4('0x28')](_0x10d821[_0x8aa4('0x26')],{'raw':_0x10d821[_0x8aa4('0x1b')]?_0x10d821['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10d821[_0x8aa4('0x1b')]?_0x10d821[_0x8aa4('0x1b')][_0x8aa4('0x1c')]||null:null,'attributes':_0x10d821['options']?_0x10d821[_0x8aa4('0x1b')][_0x8aa4('0x1d')]||null:null,'limit':_0x10d821['options']?_0x10d821[_0x8aa4('0x1b')][_0x8aa4('0x1e')]||null:null})[_0x8aa4('0xe')](function(_0x54c6d9){logger[_0x8aa4('0x16')]('UpdateMemberReport',_0x10d821);logger['debug'](_0x8aa4('0x27'),_0x10d821,JSON['stringify'](_0x54c6d9));_0x5e85a6(_0x54c6d9);})[_0x8aa4('0x23')](function(_0x29d058){logger['error'](_0x8aa4('0x27'),_0x29d058[_0x8aa4('0x15')],_0x10d821);_0x1765b7(_0x4e3eb0[_0x8aa4('0x13')](0x1f4,_0x29d058[_0x8aa4('0x15')]));});});}; \ No newline at end of file +var _0x29b7=['update','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','MemberReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','limit','include','map','model','create','CreateMemberReport','UpdateMemberReport'];(function(_0x13504e,_0xd1c4c1){var _0x3489ee=function(_0x3305ea){while(--_0x3305ea){_0x13504e['push'](_0x13504e['shift']());}};_0x3489ee(++_0xd1c4c1);}(_0x29b7,0x17d));var _0x729b=function(_0x29ebb0,_0x36ee9d){_0x29ebb0=_0x29ebb0-0x0;var _0x22f23a=_0x29b7[_0x29ebb0];return _0x22f23a;};'use strict';var _=require('lodash');var util=require(_0x729b('0x0'));var moment=require(_0x729b('0x1'));var BPromise=require(_0x729b('0x2'));var rs=require(_0x729b('0x3'));var fs=require('fs');var Redis=require(_0x729b('0x4'));var db=require(_0x729b('0x5'))['db'];var utils=require(_0x729b('0x6'));var logger=require(_0x729b('0x7'))('rpc');var config=require(_0x729b('0x8'));var jayson=require(_0x729b('0x9'));var client=jayson['client'][_0x729b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x161396,_0xf72e6d,_0x2c4252){return new BPromise(function(_0x4d75fd,_0x3df326){return client[_0x729b('0xb')](_0x161396,_0x2c4252)[_0x729b('0xc')](function(_0x1ae4e3){logger[_0x729b('0xd')](_0x729b('0xe'),_0xf72e6d,'request\x20sent');logger[_0x729b('0xf')]('MemberReport,\x20%s,\x20%s,\x20%s',_0xf72e6d,_0x729b('0x10'),JSON[_0x729b('0x11')](_0x1ae4e3));if(_0x1ae4e3[_0x729b('0x12')]){if(_0x1ae4e3['error'][_0x729b('0x13')]===0x1f4){logger[_0x729b('0x12')](_0x729b('0xe'),_0xf72e6d,_0x1ae4e3[_0x729b('0x12')][_0x729b('0x14')]);return _0x3df326(_0x1ae4e3['error'][_0x729b('0x14')]);}logger[_0x729b('0x12')]('MemberReport,\x20%s,\x20%s',_0xf72e6d,_0x1ae4e3[_0x729b('0x12')][_0x729b('0x14')]);return _0x4d75fd(_0x1ae4e3[_0x729b('0x12')][_0x729b('0x14')]);}else{logger[_0x729b('0xd')]('MemberReport,\x20%s,\x20%s',_0xf72e6d,'request\x20sent');_0x4d75fd(_0x1ae4e3[_0x729b('0x15')][_0x729b('0x14')]);}})[_0x729b('0x16')](function(_0x22b0d6){logger['error'](_0x729b('0xe'),_0xf72e6d,_0x22b0d6);_0x3df326(_0x22b0d6);});});}exports[_0x729b('0x17')]=function(_0x58fce1){var _0x10e303=this;return new Promise(function(_0x36a23e,_0x45af11){return db[_0x729b('0x18')][_0x729b('0x19')]({'raw':_0x58fce1['options']?_0x58fce1[_0x729b('0x1a')][_0x729b('0x1b')]===undefined?!![]:![]:!![],'where':_0x58fce1['options']?_0x58fce1[_0x729b('0x1a')][_0x729b('0x1c')]||null:null,'attributes':_0x58fce1['options']?_0x58fce1['options'][_0x729b('0x1d')]||null:null,'limit':_0x58fce1[_0x729b('0x1a')]?_0x58fce1[_0x729b('0x1a')][_0x729b('0x1e')]||null:null,'include':_0x58fce1[_0x729b('0x1a')]?_0x58fce1[_0x729b('0x1a')][_0x729b('0x1f')]?_[_0x729b('0x20')](_0x58fce1['options'][_0x729b('0x1f')],function(_0x378c4d){return{'model':db[_0x378c4d[_0x729b('0x21')]],'as':_0x378c4d['as'],'attributes':_0x378c4d[_0x729b('0x1d')],'include':_0x378c4d[_0x729b('0x1f')]?_['map'](_0x378c4d[_0x729b('0x1f')],function(_0x2d127e){return{'model':db[_0x2d127e['model']],'as':_0x2d127e['as'],'attributes':_0x2d127e[_0x729b('0x1d')],'include':_0x2d127e['include']?_['map'](_0x2d127e[_0x729b('0x1f')],function(_0x376a22){return{'model':db[_0x376a22[_0x729b('0x21')]],'as':_0x376a22['as'],'attributes':_0x376a22[_0x729b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x729b('0xc')](function(_0x4ab773){logger[_0x729b('0xd')](_0x729b('0x17'),_0x58fce1);logger[_0x729b('0xf')](_0x729b('0x17'),_0x58fce1,JSON[_0x729b('0x11')](_0x4ab773));_0x36a23e(_0x4ab773);})[_0x729b('0x16')](function(_0x41fe6a){logger[_0x729b('0x12')]('GetMemberReport',_0x41fe6a[_0x729b('0x14')],_0x58fce1);_0x45af11(_0x10e303[_0x729b('0x12')](0x1f4,_0x41fe6a[_0x729b('0x14')]));});});};exports['CreateMemberReport']=function(_0x18d4fa){var _0x277962=this;return new Promise(function(_0x3babe2,_0x52c9f9){return db[_0x729b('0x18')][_0x729b('0x22')](_0x18d4fa['body'],{'raw':_0x18d4fa[_0x729b('0x1a')]?_0x18d4fa['options'][_0x729b('0x1b')]===undefined?!![]:![]:!![]})[_0x729b('0xc')](function(_0x4859a3){logger[_0x729b('0xd')](_0x729b('0x23'),_0x18d4fa);logger[_0x729b('0xf')](_0x729b('0x23'),_0x18d4fa,JSON[_0x729b('0x11')](_0x4859a3));_0x3babe2(_0x4859a3);})[_0x729b('0x16')](function(_0x4ebed5){logger[_0x729b('0x12')](_0x729b('0x23'),_0x4ebed5[_0x729b('0x14')],_0x18d4fa);_0x52c9f9(_0x277962[_0x729b('0x12')](0x1f4,_0x4ebed5[_0x729b('0x14')]));});});};exports[_0x729b('0x24')]=function(_0x48933c){var _0x1a9366=this;return new Promise(function(_0x21e3b7,_0x5e2528){return db[_0x729b('0x18')][_0x729b('0x25')](_0x48933c['body'],{'raw':_0x48933c[_0x729b('0x1a')]?_0x48933c[_0x729b('0x1a')][_0x729b('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48933c[_0x729b('0x1a')]?_0x48933c[_0x729b('0x1a')][_0x729b('0x1c')]||null:null,'attributes':_0x48933c[_0x729b('0x1a')]?_0x48933c[_0x729b('0x1a')][_0x729b('0x1d')]||null:null,'limit':_0x48933c[_0x729b('0x1a')]?_0x48933c['options'][_0x729b('0x1e')]||null:null})[_0x729b('0xc')](function(_0x42a2a3){logger[_0x729b('0xd')]('UpdateMemberReport',_0x48933c);logger[_0x729b('0xf')](_0x729b('0x24'),_0x48933c,JSON[_0x729b('0x11')](_0x42a2a3));_0x21e3b7(_0x42a2a3);})['catch'](function(_0x50cd92){logger[_0x729b('0x12')](_0x729b('0x24'),_0x50cd92['message'],_0x48933c);_0x5e2528(_0x1a9366[_0x729b('0x12')](0x1f4,_0x50cd92[_0x729b('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 1264a7e..7adf364 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 _0x88e3=['get','index','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./migration.controller'];(function(_0x5efa4b,_0x40d22c){var _0x1b7f87=function(_0x4f765e){while(--_0x4f765e){_0x5efa4b['push'](_0x5efa4b['shift']());}};_0x1b7f87(++_0x40d22c);}(_0x88e3,0xa3));var _0x388e=function(_0x381379,_0x3f3b86){_0x381379=_0x381379-0x0;var _0x3e1063=_0x88e3[_0x381379];return _0x3e1063;};'use strict';var multer=require('multer');var util=require(_0x388e('0x0'));var path=require(_0x388e('0x1'));var timeout=require(_0x388e('0x2'));var express=require(_0x388e('0x3'));var router=express['Router']();var fs_extra=require(_0x388e('0x4'));var auth=require(_0x388e('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x388e('0x6'));router[_0x388e('0x7')]('/',controller[_0x388e('0x8')]);module[_0x388e('0x9')]=router; \ No newline at end of file +var _0x44ff=['../../config/environment','index','exports','util','path','connect-timeout','../../components/interaction/service'];(function(_0xd87687,_0x2c85fb){var _0x5a4c2e=function(_0x4eda0c){while(--_0x4eda0c){_0xd87687['push'](_0xd87687['shift']());}};_0x5a4c2e(++_0x2c85fb);}(_0x44ff,0x1c3));var _0xf44f=function(_0x283495,_0x5998b2){_0x283495=_0x283495-0x0;var _0x1b91d2=_0x44ff[_0x283495];return _0x1b91d2;};'use strict';var multer=require('multer');var util=require(_0xf44f('0x0'));var path=require(_0xf44f('0x1'));var timeout=require(_0xf44f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf44f('0x3'));var config=require(_0xf44f('0x4'));var controller=require('./migration.controller');router['get']('/',controller[_0xf44f('0x5')]);module[_0xf44f('0x6')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 949ef25..cea0659 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 _0x1a76=['STRING','version'];(function(_0x4a6fd0,_0x29621a){var _0x318b5a=function(_0x595e5a){while(--_0x595e5a){_0x4a6fd0['push'](_0x4a6fd0['shift']());}};_0x318b5a(++_0x29621a);}(_0x1a76,0x124));var _0x61a7=function(_0x5a401e,_0x2de782){_0x5a401e=_0x5a401e-0x0;var _0x2aa2cc=_0x1a76[_0x5a401e];return _0x2aa2cc;};'use strict';var Sequelize=require('sequelize');module['exports']={'version':{'type':Sequelize[_0x61a7('0x0')],'unique':_0x61a7('0x1')}}; \ No newline at end of file +var _0x37d9=['sequelize','exports','STRING','version'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x37d9,0x154));var _0x937d=function(_0x216edc,_0x57df05){_0x216edc=_0x216edc-0x0;var _0x745d3e=_0x37d9[_0x216edc];return _0x745d3e;};'use strict';var Sequelize=require(_0x937d('0x0'));module[_0x937d('0x1')]={'version':{'type':Sequelize[_0x937d('0x2')],'unique':_0x937d('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index e9be7cb..d5c34a3 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 _0x3824=['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','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','stack','name','send','index','Migration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch'];(function(_0x1fd675,_0x165dfe){var _0x16b554=function(_0x5761ff){while(--_0x5761ff){_0x1fd675['push'](_0x1fd675['shift']());}};_0x16b554(++_0x165dfe);}(_0x3824,0xcf));var _0x4382=function(_0x4cee4b,_0x1dfff3){_0x4cee4b=_0x4cee4b-0x0;var _0x4d891d=_0x3824[_0x4cee4b];return _0x4d891d;};'use strict';var emlformat=require(_0x4382('0x0'));var rimraf=require(_0x4382('0x1'));var zipdir=require(_0x4382('0x2'));var jsonpatch=require(_0x4382('0x3'));var rp=require('request-promise');var moment=require(_0x4382('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4382('0x5'));var util=require(_0x4382('0x6'));var path=require(_0x4382('0x7'));var sox=require(_0x4382('0x8'));var csv=require(_0x4382('0x9'));var ejs=require(_0x4382('0xa'));var fs=require('fs');var fs_extra=require(_0x4382('0xb'));var _=require(_0x4382('0xc'));var squel=require(_0x4382('0xd'));var crypto=require(_0x4382('0xe'));var jsforce=require(_0x4382('0xf'));var deskjs=require(_0x4382('0x10'));var toCsv=require(_0x4382('0x9'));var querystring=require(_0x4382('0x11'));var Papa=require(_0x4382('0x12'));var Redis=require(_0x4382('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x4382('0x14'));var as=require(_0x4382('0x15'));var hardwareService=require(_0x4382('0x16'));var logger=require(_0x4382('0x17'))(_0x4382('0x18'));var utils=require('../../config/utils');var config=require(_0x4382('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x4382('0x1a'))['db'];function respondWithStatusCode(_0x3929a1,_0x2a3041){_0x2a3041=_0x2a3041||0xcc;return function(_0x4b4ce1){if(_0x4b4ce1){return _0x3929a1[_0x4382('0x1b')](_0x2a3041);}return _0x3929a1[_0x4382('0x1c')](_0x2a3041)[_0x4382('0x1d')]();};}function respondWithResult(_0x1ae762,_0x31600b){_0x31600b=_0x31600b||0xc8;return function(_0x1f256f){if(_0x1f256f){return _0x1ae762['status'](_0x31600b)[_0x4382('0x1e')](_0x1f256f);}};}function respondWithFilteredResult(_0x991ba0,_0x4a8397){return function(_0x451ed0){if(_0x451ed0){var _0x36cde4=typeof _0x4a8397[_0x4382('0x1f')]===_0x4382('0x20')&&typeof _0x4a8397[_0x4382('0x21')]===_0x4382('0x20');var _0x268216=_0x451ed0[_0x4382('0x22')];var _0x5d7af4=_0x36cde4?0x0:_0x4a8397['offset'];var _0x1363fd=_0x36cde4?_0x451ed0[_0x4382('0x22')]:_0x4a8397[_0x4382('0x1f')]+_0x4a8397['limit'];var _0x1ffd65;if(_0x1363fd>=_0x268216){_0x1363fd=_0x268216;_0x1ffd65=0xc8;}else{_0x1ffd65=0xce;}_0x991ba0[_0x4382('0x1c')](_0x1ffd65);return _0x991ba0['set'](_0x4382('0x23'),_0x5d7af4+'-'+_0x1363fd+'/'+_0x268216)[_0x4382('0x1e')](_0x451ed0);}return null;};}function patchUpdates(_0x102528){return function(_0x139087){try{jsonpatch[_0x4382('0x24')](_0x139087,_0x102528,!![]);}catch(_0x2f6217){return BPromise['reject'](_0x2f6217);}return _0x139087[_0x4382('0x25')]();};}function saveUpdates(_0x318f91,_0x39a240){return function(_0x51cb22){if(_0x51cb22){return _0x51cb22[_0x4382('0x26')](_0x318f91)[_0x4382('0x27')](function(_0x21c9fd){return _0x21c9fd;});}return null;};}function removeEntity(_0x111cf4,_0x40e95c){return function(_0x328822){if(_0x328822){return _0x328822['destroy']()[_0x4382('0x27')](function(){_0x111cf4[_0x4382('0x1c')](0xcc)[_0x4382('0x1d')]();});}};}function handleEntityNotFound(_0xb1f06,_0x17043c){return function(_0x2f4770){if(!_0x2f4770){_0xb1f06[_0x4382('0x1b')](0x194);}return _0x2f4770;};}function handleError(_0x34a863,_0x16e28d){_0x16e28d=_0x16e28d||0x1f4;return function(_0x6ba3db){logger['error'](_0x6ba3db[_0x4382('0x28')]);if(_0x6ba3db[_0x4382('0x29')]){delete _0x6ba3db['name'];}_0x34a863[_0x4382('0x1c')](_0x16e28d)[_0x4382('0x2a')](_0x6ba3db);};}exports[_0x4382('0x2b')]=function(_0x1ced8e,_0x4c4061){var _0x430ff2={},_0x2f29f9={},_0xfb2601={'count':0x0,'rows':[]};var _0x261c13=_['map'](db[_0x4382('0x2c')][_0x4382('0x2d')],function(_0x5207f9){return{'name':_0x5207f9[_0x4382('0x2e')],'type':_0x5207f9[_0x4382('0x2f')][_0x4382('0x30')]};});_0x2f29f9[_0x4382('0x31')]=_[_0x4382('0x32')](_0x261c13,_0x4382('0x29'));_0x2f29f9[_0x4382('0x33')]=_[_0x4382('0x34')](_0x1ced8e[_0x4382('0x33')]);_0x2f29f9[_0x4382('0x35')]=_[_0x4382('0x36')](_0x2f29f9[_0x4382('0x31')],_0x2f29f9[_0x4382('0x33')]);_0x430ff2[_0x4382('0x37')]=_['intersection'](_0x2f29f9[_0x4382('0x31')],qs[_0x4382('0x38')](_0x1ced8e[_0x4382('0x33')][_0x4382('0x38')]));_0x430ff2[_0x4382('0x37')]=_0x430ff2[_0x4382('0x37')][_0x4382('0x39')]?_0x430ff2[_0x4382('0x37')]:_0x2f29f9['model'];if(!_0x1ced8e[_0x4382('0x33')]['hasOwnProperty']('nolimit')){_0x430ff2[_0x4382('0x21')]=qs['limit'](_0x1ced8e[_0x4382('0x33')]['limit']);_0x430ff2[_0x4382('0x1f')]=qs[_0x4382('0x1f')](_0x1ced8e['query'][_0x4382('0x1f')]);}_0x430ff2[_0x4382('0x3a')]=qs['sort'](_0x1ced8e[_0x4382('0x33')][_0x4382('0x3b')]);_0x430ff2[_0x4382('0x3c')]=qs[_0x4382('0x35')](_[_0x4382('0x3d')](_0x1ced8e['query'],_0x2f29f9[_0x4382('0x35')]),_0x261c13);if(_0x1ced8e[_0x4382('0x33')][_0x4382('0x3e')]){_0x430ff2[_0x4382('0x3c')]=_['merge'](_0x430ff2[_0x4382('0x3c')],{'$or':_[_0x4382('0x32')](_0x261c13,function(_0x5278fa){if(_0x5278fa[_0x4382('0x2f')]!=='VIRTUAL'){var _0x54b260={};_0x54b260[_0x5278fa[_0x4382('0x29')]]={'$like':'%'+_0x1ced8e[_0x4382('0x33')][_0x4382('0x3e')]+'%'};return _0x54b260;}})});}_0x430ff2=_[_0x4382('0x3f')]({},_0x430ff2,_0x1ced8e[_0x4382('0x40')]);var _0x56fb6b={'where':_0x430ff2[_0x4382('0x3c')]};return db[_0x4382('0x2c')][_0x4382('0x22')](_0x56fb6b)[_0x4382('0x27')](function(_0x5e9d83){_0xfb2601[_0x4382('0x22')]=_0x5e9d83;if(_0x1ced8e[_0x4382('0x33')]['includeAll']){_0x430ff2[_0x4382('0x41')]=[{'all':!![]}];}return db[_0x4382('0x2c')][_0x4382('0x42')](_0x430ff2);})[_0x4382('0x27')](function(_0x1acce2){_0xfb2601[_0x4382('0x43')]=_0x1acce2;return _0xfb2601;})[_0x4382('0x27')](respondWithFilteredResult(_0x4c4061,_0x430ff2))[_0x4382('0x44')](handleError(_0x4c4061,null));}; \ No newline at end of file +var _0x20b3=['rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','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','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index','Migration','rawAttributes','key','model','map','query','keys','filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x20b3,0x1a6));var _0x320b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x20b3[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x320b('0x0'));var rimraf=require(_0x320b('0x1'));var zipdir=require(_0x320b('0x2'));var jsonpatch=require(_0x320b('0x3'));var rp=require(_0x320b('0x4'));var moment=require(_0x320b('0x5'));var BPromise=require(_0x320b('0x6'));var Mustache=require(_0x320b('0x7'));var util=require(_0x320b('0x8'));var path=require(_0x320b('0x9'));var sox=require(_0x320b('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x320b('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x320b('0xc'));var jsforce=require(_0x320b('0xd'));var deskjs=require(_0x320b('0xe'));var toCsv=require('to-csv');var querystring=require(_0x320b('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x320b('0x10'));var qs=require(_0x320b('0x11'));var as=require(_0x320b('0x12'));var hardwareService=require(_0x320b('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x320b('0x14'));var config=require(_0x320b('0x15'));var licenseUtil=require(_0x320b('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x19ffc7,_0x209909){_0x209909=_0x209909||0xcc;return function(_0x4bf168){if(_0x4bf168){return _0x19ffc7[_0x320b('0x17')](_0x209909);}return _0x19ffc7['status'](_0x209909)[_0x320b('0x18')]();};}function respondWithResult(_0x560e1a,_0x175f15){_0x175f15=_0x175f15||0xc8;return function(_0x55eafb){if(_0x55eafb){return _0x560e1a[_0x320b('0x19')](_0x175f15)[_0x320b('0x1a')](_0x55eafb);}};}function respondWithFilteredResult(_0x2abc3e,_0x4fc249){return function(_0x226521){if(_0x226521){var _0x20f957=typeof _0x4fc249[_0x320b('0x1b')]===_0x320b('0x1c')&&typeof _0x4fc249[_0x320b('0x1d')]===_0x320b('0x1c');var _0x26215b=_0x226521[_0x320b('0x1e')];var _0x413341=_0x20f957?0x0:_0x4fc249[_0x320b('0x1b')];var _0x17c7b8=_0x20f957?_0x226521[_0x320b('0x1e')]:_0x4fc249['offset']+_0x4fc249[_0x320b('0x1d')];var _0x2159c3;if(_0x17c7b8>=_0x26215b){_0x17c7b8=_0x26215b;_0x2159c3=0xc8;}else{_0x2159c3=0xce;}_0x2abc3e[_0x320b('0x19')](_0x2159c3);return _0x2abc3e[_0x320b('0x1f')](_0x320b('0x20'),_0x413341+'-'+_0x17c7b8+'/'+_0x26215b)[_0x320b('0x1a')](_0x226521);}return null;};}function patchUpdates(_0x2a95a5){return function(_0x24b516){try{jsonpatch[_0x320b('0x21')](_0x24b516,_0x2a95a5,!![]);}catch(_0x57fd87){return BPromise[_0x320b('0x22')](_0x57fd87);}return _0x24b516[_0x320b('0x23')]();};}function saveUpdates(_0x2e0216,_0x346edf){return function(_0x333cf1){if(_0x333cf1){return _0x333cf1['update'](_0x2e0216)['then'](function(_0x44e17d){return _0x44e17d;});}return null;};}function removeEntity(_0x554112,_0xbb2fe4){return function(_0xe21e9){if(_0xe21e9){return _0xe21e9[_0x320b('0x24')]()[_0x320b('0x25')](function(){_0x554112['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x11b63b,_0x1bf428){return function(_0x5c64f6){if(!_0x5c64f6){_0x11b63b[_0x320b('0x17')](0x194);}return _0x5c64f6;};}function handleError(_0x53d6a2,_0x1fca0b){_0x1fca0b=_0x1fca0b||0x1f4;return function(_0xe0c406){logger[_0x320b('0x26')](_0xe0c406[_0x320b('0x27')]);if(_0xe0c406['name']){delete _0xe0c406[_0x320b('0x28')];}_0x53d6a2[_0x320b('0x19')](_0x1fca0b)[_0x320b('0x29')](_0xe0c406);};}exports[_0x320b('0x2a')]=function(_0x102052,_0x1d92c6){var _0x25df7b={},_0x590378={},_0x4e7f15={'count':0x0,'rows':[]};var _0x5e0617=_['map'](db[_0x320b('0x2b')][_0x320b('0x2c')],function(_0x1b3ac0){return{'name':_0x1b3ac0['fieldName'],'type':_0x1b3ac0['type'][_0x320b('0x2d')]};});_0x590378[_0x320b('0x2e')]=_[_0x320b('0x2f')](_0x5e0617,'name');_0x590378[_0x320b('0x30')]=_[_0x320b('0x31')](_0x102052[_0x320b('0x30')]);_0x590378[_0x320b('0x32')]=_['intersection'](_0x590378[_0x320b('0x2e')],_0x590378[_0x320b('0x30')]);_0x25df7b['attributes']=_[_0x320b('0x33')](_0x590378['model'],qs[_0x320b('0x34')](_0x102052[_0x320b('0x30')]['fields']));_0x25df7b['attributes']=_0x25df7b['attributes'][_0x320b('0x35')]?_0x25df7b['attributes']:_0x590378[_0x320b('0x2e')];if(!_0x102052[_0x320b('0x30')][_0x320b('0x36')](_0x320b('0x37'))){_0x25df7b[_0x320b('0x1d')]=qs['limit'](_0x102052[_0x320b('0x30')][_0x320b('0x1d')]);_0x25df7b[_0x320b('0x1b')]=qs[_0x320b('0x1b')](_0x102052[_0x320b('0x30')][_0x320b('0x1b')]);}_0x25df7b[_0x320b('0x38')]=qs[_0x320b('0x39')](_0x102052['query'][_0x320b('0x39')]);_0x25df7b[_0x320b('0x3a')]=qs[_0x320b('0x32')](_[_0x320b('0x3b')](_0x102052[_0x320b('0x30')],_0x590378[_0x320b('0x32')]),_0x5e0617);if(_0x102052[_0x320b('0x30')][_0x320b('0x3c')]){_0x25df7b['where']=_[_0x320b('0x3d')](_0x25df7b[_0x320b('0x3a')],{'$or':_[_0x320b('0x2f')](_0x5e0617,function(_0x1318df){if(_0x1318df[_0x320b('0x3e')]!==_0x320b('0x3f')){var _0xf43ca9={};_0xf43ca9[_0x1318df['name']]={'$like':'%'+_0x102052[_0x320b('0x30')][_0x320b('0x3c')]+'%'};return _0xf43ca9;}})});}_0x25df7b=_[_0x320b('0x3d')]({},_0x25df7b,_0x102052[_0x320b('0x40')]);var _0x200a44={'where':_0x25df7b[_0x320b('0x3a')]};return db['Migration'][_0x320b('0x1e')](_0x200a44)[_0x320b('0x25')](function(_0x4a955c){_0x4e7f15[_0x320b('0x1e')]=_0x4a955c;if(_0x102052['query'][_0x320b('0x41')]){_0x25df7b[_0x320b('0x42')]=[{'all':!![]}];}return db[_0x320b('0x2b')][_0x320b('0x43')](_0x25df7b);})[_0x320b('0x25')](function(_0x1d3939){_0x4e7f15[_0x320b('0x44')]=_0x1d3939;return _0x4e7f15;})['then'](respondWithFilteredResult(_0x1d92c6,_0x25df7b))[_0x320b('0x45')](handleError(_0x1d92c6,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 74c29ed..d2f1aaf 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 _0x430e=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','Migration','migrations'];(function(_0x5699c3,_0x244277){var _0x51ad07=function(_0x539906){while(--_0x539906){_0x5699c3['push'](_0x5699c3['shift']());}};_0x51ad07(++_0x244277);}(_0x430e,0x13f));var _0xe430=function(_0x1599b5,_0x28b24b){_0x1599b5=_0x1599b5-0x0;var _0x22b161=_0x430e[_0x1599b5];return _0x22b161;};'use strict';var _=require(_0xe430('0x0'));var util=require('util');var logger=require(_0xe430('0x1'))(_0xe430('0x2'));var moment=require(_0xe430('0x3'));var BPromise=require(_0xe430('0x4'));var rp=require(_0xe430('0x5'));var fs=require('fs');var path=require(_0xe430('0x6'));var rimraf=require(_0xe430('0x7'));var config=require('../../config/environment');var attributes=require('./migration.attributes');module[_0xe430('0x8')]=function(_0xa69dc2,_0x2903a3){return _0xa69dc2['define'](_0xe430('0x9'),attributes,{'tableName':_0xe430('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5160=['../../config/environment','./migration.attributes','exports','define','Migration','migrations','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x5160,0xa0));var _0x0516=function(_0x12bf21,_0x103735){_0x12bf21=_0x12bf21-0x0;var _0x2c5e73=_0x5160[_0x12bf21];return _0x2c5e73;};'use strict';var _=require(_0x0516('0x0'));var util=require(_0x0516('0x1'));var logger=require(_0x0516('0x2'))(_0x0516('0x3'));var moment=require('moment');var BPromise=require(_0x0516('0x4'));var rp=require(_0x0516('0x5'));var fs=require('fs');var path=require(_0x0516('0x6'));var rimraf=require(_0x0516('0x7'));var config=require(_0x0516('0x8'));var attributes=require(_0x0516('0x9'));module[_0x0516('0xa')]=function(_0x243a4d,_0x4cfc97){return _0x243a4d[_0x0516('0xb')](_0x0516('0xc'),attributes,{'tableName':_0x0516('0xd'),'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 57b2cf5..3cdf0cf 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 _0x8128=['message','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x14de91,_0x18abe0){var _0x46fee0=function(_0x535e04){while(--_0x535e04){_0x14de91['push'](_0x14de91['shift']());}};_0x46fee0(++_0x18abe0);}(_0x8128,0x1b1));var _0x8812=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x8128[_0x4fde08];return _0x12e725;};'use strict';var _=require(_0x8812('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8812('0x1'));var rs=require(_0x8812('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8812('0x3'));var logger=require(_0x8812('0x4'))(_0x8812('0x5'));var config=require('../../config/environment');var jayson=require(_0x8812('0x6'));var client=jayson[_0x8812('0x7')][_0x8812('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x16bafa,_0x480d1f,_0xfdd696){return new BPromise(function(_0x3d030b,_0x4e5012){return client['request'](_0x16bafa,_0xfdd696)['then'](function(_0x2bc882){logger[_0x8812('0x9')](_0x8812('0xa'),_0x480d1f,_0x8812('0xb'));logger[_0x8812('0xc')](_0x8812('0xd'),_0x480d1f,_0x8812('0xb'),JSON[_0x8812('0xe')](_0x2bc882));if(_0x2bc882[_0x8812('0xf')]){if(_0x2bc882['error'][_0x8812('0x10')]===0x1f4){logger[_0x8812('0xf')](_0x8812('0xa'),_0x480d1f,_0x2bc882[_0x8812('0xf')][_0x8812('0x11')]);return _0x4e5012(_0x2bc882[_0x8812('0xf')]['message']);}logger[_0x8812('0xf')](_0x8812('0xa'),_0x480d1f,_0x2bc882[_0x8812('0xf')]['message']);return _0x3d030b(_0x2bc882['error'][_0x8812('0x11')]);}else{logger[_0x8812('0x9')]('Migration,\x20%s,\x20%s',_0x480d1f,'request\x20sent');_0x3d030b(_0x2bc882['result']['message']);}})['catch'](function(_0xa2a8cc){logger['error'](_0x8812('0xa'),_0x480d1f,_0xa2a8cc);_0x4e5012(_0xa2a8cc);});});} \ No newline at end of file +var _0x2948=['then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request'];(function(_0x5f3cf7,_0x4ed435){var _0x4ea7dc=function(_0x4887b8){while(--_0x4887b8){_0x5f3cf7['push'](_0x5f3cf7['shift']());}};_0x4ea7dc(++_0x4ed435);}(_0x2948,0xcb));var _0x8294=function(_0x4a3f0c,_0x2e0599){_0x4a3f0c=_0x4a3f0c-0x0;var _0x49733c=_0x2948[_0x4a3f0c];return _0x49733c;};'use strict';var _=require(_0x8294('0x0'));var util=require(_0x8294('0x1'));var moment=require(_0x8294('0x2'));var BPromise=require(_0x8294('0x3'));var rs=require(_0x8294('0x4'));var fs=require('fs');var Redis=require(_0x8294('0x5'));var db=require(_0x8294('0x6'))['db'];var utils=require(_0x8294('0x7'));var logger=require(_0x8294('0x8'))('rpc');var config=require(_0x8294('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8294('0xa')][_0x8294('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x39aa65,_0x514609,_0x5a7135){return new BPromise(function(_0x56f7c8,_0x530786){return client[_0x8294('0xc')](_0x39aa65,_0x5a7135)[_0x8294('0xd')](function(_0x545613){logger[_0x8294('0xe')](_0x8294('0xf'),_0x514609,_0x8294('0x10'));logger[_0x8294('0x11')](_0x8294('0x12'),_0x514609,_0x8294('0x10'),JSON['stringify'](_0x545613));if(_0x545613[_0x8294('0x13')]){if(_0x545613[_0x8294('0x13')][_0x8294('0x14')]===0x1f4){logger[_0x8294('0x13')](_0x8294('0xf'),_0x514609,_0x545613[_0x8294('0x13')][_0x8294('0x15')]);return _0x530786(_0x545613[_0x8294('0x13')]['message']);}logger[_0x8294('0x13')](_0x8294('0xf'),_0x514609,_0x545613[_0x8294('0x13')]['message']);return _0x56f7c8(_0x545613['error']['message']);}else{logger[_0x8294('0xe')](_0x8294('0xf'),_0x514609,_0x8294('0x10'));_0x56f7c8(_0x545613[_0x8294('0x16')][_0x8294('0x15')]);}})[_0x8294('0x17')](function(_0x2a501a){logger[_0x8294('0x13')](_0x8294('0xf'),_0x514609,_0x2a501a);_0x530786(_0x2a501a);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 7a33d44..3f51d8e 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 _0xa29a=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','./network.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports'];(function(_0xa232c0,_0x3aaa8b){var _0x2ce24e=function(_0x2ffbd7){while(--_0x2ffbd7){_0xa232c0['push'](_0xa232c0['shift']());}};_0x2ce24e(++_0x3aaa8b);}(_0xa29a,0x1ee));var _0xaa29=function(_0x54f2af,_0x5d680d){_0x54f2af=_0x54f2af-0x0;var _0xa460ef=_0xa29a[_0x54f2af];return _0xa460ef;};'use strict';var multer=require(_0xaa29('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xaa29('0x1'));var express=require(_0xaa29('0x2'));var router=express[_0xaa29('0x3')]();var fs_extra=require(_0xaa29('0x4'));var auth=require(_0xaa29('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xaa29('0x6'));router[_0xaa29('0x7')]('/',auth['isAuthenticated'](),controller[_0xaa29('0x8')]);router[_0xaa29('0x7')](_0xaa29('0x9'),auth[_0xaa29('0xa')](),controller[_0xaa29('0xb')]);router[_0xaa29('0xc')]('/',auth[_0xaa29('0xa')](),controller[_0xaa29('0xd')]);router[_0xaa29('0xe')]('/:id',auth[_0xaa29('0xa')](),controller[_0xaa29('0xf')]);router[_0xaa29('0x10')]('/:id',auth[_0xaa29('0xa')](),controller[_0xaa29('0x11')]);module[_0xaa29('0x12')]=router; \ No newline at end of file +var _0x090a=['exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x090a,0x133));var _0xa090=function(_0xe8df61,_0x416963){_0xe8df61=_0xe8df61-0x0;var _0x436a3b=_0x090a[_0xe8df61];return _0x436a3b;};'use strict';var multer=require(_0xa090('0x0'));var util=require(_0xa090('0x1'));var path=require('path');var timeout=require(_0xa090('0x2'));var express=require(_0xa090('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa090('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa090('0x5'));var controller=require(_0xa090('0x6'));router[_0xa090('0x7')]('/',auth[_0xa090('0x8')](),controller[_0xa090('0x9')]);router[_0xa090('0x7')](_0xa090('0xa'),auth[_0xa090('0x8')](),controller[_0xa090('0xb')]);router[_0xa090('0xc')]('/',auth[_0xa090('0x8')](),controller[_0xa090('0xd')]);router[_0xa090('0xe')](_0xa090('0xa'),auth[_0xa090('0x8')](),controller[_0xa090('0xf')]);router['delete'](_0xa090('0xa'),auth['isAuthenticated'](),controller[_0xa090('0x10')]);module[_0xa090('0x11')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 543a846..8752527 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 _0xd4c5=['stun','STRING','exports','ENUM','localnet'];(function(_0x59db19,_0x30c1c6){var _0x5f0f09=function(_0x36e225){while(--_0x36e225){_0x59db19['push'](_0x59db19['shift']());}};_0x5f0f09(++_0x30c1c6);}(_0xd4c5,0xa7));var _0x5d4c=function(_0x54c941,_0x4da682){_0x54c941=_0x54c941-0x0;var _0x3a62b4=_0xd4c5[_0x54c941];return _0x3a62b4;};'use strict';var Sequelize=require('sequelize');module[_0x5d4c('0x0')]={'type':{'type':Sequelize[_0x5d4c('0x1')](_0x5d4c('0x2'),'externip',_0x5d4c('0x3'),'turn')},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x5d4c('0x4')]},'password':{'type':Sequelize[_0x5d4c('0x4')]}}; \ No newline at end of file +var _0x2a31=['turn','STRING','sequelize','exports','externip','stun'];(function(_0xf26c2e,_0x56c3ea){var _0x46ecb4=function(_0x1be516){while(--_0x1be516){_0xf26c2e['push'](_0xf26c2e['shift']());}};_0x46ecb4(++_0x56c3ea);}(_0x2a31,0xd4));var _0x12a3=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x2a31[_0x543084];return _0x306a57;};'use strict';var Sequelize=require(_0x12a3('0x0'));module[_0x12a3('0x1')]={'type':{'type':Sequelize['ENUM']('localnet',_0x12a3('0x2'),_0x12a3('0x3'),_0x12a3('0x4'))},'value':{'type':Sequelize[_0x12a3('0x5')]},'username':{'type':Sequelize[_0x12a3('0x5')]},'password':{'type':Sequelize[_0x12a3('0x5')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 8877011..dd4e690 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 _0x7568=['ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','destroy','stack','key','model','map','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','Network','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','toUpperCase','join','root','server/files/templates/stun_multiple.ejs','utf8','writeFileSync','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','TURN','/etc/asterisk/turn_xcally.conf','Reload','readFileSync','render','format','toLowerCase','sequelize','transaction','STUN','server/files/templates/turn_multiple.ejs','server/files/templates/network.ejs','chan_sip.so','/etc/asterisk/sip_xcally_%s.conf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x422c8c,_0xbf86e6){var _0x124d58=function(_0xad502f){while(--_0xad502f){_0x422c8c['push'](_0x422c8c['shift']());}};_0x124d58(++_0xbf86e6);}(_0x7568,0xd1));var _0x8756=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x7568[_0x46e363];return _0x3fb059;};'use strict';var emlformat=require(_0x8756('0x0'));var rimraf=require(_0x8756('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8756('0x2'));var rp=require(_0x8756('0x3'));var moment=require(_0x8756('0x4'));var BPromise=require(_0x8756('0x5'));var Mustache=require(_0x8756('0x6'));var util=require(_0x8756('0x7'));var path=require(_0x8756('0x8'));var sox=require(_0x8756('0x9'));var csv=require(_0x8756('0xa'));var ejs=require(_0x8756('0xb'));var fs=require('fs');var fs_extra=require(_0x8756('0xc'));var _=require(_0x8756('0xd'));var squel=require(_0x8756('0xe'));var crypto=require('crypto');var jsforce=require(_0x8756('0xf'));var deskjs=require(_0x8756('0x10'));var toCsv=require(_0x8756('0xa'));var querystring=require(_0x8756('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8756('0x12'));var qs=require(_0x8756('0x13'));var as=require(_0x8756('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8756('0x15'));var utils=require(_0x8756('0x16'));var config=require(_0x8756('0x17'));var licenseUtil=require(_0x8756('0x18'));var db=require(_0x8756('0x19'))['db'];var jayson=require(_0x8756('0x1a'));var client=jayson[_0x8756('0x1b')][_0x8756('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x2073cb,_0x395401,_0x5ea71d,_0x86ad81){return new BPromise(function(_0x36321e,_0x39b019){var _0x1a3adb=_0x86ad81||client;return _0x1a3adb[_0x8756('0x1d')](_0x2073cb,_0x5ea71d)[_0x8756('0x1e')](function(_0x1f26e8){logger['info'](_0x8756('0x1f'),_0x395401,_0x8756('0x20'));logger[_0x8756('0x21')](_0x8756('0x22'),_0x395401,_0x8756('0x20'),JSON[_0x8756('0x23')](_0x1f26e8));if(_0x1f26e8[_0x8756('0x24')]){if(_0x1f26e8[_0x8756('0x24')][_0x8756('0x25')]===0x1f4){logger[_0x8756('0x24')]('Network,\x20%s,\x20%s',_0x395401,_0x1f26e8[_0x8756('0x24')][_0x8756('0x26')]);return _0x39b019(_0x1f26e8[_0x8756('0x24')][_0x8756('0x26')]);}logger[_0x8756('0x24')]('Network,\x20%s,\x20%s',_0x395401,_0x1f26e8['error'][_0x8756('0x26')]);return _0x36321e(_0x1f26e8[_0x8756('0x24')][_0x8756('0x26')]);}else{logger[_0x8756('0x27')]('Network,\x20%s,\x20%s',_0x395401,_0x8756('0x20'));_0x36321e(_0x1f26e8[_0x8756('0x28')][_0x8756('0x26')]);}})['catch'](function(_0x2ecb4b){logger[_0x8756('0x24')]('Network,\x20%s,\x20%s',_0x395401,_0x2ecb4b);_0x39b019(_0x2ecb4b);});});}function respondWithStatusCode(_0x2bc599,_0x531054){_0x531054=_0x531054||0xcc;return function(_0x71462a){if(_0x71462a){return _0x2bc599[_0x8756('0x29')](_0x531054);}return _0x2bc599[_0x8756('0x2a')](_0x531054)[_0x8756('0x2b')]();};}function respondWithResult(_0x4b5794,_0x49f84b){_0x49f84b=_0x49f84b||0xc8;return function(_0x195df6){if(_0x195df6){return _0x4b5794[_0x8756('0x2a')](_0x49f84b)[_0x8756('0x2c')](_0x195df6);}};}function respondWithFilteredResult(_0xdbd644,_0x56827d){return function(_0xd9f835){if(_0xd9f835){var _0x1cddb0=typeof _0x56827d[_0x8756('0x2d')]===_0x8756('0x2e')&&typeof _0x56827d[_0x8756('0x2f')]==='undefined';var _0x57914e=_0xd9f835[_0x8756('0x30')];var _0xca01ad=_0x1cddb0?0x0:_0x56827d['offset'];var _0x95eb96=_0x1cddb0?_0xd9f835[_0x8756('0x30')]:_0x56827d[_0x8756('0x2d')]+_0x56827d[_0x8756('0x2f')];var _0x1df318;if(_0x95eb96>=_0x57914e){_0x95eb96=_0x57914e;_0x1df318=0xc8;}else{_0x1df318=0xce;}_0xdbd644[_0x8756('0x2a')](_0x1df318);return _0xdbd644['set']('Content-Range',_0xca01ad+'-'+_0x95eb96+'/'+_0x57914e)['json'](_0xd9f835);}return null;};}function patchUpdates(_0x508610){return function(_0x199c0e){try{jsonpatch[_0x8756('0x31')](_0x199c0e,_0x508610,!![]);}catch(_0x8e5b52){return BPromise[_0x8756('0x32')](_0x8e5b52);}return _0x199c0e[_0x8756('0x33')]();};}function saveUpdates(_0x41a15c,_0x216bfa){return function(_0x264480){if(_0x264480){return _0x264480[_0x8756('0x34')](_0x41a15c)[_0x8756('0x1e')](function(_0xd7a245){return _0xd7a245;});}return null;};}function removeEntity(_0x5c88e2,_0x5342ca){return function(_0x5b2456){if(_0x5b2456){return _0x5b2456[_0x8756('0x35')]()[_0x8756('0x1e')](function(){_0x5c88e2['status'](0xcc)[_0x8756('0x2b')]();});}};}function handleEntityNotFound(_0x99d114,_0x539f47){return function(_0x2c7358){if(!_0x2c7358){_0x99d114['sendStatus'](0x194);}return _0x2c7358;};}function handleError(_0x90512d,_0x1cca96){_0x1cca96=_0x1cca96||0x1f4;return function(_0x5bd680){logger[_0x8756('0x24')](_0x5bd680[_0x8756('0x36')]);if(_0x5bd680['name']){delete _0x5bd680['name'];}_0x90512d['status'](_0x1cca96)['send'](_0x5bd680);};}exports['index']=function(_0x4b244c,_0xb950ee){var _0x554b60={},_0x165314={},_0x558bd8={'count':0x0,'rows':[]};var _0x341e0f=_['map'](db['Network']['rawAttributes'],function(_0x24dd64){return{'name':_0x24dd64['fieldName'],'type':_0x24dd64['type'][_0x8756('0x37')]};});_0x165314[_0x8756('0x38')]=_[_0x8756('0x39')](_0x341e0f,_0x8756('0x3a'));_0x165314['query']=_[_0x8756('0x3b')](_0x4b244c[_0x8756('0x3c')]);_0x165314[_0x8756('0x3d')]=_[_0x8756('0x3e')](_0x165314[_0x8756('0x38')],_0x165314[_0x8756('0x3c')]);_0x554b60[_0x8756('0x3f')]=_[_0x8756('0x3e')](_0x165314[_0x8756('0x38')],qs[_0x8756('0x40')](_0x4b244c[_0x8756('0x3c')][_0x8756('0x40')]));_0x554b60['attributes']=_0x554b60[_0x8756('0x3f')][_0x8756('0x41')]?_0x554b60['attributes']:_0x165314[_0x8756('0x38')];if(!_0x4b244c[_0x8756('0x3c')][_0x8756('0x42')](_0x8756('0x43'))){_0x554b60['limit']=qs[_0x8756('0x2f')](_0x4b244c[_0x8756('0x3c')][_0x8756('0x2f')]);_0x554b60['offset']=qs['offset'](_0x4b244c[_0x8756('0x3c')]['offset']);}_0x554b60[_0x8756('0x44')]=qs[_0x8756('0x45')](_0x4b244c[_0x8756('0x3c')][_0x8756('0x45')]);_0x554b60[_0x8756('0x46')]=qs['filters'](_[_0x8756('0x47')](_0x4b244c[_0x8756('0x3c')],_0x165314['filters']),_0x341e0f);if(_0x4b244c[_0x8756('0x3c')][_0x8756('0x48')]){_0x554b60['where']=_['merge'](_0x554b60['where'],{'$or':_['map'](_0x341e0f,function(_0x4b7f88){if(_0x4b7f88[_0x8756('0x49')]!==_0x8756('0x4a')){var _0x5e1e36={};_0x5e1e36[_0x4b7f88[_0x8756('0x3a')]]={'$like':'%'+_0x4b244c[_0x8756('0x3c')][_0x8756('0x48')]+'%'};return _0x5e1e36;}})});}_0x554b60=_[_0x8756('0x4b')]({},_0x554b60,_0x4b244c[_0x8756('0x4c')]);var _0x5d181e={'where':_0x554b60[_0x8756('0x46')]};return db[_0x8756('0x4d')][_0x8756('0x30')](_0x5d181e)[_0x8756('0x1e')](function(_0x3f521c){_0x558bd8[_0x8756('0x30')]=_0x3f521c;if(_0x4b244c[_0x8756('0x3c')]['includeAll']){_0x554b60['include']=[{'all':!![]}];}return db[_0x8756('0x4d')][_0x8756('0x4e')](_0x554b60);})[_0x8756('0x1e')](function(_0x408398){_0x558bd8[_0x8756('0x4f')]=_0x408398;return _0x558bd8;})[_0x8756('0x1e')](respondWithFilteredResult(_0xb950ee,_0x554b60))[_0x8756('0x50')](handleError(_0xb950ee,null));};exports[_0x8756('0x51')]=function(_0x37321e,_0x47fb0e){var _0x93614b={'raw':!![],'where':{'id':_0x37321e[_0x8756('0x52')]['id']}},_0x23c8da={};_0x23c8da[_0x8756('0x38')]=_[_0x8756('0x3b')](db[_0x8756('0x4d')][_0x8756('0x53')]);_0x23c8da[_0x8756('0x3c')]=_['keys'](_0x37321e[_0x8756('0x3c')]);_0x23c8da['filters']=_[_0x8756('0x3e')](_0x23c8da[_0x8756('0x38')],_0x23c8da[_0x8756('0x3c')]);_0x93614b['attributes']=_['intersection'](_0x23c8da[_0x8756('0x38')],qs['fields'](_0x37321e[_0x8756('0x3c')][_0x8756('0x40')]));_0x93614b['attributes']=_0x93614b['attributes'][_0x8756('0x41')]?_0x93614b[_0x8756('0x3f')]:_0x23c8da[_0x8756('0x38')];if(_0x37321e[_0x8756('0x3c')][_0x8756('0x54')]){_0x93614b['include']=[{'all':!![]}];}_0x93614b=_['merge']({},_0x93614b,_0x37321e[_0x8756('0x4c')]);return db[_0x8756('0x4d')][_0x8756('0x55')](_0x93614b)['then'](handleEntityNotFound(_0x47fb0e,null))[_0x8756('0x1e')](respondWithResult(_0x47fb0e,null))[_0x8756('0x50')](handleError(_0x47fb0e,null));};exports[_0x8756('0x56')]=function(_0x1f8c2f,_0x19423e,_0x19294c){var _0x1ee150;return db['sequelize']['transaction'](function(_0x4b574b){return db[_0x8756('0x4d')][_0x8756('0x56')](_0x1f8c2f[_0x8756('0x57')],{'raw':!![]})['then'](function(_0x3bb0dd){_0x1ee150=_0x3bb0dd;return db[_0x8756('0x4d')][_0x8756('0x4e')]({'where':{'type':_0x1f8c2f[_0x8756('0x57')]['type']},'raw':!![]});})[_0x8756('0x1e')](function(_0x1379ba){if(_0x1ee150[_0x8756('0x49')][_0x8756('0x58')]()=='STUN'){var _0x51ffd0=fs['readFileSync'](path[_0x8756('0x59')](config[_0x8756('0x5a')],_0x8756('0x5b')),_0x8756('0x5c'));var _0x539251=ejs['render'](_0x51ffd0,{'networks':_0x1379ba||[]});fs[_0x8756('0x5d')](_0x8756('0x5e'),_0x539251);return respondWithRpcPromise('Reload',_0x8756('0x56'),{'module':_0x8756('0x5f')});}else if(_0x1ee150['type'][_0x8756('0x58')]()==_0x8756('0x60')){var _0x2f2680=fs['readFileSync'](path[_0x8756('0x59')](config['root'],'server/files/templates/turn_multiple.ejs'),_0x8756('0x5c'));var _0x4ec0ff=ejs['render'](_0x2f2680,{'networks':_0x1379ba||[]});fs[_0x8756('0x5d')](_0x8756('0x61'),_0x4ec0ff);return respondWithRpcPromise(_0x8756('0x62'),_0x8756('0x56'),{'module':_0x8756('0x5f')});}else{var _0x1d79c1=fs[_0x8756('0x63')](path[_0x8756('0x59')](config[_0x8756('0x5a')],'server/files/templates/network.ejs'),'utf8');var _0x4435e6=ejs[_0x8756('0x64')](_0x1d79c1,{'networks':_0x1379ba||[]});fs[_0x8756('0x5d')](util[_0x8756('0x65')]('/etc/asterisk/sip_xcally_%s.conf',_0x1f8c2f[_0x8756('0x57')]['type'][_0x8756('0x66')]()),_0x4435e6);return respondWithRpcPromise('Reload','create',{'module':'chan_sip.so'});}return null;})[_0x8756('0x1e')](function(){return _0x1ee150;});})[_0x8756('0x1e')](respondWithResult(_0x19423e,0xc9))[_0x8756('0x50')](handleError(_0x19423e,null));};exports['update']=function(_0x2cbb8f,_0x369864,_0x4adcd1){var _0x3cf4ad;return db[_0x8756('0x67')][_0x8756('0x68')](function(_0x4a6f06){return db[_0x8756('0x4d')][_0x8756('0x55')]({'where':{'id':_0x2cbb8f[_0x8756('0x52')]['id']}})[_0x8756('0x1e')](handleEntityNotFound(_0x369864,null))[_0x8756('0x1e')](saveUpdates(_0x2cbb8f['body'],null))[_0x8756('0x1e')](function(_0x1a9a02){if(_0x1a9a02){_0x3cf4ad=_0x1a9a02;return db['Network'][_0x8756('0x4e')]({'where':{'type':_0x3cf4ad[_0x8756('0x49')]},'raw':!![]});}return null;})[_0x8756('0x1e')](function(_0x4a1104){if(_0x3cf4ad[_0x8756('0x49')][_0x8756('0x58')]()==_0x8756('0x69')){var _0x5c49e8=fs[_0x8756('0x63')](path[_0x8756('0x59')](config['root'],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x580e18=ejs['render'](_0x5c49e8,{'networks':_0x4a1104||[]});fs[_0x8756('0x5d')]('/etc/asterisk/stun_xcally.conf',_0x580e18);return respondWithRpcPromise('Reload',_0x8756('0x34'),{'module':_0x8756('0x5f')});}else if(_0x3cf4ad[_0x8756('0x49')]['toUpperCase']()==_0x8756('0x60')){var _0x124dbf=fs[_0x8756('0x63')](path[_0x8756('0x59')](config[_0x8756('0x5a')],_0x8756('0x6a')),_0x8756('0x5c'));var _0xd74af1=ejs['render'](_0x124dbf,{'networks':_0x4a1104||[]});fs[_0x8756('0x5d')](_0x8756('0x61'),_0xd74af1);return respondWithRpcPromise(_0x8756('0x62'),_0x8756('0x34'),{'module':_0x8756('0x5f')});}else{var _0x2246e5=fs[_0x8756('0x63')](path[_0x8756('0x59')](config[_0x8756('0x5a')],_0x8756('0x6b')),_0x8756('0x5c'));var _0x147a5a=ejs[_0x8756('0x64')](_0x2246e5,{'networks':_0x4a1104||[]});fs['writeFileSync'](util[_0x8756('0x65')]('/etc/asterisk/sip_xcally_%s.conf',_0x2cbb8f[_0x8756('0x57')][_0x8756('0x49')][_0x8756('0x66')]()),_0x147a5a);return respondWithRpcPromise(_0x8756('0x62'),_0x8756('0x34'),{'module':_0x8756('0x6c')});}return null;})['then'](function(_0x2ab896){if(_0x2ab896){return _0x3cf4ad;}return null;});})['then'](respondWithResult(_0x369864,null))['catch'](handleError(_0x369864,null));};exports['destroy']=function(_0x5530fe,_0x33343f,_0x308aa5){var _0x1fd5e5;return db['Network']['find']({'where':{'id':_0x5530fe['params']['id']}})[_0x8756('0x1e')](function(_0x287984){_0x1fd5e5=_0x287984;return _0x287984;})[_0x8756('0x1e')](handleEntityNotFound(_0x33343f,null))[_0x8756('0x1e')](removeEntity(_0x33343f,null))[_0x8756('0x1e')](function(){if(_0x1fd5e5){return db[_0x8756('0x4d')][_0x8756('0x4e')]({'where':{'type':_0x1fd5e5[_0x8756('0x49')]},'raw':!![]});}})[_0x8756('0x1e')](function(_0x3f7a15){if(_0x1fd5e5['type'][_0x8756('0x58')]()=='STUN'){var _0xe6f813=fs[_0x8756('0x63')](path['join'](config[_0x8756('0x5a')],_0x8756('0x5b')),'utf8');var _0xdbc9ef=ejs[_0x8756('0x64')](_0xe6f813,{'networks':_0x3f7a15||[]});fs['writeFileSync'](_0x8756('0x5e'),_0xdbc9ef);return respondWithRpcPromise(_0x8756('0x62'),_0x8756('0x35'),{'module':_0x8756('0x5f')});}else if(_0x1fd5e5['type']['toUpperCase']()==_0x8756('0x60')){var _0x2c8d7d=fs[_0x8756('0x63')](path[_0x8756('0x59')](config[_0x8756('0x5a')],_0x8756('0x6a')),'utf8');var _0x3fa03c=ejs[_0x8756('0x64')](_0x2c8d7d,{'networks':_0x3f7a15||[]});fs[_0x8756('0x5d')]('/etc/asterisk/turn_xcally.conf',_0x3fa03c);return respondWithRpcPromise(_0x8756('0x62'),'destroy',{'module':_0x8756('0x5f')});}else{var _0x256011=fs['readFileSync'](path['join'](config[_0x8756('0x5a')],_0x8756('0x6b')),_0x8756('0x5c'));var _0x136e3a=ejs['render'](_0x256011,{'networks':_0x3f7a15||[]});fs['writeFileSync'](util['format'](_0x8756('0x6d'),_0x5530fe[_0x8756('0x57')][_0x8756('0x49')]['toLowerCase']()),_0x136e3a);return respondWithRpcPromise(_0x8756('0x62'),_0x8756('0x35'),{'module':_0x8756('0x6c')});}return null;})[_0x8756('0x50')](handleError(_0x33343f,null));}; \ No newline at end of file +var _0x76ff=['apply','reject','save','destroy','end','stack','name','send','map','Network','rawAttributes','fieldName','type','key','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','rows','show','params','keys','intersection','options','find','create','transaction','body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','toLowerCase','update','sequelize','findAll','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','sendStatus','status','limit','undefined','count','offset','set','Content-Range'];(function(_0x286448,_0x389dda){var _0x43e88b=function(_0x398d8c){while(--_0x398d8c){_0x286448['push'](_0x286448['shift']());}};_0x43e88b(++_0x389dda);}(_0x76ff,0xa8));var _0xf76f=function(_0x171789,_0x5d26d8){_0x171789=_0x171789-0x0;var _0x2d36ad=_0x76ff[_0x171789];return _0x2d36ad;};'use strict';var emlformat=require(_0xf76f('0x0'));var rimraf=require(_0xf76f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf76f('0x2'));var moment=require('moment');var BPromise=require(_0xf76f('0x3'));var Mustache=require(_0xf76f('0x4'));var util=require(_0xf76f('0x5'));var path=require(_0xf76f('0x6'));var sox=require(_0xf76f('0x7'));var csv=require(_0xf76f('0x8'));var ejs=require(_0xf76f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf76f('0xa'));var squel=require(_0xf76f('0xb'));var crypto=require('crypto');var jsforce=require(_0xf76f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf76f('0x8'));var querystring=require('querystring');var Papa=require(_0xf76f('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf76f('0xe'));var as=require(_0xf76f('0xf'));var hardwareService=require(_0xf76f('0x10'));var logger=require(_0xf76f('0x11'))(_0xf76f('0x12'));var utils=require(_0xf76f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xf76f('0x14'));var db=require(_0xf76f('0x15'))['db'];var jayson=require(_0xf76f('0x16'));var client=jayson[_0xf76f('0x17')][_0xf76f('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x21fbba,_0x8aadc7,_0x19f55a,_0x48982b){return new BPromise(function(_0x3dd357,_0x10a5b0){var _0x2b9e57=_0x48982b||client;return _0x2b9e57[_0xf76f('0x19')](_0x21fbba,_0x19f55a)[_0xf76f('0x1a')](function(_0x377299){logger[_0xf76f('0x1b')](_0xf76f('0x1c'),_0x8aadc7,'request\x20sent');logger[_0xf76f('0x1d')]('Network,\x20%s,\x20%s,\x20%s',_0x8aadc7,_0xf76f('0x1e'),JSON[_0xf76f('0x1f')](_0x377299));if(_0x377299[_0xf76f('0x20')]){if(_0x377299[_0xf76f('0x20')]['code']===0x1f4){logger[_0xf76f('0x20')](_0xf76f('0x1c'),_0x8aadc7,_0x377299[_0xf76f('0x20')]['message']);return _0x10a5b0(_0x377299[_0xf76f('0x20')][_0xf76f('0x21')]);}logger[_0xf76f('0x20')](_0xf76f('0x1c'),_0x8aadc7,_0x377299[_0xf76f('0x20')][_0xf76f('0x21')]);return _0x3dd357(_0x377299[_0xf76f('0x20')][_0xf76f('0x21')]);}else{logger[_0xf76f('0x1b')](_0xf76f('0x1c'),_0x8aadc7,_0xf76f('0x1e'));_0x3dd357(_0x377299[_0xf76f('0x22')][_0xf76f('0x21')]);}})[_0xf76f('0x23')](function(_0x59e89d){logger[_0xf76f('0x20')](_0xf76f('0x1c'),_0x8aadc7,_0x59e89d);_0x10a5b0(_0x59e89d);});});}function respondWithStatusCode(_0x1f5814,_0x4a158e){_0x4a158e=_0x4a158e||0xcc;return function(_0x53e7b7){if(_0x53e7b7){return _0x1f5814[_0xf76f('0x24')](_0x4a158e);}return _0x1f5814[_0xf76f('0x25')](_0x4a158e)['end']();};}function respondWithResult(_0x2bc203,_0x57bfa2){_0x57bfa2=_0x57bfa2||0xc8;return function(_0x512406){if(_0x512406){return _0x2bc203[_0xf76f('0x25')](_0x57bfa2)['json'](_0x512406);}};}function respondWithFilteredResult(_0x5f05e2,_0x4e8ff4){return function(_0x502a79){if(_0x502a79){var _0x5cf825=typeof _0x4e8ff4['offset']==='undefined'&&typeof _0x4e8ff4[_0xf76f('0x26')]===_0xf76f('0x27');var _0xb2d062=_0x502a79[_0xf76f('0x28')];var _0x5b22a0=_0x5cf825?0x0:_0x4e8ff4[_0xf76f('0x29')];var _0x44f731=_0x5cf825?_0x502a79[_0xf76f('0x28')]:_0x4e8ff4[_0xf76f('0x29')]+_0x4e8ff4[_0xf76f('0x26')];var _0x102074;if(_0x44f731>=_0xb2d062){_0x44f731=_0xb2d062;_0x102074=0xc8;}else{_0x102074=0xce;}_0x5f05e2[_0xf76f('0x25')](_0x102074);return _0x5f05e2[_0xf76f('0x2a')](_0xf76f('0x2b'),_0x5b22a0+'-'+_0x44f731+'/'+_0xb2d062)['json'](_0x502a79);}return null;};}function patchUpdates(_0x2e0955){return function(_0x4f1fe6){try{jsonpatch[_0xf76f('0x2c')](_0x4f1fe6,_0x2e0955,!![]);}catch(_0x5b027d){return BPromise[_0xf76f('0x2d')](_0x5b027d);}return _0x4f1fe6[_0xf76f('0x2e')]();};}function saveUpdates(_0x4acd0e,_0x2d3939){return function(_0x904b6c){if(_0x904b6c){return _0x904b6c['update'](_0x4acd0e)[_0xf76f('0x1a')](function(_0x3571c3){return _0x3571c3;});}return null;};}function removeEntity(_0x30db0f,_0x2d97c0){return function(_0x5a50c7){if(_0x5a50c7){return _0x5a50c7[_0xf76f('0x2f')]()[_0xf76f('0x1a')](function(){_0x30db0f[_0xf76f('0x25')](0xcc)[_0xf76f('0x30')]();});}};}function handleEntityNotFound(_0x530806,_0x254cc0){return function(_0x200aed){if(!_0x200aed){_0x530806[_0xf76f('0x24')](0x194);}return _0x200aed;};}function handleError(_0x227456,_0x173b5b){_0x173b5b=_0x173b5b||0x1f4;return function(_0x25afaa){logger['error'](_0x25afaa[_0xf76f('0x31')]);if(_0x25afaa[_0xf76f('0x32')]){delete _0x25afaa[_0xf76f('0x32')];}_0x227456['status'](_0x173b5b)[_0xf76f('0x33')](_0x25afaa);};}exports['index']=function(_0x17835c,_0x2ae7bb){var _0x2e2d01={},_0x5af909={},_0x12b419={'count':0x0,'rows':[]};var _0xd1ac30=_[_0xf76f('0x34')](db[_0xf76f('0x35')][_0xf76f('0x36')],function(_0x231568){return{'name':_0x231568[_0xf76f('0x37')],'type':_0x231568[_0xf76f('0x38')][_0xf76f('0x39')]};});_0x5af909[_0xf76f('0x3a')]=_[_0xf76f('0x34')](_0xd1ac30,_0xf76f('0x32'));_0x5af909[_0xf76f('0x3b')]=_['keys'](_0x17835c[_0xf76f('0x3b')]);_0x5af909['filters']=_['intersection'](_0x5af909[_0xf76f('0x3a')],_0x5af909[_0xf76f('0x3b')]);_0x2e2d01[_0xf76f('0x3c')]=_['intersection'](_0x5af909[_0xf76f('0x3a')],qs[_0xf76f('0x3d')](_0x17835c[_0xf76f('0x3b')][_0xf76f('0x3d')]));_0x2e2d01[_0xf76f('0x3c')]=_0x2e2d01[_0xf76f('0x3c')][_0xf76f('0x3e')]?_0x2e2d01[_0xf76f('0x3c')]:_0x5af909[_0xf76f('0x3a')];if(!_0x17835c[_0xf76f('0x3b')][_0xf76f('0x3f')](_0xf76f('0x40'))){_0x2e2d01['limit']=qs[_0xf76f('0x26')](_0x17835c['query'][_0xf76f('0x26')]);_0x2e2d01[_0xf76f('0x29')]=qs[_0xf76f('0x29')](_0x17835c[_0xf76f('0x3b')][_0xf76f('0x29')]);}_0x2e2d01[_0xf76f('0x41')]=qs['sort'](_0x17835c[_0xf76f('0x3b')][_0xf76f('0x42')]);_0x2e2d01[_0xf76f('0x43')]=qs[_0xf76f('0x44')](_['pick'](_0x17835c[_0xf76f('0x3b')],_0x5af909['filters']),_0xd1ac30);if(_0x17835c[_0xf76f('0x3b')][_0xf76f('0x45')]){_0x2e2d01[_0xf76f('0x43')]=_[_0xf76f('0x46')](_0x2e2d01[_0xf76f('0x43')],{'$or':_[_0xf76f('0x34')](_0xd1ac30,function(_0x51e0c8){if(_0x51e0c8['type']!==_0xf76f('0x47')){var _0x1dded9={};_0x1dded9[_0x51e0c8['name']]={'$like':'%'+_0x17835c[_0xf76f('0x3b')][_0xf76f('0x45')]+'%'};return _0x1dded9;}})});}_0x2e2d01=_[_0xf76f('0x46')]({},_0x2e2d01,_0x17835c['options']);var _0x7e9cb6={'where':_0x2e2d01[_0xf76f('0x43')]};return db[_0xf76f('0x35')][_0xf76f('0x28')](_0x7e9cb6)[_0xf76f('0x1a')](function(_0x5736d2){_0x12b419[_0xf76f('0x28')]=_0x5736d2;if(_0x17835c[_0xf76f('0x3b')][_0xf76f('0x48')]){_0x2e2d01['include']=[{'all':!![]}];}return db[_0xf76f('0x35')]['findAll'](_0x2e2d01);})[_0xf76f('0x1a')](function(_0x522ee2){_0x12b419[_0xf76f('0x49')]=_0x522ee2;return _0x12b419;})['then'](respondWithFilteredResult(_0x2ae7bb,_0x2e2d01))[_0xf76f('0x23')](handleError(_0x2ae7bb,null));};exports[_0xf76f('0x4a')]=function(_0xce30ee,_0x20fbbc){var _0x4076db={'raw':!![],'where':{'id':_0xce30ee[_0xf76f('0x4b')]['id']}},_0x3a5831={};_0x3a5831[_0xf76f('0x3a')]=_[_0xf76f('0x4c')](db[_0xf76f('0x35')]['rawAttributes']);_0x3a5831[_0xf76f('0x3b')]=_[_0xf76f('0x4c')](_0xce30ee[_0xf76f('0x3b')]);_0x3a5831[_0xf76f('0x44')]=_[_0xf76f('0x4d')](_0x3a5831[_0xf76f('0x3a')],_0x3a5831[_0xf76f('0x3b')]);_0x4076db[_0xf76f('0x3c')]=_[_0xf76f('0x4d')](_0x3a5831['model'],qs['fields'](_0xce30ee[_0xf76f('0x3b')]['fields']));_0x4076db['attributes']=_0x4076db[_0xf76f('0x3c')][_0xf76f('0x3e')]?_0x4076db[_0xf76f('0x3c')]:_0x3a5831[_0xf76f('0x3a')];if(_0xce30ee[_0xf76f('0x3b')][_0xf76f('0x48')]){_0x4076db['include']=[{'all':!![]}];}_0x4076db=_['merge']({},_0x4076db,_0xce30ee[_0xf76f('0x4e')]);return db['Network'][_0xf76f('0x4f')](_0x4076db)[_0xf76f('0x1a')](handleEntityNotFound(_0x20fbbc,null))[_0xf76f('0x1a')](respondWithResult(_0x20fbbc,null))[_0xf76f('0x23')](handleError(_0x20fbbc,null));};exports[_0xf76f('0x50')]=function(_0x51abb,_0x5afb03,_0x38bd04){var _0x1dd9f8;return db['sequelize'][_0xf76f('0x51')](function(_0x2def79){return db[_0xf76f('0x35')][_0xf76f('0x50')](_0x51abb[_0xf76f('0x52')],{'raw':!![]})[_0xf76f('0x1a')](function(_0x2bacb5){_0x1dd9f8=_0x2bacb5;return db[_0xf76f('0x35')]['findAll']({'where':{'type':_0x51abb['body'][_0xf76f('0x38')]},'raw':!![]});})[_0xf76f('0x1a')](function(_0x1bfe0d){if(_0x1dd9f8['type'][_0xf76f('0x53')]()==_0xf76f('0x54')){var _0x72eef8=fs[_0xf76f('0x55')](path[_0xf76f('0x56')](config[_0xf76f('0x57')],_0xf76f('0x58')),_0xf76f('0x59'));var _0x52cb62=ejs[_0xf76f('0x5a')](_0x72eef8,{'networks':_0x1bfe0d||[]});fs[_0xf76f('0x5b')](_0xf76f('0x5c'),_0x52cb62);return respondWithRpcPromise(_0xf76f('0x5d'),_0xf76f('0x50'),{'module':_0xf76f('0x5e')});}else if(_0x1dd9f8[_0xf76f('0x38')]['toUpperCase']()==_0xf76f('0x5f')){var _0x36f653=fs[_0xf76f('0x55')](path[_0xf76f('0x56')](config[_0xf76f('0x57')],_0xf76f('0x60')),_0xf76f('0x59'));var _0x189868=ejs[_0xf76f('0x5a')](_0x36f653,{'networks':_0x1bfe0d||[]});fs[_0xf76f('0x5b')](_0xf76f('0x61'),_0x189868);return respondWithRpcPromise(_0xf76f('0x5d'),_0xf76f('0x50'),{'module':'res_stun_monitor.so'});}else{var _0x530d06=fs[_0xf76f('0x55')](path['join'](config[_0xf76f('0x57')],_0xf76f('0x62')),_0xf76f('0x59'));var _0x371017=ejs[_0xf76f('0x5a')](_0x530d06,{'networks':_0x1bfe0d||[]});fs[_0xf76f('0x5b')](util[_0xf76f('0x63')]('/etc/asterisk/sip_xcally_%s.conf',_0x51abb[_0xf76f('0x52')]['type'][_0xf76f('0x64')]()),_0x371017);return respondWithRpcPromise(_0xf76f('0x5d'),_0xf76f('0x50'),{'module':'chan_sip.so'});}return null;})[_0xf76f('0x1a')](function(){return _0x1dd9f8;});})['then'](respondWithResult(_0x5afb03,0xc9))['catch'](handleError(_0x5afb03,null));};exports[_0xf76f('0x65')]=function(_0x43b91a,_0x339d50,_0x4a0c4d){var _0xdd61d1;return db[_0xf76f('0x66')][_0xf76f('0x51')](function(_0xf6cef9){return db[_0xf76f('0x35')][_0xf76f('0x4f')]({'where':{'id':_0x43b91a[_0xf76f('0x4b')]['id']}})[_0xf76f('0x1a')](handleEntityNotFound(_0x339d50,null))['then'](saveUpdates(_0x43b91a['body'],null))[_0xf76f('0x1a')](function(_0x57f265){if(_0x57f265){_0xdd61d1=_0x57f265;return db['Network'][_0xf76f('0x67')]({'where':{'type':_0xdd61d1[_0xf76f('0x38')]},'raw':!![]});}return null;})[_0xf76f('0x1a')](function(_0x16b79e){if(_0xdd61d1[_0xf76f('0x38')][_0xf76f('0x53')]()==_0xf76f('0x54')){var _0x5ae37c=fs[_0xf76f('0x55')](path['join'](config[_0xf76f('0x57')],'server/files/templates/stun_multiple.ejs'),_0xf76f('0x59'));var _0x22c27d=ejs['render'](_0x5ae37c,{'networks':_0x16b79e||[]});fs[_0xf76f('0x5b')]('/etc/asterisk/stun_xcally.conf',_0x22c27d);return respondWithRpcPromise(_0xf76f('0x5d'),_0xf76f('0x65'),{'module':_0xf76f('0x5e')});}else if(_0xdd61d1['type'][_0xf76f('0x53')]()==_0xf76f('0x5f')){var _0x3569b7=fs['readFileSync'](path[_0xf76f('0x56')](config[_0xf76f('0x57')],_0xf76f('0x60')),_0xf76f('0x59'));var _0x38ca85=ejs['render'](_0x3569b7,{'networks':_0x16b79e||[]});fs[_0xf76f('0x5b')](_0xf76f('0x61'),_0x38ca85);return respondWithRpcPromise(_0xf76f('0x5d'),_0xf76f('0x65'),{'module':_0xf76f('0x5e')});}else{var _0x40994c=fs[_0xf76f('0x55')](path[_0xf76f('0x56')](config[_0xf76f('0x57')],_0xf76f('0x62')),_0xf76f('0x59'));var _0x546af7=ejs[_0xf76f('0x5a')](_0x40994c,{'networks':_0x16b79e||[]});fs[_0xf76f('0x5b')](util[_0xf76f('0x63')](_0xf76f('0x68'),_0x43b91a[_0xf76f('0x52')][_0xf76f('0x38')][_0xf76f('0x64')]()),_0x546af7);return respondWithRpcPromise('Reload','update',{'module':_0xf76f('0x69')});}return null;})[_0xf76f('0x1a')](function(_0x3e96c0){if(_0x3e96c0){return _0xdd61d1;}return null;});})['then'](respondWithResult(_0x339d50,null))['catch'](handleError(_0x339d50,null));};exports['destroy']=function(_0x3dd5b8,_0x3daee4,_0x22bc4b){var _0x1440fa;return db['Network'][_0xf76f('0x4f')]({'where':{'id':_0x3dd5b8[_0xf76f('0x4b')]['id']}})[_0xf76f('0x1a')](function(_0x221f26){_0x1440fa=_0x221f26;return _0x221f26;})['then'](handleEntityNotFound(_0x3daee4,null))['then'](removeEntity(_0x3daee4,null))['then'](function(){if(_0x1440fa){return db['Network'][_0xf76f('0x67')]({'where':{'type':_0x1440fa[_0xf76f('0x38')]},'raw':!![]});}})[_0xf76f('0x1a')](function(_0x5181bd){if(_0x1440fa[_0xf76f('0x38')][_0xf76f('0x53')]()==_0xf76f('0x54')){var _0x2c8587=fs[_0xf76f('0x55')](path['join'](config[_0xf76f('0x57')],'server/files/templates/stun_multiple.ejs'),_0xf76f('0x59'));var _0x1c7f75=ejs[_0xf76f('0x5a')](_0x2c8587,{'networks':_0x5181bd||[]});fs[_0xf76f('0x5b')](_0xf76f('0x5c'),_0x1c7f75);return respondWithRpcPromise(_0xf76f('0x5d'),_0xf76f('0x2f'),{'module':_0xf76f('0x5e')});}else if(_0x1440fa[_0xf76f('0x38')][_0xf76f('0x53')]()==_0xf76f('0x5f')){var _0x312bc1=fs[_0xf76f('0x55')](path[_0xf76f('0x56')](config[_0xf76f('0x57')],_0xf76f('0x60')),_0xf76f('0x59'));var _0x1edc6d=ejs['render'](_0x312bc1,{'networks':_0x5181bd||[]});fs[_0xf76f('0x5b')](_0xf76f('0x61'),_0x1edc6d);return respondWithRpcPromise(_0xf76f('0x5d'),_0xf76f('0x2f'),{'module':'res_stun_monitor.so'});}else{var _0x3eadee=fs['readFileSync'](path[_0xf76f('0x56')](config[_0xf76f('0x57')],_0xf76f('0x62')),_0xf76f('0x59'));var _0x4767f7=ejs[_0xf76f('0x5a')](_0x3eadee,{'networks':_0x5181bd||[]});fs[_0xf76f('0x5b')](util[_0xf76f('0x63')](_0xf76f('0x68'),_0x3dd5b8[_0xf76f('0x52')][_0xf76f('0x38')]['toLowerCase']()),_0x4767f7);return respondWithRpcPromise('Reload','destroy',{'module':_0xf76f('0x69')});}return null;})['catch'](handleError(_0x3daee4,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 00a72f8..a0807a1 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 _0x4483=['define','Network','network','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./network.attributes','exports'];(function(_0x6fe248,_0x446dfb){var _0x601d6e=function(_0xf1f93){while(--_0xf1f93){_0x6fe248['push'](_0x6fe248['shift']());}};_0x601d6e(++_0x446dfb);}(_0x4483,0x1a3));var _0x3448=function(_0x28681e,_0xdf3ec2){_0x28681e=_0x28681e-0x0;var _0x22e2cc=_0x4483[_0x28681e];return _0x22e2cc;};'use strict';var _=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var logger=require(_0x3448('0x2'))('api');var moment=require(_0x3448('0x3'));var BPromise=require(_0x3448('0x4'));var rp=require(_0x3448('0x5'));var fs=require('fs');var path=require(_0x3448('0x6'));var rimraf=require(_0x3448('0x7'));var config=require('../../config/environment');var attributes=require(_0x3448('0x8'));module[_0x3448('0x9')]=function(_0x1b05db,_0xd3606d){return _0x1b05db[_0x3448('0xa')](_0x3448('0xb'),attributes,{'tableName':_0x3448('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb6b1=['../../config/logger','moment','bluebird','path','../../config/environment','./network.attributes','exports','define','network','lodash'];(function(_0x1bc750,_0x23f442){var _0xcd51da=function(_0x323854){while(--_0x323854){_0x1bc750['push'](_0x1bc750['shift']());}};_0xcd51da(++_0x23f442);}(_0xb6b1,0x17b));var _0x1b6b=function(_0x5280f4,_0x3c36d0){_0x5280f4=_0x5280f4-0x0;var _0xba93e7=_0xb6b1[_0x5280f4];return _0xba93e7;};'use strict';var _=require(_0x1b6b('0x0'));var util=require('util');var logger=require(_0x1b6b('0x1'))('api');var moment=require(_0x1b6b('0x2'));var BPromise=require(_0x1b6b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1b6b('0x4'));var rimraf=require('rimraf');var config=require(_0x1b6b('0x5'));var attributes=require(_0x1b6b('0x6'));module[_0x1b6b('0x7')]=function(_0xdbbe22,_0x5870ca){return _0xdbbe22[_0x1b6b('0x8')]('Network',attributes,{'tableName':_0x1b6b('0x9'),'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 f674e52..75877ae 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x22d6d6,_0x5250c3){var _0x1dbb9d=function(_0x2a4a04){while(--_0x2a4a04){_0x22d6d6['push'](_0x22d6d6['shift']());}};_0x1dbb9d(++_0x5250c3);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file +var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7a54,0x106));var _0x47a5=function(_0x4ab876,_0x2e026e){_0x4ab876=_0x4ab876-0x0;var _0x1cb710=_0x7a54[_0x4ab876];return _0x1cb710;};'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 b351100..17edc46 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 _0x7b01=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelAccount.controller','get','isAuthenticated','index','/describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','addDisposition','addAnswer','notify','/:id/applications','addApplications','addAgents','/:id/send','put','/:id','update','delete','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7b01,0x182));var _0x17b0=function(_0x425cd2,_0x4e246e){_0x425cd2=_0x425cd2-0x0;var _0x3618f8=_0x7b01[_0x425cd2];return _0x3618f8;};'use strict';var multer=require(_0x17b0('0x0'));var util=require(_0x17b0('0x1'));var path=require(_0x17b0('0x2'));var timeout=require(_0x17b0('0x3'));var express=require(_0x17b0('0x4'));var router=express[_0x17b0('0x5')]();var fs_extra=require(_0x17b0('0x6'));var auth=require(_0x17b0('0x7'));var interaction=require(_0x17b0('0x8'));var config=require('../../config/environment');var controller=require(_0x17b0('0x9'));router[_0x17b0('0xa')]('/',auth[_0x17b0('0xb')](),controller[_0x17b0('0xc')]);router['get'](_0x17b0('0xd'),auth[_0x17b0('0xb')](),controller['describe']);router[_0x17b0('0xa')]('/:id',auth[_0x17b0('0xb')](),controller[_0x17b0('0xe')]);router[_0x17b0('0xa')](_0x17b0('0xf'),auth[_0x17b0('0xb')](),controller[_0x17b0('0x10')]);router[_0x17b0('0xa')](_0x17b0('0x11'),auth[_0x17b0('0xb')](),controller['getAnswers']);router[_0x17b0('0xa')]('/:id/applications',auth[_0x17b0('0xb')](),controller[_0x17b0('0x12')]);router['get'](_0x17b0('0x13'),auth[_0x17b0('0xb')](),controller[_0x17b0('0x14')]);router[_0x17b0('0xa')](_0x17b0('0x15'),auth['isAuthenticated'](),controller[_0x17b0('0x16')]);router[_0x17b0('0x17')]('/',auth['isAuthenticated'](),controller[_0x17b0('0x18')]);router[_0x17b0('0x17')](_0x17b0('0xf'),auth[_0x17b0('0xb')](),controller[_0x17b0('0x19')]);router[_0x17b0('0x17')](_0x17b0('0x11'),auth['isAuthenticated'](),controller[_0x17b0('0x1a')]);router[_0x17b0('0x17')]('/:id/notify',controller[_0x17b0('0x1b')]);router['post'](_0x17b0('0x1c'),auth[_0x17b0('0xb')](),controller[_0x17b0('0x1d')]);router[_0x17b0('0x17')](_0x17b0('0x15'),auth[_0x17b0('0xb')](),controller[_0x17b0('0x1e')]);router[_0x17b0('0x17')](_0x17b0('0x1f'),auth[_0x17b0('0xb')](),controller['send']);router[_0x17b0('0x20')](_0x17b0('0x21'),auth[_0x17b0('0xb')](),controller[_0x17b0('0x22')]);router[_0x17b0('0x23')](_0x17b0('0x21'),auth['isAuthenticated'](),controller['destroy']);router[_0x17b0('0x23')](_0x17b0('0xf'),auth[_0x17b0('0xb')](),controller[_0x17b0('0x24')]);router[_0x17b0('0x23')](_0x17b0('0x11'),auth[_0x17b0('0xb')](),controller['removeAnswers']);router[_0x17b0('0x23')](_0x17b0('0x15'),auth['isAuthenticated'](),controller[_0x17b0('0x25')]);module[_0x17b0('0x26')]=router; \ No newline at end of file +var _0x1dd7=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelAccount.controller','get','isAuthenticated','/describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','/:id/dispositions','addAnswer','notify','/:id/applications','addApplications','addAgents','/:id/send','send','put','update','delete','removeDispositions','removeAnswers','removeAgents','multer'];(function(_0x5c6b62,_0x559670){var _0x28e406=function(_0xd6c5de){while(--_0xd6c5de){_0x5c6b62['push'](_0x5c6b62['shift']());}};_0x28e406(++_0x559670);}(_0x1dd7,0x155));var _0x71dd=function(_0x36940e,_0x11f338){_0x36940e=_0x36940e-0x0;var _0x3283f2=_0x1dd7[_0x36940e];return _0x3283f2;};'use strict';var multer=require(_0x71dd('0x0'));var util=require(_0x71dd('0x1'));var path=require(_0x71dd('0x2'));var timeout=require(_0x71dd('0x3'));var express=require(_0x71dd('0x4'));var router=express[_0x71dd('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x71dd('0x6'));var interaction=require(_0x71dd('0x7'));var config=require('../../config/environment');var controller=require(_0x71dd('0x8'));router[_0x71dd('0x9')]('/',auth[_0x71dd('0xa')](),controller['index']);router[_0x71dd('0x9')](_0x71dd('0xb'),auth[_0x71dd('0xa')](),controller['describe']);router[_0x71dd('0x9')](_0x71dd('0xc'),auth[_0x71dd('0xa')](),controller[_0x71dd('0xd')]);router[_0x71dd('0x9')]('/:id/dispositions',auth[_0x71dd('0xa')](),controller[_0x71dd('0xe')]);router[_0x71dd('0x9')](_0x71dd('0xf'),auth[_0x71dd('0xa')](),controller[_0x71dd('0x10')]);router[_0x71dd('0x9')]('/:id/applications',auth[_0x71dd('0xa')](),controller[_0x71dd('0x11')]);router['get'](_0x71dd('0x12'),auth[_0x71dd('0xa')](),controller[_0x71dd('0x13')]);router[_0x71dd('0x9')](_0x71dd('0x14'),auth[_0x71dd('0xa')](),controller[_0x71dd('0x15')]);router[_0x71dd('0x16')]('/',auth[_0x71dd('0xa')](),controller[_0x71dd('0x17')]);router[_0x71dd('0x16')](_0x71dd('0x18'),auth[_0x71dd('0xa')](),controller['addDisposition']);router[_0x71dd('0x16')](_0x71dd('0xf'),auth[_0x71dd('0xa')](),controller[_0x71dd('0x19')]);router[_0x71dd('0x16')]('/:id/notify',controller[_0x71dd('0x1a')]);router[_0x71dd('0x16')](_0x71dd('0x1b'),auth[_0x71dd('0xa')](),controller[_0x71dd('0x1c')]);router['post'](_0x71dd('0x14'),auth[_0x71dd('0xa')](),controller[_0x71dd('0x1d')]);router[_0x71dd('0x16')](_0x71dd('0x1e'),auth[_0x71dd('0xa')](),controller[_0x71dd('0x1f')]);router[_0x71dd('0x20')]('/:id',auth['isAuthenticated'](),controller[_0x71dd('0x21')]);router[_0x71dd('0x22')](_0x71dd('0xc'),auth[_0x71dd('0xa')](),controller['destroy']);router[_0x71dd('0x22')](_0x71dd('0x18'),auth[_0x71dd('0xa')](),controller[_0x71dd('0x23')]);router[_0x71dd('0x22')]('/:id/canned_answers',auth[_0x71dd('0xa')](),controller[_0x71dd('0x24')]);router[_0x71dd('0x22')](_0x71dd('0x14'),auth['isAuthenticated'](),controller[_0x71dd('0x25')]);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 7a8142c..031d811 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 _0x7128=['randomstring','name','STRING','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','sequelize'];(function(_0x5526fc,_0x50cb07){var _0x3a36a4=function(_0x35e65f){while(--_0x35e65f){_0x5526fc['push'](_0x5526fc['shift']());}};_0x3a36a4(++_0x50cb07);}(_0x7128,0x83));var _0x8712=function(_0x65c50e,_0x1aa926){_0x65c50e=_0x65c50e-0x0;var _0x4573e7=_0x7128[_0x65c50e];return _0x4573e7;};'use strict';var Sequelize=require(_0x8712('0x0'));var rs=require(_0x8712('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x8712('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x8712('0x3')]},'token':{'type':Sequelize[_0x8712('0x3')],'defaultValue':function(){return rs[_0x8712('0x4')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x8712('0x5')],'defaultValue':function(){return _0x8712('0x6');}},'notificationSound':{'type':Sequelize[_0x8712('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8712('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8712('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0x8712('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8712('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8712('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8712('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x8712('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x8712('0x7')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x50924e){if(!_0x50924e)this[_0x8712('0xa')](_0x8712('0xb'),null);this[_0x8712('0xa')]('mandatoryDisposition',_0x50924e);}}}; \ No newline at end of file +var _0x10a7=['BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0xc2b4c8,_0x756a49){var _0x402443=function(_0x571bae){while(--_0x571bae){_0xc2b4c8['push'](_0xc2b4c8['shift']());}};_0x402443(++_0x756a49);}(_0x10a7,0x110));var _0x710a=function(_0x4f76b3,_0x2a3d9c){_0x4f76b3=_0x4f76b3-0x0;var _0x2ca31c=_0x10a7[_0x4f76b3];return _0x2ca31c;};'use strict';var Sequelize=require(_0x710a('0x0'));var rs=require(_0x710a('0x1'));module[_0x710a('0x2')]={'name':{'type':Sequelize[_0x710a('0x3')],'unique':_0x710a('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x710a('0x3')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x710a('0x5')]();}},'replyUri':{'type':Sequelize[_0x710a('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x710a('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x710a('0x6')],'defaultValue':function(){return _0x710a('0x7');}},'notificationSound':{'type':Sequelize[_0x710a('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x710a('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x710a('0x3')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x710a('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x710a('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x710a('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x710a('0x9')],'allowNull':!![],'defaultValue':null,'comment':_0x710a('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x710a('0x8')],'defaultValue':![],'comment':_0x710a('0xb'),'set':function(_0x7f5ad7){if(!_0x7f5ad7)this['setDataValue'](_0x710a('0xc'),null);this['setDataValue'](_0x710a('0xd'),_0x7f5ad7);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index db2dffe..0b50d93 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 _0x7639=['agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','internal','Tag','Tags','color','tag','addAgents','omit','userOpenchannelAccount:save','removeAgents','isArray','emit','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','out','OpenchannelMessage','Messages','dataValues','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','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','redis','defaults','localhost','register','client','http','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','type','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','OpenchannelAccount','findAll','rows','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','addDisposition','Disposition','getDispositions','findOne','OpenchannelAccountId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','CmContact','Contacts','DESC','OpenchannelApplication','Applications','List','account','applications','list','priority','asc','ListId','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','push','close','unmanaged','*,*,*,*','UserId','User','unshift'];(function(_0x2e6dbf,_0x57dd06){var _0x2680e5=function(_0x4018f4){while(--_0x4018f4){_0x2e6dbf['push'](_0x2e6dbf['shift']());}};_0x2680e5(++_0x57dd06);}(_0x7639,0xdf));var _0x9763=function(_0x1ee1bb,_0x3eb737){_0x1ee1bb=_0x1ee1bb-0x0;var _0x39f74a=_0x7639[_0x1ee1bb];return _0x39f74a;};'use strict';var emlformat=require(_0x9763('0x0'));var rimraf=require(_0x9763('0x1'));var zipdir=require(_0x9763('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9763('0x3'));var BPromise=require(_0x9763('0x4'));var Mustache=require(_0x9763('0x5'));var util=require(_0x9763('0x6'));var path=require(_0x9763('0x7'));var sox=require('sox');var csv=require(_0x9763('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9763('0x9'));var _=require(_0x9763('0xa'));var squel=require(_0x9763('0xb'));var crypto=require(_0x9763('0xc'));var jsforce=require(_0x9763('0xd'));var deskjs=require(_0x9763('0xe'));var toCsv=require(_0x9763('0x8'));var querystring=require(_0x9763('0xf'));var Papa=require('papaparse');var Redis=require(_0x9763('0x10'));var authService=require(_0x9763('0x11'));var qs=require(_0x9763('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9763('0x13'));var logger=require(_0x9763('0x14'))(_0x9763('0x15'));var utils=require(_0x9763('0x16'));var config=require(_0x9763('0x17'));var licenseUtil=require(_0x9763('0x18'));var db=require('../../mysqldb')['db'];config[_0x9763('0x19')]=_[_0x9763('0x1a')](config[_0x9763('0x19')],{'host':_0x9763('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./openchannelAccount.socket')[_0x9763('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x9763('0x1d')][_0x9763('0x1e')]({'port':0x232c});var client9002=jayson[_0x9763('0x1d')][_0x9763('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x4afbd7,_0x1930f5,_0x4eaddc,_0x2bc07b){return new BPromise(function(_0x20838b,_0x5162ab){var _0x2de427=_0x2bc07b||client;return _0x2de427['request'](_0x4afbd7,_0x4eaddc)[_0x9763('0x1f')](function(_0x30a8c9){logger[_0x9763('0x20')](_0x9763('0x21'),_0x1930f5,_0x9763('0x22'));logger[_0x9763('0x23')](_0x9763('0x24'),_0x1930f5,_0x9763('0x22'),JSON[_0x9763('0x25')](_0x30a8c9));if(_0x30a8c9[_0x9763('0x26')]){if(_0x30a8c9[_0x9763('0x26')][_0x9763('0x27')]===0x1f4){logger[_0x9763('0x26')]('OpenchannelAccount,\x20%s,\x20%s',_0x1930f5,_0x30a8c9[_0x9763('0x26')][_0x9763('0x28')]);return _0x5162ab(_0x30a8c9[_0x9763('0x26')][_0x9763('0x28')]);}logger['error'](_0x9763('0x21'),_0x1930f5,_0x30a8c9['error'][_0x9763('0x28')]);return _0x20838b(_0x30a8c9[_0x9763('0x26')][_0x9763('0x28')]);}else{logger['info'](_0x9763('0x21'),_0x1930f5,'request\x20sent');_0x20838b(_0x30a8c9[_0x9763('0x29')]['message']);}})[_0x9763('0x2a')](function(_0x3c0c95){logger[_0x9763('0x26')]('OpenchannelAccount,\x20%s,\x20%s',_0x1930f5,_0x3c0c95);_0x5162ab(_0x3c0c95);});});}function respondWithStatusCode(_0x5d0ff2,_0x3f4b01){_0x3f4b01=_0x3f4b01||0xcc;return function(_0x51e0f3){if(_0x51e0f3){return _0x5d0ff2[_0x9763('0x2b')](_0x3f4b01);}return _0x5d0ff2[_0x9763('0x2c')](_0x3f4b01)[_0x9763('0x2d')]();};}function respondWithResult(_0x4ae15c,_0x3031bb){_0x3031bb=_0x3031bb||0xc8;return function(_0x179518){if(_0x179518){return _0x4ae15c[_0x9763('0x2c')](_0x3031bb)[_0x9763('0x2e')](_0x179518);}};}function respondWithFilteredResult(_0x434d38,_0x5c6e82){return function(_0xc2cfa7){if(_0xc2cfa7){var _0x233274=typeof _0x5c6e82['offset']==='undefined'&&typeof _0x5c6e82[_0x9763('0x2f')]===_0x9763('0x30');var _0x5c8590=_0xc2cfa7[_0x9763('0x31')];var _0x49e7f7=_0x233274?0x0:_0x5c6e82['offset'];var _0x451368=_0x233274?_0xc2cfa7[_0x9763('0x31')]:_0x5c6e82[_0x9763('0x32')]+_0x5c6e82[_0x9763('0x2f')];var _0x55d4d6;if(_0x451368>=_0x5c8590){_0x451368=_0x5c8590;_0x55d4d6=0xc8;}else{_0x55d4d6=0xce;}_0x434d38[_0x9763('0x2c')](_0x55d4d6);return _0x434d38[_0x9763('0x33')](_0x9763('0x34'),_0x49e7f7+'-'+_0x451368+'/'+_0x5c8590)[_0x9763('0x2e')](_0xc2cfa7);}return null;};}function patchUpdates(_0xbf293c){return function(_0x4b7565){try{jsonpatch[_0x9763('0x35')](_0x4b7565,_0xbf293c,!![]);}catch(_0x3eda96){return BPromise[_0x9763('0x36')](_0x3eda96);}return _0x4b7565['save']();};}function saveUpdates(_0x4e5530,_0x4ff14e){return function(_0x47317c){if(_0x47317c){return _0x47317c['update'](_0x4e5530)['then'](function(_0x326c5){return _0x326c5;});}return null;};}function removeEntity(_0x4c79a6,_0x4ad5c2){return function(_0x5b1e20){if(_0x5b1e20){return _0x5b1e20[_0x9763('0x37')]()[_0x9763('0x1f')](function(){var _0x2a097f=_0x5b1e20[_0x9763('0x38')]({'plain':!![]});var _0x301ffe=_0x9763('0x39');return db[_0x9763('0x3a')][_0x9763('0x37')]({'where':{'type':_0x301ffe,'resourceId':_0x2a097f['id']}})[_0x9763('0x1f')](function(){return _0x5b1e20;});})[_0x9763('0x1f')](function(){_0x4c79a6[_0x9763('0x2c')](0xcc)[_0x9763('0x2d')]();});}};}function handleEntityNotFound(_0x4b3073,_0x25d359){return function(_0x194c7c){if(!_0x194c7c){_0x4b3073[_0x9763('0x2b')](0x194);}return _0x194c7c;};}function handleError(_0x528335,_0x3f1f41){_0x3f1f41=_0x3f1f41||0x1f4;return function(_0x4124b1){logger[_0x9763('0x26')](_0x4124b1[_0x9763('0x3b')]);if(_0x4124b1[_0x9763('0x3c')]){delete _0x4124b1[_0x9763('0x3c')];}_0x528335[_0x9763('0x2c')](_0x3f1f41)[_0x9763('0x3d')](_0x4124b1);};}exports[_0x9763('0x3e')]=function(_0x1a8d7a,_0x402893){var _0x32a465={'include':[{'model':db[_0x9763('0x3f')],'as':_0x9763('0x40')}]},_0x5cd8cd={},_0x32176f={'count':0x0,'rows':[]};var _0x40769b=_[_0x9763('0x41')](db['OpenchannelAccount'][_0x9763('0x42')],function(_0x90f947){return{'name':_0x90f947['fieldName'],'type':_0x90f947[_0x9763('0x43')]['key']};});_0x5cd8cd['model']=_[_0x9763('0x41')](_0x40769b,_0x9763('0x3c'));_0x5cd8cd[_0x9763('0x44')]=_[_0x9763('0x45')](_0x1a8d7a['query']);_0x5cd8cd['filters']=_['intersection'](_0x5cd8cd[_0x9763('0x46')],_0x5cd8cd[_0x9763('0x44')]);_0x32a465[_0x9763('0x47')]=_[_0x9763('0x48')](_0x5cd8cd[_0x9763('0x46')],qs[_0x9763('0x49')](_0x1a8d7a[_0x9763('0x44')][_0x9763('0x49')]));_0x32a465['attributes']=_0x32a465[_0x9763('0x47')][_0x9763('0x4a')]?_0x32a465[_0x9763('0x47')]:_0x5cd8cd[_0x9763('0x46')];if(!_0x1a8d7a['query'][_0x9763('0x4b')](_0x9763('0x4c'))){_0x32a465['limit']=qs[_0x9763('0x2f')](_0x1a8d7a['query'][_0x9763('0x2f')]);_0x32a465[_0x9763('0x32')]=qs['offset'](_0x1a8d7a[_0x9763('0x44')][_0x9763('0x32')]);}_0x32a465[_0x9763('0x4d')]=qs[_0x9763('0x4e')](_0x1a8d7a[_0x9763('0x44')][_0x9763('0x4e')]);_0x32a465[_0x9763('0x4f')]=qs[_0x9763('0x50')](_[_0x9763('0x51')](_0x1a8d7a[_0x9763('0x44')],_0x5cd8cd[_0x9763('0x50')]),_0x40769b);if(_0x1a8d7a[_0x9763('0x44')][_0x9763('0x52')]){_0x32a465[_0x9763('0x4f')]=_[_0x9763('0x53')](_0x32a465[_0x9763('0x4f')],{'$or':_[_0x9763('0x41')](_0x40769b,function(_0x22bbf4){if(_0x22bbf4[_0x9763('0x43')]!==_0x9763('0x54')){var _0xca17fd={};_0xca17fd[_0x22bbf4[_0x9763('0x3c')]]={'$like':'%'+_0x1a8d7a[_0x9763('0x44')][_0x9763('0x52')]+'%'};return _0xca17fd;}})});}_0x32a465=_[_0x9763('0x53')]({},_0x32a465,_0x1a8d7a[_0x9763('0x55')]);var _0x46e37f={'where':_0x32a465[_0x9763('0x4f')]};return db['OpenchannelAccount'][_0x9763('0x31')](_0x46e37f)['then'](function(_0xfddade){_0x32176f[_0x9763('0x31')]=_0xfddade;if(_0x1a8d7a[_0x9763('0x44')][_0x9763('0x56')]){_0x32a465[_0x9763('0x57')]=[{'all':!![]}];}return db[_0x9763('0x58')][_0x9763('0x59')](_0x32a465);})['then'](function(_0x1f62f9){_0x32176f[_0x9763('0x5a')]=_0x1f62f9;return _0x32176f;})[_0x9763('0x1f')](respondWithFilteredResult(_0x402893,_0x32a465))[_0x9763('0x2a')](handleError(_0x402893,null));};exports[_0x9763('0x5b')]=function(_0x4df4c2,_0xeb6aa9){var _0xda354d={'raw':![],'where':{'id':_0x4df4c2['params']['id']},'include':[{'model':db[_0x9763('0x3f')],'as':_0x9763('0x40')}]},_0x1eaebe={};_0x1eaebe[_0x9763('0x46')]=_[_0x9763('0x45')](db[_0x9763('0x58')]['rawAttributes']);_0x1eaebe[_0x9763('0x44')]=_[_0x9763('0x45')](_0x4df4c2['query']);_0x1eaebe[_0x9763('0x50')]=_['intersection'](_0x1eaebe[_0x9763('0x46')],_0x1eaebe[_0x9763('0x44')]);_0xda354d[_0x9763('0x47')]=_[_0x9763('0x48')](_0x1eaebe[_0x9763('0x46')],qs[_0x9763('0x49')](_0x4df4c2[_0x9763('0x44')][_0x9763('0x49')]));_0xda354d[_0x9763('0x47')]=_0xda354d['attributes'][_0x9763('0x4a')]?_0xda354d['attributes']:_0x1eaebe[_0x9763('0x46')];if(_0x4df4c2['query']['includeAll']){_0xda354d[_0x9763('0x57')]=[{'all':!![]}];}_0xda354d=_['merge']({},_0xda354d,_0x4df4c2[_0x9763('0x55')]);return db[_0x9763('0x58')][_0x9763('0x5c')](_0xda354d)[_0x9763('0x1f')](handleEntityNotFound(_0xeb6aa9,null))['then'](respondWithResult(_0xeb6aa9,null))[_0x9763('0x2a')](handleError(_0xeb6aa9,null));};exports[_0x9763('0x5d')]=function(_0x4d9958,_0x4eeda5){return db[_0x9763('0x58')][_0x9763('0x5d')](_0x4d9958[_0x9763('0x5e')],{})[_0x9763('0x1f')](function(_0x34d535){var _0x2a2790=_0x4d9958[_0x9763('0x5f')][_0x9763('0x38')]({'plain':!![]});if(!_0x2a2790)throw new Error(_0x9763('0x60'));if(_0x2a2790[_0x9763('0x61')]==='user'){var _0x4bcdc6=_0x34d535[_0x9763('0x38')]({'plain':!![]});var _0x54aea3=_0x9763('0x39');return db['UserProfileSection'][_0x9763('0x5c')]({'where':{'name':_0x54aea3,'userProfileId':_0x2a2790['userProfileId']},'raw':!![]})[_0x9763('0x1f')](function(_0x1b3b53){if(_0x1b3b53&&_0x1b3b53[_0x9763('0x62')]===0x0){return db[_0x9763('0x3a')]['create']({'name':_0x4bcdc6[_0x9763('0x3c')],'resourceId':_0x4bcdc6['id'],'type':_0x1b3b53[_0x9763('0x3c')],'sectionId':_0x1b3b53['id']},{})[_0x9763('0x1f')](function(){return _0x34d535;});}else{return _0x34d535;}})[_0x9763('0x2a')](function(_0x332cd2){logger[_0x9763('0x26')](_0x9763('0x63'),_0x332cd2);throw _0x332cd2;});}return _0x34d535;})[_0x9763('0x1f')](respondWithResult(_0x4eeda5,0xc9))[_0x9763('0x2a')](handleError(_0x4eeda5,null));};exports[_0x9763('0x64')]=function(_0x3f7b1e,_0xc4a85c){if(_0x3f7b1e[_0x9763('0x5e')]['id']){delete _0x3f7b1e[_0x9763('0x5e')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x3f7b1e[_0x9763('0x65')]['id']},'include':[{'model':db[_0x9763('0x3f')],'as':_0x9763('0x40')}]})[_0x9763('0x1f')](handleEntityNotFound(_0xc4a85c,null))[_0x9763('0x1f')](saveUpdates(_0x3f7b1e[_0x9763('0x5e')],null))[_0x9763('0x1f')](respondWithResult(_0xc4a85c,null))[_0x9763('0x2a')](handleError(_0xc4a85c,null));};exports['destroy']=function(_0x35851f,_0x10ff14){return db['OpenchannelAccount'][_0x9763('0x5c')]({'where':{'id':_0x35851f[_0x9763('0x65')]['id']}})['then'](handleEntityNotFound(_0x10ff14,null))[_0x9763('0x1f')](removeEntity(_0x10ff14,null))[_0x9763('0x2a')](handleError(_0x10ff14,null));};exports[_0x9763('0x66')]=function(_0x3cf663,_0x52c913){return db[_0x9763('0x58')]['describe']()['then'](respondWithResult(_0x52c913,null))[_0x9763('0x2a')](handleError(_0x52c913,null));};exports[_0x9763('0x67')]=function(_0x438c96,_0x1c655b,_0x562514){if(_0x438c96[_0x9763('0x5e')]['id']){delete _0x438c96[_0x9763('0x5e')]['id'];}return db['OpenchannelAccount'][_0x9763('0x5c')]({'where':{'id':_0x438c96['params']['id']}})[_0x9763('0x1f')](handleEntityNotFound(_0x1c655b,null))[_0x9763('0x1f')](function(_0x5dfa40){if(_0x5dfa40){_0x438c96[_0x9763('0x5e')]['OpenchannelAccountId']=_0x5dfa40['id'];return db[_0x9763('0x68')][_0x9763('0x5d')](_0x438c96[_0x9763('0x5e')]);}})[_0x9763('0x1f')](respondWithResult(_0x1c655b,null))[_0x9763('0x2a')](handleError(_0x1c655b,null));};exports[_0x9763('0x69')]=function(_0x3cc5a9,_0x344504,_0x13a4b3){var _0x3b0031={'raw':![],'where':{}};var _0x2c4e86={};var _0x4aa386={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x9763('0x6a')]({'where':{'id':_0x3cc5a9[_0x9763('0x65')]['id']}})[_0x9763('0x1f')](handleEntityNotFound(_0x344504,null))[_0x9763('0x1f')](function(_0x14f9db){if(_0x14f9db){_0x2c4e86[_0x9763('0x46')]=_[_0x9763('0x45')](db[_0x9763('0x68')][_0x9763('0x42')]);_0x2c4e86['query']=_['keys'](_0x3cc5a9['query']);_0x2c4e86[_0x9763('0x50')]=_[_0x9763('0x48')](_0x2c4e86[_0x9763('0x46')],_0x2c4e86[_0x9763('0x44')]);_0x3b0031[_0x9763('0x47')]=_[_0x9763('0x48')](_0x2c4e86[_0x9763('0x46')],qs['fields'](_0x3cc5a9[_0x9763('0x44')][_0x9763('0x49')]));_0x3b0031[_0x9763('0x47')]=_0x3b0031[_0x9763('0x47')][_0x9763('0x4a')]?_0x3b0031['attributes']:_0x2c4e86['model'];if(!_0x3cc5a9[_0x9763('0x44')]['hasOwnProperty'](_0x9763('0x4c'))){_0x3b0031[_0x9763('0x2f')]=qs['limit'](_0x3cc5a9[_0x9763('0x44')][_0x9763('0x2f')]);_0x3b0031[_0x9763('0x32')]=qs[_0x9763('0x32')](_0x3cc5a9[_0x9763('0x44')][_0x9763('0x32')]);}_0x3b0031[_0x9763('0x4d')]=qs['sort'](_0x3cc5a9['query'][_0x9763('0x4e')]);_0x3b0031['where']=qs[_0x9763('0x50')](_['pick'](_0x3cc5a9[_0x9763('0x44')],_0x2c4e86[_0x9763('0x50')]));_0x3b0031['where'][_0x9763('0x6b')]=_0x14f9db['id'];if(_0x3cc5a9[_0x9763('0x44')][_0x9763('0x52')]){_0x3b0031[_0x9763('0x4f')]=_['merge'](_0x3b0031[_0x9763('0x4f')],{'$or':_[_0x9763('0x41')](_0x3b0031[_0x9763('0x47')],function(_0x4ad71d){var _0x43eaa4={};_0x43eaa4[_0x4ad71d]={'$like':'%'+_0x3cc5a9['query']['filter']+'%'};return _0x43eaa4;})});}_0x3b0031=_[_0x9763('0x53')]({},_0x3b0031,_0x3cc5a9[_0x9763('0x55')]);return db[_0x9763('0x68')][_0x9763('0x31')]({'where':_0x3b0031[_0x9763('0x4f')]})[_0x9763('0x1f')](function(_0x1c2059){_0x4aa386[_0x9763('0x31')]=_0x1c2059;if(_0x3cc5a9[_0x9763('0x44')][_0x9763('0x56')]){_0x3b0031['include']=[{'all':!![]}];}return db[_0x9763('0x68')]['findAll'](_0x3b0031);})[_0x9763('0x1f')](function(_0x488630){_0x4aa386[_0x9763('0x5a')]=_0x488630;return _0x4aa386;});}})[_0x9763('0x1f')](respondWithFilteredResult(_0x344504,_0x3b0031))[_0x9763('0x2a')](handleError(_0x344504,null));};exports[_0x9763('0x6c')]=function(_0x5452ec,_0xd41aa,_0x5ef4ad){return db['OpenchannelAccount']['find']({'where':{'id':_0x5452ec[_0x9763('0x65')]['id']}})[_0x9763('0x1f')](handleEntityNotFound(_0xd41aa,null))[_0x9763('0x1f')](function(_0x51a215){if(_0x51a215){return _0x51a215['removeDispositions'](_0x5452ec[_0x9763('0x44')][_0x9763('0x6d')]);}})[_0x9763('0x1f')](respondWithStatusCode(_0xd41aa,null))[_0x9763('0x2a')](handleError(_0xd41aa,null));};exports[_0x9763('0x6e')]=function(_0x45f0de,_0x3b49fd,_0x147994){if(_0x45f0de[_0x9763('0x5e')]['id']){delete _0x45f0de[_0x9763('0x5e')]['id'];}return db[_0x9763('0x58')][_0x9763('0x5c')]({'where':{'id':_0x45f0de[_0x9763('0x65')]['id']}})['then'](handleEntityNotFound(_0x3b49fd,null))[_0x9763('0x1f')](function(_0x1786e2){if(_0x1786e2){_0x45f0de['body'][_0x9763('0x6b')]=_0x1786e2['id'];return db[_0x9763('0x6f')][_0x9763('0x5d')](_0x45f0de[_0x9763('0x5e')]);}})[_0x9763('0x1f')](respondWithResult(_0x3b49fd,null))['catch'](handleError(_0x3b49fd,null));};exports[_0x9763('0x70')]=function(_0x20912c,_0x1af527,_0x3f16c8){var _0x4a4f92={'raw':![],'where':{}};var _0x1b448a={};var _0xd319c8={'count':0x0,'rows':[]};return db[_0x9763('0x58')]['findOne']({'where':{'id':_0x20912c['params']['id']}})[_0x9763('0x1f')](handleEntityNotFound(_0x1af527,null))[_0x9763('0x1f')](function(_0x2f25a2){if(_0x2f25a2){_0x1b448a[_0x9763('0x46')]=_[_0x9763('0x45')](db[_0x9763('0x6f')][_0x9763('0x42')]);_0x1b448a[_0x9763('0x44')]=_['keys'](_0x20912c[_0x9763('0x44')]);_0x1b448a['filters']=_[_0x9763('0x48')](_0x1b448a[_0x9763('0x46')],_0x1b448a['query']);_0x4a4f92['attributes']=_['intersection'](_0x1b448a[_0x9763('0x46')],qs[_0x9763('0x49')](_0x20912c[_0x9763('0x44')][_0x9763('0x49')]));_0x4a4f92[_0x9763('0x47')]=_0x4a4f92[_0x9763('0x47')][_0x9763('0x4a')]?_0x4a4f92[_0x9763('0x47')]:_0x1b448a['model'];if(!_0x20912c[_0x9763('0x44')]['hasOwnProperty'](_0x9763('0x4c'))){_0x4a4f92[_0x9763('0x2f')]=qs[_0x9763('0x2f')](_0x20912c['query']['limit']);_0x4a4f92[_0x9763('0x32')]=qs[_0x9763('0x32')](_0x20912c[_0x9763('0x44')][_0x9763('0x32')]);}_0x4a4f92[_0x9763('0x4d')]=qs[_0x9763('0x4e')](_0x20912c[_0x9763('0x44')][_0x9763('0x4e')]);_0x4a4f92[_0x9763('0x4f')]=qs['filters'](_[_0x9763('0x51')](_0x20912c['query'],_0x1b448a[_0x9763('0x50')]));_0x4a4f92[_0x9763('0x4f')][_0x9763('0x6b')]=_0x2f25a2['id'];if(_0x20912c[_0x9763('0x44')][_0x9763('0x52')]){_0x4a4f92[_0x9763('0x4f')]=_['merge'](_0x4a4f92['where'],{'$or':_[_0x9763('0x41')](_0x4a4f92['attributes'],function(_0x2e8f90){var _0x242084={};_0x242084[_0x2e8f90]={'$like':'%'+_0x20912c[_0x9763('0x44')]['filter']+'%'};return _0x242084;})});}_0x4a4f92=_[_0x9763('0x53')]({},_0x4a4f92,_0x20912c['options']);return db[_0x9763('0x6f')][_0x9763('0x31')]({'where':_0x4a4f92['where']})[_0x9763('0x1f')](function(_0x5887fa){_0xd319c8['count']=_0x5887fa;if(_0x20912c[_0x9763('0x44')][_0x9763('0x56')]){_0x4a4f92[_0x9763('0x57')]=[{'all':!![]}];}return db[_0x9763('0x6f')]['findAll'](_0x4a4f92);})[_0x9763('0x1f')](function(_0xa70e01){_0xd319c8['rows']=_0xa70e01;return _0xd319c8;});}})[_0x9763('0x1f')](respondWithFilteredResult(_0x1af527,_0x4a4f92))['catch'](handleError(_0x1af527,null));};exports[_0x9763('0x71')]=function(_0x4d6034,_0x2ff79a,_0x4caee8){return db[_0x9763('0x58')][_0x9763('0x5c')]({'where':{'id':_0x4d6034['params']['id']}})[_0x9763('0x1f')](handleEntityNotFound(_0x2ff79a,null))[_0x9763('0x1f')](function(_0x2cef0d){if(_0x2cef0d){return _0x2cef0d['removeAnswers'](_0x4d6034[_0x9763('0x44')][_0x9763('0x6d')]);}})[_0x9763('0x1f')](respondWithStatusCode(_0x2ff79a,null))[_0x9763('0x2a')](handleError(_0x2ff79a,null));};exports[_0x9763('0x72')]=function(_0x41c685,_0x3d4dd1,_0x56ee40){var _0x4ad8d5={'body':_0x41c685[_0x9763('0x5e')],'channel':_0x9763('0x73')};var _0x5e51f5=[];var _0x180614=[];var _0x10e499={};var _0x6b975=![];return db['CmContact'][_0x9763('0x66')]()[_0x9763('0x1f')](function(_0x451238){if(!_0x451238){throw new db[(_0x9763('0x74'))][(_0x9763('0x75'))](_0x9763('0x76'));}_0x5e51f5=_[_0x9763('0x77')](_[_0x9763('0x45')](_0x451238),['createdAt','updatedAt']);_0x180614=_[_0x9763('0x77')](_[_0x9763('0x45')](_0x451238),[_0x9763('0x78'),_0x9763('0x79'),_0x9763('0x7a'),'ListId']);if(_0x41c685[_0x9763('0x5e')]['id']){delete _0x41c685[_0x9763('0x5e')]['id'];}if(_['isNil'](_0x41c685[_0x9763('0x5e')]['from'])){throw new db[(_0x9763('0x74'))][(_0x9763('0x75'))](_0x9763('0x7b'));}if(_[_0x9763('0x7c')](_0x41c685[_0x9763('0x5e')]['body'])||_0x41c685[_0x9763('0x5e')][_0x9763('0x5e')]===''){throw new db['Sequelize'][(_0x9763('0x75'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x9763('0x7c')](_0x41c685['body'][_0x9763('0x7d')])){throw new db[(_0x9763('0x74'))][(_0x9763('0x75'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x180614);}if(!_['includes'](_0x180614,_0x41c685[_0x9763('0x5e')][_0x9763('0x7d')])){throw new db['Sequelize'][(_0x9763('0x75'))](_0x9763('0x7e')+_0x180614);}_0x10e499[_0x41c685[_0x9763('0x5e')][_0x9763('0x7d')]]=_0x41c685['body'][_0x9763('0x7f')];})[_0x9763('0x1f')](function(){return db['OpenchannelAccount'][_0x9763('0x5c')]({'where':{'id':_0x41c685[_0x9763('0x65')]['id']},'include':[{'model':db[_0x9763('0x80')],'as':'List','include':[{'model':db[_0x9763('0x81')],'as':_0x9763('0x82'),'where':_0x10e499,'limit':0x1,'order':[['updatedAt',_0x9763('0x83')]]}]},{'model':db[_0x9763('0x84')],'as':_0x9763('0x85')}]});})[_0x9763('0x1f')](handleEntityNotFound(_0x3d4dd1,null))[_0x9763('0x1f')](function(_0x32397c){if(_0x32397c&&_0x32397c[_0x9763('0x86')]){_0x4ad8d5[_0x9763('0x87')]=_0x32397c;_0x4ad8d5[_0x9763('0x88')]=_0x32397c[_0x9763('0x85')];_0x4ad8d5[_0x9763('0x89')]=_0x32397c[_0x9763('0x86')];_0x4ad8d5[_0x9763('0x88')]=_['orderBy'](_0x4ad8d5[_0x9763('0x88')],[_0x9763('0x8a')],[_0x9763('0x8b')]);if(_0x4ad8d5[_0x9763('0x87')][_0x9763('0x85')]){delete _0x4ad8d5['account'][_0x9763('0x85')];}if(_0x4ad8d5[_0x9763('0x87')][_0x9763('0x86')]&&_0x4ad8d5['account'][_0x9763('0x86')]['Contacts'][_0x9763('0x4a')]){return _0x4ad8d5[_0x9763('0x87')][_0x9763('0x86')]['Contacts'][0x0];}var _0x3ea599=_[_0x9763('0x1a')](_0x41c685[_0x9763('0x5e')],{'firstName':_0x41c685[_0x9763('0x5e')]['from'],'ListId':_0x32397c[_0x9763('0x8c')]});_0x3ea599[_0x41c685[_0x9763('0x5e')][_0x9763('0x7d')]]=_0x41c685[_0x9763('0x5e')][_0x9763('0x7f')];return db[_0x9763('0x81')][_0x9763('0x5d')](_0x3ea599,{'fields':_0x5e51f5,'raw':!![]});}})['then'](handleEntityNotFound(_0x3d4dd1,null))['then'](function(_0x5476d3){_0x4ad8d5[_0x9763('0x8d')]=_0x5476d3;if(_0x5476d3){var _0x586db4={'ContactId':_0x5476d3['id'],'OpenchannelAccountId':_0x41c685[_0x9763('0x65')]['id'],'from':(_0x5476d3[_0x9763('0x8e')]||'')+'\x20'+(_0x5476d3[_0x9763('0x8f')]||'')};var _0x171dee={'OpenchannelAccountId':_0x41c685[_0x9763('0x65')]['id'],'closed':![]};if(_0x41c685['body']['threadId']){_0x171dee[_0x9763('0x90')]=_0x41c685['body']['threadId'];return db[_0x9763('0x91')][_0x9763('0x5c')]({'where':_0x171dee})['then'](function(_0xc4b651){if(_0xc4b651){return[_0xc4b651,![]];}_0x586db4[_0x9763('0x90')]=_0x41c685[_0x9763('0x5e')][_0x9763('0x90')];_0x586db4[_0x9763('0x92')]=_0x41c685[_0x9763('0x5e')][_0x9763('0x92')];return db[_0x9763('0x91')][_0x9763('0x5d')](_0x586db4)[_0x9763('0x1f')](function(_0x1a2719){return[_0x1a2719,!![]];});});}else{_0x171dee[_0x9763('0x90')]=null;}_0x171dee[_0x9763('0x93')]=_0x5476d3['id'];return db[_0x9763('0x91')][_0x9763('0x5c')]({'where':_0x171dee})[_0x9763('0x1f')](function(_0x495c22){if(_0x495c22){return[_0x495c22,![]];}return db[_0x9763('0x91')][_0x9763('0x5d')](_0x586db4)[_0x9763('0x1f')](function(_0x1efa35){return[_0x1efa35,!![]];});});}})[_0x9763('0x94')](function(_0x1e2a81,_0x2aeeb3){if(_0x1e2a81){_0x6b975=_0x2aeeb3;if(!_0x2aeeb3){var _0xa9274c={'from':(_0x4ad8d5[_0x9763('0x8d')][_0x9763('0x8e')]||'')+'\x20'+(_0x4ad8d5[_0x9763('0x8d')]['lastName']||'')};if(_0x41c685[_0x9763('0x5e')][_0x9763('0x90')]&&_0x41c685[_0x9763('0x5e')]['messageId']&&_0x41c685['body']['threadId']!=_0x41c685[_0x9763('0x5e')][_0x9763('0x95')]){_0xa9274c['threadId']=_0x41c685[_0x9763('0x5e')][_0x9763('0x95')];}return _0x1e2a81[_0x9763('0x64')](_0xa9274c);}else{return _0x1e2a81;}}})[_0x9763('0x1f')](function(_0x1d693e){_0x4ad8d5[_0x9763('0x96')]=_0x1d693e[_0x9763('0x38')]({'plain':!![]});_0x4ad8d5['interaction'][_0x9763('0x97')]=_0x6b975;if(_0x4ad8d5[_0x9763('0x96')][_0x9763('0x97')]){if(_0x4ad8d5[_0x9763('0x87')]['autoclose']){_0x4ad8d5[_0x9763('0x88')][_0x9763('0x98')]({'id':0x0,'priority':_0x4ad8d5[_0x9763('0x88')][_0x9763('0x4a')]+0x1,'app':_0x9763('0x99'),'appdata':_0x9763('0x9a'),'interval':_0x9763('0x9b')});}}return db['OpenchannelMessage'][_0x9763('0x5d')]({'body':_0x41c685[_0x9763('0x5e')][_0x9763('0x5e')],'OpenchannelAccountId':_0x41c685[_0x9763('0x65')]['id'],'OpenchannelInteractionId':_0x1d693e['id'],'direction':'in','ContactId':_0x4ad8d5[_0x9763('0x8d')]['id'],'AttachmentId':_0x41c685[_0x9763('0x5e')]['AttachmentId']});})[_0x9763('0x1f')](function(_0x5897cd){_0x4ad8d5[_0x9763('0x28')]=_0x5897cd;if(_0x4ad8d5[_0x9763('0x96')][_0x9763('0x9c')]){return db[_0x9763('0x9d')][_0x9763('0x5c')]({'attributes':['id',_0x9763('0x3c')],'where':{'id':_0x4ad8d5[_0x9763('0x96')][_0x9763('0x9c')]}})[_0x9763('0x1f')](function(_0x2a37aa){if(_0x2a37aa){_0x4ad8d5[_0x9763('0x88')][_0x9763('0x9e')]({'id':0x0,'priority':0x0,'app':_0x9763('0x9f'),'appdata':_0x2a37aa[_0x9763('0x3c')]+','+(_0x4ad8d5[_0x9763('0x87')][_0x9763('0xa0')]||0xa),'interval':_0x9763('0x9b')});_0x4ad8d5[_0x9763('0xa1')]=![];}return respondWithRpcPromise(_0x9763('0xa2'),_0x9763('0xa3'),_0x4ad8d5);});}return respondWithRpcPromise(_0x9763('0xa2'),_0x9763('0xa3'),_0x4ad8d5);})['then'](function(_0x293649){respondWithRpcPromise(_0x9763('0xa4'),_0x9763('0xa4'),{'event':'notify','message':_0x293649},client9002);return _0x293649;})['then'](respondWithResult(_0x3d4dd1,null))[_0x9763('0x2a')](handleError(_0x3d4dd1,null));};exports['addApplications']=function(_0x2d3512,_0x5efc3f,_0x364fa5){return db[_0x9763('0x58')]['findOne']({'where':{'id':_0x2d3512[_0x9763('0x65')]['id']}})['then'](handleEntityNotFound(_0x5efc3f,null))['then'](function(_0x58cf81){if(_0x58cf81){return db[_0x9763('0xa5')][_0x9763('0xa6')](function(_0x2a756){return db[_0x9763('0x84')][_0x9763('0x37')]({'where':{'OpenchannelAccountId':_0x2d3512[_0x9763('0x65')]['id']},'transaction':_0x2a756})[_0x9763('0x1f')](function(_0x174da3){var _0x326617=_[_0x9763('0x41')](_0x2d3512[_0x9763('0x5e')],function(_0xbd5e74){_0xbd5e74[_0x9763('0x6b')]=_0x2d3512[_0x9763('0x65')]['id'];return _0xbd5e74;});return db[_0x9763('0x84')][_0x9763('0xa7')](_0x326617,{'transaction':_0x2a756});});})[_0x9763('0x1f')](function(){return db[_0x9763('0x84')][_0x9763('0xa8')]({'where':{'OpenchannelAccountId':_0x2d3512[_0x9763('0x65')]['id']},'order':_0x9763('0x8a')});});}})[_0x9763('0x1f')](respondWithResult(_0x5efc3f,null))[_0x9763('0x2a')](handleError(_0x5efc3f,null));};exports['getApplications']=function(_0x3f7c7e,_0x42d627,_0x21889e){var _0x24939d={};var _0x323334={};var _0x31e900;var _0x1ff54e;return db['OpenchannelAccount'][_0x9763('0x6a')]({'where':{'id':_0x3f7c7e[_0x9763('0x65')]['id']}})['then'](handleEntityNotFound(_0x42d627,null))[_0x9763('0x1f')](function(_0x298e2a){if(_0x298e2a){_0x31e900=_0x298e2a;_0x323334[_0x9763('0x46')]=_[_0x9763('0x45')](db[_0x9763('0x84')][_0x9763('0x42')]);_0x323334[_0x9763('0x44')]=_[_0x9763('0x45')](_0x3f7c7e[_0x9763('0x44')]);_0x323334[_0x9763('0x50')]=_['intersection'](_0x323334['model'],_0x323334[_0x9763('0x44')]);_0x24939d['attributes']=_[_0x9763('0x48')](_0x323334['model'],qs['fields'](_0x3f7c7e[_0x9763('0x44')][_0x9763('0x49')]));_0x24939d[_0x9763('0x47')]=_0x24939d[_0x9763('0x47')]['length']?_0x24939d[_0x9763('0x47')]:_0x323334[_0x9763('0x46')];_0x24939d[_0x9763('0x4d')]=qs[_0x9763('0x4e')](_0x3f7c7e[_0x9763('0x44')]['sort']);_0x24939d[_0x9763('0x4f')]=qs['filters'](_[_0x9763('0x51')](_0x3f7c7e[_0x9763('0x44')],_0x323334[_0x9763('0x50')]));if(_0x3f7c7e['query']['filter']){_0x24939d[_0x9763('0x4f')]=_['merge'](_0x24939d[_0x9763('0x4f')],{'$or':_[_0x9763('0x41')](_0x24939d[_0x9763('0x47')],function(_0x4869c9){var _0x34ebf7={};_0x34ebf7[_0x4869c9]={'$like':'%'+_0x3f7c7e[_0x9763('0x44')]['filter']+'%'};return _0x34ebf7;})});}_0x24939d=_[_0x9763('0x53')]({},_0x24939d,_0x3f7c7e['options']);return _0x31e900[_0x9763('0xa9')](_0x24939d);}})[_0x9763('0x1f')](function(_0x2aa1bb){if(_0x2aa1bb){_0x1ff54e=_0x2aa1bb[_0x9763('0x4a')];if(!_0x3f7c7e[_0x9763('0x44')][_0x9763('0x4b')](_0x9763('0x4c'))){_0x24939d[_0x9763('0x2f')]=qs[_0x9763('0x2f')](_0x3f7c7e['query'][_0x9763('0x2f')]);_0x24939d[_0x9763('0x32')]=qs[_0x9763('0x32')](_0x3f7c7e[_0x9763('0x44')]['offset']);}return _0x31e900[_0x9763('0xa9')](_0x24939d);}})[_0x9763('0x1f')](function(_0x11e31d){if(_0x11e31d){return _0x11e31d?{'count':_0x1ff54e,'rows':_0x11e31d}:null;}})[_0x9763('0x1f')](respondWithResult(_0x42d627,null))[_0x9763('0x2a')](handleError(_0x42d627,null));};exports[_0x9763('0xaa')]=function(_0x419674,_0x542c88,_0x1b872c){var _0x27677f={'raw':![],'where':{}};var _0x215fc6={};var _0x438057={'count':0x0,'rows':[]};return db[_0x9763('0x58')][_0x9763('0x6a')]({'where':{'id':_0x419674[_0x9763('0x65')]['id']}})[_0x9763('0x1f')](handleEntityNotFound(_0x542c88,null))[_0x9763('0x1f')](function(_0x211e9d){if(_0x211e9d){_0x215fc6['model']=_[_0x9763('0x45')](db[_0x9763('0x91')][_0x9763('0x42')]);_0x215fc6[_0x9763('0x44')]=_[_0x9763('0x45')](_0x419674[_0x9763('0x44')]);_0x215fc6[_0x9763('0x50')]=_[_0x9763('0x48')](_0x215fc6[_0x9763('0x46')],_0x215fc6[_0x9763('0x44')]);_0x27677f[_0x9763('0x47')]=_[_0x9763('0x48')](_0x215fc6['model'],qs[_0x9763('0x49')](_0x419674[_0x9763('0x44')][_0x9763('0x49')]));_0x27677f[_0x9763('0x47')]=_0x27677f[_0x9763('0x47')]['length']?_0x27677f[_0x9763('0x47')]:_0x215fc6[_0x9763('0x46')];if(!_0x419674[_0x9763('0x44')][_0x9763('0x4b')]('nolimit')){_0x27677f[_0x9763('0x2f')]=qs[_0x9763('0x2f')](_0x419674['query'][_0x9763('0x2f')]);_0x27677f[_0x9763('0x32')]=qs[_0x9763('0x32')](_0x419674[_0x9763('0x44')][_0x9763('0x32')]);}_0x27677f[_0x9763('0x4d')]=qs[_0x9763('0x4e')](_0x419674[_0x9763('0x44')][_0x9763('0x4e')]);_0x27677f[_0x9763('0x4f')]=qs[_0x9763('0x50')](_['pick'](_0x419674[_0x9763('0x44')],_0x215fc6[_0x9763('0x50')]));_0x27677f['where']['OpenchannelAccountId']=_0x211e9d['id'];if(_0x419674[_0x9763('0x44')][_0x9763('0x52')]){_0x27677f[_0x9763('0x4f')]=_[_0x9763('0x53')](_0x27677f[_0x9763('0x4f')],{'$or':_[_0x9763('0x41')](_0x27677f[_0x9763('0x47')],function(_0x4daf37){var _0x3136e1={};_0x3136e1[_0x4daf37]={'$like':'%'+_0x419674['query'][_0x9763('0x52')]+'%'};return _0x3136e1;})});}_0x27677f=_[_0x9763('0x53')]({},_0x27677f,_0x419674[_0x9763('0x55')]);return db[_0x9763('0x91')][_0x9763('0x31')]({'where':_0x27677f[_0x9763('0x4f')]})[_0x9763('0x1f')](function(_0x48b8bb){_0x438057['count']=_0x48b8bb;if(_0x419674[_0x9763('0x44')][_0x9763('0x56')]){_0x27677f[_0x9763('0x57')]=[{'model':db[_0x9763('0x81')],'as':_0x9763('0xab'),'required':![]},{'model':db[_0x9763('0x9d')],'as':_0x9763('0xac'),'attributes':[_0x9763('0x3c'),'fullname',_0x9763('0xad')],'required':![]},{'model':db[_0x9763('0xae')],'as':_0x9763('0xaf'),'attributes':['id',_0x9763('0x3c'),_0x9763('0xb0')],'where':_0x419674[_0x9763('0x44')][_0x9763('0xb1')]?{'id':_0x419674['query']['tag']}:undefined,'required':_0x419674[_0x9763('0x44')][_0x9763('0xb1')]?!![]:![]}];}return db[_0x9763('0x91')][_0x9763('0x59')](_0x27677f);})['then'](function(_0x1f5082){_0x438057['rows']=_0x1f5082;return _0x438057;});}})[_0x9763('0x1f')](respondWithFilteredResult(_0x542c88,_0x27677f))[_0x9763('0x2a')](handleError(_0x542c88,null));};exports[_0x9763('0xb2')]=function(_0x3af06e,_0xd583f5,_0x49694a){return db[_0x9763('0x58')]['find']({'where':{'id':_0x3af06e[_0x9763('0x65')]['id']}})[_0x9763('0x1f')](handleEntityNotFound(_0xd583f5,null))[_0x9763('0x1f')](function(_0xbf5d47){if(_0xbf5d47){return _0xbf5d47['addAgents'](_0x3af06e['body'][_0x9763('0x6d')],_[_0x9763('0xb3')](_0x3af06e[_0x9763('0x5e')],['ids','id'])||{})['spread'](function(_0x168c3f){for(var _0xb086cd=0x0;_0xb086cd<_0x3af06e[_0x9763('0x5e')][_0x9763('0x6d')][_0x9763('0x4a')];_0xb086cd+=0x1){socket['emit'](_0x9763('0xb4'),{'UserId':Number(_0x3af06e[_0x9763('0x5e')][_0x9763('0x6d')][_0xb086cd]),'OpenchannelAccountId':Number(_0x3af06e['params']['id'])});}return _0x168c3f;});}})[_0x9763('0x1f')](respondWithResult(_0xd583f5,null))[_0x9763('0x2a')](handleError(_0xd583f5,null));};exports[_0x9763('0xb5')]=function(_0x38f41b,_0x4919dd,_0x16105b){return db[_0x9763('0x58')][_0x9763('0x5c')]({'where':{'id':_0x38f41b[_0x9763('0x65')]['id']}})[_0x9763('0x1f')](handleEntityNotFound(_0x4919dd,null))[_0x9763('0x1f')](function(_0xe5884e){if(_0xe5884e){return _0xe5884e[_0x9763('0xb5')](_0x38f41b['query'][_0x9763('0x6d')])[_0x9763('0x1f')](function(){if(_[_0x9763('0xb6')](_0x38f41b[_0x9763('0x44')][_0x9763('0x6d')])){for(var _0x260f55=0x0;_0x260f55<_0x38f41b[_0x9763('0x44')]['ids']['length'];_0x260f55+=0x1){socket[_0x9763('0xb7')](_0x9763('0xb8'),{'UserId':Number(_0x38f41b[_0x9763('0x44')][_0x9763('0x6d')][_0x260f55]),'OpenchannelAccountId':Number(_0x38f41b['params']['id'])});}}else{socket[_0x9763('0xb7')](_0x9763('0xb8'),{'UserId':Number(_0x38f41b['query']['ids']),'OpenchannelAccountId':Number(_0x38f41b[_0x9763('0x65')]['id'])});}});}})[_0x9763('0x1f')](respondWithStatusCode(_0x4919dd,null))['catch'](handleError(_0x4919dd,null));};exports['getAgents']=function(_0x40ebe6,_0x46afd8,_0x27b8a0){var _0x10adda={};var _0x1ee94f={};var _0x647721;var _0x5843ba;return db[_0x9763('0x58')]['findOne']({'where':{'id':_0x40ebe6[_0x9763('0x65')]['id']}})[_0x9763('0x1f')](handleEntityNotFound(_0x46afd8,null))[_0x9763('0x1f')](function(_0xc951d9){if(_0xc951d9){_0x647721=_0xc951d9;_0x1ee94f[_0x9763('0x46')]=_['keys'](db['User'][_0x9763('0x42')]);_0x1ee94f[_0x9763('0x44')]=_[_0x9763('0x45')](_0x40ebe6[_0x9763('0x44')]);_0x1ee94f[_0x9763('0x50')]=_[_0x9763('0x48')](_0x1ee94f[_0x9763('0x46')],_0x1ee94f['query']);_0x10adda[_0x9763('0x47')]=_[_0x9763('0x48')](_0x1ee94f[_0x9763('0x46')],qs[_0x9763('0x49')](_0x40ebe6[_0x9763('0x44')][_0x9763('0x49')]));_0x10adda[_0x9763('0x47')]=_0x10adda['attributes'][_0x9763('0x4a')]?_0x10adda['attributes']:_0x1ee94f[_0x9763('0x46')];_0x10adda[_0x9763('0x4d')]=qs[_0x9763('0x4e')](_0x40ebe6['query'][_0x9763('0x4e')]);_0x10adda[_0x9763('0x4f')]=qs[_0x9763('0x50')](_['pick'](_0x40ebe6[_0x9763('0x44')],_0x1ee94f[_0x9763('0x50')]));if(_0x40ebe6[_0x9763('0x44')]['filter']){_0x10adda[_0x9763('0x4f')]=_[_0x9763('0x53')](_0x10adda[_0x9763('0x4f')],{'$or':_[_0x9763('0x41')](_0x10adda[_0x9763('0x47')],function(_0x44d878){var _0x6c352c={};_0x6c352c[_0x44d878]={'$like':'%'+_0x40ebe6[_0x9763('0x44')][_0x9763('0x52')]+'%'};return _0x6c352c;})});}_0x10adda=_[_0x9763('0x53')]({},_0x10adda,_0x40ebe6['options']);return _0x647721['getAgents'](_0x10adda);}})[_0x9763('0x1f')](function(_0x4eee08){if(_0x4eee08){_0x5843ba=_0x4eee08[_0x9763('0x4a')];if(!_0x40ebe6['query'][_0x9763('0x4b')](_0x9763('0x4c'))){_0x10adda['limit']=qs['limit'](_0x40ebe6[_0x9763('0x44')][_0x9763('0x2f')]);_0x10adda[_0x9763('0x32')]=qs['offset'](_0x40ebe6['query'][_0x9763('0x32')]);}return _0x647721[_0x9763('0xb9')](_0x10adda);}})[_0x9763('0x1f')](function(_0xce5e8c){if(_0xce5e8c){return _0xce5e8c?{'count':_0x5843ba,'rows':_0xce5e8c}:null;}})[_0x9763('0x1f')](respondWithResult(_0x46afd8,null))[_0x9763('0x2a')](handleError(_0x46afd8,null));};exports[_0x9763('0x3d')]=function(_0x20eee0,_0x1169f5,_0x2eed4d){var _0x226cde,_0x1e5b3d,_0x1f971c;if(_[_0x9763('0x7c')](_0x20eee0['body'][_0x9763('0x5e')])||_0x20eee0[_0x9763('0x5e')][_0x9763('0x5e')]===''){throw new db[(_0x9763('0x74'))][(_0x9763('0x75'))](_0x9763('0xba'));}if(_[_0x9763('0x7c')](_0x20eee0[_0x9763('0x5e')]['to'])){}_0x226cde=_0x20eee0[_0x9763('0x5e')]['to'];return db[_0x9763('0x58')][_0x9763('0x6a')]({'where':{'id':_0x20eee0[_0x9763('0x65')]['id']}})[_0x9763('0x1f')](handleEntityNotFound(_0x1169f5,null))[_0x9763('0x1f')](function(_0x3ce9bd){if(_0x3ce9bd){return db[_0x9763('0x58')][_0x9763('0x5c')]({'where':{'id':_0x3ce9bd['id']},'include':[{'model':db[_0x9763('0x80')],'as':_0x9763('0x86'),'include':[{'model':db[_0x9763('0x81')],'as':_0x9763('0x82'),'where':{[_0x3ce9bd[_0x9763('0x7d')]]:_0x226cde},'limit':0x1,'order':[[_0x9763('0x79'),_0x9763('0x83')]]}]}]})[_0x9763('0x1f')](handleEntityNotFound(_0x1169f5,null))[_0x9763('0x1f')](function(_0x106b71){if(_0x106b71&&_0x106b71[_0x9763('0x86')]){_0x1e5b3d=_0x106b71[_0x9763('0x38')]({'plain':!![]});if(_0x1e5b3d[_0x9763('0x86')]&&_0x1e5b3d[_0x9763('0x86')][_0x9763('0x82')][_0x9763('0x4a')]){return _0x1e5b3d['List']['Contacts'][0x0];}return db[_0x9763('0x81')][_0x9763('0x5d')](_['defaults'](_0x20eee0[_0x9763('0x5e')],{'firstName':_0x226cde,[_0x106b71[_0x9763('0x7d')]]:_0x226cde,'phone':_0x226cde,'ListId':_0x1e5b3d[_0x9763('0x8c')]}));}})['then'](handleEntityNotFound(_0x1169f5,null))[_0x9763('0x1f')](function(_0x10469e){if(_0x10469e){_0x1f971c=_0x10469e;return db[_0x9763('0x91')]['find']({'where':{'ContactId':_0x1f971c['id'],'closed':![],'OpenchannelAccountId':_0x1e5b3d['id']}})[_0x9763('0x1f')](function(_0x57e973){if(_0x57e973){return[_0x57e973,![]];}return db[_0x9763('0x91')][_0x9763('0x5d')]({'UserId':_0x20eee0['user']['id'],'ContactId':_0x1f971c['id'],'OpenchannelAccountId':_0x1e5b3d['id'],'lastMsgDirection':_0x9763('0xbb'),'Messages':[_['merge'](_0x20eee0[_0x9763('0x5e')],{'read':![],'body':_0x20eee0[_0x9763('0x5e')][_0x9763('0x5e')],'OpenchannelAccountId':_0x1e5b3d['id'],'UserId':_0x20eee0[_0x9763('0x5f')]['id'],'ContactId':_0x1f971c['id']})]},{'include':[{'model':db[_0x9763('0xbc')],'as':_0x9763('0xbd')}]})['then'](function(_0x11df77){return[_0x11df77,!![]];});});}})[_0x9763('0x94')](function(_0x318ca3,_0x55ec3e){if(_0x55ec3e){return _0x318ca3;}return db['OpenchannelMessage'][_0x9763('0x5d')](_[_0x9763('0x53')](_0x20eee0[_0x9763('0x5e')],{'read':![],'body':_0x20eee0[_0x9763('0x5e')][_0x9763('0x5e')],'OpenchannelAccountId':_0x1e5b3d['id'],'OpenchannelInteractionId':_0x318ca3['id'],'UserId':_0x20eee0[_0x9763('0x5f')]['id'],'ContactId':_0x1f971c['id']}))[_0x9763('0x1f')](function(_0x103576){_0x318ca3['dataValues'][_0x9763('0xbd')]=[];_0x318ca3[_0x9763('0xbe')][_0x9763('0xbd')]['push'](_0x103576[_0x9763('0xbe')]);return _0x318ca3;});});}})[_0x9763('0x1f')](respondWithResult(_0x1169f5,null))[_0x9763('0x2a')](handleError(_0x1169f5,null));}; \ No newline at end of file +var _0x0347=['CompanyId','ListId','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','Contacts','DESC','OpenchannelApplication','Applications','List','account','applications','list','orderBy','priority','asc','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','spread','messageId','interaction','created','autoclose','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','forcedOwnership','startRouting','Start','EventManager','notify','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','fullname','internal','Tags','tag','addAgents','omit','emit','removeAgents','userOpenchannelAccount:remove','getAgents','send','body\x20is\x20mandatory\x20and\x20not\x20empty','out','user','Messages','dataValues','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','get','OpenchannelAccounts','UserProfileResource','destroy','stack','name','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','type','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','body','describe','OpenchannelAccountId','Disposition','getDispositions','findOne','nolimit','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','openchannel','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt'];(function(_0x32e383,_0x40c932){var _0x19be86=function(_0x4319ff){while(--_0x4319ff){_0x32e383['push'](_0x32e383['shift']());}};_0x19be86(++_0x40c932);}(_0x0347,0x1b3));var _0x7034=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x0347[_0x432682];return _0x463d05;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7034('0x0'));var zipdir=require(_0x7034('0x1'));var jsonpatch=require(_0x7034('0x2'));var rp=require(_0x7034('0x3'));var moment=require('moment');var BPromise=require(_0x7034('0x4'));var Mustache=require('mustache');var util=require(_0x7034('0x5'));var path=require(_0x7034('0x6'));var sox=require(_0x7034('0x7'));var csv=require(_0x7034('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7034('0x9'));var squel=require(_0x7034('0xa'));var crypto=require('crypto');var jsforce=require(_0x7034('0xb'));var deskjs=require(_0x7034('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7034('0xd'));var Papa=require(_0x7034('0xe'));var Redis=require(_0x7034('0xf'));var authService=require(_0x7034('0x10'));var qs=require(_0x7034('0x11'));var as=require(_0x7034('0x12'));var hardwareService=require(_0x7034('0x13'));var logger=require(_0x7034('0x14'))(_0x7034('0x15'));var utils=require('../../config/utils');var config=require(_0x7034('0x16'));var licenseUtil=require(_0x7034('0x17'));var db=require(_0x7034('0x18'))['db'];config['redis']=_[_0x7034('0x19')](config['redis'],{'host':_0x7034('0x1a'),'port':0x18eb});var socket=require(_0x7034('0x1b'))(new Redis(config['redis']));require('./openchannelAccount.socket')[_0x7034('0x1c')](socket);var jayson=require(_0x7034('0x1d'));var client=jayson[_0x7034('0x1e')][_0x7034('0x1f')]({'port':0x232c});var client9002=jayson[_0x7034('0x1e')][_0x7034('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x33b111,_0x5f3359,_0x14253f,_0x2a4f01){return new BPromise(function(_0x191fee,_0x258c32){var _0x3254a9=_0x2a4f01||client;return _0x3254a9[_0x7034('0x20')](_0x33b111,_0x14253f)[_0x7034('0x21')](function(_0x154d6a){logger[_0x7034('0x22')](_0x7034('0x23'),_0x5f3359,'request\x20sent');logger[_0x7034('0x24')](_0x7034('0x25'),_0x5f3359,_0x7034('0x26'),JSON[_0x7034('0x27')](_0x154d6a));if(_0x154d6a[_0x7034('0x28')]){if(_0x154d6a[_0x7034('0x28')][_0x7034('0x29')]===0x1f4){logger[_0x7034('0x28')](_0x7034('0x23'),_0x5f3359,_0x154d6a[_0x7034('0x28')][_0x7034('0x2a')]);return _0x258c32(_0x154d6a[_0x7034('0x28')][_0x7034('0x2a')]);}logger[_0x7034('0x28')](_0x7034('0x23'),_0x5f3359,_0x154d6a[_0x7034('0x28')][_0x7034('0x2a')]);return _0x191fee(_0x154d6a[_0x7034('0x28')][_0x7034('0x2a')]);}else{logger[_0x7034('0x22')]('OpenchannelAccount,\x20%s,\x20%s',_0x5f3359,_0x7034('0x26'));_0x191fee(_0x154d6a['result'][_0x7034('0x2a')]);}})[_0x7034('0x2b')](function(_0x6543d9){logger['error'](_0x7034('0x23'),_0x5f3359,_0x6543d9);_0x258c32(_0x6543d9);});});}function respondWithStatusCode(_0x3b3a3c,_0x4db976){_0x4db976=_0x4db976||0xcc;return function(_0x7c91ec){if(_0x7c91ec){return _0x3b3a3c[_0x7034('0x2c')](_0x4db976);}return _0x3b3a3c[_0x7034('0x2d')](_0x4db976)[_0x7034('0x2e')]();};}function respondWithResult(_0x1e4360,_0x4a7b13){_0x4a7b13=_0x4a7b13||0xc8;return function(_0x57e112){if(_0x57e112){return _0x1e4360[_0x7034('0x2d')](_0x4a7b13)[_0x7034('0x2f')](_0x57e112);}};}function respondWithFilteredResult(_0xd6aa8b,_0xca1d6c){return function(_0x58f2ae){if(_0x58f2ae){var _0x29a06a=typeof _0xca1d6c[_0x7034('0x30')]==='undefined'&&typeof _0xca1d6c[_0x7034('0x31')]===_0x7034('0x32');var _0x3e30aa=_0x58f2ae[_0x7034('0x33')];var _0x2ef112=_0x29a06a?0x0:_0xca1d6c['offset'];var _0x2cceda=_0x29a06a?_0x58f2ae[_0x7034('0x33')]:_0xca1d6c[_0x7034('0x30')]+_0xca1d6c[_0x7034('0x31')];var _0x3dce2a;if(_0x2cceda>=_0x3e30aa){_0x2cceda=_0x3e30aa;_0x3dce2a=0xc8;}else{_0x3dce2a=0xce;}_0xd6aa8b[_0x7034('0x2d')](_0x3dce2a);return _0xd6aa8b[_0x7034('0x34')](_0x7034('0x35'),_0x2ef112+'-'+_0x2cceda+'/'+_0x3e30aa)['json'](_0x58f2ae);}return null;};}function patchUpdates(_0x2e74ec){return function(_0x244856){try{jsonpatch[_0x7034('0x36')](_0x244856,_0x2e74ec,!![]);}catch(_0x15da9d){return BPromise['reject'](_0x15da9d);}return _0x244856[_0x7034('0x37')]();};}function saveUpdates(_0x35a968,_0x49a55d){return function(_0x32509f){if(_0x32509f){return _0x32509f[_0x7034('0x38')](_0x35a968)['then'](function(_0x50ee3b){return _0x50ee3b;});}return null;};}function removeEntity(_0x28333a,_0x576f2b){return function(_0x47d381){if(_0x47d381){return _0x47d381['destroy']()['then'](function(){var _0x5de8fe=_0x47d381[_0x7034('0x39')]({'plain':!![]});var _0x2ea9d6=_0x7034('0x3a');return db[_0x7034('0x3b')][_0x7034('0x3c')]({'where':{'type':_0x2ea9d6,'resourceId':_0x5de8fe['id']}})['then'](function(){return _0x47d381;});})[_0x7034('0x21')](function(){_0x28333a[_0x7034('0x2d')](0xcc)[_0x7034('0x2e')]();});}};}function handleEntityNotFound(_0x24a927,_0x3dfa2e){return function(_0x139274){if(!_0x139274){_0x24a927[_0x7034('0x2c')](0x194);}return _0x139274;};}function handleError(_0x2dd56c,_0x201a0d){_0x201a0d=_0x201a0d||0x1f4;return function(_0x3522a3){logger[_0x7034('0x28')](_0x3522a3[_0x7034('0x3d')]);if(_0x3522a3[_0x7034('0x3e')]){delete _0x3522a3['name'];}_0x2dd56c[_0x7034('0x2d')](_0x201a0d)['send'](_0x3522a3);};}exports[_0x7034('0x3f')]=function(_0x275a2b,_0x4e65e1){var _0x20d37c={'include':[{'model':db[_0x7034('0x40')],'as':_0x7034('0x41')}]},_0x490243={},_0x14435a={'count':0x0,'rows':[]};var _0xdad13b=_[_0x7034('0x42')](db[_0x7034('0x43')][_0x7034('0x44')],function(_0x3ba69b){return{'name':_0x3ba69b['fieldName'],'type':_0x3ba69b[_0x7034('0x45')]['key']};});_0x490243['model']=_[_0x7034('0x42')](_0xdad13b,'name');_0x490243[_0x7034('0x46')]=_[_0x7034('0x47')](_0x275a2b['query']);_0x490243[_0x7034('0x48')]=_['intersection'](_0x490243['model'],_0x490243[_0x7034('0x46')]);_0x20d37c[_0x7034('0x49')]=_[_0x7034('0x4a')](_0x490243[_0x7034('0x4b')],qs[_0x7034('0x4c')](_0x275a2b[_0x7034('0x46')][_0x7034('0x4c')]));_0x20d37c[_0x7034('0x49')]=_0x20d37c[_0x7034('0x49')][_0x7034('0x4d')]?_0x20d37c[_0x7034('0x49')]:_0x490243[_0x7034('0x4b')];if(!_0x275a2b[_0x7034('0x46')][_0x7034('0x4e')]('nolimit')){_0x20d37c['limit']=qs[_0x7034('0x31')](_0x275a2b['query'][_0x7034('0x31')]);_0x20d37c[_0x7034('0x30')]=qs['offset'](_0x275a2b[_0x7034('0x46')][_0x7034('0x30')]);}_0x20d37c[_0x7034('0x4f')]=qs['sort'](_0x275a2b[_0x7034('0x46')][_0x7034('0x50')]);_0x20d37c['where']=qs['filters'](_[_0x7034('0x51')](_0x275a2b[_0x7034('0x46')],_0x490243[_0x7034('0x48')]),_0xdad13b);if(_0x275a2b[_0x7034('0x46')]['filter']){_0x20d37c[_0x7034('0x52')]=_[_0x7034('0x53')](_0x20d37c[_0x7034('0x52')],{'$or':_[_0x7034('0x42')](_0xdad13b,function(_0x3c2fcf){if(_0x3c2fcf[_0x7034('0x45')]!==_0x7034('0x54')){var _0x4fb242={};_0x4fb242[_0x3c2fcf[_0x7034('0x3e')]]={'$like':'%'+_0x275a2b[_0x7034('0x46')][_0x7034('0x55')]+'%'};return _0x4fb242;}})});}_0x20d37c=_[_0x7034('0x53')]({},_0x20d37c,_0x275a2b[_0x7034('0x56')]);var _0x2208f4={'where':_0x20d37c[_0x7034('0x52')]};return db['OpenchannelAccount'][_0x7034('0x33')](_0x2208f4)[_0x7034('0x21')](function(_0x160b07){_0x14435a[_0x7034('0x33')]=_0x160b07;if(_0x275a2b['query'][_0x7034('0x57')]){_0x20d37c[_0x7034('0x58')]=[{'all':!![]}];}return db[_0x7034('0x43')][_0x7034('0x59')](_0x20d37c);})[_0x7034('0x21')](function(_0x3c8ef7){_0x14435a[_0x7034('0x5a')]=_0x3c8ef7;return _0x14435a;})[_0x7034('0x21')](respondWithFilteredResult(_0x4e65e1,_0x20d37c))['catch'](handleError(_0x4e65e1,null));};exports['show']=function(_0x106cf9,_0xaca5bd){var _0x2fff66={'raw':![],'where':{'id':_0x106cf9[_0x7034('0x5b')]['id']},'include':[{'model':db['Pause'],'as':_0x7034('0x41')}]},_0x2fe253={};_0x2fe253[_0x7034('0x4b')]=_[_0x7034('0x47')](db[_0x7034('0x43')]['rawAttributes']);_0x2fe253[_0x7034('0x46')]=_['keys'](_0x106cf9[_0x7034('0x46')]);_0x2fe253[_0x7034('0x48')]=_[_0x7034('0x4a')](_0x2fe253[_0x7034('0x4b')],_0x2fe253[_0x7034('0x46')]);_0x2fff66[_0x7034('0x49')]=_[_0x7034('0x4a')](_0x2fe253[_0x7034('0x4b')],qs[_0x7034('0x4c')](_0x106cf9[_0x7034('0x46')][_0x7034('0x4c')]));_0x2fff66[_0x7034('0x49')]=_0x2fff66[_0x7034('0x49')]['length']?_0x2fff66[_0x7034('0x49')]:_0x2fe253[_0x7034('0x4b')];if(_0x106cf9[_0x7034('0x46')][_0x7034('0x57')]){_0x2fff66[_0x7034('0x58')]=[{'all':!![]}];}_0x2fff66=_[_0x7034('0x53')]({},_0x2fff66,_0x106cf9[_0x7034('0x56')]);return db[_0x7034('0x43')][_0x7034('0x5c')](_0x2fff66)[_0x7034('0x21')](handleEntityNotFound(_0xaca5bd,null))[_0x7034('0x21')](respondWithResult(_0xaca5bd,null))[_0x7034('0x2b')](handleError(_0xaca5bd,null));};exports[_0x7034('0x5d')]=function(_0x56da54,_0x1f50e7){return db[_0x7034('0x43')][_0x7034('0x5d')](_0x56da54['body'],{})[_0x7034('0x21')](function(_0xab5e1c){var _0x1ff7a7=_0x56da54['user'][_0x7034('0x39')]({'plain':!![]});if(!_0x1ff7a7)throw new Error(_0x7034('0x5e'));if(_0x1ff7a7[_0x7034('0x5f')]==='user'){var _0x2edd32=_0xab5e1c['get']({'plain':!![]});var _0x4b49b9=_0x7034('0x3a');return db['UserProfileSection']['find']({'where':{'name':_0x4b49b9,'userProfileId':_0x1ff7a7['userProfileId']},'raw':!![]})['then'](function(_0x5bc585){if(_0x5bc585&&_0x5bc585[_0x7034('0x60')]===0x0){return db['UserProfileResource'][_0x7034('0x5d')]({'name':_0x2edd32['name'],'resourceId':_0x2edd32['id'],'type':_0x5bc585[_0x7034('0x3e')],'sectionId':_0x5bc585['id']},{})[_0x7034('0x21')](function(){return _0xab5e1c;});}else{return _0xab5e1c;}})['catch'](function(_0x474927){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x474927);throw _0x474927;});}return _0xab5e1c;})[_0x7034('0x21')](respondWithResult(_0x1f50e7,0xc9))['catch'](handleError(_0x1f50e7,null));};exports['update']=function(_0x598eb7,_0xb6bce6){if(_0x598eb7['body']['id']){delete _0x598eb7[_0x7034('0x61')]['id'];}return db[_0x7034('0x43')]['find']({'where':{'id':_0x598eb7[_0x7034('0x5b')]['id']},'include':[{'model':db[_0x7034('0x40')],'as':_0x7034('0x41')}]})[_0x7034('0x21')](handleEntityNotFound(_0xb6bce6,null))[_0x7034('0x21')](saveUpdates(_0x598eb7[_0x7034('0x61')],null))[_0x7034('0x21')](respondWithResult(_0xb6bce6,null))[_0x7034('0x2b')](handleError(_0xb6bce6,null));};exports[_0x7034('0x3c')]=function(_0x177a5c,_0x4b84da){return db[_0x7034('0x43')][_0x7034('0x5c')]({'where':{'id':_0x177a5c['params']['id']}})['then'](handleEntityNotFound(_0x4b84da,null))[_0x7034('0x21')](removeEntity(_0x4b84da,null))['catch'](handleError(_0x4b84da,null));};exports['describe']=function(_0x4c7c6f,_0xb4cfdb){return db['OpenchannelAccount'][_0x7034('0x62')]()[_0x7034('0x21')](respondWithResult(_0xb4cfdb,null))[_0x7034('0x2b')](handleError(_0xb4cfdb,null));};exports['addDisposition']=function(_0x300414,_0x10e84b,_0x5c6c05){if(_0x300414['body']['id']){delete _0x300414['body']['id'];}return db[_0x7034('0x43')][_0x7034('0x5c')]({'where':{'id':_0x300414['params']['id']}})[_0x7034('0x21')](handleEntityNotFound(_0x10e84b,null))['then'](function(_0x57a3b7){if(_0x57a3b7){_0x300414[_0x7034('0x61')][_0x7034('0x63')]=_0x57a3b7['id'];return db[_0x7034('0x64')][_0x7034('0x5d')](_0x300414[_0x7034('0x61')]);}})[_0x7034('0x21')](respondWithResult(_0x10e84b,null))[_0x7034('0x2b')](handleError(_0x10e84b,null));};exports[_0x7034('0x65')]=function(_0x30e8d4,_0x420a2b,_0x125d4a){var _0x317f9e={'raw':![],'where':{}};var _0x3dbef3={};var _0x22c6ec={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x7034('0x66')]({'where':{'id':_0x30e8d4[_0x7034('0x5b')]['id']}})[_0x7034('0x21')](handleEntityNotFound(_0x420a2b,null))[_0x7034('0x21')](function(_0x4f698a){if(_0x4f698a){_0x3dbef3[_0x7034('0x4b')]=_['keys'](db['Disposition'][_0x7034('0x44')]);_0x3dbef3[_0x7034('0x46')]=_['keys'](_0x30e8d4[_0x7034('0x46')]);_0x3dbef3[_0x7034('0x48')]=_[_0x7034('0x4a')](_0x3dbef3[_0x7034('0x4b')],_0x3dbef3[_0x7034('0x46')]);_0x317f9e['attributes']=_['intersection'](_0x3dbef3[_0x7034('0x4b')],qs[_0x7034('0x4c')](_0x30e8d4[_0x7034('0x46')][_0x7034('0x4c')]));_0x317f9e[_0x7034('0x49')]=_0x317f9e[_0x7034('0x49')]['length']?_0x317f9e['attributes']:_0x3dbef3['model'];if(!_0x30e8d4[_0x7034('0x46')][_0x7034('0x4e')](_0x7034('0x67'))){_0x317f9e[_0x7034('0x31')]=qs[_0x7034('0x31')](_0x30e8d4['query'][_0x7034('0x31')]);_0x317f9e[_0x7034('0x30')]=qs[_0x7034('0x30')](_0x30e8d4[_0x7034('0x46')][_0x7034('0x30')]);}_0x317f9e[_0x7034('0x4f')]=qs[_0x7034('0x50')](_0x30e8d4[_0x7034('0x46')][_0x7034('0x50')]);_0x317f9e[_0x7034('0x52')]=qs['filters'](_[_0x7034('0x51')](_0x30e8d4['query'],_0x3dbef3[_0x7034('0x48')]));_0x317f9e[_0x7034('0x52')][_0x7034('0x63')]=_0x4f698a['id'];if(_0x30e8d4[_0x7034('0x46')]['filter']){_0x317f9e[_0x7034('0x52')]=_[_0x7034('0x53')](_0x317f9e[_0x7034('0x52')],{'$or':_[_0x7034('0x42')](_0x317f9e[_0x7034('0x49')],function(_0x5093fa){var _0x45741a={};_0x45741a[_0x5093fa]={'$like':'%'+_0x30e8d4[_0x7034('0x46')][_0x7034('0x55')]+'%'};return _0x45741a;})});}_0x317f9e=_[_0x7034('0x53')]({},_0x317f9e,_0x30e8d4['options']);return db[_0x7034('0x64')][_0x7034('0x33')]({'where':_0x317f9e['where']})[_0x7034('0x21')](function(_0x178034){_0x22c6ec[_0x7034('0x33')]=_0x178034;if(_0x30e8d4[_0x7034('0x46')][_0x7034('0x57')]){_0x317f9e['include']=[{'all':!![]}];}return db[_0x7034('0x64')]['findAll'](_0x317f9e);})[_0x7034('0x21')](function(_0x5c1e9c){_0x22c6ec[_0x7034('0x5a')]=_0x5c1e9c;return _0x22c6ec;});}})[_0x7034('0x21')](respondWithFilteredResult(_0x420a2b,_0x317f9e))[_0x7034('0x2b')](handleError(_0x420a2b,null));};exports[_0x7034('0x68')]=function(_0x3b7dc2,_0x20403e,_0x260966){return db[_0x7034('0x43')][_0x7034('0x5c')]({'where':{'id':_0x3b7dc2[_0x7034('0x5b')]['id']}})[_0x7034('0x21')](handleEntityNotFound(_0x20403e,null))[_0x7034('0x21')](function(_0x29e15a){if(_0x29e15a){return _0x29e15a['removeDispositions'](_0x3b7dc2[_0x7034('0x46')][_0x7034('0x69')]);}})[_0x7034('0x21')](respondWithStatusCode(_0x20403e,null))['catch'](handleError(_0x20403e,null));};exports[_0x7034('0x6a')]=function(_0x2447a8,_0x57a034,_0x287985){if(_0x2447a8[_0x7034('0x61')]['id']){delete _0x2447a8[_0x7034('0x61')]['id'];}return db[_0x7034('0x43')][_0x7034('0x5c')]({'where':{'id':_0x2447a8[_0x7034('0x5b')]['id']}})[_0x7034('0x21')](handleEntityNotFound(_0x57a034,null))[_0x7034('0x21')](function(_0x129e1d){if(_0x129e1d){_0x2447a8[_0x7034('0x61')]['OpenchannelAccountId']=_0x129e1d['id'];return db[_0x7034('0x6b')]['create'](_0x2447a8[_0x7034('0x61')]);}})[_0x7034('0x21')](respondWithResult(_0x57a034,null))[_0x7034('0x2b')](handleError(_0x57a034,null));};exports[_0x7034('0x6c')]=function(_0x43ebf4,_0xb5025b,_0x32baf0){var _0x1f67d4={'raw':![],'where':{}};var _0x561447={};var _0x5d01d0={'count':0x0,'rows':[]};return db[_0x7034('0x43')][_0x7034('0x66')]({'where':{'id':_0x43ebf4[_0x7034('0x5b')]['id']}})['then'](handleEntityNotFound(_0xb5025b,null))[_0x7034('0x21')](function(_0x3a2e9f){if(_0x3a2e9f){_0x561447[_0x7034('0x4b')]=_['keys'](db[_0x7034('0x6b')][_0x7034('0x44')]);_0x561447[_0x7034('0x46')]=_[_0x7034('0x47')](_0x43ebf4['query']);_0x561447[_0x7034('0x48')]=_['intersection'](_0x561447['model'],_0x561447[_0x7034('0x46')]);_0x1f67d4['attributes']=_[_0x7034('0x4a')](_0x561447[_0x7034('0x4b')],qs[_0x7034('0x4c')](_0x43ebf4['query']['fields']));_0x1f67d4[_0x7034('0x49')]=_0x1f67d4[_0x7034('0x49')]['length']?_0x1f67d4['attributes']:_0x561447[_0x7034('0x4b')];if(!_0x43ebf4[_0x7034('0x46')]['hasOwnProperty'](_0x7034('0x67'))){_0x1f67d4['limit']=qs[_0x7034('0x31')](_0x43ebf4[_0x7034('0x46')][_0x7034('0x31')]);_0x1f67d4[_0x7034('0x30')]=qs[_0x7034('0x30')](_0x43ebf4[_0x7034('0x46')][_0x7034('0x30')]);}_0x1f67d4[_0x7034('0x4f')]=qs['sort'](_0x43ebf4[_0x7034('0x46')][_0x7034('0x50')]);_0x1f67d4['where']=qs[_0x7034('0x48')](_[_0x7034('0x51')](_0x43ebf4[_0x7034('0x46')],_0x561447[_0x7034('0x48')]));_0x1f67d4[_0x7034('0x52')][_0x7034('0x63')]=_0x3a2e9f['id'];if(_0x43ebf4[_0x7034('0x46')][_0x7034('0x55')]){_0x1f67d4['where']=_[_0x7034('0x53')](_0x1f67d4[_0x7034('0x52')],{'$or':_[_0x7034('0x42')](_0x1f67d4[_0x7034('0x49')],function(_0x2a1d17){var _0x2c681b={};_0x2c681b[_0x2a1d17]={'$like':'%'+_0x43ebf4[_0x7034('0x46')][_0x7034('0x55')]+'%'};return _0x2c681b;})});}_0x1f67d4=_[_0x7034('0x53')]({},_0x1f67d4,_0x43ebf4[_0x7034('0x56')]);return db[_0x7034('0x6b')][_0x7034('0x33')]({'where':_0x1f67d4[_0x7034('0x52')]})[_0x7034('0x21')](function(_0x3be63f){_0x5d01d0[_0x7034('0x33')]=_0x3be63f;if(_0x43ebf4[_0x7034('0x46')][_0x7034('0x57')]){_0x1f67d4[_0x7034('0x58')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x1f67d4);})[_0x7034('0x21')](function(_0x29fb23){_0x5d01d0[_0x7034('0x5a')]=_0x29fb23;return _0x5d01d0;});}})[_0x7034('0x21')](respondWithFilteredResult(_0xb5025b,_0x1f67d4))[_0x7034('0x2b')](handleError(_0xb5025b,null));};exports[_0x7034('0x6d')]=function(_0x1251f7,_0x1d2d36,_0x1f0e1d){return db['OpenchannelAccount'][_0x7034('0x5c')]({'where':{'id':_0x1251f7['params']['id']}})[_0x7034('0x21')](handleEntityNotFound(_0x1d2d36,null))[_0x7034('0x21')](function(_0x8c6dcd){if(_0x8c6dcd){return _0x8c6dcd[_0x7034('0x6d')](_0x1251f7[_0x7034('0x46')][_0x7034('0x69')]);}})[_0x7034('0x21')](respondWithStatusCode(_0x1d2d36,null))['catch'](handleError(_0x1d2d36,null));};exports['notify']=function(_0x171605,_0x30b9be,_0x1e8e89){var _0x31329d={'body':_0x171605['body'],'channel':_0x7034('0x6e')};var _0x10b649=[];var _0x13b1fa=[];var _0x576f82={};var _0xfe77e7=![];return db[_0x7034('0x6f')][_0x7034('0x62')]()[_0x7034('0x21')](function(_0x26c05f){if(!_0x26c05f){throw new db[(_0x7034('0x70'))][(_0x7034('0x71'))]('no\x20available\x20attributes');}_0x10b649=_[_0x7034('0x72')](_['keys'](_0x26c05f),[_0x7034('0x73'),'updatedAt']);_0x13b1fa=_['difference'](_[_0x7034('0x47')](_0x26c05f),[_0x7034('0x73'),_0x7034('0x74'),_0x7034('0x75'),_0x7034('0x76')]);if(_0x171605[_0x7034('0x61')]['id']){delete _0x171605[_0x7034('0x61')]['id'];}if(_[_0x7034('0x77')](_0x171605[_0x7034('0x61')][_0x7034('0x78')])){throw new db[(_0x7034('0x70'))][(_0x7034('0x71'))](_0x7034('0x79'));}if(_[_0x7034('0x77')](_0x171605[_0x7034('0x61')][_0x7034('0x61')])||_0x171605[_0x7034('0x61')][_0x7034('0x61')]===''){throw new db['Sequelize'][(_0x7034('0x71'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x7034('0x77')](_0x171605['body'][_0x7034('0x7a')])){throw new db[(_0x7034('0x70'))]['ValidationError'](_0x7034('0x7b')+_0x13b1fa);}if(!_[_0x7034('0x7c')](_0x13b1fa,_0x171605[_0x7034('0x61')][_0x7034('0x7a')])){throw new db[(_0x7034('0x70'))][(_0x7034('0x71'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x13b1fa);}_0x576f82[_0x171605['body'][_0x7034('0x7a')]]=_0x171605[_0x7034('0x61')]['from'];})[_0x7034('0x21')](function(){return db['OpenchannelAccount'][_0x7034('0x5c')]({'where':{'id':_0x171605[_0x7034('0x5b')]['id']},'include':[{'model':db[_0x7034('0x7d')],'as':'List','include':[{'model':db[_0x7034('0x6f')],'as':_0x7034('0x7e'),'where':_0x576f82,'limit':0x1,'order':[[_0x7034('0x74'),_0x7034('0x7f')]]}]},{'model':db[_0x7034('0x80')],'as':_0x7034('0x81')}]});})[_0x7034('0x21')](handleEntityNotFound(_0x30b9be,null))['then'](function(_0xd43089){if(_0xd43089&&_0xd43089[_0x7034('0x82')]){_0x31329d[_0x7034('0x83')]=_0xd43089;_0x31329d[_0x7034('0x84')]=_0xd43089[_0x7034('0x81')];_0x31329d[_0x7034('0x85')]=_0xd43089[_0x7034('0x82')];_0x31329d[_0x7034('0x84')]=_[_0x7034('0x86')](_0x31329d[_0x7034('0x84')],[_0x7034('0x87')],[_0x7034('0x88')]);if(_0x31329d[_0x7034('0x83')][_0x7034('0x81')]){delete _0x31329d['account'][_0x7034('0x81')];}if(_0x31329d[_0x7034('0x83')][_0x7034('0x82')]&&_0x31329d[_0x7034('0x83')][_0x7034('0x82')][_0x7034('0x7e')]['length']){return _0x31329d[_0x7034('0x83')][_0x7034('0x82')][_0x7034('0x7e')][0x0];}var _0x6d90f4=_[_0x7034('0x19')](_0x171605[_0x7034('0x61')],{'firstName':_0x171605[_0x7034('0x61')][_0x7034('0x78')],'ListId':_0xd43089['ListId']});_0x6d90f4[_0x171605['body'][_0x7034('0x7a')]]=_0x171605[_0x7034('0x61')]['from'];return db[_0x7034('0x6f')]['create'](_0x6d90f4,{'fields':_0x10b649,'raw':!![]});}})[_0x7034('0x21')](handleEntityNotFound(_0x30b9be,null))[_0x7034('0x21')](function(_0x1b010d){_0x31329d[_0x7034('0x89')]=_0x1b010d;if(_0x1b010d){var _0xff08c9={'ContactId':_0x1b010d['id'],'OpenchannelAccountId':_0x171605[_0x7034('0x5b')]['id'],'from':(_0x1b010d[_0x7034('0x8a')]||'')+'\x20'+(_0x1b010d[_0x7034('0x8b')]||'')};var _0x1345cf={'OpenchannelAccountId':_0x171605[_0x7034('0x5b')]['id'],'closed':![]};if(_0x171605[_0x7034('0x61')]['threadId']){_0x1345cf[_0x7034('0x8c')]=_0x171605['body']['threadId'];return db[_0x7034('0x8d')][_0x7034('0x5c')]({'where':_0x1345cf})[_0x7034('0x21')](function(_0x804dea){if(_0x804dea){return[_0x804dea,![]];}_0xff08c9[_0x7034('0x8c')]=_0x171605[_0x7034('0x61')][_0x7034('0x8c')];_0xff08c9[_0x7034('0x8e')]=_0x171605[_0x7034('0x61')][_0x7034('0x8e')];return db[_0x7034('0x8d')]['create'](_0xff08c9)[_0x7034('0x21')](function(_0x49bd74){return[_0x49bd74,!![]];});});}else{_0x1345cf['threadId']=null;}_0x1345cf['ContactId']=_0x1b010d['id'];return db[_0x7034('0x8d')][_0x7034('0x5c')]({'where':_0x1345cf})[_0x7034('0x21')](function(_0x2c021f){if(_0x2c021f){return[_0x2c021f,![]];}return db['OpenchannelInteraction']['create'](_0xff08c9)[_0x7034('0x21')](function(_0x54d053){return[_0x54d053,!![]];});});}})[_0x7034('0x8f')](function(_0x1d6512,_0x371184){if(_0x1d6512){_0xfe77e7=_0x371184;if(!_0x371184){var _0x4d12c0={'from':(_0x31329d[_0x7034('0x89')][_0x7034('0x8a')]||'')+'\x20'+(_0x31329d[_0x7034('0x89')]['lastName']||'')};if(_0x171605[_0x7034('0x61')]['threadId']&&_0x171605[_0x7034('0x61')][_0x7034('0x90')]&&_0x171605['body'][_0x7034('0x8c')]!=_0x171605[_0x7034('0x61')][_0x7034('0x90')]){_0x4d12c0[_0x7034('0x8c')]=_0x171605[_0x7034('0x61')]['messageId'];}return _0x1d6512[_0x7034('0x38')](_0x4d12c0);}else{return _0x1d6512;}}})[_0x7034('0x21')](function(_0x4aca37){_0x31329d[_0x7034('0x91')]=_0x4aca37[_0x7034('0x39')]({'plain':!![]});_0x31329d[_0x7034('0x91')][_0x7034('0x92')]=_0xfe77e7;if(_0x31329d[_0x7034('0x91')][_0x7034('0x92')]){if(_0x31329d[_0x7034('0x83')][_0x7034('0x93')]){_0x31329d[_0x7034('0x84')]['push']({'id':0x0,'priority':_0x31329d[_0x7034('0x84')][_0x7034('0x4d')]+0x1,'app':_0x7034('0x94'),'appdata':_0x7034('0x95'),'interval':_0x7034('0x96')});}}return db[_0x7034('0x97')][_0x7034('0x5d')]({'body':_0x171605[_0x7034('0x61')][_0x7034('0x61')],'OpenchannelAccountId':_0x171605[_0x7034('0x5b')]['id'],'OpenchannelInteractionId':_0x4aca37['id'],'direction':'in','ContactId':_0x31329d[_0x7034('0x89')]['id'],'AttachmentId':_0x171605[_0x7034('0x61')][_0x7034('0x98')]});})[_0x7034('0x21')](function(_0x859f2f){_0x31329d[_0x7034('0x2a')]=_0x859f2f;if(_0x31329d[_0x7034('0x91')][_0x7034('0x99')]){return db[_0x7034('0x9a')][_0x7034('0x5c')]({'attributes':['id','name'],'where':{'id':_0x31329d[_0x7034('0x91')][_0x7034('0x99')]}})[_0x7034('0x21')](function(_0x5a11f1){if(_0x5a11f1){_0x31329d['applications'][_0x7034('0x9b')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5a11f1[_0x7034('0x3e')]+','+(_0x31329d[_0x7034('0x83')]['waitForTheAssignedAgent']||0xa),'interval':_0x7034('0x96')});_0x31329d[_0x7034('0x9c')]=![];}return respondWithRpcPromise('Start',_0x7034('0x9d'),_0x31329d);});}return respondWithRpcPromise(_0x7034('0x9e'),_0x7034('0x9d'),_0x31329d);})[_0x7034('0x21')](function(_0xa18657){respondWithRpcPromise(_0x7034('0x9f'),_0x7034('0x9f'),{'event':_0x7034('0xa0'),'message':_0xa18657},client9002);return _0xa18657;})['then'](respondWithResult(_0x30b9be,null))[_0x7034('0x2b')](handleError(_0x30b9be,null));};exports['addApplications']=function(_0x4e2e63,_0x539064,_0x2f616e){return db['OpenchannelAccount']['findOne']({'where':{'id':_0x4e2e63[_0x7034('0x5b')]['id']}})[_0x7034('0x21')](handleEntityNotFound(_0x539064,null))[_0x7034('0x21')](function(_0x44ea34){if(_0x44ea34){return db[_0x7034('0xa1')][_0x7034('0xa2')](function(_0xb76f5f){return db[_0x7034('0x80')][_0x7034('0x3c')]({'where':{'OpenchannelAccountId':_0x4e2e63['params']['id']},'transaction':_0xb76f5f})[_0x7034('0x21')](function(_0x388a47){var _0x5c40c5=_[_0x7034('0x42')](_0x4e2e63[_0x7034('0x61')],function(_0x27515e){_0x27515e['OpenchannelAccountId']=_0x4e2e63[_0x7034('0x5b')]['id'];return _0x27515e;});return db[_0x7034('0x80')][_0x7034('0xa3')](_0x5c40c5,{'transaction':_0xb76f5f});});})[_0x7034('0x21')](function(){return db[_0x7034('0x80')][_0x7034('0xa4')]({'where':{'OpenchannelAccountId':_0x4e2e63[_0x7034('0x5b')]['id']},'order':'priority'});});}})[_0x7034('0x21')](respondWithResult(_0x539064,null))[_0x7034('0x2b')](handleError(_0x539064,null));};exports[_0x7034('0xa5')]=function(_0x4f3805,_0x3732be,_0x2d4edf){var _0x5d2eba={};var _0x589d5f={};var _0x2312c2;var _0x58d8f9;return db[_0x7034('0x43')][_0x7034('0x66')]({'where':{'id':_0x4f3805['params']['id']}})[_0x7034('0x21')](handleEntityNotFound(_0x3732be,null))[_0x7034('0x21')](function(_0x437da8){if(_0x437da8){_0x2312c2=_0x437da8;_0x589d5f[_0x7034('0x4b')]=_[_0x7034('0x47')](db[_0x7034('0x80')][_0x7034('0x44')]);_0x589d5f[_0x7034('0x46')]=_['keys'](_0x4f3805['query']);_0x589d5f[_0x7034('0x48')]=_[_0x7034('0x4a')](_0x589d5f[_0x7034('0x4b')],_0x589d5f[_0x7034('0x46')]);_0x5d2eba['attributes']=_[_0x7034('0x4a')](_0x589d5f['model'],qs['fields'](_0x4f3805[_0x7034('0x46')][_0x7034('0x4c')]));_0x5d2eba['attributes']=_0x5d2eba[_0x7034('0x49')]['length']?_0x5d2eba[_0x7034('0x49')]:_0x589d5f[_0x7034('0x4b')];_0x5d2eba[_0x7034('0x4f')]=qs[_0x7034('0x50')](_0x4f3805[_0x7034('0x46')]['sort']);_0x5d2eba[_0x7034('0x52')]=qs[_0x7034('0x48')](_['pick'](_0x4f3805[_0x7034('0x46')],_0x589d5f[_0x7034('0x48')]));if(_0x4f3805['query']['filter']){_0x5d2eba[_0x7034('0x52')]=_[_0x7034('0x53')](_0x5d2eba[_0x7034('0x52')],{'$or':_[_0x7034('0x42')](_0x5d2eba[_0x7034('0x49')],function(_0x406af6){var _0x30d8b0={};_0x30d8b0[_0x406af6]={'$like':'%'+_0x4f3805[_0x7034('0x46')]['filter']+'%'};return _0x30d8b0;})});}_0x5d2eba=_[_0x7034('0x53')]({},_0x5d2eba,_0x4f3805['options']);return _0x2312c2[_0x7034('0xa5')](_0x5d2eba);}})[_0x7034('0x21')](function(_0x5b8c56){if(_0x5b8c56){_0x58d8f9=_0x5b8c56[_0x7034('0x4d')];if(!_0x4f3805[_0x7034('0x46')][_0x7034('0x4e')](_0x7034('0x67'))){_0x5d2eba[_0x7034('0x31')]=qs[_0x7034('0x31')](_0x4f3805[_0x7034('0x46')][_0x7034('0x31')]);_0x5d2eba[_0x7034('0x30')]=qs[_0x7034('0x30')](_0x4f3805['query'][_0x7034('0x30')]);}return _0x2312c2[_0x7034('0xa5')](_0x5d2eba);}})[_0x7034('0x21')](function(_0x40c7b4){if(_0x40c7b4){return _0x40c7b4?{'count':_0x58d8f9,'rows':_0x40c7b4}:null;}})[_0x7034('0x21')](respondWithResult(_0x3732be,null))[_0x7034('0x2b')](handleError(_0x3732be,null));};exports[_0x7034('0xa6')]=function(_0x498145,_0x27a4aa,_0x51a653){var _0x3b41f1={'raw':![],'where':{}};var _0x16f784={};var _0x4e2bd8={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x7034('0x66')]({'where':{'id':_0x498145['params']['id']}})[_0x7034('0x21')](handleEntityNotFound(_0x27a4aa,null))[_0x7034('0x21')](function(_0x4ed735){if(_0x4ed735){_0x16f784['model']=_[_0x7034('0x47')](db[_0x7034('0x8d')][_0x7034('0x44')]);_0x16f784[_0x7034('0x46')]=_[_0x7034('0x47')](_0x498145[_0x7034('0x46')]);_0x16f784[_0x7034('0x48')]=_[_0x7034('0x4a')](_0x16f784[_0x7034('0x4b')],_0x16f784[_0x7034('0x46')]);_0x3b41f1[_0x7034('0x49')]=_[_0x7034('0x4a')](_0x16f784['model'],qs[_0x7034('0x4c')](_0x498145[_0x7034('0x46')][_0x7034('0x4c')]));_0x3b41f1[_0x7034('0x49')]=_0x3b41f1[_0x7034('0x49')][_0x7034('0x4d')]?_0x3b41f1[_0x7034('0x49')]:_0x16f784['model'];if(!_0x498145[_0x7034('0x46')][_0x7034('0x4e')](_0x7034('0x67'))){_0x3b41f1['limit']=qs[_0x7034('0x31')](_0x498145[_0x7034('0x46')]['limit']);_0x3b41f1['offset']=qs['offset'](_0x498145['query'][_0x7034('0x30')]);}_0x3b41f1[_0x7034('0x4f')]=qs[_0x7034('0x50')](_0x498145[_0x7034('0x46')]['sort']);_0x3b41f1[_0x7034('0x52')]=qs[_0x7034('0x48')](_[_0x7034('0x51')](_0x498145[_0x7034('0x46')],_0x16f784['filters']));_0x3b41f1[_0x7034('0x52')][_0x7034('0x63')]=_0x4ed735['id'];if(_0x498145[_0x7034('0x46')][_0x7034('0x55')]){_0x3b41f1[_0x7034('0x52')]=_[_0x7034('0x53')](_0x3b41f1[_0x7034('0x52')],{'$or':_['map'](_0x3b41f1[_0x7034('0x49')],function(_0x1595c1){var _0x33cf57={};_0x33cf57[_0x1595c1]={'$like':'%'+_0x498145['query'][_0x7034('0x55')]+'%'};return _0x33cf57;})});}_0x3b41f1=_[_0x7034('0x53')]({},_0x3b41f1,_0x498145[_0x7034('0x56')]);return db[_0x7034('0x8d')][_0x7034('0x33')]({'where':_0x3b41f1['where']})[_0x7034('0x21')](function(_0x575694){_0x4e2bd8[_0x7034('0x33')]=_0x575694;if(_0x498145['query']['includeAll']){_0x3b41f1['include']=[{'model':db[_0x7034('0x6f')],'as':_0x7034('0xa7'),'required':![]},{'model':db[_0x7034('0x9a')],'as':'Owner','attributes':[_0x7034('0x3e'),_0x7034('0xa8'),_0x7034('0xa9')],'required':![]},{'model':db['Tag'],'as':_0x7034('0xaa'),'attributes':['id',_0x7034('0x3e'),'color'],'where':_0x498145[_0x7034('0x46')][_0x7034('0xab')]?{'id':_0x498145[_0x7034('0x46')][_0x7034('0xab')]}:undefined,'required':_0x498145['query'][_0x7034('0xab')]?!![]:![]}];}return db[_0x7034('0x8d')][_0x7034('0x59')](_0x3b41f1);})[_0x7034('0x21')](function(_0x106244){_0x4e2bd8['rows']=_0x106244;return _0x4e2bd8;});}})[_0x7034('0x21')](respondWithFilteredResult(_0x27a4aa,_0x3b41f1))[_0x7034('0x2b')](handleError(_0x27a4aa,null));};exports[_0x7034('0xac')]=function(_0x39c067,_0x3e4070,_0x382190){return db[_0x7034('0x43')][_0x7034('0x5c')]({'where':{'id':_0x39c067[_0x7034('0x5b')]['id']}})[_0x7034('0x21')](handleEntityNotFound(_0x3e4070,null))[_0x7034('0x21')](function(_0x33a773){if(_0x33a773){return _0x33a773[_0x7034('0xac')](_0x39c067[_0x7034('0x61')]['ids'],_[_0x7034('0xad')](_0x39c067[_0x7034('0x61')],[_0x7034('0x69'),'id'])||{})[_0x7034('0x8f')](function(_0x56d473){for(var _0x3bd0ab=0x0;_0x3bd0ab<_0x39c067[_0x7034('0x61')][_0x7034('0x69')][_0x7034('0x4d')];_0x3bd0ab+=0x1){socket[_0x7034('0xae')]('userOpenchannelAccount:save',{'UserId':Number(_0x39c067[_0x7034('0x61')][_0x7034('0x69')][_0x3bd0ab]),'OpenchannelAccountId':Number(_0x39c067[_0x7034('0x5b')]['id'])});}return _0x56d473;});}})['then'](respondWithResult(_0x3e4070,null))[_0x7034('0x2b')](handleError(_0x3e4070,null));};exports[_0x7034('0xaf')]=function(_0x315273,_0x1d9187,_0x538a51){return db[_0x7034('0x43')]['find']({'where':{'id':_0x315273[_0x7034('0x5b')]['id']}})[_0x7034('0x21')](handleEntityNotFound(_0x1d9187,null))[_0x7034('0x21')](function(_0x2ea2cd){if(_0x2ea2cd){return _0x2ea2cd[_0x7034('0xaf')](_0x315273['query'][_0x7034('0x69')])[_0x7034('0x21')](function(){if(_['isArray'](_0x315273[_0x7034('0x46')][_0x7034('0x69')])){for(var _0x3e9933=0x0;_0x3e9933<_0x315273['query'][_0x7034('0x69')][_0x7034('0x4d')];_0x3e9933+=0x1){socket[_0x7034('0xae')]('userOpenchannelAccount:remove',{'UserId':Number(_0x315273[_0x7034('0x46')][_0x7034('0x69')][_0x3e9933]),'OpenchannelAccountId':Number(_0x315273[_0x7034('0x5b')]['id'])});}}else{socket[_0x7034('0xae')](_0x7034('0xb0'),{'UserId':Number(_0x315273[_0x7034('0x46')][_0x7034('0x69')]),'OpenchannelAccountId':Number(_0x315273[_0x7034('0x5b')]['id'])});}});}})[_0x7034('0x21')](respondWithStatusCode(_0x1d9187,null))[_0x7034('0x2b')](handleError(_0x1d9187,null));};exports[_0x7034('0xb1')]=function(_0x4028e4,_0x176811,_0x3b9567){var _0x51c665={};var _0x29000c={};var _0x1cb64d;var _0x475936;return db[_0x7034('0x43')][_0x7034('0x66')]({'where':{'id':_0x4028e4[_0x7034('0x5b')]['id']}})['then'](handleEntityNotFound(_0x176811,null))[_0x7034('0x21')](function(_0x498ae9){if(_0x498ae9){_0x1cb64d=_0x498ae9;_0x29000c[_0x7034('0x4b')]=_[_0x7034('0x47')](db[_0x7034('0x9a')]['rawAttributes']);_0x29000c[_0x7034('0x46')]=_[_0x7034('0x47')](_0x4028e4[_0x7034('0x46')]);_0x29000c['filters']=_[_0x7034('0x4a')](_0x29000c[_0x7034('0x4b')],_0x29000c[_0x7034('0x46')]);_0x51c665[_0x7034('0x49')]=_['intersection'](_0x29000c[_0x7034('0x4b')],qs[_0x7034('0x4c')](_0x4028e4[_0x7034('0x46')][_0x7034('0x4c')]));_0x51c665[_0x7034('0x49')]=_0x51c665[_0x7034('0x49')][_0x7034('0x4d')]?_0x51c665[_0x7034('0x49')]:_0x29000c['model'];_0x51c665[_0x7034('0x4f')]=qs[_0x7034('0x50')](_0x4028e4[_0x7034('0x46')][_0x7034('0x50')]);_0x51c665[_0x7034('0x52')]=qs[_0x7034('0x48')](_[_0x7034('0x51')](_0x4028e4[_0x7034('0x46')],_0x29000c[_0x7034('0x48')]));if(_0x4028e4['query'][_0x7034('0x55')]){_0x51c665[_0x7034('0x52')]=_['merge'](_0x51c665['where'],{'$or':_[_0x7034('0x42')](_0x51c665[_0x7034('0x49')],function(_0x33c7f6){var _0x127fdf={};_0x127fdf[_0x33c7f6]={'$like':'%'+_0x4028e4[_0x7034('0x46')][_0x7034('0x55')]+'%'};return _0x127fdf;})});}_0x51c665=_[_0x7034('0x53')]({},_0x51c665,_0x4028e4['options']);return _0x1cb64d[_0x7034('0xb1')](_0x51c665);}})[_0x7034('0x21')](function(_0x4dbc18){if(_0x4dbc18){_0x475936=_0x4dbc18[_0x7034('0x4d')];if(!_0x4028e4[_0x7034('0x46')][_0x7034('0x4e')](_0x7034('0x67'))){_0x51c665[_0x7034('0x31')]=qs['limit'](_0x4028e4[_0x7034('0x46')][_0x7034('0x31')]);_0x51c665[_0x7034('0x30')]=qs[_0x7034('0x30')](_0x4028e4[_0x7034('0x46')][_0x7034('0x30')]);}return _0x1cb64d[_0x7034('0xb1')](_0x51c665);}})[_0x7034('0x21')](function(_0xb3b6e0){if(_0xb3b6e0){return _0xb3b6e0?{'count':_0x475936,'rows':_0xb3b6e0}:null;}})['then'](respondWithResult(_0x176811,null))[_0x7034('0x2b')](handleError(_0x176811,null));};exports[_0x7034('0xb2')]=function(_0x5e0c61,_0x5badbf,_0x72dc00){var _0x34d571,_0x5bb088,_0x59c044;if(_[_0x7034('0x77')](_0x5e0c61[_0x7034('0x61')][_0x7034('0x61')])||_0x5e0c61['body']['body']===''){throw new db[(_0x7034('0x70'))]['ValidationError'](_0x7034('0xb3'));}if(_[_0x7034('0x77')](_0x5e0c61[_0x7034('0x61')]['to'])){}_0x34d571=_0x5e0c61[_0x7034('0x61')]['to'];return db[_0x7034('0x43')]['findOne']({'where':{'id':_0x5e0c61['params']['id']}})['then'](handleEntityNotFound(_0x5badbf,null))[_0x7034('0x21')](function(_0x54f06f){if(_0x54f06f){return db['OpenchannelAccount'][_0x7034('0x5c')]({'where':{'id':_0x54f06f['id']},'include':[{'model':db[_0x7034('0x7d')],'as':'List','include':[{'model':db[_0x7034('0x6f')],'as':_0x7034('0x7e'),'where':{[_0x54f06f['mapKey']]:_0x34d571},'limit':0x1,'order':[[_0x7034('0x74'),_0x7034('0x7f')]]}]}]})[_0x7034('0x21')](handleEntityNotFound(_0x5badbf,null))['then'](function(_0x576dda){if(_0x576dda&&_0x576dda[_0x7034('0x82')]){_0x5bb088=_0x576dda[_0x7034('0x39')]({'plain':!![]});if(_0x5bb088['List']&&_0x5bb088[_0x7034('0x82')][_0x7034('0x7e')][_0x7034('0x4d')]){return _0x5bb088[_0x7034('0x82')][_0x7034('0x7e')][0x0];}return db['CmContact'][_0x7034('0x5d')](_[_0x7034('0x19')](_0x5e0c61[_0x7034('0x61')],{'firstName':_0x34d571,[_0x576dda[_0x7034('0x7a')]]:_0x34d571,'phone':_0x34d571,'ListId':_0x5bb088['ListId']}));}})[_0x7034('0x21')](handleEntityNotFound(_0x5badbf,null))[_0x7034('0x21')](function(_0x12115e){if(_0x12115e){_0x59c044=_0x12115e;return db[_0x7034('0x8d')]['find']({'where':{'ContactId':_0x59c044['id'],'closed':![],'OpenchannelAccountId':_0x5bb088['id']}})[_0x7034('0x21')](function(_0x265025){if(_0x265025){return[_0x265025,![]];}return db[_0x7034('0x8d')][_0x7034('0x5d')]({'UserId':_0x5e0c61['user']['id'],'ContactId':_0x59c044['id'],'OpenchannelAccountId':_0x5bb088['id'],'lastMsgDirection':_0x7034('0xb4'),'Messages':[_['merge'](_0x5e0c61[_0x7034('0x61')],{'read':![],'body':_0x5e0c61['body'][_0x7034('0x61')],'OpenchannelAccountId':_0x5bb088['id'],'UserId':_0x5e0c61[_0x7034('0xb5')]['id'],'ContactId':_0x59c044['id']})]},{'include':[{'model':db[_0x7034('0x97')],'as':_0x7034('0xb6')}]})[_0x7034('0x21')](function(_0x38b56c){return[_0x38b56c,!![]];});});}})[_0x7034('0x8f')](function(_0x42244d,_0x48b6a2){if(_0x48b6a2){return _0x42244d;}return db[_0x7034('0x97')]['create'](_[_0x7034('0x53')](_0x5e0c61[_0x7034('0x61')],{'read':![],'body':_0x5e0c61['body']['body'],'OpenchannelAccountId':_0x5bb088['id'],'OpenchannelInteractionId':_0x42244d['id'],'UserId':_0x5e0c61[_0x7034('0xb5')]['id'],'ContactId':_0x59c044['id']}))[_0x7034('0x21')](function(_0x3cddc6){_0x42244d['dataValues'][_0x7034('0xb6')]=[];_0x42244d[_0x7034('0xb7')][_0x7034('0xb6')]['push'](_0x3cddc6[_0x7034('0xb7')]);return _0x42244d;});});}})[_0x7034('0x21')](respondWithResult(_0x5badbf,null))['catch'](handleError(_0x5badbf,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 306b455..53880ec 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 _0xb58b=['exports','../../mysqldb','OpenchannelAccount','setMaxListeners','update','remove','emit','hook'];(function(_0x21dfe5,_0x1c4265){var _0x51a41e=function(_0x3fc444){while(--_0x3fc444){_0x21dfe5['push'](_0x21dfe5['shift']());}};_0x51a41e(++_0x1c4265);}(_0xb58b,0x1f1));var _0xbb58=function(_0x4cad04,_0x4787a1){_0x4cad04=_0x4cad04-0x0;var _0xbb7b5d=_0xb58b[_0x4cad04];return _0xbb7b5d;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0xbb58('0x0'))['db'][_0xbb58('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xbb58('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbb58('0x3'),'afterDestroy':_0xbb58('0x4')};function emitEvent(_0x5c9ec5){return function(_0x226363,_0x546510,_0x2edb10){OpenchannelAccountEvents[_0xbb58('0x5')](_0x5c9ec5+':'+_0x226363['id'],_0x226363);OpenchannelAccountEvents[_0xbb58('0x5')](_0x5c9ec5,_0x226363);_0x2edb10(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0xbb58('0x6')](e,emitEvent(event));}}module[_0xbb58('0x7')]=OpenchannelAccountEvents; \ No newline at end of file +var _0xbdb7=['save','update','remove','hasOwnProperty','hook','events','../../mysqldb','OpenchannelAccount','setMaxListeners'];(function(_0x1cc3f9,_0x5033d2){var _0x59268d=function(_0x27492c){while(--_0x27492c){_0x1cc3f9['push'](_0x1cc3f9['shift']());}};_0x59268d(++_0x5033d2);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x370284,_0x3348d5){_0x370284=_0x370284-0x0;var _0x1445c8=_0xbdb7[_0x370284];return _0x1445c8;};'use strict';var EventEmitter=require(_0x7bdb('0x0'));var OpenchannelAccount=require(_0x7bdb('0x1'))['db'][_0x7bdb('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x7bdb('0x3')](0x0);var events={'afterCreate':_0x7bdb('0x4'),'afterUpdate':_0x7bdb('0x5'),'afterDestroy':_0x7bdb('0x6')};function emitEvent(_0x2c7e07){return function(_0x46c068,_0x47aec5,_0x28542c){OpenchannelAccountEvents['emit'](_0x2c7e07+':'+_0x46c068['id'],_0x46c068);OpenchannelAccountEvents['emit'](_0x2c7e07,_0x46c068);_0x28542c(null);};}for(var e in events){if(events[_0x7bdb('0x7')](e)){var event=events[e];OpenchannelAccount[_0x7bdb('0x8')](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 49ea162..b9f7f05 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(_0x468933,_0x30188f){var _0x4f968c=function(_0x41e698){while(--_0x41e698){_0x468933['push'](_0x468933['shift']());}};_0x4f968c(++_0x30188f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'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(_0x3f3726,_0x3b0c1a){var _0xeb8bf6=function(_0x345192){while(--_0x345192){_0x3f3726['push'](_0x3f3726['shift']());}};_0xeb8bf6(++_0x3b0c1a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'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 f7144d3..b727632 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 _0x7be1=['../../config/logger','client','http','defaults','redis','localhost','socket.io-emitter','./openchannelAccount.socket','request','then','info','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','OpenchannelAccount,\x20%s,\x20%s','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1ee351,_0x54261b){var _0x245aaf=function(_0x3e4b65){while(--_0x3e4b65){_0x1ee351['push'](_0x1ee351['shift']());}};_0x245aaf(++_0x54261b);}(_0x7be1,0x165));var _0x17be=function(_0x3018eb,_0x570c63){_0x3018eb=_0x3018eb-0x0;var _0x23131f=_0x7be1[_0x3018eb];return _0x23131f;};'use strict';var _=require(_0x17be('0x0'));var util=require(_0x17be('0x1'));var moment=require(_0x17be('0x2'));var BPromise=require('bluebird');var rs=require(_0x17be('0x3'));var fs=require('fs');var Redis=require(_0x17be('0x4'));var db=require(_0x17be('0x5'))['db'];var utils=require(_0x17be('0x6'));var logger=require(_0x17be('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x17be('0x8')][_0x17be('0x9')]({'port':0x232a});config['redis']=_[_0x17be('0xa')](config[_0x17be('0xb')],{'host':_0x17be('0xc'),'port':0x18eb});var socket=require(_0x17be('0xd'))(new Redis(config[_0x17be('0xb')]));require(_0x17be('0xe'))['register'](socket);function respondWithRpcPromise(_0x41e383,_0x589cdb,_0x3d23c3){return new BPromise(function(_0x2c276e,_0x520a49){return client[_0x17be('0xf')](_0x41e383,_0x3d23c3)[_0x17be('0x10')](function(_0x1ee322){logger[_0x17be('0x11')]('OpenchannelAccount,\x20%s,\x20%s',_0x589cdb,_0x17be('0x12'));logger['debug'](_0x17be('0x13'),_0x589cdb,'request\x20sent',JSON[_0x17be('0x14')](_0x1ee322));if(_0x1ee322[_0x17be('0x15')]){if(_0x1ee322[_0x17be('0x15')][_0x17be('0x16')]===0x1f4){logger[_0x17be('0x15')]('OpenchannelAccount,\x20%s,\x20%s',_0x589cdb,_0x1ee322[_0x17be('0x15')]['message']);return _0x520a49(_0x1ee322['error'][_0x17be('0x17')]);}logger['error'](_0x17be('0x18'),_0x589cdb,_0x1ee322['error'][_0x17be('0x17')]);return _0x2c276e(_0x1ee322[_0x17be('0x15')]['message']);}else{logger[_0x17be('0x11')]('OpenchannelAccount,\x20%s,\x20%s',_0x589cdb,_0x17be('0x12'));_0x2c276e(_0x1ee322['result'][_0x17be('0x17')]);}})[_0x17be('0x19')](function(_0x416f81){logger[_0x17be('0x15')](_0x17be('0x18'),_0x589cdb,_0x416f81);_0x520a49(_0x416f81);});});} \ No newline at end of file +var _0x235a=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./openchannelAccount.socket','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x247fa1,_0x4ec37c){var _0x244f35=function(_0xfb98be){while(--_0xfb98be){_0x247fa1['push'](_0x247fa1['shift']());}};_0x244f35(++_0x4ec37c);}(_0x235a,0x1ef));var _0xa235=function(_0x1241bc,_0x4ff189){_0x1241bc=_0x1241bc-0x0;var _0x11951f=_0x235a[_0x1241bc];return _0x11951f;};'use strict';var _=require(_0xa235('0x0'));var util=require(_0xa235('0x1'));var moment=require(_0xa235('0x2'));var BPromise=require('bluebird');var rs=require(_0xa235('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa235('0x4'))['db'];var utils=require(_0xa235('0x5'));var logger=require(_0xa235('0x6'))(_0xa235('0x7'));var config=require(_0xa235('0x8'));var jayson=require(_0xa235('0x9'));var client=jayson[_0xa235('0xa')][_0xa235('0xb')]({'port':0x232a});config['redis']=_[_0xa235('0xc')](config[_0xa235('0xd')],{'host':_0xa235('0xe'),'port':0x18eb});var socket=require(_0xa235('0xf'))(new Redis(config['redis']));require(_0xa235('0x10'))['register'](socket);function respondWithRpcPromise(_0x560eb1,_0x10bb4f,_0x504b60){return new BPromise(function(_0xbde1c7,_0x535bb9){return client['request'](_0x560eb1,_0x504b60)['then'](function(_0x464a85){logger[_0xa235('0x11')](_0xa235('0x12'),_0x10bb4f,_0xa235('0x13'));logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x10bb4f,'request\x20sent',JSON[_0xa235('0x14')](_0x464a85));if(_0x464a85[_0xa235('0x15')]){if(_0x464a85[_0xa235('0x15')][_0xa235('0x16')]===0x1f4){logger[_0xa235('0x15')](_0xa235('0x12'),_0x10bb4f,_0x464a85[_0xa235('0x15')][_0xa235('0x17')]);return _0x535bb9(_0x464a85[_0xa235('0x15')]['message']);}logger[_0xa235('0x15')](_0xa235('0x12'),_0x10bb4f,_0x464a85[_0xa235('0x15')][_0xa235('0x17')]);return _0xbde1c7(_0x464a85[_0xa235('0x15')][_0xa235('0x17')]);}else{logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x10bb4f,_0xa235('0x13'));_0xbde1c7(_0x464a85[_0xa235('0x18')][_0xa235('0x17')]);}})['catch'](function(_0x40b4a9){logger[_0xa235('0x15')](_0xa235('0x12'),_0x10bb4f,_0x40b4a9);_0x535bb9(_0x40b4a9);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 25bb510..787462e 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 _0x78f0=['remove','update','emit','removeListener','register','length','openchannelAccount:','./openchannelAccount.events','save'];(function(_0x13c4eb,_0x5d218c){var _0x421546=function(_0x4d2494){while(--_0x4d2494){_0x13c4eb['push'](_0x13c4eb['shift']());}};_0x421546(++_0x5d218c);}(_0x78f0,0x15d));var _0x078f=function(_0x379969,_0x2ac8a3){_0x379969=_0x379969-0x0;var _0x304b57=_0x78f0[_0x379969];return _0x304b57;};'use strict';var OpenchannelAccountEvents=require(_0x078f('0x0'));var events=[_0x078f('0x1'),_0x078f('0x2'),_0x078f('0x3')];function createListener(_0x11b4c1,_0x2bde34){return function(_0x34a715){_0x2bde34[_0x078f('0x4')](_0x11b4c1,_0x34a715);};}function removeListener(_0x5785fd,_0x2f3d53){return function(){OpenchannelAccountEvents[_0x078f('0x5')](_0x5785fd,_0x2f3d53);};}exports[_0x078f('0x6')]=function(_0x7b5bcd){for(var _0x47cbe5=0x0,_0x728cfe=events[_0x078f('0x7')];_0x47cbe5<_0x728cfe;_0x47cbe5++){var _0x4a7db3=events[_0x47cbe5];var _0x2ef013=createListener(_0x078f('0x8')+_0x4a7db3,_0x7b5bcd);OpenchannelAccountEvents['on'](_0x4a7db3,_0x2ef013);}}; \ No newline at end of file +var _0x149c=['register','length','openchannelAccount:','./openchannelAccount.events','remove','update','emit','removeListener'];(function(_0x596e71,_0x2ca82c){var _0x1a430e=function(_0x3dc9e2){while(--_0x3dc9e2){_0x596e71['push'](_0x596e71['shift']());}};_0x1a430e(++_0x2ca82c);}(_0x149c,0x143));var _0xc149=function(_0x2a97b0,_0x51ead0){_0x2a97b0=_0x2a97b0-0x0;var _0x58181c=_0x149c[_0x2a97b0];return _0x58181c;};'use strict';var OpenchannelAccountEvents=require(_0xc149('0x0'));var events=['save',_0xc149('0x1'),_0xc149('0x2')];function createListener(_0x35e9b8,_0x4f5a90){return function(_0x3b8ac6){_0x4f5a90[_0xc149('0x3')](_0x35e9b8,_0x3b8ac6);};}function removeListener(_0x19a7cb,_0x298415){return function(){OpenchannelAccountEvents[_0xc149('0x4')](_0x19a7cb,_0x298415);};}exports[_0xc149('0x5')]=function(_0x3b5e34){for(var _0x5e9b5c=0x0,_0x578cec=events[_0xc149('0x6')];_0x5e9b5c<_0x578cec;_0x5e9b5c++){var _0x34710e=events[_0x5e9b5c];var _0x3a1739=createListener(_0xc149('0x7')+_0x34710e,_0x3b5e34);OpenchannelAccountEvents['on'](_0x34710e,_0x3a1739);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 31a5134..b4b56e1 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 _0xb8e8=['exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','put','delete','destroy'];(function(_0x55f07b,_0x319461){var _0x4c4171=function(_0x10620c){while(--_0x10620c){_0x55f07b['push'](_0x55f07b['shift']());}};_0x4c4171(++_0x319461);}(_0xb8e8,0x9a));var _0x8b8e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xb8e8[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x8b8e('0x0'));var util=require(_0x8b8e('0x1'));var path=require(_0x8b8e('0x2'));var timeout=require('connect-timeout');var express=require(_0x8b8e('0x3'));var router=express[_0x8b8e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8b8e('0x5'));var interaction=require(_0x8b8e('0x6'));var config=require('../../config/environment');var controller=require(_0x8b8e('0x7'));router[_0x8b8e('0x8')]('/',auth[_0x8b8e('0x9')](),controller[_0x8b8e('0xa')]);router[_0x8b8e('0x8')](_0x8b8e('0xb'),auth[_0x8b8e('0x9')](),controller[_0x8b8e('0xc')]);router['post']('/',auth[_0x8b8e('0x9')](),controller['create']);router[_0x8b8e('0xd')](_0x8b8e('0xb'),auth[_0x8b8e('0x9')](),controller['update']);router[_0x8b8e('0xe')](_0x8b8e('0xb'),auth[_0x8b8e('0x9')](),controller[_0x8b8e('0xf')]);module[_0x8b8e('0x10')]=router; \ No newline at end of file +var _0x2322=['delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelApplication.controller','get','isAuthenticated','/:id','show','post','put','update'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x2322,0x101));var _0x2232=function(_0x12d0ab,_0x19b6ff){_0x12d0ab=_0x12d0ab-0x0;var _0x7de938=_0x2322[_0x12d0ab];return _0x7de938;};'use strict';var multer=require('multer');var util=require(_0x2232('0x0'));var path=require(_0x2232('0x1'));var timeout=require(_0x2232('0x2'));var express=require(_0x2232('0x3'));var router=express[_0x2232('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2232('0x5'));var interaction=require(_0x2232('0x6'));var config=require('../../config/environment');var controller=require(_0x2232('0x7'));router[_0x2232('0x8')]('/',auth[_0x2232('0x9')](),controller['index']);router['get'](_0x2232('0xa'),auth[_0x2232('0x9')](),controller[_0x2232('0xb')]);router[_0x2232('0xc')]('/',auth[_0x2232('0x9')](),controller['create']);router[_0x2232('0xd')](_0x2232('0xa'),auth[_0x2232('0x9')](),controller[_0x2232('0xe')]);router[_0x2232('0xf')](_0x2232('0xa'),auth[_0x2232('0x9')](),controller['destroy']);module[_0x2232('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 c357b14..8b7836b 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 _0xa621=['STRING','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x488d85,_0x1c5655){var _0x5dd56c=function(_0xe3d65d){while(--_0xe3d65d){_0x488d85['push'](_0x488d85['shift']());}};_0x5dd56c(++_0x1c5655);}(_0xa621,0x1ab));var _0x1a62=function(_0x59bd0e,_0xf04778){_0x59bd0e=_0x59bd0e-0x0;var _0x5a488b=_0xa621[_0x59bd0e];return _0x5a488b;};'use strict';var Sequelize=require(_0x1a62('0x0'));module[_0x1a62('0x1')]={'priority':{'type':Sequelize[_0x1a62('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x1a62('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x1a62('0x3')]},'interval':{'type':Sequelize[_0x1a62('0x3')],'defaultValue':_0x1a62('0x4')}}; \ No newline at end of file +var _0x6a9c=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x466758,_0x56a6e4){var _0x2fb977=function(_0x1d0fd9){while(--_0x1d0fd9){_0x466758['push'](_0x466758['shift']());}};_0x2fb977(++_0x56a6e4);}(_0x6a9c,0x14e));var _0xc6a9=function(_0x22d6d5,_0xdbad05){_0x22d6d5=_0x22d6d5-0x0;var _0x597051=_0x6a9c[_0x22d6d5];return _0x597051;};'use strict';var Sequelize=require(_0xc6a9('0x0'));module[_0xc6a9('0x1')]={'priority':{'type':Sequelize[_0xc6a9('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xc6a9('0x3')],'allowNull':![],'defaultValue':_0xc6a9('0x4')},'appdata':{'type':Sequelize[_0xc6a9('0x5')]()},'description':{'type':Sequelize[_0xc6a9('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xc6a9('0x6')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 4343663..51ebfc2 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 _0x18a2=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','status','end','sendStatus','stack','name','send','index','map','OpenchannelApplication','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','merge','VIRTUAL','filter','options','findAll','rows','catch','show','params','rawAttributes','includeAll','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x18a2,0x158));var _0x218a=function(_0x53ff33,_0x461b30){_0x53ff33=_0x53ff33-0x0;var _0x448098=_0x18a2[_0x53ff33];return _0x448098;};'use strict';var emlformat=require(_0x218a('0x0'));var rimraf=require(_0x218a('0x1'));var zipdir=require(_0x218a('0x2'));var jsonpatch=require(_0x218a('0x3'));var rp=require(_0x218a('0x4'));var moment=require('moment');var BPromise=require(_0x218a('0x5'));var Mustache=require('mustache');var util=require(_0x218a('0x6'));var path=require(_0x218a('0x7'));var sox=require(_0x218a('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x218a('0x9'));var _=require(_0x218a('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x218a('0xb'));var toCsv=require('to-csv');var querystring=require(_0x218a('0xc'));var Papa=require(_0x218a('0xd'));var Redis=require(_0x218a('0xe'));var authService=require(_0x218a('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x218a('0x10'));var hardwareService=require(_0x218a('0x11'));var logger=require(_0x218a('0x12'))(_0x218a('0x13'));var utils=require('../../config/utils');var config=require(_0x218a('0x14'));var licenseUtil=require(_0x218a('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b0666,_0x902de7){_0x902de7=_0x902de7||0xcc;return function(_0x26cd38){if(_0x26cd38){return _0x5b0666['sendStatus'](_0x902de7);}return _0x5b0666['status'](_0x902de7)['end']();};}function respondWithResult(_0x49a30e,_0x4ecdd6){_0x4ecdd6=_0x4ecdd6||0xc8;return function(_0x13b1c8){if(_0x13b1c8){return _0x49a30e['status'](_0x4ecdd6)[_0x218a('0x16')](_0x13b1c8);}};}function respondWithFilteredResult(_0x53ea7c,_0x1719af){return function(_0x268907){if(_0x268907){var _0x223bd1=typeof _0x1719af[_0x218a('0x17')]===_0x218a('0x18')&&typeof _0x1719af[_0x218a('0x19')]==='undefined';var _0x3f03eb=_0x268907['count'];var _0x2300a3=_0x223bd1?0x0:_0x1719af[_0x218a('0x17')];var _0x421ff2=_0x223bd1?_0x268907[_0x218a('0x1a')]:_0x1719af[_0x218a('0x17')]+_0x1719af['limit'];var _0x42b47a;if(_0x421ff2>=_0x3f03eb){_0x421ff2=_0x3f03eb;_0x42b47a=0xc8;}else{_0x42b47a=0xce;}_0x53ea7c['status'](_0x42b47a);return _0x53ea7c[_0x218a('0x1b')]('Content-Range',_0x2300a3+'-'+_0x421ff2+'/'+_0x3f03eb)['json'](_0x268907);}return null;};}function patchUpdates(_0x35bbf1){return function(_0x217e06){try{jsonpatch[_0x218a('0x1c')](_0x217e06,_0x35bbf1,!![]);}catch(_0x1a0b4e){return BPromise['reject'](_0x1a0b4e);}return _0x217e06[_0x218a('0x1d')]();};}function saveUpdates(_0x396f5c,_0xd699f0){return function(_0x2ff9b3){if(_0x2ff9b3){return _0x2ff9b3[_0x218a('0x1e')](_0x396f5c)[_0x218a('0x1f')](function(_0x633fff){return _0x633fff;});}return null;};}function removeEntity(_0x1e7587,_0xde9652){return function(_0x204d45){if(_0x204d45){return _0x204d45[_0x218a('0x20')]()['then'](function(){_0x1e7587[_0x218a('0x21')](0xcc)[_0x218a('0x22')]();});}};}function handleEntityNotFound(_0x14cc24,_0x12bed6){return function(_0x2da657){if(!_0x2da657){_0x14cc24[_0x218a('0x23')](0x194);}return _0x2da657;};}function handleError(_0x5cf3ec,_0x1389e7){_0x1389e7=_0x1389e7||0x1f4;return function(_0x36b645){logger['error'](_0x36b645[_0x218a('0x24')]);if(_0x36b645[_0x218a('0x25')]){delete _0x36b645[_0x218a('0x25')];}_0x5cf3ec[_0x218a('0x21')](_0x1389e7)[_0x218a('0x26')](_0x36b645);};}exports[_0x218a('0x27')]=function(_0x5685a0,_0x320b5e){var _0x5bf27c={},_0x7d48a3={},_0x3fa2b5={'count':0x0,'rows':[]};var _0x4ed61a=_[_0x218a('0x28')](db[_0x218a('0x29')]['rawAttributes'],function(_0x3f65b5){return{'name':_0x3f65b5['fieldName'],'type':_0x3f65b5[_0x218a('0x2a')][_0x218a('0x2b')]};});_0x7d48a3[_0x218a('0x2c')]=_['map'](_0x4ed61a,'name');_0x7d48a3[_0x218a('0x2d')]=_[_0x218a('0x2e')](_0x5685a0[_0x218a('0x2d')]);_0x7d48a3['filters']=_[_0x218a('0x2f')](_0x7d48a3[_0x218a('0x2c')],_0x7d48a3[_0x218a('0x2d')]);_0x5bf27c[_0x218a('0x30')]=_[_0x218a('0x2f')](_0x7d48a3['model'],qs[_0x218a('0x31')](_0x5685a0[_0x218a('0x2d')][_0x218a('0x31')]));_0x5bf27c['attributes']=_0x5bf27c[_0x218a('0x30')][_0x218a('0x32')]?_0x5bf27c[_0x218a('0x30')]:_0x7d48a3['model'];if(!_0x5685a0['query'][_0x218a('0x33')](_0x218a('0x34'))){_0x5bf27c[_0x218a('0x19')]=qs[_0x218a('0x19')](_0x5685a0[_0x218a('0x2d')]['limit']);_0x5bf27c[_0x218a('0x17')]=qs[_0x218a('0x17')](_0x5685a0['query'][_0x218a('0x17')]);}_0x5bf27c['order']=qs[_0x218a('0x35')](_0x5685a0[_0x218a('0x2d')]['sort']);_0x5bf27c[_0x218a('0x36')]=qs['filters'](_[_0x218a('0x37')](_0x5685a0['query'],_0x7d48a3[_0x218a('0x38')]),_0x4ed61a);if(_0x5685a0['query']['filter']){_0x5bf27c[_0x218a('0x36')]=_[_0x218a('0x39')](_0x5bf27c[_0x218a('0x36')],{'$or':_['map'](_0x4ed61a,function(_0x2a4544){if(_0x2a4544[_0x218a('0x2a')]!==_0x218a('0x3a')){var _0x38672b={};_0x38672b[_0x2a4544[_0x218a('0x25')]]={'$like':'%'+_0x5685a0[_0x218a('0x2d')][_0x218a('0x3b')]+'%'};return _0x38672b;}})});}_0x5bf27c=_['merge']({},_0x5bf27c,_0x5685a0[_0x218a('0x3c')]);var _0x3c7fd0={'where':_0x5bf27c[_0x218a('0x36')]};return db['OpenchannelApplication']['count'](_0x3c7fd0)[_0x218a('0x1f')](function(_0xb784ab){_0x3fa2b5[_0x218a('0x1a')]=_0xb784ab;if(_0x5685a0[_0x218a('0x2d')]['includeAll']){_0x5bf27c['include']=[{'all':!![]}];}return db[_0x218a('0x29')][_0x218a('0x3d')](_0x5bf27c);})[_0x218a('0x1f')](function(_0x1cf401){_0x3fa2b5[_0x218a('0x3e')]=_0x1cf401;return _0x3fa2b5;})[_0x218a('0x1f')](respondWithFilteredResult(_0x320b5e,_0x5bf27c))[_0x218a('0x3f')](handleError(_0x320b5e,null));};exports[_0x218a('0x40')]=function(_0x129e16,_0x49a483){var _0x4aa426={'raw':!![],'where':{'id':_0x129e16[_0x218a('0x41')]['id']}},_0x107b8a={};_0x107b8a[_0x218a('0x2c')]=_[_0x218a('0x2e')](db['OpenchannelApplication'][_0x218a('0x42')]);_0x107b8a[_0x218a('0x2d')]=_[_0x218a('0x2e')](_0x129e16[_0x218a('0x2d')]);_0x107b8a[_0x218a('0x38')]=_[_0x218a('0x2f')](_0x107b8a['model'],_0x107b8a[_0x218a('0x2d')]);_0x4aa426[_0x218a('0x30')]=_[_0x218a('0x2f')](_0x107b8a[_0x218a('0x2c')],qs[_0x218a('0x31')](_0x129e16[_0x218a('0x2d')][_0x218a('0x31')]));_0x4aa426['attributes']=_0x4aa426['attributes'][_0x218a('0x32')]?_0x4aa426[_0x218a('0x30')]:_0x107b8a[_0x218a('0x2c')];if(_0x129e16[_0x218a('0x2d')][_0x218a('0x43')]){_0x4aa426[_0x218a('0x44')]=[{'all':!![]}];}_0x4aa426=_['merge']({},_0x4aa426,_0x129e16[_0x218a('0x3c')]);return db[_0x218a('0x29')][_0x218a('0x45')](_0x4aa426)[_0x218a('0x1f')](handleEntityNotFound(_0x49a483,null))['then'](respondWithResult(_0x49a483,null))['catch'](handleError(_0x49a483,null));};exports[_0x218a('0x46')]=function(_0x1c25d7,_0x42c561){return db[_0x218a('0x29')][_0x218a('0x46')](_0x1c25d7['body'],{})[_0x218a('0x1f')](respondWithResult(_0x42c561,0xc9))[_0x218a('0x3f')](handleError(_0x42c561,null));};exports[_0x218a('0x1e')]=function(_0x33cc03,_0x1f7d23){if(_0x33cc03[_0x218a('0x47')]['id']){delete _0x33cc03[_0x218a('0x47')]['id'];}return db[_0x218a('0x29')][_0x218a('0x45')]({'where':{'id':_0x33cc03[_0x218a('0x41')]['id']}})['then'](handleEntityNotFound(_0x1f7d23,null))[_0x218a('0x1f')](saveUpdates(_0x33cc03[_0x218a('0x47')],null))[_0x218a('0x1f')](respondWithResult(_0x1f7d23,null))['catch'](handleError(_0x1f7d23,null));};exports[_0x218a('0x20')]=function(_0xf512ef,_0x97cde1){return db[_0x218a('0x29')][_0x218a('0x45')]({'where':{'id':_0xf512ef[_0x218a('0x41')]['id']}})['then'](handleEntityNotFound(_0x97cde1,null))[_0x218a('0x1f')](removeEntity(_0x97cde1,null))[_0x218a('0x3f')](handleError(_0x97cde1,null));}; \ No newline at end of file +var _0xa92d=['path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','reject','update','then','destroy','end','error','name','send','map','OpenchannelApplication','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','keys','include','find','create','body','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x4c56b6,_0x239082){var _0x1ee73a=function(_0x43687e){while(--_0x43687e){_0x4c56b6['push'](_0x4c56b6['shift']());}};_0x1ee73a(++_0x239082);}(_0xa92d,0xd8));var _0xda92=function(_0x17f7d8,_0x549112){_0x17f7d8=_0x17f7d8-0x0;var _0x2c5198=_0xa92d[_0x17f7d8];return _0x2c5198;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xda92('0x0'));var jsonpatch=require(_0xda92('0x1'));var rp=require(_0xda92('0x2'));var moment=require('moment');var BPromise=require(_0xda92('0x3'));var Mustache=require(_0xda92('0x4'));var util=require(_0xda92('0x5'));var path=require(_0xda92('0x6'));var sox=require('sox');var csv=require(_0xda92('0x7'));var ejs=require(_0xda92('0x8'));var fs=require('fs');var fs_extra=require(_0xda92('0x9'));var _=require(_0xda92('0xa'));var squel=require(_0xda92('0xb'));var crypto=require(_0xda92('0xc'));var jsforce=require(_0xda92('0xd'));var deskjs=require(_0xda92('0xe'));var toCsv=require(_0xda92('0x7'));var querystring=require(_0xda92('0xf'));var Papa=require(_0xda92('0x10'));var Redis=require(_0xda92('0x11'));var authService=require(_0xda92('0x12'));var qs=require(_0xda92('0x13'));var as=require(_0xda92('0x14'));var hardwareService=require(_0xda92('0x15'));var logger=require(_0xda92('0x16'))('api');var utils=require(_0xda92('0x17'));var config=require(_0xda92('0x18'));var licenseUtil=require(_0xda92('0x19'));var db=require(_0xda92('0x1a'))['db'];function respondWithStatusCode(_0x209e70,_0x10125e){_0x10125e=_0x10125e||0xcc;return function(_0x4a13c3){if(_0x4a13c3){return _0x209e70[_0xda92('0x1b')](_0x10125e);}return _0x209e70[_0xda92('0x1c')](_0x10125e)['end']();};}function respondWithResult(_0x31cbf1,_0x434036){_0x434036=_0x434036||0xc8;return function(_0x1f23f7){if(_0x1f23f7){return _0x31cbf1[_0xda92('0x1c')](_0x434036)[_0xda92('0x1d')](_0x1f23f7);}};}function respondWithFilteredResult(_0x18dfa1,_0x30ec1b){return function(_0x146660){if(_0x146660){var _0x24f16f=typeof _0x30ec1b[_0xda92('0x1e')]==='undefined'&&typeof _0x30ec1b[_0xda92('0x1f')]===_0xda92('0x20');var _0x13c533=_0x146660[_0xda92('0x21')];var _0x5ae686=_0x24f16f?0x0:_0x30ec1b[_0xda92('0x1e')];var _0x393c4b=_0x24f16f?_0x146660[_0xda92('0x21')]:_0x30ec1b[_0xda92('0x1e')]+_0x30ec1b[_0xda92('0x1f')];var _0x33c96d;if(_0x393c4b>=_0x13c533){_0x393c4b=_0x13c533;_0x33c96d=0xc8;}else{_0x33c96d=0xce;}_0x18dfa1['status'](_0x33c96d);return _0x18dfa1['set'](_0xda92('0x22'),_0x5ae686+'-'+_0x393c4b+'/'+_0x13c533)['json'](_0x146660);}return null;};}function patchUpdates(_0x4250b0){return function(_0x5c2add){try{jsonpatch['apply'](_0x5c2add,_0x4250b0,!![]);}catch(_0x4c7386){return BPromise[_0xda92('0x23')](_0x4c7386);}return _0x5c2add['save']();};}function saveUpdates(_0x50e966,_0x49b464){return function(_0x1199af){if(_0x1199af){return _0x1199af[_0xda92('0x24')](_0x50e966)[_0xda92('0x25')](function(_0x278840){return _0x278840;});}return null;};}function removeEntity(_0x2a2c9e,_0x188317){return function(_0x24ae10){if(_0x24ae10){return _0x24ae10[_0xda92('0x26')]()[_0xda92('0x25')](function(){_0x2a2c9e[_0xda92('0x1c')](0xcc)[_0xda92('0x27')]();});}};}function handleEntityNotFound(_0x3e4694,_0x39f8ed){return function(_0x412806){if(!_0x412806){_0x3e4694[_0xda92('0x1b')](0x194);}return _0x412806;};}function handleError(_0x166182,_0x4141ea){_0x4141ea=_0x4141ea||0x1f4;return function(_0x102680){logger[_0xda92('0x28')](_0x102680['stack']);if(_0x102680[_0xda92('0x29')]){delete _0x102680[_0xda92('0x29')];}_0x166182['status'](_0x4141ea)[_0xda92('0x2a')](_0x102680);};}exports['index']=function(_0x45514c,_0xae3408){var _0x13ba3a={},_0x329010={},_0xa9106b={'count':0x0,'rows':[]};var _0x2b4069=_[_0xda92('0x2b')](db[_0xda92('0x2c')]['rawAttributes'],function(_0x57a03a){return{'name':_0x57a03a['fieldName'],'type':_0x57a03a['type']['key']};});_0x329010[_0xda92('0x2d')]=_[_0xda92('0x2b')](_0x2b4069,_0xda92('0x29'));_0x329010[_0xda92('0x2e')]=_['keys'](_0x45514c['query']);_0x329010[_0xda92('0x2f')]=_[_0xda92('0x30')](_0x329010[_0xda92('0x2d')],_0x329010[_0xda92('0x2e')]);_0x13ba3a[_0xda92('0x31')]=_[_0xda92('0x30')](_0x329010[_0xda92('0x2d')],qs[_0xda92('0x32')](_0x45514c['query'][_0xda92('0x32')]));_0x13ba3a[_0xda92('0x31')]=_0x13ba3a[_0xda92('0x31')]['length']?_0x13ba3a['attributes']:_0x329010[_0xda92('0x2d')];if(!_0x45514c[_0xda92('0x2e')][_0xda92('0x33')](_0xda92('0x34'))){_0x13ba3a['limit']=qs[_0xda92('0x1f')](_0x45514c[_0xda92('0x2e')][_0xda92('0x1f')]);_0x13ba3a[_0xda92('0x1e')]=qs[_0xda92('0x1e')](_0x45514c[_0xda92('0x2e')]['offset']);}_0x13ba3a[_0xda92('0x35')]=qs[_0xda92('0x36')](_0x45514c[_0xda92('0x2e')][_0xda92('0x36')]);_0x13ba3a[_0xda92('0x37')]=qs[_0xda92('0x2f')](_[_0xda92('0x38')](_0x45514c[_0xda92('0x2e')],_0x329010[_0xda92('0x2f')]),_0x2b4069);if(_0x45514c[_0xda92('0x2e')][_0xda92('0x39')]){_0x13ba3a[_0xda92('0x37')]=_[_0xda92('0x3a')](_0x13ba3a[_0xda92('0x37')],{'$or':_['map'](_0x2b4069,function(_0x55aa29){if(_0x55aa29[_0xda92('0x3b')]!==_0xda92('0x3c')){var _0x32986f={};_0x32986f[_0x55aa29[_0xda92('0x29')]]={'$like':'%'+_0x45514c[_0xda92('0x2e')][_0xda92('0x39')]+'%'};return _0x32986f;}})});}_0x13ba3a=_[_0xda92('0x3a')]({},_0x13ba3a,_0x45514c[_0xda92('0x3d')]);var _0x840976={'where':_0x13ba3a[_0xda92('0x37')]};return db[_0xda92('0x2c')][_0xda92('0x21')](_0x840976)['then'](function(_0x34bbf5){_0xa9106b[_0xda92('0x21')]=_0x34bbf5;if(_0x45514c[_0xda92('0x2e')][_0xda92('0x3e')]){_0x13ba3a['include']=[{'all':!![]}];}return db[_0xda92('0x2c')][_0xda92('0x3f')](_0x13ba3a);})[_0xda92('0x25')](function(_0x443e00){_0xa9106b[_0xda92('0x40')]=_0x443e00;return _0xa9106b;})[_0xda92('0x25')](respondWithFilteredResult(_0xae3408,_0x13ba3a))[_0xda92('0x41')](handleError(_0xae3408,null));};exports[_0xda92('0x42')]=function(_0x860577,_0x25bc55){var _0x4bea91={'raw':!![],'where':{'id':_0x860577[_0xda92('0x43')]['id']}},_0x1f10f1={};_0x1f10f1[_0xda92('0x2d')]=_['keys'](db['OpenchannelApplication'][_0xda92('0x44')]);_0x1f10f1[_0xda92('0x2e')]=_[_0xda92('0x45')](_0x860577['query']);_0x1f10f1[_0xda92('0x2f')]=_[_0xda92('0x30')](_0x1f10f1['model'],_0x1f10f1[_0xda92('0x2e')]);_0x4bea91[_0xda92('0x31')]=_[_0xda92('0x30')](_0x1f10f1['model'],qs[_0xda92('0x32')](_0x860577[_0xda92('0x2e')]['fields']));_0x4bea91['attributes']=_0x4bea91[_0xda92('0x31')]['length']?_0x4bea91[_0xda92('0x31')]:_0x1f10f1[_0xda92('0x2d')];if(_0x860577[_0xda92('0x2e')][_0xda92('0x3e')]){_0x4bea91[_0xda92('0x46')]=[{'all':!![]}];}_0x4bea91=_[_0xda92('0x3a')]({},_0x4bea91,_0x860577[_0xda92('0x3d')]);return db[_0xda92('0x2c')][_0xda92('0x47')](_0x4bea91)[_0xda92('0x25')](handleEntityNotFound(_0x25bc55,null))[_0xda92('0x25')](respondWithResult(_0x25bc55,null))['catch'](handleError(_0x25bc55,null));};exports[_0xda92('0x48')]=function(_0x53d587,_0xeea649){return db['OpenchannelApplication'][_0xda92('0x48')](_0x53d587[_0xda92('0x49')],{})['then'](respondWithResult(_0xeea649,0xc9))[_0xda92('0x41')](handleError(_0xeea649,null));};exports[_0xda92('0x24')]=function(_0xdca2f4,_0x44ca9c){if(_0xdca2f4[_0xda92('0x49')]['id']){delete _0xdca2f4[_0xda92('0x49')]['id'];}return db[_0xda92('0x2c')][_0xda92('0x47')]({'where':{'id':_0xdca2f4[_0xda92('0x43')]['id']}})['then'](handleEntityNotFound(_0x44ca9c,null))[_0xda92('0x25')](saveUpdates(_0xdca2f4[_0xda92('0x49')],null))['then'](respondWithResult(_0x44ca9c,null))['catch'](handleError(_0x44ca9c,null));};exports[_0xda92('0x26')]=function(_0x4f0b79,_0x1bd4f5){return db[_0xda92('0x2c')][_0xda92('0x47')]({'where':{'id':_0x4f0b79[_0xda92('0x43')]['id']}})[_0xda92('0x25')](handleEntityNotFound(_0x1bd4f5,null))[_0xda92('0x25')](removeEntity(_0x1bd4f5,null))['catch'](handleError(_0x1bd4f5,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 8e26603..1a9194e 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 _0x2755=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelApplication.attributes','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x2829ee,_0x3c88ef){var _0x22a8ef=function(_0x3a0e60){while(--_0x3a0e60){_0x2829ee['push'](_0x2829ee['shift']());}};_0x22a8ef(++_0x3c88ef);}(_0x2755,0xb5));var _0x5275=function(_0x2260df,_0x219c5c){_0x2260df=_0x2260df-0x0;var _0x8f9320=_0x2755[_0x2260df];return _0x8f9320;};'use strict';var _=require('lodash');var util=require(_0x5275('0x0'));var logger=require(_0x5275('0x1'))(_0x5275('0x2'));var moment=require(_0x5275('0x3'));var BPromise=require(_0x5275('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5275('0x5'));var rimraf=require(_0x5275('0x6'));var config=require(_0x5275('0x7'));var attributes=require(_0x5275('0x8'));module['exports']=function(_0x27010a,_0x197fb9){return _0x27010a[_0x5275('0x9')](_0x5275('0xa'),attributes,{'tableName':_0x5275('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5275('0xc'),'collate':_0x5275('0xd')});}; \ No newline at end of file +var _0x3da4=['utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','../../config/environment','./openchannelApplication.attributes','exports','define','openchannel_applications'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3da4,0xda));var _0x43da=function(_0x4b969d,_0x5b6e52){_0x4b969d=_0x4b969d-0x0;var _0x10354d=_0x3da4[_0x4b969d];return _0x10354d;};'use strict';var _=require('lodash');var util=require(_0x43da('0x0'));var logger=require('../../config/logger')(_0x43da('0x1'));var moment=require(_0x43da('0x2'));var BPromise=require(_0x43da('0x3'));var rp=require(_0x43da('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x43da('0x5'));var attributes=require(_0x43da('0x6'));module[_0x43da('0x7')]=function(_0x45e1a8,_0x106802){return _0x45e1a8[_0x43da('0x8')]('OpenchannelApplication',attributes,{'tableName':_0x43da('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x43da('0xa'),'collate':_0x43da('0xb')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 60a2da5..3ecb45e 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 _0xcfbd=['message','request\x20sent','catch','UpdateOpenchannelApplication','body','options','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x4a046e,_0xfe96d2){var _0x17b271=function(_0x3d9130){while(--_0x3d9130){_0x4a046e['push'](_0x4a046e['shift']());}};_0x17b271(++_0xfe96d2);}(_0xcfbd,0x13d));var _0xdcfb=function(_0xbfc531,_0x4bc1a6){_0xbfc531=_0xbfc531-0x0;var _0x44fbed=_0xcfbd[_0xbfc531];return _0x44fbed;};'use strict';var _=require(_0xdcfb('0x0'));var util=require(_0xdcfb('0x1'));var moment=require('moment');var BPromise=require(_0xdcfb('0x2'));var rs=require(_0xdcfb('0x3'));var fs=require('fs');var Redis=require(_0xdcfb('0x4'));var db=require(_0xdcfb('0x5'))['db'];var utils=require(_0xdcfb('0x6'));var logger=require('../../config/logger')(_0xdcfb('0x7'));var config=require(_0xdcfb('0x8'));var jayson=require(_0xdcfb('0x9'));var client=jayson['client'][_0xdcfb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x47dff0,_0x4da701,_0x2ca141){return new BPromise(function(_0x609d9,_0x1948ae){return client[_0xdcfb('0xb')](_0x47dff0,_0x2ca141)[_0xdcfb('0xc')](function(_0x269b77){logger[_0xdcfb('0xd')](_0xdcfb('0xe'),_0x4da701,'request\x20sent');logger[_0xdcfb('0xf')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x4da701,'request\x20sent',JSON[_0xdcfb('0x10')](_0x269b77));if(_0x269b77['error']){if(_0x269b77[_0xdcfb('0x11')][_0xdcfb('0x12')]===0x1f4){logger['error'](_0xdcfb('0xe'),_0x4da701,_0x269b77[_0xdcfb('0x11')]['message']);return _0x1948ae(_0x269b77[_0xdcfb('0x11')][_0xdcfb('0x13')]);}logger[_0xdcfb('0x11')]('OpenchannelApplication,\x20%s,\x20%s',_0x4da701,_0x269b77['error'][_0xdcfb('0x13')]);return _0x609d9(_0x269b77[_0xdcfb('0x11')][_0xdcfb('0x13')]);}else{logger['info'](_0xdcfb('0xe'),_0x4da701,_0xdcfb('0x14'));_0x609d9(_0x269b77['result'][_0xdcfb('0x13')]);}})[_0xdcfb('0x15')](function(_0xd214b6){logger[_0xdcfb('0x11')](_0xdcfb('0xe'),_0x4da701,_0xd214b6);_0x1948ae(_0xd214b6);});});}exports[_0xdcfb('0x16')]=function(_0x3828b0){var _0x4cc1f9=this;return new Promise(function(_0x218446,_0x3d0afc){return db['OpenchannelApplication']['update'](_0x3828b0[_0xdcfb('0x17')],{'raw':_0x3828b0[_0xdcfb('0x18')]?_0x3828b0[_0xdcfb('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3828b0[_0xdcfb('0x18')]?_0x3828b0[_0xdcfb('0x18')][_0xdcfb('0x19')]||null:null,'attributes':_0x3828b0['options']?_0x3828b0[_0xdcfb('0x18')][_0xdcfb('0x1a')]||null:null,'limit':_0x3828b0['options']?_0x3828b0[_0xdcfb('0x18')][_0xdcfb('0x1b')]||null:null})[_0xdcfb('0xc')](function(_0x24dcd9){logger['info'](_0xdcfb('0x16'),_0x3828b0);logger['debug'](_0xdcfb('0x16'),_0x3828b0,JSON[_0xdcfb('0x10')](_0x24dcd9));_0x218446(_0x24dcd9);})[_0xdcfb('0x15')](function(_0x190bdd){logger[_0xdcfb('0x11')]('UpdateOpenchannelApplication',_0x190bdd[_0xdcfb('0x13')],_0x3828b0);_0x3d0afc(_0x4cc1f9['error'](0x1f4,_0x190bdd[_0xdcfb('0x13')]));});});}; \ No newline at end of file +var _0xc28f=['debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelApplication,\x20%s,\x20%s','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','limit','then','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent'];(function(_0x855e2a,_0x52e244){var _0x4be424=function(_0xaef50d){while(--_0xaef50d){_0x855e2a['push'](_0x855e2a['shift']());}};_0x4be424(++_0x52e244);}(_0xc28f,0x72));var _0xfc28=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xc28f[_0x5c351c];return _0x26f3b3;};'use strict';var _=require(_0xfc28('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xfc28('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfc28('0x2'));var db=require(_0xfc28('0x3'))['db'];var utils=require(_0xfc28('0x4'));var logger=require(_0xfc28('0x5'))(_0xfc28('0x6'));var config=require(_0xfc28('0x7'));var jayson=require(_0xfc28('0x8'));var client=jayson[_0xfc28('0x9')][_0xfc28('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a3a86,_0x14dd9e,_0x505af6){return new BPromise(function(_0x143df3,_0x4382ed){return client[_0xfc28('0xb')](_0x4a3a86,_0x505af6)['then'](function(_0x99b0f3){logger[_0xfc28('0xc')]('OpenchannelApplication,\x20%s,\x20%s',_0x14dd9e,_0xfc28('0xd'));logger[_0xfc28('0xe')](_0xfc28('0xf'),_0x14dd9e,_0xfc28('0xd'),JSON[_0xfc28('0x10')](_0x99b0f3));if(_0x99b0f3['error']){if(_0x99b0f3[_0xfc28('0x11')][_0xfc28('0x12')]===0x1f4){logger[_0xfc28('0x11')](_0xfc28('0x13'),_0x14dd9e,_0x99b0f3[_0xfc28('0x11')][_0xfc28('0x14')]);return _0x4382ed(_0x99b0f3['error'][_0xfc28('0x14')]);}logger[_0xfc28('0x11')](_0xfc28('0x13'),_0x14dd9e,_0x99b0f3[_0xfc28('0x11')][_0xfc28('0x14')]);return _0x143df3(_0x99b0f3[_0xfc28('0x11')][_0xfc28('0x14')]);}else{logger[_0xfc28('0xc')](_0xfc28('0x13'),_0x14dd9e,_0xfc28('0xd'));_0x143df3(_0x99b0f3[_0xfc28('0x15')]['message']);}})[_0xfc28('0x16')](function(_0xe3758){logger['error'](_0xfc28('0x13'),_0x14dd9e,_0xe3758);_0x4382ed(_0xe3758);});});}exports[_0xfc28('0x17')]=function(_0x2ae2db){var _0x5e0445=this;return new Promise(function(_0x263326,_0x265d9d){return db[_0xfc28('0x18')][_0xfc28('0x19')](_0x2ae2db[_0xfc28('0x1a')],{'raw':_0x2ae2db[_0xfc28('0x1b')]?_0x2ae2db[_0xfc28('0x1b')][_0xfc28('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ae2db[_0xfc28('0x1b')]?_0x2ae2db[_0xfc28('0x1b')][_0xfc28('0x1d')]||null:null,'attributes':_0x2ae2db[_0xfc28('0x1b')]?_0x2ae2db[_0xfc28('0x1b')]['attributes']||null:null,'limit':_0x2ae2db[_0xfc28('0x1b')]?_0x2ae2db[_0xfc28('0x1b')][_0xfc28('0x1e')]||null:null})[_0xfc28('0x1f')](function(_0x36098b){logger[_0xfc28('0xc')](_0xfc28('0x17'),_0x2ae2db);logger[_0xfc28('0xe')]('UpdateOpenchannelApplication',_0x2ae2db,JSON['stringify'](_0x36098b));_0x263326(_0x36098b);})[_0xfc28('0x16')](function(_0x13fc5f){logger[_0xfc28('0x11')]('UpdateOpenchannelApplication',_0x13fc5f['message'],_0x2ae2db);_0x265d9d(_0x5e0445[_0xfc28('0x11')](0x1f4,_0x13fc5f[_0xfc28('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 8874892..6bd412c 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 _0x3100=['/:id','/:id/messages','getMessages','/:id/download','post','create','addMessage','tracked','put','openchannel','update','openchannelinteraction:destroy','destroy','delete','/:id/tags','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0x3100,0x1b4));var _0x0310=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3100[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x0310('0x0'));var path=require(_0x0310('0x1'));var timeout=require(_0x0310('0x2'));var express=require('express');var router=express[_0x0310('0x3')]();var fs_extra=require(_0x0310('0x4'));var auth=require(_0x0310('0x5'));var interaction=require(_0x0310('0x6'));var config=require(_0x0310('0x7'));var controller=require('./openchannelInteraction.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x0310('0x8')]);router[_0x0310('0x9')](_0x0310('0xa'),auth[_0x0310('0xb')](),controller['describe']);router[_0x0310('0x9')](_0x0310('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x0310('0x9')](_0x0310('0xd'),auth[_0x0310('0xb')](),controller[_0x0310('0xe')]);router[_0x0310('0x9')](_0x0310('0xf'),auth[_0x0310('0xb')](),controller['download']);router[_0x0310('0x10')]('/',auth[_0x0310('0xb')](),controller[_0x0310('0x11')]);router['post']('/:id/messages',auth['isAuthenticated'](),controller[_0x0310('0x12')]);router[_0x0310('0x10')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x0310('0x13')]('openchannel','openchannelinteraction:addtags'),controller['addTags']);router[_0x0310('0x14')](_0x0310('0xc'),auth[_0x0310('0xb')](),interaction[_0x0310('0x13')](_0x0310('0x15'),'openchannelinteraction:update'),controller[_0x0310('0x16')]);router['delete'](_0x0310('0xc'),auth[_0x0310('0xb')](),interaction['tracked'](_0x0310('0x15'),_0x0310('0x17')),controller[_0x0310('0x18')]);router[_0x0310('0x19')](_0x0310('0x1a'),auth['isAuthenticated'](),controller['removeTags']);module[_0x0310('0x1b')]=router; \ No newline at end of file +var _0x341b=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','isAuthenticated','get','describe','/:id','show','getMessages','/:id/download','download','post','/:id/messages','addMessage','tracked','openchannel','addTags','put','openchannelinteraction:update','delete','openchannelinteraction:destroy','destroy','/:id/tags','removeTags','exports','util','path'];(function(_0x580c79,_0x5dae47){var _0x1f6577=function(_0x2f9395){while(--_0x2f9395){_0x580c79['push'](_0x580c79['shift']());}};_0x1f6577(++_0x5dae47);}(_0x341b,0x115));var _0xb341=function(_0x49c23f,_0x3ed202){_0x49c23f=_0x49c23f-0x0;var _0x34b65d=_0x341b[_0x49c23f];return _0x34b65d;};'use strict';var multer=require('multer');var util=require(_0xb341('0x0'));var path=require(_0xb341('0x1'));var timeout=require('connect-timeout');var express=require(_0xb341('0x2'));var router=express[_0xb341('0x3')]();var fs_extra=require(_0xb341('0x4'));var auth=require(_0xb341('0x5'));var interaction=require(_0xb341('0x6'));var config=require(_0xb341('0x7'));var controller=require(_0xb341('0x8'));router['get']('/',auth[_0xb341('0x9')](),controller['index']);router[_0xb341('0xa')]('/describe',auth[_0xb341('0x9')](),controller[_0xb341('0xb')]);router['get'](_0xb341('0xc'),auth[_0xb341('0x9')](),controller[_0xb341('0xd')]);router[_0xb341('0xa')]('/:id/messages',auth[_0xb341('0x9')](),controller[_0xb341('0xe')]);router[_0xb341('0xa')](_0xb341('0xf'),auth[_0xb341('0x9')](),controller[_0xb341('0x10')]);router[_0xb341('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb341('0x11')](_0xb341('0x12'),auth[_0xb341('0x9')](),controller[_0xb341('0x13')]);router[_0xb341('0x11')]('/:id/tags',auth[_0xb341('0x9')](),interaction[_0xb341('0x14')](_0xb341('0x15'),'openchannelinteraction:addtags'),controller[_0xb341('0x16')]);router[_0xb341('0x17')](_0xb341('0xc'),auth['isAuthenticated'](),interaction[_0xb341('0x14')](_0xb341('0x15'),_0xb341('0x18')),controller['update']);router[_0xb341('0x19')](_0xb341('0xc'),auth[_0xb341('0x9')](),interaction[_0xb341('0x14')](_0xb341('0x15'),_0xb341('0x1a')),controller[_0xb341('0x1b')]);router['delete'](_0xb341('0x1c'),auth['isAuthenticated'](),controller[_0xb341('0x1d')]);module[_0xb341('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 32691a2..e9f1f45 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 _0x5900=['exports','BOOLEAN','STRING','DATE','ENUM'];(function(_0x5c4f6b,_0x2cdfce){var _0x104c4e=function(_0x31171b){while(--_0x31171b){_0x5c4f6b['push'](_0x5c4f6b['shift']());}};_0x104c4e(++_0x2cdfce);}(_0x5900,0xd2));var _0x0590=function(_0xf845cc,_0x7bce78){_0xf845cc=_0xf845cc-0x0;var _0x24da94=_0x5900[_0xf845cc];return _0x24da94;};'use strict';var Sequelize=require('sequelize');module[_0x0590('0x0')]={'closed':{'type':Sequelize[_0x0590('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x0590('0x2')]},'secondDisposition':{'type':Sequelize[_0x0590('0x2')]},'thirdDisposition':{'type':Sequelize[_0x0590('0x2')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x0590('0x3')]},'threadId':{'type':Sequelize[_0x0590('0x2')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x0590('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x0590('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x0590('0x2')]},'autoreplyExecuted':{'type':Sequelize[_0x0590('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x572b=['sequelize','exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x2bdaf8,_0x22a0b5){var _0x4ab94c=function(_0x1c964c){while(--_0x1c964c){_0x2bdaf8['push'](_0x2bdaf8['shift']());}};_0x4ab94c(++_0x22a0b5);}(_0x572b,0x1b2));var _0xb572=function(_0x685346,_0x3ef2e5){_0x685346=_0x685346-0x0;var _0x52e15b=_0x572b[_0x685346];return _0x52e15b;};'use strict';var Sequelize=require(_0xb572('0x0'));module[_0xb572('0x1')]={'closed':{'type':Sequelize[_0xb572('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb572('0x3')]},'disposition':{'type':Sequelize[_0xb572('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xb572('0x4')]},'note':{'type':Sequelize[_0xb572('0x4')]},'read1stAt':{'type':Sequelize[_0xb572('0x3')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0xb572('0x4')]},'lastMsgAt':{'type':Sequelize[_0xb572('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xb572('0x5')]('in',_0xb572('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xb572('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0xb572('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index dedb77b..0ecea64 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 _0x4fa2=['MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','union','UserId','keys','some','isEmpty','OpenchannelAccountId','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','Contact.lastName','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','OpenchannelInteractionId','all','show','params','fields','includeAll','include','options','create','body','describe','addMessage','ids','omit','getMessages','findOne','OpenchannelMessage','format','YYYY-MM-DD\x20HH:mm:ss','rows','findAll','color','openchannelInteractionTags:save','removeTags','download','unix','root','server','files','tmp','attachments','transcript-%d-%s.zip','User','CmContact','firstName','lastName','Attachment','createdAt','secret','OpenchannelAccount','Account','get','mkdirSync','Openchannel','Owner','N.A.','closed','threadId','Public','join','existsSync','createReadStream','basename','direction','out','renderFile','views','downloadInteraction.ejs','createPdfFromHTML','log','err','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','end','json','undefined','limit','offset','count','status','set','Content-Range','reject','save','update','then','destroy','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','index','OpenchannelInteraction','rawAttributes','fieldName','type','key','model','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','select','field','from','tools_tags','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','users','u.id\x20=\x20ui.UserId','openchannel_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','conditions','find','unreadMessages','value','having','`\x20=\x200','Contact','operator','$substring'];(function(_0x19efc8,_0xa8b500){var _0x1926ea=function(_0x466bbc){while(--_0x466bbc){_0x19efc8['push'](_0x19efc8['shift']());}};_0x1926ea(++_0xa8b500);}(_0x4fa2,0x16e));var _0x24fa=function(_0xfdec06,_0x9fa2f4){_0xfdec06=_0xfdec06-0x0;var _0x58a539=_0x4fa2[_0xfdec06];return _0x58a539;};'use strict';var emlformat=require(_0x24fa('0x0'));var rimraf=require(_0x24fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x24fa('0x2'));var rp=require(_0x24fa('0x3'));var moment=require(_0x24fa('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x24fa('0x5'));var util=require(_0x24fa('0x6'));var path=require(_0x24fa('0x7'));var sox=require(_0x24fa('0x8'));var csv=require('to-csv');var ejs=require(_0x24fa('0x9'));var fs=require('fs');var fs_extra=require(_0x24fa('0xa'));var _=require(_0x24fa('0xb'));var squel=require(_0x24fa('0xc'));var crypto=require(_0x24fa('0xd'));var jsforce=require(_0x24fa('0xe'));var deskjs=require(_0x24fa('0xf'));var toCsv=require(_0x24fa('0x10'));var querystring=require(_0x24fa('0x11'));var Papa=require(_0x24fa('0x12'));var Redis=require(_0x24fa('0x13'));var authService=require(_0x24fa('0x14'));var qs=require(_0x24fa('0x15'));var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require(_0x24fa('0x16'))(_0x24fa('0x17'));var utils=require(_0x24fa('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x24fa('0x19'));var db=require('../../mysqldb')['db'];config[_0x24fa('0x1a')]=_['defaults'](config['redis'],{'host':_0x24fa('0x1b'),'port':0x18eb});var socket=require(_0x24fa('0x1c'))(new Redis(config[_0x24fa('0x1a')]));require(_0x24fa('0x1d'))[_0x24fa('0x1e')](socket);function respondWithStatusCode(_0x1d905f,_0x12c969){_0x12c969=_0x12c969||0xcc;return function(_0x4000fa){if(_0x4000fa){return _0x1d905f[_0x24fa('0x1f')](_0x12c969);}return _0x1d905f['status'](_0x12c969)[_0x24fa('0x20')]();};}function respondWithResult(_0x31bcd1,_0x5be4d4){_0x5be4d4=_0x5be4d4||0xc8;return function(_0x124dbd){if(_0x124dbd){return _0x31bcd1['status'](_0x5be4d4)[_0x24fa('0x21')](_0x124dbd);}};}function respondWithFilteredResult(_0x4f8f57,_0xde5153){return function(_0xdb9cbb){if(_0xdb9cbb){var _0x35f740=typeof _0xde5153['offset']===_0x24fa('0x22')&&typeof _0xde5153[_0x24fa('0x23')]===_0x24fa('0x22');var _0x2a7b05=_0xdb9cbb['count'];var _0x488a91=_0x35f740?0x0:_0xde5153[_0x24fa('0x24')];var _0x1dfeb2=_0x35f740?_0xdb9cbb[_0x24fa('0x25')]:_0xde5153[_0x24fa('0x24')]+_0xde5153[_0x24fa('0x23')];var _0xe7caff;if(_0x1dfeb2>=_0x2a7b05){_0x1dfeb2=_0x2a7b05;_0xe7caff=0xc8;}else{_0xe7caff=0xce;}_0x4f8f57[_0x24fa('0x26')](_0xe7caff);return _0x4f8f57[_0x24fa('0x27')](_0x24fa('0x28'),_0x488a91+'-'+_0x1dfeb2+'/'+_0x2a7b05)[_0x24fa('0x21')](_0xdb9cbb);}return null;};}function patchUpdates(_0x4ab738){return function(_0x1901d6){try{jsonpatch['apply'](_0x1901d6,_0x4ab738,!![]);}catch(_0x36ba71){return BPromise[_0x24fa('0x29')](_0x36ba71);}return _0x1901d6[_0x24fa('0x2a')]();};}function saveUpdates(_0x87380,_0x459515){return function(_0x25b09a){if(_0x25b09a){return _0x25b09a[_0x24fa('0x2b')](_0x87380)[_0x24fa('0x2c')](function(_0xab5e0f){return _0xab5e0f;});}return null;};}function removeEntity(_0x21960c,_0x287f72){return function(_0x39454e){if(_0x39454e){return _0x39454e[_0x24fa('0x2d')]()['then'](function(){_0x21960c[_0x24fa('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ee27d,_0xa16ec4){return function(_0x45ead6){if(!_0x45ead6){_0x2ee27d['sendStatus'](0x194);}return _0x45ead6;};}function handleError(_0x5b4a4b,_0x2aa41a){_0x2aa41a=_0x2aa41a||0x1f4;return function(_0x1dc49a){logger['error'](_0x1dc49a[_0x24fa('0x2e')]);if(_0x1dc49a['name']){delete _0x1dc49a[_0x24fa('0x2f')];}_0x5b4a4b[_0x24fa('0x26')](_0x2aa41a)[_0x24fa('0x30')](_0x1dc49a);};}function getInteractionUsers(_0x3dec07,_0x10e90b){return new BPromise(function(_0x112366,_0x1a8942){try{if(_0x10e90b[_0x3dec07['id']]){_0x3dec07[_0x24fa('0x31')]=_[_0x24fa('0x32')](_0x10e90b[_0x3dec07['id']],function(_0x2a0008){return{'id':_0x2a0008['id'],'fullname':_0x2a0008[_0x24fa('0x33')]};});}}catch(_0x33c1b6){_0x1a8942(_0x33c1b6);}_0x112366(_0x3dec07);});}function getInteractionTags(_0x203b24,_0x571d5f){return new BPromise(function(_0x5b46e2,_0x70aa5d){try{if(_0x203b24[_0x24fa('0x34')]){_0x203b24[_0x24fa('0x35')]=[];_0x203b24['TagIds'][_0x24fa('0x36')](',')[_0x24fa('0x37')](function(_0x2a0226){_0x203b24[_0x24fa('0x35')][_0x24fa('0x38')](_0x571d5f[_0x2a0226]);});}delete _0x203b24['TagIds'];}catch(_0x10da71){_0x70aa5d(_0x10da71);}_0x5b46e2(_0x203b24);});}function updateOpenchannelInteraction(_0x4d6d77,_0x3e30bd,_0x1a2c64){return new BPromise(function(_0x2eb3ae,_0x53ef20){return getInteractionUsers(_0x4d6d77,_0x1a2c64)[_0x24fa('0x2c')](function(_0x14352a){return getInteractionTags(_0x14352a,_0x3e30bd);})[_0x24fa('0x2c')](function(_0x22ee6f){_0x2eb3ae(_0x22ee6f);})[_0x24fa('0x39')](function(_0x1f82b1){_0x53ef20(_0x1f82b1);});});}exports[_0x24fa('0x3a')]=function(_0x396666,_0x31da64){var _0x745782={},_0x30d8f5={},_0x46e699={'count':0x0,'rows':[]};var _0x116dca=_[_0x24fa('0x32')](db[_0x24fa('0x3b')][_0x24fa('0x3c')],function(_0x3e5c47){return{'name':_0x3e5c47[_0x24fa('0x3d')],'type':_0x3e5c47[_0x24fa('0x3e')][_0x24fa('0x3f')]};});_0x30d8f5[_0x24fa('0x40')]=_[_0x24fa('0x32')](_0x116dca,_0x24fa('0x2f'));_0x30d8f5[_0x24fa('0x41')]=_['keys'](_0x396666[_0x24fa('0x41')]);_0x30d8f5['filters']=_[_0x24fa('0x42')](_0x30d8f5[_0x24fa('0x40')],_0x30d8f5[_0x24fa('0x41')]);_0x745782[_0x24fa('0x43')]=_[_0x24fa('0x42')](_0x30d8f5[_0x24fa('0x40')],qs['fields'](_0x396666[_0x24fa('0x41')]['fields']));_0x745782[_0x24fa('0x43')]=_0x745782[_0x24fa('0x43')][_0x24fa('0x44')]?_0x745782[_0x24fa('0x43')]:_0x30d8f5[_0x24fa('0x40')];if(!_0x396666['query'][_0x24fa('0x45')](_0x24fa('0x46'))){_0x745782[_0x24fa('0x23')]=qs[_0x24fa('0x23')](_0x396666['query'][_0x24fa('0x23')]);_0x745782[_0x24fa('0x24')]=qs['offset'](_0x396666[_0x24fa('0x41')]['offset']);}_0x745782[_0x24fa('0x47')]=qs[_0x24fa('0x48')](_0x396666[_0x24fa('0x41')]['sort']);_0x745782[_0x24fa('0x49')]=qs['filters'](_[_0x24fa('0x4a')](_0x396666[_0x24fa('0x41')],_0x30d8f5[_0x24fa('0x4b')]),_0x116dca);var _0x38ea47=[];var _0x3fde82=squel[_0x24fa('0x4c')]()[_0x24fa('0x4d')]('id')[_0x24fa('0x4d')](_0x24fa('0x2f'))[_0x24fa('0x4d')]('color')[_0x24fa('0x4e')](_0x24fa('0x4f'));var _0x1db351=squel[_0x24fa('0x4c')]()[_0x24fa('0x4d')]('u.id')['field'](_0x24fa('0x50'))['field'](_0x24fa('0x51'))['from'](_0x24fa('0x52'),'ui')['left_join'](_0x24fa('0x53'),'u',_0x24fa('0x54'));var _0x4844c1=squel['select']()[_0x24fa('0x4e')](_0x24fa('0x55'),'i')[_0x24fa('0x56')](_0x24fa('0x57'),'c',_0x24fa('0x58'))['left_join'](_0x24fa('0x53'),'o',_0x24fa('0x59'))['left_join'](_0x24fa('0x5a'),'a',_0x24fa('0x5b'))[_0x24fa('0x56')](_0x24fa('0x5c'),'me',_0x24fa('0x5d'))['left_join'](_0x24fa('0x5e'),'it',_0x24fa('0x5f'))[_0x24fa('0x56')](_0x24fa('0x4f'),'t',_0x24fa('0x60'));var _0x153723=squel[_0x24fa('0x61')]();var _0x31ba37=[];var _0x2ac110=squel[_0x24fa('0x61')]();var _0x144393;if(_0x396666[_0x24fa('0x41')][_0x24fa('0x62')]){_0x144393=as['parseSearch'](_0x396666[_0x24fa('0x41')]['search']);var _0x5a8150=_0x144393['sqlOperator'];for(var _0x459e16=0x0;_0x459e16<_0x144393[_0x24fa('0x63')]['length'];_0x459e16++){var _0x180648=_0x144393[_0x24fa('0x63')][_0x459e16];var _0x37d0cd='i';var _0x2977bb=_[_0x24fa('0x64')](_0x116dca,['name',_0x180648[_0x24fa('0x4d')]]);if(!_0x2977bb){switch(_0x180648[_0x24fa('0x4d')]){case _0x24fa('0x65'):if(_0x180648[_0x24fa('0x66')]==0x1){_0x4844c1[_0x24fa('0x67')]('`'+_0x180648[_0x24fa('0x4d')]+_0x24fa('0x68'));}else{_0x4844c1[_0x24fa('0x67')]('`'+_0x180648[_0x24fa('0x4d')]+'`\x20>\x200');}break;case _0x24fa('0x69'):if(_0x180648[_0x24fa('0x6a')]===_0x24fa('0x6b')){if(_0x180648[_0x24fa('0x66')][_0x24fa('0x36')]('\x20')[_0x24fa('0x44')]>0x1){_0x153723[_0x5a8150](_0x24fa('0x6c'),qs[_0x24fa('0x6d')](_0x180648[_0x24fa('0x66')]),null);}else{var _0x1985c1='%'+_0x180648['value']+'%';_0x153723[_0x5a8150](_0x24fa('0x6e'),_0x1985c1,_0x1985c1,_0x1985c1);}}else{_0x2977bb=_[_0x24fa('0x64')](_0x116dca,[_0x24fa('0x2f'),_0x24fa('0x6f')]);_0x180648[_0x24fa('0x4d')]=_0x24fa('0x6f');_0x2c5d4e=as[_0x24fa('0x70')](_0x37d0cd,_0x2977bb[_0x24fa('0x3e')],_0x180648);_0x153723[_0x5a8150](_0x2c5d4e[_0x24fa('0x71')],_0x2c5d4e['value'][_0x24fa('0x72')],_0x2c5d4e[_0x24fa('0x66')]['end']);}break;case _0x24fa('0x73'):var _0x23a220=_0x180648[_0x24fa('0x66')]['split'](',')[_0x24fa('0x32')](function(_0x196e1c){return Number(_0x196e1c);});_0x23a220[_0x24fa('0x37')](function(_0x2b2a81){_0x2ac110['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2b2a81+',%');});_0x31ba37=_[_0x24fa('0x74')](_0x31ba37,_0x23a220);break;case'User':if(_0x180648[_0x24fa('0x6a')]===_0x24fa('0x6b')){_0x153723[_0x5a8150]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x180648[_0x24fa('0x66')]+'%',null);}else{_0x2977bb=_[_0x24fa('0x64')](_0x116dca,[_0x24fa('0x2f'),_0x24fa('0x75')]);_0x180648[_0x24fa('0x4d')]=_0x24fa('0x75');_0x2c5d4e=as['buildExpression'](_0x37d0cd,_0x2977bb['type'],_0x180648);_0x153723[_0x5a8150](_0x2c5d4e[_0x24fa('0x71')],_0x2c5d4e[_0x24fa('0x66')][_0x24fa('0x72')],_0x2c5d4e[_0x24fa('0x66')][_0x24fa('0x20')]);}break;case'body':_0x2c5d4e=as[_0x24fa('0x70')]('me',null,_0x180648);_0x153723[_0x5a8150](_0x2c5d4e[_0x24fa('0x71')],_0x2c5d4e[_0x24fa('0x66')][_0x24fa('0x72')],_0x2c5d4e[_0x24fa('0x66')]['end']);break;}}else{var _0x2c5d4e=as[_0x24fa('0x70')](_0x37d0cd,_0x2977bb['type'],_0x180648);_0x153723[_0x5a8150](_0x2c5d4e['text'],_0x2c5d4e[_0x24fa('0x66')][_0x24fa('0x72')],_0x2c5d4e[_0x24fa('0x66')][_0x24fa('0x20')]);}}}else{var _0x3f2050=_(_0x396666[_0x24fa('0x41')])[_0x24fa('0x76')]()['map'](function(_0x18d65c){return _[_0x24fa('0x77')](_0x116dca,[_0x24fa('0x2f'),_0x18d65c])?_0x18d65c:undefined;})['compact']()[_0x24fa('0x66')]();if(!_[_0x24fa('0x78')](_0x3f2050)){_0x3f2050[_0x24fa('0x37')](function(_0x184700){if(_0x184700===_0x24fa('0x79')){_0x4844c1[_0x24fa('0x49')]('i.OpenchannelAccountId\x20IN\x20?',[][_0x24fa('0x7a')](_0x396666[_0x24fa('0x41')][_0x184700]));}else if(_0x184700==='createdAt'){var _0x496c84=JSON[_0x24fa('0x7b')](_0x396666[_0x24fa('0x41')][_0x184700])[_0x24fa('0x7c')];var _0x31d5f1=JSON[_0x24fa('0x7b')](_0x396666[_0x24fa('0x41')][_0x184700])[_0x24fa('0x7d')];_0x4844c1['where'](_0x24fa('0x7e'),_0x496c84,_0x31d5f1);}else{if(_0x396666[_0x24fa('0x41')][_0x184700]===_0x24fa('0x7f')){_0x4844c1['where']('i.'+_0x184700+'\x20IS\x20NULL');}else{_0x4844c1['where']('i.'+_0x184700+_0x24fa('0x80'),_0x396666[_0x24fa('0x41')][_0x184700]);}}});}if(_0x396666['query']['read']){if(_0x396666['query'][_0x24fa('0x81')]==0x1){_0x4844c1[_0x24fa('0x67')](_0x24fa('0x82'));}else{_0x4844c1[_0x24fa('0x67')](_0x24fa('0x83'));}}if(_0x396666['query'][_0x24fa('0x84')]){_0x31ba37=_[_0x24fa('0x85')](_0x396666[_0x24fa('0x41')][_0x24fa('0x84')])?_0x396666[_0x24fa('0x41')][_0x24fa('0x84')]:new Array(_0x396666[_0x24fa('0x41')][_0x24fa('0x84')]);_0x31ba37[_0x24fa('0x37')](function(_0x538f00){_0x2ac110['or'](_0x24fa('0x86'),'%,'+_0x538f00+',%');});}if(_0x396666[_0x24fa('0x41')]['filter']){var _0xa8e237=_0x396666[_0x24fa('0x41')][_0x24fa('0x87')][_0x24fa('0x88')]('\x5c','\x5c\x5c')[_0x24fa('0x88')](/'/g,'\x27\x27');if(qs['isNumeric'](_0xa8e237)){_0x153723['or']('i.id\x20LIKE\x20?',_0xa8e237+'%');}else{_0x153723['or'](_0x24fa('0x89'),qs[_0x24fa('0x6d')](_0xa8e237))['or'](_0x24fa('0x8a'),_0xa8e237+'%')['or'](_0x24fa('0x8b'),_0xa8e237+'%');}}}_0x4844c1[_0x24fa('0x49')](_0x153723);_0x4844c1[_0x24fa('0x8c')](_0x24fa('0x8d'));var _0x1d7620={'type':db['Sequelize'][_0x24fa('0x8e')][_0x24fa('0x8f')],'raw':!![]};var _0x36f990=_0x4844c1['clone']();_0x36f990[_0x24fa('0x4d')](_0x24fa('0x8d'));_0x36f990['field'](_0x24fa('0x90'),_0x24fa('0x65'));if(_0x745782[_0x24fa('0x47')]){_0x745782[_0x24fa('0x47')]['forEach'](function(_0x358ff1){var _0x1ceb1a=_0x358ff1[0x0]===_0x24fa('0x91')?_0x358ff1[0x0]:'i.'+_0x358ff1[0x0];_0x4844c1['order'](_0x1ceb1a,_0x358ff1[0x1]==='DESC'?![]:!![]);});}if(!_[_0x24fa('0x78')](_0x31ba37)){_0x4844c1['having'](_0x2ac110);_0x36f990['where'](_0x24fa('0x92'),_0x31ba37);}BPromise[_0x24fa('0x93')]()[_0x24fa('0x2c')](function(){if(!_0x144393){if(_0x396666[_0x24fa('0x41')][_0x24fa('0x79')])return;_0x36f990[_0x24fa('0x49')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');_0x4844c1[_0x24fa('0x49')](_0x24fa('0x94'));return;}if(_0x396666[_0x24fa('0x95')][_0x24fa('0x96')]!==_0x24fa('0x97'))return;return _0x396666['user']['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0x24f9b2){if(_[_0x24fa('0x78')](_0x24f9b2)){_0x36f990['where'](_0x24fa('0x98'));_0x4844c1['where']('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0x36f990[_0x24fa('0x49')](_0x24fa('0x99'),_['map'](_0x24f9b2,'id'));_0x4844c1[_0x24fa('0x49')](_0x24fa('0x99'),_[_0x24fa('0x32')](_0x24f9b2,'id'));}});})[_0x24fa('0x2c')](function(){if(_0x396666[_0x24fa('0x95')][_0x24fa('0x96')]===_0x24fa('0x97')&&!_0x144393&&!_0x396666[_0x24fa('0x41')]['OpenchannelAccountId'])return[];return db[_0x24fa('0x9a')][_0x24fa('0x41')](_0x36f990[_0x24fa('0x9b')](),_0x1d7620);})[_0x24fa('0x2c')](function(_0x28654f){_0x46e699[_0x24fa('0x25')]=_0x28654f[_0x24fa('0x44')];if(_0x46e699['count']===0x0)return[];return db[_0x24fa('0x9a')][_0x24fa('0x41')](_0x3fde82[_0x24fa('0x9b')](),_0x1d7620)[_0x24fa('0x2c')](function(_0x4a7d7c){_0x38ea47=_[_0x24fa('0x9c')](_0x4a7d7c,'id');_0x1d7620=_[_0x24fa('0x9d')](_0x1d7620,{'model':db[_0x24fa('0x3b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x396666[_0x24fa('0x41')]['fields']){_0x745782[_0x24fa('0x43')][_0x24fa('0x37')](function(_0x33b4a7){_0x4844c1[_0x24fa('0x4d')]('i.'+_0x33b4a7);});}else{_0x4844c1[_0x24fa('0x4d')](_0x24fa('0x90'),'unreadMessages');_0x4844c1[_0x24fa('0x4d')](_0x24fa('0x9e'),_0x24fa('0x9f'));_0x4844c1[_0x24fa('0x4d')](_0x24fa('0xa0'),'Account.mandatoryDisposition');_0x4844c1[_0x24fa('0x4d')](_0x24fa('0xa1'),_0x24fa('0x91'));_0x4844c1['field'](_0x24fa('0xa2'));_0x4844c1[_0x24fa('0x4d')]('c.firstName',_0x24fa('0xa3'));_0x4844c1[_0x24fa('0x4d')](_0x24fa('0xa4'),_0x24fa('0xa5'));_0x4844c1[_0x24fa('0x4d')]('c.email','Contact.email');_0x4844c1[_0x24fa('0x4d')](_0x24fa('0xa6'),_0x24fa('0xa7'));_0x4844c1[_0x24fa('0x4d')](_0x24fa('0xa8'),_0x24fa('0xa9'));_0x4844c1[_0x24fa('0x4d')](_0x24fa('0xaa'),_0x24fa('0xab'));_0x4844c1['field'](_0x24fa('0xac'),'Owner.fullname');_0x4844c1[_0x24fa('0x4d')](_0x24fa('0xad'),'Owner.internal');_0x4844c1[_0x24fa('0x4d')](_0x24fa('0xae'),_0x24fa('0x34'));}if(_0x745782[_0x24fa('0x23')])_0x4844c1['limit'](_0x745782['limit']);if(_0x745782['offset'])_0x4844c1['offset'](_0x745782[_0x24fa('0x24')]);return db[_0x24fa('0x9a')]['query'](_0x4844c1['toString'](),_0x1d7620);})['then'](function(_0x3c92e9){if(_0x3c92e9[_0x24fa('0x44')]>0x0)_0x1db351['where'](_0x24fa('0xaf'),_[_0x24fa('0x32')](_0x3c92e9,'id'));return db[_0x24fa('0x9a')]['query'](_0x1db351[_0x24fa('0x9b')](),_0x1d7620)['then'](function(_0xed902b){var _0x45ec71=_['groupBy'](_0xed902b,_0x24fa('0xb0'));var _0x12b59f=[];_0x3c92e9[_0x24fa('0x37')](function(_0x53c0c8){_0x12b59f[_0x24fa('0x38')](updateOpenchannelInteraction(_0x53c0c8,_0x38ea47,_0x45ec71));});return BPromise[_0x24fa('0xb1')](_0x12b59f);});});})[_0x24fa('0x2c')](function(_0xe457e9){_0x46e699['rows']=_0xe457e9;return _0x46e699;})[_0x24fa('0x2c')](respondWithFilteredResult(_0x31da64,_0x745782))[_0x24fa('0x39')](handleError(_0x31da64,null));};exports[_0x24fa('0xb2')]=function(_0x15b434,_0x50acc3){var _0xa594b={};if(_0x15b434[_0x24fa('0x41')][_0x24fa('0x3e')]&&_0x15b434[_0x24fa('0x41')][_0x24fa('0x3e')]===_0x24fa('0x4e')){_0xa594b['from']=_0x15b434[_0x24fa('0xb3')]['id'];}else{_0xa594b['id']=_0x15b434[_0x24fa('0xb3')]['id'];}var _0x2e472e={'raw':![],'where':_0xa594b},_0x115c1f={};_0x115c1f[_0x24fa('0x40')]=_[_0x24fa('0x76')](db['OpenchannelInteraction'][_0x24fa('0x3c')]);_0x115c1f['query']=_[_0x24fa('0x76')](_0x15b434[_0x24fa('0x41')]);_0x115c1f[_0x24fa('0x4b')]=_[_0x24fa('0x42')](_0x115c1f[_0x24fa('0x40')],_0x115c1f[_0x24fa('0x41')]);_0x2e472e[_0x24fa('0x43')]=_[_0x24fa('0x42')](_0x115c1f[_0x24fa('0x40')],qs[_0x24fa('0xb4')](_0x15b434[_0x24fa('0x41')][_0x24fa('0xb4')]));_0x2e472e['attributes']=_0x2e472e[_0x24fa('0x43')]['length']?_0x2e472e['attributes']:_0x115c1f['model'];if(_0x15b434[_0x24fa('0x41')][_0x24fa('0xb5')]){_0x2e472e[_0x24fa('0xb6')]=[{'all':!![]}];}_0x2e472e=_[_0x24fa('0x9d')]({},_0x2e472e,_0x15b434[_0x24fa('0xb7')]);return db[_0x24fa('0x3b')][_0x24fa('0x64')](_0x2e472e)[_0x24fa('0x2c')](handleEntityNotFound(_0x50acc3,null))[_0x24fa('0x2c')](respondWithResult(_0x50acc3,null))[_0x24fa('0x39')](handleError(_0x50acc3,null));};exports[_0x24fa('0xb8')]=function(_0x292668,_0x1ad3f4){return db['OpenchannelInteraction']['create'](_0x292668[_0x24fa('0xb9')],{})[_0x24fa('0x2c')](respondWithResult(_0x1ad3f4,0xc9))[_0x24fa('0x39')](handleError(_0x1ad3f4,null));};exports[_0x24fa('0x2b')]=function(_0xb55f1b,_0x258609){if(_0xb55f1b['body']['id']){delete _0xb55f1b[_0x24fa('0xb9')]['id'];}return db[_0x24fa('0x3b')][_0x24fa('0x64')]({'where':{'id':_0xb55f1b[_0x24fa('0xb3')]['id']}})[_0x24fa('0x2c')](handleEntityNotFound(_0x258609,null))[_0x24fa('0x2c')](saveUpdates(_0xb55f1b[_0x24fa('0xb9')],null))[_0x24fa('0x2c')](respondWithResult(_0x258609,null))[_0x24fa('0x39')](handleError(_0x258609,null));};exports['destroy']=function(_0x594f01,_0x139859){return db[_0x24fa('0x3b')][_0x24fa('0x64')]({'where':{'id':_0x594f01['params']['id']}})['then'](handleEntityNotFound(_0x139859,null))['then'](removeEntity(_0x139859,null))[_0x24fa('0x39')](handleError(_0x139859,null));};exports[_0x24fa('0xba')]=function(_0xd7e317,_0x50f43a){return db[_0x24fa('0x3b')][_0x24fa('0xba')]()[_0x24fa('0x2c')](respondWithResult(_0x50f43a,null))[_0x24fa('0x39')](handleError(_0x50f43a,null));};exports[_0x24fa('0xbb')]=function(_0x348201,_0x4d6eee,_0x1bdde1){return db['OpenchannelMessage'][_0x24fa('0x64')]({'where':{'id':_0x348201[_0x24fa('0xb3')]['id']}})[_0x24fa('0x2c')](handleEntityNotFound(_0x4d6eee,null))['then'](function(_0x51ad56){if(_0x51ad56){return _0x51ad56[_0x24fa('0xbb')](_0x348201['body'][_0x24fa('0xbc')],_[_0x24fa('0xbd')](_0x348201[_0x24fa('0xb9')],['ids','id'])||{});}})[_0x24fa('0x2c')](respondWithResult(_0x4d6eee,null))[_0x24fa('0x39')](handleError(_0x4d6eee,null));};exports[_0x24fa('0xbe')]=function(_0x481f01,_0x4afb26,_0x5f3f0b){var _0x322f4d={'raw':![],'where':{}};var _0xe28141={};var _0x3ddfc3={'count':0x0,'rows':[]};return db[_0x24fa('0x3b')][_0x24fa('0xbf')]({'where':{'id':_0x481f01[_0x24fa('0xb3')]['id']}})['then'](handleEntityNotFound(_0x4afb26,null))['then'](function(_0x249844){if(_0x249844){_0xe28141[_0x24fa('0x40')]=_[_0x24fa('0x76')](db[_0x24fa('0xc0')]['rawAttributes']);_0xe28141[_0x24fa('0x41')]=_[_0x24fa('0x76')](_0x481f01[_0x24fa('0x41')]);_0xe28141[_0x24fa('0x4b')]=_['intersection'](_0xe28141[_0x24fa('0x40')],_0xe28141['query']);_0x322f4d[_0x24fa('0x43')]=_['intersection'](_0xe28141[_0x24fa('0x40')],qs[_0x24fa('0xb4')](_0x481f01['query'][_0x24fa('0xb4')]));_0x322f4d[_0x24fa('0x43')]=_0x322f4d[_0x24fa('0x43')][_0x24fa('0x44')]?_0x322f4d[_0x24fa('0x43')]:_0xe28141[_0x24fa('0x40')];if(!_0x481f01[_0x24fa('0x41')][_0x24fa('0x45')](_0x24fa('0x46'))){_0x322f4d[_0x24fa('0x23')]=qs[_0x24fa('0x23')](_0x481f01[_0x24fa('0x41')][_0x24fa('0x23')]);_0x322f4d[_0x24fa('0x24')]=qs[_0x24fa('0x24')](_0x481f01['query'][_0x24fa('0x24')]);}_0x322f4d[_0x24fa('0x47')]=qs[_0x24fa('0x48')](_0x481f01[_0x24fa('0x41')][_0x24fa('0x48')]);_0x322f4d[_0x24fa('0x49')]=qs['filters'](_[_0x24fa('0x4a')](_0x481f01[_0x24fa('0x41')],_0xe28141[_0x24fa('0x4b')]));_0x322f4d[_0x24fa('0x49')]['OpenchannelInteractionId']=_0x249844['id'];if(_0x481f01[_0x24fa('0x41')]['filter']){_0x322f4d[_0x24fa('0x49')]=_[_0x24fa('0x9d')](_0x322f4d[_0x24fa('0x49')],{'$or':_[_0x24fa('0x32')](_0x322f4d[_0x24fa('0x43')],function(_0x578e77){var _0x5ba456={};_0x5ba456[_0x578e77]={'$like':'%'+_0x481f01['query'][_0x24fa('0x87')]+'%'};return _0x5ba456;})});}if(_0x481f01[_0x24fa('0x41')][_0x24fa('0x7c')]){var _0x3e9891=_0x481f01[_0x24fa('0x41')]['$gte'][_0x24fa('0x36')](',');var _0x5ee4d6={};_0x5ee4d6[_0x3e9891[0x0]]={'$gte':moment(_0x3e9891[0x1])[_0x24fa('0xc1')](_0x24fa('0xc2'))};_0x322f4d[_0x24fa('0x49')]=_[_0x24fa('0x9d')](_0x322f4d[_0x24fa('0x49')],_0x5ee4d6);}_0x322f4d=_[_0x24fa('0x9d')]({},_0x322f4d,_0x481f01[_0x24fa('0xb7')]);return db[_0x24fa('0xc0')]['count']({'where':_0x322f4d['where']})[_0x24fa('0x2c')](function(_0x494794){_0x3ddfc3[_0x24fa('0x25')]=_0x494794;if(_0x481f01[_0x24fa('0x41')]['includeAll']){_0x322f4d[_0x24fa('0xb6')]=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x322f4d);})[_0x24fa('0x2c')](function(_0x4c1d78){_0x3ddfc3[_0x24fa('0xc3')]=_0x4c1d78;return _0x3ddfc3;});}})[_0x24fa('0x2c')](respondWithFilteredResult(_0x4afb26,_0x322f4d))[_0x24fa('0x39')](handleError(_0x4afb26,null));};exports['addTags']=function(_0x4bc450,_0x5aabbc,_0x2c4216){return db[_0x24fa('0x3b')][_0x24fa('0x64')]({'where':{'id':_0x4bc450[_0x24fa('0xb3')]['id']}})['then'](handleEntityNotFound(_0x5aabbc,null))[_0x24fa('0x2c')](function(_0x9a1d24){if(_0x9a1d24){return _0x9a1d24['setTags'](_0x4bc450[_0x24fa('0xb9')][_0x24fa('0xbc')],_[_0x24fa('0xbd')](_0x4bc450['body'],['ids','id'])||{})['spread'](function(){return db[_0x24fa('0x73')][_0x24fa('0xc4')]({'attributes':['id',_0x24fa('0x2f'),_0x24fa('0xc5')],'where':{'id':_0x4bc450['body'][_0x24fa('0xbc')]}});})[_0x24fa('0x2c')](function(_0x3eab61){socket['emit'](_0x24fa('0xc6'),{'id':Number(_0x4bc450[_0x24fa('0xb3')]['id']),'tags':_0x3eab61||[]});return{'id':Number(_0x4bc450[_0x24fa('0xb3')]['id']),'tags':_0x3eab61||[]};});}})[_0x24fa('0x2c')](respondWithResult(_0x5aabbc,null))[_0x24fa('0x39')](handleError(_0x5aabbc,null));};exports[_0x24fa('0xc7')]=function(_0x35dfa3,_0xcb8741,_0x517809){return db[_0x24fa('0x3b')][_0x24fa('0x64')]({'where':{'id':_0x35dfa3[_0x24fa('0xb3')]['id']}})[_0x24fa('0x2c')](handleEntityNotFound(_0xcb8741,null))[_0x24fa('0x2c')](function(_0x5307ae){if(_0x5307ae){return _0x5307ae['removeTags'](_0x35dfa3[_0x24fa('0x41')]['ids']);}})[_0x24fa('0x2c')](respondWithStatusCode(_0xcb8741,null))[_0x24fa('0x39')](handleError(_0xcb8741,null));};exports[_0x24fa('0xc8')]=function(_0x42730d,_0x4d5454){var _0x37c579=moment()[_0x24fa('0xc9')]()[_0x24fa('0x9b')]();var _0x273747=path['join'](config[_0x24fa('0xca')],_0x24fa('0xcb'),_0x24fa('0xcc'),_0x24fa('0xcd'));var _0x401aab=path['join'](config[_0x24fa('0xca')],_0x24fa('0xcb'),_0x24fa('0xcc'),_0x24fa('0xce'));var _0x259de8=path['join'](_0x273747,_0x37c579);var _0x12520c=util['format'](_0x24fa('0xcf'),_0x42730d[_0x24fa('0xb3')]['id'],_0x37c579);var _0x56d0d2=path['join'](_0x273747,_0x12520c);var _0x3b5093=[];_0x3b5093['push']({'model':db[_0x24fa('0xd0')],'as':'User','attributes':['id',_0x24fa('0x33')],'raw':!![]});_0x3b5093[_0x24fa('0x38')]({'model':db[_0x24fa('0xd1')],'as':_0x24fa('0x69'),'attributes':['id',_0x24fa('0xd2'),_0x24fa('0xd3')],'raw':!![]});if(_0x42730d[_0x24fa('0x41')][_0x24fa('0xce')]){_0x3b5093[_0x24fa('0x38')]({'model':db[_0x24fa('0xd4')],'as':'Attachment','raw':!![]});}var _0x1b9492=[{'model':db[_0x24fa('0xc0')],'as':'Messages','attributes':['id','body',_0x24fa('0xd5'),'direction',_0x24fa('0xd6'),'read'],'include':_0x3b5093}];_0x1b9492[_0x24fa('0x38')]({'model':db[_0x24fa('0xd7')],'as':_0x24fa('0xd8'),'attributes':['id',_0x24fa('0x2f')]});_0x1b9492[_0x24fa('0x38')]({'model':db[_0x24fa('0xd0')],'as':'Owner','attributes':['id',_0x24fa('0x33')]});return db[_0x24fa('0x3b')][_0x24fa('0x64')]({'where':{'id':_0x42730d[_0x24fa('0xb3')]['id']},'include':_0x1b9492})[_0x24fa('0x2c')](handleEntityNotFound(_0x4d5454,null))[_0x24fa('0x2c')](function(_0xe93cf2){if(_0xe93cf2){var _0x1a43eb=_0xe93cf2[_0x24fa('0xd9')]({'plain':!![]});fs[_0x24fa('0xda')](_0x259de8);var _0x5136f7={'channel':_0x24fa('0xdb'),'account':_0x1a43eb[_0x24fa('0xd8')][_0x24fa('0x2f')],'agent':_0x1a43eb[_0x24fa('0xdc')]?_0x1a43eb[_0x24fa('0xdc')]['fullname']:_0x24fa('0xdd'),'createdAt':moment(_0x1a43eb[_0x24fa('0xd5')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x1a43eb[_0x24fa('0xde')]?moment(_0x1a43eb['closedAt'])[_0x24fa('0xc1')](_0x24fa('0xc2'))[_0x24fa('0x9b')]():'','disposition':_0x1a43eb['disposition'],'visibility':_0x1a43eb[_0x24fa('0xdf')]?_0x24fa('0xe0'):'Private','messages':_(_0x1a43eb['Messages'])['filter']({'secret':![]})[_0x24fa('0x32')](function(_0xd0cd0b){if(_0xd0cd0b[_0x24fa('0xd4')]){var _0x23cc19=path[_0x24fa('0xe1')](_0x401aab,_0xd0cd0b[_0x24fa('0xd4')]['basename']);if(fs[_0x24fa('0xe2')](_0x23cc19)){fs[_0x24fa('0xe3')](_0x23cc19)['pipe'](fs['createWriteStream'](path[_0x24fa('0xe1')](_0x259de8,_0xd0cd0b[_0x24fa('0xd4')]['basename'])));}}return{'date':moment(_0xd0cd0b[_0x24fa('0xd5')])[_0x24fa('0xc1')](_0x24fa('0xc2'))[_0x24fa('0x9b')](),'sender':_0xd0cd0b['direction']==='out'?_0xd0cd0b[_0x24fa('0xd0')]?_0xd0cd0b[_0x24fa('0xd0')][_0x24fa('0x33')]:'System':_0xd0cd0b['Contact'][_0x24fa('0xd2')]+(_0xd0cd0b[_0x24fa('0x69')]['lastName']?'\x20'+_0xd0cd0b['Contact'][_0x24fa('0xd3')]:''),'body':_0xd0cd0b[_0x24fa('0xd4')]?_0xd0cd0b[_0x24fa('0xd4')][_0x24fa('0xe4')]:_0xd0cd0b[_0x24fa('0xb9')],'direction':_0xd0cd0b[_0x24fa('0xe5')]===_0x24fa('0xe6')?'A':'C','secret':_0xd0cd0b[_0x24fa('0xd6')],'read':_0xd0cd0b[_0x24fa('0x81')],'attachment':_0xd0cd0b[_0x24fa('0xd4')]};})['value']()};return ejs[_0x24fa('0xe7')](path['join'](config[_0x24fa('0xca')],_0x24fa('0xcb'),_0x24fa('0xe8'),_0x24fa('0xe9')),{'interaction':_0x5136f7})[_0x24fa('0x2c')](function(_0x5ccb94){var _0x557e73=path[_0x24fa('0xe1')](_0x259de8,'transcript-'+_0x1a43eb['id']+'-'+_0x37c579+'.pdf');var _0xaad5fd={'path':_0x557e73,'channel':_0x24fa('0xdb'),'interactionId':_0x1a43eb['id']};return pdf[_0x24fa('0xea')](_0x5ccb94,_0xaad5fd);})['then'](function(){return new BPromise(function(_0x3b9e38,_0x80bbf){zipdir(_0x259de8,{'saveTo':_0x56d0d2},function(_0x634513,_0x31dd42){if(_0x634513)return _0x80bbf(_0x634513);return _0x3b9e38(_0x31dd42);});})[_0x24fa('0x2c')](function(){return new BPromise(function(_0x239afd,_0x3b3360){rimraf(_0x259de8,function(_0x3f36aa){if(_0x3f36aa)_0x3b3360(_0x3f36aa);return _0x239afd();});});})[_0x24fa('0x2c')](function(){return _0x4d5454[_0x24fa('0xc8')](_0x56d0d2,_0x12520c,function(_0x48a0ca){if(_0x48a0ca){console[_0x24fa('0xeb')](_0x24fa('0xec'),_0x48a0ca);}else{fs['unlinkSync'](_0x56d0d2);}});});});}else{return _0x4d5454[_0x24fa('0x1f')](0xc8);}})['catch'](handleError(_0x4d5454,null));}; \ No newline at end of file +var _0x4846=['findAll','addTags','setTags','ids','spread','emit','openchannelInteractionTags:save','removeTags','unix','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Attachment','Messages','direction','secret','Owner','fullname','get','mkdirSync','Account','closedAt','disposition','threadId','Private','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','renderFile','views','.pdf','Openchannel','download','log','err','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','count','limit','apply','reject','save','then','destroy','end','error','stack','name','send','Users','TagIds','Tags','split','forEach','catch','index','map','fieldName','type','key','model','filters','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','ui.OpenchannelInteractionId','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','left_join','o.id\x20=\x20i.UserId','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','body','keys','some','compact','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','Sequelize','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','DESC','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','merge','OpenchannelInteraction','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','c.lastName','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','push','all','rows','params','rawAttributes','intersection','includeAll','include','create','update','describe','addMessage','OpenchannelMessage','omit','findOne','OpenchannelInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','options'];(function(_0x4c2a66,_0x5abaaf){var _0x3fbe5f=function(_0x5a1beb){while(--_0x5a1beb){_0x4c2a66['push'](_0x4c2a66['shift']());}};_0x3fbe5f(++_0x5abaaf);}(_0x4846,0x122));var _0x6484=function(_0x1df14f,_0x122ced){_0x1df14f=_0x1df14f-0x0;var _0x3f6e46=_0x4846[_0x1df14f];return _0x3f6e46;};'use strict';var emlformat=require(_0x6484('0x0'));var rimraf=require(_0x6484('0x1'));var zipdir=require(_0x6484('0x2'));var jsonpatch=require(_0x6484('0x3'));var rp=require(_0x6484('0x4'));var moment=require(_0x6484('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6484('0x6'));var util=require('util');var path=require(_0x6484('0x7'));var sox=require('sox');var csv=require(_0x6484('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6484('0x9'));var _=require(_0x6484('0xa'));var squel=require(_0x6484('0xb'));var crypto=require(_0x6484('0xc'));var jsforce=require(_0x6484('0xd'));var deskjs=require(_0x6484('0xe'));var toCsv=require(_0x6484('0x8'));var querystring=require(_0x6484('0xf'));var Papa=require(_0x6484('0x10'));var Redis=require(_0x6484('0x11'));var authService=require(_0x6484('0x12'));var qs=require(_0x6484('0x13'));var as=require(_0x6484('0x14'));var pdf=require(_0x6484('0x15'));var hardwareService=require(_0x6484('0x16'));var logger=require(_0x6484('0x17'))('api');var utils=require(_0x6484('0x18'));var config=require(_0x6484('0x19'));var licenseUtil=require(_0x6484('0x1a'));var db=require(_0x6484('0x1b'))['db'];config[_0x6484('0x1c')]=_[_0x6484('0x1d')](config[_0x6484('0x1c')],{'host':_0x6484('0x1e'),'port':0x18eb});var socket=require(_0x6484('0x1f'))(new Redis(config[_0x6484('0x1c')]));require('./openchannelInteraction.socket')[_0x6484('0x20')](socket);function respondWithStatusCode(_0x35d417,_0x8248e4){_0x8248e4=_0x8248e4||0xcc;return function(_0x19d7ba){if(_0x19d7ba){return _0x35d417[_0x6484('0x21')](_0x8248e4);}return _0x35d417[_0x6484('0x22')](_0x8248e4)['end']();};}function respondWithResult(_0x5f3793,_0x32001f){_0x32001f=_0x32001f||0xc8;return function(_0x10d8b){if(_0x10d8b){return _0x5f3793[_0x6484('0x22')](_0x32001f)[_0x6484('0x23')](_0x10d8b);}};}function respondWithFilteredResult(_0x19ee14,_0xc362f2){return function(_0x23889d){if(_0x23889d){var _0x40b27d=typeof _0xc362f2[_0x6484('0x24')]===_0x6484('0x25')&&typeof _0xc362f2['limit']===_0x6484('0x25');var _0x3b1c55=_0x23889d[_0x6484('0x26')];var _0x464fdb=_0x40b27d?0x0:_0xc362f2[_0x6484('0x24')];var _0x257d99=_0x40b27d?_0x23889d[_0x6484('0x26')]:_0xc362f2['offset']+_0xc362f2[_0x6484('0x27')];var _0x25a4c0;if(_0x257d99>=_0x3b1c55){_0x257d99=_0x3b1c55;_0x25a4c0=0xc8;}else{_0x25a4c0=0xce;}_0x19ee14['status'](_0x25a4c0);return _0x19ee14['set']('Content-Range',_0x464fdb+'-'+_0x257d99+'/'+_0x3b1c55)[_0x6484('0x23')](_0x23889d);}return null;};}function patchUpdates(_0x531c17){return function(_0x3e078f){try{jsonpatch[_0x6484('0x28')](_0x3e078f,_0x531c17,!![]);}catch(_0x57ad57){return BPromise[_0x6484('0x29')](_0x57ad57);}return _0x3e078f[_0x6484('0x2a')]();};}function saveUpdates(_0x4ca67d,_0x7dafdf){return function(_0x2ba66a){if(_0x2ba66a){return _0x2ba66a['update'](_0x4ca67d)[_0x6484('0x2b')](function(_0x53bc80){return _0x53bc80;});}return null;};}function removeEntity(_0x3a2a73,_0x55c023){return function(_0x14f536){if(_0x14f536){return _0x14f536[_0x6484('0x2c')]()[_0x6484('0x2b')](function(){_0x3a2a73['status'](0xcc)[_0x6484('0x2d')]();});}};}function handleEntityNotFound(_0xb7fbcc,_0x527395){return function(_0x2a25bd){if(!_0x2a25bd){_0xb7fbcc[_0x6484('0x21')](0x194);}return _0x2a25bd;};}function handleError(_0x1bacf7,_0x444f0b){_0x444f0b=_0x444f0b||0x1f4;return function(_0x79e1db){logger[_0x6484('0x2e')](_0x79e1db[_0x6484('0x2f')]);if(_0x79e1db[_0x6484('0x30')]){delete _0x79e1db[_0x6484('0x30')];}_0x1bacf7[_0x6484('0x22')](_0x444f0b)[_0x6484('0x31')](_0x79e1db);};}function getInteractionUsers(_0x2b62aa,_0x24c71d){return new BPromise(function(_0x3cb434,_0x5a7a86){try{if(_0x24c71d[_0x2b62aa['id']]){_0x2b62aa[_0x6484('0x32')]=_['map'](_0x24c71d[_0x2b62aa['id']],function(_0x58ede4){return{'id':_0x58ede4['id'],'fullname':_0x58ede4['fullname']};});}}catch(_0x2c172c){_0x5a7a86(_0x2c172c);}_0x3cb434(_0x2b62aa);});}function getInteractionTags(_0x2a77c2,_0x1edfbc){return new BPromise(function(_0x18953,_0x47e70e){try{if(_0x2a77c2[_0x6484('0x33')]){_0x2a77c2[_0x6484('0x34')]=[];_0x2a77c2[_0x6484('0x33')][_0x6484('0x35')](',')[_0x6484('0x36')](function(_0x221520){_0x2a77c2['Tags']['push'](_0x1edfbc[_0x221520]);});}delete _0x2a77c2[_0x6484('0x33')];}catch(_0x516c42){_0x47e70e(_0x516c42);}_0x18953(_0x2a77c2);});}function updateOpenchannelInteraction(_0x1d7e6d,_0xad3ae9,_0x4d85c6){return new BPromise(function(_0x20d061,_0x4afb28){return getInteractionUsers(_0x1d7e6d,_0x4d85c6)['then'](function(_0xd5248d){return getInteractionTags(_0xd5248d,_0xad3ae9);})[_0x6484('0x2b')](function(_0x1b5fc2){_0x20d061(_0x1b5fc2);})[_0x6484('0x37')](function(_0x6422e0){_0x4afb28(_0x6422e0);});});}exports[_0x6484('0x38')]=function(_0x39c079,_0x3971a9){var _0x4657b1={},_0x18041b={},_0x24bec0={'count':0x0,'rows':[]};var _0x3da212=_[_0x6484('0x39')](db['OpenchannelInteraction']['rawAttributes'],function(_0x568856){return{'name':_0x568856[_0x6484('0x3a')],'type':_0x568856[_0x6484('0x3b')][_0x6484('0x3c')]};});_0x18041b[_0x6484('0x3d')]=_['map'](_0x3da212,_0x6484('0x30'));_0x18041b['query']=_['keys'](_0x39c079['query']);_0x18041b[_0x6484('0x3e')]=_['intersection'](_0x18041b['model'],_0x18041b[_0x6484('0x3f')]);_0x4657b1[_0x6484('0x40')]=_['intersection'](_0x18041b[_0x6484('0x3d')],qs[_0x6484('0x41')](_0x39c079['query'][_0x6484('0x41')]));_0x4657b1['attributes']=_0x4657b1[_0x6484('0x40')][_0x6484('0x42')]?_0x4657b1['attributes']:_0x18041b[_0x6484('0x3d')];if(!_0x39c079['query'][_0x6484('0x43')](_0x6484('0x44'))){_0x4657b1[_0x6484('0x27')]=qs['limit'](_0x39c079[_0x6484('0x3f')][_0x6484('0x27')]);_0x4657b1[_0x6484('0x24')]=qs[_0x6484('0x24')](_0x39c079[_0x6484('0x3f')]['offset']);}_0x4657b1[_0x6484('0x45')]=qs['sort'](_0x39c079[_0x6484('0x3f')][_0x6484('0x46')]);_0x4657b1[_0x6484('0x47')]=qs[_0x6484('0x3e')](_[_0x6484('0x48')](_0x39c079['query'],_0x18041b[_0x6484('0x3e')]),_0x3da212);var _0x159894=[];var _0x3008eb=squel[_0x6484('0x49')]()['field']('id')[_0x6484('0x4a')](_0x6484('0x30'))[_0x6484('0x4a')](_0x6484('0x4b'))[_0x6484('0x4c')](_0x6484('0x4d'));var _0x3a99c7=squel[_0x6484('0x49')]()[_0x6484('0x4a')]('u.id')[_0x6484('0x4a')]('u.fullname')['field'](_0x6484('0x4e'))[_0x6484('0x4c')]('user_has_openchannel_interactions','ui')['left_join'](_0x6484('0x4f'),'u',_0x6484('0x50'));var _0x2347d4=squel[_0x6484('0x49')]()[_0x6484('0x4c')]('openchannel_interactions','i')['left_join'](_0x6484('0x51'),'c',_0x6484('0x52'))[_0x6484('0x53')]('users','o',_0x6484('0x54'))[_0x6484('0x53')]('openchannel_accounts','a',_0x6484('0x55'))[_0x6484('0x53')](_0x6484('0x56'),'me',_0x6484('0x57'))[_0x6484('0x53')](_0x6484('0x58'),'it',_0x6484('0x59'))[_0x6484('0x53')]('tools_tags','t',_0x6484('0x5a'));var _0x2c74ce=squel[_0x6484('0x5b')]();var _0xc45757=[];var _0x3b531a=squel[_0x6484('0x5b')]();var _0xbf915d;if(_0x39c079[_0x6484('0x3f')]['search']){_0xbf915d=as[_0x6484('0x5c')](_0x39c079[_0x6484('0x3f')][_0x6484('0x5d')]);var _0x4e1c71=_0xbf915d[_0x6484('0x5e')];for(var _0xc04751=0x0;_0xc04751<_0xbf915d[_0x6484('0x5f')]['length'];_0xc04751++){var _0x2600a2=_0xbf915d[_0x6484('0x5f')][_0xc04751];var _0x227e5a='i';var _0x2bc1f3=_[_0x6484('0x60')](_0x3da212,['name',_0x2600a2['field']]);if(!_0x2bc1f3){switch(_0x2600a2[_0x6484('0x4a')]){case'unreadMessages':if(_0x2600a2[_0x6484('0x61')]==0x1){_0x2347d4[_0x6484('0x62')]('`'+_0x2600a2[_0x6484('0x4a')]+_0x6484('0x63'));}else{_0x2347d4[_0x6484('0x62')]('`'+_0x2600a2['field']+_0x6484('0x64'));}break;case _0x6484('0x65'):if(_0x2600a2[_0x6484('0x66')]==='$substring'){if(_0x2600a2['value']['split']('\x20')[_0x6484('0x42')]>0x1){_0x2c74ce[_0x4e1c71](_0x6484('0x67'),qs[_0x6484('0x68')](_0x2600a2[_0x6484('0x61')]),null);}else{var _0x5395f8='%'+_0x2600a2[_0x6484('0x61')]+'%';_0x2c74ce[_0x4e1c71](_0x6484('0x69'),_0x5395f8,_0x5395f8,_0x5395f8);}}else{_0x2bc1f3=_[_0x6484('0x60')](_0x3da212,[_0x6484('0x30'),_0x6484('0x6a')]);_0x2600a2[_0x6484('0x4a')]=_0x6484('0x6a');_0x4b1c0d=as[_0x6484('0x6b')](_0x227e5a,_0x2bc1f3['type'],_0x2600a2);_0x2c74ce[_0x4e1c71](_0x4b1c0d[_0x6484('0x6c')],_0x4b1c0d[_0x6484('0x61')]['start'],_0x4b1c0d[_0x6484('0x61')][_0x6484('0x2d')]);}break;case _0x6484('0x6d'):var _0x2a13c6=_0x2600a2['value'][_0x6484('0x35')](',')[_0x6484('0x39')](function(_0x526086){return Number(_0x526086);});_0x2a13c6[_0x6484('0x36')](function(_0x2e1a57){_0x3b531a['or'](_0x6484('0x6e'),'%,'+_0x2e1a57+',%');});_0xc45757=_['union'](_0xc45757,_0x2a13c6);break;case _0x6484('0x6f'):if(_0x2600a2[_0x6484('0x66')]==='$substring'){_0x2c74ce[_0x4e1c71](_0x6484('0x70'),'%'+_0x2600a2[_0x6484('0x61')]+'%',null);}else{_0x2bc1f3=_['find'](_0x3da212,[_0x6484('0x30'),_0x6484('0x71')]);_0x2600a2[_0x6484('0x4a')]=_0x6484('0x71');_0x4b1c0d=as[_0x6484('0x6b')](_0x227e5a,_0x2bc1f3['type'],_0x2600a2);_0x2c74ce[_0x4e1c71](_0x4b1c0d['text'],_0x4b1c0d[_0x6484('0x61')][_0x6484('0x72')],_0x4b1c0d['value'][_0x6484('0x2d')]);}break;case _0x6484('0x73'):_0x4b1c0d=as['buildExpression']('me',null,_0x2600a2);_0x2c74ce[_0x4e1c71](_0x4b1c0d['text'],_0x4b1c0d[_0x6484('0x61')]['start'],_0x4b1c0d[_0x6484('0x61')][_0x6484('0x2d')]);break;}}else{var _0x4b1c0d=as[_0x6484('0x6b')](_0x227e5a,_0x2bc1f3[_0x6484('0x3b')],_0x2600a2);_0x2c74ce[_0x4e1c71](_0x4b1c0d[_0x6484('0x6c')],_0x4b1c0d[_0x6484('0x61')][_0x6484('0x72')],_0x4b1c0d[_0x6484('0x61')][_0x6484('0x2d')]);}}}else{var _0x498149=_(_0x39c079['query'])[_0x6484('0x74')]()[_0x6484('0x39')](function(_0x534e22){return _[_0x6484('0x75')](_0x3da212,[_0x6484('0x30'),_0x534e22])?_0x534e22:undefined;})[_0x6484('0x76')]()[_0x6484('0x61')]();if(!_[_0x6484('0x77')](_0x498149)){_0x498149[_0x6484('0x36')](function(_0x1d0703){if(_0x1d0703===_0x6484('0x78')){_0x2347d4['where'](_0x6484('0x79'),[][_0x6484('0x7a')](_0x39c079[_0x6484('0x3f')][_0x1d0703]));}else if(_0x1d0703===_0x6484('0x7b')){var _0x2194e0=JSON[_0x6484('0x7c')](_0x39c079[_0x6484('0x3f')][_0x1d0703])[_0x6484('0x7d')];var _0x320a88=JSON[_0x6484('0x7c')](_0x39c079[_0x6484('0x3f')][_0x1d0703])[_0x6484('0x7e')];_0x2347d4[_0x6484('0x47')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2194e0,_0x320a88);}else{if(_0x39c079[_0x6484('0x3f')][_0x1d0703]==='null'){_0x2347d4['where']('i.'+_0x1d0703+_0x6484('0x7f'));}else{_0x2347d4[_0x6484('0x47')]('i.'+_0x1d0703+_0x6484('0x80'),_0x39c079[_0x6484('0x3f')][_0x1d0703]);}}});}if(_0x39c079[_0x6484('0x3f')][_0x6484('0x81')]){if(_0x39c079[_0x6484('0x3f')][_0x6484('0x81')]==0x1){_0x2347d4['having']('`unreadMessages`\x20=\x200');}else{_0x2347d4[_0x6484('0x62')](_0x6484('0x82'));}}if(_0x39c079[_0x6484('0x3f')][_0x6484('0x83')]){_0xc45757=_[_0x6484('0x84')](_0x39c079[_0x6484('0x3f')]['tag'])?_0x39c079[_0x6484('0x3f')][_0x6484('0x83')]:new Array(_0x39c079[_0x6484('0x3f')][_0x6484('0x83')]);_0xc45757[_0x6484('0x36')](function(_0x4d55f6){_0x3b531a['or'](_0x6484('0x6e'),'%,'+_0x4d55f6+',%');});}if(_0x39c079[_0x6484('0x3f')][_0x6484('0x85')]){var _0x5bc505=_0x39c079[_0x6484('0x3f')][_0x6484('0x85')][_0x6484('0x86')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x5bc505)){_0x2c74ce['or'](_0x6484('0x87'),_0x5bc505+'%');}else{_0x2c74ce['or'](_0x6484('0x88'),qs[_0x6484('0x68')](_0x5bc505))['or'](_0x6484('0x89'),_0x5bc505+'%')['or'](_0x6484('0x8a'),_0x5bc505+'%');}}}_0x2347d4['where'](_0x2c74ce);_0x2347d4['group']('i.id');var _0x830261={'type':db[_0x6484('0x8b')]['QueryTypes'][_0x6484('0x8c')],'raw':!![]};var _0x2c8ec2=_0x2347d4[_0x6484('0x8d')]();_0x2c8ec2['field'](_0x6484('0x8e'));_0x2c8ec2[_0x6484('0x4a')](_0x6484('0x8f'),_0x6484('0x90'));if(_0x4657b1[_0x6484('0x45')]){_0x4657b1[_0x6484('0x45')]['forEach'](function(_0x24d548){var _0x206b20=_0x24d548[0x0]==='contactName'?_0x24d548[0x0]:'i.'+_0x24d548[0x0];_0x2347d4[_0x6484('0x45')](_0x206b20,_0x24d548[0x1]===_0x6484('0x91')?![]:!![]);});}if(!_[_0x6484('0x77')](_0xc45757)){_0x2347d4[_0x6484('0x62')](_0x3b531a);_0x2c8ec2[_0x6484('0x47')](_0x6484('0x92'),_0xc45757);}BPromise[_0x6484('0x93')]()[_0x6484('0x2b')](function(){if(!_0xbf915d){if(_0x39c079[_0x6484('0x3f')]['OpenchannelAccountId'])return;_0x2c8ec2['where']('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');_0x2347d4[_0x6484('0x47')](_0x6484('0x94'));return;}if(_0x39c079[_0x6484('0x95')][_0x6484('0x96')]!==_0x6484('0x97'))return;return _0x39c079[_0x6484('0x95')][_0x6484('0x98')]({'attributes':['id'],'raw':!![]})[_0x6484('0x2b')](function(_0x232a75){if(_['isEmpty'](_0x232a75)){_0x2c8ec2[_0x6484('0x47')](_0x6484('0x99'));_0x2347d4[_0x6484('0x47')](_0x6484('0x99'));}else{_0x2c8ec2[_0x6484('0x47')]('i.OpenchannelAccountId\x20IN\x20?',_[_0x6484('0x39')](_0x232a75,'id'));_0x2347d4['where'](_0x6484('0x79'),_[_0x6484('0x39')](_0x232a75,'id'));}});})[_0x6484('0x2b')](function(){if(_0x39c079[_0x6484('0x95')][_0x6484('0x96')]===_0x6484('0x97')&&!_0xbf915d&&!_0x39c079[_0x6484('0x3f')][_0x6484('0x78')])return[];return db[_0x6484('0x9a')][_0x6484('0x3f')](_0x2c8ec2['toString'](),_0x830261);})[_0x6484('0x2b')](function(_0x4b0f89){_0x24bec0[_0x6484('0x26')]=_0x4b0f89['length'];if(_0x24bec0[_0x6484('0x26')]===0x0)return[];return db[_0x6484('0x9a')][_0x6484('0x3f')](_0x3008eb[_0x6484('0x9b')](),_0x830261)['then'](function(_0x520c13){_0x159894=_['keyBy'](_0x520c13,'id');_0x830261=_[_0x6484('0x9c')](_0x830261,{'model':db[_0x6484('0x9d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x39c079[_0x6484('0x3f')][_0x6484('0x41')]){_0x4657b1['attributes'][_0x6484('0x36')](function(_0xce5061){_0x2347d4[_0x6484('0x4a')]('i.'+_0xce5061);});}else{_0x2347d4[_0x6484('0x4a')](_0x6484('0x8f'),_0x6484('0x90'));_0x2347d4[_0x6484('0x4a')](_0x6484('0x9e'),_0x6484('0x9f'));_0x2347d4['field'](_0x6484('0xa0'),_0x6484('0xa1'));_0x2347d4[_0x6484('0x4a')](_0x6484('0xa2'),_0x6484('0xa3'));_0x2347d4[_0x6484('0x4a')](_0x6484('0xa4'));_0x2347d4[_0x6484('0x4a')](_0x6484('0xa5'),'Contact.firstName');_0x2347d4[_0x6484('0x4a')](_0x6484('0xa6'),'Contact.lastName');_0x2347d4['field']('c.email','Contact.email');_0x2347d4[_0x6484('0x4a')](_0x6484('0xa7'),'Contact.phone');_0x2347d4[_0x6484('0x4a')](_0x6484('0xa8'),_0x6484('0xa9'));_0x2347d4['field'](_0x6484('0xaa'),_0x6484('0xab'));_0x2347d4[_0x6484('0x4a')](_0x6484('0xac'),_0x6484('0xad'));_0x2347d4[_0x6484('0x4a')](_0x6484('0xae'),_0x6484('0xaf'));_0x2347d4['field'](_0x6484('0xb0'),_0x6484('0x33'));}if(_0x4657b1[_0x6484('0x27')])_0x2347d4['limit'](_0x4657b1[_0x6484('0x27')]);if(_0x4657b1[_0x6484('0x24')])_0x2347d4['offset'](_0x4657b1[_0x6484('0x24')]);return db[_0x6484('0x9a')][_0x6484('0x3f')](_0x2347d4[_0x6484('0x9b')](),_0x830261);})[_0x6484('0x2b')](function(_0x5b3ab1){if(_0x5b3ab1[_0x6484('0x42')]>0x0)_0x3a99c7[_0x6484('0x47')](_0x6484('0xb1'),_[_0x6484('0x39')](_0x5b3ab1,'id'));return db[_0x6484('0x9a')][_0x6484('0x3f')](_0x3a99c7[_0x6484('0x9b')](),_0x830261)['then'](function(_0x31c2d9){var _0x207bd1=_[_0x6484('0xb2')](_0x31c2d9,'OpenchannelInteractionId');var _0x46f337=[];_0x5b3ab1[_0x6484('0x36')](function(_0x42fc6c){_0x46f337[_0x6484('0xb3')](updateOpenchannelInteraction(_0x42fc6c,_0x159894,_0x207bd1));});return BPromise[_0x6484('0xb4')](_0x46f337);});});})[_0x6484('0x2b')](function(_0x2d59b4){_0x24bec0[_0x6484('0xb5')]=_0x2d59b4;return _0x24bec0;})['then'](respondWithFilteredResult(_0x3971a9,_0x4657b1))[_0x6484('0x37')](handleError(_0x3971a9,null));};exports['show']=function(_0x2335c4,_0x4ea60d){var _0x466884={};if(_0x2335c4['query'][_0x6484('0x3b')]&&_0x2335c4['query'][_0x6484('0x3b')]===_0x6484('0x4c')){_0x466884[_0x6484('0x4c')]=_0x2335c4[_0x6484('0xb6')]['id'];}else{_0x466884['id']=_0x2335c4['params']['id'];}var _0x512744={'raw':![],'where':_0x466884},_0x399281={};_0x399281[_0x6484('0x3d')]=_[_0x6484('0x74')](db[_0x6484('0x9d')][_0x6484('0xb7')]);_0x399281[_0x6484('0x3f')]=_['keys'](_0x2335c4['query']);_0x399281[_0x6484('0x3e')]=_[_0x6484('0xb8')](_0x399281['model'],_0x399281['query']);_0x512744[_0x6484('0x40')]=_[_0x6484('0xb8')](_0x399281[_0x6484('0x3d')],qs[_0x6484('0x41')](_0x2335c4[_0x6484('0x3f')][_0x6484('0x41')]));_0x512744[_0x6484('0x40')]=_0x512744[_0x6484('0x40')]['length']?_0x512744['attributes']:_0x399281[_0x6484('0x3d')];if(_0x2335c4['query'][_0x6484('0xb9')]){_0x512744[_0x6484('0xba')]=[{'all':!![]}];}_0x512744=_[_0x6484('0x9c')]({},_0x512744,_0x2335c4['options']);return db[_0x6484('0x9d')][_0x6484('0x60')](_0x512744)['then'](handleEntityNotFound(_0x4ea60d,null))['then'](respondWithResult(_0x4ea60d,null))[_0x6484('0x37')](handleError(_0x4ea60d,null));};exports[_0x6484('0xbb')]=function(_0x398e5a,_0x56dfa3){return db[_0x6484('0x9d')][_0x6484('0xbb')](_0x398e5a[_0x6484('0x73')],{})['then'](respondWithResult(_0x56dfa3,0xc9))[_0x6484('0x37')](handleError(_0x56dfa3,null));};exports[_0x6484('0xbc')]=function(_0x34c1c2,_0x574f11){if(_0x34c1c2['body']['id']){delete _0x34c1c2[_0x6484('0x73')]['id'];}return db[_0x6484('0x9d')][_0x6484('0x60')]({'where':{'id':_0x34c1c2[_0x6484('0xb6')]['id']}})[_0x6484('0x2b')](handleEntityNotFound(_0x574f11,null))['then'](saveUpdates(_0x34c1c2[_0x6484('0x73')],null))[_0x6484('0x2b')](respondWithResult(_0x574f11,null))[_0x6484('0x37')](handleError(_0x574f11,null));};exports['destroy']=function(_0xc0c3de,_0x12a6c5){return db[_0x6484('0x9d')]['find']({'where':{'id':_0xc0c3de['params']['id']}})[_0x6484('0x2b')](handleEntityNotFound(_0x12a6c5,null))['then'](removeEntity(_0x12a6c5,null))[_0x6484('0x37')](handleError(_0x12a6c5,null));};exports[_0x6484('0xbd')]=function(_0x394e2b,_0xcabc4f){return db[_0x6484('0x9d')][_0x6484('0xbd')]()[_0x6484('0x2b')](respondWithResult(_0xcabc4f,null))[_0x6484('0x37')](handleError(_0xcabc4f,null));};exports[_0x6484('0xbe')]=function(_0x4a73df,_0x47459a,_0x586928){return db[_0x6484('0xbf')][_0x6484('0x60')]({'where':{'id':_0x4a73df['params']['id']}})['then'](handleEntityNotFound(_0x47459a,null))['then'](function(_0x520fc7){if(_0x520fc7){return _0x520fc7[_0x6484('0xbe')](_0x4a73df[_0x6484('0x73')]['ids'],_[_0x6484('0xc0')](_0x4a73df['body'],['ids','id'])||{});}})[_0x6484('0x2b')](respondWithResult(_0x47459a,null))['catch'](handleError(_0x47459a,null));};exports['getMessages']=function(_0x3e6740,_0x11748a,_0x1fae07){var _0x99d1ce={'raw':![],'where':{}};var _0x289359={};var _0x2c9ee8={'count':0x0,'rows':[]};return db[_0x6484('0x9d')][_0x6484('0xc1')]({'where':{'id':_0x3e6740['params']['id']}})[_0x6484('0x2b')](handleEntityNotFound(_0x11748a,null))[_0x6484('0x2b')](function(_0x762878){if(_0x762878){_0x289359['model']=_['keys'](db[_0x6484('0xbf')][_0x6484('0xb7')]);_0x289359[_0x6484('0x3f')]=_['keys'](_0x3e6740[_0x6484('0x3f')]);_0x289359['filters']=_['intersection'](_0x289359['model'],_0x289359['query']);_0x99d1ce[_0x6484('0x40')]=_[_0x6484('0xb8')](_0x289359[_0x6484('0x3d')],qs[_0x6484('0x41')](_0x3e6740[_0x6484('0x3f')][_0x6484('0x41')]));_0x99d1ce[_0x6484('0x40')]=_0x99d1ce['attributes'][_0x6484('0x42')]?_0x99d1ce[_0x6484('0x40')]:_0x289359[_0x6484('0x3d')];if(!_0x3e6740['query']['hasOwnProperty']('nolimit')){_0x99d1ce[_0x6484('0x27')]=qs['limit'](_0x3e6740[_0x6484('0x3f')][_0x6484('0x27')]);_0x99d1ce[_0x6484('0x24')]=qs['offset'](_0x3e6740['query'][_0x6484('0x24')]);}_0x99d1ce[_0x6484('0x45')]=qs['sort'](_0x3e6740[_0x6484('0x3f')][_0x6484('0x46')]);_0x99d1ce['where']=qs['filters'](_[_0x6484('0x48')](_0x3e6740[_0x6484('0x3f')],_0x289359[_0x6484('0x3e')]));_0x99d1ce[_0x6484('0x47')][_0x6484('0xc2')]=_0x762878['id'];if(_0x3e6740[_0x6484('0x3f')][_0x6484('0x85')]){_0x99d1ce[_0x6484('0x47')]=_[_0x6484('0x9c')](_0x99d1ce[_0x6484('0x47')],{'$or':_[_0x6484('0x39')](_0x99d1ce[_0x6484('0x40')],function(_0x3c0455){var _0x3000de={};_0x3000de[_0x3c0455]={'$like':'%'+_0x3e6740[_0x6484('0x3f')]['filter']+'%'};return _0x3000de;})});}if(_0x3e6740[_0x6484('0x3f')][_0x6484('0x7d')]){var _0x1d8d67=_0x3e6740['query']['$gte'][_0x6484('0x35')](',');var _0x7d7194={};_0x7d7194[_0x1d8d67[0x0]]={'$gte':moment(_0x1d8d67[0x1])[_0x6484('0xc3')](_0x6484('0xc4'))};_0x99d1ce[_0x6484('0x47')]=_[_0x6484('0x9c')](_0x99d1ce[_0x6484('0x47')],_0x7d7194);}_0x99d1ce=_[_0x6484('0x9c')]({},_0x99d1ce,_0x3e6740[_0x6484('0xc5')]);return db[_0x6484('0xbf')][_0x6484('0x26')]({'where':_0x99d1ce['where']})[_0x6484('0x2b')](function(_0xae3044){_0x2c9ee8[_0x6484('0x26')]=_0xae3044;if(_0x3e6740['query']['includeAll']){_0x99d1ce[_0x6484('0xba')]=[{'all':!![]}];}return db[_0x6484('0xbf')][_0x6484('0xc6')](_0x99d1ce);})['then'](function(_0x57729d){_0x2c9ee8[_0x6484('0xb5')]=_0x57729d;return _0x2c9ee8;});}})[_0x6484('0x2b')](respondWithFilteredResult(_0x11748a,_0x99d1ce))[_0x6484('0x37')](handleError(_0x11748a,null));};exports[_0x6484('0xc7')]=function(_0x12a2f5,_0x5208dd,_0x1deedc){return db[_0x6484('0x9d')]['find']({'where':{'id':_0x12a2f5[_0x6484('0xb6')]['id']}})['then'](handleEntityNotFound(_0x5208dd,null))['then'](function(_0x2870b1){if(_0x2870b1){return _0x2870b1[_0x6484('0xc8')](_0x12a2f5[_0x6484('0x73')][_0x6484('0xc9')],_[_0x6484('0xc0')](_0x12a2f5['body'],['ids','id'])||{})[_0x6484('0xca')](function(){return db[_0x6484('0x6d')]['findAll']({'attributes':['id','name',_0x6484('0x4b')],'where':{'id':_0x12a2f5['body']['ids']}});})[_0x6484('0x2b')](function(_0x36ce76){socket[_0x6484('0xcb')](_0x6484('0xcc'),{'id':Number(_0x12a2f5[_0x6484('0xb6')]['id']),'tags':_0x36ce76||[]});return{'id':Number(_0x12a2f5[_0x6484('0xb6')]['id']),'tags':_0x36ce76||[]};});}})[_0x6484('0x2b')](respondWithResult(_0x5208dd,null))['catch'](handleError(_0x5208dd,null));};exports[_0x6484('0xcd')]=function(_0x303df9,_0x45a635,_0x11272a){return db[_0x6484('0x9d')][_0x6484('0x60')]({'where':{'id':_0x303df9[_0x6484('0xb6')]['id']}})['then'](handleEntityNotFound(_0x45a635,null))['then'](function(_0x47e0f5){if(_0x47e0f5){return _0x47e0f5[_0x6484('0xcd')](_0x303df9[_0x6484('0x3f')]['ids']);}})[_0x6484('0x2b')](respondWithStatusCode(_0x45a635,null))['catch'](handleError(_0x45a635,null));};exports['download']=function(_0x44910c,_0x16cad6){var _0x3a97fe=moment()[_0x6484('0xce')]()[_0x6484('0x9b')]();var _0x55ba18=path['join'](config[_0x6484('0xcf')],_0x6484('0xd0'),_0x6484('0xd1'),_0x6484('0xd2'));var _0x5d19e4=path[_0x6484('0xd3')](config[_0x6484('0xcf')],'server','files',_0x6484('0xd4'));var _0xc666c7=path['join'](_0x55ba18,_0x3a97fe);var _0x5bd2db=util[_0x6484('0xc3')](_0x6484('0xd5'),_0x44910c[_0x6484('0xb6')]['id'],_0x3a97fe);var _0x513363=path[_0x6484('0xd3')](_0x55ba18,_0x5bd2db);var _0x510ed=[];_0x510ed['push']({'model':db['User'],'as':_0x6484('0x6f'),'attributes':['id','fullname'],'raw':!![]});_0x510ed[_0x6484('0xb3')]({'model':db[_0x6484('0xd6')],'as':_0x6484('0x65'),'attributes':['id',_0x6484('0xd7'),_0x6484('0xd8')],'raw':!![]});if(_0x44910c[_0x6484('0x3f')]['attachments']){_0x510ed['push']({'model':db['Attachment'],'as':_0x6484('0xd9'),'raw':!![]});}var _0x950992=[{'model':db[_0x6484('0xbf')],'as':_0x6484('0xda'),'attributes':['id','body',_0x6484('0x7b'),_0x6484('0xdb'),_0x6484('0xdc'),'read'],'include':_0x510ed}];_0x950992['push']({'model':db['OpenchannelAccount'],'as':'Account','attributes':['id',_0x6484('0x30')]});_0x950992[_0x6484('0xb3')]({'model':db[_0x6484('0x6f')],'as':_0x6484('0xdd'),'attributes':['id',_0x6484('0xde')]});return db[_0x6484('0x9d')][_0x6484('0x60')]({'where':{'id':_0x44910c[_0x6484('0xb6')]['id']},'include':_0x950992})[_0x6484('0x2b')](handleEntityNotFound(_0x16cad6,null))[_0x6484('0x2b')](function(_0x537572){if(_0x537572){var _0xabfa4=_0x537572[_0x6484('0xdf')]({'plain':!![]});fs[_0x6484('0xe0')](_0xc666c7);var _0x5ec851={'channel':'Openchannel','account':_0xabfa4[_0x6484('0xe1')]['name'],'agent':_0xabfa4[_0x6484('0xdd')]?_0xabfa4[_0x6484('0xdd')]['fullname']:'N.A.','createdAt':moment(_0xabfa4[_0x6484('0x7b')])['format'](_0x6484('0xc4'))['toString'](),'closedAt':_0xabfa4['closed']?moment(_0xabfa4[_0x6484('0xe2')])[_0x6484('0xc3')](_0x6484('0xc4'))['toString']():'','disposition':_0xabfa4[_0x6484('0xe3')],'visibility':_0xabfa4[_0x6484('0xe4')]?'Public':_0x6484('0xe5'),'messages':_(_0xabfa4[_0x6484('0xda')])[_0x6484('0x85')]({'secret':![]})['map'](function(_0x572dd4){if(_0x572dd4['Attachment']){var _0x58d584=path[_0x6484('0xd3')](_0x5d19e4,_0x572dd4['Attachment'][_0x6484('0xe6')]);if(fs[_0x6484('0xe7')](_0x58d584)){fs[_0x6484('0xe8')](_0x58d584)[_0x6484('0xe9')](fs[_0x6484('0xea')](path[_0x6484('0xd3')](_0xc666c7,_0x572dd4['Attachment'][_0x6484('0xe6')])));}}return{'date':moment(_0x572dd4[_0x6484('0x7b')])[_0x6484('0xc3')]('YYYY-MM-DD\x20HH:mm:ss')[_0x6484('0x9b')](),'sender':_0x572dd4[_0x6484('0xdb')]===_0x6484('0xeb')?_0x572dd4[_0x6484('0x6f')]?_0x572dd4['User']['fullname']:_0x6484('0xec'):_0x572dd4[_0x6484('0x65')]['firstName']+(_0x572dd4['Contact'][_0x6484('0xd8')]?'\x20'+_0x572dd4[_0x6484('0x65')]['lastName']:''),'body':_0x572dd4[_0x6484('0xd9')]?_0x572dd4[_0x6484('0xd9')]['basename']:_0x572dd4[_0x6484('0x73')],'direction':_0x572dd4['direction']==='out'?'A':'C','secret':_0x572dd4[_0x6484('0xdc')],'read':_0x572dd4['read'],'attachment':_0x572dd4[_0x6484('0xd9')]};})[_0x6484('0x61')]()};return ejs[_0x6484('0xed')](path[_0x6484('0xd3')](config['root'],_0x6484('0xd0'),_0x6484('0xee'),'downloadInteraction.ejs'),{'interaction':_0x5ec851})[_0x6484('0x2b')](function(_0x133463){var _0x47a7b5=path[_0x6484('0xd3')](_0xc666c7,'transcript-'+_0xabfa4['id']+'-'+_0x3a97fe+_0x6484('0xef'));var _0x548847={'path':_0x47a7b5,'channel':_0x6484('0xf0'),'interactionId':_0xabfa4['id']};return pdf['createPdfFromHTML'](_0x133463,_0x548847);})[_0x6484('0x2b')](function(){return new BPromise(function(_0x1cb0a6,_0x7b10d){zipdir(_0xc666c7,{'saveTo':_0x513363},function(_0x6e8f3d,_0x544497){if(_0x6e8f3d)return _0x7b10d(_0x6e8f3d);return _0x1cb0a6(_0x544497);});})[_0x6484('0x2b')](function(){return new BPromise(function(_0x523a1a,_0x2f0c91){rimraf(_0xc666c7,function(_0x3014c0){if(_0x3014c0)_0x2f0c91(_0x3014c0);return _0x523a1a();});});})[_0x6484('0x2b')](function(){return _0x16cad6[_0x6484('0xf1')](_0x513363,_0x5bd2db,function(_0x1895bc){if(_0x1895bc){console[_0x6484('0xf2')](_0x6484('0xf3'),_0x1895bc);}else{fs['unlinkSync'](_0x513363);}});});});}else{return _0x16cad6[_0x6484('0x21')](0xc8);}})[_0x6484('0x37')](handleError(_0x16cad6,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index da2729f..69f0311 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 _0x2ae7=['events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','update','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hook','exports'];(function(_0x2adb04,_0x4d4356){var _0x3c1bca=function(_0x5e3b88){while(--_0x5e3b88){_0x2adb04['push'](_0x2adb04['shift']());}};_0x3c1bca(++_0x4d4356);}(_0x2ae7,0x1f0));var _0x72ae=function(_0xd506ba,_0x3fef95){_0xd506ba=_0xd506ba-0x0;var _0x45f1e1=_0x2ae7[_0xd506ba];return _0x45f1e1;};'use strict';var EventEmitter=require(_0x72ae('0x0'));var OpenchannelInteraction=require(_0x72ae('0x1'))['db'][_0x72ae('0x2')];var OpenchannelMessage=require(_0x72ae('0x1'))['db'][_0x72ae('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x72ae('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x72ae('0x5'),'afterDestroy':'remove'};function emitEvent(_0x17796a){return function(_0x4357a9,_0x1eb55a,_0x525cbf){_0x4357a9['getUsers']({'attributes':['id'],'raw':!![]})[_0x72ae('0x6')](function(_0x31c1db){_0x4357a9[_0x72ae('0x7')](_0x72ae('0x8'),_0x31c1db[_0x72ae('0x9')](function(_0x914038){return{'id':_0x914038['id']};}));return OpenchannelMessage[_0x72ae('0xa')]({'where':{'OpenchannelInteractionId':_0x4357a9['id'],'direction':'in','read':![]},'raw':!![]});})[_0x72ae('0x6')](function(_0x83df0e){_0x4357a9[_0x72ae('0x7')](_0x72ae('0xb'),_0x83df0e['length']);OpenchannelInteractionEvents[_0x72ae('0xc')](_0x17796a+':'+_0x4357a9['id'],_0x4357a9);OpenchannelInteractionEvents[_0x72ae('0xc')](_0x17796a,_0x4357a9);_0x525cbf(null);})[_0x72ae('0xd')](_0x525cbf(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x72ae('0xe')](e,emitEvent(event));}}module[_0x72ae('0xf')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x6b3e=['hook','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x13c75c,_0x2d07e4){var _0x2c687e=function(_0x33c87a){while(--_0x33c87a){_0x13c75c['push'](_0x13c75c['shift']());}};_0x2c687e(++_0x2d07e4);}(_0x6b3e,0x1b7));var _0xe6b3=function(_0x2e9fb8,_0x32ce3a){_0x2e9fb8=_0x2e9fb8-0x0;var _0x4b1f24=_0x6b3e[_0x2e9fb8];return _0x4b1f24;};'use strict';var EventEmitter=require(_0xe6b3('0x0'));var OpenchannelInteraction=require(_0xe6b3('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0xe6b3('0x1'))['db'][_0xe6b3('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xe6b3('0x3')](0x0);var events={'afterCreate':_0xe6b3('0x4'),'afterUpdate':'update','afterDestroy':_0xe6b3('0x5')};function emitEvent(_0x3c6012){return function(_0x221164,_0x139213,_0x18209d){_0x221164[_0xe6b3('0x6')]({'attributes':['id'],'raw':!![]})[_0xe6b3('0x7')](function(_0x286fd1){_0x221164[_0xe6b3('0x8')](_0xe6b3('0x9'),_0x286fd1[_0xe6b3('0xa')](function(_0xf6b080){return{'id':_0xf6b080['id']};}));return OpenchannelMessage[_0xe6b3('0xb')]({'where':{'OpenchannelInteractionId':_0x221164['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe6b3('0x7')](function(_0x4ede5f){_0x221164[_0xe6b3('0x8')](_0xe6b3('0xc'),_0x4ede5f[_0xe6b3('0xd')]);OpenchannelInteractionEvents[_0xe6b3('0xe')](_0x3c6012+':'+_0x221164['id'],_0x221164);OpenchannelInteractionEvents[_0xe6b3('0xe')](_0x3c6012,_0x221164);_0x18209d(null);})[_0xe6b3('0xf')](_0x18209d(null));};}for(var e in events){if(events[_0xe6b3('0x10')](e)){var event=events[e];OpenchannelInteraction[_0xe6b3('0x11')](e,emitEvent(event));}}module[_0xe6b3('0x12')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index bbd1b93..d6d3913 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 _0xcea0=['OpenchannelInteraction','openchannel_interactions','utf8mb4','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelInteraction.attributes','exports'];(function(_0x3bf4a4,_0x51c2b1){var _0x592a68=function(_0x4db027){while(--_0x4db027){_0x3bf4a4['push'](_0x3bf4a4['shift']());}};_0x592a68(++_0x51c2b1);}(_0xcea0,0x194));var _0x0cea=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xcea0[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0x0cea('0x0'));var util=require(_0x0cea('0x1'));var logger=require(_0x0cea('0x2'))('api');var moment=require(_0x0cea('0x3'));var BPromise=require(_0x0cea('0x4'));var rp=require(_0x0cea('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0cea('0x6'));var config=require(_0x0cea('0x7'));var attributes=require(_0x0cea('0x8'));module[_0x0cea('0x9')]=function(_0x35dbd8,_0x5bffbf){return _0x35dbd8['define'](_0x0cea('0xa'),attributes,{'tableName':_0x0cea('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0cea('0xc'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x2ef215,_0x341ee8,_0x4a525f){if(_0x2ef215[_0x0cea('0xd')](_0x0cea('0xe'))){_0x2ef215[_0x0cea('0xf')]=moment()[_0x0cea('0x10')](_0x0cea('0x11'));}_0x4a525f(null,_0x2ef215);}}});}; \ No newline at end of file +var _0x434f=['OpenchannelInteraction','utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./openchannelInteraction.attributes','exports','define'];(function(_0x56d3cf,_0x20787b){var _0x5881e6=function(_0x2bd2cc){while(--_0x2bd2cc){_0x56d3cf['push'](_0x56d3cf['shift']());}};_0x5881e6(++_0x20787b);}(_0x434f,0x8d));var _0xf434=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x434f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xf434('0x0'));var util=require(_0xf434('0x1'));var logger=require(_0xf434('0x2'))(_0xf434('0x3'));var moment=require(_0xf434('0x4'));var BPromise=require(_0xf434('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf434('0x6'));var rimraf=require('rimraf');var config=require(_0xf434('0x7'));var attributes=require(_0xf434('0x8'));module[_0xf434('0x9')]=function(_0x3270ce,_0x343c74){return _0x3270ce[_0xf434('0xa')](_0xf434('0xb'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf434('0xc'),'collate':_0xf434('0xd'),'hooks':{'beforeUpdate':function(_0x565b56,_0x29e8fd,_0x352d2c){if(_0x565b56[_0xf434('0xe')](_0xf434('0xf'))){_0x565b56[_0xf434('0x10')]=moment()[_0xf434('0x11')](_0xf434('0x12'));}_0x352d2c(null,_0x565b56);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index a9aa125..f441410 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 _0x9d9e=['defaults','localhost','./openchannelInteraction.socket','register','then','request\x20sent','debug','error','code','message','OpenchannelInteraction,\x20%s,\x20%s','info','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','options','raw','where','attributes','limit','stringify','AddTagsToOpenchannelInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis'];(function(_0x5da63e,_0x4d3503){var _0x442aca=function(_0x6d5bca){while(--_0x6d5bca){_0x5da63e['push'](_0x5da63e['shift']());}};_0x442aca(++_0x4d3503);}(_0x9d9e,0x9f));var _0xe9d9=function(_0x1fd2e6,_0x319411){_0x1fd2e6=_0x1fd2e6-0x0;var _0x38284b=_0x9d9e[_0x1fd2e6];return _0x38284b;};'use strict';var _=require(_0xe9d9('0x0'));var util=require(_0xe9d9('0x1'));var moment=require(_0xe9d9('0x2'));var BPromise=require(_0xe9d9('0x3'));var rs=require(_0xe9d9('0x4'));var fs=require('fs');var Redis=require(_0xe9d9('0x5'));var db=require(_0xe9d9('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe9d9('0x7'))(_0xe9d9('0x8'));var config=require('../../config/environment');var jayson=require(_0xe9d9('0x9'));var client=jayson[_0xe9d9('0xa')][_0xe9d9('0xb')]({'port':0x232a});config[_0xe9d9('0xc')]=_[_0xe9d9('0xd')](config['redis'],{'host':_0xe9d9('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe9d9('0xf'))[_0xe9d9('0x10')](socket);function respondWithRpcPromise(_0x18a520,_0xf7222a,_0x206a19){return new BPromise(function(_0x304753,_0x5c5998){return client['request'](_0x18a520,_0x206a19)[_0xe9d9('0x11')](function(_0xbf932f){logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0xf7222a,_0xe9d9('0x12'));logger[_0xe9d9('0x13')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0xf7222a,_0xe9d9('0x12'),JSON['stringify'](_0xbf932f));if(_0xbf932f[_0xe9d9('0x14')]){if(_0xbf932f[_0xe9d9('0x14')][_0xe9d9('0x15')]===0x1f4){logger[_0xe9d9('0x14')]('OpenchannelInteraction,\x20%s,\x20%s',_0xf7222a,_0xbf932f[_0xe9d9('0x14')][_0xe9d9('0x16')]);return _0x5c5998(_0xbf932f[_0xe9d9('0x14')][_0xe9d9('0x16')]);}logger[_0xe9d9('0x14')](_0xe9d9('0x17'),_0xf7222a,_0xbf932f[_0xe9d9('0x14')]['message']);return _0x304753(_0xbf932f['error'][_0xe9d9('0x16')]);}else{logger[_0xe9d9('0x18')]('OpenchannelInteraction,\x20%s,\x20%s',_0xf7222a,'request\x20sent');_0x304753(_0xbf932f['result'][_0xe9d9('0x16')]);}})[_0xe9d9('0x19')](function(_0x4e7254){logger['error'](_0xe9d9('0x17'),_0xf7222a,_0x4e7254);_0x5c5998(_0x4e7254);});});}exports[_0xe9d9('0x1a')]=function(_0x446c90){var _0x4a8a7e=this;return new Promise(function(_0x5c69e9,_0x169d90){return db[_0xe9d9('0x1b')][_0xe9d9('0x1c')](_0x446c90['body'],{'raw':_0x446c90['options']?_0x446c90[_0xe9d9('0x1d')][_0xe9d9('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x446c90[_0xe9d9('0x1d')]?_0x446c90[_0xe9d9('0x1d')][_0xe9d9('0x1f')]||null:null,'attributes':_0x446c90[_0xe9d9('0x1d')]?_0x446c90[_0xe9d9('0x1d')][_0xe9d9('0x20')]||null:null,'limit':_0x446c90['options']?_0x446c90[_0xe9d9('0x1d')][_0xe9d9('0x21')]||null:null})[_0xe9d9('0x11')](function(_0x5bbf66){logger[_0xe9d9('0x18')]('UpdateOpenchannelInteraction',_0x446c90);logger[_0xe9d9('0x13')](_0xe9d9('0x1a'),_0x446c90,JSON[_0xe9d9('0x22')](_0x5bbf66));_0x5c69e9(_0x5bbf66);})[_0xe9d9('0x19')](function(_0x5b49dc){logger['error'](_0xe9d9('0x1a'),_0x5b49dc['message'],_0x446c90);_0x169d90(_0x4a8a7e[_0xe9d9('0x14')](0x1f4,_0x5b49dc[_0xe9d9('0x16')]));});});};exports[_0xe9d9('0x23')]=function(_0x5c6e56){return new Promise(function(_0x57bdd1,_0x524419){return db[_0xe9d9('0x1b')][_0xe9d9('0x24')]({'where':_0x5c6e56[_0xe9d9('0x1d')]?_0x5c6e56[_0xe9d9('0x1d')][_0xe9d9('0x1f')]||null:null})[_0xe9d9('0x11')](function(_0x4ba77d){if(_0x4ba77d){return _0x4ba77d[_0xe9d9('0x25')](_0x5c6e56[_0xe9d9('0x26')][_0xe9d9('0x27')],_[_0xe9d9('0x28')](_0x5c6e56[_0xe9d9('0x26')],[_0xe9d9('0x27'),'id'])||{});}})[_0xe9d9('0x29')](function(_0x115a03){logger[_0xe9d9('0x18')](_0xe9d9('0x2a'),_0x5c6e56);logger[_0xe9d9('0x13')]('AddTags',_0x5c6e56,JSON[_0xe9d9('0x22')](_0x115a03));_0x57bdd1(_0x115a03);})[_0xe9d9('0x19')](function(_0x2cd14d){logger[_0xe9d9('0x14')](_0xe9d9('0x2a'),_0x2cd14d[_0xe9d9('0x16')],_0x5c6e56);_0x524419(_this['error'](0x1f4,_0x2cd14d[_0xe9d9('0x16')]));});});}; \ No newline at end of file +var _0x17f6=['../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','request','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','attributes','limit','then','ids','spread','AddTags','lodash','util','moment','bluebird','ioredis'];(function(_0x5eb8e4,_0x444a78){var _0xb46a21=function(_0x5bd8b2){while(--_0x5bd8b2){_0x5eb8e4['push'](_0x5eb8e4['shift']());}};_0xb46a21(++_0x444a78);}(_0x17f6,0x177));var _0x617f=function(_0x42716d,_0x56071f){_0x42716d=_0x42716d-0x0;var _0x57e0a1=_0x17f6[_0x42716d];return _0x57e0a1;};'use strict';var _=require(_0x617f('0x0'));var util=require(_0x617f('0x1'));var moment=require(_0x617f('0x2'));var BPromise=require(_0x617f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x617f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x617f('0x5'));var logger=require(_0x617f('0x6'))(_0x617f('0x7'));var config=require(_0x617f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x617f('0x9')]['http']({'port':0x232a});config[_0x617f('0xa')]=_[_0x617f('0xb')](config[_0x617f('0xa')],{'host':_0x617f('0xc'),'port':0x18eb});var socket=require(_0x617f('0xd'))(new Redis(config[_0x617f('0xa')]));require(_0x617f('0xe'))['register'](socket);function respondWithRpcPromise(_0xfb21b0,_0x3aa298,_0x142887){return new BPromise(function(_0x106f0a,_0x2b9a46){return client[_0x617f('0xf')](_0xfb21b0,_0x142887)['then'](function(_0x13455e){logger[_0x617f('0x10')](_0x617f('0x11'),_0x3aa298,_0x617f('0x12'));logger[_0x617f('0x13')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x3aa298,_0x617f('0x12'),JSON[_0x617f('0x14')](_0x13455e));if(_0x13455e['error']){if(_0x13455e[_0x617f('0x15')]['code']===0x1f4){logger[_0x617f('0x15')](_0x617f('0x11'),_0x3aa298,_0x13455e[_0x617f('0x15')]['message']);return _0x2b9a46(_0x13455e[_0x617f('0x15')][_0x617f('0x16')]);}logger['error'](_0x617f('0x11'),_0x3aa298,_0x13455e[_0x617f('0x15')][_0x617f('0x16')]);return _0x106f0a(_0x13455e[_0x617f('0x15')][_0x617f('0x16')]);}else{logger[_0x617f('0x10')](_0x617f('0x11'),_0x3aa298,_0x617f('0x12'));_0x106f0a(_0x13455e[_0x617f('0x17')][_0x617f('0x16')]);}})[_0x617f('0x18')](function(_0x33d028){logger[_0x617f('0x15')](_0x617f('0x11'),_0x3aa298,_0x33d028);_0x2b9a46(_0x33d028);});});}exports[_0x617f('0x19')]=function(_0x1cbae0){var _0x448a15=this;return new Promise(function(_0x1d53e3,_0x40747e){return db[_0x617f('0x1a')][_0x617f('0x1b')](_0x1cbae0[_0x617f('0x1c')],{'raw':_0x1cbae0[_0x617f('0x1d')]?_0x1cbae0[_0x617f('0x1d')][_0x617f('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1cbae0['options']?_0x1cbae0[_0x617f('0x1d')][_0x617f('0x1f')]||null:null,'attributes':_0x1cbae0[_0x617f('0x1d')]?_0x1cbae0[_0x617f('0x1d')][_0x617f('0x20')]||null:null,'limit':_0x1cbae0['options']?_0x1cbae0[_0x617f('0x1d')][_0x617f('0x21')]||null:null})[_0x617f('0x22')](function(_0x199b57){logger['info']('UpdateOpenchannelInteraction',_0x1cbae0);logger[_0x617f('0x13')](_0x617f('0x19'),_0x1cbae0,JSON['stringify'](_0x199b57));_0x1d53e3(_0x199b57);})['catch'](function(_0x4a8846){logger[_0x617f('0x15')]('UpdateOpenchannelInteraction',_0x4a8846['message'],_0x1cbae0);_0x40747e(_0x448a15[_0x617f('0x15')](0x1f4,_0x4a8846[_0x617f('0x16')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x187f97){return new Promise(function(_0x236741,_0x1e4dbc){return db['OpenchannelInteraction']['find']({'where':_0x187f97[_0x617f('0x1d')]?_0x187f97[_0x617f('0x1d')]['where']||null:null})['then'](function(_0x456e9b){if(_0x456e9b){return _0x456e9b['addTags'](_0x187f97[_0x617f('0x1c')][_0x617f('0x23')],_['omit'](_0x187f97[_0x617f('0x1c')],[_0x617f('0x23'),'id'])||{});}})[_0x617f('0x24')](function(_0x23024b){logger[_0x617f('0x10')](_0x617f('0x25'),_0x187f97);logger[_0x617f('0x13')](_0x617f('0x25'),_0x187f97,JSON[_0x617f('0x14')](_0x23024b));_0x236741(_0x23024b);})[_0x617f('0x18')](function(_0x359934){logger[_0x617f('0x15')]('AddTags',_0x359934[_0x617f('0x16')],_0x187f97);_0x1e4dbc(_this['error'](0x1f4,_0x359934[_0x617f('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 8bb3d99..22d3c9a 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 _0xa51a=['./openchannelInteraction.events','save','remove','emit','removeListener','length'];(function(_0xd76c0,_0xd6d52){var _0x2a2671=function(_0x31ee1c){while(--_0x31ee1c){_0xd76c0['push'](_0xd76c0['shift']());}};_0x2a2671(++_0xd6d52);}(_0xa51a,0x14a));var _0xaa51=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0xa51a[_0x1e3c16];return _0x47a0c9;};'use strict';var OpenchannelInteractionEvents=require(_0xaa51('0x0'));var events=[_0xaa51('0x1'),_0xaa51('0x2'),'update'];function createListener(_0x4da64c,_0x324a24){return function(_0x545d57){_0x324a24[_0xaa51('0x3')](_0x4da64c,_0x545d57);};}function removeListener(_0x326547,_0x387dea){return function(){OpenchannelInteractionEvents[_0xaa51('0x4')](_0x326547,_0x387dea);};}exports['register']=function(_0x2f1947){for(var _0x3b2118=0x0,_0x39320b=events[_0xaa51('0x5')];_0x3b2118<_0x39320b;_0x3b2118++){var _0x38d178=events[_0x3b2118];var _0x2c6913=createListener('openchannelInteraction:'+_0x38d178,_0x2f1947);OpenchannelInteractionEvents['on'](_0x38d178,_0x2c6913);}}; \ No newline at end of file +var _0xf2c1=['update','emit','removeListener','register','openchannelInteraction:','./openchannelInteraction.events','save'];(function(_0x2b152a,_0x3dd988){var _0x2ad4c7=function(_0x2fa97c){while(--_0x2fa97c){_0x2b152a['push'](_0x2b152a['shift']());}};_0x2ad4c7(++_0x3dd988);}(_0xf2c1,0x1da));var _0x1f2c=function(_0x50209b,_0x4cf1df){_0x50209b=_0x50209b-0x0;var _0x3693d8=_0xf2c1[_0x50209b];return _0x3693d8;};'use strict';var OpenchannelInteractionEvents=require(_0x1f2c('0x0'));var events=[_0x1f2c('0x1'),'remove',_0x1f2c('0x2')];function createListener(_0x3fd505,_0x564f16){return function(_0x4c585d){_0x564f16[_0x1f2c('0x3')](_0x3fd505,_0x4c585d);};}function removeListener(_0x4351a4,_0x19e50f){return function(){OpenchannelInteractionEvents[_0x1f2c('0x4')](_0x4351a4,_0x19e50f);};}exports[_0x1f2c('0x5')]=function(_0x33b062){for(var _0x4ef78e=0x0,_0x520875=events['length'];_0x4ef78e<_0x520875;_0x4ef78e++){var _0x205485=events[_0x4ef78e];var _0x2daa2b=createListener(_0x1f2c('0x6')+_0x205485,_0x33b062);OpenchannelInteractionEvents['on'](_0x205485,_0x2daa2b);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index da54985..9d812fa 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','create','update','put','/:id/accept','accept','/:id/reject','exports','multer','util','path','express','Router'];(function(_0x13a7a2,_0x28589a){var _0x3e6e0a=function(_0x63de6f){while(--_0x63de6f){_0x13a7a2['push'](_0x13a7a2['shift']());}};_0x3e6e0a(++_0x28589a);}(_0xe706,0xa3));var _0x6e70=function(_0x56d591,_0x3191a3){_0x56d591=_0x56d591-0x0;var _0x4bf0ff=_0xe706[_0x56d591];return _0x4bf0ff;};'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')](),interaction[_0x6e70('0x12')](_0x6e70('0x13'),_0x6e70('0x14')),controller[_0x6e70('0x15')]);router['put']('/:id',auth[_0x6e70('0xb')](),controller[_0x6e70('0x16')]);router[_0x6e70('0x17')](_0x6e70('0x18'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x19')]);router[_0x6e70('0x17')](_0x6e70('0x1a'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0x6e70('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x6e70('0x1b')]=router; \ No newline at end of file +var _0x0713=['get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','openchannelmessage:create','put','update','accept','/:id/reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelMessage.controller'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),interaction[_0x3071('0xf')](_0x3071('0x10'),_0x3071('0x11')),controller['create']);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);router[_0x3071('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x3071('0x14')]);router['put'](_0x3071('0x15'),auth[_0x3071('0x9')](),controller['reject']);router[_0x3071('0x16')]('/:id',auth[_0x3071('0x9')](),controller[_0x3071('0x17')]);module[_0x3071('0x18')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index df58b83..d9ff922 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 _0x63c6=['DATE','STRING','TEXT','sequelize','exports','BOOLEAN','ENUM','out'];(function(_0x50b2d4,_0x26874c){var _0x42f56b=function(_0x3c8190){while(--_0x3c8190){_0x50b2d4['push'](_0x50b2d4['shift']());}};_0x42f56b(++_0x26874c);}(_0x63c6,0xbb));var _0x663c=function(_0x58af75,_0x1a6a22){_0x58af75=_0x58af75-0x0;var _0x32a5ad=_0x63c6[_0x58af75];return _0x32a5ad;};'use strict';var Sequelize=require(_0x663c('0x0'));module[_0x663c('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x663c('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x663c('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x663c('0x3')]('in',_0x663c('0x4')),'defaultValue':_0x663c('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x663c('0x5')]},'providerName':{'type':Sequelize[_0x663c('0x6')]},'providerResponse':{'type':Sequelize[_0x663c('0x7')]}}; \ No newline at end of file +var _0x6947=['STRING','TEXT','exports','medium','BOOLEAN','ENUM','DATE'];(function(_0x179e11,_0xf65436){var _0x549f04=function(_0x610545){while(--_0x610545){_0x179e11['push'](_0x179e11['shift']());}};_0x549f04(++_0xf65436);}(_0x6947,0x72));var _0x7694=function(_0x4abf9d,_0x37ae2b){_0x4abf9d=_0x4abf9d-0x0;var _0x86c381=_0x6947[_0x4abf9d];return _0x86c381;};'use strict';var Sequelize=require('sequelize');module[_0x7694('0x0')]={'body':{'type':Sequelize['TEXT'](_0x7694('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x7694('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x7694('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7694('0x3')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x7694('0x4')]},'providerName':{'type':Sequelize[_0x7694('0x5')]},'providerResponse':{'type':Sequelize[_0x7694('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 737d1d2..39d4a59 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 _0x4469=['findAll','rows','show','params','rawAttributes','include','merge','create','body','find','destroy','describe','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','Sequelize','QueryTypes','SELECT','contact','agent','fullname','internal','interface','SIP/%s','channel','EventManager','openchannel-interactions','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','User','email','rejectmessage','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','stack','name','send','index','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','map','OpenchannelMessage','includeAll'];(function(_0x1df79c,_0x5ad8fd){var _0x2f23e4=function(_0x47836f){while(--_0x47836f){_0x1df79c['push'](_0x1df79c['shift']());}};_0x2f23e4(++_0x5ad8fd);}(_0x4469,0xb6));var _0x9446=function(_0x160e74,_0x297331){_0x160e74=_0x160e74-0x0;var _0x35aef7=_0x4469[_0x160e74];return _0x35aef7;};'use strict';var emlformat=require(_0x9446('0x0'));var rimraf=require(_0x9446('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9446('0x2'));var rp=require(_0x9446('0x3'));var moment=require(_0x9446('0x4'));var BPromise=require(_0x9446('0x5'));var Mustache=require(_0x9446('0x6'));var util=require('util');var path=require(_0x9446('0x7'));var sox=require('sox');var csv=require(_0x9446('0x8'));var ejs=require(_0x9446('0x9'));var fs=require('fs');var fs_extra=require(_0x9446('0xa'));var _=require(_0x9446('0xb'));var squel=require(_0x9446('0xc'));var crypto=require(_0x9446('0xd'));var jsforce=require(_0x9446('0xe'));var deskjs=require(_0x9446('0xf'));var toCsv=require(_0x9446('0x8'));var querystring=require(_0x9446('0x10'));var Papa=require('papaparse');var Redis=require(_0x9446('0x11'));var authService=require(_0x9446('0x12'));var qs=require(_0x9446('0x13'));var as=require(_0x9446('0x14'));var hardwareService=require(_0x9446('0x15'));var logger=require(_0x9446('0x16'))(_0x9446('0x17'));var utils=require('../../config/utils');var config=require(_0x9446('0x18'));var licenseUtil=require(_0x9446('0x19'));var db=require(_0x9446('0x1a'))['db'];config['redis']=_['defaults'](config[_0x9446('0x1b')],{'host':_0x9446('0x1c'),'port':0x18eb});var socket=require(_0x9446('0x1d'))(new Redis(config['redis']));require(_0x9446('0x1e'))[_0x9446('0x1f')](socket);var jayson=require(_0x9446('0x20'));var client=jayson[_0x9446('0x21')][_0x9446('0x22')]({'port':0x232c});var client9002=jayson[_0x9446('0x21')][_0x9446('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x50ab8b,_0x40a8ab,_0x15e226,_0x1f767b){return new BPromise(function(_0x61f0ab,_0x3a4620){var _0x4b625c=_0x1f767b||client;return _0x4b625c[_0x9446('0x23')](_0x50ab8b,_0x15e226)['then'](function(_0x1b1d05){logger[_0x9446('0x24')](_0x9446('0x25'),_0x40a8ab,_0x9446('0x26'));logger[_0x9446('0x27')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x40a8ab,_0x9446('0x26'),JSON[_0x9446('0x28')](_0x1b1d05));if(_0x1b1d05[_0x9446('0x29')]){if(_0x1b1d05[_0x9446('0x29')][_0x9446('0x2a')]===0x1f4){logger[_0x9446('0x29')](_0x9446('0x25'),_0x40a8ab,_0x1b1d05[_0x9446('0x29')][_0x9446('0x2b')]);return _0x3a4620(_0x1b1d05[_0x9446('0x29')]['message']);}logger[_0x9446('0x29')](_0x9446('0x25'),_0x40a8ab,_0x1b1d05[_0x9446('0x29')]['message']);return _0x61f0ab(_0x1b1d05[_0x9446('0x29')]['message']);}else{logger[_0x9446('0x24')](_0x9446('0x25'),_0x40a8ab,'request\x20sent');_0x61f0ab(_0x1b1d05['result'][_0x9446('0x2b')]);}})[_0x9446('0x2c')](function(_0x2ed984){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x40a8ab,_0x2ed984);_0x3a4620(_0x2ed984);});});}function respondWithStatusCode(_0x1be315,_0x20403d){_0x20403d=_0x20403d||0xcc;return function(_0x49a15a){if(_0x49a15a){return _0x1be315['sendStatus'](_0x20403d);}return _0x1be315[_0x9446('0x2d')](_0x20403d)[_0x9446('0x2e')]();};}function respondWithResult(_0x3da6dc,_0x36a7b9){_0x36a7b9=_0x36a7b9||0xc8;return function(_0x425a62){if(_0x425a62){return _0x3da6dc['status'](_0x36a7b9)[_0x9446('0x2f')](_0x425a62);}};}function respondWithFilteredResult(_0x426aa6,_0x2101ac){return function(_0x5d1400){if(_0x5d1400){var _0x1695e0=typeof _0x2101ac['offset']===_0x9446('0x30')&&typeof _0x2101ac[_0x9446('0x31')]===_0x9446('0x30');var _0x27b656=_0x5d1400[_0x9446('0x32')];var _0x58cd0d=_0x1695e0?0x0:_0x2101ac[_0x9446('0x33')];var _0x681add=_0x1695e0?_0x5d1400[_0x9446('0x32')]:_0x2101ac[_0x9446('0x33')]+_0x2101ac[_0x9446('0x31')];var _0x4517c2;if(_0x681add>=_0x27b656){_0x681add=_0x27b656;_0x4517c2=0xc8;}else{_0x4517c2=0xce;}_0x426aa6['status'](_0x4517c2);return _0x426aa6['set'](_0x9446('0x34'),_0x58cd0d+'-'+_0x681add+'/'+_0x27b656)[_0x9446('0x2f')](_0x5d1400);}return null;};}function patchUpdates(_0x217608){return function(_0x5f134d){try{jsonpatch[_0x9446('0x35')](_0x5f134d,_0x217608,!![]);}catch(_0x75adc3){return BPromise[_0x9446('0x36')](_0x75adc3);}return _0x5f134d[_0x9446('0x37')]();};}function saveUpdates(_0x364eab,_0x358298){return function(_0x2ff64a){if(_0x2ff64a){return _0x2ff64a[_0x9446('0x38')](_0x364eab)[_0x9446('0x39')](function(_0x3df8b6){return _0x3df8b6;});}return null;};}function removeEntity(_0x1f8f87,_0x1e5f1b){return function(_0x38bcc1){if(_0x38bcc1){return _0x38bcc1['destroy']()[_0x9446('0x39')](function(){_0x1f8f87[_0x9446('0x2d')](0xcc)[_0x9446('0x2e')]();});}};}function handleEntityNotFound(_0x2a12fc,_0x588af6){return function(_0x4d3f24){if(!_0x4d3f24){_0x2a12fc['sendStatus'](0x194);}return _0x4d3f24;};}function handleError(_0x544490,_0x53fb80){_0x53fb80=_0x53fb80||0x1f4;return function(_0x4f738b){logger[_0x9446('0x29')](_0x4f738b[_0x9446('0x3a')]);if(_0x4f738b[_0x9446('0x3b')]){delete _0x4f738b[_0x9446('0x3b')];}_0x544490['status'](_0x53fb80)[_0x9446('0x3c')](_0x4f738b);};}exports[_0x9446('0x3d')]=function(_0x459c4c,_0x2a88b6){var _0x15c291={},_0x5e7467={},_0x489dcb={'count':0x0,'rows':[]};var _0x1eb86c=_['map'](db['OpenchannelMessage']['rawAttributes'],function(_0x13a110){return{'name':_0x13a110[_0x9446('0x3e')],'type':_0x13a110[_0x9446('0x3f')][_0x9446('0x40')]};});_0x5e7467['model']=_['map'](_0x1eb86c,_0x9446('0x3b'));_0x5e7467[_0x9446('0x41')]=_[_0x9446('0x42')](_0x459c4c[_0x9446('0x41')]);_0x5e7467[_0x9446('0x43')]=_[_0x9446('0x44')](_0x5e7467[_0x9446('0x45')],_0x5e7467['query']);_0x15c291[_0x9446('0x46')]=_['intersection'](_0x5e7467[_0x9446('0x45')],qs[_0x9446('0x47')](_0x459c4c[_0x9446('0x41')][_0x9446('0x47')]));_0x15c291[_0x9446('0x46')]=_0x15c291[_0x9446('0x46')][_0x9446('0x48')]?_0x15c291[_0x9446('0x46')]:_0x5e7467[_0x9446('0x45')];if(!_0x459c4c[_0x9446('0x41')][_0x9446('0x49')](_0x9446('0x4a'))){_0x15c291[_0x9446('0x31')]=qs[_0x9446('0x31')](_0x459c4c['query'][_0x9446('0x31')]);_0x15c291['offset']=qs[_0x9446('0x33')](_0x459c4c[_0x9446('0x41')]['offset']);}_0x15c291[_0x9446('0x4b')]=qs[_0x9446('0x4c')](_0x459c4c['query']['sort']);_0x15c291[_0x9446('0x4d')]=qs[_0x9446('0x43')](_['pick'](_0x459c4c['query'],_0x5e7467['filters']),_0x1eb86c);if(_0x459c4c['query'][_0x9446('0x4e')]){_0x15c291[_0x9446('0x4d')]=_['merge'](_0x15c291[_0x9446('0x4d')],{'$or':_[_0x9446('0x4f')](_0x1eb86c,function(_0x1b68bb){if(_0x1b68bb[_0x9446('0x3f')]!=='VIRTUAL'){var _0x48ec02={};_0x48ec02[_0x1b68bb[_0x9446('0x3b')]]={'$like':'%'+_0x459c4c['query'][_0x9446('0x4e')]+'%'};return _0x48ec02;}})});}_0x15c291=_['merge']({},_0x15c291,_0x459c4c['options']);var _0x3e4da0={'where':_0x15c291[_0x9446('0x4d')]};return db[_0x9446('0x50')][_0x9446('0x32')](_0x3e4da0)['then'](function(_0x4c661d){_0x489dcb['count']=_0x4c661d;if(_0x459c4c['query'][_0x9446('0x51')]){_0x15c291['include']=[{'all':!![]}];}return db['OpenchannelMessage'][_0x9446('0x52')](_0x15c291);})[_0x9446('0x39')](function(_0x3532c8){_0x489dcb[_0x9446('0x53')]=_0x3532c8;return _0x489dcb;})[_0x9446('0x39')](respondWithFilteredResult(_0x2a88b6,_0x15c291))['catch'](handleError(_0x2a88b6,null));};exports[_0x9446('0x54')]=function(_0x2b88ae,_0x325bf4){var _0x2fc9d2={'raw':!![],'where':{'id':_0x2b88ae[_0x9446('0x55')]['id']}},_0x37d061={};_0x37d061[_0x9446('0x45')]=_[_0x9446('0x42')](db[_0x9446('0x50')][_0x9446('0x56')]);_0x37d061[_0x9446('0x41')]=_['keys'](_0x2b88ae[_0x9446('0x41')]);_0x37d061['filters']=_[_0x9446('0x44')](_0x37d061[_0x9446('0x45')],_0x37d061[_0x9446('0x41')]);_0x2fc9d2[_0x9446('0x46')]=_[_0x9446('0x44')](_0x37d061['model'],qs[_0x9446('0x47')](_0x2b88ae[_0x9446('0x41')][_0x9446('0x47')]));_0x2fc9d2[_0x9446('0x46')]=_0x2fc9d2[_0x9446('0x46')][_0x9446('0x48')]?_0x2fc9d2[_0x9446('0x46')]:_0x37d061[_0x9446('0x45')];if(_0x2b88ae[_0x9446('0x41')][_0x9446('0x51')]){_0x2fc9d2[_0x9446('0x57')]=[{'all':!![]}];}_0x2fc9d2=_[_0x9446('0x58')]({},_0x2fc9d2,_0x2b88ae['options']);return db[_0x9446('0x50')]['find'](_0x2fc9d2)[_0x9446('0x39')](handleEntityNotFound(_0x325bf4,null))[_0x9446('0x39')](respondWithResult(_0x325bf4,null))[_0x9446('0x2c')](handleError(_0x325bf4,null));};exports['create']=function(_0x248af0,_0x40cccb){return db[_0x9446('0x50')][_0x9446('0x59')](_0x248af0[_0x9446('0x5a')],{})[_0x9446('0x39')](respondWithResult(_0x40cccb,0xc9))[_0x9446('0x2c')](handleError(_0x40cccb,null));};exports[_0x9446('0x38')]=function(_0x513f19,_0xdd0abf){if(_0x513f19[_0x9446('0x5a')]['id']){delete _0x513f19[_0x9446('0x5a')]['id'];}return db[_0x9446('0x50')][_0x9446('0x5b')]({'where':{'id':_0x513f19['params']['id']}})[_0x9446('0x39')](handleEntityNotFound(_0xdd0abf,null))['then'](saveUpdates(_0x513f19[_0x9446('0x5a')],null))['then'](respondWithResult(_0xdd0abf,null))[_0x9446('0x2c')](handleError(_0xdd0abf,null));};exports[_0x9446('0x5c')]=function(_0x3f6449,_0xe8ebc5){return db[_0x9446('0x50')]['find']({'where':{'id':_0x3f6449[_0x9446('0x55')]['id']}})['then'](handleEntityNotFound(_0xe8ebc5,null))[_0x9446('0x39')](removeEntity(_0xe8ebc5,null))[_0x9446('0x2c')](handleError(_0xe8ebc5,null));};exports[_0x9446('0x5d')]=function(_0x59b9f8,_0xe817bd){return db[_0x9446('0x50')]['describe']()['then'](respondWithResult(_0xe817bd,null))['catch'](handleError(_0xe817bd,null));};var interaction_log=require(_0x9446('0x16'))('openchannel-interactions');exports[_0x9446('0x5e')]=function(_0x16ec96,_0x371d11,_0x4876e2){var _0xebacb0={'agent':{},'channel':_0x9446('0x5f')};if(_0x16ec96['body']['id']){delete _0x16ec96['body']['id'];}_0x16ec96[_0x9446('0x5a')][_0x9446('0x60')]=!![];_0x16ec96[_0x9446('0x5a')][_0x9446('0x61')]=moment()[_0x9446('0x62')](_0x9446('0x63'));_0x16ec96['body'][_0x9446('0x64')]=_0x16ec96['body'][_0x9446('0x64')]||_0x16ec96['user']['id'];_0xebacb0['agent']['id']=_0x16ec96[_0x9446('0x5a')][_0x9446('0x64')];return db[_0x9446('0x50')][_0x9446('0x5b')]({'where':{'id':_0x16ec96[_0x9446('0x55')]['id'],'UserId':null}})[_0x9446('0x39')](handleEntityNotFound(_0x371d11,null))[_0x9446('0x39')](saveUpdates(_0x16ec96['body'],null))[_0x9446('0x39')](function(_0x456eae){if(_0x456eae){_0xebacb0[_0x9446('0x2b')]=_0x456eae[_0x9446('0x65')]({'plain':!![]});return db[_0x9446('0x66')][_0x9446('0x5b')]({'where':{'id':_0x456eae[_0x9446('0x67')]}});}return null;})[_0x9446('0x39')](handleEntityNotFound(_0x371d11,null))[_0x9446('0x39')](function(_0x4237c7){if(_0x4237c7){return _0x4237c7[_0x9446('0x38')]({'UserId':_0x16ec96[_0x9446('0x5a')]['UserId'],'read1stAt':_[_0x9446('0x68')](_0x4237c7[_0x9446('0x69')])?moment()['format'](_0x9446('0x63')):undefined});}return null;})[_0x9446('0x39')](function(_0x585da8){if(_0x585da8){_0xebacb0[_0x9446('0x6a')]=_0x585da8[_0x9446('0x65')]({'plain':!![]});interaction_log[_0x9446('0x24')](_0x9446('0x6b'),_0x16ec96['user']['id'],_0x16ec96[_0x9446('0x6c')][_0x9446('0x3b')],_0x16ec96[_0x9446('0x6c')][_0x9446('0x6d')],_0xebacb0[_0x9446('0x6a')]['id'],_0x16ec96['body']?JSON[_0x9446('0x28')](_0x16ec96[_0x9446('0x5a')]):_0x9446('0x6e'));return respondWithRpcPromise(_0x9446('0x6f'),'acceptMessage',_0xebacb0);}return null;})['then'](function(_0x1a9132){var _0x56e7db='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1a9132[_0x9446('0x2b')]['ContactId'];return db['sequelize']['query'](_0x56e7db,{'type':db[_0x9446('0x70')][_0x9446('0x71')][_0x9446('0x72')],'raw':!![]})[_0x9446('0x39')](function(_0xc5077a){return _0xc5077a;});})['then'](function(_0xd9be38){if(_0xd9be38){_0xebacb0[_0x9446('0x2b')][_0x9446('0x73')]=_0xd9be38[0x0];if(!_0x16ec96[_0x9446('0x5a')][_0x9446('0x64')])return;return db['User'][_0x9446('0x5b')]({'where':{'id':_0x16ec96['body'][_0x9446('0x64')],'role':_0x9446('0x74')},'attributes':['id',_0x9446('0x3b'),_0x9446('0x75'),'email',_0x9446('0x76')],'raw':!![]});}return null;})[_0x9446('0x39')](function(_0xd167a7){if(!_0xd167a7)return null;_0xebacb0['message'][_0x9446('0x74')]=_0xd167a7;return _0xebacb0;})[_0x9446('0x39')](function(_0x4d8403){if(_0x4d8403){if(_0x16ec96[_0x9446('0x5a')]['manual']){_0xebacb0[_0x9446('0x2b')][_0x9446('0x77')]=util['format'](_0x9446('0x78'),_0x16ec96[_0x9446('0x6c')][_0x9446('0x3b')]);_0xebacb0[_0x9446('0x2b')][_0x9446('0x79')]=_0xebacb0[_0x9446('0x79')];_0xebacb0['message']['event']=_0x9446('0x5e');return respondWithRpcPromise(_0x9446('0x7a'),_0x9446('0x7a'),{'event':'acceptmessage','message':_0xebacb0['message']},client9002)[_0x9446('0x39')](function(){return _0xebacb0;});}return _0xebacb0;}return null;})[_0x9446('0x39')](respondWithResult(_0x371d11,null))[_0x9446('0x2c')](handleError(_0x371d11,null));};var interaction_log=require('../../config/logger')(_0x9446('0x7b'));exports[_0x9446('0x36')]=function(_0x47ba92,_0x4f9e2f,_0x3c3773){var _0x4a6a5d={'agent':{},'channel':_0x9446('0x5f')};if(_0x47ba92['body']['id']){delete _0x47ba92[_0x9446('0x5a')]['id'];}_0x47ba92[_0x9446('0x5a')][_0x9446('0x64')]=_0x47ba92[_0x9446('0x5a')]['UserId']||_0x47ba92[_0x9446('0x6c')]['id'];_0x4a6a5d[_0x9446('0x74')]['id']=_0x47ba92['body'][_0x9446('0x64')];return db[_0x9446('0x50')][_0x9446('0x5b')]({'where':{'id':_0x47ba92[_0x9446('0x55')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4f9e2f,null))[_0x9446('0x39')](function(_0x462413){if(_0x462413){_0x4a6a5d[_0x9446('0x2b')]=_0x462413[_0x9446('0x65')]({'plain':!![]});return db[_0x9446('0x66')]['find']({'where':{'id':_0x462413[_0x9446('0x67')]}});}return null;})[_0x9446('0x39')](handleEntityNotFound(_0x4f9e2f,null))[_0x9446('0x39')](function(_0x54ca4d){if(_0x54ca4d){_0x4a6a5d[_0x9446('0x6a')]=_0x54ca4d['get']({'plain':!![]});interaction_log[_0x9446('0x24')](_0x9446('0x7c'),_0x47ba92[_0x9446('0x6c')]['id'],_0x47ba92[_0x9446('0x6c')][_0x9446('0x3b')],_0x47ba92[_0x9446('0x6c')]['role'],_0x4a6a5d[_0x9446('0x6a')]['id'],_0x47ba92['body']?JSON[_0x9446('0x28')](_0x47ba92[_0x9446('0x5a')]):_0x9446('0x6e'));return respondWithRpcPromise('RejectMessage',_0x9446('0x7d'),_0x4a6a5d);}return null;})['then'](function(_0x253c54){var _0x167bf0=_0x9446('0x7e')+_0x253c54[_0x9446('0x2b')][_0x9446('0x7f')];return db[_0x9446('0x80')][_0x9446('0x41')](_0x167bf0,{'type':db[_0x9446('0x70')]['QueryTypes'][_0x9446('0x72')],'raw':!![]})['then'](function(_0x454a95){return _0x454a95;});})[_0x9446('0x39')](function(_0x474891){if(_0x474891){_0x4a6a5d[_0x9446('0x2b')]['contact']=_0x474891[0x0];if(!_0x47ba92[_0x9446('0x5a')][_0x9446('0x64')])return;return db[_0x9446('0x81')][_0x9446('0x5b')]({'where':{'id':_0x47ba92[_0x9446('0x5a')][_0x9446('0x64')],'role':_0x9446('0x74')},'attributes':['id',_0x9446('0x3b'),_0x9446('0x75'),_0x9446('0x82'),_0x9446('0x76')],'raw':!![]});}return null;})['then'](function(_0xdae47c){if(!_0xdae47c)return null;_0x4a6a5d[_0x9446('0x2b')][_0x9446('0x74')]=_0xdae47c;return _0x4a6a5d;})[_0x9446('0x39')](function(_0x77f2e0){if(_0x77f2e0){_0x77f2e0[_0x9446('0x2b')][_0x9446('0x77')]=util['format'](_0x9446('0x78'),_0x47ba92['user']['name']);_0x77f2e0[_0x9446('0x2b')][_0x9446('0x79')]=_0x4a6a5d[_0x9446('0x79')];_0x77f2e0[_0x9446('0x2b')]['event']='reject';respondWithRpcPromise(_0x9446('0x7a'),_0x9446('0x7a'),{'event':_0x9446('0x83'),'message':_0x77f2e0[_0x9446('0x2b')]},client9002);return _0x4a6a5d;}return null;})[_0x9446('0x39')](respondWithResult(_0x4f9e2f,null))[_0x9446('0x2c')](handleError(_0x4f9e2f,null));}; \ No newline at end of file +var _0x8b6c=['describe','accept','openchannel','read','readAt','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','role','interaction','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','openchannel-interactions','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','User','email','internal','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','sox','lodash','squel','crypto','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','update','name','send','index','map','OpenchannelMessage','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','options','create','body','find','destroy','params'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8b6c,0x1b7));var _0xc8b6=function(_0x14f7a6,_0x421198){_0x14f7a6=_0x14f7a6-0x0;var _0x465213=_0x8b6c[_0x14f7a6];return _0x465213;};'use strict';var emlformat=require(_0xc8b6('0x0'));var rimraf=require(_0xc8b6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc8b6('0x2'));var rp=require(_0xc8b6('0x3'));var moment=require(_0xc8b6('0x4'));var BPromise=require(_0xc8b6('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc8b6('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc8b6('0x7'));var squel=require(_0xc8b6('0x8'));var crypto=require(_0xc8b6('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc8b6('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc8b6('0xb'));var authService=require(_0xc8b6('0xc'));var qs=require(_0xc8b6('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc8b6('0xe'));var logger=require(_0xc8b6('0xf'))(_0xc8b6('0x10'));var utils=require(_0xc8b6('0x11'));var config=require(_0xc8b6('0x12'));var licenseUtil=require(_0xc8b6('0x13'));var db=require(_0xc8b6('0x14'))['db'];config[_0xc8b6('0x15')]=_[_0xc8b6('0x16')](config[_0xc8b6('0x15')],{'host':_0xc8b6('0x17'),'port':0x18eb});var socket=require(_0xc8b6('0x18'))(new Redis(config[_0xc8b6('0x15')]));require(_0xc8b6('0x19'))[_0xc8b6('0x1a')](socket);var jayson=require(_0xc8b6('0x1b'));var client=jayson[_0xc8b6('0x1c')][_0xc8b6('0x1d')]({'port':0x232c});var client9002=jayson[_0xc8b6('0x1c')][_0xc8b6('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x4a49f2,_0x368940,_0x49806f,_0x302810){return new BPromise(function(_0xaf3c7b,_0x107070){var _0x3bcff3=_0x302810||client;return _0x3bcff3[_0xc8b6('0x1e')](_0x4a49f2,_0x49806f)[_0xc8b6('0x1f')](function(_0x35175b){logger[_0xc8b6('0x20')](_0xc8b6('0x21'),_0x368940,_0xc8b6('0x22'));logger[_0xc8b6('0x23')](_0xc8b6('0x24'),_0x368940,_0xc8b6('0x22'),JSON['stringify'](_0x35175b));if(_0x35175b[_0xc8b6('0x25')]){if(_0x35175b[_0xc8b6('0x25')][_0xc8b6('0x26')]===0x1f4){logger['error'](_0xc8b6('0x21'),_0x368940,_0x35175b[_0xc8b6('0x25')]['message']);return _0x107070(_0x35175b[_0xc8b6('0x25')][_0xc8b6('0x27')]);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x368940,_0x35175b[_0xc8b6('0x25')]['message']);return _0xaf3c7b(_0x35175b['error']['message']);}else{logger[_0xc8b6('0x20')]('OpenchannelMessage,\x20%s,\x20%s',_0x368940,_0xc8b6('0x22'));_0xaf3c7b(_0x35175b[_0xc8b6('0x28')][_0xc8b6('0x27')]);}})['catch'](function(_0x1daa11){logger[_0xc8b6('0x25')](_0xc8b6('0x21'),_0x368940,_0x1daa11);_0x107070(_0x1daa11);});});}function respondWithStatusCode(_0x2c544d,_0x3ad8a4){_0x3ad8a4=_0x3ad8a4||0xcc;return function(_0x4dcdfe){if(_0x4dcdfe){return _0x2c544d[_0xc8b6('0x29')](_0x3ad8a4);}return _0x2c544d[_0xc8b6('0x2a')](_0x3ad8a4)[_0xc8b6('0x2b')]();};}function respondWithResult(_0xcc733f,_0x3d1d2c){_0x3d1d2c=_0x3d1d2c||0xc8;return function(_0x4b0eff){if(_0x4b0eff){return _0xcc733f['status'](_0x3d1d2c)[_0xc8b6('0x2c')](_0x4b0eff);}};}function respondWithFilteredResult(_0x5b9178,_0x672a4d){return function(_0x3b588c){if(_0x3b588c){var _0x55ab56=typeof _0x672a4d[_0xc8b6('0x2d')]==='undefined'&&typeof _0x672a4d[_0xc8b6('0x2e')]===_0xc8b6('0x2f');var _0x3d6403=_0x3b588c[_0xc8b6('0x30')];var _0x2d7f53=_0x55ab56?0x0:_0x672a4d[_0xc8b6('0x2d')];var _0x4eda49=_0x55ab56?_0x3b588c['count']:_0x672a4d[_0xc8b6('0x2d')]+_0x672a4d['limit'];var _0x1a7950;if(_0x4eda49>=_0x3d6403){_0x4eda49=_0x3d6403;_0x1a7950=0xc8;}else{_0x1a7950=0xce;}_0x5b9178[_0xc8b6('0x2a')](_0x1a7950);return _0x5b9178[_0xc8b6('0x31')]('Content-Range',_0x2d7f53+'-'+_0x4eda49+'/'+_0x3d6403)['json'](_0x3b588c);}return null;};}function patchUpdates(_0x1231dc){return function(_0x2aad7d){try{jsonpatch[_0xc8b6('0x32')](_0x2aad7d,_0x1231dc,!![]);}catch(_0x16f5ac){return BPromise[_0xc8b6('0x33')](_0x16f5ac);}return _0x2aad7d['save']();};}function saveUpdates(_0x474934,_0x477778){return function(_0x2fa63e){if(_0x2fa63e){return _0x2fa63e[_0xc8b6('0x34')](_0x474934)[_0xc8b6('0x1f')](function(_0x21e87b){return _0x21e87b;});}return null;};}function removeEntity(_0x22217c,_0x13b75a){return function(_0x1c14ae){if(_0x1c14ae){return _0x1c14ae['destroy']()[_0xc8b6('0x1f')](function(){_0x22217c[_0xc8b6('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d266,_0x57de52){return function(_0x444b54){if(!_0x444b54){_0x5d266['sendStatus'](0x194);}return _0x444b54;};}function handleError(_0x3d52df,_0x2d112a){_0x2d112a=_0x2d112a||0x1f4;return function(_0xee0022){logger['error'](_0xee0022['stack']);if(_0xee0022['name']){delete _0xee0022[_0xc8b6('0x35')];}_0x3d52df[_0xc8b6('0x2a')](_0x2d112a)[_0xc8b6('0x36')](_0xee0022);};}exports[_0xc8b6('0x37')]=function(_0x103076,_0x246e35){var _0x4340c0={},_0x5cc613={},_0x29c256={'count':0x0,'rows':[]};var _0x2d49b7=_[_0xc8b6('0x38')](db[_0xc8b6('0x39')][_0xc8b6('0x3a')],function(_0xe5d8e6){return{'name':_0xe5d8e6['fieldName'],'type':_0xe5d8e6[_0xc8b6('0x3b')][_0xc8b6('0x3c')]};});_0x5cc613[_0xc8b6('0x3d')]=_[_0xc8b6('0x38')](_0x2d49b7,_0xc8b6('0x35'));_0x5cc613[_0xc8b6('0x3e')]=_[_0xc8b6('0x3f')](_0x103076[_0xc8b6('0x3e')]);_0x5cc613[_0xc8b6('0x40')]=_[_0xc8b6('0x41')](_0x5cc613[_0xc8b6('0x3d')],_0x5cc613['query']);_0x4340c0[_0xc8b6('0x42')]=_[_0xc8b6('0x41')](_0x5cc613[_0xc8b6('0x3d')],qs['fields'](_0x103076[_0xc8b6('0x3e')][_0xc8b6('0x43')]));_0x4340c0[_0xc8b6('0x42')]=_0x4340c0[_0xc8b6('0x42')][_0xc8b6('0x44')]?_0x4340c0['attributes']:_0x5cc613[_0xc8b6('0x3d')];if(!_0x103076['query'][_0xc8b6('0x45')](_0xc8b6('0x46'))){_0x4340c0['limit']=qs['limit'](_0x103076[_0xc8b6('0x3e')][_0xc8b6('0x2e')]);_0x4340c0[_0xc8b6('0x2d')]=qs['offset'](_0x103076[_0xc8b6('0x3e')][_0xc8b6('0x2d')]);}_0x4340c0[_0xc8b6('0x47')]=qs['sort'](_0x103076[_0xc8b6('0x3e')][_0xc8b6('0x48')]);_0x4340c0[_0xc8b6('0x49')]=qs[_0xc8b6('0x40')](_[_0xc8b6('0x4a')](_0x103076[_0xc8b6('0x3e')],_0x5cc613['filters']),_0x2d49b7);if(_0x103076['query'][_0xc8b6('0x4b')]){_0x4340c0['where']=_[_0xc8b6('0x4c')](_0x4340c0[_0xc8b6('0x49')],{'$or':_[_0xc8b6('0x38')](_0x2d49b7,function(_0x345329){if(_0x345329[_0xc8b6('0x3b')]!==_0xc8b6('0x4d')){var _0x1e9023={};_0x1e9023[_0x345329[_0xc8b6('0x35')]]={'$like':'%'+_0x103076[_0xc8b6('0x3e')]['filter']+'%'};return _0x1e9023;}})});}_0x4340c0=_[_0xc8b6('0x4c')]({},_0x4340c0,_0x103076['options']);var _0x5ddfb5={'where':_0x4340c0[_0xc8b6('0x49')]};return db[_0xc8b6('0x39')][_0xc8b6('0x30')](_0x5ddfb5)[_0xc8b6('0x1f')](function(_0x21c94c){_0x29c256[_0xc8b6('0x30')]=_0x21c94c;if(_0x103076[_0xc8b6('0x3e')][_0xc8b6('0x4e')]){_0x4340c0[_0xc8b6('0x4f')]=[{'all':!![]}];}return db[_0xc8b6('0x39')][_0xc8b6('0x50')](_0x4340c0);})[_0xc8b6('0x1f')](function(_0xf5b0d){_0x29c256['rows']=_0xf5b0d;return _0x29c256;})['then'](respondWithFilteredResult(_0x246e35,_0x4340c0))[_0xc8b6('0x51')](handleError(_0x246e35,null));};exports[_0xc8b6('0x52')]=function(_0xe77e07,_0x39874f){var _0x834b31={'raw':!![],'where':{'id':_0xe77e07['params']['id']}},_0x5d91f4={};_0x5d91f4[_0xc8b6('0x3d')]=_['keys'](db[_0xc8b6('0x39')][_0xc8b6('0x3a')]);_0x5d91f4[_0xc8b6('0x3e')]=_['keys'](_0xe77e07[_0xc8b6('0x3e')]);_0x5d91f4['filters']=_[_0xc8b6('0x41')](_0x5d91f4['model'],_0x5d91f4['query']);_0x834b31['attributes']=_['intersection'](_0x5d91f4[_0xc8b6('0x3d')],qs[_0xc8b6('0x43')](_0xe77e07[_0xc8b6('0x3e')][_0xc8b6('0x43')]));_0x834b31['attributes']=_0x834b31[_0xc8b6('0x42')][_0xc8b6('0x44')]?_0x834b31[_0xc8b6('0x42')]:_0x5d91f4[_0xc8b6('0x3d')];if(_0xe77e07[_0xc8b6('0x3e')][_0xc8b6('0x4e')]){_0x834b31[_0xc8b6('0x4f')]=[{'all':!![]}];}_0x834b31=_[_0xc8b6('0x4c')]({},_0x834b31,_0xe77e07[_0xc8b6('0x53')]);return db[_0xc8b6('0x39')]['find'](_0x834b31)[_0xc8b6('0x1f')](handleEntityNotFound(_0x39874f,null))[_0xc8b6('0x1f')](respondWithResult(_0x39874f,null))['catch'](handleError(_0x39874f,null));};exports[_0xc8b6('0x54')]=function(_0xbf2bf6,_0x4ec551){return db[_0xc8b6('0x39')][_0xc8b6('0x54')](_0xbf2bf6['body'],{})[_0xc8b6('0x1f')](respondWithResult(_0x4ec551,0xc9))[_0xc8b6('0x51')](handleError(_0x4ec551,null));};exports[_0xc8b6('0x34')]=function(_0x4168b5,_0x20d3dd){if(_0x4168b5[_0xc8b6('0x55')]['id']){delete _0x4168b5[_0xc8b6('0x55')]['id'];}return db[_0xc8b6('0x39')][_0xc8b6('0x56')]({'where':{'id':_0x4168b5['params']['id']}})[_0xc8b6('0x1f')](handleEntityNotFound(_0x20d3dd,null))[_0xc8b6('0x1f')](saveUpdates(_0x4168b5[_0xc8b6('0x55')],null))['then'](respondWithResult(_0x20d3dd,null))[_0xc8b6('0x51')](handleError(_0x20d3dd,null));};exports[_0xc8b6('0x57')]=function(_0x1d676d,_0x1d7bc0){return db[_0xc8b6('0x39')]['find']({'where':{'id':_0x1d676d[_0xc8b6('0x58')]['id']}})['then'](handleEntityNotFound(_0x1d7bc0,null))['then'](removeEntity(_0x1d7bc0,null))[_0xc8b6('0x51')](handleError(_0x1d7bc0,null));};exports[_0xc8b6('0x59')]=function(_0x3e6275,_0xc8f2d1){return db[_0xc8b6('0x39')][_0xc8b6('0x59')]()[_0xc8b6('0x1f')](respondWithResult(_0xc8f2d1,null))[_0xc8b6('0x51')](handleError(_0xc8f2d1,null));};var interaction_log=require('../../config/logger')('openchannel-interactions');exports[_0xc8b6('0x5a')]=function(_0x42b559,_0x242345,_0x1a52db){var _0x56df18={'agent':{},'channel':_0xc8b6('0x5b')};if(_0x42b559['body']['id']){delete _0x42b559[_0xc8b6('0x55')]['id'];}_0x42b559[_0xc8b6('0x55')][_0xc8b6('0x5c')]=!![];_0x42b559[_0xc8b6('0x55')][_0xc8b6('0x5d')]=moment()['format'](_0xc8b6('0x5e'));_0x42b559[_0xc8b6('0x55')][_0xc8b6('0x5f')]=_0x42b559[_0xc8b6('0x55')][_0xc8b6('0x5f')]||_0x42b559[_0xc8b6('0x60')]['id'];_0x56df18[_0xc8b6('0x61')]['id']=_0x42b559[_0xc8b6('0x55')][_0xc8b6('0x5f')];return db[_0xc8b6('0x39')]['find']({'where':{'id':_0x42b559['params']['id'],'UserId':null}})[_0xc8b6('0x1f')](handleEntityNotFound(_0x242345,null))['then'](saveUpdates(_0x42b559['body'],null))[_0xc8b6('0x1f')](function(_0x5edba1){if(_0x5edba1){_0x56df18[_0xc8b6('0x27')]=_0x5edba1[_0xc8b6('0x62')]({'plain':!![]});return db[_0xc8b6('0x63')][_0xc8b6('0x56')]({'where':{'id':_0x5edba1[_0xc8b6('0x64')]}});}return null;})[_0xc8b6('0x1f')](handleEntityNotFound(_0x242345,null))[_0xc8b6('0x1f')](function(_0x1fd16d){if(_0x1fd16d){return _0x1fd16d[_0xc8b6('0x34')]({'UserId':_0x42b559['body'][_0xc8b6('0x5f')],'read1stAt':_[_0xc8b6('0x65')](_0x1fd16d[_0xc8b6('0x66')])?moment()[_0xc8b6('0x67')](_0xc8b6('0x5e')):undefined});}return null;})[_0xc8b6('0x1f')](function(_0x62cf25){if(_0x62cf25){_0x56df18['interaction']=_0x62cf25[_0xc8b6('0x62')]({'plain':!![]});interaction_log[_0xc8b6('0x20')](_0xc8b6('0x68'),_0x42b559['user']['id'],_0x42b559[_0xc8b6('0x60')][_0xc8b6('0x35')],_0x42b559['user'][_0xc8b6('0x69')],_0x56df18[_0xc8b6('0x6a')]['id'],_0x42b559['body']?JSON[_0xc8b6('0x6b')](_0x42b559['body']):_0xc8b6('0x6c'));return respondWithRpcPromise(_0xc8b6('0x6d'),_0xc8b6('0x6e'),_0x56df18);}return null;})[_0xc8b6('0x1f')](function(_0x2944ac){var _0x5cd89b=_0xc8b6('0x6f')+_0x2944ac['message'][_0xc8b6('0x70')];return db[_0xc8b6('0x71')][_0xc8b6('0x3e')](_0x5cd89b,{'type':db[_0xc8b6('0x72')][_0xc8b6('0x73')][_0xc8b6('0x74')],'raw':!![]})[_0xc8b6('0x1f')](function(_0x35a2bc){return _0x35a2bc;});})[_0xc8b6('0x1f')](function(_0x49093a){if(_0x49093a){_0x56df18[_0xc8b6('0x27')][_0xc8b6('0x75')]=_0x49093a[0x0];if(!_0x42b559[_0xc8b6('0x55')][_0xc8b6('0x5f')])return;return db['User'][_0xc8b6('0x56')]({'where':{'id':_0x42b559[_0xc8b6('0x55')]['UserId'],'role':_0xc8b6('0x61')},'attributes':['id',_0xc8b6('0x35'),_0xc8b6('0x76'),'email','internal'],'raw':!![]});}return null;})[_0xc8b6('0x1f')](function(_0x387719){if(!_0x387719)return null;_0x56df18['message']['agent']=_0x387719;return _0x56df18;})[_0xc8b6('0x1f')](function(_0x346efb){if(_0x346efb){if(_0x42b559[_0xc8b6('0x55')][_0xc8b6('0x77')]){_0x56df18[_0xc8b6('0x27')][_0xc8b6('0x78')]=util[_0xc8b6('0x67')](_0xc8b6('0x79'),_0x42b559['user']['name']);_0x56df18[_0xc8b6('0x27')][_0xc8b6('0x7a')]=_0x56df18[_0xc8b6('0x7a')];_0x56df18['message'][_0xc8b6('0x7b')]=_0xc8b6('0x5a');return respondWithRpcPromise(_0xc8b6('0x7c'),'EventManager',{'event':_0xc8b6('0x7d'),'message':_0x56df18[_0xc8b6('0x27')]},client9002)[_0xc8b6('0x1f')](function(){return _0x56df18;});}return _0x56df18;}return null;})[_0xc8b6('0x1f')](respondWithResult(_0x242345,null))[_0xc8b6('0x51')](handleError(_0x242345,null));};var interaction_log=require(_0xc8b6('0xf'))(_0xc8b6('0x7e'));exports['reject']=function(_0x4f74b3,_0x479dd2,_0x579ef7){var _0x1b7dbb={'agent':{},'channel':'openchannel'};if(_0x4f74b3[_0xc8b6('0x55')]['id']){delete _0x4f74b3[_0xc8b6('0x55')]['id'];}_0x4f74b3[_0xc8b6('0x55')][_0xc8b6('0x5f')]=_0x4f74b3['body'][_0xc8b6('0x5f')]||_0x4f74b3['user']['id'];_0x1b7dbb['agent']['id']=_0x4f74b3['body'][_0xc8b6('0x5f')];return db[_0xc8b6('0x39')][_0xc8b6('0x56')]({'where':{'id':_0x4f74b3[_0xc8b6('0x58')]['id'],'UserId':null}})[_0xc8b6('0x1f')](handleEntityNotFound(_0x479dd2,null))[_0xc8b6('0x1f')](function(_0x77a1b0){if(_0x77a1b0){_0x1b7dbb[_0xc8b6('0x27')]=_0x77a1b0[_0xc8b6('0x62')]({'plain':!![]});return db['OpenchannelInteraction'][_0xc8b6('0x56')]({'where':{'id':_0x77a1b0[_0xc8b6('0x64')]}});}return null;})[_0xc8b6('0x1f')](handleEntityNotFound(_0x479dd2,null))[_0xc8b6('0x1f')](function(_0x350367){if(_0x350367){_0x1b7dbb['interaction']=_0x350367[_0xc8b6('0x62')]({'plain':!![]});interaction_log[_0xc8b6('0x20')](_0xc8b6('0x7f'),_0x4f74b3['user']['id'],_0x4f74b3[_0xc8b6('0x60')][_0xc8b6('0x35')],_0x4f74b3['user'][_0xc8b6('0x69')],_0x1b7dbb['interaction']['id'],_0x4f74b3['body']?JSON['stringify'](_0x4f74b3[_0xc8b6('0x55')]):'null');return respondWithRpcPromise(_0xc8b6('0x80'),'rejectMessage',_0x1b7dbb);}return null;})[_0xc8b6('0x1f')](function(_0x46e796){var _0x3c7d3d=_0xc8b6('0x6f')+_0x46e796[_0xc8b6('0x27')]['ContactId'];return db[_0xc8b6('0x71')][_0xc8b6('0x3e')](_0x3c7d3d,{'type':db['Sequelize'][_0xc8b6('0x73')]['SELECT'],'raw':!![]})[_0xc8b6('0x1f')](function(_0x54a673){return _0x54a673;});})[_0xc8b6('0x1f')](function(_0x150761){if(_0x150761){_0x1b7dbb[_0xc8b6('0x27')]['contact']=_0x150761[0x0];if(!_0x4f74b3[_0xc8b6('0x55')][_0xc8b6('0x5f')])return;return db[_0xc8b6('0x81')][_0xc8b6('0x56')]({'where':{'id':_0x4f74b3['body'][_0xc8b6('0x5f')],'role':_0xc8b6('0x61')},'attributes':['id',_0xc8b6('0x35'),_0xc8b6('0x76'),_0xc8b6('0x82'),_0xc8b6('0x83')],'raw':!![]});}return null;})['then'](function(_0x1a02b6){if(!_0x1a02b6)return null;_0x1b7dbb['message'][_0xc8b6('0x61')]=_0x1a02b6;return _0x1b7dbb;})[_0xc8b6('0x1f')](function(_0x1ab9bb){if(_0x1ab9bb){_0x1ab9bb[_0xc8b6('0x27')]['interface']=util[_0xc8b6('0x67')](_0xc8b6('0x79'),_0x4f74b3[_0xc8b6('0x60')][_0xc8b6('0x35')]);_0x1ab9bb[_0xc8b6('0x27')][_0xc8b6('0x7a')]=_0x1b7dbb[_0xc8b6('0x7a')];_0x1ab9bb[_0xc8b6('0x27')][_0xc8b6('0x7b')]=_0xc8b6('0x33');respondWithRpcPromise(_0xc8b6('0x7c'),_0xc8b6('0x7c'),{'event':'rejectmessage','message':_0x1ab9bb[_0xc8b6('0x27')]},client9002);return _0x1b7dbb;}return null;})[_0xc8b6('0x1f')](respondWithResult(_0x479dd2,null))[_0xc8b6('0x51')](handleError(_0x479dd2,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index e1ee0a9..bab79ca 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 _0xc8bb=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','OpenchannelMessage','save','update'];(function(_0x5e5e55,_0x583a54){var _0xc903c9=function(_0x238654){while(--_0x238654){_0x5e5e55['push'](_0x5e5e55['shift']());}};_0xc903c9(++_0x583a54);}(_0xc8bb,0x79));var _0xbc8b=function(_0x325c86,_0x1c405f){_0x325c86=_0x325c86-0x0;var _0x231dde=_0xc8bb[_0x325c86];return _0x231dde;};'use strict';var EventEmitter=require(_0xbc8b('0x0'));var OpenchannelMessage=require(_0xbc8b('0x1'))['db'][_0xbc8b('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbc8b('0x3'),'afterUpdate':_0xbc8b('0x4'),'afterDestroy':_0xbc8b('0x5')};function emitEvent(_0x2bf705){return function(_0x510e5d,_0x51d7e0,_0x70afb6){OpenchannelMessageEvents[_0xbc8b('0x6')](_0x2bf705+':'+_0x510e5d['id'],_0x510e5d);OpenchannelMessageEvents[_0xbc8b('0x6')](_0x2bf705,_0x510e5d);_0x70afb6(null);};}for(var e in events){if(events[_0xbc8b('0x7')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0xbc8b('0x8')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x016a=['exports','../../mysqldb','OpenchannelMessage','update','remove','emit','hook'];(function(_0x52554c,_0x47aeb0){var _0x5778af=function(_0x110767){while(--_0x110767){_0x52554c['push'](_0x52554c['shift']());}};_0x5778af(++_0x47aeb0);}(_0x016a,0xe8));var _0xa016=function(_0x56740a,_0x568894){_0x56740a=_0x56740a-0x0;var _0x257144=_0x016a[_0x56740a];return _0x257144;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0xa016('0x0'))['db'][_0xa016('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa016('0x2'),'afterDestroy':_0xa016('0x3')};function emitEvent(_0x4537eb){return function(_0x4cb38e,_0x264d14,_0x440c32){OpenchannelMessageEvents[_0xa016('0x4')](_0x4537eb+':'+_0x4cb38e['id'],_0x4cb38e);OpenchannelMessageEvents[_0xa016('0x4')](_0x4537eb,_0x4cb38e);_0x440c32(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0xa016('0x5')](e,emitEvent(event));}}module[_0xa016('0x6')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index cb75b16..d664a37 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 _0x3266=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./openchannelMessage.attributes','define','openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','findOne','OpenchannelInteractionId','createdAt','catch','error','OpenchannelAccount','find','OpenchannelAccountId','CmContact','Contact','keys','then','info','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','Interactions','length','Interaction','omit','method','POST','OpenchannelMessage,\x20%s,\x20%s','Message\x20%d\x20forwarded\x20to\x20%s','threadId','OpenchannelInteraction','update','inspect','finally','utf8mb4','utf8mb4_unicode_ci'];(function(_0x9be779,_0x3c5b4b){var _0x1cf800=function(_0xa39bc4){while(--_0xa39bc4){_0x9be779['push'](_0x9be779['shift']());}};_0x1cf800(++_0x3c5b4b);}(_0x3266,0x6a));var _0x6326=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x3266[_0x3d42d8];return _0x27fc41;};'use strict';var _=require(_0x6326('0x0'));var util=require(_0x6326('0x1'));var logger=require(_0x6326('0x2'))(_0x6326('0x3'));var moment=require(_0x6326('0x4'));var BPromise=require(_0x6326('0x5'));var rp=require(_0x6326('0x6'));var fs=require('fs');var path=require(_0x6326('0x7'));var rimraf=require(_0x6326('0x8'));var config=require('../../config/environment');var attributes=require(_0x6326('0x9'));module['exports']=function(_0x25ecd8,_0x44460c){return _0x25ecd8[_0x6326('0xa')]('OpenchannelMessage',attributes,{'tableName':_0x6326('0xb'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0x6326('0xc')],'type':_0x6326('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x249eca,_0x1aee60,_0x37a23d){var _0x53c3e1=_0x25ecd8[_0x6326('0xe')];var _0x464a36=_0x249eca[_0x6326('0xf')]({'plain':!![]});if(_0x464a36[_0x6326('0x10')][_0x6326('0x11')]()==='in'||_0x464a36[_0x6326('0x10')][_0x6326('0x11')]()===_0x6326('0x12')&&!_0x464a36[_0x6326('0x13')]&&!_[_0x6326('0x14')](_0x464a36['UserId'])){_0x53c3e1['OpenchannelInteraction'][_0x6326('0x15')]({'where':{'id':_0x464a36[_0x6326('0x16')]}})['then'](function(_0x425878){if(_0x425878){_0x425878['update']({'lastMsgAt':_0x464a36[_0x6326('0x17')],'lastMsgDirection':_0x464a36[_0x6326('0x10')][_0x6326('0x11')]()});}})[_0x6326('0x18')](function(_0x1ed3a3){console[_0x6326('0x19')](_0x1ed3a3);});}if(_0x464a36['direction']===_0x6326('0x12')&&!_0x464a36['secret']){var _0x5945ee;_0x53c3e1['CmContact']['describe']()['then'](function(_0x58e960){return _0x53c3e1[_0x6326('0x1a')][_0x6326('0x1b')]({'where':{'id':_0x464a36[_0x6326('0x1c')]},'include':[{'model':_0x53c3e1['OpenchannelInteraction'],'as':'Interactions','where':{'id':_0x464a36[_0x6326('0x16')]},'limit':0x1,'include':[{'model':_0x53c3e1[_0x6326('0x1d')],'as':_0x6326('0x1e'),'attributes':_[_0x6326('0x1f')](_0x58e960)}]}]});})[_0x6326('0x20')](function(_0x25957a){_0x5945ee=_0x25957a[_0x6326('0xf')]({'plain':!![]});if(_0x5945ee&&_0x5945ee['replyUri']){logger[_0x6326('0x21')]('OpenchannelMessage,\x20%s,\x20%s',_0x6326('0x22'),util[_0x6326('0x23')](_0x6326('0x24'),_0x464a36['id'],_0x5945ee[_0x6326('0x25')]));if(_0x5945ee[_0x6326('0x26')]&&_0x5945ee[_0x6326('0x26')][_0x6326('0x27')]){_0x464a36[_0x6326('0x28')]=_[_0x6326('0x29')](_0x5945ee[_0x6326('0x26')][0x0],_0x6326('0x1e'));_0x464a36['Contact']=_0x5945ee[_0x6326('0x26')][0x0][_0x6326('0x1e')];}var _0x1aee60={'method':'POST','uri':encodeURI(_0x5945ee['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x1aee60[_0x6326('0x2a')]){case'GET':_0x1aee60['qs']=_0x464a36;break;case _0x6326('0x2b'):_0x1aee60[_0x6326('0xc')]=_0x464a36;break;}return rp(_0x1aee60)['then'](function(_0x15e33d){logger[_0x6326('0x21')](_0x6326('0x2c'),_0x6326('0x22'),util[_0x6326('0x23')](_0x6326('0x2d'),_0x464a36['id'],_0x5945ee[_0x6326('0x25')]));if(_0x15e33d[_0x6326('0xc')][_0x6326('0x2e')]&&_0x15e33d[_0x6326('0xc')][_0x6326('0x2e')]!=_0x464a36[_0x6326('0x28')][_0x6326('0x2e')]){return _0x53c3e1[_0x6326('0x2f')][_0x6326('0x30')]({'threadId':_0x15e33d[_0x6326('0xc')]['threadId']},{'logging':!![],'where':{'id':_0x464a36[_0x6326('0x28')]['id']}});}else{return;}})[_0x6326('0x20')](function(){return _0x249eca[_0x6326('0x30')]({'read':!![]});})['catch'](function(_0x1bd9a6){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x6326('0x22'),util[_0x6326('0x31')](_0x1bd9a6,{'showHidden':![],'depth':null}));_0x37a23d();});}else{_0x37a23d();}})[_0x6326('0x32')](function(){_0x37a23d();});}else{_0x37a23d();}}},'charset':_0x6326('0x33'),'collate':_0x6326('0x34')});}; \ No newline at end of file +var _0x6cb4=['define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','direction','toLowerCase','secret','isNil','UserId','OpenchannelInteraction','OpenchannelInteractionId','then','update','createdAt','catch','error','CmContact','OpenchannelAccount','find','OpenchannelAccountId','Interactions','Contact','keys','get','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','POST','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./openchannelMessage.attributes'];(function(_0x2f6cbd,_0x4dbbd3){var _0x530361=function(_0x56ed42){while(--_0x56ed42){_0x2f6cbd['push'](_0x2f6cbd['shift']());}};_0x530361(++_0x4dbbd3);}(_0x6cb4,0xff));var _0x46cb=function(_0x55093a,_0x21f1f4){_0x55093a=_0x55093a-0x0;var _0x1b132d=_0x6cb4[_0x55093a];return _0x1b132d;};'use strict';var _=require(_0x46cb('0x0'));var util=require(_0x46cb('0x1'));var logger=require(_0x46cb('0x2'))(_0x46cb('0x3'));var moment=require(_0x46cb('0x4'));var BPromise=require(_0x46cb('0x5'));var rp=require(_0x46cb('0x6'));var fs=require('fs');var path=require(_0x46cb('0x7'));var rimraf=require(_0x46cb('0x8'));var config=require('../../config/environment');var attributes=require(_0x46cb('0x9'));module['exports']=function(_0x3d9d3c,_0x4d9f1d){return _0x3d9d3c[_0x46cb('0xa')](_0x46cb('0xb'),attributes,{'tableName':_0x46cb('0xc'),'paranoid':![],'indexes':[{'name':_0x46cb('0xd'),'fields':[_0x46cb('0xe')],'type':_0x46cb('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x56258a,_0x3d7663,_0x34f9e9){var _0x48101c=_0x3d9d3c[_0x46cb('0x10')];var _0x106a87=_0x56258a['get']({'plain':!![]});if(_0x106a87[_0x46cb('0x11')][_0x46cb('0x12')]()==='in'||_0x106a87['direction']['toLowerCase']()==='out'&&!_0x106a87[_0x46cb('0x13')]&&!_[_0x46cb('0x14')](_0x106a87[_0x46cb('0x15')])){_0x48101c[_0x46cb('0x16')]['findOne']({'where':{'id':_0x106a87[_0x46cb('0x17')]}})[_0x46cb('0x18')](function(_0x2a1f9d){if(_0x2a1f9d){_0x2a1f9d[_0x46cb('0x19')]({'lastMsgAt':_0x106a87[_0x46cb('0x1a')],'lastMsgDirection':_0x106a87[_0x46cb('0x11')][_0x46cb('0x12')]()});}})[_0x46cb('0x1b')](function(_0x37d368){console[_0x46cb('0x1c')](_0x37d368);});}if(_0x106a87[_0x46cb('0x11')]==='out'&&!_0x106a87[_0x46cb('0x13')]){var _0x5796d2;_0x48101c[_0x46cb('0x1d')]['describe']()['then'](function(_0x4e3454){return _0x48101c[_0x46cb('0x1e')][_0x46cb('0x1f')]({'where':{'id':_0x106a87[_0x46cb('0x20')]},'include':[{'model':_0x48101c[_0x46cb('0x16')],'as':_0x46cb('0x21'),'where':{'id':_0x106a87[_0x46cb('0x17')]},'limit':0x1,'include':[{'model':_0x48101c[_0x46cb('0x1d')],'as':_0x46cb('0x22'),'attributes':_[_0x46cb('0x23')](_0x4e3454)}]}]});})[_0x46cb('0x18')](function(_0x149483){_0x5796d2=_0x149483[_0x46cb('0x24')]({'plain':!![]});if(_0x5796d2&&_0x5796d2[_0x46cb('0x25')]){logger[_0x46cb('0x26')](_0x46cb('0x27'),_0x46cb('0x28'),util[_0x46cb('0x29')](_0x46cb('0x2a'),_0x106a87['id'],_0x5796d2[_0x46cb('0x25')]));if(_0x5796d2[_0x46cb('0x21')]&&_0x5796d2[_0x46cb('0x21')][_0x46cb('0x2b')]){_0x106a87[_0x46cb('0x2c')]=_[_0x46cb('0x2d')](_0x5796d2[_0x46cb('0x21')][0x0],'Contact');_0x106a87['Contact']=_0x5796d2[_0x46cb('0x21')][0x0][_0x46cb('0x22')];}var _0x3d7663={'method':_0x46cb('0x2e'),'uri':encodeURI(_0x5796d2[_0x46cb('0x25')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x3d7663['method']){case _0x46cb('0x2f'):_0x3d7663['qs']=_0x106a87;break;case'POST':_0x3d7663['body']=_0x106a87;break;}return rp(_0x3d7663)['then'](function(_0x180ce1){logger[_0x46cb('0x26')](_0x46cb('0x27'),_0x46cb('0x28'),util[_0x46cb('0x29')](_0x46cb('0x30'),_0x106a87['id'],_0x5796d2[_0x46cb('0x25')]));if(_0x180ce1[_0x46cb('0xe')][_0x46cb('0x31')]&&_0x180ce1[_0x46cb('0xe')][_0x46cb('0x31')]!=_0x106a87['Interaction'][_0x46cb('0x31')]){return _0x48101c[_0x46cb('0x16')]['update']({'threadId':_0x180ce1['body'][_0x46cb('0x31')]},{'logging':!![],'where':{'id':_0x106a87['Interaction']['id']}});}else{return;}})[_0x46cb('0x18')](function(){return _0x56258a[_0x46cb('0x19')]({'read':!![]});})[_0x46cb('0x1b')](function(_0xd96713){logger[_0x46cb('0x1c')](_0x46cb('0x27'),'afterCreate',util[_0x46cb('0x32')](_0xd96713,{'showHidden':![],'depth':null}));_0x34f9e9();});}else{_0x34f9e9();}})['finally'](function(){_0x34f9e9();});}else{_0x34f9e9();}}},'charset':_0x46cb('0x33'),'collate':_0x46cb('0x34')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 66b0c94..120055d 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(_0x252884,_0x117ddf){var _0x4de0e6=function(_0x442519){while(--_0x442519){_0x252884['push'](_0x252884['shift']());}};_0x4de0e6(++_0x117ddf);}(_0xdb28,0x106));var _0x8db2=function(_0x1ef8b8,_0x18dc6a){_0x1ef8b8=_0x1ef8b8-0x0;var _0x515064=_0xdb28[_0x1ef8b8];return _0x515064;};'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 _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','OpenchannelMessage','options','raw','then','CreateOpenchannelMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5c7b86,_0x1cc316){var _0x459d2a=function(_0x377031){while(--_0x377031){_0x5c7b86['push'](_0x5c7b86['shift']());}};_0x459d2a(++_0x1cc316);}(_0x1261,0x144));var _0x1126=function(_0x4a0066,_0x16fb7e){_0x4a0066=_0x4a0066-0x0;var _0x611761=_0x1261[_0x4a0066];return _0x611761;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});config[_0x1126('0xb')]=_['defaults'](config[_0x1126('0xb')],{'host':_0x1126('0xc'),'port':0x18eb});var socket=require(_0x1126('0xd'))(new Redis(config[_0x1126('0xb')]));require(_0x1126('0xe'))['register'](socket);function respondWithRpcPromise(_0x3f09ac,_0x18dbe6,_0x167ef1){return new BPromise(function(_0x5e72e2,_0x34571c){return client['request'](_0x3f09ac,_0x167ef1)['then'](function(_0x15c071){logger['info'](_0x1126('0xf'),_0x18dbe6,_0x1126('0x10'));logger[_0x1126('0x11')](_0x1126('0x12'),_0x18dbe6,_0x1126('0x10'),JSON[_0x1126('0x13')](_0x15c071));if(_0x15c071[_0x1126('0x14')]){if(_0x15c071[_0x1126('0x14')][_0x1126('0x15')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x34571c(_0x15c071[_0x1126('0x14')]['message']);}logger[_0x1126('0x14')]('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x5e72e2(_0x15c071[_0x1126('0x14')]['message']);}else{logger[_0x1126('0x17')](_0x1126('0xf'),_0x18dbe6,'request\x20sent');_0x5e72e2(_0x15c071['result'][_0x1126('0x16')]);}})[_0x1126('0x18')](function(_0x58d11a){logger['error'](_0x1126('0xf'),_0x18dbe6,_0x58d11a);_0x34571c(_0x58d11a);});});}exports['CreateOpenchannelMessage']=function(_0x22ed37){var _0x1d6d19=this;return new Promise(function(_0x2f70ac,_0x54400a){return db[_0x1126('0x19')]['create'](_0x22ed37['body'],{'raw':_0x22ed37[_0x1126('0x1a')]?_0x22ed37[_0x1126('0x1a')][_0x1126('0x1b')]===undefined?!![]:![]:!![]})[_0x1126('0x1c')](function(_0x526ca1){logger[_0x1126('0x17')](_0x1126('0x1d'),_0x22ed37);logger['debug'](_0x1126('0x1d'),_0x22ed37,JSON['stringify'](_0x526ca1));_0x2f70ac(_0x526ca1);})['catch'](function(_0x4b57ab){logger[_0x1126('0x14')](_0x1126('0x1d'),_0x4b57ab[_0x1126('0x16')],_0x22ed37);_0x54400a(_0x1d6d19[_0x1126('0x14')](0x1f4,_0x4b57ab[_0x1126('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 949503e..2157c62 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 _0x7bd5=['length','openchannelMessage:','./openchannelMessage.events','remove','update','emit','register'];(function(_0x4c35fd,_0x4c801b){var _0x190218=function(_0xaf0294){while(--_0xaf0294){_0x4c35fd['push'](_0x4c35fd['shift']());}};_0x190218(++_0x4c801b);}(_0x7bd5,0x8e));var _0x57bd=function(_0x2072f5,_0x1b5eb9){_0x2072f5=_0x2072f5-0x0;var _0x1893c4=_0x7bd5[_0x2072f5];return _0x1893c4;};'use strict';var OpenchannelMessageEvents=require(_0x57bd('0x0'));var events=['save',_0x57bd('0x1'),_0x57bd('0x2')];function createListener(_0x467218,_0x231b3e){return function(_0x5cbb6a){_0x231b3e[_0x57bd('0x3')](_0x467218,_0x5cbb6a);};}function removeListener(_0x49b3b6,_0x2f3491){return function(){OpenchannelMessageEvents['removeListener'](_0x49b3b6,_0x2f3491);};}exports[_0x57bd('0x4')]=function(_0x12ebc7){for(var _0x2f989=0x0,_0x5e18c1=events[_0x57bd('0x5')];_0x2f989<_0x5e18c1;_0x2f989++){var _0x390abc=events[_0x2f989];var _0x1c8fac=createListener(_0x57bd('0x6')+_0x390abc,_0x12ebc7);OpenchannelMessageEvents['on'](_0x390abc,_0x1c8fac);}}; \ No newline at end of file +var _0xef1a=['remove','update','emit','removeListener','register','length','openchannelMessage:'];(function(_0x5b311b,_0x3e0280){var _0x4fa0de=function(_0x5363ed){while(--_0x5363ed){_0x5b311b['push'](_0x5b311b['shift']());}};_0x4fa0de(++_0x3e0280);}(_0xef1a,0xaf));var _0xaef1=function(_0x7a1153,_0x48c2a3){_0x7a1153=_0x7a1153-0x0;var _0x1fc52b=_0xef1a[_0x7a1153];return _0x1fc52b;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=['save',_0xaef1('0x0'),_0xaef1('0x1')];function createListener(_0x208488,_0x5669c3){return function(_0x5ef564){_0x5669c3[_0xaef1('0x2')](_0x208488,_0x5ef564);};}function removeListener(_0x520a0d,_0x4de826){return function(){OpenchannelMessageEvents[_0xaef1('0x3')](_0x520a0d,_0x4de826);};}exports[_0xaef1('0x4')]=function(_0x5a079b){for(var _0x3b4cf8=0x0,_0xd5ee9=events[_0xaef1('0x5')];_0x3b4cf8<_0xd5ee9;_0x3b4cf8++){var _0x19256b=events[_0x3b4cf8];var _0x437f88=createListener(_0xaef1('0x6')+_0x19256b,_0x5a079b);OpenchannelMessageEvents['on'](_0x19256b,_0x437f88);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 15f7003..9644cc1 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 _0xfff3=['getMembers','/:id/teams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x1e7a5c,_0x28ffc0){var _0x5e806b=function(_0x22a0b8){while(--_0x22a0b8){_0x1e7a5c['push'](_0x1e7a5c['shift']());}};_0x5e806b(++_0x28ffc0);}(_0xfff3,0x10f));var _0x3fff=function(_0x3765a7,_0x4db1e5){_0x3765a7=_0x3765a7-0x0;var _0x382076=_0xfff3[_0x3765a7];return _0x382076;};'use strict';var multer=require(_0x3fff('0x0'));var util=require(_0x3fff('0x1'));var path=require(_0x3fff('0x2'));var timeout=require(_0x3fff('0x3'));var express=require(_0x3fff('0x4'));var router=express['Router']();var fs_extra=require(_0x3fff('0x5'));var auth=require(_0x3fff('0x6'));var interaction=require(_0x3fff('0x7'));var config=require(_0x3fff('0x8'));var controller=require(_0x3fff('0x9'));router[_0x3fff('0xa')]('/',auth[_0x3fff('0xb')](),controller[_0x3fff('0xc')]);router[_0x3fff('0xa')](_0x3fff('0xd'),auth[_0x3fff('0xb')](),controller[_0x3fff('0xe')]);router[_0x3fff('0xa')](_0x3fff('0xf'),auth['isAuthenticated'](),controller[_0x3fff('0x10')]);router[_0x3fff('0xa')]('/:id/members',auth[_0x3fff('0xb')](),controller[_0x3fff('0x11')]);router[_0x3fff('0xa')](_0x3fff('0x12'),auth[_0x3fff('0xb')](),controller['getTeams']);router[_0x3fff('0xa')](_0x3fff('0x13'),auth[_0x3fff('0xb')](),controller[_0x3fff('0x14')]);router[_0x3fff('0x15')]('/',auth[_0x3fff('0xb')](),controller[_0x3fff('0x16')]);router[_0x3fff('0x15')](_0x3fff('0x12'),auth[_0x3fff('0xb')](),controller[_0x3fff('0x17')]);router[_0x3fff('0x15')](_0x3fff('0x13'),auth[_0x3fff('0xb')](),controller[_0x3fff('0x18')]);router[_0x3fff('0x19')](_0x3fff('0xf'),auth[_0x3fff('0xb')](),controller[_0x3fff('0x1a')]);router[_0x3fff('0x1b')](_0x3fff('0xf'),auth['isAuthenticated'](),controller[_0x3fff('0x1c')]);router[_0x3fff('0x1b')](_0x3fff('0x12'),auth[_0x3fff('0xb')](),controller[_0x3fff('0x1d')]);router['delete'](_0x3fff('0x13'),auth['isAuthenticated'](),controller[_0x3fff('0x1e')]);module[_0x3fff('0x1f')]=router; \ No newline at end of file +var _0xd73a=['create','/:id/teams','addTeams','post','addAgents','put','update','delete','destroy','removeAgents','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/users','getAgents'];(function(_0x2caaef,_0x3c19ed){var _0xd011f8=function(_0x318656){while(--_0x318656){_0x2caaef['push'](_0x2caaef['shift']());}};_0xd011f8(++_0x3c19ed);}(_0xd73a,0x15a));var _0xad73=function(_0x30f90e,_0x571d9f){_0x30f90e=_0x30f90e-0x0;var _0x522300=_0xd73a[_0x30f90e];return _0x522300;};'use strict';var multer=require(_0xad73('0x0'));var util=require('util');var path=require(_0xad73('0x1'));var timeout=require(_0xad73('0x2'));var express=require(_0xad73('0x3'));var router=express[_0xad73('0x4')]();var fs_extra=require(_0xad73('0x5'));var auth=require(_0xad73('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./openchannelQueue.controller');router[_0xad73('0x7')]('/',auth[_0xad73('0x8')](),controller[_0xad73('0x9')]);router[_0xad73('0x7')](_0xad73('0xa'),auth[_0xad73('0x8')](),controller[_0xad73('0xb')]);router[_0xad73('0x7')](_0xad73('0xc'),auth[_0xad73('0x8')](),controller[_0xad73('0xd')]);router[_0xad73('0x7')](_0xad73('0xe'),auth[_0xad73('0x8')](),controller[_0xad73('0xf')]);router[_0xad73('0x7')]('/:id/teams',auth[_0xad73('0x8')](),controller['getTeams']);router[_0xad73('0x7')](_0xad73('0x10'),auth['isAuthenticated'](),controller[_0xad73('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0xad73('0x12')]);router['post'](_0xad73('0x13'),auth[_0xad73('0x8')](),controller[_0xad73('0x14')]);router[_0xad73('0x15')](_0xad73('0x10'),auth[_0xad73('0x8')](),controller[_0xad73('0x16')]);router[_0xad73('0x17')]('/:id',auth[_0xad73('0x8')](),controller[_0xad73('0x18')]);router[_0xad73('0x19')](_0xad73('0xc'),auth['isAuthenticated'](),controller[_0xad73('0x1a')]);router[_0xad73('0x19')](_0xad73('0x13'),auth[_0xad73('0x8')](),controller['removeTeams']);router['delete']('/:id/users',auth[_0xad73('0x8')](),controller[_0xad73('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 6641eaa..fa2c80c 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 _0xf3eb=['ENUM','rrmemory','beepall','roundrobin','exports','STRING'];(function(_0x5ac6d6,_0x544811){var _0x22aecc=function(_0x116a36){while(--_0x116a36){_0x5ac6d6['push'](_0x5ac6d6['shift']());}};_0x22aecc(++_0x544811);}(_0xf3eb,0x1c0));var _0xbf3e=function(_0x1ec0bb,_0x37f39d){_0x1ec0bb=_0x1ec0bb-0x0;var _0xe102a0=_0xf3eb[_0x1ec0bb];return _0xe102a0;};'use strict';var Sequelize=require('sequelize');module[_0xbf3e('0x0')]={'name':{'type':Sequelize[_0xbf3e('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xbf3e('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xbf3e('0x2')](_0xbf3e('0x3'),_0xbf3e('0x4'),_0xbf3e('0x5'))}}; \ No newline at end of file +var _0x7424=['name','ENUM','rrmemory','beepall','sequelize','exports','STRING'];(function(_0x26639c,_0x3df652){var _0x326197=function(_0x12c542){while(--_0x12c542){_0x26639c['push'](_0x26639c['shift']());}};_0x326197(++_0x3df652);}(_0x7424,0x66));var _0x4742=function(_0x2df8e6,_0x510073){_0x2df8e6=_0x2df8e6-0x0;var _0x3e3a52=_0x7424[_0x2df8e6];return _0x3e3a52;};'use strict';var Sequelize=require(_0x4742('0x0'));module[_0x4742('0x1')]={'name':{'type':Sequelize[_0x4742('0x2')],'unique':_0x4742('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4742('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4742('0x4')](_0x4742('0x5'),_0x4742('0x6'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 721cc7c..2b26369 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 _0x209b=['removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','OpenchannelQueues','UserProfileResource','stack','name','send','index','OpenchannelQueue','rawAttributes','fieldName','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','limit','order','sort','filters','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','find','catch','create','body','user','get','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserOpenchannelQueue','length','nolimit','pick','OpenchannelQueueId','User','findAndCountAll','UserId','updatedAt','format','%s/%s','SIP','openchannelPause','getTeams','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','ids','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','TeamId','includes','all','union','value','isEmpty'];(function(_0x2ef44b,_0x553359){var _0x2405b9=function(_0x278290){while(--_0x278290){_0x2ef44b['push'](_0x2ef44b['shift']());}};_0x2405b9(++_0x553359);}(_0x209b,0x1bd));var _0xb209=function(_0x302a64,_0x191bf6){_0x302a64=_0x302a64-0x0;var _0xc4c71e=_0x209b[_0x302a64];return _0xc4c71e;};'use strict';var emlformat=require(_0xb209('0x0'));var rimraf=require(_0xb209('0x1'));var zipdir=require(_0xb209('0x2'));var jsonpatch=require(_0xb209('0x3'));var rp=require(_0xb209('0x4'));var moment=require(_0xb209('0x5'));var BPromise=require(_0xb209('0x6'));var Mustache=require(_0xb209('0x7'));var util=require(_0xb209('0x8'));var path=require(_0xb209('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb209('0xa'));var fs=require('fs');var fs_extra=require(_0xb209('0xb'));var _=require('lodash');var squel=require(_0xb209('0xc'));var crypto=require(_0xb209('0xd'));var jsforce=require(_0xb209('0xe'));var deskjs=require(_0xb209('0xf'));var toCsv=require(_0xb209('0x10'));var querystring=require(_0xb209('0x11'));var Papa=require('papaparse');var Redis=require(_0xb209('0x12'));var authService=require(_0xb209('0x13'));var qs=require(_0xb209('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb209('0x15'));var logger=require('../../config/logger')(_0xb209('0x16'));var utils=require(_0xb209('0x17'));var config=require(_0xb209('0x18'));var licenseUtil=require(_0xb209('0x19'));var db=require(_0xb209('0x1a'))['db'];config['redis']=_[_0xb209('0x1b')](config[_0xb209('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0xb209('0x1d'))(new Redis(config['redis']));require('./openchannelQueue.socket')[_0xb209('0x1e')](socket);function respondWithStatusCode(_0x170e8a,_0xbc1fa3){_0xbc1fa3=_0xbc1fa3||0xcc;return function(_0x215582){if(_0x215582){return _0x170e8a[_0xb209('0x1f')](_0xbc1fa3);}return _0x170e8a[_0xb209('0x20')](_0xbc1fa3)[_0xb209('0x21')]();};}function respondWithResult(_0x327fbb,_0x5061c5){_0x5061c5=_0x5061c5||0xc8;return function(_0x36e097){if(_0x36e097){return _0x327fbb[_0xb209('0x20')](_0x5061c5)[_0xb209('0x22')](_0x36e097);}};}function respondWithFilteredResult(_0x511561,_0x1f403d){return function(_0x59e828){if(_0x59e828){var _0x51e526=typeof _0x1f403d[_0xb209('0x23')]===_0xb209('0x24')&&typeof _0x1f403d['limit']==='undefined';var _0x4d5a86=_0x59e828[_0xb209('0x25')];var _0x53a808=_0x51e526?0x0:_0x1f403d['offset'];var _0x598dc3=_0x51e526?_0x59e828[_0xb209('0x25')]:_0x1f403d['offset']+_0x1f403d['limit'];var _0x3b8d4a;if(_0x598dc3>=_0x4d5a86){_0x598dc3=_0x4d5a86;_0x3b8d4a=0xc8;}else{_0x3b8d4a=0xce;}_0x511561[_0xb209('0x20')](_0x3b8d4a);return _0x511561[_0xb209('0x26')](_0xb209('0x27'),_0x53a808+'-'+_0x598dc3+'/'+_0x4d5a86)[_0xb209('0x22')](_0x59e828);}return null;};}function patchUpdates(_0x183260){return function(_0x35a38b){try{jsonpatch[_0xb209('0x28')](_0x35a38b,_0x183260,!![]);}catch(_0x52d435){return BPromise[_0xb209('0x29')](_0x52d435);}return _0x35a38b[_0xb209('0x2a')]();};}function saveUpdates(_0x489647,_0x4de679){return function(_0x3bc218){if(_0x3bc218){return _0x3bc218[_0xb209('0x2b')](_0x489647)[_0xb209('0x2c')](function(_0x77738b){return _0x77738b;});}return null;};}function removeEntity(_0x26f005,_0xfd9cf7){return function(_0x322252){if(_0x322252){return _0x322252[_0xb209('0x2d')]()[_0xb209('0x2c')](function(){var _0x6c3539=_0x322252['get']({'plain':!![]});var _0x4c35f8=_0xb209('0x2e');return db[_0xb209('0x2f')][_0xb209('0x2d')]({'where':{'type':_0x4c35f8,'resourceId':_0x6c3539['id']}})['then'](function(){return _0x322252;});})[_0xb209('0x2c')](function(){_0x26f005[_0xb209('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x900df4,_0x22114c){return function(_0x1faa62){if(!_0x1faa62){_0x900df4[_0xb209('0x1f')](0x194);}return _0x1faa62;};}function handleError(_0x4c2e9f,_0x5950d9){_0x5950d9=_0x5950d9||0x1f4;return function(_0x5a5a4d){logger['error'](_0x5a5a4d[_0xb209('0x30')]);if(_0x5a5a4d[_0xb209('0x31')]){delete _0x5a5a4d[_0xb209('0x31')];}_0x4c2e9f[_0xb209('0x20')](_0x5950d9)[_0xb209('0x32')](_0x5a5a4d);};}exports[_0xb209('0x33')]=function(_0x1aadda,_0x301f7a){var _0x4fcbf8={},_0xcf9a1={},_0x4db5a4={'count':0x0,'rows':[]};var _0xe8adb=_['map'](db[_0xb209('0x34')][_0xb209('0x35')],function(_0x1af76e){return{'name':_0x1af76e[_0xb209('0x36')],'type':_0x1af76e['type']['key']};});_0xcf9a1[_0xb209('0x37')]=_[_0xb209('0x38')](_0xe8adb,_0xb209('0x31'));_0xcf9a1[_0xb209('0x39')]=_[_0xb209('0x3a')](_0x1aadda['query']);_0xcf9a1['filters']=_[_0xb209('0x3b')](_0xcf9a1[_0xb209('0x37')],_0xcf9a1[_0xb209('0x39')]);_0x4fcbf8[_0xb209('0x3c')]=_[_0xb209('0x3b')](_0xcf9a1[_0xb209('0x37')],qs['fields'](_0x1aadda[_0xb209('0x39')][_0xb209('0x3d')]));_0x4fcbf8[_0xb209('0x3c')]=_0x4fcbf8[_0xb209('0x3c')]['length']?_0x4fcbf8[_0xb209('0x3c')]:_0xcf9a1['model'];if(!_0x1aadda[_0xb209('0x39')][_0xb209('0x3e')]('nolimit')){_0x4fcbf8[_0xb209('0x3f')]=qs[_0xb209('0x3f')](_0x1aadda[_0xb209('0x39')][_0xb209('0x3f')]);_0x4fcbf8[_0xb209('0x23')]=qs['offset'](_0x1aadda[_0xb209('0x39')][_0xb209('0x23')]);}_0x4fcbf8[_0xb209('0x40')]=qs[_0xb209('0x41')](_0x1aadda[_0xb209('0x39')]['sort']);_0x4fcbf8['where']=qs['filters'](_['pick'](_0x1aadda[_0xb209('0x39')],_0xcf9a1[_0xb209('0x42')]),_0xe8adb);if(_0x1aadda['query'][_0xb209('0x43')]){_0x4fcbf8[_0xb209('0x44')]=_[_0xb209('0x45')](_0x4fcbf8[_0xb209('0x44')],{'$or':_['map'](_0xe8adb,function(_0x384cf6){if(_0x384cf6[_0xb209('0x46')]!==_0xb209('0x47')){var _0x83928f={};_0x83928f[_0x384cf6[_0xb209('0x31')]]={'$like':'%'+_0x1aadda[_0xb209('0x39')][_0xb209('0x43')]+'%'};return _0x83928f;}})});}_0x4fcbf8=_[_0xb209('0x45')]({},_0x4fcbf8,_0x1aadda[_0xb209('0x48')]);var _0x2f76dd={'where':_0x4fcbf8['where']};return db['OpenchannelQueue']['count'](_0x2f76dd)[_0xb209('0x2c')](function(_0x5a9550){_0x4db5a4[_0xb209('0x25')]=_0x5a9550;if(_0x1aadda[_0xb209('0x39')][_0xb209('0x49')]){_0x4fcbf8[_0xb209('0x4a')]=[{'all':!![]}];}return db[_0xb209('0x34')][_0xb209('0x4b')](_0x4fcbf8);})[_0xb209('0x2c')](function(_0x25d352){_0x4db5a4[_0xb209('0x4c')]=_0x25d352;return _0x4db5a4;})['then'](respondWithFilteredResult(_0x301f7a,_0x4fcbf8))['catch'](handleError(_0x301f7a,null));};exports[_0xb209('0x4d')]=function(_0x2c969d,_0x43da5b){var _0x2222d7={'raw':!![],'where':{'id':_0x2c969d['params']['id']}},_0x15e809={};_0x15e809[_0xb209('0x37')]=_['keys'](db['OpenchannelQueue'][_0xb209('0x35')]);_0x15e809['query']=_[_0xb209('0x3a')](_0x2c969d['query']);_0x15e809[_0xb209('0x42')]=_[_0xb209('0x3b')](_0x15e809[_0xb209('0x37')],_0x15e809[_0xb209('0x39')]);_0x2222d7['attributes']=_[_0xb209('0x3b')](_0x15e809[_0xb209('0x37')],qs[_0xb209('0x3d')](_0x2c969d[_0xb209('0x39')][_0xb209('0x3d')]));_0x2222d7[_0xb209('0x3c')]=_0x2222d7[_0xb209('0x3c')]['length']?_0x2222d7[_0xb209('0x3c')]:_0x15e809['model'];if(_0x2c969d[_0xb209('0x39')][_0xb209('0x49')]){_0x2222d7[_0xb209('0x4a')]=[{'all':!![]}];}_0x2222d7=_[_0xb209('0x45')]({},_0x2222d7,_0x2c969d[_0xb209('0x48')]);return db[_0xb209('0x34')][_0xb209('0x4e')](_0x2222d7)[_0xb209('0x2c')](handleEntityNotFound(_0x43da5b,null))[_0xb209('0x2c')](respondWithResult(_0x43da5b,null))[_0xb209('0x4f')](handleError(_0x43da5b,null));};exports['create']=function(_0xe541fc,_0x501d59){return db[_0xb209('0x34')][_0xb209('0x50')](_0xe541fc[_0xb209('0x51')],{})[_0xb209('0x2c')](function(_0x13dbf6){var _0x2fa9ed=_0xe541fc[_0xb209('0x52')][_0xb209('0x53')]({'plain':!![]});if(!_0x2fa9ed)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2fa9ed[_0xb209('0x54')]===_0xb209('0x52')){var _0x55942a=_0x13dbf6[_0xb209('0x53')]({'plain':!![]});var _0x374e24='OpenchannelQueues';return db['UserProfileSection'][_0xb209('0x4e')]({'where':{'name':_0x374e24,'userProfileId':_0x2fa9ed[_0xb209('0x55')]},'raw':!![]})[_0xb209('0x2c')](function(_0x1b6c1d){if(_0x1b6c1d&&_0x1b6c1d[_0xb209('0x56')]===0x0){return db['UserProfileResource'][_0xb209('0x50')]({'name':_0x55942a[_0xb209('0x31')],'resourceId':_0x55942a['id'],'type':_0x1b6c1d[_0xb209('0x31')],'sectionId':_0x1b6c1d['id']},{})[_0xb209('0x2c')](function(){return _0x13dbf6;});}else{return _0x13dbf6;}})[_0xb209('0x4f')](function(_0x39163b){logger[_0xb209('0x57')](_0xb209('0x58'),_0x39163b);throw _0x39163b;});}return _0x13dbf6;})[_0xb209('0x2c')](respondWithResult(_0x501d59,0xc9))[_0xb209('0x4f')](handleError(_0x501d59,null));};exports[_0xb209('0x2b')]=function(_0x2aca22,_0x122b39){if(_0x2aca22[_0xb209('0x51')]['id']){delete _0x2aca22[_0xb209('0x51')]['id'];}return db[_0xb209('0x34')][_0xb209('0x4e')]({'where':{'id':_0x2aca22['params']['id']}})[_0xb209('0x2c')](handleEntityNotFound(_0x122b39,null))[_0xb209('0x2c')](saveUpdates(_0x2aca22[_0xb209('0x51')],null))[_0xb209('0x2c')](respondWithResult(_0x122b39,null))[_0xb209('0x4f')](handleError(_0x122b39,null));};exports[_0xb209('0x2d')]=function(_0x2eecce,_0x1f595f){return db[_0xb209('0x34')][_0xb209('0x4e')]({'where':{'id':_0x2eecce[_0xb209('0x59')]['id']}})['then'](handleEntityNotFound(_0x1f595f,null))['then'](removeEntity(_0x1f595f,null))[_0xb209('0x4f')](handleError(_0x1f595f,null));};exports[_0xb209('0x5a')]=function(_0x3d15a1,_0xcf9660){return db[_0xb209('0x34')]['describe']()[_0xb209('0x2c')](respondWithResult(_0xcf9660,null))[_0xb209('0x4f')](handleError(_0xcf9660,null));};exports[_0xb209('0x5b')]=function(_0x28a2ac,_0x554cc3,_0x271d5f){var _0x217c56={'raw':!![],'where':{}},_0x482c0a={},_0x1f610e;return db['OpenchannelQueue'][_0xb209('0x5c')]({'where':{'id':_0x28a2ac['params']['id']}})[_0xb209('0x2c')](handleEntityNotFound(_0x554cc3,null))['then'](function(_0x310b99){if(_0x310b99){_0x1f610e=_0x310b99[_0xb209('0x53')]({'plain':!![]});_0x482c0a[_0xb209('0x37')]=_['keys'](db[_0xb209('0x5d')][_0xb209('0x35')]);_0x482c0a[_0xb209('0x39')]=_['keys'](_0x28a2ac[_0xb209('0x39')]);_0x482c0a[_0xb209('0x42')]=_['intersection'](_0x482c0a['model'],_0x482c0a[_0xb209('0x39')]);_0x217c56[_0xb209('0x3c')]=_[_0xb209('0x3b')](_0x482c0a[_0xb209('0x37')],qs[_0xb209('0x3d')](_0x28a2ac['query'][_0xb209('0x3d')]));_0x217c56[_0xb209('0x3c')]=_0x217c56[_0xb209('0x3c')][_0xb209('0x5e')]?_0x217c56[_0xb209('0x3c')]:_0x482c0a[_0xb209('0x37')];if(!_0x28a2ac[_0xb209('0x39')]['hasOwnProperty'](_0xb209('0x5f'))){_0x217c56[_0xb209('0x3f')]=qs[_0xb209('0x3f')](_0x28a2ac['query'][_0xb209('0x3f')]);_0x217c56[_0xb209('0x23')]=qs[_0xb209('0x23')](_0x28a2ac[_0xb209('0x39')][_0xb209('0x23')]);}_0x217c56[_0xb209('0x40')]=qs['sort'](_0x28a2ac[_0xb209('0x39')][_0xb209('0x41')]);_0x217c56[_0xb209('0x44')]=qs[_0xb209('0x42')](_[_0xb209('0x60')](_0x28a2ac[_0xb209('0x39')],_0x482c0a[_0xb209('0x42')]));_0x217c56['where'][_0xb209('0x61')]=_0x310b99['id'];if(_0x28a2ac[_0xb209('0x39')][_0xb209('0x43')]){_0x217c56[_0xb209('0x44')]=_[_0xb209('0x45')](_0x217c56[_0xb209('0x44')],{'$or':_[_0xb209('0x38')](_0x217c56['attributes'],function(_0xff36cf){var _0x5587e1={};_0x5587e1[_0xff36cf]={'$like':'%'+_0x28a2ac[_0xb209('0x39')][_0xb209('0x43')]+'%'};return _0x5587e1;})});}_0x217c56=_['merge']({},_0x217c56,_0x28a2ac[_0xb209('0x48')]);return db[_0xb209('0x5d')][_0xb209('0x4b')](_0x217c56);}})[_0xb209('0x2c')](function(_0xafb53c){if(_0xafb53c){return db[_0xb209('0x62')][_0xb209('0x63')]({'where':{'id':_[_0xb209('0x38')](_0xafb53c,_0xb209('0x64')),'role':'agent'},'attributes':['id',_0xb209('0x31'),'openchannelPause',_0xb209('0x65'),'createdAt']});}})['then'](function(_0x1b4475){if(_0x1b4475){return{'count':_0x1b4475['count'],'rows':_[_0xb209('0x38')](_0x1b4475[_0xb209('0x4c')],function(_0x1dd9fd){return{'membername':_0x1dd9fd[_0xb209('0x31')],'UserId':_0x1dd9fd['id'],'queue_name':_0x1f610e['name'],'OpenchannelQueueId':_0x1f610e['id'],'interface':util[_0xb209('0x66')](_0xb209('0x67'),_0xb209('0x68'),_0x1dd9fd['name']),'penalty':0x0,'paused':_0x1dd9fd[_0xb209('0x69')],'createdAt':_0x1dd9fd['createdAt'],'updatedAt':_0x1dd9fd[_0xb209('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb209('0x2c')](respondWithFilteredResult(_0x554cc3,_0x217c56))['catch'](handleError(_0x554cc3,null));};exports[_0xb209('0x6a')]=function(_0x59b114,_0x576f65,_0x21e28f){var _0x4e422d={};var _0x27eaf1={};var _0x554fbe;var _0x5851bc;return db[_0xb209('0x34')][_0xb209('0x5c')]({'where':{'id':_0x59b114[_0xb209('0x59')]['id']}})['then'](handleEntityNotFound(_0x576f65,null))[_0xb209('0x2c')](function(_0x2e8415){if(_0x2e8415){_0x554fbe=_0x2e8415;_0x27eaf1[_0xb209('0x37')]=_['keys'](db[_0xb209('0x6b')][_0xb209('0x35')]);_0x27eaf1[_0xb209('0x39')]=_[_0xb209('0x3a')](_0x59b114[_0xb209('0x39')]);_0x27eaf1[_0xb209('0x42')]=_[_0xb209('0x3b')](_0x27eaf1[_0xb209('0x37')],_0x27eaf1['query']);_0x4e422d[_0xb209('0x3c')]=_[_0xb209('0x3b')](_0x27eaf1[_0xb209('0x37')],qs[_0xb209('0x3d')](_0x59b114[_0xb209('0x39')][_0xb209('0x3d')]));_0x4e422d[_0xb209('0x3c')]=_0x4e422d[_0xb209('0x3c')][_0xb209('0x5e')]?_0x4e422d['attributes']:_0x27eaf1[_0xb209('0x37')];_0x4e422d[_0xb209('0x40')]=qs['sort'](_0x59b114['query'][_0xb209('0x41')]);_0x4e422d[_0xb209('0x44')]=qs[_0xb209('0x42')](_[_0xb209('0x60')](_0x59b114[_0xb209('0x39')],_0x27eaf1[_0xb209('0x42')]));if(_0x59b114[_0xb209('0x39')][_0xb209('0x43')]){_0x4e422d['where']=_[_0xb209('0x45')](_0x4e422d[_0xb209('0x44')],{'$or':_[_0xb209('0x38')](_0x4e422d['attributes'],function(_0x537a17){var _0x223500={};_0x223500[_0x537a17]={'$like':'%'+_0x59b114[_0xb209('0x39')][_0xb209('0x43')]+'%'};return _0x223500;})});}_0x4e422d=_[_0xb209('0x45')]({},_0x4e422d,_0x59b114[_0xb209('0x48')]);return _0x554fbe[_0xb209('0x6a')](_0x4e422d);}})[_0xb209('0x2c')](function(_0x264509){if(_0x264509){_0x5851bc=_0x264509['length'];if(!_0x59b114[_0xb209('0x39')][_0xb209('0x3e')](_0xb209('0x5f'))){_0x4e422d['limit']=qs[_0xb209('0x3f')](_0x59b114['query']['limit']);_0x4e422d['offset']=qs[_0xb209('0x23')](_0x59b114[_0xb209('0x39')]['offset']);}return _0x554fbe['getTeams'](_0x4e422d);}})[_0xb209('0x2c')](function(_0x1b9020){if(_0x1b9020){return _0x1b9020?{'count':_0x5851bc,'rows':_0x1b9020}:null;}})[_0xb209('0x2c')](respondWithResult(_0x576f65,null))[_0xb209('0x4f')](handleError(_0x576f65,null));};exports['addTeams']=function(_0xe76f0e,_0x53732c,_0x39e17f){var _0x3c32f5=_0xe76f0e[_0xb209('0x51')]['ids'];return db[_0xb209('0x6b')][_0xb209('0x4b')]({'where':{'id':_0x3c32f5},'attributes':['id'],'include':[{'model':db[_0xb209('0x62')],'as':_0xb209('0x6c'),'attributes':['id','name',_0xb209('0x6d'),_0xb209('0x6e'),_0xb209('0x6f')],'raw':!![]}]})[_0xb209('0x2c')](function(_0x589ec8){if(_0x589ec8){var _0x4f272b=_[_0xb209('0x70')](_0x589ec8,function(_0x372c40){var _0x331205=_0x372c40[_0xb209('0x53')]({'plain':!![]});return _0x331205[_0xb209('0x6c')];});return db[_0xb209('0x34')]['find']({'where':{'id':_0xe76f0e[_0xb209('0x59')]['id']}})[_0xb209('0x2c')](function(_0x34fbd6){return db[_0xb209('0x71')][_0xb209('0x72')](function(_0x18bd7e){return _0x34fbd6[_0xb209('0x73')](_0x3c32f5,{'transaction':_0x18bd7e})[_0xb209('0x2c')](function(){return BPromise[_0xb209('0x74')](_0x4f272b,function(_0x3d7361){return db[_0xb209('0x5d')][_0xb209('0x75')]({'where':{'UserId':_0x3d7361['id'],'OpenchannelQueueId':_0xe76f0e[_0xb209('0x59')]['id']},'transaction':_0x18bd7e});});})['then'](function(){_0x4f272b[_0xb209('0x76')](function(_0x336c5d){socket[_0xb209('0x77')](_0xb209('0x78'),{'UserId':_0x336c5d['id'],'OpenchannelQueueId':_0x34fbd6['id']});});});});});}})['then'](respondWithStatusCode(_0x53732c,null))[_0xb209('0x4f')](handleError(_0x53732c,null));};exports[_0xb209('0x79')]=function(_0x6ab1d3,_0xc5cf77,_0x3b5cc4){return db[_0xb209('0x6b')]['findAll']({'where':{'id':_0x6ab1d3[_0xb209('0x39')][_0xb209('0x7a')]},'attributes':['id'],'include':[{'model':db[_0xb209('0x62')],'as':_0xb209('0x6c'),'attributes':['id'],'raw':!![]}]})[_0xb209('0x2c')](handleEntityNotFound(_0xc5cf77,null))[_0xb209('0x2c')](function(_0x13be22){var _0x505673=_['map'](_0x13be22,'id');var _0x54e4d2=[];var _0x2d4e86=[];var _0x258ac7=squel['select']();_0x258ac7[_0xb209('0x7b')](_0xb209('0x7c'))[_0xb209('0x7d')](_0xb209('0x7e'),'tq')[_0xb209('0x7f')](_0xb209('0x80'),'ut',_0xb209('0x81'))['where']('OpenchannelQueueId\x20=\x20?',_0x6ab1d3[_0xb209('0x59')]['id']);for(var _0x41fd2a=0x0;_0x41fd2a<_0x13be22[_0xb209('0x5e')];_0x41fd2a+=0x1){let _0x170b9e=_0x13be22[_0x41fd2a];for(var _0x150d84=0x0;_0x150d84<_0x170b9e['Agents'][_0xb209('0x5e')];_0x150d84+=0x1){let _0x204031=_0x170b9e[_0xb209('0x6c')][_0x150d84];var _0x2f4560=_0x258ac7[_0xb209('0x82')]();_0x2f4560['where']('ut.UserId\x20=\x20?',_0x204031['id']);_0x2d4e86[_0xb209('0x83')](db[_0xb209('0x71')][_0xb209('0x39')](_0x2f4560[_0xb209('0x84')](),{'type':db[_0xb209('0x71')]['QueryTypes']['SELECT']})[_0xb209('0x2c')](function(_0x1a8989){if(_0x1a8989[_0xb209('0x5e')]===0x1){return _0x204031['id'];}else{var _0x4c79b8=_['every'](_[_0xb209('0x38')](_0x1a8989,_0xb209('0x85')),function(_0x9f3180){return _[_0xb209('0x86')](_0x505673,_0x9f3180);});if(_0x4c79b8){return _0x204031['id'];}}}));}}return BPromise[_0xb209('0x87')](_0x2d4e86)[_0xb209('0x2c')](function(_0x39beb4){_0x54e4d2=_(_0x54e4d2)[_0xb209('0x88')](_0x39beb4)['compact']()[_0xb209('0x89')]();return db['OpenchannelQueue'][_0xb209('0x4e')]({'where':{'id':_0x6ab1d3['params']['id']}})[_0xb209('0x2c')](function(_0x183c8e){return db[_0xb209('0x71')][_0xb209('0x72')](function(_0x869ebf){return _0x183c8e['removeTeams'](_0x6ab1d3['query'][_0xb209('0x7a')],{'transaction':_0x869ebf})['then'](function(){if(!_[_0xb209('0x8a')](_0x54e4d2)){return _0x183c8e[_0xb209('0x8b')](_0x54e4d2,{'transaction':_0x869ebf});}})[_0xb209('0x2c')](function(){_0x54e4d2[_0xb209('0x76')](function(_0x19caed){socket[_0xb209('0x77')](_0xb209('0x8c'),{'UserId':_0x19caed,'OpenchannelQueueId':_0x183c8e['id']});});});});});});})[_0xb209('0x2c')](respondWithStatusCode(_0xc5cf77,null))[_0xb209('0x4f')](handleError(_0xc5cf77,null));};exports[_0xb209('0x8d')]=function(_0x7166bf,_0xba177c,_0x3c04d6){return db[_0xb209('0x34')][_0xb209('0x4e')]({'where':{'id':_0x7166bf[_0xb209('0x59')]['id']}})[_0xb209('0x2c')](handleEntityNotFound(_0xba177c,null))[_0xb209('0x2c')](function(_0x907c2b){if(_0x907c2b){return _0x907c2b[_0xb209('0x8d')](_0x7166bf['body'][_0xb209('0x7a')],_[_0xb209('0x8e')](_0x7166bf[_0xb209('0x51')],['ids','id'])||{})[_0xb209('0x8f')](function(_0x4852ab){for(var _0x482383=0x0;_0x482383<_0x7166bf['body'][_0xb209('0x7a')][_0xb209('0x5e')];_0x482383+=0x1){socket[_0xb209('0x77')]('userOpenchannelQueue:save',{'UserId':Number(_0x7166bf[_0xb209('0x51')][_0xb209('0x7a')][_0x482383]),'OpenchannelQueueId':Number(_0x7166bf['params']['id'])});}return _0x4852ab;});}})[_0xb209('0x2c')](respondWithResult(_0xba177c,null))[_0xb209('0x4f')](handleError(_0xba177c,null));};exports[_0xb209('0x8b')]=function(_0x18feff,_0x29971d,_0x256737){return db['OpenchannelQueue'][_0xb209('0x4e')]({'where':{'id':_0x18feff[_0xb209('0x59')]['id']}})[_0xb209('0x2c')](handleEntityNotFound(_0x29971d,null))[_0xb209('0x2c')](function(_0x19c164){if(_0x19c164){return _0x19c164[_0xb209('0x8b')](_0x18feff[_0xb209('0x39')]['ids'])[_0xb209('0x2c')](function(){if(_[_0xb209('0x90')](_0x18feff[_0xb209('0x39')][_0xb209('0x7a')])){for(var _0x52eb8b=0x0;_0x52eb8b<_0x18feff[_0xb209('0x39')][_0xb209('0x7a')][_0xb209('0x5e')];_0x52eb8b+=0x1){socket[_0xb209('0x77')]('userOpenchannelQueue:remove',{'UserId':Number(_0x18feff[_0xb209('0x39')][_0xb209('0x7a')][_0x52eb8b]),'OpenchannelQueueId':Number(_0x18feff[_0xb209('0x59')]['id'])});}}else{socket[_0xb209('0x77')](_0xb209('0x8c'),{'UserId':Number(_0x18feff[_0xb209('0x39')]['ids']),'OpenchannelQueueId':Number(_0x18feff[_0xb209('0x59')]['id'])});}});}})[_0xb209('0x2c')](respondWithStatusCode(_0x29971d,null))[_0xb209('0x4f')](handleError(_0x29971d,null));};exports[_0xb209('0x91')]=function(_0x57cba2,_0x387aab,_0xa50e83){var _0x538c88={};var _0x1e5fca={};var _0x2ee361;var _0x110251;return db[_0xb209('0x34')][_0xb209('0x5c')]({'where':{'id':_0x57cba2[_0xb209('0x59')]['id']}})[_0xb209('0x2c')](handleEntityNotFound(_0x387aab,null))['then'](function(_0x2d7e42){if(_0x2d7e42){_0x2ee361=_0x2d7e42;_0x1e5fca[_0xb209('0x37')]=_[_0xb209('0x3a')](db[_0xb209('0x62')]['rawAttributes']);_0x1e5fca['query']=_['keys'](_0x57cba2[_0xb209('0x39')]);_0x1e5fca[_0xb209('0x42')]=_[_0xb209('0x3b')](_0x1e5fca[_0xb209('0x37')],_0x1e5fca[_0xb209('0x39')]);_0x538c88['attributes']=_[_0xb209('0x3b')](_0x1e5fca[_0xb209('0x37')],qs[_0xb209('0x3d')](_0x57cba2['query'][_0xb209('0x3d')]));_0x538c88[_0xb209('0x3c')]=_0x538c88['attributes'][_0xb209('0x5e')]?_0x538c88['attributes']:_0x1e5fca[_0xb209('0x37')];_0x538c88[_0xb209('0x40')]=qs[_0xb209('0x41')](_0x57cba2['query'][_0xb209('0x41')]);_0x538c88[_0xb209('0x44')]=qs[_0xb209('0x42')](_['pick'](_0x57cba2[_0xb209('0x39')],_0x1e5fca['filters']));if(_0x57cba2[_0xb209('0x39')]['filter']){_0x538c88[_0xb209('0x44')]=_[_0xb209('0x45')](_0x538c88[_0xb209('0x44')],{'$or':_[_0xb209('0x38')](_0x538c88[_0xb209('0x3c')],function(_0xf4270b){var _0x483fc5={};_0x483fc5[_0xf4270b]={'$like':'%'+_0x57cba2['query'][_0xb209('0x43')]+'%'};return _0x483fc5;})});}_0x538c88=_[_0xb209('0x45')]({},_0x538c88,_0x57cba2[_0xb209('0x48')]);return _0x2ee361['getAgents'](_0x538c88);}})['then'](function(_0x265bde){if(_0x265bde){_0x110251=_0x265bde[_0xb209('0x5e')];if(!_0x57cba2[_0xb209('0x39')]['hasOwnProperty'](_0xb209('0x5f'))){_0x538c88[_0xb209('0x3f')]=qs['limit'](_0x57cba2[_0xb209('0x39')][_0xb209('0x3f')]);_0x538c88[_0xb209('0x23')]=qs[_0xb209('0x23')](_0x57cba2[_0xb209('0x39')][_0xb209('0x23')]);}return _0x2ee361[_0xb209('0x91')](_0x538c88);}})[_0xb209('0x2c')](function(_0x53f2bc){if(_0x53f2bc){return _0x53f2bc?{'count':_0x110251,'rows':_0x53f2bc}:null;}})[_0xb209('0x2c')](respondWithResult(_0x387aab,null))[_0xb209('0x4f')](handleError(_0x387aab,null));}; \ No newline at end of file +var _0x8551=['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','redis','defaults','end','status','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','get','OpenchannelQueues','sendStatus','error','stack','name','send','index','OpenchannelQueue','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserOpenchannelQueue','OpenchannelQueueId','findAll','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','rows','%s/%s','Team','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','field','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','removeAgents','addAgents','omit','userOpenchannelQueue:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0x8551,0x194));var _0x1855=function(_0x22730b,_0x3aafcd){_0x22730b=_0x22730b-0x0;var _0x20af64=_0x8551[_0x22730b];return _0x20af64;};'use strict';var emlformat=require(_0x1855('0x0'));var rimraf=require(_0x1855('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1855('0x2'));var rp=require(_0x1855('0x3'));var moment=require(_0x1855('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1855('0x5'));var util=require('util');var path=require(_0x1855('0x6'));var sox=require(_0x1855('0x7'));var csv=require(_0x1855('0x8'));var ejs=require(_0x1855('0x9'));var fs=require('fs');var fs_extra=require(_0x1855('0xa'));var _=require(_0x1855('0xb'));var squel=require(_0x1855('0xc'));var crypto=require('crypto');var jsforce=require(_0x1855('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1855('0x8'));var querystring=require('querystring');var Papa=require(_0x1855('0xe'));var Redis=require(_0x1855('0xf'));var authService=require(_0x1855('0x10'));var qs=require(_0x1855('0x11'));var as=require(_0x1855('0x12'));var hardwareService=require(_0x1855('0x13'));var logger=require(_0x1855('0x14'))(_0x1855('0x15'));var utils=require(_0x1855('0x16'));var config=require(_0x1855('0x17'));var licenseUtil=require(_0x1855('0x18'));var db=require('../../mysqldb')['db'];config[_0x1855('0x19')]=_[_0x1855('0x1a')](config[_0x1855('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1855('0x19')]));require('./openchannelQueue.socket')['register'](socket);function respondWithStatusCode(_0x103696,_0x4e4b5d){_0x4e4b5d=_0x4e4b5d||0xcc;return function(_0x21e7b3){if(_0x21e7b3){return _0x103696['sendStatus'](_0x4e4b5d);}return _0x103696['status'](_0x4e4b5d)[_0x1855('0x1b')]();};}function respondWithResult(_0x434e17,_0x140901){_0x140901=_0x140901||0xc8;return function(_0x3983bb){if(_0x3983bb){return _0x434e17[_0x1855('0x1c')](_0x140901)[_0x1855('0x1d')](_0x3983bb);}};}function respondWithFilteredResult(_0x3aa64d,_0x4e14b6){return function(_0xacbe50){if(_0xacbe50){var _0x2caad9=typeof _0x4e14b6[_0x1855('0x1e')]===_0x1855('0x1f')&&typeof _0x4e14b6[_0x1855('0x20')]===_0x1855('0x1f');var _0x47d1e7=_0xacbe50[_0x1855('0x21')];var _0x265c3c=_0x2caad9?0x0:_0x4e14b6['offset'];var _0x37047e=_0x2caad9?_0xacbe50['count']:_0x4e14b6[_0x1855('0x1e')]+_0x4e14b6[_0x1855('0x20')];var _0xeca033;if(_0x37047e>=_0x47d1e7){_0x37047e=_0x47d1e7;_0xeca033=0xc8;}else{_0xeca033=0xce;}_0x3aa64d['status'](_0xeca033);return _0x3aa64d['set']('Content-Range',_0x265c3c+'-'+_0x37047e+'/'+_0x47d1e7)['json'](_0xacbe50);}return null;};}function patchUpdates(_0x280951){return function(_0x424468){try{jsonpatch[_0x1855('0x22')](_0x424468,_0x280951,!![]);}catch(_0x3d9c70){return BPromise[_0x1855('0x23')](_0x3d9c70);}return _0x424468[_0x1855('0x24')]();};}function saveUpdates(_0x457250,_0x5181f6){return function(_0x38d90f){if(_0x38d90f){return _0x38d90f[_0x1855('0x25')](_0x457250)[_0x1855('0x26')](function(_0x10f536){return _0x10f536;});}return null;};}function removeEntity(_0x2fddd4,_0x59c7b0){return function(_0x5055ed){if(_0x5055ed){return _0x5055ed[_0x1855('0x27')]()[_0x1855('0x26')](function(){var _0x24acf4=_0x5055ed[_0x1855('0x28')]({'plain':!![]});var _0x4bd6cd=_0x1855('0x29');return db['UserProfileResource'][_0x1855('0x27')]({'where':{'type':_0x4bd6cd,'resourceId':_0x24acf4['id']}})[_0x1855('0x26')](function(){return _0x5055ed;});})[_0x1855('0x26')](function(){_0x2fddd4[_0x1855('0x1c')](0xcc)[_0x1855('0x1b')]();});}};}function handleEntityNotFound(_0x1327b9,_0x45fec1){return function(_0x34d9dd){if(!_0x34d9dd){_0x1327b9[_0x1855('0x2a')](0x194);}return _0x34d9dd;};}function handleError(_0x86ca1,_0x337304){_0x337304=_0x337304||0x1f4;return function(_0x114b1d){logger[_0x1855('0x2b')](_0x114b1d[_0x1855('0x2c')]);if(_0x114b1d[_0x1855('0x2d')]){delete _0x114b1d[_0x1855('0x2d')];}_0x86ca1[_0x1855('0x1c')](_0x337304)[_0x1855('0x2e')](_0x114b1d);};}exports[_0x1855('0x2f')]=function(_0xee730d,_0x36f18a){var _0x1668e9={},_0x4bb4bc={},_0x2d8bb6={'count':0x0,'rows':[]};var _0x29440f=_['map'](db[_0x1855('0x30')]['rawAttributes'],function(_0x5ebf01){return{'name':_0x5ebf01[_0x1855('0x31')],'type':_0x5ebf01[_0x1855('0x32')][_0x1855('0x33')]};});_0x4bb4bc[_0x1855('0x34')]=_[_0x1855('0x35')](_0x29440f,_0x1855('0x2d'));_0x4bb4bc[_0x1855('0x36')]=_[_0x1855('0x37')](_0xee730d[_0x1855('0x36')]);_0x4bb4bc[_0x1855('0x38')]=_['intersection'](_0x4bb4bc[_0x1855('0x34')],_0x4bb4bc[_0x1855('0x36')]);_0x1668e9[_0x1855('0x39')]=_[_0x1855('0x3a')](_0x4bb4bc[_0x1855('0x34')],qs['fields'](_0xee730d[_0x1855('0x36')][_0x1855('0x3b')]));_0x1668e9[_0x1855('0x39')]=_0x1668e9[_0x1855('0x39')][_0x1855('0x3c')]?_0x1668e9[_0x1855('0x39')]:_0x4bb4bc[_0x1855('0x34')];if(!_0xee730d['query'][_0x1855('0x3d')](_0x1855('0x3e'))){_0x1668e9[_0x1855('0x20')]=qs[_0x1855('0x20')](_0xee730d[_0x1855('0x36')][_0x1855('0x20')]);_0x1668e9[_0x1855('0x1e')]=qs['offset'](_0xee730d['query'][_0x1855('0x1e')]);}_0x1668e9[_0x1855('0x3f')]=qs[_0x1855('0x40')](_0xee730d[_0x1855('0x36')][_0x1855('0x40')]);_0x1668e9[_0x1855('0x41')]=qs['filters'](_[_0x1855('0x42')](_0xee730d[_0x1855('0x36')],_0x4bb4bc['filters']),_0x29440f);if(_0xee730d['query'][_0x1855('0x43')]){_0x1668e9[_0x1855('0x41')]=_[_0x1855('0x44')](_0x1668e9[_0x1855('0x41')],{'$or':_[_0x1855('0x35')](_0x29440f,function(_0x4b1688){if(_0x4b1688[_0x1855('0x32')]!==_0x1855('0x45')){var _0x415090={};_0x415090[_0x4b1688[_0x1855('0x2d')]]={'$like':'%'+_0xee730d[_0x1855('0x36')][_0x1855('0x43')]+'%'};return _0x415090;}})});}_0x1668e9=_[_0x1855('0x44')]({},_0x1668e9,_0xee730d[_0x1855('0x46')]);var _0x4c5dc2={'where':_0x1668e9[_0x1855('0x41')]};return db[_0x1855('0x30')][_0x1855('0x21')](_0x4c5dc2)[_0x1855('0x26')](function(_0x36547f){_0x2d8bb6[_0x1855('0x21')]=_0x36547f;if(_0xee730d[_0x1855('0x36')][_0x1855('0x47')]){_0x1668e9[_0x1855('0x48')]=[{'all':!![]}];}return db[_0x1855('0x30')]['findAll'](_0x1668e9);})[_0x1855('0x26')](function(_0x2e7263){_0x2d8bb6['rows']=_0x2e7263;return _0x2d8bb6;})[_0x1855('0x26')](respondWithFilteredResult(_0x36f18a,_0x1668e9))[_0x1855('0x49')](handleError(_0x36f18a,null));};exports[_0x1855('0x4a')]=function(_0xecf4e7,_0x308cb7){var _0x591291={'raw':!![],'where':{'id':_0xecf4e7[_0x1855('0x4b')]['id']}},_0x230f17={};_0x230f17[_0x1855('0x34')]=_[_0x1855('0x37')](db[_0x1855('0x30')][_0x1855('0x4c')]);_0x230f17[_0x1855('0x36')]=_['keys'](_0xecf4e7[_0x1855('0x36')]);_0x230f17[_0x1855('0x38')]=_['intersection'](_0x230f17[_0x1855('0x34')],_0x230f17['query']);_0x591291['attributes']=_['intersection'](_0x230f17[_0x1855('0x34')],qs[_0x1855('0x3b')](_0xecf4e7[_0x1855('0x36')][_0x1855('0x3b')]));_0x591291['attributes']=_0x591291[_0x1855('0x39')][_0x1855('0x3c')]?_0x591291[_0x1855('0x39')]:_0x230f17[_0x1855('0x34')];if(_0xecf4e7['query'][_0x1855('0x47')]){_0x591291[_0x1855('0x48')]=[{'all':!![]}];}_0x591291=_['merge']({},_0x591291,_0xecf4e7[_0x1855('0x46')]);return db[_0x1855('0x30')][_0x1855('0x4d')](_0x591291)[_0x1855('0x26')](handleEntityNotFound(_0x308cb7,null))['then'](respondWithResult(_0x308cb7,null))[_0x1855('0x49')](handleError(_0x308cb7,null));};exports[_0x1855('0x4e')]=function(_0x4bb40e,_0x131208){return db[_0x1855('0x30')][_0x1855('0x4e')](_0x4bb40e[_0x1855('0x4f')],{})['then'](function(_0x33b17f){var _0x41bb7c=_0x4bb40e[_0x1855('0x50')]['get']({'plain':!![]});if(!_0x41bb7c)throw new Error(_0x1855('0x51'));if(_0x41bb7c['role']===_0x1855('0x50')){var _0x218447=_0x33b17f['get']({'plain':!![]});var _0x42167b=_0x1855('0x29');return db[_0x1855('0x52')][_0x1855('0x4d')]({'where':{'name':_0x42167b,'userProfileId':_0x41bb7c[_0x1855('0x53')]},'raw':!![]})[_0x1855('0x26')](function(_0x1630d9){if(_0x1630d9&&_0x1630d9['autoAssociation']===0x0){return db[_0x1855('0x54')][_0x1855('0x4e')]({'name':_0x218447[_0x1855('0x2d')],'resourceId':_0x218447['id'],'type':_0x1630d9['name'],'sectionId':_0x1630d9['id']},{})[_0x1855('0x26')](function(){return _0x33b17f;});}else{return _0x33b17f;}})[_0x1855('0x49')](function(_0x3bc1c5){logger[_0x1855('0x2b')](_0x1855('0x55'),_0x3bc1c5);throw _0x3bc1c5;});}return _0x33b17f;})[_0x1855('0x26')](respondWithResult(_0x131208,0xc9))[_0x1855('0x49')](handleError(_0x131208,null));};exports[_0x1855('0x25')]=function(_0xaa6f6a,_0x54ad0a){if(_0xaa6f6a[_0x1855('0x4f')]['id']){delete _0xaa6f6a[_0x1855('0x4f')]['id'];}return db[_0x1855('0x30')][_0x1855('0x4d')]({'where':{'id':_0xaa6f6a['params']['id']}})[_0x1855('0x26')](handleEntityNotFound(_0x54ad0a,null))['then'](saveUpdates(_0xaa6f6a[_0x1855('0x4f')],null))[_0x1855('0x26')](respondWithResult(_0x54ad0a,null))['catch'](handleError(_0x54ad0a,null));};exports[_0x1855('0x27')]=function(_0x30e17e,_0x34d711){return db[_0x1855('0x30')]['find']({'where':{'id':_0x30e17e[_0x1855('0x4b')]['id']}})['then'](handleEntityNotFound(_0x34d711,null))[_0x1855('0x26')](removeEntity(_0x34d711,null))[_0x1855('0x49')](handleError(_0x34d711,null));};exports[_0x1855('0x56')]=function(_0x331849,_0x36cf47){return db[_0x1855('0x30')][_0x1855('0x56')]()[_0x1855('0x26')](respondWithResult(_0x36cf47,null))[_0x1855('0x49')](handleError(_0x36cf47,null));};exports['getMembers']=function(_0x1b08a7,_0x3afe06,_0x2d8a8a){var _0x1bdde2={'raw':!![],'where':{}},_0x5adad6={},_0x396d74;return db['OpenchannelQueue'][_0x1855('0x57')]({'where':{'id':_0x1b08a7[_0x1855('0x4b')]['id']}})[_0x1855('0x26')](handleEntityNotFound(_0x3afe06,null))[_0x1855('0x26')](function(_0x38a12d){if(_0x38a12d){_0x396d74=_0x38a12d[_0x1855('0x28')]({'plain':!![]});_0x5adad6['model']=_[_0x1855('0x37')](db[_0x1855('0x58')][_0x1855('0x4c')]);_0x5adad6[_0x1855('0x36')]=_[_0x1855('0x37')](_0x1b08a7[_0x1855('0x36')]);_0x5adad6['filters']=_[_0x1855('0x3a')](_0x5adad6['model'],_0x5adad6[_0x1855('0x36')]);_0x1bdde2[_0x1855('0x39')]=_[_0x1855('0x3a')](_0x5adad6[_0x1855('0x34')],qs[_0x1855('0x3b')](_0x1b08a7['query'][_0x1855('0x3b')]));_0x1bdde2[_0x1855('0x39')]=_0x1bdde2[_0x1855('0x39')][_0x1855('0x3c')]?_0x1bdde2['attributes']:_0x5adad6['model'];if(!_0x1b08a7['query'][_0x1855('0x3d')](_0x1855('0x3e'))){_0x1bdde2['limit']=qs['limit'](_0x1b08a7[_0x1855('0x36')][_0x1855('0x20')]);_0x1bdde2[_0x1855('0x1e')]=qs[_0x1855('0x1e')](_0x1b08a7['query'][_0x1855('0x1e')]);}_0x1bdde2[_0x1855('0x3f')]=qs[_0x1855('0x40')](_0x1b08a7['query'][_0x1855('0x40')]);_0x1bdde2[_0x1855('0x41')]=qs[_0x1855('0x38')](_[_0x1855('0x42')](_0x1b08a7[_0x1855('0x36')],_0x5adad6[_0x1855('0x38')]));_0x1bdde2[_0x1855('0x41')][_0x1855('0x59')]=_0x38a12d['id'];if(_0x1b08a7[_0x1855('0x36')][_0x1855('0x43')]){_0x1bdde2[_0x1855('0x41')]=_[_0x1855('0x44')](_0x1bdde2[_0x1855('0x41')],{'$or':_[_0x1855('0x35')](_0x1bdde2[_0x1855('0x39')],function(_0x371908){var _0x384ede={};_0x384ede[_0x371908]={'$like':'%'+_0x1b08a7[_0x1855('0x36')][_0x1855('0x43')]+'%'};return _0x384ede;})});}_0x1bdde2=_[_0x1855('0x44')]({},_0x1bdde2,_0x1b08a7[_0x1855('0x46')]);return db[_0x1855('0x58')][_0x1855('0x5a')](_0x1bdde2);}})[_0x1855('0x26')](function(_0x20ff4e){if(_0x20ff4e){return db[_0x1855('0x5b')][_0x1855('0x5c')]({'where':{'id':_['map'](_0x20ff4e,_0x1855('0x5d')),'role':_0x1855('0x5e')},'attributes':['id',_0x1855('0x2d'),_0x1855('0x5f'),_0x1855('0x60'),_0x1855('0x61')]});}})[_0x1855('0x26')](function(_0x3a54d0){if(_0x3a54d0){return{'count':_0x3a54d0[_0x1855('0x21')],'rows':_['map'](_0x3a54d0[_0x1855('0x62')],function(_0xaf3688){return{'membername':_0xaf3688['name'],'UserId':_0xaf3688['id'],'queue_name':_0x396d74[_0x1855('0x2d')],'OpenchannelQueueId':_0x396d74['id'],'interface':util['format'](_0x1855('0x63'),'SIP',_0xaf3688['name']),'penalty':0x0,'paused':_0xaf3688[_0x1855('0x5f')],'createdAt':_0xaf3688['createdAt'],'updatedAt':_0xaf3688[_0x1855('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1855('0x26')](respondWithFilteredResult(_0x3afe06,_0x1bdde2))[_0x1855('0x49')](handleError(_0x3afe06,null));};exports['getTeams']=function(_0x2080e1,_0x3e9e3e,_0x6b676b){var _0x4260d2={};var _0x48863a={};var _0x1598f8;var _0x2a7be8;return db[_0x1855('0x30')][_0x1855('0x57')]({'where':{'id':_0x2080e1['params']['id']}})[_0x1855('0x26')](handleEntityNotFound(_0x3e9e3e,null))[_0x1855('0x26')](function(_0x13874e){if(_0x13874e){_0x1598f8=_0x13874e;_0x48863a[_0x1855('0x34')]=_[_0x1855('0x37')](db[_0x1855('0x64')]['rawAttributes']);_0x48863a[_0x1855('0x36')]=_[_0x1855('0x37')](_0x2080e1[_0x1855('0x36')]);_0x48863a[_0x1855('0x38')]=_['intersection'](_0x48863a[_0x1855('0x34')],_0x48863a[_0x1855('0x36')]);_0x4260d2[_0x1855('0x39')]=_[_0x1855('0x3a')](_0x48863a[_0x1855('0x34')],qs[_0x1855('0x3b')](_0x2080e1[_0x1855('0x36')][_0x1855('0x3b')]));_0x4260d2['attributes']=_0x4260d2['attributes'][_0x1855('0x3c')]?_0x4260d2[_0x1855('0x39')]:_0x48863a[_0x1855('0x34')];_0x4260d2[_0x1855('0x3f')]=qs[_0x1855('0x40')](_0x2080e1[_0x1855('0x36')][_0x1855('0x40')]);_0x4260d2[_0x1855('0x41')]=qs[_0x1855('0x38')](_[_0x1855('0x42')](_0x2080e1['query'],_0x48863a['filters']));if(_0x2080e1[_0x1855('0x36')]['filter']){_0x4260d2[_0x1855('0x41')]=_[_0x1855('0x44')](_0x4260d2[_0x1855('0x41')],{'$or':_[_0x1855('0x35')](_0x4260d2[_0x1855('0x39')],function(_0x572be9){var _0x561683={};_0x561683[_0x572be9]={'$like':'%'+_0x2080e1['query'][_0x1855('0x43')]+'%'};return _0x561683;})});}_0x4260d2=_['merge']({},_0x4260d2,_0x2080e1['options']);return _0x1598f8['getTeams'](_0x4260d2);}})[_0x1855('0x26')](function(_0x22d7c8){if(_0x22d7c8){_0x2a7be8=_0x22d7c8[_0x1855('0x3c')];if(!_0x2080e1[_0x1855('0x36')][_0x1855('0x3d')]('nolimit')){_0x4260d2[_0x1855('0x20')]=qs[_0x1855('0x20')](_0x2080e1[_0x1855('0x36')][_0x1855('0x20')]);_0x4260d2[_0x1855('0x1e')]=qs[_0x1855('0x1e')](_0x2080e1['query']['offset']);}return _0x1598f8['getTeams'](_0x4260d2);}})['then'](function(_0x31f0b9){if(_0x31f0b9){return _0x31f0b9?{'count':_0x2a7be8,'rows':_0x31f0b9}:null;}})[_0x1855('0x26')](respondWithResult(_0x3e9e3e,null))['catch'](handleError(_0x3e9e3e,null));};exports[_0x1855('0x65')]=function(_0x53d37b,_0x3db571,_0x48bbce){var _0x59e11f=_0x53d37b[_0x1855('0x4f')][_0x1855('0x66')];return db['Team'][_0x1855('0x5a')]({'where':{'id':_0x59e11f},'attributes':['id'],'include':[{'model':db[_0x1855('0x5b')],'as':_0x1855('0x67'),'attributes':['id',_0x1855('0x2d'),_0x1855('0x68'),_0x1855('0x69'),_0x1855('0x6a')],'raw':!![]}]})[_0x1855('0x26')](function(_0x19a866){if(_0x19a866){var _0x5438de=_['flatMap'](_0x19a866,function(_0x2c12bc){var _0x5a17e1=_0x2c12bc[_0x1855('0x28')]({'plain':!![]});return _0x5a17e1[_0x1855('0x67')];});return db[_0x1855('0x30')][_0x1855('0x4d')]({'where':{'id':_0x53d37b['params']['id']}})[_0x1855('0x26')](function(_0x4b5913){return db[_0x1855('0x6b')][_0x1855('0x6c')](function(_0x1ff6c8){return _0x4b5913[_0x1855('0x65')](_0x59e11f,{'transaction':_0x1ff6c8})[_0x1855('0x26')](function(){return BPromise[_0x1855('0x6d')](_0x5438de,function(_0x110e50){return db[_0x1855('0x58')][_0x1855('0x6e')]({'where':{'UserId':_0x110e50['id'],'OpenchannelQueueId':_0x53d37b[_0x1855('0x4b')]['id']},'transaction':_0x1ff6c8});});})[_0x1855('0x26')](function(){_0x5438de[_0x1855('0x6f')](function(_0x1b9058){socket[_0x1855('0x70')](_0x1855('0x71'),{'UserId':_0x1b9058['id'],'OpenchannelQueueId':_0x4b5913['id']});});});});});}})['then'](respondWithStatusCode(_0x3db571,null))[_0x1855('0x49')](handleError(_0x3db571,null));};exports[_0x1855('0x72')]=function(_0x39a62f,_0x1052d6,_0x216404){return db['Team'][_0x1855('0x5a')]({'where':{'id':_0x39a62f[_0x1855('0x36')][_0x1855('0x66')]},'attributes':['id'],'include':[{'model':db[_0x1855('0x5b')],'as':_0x1855('0x67'),'attributes':['id'],'raw':!![]}]})[_0x1855('0x26')](handleEntityNotFound(_0x1052d6,null))[_0x1855('0x26')](function(_0x46b1be){var _0x43dce5=_[_0x1855('0x35')](_0x46b1be,'id');var _0x58f7eb=[];var _0xec2a9c=[];var _0x1e7591=squel['select']();_0x1e7591[_0x1855('0x73')](_0x1855('0x74'))['from']('team_has_openchannel_queues','tq')[_0x1855('0x75')](_0x1855('0x76'),'ut',_0x1855('0x77'))[_0x1855('0x41')](_0x1855('0x78'),_0x39a62f['params']['id']);for(var _0x4b16ea=0x0;_0x4b16ea<_0x46b1be[_0x1855('0x3c')];_0x4b16ea+=0x1){let _0x3873dd=_0x46b1be[_0x4b16ea];for(var _0x4348a1=0x0;_0x4348a1<_0x3873dd[_0x1855('0x67')][_0x1855('0x3c')];_0x4348a1+=0x1){let _0x2f3860=_0x3873dd[_0x1855('0x67')][_0x4348a1];var _0x20f25f=_0x1e7591[_0x1855('0x79')]();_0x20f25f['where'](_0x1855('0x7a'),_0x2f3860['id']);_0xec2a9c[_0x1855('0x7b')](db['sequelize'][_0x1855('0x36')](_0x20f25f[_0x1855('0x7c')](),{'type':db[_0x1855('0x6b')][_0x1855('0x7d')][_0x1855('0x7e')]})[_0x1855('0x26')](function(_0x5379b6){if(_0x5379b6[_0x1855('0x3c')]===0x1){return _0x2f3860['id'];}else{var _0x4ec73d=_[_0x1855('0x7f')](_[_0x1855('0x35')](_0x5379b6,_0x1855('0x80')),function(_0x5b16e1){return _[_0x1855('0x81')](_0x43dce5,_0x5b16e1);});if(_0x4ec73d){return _0x2f3860['id'];}}}));}}return BPromise[_0x1855('0x82')](_0xec2a9c)[_0x1855('0x26')](function(_0x29729e){_0x58f7eb=_(_0x58f7eb)[_0x1855('0x83')](_0x29729e)[_0x1855('0x84')]()[_0x1855('0x85')]();return db[_0x1855('0x30')][_0x1855('0x4d')]({'where':{'id':_0x39a62f[_0x1855('0x4b')]['id']}})['then'](function(_0xb40559){return db[_0x1855('0x6b')][_0x1855('0x6c')](function(_0x331405){return _0xb40559['removeTeams'](_0x39a62f[_0x1855('0x36')][_0x1855('0x66')],{'transaction':_0x331405})[_0x1855('0x26')](function(){if(!_['isEmpty'](_0x58f7eb)){return _0xb40559[_0x1855('0x86')](_0x58f7eb,{'transaction':_0x331405});}})[_0x1855('0x26')](function(){_0x58f7eb[_0x1855('0x6f')](function(_0x30d9cf){socket[_0x1855('0x70')]('userOpenchannelQueue:remove',{'UserId':_0x30d9cf,'OpenchannelQueueId':_0xb40559['id']});});});});});});})[_0x1855('0x26')](respondWithStatusCode(_0x1052d6,null))[_0x1855('0x49')](handleError(_0x1052d6,null));};exports[_0x1855('0x87')]=function(_0x41b2ce,_0x3a7f03,_0x3352e4){return db[_0x1855('0x30')][_0x1855('0x4d')]({'where':{'id':_0x41b2ce['params']['id']}})[_0x1855('0x26')](handleEntityNotFound(_0x3a7f03,null))[_0x1855('0x26')](function(_0x1da27a){if(_0x1da27a){return _0x1da27a[_0x1855('0x87')](_0x41b2ce['body'][_0x1855('0x66')],_[_0x1855('0x88')](_0x41b2ce[_0x1855('0x4f')],['ids','id'])||{})['spread'](function(_0xdcfe64){for(var _0x36b5d0=0x0;_0x36b5d0<_0x41b2ce[_0x1855('0x4f')][_0x1855('0x66')]['length'];_0x36b5d0+=0x1){socket[_0x1855('0x70')]('userOpenchannelQueue:save',{'UserId':Number(_0x41b2ce[_0x1855('0x4f')][_0x1855('0x66')][_0x36b5d0]),'OpenchannelQueueId':Number(_0x41b2ce['params']['id'])});}return _0xdcfe64;});}})[_0x1855('0x26')](respondWithResult(_0x3a7f03,null))['catch'](handleError(_0x3a7f03,null));};exports[_0x1855('0x86')]=function(_0x56e7db,_0x4cbf05,_0x4180e4){return db[_0x1855('0x30')][_0x1855('0x4d')]({'where':{'id':_0x56e7db[_0x1855('0x4b')]['id']}})[_0x1855('0x26')](handleEntityNotFound(_0x4cbf05,null))[_0x1855('0x26')](function(_0x35027a){if(_0x35027a){return _0x35027a[_0x1855('0x86')](_0x56e7db[_0x1855('0x36')][_0x1855('0x66')])[_0x1855('0x26')](function(){if(_['isArray'](_0x56e7db[_0x1855('0x36')][_0x1855('0x66')])){for(var _0x8e147c=0x0;_0x8e147c<_0x56e7db[_0x1855('0x36')][_0x1855('0x66')]['length'];_0x8e147c+=0x1){socket[_0x1855('0x70')]('userOpenchannelQueue:remove',{'UserId':Number(_0x56e7db['query'][_0x1855('0x66')][_0x8e147c]),'OpenchannelQueueId':Number(_0x56e7db[_0x1855('0x4b')]['id'])});}}else{socket[_0x1855('0x70')](_0x1855('0x89'),{'UserId':Number(_0x56e7db[_0x1855('0x36')][_0x1855('0x66')]),'OpenchannelQueueId':Number(_0x56e7db[_0x1855('0x4b')]['id'])});}});}})['then'](respondWithStatusCode(_0x4cbf05,null))[_0x1855('0x49')](handleError(_0x4cbf05,null));};exports[_0x1855('0x8a')]=function(_0xca5cbe,_0x1d8712,_0xecd057){var _0x5bbca8={};var _0x536461={};var _0x53631b;var _0x379a0c;return db[_0x1855('0x30')]['findOne']({'where':{'id':_0xca5cbe[_0x1855('0x4b')]['id']}})[_0x1855('0x26')](handleEntityNotFound(_0x1d8712,null))['then'](function(_0x3c61a7){if(_0x3c61a7){_0x53631b=_0x3c61a7;_0x536461[_0x1855('0x34')]=_['keys'](db[_0x1855('0x5b')][_0x1855('0x4c')]);_0x536461[_0x1855('0x36')]=_['keys'](_0xca5cbe[_0x1855('0x36')]);_0x536461[_0x1855('0x38')]=_[_0x1855('0x3a')](_0x536461[_0x1855('0x34')],_0x536461[_0x1855('0x36')]);_0x5bbca8[_0x1855('0x39')]=_[_0x1855('0x3a')](_0x536461[_0x1855('0x34')],qs['fields'](_0xca5cbe['query']['fields']));_0x5bbca8['attributes']=_0x5bbca8['attributes'][_0x1855('0x3c')]?_0x5bbca8[_0x1855('0x39')]:_0x536461[_0x1855('0x34')];_0x5bbca8[_0x1855('0x3f')]=qs['sort'](_0xca5cbe[_0x1855('0x36')][_0x1855('0x40')]);_0x5bbca8['where']=qs[_0x1855('0x38')](_[_0x1855('0x42')](_0xca5cbe[_0x1855('0x36')],_0x536461[_0x1855('0x38')]));if(_0xca5cbe[_0x1855('0x36')]['filter']){_0x5bbca8[_0x1855('0x41')]=_[_0x1855('0x44')](_0x5bbca8['where'],{'$or':_[_0x1855('0x35')](_0x5bbca8[_0x1855('0x39')],function(_0x577dce){var _0x4ab9f2={};_0x4ab9f2[_0x577dce]={'$like':'%'+_0xca5cbe['query']['filter']+'%'};return _0x4ab9f2;})});}_0x5bbca8=_[_0x1855('0x44')]({},_0x5bbca8,_0xca5cbe[_0x1855('0x46')]);return _0x53631b[_0x1855('0x8a')](_0x5bbca8);}})[_0x1855('0x26')](function(_0x286431){if(_0x286431){_0x379a0c=_0x286431['length'];if(!_0xca5cbe['query'][_0x1855('0x3d')]('nolimit')){_0x5bbca8[_0x1855('0x20')]=qs[_0x1855('0x20')](_0xca5cbe[_0x1855('0x36')][_0x1855('0x20')]);_0x5bbca8[_0x1855('0x1e')]=qs[_0x1855('0x1e')](_0xca5cbe['query'][_0x1855('0x1e')]);}return _0x53631b[_0x1855('0x8a')](_0x5bbca8);}})[_0x1855('0x26')](function(_0xa1bcc9){if(_0xa1bcc9){return _0xa1bcc9?{'count':_0x379a0c,'rows':_0xa1bcc9}:null;}})[_0x1855('0x26')](respondWithResult(_0x1d8712,null))[_0x1855('0x49')](handleError(_0x1d8712,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 62f774b..8b2fa9b 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 _0xe631=['exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x579042,_0x5a356f){var _0x3546af=function(_0x5a2689){while(--_0x5a2689){_0x579042['push'](_0x579042['shift']());}};_0x3546af(++_0x5a356f);}(_0xe631,0x1b9));var _0x1e63=function(_0x208505,_0x241a77){_0x208505=_0x208505-0x0;var _0x1a985f=_0xe631[_0x208505];return _0x1a985f;};'use strict';var EventEmitter=require(_0x1e63('0x0'));var OpenchannelQueue=require(_0x1e63('0x1'))['db'][_0x1e63('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x1e63('0x3')](0x0);var events={'afterCreate':_0x1e63('0x4'),'afterUpdate':_0x1e63('0x5'),'afterDestroy':_0x1e63('0x6')};function emitEvent(_0x3f7533){return function(_0x25701a,_0x5ccb1a,_0x15789d){OpenchannelQueueEvents[_0x1e63('0x7')](_0x3f7533+':'+_0x25701a['id'],_0x25701a);OpenchannelQueueEvents[_0x1e63('0x7')](_0x3f7533,_0x25701a);_0x15789d(null);};}for(var e in events){if(events[_0x1e63('0x8')](e)){var event=events[e];OpenchannelQueue[_0x1e63('0x9')](e,emitEvent(event));}}module[_0x1e63('0xa')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x5e57=['exports','events','OpenchannelQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x4b8f79,_0xcc829){var _0x400a15=function(_0x44dc72){while(--_0x44dc72){_0x4b8f79['push'](_0x4b8f79['shift']());}};_0x400a15(++_0xcc829);}(_0x5e57,0x8d));var _0x75e5=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x5e57[_0x42cae2];return _0x5f256f;};'use strict';var EventEmitter=require(_0x75e5('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0x75e5('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x75e5('0x2')](0x0);var events={'afterCreate':_0x75e5('0x3'),'afterUpdate':_0x75e5('0x4'),'afterDestroy':_0x75e5('0x5')};function emitEvent(_0x3ec55d){return function(_0x23dda9,_0x571e18,_0x3cab5f){OpenchannelQueueEvents[_0x75e5('0x6')](_0x3ec55d+':'+_0x23dda9['id'],_0x23dda9);OpenchannelQueueEvents[_0x75e5('0x6')](_0x3ec55d,_0x23dda9);_0x3cab5f(null);};}for(var e in events){if(events[_0x75e5('0x7')](e)){var event=events[e];OpenchannelQueue[_0x75e5('0x8')](e,emitEvent(event));}}module[_0x75e5('0x9')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 9e2eb1c..17177f1 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 _0xcb8f=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','define','openchannel_queues','lodash','util'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xcb8f,0xbe));var _0xfcb8=function(_0x30cfe4,_0x5bfea0){_0x30cfe4=_0x30cfe4-0x0;var _0x61b919=_0xcb8f[_0x30cfe4];return _0x61b919;};'use strict';var _=require(_0xfcb8('0x0'));var util=require(_0xfcb8('0x1'));var logger=require(_0xfcb8('0x2'))(_0xfcb8('0x3'));var moment=require('moment');var BPromise=require(_0xfcb8('0x4'));var rp=require(_0xfcb8('0x5'));var fs=require('fs');var path=require(_0xfcb8('0x6'));var rimraf=require(_0xfcb8('0x7'));var config=require(_0xfcb8('0x8'));var attributes=require(_0xfcb8('0x9'));module['exports']=function(_0x211d3f,_0x3bdde8){return _0x211d3f[_0xfcb8('0xa')]('OpenchannelQueue',attributes,{'tableName':_0xfcb8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x92c3=['../../config/environment','./openchannelQueue.attributes','exports','define','openchannel_queues','util','../../config/logger','api','bluebird','path'];(function(_0x468acd,_0x15a128){var _0x6fe5de=function(_0x2dc7a1){while(--_0x2dc7a1){_0x468acd['push'](_0x468acd['shift']());}};_0x6fe5de(++_0x15a128);}(_0x92c3,0xd7));var _0x392c=function(_0x4d2a1c,_0x4fa73a){_0x4d2a1c=_0x4d2a1c-0x0;var _0x2a1031=_0x92c3[_0x4d2a1c];return _0x2a1031;};'use strict';var _=require('lodash');var util=require(_0x392c('0x0'));var logger=require(_0x392c('0x1'))(_0x392c('0x2'));var moment=require('moment');var BPromise=require(_0x392c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x392c('0x4'));var rimraf=require('rimraf');var config=require(_0x392c('0x5'));var attributes=require(_0x392c('0x6'));module[_0x392c('0x7')]=function(_0x279847,_0x212798){return _0x279847[_0x392c('0x8')]('OpenchannelQueue',attributes,{'tableName':_0x392c('0x9'),'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 bc82ea3..f301f7a 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 _0x3788=['localhost','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','OpenchannelQueue','options','raw','attributes','include','model','map','GetOpenchannelQueue','catch','ShowOpenchannelQueue','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x3e0600,_0x9bb3c9){var _0x5e1117=function(_0x508ca2){while(--_0x508ca2){_0x3e0600['push'](_0x3e0600['shift']());}};_0x5e1117(++_0x9bb3c9);}(_0x3788,0x139));var _0x8378=function(_0x59e11e,_0x19f386){_0x59e11e=_0x59e11e-0x0;var _0x15ddca=_0x3788[_0x59e11e];return _0x15ddca;};'use strict';var _=require(_0x8378('0x0'));var util=require(_0x8378('0x1'));var moment=require(_0x8378('0x2'));var BPromise=require(_0x8378('0x3'));var rs=require(_0x8378('0x4'));var fs=require('fs');var Redis=require(_0x8378('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8378('0x6'));var logger=require(_0x8378('0x7'))(_0x8378('0x8'));var config=require(_0x8378('0x9'));var jayson=require(_0x8378('0xa'));var client=jayson[_0x8378('0xb')][_0x8378('0xc')]({'port':0x232a});config[_0x8378('0xd')]=_[_0x8378('0xe')](config[_0x8378('0xd')],{'host':_0x8378('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8378('0xd')]));require(_0x8378('0x10'))[_0x8378('0x11')](socket);function respondWithRpcPromise(_0x26fe31,_0x58a972,_0x27fa1a){return new BPromise(function(_0x2d2ded,_0x59abf5){return client[_0x8378('0x12')](_0x26fe31,_0x27fa1a)[_0x8378('0x13')](function(_0x1f27fe){logger[_0x8378('0x14')](_0x8378('0x15'),_0x58a972,_0x8378('0x16'));logger[_0x8378('0x17')](_0x8378('0x18'),_0x58a972,_0x8378('0x16'),JSON[_0x8378('0x19')](_0x1f27fe));if(_0x1f27fe[_0x8378('0x1a')]){if(_0x1f27fe['error'][_0x8378('0x1b')]===0x1f4){logger[_0x8378('0x1a')](_0x8378('0x15'),_0x58a972,_0x1f27fe[_0x8378('0x1a')][_0x8378('0x1c')]);return _0x59abf5(_0x1f27fe[_0x8378('0x1a')][_0x8378('0x1c')]);}logger[_0x8378('0x1a')](_0x8378('0x15'),_0x58a972,_0x1f27fe[_0x8378('0x1a')][_0x8378('0x1c')]);return _0x2d2ded(_0x1f27fe[_0x8378('0x1a')][_0x8378('0x1c')]);}else{logger[_0x8378('0x14')](_0x8378('0x15'),_0x58a972,_0x8378('0x16'));_0x2d2ded(_0x1f27fe['result']['message']);}})['catch'](function(_0x14956a){logger[_0x8378('0x1a')](_0x8378('0x15'),_0x58a972,_0x14956a);_0x59abf5(_0x14956a);});});}exports['GetOpenchannelQueue']=function(_0x340694){var _0x57e231=this;return new Promise(function(_0x415bf8,_0x54a571){return db[_0x8378('0x1d')]['findAll']({'raw':_0x340694[_0x8378('0x1e')]?_0x340694[_0x8378('0x1e')][_0x8378('0x1f')]===undefined?!![]:![]:!![],'where':_0x340694[_0x8378('0x1e')]?_0x340694['options']['where']||null:null,'attributes':_0x340694[_0x8378('0x1e')]?_0x340694['options'][_0x8378('0x20')]||null:null,'limit':_0x340694[_0x8378('0x1e')]?_0x340694[_0x8378('0x1e')]['limit']||null:null,'include':_0x340694['options']?_0x340694[_0x8378('0x1e')][_0x8378('0x21')]?_['map'](_0x340694[_0x8378('0x1e')]['include'],function(_0x111bab){return{'model':db[_0x111bab[_0x8378('0x22')]],'as':_0x111bab['as'],'attributes':_0x111bab[_0x8378('0x20')],'include':_0x111bab['include']?_[_0x8378('0x23')](_0x111bab[_0x8378('0x21')],function(_0x383b2d){return{'model':db[_0x383b2d[_0x8378('0x22')]],'as':_0x383b2d['as'],'attributes':_0x383b2d[_0x8378('0x20')],'include':_0x383b2d[_0x8378('0x21')]?_[_0x8378('0x23')](_0x383b2d['include'],function(_0xca82c){return{'model':db[_0xca82c['model']],'as':_0xca82c['as'],'attributes':_0xca82c['attributes']};}):[]};}):[]};}):[]:[]})[_0x8378('0x13')](function(_0x4c6d2d){logger['info'](_0x8378('0x24'),_0x340694);logger[_0x8378('0x17')](_0x8378('0x24'),_0x340694,JSON[_0x8378('0x19')](_0x4c6d2d));_0x415bf8(_0x4c6d2d);})[_0x8378('0x25')](function(_0x41be0e){logger['error'](_0x8378('0x24'),_0x41be0e[_0x8378('0x1c')],_0x340694);_0x54a571(_0x57e231[_0x8378('0x1a')](0x1f4,_0x41be0e[_0x8378('0x1c')]));});});};exports[_0x8378('0x26')]=function(_0x52d1c6){var _0x2ed2d0=this;return new Promise(function(_0x50303a,_0x37f0c2){return db[_0x8378('0x1d')][_0x8378('0x27')]({'raw':_0x52d1c6[_0x8378('0x1e')]?_0x52d1c6['options'][_0x8378('0x1f')]===undefined?!![]:![]:!![],'where':_0x52d1c6[_0x8378('0x1e')]?_0x52d1c6['options'][_0x8378('0x28')]||null:null,'attributes':_0x52d1c6[_0x8378('0x1e')]?_0x52d1c6[_0x8378('0x1e')]['attributes']||null:null,'include':_0x52d1c6['options']?_0x52d1c6['options'][_0x8378('0x21')]?_[_0x8378('0x23')](_0x52d1c6[_0x8378('0x1e')][_0x8378('0x21')],function(_0x567272){return{'model':db[_0x567272[_0x8378('0x22')]],'as':_0x567272['as'],'attributes':_0x567272[_0x8378('0x20')],'include':_0x567272[_0x8378('0x21')]?_['map'](_0x567272['include'],function(_0x2cf1c8){return{'model':db[_0x2cf1c8[_0x8378('0x22')]],'as':_0x2cf1c8['as'],'attributes':_0x2cf1c8[_0x8378('0x20')],'include':_0x2cf1c8[_0x8378('0x21')]?_[_0x8378('0x23')](_0x2cf1c8[_0x8378('0x21')],function(_0x5078d7){return{'model':db[_0x5078d7['model']],'as':_0x5078d7['as'],'attributes':_0x5078d7['attributes']};}):[]};}):[]};}):[]:[]})[_0x8378('0x13')](function(_0x54adad){logger[_0x8378('0x14')](_0x8378('0x26'),_0x52d1c6);logger[_0x8378('0x17')]('ShowOpenchannelQueue',_0x52d1c6,JSON['stringify'](_0x54adad));_0x50303a(_0x54adad);})['catch'](function(_0x5cfcee){logger['error']('ShowOpenchannelQueue',_0x5cfcee[_0x8378('0x1c')],_0x52d1c6);_0x37f0c2(_0x2ed2d0[_0x8378('0x1a')](0x1f4,_0x5cfcee['message']));});});}; \ No newline at end of file +var _0x0d46=['OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','model','map','GetOpenchannelQueue','debug','ShowOpenchannelQueue','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelQueue.socket','request','then','info','OpenchannelQueue,\x20%s,\x20%s'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x0d46,0x1a4));var _0x60d4=function(_0x2b8231,_0x2ad563){_0x2b8231=_0x2b8231-0x0;var _0x19af46=_0x0d46[_0x2b8231];return _0x19af46;};'use strict';var _=require(_0x60d4('0x0'));var util=require(_0x60d4('0x1'));var moment=require('moment');var BPromise=require(_0x60d4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x60d4('0x3'));var db=require(_0x60d4('0x4'))['db'];var utils=require(_0x60d4('0x5'));var logger=require(_0x60d4('0x6'))(_0x60d4('0x7'));var config=require(_0x60d4('0x8'));var jayson=require(_0x60d4('0x9'));var client=jayson[_0x60d4('0xa')][_0x60d4('0xb')]({'port':0x232a});config[_0x60d4('0xc')]=_['defaults'](config[_0x60d4('0xc')],{'host':_0x60d4('0xd'),'port':0x18eb});var socket=require(_0x60d4('0xe'))(new Redis(config[_0x60d4('0xc')]));require(_0x60d4('0xf'))['register'](socket);function respondWithRpcPromise(_0x21eaeb,_0x4125e2,_0xc9ae25){return new BPromise(function(_0x5781cf,_0xa9f88f){return client[_0x60d4('0x10')](_0x21eaeb,_0xc9ae25)[_0x60d4('0x11')](function(_0x115367){logger[_0x60d4('0x12')](_0x60d4('0x13'),_0x4125e2,'request\x20sent');logger['debug'](_0x60d4('0x14'),_0x4125e2,_0x60d4('0x15'),JSON[_0x60d4('0x16')](_0x115367));if(_0x115367[_0x60d4('0x17')]){if(_0x115367['error']['code']===0x1f4){logger['error'](_0x60d4('0x13'),_0x4125e2,_0x115367[_0x60d4('0x17')]['message']);return _0xa9f88f(_0x115367[_0x60d4('0x17')][_0x60d4('0x18')]);}logger[_0x60d4('0x17')](_0x60d4('0x13'),_0x4125e2,_0x115367[_0x60d4('0x17')][_0x60d4('0x18')]);return _0x5781cf(_0x115367[_0x60d4('0x17')][_0x60d4('0x18')]);}else{logger[_0x60d4('0x12')]('OpenchannelQueue,\x20%s,\x20%s',_0x4125e2,_0x60d4('0x15'));_0x5781cf(_0x115367[_0x60d4('0x19')]['message']);}})[_0x60d4('0x1a')](function(_0x5adb83){logger[_0x60d4('0x17')]('OpenchannelQueue,\x20%s,\x20%s',_0x4125e2,_0x5adb83);_0xa9f88f(_0x5adb83);});});}exports['GetOpenchannelQueue']=function(_0x3c977c){var _0x24ee31=this;return new Promise(function(_0x4c3db8,_0x32d2b3){return db[_0x60d4('0x1b')][_0x60d4('0x1c')]({'raw':_0x3c977c[_0x60d4('0x1d')]?_0x3c977c[_0x60d4('0x1d')][_0x60d4('0x1e')]===undefined?!![]:![]:!![],'where':_0x3c977c[_0x60d4('0x1d')]?_0x3c977c[_0x60d4('0x1d')][_0x60d4('0x1f')]||null:null,'attributes':_0x3c977c[_0x60d4('0x1d')]?_0x3c977c[_0x60d4('0x1d')][_0x60d4('0x20')]||null:null,'limit':_0x3c977c['options']?_0x3c977c[_0x60d4('0x1d')][_0x60d4('0x21')]||null:null,'include':_0x3c977c['options']?_0x3c977c[_0x60d4('0x1d')]['include']?_['map'](_0x3c977c[_0x60d4('0x1d')][_0x60d4('0x22')],function(_0x3abb9b){return{'model':db[_0x3abb9b[_0x60d4('0x23')]],'as':_0x3abb9b['as'],'attributes':_0x3abb9b[_0x60d4('0x20')],'include':_0x3abb9b[_0x60d4('0x22')]?_[_0x60d4('0x24')](_0x3abb9b[_0x60d4('0x22')],function(_0x2e004b){return{'model':db[_0x2e004b[_0x60d4('0x23')]],'as':_0x2e004b['as'],'attributes':_0x2e004b['attributes'],'include':_0x2e004b[_0x60d4('0x22')]?_[_0x60d4('0x24')](_0x2e004b[_0x60d4('0x22')],function(_0x569662){return{'model':db[_0x569662[_0x60d4('0x23')]],'as':_0x569662['as'],'attributes':_0x569662[_0x60d4('0x20')]};}):[]};}):[]};}):[]:[]})[_0x60d4('0x11')](function(_0x530d24){logger[_0x60d4('0x12')](_0x60d4('0x25'),_0x3c977c);logger[_0x60d4('0x26')](_0x60d4('0x25'),_0x3c977c,JSON[_0x60d4('0x16')](_0x530d24));_0x4c3db8(_0x530d24);})['catch'](function(_0x92df69){logger[_0x60d4('0x17')](_0x60d4('0x25'),_0x92df69[_0x60d4('0x18')],_0x3c977c);_0x32d2b3(_0x24ee31[_0x60d4('0x17')](0x1f4,_0x92df69['message']));});});};exports[_0x60d4('0x27')]=function(_0x1f60bd){var _0xe9308f=this;return new Promise(function(_0x56f8a3,_0x34541b){return db[_0x60d4('0x1b')]['find']({'raw':_0x1f60bd['options']?_0x1f60bd[_0x60d4('0x1d')][_0x60d4('0x1e')]===undefined?!![]:![]:!![],'where':_0x1f60bd[_0x60d4('0x1d')]?_0x1f60bd[_0x60d4('0x1d')][_0x60d4('0x1f')]||null:null,'attributes':_0x1f60bd['options']?_0x1f60bd['options'][_0x60d4('0x20')]||null:null,'include':_0x1f60bd[_0x60d4('0x1d')]?_0x1f60bd[_0x60d4('0x1d')][_0x60d4('0x22')]?_[_0x60d4('0x24')](_0x1f60bd[_0x60d4('0x1d')][_0x60d4('0x22')],function(_0x26a4d4){return{'model':db[_0x26a4d4[_0x60d4('0x23')]],'as':_0x26a4d4['as'],'attributes':_0x26a4d4['attributes'],'include':_0x26a4d4[_0x60d4('0x22')]?_[_0x60d4('0x24')](_0x26a4d4[_0x60d4('0x22')],function(_0x2b2c31){return{'model':db[_0x2b2c31[_0x60d4('0x23')]],'as':_0x2b2c31['as'],'attributes':_0x2b2c31[_0x60d4('0x20')],'include':_0x2b2c31[_0x60d4('0x22')]?_['map'](_0x2b2c31[_0x60d4('0x22')],function(_0x572a2e){return{'model':db[_0x572a2e['model']],'as':_0x572a2e['as'],'attributes':_0x572a2e[_0x60d4('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x7305de){logger[_0x60d4('0x12')](_0x60d4('0x27'),_0x1f60bd);logger[_0x60d4('0x26')]('ShowOpenchannelQueue',_0x1f60bd,JSON[_0x60d4('0x16')](_0x7305de));_0x56f8a3(_0x7305de);})[_0x60d4('0x1a')](function(_0x13e55c){logger[_0x60d4('0x17')](_0x60d4('0x27'),_0x13e55c['message'],_0x1f60bd);_0x34541b(_0xe9308f['error'](0x1f4,_0x13e55c[_0x60d4('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index ef4ebda..49888f8 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 _0xbf22=['removeListener','length','openchannelQueue:','./openchannelQueue.events','save','update','emit'];(function(_0x255c48,_0x2a4449){var _0xaebda3=function(_0x12a04e){while(--_0x12a04e){_0x255c48['push'](_0x255c48['shift']());}};_0xaebda3(++_0x2a4449);}(_0xbf22,0x10d));var _0x2bf2=function(_0x160152,_0x3dadf8){_0x160152=_0x160152-0x0;var _0x518c01=_0xbf22[_0x160152];return _0x518c01;};'use strict';var OpenchannelQueueEvents=require(_0x2bf2('0x0'));var events=[_0x2bf2('0x1'),'remove',_0x2bf2('0x2')];function createListener(_0x4568f8,_0x16c9eb){return function(_0x5499db){_0x16c9eb[_0x2bf2('0x3')](_0x4568f8,_0x5499db);};}function removeListener(_0x7a58af,_0x5aa6e2){return function(){OpenchannelQueueEvents[_0x2bf2('0x4')](_0x7a58af,_0x5aa6e2);};}exports['register']=function(_0x345a1f){for(var _0x43215a=0x0,_0x3338fe=events[_0x2bf2('0x5')];_0x43215a<_0x3338fe;_0x43215a++){var _0x3213e5=events[_0x43215a];var _0x24a71a=createListener(_0x2bf2('0x6')+_0x3213e5,_0x345a1f);OpenchannelQueueEvents['on'](_0x3213e5,_0x24a71a);}}; \ No newline at end of file +var _0x625e=['./openchannelQueue.events','save','remove','update','emit','removeListener','length','openchannelQueue:'];(function(_0x2a3730,_0xe60ba5){var _0x138a5c=function(_0x4b2da9){while(--_0x4b2da9){_0x2a3730['push'](_0x2a3730['shift']());}};_0x138a5c(++_0xe60ba5);}(_0x625e,0x1c8));var _0xe625=function(_0x51e79c,_0x51485e){_0x51e79c=_0x51e79c-0x0;var _0x2467be=_0x625e[_0x51e79c];return _0x2467be;};'use strict';var OpenchannelQueueEvents=require(_0xe625('0x0'));var events=[_0xe625('0x1'),_0xe625('0x2'),_0xe625('0x3')];function createListener(_0x599d36,_0x307fbd){return function(_0x37bd72){_0x307fbd[_0xe625('0x4')](_0x599d36,_0x37bd72);};}function removeListener(_0x4a0d1c,_0x130030){return function(){OpenchannelQueueEvents[_0xe625('0x5')](_0x4a0d1c,_0x130030);};}exports['register']=function(_0x389fef){for(var _0x587ac3=0x0,_0x1b1617=events[_0xe625('0x6')];_0x587ac3<_0x1b1617;_0x587ac3++){var _0xca36b7=events[_0x587ac3];var _0xf4891c=createListener(_0xe625('0x7')+_0xca36b7,_0x389fef);OpenchannelQueueEvents['on'](_0xca36b7,_0xf4891c);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 8773275..c050917 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 _0x611c=['create','put','update','delete','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','index','isAuthenticated','describe','/:id'];(function(_0x1fef5a,_0x3a2b7f){var _0x19a90a=function(_0x37b722){while(--_0x37b722){_0x1fef5a['push'](_0x1fef5a['shift']());}};_0x19a90a(++_0x3a2b7f);}(_0x611c,0x158));var _0xc611=function(_0x2157bc,_0x109ee2){_0x2157bc=_0x2157bc-0x0;var _0x1db004=_0x611c[_0x2157bc];return _0x1db004;};'use strict';var multer=require('multer');var util=require(_0xc611('0x0'));var path=require(_0xc611('0x1'));var timeout=require('connect-timeout');var express=require(_0xc611('0x2'));var router=express[_0xc611('0x3')]();var fs_extra=require(_0xc611('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc611('0x5'));var config=require(_0xc611('0x6'));var controller=require(_0xc611('0x7'));router[_0xc611('0x8')]('/',auth['isAuthenticated'](),controller[_0xc611('0x9')]);router[_0xc611('0x8')]('/describe',auth[_0xc611('0xa')](),controller[_0xc611('0xb')]);router[_0xc611('0x8')](_0xc611('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xc611('0xa')](),controller[_0xc611('0xd')]);router[_0xc611('0xe')](_0xc611('0xc'),auth[_0xc611('0xa')](),controller[_0xc611('0xf')]);router[_0xc611('0x10')](_0xc611('0xc'),auth[_0xc611('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x81ff=['get','/describe','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueueReport.controller','isAuthenticated','index'];(function(_0x4a8e62,_0x1a8d69){var _0x490381=function(_0x360504){while(--_0x360504){_0x4a8e62['push'](_0x4a8e62['shift']());}};_0x490381(++_0x1a8d69);}(_0x81ff,0xd0));var _0xf81f=function(_0x16d617,_0x2558b7){_0x16d617=_0x16d617-0x0;var _0x30081a=_0x81ff[_0x16d617];return _0x30081a;};'use strict';var multer=require(_0xf81f('0x0'));var util=require(_0xf81f('0x1'));var path=require(_0xf81f('0x2'));var timeout=require(_0xf81f('0x3'));var express=require(_0xf81f('0x4'));var router=express[_0xf81f('0x5')]();var fs_extra=require(_0xf81f('0x6'));var auth=require(_0xf81f('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xf81f('0x8'));var controller=require(_0xf81f('0x9'));router['get']('/',auth[_0xf81f('0xa')](),controller[_0xf81f('0xb')]);router[_0xf81f('0xc')](_0xf81f('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0xf81f('0xc')](_0xf81f('0xe'),auth[_0xf81f('0xa')](),controller[_0xf81f('0xf')]);router[_0xf81f('0x10')]('/',auth[_0xf81f('0xa')](),controller[_0xf81f('0x11')]);router[_0xf81f('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xf81f('0x13')]);router[_0xf81f('0x14')](_0xf81f('0xe'),auth[_0xf81f('0xa')](),controller[_0xf81f('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index f9059f4..3166ed2 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 _0x66d9=['DATE','moment','sequelize','exports','STRING'];(function(_0x32461e,_0x32708f){var _0x294e52=function(_0x58fac9){while(--_0x58fac9){_0x32461e['push'](_0x32461e['shift']());}};_0x294e52(++_0x32708f);}(_0x66d9,0x1b9));var _0x966d=function(_0x22490d,_0x5b9cbf){_0x22490d=_0x22490d-0x0;var _0x207eaa=_0x66d9[_0x22490d];return _0x207eaa;};'use strict';var moment=require(_0x966d('0x0'));var Sequelize=require(_0x966d('0x1'));module[_0x966d('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x966d('0x3')]},'joinAt':{'type':Sequelize[_0x966d('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x966d('0x4')]},'reason':{'type':Sequelize[_0x966d('0x3')]}}; \ No newline at end of file +var _0xbe68=['exports','STRING','DATE','moment','sequelize'];(function(_0x126fb9,_0x122c59){var _0xc8a3b1=function(_0x355744){while(--_0x355744){_0x126fb9['push'](_0x126fb9['shift']());}};_0xc8a3b1(++_0x122c59);}(_0xbe68,0x189));var _0x8be6=function(_0x1135cb,_0x431716){_0x1135cb=_0x1135cb-0x0;var _0x59b573=_0xbe68[_0x1135cb];return _0x59b573;};'use strict';var moment=require(_0x8be6('0x0'));var Sequelize=require(_0x8be6('0x1'));module[_0x8be6('0x2')]={'uniqueid':{'type':Sequelize[_0x8be6('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x8be6('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x8be6('0x4')]},'exitAt':{'type':Sequelize[_0x8be6('0x4')]},'reason':{'type':Sequelize[_0x8be6('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index aeec9ed..e43a6e8 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 _0x85db=['nolimit','order','sort','where','filter','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','merge','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','name','index','map','OpenchannelQueueReport','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x85db,0x1c3));var _0xb85d=function(_0xdd82b4,_0x5cd8b8){_0xdd82b4=_0xdd82b4-0x0;var _0x549bb2=_0x85db[_0xdd82b4];return _0x549bb2;};'use strict';var emlformat=require(_0xb85d('0x0'));var rimraf=require(_0xb85d('0x1'));var zipdir=require(_0xb85d('0x2'));var jsonpatch=require(_0xb85d('0x3'));var rp=require(_0xb85d('0x4'));var moment=require(_0xb85d('0x5'));var BPromise=require(_0xb85d('0x6'));var Mustache=require(_0xb85d('0x7'));var util=require(_0xb85d('0x8'));var path=require(_0xb85d('0x9'));var sox=require(_0xb85d('0xa'));var csv=require(_0xb85d('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb85d('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb85d('0xd'));var jsforce=require(_0xb85d('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb85d('0xf'));var Redis=require(_0xb85d('0x10'));var authService=require(_0xb85d('0x11'));var qs=require(_0xb85d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb85d('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb85d('0x14'))['db'];function respondWithStatusCode(_0x14a7e9,_0x10a154){_0x10a154=_0x10a154||0xcc;return function(_0xccf107){if(_0xccf107){return _0x14a7e9[_0xb85d('0x15')](_0x10a154);}return _0x14a7e9[_0xb85d('0x16')](_0x10a154)[_0xb85d('0x17')]();};}function respondWithResult(_0xd1d5dd,_0x3e5b0b){_0x3e5b0b=_0x3e5b0b||0xc8;return function(_0x1356ac){if(_0x1356ac){return _0xd1d5dd[_0xb85d('0x16')](_0x3e5b0b)[_0xb85d('0x18')](_0x1356ac);}};}function respondWithFilteredResult(_0xc73860,_0x3098f2){return function(_0x4c4766){if(_0x4c4766){var _0x1dd4aa=typeof _0x3098f2[_0xb85d('0x19')]===_0xb85d('0x1a')&&typeof _0x3098f2[_0xb85d('0x1b')]===_0xb85d('0x1a');var _0x51c98f=_0x4c4766[_0xb85d('0x1c')];var _0x4ca22f=_0x1dd4aa?0x0:_0x3098f2['offset'];var _0x34c7d4=_0x1dd4aa?_0x4c4766[_0xb85d('0x1c')]:_0x3098f2[_0xb85d('0x19')]+_0x3098f2[_0xb85d('0x1b')];var _0x34db91;if(_0x34c7d4>=_0x51c98f){_0x34c7d4=_0x51c98f;_0x34db91=0xc8;}else{_0x34db91=0xce;}_0xc73860[_0xb85d('0x16')](_0x34db91);return _0xc73860[_0xb85d('0x1d')](_0xb85d('0x1e'),_0x4ca22f+'-'+_0x34c7d4+'/'+_0x51c98f)[_0xb85d('0x18')](_0x4c4766);}return null;};}function patchUpdates(_0x5ddbaa){return function(_0x4f1807){try{jsonpatch['apply'](_0x4f1807,_0x5ddbaa,!![]);}catch(_0x1f4d81){return BPromise[_0xb85d('0x1f')](_0x1f4d81);}return _0x4f1807[_0xb85d('0x20')]();};}function saveUpdates(_0x42bacb,_0x3adbcc){return function(_0x3e5e27){if(_0x3e5e27){return _0x3e5e27[_0xb85d('0x21')](_0x42bacb)[_0xb85d('0x22')](function(_0xdd625e){return _0xdd625e;});}return null;};}function removeEntity(_0x5e1392,_0x44b349){return function(_0x2c1492){if(_0x2c1492){return _0x2c1492[_0xb85d('0x23')]()[_0xb85d('0x22')](function(){_0x5e1392[_0xb85d('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3727fe,_0x556dcf){return function(_0x3bfe53){if(!_0x3bfe53){_0x3727fe['sendStatus'](0x194);}return _0x3bfe53;};}function handleError(_0x42b6a6,_0x17ecb5){_0x17ecb5=_0x17ecb5||0x1f4;return function(_0x274b70){logger[_0xb85d('0x24')](_0x274b70['stack']);if(_0x274b70[_0xb85d('0x25')]){delete _0x274b70['name'];}_0x42b6a6[_0xb85d('0x16')](_0x17ecb5)['send'](_0x274b70);};}exports[_0xb85d('0x26')]=function(_0x1044e5,_0x25376f){var _0x515ef6={},_0x1463f8={},_0x4a6a9c={'count':0x0,'rows':[]};var _0x22fbaf=_[_0xb85d('0x27')](db[_0xb85d('0x28')]['rawAttributes'],function(_0x1fc4b7){return{'name':_0x1fc4b7[_0xb85d('0x29')],'type':_0x1fc4b7[_0xb85d('0x2a')][_0xb85d('0x2b')]};});_0x1463f8[_0xb85d('0x2c')]=_[_0xb85d('0x27')](_0x22fbaf,'name');_0x1463f8[_0xb85d('0x2d')]=_[_0xb85d('0x2e')](_0x1044e5['query']);_0x1463f8[_0xb85d('0x2f')]=_[_0xb85d('0x30')](_0x1463f8['model'],_0x1463f8[_0xb85d('0x2d')]);_0x515ef6['attributes']=_[_0xb85d('0x30')](_0x1463f8['model'],qs[_0xb85d('0x31')](_0x1044e5['query']['fields']));_0x515ef6['attributes']=_0x515ef6['attributes'][_0xb85d('0x32')]?_0x515ef6[_0xb85d('0x33')]:_0x1463f8[_0xb85d('0x2c')];if(!_0x1044e5[_0xb85d('0x2d')][_0xb85d('0x34')](_0xb85d('0x35'))){_0x515ef6[_0xb85d('0x1b')]=qs[_0xb85d('0x1b')](_0x1044e5[_0xb85d('0x2d')][_0xb85d('0x1b')]);_0x515ef6[_0xb85d('0x19')]=qs[_0xb85d('0x19')](_0x1044e5[_0xb85d('0x2d')][_0xb85d('0x19')]);}_0x515ef6[_0xb85d('0x36')]=qs[_0xb85d('0x37')](_0x1044e5[_0xb85d('0x2d')][_0xb85d('0x37')]);_0x515ef6[_0xb85d('0x38')]=qs[_0xb85d('0x2f')](_['pick'](_0x1044e5[_0xb85d('0x2d')],_0x1463f8[_0xb85d('0x2f')]),_0x22fbaf);if(_0x1044e5[_0xb85d('0x2d')][_0xb85d('0x39')]){_0x515ef6['where']=_['merge'](_0x515ef6[_0xb85d('0x38')],{'$or':_['map'](_0x22fbaf,function(_0x1c92e1){if(_0x1c92e1[_0xb85d('0x2a')]!==_0xb85d('0x3a')){var _0x5c695a={};_0x5c695a[_0x1c92e1[_0xb85d('0x25')]]={'$like':'%'+_0x1044e5[_0xb85d('0x2d')][_0xb85d('0x39')]+'%'};return _0x5c695a;}})});}_0x515ef6=_['merge']({},_0x515ef6,_0x1044e5[_0xb85d('0x3b')]);var _0x306555={'where':_0x515ef6[_0xb85d('0x38')]};return db[_0xb85d('0x28')][_0xb85d('0x1c')](_0x306555)[_0xb85d('0x22')](function(_0x515999){_0x4a6a9c['count']=_0x515999;if(_0x1044e5[_0xb85d('0x2d')][_0xb85d('0x3c')]){_0x515ef6[_0xb85d('0x3d')]=[{'all':!![]}];}return db[_0xb85d('0x28')]['findAll'](_0x515ef6);})['then'](function(_0x4d7741){_0x4a6a9c[_0xb85d('0x3e')]=_0x4d7741;return _0x4a6a9c;})[_0xb85d('0x22')](respondWithFilteredResult(_0x25376f,_0x515ef6))[_0xb85d('0x3f')](handleError(_0x25376f,null));};exports[_0xb85d('0x40')]=function(_0x3d6875,_0x179308){var _0x3bc884={'raw':!![],'where':{'id':_0x3d6875[_0xb85d('0x41')]['id']}},_0x2b5c25={};_0x2b5c25[_0xb85d('0x2c')]=_[_0xb85d('0x2e')](db[_0xb85d('0x28')][_0xb85d('0x42')]);_0x2b5c25[_0xb85d('0x2d')]=_[_0xb85d('0x2e')](_0x3d6875[_0xb85d('0x2d')]);_0x2b5c25[_0xb85d('0x2f')]=_[_0xb85d('0x30')](_0x2b5c25[_0xb85d('0x2c')],_0x2b5c25[_0xb85d('0x2d')]);_0x3bc884[_0xb85d('0x33')]=_['intersection'](_0x2b5c25[_0xb85d('0x2c')],qs[_0xb85d('0x31')](_0x3d6875[_0xb85d('0x2d')][_0xb85d('0x31')]));_0x3bc884[_0xb85d('0x33')]=_0x3bc884['attributes'][_0xb85d('0x32')]?_0x3bc884[_0xb85d('0x33')]:_0x2b5c25[_0xb85d('0x2c')];if(_0x3d6875[_0xb85d('0x2d')][_0xb85d('0x3c')]){_0x3bc884['include']=[{'all':!![]}];}_0x3bc884=_[_0xb85d('0x43')]({},_0x3bc884,_0x3d6875[_0xb85d('0x3b')]);return db[_0xb85d('0x28')][_0xb85d('0x44')](_0x3bc884)['then'](handleEntityNotFound(_0x179308,null))[_0xb85d('0x22')](respondWithResult(_0x179308,null))['catch'](handleError(_0x179308,null));};exports[_0xb85d('0x45')]=function(_0x3d9e58,_0x4d00a1){return db[_0xb85d('0x28')][_0xb85d('0x45')](_0x3d9e58[_0xb85d('0x46')],{})[_0xb85d('0x22')](respondWithResult(_0x4d00a1,0xc9))[_0xb85d('0x3f')](handleError(_0x4d00a1,null));};exports['update']=function(_0x1fdac9,_0x4f56a8){if(_0x1fdac9[_0xb85d('0x46')]['id']){delete _0x1fdac9[_0xb85d('0x46')]['id'];}return db[_0xb85d('0x28')][_0xb85d('0x44')]({'where':{'id':_0x1fdac9[_0xb85d('0x41')]['id']}})[_0xb85d('0x22')](handleEntityNotFound(_0x4f56a8,null))[_0xb85d('0x22')](saveUpdates(_0x1fdac9['body'],null))[_0xb85d('0x22')](respondWithResult(_0x4f56a8,null))[_0xb85d('0x3f')](handleError(_0x4f56a8,null));};exports[_0xb85d('0x23')]=function(_0x291cdf,_0x2c5d1a){return db['OpenchannelQueueReport'][_0xb85d('0x44')]({'where':{'id':_0x291cdf[_0xb85d('0x41')]['id']}})[_0xb85d('0x22')](handleEntityNotFound(_0x2c5d1a,null))[_0xb85d('0x22')](removeEntity(_0x2c5d1a,null))[_0xb85d('0x3f')](handleError(_0x2c5d1a,null));};exports[_0xb85d('0x47')]=function(_0x455c49,_0x45098e){return db[_0xb85d('0x28')][_0xb85d('0x47')]()[_0xb85d('0x22')](respondWithResult(_0x45098e,null))[_0xb85d('0x3f')](handleError(_0x45098e,null));}; \ No newline at end of file +var _0xedf2=['Content-Range','apply','reject','update','error','name','send','map','OpenchannelQueueReport','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','then','include','findAll','rows','catch','show','params','keys','options','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set'];(function(_0x1c71cd,_0x4b696a){var _0x505500=function(_0x56300b){while(--_0x56300b){_0x1c71cd['push'](_0x1c71cd['shift']());}};_0x505500(++_0x4b696a);}(_0xedf2,0x156));var _0x2edf=function(_0x356b5b,_0x148ff3){_0x356b5b=_0x356b5b-0x0;var _0x26f888=_0xedf2[_0x356b5b];return _0x26f888;};'use strict';var emlformat=require(_0x2edf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2edf('0x1'));var jsonpatch=require(_0x2edf('0x2'));var rp=require(_0x2edf('0x3'));var moment=require(_0x2edf('0x4'));var BPromise=require(_0x2edf('0x5'));var Mustache=require(_0x2edf('0x6'));var util=require(_0x2edf('0x7'));var path=require(_0x2edf('0x8'));var sox=require(_0x2edf('0x9'));var csv=require('to-csv');var ejs=require(_0x2edf('0xa'));var fs=require('fs');var fs_extra=require(_0x2edf('0xb'));var _=require(_0x2edf('0xc'));var squel=require(_0x2edf('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2edf('0xe'));var Papa=require(_0x2edf('0xf'));var Redis=require(_0x2edf('0x10'));var authService=require(_0x2edf('0x11'));var qs=require(_0x2edf('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2edf('0x13'));var logger=require(_0x2edf('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x2edf('0x15'));var licenseUtil=require(_0x2edf('0x16'));var db=require(_0x2edf('0x17'))['db'];function respondWithStatusCode(_0x1a6201,_0x45f766){_0x45f766=_0x45f766||0xcc;return function(_0x263ad2){if(_0x263ad2){return _0x1a6201[_0x2edf('0x18')](_0x45f766);}return _0x1a6201[_0x2edf('0x19')](_0x45f766)[_0x2edf('0x1a')]();};}function respondWithResult(_0x543c20,_0x26cc6a){_0x26cc6a=_0x26cc6a||0xc8;return function(_0x4fc803){if(_0x4fc803){return _0x543c20['status'](_0x26cc6a)[_0x2edf('0x1b')](_0x4fc803);}};}function respondWithFilteredResult(_0x3da91f,_0x3a43c8){return function(_0x187b6b){if(_0x187b6b){var _0x4d3d46=typeof _0x3a43c8[_0x2edf('0x1c')]==='undefined'&&typeof _0x3a43c8['limit']===_0x2edf('0x1d');var _0x39dc92=_0x187b6b[_0x2edf('0x1e')];var _0x19621d=_0x4d3d46?0x0:_0x3a43c8[_0x2edf('0x1c')];var _0x3bfebf=_0x4d3d46?_0x187b6b['count']:_0x3a43c8[_0x2edf('0x1c')]+_0x3a43c8[_0x2edf('0x1f')];var _0x42d1b9;if(_0x3bfebf>=_0x39dc92){_0x3bfebf=_0x39dc92;_0x42d1b9=0xc8;}else{_0x42d1b9=0xce;}_0x3da91f[_0x2edf('0x19')](_0x42d1b9);return _0x3da91f[_0x2edf('0x20')](_0x2edf('0x21'),_0x19621d+'-'+_0x3bfebf+'/'+_0x39dc92)[_0x2edf('0x1b')](_0x187b6b);}return null;};}function patchUpdates(_0x477fcf){return function(_0x51990c){try{jsonpatch[_0x2edf('0x22')](_0x51990c,_0x477fcf,!![]);}catch(_0x1ad0b7){return BPromise[_0x2edf('0x23')](_0x1ad0b7);}return _0x51990c['save']();};}function saveUpdates(_0x568e0b,_0x4479e6){return function(_0x4869b4){if(_0x4869b4){return _0x4869b4[_0x2edf('0x24')](_0x568e0b)['then'](function(_0x254263){return _0x254263;});}return null;};}function removeEntity(_0x54201a,_0x515bca){return function(_0x4488c1){if(_0x4488c1){return _0x4488c1['destroy']()['then'](function(){_0x54201a[_0x2edf('0x19')](0xcc)[_0x2edf('0x1a')]();});}};}function handleEntityNotFound(_0x70c39b,_0x3372b2){return function(_0x504eac){if(!_0x504eac){_0x70c39b[_0x2edf('0x18')](0x194);}return _0x504eac;};}function handleError(_0x6311e5,_0xdef0b3){_0xdef0b3=_0xdef0b3||0x1f4;return function(_0x3b6cfa){logger[_0x2edf('0x25')](_0x3b6cfa['stack']);if(_0x3b6cfa['name']){delete _0x3b6cfa[_0x2edf('0x26')];}_0x6311e5[_0x2edf('0x19')](_0xdef0b3)[_0x2edf('0x27')](_0x3b6cfa);};}exports['index']=function(_0x14799a,_0x4f21a0){var _0x460927={},_0x34eec3={},_0x2685fa={'count':0x0,'rows':[]};var _0x3afcb3=_[_0x2edf('0x28')](db[_0x2edf('0x29')][_0x2edf('0x2a')],function(_0xcbdcff){return{'name':_0xcbdcff[_0x2edf('0x2b')],'type':_0xcbdcff[_0x2edf('0x2c')]['key']};});_0x34eec3[_0x2edf('0x2d')]=_['map'](_0x3afcb3,_0x2edf('0x26'));_0x34eec3[_0x2edf('0x2e')]=_['keys'](_0x14799a[_0x2edf('0x2e')]);_0x34eec3[_0x2edf('0x2f')]=_[_0x2edf('0x30')](_0x34eec3['model'],_0x34eec3[_0x2edf('0x2e')]);_0x460927[_0x2edf('0x31')]=_['intersection'](_0x34eec3[_0x2edf('0x2d')],qs[_0x2edf('0x32')](_0x14799a[_0x2edf('0x2e')]['fields']));_0x460927[_0x2edf('0x31')]=_0x460927[_0x2edf('0x31')][_0x2edf('0x33')]?_0x460927[_0x2edf('0x31')]:_0x34eec3[_0x2edf('0x2d')];if(!_0x14799a[_0x2edf('0x2e')][_0x2edf('0x34')](_0x2edf('0x35'))){_0x460927['limit']=qs['limit'](_0x14799a[_0x2edf('0x2e')]['limit']);_0x460927[_0x2edf('0x1c')]=qs[_0x2edf('0x1c')](_0x14799a[_0x2edf('0x2e')]['offset']);}_0x460927[_0x2edf('0x36')]=qs['sort'](_0x14799a['query'][_0x2edf('0x37')]);_0x460927[_0x2edf('0x38')]=qs[_0x2edf('0x2f')](_[_0x2edf('0x39')](_0x14799a['query'],_0x34eec3[_0x2edf('0x2f')]),_0x3afcb3);if(_0x14799a['query'][_0x2edf('0x3a')]){_0x460927['where']=_[_0x2edf('0x3b')](_0x460927[_0x2edf('0x38')],{'$or':_[_0x2edf('0x28')](_0x3afcb3,function(_0xa78288){if(_0xa78288[_0x2edf('0x2c')]!==_0x2edf('0x3c')){var _0x1da250={};_0x1da250[_0xa78288['name']]={'$like':'%'+_0x14799a[_0x2edf('0x2e')][_0x2edf('0x3a')]+'%'};return _0x1da250;}})});}_0x460927=_[_0x2edf('0x3b')]({},_0x460927,_0x14799a['options']);var _0x53a909={'where':_0x460927[_0x2edf('0x38')]};return db['OpenchannelQueueReport'][_0x2edf('0x1e')](_0x53a909)[_0x2edf('0x3d')](function(_0x3c8697){_0x2685fa[_0x2edf('0x1e')]=_0x3c8697;if(_0x14799a[_0x2edf('0x2e')]['includeAll']){_0x460927[_0x2edf('0x3e')]=[{'all':!![]}];}return db[_0x2edf('0x29')][_0x2edf('0x3f')](_0x460927);})[_0x2edf('0x3d')](function(_0x19d0e7){_0x2685fa[_0x2edf('0x40')]=_0x19d0e7;return _0x2685fa;})['then'](respondWithFilteredResult(_0x4f21a0,_0x460927))[_0x2edf('0x41')](handleError(_0x4f21a0,null));};exports[_0x2edf('0x42')]=function(_0x19f9a3,_0x1c9577){var _0x4f6549={'raw':!![],'where':{'id':_0x19f9a3[_0x2edf('0x43')]['id']}},_0x3797f9={};_0x3797f9['model']=_[_0x2edf('0x44')](db['OpenchannelQueueReport'][_0x2edf('0x2a')]);_0x3797f9[_0x2edf('0x2e')]=_['keys'](_0x19f9a3[_0x2edf('0x2e')]);_0x3797f9[_0x2edf('0x2f')]=_[_0x2edf('0x30')](_0x3797f9['model'],_0x3797f9[_0x2edf('0x2e')]);_0x4f6549[_0x2edf('0x31')]=_[_0x2edf('0x30')](_0x3797f9[_0x2edf('0x2d')],qs[_0x2edf('0x32')](_0x19f9a3[_0x2edf('0x2e')][_0x2edf('0x32')]));_0x4f6549['attributes']=_0x4f6549['attributes']['length']?_0x4f6549['attributes']:_0x3797f9[_0x2edf('0x2d')];if(_0x19f9a3[_0x2edf('0x2e')]['includeAll']){_0x4f6549[_0x2edf('0x3e')]=[{'all':!![]}];}_0x4f6549=_[_0x2edf('0x3b')]({},_0x4f6549,_0x19f9a3[_0x2edf('0x45')]);return db[_0x2edf('0x29')][_0x2edf('0x46')](_0x4f6549)[_0x2edf('0x3d')](handleEntityNotFound(_0x1c9577,null))[_0x2edf('0x3d')](respondWithResult(_0x1c9577,null))['catch'](handleError(_0x1c9577,null));};exports[_0x2edf('0x47')]=function(_0x1970a6,_0x4c77d){return db[_0x2edf('0x29')][_0x2edf('0x47')](_0x1970a6[_0x2edf('0x48')],{})[_0x2edf('0x3d')](respondWithResult(_0x4c77d,0xc9))[_0x2edf('0x41')](handleError(_0x4c77d,null));};exports[_0x2edf('0x24')]=function(_0x497f2d,_0x1d98a3){if(_0x497f2d[_0x2edf('0x48')]['id']){delete _0x497f2d[_0x2edf('0x48')]['id'];}return db[_0x2edf('0x29')][_0x2edf('0x46')]({'where':{'id':_0x497f2d[_0x2edf('0x43')]['id']}})[_0x2edf('0x3d')](handleEntityNotFound(_0x1d98a3,null))[_0x2edf('0x3d')](saveUpdates(_0x497f2d['body'],null))['then'](respondWithResult(_0x1d98a3,null))[_0x2edf('0x41')](handleError(_0x1d98a3,null));};exports[_0x2edf('0x49')]=function(_0x36082c,_0x2e3f7f){return db['OpenchannelQueueReport'][_0x2edf('0x46')]({'where':{'id':_0x36082c[_0x2edf('0x43')]['id']}})[_0x2edf('0x3d')](handleEntityNotFound(_0x2e3f7f,null))[_0x2edf('0x3d')](removeEntity(_0x2e3f7f,null))[_0x2edf('0x41')](handleError(_0x2e3f7f,null));};exports['describe']=function(_0x1f3f42,_0x3cc463){return db[_0x2edf('0x29')][_0x2edf('0x4a')]()['then'](respondWithResult(_0x3cc463,null))['catch'](handleError(_0x3cc463,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index ce9c3ba..1ea36d2 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 _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelQueueReport.attributes','exports','define','report_openchannel_queue','uniqueid','lodash'];(function(_0x2a2a40,_0x213684){var _0x5e3afd=function(_0x1ce0e4){while(--_0x1ce0e4){_0x2a2a40['push'](_0x2a2a40['shift']());}};_0x5e3afd(++_0x213684);}(_0x5fc3,0xa8));var _0x35fc=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x5fc3[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe14b=['bluebird','path','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','moment'];(function(_0x5c4ce1,_0x3be64c){var _0x2fd310=function(_0x1ab4e8){while(--_0x1ab4e8){_0x5c4ce1['push'](_0x5c4ce1['shift']());}};_0x2fd310(++_0x3be64c);}(_0xe14b,0x93));var _0xbe14=function(_0x58299f,_0x44129b){_0x58299f=_0x58299f-0x0;var _0x43184e=_0xe14b[_0x58299f];return _0x43184e;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index ded83a2..a487a2d 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 _0x7d25=['create','body','options','raw','then','UpdateOpenchannelQueueReport','update','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','request','info','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport'];(function(_0x3198ef,_0x32e339){var _0x138220=function(_0x489cc0){while(--_0x489cc0){_0x3198ef['push'](_0x3198ef['shift']());}};_0x138220(++_0x32e339);}(_0x7d25,0x8a));var _0x57d2=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x7d25[_0x49b207];return _0x2dc8fa;};'use strict';var _=require('lodash');var util=require(_0x57d2('0x0'));var moment=require(_0x57d2('0x1'));var BPromise=require(_0x57d2('0x2'));var rs=require(_0x57d2('0x3'));var fs=require('fs');var Redis=require(_0x57d2('0x4'));var db=require(_0x57d2('0x5'))['db'];var utils=require(_0x57d2('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x57d2('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f43b2,_0x263d35,_0x147194){return new BPromise(function(_0x59ae87,_0x49e3e5){return client[_0x57d2('0x8')](_0x1f43b2,_0x147194)['then'](function(_0x3a1ec5){logger[_0x57d2('0x9')](_0x57d2('0xa'),_0x263d35,'request\x20sent');logger[_0x57d2('0xb')](_0x57d2('0xc'),_0x263d35,_0x57d2('0xd'),JSON[_0x57d2('0xe')](_0x3a1ec5));if(_0x3a1ec5[_0x57d2('0xf')]){if(_0x3a1ec5[_0x57d2('0xf')][_0x57d2('0x10')]===0x1f4){logger[_0x57d2('0xf')](_0x57d2('0xa'),_0x263d35,_0x3a1ec5[_0x57d2('0xf')][_0x57d2('0x11')]);return _0x49e3e5(_0x3a1ec5[_0x57d2('0xf')][_0x57d2('0x11')]);}logger[_0x57d2('0xf')](_0x57d2('0xa'),_0x263d35,_0x3a1ec5[_0x57d2('0xf')]['message']);return _0x59ae87(_0x3a1ec5['error'][_0x57d2('0x11')]);}else{logger[_0x57d2('0x9')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x263d35,_0x57d2('0xd'));_0x59ae87(_0x3a1ec5[_0x57d2('0x12')]['message']);}})[_0x57d2('0x13')](function(_0x4986ad){logger[_0x57d2('0xf')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x263d35,_0x4986ad);_0x49e3e5(_0x4986ad);});});}exports[_0x57d2('0x14')]=function(_0x7d4cf1){var _0x2ecfdf=this;return new Promise(function(_0x4a94e3,_0x525cfc){return db[_0x57d2('0x15')][_0x57d2('0x16')](_0x7d4cf1[_0x57d2('0x17')],{'raw':_0x7d4cf1[_0x57d2('0x18')]?_0x7d4cf1['options'][_0x57d2('0x19')]===undefined?!![]:![]:!![]})[_0x57d2('0x1a')](function(_0x55191e){logger['info'](_0x57d2('0x14'),_0x7d4cf1);logger[_0x57d2('0xb')](_0x57d2('0x14'),_0x7d4cf1,JSON[_0x57d2('0xe')](_0x55191e));_0x4a94e3(_0x55191e);})[_0x57d2('0x13')](function(_0x803c25){logger[_0x57d2('0xf')](_0x57d2('0x14'),_0x803c25[_0x57d2('0x11')],_0x7d4cf1);_0x525cfc(_0x2ecfdf[_0x57d2('0xf')](0x1f4,_0x803c25[_0x57d2('0x11')]));});});};exports[_0x57d2('0x1b')]=function(_0x12ff19){var _0x473df2=this;return new Promise(function(_0x5327ea,_0x424ddc){return db[_0x57d2('0x15')][_0x57d2('0x1c')](_0x12ff19[_0x57d2('0x17')],{'raw':_0x12ff19[_0x57d2('0x18')]?_0x12ff19['options'][_0x57d2('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12ff19[_0x57d2('0x18')]?_0x12ff19[_0x57d2('0x18')][_0x57d2('0x1d')]||null:null,'attributes':_0x12ff19[_0x57d2('0x18')]?_0x12ff19[_0x57d2('0x18')][_0x57d2('0x1e')]||null:null,'limit':_0x12ff19['options']?_0x12ff19[_0x57d2('0x18')][_0x57d2('0x1f')]||null:null})[_0x57d2('0x1a')](function(_0x1fe383){logger[_0x57d2('0x9')](_0x57d2('0x1b'),_0x12ff19);logger[_0x57d2('0xb')](_0x57d2('0x1b'),_0x12ff19,JSON[_0x57d2('0xe')](_0x1fe383));_0x5327ea(_0x1fe383);})[_0x57d2('0x13')](function(_0x574589){logger[_0x57d2('0xf')](_0x57d2('0x1b'),_0x574589[_0x57d2('0x11')],_0x12ff19);_0x424ddc(_0x473df2[_0x57d2('0xf')](0x1f4,_0x574589['message']));});});}; \ No newline at end of file +var _0x3de3=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateOpenchannelQueueReport','create','options','raw','OpenchannelQueueReport','body','attributes','limit','UpdateOpenchannelQueueReport','lodash','moment','bluebird'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0x3de3,0x1ce));var _0x33de=function(_0x3e311c,_0x5d480d){_0x3e311c=_0x3e311c-0x0;var _0xd1fca9=_0x3de3[_0x3e311c];return _0xd1fca9;};'use strict';var _=require(_0x33de('0x0'));var util=require('util');var moment=require(_0x33de('0x1'));var BPromise=require(_0x33de('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x33de('0x3'));var db=require(_0x33de('0x4'))['db'];var utils=require(_0x33de('0x5'));var logger=require(_0x33de('0x6'))('rpc');var config=require(_0x33de('0x7'));var jayson=require(_0x33de('0x8'));var client=jayson['client'][_0x33de('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x587be8,_0x13afea,_0x35ee93){return new BPromise(function(_0x7ceca6,_0x486ab6){return client[_0x33de('0xa')](_0x587be8,_0x35ee93)[_0x33de('0xb')](function(_0x2e0419){logger['info'](_0x33de('0xc'),_0x13afea,_0x33de('0xd'));logger[_0x33de('0xe')](_0x33de('0xf'),_0x13afea,_0x33de('0xd'),JSON[_0x33de('0x10')](_0x2e0419));if(_0x2e0419[_0x33de('0x11')]){if(_0x2e0419[_0x33de('0x11')][_0x33de('0x12')]===0x1f4){logger[_0x33de('0x11')](_0x33de('0xc'),_0x13afea,_0x2e0419['error'][_0x33de('0x13')]);return _0x486ab6(_0x2e0419[_0x33de('0x11')]['message']);}logger['error'](_0x33de('0xc'),_0x13afea,_0x2e0419[_0x33de('0x11')][_0x33de('0x13')]);return _0x7ceca6(_0x2e0419[_0x33de('0x11')]['message']);}else{logger[_0x33de('0x14')](_0x33de('0xc'),_0x13afea,'request\x20sent');_0x7ceca6(_0x2e0419['result'][_0x33de('0x13')]);}})[_0x33de('0x15')](function(_0x13e832){logger['error'](_0x33de('0xc'),_0x13afea,_0x13e832);_0x486ab6(_0x13e832);});});}exports[_0x33de('0x16')]=function(_0x52cfa0){var _0x2815a7=this;return new Promise(function(_0x201ff3,_0x482667){return db['OpenchannelQueueReport'][_0x33de('0x17')](_0x52cfa0['body'],{'raw':_0x52cfa0[_0x33de('0x18')]?_0x52cfa0[_0x33de('0x18')][_0x33de('0x19')]===undefined?!![]:![]:!![]})[_0x33de('0xb')](function(_0xc4f1a4){logger[_0x33de('0x14')](_0x33de('0x16'),_0x52cfa0);logger['debug']('CreateOpenchannelQueueReport',_0x52cfa0,JSON[_0x33de('0x10')](_0xc4f1a4));_0x201ff3(_0xc4f1a4);})['catch'](function(_0x8acd8d){logger['error'](_0x33de('0x16'),_0x8acd8d[_0x33de('0x13')],_0x52cfa0);_0x482667(_0x2815a7['error'](0x1f4,_0x8acd8d[_0x33de('0x13')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x67d040){var _0x5c602d=this;return new Promise(function(_0x62743b,_0x24e282){return db[_0x33de('0x1a')]['update'](_0x67d040[_0x33de('0x1b')],{'raw':_0x67d040[_0x33de('0x18')]?_0x67d040[_0x33de('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x67d040[_0x33de('0x18')]?_0x67d040['options']['where']||null:null,'attributes':_0x67d040[_0x33de('0x18')]?_0x67d040[_0x33de('0x18')][_0x33de('0x1c')]||null:null,'limit':_0x67d040[_0x33de('0x18')]?_0x67d040[_0x33de('0x18')][_0x33de('0x1d')]||null:null})[_0x33de('0xb')](function(_0x1b4703){logger['info']('UpdateOpenchannelQueueReport',_0x67d040);logger[_0x33de('0xe')](_0x33de('0x1e'),_0x67d040,JSON[_0x33de('0x10')](_0x1b4703));_0x62743b(_0x1b4703);})[_0x33de('0x15')](function(_0x167cec){logger[_0x33de('0x11')](_0x33de('0x1e'),_0x167cec['message'],_0x67d040);_0x24e282(_0x5c602d[_0x33de('0x11')](0x1f4,_0x167cec[_0x33de('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 0680387..065d9d9 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 _0xbbde=['update','delete','destroy','multer','util','path','express','fs-extra','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','put'];(function(_0x1427e5,_0x34526e){var _0x59bb5f=function(_0x353365){while(--_0x353365){_0x1427e5['push'](_0x1427e5['shift']());}};_0x59bb5f(++_0x34526e);}(_0xbbde,0xcf));var _0xebbd=function(_0x5e4b85,_0x6cf965){_0x5e4b85=_0x5e4b85-0x0;var _0x5cd3cb=_0xbbde[_0x5e4b85];return _0x5cd3cb;};'use strict';var multer=require(_0xebbd('0x0'));var util=require(_0xebbd('0x1'));var path=require(_0xebbd('0x2'));var timeout=require('connect-timeout');var express=require(_0xebbd('0x3'));var router=express['Router']();var fs_extra=require(_0xebbd('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xebbd('0x5'));var controller=require(_0xebbd('0x6'));router[_0xebbd('0x7')]('/',auth[_0xebbd('0x8')](),controller[_0xebbd('0x9')]);router['get']('/describe',auth[_0xebbd('0x8')](),controller[_0xebbd('0xa')]);router[_0xebbd('0x7')](_0xebbd('0xb'),auth[_0xebbd('0x8')](),controller[_0xebbd('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xebbd('0xd')](_0xebbd('0xb'),auth[_0xebbd('0x8')](),controller[_0xebbd('0xe')]);router[_0xebbd('0xf')](_0xebbd('0xb'),auth[_0xebbd('0x8')](),controller[_0xebbd('0x10')]);module['exports']=router; \ No newline at end of file +var _0x26fe=['get','index','/describe','isAuthenticated','describe','/:id','show','create','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./openchannelTransferReport.controller'];(function(_0x15e4ea,_0x4c268){var _0x5f3858=function(_0x2a5bda){while(--_0x2a5bda){_0x15e4ea['push'](_0x15e4ea['shift']());}};_0x5f3858(++_0x4c268);}(_0x26fe,0x6f));var _0xe26f=function(_0x25241e,_0x4f396c){_0x25241e=_0x25241e-0x0;var _0x1242dd=_0x26fe[_0x25241e];return _0x1242dd;};'use strict';var multer=require(_0xe26f('0x0'));var util=require(_0xe26f('0x1'));var path=require(_0xe26f('0x2'));var timeout=require(_0xe26f('0x3'));var express=require(_0xe26f('0x4'));var router=express['Router']();var fs_extra=require(_0xe26f('0x5'));var auth=require(_0xe26f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe26f('0x7'));var controller=require(_0xe26f('0x8'));router[_0xe26f('0x9')]('/',auth['isAuthenticated'](),controller[_0xe26f('0xa')]);router['get'](_0xe26f('0xb'),auth[_0xe26f('0xc')](),controller[_0xe26f('0xd')]);router[_0xe26f('0x9')](_0xe26f('0xe'),auth['isAuthenticated'](),controller[_0xe26f('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe26f('0x10')]);router['put']('/:id',auth[_0xe26f('0xc')](),controller[_0xe26f('0x11')]);router[_0xe26f('0x12')](_0xe26f('0xe'),auth['isAuthenticated'](),controller[_0xe26f('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 75cb89e..7c044d0 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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x579121,_0x27e9e2){var _0x38a4ae=function(_0x53e154){while(--_0x53e154){_0x579121['push'](_0x579121['shift']());}};_0x38a4ae(++_0x27e9e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x3ad93b,_0x284c95){var _0x4ef96b=function(_0x576f6b){while(--_0x576f6b){_0x3ad93b['push'](_0x3ad93b['shift']());}};_0x4ef96b(++_0x284c95);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xcb91[_0x16b9ed];return _0x66b1f8;};'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/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 13fe2ba..174fb56 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 _0xa50a=['filters','fields','attributes','length','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','options','OpenchannelTransferReport','includeAll','findAll','rows','catch','show','keys','intersection','find','create','body','params','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','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','count','limit','set','reject','update','then','destroy','error','stack','name','send','index','rawAttributes','type','key','model','map','query'];(function(_0x1c8181,_0x424b01){var _0x3d1cb=function(_0x270e8e){while(--_0x270e8e){_0x1c8181['push'](_0x1c8181['shift']());}};_0x3d1cb(++_0x424b01);}(_0xa50a,0x13c));var _0xaa50=function(_0x6bddc3,_0x36563e){_0x6bddc3=_0x6bddc3-0x0;var _0x868581=_0xa50a[_0x6bddc3];return _0x868581;};'use strict';var emlformat=require(_0xaa50('0x0'));var rimraf=require(_0xaa50('0x1'));var zipdir=require(_0xaa50('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaa50('0x3'));var moment=require('moment');var BPromise=require(_0xaa50('0x4'));var Mustache=require(_0xaa50('0x5'));var util=require(_0xaa50('0x6'));var path=require(_0xaa50('0x7'));var sox=require(_0xaa50('0x8'));var csv=require(_0xaa50('0x9'));var ejs=require(_0xaa50('0xa'));var fs=require('fs');var fs_extra=require(_0xaa50('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xaa50('0xc'));var jsforce=require(_0xaa50('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaa50('0x9'));var querystring=require(_0xaa50('0xe'));var Papa=require(_0xaa50('0xf'));var Redis=require(_0xaa50('0x10'));var authService=require(_0xaa50('0x11'));var qs=require(_0xaa50('0x12'));var as=require(_0xaa50('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xaa50('0x14'));var utils=require(_0xaa50('0x15'));var config=require(_0xaa50('0x16'));var licenseUtil=require(_0xaa50('0x17'));var db=require(_0xaa50('0x18'))['db'];function respondWithStatusCode(_0x3f2026,_0x1cddd4){_0x1cddd4=_0x1cddd4||0xcc;return function(_0xaa2d39){if(_0xaa2d39){return _0x3f2026[_0xaa50('0x19')](_0x1cddd4);}return _0x3f2026[_0xaa50('0x1a')](_0x1cddd4)[_0xaa50('0x1b')]();};}function respondWithResult(_0x37dcd4,_0x50df60){_0x50df60=_0x50df60||0xc8;return function(_0x2901ae){if(_0x2901ae){return _0x37dcd4[_0xaa50('0x1a')](_0x50df60)[_0xaa50('0x1c')](_0x2901ae);}};}function respondWithFilteredResult(_0x4710e2,_0x29e7f1){return function(_0x2cced2){if(_0x2cced2){var _0x5b4b6e=typeof _0x29e7f1[_0xaa50('0x1d')]===_0xaa50('0x1e')&&typeof _0x29e7f1['limit']==='undefined';var _0x3e1bca=_0x2cced2[_0xaa50('0x1f')];var _0x24c625=_0x5b4b6e?0x0:_0x29e7f1[_0xaa50('0x1d')];var _0x2514ff=_0x5b4b6e?_0x2cced2[_0xaa50('0x1f')]:_0x29e7f1[_0xaa50('0x1d')]+_0x29e7f1[_0xaa50('0x20')];var _0x5dc8f1;if(_0x2514ff>=_0x3e1bca){_0x2514ff=_0x3e1bca;_0x5dc8f1=0xc8;}else{_0x5dc8f1=0xce;}_0x4710e2['status'](_0x5dc8f1);return _0x4710e2[_0xaa50('0x21')]('Content-Range',_0x24c625+'-'+_0x2514ff+'/'+_0x3e1bca)[_0xaa50('0x1c')](_0x2cced2);}return null;};}function patchUpdates(_0xe4f2aa){return function(_0x2cd4ed){try{jsonpatch['apply'](_0x2cd4ed,_0xe4f2aa,!![]);}catch(_0x16088d){return BPromise[_0xaa50('0x22')](_0x16088d);}return _0x2cd4ed['save']();};}function saveUpdates(_0x4a3830,_0x36bf8f){return function(_0x5bb56c){if(_0x5bb56c){return _0x5bb56c[_0xaa50('0x23')](_0x4a3830)[_0xaa50('0x24')](function(_0x1007e4){return _0x1007e4;});}return null;};}function removeEntity(_0x4c266d,_0xf863a1){return function(_0xcbb53f){if(_0xcbb53f){return _0xcbb53f[_0xaa50('0x25')]()[_0xaa50('0x24')](function(){_0x4c266d[_0xaa50('0x1a')](0xcc)[_0xaa50('0x1b')]();});}};}function handleEntityNotFound(_0x534d91,_0x11bcdf){return function(_0xc66a96){if(!_0xc66a96){_0x534d91[_0xaa50('0x19')](0x194);}return _0xc66a96;};}function handleError(_0x213d08,_0x25b404){_0x25b404=_0x25b404||0x1f4;return function(_0x2a592d){logger[_0xaa50('0x26')](_0x2a592d[_0xaa50('0x27')]);if(_0x2a592d[_0xaa50('0x28')]){delete _0x2a592d[_0xaa50('0x28')];}_0x213d08[_0xaa50('0x1a')](_0x25b404)[_0xaa50('0x29')](_0x2a592d);};}exports[_0xaa50('0x2a')]=function(_0x3ef93d,_0x283269){var _0xc9aa8b={},_0xca594c={},_0x50211b={'count':0x0,'rows':[]};var _0x17af56=_['map'](db['OpenchannelTransferReport'][_0xaa50('0x2b')],function(_0x3bbc67){return{'name':_0x3bbc67['fieldName'],'type':_0x3bbc67[_0xaa50('0x2c')][_0xaa50('0x2d')]};});_0xca594c[_0xaa50('0x2e')]=_[_0xaa50('0x2f')](_0x17af56,_0xaa50('0x28'));_0xca594c['query']=_['keys'](_0x3ef93d[_0xaa50('0x30')]);_0xca594c[_0xaa50('0x31')]=_['intersection'](_0xca594c['model'],_0xca594c[_0xaa50('0x30')]);_0xc9aa8b['attributes']=_['intersection'](_0xca594c[_0xaa50('0x2e')],qs['fields'](_0x3ef93d[_0xaa50('0x30')][_0xaa50('0x32')]));_0xc9aa8b[_0xaa50('0x33')]=_0xc9aa8b[_0xaa50('0x33')][_0xaa50('0x34')]?_0xc9aa8b['attributes']:_0xca594c[_0xaa50('0x2e')];if(!_0x3ef93d[_0xaa50('0x30')][_0xaa50('0x35')]('nolimit')){_0xc9aa8b[_0xaa50('0x20')]=qs['limit'](_0x3ef93d[_0xaa50('0x30')][_0xaa50('0x20')]);_0xc9aa8b[_0xaa50('0x1d')]=qs[_0xaa50('0x1d')](_0x3ef93d[_0xaa50('0x30')][_0xaa50('0x1d')]);}_0xc9aa8b[_0xaa50('0x36')]=qs[_0xaa50('0x37')](_0x3ef93d[_0xaa50('0x30')][_0xaa50('0x37')]);_0xc9aa8b['where']=qs['filters'](_['pick'](_0x3ef93d[_0xaa50('0x30')],_0xca594c[_0xaa50('0x31')]),_0x17af56);if(_0x3ef93d[_0xaa50('0x30')][_0xaa50('0x38')]){_0xc9aa8b[_0xaa50('0x39')]=_[_0xaa50('0x3a')](_0xc9aa8b[_0xaa50('0x39')],{'$or':_[_0xaa50('0x2f')](_0x17af56,function(_0x5e362a){if(_0x5e362a[_0xaa50('0x2c')]!==_0xaa50('0x3b')){var _0x4e4e15={};_0x4e4e15[_0x5e362a['name']]={'$like':'%'+_0x3ef93d[_0xaa50('0x30')][_0xaa50('0x38')]+'%'};return _0x4e4e15;}})});}_0xc9aa8b=_[_0xaa50('0x3a')]({},_0xc9aa8b,_0x3ef93d[_0xaa50('0x3c')]);var _0x1e68ed={'where':_0xc9aa8b['where']};return db[_0xaa50('0x3d')][_0xaa50('0x1f')](_0x1e68ed)[_0xaa50('0x24')](function(_0x42a7e0){_0x50211b[_0xaa50('0x1f')]=_0x42a7e0;if(_0x3ef93d[_0xaa50('0x30')][_0xaa50('0x3e')]){_0xc9aa8b['include']=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0xaa50('0x3f')](_0xc9aa8b);})[_0xaa50('0x24')](function(_0x368e69){_0x50211b[_0xaa50('0x40')]=_0x368e69;return _0x50211b;})[_0xaa50('0x24')](respondWithFilteredResult(_0x283269,_0xc9aa8b))[_0xaa50('0x41')](handleError(_0x283269,null));};exports[_0xaa50('0x42')]=function(_0x111635,_0x506d8f){var _0x8a69c5={'raw':!![],'where':{'id':_0x111635['params']['id']}},_0x3b6797={};_0x3b6797[_0xaa50('0x2e')]=_[_0xaa50('0x43')](db['OpenchannelTransferReport'][_0xaa50('0x2b')]);_0x3b6797['query']=_['keys'](_0x111635[_0xaa50('0x30')]);_0x3b6797['filters']=_[_0xaa50('0x44')](_0x3b6797[_0xaa50('0x2e')],_0x3b6797[_0xaa50('0x30')]);_0x8a69c5[_0xaa50('0x33')]=_[_0xaa50('0x44')](_0x3b6797[_0xaa50('0x2e')],qs[_0xaa50('0x32')](_0x111635[_0xaa50('0x30')][_0xaa50('0x32')]));_0x8a69c5[_0xaa50('0x33')]=_0x8a69c5[_0xaa50('0x33')]['length']?_0x8a69c5[_0xaa50('0x33')]:_0x3b6797[_0xaa50('0x2e')];if(_0x111635[_0xaa50('0x30')][_0xaa50('0x3e')]){_0x8a69c5['include']=[{'all':!![]}];}_0x8a69c5=_[_0xaa50('0x3a')]({},_0x8a69c5,_0x111635[_0xaa50('0x3c')]);return db['OpenchannelTransferReport'][_0xaa50('0x45')](_0x8a69c5)['then'](handleEntityNotFound(_0x506d8f,null))[_0xaa50('0x24')](respondWithResult(_0x506d8f,null))[_0xaa50('0x41')](handleError(_0x506d8f,null));};exports[_0xaa50('0x46')]=function(_0x2ea813,_0x23d419){return db['OpenchannelTransferReport']['create'](_0x2ea813[_0xaa50('0x47')],{})[_0xaa50('0x24')](respondWithResult(_0x23d419,0xc9))['catch'](handleError(_0x23d419,null));};exports[_0xaa50('0x23')]=function(_0x1f3d82,_0x2fa88d){if(_0x1f3d82[_0xaa50('0x47')]['id']){delete _0x1f3d82['body']['id'];}return db['OpenchannelTransferReport'][_0xaa50('0x45')]({'where':{'id':_0x1f3d82['params']['id']}})[_0xaa50('0x24')](handleEntityNotFound(_0x2fa88d,null))[_0xaa50('0x24')](saveUpdates(_0x1f3d82[_0xaa50('0x47')],null))['then'](respondWithResult(_0x2fa88d,null))[_0xaa50('0x41')](handleError(_0x2fa88d,null));};exports[_0xaa50('0x25')]=function(_0x596259,_0x538585){return db[_0xaa50('0x3d')][_0xaa50('0x45')]({'where':{'id':_0x596259[_0xaa50('0x48')]['id']}})['then'](handleEntityNotFound(_0x538585,null))[_0xaa50('0x24')](removeEntity(_0x538585,null))[_0xaa50('0x41')](handleError(_0x538585,null));};exports['describe']=function(_0x585045,_0x5a50aa){return db[_0xaa50('0x3d')]['describe']()[_0xaa50('0x24')](respondWithResult(_0x5a50aa,null))[_0xaa50('0x41')](handleError(_0x5a50aa,null));}; \ No newline at end of file +var _0xea6a=['update','destroy','then','stack','name','index','map','OpenchannelTransferReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','catch','create','body','params','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','reject'];(function(_0x30fa83,_0x183b2e){var _0x497fc3=function(_0x59a818){while(--_0x59a818){_0x30fa83['push'](_0x30fa83['shift']());}};_0x497fc3(++_0x183b2e);}(_0xea6a,0x73));var _0xaea6=function(_0x554d47,_0x414e10){_0x554d47=_0x554d47-0x0;var _0x54e0a0=_0xea6a[_0x554d47];return _0x54e0a0;};'use strict';var emlformat=require(_0xaea6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaea6('0x1'));var jsonpatch=require(_0xaea6('0x2'));var rp=require(_0xaea6('0x3'));var moment=require(_0xaea6('0x4'));var BPromise=require(_0xaea6('0x5'));var Mustache=require(_0xaea6('0x6'));var util=require(_0xaea6('0x7'));var path=require(_0xaea6('0x8'));var sox=require(_0xaea6('0x9'));var csv=require(_0xaea6('0xa'));var ejs=require(_0xaea6('0xb'));var fs=require('fs');var fs_extra=require(_0xaea6('0xc'));var _=require(_0xaea6('0xd'));var squel=require(_0xaea6('0xe'));var crypto=require(_0xaea6('0xf'));var jsforce=require(_0xaea6('0x10'));var deskjs=require(_0xaea6('0x11'));var toCsv=require(_0xaea6('0xa'));var querystring=require(_0xaea6('0x12'));var Papa=require(_0xaea6('0x13'));var Redis=require('ioredis');var authService=require(_0xaea6('0x14'));var qs=require(_0xaea6('0x15'));var as=require(_0xaea6('0x16'));var hardwareService=require(_0xaea6('0x17'));var logger=require('../../config/logger')(_0xaea6('0x18'));var utils=require(_0xaea6('0x19'));var config=require(_0xaea6('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xaea6('0x1b'))['db'];function respondWithStatusCode(_0x292128,_0x1d143c){_0x1d143c=_0x1d143c||0xcc;return function(_0x58092b){if(_0x58092b){return _0x292128[_0xaea6('0x1c')](_0x1d143c);}return _0x292128[_0xaea6('0x1d')](_0x1d143c)[_0xaea6('0x1e')]();};}function respondWithResult(_0xd2400d,_0x5015f2){_0x5015f2=_0x5015f2||0xc8;return function(_0x55dc25){if(_0x55dc25){return _0xd2400d[_0xaea6('0x1d')](_0x5015f2)[_0xaea6('0x1f')](_0x55dc25);}};}function respondWithFilteredResult(_0x687f66,_0x4cc3cc){return function(_0x2df096){if(_0x2df096){var _0x1ecf79=typeof _0x4cc3cc['offset']===_0xaea6('0x20')&&typeof _0x4cc3cc[_0xaea6('0x21')]==='undefined';var _0x510caa=_0x2df096['count'];var _0x3c9bab=_0x1ecf79?0x0:_0x4cc3cc[_0xaea6('0x22')];var _0x760630=_0x1ecf79?_0x2df096[_0xaea6('0x23')]:_0x4cc3cc[_0xaea6('0x22')]+_0x4cc3cc['limit'];var _0x3b73b4;if(_0x760630>=_0x510caa){_0x760630=_0x510caa;_0x3b73b4=0xc8;}else{_0x3b73b4=0xce;}_0x687f66[_0xaea6('0x1d')](_0x3b73b4);return _0x687f66[_0xaea6('0x24')](_0xaea6('0x25'),_0x3c9bab+'-'+_0x760630+'/'+_0x510caa)[_0xaea6('0x1f')](_0x2df096);}return null;};}function patchUpdates(_0x5e16d8){return function(_0x529413){try{jsonpatch['apply'](_0x529413,_0x5e16d8,!![]);}catch(_0x43a197){return BPromise[_0xaea6('0x26')](_0x43a197);}return _0x529413['save']();};}function saveUpdates(_0x4c73c5,_0x29f258){return function(_0xc633e8){if(_0xc633e8){return _0xc633e8[_0xaea6('0x27')](_0x4c73c5)['then'](function(_0x38a42e){return _0x38a42e;});}return null;};}function removeEntity(_0x28df37,_0x34c8fc){return function(_0x29b162){if(_0x29b162){return _0x29b162[_0xaea6('0x28')]()[_0xaea6('0x29')](function(){_0x28df37[_0xaea6('0x1d')](0xcc)[_0xaea6('0x1e')]();});}};}function handleEntityNotFound(_0x5d3e4d,_0x268176){return function(_0x34571d){if(!_0x34571d){_0x5d3e4d[_0xaea6('0x1c')](0x194);}return _0x34571d;};}function handleError(_0x3a3be8,_0x436a42){_0x436a42=_0x436a42||0x1f4;return function(_0x307cd8){logger['error'](_0x307cd8[_0xaea6('0x2a')]);if(_0x307cd8[_0xaea6('0x2b')]){delete _0x307cd8[_0xaea6('0x2b')];}_0x3a3be8[_0xaea6('0x1d')](_0x436a42)['send'](_0x307cd8);};}exports[_0xaea6('0x2c')]=function(_0x5593ae,_0x1daa23){var _0x93301e={},_0x2947a2={},_0x4d6d20={'count':0x0,'rows':[]};var _0x1c715b=_[_0xaea6('0x2d')](db[_0xaea6('0x2e')][_0xaea6('0x2f')],function(_0x29b157){return{'name':_0x29b157['fieldName'],'type':_0x29b157[_0xaea6('0x30')][_0xaea6('0x31')]};});_0x2947a2[_0xaea6('0x32')]=_[_0xaea6('0x2d')](_0x1c715b,_0xaea6('0x2b'));_0x2947a2[_0xaea6('0x33')]=_[_0xaea6('0x34')](_0x5593ae[_0xaea6('0x33')]);_0x2947a2[_0xaea6('0x35')]=_[_0xaea6('0x36')](_0x2947a2[_0xaea6('0x32')],_0x2947a2[_0xaea6('0x33')]);_0x93301e[_0xaea6('0x37')]=_['intersection'](_0x2947a2[_0xaea6('0x32')],qs['fields'](_0x5593ae['query'][_0xaea6('0x38')]));_0x93301e[_0xaea6('0x37')]=_0x93301e[_0xaea6('0x37')][_0xaea6('0x39')]?_0x93301e[_0xaea6('0x37')]:_0x2947a2[_0xaea6('0x32')];if(!_0x5593ae[_0xaea6('0x33')]['hasOwnProperty'](_0xaea6('0x3a'))){_0x93301e[_0xaea6('0x21')]=qs['limit'](_0x5593ae[_0xaea6('0x33')]['limit']);_0x93301e['offset']=qs[_0xaea6('0x22')](_0x5593ae[_0xaea6('0x33')][_0xaea6('0x22')]);}_0x93301e[_0xaea6('0x3b')]=qs[_0xaea6('0x3c')](_0x5593ae[_0xaea6('0x33')][_0xaea6('0x3c')]);_0x93301e[_0xaea6('0x3d')]=qs[_0xaea6('0x35')](_[_0xaea6('0x3e')](_0x5593ae[_0xaea6('0x33')],_0x2947a2['filters']),_0x1c715b);if(_0x5593ae['query'][_0xaea6('0x3f')]){_0x93301e['where']=_[_0xaea6('0x40')](_0x93301e[_0xaea6('0x3d')],{'$or':_[_0xaea6('0x2d')](_0x1c715b,function(_0x185153){if(_0x185153[_0xaea6('0x30')]!==_0xaea6('0x41')){var _0x22f96c={};_0x22f96c[_0x185153[_0xaea6('0x2b')]]={'$like':'%'+_0x5593ae[_0xaea6('0x33')][_0xaea6('0x3f')]+'%'};return _0x22f96c;}})});}_0x93301e=_[_0xaea6('0x40')]({},_0x93301e,_0x5593ae[_0xaea6('0x42')]);var _0x5c4457={'where':_0x93301e['where']};return db[_0xaea6('0x2e')][_0xaea6('0x23')](_0x5c4457)['then'](function(_0x551e03){_0x4d6d20[_0xaea6('0x23')]=_0x551e03;if(_0x5593ae[_0xaea6('0x33')][_0xaea6('0x43')]){_0x93301e[_0xaea6('0x44')]=[{'all':!![]}];}return db[_0xaea6('0x2e')][_0xaea6('0x45')](_0x93301e);})[_0xaea6('0x29')](function(_0x38fa64){_0x4d6d20['rows']=_0x38fa64;return _0x4d6d20;})[_0xaea6('0x29')](respondWithFilteredResult(_0x1daa23,_0x93301e))['catch'](handleError(_0x1daa23,null));};exports[_0xaea6('0x46')]=function(_0x87f992,_0x25e9b4){var _0x2f8cf0={'raw':!![],'where':{'id':_0x87f992['params']['id']}},_0x5b8dfd={};_0x5b8dfd[_0xaea6('0x32')]=_[_0xaea6('0x34')](db[_0xaea6('0x2e')]['rawAttributes']);_0x5b8dfd[_0xaea6('0x33')]=_[_0xaea6('0x34')](_0x87f992[_0xaea6('0x33')]);_0x5b8dfd[_0xaea6('0x35')]=_[_0xaea6('0x36')](_0x5b8dfd[_0xaea6('0x32')],_0x5b8dfd[_0xaea6('0x33')]);_0x2f8cf0[_0xaea6('0x37')]=_[_0xaea6('0x36')](_0x5b8dfd[_0xaea6('0x32')],qs['fields'](_0x87f992[_0xaea6('0x33')]['fields']));_0x2f8cf0['attributes']=_0x2f8cf0[_0xaea6('0x37')][_0xaea6('0x39')]?_0x2f8cf0[_0xaea6('0x37')]:_0x5b8dfd[_0xaea6('0x32')];if(_0x87f992[_0xaea6('0x33')][_0xaea6('0x43')]){_0x2f8cf0[_0xaea6('0x44')]=[{'all':!![]}];}_0x2f8cf0=_[_0xaea6('0x40')]({},_0x2f8cf0,_0x87f992['options']);return db[_0xaea6('0x2e')]['find'](_0x2f8cf0)[_0xaea6('0x29')](handleEntityNotFound(_0x25e9b4,null))[_0xaea6('0x29')](respondWithResult(_0x25e9b4,null))[_0xaea6('0x47')](handleError(_0x25e9b4,null));};exports[_0xaea6('0x48')]=function(_0x53a943,_0x294c06){return db[_0xaea6('0x2e')]['create'](_0x53a943[_0xaea6('0x49')],{})[_0xaea6('0x29')](respondWithResult(_0x294c06,0xc9))['catch'](handleError(_0x294c06,null));};exports['update']=function(_0x58d100,_0x5be8a4){if(_0x58d100[_0xaea6('0x49')]['id']){delete _0x58d100[_0xaea6('0x49')]['id'];}return db['OpenchannelTransferReport']['find']({'where':{'id':_0x58d100[_0xaea6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5be8a4,null))[_0xaea6('0x29')](saveUpdates(_0x58d100[_0xaea6('0x49')],null))['then'](respondWithResult(_0x5be8a4,null))[_0xaea6('0x47')](handleError(_0x5be8a4,null));};exports[_0xaea6('0x28')]=function(_0xfe6009,_0x5ed999){return db[_0xaea6('0x2e')][_0xaea6('0x4b')]({'where':{'id':_0xfe6009['params']['id']}})['then'](handleEntityNotFound(_0x5ed999,null))[_0xaea6('0x29')](removeEntity(_0x5ed999,null))[_0xaea6('0x47')](handleError(_0x5ed999,null));};exports[_0xaea6('0x4c')]=function(_0x39a957,_0x263908){return db[_0xaea6('0x2e')][_0xaea6('0x4c')]()[_0xaea6('0x29')](respondWithResult(_0x263908,null))[_0xaea6('0x47')](handleError(_0x263908,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 7d0ab6b..258f03e 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 _0xd310=['api','request-promise','path','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xd310,0x132));var _0x0d31=function(_0x80f119,_0x55c441){_0x80f119=_0x80f119-0x0;var _0x2544bb=_0xd310[_0x80f119];return _0x2544bb;};'use strict';var _=require(_0x0d31('0x0'));var util=require(_0x0d31('0x1'));var logger=require('../../config/logger')(_0x0d31('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0d31('0x3'));var fs=require('fs');var path=require(_0x0d31('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0d31('0x5'));module[_0x0d31('0x6')]=function(_0x1c8283,_0x1ab2e0){return _0x1c8283[_0x0d31('0x7')](_0x0d31('0x8'),attributes,{'tableName':_0x0d31('0x9'),'paranoid':![],'indexes':[{'name':_0x0d31('0xa'),'fields':[_0x0d31('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7fea=['define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x27380a,_0x11b4db){var _0x49557d=function(_0x11984a){while(--_0x11984a){_0x27380a['push'](_0x27380a['shift']());}};_0x49557d(++_0x11b4db);}(_0x7fea,0x1c0));var _0xa7fe=function(_0x295362,_0x3ee762){_0x295362=_0x295362-0x0;var _0x2c10b5=_0x7fea[_0x295362];return _0x2c10b5;};'use strict';var _=require(_0xa7fe('0x0'));var util=require('util');var logger=require(_0xa7fe('0x1'))(_0xa7fe('0x2'));var moment=require('moment');var BPromise=require(_0xa7fe('0x3'));var rp=require(_0xa7fe('0x4'));var fs=require('fs');var path=require(_0xa7fe('0x5'));var rimraf=require('rimraf');var config=require(_0xa7fe('0x6'));var attributes=require('./openchannelTransferReport.attributes');module[_0xa7fe('0x7')]=function(_0x57a441,_0x379e5f){return _0x57a441[_0xa7fe('0x8')](_0xa7fe('0x9'),attributes,{'tableName':_0xa7fe('0xa'),'paranoid':![],'indexes':[{'name':_0xa7fe('0xb'),'fields':[_0xa7fe('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 34256fc..df173dd 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 _0x64f5=['result','catch','lodash','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x22c684,_0x753309){var _0x39fcbb=function(_0x38b631){while(--_0x38b631){_0x22c684['push'](_0x22c684['shift']());}};_0x39fcbb(++_0x753309);}(_0x64f5,0x17e));var _0x564f=function(_0xd44fee,_0x2c5737){_0xd44fee=_0xd44fee-0x0;var _0x3e7ccb=_0x64f5[_0xd44fee];return _0x3e7ccb;};'use strict';var _=require(_0x564f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x564f('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x564f('0x2'))['db'];var utils=require(_0x564f('0x3'));var logger=require('../../config/logger')(_0x564f('0x4'));var config=require(_0x564f('0x5'));var jayson=require(_0x564f('0x6'));var client=jayson[_0x564f('0x7')][_0x564f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4d3dae,_0x26f14e,_0x28db5a){return new BPromise(function(_0x275bd6,_0x26fd74){return client[_0x564f('0x9')](_0x4d3dae,_0x28db5a)[_0x564f('0xa')](function(_0x2e2b5c){logger[_0x564f('0xb')](_0x564f('0xc'),_0x26f14e,_0x564f('0xd'));logger[_0x564f('0xe')](_0x564f('0xf'),_0x26f14e,_0x564f('0xd'),JSON['stringify'](_0x2e2b5c));if(_0x2e2b5c['error']){if(_0x2e2b5c[_0x564f('0x10')]['code']===0x1f4){logger[_0x564f('0x10')](_0x564f('0xc'),_0x26f14e,_0x2e2b5c[_0x564f('0x10')]['message']);return _0x26fd74(_0x2e2b5c[_0x564f('0x10')][_0x564f('0x11')]);}logger[_0x564f('0x10')](_0x564f('0xc'),_0x26f14e,_0x2e2b5c[_0x564f('0x10')]['message']);return _0x275bd6(_0x2e2b5c['error'][_0x564f('0x11')]);}else{logger[_0x564f('0xb')](_0x564f('0xc'),_0x26f14e,_0x564f('0xd'));_0x275bd6(_0x2e2b5c[_0x564f('0x12')][_0x564f('0x11')]);}})[_0x564f('0x13')](function(_0x15d9d7){logger[_0x564f('0x10')](_0x564f('0xc'),_0x26f14e,_0x15d9d7);_0x26fd74(_0x15d9d7);});});} \ No newline at end of file +var _0x1af3=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x30b955,_0x55d0d8){var _0x2c9b08=function(_0x17b652){while(--_0x17b652){_0x30b955['push'](_0x30b955['shift']());}};_0x2c9b08(++_0x55d0d8);}(_0x1af3,0x1ca));var _0x31af=function(_0x58afd5,_0x534a48){_0x58afd5=_0x58afd5-0x0;var _0x3e503b=_0x1af3[_0x58afd5];return _0x3e503b;};'use strict';var _=require(_0x31af('0x0'));var util=require(_0x31af('0x1'));var moment=require(_0x31af('0x2'));var BPromise=require(_0x31af('0x3'));var rs=require(_0x31af('0x4'));var fs=require('fs');var Redis=require(_0x31af('0x5'));var db=require(_0x31af('0x6'))['db'];var utils=require(_0x31af('0x7'));var logger=require(_0x31af('0x8'))(_0x31af('0x9'));var config=require('../../config/environment');var jayson=require(_0x31af('0xa'));var client=jayson[_0x31af('0xb')][_0x31af('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x21ddc5,_0x485717,_0x6be8e9){return new BPromise(function(_0x1833de,_0x406dd8){return client['request'](_0x21ddc5,_0x6be8e9)[_0x31af('0xd')](function(_0x2f1973){logger[_0x31af('0xe')](_0x31af('0xf'),_0x485717,_0x31af('0x10'));logger[_0x31af('0x11')](_0x31af('0x12'),_0x485717,_0x31af('0x10'),JSON['stringify'](_0x2f1973));if(_0x2f1973[_0x31af('0x13')]){if(_0x2f1973[_0x31af('0x13')][_0x31af('0x14')]===0x1f4){logger[_0x31af('0x13')](_0x31af('0xf'),_0x485717,_0x2f1973['error'][_0x31af('0x15')]);return _0x406dd8(_0x2f1973[_0x31af('0x13')]['message']);}logger['error'](_0x31af('0xf'),_0x485717,_0x2f1973[_0x31af('0x13')][_0x31af('0x15')]);return _0x1833de(_0x2f1973[_0x31af('0x13')][_0x31af('0x15')]);}else{logger[_0x31af('0xe')](_0x31af('0xf'),_0x485717,_0x31af('0x10'));_0x1833de(_0x2f1973[_0x31af('0x16')][_0x31af('0x15')]);}})[_0x31af('0x17')](function(_0x51bae2){logger[_0x31af('0x13')](_0x31af('0xf'),_0x485717,_0x51bae2);_0x406dd8(_0x51bae2);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 5f92ef1..aee313d 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 _0x6344=['./pause.controller','get','index','/:id','isAuthenticated','post','create','update','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x562d39,_0x290f8d){var _0x4fdc2d=function(_0x53968e){while(--_0x53968e){_0x562d39['push'](_0x562d39['shift']());}};_0x4fdc2d(++_0x290f8d);}(_0x6344,0x196));var _0x4634=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6344[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x4634('0x0'));var util=require(_0x4634('0x1'));var path=require('path');var timeout=require(_0x4634('0x2'));var express=require('express');var router=express[_0x4634('0x3')]();var fs_extra=require(_0x4634('0x4'));var auth=require(_0x4634('0x5'));var interaction=require(_0x4634('0x6'));var config=require(_0x4634('0x7'));var controller=require(_0x4634('0x8'));router[_0x4634('0x9')]('/',auth['isAuthenticated'](),controller[_0x4634('0xa')]);router[_0x4634('0x9')](_0x4634('0xb'),auth[_0x4634('0xc')](),controller['show']);router[_0x4634('0xd')]('/',auth[_0x4634('0xc')](),controller[_0x4634('0xe')]);router['put'](_0x4634('0xb'),auth[_0x4634('0xc')](),controller[_0x4634('0xf')]);router['delete']('/:id',auth[_0x4634('0xc')](),controller[_0x4634('0x10')]);module[_0x4634('0x11')]=router; \ No newline at end of file +var _0x4ebc=['destroy','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','/:id'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0x4ebc,0x1d2));var _0xc4eb=function(_0x4e19ab,_0x55ba6f){_0x4e19ab=_0x4e19ab-0x0;var _0xfa69da=_0x4ebc[_0x4e19ab];return _0xfa69da;};'use strict';var multer=require('multer');var util=require(_0xc4eb('0x0'));var path=require('path');var timeout=require(_0xc4eb('0x1'));var express=require(_0xc4eb('0x2'));var router=express['Router']();var fs_extra=require(_0xc4eb('0x3'));var auth=require(_0xc4eb('0x4'));var interaction=require(_0xc4eb('0x5'));var config=require(_0xc4eb('0x6'));var controller=require('./pause.controller');router[_0xc4eb('0x7')]('/',auth[_0xc4eb('0x8')](),controller[_0xc4eb('0x9')]);router[_0xc4eb('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xc4eb('0xa')]);router[_0xc4eb('0xb')]('/',auth['isAuthenticated'](),controller[_0xc4eb('0xc')]);router['put'](_0xc4eb('0xd'),auth[_0xc4eb('0x8')](),controller['update']);router['delete'](_0xc4eb('0xd'),auth[_0xc4eb('0x8')](),controller[_0xc4eb('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 117ffd0..94104b2 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 _0x1939=['sequelize','exports','STRING'];(function(_0x559854,_0x2056e1){var _0x5bf2b9=function(_0x5ed1a1){while(--_0x5ed1a1){_0x559854['push'](_0x559854['shift']());}};_0x5bf2b9(++_0x2056e1);}(_0x1939,0x9c));var _0x9193=function(_0x5d2a5d,_0x55d114){_0x5d2a5d=_0x5d2a5d-0x0;var _0x66550d=_0x1939[_0x5d2a5d];return _0x66550d;};'use strict';var Sequelize=require(_0x9193('0x0'));module[_0x9193('0x1')]={'name':{'type':Sequelize[_0x9193('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x9193('0x2')]}}; \ No newline at end of file +var _0xdefb=['sequelize','exports','STRING'];(function(_0x2f9dd5,_0xee3127){var _0x36fb6e=function(_0x4105d4){while(--_0x4105d4){_0x2f9dd5['push'](_0x2f9dd5['shift']());}};_0x36fb6e(++_0xee3127);}(_0xdefb,0x168));var _0xbdef=function(_0x70d3b5,_0x4bbd30){_0x70d3b5=_0x70d3b5-0x0;var _0x4f96d6=_0xdefb[_0x70d3b5];return _0x4f96d6;};'use strict';var Sequelize=require(_0xbdef('0x0'));module[_0xbdef('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xbdef('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 6b22061..7813978 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 _0xca80=['Content-Range','reject','then','Pauses','UserProfileResource','end','error','name','send','index','map','Pause','fieldName','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','destroy','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set'];(function(_0x3460e3,_0x23d874){var _0x22a450=function(_0x2c1038){while(--_0x2c1038){_0x3460e3['push'](_0x3460e3['shift']());}};_0x22a450(++_0x23d874);}(_0xca80,0xd4));var _0x0ca8=function(_0x31dc7e,_0x2dd309){_0x31dc7e=_0x31dc7e-0x0;var _0x172eac=_0xca80[_0x31dc7e];return _0x172eac;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0ca8('0x0'));var zipdir=require(_0x0ca8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0ca8('0x2'));var moment=require(_0x0ca8('0x3'));var BPromise=require(_0x0ca8('0x4'));var Mustache=require(_0x0ca8('0x5'));var util=require(_0x0ca8('0x6'));var path=require(_0x0ca8('0x7'));var sox=require(_0x0ca8('0x8'));var csv=require(_0x0ca8('0x9'));var ejs=require(_0x0ca8('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0ca8('0xb'));var squel=require(_0x0ca8('0xc'));var crypto=require('crypto');var jsforce=require(_0x0ca8('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0ca8('0x9'));var querystring=require('querystring');var Papa=require(_0x0ca8('0xe'));var Redis=require('ioredis');var authService=require(_0x0ca8('0xf'));var qs=require(_0x0ca8('0x10'));var as=require(_0x0ca8('0x11'));var hardwareService=require(_0x0ca8('0x12'));var logger=require(_0x0ca8('0x13'))('api');var utils=require(_0x0ca8('0x14'));var config=require(_0x0ca8('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x0ca8('0x16'))['db'];function respondWithStatusCode(_0x3be8b8,_0x4df7bd){_0x4df7bd=_0x4df7bd||0xcc;return function(_0xbb52e5){if(_0xbb52e5){return _0x3be8b8[_0x0ca8('0x17')](_0x4df7bd);}return _0x3be8b8[_0x0ca8('0x18')](_0x4df7bd)['end']();};}function respondWithResult(_0x1900d0,_0x273c2c){_0x273c2c=_0x273c2c||0xc8;return function(_0x24d3f8){if(_0x24d3f8){return _0x1900d0['status'](_0x273c2c)[_0x0ca8('0x19')](_0x24d3f8);}};}function respondWithFilteredResult(_0x431637,_0x15af92){return function(_0x3340a6){if(_0x3340a6){var _0x280bdb=typeof _0x15af92[_0x0ca8('0x1a')]===_0x0ca8('0x1b')&&typeof _0x15af92['limit']===_0x0ca8('0x1b');var _0x453e7d=_0x3340a6['count'];var _0x282289=_0x280bdb?0x0:_0x15af92[_0x0ca8('0x1a')];var _0x34ed9d=_0x280bdb?_0x3340a6[_0x0ca8('0x1c')]:_0x15af92[_0x0ca8('0x1a')]+_0x15af92[_0x0ca8('0x1d')];var _0x76fff0;if(_0x34ed9d>=_0x453e7d){_0x34ed9d=_0x453e7d;_0x76fff0=0xc8;}else{_0x76fff0=0xce;}_0x431637[_0x0ca8('0x18')](_0x76fff0);return _0x431637[_0x0ca8('0x1e')](_0x0ca8('0x1f'),_0x282289+'-'+_0x34ed9d+'/'+_0x453e7d)['json'](_0x3340a6);}return null;};}function patchUpdates(_0x464720){return function(_0x4fa865){try{jsonpatch['apply'](_0x4fa865,_0x464720,!![]);}catch(_0x19cfa1){return BPromise[_0x0ca8('0x20')](_0x19cfa1);}return _0x4fa865['save']();};}function saveUpdates(_0x33e277,_0x28538c){return function(_0x580185){if(_0x580185){return _0x580185['update'](_0x33e277)[_0x0ca8('0x21')](function(_0xb8ab12){return _0xb8ab12;});}return null;};}function removeEntity(_0x4e03e0,_0x386665){return function(_0xe83d27){if(_0xe83d27){return _0xe83d27['destroy']()[_0x0ca8('0x21')](function(){var _0x27bb59=_0xe83d27['get']({'plain':!![]});var _0x4ce842=_0x0ca8('0x22');return db[_0x0ca8('0x23')]['destroy']({'where':{'type':_0x4ce842,'resourceId':_0x27bb59['id']}})['then'](function(){return _0xe83d27;});})[_0x0ca8('0x21')](function(){_0x4e03e0[_0x0ca8('0x18')](0xcc)[_0x0ca8('0x24')]();});}};}function handleEntityNotFound(_0x14893a,_0x20b8be){return function(_0x4c0516){if(!_0x4c0516){_0x14893a[_0x0ca8('0x17')](0x194);}return _0x4c0516;};}function handleError(_0x328d3f,_0x37fd17){_0x37fd17=_0x37fd17||0x1f4;return function(_0x5d80db){logger[_0x0ca8('0x25')](_0x5d80db['stack']);if(_0x5d80db[_0x0ca8('0x26')]){delete _0x5d80db[_0x0ca8('0x26')];}_0x328d3f[_0x0ca8('0x18')](_0x37fd17)[_0x0ca8('0x27')](_0x5d80db);};}exports[_0x0ca8('0x28')]=function(_0x4b54b0,_0x5ca807){var _0x3909d7={},_0x6e3316={},_0x4c8fc3={'count':0x0,'rows':[]};var _0x6f049a=_[_0x0ca8('0x29')](db[_0x0ca8('0x2a')]['rawAttributes'],function(_0x2a7c4c){return{'name':_0x2a7c4c[_0x0ca8('0x2b')],'type':_0x2a7c4c['type'][_0x0ca8('0x2c')]};});_0x6e3316['model']=_['map'](_0x6f049a,_0x0ca8('0x26'));_0x6e3316[_0x0ca8('0x2d')]=_[_0x0ca8('0x2e')](_0x4b54b0['query']);_0x6e3316['filters']=_[_0x0ca8('0x2f')](_0x6e3316[_0x0ca8('0x30')],_0x6e3316[_0x0ca8('0x2d')]);_0x3909d7[_0x0ca8('0x31')]=_[_0x0ca8('0x2f')](_0x6e3316['model'],qs[_0x0ca8('0x32')](_0x4b54b0[_0x0ca8('0x2d')][_0x0ca8('0x32')]));_0x3909d7[_0x0ca8('0x31')]=_0x3909d7[_0x0ca8('0x31')][_0x0ca8('0x33')]?_0x3909d7[_0x0ca8('0x31')]:_0x6e3316[_0x0ca8('0x30')];if(!_0x4b54b0[_0x0ca8('0x2d')][_0x0ca8('0x34')]('nolimit')){_0x3909d7[_0x0ca8('0x1d')]=qs[_0x0ca8('0x1d')](_0x4b54b0[_0x0ca8('0x2d')][_0x0ca8('0x1d')]);_0x3909d7['offset']=qs[_0x0ca8('0x1a')](_0x4b54b0[_0x0ca8('0x2d')][_0x0ca8('0x1a')]);}_0x3909d7[_0x0ca8('0x35')]=qs['sort'](_0x4b54b0[_0x0ca8('0x2d')][_0x0ca8('0x36')]);_0x3909d7[_0x0ca8('0x37')]=qs[_0x0ca8('0x38')](_['pick'](_0x4b54b0[_0x0ca8('0x2d')],_0x6e3316[_0x0ca8('0x38')]),_0x6f049a);if(_0x4b54b0[_0x0ca8('0x2d')][_0x0ca8('0x39')]){_0x3909d7['where']=_[_0x0ca8('0x3a')](_0x3909d7[_0x0ca8('0x37')],{'$or':_[_0x0ca8('0x29')](_0x6f049a,function(_0x28014c){if(_0x28014c['type']!==_0x0ca8('0x3b')){var _0x10a279={};_0x10a279[_0x28014c[_0x0ca8('0x26')]]={'$like':'%'+_0x4b54b0[_0x0ca8('0x2d')][_0x0ca8('0x39')]+'%'};return _0x10a279;}})});}_0x3909d7=_[_0x0ca8('0x3a')]({},_0x3909d7,_0x4b54b0[_0x0ca8('0x3c')]);var _0x4515b5={'where':_0x3909d7[_0x0ca8('0x37')]};return db['Pause'][_0x0ca8('0x1c')](_0x4515b5)[_0x0ca8('0x21')](function(_0x7bda77){_0x4c8fc3[_0x0ca8('0x1c')]=_0x7bda77;if(_0x4b54b0[_0x0ca8('0x2d')][_0x0ca8('0x3d')]){_0x3909d7[_0x0ca8('0x3e')]=[{'all':!![]}];}return db[_0x0ca8('0x2a')][_0x0ca8('0x3f')](_0x3909d7);})['then'](function(_0x2fdd73){_0x4c8fc3[_0x0ca8('0x40')]=_0x2fdd73;return _0x4c8fc3;})[_0x0ca8('0x21')](respondWithFilteredResult(_0x5ca807,_0x3909d7))[_0x0ca8('0x41')](handleError(_0x5ca807,null));};exports[_0x0ca8('0x42')]=function(_0x18991a,_0xadddda){var _0x10a9ee={'raw':!![],'where':{'id':_0x18991a[_0x0ca8('0x43')]['id']}},_0x1efa29={};_0x1efa29[_0x0ca8('0x30')]=_[_0x0ca8('0x2e')](db[_0x0ca8('0x2a')][_0x0ca8('0x44')]);_0x1efa29[_0x0ca8('0x2d')]=_[_0x0ca8('0x2e')](_0x18991a[_0x0ca8('0x2d')]);_0x1efa29[_0x0ca8('0x38')]=_[_0x0ca8('0x2f')](_0x1efa29[_0x0ca8('0x30')],_0x1efa29[_0x0ca8('0x2d')]);_0x10a9ee[_0x0ca8('0x31')]=_[_0x0ca8('0x2f')](_0x1efa29[_0x0ca8('0x30')],qs[_0x0ca8('0x32')](_0x18991a[_0x0ca8('0x2d')][_0x0ca8('0x32')]));_0x10a9ee['attributes']=_0x10a9ee[_0x0ca8('0x31')][_0x0ca8('0x33')]?_0x10a9ee[_0x0ca8('0x31')]:_0x1efa29[_0x0ca8('0x30')];if(_0x18991a[_0x0ca8('0x2d')][_0x0ca8('0x3d')]){_0x10a9ee['include']=[{'all':!![]}];}_0x10a9ee=_[_0x0ca8('0x3a')]({},_0x10a9ee,_0x18991a[_0x0ca8('0x3c')]);return db[_0x0ca8('0x2a')][_0x0ca8('0x45')](_0x10a9ee)[_0x0ca8('0x21')](handleEntityNotFound(_0xadddda,null))[_0x0ca8('0x21')](respondWithResult(_0xadddda,null))[_0x0ca8('0x41')](handleError(_0xadddda,null));};exports[_0x0ca8('0x46')]=function(_0x151442,_0x3c61b7){return db[_0x0ca8('0x2a')][_0x0ca8('0x46')](_0x151442[_0x0ca8('0x47')],{})[_0x0ca8('0x21')](function(_0x418737){var _0x13c841=_0x151442[_0x0ca8('0x48')][_0x0ca8('0x49')]({'plain':!![]});if(!_0x13c841)throw new Error(_0x0ca8('0x4a'));if(_0x13c841[_0x0ca8('0x4b')]===_0x0ca8('0x48')){var _0x541e77=_0x418737[_0x0ca8('0x49')]({'plain':!![]});var _0x444000=_0x0ca8('0x22');return db[_0x0ca8('0x4c')][_0x0ca8('0x45')]({'where':{'name':_0x444000,'userProfileId':_0x13c841[_0x0ca8('0x4d')]},'raw':!![]})[_0x0ca8('0x21')](function(_0x47b160){if(_0x47b160&&_0x47b160[_0x0ca8('0x4e')]===0x0){return db[_0x0ca8('0x23')][_0x0ca8('0x46')]({'name':_0x541e77[_0x0ca8('0x26')],'resourceId':_0x541e77['id'],'type':_0x47b160[_0x0ca8('0x26')],'sectionId':_0x47b160['id']},{})[_0x0ca8('0x21')](function(){return _0x418737;});}else{return _0x418737;}})[_0x0ca8('0x41')](function(_0x3ce032){logger[_0x0ca8('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3ce032);throw _0x3ce032;});}return _0x418737;})[_0x0ca8('0x21')](respondWithResult(_0x3c61b7,0xc9))[_0x0ca8('0x41')](handleError(_0x3c61b7,null));};exports[_0x0ca8('0x4f')]=function(_0x3c258,_0xf00bd3){if(_0x3c258[_0x0ca8('0x47')]['id']){delete _0x3c258[_0x0ca8('0x47')]['id'];}return db[_0x0ca8('0x2a')][_0x0ca8('0x45')]({'where':{'id':_0x3c258['params']['id']}})['then'](handleEntityNotFound(_0xf00bd3,null))[_0x0ca8('0x21')](saveUpdates(_0x3c258[_0x0ca8('0x47')],null))[_0x0ca8('0x21')](respondWithResult(_0xf00bd3,null))[_0x0ca8('0x41')](handleError(_0xf00bd3,null));};exports[_0x0ca8('0x50')]=function(_0x5bb833,_0x2cce94){return db['Pause'][_0x0ca8('0x45')]({'where':{'id':_0x5bb833[_0x0ca8('0x43')]['id']}})['then'](handleEntityNotFound(_0x2cce94,null))[_0x0ca8('0x21')](removeEntity(_0x2cce94,null))['catch'](handleError(_0x2cce94,null));}; \ No newline at end of file +var _0xb743=['params','filters','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Pauses','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','json','save','then','UserProfileResource','destroy','error','stack','name','send','index','map','Pause','rawAttributes','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show'];(function(_0x4c7d8b,_0x572388){var _0x187158=function(_0x5e956d){while(--_0x5e956d){_0x4c7d8b['push'](_0x4c7d8b['shift']());}};_0x187158(++_0x572388);}(_0xb743,0x1a8));var _0x3b74=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xb743[_0x36eaaa];return _0x461349;};'use strict';var emlformat=require(_0x3b74('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3b74('0x1'));var jsonpatch=require(_0x3b74('0x2'));var rp=require('request-promise');var moment=require(_0x3b74('0x3'));var BPromise=require(_0x3b74('0x4'));var Mustache=require(_0x3b74('0x5'));var util=require(_0x3b74('0x6'));var path=require('path');var sox=require(_0x3b74('0x7'));var csv=require(_0x3b74('0x8'));var ejs=require(_0x3b74('0x9'));var fs=require('fs');var fs_extra=require(_0x3b74('0xa'));var _=require('lodash');var squel=require(_0x3b74('0xb'));var crypto=require(_0x3b74('0xc'));var jsforce=require(_0x3b74('0xd'));var deskjs=require(_0x3b74('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3b74('0xf'));var Papa=require(_0x3b74('0x10'));var Redis=require(_0x3b74('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3b74('0x12'));var hardwareService=require(_0x3b74('0x13'));var logger=require(_0x3b74('0x14'))(_0x3b74('0x15'));var utils=require(_0x3b74('0x16'));var config=require(_0x3b74('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x3b74('0x18'))['db'];function respondWithStatusCode(_0x177ef8,_0xe8529e){_0xe8529e=_0xe8529e||0xcc;return function(_0x2792a9){if(_0x2792a9){return _0x177ef8[_0x3b74('0x19')](_0xe8529e);}return _0x177ef8[_0x3b74('0x1a')](_0xe8529e)[_0x3b74('0x1b')]();};}function respondWithResult(_0xef6e93,_0x2694ca){_0x2694ca=_0x2694ca||0xc8;return function(_0x7df5f1){if(_0x7df5f1){return _0xef6e93[_0x3b74('0x1a')](_0x2694ca)['json'](_0x7df5f1);}};}function respondWithFilteredResult(_0x57e829,_0x2e97a9){return function(_0x5c246b){if(_0x5c246b){var _0x57fcb2=typeof _0x2e97a9[_0x3b74('0x1c')]===_0x3b74('0x1d')&&typeof _0x2e97a9[_0x3b74('0x1e')]==='undefined';var _0x103997=_0x5c246b[_0x3b74('0x1f')];var _0x517a33=_0x57fcb2?0x0:_0x2e97a9[_0x3b74('0x1c')];var _0x4dfab1=_0x57fcb2?_0x5c246b[_0x3b74('0x1f')]:_0x2e97a9['offset']+_0x2e97a9[_0x3b74('0x1e')];var _0x3e5782;if(_0x4dfab1>=_0x103997){_0x4dfab1=_0x103997;_0x3e5782=0xc8;}else{_0x3e5782=0xce;}_0x57e829['status'](_0x3e5782);return _0x57e829['set']('Content-Range',_0x517a33+'-'+_0x4dfab1+'/'+_0x103997)[_0x3b74('0x20')](_0x5c246b);}return null;};}function patchUpdates(_0x4c9bdf){return function(_0x16b685){try{jsonpatch['apply'](_0x16b685,_0x4c9bdf,!![]);}catch(_0x44bbbe){return BPromise['reject'](_0x44bbbe);}return _0x16b685[_0x3b74('0x21')]();};}function saveUpdates(_0x4abc61,_0x904a87){return function(_0x1a90fa){if(_0x1a90fa){return _0x1a90fa['update'](_0x4abc61)[_0x3b74('0x22')](function(_0x5e2698){return _0x5e2698;});}return null;};}function removeEntity(_0x597066,_0x3a6ee7){return function(_0x578b7f){if(_0x578b7f){return _0x578b7f['destroy']()[_0x3b74('0x22')](function(){var _0x194f3b=_0x578b7f['get']({'plain':!![]});var _0x4a5512='Pauses';return db[_0x3b74('0x23')][_0x3b74('0x24')]({'where':{'type':_0x4a5512,'resourceId':_0x194f3b['id']}})[_0x3b74('0x22')](function(){return _0x578b7f;});})['then'](function(){_0x597066[_0x3b74('0x1a')](0xcc)[_0x3b74('0x1b')]();});}};}function handleEntityNotFound(_0x4b60a0,_0x51351e){return function(_0x4c1a7e){if(!_0x4c1a7e){_0x4b60a0[_0x3b74('0x19')](0x194);}return _0x4c1a7e;};}function handleError(_0x407f5c,_0x2c5d8d){_0x2c5d8d=_0x2c5d8d||0x1f4;return function(_0x4ad27e){logger[_0x3b74('0x25')](_0x4ad27e[_0x3b74('0x26')]);if(_0x4ad27e[_0x3b74('0x27')]){delete _0x4ad27e[_0x3b74('0x27')];}_0x407f5c[_0x3b74('0x1a')](_0x2c5d8d)[_0x3b74('0x28')](_0x4ad27e);};}exports[_0x3b74('0x29')]=function(_0x45c56c,_0x5a4a04){var _0x4f5c62={},_0x415d1f={},_0xbd4776={'count':0x0,'rows':[]};var _0x176611=_[_0x3b74('0x2a')](db[_0x3b74('0x2b')][_0x3b74('0x2c')],function(_0x1f0a2a){return{'name':_0x1f0a2a['fieldName'],'type':_0x1f0a2a['type'][_0x3b74('0x2d')]};});_0x415d1f[_0x3b74('0x2e')]=_[_0x3b74('0x2a')](_0x176611,'name');_0x415d1f[_0x3b74('0x2f')]=_[_0x3b74('0x30')](_0x45c56c[_0x3b74('0x2f')]);_0x415d1f['filters']=_[_0x3b74('0x31')](_0x415d1f[_0x3b74('0x2e')],_0x415d1f['query']);_0x4f5c62[_0x3b74('0x32')]=_[_0x3b74('0x31')](_0x415d1f[_0x3b74('0x2e')],qs[_0x3b74('0x33')](_0x45c56c[_0x3b74('0x2f')][_0x3b74('0x33')]));_0x4f5c62[_0x3b74('0x32')]=_0x4f5c62[_0x3b74('0x32')][_0x3b74('0x34')]?_0x4f5c62['attributes']:_0x415d1f[_0x3b74('0x2e')];if(!_0x45c56c[_0x3b74('0x2f')][_0x3b74('0x35')](_0x3b74('0x36'))){_0x4f5c62[_0x3b74('0x1e')]=qs[_0x3b74('0x1e')](_0x45c56c[_0x3b74('0x2f')][_0x3b74('0x1e')]);_0x4f5c62[_0x3b74('0x1c')]=qs[_0x3b74('0x1c')](_0x45c56c[_0x3b74('0x2f')]['offset']);}_0x4f5c62[_0x3b74('0x37')]=qs['sort'](_0x45c56c[_0x3b74('0x2f')]['sort']);_0x4f5c62[_0x3b74('0x38')]=qs['filters'](_['pick'](_0x45c56c[_0x3b74('0x2f')],_0x415d1f['filters']),_0x176611);if(_0x45c56c['query'][_0x3b74('0x39')]){_0x4f5c62[_0x3b74('0x38')]=_[_0x3b74('0x3a')](_0x4f5c62[_0x3b74('0x38')],{'$or':_['map'](_0x176611,function(_0x3c3a2e){if(_0x3c3a2e[_0x3b74('0x3b')]!==_0x3b74('0x3c')){var _0x130a9d={};_0x130a9d[_0x3c3a2e[_0x3b74('0x27')]]={'$like':'%'+_0x45c56c[_0x3b74('0x2f')]['filter']+'%'};return _0x130a9d;}})});}_0x4f5c62=_['merge']({},_0x4f5c62,_0x45c56c[_0x3b74('0x3d')]);var _0x4fd149={'where':_0x4f5c62[_0x3b74('0x38')]};return db[_0x3b74('0x2b')]['count'](_0x4fd149)[_0x3b74('0x22')](function(_0x2c3b02){_0xbd4776[_0x3b74('0x1f')]=_0x2c3b02;if(_0x45c56c[_0x3b74('0x2f')][_0x3b74('0x3e')]){_0x4f5c62[_0x3b74('0x3f')]=[{'all':!![]}];}return db[_0x3b74('0x2b')][_0x3b74('0x40')](_0x4f5c62);})[_0x3b74('0x22')](function(_0xa2ee3b){_0xbd4776[_0x3b74('0x41')]=_0xa2ee3b;return _0xbd4776;})[_0x3b74('0x22')](respondWithFilteredResult(_0x5a4a04,_0x4f5c62))[_0x3b74('0x42')](handleError(_0x5a4a04,null));};exports[_0x3b74('0x43')]=function(_0x413fa0,_0x4f033e){var _0x297eff={'raw':!![],'where':{'id':_0x413fa0[_0x3b74('0x44')]['id']}},_0x52338f={};_0x52338f[_0x3b74('0x2e')]=_[_0x3b74('0x30')](db[_0x3b74('0x2b')]['rawAttributes']);_0x52338f[_0x3b74('0x2f')]=_[_0x3b74('0x30')](_0x413fa0[_0x3b74('0x2f')]);_0x52338f[_0x3b74('0x45')]=_[_0x3b74('0x31')](_0x52338f[_0x3b74('0x2e')],_0x52338f['query']);_0x297eff['attributes']=_['intersection'](_0x52338f[_0x3b74('0x2e')],qs[_0x3b74('0x33')](_0x413fa0[_0x3b74('0x2f')][_0x3b74('0x33')]));_0x297eff['attributes']=_0x297eff[_0x3b74('0x32')]['length']?_0x297eff['attributes']:_0x52338f[_0x3b74('0x2e')];if(_0x413fa0[_0x3b74('0x2f')]['includeAll']){_0x297eff[_0x3b74('0x3f')]=[{'all':!![]}];}_0x297eff=_[_0x3b74('0x3a')]({},_0x297eff,_0x413fa0[_0x3b74('0x3d')]);return db[_0x3b74('0x2b')][_0x3b74('0x46')](_0x297eff)[_0x3b74('0x22')](handleEntityNotFound(_0x4f033e,null))[_0x3b74('0x22')](respondWithResult(_0x4f033e,null))[_0x3b74('0x42')](handleError(_0x4f033e,null));};exports['create']=function(_0x1d5094,_0x270398){return db[_0x3b74('0x2b')]['create'](_0x1d5094[_0x3b74('0x47')],{})['then'](function(_0x4d8472){var _0x294958=_0x1d5094[_0x3b74('0x48')][_0x3b74('0x49')]({'plain':!![]});if(!_0x294958)throw new Error(_0x3b74('0x4a'));if(_0x294958[_0x3b74('0x4b')]===_0x3b74('0x48')){var _0x26c649=_0x4d8472[_0x3b74('0x49')]({'plain':!![]});var _0x1f212a=_0x3b74('0x4c');return db[_0x3b74('0x4d')][_0x3b74('0x46')]({'where':{'name':_0x1f212a,'userProfileId':_0x294958[_0x3b74('0x4e')]},'raw':!![]})['then'](function(_0x1bbc2a){if(_0x1bbc2a&&_0x1bbc2a[_0x3b74('0x4f')]===0x0){return db[_0x3b74('0x23')]['create']({'name':_0x26c649[_0x3b74('0x27')],'resourceId':_0x26c649['id'],'type':_0x1bbc2a[_0x3b74('0x27')],'sectionId':_0x1bbc2a['id']},{})[_0x3b74('0x22')](function(){return _0x4d8472;});}else{return _0x4d8472;}})[_0x3b74('0x42')](function(_0x5d26b9){logger[_0x3b74('0x25')](_0x3b74('0x50'),_0x5d26b9);throw _0x5d26b9;});}return _0x4d8472;})[_0x3b74('0x22')](respondWithResult(_0x270398,0xc9))[_0x3b74('0x42')](handleError(_0x270398,null));};exports[_0x3b74('0x51')]=function(_0x141423,_0x598341){if(_0x141423[_0x3b74('0x47')]['id']){delete _0x141423[_0x3b74('0x47')]['id'];}return db[_0x3b74('0x2b')][_0x3b74('0x46')]({'where':{'id':_0x141423[_0x3b74('0x44')]['id']}})[_0x3b74('0x22')](handleEntityNotFound(_0x598341,null))['then'](saveUpdates(_0x141423['body'],null))[_0x3b74('0x22')](respondWithResult(_0x598341,null))['catch'](handleError(_0x598341,null));};exports[_0x3b74('0x24')]=function(_0x55ab81,_0xe02bab){return db[_0x3b74('0x2b')][_0x3b74('0x46')]({'where':{'id':_0x55ab81[_0x3b74('0x44')]['id']}})[_0x3b74('0x22')](handleEntityNotFound(_0xe02bab,null))[_0x3b74('0x22')](removeEntity(_0xe02bab,null))[_0x3b74('0x42')](handleError(_0xe02bab,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 6b6430e..d28b4f8 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 _0x8ef6=['exports','define','Pause','tools_pauses','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./pause.attributes'];(function(_0x143fca,_0x3e18ac){var _0x5726b5=function(_0x4a778b){while(--_0x4a778b){_0x143fca['push'](_0x143fca['shift']());}};_0x5726b5(++_0x3e18ac);}(_0x8ef6,0xf2));var _0x68ef=function(_0xe08a08,_0x1d190a){_0xe08a08=_0xe08a08-0x0;var _0x1b542f=_0x8ef6[_0xe08a08];return _0x1b542f;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var logger=require(_0x68ef('0x2'))(_0x68ef('0x3'));var moment=require(_0x68ef('0x4'));var BPromise=require(_0x68ef('0x5'));var rp=require(_0x68ef('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var attributes=require(_0x68ef('0x9'));module[_0x68ef('0xa')]=function(_0x4d26e3,_0x4f77f3){return _0x4d26e3[_0x68ef('0xb')](_0x68ef('0xc'),attributes,{'tableName':_0x68ef('0xd'),'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(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xc4aa[_0x51020b];return _0x371e47;};'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 b1f57eb..6774d5e 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(_0x4760ea,_0x2545bf){var _0x251807=function(_0x143db4){while(--_0x143db4){_0x4760ea['push'](_0x4760ea['shift']());}};_0x251807(++_0x2545bf);}(_0x7a54,0x106));var _0x47a5=function(_0x12f358,_0x394841){_0x12f358=_0x12f358-0x0;var _0x18cf1c=_0x7a54[_0x12f358];return _0x18cf1c;};'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(_0x2437dc,_0x21d231){var _0x5da2f0=function(_0x445a6b){while(--_0x445a6b){_0x2437dc['push'](_0x2437dc['shift']());}};_0x5da2f0(++_0x21d231);}(_0xb10b,0x12a));var _0xbb10=function(_0x264d4d,_0x118fb5){_0x264d4d=_0x264d4d-0x0;var _0xc917e2=_0xb10b[_0x264d4d];return _0xc917e2;};'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 92144e5..6fe7c9c 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 _0xb332=['server/files/plugins','originalname','replace','format','basename','extname','now','post','single','file','upload','/:id','delete','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','/:id/download','download','diskStorage','join','root'];(function(_0x25b483,_0x2e5db2){var _0x534772=function(_0x4c40c3){while(--_0x4c40c3){_0x25b483['push'](_0x25b483['shift']());}};_0x534772(++_0x2e5db2);}(_0xb332,0xd9));var _0x2b33=function(_0xaf25ae,_0x2001c1){_0xaf25ae=_0xaf25ae-0x0;var _0x49732d=_0xb332[_0xaf25ae];return _0x49732d;};'use strict';var multer=require(_0x2b33('0x0'));var util=require('util');var path=require(_0x2b33('0x1'));var timeout=require(_0x2b33('0x2'));var express=require('express');var router=express[_0x2b33('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2b33('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2b33('0x5'));var controller=require('./plugin.controller');router[_0x2b33('0x6')]('/',auth[_0x2b33('0x7')](),controller[_0x2b33('0x8')]);router[_0x2b33('0x6')]('/webhook',controller['webhookGet']);router[_0x2b33('0x6')]('/:id',auth[_0x2b33('0x7')](),controller[_0x2b33('0x9')]);router[_0x2b33('0x6')](_0x2b33('0xa'),auth['isAuthenticated'](),controller[_0x2b33('0xb')]);var upload=multer({'storage':multer[_0x2b33('0xc')]({'destination':function(_0x1be19d,_0x1d83a6,_0x1989f3){_0x1989f3(null,path[_0x2b33('0xd')](config[_0x2b33('0xe')],_0x2b33('0xf')));},'filename':function(_0x1e0d36,_0x3969cb,_0xca2248){_0x3969cb['originalname']=_0x3969cb[_0x2b33('0x10')][_0x2b33('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xca2248(null,util[_0x2b33('0x12')]('%s-%s%s',path[_0x2b33('0x13')](_0x3969cb['originalname'],path[_0x2b33('0x14')](_0x3969cb[_0x2b33('0x10')])),Date[_0x2b33('0x15')](),path['extname'](_0x3969cb['originalname'])));}})});router[_0x2b33('0x16')]('/',upload[_0x2b33('0x17')](_0x2b33('0x18')),controller[_0x2b33('0x19')]);router[_0x2b33('0x16')]('/webhook',controller['webhookPost']);router['put'](_0x2b33('0x1a'),auth['isAuthenticated'](),controller['update']);router[_0x2b33('0x1b')](_0x2b33('0x1a'),auth[_0x2b33('0x7')](),controller['delete']);module[_0x2b33('0x1c')]=router; \ No newline at end of file +var _0xc3b5=['server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','webhookPost','/:id','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/webhook','webhookGet','show','/:id/download','download','diskStorage','root'];(function(_0x13932d,_0xf930d3){var _0x1a7b81=function(_0x5c7b67){while(--_0x5c7b67){_0x13932d['push'](_0x13932d['shift']());}};_0x1a7b81(++_0xf930d3);}(_0xc3b5,0x6f));var _0x5c3b=function(_0x403444,_0x49a7a7){_0x403444=_0x403444-0x0;var _0x326257=_0xc3b5[_0x403444];return _0x326257;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5c3b('0x0'));var timeout=require(_0x5c3b('0x1'));var express=require(_0x5c3b('0x2'));var router=express[_0x5c3b('0x3')]();var fs_extra=require(_0x5c3b('0x4'));var auth=require(_0x5c3b('0x5'));var interaction=require(_0x5c3b('0x6'));var config=require(_0x5c3b('0x7'));var controller=require('./plugin.controller');router[_0x5c3b('0x8')]('/',auth[_0x5c3b('0x9')](),controller['index']);router[_0x5c3b('0x8')](_0x5c3b('0xa'),controller[_0x5c3b('0xb')]);router[_0x5c3b('0x8')]('/:id',auth[_0x5c3b('0x9')](),controller[_0x5c3b('0xc')]);router[_0x5c3b('0x8')](_0x5c3b('0xd'),auth['isAuthenticated'](),controller[_0x5c3b('0xe')]);var upload=multer({'storage':multer[_0x5c3b('0xf')]({'destination':function(_0x30ceca,_0x2e894a,_0x363c3d){_0x363c3d(null,path['join'](config[_0x5c3b('0x10')],_0x5c3b('0x11')));},'filename':function(_0x589c36,_0x1b2815,_0x3b953d){_0x1b2815['originalname']=_0x1b2815[_0x5c3b('0x12')][_0x5c3b('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3b953d(null,util[_0x5c3b('0x14')](_0x5c3b('0x15'),path[_0x5c3b('0x16')](_0x1b2815[_0x5c3b('0x12')],path[_0x5c3b('0x17')](_0x1b2815['originalname'])),Date[_0x5c3b('0x18')](),path['extname'](_0x1b2815['originalname'])));}})});router[_0x5c3b('0x19')]('/',upload[_0x5c3b('0x1a')](_0x5c3b('0x1b')),controller['upload']);router[_0x5c3b('0x19')](_0x5c3b('0xa'),controller[_0x5c3b('0x1c')]);router['put'](_0x5c3b('0x1d'),auth[_0x5c3b('0x9')](),controller['update']);router[_0x5c3b('0x1e')](_0x5c3b('0x1d'),auth[_0x5c3b('0x9')](),controller[_0x5c3b('0x1e')]);module[_0x5c3b('0x1f')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 27f35d7..117170f 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 _0x7826=['sequelize','STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'];(function(_0x57768a,_0x184569){var _0xd5145a=function(_0xedcf19){while(--_0xedcf19){_0x57768a['push'](_0x57768a['shift']());}};_0xd5145a(++_0x184569);}(_0x7826,0x126));var _0x6782=function(_0xb29bef,_0x45aff1){_0xb29bef=_0xb29bef-0x0;var _0x878163=_0x7826[_0xb29bef];return _0x878163;};'use strict';var Sequelize=require(_0x6782('0x0'));module['exports']={'name':{'type':Sequelize[_0x6782('0x1')]},'type':{'type':Sequelize[_0x6782('0x2')](_0x6782('0x3'),_0x6782('0x4'))},'description':{'type':Sequelize[_0x6782('0x5')]},'version':{'type':Sequelize[_0x6782('0x5')]},'path':{'type':Sequelize[_0x6782('0x1')],'comment':_0x6782('0x6')},'active':{'type':Sequelize[_0x6782('0x7')],'defaultValue':0x0,'comment':_0x6782('0x8')},'sidebar':{'type':Sequelize[_0x6782('0x2')](_0x6782('0x9'),_0x6782('0xa'),_0x6782('0xb'),_0x6782('0xc')),'defaultValue':_0x6782('0xb'),'comment':_0x6782('0xd')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0x6782('0x1')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x6782('0x1')]},'scriptPath':{'type':Sequelize[_0x6782('0x1')]}}; \ No newline at end of file +var _0x0405=['script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','adminOnly','always','never','sequelize','STRING','ENUM','html'];(function(_0x444ef9,_0x5d1b9f){var _0x586574=function(_0xceb7a4){while(--_0xceb7a4){_0x444ef9['push'](_0x444ef9['shift']());}};_0x586574(++_0x5d1b9f);}(_0x0405,0x75));var _0x5040=function(_0x31c69e,_0x21b53a){_0x31c69e=_0x31c69e-0x0;var _0x416220=_0x0405[_0x31c69e];return _0x416220;};'use strict';var Sequelize=require(_0x5040('0x0'));module['exports']={'name':{'type':Sequelize[_0x5040('0x1')]},'type':{'type':Sequelize[_0x5040('0x2')](_0x5040('0x3'),_0x5040('0x4'))},'description':{'type':Sequelize[_0x5040('0x5')]},'version':{'type':Sequelize[_0x5040('0x5')]},'path':{'type':Sequelize[_0x5040('0x1')],'comment':_0x5040('0x6')},'active':{'type':Sequelize[_0x5040('0x7')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x5040('0x2')](_0x5040('0x8'),'agentOnly',_0x5040('0x9'),_0x5040('0xa')),'defaultValue':_0x5040('0x9'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0x5040('0x1')]},'adminUrl':{'type':Sequelize[_0x5040('0x1')]},'agentUrl':{'type':Sequelize[_0x5040('0x1')]},'scriptName':{'type':Sequelize[_0x5040('0x1')]},'scriptPath':{'type':Sequelize[_0x5040('0x1')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 0360a55..803d7c5 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 _0x4aca=['intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','merge','options','include','catch','show','includeAll','find','params','root','server/files/plugins','format','basename','createWriteStream','zip','warning','code','ENOENT','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','join','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Sequelize','Plugin\x20not\x20found','download','%s.zip','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','parameters','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','always','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Plugins','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./plugin.socket','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','map','Plugin','fieldName','type','key','model','query','keys','filters'];(function(_0xf4d352,_0x31c9c6){var _0x360635=function(_0x488308){while(--_0x488308){_0xf4d352['push'](_0xf4d352['shift']());}};_0x360635(++_0x31c9c6);}(_0x4aca,0x1dd));var _0xa4ac=function(_0x2ce498,_0xd2eb9){_0x2ce498=_0x2ce498-0x0;var _0x5923f5=_0x4aca[_0x2ce498];return _0x5923f5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa4ac('0x0'));var zipdir=require(_0xa4ac('0x1'));var jsonpatch=require(_0xa4ac('0x2'));var rp=require(_0xa4ac('0x3'));var moment=require(_0xa4ac('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa4ac('0x5'));var util=require(_0xa4ac('0x6'));var path=require(_0xa4ac('0x7'));var sox=require(_0xa4ac('0x8'));var csv=require('to-csv');var ejs=require(_0xa4ac('0x9'));var fs=require('fs');var fs_extra=require(_0xa4ac('0xa'));var _=require(_0xa4ac('0xb'));var squel=require(_0xa4ac('0xc'));var crypto=require(_0xa4ac('0xd'));var jsforce=require(_0xa4ac('0xe'));var deskjs=require(_0xa4ac('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa4ac('0x10'));var Papa=require(_0xa4ac('0x11'));var extract=require(_0xa4ac('0x12'));var rimraf=require(_0xa4ac('0x0'));var archiver=require(_0xa4ac('0x13'));var Redis=require(_0xa4ac('0x14'));var authService=require(_0xa4ac('0x15'));var qs=require(_0xa4ac('0x16'));var as=require(_0xa4ac('0x17'));var hardwareService=require(_0xa4ac('0x18'));var logger=require(_0xa4ac('0x19'))(_0xa4ac('0x1a'));var utils=require(_0xa4ac('0x1b'));var config=require(_0xa4ac('0x1c'));var licenseUtil=require('../../config/license/util');var db=require(_0xa4ac('0x1d'))['db'];config[_0xa4ac('0x1e')]=_['defaults'](config[_0xa4ac('0x1e')],{'host':_0xa4ac('0x1f'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa4ac('0x1e')]));require(_0xa4ac('0x20'))['register'](socket);function respondWithStatusCode(_0x2efcd5,_0x95b0f7){_0x95b0f7=_0x95b0f7||0xcc;return function(_0x542d93){if(_0x542d93){return _0x2efcd5[_0xa4ac('0x21')](_0x95b0f7);}return _0x2efcd5[_0xa4ac('0x22')](_0x95b0f7)[_0xa4ac('0x23')]();};}function respondWithResult(_0x5b76a6,_0x5be8cd){_0x5be8cd=_0x5be8cd||0xc8;return function(_0x30f4fe){if(_0x30f4fe){return _0x5b76a6['status'](_0x5be8cd)[_0xa4ac('0x24')](_0x30f4fe);}};}function respondWithFilteredResult(_0x54878f,_0x5792dc){return function(_0x38f08e){if(_0x38f08e){var _0x4d3ad5=typeof _0x5792dc['offset']===_0xa4ac('0x25')&&typeof _0x5792dc[_0xa4ac('0x26')]===_0xa4ac('0x25');var _0x10c35b=_0x38f08e[_0xa4ac('0x27')];var _0x361b9c=_0x4d3ad5?0x0:_0x5792dc['offset'];var _0x2cf9c0=_0x4d3ad5?_0x38f08e[_0xa4ac('0x27')]:_0x5792dc['offset']+_0x5792dc['limit'];var _0x4a3306;if(_0x2cf9c0>=_0x10c35b){_0x2cf9c0=_0x10c35b;_0x4a3306=0xc8;}else{_0x4a3306=0xce;}_0x54878f[_0xa4ac('0x22')](_0x4a3306);return _0x54878f[_0xa4ac('0x28')](_0xa4ac('0x29'),_0x361b9c+'-'+_0x2cf9c0+'/'+_0x10c35b)[_0xa4ac('0x24')](_0x38f08e);}return null;};}function patchUpdates(_0x4def5d){return function(_0x17ceec){try{jsonpatch[_0xa4ac('0x2a')](_0x17ceec,_0x4def5d,!![]);}catch(_0x2c0052){return BPromise[_0xa4ac('0x2b')](_0x2c0052);}return _0x17ceec[_0xa4ac('0x2c')]();};}function saveUpdates(_0x3f99cf,_0x13832c){return function(_0x16e8c3){if(_0x16e8c3){return _0x16e8c3[_0xa4ac('0x2d')](_0x3f99cf)[_0xa4ac('0x2e')](function(_0x12366d){return _0x12366d;});}return null;};}function removeEntity(_0x548025,_0x1249e3){return function(_0x58f1a4){if(_0x58f1a4){return _0x58f1a4[_0xa4ac('0x2f')]()[_0xa4ac('0x2e')](function(){var _0x4a9ed4=_0x58f1a4[_0xa4ac('0x30')]({'plain':!![]});var _0x2b3fa7='Plugins';return db[_0xa4ac('0x31')][_0xa4ac('0x2f')]({'where':{'type':_0x2b3fa7,'resourceId':_0x4a9ed4['id']}})[_0xa4ac('0x2e')](function(){return _0x58f1a4;});})[_0xa4ac('0x2e')](function(){_0x548025['status'](0xcc)[_0xa4ac('0x23')]();});}};}function handleEntityNotFound(_0x5afc06,_0x5d8441){return function(_0x3930e5){if(!_0x3930e5){_0x5afc06['sendStatus'](0x194);}return _0x3930e5;};}function handleError(_0x35ae23,_0xec7269){_0xec7269=_0xec7269||0x1f4;return function(_0x340250){logger[_0xa4ac('0x32')](_0x340250[_0xa4ac('0x33')]);if(_0x340250['name']){delete _0x340250[_0xa4ac('0x34')];}_0x35ae23['status'](_0xec7269)[_0xa4ac('0x35')](_0x340250);};}exports['index']=function(_0x51ef6e,_0x273681){var _0x112cfa={},_0x2a8f66={},_0x5efbab={'count':0x0,'rows':[]};var _0x3bd5e0=_[_0xa4ac('0x36')](db[_0xa4ac('0x37')]['rawAttributes'],function(_0x1775ea){return{'name':_0x1775ea[_0xa4ac('0x38')],'type':_0x1775ea[_0xa4ac('0x39')][_0xa4ac('0x3a')]};});_0x2a8f66[_0xa4ac('0x3b')]=_['map'](_0x3bd5e0,_0xa4ac('0x34'));_0x2a8f66[_0xa4ac('0x3c')]=_[_0xa4ac('0x3d')](_0x51ef6e[_0xa4ac('0x3c')]);_0x2a8f66[_0xa4ac('0x3e')]=_[_0xa4ac('0x3f')](_0x2a8f66[_0xa4ac('0x3b')],_0x2a8f66[_0xa4ac('0x3c')]);_0x112cfa[_0xa4ac('0x40')]=_[_0xa4ac('0x3f')](_0x2a8f66[_0xa4ac('0x3b')],qs[_0xa4ac('0x41')](_0x51ef6e[_0xa4ac('0x3c')][_0xa4ac('0x41')]));_0x112cfa['attributes']=_0x112cfa[_0xa4ac('0x40')][_0xa4ac('0x42')]?_0x112cfa[_0xa4ac('0x40')]:_0x2a8f66['model'];if(!_0x51ef6e[_0xa4ac('0x3c')][_0xa4ac('0x43')](_0xa4ac('0x44'))){_0x112cfa[_0xa4ac('0x26')]=qs[_0xa4ac('0x26')](_0x51ef6e[_0xa4ac('0x3c')][_0xa4ac('0x26')]);_0x112cfa[_0xa4ac('0x45')]=qs[_0xa4ac('0x45')](_0x51ef6e[_0xa4ac('0x3c')]['offset']);}_0x112cfa[_0xa4ac('0x46')]=qs[_0xa4ac('0x47')](_0x51ef6e[_0xa4ac('0x3c')][_0xa4ac('0x47')]);_0x112cfa[_0xa4ac('0x48')]=qs[_0xa4ac('0x3e')](_[_0xa4ac('0x49')](_0x51ef6e[_0xa4ac('0x3c')],_0x2a8f66[_0xa4ac('0x3e')]),_0x3bd5e0);if(_0x51ef6e[_0xa4ac('0x3c')]['filter']){_0x112cfa[_0xa4ac('0x48')]=_[_0xa4ac('0x4a')](_0x112cfa[_0xa4ac('0x48')],{'$or':_['map'](_0x3bd5e0,function(_0x3ec937){if(_0x3ec937[_0xa4ac('0x39')]!=='VIRTUAL'){var _0x135381={};_0x135381[_0x3ec937[_0xa4ac('0x34')]]={'$like':'%'+_0x51ef6e[_0xa4ac('0x3c')]['filter']+'%'};return _0x135381;}})});}_0x112cfa=_['merge']({},_0x112cfa,_0x51ef6e[_0xa4ac('0x4b')]);var _0x2058d0={'where':_0x112cfa[_0xa4ac('0x48')]};return db[_0xa4ac('0x37')]['count'](_0x2058d0)[_0xa4ac('0x2e')](function(_0x28599a){_0x5efbab['count']=_0x28599a;if(_0x51ef6e[_0xa4ac('0x3c')]['includeAll']){_0x112cfa[_0xa4ac('0x4c')]=[{'all':!![]}];}return db[_0xa4ac('0x37')]['findAll'](_0x112cfa);})[_0xa4ac('0x2e')](function(_0x465ab2){_0x5efbab['rows']=_0x465ab2;return _0x5efbab;})[_0xa4ac('0x2e')](respondWithFilteredResult(_0x273681,_0x112cfa))[_0xa4ac('0x4d')](handleError(_0x273681,null));};exports[_0xa4ac('0x4e')]=function(_0x39eb98,_0x2d9bfb){var _0x4f745b={'raw':!![],'where':{'id':_0x39eb98['params']['id']}},_0x28a500={};_0x28a500[_0xa4ac('0x3b')]=_[_0xa4ac('0x3d')](db[_0xa4ac('0x37')]['rawAttributes']);_0x28a500['query']=_['keys'](_0x39eb98[_0xa4ac('0x3c')]);_0x28a500[_0xa4ac('0x3e')]=_[_0xa4ac('0x3f')](_0x28a500[_0xa4ac('0x3b')],_0x28a500[_0xa4ac('0x3c')]);_0x4f745b[_0xa4ac('0x40')]=_['intersection'](_0x28a500[_0xa4ac('0x3b')],qs[_0xa4ac('0x41')](_0x39eb98['query'][_0xa4ac('0x41')]));_0x4f745b[_0xa4ac('0x40')]=_0x4f745b[_0xa4ac('0x40')][_0xa4ac('0x42')]?_0x4f745b[_0xa4ac('0x40')]:_0x28a500['model'];if(_0x39eb98[_0xa4ac('0x3c')][_0xa4ac('0x4f')]){_0x4f745b['include']=[{'all':!![]}];}_0x4f745b=_[_0xa4ac('0x4a')]({},_0x4f745b,_0x39eb98[_0xa4ac('0x4b')]);return db[_0xa4ac('0x37')]['find'](_0x4f745b)[_0xa4ac('0x2e')](handleEntityNotFound(_0x2d9bfb,null))[_0xa4ac('0x2e')](respondWithResult(_0x2d9bfb,null))[_0xa4ac('0x4d')](handleError(_0x2d9bfb,null));};exports['download']=function(_0x41ee47,_0x2cbfcc,_0x45f55b){return db[_0xa4ac('0x37')][_0xa4ac('0x50')]({'where':{'id':_0x41ee47[_0xa4ac('0x51')]['id']},'attributes':[_0xa4ac('0x34'),_0xa4ac('0x7')],'raw':!![]})['then'](handleEntityNotFound(_0x2cbfcc,null))[_0xa4ac('0x2e')](function(_0x3d9274){if(_0x3d9274){var _0x52b554=path['join'](config[_0xa4ac('0x52')],_0xa4ac('0x53'),util[_0xa4ac('0x54')]('%s.zip',path[_0xa4ac('0x55')](_0x3d9274['path'])));var _0x447232=fs[_0xa4ac('0x56')](_0x52b554);var _0xcbe4e9=archiver(_0xa4ac('0x57'),{'zlib':{'level':0x9}});_0xcbe4e9['on'](_0xa4ac('0x58'),function(_0xf94305){if(_0xf94305[_0xa4ac('0x59')]===_0xa4ac('0x5a')){logger[_0xa4ac('0x32')](_0xf94305);}else{throw new db['Sequelize'][(_0xa4ac('0x5b'))](_0xa4ac('0x5c'));}});_0xcbe4e9['on'](_0xa4ac('0x32'),function(_0x122de9){throw new db['Sequelize'][(_0xa4ac('0x5b'))](_0xa4ac('0x5c'));});_0xcbe4e9[_0xa4ac('0x5d')](_0x447232);_0xcbe4e9[_0xa4ac('0x5e')](_0xa4ac('0x5f'),{'cwd':path[_0xa4ac('0x60')](config[_0xa4ac('0x52')],'server/files/plugins',path['dirname'](_0x3d9274[_0xa4ac('0x7')])),'ignore':[path[_0xa4ac('0x60')](path[_0xa4ac('0x55')](_0x3d9274[_0xa4ac('0x7')]),_0xa4ac('0x61')),path['join'](path[_0xa4ac('0x55')](_0x3d9274['path']),_0xa4ac('0x62'))],'nodir':!![]})[_0xa4ac('0x63')]();_0x447232['on'](_0xa4ac('0x64'),function(){if(!fs[_0xa4ac('0x65')](_0x52b554)){throw new db[(_0xa4ac('0x66'))][(_0xa4ac('0x5b'))](_0xa4ac('0x67'));}return _0x2cbfcc[_0xa4ac('0x68')](_0x52b554,util['format'](_0xa4ac('0x69'),path['basename'](_0x3d9274[_0xa4ac('0x7')])),function(_0x46bb10){if(_0x46bb10){throw new db[(_0xa4ac('0x66'))][(_0xa4ac('0x5b'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0xa4ac('0x6a')](_0x52b554);logger[_0xa4ac('0x6b')](_0xa4ac('0x6c'));logger[_0xa4ac('0x6b')](_0xa4ac('0x6d'));});});}return null;})[_0xa4ac('0x4d')](handleError(_0x2cbfcc,null));};exports['upload']=function(_0xaddaf1,_0x2c4c25,_0x169057){var _0x1b771d=path['basename'](_0xaddaf1[_0xa4ac('0x6e')][_0xa4ac('0x6f')],path[_0xa4ac('0x70')](_0xaddaf1['file']['filename']));var _0x10d711=path['join'](config[_0xa4ac('0x52')],_0xa4ac('0x53'),_0xaddaf1['file'][_0xa4ac('0x6f')]);var _0x3feb1b=path['join'](config[_0xa4ac('0x52')],_0xa4ac('0x53'),_0x1b771d);logger[_0xa4ac('0x6b')](_0xa4ac('0x71'),_0x10d711);logger[_0xa4ac('0x6b')](_0xa4ac('0x72'),_0x3feb1b);try{fs[_0xa4ac('0x73')](_0x10d711,parseInt(_0xa4ac('0x74'),0x8));extract(_0x10d711,{'dir':_0x3feb1b},function(_0x41000a){if(_0x41000a){logger[_0xa4ac('0x32')](_0x41000a);handleError(_0x41000a,!![]);};var _0x2d19bf=fs[_0xa4ac('0x75')](_0x3feb1b);if(_0x2d19bf[_0xa4ac('0x42')]>0x1){removeReferences(_0x10d711,_0x3feb1b);logger[_0xa4ac('0x32')](_0xa4ac('0x76'));return _0x169057(new Error(_0xa4ac('0x76')));}var _0xec777e=fs[_0xa4ac('0x77')](path[_0xa4ac('0x60')](_0x3feb1b,_0x2d19bf[0x0]));if(_0xec777e[_0xa4ac('0x78')]()){removeReferences(_0x10d711,_0x3feb1b);logger[_0xa4ac('0x32')]('Invalid\x20plugin\x20structure');return _0x169057(new Error(_0xa4ac('0x76')));}if(_0xec777e[_0xa4ac('0x79')]()){var _0x2f50de=fs[_0xa4ac('0x75')](path[_0xa4ac('0x60')](_0x3feb1b,_0x2d19bf[0x0]));if(_0x2f50de['length']===0x0){removeReferences(_0x10d711,_0x3feb1b);logger[_0xa4ac('0x32')](_0xa4ac('0x76'));return _0x169057(new Error('Invalid\x20plugin\x20structure'));}var _0x14657c=_0x2f50de[_0xa4ac('0x7a')](function(_0x2c2f86){return _0x2c2f86===_0xa4ac('0x7b');});if(!_0x14657c){return _0x169057(new Error(_0xa4ac('0x7c')));}var _0x280a19=fs[_0xa4ac('0x7d')](path['join'](_0x3feb1b,_0x2d19bf[0x0],'manifest.json'));var _0x1c9093=JSON[_0xa4ac('0x7e')](_0x280a19);if(_0xa4ac('0x25')==typeof _0x1c9093['name']){return _0x169057(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0xa4ac('0x25')==typeof _0x1c9093['type']){return _0x169057(new Error(_0xa4ac('0x7f')));}if(_0xa4ac('0x25')==typeof _0x1c9093[_0xa4ac('0x80')]){return _0x169057(new Error(_0xa4ac('0x81')));}if('undefined'==typeof _0x1c9093['parameters']){return _0x169057(new Error(_0xa4ac('0x82')));}if(_0x1c9093[_0xa4ac('0x39')]===_0xa4ac('0x83')){if(_0xa4ac('0x25')==typeof _0x1c9093['parameters'][_0xa4ac('0x84')]){return _0x169057(new Error(_0xa4ac('0x85')));}if(_0xa4ac('0x25')==typeof _0x1c9093[_0xa4ac('0x86')][_0xa4ac('0x84')][_0xa4ac('0x87')]&&_0xa4ac('0x25')==typeof _0x1c9093[_0xa4ac('0x86')][_0xa4ac('0x84')][_0xa4ac('0x88')]){return _0x169057(new Error(_0xa4ac('0x89')));}}else if(_0x1c9093['type']===_0xa4ac('0x8a')){if(_0xa4ac('0x25')==typeof _0x1c9093[_0xa4ac('0x86')][_0xa4ac('0x8b')]){return _0x169057(new Error(_0xa4ac('0x8c')));}if(_0xa4ac('0x25')==typeof _0x1c9093[_0xa4ac('0x86')][_0xa4ac('0x8d')]){return _0x169057(new Error(_0xa4ac('0x8e')));}}else{return _0x169057(new Error(_0xa4ac('0x8f')));}var _0x39cfd0=_0x1c9093[_0xa4ac('0x34')];var _0x26588c=_0x1c9093[_0xa4ac('0x90')];var _0x42b4e2=_0x1c9093['type'];var _0x3d7520=_0x1c9093['sidebar']?_0x1c9093['sidebar']:_0xa4ac('0x91');var _0x2803b9=_0x1c9093['icon']?_0x1c9093[_0xa4ac('0x92')]:_0xa4ac('0x93');var _0x6a2784='';var _0x11a024='';var _0x36c8c5='';var _0x26db49='';var _0x79879b=_0x1c9093['version'];if(_0x42b4e2===_0xa4ac('0x83')){if(_0xa4ac('0x25')!=typeof _0x1c9093[_0xa4ac('0x86')][_0xa4ac('0x84')][_0xa4ac('0x87')]){var _0x40a089=_0x1c9093[_0xa4ac('0x86')]['views'][_0xa4ac('0x87')];if(!/^(f|ht)tps?:\/\//i[_0xa4ac('0x94')](_0x40a089)){_0x6a2784=path[_0xa4ac('0x60')](_0xa4ac('0x95'),_0x1b771d,_0x2d19bf[0x0],_0x40a089);}else{_0x6a2784=_0x40a089;}}else{logger[_0xa4ac('0x6b')](_0xa4ac('0x96'));}if(_0xa4ac('0x25')!=typeof _0x1c9093[_0xa4ac('0x86')][_0xa4ac('0x84')][_0xa4ac('0x88')]){var _0x585bee=_0x1c9093[_0xa4ac('0x86')][_0xa4ac('0x84')][_0xa4ac('0x88')];if(!/^(f|ht)tps?:\/\//i[_0xa4ac('0x94')](_0x585bee)){_0x11a024=path[_0xa4ac('0x60')]('plugins',_0x1b771d,_0x2d19bf[0x0],_0x585bee);}else{_0x11a024=_0x585bee;}}else{logger[_0xa4ac('0x6b')](_0xa4ac('0x97'));}}else if(_0x42b4e2===_0xa4ac('0x8a')){_0x36c8c5=_0x1c9093['parameters'][_0xa4ac('0x8b')];_0x26db49=_0x1c9093[_0xa4ac('0x86')]['scriptPath'];if(_0xa4ac('0x25')!=typeof _0x1c9093[_0xa4ac('0x86')][_0xa4ac('0x84')]){if(_0xa4ac('0x25')!=typeof _0x1c9093[_0xa4ac('0x86')][_0xa4ac('0x84')]['admin']){var _0x40a089=_0x1c9093[_0xa4ac('0x86')][_0xa4ac('0x84')][_0xa4ac('0x87')];if(!/^(f|ht)tps?:\/\//i[_0xa4ac('0x94')](_0x40a089)){_0x6a2784=path[_0xa4ac('0x60')](_0xa4ac('0x95'),_0x1b771d,_0x2d19bf[0x0],_0x40a089);}else{_0x6a2784=_0x40a089;}}if(_0xa4ac('0x25')!=typeof _0x1c9093[_0xa4ac('0x86')]['views']['agent']){var _0x585bee=_0x1c9093[_0xa4ac('0x86')][_0xa4ac('0x84')][_0xa4ac('0x88')];if(!/^(f|ht)tps?:\/\//i[_0xa4ac('0x94')](_0x585bee)){_0x11a024=path['join'](_0xa4ac('0x95'),_0x1b771d,_0x2d19bf[0x0],_0x585bee);}else{_0x11a024=_0x585bee;}}}}var _0x5d6ddb={'name':_0x39cfd0,'description':_0x26588c,'path':path[_0xa4ac('0x60')](_0x1b771d,_0x2d19bf[0x0]),'type':_0x42b4e2,'sidebar':_0x3d7520,'icon':_0x2803b9,'adminUrl':_0x6a2784,'agentUrl':_0x11a024,'scriptName':_0x36c8c5,'scriptPath':_0x26db49,'version':_0x79879b};removeReferences(_0x10d711,null);return db[_0xa4ac('0x37')][_0xa4ac('0x98')](_0x5d6ddb)['then'](function(_0x40d39d){var _0x59bf26={'role':_0xaddaf1[_0xa4ac('0x99')][_0xa4ac('0x9a')],'userProfileId':_0xaddaf1[_0xa4ac('0x99')][_0xa4ac('0x9b')]};if(!_0x59bf26)throw new Error(_0xa4ac('0x9c'));if(_0x59bf26[_0xa4ac('0x9a')]===_0xa4ac('0x9d')){var _0x1708e7=_0x40d39d['get']({'plain':!![]});return db[_0xa4ac('0x9e')][_0xa4ac('0x50')]({'where':{'name':_0xa4ac('0x9f'),'userProfileId':_0x59bf26[_0xa4ac('0x9b')]},'raw':!![]})[_0xa4ac('0x2e')](function(_0x50429d){if(_0x50429d&&_0x50429d['autoAssociation']===0x0){return db[_0xa4ac('0x31')][_0xa4ac('0x98')]({'name':_0x1708e7[_0xa4ac('0x34')],'resourceId':_0x1708e7['id'],'type':_0x50429d[_0xa4ac('0x34')],'sectionId':_0x50429d['id']},{})[_0xa4ac('0x2e')](function(){return _0x40d39d;});}else{return _0x40d39d;}})['catch'](function(_0x277187){logger[_0xa4ac('0x32')](_0xa4ac('0xa0'),_0x277187);throw _0x277187;});}return _0x40d39d;})[_0xa4ac('0x2e')](respondWithResult(_0x2c4c25,null))[_0xa4ac('0x4d')](handleError(_0x2c4c25,null));}});}catch(_0x5407bf){_0x2c4c25[_0xa4ac('0x22')](0x1f4)[_0xa4ac('0x35')](_0x5407bf);}};function removeReferences(_0x16f755,_0x36b3f8){try{if(_0x16f755){fs['unlinkSync'](_0x16f755);logger[_0xa4ac('0x6b')](_0xa4ac('0xa1'));}if(_0x36b3f8){rimraf(_0x36b3f8,function(){});logger[_0xa4ac('0x6b')](_0xa4ac('0xa2'));}}catch(_0x2c5e4f){logger[_0xa4ac('0x32')](_0x2c5e4f);}}exports[_0xa4ac('0x2d')]=function(_0x53bc48,_0x387f7e,_0x2dbaec){return db['Plugin']['find']({'where':{'id':_0x53bc48[_0xa4ac('0x51')]['id']}})['then'](handleEntityNotFound(_0x387f7e,null))[_0xa4ac('0x2e')](saveUpdates(_0x53bc48[_0xa4ac('0x99')],null))[_0xa4ac('0x2e')](respondWithResult(_0x387f7e,null))[_0xa4ac('0x4d')](handleError(_0x387f7e,null));};exports[_0xa4ac('0xa3')]=function(_0x3d4348,_0x567808,_0x431106){return db['Plugin']['find']({'where':{'id':_0x3d4348[_0xa4ac('0x51')]['id']}})[_0xa4ac('0x2e')](function(_0x3fae51){if(_0x3fae51){return _0x3fae51['destroy']();}})[_0xa4ac('0x2e')](function(_0x181b5b){rimraf(path[_0xa4ac('0x60')](config['root'],_0xa4ac('0x53'),path['dirname'](_0x181b5b[_0xa4ac('0x7')])),function(){});return _0x181b5b;})[_0xa4ac('0x2e')](handleEntityNotFound(_0x567808,null))[_0xa4ac('0x2e')](respondWithStatusCode(_0x567808,null))[_0xa4ac('0x4d')](handleError(_0x567808,null));};exports[_0xa4ac('0xa4')]=function(_0x5e47e1,_0x3530d3,_0x25c9c8){return BPromise['resolve']()['then'](function(){if(!_0x5e47e1[_0xa4ac('0x3c')]['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x5e47e1[_0xa4ac('0x3c')]['port']){throw new Error(_0xa4ac('0xa5'));}var _0x2fd64b=_0x5e47e1['query'][_0xa4ac('0xa6')]?_0x5e47e1[_0xa4ac('0x3c')][_0xa4ac('0xa6')]+':'+_0x5e47e1[_0xa4ac('0x3c')][_0xa4ac('0xa7')]:_0xa4ac('0xa8')+_0x5e47e1[_0xa4ac('0x3c')][_0xa4ac('0xa7')];var _0x48483d=_0x5e47e1['query'][_0xa4ac('0x24')]?_0x5e47e1[_0xa4ac('0x3c')][_0xa4ac('0x24')]:!![];var _0x23a0b9=_0x5e47e1['query'][_0xa4ac('0xa9')]?_0x5e47e1[_0xa4ac('0x3c')][_0xa4ac('0xa9')]:null;var _0x5ea4ce={'method':_0x5e47e1[_0xa4ac('0xaa')],'uri':util[_0xa4ac('0x54')](_0xa4ac('0xab'),_0x2fd64b,_0x5e47e1['query'][_0xa4ac('0x7')]),'json':_0x48483d,'resolveWithFullResponse':!![],'encoding':_0x23a0b9,'qs':_0x5e47e1[_0xa4ac('0x3c')]};if(_0x5e47e1[_0xa4ac('0xac')]){_0x5ea4ce[_0xa4ac('0xac')]=_0x5e47e1[_0xa4ac('0xac')];if(_0x5ea4ce['headers'][_0xa4ac('0xad')]){delete _0x5ea4ce[_0xa4ac('0xac')][_0xa4ac('0xad')];}}if(_0x5ea4ce[_0xa4ac('0xac')]['content-type']){delete _0x5ea4ce['headers'][_0xa4ac('0xae')];}return rp(_0x5ea4ce);})['then'](function(_0x542d9f){if(_0x542d9f){_0x3530d3[_0xa4ac('0x28')](_0x542d9f[_0xa4ac('0xac')]);logger[_0xa4ac('0x6b')](_0x542d9f['body']);if(_[_0xa4ac('0xaf')](_0x5e47e1[_0xa4ac('0x3c')][_0xa4ac('0x7')],_0xa4ac('0x68'))&&_0x542d9f[_0xa4ac('0xb0')]==0x1f4){return _0x3530d3[_0xa4ac('0x21')](_0x542d9f['statusCode']);}else{return _0x3530d3['status'](_0x542d9f['statusCode'])['send'](_0x542d9f[_0xa4ac('0x99')]);}}else{return _0x3530d3[_0xa4ac('0x21')](0xc8);}})[_0xa4ac('0x4d')](handleError(_0x3530d3,null));};exports[_0xa4ac('0xb1')]=function(_0x374f10,_0x22a757,_0x52553b){return BPromise[_0xa4ac('0xb2')]()[_0xa4ac('0x2e')](function(){if(!_0x374f10[_0xa4ac('0x3c')][_0xa4ac('0x7')]){throw new Error(_0xa4ac('0xb3'));}if(!_0x374f10[_0xa4ac('0x3c')][_0xa4ac('0xa7')]){throw new Error(_0xa4ac('0xa5'));}var _0x32b77c=_0x374f10[_0xa4ac('0x3c')][_0xa4ac('0xa6')]?_0x374f10[_0xa4ac('0x3c')][_0xa4ac('0xa6')]+':'+_0x374f10[_0xa4ac('0x3c')]['port']:_0xa4ac('0xa8')+_0x374f10[_0xa4ac('0x3c')][_0xa4ac('0xa7')];var _0x39529d=_0x374f10[_0xa4ac('0x3c')][_0xa4ac('0x24')]?_0x374f10[_0xa4ac('0x3c')][_0xa4ac('0x24')]:!![];var _0x2848ab=_0x374f10['query']['encoding']?_0x374f10[_0xa4ac('0x3c')][_0xa4ac('0xa9')]:null;var _0x4900ac={'method':_0x374f10['method'],'uri':util[_0xa4ac('0x54')]('%s%s',_0x32b77c,_0x374f10['query'][_0xa4ac('0x7')]),'json':_0x39529d,'resolveWithFullResponse':!![],'encoding':_0x2848ab,'body':_0x374f10[_0xa4ac('0x99')]};if(_0x374f10[_0xa4ac('0xac')]){_0x4900ac[_0xa4ac('0xac')]=_0x374f10[_0xa4ac('0xac')];if(_0x4900ac[_0xa4ac('0xac')][_0xa4ac('0xad')]){delete _0x4900ac[_0xa4ac('0xac')][_0xa4ac('0xad')];}}if(_0x4900ac[_0xa4ac('0xac')]['content-type']){delete _0x4900ac['headers'][_0xa4ac('0xae')];}return rp(_0x4900ac);})['then'](function(_0x40392d){if(_0x40392d){_0x22a757[_0xa4ac('0x28')](_0x40392d[_0xa4ac('0xac')]);logger[_0xa4ac('0x6b')](_0x40392d[_0xa4ac('0x99')]);return _0x22a757['status'](_0x40392d['statusCode'])[_0xa4ac('0x35')](_0x40392d[_0xa4ac('0x99')]);}else{return _0x22a757[_0xa4ac('0x21')](0xc8);}})['catch'](handleError(_0x22a757,null));}; \ No newline at end of file +var _0xe465=['desk.js','to-csv','querystring','papaparse','extract-zip','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','./plugin.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','error','stack','name','send','map','Plugin','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','VIRTUAL','options','include','findAll','rows','catch','params','includeAll','find','path','join','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','**/*','root','dirname','finalize','existsSync','Plugin\x20not\x20found','download','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','filename','extname','file','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','isFile','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','test','Warning:\x20admin\x20view\x20not\x20specified','plugins','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Plugins','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','delete','webhookGet','\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','resolve','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x219279,_0x2628c3){var _0x3d571e=function(_0xe94be0){while(--_0xe94be0){_0x219279['push'](_0x219279['shift']());}};_0x3d571e(++_0x2628c3);}(_0xe465,0x150));var _0x5e46=function(_0x5d02e1,_0x3a4f44){_0x5d02e1=_0x5d02e1-0x0;var _0x4e5c90=_0xe465[_0x5d02e1];return _0x4e5c90;};'use strict';var emlformat=require(_0x5e46('0x0'));var rimraf=require(_0x5e46('0x1'));var zipdir=require(_0x5e46('0x2'));var jsonpatch=require(_0x5e46('0x3'));var rp=require(_0x5e46('0x4'));var moment=require(_0x5e46('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5e46('0x6'));var path=require('path');var sox=require(_0x5e46('0x7'));var csv=require('to-csv');var ejs=require(_0x5e46('0x8'));var fs=require('fs');var fs_extra=require(_0x5e46('0x9'));var _=require(_0x5e46('0xa'));var squel=require(_0x5e46('0xb'));var crypto=require(_0x5e46('0xc'));var jsforce=require(_0x5e46('0xd'));var deskjs=require(_0x5e46('0xe'));var toCsv=require(_0x5e46('0xf'));var querystring=require(_0x5e46('0x10'));var Papa=require(_0x5e46('0x11'));var extract=require(_0x5e46('0x12'));var rimraf=require(_0x5e46('0x1'));var archiver=require('archiver');var Redis=require(_0x5e46('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x5e46('0x14'));var as=require(_0x5e46('0x15'));var hardwareService=require(_0x5e46('0x16'));var logger=require(_0x5e46('0x17'))(_0x5e46('0x18'));var utils=require(_0x5e46('0x19'));var config=require(_0x5e46('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x5e46('0x1b'))['db'];config['redis']=_[_0x5e46('0x1c')](config[_0x5e46('0x1d')],{'host':_0x5e46('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5e46('0x1d')]));require(_0x5e46('0x1f'))[_0x5e46('0x20')](socket);function respondWithStatusCode(_0xb5822b,_0x54786f){_0x54786f=_0x54786f||0xcc;return function(_0x45584a){if(_0x45584a){return _0xb5822b[_0x5e46('0x21')](_0x54786f);}return _0xb5822b['status'](_0x54786f)[_0x5e46('0x22')]();};}function respondWithResult(_0x142c19,_0x3d12ef){_0x3d12ef=_0x3d12ef||0xc8;return function(_0xbe6f8a){if(_0xbe6f8a){return _0x142c19[_0x5e46('0x23')](_0x3d12ef)[_0x5e46('0x24')](_0xbe6f8a);}};}function respondWithFilteredResult(_0x3b78c2,_0x35439c){return function(_0x1961f4){if(_0x1961f4){var _0x553242=typeof _0x35439c[_0x5e46('0x25')]===_0x5e46('0x26')&&typeof _0x35439c[_0x5e46('0x27')]===_0x5e46('0x26');var _0x4fae27=_0x1961f4['count'];var _0x4df888=_0x553242?0x0:_0x35439c[_0x5e46('0x25')];var _0x2a5a2c=_0x553242?_0x1961f4[_0x5e46('0x28')]:_0x35439c['offset']+_0x35439c[_0x5e46('0x27')];var _0x1f9a78;if(_0x2a5a2c>=_0x4fae27){_0x2a5a2c=_0x4fae27;_0x1f9a78=0xc8;}else{_0x1f9a78=0xce;}_0x3b78c2['status'](_0x1f9a78);return _0x3b78c2[_0x5e46('0x29')](_0x5e46('0x2a'),_0x4df888+'-'+_0x2a5a2c+'/'+_0x4fae27)['json'](_0x1961f4);}return null;};}function patchUpdates(_0x5bbf2a){return function(_0x309c3e){try{jsonpatch[_0x5e46('0x2b')](_0x309c3e,_0x5bbf2a,!![]);}catch(_0x17fa66){return BPromise[_0x5e46('0x2c')](_0x17fa66);}return _0x309c3e[_0x5e46('0x2d')]();};}function saveUpdates(_0x2c3d50,_0x350a31){return function(_0x834a08){if(_0x834a08){return _0x834a08['update'](_0x2c3d50)[_0x5e46('0x2e')](function(_0x287585){return _0x287585;});}return null;};}function removeEntity(_0xff5af7,_0x32cc3a){return function(_0x4c99ac){if(_0x4c99ac){return _0x4c99ac[_0x5e46('0x2f')]()[_0x5e46('0x2e')](function(){var _0x3bb245=_0x4c99ac[_0x5e46('0x30')]({'plain':!![]});var _0x104371='Plugins';return db['UserProfileResource'][_0x5e46('0x2f')]({'where':{'type':_0x104371,'resourceId':_0x3bb245['id']}})[_0x5e46('0x2e')](function(){return _0x4c99ac;});})[_0x5e46('0x2e')](function(){_0xff5af7[_0x5e46('0x23')](0xcc)[_0x5e46('0x22')]();});}};}function handleEntityNotFound(_0x3df85c,_0x2c21d8){return function(_0x1b5e08){if(!_0x1b5e08){_0x3df85c[_0x5e46('0x21')](0x194);}return _0x1b5e08;};}function handleError(_0x592b87,_0x33022f){_0x33022f=_0x33022f||0x1f4;return function(_0x1c176e){logger[_0x5e46('0x31')](_0x1c176e[_0x5e46('0x32')]);if(_0x1c176e[_0x5e46('0x33')]){delete _0x1c176e[_0x5e46('0x33')];}_0x592b87[_0x5e46('0x23')](_0x33022f)[_0x5e46('0x34')](_0x1c176e);};}exports['index']=function(_0xd3f3b6,_0x1ea2d9){var _0x2cf0e8={},_0x3f77f9={},_0x228905={'count':0x0,'rows':[]};var _0x29b0fd=_[_0x5e46('0x35')](db[_0x5e46('0x36')][_0x5e46('0x37')],function(_0x870085){return{'name':_0x870085['fieldName'],'type':_0x870085['type'][_0x5e46('0x38')]};});_0x3f77f9[_0x5e46('0x39')]=_[_0x5e46('0x35')](_0x29b0fd,_0x5e46('0x33'));_0x3f77f9[_0x5e46('0x3a')]=_[_0x5e46('0x3b')](_0xd3f3b6[_0x5e46('0x3a')]);_0x3f77f9[_0x5e46('0x3c')]=_[_0x5e46('0x3d')](_0x3f77f9[_0x5e46('0x39')],_0x3f77f9['query']);_0x2cf0e8['attributes']=_['intersection'](_0x3f77f9[_0x5e46('0x39')],qs[_0x5e46('0x3e')](_0xd3f3b6[_0x5e46('0x3a')][_0x5e46('0x3e')]));_0x2cf0e8['attributes']=_0x2cf0e8[_0x5e46('0x3f')][_0x5e46('0x40')]?_0x2cf0e8[_0x5e46('0x3f')]:_0x3f77f9[_0x5e46('0x39')];if(!_0xd3f3b6[_0x5e46('0x3a')][_0x5e46('0x41')](_0x5e46('0x42'))){_0x2cf0e8[_0x5e46('0x27')]=qs['limit'](_0xd3f3b6[_0x5e46('0x3a')][_0x5e46('0x27')]);_0x2cf0e8[_0x5e46('0x25')]=qs[_0x5e46('0x25')](_0xd3f3b6[_0x5e46('0x3a')][_0x5e46('0x25')]);}_0x2cf0e8[_0x5e46('0x43')]=qs[_0x5e46('0x44')](_0xd3f3b6[_0x5e46('0x3a')]['sort']);_0x2cf0e8['where']=qs[_0x5e46('0x3c')](_[_0x5e46('0x45')](_0xd3f3b6[_0x5e46('0x3a')],_0x3f77f9[_0x5e46('0x3c')]),_0x29b0fd);if(_0xd3f3b6[_0x5e46('0x3a')]['filter']){_0x2cf0e8[_0x5e46('0x46')]=_[_0x5e46('0x47')](_0x2cf0e8[_0x5e46('0x46')],{'$or':_['map'](_0x29b0fd,function(_0x14d8ec){if(_0x14d8ec[_0x5e46('0x48')]!==_0x5e46('0x49')){var _0x3f6d47={};_0x3f6d47[_0x14d8ec[_0x5e46('0x33')]]={'$like':'%'+_0xd3f3b6[_0x5e46('0x3a')]['filter']+'%'};return _0x3f6d47;}})});}_0x2cf0e8=_['merge']({},_0x2cf0e8,_0xd3f3b6[_0x5e46('0x4a')]);var _0x314dd9={'where':_0x2cf0e8[_0x5e46('0x46')]};return db[_0x5e46('0x36')][_0x5e46('0x28')](_0x314dd9)[_0x5e46('0x2e')](function(_0x26e296){_0x228905[_0x5e46('0x28')]=_0x26e296;if(_0xd3f3b6[_0x5e46('0x3a')]['includeAll']){_0x2cf0e8[_0x5e46('0x4b')]=[{'all':!![]}];}return db[_0x5e46('0x36')][_0x5e46('0x4c')](_0x2cf0e8);})[_0x5e46('0x2e')](function(_0x4b75f9){_0x228905[_0x5e46('0x4d')]=_0x4b75f9;return _0x228905;})[_0x5e46('0x2e')](respondWithFilteredResult(_0x1ea2d9,_0x2cf0e8))[_0x5e46('0x4e')](handleError(_0x1ea2d9,null));};exports['show']=function(_0x19cf84,_0x284a64){var _0x2cbd83={'raw':!![],'where':{'id':_0x19cf84[_0x5e46('0x4f')]['id']}},_0x50302a={};_0x50302a[_0x5e46('0x39')]=_[_0x5e46('0x3b')](db[_0x5e46('0x36')]['rawAttributes']);_0x50302a[_0x5e46('0x3a')]=_[_0x5e46('0x3b')](_0x19cf84[_0x5e46('0x3a')]);_0x50302a[_0x5e46('0x3c')]=_[_0x5e46('0x3d')](_0x50302a[_0x5e46('0x39')],_0x50302a[_0x5e46('0x3a')]);_0x2cbd83[_0x5e46('0x3f')]=_[_0x5e46('0x3d')](_0x50302a['model'],qs[_0x5e46('0x3e')](_0x19cf84[_0x5e46('0x3a')]['fields']));_0x2cbd83[_0x5e46('0x3f')]=_0x2cbd83[_0x5e46('0x3f')][_0x5e46('0x40')]?_0x2cbd83[_0x5e46('0x3f')]:_0x50302a[_0x5e46('0x39')];if(_0x19cf84[_0x5e46('0x3a')][_0x5e46('0x50')]){_0x2cbd83['include']=[{'all':!![]}];}_0x2cbd83=_['merge']({},_0x2cbd83,_0x19cf84[_0x5e46('0x4a')]);return db[_0x5e46('0x36')][_0x5e46('0x51')](_0x2cbd83)['then'](handleEntityNotFound(_0x284a64,null))[_0x5e46('0x2e')](respondWithResult(_0x284a64,null))[_0x5e46('0x4e')](handleError(_0x284a64,null));};exports['download']=function(_0x443b30,_0x552b13,_0x212965){return db[_0x5e46('0x36')]['find']({'where':{'id':_0x443b30[_0x5e46('0x4f')]['id']},'attributes':[_0x5e46('0x33'),_0x5e46('0x52')],'raw':!![]})[_0x5e46('0x2e')](handleEntityNotFound(_0x552b13,null))[_0x5e46('0x2e')](function(_0x164d9f){if(_0x164d9f){var _0x13a0aa=path[_0x5e46('0x53')](config['root'],_0x5e46('0x54'),util[_0x5e46('0x55')](_0x5e46('0x56'),path[_0x5e46('0x57')](_0x164d9f[_0x5e46('0x52')])));var _0x470733=fs[_0x5e46('0x58')](_0x13a0aa);var _0x4de906=archiver(_0x5e46('0x59'),{'zlib':{'level':0x9}});_0x4de906['on'](_0x5e46('0x5a'),function(_0x2b0e41){if(_0x2b0e41['code']==='ENOENT'){logger[_0x5e46('0x31')](_0x2b0e41);}else{throw new db[(_0x5e46('0x5b'))][(_0x5e46('0x5c'))](_0x5e46('0x5d'));}});_0x4de906['on'](_0x5e46('0x31'),function(_0x3b2f92){throw new db[(_0x5e46('0x5b'))][(_0x5e46('0x5c'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x4de906[_0x5e46('0x5e')](_0x470733);_0x4de906['glob'](_0x5e46('0x5f'),{'cwd':path['join'](config[_0x5e46('0x60')],_0x5e46('0x54'),path[_0x5e46('0x61')](_0x164d9f[_0x5e46('0x52')])),'ignore':[path[_0x5e46('0x53')](path['basename'](_0x164d9f[_0x5e46('0x52')]),'node_modules/**/*'),path[_0x5e46('0x53')](path[_0x5e46('0x57')](_0x164d9f[_0x5e46('0x52')]),'attachments/**/*')],'nodir':!![]})[_0x5e46('0x62')]();_0x470733['on']('close',function(){if(!fs[_0x5e46('0x63')](_0x13a0aa)){throw new db[(_0x5e46('0x5b'))][(_0x5e46('0x5c'))](_0x5e46('0x64'));}return _0x552b13[_0x5e46('0x65')](_0x13a0aa,util[_0x5e46('0x55')](_0x5e46('0x56'),path[_0x5e46('0x57')](_0x164d9f['path'])),function(_0x3d714c){if(_0x3d714c){throw new db[(_0x5e46('0x5b'))][(_0x5e46('0x5c'))](_0x5e46('0x66'));}fs[_0x5e46('0x67')](_0x13a0aa);logger[_0x5e46('0x68')](_0x5e46('0x69'));logger[_0x5e46('0x68')](_0x5e46('0x6a'));});});}return null;})['catch'](handleError(_0x552b13,null));};exports['upload']=function(_0x36e716,_0x3d18e0,_0x43ebb4){var _0x35c1d2=path[_0x5e46('0x57')](_0x36e716['file'][_0x5e46('0x6b')],path[_0x5e46('0x6c')](_0x36e716[_0x5e46('0x6d')][_0x5e46('0x6b')]));var _0x198646=path[_0x5e46('0x53')](config[_0x5e46('0x60')],'server/files/plugins',_0x36e716[_0x5e46('0x6d')]['filename']);var _0x1f3be7=path[_0x5e46('0x53')](config[_0x5e46('0x60')],'server/files/plugins',_0x35c1d2);logger[_0x5e46('0x68')](_0x5e46('0x6e'),_0x198646);logger[_0x5e46('0x68')](_0x5e46('0x6f'),_0x1f3be7);try{fs[_0x5e46('0x70')](_0x198646,parseInt(_0x5e46('0x71'),0x8));extract(_0x198646,{'dir':_0x1f3be7},function(_0x127b71){if(_0x127b71){logger['error'](_0x127b71);handleError(_0x127b71,!![]);};var _0x13d781=fs[_0x5e46('0x72')](_0x1f3be7);if(_0x13d781[_0x5e46('0x40')]>0x1){removeReferences(_0x198646,_0x1f3be7);logger['error'](_0x5e46('0x73'));return _0x43ebb4(new Error(_0x5e46('0x73')));}var _0x3275c0=fs['lstatSync'](path[_0x5e46('0x53')](_0x1f3be7,_0x13d781[0x0]));if(_0x3275c0[_0x5e46('0x74')]()){removeReferences(_0x198646,_0x1f3be7);logger[_0x5e46('0x31')]('Invalid\x20plugin\x20structure');return _0x43ebb4(new Error(_0x5e46('0x73')));}if(_0x3275c0['isDirectory']()){var _0x66d85c=fs[_0x5e46('0x72')](path['join'](_0x1f3be7,_0x13d781[0x0]));if(_0x66d85c[_0x5e46('0x40')]===0x0){removeReferences(_0x198646,_0x1f3be7);logger[_0x5e46('0x31')](_0x5e46('0x73'));return _0x43ebb4(new Error(_0x5e46('0x73')));}var _0x5cdf5e=_0x66d85c[_0x5e46('0x75')](function(_0x2f8987){return _0x2f8987===_0x5e46('0x76');});if(!_0x5cdf5e){return _0x43ebb4(new Error(_0x5e46('0x77')));}var _0x513c44=fs[_0x5e46('0x78')](path['join'](_0x1f3be7,_0x13d781[0x0],'manifest.json'));var _0x2d618c=JSON[_0x5e46('0x79')](_0x513c44);if('undefined'==typeof _0x2d618c[_0x5e46('0x33')]){return _0x43ebb4(new Error(_0x5e46('0x7a')));}if(_0x5e46('0x26')==typeof _0x2d618c['type']){return _0x43ebb4(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0x5e46('0x26')==typeof _0x2d618c[_0x5e46('0x7b')]){return _0x43ebb4(new Error(_0x5e46('0x7c')));}if(_0x5e46('0x26')==typeof _0x2d618c[_0x5e46('0x7d')]){return _0x43ebb4(new Error(_0x5e46('0x7e')));}if(_0x2d618c[_0x5e46('0x48')]===_0x5e46('0x7f')){if(_0x5e46('0x26')==typeof _0x2d618c[_0x5e46('0x7d')][_0x5e46('0x80')]){return _0x43ebb4(new Error(_0x5e46('0x81')));}if(_0x5e46('0x26')==typeof _0x2d618c['parameters'][_0x5e46('0x80')][_0x5e46('0x82')]&&'undefined'==typeof _0x2d618c[_0x5e46('0x7d')][_0x5e46('0x80')][_0x5e46('0x83')]){return _0x43ebb4(new Error(_0x5e46('0x84')));}}else if(_0x2d618c[_0x5e46('0x48')]===_0x5e46('0x85')){if(_0x5e46('0x26')==typeof _0x2d618c['parameters'][_0x5e46('0x86')]){return _0x43ebb4(new Error(_0x5e46('0x87')));}if(_0x5e46('0x26')==typeof _0x2d618c[_0x5e46('0x7d')][_0x5e46('0x88')]){return _0x43ebb4(new Error(_0x5e46('0x89')));}}else{return _0x43ebb4(new Error(_0x5e46('0x8a')));}var _0x37ccbd=_0x2d618c[_0x5e46('0x33')];var _0x2f0c68=_0x2d618c[_0x5e46('0x8b')];var _0x18fffa=_0x2d618c[_0x5e46('0x48')];var _0xf359fc=_0x2d618c[_0x5e46('0x8c')]?_0x2d618c[_0x5e46('0x8c')]:_0x5e46('0x8d');var _0x42a54a=_0x2d618c[_0x5e46('0x8e')]?_0x2d618c[_0x5e46('0x8e')]:_0x5e46('0x8f');var _0x315854='';var _0x3ddbe9='';var _0xb24de1='';var _0x592199='';var _0x51a4ab=_0x2d618c[_0x5e46('0x7b')];if(_0x18fffa===_0x5e46('0x7f')){if(_0x5e46('0x26')!=typeof _0x2d618c[_0x5e46('0x7d')][_0x5e46('0x80')][_0x5e46('0x82')]){var _0xd53b19=_0x2d618c[_0x5e46('0x7d')][_0x5e46('0x80')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x5e46('0x90')](_0xd53b19)){_0x315854=path[_0x5e46('0x53')]('plugins',_0x35c1d2,_0x13d781[0x0],_0xd53b19);}else{_0x315854=_0xd53b19;}}else{logger[_0x5e46('0x68')](_0x5e46('0x91'));}if(_0x5e46('0x26')!=typeof _0x2d618c['parameters']['views']['agent']){var _0x44cc5b=_0x2d618c['parameters'][_0x5e46('0x80')][_0x5e46('0x83')];if(!/^(f|ht)tps?:\/\//i['test'](_0x44cc5b)){_0x3ddbe9=path[_0x5e46('0x53')](_0x5e46('0x92'),_0x35c1d2,_0x13d781[0x0],_0x44cc5b);}else{_0x3ddbe9=_0x44cc5b;}}else{logger['info'](_0x5e46('0x93'));}}else if(_0x18fffa===_0x5e46('0x85')){_0xb24de1=_0x2d618c['parameters'][_0x5e46('0x86')];_0x592199=_0x2d618c['parameters']['scriptPath'];if(_0x5e46('0x26')!=typeof _0x2d618c[_0x5e46('0x7d')][_0x5e46('0x80')]){if('undefined'!=typeof _0x2d618c[_0x5e46('0x7d')][_0x5e46('0x80')]['admin']){var _0xd53b19=_0x2d618c[_0x5e46('0x7d')][_0x5e46('0x80')][_0x5e46('0x82')];if(!/^(f|ht)tps?:\/\//i['test'](_0xd53b19)){_0x315854=path[_0x5e46('0x53')]('plugins',_0x35c1d2,_0x13d781[0x0],_0xd53b19);}else{_0x315854=_0xd53b19;}}if(_0x5e46('0x26')!=typeof _0x2d618c[_0x5e46('0x7d')][_0x5e46('0x80')]['agent']){var _0x44cc5b=_0x2d618c['parameters'][_0x5e46('0x80')][_0x5e46('0x83')];if(!/^(f|ht)tps?:\/\//i[_0x5e46('0x90')](_0x44cc5b)){_0x3ddbe9=path[_0x5e46('0x53')](_0x5e46('0x92'),_0x35c1d2,_0x13d781[0x0],_0x44cc5b);}else{_0x3ddbe9=_0x44cc5b;}}}}var _0x1bf121={'name':_0x37ccbd,'description':_0x2f0c68,'path':path[_0x5e46('0x53')](_0x35c1d2,_0x13d781[0x0]),'type':_0x18fffa,'sidebar':_0xf359fc,'icon':_0x42a54a,'adminUrl':_0x315854,'agentUrl':_0x3ddbe9,'scriptName':_0xb24de1,'scriptPath':_0x592199,'version':_0x51a4ab};removeReferences(_0x198646,null);return db[_0x5e46('0x36')][_0x5e46('0x94')](_0x1bf121)[_0x5e46('0x2e')](function(_0x3a9c46){var _0xc48188={'role':_0x36e716[_0x5e46('0x95')][_0x5e46('0x96')],'userProfileId':_0x36e716[_0x5e46('0x95')][_0x5e46('0x97')]};if(!_0xc48188)throw new Error(_0x5e46('0x98'));if(_0xc48188['role']===_0x5e46('0x99')){var _0x2090e1=_0x3a9c46['get']({'plain':!![]});return db[_0x5e46('0x9a')][_0x5e46('0x51')]({'where':{'name':_0x5e46('0x9b'),'userProfileId':_0xc48188[_0x5e46('0x97')]},'raw':!![]})[_0x5e46('0x2e')](function(_0x138809){if(_0x138809&&_0x138809['autoAssociation']===0x0){return db[_0x5e46('0x9c')][_0x5e46('0x94')]({'name':_0x2090e1[_0x5e46('0x33')],'resourceId':_0x2090e1['id'],'type':_0x138809[_0x5e46('0x33')],'sectionId':_0x138809['id']},{})[_0x5e46('0x2e')](function(){return _0x3a9c46;});}else{return _0x3a9c46;}})[_0x5e46('0x4e')](function(_0x14ab19){logger[_0x5e46('0x31')](_0x5e46('0x9d'),_0x14ab19);throw _0x14ab19;});}return _0x3a9c46;})['then'](respondWithResult(_0x3d18e0,null))[_0x5e46('0x4e')](handleError(_0x3d18e0,null));}});}catch(_0x58f478){_0x3d18e0[_0x5e46('0x23')](0x1f4)['send'](_0x58f478);}};function removeReferences(_0xfc076,_0x59447a){try{if(_0xfc076){fs[_0x5e46('0x67')](_0xfc076);logger[_0x5e46('0x68')]('Zip\x20archive\x20removed');}if(_0x59447a){rimraf(_0x59447a,function(){});logger[_0x5e46('0x68')]('Extracted\x20folder\x20removed');}}catch(_0xb06f74){logger[_0x5e46('0x31')](_0xb06f74);}}exports[_0x5e46('0x9e')]=function(_0x447e61,_0x345705,_0x1bbd5c){return db[_0x5e46('0x36')][_0x5e46('0x51')]({'where':{'id':_0x447e61[_0x5e46('0x4f')]['id']}})[_0x5e46('0x2e')](handleEntityNotFound(_0x345705,null))[_0x5e46('0x2e')](saveUpdates(_0x447e61[_0x5e46('0x95')],null))['then'](respondWithResult(_0x345705,null))[_0x5e46('0x4e')](handleError(_0x345705,null));};exports[_0x5e46('0x9f')]=function(_0x3888f8,_0x16feec,_0x2d53e5){return db['Plugin'][_0x5e46('0x51')]({'where':{'id':_0x3888f8[_0x5e46('0x4f')]['id']}})[_0x5e46('0x2e')](function(_0x35bae7){if(_0x35bae7){return _0x35bae7['destroy']();}})[_0x5e46('0x2e')](function(_0xc37389){rimraf(path[_0x5e46('0x53')](config['root'],_0x5e46('0x54'),path[_0x5e46('0x61')](_0xc37389[_0x5e46('0x52')])),function(){});return _0xc37389;})[_0x5e46('0x2e')](handleEntityNotFound(_0x16feec,null))[_0x5e46('0x2e')](respondWithStatusCode(_0x16feec,null))['catch'](handleError(_0x16feec,null));};exports[_0x5e46('0xa0')]=function(_0x25b4d8,_0x10284f,_0x3f740d){return BPromise['resolve']()[_0x5e46('0x2e')](function(){if(!_0x25b4d8[_0x5e46('0x3a')]['path']){throw new Error(_0x5e46('0xa1'));}if(!_0x25b4d8['query'][_0x5e46('0xa2')]){throw new Error(_0x5e46('0xa3'));}var _0x337d13=_0x25b4d8[_0x5e46('0x3a')][_0x5e46('0xa4')]?_0x25b4d8['query'][_0x5e46('0xa4')]+':'+_0x25b4d8['query'][_0x5e46('0xa2')]:_0x5e46('0xa5')+_0x25b4d8['query'][_0x5e46('0xa2')];var _0x548a3f=_0x25b4d8[_0x5e46('0x3a')][_0x5e46('0x24')]?_0x25b4d8[_0x5e46('0x3a')]['json']:!![];var _0x3ea837=_0x25b4d8[_0x5e46('0x3a')][_0x5e46('0xa6')]?_0x25b4d8[_0x5e46('0x3a')][_0x5e46('0xa6')]:null;var _0x23048f={'method':_0x25b4d8[_0x5e46('0xa7')],'uri':util[_0x5e46('0x55')](_0x5e46('0xa8'),_0x337d13,_0x25b4d8[_0x5e46('0x3a')][_0x5e46('0x52')]),'json':_0x548a3f,'resolveWithFullResponse':!![],'encoding':_0x3ea837,'qs':_0x25b4d8['query']};if(_0x25b4d8[_0x5e46('0xa9')]){_0x23048f[_0x5e46('0xa9')]=_0x25b4d8[_0x5e46('0xa9')];if(_0x23048f[_0x5e46('0xa9')][_0x5e46('0xaa')]){delete _0x23048f['headers'][_0x5e46('0xaa')];}}if(_0x23048f['headers'][_0x5e46('0xab')]){delete _0x23048f[_0x5e46('0xa9')]['content-type'];}return rp(_0x23048f);})['then'](function(_0x9288bc){if(_0x9288bc){_0x10284f[_0x5e46('0x29')](_0x9288bc[_0x5e46('0xa9')]);logger[_0x5e46('0x68')](_0x9288bc[_0x5e46('0x95')]);if(_[_0x5e46('0xac')](_0x25b4d8['query'][_0x5e46('0x52')],_0x5e46('0x65'))&&_0x9288bc[_0x5e46('0xad')]==0x1f4){return _0x10284f[_0x5e46('0x21')](_0x9288bc[_0x5e46('0xad')]);}else{return _0x10284f[_0x5e46('0x23')](_0x9288bc[_0x5e46('0xad')])['send'](_0x9288bc['body']);}}else{return _0x10284f[_0x5e46('0x21')](0xc8);}})['catch'](handleError(_0x10284f,null));};exports['webhookPost']=function(_0x3a42d3,_0x557703,_0x552a79){return BPromise[_0x5e46('0xae')]()[_0x5e46('0x2e')](function(){if(!_0x3a42d3[_0x5e46('0x3a')][_0x5e46('0x52')]){throw new Error(_0x5e46('0xa1'));}if(!_0x3a42d3['query'][_0x5e46('0xa2')]){throw new Error(_0x5e46('0xa3'));}var _0x5415d2=_0x3a42d3[_0x5e46('0x3a')][_0x5e46('0xa4')]?_0x3a42d3['query'][_0x5e46('0xa4')]+':'+_0x3a42d3[_0x5e46('0x3a')][_0x5e46('0xa2')]:_0x5e46('0xa5')+_0x3a42d3[_0x5e46('0x3a')][_0x5e46('0xa2')];var _0x5cad8f=_0x3a42d3[_0x5e46('0x3a')][_0x5e46('0x24')]?_0x3a42d3[_0x5e46('0x3a')][_0x5e46('0x24')]:!![];var _0x46ed1e=_0x3a42d3[_0x5e46('0x3a')][_0x5e46('0xa6')]?_0x3a42d3['query'][_0x5e46('0xa6')]:null;var _0x167348={'method':_0x3a42d3[_0x5e46('0xa7')],'uri':util[_0x5e46('0x55')](_0x5e46('0xa8'),_0x5415d2,_0x3a42d3[_0x5e46('0x3a')][_0x5e46('0x52')]),'json':_0x5cad8f,'resolveWithFullResponse':!![],'encoding':_0x46ed1e,'body':_0x3a42d3[_0x5e46('0x95')]};if(_0x3a42d3[_0x5e46('0xa9')]){_0x167348[_0x5e46('0xa9')]=_0x3a42d3[_0x5e46('0xa9')];if(_0x167348['headers'][_0x5e46('0xaa')]){delete _0x167348[_0x5e46('0xa9')][_0x5e46('0xaa')];}}if(_0x167348['headers'][_0x5e46('0xab')]){delete _0x167348[_0x5e46('0xa9')]['content-type'];}return rp(_0x167348);})[_0x5e46('0x2e')](function(_0x3ccb4d){if(_0x3ccb4d){_0x557703[_0x5e46('0x29')](_0x3ccb4d[_0x5e46('0xa9')]);logger[_0x5e46('0x68')](_0x3ccb4d[_0x5e46('0x95')]);return _0x557703[_0x5e46('0x23')](_0x3ccb4d[_0x5e46('0xad')])[_0x5e46('0x34')](_0x3ccb4d[_0x5e46('0x95')]);}else{return _0x557703[_0x5e46('0x21')](0xc8);}})['catch'](handleError(_0x557703,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 5e11206..f033f29 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 _0x4e83=['setMaxListeners','save','update','remove','emit','hook','exports','events','Plugin'];(function(_0x5b14da,_0x287e59){var _0x5589b9=function(_0x3d3137){while(--_0x3d3137){_0x5b14da['push'](_0x5b14da['shift']());}};_0x5589b9(++_0x287e59);}(_0x4e83,0x1ae));var _0x34e8=function(_0x20d4e7,_0x5f29f7){_0x20d4e7=_0x20d4e7-0x0;var _0x125131=_0x4e83[_0x20d4e7];return _0x125131;};'use strict';var EventEmitter=require(_0x34e8('0x0'));var Plugin=require('../../mysqldb')['db'][_0x34e8('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x34e8('0x2')](0x0);var events={'afterCreate':_0x34e8('0x3'),'afterUpdate':_0x34e8('0x4'),'afterDestroy':_0x34e8('0x5')};function emitEvent(_0x58fe4b){return function(_0x5dc841,_0x506eb2,_0x51fc5b){PluginEvents[_0x34e8('0x6')](_0x58fe4b+':'+_0x5dc841['id'],_0x5dc841);PluginEvents[_0x34e8('0x6')](_0x58fe4b,_0x5dc841);_0x51fc5b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0x34e8('0x7')](e,emitEvent(event));}}module[_0x34e8('0x8')]=PluginEvents; \ No newline at end of file +var _0xfd87=['Plugin','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x44a5a9,_0x25d636){var _0x1bca68=function(_0x41990c){while(--_0x41990c){_0x44a5a9['push'](_0x44a5a9['shift']());}};_0x1bca68(++_0x25d636);}(_0xfd87,0x80));var _0x7fd8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd87[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x7fd8('0x0'));var Plugin=require(_0x7fd8('0x1'))['db'][_0x7fd8('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x7fd8('0x3')](0x0);var events={'afterCreate':_0x7fd8('0x4'),'afterUpdate':_0x7fd8('0x5'),'afterDestroy':_0x7fd8('0x6')};function emitEvent(_0x42b06c){return function(_0x4429f2,_0x43b442,_0x3bd037){PluginEvents['emit'](_0x42b06c+':'+_0x4429f2['id'],_0x4429f2);PluginEvents[_0x7fd8('0x7')](_0x42b06c,_0x4429f2);_0x3bd037(null);};}for(var e in events){if(events[_0x7fd8('0x8')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x7fd8('0x9')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 4541549..37b6dbb 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 _0xcbae=['../../config/logger','api','bluebird','request-promise','path','rimraf','./plugin.attributes','exports','define','Plugin','plugins','lodash','util'];(function(_0x1d75f7,_0x139d5e){var _0x307f9a=function(_0x400ae1){while(--_0x400ae1){_0x1d75f7['push'](_0x1d75f7['shift']());}};_0x307f9a(++_0x139d5e);}(_0xcbae,0x1c5));var _0xecba=function(_0x870788,_0x484e2f){_0x870788=_0x870788-0x0;var _0xb28e6c=_0xcbae[_0x870788];return _0xb28e6c;};'use strict';var _=require(_0xecba('0x0'));var util=require(_0xecba('0x1'));var logger=require(_0xecba('0x2'))(_0xecba('0x3'));var moment=require('moment');var BPromise=require(_0xecba('0x4'));var rp=require(_0xecba('0x5'));var fs=require('fs');var path=require(_0xecba('0x6'));var rimraf=require(_0xecba('0x7'));var config=require('../../config/environment');var attributes=require(_0xecba('0x8'));module[_0xecba('0x9')]=function(_0x55ca5d,_0x7a390){return _0x55ca5d[_0xecba('0xa')](_0xecba('0xb'),attributes,{'tableName':_0xecba('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x607b=['../../config/environment','Plugin','plugins','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x11716f,_0x902592){var _0x59661d=function(_0x3804d2){while(--_0x3804d2){_0x11716f['push'](_0x11716f['shift']());}};_0x59661d(++_0x902592);}(_0x607b,0x18f));var _0xb607=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x607b[_0x334841];return _0x5beb4b;};'use strict';var _=require(_0xb607('0x0'));var util=require('util');var logger=require(_0xb607('0x1'))(_0xb607('0x2'));var moment=require(_0xb607('0x3'));var BPromise=require(_0xb607('0x4'));var rp=require(_0xb607('0x5'));var fs=require('fs');var path=require(_0xb607('0x6'));var rimraf=require(_0xb607('0x7'));var config=require(_0xb607('0x8'));var attributes=require('./plugin.attributes');module['exports']=function(_0xc7225a,_0x509054){return _0xc7225a['define'](_0xb607('0x9'),attributes,{'tableName':_0xb607('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 14bc3a4..71c4b04 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 _0xe62e=['Plugin,\x20%s,\x20%s','message','result','CreatePlugin','Plugin','create','options','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2e986d,_0x4b6b63){var _0x351c79=function(_0xf178c7){while(--_0xf178c7){_0x2e986d['push'](_0x2e986d['shift']());}};_0x351c79(++_0x4b6b63);}(_0xe62e,0x1ac));var _0xee62=function(_0xca41dc,_0x22936e){_0xca41dc=_0xca41dc-0x0;var _0x3e125c=_0xe62e[_0xca41dc];return _0x3e125c;};'use strict';var _=require(_0xee62('0x0'));var util=require(_0xee62('0x1'));var moment=require(_0xee62('0x2'));var BPromise=require(_0xee62('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee62('0x4'));var db=require(_0xee62('0x5'))['db'];var utils=require(_0xee62('0x6'));var logger=require(_0xee62('0x7'))(_0xee62('0x8'));var config=require(_0xee62('0x9'));var jayson=require(_0xee62('0xa'));var client=jayson[_0xee62('0xb')][_0xee62('0xc')]({'port':0x232a});config[_0xee62('0xd')]=_['defaults'](config[_0xee62('0xd')],{'host':_0xee62('0xe'),'port':0x18eb});var socket=require(_0xee62('0xf'))(new Redis(config[_0xee62('0xd')]));require(_0xee62('0x10'))[_0xee62('0x11')](socket);function respondWithRpcPromise(_0x15be4d,_0x32336c,_0x220847){return new BPromise(function(_0x563e73,_0x5942e7){return client[_0xee62('0x12')](_0x15be4d,_0x220847)[_0xee62('0x13')](function(_0x42d56e){logger[_0xee62('0x14')]('Plugin,\x20%s,\x20%s',_0x32336c,_0xee62('0x15'));logger[_0xee62('0x16')](_0xee62('0x17'),_0x32336c,_0xee62('0x15'),JSON[_0xee62('0x18')](_0x42d56e));if(_0x42d56e[_0xee62('0x19')]){if(_0x42d56e[_0xee62('0x19')][_0xee62('0x1a')]===0x1f4){logger['error'](_0xee62('0x1b'),_0x32336c,_0x42d56e[_0xee62('0x19')][_0xee62('0x1c')]);return _0x5942e7(_0x42d56e['error']['message']);}logger['error'](_0xee62('0x1b'),_0x32336c,_0x42d56e['error']['message']);return _0x563e73(_0x42d56e['error'][_0xee62('0x1c')]);}else{logger[_0xee62('0x14')](_0xee62('0x1b'),_0x32336c,'request\x20sent');_0x563e73(_0x42d56e[_0xee62('0x1d')][_0xee62('0x1c')]);}})['catch'](function(_0xc83573){logger[_0xee62('0x19')](_0xee62('0x1b'),_0x32336c,_0xc83573);_0x5942e7(_0xc83573);});});}exports[_0xee62('0x1e')]=function(_0x485358){var _0x578f7f=this;return new Promise(function(_0x457f52,_0x41466b){return db[_0xee62('0x1f')][_0xee62('0x20')](_0x485358['body'],{'raw':_0x485358[_0xee62('0x21')]?_0x485358[_0xee62('0x21')]['raw']===undefined?!![]:![]:!![]})[_0xee62('0x13')](function(_0x2f657e){logger[_0xee62('0x14')](_0xee62('0x1e'),_0x485358);logger[_0xee62('0x16')](_0xee62('0x1e'),_0x485358,JSON[_0xee62('0x18')](_0x2f657e));_0x457f52(_0x2f657e);})[_0xee62('0x22')](function(_0xbe797c){logger[_0xee62('0x19')]('CreatePlugin',_0xbe797c['message'],_0x485358);_0x41466b(_0x578f7f[_0xee62('0x19')](0x1f4,_0xbe797c[_0xee62('0x1c')]));});});}; \ No newline at end of file +var _0xa2dd=['then','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./plugin.socket','Plugin,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreatePlugin','Plugin','create','body','options'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa2dd,0xea));var _0xda2d=function(_0x1053d4,_0x4c1846){_0x1053d4=_0x1053d4-0x0;var _0x1603cc=_0xa2dd[_0x1053d4];return _0x1603cc;};'use strict';var _=require(_0xda2d('0x0'));var util=require('util');var moment=require(_0xda2d('0x1'));var BPromise=require(_0xda2d('0x2'));var rs=require(_0xda2d('0x3'));var fs=require('fs');var Redis=require(_0xda2d('0x4'));var db=require(_0xda2d('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xda2d('0x6'));var config=require(_0xda2d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xda2d('0x8')][_0xda2d('0x9')]({'port':0x232a});config[_0xda2d('0xa')]=_['defaults'](config[_0xda2d('0xa')],{'host':_0xda2d('0xb'),'port':0x18eb});var socket=require(_0xda2d('0xc'))(new Redis(config['redis']));require(_0xda2d('0xd'))['register'](socket);function respondWithRpcPromise(_0xd6ca61,_0x1d29c4,_0x117951){return new BPromise(function(_0x28b966,_0x2c37c9){return client['request'](_0xd6ca61,_0x117951)['then'](function(_0x33bef0){logger['info'](_0xda2d('0xe'),_0x1d29c4,'request\x20sent');logger['debug']('Plugin,\x20%s,\x20%s,\x20%s',_0x1d29c4,_0xda2d('0xf'),JSON[_0xda2d('0x10')](_0x33bef0));if(_0x33bef0[_0xda2d('0x11')]){if(_0x33bef0['error'][_0xda2d('0x12')]===0x1f4){logger['error']('Plugin,\x20%s,\x20%s',_0x1d29c4,_0x33bef0[_0xda2d('0x11')]['message']);return _0x2c37c9(_0x33bef0[_0xda2d('0x11')][_0xda2d('0x13')]);}logger[_0xda2d('0x11')](_0xda2d('0xe'),_0x1d29c4,_0x33bef0[_0xda2d('0x11')]['message']);return _0x28b966(_0x33bef0[_0xda2d('0x11')][_0xda2d('0x13')]);}else{logger['info'](_0xda2d('0xe'),_0x1d29c4,_0xda2d('0xf'));_0x28b966(_0x33bef0[_0xda2d('0x14')][_0xda2d('0x13')]);}})[_0xda2d('0x15')](function(_0x457cdc){logger['error'](_0xda2d('0xe'),_0x1d29c4,_0x457cdc);_0x2c37c9(_0x457cdc);});});}exports[_0xda2d('0x16')]=function(_0x42c271){var _0x4ac57d=this;return new Promise(function(_0x4b6a11,_0x14b932){return db[_0xda2d('0x17')][_0xda2d('0x18')](_0x42c271[_0xda2d('0x19')],{'raw':_0x42c271[_0xda2d('0x1a')]?_0x42c271[_0xda2d('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xda2d('0x1b')](function(_0x58f7db){logger['info']('CreatePlugin',_0x42c271);logger[_0xda2d('0x1c')]('CreatePlugin',_0x42c271,JSON[_0xda2d('0x10')](_0x58f7db));_0x4b6a11(_0x58f7db);})['catch'](function(_0x4933b4){logger[_0xda2d('0x11')](_0xda2d('0x16'),_0x4933b4['message'],_0x42c271);_0x14b932(_0x4ac57d[_0xda2d('0x11')](0x1f4,_0x4933b4[_0xda2d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 0970d19..91ddffc 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 _0x8f5f=['save','emit','removeListener','register','./plugin.events'];(function(_0x332005,_0x24edf1){var _0x4393e1=function(_0x352f93){while(--_0x352f93){_0x332005['push'](_0x332005['shift']());}};_0x4393e1(++_0x24edf1);}(_0x8f5f,0xcc));var _0xf8f5=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x8f5f[_0x1928c9];return _0x51b5fb;};'use strict';var PluginEvents=require(_0xf8f5('0x0'));var events=[_0xf8f5('0x1'),'remove','update'];function createListener(_0x3ed03e,_0xcbcb47){return function(_0x297618){_0xcbcb47[_0xf8f5('0x2')](_0x3ed03e,_0x297618);};}function removeListener(_0x304add,_0x569d81){return function(){PluginEvents[_0xf8f5('0x3')](_0x304add,_0x569d81);};}exports[_0xf8f5('0x4')]=function(_0x491499){for(var _0x15f64b=0x0,_0x57f001=events['length'];_0x15f64b<_0x57f001;_0x15f64b++){var _0x1374c4=events[_0x15f64b];var _0x1239fc=createListener('plugin:'+_0x1374c4,_0x491499);PluginEvents['on'](_0x1374c4,_0x1239fc);}}; \ No newline at end of file +var _0x19f8=['register','plugin:','save','remove','update','emit','removeListener'];(function(_0x23c033,_0x22fdd7){var _0x149903=function(_0x232b32){while(--_0x232b32){_0x23c033['push'](_0x23c033['shift']());}};_0x149903(++_0x22fdd7);}(_0x19f8,0x6b));var _0x819f=function(_0x21a87d,_0x2469e1){_0x21a87d=_0x21a87d-0x0;var _0x549694=_0x19f8[_0x21a87d];return _0x549694;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0x819f('0x0'),_0x819f('0x1'),_0x819f('0x2')];function createListener(_0x42e8f1,_0x3167c9){return function(_0x26de76){_0x3167c9[_0x819f('0x3')](_0x42e8f1,_0x26de76);};}function removeListener(_0x511657,_0x5d9aad){return function(){PluginEvents[_0x819f('0x4')](_0x511657,_0x5d9aad);};}exports[_0x819f('0x5')]=function(_0x3d61d8){for(var _0x1f5d08=0x0,_0x1b55b7=events['length'];_0x1f5d08<_0x1b55b7;_0x1f5d08++){var _0x2619b6=events[_0x1f5d08];var _0x1c5fdc=createListener(_0x819f('0x6')+_0x2619b6,_0x3d61d8);PluginEvents['on'](_0x2619b6,_0x1c5fdc);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 0b82365..1f1a2e3 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(_0x43a14f,_0x1c7d05){var _0x1f96ef=function(_0x1e868a){while(--_0x1e868a){_0x43a14f['push'](_0x43a14f['shift']());}};_0x1f96ef(++_0x1c7d05);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'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(_0xaac782,_0x576e38){var _0x49d3a0=function(_0x22a3e2){while(--_0x22a3e2){_0xaac782['push'](_0xaac782['shift']());}};_0x49d3a0(++_0x576e38);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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 aa59d33..b78ec1b 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 _0xb469=['motion2','show','create','body','join','../../files/plugins','chdir','dirname','start','dump','catch','status','update','restart','hasOwnProperty','params','Unknown\x20status','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','path','child_process','exec','sendStatus','error','stack','name','send','info','index','list','then','reject','express'];(function(_0x23fc9d,_0x5ea901){var _0xa81513=function(_0x2653d6){while(--_0x2653d6){_0x23fc9d['push'](_0x23fc9d['shift']());}};_0xa81513(++_0x5ea901);}(_0xb469,0x13b));var _0x9b46=function(_0x1d9d64,_0x54f30c){_0x1d9d64=_0x1d9d64-0x0;var _0x516e87=_0xb469[_0x1d9d64];return _0x516e87;};'use strict';var _=require(_0x9b46('0x0'));var pm2=require(_0x9b46('0x1'));var logger=require(_0x9b46('0x2'))(_0x9b46('0x3'));var path=require(_0x9b46('0x4'));var exec=require(_0x9b46('0x5'))[_0x9b46('0x6')];var BPromise=require('bluebird');function handleEntityNotFound(_0x31f853,_0x45322f){return function(_0x538fc4){if(!_0x538fc4){_0x31f853[_0x9b46('0x7')](0x194);;}return _0x538fc4;};}function respondWithResult(_0x405d1c,_0x50b49e){_0x50b49e=_0x50b49e||0xc8;return function(_0x1b2dd3){if(_0x1b2dd3){return _0x405d1c['status'](_0x50b49e)['json'](_0x1b2dd3);}return null;};}function handleError(_0x34c0de,_0x545b6c){_0x545b6c=_0x545b6c||0x1f4;return function(_0x402595){logger[_0x9b46('0x8')](_0x402595[_0x9b46('0x9')]);if(_0x402595['name']){delete _0x402595[_0x9b46('0xa')];}_0x34c0de['status'](_0x545b6c)[_0x9b46('0xb')](_0x402595);};}function execChildProcess(){return new BPromise(function(_0x568d9a,_0x2c29a7){exec('npm\x20install',function(_0x672157,_0x233b6b,_0x563de4){logger[_0x9b46('0xc')](_0x233b6b);logger[_0x9b46('0xc')](_0x563de4);if(_0x672157){logger['error'](_0x672157);return _0x2c29a7(_0x672157);}return _0x568d9a(_0x233b6b);});});}exports[_0x9b46('0xd')]=function(_0x2cfb35,_0x3d9618){return pm2[_0x9b46('0xe')]()[_0x9b46('0xf')](function(_0x35c5c1){if(_0x35c5c1){var _0x2136bc=_[_0x9b46('0x10')](_0x35c5c1,function(_0x3f2b28){return _0x3f2b28[_0x9b46('0xa')]===_0x9b46('0x11')||_0x3f2b28[_0x9b46('0xa')]===_0x9b46('0x12');});return{'rows':_0x2136bc,'count':_0x2136bc['length']};}return null;})['then'](respondWithResult(_0x3d9618,null))['catch'](handleError(_0x3d9618,null));};exports[_0x9b46('0x13')]=function(_0x5a380c,_0x29fec9){return pm2['describe'](_0x5a380c['params']['id'])[_0x9b46('0xf')](respondWithResult(_0x29fec9,null))['then'](handleEntityNotFound(_0x29fec9,null))['catch'](handleError(_0x29fec9,null));};exports[_0x9b46('0x14')]=function(_0x3a15cc,_0x5a0d25){if(_0x3a15cc[_0x9b46('0x15')][_0x9b46('0xa')]&&_0x3a15cc['body']['script']){var _0xbec2ea=path[_0x9b46('0x16')](__dirname,_0x9b46('0x17'),_0x3a15cc['body']['script']);var _0x2b3440=process['cwd']();process[_0x9b46('0x18')](path[_0x9b46('0x19')](_0xbec2ea));return execChildProcess()['then'](function(_0xadff19){process['chdir'](_0x2b3440);return pm2[_0x9b46('0x1a')]({'name':_0x3a15cc[_0x9b46('0x15')]['name'],'script':_0xbec2ea});})[_0x9b46('0xf')](function(_0x31ca63){pm2[_0x9b46('0x1b')]();return _0x31ca63[0x0];})[_0x9b46('0xf')](respondWithResult(_0x5a0d25,0xc9))[_0x9b46('0x1c')](handleError(_0x5a0d25,null));}else{return _0x5a0d25[_0x9b46('0x1d')](0x1f4)[_0x9b46('0xb')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x9b46('0x1e')]=function(_0x3ac37e,_0x478105){if(_0x3ac37e[_0x9b46('0x15')]['id']){delete _0x3ac37e[_0x9b46('0x15')]['id'];}var _0x2a79a5={'online':_0x9b46('0x1f'),'stopped':'stop'};if(_0x2a79a5[_0x9b46('0x20')](_0x3ac37e[_0x9b46('0x15')][_0x9b46('0x1d')])){return pm2[_0x2a79a5[_0x3ac37e[_0x9b46('0x15')][_0x9b46('0x1d')]]](_0x3ac37e[_0x9b46('0x21')]['id'])[_0x9b46('0xf')](respondWithResult(_0x478105,0xc8))[_0x9b46('0x1c')](handleError(_0x478105,null));}else{return _0x478105[_0x9b46('0x1d')](0x1f4)[_0x9b46('0xb')]({'message':_0x9b46('0x22')});}};exports['destroy']=function(_0x1f722d,_0x27f326){if(_0x1f722d[_0x9b46('0x15')]['id']){delete _0x1f722d[_0x9b46('0x15')]['id'];}if(_0x1f722d[_0x9b46('0x21')]['id']){return pm2[_0x9b46('0x23')](_0x1f722d[_0x9b46('0x21')]['id'])[_0x9b46('0xf')](function(_0x3ab49a){pm2[_0x9b46('0x1b')]();return _0x3ab49a[0x0];})[_0x9b46('0xf')](respondWithResult(_0x27f326,null))['catch'](handleError(_0x27f326,null));}else{return _0x27f326[_0x9b46('0x1d')](0x1f4)['send']({'message':_0x9b46('0x24')});}}; \ No newline at end of file +var _0xfe57=['bluebird','sendStatus','status','json','error','stack','send','info','index','list','express','name','motion2','length','then','catch','describe','params','create','body','script','join','../../files/plugins','cwd','chdir','dirname','start','dump','Missing\x20name\x20and/or\x20path','update','restart','stop','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/pm2','path','child_process','exec'];(function(_0x5a8396,_0x3a2cdf){var _0x39fca8=function(_0x5b5670){while(--_0x5b5670){_0x5a8396['push'](_0x5a8396['shift']());}};_0x39fca8(++_0x3a2cdf);}(_0xfe57,0x195));var _0x7fe5=function(_0x240261,_0x4fe66c){_0x240261=_0x240261-0x0;var _0x45c332=_0xfe57[_0x240261];return _0x45c332;};'use strict';var _=require(_0x7fe5('0x0'));var pm2=require(_0x7fe5('0x1'));var logger=require('../../config/logger')('api');var path=require(_0x7fe5('0x2'));var exec=require(_0x7fe5('0x3'))[_0x7fe5('0x4')];var BPromise=require(_0x7fe5('0x5'));function handleEntityNotFound(_0x89ad5f,_0x1254d2){return function(_0x41f5f4){if(!_0x41f5f4){_0x89ad5f[_0x7fe5('0x6')](0x194);;}return _0x41f5f4;};}function respondWithResult(_0x22e850,_0x188cfb){_0x188cfb=_0x188cfb||0xc8;return function(_0xd6146b){if(_0xd6146b){return _0x22e850[_0x7fe5('0x7')](_0x188cfb)[_0x7fe5('0x8')](_0xd6146b);}return null;};}function handleError(_0x4ab081,_0x13b391){_0x13b391=_0x13b391||0x1f4;return function(_0x5ef757){logger[_0x7fe5('0x9')](_0x5ef757[_0x7fe5('0xa')]);if(_0x5ef757['name']){delete _0x5ef757['name'];}_0x4ab081[_0x7fe5('0x7')](_0x13b391)[_0x7fe5('0xb')](_0x5ef757);};}function execChildProcess(){return new BPromise(function(_0x4b92d3,_0x35913b){exec('npm\x20install',function(_0x48d10b,_0xdb5182,_0x84bb93){logger[_0x7fe5('0xc')](_0xdb5182);logger[_0x7fe5('0xc')](_0x84bb93);if(_0x48d10b){logger['error'](_0x48d10b);return _0x35913b(_0x48d10b);}return _0x4b92d3(_0xdb5182);});});}exports[_0x7fe5('0xd')]=function(_0x16bed9,_0x579fd3){return pm2[_0x7fe5('0xe')]()['then'](function(_0x1f84b5){if(_0x1f84b5){var _0x2d297b=_['reject'](_0x1f84b5,function(_0x1ce051){return _0x1ce051['name']===_0x7fe5('0xf')||_0x1ce051[_0x7fe5('0x10')]===_0x7fe5('0x11');});return{'rows':_0x2d297b,'count':_0x2d297b[_0x7fe5('0x12')]};}return null;})[_0x7fe5('0x13')](respondWithResult(_0x579fd3,null))[_0x7fe5('0x14')](handleError(_0x579fd3,null));};exports['show']=function(_0x166e23,_0x3c7dd3){return pm2[_0x7fe5('0x15')](_0x166e23[_0x7fe5('0x16')]['id'])[_0x7fe5('0x13')](respondWithResult(_0x3c7dd3,null))[_0x7fe5('0x13')](handleEntityNotFound(_0x3c7dd3,null))[_0x7fe5('0x14')](handleError(_0x3c7dd3,null));};exports[_0x7fe5('0x17')]=function(_0x478523,_0x3b98cd){if(_0x478523['body']['name']&&_0x478523[_0x7fe5('0x18')][_0x7fe5('0x19')]){var _0x2f6592=path[_0x7fe5('0x1a')](__dirname,_0x7fe5('0x1b'),_0x478523[_0x7fe5('0x18')][_0x7fe5('0x19')]);var _0xdd9df7=process[_0x7fe5('0x1c')]();process[_0x7fe5('0x1d')](path[_0x7fe5('0x1e')](_0x2f6592));return execChildProcess()[_0x7fe5('0x13')](function(_0x54ee98){process[_0x7fe5('0x1d')](_0xdd9df7);return pm2[_0x7fe5('0x1f')]({'name':_0x478523[_0x7fe5('0x18')]['name'],'script':_0x2f6592});})[_0x7fe5('0x13')](function(_0x48ee56){pm2[_0x7fe5('0x20')]();return _0x48ee56[0x0];})['then'](respondWithResult(_0x3b98cd,0xc9))[_0x7fe5('0x14')](handleError(_0x3b98cd,null));}else{return _0x3b98cd[_0x7fe5('0x7')](0x1f4)[_0x7fe5('0xb')]({'message':_0x7fe5('0x21')});}};exports[_0x7fe5('0x22')]=function(_0x4393c3,_0x5bfe23){if(_0x4393c3['body']['id']){delete _0x4393c3[_0x7fe5('0x18')]['id'];}var _0x450759={'online':_0x7fe5('0x23'),'stopped':_0x7fe5('0x24')};if(_0x450759['hasOwnProperty'](_0x4393c3[_0x7fe5('0x18')]['status'])){return pm2[_0x450759[_0x4393c3[_0x7fe5('0x18')][_0x7fe5('0x7')]]](_0x4393c3[_0x7fe5('0x16')]['id'])[_0x7fe5('0x13')](respondWithResult(_0x5bfe23,0xc8))[_0x7fe5('0x14')](handleError(_0x5bfe23,null));}else{return _0x5bfe23[_0x7fe5('0x7')](0x1f4)['send']({'message':_0x7fe5('0x25')});}};exports[_0x7fe5('0x26')]=function(_0x5ec0b4,_0xfc1189){if(_0x5ec0b4[_0x7fe5('0x18')]['id']){delete _0x5ec0b4[_0x7fe5('0x18')]['id'];}if(_0x5ec0b4[_0x7fe5('0x16')]['id']){return pm2[_0x7fe5('0x27')](_0x5ec0b4['params']['id'])['then'](function(_0x13623e){pm2[_0x7fe5('0x20')]();return _0x13623e[0x0];})[_0x7fe5('0x13')](respondWithResult(_0xfc1189,null))[_0x7fe5('0x14')](handleError(_0xfc1189,null));}else{return _0xfc1189['status'](0x1f4)[_0x7fe5('0xb')]({'message':_0x7fe5('0x28')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 248b79b..f8ff28d 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 _0x7461=['isAuthenticated','getQueues','exports','multer','util','path','connect-timeout','express','../../config/environment','./realtime.controller','get','/queues'];(function(_0x12fdd8,_0x4e548e){var _0x3e6622=function(_0x58a0fc){while(--_0x58a0fc){_0x12fdd8['push'](_0x12fdd8['shift']());}};_0x3e6622(++_0x4e548e);}(_0x7461,0xdb));var _0x1746=function(_0x119d25,_0x588c8){_0x119d25=_0x119d25-0x0;var _0x39cf30=_0x7461[_0x119d25];return _0x39cf30;};'use strict';var multer=require(_0x1746('0x0'));var util=require(_0x1746('0x1'));var path=require(_0x1746('0x2'));var timeout=require(_0x1746('0x3'));var express=require(_0x1746('0x4'));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(_0x1746('0x5'));var controller=require(_0x1746('0x6'));router[_0x1746('0x7')](_0x1746('0x8'),auth[_0x1746('0x9')](),controller[_0x1746('0xa')]);module[_0x1746('0xb')]=router; \ No newline at end of file +var _0xede3=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./realtime.controller','get','/queues','isAuthenticated','getQueues','exports','util','connect-timeout','express','Router'];(function(_0x1d0d23,_0x43e210){var _0x2d295b=function(_0x214774){while(--_0x214774){_0x1d0d23['push'](_0x1d0d23['shift']());}};_0x2d295b(++_0x43e210);}(_0xede3,0xc0));var _0x3ede=function(_0x1596eb,_0x2274e0){_0x1596eb=_0x1596eb-0x0;var _0x449b5e=_0xede3[_0x1596eb];return _0x449b5e;};'use strict';var multer=require('multer');var util=require(_0x3ede('0x0'));var path=require('path');var timeout=require(_0x3ede('0x1'));var express=require(_0x3ede('0x2'));var router=express[_0x3ede('0x3')]();var fs_extra=require(_0x3ede('0x4'));var auth=require(_0x3ede('0x5'));var interaction=require(_0x3ede('0x6'));var config=require(_0x3ede('0x7'));var controller=require(_0x3ede('0x8'));router[_0x3ede('0x9')](_0x3ede('0xa'),auth[_0x3ede('0xb')](),controller[_0x3ede('0xc')]);module[_0x3ede('0xd')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index ced4c77..65d0478 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 _0x3ed7=['fax','voice','resolve','query','channel','toLowerCase','Invalid\x20channel','startCase','Queue','type','key','user','userProfileId','outbound','QueueCampaigns','Queues','filter','UserProfile','findAndCountAll','format','loggedIn','waiting','talking','paused','push','pTalking','originated','dialActive','dialMethod','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','map','get','available','agents','find','rows','pick','getAgents','online','getMembers','loggedInDb','Pause','findAll','User','UserId','all','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','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','jayson/promise','client','http','request','info','Realtime,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','status','end','json','limit','count','offset','Content-Range','apply','reject','save','then','destroy','sendStatus','stack','name','send','getQueues','chat','sms','openchannel'];(function(_0x2786ea,_0x16c3c3){var _0x5c38e5=function(_0x5a53c5){while(--_0x5a53c5){_0x2786ea['push'](_0x2786ea['shift']());}};_0x5c38e5(++_0x16c3c3);}(_0x3ed7,0x1a8));var _0x73ed=function(_0x16fc91,_0x511f25){_0x16fc91=_0x16fc91-0x0;var _0x2f9973=_0x3ed7[_0x16fc91];return _0x2f9973;};'use strict';var emlformat=require(_0x73ed('0x0'));var rimraf=require(_0x73ed('0x1'));var zipdir=require(_0x73ed('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x73ed('0x3'));var moment=require(_0x73ed('0x4'));var BPromise=require(_0x73ed('0x5'));var Mustache=require(_0x73ed('0x6'));var util=require(_0x73ed('0x7'));var path=require(_0x73ed('0x8'));var sox=require(_0x73ed('0x9'));var csv=require(_0x73ed('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x73ed('0xb'));var _=require(_0x73ed('0xc'));var squel=require(_0x73ed('0xd'));var crypto=require(_0x73ed('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x73ed('0xf'));var toCsv=require(_0x73ed('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x73ed('0x10'));var authService=require(_0x73ed('0x11'));var qs=require(_0x73ed('0x12'));var as=require(_0x73ed('0x13'));var hardwareService=require(_0x73ed('0x14'));var logger=require(_0x73ed('0x15'))(_0x73ed('0x16'));var utils=require(_0x73ed('0x17'));var config=require(_0x73ed('0x18'));var licenseUtil=require(_0x73ed('0x19'));var db=require(_0x73ed('0x1a'))['db'];var jayson=require(_0x73ed('0x1b'));var client=jayson[_0x73ed('0x1c')][_0x73ed('0x1d')]({'port':0x232a});var routingClient=jayson['client'][_0x73ed('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x109029,_0x134b91,_0x1bfca6,_0xcfe78b){return new BPromise(function(_0x283c8e,_0x1c1bfd){var _0x59e4bb=_0xcfe78b||client;return _0x59e4bb[_0x73ed('0x1e')](_0x109029,_0x1bfca6)['then'](function(_0x2c31a3){logger[_0x73ed('0x1f')](_0x73ed('0x20'),_0x134b91,_0x73ed('0x21'));logger[_0x73ed('0x22')]('Realtime,\x20%s,\x20%s,\x20%s',_0x134b91,'request\x20sent',JSON[_0x73ed('0x23')](_0x2c31a3));if(_0x2c31a3[_0x73ed('0x24')]){if(_0x2c31a3['error'][_0x73ed('0x25')]===0x1f4){logger[_0x73ed('0x24')](_0x73ed('0x20'),_0x134b91,_0x2c31a3['error'][_0x73ed('0x26')]);return _0x1c1bfd(_0x2c31a3[_0x73ed('0x24')][_0x73ed('0x26')]);}logger[_0x73ed('0x24')]('Realtime,\x20%s,\x20%s',_0x134b91,_0x2c31a3[_0x73ed('0x24')][_0x73ed('0x26')]);return _0x283c8e(_0x2c31a3[_0x73ed('0x24')][_0x73ed('0x26')]);}else{logger['info']('Realtime,\x20%s,\x20%s',_0x134b91,_0x73ed('0x21'));_0x283c8e(_0x2c31a3['result'][_0x73ed('0x26')]);}})[_0x73ed('0x27')](function(_0x22a7a5){logger['error'](_0x73ed('0x20'),_0x134b91,_0x22a7a5);_0x1c1bfd(_0x22a7a5);});});}function respondWithStatusCode(_0x20222e,_0x271267){_0x271267=_0x271267||0xcc;return function(_0x412615){if(_0x412615){return _0x20222e['sendStatus'](_0x271267);}return _0x20222e[_0x73ed('0x28')](_0x271267)[_0x73ed('0x29')]();};}function respondWithResult(_0x1572c2,_0xcffdc8){_0xcffdc8=_0xcffdc8||0xc8;return function(_0x2bb2e4){if(_0x2bb2e4){return _0x1572c2[_0x73ed('0x28')](_0xcffdc8)[_0x73ed('0x2a')](_0x2bb2e4);}};}function respondWithFilteredResult(_0x4a6d7d,_0x2980b5){return function(_0x89678a){if(_0x89678a){var _0x347e05=typeof _0x2980b5['offset']==='undefined'&&typeof _0x2980b5[_0x73ed('0x2b')]==='undefined';var _0x3f3969=_0x89678a[_0x73ed('0x2c')];var _0x257583=_0x347e05?0x0:_0x2980b5['offset'];var _0x48dda4=_0x347e05?_0x89678a['count']:_0x2980b5[_0x73ed('0x2d')]+_0x2980b5[_0x73ed('0x2b')];var _0x29b296;if(_0x48dda4>=_0x3f3969){_0x48dda4=_0x3f3969;_0x29b296=0xc8;}else{_0x29b296=0xce;}_0x4a6d7d[_0x73ed('0x28')](_0x29b296);return _0x4a6d7d['set'](_0x73ed('0x2e'),_0x257583+'-'+_0x48dda4+'/'+_0x3f3969)[_0x73ed('0x2a')](_0x89678a);}return null;};}function patchUpdates(_0x417828){return function(_0x3e2ec5){try{jsonpatch[_0x73ed('0x2f')](_0x3e2ec5,_0x417828,!![]);}catch(_0x2a1a33){return BPromise[_0x73ed('0x30')](_0x2a1a33);}return _0x3e2ec5[_0x73ed('0x31')]();};}function saveUpdates(_0x17b34b,_0x5b3b90){return function(_0x1ca049){if(_0x1ca049){return _0x1ca049['update'](_0x17b34b)[_0x73ed('0x32')](function(_0x1f35f3){return _0x1f35f3;});}return null;};}function removeEntity(_0x474d2f,_0x1bac9a){return function(_0x30cd82){if(_0x30cd82){return _0x30cd82[_0x73ed('0x33')]()[_0x73ed('0x32')](function(){_0x474d2f[_0x73ed('0x28')](0xcc)[_0x73ed('0x29')]();});}};}function handleEntityNotFound(_0x126a1f,_0x2e33d4){return function(_0x4c5bf9){if(!_0x4c5bf9){_0x126a1f[_0x73ed('0x34')](0x194);}return _0x4c5bf9;};}function handleError(_0x9e97cd,_0x476a74){_0x476a74=_0x476a74||0x1f4;return function(_0x3420ec){logger[_0x73ed('0x24')](_0x3420ec[_0x73ed('0x35')]);if(_0x3420ec[_0x73ed('0x36')]){delete _0x3420ec[_0x73ed('0x36')];}_0x9e97cd[_0x73ed('0x28')](_0x476a74)[_0x73ed('0x37')](_0x3420ec);};}exports[_0x73ed('0x38')]=function(_0x4a371d,_0x2dc023){var _0x48cfd8=['mail',_0x73ed('0x39'),_0x73ed('0x3a'),_0x73ed('0x3b'),_0x73ed('0x3c'),'whatsapp',_0x73ed('0x3d')];var _0x56e58b={'count':0x0,'rows':[]},_0x4a8aac={},_0xb8ab96;Promise[_0x73ed('0x3e')]()[_0x73ed('0x32')](function(){if(_0x4a371d[_0x73ed('0x3f')][_0x73ed('0x40')]){if(!_['includes'](_0x48cfd8,_0x4a371d[_0x73ed('0x3f')][_0x73ed('0x40')][_0x73ed('0x41')]()))throw new Error(_0x73ed('0x42'));_0xb8ab96=_0x4a371d[_0x73ed('0x3f')]['channel']['toLowerCase']();}var _0x3ddd83=_[_0x73ed('0x43')](_0xb8ab96)+_0x73ed('0x44');var _0x183056=_['map'](db[_0x3ddd83]['rawAttributes'],function(_0x54d9c6){return{'name':_0x54d9c6['fieldName'],'type':_0x54d9c6[_0x73ed('0x45')][_0x73ed('0x46')]};});_0x4a8aac=qs['getOptions'](_0x183056,_0x4a371d);if(_0x4a371d[_0x73ed('0x47')]['role']==='user'){var _0x2d4b94={'params':{'id':_0x4a371d[_0x73ed('0x47')][_0x73ed('0x48')]},'query':{'section':_0xb8ab96===_0x73ed('0x3d')&&_0x4a371d[_0x73ed('0x3f')][_0x73ed('0x45')]===_0x73ed('0x49')?_0x73ed('0x4a'):_['startCase'](_0xb8ab96)+_0x73ed('0x4b'),'type':_0x4a371d[_0x73ed('0x3f')][_0x73ed('0x45')],'nolimit':!![],'sort':_0x73ed('0x36'),'filter':_0x4a371d[_0x73ed('0x3f')][_0x73ed('0x4c')]}};return db[_0x73ed('0x4d')]['getResources'](_0x2d4b94);}return db[_0x3ddd83][_0x73ed('0x4e')](_0x4a8aac);})[_0x73ed('0x32')](function(_0x1e1c56){_0x56e58b[_0x73ed('0x2c')]=_0x1e1c56['count'];var _0x3ef3a8=_0xb8ab96===_0x73ed('0x3d')?client:routingClient;return _0x3ef3a8[_0x73ed('0x1e')](_['startCase'](_0xb8ab96)+_0x73ed('0x4b'),_0x4a371d)['then'](function(_0x4cd3a5){if(_0x4cd3a5['error'])throw new Error(util[_0x73ed('0x4f')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0xb8ab96));var _0x2ab4b7=_0x4cd3a5['result'];var _0x1a7474=[_0x73ed('0x50'),'available',_0x73ed('0x51'),_0x73ed('0x52'),_0x73ed('0x53')];if(_0xb8ab96===_0x73ed('0x3d')&&_0x4a371d[_0x73ed('0x3f')][_0x73ed('0x45')]==='outbound'){_0x1a7474[_0x73ed('0x54')](_0x73ed('0x55'),_0x73ed('0x56'),'message',_0x73ed('0x57'),_0x73ed('0x58'),'Trunk',_0x73ed('0x59'),_0x73ed('0x5a'),_0x73ed('0x5b'),_0x73ed('0x5c'),_0x73ed('0x5d'),_0x73ed('0x5e'),_0x73ed('0x5f'),_0x73ed('0x60'),_0x73ed('0x61'),_0x73ed('0x62'),_0x73ed('0x63'),_0x73ed('0x64'),_0x73ed('0x65'),_0x73ed('0x66'),_0x73ed('0x67'),_0x73ed('0x68'));}var _0x1e327d=_0x1e1c56['rows'][_0x73ed('0x69')](function(_0x2d58d2){var _0x1d6dbe=_0x2d58d2[_0x73ed('0x6a')]({'plain':!![]});_0x1d6dbe['paused']=0x0;_0x1d6dbe['loggedInDb']=0x0;_0x1d6dbe[_0x73ed('0x50')]=0x0;_0x1d6dbe[_0x73ed('0x6b')]=0x0;_0x1d6dbe[_0x73ed('0x53')]=0x0;_0x1d6dbe[_0x73ed('0x51')]=0x0;if(_0xb8ab96===_0x73ed('0x3d')){_0x1d6dbe[_0x73ed('0x52')]=0x0;if(_0x4a371d['query'][_0x73ed('0x45')]==='outbound'){_0x1d6dbe[_0x73ed('0x55')]=0x0;_0x1d6dbe[_0x73ed('0x56')]=0x0;}}_0x1d6dbe[_0x73ed('0x6c')]=[];var _0x21b6cd=_[_0x73ed('0x6d')](_0x2ab4b7[_0x73ed('0x6e')],['id',_0x1d6dbe['id']]);if(_0x21b6cd)_['merge'](_0x1d6dbe,_[_0x73ed('0x6f')](_0x21b6cd,_0x1a7474));if(_0xb8ab96==='voice'){return _0x2d58d2[_0x73ed('0x70')]({'attributes':['id','name',_0x73ed('0x71')],'joinTableAttributes':[],'raw':!![]})[_0x73ed('0x32')](function(_0x551bbc){return _0x2d58d2[_0x73ed('0x72')]({'raw':!![]})[_0x73ed('0x32')](function(_0xb8595d){for(var _0xbfc440=0x0;_0xbfc440<_0x551bbc['length'];_0xbfc440++){var _0x452174=_[_0x73ed('0x6d')](_0xb8595d,['UserId',_0x551bbc[_0xbfc440]['id']]);var _0x8e376={'id':_0x551bbc[_0xbfc440]['id'],'name':_0x551bbc[_0xbfc440]['name'],'online':Boolean(_0x551bbc[_0xbfc440]['online']),'paused':_0x452174?Boolean(_0x452174[_0x73ed('0x53')]):![]};if(_0x8e376[_0x73ed('0x71')])_0x1d6dbe[_0x73ed('0x73')]++;if(_0x8e376[_0x73ed('0x53')])_0x1d6dbe['paused']++;_0x1d6dbe[_0x73ed('0x6c')]['push'](_0x8e376);}return _0x1d6dbe;});});}else{var _0xa4e8ad='User'+_['startCase'](_0xb8ab96)+'Queue';var _0x3f590c=_[_0x73ed('0x43')](_0xb8ab96)+'QueueId';var _0x46c933=_0xb8ab96+_0x73ed('0x74');return db[_0xa4e8ad][_0x73ed('0x75')]({'where':{['userQueueKey']:_0x2d58d2['id']},'raw':!![]})[_0x73ed('0x32')](function(_0xcd4e16){return db[_0x73ed('0x76')]['findAll']({'attributes':['id',_0x73ed('0x36'),'online',_0x46c933],'where':{'id':_[_0x73ed('0x69')](_0xcd4e16,_0x73ed('0x77')),'role':'agent'},'raw':!![]});})[_0x73ed('0x32')](function(_0x3a76ed){for(var _0x529ca4=0x0;_0x529ca4<_0x3a76ed['length'];_0x529ca4++){var _0x8b00b7={'id':_0x3a76ed[_0x529ca4]['id'],'name':_0x3a76ed[_0x529ca4][_0x73ed('0x36')],'online':Boolean(_0x3a76ed[_0x529ca4]['online']),'paused':Boolean(_0x3a76ed[_0x529ca4][_0x46c933])};if(_0x8b00b7[_0x73ed('0x71')])_0x1d6dbe[_0x73ed('0x73')]++;if(_0x8b00b7[_0x73ed('0x53')])_0x1d6dbe[_0x73ed('0x53')]++;_0x1d6dbe[_0x73ed('0x6c')][_0x73ed('0x54')](_0x8b00b7);}return _0x1d6dbe;});}});return Promise[_0x73ed('0x78')](_0x1e327d);});})[_0x73ed('0x32')](function(_0x35dac5){_0x56e58b[_0x73ed('0x6e')]=_0x35dac5;return _0x56e58b;})[_0x73ed('0x32')](respondWithFilteredResult(_0x2dc023,_0x4a8aac))['catch'](handleError(_0x2dc023,null));}; \ No newline at end of file +var _0xa81e=['dialActive','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','rows','loggedInDb','find','pick','getAgents','online','length','UserId','push','User','QueueId','Pause','findAll','agent','all','catch','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','client','then','info','Realtime,\x20%s,\x20%s','request\x20sent','Realtime,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','getQueues','mail','chat','openchannel','whatsapp','voice','query','Invalid\x20channel','channel','toLowerCase','startCase','Queue','map','fieldName','key','getOptions','user','userProfileId','type','outbound','QueueCampaigns','filter','UserProfile','getResources','findAndCountAll','request','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','available','waiting','talking','paused','pTalking','originated'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0xa81e,0x174));var _0xea81=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xa81e[_0x160c73];return _0xd9302;};'use strict';var emlformat=require(_0xea81('0x0'));var rimraf=require(_0xea81('0x1'));var zipdir=require(_0xea81('0x2'));var jsonpatch=require(_0xea81('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xea81('0x4'));var Mustache=require(_0xea81('0x5'));var util=require(_0xea81('0x6'));var path=require(_0xea81('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xea81('0x8'));var squel=require(_0xea81('0x9'));var crypto=require(_0xea81('0xa'));var jsforce=require(_0xea81('0xb'));var deskjs=require(_0xea81('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xea81('0xd'));var authService=require(_0xea81('0xe'));var qs=require(_0xea81('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xea81('0x10'));var logger=require('../../config/logger')(_0xea81('0x11'));var utils=require('../../config/utils');var config=require(_0xea81('0x12'));var licenseUtil=require(_0xea81('0x13'));var db=require(_0xea81('0x14'))['db'];var jayson=require(_0xea81('0x15'));var client=jayson['client'][_0xea81('0x16')]({'port':0x232a});var routingClient=jayson[_0xea81('0x17')][_0xea81('0x16')]({'port':0x232c});function respondWithRpcPromise(_0x43b0a3,_0x1fcd86,_0x2d8447,_0x5c8b14){return new BPromise(function(_0x41d109,_0x5c3723){var _0x228d2d=_0x5c8b14||client;return _0x228d2d['request'](_0x43b0a3,_0x2d8447)[_0xea81('0x18')](function(_0x2878cb){logger[_0xea81('0x19')](_0xea81('0x1a'),_0x1fcd86,_0xea81('0x1b'));logger['debug'](_0xea81('0x1c'),_0x1fcd86,_0xea81('0x1b'),JSON[_0xea81('0x1d')](_0x2878cb));if(_0x2878cb[_0xea81('0x1e')]){if(_0x2878cb[_0xea81('0x1e')]['code']===0x1f4){logger[_0xea81('0x1e')](_0xea81('0x1a'),_0x1fcd86,_0x2878cb[_0xea81('0x1e')][_0xea81('0x1f')]);return _0x5c3723(_0x2878cb[_0xea81('0x1e')][_0xea81('0x1f')]);}logger[_0xea81('0x1e')](_0xea81('0x1a'),_0x1fcd86,_0x2878cb[_0xea81('0x1e')][_0xea81('0x1f')]);return _0x41d109(_0x2878cb[_0xea81('0x1e')][_0xea81('0x1f')]);}else{logger['info']('Realtime,\x20%s,\x20%s',_0x1fcd86,'request\x20sent');_0x41d109(_0x2878cb[_0xea81('0x20')][_0xea81('0x1f')]);}})['catch'](function(_0x859d4c){logger[_0xea81('0x1e')](_0xea81('0x1a'),_0x1fcd86,_0x859d4c);_0x5c3723(_0x859d4c);});});}function respondWithStatusCode(_0x36b4a4,_0x79e420){_0x79e420=_0x79e420||0xcc;return function(_0x56737c){if(_0x56737c){return _0x36b4a4[_0xea81('0x21')](_0x79e420);}return _0x36b4a4[_0xea81('0x22')](_0x79e420)[_0xea81('0x23')]();};}function respondWithResult(_0x480964,_0x5eba1b){_0x5eba1b=_0x5eba1b||0xc8;return function(_0x584324){if(_0x584324){return _0x480964[_0xea81('0x22')](_0x5eba1b)['json'](_0x584324);}};}function respondWithFilteredResult(_0x1a9dc0,_0x211034){return function(_0x4e13fe){if(_0x4e13fe){var _0x32f181=typeof _0x211034[_0xea81('0x24')]===_0xea81('0x25')&&typeof _0x211034[_0xea81('0x26')]===_0xea81('0x25');var _0x35ee83=_0x4e13fe[_0xea81('0x27')];var _0x54751c=_0x32f181?0x0:_0x211034[_0xea81('0x24')];var _0x57d0bb=_0x32f181?_0x4e13fe[_0xea81('0x27')]:_0x211034[_0xea81('0x24')]+_0x211034['limit'];var _0x408371;if(_0x57d0bb>=_0x35ee83){_0x57d0bb=_0x35ee83;_0x408371=0xc8;}else{_0x408371=0xce;}_0x1a9dc0[_0xea81('0x22')](_0x408371);return _0x1a9dc0[_0xea81('0x28')](_0xea81('0x29'),_0x54751c+'-'+_0x57d0bb+'/'+_0x35ee83)['json'](_0x4e13fe);}return null;};}function patchUpdates(_0x4dbd77){return function(_0x14703f){try{jsonpatch[_0xea81('0x2a')](_0x14703f,_0x4dbd77,!![]);}catch(_0x4b869c){return BPromise[_0xea81('0x2b')](_0x4b869c);}return _0x14703f[_0xea81('0x2c')]();};}function saveUpdates(_0x446ef9,_0x55249b){return function(_0x914cfa){if(_0x914cfa){return _0x914cfa[_0xea81('0x2d')](_0x446ef9)[_0xea81('0x18')](function(_0x23f9f2){return _0x23f9f2;});}return null;};}function removeEntity(_0x5b539f,_0x5b2dd1){return function(_0x134cfd){if(_0x134cfd){return _0x134cfd[_0xea81('0x2e')]()[_0xea81('0x18')](function(){_0x5b539f[_0xea81('0x22')](0xcc)[_0xea81('0x23')]();});}};}function handleEntityNotFound(_0x576bbd,_0x2ee8cc){return function(_0x2b97c0){if(!_0x2b97c0){_0x576bbd[_0xea81('0x21')](0x194);}return _0x2b97c0;};}function handleError(_0x38691f,_0x230433){_0x230433=_0x230433||0x1f4;return function(_0x50cbe1){logger[_0xea81('0x1e')](_0x50cbe1[_0xea81('0x2f')]);if(_0x50cbe1['name']){delete _0x50cbe1[_0xea81('0x30')];}_0x38691f['status'](_0x230433)['send'](_0x50cbe1);};}exports[_0xea81('0x31')]=function(_0x348a72,_0xdddb3a){var _0x8f9063=[_0xea81('0x32'),_0xea81('0x33'),'sms',_0xea81('0x34'),'fax',_0xea81('0x35'),_0xea81('0x36')];var _0x5a1c9f={'count':0x0,'rows':[]},_0x14c098={},_0x2b638c;Promise['resolve']()[_0xea81('0x18')](function(){if(_0x348a72['query']['channel']){if(!_['includes'](_0x8f9063,_0x348a72[_0xea81('0x37')]['channel']['toLowerCase']()))throw new Error(_0xea81('0x38'));_0x2b638c=_0x348a72[_0xea81('0x37')][_0xea81('0x39')][_0xea81('0x3a')]();}var _0x31f09a=_[_0xea81('0x3b')](_0x2b638c)+_0xea81('0x3c');var _0x274cfd=_[_0xea81('0x3d')](db[_0x31f09a]['rawAttributes'],function(_0x5d7dc3){return{'name':_0x5d7dc3[_0xea81('0x3e')],'type':_0x5d7dc3['type'][_0xea81('0x3f')]};});_0x14c098=qs[_0xea81('0x40')](_0x274cfd,_0x348a72);if(_0x348a72[_0xea81('0x41')]['role']===_0xea81('0x41')){var _0x528a58={'params':{'id':_0x348a72[_0xea81('0x41')][_0xea81('0x42')]},'query':{'section':_0x2b638c==='voice'&&_0x348a72[_0xea81('0x37')][_0xea81('0x43')]===_0xea81('0x44')?_0xea81('0x45'):_[_0xea81('0x3b')](_0x2b638c)+'Queues','type':_0x348a72[_0xea81('0x37')][_0xea81('0x43')],'nolimit':!![],'sort':'name','filter':_0x348a72[_0xea81('0x37')][_0xea81('0x46')]}};return db[_0xea81('0x47')][_0xea81('0x48')](_0x528a58);}return db[_0x31f09a][_0xea81('0x49')](_0x14c098);})[_0xea81('0x18')](function(_0x134271){_0x5a1c9f[_0xea81('0x27')]=_0x134271[_0xea81('0x27')];var _0x1a1bcc=_0x2b638c===_0xea81('0x36')?client:routingClient;return _0x1a1bcc[_0xea81('0x4a')](_['startCase'](_0x2b638c)+_0xea81('0x4b'),_0x348a72)[_0xea81('0x18')](function(_0x575317){if(_0x575317[_0xea81('0x1e')])throw new Error(util[_0xea81('0x4c')](_0xea81('0x4d'),_0x2b638c));var _0x10d0d7=_0x575317['result'];var _0x5da544=['loggedIn',_0xea81('0x4e'),_0xea81('0x4f'),_0xea81('0x50'),_0xea81('0x51')];if(_0x2b638c==='voice'&&_0x348a72['query']['type']===_0xea81('0x44')){_0x5da544['push'](_0xea81('0x52'),_0xea81('0x53'),_0xea81('0x1f'),_0xea81('0x54'),'dialMethod',_0xea81('0x55'),_0xea81('0x56'),_0xea81('0x57'),_0xea81('0x58'),_0xea81('0x59'),_0xea81('0x5a'),_0xea81('0x5b'),'dialPredictiveInterval',_0xea81('0x5c'),'dialPredictiveIntervalMinThreshold',_0xea81('0x5d'),'predictiveIntervalTotalCalls',_0xea81('0x5e'),_0xea81('0x5f'),_0xea81('0x60'),'predictiveIntervalAvgHoldtime',_0xea81('0x61'));}var _0x6a7823=_0x134271[_0xea81('0x62')][_0xea81('0x3d')](function(_0x2e7c84){var _0x35e217=_0x2e7c84['get']({'plain':!![]});_0x35e217['paused']=0x0;_0x35e217[_0xea81('0x63')]=0x0;_0x35e217['loggedIn']=0x0;_0x35e217['available']=0x0;_0x35e217[_0xea81('0x51')]=0x0;_0x35e217[_0xea81('0x4f')]=0x0;if(_0x2b638c===_0xea81('0x36')){_0x35e217['talking']=0x0;if(_0x348a72[_0xea81('0x37')][_0xea81('0x43')]===_0xea81('0x44')){_0x35e217[_0xea81('0x52')]=0x0;_0x35e217[_0xea81('0x53')]=0x0;}}_0x35e217['agents']=[];var _0x4c0054=_[_0xea81('0x64')](_0x10d0d7[_0xea81('0x62')],['id',_0x35e217['id']]);if(_0x4c0054)_['merge'](_0x35e217,_[_0xea81('0x65')](_0x4c0054,_0x5da544));if(_0x2b638c===_0xea81('0x36')){return _0x2e7c84[_0xea81('0x66')]({'attributes':['id',_0xea81('0x30'),_0xea81('0x67')],'joinTableAttributes':[],'raw':!![]})[_0xea81('0x18')](function(_0x44c549){return _0x2e7c84['getMembers']({'raw':!![]})[_0xea81('0x18')](function(_0x42e660){for(var _0x1e04c4=0x0;_0x1e04c4<_0x44c549[_0xea81('0x68')];_0x1e04c4++){var _0x347608=_[_0xea81('0x64')](_0x42e660,[_0xea81('0x69'),_0x44c549[_0x1e04c4]['id']]);var _0x14c210={'id':_0x44c549[_0x1e04c4]['id'],'name':_0x44c549[_0x1e04c4]['name'],'online':Boolean(_0x44c549[_0x1e04c4][_0xea81('0x67')]),'paused':_0x347608?Boolean(_0x347608[_0xea81('0x51')]):![]};if(_0x14c210[_0xea81('0x67')])_0x35e217[_0xea81('0x63')]++;if(_0x14c210[_0xea81('0x51')])_0x35e217[_0xea81('0x51')]++;_0x35e217['agents'][_0xea81('0x6a')](_0x14c210);}return _0x35e217;});});}else{var _0x1f5249=_0xea81('0x6b')+_[_0xea81('0x3b')](_0x2b638c)+'Queue';var _0x5b37da=_[_0xea81('0x3b')](_0x2b638c)+_0xea81('0x6c');var _0x444eb4=_0x2b638c+_0xea81('0x6d');return db[_0x1f5249][_0xea81('0x6e')]({'where':{['userQueueKey']:_0x2e7c84['id']},'raw':!![]})[_0xea81('0x18')](function(_0x4f1a3c){return db[_0xea81('0x6b')][_0xea81('0x6e')]({'attributes':['id','name',_0xea81('0x67'),_0x444eb4],'where':{'id':_[_0xea81('0x3d')](_0x4f1a3c,_0xea81('0x69')),'role':_0xea81('0x6f')},'raw':!![]});})['then'](function(_0x5afcc7){for(var _0x432545=0x0;_0x432545<_0x5afcc7[_0xea81('0x68')];_0x432545++){var _0x1c2a8a={'id':_0x5afcc7[_0x432545]['id'],'name':_0x5afcc7[_0x432545][_0xea81('0x30')],'online':Boolean(_0x5afcc7[_0x432545][_0xea81('0x67')]),'paused':Boolean(_0x5afcc7[_0x432545][_0x444eb4])};if(_0x1c2a8a[_0xea81('0x67')])_0x35e217[_0xea81('0x63')]++;if(_0x1c2a8a['paused'])_0x35e217[_0xea81('0x51')]++;_0x35e217['agents']['push'](_0x1c2a8a);}return _0x35e217;});}});return Promise[_0xea81('0x70')](_0x6a7823);});})[_0xea81('0x18')](function(_0x45739f){_0x5a1c9f[_0xea81('0x62')]=_0x45739f;return _0x5a1c9f;})[_0xea81('0x18')](respondWithFilteredResult(_0xdddb3a,_0x14c098))[_0xea81('0x71')](handleError(_0xdddb3a,null));}; \ No newline at end of file diff --git a/server/api/realtime/realtime.model.js b/server/api/realtime/realtime.model.js index 1a03441..c8294c2 100644 --- a/server/api/realtime/realtime.model.js +++ b/server/api/realtime/realtime.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc1cf=['path','rimraf','../../config/environment','exports','Realtime','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x2671e2,_0x34fc62){var _0x5e7be9=function(_0x4b0154){while(--_0x4b0154){_0x2671e2['push'](_0x2671e2['shift']());}};_0x5e7be9(++_0x34fc62);}(_0xc1cf,0x165));var _0xfc1c=function(_0x4b252d,_0x3c054d){_0x4b252d=_0x4b252d-0x0;var _0x3b62d1=_0xc1cf[_0x4b252d];return _0x3b62d1;};'use strict';var _=require(_0xfc1c('0x0'));var util=require(_0xfc1c('0x1'));var logger=require(_0xfc1c('0x2'))(_0xfc1c('0x3'));var moment=require(_0xfc1c('0x4'));var BPromise=require('bluebird');var rp=require(_0xfc1c('0x5'));var fs=require('fs');var path=require(_0xfc1c('0x6'));var rimraf=require(_0xfc1c('0x7'));var config=require(_0xfc1c('0x8'));;module[_0xfc1c('0x9')]=function(_0x13b9e2,_0x440483){return _0x13b9e2['define'](_0xfc1c('0xa'),[],{});}; \ No newline at end of file +var _0x54c7=['bluebird','rimraf','../../config/environment','lodash','util','api','moment'];(function(_0x28abf9,_0x2774b2){var _0x1acc64=function(_0x21ba64){while(--_0x21ba64){_0x28abf9['push'](_0x28abf9['shift']());}};_0x1acc64(++_0x2774b2);}(_0x54c7,0xb9));var _0x754c=function(_0x4fd489,_0x592354){_0x4fd489=_0x4fd489-0x0;var _0x924bb5=_0x54c7[_0x4fd489];return _0x924bb5;};'use strict';var _=require(_0x754c('0x0'));var util=require(_0x754c('0x1'));var logger=require('../../config/logger')(_0x754c('0x2'));var moment=require(_0x754c('0x3'));var BPromise=require(_0x754c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x754c('0x5'));var config=require(_0x754c('0x6'));;module['exports']=function(_0x49293a,_0x4f75f0){return _0x49293a['define']('Realtime',[],{});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 6da1db4..dc25354 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x433fc0,_0x3e3711){var _0x3956bb=function(_0x232b9d){while(--_0x232b9d){_0x433fc0['push'](_0x433fc0['shift']());}};_0x3956bb(++_0x3e3711);}(_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 +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x4b9eb6,_0x308fad){var _0x41fd3d=function(_0x561751){while(--_0x561751){_0x4b9eb6['push'](_0x4b9eb6['shift']());}};_0x41fd3d(++_0x308fad);}(_0xe706,0xa3));var _0x6e70=function(_0x38cbdf,_0x4eb95f){_0x38cbdf=_0x38cbdf-0x0;var _0x20ebce=_0xe706[_0x38cbdf];return _0x20ebce;};'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/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 1074b96..e024515 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 _0x644f=['exports','DATE','STRING','INTEGER','sequelize'];(function(_0xb6723c,_0x147da9){var _0x5d9aab=function(_0x3ebbf3){while(--_0x3ebbf3){_0xb6723c['push'](_0xb6723c['shift']());}};_0x5d9aab(++_0x147da9);}(_0x644f,0xc2));var _0xf644=function(_0x378b4,_0x5ca7fa){_0x378b4=_0x378b4-0x0;var _0x11d07b=_0x644f[_0x378b4];return _0x11d07b;};'use strict';var Sequelize=require(_0xf644('0x0'));module[_0xf644('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xf644('0x2')]},'uniqueid':{'type':Sequelize[_0xf644('0x3')]},'starttime':{'type':Sequelize[_0xf644('0x2')]},'responsetime':{'type':Sequelize[_0xf644('0x2')]},'ringtime':{'type':Sequelize[_0xf644('0x4')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xf644('0x3')]},'campaigntype':{'type':Sequelize[_0xf644('0x3')]},'membername':{'type':Sequelize[_0xf644('0x3')]}}; \ No newline at end of file +var _0xb0e5=['exports','INTEGER','STRING','DATE','sequelize'];(function(_0x325e8b,_0x4afa45){var _0x263cfd=function(_0x13e415){while(--_0x13e415){_0x325e8b['push'](_0x325e8b['shift']());}};_0x263cfd(++_0x4afa45);}(_0xb0e5,0x1ad));var _0x5b0e=function(_0x845a40,_0x466cd6){_0x845a40=_0x845a40-0x0;var _0x535e25=_0xb0e5[_0x845a40];return _0x535e25;};'use strict';var Sequelize=require(_0x5b0e('0x0'));module[_0x5b0e('0x1')]={'state':{'type':Sequelize[_0x5b0e('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x5b0e('0x3')]},'scheduledat':{'type':Sequelize[_0x5b0e('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x5b0e('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x5b0e('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x5b0e('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index b7a3337..b358ede 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 _0xf82e=['report_agent_preview','util','../../config/logger','api','moment','bluebird','request-promise','./reportAgentPreview.attributes','ReportAgentPreview'];(function(_0x44f208,_0x15a36b){var _0x42ce64=function(_0x3a2337){while(--_0x3a2337){_0x44f208['push'](_0x44f208['shift']());}};_0x42ce64(++_0x15a36b);}(_0xf82e,0xb5));var _0xef82=function(_0x35d7e3,_0x2489dc){_0x35d7e3=_0x35d7e3-0x0;var _0xcd2635=_0xf82e[_0x35d7e3];return _0xcd2635;};'use strict';var _=require('lodash');var util=require(_0xef82('0x0'));var logger=require(_0xef82('0x1'))(_0xef82('0x2'));var moment=require(_0xef82('0x3'));var BPromise=require(_0xef82('0x4'));var rp=require(_0xef82('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xef82('0x6'));module['exports']=function(_0x3cf5ef,_0x41a080){return _0x3cf5ef['define'](_0xef82('0x7'),attributes,{'tableName':_0xef82('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb832=['ReportAgentPreview','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./reportAgentPreview.attributes','define'];(function(_0x3cac60,_0x5960ff){var _0x37c3ec=function(_0x1be0c9){while(--_0x1be0c9){_0x3cac60['push'](_0x3cac60['shift']());}};_0x37c3ec(++_0x5960ff);}(_0xb832,0x14b));var _0x2b83=function(_0x1f3941,_0x6f16e5){_0x1f3941=_0x1f3941-0x0;var _0x1a6b70=_0xb832[_0x1f3941];return _0x1a6b70;};'use strict';var _=require('lodash');var util=require(_0x2b83('0x0'));var logger=require(_0x2b83('0x1'))(_0x2b83('0x2'));var moment=require(_0x2b83('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2b83('0x4'));var rimraf=require(_0x2b83('0x5'));var config=require(_0x2b83('0x6'));var attributes=require(_0x2b83('0x7'));module['exports']=function(_0x373fb1,_0x45ffa4){return _0x373fb1[_0x2b83('0x8')](_0x2b83('0x9'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index defc05e..55dfb95 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 _0x1c8e=['bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','lodash','util','moment'];(function(_0x41dc00,_0x80a32){var _0x5f511d=function(_0x1021c4){while(--_0x1021c4){_0x41dc00['push'](_0x41dc00['shift']());}};_0x5f511d(++_0x80a32);}(_0x1c8e,0x1e3));var _0xe1c8=function(_0x66b27c,_0x137ea3){_0x66b27c=_0x66b27c-0x0;var _0x1ba4a7=_0x1c8e[_0x66b27c];return _0x1ba4a7;};'use strict';var _=require(_0xe1c8('0x0'));var util=require(_0xe1c8('0x1'));var moment=require(_0xe1c8('0x2'));var BPromise=require(_0xe1c8('0x3'));var rs=require(_0xe1c8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe1c8('0x5'));var logger=require(_0xe1c8('0x6'))(_0xe1c8('0x7'));var config=require(_0xe1c8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe1c8('0x9')][_0xe1c8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a077b,_0xcff69b,_0x332673){return new BPromise(function(_0x382884,_0x4ea8ae){return client[_0xe1c8('0xb')](_0x2a077b,_0x332673)[_0xe1c8('0xc')](function(_0x216270){logger[_0xe1c8('0xd')](_0xe1c8('0xe'),_0xcff69b,_0xe1c8('0xf'));logger[_0xe1c8('0x10')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0xcff69b,_0xe1c8('0xf'),JSON[_0xe1c8('0x11')](_0x216270));if(_0x216270[_0xe1c8('0x12')]){if(_0x216270[_0xe1c8('0x12')]['code']===0x1f4){logger['error'](_0xe1c8('0xe'),_0xcff69b,_0x216270[_0xe1c8('0x12')]['message']);return _0x4ea8ae(_0x216270[_0xe1c8('0x12')][_0xe1c8('0x13')]);}logger[_0xe1c8('0x12')](_0xe1c8('0xe'),_0xcff69b,_0x216270['error'][_0xe1c8('0x13')]);return _0x382884(_0x216270[_0xe1c8('0x12')][_0xe1c8('0x13')]);}else{logger[_0xe1c8('0xd')](_0xe1c8('0xe'),_0xcff69b,_0xe1c8('0xf'));_0x382884(_0x216270['result'][_0xe1c8('0x13')]);}})[_0xe1c8('0x14')](function(_0x303418){logger[_0xe1c8('0x12')](_0xe1c8('0xe'),_0xcff69b,_0x303418);_0x4ea8ae(_0x303418);});});}exports[_0xe1c8('0x15')]=function(_0x1db674){var _0x5ca4fb=this;return new Promise(function(_0x1f98fb,_0x515c71){return db[_0xe1c8('0x16')][_0xe1c8('0x17')](_0x1db674[_0xe1c8('0x18')],{'raw':_0x1db674[_0xe1c8('0x19')]?_0x1db674[_0xe1c8('0x19')][_0xe1c8('0x1a')]===undefined?!![]:![]:!![]})[_0xe1c8('0xc')](function(_0x5800b1){logger[_0xe1c8('0xd')](_0xe1c8('0x15'),_0x1db674);logger[_0xe1c8('0x10')]('CreateReportAgentPreview',_0x1db674,JSON[_0xe1c8('0x11')](_0x5800b1));_0x1f98fb(_0x5800b1);})[_0xe1c8('0x14')](function(_0x32046c){logger[_0xe1c8('0x12')](_0xe1c8('0x15'),_0x32046c[_0xe1c8('0x13')],_0x1db674);_0x515c71(_0x5ca4fb[_0xe1c8('0x12')](0x1f4,_0x32046c['message']));});});}; \ No newline at end of file +var _0x55d3=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','error','ReportAgentPreview,\x20%s,\x20%s','message','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','stringify','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0xc989a3,_0x2ad1b0){var _0x24de1a=function(_0x37ee92){while(--_0x37ee92){_0xc989a3['push'](_0xc989a3['shift']());}};_0x24de1a(++_0x2ad1b0);}(_0x55d3,0xee));var _0x355d=function(_0x257ec5,_0x552ced){_0x257ec5=_0x257ec5-0x0;var _0x266840=_0x55d3[_0x257ec5];return _0x266840;};'use strict';var _=require(_0x355d('0x0'));var util=require('util');var moment=require(_0x355d('0x1'));var BPromise=require(_0x355d('0x2'));var rs=require(_0x355d('0x3'));var fs=require('fs');var Redis=require(_0x355d('0x4'));var db=require(_0x355d('0x5'))['db'];var utils=require(_0x355d('0x6'));var logger=require('../../config/logger')(_0x355d('0x7'));var config=require(_0x355d('0x8'));var jayson=require(_0x355d('0x9'));var client=jayson[_0x355d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x528d90,_0x1cc226,_0x1390e8){return new BPromise(function(_0x4a45e9,_0x42635){return client[_0x355d('0xb')](_0x528d90,_0x1390e8)[_0x355d('0xc')](function(_0x8e27e4){logger[_0x355d('0xd')]('ReportAgentPreview,\x20%s,\x20%s',_0x1cc226,_0x355d('0xe'));logger[_0x355d('0xf')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x1cc226,_0x355d('0xe'),JSON['stringify'](_0x8e27e4));if(_0x8e27e4[_0x355d('0x10')]){if(_0x8e27e4[_0x355d('0x10')]['code']===0x1f4){logger[_0x355d('0x10')](_0x355d('0x11'),_0x1cc226,_0x8e27e4[_0x355d('0x10')][_0x355d('0x12')]);return _0x42635(_0x8e27e4['error'][_0x355d('0x12')]);}logger['error'](_0x355d('0x11'),_0x1cc226,_0x8e27e4[_0x355d('0x10')][_0x355d('0x12')]);return _0x4a45e9(_0x8e27e4[_0x355d('0x10')][_0x355d('0x12')]);}else{logger[_0x355d('0xd')](_0x355d('0x11'),_0x1cc226,'request\x20sent');_0x4a45e9(_0x8e27e4['result']['message']);}})['catch'](function(_0x2f1677){logger['error'](_0x355d('0x11'),_0x1cc226,_0x2f1677);_0x42635(_0x2f1677);});});}exports[_0x355d('0x13')]=function(_0x5aca10){var _0x479ead=this;return new Promise(function(_0x4274cb,_0x1ecb59){return db[_0x355d('0x14')][_0x355d('0x15')](_0x5aca10[_0x355d('0x16')],{'raw':_0x5aca10['options']?_0x5aca10[_0x355d('0x17')][_0x355d('0x18')]===undefined?!![]:![]:!![]})[_0x355d('0xc')](function(_0x1fdbed){logger['info'](_0x355d('0x13'),_0x5aca10);logger['debug']('CreateReportAgentPreview',_0x5aca10,JSON[_0x355d('0x19')](_0x1fdbed));_0x4274cb(_0x1fdbed);})[_0x355d('0x1a')](function(_0x45d3b3){logger[_0x355d('0x10')](_0x355d('0x13'),_0x45d3b3[_0x355d('0x12')],_0x5aca10);_0x1ecb59(_0x479ead[_0x355d('0x10')](0x1f4,_0x45d3b3[_0x355d('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 4abfb12..a675d29 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 _0x88a5=['/voice/queues/channels/:uniqueid','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','put','updateVoiceQueue','outbound','/outbound/channels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','/fax/queues/:id','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','queueNotify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','showWhatsappQueues','/agents/:id/notify','agentNotify','util','Router','../../components/auth/service','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','mailQueues','/mail/accounts','mailAccounts','openchannelQueues','/sms/queues','/whatsapp/queues','whatsappQueues','/fax/queues','/voice/queues/preview/:id','voiceQueuesChannels'];(function(_0x4e8c36,_0x5f138b){var _0x4c33de=function(_0x57034d){while(--_0x57034d){_0x4e8c36['push'](_0x4e8c36['shift']());}};_0x4c33de(++_0x5f138b);}(_0x88a5,0x80));var _0x588a=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x88a5[_0xd1d19a];return _0x52a79d;};'use strict';var multer=require('multer');var util=require(_0x588a('0x0'));var path=require('path');var express=require('express');var router=express[_0x588a('0x1')]();var auth=require(_0x588a('0x2'));var controller=require('./rpc.controller');router[_0x588a('0x3')](_0x588a('0x4'),auth[_0x588a('0x5')](),controller[_0x588a('0x6')]);router[_0x588a('0x3')](_0x588a('0x7'),auth[_0x588a('0x5')](),controller[_0x588a('0x8')]);router[_0x588a('0x3')](_0x588a('0x9'),auth['isAuthenticated'](),controller['voiceChannelStopMixMonitor']);router['get'](_0x588a('0xa'),auth['isAuthenticated'](),controller[_0x588a('0xb')]);router[_0x588a('0x3')](_0x588a('0xc'),auth[_0x588a('0x5')](),controller[_0x588a('0xd')]);router[_0x588a('0x3')]('/mail/queues',auth[_0x588a('0x5')](),controller[_0x588a('0xe')]);router[_0x588a('0x3')](_0x588a('0xf'),auth[_0x588a('0x5')](),controller[_0x588a('0x10')]);router[_0x588a('0x3')]('/openchannel/queues',auth[_0x588a('0x5')](),controller[_0x588a('0x11')]);router[_0x588a('0x3')](_0x588a('0x12'),auth[_0x588a('0x5')](),controller['smsQueues']);router[_0x588a('0x3')](_0x588a('0x13'),auth[_0x588a('0x5')](),controller[_0x588a('0x14')]);router['get'](_0x588a('0x15'),auth[_0x588a('0x5')](),controller['faxQueues']);router[_0x588a('0x3')](_0x588a('0x16'),auth[_0x588a('0x5')](),controller['voiceQueuesPreview']);router[_0x588a('0x3')]('/voice/queues/channels',auth[_0x588a('0x5')](),controller[_0x588a('0x17')]);router[_0x588a('0x3')](_0x588a('0x18'),auth[_0x588a('0x5')](),controller['voiceQueuesChannel']);router[_0x588a('0x3')]('/voice/queues/channels/:uniqueid/hangup',auth[_0x588a('0x5')](),controller[_0x588a('0x19')]);router[_0x588a('0x3')](_0x588a('0x1a'),auth[_0x588a('0x5')](),controller[_0x588a('0x1b')]);router[_0x588a('0x3')](_0x588a('0x1c'),auth[_0x588a('0x5')](),controller['showVoiceQueues']);router[_0x588a('0x1d')](_0x588a('0x1c'),auth[_0x588a('0x5')](),controller[_0x588a('0x1e')]);router[_0x588a('0x3')]('/outbound',auth[_0x588a('0x5')](),controller[_0x588a('0x1f')]);router[_0x588a('0x3')](_0x588a('0x20'),auth[_0x588a('0x5')](),controller['outboundChannels']);router[_0x588a('0x3')](_0x588a('0x21'),auth[_0x588a('0x5')](),controller[_0x588a('0x22')]);router[_0x588a('0x1d')](_0x588a('0x23'),auth[_0x588a('0x5')](),controller[_0x588a('0x24')]);router[_0x588a('0x3')](_0x588a('0x25'),auth[_0x588a('0x5')](),controller[_0x588a('0x26')]);router[_0x588a('0x3')](_0x588a('0x27'),auth[_0x588a('0x5')](),controller[_0x588a('0x28')]);router['get']('/campaigns',auth['isAuthenticated'](),controller[_0x588a('0x29')]);router[_0x588a('0x3')](_0x588a('0x2a'),auth[_0x588a('0x5')](),controller[_0x588a('0x2b')]);router[_0x588a('0x3')](_0x588a('0x2c'),auth[_0x588a('0x5')](),controller[_0x588a('0x2d')]);router[_0x588a('0x3')](_0x588a('0x2e'),auth[_0x588a('0x5')](),controller[_0x588a('0x2f')]);router[_0x588a('0x3')](_0x588a('0x30'),auth[_0x588a('0x5')](),controller['openchannelQueuesWaitingInteractions']);router[_0x588a('0x3')]('/openchannel/queues/:id/waitinginteractions',auth[_0x588a('0x5')](),controller[_0x588a('0x31')]);router['get'](_0x588a('0x32'),auth[_0x588a('0x5')](),controller[_0x588a('0x33')]);router['get']('/whatsapp/queues/waitinginteractions',auth[_0x588a('0x5')](),controller['whatsappQueuesWaitingInteractions']);router[_0x588a('0x3')](_0x588a('0x34'),auth[_0x588a('0x5')](),controller[_0x588a('0x35')]);router[_0x588a('0x36')](_0x588a('0x37'),auth[_0x588a('0x5')](),controller['queueNotify'](_0x588a('0x38')));router[_0x588a('0x3')](_0x588a('0x39'),auth[_0x588a('0x5')](),controller[_0x588a('0x3a')]);router[_0x588a('0x36')]('/chat/queues/:id/notify',auth['isAuthenticated'](),controller['queueNotify']('chat'));router[_0x588a('0x3')](_0x588a('0x3b'),auth['isAuthenticated'](),controller[_0x588a('0x3c')]);router['post'](_0x588a('0x3d'),auth[_0x588a('0x5')](),controller['queueNotify']('fax'));router[_0x588a('0x3')](_0x588a('0x3e'),auth[_0x588a('0x5')](),controller['showFaxQueues']);router[_0x588a('0x36')]('/openchannel/queues/:id/notify',auth[_0x588a('0x5')](),controller['queueNotify'](_0x588a('0x3f')));router[_0x588a('0x3')](_0x588a('0x40'),auth[_0x588a('0x5')](),controller[_0x588a('0x41')]);router[_0x588a('0x36')](_0x588a('0x42'),auth['isAuthenticated'](),controller[_0x588a('0x43')](_0x588a('0x44')));router[_0x588a('0x36')](_0x588a('0x45'),auth[_0x588a('0x5')](),controller[_0x588a('0x43')](_0x588a('0x46')));router[_0x588a('0x3')](_0x588a('0x47'),auth[_0x588a('0x5')](),controller[_0x588a('0x48')]);router[_0x588a('0x3')]('/whatsapp/queues/:id',auth[_0x588a('0x5')](),controller[_0x588a('0x49')]);router['post'](_0x588a('0x4a'),auth[_0x588a('0x5')](),controller[_0x588a('0x4b')]);module['exports']=router; \ No newline at end of file +var _0xa51d=['campaigns','/fax/accounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','showChatQueues','/fax/queues/:id/notify','fax','showFaxQueues','showOpenchannelQueues','/whatsapp/queues/:id/notify','whatsapp','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','multer','util','express','../../components/auth/service','./rpc.controller','isAuthenticated','voiceChannels','get','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','voiceQueues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','updateVoiceQueue','outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks'];(function(_0xda3baf,_0x5201a2){var _0x3b1b34=function(_0x138013){while(--_0x138013){_0xda3baf['push'](_0xda3baf['shift']());}};_0x3b1b34(++_0x5201a2);}(_0xa51d,0x1e0));var _0xda51=function(_0x2258e8,_0x396f17){_0x2258e8=_0x2258e8-0x0;var _0x539892=_0xa51d[_0x2258e8];return _0x539892;};'use strict';var multer=require(_0xda51('0x0'));var util=require(_0xda51('0x1'));var path=require('path');var express=require(_0xda51('0x2'));var router=express['Router']();var auth=require(_0xda51('0x3'));var controller=require(_0xda51('0x4'));router['get']('/voice/channels',auth[_0xda51('0x5')](),controller[_0xda51('0x6')]);router[_0xda51('0x7')]('/voice/channels/:uniqueid/mixmonitor',auth['isAuthenticated'](),controller[_0xda51('0x8')]);router[_0xda51('0x7')](_0xda51('0x9'),auth['isAuthenticated'](),controller['voiceChannelStopMixMonitor']);router[_0xda51('0x7')](_0xda51('0xa'),auth['isAuthenticated'](),controller[_0xda51('0xb')]);router[_0xda51('0x7')]('/chat/queues',auth[_0xda51('0x5')](),controller['chatQueues']);router[_0xda51('0x7')]('/mail/queues',auth['isAuthenticated'](),controller[_0xda51('0xc')]);router[_0xda51('0x7')](_0xda51('0xd'),auth[_0xda51('0x5')](),controller[_0xda51('0xe')]);router[_0xda51('0x7')](_0xda51('0xf'),auth[_0xda51('0x5')](),controller[_0xda51('0x10')]);router[_0xda51('0x7')](_0xda51('0x11'),auth[_0xda51('0x5')](),controller[_0xda51('0x12')]);router[_0xda51('0x7')](_0xda51('0x13'),auth[_0xda51('0x5')](),controller[_0xda51('0x14')]);router['get']('/fax/queues',auth['isAuthenticated'](),controller[_0xda51('0x15')]);router[_0xda51('0x7')](_0xda51('0x16'),auth[_0xda51('0x5')](),controller[_0xda51('0x17')]);router['get'](_0xda51('0x18'),auth[_0xda51('0x5')](),controller[_0xda51('0x19')]);router['get'](_0xda51('0x1a'),auth[_0xda51('0x5')](),controller[_0xda51('0x1b')]);router[_0xda51('0x7')](_0xda51('0x1c'),auth['isAuthenticated'](),controller['voiceQueuesChannelHangup']);router[_0xda51('0x7')](_0xda51('0x1d'),auth[_0xda51('0x5')](),controller[_0xda51('0x1e')]);router[_0xda51('0x7')](_0xda51('0x1f'),auth[_0xda51('0x5')](),controller[_0xda51('0x20')]);router['put'](_0xda51('0x1f'),auth[_0xda51('0x5')](),controller[_0xda51('0x21')]);router['get']('/outbound',auth[_0xda51('0x5')](),controller[_0xda51('0x22')]);router[_0xda51('0x7')](_0xda51('0x23'),auth[_0xda51('0x5')](),controller[_0xda51('0x24')]);router[_0xda51('0x7')](_0xda51('0x25'),auth[_0xda51('0x5')](),controller[_0xda51('0x26')]);router['put'](_0xda51('0x27'),auth[_0xda51('0x5')](),controller[_0xda51('0x28')]);router[_0xda51('0x7')](_0xda51('0x29'),auth['isAuthenticated'](),controller[_0xda51('0x2a')]);router[_0xda51('0x7')](_0xda51('0x2b'),auth['isAuthenticated'](),controller[_0xda51('0x2c')]);router[_0xda51('0x7')]('/campaigns',auth[_0xda51('0x5')](),controller[_0xda51('0x2d')]);router[_0xda51('0x7')](_0xda51('0x2e'),auth[_0xda51('0x5')](),controller['faxAccounts']);router[_0xda51('0x7')](_0xda51('0x2f'),auth[_0xda51('0x5')](),controller[_0xda51('0x30')]);router['get']('/mail/queues/waitinginteractions',auth['isAuthenticated'](),controller['mailQueuesWaitingInteractions']);router['get'](_0xda51('0x31'),auth[_0xda51('0x5')](),controller[_0xda51('0x32')]);router['get'](_0xda51('0x33'),auth[_0xda51('0x5')](),controller[_0xda51('0x34')]);router[_0xda51('0x7')](_0xda51('0x35'),auth[_0xda51('0x5')](),controller[_0xda51('0x36')]);router[_0xda51('0x7')](_0xda51('0x37'),auth['isAuthenticated'](),controller[_0xda51('0x38')]);router[_0xda51('0x7')]('/fax/queues/waitinginteractions',auth[_0xda51('0x5')](),controller[_0xda51('0x39')]);router[_0xda51('0x3a')](_0xda51('0x3b'),auth['isAuthenticated'](),controller[_0xda51('0x3c')](_0xda51('0x3d')));router[_0xda51('0x7')](_0xda51('0x3e'),auth['isAuthenticated'](),controller[_0xda51('0x3f')]);router[_0xda51('0x3a')]('/chat/queues/:id/notify',auth[_0xda51('0x5')](),controller[_0xda51('0x3c')]('chat'));router[_0xda51('0x7')]('/chat/queues/:id',auth[_0xda51('0x5')](),controller[_0xda51('0x40')]);router[_0xda51('0x3a')](_0xda51('0x41'),auth[_0xda51('0x5')](),controller[_0xda51('0x3c')](_0xda51('0x42')));router['get']('/fax/queues/:id',auth[_0xda51('0x5')](),controller[_0xda51('0x43')]);router[_0xda51('0x3a')]('/openchannel/queues/:id/notify',auth[_0xda51('0x5')](),controller[_0xda51('0x3c')]('openchannel'));router[_0xda51('0x7')]('/openchannel/queues/:id',auth[_0xda51('0x5')](),controller[_0xda51('0x44')]);router[_0xda51('0x3a')]('/sms/queues/:id/notify',auth[_0xda51('0x5')](),controller[_0xda51('0x3c')]('sms'));router['post'](_0xda51('0x45'),auth[_0xda51('0x5')](),controller['queueNotify'](_0xda51('0x46')));router[_0xda51('0x7')]('/sms/queues/:id',auth[_0xda51('0x5')](),controller[_0xda51('0x47')]);router[_0xda51('0x7')](_0xda51('0x48'),auth[_0xda51('0x5')](),controller[_0xda51('0x49')]);router[_0xda51('0x3a')](_0xda51('0x4a'),auth[_0xda51('0x5')](),controller['agentNotify']);module['exports']=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 3a97310..2ba0147 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 _0xee14=['telephones','Telephones','trunks','campaigns','Campaigns','chatQueues','showChatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','update','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','Start','queueTransferTimeout','channel','Website','User','agent','Agent\x20not\x20found','\x20Message\x20not\x20found','*,*,*,*','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','then','error','code','message','result','catch','status','json','sendStatus','stack','name','send','isNil','rows','find','VoiceChannels','query','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','user','interaction','hasOwnProperty','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','MemberReport','findOrCreate','INTERACTION','SIP/%s','AgentCapacity'];(function(_0x8688fd,_0x4484df){var _0x226ec0=function(_0x2c6cb7){while(--_0x2c6cb7){_0x8688fd['push'](_0x8688fd['shift']());}};_0x226ec0(++_0x4484df);}(_0xee14,0x13a));var _0x4ee1=function(_0x27dac8,_0xe2a960){_0x27dac8=_0x27dac8-0x0;var _0x4cfe42=_0xee14[_0x27dac8];return _0x4cfe42;};'use strict';var BPromise=require('bluebird');var moment=require('moment');var _=require(_0x4ee1('0x0'));var util=require(_0x4ee1('0x1'));var db=require(_0x4ee1('0x2'))['db'];var logger=require(_0x4ee1('0x3'))(_0x4ee1('0x4'));var jayson=require(_0x4ee1('0x5'));var amiClient=jayson[_0x4ee1('0x6')][_0x4ee1('0x7')]({'port':0x232a});var mailClient=jayson[_0x4ee1('0x6')]['http']({'port':0x232b});var routingClient=jayson[_0x4ee1('0x6')]['http']({'port':0x232c});function respondWithRpcPromise(_0x327c18,_0x3a45a3,_0x187656){return new BPromise(function(_0x293d5f,_0xdfe9c1){var _0x1fd8c8=_0x187656?_0x187656:amiClient;return _0x1fd8c8['request'](_0x327c18,_0x3a45a3)[_0x4ee1('0x8')](function(_0x38be25){if(_0x38be25['error']){if(_0x38be25[_0x4ee1('0x9')][_0x4ee1('0xa')]===0x1f4){return _0xdfe9c1(_0x38be25[_0x4ee1('0x9')][_0x4ee1('0xb')]);}return _0x293d5f(_0x38be25['error'][_0x4ee1('0xb')]);}else{_0x293d5f(_0x38be25[_0x4ee1('0xc')]);}})[_0x4ee1('0xd')](function(_0x2d5d3c){_0xdfe9c1(_0x2d5d3c);});});}function respondWithResult(_0x2f864e,_0x174427){_0x174427=_0x174427||0xc8;return function(_0x5616d6){if(_0x5616d6){return _0x2f864e[_0x4ee1('0xe')](_0x174427)[_0x4ee1('0xf')](_0x5616d6);}return _0x2f864e[_0x4ee1('0x10')](0x194);};}function handleError(_0x24a915,_0x46d2c2){_0x46d2c2=_0x46d2c2||0x1f4;return function(_0x1c342a){logger[_0x4ee1('0x9')](_0x1c342a[_0x4ee1('0x11')]);if(_0x1c342a[_0x4ee1('0x12')]){delete _0x1c342a['name'];}_0x24a915[_0x4ee1('0xe')](_0x46d2c2)[_0x4ee1('0x13')](_0x1c342a);};}function findById(_0x34651b){return function(_0x1b1e0e){if(!_[_0x4ee1('0x14')](_0x34651b)&&!_[_0x4ee1('0x14')](_0x1b1e0e)&&!_[_0x4ee1('0x14')](_0x1b1e0e[_0x4ee1('0x15')])){return _[_0x4ee1('0x16')](_0x1b1e0e[_0x4ee1('0x15')],function(_0x274de5){return _0x274de5['id']==_0x34651b;});}return null;};}exports['voiceChannels']=function(_0x236215,_0x3db827){return respondWithRpcPromise(_0x4ee1('0x17'),_0x236215[_0x4ee1('0x18')])[_0x4ee1('0x8')](respondWithResult(_0x3db827,null))[_0x4ee1('0xd')](handleError(_0x3db827,null));};exports['voiceChannelMixMonitor']=function(_0x8a631f,_0x333e96){return respondWithRpcPromise(_0x4ee1('0x19'),_[_0x4ee1('0x1a')](_0x8a631f[_0x4ee1('0x18')],_0x8a631f[_0x4ee1('0x1b')]))[_0x4ee1('0x8')](respondWithResult(_0x333e96,null))[_0x4ee1('0xd')](handleError(_0x333e96,null));};exports[_0x4ee1('0x1c')]=function(_0x3e5038,_0x4faaf6){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0x4ee1('0x1a')](_0x3e5038[_0x4ee1('0x18')],_0x3e5038[_0x4ee1('0x1b')]))[_0x4ee1('0x8')](respondWithResult(_0x4faaf6,null))[_0x4ee1('0xd')](handleError(_0x4faaf6,null));};exports[_0x4ee1('0x1d')]=function(_0x57d45d,_0x5cc0b5){return respondWithRpcPromise(_0x4ee1('0x1e'),_0x57d45d[_0x4ee1('0x18')])['then'](respondWithResult(_0x5cc0b5,null))[_0x4ee1('0xd')](handleError(_0x5cc0b5,null));};exports[_0x4ee1('0x1f')]=function(_0x36654c,_0x215949){return respondWithRpcPromise(_0x4ee1('0x1e'),_0x36654c[_0x4ee1('0x18')])[_0x4ee1('0x8')](findById(_0x36654c['params']['id']))[_0x4ee1('0x8')](respondWithResult(_0x215949,null))['catch'](handleError(_0x215949,null));};exports[_0x4ee1('0x20')]=function(_0x4ec408,_0x3dc870){return respondWithRpcPromise(_0x4ee1('0x21'),_[_0x4ee1('0x1a')](_0x4ec408[_0x4ee1('0x22')],_0x4ec408[_0x4ee1('0x1b')]))['then'](respondWithResult(_0x3dc870,null))[_0x4ee1('0xd')](handleError(_0x3dc870,null));};exports['voiceQueuesPreview']=function(_0x121301,_0x3d5e6c){return respondWithRpcPromise(_0x4ee1('0x23'),_[_0x4ee1('0x1a')](_0x121301[_0x4ee1('0x18')],_0x121301['params']))[_0x4ee1('0x8')](respondWithResult(_0x3d5e6c,null))[_0x4ee1('0xd')](handleError(_0x3d5e6c,null));};exports[_0x4ee1('0x24')]=function(_0x2e37a3,_0x79f87c){return respondWithRpcPromise(_0x4ee1('0x25'),_0x2e37a3['query'])['then'](respondWithResult(_0x79f87c,null))[_0x4ee1('0xd')](handleError(_0x79f87c,null));};exports[_0x4ee1('0x26')]=function(_0x41ab60,_0x5a2f6f){return respondWithRpcPromise(_0x4ee1('0x27'),_[_0x4ee1('0x1a')](_0x41ab60[_0x4ee1('0x18')],_0x41ab60[_0x4ee1('0x1b')]))[_0x4ee1('0x8')](respondWithResult(_0x5a2f6f,null))[_0x4ee1('0xd')](handleError(_0x5a2f6f,null));};exports[_0x4ee1('0x28')]=function(_0x199e11,_0x36898c){return respondWithRpcPromise(_0x4ee1('0x29'),_[_0x4ee1('0x1a')](_0x199e11[_0x4ee1('0x18')],_0x199e11[_0x4ee1('0x1b')]))['then'](respondWithResult(_0x36898c,null))[_0x4ee1('0xd')](handleError(_0x36898c,null));};exports[_0x4ee1('0x2a')]=function(_0x882468,_0x50539f){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x4ee1('0x1a')](_0x882468[_0x4ee1('0x18')],_0x882468[_0x4ee1('0x1b')]))[_0x4ee1('0x8')](respondWithResult(_0x50539f,null))['catch'](handleError(_0x50539f,null));};exports[_0x4ee1('0x2b')]=function(_0x2ed16f,_0x11721a){return respondWithRpcPromise(_0x4ee1('0x2c'),_0x2ed16f[_0x4ee1('0x18')])[_0x4ee1('0x8')](respondWithResult(_0x11721a,null))[_0x4ee1('0xd')](handleError(_0x11721a,null));};exports[_0x4ee1('0x2d')]=function(_0x59b5cc,_0x3b346e){return respondWithRpcPromise(_0x4ee1('0x2e'),_0x59b5cc[_0x4ee1('0x18')])[_0x4ee1('0x8')](respondWithResult(_0x3b346e,null))[_0x4ee1('0xd')](handleError(_0x3b346e,null));};exports[_0x4ee1('0x2f')]=function(_0x543b2e,_0x3e2ca7){var _0x37176a;return respondWithRpcPromise(_0x4ee1('0x30'),_0x543b2e[_0x4ee1('0x18')])[_0x4ee1('0x8')](function(_0x352dc5){_0x37176a=_0x352dc5;return respondWithRpcPromise(_0x4ee1('0x30'),_0x543b2e[_0x4ee1('0x18')],routingClient);})[_0x4ee1('0x8')](function(_0x29493d){return _[_0x4ee1('0x1a')]({},_0x29493d,_0x37176a);})[_0x4ee1('0x8')](respondWithResult(_0x3e2ca7,null))[_0x4ee1('0xd')](handleError(_0x3e2ca7,null));};exports['agentCapacity']=function(_0x3b3bed,_0x40a3e3){if(_0x3b3bed['body']&&_0x3b3bed[_0x4ee1('0x22')]['interaction']&&_0x3b3bed[_0x4ee1('0x31')]&&_0x3b3bed['user'][_0x4ee1('0x12')]){for(var _0xc7580c in _0x3b3bed['body'][_0x4ee1('0x32')]){if(_0x3b3bed[_0x4ee1('0x22')][_0x4ee1('0x32')][_0x4ee1('0x33')](_0xc7580c)){db['MemberReport'][_0x4ee1('0x34')]({'where':{'channel':_0xc7580c,'membername':_0x3b3bed[_0x4ee1('0x31')][_0x4ee1('0x12')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x3b3bed['body'][_0x4ee1('0x32')][_0xc7580c]&&_0x3b3bed[_0x4ee1('0x22')][_0x4ee1('0x32')][_0xc7580c][_0x4ee1('0x35')]?{'$notIn':_0x3b3bed[_0x4ee1('0x22')]['interaction'][_0xc7580c]}:{'$ne':null}}})['then'](function(_0xaa71d5){var _0x266add=moment()[_0x4ee1('0x36')](_0x4ee1('0x37'));for(var _0x5c5862=0x0,_0x3d6bf4=_0xaa71d5[_0x4ee1('0x35')];_0x5c5862<_0x3d6bf4;_0x5c5862+=0x1){_0xaa71d5[_0x5c5862]['updateAttributes']({'exitAt':_0x266add});}});for(var _0x21ebb8=0x0;_0x21ebb8<_0x3b3bed[_0x4ee1('0x22')][_0x4ee1('0x32')][_0xc7580c][_0x4ee1('0x35')];_0x21ebb8+=0x1){db[_0x4ee1('0x38')][_0x4ee1('0x39')]({'where':{'channel':_0xc7580c,'membername':_0x3b3bed[_0x4ee1('0x31')][_0x4ee1('0x12')],'type':_0x4ee1('0x3a'),'uniqueid':_0x3b3bed['body']['interaction'][_0xc7580c][_0x21ebb8],'exitAt':null},'defaults':{'channel':_0xc7580c,'membername':_0x3b3bed[_0x4ee1('0x31')][_0x4ee1('0x12')],'interface':_[_0x4ee1('0x14')](_0x3b3bed[_0x4ee1('0x31')]['interface'])?util[_0x4ee1('0x36')](_0x4ee1('0x3b'),_0x3b3bed[_0x4ee1('0x31')][_0x4ee1('0x12')]):_0x3b3bed[_0x4ee1('0x31')]['interface'],'type':_0x4ee1('0x3a'),'enterAt':moment()[_0x4ee1('0x36')](_0x4ee1('0x37')),'role':'agent','internal':_0x3b3bed[_0x4ee1('0x31')]['internal'],'uniqueid':_0x3b3bed[_0x4ee1('0x22')]['interaction'][_0xc7580c][_0x21ebb8]}});}}}}return respondWithRpcPromise(_0x4ee1('0x3c'),{'id':_0x3b3bed['params']['id'],'capacity':_0x3b3bed[_0x4ee1('0x22')]['capacity']},routingClient)[_0x4ee1('0x8')](respondWithResult(_0x40a3e3,null))[_0x4ee1('0xd')](handleError(_0x40a3e3,null));};exports[_0x4ee1('0x3d')]=function(_0x5f4f78,_0x3368ed){return respondWithRpcPromise(_0x4ee1('0x3e'),_0x5f4f78[_0x4ee1('0x18')])[_0x4ee1('0x8')](respondWithResult(_0x3368ed,null))[_0x4ee1('0xd')](handleError(_0x3368ed,null));};exports[_0x4ee1('0x3f')]=function(_0x3f1c32,_0x517729){return respondWithRpcPromise('Trunks',_0x3f1c32[_0x4ee1('0x18')])[_0x4ee1('0x8')](respondWithResult(_0x517729,null))[_0x4ee1('0xd')](handleError(_0x517729,null));};exports[_0x4ee1('0x40')]=function(_0x44e65f,_0x31e82d){return respondWithRpcPromise(_0x4ee1('0x41'),_0x44e65f[_0x4ee1('0x18')])[_0x4ee1('0x8')](respondWithResult(_0x31e82d,null))[_0x4ee1('0xd')](handleError(_0x31e82d,null));};exports[_0x4ee1('0x42')]=function(_0x2453ac,_0x3c2e42){return respondWithRpcPromise('ChatQueues',_0x2453ac[_0x4ee1('0x18')],routingClient)['then'](respondWithResult(_0x3c2e42,null))[_0x4ee1('0xd')](handleError(_0x3c2e42,null));};exports[_0x4ee1('0x43')]=function(_0x59bbca,_0x1e0aac){return respondWithRpcPromise(_0x4ee1('0x44'),_0x59bbca['query'],routingClient)['then'](findById(_0x59bbca[_0x4ee1('0x1b')]['id']))['then'](respondWithResult(_0x1e0aac,null))[_0x4ee1('0xd')](handleError(_0x1e0aac,null));};exports[_0x4ee1('0x45')]=function(_0x59ba70,_0x43489c){return respondWithRpcPromise(_0x4ee1('0x46'),_0x59ba70[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](respondWithResult(_0x43489c,null))[_0x4ee1('0xd')](handleError(_0x43489c,null));};exports[_0x4ee1('0x47')]=function(_0x11f619,_0x5f5694){return respondWithRpcPromise('MailQueues',_0x11f619[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](findById(_0x11f619['params']['id']))[_0x4ee1('0x8')](respondWithResult(_0x5f5694,null))[_0x4ee1('0xd')](handleError(_0x5f5694,null));};exports[_0x4ee1('0x48')]=function(_0x51e341,_0x1ad933){return respondWithRpcPromise('MailAccounts',_0x51e341[_0x4ee1('0x18')],mailClient)['then'](respondWithResult(_0x1ad933,null))['catch'](handleError(_0x1ad933,null));};exports[_0x4ee1('0x49')]=function(_0x16fcd0,_0x290451){return respondWithRpcPromise(_0x4ee1('0x4a'),_0x16fcd0[_0x4ee1('0x18')],routingClient)['then'](respondWithResult(_0x290451,null))[_0x4ee1('0xd')](handleError(_0x290451,null));};exports[_0x4ee1('0x4b')]=function(_0x10f4e,_0x58eb1d){return respondWithRpcPromise(_0x4ee1('0x4a'),_0x10f4e[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](findById(_0x10f4e[_0x4ee1('0x1b')]['id']))[_0x4ee1('0x8')](respondWithResult(_0x58eb1d,null))[_0x4ee1('0xd')](handleError(_0x58eb1d,null));};exports[_0x4ee1('0x4c')]=function(_0x20ca0b,_0x19fa31){return respondWithRpcPromise(_0x4ee1('0x4d'),_0x20ca0b[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](respondWithResult(_0x19fa31,null))['catch'](handleError(_0x19fa31,null));};exports[_0x4ee1('0x4e')]=function(_0x5bf5e9,_0x25cfc3){return respondWithRpcPromise('SmsQueues',_0x5bf5e9[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](findById(_0x5bf5e9[_0x4ee1('0x1b')]['id']))[_0x4ee1('0x8')](respondWithResult(_0x25cfc3,null))[_0x4ee1('0xd')](handleError(_0x25cfc3,null));};exports[_0x4ee1('0x4f')]=function(_0x342aa1,_0x447060){return respondWithRpcPromise(_0x4ee1('0x50'),_0x342aa1[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](respondWithResult(_0x447060,null))[_0x4ee1('0xd')](handleError(_0x447060,null));};exports['showWhatsappQueues']=function(_0x759888,_0x24308c){return respondWithRpcPromise(_0x4ee1('0x50'),_0x759888['query'],routingClient)['then'](findById(_0x759888[_0x4ee1('0x1b')]['id']))[_0x4ee1('0x8')](respondWithResult(_0x24308c,null))['catch'](handleError(_0x24308c,null));};exports[_0x4ee1('0x51')]=function(_0x431dfa,_0x3f8f94){return respondWithRpcPromise(_0x4ee1('0x52'),_0x431dfa[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](respondWithResult(_0x3f8f94,null))[_0x4ee1('0xd')](handleError(_0x3f8f94,null));};exports[_0x4ee1('0x53')]=function(_0x28e11c,_0x3824bf){return respondWithRpcPromise('FaxQueues',_0x28e11c[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](findById(_0x28e11c['params']['id']))['then'](respondWithResult(_0x3824bf,null))[_0x4ee1('0xd')](handleError(_0x3824bf,null));};exports[_0x4ee1('0x54')]=function(_0x19e095,_0x38e06){return respondWithRpcPromise(_0x4ee1('0x55'),_0x19e095[_0x4ee1('0x18')])[_0x4ee1('0x8')](respondWithResult(_0x38e06,null))['catch'](handleError(_0x38e06,null));};exports[_0x4ee1('0x56')]=function(_0x39583b,_0x44af66){return respondWithRpcPromise(_0x4ee1('0x57'),_0x39583b[_0x4ee1('0x18')],routingClient)['then'](respondWithResult(_0x44af66,null))[_0x4ee1('0xd')](handleError(_0x44af66,null));};exports['mailQueuesWaitingInteractions']=function(_0x1d360f,_0x29371c){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x1d360f['query'],routingClient)[_0x4ee1('0x8')](respondWithResult(_0x29371c,null))[_0x4ee1('0xd')](handleError(_0x29371c,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x2beb82,_0x5aacf1){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x2beb82[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](respondWithResult(_0x5aacf1,null))[_0x4ee1('0xd')](handleError(_0x5aacf1,null));};exports[_0x4ee1('0x58')]=function(_0x37fa42,_0x38698a){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x37fa42[_0x4ee1('0x18')],routingClient)['then'](function(_0x57f66c){if(_0x37fa42[_0x4ee1('0x18')][_0x4ee1('0x59')]!==undefined){var _0x411c99=_(_0x57f66c[_0x4ee1('0x15')])[_0x4ee1('0x5a')]([_0x37fa42[_0x4ee1('0x18')][_0x4ee1('0x59')],_0x37fa42[_0x4ee1('0x1b')]['id']])['map'](_0x4ee1('0x5b'))[_0x4ee1('0x5c')]()['value']();return _0x57f66c[_0x4ee1('0x15')][_0x4ee1('0x5a')](function(_0xcd0dd9){return _0x411c99[_0x4ee1('0x5d')](_0xcd0dd9[_0x4ee1('0x5b')])>-0x1;});}else{return _0x57f66c[_0x4ee1('0x15')][_0x4ee1('0x5a')](function(_0x4dee3a){return _0x4dee3a[_0x4ee1('0x5b')]===parseInt(_0x37fa42['params']['id']);});}})[_0x4ee1('0x8')](respondWithResult(_0x38698a,null))[_0x4ee1('0xd')](handleError(_0x38698a,null));};exports[_0x4ee1('0x5e')]=function(_0x35a719,_0x48c51c){return respondWithRpcPromise(_0x4ee1('0x5f'),_0x35a719[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](respondWithResult(_0x48c51c,null))['catch'](handleError(_0x48c51c,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x2ef7c9,_0x4b4ad5){return respondWithRpcPromise(_0x4ee1('0x60'),_0x2ef7c9[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](respondWithResult(_0x4b4ad5,null))['catch'](handleError(_0x4b4ad5,null));};exports['faxQueuesWaitingInteractions']=function(_0x27fd3b,_0x1e2360){return respondWithRpcPromise(_0x4ee1('0x61'),_0x27fd3b[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](respondWithResult(_0x1e2360,null))[_0x4ee1('0xd')](handleError(_0x1e2360,null));};exports[_0x4ee1('0x62')]=function(_0x5727ef){return function(_0x4a3201,_0x50645b){var _0x3fba19,_0x3a75a7;var _0x33f5af=_[_0x4ee1('0x63')](_0x5727ef);var _0x4db801=_0x5727ef===_0x4ee1('0x64')?'Website':_0x4ee1('0x65');return db[_0x33f5af+_0x4ee1('0x66')][_0x4ee1('0x67')]({'raw':!![],'where':{'id':_0x4a3201[_0x4ee1('0x1b')]['id']}})[_0x4ee1('0x8')](function(_0x190f59){if(_['isNil'](_0x190f59)){throw new Error(_0x33f5af+_0x4ee1('0x68'));}_0x3fba19=_0x190f59;return db[_0x33f5af+_0x4ee1('0x69')][_0x4ee1('0x67')]({'where':{'id':_0x4a3201[_0x4ee1('0x22')][_0x4ee1('0x6a')]},'include':[{'model':db[_0x33f5af+_0x4ee1('0x6b')],'as':_0x4ee1('0x6b')},{'model':db[_0x33f5af+_0x4db801],'as':_0x4ee1('0x65')}]});})[_0x4ee1('0x8')](function(_0x207758){if(_[_0x4ee1('0x14')](_0x207758)){throw new Error(_0x33f5af+'\x20Message\x20not\x20found');}_0x3a75a7=_0x207758;return _0x207758[_0x4ee1('0x6c')]({'read':0x0,'readAt':null,'UserId':null});})[_0x4ee1('0x8')](function(){var _0x646878={'uniqueid':_0x5727ef+'.'+_0x3a75a7['id']+'.'+_0x3a75a7[_0x4ee1('0x6b')]['id'],'FromUserId':_0x4a3201[_0x4ee1('0x31')]['id'],'type':_0x4ee1('0x6d')};_0x646878[_0x33f5af+_0x4ee1('0x6e')]=_0x3a75a7['id'];_0x646878[_0x33f5af+_0x4ee1('0x6f')]=_0x3a75a7[_0x4ee1('0x6b')]['id'];_0x646878[_0x4ee1('0x70')+_0x33f5af+_0x4db801+'Id']=_0x3a75a7[_0x4ee1('0x65')]['id'];_0x646878['To'+_0x33f5af+_0x4ee1('0x71')]=_0x3fba19['id'];return db[_0x33f5af+_0x4ee1('0x72')][_0x4ee1('0x73')](_0x646878);})[_0x4ee1('0x8')](function(){return respondWithRpcPromise(_0x4ee1('0x74'),{'channel':_0x5727ef,'interaction':_0x3a75a7['Interaction'],'message':_0x3a75a7,'account':_0x3a75a7[_0x4ee1('0x65')],'applications':[{'id':0x0,'priority':0x1,'app':_0x4ee1('0x6d'),'appdata':_0x3fba19['name']+','+(_0x3a75a7[_0x4ee1('0x65')][_0x4ee1('0x75')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0x50645b,null))[_0x4ee1('0xd')](handleError(_0x50645b,null));};};exports['agentNotify']=function(_0x13a755,_0x1a00a4){var _0x47b854,_0x1700c6;if(_[_0x4ee1('0x14')](_0x13a755[_0x4ee1('0x22')][_0x4ee1('0x76')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x2bc05a=_0x13a755[_0x4ee1('0x22')][_0x4ee1('0x76')];var _0xc07f75=_[_0x4ee1('0x63')](_0x2bc05a);var _0x4315e9=_0x2bc05a===_0x4ee1('0x64')?_0x4ee1('0x77'):'Account';return db[_0x4ee1('0x78')][_0x4ee1('0x67')]({'raw':!![],'where':{'id':_0x13a755['params']['id'],'role':_0x4ee1('0x79')}})['then'](function(_0x5cf7fb){if(_[_0x4ee1('0x14')](_0x5cf7fb)){throw new Error(_0x4ee1('0x7a'));}_0x47b854=_0x5cf7fb;return db[_0xc07f75+_0x4ee1('0x69')][_0x4ee1('0x67')]({'where':{'id':_0x13a755[_0x4ee1('0x22')][_0x4ee1('0x6a')]},'include':[{'model':db[_0xc07f75+'Interaction'],'as':_0x4ee1('0x6b')},{'model':db[_0xc07f75+_0x4315e9],'as':_0x4ee1('0x65')}]});})[_0x4ee1('0x8')](function(_0x17ae2d){if(_[_0x4ee1('0x14')](_0x17ae2d)){throw new Error(_0xc07f75+_0x4ee1('0x7b'));}_0x1700c6=_0x17ae2d;return _0x17ae2d[_0x4ee1('0x6c')]({'read':0x0,'readAt':null,'UserId':null});})[_0x4ee1('0x8')](function(){var _0x5076c6={'uniqueid':_0x2bc05a+'.'+_0x1700c6['id']+'.'+_0x1700c6[_0x4ee1('0x6b')]['id'],'FromUserId':_0x13a755[_0x4ee1('0x31')]['id'],'type':_0x4ee1('0x6d'),'ToUserId':_0x47b854['id']};_0x5076c6[_0xc07f75+_0x4ee1('0x6e')]=_0x1700c6['id'];_0x5076c6[_0xc07f75+_0x4ee1('0x6f')]=_0x1700c6['Interaction']['id'];_0x5076c6[_0x4ee1('0x70')+_0xc07f75+_0x4315e9+'Id']=_0x1700c6['Account']['id'];return db[_0xc07f75+_0x4ee1('0x72')][_0x4ee1('0x73')](_0x5076c6);})[_0x4ee1('0x8')](function(){return respondWithRpcPromise(_0x4ee1('0x74'),{'channel':_0x2bc05a,'interaction':_0x1700c6['Interaction'],'message':_0x1700c6,'account':_0x1700c6[_0x4ee1('0x65')],'applications':[{'id':0x0,'priority':0x1,'app':_0x4ee1('0x79'),'appdata':_0x47b854['name']+','+(_0x1700c6[_0x4ee1('0x65')]['agentTransferTimeout']||0x12c),'interval':_0x4ee1('0x7c')}]},routingClient);})[_0x4ee1('0x8')](respondWithResult(_0x1a00a4,null))['catch'](handleError(_0x1a00a4,null));}; \ No newline at end of file +var _0xa41a=['name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','merge','params','catch','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','VoiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','interaction','hasOwnProperty','MemberReport','findAll','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','findOrCreate','user','INTERACTION','interface','SIP/%s','agent','AgentCapacity','capacity','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','showMailQueues','MailQueues','mailAccounts','OpenchannelQueues','showOpenchannelQueues','SmsQueues','showSmsQueues','whatsappQueues','showWhatsappQueues','WhatsappQueues','FaxQueues','showFaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','value','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Queue','findOne','\x20Queue\x20not\x20found','Interaction','update','MessageId','From','Account','QueueId','TransferReport','create','Start','queue','queueTransferTimeout','agentNotify','Channel\x20field\x20is\x20mandatory','channel','User','Agent\x20not\x20found','Message','messageId','\x20Message\x20not\x20found','agentTransferTimeout','*,*,*,*','bluebird','moment','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','result','status','json','sendStatus','stack'];(function(_0x9d4676,_0x3fa221){var _0x3cc17c=function(_0xfd7544){while(--_0xfd7544){_0x9d4676['push'](_0x9d4676['shift']());}};_0x3cc17c(++_0x3fa221);}(_0xa41a,0x6b));var _0xaa41=function(_0x23315f,_0x87e322){_0x23315f=_0x23315f-0x0;var _0x18707e=_0xa41a[_0x23315f];return _0x18707e;};'use strict';var BPromise=require(_0xaa41('0x0'));var moment=require(_0xaa41('0x1'));var _=require('lodash');var util=require(_0xaa41('0x2'));var db=require(_0xaa41('0x3'))['db'];var logger=require(_0xaa41('0x4'))(_0xaa41('0x5'));var jayson=require(_0xaa41('0x6'));var amiClient=jayson[_0xaa41('0x7')][_0xaa41('0x8')]({'port':0x232a});var mailClient=jayson[_0xaa41('0x7')]['http']({'port':0x232b});var routingClient=jayson[_0xaa41('0x7')][_0xaa41('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){var _0x31df43=_0x179545?_0x179545:amiClient;return _0x31df43[_0xaa41('0x9')](_0x54bc5a,_0x5b1fff)[_0xaa41('0xa')](function(_0x1cc344){if(_0x1cc344[_0xaa41('0xb')]){if(_0x1cc344[_0xaa41('0xb')][_0xaa41('0xc')]===0x1f4){return _0x588ab4(_0x1cc344[_0xaa41('0xb')][_0xaa41('0xd')]);}return _0x202cce(_0x1cc344['error'][_0xaa41('0xd')]);}else{_0x202cce(_0x1cc344[_0xaa41('0xe')]);}})['catch'](function(_0x54827c){_0x588ab4(_0x54827c);});});}function respondWithResult(_0x1d0a54,_0x518b5b){_0x518b5b=_0x518b5b||0xc8;return function(_0x19bd69){if(_0x19bd69){return _0x1d0a54[_0xaa41('0xf')](_0x518b5b)[_0xaa41('0x10')](_0x19bd69);}return _0x1d0a54[_0xaa41('0x11')](0x194);};}function handleError(_0x6f9ade,_0x4eaf81){_0x4eaf81=_0x4eaf81||0x1f4;return function(_0x1e9d7f){logger[_0xaa41('0xb')](_0x1e9d7f[_0xaa41('0x12')]);if(_0x1e9d7f[_0xaa41('0x13')]){delete _0x1e9d7f[_0xaa41('0x13')];}_0x6f9ade[_0xaa41('0xf')](_0x4eaf81)[_0xaa41('0x14')](_0x1e9d7f);};}function findById(_0x550ad5){return function(_0x2d868a){if(!_[_0xaa41('0x15')](_0x550ad5)&&!_[_0xaa41('0x15')](_0x2d868a)&&!_[_0xaa41('0x15')](_0x2d868a[_0xaa41('0x16')])){return _[_0xaa41('0x17')](_0x2d868a[_0xaa41('0x16')],function(_0x46e6d3){return _0x46e6d3['id']==_0x550ad5;});}return null;};}exports[_0xaa41('0x18')]=function(_0x4fe1a4,_0x5cd936){return respondWithRpcPromise(_0xaa41('0x19'),_0x4fe1a4[_0xaa41('0x1a')])[_0xaa41('0xa')](respondWithResult(_0x5cd936,null))['catch'](handleError(_0x5cd936,null));};exports[_0xaa41('0x1b')]=function(_0x1f692b,_0x4e768e){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0xaa41('0x1c')](_0x1f692b['query'],_0x1f692b[_0xaa41('0x1d')]))[_0xaa41('0xa')](respondWithResult(_0x4e768e,null))[_0xaa41('0x1e')](handleError(_0x4e768e,null));};exports[_0xaa41('0x1f')]=function(_0x1d623c,_0x4eb01f){return respondWithRpcPromise(_0xaa41('0x20'),_[_0xaa41('0x1c')](_0x1d623c[_0xaa41('0x1a')],_0x1d623c[_0xaa41('0x1d')]))[_0xaa41('0xa')](respondWithResult(_0x4eb01f,null))[_0xaa41('0x1e')](handleError(_0x4eb01f,null));};exports['voiceQueues']=function(_0x5795f4,_0x16aec5){return respondWithRpcPromise('VoiceQueues',_0x5795f4['query'])[_0xaa41('0xa')](respondWithResult(_0x16aec5,null))['catch'](handleError(_0x16aec5,null));};exports['showVoiceQueues']=function(_0x2d0ac0,_0x9c8c21){return respondWithRpcPromise(_0xaa41('0x21'),_0x2d0ac0[_0xaa41('0x1a')])[_0xaa41('0xa')](findById(_0x2d0ac0[_0xaa41('0x1d')]['id']))['then'](respondWithResult(_0x9c8c21,null))[_0xaa41('0x1e')](handleError(_0x9c8c21,null));};exports[_0xaa41('0x22')]=function(_0x63c18c,_0x9a16e3){return respondWithRpcPromise(_0xaa41('0x23'),_[_0xaa41('0x1c')](_0x63c18c[_0xaa41('0x24')],_0x63c18c[_0xaa41('0x1d')]))['then'](respondWithResult(_0x9a16e3,null))[_0xaa41('0x1e')](handleError(_0x9a16e3,null));};exports['voiceQueuesPreview']=function(_0x5dad80,_0x714537){return respondWithRpcPromise(_0xaa41('0x25'),_['merge'](_0x5dad80[_0xaa41('0x1a')],_0x5dad80[_0xaa41('0x1d')]))['then'](respondWithResult(_0x714537,null))['catch'](handleError(_0x714537,null));};exports['voiceQueuesChannels']=function(_0x1cf3da,_0x2f5cc0){return respondWithRpcPromise(_0xaa41('0x26'),_0x1cf3da[_0xaa41('0x1a')])['then'](respondWithResult(_0x2f5cc0,null))[_0xaa41('0x1e')](handleError(_0x2f5cc0,null));};exports[_0xaa41('0x27')]=function(_0x3e0204,_0x4de770){return respondWithRpcPromise(_0xaa41('0x28'),_[_0xaa41('0x1c')](_0x3e0204[_0xaa41('0x1a')],_0x3e0204['params']))[_0xaa41('0xa')](respondWithResult(_0x4de770,null))[_0xaa41('0x1e')](handleError(_0x4de770,null));};exports['voiceQueuesChannelHangup']=function(_0x23eb50,_0x13b6d4){return respondWithRpcPromise(_0xaa41('0x29'),_['merge'](_0x23eb50[_0xaa41('0x1a')],_0x23eb50['params']))[_0xaa41('0xa')](respondWithResult(_0x13b6d4,null))[_0xaa41('0x1e')](handleError(_0x13b6d4,null));};exports[_0xaa41('0x2a')]=function(_0x49b77a,_0x526377){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xaa41('0x1c')](_0x49b77a[_0xaa41('0x1a')],_0x49b77a[_0xaa41('0x1d')]))[_0xaa41('0xa')](respondWithResult(_0x526377,null))['catch'](handleError(_0x526377,null));};exports['outbound']=function(_0x267999,_0x5673c){return respondWithRpcPromise(_0xaa41('0x2b'),_0x267999[_0xaa41('0x1a')])[_0xaa41('0xa')](respondWithResult(_0x5673c,null))[_0xaa41('0x1e')](handleError(_0x5673c,null));};exports[_0xaa41('0x2c')]=function(_0x5e9879,_0x3adc28){return respondWithRpcPromise(_0xaa41('0x2d'),_0x5e9879[_0xaa41('0x1a')])[_0xaa41('0xa')](respondWithResult(_0x3adc28,null))['catch'](handleError(_0x3adc28,null));};exports['agents']=function(_0x42b759,_0x275fa3){var _0x5eae08;return respondWithRpcPromise(_0xaa41('0x2e'),_0x42b759['query'])[_0xaa41('0xa')](function(_0x25f2df){_0x5eae08=_0x25f2df;return respondWithRpcPromise(_0xaa41('0x2e'),_0x42b759[_0xaa41('0x1a')],routingClient);})[_0xaa41('0xa')](function(_0x12ba1a){return _[_0xaa41('0x1c')]({},_0x12ba1a,_0x5eae08);})[_0xaa41('0xa')](respondWithResult(_0x275fa3,null))['catch'](handleError(_0x275fa3,null));};exports[_0xaa41('0x2f')]=function(_0x2abf39,_0x35c685){if(_0x2abf39[_0xaa41('0x24')]&&_0x2abf39[_0xaa41('0x24')][_0xaa41('0x30')]&&_0x2abf39['user']&&_0x2abf39['user'][_0xaa41('0x13')]){for(var _0x4f9086 in _0x2abf39[_0xaa41('0x24')][_0xaa41('0x30')]){if(_0x2abf39[_0xaa41('0x24')][_0xaa41('0x30')][_0xaa41('0x31')](_0x4f9086)){db[_0xaa41('0x32')][_0xaa41('0x33')]({'where':{'channel':_0x4f9086,'membername':_0x2abf39['user'][_0xaa41('0x13')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x2abf39['body'][_0xaa41('0x30')][_0x4f9086]&&_0x2abf39['body']['interaction'][_0x4f9086]['length']?{'$notIn':_0x2abf39[_0xaa41('0x24')]['interaction'][_0x4f9086]}:{'$ne':null}}})[_0xaa41('0xa')](function(_0x198716){var _0x4a6882=moment()['format'](_0xaa41('0x34'));for(var _0x1b7b97=0x0,_0x1bb973=_0x198716[_0xaa41('0x35')];_0x1b7b97<_0x1bb973;_0x1b7b97+=0x1){_0x198716[_0x1b7b97][_0xaa41('0x36')]({'exitAt':_0x4a6882});}});for(var _0x337993=0x0;_0x337993<_0x2abf39[_0xaa41('0x24')][_0xaa41('0x30')][_0x4f9086][_0xaa41('0x35')];_0x337993+=0x1){db['MemberReport'][_0xaa41('0x37')]({'where':{'channel':_0x4f9086,'membername':_0x2abf39[_0xaa41('0x38')][_0xaa41('0x13')],'type':_0xaa41('0x39'),'uniqueid':_0x2abf39[_0xaa41('0x24')][_0xaa41('0x30')][_0x4f9086][_0x337993],'exitAt':null},'defaults':{'channel':_0x4f9086,'membername':_0x2abf39['user'][_0xaa41('0x13')],'interface':_[_0xaa41('0x15')](_0x2abf39[_0xaa41('0x38')][_0xaa41('0x3a')])?util['format'](_0xaa41('0x3b'),_0x2abf39['user']['name']):_0x2abf39[_0xaa41('0x38')][_0xaa41('0x3a')],'type':_0xaa41('0x39'),'enterAt':moment()['format'](_0xaa41('0x34')),'role':_0xaa41('0x3c'),'internal':_0x2abf39[_0xaa41('0x38')]['internal'],'uniqueid':_0x2abf39[_0xaa41('0x24')][_0xaa41('0x30')][_0x4f9086][_0x337993]}});}}}}return respondWithRpcPromise(_0xaa41('0x3d'),{'id':_0x2abf39[_0xaa41('0x1d')]['id'],'capacity':_0x2abf39[_0xaa41('0x24')][_0xaa41('0x3e')]},routingClient)[_0xaa41('0xa')](respondWithResult(_0x35c685,null))[_0xaa41('0x1e')](handleError(_0x35c685,null));};exports['telephones']=function(_0x9f0a81,_0x5bef5f){return respondWithRpcPromise('Telephones',_0x9f0a81[_0xaa41('0x1a')])[_0xaa41('0xa')](respondWithResult(_0x5bef5f,null))[_0xaa41('0x1e')](handleError(_0x5bef5f,null));};exports[_0xaa41('0x3f')]=function(_0x14aab0,_0x288db3){return respondWithRpcPromise(_0xaa41('0x40'),_0x14aab0[_0xaa41('0x1a')])['then'](respondWithResult(_0x288db3,null))[_0xaa41('0x1e')](handleError(_0x288db3,null));};exports[_0xaa41('0x41')]=function(_0x1d518f,_0x4f9e92){return respondWithRpcPromise(_0xaa41('0x42'),_0x1d518f[_0xaa41('0x1a')])['then'](respondWithResult(_0x4f9e92,null))[_0xaa41('0x1e')](handleError(_0x4f9e92,null));};exports[_0xaa41('0x43')]=function(_0x283b3b,_0x4e5a2e){return respondWithRpcPromise(_0xaa41('0x44'),_0x283b3b[_0xaa41('0x1a')],routingClient)['then'](respondWithResult(_0x4e5a2e,null))['catch'](handleError(_0x4e5a2e,null));};exports[_0xaa41('0x45')]=function(_0x3cd14f,_0x3a29d2){return respondWithRpcPromise('ChatQueues',_0x3cd14f[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](findById(_0x3cd14f[_0xaa41('0x1d')]['id']))[_0xaa41('0xa')](respondWithResult(_0x3a29d2,null))[_0xaa41('0x1e')](handleError(_0x3a29d2,null));};exports['mailQueues']=function(_0x2ae70c,_0x57cb70){return respondWithRpcPromise('MailQueues',_0x2ae70c[_0xaa41('0x1a')],routingClient)['then'](respondWithResult(_0x57cb70,null))[_0xaa41('0x1e')](handleError(_0x57cb70,null));};exports[_0xaa41('0x46')]=function(_0x169ddf,_0x5e83e1){return respondWithRpcPromise(_0xaa41('0x47'),_0x169ddf[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](findById(_0x169ddf[_0xaa41('0x1d')]['id']))[_0xaa41('0xa')](respondWithResult(_0x5e83e1,null))[_0xaa41('0x1e')](handleError(_0x5e83e1,null));};exports[_0xaa41('0x48')]=function(_0x337059,_0x3f91f3){return respondWithRpcPromise('MailAccounts',_0x337059[_0xaa41('0x1a')],mailClient)[_0xaa41('0xa')](respondWithResult(_0x3f91f3,null))[_0xaa41('0x1e')](handleError(_0x3f91f3,null));};exports['openchannelQueues']=function(_0x3fe47a,_0x2caf5c){return respondWithRpcPromise(_0xaa41('0x49'),_0x3fe47a[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](respondWithResult(_0x2caf5c,null))[_0xaa41('0x1e')](handleError(_0x2caf5c,null));};exports[_0xaa41('0x4a')]=function(_0x5ea056,_0x55a85c){return respondWithRpcPromise('OpenchannelQueues',_0x5ea056['query'],routingClient)['then'](findById(_0x5ea056['params']['id']))[_0xaa41('0xa')](respondWithResult(_0x55a85c,null))['catch'](handleError(_0x55a85c,null));};exports['smsQueues']=function(_0x24c6f3,_0x40a524){return respondWithRpcPromise(_0xaa41('0x4b'),_0x24c6f3[_0xaa41('0x1a')],routingClient)['then'](respondWithResult(_0x40a524,null))[_0xaa41('0x1e')](handleError(_0x40a524,null));};exports[_0xaa41('0x4c')]=function(_0x1ddb6c,_0x46822f){return respondWithRpcPromise(_0xaa41('0x4b'),_0x1ddb6c[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](findById(_0x1ddb6c[_0xaa41('0x1d')]['id']))[_0xaa41('0xa')](respondWithResult(_0x46822f,null))['catch'](handleError(_0x46822f,null));};exports[_0xaa41('0x4d')]=function(_0x2d2af8,_0x50170f){return respondWithRpcPromise('WhatsappQueues',_0x2d2af8['query'],routingClient)[_0xaa41('0xa')](respondWithResult(_0x50170f,null))['catch'](handleError(_0x50170f,null));};exports[_0xaa41('0x4e')]=function(_0x5c8028,_0x5423b6){return respondWithRpcPromise(_0xaa41('0x4f'),_0x5c8028['query'],routingClient)[_0xaa41('0xa')](findById(_0x5c8028[_0xaa41('0x1d')]['id']))[_0xaa41('0xa')](respondWithResult(_0x5423b6,null))[_0xaa41('0x1e')](handleError(_0x5423b6,null));};exports['faxQueues']=function(_0x5be61b,_0x339db3){return respondWithRpcPromise(_0xaa41('0x50'),_0x5be61b['query'],routingClient)['then'](respondWithResult(_0x339db3,null))[_0xaa41('0x1e')](handleError(_0x339db3,null));};exports[_0xaa41('0x51')]=function(_0x304694,_0xbeafb5){return respondWithRpcPromise(_0xaa41('0x50'),_0x304694['query'],routingClient)[_0xaa41('0xa')](findById(_0x304694['params']['id']))['then'](respondWithResult(_0xbeafb5,null))['catch'](handleError(_0xbeafb5,null));};exports[_0xaa41('0x52')]=function(_0x19ec63,_0x436362){return respondWithRpcPromise('FaxAccounts',_0x19ec63[_0xaa41('0x1a')])[_0xaa41('0xa')](respondWithResult(_0x436362,null))[_0xaa41('0x1e')](handleError(_0x436362,null));};exports[_0xaa41('0x53')]=function(_0x457515,_0x3ffbf8){return respondWithRpcPromise(_0xaa41('0x54'),_0x457515['query'],routingClient)[_0xaa41('0xa')](respondWithResult(_0x3ffbf8,null))[_0xaa41('0x1e')](handleError(_0x3ffbf8,null));};exports[_0xaa41('0x55')]=function(_0x175ca9,_0x51ff61){return respondWithRpcPromise(_0xaa41('0x56'),_0x175ca9['query'],routingClient)[_0xaa41('0xa')](respondWithResult(_0x51ff61,null))[_0xaa41('0x1e')](handleError(_0x51ff61,null));};exports[_0xaa41('0x57')]=function(_0x143ef0,_0x491cad){return respondWithRpcPromise(_0xaa41('0x58'),_0x143ef0[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](respondWithResult(_0x491cad,null))[_0xaa41('0x1e')](handleError(_0x491cad,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x140d78,_0x50197b){return respondWithRpcPromise(_0xaa41('0x58'),_0x140d78[_0xaa41('0x1a')],routingClient)['then'](function(_0x1ac05e){if(_0x140d78[_0xaa41('0x1a')][_0xaa41('0x59')]!==undefined){var _0x582d79=_(_0x1ac05e[_0xaa41('0x16')])[_0xaa41('0x5a')]([_0x140d78[_0xaa41('0x1a')][_0xaa41('0x59')],_0x140d78[_0xaa41('0x1d')]['id']])[_0xaa41('0x5b')](_0xaa41('0x5c'))['uniq']()[_0xaa41('0x5d')]();return _0x1ac05e[_0xaa41('0x16')][_0xaa41('0x5a')](function(_0x530982){return _0x582d79['indexOf'](_0x530982[_0xaa41('0x5c')])>-0x1;});}else{return _0x1ac05e[_0xaa41('0x16')]['filter'](function(_0x1ce957){return _0x1ce957[_0xaa41('0x5c')]===parseInt(_0x140d78['params']['id']);});}})[_0xaa41('0xa')](respondWithResult(_0x50197b,null))[_0xaa41('0x1e')](handleError(_0x50197b,null));};exports[_0xaa41('0x5e')]=function(_0xe8731,_0x46feb2){return respondWithRpcPromise(_0xaa41('0x5f'),_0xe8731[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](respondWithResult(_0x46feb2,null))['catch'](handleError(_0x46feb2,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x397526,_0x481db9){return respondWithRpcPromise(_0xaa41('0x60'),_0x397526[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](respondWithResult(_0x481db9,null))['catch'](handleError(_0x481db9,null));};exports[_0xaa41('0x61')]=function(_0x404c38,_0x2d7493){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x404c38[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](respondWithResult(_0x2d7493,null))['catch'](handleError(_0x2d7493,null));};exports[_0xaa41('0x62')]=function(_0x4de25c){return function(_0x53faf4,_0x3f6a2b){var _0x34d0e4,_0x5eded3;var _0x5a8cb0=_[_0xaa41('0x63')](_0x4de25c);var _0x1726ec=_0x4de25c===_0xaa41('0x64')?_0xaa41('0x65'):'Account';return db[_0x5a8cb0+_0xaa41('0x66')][_0xaa41('0x67')]({'raw':!![],'where':{'id':_0x53faf4[_0xaa41('0x1d')]['id']}})['then'](function(_0x1ad3aa){if(_[_0xaa41('0x15')](_0x1ad3aa)){throw new Error(_0x5a8cb0+_0xaa41('0x68'));}_0x34d0e4=_0x1ad3aa;return db[_0x5a8cb0+'Message'][_0xaa41('0x67')]({'where':{'id':_0x53faf4['body']['messageId']},'include':[{'model':db[_0x5a8cb0+_0xaa41('0x69')],'as':_0xaa41('0x69')},{'model':db[_0x5a8cb0+_0x1726ec],'as':'Account'}]});})[_0xaa41('0xa')](function(_0x9e8ebb){if(_[_0xaa41('0x15')](_0x9e8ebb)){throw new Error(_0x5a8cb0+'\x20Message\x20not\x20found');}_0x5eded3=_0x9e8ebb;return _0x9e8ebb[_0xaa41('0x6a')]({'read':0x0,'readAt':null,'UserId':null});})[_0xaa41('0xa')](function(){var _0x1a2deb={'uniqueid':_0x4de25c+'.'+_0x5eded3['id']+'.'+_0x5eded3[_0xaa41('0x69')]['id'],'FromUserId':_0x53faf4[_0xaa41('0x38')]['id'],'type':'queue'};_0x1a2deb[_0x5a8cb0+_0xaa41('0x6b')]=_0x5eded3['id'];_0x1a2deb[_0x5a8cb0+'InteractionId']=_0x5eded3[_0xaa41('0x69')]['id'];_0x1a2deb[_0xaa41('0x6c')+_0x5a8cb0+_0x1726ec+'Id']=_0x5eded3[_0xaa41('0x6d')]['id'];_0x1a2deb['To'+_0x5a8cb0+_0xaa41('0x6e')]=_0x34d0e4['id'];return db[_0x5a8cb0+_0xaa41('0x6f')][_0xaa41('0x70')](_0x1a2deb);})[_0xaa41('0xa')](function(){return respondWithRpcPromise(_0xaa41('0x71'),{'channel':_0x4de25c,'interaction':_0x5eded3[_0xaa41('0x69')],'message':_0x5eded3,'account':_0x5eded3[_0xaa41('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':_0xaa41('0x72'),'appdata':_0x34d0e4['name']+','+(_0x5eded3[_0xaa41('0x6d')][_0xaa41('0x73')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xaa41('0xa')](respondWithResult(_0x3f6a2b,null))['catch'](handleError(_0x3f6a2b,null));};};exports[_0xaa41('0x74')]=function(_0xb44b1f,_0x472eb3){var _0x38d759,_0x2dc55e;if(_[_0xaa41('0x15')](_0xb44b1f[_0xaa41('0x24')]['channel'])){throw new Error(_0xaa41('0x75'));}var _0x1d50db=_0xb44b1f[_0xaa41('0x24')][_0xaa41('0x76')];var _0x585ce7=_[_0xaa41('0x63')](_0x1d50db);var _0x5c9beb=_0x1d50db===_0xaa41('0x64')?_0xaa41('0x65'):_0xaa41('0x6d');return db[_0xaa41('0x77')][_0xaa41('0x67')]({'raw':!![],'where':{'id':_0xb44b1f['params']['id'],'role':_0xaa41('0x3c')}})[_0xaa41('0xa')](function(_0x5819ac){if(_[_0xaa41('0x15')](_0x5819ac)){throw new Error(_0xaa41('0x78'));}_0x38d759=_0x5819ac;return db[_0x585ce7+_0xaa41('0x79')][_0xaa41('0x67')]({'where':{'id':_0xb44b1f[_0xaa41('0x24')][_0xaa41('0x7a')]},'include':[{'model':db[_0x585ce7+_0xaa41('0x69')],'as':_0xaa41('0x69')},{'model':db[_0x585ce7+_0x5c9beb],'as':'Account'}]});})[_0xaa41('0xa')](function(_0x39d3cc){if(_[_0xaa41('0x15')](_0x39d3cc)){throw new Error(_0x585ce7+_0xaa41('0x7b'));}_0x2dc55e=_0x39d3cc;return _0x39d3cc[_0xaa41('0x6a')]({'read':0x0,'readAt':null,'UserId':null});})[_0xaa41('0xa')](function(){var _0x5489be={'uniqueid':_0x1d50db+'.'+_0x2dc55e['id']+'.'+_0x2dc55e['Interaction']['id'],'FromUserId':_0xb44b1f['user']['id'],'type':_0xaa41('0x72'),'ToUserId':_0x38d759['id']};_0x5489be[_0x585ce7+_0xaa41('0x6b')]=_0x2dc55e['id'];_0x5489be[_0x585ce7+'InteractionId']=_0x2dc55e[_0xaa41('0x69')]['id'];_0x5489be[_0xaa41('0x6c')+_0x585ce7+_0x5c9beb+'Id']=_0x2dc55e['Account']['id'];return db[_0x585ce7+_0xaa41('0x6f')][_0xaa41('0x70')](_0x5489be);})[_0xaa41('0xa')](function(){return respondWithRpcPromise(_0xaa41('0x71'),{'channel':_0x1d50db,'interaction':_0x2dc55e['Interaction'],'message':_0x2dc55e,'account':_0x2dc55e[_0xaa41('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x38d759[_0xaa41('0x13')]+','+(_0x2dc55e[_0xaa41('0x6d')][_0xaa41('0x7c')]||0x12c),'interval':_0xaa41('0x7d')}]},routingClient);})[_0xaa41('0xa')](respondWithResult(_0x472eb3,null))[_0xaa41('0x1e')](handleError(_0x472eb3,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 29ca6e7..56e07c7 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 _0xf1b4=['express','fs-extra','../../components/auth/service','../../components/interaction/service','./schedule.controller','get','/:id','isAuthenticated','/:id/run','run','post','put','update','delete','destroy','connect-timeout'];(function(_0x8ae98b,_0x155f88){var _0xc30bd4=function(_0x5ca462){while(--_0x5ca462){_0x8ae98b['push'](_0x8ae98b['shift']());}};_0xc30bd4(++_0x155f88);}(_0xf1b4,0x12f));var _0x4f1b=function(_0x909ff0,_0x2e74f2){_0x909ff0=_0x909ff0-0x0;var _0x4969b1=_0xf1b4[_0x909ff0];return _0x4969b1;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x4f1b('0x0'));var express=require(_0x4f1b('0x1'));var router=express['Router']();var fs_extra=require(_0x4f1b('0x2'));var auth=require(_0x4f1b('0x3'));var interaction=require(_0x4f1b('0x4'));var config=require('../../config/environment');var controller=require(_0x4f1b('0x5'));router[_0x4f1b('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4f1b('0x6')](_0x4f1b('0x7'),auth[_0x4f1b('0x8')](),controller['show']);router[_0x4f1b('0x6')](_0x4f1b('0x9'),auth[_0x4f1b('0x8')](),controller[_0x4f1b('0xa')]);router[_0x4f1b('0xb')]('/',auth[_0x4f1b('0x8')](),controller['create']);router[_0x4f1b('0xc')]('/:id',auth[_0x4f1b('0x8')](),controller[_0x4f1b('0xd')]);router[_0x4f1b('0xe')](_0x4f1b('0x7'),auth['isAuthenticated'](),controller[_0x4f1b('0xf')]);module['exports']=router; \ No newline at end of file +var _0xb16b=['create','put','update','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id','run','post'];(function(_0x28de70,_0x165ec6){var _0x3804c8=function(_0x40fb5d){while(--_0x40fb5d){_0x28de70['push'](_0x28de70['shift']());}};_0x3804c8(++_0x165ec6);}(_0xb16b,0xb9));var _0xbb16=function(_0x3ed95e,_0x2d2d13){_0x3ed95e=_0x3ed95e-0x0;var _0x4ab531=_0xb16b[_0x3ed95e];return _0x4ab531;};'use strict';var multer=require(_0xbb16('0x0'));var util=require(_0xbb16('0x1'));var path=require('path');var timeout=require(_0xbb16('0x2'));var express=require(_0xbb16('0x3'));var router=express['Router']();var fs_extra=require(_0xbb16('0x4'));var auth=require(_0xbb16('0x5'));var interaction=require(_0xbb16('0x6'));var config=require(_0xbb16('0x7'));var controller=require(_0xbb16('0x8'));router[_0xbb16('0x9')]('/',auth[_0xbb16('0xa')](),controller[_0xbb16('0xb')]);router[_0xbb16('0x9')](_0xbb16('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xbb16('0x9')]('/:id/run',auth[_0xbb16('0xa')](),controller[_0xbb16('0xd')]);router[_0xbb16('0xe')]('/',auth[_0xbb16('0xa')](),controller[_0xbb16('0xf')]);router[_0xbb16('0x10')]('/:id',auth[_0xbb16('0xa')](),controller[_0xbb16('0x11')]);router[_0xbb16('0x12')]('/:id',auth[_0xbb16('0xa')](),controller['destroy']);module[_0xbb16('0x13')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 54ec4fe..5ddad5c 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 _0xc9fc=['sequelize','exports','BOOLEAN','DATE','INTEGER','ENUM','years','quarters','months','weeks','days','hours','csv','pdf','custom','default','STRING','TEXT'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc9fc,0xea));var _0xcc9f=function(_0x42b1d2,_0x554895){_0x42b1d2=_0x42b1d2-0x0;var _0x2b48e9=_0xc9fc[_0x42b1d2];return _0x2b48e9;};'use strict';var Sequelize=require(_0xcc9f('0x0'));module[_0xcc9f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xcc9f('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0xcc9f('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0xcc9f('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xcc9f('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xcc9f('0x5')](_0xcc9f('0x6'),_0xcc9f('0x7'),_0xcc9f('0x8'),_0xcc9f('0x9'),_0xcc9f('0xa'),_0xcc9f('0xb'),'minutes'),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0xcc9f('0x5')](_0xcc9f('0xc'),_0xcc9f('0xd'),'xlsx'),'allowNull':![],'defaultValue':_0xcc9f('0xc')},'type':{'type':Sequelize[_0xcc9f('0x5')](_0xcc9f('0xe'),_0xcc9f('0xf')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0xcc9f('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xcc9f('0x10')]},'cc':{'type':Sequelize[_0xcc9f('0x11')]},'bcc':{'type':Sequelize[_0xcc9f('0x11')]},'sendIfEmpty':{'type':Sequelize[_0xcc9f('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0xacef=['csv','pdf','xlsx','custom','TEXT','sequelize','STRING','BOOLEAN','DATE','INTEGER','ENUM','quarters','days','hours'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0xacef,0xad));var _0xface=function(_0x3e21ba,_0xdb7951){_0x3e21ba=_0x3e21ba-0x0;var _0x38469c=_0xacef[_0x3e21ba];return _0x38469c;};'use strict';var Sequelize=require(_0xface('0x0'));module['exports']={'name':{'type':Sequelize[_0xface('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xface('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xface('0x1')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0xface('0x3')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xface('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xface('0x5')]('years',_0xface('0x6'),'months','weeks',_0xface('0x7'),_0xface('0x8'),'minutes'),'allowNull':![],'defaultValue':_0xface('0x7')},'output':{'type':Sequelize[_0xface('0x5')](_0xface('0x9'),_0xface('0xa'),_0xface('0xb')),'allowNull':![],'defaultValue':_0xface('0x9')},'type':{'type':Sequelize[_0xface('0x5')](_0xface('0xc'),'default'),'allowNull':![],'defaultValue':_0xface('0xc')},'sendMail':{'type':Sequelize[_0xface('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xface('0x1')]},'cc':{'type':Sequelize[_0xface('0xd')]},'bcc':{'type':Sequelize[_0xface('0xd')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 8aaa616..b5ad659 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 _0xefb6=['reject','save','update','destroy','Scheduler','UserProfileResource','then','stack','send','index','map','rawAttributes','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','Schedule','includeAll','findAll','show','params','include','find','catch','create','body','get','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0xefb6,0x135));var _0x6efb=function(_0xf26c2e,_0x56c3ea){_0xf26c2e=_0xf26c2e-0x0;var _0x46ecb4=_0xefb6[_0xf26c2e];return _0x46ecb4;};'use strict';var emlformat=require(_0x6efb('0x0'));var rimraf=require(_0x6efb('0x1'));var zipdir=require(_0x6efb('0x2'));var jsonpatch=require(_0x6efb('0x3'));var rp=require('request-promise');var moment=require(_0x6efb('0x4'));var BPromise=require(_0x6efb('0x5'));var Mustache=require(_0x6efb('0x6'));var util=require(_0x6efb('0x7'));var path=require(_0x6efb('0x8'));var sox=require(_0x6efb('0x9'));var csv=require('to-csv');var ejs=require(_0x6efb('0xa'));var fs=require('fs');var fs_extra=require(_0x6efb('0xb'));var _=require('lodash');var squel=require(_0x6efb('0xc'));var crypto=require(_0x6efb('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6efb('0xe'));var querystring=require('querystring');var Papa=require(_0x6efb('0xf'));var Redis=require(_0x6efb('0x10'));var authService=require(_0x6efb('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x6efb('0x12'));var hardwareService=require(_0x6efb('0x13'));var logger=require(_0x6efb('0x14'))('api');var utils=require(_0x6efb('0x15'));var config=require(_0x6efb('0x16'));var licenseUtil=require(_0x6efb('0x17'));var db=require(_0x6efb('0x18'))['db'];function respondWithStatusCode(_0x826c24,_0x3c9413){_0x3c9413=_0x3c9413||0xcc;return function(_0x2e635f){if(_0x2e635f){return _0x826c24[_0x6efb('0x19')](_0x3c9413);}return _0x826c24[_0x6efb('0x1a')](_0x3c9413)[_0x6efb('0x1b')]();};}function respondWithResult(_0xd538c2,_0x73eb99){_0x73eb99=_0x73eb99||0xc8;return function(_0x5447bb){if(_0x5447bb){return _0xd538c2[_0x6efb('0x1a')](_0x73eb99)['json'](_0x5447bb);}};}function respondWithFilteredResult(_0x28dbaa,_0x2c34d4){return function(_0x503b0e){if(_0x503b0e){var _0x4137e4=typeof _0x2c34d4['offset']===_0x6efb('0x1c')&&typeof _0x2c34d4[_0x6efb('0x1d')]===_0x6efb('0x1c');var _0x1af171=_0x503b0e[_0x6efb('0x1e')];var _0x4a5996=_0x4137e4?0x0:_0x2c34d4[_0x6efb('0x1f')];var _0x30f03e=_0x4137e4?_0x503b0e[_0x6efb('0x1e')]:_0x2c34d4[_0x6efb('0x1f')]+_0x2c34d4[_0x6efb('0x1d')];var _0x4e47e2;if(_0x30f03e>=_0x1af171){_0x30f03e=_0x1af171;_0x4e47e2=0xc8;}else{_0x4e47e2=0xce;}_0x28dbaa[_0x6efb('0x1a')](_0x4e47e2);return _0x28dbaa['set'](_0x6efb('0x20'),_0x4a5996+'-'+_0x30f03e+'/'+_0x1af171)[_0x6efb('0x21')](_0x503b0e);}return null;};}function patchUpdates(_0x56a12d){return function(_0x9b4b09){try{jsonpatch[_0x6efb('0x22')](_0x9b4b09,_0x56a12d,!![]);}catch(_0x3514e4){return BPromise[_0x6efb('0x23')](_0x3514e4);}return _0x9b4b09[_0x6efb('0x24')]();};}function saveUpdates(_0x52e97b,_0x87e136){return function(_0x36b8a2){if(_0x36b8a2){return _0x36b8a2[_0x6efb('0x25')](_0x52e97b)['then'](function(_0x515267){return _0x515267;});}return null;};}function removeEntity(_0x1acf56,_0x889629){return function(_0x58005a){if(_0x58005a){return _0x58005a[_0x6efb('0x26')]()['then'](function(){var _0xbada91=_0x58005a['get']({'plain':!![]});var _0x20ec4a=_0x6efb('0x27');return db[_0x6efb('0x28')][_0x6efb('0x26')]({'where':{'type':_0x20ec4a,'resourceId':_0xbada91['id']}})[_0x6efb('0x29')](function(){return _0x58005a;});})[_0x6efb('0x29')](function(){_0x1acf56['status'](0xcc)[_0x6efb('0x1b')]();});}};}function handleEntityNotFound(_0x5cc75a,_0x1edf54){return function(_0x47cdfe){if(!_0x47cdfe){_0x5cc75a[_0x6efb('0x19')](0x194);}return _0x47cdfe;};}function handleError(_0x50d0d6,_0x24b570){_0x24b570=_0x24b570||0x1f4;return function(_0x33fe95){logger['error'](_0x33fe95[_0x6efb('0x2a')]);if(_0x33fe95['name']){delete _0x33fe95['name'];}_0x50d0d6['status'](_0x24b570)[_0x6efb('0x2b')](_0x33fe95);};}exports[_0x6efb('0x2c')]=function(_0x104963,_0x53df69){var _0x5072c9={},_0x484654={},_0x5d8c9={'count':0x0,'rows':[]};var _0x53c44e=_[_0x6efb('0x2d')](db['Schedule'][_0x6efb('0x2e')],function(_0x59a0eb){return{'name':_0x59a0eb['fieldName'],'type':_0x59a0eb[_0x6efb('0x2f')][_0x6efb('0x30')]};});_0x484654[_0x6efb('0x31')]=_[_0x6efb('0x2d')](_0x53c44e,_0x6efb('0x32'));_0x484654[_0x6efb('0x33')]=_[_0x6efb('0x34')](_0x104963[_0x6efb('0x33')]);_0x484654[_0x6efb('0x35')]=_[_0x6efb('0x36')](_0x484654[_0x6efb('0x31')],_0x484654['query']);_0x5072c9[_0x6efb('0x37')]=_[_0x6efb('0x36')](_0x484654[_0x6efb('0x31')],qs[_0x6efb('0x38')](_0x104963[_0x6efb('0x33')][_0x6efb('0x38')]));_0x5072c9['attributes']=_0x5072c9[_0x6efb('0x37')][_0x6efb('0x39')]?_0x5072c9[_0x6efb('0x37')]:_0x484654[_0x6efb('0x31')];if(!_0x104963[_0x6efb('0x33')][_0x6efb('0x3a')]('nolimit')){_0x5072c9[_0x6efb('0x1d')]=qs[_0x6efb('0x1d')](_0x104963['query'][_0x6efb('0x1d')]);_0x5072c9[_0x6efb('0x1f')]=qs['offset'](_0x104963[_0x6efb('0x33')]['offset']);}_0x5072c9[_0x6efb('0x3b')]=qs[_0x6efb('0x3c')](_0x104963['query'][_0x6efb('0x3c')]);_0x5072c9[_0x6efb('0x3d')]=qs['filters'](_[_0x6efb('0x3e')](_0x104963[_0x6efb('0x33')],_0x484654[_0x6efb('0x35')]),_0x53c44e);if(_0x104963[_0x6efb('0x33')][_0x6efb('0x3f')]){_0x5072c9[_0x6efb('0x3d')]=_[_0x6efb('0x40')](_0x5072c9[_0x6efb('0x3d')],{'$or':_[_0x6efb('0x2d')](_0x53c44e,function(_0x5ee87e){if(_0x5ee87e['type']!==_0x6efb('0x41')){var _0x31550c={};_0x31550c[_0x5ee87e['name']]={'$like':'%'+_0x104963['query'][_0x6efb('0x3f')]+'%'};return _0x31550c;}})});}_0x5072c9=_[_0x6efb('0x40')]({},_0x5072c9,_0x104963[_0x6efb('0x42')]);var _0x5d38a0={'where':_0x5072c9[_0x6efb('0x3d')]};return db[_0x6efb('0x43')][_0x6efb('0x1e')](_0x5d38a0)[_0x6efb('0x29')](function(_0x4c66b7){_0x5d8c9[_0x6efb('0x1e')]=_0x4c66b7;if(_0x104963[_0x6efb('0x33')][_0x6efb('0x44')]){_0x5072c9['include']=[{'all':!![]}];}return db[_0x6efb('0x43')][_0x6efb('0x45')](_0x5072c9);})[_0x6efb('0x29')](function(_0x123b0e){_0x5d8c9['rows']=_0x123b0e;return _0x5d8c9;})[_0x6efb('0x29')](respondWithFilteredResult(_0x53df69,_0x5072c9))['catch'](handleError(_0x53df69,null));};exports[_0x6efb('0x46')]=function(_0x24e452,_0x1c26f9){var _0x160997={'raw':![],'where':{'id':_0x24e452[_0x6efb('0x47')]['id']}},_0x160f46={};_0x160f46['model']=_['keys'](db[_0x6efb('0x43')][_0x6efb('0x2e')]);_0x160f46[_0x6efb('0x33')]=_[_0x6efb('0x34')](_0x24e452['query']);_0x160f46[_0x6efb('0x35')]=_[_0x6efb('0x36')](_0x160f46[_0x6efb('0x31')],_0x160f46['query']);_0x160997[_0x6efb('0x37')]=_[_0x6efb('0x36')](_0x160f46['model'],qs[_0x6efb('0x38')](_0x24e452[_0x6efb('0x33')]['fields']));_0x160997[_0x6efb('0x37')]=_0x160997['attributes'][_0x6efb('0x39')]?_0x160997[_0x6efb('0x37')]:_0x160f46['model'];if(_0x24e452[_0x6efb('0x33')][_0x6efb('0x44')]){_0x160997[_0x6efb('0x48')]=[{'all':!![]}];}_0x160997=_['merge']({},_0x160997,_0x24e452[_0x6efb('0x42')]);return db[_0x6efb('0x43')][_0x6efb('0x49')](_0x160997)[_0x6efb('0x29')](handleEntityNotFound(_0x1c26f9,null))[_0x6efb('0x29')](respondWithResult(_0x1c26f9,null))[_0x6efb('0x4a')](handleError(_0x1c26f9,null));};exports[_0x6efb('0x4b')]=function(_0x36ff9b,_0xf973c8){return db[_0x6efb('0x43')][_0x6efb('0x4b')](_0x36ff9b[_0x6efb('0x4c')],{})[_0x6efb('0x29')](function(_0xde50f6){var _0x3a430f=_0x36ff9b['user'][_0x6efb('0x4d')]({'plain':!![]});if(!_0x3a430f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3a430f[_0x6efb('0x4e')]===_0x6efb('0x4f')){var _0x3b19a5=_0xde50f6[_0x6efb('0x4d')]({'plain':!![]});var _0x3643cb='Scheduler';return db[_0x6efb('0x50')]['find']({'where':{'name':_0x3643cb,'userProfileId':_0x3a430f[_0x6efb('0x51')]},'raw':!![]})['then'](function(_0x1a65bd){if(_0x1a65bd&&_0x1a65bd[_0x6efb('0x52')]===0x0){return db[_0x6efb('0x28')][_0x6efb('0x4b')]({'name':_0x3b19a5[_0x6efb('0x32')],'resourceId':_0x3b19a5['id'],'type':_0x1a65bd[_0x6efb('0x32')],'sectionId':_0x1a65bd['id']},{})[_0x6efb('0x29')](function(){return _0xde50f6;});}else{return _0xde50f6;}})[_0x6efb('0x4a')](function(_0x5c68fe){logger['error'](_0x6efb('0x53'),_0x5c68fe);throw _0x5c68fe;});}return _0xde50f6;})['then'](respondWithResult(_0xf973c8,0xc9))['catch'](handleError(_0xf973c8,null));};exports[_0x6efb('0x25')]=function(_0x33db07,_0x4b1632){if(_0x33db07[_0x6efb('0x4c')]['id']){delete _0x33db07[_0x6efb('0x4c')]['id'];}return db[_0x6efb('0x43')][_0x6efb('0x49')]({'where':{'id':_0x33db07[_0x6efb('0x47')]['id']}})[_0x6efb('0x29')](handleEntityNotFound(_0x4b1632,null))[_0x6efb('0x29')](saveUpdates(_0x33db07[_0x6efb('0x4c')],null))[_0x6efb('0x29')](respondWithResult(_0x4b1632,null))[_0x6efb('0x4a')](handleError(_0x4b1632,null));};exports['destroy']=function(_0x4156ab,_0x3633f6){return db[_0x6efb('0x43')]['find']({'where':{'id':_0x4156ab[_0x6efb('0x47')]['id']}})[_0x6efb('0x29')](handleEntityNotFound(_0x3633f6,null))['then'](removeEntity(_0x3633f6,null))['catch'](handleError(_0x3633f6,null));};exports[_0x6efb('0x54')]=function(_0x17846,_0x31c8fa,_0x1c9791){var _0x50d2ce=require(_0x6efb('0x55'));return db[_0x6efb('0x43')][_0x6efb('0x49')]({'where':{'id':_0x17846['params']['id']},'raw':!![]})[_0x6efb('0x29')](handleEntityNotFound(_0x31c8fa,null))[_0x6efb('0x29')](function(){_0x50d2ce[_0x6efb('0x54')](_0x17846[_0x6efb('0x47')]['id']);})[_0x6efb('0x29')](respondWithStatusCode(_0x31c8fa,null))[_0x6efb('0x4a')](handleError(_0x31c8fa,null));}; \ No newline at end of file +var _0x3bd0=['keys','query','filters','attributes','intersection','fields','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Scheduler','autoAssociation','body','run','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','count','Content-Range','save','then','destroy','UserProfileResource','stack','name','send','index','map','Schedule','rawAttributes','type','key','model'];(function(_0x4de9e8,_0x565ffa){var _0x4db0de=function(_0x12279d){while(--_0x12279d){_0x4de9e8['push'](_0x4de9e8['shift']());}};_0x4db0de(++_0x565ffa);}(_0x3bd0,0x102));var _0x03bd=function(_0x113afc,_0x2c7d5a){_0x113afc=_0x113afc-0x0;var _0x3a9219=_0x3bd0[_0x113afc];return _0x3a9219;};'use strict';var emlformat=require(_0x03bd('0x0'));var rimraf=require(_0x03bd('0x1'));var zipdir=require(_0x03bd('0x2'));var jsonpatch=require(_0x03bd('0x3'));var rp=require(_0x03bd('0x4'));var moment=require(_0x03bd('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x03bd('0x6'));var util=require(_0x03bd('0x7'));var path=require(_0x03bd('0x8'));var sox=require(_0x03bd('0x9'));var csv=require(_0x03bd('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x03bd('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x03bd('0xc'));var deskjs=require(_0x03bd('0xd'));var toCsv=require(_0x03bd('0xa'));var querystring=require('querystring');var Papa=require(_0x03bd('0xe'));var Redis=require('ioredis');var authService=require(_0x03bd('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x03bd('0x10'));var hardwareService=require(_0x03bd('0x11'));var logger=require(_0x03bd('0x12'))('api');var utils=require(_0x03bd('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x03bd('0x14'));var db=require(_0x03bd('0x15'))['db'];function respondWithStatusCode(_0x45e827,_0x439d29){_0x439d29=_0x439d29||0xcc;return function(_0x5a3c3d){if(_0x5a3c3d){return _0x45e827['sendStatus'](_0x439d29);}return _0x45e827[_0x03bd('0x16')](_0x439d29)[_0x03bd('0x17')]();};}function respondWithResult(_0x1e1d34,_0x2503bb){_0x2503bb=_0x2503bb||0xc8;return function(_0x3383b2){if(_0x3383b2){return _0x1e1d34[_0x03bd('0x16')](_0x2503bb)[_0x03bd('0x18')](_0x3383b2);}};}function respondWithFilteredResult(_0x44cfcc,_0x3eb5f0){return function(_0x30e580){if(_0x30e580){var _0x816b6=typeof _0x3eb5f0[_0x03bd('0x19')]==='undefined'&&typeof _0x3eb5f0['limit']==='undefined';var _0x50d502=_0x30e580[_0x03bd('0x1a')];var _0x5a9cf0=_0x816b6?0x0:_0x3eb5f0['offset'];var _0x250e11=_0x816b6?_0x30e580['count']:_0x3eb5f0[_0x03bd('0x19')]+_0x3eb5f0['limit'];var _0x215caa;if(_0x250e11>=_0x50d502){_0x250e11=_0x50d502;_0x215caa=0xc8;}else{_0x215caa=0xce;}_0x44cfcc[_0x03bd('0x16')](_0x215caa);return _0x44cfcc['set'](_0x03bd('0x1b'),_0x5a9cf0+'-'+_0x250e11+'/'+_0x50d502)[_0x03bd('0x18')](_0x30e580);}return null;};}function patchUpdates(_0x299f4b){return function(_0xcb91fd){try{jsonpatch['apply'](_0xcb91fd,_0x299f4b,!![]);}catch(_0x20359d){return BPromise['reject'](_0x20359d);}return _0xcb91fd[_0x03bd('0x1c')]();};}function saveUpdates(_0x1d4278,_0x144ad5){return function(_0x10ed2a){if(_0x10ed2a){return _0x10ed2a['update'](_0x1d4278)[_0x03bd('0x1d')](function(_0x1f4ce6){return _0x1f4ce6;});}return null;};}function removeEntity(_0x4a6043,_0x19f1c7){return function(_0x154760){if(_0x154760){return _0x154760[_0x03bd('0x1e')]()[_0x03bd('0x1d')](function(){var _0x49f3ab=_0x154760['get']({'plain':!![]});var _0xda63a7='Scheduler';return db[_0x03bd('0x1f')][_0x03bd('0x1e')]({'where':{'type':_0xda63a7,'resourceId':_0x49f3ab['id']}})['then'](function(){return _0x154760;});})['then'](function(){_0x4a6043[_0x03bd('0x16')](0xcc)[_0x03bd('0x17')]();});}};}function handleEntityNotFound(_0x51c765,_0x414eba){return function(_0x5e2736){if(!_0x5e2736){_0x51c765['sendStatus'](0x194);}return _0x5e2736;};}function handleError(_0x39a5db,_0x462d77){_0x462d77=_0x462d77||0x1f4;return function(_0x534ab7){logger['error'](_0x534ab7[_0x03bd('0x20')]);if(_0x534ab7[_0x03bd('0x21')]){delete _0x534ab7[_0x03bd('0x21')];}_0x39a5db[_0x03bd('0x16')](_0x462d77)[_0x03bd('0x22')](_0x534ab7);};}exports[_0x03bd('0x23')]=function(_0x44fad9,_0x512af8){var _0x1f5ad8={},_0x43dced={},_0x409d7f={'count':0x0,'rows':[]};var _0x23f87e=_[_0x03bd('0x24')](db[_0x03bd('0x25')][_0x03bd('0x26')],function(_0x46f0ff){return{'name':_0x46f0ff['fieldName'],'type':_0x46f0ff[_0x03bd('0x27')][_0x03bd('0x28')]};});_0x43dced[_0x03bd('0x29')]=_[_0x03bd('0x24')](_0x23f87e,_0x03bd('0x21'));_0x43dced['query']=_[_0x03bd('0x2a')](_0x44fad9[_0x03bd('0x2b')]);_0x43dced[_0x03bd('0x2c')]=_['intersection'](_0x43dced[_0x03bd('0x29')],_0x43dced[_0x03bd('0x2b')]);_0x1f5ad8[_0x03bd('0x2d')]=_[_0x03bd('0x2e')](_0x43dced[_0x03bd('0x29')],qs[_0x03bd('0x2f')](_0x44fad9[_0x03bd('0x2b')][_0x03bd('0x2f')]));_0x1f5ad8[_0x03bd('0x2d')]=_0x1f5ad8[_0x03bd('0x2d')]['length']?_0x1f5ad8[_0x03bd('0x2d')]:_0x43dced['model'];if(!_0x44fad9[_0x03bd('0x2b')]['hasOwnProperty'](_0x03bd('0x30'))){_0x1f5ad8[_0x03bd('0x31')]=qs['limit'](_0x44fad9['query'][_0x03bd('0x31')]);_0x1f5ad8[_0x03bd('0x19')]=qs[_0x03bd('0x19')](_0x44fad9[_0x03bd('0x2b')][_0x03bd('0x19')]);}_0x1f5ad8[_0x03bd('0x32')]=qs[_0x03bd('0x33')](_0x44fad9[_0x03bd('0x2b')]['sort']);_0x1f5ad8[_0x03bd('0x34')]=qs['filters'](_[_0x03bd('0x35')](_0x44fad9[_0x03bd('0x2b')],_0x43dced[_0x03bd('0x2c')]),_0x23f87e);if(_0x44fad9[_0x03bd('0x2b')][_0x03bd('0x36')]){_0x1f5ad8['where']=_[_0x03bd('0x37')](_0x1f5ad8[_0x03bd('0x34')],{'$or':_[_0x03bd('0x24')](_0x23f87e,function(_0xe101f1){if(_0xe101f1[_0x03bd('0x27')]!==_0x03bd('0x38')){var _0x57f5a2={};_0x57f5a2[_0xe101f1['name']]={'$like':'%'+_0x44fad9[_0x03bd('0x2b')][_0x03bd('0x36')]+'%'};return _0x57f5a2;}})});}_0x1f5ad8=_[_0x03bd('0x37')]({},_0x1f5ad8,_0x44fad9[_0x03bd('0x39')]);var _0x5ac585={'where':_0x1f5ad8[_0x03bd('0x34')]};return db[_0x03bd('0x25')][_0x03bd('0x1a')](_0x5ac585)[_0x03bd('0x1d')](function(_0x2f5be9){_0x409d7f[_0x03bd('0x1a')]=_0x2f5be9;if(_0x44fad9['query'][_0x03bd('0x3a')]){_0x1f5ad8[_0x03bd('0x3b')]=[{'all':!![]}];}return db[_0x03bd('0x25')][_0x03bd('0x3c')](_0x1f5ad8);})['then'](function(_0x260d09){_0x409d7f[_0x03bd('0x3d')]=_0x260d09;return _0x409d7f;})['then'](respondWithFilteredResult(_0x512af8,_0x1f5ad8))[_0x03bd('0x3e')](handleError(_0x512af8,null));};exports['show']=function(_0x402e57,_0x2578d1){var _0x42cbb3={'raw':![],'where':{'id':_0x402e57[_0x03bd('0x3f')]['id']}},_0x2f216d={};_0x2f216d[_0x03bd('0x29')]=_[_0x03bd('0x2a')](db[_0x03bd('0x25')]['rawAttributes']);_0x2f216d[_0x03bd('0x2b')]=_[_0x03bd('0x2a')](_0x402e57['query']);_0x2f216d[_0x03bd('0x2c')]=_['intersection'](_0x2f216d[_0x03bd('0x29')],_0x2f216d[_0x03bd('0x2b')]);_0x42cbb3[_0x03bd('0x2d')]=_[_0x03bd('0x2e')](_0x2f216d['model'],qs['fields'](_0x402e57[_0x03bd('0x2b')][_0x03bd('0x2f')]));_0x42cbb3[_0x03bd('0x2d')]=_0x42cbb3[_0x03bd('0x2d')][_0x03bd('0x40')]?_0x42cbb3[_0x03bd('0x2d')]:_0x2f216d[_0x03bd('0x29')];if(_0x402e57['query']['includeAll']){_0x42cbb3['include']=[{'all':!![]}];}_0x42cbb3=_['merge']({},_0x42cbb3,_0x402e57[_0x03bd('0x39')]);return db[_0x03bd('0x25')][_0x03bd('0x41')](_0x42cbb3)[_0x03bd('0x1d')](handleEntityNotFound(_0x2578d1,null))['then'](respondWithResult(_0x2578d1,null))['catch'](handleError(_0x2578d1,null));};exports['create']=function(_0x5d7753,_0x4c9f10){return db[_0x03bd('0x25')][_0x03bd('0x42')](_0x5d7753['body'],{})[_0x03bd('0x1d')](function(_0x1950ad){var _0x884f6d=_0x5d7753[_0x03bd('0x43')]['get']({'plain':!![]});if(!_0x884f6d)throw new Error(_0x03bd('0x44'));if(_0x884f6d[_0x03bd('0x45')]==='user'){var _0x11db3a=_0x1950ad[_0x03bd('0x46')]({'plain':!![]});var _0x13c7f2=_0x03bd('0x47');return db['UserProfileSection'][_0x03bd('0x41')]({'where':{'name':_0x13c7f2,'userProfileId':_0x884f6d['userProfileId']},'raw':!![]})[_0x03bd('0x1d')](function(_0x51ac46){if(_0x51ac46&&_0x51ac46[_0x03bd('0x48')]===0x0){return db[_0x03bd('0x1f')][_0x03bd('0x42')]({'name':_0x11db3a[_0x03bd('0x21')],'resourceId':_0x11db3a['id'],'type':_0x51ac46[_0x03bd('0x21')],'sectionId':_0x51ac46['id']},{})['then'](function(){return _0x1950ad;});}else{return _0x1950ad;}})[_0x03bd('0x3e')](function(_0x27126e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x27126e);throw _0x27126e;});}return _0x1950ad;})[_0x03bd('0x1d')](respondWithResult(_0x4c9f10,0xc9))[_0x03bd('0x3e')](handleError(_0x4c9f10,null));};exports['update']=function(_0x40e41b,_0x1e7737){if(_0x40e41b[_0x03bd('0x49')]['id']){delete _0x40e41b[_0x03bd('0x49')]['id'];}return db['Schedule'][_0x03bd('0x41')]({'where':{'id':_0x40e41b[_0x03bd('0x3f')]['id']}})[_0x03bd('0x1d')](handleEntityNotFound(_0x1e7737,null))[_0x03bd('0x1d')](saveUpdates(_0x40e41b['body'],null))[_0x03bd('0x1d')](respondWithResult(_0x1e7737,null))['catch'](handleError(_0x1e7737,null));};exports['destroy']=function(_0x2dd72a,_0x33eab0){return db[_0x03bd('0x25')]['find']({'where':{'id':_0x2dd72a[_0x03bd('0x3f')]['id']}})[_0x03bd('0x1d')](handleEntityNotFound(_0x33eab0,null))[_0x03bd('0x1d')](removeEntity(_0x33eab0,null))[_0x03bd('0x3e')](handleError(_0x33eab0,null));};exports['run']=function(_0x5c9c98,_0x26010f,_0x55d158){var _0x37c30f=require('../../config/schedule');return db[_0x03bd('0x25')][_0x03bd('0x41')]({'where':{'id':_0x5c9c98['params']['id']},'raw':!![]})[_0x03bd('0x1d')](handleEntityNotFound(_0x26010f,null))[_0x03bd('0x1d')](function(){_0x37c30f[_0x03bd('0x4a')](_0x5c9c98['params']['id']);})[_0x03bd('0x1d')](respondWithStatusCode(_0x26010f,null))[_0x03bd('0x3e')](handleError(_0x26010f,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index eac1609..b76fbb1 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 _0x1171=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule','tools_schedules','lodash','util','../../config/logger'];(function(_0x28c3aa,_0x463307){var _0x4d0ede=function(_0x1c5a53){while(--_0x1c5a53){_0x28c3aa['push'](_0x28c3aa['shift']());}};_0x4d0ede(++_0x463307);}(_0x1171,0xcf));var _0x1117=function(_0x45c0da,_0x4f9492){_0x45c0da=_0x45c0da-0x0;var _0x51efff=_0x1171[_0x45c0da];return _0x51efff;};'use strict';var _=require(_0x1117('0x0'));var util=require(_0x1117('0x1'));var logger=require(_0x1117('0x2'))('api');var moment=require(_0x1117('0x3'));var BPromise=require(_0x1117('0x4'));var rp=require(_0x1117('0x5'));var fs=require('fs');var path=require(_0x1117('0x6'));var rimraf=require(_0x1117('0x7'));var config=require(_0x1117('0x8'));var attributes=require(_0x1117('0x9'));module[_0x1117('0xa')]=function(_0x30a4b0,_0x54e09b){return _0x30a4b0[_0x1117('0xb')](_0x1117('0xc'),attributes,{'tableName':_0x1117('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xadf3=['util','api','moment','request-promise','path','rimraf','exports','Schedule','tools_schedules'];(function(_0x1778b5,_0x1e97c3){var _0x5c6a3d=function(_0x127f0b){while(--_0x127f0b){_0x1778b5['push'](_0x1778b5['shift']());}};_0x5c6a3d(++_0x1e97c3);}(_0xadf3,0x1ef));var _0x3adf=function(_0x169b2f,_0xf19aa8){_0x169b2f=_0x169b2f-0x0;var _0x4069a9=_0xadf3[_0x169b2f];return _0x4069a9;};'use strict';var _=require('lodash');var util=require(_0x3adf('0x0'));var logger=require('../../config/logger')(_0x3adf('0x1'));var moment=require(_0x3adf('0x2'));var BPromise=require('bluebird');var rp=require(_0x3adf('0x3'));var fs=require('fs');var path=require(_0x3adf('0x4'));var rimraf=require(_0x3adf('0x5'));var config=require('../../config/environment');var attributes=require('./schedule.attributes');module[_0x3adf('0x6')]=function(_0x666bb6,_0x557b78){return _0x666bb6['define'](_0x3adf('0x7'),attributes,{'tableName':_0x3adf('0x8'),'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 a444705..2bf9526 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 _0x3882=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Schedule,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring'];(function(_0x5c84a6,_0xa1d637){var _0x37de3a=function(_0x404b37){while(--_0x404b37){_0x5c84a6['push'](_0x5c84a6['shift']());}};_0x37de3a(++_0xa1d637);}(_0x3882,0x183));var _0x2388=function(_0x409ab7,_0x554b51){_0x409ab7=_0x409ab7-0x0;var _0x32727b=_0x3882[_0x409ab7];return _0x32727b;};'use strict';var _=require(_0x2388('0x0'));var util=require(_0x2388('0x1'));var moment=require(_0x2388('0x2'));var BPromise=require('bluebird');var rs=require(_0x2388('0x3'));var fs=require('fs');var Redis=require(_0x2388('0x4'));var db=require(_0x2388('0x5'))['db'];var utils=require(_0x2388('0x6'));var logger=require('../../config/logger')(_0x2388('0x7'));var config=require(_0x2388('0x8'));var jayson=require(_0x2388('0x9'));var client=jayson[_0x2388('0xa')][_0x2388('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x332e8e,_0x2d0e50,_0x4b2153){return new BPromise(function(_0x2abb60,_0x52f173){return client[_0x2388('0xc')](_0x332e8e,_0x4b2153)[_0x2388('0xd')](function(_0x123695){logger[_0x2388('0xe')](_0x2388('0xf'),_0x2d0e50,'request\x20sent');logger[_0x2388('0x10')]('Schedule,\x20%s,\x20%s,\x20%s',_0x2d0e50,'request\x20sent',JSON['stringify'](_0x123695));if(_0x123695['error']){if(_0x123695[_0x2388('0x11')][_0x2388('0x12')]===0x1f4){logger[_0x2388('0x11')]('Schedule,\x20%s,\x20%s',_0x2d0e50,_0x123695[_0x2388('0x11')][_0x2388('0x13')]);return _0x52f173(_0x123695[_0x2388('0x11')][_0x2388('0x13')]);}logger[_0x2388('0x11')](_0x2388('0xf'),_0x2d0e50,_0x123695[_0x2388('0x11')]['message']);return _0x2abb60(_0x123695[_0x2388('0x11')][_0x2388('0x13')]);}else{logger[_0x2388('0xe')]('Schedule,\x20%s,\x20%s',_0x2d0e50,_0x2388('0x14'));_0x2abb60(_0x123695[_0x2388('0x15')]['message']);}})[_0x2388('0x16')](function(_0x517a96){logger[_0x2388('0x11')](_0x2388('0xf'),_0x2d0e50,_0x517a96);_0x52f173(_0x517a96);});});} \ No newline at end of file +var _0xc757=['message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','then','Schedule,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x2655ea,_0x47c38a){var _0x468708=function(_0x53889b){while(--_0x53889b){_0x2655ea['push'](_0x2655ea['shift']());}};_0x468708(++_0x47c38a);}(_0xc757,0x16b));var _0x7c75=function(_0xbca37a,_0x3df07c){_0xbca37a=_0xbca37a-0x0;var _0x2c438c=_0xc757[_0xbca37a];return _0x2c438c;};'use strict';var _=require('lodash');var util=require(_0x7c75('0x0'));var moment=require(_0x7c75('0x1'));var BPromise=require(_0x7c75('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7c75('0x3'));var db=require(_0x7c75('0x4'))['db'];var utils=require(_0x7c75('0x5'));var logger=require(_0x7c75('0x6'))('rpc');var config=require(_0x7c75('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7c75('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f3e1f,_0x24bf54,_0x48cc56){return new BPromise(function(_0x1bfb80,_0x25cb9c){return client['request'](_0x3f3e1f,_0x48cc56)[_0x7c75('0x9')](function(_0xd64e0c){logger['info'](_0x7c75('0xa'),_0x24bf54,_0x7c75('0xb'));logger['debug']('Schedule,\x20%s,\x20%s,\x20%s',_0x24bf54,'request\x20sent',JSON[_0x7c75('0xc')](_0xd64e0c));if(_0xd64e0c['error']){if(_0xd64e0c[_0x7c75('0xd')][_0x7c75('0xe')]===0x1f4){logger[_0x7c75('0xd')](_0x7c75('0xa'),_0x24bf54,_0xd64e0c[_0x7c75('0xd')][_0x7c75('0xf')]);return _0x25cb9c(_0xd64e0c[_0x7c75('0xd')][_0x7c75('0xf')]);}logger[_0x7c75('0xd')](_0x7c75('0xa'),_0x24bf54,_0xd64e0c['error'][_0x7c75('0xf')]);return _0x1bfb80(_0xd64e0c[_0x7c75('0xd')]['message']);}else{logger['info']('Schedule,\x20%s,\x20%s',_0x24bf54,_0x7c75('0xb'));_0x1bfb80(_0xd64e0c[_0x7c75('0x10')][_0x7c75('0xf')]);}})[_0x7c75('0x11')](function(_0x21fb5c){logger[_0x7c75('0xd')]('Schedule,\x20%s,\x20%s',_0x24bf54,_0x21fb5c);_0x25cb9c(_0x21fb5c);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 9e9ced7..ab06670 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 _0x3640=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x5b961f,_0x1deaea){var _0x2dc936=function(_0x1784e8){while(--_0x1784e8){_0x5b961f['push'](_0x5b961f['shift']());}};_0x2dc936(++_0x1deaea);}(_0x3640,0x67));var _0x0364=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0x3640[_0x342700];return _0x53406f;};'use strict';var multer=require(_0x0364('0x0'));var util=require(_0x0364('0x1'));var path=require(_0x0364('0x2'));var timeout=require(_0x0364('0x3'));var express=require('express');var router=express[_0x0364('0x4')]();var fs_extra=require(_0x0364('0x5'));var auth=require(_0x0364('0x6'));var interaction=require(_0x0364('0x7'));var config=require(_0x0364('0x8'));var controller=require(_0x0364('0x9'));router[_0x0364('0xa')]('/',auth[_0x0364('0xb')](),controller[_0x0364('0xc')]);router[_0x0364('0xa')](_0x0364('0xd'),auth[_0x0364('0xb')](),controller[_0x0364('0xe')]);router['get'](_0x0364('0xf'),auth[_0x0364('0xb')](),controller[_0x0364('0x10')]);router[_0x0364('0xa')]('/:id/download',auth[_0x0364('0xb')](),controller['download']);router[_0x0364('0x11')]('/',auth[_0x0364('0xb')](),controller[_0x0364('0x12')]);router[_0x0364('0x13')](_0x0364('0xf'),auth[_0x0364('0xb')](),controller[_0x0364('0x14')]);router[_0x0364('0x15')](_0x0364('0xf'),auth[_0x0364('0xb')](),controller[_0x0364('0x16')]);module[_0x0364('0x17')]=router; \ No newline at end of file +var _0x7eb2=['../../components/auth/service','../../config/environment','./screenRecording.controller','index','/describe','isAuthenticated','get','/:id','show','/:id/download','download','post','create','put','update','multer','path','Router','fs-extra'];(function(_0x28666a,_0x3dc25d){var _0x19d752=function(_0x551e47){while(--_0x551e47){_0x28666a['push'](_0x28666a['shift']());}};_0x19d752(++_0x3dc25d);}(_0x7eb2,0x94));var _0x27eb=function(_0x1e318c,_0x1981a6){_0x1e318c=_0x1e318c-0x0;var _0x3f95e3=_0x7eb2[_0x1e318c];return _0x3f95e3;};'use strict';var multer=require(_0x27eb('0x0'));var util=require('util');var path=require(_0x27eb('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x27eb('0x2')]();var fs_extra=require(_0x27eb('0x3'));var auth=require(_0x27eb('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x27eb('0x5'));var controller=require(_0x27eb('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x27eb('0x7')]);router['get'](_0x27eb('0x8'),auth[_0x27eb('0x9')](),controller['describe']);router[_0x27eb('0xa')](_0x27eb('0xb'),auth['isAuthenticated'](),controller[_0x27eb('0xc')]);router[_0x27eb('0xa')](_0x27eb('0xd'),auth[_0x27eb('0x9')](),controller[_0x27eb('0xe')]);router[_0x27eb('0xf')]('/',auth[_0x27eb('0x9')](),controller[_0x27eb('0x10')]);router[_0x27eb('0x11')](_0x27eb('0xb'),auth[_0x27eb('0x9')](),controller[_0x27eb('0x12')]);router['delete'](_0x27eb('0xb'),auth['isAuthenticated'](),controller['destroy']);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 daa76d7..1db33a8 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 _0x70e3=['getDataValue','value','STRING','INTEGER','setDataValue','startedAt','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','updatedAt','sequelize','moment','path','../../config/environment','VIRTUAL'];(function(_0x4567dd,_0x5dfe79){var _0x255028=function(_0x2b8dd4){while(--_0x2b8dd4){_0x4567dd['push'](_0x4567dd['shift']());}};_0x255028(++_0x5dfe79);}(_0x70e3,0x9d));var _0x370e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0x70e3[_0x36dfbd];return _0x4ecad9;};'use strict';var Sequelize=require(_0x370e('0x0'));var moment=require(_0x370e('0x1'));var path=require(_0x370e('0x2'));var config=require(_0x370e('0x3'));module['exports']={'format':{'type':Sequelize[_0x370e('0x4')],'get':function(){return this[_0x370e('0x5')](_0x370e('0x6'))?path['extname'](this[_0x370e('0x5')](_0x370e('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x370e('0x7')]},'channel':{'type':Sequelize[_0x370e('0x7')]},'value':{'type':Sequelize['STRING'],'set':function(_0x3a2aaf){var _0x5f57ea=_0x3a2aaf['replace'](/\\/g,'/');this['setDataValue'](_0x370e('0x6'),_0x5f57ea);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x370e('0x8')],'set':function(_0x52d611){this[_0x370e('0x9')](_0x370e('0xa'),moment()['subtract'](_0x52d611,'ms'));this['setDataValue'](_0x370e('0xb'),moment());this[_0x370e('0x9')](_0x370e('0xc'),_0x52d611);}},'startedAt':{'type':Sequelize[_0x370e('0xd')],'get':function(){return moment(this[_0x370e('0x5')]('startedAt'))[_0x370e('0xe')](_0x370e('0xf'))[_0x370e('0x10')]();}},'closedAt':{'type':Sequelize[_0x370e('0xd')],'get':function(){return moment(this[_0x370e('0x5')](_0x370e('0xb')))[_0x370e('0xe')](_0x370e('0xf'))[_0x370e('0x10')]();}},'createdAt':{'type':Sequelize[_0x370e('0xd')],'get':function(){return moment(this[_0x370e('0x5')]('createdAt'))['format']('MM-DD-YYYY\x20HH:mm')[_0x370e('0x10')]();}},'updatedAt':{'type':Sequelize[_0x370e('0xd')],'get':function(){return moment(this[_0x370e('0x5')](_0x370e('0x11')))[_0x370e('0xe')](_0x370e('0xf'))['toString']();}}}; \ No newline at end of file +var _0x6efe=['closedAt','duration','DATE','startedAt','MM-DD-YYYY\x20HH:mm','toString','format','createdAt','updatedAt','sequelize','moment','path','../../config/environment','exports','value','extname','getDataValue','STRING','INTEGER','setDataValue','subtract'];(function(_0x18959e,_0x24e830){var _0x308aba=function(_0x11ac72){while(--_0x11ac72){_0x18959e['push'](_0x18959e['shift']());}};_0x308aba(++_0x24e830);}(_0x6efe,0xc6));var _0xe6ef=function(_0x5825d4,_0x4ae980){_0x5825d4=_0x5825d4-0x0;var _0x3af6c8=_0x6efe[_0x5825d4];return _0x3af6c8;};'use strict';var Sequelize=require(_0xe6ef('0x0'));var moment=require(_0xe6ef('0x1'));var path=require(_0xe6ef('0x2'));var config=require(_0xe6ef('0x3'));module[_0xe6ef('0x4')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0xe6ef('0x5'))?path[_0xe6ef('0x6')](this[_0xe6ef('0x7')](_0xe6ef('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0xe6ef('0x8')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0xe6ef('0x8')],'set':function(_0x422e13){var _0x599b6c=_0x422e13['replace'](/\\/g,'/');this['setDataValue'](_0xe6ef('0x5'),_0x599b6c);}},'rating':{'type':Sequelize[_0xe6ef('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xe6ef('0x9')],'set':function(_0x4fca2f){this[_0xe6ef('0xa')]('startedAt',moment()[_0xe6ef('0xb')](_0x4fca2f,'ms'));this[_0xe6ef('0xa')](_0xe6ef('0xc'),moment());this[_0xe6ef('0xa')](_0xe6ef('0xd'),_0x4fca2f);}},'startedAt':{'type':Sequelize[_0xe6ef('0xe')],'get':function(){return moment(this[_0xe6ef('0x7')](_0xe6ef('0xf')))['format'](_0xe6ef('0x10'))[_0xe6ef('0x11')]();}},'closedAt':{'type':Sequelize[_0xe6ef('0xe')],'get':function(){return moment(this[_0xe6ef('0x7')]('closedAt'))[_0xe6ef('0x12')]('MM-DD-YYYY\x20HH:mm')[_0xe6ef('0x11')]();}},'createdAt':{'type':Sequelize[_0xe6ef('0xe')],'get':function(){return moment(this[_0xe6ef('0x7')](_0xe6ef('0x13')))[_0xe6ef('0x12')](_0xe6ef('0x10'))[_0xe6ef('0x11')]();}},'updatedAt':{'type':Sequelize[_0xe6ef('0xe')],'get':function(){return moment(this[_0xe6ef('0x7')](_0xe6ef('0x14')))[_0xe6ef('0x12')](_0xe6ef('0x10'))[_0xe6ef('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index d0ccf2b..6dc2d87 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 _0xe5b3=['info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','name','index','map','ScreenRecording','rawAttributes','type','key','model','differenceBy','format','keys','intersection','attributes','fields','query','length','nolimit','order','where','filters','filter','merge','options','include','findAll','rows','catch','show','create','body','duration','createdAt','closedAt','value','find','params','describe','download','uniqueid','join','%s.cypher','existsSync','root','server/files/screen_recordings','ValidationError','ScreenRecording\x20not\x20found','filename','unlink','send','Not\x20found','destroy','Entity\x20not\x20found'];(function(_0xb2edee,_0x5e08b3){var _0x21a7e3=function(_0x4a5ce0){while(--_0x4a5ce0){_0xb2edee['push'](_0xb2edee['shift']());}};_0x21a7e3(++_0x5e08b3);}(_0xe5b3,0x133));var _0x3e5b=function(_0x32a685,_0x55315c){_0x32a685=_0x32a685-0x0;var _0x4feac1=_0xe5b3[_0x32a685];return _0x4feac1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e5b('0x0'));var zipdir=require(_0x3e5b('0x1'));var jsonpatch=require(_0x3e5b('0x2'));var rp=require(_0x3e5b('0x3'));var moment=require(_0x3e5b('0x4'));var BPromise=require(_0x3e5b('0x5'));var Mustache=require(_0x3e5b('0x6'));var util=require(_0x3e5b('0x7'));var path=require(_0x3e5b('0x8'));var sox=require(_0x3e5b('0x9'));var csv=require(_0x3e5b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e5b('0xb'));var _=require(_0x3e5b('0xc'));var squel=require('squel');var crypto=require(_0x3e5b('0xd'));var jsforce=require(_0x3e5b('0xe'));var deskjs=require(_0x3e5b('0xf'));var toCsv=require(_0x3e5b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3e5b('0x10'));var authService=require(_0x3e5b('0x11'));var qs=require(_0x3e5b('0x12'));var as=require(_0x3e5b('0x13'));var hardwareService=require(_0x3e5b('0x14'));var logger=require('../../config/logger')(_0x3e5b('0x15'));var utils=require('../../config/utils');var config=require(_0x3e5b('0x16'));var licenseUtil=require(_0x3e5b('0x17'));var db=require(_0x3e5b('0x18'))['db'];function respondWithStatusCode(_0x374068,_0x20b97b){_0x20b97b=_0x20b97b||0xcc;return function(_0x3c4eb1){if(_0x3c4eb1){return _0x374068[_0x3e5b('0x19')](_0x20b97b);}return _0x374068['status'](_0x20b97b)[_0x3e5b('0x1a')]();};}function respondWithResult(_0x5f2f9c,_0x51a188){_0x51a188=_0x51a188||0xc8;return function(_0x4d71a3){if(_0x4d71a3){return _0x5f2f9c[_0x3e5b('0x1b')](_0x51a188)[_0x3e5b('0x1c')](_0x4d71a3);}};}function respondWithFilteredResult(_0x17aaa3,_0x4fb471){return function(_0x1f81a7){if(_0x1f81a7){var _0x59ddc0=typeof _0x4fb471['offset']===_0x3e5b('0x1d')&&typeof _0x4fb471[_0x3e5b('0x1e')]==='undefined';var _0x3d58a4=_0x1f81a7[_0x3e5b('0x1f')];var _0x555002=_0x59ddc0?0x0:_0x4fb471[_0x3e5b('0x20')];var _0x3365dd=_0x59ddc0?_0x1f81a7['count']:_0x4fb471['offset']+_0x4fb471[_0x3e5b('0x1e')];var _0x20806a;if(_0x3365dd>=_0x3d58a4){_0x3365dd=_0x3d58a4;_0x20806a=0xc8;}else{_0x20806a=0xce;}_0x17aaa3[_0x3e5b('0x1b')](_0x20806a);return _0x17aaa3[_0x3e5b('0x21')](_0x3e5b('0x22'),_0x555002+'-'+_0x3365dd+'/'+_0x3d58a4)[_0x3e5b('0x1c')](_0x1f81a7);}return null;};}function patchUpdates(_0x447d36){return function(_0x21fc32){try{jsonpatch[_0x3e5b('0x23')](_0x21fc32,_0x447d36,!![]);}catch(_0x3d95f3){return BPromise[_0x3e5b('0x24')](_0x3d95f3);}return _0x21fc32[_0x3e5b('0x25')]();};}function saveUpdates(_0x2d77cc,_0x402873){return function(_0x5b46d4){if(_0x5b46d4){return _0x5b46d4[_0x3e5b('0x26')](_0x2d77cc)[_0x3e5b('0x27')](function(_0x2146d4){return _0x2146d4;});}return null;};}function removeEntity(_0x150674,_0x50039b){return function(_0x1eb80f){if(_0x1eb80f){return _0x1eb80f['destroy']()[_0x3e5b('0x27')](function(){_0x150674[_0x3e5b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41b684,_0x2f6368){return function(_0x42d7e9){if(!_0x42d7e9){_0x41b684[_0x3e5b('0x19')](0x194);}return _0x42d7e9;};}function handleError(_0x3bb749,_0x26c7f2){_0x26c7f2=_0x26c7f2||0x1f4;return function(_0x160e87){logger[_0x3e5b('0x28')](_0x160e87['stack']);if(_0x160e87[_0x3e5b('0x29')]){delete _0x160e87['name'];}_0x3bb749[_0x3e5b('0x1b')](_0x26c7f2)['send'](_0x160e87);};}exports[_0x3e5b('0x2a')]=function(_0x1f6473,_0x1296ec){var _0x475b39={},_0x10d2ed={},_0x3cfaf6={'count':0x0,'rows':[]};var _0x307091=_[_0x3e5b('0x2b')](db[_0x3e5b('0x2c')][_0x3e5b('0x2d')],function(_0x1e1565){return{'name':_0x1e1565['fieldName'],'type':_0x1e1565[_0x3e5b('0x2e')][_0x3e5b('0x2f')]};});_0x10d2ed[_0x3e5b('0x30')]=_[_0x3e5b('0x31')](_[_0x3e5b('0x2b')](_0x307091,_0x3e5b('0x29')),[_0x3e5b('0x32')]);_0x10d2ed['query']=_[_0x3e5b('0x33')](_0x1f6473['query']);_0x10d2ed['filters']=_[_0x3e5b('0x34')](_0x10d2ed[_0x3e5b('0x30')],_0x10d2ed['query']);_0x475b39[_0x3e5b('0x35')]=_[_0x3e5b('0x34')](_0x10d2ed[_0x3e5b('0x30')],qs[_0x3e5b('0x36')](_0x1f6473[_0x3e5b('0x37')][_0x3e5b('0x36')]));_0x475b39[_0x3e5b('0x35')]=_0x475b39[_0x3e5b('0x35')][_0x3e5b('0x38')]?_0x475b39[_0x3e5b('0x35')]:_0x10d2ed[_0x3e5b('0x30')];if(!_0x1f6473[_0x3e5b('0x37')]['hasOwnProperty'](_0x3e5b('0x39'))){_0x475b39[_0x3e5b('0x1e')]=qs['limit'](_0x1f6473['query'][_0x3e5b('0x1e')]);_0x475b39['offset']=qs[_0x3e5b('0x20')](_0x1f6473[_0x3e5b('0x37')][_0x3e5b('0x20')]);}_0x475b39[_0x3e5b('0x3a')]=qs['sort'](_0x1f6473[_0x3e5b('0x37')]['sort']);_0x475b39[_0x3e5b('0x3b')]=qs['filters'](_['pick'](_0x1f6473['query'],_0x10d2ed[_0x3e5b('0x3c')]),_0x307091);if(_0x1f6473[_0x3e5b('0x37')][_0x3e5b('0x3d')]){_0x475b39[_0x3e5b('0x3b')]=_[_0x3e5b('0x3e')](_0x475b39[_0x3e5b('0x3b')],{'$or':_['map'](_0x307091,function(_0x5d0c59){if(_0x5d0c59['type']!=='VIRTUAL'){var _0x5f0271={};_0x5f0271[_0x5d0c59['name']]={'$like':'%'+_0x1f6473['query'][_0x3e5b('0x3d')]+'%'};return _0x5f0271;}})});}_0x475b39=_[_0x3e5b('0x3e')]({},_0x475b39,_0x1f6473[_0x3e5b('0x3f')]);var _0x1aafd5={'where':_0x475b39[_0x3e5b('0x3b')]};return db[_0x3e5b('0x2c')][_0x3e5b('0x1f')](_0x1aafd5)[_0x3e5b('0x27')](function(_0x222d0f){_0x3cfaf6[_0x3e5b('0x1f')]=_0x222d0f;if(_0x1f6473[_0x3e5b('0x37')]['includeAll']){_0x475b39[_0x3e5b('0x40')]=[{'all':!![]}];}return db[_0x3e5b('0x2c')][_0x3e5b('0x41')](_0x475b39);})[_0x3e5b('0x27')](function(_0xa262e0){_0x3cfaf6[_0x3e5b('0x42')]=_0xa262e0;return _0x3cfaf6;})[_0x3e5b('0x27')](respondWithFilteredResult(_0x1296ec,_0x475b39))[_0x3e5b('0x43')](handleError(_0x1296ec,null));};exports[_0x3e5b('0x44')]=function(_0x39da3f,_0x13c8d5){var _0x559056={'raw':![],'where':{'id':_0x39da3f['params']['id']}},_0x598ab4={};_0x598ab4['model']=_[_0x3e5b('0x33')](db[_0x3e5b('0x2c')][_0x3e5b('0x2d')]);_0x598ab4[_0x3e5b('0x37')]=_[_0x3e5b('0x33')](_0x39da3f[_0x3e5b('0x37')]);_0x598ab4[_0x3e5b('0x3c')]=_[_0x3e5b('0x34')](_0x598ab4[_0x3e5b('0x30')],_0x598ab4[_0x3e5b('0x37')]);_0x559056['attributes']=_[_0x3e5b('0x34')](_0x598ab4[_0x3e5b('0x30')],qs[_0x3e5b('0x36')](_0x39da3f[_0x3e5b('0x37')][_0x3e5b('0x36')]));_0x559056['attributes']=_0x559056['attributes']['length']?_0x559056[_0x3e5b('0x35')]:_0x598ab4[_0x3e5b('0x30')];if(_0x39da3f[_0x3e5b('0x37')]['includeAll']){_0x559056['include']=[{'all':!![]}];}_0x559056=_[_0x3e5b('0x3e')]({},_0x559056,_0x39da3f[_0x3e5b('0x3f')]);return db[_0x3e5b('0x2c')]['find'](_0x559056)['then'](handleEntityNotFound(_0x13c8d5,null))[_0x3e5b('0x27')](respondWithResult(_0x13c8d5,null))['catch'](handleError(_0x13c8d5,null));};exports[_0x3e5b('0x45')]=function(_0x3379a1,_0x3f5835){return db[_0x3e5b('0x2c')][_0x3e5b('0x45')](_0x3379a1[_0x3e5b('0x46')],{})[_0x3e5b('0x27')](respondWithResult(_0x3f5835,0xc9))[_0x3e5b('0x43')](handleError(_0x3f5835,null));};exports[_0x3e5b('0x26')]=function(_0x4a2ae1,_0x223185){if(_0x4a2ae1['body']['id']){delete _0x4a2ae1[_0x3e5b('0x46')]['id'];}delete _0x4a2ae1[_0x3e5b('0x46')][_0x3e5b('0x47')];delete _0x4a2ae1[_0x3e5b('0x46')][_0x3e5b('0x48')];delete _0x4a2ae1[_0x3e5b('0x46')][_0x3e5b('0x49')];delete _0x4a2ae1[_0x3e5b('0x46')][_0x3e5b('0x4a')];return db[_0x3e5b('0x2c')][_0x3e5b('0x4b')]({'where':{'id':_0x4a2ae1[_0x3e5b('0x4c')]['id']}})[_0x3e5b('0x27')](handleEntityNotFound(_0x223185,null))['then'](saveUpdates(_0x4a2ae1[_0x3e5b('0x46')],null))[_0x3e5b('0x27')](respondWithResult(_0x223185,null))[_0x3e5b('0x43')](handleError(_0x223185,null));};exports[_0x3e5b('0x4d')]=function(_0x16c9f9,_0x2cecd3){return db['ScreenRecording'][_0x3e5b('0x4d')]()[_0x3e5b('0x27')](respondWithResult(_0x2cecd3,null))[_0x3e5b('0x43')](handleError(_0x2cecd3,null));};exports[_0x3e5b('0x4e')]=function(_0x3f8646,_0x449d0f,_0x216600){var _0x437430=require('../../components/encryptor');var _0x1e6403=![];var _0x5e702f={};if(_0x3f8646['query'][_0x3e5b('0x2e')]&&_0x3f8646['query'][_0x3e5b('0x2e')]===_0x3e5b('0x4f')){_0x5e702f[_0x3e5b('0x4f')]=_0x3f8646[_0x3e5b('0x4c')]['id'];}else{_0x5e702f['id']=_0x3f8646['params']['id'];}return db['ScreenRecording']['find']({'where':_0x5e702f,'attributes':['id','value'],'raw':!![]})[_0x3e5b('0x27')](handleEntityNotFound(_0x449d0f,null))[_0x3e5b('0x27')](function(_0x1ea02a){if(_0x1ea02a){var _0x4149c8=path[_0x3e5b('0x50')](config['root'],'server/files/screen_recordings',_0x1ea02a[_0x3e5b('0x4a')]);var _0x1b0b32=util[_0x3e5b('0x32')](_0x3e5b('0x51'),_0x4149c8);if(fs[_0x3e5b('0x52')](_0x1b0b32)){_0x1e6403=!![];return _0x437430['decryptFile'](_0x1b0b32,_0x4149c8,config['secrets']['recording'])['then'](function(){return _0x1ea02a;});}return _0x1ea02a;}})[_0x3e5b('0x27')](function(_0x3e3115){if(_0x3e3115){var _0x3088d4=path[_0x3e5b('0x50')](config[_0x3e5b('0x53')],_0x3e5b('0x54'),_0x3e3115[_0x3e5b('0x4a')]);if(!fs[_0x3e5b('0x52')](_0x3088d4)){throw new db['Sequelize'][(_0x3e5b('0x55'))](_0x3e5b('0x56'));}if(_0x3e3115[_0x3e5b('0x57')]){return _0x449d0f[_0x3e5b('0x4e')](_0x3088d4,_0x3e3115[_0x3e5b('0x57')]+path['extname'](_0x3088d4),function(){if(_0x1e6403){fs[_0x3e5b('0x58')](_0x3088d4);}});}else{return _0x449d0f['download'](_0x3088d4,function(_0x45ca16){if(_0x1e6403){fs[_0x3e5b('0x58')](_0x3088d4);}});}}})['catch'](function(_0x4a7d8e){if(_0x4a7d8e['message']===_0x3e5b('0x56')){_0x449d0f['status'](0x194)[_0x3e5b('0x59')](_0x3e5b('0x5a'));}else{return handleError(_0x449d0f,null);}});};exports[_0x3e5b('0x5b')]=function(_0x40197c,_0x14f187){return db['ScreenRecording']['find']({'where':{'id':_0x40197c[_0x3e5b('0x4c')]['id']}})[_0x3e5b('0x27')](function(_0x3f7f71){if(_['isNil'](_0x3f7f71)){throw new ReferenceError(_0x3e5b('0x5c'));}return _0x3f7f71;})[_0x3e5b('0x27')](function(_0x32a42f){var _0x1c9526=path[_0x3e5b('0x50')](config[_0x3e5b('0x53')],_0x3e5b('0x54'),_0x32a42f[_0x3e5b('0x4a')]);logger[_0x3e5b('0x5d')](_0x3e5b('0x5e'),_0x1c9526);if(!_[_0x3e5b('0x5f')](_0x32a42f[_0x3e5b('0x4a')])&&fs[_0x3e5b('0x52')](_0x1c9526)){logger[_0x3e5b('0x5d')](_0x3e5b('0x60')+_0x1c9526+_0x3e5b('0x61'));fs[_0x3e5b('0x62')](_0x1c9526);}_0x1c9526=_0x1c9526+_0x3e5b('0x63');if(!_['isNil'](_0x32a42f[_0x3e5b('0x4a')])&&fs[_0x3e5b('0x52')](_0x1c9526)){logger['info'](_0x3e5b('0x60')+_0x1c9526+_0x3e5b('0x61'));fs['unlinkSync'](_0x1c9526);}return _0x32a42f;})['then'](function(_0x4f67d1){if(!_0x4f67d1)throw new InternalError();return _0x4f67d1[_0x3e5b('0x5b')]();})[_0x3e5b('0x27')](function(){_0x14f187['status'](0xcc)[_0x3e5b('0x1a')]();})[_0x3e5b('0x43')](handleError(_0x14f187,null));}; \ No newline at end of file +var _0xdbf5=['papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','sendStatus','status','json','offset','undefined','count','set','Content-Range','save','update','then','destroy','end','error','stack','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','format','query','keys','intersection','fields','attributes','length','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','duration','createdAt','closedAt','value','describe','download','uniqueid','join','root','server/files/screen_recordings','decryptFile','secrets','recording','existsSync','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x9a3d1b,_0xd84aca){_0x9a3d1b=_0x9a3d1b-0x0;var _0x1396c3=_0xdbf5[_0x9a3d1b];return _0x1396c3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5dbf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5dbf('0x1'));var moment=require(_0x5dbf('0x2'));var BPromise=require(_0x5dbf('0x3'));var Mustache=require(_0x5dbf('0x4'));var util=require(_0x5dbf('0x5'));var path=require(_0x5dbf('0x6'));var sox=require(_0x5dbf('0x7'));var csv=require(_0x5dbf('0x8'));var ejs=require(_0x5dbf('0x9'));var fs=require('fs');var fs_extra=require(_0x5dbf('0xa'));var _=require(_0x5dbf('0xb'));var squel=require(_0x5dbf('0xc'));var crypto=require(_0x5dbf('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5dbf('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5dbf('0xf'));var Papa=require(_0x5dbf('0x10'));var Redis=require(_0x5dbf('0x11'));var authService=require(_0x5dbf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5dbf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5dbf('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5dbf('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x182cec,_0x2bb7ed){_0x2bb7ed=_0x2bb7ed||0xcc;return function(_0x1453a9){if(_0x1453a9){return _0x182cec[_0x5dbf('0x16')](_0x2bb7ed);}return _0x182cec[_0x5dbf('0x17')](_0x2bb7ed)['end']();};}function respondWithResult(_0x4803ca,_0x2b4e1c){_0x2b4e1c=_0x2b4e1c||0xc8;return function(_0x3480c8){if(_0x3480c8){return _0x4803ca['status'](_0x2b4e1c)[_0x5dbf('0x18')](_0x3480c8);}};}function respondWithFilteredResult(_0x248e3c,_0x23f763){return function(_0x2dfa44){if(_0x2dfa44){var _0x181816=typeof _0x23f763[_0x5dbf('0x19')]===_0x5dbf('0x1a')&&typeof _0x23f763['limit']==='undefined';var _0x16dc82=_0x2dfa44[_0x5dbf('0x1b')];var _0x39c7aa=_0x181816?0x0:_0x23f763[_0x5dbf('0x19')];var _0x20c2b0=_0x181816?_0x2dfa44['count']:_0x23f763[_0x5dbf('0x19')]+_0x23f763['limit'];var _0x565efa;if(_0x20c2b0>=_0x16dc82){_0x20c2b0=_0x16dc82;_0x565efa=0xc8;}else{_0x565efa=0xce;}_0x248e3c['status'](_0x565efa);return _0x248e3c[_0x5dbf('0x1c')](_0x5dbf('0x1d'),_0x39c7aa+'-'+_0x20c2b0+'/'+_0x16dc82)[_0x5dbf('0x18')](_0x2dfa44);}return null;};}function patchUpdates(_0x2ab57c){return function(_0x1e3cce){try{jsonpatch['apply'](_0x1e3cce,_0x2ab57c,!![]);}catch(_0x2764ea){return BPromise['reject'](_0x2764ea);}return _0x1e3cce[_0x5dbf('0x1e')]();};}function saveUpdates(_0x11cc67,_0x14d133){return function(_0x43a612){if(_0x43a612){return _0x43a612[_0x5dbf('0x1f')](_0x11cc67)[_0x5dbf('0x20')](function(_0x58085e){return _0x58085e;});}return null;};}function removeEntity(_0x4027c3,_0x3e3a2d){return function(_0x2d3e1b){if(_0x2d3e1b){return _0x2d3e1b[_0x5dbf('0x21')]()[_0x5dbf('0x20')](function(){_0x4027c3[_0x5dbf('0x17')](0xcc)[_0x5dbf('0x22')]();});}};}function handleEntityNotFound(_0x20ab1b,_0x42f13b){return function(_0x15a790){if(!_0x15a790){_0x20ab1b[_0x5dbf('0x16')](0x194);}return _0x15a790;};}function handleError(_0x232c77,_0x3f9e60){_0x3f9e60=_0x3f9e60||0x1f4;return function(_0x407741){logger[_0x5dbf('0x23')](_0x407741[_0x5dbf('0x24')]);if(_0x407741[_0x5dbf('0x25')]){delete _0x407741[_0x5dbf('0x25')];}_0x232c77[_0x5dbf('0x17')](_0x3f9e60)[_0x5dbf('0x26')](_0x407741);};}exports[_0x5dbf('0x27')]=function(_0x471027,_0x21cd00){var _0x5768b7={},_0x2f71eb={},_0x24dc99={'count':0x0,'rows':[]};var _0xc4748=_[_0x5dbf('0x28')](db[_0x5dbf('0x29')][_0x5dbf('0x2a')],function(_0x2a65c5){return{'name':_0x2a65c5[_0x5dbf('0x2b')],'type':_0x2a65c5[_0x5dbf('0x2c')][_0x5dbf('0x2d')]};});_0x2f71eb[_0x5dbf('0x2e')]=_['differenceBy'](_['map'](_0xc4748,_0x5dbf('0x25')),[_0x5dbf('0x2f')]);_0x2f71eb[_0x5dbf('0x30')]=_[_0x5dbf('0x31')](_0x471027[_0x5dbf('0x30')]);_0x2f71eb['filters']=_['intersection'](_0x2f71eb[_0x5dbf('0x2e')],_0x2f71eb[_0x5dbf('0x30')]);_0x5768b7['attributes']=_[_0x5dbf('0x32')](_0x2f71eb[_0x5dbf('0x2e')],qs[_0x5dbf('0x33')](_0x471027[_0x5dbf('0x30')][_0x5dbf('0x33')]));_0x5768b7['attributes']=_0x5768b7[_0x5dbf('0x34')][_0x5dbf('0x35')]?_0x5768b7[_0x5dbf('0x34')]:_0x2f71eb[_0x5dbf('0x2e')];if(!_0x471027[_0x5dbf('0x30')]['hasOwnProperty'](_0x5dbf('0x36'))){_0x5768b7[_0x5dbf('0x37')]=qs[_0x5dbf('0x37')](_0x471027[_0x5dbf('0x30')]['limit']);_0x5768b7[_0x5dbf('0x19')]=qs[_0x5dbf('0x19')](_0x471027[_0x5dbf('0x30')][_0x5dbf('0x19')]);}_0x5768b7[_0x5dbf('0x38')]=qs[_0x5dbf('0x39')](_0x471027[_0x5dbf('0x30')][_0x5dbf('0x39')]);_0x5768b7[_0x5dbf('0x3a')]=qs[_0x5dbf('0x3b')](_[_0x5dbf('0x3c')](_0x471027['query'],_0x2f71eb[_0x5dbf('0x3b')]),_0xc4748);if(_0x471027[_0x5dbf('0x30')][_0x5dbf('0x3d')]){_0x5768b7['where']=_[_0x5dbf('0x3e')](_0x5768b7[_0x5dbf('0x3a')],{'$or':_[_0x5dbf('0x28')](_0xc4748,function(_0x5b3738){if(_0x5b3738[_0x5dbf('0x2c')]!==_0x5dbf('0x3f')){var _0x9bd4c0={};_0x9bd4c0[_0x5b3738['name']]={'$like':'%'+_0x471027[_0x5dbf('0x30')][_0x5dbf('0x3d')]+'%'};return _0x9bd4c0;}})});}_0x5768b7=_[_0x5dbf('0x3e')]({},_0x5768b7,_0x471027[_0x5dbf('0x40')]);var _0x10537d={'where':_0x5768b7[_0x5dbf('0x3a')]};return db[_0x5dbf('0x29')][_0x5dbf('0x1b')](_0x10537d)['then'](function(_0x5be96b){_0x24dc99['count']=_0x5be96b;if(_0x471027['query'][_0x5dbf('0x41')]){_0x5768b7[_0x5dbf('0x42')]=[{'all':!![]}];}return db['ScreenRecording'][_0x5dbf('0x43')](_0x5768b7);})[_0x5dbf('0x20')](function(_0x5a60e8){_0x24dc99[_0x5dbf('0x44')]=_0x5a60e8;return _0x24dc99;})[_0x5dbf('0x20')](respondWithFilteredResult(_0x21cd00,_0x5768b7))[_0x5dbf('0x45')](handleError(_0x21cd00,null));};exports[_0x5dbf('0x46')]=function(_0x21ae10,_0x7c390d){var _0x2745df={'raw':![],'where':{'id':_0x21ae10[_0x5dbf('0x47')]['id']}},_0x1c020a={};_0x1c020a[_0x5dbf('0x2e')]=_['keys'](db[_0x5dbf('0x29')][_0x5dbf('0x2a')]);_0x1c020a[_0x5dbf('0x30')]=_['keys'](_0x21ae10[_0x5dbf('0x30')]);_0x1c020a[_0x5dbf('0x3b')]=_[_0x5dbf('0x32')](_0x1c020a[_0x5dbf('0x2e')],_0x1c020a['query']);_0x2745df[_0x5dbf('0x34')]=_['intersection'](_0x1c020a[_0x5dbf('0x2e')],qs[_0x5dbf('0x33')](_0x21ae10[_0x5dbf('0x30')][_0x5dbf('0x33')]));_0x2745df['attributes']=_0x2745df['attributes'][_0x5dbf('0x35')]?_0x2745df[_0x5dbf('0x34')]:_0x1c020a[_0x5dbf('0x2e')];if(_0x21ae10['query'][_0x5dbf('0x41')]){_0x2745df['include']=[{'all':!![]}];}_0x2745df=_['merge']({},_0x2745df,_0x21ae10['options']);return db['ScreenRecording'][_0x5dbf('0x48')](_0x2745df)[_0x5dbf('0x20')](handleEntityNotFound(_0x7c390d,null))['then'](respondWithResult(_0x7c390d,null))[_0x5dbf('0x45')](handleError(_0x7c390d,null));};exports[_0x5dbf('0x49')]=function(_0x4b6f30,_0x366102){return db[_0x5dbf('0x29')]['create'](_0x4b6f30[_0x5dbf('0x4a')],{})['then'](respondWithResult(_0x366102,0xc9))['catch'](handleError(_0x366102,null));};exports[_0x5dbf('0x1f')]=function(_0x2a3d30,_0x17a1c0){if(_0x2a3d30['body']['id']){delete _0x2a3d30['body']['id'];}delete _0x2a3d30[_0x5dbf('0x4a')][_0x5dbf('0x4b')];delete _0x2a3d30[_0x5dbf('0x4a')][_0x5dbf('0x4c')];delete _0x2a3d30[_0x5dbf('0x4a')][_0x5dbf('0x4d')];delete _0x2a3d30[_0x5dbf('0x4a')][_0x5dbf('0x4e')];return db['ScreenRecording'][_0x5dbf('0x48')]({'where':{'id':_0x2a3d30[_0x5dbf('0x47')]['id']}})[_0x5dbf('0x20')](handleEntityNotFound(_0x17a1c0,null))[_0x5dbf('0x20')](saveUpdates(_0x2a3d30[_0x5dbf('0x4a')],null))[_0x5dbf('0x20')](respondWithResult(_0x17a1c0,null))[_0x5dbf('0x45')](handleError(_0x17a1c0,null));};exports['describe']=function(_0x1b0b13,_0x54f401){return db[_0x5dbf('0x29')][_0x5dbf('0x4f')]()[_0x5dbf('0x20')](respondWithResult(_0x54f401,null))[_0x5dbf('0x45')](handleError(_0x54f401,null));};exports[_0x5dbf('0x50')]=function(_0x1f165d,_0x353d0f,_0x48403a){var _0x5c3c0d=require('../../components/encryptor');var _0x1e1876=![];var _0xfdacc7={};if(_0x1f165d[_0x5dbf('0x30')]['type']&&_0x1f165d['query'][_0x5dbf('0x2c')]===_0x5dbf('0x51')){_0xfdacc7[_0x5dbf('0x51')]=_0x1f165d['params']['id'];}else{_0xfdacc7['id']=_0x1f165d[_0x5dbf('0x47')]['id'];}return db['ScreenRecording'][_0x5dbf('0x48')]({'where':_0xfdacc7,'attributes':['id',_0x5dbf('0x4e')],'raw':!![]})[_0x5dbf('0x20')](handleEntityNotFound(_0x353d0f,null))['then'](function(_0x55fd51){if(_0x55fd51){var _0x1b316d=path[_0x5dbf('0x52')](config[_0x5dbf('0x53')],_0x5dbf('0x54'),_0x55fd51['value']);var _0xfcc43c=util[_0x5dbf('0x2f')]('%s.cypher',_0x1b316d);if(fs['existsSync'](_0xfcc43c)){_0x1e1876=!![];return _0x5c3c0d[_0x5dbf('0x55')](_0xfcc43c,_0x1b316d,config[_0x5dbf('0x56')][_0x5dbf('0x57')])[_0x5dbf('0x20')](function(){return _0x55fd51;});}return _0x55fd51;}})[_0x5dbf('0x20')](function(_0x4711d5){if(_0x4711d5){var _0x50a029=path[_0x5dbf('0x52')](config['root'],'server/files/screen_recordings',_0x4711d5['value']);if(!fs[_0x5dbf('0x58')](_0x50a029)){throw new db['Sequelize'][(_0x5dbf('0x59'))](_0x5dbf('0x5a'));}if(_0x4711d5[_0x5dbf('0x5b')]){return _0x353d0f[_0x5dbf('0x50')](_0x50a029,_0x4711d5[_0x5dbf('0x5b')]+path[_0x5dbf('0x5c')](_0x50a029),function(){if(_0x1e1876){fs[_0x5dbf('0x5d')](_0x50a029);}});}else{return _0x353d0f[_0x5dbf('0x50')](_0x50a029,function(_0x2c84d6){if(_0x1e1876){fs[_0x5dbf('0x5d')](_0x50a029);}});}}})[_0x5dbf('0x45')](function(_0x2ca889){if(_0x2ca889[_0x5dbf('0x5e')]===_0x5dbf('0x5a')){_0x353d0f[_0x5dbf('0x17')](0x194)['send'](_0x5dbf('0x5f'));}else{return handleError(_0x353d0f,null);}});};exports['destroy']=function(_0xb0a9bf,_0xfc5817){return db[_0x5dbf('0x29')][_0x5dbf('0x48')]({'where':{'id':_0xb0a9bf['params']['id']}})[_0x5dbf('0x20')](function(_0x1ade34){if(_[_0x5dbf('0x60')](_0x1ade34)){throw new ReferenceError(_0x5dbf('0x61'));}return _0x1ade34;})[_0x5dbf('0x20')](function(_0x40982f){var _0x52efd7=path[_0x5dbf('0x52')](config[_0x5dbf('0x53')],_0x5dbf('0x54'),_0x40982f[_0x5dbf('0x4e')]);logger[_0x5dbf('0x62')](_0x5dbf('0x63'),_0x52efd7);if(!_[_0x5dbf('0x60')](_0x40982f[_0x5dbf('0x4e')])&&fs[_0x5dbf('0x58')](_0x52efd7)){logger[_0x5dbf('0x62')](_0x5dbf('0x64')+_0x52efd7+_0x5dbf('0x65'));fs['unlinkSync'](_0x52efd7);}_0x52efd7=_0x52efd7+'.cypher';if(!_[_0x5dbf('0x60')](_0x40982f[_0x5dbf('0x4e')])&&fs[_0x5dbf('0x58')](_0x52efd7)){logger[_0x5dbf('0x62')](_0x5dbf('0x64')+_0x52efd7+_0x5dbf('0x65'));fs[_0x5dbf('0x66')](_0x52efd7);}return _0x40982f;})[_0x5dbf('0x20')](function(_0x3a4001){if(!_0x3a4001)throw new InternalError();return _0x3a4001['destroy']();})['then'](function(){_0xfc5817['status'](0xcc)['end']();})[_0x5dbf('0x45')](handleError(_0xfc5817,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 1bd41c4..de2f6a2 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 _0x76c3=['rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','util','../../config/logger','api','bluebird','path'];(function(_0x19be6a,_0x5b652d){var _0x3af785=function(_0xdb5a40){while(--_0xdb5a40){_0x19be6a['push'](_0x19be6a['shift']());}};_0x3af785(++_0x5b652d);}(_0x76c3,0xff));var _0x376c=function(_0x34d547,_0x21d2f8){_0x34d547=_0x34d547-0x0;var _0x552082=_0x76c3[_0x34d547];return _0x552082;};'use strict';var _=require('lodash');var util=require(_0x376c('0x0'));var logger=require(_0x376c('0x1'))(_0x376c('0x2'));var moment=require('moment');var BPromise=require(_0x376c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x376c('0x4'));var rimraf=require(_0x376c('0x5'));var config=require(_0x376c('0x6'));var attributes=require(_0x376c('0x7'));module[_0x376c('0x8')]=function(_0x394812,_0x4e6bad){return _0x394812[_0x376c('0x9')](_0x376c('0xa'),attributes,{'tableName':_0x376c('0xb'),'paranoid':![],'indexes':[{'name':_0x376c('0xc'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7e7b=['screen_recordings','interactionid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./screenRecording.attributes','exports','ScreenRecording'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x7e7b,0xc6));var _0xb7e7=function(_0x581775,_0x529075){_0x581775=_0x581775-0x0;var _0x49cf94=_0x7e7b[_0x581775];return _0x49cf94;};'use strict';var _=require(_0xb7e7('0x0'));var util=require(_0xb7e7('0x1'));var logger=require(_0xb7e7('0x2'))(_0xb7e7('0x3'));var moment=require(_0xb7e7('0x4'));var BPromise=require(_0xb7e7('0x5'));var rp=require(_0xb7e7('0x6'));var fs=require('fs');var path=require(_0xb7e7('0x7'));var rimraf=require(_0xb7e7('0x8'));var config=require('../../config/environment');var attributes=require(_0xb7e7('0x9'));module[_0xb7e7('0xa')]=function(_0x4264a3,_0x35d507){return _0x4264a3['define'](_0xb7e7('0xb'),attributes,{'tableName':_0xb7e7('0xc'),'paranoid':![],'indexes':[{'name':_0xb7e7('0xd'),'fields':[_0xb7e7('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 02074ff..7ae6df6 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 _0xde4e=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','http','request','then','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x243567,_0x51ff67){var _0x1b5def=function(_0x1344e8){while(--_0x1344e8){_0x243567['push'](_0x243567['shift']());}};_0x1b5def(++_0x51ff67);}(_0xde4e,0x1cf));var _0xede4=function(_0x46d13f,_0x492b61){_0x46d13f=_0x46d13f-0x0;var _0x15fae2=_0xde4e[_0x46d13f];return _0x15fae2;};'use strict';var _=require(_0xede4('0x0'));var util=require(_0xede4('0x1'));var moment=require(_0xede4('0x2'));var BPromise=require(_0xede4('0x3'));var rs=require(_0xede4('0x4'));var fs=require('fs');var Redis=require(_0xede4('0x5'));var db=require(_0xede4('0x6'))['db'];var utils=require(_0xede4('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xede4('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xede4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3a287e,_0x54beac,_0x21be23){return new BPromise(function(_0x2bd164,_0x169ed5){return client[_0xede4('0xa')](_0x3a287e,_0x21be23)[_0xede4('0xb')](function(_0x41b78a){logger['info'](_0xede4('0xc'),_0x54beac,_0xede4('0xd'));logger[_0xede4('0xe')](_0xede4('0xf'),_0x54beac,'request\x20sent',JSON['stringify'](_0x41b78a));if(_0x41b78a['error']){if(_0x41b78a[_0xede4('0x10')][_0xede4('0x11')]===0x1f4){logger['error'](_0xede4('0xc'),_0x54beac,_0x41b78a[_0xede4('0x10')]['message']);return _0x169ed5(_0x41b78a[_0xede4('0x10')][_0xede4('0x12')]);}logger[_0xede4('0x10')](_0xede4('0xc'),_0x54beac,_0x41b78a[_0xede4('0x10')][_0xede4('0x12')]);return _0x2bd164(_0x41b78a[_0xede4('0x10')][_0xede4('0x12')]);}else{logger[_0xede4('0x13')](_0xede4('0xc'),_0x54beac,_0xede4('0xd'));_0x2bd164(_0x41b78a[_0xede4('0x14')][_0xede4('0x12')]);}})['catch'](function(_0x346000){logger[_0xede4('0x10')](_0xede4('0xc'),_0x54beac,_0x346000);_0x169ed5(_0x346000);});});} \ No newline at end of file +var _0x0150=['jayson/promise','client','http','request','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x5208fa,_0x2e0115){var _0x340255=function(_0x243db1){while(--_0x243db1){_0x5208fa['push'](_0x5208fa['shift']());}};_0x340255(++_0x2e0115);}(_0x0150,0xd4));var _0x0015=function(_0x383744,_0x2857b4){_0x383744=_0x383744-0x0;var _0x2808ff=_0x0150[_0x383744];return _0x2808ff;};'use strict';var _=require(_0x0015('0x0'));var util=require(_0x0015('0x1'));var moment=require(_0x0015('0x2'));var BPromise=require('bluebird');var rs=require(_0x0015('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0015('0x4'))['db'];var utils=require(_0x0015('0x5'));var logger=require(_0x0015('0x6'))('rpc');var config=require(_0x0015('0x7'));var jayson=require(_0x0015('0x8'));var client=jayson[_0x0015('0x9')][_0x0015('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xfda0e7,_0x2b761f,_0x5b8dfd){return new BPromise(function(_0x41119a,_0x484429){return client[_0x0015('0xb')](_0xfda0e7,_0x5b8dfd)['then'](function(_0x2bce58){logger[_0x0015('0xc')](_0x0015('0xd'),_0x2b761f,_0x0015('0xe'));logger[_0x0015('0xf')](_0x0015('0x10'),_0x2b761f,_0x0015('0xe'),JSON[_0x0015('0x11')](_0x2bce58));if(_0x2bce58[_0x0015('0x12')]){if(_0x2bce58['error'][_0x0015('0x13')]===0x1f4){logger[_0x0015('0x12')]('ScreenRecording,\x20%s,\x20%s',_0x2b761f,_0x2bce58['error'][_0x0015('0x14')]);return _0x484429(_0x2bce58[_0x0015('0x12')]['message']);}logger[_0x0015('0x12')](_0x0015('0xd'),_0x2b761f,_0x2bce58[_0x0015('0x12')]['message']);return _0x41119a(_0x2bce58[_0x0015('0x12')][_0x0015('0x14')]);}else{logger['info'](_0x0015('0xd'),_0x2b761f,_0x0015('0xe'));_0x41119a(_0x2bce58['result']['message']);}})[_0x0015('0x15')](function(_0xf9b6b0){logger['error'](_0x0015('0xd'),_0x2b761f,_0xf9b6b0);_0x484429(_0xf9b6b0);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index ec596e0..9320bfe 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 _0x8742=['../../config/environment','./setting.controller','get','isAuthenticated','/now','getDate','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','gdpr','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','extname','originalname','post','single','logologin','file','addLogoLogin','preferred','/:id/preferred','favicon','addFavicon','put','/:id','update','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4017b0,_0x4347db){var _0x5ed4f7=function(_0x706c26){while(--_0x706c26){_0x4017b0['push'](_0x4017b0['shift']());}};_0x5ed4f7(++_0x4347db);}(_0x8742,0x12c));var _0x2874=function(_0xd420bc,_0x30d7b4){_0xd420bc=_0xd420bc-0x0;var _0x44ac1f=_0x8742[_0xd420bc];return _0x44ac1f;};'use strict';var multer=require(_0x2874('0x0'));var util=require(_0x2874('0x1'));var path=require(_0x2874('0x2'));var timeout=require(_0x2874('0x3'));var express=require(_0x2874('0x4'));var router=express[_0x2874('0x5')]();var fs_extra=require(_0x2874('0x6'));var auth=require(_0x2874('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x2874('0x8'));var controller=require(_0x2874('0x9'));router[_0x2874('0xa')]('/',auth[_0x2874('0xb')](),controller['index']);router['get'](_0x2874('0xc'),controller[_0x2874('0xd')]);router[_0x2874('0xa')]('/:id',controller[_0x2874('0xe')]);router[_0x2874('0xa')](_0x2874('0xf'),controller[_0x2874('0x10')]);router[_0x2874('0xa')](_0x2874('0x11'),controller[_0x2874('0x12')]);router['get']('/:id/gdpr',controller[_0x2874('0x13')]);router[_0x2874('0xa')]('/:id/preferred',controller[_0x2874('0x14')]);router[_0x2874('0xa')](_0x2874('0x15'),controller[_0x2874('0x16')]);var upload=multer({'storage':multer[_0x2874('0x17')]({'destination':function(_0x515b65,_0x8371a,_0x59e8ec){_0x59e8ec(null,path[_0x2874('0x18')](config[_0x2874('0x19')],_0x2874('0x1a')));},'filename':function(_0x3894cd,_0x39883f,_0x48de22){_0x48de22(null,util[_0x2874('0x1b')](_0x2874('0x1c'),_0x2874('0x1d'),path[_0x2874('0x1e')](_0x39883f[_0x2874('0x1f')])));}})});router[_0x2874('0x20')](_0x2874('0xf'),upload[_0x2874('0x21')]('file'),controller['addLogo']);var upload=multer({'storage':multer[_0x2874('0x17')]({'destination':function(_0x6b4c37,_0x32e030,_0x5e80c3){_0x5e80c3(null,path[_0x2874('0x18')](config['root'],_0x2874('0x1a')));},'filename':function(_0xf35aab,_0x370dc5,_0x54e7eb){_0x54e7eb(null,util['format'](_0x2874('0x1c'),_0x2874('0x22'),path[_0x2874('0x1e')](_0x370dc5[_0x2874('0x1f')])));}})});router[_0x2874('0x20')](_0x2874('0x11'),upload[_0x2874('0x21')](_0x2874('0x23')),controller[_0x2874('0x24')]);var upload=multer({'storage':multer[_0x2874('0x17')]({'destination':function(_0x4bb80f,_0x29d663,_0x26a819){_0x26a819(null,path['join'](config[_0x2874('0x19')],_0x2874('0x1a')));},'filename':function(_0xf28637,_0x2509c1,_0x30afad){_0x30afad(null,util[_0x2874('0x1b')](_0x2874('0x1c'),_0x2874('0x25'),path['extname'](_0x2509c1[_0x2874('0x1f')])));}})});router[_0x2874('0x20')](_0x2874('0x26'),upload[_0x2874('0x21')](_0x2874('0x23')),controller['addPreferred']);var upload=multer({'storage':multer[_0x2874('0x17')]({'destination':function(_0xfe45b2,_0x147707,_0x3660b2){_0x3660b2(null,path[_0x2874('0x18')](config[_0x2874('0x19')],_0x2874('0x1a')));},'filename':function(_0x22feb9,_0x59165d,_0x1b75d0){_0x1b75d0(null,util[_0x2874('0x1b')]('%s%s',_0x2874('0x27'),path[_0x2874('0x1e')](_0x59165d[_0x2874('0x1f')])));}})});router[_0x2874('0x20')](_0x2874('0x15'),upload[_0x2874('0x21')](_0x2874('0x23')),controller[_0x2874('0x28')]);router[_0x2874('0x29')](_0x2874('0x2a'),auth['isAuthenticated'](),controller[_0x2874('0x2b')]);module['exports']=router; \ No newline at end of file +var _0x5d80=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','/now','getDate','getLogo','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','diskStorage','join','root','format','%s%s','logo','extname','post','/:id/logo','single','file','addLogo','server/files/images/logos/','logologin','/:id/logo_login','addLogoLogin','favicon','originalname','/:id/favicon','put','update','exports'];(function(_0x53ca7c,_0x59cbc0){var _0x1be634=function(_0x456de2){while(--_0x456de2){_0x53ca7c['push'](_0x53ca7c['shift']());}};_0x1be634(++_0x59cbc0);}(_0x5d80,0x1a4));var _0x05d8=function(_0x482214,_0x10e89c){_0x482214=_0x482214-0x0;var _0xfd1cb2=_0x5d80[_0x482214];return _0xfd1cb2;};'use strict';var multer=require(_0x05d8('0x0'));var util=require('util');var path=require(_0x05d8('0x1'));var timeout=require(_0x05d8('0x2'));var express=require(_0x05d8('0x3'));var router=express[_0x05d8('0x4')]();var fs_extra=require(_0x05d8('0x5'));var auth=require(_0x05d8('0x6'));var interaction=require(_0x05d8('0x7'));var config=require(_0x05d8('0x8'));var controller=require(_0x05d8('0x9'));router[_0x05d8('0xa')]('/',auth[_0x05d8('0xb')](),controller['index']);router[_0x05d8('0xa')](_0x05d8('0xc'),controller[_0x05d8('0xd')]);router[_0x05d8('0xa')]('/:id',controller['show']);router[_0x05d8('0xa')]('/:id/logo',controller[_0x05d8('0xe')]);router[_0x05d8('0xa')]('/:id/logo_login',controller[_0x05d8('0xf')]);router[_0x05d8('0xa')](_0x05d8('0x10'),controller[_0x05d8('0x11')]);router[_0x05d8('0xa')](_0x05d8('0x12'),controller[_0x05d8('0x13')]);router['get']('/:id/favicon',controller['getFavicon']);var upload=multer({'storage':multer[_0x05d8('0x14')]({'destination':function(_0x52e51d,_0x32a01a,_0x543ba6){_0x543ba6(null,path[_0x05d8('0x15')](config[_0x05d8('0x16')],'server/files/images/logos/'));},'filename':function(_0x10a4b8,_0x4e4b9e,_0x1f2d6b){_0x1f2d6b(null,util[_0x05d8('0x17')](_0x05d8('0x18'),_0x05d8('0x19'),path[_0x05d8('0x1a')](_0x4e4b9e['originalname'])));}})});router[_0x05d8('0x1b')](_0x05d8('0x1c'),upload[_0x05d8('0x1d')](_0x05d8('0x1e')),controller[_0x05d8('0x1f')]);var upload=multer({'storage':multer[_0x05d8('0x14')]({'destination':function(_0x3cee38,_0x2905b6,_0x1c325f){_0x1c325f(null,path['join'](config['root'],_0x05d8('0x20')));},'filename':function(_0x5982ac,_0x3b55d6,_0x2422af){_0x2422af(null,util[_0x05d8('0x17')](_0x05d8('0x18'),_0x05d8('0x21'),path['extname'](_0x3b55d6['originalname'])));}})});router[_0x05d8('0x1b')](_0x05d8('0x22'),upload[_0x05d8('0x1d')](_0x05d8('0x1e')),controller[_0x05d8('0x23')]);var upload=multer({'storage':multer[_0x05d8('0x14')]({'destination':function(_0x18ccc3,_0x15823c,_0x5ed32f){_0x5ed32f(null,path[_0x05d8('0x15')](config[_0x05d8('0x16')],_0x05d8('0x20')));},'filename':function(_0x33fb70,_0x1336a2,_0x515f04){_0x515f04(null,util[_0x05d8('0x17')](_0x05d8('0x18'),'preferred',path[_0x05d8('0x1a')](_0x1336a2['originalname'])));}})});router[_0x05d8('0x1b')](_0x05d8('0x12'),upload[_0x05d8('0x1d')]('file'),controller['addPreferred']);var upload=multer({'storage':multer[_0x05d8('0x14')]({'destination':function(_0x546c1c,_0x3aaa7f,_0x5c474f){_0x5c474f(null,path[_0x05d8('0x15')](config[_0x05d8('0x16')],'server/files/images/logos/'));},'filename':function(_0x57cf62,_0x264a39,_0x3c4293){_0x3c4293(null,util['format']('%s%s',_0x05d8('0x24'),path[_0x05d8('0x1a')](_0x264a39[_0x05d8('0x25')])));}})});router[_0x05d8('0x1b')](_0x05d8('0x26'),upload[_0x05d8('0x1d')]('file'),controller['addFavicon']);router[_0x05d8('0x27')]('/:id',auth['isAuthenticated'](),controller[_0x05d8('0x28')]);module[_0x05d8('0x29')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 6ee2a1b..0989d2a 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 _0x1261=['exports','INTEGER','min_internal','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','alternate','UNSIGNED'];(function(_0x12d79d,_0x3c4f12){var _0x5cbe01=function(_0x51cab0){while(--_0x51cab0){_0x12d79d['push'](_0x12d79d['shift']());}};_0x5cbe01(++_0x3c4f12);}(_0x1261,0x144));var _0x1126=function(_0x57062a,_0x123026){_0x57062a=_0x57062a-0x0;var _0xa178da=_0x1261[_0x57062a];return _0xa178da;};'use strict';var Sequelize=require('sequelize');module[_0x1126('0x0')]={'min_internal':{'type':Sequelize[_0x1126('0x1')](0xb),'unique':_0x1126('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x1126('0x1')](0xb),'unique':_0x1126('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x1126('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x1126('0x4')],'defaultValue':_0x1126('0x5')},'logo':{'type':Sequelize[_0x1126('0x4')]},'defaultLogo':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x1126('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x1126('0x4')]},'turnaddr':{'type':Sequelize[_0x1126('0x4')]},'turnusername':{'type':Sequelize[_0x1126('0x4')]},'turnpassword':{'type':Sequelize[_0x1126('0x4')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x1126('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x1126('0x1')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x1126('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x1126('0x4')],'defaultValue':_0x1126('0x7')},'chatTimeout':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x1126('0x4')]},'defaultPreferred':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x1126('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x1126('0x4')]},'defaultFavicon':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x1126('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x1126('0x1')]},'transcribeRegion':{'type':Sequelize[_0x1126('0x4')]},'sentiment':{'type':Sequelize[_0x1126('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x1126('0x1')]},'sentimentRegion':{'type':Sequelize[_0x1126('0x4')]},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize['STRING']},'googleSsoEnabled':{'type':Sequelize[_0x1126('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x1126('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x1126('0x1')](0x2)[_0x1126('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x1126('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x1126('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0x7a54=['UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','alternate'];(function(_0x3656ec,_0x325614){var _0x39eefd=function(_0x19542e){while(--_0x19542e){_0x3656ec['push'](_0x3656ec['shift']());}};_0x39eefd(++_0x325614);}(_0x7a54,0x106));var _0x47a5=function(_0x589c47,_0x56d85d){_0x589c47=_0x589c47-0x0;var _0xb56553=_0x7a54[_0x589c47];return _0xb56553;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'min_internal':{'type':Sequelize[_0x47a5('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x47a5('0x2')](0xb),'unique':_0x47a5('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x47a5('0x4')],'defaultValue':_0x47a5('0x5')},'logo':{'type':Sequelize[_0x47a5('0x4')]},'defaultLogo':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x47a5('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x47a5('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x47a5('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x47a5('0x4')],'defaultValue':_0x47a5('0x7')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x47a5('0x4')]},'defaultPreferred':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x47a5('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x47a5('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x47a5('0x2')]},'transcribeRegion':{'type':Sequelize[_0x47a5('0x4')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x47a5('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0x47a5('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x47a5('0x2')](0x2)[_0x47a5('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x47a5('0x2')](0x2)[_0x47a5('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x47a5('0x2')](0x2)[_0x47a5('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)[_0x47a5('0x8')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index ccd2283..4af482e 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 _0x4756=['sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','find','body','file','logo','filename','addLogoLogin','loginLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','toLower','root','upperFirst','Sequelize','\x20not\x20found','download','getLogoLogin','default_loginLogo.svg','default','custom','ValidationError','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','default_favicon.ico','getDate','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','ejs','fs-extra','lodash','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','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','end','sendStatus','stack','name','send','Setting','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4756,0xa6));var _0x6475=function(_0x25dd09,_0x16cdcd){_0x25dd09=_0x25dd09-0x0;var _0x5520bb=_0x4756[_0x25dd09];return _0x5520bb;};'use strict';var emlformat=require(_0x6475('0x0'));var rimraf=require(_0x6475('0x1'));var zipdir=require(_0x6475('0x2'));var jsonpatch=require(_0x6475('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6475('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6475('0x5'));var fs=require('fs');var fs_extra=require(_0x6475('0x6'));var _=require(_0x6475('0x7'));var squel=require('squel');var crypto=require(_0x6475('0x8'));var jsforce=require(_0x6475('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6475('0xa'));var Papa=require(_0x6475('0xb'));var Redis=require(_0x6475('0xc'));var authService=require(_0x6475('0xd'));var qs=require(_0x6475('0xe'));var as=require(_0x6475('0xf'));var hardwareService=require(_0x6475('0x10'));var logger=require(_0x6475('0x11'))('api');var utils=require(_0x6475('0x12'));var config=require(_0x6475('0x13'));var licenseUtil=require(_0x6475('0x14'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x6475('0x15')][_0x6475('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x427bff,_0x1ae4c9,_0x32bb88,_0x1258ed){return new BPromise(function(_0x53ddbd,_0x1b1dbc){var _0x47747c=_0x1258ed||client;return _0x47747c[_0x6475('0x17')](_0x427bff,_0x32bb88)[_0x6475('0x18')](function(_0xa02fd6){logger[_0x6475('0x19')](_0x6475('0x1a'),_0x1ae4c9,_0x6475('0x1b'));logger[_0x6475('0x1c')](_0x6475('0x1d'),_0x1ae4c9,_0x6475('0x1b'),JSON[_0x6475('0x1e')](_0xa02fd6));if(_0xa02fd6[_0x6475('0x1f')]){if(_0xa02fd6[_0x6475('0x1f')][_0x6475('0x20')]===0x1f4){logger[_0x6475('0x1f')]('Setting,\x20%s,\x20%s',_0x1ae4c9,_0xa02fd6[_0x6475('0x1f')][_0x6475('0x21')]);return _0x1b1dbc(_0xa02fd6[_0x6475('0x1f')]['message']);}logger[_0x6475('0x1f')](_0x6475('0x1a'),_0x1ae4c9,_0xa02fd6[_0x6475('0x1f')][_0x6475('0x21')]);return _0x53ddbd(_0xa02fd6[_0x6475('0x1f')][_0x6475('0x21')]);}else{logger['info']('Setting,\x20%s,\x20%s',_0x1ae4c9,'request\x20sent');_0x53ddbd(_0xa02fd6[_0x6475('0x22')][_0x6475('0x21')]);}})[_0x6475('0x23')](function(_0x563082){logger[_0x6475('0x1f')]('Setting,\x20%s,\x20%s',_0x1ae4c9,_0x563082);_0x1b1dbc(_0x563082);});});}function respondWithStatusCode(_0x5b5d89,_0x513ed7){_0x513ed7=_0x513ed7||0xcc;return function(_0x219715){if(_0x219715){return _0x5b5d89['sendStatus'](_0x513ed7);}return _0x5b5d89['status'](_0x513ed7)['end']();};}function respondWithResult(_0x5a83c2,_0x310115){_0x310115=_0x310115||0xc8;return function(_0x13c0c3){if(_0x13c0c3){return _0x5a83c2[_0x6475('0x24')](_0x310115)['json'](_0x13c0c3);}};}function respondWithFilteredResult(_0x18ef16,_0xce3662){return function(_0x23e096){if(_0x23e096){var _0x541035=typeof _0xce3662[_0x6475('0x25')]===_0x6475('0x26')&&typeof _0xce3662[_0x6475('0x27')]===_0x6475('0x26');var _0x189abb=_0x23e096[_0x6475('0x28')];var _0xb4a0fb=_0x541035?0x0:_0xce3662[_0x6475('0x25')];var _0x369088=_0x541035?_0x23e096[_0x6475('0x28')]:_0xce3662[_0x6475('0x25')]+_0xce3662[_0x6475('0x27')];var _0x5563ee;if(_0x369088>=_0x189abb){_0x369088=_0x189abb;_0x5563ee=0xc8;}else{_0x5563ee=0xce;}_0x18ef16[_0x6475('0x24')](_0x5563ee);return _0x18ef16[_0x6475('0x29')]('Content-Range',_0xb4a0fb+'-'+_0x369088+'/'+_0x189abb)[_0x6475('0x2a')](_0x23e096);}return null;};}function patchUpdates(_0x3d0058){return function(_0xcbe2e4){try{jsonpatch[_0x6475('0x2b')](_0xcbe2e4,_0x3d0058,!![]);}catch(_0x42a92b){return BPromise[_0x6475('0x2c')](_0x42a92b);}return _0xcbe2e4[_0x6475('0x2d')]();};}function saveUpdates(_0x31242f,_0xbe38f){return function(_0x31cdcb){if(_0x31cdcb){return _0x31cdcb[_0x6475('0x2e')](_0x31242f)[_0x6475('0x18')](function(_0x2c032a){return _0x2c032a;});}return null;};}function removeEntity(_0x141159,_0x5d0792){return function(_0x898a36){if(_0x898a36){return _0x898a36[_0x6475('0x2f')]()[_0x6475('0x18')](function(){_0x141159[_0x6475('0x24')](0xcc)[_0x6475('0x30')]();});}};}function handleEntityNotFound(_0x56b7be,_0x27f1a7){return function(_0x104736){if(!_0x104736){_0x56b7be[_0x6475('0x31')](0x194);}return _0x104736;};}function handleError(_0x15f68c,_0x323f70){_0x323f70=_0x323f70||0x1f4;return function(_0x3a1c42){logger[_0x6475('0x1f')](_0x3a1c42[_0x6475('0x32')]);if(_0x3a1c42[_0x6475('0x33')]){delete _0x3a1c42[_0x6475('0x33')];}_0x15f68c[_0x6475('0x24')](_0x323f70)[_0x6475('0x34')](_0x3a1c42);};}exports['index']=function(_0xf9192d,_0x8581fc){var _0x2c786c={},_0x3dfa3b={},_0x4ec718={'count':0x0,'rows':[]};var _0x2f96c2=_['map'](db[_0x6475('0x35')]['rawAttributes'],function(_0x4dd7ef){return{'name':_0x4dd7ef['fieldName'],'type':_0x4dd7ef[_0x6475('0x36')][_0x6475('0x37')]};});_0x3dfa3b[_0x6475('0x38')]=_[_0x6475('0x39')](_0x2f96c2,'name');_0x3dfa3b[_0x6475('0x3a')]=_[_0x6475('0x3b')](_0xf9192d['query']);_0x3dfa3b[_0x6475('0x3c')]=_[_0x6475('0x3d')](_0x3dfa3b[_0x6475('0x38')],_0x3dfa3b['query']);_0x2c786c[_0x6475('0x3e')]=_[_0x6475('0x3d')](_0x3dfa3b['model'],qs[_0x6475('0x3f')](_0xf9192d[_0x6475('0x3a')][_0x6475('0x3f')]));_0x2c786c[_0x6475('0x3e')]=_0x2c786c['attributes']['length']?_0x2c786c[_0x6475('0x3e')]:_0x3dfa3b[_0x6475('0x38')];if(!_0xf9192d[_0x6475('0x3a')][_0x6475('0x40')](_0x6475('0x41'))){_0x2c786c[_0x6475('0x27')]=qs[_0x6475('0x27')](_0xf9192d[_0x6475('0x3a')][_0x6475('0x27')]);_0x2c786c[_0x6475('0x25')]=qs[_0x6475('0x25')](_0xf9192d[_0x6475('0x3a')][_0x6475('0x25')]);}_0x2c786c['order']=qs[_0x6475('0x42')](_0xf9192d[_0x6475('0x3a')][_0x6475('0x42')]);_0x2c786c[_0x6475('0x43')]=qs['filters'](_['pick'](_0xf9192d[_0x6475('0x3a')],_0x3dfa3b[_0x6475('0x3c')]),_0x2f96c2);if(_0xf9192d[_0x6475('0x3a')]['filter']){_0x2c786c[_0x6475('0x43')]=_[_0x6475('0x44')](_0x2c786c[_0x6475('0x43')],{'$or':_['map'](_0x2f96c2,function(_0x2b4b7c){if(_0x2b4b7c[_0x6475('0x36')]!==_0x6475('0x45')){var _0x55b79b={};_0x55b79b[_0x2b4b7c[_0x6475('0x33')]]={'$like':'%'+_0xf9192d['query'][_0x6475('0x46')]+'%'};return _0x55b79b;}})});}_0x2c786c=_[_0x6475('0x44')]({},_0x2c786c,_0xf9192d[_0x6475('0x47')]);var _0x2e907c={'where':_0x2c786c[_0x6475('0x43')]};return db['Setting'][_0x6475('0x28')](_0x2e907c)[_0x6475('0x18')](function(_0x17cfc0){_0x4ec718['count']=_0x17cfc0;if(_0xf9192d[_0x6475('0x3a')][_0x6475('0x48')]){_0x2c786c[_0x6475('0x49')]=[{'all':!![]}];}return db['Setting'][_0x6475('0x4a')](_0x2c786c);})[_0x6475('0x18')](function(_0x5fc6ef){_0x4ec718[_0x6475('0x4b')]=_0x5fc6ef;return _0x4ec718;})[_0x6475('0x18')](respondWithFilteredResult(_0x8581fc,_0x2c786c))[_0x6475('0x23')](handleError(_0x8581fc,null));};exports['show']=function(_0x5d3431,_0x45722d){var _0xd5486c={'raw':![],'where':{'id':_0x5d3431[_0x6475('0x4c')]['id']}},_0x1e479c={};_0x1e479c[_0x6475('0x38')]=_[_0x6475('0x3b')](db['Setting']['rawAttributes']);_0x1e479c[_0x6475('0x3a')]=_[_0x6475('0x3b')](_0x5d3431[_0x6475('0x3a')]);_0x1e479c[_0x6475('0x3c')]=_[_0x6475('0x3d')](_0x1e479c[_0x6475('0x38')],_0x1e479c['query']);_0xd5486c['attributes']=_[_0x6475('0x3d')](_0x1e479c[_0x6475('0x38')],qs[_0x6475('0x3f')](_0x5d3431['query']['fields']));_0xd5486c[_0x6475('0x3e')]=_0xd5486c['attributes']['length']?_0xd5486c[_0x6475('0x3e')]:_0x1e479c[_0x6475('0x38')];if(_0x5d3431[_0x6475('0x3a')][_0x6475('0x48')]){_0xd5486c[_0x6475('0x49')]=[{'all':!![]}];}_0xd5486c=_[_0x6475('0x44')]({},_0xd5486c,_0x5d3431[_0x6475('0x47')]);return db[_0x6475('0x35')][_0x6475('0x4d')](_0xd5486c)[_0x6475('0x18')](handleEntityNotFound(_0x45722d,null))['then'](respondWithResult(_0x45722d,null))[_0x6475('0x23')](handleError(_0x45722d,null));};exports['update']=function(_0xe63dd1,_0x5ce0c0){if(_0xe63dd1[_0x6475('0x4e')]['id']){delete _0xe63dd1[_0x6475('0x4e')]['id'];}return db['Setting']['find']({'where':{'id':_0xe63dd1[_0x6475('0x4c')]['id']}})[_0x6475('0x18')](handleEntityNotFound(_0x5ce0c0,null))[_0x6475('0x18')](saveUpdates(_0xe63dd1[_0x6475('0x4e')],null))[_0x6475('0x18')](respondWithResult(_0x5ce0c0,null))[_0x6475('0x23')](handleError(_0x5ce0c0,null));};exports['addLogo']=function(_0x1b8f56,_0x302a23,_0x1fc24f){if(_0x1b8f56[_0x6475('0x4f')]&&_0x1b8f56[_0x6475('0x4f')]['filename']){_0x1b8f56['body'][_0x6475('0x50')]=_0x1b8f56[_0x6475('0x4f')][_0x6475('0x51')];}return db[_0x6475('0x35')]['find']({'where':{'id':_0x1b8f56['params']['id']}})[_0x6475('0x18')](handleEntityNotFound(_0x302a23,null))[_0x6475('0x18')](saveUpdates(_0x1b8f56['body'],null))[_0x6475('0x18')](respondWithResult(_0x302a23,null))[_0x6475('0x23')](handleError(_0x302a23,null));};exports[_0x6475('0x52')]=function(_0x19580f,_0x221f60,_0x34f6c4){if(_0x19580f['file']&&_0x19580f[_0x6475('0x4f')][_0x6475('0x51')]){_0x19580f[_0x6475('0x4e')][_0x6475('0x53')]=_0x19580f['file']['filename'];}return db[_0x6475('0x35')]['find']({'where':{'id':_0x19580f['params']['id']}})[_0x6475('0x18')](handleEntityNotFound(_0x221f60,null))[_0x6475('0x18')](saveUpdates(_0x19580f[_0x6475('0x4e')],null))[_0x6475('0x18')](respondWithResult(_0x221f60,null))[_0x6475('0x23')](handleError(_0x221f60,null));};var utilLicense=require('../../config/license/util');exports['getLogo']=function(_0x3821e6,_0x5ceb15,_0xf5dba6){var _0x4dbad0=_0x6475('0x54');var _0x56218f={'custom':![]};return utilLicense[_0x6475('0x55')]()[_0x6475('0x18')](function(_0x3ff3d0){if(_0x3ff3d0){_0x56218f=_0x3ff3d0;}return db[_0x6475('0x35')][_0x6475('0x4d')]({'where':{'id':_0x3821e6[_0x6475('0x4c')]['id']},'attributes':[_0x6475('0x50'),_0x6475('0x53'),_0x6475('0x56'),_0x6475('0x57'),_0x6475('0x58'),_0x6475('0x59'),_0x6475('0x5a'),_0x6475('0x5b')],'raw':!![]});})[_0x6475('0x18')](handleEntityNotFound(_0x5ceb15,null))['then'](function(_0x44d7c1){if(_0x44d7c1){var _0x2c09fe=_0x44d7c1[_0x6475('0x50')]&&fs[_0x6475('0x5c')](path[_0x6475('0x5d')](config['root'],_0x4dbad0,_[_0x6475('0x5e')](_0x44d7c1[_0x6475('0x50')])))?path[_0x6475('0x5d')](config[_0x6475('0x5f')],_0x4dbad0,_[_0x6475('0x5e')](_0x44d7c1[_0x6475('0x50')])):path[_0x6475('0x5d')](config[_0x6475('0x5f')],_0x4dbad0,_[_0x6475('0x5e')]('default_logo.svg'));var _0xb6b3f4='default'+_[_0x6475('0x60')]('logo');if(_0x44d7c1[_0xb6b3f4]||!_0x56218f['custom']){_0x2c09fe=path[_0x6475('0x5d')](config[_0x6475('0x5f')],_0x4dbad0,_[_0x6475('0x5e')]('default_logo.svg'));}if(!fs[_0x6475('0x5c')](_0x2c09fe)){throw new db[(_0x6475('0x61'))]['ValidationError'](_[_0x6475('0x60')]('logo')+_0x6475('0x62'));}return _0x5ceb15[_0x6475('0x63')](_0x2c09fe);}})[_0x6475('0x23')](handleError(_0x5ceb15,null));};var utilLicense=require('../../config/license/util');exports[_0x6475('0x64')]=function(_0x47ebc1,_0xba915d,_0xefcff2){var _0x2ae54b=_0x6475('0x54');var _0x21803a={'custom':![]};return utilLicense[_0x6475('0x55')]()['then'](function(_0x3dfa90){if(_0x3dfa90){_0x21803a=_0x3dfa90;}return db[_0x6475('0x35')]['find']({'where':{'id':_0x47ebc1[_0x6475('0x4c')]['id']},'attributes':['logo',_0x6475('0x53'),_0x6475('0x56'),_0x6475('0x57'),_0x6475('0x58'),_0x6475('0x59'),_0x6475('0x5a'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0xba915d,null))[_0x6475('0x18')](function(_0x186f91){if(_0x186f91){var _0xd39f9b=_0x186f91[_0x6475('0x53')]&&fs['existsSync'](path['join'](config[_0x6475('0x5f')],_0x2ae54b,_[_0x6475('0x5e')](_0x186f91[_0x6475('0x53')])))?path['join'](config['root'],_0x2ae54b,_[_0x6475('0x5e')](_0x186f91['loginLogo'])):path['join'](config[_0x6475('0x5f')],_0x2ae54b,_[_0x6475('0x5e')](_0x6475('0x65')));var _0x393ebe=_0x6475('0x66')+_[_0x6475('0x60')](_0x6475('0x53'));if(_0x186f91[_0x393ebe]||!_0x21803a[_0x6475('0x67')]){_0xd39f9b=path[_0x6475('0x5d')](config[_0x6475('0x5f')],_0x2ae54b,_[_0x6475('0x5e')]('default_loginLogo.svg'));}if(!fs[_0x6475('0x5c')](_0xd39f9b)){throw new db['Sequelize'][(_0x6475('0x68'))](_[_0x6475('0x60')](_0x6475('0x53'))+_0x6475('0x62'));}return _0xba915d[_0x6475('0x63')](_0xd39f9b);}})['catch'](handleError(_0xba915d,null));};exports[_0x6475('0x69')]=function(_0x382498,_0x2c9f3d){return db[_0x6475('0x35')]['find']({'where':{'id':_0x382498[_0x6475('0x4c')]['id']},'attributes':[_0x6475('0x6a')]})[_0x6475('0x18')](respondWithResult(_0x2c9f3d,null))[_0x6475('0x23')](handleError(_0x2c9f3d,null));};exports[_0x6475('0x6b')]=function(_0x43c0e3,_0x48f6d0,_0x30f72b){if(_0x43c0e3[_0x6475('0x4f')]&&_0x43c0e3[_0x6475('0x4f')][_0x6475('0x51')]){_0x43c0e3[_0x6475('0x4e')][_0x6475('0x56')]=_0x43c0e3[_0x6475('0x4f')][_0x6475('0x51')];}return db[_0x6475('0x35')][_0x6475('0x4d')]({'where':{'id':_0x43c0e3[_0x6475('0x4c')]['id']}})[_0x6475('0x18')](handleEntityNotFound(_0x48f6d0,null))[_0x6475('0x18')](saveUpdates(_0x43c0e3['body'],null))['then'](respondWithResult(_0x48f6d0,null))[_0x6475('0x23')](handleError(_0x48f6d0,null));};var utilLicense=require(_0x6475('0x14'));exports[_0x6475('0x6c')]=function(_0x20375f,_0xffc409,_0x3253dd){var _0x42fb58=_0x6475('0x54');var _0x438221={'custom':![]};return utilLicense[_0x6475('0x55')]()['then'](function(_0x4d7826){if(_0x4d7826){_0x438221=_0x4d7826;}return db[_0x6475('0x35')][_0x6475('0x4d')]({'where':{'id':_0x20375f[_0x6475('0x4c')]['id']},'attributes':[_0x6475('0x50'),_0x6475('0x53'),'preferred',_0x6475('0x57'),_0x6475('0x58'),_0x6475('0x59'),_0x6475('0x5a'),'defaultFavicon'],'raw':!![]});})[_0x6475('0x18')](handleEntityNotFound(_0xffc409,null))[_0x6475('0x18')](function(_0x7b9561){if(_0x7b9561){var _0x20444e=_0x7b9561[_0x6475('0x56')]&&fs[_0x6475('0x5c')](path[_0x6475('0x5d')](config[_0x6475('0x5f')],_0x42fb58,_['toLower'](_0x7b9561[_0x6475('0x56')])))?path['join'](config[_0x6475('0x5f')],_0x42fb58,_['toLower'](_0x7b9561[_0x6475('0x56')])):path[_0x6475('0x5d')](config['root'],_0x42fb58,_[_0x6475('0x5e')](_0x6475('0x6d')));var _0xbd43c7='default'+_[_0x6475('0x60')](_0x6475('0x56'));if(_0x7b9561[_0xbd43c7]||!_0x438221[_0x6475('0x67')]||!_0x438221[_0x6475('0x56')]){_0x20444e=path['join'](config[_0x6475('0x5f')],_0x42fb58,_[_0x6475('0x5e')]('default_preferred.png'));}if(!fs[_0x6475('0x5c')](_0x20444e)){throw new db[(_0x6475('0x61'))][(_0x6475('0x68'))](_[_0x6475('0x60')](_0x6475('0x56'))+_0x6475('0x62'));}return _0xffc409['download'](_0x20444e);}})['catch'](handleError(_0xffc409,null));};exports[_0x6475('0x6e')]=function(_0x358115,_0x487897,_0x1898dd){if(_0x358115['file']&&_0x358115[_0x6475('0x4f')][_0x6475('0x51')]){_0x358115['body'][_0x6475('0x57')]=_0x358115[_0x6475('0x4f')][_0x6475('0x51')];}return db[_0x6475('0x35')][_0x6475('0x4d')]({'where':{'id':_0x358115['params']['id']}})['then'](handleEntityNotFound(_0x487897,null))[_0x6475('0x18')](saveUpdates(_0x358115[_0x6475('0x4e')],null))[_0x6475('0x18')](respondWithResult(_0x487897,null))['catch'](handleError(_0x487897,null));};var utilLicense=require(_0x6475('0x14'));exports['getFavicon']=function(_0x2ebb53,_0x56b450,_0x5131d7){var _0x53d62a=_0x6475('0x54');var _0x45ee28={'custom':![]};return utilLicense[_0x6475('0x55')]()[_0x6475('0x18')](function(_0x10f605){if(_0x10f605){_0x45ee28=_0x10f605;}return db[_0x6475('0x35')][_0x6475('0x4d')]({'where':{'id':_0x2ebb53['params']['id']},'attributes':[_0x6475('0x50'),_0x6475('0x53'),_0x6475('0x56'),_0x6475('0x57'),_0x6475('0x58'),_0x6475('0x59'),_0x6475('0x5a'),'defaultFavicon'],'raw':!![]});})[_0x6475('0x18')](handleEntityNotFound(_0x56b450,null))['then'](function(_0x37fd06){if(_0x37fd06){var _0x49233b=_0x37fd06[_0x6475('0x57')]&&fs[_0x6475('0x5c')](path[_0x6475('0x5d')](config[_0x6475('0x5f')],_0x53d62a,_[_0x6475('0x5e')](_0x37fd06[_0x6475('0x57')])))?path['join'](config[_0x6475('0x5f')],_0x53d62a,_[_0x6475('0x5e')](_0x37fd06[_0x6475('0x57')])):path[_0x6475('0x5d')](config[_0x6475('0x5f')],_0x53d62a,_[_0x6475('0x5e')](_0x6475('0x6f')));var _0x1c4d13='default'+_[_0x6475('0x60')](_0x6475('0x57'));if(_0x37fd06[_0x1c4d13]||!_0x45ee28[_0x6475('0x67')]){_0x49233b=path[_0x6475('0x5d')](config[_0x6475('0x5f')],_0x53d62a,_['toLower']('default_favicon.ico'));}if(!fs[_0x6475('0x5c')](_0x49233b)){throw new db['Sequelize'][(_0x6475('0x68'))](_[_0x6475('0x60')](_0x6475('0x57'))+_0x6475('0x62'));}return _0x56b450[_0x6475('0x63')](_0x49233b);}})['catch'](handleError(_0x56b450,null));};exports[_0x6475('0x70')]=function(_0x61a899,_0x3f31e0){var _0x44dff1={'offset':moment()['utcOffset']()};_0x44dff1['now']=moment()[_0x6475('0x71')](_0x44dff1['offset'])[_0x6475('0x72')](_0x6475('0x73'));return _0x3f31e0['status'](0xc8)[_0x6475('0x34')](_0x44dff1);}; \ No newline at end of file +var _0x7c8e=['Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','defaultLogo','default_loginLogo.svg','default','addPreferred','getPreferred','defaultLoginLogo','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','error','code','Setting,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','end','name','send','index','map','Setting','fieldName','model','keys','filters','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','intersection','update','body','find','addLogo','file','filename','logo','addLogoLogin','loginLogo','../../config/license/util','server/files/images/logos','getLicense','preferred','favicon','defaultPreferred','toLower','join','root','default_logo.svg','upperFirst','custom','existsSync'];(function(_0x3c2b2e,_0x3e6e53){var _0x27a338=function(_0x40d29d){while(--_0x40d29d){_0x3c2b2e['push'](_0x3c2b2e['shift']());}};_0x27a338(++_0x3e6e53);}(_0x7c8e,0x10e));var _0xe7c8=function(_0x3be0c4,_0x5b7eff){_0x3be0c4=_0x3be0c4-0x0;var _0x11af9f=_0x7c8e[_0x3be0c4];return _0x11af9f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe7c8('0x0'));var zipdir=require(_0xe7c8('0x1'));var jsonpatch=require(_0xe7c8('0x2'));var rp=require(_0xe7c8('0x3'));var moment=require(_0xe7c8('0x4'));var BPromise=require(_0xe7c8('0x5'));var Mustache=require(_0xe7c8('0x6'));var util=require(_0xe7c8('0x7'));var path=require(_0xe7c8('0x8'));var sox=require(_0xe7c8('0x9'));var csv=require(_0xe7c8('0xa'));var ejs=require(_0xe7c8('0xb'));var fs=require('fs');var fs_extra=require(_0xe7c8('0xc'));var _=require(_0xe7c8('0xd'));var squel=require(_0xe7c8('0xe'));var crypto=require(_0xe7c8('0xf'));var jsforce=require(_0xe7c8('0x10'));var deskjs=require(_0xe7c8('0x11'));var toCsv=require('to-csv');var querystring=require(_0xe7c8('0x12'));var Papa=require(_0xe7c8('0x13'));var Redis=require(_0xe7c8('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xe7c8('0x15'));var as=require(_0xe7c8('0x16'));var hardwareService=require(_0xe7c8('0x17'));var logger=require(_0xe7c8('0x18'))(_0xe7c8('0x19'));var utils=require(_0xe7c8('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe7c8('0x1b'))['db'];var jayson=require(_0xe7c8('0x1c'));var client=jayson[_0xe7c8('0x1d')][_0xe7c8('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x39ad49,_0x449265,_0x4e2266,_0x53b2ac){return new BPromise(function(_0x37c6be,_0x593bf1){var _0x47dcc0=_0x53b2ac||client;return _0x47dcc0[_0xe7c8('0x1f')](_0x39ad49,_0x4e2266)[_0xe7c8('0x20')](function(_0x564250){logger[_0xe7c8('0x21')]('Setting,\x20%s,\x20%s',_0x449265,'request\x20sent');logger['debug']('Setting,\x20%s,\x20%s,\x20%s',_0x449265,_0xe7c8('0x22'),JSON['stringify'](_0x564250));if(_0x564250[_0xe7c8('0x23')]){if(_0x564250[_0xe7c8('0x23')][_0xe7c8('0x24')]===0x1f4){logger[_0xe7c8('0x23')](_0xe7c8('0x25'),_0x449265,_0x564250[_0xe7c8('0x23')][_0xe7c8('0x26')]);return _0x593bf1(_0x564250[_0xe7c8('0x23')][_0xe7c8('0x26')]);}logger['error'](_0xe7c8('0x25'),_0x449265,_0x564250['error'][_0xe7c8('0x26')]);return _0x37c6be(_0x564250[_0xe7c8('0x23')][_0xe7c8('0x26')]);}else{logger[_0xe7c8('0x21')](_0xe7c8('0x25'),_0x449265,_0xe7c8('0x22'));_0x37c6be(_0x564250[_0xe7c8('0x27')][_0xe7c8('0x26')]);}})[_0xe7c8('0x28')](function(_0x400d8a){logger[_0xe7c8('0x23')](_0xe7c8('0x25'),_0x449265,_0x400d8a);_0x593bf1(_0x400d8a);});});}function respondWithStatusCode(_0x2f9a8d,_0x392b79){_0x392b79=_0x392b79||0xcc;return function(_0xa4ab98){if(_0xa4ab98){return _0x2f9a8d[_0xe7c8('0x29')](_0x392b79);}return _0x2f9a8d[_0xe7c8('0x2a')](_0x392b79)['end']();};}function respondWithResult(_0x50f015,_0x45b926){_0x45b926=_0x45b926||0xc8;return function(_0x4d10e5){if(_0x4d10e5){return _0x50f015['status'](_0x45b926)[_0xe7c8('0x2b')](_0x4d10e5);}};}function respondWithFilteredResult(_0x3bf2bd,_0x2cec18){return function(_0x15c3aa){if(_0x15c3aa){var _0x477627=typeof _0x2cec18[_0xe7c8('0x2c')]===_0xe7c8('0x2d')&&typeof _0x2cec18[_0xe7c8('0x2e')]===_0xe7c8('0x2d');var _0x4d5e9b=_0x15c3aa[_0xe7c8('0x2f')];var _0x7985d8=_0x477627?0x0:_0x2cec18['offset'];var _0x5d4753=_0x477627?_0x15c3aa[_0xe7c8('0x2f')]:_0x2cec18[_0xe7c8('0x2c')]+_0x2cec18[_0xe7c8('0x2e')];var _0x5d5cab;if(_0x5d4753>=_0x4d5e9b){_0x5d4753=_0x4d5e9b;_0x5d5cab=0xc8;}else{_0x5d5cab=0xce;}_0x3bf2bd[_0xe7c8('0x2a')](_0x5d5cab);return _0x3bf2bd[_0xe7c8('0x30')](_0xe7c8('0x31'),_0x7985d8+'-'+_0x5d4753+'/'+_0x4d5e9b)[_0xe7c8('0x2b')](_0x15c3aa);}return null;};}function patchUpdates(_0x277bd1){return function(_0x1ef18c){try{jsonpatch['apply'](_0x1ef18c,_0x277bd1,!![]);}catch(_0x2ac550){return BPromise['reject'](_0x2ac550);}return _0x1ef18c[_0xe7c8('0x32')]();};}function saveUpdates(_0xe13157,_0x43ee15){return function(_0x115352){if(_0x115352){return _0x115352['update'](_0xe13157)[_0xe7c8('0x20')](function(_0x2ea785){return _0x2ea785;});}return null;};}function removeEntity(_0x3e2df4,_0x18d162){return function(_0x197931){if(_0x197931){return _0x197931['destroy']()['then'](function(){_0x3e2df4[_0xe7c8('0x2a')](0xcc)[_0xe7c8('0x33')]();});}};}function handleEntityNotFound(_0x1c4c3a,_0x3ad3ad){return function(_0x53bfa6){if(!_0x53bfa6){_0x1c4c3a['sendStatus'](0x194);}return _0x53bfa6;};}function handleError(_0x4017a8,_0x413c9e){_0x413c9e=_0x413c9e||0x1f4;return function(_0xbfcc83){logger[_0xe7c8('0x23')](_0xbfcc83['stack']);if(_0xbfcc83[_0xe7c8('0x34')]){delete _0xbfcc83[_0xe7c8('0x34')];}_0x4017a8[_0xe7c8('0x2a')](_0x413c9e)[_0xe7c8('0x35')](_0xbfcc83);};}exports[_0xe7c8('0x36')]=function(_0x3374a5,_0x587102){var _0xf786c2={},_0x4c58bf={},_0x5291f2={'count':0x0,'rows':[]};var _0x14ea48=_[_0xe7c8('0x37')](db[_0xe7c8('0x38')]['rawAttributes'],function(_0x581cd5){return{'name':_0x581cd5[_0xe7c8('0x39')],'type':_0x581cd5['type']['key']};});_0x4c58bf[_0xe7c8('0x3a')]=_[_0xe7c8('0x37')](_0x14ea48,_0xe7c8('0x34'));_0x4c58bf['query']=_[_0xe7c8('0x3b')](_0x3374a5['query']);_0x4c58bf[_0xe7c8('0x3c')]=_['intersection'](_0x4c58bf[_0xe7c8('0x3a')],_0x4c58bf[_0xe7c8('0x3d')]);_0xf786c2[_0xe7c8('0x3e')]=_['intersection'](_0x4c58bf[_0xe7c8('0x3a')],qs[_0xe7c8('0x3f')](_0x3374a5['query'][_0xe7c8('0x3f')]));_0xf786c2[_0xe7c8('0x3e')]=_0xf786c2[_0xe7c8('0x3e')][_0xe7c8('0x40')]?_0xf786c2[_0xe7c8('0x3e')]:_0x4c58bf[_0xe7c8('0x3a')];if(!_0x3374a5[_0xe7c8('0x3d')][_0xe7c8('0x41')](_0xe7c8('0x42'))){_0xf786c2[_0xe7c8('0x2e')]=qs[_0xe7c8('0x2e')](_0x3374a5[_0xe7c8('0x3d')][_0xe7c8('0x2e')]);_0xf786c2[_0xe7c8('0x2c')]=qs['offset'](_0x3374a5['query'][_0xe7c8('0x2c')]);}_0xf786c2[_0xe7c8('0x43')]=qs['sort'](_0x3374a5[_0xe7c8('0x3d')][_0xe7c8('0x44')]);_0xf786c2[_0xe7c8('0x45')]=qs['filters'](_['pick'](_0x3374a5['query'],_0x4c58bf['filters']),_0x14ea48);if(_0x3374a5['query'][_0xe7c8('0x46')]){_0xf786c2['where']=_[_0xe7c8('0x47')](_0xf786c2[_0xe7c8('0x45')],{'$or':_[_0xe7c8('0x37')](_0x14ea48,function(_0x1e2637){if(_0x1e2637[_0xe7c8('0x48')]!==_0xe7c8('0x49')){var _0x2f9c80={};_0x2f9c80[_0x1e2637[_0xe7c8('0x34')]]={'$like':'%'+_0x3374a5['query']['filter']+'%'};return _0x2f9c80;}})});}_0xf786c2=_[_0xe7c8('0x47')]({},_0xf786c2,_0x3374a5[_0xe7c8('0x4a')]);var _0x3d93d5={'where':_0xf786c2[_0xe7c8('0x45')]};return db[_0xe7c8('0x38')]['count'](_0x3d93d5)[_0xe7c8('0x20')](function(_0x52d4b8){_0x5291f2['count']=_0x52d4b8;if(_0x3374a5['query'][_0xe7c8('0x4b')]){_0xf786c2[_0xe7c8('0x4c')]=[{'all':!![]}];}return db[_0xe7c8('0x38')][_0xe7c8('0x4d')](_0xf786c2);})['then'](function(_0x15f4a2){_0x5291f2[_0xe7c8('0x4e')]=_0x15f4a2;return _0x5291f2;})[_0xe7c8('0x20')](respondWithFilteredResult(_0x587102,_0xf786c2))[_0xe7c8('0x28')](handleError(_0x587102,null));};exports[_0xe7c8('0x4f')]=function(_0x2e40a8,_0x16b6a6){var _0x3dab82={'raw':![],'where':{'id':_0x2e40a8[_0xe7c8('0x50')]['id']}},_0x57ccf4={};_0x57ccf4[_0xe7c8('0x3a')]=_[_0xe7c8('0x3b')](db[_0xe7c8('0x38')][_0xe7c8('0x51')]);_0x57ccf4['query']=_['keys'](_0x2e40a8[_0xe7c8('0x3d')]);_0x57ccf4[_0xe7c8('0x3c')]=_[_0xe7c8('0x52')](_0x57ccf4[_0xe7c8('0x3a')],_0x57ccf4[_0xe7c8('0x3d')]);_0x3dab82['attributes']=_[_0xe7c8('0x52')](_0x57ccf4[_0xe7c8('0x3a')],qs['fields'](_0x2e40a8[_0xe7c8('0x3d')]['fields']));_0x3dab82[_0xe7c8('0x3e')]=_0x3dab82['attributes']['length']?_0x3dab82[_0xe7c8('0x3e')]:_0x57ccf4[_0xe7c8('0x3a')];if(_0x2e40a8[_0xe7c8('0x3d')][_0xe7c8('0x4b')]){_0x3dab82[_0xe7c8('0x4c')]=[{'all':!![]}];}_0x3dab82=_[_0xe7c8('0x47')]({},_0x3dab82,_0x2e40a8['options']);return db[_0xe7c8('0x38')]['find'](_0x3dab82)['then'](handleEntityNotFound(_0x16b6a6,null))[_0xe7c8('0x20')](respondWithResult(_0x16b6a6,null))[_0xe7c8('0x28')](handleError(_0x16b6a6,null));};exports[_0xe7c8('0x53')]=function(_0x4a23eb,_0xf4ab68){if(_0x4a23eb[_0xe7c8('0x54')]['id']){delete _0x4a23eb['body']['id'];}return db[_0xe7c8('0x38')][_0xe7c8('0x55')]({'where':{'id':_0x4a23eb[_0xe7c8('0x50')]['id']}})[_0xe7c8('0x20')](handleEntityNotFound(_0xf4ab68,null))[_0xe7c8('0x20')](saveUpdates(_0x4a23eb[_0xe7c8('0x54')],null))[_0xe7c8('0x20')](respondWithResult(_0xf4ab68,null))[_0xe7c8('0x28')](handleError(_0xf4ab68,null));};exports[_0xe7c8('0x56')]=function(_0x14791a,_0x240e2c,_0x3f2ff0){if(_0x14791a[_0xe7c8('0x57')]&&_0x14791a['file'][_0xe7c8('0x58')]){_0x14791a[_0xe7c8('0x54')][_0xe7c8('0x59')]=_0x14791a['file']['filename'];}return db[_0xe7c8('0x38')][_0xe7c8('0x55')]({'where':{'id':_0x14791a[_0xe7c8('0x50')]['id']}})[_0xe7c8('0x20')](handleEntityNotFound(_0x240e2c,null))[_0xe7c8('0x20')](saveUpdates(_0x14791a[_0xe7c8('0x54')],null))[_0xe7c8('0x20')](respondWithResult(_0x240e2c,null))[_0xe7c8('0x28')](handleError(_0x240e2c,null));};exports[_0xe7c8('0x5a')]=function(_0x473430,_0x25c4c5,_0x1091d0){if(_0x473430['file']&&_0x473430[_0xe7c8('0x57')][_0xe7c8('0x58')]){_0x473430[_0xe7c8('0x54')][_0xe7c8('0x5b')]=_0x473430[_0xe7c8('0x57')][_0xe7c8('0x58')];}return db[_0xe7c8('0x38')][_0xe7c8('0x55')]({'where':{'id':_0x473430['params']['id']}})[_0xe7c8('0x20')](handleEntityNotFound(_0x25c4c5,null))[_0xe7c8('0x20')](saveUpdates(_0x473430[_0xe7c8('0x54')],null))[_0xe7c8('0x20')](respondWithResult(_0x25c4c5,null))[_0xe7c8('0x28')](handleError(_0x25c4c5,null));};var utilLicense=require(_0xe7c8('0x5c'));exports['getLogo']=function(_0x4bedc2,_0x10b563,_0x3e3d6f){var _0x2a7eec=_0xe7c8('0x5d');var _0x52b4e4={'custom':![]};return utilLicense[_0xe7c8('0x5e')]()[_0xe7c8('0x20')](function(_0x283b00){if(_0x283b00){_0x52b4e4=_0x283b00;}return db[_0xe7c8('0x38')]['find']({'where':{'id':_0x4bedc2[_0xe7c8('0x50')]['id']},'attributes':[_0xe7c8('0x59'),_0xe7c8('0x5b'),_0xe7c8('0x5f'),_0xe7c8('0x60'),'defaultLogo','defaultLoginLogo',_0xe7c8('0x61'),'defaultFavicon'],'raw':!![]});})[_0xe7c8('0x20')](handleEntityNotFound(_0x10b563,null))[_0xe7c8('0x20')](function(_0x37fa7a){if(_0x37fa7a){var _0x527575=_0x37fa7a[_0xe7c8('0x59')]&&fs['existsSync'](path['join'](config['root'],_0x2a7eec,_[_0xe7c8('0x62')](_0x37fa7a[_0xe7c8('0x59')])))?path[_0xe7c8('0x63')](config[_0xe7c8('0x64')],_0x2a7eec,_[_0xe7c8('0x62')](_0x37fa7a[_0xe7c8('0x59')])):path['join'](config['root'],_0x2a7eec,_[_0xe7c8('0x62')](_0xe7c8('0x65')));var _0x3f17e8='default'+_[_0xe7c8('0x66')](_0xe7c8('0x59'));if(_0x37fa7a[_0x3f17e8]||!_0x52b4e4[_0xe7c8('0x67')]){_0x527575=path[_0xe7c8('0x63')](config[_0xe7c8('0x64')],_0x2a7eec,_[_0xe7c8('0x62')](_0xe7c8('0x65')));}if(!fs[_0xe7c8('0x68')](_0x527575)){throw new db[(_0xe7c8('0x69'))][(_0xe7c8('0x6a'))](_[_0xe7c8('0x66')](_0xe7c8('0x59'))+_0xe7c8('0x6b'));}return _0x10b563[_0xe7c8('0x6c')](_0x527575);}})['catch'](handleError(_0x10b563,null));};var utilLicense=require(_0xe7c8('0x5c'));exports[_0xe7c8('0x6d')]=function(_0x45275c,_0x293321,_0x5436b2){var _0xcf38e6=_0xe7c8('0x5d');var _0x10a180={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x2db53c){if(_0x2db53c){_0x10a180=_0x2db53c;}return db['Setting'][_0xe7c8('0x55')]({'where':{'id':_0x45275c[_0xe7c8('0x50')]['id']},'attributes':[_0xe7c8('0x59'),'loginLogo',_0xe7c8('0x5f'),_0xe7c8('0x60'),_0xe7c8('0x6e'),'defaultLoginLogo',_0xe7c8('0x61'),'defaultFavicon'],'raw':!![]});})[_0xe7c8('0x20')](handleEntityNotFound(_0x293321,null))[_0xe7c8('0x20')](function(_0x3482ce){if(_0x3482ce){var _0x5e8862=_0x3482ce[_0xe7c8('0x5b')]&&fs['existsSync'](path[_0xe7c8('0x63')](config[_0xe7c8('0x64')],_0xcf38e6,_['toLower'](_0x3482ce[_0xe7c8('0x5b')])))?path[_0xe7c8('0x63')](config[_0xe7c8('0x64')],_0xcf38e6,_[_0xe7c8('0x62')](_0x3482ce[_0xe7c8('0x5b')])):path['join'](config[_0xe7c8('0x64')],_0xcf38e6,_[_0xe7c8('0x62')](_0xe7c8('0x6f')));var _0x44e202=_0xe7c8('0x70')+_['upperFirst'](_0xe7c8('0x5b'));if(_0x3482ce[_0x44e202]||!_0x10a180[_0xe7c8('0x67')]){_0x5e8862=path[_0xe7c8('0x63')](config[_0xe7c8('0x64')],_0xcf38e6,_[_0xe7c8('0x62')]('default_loginLogo.svg'));}if(!fs[_0xe7c8('0x68')](_0x5e8862)){throw new db['Sequelize'][(_0xe7c8('0x6a'))](_[_0xe7c8('0x66')](_0xe7c8('0x5b'))+_0xe7c8('0x6b'));}return _0x293321[_0xe7c8('0x6c')](_0x5e8862);}})['catch'](handleError(_0x293321,null));};exports['gdpr']=function(_0x40a92d,_0x181cd2){return db[_0xe7c8('0x38')][_0xe7c8('0x55')]({'where':{'id':_0x40a92d[_0xe7c8('0x50')]['id']},'attributes':['securePassword']})[_0xe7c8('0x20')](respondWithResult(_0x181cd2,null))[_0xe7c8('0x28')](handleError(_0x181cd2,null));};exports[_0xe7c8('0x71')]=function(_0x5d66ea,_0x28cbec,_0x11faac){if(_0x5d66ea[_0xe7c8('0x57')]&&_0x5d66ea[_0xe7c8('0x57')][_0xe7c8('0x58')]){_0x5d66ea[_0xe7c8('0x54')][_0xe7c8('0x5f')]=_0x5d66ea[_0xe7c8('0x57')][_0xe7c8('0x58')];}return db['Setting'][_0xe7c8('0x55')]({'where':{'id':_0x5d66ea[_0xe7c8('0x50')]['id']}})[_0xe7c8('0x20')](handleEntityNotFound(_0x28cbec,null))[_0xe7c8('0x20')](saveUpdates(_0x5d66ea[_0xe7c8('0x54')],null))[_0xe7c8('0x20')](respondWithResult(_0x28cbec,null))[_0xe7c8('0x28')](handleError(_0x28cbec,null));};var utilLicense=require(_0xe7c8('0x5c'));exports[_0xe7c8('0x72')]=function(_0x45d341,_0x745a25,_0x15b714){var _0x48f2b9=_0xe7c8('0x5d');var _0x32956b={'custom':![]};return utilLicense['getLicense']()[_0xe7c8('0x20')](function(_0x39847b){if(_0x39847b){_0x32956b=_0x39847b;}return db[_0xe7c8('0x38')][_0xe7c8('0x55')]({'where':{'id':_0x45d341[_0xe7c8('0x50')]['id']},'attributes':[_0xe7c8('0x59'),_0xe7c8('0x5b'),_0xe7c8('0x5f'),_0xe7c8('0x60'),_0xe7c8('0x6e'),_0xe7c8('0x73'),_0xe7c8('0x61'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x745a25,null))[_0xe7c8('0x20')](function(_0x296cc8){if(_0x296cc8){var _0x28a1b9=_0x296cc8[_0xe7c8('0x5f')]&&fs[_0xe7c8('0x68')](path[_0xe7c8('0x63')](config[_0xe7c8('0x64')],_0x48f2b9,_['toLower'](_0x296cc8[_0xe7c8('0x5f')])))?path[_0xe7c8('0x63')](config[_0xe7c8('0x64')],_0x48f2b9,_[_0xe7c8('0x62')](_0x296cc8['preferred'])):path[_0xe7c8('0x63')](config[_0xe7c8('0x64')],_0x48f2b9,_[_0xe7c8('0x62')](_0xe7c8('0x74')));var _0x5bbbce=_0xe7c8('0x70')+_[_0xe7c8('0x66')](_0xe7c8('0x5f'));if(_0x296cc8[_0x5bbbce]||!_0x32956b[_0xe7c8('0x67')]||!_0x32956b[_0xe7c8('0x5f')]){_0x28a1b9=path[_0xe7c8('0x63')](config[_0xe7c8('0x64')],_0x48f2b9,_[_0xe7c8('0x62')](_0xe7c8('0x74')));}if(!fs[_0xe7c8('0x68')](_0x28a1b9)){throw new db[(_0xe7c8('0x69'))][(_0xe7c8('0x6a'))](_[_0xe7c8('0x66')]('preferred')+'\x20not\x20found');}return _0x745a25[_0xe7c8('0x6c')](_0x28a1b9);}})[_0xe7c8('0x28')](handleError(_0x745a25,null));};exports[_0xe7c8('0x75')]=function(_0x485892,_0x233365,_0x68aeb6){if(_0x485892['file']&&_0x485892['file'][_0xe7c8('0x58')]){_0x485892[_0xe7c8('0x54')]['favicon']=_0x485892['file'][_0xe7c8('0x58')];}return db[_0xe7c8('0x38')][_0xe7c8('0x55')]({'where':{'id':_0x485892[_0xe7c8('0x50')]['id']}})[_0xe7c8('0x20')](handleEntityNotFound(_0x233365,null))['then'](saveUpdates(_0x485892['body'],null))[_0xe7c8('0x20')](respondWithResult(_0x233365,null))[_0xe7c8('0x28')](handleError(_0x233365,null));};var utilLicense=require(_0xe7c8('0x5c'));exports[_0xe7c8('0x76')]=function(_0x56091b,_0x23c595,_0x9ee5fa){var _0x1651fb='server/files/images/logos';var _0x3b05e0={'custom':![]};return utilLicense[_0xe7c8('0x5e')]()['then'](function(_0x5637a9){if(_0x5637a9){_0x3b05e0=_0x5637a9;}return db[_0xe7c8('0x38')][_0xe7c8('0x55')]({'where':{'id':_0x56091b[_0xe7c8('0x50')]['id']},'attributes':['logo','loginLogo',_0xe7c8('0x5f'),_0xe7c8('0x60'),_0xe7c8('0x6e'),_0xe7c8('0x73'),_0xe7c8('0x61'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x23c595,null))[_0xe7c8('0x20')](function(_0x1fdcba){if(_0x1fdcba){var _0x1e5d17=_0x1fdcba['favicon']&&fs[_0xe7c8('0x68')](path['join'](config[_0xe7c8('0x64')],_0x1651fb,_[_0xe7c8('0x62')](_0x1fdcba['favicon'])))?path[_0xe7c8('0x63')](config['root'],_0x1651fb,_[_0xe7c8('0x62')](_0x1fdcba[_0xe7c8('0x60')])):path[_0xe7c8('0x63')](config[_0xe7c8('0x64')],_0x1651fb,_['toLower'](_0xe7c8('0x77')));var _0x5c2a81=_0xe7c8('0x70')+_['upperFirst'](_0xe7c8('0x60'));if(_0x1fdcba[_0x5c2a81]||!_0x3b05e0[_0xe7c8('0x67')]){_0x1e5d17=path['join'](config['root'],_0x1651fb,_[_0xe7c8('0x62')](_0xe7c8('0x77')));}if(!fs['existsSync'](_0x1e5d17)){throw new db[(_0xe7c8('0x69'))][(_0xe7c8('0x6a'))](_[_0xe7c8('0x66')]('favicon')+_0xe7c8('0x6b'));}return _0x23c595['download'](_0x1e5d17);}})[_0xe7c8('0x28')](handleError(_0x23c595,null));};exports[_0xe7c8('0x78')]=function(_0x428e10,_0x5a30fb){var _0x1354f5={'offset':moment()[_0xe7c8('0x79')]()};_0x1354f5[_0xe7c8('0x7a')]=moment()[_0xe7c8('0x79')](_0x1354f5['offset'])[_0xe7c8('0x7b')](_0xe7c8('0x7c'));return _0x5a30fb[_0xe7c8('0x2a')](0xc8)[_0xe7c8('0x35')](_0x1354f5);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 4a67c5a..68b2fb7 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 _0x55ca=['./setting.attributes','exports','define','settings','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x581249,_0x483f03){var _0x284bae=function(_0x2faadd){while(--_0x2faadd){_0x581249['push'](_0x581249['shift']());}};_0x284bae(++_0x483f03);}(_0x55ca,0x126));var _0xa55c=function(_0xdbe2de,_0x3bdc5a){_0xdbe2de=_0xdbe2de-0x0;var _0x2facd7=_0x55ca[_0xdbe2de];return _0x2facd7;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('Setting',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7217=['../../config/environment','./setting.attributes','exports','define','Setting','settings','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x25df80,_0xa2aec5){var _0x17b6d0=function(_0x446155){while(--_0x446155){_0x25df80['push'](_0x25df80['shift']());}};_0x17b6d0(++_0xa2aec5);}(_0x7217,0x19e));var _0x7721=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0x7217[_0x298ed3];return _0x5aad28;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 5db5a94..1a7821e 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 _0xdf81=['request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','ShowSetting','Setting','find','options','raw','include','map','model','attributes','debug','lodash','util','moment','../../mysqldb','../../config/utils','rpc','client','request','then','Setting,\x20%s,\x20%s'];(function(_0x3335f6,_0x485c1a){var _0x3d3925=function(_0x460da3){while(--_0x460da3){_0x3335f6['push'](_0x3335f6['shift']());}};_0x3d3925(++_0x485c1a);}(_0xdf81,0x1c1));var _0x1df8=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0xdf81[_0x2d34d6];return _0x1d3d12;};'use strict';var _=require(_0x1df8('0x0'));var util=require(_0x1df8('0x1'));var moment=require(_0x1df8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1df8('0x3'))['db'];var utils=require(_0x1df8('0x4'));var logger=require('../../config/logger')(_0x1df8('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1df8('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22b691,_0x1f3150,_0x4bcfd3){return new BPromise(function(_0x1c8894,_0x2646fe){return client[_0x1df8('0x7')](_0x22b691,_0x4bcfd3)[_0x1df8('0x8')](function(_0x25a973){logger['info'](_0x1df8('0x9'),_0x1f3150,_0x1df8('0xa'));logger['debug'](_0x1df8('0xb'),_0x1f3150,_0x1df8('0xa'),JSON[_0x1df8('0xc')](_0x25a973));if(_0x25a973['error']){if(_0x25a973[_0x1df8('0xd')][_0x1df8('0xe')]===0x1f4){logger['error']('Setting,\x20%s,\x20%s',_0x1f3150,_0x25a973[_0x1df8('0xd')][_0x1df8('0xf')]);return _0x2646fe(_0x25a973[_0x1df8('0xd')][_0x1df8('0xf')]);}logger['error'](_0x1df8('0x9'),_0x1f3150,_0x25a973[_0x1df8('0xd')][_0x1df8('0xf')]);return _0x1c8894(_0x25a973[_0x1df8('0xd')][_0x1df8('0xf')]);}else{logger[_0x1df8('0x10')](_0x1df8('0x9'),_0x1f3150,_0x1df8('0xa'));_0x1c8894(_0x25a973['result'][_0x1df8('0xf')]);}})['catch'](function(_0x1ceef4){logger[_0x1df8('0xd')](_0x1df8('0x9'),_0x1f3150,_0x1ceef4);_0x2646fe(_0x1ceef4);});});}exports[_0x1df8('0x11')]=function(_0x3361a2){var _0x27a865=this;return new Promise(function(_0x1276fd,_0x5cf7d9){return db[_0x1df8('0x12')][_0x1df8('0x13')]({'raw':_0x3361a2['options']?_0x3361a2[_0x1df8('0x14')][_0x1df8('0x15')]===undefined?!![]:![]:!![],'where':_0x3361a2['options']?_0x3361a2['options']['where']||null:null,'attributes':_0x3361a2[_0x1df8('0x14')]?_0x3361a2['options']['attributes']||null:null,'include':_0x3361a2[_0x1df8('0x14')]?_0x3361a2[_0x1df8('0x14')][_0x1df8('0x16')]?_[_0x1df8('0x17')](_0x3361a2['options'][_0x1df8('0x16')],function(_0x4ec3e5){return{'model':db[_0x4ec3e5[_0x1df8('0x18')]],'as':_0x4ec3e5['as'],'attributes':_0x4ec3e5['attributes'],'include':_0x4ec3e5[_0x1df8('0x16')]?_[_0x1df8('0x17')](_0x4ec3e5[_0x1df8('0x16')],function(_0x56d1c1){return{'model':db[_0x56d1c1[_0x1df8('0x18')]],'as':_0x56d1c1['as'],'attributes':_0x56d1c1[_0x1df8('0x19')],'include':_0x56d1c1[_0x1df8('0x16')]?_[_0x1df8('0x17')](_0x56d1c1[_0x1df8('0x16')],function(_0x442420){return{'model':db[_0x442420[_0x1df8('0x18')]],'as':_0x442420['as'],'attributes':_0x442420['attributes']};}):[]};}):[]};}):[]:[]})[_0x1df8('0x8')](function(_0x1d2beb){logger[_0x1df8('0x10')](_0x1df8('0x11'),_0x3361a2);logger[_0x1df8('0x1a')](_0x1df8('0x11'),_0x3361a2,JSON['stringify'](_0x1d2beb));_0x1276fd(_0x1d2beb);})['catch'](function(_0x2290db){logger[_0x1df8('0xd')]('ShowSetting',_0x2290db['message'],_0x3361a2);_0x5cf7d9(_0x27a865[_0x1df8('0xd')](0x1f4,_0x2290db[_0x1df8('0xf')]));});});}; \ No newline at end of file +var _0x5fbc=['message','ShowSetting','Setting','options','raw','where','attributes','include','map','model','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x5fbc,0x17f));var _0xc5fb=function(_0x3e982b,_0x2971ae){_0x3e982b=_0x3e982b-0x0;var _0x4758a5=_0x5fbc[_0x3e982b];return _0x4758a5;};'use strict';var _=require('lodash');var util=require(_0xc5fb('0x0'));var moment=require(_0xc5fb('0x1'));var BPromise=require(_0xc5fb('0x2'));var rs=require(_0xc5fb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc5fb('0x4'))['db'];var utils=require(_0xc5fb('0x5'));var logger=require(_0xc5fb('0x6'))('rpc');var config=require(_0xc5fb('0x7'));var jayson=require(_0xc5fb('0x8'));var client=jayson[_0xc5fb('0x9')][_0xc5fb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x8525ad,_0x278b34,_0x3b2b1c){return new BPromise(function(_0x2ace7e,_0x48abe4){return client['request'](_0x8525ad,_0x3b2b1c)[_0xc5fb('0xb')](function(_0x1ed992){logger[_0xc5fb('0xc')]('Setting,\x20%s,\x20%s',_0x278b34,_0xc5fb('0xd'));logger[_0xc5fb('0xe')](_0xc5fb('0xf'),_0x278b34,_0xc5fb('0xd'),JSON[_0xc5fb('0x10')](_0x1ed992));if(_0x1ed992[_0xc5fb('0x11')]){if(_0x1ed992[_0xc5fb('0x11')][_0xc5fb('0x12')]===0x1f4){logger[_0xc5fb('0x11')](_0xc5fb('0x13'),_0x278b34,_0x1ed992[_0xc5fb('0x11')][_0xc5fb('0x14')]);return _0x48abe4(_0x1ed992['error']['message']);}logger[_0xc5fb('0x11')](_0xc5fb('0x13'),_0x278b34,_0x1ed992[_0xc5fb('0x11')][_0xc5fb('0x14')]);return _0x2ace7e(_0x1ed992['error']['message']);}else{logger[_0xc5fb('0xc')](_0xc5fb('0x13'),_0x278b34,_0xc5fb('0xd'));_0x2ace7e(_0x1ed992['result'][_0xc5fb('0x14')]);}})['catch'](function(_0x5be1f2){logger[_0xc5fb('0x11')](_0xc5fb('0x13'),_0x278b34,_0x5be1f2);_0x48abe4(_0x5be1f2);});});}exports[_0xc5fb('0x15')]=function(_0x14a30b){var _0x284778=this;return new Promise(function(_0x51ecbb,_0x2a76bb){return db[_0xc5fb('0x16')]['find']({'raw':_0x14a30b[_0xc5fb('0x17')]?_0x14a30b[_0xc5fb('0x17')][_0xc5fb('0x18')]===undefined?!![]:![]:!![],'where':_0x14a30b[_0xc5fb('0x17')]?_0x14a30b[_0xc5fb('0x17')][_0xc5fb('0x19')]||null:null,'attributes':_0x14a30b[_0xc5fb('0x17')]?_0x14a30b[_0xc5fb('0x17')][_0xc5fb('0x1a')]||null:null,'include':_0x14a30b[_0xc5fb('0x17')]?_0x14a30b[_0xc5fb('0x17')][_0xc5fb('0x1b')]?_[_0xc5fb('0x1c')](_0x14a30b[_0xc5fb('0x17')][_0xc5fb('0x1b')],function(_0x396690){return{'model':db[_0x396690[_0xc5fb('0x1d')]],'as':_0x396690['as'],'attributes':_0x396690[_0xc5fb('0x1a')],'include':_0x396690['include']?_[_0xc5fb('0x1c')](_0x396690['include'],function(_0x4df201){return{'model':db[_0x4df201['model']],'as':_0x4df201['as'],'attributes':_0x4df201[_0xc5fb('0x1a')],'include':_0x4df201['include']?_[_0xc5fb('0x1c')](_0x4df201[_0xc5fb('0x1b')],function(_0x161cc8){return{'model':db[_0x161cc8[_0xc5fb('0x1d')]],'as':_0x161cc8['as'],'attributes':_0x161cc8[_0xc5fb('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xc5fb('0xb')](function(_0x12c726){logger[_0xc5fb('0xc')](_0xc5fb('0x15'),_0x14a30b);logger[_0xc5fb('0xe')]('ShowSetting',_0x14a30b,JSON[_0xc5fb('0x10')](_0x12c726));_0x51ecbb(_0x12c726);})[_0xc5fb('0x1e')](function(_0x58e552){logger['error'](_0xc5fb('0x15'),_0x58e552[_0xc5fb('0x14')],_0x14a30b);_0x2a76bb(_0x284778[_0xc5fb('0x11')](0x1f4,_0x58e552[_0xc5fb('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 9422268..e392dc8 100644 --- a/server/api/smsAccount/index.js +++ b/server/api/smsAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ef6=['addApplications','/:id/send','send','status','update','delete','destroy','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','/:id/status','statusGet','/:id/users','getAgents','create','post','addDisposition','addAnswer','notify'];(function(_0x40c90c,_0x46556e){var _0x28eaec=function(_0x21bd77){while(--_0x21bd77){_0x40c90c['push'](_0x40c90c['shift']());}};_0x28eaec(++_0x46556e);}(_0x8ef6,0xf2));var _0x68ef=function(_0x2d8a95,_0x753c52){_0x2d8a95=_0x2d8a95-0x0;var _0x4d391e=_0x8ef6[_0x2d8a95];return _0x4d391e;};'use strict';var multer=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var path=require(_0x68ef('0x2'));var timeout=require(_0x68ef('0x3'));var express=require(_0x68ef('0x4'));var router=express[_0x68ef('0x5')]();var fs_extra=require(_0x68ef('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var controller=require(_0x68ef('0x9'));router[_0x68ef('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x68ef('0xa')](_0x68ef('0xb'),auth[_0x68ef('0xc')](),controller['describe']);router[_0x68ef('0xa')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0xe')]);router[_0x68ef('0xa')](_0x68ef('0xf'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x10')]);router[_0x68ef('0xa')](_0x68ef('0x11'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x12')]);router['get'](_0x68ef('0x13'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x14')]);router[_0x68ef('0xa')](_0x68ef('0x15'),auth[_0x68ef('0xc')](),controller['getInteractions']);router[_0x68ef('0xa')](_0x68ef('0x16'),controller[_0x68ef('0x17')]);router['get'](_0x68ef('0x18'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x19')]);router['post']('/',auth[_0x68ef('0xc')](),controller[_0x68ef('0x1a')]);router[_0x68ef('0x1b')](_0x68ef('0xf'),auth['isAuthenticated'](),controller[_0x68ef('0x1c')]);router['post']('/:id/canned_answers',auth[_0x68ef('0xc')](),controller[_0x68ef('0x1d')]);router['post']('/:id/notify',controller[_0x68ef('0x1e')]);router[_0x68ef('0x1b')](_0x68ef('0x13'),auth['isAuthenticated'](),controller[_0x68ef('0x1f')]);router[_0x68ef('0x1b')](_0x68ef('0x20'),auth['isAuthenticated'](),controller[_0x68ef('0x21')]);router[_0x68ef('0x1b')]('/:id/status',controller[_0x68ef('0x22')]);router[_0x68ef('0x1b')](_0x68ef('0x18'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x23')]);router[_0x68ef('0x24')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x25')]);router[_0x68ef('0x24')](_0x68ef('0xf'),auth[_0x68ef('0xc')](),controller['removeDispositions']);router[_0x68ef('0x24')]('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router[_0x68ef('0x24')](_0x68ef('0x18'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x26')]);module['exports']=router; \ No newline at end of file +var _0xe14b=['./smsAccount.controller','get','isAuthenticated','index','/describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','/:id/send','send','put','update','/:id','destroy','removeDispositions','delete','/:id/users','removeAgents','multer','util','express','Router','../../components/auth/service'];(function(_0x2918e1,_0x9613bc){var _0x2f5165=function(_0x12d6e2){while(--_0x12d6e2){_0x2918e1['push'](_0x2918e1['shift']());}};_0x2f5165(++_0x9613bc);}(_0xe14b,0x93));var _0xbe14=function(_0x201699,_0x3d84b4){_0x201699=_0x201699-0x0;var _0x41c6ac=_0xe14b[_0x201699];return _0x41c6ac;};'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['getDispositions']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x6')](_0xbe14('0x10'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x6')](_0xbe14('0x12'),controller[_0xbe14('0x13')]);router[_0xbe14('0x6')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x14')]);router[_0xbe14('0x15')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x16')]);router['post'](_0xbe14('0xb'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x15')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);router['post'](_0xbe14('0x19'),controller[_0xbe14('0x1a')]);router[_0xbe14('0x15')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x1b')]);router['post'](_0xbe14('0x1c'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x1d')]);router[_0xbe14('0x15')](_0xbe14('0x12'),controller['status']);router[_0xbe14('0x15')]('/:id/users',auth[_0xbe14('0x7')](),controller['addAgents']);router[_0xbe14('0x1e')]('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0x1f')]);router['delete'](_0xbe14('0x20'),auth['isAuthenticated'](),controller[_0xbe14('0x21')]);router['delete'](_0xbe14('0xb'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x22')]);router[_0xbe14('0x23')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeAnswers']);router[_0xbe14('0x23')](_0xbe14('0x24'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x25')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 7a10bf3..bfaa877 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 _0x0e23=['mandatoryDispositionPauseId','sequelize','randomstring','exports','STRING','name','ENUM','connectel','clicksend','plivo','infobip','BOOLEAN','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x4dd8b2,_0x2bdc25){var _0x12cd5e=function(_0x187075){while(--_0x187075){_0x4dd8b2['push'](_0x4dd8b2['shift']());}};_0x12cd5e(++_0x2bdc25);}(_0x0e23,0x133));var _0x30e2=function(_0x3ddc5c,_0x22b1dc){_0x3ddc5c=_0x3ddc5c-0x0;var _0x310ccd=_0x0e23[_0x3ddc5c];return _0x310ccd;};'use strict';var Sequelize=require(_0x30e2('0x0'));var rs=require(_0x30e2('0x1'));module[_0x30e2('0x2')]={'name':{'type':Sequelize[_0x30e2('0x3')],'unique':_0x30e2('0x4'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x30e2('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x30e2('0x3')]},'type':{'type':Sequelize[_0x30e2('0x5')]('twilio','skebby',_0x30e2('0x6'),_0x30e2('0x7'),_0x30e2('0x8'),'clickatell','bandwidth','csc',_0x30e2('0x9'),'intelepeer')},'accountSid':{'type':Sequelize[_0x30e2('0x3')]},'authId':{'type':Sequelize[_0x30e2('0x3')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0x30e2('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0x30e2('0x3')]},'password':{'type':Sequelize[_0x30e2('0x3')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0x30e2('0x3')]},'accountId':{'type':Sequelize[_0x30e2('0x3')]},'senderString':{'type':Sequelize[_0x30e2('0x3')]},'deliveryReport':{'type':Sequelize[_0x30e2('0xa')],'defaultValue':![]},'description':{'type':Sequelize[_0x30e2('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x30e2('0xb');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x30e2('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x30e2('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x30e2('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x30e2('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x30e2('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x30e2('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x30e2('0xc')],'comment':_0x30e2('0xd')},'mandatoryDisposition':{'type':Sequelize[_0x30e2('0xa')],'defaultValue':![],'comment':_0x30e2('0xe'),'set':function(_0x5ea8ea){if(!_0x5ea8ea)this[_0x30e2('0xf')](_0x30e2('0x10'),null);this[_0x30e2('0xf')]('mandatoryDisposition',_0x5ea8ea);}}}; \ No newline at end of file +var _0x4d9a=['plivo','clickatell','bandwidth','intelepeer','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','randomstring','name','STRING','generate','ENUM','twilio','skebby'];(function(_0x380e3b,_0x4fbd14){var _0x140559=function(_0xd61e90){while(--_0xd61e90){_0x380e3b['push'](_0x380e3b['shift']());}};_0x140559(++_0x4fbd14);}(_0x4d9a,0x119));var _0xa4d9=function(_0x5cfbb7,_0x3a0918){_0x5cfbb7=_0x5cfbb7-0x0;var _0x6322de=_0x4d9a[_0x5cfbb7];return _0x6322de;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xa4d9('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xa4d9('0x1'),'allowNull':![]},'key':{'type':Sequelize[_0xa4d9('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xa4d9('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xa4d9('0x2')],'defaultValue':function(){return rs[_0xa4d9('0x3')]();}},'phone':{'type':Sequelize[_0xa4d9('0x2')]},'type':{'type':Sequelize[_0xa4d9('0x4')](_0xa4d9('0x5'),_0xa4d9('0x6'),'connectel','clicksend',_0xa4d9('0x7'),_0xa4d9('0x8'),_0xa4d9('0x9'),'csc','infobip',_0xa4d9('0xa'))},'accountSid':{'type':Sequelize[_0xa4d9('0x2')]},'authId':{'type':Sequelize[_0xa4d9('0x2')]},'authToken':{'type':Sequelize[_0xa4d9('0x2')]},'smsMethod':{'type':Sequelize[_0xa4d9('0x4')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xa4d9('0x2')]},'apiKey':{'type':Sequelize[_0xa4d9('0x2')]},'applicationId':{'type':Sequelize[_0xa4d9('0x2')]},'accountId':{'type':Sequelize[_0xa4d9('0x2')]},'senderString':{'type':Sequelize[_0xa4d9('0x2')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xa4d9('0x2')]},'notificationTemplate':{'type':Sequelize[_0xa4d9('0xb')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xa4d9('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa4d9('0xc')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa4d9('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xa4d9('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa4d9('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa4d9('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa4d9('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xa4d9('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa4d9('0xd')],'comment':_0xa4d9('0xe')},'mandatoryDisposition':{'type':Sequelize[_0xa4d9('0xc')],'defaultValue':![],'comment':_0xa4d9('0xf'),'set':function(_0x14ed58){if(!_0x14ed58)this['setDataValue'](_0xa4d9('0x10'),null);this[_0xa4d9('0x11')]('mandatoryDisposition',_0x14ed58);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index feefc84..bb63363 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 _0x5581=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','SmsAccountId','Disposition','getDispositions','length','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','rawAttributes','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','orderBy','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','From','Body','messageId','MessageSid','skebby','sender','text','from','clicksend','message_id','plivo','Text','MessageUUID','results','csc','originatingAddress','clickatell','fromNumber','refid','isNil','from\x20is\x20mandatory','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','list','omit','defaults','contact','SmsInteraction','spread','interaction','autoclose','push','close','unmanaged','created','SmsMessage','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','transaction','bulkCreate','priority','getApplications','getInteractions','User','Owner','fullname','internal','Tag','Tags','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','CmList','List','out','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','status_code','infobip','groupName','DELIVERED','intelepeer','redif','connectel','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','bandwidth','ACCEPTD','state','addAgents','userSmsAccount:save','removeAgents','emit','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','localhost','socket.io-emitter','redis','./smsAccount.socket','register','jayson/promise','client','http','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\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','get','SmsAccounts','UserProfileResource','end','stack','name','send','index','map','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','SmsAccount','findAll','rows','show','Pause','mandatoryDispositionPause','keys','find','create','body','user','UserProfileSection','autoAssociation'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x5581,0x161));var _0x1558=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x5581[_0x199572];return _0x13cfa3;};'use strict';var emlformat=require(_0x1558('0x0'));var rimraf=require(_0x1558('0x1'));var zipdir=require(_0x1558('0x2'));var jsonpatch=require(_0x1558('0x3'));var rp=require(_0x1558('0x4'));var moment=require(_0x1558('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1558('0x6'));var util=require('util');var path=require(_0x1558('0x7'));var sox=require(_0x1558('0x8'));var csv=require(_0x1558('0x9'));var ejs=require(_0x1558('0xa'));var fs=require('fs');var fs_extra=require(_0x1558('0xb'));var _=require(_0x1558('0xc'));var squel=require(_0x1558('0xd'));var crypto=require('crypto');var jsforce=require(_0x1558('0xe'));var deskjs=require(_0x1558('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1558('0x10'));var Papa=require(_0x1558('0x11'));var Redis=require(_0x1558('0x12'));var authService=require(_0x1558('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x1558('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x1558('0x15'));var config=require(_0x1558('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x1558('0x17'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x1558('0x18'),'port':0x18eb});var socket=require(_0x1558('0x19'))(new Redis(config[_0x1558('0x1a')]));require(_0x1558('0x1b'))[_0x1558('0x1c')](socket);var jayson=require(_0x1558('0x1d'));var client=jayson[_0x1558('0x1e')][_0x1558('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x8c67ea,_0x41c4b1,_0x572896,_0x40447c){return new BPromise(function(_0x25bd3d,_0x1eba5e){var _0x262461=_0x40447c||client;return _0x262461['request'](_0x8c67ea,_0x572896)[_0x1558('0x20')](function(_0x29b845){logger[_0x1558('0x21')](_0x1558('0x22'),_0x41c4b1,_0x1558('0x23'));logger[_0x1558('0x24')](_0x1558('0x25'),_0x41c4b1,'request\x20sent',JSON[_0x1558('0x26')](_0x29b845));if(_0x29b845[_0x1558('0x27')]){if(_0x29b845[_0x1558('0x27')][_0x1558('0x28')]===0x1f4){logger['error'](_0x1558('0x22'),_0x41c4b1,_0x29b845['error'][_0x1558('0x29')]);return _0x1eba5e(_0x29b845['error']['message']);}logger['error'](_0x1558('0x22'),_0x41c4b1,_0x29b845[_0x1558('0x27')]['message']);return _0x25bd3d(_0x29b845['error'][_0x1558('0x29')]);}else{logger['info'](_0x1558('0x22'),_0x41c4b1,'request\x20sent');_0x25bd3d(_0x29b845['result'][_0x1558('0x29')]);}})[_0x1558('0x2a')](function(_0x469a3a){logger['error'](_0x1558('0x22'),_0x41c4b1,_0x469a3a);_0x1eba5e(_0x469a3a);});});}function respondWithStatusCode(_0x3482f6,_0x231769){_0x231769=_0x231769||0xcc;return function(_0x2062bc){if(_0x2062bc){return _0x3482f6[_0x1558('0x2b')](_0x231769);}return _0x3482f6[_0x1558('0x2c')](_0x231769)['end']();};}function respondWithResult(_0x3d75a6,_0x32523c){_0x32523c=_0x32523c||0xc8;return function(_0x186a3e){if(_0x186a3e){return _0x3d75a6[_0x1558('0x2c')](_0x32523c)[_0x1558('0x2d')](_0x186a3e);}};}function respondWithFilteredResult(_0x5c06da,_0x52b22e){return function(_0x1d6f7f){if(_0x1d6f7f){var _0x22d655=typeof _0x52b22e[_0x1558('0x2e')]===_0x1558('0x2f')&&typeof _0x52b22e[_0x1558('0x30')]===_0x1558('0x2f');var _0x241866=_0x1d6f7f[_0x1558('0x31')];var _0x354fb7=_0x22d655?0x0:_0x52b22e[_0x1558('0x2e')];var _0x3ac333=_0x22d655?_0x1d6f7f['count']:_0x52b22e[_0x1558('0x2e')]+_0x52b22e['limit'];var _0x5c0ffd;if(_0x3ac333>=_0x241866){_0x3ac333=_0x241866;_0x5c0ffd=0xc8;}else{_0x5c0ffd=0xce;}_0x5c06da['status'](_0x5c0ffd);return _0x5c06da[_0x1558('0x32')](_0x1558('0x33'),_0x354fb7+'-'+_0x3ac333+'/'+_0x241866)['json'](_0x1d6f7f);}return null;};}function patchUpdates(_0xba22b4){return function(_0x5f28f0){try{jsonpatch[_0x1558('0x34')](_0x5f28f0,_0xba22b4,!![]);}catch(_0x59e468){return BPromise[_0x1558('0x35')](_0x59e468);}return _0x5f28f0[_0x1558('0x36')]();};}function saveUpdates(_0x13057c,_0x475bed){return function(_0x491e5b){if(_0x491e5b){return _0x491e5b[_0x1558('0x37')](_0x13057c)[_0x1558('0x20')](function(_0x217ea2){return _0x217ea2;});}return null;};}function removeEntity(_0x1f3242,_0x18f43c){return function(_0x4762e8){if(_0x4762e8){return _0x4762e8[_0x1558('0x38')]()[_0x1558('0x20')](function(){var _0x3d5790=_0x4762e8[_0x1558('0x39')]({'plain':!![]});var _0x489b04=_0x1558('0x3a');return db[_0x1558('0x3b')]['destroy']({'where':{'type':_0x489b04,'resourceId':_0x3d5790['id']}})[_0x1558('0x20')](function(){return _0x4762e8;});})['then'](function(){_0x1f3242[_0x1558('0x2c')](0xcc)[_0x1558('0x3c')]();});}};}function handleEntityNotFound(_0x49d6ed,_0x5d21c0){return function(_0x233d22){if(!_0x233d22){_0x49d6ed[_0x1558('0x2b')](0x194);}return _0x233d22;};}function handleError(_0x210fdf,_0x363e48){_0x363e48=_0x363e48||0x1f4;return function(_0x144e56){logger['error'](_0x144e56[_0x1558('0x3d')]);if(_0x144e56[_0x1558('0x3e')]){delete _0x144e56[_0x1558('0x3e')];}_0x210fdf[_0x1558('0x2c')](_0x363e48)[_0x1558('0x3f')](_0x144e56);};}exports[_0x1558('0x40')]=function(_0x9acea5,_0x5dbb84){var _0x1eff12={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x3ca591={},_0x3d06b6={'count':0x0,'rows':[]};var _0x23c0fc=_[_0x1558('0x41')](db['SmsAccount']['rawAttributes'],function(_0x150828){return{'name':_0x150828[_0x1558('0x42')],'type':_0x150828[_0x1558('0x43')][_0x1558('0x44')]};});_0x3ca591['model']=_[_0x1558('0x41')](_0x23c0fc,_0x1558('0x3e'));_0x3ca591[_0x1558('0x45')]=_['keys'](_0x9acea5[_0x1558('0x45')]);_0x3ca591[_0x1558('0x46')]=_[_0x1558('0x47')](_0x3ca591[_0x1558('0x48')],_0x3ca591['query']);_0x1eff12[_0x1558('0x49')]=_['intersection'](_0x3ca591[_0x1558('0x48')],qs[_0x1558('0x4a')](_0x9acea5[_0x1558('0x45')]['fields']));_0x1eff12[_0x1558('0x49')]=_0x1eff12[_0x1558('0x49')]['length']?_0x1eff12[_0x1558('0x49')]:_0x3ca591[_0x1558('0x48')];if(!_0x9acea5['query'][_0x1558('0x4b')](_0x1558('0x4c'))){_0x1eff12[_0x1558('0x30')]=qs[_0x1558('0x30')](_0x9acea5[_0x1558('0x45')][_0x1558('0x30')]);_0x1eff12[_0x1558('0x2e')]=qs[_0x1558('0x2e')](_0x9acea5[_0x1558('0x45')][_0x1558('0x2e')]);}_0x1eff12[_0x1558('0x4d')]=qs['sort'](_0x9acea5['query'][_0x1558('0x4e')]);_0x1eff12['where']=qs[_0x1558('0x46')](_[_0x1558('0x4f')](_0x9acea5['query'],_0x3ca591[_0x1558('0x46')]),_0x23c0fc);if(_0x9acea5['query'][_0x1558('0x50')]){_0x1eff12[_0x1558('0x51')]=_[_0x1558('0x52')](_0x1eff12[_0x1558('0x51')],{'$or':_['map'](_0x23c0fc,function(_0x367508){if(_0x367508[_0x1558('0x43')]!=='VIRTUAL'){var _0xcdba0a={};_0xcdba0a[_0x367508['name']]={'$like':'%'+_0x9acea5[_0x1558('0x45')]['filter']+'%'};return _0xcdba0a;}})});}_0x1eff12=_[_0x1558('0x52')]({},_0x1eff12,_0x9acea5[_0x1558('0x53')]);var _0x1b508a={'where':_0x1eff12[_0x1558('0x51')]};return db['SmsAccount'][_0x1558('0x31')](_0x1b508a)[_0x1558('0x20')](function(_0x2000ab){_0x3d06b6[_0x1558('0x31')]=_0x2000ab;if(_0x9acea5['query'][_0x1558('0x54')]){_0x1eff12[_0x1558('0x55')]=[{'all':!![]}];}return db[_0x1558('0x56')][_0x1558('0x57')](_0x1eff12);})['then'](function(_0x393c46){_0x3d06b6[_0x1558('0x58')]=_0x393c46;return _0x3d06b6;})[_0x1558('0x20')](respondWithFilteredResult(_0x5dbb84,_0x1eff12))[_0x1558('0x2a')](handleError(_0x5dbb84,null));};exports[_0x1558('0x59')]=function(_0xb855a7,_0x1c9135){var _0xd81e9a={'raw':![],'where':{'id':_0xb855a7['params']['id']},'include':[{'model':db[_0x1558('0x5a')],'as':_0x1558('0x5b')}]},_0x2af333={};_0x2af333[_0x1558('0x48')]=_[_0x1558('0x5c')](db[_0x1558('0x56')]['rawAttributes']);_0x2af333[_0x1558('0x45')]=_[_0x1558('0x5c')](_0xb855a7[_0x1558('0x45')]);_0x2af333['filters']=_[_0x1558('0x47')](_0x2af333[_0x1558('0x48')],_0x2af333[_0x1558('0x45')]);_0xd81e9a['attributes']=_[_0x1558('0x47')](_0x2af333[_0x1558('0x48')],qs[_0x1558('0x4a')](_0xb855a7[_0x1558('0x45')][_0x1558('0x4a')]));_0xd81e9a[_0x1558('0x49')]=_0xd81e9a[_0x1558('0x49')]['length']?_0xd81e9a[_0x1558('0x49')]:_0x2af333['model'];if(_0xb855a7[_0x1558('0x45')][_0x1558('0x54')]){_0xd81e9a[_0x1558('0x55')]=[{'all':!![]}];}_0xd81e9a=_[_0x1558('0x52')]({},_0xd81e9a,_0xb855a7[_0x1558('0x53')]);return db[_0x1558('0x56')][_0x1558('0x5d')](_0xd81e9a)[_0x1558('0x20')](handleEntityNotFound(_0x1c9135,null))[_0x1558('0x20')](respondWithResult(_0x1c9135,null))[_0x1558('0x2a')](handleError(_0x1c9135,null));};exports[_0x1558('0x5e')]=function(_0x247d7e,_0x2aa50c){return db[_0x1558('0x56')]['create'](_0x247d7e[_0x1558('0x5f')],{})[_0x1558('0x20')](function(_0x1559c6){var _0x5a5e86=_0x247d7e[_0x1558('0x60')]['get']({'plain':!![]});if(!_0x5a5e86)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a5e86['role']===_0x1558('0x60')){var _0x3c6f30=_0x1559c6[_0x1558('0x39')]({'plain':!![]});var _0x531bfa=_0x1558('0x3a');return db[_0x1558('0x61')][_0x1558('0x5d')]({'where':{'name':_0x531bfa,'userProfileId':_0x5a5e86['userProfileId']},'raw':!![]})['then'](function(_0x2bdff5){if(_0x2bdff5&&_0x2bdff5[_0x1558('0x62')]===0x0){return db[_0x1558('0x3b')][_0x1558('0x5e')]({'name':_0x3c6f30[_0x1558('0x3e')],'resourceId':_0x3c6f30['id'],'type':_0x2bdff5[_0x1558('0x3e')],'sectionId':_0x2bdff5['id']},{})[_0x1558('0x20')](function(){return _0x1559c6;});}else{return _0x1559c6;}})[_0x1558('0x2a')](function(_0x556846){logger[_0x1558('0x27')](_0x1558('0x63'),_0x556846);throw _0x556846;});}return _0x1559c6;})[_0x1558('0x20')](respondWithResult(_0x2aa50c,0xc9))[_0x1558('0x2a')](handleError(_0x2aa50c,null));};exports['update']=function(_0x232f86,_0x1ac953){if(_0x232f86[_0x1558('0x5f')]['id']){delete _0x232f86['body']['id'];}return db[_0x1558('0x56')]['find']({'where':{'id':_0x232f86[_0x1558('0x64')]['id']},'include':[{'model':db['Pause'],'as':_0x1558('0x5b')}]})[_0x1558('0x20')](handleEntityNotFound(_0x1ac953,null))[_0x1558('0x20')](saveUpdates(_0x232f86['body'],null))[_0x1558('0x20')](respondWithResult(_0x1ac953,null))['catch'](handleError(_0x1ac953,null));};exports[_0x1558('0x38')]=function(_0x1dc113,_0x599681){return db['SmsAccount'][_0x1558('0x5d')]({'where':{'id':_0x1dc113[_0x1558('0x64')]['id']}})[_0x1558('0x20')](handleEntityNotFound(_0x599681,null))[_0x1558('0x20')](removeEntity(_0x599681,null))[_0x1558('0x2a')](handleError(_0x599681,null));};exports[_0x1558('0x65')]=function(_0x194f03,_0x33ed70){return db[_0x1558('0x56')]['describe']()[_0x1558('0x20')](respondWithResult(_0x33ed70,null))[_0x1558('0x2a')](handleError(_0x33ed70,null));};exports[_0x1558('0x66')]=function(_0x29fbcb,_0x59c732,_0x269563){if(_0x29fbcb[_0x1558('0x5f')]['id']){delete _0x29fbcb[_0x1558('0x5f')]['id'];}return db[_0x1558('0x56')][_0x1558('0x5d')]({'where':{'id':_0x29fbcb[_0x1558('0x64')]['id']}})[_0x1558('0x20')](handleEntityNotFound(_0x59c732,null))[_0x1558('0x20')](function(_0x5b0f2a){if(_0x5b0f2a){_0x29fbcb[_0x1558('0x5f')][_0x1558('0x67')]=_0x5b0f2a['id'];return db[_0x1558('0x68')][_0x1558('0x5e')](_0x29fbcb[_0x1558('0x5f')]);}})[_0x1558('0x20')](respondWithResult(_0x59c732,null))['catch'](handleError(_0x59c732,null));};exports[_0x1558('0x69')]=function(_0x3962c5,_0x384151,_0x4b23a6){var _0x44a1b1={'raw':![],'where':{}};var _0x2f0b1b={};var _0x58118={'count':0x0,'rows':[]};return db[_0x1558('0x56')]['findOne']({'where':{'id':_0x3962c5[_0x1558('0x64')]['id']}})[_0x1558('0x20')](handleEntityNotFound(_0x384151,null))[_0x1558('0x20')](function(_0x54f8db){if(_0x54f8db){_0x2f0b1b[_0x1558('0x48')]=_['keys'](db['Disposition']['rawAttributes']);_0x2f0b1b[_0x1558('0x45')]=_[_0x1558('0x5c')](_0x3962c5[_0x1558('0x45')]);_0x2f0b1b[_0x1558('0x46')]=_[_0x1558('0x47')](_0x2f0b1b[_0x1558('0x48')],_0x2f0b1b[_0x1558('0x45')]);_0x44a1b1[_0x1558('0x49')]=_[_0x1558('0x47')](_0x2f0b1b['model'],qs['fields'](_0x3962c5['query']['fields']));_0x44a1b1[_0x1558('0x49')]=_0x44a1b1['attributes'][_0x1558('0x6a')]?_0x44a1b1[_0x1558('0x49')]:_0x2f0b1b[_0x1558('0x48')];if(!_0x3962c5[_0x1558('0x45')]['hasOwnProperty'](_0x1558('0x4c'))){_0x44a1b1[_0x1558('0x30')]=qs[_0x1558('0x30')](_0x3962c5[_0x1558('0x45')][_0x1558('0x30')]);_0x44a1b1['offset']=qs[_0x1558('0x2e')](_0x3962c5['query']['offset']);}_0x44a1b1['order']=qs[_0x1558('0x4e')](_0x3962c5[_0x1558('0x45')]['sort']);_0x44a1b1[_0x1558('0x51')]=qs[_0x1558('0x46')](_[_0x1558('0x4f')](_0x3962c5[_0x1558('0x45')],_0x2f0b1b[_0x1558('0x46')]));_0x44a1b1['where'][_0x1558('0x67')]=_0x54f8db['id'];if(_0x3962c5[_0x1558('0x45')][_0x1558('0x50')]){_0x44a1b1[_0x1558('0x51')]=_['merge'](_0x44a1b1[_0x1558('0x51')],{'$or':_[_0x1558('0x41')](_0x44a1b1['attributes'],function(_0x2da294){var _0x19f14d={};_0x19f14d[_0x2da294]={'$like':'%'+_0x3962c5['query']['filter']+'%'};return _0x19f14d;})});}_0x44a1b1=_[_0x1558('0x52')]({},_0x44a1b1,_0x3962c5[_0x1558('0x53')]);return db[_0x1558('0x68')]['count']({'where':_0x44a1b1[_0x1558('0x51')]})['then'](function(_0x5b817a){_0x58118[_0x1558('0x31')]=_0x5b817a;if(_0x3962c5[_0x1558('0x45')]['includeAll']){_0x44a1b1['include']=[{'all':!![]}];}return db[_0x1558('0x68')][_0x1558('0x57')](_0x44a1b1);})['then'](function(_0x2f25a6){_0x58118[_0x1558('0x58')]=_0x2f25a6;return _0x58118;});}})[_0x1558('0x20')](respondWithFilteredResult(_0x384151,_0x44a1b1))[_0x1558('0x2a')](handleError(_0x384151,null));};exports[_0x1558('0x6b')]=function(_0x2157b2,_0x3806d2,_0x14a7de){return db[_0x1558('0x56')][_0x1558('0x5d')]({'where':{'id':_0x2157b2[_0x1558('0x64')]['id']}})[_0x1558('0x20')](handleEntityNotFound(_0x3806d2,null))['then'](function(_0x294d62){if(_0x294d62){return _0x294d62['removeDispositions'](_0x2157b2['query'][_0x1558('0x6c')]);}})[_0x1558('0x20')](respondWithStatusCode(_0x3806d2,null))[_0x1558('0x2a')](handleError(_0x3806d2,null));};exports[_0x1558('0x6d')]=function(_0x5273de,_0x16dfb6,_0x3d16a9){if(_0x5273de[_0x1558('0x5f')]['id']){delete _0x5273de[_0x1558('0x5f')]['id'];}return db[_0x1558('0x56')][_0x1558('0x5d')]({'where':{'id':_0x5273de[_0x1558('0x64')]['id']}})[_0x1558('0x20')](handleEntityNotFound(_0x16dfb6,null))[_0x1558('0x20')](function(_0x213774){if(_0x213774){_0x5273de['body'][_0x1558('0x67')]=_0x213774['id'];return db[_0x1558('0x6e')][_0x1558('0x5e')](_0x5273de[_0x1558('0x5f')]);}})[_0x1558('0x20')](respondWithResult(_0x16dfb6,null))[_0x1558('0x2a')](handleError(_0x16dfb6,null));};exports[_0x1558('0x6f')]=function(_0x286ce4,_0x442fed,_0x3969c7){var _0x12474f={'raw':![],'where':{}};var _0x2664fe={};var _0x201ee6={'count':0x0,'rows':[]};return db['SmsAccount'][_0x1558('0x70')]({'where':{'id':_0x286ce4['params']['id']}})['then'](handleEntityNotFound(_0x442fed,null))[_0x1558('0x20')](function(_0x2b9585){if(_0x2b9585){_0x2664fe['model']=_['keys'](db['CannedAnswer'][_0x1558('0x71')]);_0x2664fe[_0x1558('0x45')]=_[_0x1558('0x5c')](_0x286ce4[_0x1558('0x45')]);_0x2664fe['filters']=_[_0x1558('0x47')](_0x2664fe['model'],_0x2664fe[_0x1558('0x45')]);_0x12474f[_0x1558('0x49')]=_['intersection'](_0x2664fe[_0x1558('0x48')],qs[_0x1558('0x4a')](_0x286ce4[_0x1558('0x45')]['fields']));_0x12474f['attributes']=_0x12474f[_0x1558('0x49')][_0x1558('0x6a')]?_0x12474f['attributes']:_0x2664fe[_0x1558('0x48')];if(!_0x286ce4[_0x1558('0x45')][_0x1558('0x4b')](_0x1558('0x4c'))){_0x12474f[_0x1558('0x30')]=qs[_0x1558('0x30')](_0x286ce4[_0x1558('0x45')][_0x1558('0x30')]);_0x12474f[_0x1558('0x2e')]=qs[_0x1558('0x2e')](_0x286ce4[_0x1558('0x45')][_0x1558('0x2e')]);}_0x12474f['order']=qs[_0x1558('0x4e')](_0x286ce4[_0x1558('0x45')][_0x1558('0x4e')]);_0x12474f[_0x1558('0x51')]=qs[_0x1558('0x46')](_[_0x1558('0x4f')](_0x286ce4[_0x1558('0x45')],_0x2664fe['filters']));_0x12474f[_0x1558('0x51')][_0x1558('0x67')]=_0x2b9585['id'];if(_0x286ce4['query'][_0x1558('0x50')]){_0x12474f['where']=_[_0x1558('0x52')](_0x12474f['where'],{'$or':_[_0x1558('0x41')](_0x12474f['attributes'],function(_0xe7bb92){var _0x1fe878={};_0x1fe878[_0xe7bb92]={'$like':'%'+_0x286ce4[_0x1558('0x45')][_0x1558('0x50')]+'%'};return _0x1fe878;})});}_0x12474f=_['merge']({},_0x12474f,_0x286ce4['options']);return db[_0x1558('0x6e')][_0x1558('0x31')]({'where':_0x12474f[_0x1558('0x51')]})['then'](function(_0x26d576){_0x201ee6[_0x1558('0x31')]=_0x26d576;if(_0x286ce4[_0x1558('0x45')][_0x1558('0x54')]){_0x12474f[_0x1558('0x55')]=[{'all':!![]}];}return db[_0x1558('0x6e')][_0x1558('0x57')](_0x12474f);})[_0x1558('0x20')](function(_0x28d35c){_0x201ee6[_0x1558('0x58')]=_0x28d35c;return _0x201ee6;});}})[_0x1558('0x20')](respondWithFilteredResult(_0x442fed,_0x12474f))[_0x1558('0x2a')](handleError(_0x442fed,null));};exports[_0x1558('0x72')]=function(_0x1b3fab,_0x1706d1,_0x324b16){return db[_0x1558('0x56')][_0x1558('0x5d')]({'where':{'id':_0x1b3fab['params']['id']}})['then'](handleEntityNotFound(_0x1706d1,null))[_0x1558('0x20')](function(_0x1b8628){if(_0x1b8628){return _0x1b8628[_0x1558('0x72')](_0x1b3fab[_0x1558('0x45')][_0x1558('0x6c')]);}})['then'](respondWithStatusCode(_0x1706d1,null))[_0x1558('0x2a')](handleError(_0x1706d1,null));};exports[_0x1558('0x73')]=function(_0x236579,_0xc448ef,_0x521475){var _0x30e029={'channel':_0x1558('0x74')};var _0x1002fb=[];var _0x22855c=[];var _0x5b396c={};return db[_0x1558('0x56')][_0x1558('0x5d')]({'where':{'id':_0x236579[_0x1558('0x64')]['id']},'include':[{'model':db[_0x1558('0x75')],'as':_0x1558('0x76')}]})[_0x1558('0x20')](handleEntityNotFound(_0xc448ef,null))[_0x1558('0x20')](function(_0xdf549f){_0x30e029[_0x1558('0x77')]=_0xdf549f;_0x30e029[_0x1558('0x78')]=_[_0x1558('0x79')](_0xdf549f['Applications'],['priority'],[_0x1558('0x7a')]);if(_0x30e029['account'][_0x1558('0x76')]){delete _0x30e029[_0x1558('0x77')][_0x1558('0x76')];}return db[_0x1558('0x7b')][_0x1558('0x65')]();})['then'](function(_0x233e29){if(!_0x233e29){throw new db[(_0x1558('0x7c'))][(_0x1558('0x7d'))](_0x1558('0x7e'));}_0x1002fb=_[_0x1558('0x7f')](_[_0x1558('0x5c')](_0x233e29),[_0x1558('0x80'),'updatedAt']);_0x22855c=_['difference'](_[_0x1558('0x5c')](_0x233e29),[_0x1558('0x80'),_0x1558('0x81'),_0x1558('0x82'),_0x1558('0x83')]);_0x30e029[_0x1558('0x5f')]={'mapKey':_0x1558('0x84')};if(_0x30e029[_0x1558('0x77')][_0x1558('0x43')]){switch(_0x30e029[_0x1558('0x77')]['type']){case _0x1558('0x85'):_0x30e029['body']['from']=_0x236579[_0x1558('0x5f')][_0x1558('0x86')];_0x30e029[_0x1558('0x5f')]['body']=_0x236579[_0x1558('0x5f')][_0x1558('0x87')];_0x30e029[_0x1558('0x5f')][_0x1558('0x88')]=_0x236579[_0x1558('0x5f')][_0x1558('0x89')];break;case _0x1558('0x8a'):_0x30e029['body']['from']='+'+_0x236579['body'][_0x1558('0x8b')];_0x30e029[_0x1558('0x5f')][_0x1558('0x5f')]=_0x236579['body'][_0x1558('0x8c')];break;case'connectel':_0x30e029[_0x1558('0x5f')][_0x1558('0x8d')]=_0x236579[_0x1558('0x5f')][_0x1558('0x8d')];_0x30e029[_0x1558('0x5f')][_0x1558('0x5f')]=_0x236579[_0x1558('0x5f')][_0x1558('0x29')];break;case _0x1558('0x8e'):_0x30e029[_0x1558('0x5f')][_0x1558('0x8d')]=_0x236579[_0x1558('0x5f')]['from'];_0x30e029['body']['body']=_0x236579[_0x1558('0x5f')][_0x1558('0x5f')];_0x30e029[_0x1558('0x5f')][_0x1558('0x88')]=_0x236579['body'][_0x1558('0x8f')];break;case _0x1558('0x90'):_0x30e029[_0x1558('0x5f')][_0x1558('0x8d')]=_0x236579[_0x1558('0x5f')]['From'];_0x30e029[_0x1558('0x5f')][_0x1558('0x5f')]=_0x236579[_0x1558('0x5f')][_0x1558('0x91')];_0x30e029[_0x1558('0x5f')][_0x1558('0x88')]=_0x236579[_0x1558('0x5f')][_0x1558('0x92')];break;case'infobip':_0x30e029[_0x1558('0x5f')][_0x1558('0x8d')]='+'+_0x236579[_0x1558('0x5f')][_0x1558('0x93')][0x0]['from'];_0x30e029['body']['body']=_0x236579[_0x1558('0x5f')][_0x1558('0x93')][0x0][_0x1558('0x8c')];_0x30e029[_0x1558('0x5f')][_0x1558('0x88')]=_0x236579[_0x1558('0x5f')][_0x1558('0x93')][0x0][_0x1558('0x88')];break;case _0x1558('0x94'):_0x30e029[_0x1558('0x5f')][_0x1558('0x8d')]=_0x236579[_0x1558('0x5f')][_0x1558('0x95')];_0x30e029[_0x1558('0x5f')][_0x1558('0x5f')]=_0x236579[_0x1558('0x5f')]['segmentedMessage'][_0x1558('0x29')];break;case _0x1558('0x96'):_0x30e029[_0x1558('0x5f')][_0x1558('0x8d')]=_0x236579[_0x1558('0x5f')][_0x1558('0x97')];_0x30e029['body'][_0x1558('0x5f')]=_0x236579[_0x1558('0x5f')][_0x1558('0x8c')];_0x30e029[_0x1558('0x5f')]['messageId']=_0x236579[_0x1558('0x5f')]['replyMessageId'];break;case'bandwidth':_0x30e029[_0x1558('0x5f')][_0x1558('0x88')]=_0x236579[_0x1558('0x5f')][0x0][_0x1558('0x29')]['id'];_0x30e029[_0x1558('0x5f')][_0x1558('0x8d')]=_0x236579[_0x1558('0x5f')][0x0][_0x1558('0x29')]['from'];_0x30e029[_0x1558('0x5f')][_0x1558('0x5f')]=_0x236579['body'][0x0][_0x1558('0x29')][_0x1558('0x8c')];break;case'intelepeer':_0x30e029[_0x1558('0x5f')]['from']=_0x236579[_0x1558('0x5f')]['from'];_0x30e029[_0x1558('0x5f')][_0x1558('0x5f')]=_0x236579[_0x1558('0x5f')][_0x1558('0x29')];_0x30e029['body']['messageId']=_0x236579[_0x1558('0x5f')][_0x1558('0x98')];break;}}if(_0x30e029[_0x1558('0x5f')]['id']){delete _0x30e029[_0x1558('0x5f')]['id'];}if(_[_0x1558('0x99')](_0x30e029['body'][_0x1558('0x8d')])){throw new db[(_0x1558('0x7c'))]['ValidationError'](_0x1558('0x9a'));}if(_[_0x1558('0x99')](_0x30e029[_0x1558('0x5f')][_0x1558('0x5f')])||_0x30e029['body'][_0x1558('0x5f')]===''){throw new db[(_0x1558('0x7c'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x30e029['body']['mapKey'])){throw new db[(_0x1558('0x7c'))][(_0x1558('0x7d'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x22855c);}if(!_['includes'](_0x22855c,_0x30e029[_0x1558('0x5f')][_0x1558('0x9b')])){throw new db[(_0x1558('0x7c'))]['ValidationError'](_0x1558('0x9c')+_0x22855c);}_0x5b396c[_0x30e029['body']['mapKey']]=_0x30e029[_0x1558('0x5f')]['from'];return db['CmList'][_0x1558('0x5d')]({'where':{'id':_0x30e029[_0x1558('0x77')][_0x1558('0x83')]},'include':[{'model':db[_0x1558('0x7b')],'as':_0x1558('0x9d'),'where':_0x5b396c,'limit':0x1,'order':[['updatedAt',_0x1558('0x9e')]]}]});})['then'](handleEntityNotFound(_0xc448ef,null))['then'](function(_0x343781){if(_0x343781){_0x30e029[_0x1558('0x9f')]=_[_0x1558('0xa0')](_0x343781,[_0x1558('0x9d')]);if(_0x343781['Contacts'][_0x1558('0x6a')]){return _0x343781[_0x1558('0x9d')][0x0];}var _0x19b44e=_[_0x1558('0xa1')](_0x30e029['body'],{'firstName':_0x30e029[_0x1558('0x5f')][_0x1558('0x8d')],'ListId':_0x343781['id']});_0x19b44e[_0x30e029['body']['mapKey']]=_0x30e029[_0x1558('0x5f')][_0x1558('0x8d')];return db['CmContact'][_0x1558('0x5e')](_0x19b44e,{'fields':_0x1002fb,'raw':!![]});}})[_0x1558('0x20')](handleEntityNotFound(_0xc448ef,null))['then'](function(_0x499105){if(_0x499105){_0x30e029[_0x1558('0xa2')]=_0x499105;var _0x46a5d1={'ContactId':_0x499105['id'],'phone':_0x30e029['body'][_0x1558('0x8d')],'SmsAccountId':_0x236579['params']['id']};var _0x1d1ef3={'ContactId':_0x499105['id'],'SmsAccountId':_0x236579['params']['id'],'closed':![]};return db[_0x1558('0xa3')][_0x1558('0x5d')]({'where':_0x1d1ef3})[_0x1558('0x20')](function(_0x30ad1e){if(_0x30ad1e){return[_0x30ad1e,![]];}return db['SmsInteraction'][_0x1558('0x5e')](_0x46a5d1)[_0x1558('0x20')](function(_0x47a764){return[_0x47a764,!![]];});});}})[_0x1558('0xa4')](function(_0x9dd52e,_0xf42277){_0x30e029[_0x1558('0xa5')]=_0x9dd52e[_0x1558('0x39')]({'plain':!![]});_0x30e029[_0x1558('0xa5')]['created']=![];if(_0xf42277){if(_0x30e029[_0x1558('0x77')][_0x1558('0xa6')]){_0x30e029[_0x1558('0x78')][_0x1558('0xa7')]({'id':0x0,'priority':_0x30e029[_0x1558('0x78')][_0x1558('0x6a')]+0x1,'app':_0x1558('0xa8'),'appdata':_0x1558('0xa9'),'interval':'*,*,*,*'});}_0x30e029[_0x1558('0xa5')][_0x1558('0xaa')]=!![];}return db[_0x1558('0xab')][_0x1558('0x5e')]({'phone':_0x30e029['body'][_0x1558('0x8d')],'messageId':_0x30e029['body']['messageId'],'body':_0x30e029['body'][_0x1558('0x5f')],'SmsAccountId':_0x236579[_0x1558('0x64')]['id'],'SmsInteractionId':_0x9dd52e['id'],'direction':'in','ContactId':_0x9dd52e[_0x1558('0xac')],'AttachmentId':_0x30e029[_0x1558('0x5f')][_0x1558('0xad')]});})[_0x1558('0x20')](function(_0x4c52e3){_0x30e029[_0x1558('0x29')]=_0x4c52e3;if(_0x30e029[_0x1558('0xa5')]['UserId']){return db['User'][_0x1558('0x5d')]({'attributes':['id','name'],'where':{'id':_0x30e029[_0x1558('0xa5')][_0x1558('0xae')]}})[_0x1558('0x20')](function(_0x447b70){if(_0x447b70){_0x30e029[_0x1558('0x78')][_0x1558('0xaf')]({'id':0x0,'priority':0x0,'app':_0x1558('0xb0'),'appdata':_0x447b70['name']+','+(_0x30e029[_0x1558('0x77')][_0x1558('0xb1')]||0xa),'interval':_0x1558('0xb2')});}return respondWithRpcPromise(_0x1558('0xb3'),_0x1558('0xb4'),_0x30e029);});}return respondWithRpcPromise(_0x1558('0xb3'),'startRouting',_0x30e029);})[_0x1558('0x20')](function(_0x1b92da){if(_0x1b92da){var _0x4ea45c=0xc8;var _0x38d406=_0x1558('0xb5');logger[_0x1558('0x21')](_0x1558('0x25'),_0x38d406,_0x4ea45c,_0x1558('0xb6'));logger[_0x1558('0x24')](_0x1558('0xb7'),_0x38d406,_0x4ea45c,_0x1558('0xb6'),JSON[_0x1558('0x26')](_0x1b92da));if(_0x30e029[_0x1558('0x77')][_0x1558('0x43')]===_0x1558('0x85')){return _0xc448ef[_0x1558('0x2c')](_0x4ea45c)['set']('Content-Type','text/xml')[_0x1558('0x3f')]('\x0a');}else{return _0xc448ef[_0x1558('0x2c')](_0x4ea45c)[_0x1558('0x2d')](_0x1b92da);}}})[_0x1558('0x2a')](handleError(_0xc448ef,null));};exports['addApplications']=function(_0x8bc728,_0x3cda8a,_0x1f7d97){return db['SmsAccount'][_0x1558('0x70')]({'where':{'id':_0x8bc728['params']['id']}})['then'](handleEntityNotFound(_0x3cda8a,null))[_0x1558('0x20')](function(_0x1cbadf){if(_0x1cbadf){return db['sequelize'][_0x1558('0xb8')](function(_0x5cb1f9){return db['SmsApplication']['destroy']({'where':{'SmsAccountId':_0x8bc728['params']['id']},'transaction':_0x5cb1f9})[_0x1558('0x20')](function(_0x11e1a1){var _0x27f4bd=_[_0x1558('0x41')](_0x8bc728[_0x1558('0x5f')],function(_0xc561b3){_0xc561b3['SmsAccountId']=_0x8bc728['params']['id'];return _0xc561b3;});return db[_0x1558('0x75')][_0x1558('0xb9')](_0x27f4bd,{'transaction':_0x5cb1f9});});})[_0x1558('0x20')](function(){return db['SmsApplication']['findAndCountAll']({'where':{'SmsAccountId':_0x8bc728[_0x1558('0x64')]['id']},'order':_0x1558('0xba')});});}})['then'](respondWithResult(_0x3cda8a,null))['catch'](handleError(_0x3cda8a,null));};exports[_0x1558('0xbb')]=function(_0x1cc2f2,_0x18d93e,_0x2cc7df){var _0x4faa62={};var _0x4968fe={};var _0x5418cc;var _0x41a969;return db[_0x1558('0x56')][_0x1558('0x70')]({'where':{'id':_0x1cc2f2[_0x1558('0x64')]['id']}})['then'](handleEntityNotFound(_0x18d93e,null))['then'](function(_0x3dd0b9){if(_0x3dd0b9){_0x5418cc=_0x3dd0b9;_0x4968fe['model']=_[_0x1558('0x5c')](db[_0x1558('0x75')][_0x1558('0x71')]);_0x4968fe[_0x1558('0x45')]=_[_0x1558('0x5c')](_0x1cc2f2['query']);_0x4968fe['filters']=_[_0x1558('0x47')](_0x4968fe[_0x1558('0x48')],_0x4968fe['query']);_0x4faa62['attributes']=_[_0x1558('0x47')](_0x4968fe[_0x1558('0x48')],qs[_0x1558('0x4a')](_0x1cc2f2[_0x1558('0x45')][_0x1558('0x4a')]));_0x4faa62[_0x1558('0x49')]=_0x4faa62[_0x1558('0x49')]['length']?_0x4faa62[_0x1558('0x49')]:_0x4968fe[_0x1558('0x48')];_0x4faa62[_0x1558('0x4d')]=qs[_0x1558('0x4e')](_0x1cc2f2['query'][_0x1558('0x4e')]);_0x4faa62[_0x1558('0x51')]=qs[_0x1558('0x46')](_[_0x1558('0x4f')](_0x1cc2f2[_0x1558('0x45')],_0x4968fe[_0x1558('0x46')]));if(_0x1cc2f2[_0x1558('0x45')]['filter']){_0x4faa62[_0x1558('0x51')]=_[_0x1558('0x52')](_0x4faa62[_0x1558('0x51')],{'$or':_[_0x1558('0x41')](_0x4faa62['attributes'],function(_0x4b1c58){var _0x1d700c={};_0x1d700c[_0x4b1c58]={'$like':'%'+_0x1cc2f2[_0x1558('0x45')][_0x1558('0x50')]+'%'};return _0x1d700c;})});}_0x4faa62=_[_0x1558('0x52')]({},_0x4faa62,_0x1cc2f2[_0x1558('0x53')]);return _0x5418cc[_0x1558('0xbb')](_0x4faa62);}})['then'](function(_0x1f5ffe){if(_0x1f5ffe){_0x41a969=_0x1f5ffe[_0x1558('0x6a')];if(!_0x1cc2f2[_0x1558('0x45')][_0x1558('0x4b')]('nolimit')){_0x4faa62[_0x1558('0x30')]=qs[_0x1558('0x30')](_0x1cc2f2[_0x1558('0x45')][_0x1558('0x30')]);_0x4faa62['offset']=qs['offset'](_0x1cc2f2[_0x1558('0x45')][_0x1558('0x2e')]);}return _0x5418cc['getApplications'](_0x4faa62);}})[_0x1558('0x20')](function(_0x12b052){if(_0x12b052){return _0x12b052?{'count':_0x41a969,'rows':_0x12b052}:null;}})[_0x1558('0x20')](respondWithResult(_0x18d93e,null))[_0x1558('0x2a')](handleError(_0x18d93e,null));};exports[_0x1558('0xbc')]=function(_0x439ac4,_0x27fd0,_0x10a112){var _0x3f4974={'raw':![],'where':{}};var _0x310efe={};var _0x2fe439={'count':0x0,'rows':[]};return db[_0x1558('0x56')][_0x1558('0x70')]({'where':{'id':_0x439ac4[_0x1558('0x64')]['id']}})[_0x1558('0x20')](handleEntityNotFound(_0x27fd0,null))[_0x1558('0x20')](function(_0x311fc5){if(_0x311fc5){_0x310efe[_0x1558('0x48')]=_[_0x1558('0x5c')](db[_0x1558('0xa3')][_0x1558('0x71')]);_0x310efe['query']=_[_0x1558('0x5c')](_0x439ac4[_0x1558('0x45')]);_0x310efe[_0x1558('0x46')]=_['intersection'](_0x310efe[_0x1558('0x48')],_0x310efe[_0x1558('0x45')]);_0x3f4974[_0x1558('0x49')]=_[_0x1558('0x47')](_0x310efe[_0x1558('0x48')],qs[_0x1558('0x4a')](_0x439ac4[_0x1558('0x45')][_0x1558('0x4a')]));_0x3f4974[_0x1558('0x49')]=_0x3f4974[_0x1558('0x49')]['length']?_0x3f4974[_0x1558('0x49')]:_0x310efe['model'];if(!_0x439ac4[_0x1558('0x45')][_0x1558('0x4b')]('nolimit')){_0x3f4974[_0x1558('0x30')]=qs['limit'](_0x439ac4[_0x1558('0x45')][_0x1558('0x30')]);_0x3f4974['offset']=qs[_0x1558('0x2e')](_0x439ac4[_0x1558('0x45')][_0x1558('0x2e')]);}_0x3f4974['order']=qs[_0x1558('0x4e')](_0x439ac4[_0x1558('0x45')][_0x1558('0x4e')]);_0x3f4974['where']=qs[_0x1558('0x46')](_[_0x1558('0x4f')](_0x439ac4['query'],_0x310efe['filters']));_0x3f4974[_0x1558('0x51')]['SmsAccountId']=_0x311fc5['id'];if(_0x439ac4['query'][_0x1558('0x50')]){_0x3f4974[_0x1558('0x51')]=_[_0x1558('0x52')](_0x3f4974[_0x1558('0x51')],{'$or':_[_0x1558('0x41')](_0x3f4974[_0x1558('0x49')],function(_0x3c5fd7){var _0x44d5d4={};_0x44d5d4[_0x3c5fd7]={'$like':'%'+_0x439ac4[_0x1558('0x45')][_0x1558('0x50')]+'%'};return _0x44d5d4;})});}_0x3f4974=_[_0x1558('0x52')]({},_0x3f4974,_0x439ac4['options']);return db[_0x1558('0xa3')][_0x1558('0x31')]({'where':_0x3f4974[_0x1558('0x51')]})[_0x1558('0x20')](function(_0x5ce3d6){_0x2fe439[_0x1558('0x31')]=_0x5ce3d6;if(_0x439ac4['query'][_0x1558('0x54')]){_0x3f4974[_0x1558('0x55')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x1558('0xbd')],'as':_0x1558('0xbe'),'attributes':[_0x1558('0x3e'),_0x1558('0xbf'),_0x1558('0xc0')],'required':![]},{'model':db[_0x1558('0xc1')],'as':_0x1558('0xc2'),'attributes':['id','name',_0x1558('0xc3')],'where':_0x439ac4['query'][_0x1558('0xc4')]?{'id':_0x439ac4['query'][_0x1558('0xc4')]}:undefined,'required':_0x439ac4[_0x1558('0x45')][_0x1558('0xc4')]?!![]:![]}];}return db[_0x1558('0xa3')][_0x1558('0x57')](_0x3f4974);})['then'](function(_0x121f50){_0x2fe439[_0x1558('0x58')]=_0x121f50;return _0x2fe439;});}})['then'](respondWithFilteredResult(_0x27fd0,_0x3f4974))[_0x1558('0x2a')](handleError(_0x27fd0,null));};exports[_0x1558('0x3f')]=function(_0x2ab6a0,_0x5c04a8,_0x13cf71){var _0x699b21,_0x1b2bed,_0x2e6497;if(_['isNil'](_0x2ab6a0['body'][_0x1558('0x5f')])||_0x2ab6a0[_0x1558('0x5f')][_0x1558('0x5f')]===''){throw new db[(_0x1558('0x7c'))]['ValidationError'](_0x1558('0xc5'));}if(_['isNil'](_0x2ab6a0[_0x1558('0x5f')]['to'])){throw new db[(_0x1558('0x7c'))][(_0x1558('0x7d'))]('to\x20is\x20mandatory');}_0x699b21=_0x2ab6a0[_0x1558('0x5f')]['to'];return db[_0x1558('0x56')][_0x1558('0x5d')]({'where':{'id':_0x2ab6a0[_0x1558('0x64')]['id']},'include':[{'model':db[_0x1558('0xc6')],'as':'List','include':[{'model':db[_0x1558('0x7b')],'as':_0x1558('0x9d'),'where':{'mobile':_0x699b21},'limit':0x1,'order':[['updatedAt',_0x1558('0x9e')]]}]}]})[_0x1558('0x20')](handleEntityNotFound(_0x5c04a8,null))[_0x1558('0x20')](function(_0x2f053a){if(_0x2f053a&&_0x2f053a[_0x1558('0xc7')]){_0x1b2bed=_0x2f053a[_0x1558('0x39')]({'plain':!![]});if(_0x1b2bed['List']&&_0x1b2bed['List'][_0x1558('0x9d')][_0x1558('0x6a')]){return _0x1b2bed[_0x1558('0xc7')]['Contacts'][0x0];}return db['CmContact']['create'](_[_0x1558('0xa1')](_0x2ab6a0[_0x1558('0x5f')],{'firstName':_0x699b21,'mobile':_0x699b21,'phone':_0x699b21,'ListId':_0x1b2bed[_0x1558('0x83')]}));}})[_0x1558('0x20')](handleEntityNotFound(_0x5c04a8,null))['then'](function(_0x3d62a3){if(_0x3d62a3){_0x2e6497=_0x3d62a3;return db[_0x1558('0xa3')][_0x1558('0x5d')]({'where':{'ContactId':_0x2e6497['id'],'closed':![],'SmsAccountId':_0x1b2bed['id']}})[_0x1558('0x20')](function(_0x5929a6){if(_0x5929a6){return[_0x5929a6,![]];}return db[_0x1558('0xa3')][_0x1558('0x5e')]({'UserId':_0x2ab6a0['user']['id'],'ContactId':_0x2e6497['id'],'SmsAccountId':_0x1b2bed['id'],'phone':_0x699b21,'firstMsgDirection':_0x1558('0xc8'),'Messages':[_[_0x1558('0x52')](_0x2ab6a0[_0x1558('0x5f')],{'read':![],'body':_0x2ab6a0[_0x1558('0x5f')][_0x1558('0x5f')],'phone':_0x699b21,'SmsAccountId':_0x1b2bed['id'],'UserId':_0x2ab6a0['user']['id'],'ContactId':_0x2e6497['id']})]},{'include':[{'model':db[_0x1558('0xab')],'as':'Messages'}]})['then'](function(_0x37fe2f){return[_0x37fe2f,!![]];});});}})['spread'](function(_0x3fc5db,_0x16a2d7){if(_0x16a2d7){return _0x3fc5db;}return db[_0x1558('0xab')][_0x1558('0x5e')](_[_0x1558('0x52')](_0x2ab6a0[_0x1558('0x5f')],{'read':![],'body':_0x2ab6a0[_0x1558('0x5f')]['body'],'phone':_0x699b21,'SmsAccountId':_0x1b2bed['id'],'SmsInteractionId':_0x3fc5db['id'],'UserId':_0x2ab6a0[_0x1558('0x60')]['id'],'ContactId':_0x2e6497['id']}))[_0x1558('0x20')](function(_0x3cf03c){_0x3fc5db['dataValues'][_0x1558('0xc9')]=[];_0x3fc5db[_0x1558('0xca')]['Messages']['push'](_0x3cf03c[_0x1558('0xca')]);return _0x3fc5db;});})[_0x1558('0x20')](respondWithResult(_0x5c04a8,null))[_0x1558('0x2a')](handleError(_0x5c04a8,null));};exports[_0x1558('0x2c')]=function(_0x3a89ca,_0x5e06ca,_0x208dd5){if(_0x3a89ca[_0x1558('0x5f')]['id']){delete _0x3a89ca[_0x1558('0x5f')]['id'];}var _0x58882c,_0x2c60a8,_0x42fdd9;return db['SmsAccount'][_0x1558('0x5d')]({'where':{'id':_0x3a89ca['params']['id']}})[_0x1558('0x20')](handleEntityNotFound(_0x5e06ca,null))[_0x1558('0x20')](function(_0x7c4e38){if(_0x7c4e38){_0x42fdd9=_0x7c4e38;logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1558('0x2c'),_0x1558('0xcb'),_0x7c4e38['type'],util[_0x1558('0xcc')](_0x3a89ca[_0x1558('0x5f')],{'showHidden':![],'depth':null}));switch(_0x7c4e38[_0x1558('0x43')]){case _0x1558('0x8a'):if(_0x3a89ca[_0x1558('0x5f')][_0x1558('0xcd')]&&_0x3a89ca[_0x1558('0x5f')][_0x1558('0x2c')]){_0x2c60a8=_0x3a89ca[_0x1558('0x5f')][_0x1558('0x2c')];return db[_0x1558('0xab')][_0x1558('0x5d')]({'where':{'messageId':_0x3a89ca[_0x1558('0x5f')][_0x1558('0xcd')]}});}break;case'connectel':if(_0x3a89ca[_0x1558('0x5f')][_0x1558('0xce')]&&_0x3a89ca[_0x1558('0x5f')]['statusInt']){_0x2c60a8=_0x3a89ca[_0x1558('0x5f')]['statusInt'];return db[_0x1558('0xab')]['find']({'where':{'messageId':_0x3a89ca[_0x1558('0x5f')][_0x1558('0xce')]}});}break;case _0x1558('0x8e'):if(_0x3a89ca[_0x1558('0x5f')][_0x1558('0x8f')]&&_0x3a89ca[_0x1558('0x5f')][_0x1558('0xcf')]){_0x2c60a8=_0x3a89ca[_0x1558('0x5f')][_0x1558('0xcf')];return db[_0x1558('0xab')][_0x1558('0x5d')]({'where':{'messageId':_0x3a89ca[_0x1558('0x5f')][_0x1558('0x8f')]}});}break;case _0x1558('0xd0'):var _0xd4b837=_0x3a89ca[_0x1558('0x5f')][_0x1558('0x93')][0x0];if(_0xd4b837[_0x1558('0x88')]&&_0xd4b837[_0x1558('0x2c')][_0x1558('0xd1')]===_0x1558('0xd2')){_0x2c60a8=_0xd4b837[_0x1558('0x2c')][_0x1558('0xd1')];return db[_0x1558('0xab')][_0x1558('0x5d')]({'where':{'messageId':_0xd4b837['messageId']}});}break;case _0x1558('0x96'):if(_0x3a89ca[_0x1558('0x5f')][_0x1558('0x88')]&&_0x3a89ca[_0x1558('0x5f')][_0x1558('0x2c')]){_0x2c60a8=_0x3a89ca[_0x1558('0x5f')][_0x1558('0x2c')];return db[_0x1558('0xab')][_0x1558('0x5d')]({'where':{'messageId':_0x3a89ca[_0x1558('0x5f')][_0x1558('0x88')]}});}break;case'bandwidth':if(_0x3a89ca[_0x1558('0x5f')][0x0]['message']['id']){_0x2c60a8=_0x3a89ca['body'][0x0][_0x1558('0x43')];return db[_0x1558('0xab')][_0x1558('0x5d')]({'where':{'messageId':_0x3a89ca[_0x1558('0x5f')][0x0][_0x1558('0x29')]['id']}});}break;case _0x1558('0xd3'):if(_0x3a89ca['body'][_0x1558('0xd4')]&&_0x3a89ca[_0x1558('0x5f')][_0x1558('0x2c')]){_0x2c60a8=_0x3a89ca[_0x1558('0x5f')][_0x1558('0x2c')];return db[_0x1558('0xab')][_0x1558('0x5d')]({'where':{'messageId':_0x3a89ca[_0x1558('0x5f')]['redif']}});}break;}}})['then'](handleEntityNotFound(_0x5e06ca,null))[_0x1558('0x20')](function(_0x1cbb54){if(_0x1cbb54){_0x58882c=_0x1cbb54;switch(_0x42fdd9[_0x1558('0x43')]){case _0x1558('0x8a'):if(_0x2c60a8==='DELIVERED'){return _0x58882c[_0x1558('0x37')]({'read':!![]});}else{logger[_0x1558('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','skebby',util[_0x1558('0xcc')](_0x3a89ca[_0x1558('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x1558('0xd5'):if(_0x2c60a8==='1'){return _0x58882c['update']({'read':!![]});}else{logger[_0x1558('0x27')](_0x1558('0x25'),_0x1558('0x2c'),_0x1558('0x8a'),util[_0x1558('0xcc')](_0x3a89ca[_0x1558('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x1558('0x8e'):if(!_0x3a89ca[_0x1558('0x5f')][_0x1558('0xd6')]&&_0x2c60a8>=0xc8&&_0x2c60a8<=0xce){return _0x58882c['update']({'read':!![]});}else{logger[_0x1558('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1558('0x2c'),_0x1558('0x8e'),util[_0x1558('0xcc')](_0x3a89ca[_0x1558('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x1558('0xd0'):var _0x3f218c=_0x3a89ca[_0x1558('0x5f')][_0x1558('0x93')][0x0];if(_0x3f218c[_0x1558('0x2c')][_0x1558('0xd1')]==='DELIVERED'){return _0x58882c[_0x1558('0x37')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1558('0x2c'),'infobip',util[_0x1558('0xcc')](_0x3a89ca['body'],{'showHidden':![],'depth':null}));}break;case _0x1558('0x96'):if(_0x2c60a8==_0x1558('0xd7')||_0x2c60a8==_0x1558('0xd8')){return _0x58882c['update']({'read':!![]});}else{logger['error'](_0x1558('0x25'),_0x1558('0x2c'),'clickatell',util[_0x1558('0xcc')](_0x3a89ca['body'],{'showHidden':![],'depth':null}));}break;case _0x1558('0xd9'):if(_0x2c60a8=='message-delivered'){return _0x58882c[_0x1558('0x37')]({'read':!![]});}else{logger[_0x1558('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x1558('0xd9'),util[_0x1558('0xcc')](_0x3a89ca['body'],{'showHidden':![],'depth':null}));}break;case _0x1558('0xd3'):if(_0x2c60a8==='DELIVRD'||_0x2c60a8===_0x1558('0xda')){return _0x58882c['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1558('0x2c'),'intelepeer',util[_0x1558('0xcc')](_0x3a89ca[_0x1558('0x5f')],{'showHidden':![],'depth':null}));}break;}return _0x58882c;}})[_0x1558('0x20')](respondWithResult(_0x5e06ca,null))[_0x1558('0x2a')](handleError(_0x5e06ca,null));};exports['statusGet']=function(_0xdffcc6,_0x5b76df,_0xfd1948){var _0x5f15ba,_0x2552cc,_0x2ff371;return db['SmsAccount'][_0x1558('0x5d')]({'where':{'id':_0xdffcc6[_0x1558('0x64')]['id']}})[_0x1558('0x20')](handleEntityNotFound(_0x5b76df,null))[_0x1558('0x20')](function(_0x4ceaa4){if(_0x4ceaa4){_0x2ff371=_0x4ceaa4;logger[_0x1558('0x24')](_0x1558('0x25'),'status',_0x1558('0xcb'),_0x4ceaa4[_0x1558('0x43')],util['inspect'](_0xdffcc6[_0x1558('0x45')],{'showHidden':![],'depth':null}));switch(_0x4ceaa4['type']){case _0x1558('0x94'):if(_0xdffcc6[_0x1558('0x45')]['message-id']&&_0xdffcc6[_0x1558('0x45')]['state']){_0x2552cc=_0xdffcc6[_0x1558('0x45')][_0x1558('0xdb')];return db[_0x1558('0xab')][_0x1558('0x5d')]({'where':{'messageId':_0xdffcc6[_0x1558('0x45')]['message-id']}});}break;}}})['then'](handleEntityNotFound(_0x5b76df,null))[_0x1558('0x20')](function(_0x1ea6ff){if(_0x1ea6ff){_0x5f15ba=_0x1ea6ff;switch(_0x2ff371['type']){case _0x1558('0x94'):if(_0x2552cc==='2'||_0x2552cc==='6'){return _0x5f15ba['update']({'read':!![]});}else{logger[_0x1558('0x27')](_0x1558('0x25'),_0x1558('0x2c'),_0x1558('0x94'),util['inspect'](_0xdffcc6[_0x1558('0x45')],{'showHidden':![],'depth':null}));};break;}return _0x5f15ba;}})['then'](respondWithResult(_0x5b76df,null))[_0x1558('0x2a')](handleError(_0x5b76df,null));};exports['addAgents']=function(_0x16ef1a,_0xac6f6c,_0x3bd38e){return db[_0x1558('0x56')][_0x1558('0x5d')]({'where':{'id':_0x16ef1a[_0x1558('0x64')]['id']}})['then'](handleEntityNotFound(_0xac6f6c,null))[_0x1558('0x20')](function(_0xca3d11){if(_0xca3d11){return _0xca3d11[_0x1558('0xdc')](_0x16ef1a[_0x1558('0x5f')]['ids'],_[_0x1558('0xa0')](_0x16ef1a[_0x1558('0x5f')],[_0x1558('0x6c'),'id'])||{})[_0x1558('0xa4')](function(_0x2218a9){for(var _0x394aa2=0x0;_0x394aa2<_0x16ef1a['body'][_0x1558('0x6c')][_0x1558('0x6a')];_0x394aa2+=0x1){socket['emit'](_0x1558('0xdd'),{'UserId':Number(_0x16ef1a[_0x1558('0x5f')][_0x1558('0x6c')][_0x394aa2]),'SmsAccountId':Number(_0x16ef1a[_0x1558('0x64')]['id'])});}return _0x2218a9;});}})[_0x1558('0x20')](respondWithResult(_0xac6f6c,null))['catch'](handleError(_0xac6f6c,null));};exports[_0x1558('0xde')]=function(_0x3df507,_0x2fa706,_0x3ea0ab){return db[_0x1558('0x56')][_0x1558('0x5d')]({'where':{'id':_0x3df507[_0x1558('0x64')]['id']}})[_0x1558('0x20')](handleEntityNotFound(_0x2fa706,null))[_0x1558('0x20')](function(_0x54248a){if(_0x54248a){return _0x54248a['removeAgents'](_0x3df507['query'][_0x1558('0x6c')])[_0x1558('0x20')](function(){if(_['isArray'](_0x3df507[_0x1558('0x45')][_0x1558('0x6c')])){for(var _0x566f87=0x0;_0x566f87<_0x3df507[_0x1558('0x45')][_0x1558('0x6c')]['length'];_0x566f87+=0x1){socket[_0x1558('0xdf')](_0x1558('0xe0'),{'UserId':Number(_0x3df507[_0x1558('0x45')]['ids'][_0x566f87]),'SmsAccountId':Number(_0x3df507[_0x1558('0x64')]['id'])});}}else{socket['emit'](_0x1558('0xe0'),{'UserId':Number(_0x3df507[_0x1558('0x45')][_0x1558('0x6c')]),'SmsAccountId':Number(_0x3df507[_0x1558('0x64')]['id'])});}});}})[_0x1558('0x20')](respondWithStatusCode(_0x2fa706,null))['catch'](handleError(_0x2fa706,null));};exports[_0x1558('0xe1')]=function(_0x557917,_0x5cc825,_0x3d15a1){var _0x29611b={};var _0x5dcb36={};var _0x18f8eb;var _0x4a734d;return db[_0x1558('0x56')]['findOne']({'where':{'id':_0x557917[_0x1558('0x64')]['id']}})[_0x1558('0x20')](handleEntityNotFound(_0x5cc825,null))[_0x1558('0x20')](function(_0x3584bc){if(_0x3584bc){_0x18f8eb=_0x3584bc;_0x5dcb36[_0x1558('0x48')]=_[_0x1558('0x5c')](db[_0x1558('0xbd')][_0x1558('0x71')]);_0x5dcb36['query']=_[_0x1558('0x5c')](_0x557917[_0x1558('0x45')]);_0x5dcb36[_0x1558('0x46')]=_[_0x1558('0x47')](_0x5dcb36['model'],_0x5dcb36[_0x1558('0x45')]);_0x29611b[_0x1558('0x49')]=_[_0x1558('0x47')](_0x5dcb36[_0x1558('0x48')],qs[_0x1558('0x4a')](_0x557917[_0x1558('0x45')][_0x1558('0x4a')]));_0x29611b['attributes']=_0x29611b[_0x1558('0x49')][_0x1558('0x6a')]?_0x29611b[_0x1558('0x49')]:_0x5dcb36[_0x1558('0x48')];_0x29611b[_0x1558('0x4d')]=qs[_0x1558('0x4e')](_0x557917[_0x1558('0x45')][_0x1558('0x4e')]);_0x29611b[_0x1558('0x51')]=qs['filters'](_[_0x1558('0x4f')](_0x557917[_0x1558('0x45')],_0x5dcb36['filters']));if(_0x557917[_0x1558('0x45')][_0x1558('0x50')]){_0x29611b[_0x1558('0x51')]=_[_0x1558('0x52')](_0x29611b[_0x1558('0x51')],{'$or':_['map'](_0x29611b[_0x1558('0x49')],function(_0x36bc7a){var _0xa695f={};_0xa695f[_0x36bc7a]={'$like':'%'+_0x557917['query'][_0x1558('0x50')]+'%'};return _0xa695f;})});}_0x29611b=_[_0x1558('0x52')]({},_0x29611b,_0x557917[_0x1558('0x53')]);return _0x18f8eb['getAgents'](_0x29611b);}})[_0x1558('0x20')](function(_0x2f14d1){if(_0x2f14d1){_0x4a734d=_0x2f14d1[_0x1558('0x6a')];if(!_0x557917['query'][_0x1558('0x4b')]('nolimit')){_0x29611b[_0x1558('0x30')]=qs['limit'](_0x557917[_0x1558('0x45')][_0x1558('0x30')]);_0x29611b['offset']=qs[_0x1558('0x2e')](_0x557917[_0x1558('0x45')][_0x1558('0x2e')]);}return _0x18f8eb[_0x1558('0xe1')](_0x29611b);}})['then'](function(_0x3b5f03){if(_0x3b5f03){return _0x3b5f03?{'count':_0x4a734d,'rows':_0x3b5f03}:null;}})[_0x1558('0x20')](respondWithResult(_0x5cc825,null))[_0x1558('0x2a')](handleError(_0x5cc825,null));}; \ No newline at end of file +var _0x47e7=['key','model','keys','filters','query','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','name','options','SmsAccount','findAll','rows','show','params','intersection','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','SmsAccountId','Disposition','findOne','nolimit','order','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','sms','SmsApplication','account','applications','orderBy','Applications','priority','CmContact','Sequelize','ValidationError','createdAt','updatedAt','difference','ListId','from','messageId','skebby','sender','text','connectel','clicksend','message_id','plivo','From','Text','MessageUUID','infobip','results','csc','segmentedMessage','clickatell','fromNumber','replyMessageId','from\x20is\x20mandatory','isNil','mapKey','includes','CmList','Contacts','DESC','list','omit','contact','SmsInteraction','autoclose','close','unmanaged','*,*,*,*','created','SmsMessage','ContactId','AttachmentId','interaction','UserId','unshift','agent','waitForTheAssignedAgent','startRouting','Start','receiveMessage','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','text/xml','\x0a','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','User','internal','Tag','Tags','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','out','dataValues','Messages','push','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','status_code','groupName','bandwidth','redif','DELIVERED','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','intelepeer','ACCEPTD','statusGet','state','addAgents','spread','userSmsAccount:save','removeAgents','userSmsAccount:remove','emit','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','then','info','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','save','update','destroy','get','SmsAccounts','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','type'];(function(_0x3f9298,_0xb76476){var _0x4d53ba=function(_0x48626a){while(--_0x48626a){_0x3f9298['push'](_0x3f9298['shift']());}};_0x4d53ba(++_0xb76476);}(_0x47e7,0x9d));var _0x747e=function(_0x1c285c,_0x213c88){_0x1c285c=_0x1c285c-0x0;var _0x337e6a=_0x47e7[_0x1c285c];return _0x337e6a;};'use strict';var emlformat=require(_0x747e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x747e('0x1'));var jsonpatch=require(_0x747e('0x2'));var rp=require('request-promise');var moment=require(_0x747e('0x3'));var BPromise=require(_0x747e('0x4'));var Mustache=require(_0x747e('0x5'));var util=require(_0x747e('0x6'));var path=require(_0x747e('0x7'));var sox=require('sox');var csv=require(_0x747e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x747e('0x9'));var squel=require('squel');var crypto=require(_0x747e('0xa'));var jsforce=require(_0x747e('0xb'));var deskjs=require(_0x747e('0xc'));var toCsv=require('to-csv');var querystring=require(_0x747e('0xd'));var Papa=require(_0x747e('0xe'));var Redis=require(_0x747e('0xf'));var authService=require(_0x747e('0x10'));var qs=require(_0x747e('0x11'));var as=require(_0x747e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x747e('0x13'))(_0x747e('0x14'));var utils=require(_0x747e('0x15'));var config=require(_0x747e('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x747e('0x17'))['db'];config['redis']=_[_0x747e('0x18')](config[_0x747e('0x19')],{'host':_0x747e('0x1a'),'port':0x18eb});var socket=require(_0x747e('0x1b'))(new Redis(config['redis']));require(_0x747e('0x1c'))[_0x747e('0x1d')](socket);var jayson=require(_0x747e('0x1e'));var client=jayson[_0x747e('0x1f')]['http']({'port':0x232c});function respondWithRpcPromise(_0x2f7411,_0x36cacf,_0x1a63f3,_0x3f0261){return new BPromise(function(_0x2c352d,_0x7d242){var _0xc1a577=_0x3f0261||client;return _0xc1a577['request'](_0x2f7411,_0x1a63f3)[_0x747e('0x20')](function(_0x1ed684){logger[_0x747e('0x21')]('SmsAccount,\x20%s,\x20%s',_0x36cacf,_0x747e('0x22'));logger['debug'](_0x747e('0x23'),_0x36cacf,'request\x20sent',JSON[_0x747e('0x24')](_0x1ed684));if(_0x1ed684[_0x747e('0x25')]){if(_0x1ed684[_0x747e('0x25')][_0x747e('0x26')]===0x1f4){logger['error'](_0x747e('0x27'),_0x36cacf,_0x1ed684[_0x747e('0x25')][_0x747e('0x28')]);return _0x7d242(_0x1ed684[_0x747e('0x25')][_0x747e('0x28')]);}logger[_0x747e('0x25')](_0x747e('0x27'),_0x36cacf,_0x1ed684[_0x747e('0x25')]['message']);return _0x2c352d(_0x1ed684[_0x747e('0x25')][_0x747e('0x28')]);}else{logger[_0x747e('0x21')](_0x747e('0x27'),_0x36cacf,_0x747e('0x22'));_0x2c352d(_0x1ed684[_0x747e('0x29')][_0x747e('0x28')]);}})[_0x747e('0x2a')](function(_0x463061){logger['error'](_0x747e('0x27'),_0x36cacf,_0x463061);_0x7d242(_0x463061);});});}function respondWithStatusCode(_0x2146a5,_0x5406ee){_0x5406ee=_0x5406ee||0xcc;return function(_0x571569){if(_0x571569){return _0x2146a5[_0x747e('0x2b')](_0x5406ee);}return _0x2146a5[_0x747e('0x2c')](_0x5406ee)[_0x747e('0x2d')]();};}function respondWithResult(_0x12f63a,_0x1d2a6a){_0x1d2a6a=_0x1d2a6a||0xc8;return function(_0x2cdd48){if(_0x2cdd48){return _0x12f63a['status'](_0x1d2a6a)[_0x747e('0x2e')](_0x2cdd48);}};}function respondWithFilteredResult(_0x563e5a,_0x8b7c65){return function(_0x92aed0){if(_0x92aed0){var _0x488e5d=typeof _0x8b7c65['offset']==='undefined'&&typeof _0x8b7c65['limit']==='undefined';var _0x47d54a=_0x92aed0[_0x747e('0x2f')];var _0x2e43fb=_0x488e5d?0x0:_0x8b7c65[_0x747e('0x30')];var _0x1335ea=_0x488e5d?_0x92aed0[_0x747e('0x2f')]:_0x8b7c65[_0x747e('0x30')]+_0x8b7c65[_0x747e('0x31')];var _0xddfd21;if(_0x1335ea>=_0x47d54a){_0x1335ea=_0x47d54a;_0xddfd21=0xc8;}else{_0xddfd21=0xce;}_0x563e5a[_0x747e('0x2c')](_0xddfd21);return _0x563e5a[_0x747e('0x32')]('Content-Range',_0x2e43fb+'-'+_0x1335ea+'/'+_0x47d54a)[_0x747e('0x2e')](_0x92aed0);}return null;};}function patchUpdates(_0x6d1849){return function(_0x3e0842){try{jsonpatch['apply'](_0x3e0842,_0x6d1849,!![]);}catch(_0x4388fb){return BPromise['reject'](_0x4388fb);}return _0x3e0842[_0x747e('0x33')]();};}function saveUpdates(_0x3eb960,_0x52634b){return function(_0xbca505){if(_0xbca505){return _0xbca505[_0x747e('0x34')](_0x3eb960)[_0x747e('0x20')](function(_0x5ae071){return _0x5ae071;});}return null;};}function removeEntity(_0x2494cf,_0x1b9fb8){return function(_0x2d57d5){if(_0x2d57d5){return _0x2d57d5[_0x747e('0x35')]()[_0x747e('0x20')](function(){var _0x4da358=_0x2d57d5[_0x747e('0x36')]({'plain':!![]});var _0x43f850=_0x747e('0x37');return db['UserProfileResource']['destroy']({'where':{'type':_0x43f850,'resourceId':_0x4da358['id']}})[_0x747e('0x20')](function(){return _0x2d57d5;});})['then'](function(){_0x2494cf[_0x747e('0x2c')](0xcc)[_0x747e('0x2d')]();});}};}function handleEntityNotFound(_0x388d1d,_0x565051){return function(_0x46b09a){if(!_0x46b09a){_0x388d1d[_0x747e('0x2b')](0x194);}return _0x46b09a;};}function handleError(_0x3b7cb5,_0x1a127e){_0x1a127e=_0x1a127e||0x1f4;return function(_0x4b9c57){logger[_0x747e('0x25')](_0x4b9c57['stack']);if(_0x4b9c57['name']){delete _0x4b9c57['name'];}_0x3b7cb5['status'](_0x1a127e)[_0x747e('0x38')](_0x4b9c57);};}exports[_0x747e('0x39')]=function(_0x1ae7de,_0x123bc7){var _0x26702f={'include':[{'model':db[_0x747e('0x3a')],'as':_0x747e('0x3b')}]},_0xc422b3={},_0x57120f={'count':0x0,'rows':[]};var _0x1ccf31=_[_0x747e('0x3c')](db['SmsAccount'][_0x747e('0x3d')],function(_0x434b73){return{'name':_0x434b73['fieldName'],'type':_0x434b73[_0x747e('0x3e')][_0x747e('0x3f')]};});_0xc422b3[_0x747e('0x40')]=_['map'](_0x1ccf31,'name');_0xc422b3['query']=_[_0x747e('0x41')](_0x1ae7de['query']);_0xc422b3[_0x747e('0x42')]=_['intersection'](_0xc422b3[_0x747e('0x40')],_0xc422b3[_0x747e('0x43')]);_0x26702f[_0x747e('0x44')]=_['intersection'](_0xc422b3[_0x747e('0x40')],qs[_0x747e('0x45')](_0x1ae7de[_0x747e('0x43')][_0x747e('0x45')]));_0x26702f[_0x747e('0x44')]=_0x26702f[_0x747e('0x44')][_0x747e('0x46')]?_0x26702f[_0x747e('0x44')]:_0xc422b3[_0x747e('0x40')];if(!_0x1ae7de[_0x747e('0x43')][_0x747e('0x47')]('nolimit')){_0x26702f[_0x747e('0x31')]=qs['limit'](_0x1ae7de[_0x747e('0x43')][_0x747e('0x31')]);_0x26702f['offset']=qs[_0x747e('0x30')](_0x1ae7de[_0x747e('0x43')]['offset']);}_0x26702f['order']=qs[_0x747e('0x48')](_0x1ae7de[_0x747e('0x43')][_0x747e('0x48')]);_0x26702f[_0x747e('0x49')]=qs['filters'](_[_0x747e('0x4a')](_0x1ae7de[_0x747e('0x43')],_0xc422b3[_0x747e('0x42')]),_0x1ccf31);if(_0x1ae7de[_0x747e('0x43')][_0x747e('0x4b')]){_0x26702f['where']=_[_0x747e('0x4c')](_0x26702f[_0x747e('0x49')],{'$or':_[_0x747e('0x3c')](_0x1ccf31,function(_0x23bbd5){if(_0x23bbd5['type']!=='VIRTUAL'){var _0x4829c2={};_0x4829c2[_0x23bbd5[_0x747e('0x4d')]]={'$like':'%'+_0x1ae7de['query'][_0x747e('0x4b')]+'%'};return _0x4829c2;}})});}_0x26702f=_['merge']({},_0x26702f,_0x1ae7de[_0x747e('0x4e')]);var _0x40cea4={'where':_0x26702f[_0x747e('0x49')]};return db[_0x747e('0x4f')][_0x747e('0x2f')](_0x40cea4)['then'](function(_0xd3748b){_0x57120f[_0x747e('0x2f')]=_0xd3748b;if(_0x1ae7de[_0x747e('0x43')]['includeAll']){_0x26702f['include']=[{'all':!![]}];}return db[_0x747e('0x4f')][_0x747e('0x50')](_0x26702f);})[_0x747e('0x20')](function(_0x443c27){_0x57120f[_0x747e('0x51')]=_0x443c27;return _0x57120f;})[_0x747e('0x20')](respondWithFilteredResult(_0x123bc7,_0x26702f))['catch'](handleError(_0x123bc7,null));};exports[_0x747e('0x52')]=function(_0x5ba1ea,_0x5efd50){var _0xad6ec1={'raw':![],'where':{'id':_0x5ba1ea[_0x747e('0x53')]['id']},'include':[{'model':db[_0x747e('0x3a')],'as':_0x747e('0x3b')}]},_0x2dc879={};_0x2dc879['model']=_[_0x747e('0x41')](db['SmsAccount'][_0x747e('0x3d')]);_0x2dc879[_0x747e('0x43')]=_[_0x747e('0x41')](_0x5ba1ea[_0x747e('0x43')]);_0x2dc879['filters']=_[_0x747e('0x54')](_0x2dc879[_0x747e('0x40')],_0x2dc879[_0x747e('0x43')]);_0xad6ec1[_0x747e('0x44')]=_[_0x747e('0x54')](_0x2dc879[_0x747e('0x40')],qs[_0x747e('0x45')](_0x5ba1ea[_0x747e('0x43')]['fields']));_0xad6ec1['attributes']=_0xad6ec1[_0x747e('0x44')][_0x747e('0x46')]?_0xad6ec1['attributes']:_0x2dc879[_0x747e('0x40')];if(_0x5ba1ea['query'][_0x747e('0x55')]){_0xad6ec1[_0x747e('0x56')]=[{'all':!![]}];}_0xad6ec1=_[_0x747e('0x4c')]({},_0xad6ec1,_0x5ba1ea[_0x747e('0x4e')]);return db['SmsAccount'][_0x747e('0x57')](_0xad6ec1)[_0x747e('0x20')](handleEntityNotFound(_0x5efd50,null))[_0x747e('0x20')](respondWithResult(_0x5efd50,null))[_0x747e('0x2a')](handleError(_0x5efd50,null));};exports[_0x747e('0x58')]=function(_0x4cba5b,_0x4ea400){return db[_0x747e('0x4f')][_0x747e('0x58')](_0x4cba5b[_0x747e('0x59')],{})['then'](function(_0x45f1a2){var _0x7d5638=_0x4cba5b[_0x747e('0x5a')]['get']({'plain':!![]});if(!_0x7d5638)throw new Error(_0x747e('0x5b'));if(_0x7d5638[_0x747e('0x5c')]===_0x747e('0x5a')){var _0x4ecfcb=_0x45f1a2[_0x747e('0x36')]({'plain':!![]});var _0x600fd6=_0x747e('0x37');return db[_0x747e('0x5d')][_0x747e('0x57')]({'where':{'name':_0x600fd6,'userProfileId':_0x7d5638['userProfileId']},'raw':!![]})[_0x747e('0x20')](function(_0x338bdb){if(_0x338bdb&&_0x338bdb['autoAssociation']===0x0){return db[_0x747e('0x5e')]['create']({'name':_0x4ecfcb[_0x747e('0x4d')],'resourceId':_0x4ecfcb['id'],'type':_0x338bdb['name'],'sectionId':_0x338bdb['id']},{})[_0x747e('0x20')](function(){return _0x45f1a2;});}else{return _0x45f1a2;}})[_0x747e('0x2a')](function(_0x499ff8){logger[_0x747e('0x25')](_0x747e('0x5f'),_0x499ff8);throw _0x499ff8;});}return _0x45f1a2;})['then'](respondWithResult(_0x4ea400,0xc9))[_0x747e('0x2a')](handleError(_0x4ea400,null));};exports['update']=function(_0x28e7a0,_0x5e935e){if(_0x28e7a0[_0x747e('0x59')]['id']){delete _0x28e7a0[_0x747e('0x59')]['id'];}return db[_0x747e('0x4f')][_0x747e('0x57')]({'where':{'id':_0x28e7a0['params']['id']},'include':[{'model':db['Pause'],'as':_0x747e('0x3b')}]})[_0x747e('0x20')](handleEntityNotFound(_0x5e935e,null))[_0x747e('0x20')](saveUpdates(_0x28e7a0[_0x747e('0x59')],null))[_0x747e('0x20')](respondWithResult(_0x5e935e,null))['catch'](handleError(_0x5e935e,null));};exports[_0x747e('0x35')]=function(_0xba396c,_0x41d8e6){return db[_0x747e('0x4f')]['find']({'where':{'id':_0xba396c[_0x747e('0x53')]['id']}})[_0x747e('0x20')](handleEntityNotFound(_0x41d8e6,null))['then'](removeEntity(_0x41d8e6,null))[_0x747e('0x2a')](handleError(_0x41d8e6,null));};exports[_0x747e('0x60')]=function(_0x154235,_0x273803){return db['SmsAccount']['describe']()[_0x747e('0x20')](respondWithResult(_0x273803,null))[_0x747e('0x2a')](handleError(_0x273803,null));};exports[_0x747e('0x61')]=function(_0x1e8a7e,_0x1687f6,_0x43358e){if(_0x1e8a7e['body']['id']){delete _0x1e8a7e[_0x747e('0x59')]['id'];}return db[_0x747e('0x4f')][_0x747e('0x57')]({'where':{'id':_0x1e8a7e[_0x747e('0x53')]['id']}})[_0x747e('0x20')](handleEntityNotFound(_0x1687f6,null))['then'](function(_0x481693){if(_0x481693){_0x1e8a7e['body'][_0x747e('0x62')]=_0x481693['id'];return db[_0x747e('0x63')]['create'](_0x1e8a7e[_0x747e('0x59')]);}})['then'](respondWithResult(_0x1687f6,null))[_0x747e('0x2a')](handleError(_0x1687f6,null));};exports['getDispositions']=function(_0x579235,_0x1ab174,_0xba3cc1){var _0x2178f3={'raw':![],'where':{}};var _0xc3e075={};var _0x36e728={'count':0x0,'rows':[]};return db['SmsAccount'][_0x747e('0x64')]({'where':{'id':_0x579235[_0x747e('0x53')]['id']}})['then'](handleEntityNotFound(_0x1ab174,null))['then'](function(_0x1b9230){if(_0x1b9230){_0xc3e075[_0x747e('0x40')]=_[_0x747e('0x41')](db[_0x747e('0x63')][_0x747e('0x3d')]);_0xc3e075[_0x747e('0x43')]=_[_0x747e('0x41')](_0x579235[_0x747e('0x43')]);_0xc3e075[_0x747e('0x42')]=_[_0x747e('0x54')](_0xc3e075[_0x747e('0x40')],_0xc3e075[_0x747e('0x43')]);_0x2178f3[_0x747e('0x44')]=_[_0x747e('0x54')](_0xc3e075[_0x747e('0x40')],qs[_0x747e('0x45')](_0x579235[_0x747e('0x43')]['fields']));_0x2178f3[_0x747e('0x44')]=_0x2178f3[_0x747e('0x44')]['length']?_0x2178f3[_0x747e('0x44')]:_0xc3e075[_0x747e('0x40')];if(!_0x579235['query'][_0x747e('0x47')](_0x747e('0x65'))){_0x2178f3[_0x747e('0x31')]=qs[_0x747e('0x31')](_0x579235['query']['limit']);_0x2178f3[_0x747e('0x30')]=qs[_0x747e('0x30')](_0x579235[_0x747e('0x43')][_0x747e('0x30')]);}_0x2178f3[_0x747e('0x66')]=qs[_0x747e('0x48')](_0x579235[_0x747e('0x43')][_0x747e('0x48')]);_0x2178f3[_0x747e('0x49')]=qs[_0x747e('0x42')](_['pick'](_0x579235[_0x747e('0x43')],_0xc3e075['filters']));_0x2178f3['where'][_0x747e('0x62')]=_0x1b9230['id'];if(_0x579235['query'][_0x747e('0x4b')]){_0x2178f3['where']=_['merge'](_0x2178f3[_0x747e('0x49')],{'$or':_[_0x747e('0x3c')](_0x2178f3[_0x747e('0x44')],function(_0x329002){var _0x198397={};_0x198397[_0x329002]={'$like':'%'+_0x579235['query'][_0x747e('0x4b')]+'%'};return _0x198397;})});}_0x2178f3=_[_0x747e('0x4c')]({},_0x2178f3,_0x579235[_0x747e('0x4e')]);return db[_0x747e('0x63')][_0x747e('0x2f')]({'where':_0x2178f3[_0x747e('0x49')]})['then'](function(_0x2b1b73){_0x36e728[_0x747e('0x2f')]=_0x2b1b73;if(_0x579235['query'][_0x747e('0x55')]){_0x2178f3[_0x747e('0x56')]=[{'all':!![]}];}return db[_0x747e('0x63')][_0x747e('0x50')](_0x2178f3);})[_0x747e('0x20')](function(_0x5f17ef){_0x36e728['rows']=_0x5f17ef;return _0x36e728;});}})[_0x747e('0x20')](respondWithFilteredResult(_0x1ab174,_0x2178f3))['catch'](handleError(_0x1ab174,null));};exports[_0x747e('0x67')]=function(_0x1daea7,_0x1f460e,_0x28c0e1){return db[_0x747e('0x4f')][_0x747e('0x57')]({'where':{'id':_0x1daea7['params']['id']}})[_0x747e('0x20')](handleEntityNotFound(_0x1f460e,null))['then'](function(_0x4df9ff){if(_0x4df9ff){return _0x4df9ff[_0x747e('0x67')](_0x1daea7[_0x747e('0x43')][_0x747e('0x68')]);}})['then'](respondWithStatusCode(_0x1f460e,null))[_0x747e('0x2a')](handleError(_0x1f460e,null));};exports['addAnswer']=function(_0x37cae4,_0x1682bf,_0x2559ac){if(_0x37cae4[_0x747e('0x59')]['id']){delete _0x37cae4[_0x747e('0x59')]['id'];}return db['SmsAccount'][_0x747e('0x57')]({'where':{'id':_0x37cae4[_0x747e('0x53')]['id']}})[_0x747e('0x20')](handleEntityNotFound(_0x1682bf,null))[_0x747e('0x20')](function(_0x3f723d){if(_0x3f723d){_0x37cae4[_0x747e('0x59')][_0x747e('0x62')]=_0x3f723d['id'];return db[_0x747e('0x69')]['create'](_0x37cae4[_0x747e('0x59')]);}})[_0x747e('0x20')](respondWithResult(_0x1682bf,null))[_0x747e('0x2a')](handleError(_0x1682bf,null));};exports[_0x747e('0x6a')]=function(_0x576a56,_0xc2d15b,_0x20fff0){var _0x180870={'raw':![],'where':{}};var _0x3ca8eb={};var _0x1b0dcc={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x576a56['params']['id']}})[_0x747e('0x20')](handleEntityNotFound(_0xc2d15b,null))[_0x747e('0x20')](function(_0x4588c7){if(_0x4588c7){_0x3ca8eb[_0x747e('0x40')]=_[_0x747e('0x41')](db[_0x747e('0x69')]['rawAttributes']);_0x3ca8eb[_0x747e('0x43')]=_[_0x747e('0x41')](_0x576a56[_0x747e('0x43')]);_0x3ca8eb[_0x747e('0x42')]=_[_0x747e('0x54')](_0x3ca8eb['model'],_0x3ca8eb[_0x747e('0x43')]);_0x180870[_0x747e('0x44')]=_['intersection'](_0x3ca8eb[_0x747e('0x40')],qs[_0x747e('0x45')](_0x576a56[_0x747e('0x43')][_0x747e('0x45')]));_0x180870[_0x747e('0x44')]=_0x180870[_0x747e('0x44')][_0x747e('0x46')]?_0x180870['attributes']:_0x3ca8eb[_0x747e('0x40')];if(!_0x576a56['query']['hasOwnProperty']('nolimit')){_0x180870[_0x747e('0x31')]=qs[_0x747e('0x31')](_0x576a56['query'][_0x747e('0x31')]);_0x180870[_0x747e('0x30')]=qs[_0x747e('0x30')](_0x576a56['query'][_0x747e('0x30')]);}_0x180870['order']=qs[_0x747e('0x48')](_0x576a56[_0x747e('0x43')]['sort']);_0x180870['where']=qs[_0x747e('0x42')](_[_0x747e('0x4a')](_0x576a56[_0x747e('0x43')],_0x3ca8eb[_0x747e('0x42')]));_0x180870['where']['SmsAccountId']=_0x4588c7['id'];if(_0x576a56[_0x747e('0x43')][_0x747e('0x4b')]){_0x180870[_0x747e('0x49')]=_['merge'](_0x180870[_0x747e('0x49')],{'$or':_[_0x747e('0x3c')](_0x180870[_0x747e('0x44')],function(_0x4e5b7a){var _0x33615b={};_0x33615b[_0x4e5b7a]={'$like':'%'+_0x576a56['query']['filter']+'%'};return _0x33615b;})});}_0x180870=_[_0x747e('0x4c')]({},_0x180870,_0x576a56[_0x747e('0x4e')]);return db[_0x747e('0x69')][_0x747e('0x2f')]({'where':_0x180870[_0x747e('0x49')]})[_0x747e('0x20')](function(_0x17693f){_0x1b0dcc[_0x747e('0x2f')]=_0x17693f;if(_0x576a56[_0x747e('0x43')][_0x747e('0x55')]){_0x180870[_0x747e('0x56')]=[{'all':!![]}];}return db[_0x747e('0x69')][_0x747e('0x50')](_0x180870);})[_0x747e('0x20')](function(_0x25b2d2){_0x1b0dcc[_0x747e('0x51')]=_0x25b2d2;return _0x1b0dcc;});}})[_0x747e('0x20')](respondWithFilteredResult(_0xc2d15b,_0x180870))['catch'](handleError(_0xc2d15b,null));};exports[_0x747e('0x6b')]=function(_0x35013b,_0x2f1953,_0x24a460){return db['SmsAccount'][_0x747e('0x57')]({'where':{'id':_0x35013b[_0x747e('0x53')]['id']}})[_0x747e('0x20')](handleEntityNotFound(_0x2f1953,null))[_0x747e('0x20')](function(_0x1e200f){if(_0x1e200f){return _0x1e200f[_0x747e('0x6b')](_0x35013b[_0x747e('0x43')][_0x747e('0x68')]);}})[_0x747e('0x20')](respondWithStatusCode(_0x2f1953,null))['catch'](handleError(_0x2f1953,null));};exports['notify']=function(_0x8a4099,_0x15e9b0,_0x5b1d38){var _0x26421d={'channel':_0x747e('0x6c')};var _0x3e7903=[];var _0x3aab50=[];var _0x50b70d={};return db[_0x747e('0x4f')][_0x747e('0x57')]({'where':{'id':_0x8a4099['params']['id']},'include':[{'model':db[_0x747e('0x6d')],'as':'Applications'}]})[_0x747e('0x20')](handleEntityNotFound(_0x15e9b0,null))[_0x747e('0x20')](function(_0x1064a5){_0x26421d[_0x747e('0x6e')]=_0x1064a5;_0x26421d[_0x747e('0x6f')]=_[_0x747e('0x70')](_0x1064a5[_0x747e('0x71')],[_0x747e('0x72')],['asc']);if(_0x26421d[_0x747e('0x6e')][_0x747e('0x71')]){delete _0x26421d[_0x747e('0x6e')][_0x747e('0x71')];}return db[_0x747e('0x73')][_0x747e('0x60')]();})['then'](function(_0x1e3c67){if(!_0x1e3c67){throw new db[(_0x747e('0x74'))][(_0x747e('0x75'))]('no\x20available\x20attributes');}_0x3e7903=_['difference'](_['keys'](_0x1e3c67),[_0x747e('0x76'),_0x747e('0x77')]);_0x3aab50=_[_0x747e('0x78')](_[_0x747e('0x41')](_0x1e3c67),[_0x747e('0x76'),'updatedAt','CompanyId',_0x747e('0x79')]);_0x26421d[_0x747e('0x59')]={'mapKey':'mobile'};if(_0x26421d[_0x747e('0x6e')][_0x747e('0x3e')]){switch(_0x26421d[_0x747e('0x6e')][_0x747e('0x3e')]){case'twilio':_0x26421d['body'][_0x747e('0x7a')]=_0x8a4099['body']['From'];_0x26421d[_0x747e('0x59')][_0x747e('0x59')]=_0x8a4099['body']['Body'];_0x26421d[_0x747e('0x59')][_0x747e('0x7b')]=_0x8a4099[_0x747e('0x59')]['MessageSid'];break;case _0x747e('0x7c'):_0x26421d['body'][_0x747e('0x7a')]='+'+_0x8a4099[_0x747e('0x59')][_0x747e('0x7d')];_0x26421d[_0x747e('0x59')][_0x747e('0x59')]=_0x8a4099[_0x747e('0x59')][_0x747e('0x7e')];break;case _0x747e('0x7f'):_0x26421d['body'][_0x747e('0x7a')]=_0x8a4099[_0x747e('0x59')][_0x747e('0x7a')];_0x26421d[_0x747e('0x59')][_0x747e('0x59')]=_0x8a4099[_0x747e('0x59')][_0x747e('0x28')];break;case _0x747e('0x80'):_0x26421d['body'][_0x747e('0x7a')]=_0x8a4099[_0x747e('0x59')][_0x747e('0x7a')];_0x26421d[_0x747e('0x59')][_0x747e('0x59')]=_0x8a4099[_0x747e('0x59')][_0x747e('0x59')];_0x26421d[_0x747e('0x59')][_0x747e('0x7b')]=_0x8a4099['body'][_0x747e('0x81')];break;case _0x747e('0x82'):_0x26421d['body']['from']=_0x8a4099['body'][_0x747e('0x83')];_0x26421d['body'][_0x747e('0x59')]=_0x8a4099[_0x747e('0x59')][_0x747e('0x84')];_0x26421d[_0x747e('0x59')][_0x747e('0x7b')]=_0x8a4099[_0x747e('0x59')][_0x747e('0x85')];break;case _0x747e('0x86'):_0x26421d[_0x747e('0x59')][_0x747e('0x7a')]='+'+_0x8a4099[_0x747e('0x59')][_0x747e('0x87')][0x0]['from'];_0x26421d[_0x747e('0x59')][_0x747e('0x59')]=_0x8a4099[_0x747e('0x59')]['results'][0x0][_0x747e('0x7e')];_0x26421d[_0x747e('0x59')]['messageId']=_0x8a4099[_0x747e('0x59')][_0x747e('0x87')][0x0][_0x747e('0x7b')];break;case _0x747e('0x88'):_0x26421d['body'][_0x747e('0x7a')]=_0x8a4099['body']['originatingAddress'];_0x26421d[_0x747e('0x59')][_0x747e('0x59')]=_0x8a4099[_0x747e('0x59')][_0x747e('0x89')]['message'];break;case _0x747e('0x8a'):_0x26421d['body'][_0x747e('0x7a')]=_0x8a4099['body'][_0x747e('0x8b')];_0x26421d[_0x747e('0x59')][_0x747e('0x59')]=_0x8a4099[_0x747e('0x59')][_0x747e('0x7e')];_0x26421d[_0x747e('0x59')][_0x747e('0x7b')]=_0x8a4099[_0x747e('0x59')][_0x747e('0x8c')];break;case'bandwidth':_0x26421d[_0x747e('0x59')][_0x747e('0x7b')]=_0x8a4099[_0x747e('0x59')][0x0][_0x747e('0x28')]['id'];_0x26421d[_0x747e('0x59')]['from']=_0x8a4099['body'][0x0][_0x747e('0x28')][_0x747e('0x7a')];_0x26421d['body'][_0x747e('0x59')]=_0x8a4099['body'][0x0][_0x747e('0x28')][_0x747e('0x7e')];break;case'intelepeer':_0x26421d['body'][_0x747e('0x7a')]=_0x8a4099[_0x747e('0x59')][_0x747e('0x7a')];_0x26421d['body'][_0x747e('0x59')]=_0x8a4099[_0x747e('0x59')][_0x747e('0x28')];_0x26421d[_0x747e('0x59')][_0x747e('0x7b')]=_0x8a4099[_0x747e('0x59')]['refid'];break;}}if(_0x26421d[_0x747e('0x59')]['id']){delete _0x26421d[_0x747e('0x59')]['id'];}if(_['isNil'](_0x26421d[_0x747e('0x59')][_0x747e('0x7a')])){throw new db[(_0x747e('0x74'))]['ValidationError'](_0x747e('0x8d'));}if(_[_0x747e('0x8e')](_0x26421d[_0x747e('0x59')][_0x747e('0x59')])||_0x26421d[_0x747e('0x59')][_0x747e('0x59')]===''){throw new db[(_0x747e('0x74'))][(_0x747e('0x75'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x747e('0x8e')](_0x26421d[_0x747e('0x59')][_0x747e('0x8f')])){throw new db[(_0x747e('0x74'))][(_0x747e('0x75'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3aab50);}if(!_[_0x747e('0x90')](_0x3aab50,_0x26421d[_0x747e('0x59')][_0x747e('0x8f')])){throw new db['Sequelize'][(_0x747e('0x75'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3aab50);}_0x50b70d[_0x26421d[_0x747e('0x59')][_0x747e('0x8f')]]=_0x26421d[_0x747e('0x59')][_0x747e('0x7a')];return db[_0x747e('0x91')][_0x747e('0x57')]({'where':{'id':_0x26421d[_0x747e('0x6e')]['ListId']},'include':[{'model':db[_0x747e('0x73')],'as':_0x747e('0x92'),'where':_0x50b70d,'limit':0x1,'order':[[_0x747e('0x77'),_0x747e('0x93')]]}]});})[_0x747e('0x20')](handleEntityNotFound(_0x15e9b0,null))['then'](function(_0x4b48cd){if(_0x4b48cd){_0x26421d[_0x747e('0x94')]=_[_0x747e('0x95')](_0x4b48cd,[_0x747e('0x92')]);if(_0x4b48cd[_0x747e('0x92')]['length']){return _0x4b48cd[_0x747e('0x92')][0x0];}var _0x418ac8=_[_0x747e('0x18')](_0x26421d[_0x747e('0x59')],{'firstName':_0x26421d['body'][_0x747e('0x7a')],'ListId':_0x4b48cd['id']});_0x418ac8[_0x26421d[_0x747e('0x59')]['mapKey']]=_0x26421d[_0x747e('0x59')][_0x747e('0x7a')];return db['CmContact'][_0x747e('0x58')](_0x418ac8,{'fields':_0x3e7903,'raw':!![]});}})[_0x747e('0x20')](handleEntityNotFound(_0x15e9b0,null))[_0x747e('0x20')](function(_0x291b96){if(_0x291b96){_0x26421d[_0x747e('0x96')]=_0x291b96;var _0x4336ce={'ContactId':_0x291b96['id'],'phone':_0x26421d[_0x747e('0x59')][_0x747e('0x7a')],'SmsAccountId':_0x8a4099['params']['id']};var _0x15762c={'ContactId':_0x291b96['id'],'SmsAccountId':_0x8a4099[_0x747e('0x53')]['id'],'closed':![]};return db[_0x747e('0x97')]['find']({'where':_0x15762c})[_0x747e('0x20')](function(_0x2e120d){if(_0x2e120d){return[_0x2e120d,![]];}return db[_0x747e('0x97')][_0x747e('0x58')](_0x4336ce)['then'](function(_0x234f07){return[_0x234f07,!![]];});});}})['spread'](function(_0x23c753,_0x1fa2ab){_0x26421d['interaction']=_0x23c753[_0x747e('0x36')]({'plain':!![]});_0x26421d['interaction']['created']=![];if(_0x1fa2ab){if(_0x26421d[_0x747e('0x6e')][_0x747e('0x98')]){_0x26421d[_0x747e('0x6f')]['push']({'id':0x0,'priority':_0x26421d[_0x747e('0x6f')][_0x747e('0x46')]+0x1,'app':_0x747e('0x99'),'appdata':_0x747e('0x9a'),'interval':_0x747e('0x9b')});}_0x26421d['interaction'][_0x747e('0x9c')]=!![];}return db[_0x747e('0x9d')][_0x747e('0x58')]({'phone':_0x26421d[_0x747e('0x59')]['from'],'messageId':_0x26421d[_0x747e('0x59')]['messageId'],'body':_0x26421d[_0x747e('0x59')][_0x747e('0x59')],'SmsAccountId':_0x8a4099['params']['id'],'SmsInteractionId':_0x23c753['id'],'direction':'in','ContactId':_0x23c753[_0x747e('0x9e')],'AttachmentId':_0x26421d['body'][_0x747e('0x9f')]});})[_0x747e('0x20')](function(_0x24ad6f){_0x26421d['message']=_0x24ad6f;if(_0x26421d[_0x747e('0xa0')][_0x747e('0xa1')]){return db['User'][_0x747e('0x57')]({'attributes':['id','name'],'where':{'id':_0x26421d[_0x747e('0xa0')][_0x747e('0xa1')]}})['then'](function(_0x298e32){if(_0x298e32){_0x26421d[_0x747e('0x6f')][_0x747e('0xa2')]({'id':0x0,'priority':0x0,'app':_0x747e('0xa3'),'appdata':_0x298e32[_0x747e('0x4d')]+','+(_0x26421d[_0x747e('0x6e')][_0x747e('0xa4')]||0xa),'interval':_0x747e('0x9b')});}return respondWithRpcPromise('Start',_0x747e('0xa5'),_0x26421d);});}return respondWithRpcPromise(_0x747e('0xa6'),'startRouting',_0x26421d);})[_0x747e('0x20')](function(_0x4327d5){if(_0x4327d5){var _0x265116=0xc8;var _0x7cd8ba=_0x747e('0xa7');logger[_0x747e('0x21')](_0x747e('0x23'),_0x7cd8ba,_0x265116,_0x747e('0xa8'));logger[_0x747e('0xa9')](_0x747e('0xaa'),_0x7cd8ba,_0x265116,_0x747e('0xa8'),JSON['stringify'](_0x4327d5));if(_0x26421d[_0x747e('0x6e')]['type']===_0x747e('0xab')){return _0x15e9b0[_0x747e('0x2c')](_0x265116)[_0x747e('0x32')](_0x747e('0xac'),_0x747e('0xad'))[_0x747e('0x38')](_0x747e('0xae'));}else{return _0x15e9b0[_0x747e('0x2c')](_0x265116)['json'](_0x4327d5);}}})[_0x747e('0x2a')](handleError(_0x15e9b0,null));};exports[_0x747e('0xaf')]=function(_0x454f6f,_0x4220aa,_0x5ea440){return db['SmsAccount'][_0x747e('0x64')]({'where':{'id':_0x454f6f[_0x747e('0x53')]['id']}})[_0x747e('0x20')](handleEntityNotFound(_0x4220aa,null))[_0x747e('0x20')](function(_0x46a369){if(_0x46a369){return db[_0x747e('0xb0')][_0x747e('0xb1')](function(_0x53b519){return db[_0x747e('0x6d')][_0x747e('0x35')]({'where':{'SmsAccountId':_0x454f6f[_0x747e('0x53')]['id']},'transaction':_0x53b519})[_0x747e('0x20')](function(_0x14aeed){var _0x827c36=_[_0x747e('0x3c')](_0x454f6f['body'],function(_0xd9a060){_0xd9a060[_0x747e('0x62')]=_0x454f6f[_0x747e('0x53')]['id'];return _0xd9a060;});return db['SmsApplication'][_0x747e('0xb2')](_0x827c36,{'transaction':_0x53b519});});})[_0x747e('0x20')](function(){return db['SmsApplication'][_0x747e('0xb3')]({'where':{'SmsAccountId':_0x454f6f[_0x747e('0x53')]['id']},'order':'priority'});});}})[_0x747e('0x20')](respondWithResult(_0x4220aa,null))[_0x747e('0x2a')](handleError(_0x4220aa,null));};exports[_0x747e('0xb4')]=function(_0x38dcac,_0x16c5e8,_0x309b14){var _0x3dc020={};var _0x169966={};var _0x5bc8a7;var _0x5e1138;return db[_0x747e('0x4f')][_0x747e('0x64')]({'where':{'id':_0x38dcac[_0x747e('0x53')]['id']}})[_0x747e('0x20')](handleEntityNotFound(_0x16c5e8,null))[_0x747e('0x20')](function(_0x2f9f96){if(_0x2f9f96){_0x5bc8a7=_0x2f9f96;_0x169966['model']=_[_0x747e('0x41')](db[_0x747e('0x6d')][_0x747e('0x3d')]);_0x169966['query']=_[_0x747e('0x41')](_0x38dcac[_0x747e('0x43')]);_0x169966[_0x747e('0x42')]=_[_0x747e('0x54')](_0x169966[_0x747e('0x40')],_0x169966[_0x747e('0x43')]);_0x3dc020['attributes']=_[_0x747e('0x54')](_0x169966[_0x747e('0x40')],qs[_0x747e('0x45')](_0x38dcac[_0x747e('0x43')][_0x747e('0x45')]));_0x3dc020[_0x747e('0x44')]=_0x3dc020[_0x747e('0x44')][_0x747e('0x46')]?_0x3dc020[_0x747e('0x44')]:_0x169966[_0x747e('0x40')];_0x3dc020[_0x747e('0x66')]=qs[_0x747e('0x48')](_0x38dcac[_0x747e('0x43')]['sort']);_0x3dc020[_0x747e('0x49')]=qs['filters'](_[_0x747e('0x4a')](_0x38dcac['query'],_0x169966['filters']));if(_0x38dcac[_0x747e('0x43')][_0x747e('0x4b')]){_0x3dc020[_0x747e('0x49')]=_['merge'](_0x3dc020[_0x747e('0x49')],{'$or':_['map'](_0x3dc020[_0x747e('0x44')],function(_0x564895){var _0x1cbf61={};_0x1cbf61[_0x564895]={'$like':'%'+_0x38dcac[_0x747e('0x43')][_0x747e('0x4b')]+'%'};return _0x1cbf61;})});}_0x3dc020=_[_0x747e('0x4c')]({},_0x3dc020,_0x38dcac[_0x747e('0x4e')]);return _0x5bc8a7[_0x747e('0xb4')](_0x3dc020);}})[_0x747e('0x20')](function(_0x3550d3){if(_0x3550d3){_0x5e1138=_0x3550d3[_0x747e('0x46')];if(!_0x38dcac[_0x747e('0x43')][_0x747e('0x47')](_0x747e('0x65'))){_0x3dc020[_0x747e('0x31')]=qs['limit'](_0x38dcac[_0x747e('0x43')][_0x747e('0x31')]);_0x3dc020[_0x747e('0x30')]=qs[_0x747e('0x30')](_0x38dcac[_0x747e('0x43')]['offset']);}return _0x5bc8a7[_0x747e('0xb4')](_0x3dc020);}})[_0x747e('0x20')](function(_0x12535d){if(_0x12535d){return _0x12535d?{'count':_0x5e1138,'rows':_0x12535d}:null;}})[_0x747e('0x20')](respondWithResult(_0x16c5e8,null))['catch'](handleError(_0x16c5e8,null));};exports[_0x747e('0xb5')]=function(_0x53d1c2,_0x52fbc9,_0x3a38b9){var _0x740d79={'raw':![],'where':{}};var _0x2a5ad1={};var _0x10b205={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x53d1c2[_0x747e('0x53')]['id']}})[_0x747e('0x20')](handleEntityNotFound(_0x52fbc9,null))[_0x747e('0x20')](function(_0x41689f){if(_0x41689f){_0x2a5ad1[_0x747e('0x40')]=_[_0x747e('0x41')](db[_0x747e('0x97')]['rawAttributes']);_0x2a5ad1[_0x747e('0x43')]=_['keys'](_0x53d1c2[_0x747e('0x43')]);_0x2a5ad1['filters']=_[_0x747e('0x54')](_0x2a5ad1[_0x747e('0x40')],_0x2a5ad1['query']);_0x740d79[_0x747e('0x44')]=_[_0x747e('0x54')](_0x2a5ad1[_0x747e('0x40')],qs[_0x747e('0x45')](_0x53d1c2[_0x747e('0x43')][_0x747e('0x45')]));_0x740d79[_0x747e('0x44')]=_0x740d79[_0x747e('0x44')][_0x747e('0x46')]?_0x740d79[_0x747e('0x44')]:_0x2a5ad1[_0x747e('0x40')];if(!_0x53d1c2[_0x747e('0x43')][_0x747e('0x47')](_0x747e('0x65'))){_0x740d79['limit']=qs[_0x747e('0x31')](_0x53d1c2[_0x747e('0x43')]['limit']);_0x740d79[_0x747e('0x30')]=qs[_0x747e('0x30')](_0x53d1c2['query'][_0x747e('0x30')]);}_0x740d79[_0x747e('0x66')]=qs[_0x747e('0x48')](_0x53d1c2['query']['sort']);_0x740d79['where']=qs[_0x747e('0x42')](_[_0x747e('0x4a')](_0x53d1c2[_0x747e('0x43')],_0x2a5ad1['filters']));_0x740d79[_0x747e('0x49')][_0x747e('0x62')]=_0x41689f['id'];if(_0x53d1c2[_0x747e('0x43')]['filter']){_0x740d79[_0x747e('0x49')]=_[_0x747e('0x4c')](_0x740d79[_0x747e('0x49')],{'$or':_[_0x747e('0x3c')](_0x740d79[_0x747e('0x44')],function(_0x41f317){var _0x29d4fb={};_0x29d4fb[_0x41f317]={'$like':'%'+_0x53d1c2[_0x747e('0x43')][_0x747e('0x4b')]+'%'};return _0x29d4fb;})});}_0x740d79=_[_0x747e('0x4c')]({},_0x740d79,_0x53d1c2[_0x747e('0x4e')]);return db['SmsInteraction'][_0x747e('0x2f')]({'where':_0x740d79[_0x747e('0x49')]})[_0x747e('0x20')](function(_0x6924b3){_0x10b205[_0x747e('0x2f')]=_0x6924b3;if(_0x53d1c2[_0x747e('0x43')][_0x747e('0x55')]){_0x740d79[_0x747e('0x56')]=[{'model':db[_0x747e('0x73')],'as':_0x747e('0xb6'),'required':![]},{'model':db[_0x747e('0xb7')],'as':'Owner','attributes':['name','fullname',_0x747e('0xb8')],'required':![]},{'model':db[_0x747e('0xb9')],'as':_0x747e('0xba'),'attributes':['id','name',_0x747e('0xbb')],'where':_0x53d1c2[_0x747e('0x43')][_0x747e('0xbc')]?{'id':_0x53d1c2[_0x747e('0x43')][_0x747e('0xbc')]}:undefined,'required':_0x53d1c2[_0x747e('0x43')][_0x747e('0xbc')]?!![]:![]}];}return db[_0x747e('0x97')]['findAll'](_0x740d79);})[_0x747e('0x20')](function(_0x53f0a6){_0x10b205[_0x747e('0x51')]=_0x53f0a6;return _0x10b205;});}})['then'](respondWithFilteredResult(_0x52fbc9,_0x740d79))[_0x747e('0x2a')](handleError(_0x52fbc9,null));};exports[_0x747e('0x38')]=function(_0x485ddc,_0x641647,_0x41f4ba){var _0x50e7d4,_0x47d843,_0x31e6b2;if(_[_0x747e('0x8e')](_0x485ddc[_0x747e('0x59')][_0x747e('0x59')])||_0x485ddc['body'][_0x747e('0x59')]===''){throw new db[(_0x747e('0x74'))][(_0x747e('0x75'))](_0x747e('0xbd'));}if(_['isNil'](_0x485ddc[_0x747e('0x59')]['to'])){throw new db['Sequelize'][(_0x747e('0x75'))](_0x747e('0xbe'));}_0x50e7d4=_0x485ddc[_0x747e('0x59')]['to'];return db[_0x747e('0x4f')][_0x747e('0x57')]({'where':{'id':_0x485ddc['params']['id']},'include':[{'model':db[_0x747e('0x91')],'as':_0x747e('0xbf'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x50e7d4},'limit':0x1,'order':[[_0x747e('0x77'),'DESC']]}]}]})[_0x747e('0x20')](handleEntityNotFound(_0x641647,null))[_0x747e('0x20')](function(_0x193b42){if(_0x193b42&&_0x193b42[_0x747e('0xbf')]){_0x47d843=_0x193b42['get']({'plain':!![]});if(_0x47d843[_0x747e('0xbf')]&&_0x47d843['List']['Contacts']['length']){return _0x47d843[_0x747e('0xbf')]['Contacts'][0x0];}return db['CmContact'][_0x747e('0x58')](_[_0x747e('0x18')](_0x485ddc[_0x747e('0x59')],{'firstName':_0x50e7d4,'mobile':_0x50e7d4,'phone':_0x50e7d4,'ListId':_0x47d843[_0x747e('0x79')]}));}})[_0x747e('0x20')](handleEntityNotFound(_0x641647,null))['then'](function(_0x278f65){if(_0x278f65){_0x31e6b2=_0x278f65;return db[_0x747e('0x97')][_0x747e('0x57')]({'where':{'ContactId':_0x31e6b2['id'],'closed':![],'SmsAccountId':_0x47d843['id']}})['then'](function(_0x1a08f3){if(_0x1a08f3){return[_0x1a08f3,![]];}return db[_0x747e('0x97')]['create']({'UserId':_0x485ddc[_0x747e('0x5a')]['id'],'ContactId':_0x31e6b2['id'],'SmsAccountId':_0x47d843['id'],'phone':_0x50e7d4,'firstMsgDirection':_0x747e('0xc0'),'Messages':[_[_0x747e('0x4c')](_0x485ddc[_0x747e('0x59')],{'read':![],'body':_0x485ddc[_0x747e('0x59')][_0x747e('0x59')],'phone':_0x50e7d4,'SmsAccountId':_0x47d843['id'],'UserId':_0x485ddc[_0x747e('0x5a')]['id'],'ContactId':_0x31e6b2['id']})]},{'include':[{'model':db[_0x747e('0x9d')],'as':'Messages'}]})[_0x747e('0x20')](function(_0x4a000c){return[_0x4a000c,!![]];});});}})['spread'](function(_0x59b680,_0x4829c7){if(_0x4829c7){return _0x59b680;}return db[_0x747e('0x9d')]['create'](_[_0x747e('0x4c')](_0x485ddc[_0x747e('0x59')],{'read':![],'body':_0x485ddc[_0x747e('0x59')]['body'],'phone':_0x50e7d4,'SmsAccountId':_0x47d843['id'],'SmsInteractionId':_0x59b680['id'],'UserId':_0x485ddc[_0x747e('0x5a')]['id'],'ContactId':_0x31e6b2['id']}))[_0x747e('0x20')](function(_0x1420d5){_0x59b680['dataValues']['Messages']=[];_0x59b680[_0x747e('0xc1')][_0x747e('0xc2')][_0x747e('0xc3')](_0x1420d5[_0x747e('0xc1')]);return _0x59b680;});})['then'](respondWithResult(_0x641647,null))[_0x747e('0x2a')](handleError(_0x641647,null));};exports[_0x747e('0x2c')]=function(_0x42f82f,_0x3ce855,_0x14142a){if(_0x42f82f['body']['id']){delete _0x42f82f['body']['id'];}var _0x316613,_0x3ca9d6,_0x5ed769;return db[_0x747e('0x4f')][_0x747e('0x57')]({'where':{'id':_0x42f82f[_0x747e('0x53')]['id']}})[_0x747e('0x20')](handleEntityNotFound(_0x3ce855,null))[_0x747e('0x20')](function(_0x2bacd5){if(_0x2bacd5){_0x5ed769=_0x2bacd5;logger[_0x747e('0xa9')](_0x747e('0x23'),_0x747e('0x2c'),_0x747e('0xc4'),_0x2bacd5[_0x747e('0x3e')],util[_0x747e('0xc5')](_0x42f82f[_0x747e('0x59')],{'showHidden':![],'depth':null}));switch(_0x2bacd5[_0x747e('0x3e')]){case _0x747e('0x7c'):if(_0x42f82f[_0x747e('0x59')][_0x747e('0xc6')]&&_0x42f82f[_0x747e('0x59')][_0x747e('0x2c')]){_0x3ca9d6=_0x42f82f[_0x747e('0x59')]['status'];return db[_0x747e('0x9d')][_0x747e('0x57')]({'where':{'messageId':_0x42f82f['body']['skebby_dispatch_id']}});}break;case _0x747e('0x7f'):if(_0x42f82f[_0x747e('0x59')][_0x747e('0xc7')]&&_0x42f82f[_0x747e('0x59')]['statusInt']){_0x3ca9d6=_0x42f82f[_0x747e('0x59')]['statusInt'];return db[_0x747e('0x9d')][_0x747e('0x57')]({'where':{'messageId':_0x42f82f[_0x747e('0x59')][_0x747e('0xc7')]}});}break;case _0x747e('0x80'):if(_0x42f82f[_0x747e('0x59')][_0x747e('0x81')]&&_0x42f82f[_0x747e('0x59')][_0x747e('0xc8')]){_0x3ca9d6=_0x42f82f['body'][_0x747e('0xc8')];return db[_0x747e('0x9d')][_0x747e('0x57')]({'where':{'messageId':_0x42f82f[_0x747e('0x59')][_0x747e('0x81')]}});}break;case _0x747e('0x86'):var _0x1e0a47=_0x42f82f[_0x747e('0x59')][_0x747e('0x87')][0x0];if(_0x1e0a47[_0x747e('0x7b')]&&_0x1e0a47['status'][_0x747e('0xc9')]==='DELIVERED'){_0x3ca9d6=_0x1e0a47['status'][_0x747e('0xc9')];return db['SmsMessage']['find']({'where':{'messageId':_0x1e0a47[_0x747e('0x7b')]}});}break;case _0x747e('0x8a'):if(_0x42f82f['body'][_0x747e('0x7b')]&&_0x42f82f[_0x747e('0x59')][_0x747e('0x2c')]){_0x3ca9d6=_0x42f82f[_0x747e('0x59')]['status'];return db['SmsMessage'][_0x747e('0x57')]({'where':{'messageId':_0x42f82f[_0x747e('0x59')][_0x747e('0x7b')]}});}break;case _0x747e('0xca'):if(_0x42f82f[_0x747e('0x59')][0x0][_0x747e('0x28')]['id']){_0x3ca9d6=_0x42f82f['body'][0x0][_0x747e('0x3e')];return db[_0x747e('0x9d')][_0x747e('0x57')]({'where':{'messageId':_0x42f82f['body'][0x0]['message']['id']}});}break;case'intelepeer':if(_0x42f82f[_0x747e('0x59')][_0x747e('0xcb')]&&_0x42f82f[_0x747e('0x59')][_0x747e('0x2c')]){_0x3ca9d6=_0x42f82f[_0x747e('0x59')][_0x747e('0x2c')];return db['SmsMessage'][_0x747e('0x57')]({'where':{'messageId':_0x42f82f[_0x747e('0x59')]['redif']}});}break;}}})[_0x747e('0x20')](handleEntityNotFound(_0x3ce855,null))[_0x747e('0x20')](function(_0x5eca70){if(_0x5eca70){_0x316613=_0x5eca70;switch(_0x5ed769[_0x747e('0x3e')]){case _0x747e('0x7c'):if(_0x3ca9d6===_0x747e('0xcc')){return _0x316613[_0x747e('0x34')]({'read':!![]});}else{logger[_0x747e('0x25')](_0x747e('0x23'),_0x747e('0x2c'),_0x747e('0x7c'),util[_0x747e('0xc5')](_0x42f82f[_0x747e('0x59')],{'showHidden':![],'depth':null}));}break;case _0x747e('0x7f'):if(_0x3ca9d6==='1'){return _0x316613[_0x747e('0x34')]({'read':!![]});}else{logger['error'](_0x747e('0x23'),'status',_0x747e('0x7c'),util[_0x747e('0xc5')](_0x42f82f[_0x747e('0x59')],{'showHidden':![],'depth':null}));}break;case _0x747e('0x80'):if(!_0x42f82f['body'][_0x747e('0xcd')]&&_0x3ca9d6>=0xc8&&_0x3ca9d6<=0xce){return _0x316613['update']({'read':!![]});}else{logger[_0x747e('0x25')](_0x747e('0x23'),_0x747e('0x2c'),_0x747e('0x80'),util[_0x747e('0xc5')](_0x42f82f[_0x747e('0x59')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x34c65e=_0x42f82f[_0x747e('0x59')][_0x747e('0x87')][0x0];if(_0x34c65e[_0x747e('0x2c')][_0x747e('0xc9')]===_0x747e('0xcc')){return _0x316613['update']({'read':!![]});}else{logger['error'](_0x747e('0x23'),_0x747e('0x2c'),_0x747e('0x86'),util[_0x747e('0xc5')](_0x42f82f[_0x747e('0x59')],{'showHidden':![],'depth':null}));}break;case _0x747e('0x8a'):if(_0x3ca9d6==_0x747e('0xce')||_0x3ca9d6==_0x747e('0xcf')){return _0x316613[_0x747e('0x34')]({'read':!![]});}else{logger[_0x747e('0x25')](_0x747e('0x23'),_0x747e('0x2c'),_0x747e('0x8a'),util[_0x747e('0xc5')](_0x42f82f[_0x747e('0x59')],{'showHidden':![],'depth':null}));}break;case _0x747e('0xca'):if(_0x3ca9d6==_0x747e('0xd0')){return _0x316613[_0x747e('0x34')]({'read':!![]});}else{logger[_0x747e('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x747e('0x2c'),_0x747e('0xca'),util['inspect'](_0x42f82f[_0x747e('0x59')],{'showHidden':![],'depth':null}));}break;case _0x747e('0xd1'):if(_0x3ca9d6==='DELIVRD'||_0x3ca9d6===_0x747e('0xd2')){return _0x316613['update']({'read':!![]});}else{logger[_0x747e('0x25')](_0x747e('0x23'),_0x747e('0x2c'),_0x747e('0xd1'),util[_0x747e('0xc5')](_0x42f82f[_0x747e('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x316613;}})[_0x747e('0x20')](respondWithResult(_0x3ce855,null))[_0x747e('0x2a')](handleError(_0x3ce855,null));};exports[_0x747e('0xd3')]=function(_0x5d43a5,_0x233fbf,_0x182427){var _0x5b8c4f,_0x2a520c,_0x561645;return db[_0x747e('0x4f')][_0x747e('0x57')]({'where':{'id':_0x5d43a5[_0x747e('0x53')]['id']}})['then'](handleEntityNotFound(_0x233fbf,null))[_0x747e('0x20')](function(_0x3e2c56){if(_0x3e2c56){_0x561645=_0x3e2c56;logger['debug'](_0x747e('0x23'),'status',_0x747e('0xc4'),_0x3e2c56['type'],util[_0x747e('0xc5')](_0x5d43a5['query'],{'showHidden':![],'depth':null}));switch(_0x3e2c56[_0x747e('0x3e')]){case _0x747e('0x88'):if(_0x5d43a5[_0x747e('0x43')]['message-id']&&_0x5d43a5[_0x747e('0x43')][_0x747e('0xd4')]){_0x2a520c=_0x5d43a5[_0x747e('0x43')][_0x747e('0xd4')];return db[_0x747e('0x9d')][_0x747e('0x57')]({'where':{'messageId':_0x5d43a5[_0x747e('0x43')]['message-id']}});}break;}}})['then'](handleEntityNotFound(_0x233fbf,null))[_0x747e('0x20')](function(_0x1a742c){if(_0x1a742c){_0x5b8c4f=_0x1a742c;switch(_0x561645[_0x747e('0x3e')]){case _0x747e('0x88'):if(_0x2a520c==='2'||_0x2a520c==='6'){return _0x5b8c4f[_0x747e('0x34')]({'read':!![]});}else{logger[_0x747e('0x25')](_0x747e('0x23'),_0x747e('0x2c'),_0x747e('0x88'),util[_0x747e('0xc5')](_0x5d43a5[_0x747e('0x43')],{'showHidden':![],'depth':null}));};break;}return _0x5b8c4f;}})[_0x747e('0x20')](respondWithResult(_0x233fbf,null))['catch'](handleError(_0x233fbf,null));};exports[_0x747e('0xd5')]=function(_0x559e70,_0x3b37bd,_0x39155a){return db[_0x747e('0x4f')][_0x747e('0x57')]({'where':{'id':_0x559e70[_0x747e('0x53')]['id']}})['then'](handleEntityNotFound(_0x3b37bd,null))['then'](function(_0x2b2630){if(_0x2b2630){return _0x2b2630[_0x747e('0xd5')](_0x559e70[_0x747e('0x59')]['ids'],_[_0x747e('0x95')](_0x559e70['body'],[_0x747e('0x68'),'id'])||{})[_0x747e('0xd6')](function(_0x4e2bd4){for(var _0x2517fe=0x0;_0x2517fe<_0x559e70[_0x747e('0x59')][_0x747e('0x68')][_0x747e('0x46')];_0x2517fe+=0x1){socket['emit'](_0x747e('0xd7'),{'UserId':Number(_0x559e70[_0x747e('0x59')]['ids'][_0x2517fe]),'SmsAccountId':Number(_0x559e70['params']['id'])});}return _0x4e2bd4;});}})[_0x747e('0x20')](respondWithResult(_0x3b37bd,null))[_0x747e('0x2a')](handleError(_0x3b37bd,null));};exports[_0x747e('0xd8')]=function(_0x592af5,_0x3f6dcb,_0x1baaf7){return db[_0x747e('0x4f')]['find']({'where':{'id':_0x592af5['params']['id']}})[_0x747e('0x20')](handleEntityNotFound(_0x3f6dcb,null))['then'](function(_0x4ba459){if(_0x4ba459){return _0x4ba459[_0x747e('0xd8')](_0x592af5[_0x747e('0x43')][_0x747e('0x68')])['then'](function(){if(_['isArray'](_0x592af5[_0x747e('0x43')][_0x747e('0x68')])){for(var _0x5666e8=0x0;_0x5666e8<_0x592af5[_0x747e('0x43')][_0x747e('0x68')][_0x747e('0x46')];_0x5666e8+=0x1){socket['emit'](_0x747e('0xd9'),{'UserId':Number(_0x592af5[_0x747e('0x43')][_0x747e('0x68')][_0x5666e8]),'SmsAccountId':Number(_0x592af5[_0x747e('0x53')]['id'])});}}else{socket[_0x747e('0xda')](_0x747e('0xd9'),{'UserId':Number(_0x592af5[_0x747e('0x43')][_0x747e('0x68')]),'SmsAccountId':Number(_0x592af5[_0x747e('0x53')]['id'])});}});}})[_0x747e('0x20')](respondWithStatusCode(_0x3f6dcb,null))[_0x747e('0x2a')](handleError(_0x3f6dcb,null));};exports[_0x747e('0xdb')]=function(_0x47304f,_0x41b4a8,_0x5b15c9){var _0x5a7598={};var _0x396eb5={};var _0x5e9a0c;var _0x4a6843;return db[_0x747e('0x4f')][_0x747e('0x64')]({'where':{'id':_0x47304f[_0x747e('0x53')]['id']}})[_0x747e('0x20')](handleEntityNotFound(_0x41b4a8,null))[_0x747e('0x20')](function(_0x5d55f1){if(_0x5d55f1){_0x5e9a0c=_0x5d55f1;_0x396eb5[_0x747e('0x40')]=_[_0x747e('0x41')](db[_0x747e('0xb7')]['rawAttributes']);_0x396eb5[_0x747e('0x43')]=_[_0x747e('0x41')](_0x47304f[_0x747e('0x43')]);_0x396eb5['filters']=_[_0x747e('0x54')](_0x396eb5[_0x747e('0x40')],_0x396eb5['query']);_0x5a7598['attributes']=_['intersection'](_0x396eb5[_0x747e('0x40')],qs[_0x747e('0x45')](_0x47304f[_0x747e('0x43')][_0x747e('0x45')]));_0x5a7598[_0x747e('0x44')]=_0x5a7598['attributes']['length']?_0x5a7598[_0x747e('0x44')]:_0x396eb5['model'];_0x5a7598[_0x747e('0x66')]=qs[_0x747e('0x48')](_0x47304f[_0x747e('0x43')][_0x747e('0x48')]);_0x5a7598[_0x747e('0x49')]=qs[_0x747e('0x42')](_[_0x747e('0x4a')](_0x47304f[_0x747e('0x43')],_0x396eb5[_0x747e('0x42')]));if(_0x47304f['query'][_0x747e('0x4b')]){_0x5a7598[_0x747e('0x49')]=_[_0x747e('0x4c')](_0x5a7598[_0x747e('0x49')],{'$or':_['map'](_0x5a7598['attributes'],function(_0x331dc4){var _0x3b3566={};_0x3b3566[_0x331dc4]={'$like':'%'+_0x47304f[_0x747e('0x43')][_0x747e('0x4b')]+'%'};return _0x3b3566;})});}_0x5a7598=_[_0x747e('0x4c')]({},_0x5a7598,_0x47304f[_0x747e('0x4e')]);return _0x5e9a0c['getAgents'](_0x5a7598);}})[_0x747e('0x20')](function(_0x446911){if(_0x446911){_0x4a6843=_0x446911[_0x747e('0x46')];if(!_0x47304f[_0x747e('0x43')][_0x747e('0x47')](_0x747e('0x65'))){_0x5a7598[_0x747e('0x31')]=qs[_0x747e('0x31')](_0x47304f[_0x747e('0x43')][_0x747e('0x31')]);_0x5a7598[_0x747e('0x30')]=qs['offset'](_0x47304f[_0x747e('0x43')]['offset']);}return _0x5e9a0c[_0x747e('0xdb')](_0x5a7598);}})[_0x747e('0x20')](function(_0x3406bd){if(_0x3406bd){return _0x3406bd?{'count':_0x4a6843,'rows':_0x3406bd}:null;}})[_0x747e('0x20')](respondWithResult(_0x41b4a8,null))[_0x747e('0x2a')](handleError(_0x41b4a8,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index dd1286d..1ddaff4 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 _0x701b=['emit','hasOwnProperty','hook','exports','events','SmsAccount','setMaxListeners','save'];(function(_0x266e24,_0x1c7258){var _0x747968=function(_0x1aa0c4){while(--_0x1aa0c4){_0x266e24['push'](_0x266e24['shift']());}};_0x747968(++_0x1c7258);}(_0x701b,0x154));var _0xb701=function(_0x35fa39,_0x2ae286){_0x35fa39=_0x35fa39-0x0;var _0x2059e5=_0x701b[_0x35fa39];return _0x2059e5;};'use strict';var EventEmitter=require(_0xb701('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0xb701('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xb701('0x2')](0x0);var events={'afterCreate':_0xb701('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xd8c10e){return function(_0x32087f,_0x5424cd,_0x289653){SmsAccountEvents[_0xb701('0x4')](_0xd8c10e+':'+_0x32087f['id'],_0x32087f);SmsAccountEvents[_0xb701('0x4')](_0xd8c10e,_0x32087f);_0x289653(null);};}for(var e in events){if(events[_0xb701('0x5')](e)){var event=events[e];SmsAccount[_0xb701('0x6')](e,emitEvent(event));}}module[_0xb701('0x7')]=SmsAccountEvents; \ No newline at end of file +var _0x0f95=['emit','hasOwnProperty','hook','events','../../mysqldb','SmsAccount','setMaxListeners','save','update','remove'];(function(_0x413384,_0x43080b){var _0x2415c=function(_0x2c1705){while(--_0x2c1705){_0x413384['push'](_0x413384['shift']());}};_0x2415c(++_0x43080b);}(_0x0f95,0x139));var _0x50f9=function(_0x79b649,_0x2115b3){_0x79b649=_0x79b649-0x0;var _0x1af9b1=_0x0f95[_0x79b649];return _0x1af9b1;};'use strict';var EventEmitter=require(_0x50f9('0x0'));var SmsAccount=require(_0x50f9('0x1'))['db'][_0x50f9('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x50f9('0x3')](0x0);var events={'afterCreate':_0x50f9('0x4'),'afterUpdate':_0x50f9('0x5'),'afterDestroy':_0x50f9('0x6')};function emitEvent(_0x1fb259){return function(_0x12e8ff,_0x2ebc45,_0x169cc4){SmsAccountEvents[_0x50f9('0x7')](_0x1fb259+':'+_0x12e8ff['id'],_0x12e8ff);SmsAccountEvents[_0x50f9('0x7')](_0x1fb259,_0x12e8ff);_0x169cc4(null);};}for(var e in events){if(events[_0x50f9('0x8')](e)){var event=events[e];SmsAccount[_0x50f9('0x9')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 7ffbf05..ecb72ed 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 _0xf789=['request-promise','../../config/environment','./smsAccount.attributes','exports','SmsAccount','lodash','util','api','moment','bluebird'];(function(_0x304047,_0x397959){var _0x21c154=function(_0x5e1d75){while(--_0x5e1d75){_0x304047['push'](_0x304047['shift']());}};_0x21c154(++_0x397959);}(_0xf789,0x1ef));var _0x9f78=function(_0x3bfdb6,_0x45f813){_0x3bfdb6=_0x3bfdb6-0x0;var _0x45ffdf=_0xf789[_0x3bfdb6];return _0x45ffdf;};'use strict';var _=require(_0x9f78('0x0'));var util=require(_0x9f78('0x1'));var logger=require('../../config/logger')(_0x9f78('0x2'));var moment=require(_0x9f78('0x3'));var BPromise=require(_0x9f78('0x4'));var rp=require(_0x9f78('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9f78('0x6'));var attributes=require(_0x9f78('0x7'));module[_0x9f78('0x8')]=function(_0x1698ae,_0x5fce0){return _0x1698ae['define'](_0x9f78('0x9'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5848=['path','rimraf','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','lodash','util','../../config/logger','api','request-promise'];(function(_0x521bf3,_0x297c34){var _0x30470f=function(_0x13b234){while(--_0x13b234){_0x521bf3['push'](_0x521bf3['shift']());}};_0x30470f(++_0x297c34);}(_0x5848,0x133));var _0x8584=function(_0x2001b6,_0x365a2a){_0x2001b6=_0x2001b6-0x0;var _0x372bbe=_0x5848[_0x2001b6];return _0x372bbe;};'use strict';var _=require(_0x8584('0x0'));var util=require(_0x8584('0x1'));var logger=require(_0x8584('0x2'))(_0x8584('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8584('0x4'));var fs=require('fs');var path=require(_0x8584('0x5'));var rimraf=require(_0x8584('0x6'));var config=require(_0x8584('0x7'));var attributes=require(_0x8584('0x8'));module[_0x8584('0x9')]=function(_0x3071ea,_0x4657c3){return _0x3071ea[_0x8584('0xa')](_0x8584('0xb'),attributes,{'tableName':_0x8584('0xc'),'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 51bf87d..cdc62d4 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 _0xf075=['request\x20sent','stringify','error','code','message','result','catch','find','options','where','map','include','attributes','model','ShowSmsAccount','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsAccount.socket','register','request','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf075,0x7b));var _0x5f07=function(_0x1888b4,_0x4ae973){_0x1888b4=_0x1888b4-0x0;var _0x59c063=_0xf075[_0x1888b4];return _0x59c063;};'use strict';var _=require(_0x5f07('0x0'));var util=require(_0x5f07('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5f07('0x2'));var db=require(_0x5f07('0x3'))['db'];var utils=require(_0x5f07('0x4'));var logger=require(_0x5f07('0x5'))(_0x5f07('0x6'));var config=require(_0x5f07('0x7'));var jayson=require(_0x5f07('0x8'));var client=jayson[_0x5f07('0x9')][_0x5f07('0xa')]({'port':0x232a});config[_0x5f07('0xb')]=_['defaults'](config['redis'],{'host':_0x5f07('0xc'),'port':0x18eb});var socket=require(_0x5f07('0xd'))(new Redis(config[_0x5f07('0xb')]));require(_0x5f07('0xe'))[_0x5f07('0xf')](socket);function respondWithRpcPromise(_0x30e56d,_0x55bba2,_0x1a20af){return new BPromise(function(_0x1f2599,_0x33df94){return client[_0x5f07('0x10')](_0x30e56d,_0x1a20af)['then'](function(_0x35567d){logger[_0x5f07('0x11')](_0x5f07('0x12'),_0x55bba2,'request\x20sent');logger[_0x5f07('0x13')](_0x5f07('0x14'),_0x55bba2,_0x5f07('0x15'),JSON[_0x5f07('0x16')](_0x35567d));if(_0x35567d[_0x5f07('0x17')]){if(_0x35567d[_0x5f07('0x17')][_0x5f07('0x18')]===0x1f4){logger['error'](_0x5f07('0x12'),_0x55bba2,_0x35567d[_0x5f07('0x17')][_0x5f07('0x19')]);return _0x33df94(_0x35567d[_0x5f07('0x17')][_0x5f07('0x19')]);}logger[_0x5f07('0x17')](_0x5f07('0x12'),_0x55bba2,_0x35567d[_0x5f07('0x17')]['message']);return _0x1f2599(_0x35567d['error']['message']);}else{logger[_0x5f07('0x11')](_0x5f07('0x12'),_0x55bba2,_0x5f07('0x15'));_0x1f2599(_0x35567d[_0x5f07('0x1a')][_0x5f07('0x19')]);}})[_0x5f07('0x1b')](function(_0x8815bc){logger[_0x5f07('0x17')]('SmsAccount,\x20%s,\x20%s',_0x55bba2,_0x8815bc);_0x33df94(_0x8815bc);});});}exports['ShowSmsAccount']=function(_0x5df28c){var _0x331501=this;return new Promise(function(_0xa37b48,_0xecba27){return db['SmsAccount'][_0x5f07('0x1c')]({'raw':_0x5df28c['options']?_0x5df28c[_0x5f07('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x5df28c[_0x5f07('0x1d')]?_0x5df28c['options'][_0x5f07('0x1e')]||null:null,'attributes':_0x5df28c[_0x5f07('0x1d')]?_0x5df28c[_0x5f07('0x1d')]['attributes']||null:null,'include':_0x5df28c[_0x5f07('0x1d')]?_0x5df28c[_0x5f07('0x1d')]['include']?_[_0x5f07('0x1f')](_0x5df28c[_0x5f07('0x1d')][_0x5f07('0x20')],function(_0x18d496){return{'model':db[_0x18d496['model']],'as':_0x18d496['as'],'attributes':_0x18d496[_0x5f07('0x21')],'include':_0x18d496[_0x5f07('0x20')]?_[_0x5f07('0x1f')](_0x18d496[_0x5f07('0x20')],function(_0x387c51){return{'model':db[_0x387c51[_0x5f07('0x22')]],'as':_0x387c51['as'],'attributes':_0x387c51[_0x5f07('0x21')],'include':_0x387c51[_0x5f07('0x20')]?_['map'](_0x387c51[_0x5f07('0x20')],function(_0xdbe28c){return{'model':db[_0xdbe28c[_0x5f07('0x22')]],'as':_0xdbe28c['as'],'attributes':_0xdbe28c[_0x5f07('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x44011d){logger[_0x5f07('0x11')](_0x5f07('0x23'),_0x5df28c);logger[_0x5f07('0x13')]('ShowSmsAccount',_0x5df28c,JSON[_0x5f07('0x16')](_0x44011d));_0xa37b48(_0x44011d);})['catch'](function(_0x140201){logger[_0x5f07('0x17')](_0x5f07('0x23'),_0x140201['message'],_0x5df28c);_0xecba27(_0x331501['error'](0x1f4,_0x140201['message']));});});}; \ No newline at end of file +var _0xe1da=['code','message','info','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','attributes','include','map','model','lodash','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe1da,0x1ea));var _0xae1d=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xe1da[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xae1d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xae1d('0x1'));var db=require(_0xae1d('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xae1d('0x3'))(_0xae1d('0x4'));var config=require('../../config/environment');var jayson=require(_0xae1d('0x5'));var client=jayson[_0xae1d('0x6')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xae1d('0x7')],{'host':_0xae1d('0x8'),'port':0x18eb});var socket=require(_0xae1d('0x9'))(new Redis(config[_0xae1d('0x7')]));require(_0xae1d('0xa'))[_0xae1d('0xb')](socket);function respondWithRpcPromise(_0x467ce1,_0x31edea,_0x38aa58){return new BPromise(function(_0x375ab7,_0x19a08b){return client[_0xae1d('0xc')](_0x467ce1,_0x38aa58)[_0xae1d('0xd')](function(_0x5b571a){logger['info'](_0xae1d('0xe'),_0x31edea,_0xae1d('0xf'));logger[_0xae1d('0x10')](_0xae1d('0x11'),_0x31edea,_0xae1d('0xf'),JSON[_0xae1d('0x12')](_0x5b571a));if(_0x5b571a['error']){if(_0x5b571a[_0xae1d('0x13')][_0xae1d('0x14')]===0x1f4){logger[_0xae1d('0x13')](_0xae1d('0xe'),_0x31edea,_0x5b571a[_0xae1d('0x13')][_0xae1d('0x15')]);return _0x19a08b(_0x5b571a['error'][_0xae1d('0x15')]);}logger[_0xae1d('0x13')](_0xae1d('0xe'),_0x31edea,_0x5b571a[_0xae1d('0x13')][_0xae1d('0x15')]);return _0x375ab7(_0x5b571a[_0xae1d('0x13')][_0xae1d('0x15')]);}else{logger[_0xae1d('0x16')](_0xae1d('0xe'),_0x31edea,_0xae1d('0xf'));_0x375ab7(_0x5b571a[_0xae1d('0x17')][_0xae1d('0x15')]);}})[_0xae1d('0x18')](function(_0x2d30c2){logger[_0xae1d('0x13')](_0xae1d('0xe'),_0x31edea,_0x2d30c2);_0x19a08b(_0x2d30c2);});});}exports[_0xae1d('0x19')]=function(_0x45b6da){var _0x1b5a4f=this;return new Promise(function(_0x4723c5,_0x15d8ec){return db[_0xae1d('0x1a')][_0xae1d('0x1b')]({'raw':_0x45b6da['options']?_0x45b6da[_0xae1d('0x1c')][_0xae1d('0x1d')]===undefined?!![]:![]:!![],'where':_0x45b6da[_0xae1d('0x1c')]?_0x45b6da[_0xae1d('0x1c')]['where']||null:null,'attributes':_0x45b6da[_0xae1d('0x1c')]?_0x45b6da[_0xae1d('0x1c')][_0xae1d('0x1e')]||null:null,'include':_0x45b6da['options']?_0x45b6da[_0xae1d('0x1c')][_0xae1d('0x1f')]?_[_0xae1d('0x20')](_0x45b6da[_0xae1d('0x1c')][_0xae1d('0x1f')],function(_0x1ee294){return{'model':db[_0x1ee294[_0xae1d('0x21')]],'as':_0x1ee294['as'],'attributes':_0x1ee294[_0xae1d('0x1e')],'include':_0x1ee294[_0xae1d('0x1f')]?_[_0xae1d('0x20')](_0x1ee294[_0xae1d('0x1f')],function(_0x595678){return{'model':db[_0x595678['model']],'as':_0x595678['as'],'attributes':_0x595678[_0xae1d('0x1e')],'include':_0x595678[_0xae1d('0x1f')]?_[_0xae1d('0x20')](_0x595678[_0xae1d('0x1f')],function(_0x529c00){return{'model':db[_0x529c00[_0xae1d('0x21')]],'as':_0x529c00['as'],'attributes':_0x529c00[_0xae1d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xae1d('0xd')](function(_0x47483e){logger[_0xae1d('0x16')]('ShowSmsAccount',_0x45b6da);logger[_0xae1d('0x10')](_0xae1d('0x19'),_0x45b6da,JSON['stringify'](_0x47483e));_0x4723c5(_0x47483e);})[_0xae1d('0x18')](function(_0x24f3f1){logger[_0xae1d('0x13')]('ShowSmsAccount',_0x24f3f1['message'],_0x45b6da);_0x15d8ec(_0x1b5a4f[_0xae1d('0x13')](0x1f4,_0x24f3f1['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index b9d64ad..801feed 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(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'use strict';var 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 22b1d2a..e3571be 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(_0x89de20,_0x182ee0){var _0x457d64=function(_0x17c327){while(--_0x17c327){_0x89de20['push'](_0x89de20['shift']());}};_0x457d64(++_0x182ee0);}(_0x3e74,0x175));var _0x43e7=function(_0xefc6d8,_0x3339fc){_0xefc6d8=_0xefc6d8-0x0;var _0x12949=_0x3e74[_0xefc6d8];return _0x12949;};'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 _0x008c=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','post','put','/:id'];(function(_0x373800,_0x293c4b){var _0x367ccf=function(_0x1ccc19){while(--_0x1ccc19){_0x373800['push'](_0x373800['shift']());}};_0x367ccf(++_0x293c4b);}(_0x008c,0x188));var _0xc008=function(_0x18dc83,_0x462295){_0x18dc83=_0x18dc83-0x0;var _0x8236a2=_0x008c[_0x18dc83];return _0x8236a2;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc008('0xe')](_0xc008('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc008('0xf'),auth[_0xc008('0xb')](),controller['destroy']);module[_0xc008('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 53a82a0..43e243e 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 _0x5e01=['noop','TEXT','sequelize','STRING'];(function(_0x1cc211,_0x4856f1){var _0x5df05a=function(_0xc641cb){while(--_0xc641cb){_0x1cc211['push'](_0x1cc211['shift']());}};_0x5df05a(++_0x4856f1);}(_0x5e01,0x72));var _0x15e0=function(_0x5d07ff,_0x1f976f){_0x5d07ff=_0x5d07ff-0x0;var _0x5226ad=_0x5e01[_0x5d07ff];return _0x5226ad;};'use strict';var Sequelize=require(_0x15e0('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x15e0('0x1')],'allowNull':![],'defaultValue':_0x15e0('0x2')},'appdata':{'type':Sequelize[_0x15e0('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x15e0('0x1')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x98f7=['sequelize','exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x16b0aa,_0x3ad668){var _0xcd4bb=function(_0x4696c5){while(--_0x4696c5){_0x16b0aa['push'](_0x16b0aa['shift']());}};_0xcd4bb(++_0x3ad668);}(_0x98f7,0x69));var _0x798f=function(_0x268322,_0x3b52cd){_0x268322=_0x268322-0x0;var _0x4f3f09=_0x98f7[_0x268322];return _0x4f3f09;};'use strict';var Sequelize=require(_0x798f('0x0'));module[_0x798f('0x1')]={'priority':{'type':Sequelize[_0x798f('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x798f('0x3')],'allowNull':![],'defaultValue':_0x798f('0x4')},'appdata':{'type':Sequelize[_0x798f('0x5')]()},'description':{'type':Sequelize[_0x798f('0x3')]},'interval':{'type':Sequelize[_0x798f('0x3')],'defaultValue':_0x798f('0x6')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 6423169..98abfc0 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 _0x557c=['stack','name','send','index','map','SmsApplication','rawAttributes','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','include','create','body','update','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','count','set','apply','save','destroy','then','error'];(function(_0x593f35,_0x1a365b){var _0x2e9122=function(_0x30c7ec){while(--_0x30c7ec){_0x593f35['push'](_0x593f35['shift']());}};_0x2e9122(++_0x1a365b);}(_0x557c,0x6e));var _0xc557=function(_0x52666e,_0x5b3776){_0x52666e=_0x52666e-0x0;var _0x515330=_0x557c[_0x52666e];return _0x515330;};'use strict';var emlformat=require(_0xc557('0x0'));var rimraf=require(_0xc557('0x1'));var zipdir=require(_0xc557('0x2'));var jsonpatch=require(_0xc557('0x3'));var rp=require(_0xc557('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc557('0x5'));var util=require(_0xc557('0x6'));var path=require(_0xc557('0x7'));var sox=require(_0xc557('0x8'));var csv=require(_0xc557('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc557('0xa'));var squel=require(_0xc557('0xb'));var crypto=require(_0xc557('0xc'));var jsforce=require(_0xc557('0xd'));var deskjs=require(_0xc557('0xe'));var toCsv=require(_0xc557('0x9'));var querystring=require(_0xc557('0xf'));var Papa=require(_0xc557('0x10'));var Redis=require('ioredis');var authService=require(_0xc557('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xc557('0x12'));var hardwareService=require(_0xc557('0x13'));var logger=require(_0xc557('0x14'))(_0xc557('0x15'));var utils=require(_0xc557('0x16'));var config=require(_0xc557('0x17'));var licenseUtil=require(_0xc557('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d14f1,_0x1cf02b){_0x1cf02b=_0x1cf02b||0xcc;return function(_0x50a423){if(_0x50a423){return _0x3d14f1[_0xc557('0x19')](_0x1cf02b);}return _0x3d14f1[_0xc557('0x1a')](_0x1cf02b)[_0xc557('0x1b')]();};}function respondWithResult(_0x36c6d2,_0x2a4df2){_0x2a4df2=_0x2a4df2||0xc8;return function(_0x36063e){if(_0x36063e){return _0x36c6d2['status'](_0x2a4df2)[_0xc557('0x1c')](_0x36063e);}};}function respondWithFilteredResult(_0x16a27a,_0x3fad00){return function(_0x98de5f){if(_0x98de5f){var _0x122e6b=typeof _0x3fad00[_0xc557('0x1d')]==='undefined'&&typeof _0x3fad00[_0xc557('0x1e')]==='undefined';var _0xfffcac=_0x98de5f[_0xc557('0x1f')];var _0x446aff=_0x122e6b?0x0:_0x3fad00['offset'];var _0x15a605=_0x122e6b?_0x98de5f[_0xc557('0x1f')]:_0x3fad00[_0xc557('0x1d')]+_0x3fad00[_0xc557('0x1e')];var _0x3f175d;if(_0x15a605>=_0xfffcac){_0x15a605=_0xfffcac;_0x3f175d=0xc8;}else{_0x3f175d=0xce;}_0x16a27a[_0xc557('0x1a')](_0x3f175d);return _0x16a27a[_0xc557('0x20')]('Content-Range',_0x446aff+'-'+_0x15a605+'/'+_0xfffcac)[_0xc557('0x1c')](_0x98de5f);}return null;};}function patchUpdates(_0x503e73){return function(_0x522f44){try{jsonpatch[_0xc557('0x21')](_0x522f44,_0x503e73,!![]);}catch(_0x21f2e2){return BPromise['reject'](_0x21f2e2);}return _0x522f44[_0xc557('0x22')]();};}function saveUpdates(_0x5dc0c8,_0x11284c){return function(_0x3476e6){if(_0x3476e6){return _0x3476e6['update'](_0x5dc0c8)['then'](function(_0x2eb7fe){return _0x2eb7fe;});}return null;};}function removeEntity(_0x24c8b7,_0x376260){return function(_0x46d331){if(_0x46d331){return _0x46d331[_0xc557('0x23')]()[_0xc557('0x24')](function(){_0x24c8b7[_0xc557('0x1a')](0xcc)[_0xc557('0x1b')]();});}};}function handleEntityNotFound(_0x3a36f6,_0x151ac){return function(_0x1bc703){if(!_0x1bc703){_0x3a36f6['sendStatus'](0x194);}return _0x1bc703;};}function handleError(_0x3759b5,_0xfba922){_0xfba922=_0xfba922||0x1f4;return function(_0x3b1c26){logger[_0xc557('0x25')](_0x3b1c26[_0xc557('0x26')]);if(_0x3b1c26[_0xc557('0x27')]){delete _0x3b1c26['name'];}_0x3759b5[_0xc557('0x1a')](_0xfba922)[_0xc557('0x28')](_0x3b1c26);};}exports[_0xc557('0x29')]=function(_0x473934,_0x50bdb9){var _0x593428={},_0x1132cc={},_0x11c292={'count':0x0,'rows':[]};var _0x267e11=_[_0xc557('0x2a')](db[_0xc557('0x2b')][_0xc557('0x2c')],function(_0x5ec086){return{'name':_0x5ec086['fieldName'],'type':_0x5ec086[_0xc557('0x2d')][_0xc557('0x2e')]};});_0x1132cc['model']=_[_0xc557('0x2a')](_0x267e11,_0xc557('0x27'));_0x1132cc[_0xc557('0x2f')]=_[_0xc557('0x30')](_0x473934[_0xc557('0x2f')]);_0x1132cc[_0xc557('0x31')]=_[_0xc557('0x32')](_0x1132cc['model'],_0x1132cc[_0xc557('0x2f')]);_0x593428[_0xc557('0x33')]=_[_0xc557('0x32')](_0x1132cc[_0xc557('0x34')],qs[_0xc557('0x35')](_0x473934['query']['fields']));_0x593428[_0xc557('0x33')]=_0x593428[_0xc557('0x33')][_0xc557('0x36')]?_0x593428[_0xc557('0x33')]:_0x1132cc[_0xc557('0x34')];if(!_0x473934['query'][_0xc557('0x37')]('nolimit')){_0x593428[_0xc557('0x1e')]=qs[_0xc557('0x1e')](_0x473934[_0xc557('0x2f')][_0xc557('0x1e')]);_0x593428['offset']=qs['offset'](_0x473934[_0xc557('0x2f')][_0xc557('0x1d')]);}_0x593428[_0xc557('0x38')]=qs[_0xc557('0x39')](_0x473934[_0xc557('0x2f')][_0xc557('0x39')]);_0x593428[_0xc557('0x3a')]=qs['filters'](_['pick'](_0x473934['query'],_0x1132cc[_0xc557('0x31')]),_0x267e11);if(_0x473934[_0xc557('0x2f')]['filter']){_0x593428[_0xc557('0x3a')]=_[_0xc557('0x3b')](_0x593428[_0xc557('0x3a')],{'$or':_[_0xc557('0x2a')](_0x267e11,function(_0x54a9fe){if(_0x54a9fe[_0xc557('0x2d')]!==_0xc557('0x3c')){var _0x489ea5={};_0x489ea5[_0x54a9fe[_0xc557('0x27')]]={'$like':'%'+_0x473934[_0xc557('0x2f')][_0xc557('0x3d')]+'%'};return _0x489ea5;}})});}_0x593428=_[_0xc557('0x3b')]({},_0x593428,_0x473934[_0xc557('0x3e')]);var _0x604089={'where':_0x593428['where']};return db[_0xc557('0x2b')]['count'](_0x604089)['then'](function(_0x37207d){_0x11c292[_0xc557('0x1f')]=_0x37207d;if(_0x473934['query'][_0xc557('0x3f')]){_0x593428['include']=[{'all':!![]}];}return db['SmsApplication'][_0xc557('0x40')](_0x593428);})[_0xc557('0x24')](function(_0x54d523){_0x11c292[_0xc557('0x41')]=_0x54d523;return _0x11c292;})[_0xc557('0x24')](respondWithFilteredResult(_0x50bdb9,_0x593428))[_0xc557('0x42')](handleError(_0x50bdb9,null));};exports[_0xc557('0x43')]=function(_0x4ddee6,_0x261943){var _0x3db1a8={'raw':!![],'where':{'id':_0x4ddee6[_0xc557('0x44')]['id']}},_0x35b8ec={};_0x35b8ec['model']=_['keys'](db[_0xc557('0x2b')][_0xc557('0x2c')]);_0x35b8ec[_0xc557('0x2f')]=_['keys'](_0x4ddee6[_0xc557('0x2f')]);_0x35b8ec[_0xc557('0x31')]=_[_0xc557('0x32')](_0x35b8ec['model'],_0x35b8ec[_0xc557('0x2f')]);_0x3db1a8[_0xc557('0x33')]=_[_0xc557('0x32')](_0x35b8ec[_0xc557('0x34')],qs[_0xc557('0x35')](_0x4ddee6[_0xc557('0x2f')][_0xc557('0x35')]));_0x3db1a8[_0xc557('0x33')]=_0x3db1a8[_0xc557('0x33')][_0xc557('0x36')]?_0x3db1a8['attributes']:_0x35b8ec[_0xc557('0x34')];if(_0x4ddee6['query'][_0xc557('0x3f')]){_0x3db1a8[_0xc557('0x45')]=[{'all':!![]}];}_0x3db1a8=_['merge']({},_0x3db1a8,_0x4ddee6[_0xc557('0x3e')]);return db['SmsApplication']['find'](_0x3db1a8)[_0xc557('0x24')](handleEntityNotFound(_0x261943,null))[_0xc557('0x24')](respondWithResult(_0x261943,null))['catch'](handleError(_0x261943,null));};exports[_0xc557('0x46')]=function(_0x26d2ad,_0x408bb3){return db[_0xc557('0x2b')][_0xc557('0x46')](_0x26d2ad[_0xc557('0x47')],{})[_0xc557('0x24')](respondWithResult(_0x408bb3,0xc9))['catch'](handleError(_0x408bb3,null));};exports[_0xc557('0x48')]=function(_0x2a6a6c,_0x5c3609){if(_0x2a6a6c['body']['id']){delete _0x2a6a6c['body']['id'];}return db['SmsApplication'][_0xc557('0x49')]({'where':{'id':_0x2a6a6c['params']['id']}})[_0xc557('0x24')](handleEntityNotFound(_0x5c3609,null))[_0xc557('0x24')](saveUpdates(_0x2a6a6c[_0xc557('0x47')],null))[_0xc557('0x24')](respondWithResult(_0x5c3609,null))['catch'](handleError(_0x5c3609,null));};exports[_0xc557('0x23')]=function(_0x2e4fd5,_0x6b0ec1){return db[_0xc557('0x2b')]['find']({'where':{'id':_0x2e4fd5[_0xc557('0x44')]['id']}})[_0xc557('0x24')](handleEntityNotFound(_0x6b0ec1,null))['then'](removeEntity(_0x6b0ec1,null))[_0xc557('0x42')](handleError(_0x6b0ec1,null));}; \ No newline at end of file +var _0xcbe6=['util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','SmsApplication','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','eml-format','moment','bluebird','mustache'];(function(_0x28610f,_0x5597db){var _0x65cc73=function(_0x517d52){while(--_0x517d52){_0x28610f['push'](_0x28610f['shift']());}};_0x65cc73(++_0x5597db);}(_0xcbe6,0x92));var _0x6cbe=function(_0x30fea1,_0xd20ba3){_0x30fea1=_0x30fea1-0x0;var _0x2568ab=_0xcbe6[_0x30fea1];return _0x2568ab;};'use strict';var emlformat=require(_0x6cbe('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6cbe('0x1'));var BPromise=require(_0x6cbe('0x2'));var Mustache=require(_0x6cbe('0x3'));var util=require(_0x6cbe('0x4'));var path=require(_0x6cbe('0x5'));var sox=require(_0x6cbe('0x6'));var csv=require(_0x6cbe('0x7'));var ejs=require(_0x6cbe('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6cbe('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6cbe('0xa'));var deskjs=require(_0x6cbe('0xb'));var toCsv=require(_0x6cbe('0x7'));var querystring=require(_0x6cbe('0xc'));var Papa=require(_0x6cbe('0xd'));var Redis=require(_0x6cbe('0xe'));var authService=require(_0x6cbe('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x6cbe('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6cbe('0x11'))(_0x6cbe('0x12'));var utils=require(_0x6cbe('0x13'));var config=require(_0x6cbe('0x14'));var licenseUtil=require(_0x6cbe('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3192aa,_0x1ff9bd){_0x1ff9bd=_0x1ff9bd||0xcc;return function(_0x42d797){if(_0x42d797){return _0x3192aa[_0x6cbe('0x16')](_0x1ff9bd);}return _0x3192aa['status'](_0x1ff9bd)[_0x6cbe('0x17')]();};}function respondWithResult(_0x17c9e9,_0x5658b6){_0x5658b6=_0x5658b6||0xc8;return function(_0x1ef160){if(_0x1ef160){return _0x17c9e9['status'](_0x5658b6)[_0x6cbe('0x18')](_0x1ef160);}};}function respondWithFilteredResult(_0x386982,_0x1dfbe9){return function(_0x52d832){if(_0x52d832){var _0x5c7784=typeof _0x1dfbe9[_0x6cbe('0x19')]===_0x6cbe('0x1a')&&typeof _0x1dfbe9[_0x6cbe('0x1b')]==='undefined';var _0x20e42d=_0x52d832[_0x6cbe('0x1c')];var _0x393fad=_0x5c7784?0x0:_0x1dfbe9[_0x6cbe('0x19')];var _0x2d6e54=_0x5c7784?_0x52d832[_0x6cbe('0x1c')]:_0x1dfbe9[_0x6cbe('0x19')]+_0x1dfbe9['limit'];var _0xd0a345;if(_0x2d6e54>=_0x20e42d){_0x2d6e54=_0x20e42d;_0xd0a345=0xc8;}else{_0xd0a345=0xce;}_0x386982[_0x6cbe('0x1d')](_0xd0a345);return _0x386982[_0x6cbe('0x1e')](_0x6cbe('0x1f'),_0x393fad+'-'+_0x2d6e54+'/'+_0x20e42d)[_0x6cbe('0x18')](_0x52d832);}return null;};}function patchUpdates(_0x5af852){return function(_0x35d6ae){try{jsonpatch[_0x6cbe('0x20')](_0x35d6ae,_0x5af852,!![]);}catch(_0x263f63){return BPromise[_0x6cbe('0x21')](_0x263f63);}return _0x35d6ae[_0x6cbe('0x22')]();};}function saveUpdates(_0x43c1de,_0x54556f){return function(_0x3ebc70){if(_0x3ebc70){return _0x3ebc70[_0x6cbe('0x23')](_0x43c1de)['then'](function(_0x4133e4){return _0x4133e4;});}return null;};}function removeEntity(_0x2a01f3,_0x374dfc){return function(_0x760ae5){if(_0x760ae5){return _0x760ae5[_0x6cbe('0x24')]()[_0x6cbe('0x25')](function(){_0x2a01f3[_0x6cbe('0x1d')](0xcc)[_0x6cbe('0x17')]();});}};}function handleEntityNotFound(_0x22c9ca,_0x27694e){return function(_0x1edf91){if(!_0x1edf91){_0x22c9ca['sendStatus'](0x194);}return _0x1edf91;};}function handleError(_0x569621,_0x37b1b9){_0x37b1b9=_0x37b1b9||0x1f4;return function(_0x2fa4a6){logger[_0x6cbe('0x26')](_0x2fa4a6[_0x6cbe('0x27')]);if(_0x2fa4a6[_0x6cbe('0x28')]){delete _0x2fa4a6['name'];}_0x569621[_0x6cbe('0x1d')](_0x37b1b9)[_0x6cbe('0x29')](_0x2fa4a6);};}exports[_0x6cbe('0x2a')]=function(_0x36f4b7,_0x519edb){var _0x192314={},_0x765980={},_0x2dff16={'count':0x0,'rows':[]};var _0x4e75ef=_[_0x6cbe('0x2b')](db['SmsApplication'][_0x6cbe('0x2c')],function(_0x46e927){return{'name':_0x46e927['fieldName'],'type':_0x46e927[_0x6cbe('0x2d')][_0x6cbe('0x2e')]};});_0x765980[_0x6cbe('0x2f')]=_[_0x6cbe('0x2b')](_0x4e75ef,_0x6cbe('0x28'));_0x765980[_0x6cbe('0x30')]=_[_0x6cbe('0x31')](_0x36f4b7['query']);_0x765980[_0x6cbe('0x32')]=_[_0x6cbe('0x33')](_0x765980[_0x6cbe('0x2f')],_0x765980['query']);_0x192314[_0x6cbe('0x34')]=_[_0x6cbe('0x33')](_0x765980[_0x6cbe('0x2f')],qs[_0x6cbe('0x35')](_0x36f4b7[_0x6cbe('0x30')]['fields']));_0x192314[_0x6cbe('0x34')]=_0x192314[_0x6cbe('0x34')][_0x6cbe('0x36')]?_0x192314[_0x6cbe('0x34')]:_0x765980[_0x6cbe('0x2f')];if(!_0x36f4b7[_0x6cbe('0x30')][_0x6cbe('0x37')]('nolimit')){_0x192314[_0x6cbe('0x1b')]=qs[_0x6cbe('0x1b')](_0x36f4b7['query']['limit']);_0x192314[_0x6cbe('0x19')]=qs[_0x6cbe('0x19')](_0x36f4b7[_0x6cbe('0x30')][_0x6cbe('0x19')]);}_0x192314[_0x6cbe('0x38')]=qs[_0x6cbe('0x39')](_0x36f4b7['query'][_0x6cbe('0x39')]);_0x192314['where']=qs[_0x6cbe('0x32')](_[_0x6cbe('0x3a')](_0x36f4b7[_0x6cbe('0x30')],_0x765980['filters']),_0x4e75ef);if(_0x36f4b7[_0x6cbe('0x30')][_0x6cbe('0x3b')]){_0x192314[_0x6cbe('0x3c')]=_['merge'](_0x192314[_0x6cbe('0x3c')],{'$or':_[_0x6cbe('0x2b')](_0x4e75ef,function(_0x5c5c27){if(_0x5c5c27['type']!==_0x6cbe('0x3d')){var _0x3fdd3a={};_0x3fdd3a[_0x5c5c27[_0x6cbe('0x28')]]={'$like':'%'+_0x36f4b7[_0x6cbe('0x30')][_0x6cbe('0x3b')]+'%'};return _0x3fdd3a;}})});}_0x192314=_[_0x6cbe('0x3e')]({},_0x192314,_0x36f4b7['options']);var _0x49ac2c={'where':_0x192314['where']};return db[_0x6cbe('0x3f')][_0x6cbe('0x1c')](_0x49ac2c)['then'](function(_0x5026a5){_0x2dff16[_0x6cbe('0x1c')]=_0x5026a5;if(_0x36f4b7[_0x6cbe('0x30')][_0x6cbe('0x40')]){_0x192314[_0x6cbe('0x41')]=[{'all':!![]}];}return db[_0x6cbe('0x3f')][_0x6cbe('0x42')](_0x192314);})[_0x6cbe('0x25')](function(_0x5450d2){_0x2dff16[_0x6cbe('0x43')]=_0x5450d2;return _0x2dff16;})['then'](respondWithFilteredResult(_0x519edb,_0x192314))[_0x6cbe('0x44')](handleError(_0x519edb,null));};exports[_0x6cbe('0x45')]=function(_0x234d09,_0xf0a13b){var _0x48fc39={'raw':!![],'where':{'id':_0x234d09[_0x6cbe('0x46')]['id']}},_0x5eafa8={};_0x5eafa8[_0x6cbe('0x2f')]=_[_0x6cbe('0x31')](db[_0x6cbe('0x3f')][_0x6cbe('0x2c')]);_0x5eafa8['query']=_[_0x6cbe('0x31')](_0x234d09[_0x6cbe('0x30')]);_0x5eafa8['filters']=_[_0x6cbe('0x33')](_0x5eafa8[_0x6cbe('0x2f')],_0x5eafa8[_0x6cbe('0x30')]);_0x48fc39[_0x6cbe('0x34')]=_[_0x6cbe('0x33')](_0x5eafa8[_0x6cbe('0x2f')],qs[_0x6cbe('0x35')](_0x234d09[_0x6cbe('0x30')][_0x6cbe('0x35')]));_0x48fc39[_0x6cbe('0x34')]=_0x48fc39[_0x6cbe('0x34')][_0x6cbe('0x36')]?_0x48fc39[_0x6cbe('0x34')]:_0x5eafa8[_0x6cbe('0x2f')];if(_0x234d09[_0x6cbe('0x30')][_0x6cbe('0x40')]){_0x48fc39[_0x6cbe('0x41')]=[{'all':!![]}];}_0x48fc39=_[_0x6cbe('0x3e')]({},_0x48fc39,_0x234d09[_0x6cbe('0x47')]);return db[_0x6cbe('0x3f')][_0x6cbe('0x48')](_0x48fc39)[_0x6cbe('0x25')](handleEntityNotFound(_0xf0a13b,null))[_0x6cbe('0x25')](respondWithResult(_0xf0a13b,null))[_0x6cbe('0x44')](handleError(_0xf0a13b,null));};exports[_0x6cbe('0x49')]=function(_0x2b1934,_0x296712){return db[_0x6cbe('0x3f')]['create'](_0x2b1934[_0x6cbe('0x4a')],{})['then'](respondWithResult(_0x296712,0xc9))[_0x6cbe('0x44')](handleError(_0x296712,null));};exports[_0x6cbe('0x23')]=function(_0x10ef34,_0x2b7f28){if(_0x10ef34[_0x6cbe('0x4a')]['id']){delete _0x10ef34['body']['id'];}return db[_0x6cbe('0x3f')][_0x6cbe('0x48')]({'where':{'id':_0x10ef34['params']['id']}})[_0x6cbe('0x25')](handleEntityNotFound(_0x2b7f28,null))['then'](saveUpdates(_0x10ef34[_0x6cbe('0x4a')],null))[_0x6cbe('0x25')](respondWithResult(_0x2b7f28,null))[_0x6cbe('0x44')](handleError(_0x2b7f28,null));};exports[_0x6cbe('0x24')]=function(_0x3d4f84,_0x391841){return db[_0x6cbe('0x3f')]['find']({'where':{'id':_0x3d4f84['params']['id']}})['then'](handleEntityNotFound(_0x391841,null))['then'](removeEntity(_0x391841,null))[_0x6cbe('0x44')](handleError(_0x391841,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 96d61b7..38e25c9 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 _0x048f=['sms_applications','utf8mb4','utf8mb4_unicode_ci','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','exports','SmsApplication'];(function(_0x35bdcf,_0x21421c){var _0x5a4fc7=function(_0x374f22){while(--_0x374f22){_0x35bdcf['push'](_0x35bdcf['shift']());}};_0x5a4fc7(++_0x21421c);}(_0x048f,0x1e4));var _0xf048=function(_0x2b1bcf,_0x2c43d3){_0x2b1bcf=_0x2b1bcf-0x0;var _0xee11c0=_0x048f[_0x2b1bcf];return _0xee11c0;};'use strict';var _=require('lodash');var util=require(_0xf048('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xf048('0x1'));var BPromise=require(_0xf048('0x2'));var rp=require(_0xf048('0x3'));var fs=require('fs');var path=require(_0xf048('0x4'));var rimraf=require(_0xf048('0x5'));var config=require(_0xf048('0x6'));var attributes=require(_0xf048('0x7'));module[_0xf048('0x8')]=function(_0x535615,_0x4f0c6e){return _0x535615['define'](_0xf048('0x9'),attributes,{'tableName':_0xf048('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf048('0xb'),'collate':_0xf048('0xc')});}; \ No newline at end of file +var _0x7fac=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4','lodash'];(function(_0xae01dd,_0xbd8a3c){var _0x8c26df=function(_0x359827){while(--_0x359827){_0xae01dd['push'](_0xae01dd['shift']());}};_0x8c26df(++_0xbd8a3c);}(_0x7fac,0x137));var _0xc7fa=function(_0x503950,_0x5022eb){_0x503950=_0x503950-0x0;var _0x1657a9=_0x7fac[_0x503950];return _0x1657a9;};'use strict';var _=require(_0xc7fa('0x0'));var util=require('util');var logger=require(_0xc7fa('0x1'))('api');var moment=require(_0xc7fa('0x2'));var BPromise=require(_0xc7fa('0x3'));var rp=require(_0xc7fa('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc7fa('0x5'));var config=require(_0xc7fa('0x6'));var attributes=require(_0xc7fa('0x7'));module[_0xc7fa('0x8')]=function(_0x386b6c,_0xb8151c){return _0x386b6c[_0xc7fa('0x9')](_0xc7fa('0xa'),attributes,{'tableName':_0xc7fa('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc7fa('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 7a4e650..0a5ed07 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 _0xb5f3=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','SmsApplication,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring'];(function(_0x55e3e6,_0x1376e4){var _0x4f3722=function(_0xb385cf){while(--_0xb385cf){_0x55e3e6['push'](_0x55e3e6['shift']());}};_0x4f3722(++_0x1376e4);}(_0xb5f3,0x137));var _0x3b5f=function(_0x25c326,_0x250137){_0x25c326=_0x25c326-0x0;var _0x762452=_0xb5f3[_0x25c326];return _0x762452;};'use strict';var _=require(_0x3b5f('0x0'));var util=require(_0x3b5f('0x1'));var moment=require(_0x3b5f('0x2'));var BPromise=require('bluebird');var rs=require(_0x3b5f('0x3'));var fs=require('fs');var Redis=require(_0x3b5f('0x4'));var db=require(_0x3b5f('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3b5f('0x6'));var config=require(_0x3b5f('0x7'));var jayson=require(_0x3b5f('0x8'));var client=jayson[_0x3b5f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2db4ad,_0x1b6d67,_0x4edb1a){return new BPromise(function(_0x2e213c,_0x48597e){return client[_0x3b5f('0xa')](_0x2db4ad,_0x4edb1a)[_0x3b5f('0xb')](function(_0x2c37f6){logger[_0x3b5f('0xc')]('SmsApplication,\x20%s,\x20%s',_0x1b6d67,_0x3b5f('0xd'));logger[_0x3b5f('0xe')](_0x3b5f('0xf'),_0x1b6d67,_0x3b5f('0xd'),JSON[_0x3b5f('0x10')](_0x2c37f6));if(_0x2c37f6['error']){if(_0x2c37f6['error']['code']===0x1f4){logger[_0x3b5f('0x11')](_0x3b5f('0x12'),_0x1b6d67,_0x2c37f6[_0x3b5f('0x11')][_0x3b5f('0x13')]);return _0x48597e(_0x2c37f6[_0x3b5f('0x11')][_0x3b5f('0x13')]);}logger[_0x3b5f('0x11')](_0x3b5f('0x12'),_0x1b6d67,_0x2c37f6['error'][_0x3b5f('0x13')]);return _0x2e213c(_0x2c37f6[_0x3b5f('0x11')][_0x3b5f('0x13')]);}else{logger['info'](_0x3b5f('0x12'),_0x1b6d67,'request\x20sent');_0x2e213c(_0x2c37f6[_0x3b5f('0x14')][_0x3b5f('0x13')]);}})['catch'](function(_0x28b6c1){logger[_0x3b5f('0x11')](_0x3b5f('0x12'),_0x1b6d67,_0x28b6c1);_0x48597e(_0x28b6c1);});});} \ No newline at end of file +var _0x04d5=['stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x28eb18,_0x10f5e1){var _0x563099=function(_0x3a7317){while(--_0x3a7317){_0x28eb18['push'](_0x28eb18['shift']());}};_0x563099(++_0x10f5e1);}(_0x04d5,0xe1));var _0x504d=function(_0x4b98b4,_0x35e955){_0x4b98b4=_0x4b98b4-0x0;var _0x4e6a96=_0x04d5[_0x4b98b4];return _0x4e6a96;};'use strict';var _=require(_0x504d('0x0'));var util=require(_0x504d('0x1'));var moment=require('moment');var BPromise=require(_0x504d('0x2'));var rs=require(_0x504d('0x3'));var fs=require('fs');var Redis=require(_0x504d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x504d('0x5'));var logger=require(_0x504d('0x6'))(_0x504d('0x7'));var config=require(_0x504d('0x8'));var jayson=require(_0x504d('0x9'));var client=jayson['client'][_0x504d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x278262,_0x87bf04,_0x49cb76){return new BPromise(function(_0x5712a7,_0x16da4f){return client[_0x504d('0xb')](_0x278262,_0x49cb76)[_0x504d('0xc')](function(_0x48e0e6){logger[_0x504d('0xd')](_0x504d('0xe'),_0x87bf04,_0x504d('0xf'));logger[_0x504d('0x10')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x87bf04,_0x504d('0xf'),JSON[_0x504d('0x11')](_0x48e0e6));if(_0x48e0e6[_0x504d('0x12')]){if(_0x48e0e6[_0x504d('0x12')][_0x504d('0x13')]===0x1f4){logger[_0x504d('0x12')](_0x504d('0xe'),_0x87bf04,_0x48e0e6['error']['message']);return _0x16da4f(_0x48e0e6[_0x504d('0x12')][_0x504d('0x14')]);}logger[_0x504d('0x12')](_0x504d('0xe'),_0x87bf04,_0x48e0e6[_0x504d('0x12')][_0x504d('0x14')]);return _0x5712a7(_0x48e0e6['error'][_0x504d('0x14')]);}else{logger['info'](_0x504d('0xe'),_0x87bf04,_0x504d('0xf'));_0x5712a7(_0x48e0e6['result'][_0x504d('0x14')]);}})[_0x504d('0x15')](function(_0x1e3722){logger[_0x504d('0x12')](_0x504d('0xe'),_0x87bf04,_0x1e3722);_0x16da4f(_0x1e3722);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 9ba2322..fb06e3a 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 _0x6cb4=['./smsInteraction.controller','isAuthenticated','get','/describe','describe','/:id','show','getMessages','/:id/download','create','post','/:id/messages','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x69df00,_0x2bb9a8){var _0x2e82bc=function(_0x4f512f){while(--_0x4f512f){_0x69df00['push'](_0x69df00['shift']());}};_0x2e82bc(++_0x2bb9a8);}(_0x6cb4,0xff));var _0x46cb=function(_0x134b20,_0x40f316){_0x134b20=_0x134b20-0x0;var _0x3ad08d=_0x6cb4[_0x134b20];return _0x3ad08d;};'use strict';var multer=require(_0x46cb('0x0'));var util=require(_0x46cb('0x1'));var path=require(_0x46cb('0x2'));var timeout=require(_0x46cb('0x3'));var express=require(_0x46cb('0x4'));var router=express[_0x46cb('0x5')]();var fs_extra=require(_0x46cb('0x6'));var auth=require(_0x46cb('0x7'));var interaction=require(_0x46cb('0x8'));var config=require('../../config/environment');var controller=require(_0x46cb('0x9'));router['get']('/',auth[_0x46cb('0xa')](),controller['index']);router[_0x46cb('0xb')](_0x46cb('0xc'),auth[_0x46cb('0xa')](),controller[_0x46cb('0xd')]);router[_0x46cb('0xb')](_0x46cb('0xe'),auth['isAuthenticated'](),controller[_0x46cb('0xf')]);router[_0x46cb('0xb')]('/:id/messages',auth[_0x46cb('0xa')](),controller[_0x46cb('0x10')]);router['get'](_0x46cb('0x11'),auth[_0x46cb('0xa')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0x46cb('0x12')]);router[_0x46cb('0x13')](_0x46cb('0x14'),auth[_0x46cb('0xa')](),controller['addMessage']);router[_0x46cb('0x13')](_0x46cb('0x15'),auth[_0x46cb('0xa')](),interaction[_0x46cb('0x16')](_0x46cb('0x17'),_0x46cb('0x18')),controller[_0x46cb('0x19')]);router[_0x46cb('0x1a')](_0x46cb('0xe'),auth[_0x46cb('0xa')](),interaction[_0x46cb('0x16')]('sms',_0x46cb('0x1b')),controller['update']);router[_0x46cb('0x1c')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x46cb('0x17'),_0x46cb('0x1d')),controller[_0x46cb('0x1e')]);router[_0x46cb('0x1c')](_0x46cb('0x15'),auth[_0x46cb('0xa')](),controller[_0x46cb('0x1f')]);module[_0x46cb('0x20')]=router; \ No newline at end of file +var _0x14a0=['/:id/download','post','create','/:id/messages','addMessage','/:id/tags','tracked','sms','addTags','put','smsinteraction:update','update','delete','/:id','smsinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./smsInteraction.controller','get','isAuthenticated','/describe','describe','getMessages'];(function(_0x4d188e,_0x41d32a){var _0x12aae2=function(_0x60d49b){while(--_0x60d49b){_0x4d188e['push'](_0x4d188e['shift']());}};_0x12aae2(++_0x41d32a);}(_0x14a0,0x8e));var _0x014a=function(_0x226e6b,_0x6b74e1){_0x226e6b=_0x226e6b-0x0;var _0xa26c2d=_0x14a0[_0x226e6b];return _0xa26c2d;};'use strict';var multer=require('multer');var util=require(_0x014a('0x0'));var path=require(_0x014a('0x1'));var timeout=require(_0x014a('0x2'));var express=require(_0x014a('0x3'));var router=express[_0x014a('0x4')]();var fs_extra=require(_0x014a('0x5'));var auth=require(_0x014a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x014a('0x7'));router[_0x014a('0x8')]('/',auth[_0x014a('0x9')](),controller['index']);router['get'](_0x014a('0xa'),auth[_0x014a('0x9')](),controller[_0x014a('0xb')]);router['get']('/:id',auth[_0x014a('0x9')](),controller['show']);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0x014a('0xc')]);router['get'](_0x014a('0xd'),auth[_0x014a('0x9')](),controller['download']);router[_0x014a('0xe')]('/',auth[_0x014a('0x9')](),controller[_0x014a('0xf')]);router[_0x014a('0xe')](_0x014a('0x10'),auth[_0x014a('0x9')](),controller[_0x014a('0x11')]);router[_0x014a('0xe')](_0x014a('0x12'),auth[_0x014a('0x9')](),interaction[_0x014a('0x13')](_0x014a('0x14'),'smsinteraction:addtags'),controller[_0x014a('0x15')]);router[_0x014a('0x16')]('/:id',auth[_0x014a('0x9')](),interaction[_0x014a('0x13')]('sms',_0x014a('0x17')),controller[_0x014a('0x18')]);router[_0x014a('0x19')](_0x014a('0x1a'),auth[_0x014a('0x9')](),interaction[_0x014a('0x13')](_0x014a('0x14'),_0x014a('0x1b')),controller[_0x014a('0x1c')]);router[_0x014a('0x19')](_0x014a('0x12'),auth[_0x014a('0x9')](),controller[_0x014a('0x1d')]);module[_0x014a('0x1e')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index f2fff7a..a41acfe 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 _0x9865=['ENUM','out','sequelize','moment','exports','BOOLEAN','DATE','STRING'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x9865,0x1ba));var _0x5986=function(_0x2ebf64,_0x28d567){_0x2ebf64=_0x2ebf64-0x0;var _0x4b3e84=_0x9865[_0x2ebf64];return _0x4b3e84;};'use strict';var Sequelize=require(_0x5986('0x0'));var moment=require(_0x5986('0x1'));module[_0x5986('0x2')]={'closed':{'type':Sequelize[_0x5986('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5986('0x4')]},'disposition':{'type':Sequelize[_0x5986('0x5')]},'secondDisposition':{'type':Sequelize[_0x5986('0x5')]},'thirdDisposition':{'type':Sequelize[_0x5986('0x5')]},'note':{'type':Sequelize[_0x5986('0x5')]},'phone':{'type':Sequelize[_0x5986('0x5')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x5986('0x6')]('in',_0x5986('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x5986('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x5986('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x7c22=['STRING','out','ENUM','sequelize','moment','BOOLEAN','DATE'];(function(_0x138f6b,_0x43eb47){var _0x124d64=function(_0x347a04){while(--_0x347a04){_0x138f6b['push'](_0x138f6b['shift']());}};_0x124d64(++_0x43eb47);}(_0x7c22,0x6c));var _0x27c2=function(_0x4e74cd,_0x2a6076){_0x4e74cd=_0x4e74cd-0x0;var _0x4d2525=_0x7c22[_0x4e74cd];return _0x4d2525;};'use strict';var Sequelize=require(_0x27c2('0x0'));var moment=require(_0x27c2('0x1'));module['exports']={'closed':{'type':Sequelize[_0x27c2('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x27c2('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x27c2('0x4')]},'thirdDisposition':{'type':Sequelize[_0x27c2('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x27c2('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x27c2('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x27c2('0x6')]('in',_0x27c2('0x5')),'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 cb1415d..abaf11d 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 _0xb6e3=['sendStatus','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','index','SmsInteraction','rawAttributes','fieldName','type','key','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','unreadMessages','having','`\x20=\x200','Contact','operator','$substring','value','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','body','text','keys','compact','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','agent','toString','sequelize','keyBy','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','all','rows','show','params','include','merge','options','describe','addMessage','ids','getMessages','findOne','SmsMessage','SmsInteractionId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','setTags','omit','spread','emit','removeTags','download','unix','root','server','join','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Messages','SmsAccount','Account','Owner','mkdirSync','N.A.','closed','closedAt','direction','out','secret','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Sms','createPdfFromHTML','log','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','end'];(function(_0x4cfa7b,_0x786ac7){var _0x2453ac=function(_0x12e3d6){while(--_0x12e3d6){_0x4cfa7b['push'](_0x4cfa7b['shift']());}};_0x2453ac(++_0x786ac7);}(_0xb6e3,0xbf));var _0x3b6e=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0xb6e3[_0x5608a3];return _0x1ed50a;};'use strict';var emlformat=require(_0x3b6e('0x0'));var rimraf=require(_0x3b6e('0x1'));var zipdir=require(_0x3b6e('0x2'));var jsonpatch=require(_0x3b6e('0x3'));var rp=require(_0x3b6e('0x4'));var moment=require(_0x3b6e('0x5'));var BPromise=require(_0x3b6e('0x6'));var Mustache=require(_0x3b6e('0x7'));var util=require('util');var path=require('path');var sox=require(_0x3b6e('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3b6e('0x9'));var _=require(_0x3b6e('0xa'));var squel=require(_0x3b6e('0xb'));var crypto=require(_0x3b6e('0xc'));var jsforce=require(_0x3b6e('0xd'));var deskjs=require(_0x3b6e('0xe'));var toCsv=require(_0x3b6e('0xf'));var querystring=require(_0x3b6e('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3b6e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3b6e('0x12'));var pdf=require(_0x3b6e('0x13'));var hardwareService=require(_0x3b6e('0x14'));var logger=require(_0x3b6e('0x15'))(_0x3b6e('0x16'));var utils=require(_0x3b6e('0x17'));var config=require(_0x3b6e('0x18'));var licenseUtil=require(_0x3b6e('0x19'));var db=require(_0x3b6e('0x1a'))['db'];config[_0x3b6e('0x1b')]=_[_0x3b6e('0x1c')](config[_0x3b6e('0x1b')],{'host':_0x3b6e('0x1d'),'port':0x18eb});var socket=require(_0x3b6e('0x1e'))(new Redis(config[_0x3b6e('0x1b')]));require(_0x3b6e('0x1f'))['register'](socket);function respondWithStatusCode(_0x50bf45,_0x482d0e){_0x482d0e=_0x482d0e||0xcc;return function(_0x138846){if(_0x138846){return _0x50bf45['sendStatus'](_0x482d0e);}return _0x50bf45[_0x3b6e('0x20')](_0x482d0e)['end']();};}function respondWithResult(_0x17e302,_0x8b00a2){_0x8b00a2=_0x8b00a2||0xc8;return function(_0xa48a22){if(_0xa48a22){return _0x17e302[_0x3b6e('0x20')](_0x8b00a2)[_0x3b6e('0x21')](_0xa48a22);}};}function respondWithFilteredResult(_0x152de3,_0x3da222){return function(_0xef83d){if(_0xef83d){var _0xd6e115=typeof _0x3da222[_0x3b6e('0x22')]===_0x3b6e('0x23')&&typeof _0x3da222['limit']==='undefined';var _0x4183ac=_0xef83d['count'];var _0x46b778=_0xd6e115?0x0:_0x3da222[_0x3b6e('0x22')];var _0x3f244f=_0xd6e115?_0xef83d[_0x3b6e('0x24')]:_0x3da222[_0x3b6e('0x22')]+_0x3da222[_0x3b6e('0x25')];var _0x2db9c6;if(_0x3f244f>=_0x4183ac){_0x3f244f=_0x4183ac;_0x2db9c6=0xc8;}else{_0x2db9c6=0xce;}_0x152de3[_0x3b6e('0x20')](_0x2db9c6);return _0x152de3['set'](_0x3b6e('0x26'),_0x46b778+'-'+_0x3f244f+'/'+_0x4183ac)[_0x3b6e('0x21')](_0xef83d);}return null;};}function patchUpdates(_0x3da3d8){return function(_0x432996){try{jsonpatch[_0x3b6e('0x27')](_0x432996,_0x3da3d8,!![]);}catch(_0xad11aa){return BPromise[_0x3b6e('0x28')](_0xad11aa);}return _0x432996[_0x3b6e('0x29')]();};}function saveUpdates(_0x44561c,_0x3c1630){return function(_0x5b0536){if(_0x5b0536){return _0x5b0536[_0x3b6e('0x2a')](_0x44561c)[_0x3b6e('0x2b')](function(_0x884533){return _0x884533;});}return null;};}function removeEntity(_0x5085ce,_0x54f8e5){return function(_0x376f9b){if(_0x376f9b){return _0x376f9b[_0x3b6e('0x2c')]()[_0x3b6e('0x2b')](function(){_0x5085ce[_0x3b6e('0x20')](0xcc)[_0x3b6e('0x2d')]();});}};}function handleEntityNotFound(_0x3073b8,_0x191730){return function(_0x1a9db9){if(!_0x1a9db9){_0x3073b8[_0x3b6e('0x2e')](0x194);}return _0x1a9db9;};}function handleError(_0x5c24ac,_0x25e2db){_0x25e2db=_0x25e2db||0x1f4;return function(_0x143239){logger[_0x3b6e('0x2f')](_0x143239[_0x3b6e('0x30')]);if(_0x143239[_0x3b6e('0x31')]){delete _0x143239['name'];}_0x5c24ac[_0x3b6e('0x20')](_0x25e2db)[_0x3b6e('0x32')](_0x143239);};}function getInteractionUsers(_0x1362b8,_0x5ad4a4){return new BPromise(function(_0x465c5e,_0x1978ef){try{if(_0x5ad4a4[_0x1362b8['id']]){_0x1362b8[_0x3b6e('0x33')]=_[_0x3b6e('0x34')](_0x5ad4a4[_0x1362b8['id']],function(_0x1b8a06){return{'id':_0x1b8a06['id'],'fullname':_0x1b8a06[_0x3b6e('0x35')]};});}}catch(_0x38c5fb){_0x1978ef(_0x38c5fb);}_0x465c5e(_0x1362b8);});}function getInteractionTags(_0x34e8ef,_0x156133){return new BPromise(function(_0x21dc64,_0xc508df){try{if(_0x34e8ef[_0x3b6e('0x36')]){_0x34e8ef[_0x3b6e('0x37')]=[];_0x34e8ef[_0x3b6e('0x36')][_0x3b6e('0x38')](',')[_0x3b6e('0x39')](function(_0x566457){_0x34e8ef['Tags'][_0x3b6e('0x3a')](_0x156133[_0x566457]);});}delete _0x34e8ef[_0x3b6e('0x36')];}catch(_0x530601){_0xc508df(_0x530601);}_0x21dc64(_0x34e8ef);});}function updateSmsInteraction(_0x579c95,_0x423c44,_0x557de9){return new BPromise(function(_0x521547,_0x45470f){return getInteractionUsers(_0x579c95,_0x557de9)[_0x3b6e('0x2b')](function(_0x3d480e){return getInteractionTags(_0x3d480e,_0x423c44);})[_0x3b6e('0x2b')](function(_0x3a45b0){_0x521547(_0x3a45b0);})[_0x3b6e('0x3b')](function(_0x43c2f3){_0x45470f(_0x43c2f3);});});}exports[_0x3b6e('0x3c')]=function(_0x4cbdbc,_0x153fcb){var _0x4ce0e9={},_0x1909f4={},_0x4cac70={'count':0x0,'rows':[]};var _0x41a4d5=_['map'](db[_0x3b6e('0x3d')][_0x3b6e('0x3e')],function(_0x1135be){return{'name':_0x1135be[_0x3b6e('0x3f')],'type':_0x1135be[_0x3b6e('0x40')][_0x3b6e('0x41')]};});_0x1909f4['model']=_[_0x3b6e('0x34')](_0x41a4d5,_0x3b6e('0x31'));_0x1909f4['query']=_['keys'](_0x4cbdbc[_0x3b6e('0x42')]);_0x1909f4[_0x3b6e('0x43')]=_['intersection'](_0x1909f4[_0x3b6e('0x44')],_0x1909f4[_0x3b6e('0x42')]);_0x4ce0e9['attributes']=_[_0x3b6e('0x45')](_0x1909f4[_0x3b6e('0x44')],qs[_0x3b6e('0x46')](_0x4cbdbc[_0x3b6e('0x42')]['fields']));_0x4ce0e9[_0x3b6e('0x47')]=_0x4ce0e9['attributes'][_0x3b6e('0x48')]?_0x4ce0e9['attributes']:_0x1909f4[_0x3b6e('0x44')];if(!_0x4cbdbc[_0x3b6e('0x42')][_0x3b6e('0x49')](_0x3b6e('0x4a'))){_0x4ce0e9['limit']=qs['limit'](_0x4cbdbc[_0x3b6e('0x42')][_0x3b6e('0x25')]);_0x4ce0e9[_0x3b6e('0x22')]=qs[_0x3b6e('0x22')](_0x4cbdbc[_0x3b6e('0x42')]['offset']);}_0x4ce0e9[_0x3b6e('0x4b')]=qs[_0x3b6e('0x4c')](_0x4cbdbc['query'][_0x3b6e('0x4c')]);_0x4ce0e9[_0x3b6e('0x4d')]=qs[_0x3b6e('0x43')](_[_0x3b6e('0x4e')](_0x4cbdbc[_0x3b6e('0x42')],_0x1909f4[_0x3b6e('0x43')]),_0x41a4d5);var _0x3e7651=[];var _0x298531=squel[_0x3b6e('0x4f')]()[_0x3b6e('0x50')]('id')[_0x3b6e('0x50')]('name')[_0x3b6e('0x50')](_0x3b6e('0x51'))[_0x3b6e('0x52')](_0x3b6e('0x53'));var _0x1d83ad=squel[_0x3b6e('0x4f')]()[_0x3b6e('0x50')]('u.id')[_0x3b6e('0x50')](_0x3b6e('0x54'))[_0x3b6e('0x50')](_0x3b6e('0x55'))[_0x3b6e('0x52')](_0x3b6e('0x56'),'ui')[_0x3b6e('0x57')](_0x3b6e('0x58'),'u',_0x3b6e('0x59'));var _0x36be47=squel[_0x3b6e('0x4f')]()[_0x3b6e('0x52')](_0x3b6e('0x5a'),'i')[_0x3b6e('0x57')](_0x3b6e('0x5b'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x3b6e('0x57')](_0x3b6e('0x58'),'o',_0x3b6e('0x5c'))[_0x3b6e('0x57')](_0x3b6e('0x5d'),'a',_0x3b6e('0x5e'))[_0x3b6e('0x57')](_0x3b6e('0x5f'),'me',_0x3b6e('0x60'))[_0x3b6e('0x57')](_0x3b6e('0x61'),'it',_0x3b6e('0x62'))[_0x3b6e('0x57')](_0x3b6e('0x53'),'t','t.id\x20=\x20it.TagId');var _0x68564b=squel[_0x3b6e('0x63')]();var _0x46ae84=[];var _0x4a84a2=squel[_0x3b6e('0x63')]();var _0x43b5d7;if(_0x4cbdbc['query'][_0x3b6e('0x64')]){_0x43b5d7=as[_0x3b6e('0x65')](_0x4cbdbc[_0x3b6e('0x42')][_0x3b6e('0x64')]);var _0x58e201=_0x43b5d7['sqlOperator'];for(var _0x55b70a=0x0;_0x55b70a<_0x43b5d7[_0x3b6e('0x66')][_0x3b6e('0x48')];_0x55b70a++){var _0x1f806f=_0x43b5d7['conditions'][_0x55b70a];var _0xa15de2='i';var _0x25b308=_['find'](_0x41a4d5,[_0x3b6e('0x31'),_0x1f806f[_0x3b6e('0x50')]]);if(!_0x25b308){switch(_0x1f806f[_0x3b6e('0x50')]){case _0x3b6e('0x67'):if(_0x1f806f['value']==0x1){_0x36be47[_0x3b6e('0x68')]('`'+_0x1f806f[_0x3b6e('0x50')]+_0x3b6e('0x69'));}else{_0x36be47[_0x3b6e('0x68')]('`'+_0x1f806f[_0x3b6e('0x50')]+'`\x20>\x200');}break;case _0x3b6e('0x6a'):if(_0x1f806f[_0x3b6e('0x6b')]===_0x3b6e('0x6c')){if(_0x1f806f[_0x3b6e('0x6d')][_0x3b6e('0x38')]('\x20')[_0x3b6e('0x48')]>0x1){_0x68564b[_0x58e201]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x3b6e('0x6e')](_0x1f806f['value']),null);}else{var _0x2fe3bf='%'+_0x1f806f[_0x3b6e('0x6d')]+'%';_0x68564b[_0x58e201](_0x3b6e('0x6f'),_0x2fe3bf,_0x2fe3bf,_0x2fe3bf);}}else{_0x25b308=_[_0x3b6e('0x70')](_0x41a4d5,[_0x3b6e('0x31'),_0x3b6e('0x71')]);_0x1f806f[_0x3b6e('0x50')]='ContactId';_0x4338ab=as[_0x3b6e('0x72')](_0xa15de2,_0x25b308['type'],_0x1f806f);_0x68564b[_0x58e201](_0x4338ab['text'],_0x4338ab[_0x3b6e('0x6d')]['start'],_0x4338ab[_0x3b6e('0x6d')]['end']);}break;case'Tag':var _0x3000ea=_0x1f806f['value'][_0x3b6e('0x38')](',')[_0x3b6e('0x34')](function(_0x5519a2){return Number(_0x5519a2);});_0x3000ea[_0x3b6e('0x39')](function(_0xba808e){_0x4a84a2['or'](_0x3b6e('0x73'),'%,'+_0xba808e+',%');});_0x46ae84=_[_0x3b6e('0x74')](_0x46ae84,_0x3000ea);break;case _0x3b6e('0x75'):if(_0x1f806f[_0x3b6e('0x6b')]===_0x3b6e('0x6c')){_0x68564b[_0x58e201](_0x3b6e('0x76'),'%'+_0x1f806f['value']+'%',null);}else{_0x25b308=_[_0x3b6e('0x70')](_0x41a4d5,['name',_0x3b6e('0x77')]);_0x1f806f[_0x3b6e('0x50')]='UserId';_0x4338ab=as[_0x3b6e('0x72')](_0xa15de2,_0x25b308['type'],_0x1f806f);_0x68564b[_0x58e201](_0x4338ab['text'],_0x4338ab[_0x3b6e('0x6d')][_0x3b6e('0x78')],_0x4338ab[_0x3b6e('0x6d')]['end']);}break;case _0x3b6e('0x79'):_0x4338ab=as[_0x3b6e('0x72')]('me',null,_0x1f806f);_0x68564b[_0x58e201](_0x4338ab[_0x3b6e('0x7a')],_0x4338ab['value'][_0x3b6e('0x78')],_0x4338ab[_0x3b6e('0x6d')][_0x3b6e('0x2d')]);break;}}else{var _0x4338ab=as[_0x3b6e('0x72')](_0xa15de2,_0x25b308[_0x3b6e('0x40')],_0x1f806f);_0x68564b[_0x58e201](_0x4338ab[_0x3b6e('0x7a')],_0x4338ab[_0x3b6e('0x6d')]['start'],_0x4338ab['value']['end']);}}}else{var _0x1fb744=_(_0x4cbdbc[_0x3b6e('0x42')])[_0x3b6e('0x7b')]()[_0x3b6e('0x34')](function(_0x544c52){return _['some'](_0x41a4d5,[_0x3b6e('0x31'),_0x544c52])?_0x544c52:undefined;})[_0x3b6e('0x7c')]()[_0x3b6e('0x6d')]();if(!_['isEmpty'](_0x1fb744)){_0x1fb744['forEach'](function(_0x38b723){if(_0x38b723===_0x3b6e('0x7d')){_0x36be47[_0x3b6e('0x4d')](_0x3b6e('0x7e'),[][_0x3b6e('0x7f')](_0x4cbdbc[_0x3b6e('0x42')][_0x38b723]));}else if(_0x38b723===_0x3b6e('0x80')){var _0x91dba3=JSON['parse'](_0x4cbdbc[_0x3b6e('0x42')][_0x38b723])['$gte'];var _0x2fd138=JSON['parse'](_0x4cbdbc[_0x3b6e('0x42')][_0x38b723])[_0x3b6e('0x81')];_0x36be47['where'](_0x3b6e('0x82'),_0x91dba3,_0x2fd138);}else{if(_0x4cbdbc[_0x3b6e('0x42')][_0x38b723]===_0x3b6e('0x83')){_0x36be47[_0x3b6e('0x4d')]('i.'+_0x38b723+'\x20IS\x20NULL');}else{_0x36be47[_0x3b6e('0x4d')]('i.'+_0x38b723+'\x20=\x20?',_0x4cbdbc['query'][_0x38b723]);}}});}if(_0x4cbdbc[_0x3b6e('0x42')]['read']){if(_0x4cbdbc[_0x3b6e('0x42')][_0x3b6e('0x84')]==0x1){_0x36be47['having'](_0x3b6e('0x85'));}else{_0x36be47['having'](_0x3b6e('0x86'));}}if(_0x4cbdbc[_0x3b6e('0x42')][_0x3b6e('0x87')]){_0x46ae84=_[_0x3b6e('0x88')](_0x4cbdbc[_0x3b6e('0x42')]['tag'])?_0x4cbdbc[_0x3b6e('0x42')][_0x3b6e('0x87')]:new Array(_0x4cbdbc[_0x3b6e('0x42')][_0x3b6e('0x87')]);_0x46ae84[_0x3b6e('0x39')](function(_0x294ae){_0x4a84a2['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x294ae+',%');});}if(_0x4cbdbc[_0x3b6e('0x42')][_0x3b6e('0x89')]){var _0x1af70a=_0x4cbdbc[_0x3b6e('0x42')][_0x3b6e('0x89')][_0x3b6e('0x8a')]('\x5c','\x5c\x5c')[_0x3b6e('0x8a')](/'/g,'\x27\x27');if(qs[_0x3b6e('0x8b')](_0x1af70a)){_0x68564b['or'](_0x3b6e('0x8c'),_0x1af70a+'%')['or']('i.phone\x20LIKE\x20?',_0x1af70a+'%');}else{_0x68564b['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x3b6e('0x6e')](_0x1af70a))['or'](_0x3b6e('0x8d'),_0x1af70a+'%');}}}_0x36be47[_0x3b6e('0x4d')](_0x68564b);_0x36be47[_0x3b6e('0x8e')](_0x3b6e('0x8f'));var _0x4479f9={'type':db['Sequelize'][_0x3b6e('0x90')][_0x3b6e('0x91')],'raw':!![]};var _0x50069d=_0x36be47[_0x3b6e('0x92')]();_0x50069d[_0x3b6e('0x50')](_0x3b6e('0x8f'));_0x50069d[_0x3b6e('0x50')](_0x3b6e('0x93'),_0x3b6e('0x67'));if(_0x4ce0e9[_0x3b6e('0x4b')]){_0x4ce0e9['order'][_0x3b6e('0x39')](function(_0x46d1df){var _0x470c79=_0x46d1df[0x0]==='contactName'?_0x46d1df[0x0]:'i.'+_0x46d1df[0x0];_0x36be47['order'](_0x470c79,_0x46d1df[0x1]===_0x3b6e('0x94')?![]:!![]);});}if(!_[_0x3b6e('0x95')](_0x46ae84)){_0x36be47[_0x3b6e('0x68')](_0x4a84a2);_0x50069d[_0x3b6e('0x4d')](_0x3b6e('0x96'),_0x46ae84);}BPromise[_0x3b6e('0x97')]()['then'](function(){if(!_0x43b5d7){if(_0x4cbdbc[_0x3b6e('0x42')]['SmsAccountId'])return;_0x50069d[_0x3b6e('0x4d')](_0x3b6e('0x98'));_0x36be47['where']('i.SmsAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x4cbdbc[_0x3b6e('0x99')][_0x3b6e('0x9a')]!=='agent')return;return _0x4cbdbc[_0x3b6e('0x99')][_0x3b6e('0x9b')]({'attributes':['id'],'raw':!![]})[_0x3b6e('0x2b')](function(_0x47ddff){if(_[_0x3b6e('0x95')](_0x47ddff)){_0x50069d[_0x3b6e('0x4d')](_0x3b6e('0x9c'));_0x36be47[_0x3b6e('0x4d')](_0x3b6e('0x9c'));}else{_0x50069d[_0x3b6e('0x4d')](_0x3b6e('0x7e'),_[_0x3b6e('0x34')](_0x47ddff,'id'));_0x36be47[_0x3b6e('0x4d')](_0x3b6e('0x7e'),_[_0x3b6e('0x34')](_0x47ddff,'id'));}});})['then'](function(){if(_0x4cbdbc['user'][_0x3b6e('0x9a')]===_0x3b6e('0x9d')&&!_0x43b5d7&&!_0x4cbdbc[_0x3b6e('0x42')][_0x3b6e('0x7d')])return[];return db['sequelize'][_0x3b6e('0x42')](_0x50069d[_0x3b6e('0x9e')](),_0x4479f9);})[_0x3b6e('0x2b')](function(_0x51545c){_0x4cac70[_0x3b6e('0x24')]=_0x51545c[_0x3b6e('0x48')];if(_0x4cac70[_0x3b6e('0x24')]===0x0)return[];return db[_0x3b6e('0x9f')]['query'](_0x298531[_0x3b6e('0x9e')](),_0x4479f9)[_0x3b6e('0x2b')](function(_0x3a2f68){_0x3e7651=_[_0x3b6e('0xa0')](_0x3a2f68,'id');_0x4479f9=_['merge'](_0x4479f9,{'model':db[_0x3b6e('0x3d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4cbdbc['query']['fields']){_0x4ce0e9[_0x3b6e('0x47')][_0x3b6e('0x39')](function(_0x285915){_0x36be47[_0x3b6e('0x50')]('i.'+_0x285915);});}else{_0x36be47[_0x3b6e('0x50')](_0x3b6e('0x93'),_0x3b6e('0x67'));_0x36be47[_0x3b6e('0x50')](_0x3b6e('0xa1'),_0x3b6e('0xa2'));_0x36be47[_0x3b6e('0x50')]('a.mandatoryDisposition',_0x3b6e('0xa3'));_0x36be47['field'](_0x3b6e('0xa4'),_0x3b6e('0xa5'));_0x36be47[_0x3b6e('0x50')](_0x3b6e('0xa6'));_0x36be47[_0x3b6e('0x50')](_0x3b6e('0xa7'),_0x3b6e('0xa8'));_0x36be47['field'](_0x3b6e('0xa9'),_0x3b6e('0xaa'));_0x36be47[_0x3b6e('0x50')](_0x3b6e('0xab'),_0x3b6e('0xac'));_0x36be47[_0x3b6e('0x50')](_0x3b6e('0xad'),_0x3b6e('0xae'));_0x36be47[_0x3b6e('0x50')](_0x3b6e('0xaf'),_0x3b6e('0xb0'));_0x36be47['field'](_0x3b6e('0xb1'),_0x3b6e('0xb2'));_0x36be47[_0x3b6e('0x50')]('o.fullname',_0x3b6e('0xb3'));_0x36be47[_0x3b6e('0x50')](_0x3b6e('0xb4'),_0x3b6e('0xb5'));_0x36be47[_0x3b6e('0x50')](_0x3b6e('0xb6'),'TagIds');}if(_0x4ce0e9[_0x3b6e('0x25')])_0x36be47[_0x3b6e('0x25')](_0x4ce0e9[_0x3b6e('0x25')]);if(_0x4ce0e9['offset'])_0x36be47['offset'](_0x4ce0e9[_0x3b6e('0x22')]);return db[_0x3b6e('0x9f')]['query'](_0x36be47[_0x3b6e('0x9e')](),_0x4479f9);})[_0x3b6e('0x2b')](function(_0x992ea5){if(_0x992ea5['length']>0x0)_0x1d83ad['where']('ui.SmsInteractionId\x20IN\x20?',_[_0x3b6e('0x34')](_0x992ea5,'id'));return db['sequelize']['query'](_0x1d83ad[_0x3b6e('0x9e')](),_0x4479f9)['then'](function(_0x24b753){var _0x5ac9d6=_[_0x3b6e('0xb7')](_0x24b753,'SmsInteractionId');var _0x2c0acf=[];_0x992ea5[_0x3b6e('0x39')](function(_0x11ae0c){_0x2c0acf[_0x3b6e('0x3a')](updateSmsInteraction(_0x11ae0c,_0x3e7651,_0x5ac9d6));});return BPromise[_0x3b6e('0xb8')](_0x2c0acf);});});})['then'](function(_0x3eb4b1){_0x4cac70[_0x3b6e('0xb9')]=_0x3eb4b1;return _0x4cac70;})['then'](respondWithFilteredResult(_0x153fcb,_0x4ce0e9))[_0x3b6e('0x3b')](handleError(_0x153fcb,null));};exports[_0x3b6e('0xba')]=function(_0x2cf6e6,_0x41f488){var _0x4b859={'raw':![],'where':{'id':_0x2cf6e6[_0x3b6e('0xbb')]['id']}},_0x34c4a1={};_0x34c4a1['model']=_['keys'](db[_0x3b6e('0x3d')][_0x3b6e('0x3e')]);_0x34c4a1['query']=_[_0x3b6e('0x7b')](_0x2cf6e6[_0x3b6e('0x42')]);_0x34c4a1[_0x3b6e('0x43')]=_['intersection'](_0x34c4a1[_0x3b6e('0x44')],_0x34c4a1[_0x3b6e('0x42')]);_0x4b859[_0x3b6e('0x47')]=_[_0x3b6e('0x45')](_0x34c4a1['model'],qs[_0x3b6e('0x46')](_0x2cf6e6[_0x3b6e('0x42')]['fields']));_0x4b859[_0x3b6e('0x47')]=_0x4b859['attributes']['length']?_0x4b859['attributes']:_0x34c4a1[_0x3b6e('0x44')];if(_0x2cf6e6[_0x3b6e('0x42')]['includeAll']){_0x4b859[_0x3b6e('0xbc')]=[{'all':!![]}];}_0x4b859=_[_0x3b6e('0xbd')]({},_0x4b859,_0x2cf6e6[_0x3b6e('0xbe')]);return db['SmsInteraction']['find'](_0x4b859)[_0x3b6e('0x2b')](handleEntityNotFound(_0x41f488,null))[_0x3b6e('0x2b')](respondWithResult(_0x41f488,null))[_0x3b6e('0x3b')](handleError(_0x41f488,null));};exports['create']=function(_0x240a0d,_0x18ce1c){return db['SmsInteraction']['create'](_0x240a0d['body'],{})[_0x3b6e('0x2b')](respondWithResult(_0x18ce1c,0xc9))['catch'](handleError(_0x18ce1c,null));};exports['update']=function(_0x379078,_0x5ab12e){if(_0x379078[_0x3b6e('0x79')]['id']){delete _0x379078[_0x3b6e('0x79')]['id'];}return db[_0x3b6e('0x3d')][_0x3b6e('0x70')]({'where':{'id':_0x379078['params']['id']}})[_0x3b6e('0x2b')](handleEntityNotFound(_0x5ab12e,null))['then'](saveUpdates(_0x379078[_0x3b6e('0x79')],null))[_0x3b6e('0x2b')](respondWithResult(_0x5ab12e,null))['catch'](handleError(_0x5ab12e,null));};exports['destroy']=function(_0x351dd9,_0x560310){return db[_0x3b6e('0x3d')][_0x3b6e('0x70')]({'where':{'id':_0x351dd9[_0x3b6e('0xbb')]['id']}})[_0x3b6e('0x2b')](handleEntityNotFound(_0x560310,null))[_0x3b6e('0x2b')](removeEntity(_0x560310,null))[_0x3b6e('0x3b')](handleError(_0x560310,null));};exports[_0x3b6e('0xbf')]=function(_0x471446,_0x373b49){return db['SmsInteraction'][_0x3b6e('0xbf')]()[_0x3b6e('0x2b')](respondWithResult(_0x373b49,null))[_0x3b6e('0x3b')](handleError(_0x373b49,null));};exports[_0x3b6e('0xc0')]=function(_0x54f62d,_0xdc9575,_0x2f7241){return db['SmsMessage']['find']({'where':{'id':_0x54f62d[_0x3b6e('0xbb')]['id']}})[_0x3b6e('0x2b')](handleEntityNotFound(_0xdc9575,null))['then'](function(_0x145ef3){if(_0x145ef3){return _0x145ef3[_0x3b6e('0xc0')](_0x54f62d[_0x3b6e('0x79')][_0x3b6e('0xc1')],_['omit'](_0x54f62d[_0x3b6e('0x79')],[_0x3b6e('0xc1'),'id'])||{});}})[_0x3b6e('0x2b')](respondWithResult(_0xdc9575,null))[_0x3b6e('0x3b')](handleError(_0xdc9575,null));};exports[_0x3b6e('0xc2')]=function(_0x16ad58,_0x2f1d58,_0xffe6fd){var _0x18cb6b={'raw':![],'where':{}};var _0x2360de={};var _0x230191={'count':0x0,'rows':[]};return db[_0x3b6e('0x3d')][_0x3b6e('0xc3')]({'where':{'id':_0x16ad58['params']['id']}})[_0x3b6e('0x2b')](handleEntityNotFound(_0x2f1d58,null))[_0x3b6e('0x2b')](function(_0x1e99c3){if(_0x1e99c3){_0x2360de[_0x3b6e('0x44')]=_['keys'](db[_0x3b6e('0xc4')]['rawAttributes']);_0x2360de[_0x3b6e('0x42')]=_[_0x3b6e('0x7b')](_0x16ad58[_0x3b6e('0x42')]);_0x2360de[_0x3b6e('0x43')]=_[_0x3b6e('0x45')](_0x2360de['model'],_0x2360de[_0x3b6e('0x42')]);_0x18cb6b['attributes']=_[_0x3b6e('0x45')](_0x2360de[_0x3b6e('0x44')],qs['fields'](_0x16ad58[_0x3b6e('0x42')][_0x3b6e('0x46')]));_0x18cb6b[_0x3b6e('0x47')]=_0x18cb6b['attributes'][_0x3b6e('0x48')]?_0x18cb6b[_0x3b6e('0x47')]:_0x2360de['model'];if(!_0x16ad58[_0x3b6e('0x42')][_0x3b6e('0x49')]('nolimit')){_0x18cb6b['limit']=qs[_0x3b6e('0x25')](_0x16ad58['query'][_0x3b6e('0x25')]);_0x18cb6b[_0x3b6e('0x22')]=qs[_0x3b6e('0x22')](_0x16ad58['query'][_0x3b6e('0x22')]);}_0x18cb6b[_0x3b6e('0x4b')]=qs['sort'](_0x16ad58[_0x3b6e('0x42')][_0x3b6e('0x4c')]);_0x18cb6b[_0x3b6e('0x4d')]=qs['filters'](_[_0x3b6e('0x4e')](_0x16ad58[_0x3b6e('0x42')],_0x2360de[_0x3b6e('0x43')]));_0x18cb6b[_0x3b6e('0x4d')][_0x3b6e('0xc5')]=_0x1e99c3['id'];if(_0x16ad58[_0x3b6e('0x42')][_0x3b6e('0x89')]){_0x18cb6b[_0x3b6e('0x4d')]=_[_0x3b6e('0xbd')](_0x18cb6b['where'],{'$or':_[_0x3b6e('0x34')](_0x18cb6b[_0x3b6e('0x47')],function(_0x2b14a0){var _0x4251bf={};_0x4251bf[_0x2b14a0]={'$like':'%'+_0x16ad58['query'][_0x3b6e('0x89')]+'%'};return _0x4251bf;})});}if(_0x16ad58['query'][_0x3b6e('0xc6')]){var _0x20fa8e=_0x16ad58[_0x3b6e('0x42')][_0x3b6e('0xc6')][_0x3b6e('0x38')](',');var _0x2f423a={};_0x2f423a[_0x20fa8e[0x0]]={'$gte':moment(_0x20fa8e[0x1])[_0x3b6e('0xc7')](_0x3b6e('0xc8'))};_0x18cb6b[_0x3b6e('0x4d')]=_[_0x3b6e('0xbd')](_0x18cb6b[_0x3b6e('0x4d')],_0x2f423a);}_0x18cb6b=_[_0x3b6e('0xbd')]({},_0x18cb6b,_0x16ad58[_0x3b6e('0xbe')]);return db['SmsMessage'][_0x3b6e('0x24')]({'where':_0x18cb6b['where']})[_0x3b6e('0x2b')](function(_0x3aab86){_0x230191[_0x3b6e('0x24')]=_0x3aab86;if(_0x16ad58['query'][_0x3b6e('0xc9')]){_0x18cb6b[_0x3b6e('0xbc')]=[{'all':!![]}];}return db[_0x3b6e('0xc4')][_0x3b6e('0xca')](_0x18cb6b);})[_0x3b6e('0x2b')](function(_0x1b1db9){_0x230191[_0x3b6e('0xb9')]=_0x1b1db9;return _0x230191;});}})['then'](respondWithFilteredResult(_0x2f1d58,_0x18cb6b))['catch'](handleError(_0x2f1d58,null));};exports['addTags']=function(_0x36fc3a,_0xc65a46,_0x870eae){return db[_0x3b6e('0x3d')][_0x3b6e('0x70')]({'where':{'id':_0x36fc3a[_0x3b6e('0xbb')]['id']}})[_0x3b6e('0x2b')](handleEntityNotFound(_0xc65a46,null))[_0x3b6e('0x2b')](function(_0x2dacef){if(_0x2dacef){return _0x2dacef[_0x3b6e('0xcb')](_0x36fc3a[_0x3b6e('0x79')][_0x3b6e('0xc1')],_[_0x3b6e('0xcc')](_0x36fc3a['body'],[_0x3b6e('0xc1'),'id'])||{})[_0x3b6e('0xcd')](function(){return db['Tag']['findAll']({'attributes':['id',_0x3b6e('0x31'),_0x3b6e('0x51')],'where':{'id':_0x36fc3a[_0x3b6e('0x79')][_0x3b6e('0xc1')]}});})['then'](function(_0x1e0653){socket[_0x3b6e('0xce')]('smsInteractionTags:save',{'id':Number(_0x36fc3a[_0x3b6e('0xbb')]['id']),'tags':_0x1e0653||[]});return{'id':Number(_0x36fc3a[_0x3b6e('0xbb')]['id']),'tags':_0x1e0653||[]};});}})[_0x3b6e('0x2b')](respondWithResult(_0xc65a46,null))[_0x3b6e('0x3b')](handleError(_0xc65a46,null));};exports[_0x3b6e('0xcf')]=function(_0x151f99,_0x268fec,_0x31532c){return db[_0x3b6e('0x3d')]['find']({'where':{'id':_0x151f99['params']['id']}})[_0x3b6e('0x2b')](handleEntityNotFound(_0x268fec,null))[_0x3b6e('0x2b')](function(_0x723cb5){if(_0x723cb5){return _0x723cb5[_0x3b6e('0xcf')](_0x151f99[_0x3b6e('0x42')]['ids']);}})['then'](respondWithStatusCode(_0x268fec,null))['catch'](handleError(_0x268fec,null));};exports[_0x3b6e('0xd0')]=function(_0x24217b,_0x27d09f){var _0x367f6c=moment()[_0x3b6e('0xd1')]()[_0x3b6e('0x9e')]();var _0x4a4b60=path['join'](config[_0x3b6e('0xd2')],_0x3b6e('0xd3'),'files','tmp');var _0x150e2a=path[_0x3b6e('0xd4')](config['root'],_0x3b6e('0xd3'),'files',_0x3b6e('0xd5'));var _0x18327a=path[_0x3b6e('0xd4')](_0x4a4b60,_0x367f6c);var _0x1fe42d=util[_0x3b6e('0xc7')](_0x3b6e('0xd6'),_0x24217b['params']['id'],_0x367f6c);var _0x4dd846=path['join'](_0x4a4b60,_0x1fe42d);var _0x46d422=[];_0x46d422[_0x3b6e('0x3a')]({'model':db[_0x3b6e('0x75')],'as':'User','attributes':['id',_0x3b6e('0x35')],'raw':!![]});_0x46d422[_0x3b6e('0x3a')]({'model':db[_0x3b6e('0xd7')],'as':'Contact','attributes':['id',_0x3b6e('0xd8'),_0x3b6e('0xd9')],'raw':!![]});var _0x427396=[{'model':db[_0x3b6e('0xc4')],'as':_0x3b6e('0xda'),'attributes':['id',_0x3b6e('0x79'),_0x3b6e('0x80'),'direction','secret',_0x3b6e('0x84')],'include':_0x46d422}];_0x427396[_0x3b6e('0x3a')]({'model':db[_0x3b6e('0xdb')],'as':_0x3b6e('0xdc'),'attributes':['id',_0x3b6e('0x31')]});_0x427396[_0x3b6e('0x3a')]({'model':db[_0x3b6e('0x75')],'as':_0x3b6e('0xdd'),'attributes':['id',_0x3b6e('0x35')]});return db[_0x3b6e('0x3d')][_0x3b6e('0x70')]({'where':{'id':_0x24217b[_0x3b6e('0xbb')]['id']},'include':_0x427396})[_0x3b6e('0x2b')](handleEntityNotFound(_0x27d09f,null))[_0x3b6e('0x2b')](function(_0x316977){if(_0x316977){var _0x1d0207=_0x316977['get']({'plain':!![]});fs[_0x3b6e('0xde')](_0x18327a);var _0x478c08={'channel':'Sms','account':_0x1d0207[_0x3b6e('0xdc')][_0x3b6e('0x31')],'agent':_0x1d0207[_0x3b6e('0xdd')]?_0x1d0207[_0x3b6e('0xdd')]['fullname']:_0x3b6e('0xdf'),'createdAt':moment(_0x1d0207[_0x3b6e('0x80')])[_0x3b6e('0xc7')](_0x3b6e('0xc8'))[_0x3b6e('0x9e')](),'closedAt':_0x1d0207[_0x3b6e('0xe0')]?moment(_0x1d0207[_0x3b6e('0xe1')])['format'](_0x3b6e('0xc8'))[_0x3b6e('0x9e')]():'','disposition':_0x1d0207['disposition'],'messages':_(_0x1d0207[_0x3b6e('0xda')])[_0x3b6e('0x89')]({'secret':![]})[_0x3b6e('0x34')](function(_0x43f8bb){return{'date':moment(_0x43f8bb['createdAt'])[_0x3b6e('0xc7')](_0x3b6e('0xc8'))[_0x3b6e('0x9e')](),'sender':_0x43f8bb[_0x3b6e('0xe2')]===_0x3b6e('0xe3')?_0x43f8bb[_0x3b6e('0x75')]?_0x43f8bb[_0x3b6e('0x75')][_0x3b6e('0x35')]:'System':_0x43f8bb[_0x3b6e('0x6a')][_0x3b6e('0xd8')]+(_0x43f8bb[_0x3b6e('0x6a')][_0x3b6e('0xd9')]?'\x20'+_0x43f8bb[_0x3b6e('0x6a')][_0x3b6e('0xd9')]:''),'body':_0x43f8bb['body'],'direction':_0x43f8bb[_0x3b6e('0xe2')]===_0x3b6e('0xe3')?'A':'C','secret':_0x43f8bb[_0x3b6e('0xe4')],'read':_0x43f8bb[_0x3b6e('0x84')]};})[_0x3b6e('0x6d')]()};return ejs[_0x3b6e('0xe5')](path[_0x3b6e('0xd4')](config[_0x3b6e('0xd2')],'server',_0x3b6e('0xe6'),_0x3b6e('0xe7')),{'interaction':_0x478c08})[_0x3b6e('0x2b')](function(_0x201ef6){var _0x4c2d43=path['join'](_0x18327a,_0x3b6e('0xe8')+_0x1d0207['id']+'-'+_0x367f6c+_0x3b6e('0xe9'));var _0x508970={'path':_0x4c2d43,'channel':_0x3b6e('0xea'),'interactionId':_0x1d0207['id']};return pdf[_0x3b6e('0xeb')](_0x201ef6,_0x508970);})['then'](function(){return new BPromise(function(_0x1efde9,_0x40acb4){zipdir(_0x18327a,{'saveTo':_0x4dd846},function(_0x184ed6,_0x28add0){if(_0x184ed6)return _0x40acb4(_0x184ed6);return _0x1efde9(_0x28add0);});})[_0x3b6e('0x2b')](function(){return new BPromise(function(_0xdac8be,_0x258d86){rimraf(_0x18327a,function(_0x27a73f){if(_0x27a73f)_0x258d86(_0x27a73f);return _0xdac8be();});});})[_0x3b6e('0x2b')](function(){return _0x27d09f[_0x3b6e('0xd0')](_0x4dd846,_0x1fe42d,function(_0x294b63){if(_0x294b63){console[_0x3b6e('0xec')]('err',_0x294b63);}else{fs['unlinkSync'](_0x4dd846);}});});});}else{return _0x27d09f[_0x3b6e('0x2e')](0xc8);}})[_0x3b6e('0x3b')](handleError(_0x27d09f,null));}; \ No newline at end of file +var _0xae3e=['findAll','addTags','spread','smsInteractionTags:save','removeTags','download','root','join','server','files','attachments','format','transcript-%d-%s.zip','CmContact','firstName','lastName','Messages','direction','User','get','mkdirSync','Account','Owner','N.A.','closed','closedAt','disposition','out','System','Contact','secret','renderFile','views','transcript-','.pdf','log','err','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','status','end','json','undefined','limit','offset','count','set','apply','reject','then','destroy','sendStatus','error','stack','name','send','map','fullname','TagIds','split','forEach','push','catch','index','SmsInteraction','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','sms_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','value','having','`\x20=\x200','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','isEmpty','SmsAccountId','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','read','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','contactName','DESC','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','unreadMessages','a.key','Account.key','Account.mandatoryDisposition','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','rows','show','includeAll','options','create','update','params','describe','addMessage','SmsMessage','ids','omit','getMessages','$gte','YYYY-MM-DD\x20HH:mm:ss','include'];(function(_0x51e475,_0x5bdaeb){var _0x1cf546=function(_0x46561c){while(--_0x46561c){_0x51e475['push'](_0x51e475['shift']());}};_0x1cf546(++_0x5bdaeb);}(_0xae3e,0x10b));var _0xeae3=function(_0x5a452e,_0x355a90){_0x5a452e=_0x5a452e-0x0;var _0x2c4c43=_0xae3e[_0x5a452e];return _0x2c4c43;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeae3('0x0'));var zipdir=require(_0xeae3('0x1'));var jsonpatch=require(_0xeae3('0x2'));var rp=require(_0xeae3('0x3'));var moment=require(_0xeae3('0x4'));var BPromise=require(_0xeae3('0x5'));var Mustache=require(_0xeae3('0x6'));var util=require(_0xeae3('0x7'));var path=require(_0xeae3('0x8'));var sox=require(_0xeae3('0x9'));var csv=require(_0xeae3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeae3('0xb'));var squel=require(_0xeae3('0xc'));var crypto=require(_0xeae3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xeae3('0xe'));var toCsv=require('to-csv');var querystring=require(_0xeae3('0xf'));var Papa=require(_0xeae3('0x10'));var Redis=require(_0xeae3('0x11'));var authService=require(_0xeae3('0x12'));var qs=require(_0xeae3('0x13'));var as=require(_0xeae3('0x14'));var pdf=require(_0xeae3('0x15'));var hardwareService=require(_0xeae3('0x16'));var logger=require(_0xeae3('0x17'))('api');var utils=require('../../config/utils');var config=require(_0xeae3('0x18'));var licenseUtil=require(_0xeae3('0x19'));var db=require(_0xeae3('0x1a'))['db'];config[_0xeae3('0x1b')]=_[_0xeae3('0x1c')](config[_0xeae3('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xeae3('0x1d'))(new Redis(config[_0xeae3('0x1b')]));require('./smsInteraction.socket')[_0xeae3('0x1e')](socket);function respondWithStatusCode(_0x3a8701,_0x59cfa1){_0x59cfa1=_0x59cfa1||0xcc;return function(_0x455c8f){if(_0x455c8f){return _0x3a8701['sendStatus'](_0x59cfa1);}return _0x3a8701[_0xeae3('0x1f')](_0x59cfa1)[_0xeae3('0x20')]();};}function respondWithResult(_0x550c6b,_0x40265a){_0x40265a=_0x40265a||0xc8;return function(_0x2391e1){if(_0x2391e1){return _0x550c6b['status'](_0x40265a)[_0xeae3('0x21')](_0x2391e1);}};}function respondWithFilteredResult(_0x4acc13,_0x2bff4b){return function(_0x152b8e){if(_0x152b8e){var _0x4c6263=typeof _0x2bff4b['offset']===_0xeae3('0x22')&&typeof _0x2bff4b[_0xeae3('0x23')]==='undefined';var _0x2dbc69=_0x152b8e['count'];var _0x2eaae1=_0x4c6263?0x0:_0x2bff4b[_0xeae3('0x24')];var _0x278c8e=_0x4c6263?_0x152b8e[_0xeae3('0x25')]:_0x2bff4b[_0xeae3('0x24')]+_0x2bff4b[_0xeae3('0x23')];var _0x4634de;if(_0x278c8e>=_0x2dbc69){_0x278c8e=_0x2dbc69;_0x4634de=0xc8;}else{_0x4634de=0xce;}_0x4acc13[_0xeae3('0x1f')](_0x4634de);return _0x4acc13[_0xeae3('0x26')]('Content-Range',_0x2eaae1+'-'+_0x278c8e+'/'+_0x2dbc69)[_0xeae3('0x21')](_0x152b8e);}return null;};}function patchUpdates(_0x16ce8e){return function(_0x1bb844){try{jsonpatch[_0xeae3('0x27')](_0x1bb844,_0x16ce8e,!![]);}catch(_0x572366){return BPromise[_0xeae3('0x28')](_0x572366);}return _0x1bb844['save']();};}function saveUpdates(_0x3e1839,_0x215959){return function(_0x600750){if(_0x600750){return _0x600750['update'](_0x3e1839)[_0xeae3('0x29')](function(_0xc1460b){return _0xc1460b;});}return null;};}function removeEntity(_0x3344c4,_0x56913b){return function(_0x56f74e){if(_0x56f74e){return _0x56f74e[_0xeae3('0x2a')]()[_0xeae3('0x29')](function(){_0x3344c4[_0xeae3('0x1f')](0xcc)[_0xeae3('0x20')]();});}};}function handleEntityNotFound(_0x480e7c,_0x415b45){return function(_0x31a72b){if(!_0x31a72b){_0x480e7c[_0xeae3('0x2b')](0x194);}return _0x31a72b;};}function handleError(_0x18ea26,_0x590b7b){_0x590b7b=_0x590b7b||0x1f4;return function(_0x3cc895){logger[_0xeae3('0x2c')](_0x3cc895[_0xeae3('0x2d')]);if(_0x3cc895[_0xeae3('0x2e')]){delete _0x3cc895[_0xeae3('0x2e')];}_0x18ea26[_0xeae3('0x1f')](_0x590b7b)[_0xeae3('0x2f')](_0x3cc895);};}function getInteractionUsers(_0x38d7bd,_0x440b8b){return new BPromise(function(_0x1be573,_0x138a65){try{if(_0x440b8b[_0x38d7bd['id']]){_0x38d7bd['Users']=_[_0xeae3('0x30')](_0x440b8b[_0x38d7bd['id']],function(_0x3987aa){return{'id':_0x3987aa['id'],'fullname':_0x3987aa[_0xeae3('0x31')]};});}}catch(_0x37c2d7){_0x138a65(_0x37c2d7);}_0x1be573(_0x38d7bd);});}function getInteractionTags(_0x3332b3,_0x7311d){return new BPromise(function(_0x2011ea,_0x4a475f){try{if(_0x3332b3[_0xeae3('0x32')]){_0x3332b3['Tags']=[];_0x3332b3[_0xeae3('0x32')][_0xeae3('0x33')](',')[_0xeae3('0x34')](function(_0x46aa69){_0x3332b3['Tags'][_0xeae3('0x35')](_0x7311d[_0x46aa69]);});}delete _0x3332b3['TagIds'];}catch(_0x1b7535){_0x4a475f(_0x1b7535);}_0x2011ea(_0x3332b3);});}function updateSmsInteraction(_0x3d502b,_0x213ddd,_0xa16668){return new BPromise(function(_0x11ea86,_0x42c723){return getInteractionUsers(_0x3d502b,_0xa16668)[_0xeae3('0x29')](function(_0x2ae8d6){return getInteractionTags(_0x2ae8d6,_0x213ddd);})[_0xeae3('0x29')](function(_0x21bab1){_0x11ea86(_0x21bab1);})[_0xeae3('0x36')](function(_0x23eccb){_0x42c723(_0x23eccb);});});}exports[_0xeae3('0x37')]=function(_0xa95506,_0x258725){var _0x273bd4={},_0x7d8904={},_0x455210={'count':0x0,'rows':[]};var _0x74dfbc=_[_0xeae3('0x30')](db[_0xeae3('0x38')][_0xeae3('0x39')],function(_0xfe83c9){return{'name':_0xfe83c9[_0xeae3('0x3a')],'type':_0xfe83c9[_0xeae3('0x3b')][_0xeae3('0x3c')]};});_0x7d8904['model']=_['map'](_0x74dfbc,_0xeae3('0x2e'));_0x7d8904[_0xeae3('0x3d')]=_[_0xeae3('0x3e')](_0xa95506[_0xeae3('0x3d')]);_0x7d8904[_0xeae3('0x3f')]=_[_0xeae3('0x40')](_0x7d8904['model'],_0x7d8904[_0xeae3('0x3d')]);_0x273bd4[_0xeae3('0x41')]=_['intersection'](_0x7d8904[_0xeae3('0x42')],qs[_0xeae3('0x43')](_0xa95506[_0xeae3('0x3d')][_0xeae3('0x43')]));_0x273bd4[_0xeae3('0x41')]=_0x273bd4[_0xeae3('0x41')][_0xeae3('0x44')]?_0x273bd4[_0xeae3('0x41')]:_0x7d8904[_0xeae3('0x42')];if(!_0xa95506['query'][_0xeae3('0x45')](_0xeae3('0x46'))){_0x273bd4[_0xeae3('0x23')]=qs[_0xeae3('0x23')](_0xa95506[_0xeae3('0x3d')][_0xeae3('0x23')]);_0x273bd4['offset']=qs[_0xeae3('0x24')](_0xa95506[_0xeae3('0x3d')][_0xeae3('0x24')]);}_0x273bd4[_0xeae3('0x47')]=qs[_0xeae3('0x48')](_0xa95506[_0xeae3('0x3d')]['sort']);_0x273bd4[_0xeae3('0x49')]=qs[_0xeae3('0x3f')](_[_0xeae3('0x4a')](_0xa95506[_0xeae3('0x3d')],_0x7d8904[_0xeae3('0x3f')]),_0x74dfbc);var _0x21bbe5=[];var _0x4e0c78=squel[_0xeae3('0x4b')]()[_0xeae3('0x4c')]('id')[_0xeae3('0x4c')]('name')[_0xeae3('0x4c')](_0xeae3('0x4d'))[_0xeae3('0x4e')](_0xeae3('0x4f'));var _0xb493b8=squel['select']()[_0xeae3('0x4c')]('u.id')[_0xeae3('0x4c')](_0xeae3('0x50'))['field'](_0xeae3('0x51'))[_0xeae3('0x4e')](_0xeae3('0x52'),'ui')[_0xeae3('0x53')]('users','u','u.id\x20=\x20ui.UserId');var _0x50adee=squel[_0xeae3('0x4b')]()[_0xeae3('0x4e')]('sms_interactions','i')[_0xeae3('0x53')](_0xeae3('0x54'),'c',_0xeae3('0x55'))['left_join'](_0xeae3('0x56'),'o',_0xeae3('0x57'))[_0xeae3('0x53')](_0xeae3('0x58'),'a',_0xeae3('0x59'))[_0xeae3('0x53')](_0xeae3('0x5a'),'me','me.SmsInteractionId\x20=\x20i.id')[_0xeae3('0x53')](_0xeae3('0x5b'),'it','it.SmsInteractionId\x20=\x20i.id')[_0xeae3('0x53')]('tools_tags','t',_0xeae3('0x5c'));var _0x3b0dcc=squel[_0xeae3('0x5d')]();var _0x5e1097=[];var _0x16fbf9=squel[_0xeae3('0x5d')]();var _0x36d7bf;if(_0xa95506[_0xeae3('0x3d')][_0xeae3('0x5e')]){_0x36d7bf=as['parseSearch'](_0xa95506[_0xeae3('0x3d')][_0xeae3('0x5e')]);var _0x2788ef=_0x36d7bf[_0xeae3('0x5f')];for(var _0xbe52dc=0x0;_0xbe52dc<_0x36d7bf['conditions'][_0xeae3('0x44')];_0xbe52dc++){var _0x3a9794=_0x36d7bf[_0xeae3('0x60')][_0xbe52dc];var _0x28fcd2='i';var _0x150e00=_[_0xeae3('0x61')](_0x74dfbc,[_0xeae3('0x2e'),_0x3a9794['field']]);if(!_0x150e00){switch(_0x3a9794[_0xeae3('0x4c')]){case'unreadMessages':if(_0x3a9794[_0xeae3('0x62')]==0x1){_0x50adee[_0xeae3('0x63')]('`'+_0x3a9794['field']+_0xeae3('0x64'));}else{_0x50adee[_0xeae3('0x63')]('`'+_0x3a9794[_0xeae3('0x4c')]+'`\x20>\x200');}break;case'Contact':if(_0x3a9794[_0xeae3('0x65')]==='$substring'){if(_0x3a9794[_0xeae3('0x62')][_0xeae3('0x33')]('\x20')['length']>0x1){_0x3b0dcc[_0x2788ef](_0xeae3('0x66'),qs[_0xeae3('0x67')](_0x3a9794['value']),null);}else{var _0x2a0d4c='%'+_0x3a9794[_0xeae3('0x62')]+'%';_0x3b0dcc[_0x2788ef](_0xeae3('0x68'),_0x2a0d4c,_0x2a0d4c,_0x2a0d4c);}}else{_0x150e00=_[_0xeae3('0x61')](_0x74dfbc,['name','ContactId']);_0x3a9794[_0xeae3('0x4c')]=_0xeae3('0x69');_0x27795e=as[_0xeae3('0x6a')](_0x28fcd2,_0x150e00[_0xeae3('0x3b')],_0x3a9794);_0x3b0dcc[_0x2788ef](_0x27795e[_0xeae3('0x6b')],_0x27795e[_0xeae3('0x62')][_0xeae3('0x6c')],_0x27795e[_0xeae3('0x62')][_0xeae3('0x20')]);}break;case _0xeae3('0x6d'):var _0x75d557=_0x3a9794[_0xeae3('0x62')]['split'](',')[_0xeae3('0x30')](function(_0x3b956f){return Number(_0x3b956f);});_0x75d557[_0xeae3('0x34')](function(_0x522412){_0x16fbf9['or'](_0xeae3('0x6e'),'%,'+_0x522412+',%');});_0x5e1097=_['union'](_0x5e1097,_0x75d557);break;case'User':if(_0x3a9794[_0xeae3('0x65')]===_0xeae3('0x6f')){_0x3b0dcc[_0x2788ef](_0xeae3('0x70'),'%'+_0x3a9794['value']+'%',null);}else{_0x150e00=_[_0xeae3('0x61')](_0x74dfbc,['name',_0xeae3('0x71')]);_0x3a9794['field']=_0xeae3('0x71');_0x27795e=as[_0xeae3('0x6a')](_0x28fcd2,_0x150e00[_0xeae3('0x3b')],_0x3a9794);_0x3b0dcc[_0x2788ef](_0x27795e[_0xeae3('0x6b')],_0x27795e[_0xeae3('0x62')][_0xeae3('0x6c')],_0x27795e[_0xeae3('0x62')][_0xeae3('0x20')]);}break;case _0xeae3('0x72'):_0x27795e=as[_0xeae3('0x6a')]('me',null,_0x3a9794);_0x3b0dcc[_0x2788ef](_0x27795e[_0xeae3('0x6b')],_0x27795e['value'][_0xeae3('0x6c')],_0x27795e[_0xeae3('0x62')][_0xeae3('0x20')]);break;}}else{var _0x27795e=as['buildExpression'](_0x28fcd2,_0x150e00[_0xeae3('0x3b')],_0x3a9794);_0x3b0dcc[_0x2788ef](_0x27795e[_0xeae3('0x6b')],_0x27795e[_0xeae3('0x62')]['start'],_0x27795e[_0xeae3('0x62')][_0xeae3('0x20')]);}}}else{var _0x95ddd=_(_0xa95506[_0xeae3('0x3d')])[_0xeae3('0x3e')]()['map'](function(_0xda0a0){return _[_0xeae3('0x73')](_0x74dfbc,['name',_0xda0a0])?_0xda0a0:undefined;})[_0xeae3('0x74')]()['value']();if(!_[_0xeae3('0x75')](_0x95ddd)){_0x95ddd[_0xeae3('0x34')](function(_0x1aaacc){if(_0x1aaacc===_0xeae3('0x76')){_0x50adee['where']('i.SmsAccountId\x20IN\x20?',[][_0xeae3('0x77')](_0xa95506['query'][_0x1aaacc]));}else if(_0x1aaacc===_0xeae3('0x78')){var _0x21d0e7=JSON[_0xeae3('0x79')](_0xa95506['query'][_0x1aaacc])['$gte'];var _0x4e49f3=JSON['parse'](_0xa95506['query'][_0x1aaacc])[_0xeae3('0x7a')];_0x50adee['where'](_0xeae3('0x7b'),_0x21d0e7,_0x4e49f3);}else{if(_0xa95506['query'][_0x1aaacc]==='null'){_0x50adee[_0xeae3('0x49')]('i.'+_0x1aaacc+'\x20IS\x20NULL');}else{_0x50adee['where']('i.'+_0x1aaacc+_0xeae3('0x7c'),_0xa95506[_0xeae3('0x3d')][_0x1aaacc]);}}});}if(_0xa95506[_0xeae3('0x3d')][_0xeae3('0x7d')]){if(_0xa95506['query'][_0xeae3('0x7d')]==0x1){_0x50adee[_0xeae3('0x63')]('`unreadMessages`\x20=\x200');}else{_0x50adee[_0xeae3('0x63')]('`unreadMessages`\x20>\x200');}}if(_0xa95506[_0xeae3('0x3d')]['tag']){_0x5e1097=_['isArray'](_0xa95506[_0xeae3('0x3d')][_0xeae3('0x7e')])?_0xa95506['query']['tag']:new Array(_0xa95506[_0xeae3('0x3d')][_0xeae3('0x7e')]);_0x5e1097['forEach'](function(_0x5dc5f7){_0x16fbf9['or'](_0xeae3('0x6e'),'%,'+_0x5dc5f7+',%');});}if(_0xa95506['query']['filter']){var _0x187f57=_0xa95506['query'][_0xeae3('0x7f')][_0xeae3('0x80')]('\x5c','\x5c\x5c')[_0xeae3('0x80')](/'/g,'\x27\x27');if(qs[_0xeae3('0x81')](_0x187f57)){_0x3b0dcc['or'](_0xeae3('0x82'),_0x187f57+'%')['or'](_0xeae3('0x83'),_0x187f57+'%');}else{_0x3b0dcc['or'](_0xeae3('0x84'),qs[_0xeae3('0x67')](_0x187f57))['or'](_0xeae3('0x85'),_0x187f57+'%');}}}_0x50adee[_0xeae3('0x49')](_0x3b0dcc);_0x50adee['group'](_0xeae3('0x86'));var _0x525630={'type':db[_0xeae3('0x87')][_0xeae3('0x88')][_0xeae3('0x89')],'raw':!![]};var _0x3d7219=_0x50adee[_0xeae3('0x8a')]();_0x3d7219[_0xeae3('0x4c')](_0xeae3('0x86'));_0x3d7219[_0xeae3('0x4c')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x273bd4[_0xeae3('0x47')]){_0x273bd4['order'][_0xeae3('0x34')](function(_0x39ae7f){var _0x4fd57e=_0x39ae7f[0x0]===_0xeae3('0x8b')?_0x39ae7f[0x0]:'i.'+_0x39ae7f[0x0];_0x50adee[_0xeae3('0x47')](_0x4fd57e,_0x39ae7f[0x1]===_0xeae3('0x8c')?![]:!![]);});}if(!_['isEmpty'](_0x5e1097)){_0x50adee[_0xeae3('0x63')](_0x16fbf9);_0x3d7219[_0xeae3('0x49')](_0xeae3('0x8d'),_0x5e1097);}BPromise[_0xeae3('0x8e')]()['then'](function(){if(!_0x36d7bf){if(_0xa95506[_0xeae3('0x3d')][_0xeae3('0x76')])return;_0x3d7219['where'](_0xeae3('0x8f'));_0x50adee[_0xeae3('0x49')](_0xeae3('0x8f'));return;}if(_0xa95506[_0xeae3('0x90')][_0xeae3('0x91')]!==_0xeae3('0x92'))return;return _0xa95506['user'][_0xeae3('0x93')]({'attributes':['id'],'raw':!![]})[_0xeae3('0x29')](function(_0x23a01c){if(_[_0xeae3('0x75')](_0x23a01c)){_0x3d7219[_0xeae3('0x49')](_0xeae3('0x94'));_0x50adee[_0xeae3('0x49')](_0xeae3('0x94'));}else{_0x3d7219['where'](_0xeae3('0x95'),_[_0xeae3('0x30')](_0x23a01c,'id'));_0x50adee[_0xeae3('0x49')]('i.SmsAccountId\x20IN\x20?',_[_0xeae3('0x30')](_0x23a01c,'id'));}});})[_0xeae3('0x29')](function(){if(_0xa95506['user'][_0xeae3('0x91')]==='agent'&&!_0x36d7bf&&!_0xa95506[_0xeae3('0x3d')][_0xeae3('0x76')])return[];return db[_0xeae3('0x96')][_0xeae3('0x3d')](_0x3d7219['toString'](),_0x525630);})[_0xeae3('0x29')](function(_0x35dfc0){_0x455210[_0xeae3('0x25')]=_0x35dfc0[_0xeae3('0x44')];if(_0x455210[_0xeae3('0x25')]===0x0)return[];return db['sequelize'][_0xeae3('0x3d')](_0x4e0c78[_0xeae3('0x97')](),_0x525630)[_0xeae3('0x29')](function(_0xe03dbc){_0x21bbe5=_[_0xeae3('0x98')](_0xe03dbc,'id');_0x525630=_[_0xeae3('0x99')](_0x525630,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xa95506[_0xeae3('0x3d')][_0xeae3('0x43')]){_0x273bd4[_0xeae3('0x41')][_0xeae3('0x34')](function(_0xfb446){_0x50adee[_0xeae3('0x4c')]('i.'+_0xfb446);});}else{_0x50adee[_0xeae3('0x4c')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xeae3('0x9a'));_0x50adee['field'](_0xeae3('0x9b'),_0xeae3('0x9c'));_0x50adee[_0xeae3('0x4c')]('a.mandatoryDisposition',_0xeae3('0x9d'));_0x50adee[_0xeae3('0x4c')]('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',_0xeae3('0x8b'));_0x50adee[_0xeae3('0x4c')](_0xeae3('0x9e'));_0x50adee[_0xeae3('0x4c')](_0xeae3('0x9f'),'Contact.firstName');_0x50adee['field'](_0xeae3('0xa0'),_0xeae3('0xa1'));_0x50adee[_0xeae3('0x4c')](_0xeae3('0xa2'),_0xeae3('0xa3'));_0x50adee[_0xeae3('0x4c')](_0xeae3('0xa4'),_0xeae3('0xa5'));_0x50adee['field']('c.mobile','Contact.mobile');_0x50adee[_0xeae3('0x4c')](_0xeae3('0xa6'),_0xeae3('0xa7'));_0x50adee[_0xeae3('0x4c')](_0xeae3('0xa8'),_0xeae3('0xa9'));_0x50adee[_0xeae3('0x4c')](_0xeae3('0xaa'),_0xeae3('0xab'));_0x50adee[_0xeae3('0x4c')](_0xeae3('0xac'),'TagIds');}if(_0x273bd4[_0xeae3('0x23')])_0x50adee[_0xeae3('0x23')](_0x273bd4[_0xeae3('0x23')]);if(_0x273bd4['offset'])_0x50adee[_0xeae3('0x24')](_0x273bd4[_0xeae3('0x24')]);return db[_0xeae3('0x96')][_0xeae3('0x3d')](_0x50adee[_0xeae3('0x97')](),_0x525630);})['then'](function(_0x131ad3){if(_0x131ad3[_0xeae3('0x44')]>0x0)_0xb493b8['where'](_0xeae3('0xad'),_['map'](_0x131ad3,'id'));return db[_0xeae3('0x96')]['query'](_0xb493b8[_0xeae3('0x97')](),_0x525630)[_0xeae3('0x29')](function(_0x1bb3c6){var _0x1e40d5=_[_0xeae3('0xae')](_0x1bb3c6,_0xeae3('0xaf'));var _0x366785=[];_0x131ad3['forEach'](function(_0x1b798a){_0x366785[_0xeae3('0x35')](updateSmsInteraction(_0x1b798a,_0x21bbe5,_0x1e40d5));});return BPromise[_0xeae3('0xb0')](_0x366785);});});})[_0xeae3('0x29')](function(_0x50380e){_0x455210[_0xeae3('0xb1')]=_0x50380e;return _0x455210;})['then'](respondWithFilteredResult(_0x258725,_0x273bd4))[_0xeae3('0x36')](handleError(_0x258725,null));};exports[_0xeae3('0xb2')]=function(_0x1c0379,_0x5256b9){var _0x129b04={'raw':![],'where':{'id':_0x1c0379['params']['id']}},_0x59bf51={};_0x59bf51['model']=_[_0xeae3('0x3e')](db['SmsInteraction'][_0xeae3('0x39')]);_0x59bf51[_0xeae3('0x3d')]=_['keys'](_0x1c0379[_0xeae3('0x3d')]);_0x59bf51['filters']=_[_0xeae3('0x40')](_0x59bf51[_0xeae3('0x42')],_0x59bf51['query']);_0x129b04[_0xeae3('0x41')]=_['intersection'](_0x59bf51[_0xeae3('0x42')],qs[_0xeae3('0x43')](_0x1c0379[_0xeae3('0x3d')]['fields']));_0x129b04['attributes']=_0x129b04[_0xeae3('0x41')][_0xeae3('0x44')]?_0x129b04[_0xeae3('0x41')]:_0x59bf51[_0xeae3('0x42')];if(_0x1c0379[_0xeae3('0x3d')][_0xeae3('0xb3')]){_0x129b04['include']=[{'all':!![]}];}_0x129b04=_['merge']({},_0x129b04,_0x1c0379[_0xeae3('0xb4')]);return db['SmsInteraction'][_0xeae3('0x61')](_0x129b04)[_0xeae3('0x29')](handleEntityNotFound(_0x5256b9,null))[_0xeae3('0x29')](respondWithResult(_0x5256b9,null))['catch'](handleError(_0x5256b9,null));};exports[_0xeae3('0xb5')]=function(_0x3c3d40,_0x129c6e){return db[_0xeae3('0x38')][_0xeae3('0xb5')](_0x3c3d40[_0xeae3('0x72')],{})[_0xeae3('0x29')](respondWithResult(_0x129c6e,0xc9))[_0xeae3('0x36')](handleError(_0x129c6e,null));};exports[_0xeae3('0xb6')]=function(_0xf73977,_0x4750a2){if(_0xf73977[_0xeae3('0x72')]['id']){delete _0xf73977[_0xeae3('0x72')]['id'];}return db[_0xeae3('0x38')]['find']({'where':{'id':_0xf73977[_0xeae3('0xb7')]['id']}})['then'](handleEntityNotFound(_0x4750a2,null))[_0xeae3('0x29')](saveUpdates(_0xf73977['body'],null))['then'](respondWithResult(_0x4750a2,null))[_0xeae3('0x36')](handleError(_0x4750a2,null));};exports['destroy']=function(_0x1763d4,_0x2f32df){return db[_0xeae3('0x38')][_0xeae3('0x61')]({'where':{'id':_0x1763d4['params']['id']}})['then'](handleEntityNotFound(_0x2f32df,null))['then'](removeEntity(_0x2f32df,null))[_0xeae3('0x36')](handleError(_0x2f32df,null));};exports['describe']=function(_0x114ee1,_0x44b3ff){return db[_0xeae3('0x38')][_0xeae3('0xb8')]()[_0xeae3('0x29')](respondWithResult(_0x44b3ff,null))[_0xeae3('0x36')](handleError(_0x44b3ff,null));};exports[_0xeae3('0xb9')]=function(_0x8f9e3c,_0x27e4e6,_0x17ab2a){return db[_0xeae3('0xba')]['find']({'where':{'id':_0x8f9e3c[_0xeae3('0xb7')]['id']}})[_0xeae3('0x29')](handleEntityNotFound(_0x27e4e6,null))['then'](function(_0x102326){if(_0x102326){return _0x102326['addMessage'](_0x8f9e3c[_0xeae3('0x72')][_0xeae3('0xbb')],_[_0xeae3('0xbc')](_0x8f9e3c['body'],[_0xeae3('0xbb'),'id'])||{});}})[_0xeae3('0x29')](respondWithResult(_0x27e4e6,null))[_0xeae3('0x36')](handleError(_0x27e4e6,null));};exports[_0xeae3('0xbd')]=function(_0x4b353f,_0x54a724,_0x543d73){var _0x346ce4={'raw':![],'where':{}};var _0x31eebb={};var _0x3ef700={'count':0x0,'rows':[]};return db[_0xeae3('0x38')]['findOne']({'where':{'id':_0x4b353f[_0xeae3('0xb7')]['id']}})[_0xeae3('0x29')](handleEntityNotFound(_0x54a724,null))[_0xeae3('0x29')](function(_0x5d45d2){if(_0x5d45d2){_0x31eebb[_0xeae3('0x42')]=_[_0xeae3('0x3e')](db[_0xeae3('0xba')][_0xeae3('0x39')]);_0x31eebb[_0xeae3('0x3d')]=_[_0xeae3('0x3e')](_0x4b353f[_0xeae3('0x3d')]);_0x31eebb[_0xeae3('0x3f')]=_[_0xeae3('0x40')](_0x31eebb[_0xeae3('0x42')],_0x31eebb[_0xeae3('0x3d')]);_0x346ce4[_0xeae3('0x41')]=_[_0xeae3('0x40')](_0x31eebb[_0xeae3('0x42')],qs[_0xeae3('0x43')](_0x4b353f[_0xeae3('0x3d')][_0xeae3('0x43')]));_0x346ce4[_0xeae3('0x41')]=_0x346ce4[_0xeae3('0x41')][_0xeae3('0x44')]?_0x346ce4[_0xeae3('0x41')]:_0x31eebb[_0xeae3('0x42')];if(!_0x4b353f['query'][_0xeae3('0x45')](_0xeae3('0x46'))){_0x346ce4[_0xeae3('0x23')]=qs[_0xeae3('0x23')](_0x4b353f[_0xeae3('0x3d')]['limit']);_0x346ce4[_0xeae3('0x24')]=qs['offset'](_0x4b353f[_0xeae3('0x3d')][_0xeae3('0x24')]);}_0x346ce4[_0xeae3('0x47')]=qs['sort'](_0x4b353f['query'][_0xeae3('0x48')]);_0x346ce4[_0xeae3('0x49')]=qs[_0xeae3('0x3f')](_[_0xeae3('0x4a')](_0x4b353f[_0xeae3('0x3d')],_0x31eebb[_0xeae3('0x3f')]));_0x346ce4['where'][_0xeae3('0xaf')]=_0x5d45d2['id'];if(_0x4b353f[_0xeae3('0x3d')][_0xeae3('0x7f')]){_0x346ce4[_0xeae3('0x49')]=_[_0xeae3('0x99')](_0x346ce4[_0xeae3('0x49')],{'$or':_[_0xeae3('0x30')](_0x346ce4['attributes'],function(_0x31621d){var _0xb552e5={};_0xb552e5[_0x31621d]={'$like':'%'+_0x4b353f[_0xeae3('0x3d')][_0xeae3('0x7f')]+'%'};return _0xb552e5;})});}if(_0x4b353f[_0xeae3('0x3d')][_0xeae3('0xbe')]){var _0x1c26bd=_0x4b353f[_0xeae3('0x3d')][_0xeae3('0xbe')][_0xeae3('0x33')](',');var _0x55fe82={};_0x55fe82[_0x1c26bd[0x0]]={'$gte':moment(_0x1c26bd[0x1])['format'](_0xeae3('0xbf'))};_0x346ce4[_0xeae3('0x49')]=_[_0xeae3('0x99')](_0x346ce4[_0xeae3('0x49')],_0x55fe82);}_0x346ce4=_['merge']({},_0x346ce4,_0x4b353f['options']);return db[_0xeae3('0xba')][_0xeae3('0x25')]({'where':_0x346ce4['where']})[_0xeae3('0x29')](function(_0x2beedb){_0x3ef700[_0xeae3('0x25')]=_0x2beedb;if(_0x4b353f[_0xeae3('0x3d')][_0xeae3('0xb3')]){_0x346ce4[_0xeae3('0xc0')]=[{'all':!![]}];}return db['SmsMessage'][_0xeae3('0xc1')](_0x346ce4);})['then'](function(_0x141fa0){_0x3ef700[_0xeae3('0xb1')]=_0x141fa0;return _0x3ef700;});}})[_0xeae3('0x29')](respondWithFilteredResult(_0x54a724,_0x346ce4))[_0xeae3('0x36')](handleError(_0x54a724,null));};exports[_0xeae3('0xc2')]=function(_0x35ed6f,_0x14961f,_0x243b4d){return db[_0xeae3('0x38')][_0xeae3('0x61')]({'where':{'id':_0x35ed6f[_0xeae3('0xb7')]['id']}})['then'](handleEntityNotFound(_0x14961f,null))[_0xeae3('0x29')](function(_0x5529ce){if(_0x5529ce){return _0x5529ce['setTags'](_0x35ed6f[_0xeae3('0x72')][_0xeae3('0xbb')],_['omit'](_0x35ed6f[_0xeae3('0x72')],[_0xeae3('0xbb'),'id'])||{})[_0xeae3('0xc3')](function(){return db[_0xeae3('0x6d')][_0xeae3('0xc1')]({'attributes':['id','name',_0xeae3('0x4d')],'where':{'id':_0x35ed6f[_0xeae3('0x72')][_0xeae3('0xbb')]}});})[_0xeae3('0x29')](function(_0x29eed8){socket['emit'](_0xeae3('0xc4'),{'id':Number(_0x35ed6f[_0xeae3('0xb7')]['id']),'tags':_0x29eed8||[]});return{'id':Number(_0x35ed6f['params']['id']),'tags':_0x29eed8||[]};});}})['then'](respondWithResult(_0x14961f,null))[_0xeae3('0x36')](handleError(_0x14961f,null));};exports[_0xeae3('0xc5')]=function(_0x2f6566,_0x26e4a1,_0x761e59){return db[_0xeae3('0x38')][_0xeae3('0x61')]({'where':{'id':_0x2f6566[_0xeae3('0xb7')]['id']}})[_0xeae3('0x29')](handleEntityNotFound(_0x26e4a1,null))[_0xeae3('0x29')](function(_0x3f3d4a){if(_0x3f3d4a){return _0x3f3d4a['removeTags'](_0x2f6566[_0xeae3('0x3d')]['ids']);}})['then'](respondWithStatusCode(_0x26e4a1,null))[_0xeae3('0x36')](handleError(_0x26e4a1,null));};exports[_0xeae3('0xc6')]=function(_0x221a0d,_0x441d69){var _0x30b0df=moment()['unix']()[_0xeae3('0x97')]();var _0x4713c8=path['join'](config[_0xeae3('0xc7')],'server','files','tmp');var _0x1e0ff0=path[_0xeae3('0xc8')](config[_0xeae3('0xc7')],_0xeae3('0xc9'),_0xeae3('0xca'),_0xeae3('0xcb'));var _0x56284a=path[_0xeae3('0xc8')](_0x4713c8,_0x30b0df);var _0x1cab9c=util[_0xeae3('0xcc')](_0xeae3('0xcd'),_0x221a0d[_0xeae3('0xb7')]['id'],_0x30b0df);var _0x1035eb=path[_0xeae3('0xc8')](_0x4713c8,_0x1cab9c);var _0x2cacef=[];_0x2cacef['push']({'model':db['User'],'as':'User','attributes':['id',_0xeae3('0x31')],'raw':!![]});_0x2cacef['push']({'model':db[_0xeae3('0xce')],'as':'Contact','attributes':['id',_0xeae3('0xcf'),_0xeae3('0xd0')],'raw':!![]});var _0x16bbcf=[{'model':db[_0xeae3('0xba')],'as':_0xeae3('0xd1'),'attributes':['id',_0xeae3('0x72'),'createdAt',_0xeae3('0xd2'),'secret',_0xeae3('0x7d')],'include':_0x2cacef}];_0x16bbcf[_0xeae3('0x35')]({'model':db['SmsAccount'],'as':'Account','attributes':['id',_0xeae3('0x2e')]});_0x16bbcf[_0xeae3('0x35')]({'model':db[_0xeae3('0xd3')],'as':'Owner','attributes':['id',_0xeae3('0x31')]});return db[_0xeae3('0x38')]['find']({'where':{'id':_0x221a0d[_0xeae3('0xb7')]['id']},'include':_0x16bbcf})[_0xeae3('0x29')](handleEntityNotFound(_0x441d69,null))[_0xeae3('0x29')](function(_0x3fa68a){if(_0x3fa68a){var _0x30c839=_0x3fa68a[_0xeae3('0xd4')]({'plain':!![]});fs[_0xeae3('0xd5')](_0x56284a);var _0x7442dc={'channel':'Sms','account':_0x30c839[_0xeae3('0xd6')]['name'],'agent':_0x30c839['Owner']?_0x30c839[_0xeae3('0xd7')]['fullname']:_0xeae3('0xd8'),'createdAt':moment(_0x30c839[_0xeae3('0x78')])[_0xeae3('0xcc')](_0xeae3('0xbf'))[_0xeae3('0x97')](),'closedAt':_0x30c839[_0xeae3('0xd9')]?moment(_0x30c839[_0xeae3('0xda')])[_0xeae3('0xcc')](_0xeae3('0xbf'))[_0xeae3('0x97')]():'','disposition':_0x30c839[_0xeae3('0xdb')],'messages':_(_0x30c839[_0xeae3('0xd1')])[_0xeae3('0x7f')]({'secret':![]})[_0xeae3('0x30')](function(_0x36ad27){return{'date':moment(_0x36ad27['createdAt'])[_0xeae3('0xcc')](_0xeae3('0xbf'))[_0xeae3('0x97')](),'sender':_0x36ad27[_0xeae3('0xd2')]===_0xeae3('0xdc')?_0x36ad27[_0xeae3('0xd3')]?_0x36ad27['User'][_0xeae3('0x31')]:_0xeae3('0xdd'):_0x36ad27['Contact'][_0xeae3('0xcf')]+(_0x36ad27[_0xeae3('0xde')][_0xeae3('0xd0')]?'\x20'+_0x36ad27[_0xeae3('0xde')][_0xeae3('0xd0')]:''),'body':_0x36ad27[_0xeae3('0x72')],'direction':_0x36ad27[_0xeae3('0xd2')]===_0xeae3('0xdc')?'A':'C','secret':_0x36ad27[_0xeae3('0xdf')],'read':_0x36ad27[_0xeae3('0x7d')]};})[_0xeae3('0x62')]()};return ejs[_0xeae3('0xe0')](path[_0xeae3('0xc8')](config[_0xeae3('0xc7')],'server',_0xeae3('0xe1'),'downloadInteraction.ejs'),{'interaction':_0x7442dc})[_0xeae3('0x29')](function(_0x2aa34b){var _0x461109=path[_0xeae3('0xc8')](_0x56284a,_0xeae3('0xe2')+_0x30c839['id']+'-'+_0x30b0df+_0xeae3('0xe3'));var _0x2405dd={'path':_0x461109,'channel':'Sms','interactionId':_0x30c839['id']};return pdf['createPdfFromHTML'](_0x2aa34b,_0x2405dd);})[_0xeae3('0x29')](function(){return new BPromise(function(_0x4d54ba,_0x566ad2){zipdir(_0x56284a,{'saveTo':_0x1035eb},function(_0x279a35,_0x3e1a83){if(_0x279a35)return _0x566ad2(_0x279a35);return _0x4d54ba(_0x3e1a83);});})['then'](function(){return new BPromise(function(_0x5ad696,_0x3f1733){rimraf(_0x56284a,function(_0x2fc452){if(_0x2fc452)_0x3f1733(_0x2fc452);return _0x5ad696();});});})[_0xeae3('0x29')](function(){return _0x441d69[_0xeae3('0xc6')](_0x1035eb,_0x1cab9c,function(_0x115983){if(_0x115983){console[_0xeae3('0xe4')](_0xeae3('0xe5'),_0x115983);}else{fs['unlinkSync'](_0x1035eb);}});});});}else{return _0x441d69[_0xeae3('0x2b')](0xc8);}})[_0xeae3('0x36')](handleError(_0x441d69,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 31fbf9c..4b76b0e 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 _0x236c=['length','emit','catch','hasOwnProperty','exports','events','SmsInteraction','../../mysqldb','SmsMessage','setMaxListeners','save','remove','getUsers','setDataValue','findAll','unreadMessages'];(function(_0x404972,_0x8d8a0b){var _0x267045=function(_0x18ed0e){while(--_0x18ed0e){_0x404972['push'](_0x404972['shift']());}};_0x267045(++_0x8d8a0b);}(_0x236c,0x155));var _0xc236=function(_0x5f1c0e,_0xe8642b){_0x5f1c0e=_0x5f1c0e-0x0;var _0x33d9ed=_0x236c[_0x5f1c0e];return _0x33d9ed;};'use strict';var EventEmitter=require(_0xc236('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0xc236('0x1')];var SmsMessage=require(_0xc236('0x2'))['db'][_0xc236('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xc236('0x4')](0x0);var events={'afterCreate':_0xc236('0x5'),'afterUpdate':'update','afterDestroy':_0xc236('0x6')};function emitEvent(_0x36e87d){return function(_0x33bc57,_0xd582f6,_0x23d3cc){_0x33bc57[_0xc236('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0xd612c6){_0x33bc57[_0xc236('0x8')]('Users',_0xd612c6['map'](function(_0x5cdee5){return{'id':_0x5cdee5['id']};}));return SmsMessage[_0xc236('0x9')]({'where':{'SmsInteractionId':_0x33bc57['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x30a28d){_0x33bc57[_0xc236('0x8')](_0xc236('0xa'),_0x30a28d[_0xc236('0xb')]);SmsInteractionEvents[_0xc236('0xc')](_0x36e87d+':'+_0x33bc57['id'],_0x33bc57);SmsInteractionEvents['emit'](_0x36e87d,_0x33bc57);_0x23d3cc(null);})[_0xc236('0xd')](_0x23d3cc(null));};}for(var e in events){if(events[_0xc236('0xe')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0xc236('0xf')]=SmsInteractionEvents; \ No newline at end of file +var _0xeb3b=['then','setDataValue','map','findAll','unreadMessages','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsInteraction','SmsMessage','update','getUsers'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x211a02,_0x3b5362){_0x211a02=_0x211a02-0x0;var _0x13d91c=_0xeb3b[_0x211a02];return _0x13d91c;};'use strict';var EventEmitter=require(_0xbeb3('0x0'));var SmsInteraction=require(_0xbeb3('0x1'))['db'][_0xbeb3('0x2')];var SmsMessage=require(_0xbeb3('0x1'))['db'][_0xbeb3('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xbeb3('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2e8ce3){return function(_0x4852ca,_0x2e8a69,_0x5ae6f9){_0x4852ca[_0xbeb3('0x5')]({'attributes':['id'],'raw':!![]})[_0xbeb3('0x6')](function(_0x406927){_0x4852ca[_0xbeb3('0x7')]('Users',_0x406927[_0xbeb3('0x8')](function(_0x26e0f3){return{'id':_0x26e0f3['id']};}));return SmsMessage[_0xbeb3('0x9')]({'where':{'SmsInteractionId':_0x4852ca['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbeb3('0x6')](function(_0x443396){_0x4852ca[_0xbeb3('0x7')](_0xbeb3('0xa'),_0x443396['length']);SmsInteractionEvents[_0xbeb3('0xb')](_0x2e8ce3+':'+_0x4852ca['id'],_0x4852ca);SmsInteractionEvents[_0xbeb3('0xb')](_0x2e8ce3,_0x4852ca);_0x5ae6f9(null);})['catch'](_0x5ae6f9(null));};}for(var e in events){if(events[_0xbeb3('0xc')](e)){var event=events[e];SmsInteraction[_0xbeb3('0xd')](e,emitEvent(event));}}module[_0xbeb3('0xe')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 12bce88..44be9fc 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 _0xb9f5=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','rimraf','../../config/environment','./smsInteraction.attributes','define','SmsInteraction','sms_interactions','changed','closed'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb9f5,0xf1));var _0x5b9f=function(_0x519d77,_0x4e758e){_0x519d77=_0x519d77-0x0;var _0x56e79d=_0xb9f5[_0x519d77];return _0x56e79d;};'use strict';var _=require(_0x5b9f('0x0'));var util=require(_0x5b9f('0x1'));var logger=require('../../config/logger')(_0x5b9f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5b9f('0x3'));var config=require(_0x5b9f('0x4'));var attributes=require(_0x5b9f('0x5'));module['exports']=function(_0x55a150,_0x38f8d6){return _0x55a150[_0x5b9f('0x6')](_0x5b9f('0x7'),attributes,{'tableName':_0x5b9f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x13b572,_0x59c8de,_0x530fa1){if(_0x13b572[_0x5b9f('0x9')](_0x5b9f('0xa'))){_0x13b572[_0x5b9f('0xb')]=moment()[_0x5b9f('0xc')](_0x5b9f('0xd'));}_0x530fa1(null,_0x13b572);}}});}; \ No newline at end of file +var _0x02d3=['exports','define','sms_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5731b6,_0x18e5f6){var _0x1a96b0=function(_0x14591a){while(--_0x14591a){_0x5731b6['push'](_0x5731b6['shift']());}};_0x1a96b0(++_0x18e5f6);}(_0x02d3,0x128));var _0x302d=function(_0x2db667,_0x579ba1){_0x2db667=_0x2db667-0x0;var _0x5407e9=_0x02d3[_0x2db667];return _0x5407e9;};'use strict';var _=require(_0x302d('0x0'));var util=require(_0x302d('0x1'));var logger=require(_0x302d('0x2'))(_0x302d('0x3'));var moment=require(_0x302d('0x4'));var BPromise=require(_0x302d('0x5'));var rp=require(_0x302d('0x6'));var fs=require('fs');var path=require(_0x302d('0x7'));var rimraf=require(_0x302d('0x8'));var config=require(_0x302d('0x9'));var attributes=require('./smsInteraction.attributes');module[_0x302d('0xa')]=function(_0x39a110,_0x308df5){return _0x39a110[_0x302d('0xb')]('SmsInteraction',attributes,{'tableName':_0x302d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x482779,_0x295f38,_0xc0b5da){if(_0x482779['changed'](_0x302d('0xd'))){_0x482779[_0x302d('0xe')]=moment()[_0x302d('0xf')](_0x302d('0x10'));}_0xc0b5da(null,_0x482779);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index b151da4..0ab8b18 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 _0x2d49=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','attributes','limit','catch','AddTagsToSmsInteraction','find','ids','omit','spread','AddTags','lodash','bluebird','randomstring','ioredis'];(function(_0x247cb6,_0x136177){var _0x554363=function(_0x5c981f){while(--_0x5c981f){_0x247cb6['push'](_0x247cb6['shift']());}};_0x554363(++_0x136177);}(_0x2d49,0x154));var _0x92d4=function(_0x22b7b2,_0x55532a){_0x22b7b2=_0x22b7b2-0x0;var _0x5a6360=_0x2d49[_0x22b7b2];return _0x5a6360;};'use strict';var _=require(_0x92d4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x92d4('0x1'));var rs=require(_0x92d4('0x2'));var fs=require('fs');var Redis=require(_0x92d4('0x3'));var db=require(_0x92d4('0x4'))['db'];var utils=require(_0x92d4('0x5'));var logger=require(_0x92d4('0x6'))('rpc');var config=require(_0x92d4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x92d4('0x8')]['http']({'port':0x232a});config[_0x92d4('0x9')]=_[_0x92d4('0xa')](config[_0x92d4('0x9')],{'host':_0x92d4('0xb'),'port':0x18eb});var socket=require(_0x92d4('0xc'))(new Redis(config[_0x92d4('0x9')]));require(_0x92d4('0xd'))[_0x92d4('0xe')](socket);function respondWithRpcPromise(_0x5cab15,_0x1cb198,_0x4dff68){return new BPromise(function(_0x1990ba,_0x107b65){return client[_0x92d4('0xf')](_0x5cab15,_0x4dff68)[_0x92d4('0x10')](function(_0x373674){logger[_0x92d4('0x11')](_0x92d4('0x12'),_0x1cb198,'request\x20sent');logger[_0x92d4('0x13')](_0x92d4('0x14'),_0x1cb198,'request\x20sent',JSON[_0x92d4('0x15')](_0x373674));if(_0x373674[_0x92d4('0x16')]){if(_0x373674[_0x92d4('0x16')][_0x92d4('0x17')]===0x1f4){logger[_0x92d4('0x16')](_0x92d4('0x12'),_0x1cb198,_0x373674[_0x92d4('0x16')]['message']);return _0x107b65(_0x373674[_0x92d4('0x16')][_0x92d4('0x18')]);}logger[_0x92d4('0x16')](_0x92d4('0x12'),_0x1cb198,_0x373674[_0x92d4('0x16')][_0x92d4('0x18')]);return _0x1990ba(_0x373674[_0x92d4('0x16')][_0x92d4('0x18')]);}else{logger['info'](_0x92d4('0x12'),_0x1cb198,_0x92d4('0x19'));_0x1990ba(_0x373674[_0x92d4('0x1a')]['message']);}})['catch'](function(_0x4b7096){logger['error'](_0x92d4('0x12'),_0x1cb198,_0x4b7096);_0x107b65(_0x4b7096);});});}exports[_0x92d4('0x1b')]=function(_0x2a7d44){var _0x25b7f6=this;return new Promise(function(_0x4a019c,_0x1594fc){return db[_0x92d4('0x1c')][_0x92d4('0x1d')](_0x2a7d44[_0x92d4('0x1e')],{'raw':_0x2a7d44['options']?_0x2a7d44[_0x92d4('0x1f')][_0x92d4('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a7d44[_0x92d4('0x1f')]?_0x2a7d44['options'][_0x92d4('0x21')]||null:null,'attributes':_0x2a7d44[_0x92d4('0x1f')]?_0x2a7d44['options'][_0x92d4('0x22')]||null:null,'limit':_0x2a7d44['options']?_0x2a7d44['options'][_0x92d4('0x23')]||null:null})[_0x92d4('0x10')](function(_0x2320c7){logger[_0x92d4('0x11')]('UpdateSmsInteraction',_0x2a7d44);logger[_0x92d4('0x13')]('UpdateSmsInteraction',_0x2a7d44,JSON[_0x92d4('0x15')](_0x2320c7));_0x4a019c(_0x2320c7);})[_0x92d4('0x24')](function(_0x743d81){logger['error'](_0x92d4('0x1b'),_0x743d81[_0x92d4('0x18')],_0x2a7d44);_0x1594fc(_0x25b7f6[_0x92d4('0x16')](0x1f4,_0x743d81[_0x92d4('0x18')]));});});};exports[_0x92d4('0x25')]=function(_0x1565b8){return new Promise(function(_0x2b4ec4,_0x48b838){return db[_0x92d4('0x1c')][_0x92d4('0x26')]({'where':_0x1565b8['options']?_0x1565b8[_0x92d4('0x1f')][_0x92d4('0x21')]||null:null})[_0x92d4('0x10')](function(_0x59c1fd){if(_0x59c1fd){return _0x59c1fd['addTags'](_0x1565b8[_0x92d4('0x1e')][_0x92d4('0x27')],_[_0x92d4('0x28')](_0x1565b8[_0x92d4('0x1e')],['ids','id'])||{});}})[_0x92d4('0x29')](function(_0x4d1b1e){logger['info'](_0x92d4('0x2a'),_0x1565b8);logger[_0x92d4('0x13')]('AddTags',_0x1565b8,JSON[_0x92d4('0x15')](_0x4d1b1e));_0x2b4ec4(_0x4d1b1e);})['catch'](function(_0x1f8053){logger[_0x92d4('0x16')](_0x92d4('0x2a'),_0x1f8053[_0x92d4('0x18')],_0x1565b8);_0x48b838(_this[_0x92d4('0x16')](0x1f4,_0x1f8053[_0x92d4('0x18')]));});});}; \ No newline at end of file +var _0x9bf6=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','request','info','SmsInteraction,\x20%s,\x20%s','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','UpdateSmsInteraction','SmsInteraction','body','options','where','limit','then','debug','AddTagsToSmsInteraction','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x5ce3c8,_0x2503bd){var _0xa76867=function(_0x52815e){while(--_0x52815e){_0x5ce3c8['push'](_0x5ce3c8['shift']());}};_0xa76867(++_0x2503bd);}(_0x9bf6,0x14a));var _0x69bf=function(_0x180be5,_0x514d06){_0x180be5=_0x180be5-0x0;var _0x3023f3=_0x9bf6[_0x180be5];return _0x3023f3;};'use strict';var _=require(_0x69bf('0x0'));var util=require(_0x69bf('0x1'));var moment=require(_0x69bf('0x2'));var BPromise=require(_0x69bf('0x3'));var rs=require(_0x69bf('0x4'));var fs=require('fs');var Redis=require(_0x69bf('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x69bf('0x6'));var logger=require(_0x69bf('0x7'))(_0x69bf('0x8'));var config=require(_0x69bf('0x9'));var jayson=require(_0x69bf('0xa'));var client=jayson[_0x69bf('0xb')]['http']({'port':0x232a});config[_0x69bf('0xc')]=_[_0x69bf('0xd')](config[_0x69bf('0xc')],{'host':_0x69bf('0xe'),'port':0x18eb});var socket=require(_0x69bf('0xf'))(new Redis(config['redis']));require(_0x69bf('0x10'))[_0x69bf('0x11')](socket);function respondWithRpcPromise(_0x4fa6f7,_0x1f5e7e,_0x525b88){return new BPromise(function(_0x24be72,_0x5b6459){return client[_0x69bf('0x12')](_0x4fa6f7,_0x525b88)['then'](function(_0x26dbc9){logger[_0x69bf('0x13')](_0x69bf('0x14'),_0x1f5e7e,'request\x20sent');logger['debug'](_0x69bf('0x15'),_0x1f5e7e,_0x69bf('0x16'),JSON[_0x69bf('0x17')](_0x26dbc9));if(_0x26dbc9[_0x69bf('0x18')]){if(_0x26dbc9[_0x69bf('0x18')][_0x69bf('0x19')]===0x1f4){logger['error']('SmsInteraction,\x20%s,\x20%s',_0x1f5e7e,_0x26dbc9[_0x69bf('0x18')][_0x69bf('0x1a')]);return _0x5b6459(_0x26dbc9['error'][_0x69bf('0x1a')]);}logger[_0x69bf('0x18')](_0x69bf('0x14'),_0x1f5e7e,_0x26dbc9[_0x69bf('0x18')][_0x69bf('0x1a')]);return _0x24be72(_0x26dbc9[_0x69bf('0x18')]['message']);}else{logger[_0x69bf('0x13')](_0x69bf('0x14'),_0x1f5e7e,_0x69bf('0x16'));_0x24be72(_0x26dbc9['result'][_0x69bf('0x1a')]);}})[_0x69bf('0x1b')](function(_0xd7c8b1){logger['error'](_0x69bf('0x14'),_0x1f5e7e,_0xd7c8b1);_0x5b6459(_0xd7c8b1);});});}exports[_0x69bf('0x1c')]=function(_0x4cf53e){var _0xb7965=this;return new Promise(function(_0x27836d,_0x47961){return db[_0x69bf('0x1d')]['update'](_0x4cf53e[_0x69bf('0x1e')],{'raw':_0x4cf53e[_0x69bf('0x1f')]?_0x4cf53e[_0x69bf('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4cf53e[_0x69bf('0x1f')]?_0x4cf53e[_0x69bf('0x1f')][_0x69bf('0x20')]||null:null,'attributes':_0x4cf53e[_0x69bf('0x1f')]?_0x4cf53e['options']['attributes']||null:null,'limit':_0x4cf53e[_0x69bf('0x1f')]?_0x4cf53e[_0x69bf('0x1f')][_0x69bf('0x21')]||null:null})[_0x69bf('0x22')](function(_0x36558f){logger[_0x69bf('0x13')](_0x69bf('0x1c'),_0x4cf53e);logger[_0x69bf('0x23')]('UpdateSmsInteraction',_0x4cf53e,JSON[_0x69bf('0x17')](_0x36558f));_0x27836d(_0x36558f);})['catch'](function(_0x20c2b0){logger[_0x69bf('0x18')](_0x69bf('0x1c'),_0x20c2b0[_0x69bf('0x1a')],_0x4cf53e);_0x47961(_0xb7965[_0x69bf('0x18')](0x1f4,_0x20c2b0[_0x69bf('0x1a')]));});});};exports[_0x69bf('0x24')]=function(_0x3bfeac){return new Promise(function(_0xf2f5d,_0x200eed){return db[_0x69bf('0x1d')]['find']({'where':_0x3bfeac[_0x69bf('0x1f')]?_0x3bfeac['options']['where']||null:null})['then'](function(_0x19b1c7){if(_0x19b1c7){return _0x19b1c7[_0x69bf('0x25')](_0x3bfeac[_0x69bf('0x1e')][_0x69bf('0x26')],_[_0x69bf('0x27')](_0x3bfeac[_0x69bf('0x1e')],['ids','id'])||{});}})[_0x69bf('0x28')](function(_0x47aa5b){logger[_0x69bf('0x13')]('AddTags',_0x3bfeac);logger[_0x69bf('0x23')](_0x69bf('0x29'),_0x3bfeac,JSON[_0x69bf('0x17')](_0x47aa5b));_0xf2f5d(_0x47aa5b);})[_0x69bf('0x1b')](function(_0x50a073){logger[_0x69bf('0x18')](_0x69bf('0x29'),_0x50a073['message'],_0x3bfeac);_0x200eed(_this[_0x69bf('0x18')](0x1f4,_0x50a073[_0x69bf('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 1810813..7ad40ef 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 _0x18e9=['smsInteraction:','./smsInteraction.events','remove','update','removeListener','length'];(function(_0x1b7c56,_0x114f45){var _0x53b5ac=function(_0x137c89){while(--_0x137c89){_0x1b7c56['push'](_0x1b7c56['shift']());}};_0x53b5ac(++_0x114f45);}(_0x18e9,0x1b1));var _0x918e=function(_0x39872b,_0x343e6b){_0x39872b=_0x39872b-0x0;var _0x55fa18=_0x18e9[_0x39872b];return _0x55fa18;};'use strict';var SmsInteractionEvents=require(_0x918e('0x0'));var events=['save',_0x918e('0x1'),_0x918e('0x2')];function createListener(_0x4e1815,_0x5685db){return function(_0x12e04c){_0x5685db['emit'](_0x4e1815,_0x12e04c);};}function removeListener(_0x4250ff,_0x1b7b3e){return function(){SmsInteractionEvents[_0x918e('0x3')](_0x4250ff,_0x1b7b3e);};}exports['register']=function(_0x1b1e87){for(var _0x19e548=0x0,_0xcf1323=events[_0x918e('0x4')];_0x19e548<_0xcf1323;_0x19e548++){var _0x5ebfc1=events[_0x19e548];var _0x4f5d0d=createListener(_0x918e('0x5')+_0x5ebfc1,_0x1b1e87);SmsInteractionEvents['on'](_0x5ebfc1,_0x4f5d0d);}}; \ No newline at end of file +var _0xc53c=['smsInteraction:','./smsInteraction.events','save','remove','removeListener','register','length'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xc53c,0x13c));var _0xcc53=function(_0x4eee59,_0x195b9a){_0x4eee59=_0x4eee59-0x0;var _0x42194d=_0xc53c[_0x4eee59];return _0x42194d;};'use strict';var SmsInteractionEvents=require(_0xcc53('0x0'));var events=[_0xcc53('0x1'),_0xcc53('0x2'),'update'];function createListener(_0xabb92a,_0x592fd1){return function(_0x2fabca){_0x592fd1['emit'](_0xabb92a,_0x2fabca);};}function removeListener(_0x5a2c6c,_0x2b8e39){return function(){SmsInteractionEvents[_0xcc53('0x3')](_0x5a2c6c,_0x2b8e39);};}exports[_0xcc53('0x4')]=function(_0x110204){for(var _0xe33810=0x0,_0x12f1aa=events[_0xcc53('0x5')];_0xe33810<_0x12f1aa;_0xe33810++){var _0x200afe=events[_0xe33810];var _0x508bed=createListener(_0xcc53('0x6')+_0x200afe,_0x110204);SmsInteractionEvents['on'](_0x200afe,_0x508bed);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index be96139..52d1402 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 _0x49db=['../../components/auth/service','../../components/interaction/service','./smsMessage.controller','index','get','/describe','describe','/:id','isAuthenticated','show','post','sms','smsmessage:create','create','/:id/status','status','put','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x15dbca,_0x1d7c3c){var _0x326533=function(_0x507ee2){while(--_0x507ee2){_0x15dbca['push'](_0x15dbca['shift']());}};_0x326533(++_0x1d7c3c);}(_0x49db,0xc5));var _0xb49d=function(_0x27bb18,_0x41be78){_0x27bb18=_0x27bb18-0x0;var _0x3ca6fb=_0x49db[_0x27bb18];return _0x3ca6fb;};'use strict';var multer=require(_0xb49d('0x0'));var util=require(_0xb49d('0x1'));var path=require(_0xb49d('0x2'));var timeout=require(_0xb49d('0x3'));var express=require(_0xb49d('0x4'));var router=express['Router']();var fs_extra=require(_0xb49d('0x5'));var auth=require(_0xb49d('0x6'));var interaction=require(_0xb49d('0x7'));var config=require('../../config/environment');var controller=require(_0xb49d('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xb49d('0x9')]);router[_0xb49d('0xa')](_0xb49d('0xb'),auth['isAuthenticated'](),controller[_0xb49d('0xc')]);router[_0xb49d('0xa')](_0xb49d('0xd'),auth[_0xb49d('0xe')](),controller[_0xb49d('0xf')]);router[_0xb49d('0x10')]('/',auth['isAuthenticated'](),interaction['tracked'](_0xb49d('0x11'),_0xb49d('0x12')),controller[_0xb49d('0x13')]);router[_0xb49d('0x10')](_0xb49d('0x14'),controller[_0xb49d('0x15')]);router[_0xb49d('0x16')](_0xb49d('0xd'),auth[_0xb49d('0xe')](),controller['update']);router[_0xb49d('0x16')](_0xb49d('0x17'),auth[_0xb49d('0xe')](),controller[_0xb49d('0x18')]);router['put'](_0xb49d('0x19'),auth[_0xb49d('0xe')](),controller['reject']);router[_0xb49d('0x1a')](_0xb49d('0xd'),auth[_0xb49d('0xe')](),controller[_0xb49d('0x1b')]);module[_0xb49d('0x1c')]=router; \ No newline at end of file +var _0x6208=['sms','create','/:id/status','put','update','/:id/reject','reject','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','isAuthenticated','index','get','/describe','/:id','show','post','tracked'];(function(_0x2881e2,_0x341293){var _0x5c1e1f=function(_0x10ba61){while(--_0x10ba61){_0x2881e2['push'](_0x2881e2['shift']());}};_0x5c1e1f(++_0x341293);}(_0x6208,0x192));var _0x8620=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0x6208[_0xc67528];return _0x38e26d;};'use strict';var multer=require('multer');var util=require(_0x8620('0x0'));var path=require(_0x8620('0x1'));var timeout=require(_0x8620('0x2'));var express=require(_0x8620('0x3'));var router=express[_0x8620('0x4')]();var fs_extra=require(_0x8620('0x5'));var auth=require(_0x8620('0x6'));var interaction=require(_0x8620('0x7'));var config=require(_0x8620('0x8'));var controller=require(_0x8620('0x9'));router['get']('/',auth[_0x8620('0xa')](),controller[_0x8620('0xb')]);router[_0x8620('0xc')](_0x8620('0xd'),auth[_0x8620('0xa')](),controller['describe']);router[_0x8620('0xc')](_0x8620('0xe'),auth['isAuthenticated'](),controller[_0x8620('0xf')]);router[_0x8620('0x10')]('/',auth['isAuthenticated'](),interaction[_0x8620('0x11')](_0x8620('0x12'),'smsmessage:create'),controller[_0x8620('0x13')]);router[_0x8620('0x10')](_0x8620('0x14'),controller['status']);router[_0x8620('0x15')](_0x8620('0xe'),auth[_0x8620('0xa')](),controller[_0x8620('0x16')]);router[_0x8620('0x15')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0x8620('0x15')](_0x8620('0x17'),auth[_0x8620('0xa')](),controller[_0x8620('0x18')]);router[_0x8620('0x19')](_0x8620('0xe'),auth['isAuthenticated'](),controller[_0x8620('0x1a')]);module[_0x8620('0x1b')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 3e2af90..1e1db35 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 _0x9bcc=['exports','TEXT','medium','BOOLEAN','ENUM','out','STRING','sequelize'];(function(_0x144844,_0xd6f32c){var _0x5301dd=function(_0x244c07){while(--_0x244c07){_0x144844['push'](_0x144844['shift']());}};_0x5301dd(++_0xd6f32c);}(_0x9bcc,0x1b7));var _0xc9bc=function(_0x193206,_0x54249f){_0x193206=_0x193206-0x0;var _0x1785b7=_0x9bcc[_0x193206];return _0x1785b7;};'use strict';var Sequelize=require(_0xc9bc('0x0'));module[_0xc9bc('0x1')]={'body':{'type':Sequelize[_0xc9bc('0x2')](_0xc9bc('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xc9bc('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc9bc('0x5')]('in',_0xc9bc('0x6')),'defaultValue':_0xc9bc('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xc9bc('0x7')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xc9bc('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xc9bc('0x7')]},'providerResponse':{'type':Sequelize[_0xc9bc('0x2')]}}; \ No newline at end of file +var _0x316b=['out','STRING','DATE','TEXT','medium','BOOLEAN','ENUM'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0x316b,0x1bd));var _0xb316=function(_0x57a50d,_0x2871f8){_0x57a50d=_0x57a50d-0x0;var _0x1b25b3=_0x316b[_0x57a50d];return _0x1b25b3;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT'](_0xb316('0x0')),'allowNull':![]},'read':{'type':Sequelize[_0xb316('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb316('0x2')]('in',_0xb316('0x3')),'defaultValue':_0xb316('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0xb316('0x4')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xb316('0x5')]},'secret':{'type':Sequelize[_0xb316('0x1')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xb316('0x6')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index e39a074..9330658 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 _0xf5b1=['defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','then','SmsMessage,\x20%s,\x20%s','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','limit','count','set','apply','reject','save','update','stack','send','index','map','SmsMessage','rawAttributes','fieldName','name','query','keys','filters','intersection','model','fields','attributes','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','params','include','find','create','body','destroy','describe','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','SmsInteractionId','isNil','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','fullname','rejectmessage','SmsAccount','SmsAccountId','debug','inspect','type','twilio','MessageSid','messageId','plivo','MessageUUID','sent','delivered','Status','plivio','infobip','results','DELIVERED','SmsAccount,\x20%s,\x20%s,\x20%s','eml-format','zip-dir','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','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','redis'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf5b1,0x7a));var _0x1f5b=function(_0x12c998,_0x1db642){_0x12c998=_0x12c998-0x0;var _0xbc0856=_0xf5b1[_0x12c998];return _0xbc0856;};'use strict';var emlformat=require(_0x1f5b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1f5b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1f5b('0x2'));var moment=require('moment');var BPromise=require(_0x1f5b('0x3'));var Mustache=require(_0x1f5b('0x4'));var util=require('util');var path=require(_0x1f5b('0x5'));var sox=require('sox');var csv=require(_0x1f5b('0x6'));var ejs=require(_0x1f5b('0x7'));var fs=require('fs');var fs_extra=require(_0x1f5b('0x8'));var _=require(_0x1f5b('0x9'));var squel=require(_0x1f5b('0xa'));var crypto=require('crypto');var jsforce=require(_0x1f5b('0xb'));var deskjs=require(_0x1f5b('0xc'));var toCsv=require(_0x1f5b('0x6'));var querystring=require(_0x1f5b('0xd'));var Papa=require(_0x1f5b('0xe'));var Redis=require(_0x1f5b('0xf'));var authService=require(_0x1f5b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x1f5b('0x11'));var hardwareService=require(_0x1f5b('0x12'));var logger=require(_0x1f5b('0x13'))(_0x1f5b('0x14'));var utils=require(_0x1f5b('0x15'));var config=require(_0x1f5b('0x16'));var licenseUtil=require(_0x1f5b('0x17'));var db=require(_0x1f5b('0x18'))['db'];config[_0x1f5b('0x19')]=_[_0x1f5b('0x1a')](config[_0x1f5b('0x19')],{'host':_0x1f5b('0x1b'),'port':0x18eb});var socket=require(_0x1f5b('0x1c'))(new Redis(config[_0x1f5b('0x19')]));require(_0x1f5b('0x1d'))[_0x1f5b('0x1e')](socket);var jayson=require(_0x1f5b('0x1f'));var client=jayson[_0x1f5b('0x20')][_0x1f5b('0x21')]({'port':0x232c});var client9002=jayson[_0x1f5b('0x20')][_0x1f5b('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x4beda8,_0x207eb5,_0x17e405,_0x4affff){return new BPromise(function(_0x599326,_0x1b9cc8){var _0x595320=_0x4affff||client;return _0x595320[_0x1f5b('0x22')](_0x4beda8,_0x17e405)[_0x1f5b('0x23')](function(_0x1ec899){logger['info'](_0x1f5b('0x24'),_0x207eb5,'request\x20sent');logger['debug'](_0x1f5b('0x25'),_0x207eb5,_0x1f5b('0x26'),JSON[_0x1f5b('0x27')](_0x1ec899));if(_0x1ec899[_0x1f5b('0x28')]){if(_0x1ec899[_0x1f5b('0x28')][_0x1f5b('0x29')]===0x1f4){logger[_0x1f5b('0x28')](_0x1f5b('0x24'),_0x207eb5,_0x1ec899[_0x1f5b('0x28')][_0x1f5b('0x2a')]);return _0x1b9cc8(_0x1ec899[_0x1f5b('0x28')][_0x1f5b('0x2a')]);}logger[_0x1f5b('0x28')]('SmsMessage,\x20%s,\x20%s',_0x207eb5,_0x1ec899[_0x1f5b('0x28')][_0x1f5b('0x2a')]);return _0x599326(_0x1ec899[_0x1f5b('0x28')][_0x1f5b('0x2a')]);}else{logger[_0x1f5b('0x2b')](_0x1f5b('0x24'),_0x207eb5,'request\x20sent');_0x599326(_0x1ec899[_0x1f5b('0x2c')]['message']);}})[_0x1f5b('0x2d')](function(_0x5e3bd2){logger[_0x1f5b('0x28')](_0x1f5b('0x24'),_0x207eb5,_0x5e3bd2);_0x1b9cc8(_0x5e3bd2);});});}function respondWithStatusCode(_0x21db9f,_0x592f02){_0x592f02=_0x592f02||0xcc;return function(_0x50d1fa){if(_0x50d1fa){return _0x21db9f[_0x1f5b('0x2e')](_0x592f02);}return _0x21db9f[_0x1f5b('0x2f')](_0x592f02)[_0x1f5b('0x30')]();};}function respondWithResult(_0x2c9766,_0x17c2ce){_0x17c2ce=_0x17c2ce||0xc8;return function(_0x319246){if(_0x319246){return _0x2c9766[_0x1f5b('0x2f')](_0x17c2ce)[_0x1f5b('0x31')](_0x319246);}};}function respondWithFilteredResult(_0xaa83e9,_0x4e23f0){return function(_0x5f50f1){if(_0x5f50f1){var _0x5bfea0=typeof _0x4e23f0[_0x1f5b('0x32')]==='undefined'&&typeof _0x4e23f0[_0x1f5b('0x33')]==='undefined';var _0x20bd2b=_0x5f50f1[_0x1f5b('0x34')];var _0x26a9a6=_0x5bfea0?0x0:_0x4e23f0[_0x1f5b('0x32')];var _0x591ff2=_0x5bfea0?_0x5f50f1['count']:_0x4e23f0['offset']+_0x4e23f0['limit'];var _0xd53c69;if(_0x591ff2>=_0x20bd2b){_0x591ff2=_0x20bd2b;_0xd53c69=0xc8;}else{_0xd53c69=0xce;}_0xaa83e9['status'](_0xd53c69);return _0xaa83e9[_0x1f5b('0x35')]('Content-Range',_0x26a9a6+'-'+_0x591ff2+'/'+_0x20bd2b)['json'](_0x5f50f1);}return null;};}function patchUpdates(_0xfd50ca){return function(_0x23f226){try{jsonpatch[_0x1f5b('0x36')](_0x23f226,_0xfd50ca,!![]);}catch(_0x2f51e9){return BPromise[_0x1f5b('0x37')](_0x2f51e9);}return _0x23f226[_0x1f5b('0x38')]();};}function saveUpdates(_0x59de79,_0x231408){return function(_0x4f0833){if(_0x4f0833){return _0x4f0833[_0x1f5b('0x39')](_0x59de79)[_0x1f5b('0x23')](function(_0x134962){return _0x134962;});}return null;};}function removeEntity(_0x212bb0,_0x1aeaed){return function(_0x5e06e6){if(_0x5e06e6){return _0x5e06e6['destroy']()['then'](function(){_0x212bb0['status'](0xcc)[_0x1f5b('0x30')]();});}};}function handleEntityNotFound(_0x5770ba,_0x4fe245){return function(_0x19b549){if(!_0x19b549){_0x5770ba[_0x1f5b('0x2e')](0x194);}return _0x19b549;};}function handleError(_0x225a0c,_0x53c83c){_0x53c83c=_0x53c83c||0x1f4;return function(_0x4953e2){logger[_0x1f5b('0x28')](_0x4953e2[_0x1f5b('0x3a')]);if(_0x4953e2['name']){delete _0x4953e2['name'];}_0x225a0c[_0x1f5b('0x2f')](_0x53c83c)[_0x1f5b('0x3b')](_0x4953e2);};}exports[_0x1f5b('0x3c')]=function(_0x31f9d3,_0xbbe617){var _0x4270d5={},_0x398094={},_0x4b8f41={'count':0x0,'rows':[]};var _0x5381c5=_[_0x1f5b('0x3d')](db[_0x1f5b('0x3e')][_0x1f5b('0x3f')],function(_0xa5233e){return{'name':_0xa5233e[_0x1f5b('0x40')],'type':_0xa5233e['type']['key']};});_0x398094['model']=_[_0x1f5b('0x3d')](_0x5381c5,_0x1f5b('0x41'));_0x398094[_0x1f5b('0x42')]=_[_0x1f5b('0x43')](_0x31f9d3[_0x1f5b('0x42')]);_0x398094[_0x1f5b('0x44')]=_[_0x1f5b('0x45')](_0x398094[_0x1f5b('0x46')],_0x398094[_0x1f5b('0x42')]);_0x4270d5['attributes']=_[_0x1f5b('0x45')](_0x398094[_0x1f5b('0x46')],qs['fields'](_0x31f9d3[_0x1f5b('0x42')][_0x1f5b('0x47')]));_0x4270d5['attributes']=_0x4270d5[_0x1f5b('0x48')][_0x1f5b('0x49')]?_0x4270d5['attributes']:_0x398094[_0x1f5b('0x46')];if(!_0x31f9d3['query']['hasOwnProperty'](_0x1f5b('0x4a'))){_0x4270d5[_0x1f5b('0x33')]=qs[_0x1f5b('0x33')](_0x31f9d3[_0x1f5b('0x42')][_0x1f5b('0x33')]);_0x4270d5[_0x1f5b('0x32')]=qs[_0x1f5b('0x32')](_0x31f9d3[_0x1f5b('0x42')]['offset']);}_0x4270d5['order']=qs['sort'](_0x31f9d3['query'][_0x1f5b('0x4b')]);_0x4270d5[_0x1f5b('0x4c')]=qs[_0x1f5b('0x44')](_[_0x1f5b('0x4d')](_0x31f9d3[_0x1f5b('0x42')],_0x398094[_0x1f5b('0x44')]),_0x5381c5);if(_0x31f9d3[_0x1f5b('0x42')][_0x1f5b('0x4e')]){_0x4270d5[_0x1f5b('0x4c')]=_[_0x1f5b('0x4f')](_0x4270d5[_0x1f5b('0x4c')],{'$or':_[_0x1f5b('0x3d')](_0x5381c5,function(_0x5f3f6d){if(_0x5f3f6d['type']!==_0x1f5b('0x50')){var _0x4423d4={};_0x4423d4[_0x5f3f6d[_0x1f5b('0x41')]]={'$like':'%'+_0x31f9d3[_0x1f5b('0x42')][_0x1f5b('0x4e')]+'%'};return _0x4423d4;}})});}_0x4270d5=_[_0x1f5b('0x4f')]({},_0x4270d5,_0x31f9d3[_0x1f5b('0x51')]);var _0x50c060={'where':_0x4270d5[_0x1f5b('0x4c')]};return db[_0x1f5b('0x3e')][_0x1f5b('0x34')](_0x50c060)[_0x1f5b('0x23')](function(_0xdd2ca9){_0x4b8f41[_0x1f5b('0x34')]=_0xdd2ca9;if(_0x31f9d3[_0x1f5b('0x42')][_0x1f5b('0x52')]){_0x4270d5['include']=[{'all':!![]}];}return db[_0x1f5b('0x3e')][_0x1f5b('0x53')](_0x4270d5);})[_0x1f5b('0x23')](function(_0x2e2ca3){_0x4b8f41['rows']=_0x2e2ca3;return _0x4b8f41;})['then'](respondWithFilteredResult(_0xbbe617,_0x4270d5))[_0x1f5b('0x2d')](handleError(_0xbbe617,null));};exports['show']=function(_0x307de6,_0x43ecba){var _0x8fd5b1={'raw':!![],'where':{'id':_0x307de6[_0x1f5b('0x54')]['id']}},_0x2644b1={};_0x2644b1[_0x1f5b('0x46')]=_[_0x1f5b('0x43')](db[_0x1f5b('0x3e')]['rawAttributes']);_0x2644b1['query']=_[_0x1f5b('0x43')](_0x307de6[_0x1f5b('0x42')]);_0x2644b1[_0x1f5b('0x44')]=_[_0x1f5b('0x45')](_0x2644b1['model'],_0x2644b1['query']);_0x8fd5b1[_0x1f5b('0x48')]=_[_0x1f5b('0x45')](_0x2644b1['model'],qs[_0x1f5b('0x47')](_0x307de6[_0x1f5b('0x42')][_0x1f5b('0x47')]));_0x8fd5b1[_0x1f5b('0x48')]=_0x8fd5b1['attributes']['length']?_0x8fd5b1[_0x1f5b('0x48')]:_0x2644b1[_0x1f5b('0x46')];if(_0x307de6['query'][_0x1f5b('0x52')]){_0x8fd5b1[_0x1f5b('0x55')]=[{'all':!![]}];}_0x8fd5b1=_[_0x1f5b('0x4f')]({},_0x8fd5b1,_0x307de6[_0x1f5b('0x51')]);return db[_0x1f5b('0x3e')][_0x1f5b('0x56')](_0x8fd5b1)[_0x1f5b('0x23')](handleEntityNotFound(_0x43ecba,null))['then'](respondWithResult(_0x43ecba,null))[_0x1f5b('0x2d')](handleError(_0x43ecba,null));};exports[_0x1f5b('0x57')]=function(_0x55ec8f,_0x4b58e4){return db['SmsMessage'][_0x1f5b('0x57')](_0x55ec8f['body'],{})[_0x1f5b('0x23')](respondWithResult(_0x4b58e4,0xc9))[_0x1f5b('0x2d')](handleError(_0x4b58e4,null));};exports[_0x1f5b('0x39')]=function(_0x3ede13,_0xbe80c2){if(_0x3ede13[_0x1f5b('0x58')]['id']){delete _0x3ede13[_0x1f5b('0x58')]['id'];}return db[_0x1f5b('0x3e')][_0x1f5b('0x56')]({'where':{'id':_0x3ede13[_0x1f5b('0x54')]['id']}})[_0x1f5b('0x23')](handleEntityNotFound(_0xbe80c2,null))[_0x1f5b('0x23')](saveUpdates(_0x3ede13[_0x1f5b('0x58')],null))[_0x1f5b('0x23')](respondWithResult(_0xbe80c2,null))[_0x1f5b('0x2d')](handleError(_0xbe80c2,null));};exports[_0x1f5b('0x59')]=function(_0x160466,_0x51eb25){return db[_0x1f5b('0x3e')]['find']({'where':{'id':_0x160466[_0x1f5b('0x54')]['id']}})['then'](handleEntityNotFound(_0x51eb25,null))['then'](removeEntity(_0x51eb25,null))['catch'](handleError(_0x51eb25,null));};exports[_0x1f5b('0x5a')]=function(_0x1dc73c,_0x266b79){return db[_0x1f5b('0x3e')][_0x1f5b('0x5a')]()['then'](respondWithResult(_0x266b79,null))['catch'](handleError(_0x266b79,null));};var interaction_log=require(_0x1f5b('0x13'))('sms-interactions');exports[_0x1f5b('0x5b')]=function(_0x176832,_0x174a9e,_0x2dc66d){var _0x56de91={'agent':{},'channel':_0x1f5b('0x5c')};if(_0x176832['body']['id']){delete _0x176832['body']['id'];}_0x176832[_0x1f5b('0x58')][_0x1f5b('0x5d')]=!![];_0x176832[_0x1f5b('0x58')][_0x1f5b('0x5e')]=moment()[_0x1f5b('0x5f')](_0x1f5b('0x60'));_0x176832[_0x1f5b('0x58')]['UserId']=_0x176832[_0x1f5b('0x58')][_0x1f5b('0x61')]||_0x176832[_0x1f5b('0x62')]['id'];_0x56de91[_0x1f5b('0x63')]['id']=_0x176832['body'][_0x1f5b('0x61')];return db[_0x1f5b('0x3e')]['find']({'where':{'id':_0x176832[_0x1f5b('0x54')]['id'],'UserId':null}})[_0x1f5b('0x23')](handleEntityNotFound(_0x174a9e,null))[_0x1f5b('0x23')](saveUpdates(_0x176832['body'],null))[_0x1f5b('0x23')](function(_0x5d77b3){if(_0x5d77b3){_0x56de91[_0x1f5b('0x2a')]=_0x5d77b3[_0x1f5b('0x64')]({'plain':!![]});return db[_0x1f5b('0x65')][_0x1f5b('0x56')]({'where':{'id':_0x5d77b3[_0x1f5b('0x66')]}});}return null;})[_0x1f5b('0x23')](handleEntityNotFound(_0x174a9e,null))['then'](function(_0x42d725){if(_0x42d725){return _0x42d725[_0x1f5b('0x39')]({'UserId':_0x176832['body']['UserId'],'read1stAt':_[_0x1f5b('0x67')](_0x42d725['read1stAt'])?moment()[_0x1f5b('0x5f')](_0x1f5b('0x60')):undefined});}return null;})['then'](function(_0x5e3251){if(_0x5e3251){_0x56de91[_0x1f5b('0x68')]=_0x5e3251['get']({'plain':!![]});interaction_log[_0x1f5b('0x2b')](_0x1f5b('0x69'),_0x176832[_0x1f5b('0x62')]['id'],_0x176832[_0x1f5b('0x62')]['name'],_0x176832[_0x1f5b('0x62')]['role'],_0x56de91[_0x1f5b('0x68')]['id'],_0x176832['body']?JSON[_0x1f5b('0x27')](_0x176832[_0x1f5b('0x58')]):'null');return respondWithRpcPromise(_0x1f5b('0x6a'),_0x1f5b('0x6b'),_0x56de91);}return null;})[_0x1f5b('0x23')](function(_0x2dc844){var _0x3c473d=_0x1f5b('0x6c')+_0x2dc844['message'][_0x1f5b('0x6d')];return db[_0x1f5b('0x6e')][_0x1f5b('0x42')](_0x3c473d,{'type':db['Sequelize'][_0x1f5b('0x6f')][_0x1f5b('0x70')],'raw':!![]})['then'](function(_0x2c393d){return _0x2c393d;});})['then'](function(_0x1a7f6c){if(_0x1a7f6c){_0x56de91[_0x1f5b('0x2a')][_0x1f5b('0x71')]=_0x1a7f6c[0x0];if(!_0x176832['body'][_0x1f5b('0x61')])return;return db[_0x1f5b('0x72')][_0x1f5b('0x56')]({'where':{'id':_0x176832['body'][_0x1f5b('0x61')],'role':_0x1f5b('0x63')},'attributes':['id',_0x1f5b('0x41'),'fullname',_0x1f5b('0x73'),_0x1f5b('0x74')],'raw':!![]});}return null;})[_0x1f5b('0x23')](function(_0x300cb7){if(!_0x300cb7)return null;_0x56de91[_0x1f5b('0x2a')]['agent']=_0x300cb7;return _0x56de91;})[_0x1f5b('0x23')](function(_0x230a8e){if(_0x230a8e){if(_0x176832['body'][_0x1f5b('0x75')]){_0x56de91[_0x1f5b('0x2a')][_0x1f5b('0x76')]=util[_0x1f5b('0x5f')](_0x1f5b('0x77'),_0x176832[_0x1f5b('0x62')][_0x1f5b('0x41')]);_0x56de91['message'][_0x1f5b('0x78')]=_0x56de91[_0x1f5b('0x78')];_0x56de91['message'][_0x1f5b('0x79')]=_0x1f5b('0x5b');return respondWithRpcPromise('EventManager',_0x1f5b('0x7a'),{'event':_0x1f5b('0x7b'),'message':_0x56de91['message']},client9002)[_0x1f5b('0x23')](function(){return _0x56de91;});}return _0x56de91;}return null;})[_0x1f5b('0x23')](respondWithResult(_0x174a9e,null))[_0x1f5b('0x2d')](handleError(_0x174a9e,null));};var interaction_log=require(_0x1f5b('0x13'))('sms-interactions');exports['reject']=function(_0x4aac07,_0x823443,_0x5b5e93){var _0x5addcc={'agent':{},'channel':_0x1f5b('0x5c')};if(_0x4aac07[_0x1f5b('0x58')]['id']){delete _0x4aac07[_0x1f5b('0x58')]['id'];}_0x4aac07[_0x1f5b('0x58')][_0x1f5b('0x61')]=_0x4aac07[_0x1f5b('0x58')]['UserId']||_0x4aac07[_0x1f5b('0x62')]['id'];_0x5addcc[_0x1f5b('0x63')]['id']=_0x4aac07[_0x1f5b('0x58')][_0x1f5b('0x61')];return db[_0x1f5b('0x3e')]['find']({'where':{'id':_0x4aac07[_0x1f5b('0x54')]['id'],'UserId':null}})[_0x1f5b('0x23')](handleEntityNotFound(_0x823443,null))['then'](function(_0x3269db){if(_0x3269db){_0x5addcc['message']=_0x3269db[_0x1f5b('0x64')]({'plain':!![]});return db['SmsInteraction'][_0x1f5b('0x56')]({'where':{'id':_0x3269db['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x823443,null))[_0x1f5b('0x23')](function(_0x1fbb77){if(_0x1fbb77){_0x5addcc[_0x1f5b('0x68')]=_0x1fbb77[_0x1f5b('0x64')]({'plain':!![]});interaction_log[_0x1f5b('0x2b')](_0x1f5b('0x7c'),_0x4aac07[_0x1f5b('0x62')]['id'],_0x4aac07[_0x1f5b('0x62')][_0x1f5b('0x41')],_0x4aac07[_0x1f5b('0x62')]['role'],_0x5addcc[_0x1f5b('0x68')]['id'],_0x4aac07[_0x1f5b('0x58')]?JSON[_0x1f5b('0x27')](_0x4aac07[_0x1f5b('0x58')]):'null');return respondWithRpcPromise(_0x1f5b('0x7d'),_0x1f5b('0x7e'),_0x5addcc);}return null;})[_0x1f5b('0x23')](function(_0x380f01){var _0x3c2b7a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x380f01[_0x1f5b('0x2a')][_0x1f5b('0x6d')];return db[_0x1f5b('0x6e')][_0x1f5b('0x42')](_0x3c2b7a,{'type':db[_0x1f5b('0x7f')][_0x1f5b('0x6f')][_0x1f5b('0x70')],'raw':!![]})['then'](function(_0x3a04c2){return _0x3a04c2;});})[_0x1f5b('0x23')](function(_0xede869){if(_0xede869){_0x5addcc[_0x1f5b('0x2a')][_0x1f5b('0x71')]=_0xede869[0x0];if(!_0x4aac07['body']['UserId'])return;return db['User'][_0x1f5b('0x56')]({'where':{'id':_0x4aac07[_0x1f5b('0x58')][_0x1f5b('0x61')],'role':_0x1f5b('0x63')},'attributes':['id',_0x1f5b('0x41'),_0x1f5b('0x80'),_0x1f5b('0x73'),_0x1f5b('0x74')],'raw':!![]});}return null;})[_0x1f5b('0x23')](function(_0x12043c){if(!_0x12043c)return null;_0x5addcc[_0x1f5b('0x2a')][_0x1f5b('0x63')]=_0x12043c;return _0x5addcc;})[_0x1f5b('0x23')](function(_0x857a9d){if(_0x857a9d){_0x857a9d['message'][_0x1f5b('0x76')]=util[_0x1f5b('0x5f')](_0x1f5b('0x77'),_0x4aac07[_0x1f5b('0x62')][_0x1f5b('0x41')]);_0x857a9d[_0x1f5b('0x2a')][_0x1f5b('0x78')]=_0x5addcc[_0x1f5b('0x78')];_0x857a9d[_0x1f5b('0x2a')][_0x1f5b('0x79')]=_0x1f5b('0x37');respondWithRpcPromise(_0x1f5b('0x7a'),_0x1f5b('0x7a'),{'event':_0x1f5b('0x81'),'message':_0x857a9d['message']},client9002);return _0x5addcc;}return null;})[_0x1f5b('0x23')](respondWithResult(_0x823443,null))['catch'](handleError(_0x823443,null));};exports['status']=function(_0x3b43a3,_0x293db6,_0x32da0d){if(_0x3b43a3[_0x1f5b('0x58')]['id']){delete _0x3b43a3['body']['id'];}var _0x3e7398;return db[_0x1f5b('0x3e')]['find']({'where':{'id':_0x3b43a3[_0x1f5b('0x54')]['id']}})[_0x1f5b('0x23')](handleEntityNotFound(_0x293db6,null))[_0x1f5b('0x23')](function(_0x27107b){if(_0x27107b){_0x3e7398=_0x27107b;return db[_0x1f5b('0x82')][_0x1f5b('0x56')]({'where':{'id':_0x27107b[_0x1f5b('0x83')]}});}})[_0x1f5b('0x23')](handleEntityNotFound(_0x293db6,null))[_0x1f5b('0x23')](function(_0x5b1faa){if(_0x5b1faa){logger[_0x1f5b('0x84')](_0x1f5b('0x25'),_0x1f5b('0x2f'),'received\x20delivery\x20report\x20from',_0x5b1faa['type'],util[_0x1f5b('0x85')](_0x3b43a3['body'],{'showHidden':![],'depth':null}));switch(_0x5b1faa[_0x1f5b('0x86')]){case _0x1f5b('0x87'):if(_0x3b43a3['body'][_0x1f5b('0x88')]&&_0x3b43a3[_0x1f5b('0x58')]['MessageSid']===_0x3e7398[_0x1f5b('0x89')]){return _0x3e7398[_0x1f5b('0x39')]({'read':!![]});}else{logger[_0x1f5b('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1f5b('0x2f'),_0x1f5b('0x87'),util[_0x1f5b('0x85')](_0x3b43a3[_0x1f5b('0x58')],{'showHidden':![],'depth':null}));}break;case _0x1f5b('0x8a'):if(_0x3b43a3[_0x1f5b('0x58')][_0x1f5b('0x8b')]&&_0x3b43a3[_0x1f5b('0x58')]['MessageUUID']===_0x3e7398[_0x1f5b('0x89')]&&_['indexOf']([_0x1f5b('0x8c'),_0x1f5b('0x8d')],_0x3b43a3['body'][_0x1f5b('0x8e')])>=0x0){return _0x3e7398['update']({'read':!![]});}else{logger[_0x1f5b('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x1f5b('0x8f'),util['inspect'](_0x3b43a3['body'],{'showHidden':![],'depth':null}));}break;case _0x1f5b('0x90'):var _0x1b3f7d=_0x3b43a3[_0x1f5b('0x58')][_0x1f5b('0x91')][0x0];if(_0x1b3f7d['status']['groupName']===_0x1f5b('0x92')){return _0x3e7398['update']({'read':!![]});}else{logger['error'](_0x1f5b('0x93'),_0x1f5b('0x2f'),'infobip',util[_0x1f5b('0x85')](_0x3b43a3[_0x1f5b('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x3e7398;}})[_0x1f5b('0x23')](respondWithResult(_0x293db6,null))[_0x1f5b('0x2d')](handleError(_0x293db6,null));}; \ No newline at end of file +var _0x102b=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsMessage.socket','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','destroy','end','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','SmsMessage','findAll','rows','params','find','create','body','describe','sms-interactions','accept','sms','read','format','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','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','SELECT','User','fullname','channel','event','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','Sequelize','contact','internal','SIP/%s','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','plivo','MessageUUID','indexOf','sent','delivered','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','inspect','infobip','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x4e69a5,_0x157ec0){var _0x5b6106=function(_0x331a16){while(--_0x331a16){_0x4e69a5['push'](_0x4e69a5['shift']());}};_0x5b6106(++_0x157ec0);}(_0x102b,0x82));var _0xb102=function(_0x31a2ef,_0x4e5cc6){_0x31a2ef=_0x31a2ef-0x0;var _0x581e4b=_0x102b[_0x31a2ef];return _0x581e4b;};'use strict';var emlformat=require(_0xb102('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb102('0x1'));var jsonpatch=require(_0xb102('0x2'));var rp=require(_0xb102('0x3'));var moment=require(_0xb102('0x4'));var BPromise=require(_0xb102('0x5'));var Mustache=require(_0xb102('0x6'));var util=require(_0xb102('0x7'));var path=require(_0xb102('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb102('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb102('0xa'));var squel=require(_0xb102('0xb'));var crypto=require(_0xb102('0xc'));var jsforce=require(_0xb102('0xd'));var deskjs=require(_0xb102('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb102('0xf'));var Papa=require(_0xb102('0x10'));var Redis=require(_0xb102('0x11'));var authService=require(_0xb102('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb102('0x13'));var hardwareService=require(_0xb102('0x14'));var logger=require(_0xb102('0x15'))(_0xb102('0x16'));var utils=require(_0xb102('0x17'));var config=require(_0xb102('0x18'));var licenseUtil=require(_0xb102('0x19'));var db=require(_0xb102('0x1a'))['db'];config[_0xb102('0x1b')]=_[_0xb102('0x1c')](config[_0xb102('0x1b')],{'host':_0xb102('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb102('0x1e'))['register'](socket);var jayson=require(_0xb102('0x1f'));var client=jayson[_0xb102('0x20')][_0xb102('0x21')]({'port':0x232c});var client9002=jayson[_0xb102('0x20')][_0xb102('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x15a70a,_0xa75f0,_0x5022e5,_0x529900){return new BPromise(function(_0x15e262,_0x2b677c){var _0x5f2d74=_0x529900||client;return _0x5f2d74[_0xb102('0x22')](_0x15a70a,_0x5022e5)[_0xb102('0x23')](function(_0x329831){logger[_0xb102('0x24')](_0xb102('0x25'),_0xa75f0,'request\x20sent');logger[_0xb102('0x26')](_0xb102('0x27'),_0xa75f0,'request\x20sent',JSON[_0xb102('0x28')](_0x329831));if(_0x329831[_0xb102('0x29')]){if(_0x329831['error'][_0xb102('0x2a')]===0x1f4){logger[_0xb102('0x29')](_0xb102('0x25'),_0xa75f0,_0x329831[_0xb102('0x29')][_0xb102('0x2b')]);return _0x2b677c(_0x329831[_0xb102('0x29')]['message']);}logger[_0xb102('0x29')](_0xb102('0x25'),_0xa75f0,_0x329831[_0xb102('0x29')]['message']);return _0x15e262(_0x329831[_0xb102('0x29')]['message']);}else{logger[_0xb102('0x24')](_0xb102('0x25'),_0xa75f0,'request\x20sent');_0x15e262(_0x329831[_0xb102('0x2c')][_0xb102('0x2b')]);}})[_0xb102('0x2d')](function(_0x4d653e){logger['error']('SmsMessage,\x20%s,\x20%s',_0xa75f0,_0x4d653e);_0x2b677c(_0x4d653e);});});}function respondWithStatusCode(_0x8dd925,_0x46967c){_0x46967c=_0x46967c||0xcc;return function(_0x59b122){if(_0x59b122){return _0x8dd925[_0xb102('0x2e')](_0x46967c);}return _0x8dd925['status'](_0x46967c)['end']();};}function respondWithResult(_0x451d6c,_0x41e210){_0x41e210=_0x41e210||0xc8;return function(_0x4cd24f){if(_0x4cd24f){return _0x451d6c[_0xb102('0x2f')](_0x41e210)[_0xb102('0x30')](_0x4cd24f);}};}function respondWithFilteredResult(_0x2f8003,_0x2a5bab){return function(_0x17cf14){if(_0x17cf14){var _0x27caa=typeof _0x2a5bab[_0xb102('0x31')]===_0xb102('0x32')&&typeof _0x2a5bab['limit']===_0xb102('0x32');var _0x59b8b8=_0x17cf14[_0xb102('0x33')];var _0x30529b=_0x27caa?0x0:_0x2a5bab[_0xb102('0x31')];var _0x5f11d4=_0x27caa?_0x17cf14['count']:_0x2a5bab[_0xb102('0x31')]+_0x2a5bab[_0xb102('0x34')];var _0x5f090d;if(_0x5f11d4>=_0x59b8b8){_0x5f11d4=_0x59b8b8;_0x5f090d=0xc8;}else{_0x5f090d=0xce;}_0x2f8003[_0xb102('0x2f')](_0x5f090d);return _0x2f8003['set'](_0xb102('0x35'),_0x30529b+'-'+_0x5f11d4+'/'+_0x59b8b8)[_0xb102('0x30')](_0x17cf14);}return null;};}function patchUpdates(_0x4fd9c7){return function(_0x12bb9e){try{jsonpatch[_0xb102('0x36')](_0x12bb9e,_0x4fd9c7,!![]);}catch(_0x4792b8){return BPromise[_0xb102('0x37')](_0x4792b8);}return _0x12bb9e[_0xb102('0x38')]();};}function saveUpdates(_0x48d208,_0x544ab6){return function(_0x1e55b6){if(_0x1e55b6){return _0x1e55b6[_0xb102('0x39')](_0x48d208)[_0xb102('0x23')](function(_0x240c42){return _0x240c42;});}return null;};}function removeEntity(_0x47f71e,_0x57215b){return function(_0x1b6c26){if(_0x1b6c26){return _0x1b6c26[_0xb102('0x3a')]()['then'](function(){_0x47f71e['status'](0xcc)[_0xb102('0x3b')]();});}};}function handleEntityNotFound(_0x70855a,_0x45eba6){return function(_0x3d6d4e){if(!_0x3d6d4e){_0x70855a[_0xb102('0x2e')](0x194);}return _0x3d6d4e;};}function handleError(_0x428498,_0x29b6d1){_0x29b6d1=_0x29b6d1||0x1f4;return function(_0x43f698){logger[_0xb102('0x29')](_0x43f698['stack']);if(_0x43f698[_0xb102('0x3c')]){delete _0x43f698['name'];}_0x428498['status'](_0x29b6d1)['send'](_0x43f698);};}exports['index']=function(_0x188481,_0xf97595){var _0x236f00={},_0x9ed3c2={},_0x3f25c6={'count':0x0,'rows':[]};var _0x10c0a6=_[_0xb102('0x3d')](db['SmsMessage'][_0xb102('0x3e')],function(_0xe062af){return{'name':_0xe062af[_0xb102('0x3f')],'type':_0xe062af[_0xb102('0x40')][_0xb102('0x41')]};});_0x9ed3c2[_0xb102('0x42')]=_[_0xb102('0x3d')](_0x10c0a6,_0xb102('0x3c'));_0x9ed3c2[_0xb102('0x43')]=_[_0xb102('0x44')](_0x188481[_0xb102('0x43')]);_0x9ed3c2[_0xb102('0x45')]=_['intersection'](_0x9ed3c2[_0xb102('0x42')],_0x9ed3c2[_0xb102('0x43')]);_0x236f00[_0xb102('0x46')]=_[_0xb102('0x47')](_0x9ed3c2[_0xb102('0x42')],qs[_0xb102('0x48')](_0x188481[_0xb102('0x43')]['fields']));_0x236f00['attributes']=_0x236f00[_0xb102('0x46')][_0xb102('0x49')]?_0x236f00[_0xb102('0x46')]:_0x9ed3c2[_0xb102('0x42')];if(!_0x188481[_0xb102('0x43')][_0xb102('0x4a')](_0xb102('0x4b'))){_0x236f00[_0xb102('0x34')]=qs[_0xb102('0x34')](_0x188481[_0xb102('0x43')][_0xb102('0x34')]);_0x236f00[_0xb102('0x31')]=qs[_0xb102('0x31')](_0x188481[_0xb102('0x43')]['offset']);}_0x236f00[_0xb102('0x4c')]=qs[_0xb102('0x4d')](_0x188481[_0xb102('0x43')][_0xb102('0x4d')]);_0x236f00['where']=qs[_0xb102('0x45')](_[_0xb102('0x4e')](_0x188481[_0xb102('0x43')],_0x9ed3c2[_0xb102('0x45')]),_0x10c0a6);if(_0x188481[_0xb102('0x43')][_0xb102('0x4f')]){_0x236f00[_0xb102('0x50')]=_[_0xb102('0x51')](_0x236f00[_0xb102('0x50')],{'$or':_[_0xb102('0x3d')](_0x10c0a6,function(_0x29edee){if(_0x29edee[_0xb102('0x40')]!==_0xb102('0x52')){var _0x486cdb={};_0x486cdb[_0x29edee[_0xb102('0x3c')]]={'$like':'%'+_0x188481[_0xb102('0x43')][_0xb102('0x4f')]+'%'};return _0x486cdb;}})});}_0x236f00=_[_0xb102('0x51')]({},_0x236f00,_0x188481[_0xb102('0x53')]);var _0x3e1136={'where':_0x236f00[_0xb102('0x50')]};return db['SmsMessage'][_0xb102('0x33')](_0x3e1136)[_0xb102('0x23')](function(_0x22360a){_0x3f25c6['count']=_0x22360a;if(_0x188481[_0xb102('0x43')][_0xb102('0x54')]){_0x236f00[_0xb102('0x55')]=[{'all':!![]}];}return db[_0xb102('0x56')][_0xb102('0x57')](_0x236f00);})[_0xb102('0x23')](function(_0x276a56){_0x3f25c6[_0xb102('0x58')]=_0x276a56;return _0x3f25c6;})[_0xb102('0x23')](respondWithFilteredResult(_0xf97595,_0x236f00))[_0xb102('0x2d')](handleError(_0xf97595,null));};exports['show']=function(_0x58e330,_0x331ac3){var _0x22f2fc={'raw':!![],'where':{'id':_0x58e330[_0xb102('0x59')]['id']}},_0x3ec2ad={};_0x3ec2ad[_0xb102('0x42')]=_['keys'](db[_0xb102('0x56')][_0xb102('0x3e')]);_0x3ec2ad[_0xb102('0x43')]=_['keys'](_0x58e330[_0xb102('0x43')]);_0x3ec2ad[_0xb102('0x45')]=_[_0xb102('0x47')](_0x3ec2ad[_0xb102('0x42')],_0x3ec2ad[_0xb102('0x43')]);_0x22f2fc[_0xb102('0x46')]=_[_0xb102('0x47')](_0x3ec2ad['model'],qs[_0xb102('0x48')](_0x58e330[_0xb102('0x43')][_0xb102('0x48')]));_0x22f2fc['attributes']=_0x22f2fc['attributes'][_0xb102('0x49')]?_0x22f2fc[_0xb102('0x46')]:_0x3ec2ad[_0xb102('0x42')];if(_0x58e330[_0xb102('0x43')][_0xb102('0x54')]){_0x22f2fc[_0xb102('0x55')]=[{'all':!![]}];}_0x22f2fc=_[_0xb102('0x51')]({},_0x22f2fc,_0x58e330[_0xb102('0x53')]);return db['SmsMessage'][_0xb102('0x5a')](_0x22f2fc)['then'](handleEntityNotFound(_0x331ac3,null))[_0xb102('0x23')](respondWithResult(_0x331ac3,null))[_0xb102('0x2d')](handleError(_0x331ac3,null));};exports[_0xb102('0x5b')]=function(_0x29729a,_0xee5665){return db[_0xb102('0x56')][_0xb102('0x5b')](_0x29729a['body'],{})[_0xb102('0x23')](respondWithResult(_0xee5665,0xc9))[_0xb102('0x2d')](handleError(_0xee5665,null));};exports['update']=function(_0x4df0f2,_0x9580d7){if(_0x4df0f2[_0xb102('0x5c')]['id']){delete _0x4df0f2[_0xb102('0x5c')]['id'];}return db['SmsMessage'][_0xb102('0x5a')]({'where':{'id':_0x4df0f2[_0xb102('0x59')]['id']}})[_0xb102('0x23')](handleEntityNotFound(_0x9580d7,null))[_0xb102('0x23')](saveUpdates(_0x4df0f2[_0xb102('0x5c')],null))[_0xb102('0x23')](respondWithResult(_0x9580d7,null))[_0xb102('0x2d')](handleError(_0x9580d7,null));};exports['destroy']=function(_0x4e7c5d,_0xfc35b6){return db[_0xb102('0x56')]['find']({'where':{'id':_0x4e7c5d['params']['id']}})['then'](handleEntityNotFound(_0xfc35b6,null))['then'](removeEntity(_0xfc35b6,null))['catch'](handleError(_0xfc35b6,null));};exports[_0xb102('0x5d')]=function(_0x1d07aa,_0x54b8ce){return db[_0xb102('0x56')]['describe']()[_0xb102('0x23')](respondWithResult(_0x54b8ce,null))['catch'](handleError(_0x54b8ce,null));};var interaction_log=require(_0xb102('0x15'))(_0xb102('0x5e'));exports[_0xb102('0x5f')]=function(_0x38929,_0x1a004f,_0x5f2195){var _0x46f99a={'agent':{},'channel':_0xb102('0x60')};if(_0x38929[_0xb102('0x5c')]['id']){delete _0x38929['body']['id'];}_0x38929['body'][_0xb102('0x61')]=!![];_0x38929[_0xb102('0x5c')]['readAt']=moment()[_0xb102('0x62')](_0xb102('0x63'));_0x38929['body'][_0xb102('0x64')]=_0x38929[_0xb102('0x5c')][_0xb102('0x64')]||_0x38929[_0xb102('0x65')]['id'];_0x46f99a[_0xb102('0x66')]['id']=_0x38929[_0xb102('0x5c')][_0xb102('0x64')];return db['SmsMessage'][_0xb102('0x5a')]({'where':{'id':_0x38929[_0xb102('0x59')]['id'],'UserId':null}})[_0xb102('0x23')](handleEntityNotFound(_0x1a004f,null))[_0xb102('0x23')](saveUpdates(_0x38929[_0xb102('0x5c')],null))['then'](function(_0x8ac8a0){if(_0x8ac8a0){_0x46f99a[_0xb102('0x2b')]=_0x8ac8a0[_0xb102('0x67')]({'plain':!![]});return db[_0xb102('0x68')][_0xb102('0x5a')]({'where':{'id':_0x8ac8a0[_0xb102('0x69')]}});}return null;})[_0xb102('0x23')](handleEntityNotFound(_0x1a004f,null))[_0xb102('0x23')](function(_0x1fd8b5){if(_0x1fd8b5){return _0x1fd8b5[_0xb102('0x39')]({'UserId':_0x38929[_0xb102('0x5c')][_0xb102('0x64')],'read1stAt':_[_0xb102('0x6a')](_0x1fd8b5[_0xb102('0x6b')])?moment()['format'](_0xb102('0x63')):undefined});}return null;})[_0xb102('0x23')](function(_0x35885a){if(_0x35885a){_0x46f99a[_0xb102('0x6c')]=_0x35885a[_0xb102('0x67')]({'plain':!![]});interaction_log[_0xb102('0x24')](_0xb102('0x6d'),_0x38929[_0xb102('0x65')]['id'],_0x38929[_0xb102('0x65')]['name'],_0x38929[_0xb102('0x65')][_0xb102('0x6e')],_0x46f99a[_0xb102('0x6c')]['id'],_0x38929[_0xb102('0x5c')]?JSON[_0xb102('0x28')](_0x38929[_0xb102('0x5c')]):_0xb102('0x6f'));return respondWithRpcPromise(_0xb102('0x70'),'acceptMessage',_0x46f99a);}return null;})[_0xb102('0x23')](function(_0x6a20ff){var _0x34aa03=_0xb102('0x71')+_0x6a20ff[_0xb102('0x2b')]['ContactId'];return db[_0xb102('0x72')][_0xb102('0x43')](_0x34aa03,{'type':db['Sequelize'][_0xb102('0x73')][_0xb102('0x74')],'raw':!![]})[_0xb102('0x23')](function(_0x4a5d2d){return _0x4a5d2d;});})[_0xb102('0x23')](function(_0x22fe0a){if(_0x22fe0a){_0x46f99a['message']['contact']=_0x22fe0a[0x0];if(!_0x38929[_0xb102('0x5c')]['UserId'])return;return db[_0xb102('0x75')][_0xb102('0x5a')]({'where':{'id':_0x38929[_0xb102('0x5c')]['UserId'],'role':_0xb102('0x66')},'attributes':['id',_0xb102('0x3c'),_0xb102('0x76'),'email','internal'],'raw':!![]});}return null;})[_0xb102('0x23')](function(_0x184302){if(!_0x184302)return null;_0x46f99a[_0xb102('0x2b')][_0xb102('0x66')]=_0x184302;return _0x46f99a;})[_0xb102('0x23')](function(_0x2b61a9){if(_0x2b61a9){if(_0x38929[_0xb102('0x5c')]['manual']){_0x46f99a[_0xb102('0x2b')]['interface']=util[_0xb102('0x62')]('SIP/%s',_0x38929['user']['name']);_0x46f99a[_0xb102('0x2b')][_0xb102('0x77')]=_0x46f99a['channel'];_0x46f99a[_0xb102('0x2b')][_0xb102('0x78')]=_0xb102('0x5f');return respondWithRpcPromise(_0xb102('0x79'),_0xb102('0x79'),{'event':_0xb102('0x7a'),'message':_0x46f99a[_0xb102('0x2b')]},client9002)['then'](function(){return _0x46f99a;});}return _0x46f99a;}return null;})[_0xb102('0x23')](respondWithResult(_0x1a004f,null))[_0xb102('0x2d')](handleError(_0x1a004f,null));};var interaction_log=require(_0xb102('0x15'))(_0xb102('0x5e'));exports[_0xb102('0x37')]=function(_0xa9f4a8,_0x77072f,_0x591347){var _0x21c59d={'agent':{},'channel':_0xb102('0x60')};if(_0xa9f4a8['body']['id']){delete _0xa9f4a8[_0xb102('0x5c')]['id'];}_0xa9f4a8['body'][_0xb102('0x64')]=_0xa9f4a8[_0xb102('0x5c')]['UserId']||_0xa9f4a8[_0xb102('0x65')]['id'];_0x21c59d['agent']['id']=_0xa9f4a8[_0xb102('0x5c')][_0xb102('0x64')];return db[_0xb102('0x56')]['find']({'where':{'id':_0xa9f4a8[_0xb102('0x59')]['id'],'UserId':null}})[_0xb102('0x23')](handleEntityNotFound(_0x77072f,null))[_0xb102('0x23')](function(_0x2d9296){if(_0x2d9296){_0x21c59d[_0xb102('0x2b')]=_0x2d9296[_0xb102('0x67')]({'plain':!![]});return db['SmsInteraction']['find']({'where':{'id':_0x2d9296[_0xb102('0x69')]}});}return null;})['then'](handleEntityNotFound(_0x77072f,null))[_0xb102('0x23')](function(_0x318cb2){if(_0x318cb2){_0x21c59d[_0xb102('0x6c')]=_0x318cb2[_0xb102('0x67')]({'plain':!![]});interaction_log['info'](_0xb102('0x7b'),_0xa9f4a8[_0xb102('0x65')]['id'],_0xa9f4a8[_0xb102('0x65')][_0xb102('0x3c')],_0xa9f4a8[_0xb102('0x65')][_0xb102('0x6e')],_0x21c59d['interaction']['id'],_0xa9f4a8[_0xb102('0x5c')]?JSON[_0xb102('0x28')](_0xa9f4a8[_0xb102('0x5c')]):_0xb102('0x6f'));return respondWithRpcPromise(_0xb102('0x7c'),_0xb102('0x7d'),_0x21c59d);}return null;})[_0xb102('0x23')](function(_0x5588a9){var _0x27aeca=_0xb102('0x71')+_0x5588a9[_0xb102('0x2b')][_0xb102('0x7e')];return db[_0xb102('0x72')][_0xb102('0x43')](_0x27aeca,{'type':db[_0xb102('0x7f')]['QueryTypes'][_0xb102('0x74')],'raw':!![]})[_0xb102('0x23')](function(_0x3ccb71){return _0x3ccb71;});})[_0xb102('0x23')](function(_0xc1db3c){if(_0xc1db3c){_0x21c59d[_0xb102('0x2b')][_0xb102('0x80')]=_0xc1db3c[0x0];if(!_0xa9f4a8[_0xb102('0x5c')]['UserId'])return;return db[_0xb102('0x75')][_0xb102('0x5a')]({'where':{'id':_0xa9f4a8[_0xb102('0x5c')][_0xb102('0x64')],'role':_0xb102('0x66')},'attributes':['id',_0xb102('0x3c'),'fullname','email',_0xb102('0x81')],'raw':!![]});}return null;})['then'](function(_0x2d8dd0){if(!_0x2d8dd0)return null;_0x21c59d[_0xb102('0x2b')]['agent']=_0x2d8dd0;return _0x21c59d;})[_0xb102('0x23')](function(_0x3b48b1){if(_0x3b48b1){_0x3b48b1[_0xb102('0x2b')]['interface']=util[_0xb102('0x62')](_0xb102('0x82'),_0xa9f4a8[_0xb102('0x65')][_0xb102('0x3c')]);_0x3b48b1[_0xb102('0x2b')][_0xb102('0x77')]=_0x21c59d[_0xb102('0x77')];_0x3b48b1['message']['event']='reject';respondWithRpcPromise('EventManager',_0xb102('0x79'),{'event':_0xb102('0x83'),'message':_0x3b48b1[_0xb102('0x2b')]},client9002);return _0x21c59d;}return null;})[_0xb102('0x23')](respondWithResult(_0x77072f,null))[_0xb102('0x2d')](handleError(_0x77072f,null));};exports['status']=function(_0x2ddcd5,_0x5588e3,_0x5e07bc){if(_0x2ddcd5[_0xb102('0x5c')]['id']){delete _0x2ddcd5[_0xb102('0x5c')]['id'];}var _0x148839;return db['SmsMessage'][_0xb102('0x5a')]({'where':{'id':_0x2ddcd5[_0xb102('0x59')]['id']}})[_0xb102('0x23')](handleEntityNotFound(_0x5588e3,null))['then'](function(_0x33a9d9){if(_0x33a9d9){_0x148839=_0x33a9d9;return db[_0xb102('0x84')][_0xb102('0x5a')]({'where':{'id':_0x33a9d9[_0xb102('0x85')]}});}})['then'](handleEntityNotFound(_0x5588e3,null))[_0xb102('0x23')](function(_0x2ebd92){if(_0x2ebd92){logger[_0xb102('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb102('0x2f'),_0xb102('0x86'),_0x2ebd92[_0xb102('0x40')],util['inspect'](_0x2ddcd5[_0xb102('0x5c')],{'showHidden':![],'depth':null}));switch(_0x2ebd92['type']){case _0xb102('0x87'):if(_0x2ddcd5['body'][_0xb102('0x88')]&&_0x2ddcd5[_0xb102('0x5c')]['MessageSid']===_0x148839[_0xb102('0x89')]){return _0x148839['update']({'read':!![]});}else{logger[_0xb102('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xb102('0x2f'),_0xb102('0x87'),util['inspect'](_0x2ddcd5[_0xb102('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xb102('0x8a'):if(_0x2ddcd5[_0xb102('0x5c')][_0xb102('0x8b')]&&_0x2ddcd5[_0xb102('0x5c')][_0xb102('0x8b')]===_0x148839['messageId']&&_[_0xb102('0x8c')]([_0xb102('0x8d'),_0xb102('0x8e')],_0x2ddcd5[_0xb102('0x5c')]['Status'])>=0x0){return _0x148839[_0xb102('0x39')]({'read':!![]});}else{logger[_0xb102('0x29')](_0xb102('0x8f'),_0xb102('0x2f'),_0xb102('0x90'),util[_0xb102('0x91')](_0x2ddcd5[_0xb102('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xb102('0x92'):var _0x587229=_0x2ddcd5[_0xb102('0x5c')]['results'][0x0];if(_0x587229[_0xb102('0x2f')]['groupName']==='DELIVERED'){return _0x148839['update']({'read':!![]});}else{logger['error'](_0xb102('0x8f'),'status',_0xb102('0x92'),util[_0xb102('0x91')](_0x2ddcd5[_0xb102('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x148839;}})['then'](respondWithResult(_0x5588e3,null))[_0xb102('0x2d')](handleError(_0x5588e3,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index f2c2a34..9265ca3 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 _0x403b=['hasOwnProperty','hook','exports','events','../../mysqldb','SmsMessage','save','update','remove','emit'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x403b,0xdf));var _0xb403=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x403b[_0x59ee6f];return _0x4c0979;};'use strict';var EventEmitter=require(_0xb403('0x0'));var SmsMessage=require(_0xb403('0x1'))['db'][_0xb403('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb403('0x3'),'afterUpdate':_0xb403('0x4'),'afterDestroy':_0xb403('0x5')};function emitEvent(_0x1baaa1){return function(_0x5d0069,_0x5ae80d,_0x511470){SmsMessageEvents[_0xb403('0x6')](_0x1baaa1+':'+_0x5d0069['id'],_0x5d0069);SmsMessageEvents['emit'](_0x1baaa1,_0x5d0069);_0x511470(null);};}for(var e in events){if(events[_0xb403('0x7')](e)){var event=events[e];SmsMessage[_0xb403('0x8')](e,emitEvent(event));}}module[_0xb403('0x9')]=SmsMessageEvents; \ No newline at end of file +var _0xe1fd=['exports','events','../../mysqldb','SmsMessage','save','update','emit','hook'];(function(_0x352e09,_0x37a7da){var _0x1b7094=function(_0x561074){while(--_0x561074){_0x352e09['push'](_0x352e09['shift']());}};_0x1b7094(++_0x37a7da);}(_0xe1fd,0x111));var _0xde1f=function(_0x228ddc,_0x5b159c){_0x228ddc=_0x228ddc-0x0;var _0x29c2ed=_0xe1fd[_0x228ddc];return _0x29c2ed;};'use strict';var EventEmitter=require(_0xde1f('0x0'));var SmsMessage=require(_0xde1f('0x1'))['db'][_0xde1f('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xde1f('0x3'),'afterUpdate':_0xde1f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x166f20){return function(_0x4207e2,_0x3d00ae,_0x5cd4d1){SmsMessageEvents[_0xde1f('0x5')](_0x166f20+':'+_0x4207e2['id'],_0x4207e2);SmsMessageEvents['emit'](_0x166f20,_0x4207e2);_0x5cd4d1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0xde1f('0x6')](e,emitEvent(event));}}module[_0xde1f('0x7')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index c2211a9..823037d 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 _0xc560=['md5','hex','signature=','/external/get/send.php?','csc','clickatell','uuid','apiMessageId','Missing\x20parameters:\x20apiKey','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','refid','status','message','intelepeer','Token\x20not\x20received','finally','utf8mb4','lodash','../../config/logger','moment','path','rimraf','../../config/environment','./smsMessage.attributes','define','SmsMessage','messageId','fti_sms_messages','body','FULLTEXT','get','direction','toLowerCase','out','UserId','SmsInteraction','findOne','SmsInteractionId','then','createdAt','catch','find','type','twilio','accountSid','authToken','phone','remote','/api/sms/messages/','token','sid','update','error','afterCreate','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','skebby','username','smsMethod','sender','login?username=','password','GET','split','POST','session_key','total_sent','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','https://smsapi.connectel.se/api/v2/send/','requestid','connectel','Missing\x20parameters:\x20authToken','format','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','head','messages','clickSend','plivo','senderString','/status?token=','authId','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/sms/2/text/advanced','application/json','IBSSO\x20','crypto','apiKey','text','timestamp','keys','createHash'];(function(_0x59312d,_0x52bb25){var _0x13ca66=function(_0x2d4a0c){while(--_0x2d4a0c){_0x59312d['push'](_0x59312d['shift']());}};_0x13ca66(++_0x52bb25);}(_0xc560,0x82));var _0x0c56=function(_0x52adcd,_0x25f2e5){_0x52adcd=_0x52adcd-0x0;var _0x313d2f=_0xc560[_0x52adcd];return _0x313d2f;};'use strict';var _=require(_0x0c56('0x0'));var util=require('util');var logger=require(_0x0c56('0x1'))('api');var moment=require(_0x0c56('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0c56('0x3'));var rimraf=require(_0x0c56('0x4'));var config=require(_0x0c56('0x5'));var attributes=require(_0x0c56('0x6'));module['exports']=function(_0x2b5654,_0x2bc0a0){return _0x2b5654[_0x0c56('0x7')](_0x0c56('0x8'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x0c56('0x9'),'fields':['messageId']},{'name':_0x0c56('0xa'),'fields':[_0x0c56('0xb')],'type':_0x0c56('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x535444,_0x15979a,_0x41fd41){var _0x3651c6=_0x2b5654['models'];var _0x2dab08=_0x535444[_0x0c56('0xd')]({'plain':!![]});if(_0x2dab08[_0x0c56('0xe')][_0x0c56('0xf')]()==='in'||_0x2dab08[_0x0c56('0xe')][_0x0c56('0xf')]()===_0x0c56('0x10')&&!_0x2dab08['secret']&&!_['isNil'](_0x2dab08[_0x0c56('0x11')])){_0x3651c6[_0x0c56('0x12')][_0x0c56('0x13')]({'where':{'id':_0x2dab08[_0x0c56('0x14')]}})[_0x0c56('0x15')](function(_0xdc4827){if(_0xdc4827){_0xdc4827['update']({'lastMsgAt':_0x2dab08[_0x0c56('0x16')],'lastMsgDirection':_0x2dab08[_0x0c56('0xe')][_0x0c56('0xf')]()});}})[_0x0c56('0x17')](function(_0x5425){console['error'](_0x5425);});}if(_0x2dab08[_0x0c56('0xe')]==='out'&&!_0x2dab08['secret']){var _0x3ccdf7;_0x3651c6['SmsAccount'][_0x0c56('0x18')]({'where':{'id':_0x2dab08['SmsAccountId']},'raw':!![]})['then'](function(_0x224424){_0x3ccdf7=_0x224424;if(_0x3ccdf7&&_0x3ccdf7[_0x0c56('0x19')]){switch(_0x3ccdf7[_0x0c56('0x19')]){case _0x0c56('0x1a'):var _0x116735=require(_0x0c56('0x1a'));if(_0x3ccdf7[_0x0c56('0x1b')]&&_0x3ccdf7[_0x0c56('0x1c')]&&_0x3ccdf7[_0x0c56('0x1d')]){var _0x2c65c5=new _0x116735(_0x3ccdf7[_0x0c56('0x1b')],_0x3ccdf7[_0x0c56('0x1c')]);_0x2c65c5['messages']['create']({'body':_0x2dab08[_0x0c56('0xb')],'to':_0x2dab08[_0x0c56('0x1d')],'from':_0x3ccdf7[_0x0c56('0x1d')],'statusCallback':_0x3ccdf7[_0x0c56('0x1e')]+_0x0c56('0x1f')+_0x2dab08['id']+'/status?token='+_0x3ccdf7[_0x0c56('0x20')]})[_0x0c56('0x15')](function(_0x448bad){if(_0x448bad[_0x0c56('0x21')]){return _0x535444[_0x0c56('0x22')]({'messageId':_0x448bad['sid']});}})[_0x0c56('0x17')](function(_0x58e79d){logger[_0x0c56('0x23')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0c56('0x24'),_0x0c56('0x1a'),util[_0x0c56('0x25')](_0x58e79d,{'showHidden':![],'depth':null}));});}else{logger[_0x0c56('0x23')](_0x0c56('0x26'),'afterCreate',_0x0c56('0x1a'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x0c56('0x27'):var _0x3a8f23='https://api.skebby.it/API/v1.0/REST/';if(_0x3ccdf7[_0x0c56('0x28')]&&_0x3ccdf7['password']){var _0x6acf19={'recipient':[_0x2dab08[_0x0c56('0x1d')]],'message':_0x2dab08[_0x0c56('0xb')],'message_type':_0x3ccdf7[_0x0c56('0x29')]};if(_0x3ccdf7[_0x0c56('0x29')]&&_0x3ccdf7[_0x0c56('0x29')]!=='SI'){_0x6acf19[_0x0c56('0x2a')]=_0x3ccdf7[_0x0c56('0x1d')];}var _0x45b70f={'url':_0x3a8f23+_0x0c56('0x2b')+_0x3ccdf7[_0x0c56('0x28')]+'&password='+_0x3ccdf7[_0x0c56('0x2c')],'method':_0x0c56('0x2d')};rp(_0x45b70f)[_0x0c56('0x15')](function(_0xa4a241){var _0x5c5a41=_0xa4a241[_0x0c56('0x2e')](';');var _0x10442e={'user_key':_0x5c5a41[0x0],'session_key':_0x5c5a41[0x1]};_0x45b70f={'url':_0x3a8f23+'sms','method':_0x0c56('0x2f'),'headers':{'user_key':_0x10442e['user_key'],'Session_key':_0x10442e[_0x0c56('0x30')]},'json':!![],'body':_0x6acf19};return rp(_0x45b70f);})[_0x0c56('0x15')](function(_0x1d83a0){if(_0x1d83a0[_0x0c56('0x31')]>=0x1){var _0x42fd9b={'messageId':_0x1d83a0[_0x0c56('0x32')]};if(_0x3ccdf7['smsMethod']!=='GP'||!_0x3ccdf7[_0x0c56('0x33')]){_0x42fd9b[_0x0c56('0x34')]=!![];}return _0x535444['update'](_0x42fd9b);}else{return logger[_0x0c56('0x23')](_0x0c56('0x26'),_0x0c56('0x24'),_0x0c56('0x27'),util[_0x0c56('0x25')](_0x1d83a0,{'showHidden':![],'depth':null}));}})[_0x0c56('0x17')](function(_0x145ba2){return logger[_0x0c56('0x23')](_0x0c56('0x26'),_0x0c56('0x24'),_0x0c56('0x27'),util['inspect'](_0x145ba2,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x0c56('0x26'),_0x0c56('0x24'),_0x0c56('0x27'),_0x0c56('0x35'));}break;case'connectel':if(_0x3ccdf7[_0x0c56('0x1c')]){var _0x57220c={'recipient':_0x2dab08[_0x0c56('0x1d')],'message':_0x2dab08['body'],'sender':_0x3ccdf7['senderString']||_0x3ccdf7[_0x0c56('0x1d')],'authorization':_0x3ccdf7[_0x0c56('0x1c')]};var _0x15979a={'method':'POST','uri':_0x0c56('0x36'),'body':_0x57220c,'json':!![]};rp(_0x15979a)['then'](function(_0x9ea888){var _0xdd075c={'messageId':_0x9ea888[_0x0c56('0x37')]};if(!_0x3ccdf7[_0x0c56('0x33')]){_0xdd075c[_0x0c56('0x34')]=!![];}return _0x535444[_0x0c56('0x22')](_0xdd075c);})[_0x0c56('0x17')](function(_0x4fd945){logger[_0x0c56('0x23')](_0x0c56('0x26'),_0x0c56('0x24'),'connectel',util['inspect'](_0x4fd945,{'showHidden':![],'depth':null}));});}else{logger[_0x0c56('0x23')](_0x0c56('0x26'),_0x0c56('0x24'),_0x0c56('0x38'),_0x0c56('0x39'));}break;case'clicksend':if(_0x3ccdf7[_0x0c56('0x28')]&&_0x3ccdf7[_0x0c56('0x2c')]){var _0x57220c={'messages':[{'source':'xCALLY\x20Motion','to':_0x2dab08[_0x0c56('0x1d')],'body':_0x2dab08[_0x0c56('0xb')],'from':_0x3ccdf7['senderString']||_0x3ccdf7[_0x0c56('0x1d')]}]};var _0x594fc9=util[_0x0c56('0x3a')]('%s:%s',_0x3ccdf7[_0x0c56('0x28')],_0x3ccdf7['password']);var _0x15979a={'method':'POST','uri':_0x0c56('0x3b'),'body':_0x57220c,'headers':{'Authorization':util[_0x0c56('0x3a')](_0x0c56('0x3c'),new Buffer(_0x594fc9)[_0x0c56('0x3d')](_0x0c56('0x3e')))},'json':!![]};rp(_0x15979a)[_0x0c56('0x15')](function(_0x264287){if(_0x264287[_0x0c56('0x3f')]>=0xc8&&_0x264287[_0x0c56('0x3f')]<=0xce){if(_0x264287[_0x0c56('0x40')]&&_0x264287[_0x0c56('0x40')][_0x0c56('0x41')]>0x0){var _0x28f537=_[_0x0c56('0x42')](_0x264287[_0x0c56('0x40')][_0x0c56('0x43')]);var _0x5dd815={'messageId':_0x28f537['message_id']};if(!_0x3ccdf7['deliveryReport']){_0x5dd815[_0x0c56('0x34')]=!![];}return _0x535444[_0x0c56('0x22')](_0x5dd815);}else{logger['error'](_0x0c56('0x26'),'afterCreate',_0x0c56('0x44'),util['inspect'](_0x264287,{'showHidden':![],'depth':null}));}}else{logger[_0x0c56('0x23')](_0x0c56('0x26'),_0x0c56('0x24'),_0x0c56('0x44'),util[_0x0c56('0x25')](_0x264287,{'showHidden':![],'depth':null}));}})['catch'](function(_0x2aa324){logger[_0x0c56('0x23')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x0c56('0x44'),util[_0x0c56('0x25')](_0x2aa324,{'showHidden':![],'depth':null}));});}else{logger[_0x0c56('0x23')](_0x0c56('0x26'),_0x0c56('0x24'),_0x0c56('0x44'),_0x0c56('0x35'));}break;case _0x0c56('0x45'):if(_0x3ccdf7['authId']&&_0x3ccdf7[_0x0c56('0x1c')]){var _0x57220c={'dst':_0x2dab08[_0x0c56('0x1d')],'text':_0x2dab08[_0x0c56('0xb')],'src':_0x3ccdf7[_0x0c56('0x46')]||_0x3ccdf7[_0x0c56('0x1d')],'url':_0x3ccdf7[_0x0c56('0x1e')]+'/api/sms/messages/'+_0x2dab08['id']+_0x0c56('0x47')+_0x3ccdf7[_0x0c56('0x20')]};var _0x594fc9=util[_0x0c56('0x3a')]('%s:%s',_0x3ccdf7[_0x0c56('0x48')],_0x3ccdf7['authToken']);var _0x15979a={'method':_0x0c56('0x2f'),'uri':util[_0x0c56('0x3a')]('https://api.plivo.com/v1/Account/%s/Message/',_0x3ccdf7['authId']),'body':_0x57220c,'headers':{'Authorization':util['format'](_0x0c56('0x3c'),new Buffer(_0x594fc9)['toString']('base64'))},'json':!![]};rp(_0x15979a)['then'](function(_0x179d98){var _0x5369ed={'messageId':_0x179d98[_0x0c56('0x49')][0x0]};return _0x535444[_0x0c56('0x22')](_0x5369ed);})['catch'](function(_0x339ccc){logger[_0x0c56('0x23')](_0x0c56('0x26'),_0x0c56('0x24'),_0x0c56('0x45'),util[_0x0c56('0x25')](_0x339ccc,{'showHidden':![],'depth':null}));});}else{logger[_0x0c56('0x23')](_0x0c56('0x26'),_0x0c56('0x24'),_0x0c56('0x45'),_0x0c56('0x4a'));}break;case _0x0c56('0x4b'):if(_0x3ccdf7[_0x0c56('0x28')]&&_0x3ccdf7[_0x0c56('0x2c')]){if(_0x3ccdf7[_0x0c56('0x4c')]){var _0x1424e2={'method':_0x0c56('0x2f'),'uri':_0x3ccdf7[_0x0c56('0x4c')]+'/auth/1/session','body':{'username':_0x3ccdf7[_0x0c56('0x28')],'password':_0x3ccdf7[_0x0c56('0x2c')]},'json':!![]};return rp(_0x1424e2)[_0x0c56('0x15')](function(_0x20b396){var _0x4ae41e={'method':_0x0c56('0x2f'),'uri':_0x3ccdf7[_0x0c56('0x4c')]+_0x0c56('0x4d'),'body':{'messages':[{'from':_0x3ccdf7[_0x0c56('0x1d')],'destinations':[{'to':_0x2dab08[_0x0c56('0x1d')]}],'text':_0x2dab08['body'],'notifyUrl':_0x3ccdf7[_0x0c56('0x1e')]+_0x0c56('0x1f')+_0x2dab08['id']+_0x0c56('0x47')+_0x3ccdf7[_0x0c56('0x20')],'notifyContentType':_0x0c56('0x4e'),'callbackData':_0x3ccdf7[_0x0c56('0x1d')]+';'+_0x2dab08[_0x0c56('0xb')]}]},'headers':{'Authorization':_0x0c56('0x4f')+_0x20b396[_0x0c56('0x20')]},'json':!![]};return rp(_0x4ae41e)['then'](function(_0x18757b){if(_0x18757b[_0x0c56('0x43')]){var _0x861f2a={'messageId':_0x18757b[_0x0c56('0x43')][0x0][_0x0c56('0x9')]};if(!_0x3ccdf7[_0x0c56('0x33')]){_0x861f2a[_0x0c56('0x34')]=!![];}return _0x535444[_0x0c56('0x22')](_0x861f2a);}else{return logger[_0x0c56('0x23')](_0x0c56('0x26'),'afterCreate',_0x0c56('0x4b'),util[_0x0c56('0x25')](_0x18757b,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x36c4b1){return logger[_0x0c56('0x23')](_0x0c56('0x26'),_0x0c56('0x24'),_0x0c56('0x4b'),util[_0x0c56('0x25')](_0x36c4b1,{'showHidden':![],'depth':null}));});}else{logger[_0x0c56('0x23')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0c56('0x24'),_0x0c56('0x4b'),'Missing\x20parameters:\x20base_url');}}else{logger[_0x0c56('0x23')](_0x0c56('0x26'),_0x0c56('0x24'),_0x0c56('0x4b'),_0x0c56('0x35'));}break;case'csc':var _0x2f2e43=require(_0x0c56('0x50'));if(_0x3ccdf7[_0x0c56('0x51')]){var _0x28d698={};_0x28d698['login']=_0x3ccdf7['username'];_0x28d698[_0x0c56('0x1d')]=_0x2dab08[_0x0c56('0x1d')];_0x28d698[_0x0c56('0x2a')]=_0x3ccdf7['phone'];_0x28d698[_0x0c56('0x52')]=_0x2dab08[_0x0c56('0xb')];_0x28d698[_0x0c56('0x53')]=+new Date();var _0x39a88a='';var _0xbbe790='';var _0x4c5812=Object[_0x0c56('0x54')](_0x28d698);_0x4c5812['sort']();for(var _0x3b0688=0x0;_0x3b0688<_0x4c5812['length'];_0x3b0688++){if(_0x39a88a!=''){_0x39a88a+='&';}_0x39a88a+=_0x4c5812[_0x3b0688]+'='+encodeURIComponent(_0x28d698[_0x4c5812[_0x3b0688]]);_0xbbe790+=_0x28d698[_0x4c5812[_0x3b0688]];}_0xbbe790+=_0x3ccdf7[_0x0c56('0x51')];_0xbbe790=_0x2f2e43[_0x0c56('0x55')](_0x0c56('0x56'))['update'](_0xbbe790)['digest'](_0x0c56('0x57'));if(_0x39a88a!==''){_0x39a88a+='&';}_0x39a88a+=_0x0c56('0x58')+_0xbbe790;var _0x45b70f={'method':_0x0c56('0x2d'),'uri':_0x3ccdf7[_0x0c56('0x4c')]+_0x0c56('0x59')+_0x39a88a,'json':!![]};return rp(_0x45b70f)[_0x0c56('0x15')](function(_0x5a9e5f){var _0x420cc5=Object[_0x0c56('0x54')](_0x5a9e5f);if(_0x5a9e5f[_0x420cc5[0x0]][_0x0c56('0x23')]&&parseInt(_0x5a9e5f[_0x420cc5[0x0]][_0x0c56('0x23')])===0x0){var _0x5e92e4={'messageId':_0x5a9e5f[_0x420cc5[0x0]]['id_sms']};if(!_0x3ccdf7[_0x0c56('0x33')]){_0x5e92e4[_0x0c56('0x34')]=!![];}return _0x535444[_0x0c56('0x22')](_0x5e92e4);}else{return logger[_0x0c56('0x23')](_0x0c56('0x26'),_0x0c56('0x24'),_0x0c56('0x5a'),util[_0x0c56('0x25')](_0x5a9e5f[_0x0c56('0x23')],{'showHidden':![],'depth':null}));}})[_0x0c56('0x17')](function(_0x1002c9){return logger['error'](_0x0c56('0x26'),_0x0c56('0x24'),_0x0c56('0x5a'),util[_0x0c56('0x25')](_0x1002c9,{'showHidden':![],'depth':null}));});}else{logger[_0x0c56('0x23')](_0x0c56('0x26'),_0x0c56('0x24'),_0x0c56('0x5a'),'Missing\x20parameters:\x20apiKey');}break;case _0x0c56('0x5b'):if(_0x3ccdf7['apiKey']){var _0x266315={'method':_0x0c56('0x2f'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x3ccdf7[_0x0c56('0x51')]},'body':{'content':_0x2dab08[_0x0c56('0xb')],'to':[_0x2dab08[_0x0c56('0x1d')]],'from':_0x3ccdf7[_0x0c56('0x1d')],'binary':![],'clientMessageId':_0x0c56('0x5c'),'charset':'UTF-8'},'json':!![]};rp(_0x266315)['then'](function(_0x5bf2fd){if(!_0x5bf2fd['error']){var _0x3ede17={'messageId':_0x5bf2fd[_0x0c56('0x43')][0x0][_0x0c56('0x5d')]};if(!_0x3ccdf7[_0x0c56('0x33')]){_0x3ede17[_0x0c56('0x34')]=!![];}return _0x535444[_0x0c56('0x22')](_0x3ede17);}else{return logger[_0x0c56('0x23')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0c56('0x24'),_0x0c56('0x5b'),util['inspect'](_0x5bf2fd[_0x0c56('0x23')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x54f8b8){return logger[_0x0c56('0x23')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x0c56('0x5b'),util[_0x0c56('0x25')](_0x54f8b8,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0c56('0x24'),_0x0c56('0x5b'),_0x0c56('0x5e'));}break;case _0x0c56('0x5f'):if(_0x3ccdf7['username']&&_0x3ccdf7[_0x0c56('0x2c')]){var _0x594fc9=util[_0x0c56('0x3a')]('%s:%s',_0x3ccdf7[_0x0c56('0x28')],_0x3ccdf7[_0x0c56('0x2c')]);var _0x15979a={'method':_0x0c56('0x2f'),'uri':_0x0c56('0x60')+_0x3ccdf7[_0x0c56('0x61')]+'/messages','body':{'to':[_0x2dab08[_0x0c56('0x1d')]],'text':_0x2dab08['body'],'from':_0x3ccdf7[_0x0c56('0x1d')],'applicationId':_0x3ccdf7['applicationId']},'headers':{'Authorization':util[_0x0c56('0x3a')](_0x0c56('0x3c'),new Buffer(_0x594fc9)[_0x0c56('0x3d')](_0x0c56('0x3e')))},'json':!![]};rp(_0x15979a)['then'](function(_0x4d24d7){if(_0x4d24d7['id']){var _0x42ffcd={'messageId':_0x4d24d7['id']};return _0x535444[_0x0c56('0x22')](_0x42ffcd);}else{logger[_0x0c56('0x23')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0c56('0x24'),_0x0c56('0x5f'),util[_0x0c56('0x25')](_0x4d24d7,{'showHidden':![],'depth':null}));}})[_0x0c56('0x17')](function(_0x17d3a4){logger[_0x0c56('0x23')](_0x0c56('0x26'),_0x0c56('0x24'),'bandwidth',util[_0x0c56('0x25')](_0x17d3a4,{'showHidden':![],'depth':null}));});}else{logger[_0x0c56('0x23')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','bandwidth','Missing\x20parameters:\x20username,\x20password');}break;case'intelepeer':if(_0x3ccdf7[_0x0c56('0x51')]){var _0x3a2514={};var _0x45b70f={'method':_0x0c56('0x2f'),'uri':_0x0c56('0x62'),'headers':{'Authorization':_0x0c56('0x63')+_0x3ccdf7['apiKey'],'Content-Type':'application/json'},'body':{'from':_0x3ccdf7[_0x0c56('0x1d')],'to':_0x2dab08[_0x0c56('0x1d')],'text':_0x2dab08['body']},'json':!![]};return rp(_0x45b70f)[_0x0c56('0x15')](function(_0x3430){if(_0x3430[_0x0c56('0x64')]==0xca){_0x3a2514['message']=_0x3430;var _0x37ee61={'method':_0x0c56('0x2f'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0x0c56('0x63')+_0x3ccdf7[_0x0c56('0x51')],'Content-Type':'application/json'},'body':{'refid':_0x3a2514['message'][_0x0c56('0x65')]},'json':!![]};return rp(_0x37ee61)[_0x0c56('0x15')](function(_0x453eb4){_0x3a2514[_0x0c56('0x66')]=_0x453eb4;var _0x17398e={'messageId':_0x3a2514[_0x0c56('0x67')]['refid'],'read':!![]};return _0x535444[_0x0c56('0x22')](_0x17398e);});}else{return logger[_0x0c56('0x23')](_0x0c56('0x26'),'afterCreate',_0x0c56('0x68'),util['inspect'](_0x3430,{'showHidden':![],'depth':null}));}})[_0x0c56('0x17')](function(_0x18c0db){return logger['error'](_0x0c56('0x26'),_0x0c56('0x24'),'intelepeer',util[_0x0c56('0x25')](_0x18c0db,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x0c56('0x26'),_0x0c56('0x24'),_0x0c56('0x68'),_0x0c56('0x69'));}break;}}})[_0x0c56('0x6a')](function(){_0x41fd41();});}else{_0x41fd41();}}},'charset':_0x0c56('0x6b'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x36f1=['Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','head','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','authId','token','message_uuid','plivo','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','remote','application/json','IBSSO\x20','csc','crypto','apiKey','login','keys','sort','md5','digest','hex','signature=','GET','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','uuid','UTF-8','apiMessageId','https://messaging.bandwidth.com/api/v2/users/','/messages','applicationId','bandwidth','intelepeer','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','refid','Token\x20not\x20received','finally','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','toLowerCase','direction','out','secret','SmsInteraction','findOne','SmsInteractionId','update','createdAt','catch','error','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','/api/sms/messages/','/status?token=','then','sid','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','username','password','smsMethod','sender','login?username=','&password=','split','sms','POST','user_key','internal_order_id','read','afterCreate','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','deliveryReport'];(function(_0xf4c1ac,_0x5dc251){var _0x132bb8=function(_0x67d0a9){while(--_0x67d0a9){_0xf4c1ac['push'](_0xf4c1ac['shift']());}};_0x132bb8(++_0x5dc251);}(_0x36f1,0xb0));var _0x136f=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x36f1[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x136f('0x0'));var util=require('util');var logger=require(_0x136f('0x1'))('api');var moment=require(_0x136f('0x2'));var BPromise=require(_0x136f('0x3'));var rp=require(_0x136f('0x4'));var fs=require('fs');var path=require(_0x136f('0x5'));var rimraf=require(_0x136f('0x6'));var config=require(_0x136f('0x7'));var attributes=require(_0x136f('0x8'));module[_0x136f('0x9')]=function(_0x5b00b5,_0x430433){return _0x5b00b5['define'](_0x136f('0xa'),attributes,{'tableName':_0x136f('0xb'),'paranoid':![],'indexes':[{'name':_0x136f('0xc'),'fields':['messageId']},{'name':_0x136f('0xd'),'fields':[_0x136f('0xe')],'type':_0x136f('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x7b0a5b,_0x5252bc,_0x4cd978){var _0x1bf151=_0x5b00b5[_0x136f('0x10')];var _0x347e05=_0x7b0a5b['get']({'plain':!![]});if(_0x347e05['direction'][_0x136f('0x11')]()==='in'||_0x347e05[_0x136f('0x12')][_0x136f('0x11')]()===_0x136f('0x13')&&!_0x347e05[_0x136f('0x14')]&&!_['isNil'](_0x347e05['UserId'])){_0x1bf151[_0x136f('0x15')][_0x136f('0x16')]({'where':{'id':_0x347e05[_0x136f('0x17')]}})['then'](function(_0x43fca8){if(_0x43fca8){_0x43fca8[_0x136f('0x18')]({'lastMsgAt':_0x347e05[_0x136f('0x19')],'lastMsgDirection':_0x347e05[_0x136f('0x12')][_0x136f('0x11')]()});}})[_0x136f('0x1a')](function(_0x3a4a84){console[_0x136f('0x1b')](_0x3a4a84);});}if(_0x347e05['direction']===_0x136f('0x13')&&!_0x347e05[_0x136f('0x14')]){var _0x66cee;_0x1bf151[_0x136f('0x1c')][_0x136f('0x1d')]({'where':{'id':_0x347e05[_0x136f('0x1e')]},'raw':!![]})['then'](function(_0xcdab1){_0x66cee=_0xcdab1;if(_0x66cee&&_0x66cee[_0x136f('0x1f')]){switch(_0x66cee['type']){case _0x136f('0x20'):var _0x1e94de=require(_0x136f('0x20'));if(_0x66cee[_0x136f('0x21')]&&_0x66cee[_0x136f('0x22')]&&_0x66cee[_0x136f('0x23')]){var _0x493b41=new _0x1e94de(_0x66cee[_0x136f('0x21')],_0x66cee[_0x136f('0x22')]);_0x493b41[_0x136f('0x24')]['create']({'body':_0x347e05['body'],'to':_0x347e05[_0x136f('0x23')],'from':_0x66cee['phone'],'statusCallback':_0x66cee['remote']+_0x136f('0x25')+_0x347e05['id']+_0x136f('0x26')+_0x66cee['token']})[_0x136f('0x27')](function(_0x34f467){if(_0x34f467[_0x136f('0x28')]){return _0x7b0a5b['update']({'messageId':_0x34f467[_0x136f('0x28')]});}})[_0x136f('0x1a')](function(_0x538101){logger[_0x136f('0x1b')](_0x136f('0x29'),'afterCreate',_0x136f('0x20'),util[_0x136f('0x2a')](_0x538101,{'showHidden':![],'depth':null}));});}else{logger[_0x136f('0x1b')](_0x136f('0x29'),'afterCreate',_0x136f('0x20'),_0x136f('0x2b'));}break;case _0x136f('0x2c'):var _0x23ab25='https://api.skebby.it/API/v1.0/REST/';if(_0x66cee[_0x136f('0x2d')]&&_0x66cee[_0x136f('0x2e')]){var _0x1b8e90={'recipient':[_0x347e05[_0x136f('0x23')]],'message':_0x347e05[_0x136f('0xe')],'message_type':_0x66cee[_0x136f('0x2f')]};if(_0x66cee['smsMethod']&&_0x66cee[_0x136f('0x2f')]!=='SI'){_0x1b8e90[_0x136f('0x30')]=_0x66cee[_0x136f('0x23')];}var _0x5f51a6={'url':_0x23ab25+_0x136f('0x31')+_0x66cee['username']+_0x136f('0x32')+_0x66cee[_0x136f('0x2e')],'method':'GET'};rp(_0x5f51a6)[_0x136f('0x27')](function(_0x65ef2){var _0x21ad42=_0x65ef2[_0x136f('0x33')](';');var _0x268fbe={'user_key':_0x21ad42[0x0],'session_key':_0x21ad42[0x1]};_0x5f51a6={'url':_0x23ab25+_0x136f('0x34'),'method':_0x136f('0x35'),'headers':{'user_key':_0x268fbe[_0x136f('0x36')],'Session_key':_0x268fbe['session_key']},'json':!![],'body':_0x1b8e90};return rp(_0x5f51a6);})[_0x136f('0x27')](function(_0x4ebc7f){if(_0x4ebc7f['total_sent']>=0x1){var _0x504133={'messageId':_0x4ebc7f[_0x136f('0x37')]};if(_0x66cee['smsMethod']!=='GP'||!_0x66cee['deliveryReport']){_0x504133[_0x136f('0x38')]=!![];}return _0x7b0a5b[_0x136f('0x18')](_0x504133);}else{return logger[_0x136f('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x136f('0x39'),_0x136f('0x2c'),util[_0x136f('0x2a')](_0x4ebc7f,{'showHidden':![],'depth':null}));}})[_0x136f('0x1a')](function(_0x1e5138){return logger['error'](_0x136f('0x29'),_0x136f('0x39'),_0x136f('0x2c'),util[_0x136f('0x2a')](_0x1e5138,{'showHidden':![],'depth':null}));});}else{logger[_0x136f('0x1b')](_0x136f('0x29'),_0x136f('0x39'),_0x136f('0x2c'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x136f('0x3a'):if(_0x66cee[_0x136f('0x22')]){var _0x188dd5={'recipient':_0x347e05['phone'],'message':_0x347e05[_0x136f('0xe')],'sender':_0x66cee[_0x136f('0x3b')]||_0x66cee[_0x136f('0x23')],'authorization':_0x66cee[_0x136f('0x22')]};var _0x5252bc={'method':_0x136f('0x35'),'uri':_0x136f('0x3c'),'body':_0x188dd5,'json':!![]};rp(_0x5252bc)[_0x136f('0x27')](function(_0x1f9926){var _0xbd555e={'messageId':_0x1f9926['requestid']};if(!_0x66cee[_0x136f('0x3d')]){_0xbd555e[_0x136f('0x38')]=!![];}return _0x7b0a5b[_0x136f('0x18')](_0xbd555e);})['catch'](function(_0x56b620){logger[_0x136f('0x1b')](_0x136f('0x29'),_0x136f('0x39'),_0x136f('0x3a'),util[_0x136f('0x2a')](_0x56b620,{'showHidden':![],'depth':null}));});}else{logger[_0x136f('0x1b')](_0x136f('0x29'),_0x136f('0x39'),_0x136f('0x3a'),_0x136f('0x3e'));}break;case _0x136f('0x3f'):if(_0x66cee[_0x136f('0x2d')]&&_0x66cee[_0x136f('0x2e')]){var _0x188dd5={'messages':[{'source':_0x136f('0x40'),'to':_0x347e05[_0x136f('0x23')],'body':_0x347e05[_0x136f('0xe')],'from':_0x66cee[_0x136f('0x3b')]||_0x66cee[_0x136f('0x23')]}]};var _0x516732=util[_0x136f('0x41')](_0x136f('0x42'),_0x66cee[_0x136f('0x2d')],_0x66cee[_0x136f('0x2e')]);var _0x5252bc={'method':_0x136f('0x35'),'uri':_0x136f('0x43'),'body':_0x188dd5,'headers':{'Authorization':util[_0x136f('0x41')](_0x136f('0x44'),new Buffer(_0x516732)[_0x136f('0x45')](_0x136f('0x46')))},'json':!![]};rp(_0x5252bc)[_0x136f('0x27')](function(_0x49dc9d){if(_0x49dc9d[_0x136f('0x47')]>=0xc8&&_0x49dc9d[_0x136f('0x47')]<=0xce){if(_0x49dc9d['data']&&_0x49dc9d[_0x136f('0x48')][_0x136f('0x49')]>0x0){var _0x9e572b=_[_0x136f('0x4a')](_0x49dc9d[_0x136f('0x48')][_0x136f('0x24')]);var _0x20621c={'messageId':_0x9e572b[_0x136f('0x4b')]};if(!_0x66cee[_0x136f('0x3d')]){_0x20621c[_0x136f('0x38')]=!![];}return _0x7b0a5b[_0x136f('0x18')](_0x20621c);}else{logger[_0x136f('0x1b')](_0x136f('0x29'),_0x136f('0x39'),'clickSend',util[_0x136f('0x2a')](_0x49dc9d,{'showHidden':![],'depth':null}));}}else{logger[_0x136f('0x1b')](_0x136f('0x29'),_0x136f('0x39'),_0x136f('0x4c'),util[_0x136f('0x2a')](_0x49dc9d,{'showHidden':![],'depth':null}));}})[_0x136f('0x1a')](function(_0x293a49){logger[_0x136f('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x136f('0x39'),_0x136f('0x4c'),util[_0x136f('0x2a')](_0x293a49,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x136f('0x29'),_0x136f('0x39'),_0x136f('0x4c'),_0x136f('0x4d'));}break;case'plivo':if(_0x66cee[_0x136f('0x4e')]&&_0x66cee[_0x136f('0x22')]){var _0x188dd5={'dst':_0x347e05['phone'],'text':_0x347e05['body'],'src':_0x66cee[_0x136f('0x3b')]||_0x66cee[_0x136f('0x23')],'url':_0x66cee['remote']+_0x136f('0x25')+_0x347e05['id']+_0x136f('0x26')+_0x66cee[_0x136f('0x4f')]};var _0x516732=util['format'](_0x136f('0x42'),_0x66cee[_0x136f('0x4e')],_0x66cee[_0x136f('0x22')]);var _0x5252bc={'method':'POST','uri':util[_0x136f('0x41')]('https://api.plivo.com/v1/Account/%s/Message/',_0x66cee['authId']),'body':_0x188dd5,'headers':{'Authorization':util[_0x136f('0x41')](_0x136f('0x44'),new Buffer(_0x516732)[_0x136f('0x45')](_0x136f('0x46')))},'json':!![]};rp(_0x5252bc)[_0x136f('0x27')](function(_0x547cb8){var _0x44fc7e={'messageId':_0x547cb8[_0x136f('0x50')][0x0]};return _0x7b0a5b[_0x136f('0x18')](_0x44fc7e);})[_0x136f('0x1a')](function(_0x30b5ad){logger[_0x136f('0x1b')](_0x136f('0x29'),_0x136f('0x39'),'plivo',util[_0x136f('0x2a')](_0x30b5ad,{'showHidden':![],'depth':null}));});}else{logger[_0x136f('0x1b')](_0x136f('0x29'),_0x136f('0x39'),_0x136f('0x51'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0x136f('0x52'):if(_0x66cee[_0x136f('0x2d')]&&_0x66cee[_0x136f('0x2e')]){if(_0x66cee[_0x136f('0x53')]){var _0x5a46e9={'method':_0x136f('0x35'),'uri':_0x66cee[_0x136f('0x53')]+_0x136f('0x54'),'body':{'username':_0x66cee[_0x136f('0x2d')],'password':_0x66cee[_0x136f('0x2e')]},'json':!![]};return rp(_0x5a46e9)[_0x136f('0x27')](function(_0x14ff2d){var _0x3476dd={'method':_0x136f('0x35'),'uri':_0x66cee[_0x136f('0x53')]+_0x136f('0x55'),'body':{'messages':[{'from':_0x66cee[_0x136f('0x23')],'destinations':[{'to':_0x347e05['phone']}],'text':_0x347e05[_0x136f('0xe')],'notifyUrl':_0x66cee[_0x136f('0x56')]+_0x136f('0x25')+_0x347e05['id']+_0x136f('0x26')+_0x66cee[_0x136f('0x4f')],'notifyContentType':_0x136f('0x57'),'callbackData':_0x66cee[_0x136f('0x23')]+';'+_0x347e05[_0x136f('0xe')]}]},'headers':{'Authorization':_0x136f('0x58')+_0x14ff2d[_0x136f('0x4f')]},'json':!![]};return rp(_0x3476dd)[_0x136f('0x27')](function(_0x550ae3){if(_0x550ae3[_0x136f('0x24')]){var _0x2926b5={'messageId':_0x550ae3[_0x136f('0x24')][0x0][_0x136f('0xc')]};if(!_0x66cee[_0x136f('0x3d')]){_0x2926b5[_0x136f('0x38')]=!![];}return _0x7b0a5b[_0x136f('0x18')](_0x2926b5);}else{return logger[_0x136f('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x136f('0x39'),_0x136f('0x52'),util[_0x136f('0x2a')](_0x550ae3,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x2a3395){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x136f('0x39'),_0x136f('0x52'),util[_0x136f('0x2a')](_0x2a3395,{'showHidden':![],'depth':null}));});}else{logger[_0x136f('0x1b')](_0x136f('0x29'),_0x136f('0x39'),_0x136f('0x52'),'Missing\x20parameters:\x20base_url');}}else{logger[_0x136f('0x1b')](_0x136f('0x29'),_0x136f('0x39'),_0x136f('0x52'),_0x136f('0x4d'));}break;case _0x136f('0x59'):var _0x3d7a48=require(_0x136f('0x5a'));if(_0x66cee[_0x136f('0x5b')]){var _0x2231a3={};_0x2231a3[_0x136f('0x5c')]=_0x66cee[_0x136f('0x2d')];_0x2231a3[_0x136f('0x23')]=_0x347e05[_0x136f('0x23')];_0x2231a3[_0x136f('0x30')]=_0x66cee['phone'];_0x2231a3['text']=_0x347e05[_0x136f('0xe')];_0x2231a3['timestamp']=+new Date();var _0x3df463='';var _0x4e148f='';var _0x396787=Object[_0x136f('0x5d')](_0x2231a3);_0x396787[_0x136f('0x5e')]();for(var _0x41e503=0x0;_0x41e503<_0x396787['length'];_0x41e503++){if(_0x3df463!=''){_0x3df463+='&';}_0x3df463+=_0x396787[_0x41e503]+'='+encodeURIComponent(_0x2231a3[_0x396787[_0x41e503]]);_0x4e148f+=_0x2231a3[_0x396787[_0x41e503]];}_0x4e148f+=_0x66cee[_0x136f('0x5b')];_0x4e148f=_0x3d7a48['createHash'](_0x136f('0x5f'))[_0x136f('0x18')](_0x4e148f)[_0x136f('0x60')](_0x136f('0x61'));if(_0x3df463!==''){_0x3df463+='&';}_0x3df463+=_0x136f('0x62')+_0x4e148f;var _0x5f51a6={'method':_0x136f('0x63'),'uri':_0x66cee[_0x136f('0x53')]+_0x136f('0x64')+_0x3df463,'json':!![]};return rp(_0x5f51a6)[_0x136f('0x27')](function(_0xaeba7e){var _0x3dcfce=Object[_0x136f('0x5d')](_0xaeba7e);if(_0xaeba7e[_0x3dcfce[0x0]][_0x136f('0x1b')]&&parseInt(_0xaeba7e[_0x3dcfce[0x0]][_0x136f('0x1b')])===0x0){var _0x58cae2={'messageId':_0xaeba7e[_0x3dcfce[0x0]][_0x136f('0x65')]};if(!_0x66cee[_0x136f('0x3d')]){_0x58cae2[_0x136f('0x38')]=!![];}return _0x7b0a5b[_0x136f('0x18')](_0x58cae2);}else{return logger['error'](_0x136f('0x29'),_0x136f('0x39'),_0x136f('0x59'),util['inspect'](_0xaeba7e[_0x136f('0x1b')],{'showHidden':![],'depth':null}));}})[_0x136f('0x1a')](function(_0xc01b7d){return logger[_0x136f('0x1b')](_0x136f('0x29'),'afterCreate','csc',util[_0x136f('0x2a')](_0xc01b7d,{'showHidden':![],'depth':null}));});}else{logger[_0x136f('0x1b')](_0x136f('0x29'),_0x136f('0x39'),_0x136f('0x59'),_0x136f('0x66'));}break;case _0x136f('0x67'):if(_0x66cee[_0x136f('0x5b')]){var _0x5579f5={'method':_0x136f('0x35'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x66cee[_0x136f('0x5b')]},'body':{'content':_0x347e05[_0x136f('0xe')],'to':[_0x347e05['phone']],'from':_0x66cee['phone'],'binary':![],'clientMessageId':_0x136f('0x68'),'charset':_0x136f('0x69')},'json':!![]};rp(_0x5579f5)['then'](function(_0x56fd66){if(!_0x56fd66[_0x136f('0x1b')]){var _0x3d2b97={'messageId':_0x56fd66[_0x136f('0x24')][0x0][_0x136f('0x6a')]};if(!_0x66cee[_0x136f('0x3d')]){_0x3d2b97[_0x136f('0x38')]=!![];}return _0x7b0a5b[_0x136f('0x18')](_0x3d2b97);}else{return logger[_0x136f('0x1b')](_0x136f('0x29'),_0x136f('0x39'),'clickatell',util[_0x136f('0x2a')](_0x56fd66[_0x136f('0x1b')],{'showHidden':![],'depth':null}));}})[_0x136f('0x1a')](function(_0x52d9bf){return logger[_0x136f('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x136f('0x39'),_0x136f('0x67'),util['inspect'](_0x52d9bf,{'showHidden':![],'depth':null}));});}else{logger[_0x136f('0x1b')](_0x136f('0x29'),_0x136f('0x39'),_0x136f('0x67'),_0x136f('0x66'));}break;case'bandwidth':if(_0x66cee[_0x136f('0x2d')]&&_0x66cee[_0x136f('0x2e')]){var _0x516732=util['format'](_0x136f('0x42'),_0x66cee[_0x136f('0x2d')],_0x66cee['password']);var _0x5252bc={'method':_0x136f('0x35'),'uri':_0x136f('0x6b')+_0x66cee['accountId']+_0x136f('0x6c'),'body':{'to':[_0x347e05[_0x136f('0x23')]],'text':_0x347e05[_0x136f('0xe')],'from':_0x66cee[_0x136f('0x23')],'applicationId':_0x66cee[_0x136f('0x6d')]},'headers':{'Authorization':util[_0x136f('0x41')]('Basic\x20%s',new Buffer(_0x516732)[_0x136f('0x45')](_0x136f('0x46')))},'json':!![]};rp(_0x5252bc)[_0x136f('0x27')](function(_0x281acc){if(_0x281acc['id']){var _0x5804fe={'messageId':_0x281acc['id']};return _0x7b0a5b[_0x136f('0x18')](_0x5804fe);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x136f('0x39'),'bandwidth',util['inspect'](_0x281acc,{'showHidden':![],'depth':null}));}})[_0x136f('0x1a')](function(_0x5b33c3){logger[_0x136f('0x1b')](_0x136f('0x29'),_0x136f('0x39'),_0x136f('0x6e'),util[_0x136f('0x2a')](_0x5b33c3,{'showHidden':![],'depth':null}));});}else{logger[_0x136f('0x1b')](_0x136f('0x29'),_0x136f('0x39'),_0x136f('0x6e'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x136f('0x6f'):if(_0x66cee[_0x136f('0x5b')]){var _0x11a3f3={};var _0x5f51a6={'method':_0x136f('0x35'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':'Bearer\x20'+_0x66cee['apiKey'],'Content-Type':'application/json'},'body':{'from':_0x66cee[_0x136f('0x23')],'to':_0x347e05[_0x136f('0x23')],'text':_0x347e05[_0x136f('0xe')]},'json':!![]};return rp(_0x5f51a6)['then'](function(_0x44e4bf){if(_0x44e4bf['code']==0xca){_0x11a3f3[_0x136f('0x70')]=_0x44e4bf;var _0x4b6322={'method':'POST','uri':_0x136f('0x71'),'headers':{'Authorization':_0x136f('0x72')+_0x66cee['apiKey'],'Content-Type':_0x136f('0x57')},'body':{'refid':_0x11a3f3['message'][_0x136f('0x73')]},'json':!![]};return rp(_0x4b6322)[_0x136f('0x27')](function(_0x41c64a){_0x11a3f3['status']=_0x41c64a;var _0x3ee110={'messageId':_0x11a3f3[_0x136f('0x70')][_0x136f('0x73')],'read':!![]};return _0x7b0a5b['update'](_0x3ee110);});}else{return logger[_0x136f('0x1b')](_0x136f('0x29'),_0x136f('0x39'),_0x136f('0x6f'),util[_0x136f('0x2a')](_0x44e4bf,{'showHidden':![],'depth':null}));}})[_0x136f('0x1a')](function(_0x552246){return logger['error'](_0x136f('0x29'),_0x136f('0x39'),'intelepeer',util[_0x136f('0x2a')](_0x552246,{'showHidden':![],'depth':null}));});}else{return logger[_0x136f('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x136f('0x6f'),_0x136f('0x74'));}break;}}})[_0x136f('0x75')](function(){_0x4cd978();});}else{_0x4cd978();}}},'charset':'utf8mb4','collate':_0x136f('0x76')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index b32adec..6bc6c87 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 _0x321a=['raw','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','defaults','redis','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsMessage,\x20%s,\x20%s','result','catch','CreateSmsMessage','SmsMessage','options'];(function(_0x15c7c9,_0x5b551b){var _0x177a30=function(_0x4f6fac){while(--_0x4f6fac){_0x15c7c9['push'](_0x15c7c9['shift']());}};_0x177a30(++_0x5b551b);}(_0x321a,0x141));var _0xa321=function(_0xa04daf,_0x25e602){_0xa04daf=_0xa04daf-0x0;var _0x3f7fa6=_0x321a[_0xa04daf];return _0x3f7fa6;};'use strict';var _=require('lodash');var util=require(_0xa321('0x0'));var moment=require(_0xa321('0x1'));var BPromise=require(_0xa321('0x2'));var rs=require(_0xa321('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa321('0x4'))['db'];var utils=require(_0xa321('0x5'));var logger=require('../../config/logger')(_0xa321('0x6'));var config=require(_0xa321('0x7'));var jayson=require(_0xa321('0x8'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xa321('0x9')](config[_0xa321('0xa')],{'host':_0xa321('0xb'),'port':0x18eb});var socket=require(_0xa321('0xc'))(new Redis(config[_0xa321('0xa')]));require(_0xa321('0xd'))[_0xa321('0xe')](socket);function respondWithRpcPromise(_0x39e087,_0x2a94e0,_0x1c2c1d){return new BPromise(function(_0x39f3eb,_0x16fc59){return client[_0xa321('0xf')](_0x39e087,_0x1c2c1d)[_0xa321('0x10')](function(_0x60c7f4){logger[_0xa321('0x11')]('SmsMessage,\x20%s,\x20%s',_0x2a94e0,_0xa321('0x12'));logger[_0xa321('0x13')](_0xa321('0x14'),_0x2a94e0,_0xa321('0x12'),JSON[_0xa321('0x15')](_0x60c7f4));if(_0x60c7f4[_0xa321('0x16')]){if(_0x60c7f4[_0xa321('0x16')][_0xa321('0x17')]===0x1f4){logger[_0xa321('0x16')]('SmsMessage,\x20%s,\x20%s',_0x2a94e0,_0x60c7f4[_0xa321('0x16')][_0xa321('0x18')]);return _0x16fc59(_0x60c7f4[_0xa321('0x16')]['message']);}logger[_0xa321('0x16')](_0xa321('0x19'),_0x2a94e0,_0x60c7f4['error']['message']);return _0x39f3eb(_0x60c7f4['error']['message']);}else{logger[_0xa321('0x11')]('SmsMessage,\x20%s,\x20%s',_0x2a94e0,'request\x20sent');_0x39f3eb(_0x60c7f4[_0xa321('0x1a')][_0xa321('0x18')]);}})[_0xa321('0x1b')](function(_0x15323e){logger[_0xa321('0x16')](_0xa321('0x19'),_0x2a94e0,_0x15323e);_0x16fc59(_0x15323e);});});}exports[_0xa321('0x1c')]=function(_0xbbe078){var _0x484b31=this;return new Promise(function(_0x5516c8,_0x50fbae){return db[_0xa321('0x1d')]['create'](_0xbbe078['body'],{'raw':_0xbbe078[_0xa321('0x1e')]?_0xbbe078[_0xa321('0x1e')][_0xa321('0x1f')]===undefined?!![]:![]:!![]})[_0xa321('0x10')](function(_0x16c9e4){logger[_0xa321('0x11')](_0xa321('0x1c'),_0xbbe078);logger[_0xa321('0x13')]('CreateSmsMessage',_0xbbe078,JSON[_0xa321('0x15')](_0x16c9e4));_0x5516c8(_0x16c9e4);})[_0xa321('0x1b')](function(_0x3fc5b9){logger[_0xa321('0x16')](_0xa321('0x1c'),_0x3fc5b9['message'],_0xbbe078);_0x50fbae(_0x484b31[_0xa321('0x16')](0x1f4,_0x3fc5b9['message']));});});}; \ No newline at end of file +var _0xf7ce=['stringify','error','message','info','CreateSmsMessage','SmsMessage','create','body','options','raw','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s'];(function(_0xdb4de7,_0x2f6559){var _0x2d057f=function(_0x5876fc){while(--_0x5876fc){_0xdb4de7['push'](_0xdb4de7['shift']());}};_0x2d057f(++_0x2f6559);}(_0xf7ce,0xcb));var _0xef7c=function(_0x48362d,_0x98fe0f){_0x48362d=_0x48362d-0x0;var _0x424d87=_0xf7ce[_0x48362d];return _0x424d87;};'use strict';var _=require(_0xef7c('0x0'));var util=require('util');var moment=require(_0xef7c('0x1'));var BPromise=require(_0xef7c('0x2'));var rs=require(_0xef7c('0x3'));var fs=require('fs');var Redis=require(_0xef7c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xef7c('0x5'));var logger=require('../../config/logger')(_0xef7c('0x6'));var config=require(_0xef7c('0x7'));var jayson=require(_0xef7c('0x8'));var client=jayson[_0xef7c('0x9')][_0xef7c('0xa')]({'port':0x232a});config[_0xef7c('0xb')]=_[_0xef7c('0xc')](config[_0xef7c('0xb')],{'host':_0xef7c('0xd'),'port':0x18eb});var socket=require(_0xef7c('0xe'))(new Redis(config[_0xef7c('0xb')]));require('./smsMessage.socket')[_0xef7c('0xf')](socket);function respondWithRpcPromise(_0x54f689,_0xc6dfbf,_0x36186c){return new BPromise(function(_0x90194f,_0x2174b6){return client['request'](_0x54f689,_0x36186c)[_0xef7c('0x10')](function(_0x174317){logger['info'](_0xef7c('0x11'),_0xc6dfbf,_0xef7c('0x12'));logger[_0xef7c('0x13')](_0xef7c('0x14'),_0xc6dfbf,_0xef7c('0x12'),JSON[_0xef7c('0x15')](_0x174317));if(_0x174317['error']){if(_0x174317[_0xef7c('0x16')]['code']===0x1f4){logger[_0xef7c('0x16')](_0xef7c('0x11'),_0xc6dfbf,_0x174317[_0xef7c('0x16')]['message']);return _0x2174b6(_0x174317[_0xef7c('0x16')][_0xef7c('0x17')]);}logger[_0xef7c('0x16')]('SmsMessage,\x20%s,\x20%s',_0xc6dfbf,_0x174317['error'][_0xef7c('0x17')]);return _0x90194f(_0x174317[_0xef7c('0x16')][_0xef7c('0x17')]);}else{logger[_0xef7c('0x18')]('SmsMessage,\x20%s,\x20%s',_0xc6dfbf,_0xef7c('0x12'));_0x90194f(_0x174317['result']['message']);}})['catch'](function(_0x430ca2){logger[_0xef7c('0x16')](_0xef7c('0x11'),_0xc6dfbf,_0x430ca2);_0x2174b6(_0x430ca2);});});}exports[_0xef7c('0x19')]=function(_0x2d7bd1){var _0x5f5984=this;return new Promise(function(_0x5ce81d,_0x3afa8b){return db[_0xef7c('0x1a')][_0xef7c('0x1b')](_0x2d7bd1[_0xef7c('0x1c')],{'raw':_0x2d7bd1[_0xef7c('0x1d')]?_0x2d7bd1['options'][_0xef7c('0x1e')]===undefined?!![]:![]:!![]})[_0xef7c('0x10')](function(_0x3efcec){logger[_0xef7c('0x18')](_0xef7c('0x19'),_0x2d7bd1);logger[_0xef7c('0x13')]('CreateSmsMessage',_0x2d7bd1,JSON[_0xef7c('0x15')](_0x3efcec));_0x5ce81d(_0x3efcec);})[_0xef7c('0x1f')](function(_0x127a9e){logger[_0xef7c('0x16')](_0xef7c('0x19'),_0x127a9e[_0xef7c('0x17')],_0x2d7bd1);_0x3afa8b(_0x5f5984[_0xef7c('0x16')](0x1f4,_0x127a9e['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 5e93d72..5d8b27e 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 _0xe245=['emit','removeListener','register','length','smsMessage:','./smsMessage.events','save','remove','update'];(function(_0x52f16a,_0x40416f){var _0x537271=function(_0x4d74da){while(--_0x4d74da){_0x52f16a['push'](_0x52f16a['shift']());}};_0x537271(++_0x40416f);}(_0xe245,0x9e));var _0x5e24=function(_0x321c6d,_0x6e6f64){_0x321c6d=_0x321c6d-0x0;var _0x2f36da=_0xe245[_0x321c6d];return _0x2f36da;};'use strict';var SmsMessageEvents=require(_0x5e24('0x0'));var events=[_0x5e24('0x1'),_0x5e24('0x2'),_0x5e24('0x3')];function createListener(_0x118c23,_0x280df9){return function(_0x2a9a3c){_0x280df9[_0x5e24('0x4')](_0x118c23,_0x2a9a3c);};}function removeListener(_0x1dd36b,_0x111e7a){return function(){SmsMessageEvents[_0x5e24('0x5')](_0x1dd36b,_0x111e7a);};}exports[_0x5e24('0x6')]=function(_0x47f35a){for(var _0x56a6a2=0x0,_0x3a5008=events[_0x5e24('0x7')];_0x56a6a2<_0x3a5008;_0x56a6a2++){var _0x3b8a82=events[_0x56a6a2];var _0xa6c583=createListener(_0x5e24('0x8')+_0x3b8a82,_0x47f35a);SmsMessageEvents['on'](_0x3b8a82,_0xa6c583);}}; \ No newline at end of file +var _0x154c=['./smsMessage.events','save','remove','emit','removeListener','length'];(function(_0x4c2e88,_0x5bfd5a){var _0x1f60a3=function(_0x517e8a){while(--_0x517e8a){_0x4c2e88['push'](_0x4c2e88['shift']());}};_0x1f60a3(++_0x5bfd5a);}(_0x154c,0xc6));var _0xc154=function(_0x298c85,_0x1c06e0){_0x298c85=_0x298c85-0x0;var _0x58664f=_0x154c[_0x298c85];return _0x58664f;};'use strict';var SmsMessageEvents=require(_0xc154('0x0'));var events=[_0xc154('0x1'),_0xc154('0x2'),'update'];function createListener(_0x46f142,_0xaf6530){return function(_0x41cc44){_0xaf6530[_0xc154('0x3')](_0x46f142,_0x41cc44);};}function removeListener(_0x4959fd,_0x5940c1){return function(){SmsMessageEvents[_0xc154('0x4')](_0x4959fd,_0x5940c1);};}exports['register']=function(_0x1de31a){for(var _0x532f8a=0x0,_0x53f997=events[_0xc154('0x5')];_0x532f8a<_0x53f997;_0x532f8a++){var _0x21137c=events[_0x532f8a];var _0x2e60d6=createListener('smsMessage:'+_0x21137c,_0x1de31a);SmsMessageEvents['on'](_0x21137c,_0x2e60d6);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 7e7b285..334277d 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 _0x9136=['delete','removeTeams','removeAgents','exports','util','path','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents'];(function(_0xa0ff20,_0x2d2d0f){var _0x27ec58=function(_0x40ffc6){while(--_0x40ffc6){_0xa0ff20['push'](_0xa0ff20['shift']());}};_0x27ec58(++_0x2d2d0f);}(_0x9136,0x8e));var _0x6913=function(_0x5df97e,_0x4ec12f){_0x5df97e=_0x5df97e-0x0;var _0x7e0bc9=_0x9136[_0x5df97e];return _0x7e0bc9;};'use strict';var multer=require('multer');var util=require(_0x6913('0x0'));var path=require(_0x6913('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6913('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x6913('0x3'));var interaction=require(_0x6913('0x4'));var config=require('../../config/environment');var controller=require('./smsQueue.controller');router[_0x6913('0x5')]('/',auth[_0x6913('0x6')](),controller['index']);router[_0x6913('0x5')](_0x6913('0x7'),auth['isAuthenticated'](),controller[_0x6913('0x8')]);router[_0x6913('0x5')](_0x6913('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x6913('0x5')](_0x6913('0xa'),auth[_0x6913('0x6')](),controller[_0x6913('0xb')]);router[_0x6913('0x5')](_0x6913('0xc'),auth[_0x6913('0x6')](),controller[_0x6913('0xd')]);router[_0x6913('0x5')](_0x6913('0xe'),auth[_0x6913('0x6')](),controller[_0x6913('0xf')]);router[_0x6913('0x10')]('/',auth[_0x6913('0x6')](),controller[_0x6913('0x11')]);router[_0x6913('0x10')](_0x6913('0xc'),auth[_0x6913('0x6')](),controller['addTeams']);router[_0x6913('0x10')]('/:id/users',auth[_0x6913('0x6')](),controller[_0x6913('0x12')]);router['put'](_0x6913('0x9'),auth[_0x6913('0x6')](),controller['update']);router[_0x6913('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);router['delete'](_0x6913('0xc'),auth[_0x6913('0x6')](),controller[_0x6913('0x14')]);router[_0x6913('0x13')](_0x6913('0xe'),auth[_0x6913('0x6')](),controller[_0x6913('0x15')]);module[_0x6913('0x16')]=router; \ No newline at end of file +var _0x3327=['/:id','/:id/members','getTeams','getAgents','post','/:id/teams','/:id/users','addAgents','put','update','delete','destroy','removeTeams','removeAgents','multer','util','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0x3327,0x8b));var _0x7332=function(_0x378b3,_0x486c3c){_0x378b3=_0x378b3-0x0;var _0x337924=_0x3327[_0x378b3];return _0x337924;};'use strict';var multer=require(_0x7332('0x0'));var util=require(_0x7332('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7332('0x2'));var router=express[_0x7332('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7332('0x4'));var config=require(_0x7332('0x5'));var controller=require('./smsQueue.controller');router['get']('/',auth[_0x7332('0x6')](),controller[_0x7332('0x7')]);router[_0x7332('0x8')](_0x7332('0x9'),auth[_0x7332('0x6')](),controller[_0x7332('0xa')]);router[_0x7332('0x8')](_0x7332('0xb'),auth[_0x7332('0x6')](),controller['show']);router[_0x7332('0x8')](_0x7332('0xc'),auth[_0x7332('0x6')](),controller['getMembers']);router[_0x7332('0x8')]('/:id/teams',auth[_0x7332('0x6')](),controller[_0x7332('0xd')]);router['get']('/:id/users',auth[_0x7332('0x6')](),controller[_0x7332('0xe')]);router[_0x7332('0xf')]('/',auth[_0x7332('0x6')](),controller['create']);router[_0x7332('0xf')](_0x7332('0x10'),auth[_0x7332('0x6')](),controller['addTeams']);router['post'](_0x7332('0x11'),auth[_0x7332('0x6')](),controller[_0x7332('0x12')]);router[_0x7332('0x13')](_0x7332('0xb'),auth[_0x7332('0x6')](),controller[_0x7332('0x14')]);router[_0x7332('0x15')]('/:id',auth[_0x7332('0x6')](),controller[_0x7332('0x16')]);router[_0x7332('0x15')](_0x7332('0x10'),auth[_0x7332('0x6')](),controller[_0x7332('0x17')]);router[_0x7332('0x15')](_0x7332('0x11'),auth[_0x7332('0x6')](),controller[_0x7332('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index f980f27..067d6f1 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 _0x3dee=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x21a466,_0x6b26fe){var _0x4bf846=function(_0xbb0cc4){while(--_0xbb0cc4){_0x21a466['push'](_0x21a466['shift']());}};_0x4bf846(++_0x6b26fe);}(_0x3dee,0x168));var _0xe3de=function(_0x46bbb6,_0x59f258){_0x46bbb6=_0x46bbb6-0x0;var _0x9c41a3=_0x3dee[_0x46bbb6];return _0x9c41a3;};'use strict';var Sequelize=require(_0xe3de('0x0'));module[_0xe3de('0x1')]={'name':{'type':Sequelize[_0xe3de('0x2')],'unique':_0xe3de('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe3de('0x2')]},'timeout':{'type':Sequelize[_0xe3de('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe3de('0x5')](_0xe3de('0x6'),_0xe3de('0x7'),'roundrobin')}}; \ No newline at end of file +var _0x0d87=['roundrobin','sequelize','exports','STRING','rrmemory'];(function(_0x417d17,_0x17bb4f){var _0x3224ac=function(_0x4f96d4){while(--_0x4f96d4){_0x417d17['push'](_0x417d17['shift']());}};_0x3224ac(++_0x17bb4f);}(_0x0d87,0x1f0));var _0x70d8=function(_0x17853d,_0x1fb88f){_0x17853d=_0x17853d-0x0;var _0x1dc0d6=_0x0d87[_0x17853d];return _0x1dc0d6;};'use strict';var Sequelize=require(_0x70d8('0x0'));module[_0x70d8('0x1')]={'name':{'type':Sequelize[_0x70d8('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x70d8('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x70d8('0x3'),'beepall',_0x70d8('0x4'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 1940a39..15e2b83 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 _0x087a=['interface','flatMap','find','sequelize','transaction','each','emit','removeTeams','ids','select','field','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','includes','union','compact','value','removeAgents','forEach','userSmsQueue:remove','addAgents','spread','userSmsQueue:save','isArray','getAgents','eml-format','fast-json-patch','request-promise','bluebird','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','./smsQueue.socket','sendStatus','status','end','json','limit','count','offset','apply','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','error','stack','name','send','index','map','SmsQueue','fieldName','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','where','merge','type','VIRTUAL','filter','includeAll','findAll','rows','show','params','rawAttributes','include','options','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','getMembers','findOne','UserSmsQueue','order','SmsQueueId','User','findAndCountAll','agent','smsPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','addTeams','Team','Agents','online'];(function(_0xb5719a,_0x37546e){var _0x14dcfb=function(_0x229e72){while(--_0x229e72){_0xb5719a['push'](_0xb5719a['shift']());}};_0x14dcfb(++_0x37546e);}(_0x087a,0x1b0));var _0xa087=function(_0x2edcfd,_0x5e8fe2){_0x2edcfd=_0x2edcfd-0x0;var _0x1c0d60=_0x087a[_0x2edcfd];return _0x1c0d60;};'use strict';var emlformat=require(_0xa087('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa087('0x1'));var rp=require(_0xa087('0x2'));var moment=require('moment');var BPromise=require(_0xa087('0x3'));var Mustache=require('mustache');var util=require(_0xa087('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xa087('0x5'));var ejs=require(_0xa087('0x6'));var fs=require('fs');var fs_extra=require(_0xa087('0x7'));var _=require('lodash');var squel=require(_0xa087('0x8'));var crypto=require(_0xa087('0x9'));var jsforce=require(_0xa087('0xa'));var deskjs=require(_0xa087('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa087('0xc'));var Redis=require(_0xa087('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xa087('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa087('0xf'));var logger=require(_0xa087('0x10'))(_0xa087('0x11'));var utils=require(_0xa087('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xa087('0x13'));var db=require('../../mysqldb')['db'];config[_0xa087('0x14')]=_[_0xa087('0x15')](config[_0xa087('0x14')],{'host':_0xa087('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa087('0x14')]));require(_0xa087('0x17'))['register'](socket);function respondWithStatusCode(_0x2fab5b,_0x13cf01){_0x13cf01=_0x13cf01||0xcc;return function(_0x15414b){if(_0x15414b){return _0x2fab5b[_0xa087('0x18')](_0x13cf01);}return _0x2fab5b[_0xa087('0x19')](_0x13cf01)[_0xa087('0x1a')]();};}function respondWithResult(_0x55d260,_0x21501e){_0x21501e=_0x21501e||0xc8;return function(_0x3e306f){if(_0x3e306f){return _0x55d260[_0xa087('0x19')](_0x21501e)[_0xa087('0x1b')](_0x3e306f);}};}function respondWithFilteredResult(_0xa12904,_0x3c9272){return function(_0xdd396b){if(_0xdd396b){var _0x42be71=typeof _0x3c9272['offset']==='undefined'&&typeof _0x3c9272[_0xa087('0x1c')]==='undefined';var _0x1cd240=_0xdd396b[_0xa087('0x1d')];var _0x1ce21f=_0x42be71?0x0:_0x3c9272[_0xa087('0x1e')];var _0x308f20=_0x42be71?_0xdd396b[_0xa087('0x1d')]:_0x3c9272[_0xa087('0x1e')]+_0x3c9272['limit'];var _0x442825;if(_0x308f20>=_0x1cd240){_0x308f20=_0x1cd240;_0x442825=0xc8;}else{_0x442825=0xce;}_0xa12904[_0xa087('0x19')](_0x442825);return _0xa12904['set']('Content-Range',_0x1ce21f+'-'+_0x308f20+'/'+_0x1cd240)[_0xa087('0x1b')](_0xdd396b);}return null;};}function patchUpdates(_0x5e0b95){return function(_0x311831){try{jsonpatch[_0xa087('0x1f')](_0x311831,_0x5e0b95,!![]);}catch(_0x20df58){return BPromise[_0xa087('0x20')](_0x20df58);}return _0x311831[_0xa087('0x21')]();};}function saveUpdates(_0x17aee7,_0x41fbd0){return function(_0x3d2c70){if(_0x3d2c70){return _0x3d2c70[_0xa087('0x22')](_0x17aee7)[_0xa087('0x23')](function(_0xa4ae00){return _0xa4ae00;});}return null;};}function removeEntity(_0x3d3a8f,_0x3cd376){return function(_0x5c2339){if(_0x5c2339){return _0x5c2339[_0xa087('0x24')]()['then'](function(){var _0x109c13=_0x5c2339[_0xa087('0x25')]({'plain':!![]});var _0x3541d0=_0xa087('0x26');return db[_0xa087('0x27')]['destroy']({'where':{'type':_0x3541d0,'resourceId':_0x109c13['id']}})[_0xa087('0x23')](function(){return _0x5c2339;});})[_0xa087('0x23')](function(){_0x3d3a8f[_0xa087('0x19')](0xcc)[_0xa087('0x1a')]();});}};}function handleEntityNotFound(_0x2d9738,_0x5a3c04){return function(_0x3006ee){if(!_0x3006ee){_0x2d9738[_0xa087('0x18')](0x194);}return _0x3006ee;};}function handleError(_0x4c2063,_0x179acb){_0x179acb=_0x179acb||0x1f4;return function(_0x5f9388){logger[_0xa087('0x28')](_0x5f9388[_0xa087('0x29')]);if(_0x5f9388[_0xa087('0x2a')]){delete _0x5f9388['name'];}_0x4c2063[_0xa087('0x19')](_0x179acb)[_0xa087('0x2b')](_0x5f9388);};}exports[_0xa087('0x2c')]=function(_0x10a0e2,_0x55924d){var _0x230ab3={},_0x47f825={},_0x439dc5={'count':0x0,'rows':[]};var _0x1879c1=_[_0xa087('0x2d')](db[_0xa087('0x2e')]['rawAttributes'],function(_0x29d0dc){return{'name':_0x29d0dc[_0xa087('0x2f')],'type':_0x29d0dc['type']['key']};});_0x47f825['model']=_[_0xa087('0x2d')](_0x1879c1,_0xa087('0x2a'));_0x47f825[_0xa087('0x30')]=_[_0xa087('0x31')](_0x10a0e2[_0xa087('0x30')]);_0x47f825['filters']=_[_0xa087('0x32')](_0x47f825[_0xa087('0x33')],_0x47f825['query']);_0x230ab3[_0xa087('0x34')]=_['intersection'](_0x47f825[_0xa087('0x33')],qs[_0xa087('0x35')](_0x10a0e2[_0xa087('0x30')][_0xa087('0x35')]));_0x230ab3[_0xa087('0x34')]=_0x230ab3['attributes'][_0xa087('0x36')]?_0x230ab3[_0xa087('0x34')]:_0x47f825[_0xa087('0x33')];if(!_0x10a0e2[_0xa087('0x30')][_0xa087('0x37')](_0xa087('0x38'))){_0x230ab3[_0xa087('0x1c')]=qs['limit'](_0x10a0e2[_0xa087('0x30')][_0xa087('0x1c')]);_0x230ab3[_0xa087('0x1e')]=qs['offset'](_0x10a0e2['query'][_0xa087('0x1e')]);}_0x230ab3['order']=qs[_0xa087('0x39')](_0x10a0e2[_0xa087('0x30')][_0xa087('0x39')]);_0x230ab3['where']=qs[_0xa087('0x3a')](_[_0xa087('0x3b')](_0x10a0e2['query'],_0x47f825[_0xa087('0x3a')]),_0x1879c1);if(_0x10a0e2['query']['filter']){_0x230ab3[_0xa087('0x3c')]=_[_0xa087('0x3d')](_0x230ab3[_0xa087('0x3c')],{'$or':_[_0xa087('0x2d')](_0x1879c1,function(_0x2adfd2){if(_0x2adfd2[_0xa087('0x3e')]!==_0xa087('0x3f')){var _0x2ea242={};_0x2ea242[_0x2adfd2['name']]={'$like':'%'+_0x10a0e2[_0xa087('0x30')][_0xa087('0x40')]+'%'};return _0x2ea242;}})});}_0x230ab3=_[_0xa087('0x3d')]({},_0x230ab3,_0x10a0e2['options']);var _0x48e3c0={'where':_0x230ab3[_0xa087('0x3c')]};return db[_0xa087('0x2e')][_0xa087('0x1d')](_0x48e3c0)[_0xa087('0x23')](function(_0x5840e9){_0x439dc5[_0xa087('0x1d')]=_0x5840e9;if(_0x10a0e2[_0xa087('0x30')][_0xa087('0x41')]){_0x230ab3['include']=[{'all':!![]}];}return db[_0xa087('0x2e')][_0xa087('0x42')](_0x230ab3);})[_0xa087('0x23')](function(_0x47ba5c){_0x439dc5[_0xa087('0x43')]=_0x47ba5c;return _0x439dc5;})[_0xa087('0x23')](respondWithFilteredResult(_0x55924d,_0x230ab3))['catch'](handleError(_0x55924d,null));};exports[_0xa087('0x44')]=function(_0x23fd68,_0x4803db){var _0x31c5ff={'raw':!![],'where':{'id':_0x23fd68[_0xa087('0x45')]['id']}},_0x3c2f47={};_0x3c2f47[_0xa087('0x33')]=_[_0xa087('0x31')](db[_0xa087('0x2e')][_0xa087('0x46')]);_0x3c2f47[_0xa087('0x30')]=_[_0xa087('0x31')](_0x23fd68[_0xa087('0x30')]);_0x3c2f47[_0xa087('0x3a')]=_['intersection'](_0x3c2f47[_0xa087('0x33')],_0x3c2f47[_0xa087('0x30')]);_0x31c5ff['attributes']=_['intersection'](_0x3c2f47[_0xa087('0x33')],qs['fields'](_0x23fd68[_0xa087('0x30')]['fields']));_0x31c5ff[_0xa087('0x34')]=_0x31c5ff['attributes'][_0xa087('0x36')]?_0x31c5ff[_0xa087('0x34')]:_0x3c2f47[_0xa087('0x33')];if(_0x23fd68['query'][_0xa087('0x41')]){_0x31c5ff[_0xa087('0x47')]=[{'all':!![]}];}_0x31c5ff=_[_0xa087('0x3d')]({},_0x31c5ff,_0x23fd68[_0xa087('0x48')]);return db[_0xa087('0x2e')]['find'](_0x31c5ff)['then'](handleEntityNotFound(_0x4803db,null))[_0xa087('0x23')](respondWithResult(_0x4803db,null))[_0xa087('0x49')](handleError(_0x4803db,null));};exports[_0xa087('0x4a')]=function(_0x3a32d4,_0x34748a){return db[_0xa087('0x2e')][_0xa087('0x4a')](_0x3a32d4[_0xa087('0x4b')],{})[_0xa087('0x23')](function(_0x1509af){var _0x1f3f61=_0x3a32d4[_0xa087('0x4c')][_0xa087('0x25')]({'plain':!![]});if(!_0x1f3f61)throw new Error(_0xa087('0x4d'));if(_0x1f3f61['role']===_0xa087('0x4c')){var _0x1ef4bb=_0x1509af[_0xa087('0x25')]({'plain':!![]});var _0x5eac82=_0xa087('0x26');return db[_0xa087('0x4e')]['find']({'where':{'name':_0x5eac82,'userProfileId':_0x1f3f61[_0xa087('0x4f')]},'raw':!![]})['then'](function(_0x3e06d5){if(_0x3e06d5&&_0x3e06d5[_0xa087('0x50')]===0x0){return db['UserProfileResource'][_0xa087('0x4a')]({'name':_0x1ef4bb[_0xa087('0x2a')],'resourceId':_0x1ef4bb['id'],'type':_0x3e06d5[_0xa087('0x2a')],'sectionId':_0x3e06d5['id']},{})[_0xa087('0x23')](function(){return _0x1509af;});}else{return _0x1509af;}})[_0xa087('0x49')](function(_0x8c2ff8){logger[_0xa087('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x8c2ff8);throw _0x8c2ff8;});}return _0x1509af;})[_0xa087('0x23')](respondWithResult(_0x34748a,0xc9))[_0xa087('0x49')](handleError(_0x34748a,null));};exports[_0xa087('0x22')]=function(_0x18b892,_0x3bfb70){if(_0x18b892[_0xa087('0x4b')]['id']){delete _0x18b892['body']['id'];}return db[_0xa087('0x2e')]['find']({'where':{'id':_0x18b892[_0xa087('0x45')]['id']}})[_0xa087('0x23')](handleEntityNotFound(_0x3bfb70,null))[_0xa087('0x23')](saveUpdates(_0x18b892[_0xa087('0x4b')],null))['then'](respondWithResult(_0x3bfb70,null))[_0xa087('0x49')](handleError(_0x3bfb70,null));};exports['destroy']=function(_0x59650e,_0x264d1b){return db[_0xa087('0x2e')]['find']({'where':{'id':_0x59650e['params']['id']}})['then'](handleEntityNotFound(_0x264d1b,null))[_0xa087('0x23')](removeEntity(_0x264d1b,null))['catch'](handleError(_0x264d1b,null));};exports['describe']=function(_0x2300ff,_0x21e7e5){return db[_0xa087('0x2e')]['describe']()[_0xa087('0x23')](respondWithResult(_0x21e7e5,null))[_0xa087('0x49')](handleError(_0x21e7e5,null));};exports[_0xa087('0x51')]=function(_0x147647,_0x2e24d,_0x594a91){var _0x3020b9={'raw':!![],'where':{}},_0x183574={},_0x8a08ad;return db[_0xa087('0x2e')][_0xa087('0x52')]({'where':{'id':_0x147647[_0xa087('0x45')]['id']}})['then'](handleEntityNotFound(_0x2e24d,null))[_0xa087('0x23')](function(_0x327fcf){if(_0x327fcf){_0x8a08ad=_0x327fcf['get']({'plain':!![]});_0x183574[_0xa087('0x33')]=_[_0xa087('0x31')](db[_0xa087('0x53')][_0xa087('0x46')]);_0x183574[_0xa087('0x30')]=_[_0xa087('0x31')](_0x147647[_0xa087('0x30')]);_0x183574[_0xa087('0x3a')]=_[_0xa087('0x32')](_0x183574[_0xa087('0x33')],_0x183574[_0xa087('0x30')]);_0x3020b9[_0xa087('0x34')]=_[_0xa087('0x32')](_0x183574['model'],qs[_0xa087('0x35')](_0x147647[_0xa087('0x30')]['fields']));_0x3020b9[_0xa087('0x34')]=_0x3020b9['attributes'][_0xa087('0x36')]?_0x3020b9[_0xa087('0x34')]:_0x183574[_0xa087('0x33')];if(!_0x147647[_0xa087('0x30')][_0xa087('0x37')](_0xa087('0x38'))){_0x3020b9[_0xa087('0x1c')]=qs[_0xa087('0x1c')](_0x147647[_0xa087('0x30')][_0xa087('0x1c')]);_0x3020b9[_0xa087('0x1e')]=qs[_0xa087('0x1e')](_0x147647['query']['offset']);}_0x3020b9[_0xa087('0x54')]=qs[_0xa087('0x39')](_0x147647[_0xa087('0x30')][_0xa087('0x39')]);_0x3020b9[_0xa087('0x3c')]=qs[_0xa087('0x3a')](_[_0xa087('0x3b')](_0x147647[_0xa087('0x30')],_0x183574['filters']));_0x3020b9[_0xa087('0x3c')][_0xa087('0x55')]=_0x327fcf['id'];if(_0x147647[_0xa087('0x30')][_0xa087('0x40')]){_0x3020b9[_0xa087('0x3c')]=_['merge'](_0x3020b9[_0xa087('0x3c')],{'$or':_[_0xa087('0x2d')](_0x3020b9['attributes'],function(_0x5a4d4f){var _0x2be85d={};_0x2be85d[_0x5a4d4f]={'$like':'%'+_0x147647[_0xa087('0x30')][_0xa087('0x40')]+'%'};return _0x2be85d;})});}_0x3020b9=_['merge']({},_0x3020b9,_0x147647[_0xa087('0x48')]);return db[_0xa087('0x53')][_0xa087('0x42')](_0x3020b9);}})[_0xa087('0x23')](function(_0x14e4ed){if(_0x14e4ed){return db[_0xa087('0x56')][_0xa087('0x57')]({'where':{'id':_[_0xa087('0x2d')](_0x14e4ed,'UserId'),'role':_0xa087('0x58')},'attributes':['id','name',_0xa087('0x59'),'updatedAt',_0xa087('0x5a')]});}})[_0xa087('0x23')](function(_0xeb3119){if(_0xeb3119){return{'count':_0xeb3119[_0xa087('0x1d')],'rows':_[_0xa087('0x2d')](_0xeb3119[_0xa087('0x43')],function(_0x43bd0a){return{'membername':_0x43bd0a['name'],'UserId':_0x43bd0a['id'],'queue_name':_0x8a08ad['name'],'SmsQueueId':_0x8a08ad['id'],'interface':util[_0xa087('0x5b')](_0xa087('0x5c'),_0xa087('0x5d'),_0x43bd0a[_0xa087('0x2a')]),'penalty':0x0,'paused':_0x43bd0a[_0xa087('0x59')],'createdAt':_0x43bd0a[_0xa087('0x5a')],'updatedAt':_0x43bd0a[_0xa087('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa087('0x23')](respondWithFilteredResult(_0x2e24d,_0x3020b9))[_0xa087('0x49')](handleError(_0x2e24d,null));};exports[_0xa087('0x5f')]=function(_0x5ee541,_0x48b214,_0x5782da){var _0x59a21b={};var _0x5751d0={};var _0x142f12;var _0x14ffad;return db['SmsQueue']['findOne']({'where':{'id':_0x5ee541[_0xa087('0x45')]['id']}})[_0xa087('0x23')](handleEntityNotFound(_0x48b214,null))[_0xa087('0x23')](function(_0x11d3e7){if(_0x11d3e7){_0x142f12=_0x11d3e7;_0x5751d0[_0xa087('0x33')]=_[_0xa087('0x31')](db['Team'][_0xa087('0x46')]);_0x5751d0[_0xa087('0x30')]=_[_0xa087('0x31')](_0x5ee541['query']);_0x5751d0['filters']=_[_0xa087('0x32')](_0x5751d0[_0xa087('0x33')],_0x5751d0['query']);_0x59a21b[_0xa087('0x34')]=_[_0xa087('0x32')](_0x5751d0[_0xa087('0x33')],qs[_0xa087('0x35')](_0x5ee541[_0xa087('0x30')][_0xa087('0x35')]));_0x59a21b[_0xa087('0x34')]=_0x59a21b[_0xa087('0x34')][_0xa087('0x36')]?_0x59a21b[_0xa087('0x34')]:_0x5751d0['model'];_0x59a21b['order']=qs[_0xa087('0x39')](_0x5ee541[_0xa087('0x30')][_0xa087('0x39')]);_0x59a21b[_0xa087('0x3c')]=qs[_0xa087('0x3a')](_[_0xa087('0x3b')](_0x5ee541[_0xa087('0x30')],_0x5751d0[_0xa087('0x3a')]));if(_0x5ee541['query'][_0xa087('0x40')]){_0x59a21b[_0xa087('0x3c')]=_[_0xa087('0x3d')](_0x59a21b[_0xa087('0x3c')],{'$or':_[_0xa087('0x2d')](_0x59a21b[_0xa087('0x34')],function(_0x1ab875){var _0x4f8671={};_0x4f8671[_0x1ab875]={'$like':'%'+_0x5ee541[_0xa087('0x30')][_0xa087('0x40')]+'%'};return _0x4f8671;})});}_0x59a21b=_[_0xa087('0x3d')]({},_0x59a21b,_0x5ee541[_0xa087('0x48')]);return _0x142f12[_0xa087('0x5f')](_0x59a21b);}})[_0xa087('0x23')](function(_0x5ca808){if(_0x5ca808){_0x14ffad=_0x5ca808['length'];if(!_0x5ee541[_0xa087('0x30')][_0xa087('0x37')]('nolimit')){_0x59a21b[_0xa087('0x1c')]=qs[_0xa087('0x1c')](_0x5ee541[_0xa087('0x30')][_0xa087('0x1c')]);_0x59a21b[_0xa087('0x1e')]=qs[_0xa087('0x1e')](_0x5ee541[_0xa087('0x30')][_0xa087('0x1e')]);}return _0x142f12[_0xa087('0x5f')](_0x59a21b);}})['then'](function(_0x3423d7){if(_0x3423d7){return _0x3423d7?{'count':_0x14ffad,'rows':_0x3423d7}:null;}})[_0xa087('0x23')](respondWithResult(_0x48b214,null))[_0xa087('0x49')](handleError(_0x48b214,null));};exports[_0xa087('0x60')]=function(_0x54954f,_0x4b43c8,_0x273dfa){var _0x786ff6=_0x54954f[_0xa087('0x4b')]['ids'];return db[_0xa087('0x61')][_0xa087('0x42')]({'where':{'id':_0x786ff6},'attributes':['id'],'include':[{'model':db[_0xa087('0x56')],'as':_0xa087('0x62'),'attributes':['id','name',_0xa087('0x63'),'voicePause',_0xa087('0x64')],'raw':!![]}]})['then'](function(_0x35765c){if(_0x35765c){var _0x1203eb=_[_0xa087('0x65')](_0x35765c,function(_0x14043c){var _0x5b2250=_0x14043c['get']({'plain':!![]});return _0x5b2250[_0xa087('0x62')];});return db[_0xa087('0x2e')][_0xa087('0x66')]({'where':{'id':_0x54954f[_0xa087('0x45')]['id']}})[_0xa087('0x23')](function(_0x1e7b5b){return db[_0xa087('0x67')][_0xa087('0x68')](function(_0x539ff3){return _0x1e7b5b[_0xa087('0x60')](_0x786ff6,{'transaction':_0x539ff3})['then'](function(){return BPromise[_0xa087('0x69')](_0x1203eb,function(_0x13f289){return db['UserSmsQueue']['findOrCreate']({'where':{'UserId':_0x13f289['id'],'SmsQueueId':_0x54954f[_0xa087('0x45')]['id']},'transaction':_0x539ff3});});})[_0xa087('0x23')](function(){_0x1203eb['forEach'](function(_0x20689b){socket[_0xa087('0x6a')]('userSmsQueue:save',{'UserId':_0x20689b['id'],'SmsQueueId':_0x1e7b5b['id']});});});});});}})[_0xa087('0x23')](respondWithStatusCode(_0x4b43c8,null))['catch'](handleError(_0x4b43c8,null));};exports[_0xa087('0x6b')]=function(_0x14c980,_0x46b9cf,_0xecb17a){return db[_0xa087('0x61')][_0xa087('0x42')]({'where':{'id':_0x14c980['query'][_0xa087('0x6c')]},'attributes':['id'],'include':[{'model':db[_0xa087('0x56')],'as':_0xa087('0x62'),'attributes':['id'],'raw':!![]}]})[_0xa087('0x23')](handleEntityNotFound(_0x46b9cf,null))[_0xa087('0x23')](function(_0x566e4b){var _0x40c4c3=_[_0xa087('0x2d')](_0x566e4b,'id');var _0x53fd28=[];var _0x4dcb21=[];var _0x4dacb6=squel[_0xa087('0x6d')]();_0x4dacb6[_0xa087('0x6e')]('tq.TeamId')[_0xa087('0x6f')](_0xa087('0x70'),'tq')[_0xa087('0x71')](_0xa087('0x72'),'ut',_0xa087('0x73'))[_0xa087('0x3c')]('SmsQueueId\x20=\x20?',_0x14c980[_0xa087('0x45')]['id']);for(var _0x3c0547=0x0;_0x3c0547<_0x566e4b[_0xa087('0x36')];_0x3c0547+=0x1){let _0x41067b=_0x566e4b[_0x3c0547];for(var _0x90b604=0x0;_0x90b604<_0x41067b[_0xa087('0x62')][_0xa087('0x36')];_0x90b604+=0x1){let _0x261397=_0x41067b[_0xa087('0x62')][_0x90b604];var _0x378520=_0x4dacb6['clone']();_0x378520[_0xa087('0x3c')](_0xa087('0x74'),_0x261397['id']);_0x4dcb21['push'](db[_0xa087('0x67')][_0xa087('0x30')](_0x378520[_0xa087('0x75')](),{'type':db[_0xa087('0x67')][_0xa087('0x76')][_0xa087('0x77')]})['then'](function(_0x3be670){if(_0x3be670[_0xa087('0x36')]===0x1){return _0x261397['id'];}else{var _0xedc38d=_[_0xa087('0x78')](_[_0xa087('0x2d')](_0x3be670,'TeamId'),function(_0x52e40a){return _[_0xa087('0x79')](_0x40c4c3,_0x52e40a);});if(_0xedc38d){return _0x261397['id'];}}}));}}return BPromise['all'](_0x4dcb21)[_0xa087('0x23')](function(_0x1b59d7){_0x53fd28=_(_0x53fd28)[_0xa087('0x7a')](_0x1b59d7)[_0xa087('0x7b')]()[_0xa087('0x7c')]();return db[_0xa087('0x2e')][_0xa087('0x66')]({'where':{'id':_0x14c980[_0xa087('0x45')]['id']}})[_0xa087('0x23')](function(_0x4a71eb){return db[_0xa087('0x67')][_0xa087('0x68')](function(_0x3f9ed6){return _0x4a71eb[_0xa087('0x6b')](_0x14c980[_0xa087('0x30')][_0xa087('0x6c')],{'transaction':_0x3f9ed6})[_0xa087('0x23')](function(){if(!_['isEmpty'](_0x53fd28)){return _0x4a71eb[_0xa087('0x7d')](_0x53fd28,{'transaction':_0x3f9ed6});}})['then'](function(){_0x53fd28[_0xa087('0x7e')](function(_0x548326){socket[_0xa087('0x6a')](_0xa087('0x7f'),{'UserId':_0x548326,'SmsQueueId':_0x4a71eb['id']});});});});});});})[_0xa087('0x23')](respondWithStatusCode(_0x46b9cf,null))[_0xa087('0x49')](handleError(_0x46b9cf,null));};exports[_0xa087('0x80')]=function(_0x3b931c,_0xb378df,_0x821922){return db[_0xa087('0x2e')][_0xa087('0x66')]({'where':{'id':_0x3b931c[_0xa087('0x45')]['id']}})['then'](handleEntityNotFound(_0xb378df,null))[_0xa087('0x23')](function(_0x4a8694){if(_0x4a8694){return _0x4a8694[_0xa087('0x80')](_0x3b931c[_0xa087('0x4b')][_0xa087('0x6c')],_['omit'](_0x3b931c[_0xa087('0x4b')],[_0xa087('0x6c'),'id'])||{})[_0xa087('0x81')](function(_0x2b603b){for(var _0x4ec3bf=0x0;_0x4ec3bf<_0x3b931c[_0xa087('0x4b')][_0xa087('0x6c')][_0xa087('0x36')];_0x4ec3bf+=0x1){socket[_0xa087('0x6a')](_0xa087('0x82'),{'UserId':Number(_0x3b931c[_0xa087('0x4b')][_0xa087('0x6c')][_0x4ec3bf]),'SmsQueueId':Number(_0x3b931c[_0xa087('0x45')]['id'])});}return _0x2b603b;});}})[_0xa087('0x23')](respondWithResult(_0xb378df,null))[_0xa087('0x49')](handleError(_0xb378df,null));};exports['removeAgents']=function(_0x5518ae,_0x1eafe3,_0x33f0a9){return db[_0xa087('0x2e')][_0xa087('0x66')]({'where':{'id':_0x5518ae[_0xa087('0x45')]['id']}})[_0xa087('0x23')](handleEntityNotFound(_0x1eafe3,null))[_0xa087('0x23')](function(_0x18521d){if(_0x18521d){return _0x18521d[_0xa087('0x7d')](_0x5518ae['query'][_0xa087('0x6c')])['then'](function(){if(_[_0xa087('0x83')](_0x5518ae[_0xa087('0x30')][_0xa087('0x6c')])){for(var _0xb62ff0=0x0;_0xb62ff0<_0x5518ae[_0xa087('0x30')][_0xa087('0x6c')]['length'];_0xb62ff0+=0x1){socket[_0xa087('0x6a')](_0xa087('0x7f'),{'UserId':Number(_0x5518ae[_0xa087('0x30')][_0xa087('0x6c')][_0xb62ff0]),'SmsQueueId':Number(_0x5518ae['params']['id'])});}}else{socket[_0xa087('0x6a')](_0xa087('0x7f'),{'UserId':Number(_0x5518ae[_0xa087('0x30')][_0xa087('0x6c')]),'SmsQueueId':Number(_0x5518ae['params']['id'])});}});}})['then'](respondWithStatusCode(_0x1eafe3,null))[_0xa087('0x49')](handleError(_0x1eafe3,null));};exports['getAgents']=function(_0x5ede6d,_0x4978cc,_0x4d9b66){var _0x1ddd49={};var _0x34950d={};var _0x1c64f3;var _0x254e1f;return db[_0xa087('0x2e')][_0xa087('0x52')]({'where':{'id':_0x5ede6d['params']['id']}})[_0xa087('0x23')](handleEntityNotFound(_0x4978cc,null))[_0xa087('0x23')](function(_0x2122b9){if(_0x2122b9){_0x1c64f3=_0x2122b9;_0x34950d[_0xa087('0x33')]=_[_0xa087('0x31')](db[_0xa087('0x56')][_0xa087('0x46')]);_0x34950d[_0xa087('0x30')]=_[_0xa087('0x31')](_0x5ede6d[_0xa087('0x30')]);_0x34950d[_0xa087('0x3a')]=_['intersection'](_0x34950d[_0xa087('0x33')],_0x34950d[_0xa087('0x30')]);_0x1ddd49['attributes']=_[_0xa087('0x32')](_0x34950d[_0xa087('0x33')],qs[_0xa087('0x35')](_0x5ede6d[_0xa087('0x30')][_0xa087('0x35')]));_0x1ddd49[_0xa087('0x34')]=_0x1ddd49[_0xa087('0x34')]['length']?_0x1ddd49[_0xa087('0x34')]:_0x34950d[_0xa087('0x33')];_0x1ddd49['order']=qs[_0xa087('0x39')](_0x5ede6d[_0xa087('0x30')]['sort']);_0x1ddd49[_0xa087('0x3c')]=qs[_0xa087('0x3a')](_['pick'](_0x5ede6d['query'],_0x34950d['filters']));if(_0x5ede6d[_0xa087('0x30')][_0xa087('0x40')]){_0x1ddd49[_0xa087('0x3c')]=_[_0xa087('0x3d')](_0x1ddd49[_0xa087('0x3c')],{'$or':_[_0xa087('0x2d')](_0x1ddd49['attributes'],function(_0x2493c0){var _0x80b0bd={};_0x80b0bd[_0x2493c0]={'$like':'%'+_0x5ede6d[_0xa087('0x30')][_0xa087('0x40')]+'%'};return _0x80b0bd;})});}_0x1ddd49=_['merge']({},_0x1ddd49,_0x5ede6d[_0xa087('0x48')]);return _0x1c64f3[_0xa087('0x84')](_0x1ddd49);}})[_0xa087('0x23')](function(_0x3dc4d8){if(_0x3dc4d8){_0x254e1f=_0x3dc4d8[_0xa087('0x36')];if(!_0x5ede6d[_0xa087('0x30')][_0xa087('0x37')](_0xa087('0x38'))){_0x1ddd49['limit']=qs[_0xa087('0x1c')](_0x5ede6d['query'][_0xa087('0x1c')]);_0x1ddd49['offset']=qs[_0xa087('0x1e')](_0x5ede6d['query'][_0xa087('0x1e')]);}return _0x1c64f3[_0xa087('0x84')](_0x1ddd49);}})[_0xa087('0x23')](function(_0x57551a){if(_0x57551a){return _0x57551a?{'count':_0x254e1f,'rows':_0x57551a}:null;}})[_0xa087('0x23')](respondWithResult(_0x4978cc,null))[_0xa087('0x49')](handleError(_0x4978cc,null));}; \ No newline at end of file +var _0x6ce3=['describe','getMembers','findOne','pick','SmsQueueId','UserSmsQueue','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','Team','addTeams','ids','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','emit','userSmsQueue:save','removeTeams','Agents','select','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','all','union','value','isEmpty','removeAgents','forEach','userSmsQueue:remove','addAgents','omit','isArray','getAgents','request-promise','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','json','undefined','limit','count','offset','set','reject','save','update','then','get','UserProfileResource','destroy','sendStatus','error','name','send','index','map','SmsQueue','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','params','rawAttributes','length','include','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsQueues','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x1798cb,_0xafe39f){var _0x4a68ed=function(_0x2e9265){while(--_0x2e9265){_0x1798cb['push'](_0x1798cb['shift']());}};_0x4a68ed(++_0xafe39f);}(_0x6ce3,0xc1));var _0x36ce=function(_0x1770b3,_0x1aa5b0){_0x1770b3=_0x1770b3-0x0;var _0x302439=_0x6ce3[_0x1770b3];return _0x302439;};'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(_0x36ce('0x0'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x36ce('0x1'));var util=require(_0x36ce('0x2'));var path=require('path');var sox=require('sox');var csv=require(_0x36ce('0x3'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x36ce('0x4'));var _=require(_0x36ce('0x5'));var squel=require(_0x36ce('0x6'));var crypto=require(_0x36ce('0x7'));var jsforce=require(_0x36ce('0x8'));var deskjs=require('desk.js');var toCsv=require(_0x36ce('0x3'));var querystring=require(_0x36ce('0x9'));var Papa=require(_0x36ce('0xa'));var Redis=require(_0x36ce('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x36ce('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x36ce('0xd'));var logger=require(_0x36ce('0xe'))('api');var utils=require(_0x36ce('0xf'));var config=require(_0x36ce('0x10'));var licenseUtil=require(_0x36ce('0x11'));var db=require(_0x36ce('0x12'))['db'];config[_0x36ce('0x13')]=_[_0x36ce('0x14')](config[_0x36ce('0x13')],{'host':_0x36ce('0x15'),'port':0x18eb});var socket=require(_0x36ce('0x16'))(new Redis(config[_0x36ce('0x13')]));require('./smsQueue.socket')[_0x36ce('0x17')](socket);function respondWithStatusCode(_0x380710,_0x239a83){_0x239a83=_0x239a83||0xcc;return function(_0x258629){if(_0x258629){return _0x380710['sendStatus'](_0x239a83);}return _0x380710[_0x36ce('0x18')](_0x239a83)[_0x36ce('0x19')]();};}function respondWithResult(_0x5a4966,_0x11e2cc){_0x11e2cc=_0x11e2cc||0xc8;return function(_0x451b3e){if(_0x451b3e){return _0x5a4966[_0x36ce('0x18')](_0x11e2cc)[_0x36ce('0x1a')](_0x451b3e);}};}function respondWithFilteredResult(_0x4712a2,_0x5c640a){return function(_0x541e89){if(_0x541e89){var _0x13ce5b=typeof _0x5c640a['offset']===_0x36ce('0x1b')&&typeof _0x5c640a[_0x36ce('0x1c')]===_0x36ce('0x1b');var _0x37ffe8=_0x541e89[_0x36ce('0x1d')];var _0x5d1592=_0x13ce5b?0x0:_0x5c640a[_0x36ce('0x1e')];var _0x2b1935=_0x13ce5b?_0x541e89[_0x36ce('0x1d')]:_0x5c640a[_0x36ce('0x1e')]+_0x5c640a[_0x36ce('0x1c')];var _0x4860c6;if(_0x2b1935>=_0x37ffe8){_0x2b1935=_0x37ffe8;_0x4860c6=0xc8;}else{_0x4860c6=0xce;}_0x4712a2[_0x36ce('0x18')](_0x4860c6);return _0x4712a2[_0x36ce('0x1f')]('Content-Range',_0x5d1592+'-'+_0x2b1935+'/'+_0x37ffe8)[_0x36ce('0x1a')](_0x541e89);}return null;};}function patchUpdates(_0x4ec9ce){return function(_0x143715){try{jsonpatch['apply'](_0x143715,_0x4ec9ce,!![]);}catch(_0x4f6cf3){return BPromise[_0x36ce('0x20')](_0x4f6cf3);}return _0x143715[_0x36ce('0x21')]();};}function saveUpdates(_0x25a557,_0x130bd5){return function(_0x1bf3b4){if(_0x1bf3b4){return _0x1bf3b4[_0x36ce('0x22')](_0x25a557)[_0x36ce('0x23')](function(_0x624c4f){return _0x624c4f;});}return null;};}function removeEntity(_0x15949d,_0x2d7ac4){return function(_0x314dcb){if(_0x314dcb){return _0x314dcb['destroy']()[_0x36ce('0x23')](function(){var _0x5be8c0=_0x314dcb[_0x36ce('0x24')]({'plain':!![]});var _0x3bd0e5='SmsQueues';return db[_0x36ce('0x25')][_0x36ce('0x26')]({'where':{'type':_0x3bd0e5,'resourceId':_0x5be8c0['id']}})[_0x36ce('0x23')](function(){return _0x314dcb;});})['then'](function(){_0x15949d['status'](0xcc)[_0x36ce('0x19')]();});}};}function handleEntityNotFound(_0x351f0c,_0x12c5cb){return function(_0x466b4f){if(!_0x466b4f){_0x351f0c[_0x36ce('0x27')](0x194);}return _0x466b4f;};}function handleError(_0x1001e8,_0x4430ac){_0x4430ac=_0x4430ac||0x1f4;return function(_0x4d0619){logger[_0x36ce('0x28')](_0x4d0619['stack']);if(_0x4d0619['name']){delete _0x4d0619[_0x36ce('0x29')];}_0x1001e8['status'](_0x4430ac)[_0x36ce('0x2a')](_0x4d0619);};}exports[_0x36ce('0x2b')]=function(_0x1f2fcf,_0x58dddc){var _0x2ccfa1={},_0x315e3d={},_0x4bf97c={'count':0x0,'rows':[]};var _0x46a6ee=_[_0x36ce('0x2c')](db[_0x36ce('0x2d')]['rawAttributes'],function(_0xfe7d9e){return{'name':_0xfe7d9e[_0x36ce('0x2e')],'type':_0xfe7d9e[_0x36ce('0x2f')][_0x36ce('0x30')]};});_0x315e3d['model']=_[_0x36ce('0x2c')](_0x46a6ee,_0x36ce('0x29'));_0x315e3d[_0x36ce('0x31')]=_[_0x36ce('0x32')](_0x1f2fcf[_0x36ce('0x31')]);_0x315e3d[_0x36ce('0x33')]=_[_0x36ce('0x34')](_0x315e3d[_0x36ce('0x35')],_0x315e3d[_0x36ce('0x31')]);_0x2ccfa1['attributes']=_['intersection'](_0x315e3d[_0x36ce('0x35')],qs[_0x36ce('0x36')](_0x1f2fcf[_0x36ce('0x31')][_0x36ce('0x36')]));_0x2ccfa1['attributes']=_0x2ccfa1['attributes']['length']?_0x2ccfa1[_0x36ce('0x37')]:_0x315e3d[_0x36ce('0x35')];if(!_0x1f2fcf['query'][_0x36ce('0x38')](_0x36ce('0x39'))){_0x2ccfa1[_0x36ce('0x1c')]=qs[_0x36ce('0x1c')](_0x1f2fcf[_0x36ce('0x31')]['limit']);_0x2ccfa1[_0x36ce('0x1e')]=qs[_0x36ce('0x1e')](_0x1f2fcf[_0x36ce('0x31')][_0x36ce('0x1e')]);}_0x2ccfa1[_0x36ce('0x3a')]=qs[_0x36ce('0x3b')](_0x1f2fcf['query'][_0x36ce('0x3b')]);_0x2ccfa1[_0x36ce('0x3c')]=qs[_0x36ce('0x33')](_['pick'](_0x1f2fcf[_0x36ce('0x31')],_0x315e3d['filters']),_0x46a6ee);if(_0x1f2fcf['query']['filter']){_0x2ccfa1[_0x36ce('0x3c')]=_[_0x36ce('0x3d')](_0x2ccfa1['where'],{'$or':_[_0x36ce('0x2c')](_0x46a6ee,function(_0x33b7b2){if(_0x33b7b2[_0x36ce('0x2f')]!==_0x36ce('0x3e')){var _0x1fdc3d={};_0x1fdc3d[_0x33b7b2[_0x36ce('0x29')]]={'$like':'%'+_0x1f2fcf['query'][_0x36ce('0x3f')]+'%'};return _0x1fdc3d;}})});}_0x2ccfa1=_['merge']({},_0x2ccfa1,_0x1f2fcf[_0x36ce('0x40')]);var _0x25c47c={'where':_0x2ccfa1[_0x36ce('0x3c')]};return db['SmsQueue']['count'](_0x25c47c)[_0x36ce('0x23')](function(_0x1fbea9){_0x4bf97c[_0x36ce('0x1d')]=_0x1fbea9;if(_0x1f2fcf['query'][_0x36ce('0x41')]){_0x2ccfa1['include']=[{'all':!![]}];}return db[_0x36ce('0x2d')][_0x36ce('0x42')](_0x2ccfa1);})[_0x36ce('0x23')](function(_0x25518b){_0x4bf97c['rows']=_0x25518b;return _0x4bf97c;})[_0x36ce('0x23')](respondWithFilteredResult(_0x58dddc,_0x2ccfa1))['catch'](handleError(_0x58dddc,null));};exports['show']=function(_0x227158,_0x2b6c5d){var _0x9f7e5d={'raw':!![],'where':{'id':_0x227158[_0x36ce('0x43')]['id']}},_0x5aac65={};_0x5aac65[_0x36ce('0x35')]=_['keys'](db[_0x36ce('0x2d')][_0x36ce('0x44')]);_0x5aac65[_0x36ce('0x31')]=_[_0x36ce('0x32')](_0x227158['query']);_0x5aac65['filters']=_[_0x36ce('0x34')](_0x5aac65[_0x36ce('0x35')],_0x5aac65['query']);_0x9f7e5d[_0x36ce('0x37')]=_[_0x36ce('0x34')](_0x5aac65[_0x36ce('0x35')],qs[_0x36ce('0x36')](_0x227158['query'][_0x36ce('0x36')]));_0x9f7e5d[_0x36ce('0x37')]=_0x9f7e5d['attributes'][_0x36ce('0x45')]?_0x9f7e5d[_0x36ce('0x37')]:_0x5aac65['model'];if(_0x227158[_0x36ce('0x31')][_0x36ce('0x41')]){_0x9f7e5d[_0x36ce('0x46')]=[{'all':!![]}];}_0x9f7e5d=_['merge']({},_0x9f7e5d,_0x227158[_0x36ce('0x40')]);return db[_0x36ce('0x2d')]['find'](_0x9f7e5d)[_0x36ce('0x23')](handleEntityNotFound(_0x2b6c5d,null))[_0x36ce('0x23')](respondWithResult(_0x2b6c5d,null))[_0x36ce('0x47')](handleError(_0x2b6c5d,null));};exports['create']=function(_0x5501ad,_0x1b70b7){return db['SmsQueue'][_0x36ce('0x48')](_0x5501ad[_0x36ce('0x49')],{})[_0x36ce('0x23')](function(_0x20b9d5){var _0x5989bc=_0x5501ad[_0x36ce('0x4a')]['get']({'plain':!![]});if(!_0x5989bc)throw new Error(_0x36ce('0x4b'));if(_0x5989bc[_0x36ce('0x4c')]===_0x36ce('0x4a')){var _0xc73ff1=_0x20b9d5['get']({'plain':!![]});var _0x59337c=_0x36ce('0x4d');return db[_0x36ce('0x4e')][_0x36ce('0x4f')]({'where':{'name':_0x59337c,'userProfileId':_0x5989bc['userProfileId']},'raw':!![]})[_0x36ce('0x23')](function(_0xdb53fa){if(_0xdb53fa&&_0xdb53fa['autoAssociation']===0x0){return db[_0x36ce('0x25')][_0x36ce('0x48')]({'name':_0xc73ff1[_0x36ce('0x29')],'resourceId':_0xc73ff1['id'],'type':_0xdb53fa['name'],'sectionId':_0xdb53fa['id']},{})['then'](function(){return _0x20b9d5;});}else{return _0x20b9d5;}})[_0x36ce('0x47')](function(_0x41075f){logger[_0x36ce('0x28')](_0x36ce('0x50'),_0x41075f);throw _0x41075f;});}return _0x20b9d5;})[_0x36ce('0x23')](respondWithResult(_0x1b70b7,0xc9))[_0x36ce('0x47')](handleError(_0x1b70b7,null));};exports[_0x36ce('0x22')]=function(_0x482c49,_0x32d948){if(_0x482c49['body']['id']){delete _0x482c49['body']['id'];}return db[_0x36ce('0x2d')][_0x36ce('0x4f')]({'where':{'id':_0x482c49[_0x36ce('0x43')]['id']}})['then'](handleEntityNotFound(_0x32d948,null))['then'](saveUpdates(_0x482c49[_0x36ce('0x49')],null))[_0x36ce('0x23')](respondWithResult(_0x32d948,null))[_0x36ce('0x47')](handleError(_0x32d948,null));};exports[_0x36ce('0x26')]=function(_0x4282eb,_0x6e64f5){return db[_0x36ce('0x2d')][_0x36ce('0x4f')]({'where':{'id':_0x4282eb[_0x36ce('0x43')]['id']}})['then'](handleEntityNotFound(_0x6e64f5,null))['then'](removeEntity(_0x6e64f5,null))['catch'](handleError(_0x6e64f5,null));};exports[_0x36ce('0x51')]=function(_0x518eac,_0x20f8bf){return db[_0x36ce('0x2d')][_0x36ce('0x51')]()[_0x36ce('0x23')](respondWithResult(_0x20f8bf,null))['catch'](handleError(_0x20f8bf,null));};exports[_0x36ce('0x52')]=function(_0x313408,_0x7544f,_0x18d87c){var _0x3fcb21={'raw':!![],'where':{}},_0x2081b7={},_0x2446c7;return db[_0x36ce('0x2d')][_0x36ce('0x53')]({'where':{'id':_0x313408[_0x36ce('0x43')]['id']}})[_0x36ce('0x23')](handleEntityNotFound(_0x7544f,null))['then'](function(_0x4b5fc1){if(_0x4b5fc1){_0x2446c7=_0x4b5fc1[_0x36ce('0x24')]({'plain':!![]});_0x2081b7[_0x36ce('0x35')]=_[_0x36ce('0x32')](db['UserSmsQueue'][_0x36ce('0x44')]);_0x2081b7['query']=_['keys'](_0x313408[_0x36ce('0x31')]);_0x2081b7['filters']=_['intersection'](_0x2081b7[_0x36ce('0x35')],_0x2081b7[_0x36ce('0x31')]);_0x3fcb21[_0x36ce('0x37')]=_[_0x36ce('0x34')](_0x2081b7[_0x36ce('0x35')],qs[_0x36ce('0x36')](_0x313408[_0x36ce('0x31')][_0x36ce('0x36')]));_0x3fcb21['attributes']=_0x3fcb21[_0x36ce('0x37')][_0x36ce('0x45')]?_0x3fcb21[_0x36ce('0x37')]:_0x2081b7[_0x36ce('0x35')];if(!_0x313408[_0x36ce('0x31')][_0x36ce('0x38')](_0x36ce('0x39'))){_0x3fcb21[_0x36ce('0x1c')]=qs[_0x36ce('0x1c')](_0x313408[_0x36ce('0x31')][_0x36ce('0x1c')]);_0x3fcb21[_0x36ce('0x1e')]=qs[_0x36ce('0x1e')](_0x313408[_0x36ce('0x31')][_0x36ce('0x1e')]);}_0x3fcb21[_0x36ce('0x3a')]=qs[_0x36ce('0x3b')](_0x313408[_0x36ce('0x31')][_0x36ce('0x3b')]);_0x3fcb21[_0x36ce('0x3c')]=qs[_0x36ce('0x33')](_[_0x36ce('0x54')](_0x313408[_0x36ce('0x31')],_0x2081b7['filters']));_0x3fcb21[_0x36ce('0x3c')][_0x36ce('0x55')]=_0x4b5fc1['id'];if(_0x313408['query']['filter']){_0x3fcb21[_0x36ce('0x3c')]=_['merge'](_0x3fcb21[_0x36ce('0x3c')],{'$or':_[_0x36ce('0x2c')](_0x3fcb21[_0x36ce('0x37')],function(_0x3de252){var _0x76f55f={};_0x76f55f[_0x3de252]={'$like':'%'+_0x313408[_0x36ce('0x31')][_0x36ce('0x3f')]+'%'};return _0x76f55f;})});}_0x3fcb21=_[_0x36ce('0x3d')]({},_0x3fcb21,_0x313408[_0x36ce('0x40')]);return db[_0x36ce('0x56')]['findAll'](_0x3fcb21);}})['then'](function(_0x485065){if(_0x485065){return db[_0x36ce('0x57')][_0x36ce('0x58')]({'where':{'id':_[_0x36ce('0x2c')](_0x485065,_0x36ce('0x59')),'role':_0x36ce('0x5a')},'attributes':['id','name',_0x36ce('0x5b'),_0x36ce('0x5c'),_0x36ce('0x5d')]});}})[_0x36ce('0x23')](function(_0x4ba621){if(_0x4ba621){return{'count':_0x4ba621[_0x36ce('0x1d')],'rows':_['map'](_0x4ba621[_0x36ce('0x5e')],function(_0x2862b3){return{'membername':_0x2862b3[_0x36ce('0x29')],'UserId':_0x2862b3['id'],'queue_name':_0x2446c7[_0x36ce('0x29')],'SmsQueueId':_0x2446c7['id'],'interface':util[_0x36ce('0x5f')](_0x36ce('0x60'),_0x36ce('0x61'),_0x2862b3[_0x36ce('0x29')]),'penalty':0x0,'paused':_0x2862b3[_0x36ce('0x5b')],'createdAt':_0x2862b3[_0x36ce('0x5d')],'updatedAt':_0x2862b3[_0x36ce('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x36ce('0x23')](respondWithFilteredResult(_0x7544f,_0x3fcb21))['catch'](handleError(_0x7544f,null));};exports[_0x36ce('0x62')]=function(_0x8a8215,_0x4aa434,_0x516499){var _0x3a96bb={};var _0x550e4a={};var _0x3e5022;var _0xc4bebd;return db[_0x36ce('0x2d')][_0x36ce('0x53')]({'where':{'id':_0x8a8215[_0x36ce('0x43')]['id']}})['then'](handleEntityNotFound(_0x4aa434,null))[_0x36ce('0x23')](function(_0x3d68c7){if(_0x3d68c7){_0x3e5022=_0x3d68c7;_0x550e4a[_0x36ce('0x35')]=_[_0x36ce('0x32')](db[_0x36ce('0x63')][_0x36ce('0x44')]);_0x550e4a['query']=_[_0x36ce('0x32')](_0x8a8215[_0x36ce('0x31')]);_0x550e4a[_0x36ce('0x33')]=_['intersection'](_0x550e4a[_0x36ce('0x35')],_0x550e4a[_0x36ce('0x31')]);_0x3a96bb[_0x36ce('0x37')]=_[_0x36ce('0x34')](_0x550e4a[_0x36ce('0x35')],qs['fields'](_0x8a8215[_0x36ce('0x31')][_0x36ce('0x36')]));_0x3a96bb['attributes']=_0x3a96bb[_0x36ce('0x37')][_0x36ce('0x45')]?_0x3a96bb[_0x36ce('0x37')]:_0x550e4a[_0x36ce('0x35')];_0x3a96bb[_0x36ce('0x3a')]=qs[_0x36ce('0x3b')](_0x8a8215[_0x36ce('0x31')][_0x36ce('0x3b')]);_0x3a96bb[_0x36ce('0x3c')]=qs[_0x36ce('0x33')](_[_0x36ce('0x54')](_0x8a8215[_0x36ce('0x31')],_0x550e4a[_0x36ce('0x33')]));if(_0x8a8215[_0x36ce('0x31')][_0x36ce('0x3f')]){_0x3a96bb['where']=_[_0x36ce('0x3d')](_0x3a96bb['where'],{'$or':_[_0x36ce('0x2c')](_0x3a96bb[_0x36ce('0x37')],function(_0x7b2119){var _0x156013={};_0x156013[_0x7b2119]={'$like':'%'+_0x8a8215[_0x36ce('0x31')][_0x36ce('0x3f')]+'%'};return _0x156013;})});}_0x3a96bb=_[_0x36ce('0x3d')]({},_0x3a96bb,_0x8a8215['options']);return _0x3e5022[_0x36ce('0x62')](_0x3a96bb);}})[_0x36ce('0x23')](function(_0x29574a){if(_0x29574a){_0xc4bebd=_0x29574a[_0x36ce('0x45')];if(!_0x8a8215[_0x36ce('0x31')][_0x36ce('0x38')](_0x36ce('0x39'))){_0x3a96bb['limit']=qs[_0x36ce('0x1c')](_0x8a8215['query']['limit']);_0x3a96bb[_0x36ce('0x1e')]=qs['offset'](_0x8a8215[_0x36ce('0x31')][_0x36ce('0x1e')]);}return _0x3e5022[_0x36ce('0x62')](_0x3a96bb);}})[_0x36ce('0x23')](function(_0x524445){if(_0x524445){return _0x524445?{'count':_0xc4bebd,'rows':_0x524445}:null;}})[_0x36ce('0x23')](respondWithResult(_0x4aa434,null))[_0x36ce('0x47')](handleError(_0x4aa434,null));};exports[_0x36ce('0x64')]=function(_0x949fe3,_0x168ced,_0x1db603){var _0x4030a9=_0x949fe3[_0x36ce('0x49')][_0x36ce('0x65')];return db[_0x36ce('0x63')]['findAll']({'where':{'id':_0x4030a9},'attributes':['id'],'include':[{'model':db[_0x36ce('0x57')],'as':'Agents','attributes':['id',_0x36ce('0x29'),_0x36ce('0x66'),_0x36ce('0x67'),_0x36ce('0x68')],'raw':!![]}]})[_0x36ce('0x23')](function(_0x33b7a0){if(_0x33b7a0){var _0x1b5ac8=_[_0x36ce('0x69')](_0x33b7a0,function(_0x4f7250){var _0x37f791=_0x4f7250[_0x36ce('0x24')]({'plain':!![]});return _0x37f791['Agents'];});return db[_0x36ce('0x2d')][_0x36ce('0x4f')]({'where':{'id':_0x949fe3[_0x36ce('0x43')]['id']}})[_0x36ce('0x23')](function(_0x1e09c0){return db[_0x36ce('0x6a')][_0x36ce('0x6b')](function(_0x152c4c){return _0x1e09c0['addTeams'](_0x4030a9,{'transaction':_0x152c4c})[_0x36ce('0x23')](function(){return BPromise[_0x36ce('0x6c')](_0x1b5ac8,function(_0x291e81){return db['UserSmsQueue'][_0x36ce('0x6d')]({'where':{'UserId':_0x291e81['id'],'SmsQueueId':_0x949fe3['params']['id']},'transaction':_0x152c4c});});})[_0x36ce('0x23')](function(){_0x1b5ac8['forEach'](function(_0xb5ba5){socket[_0x36ce('0x6e')](_0x36ce('0x6f'),{'UserId':_0xb5ba5['id'],'SmsQueueId':_0x1e09c0['id']});});});});});}})[_0x36ce('0x23')](respondWithStatusCode(_0x168ced,null))[_0x36ce('0x47')](handleError(_0x168ced,null));};exports[_0x36ce('0x70')]=function(_0xf51725,_0x847d10,_0x9f181d){return db[_0x36ce('0x63')][_0x36ce('0x42')]({'where':{'id':_0xf51725[_0x36ce('0x31')]['ids']},'attributes':['id'],'include':[{'model':db[_0x36ce('0x57')],'as':_0x36ce('0x71'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x847d10,null))[_0x36ce('0x23')](function(_0x269186){var _0x53c721=_[_0x36ce('0x2c')](_0x269186,'id');var _0x11e67f=[];var _0x5c7701=[];var _0x2109dd=squel[_0x36ce('0x72')]();_0x2109dd[_0x36ce('0x73')](_0x36ce('0x74'))[_0x36ce('0x75')](_0x36ce('0x76'),'tq')[_0x36ce('0x77')](_0x36ce('0x78'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x36ce('0x3c')]('SmsQueueId\x20=\x20?',_0xf51725[_0x36ce('0x43')]['id']);for(var _0x184214=0x0;_0x184214<_0x269186[_0x36ce('0x45')];_0x184214+=0x1){let _0x369a35=_0x269186[_0x184214];for(var _0x3fd5fe=0x0;_0x3fd5fe<_0x369a35['Agents'][_0x36ce('0x45')];_0x3fd5fe+=0x1){let _0x24d0dd=_0x369a35['Agents'][_0x3fd5fe];var _0x13215c=_0x2109dd[_0x36ce('0x79')]();_0x13215c[_0x36ce('0x3c')](_0x36ce('0x7a'),_0x24d0dd['id']);_0x5c7701['push'](db[_0x36ce('0x6a')][_0x36ce('0x31')](_0x13215c[_0x36ce('0x7b')](),{'type':db[_0x36ce('0x6a')][_0x36ce('0x7c')][_0x36ce('0x7d')]})[_0x36ce('0x23')](function(_0x4c8d52){if(_0x4c8d52[_0x36ce('0x45')]===0x1){return _0x24d0dd['id'];}else{var _0x946944=_['every'](_[_0x36ce('0x2c')](_0x4c8d52,'TeamId'),function(_0x350f5c){return _['includes'](_0x53c721,_0x350f5c);});if(_0x946944){return _0x24d0dd['id'];}}}));}}return BPromise[_0x36ce('0x7e')](_0x5c7701)[_0x36ce('0x23')](function(_0x55fffe){_0x11e67f=_(_0x11e67f)[_0x36ce('0x7f')](_0x55fffe)['compact']()[_0x36ce('0x80')]();return db['SmsQueue'][_0x36ce('0x4f')]({'where':{'id':_0xf51725[_0x36ce('0x43')]['id']}})[_0x36ce('0x23')](function(_0x1c3ceb){return db[_0x36ce('0x6a')]['transaction'](function(_0x1012c1){return _0x1c3ceb['removeTeams'](_0xf51725['query'][_0x36ce('0x65')],{'transaction':_0x1012c1})[_0x36ce('0x23')](function(){if(!_[_0x36ce('0x81')](_0x11e67f)){return _0x1c3ceb[_0x36ce('0x82')](_0x11e67f,{'transaction':_0x1012c1});}})['then'](function(){_0x11e67f[_0x36ce('0x83')](function(_0x347e00){socket[_0x36ce('0x6e')](_0x36ce('0x84'),{'UserId':_0x347e00,'SmsQueueId':_0x1c3ceb['id']});});});});});});})[_0x36ce('0x23')](respondWithStatusCode(_0x847d10,null))[_0x36ce('0x47')](handleError(_0x847d10,null));};exports[_0x36ce('0x85')]=function(_0x3ca876,_0x3f947b,_0xa75955){return db[_0x36ce('0x2d')][_0x36ce('0x4f')]({'where':{'id':_0x3ca876[_0x36ce('0x43')]['id']}})[_0x36ce('0x23')](handleEntityNotFound(_0x3f947b,null))[_0x36ce('0x23')](function(_0x4a2765){if(_0x4a2765){return _0x4a2765[_0x36ce('0x85')](_0x3ca876[_0x36ce('0x49')][_0x36ce('0x65')],_[_0x36ce('0x86')](_0x3ca876[_0x36ce('0x49')],[_0x36ce('0x65'),'id'])||{})['spread'](function(_0x2c0e29){for(var _0x4878f5=0x0;_0x4878f5<_0x3ca876[_0x36ce('0x49')][_0x36ce('0x65')]['length'];_0x4878f5+=0x1){socket[_0x36ce('0x6e')](_0x36ce('0x6f'),{'UserId':Number(_0x3ca876[_0x36ce('0x49')][_0x36ce('0x65')][_0x4878f5]),'SmsQueueId':Number(_0x3ca876[_0x36ce('0x43')]['id'])});}return _0x2c0e29;});}})[_0x36ce('0x23')](respondWithResult(_0x3f947b,null))[_0x36ce('0x47')](handleError(_0x3f947b,null));};exports[_0x36ce('0x82')]=function(_0x1422d0,_0x47028a,_0x53e590){return db[_0x36ce('0x2d')][_0x36ce('0x4f')]({'where':{'id':_0x1422d0['params']['id']}})[_0x36ce('0x23')](handleEntityNotFound(_0x47028a,null))[_0x36ce('0x23')](function(_0x114c2e){if(_0x114c2e){return _0x114c2e[_0x36ce('0x82')](_0x1422d0[_0x36ce('0x31')]['ids'])['then'](function(){if(_[_0x36ce('0x87')](_0x1422d0[_0x36ce('0x31')][_0x36ce('0x65')])){for(var _0xcec716=0x0;_0xcec716<_0x1422d0[_0x36ce('0x31')][_0x36ce('0x65')]['length'];_0xcec716+=0x1){socket['emit'](_0x36ce('0x84'),{'UserId':Number(_0x1422d0[_0x36ce('0x31')][_0x36ce('0x65')][_0xcec716]),'SmsQueueId':Number(_0x1422d0[_0x36ce('0x43')]['id'])});}}else{socket['emit'](_0x36ce('0x84'),{'UserId':Number(_0x1422d0[_0x36ce('0x31')][_0x36ce('0x65')]),'SmsQueueId':Number(_0x1422d0['params']['id'])});}});}})['then'](respondWithStatusCode(_0x47028a,null))[_0x36ce('0x47')](handleError(_0x47028a,null));};exports[_0x36ce('0x88')]=function(_0x22a726,_0x2138f2,_0x4ba4d8){var _0x400980={};var _0x1cecc7={};var _0x5b4f0c;var _0x327910;return db['SmsQueue'][_0x36ce('0x53')]({'where':{'id':_0x22a726[_0x36ce('0x43')]['id']}})[_0x36ce('0x23')](handleEntityNotFound(_0x2138f2,null))[_0x36ce('0x23')](function(_0x24274f){if(_0x24274f){_0x5b4f0c=_0x24274f;_0x1cecc7[_0x36ce('0x35')]=_[_0x36ce('0x32')](db[_0x36ce('0x57')][_0x36ce('0x44')]);_0x1cecc7[_0x36ce('0x31')]=_['keys'](_0x22a726[_0x36ce('0x31')]);_0x1cecc7[_0x36ce('0x33')]=_[_0x36ce('0x34')](_0x1cecc7[_0x36ce('0x35')],_0x1cecc7[_0x36ce('0x31')]);_0x400980['attributes']=_[_0x36ce('0x34')](_0x1cecc7[_0x36ce('0x35')],qs['fields'](_0x22a726['query'][_0x36ce('0x36')]));_0x400980[_0x36ce('0x37')]=_0x400980[_0x36ce('0x37')][_0x36ce('0x45')]?_0x400980[_0x36ce('0x37')]:_0x1cecc7[_0x36ce('0x35')];_0x400980[_0x36ce('0x3a')]=qs[_0x36ce('0x3b')](_0x22a726['query'][_0x36ce('0x3b')]);_0x400980[_0x36ce('0x3c')]=qs[_0x36ce('0x33')](_[_0x36ce('0x54')](_0x22a726[_0x36ce('0x31')],_0x1cecc7[_0x36ce('0x33')]));if(_0x22a726[_0x36ce('0x31')]['filter']){_0x400980[_0x36ce('0x3c')]=_[_0x36ce('0x3d')](_0x400980[_0x36ce('0x3c')],{'$or':_[_0x36ce('0x2c')](_0x400980[_0x36ce('0x37')],function(_0x37a3ab){var _0x5ccc08={};_0x5ccc08[_0x37a3ab]={'$like':'%'+_0x22a726['query'][_0x36ce('0x3f')]+'%'};return _0x5ccc08;})});}_0x400980=_['merge']({},_0x400980,_0x22a726[_0x36ce('0x40')]);return _0x5b4f0c['getAgents'](_0x400980);}})[_0x36ce('0x23')](function(_0x3b4f25){if(_0x3b4f25){_0x327910=_0x3b4f25[_0x36ce('0x45')];if(!_0x22a726[_0x36ce('0x31')][_0x36ce('0x38')](_0x36ce('0x39'))){_0x400980['limit']=qs[_0x36ce('0x1c')](_0x22a726[_0x36ce('0x31')]['limit']);_0x400980[_0x36ce('0x1e')]=qs[_0x36ce('0x1e')](_0x22a726[_0x36ce('0x31')][_0x36ce('0x1e')]);}return _0x5b4f0c['getAgents'](_0x400980);}})[_0x36ce('0x23')](function(_0x524d71){if(_0x524d71){return _0x524d71?{'count':_0x327910,'rows':_0x524d71}:null;}})[_0x36ce('0x23')](respondWithResult(_0x2138f2,null))[_0x36ce('0x47')](handleError(_0x2138f2,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 8b4e86d..d4b116c 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 _0x3094=['../../mysqldb','SmsQueue','save','update','remove','emit','hasOwnProperty','events'];(function(_0x21f1e3,_0x2110fd){var _0x3abf6e=function(_0x3562c2){while(--_0x3562c2){_0x21f1e3['push'](_0x21f1e3['shift']());}};_0x3abf6e(++_0x2110fd);}(_0x3094,0x9f));var _0x4309=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x3094[_0x3bf83f];return _0x22c4a9;};'use strict';var EventEmitter=require(_0x4309('0x0'));var SmsQueue=require(_0x4309('0x1'))['db'][_0x4309('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4309('0x3'),'afterUpdate':_0x4309('0x4'),'afterDestroy':_0x4309('0x5')};function emitEvent(_0x2a617c){return function(_0x539416,_0x9475e7,_0x4fd7c8){SmsQueueEvents[_0x4309('0x6')](_0x2a617c+':'+_0x539416['id'],_0x539416);SmsQueueEvents[_0x4309('0x6')](_0x2a617c,_0x539416);_0x4fd7c8(null);};}for(var e in events){if(events[_0x4309('0x7')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file +var _0x40d7=['hook','exports','events','../../mysqldb','SmsQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x4fa3d2,_0x1bb8db){var _0x1ea3fd=function(_0x4d832e){while(--_0x4d832e){_0x4fa3d2['push'](_0x4fa3d2['shift']());}};_0x1ea3fd(++_0x1bb8db);}(_0x40d7,0x1af));var _0x740d=function(_0x118139,_0x7ce965){_0x118139=_0x118139-0x0;var _0x2fece9=_0x40d7[_0x118139];return _0x2fece9;};'use strict';var EventEmitter=require(_0x740d('0x0'));var SmsQueue=require(_0x740d('0x1'))['db'][_0x740d('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x740d('0x3')](0x0);var events={'afterCreate':_0x740d('0x4'),'afterUpdate':_0x740d('0x5'),'afterDestroy':_0x740d('0x6')};function emitEvent(_0x235d68){return function(_0x2aedd5,_0x2a8a7e,_0x44b81f){SmsQueueEvents[_0x740d('0x7')](_0x235d68+':'+_0x2aedd5['id'],_0x2aedd5);SmsQueueEvents[_0x740d('0x7')](_0x235d68,_0x2aedd5);_0x44b81f(null);};}for(var e in events){if(events[_0x740d('0x8')](e)){var event=events[e];SmsQueue[_0x740d('0x9')](e,emitEvent(event));}}module[_0x740d('0xa')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 08950f9..086613b 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 _0x91ac=['api','moment','bluebird','request-promise','path','../../config/environment','./smsQueue.attributes','lodash','../../config/logger'];(function(_0x835f9,_0x400c47){var _0x106d88=function(_0x2f3d08){while(--_0x2f3d08){_0x835f9['push'](_0x835f9['shift']());}};_0x106d88(++_0x400c47);}(_0x91ac,0x73));var _0xc91a=function(_0x560634,_0x1674cc){_0x560634=_0x560634-0x0;var _0x27bdba=_0x91ac[_0x560634];return _0x27bdba;};'use strict';var _=require(_0xc91a('0x0'));var util=require('util');var logger=require(_0xc91a('0x1'))(_0xc91a('0x2'));var moment=require(_0xc91a('0x3'));var BPromise=require(_0xc91a('0x4'));var rp=require(_0xc91a('0x5'));var fs=require('fs');var path=require(_0xc91a('0x6'));var rimraf=require('rimraf');var config=require(_0xc91a('0x7'));var attributes=require(_0xc91a('0x8'));module['exports']=function(_0x50dc8d,_0x415d95){return _0x50dc8d['define']('SmsQueue',attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x10b0=['../../config/environment','exports','define','SmsQueue','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x10b0,0xac));var _0x010b=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x10b0[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x010b('0x0'));var util=require(_0x010b('0x1'));var logger=require('../../config/logger')(_0x010b('0x2'));var moment=require(_0x010b('0x3'));var BPromise=require(_0x010b('0x4'));var rp=require(_0x010b('0x5'));var fs=require('fs');var path=require(_0x010b('0x6'));var rimraf=require(_0x010b('0x7'));var config=require(_0x010b('0x8'));var attributes=require('./smsQueue.attributes');module[_0x010b('0x9')]=function(_0x1f2b94,_0x4234d1){return _0x1f2b94[_0x010b('0xa')](_0x010b('0xb'),attributes,{'tableName':'sms_queues','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 69d1f50..c3e3f39 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 _0xe7bb=['result','catch','SmsQueue','findAll','options','raw','where','attributes','limit','include','model','map','GetSmsQueue','stringify','find','ShowSmsQueue','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','register','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','error','message'];(function(_0x3fefc3,_0x33f3b5){var _0x42cd54=function(_0x1c4330){while(--_0x1c4330){_0x3fefc3['push'](_0x3fefc3['shift']());}};_0x42cd54(++_0x33f3b5);}(_0xe7bb,0xce));var _0xbe7b=function(_0x44f739,_0x4e387a){_0x44f739=_0x44f739-0x0;var _0x127e30=_0xe7bb[_0x44f739];return _0x127e30;};'use strict';var _=require(_0xbe7b('0x0'));var util=require(_0xbe7b('0x1'));var moment=require(_0xbe7b('0x2'));var BPromise=require(_0xbe7b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbe7b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe7b('0x5'));var logger=require(_0xbe7b('0x6'))(_0xbe7b('0x7'));var config=require('../../config/environment');var jayson=require(_0xbe7b('0x8'));var client=jayson[_0xbe7b('0x9')][_0xbe7b('0xa')]({'port':0x232a});config['redis']=_[_0xbe7b('0xb')](config[_0xbe7b('0xc')],{'host':_0xbe7b('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbe7b('0xc')]));require('./smsQueue.socket')[_0xbe7b('0xe')](socket);function respondWithRpcPromise(_0xbdd7f8,_0x4b76c4,_0x255908){return new BPromise(function(_0x4ead8b,_0x610f98){return client['request'](_0xbdd7f8,_0x255908)[_0xbe7b('0xf')](function(_0x2181c9){logger[_0xbe7b('0x10')](_0xbe7b('0x11'),_0x4b76c4,_0xbe7b('0x12'));logger[_0xbe7b('0x13')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x4b76c4,_0xbe7b('0x12'),JSON['stringify'](_0x2181c9));if(_0x2181c9['error']){if(_0x2181c9[_0xbe7b('0x14')]['code']===0x1f4){logger[_0xbe7b('0x14')]('SmsQueue,\x20%s,\x20%s',_0x4b76c4,_0x2181c9[_0xbe7b('0x14')][_0xbe7b('0x15')]);return _0x610f98(_0x2181c9['error']['message']);}logger['error'](_0xbe7b('0x11'),_0x4b76c4,_0x2181c9[_0xbe7b('0x14')][_0xbe7b('0x15')]);return _0x4ead8b(_0x2181c9['error']['message']);}else{logger[_0xbe7b('0x10')](_0xbe7b('0x11'),_0x4b76c4,_0xbe7b('0x12'));_0x4ead8b(_0x2181c9[_0xbe7b('0x16')][_0xbe7b('0x15')]);}})[_0xbe7b('0x17')](function(_0x672a4c){logger[_0xbe7b('0x14')](_0xbe7b('0x11'),_0x4b76c4,_0x672a4c);_0x610f98(_0x672a4c);});});}exports['GetSmsQueue']=function(_0x54bb9a){var _0x30dc68=this;return new Promise(function(_0x57bc9d,_0x594c8f){return db[_0xbe7b('0x18')][_0xbe7b('0x19')]({'raw':_0x54bb9a[_0xbe7b('0x1a')]?_0x54bb9a['options'][_0xbe7b('0x1b')]===undefined?!![]:![]:!![],'where':_0x54bb9a[_0xbe7b('0x1a')]?_0x54bb9a[_0xbe7b('0x1a')][_0xbe7b('0x1c')]||null:null,'attributes':_0x54bb9a['options']?_0x54bb9a[_0xbe7b('0x1a')][_0xbe7b('0x1d')]||null:null,'limit':_0x54bb9a[_0xbe7b('0x1a')]?_0x54bb9a['options'][_0xbe7b('0x1e')]||null:null,'include':_0x54bb9a[_0xbe7b('0x1a')]?_0x54bb9a['options'][_0xbe7b('0x1f')]?_['map'](_0x54bb9a[_0xbe7b('0x1a')][_0xbe7b('0x1f')],function(_0x56c479){return{'model':db[_0x56c479[_0xbe7b('0x20')]],'as':_0x56c479['as'],'attributes':_0x56c479[_0xbe7b('0x1d')],'include':_0x56c479[_0xbe7b('0x1f')]?_[_0xbe7b('0x21')](_0x56c479[_0xbe7b('0x1f')],function(_0x460cd9){return{'model':db[_0x460cd9[_0xbe7b('0x20')]],'as':_0x460cd9['as'],'attributes':_0x460cd9['attributes'],'include':_0x460cd9[_0xbe7b('0x1f')]?_[_0xbe7b('0x21')](_0x460cd9[_0xbe7b('0x1f')],function(_0x582628){return{'model':db[_0x582628['model']],'as':_0x582628['as'],'attributes':_0x582628[_0xbe7b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xbe7b('0xf')](function(_0x4d5a91){logger['info'](_0xbe7b('0x22'),_0x54bb9a);logger[_0xbe7b('0x13')](_0xbe7b('0x22'),_0x54bb9a,JSON[_0xbe7b('0x23')](_0x4d5a91));_0x57bc9d(_0x4d5a91);})[_0xbe7b('0x17')](function(_0x46d513){logger['error'](_0xbe7b('0x22'),_0x46d513[_0xbe7b('0x15')],_0x54bb9a);_0x594c8f(_0x30dc68[_0xbe7b('0x14')](0x1f4,_0x46d513['message']));});});};exports['ShowSmsQueue']=function(_0x223ce9){var _0x404a52=this;return new Promise(function(_0x491a31,_0x4b45a2){return db[_0xbe7b('0x18')][_0xbe7b('0x24')]({'raw':_0x223ce9[_0xbe7b('0x1a')]?_0x223ce9[_0xbe7b('0x1a')][_0xbe7b('0x1b')]===undefined?!![]:![]:!![],'where':_0x223ce9['options']?_0x223ce9[_0xbe7b('0x1a')][_0xbe7b('0x1c')]||null:null,'attributes':_0x223ce9[_0xbe7b('0x1a')]?_0x223ce9[_0xbe7b('0x1a')]['attributes']||null:null,'include':_0x223ce9[_0xbe7b('0x1a')]?_0x223ce9[_0xbe7b('0x1a')][_0xbe7b('0x1f')]?_['map'](_0x223ce9[_0xbe7b('0x1a')][_0xbe7b('0x1f')],function(_0x2da8af){return{'model':db[_0x2da8af[_0xbe7b('0x20')]],'as':_0x2da8af['as'],'attributes':_0x2da8af[_0xbe7b('0x1d')],'include':_0x2da8af[_0xbe7b('0x1f')]?_[_0xbe7b('0x21')](_0x2da8af['include'],function(_0x4e0e47){return{'model':db[_0x4e0e47[_0xbe7b('0x20')]],'as':_0x4e0e47['as'],'attributes':_0x4e0e47[_0xbe7b('0x1d')],'include':_0x4e0e47['include']?_[_0xbe7b('0x21')](_0x4e0e47['include'],function(_0x10112e){return{'model':db[_0x10112e[_0xbe7b('0x20')]],'as':_0x10112e['as'],'attributes':_0x10112e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x26c76a){logger[_0xbe7b('0x10')]('ShowSmsQueue',_0x223ce9);logger[_0xbe7b('0x13')]('ShowSmsQueue',_0x223ce9,JSON[_0xbe7b('0x23')](_0x26c76a));_0x491a31(_0x26c76a);})[_0xbe7b('0x17')](function(_0x49911f){logger[_0xbe7b('0x14')](_0xbe7b('0x25'),_0x49911f[_0xbe7b('0x15')],_0x223ce9);_0x4b45a2(_0x404a52['error'](0x1f4,_0x49911f[_0xbe7b('0x15')]));});});}; \ No newline at end of file +var _0x30e2=['SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','SmsQueue','findAll','options','raw','where','include','map','attributes','model','GetSmsQueue','stringify','ShowSmsQueue','find','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','info'];(function(_0x302f55,_0x31872f){var _0x55ca94=function(_0x477ac3){while(--_0x477ac3){_0x302f55['push'](_0x302f55['shift']());}};_0x55ca94(++_0x31872f);}(_0x30e2,0x12d));var _0x230e=function(_0x2507b5,_0x10d52e){_0x2507b5=_0x2507b5-0x0;var _0x129077=_0x30e2[_0x2507b5];return _0x129077;};'use strict';var _=require(_0x230e('0x0'));var util=require('util');var moment=require(_0x230e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x230e('0x2'));var db=require(_0x230e('0x3'))['db'];var utils=require(_0x230e('0x4'));var logger=require(_0x230e('0x5'))(_0x230e('0x6'));var config=require(_0x230e('0x7'));var jayson=require(_0x230e('0x8'));var client=jayson[_0x230e('0x9')]['http']({'port':0x232a});config['redis']=_[_0x230e('0xa')](config[_0x230e('0xb')],{'host':_0x230e('0xc'),'port':0x18eb});var socket=require(_0x230e('0xd'))(new Redis(config[_0x230e('0xb')]));require(_0x230e('0xe'))[_0x230e('0xf')](socket);function respondWithRpcPromise(_0x4e667d,_0x48a706,_0x2e8c6b){return new BPromise(function(_0x476910,_0x45516b){return client[_0x230e('0x10')](_0x4e667d,_0x2e8c6b)[_0x230e('0x11')](function(_0x3ca737){logger[_0x230e('0x12')](_0x230e('0x13'),_0x48a706,_0x230e('0x14'));logger[_0x230e('0x15')](_0x230e('0x16'),_0x48a706,_0x230e('0x14'),JSON['stringify'](_0x3ca737));if(_0x3ca737['error']){if(_0x3ca737[_0x230e('0x17')][_0x230e('0x18')]===0x1f4){logger[_0x230e('0x17')](_0x230e('0x13'),_0x48a706,_0x3ca737[_0x230e('0x17')][_0x230e('0x19')]);return _0x45516b(_0x3ca737[_0x230e('0x17')][_0x230e('0x19')]);}logger[_0x230e('0x17')](_0x230e('0x13'),_0x48a706,_0x3ca737['error'][_0x230e('0x19')]);return _0x476910(_0x3ca737[_0x230e('0x17')][_0x230e('0x19')]);}else{logger['info'](_0x230e('0x13'),_0x48a706,'request\x20sent');_0x476910(_0x3ca737['result'][_0x230e('0x19')]);}})[_0x230e('0x1a')](function(_0x1acd0c){logger[_0x230e('0x17')](_0x230e('0x13'),_0x48a706,_0x1acd0c);_0x45516b(_0x1acd0c);});});}exports['GetSmsQueue']=function(_0x1413a5){var _0x337bd3=this;return new Promise(function(_0x7e26a2,_0x2a66b0){return db[_0x230e('0x1b')][_0x230e('0x1c')]({'raw':_0x1413a5['options']?_0x1413a5[_0x230e('0x1d')][_0x230e('0x1e')]===undefined?!![]:![]:!![],'where':_0x1413a5[_0x230e('0x1d')]?_0x1413a5[_0x230e('0x1d')][_0x230e('0x1f')]||null:null,'attributes':_0x1413a5['options']?_0x1413a5[_0x230e('0x1d')]['attributes']||null:null,'limit':_0x1413a5[_0x230e('0x1d')]?_0x1413a5['options']['limit']||null:null,'include':_0x1413a5[_0x230e('0x1d')]?_0x1413a5[_0x230e('0x1d')][_0x230e('0x20')]?_[_0x230e('0x21')](_0x1413a5[_0x230e('0x1d')][_0x230e('0x20')],function(_0x18df00){return{'model':db[_0x18df00['model']],'as':_0x18df00['as'],'attributes':_0x18df00[_0x230e('0x22')],'include':_0x18df00[_0x230e('0x20')]?_[_0x230e('0x21')](_0x18df00[_0x230e('0x20')],function(_0xf9fdec){return{'model':db[_0xf9fdec[_0x230e('0x23')]],'as':_0xf9fdec['as'],'attributes':_0xf9fdec[_0x230e('0x22')],'include':_0xf9fdec[_0x230e('0x20')]?_[_0x230e('0x21')](_0xf9fdec[_0x230e('0x20')],function(_0x197748){return{'model':db[_0x197748['model']],'as':_0x197748['as'],'attributes':_0x197748[_0x230e('0x22')]};}):[]};}):[]};}):[]:[]})[_0x230e('0x11')](function(_0x2f7dcf){logger[_0x230e('0x12')](_0x230e('0x24'),_0x1413a5);logger[_0x230e('0x15')](_0x230e('0x24'),_0x1413a5,JSON[_0x230e('0x25')](_0x2f7dcf));_0x7e26a2(_0x2f7dcf);})['catch'](function(_0x3d8cb5){logger[_0x230e('0x17')](_0x230e('0x24'),_0x3d8cb5['message'],_0x1413a5);_0x2a66b0(_0x337bd3[_0x230e('0x17')](0x1f4,_0x3d8cb5[_0x230e('0x19')]));});});};exports[_0x230e('0x26')]=function(_0x541fd6){var _0x1f4601=this;return new Promise(function(_0x36cdff,_0x3f2ec8){return db[_0x230e('0x1b')][_0x230e('0x27')]({'raw':_0x541fd6[_0x230e('0x1d')]?_0x541fd6[_0x230e('0x1d')][_0x230e('0x1e')]===undefined?!![]:![]:!![],'where':_0x541fd6[_0x230e('0x1d')]?_0x541fd6['options'][_0x230e('0x1f')]||null:null,'attributes':_0x541fd6[_0x230e('0x1d')]?_0x541fd6['options'][_0x230e('0x22')]||null:null,'include':_0x541fd6[_0x230e('0x1d')]?_0x541fd6[_0x230e('0x1d')][_0x230e('0x20')]?_[_0x230e('0x21')](_0x541fd6[_0x230e('0x1d')][_0x230e('0x20')],function(_0x41381d){return{'model':db[_0x41381d['model']],'as':_0x41381d['as'],'attributes':_0x41381d[_0x230e('0x22')],'include':_0x41381d['include']?_[_0x230e('0x21')](_0x41381d[_0x230e('0x20')],function(_0x4693d1){return{'model':db[_0x4693d1['model']],'as':_0x4693d1['as'],'attributes':_0x4693d1[_0x230e('0x22')],'include':_0x4693d1[_0x230e('0x20')]?_[_0x230e('0x21')](_0x4693d1[_0x230e('0x20')],function(_0x191218){return{'model':db[_0x191218[_0x230e('0x23')]],'as':_0x191218['as'],'attributes':_0x191218[_0x230e('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4849ba){logger[_0x230e('0x12')]('ShowSmsQueue',_0x541fd6);logger[_0x230e('0x15')](_0x230e('0x26'),_0x541fd6,JSON[_0x230e('0x25')](_0x4849ba));_0x36cdff(_0x4849ba);})[_0x230e('0x1a')](function(_0x3ceca3){logger['error'](_0x230e('0x26'),_0x3ceca3['message'],_0x541fd6);_0x3f2ec8(_0x1f4601['error'](0x1f4,_0x3ceca3[_0x230e('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 20cc9a6..04f0d26 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 _0xe776=['emit','removeListener','smsQueue:','./smsQueue.events'];(function(_0x43b584,_0x20a6bd){var _0x48f27b=function(_0x1eeb77){while(--_0x1eeb77){_0x43b584['push'](_0x43b584['shift']());}};_0x48f27b(++_0x20a6bd);}(_0xe776,0x7b));var _0x6e77=function(_0x13b365,_0x293d9d){_0x13b365=_0x13b365-0x0;var _0x507229=_0xe776[_0x13b365];return _0x507229;};'use strict';var SmsQueueEvents=require(_0x6e77('0x0'));var events=['save','remove','update'];function createListener(_0x2062f8,_0x174487){return function(_0x5cec3d){_0x174487[_0x6e77('0x1')](_0x2062f8,_0x5cec3d);};}function removeListener(_0x27513b,_0x34e5be){return function(){SmsQueueEvents[_0x6e77('0x2')](_0x27513b,_0x34e5be);};}exports['register']=function(_0x393b3f){for(var _0x5a3c33=0x0,_0x43ec5f=events['length'];_0x5a3c33<_0x43ec5f;_0x5a3c33++){var _0x34a6fd=events[_0x5a3c33];var _0x534ba7=createListener(_0x6e77('0x3')+_0x34a6fd,_0x393b3f);SmsQueueEvents['on'](_0x34a6fd,_0x534ba7);}}; \ No newline at end of file +var _0xd9c1=['save','remove','update','removeListener','register','length','./smsQueue.events'];(function(_0x4a599b,_0x1d2125){var _0x2d53d3=function(_0x5e7982){while(--_0x5e7982){_0x4a599b['push'](_0x4a599b['shift']());}};_0x2d53d3(++_0x1d2125);}(_0xd9c1,0x179));var _0x1d9c=function(_0x3341ce,_0x7c2fd0){_0x3341ce=_0x3341ce-0x0;var _0x538fe4=_0xd9c1[_0x3341ce];return _0x538fe4;};'use strict';var SmsQueueEvents=require(_0x1d9c('0x0'));var events=[_0x1d9c('0x1'),_0x1d9c('0x2'),_0x1d9c('0x3')];function createListener(_0x29441b,_0x3d57a9){return function(_0x43ac60){_0x3d57a9['emit'](_0x29441b,_0x43ac60);};}function removeListener(_0xacec54,_0x3cba47){return function(){SmsQueueEvents[_0x1d9c('0x4')](_0xacec54,_0x3cba47);};}exports[_0x1d9c('0x5')]=function(_0x7b69dc){for(var _0x5f403a=0x0,_0x3e8a6b=events[_0x1d9c('0x6')];_0x5f403a<_0x3e8a6b;_0x5f403a++){var _0x4152c2=events[_0x5f403a];var _0x5aa39b=createListener('smsQueue:'+_0x4152c2,_0x7b69dc);SmsQueueEvents['on'](_0x4152c2,_0x5aa39b);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index a4ca462..50c4258 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 _0xc8ca=['index','isAuthenticated','/:id','post','create','put','update','delete','destroy','exports','multer','util','fs-extra','../../components/auth/service','../../config/environment','./smsQueueReport.controller','get'];(function(_0xf8ecbc,_0x44ddf0){var _0x43cd87=function(_0x52b65f){while(--_0x52b65f){_0xf8ecbc['push'](_0xf8ecbc['shift']());}};_0x43cd87(++_0x44ddf0);}(_0xc8ca,0x1b3));var _0xac8c=function(_0x2c500c,_0x49e32b){_0x2c500c=_0x2c500c-0x0;var _0x24a508=_0xc8ca[_0x2c500c];return _0x24a508;};'use strict';var multer=require(_0xac8c('0x0'));var util=require(_0xac8c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xac8c('0x2'));var auth=require(_0xac8c('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xac8c('0x4'));var controller=require(_0xac8c('0x5'));router[_0xac8c('0x6')]('/',auth['isAuthenticated'](),controller[_0xac8c('0x7')]);router[_0xac8c('0x6')]('/describe',auth[_0xac8c('0x8')](),controller['describe']);router[_0xac8c('0x6')](_0xac8c('0x9'),auth[_0xac8c('0x8')](),controller['show']);router[_0xac8c('0xa')]('/',auth[_0xac8c('0x8')](),controller[_0xac8c('0xb')]);router[_0xac8c('0xc')](_0xac8c('0x9'),auth[_0xac8c('0x8')](),controller[_0xac8c('0xd')]);router[_0xac8c('0xe')]('/:id',auth[_0xac8c('0x8')](),controller[_0xac8c('0xf')]);module[_0xac8c('0x10')]=router; \ No newline at end of file +var _0x993f=['put','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create'];(function(_0x1113d9,_0x52cd99){var _0x4a5aa2=function(_0x1f0b6e){while(--_0x1f0b6e){_0x1113d9['push'](_0x1113d9['shift']());}};_0x4a5aa2(++_0x52cd99);}(_0x993f,0x129));var _0xf993=function(_0x38c340,_0x148ebe){_0x38c340=_0x38c340-0x0;var _0x1499cd=_0x993f[_0x38c340];return _0x1499cd;};'use strict';var multer=require(_0xf993('0x0'));var util=require(_0xf993('0x1'));var path=require(_0xf993('0x2'));var timeout=require(_0xf993('0x3'));var express=require('express');var router=express[_0xf993('0x4')]();var fs_extra=require(_0xf993('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf993('0x6'));var config=require(_0xf993('0x7'));var controller=require(_0xf993('0x8'));router[_0xf993('0x9')]('/',auth[_0xf993('0xa')](),controller[_0xf993('0xb')]);router[_0xf993('0x9')](_0xf993('0xc'),auth[_0xf993('0xa')](),controller[_0xf993('0xd')]);router[_0xf993('0x9')](_0xf993('0xe'),auth['isAuthenticated'](),controller[_0xf993('0xf')]);router[_0xf993('0x10')]('/',auth['isAuthenticated'](),controller[_0xf993('0x11')]);router[_0xf993('0x12')](_0xf993('0xe'),auth[_0xf993('0xa')](),controller['update']);router[_0xf993('0x13')]('/:id',auth[_0xf993('0xa')](),controller[_0xf993('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 7aec38f..03b47f7 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 _0xc8ca=['sequelize','DATE','STRING','moment'];(function(_0x3c9d62,_0x34edcd){var _0x5e9629=function(_0x498e51){while(--_0x498e51){_0x3c9d62['push'](_0x3c9d62['shift']());}};_0x5e9629(++_0x34edcd);}(_0xc8ca,0x1b3));var _0xac8c=function(_0x2d1489,_0x3ace0f){_0x2d1489=_0x2d1489-0x0;var _0x594de9=_0xc8ca[_0x2d1489];return _0x594de9;};'use strict';var moment=require(_0xac8c('0x0'));var Sequelize=require(_0xac8c('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xac8c('0x2')]},'acceptAt':{'type':Sequelize[_0xac8c('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xac8c('0x3')]}}; \ No newline at end of file +var _0x7d3c=['DATE','moment','exports','STRING'];(function(_0xcf2b7a,_0x43f6fa){var _0x59b26a=function(_0x5127a9){while(--_0x5127a9){_0xcf2b7a['push'](_0xcf2b7a['shift']());}};_0x59b26a(++_0x43f6fa);}(_0x7d3c,0xf1));var _0xc7d3=function(_0xe2cbd3,_0x678694){_0xe2cbd3=_0xe2cbd3-0x0;var _0x5155e3=_0x7d3c[_0xe2cbd3];return _0x5155e3;};'use strict';var moment=require(_0xc7d3('0x0'));var Sequelize=require('sequelize');module[_0xc7d3('0x1')]={'uniqueid':{'type':Sequelize[_0xc7d3('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xc7d3('0x2')]},'joinAt':{'type':Sequelize[_0xc7d3('0x3')]},'leaveAt':{'type':Sequelize[_0xc7d3('0x3')]},'acceptAt':{'type':Sequelize[_0xc7d3('0x3')]},'exitAt':{'type':Sequelize[_0xc7d3('0x3')]},'reason':{'type':Sequelize[_0xc7d3('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 3b067b5..de290f2 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 _0x1999=['../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','error','stack','name','index','map','SmsQueueReport','rawAttributes','fieldName','type','key','keys','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','rows','show','params','options','create','body','find','catch','destroy','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','papaparse','ioredis'];(function(_0x1d3e3f,_0x495ec1){var _0x3879fa=function(_0x12e542){while(--_0x12e542){_0x1d3e3f['push'](_0x1d3e3f['shift']());}};_0x3879fa(++_0x495ec1);}(_0x1999,0x1d4));var _0x9199=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0x1999[_0x411017];return _0x2adeea;};'use strict';var emlformat=require(_0x9199('0x0'));var rimraf=require(_0x9199('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9199('0x2'));var moment=require(_0x9199('0x3'));var BPromise=require(_0x9199('0x4'));var Mustache=require(_0x9199('0x5'));var util=require(_0x9199('0x6'));var path=require(_0x9199('0x7'));var sox=require('sox');var csv=require(_0x9199('0x8'));var ejs=require(_0x9199('0x9'));var fs=require('fs');var fs_extra=require(_0x9199('0xa'));var _=require(_0x9199('0xb'));var squel=require('squel');var crypto=require(_0x9199('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9199('0x8'));var querystring=require('querystring');var Papa=require(_0x9199('0xd'));var Redis=require(_0x9199('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x9199('0xf'));var as=require(_0x9199('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9199('0x11'));var utils=require('../../config/utils');var config=require(_0x9199('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2cdaf7,_0x701d56){_0x701d56=_0x701d56||0xcc;return function(_0x487b76){if(_0x487b76){return _0x2cdaf7[_0x9199('0x13')](_0x701d56);}return _0x2cdaf7['status'](_0x701d56)[_0x9199('0x14')]();};}function respondWithResult(_0x495a18,_0x5ce0a3){_0x5ce0a3=_0x5ce0a3||0xc8;return function(_0x27fe7f){if(_0x27fe7f){return _0x495a18[_0x9199('0x15')](_0x5ce0a3)[_0x9199('0x16')](_0x27fe7f);}};}function respondWithFilteredResult(_0x14758f,_0x481bfe){return function(_0x549e48){if(_0x549e48){var _0x15341e=typeof _0x481bfe[_0x9199('0x17')]===_0x9199('0x18')&&typeof _0x481bfe['limit']===_0x9199('0x18');var _0x331f75=_0x549e48[_0x9199('0x19')];var _0xeb86e6=_0x15341e?0x0:_0x481bfe[_0x9199('0x17')];var _0x446d4a=_0x15341e?_0x549e48[_0x9199('0x19')]:_0x481bfe[_0x9199('0x17')]+_0x481bfe[_0x9199('0x1a')];var _0x48d3bf;if(_0x446d4a>=_0x331f75){_0x446d4a=_0x331f75;_0x48d3bf=0xc8;}else{_0x48d3bf=0xce;}_0x14758f[_0x9199('0x15')](_0x48d3bf);return _0x14758f['set'](_0x9199('0x1b'),_0xeb86e6+'-'+_0x446d4a+'/'+_0x331f75)[_0x9199('0x16')](_0x549e48);}return null;};}function patchUpdates(_0x1b787b){return function(_0x4aac2a){try{jsonpatch[_0x9199('0x1c')](_0x4aac2a,_0x1b787b,!![]);}catch(_0x55979d){return BPromise[_0x9199('0x1d')](_0x55979d);}return _0x4aac2a['save']();};}function saveUpdates(_0x58c3d8,_0xd73f1b){return function(_0x7bd934){if(_0x7bd934){return _0x7bd934[_0x9199('0x1e')](_0x58c3d8)['then'](function(_0x38c788){return _0x38c788;});}return null;};}function removeEntity(_0x155ff2,_0xaaba4d){return function(_0x1caf54){if(_0x1caf54){return _0x1caf54['destroy']()[_0x9199('0x1f')](function(){_0x155ff2[_0x9199('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x227da1,_0xd024a2){return function(_0x4adab6){if(!_0x4adab6){_0x227da1[_0x9199('0x13')](0x194);}return _0x4adab6;};}function handleError(_0x4037f5,_0x1d6684){_0x1d6684=_0x1d6684||0x1f4;return function(_0x537c49){logger[_0x9199('0x20')](_0x537c49[_0x9199('0x21')]);if(_0x537c49[_0x9199('0x22')]){delete _0x537c49[_0x9199('0x22')];}_0x4037f5['status'](_0x1d6684)['send'](_0x537c49);};}exports[_0x9199('0x23')]=function(_0x5f0eb7,_0x29871e){var _0x1a9bc4={},_0x4d9264={},_0x106b58={'count':0x0,'rows':[]};var _0x4a190a=_[_0x9199('0x24')](db[_0x9199('0x25')][_0x9199('0x26')],function(_0x22232d){return{'name':_0x22232d[_0x9199('0x27')],'type':_0x22232d[_0x9199('0x28')][_0x9199('0x29')]};});_0x4d9264['model']=_[_0x9199('0x24')](_0x4a190a,_0x9199('0x22'));_0x4d9264['query']=_[_0x9199('0x2a')](_0x5f0eb7[_0x9199('0x2b')]);_0x4d9264['filters']=_[_0x9199('0x2c')](_0x4d9264['model'],_0x4d9264[_0x9199('0x2b')]);_0x1a9bc4[_0x9199('0x2d')]=_[_0x9199('0x2c')](_0x4d9264[_0x9199('0x2e')],qs[_0x9199('0x2f')](_0x5f0eb7[_0x9199('0x2b')]['fields']));_0x1a9bc4[_0x9199('0x2d')]=_0x1a9bc4[_0x9199('0x2d')][_0x9199('0x30')]?_0x1a9bc4[_0x9199('0x2d')]:_0x4d9264[_0x9199('0x2e')];if(!_0x5f0eb7[_0x9199('0x2b')][_0x9199('0x31')](_0x9199('0x32'))){_0x1a9bc4[_0x9199('0x1a')]=qs[_0x9199('0x1a')](_0x5f0eb7[_0x9199('0x2b')]['limit']);_0x1a9bc4[_0x9199('0x17')]=qs[_0x9199('0x17')](_0x5f0eb7[_0x9199('0x2b')]['offset']);}_0x1a9bc4['order']=qs['sort'](_0x5f0eb7[_0x9199('0x2b')][_0x9199('0x33')]);_0x1a9bc4[_0x9199('0x34')]=qs['filters'](_['pick'](_0x5f0eb7[_0x9199('0x2b')],_0x4d9264['filters']),_0x4a190a);if(_0x5f0eb7[_0x9199('0x2b')][_0x9199('0x35')]){_0x1a9bc4['where']=_['merge'](_0x1a9bc4[_0x9199('0x34')],{'$or':_[_0x9199('0x24')](_0x4a190a,function(_0x112f14){if(_0x112f14[_0x9199('0x28')]!==_0x9199('0x36')){var _0x4fce98={};_0x4fce98[_0x112f14[_0x9199('0x22')]]={'$like':'%'+_0x5f0eb7['query'][_0x9199('0x35')]+'%'};return _0x4fce98;}})});}_0x1a9bc4=_[_0x9199('0x37')]({},_0x1a9bc4,_0x5f0eb7['options']);var _0x4a55b4={'where':_0x1a9bc4[_0x9199('0x34')]};return db[_0x9199('0x25')][_0x9199('0x19')](_0x4a55b4)[_0x9199('0x1f')](function(_0x36dcab){_0x106b58[_0x9199('0x19')]=_0x36dcab;if(_0x5f0eb7[_0x9199('0x2b')][_0x9199('0x38')]){_0x1a9bc4[_0x9199('0x39')]=[{'all':!![]}];}return db[_0x9199('0x25')][_0x9199('0x3a')](_0x1a9bc4);})['then'](function(_0x55114a){_0x106b58[_0x9199('0x3b')]=_0x55114a;return _0x106b58;})['then'](respondWithFilteredResult(_0x29871e,_0x1a9bc4))['catch'](handleError(_0x29871e,null));};exports[_0x9199('0x3c')]=function(_0x837463,_0x1d7c69){var _0x31c0fa={'raw':!![],'where':{'id':_0x837463[_0x9199('0x3d')]['id']}},_0x1715d9={};_0x1715d9[_0x9199('0x2e')]=_[_0x9199('0x2a')](db[_0x9199('0x25')]['rawAttributes']);_0x1715d9['query']=_[_0x9199('0x2a')](_0x837463[_0x9199('0x2b')]);_0x1715d9['filters']=_[_0x9199('0x2c')](_0x1715d9[_0x9199('0x2e')],_0x1715d9[_0x9199('0x2b')]);_0x31c0fa[_0x9199('0x2d')]=_[_0x9199('0x2c')](_0x1715d9['model'],qs[_0x9199('0x2f')](_0x837463['query']['fields']));_0x31c0fa[_0x9199('0x2d')]=_0x31c0fa[_0x9199('0x2d')][_0x9199('0x30')]?_0x31c0fa[_0x9199('0x2d')]:_0x1715d9[_0x9199('0x2e')];if(_0x837463[_0x9199('0x2b')][_0x9199('0x38')]){_0x31c0fa['include']=[{'all':!![]}];}_0x31c0fa=_[_0x9199('0x37')]({},_0x31c0fa,_0x837463[_0x9199('0x3e')]);return db[_0x9199('0x25')]['find'](_0x31c0fa)['then'](handleEntityNotFound(_0x1d7c69,null))[_0x9199('0x1f')](respondWithResult(_0x1d7c69,null))['catch'](handleError(_0x1d7c69,null));};exports[_0x9199('0x3f')]=function(_0x51daa2,_0x47b479){return db[_0x9199('0x25')][_0x9199('0x3f')](_0x51daa2[_0x9199('0x40')],{})['then'](respondWithResult(_0x47b479,0xc9))['catch'](handleError(_0x47b479,null));};exports[_0x9199('0x1e')]=function(_0x362656,_0x766fbb){if(_0x362656[_0x9199('0x40')]['id']){delete _0x362656['body']['id'];}return db[_0x9199('0x25')][_0x9199('0x41')]({'where':{'id':_0x362656[_0x9199('0x3d')]['id']}})[_0x9199('0x1f')](handleEntityNotFound(_0x766fbb,null))[_0x9199('0x1f')](saveUpdates(_0x362656[_0x9199('0x40')],null))[_0x9199('0x1f')](respondWithResult(_0x766fbb,null))[_0x9199('0x42')](handleError(_0x766fbb,null));};exports[_0x9199('0x43')]=function(_0x319f4d,_0x371b0d){return db['SmsQueueReport'][_0x9199('0x41')]({'where':{'id':_0x319f4d[_0x9199('0x3d')]['id']}})[_0x9199('0x1f')](handleEntityNotFound(_0x371b0d,null))[_0x9199('0x1f')](removeEntity(_0x371b0d,null))[_0x9199('0x42')](handleError(_0x371b0d,null));};exports[_0x9199('0x44')]=function(_0x2ac4e2,_0x185ad7){return db['SmsQueueReport'][_0x9199('0x44')]()['then'](respondWithResult(_0x185ad7,null))[_0x9199('0x42')](handleError(_0x185ad7,null));}; \ No newline at end of file +var _0xa617=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','SmsQueueReport','includeAll','include','catch','show','params','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','type','key','model'];(function(_0x5d3550,_0x107033){var _0x5d1299=function(_0x5edaa1){while(--_0x5edaa1){_0x5d3550['push'](_0x5d3550['shift']());}};_0x5d1299(++_0x107033);}(_0xa617,0x103));var _0x7a61=function(_0x5264a2,_0x2459e0){_0x5264a2=_0x5264a2-0x0;var _0x5b2a55=_0xa617[_0x5264a2];return _0x5b2a55;};'use strict';var emlformat=require(_0x7a61('0x0'));var rimraf=require(_0x7a61('0x1'));var zipdir=require(_0x7a61('0x2'));var jsonpatch=require(_0x7a61('0x3'));var rp=require(_0x7a61('0x4'));var moment=require('moment');var BPromise=require(_0x7a61('0x5'));var Mustache=require(_0x7a61('0x6'));var util=require(_0x7a61('0x7'));var path=require(_0x7a61('0x8'));var sox=require(_0x7a61('0x9'));var csv=require(_0x7a61('0xa'));var ejs=require(_0x7a61('0xb'));var fs=require('fs');var fs_extra=require(_0x7a61('0xc'));var _=require(_0x7a61('0xd'));var squel=require('squel');var crypto=require(_0x7a61('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x7a61('0xf'));var toCsv=require(_0x7a61('0xa'));var querystring=require(_0x7a61('0x10'));var Papa=require(_0x7a61('0x11'));var Redis=require(_0x7a61('0x12'));var authService=require(_0x7a61('0x13'));var qs=require(_0x7a61('0x14'));var as=require(_0x7a61('0x15'));var hardwareService=require(_0x7a61('0x16'));var logger=require(_0x7a61('0x17'))(_0x7a61('0x18'));var utils=require('../../config/utils');var config=require(_0x7a61('0x19'));var licenseUtil=require(_0x7a61('0x1a'));var db=require(_0x7a61('0x1b'))['db'];function respondWithStatusCode(_0x2c12ea,_0x25277b){_0x25277b=_0x25277b||0xcc;return function(_0x170325){if(_0x170325){return _0x2c12ea[_0x7a61('0x1c')](_0x25277b);}return _0x2c12ea[_0x7a61('0x1d')](_0x25277b)[_0x7a61('0x1e')]();};}function respondWithResult(_0x1ecbb9,_0x796a9b){_0x796a9b=_0x796a9b||0xc8;return function(_0x3ac003){if(_0x3ac003){return _0x1ecbb9[_0x7a61('0x1d')](_0x796a9b)['json'](_0x3ac003);}};}function respondWithFilteredResult(_0x497727,_0xaa6f64){return function(_0x307868){if(_0x307868){var _0x5cac9e=typeof _0xaa6f64['offset']===_0x7a61('0x1f')&&typeof _0xaa6f64[_0x7a61('0x20')]===_0x7a61('0x1f');var _0x566d9b=_0x307868[_0x7a61('0x21')];var _0x492ea8=_0x5cac9e?0x0:_0xaa6f64[_0x7a61('0x22')];var _0x294643=_0x5cac9e?_0x307868['count']:_0xaa6f64[_0x7a61('0x22')]+_0xaa6f64[_0x7a61('0x20')];var _0x3c5132;if(_0x294643>=_0x566d9b){_0x294643=_0x566d9b;_0x3c5132=0xc8;}else{_0x3c5132=0xce;}_0x497727[_0x7a61('0x1d')](_0x3c5132);return _0x497727[_0x7a61('0x23')](_0x7a61('0x24'),_0x492ea8+'-'+_0x294643+'/'+_0x566d9b)[_0x7a61('0x25')](_0x307868);}return null;};}function patchUpdates(_0x1045ba){return function(_0x3cd0ff){try{jsonpatch[_0x7a61('0x26')](_0x3cd0ff,_0x1045ba,!![]);}catch(_0x1ac621){return BPromise[_0x7a61('0x27')](_0x1ac621);}return _0x3cd0ff[_0x7a61('0x28')]();};}function saveUpdates(_0x5f4369,_0x3ea5a8){return function(_0x8a9907){if(_0x8a9907){return _0x8a9907[_0x7a61('0x29')](_0x5f4369)[_0x7a61('0x2a')](function(_0x4643cd){return _0x4643cd;});}return null;};}function removeEntity(_0x11cb18,_0x33a88b){return function(_0x4bf26e){if(_0x4bf26e){return _0x4bf26e[_0x7a61('0x2b')]()['then'](function(){_0x11cb18[_0x7a61('0x1d')](0xcc)[_0x7a61('0x1e')]();});}};}function handleEntityNotFound(_0x55a955,_0x1815f3){return function(_0x588b86){if(!_0x588b86){_0x55a955[_0x7a61('0x1c')](0x194);}return _0x588b86;};}function handleError(_0x237867,_0x24d6fa){_0x24d6fa=_0x24d6fa||0x1f4;return function(_0x45e123){logger[_0x7a61('0x2c')](_0x45e123[_0x7a61('0x2d')]);if(_0x45e123[_0x7a61('0x2e')]){delete _0x45e123[_0x7a61('0x2e')];}_0x237867[_0x7a61('0x1d')](_0x24d6fa)['send'](_0x45e123);};}exports[_0x7a61('0x2f')]=function(_0x17d39c,_0x1d5cd6){var _0x451fa0={},_0x4ba3a5={},_0x545024={'count':0x0,'rows':[]};var _0x2aa5b1=_[_0x7a61('0x30')](db['SmsQueueReport'][_0x7a61('0x31')],function(_0x499b96){return{'name':_0x499b96['fieldName'],'type':_0x499b96[_0x7a61('0x32')][_0x7a61('0x33')]};});_0x4ba3a5[_0x7a61('0x34')]=_[_0x7a61('0x30')](_0x2aa5b1,_0x7a61('0x2e'));_0x4ba3a5[_0x7a61('0x35')]=_[_0x7a61('0x36')](_0x17d39c[_0x7a61('0x35')]);_0x4ba3a5[_0x7a61('0x37')]=_[_0x7a61('0x38')](_0x4ba3a5[_0x7a61('0x34')],_0x4ba3a5[_0x7a61('0x35')]);_0x451fa0[_0x7a61('0x39')]=_[_0x7a61('0x38')](_0x4ba3a5[_0x7a61('0x34')],qs['fields'](_0x17d39c[_0x7a61('0x35')][_0x7a61('0x3a')]));_0x451fa0[_0x7a61('0x39')]=_0x451fa0['attributes'][_0x7a61('0x3b')]?_0x451fa0[_0x7a61('0x39')]:_0x4ba3a5[_0x7a61('0x34')];if(!_0x17d39c[_0x7a61('0x35')][_0x7a61('0x3c')](_0x7a61('0x3d'))){_0x451fa0[_0x7a61('0x20')]=qs[_0x7a61('0x20')](_0x17d39c[_0x7a61('0x35')][_0x7a61('0x20')]);_0x451fa0[_0x7a61('0x22')]=qs['offset'](_0x17d39c[_0x7a61('0x35')][_0x7a61('0x22')]);}_0x451fa0[_0x7a61('0x3e')]=qs['sort'](_0x17d39c[_0x7a61('0x35')][_0x7a61('0x3f')]);_0x451fa0['where']=qs[_0x7a61('0x37')](_[_0x7a61('0x40')](_0x17d39c[_0x7a61('0x35')],_0x4ba3a5[_0x7a61('0x37')]),_0x2aa5b1);if(_0x17d39c[_0x7a61('0x35')]['filter']){_0x451fa0['where']=_['merge'](_0x451fa0['where'],{'$or':_[_0x7a61('0x30')](_0x2aa5b1,function(_0x470627){if(_0x470627['type']!=='VIRTUAL'){var _0x1509b5={};_0x1509b5[_0x470627[_0x7a61('0x2e')]]={'$like':'%'+_0x17d39c[_0x7a61('0x35')]['filter']+'%'};return _0x1509b5;}})});}_0x451fa0=_[_0x7a61('0x41')]({},_0x451fa0,_0x17d39c['options']);var _0x4e598e={'where':_0x451fa0[_0x7a61('0x42')]};return db[_0x7a61('0x43')]['count'](_0x4e598e)['then'](function(_0x170260){_0x545024[_0x7a61('0x21')]=_0x170260;if(_0x17d39c['query'][_0x7a61('0x44')]){_0x451fa0[_0x7a61('0x45')]=[{'all':!![]}];}return db[_0x7a61('0x43')]['findAll'](_0x451fa0);})[_0x7a61('0x2a')](function(_0x409872){_0x545024['rows']=_0x409872;return _0x545024;})[_0x7a61('0x2a')](respondWithFilteredResult(_0x1d5cd6,_0x451fa0))[_0x7a61('0x46')](handleError(_0x1d5cd6,null));};exports[_0x7a61('0x47')]=function(_0x2ef86e,_0x57efae){var _0x167764={'raw':!![],'where':{'id':_0x2ef86e[_0x7a61('0x48')]['id']}},_0x59a9e4={};_0x59a9e4[_0x7a61('0x34')]=_[_0x7a61('0x36')](db[_0x7a61('0x43')][_0x7a61('0x31')]);_0x59a9e4[_0x7a61('0x35')]=_[_0x7a61('0x36')](_0x2ef86e[_0x7a61('0x35')]);_0x59a9e4['filters']=_[_0x7a61('0x38')](_0x59a9e4[_0x7a61('0x34')],_0x59a9e4[_0x7a61('0x35')]);_0x167764['attributes']=_[_0x7a61('0x38')](_0x59a9e4[_0x7a61('0x34')],qs[_0x7a61('0x3a')](_0x2ef86e[_0x7a61('0x35')][_0x7a61('0x3a')]));_0x167764[_0x7a61('0x39')]=_0x167764[_0x7a61('0x39')][_0x7a61('0x3b')]?_0x167764[_0x7a61('0x39')]:_0x59a9e4[_0x7a61('0x34')];if(_0x2ef86e[_0x7a61('0x35')][_0x7a61('0x44')]){_0x167764[_0x7a61('0x45')]=[{'all':!![]}];}_0x167764=_[_0x7a61('0x41')]({},_0x167764,_0x2ef86e[_0x7a61('0x49')]);return db[_0x7a61('0x43')][_0x7a61('0x4a')](_0x167764)[_0x7a61('0x2a')](handleEntityNotFound(_0x57efae,null))['then'](respondWithResult(_0x57efae,null))['catch'](handleError(_0x57efae,null));};exports[_0x7a61('0x4b')]=function(_0x581cc7,_0x24d099){return db[_0x7a61('0x43')][_0x7a61('0x4b')](_0x581cc7[_0x7a61('0x4c')],{})[_0x7a61('0x2a')](respondWithResult(_0x24d099,0xc9))[_0x7a61('0x46')](handleError(_0x24d099,null));};exports[_0x7a61('0x29')]=function(_0x3309af,_0x3867c8){if(_0x3309af[_0x7a61('0x4c')]['id']){delete _0x3309af[_0x7a61('0x4c')]['id'];}return db[_0x7a61('0x43')]['find']({'where':{'id':_0x3309af[_0x7a61('0x48')]['id']}})[_0x7a61('0x2a')](handleEntityNotFound(_0x3867c8,null))[_0x7a61('0x2a')](saveUpdates(_0x3309af[_0x7a61('0x4c')],null))[_0x7a61('0x2a')](respondWithResult(_0x3867c8,null))[_0x7a61('0x46')](handleError(_0x3867c8,null));};exports[_0x7a61('0x2b')]=function(_0x3e5175,_0x3640a8){return db[_0x7a61('0x43')][_0x7a61('0x4a')]({'where':{'id':_0x3e5175['params']['id']}})[_0x7a61('0x2a')](handleEntityNotFound(_0x3640a8,null))[_0x7a61('0x2a')](removeEntity(_0x3640a8,null))[_0x7a61('0x46')](handleError(_0x3640a8,null));};exports['describe']=function(_0x30b143,_0x3c2f11){return db[_0x7a61('0x43')][_0x7a61('0x4d')]()[_0x7a61('0x2a')](respondWithResult(_0x3c2f11,null))['catch'](handleError(_0x3c2f11,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index f61fd59..3bcf915 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 _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','define','SmsQueueReport','uniqueid','lodash'];(function(_0x3ac3cb,_0x268afb){var _0x19d365=function(_0x4b4b3a){while(--_0x4b4b3a){_0x3ac3cb['push'](_0x3ac3cb['shift']());}};_0x19d365(++_0x268afb);}(_0xb7e7,0x121));var _0x7b7e=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xb7e7[_0xbd08b4];return _0x314f1e;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcb91=['path','rimraf','./smsQueueReport.attributes','exports','define','report_sms_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x157f14,_0x5ad9b2){var _0x3f1f56=function(_0x26851){while(--_0x26851){_0x157f14['push'](_0x157f14['shift']());}};_0x3f1f56(++_0x5ad9b2);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2b5513,_0x3fe5cd){_0x2b5513=_0x2b5513-0x0;var _0x578fd2=_0xcb91[_0x2b5513];return _0x578fd2;};'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')]('SmsQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index c7149df..3c7b2e3 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 _0xdf17=['../../mysqldb','rpc','../../config/environment','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateSmsQueueReport','body','options','UpdateSmsQueueReport','SmsQueueReport','raw','where','attributes','limit','stringify','lodash','moment','bluebird','ioredis'];(function(_0xa0a9fb,_0x583272){var _0x460f56=function(_0x57164f){while(--_0x57164f){_0xa0a9fb['push'](_0xa0a9fb['shift']());}};_0x460f56(++_0x583272);}(_0xdf17,0xd5));var _0x7df1=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xdf17[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0x7df1('0x0'));var util=require('util');var moment=require(_0x7df1('0x1'));var BPromise=require(_0x7df1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7df1('0x3'));var db=require(_0x7df1('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7df1('0x5'));var config=require(_0x7df1('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x7df1('0x7')][_0x7df1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1461cc,_0x158188,_0x299aec){return new BPromise(function(_0x3155da,_0xf323ba){return client[_0x7df1('0x9')](_0x1461cc,_0x299aec)[_0x7df1('0xa')](function(_0x51f70d){logger[_0x7df1('0xb')](_0x7df1('0xc'),_0x158188,_0x7df1('0xd'));logger[_0x7df1('0xe')](_0x7df1('0xf'),_0x158188,_0x7df1('0xd'),JSON['stringify'](_0x51f70d));if(_0x51f70d[_0x7df1('0x10')]){if(_0x51f70d[_0x7df1('0x10')][_0x7df1('0x11')]===0x1f4){logger[_0x7df1('0x10')](_0x7df1('0xc'),_0x158188,_0x51f70d['error'][_0x7df1('0x12')]);return _0xf323ba(_0x51f70d[_0x7df1('0x10')][_0x7df1('0x12')]);}logger[_0x7df1('0x10')](_0x7df1('0xc'),_0x158188,_0x51f70d[_0x7df1('0x10')][_0x7df1('0x12')]);return _0x3155da(_0x51f70d[_0x7df1('0x10')][_0x7df1('0x12')]);}else{logger[_0x7df1('0xb')](_0x7df1('0xc'),_0x158188,_0x7df1('0xd'));_0x3155da(_0x51f70d[_0x7df1('0x13')][_0x7df1('0x12')]);}})[_0x7df1('0x14')](function(_0x75efe1){logger[_0x7df1('0x10')](_0x7df1('0xc'),_0x158188,_0x75efe1);_0xf323ba(_0x75efe1);});});}exports[_0x7df1('0x15')]=function(_0x400cab){var _0x542c44=this;return new Promise(function(_0x3e99e7,_0x5c44ea){return db['SmsQueueReport']['create'](_0x400cab[_0x7df1('0x16')],{'raw':_0x400cab[_0x7df1('0x17')]?_0x400cab[_0x7df1('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x7df1('0xa')](function(_0x2432e5){logger[_0x7df1('0xb')](_0x7df1('0x15'),_0x400cab);logger[_0x7df1('0xe')](_0x7df1('0x15'),_0x400cab,JSON['stringify'](_0x2432e5));_0x3e99e7(_0x2432e5);})[_0x7df1('0x14')](function(_0x2bf072){logger[_0x7df1('0x10')](_0x7df1('0x15'),_0x2bf072[_0x7df1('0x12')],_0x400cab);_0x5c44ea(_0x542c44[_0x7df1('0x10')](0x1f4,_0x2bf072['message']));});});};exports[_0x7df1('0x18')]=function(_0x46cc4c){var _0x116600=this;return new Promise(function(_0x34dec1,_0xb979f0){return db[_0x7df1('0x19')]['update'](_0x46cc4c[_0x7df1('0x16')],{'raw':_0x46cc4c[_0x7df1('0x17')]?_0x46cc4c[_0x7df1('0x17')][_0x7df1('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46cc4c[_0x7df1('0x17')]?_0x46cc4c[_0x7df1('0x17')][_0x7df1('0x1b')]||null:null,'attributes':_0x46cc4c['options']?_0x46cc4c[_0x7df1('0x17')][_0x7df1('0x1c')]||null:null,'limit':_0x46cc4c[_0x7df1('0x17')]?_0x46cc4c[_0x7df1('0x17')][_0x7df1('0x1d')]||null:null})[_0x7df1('0xa')](function(_0x1ea72c){logger[_0x7df1('0xb')](_0x7df1('0x18'),_0x46cc4c);logger[_0x7df1('0xe')]('UpdateSmsQueueReport',_0x46cc4c,JSON[_0x7df1('0x1e')](_0x1ea72c));_0x34dec1(_0x1ea72c);})['catch'](function(_0x106c63){logger[_0x7df1('0x10')](_0x7df1('0x18'),_0x106c63[_0x7df1('0x12')],_0x46cc4c);_0xb979f0(_0x116600[_0x7df1('0x10')](0x1f4,_0x106c63[_0x7df1('0x12')]));});});}; \ No newline at end of file +var _0x890b=['../../config/utils','../../config/logger','../../config/environment','client','request','then','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsQueueReport,\x20%s,\x20%s','message','info','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','UpdateSmsQueueReport','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4ca333,_0x1218a3){var _0x13b2e1=function(_0x1eaf45){while(--_0x1eaf45){_0x4ca333['push'](_0x4ca333['shift']());}};_0x13b2e1(++_0x1218a3);}(_0x890b,0x12f));var _0xb890=function(_0x5a649f,_0x373c92){_0x5a649f=_0x5a649f-0x0;var _0x1720fa=_0x890b[_0x5a649f];return _0x1720fa;};'use strict';var _=require(_0xb890('0x0'));var util=require(_0xb890('0x1'));var moment=require(_0xb890('0x2'));var BPromise=require(_0xb890('0x3'));var rs=require(_0xb890('0x4'));var fs=require('fs');var Redis=require(_0xb890('0x5'));var db=require(_0xb890('0x6'))['db'];var utils=require(_0xb890('0x7'));var logger=require(_0xb890('0x8'))('rpc');var config=require(_0xb890('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb890('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc303b,_0xd3bc47,_0x3d491d){return new BPromise(function(_0x2c4c94,_0x138a99){return client[_0xb890('0xb')](_0xc303b,_0x3d491d)[_0xb890('0xc')](function(_0x6ccc01){logger['info']('SmsQueueReport,\x20%s,\x20%s',_0xd3bc47,_0xb890('0xd'));logger[_0xb890('0xe')](_0xb890('0xf'),_0xd3bc47,'request\x20sent',JSON[_0xb890('0x10')](_0x6ccc01));if(_0x6ccc01[_0xb890('0x11')]){if(_0x6ccc01[_0xb890('0x11')][_0xb890('0x12')]===0x1f4){logger[_0xb890('0x11')](_0xb890('0x13'),_0xd3bc47,_0x6ccc01[_0xb890('0x11')][_0xb890('0x14')]);return _0x138a99(_0x6ccc01[_0xb890('0x11')][_0xb890('0x14')]);}logger['error'](_0xb890('0x13'),_0xd3bc47,_0x6ccc01['error'][_0xb890('0x14')]);return _0x2c4c94(_0x6ccc01['error'][_0xb890('0x14')]);}else{logger[_0xb890('0x15')](_0xb890('0x13'),_0xd3bc47,_0xb890('0xd'));_0x2c4c94(_0x6ccc01['result']['message']);}})[_0xb890('0x16')](function(_0x10cc0c){logger[_0xb890('0x11')](_0xb890('0x13'),_0xd3bc47,_0x10cc0c);_0x138a99(_0x10cc0c);});});}exports[_0xb890('0x17')]=function(_0x3f353d){var _0x130369=this;return new Promise(function(_0x4d3d53,_0x2c345a){return db[_0xb890('0x18')][_0xb890('0x19')](_0x3f353d[_0xb890('0x1a')],{'raw':_0x3f353d[_0xb890('0x1b')]?_0x3f353d[_0xb890('0x1b')][_0xb890('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x348fe5){logger[_0xb890('0x15')](_0xb890('0x17'),_0x3f353d);logger[_0xb890('0xe')]('CreateSmsQueueReport',_0x3f353d,JSON[_0xb890('0x10')](_0x348fe5));_0x4d3d53(_0x348fe5);})[_0xb890('0x16')](function(_0x531369){logger[_0xb890('0x11')](_0xb890('0x17'),_0x531369[_0xb890('0x14')],_0x3f353d);_0x2c345a(_0x130369['error'](0x1f4,_0x531369[_0xb890('0x14')]));});});};exports[_0xb890('0x1d')]=function(_0xd75a82){var _0x33c77d=this;return new Promise(function(_0x4b6e4a,_0x4dbfd8){return db[_0xb890('0x18')]['update'](_0xd75a82[_0xb890('0x1a')],{'raw':_0xd75a82[_0xb890('0x1b')]?_0xd75a82[_0xb890('0x1b')][_0xb890('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd75a82['options']?_0xd75a82['options'][_0xb890('0x1e')]||null:null,'attributes':_0xd75a82['options']?_0xd75a82[_0xb890('0x1b')]['attributes']||null:null,'limit':_0xd75a82[_0xb890('0x1b')]?_0xd75a82[_0xb890('0x1b')]['limit']||null:null})['then'](function(_0x590172){logger[_0xb890('0x15')]('UpdateSmsQueueReport',_0xd75a82);logger[_0xb890('0xe')]('UpdateSmsQueueReport',_0xd75a82,JSON[_0xb890('0x10')](_0x590172));_0x4b6e4a(_0x590172);})[_0xb890('0x16')](function(_0x32ef5d){logger[_0xb890('0x11')]('UpdateSmsQueueReport',_0x32ef5d[_0xb890('0x14')],_0xd75a82);_0x4dbfd8(_0x33c77d[_0xb890('0x11')](0x1f4,_0x32ef5d[_0xb890('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 940b7cf..88dafde 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 _0xf120=['Router','fs-extra','../../components/auth/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','show','post','put','/:id','update','delete','exports','util','path','connect-timeout'];(function(_0x30188f,_0x2bc726){var _0x14afa4=function(_0x234600){while(--_0x234600){_0x30188f['push'](_0x30188f['shift']());}};_0x14afa4(++_0x2bc726);}(_0xf120,0x179));var _0x0f12=function(_0x335a07,_0x27e488){_0x335a07=_0x335a07-0x0;var _0x57dcf7=_0xf120[_0x335a07];return _0x57dcf7;};'use strict';var multer=require('multer');var util=require(_0x0f12('0x0'));var path=require(_0x0f12('0x1'));var timeout=require(_0x0f12('0x2'));var express=require('express');var router=express[_0x0f12('0x3')]();var fs_extra=require(_0x0f12('0x4'));var auth=require(_0x0f12('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0f12('0x6'));var controller=require(_0x0f12('0x7'));router[_0x0f12('0x8')]('/',auth[_0x0f12('0x9')](),controller[_0x0f12('0xa')]);router[_0x0f12('0x8')](_0x0f12('0xb'),auth[_0x0f12('0x9')](),controller['describe']);router[_0x0f12('0x8')]('/:id',auth[_0x0f12('0x9')](),controller[_0x0f12('0xc')]);router[_0x0f12('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0f12('0xe')](_0x0f12('0xf'),auth[_0x0f12('0x9')](),controller[_0x0f12('0x10')]);router[_0x0f12('0x11')](_0x0f12('0xf'),auth[_0x0f12('0x9')](),controller['destroy']);module[_0x0f12('0x12')]=router; \ No newline at end of file +var _0x3eea=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0xf8f2fe,_0x372faa){var _0x2f2688=function(_0x414182){while(--_0x414182){_0xf8f2fe['push'](_0xf8f2fe['shift']());}};_0x2f2688(++_0x372faa);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x37b2e6,_0x18aa8e){_0x37b2e6=_0x37b2e6-0x0;var _0x437319=_0x3eea[_0x37b2e6];return _0x437319;};'use strict';var multer=require(_0xa3ee('0x0'));var util=require('util');var path=require(_0xa3ee('0x1'));var timeout=require(_0xa3ee('0x2'));var express=require(_0xa3ee('0x3'));var router=express[_0xa3ee('0x4')]();var fs_extra=require(_0xa3ee('0x5'));var auth=require(_0xa3ee('0x6'));var interaction=require(_0xa3ee('0x7'));var config=require(_0xa3ee('0x8'));var controller=require(_0xa3ee('0x9'));router[_0xa3ee('0xa')]('/',auth[_0xa3ee('0xb')](),controller['index']);router['get'](_0xa3ee('0xc'),auth['isAuthenticated'](),controller[_0xa3ee('0xd')]);router['get'](_0xa3ee('0xe'),auth['isAuthenticated'](),controller[_0xa3ee('0xf')]);router['post']('/',auth[_0xa3ee('0xb')](),controller[_0xa3ee('0x10')]);router[_0xa3ee('0x11')]('/:id',auth[_0xa3ee('0xb')](),controller[_0xa3ee('0x12')]);router['delete']('/:id',auth[_0xa3ee('0xb')](),controller[_0xa3ee('0x13')]);module[_0xa3ee('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 05f08c9..ef85a38 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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x33ced6,_0x5d94e8){var _0x51a10f=function(_0x40a6af){while(--_0x40a6af){_0x33ced6['push'](_0x33ced6['shift']());}};_0x51a10f(++_0x5d94e8);}(_0x70e0,0x17b));var _0x070e=function(_0x56781e,_0x3fd180){_0x56781e=_0x56781e-0x0;var _0x2cbab3=_0x70e0[_0x56781e];return _0x2cbab3;};'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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x1a37b2,_0x2a7322){var _0x2a6062=function(_0x283b0d){while(--_0x283b0d){_0x1a37b2['push'](_0x1a37b2['shift']());}};_0x2a6062(++_0x2a7322);}(_0xaa88,0x137));var _0x8aa8=function(_0x4bf96c,_0x4d24fd){_0x4bf96c=_0x4bf96c-0x0;var _0x281d09=_0xaa88[_0x4bf96c];return _0x281d09;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 8ad8fe0..555d390 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 _0x6a7c=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','offset','undefined','limit','count','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','length','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x1f9923,_0x1f2419){var _0x4ddcba=function(_0x592dd0){while(--_0x592dd0){_0x1f9923['push'](_0x1f9923['shift']());}};_0x4ddcba(++_0x1f2419);}(_0x6a7c,0x11c));var _0xc6a7=function(_0x27f473,_0x21bab7){_0x27f473=_0x27f473-0x0;var _0x3f09d7=_0x6a7c[_0x27f473];return _0x3f09d7;};'use strict';var emlformat=require(_0xc6a7('0x0'));var rimraf=require(_0xc6a7('0x1'));var zipdir=require(_0xc6a7('0x2'));var jsonpatch=require(_0xc6a7('0x3'));var rp=require(_0xc6a7('0x4'));var moment=require(_0xc6a7('0x5'));var BPromise=require(_0xc6a7('0x6'));var Mustache=require(_0xc6a7('0x7'));var util=require('util');var path=require(_0xc6a7('0x8'));var sox=require('sox');var csv=require(_0xc6a7('0x9'));var ejs=require(_0xc6a7('0xa'));var fs=require('fs');var fs_extra=require(_0xc6a7('0xb'));var _=require(_0xc6a7('0xc'));var squel=require(_0xc6a7('0xd'));var crypto=require('crypto');var jsforce=require(_0xc6a7('0xe'));var deskjs=require(_0xc6a7('0xf'));var toCsv=require(_0xc6a7('0x9'));var querystring=require(_0xc6a7('0x10'));var Papa=require(_0xc6a7('0x11'));var Redis=require(_0xc6a7('0x12'));var authService=require(_0xc6a7('0x13'));var qs=require(_0xc6a7('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc6a7('0x15'));var logger=require(_0xc6a7('0x16'))(_0xc6a7('0x17'));var utils=require(_0xc6a7('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc6a7('0x19'))['db'];function respondWithStatusCode(_0x4a47e7,_0x2c1df2){_0x2c1df2=_0x2c1df2||0xcc;return function(_0x4f13f3){if(_0x4f13f3){return _0x4a47e7[_0xc6a7('0x1a')](_0x2c1df2);}return _0x4a47e7[_0xc6a7('0x1b')](_0x2c1df2)['end']();};}function respondWithResult(_0x1a0280,_0x7746c6){_0x7746c6=_0x7746c6||0xc8;return function(_0x44adb5){if(_0x44adb5){return _0x1a0280[_0xc6a7('0x1b')](_0x7746c6)['json'](_0x44adb5);}};}function respondWithFilteredResult(_0x247f1f,_0xd46d52){return function(_0x57fe7c){if(_0x57fe7c){var _0x1ae647=typeof _0xd46d52[_0xc6a7('0x1c')]===_0xc6a7('0x1d')&&typeof _0xd46d52[_0xc6a7('0x1e')]===_0xc6a7('0x1d');var _0x3b5b8c=_0x57fe7c[_0xc6a7('0x1f')];var _0x14b2c7=_0x1ae647?0x0:_0xd46d52[_0xc6a7('0x1c')];var _0x6837a3=_0x1ae647?_0x57fe7c['count']:_0xd46d52['offset']+_0xd46d52[_0xc6a7('0x1e')];var _0x4b678f;if(_0x6837a3>=_0x3b5b8c){_0x6837a3=_0x3b5b8c;_0x4b678f=0xc8;}else{_0x4b678f=0xce;}_0x247f1f[_0xc6a7('0x1b')](_0x4b678f);return _0x247f1f['set']('Content-Range',_0x14b2c7+'-'+_0x6837a3+'/'+_0x3b5b8c)[_0xc6a7('0x20')](_0x57fe7c);}return null;};}function patchUpdates(_0x3b59f1){return function(_0x3b51ec){try{jsonpatch[_0xc6a7('0x21')](_0x3b51ec,_0x3b59f1,!![]);}catch(_0x4fd745){return BPromise[_0xc6a7('0x22')](_0x4fd745);}return _0x3b51ec[_0xc6a7('0x23')]();};}function saveUpdates(_0x1a78d4,_0x4d300f){return function(_0x40b02b){if(_0x40b02b){return _0x40b02b[_0xc6a7('0x24')](_0x1a78d4)[_0xc6a7('0x25')](function(_0x58482d){return _0x58482d;});}return null;};}function removeEntity(_0x2de289,_0x21e6aa){return function(_0x2bd7b4){if(_0x2bd7b4){return _0x2bd7b4[_0xc6a7('0x26')]()[_0xc6a7('0x25')](function(){_0x2de289[_0xc6a7('0x1b')](0xcc)[_0xc6a7('0x27')]();});}};}function handleEntityNotFound(_0x130d23,_0x25aa18){return function(_0x31a392){if(!_0x31a392){_0x130d23[_0xc6a7('0x1a')](0x194);}return _0x31a392;};}function handleError(_0x4844b9,_0x2af7d8){_0x2af7d8=_0x2af7d8||0x1f4;return function(_0x1cd529){logger[_0xc6a7('0x28')](_0x1cd529[_0xc6a7('0x29')]);if(_0x1cd529[_0xc6a7('0x2a')]){delete _0x1cd529[_0xc6a7('0x2a')];}_0x4844b9['status'](_0x2af7d8)[_0xc6a7('0x2b')](_0x1cd529);};}exports[_0xc6a7('0x2c')]=function(_0x3020b0,_0x144b67){var _0x29d13e={},_0x1009e8={},_0x2ad631={'count':0x0,'rows':[]};var _0x3af9e0=_[_0xc6a7('0x2d')](db[_0xc6a7('0x2e')][_0xc6a7('0x2f')],function(_0x453997){return{'name':_0x453997[_0xc6a7('0x30')],'type':_0x453997[_0xc6a7('0x31')][_0xc6a7('0x32')]};});_0x1009e8[_0xc6a7('0x33')]=_[_0xc6a7('0x2d')](_0x3af9e0,_0xc6a7('0x2a'));_0x1009e8[_0xc6a7('0x34')]=_[_0xc6a7('0x35')](_0x3020b0[_0xc6a7('0x34')]);_0x1009e8[_0xc6a7('0x36')]=_['intersection'](_0x1009e8['model'],_0x1009e8['query']);_0x29d13e[_0xc6a7('0x37')]=_['intersection'](_0x1009e8[_0xc6a7('0x33')],qs['fields'](_0x3020b0[_0xc6a7('0x34')][_0xc6a7('0x38')]));_0x29d13e[_0xc6a7('0x37')]=_0x29d13e['attributes']['length']?_0x29d13e[_0xc6a7('0x37')]:_0x1009e8['model'];if(!_0x3020b0['query'][_0xc6a7('0x39')]('nolimit')){_0x29d13e[_0xc6a7('0x1e')]=qs[_0xc6a7('0x1e')](_0x3020b0[_0xc6a7('0x34')]['limit']);_0x29d13e[_0xc6a7('0x1c')]=qs[_0xc6a7('0x1c')](_0x3020b0[_0xc6a7('0x34')][_0xc6a7('0x1c')]);}_0x29d13e[_0xc6a7('0x3a')]=qs[_0xc6a7('0x3b')](_0x3020b0[_0xc6a7('0x34')][_0xc6a7('0x3b')]);_0x29d13e[_0xc6a7('0x3c')]=qs['filters'](_[_0xc6a7('0x3d')](_0x3020b0[_0xc6a7('0x34')],_0x1009e8[_0xc6a7('0x36')]),_0x3af9e0);if(_0x3020b0[_0xc6a7('0x34')][_0xc6a7('0x3e')]){_0x29d13e['where']=_[_0xc6a7('0x3f')](_0x29d13e[_0xc6a7('0x3c')],{'$or':_['map'](_0x3af9e0,function(_0x55aeb5){if(_0x55aeb5['type']!=='VIRTUAL'){var _0x42b8ce={};_0x42b8ce[_0x55aeb5[_0xc6a7('0x2a')]]={'$like':'%'+_0x3020b0[_0xc6a7('0x34')][_0xc6a7('0x3e')]+'%'};return _0x42b8ce;}})});}_0x29d13e=_[_0xc6a7('0x3f')]({},_0x29d13e,_0x3020b0[_0xc6a7('0x40')]);var _0x46d2c2={'where':_0x29d13e['where']};return db[_0xc6a7('0x2e')][_0xc6a7('0x1f')](_0x46d2c2)[_0xc6a7('0x25')](function(_0xae4d1a){_0x2ad631['count']=_0xae4d1a;if(_0x3020b0[_0xc6a7('0x34')][_0xc6a7('0x41')]){_0x29d13e[_0xc6a7('0x42')]=[{'all':!![]}];}return db['SmsTransferReport'][_0xc6a7('0x43')](_0x29d13e);})[_0xc6a7('0x25')](function(_0x16699c){_0x2ad631['rows']=_0x16699c;return _0x2ad631;})['then'](respondWithFilteredResult(_0x144b67,_0x29d13e))[_0xc6a7('0x44')](handleError(_0x144b67,null));};exports[_0xc6a7('0x45')]=function(_0x4d7b83,_0x9c740){var _0x321af9={'raw':!![],'where':{'id':_0x4d7b83[_0xc6a7('0x46')]['id']}},_0x321c40={};_0x321c40[_0xc6a7('0x33')]=_[_0xc6a7('0x35')](db['SmsTransferReport'][_0xc6a7('0x2f')]);_0x321c40[_0xc6a7('0x34')]=_[_0xc6a7('0x35')](_0x4d7b83['query']);_0x321c40[_0xc6a7('0x36')]=_['intersection'](_0x321c40[_0xc6a7('0x33')],_0x321c40[_0xc6a7('0x34')]);_0x321af9[_0xc6a7('0x37')]=_['intersection'](_0x321c40[_0xc6a7('0x33')],qs['fields'](_0x4d7b83[_0xc6a7('0x34')][_0xc6a7('0x38')]));_0x321af9[_0xc6a7('0x37')]=_0x321af9[_0xc6a7('0x37')][_0xc6a7('0x47')]?_0x321af9['attributes']:_0x321c40[_0xc6a7('0x33')];if(_0x4d7b83['query']['includeAll']){_0x321af9[_0xc6a7('0x42')]=[{'all':!![]}];}_0x321af9=_[_0xc6a7('0x3f')]({},_0x321af9,_0x4d7b83['options']);return db[_0xc6a7('0x2e')]['find'](_0x321af9)[_0xc6a7('0x25')](handleEntityNotFound(_0x9c740,null))[_0xc6a7('0x25')](respondWithResult(_0x9c740,null))[_0xc6a7('0x44')](handleError(_0x9c740,null));};exports[_0xc6a7('0x48')]=function(_0xd3052e,_0x6a386c){return db['SmsTransferReport']['create'](_0xd3052e[_0xc6a7('0x49')],{})[_0xc6a7('0x25')](respondWithResult(_0x6a386c,0xc9))[_0xc6a7('0x44')](handleError(_0x6a386c,null));};exports[_0xc6a7('0x24')]=function(_0xb951ae,_0x31b208){if(_0xb951ae[_0xc6a7('0x49')]['id']){delete _0xb951ae[_0xc6a7('0x49')]['id'];}return db[_0xc6a7('0x2e')][_0xc6a7('0x4a')]({'where':{'id':_0xb951ae[_0xc6a7('0x46')]['id']}})[_0xc6a7('0x25')](handleEntityNotFound(_0x31b208,null))['then'](saveUpdates(_0xb951ae['body'],null))[_0xc6a7('0x25')](respondWithResult(_0x31b208,null))['catch'](handleError(_0x31b208,null));};exports[_0xc6a7('0x26')]=function(_0x583173,_0x510b74){return db['SmsTransferReport'][_0xc6a7('0x4a')]({'where':{'id':_0x583173[_0xc6a7('0x46')]['id']}})[_0xc6a7('0x25')](handleEntityNotFound(_0x510b74,null))[_0xc6a7('0x25')](removeEntity(_0x510b74,null))[_0xc6a7('0x44')](handleError(_0x510b74,null));};exports[_0xc6a7('0x4b')]=function(_0x2a2987,_0x3d0565){return db['SmsTransferReport'][_0xc6a7('0x4b')]()[_0xc6a7('0x25')](respondWithResult(_0x3d0565,null))[_0xc6a7('0x44')](handleError(_0x3d0565,null));}; \ No newline at end of file +var _0x6c8c=['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','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','SmsTransferReport','rawAttributes','fieldName','type','key','map','keys','query','filters','intersection','fields','attributes','length','model','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','include','find','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','squel'];(function(_0x150693,_0x2bcee6){var _0x8261ca=function(_0x3008af){while(--_0x3008af){_0x150693['push'](_0x150693['shift']());}};_0x8261ca(++_0x2bcee6);}(_0x6c8c,0x17b));var _0xc6c8=function(_0x10be50,_0x1bf3d8){_0x10be50=_0x10be50-0x0;var _0x564821=_0x6c8c[_0x10be50];return _0x564821;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc6c8('0x0'));var zipdir=require(_0xc6c8('0x1'));var jsonpatch=require(_0xc6c8('0x2'));var rp=require(_0xc6c8('0x3'));var moment=require(_0xc6c8('0x4'));var BPromise=require(_0xc6c8('0x5'));var Mustache=require(_0xc6c8('0x6'));var util=require(_0xc6c8('0x7'));var path=require(_0xc6c8('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc6c8('0x9'));var _=require('lodash');var squel=require(_0xc6c8('0xa'));var crypto=require('crypto');var jsforce=require(_0xc6c8('0xb'));var deskjs=require(_0xc6c8('0xc'));var toCsv=require(_0xc6c8('0xd'));var querystring=require('querystring');var Papa=require(_0xc6c8('0xe'));var Redis=require(_0xc6c8('0xf'));var authService=require(_0xc6c8('0x10'));var qs=require(_0xc6c8('0x11'));var as=require(_0xc6c8('0x12'));var hardwareService=require(_0xc6c8('0x13'));var logger=require(_0xc6c8('0x14'))(_0xc6c8('0x15'));var utils=require(_0xc6c8('0x16'));var config=require(_0xc6c8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xc6c8('0x18'))['db'];function respondWithStatusCode(_0x6e0a3,_0x40cc03){_0x40cc03=_0x40cc03||0xcc;return function(_0x5449d8){if(_0x5449d8){return _0x6e0a3[_0xc6c8('0x19')](_0x40cc03);}return _0x6e0a3[_0xc6c8('0x1a')](_0x40cc03)[_0xc6c8('0x1b')]();};}function respondWithResult(_0xdc611f,_0x13b009){_0x13b009=_0x13b009||0xc8;return function(_0x2602cc){if(_0x2602cc){return _0xdc611f[_0xc6c8('0x1a')](_0x13b009)[_0xc6c8('0x1c')](_0x2602cc);}};}function respondWithFilteredResult(_0x29f866,_0x2bc8b5){return function(_0x50e281){if(_0x50e281){var _0x3d5181=typeof _0x2bc8b5['offset']==='undefined'&&typeof _0x2bc8b5['limit']===_0xc6c8('0x1d');var _0x57236b=_0x50e281[_0xc6c8('0x1e')];var _0x33f106=_0x3d5181?0x0:_0x2bc8b5[_0xc6c8('0x1f')];var _0x21cb6e=_0x3d5181?_0x50e281[_0xc6c8('0x1e')]:_0x2bc8b5[_0xc6c8('0x1f')]+_0x2bc8b5[_0xc6c8('0x20')];var _0x59025d;if(_0x21cb6e>=_0x57236b){_0x21cb6e=_0x57236b;_0x59025d=0xc8;}else{_0x59025d=0xce;}_0x29f866[_0xc6c8('0x1a')](_0x59025d);return _0x29f866[_0xc6c8('0x21')](_0xc6c8('0x22'),_0x33f106+'-'+_0x21cb6e+'/'+_0x57236b)[_0xc6c8('0x1c')](_0x50e281);}return null;};}function patchUpdates(_0x5aceb9){return function(_0x331df2){try{jsonpatch[_0xc6c8('0x23')](_0x331df2,_0x5aceb9,!![]);}catch(_0x17dd93){return BPromise[_0xc6c8('0x24')](_0x17dd93);}return _0x331df2[_0xc6c8('0x25')]();};}function saveUpdates(_0x363962,_0x911b06){return function(_0x11f576){if(_0x11f576){return _0x11f576[_0xc6c8('0x26')](_0x363962)[_0xc6c8('0x27')](function(_0x5c1fb4){return _0x5c1fb4;});}return null;};}function removeEntity(_0x3b2ff4,_0x303bdd){return function(_0x28f980){if(_0x28f980){return _0x28f980['destroy']()[_0xc6c8('0x27')](function(){_0x3b2ff4[_0xc6c8('0x1a')](0xcc)[_0xc6c8('0x1b')]();});}};}function handleEntityNotFound(_0x2d8af3,_0x4f3b17){return function(_0xcca056){if(!_0xcca056){_0x2d8af3[_0xc6c8('0x19')](0x194);}return _0xcca056;};}function handleError(_0x4530b8,_0x492590){_0x492590=_0x492590||0x1f4;return function(_0x3c8708){logger['error'](_0x3c8708[_0xc6c8('0x28')]);if(_0x3c8708[_0xc6c8('0x29')]){delete _0x3c8708[_0xc6c8('0x29')];}_0x4530b8[_0xc6c8('0x1a')](_0x492590)[_0xc6c8('0x2a')](_0x3c8708);};}exports[_0xc6c8('0x2b')]=function(_0x115817,_0x1909ec){var _0x325c93={},_0x7b27d6={},_0x9083dc={'count':0x0,'rows':[]};var _0x5365ed=_['map'](db[_0xc6c8('0x2c')][_0xc6c8('0x2d')],function(_0x3017eb){return{'name':_0x3017eb[_0xc6c8('0x2e')],'type':_0x3017eb[_0xc6c8('0x2f')][_0xc6c8('0x30')]};});_0x7b27d6['model']=_[_0xc6c8('0x31')](_0x5365ed,_0xc6c8('0x29'));_0x7b27d6['query']=_[_0xc6c8('0x32')](_0x115817[_0xc6c8('0x33')]);_0x7b27d6[_0xc6c8('0x34')]=_[_0xc6c8('0x35')](_0x7b27d6['model'],_0x7b27d6[_0xc6c8('0x33')]);_0x325c93['attributes']=_[_0xc6c8('0x35')](_0x7b27d6['model'],qs[_0xc6c8('0x36')](_0x115817[_0xc6c8('0x33')][_0xc6c8('0x36')]));_0x325c93[_0xc6c8('0x37')]=_0x325c93[_0xc6c8('0x37')][_0xc6c8('0x38')]?_0x325c93[_0xc6c8('0x37')]:_0x7b27d6[_0xc6c8('0x39')];if(!_0x115817[_0xc6c8('0x33')]['hasOwnProperty'](_0xc6c8('0x3a'))){_0x325c93[_0xc6c8('0x20')]=qs[_0xc6c8('0x20')](_0x115817['query']['limit']);_0x325c93['offset']=qs[_0xc6c8('0x1f')](_0x115817['query'][_0xc6c8('0x1f')]);}_0x325c93[_0xc6c8('0x3b')]=qs[_0xc6c8('0x3c')](_0x115817[_0xc6c8('0x33')][_0xc6c8('0x3c')]);_0x325c93[_0xc6c8('0x3d')]=qs[_0xc6c8('0x34')](_[_0xc6c8('0x3e')](_0x115817[_0xc6c8('0x33')],_0x7b27d6[_0xc6c8('0x34')]),_0x5365ed);if(_0x115817[_0xc6c8('0x33')][_0xc6c8('0x3f')]){_0x325c93[_0xc6c8('0x3d')]=_[_0xc6c8('0x40')](_0x325c93['where'],{'$or':_[_0xc6c8('0x31')](_0x5365ed,function(_0x565dd8){if(_0x565dd8[_0xc6c8('0x2f')]!==_0xc6c8('0x41')){var _0x314f7f={};_0x314f7f[_0x565dd8[_0xc6c8('0x29')]]={'$like':'%'+_0x115817[_0xc6c8('0x33')][_0xc6c8('0x3f')]+'%'};return _0x314f7f;}})});}_0x325c93=_[_0xc6c8('0x40')]({},_0x325c93,_0x115817[_0xc6c8('0x42')]);var _0x2a6f2e={'where':_0x325c93['where']};return db['SmsTransferReport']['count'](_0x2a6f2e)[_0xc6c8('0x27')](function(_0x216eba){_0x9083dc['count']=_0x216eba;if(_0x115817[_0xc6c8('0x33')]['includeAll']){_0x325c93['include']=[{'all':!![]}];}return db[_0xc6c8('0x2c')][_0xc6c8('0x43')](_0x325c93);})['then'](function(_0x5d5c22){_0x9083dc[_0xc6c8('0x44')]=_0x5d5c22;return _0x9083dc;})['then'](respondWithFilteredResult(_0x1909ec,_0x325c93))[_0xc6c8('0x45')](handleError(_0x1909ec,null));};exports[_0xc6c8('0x46')]=function(_0x480154,_0x58da5f){var _0x292a25={'raw':!![],'where':{'id':_0x480154[_0xc6c8('0x47')]['id']}},_0x158195={};_0x158195[_0xc6c8('0x39')]=_[_0xc6c8('0x32')](db[_0xc6c8('0x2c')][_0xc6c8('0x2d')]);_0x158195[_0xc6c8('0x33')]=_[_0xc6c8('0x32')](_0x480154[_0xc6c8('0x33')]);_0x158195[_0xc6c8('0x34')]=_[_0xc6c8('0x35')](_0x158195[_0xc6c8('0x39')],_0x158195[_0xc6c8('0x33')]);_0x292a25[_0xc6c8('0x37')]=_[_0xc6c8('0x35')](_0x158195['model'],qs[_0xc6c8('0x36')](_0x480154[_0xc6c8('0x33')][_0xc6c8('0x36')]));_0x292a25[_0xc6c8('0x37')]=_0x292a25[_0xc6c8('0x37')]['length']?_0x292a25[_0xc6c8('0x37')]:_0x158195['model'];if(_0x480154[_0xc6c8('0x33')][_0xc6c8('0x48')]){_0x292a25[_0xc6c8('0x49')]=[{'all':!![]}];}_0x292a25=_[_0xc6c8('0x40')]({},_0x292a25,_0x480154[_0xc6c8('0x42')]);return db['SmsTransferReport'][_0xc6c8('0x4a')](_0x292a25)[_0xc6c8('0x27')](handleEntityNotFound(_0x58da5f,null))[_0xc6c8('0x27')](respondWithResult(_0x58da5f,null))[_0xc6c8('0x45')](handleError(_0x58da5f,null));};exports[_0xc6c8('0x4b')]=function(_0x124aef,_0x5656d0){return db[_0xc6c8('0x2c')][_0xc6c8('0x4b')](_0x124aef[_0xc6c8('0x4c')],{})[_0xc6c8('0x27')](respondWithResult(_0x5656d0,0xc9))[_0xc6c8('0x45')](handleError(_0x5656d0,null));};exports[_0xc6c8('0x26')]=function(_0x3857f3,_0x42dc41){if(_0x3857f3[_0xc6c8('0x4c')]['id']){delete _0x3857f3[_0xc6c8('0x4c')]['id'];}return db[_0xc6c8('0x2c')]['find']({'where':{'id':_0x3857f3[_0xc6c8('0x47')]['id']}})[_0xc6c8('0x27')](handleEntityNotFound(_0x42dc41,null))[_0xc6c8('0x27')](saveUpdates(_0x3857f3[_0xc6c8('0x4c')],null))[_0xc6c8('0x27')](respondWithResult(_0x42dc41,null))[_0xc6c8('0x45')](handleError(_0x42dc41,null));};exports[_0xc6c8('0x4d')]=function(_0xaec711,_0x492c2f){return db[_0xc6c8('0x2c')][_0xc6c8('0x4a')]({'where':{'id':_0xaec711[_0xc6c8('0x47')]['id']}})[_0xc6c8('0x27')](handleEntityNotFound(_0x492c2f,null))[_0xc6c8('0x27')](removeEntity(_0x492c2f,null))[_0xc6c8('0x45')](handleError(_0x492c2f,null));};exports['describe']=function(_0x4a47ff,_0x21edb5){return db[_0xc6c8('0x2c')]['describe']()[_0xc6c8('0x27')](respondWithResult(_0x21edb5,null))[_0xc6c8('0x45')](handleError(_0x21edb5,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 875f8ec..a0eaa06 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 _0xa03c=['util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash'];(function(_0x55448c,_0x174be9){var _0x3b6b3a=function(_0x1ac9e0){while(--_0x1ac9e0){_0x55448c['push'](_0x55448c['shift']());}};_0x3b6b3a(++_0x174be9);}(_0xa03c,0x143));var _0xca03=function(_0x461058,_0x4db6b8){_0x461058=_0x461058-0x0;var _0x571917=_0xa03c[_0x461058];return _0x571917;};'use strict';var _=require(_0xca03('0x0'));var util=require(_0xca03('0x1'));var logger=require(_0xca03('0x2'))(_0xca03('0x3'));var moment=require(_0xca03('0x4'));var BPromise=require(_0xca03('0x5'));var rp=require(_0xca03('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xca03('0x7'));var attributes=require('./smsTransferReport.attributes');module['exports']=function(_0x3235ac,_0x54a2c8){return _0x3235ac[_0xca03('0x8')](_0xca03('0x9'),attributes,{'tableName':_0xca03('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xca03('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x55fd=['util','../../config/logger','api','bluebird','request-promise','rimraf','./smsTransferReport.attributes','exports','define','report_sms_transfer','uniqueid','lodash'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0x55fd,0xbf));var _0xd55f=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x55fd[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0xd55f('0x0'));var util=require(_0xd55f('0x1'));var logger=require(_0xd55f('0x2'))(_0xd55f('0x3'));var moment=require('moment');var BPromise=require(_0xd55f('0x4'));var rp=require(_0xd55f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd55f('0x6'));var config=require('../../config/environment');var attributes=require(_0xd55f('0x7'));module[_0xd55f('0x8')]=function(_0x26982d,_0x242227){return _0x26982d[_0xd55f('0x9')]('SmsTransferReport',attributes,{'tableName':_0xd55f('0xa'),'paranoid':![],'indexes':[{'name':_0xd55f('0xb'),'fields':[_0xd55f('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 363ba34..18f1c14 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 _0x26d1=['SmsTransferReport,\x20%s,\x20%s','message','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0x26d1,0x8e));var _0x126d=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x26d1[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0x126d('0x0'));var util=require('util');var moment=require(_0x126d('0x1'));var BPromise=require(_0x126d('0x2'));var rs=require(_0x126d('0x3'));var fs=require('fs');var Redis=require(_0x126d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x126d('0x5'))('rpc');var config=require(_0x126d('0x6'));var jayson=require(_0x126d('0x7'));var client=jayson[_0x126d('0x8')][_0x126d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b4dfc,_0x4e5e87,_0x2e668c){return new BPromise(function(_0x25ccc2,_0x7d6e4c){return client[_0x126d('0xa')](_0x2b4dfc,_0x2e668c)[_0x126d('0xb')](function(_0x1cf6fb){logger[_0x126d('0xc')]('SmsTransferReport,\x20%s,\x20%s',_0x4e5e87,_0x126d('0xd'));logger[_0x126d('0xe')](_0x126d('0xf'),_0x4e5e87,_0x126d('0xd'),JSON[_0x126d('0x10')](_0x1cf6fb));if(_0x1cf6fb['error']){if(_0x1cf6fb[_0x126d('0x11')]['code']===0x1f4){logger[_0x126d('0x11')](_0x126d('0x12'),_0x4e5e87,_0x1cf6fb[_0x126d('0x11')]['message']);return _0x7d6e4c(_0x1cf6fb[_0x126d('0x11')][_0x126d('0x13')]);}logger[_0x126d('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x4e5e87,_0x1cf6fb['error'][_0x126d('0x13')]);return _0x25ccc2(_0x1cf6fb[_0x126d('0x11')][_0x126d('0x13')]);}else{logger[_0x126d('0xc')](_0x126d('0x12'),_0x4e5e87,_0x126d('0xd'));_0x25ccc2(_0x1cf6fb['result'][_0x126d('0x13')]);}})['catch'](function(_0x352d72){logger['error'](_0x126d('0x12'),_0x4e5e87,_0x352d72);_0x7d6e4c(_0x352d72);});});} \ No newline at end of file +var _0x308a=['../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','error','code','SmsTransferReport,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc'];(function(_0x293c38,_0x39ae04){var _0x23f9d3=function(_0x2a2165){while(--_0x2a2165){_0x293c38['push'](_0x293c38['shift']());}};_0x23f9d3(++_0x39ae04);}(_0x308a,0x71));var _0xa308=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x308a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa308('0x0'));var util=require('util');var moment=require(_0xa308('0x1'));var BPromise=require(_0xa308('0x2'));var rs=require(_0xa308('0x3'));var fs=require('fs');var Redis=require(_0xa308('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa308('0x5'))(_0xa308('0x6'));var config=require(_0xa308('0x7'));var jayson=require(_0xa308('0x8'));var client=jayson[_0xa308('0x9')][_0xa308('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc30239,_0x5e0962,_0x5b8a23){return new BPromise(function(_0x2ca45e,_0x293f00){return client['request'](_0xc30239,_0x5b8a23)[_0xa308('0xb')](function(_0x5ced05){logger[_0xa308('0xc')]('SmsTransferReport,\x20%s,\x20%s',_0x5e0962,_0xa308('0xd'));logger[_0xa308('0xe')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x5e0962,_0xa308('0xd'),JSON['stringify'](_0x5ced05));if(_0x5ced05['error']){if(_0x5ced05[_0xa308('0xf')][_0xa308('0x10')]===0x1f4){logger[_0xa308('0xf')](_0xa308('0x11'),_0x5e0962,_0x5ced05[_0xa308('0xf')][_0xa308('0x12')]);return _0x293f00(_0x5ced05['error'][_0xa308('0x12')]);}logger[_0xa308('0xf')](_0xa308('0x11'),_0x5e0962,_0x5ced05[_0xa308('0xf')][_0xa308('0x12')]);return _0x2ca45e(_0x5ced05['error']['message']);}else{logger[_0xa308('0xc')](_0xa308('0x11'),_0x5e0962,_0xa308('0xd'));_0x2ca45e(_0x5ced05[_0xa308('0x13')][_0xa308('0x12')]);}})['catch'](function(_0x3fbc05){logger[_0xa308('0xf')](_0xa308('0x11'),_0x5e0962,_0x3fbc05);_0x293f00(_0x3fbc05);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 17bf557..b24f3db 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 _0x0395=['now','post','file','create','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id','show','isAuthenticated','download','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname'];(function(_0x4e7bad,_0x3d5983){var _0x161c5f=function(_0x1f5611){while(--_0x1f5611){_0x4e7bad['push'](_0x4e7bad['shift']());}};_0x161c5f(++_0x3d5983);}(_0x0395,0x180));var _0x5039=function(_0x9f48e6,_0x8f87aa){_0x9f48e6=_0x9f48e6-0x0;var _0x45fc5c=_0x0395[_0x9f48e6];return _0x45fc5c;};'use strict';var multer=require(_0x5039('0x0'));var util=require(_0x5039('0x1'));var path=require('path');var timeout=require(_0x5039('0x2'));var express=require(_0x5039('0x3'));var router=express[_0x5039('0x4')]();var fs_extra=require(_0x5039('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5039('0x6'));var config=require(_0x5039('0x7'));var controller=require('./sound.controller');router[_0x5039('0x8')]('/',auth['isAuthenticated'](),controller[_0x5039('0x9')]);router['get'](_0x5039('0xa'),auth['isAuthenticated'](),controller[_0x5039('0xb')]);router[_0x5039('0x8')]('/:id/download',auth[_0x5039('0xc')](),controller[_0x5039('0xd')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a5081,_0x5095b3,_0x44e835){_0x44e835(null,path['join'](config[_0x5039('0xe')],_0x5039('0xf')));},'filename':function(_0x445656,_0x210c00,_0x59a8d1){_0x210c00[_0x5039('0x10')]=_0x210c00['originalname'][_0x5039('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59a8d1(null,util[_0x5039('0x12')](_0x5039('0x13'),path[_0x5039('0x14')](_0x210c00['originalname'],path[_0x5039('0x15')](_0x210c00['originalname'])),Date[_0x5039('0x16')](),path['extname'](_0x210c00[_0x5039('0x10')])));}})});router[_0x5039('0x17')]('/',upload['single'](_0x5039('0x18')),controller[_0x5039('0x19')]);router['put']('/:id',auth[_0x5039('0xc')](),controller[_0x5039('0x1a')]);router[_0x5039('0x1b')](_0x5039('0xa'),auth[_0x5039('0xc')](),controller['delete']);module[_0x5039('0x1c')]=router; \ No newline at end of file +var _0x8bd5=['Router','fs-extra','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','/:id/download','download','join','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','now','single','file','create','/:id','update','delete','exports','multer','util','express'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x8bd5,0x84));var _0x58bd=function(_0x1b5897,_0xa5ff36){_0x1b5897=_0x1b5897-0x0;var _0x57fac4=_0x8bd5[_0x1b5897];return _0x57fac4;};'use strict';var multer=require(_0x58bd('0x0'));var util=require(_0x58bd('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x58bd('0x2'));var router=express[_0x58bd('0x3')]();var fs_extra=require(_0x58bd('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x58bd('0x5'));var config=require(_0x58bd('0x6'));var controller=require(_0x58bd('0x7'));router[_0x58bd('0x8')]('/',auth[_0x58bd('0x9')](),controller['index']);router['get']('/:id',auth[_0x58bd('0x9')](),controller['show']);router['get'](_0x58bd('0xa'),auth['isAuthenticated'](),controller[_0x58bd('0xb')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3784d5,_0x5872f9,_0x51a1f5){_0x51a1f5(null,path[_0x58bd('0xc')](config['root'],_0x58bd('0xd')));},'filename':function(_0x3676e9,_0x2f3e1a,_0x1feaf9){_0x2f3e1a[_0x58bd('0xe')]=_0x2f3e1a['originalname'][_0x58bd('0xf')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1feaf9(null,util[_0x58bd('0x10')](_0x58bd('0x11'),path[_0x58bd('0x12')](_0x2f3e1a[_0x58bd('0xe')],path['extname'](_0x2f3e1a[_0x58bd('0xe')])),Date[_0x58bd('0x13')](),path['extname'](_0x2f3e1a[_0x58bd('0xe')])));}})});router['post']('/',upload[_0x58bd('0x14')](_0x58bd('0x15')),controller[_0x58bd('0x16')]);router['put'](_0x58bd('0x17'),auth[_0x58bd('0x9')](),controller[_0x58bd('0x18')]);router[_0x58bd('0x19')](_0x58bd('0x17'),auth[_0x58bd('0x9')](),controller[_0x58bd('0x19')]);module[_0x58bd('0x1a')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 0303cce..9d33b8b 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 _0xc360=['BIGINT','STRING','name','FLOAT','INTEGER'];(function(_0x5291c8,_0x3b0c49){var _0x56b9e5=function(_0x3b2ea7){while(--_0x3b2ea7){_0x5291c8['push'](_0x5291c8['shift']());}};_0x56b9e5(++_0x3b0c49);}(_0xc360,0x15f));var _0x0c36=function(_0x65958c,_0x5e7354){_0x65958c=_0x65958c-0x0;var _0x9800c3=_0xc360[_0x65958c];return _0x9800c3;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0c36('0x0')],'unique':_0x0c36('0x1'),'allowNull':![]},'save_name':{'type':Sequelize[_0x0c36('0x0')]},'display_name':{'type':Sequelize[_0x0c36('0x0')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x0c36('0x0')]},'original_duration':{'type':Sequelize[_0x0c36('0x2')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x0c36('0x3')]},'original_bitRate':{'type':Sequelize[_0x0c36('0x4')]},'original_sampleRate':{'type':Sequelize[_0x0c36('0x3')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0x0c36('0x2')]},'converted_sampleCount':{'type':Sequelize[_0x0c36('0x4')]},'converted_channelCount':{'type':Sequelize[_0x0c36('0x3')]},'converted_bitRate':{'type':Sequelize[_0x0c36('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x0c36('0x3')]}}; \ No newline at end of file +var _0x64fa=['INTEGER','name','STRING','FLOAT','BIGINT'];(function(_0x52e363,_0x48062a){var _0x3fc2b5=function(_0x1b0cf9){while(--_0x1b0cf9){_0x52e363['push'](_0x52e363['shift']());}};_0x3fc2b5(++_0x48062a);}(_0x64fa,0xbf));var _0xa64f=function(_0x524c8f,_0x5ed25e){_0x524c8f=_0x524c8f-0x0;var _0x110103=_0x64fa[_0x524c8f];return _0x110103;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xa64f('0x0'),'allowNull':![]},'save_name':{'type':Sequelize[_0xa64f('0x1')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0xa64f('0x1')]},'original_duration':{'type':Sequelize[_0xa64f('0x2')]},'original_sampleCount':{'type':Sequelize[_0xa64f('0x3')]},'original_channelCount':{'type':Sequelize[_0xa64f('0x4')]},'original_bitRate':{'type':Sequelize[_0xa64f('0x3')]},'original_sampleRate':{'type':Sequelize[_0xa64f('0x4')]},'converted_format':{'type':Sequelize[_0xa64f('0x1')]},'converted_duration':{'type':Sequelize[_0xa64f('0x2')]},'converted_sampleCount':{'type':Sequelize[_0xa64f('0x3')]},'converted_channelCount':{'type':Sequelize[_0xa64f('0x4')]},'converted_bitRate':{'type':Sequelize[_0xa64f('0x3')]},'converted_sampleRate':{'type':Sequelize[_0xa64f('0x4')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 57b456e..8e61350 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 _0xf299=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','Content-Range','json','apply','reject','save','update','destroy','get','Sounds','then','error','name','send','index','Sound','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','query','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','include','findAll','rows','catch','params','options','find','converted_format','root','server/files/sounds/converted','save_name','Sequelize','download','join','format','%s.%s','create','file','originalname','extname','basename','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','chmodSync','0777','transcode','src','original_duration','duration','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','start','description','delete','original_format','unlinkSync','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x3f1b8d,_0x13e895){var _0x163074=function(_0x56e525){while(--_0x56e525){_0x3f1b8d['push'](_0x3f1b8d['shift']());}};_0x163074(++_0x13e895);}(_0xf299,0x161));var _0x9f29=function(_0x128bfe,_0x1e61c5){_0x128bfe=_0x128bfe-0x0;var _0x41751b=_0xf299[_0x128bfe];return _0x41751b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9f29('0x0'));var jsonpatch=require(_0x9f29('0x1'));var rp=require('request-promise');var moment=require(_0x9f29('0x2'));var BPromise=require(_0x9f29('0x3'));var Mustache=require(_0x9f29('0x4'));var util=require(_0x9f29('0x5'));var path=require('path');var sox=require(_0x9f29('0x6'));var csv=require(_0x9f29('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9f29('0x8'));var squel=require(_0x9f29('0x9'));var crypto=require(_0x9f29('0xa'));var jsforce=require(_0x9f29('0xb'));var deskjs=require(_0x9f29('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9f29('0xd'));var Papa=require(_0x9f29('0xe'));var Redis=require(_0x9f29('0xf'));var authService=require(_0x9f29('0x10'));var qs=require(_0x9f29('0x11'));var as=require(_0x9f29('0x12'));var hardwareService=require(_0x9f29('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x9f29('0x14'));var config=require(_0x9f29('0x15'));var licenseUtil=require(_0x9f29('0x16'));var db=require(_0x9f29('0x17'))['db'];function respondWithStatusCode(_0x221e4f,_0x1bcf1a){_0x1bcf1a=_0x1bcf1a||0xcc;return function(_0x18b6cc){if(_0x18b6cc){return _0x221e4f[_0x9f29('0x18')](_0x1bcf1a);}return _0x221e4f[_0x9f29('0x19')](_0x1bcf1a)[_0x9f29('0x1a')]();};}function respondWithResult(_0x776b78,_0x51593d){_0x51593d=_0x51593d||0xc8;return function(_0x268bc5){if(_0x268bc5){return _0x776b78[_0x9f29('0x19')](_0x51593d)['json'](_0x268bc5);}};}function respondWithFilteredResult(_0x518f23,_0xa85f9){return function(_0x4302d){if(_0x4302d){var _0x4fe86e=typeof _0xa85f9['offset']==='undefined'&&typeof _0xa85f9[_0x9f29('0x1b')]===_0x9f29('0x1c');var _0x25d744=_0x4302d[_0x9f29('0x1d')];var _0x162dc9=_0x4fe86e?0x0:_0xa85f9['offset'];var _0x421891=_0x4fe86e?_0x4302d[_0x9f29('0x1d')]:_0xa85f9[_0x9f29('0x1e')]+_0xa85f9['limit'];var _0x25138f;if(_0x421891>=_0x25d744){_0x421891=_0x25d744;_0x25138f=0xc8;}else{_0x25138f=0xce;}_0x518f23[_0x9f29('0x19')](_0x25138f);return _0x518f23['set'](_0x9f29('0x1f'),_0x162dc9+'-'+_0x421891+'/'+_0x25d744)[_0x9f29('0x20')](_0x4302d);}return null;};}function patchUpdates(_0x30d4bc){return function(_0x1a4c87){try{jsonpatch[_0x9f29('0x21')](_0x1a4c87,_0x30d4bc,!![]);}catch(_0x32f3b9){return BPromise[_0x9f29('0x22')](_0x32f3b9);}return _0x1a4c87[_0x9f29('0x23')]();};}function saveUpdates(_0x2f249a,_0x2479a9){return function(_0x219390){if(_0x219390){return _0x219390[_0x9f29('0x24')](_0x2f249a)['then'](function(_0x2d8c9e){return _0x2d8c9e;});}return null;};}function removeEntity(_0x44143e,_0xd0a420){return function(_0x221fa7){if(_0x221fa7){return _0x221fa7[_0x9f29('0x25')]()['then'](function(){var _0x33b429=_0x221fa7[_0x9f29('0x26')]({'plain':!![]});var _0x550543=_0x9f29('0x27');return db['UserProfileResource'][_0x9f29('0x25')]({'where':{'type':_0x550543,'resourceId':_0x33b429['id']}})['then'](function(){return _0x221fa7;});})[_0x9f29('0x28')](function(){_0x44143e[_0x9f29('0x19')](0xcc)[_0x9f29('0x1a')]();});}};}function handleEntityNotFound(_0x4a4e69,_0x1266af){return function(_0x3ab254){if(!_0x3ab254){_0x4a4e69[_0x9f29('0x18')](0x194);}return _0x3ab254;};}function handleError(_0x2ad946,_0x531172){_0x531172=_0x531172||0x1f4;return function(_0xe11b23){logger[_0x9f29('0x29')](_0xe11b23['stack']);if(_0xe11b23['name']){delete _0xe11b23[_0x9f29('0x2a')];}_0x2ad946['status'](_0x531172)[_0x9f29('0x2b')](_0xe11b23);};}exports[_0x9f29('0x2c')]=function(_0x458c93,_0x4ccf42){var _0x5b6522={},_0xab1d5c={},_0x4dcccb={'count':0x0,'rows':[]};var _0x660981=_['map'](db[_0x9f29('0x2d')][_0x9f29('0x2e')],function(_0x1ffc9c){return{'name':_0x1ffc9c[_0x9f29('0x2f')],'type':_0x1ffc9c[_0x9f29('0x30')][_0x9f29('0x31')]};});_0xab1d5c[_0x9f29('0x32')]=_[_0x9f29('0x33')](_0x660981,_0x9f29('0x2a'));_0xab1d5c['query']=_[_0x9f29('0x34')](_0x458c93['query']);_0xab1d5c[_0x9f29('0x35')]=_[_0x9f29('0x36')](_0xab1d5c[_0x9f29('0x32')],_0xab1d5c[_0x9f29('0x37')]);_0x5b6522['attributes']=_[_0x9f29('0x36')](_0xab1d5c[_0x9f29('0x32')],qs['fields'](_0x458c93[_0x9f29('0x37')][_0x9f29('0x38')]));_0x5b6522[_0x9f29('0x39')]=_0x5b6522[_0x9f29('0x39')][_0x9f29('0x3a')]?_0x5b6522[_0x9f29('0x39')]:_0xab1d5c[_0x9f29('0x32')];if(!_0x458c93[_0x9f29('0x37')]['hasOwnProperty'](_0x9f29('0x3b'))){_0x5b6522[_0x9f29('0x1b')]=qs['limit'](_0x458c93[_0x9f29('0x37')][_0x9f29('0x1b')]);_0x5b6522['offset']=qs[_0x9f29('0x1e')](_0x458c93['query'][_0x9f29('0x1e')]);}_0x5b6522[_0x9f29('0x3c')]=qs[_0x9f29('0x3d')](_0x458c93[_0x9f29('0x37')][_0x9f29('0x3d')]);_0x5b6522[_0x9f29('0x3e')]=qs[_0x9f29('0x35')](_[_0x9f29('0x3f')](_0x458c93['query'],_0xab1d5c['filters']),_0x660981);if(_0x458c93['query'][_0x9f29('0x40')]){_0x5b6522['where']=_['merge'](_0x5b6522[_0x9f29('0x3e')],{'$or':_[_0x9f29('0x33')](_0x660981,function(_0x1e9cd8){if(_0x1e9cd8[_0x9f29('0x30')]!==_0x9f29('0x41')){var _0x13b8ad={};_0x13b8ad[_0x1e9cd8[_0x9f29('0x2a')]]={'$like':'%'+_0x458c93['query'][_0x9f29('0x40')]+'%'};return _0x13b8ad;}})});}_0x5b6522=_[_0x9f29('0x42')]({},_0x5b6522,_0x458c93['options']);var _0x3bb87d={'where':_0x5b6522['where']};return db['Sound'][_0x9f29('0x1d')](_0x3bb87d)[_0x9f29('0x28')](function(_0x3a81d7){_0x4dcccb[_0x9f29('0x1d')]=_0x3a81d7;if(_0x458c93[_0x9f29('0x37')]['includeAll']){_0x5b6522[_0x9f29('0x43')]=[{'all':!![]}];}return db[_0x9f29('0x2d')][_0x9f29('0x44')](_0x5b6522);})[_0x9f29('0x28')](function(_0x293309){_0x4dcccb[_0x9f29('0x45')]=_0x293309;return _0x4dcccb;})[_0x9f29('0x28')](respondWithFilteredResult(_0x4ccf42,_0x5b6522))[_0x9f29('0x46')](handleError(_0x4ccf42,null));};exports['show']=function(_0x574df8,_0x3d6f25){var _0x23b65f={'raw':!![],'where':{'id':_0x574df8[_0x9f29('0x47')]['id']}},_0x536fbe={};_0x536fbe['model']=_[_0x9f29('0x34')](db[_0x9f29('0x2d')][_0x9f29('0x2e')]);_0x536fbe[_0x9f29('0x37')]=_['keys'](_0x574df8[_0x9f29('0x37')]);_0x536fbe[_0x9f29('0x35')]=_[_0x9f29('0x36')](_0x536fbe[_0x9f29('0x32')],_0x536fbe[_0x9f29('0x37')]);_0x23b65f['attributes']=_[_0x9f29('0x36')](_0x536fbe[_0x9f29('0x32')],qs[_0x9f29('0x38')](_0x574df8[_0x9f29('0x37')][_0x9f29('0x38')]));_0x23b65f[_0x9f29('0x39')]=_0x23b65f[_0x9f29('0x39')][_0x9f29('0x3a')]?_0x23b65f[_0x9f29('0x39')]:_0x536fbe[_0x9f29('0x32')];if(_0x574df8[_0x9f29('0x37')]['includeAll']){_0x23b65f[_0x9f29('0x43')]=[{'all':!![]}];}_0x23b65f=_[_0x9f29('0x42')]({},_0x23b65f,_0x574df8[_0x9f29('0x48')]);return db['Sound'][_0x9f29('0x49')](_0x23b65f)['then'](handleEntityNotFound(_0x3d6f25,null))[_0x9f29('0x28')](respondWithResult(_0x3d6f25,null))[_0x9f29('0x46')](handleError(_0x3d6f25,null));};exports['download']=function(_0x31e10d,_0x4598e9,_0x2978d0){return db[_0x9f29('0x2d')]['find']({'where':{'id':_0x31e10d[_0x9f29('0x47')]['id']},'attributes':[_0x9f29('0x2a'),'save_name',_0x9f29('0x4a')],'raw':!![]})[_0x9f29('0x28')](handleEntityNotFound(_0x4598e9,null))[_0x9f29('0x28')](function(_0x26f929){if(_0x26f929){if(!fs['existsSync'](path['join'](config[_0x9f29('0x4b')],_0x9f29('0x4c'),_0x26f929[_0x9f29('0x4d')]+'.'+_0x26f929['converted_format']))){throw new db[(_0x9f29('0x4e'))]['ValidationError']('Sound\x20not\x20found');}return _0x4598e9[_0x9f29('0x4f')](path[_0x9f29('0x50')](config['root'],_0x9f29('0x4c'),util[_0x9f29('0x51')](_0x9f29('0x52'),_0x26f929[_0x9f29('0x4d')],_0x26f929[_0x9f29('0x4a')])),util[_0x9f29('0x51')]('%s.%s',_0x26f929['name'],_0x26f929[_0x9f29('0x4a')]));}return null;})['catch'](handleError(_0x4598e9,null));};exports[_0x9f29('0x53')]=function(_0x5b6564,_0x4c2d92,_0x18e988){var _0x48f694={'name':path['basename'](_0x5b6564[_0x9f29('0x54')][_0x9f29('0x55')],path[_0x9f29('0x56')](_0x5b6564['file'][_0x9f29('0x55')])),'save_name':path[_0x9f29('0x57')](_0x5b6564[_0x9f29('0x54')][_0x9f29('0x58')],path['extname'](_0x5b6564['file'][_0x9f29('0x58')])),'original_format':path[_0x9f29('0x56')](_0x5b6564[_0x9f29('0x54')][_0x9f29('0x55')])[_0x9f29('0x59')](0x1),'converted_format':_0x9f29('0x5a')};var _0x537cc2=path[_0x9f29('0x50')](config[_0x9f29('0x4b')],_0x9f29('0x5b'),_0x5b6564[_0x9f29('0x54')][_0x9f29('0x58')]);var _0x1e61c1=path[_0x9f29('0x50')](config['root'],'server/files/sounds/converted',util[_0x9f29('0x51')](_0x9f29('0x52'),path[_0x9f29('0x57')](_0x5b6564['file'][_0x9f29('0x58')],path[_0x9f29('0x56')](_0x5b6564[_0x9f29('0x54')]['filename'])),_0x48f694['converted_format']));logger[_0x9f29('0x5c')](_0x9f29('0x5d'),_0x537cc2);logger[_0x9f29('0x5c')]('Sound\x20upload\x20destination:\x20%s',_0x1e61c1);try{fs[_0x9f29('0x5e')](_0x537cc2,parseInt(_0x9f29('0x5f'),0x8));var _0x2501f0=sox[_0x9f29('0x60')](_0x537cc2,_0x1e61c1,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2501f0['on']('error',function(_0x42aa65){fs['unlinkSync'](_0x537cc2);_0x4c2d92[_0x9f29('0x19')](0x1f4)[_0x9f29('0x2b')](_0x42aa65);});_0x2501f0['on'](_0x9f29('0x61'),function(_0x1cdc9b){_0x48f694[_0x9f29('0x62')]=isNaN(_0x1cdc9b[_0x9f29('0x63')])?null:_0x1cdc9b[_0x9f29('0x63')]*0x3e8;_0x48f694['original_sampleCount']=isNaN(_0x1cdc9b[_0x9f29('0x64')])?null:_0x1cdc9b['sampleCount'];_0x48f694[_0x9f29('0x65')]=isNaN(_0x1cdc9b[_0x9f29('0x66')])?null:_0x1cdc9b[_0x9f29('0x66')];_0x48f694['original_bitRate']=isNaN(_0x1cdc9b[_0x9f29('0x67')])?null:_0x1cdc9b[_0x9f29('0x67')];_0x48f694[_0x9f29('0x68')]=isNaN(_0x1cdc9b[_0x9f29('0x69')])?null:_0x1cdc9b[_0x9f29('0x69')];});_0x2501f0['on'](_0x9f29('0x6a'),function(_0x3fd2a4){_0x48f694[_0x9f29('0x6b')]=isNaN(_0x3fd2a4[_0x9f29('0x63')])?null:_0x3fd2a4[_0x9f29('0x63')]*0x3e8;_0x48f694[_0x9f29('0x6c')]=isNaN(_0x3fd2a4[_0x9f29('0x64')])?null:_0x3fd2a4[_0x9f29('0x64')];_0x48f694[_0x9f29('0x6d')]=isNaN(_0x3fd2a4[_0x9f29('0x66')])?null:_0x3fd2a4[_0x9f29('0x66')];_0x48f694[_0x9f29('0x6e')]=isNaN(_0x3fd2a4[_0x9f29('0x67')])?null:_0x3fd2a4[_0x9f29('0x67')];_0x48f694[_0x9f29('0x6f')]=isNaN(_0x3fd2a4['sampleRate'])?null:_0x3fd2a4[_0x9f29('0x69')];});_0x2501f0['on'](_0x9f29('0x1a'),function(){fs[_0x9f29('0x5e')](_0x1e61c1,parseInt(_0x9f29('0x5f'),0x8));return db['Sound'][_0x9f29('0x53')](_0x48f694)[_0x9f29('0x28')](function(_0x50d3cc){var _0x4bfa71={'role':_0x5b6564[_0x9f29('0x70')]['role'],'userProfileId':_0x5b6564[_0x9f29('0x70')][_0x9f29('0x71')]};if(!_0x4bfa71)throw new Error(_0x9f29('0x72'));if(_0x4bfa71[_0x9f29('0x73')]===_0x9f29('0x74')){var _0x4852d8=_0x50d3cc['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x9f29('0x27'),'userProfileId':_0x4bfa71[_0x9f29('0x71')]},'raw':!![]})[_0x9f29('0x28')](function(_0x361a5b){if(_0x361a5b&&_0x361a5b[_0x9f29('0x75')]===0x0){return db['UserProfileResource'][_0x9f29('0x53')]({'name':_0x4852d8[_0x9f29('0x2a')],'resourceId':_0x4852d8['id'],'type':_0x361a5b[_0x9f29('0x2a')],'sectionId':_0x361a5b['id']},{})[_0x9f29('0x28')](function(){return _0x50d3cc;});}else{return _0x50d3cc;}})[_0x9f29('0x46')](function(_0x3fbf02){logger[_0x9f29('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3fbf02);throw _0x3fbf02;});}return _0x50d3cc;})[_0x9f29('0x28')](respondWithResult(_0x4c2d92,null))[_0x9f29('0x46')](handleError(_0x4c2d92,null));});_0x2501f0[_0x9f29('0x76')]();}catch(_0x5cd94a){_0x4c2d92[_0x9f29('0x19')](0x1f4)[_0x9f29('0x2b')](_0x5cd94a);}};exports[_0x9f29('0x24')]=function(_0x316699,_0x2caadf,_0x4d4551){return db[_0x9f29('0x2d')][_0x9f29('0x49')]({'where':{'id':_0x316699[_0x9f29('0x47')]['id']}})[_0x9f29('0x28')](handleEntityNotFound(_0x2caadf,null))['then'](saveUpdates(_[_0x9f29('0x3f')](_0x316699[_0x9f29('0x70')],['name',_0x9f29('0x77')]),null))[_0x9f29('0x28')](respondWithResult(_0x2caadf,null))[_0x9f29('0x46')](handleError(_0x2caadf,null));};exports[_0x9f29('0x78')]=function(_0x57c6a9,_0x3979dd,_0x55de72){return db[_0x9f29('0x2d')][_0x9f29('0x49')]({'where':{'id':_0x57c6a9['params']['id']}})[_0x9f29('0x28')](function(_0x2dfea5){if(_0x2dfea5){return _0x2dfea5[_0x9f29('0x25')]();}})[_0x9f29('0x28')](function(_0x3ea519){var _0x41d21d=path[_0x9f29('0x50')](config[_0x9f29('0x4b')],'server/files/sounds/original',util[_0x9f29('0x51')](_0x9f29('0x52'),_0x3ea519['save_name'],_0x3ea519[_0x9f29('0x79')]));var _0x1807ca=path[_0x9f29('0x50')](config[_0x9f29('0x4b')],_0x9f29('0x4c'),util[_0x9f29('0x51')](_0x9f29('0x52'),_0x3ea519[_0x9f29('0x4d')],_0x3ea519['converted_format']));fs[_0x9f29('0x7a')](_0x41d21d);fs[_0x9f29('0x7a')](_0x1807ca);return _0x3ea519;})[_0x9f29('0x28')](function(_0x186b9b){if(_0x186b9b){return _0x3979dd['status'](0xcc)[_0x9f29('0x1a')]();}})[_0x9f29('0x28')](handleEntityNotFound(_0x3979dd,null))[_0x9f29('0x46')](handleError(_0x3979dd,null));}; \ No newline at end of file +var _0xac55=['zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','limit','undefined','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Sounds','UserProfileResource','sendStatus','stack','name','send','index','Sound','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','options','find','download','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','Sequelize','ValidationError','format','%s.%s','create','basename','file','originalname','extname','filename','substring','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','wav','error','unlinkSync','src','duration','original_sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_bitRate','converted_sampleRate','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','params','description','original_format','eml-format','rimraf'];(function(_0x3e18b4,_0x5eb300){var _0x23f541=function(_0x1178a9){while(--_0x1178a9){_0x3e18b4['push'](_0x3e18b4['shift']());}};_0x23f541(++_0x5eb300);}(_0xac55,0x172));var _0x5ac5=function(_0x1da4ca,_0x547e72){_0x1da4ca=_0x1da4ca-0x0;var _0x383c46=_0xac55[_0x1da4ca];return _0x383c46;};'use strict';var emlformat=require(_0x5ac5('0x0'));var rimraf=require(_0x5ac5('0x1'));var zipdir=require(_0x5ac5('0x2'));var jsonpatch=require(_0x5ac5('0x3'));var rp=require('request-promise');var moment=require(_0x5ac5('0x4'));var BPromise=require(_0x5ac5('0x5'));var Mustache=require('mustache');var util=require(_0x5ac5('0x6'));var path=require('path');var sox=require(_0x5ac5('0x7'));var csv=require(_0x5ac5('0x8'));var ejs=require(_0x5ac5('0x9'));var fs=require('fs');var fs_extra=require(_0x5ac5('0xa'));var _=require('lodash');var squel=require(_0x5ac5('0xb'));var crypto=require(_0x5ac5('0xc'));var jsforce=require(_0x5ac5('0xd'));var deskjs=require(_0x5ac5('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5ac5('0xf'));var Redis=require(_0x5ac5('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5ac5('0x11'));var as=require(_0x5ac5('0x12'));var hardwareService=require(_0x5ac5('0x13'));var logger=require('../../config/logger')(_0x5ac5('0x14'));var utils=require(_0x5ac5('0x15'));var config=require(_0x5ac5('0x16'));var licenseUtil=require(_0x5ac5('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x544561,_0x36ecf3){_0x36ecf3=_0x36ecf3||0xcc;return function(_0x423871){if(_0x423871){return _0x544561['sendStatus'](_0x36ecf3);}return _0x544561[_0x5ac5('0x18')](_0x36ecf3)[_0x5ac5('0x19')]();};}function respondWithResult(_0x18bdf4,_0x10d28a){_0x10d28a=_0x10d28a||0xc8;return function(_0x41dfe6){if(_0x41dfe6){return _0x18bdf4[_0x5ac5('0x18')](_0x10d28a)['json'](_0x41dfe6);}};}function respondWithFilteredResult(_0x529517,_0x65a2ad){return function(_0x49f59e){if(_0x49f59e){var _0x9381=typeof _0x65a2ad['offset']==='undefined'&&typeof _0x65a2ad[_0x5ac5('0x1a')]===_0x5ac5('0x1b');var _0x905d89=_0x49f59e['count'];var _0x31de71=_0x9381?0x0:_0x65a2ad[_0x5ac5('0x1c')];var _0x5540b6=_0x9381?_0x49f59e['count']:_0x65a2ad['offset']+_0x65a2ad[_0x5ac5('0x1a')];var _0x4b0aeb;if(_0x5540b6>=_0x905d89){_0x5540b6=_0x905d89;_0x4b0aeb=0xc8;}else{_0x4b0aeb=0xce;}_0x529517[_0x5ac5('0x18')](_0x4b0aeb);return _0x529517[_0x5ac5('0x1d')](_0x5ac5('0x1e'),_0x31de71+'-'+_0x5540b6+'/'+_0x905d89)[_0x5ac5('0x1f')](_0x49f59e);}return null;};}function patchUpdates(_0x403c56){return function(_0x53a8b3){try{jsonpatch[_0x5ac5('0x20')](_0x53a8b3,_0x403c56,!![]);}catch(_0x3940d2){return BPromise[_0x5ac5('0x21')](_0x3940d2);}return _0x53a8b3[_0x5ac5('0x22')]();};}function saveUpdates(_0x59bd41,_0x3f0161){return function(_0x2b3d75){if(_0x2b3d75){return _0x2b3d75[_0x5ac5('0x23')](_0x59bd41)[_0x5ac5('0x24')](function(_0x81a551){return _0x81a551;});}return null;};}function removeEntity(_0xc7b919,_0x36efbe){return function(_0x35784a){if(_0x35784a){return _0x35784a[_0x5ac5('0x25')]()[_0x5ac5('0x24')](function(){var _0x155348=_0x35784a[_0x5ac5('0x26')]({'plain':!![]});var _0x2b4696=_0x5ac5('0x27');return db[_0x5ac5('0x28')][_0x5ac5('0x25')]({'where':{'type':_0x2b4696,'resourceId':_0x155348['id']}})[_0x5ac5('0x24')](function(){return _0x35784a;});})['then'](function(){_0xc7b919[_0x5ac5('0x18')](0xcc)[_0x5ac5('0x19')]();});}};}function handleEntityNotFound(_0x4bdbf7,_0x4921eb){return function(_0x321f76){if(!_0x321f76){_0x4bdbf7[_0x5ac5('0x29')](0x194);}return _0x321f76;};}function handleError(_0x1d3d2b,_0x2c2121){_0x2c2121=_0x2c2121||0x1f4;return function(_0x14e775){logger['error'](_0x14e775[_0x5ac5('0x2a')]);if(_0x14e775[_0x5ac5('0x2b')]){delete _0x14e775[_0x5ac5('0x2b')];}_0x1d3d2b[_0x5ac5('0x18')](_0x2c2121)[_0x5ac5('0x2c')](_0x14e775);};}exports[_0x5ac5('0x2d')]=function(_0x3dc141,_0x3ba215){var _0x4c0632={},_0x5bf8a9={},_0x42290a={'count':0x0,'rows':[]};var _0xdc5ccb=_['map'](db[_0x5ac5('0x2e')]['rawAttributes'],function(_0x4d4bbd){return{'name':_0x4d4bbd[_0x5ac5('0x2f')],'type':_0x4d4bbd[_0x5ac5('0x30')]['key']};});_0x5bf8a9[_0x5ac5('0x31')]=_[_0x5ac5('0x32')](_0xdc5ccb,_0x5ac5('0x2b'));_0x5bf8a9[_0x5ac5('0x33')]=_[_0x5ac5('0x34')](_0x3dc141['query']);_0x5bf8a9[_0x5ac5('0x35')]=_[_0x5ac5('0x36')](_0x5bf8a9['model'],_0x5bf8a9[_0x5ac5('0x33')]);_0x4c0632[_0x5ac5('0x37')]=_['intersection'](_0x5bf8a9[_0x5ac5('0x31')],qs['fields'](_0x3dc141[_0x5ac5('0x33')][_0x5ac5('0x38')]));_0x4c0632['attributes']=_0x4c0632[_0x5ac5('0x37')][_0x5ac5('0x39')]?_0x4c0632[_0x5ac5('0x37')]:_0x5bf8a9[_0x5ac5('0x31')];if(!_0x3dc141['query'][_0x5ac5('0x3a')]('nolimit')){_0x4c0632[_0x5ac5('0x1a')]=qs[_0x5ac5('0x1a')](_0x3dc141[_0x5ac5('0x33')][_0x5ac5('0x1a')]);_0x4c0632['offset']=qs[_0x5ac5('0x1c')](_0x3dc141['query']['offset']);}_0x4c0632[_0x5ac5('0x3b')]=qs[_0x5ac5('0x3c')](_0x3dc141['query'][_0x5ac5('0x3c')]);_0x4c0632[_0x5ac5('0x3d')]=qs[_0x5ac5('0x35')](_[_0x5ac5('0x3e')](_0x3dc141[_0x5ac5('0x33')],_0x5bf8a9[_0x5ac5('0x35')]),_0xdc5ccb);if(_0x3dc141['query'][_0x5ac5('0x3f')]){_0x4c0632[_0x5ac5('0x3d')]=_[_0x5ac5('0x40')](_0x4c0632[_0x5ac5('0x3d')],{'$or':_[_0x5ac5('0x32')](_0xdc5ccb,function(_0x24a4c2){if(_0x24a4c2[_0x5ac5('0x30')]!==_0x5ac5('0x41')){var _0x775c0={};_0x775c0[_0x24a4c2[_0x5ac5('0x2b')]]={'$like':'%'+_0x3dc141[_0x5ac5('0x33')][_0x5ac5('0x3f')]+'%'};return _0x775c0;}})});}_0x4c0632=_['merge']({},_0x4c0632,_0x3dc141['options']);var _0x4edfc5={'where':_0x4c0632['where']};return db[_0x5ac5('0x2e')][_0x5ac5('0x42')](_0x4edfc5)['then'](function(_0x31518f){_0x42290a['count']=_0x31518f;if(_0x3dc141[_0x5ac5('0x33')][_0x5ac5('0x43')]){_0x4c0632[_0x5ac5('0x44')]=[{'all':!![]}];}return db['Sound'][_0x5ac5('0x45')](_0x4c0632);})[_0x5ac5('0x24')](function(_0xdefb54){_0x42290a[_0x5ac5('0x46')]=_0xdefb54;return _0x42290a;})[_0x5ac5('0x24')](respondWithFilteredResult(_0x3ba215,_0x4c0632))[_0x5ac5('0x47')](handleError(_0x3ba215,null));};exports['show']=function(_0x252c9d,_0x6d8487){var _0x167d33={'raw':!![],'where':{'id':_0x252c9d['params']['id']}},_0x15db5c={};_0x15db5c[_0x5ac5('0x31')]=_[_0x5ac5('0x34')](db[_0x5ac5('0x2e')]['rawAttributes']);_0x15db5c['query']=_[_0x5ac5('0x34')](_0x252c9d['query']);_0x15db5c[_0x5ac5('0x35')]=_['intersection'](_0x15db5c[_0x5ac5('0x31')],_0x15db5c[_0x5ac5('0x33')]);_0x167d33['attributes']=_[_0x5ac5('0x36')](_0x15db5c['model'],qs['fields'](_0x252c9d[_0x5ac5('0x33')]['fields']));_0x167d33[_0x5ac5('0x37')]=_0x167d33[_0x5ac5('0x37')][_0x5ac5('0x39')]?_0x167d33['attributes']:_0x15db5c['model'];if(_0x252c9d[_0x5ac5('0x33')]['includeAll']){_0x167d33[_0x5ac5('0x44')]=[{'all':!![]}];}_0x167d33=_[_0x5ac5('0x40')]({},_0x167d33,_0x252c9d[_0x5ac5('0x48')]);return db[_0x5ac5('0x2e')][_0x5ac5('0x49')](_0x167d33)[_0x5ac5('0x24')](handleEntityNotFound(_0x6d8487,null))[_0x5ac5('0x24')](respondWithResult(_0x6d8487,null))['catch'](handleError(_0x6d8487,null));};exports[_0x5ac5('0x4a')]=function(_0x1cf5d3,_0x51d424,_0x638714){return db[_0x5ac5('0x2e')][_0x5ac5('0x49')]({'where':{'id':_0x1cf5d3['params']['id']},'attributes':[_0x5ac5('0x2b'),_0x5ac5('0x4b'),_0x5ac5('0x4c')],'raw':!![]})[_0x5ac5('0x24')](handleEntityNotFound(_0x51d424,null))[_0x5ac5('0x24')](function(_0x2f0dbe){if(_0x2f0dbe){if(!fs[_0x5ac5('0x4d')](path[_0x5ac5('0x4e')](config[_0x5ac5('0x4f')],_0x5ac5('0x50'),_0x2f0dbe[_0x5ac5('0x4b')]+'.'+_0x2f0dbe[_0x5ac5('0x4c')]))){throw new db[(_0x5ac5('0x51'))][(_0x5ac5('0x52'))]('Sound\x20not\x20found');}return _0x51d424[_0x5ac5('0x4a')](path[_0x5ac5('0x4e')](config['root'],_0x5ac5('0x50'),util[_0x5ac5('0x53')](_0x5ac5('0x54'),_0x2f0dbe[_0x5ac5('0x4b')],_0x2f0dbe['converted_format'])),util[_0x5ac5('0x53')](_0x5ac5('0x54'),_0x2f0dbe['name'],_0x2f0dbe[_0x5ac5('0x4c')]));}return null;})[_0x5ac5('0x47')](handleError(_0x51d424,null));};exports[_0x5ac5('0x55')]=function(_0x4b5682,_0x51ce5c,_0x439b25){var _0x176aa6={'name':path[_0x5ac5('0x56')](_0x4b5682[_0x5ac5('0x57')][_0x5ac5('0x58')],path[_0x5ac5('0x59')](_0x4b5682[_0x5ac5('0x57')][_0x5ac5('0x58')])),'save_name':path[_0x5ac5('0x56')](_0x4b5682[_0x5ac5('0x57')][_0x5ac5('0x5a')],path[_0x5ac5('0x59')](_0x4b5682[_0x5ac5('0x57')][_0x5ac5('0x5a')])),'original_format':path[_0x5ac5('0x59')](_0x4b5682[_0x5ac5('0x57')]['originalname'])[_0x5ac5('0x5b')](0x1),'converted_format':'wav'};var _0x20438b=path['join'](config['root'],_0x5ac5('0x5c'),_0x4b5682[_0x5ac5('0x57')][_0x5ac5('0x5a')]);var _0xd32df0=path[_0x5ac5('0x4e')](config[_0x5ac5('0x4f')],'server/files/sounds/converted',util[_0x5ac5('0x53')]('%s.%s',path[_0x5ac5('0x56')](_0x4b5682[_0x5ac5('0x57')][_0x5ac5('0x5a')],path[_0x5ac5('0x59')](_0x4b5682[_0x5ac5('0x57')][_0x5ac5('0x5a')])),_0x176aa6['converted_format']));logger[_0x5ac5('0x5d')](_0x5ac5('0x5e'),_0x20438b);logger['info'](_0x5ac5('0x5f'),_0xd32df0);try{fs[_0x5ac5('0x60')](_0x20438b,parseInt(_0x5ac5('0x61'),0x8));var _0x378fc8=sox[_0x5ac5('0x62')](_0x20438b,_0xd32df0,{'sampleRate':0x1f40,'format':_0x5ac5('0x63'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x378fc8['on'](_0x5ac5('0x64'),function(_0x1a2ed8){fs[_0x5ac5('0x65')](_0x20438b);_0x51ce5c[_0x5ac5('0x18')](0x1f4)[_0x5ac5('0x2c')](_0x1a2ed8);});_0x378fc8['on'](_0x5ac5('0x66'),function(_0x5d7497){_0x176aa6['original_duration']=isNaN(_0x5d7497[_0x5ac5('0x67')])?null:_0x5d7497['duration']*0x3e8;_0x176aa6[_0x5ac5('0x68')]=isNaN(_0x5d7497['sampleCount'])?null:_0x5d7497['sampleCount'];_0x176aa6['original_channelCount']=isNaN(_0x5d7497[_0x5ac5('0x69')])?null:_0x5d7497['channelCount'];_0x176aa6[_0x5ac5('0x6a')]=isNaN(_0x5d7497[_0x5ac5('0x6b')])?null:_0x5d7497[_0x5ac5('0x6b')];_0x176aa6[_0x5ac5('0x6c')]=isNaN(_0x5d7497[_0x5ac5('0x6d')])?null:_0x5d7497['sampleRate'];});_0x378fc8['on'](_0x5ac5('0x6e'),function(_0x505b48){_0x176aa6[_0x5ac5('0x6f')]=isNaN(_0x505b48[_0x5ac5('0x67')])?null:_0x505b48[_0x5ac5('0x67')]*0x3e8;_0x176aa6[_0x5ac5('0x70')]=isNaN(_0x505b48['sampleCount'])?null:_0x505b48['sampleCount'];_0x176aa6['converted_channelCount']=isNaN(_0x505b48[_0x5ac5('0x69')])?null:_0x505b48[_0x5ac5('0x69')];_0x176aa6[_0x5ac5('0x71')]=isNaN(_0x505b48[_0x5ac5('0x6b')])?null:_0x505b48[_0x5ac5('0x6b')];_0x176aa6[_0x5ac5('0x72')]=isNaN(_0x505b48[_0x5ac5('0x6d')])?null:_0x505b48['sampleRate'];});_0x378fc8['on'](_0x5ac5('0x19'),function(){fs[_0x5ac5('0x60')](_0xd32df0,parseInt(_0x5ac5('0x61'),0x8));return db[_0x5ac5('0x2e')][_0x5ac5('0x55')](_0x176aa6)['then'](function(_0x5644e2){var _0xff57e1={'role':_0x4b5682[_0x5ac5('0x73')]['role'],'userProfileId':_0x4b5682[_0x5ac5('0x73')][_0x5ac5('0x74')]};if(!_0xff57e1)throw new Error(_0x5ac5('0x75'));if(_0xff57e1['role']===_0x5ac5('0x76')){var _0x568682=_0x5644e2[_0x5ac5('0x26')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x5ac5('0x27'),'userProfileId':_0xff57e1[_0x5ac5('0x74')]},'raw':!![]})[_0x5ac5('0x24')](function(_0x267331){if(_0x267331&&_0x267331['autoAssociation']===0x0){return db[_0x5ac5('0x28')][_0x5ac5('0x55')]({'name':_0x568682[_0x5ac5('0x2b')],'resourceId':_0x568682['id'],'type':_0x267331[_0x5ac5('0x2b')],'sectionId':_0x267331['id']},{})[_0x5ac5('0x24')](function(){return _0x5644e2;});}else{return _0x5644e2;}})['catch'](function(_0x432da4){logger[_0x5ac5('0x64')](_0x5ac5('0x77'),_0x432da4);throw _0x432da4;});}return _0x5644e2;})[_0x5ac5('0x24')](respondWithResult(_0x51ce5c,null))[_0x5ac5('0x47')](handleError(_0x51ce5c,null));});_0x378fc8[_0x5ac5('0x78')]();}catch(_0x423314){_0x51ce5c['status'](0x1f4)[_0x5ac5('0x2c')](_0x423314);}};exports[_0x5ac5('0x23')]=function(_0x321077,_0x43daf2,_0x258af2){return db['Sound'][_0x5ac5('0x49')]({'where':{'id':_0x321077[_0x5ac5('0x79')]['id']}})['then'](handleEntityNotFound(_0x43daf2,null))[_0x5ac5('0x24')](saveUpdates(_[_0x5ac5('0x3e')](_0x321077[_0x5ac5('0x73')],['name',_0x5ac5('0x7a')]),null))[_0x5ac5('0x24')](respondWithResult(_0x43daf2,null))[_0x5ac5('0x47')](handleError(_0x43daf2,null));};exports['delete']=function(_0x562f10,_0x50c6a4,_0x24a8e4){return db[_0x5ac5('0x2e')][_0x5ac5('0x49')]({'where':{'id':_0x562f10[_0x5ac5('0x79')]['id']}})[_0x5ac5('0x24')](function(_0x4a9238){if(_0x4a9238){return _0x4a9238['destroy']();}})[_0x5ac5('0x24')](function(_0x11b957){var _0x11f44e=path[_0x5ac5('0x4e')](config[_0x5ac5('0x4f')],_0x5ac5('0x5c'),util[_0x5ac5('0x53')](_0x5ac5('0x54'),_0x11b957[_0x5ac5('0x4b')],_0x11b957[_0x5ac5('0x7b')]));var _0x464c5f=path[_0x5ac5('0x4e')](config[_0x5ac5('0x4f')],'server/files/sounds/converted',util[_0x5ac5('0x53')](_0x5ac5('0x54'),_0x11b957[_0x5ac5('0x4b')],_0x11b957['converted_format']));fs['unlinkSync'](_0x11f44e);fs[_0x5ac5('0x65')](_0x464c5f);return _0x11b957;})[_0x5ac5('0x24')](function(_0x2e8e8d){if(_0x2e8e8d){return _0x50c6a4['status'](0xcc)[_0x5ac5('0x19')]();}})['then'](handleEntityNotFound(_0x50c6a4,null))['catch'](handleError(_0x50c6a4,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 4c01593..1c18fc0 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 _0xa6fa=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./sound.attributes','exports','define','Sound','tools_sounds','lodash','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa6fa,0x15c));var _0xaa6f=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xa6fa[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xaa6f('0x0'));var util=require(_0xaa6f('0x1'));var logger=require(_0xaa6f('0x2'))(_0xaa6f('0x3'));var moment=require(_0xaa6f('0x4'));var BPromise=require(_0xaa6f('0x5'));var rp=require(_0xaa6f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaa6f('0x7'));var config=require(_0xaa6f('0x8'));var attributes=require(_0xaa6f('0x9'));module[_0xaa6f('0xa')]=function(_0x309b8d,_0x1aaa01){return _0x309b8d[_0xaa6f('0xb')](_0xaa6f('0xc'),attributes,{'tableName':_0xaa6f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8915=['define','tools_sounds','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x8915,0x115));var _0x5891=function(_0x5e4563,_0x3ff918){_0x5e4563=_0x5e4563-0x0;var _0x8d1bf5=_0x8915[_0x5e4563];return _0x8d1bf5;};'use strict';var _=require(_0x5891('0x0'));var util=require(_0x5891('0x1'));var logger=require(_0x5891('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5891('0x3'));var rp=require(_0x5891('0x4'));var fs=require('fs');var path=require(_0x5891('0x5'));var rimraf=require(_0x5891('0x6'));var config=require(_0x5891('0x7'));var attributes=require('./sound.attributes');module[_0x5891('0x8')]=function(_0x48fe1d,_0x431f00){return _0x48fe1d[_0x5891('0x9')]('Sound',attributes,{'tableName':_0x5891('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 ad7e1f2..1611eb3 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 _0xf82b=['debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','ShowSound','Sound','find','options','raw','where','attributes','map','include','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','Sound,\x20%s,\x20%s','request\x20sent'];(function(_0x44a5a3,_0x44e933){var _0x524520=function(_0xa7dc2a){while(--_0xa7dc2a){_0x44a5a3['push'](_0x44a5a3['shift']());}};_0x524520(++_0x44e933);}(_0xf82b,0x13b));var _0xbf82=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf82b[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xbf82('0x0'));var util=require(_0xbf82('0x1'));var moment=require(_0xbf82('0x2'));var BPromise=require(_0xbf82('0x3'));var rs=require(_0xbf82('0x4'));var fs=require('fs');var Redis=require(_0xbf82('0x5'));var db=require(_0xbf82('0x6'))['db'];var utils=require(_0xbf82('0x7'));var logger=require(_0xbf82('0x8'))('rpc');var config=require(_0xbf82('0x9'));var jayson=require(_0xbf82('0xa'));var client=jayson['client'][_0xbf82('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x15613f,_0x3ed839,_0x56c839){return new BPromise(function(_0x476d32,_0x303c44){return client[_0xbf82('0xc')](_0x15613f,_0x56c839)['then'](function(_0x31e9dc){logger['info'](_0xbf82('0xd'),_0x3ed839,_0xbf82('0xe'));logger[_0xbf82('0xf')](_0xbf82('0x10'),_0x3ed839,_0xbf82('0xe'),JSON[_0xbf82('0x11')](_0x31e9dc));if(_0x31e9dc['error']){if(_0x31e9dc[_0xbf82('0x12')]['code']===0x1f4){logger[_0xbf82('0x12')](_0xbf82('0xd'),_0x3ed839,_0x31e9dc['error'][_0xbf82('0x13')]);return _0x303c44(_0x31e9dc[_0xbf82('0x12')]['message']);}logger['error'](_0xbf82('0xd'),_0x3ed839,_0x31e9dc[_0xbf82('0x12')][_0xbf82('0x13')]);return _0x476d32(_0x31e9dc[_0xbf82('0x12')]['message']);}else{logger[_0xbf82('0x14')](_0xbf82('0xd'),_0x3ed839,_0xbf82('0xe'));_0x476d32(_0x31e9dc[_0xbf82('0x15')][_0xbf82('0x13')]);}})[_0xbf82('0x16')](function(_0x1e60e0){logger['error'](_0xbf82('0xd'),_0x3ed839,_0x1e60e0);_0x303c44(_0x1e60e0);});});}exports[_0xbf82('0x17')]=function(_0x1f2c97){var _0x8e122c=this;return new Promise(function(_0x5b406d,_0x447cf0){return db[_0xbf82('0x18')][_0xbf82('0x19')]({'raw':_0x1f2c97['options']?_0x1f2c97[_0xbf82('0x1a')][_0xbf82('0x1b')]===undefined?!![]:![]:!![],'where':_0x1f2c97[_0xbf82('0x1a')]?_0x1f2c97[_0xbf82('0x1a')][_0xbf82('0x1c')]||null:null,'attributes':_0x1f2c97[_0xbf82('0x1a')]?_0x1f2c97[_0xbf82('0x1a')][_0xbf82('0x1d')]||null:null,'include':_0x1f2c97[_0xbf82('0x1a')]?_0x1f2c97['options']['include']?_[_0xbf82('0x1e')](_0x1f2c97[_0xbf82('0x1a')][_0xbf82('0x1f')],function(_0x2dd3fc){return{'model':db[_0x2dd3fc[_0xbf82('0x20')]],'as':_0x2dd3fc['as'],'attributes':_0x2dd3fc[_0xbf82('0x1d')],'include':_0x2dd3fc[_0xbf82('0x1f')]?_[_0xbf82('0x1e')](_0x2dd3fc[_0xbf82('0x1f')],function(_0x248daf){return{'model':db[_0x248daf[_0xbf82('0x20')]],'as':_0x248daf['as'],'attributes':_0x248daf[_0xbf82('0x1d')],'include':_0x248daf['include']?_[_0xbf82('0x1e')](_0x248daf['include'],function(_0x2c87df){return{'model':db[_0x2c87df[_0xbf82('0x20')]],'as':_0x2c87df['as'],'attributes':_0x2c87df[_0xbf82('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23689e){logger[_0xbf82('0x14')](_0xbf82('0x17'),_0x1f2c97);logger[_0xbf82('0xf')](_0xbf82('0x17'),_0x1f2c97,JSON[_0xbf82('0x11')](_0x23689e));_0x5b406d(_0x23689e);})[_0xbf82('0x16')](function(_0x190bab){logger[_0xbf82('0x12')](_0xbf82('0x17'),_0x190bab['message'],_0x1f2c97);_0x447cf0(_0x8e122c['error'](0x1f4,_0x190bab[_0xbf82('0x13')]));});});}; \ No newline at end of file +var _0x77df=['include','map','model','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','Sound,\x20%s,\x20%s','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','ShowSound','Sound','find','options','raw','where','attributes'];(function(_0x2c50d8,_0x486a06){var _0x562493=function(_0x2564d8){while(--_0x2564d8){_0x2c50d8['push'](_0x2c50d8['shift']());}};_0x562493(++_0x486a06);}(_0x77df,0x94));var _0xf77d=function(_0x31b7d0,_0x4368e9){_0x31b7d0=_0x31b7d0-0x0;var _0x11b9a7=_0x77df[_0x31b7d0];return _0x11b9a7;};'use strict';var _=require('lodash');var util=require(_0xf77d('0x0'));var moment=require('moment');var BPromise=require(_0xf77d('0x1'));var rs=require(_0xf77d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf77d('0x3'))['db'];var utils=require(_0xf77d('0x4'));var logger=require(_0xf77d('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf77d('0x6'));var client=jayson['client'][_0xf77d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x192244,_0x3c00e9,_0x19e60d){return new BPromise(function(_0x133014,_0x51f24a){return client[_0xf77d('0x8')](_0x192244,_0x19e60d)[_0xf77d('0x9')](function(_0x23dcc4){logger[_0xf77d('0xa')](_0xf77d('0xb'),_0x3c00e9,'request\x20sent');logger[_0xf77d('0xc')](_0xf77d('0xd'),_0x3c00e9,'request\x20sent',JSON[_0xf77d('0xe')](_0x23dcc4));if(_0x23dcc4['error']){if(_0x23dcc4[_0xf77d('0xf')]['code']===0x1f4){logger['error'](_0xf77d('0xb'),_0x3c00e9,_0x23dcc4[_0xf77d('0xf')][_0xf77d('0x10')]);return _0x51f24a(_0x23dcc4[_0xf77d('0xf')][_0xf77d('0x10')]);}logger[_0xf77d('0xf')](_0xf77d('0xb'),_0x3c00e9,_0x23dcc4[_0xf77d('0xf')][_0xf77d('0x10')]);return _0x133014(_0x23dcc4[_0xf77d('0xf')]['message']);}else{logger[_0xf77d('0xa')](_0xf77d('0xb'),_0x3c00e9,_0xf77d('0x11'));_0x133014(_0x23dcc4['result']['message']);}})[_0xf77d('0x12')](function(_0xf5f27e){logger['error'](_0xf77d('0xb'),_0x3c00e9,_0xf5f27e);_0x51f24a(_0xf5f27e);});});}exports[_0xf77d('0x13')]=function(_0x40ed86){var _0x5c4130=this;return new Promise(function(_0x5c1d70,_0x499603){return db[_0xf77d('0x14')][_0xf77d('0x15')]({'raw':_0x40ed86[_0xf77d('0x16')]?_0x40ed86[_0xf77d('0x16')][_0xf77d('0x17')]===undefined?!![]:![]:!![],'where':_0x40ed86['options']?_0x40ed86[_0xf77d('0x16')][_0xf77d('0x18')]||null:null,'attributes':_0x40ed86[_0xf77d('0x16')]?_0x40ed86[_0xf77d('0x16')][_0xf77d('0x19')]||null:null,'include':_0x40ed86[_0xf77d('0x16')]?_0x40ed86['options'][_0xf77d('0x1a')]?_[_0xf77d('0x1b')](_0x40ed86[_0xf77d('0x16')][_0xf77d('0x1a')],function(_0x19f59e){return{'model':db[_0x19f59e[_0xf77d('0x1c')]],'as':_0x19f59e['as'],'attributes':_0x19f59e[_0xf77d('0x19')],'include':_0x19f59e[_0xf77d('0x1a')]?_[_0xf77d('0x1b')](_0x19f59e[_0xf77d('0x1a')],function(_0x6198a6){return{'model':db[_0x6198a6['model']],'as':_0x6198a6['as'],'attributes':_0x6198a6['attributes'],'include':_0x6198a6[_0xf77d('0x1a')]?_[_0xf77d('0x1b')](_0x6198a6[_0xf77d('0x1a')],function(_0x234b5b){return{'model':db[_0x234b5b[_0xf77d('0x1c')]],'as':_0x234b5b['as'],'attributes':_0x234b5b[_0xf77d('0x19')]};}):[]};}):[]};}):[]:[]})[_0xf77d('0x9')](function(_0x152ce6){logger[_0xf77d('0xa')](_0xf77d('0x13'),_0x40ed86);logger[_0xf77d('0xc')](_0xf77d('0x13'),_0x40ed86,JSON[_0xf77d('0xe')](_0x152ce6));_0x5c1d70(_0x152ce6);})[_0xf77d('0x12')](function(_0x42ad3c){logger[_0xf77d('0xf')](_0xf77d('0x13'),_0x42ad3c[_0xf77d('0x10')],_0x40ed86);_0x499603(_0x5c4130['error'](0x1f4,_0x42ad3c[_0xf77d('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index ce9d1e0..2cb1379 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 _0xb7e7=['exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','index','get','/:id','show','post','isAuthenticated','create','put','delete','destroy'];(function(_0x200b68,_0x3271ee){var _0x4a9661=function(_0x29e135){while(--_0x29e135){_0x200b68['push'](_0x200b68['shift']());}};_0x4a9661(++_0x3271ee);}(_0xb7e7,0x121));var _0x7b7e=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xb7e7[_0x580576];return _0x3f55a0;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var fs_extra=require(_0x7b7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var controller=require(_0x7b7e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7b7e('0x7')]);router[_0x7b7e('0x8')](_0x7b7e('0x9'),auth['isAuthenticated'](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0xb')]('/',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller['update']);router[_0x7b7e('0xf')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x10')]);module[_0x7b7e('0x11')]=router; \ No newline at end of file +var _0x9ffd=['util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareMessage.controller','isAuthenticated','index','get','/:id','show','post','create','delete','destroy','exports','multer'];(function(_0x296897,_0x4d23ea){var _0x2b44ab=function(_0xdf90d8){while(--_0xdf90d8){_0x296897['push'](_0x296897['shift']());}};_0x2b44ab(++_0x4d23ea);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x5594db,_0x1d21aa){_0x5594db=_0x5594db-0x0;var _0x9e9907=_0x9ffd[_0x5594db];return _0x9e9907;};'use strict';var multer=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var path=require(_0xd9ff('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9ff('0x3'));var router=express[_0xd9ff('0x4')]();var fs_extra=require(_0xd9ff('0x5'));var auth=require(_0xd9ff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd9ff('0x7'));var controller=require(_0xd9ff('0x8'));router['get']('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xa')]);router[_0xd9ff('0xb')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xd')]);router[_0xd9ff('0xe')]('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd9ff('0x10')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x11')]);module[_0xd9ff('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index f4ff4bf..cc07f90 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 _0xaf2a=['out','STRING','TEXT','sequelize','exports','ENUM'];(function(_0x5536b2,_0x22d286){var _0x477566=function(_0x35c0f4){while(--_0x35c0f4){_0x5536b2['push'](_0x5536b2['shift']());}};_0x477566(++_0x22d286);}(_0xaf2a,0x1d7));var _0xaaf2=function(_0x66e7f,_0xe45210){_0x66e7f=_0x66e7f-0x0;var _0x31471f=_0xaf2a[_0x66e7f];return _0x31471f;};'use strict';var Sequelize=require(_0xaaf2('0x0'));module[_0xaaf2('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0xaaf2('0x2')]('in',_0xaaf2('0x3')),'defaultValue':_0xaaf2('0x3'),'allowNull':![]},'providerName':{'type':Sequelize[_0xaaf2('0x4')]},'providerResponse':{'type':Sequelize[_0xaaf2('0x5')]}}; \ No newline at end of file +var _0xedd3=['exports','STRING','TEXT','ENUM','out','sequelize'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0xedd3,0xa1));var _0x3edd=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xedd3[_0x1caf6a];return _0x1bf493;};'use strict';var Sequelize=require(_0x3edd('0x0'));module[_0x3edd('0x1')]={'uniqueid':{'type':Sequelize[_0x3edd('0x2')]},'body':{'type':Sequelize[_0x3edd('0x3')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x3edd('0x4')]('in',_0x3edd('0x5')),'defaultValue':_0x3edd('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x3edd('0x2')]},'providerResponse':{'type':Sequelize[_0x3edd('0x3')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index b8f55bd..cde8186 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 _0x8588=['limit','count','set','Content-Range','json','apply','reject','save','then','error','stack','name','index','SquareMessage','type','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','options','includeAll','include','findAll','catch','show','rawAttributes','merge','find','create','update','body','destroy','params','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined'];(function(_0x1c8590,_0x2791ee){var _0x8898d1=function(_0x405673){while(--_0x405673){_0x1c8590['push'](_0x1c8590['shift']());}};_0x8898d1(++_0x2791ee);}(_0x8588,0x185));var _0x8858=function(_0x5ac188,_0x54cb25){_0x5ac188=_0x5ac188-0x0;var _0x190caf=_0x8588[_0x5ac188];return _0x190caf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8858('0x0'));var zipdir=require(_0x8858('0x1'));var jsonpatch=require(_0x8858('0x2'));var rp=require(_0x8858('0x3'));var moment=require('moment');var BPromise=require(_0x8858('0x4'));var Mustache=require(_0x8858('0x5'));var util=require(_0x8858('0x6'));var path=require('path');var sox=require(_0x8858('0x7'));var csv=require(_0x8858('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8858('0x9'));var _=require(_0x8858('0xa'));var squel=require(_0x8858('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8858('0x8'));var querystring=require('querystring');var Papa=require(_0x8858('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8858('0xd'));var as=require(_0x8858('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8858('0xf'));var utils=require(_0x8858('0x10'));var config=require(_0x8858('0x11'));var licenseUtil=require(_0x8858('0x12'));var db=require(_0x8858('0x13'))['db'];function respondWithStatusCode(_0x1f063a,_0x1da801){_0x1da801=_0x1da801||0xcc;return function(_0x3ebff2){if(_0x3ebff2){return _0x1f063a[_0x8858('0x14')](_0x1da801);}return _0x1f063a[_0x8858('0x15')](_0x1da801)[_0x8858('0x16')]();};}function respondWithResult(_0x1f6c96,_0x32be90){_0x32be90=_0x32be90||0xc8;return function(_0x424f1d){if(_0x424f1d){return _0x1f6c96[_0x8858('0x15')](_0x32be90)['json'](_0x424f1d);}};}function respondWithFilteredResult(_0x41f883,_0x5c0a1d){return function(_0x26c0bd){if(_0x26c0bd){var _0x22b356=typeof _0x5c0a1d[_0x8858('0x17')]===_0x8858('0x18')&&typeof _0x5c0a1d[_0x8858('0x19')]===_0x8858('0x18');var _0x251b32=_0x26c0bd[_0x8858('0x1a')];var _0x159aab=_0x22b356?0x0:_0x5c0a1d[_0x8858('0x17')];var _0x5b0880=_0x22b356?_0x26c0bd[_0x8858('0x1a')]:_0x5c0a1d[_0x8858('0x17')]+_0x5c0a1d[_0x8858('0x19')];var _0xcf674a;if(_0x5b0880>=_0x251b32){_0x5b0880=_0x251b32;_0xcf674a=0xc8;}else{_0xcf674a=0xce;}_0x41f883[_0x8858('0x15')](_0xcf674a);return _0x41f883[_0x8858('0x1b')](_0x8858('0x1c'),_0x159aab+'-'+_0x5b0880+'/'+_0x251b32)[_0x8858('0x1d')](_0x26c0bd);}return null;};}function patchUpdates(_0x837d58){return function(_0x19c37d){try{jsonpatch[_0x8858('0x1e')](_0x19c37d,_0x837d58,!![]);}catch(_0x30f607){return BPromise[_0x8858('0x1f')](_0x30f607);}return _0x19c37d[_0x8858('0x20')]();};}function saveUpdates(_0x546d2c,_0x55ec5b){return function(_0x1e7ee){if(_0x1e7ee){return _0x1e7ee['update'](_0x546d2c)[_0x8858('0x21')](function(_0x3b3301){return _0x3b3301;});}return null;};}function removeEntity(_0x3e31a0,_0x580fcb){return function(_0x4d7267){if(_0x4d7267){return _0x4d7267['destroy']()[_0x8858('0x21')](function(){_0x3e31a0[_0x8858('0x15')](0xcc)[_0x8858('0x16')]();});}};}function handleEntityNotFound(_0x11e03d,_0x479254){return function(_0x113e0c){if(!_0x113e0c){_0x11e03d[_0x8858('0x14')](0x194);}return _0x113e0c;};}function handleError(_0xf748fb,_0x1303c5){_0x1303c5=_0x1303c5||0x1f4;return function(_0x1e8f99){logger[_0x8858('0x22')](_0x1e8f99[_0x8858('0x23')]);if(_0x1e8f99[_0x8858('0x24')]){delete _0x1e8f99[_0x8858('0x24')];}_0xf748fb[_0x8858('0x15')](_0x1303c5)['send'](_0x1e8f99);};}exports[_0x8858('0x25')]=function(_0x4e2459,_0x3f9191){var _0x2fa4f9={},_0xba3171={},_0x1aaae3={'count':0x0,'rows':[]};var _0x89bec7=_['map'](db[_0x8858('0x26')]['rawAttributes'],function(_0xccfb93){return{'name':_0xccfb93['fieldName'],'type':_0xccfb93[_0x8858('0x27')]['key']};});_0xba3171['model']=_[_0x8858('0x28')](_0x89bec7,'name');_0xba3171[_0x8858('0x29')]=_[_0x8858('0x2a')](_0x4e2459[_0x8858('0x29')]);_0xba3171[_0x8858('0x2b')]=_[_0x8858('0x2c')](_0xba3171['model'],_0xba3171[_0x8858('0x29')]);_0x2fa4f9['attributes']=_['intersection'](_0xba3171[_0x8858('0x2d')],qs[_0x8858('0x2e')](_0x4e2459[_0x8858('0x29')][_0x8858('0x2e')]));_0x2fa4f9['attributes']=_0x2fa4f9[_0x8858('0x2f')][_0x8858('0x30')]?_0x2fa4f9[_0x8858('0x2f')]:_0xba3171[_0x8858('0x2d')];if(!_0x4e2459[_0x8858('0x29')][_0x8858('0x31')](_0x8858('0x32'))){_0x2fa4f9[_0x8858('0x19')]=qs[_0x8858('0x19')](_0x4e2459[_0x8858('0x29')][_0x8858('0x19')]);_0x2fa4f9[_0x8858('0x17')]=qs[_0x8858('0x17')](_0x4e2459[_0x8858('0x29')][_0x8858('0x17')]);}_0x2fa4f9[_0x8858('0x33')]=qs[_0x8858('0x34')](_0x4e2459['query']['sort']);_0x2fa4f9[_0x8858('0x35')]=qs[_0x8858('0x2b')](_['pick'](_0x4e2459[_0x8858('0x29')],_0xba3171[_0x8858('0x2b')]),_0x89bec7);if(_0x4e2459[_0x8858('0x29')]['filter']){_0x2fa4f9['where']=_['merge'](_0x2fa4f9[_0x8858('0x35')],{'$or':_[_0x8858('0x28')](_0x89bec7,function(_0x341dae){if(_0x341dae[_0x8858('0x27')]!=='VIRTUAL'){var _0x1ed1e2={};_0x1ed1e2[_0x341dae[_0x8858('0x24')]]={'$like':'%'+_0x4e2459[_0x8858('0x29')][_0x8858('0x36')]+'%'};return _0x1ed1e2;}})});}_0x2fa4f9=_['merge']({},_0x2fa4f9,_0x4e2459[_0x8858('0x37')]);var _0x21903f={'where':_0x2fa4f9[_0x8858('0x35')]};return db[_0x8858('0x26')][_0x8858('0x1a')](_0x21903f)['then'](function(_0x33fd2f){_0x1aaae3[_0x8858('0x1a')]=_0x33fd2f;if(_0x4e2459[_0x8858('0x29')][_0x8858('0x38')]){_0x2fa4f9[_0x8858('0x39')]=[{'all':!![]}];}return db[_0x8858('0x26')][_0x8858('0x3a')](_0x2fa4f9);})[_0x8858('0x21')](function(_0x3cadbf){_0x1aaae3['rows']=_0x3cadbf;return _0x1aaae3;})[_0x8858('0x21')](respondWithFilteredResult(_0x3f9191,_0x2fa4f9))[_0x8858('0x3b')](handleError(_0x3f9191,null));};exports[_0x8858('0x3c')]=function(_0xc6b4db,_0x5d33d0){var _0x1bdead={'raw':!![],'where':{'id':_0xc6b4db['params']['id']}},_0x5e86bd={};_0x5e86bd[_0x8858('0x2d')]=_[_0x8858('0x2a')](db[_0x8858('0x26')][_0x8858('0x3d')]);_0x5e86bd[_0x8858('0x29')]=_['keys'](_0xc6b4db[_0x8858('0x29')]);_0x5e86bd[_0x8858('0x2b')]=_['intersection'](_0x5e86bd[_0x8858('0x2d')],_0x5e86bd[_0x8858('0x29')]);_0x1bdead[_0x8858('0x2f')]=_[_0x8858('0x2c')](_0x5e86bd[_0x8858('0x2d')],qs[_0x8858('0x2e')](_0xc6b4db[_0x8858('0x29')][_0x8858('0x2e')]));_0x1bdead[_0x8858('0x2f')]=_0x1bdead[_0x8858('0x2f')][_0x8858('0x30')]?_0x1bdead[_0x8858('0x2f')]:_0x5e86bd[_0x8858('0x2d')];if(_0xc6b4db[_0x8858('0x29')][_0x8858('0x38')]){_0x1bdead[_0x8858('0x39')]=[{'all':!![]}];}_0x1bdead=_[_0x8858('0x3e')]({},_0x1bdead,_0xc6b4db['options']);return db[_0x8858('0x26')][_0x8858('0x3f')](_0x1bdead)['then'](handleEntityNotFound(_0x5d33d0,null))[_0x8858('0x21')](respondWithResult(_0x5d33d0,null))['catch'](handleError(_0x5d33d0,null));};exports[_0x8858('0x40')]=function(_0x34217a,_0x166d4d){return db['SquareMessage'][_0x8858('0x40')](_0x34217a['body'],{})['then'](respondWithResult(_0x166d4d,0xc9))[_0x8858('0x3b')](handleError(_0x166d4d,null));};exports[_0x8858('0x41')]=function(_0xe41edd,_0x147d0e){if(_0xe41edd[_0x8858('0x42')]['id']){delete _0xe41edd[_0x8858('0x42')]['id'];}return db[_0x8858('0x26')][_0x8858('0x3f')]({'where':{'id':_0xe41edd['params']['id']}})['then'](handleEntityNotFound(_0x147d0e,null))[_0x8858('0x21')](saveUpdates(_0xe41edd[_0x8858('0x42')],null))[_0x8858('0x21')](respondWithResult(_0x147d0e,null))[_0x8858('0x3b')](handleError(_0x147d0e,null));};exports[_0x8858('0x43')]=function(_0x48a32c,_0x2df438){return db['SquareMessage'][_0x8858('0x3f')]({'where':{'id':_0x48a32c[_0x8858('0x44')]['id']}})[_0x8858('0x21')](handleEntityNotFound(_0x2df438,null))[_0x8858('0x21')](removeEntity(_0x2df438,null))[_0x8858('0x3b')](handleError(_0x2df438,null));}; \ No newline at end of file +var _0x9e38=['fields','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../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','stack','name','send','index','map','SquareMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes'];(function(_0x2ddfd9,_0x5877d0){var _0x2668f0=function(_0x70ad6f){while(--_0x70ad6f){_0x2ddfd9['push'](_0x2ddfd9['shift']());}};_0x2668f0(++_0x5877d0);}(_0x9e38,0x155));var _0x89e3=function(_0x4a095e,_0x381cd5){_0x4a095e=_0x4a095e-0x0;var _0x10ef73=_0x9e38[_0x4a095e];return _0x10ef73;};'use strict';var emlformat=require(_0x89e3('0x0'));var rimraf=require(_0x89e3('0x1'));var zipdir=require(_0x89e3('0x2'));var jsonpatch=require(_0x89e3('0x3'));var rp=require(_0x89e3('0x4'));var moment=require(_0x89e3('0x5'));var BPromise=require(_0x89e3('0x6'));var Mustache=require(_0x89e3('0x7'));var util=require(_0x89e3('0x8'));var path=require(_0x89e3('0x9'));var sox=require(_0x89e3('0xa'));var csv=require(_0x89e3('0xb'));var ejs=require(_0x89e3('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x89e3('0xd'));var squel=require(_0x89e3('0xe'));var crypto=require(_0x89e3('0xf'));var jsforce=require(_0x89e3('0x10'));var deskjs=require(_0x89e3('0x11'));var toCsv=require(_0x89e3('0xb'));var querystring=require(_0x89e3('0x12'));var Papa=require(_0x89e3('0x13'));var Redis=require(_0x89e3('0x14'));var authService=require(_0x89e3('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x89e3('0x16'));var hardwareService=require(_0x89e3('0x17'));var logger=require(_0x89e3('0x18'))(_0x89e3('0x19'));var utils=require('../../config/utils');var config=require(_0x89e3('0x1a'));var licenseUtil=require(_0x89e3('0x1b'));var db=require(_0x89e3('0x1c'))['db'];function respondWithStatusCode(_0x4b1b74,_0x1d84c5){_0x1d84c5=_0x1d84c5||0xcc;return function(_0x5317d9){if(_0x5317d9){return _0x4b1b74[_0x89e3('0x1d')](_0x1d84c5);}return _0x4b1b74[_0x89e3('0x1e')](_0x1d84c5)[_0x89e3('0x1f')]();};}function respondWithResult(_0x3a5ed4,_0x476d4e){_0x476d4e=_0x476d4e||0xc8;return function(_0x463b09){if(_0x463b09){return _0x3a5ed4[_0x89e3('0x1e')](_0x476d4e)[_0x89e3('0x20')](_0x463b09);}};}function respondWithFilteredResult(_0x2dea23,_0x722a17){return function(_0x3439bc){if(_0x3439bc){var _0x16742e=typeof _0x722a17[_0x89e3('0x21')]===_0x89e3('0x22')&&typeof _0x722a17[_0x89e3('0x23')]==='undefined';var _0x38688a=_0x3439bc['count'];var _0x5b41d9=_0x16742e?0x0:_0x722a17[_0x89e3('0x21')];var _0x5e3766=_0x16742e?_0x3439bc[_0x89e3('0x24')]:_0x722a17[_0x89e3('0x21')]+_0x722a17[_0x89e3('0x23')];var _0x1b475e;if(_0x5e3766>=_0x38688a){_0x5e3766=_0x38688a;_0x1b475e=0xc8;}else{_0x1b475e=0xce;}_0x2dea23[_0x89e3('0x1e')](_0x1b475e);return _0x2dea23['set'](_0x89e3('0x25'),_0x5b41d9+'-'+_0x5e3766+'/'+_0x38688a)[_0x89e3('0x20')](_0x3439bc);}return null;};}function patchUpdates(_0x5f51a5){return function(_0x2d9300){try{jsonpatch[_0x89e3('0x26')](_0x2d9300,_0x5f51a5,!![]);}catch(_0x5c07e2){return BPromise[_0x89e3('0x27')](_0x5c07e2);}return _0x2d9300[_0x89e3('0x28')]();};}function saveUpdates(_0x4c3f06,_0x207499){return function(_0x395864){if(_0x395864){return _0x395864[_0x89e3('0x29')](_0x4c3f06)[_0x89e3('0x2a')](function(_0x21045e){return _0x21045e;});}return null;};}function removeEntity(_0x531afe,_0x36772c){return function(_0x14a536){if(_0x14a536){return _0x14a536[_0x89e3('0x2b')]()[_0x89e3('0x2a')](function(){_0x531afe[_0x89e3('0x1e')](0xcc)[_0x89e3('0x1f')]();});}};}function handleEntityNotFound(_0x39e6d6,_0xfa7e01){return function(_0x3ed66f){if(!_0x3ed66f){_0x39e6d6[_0x89e3('0x1d')](0x194);}return _0x3ed66f;};}function handleError(_0x502b57,_0x2cccbc){_0x2cccbc=_0x2cccbc||0x1f4;return function(_0x109246){logger['error'](_0x109246[_0x89e3('0x2c')]);if(_0x109246[_0x89e3('0x2d')]){delete _0x109246[_0x89e3('0x2d')];}_0x502b57[_0x89e3('0x1e')](_0x2cccbc)[_0x89e3('0x2e')](_0x109246);};}exports[_0x89e3('0x2f')]=function(_0x1583c2,_0x11b276){var _0x349cb6={},_0x590904={},_0x24c2b6={'count':0x0,'rows':[]};var _0xc8366c=_[_0x89e3('0x30')](db[_0x89e3('0x31')][_0x89e3('0x32')],function(_0x121926){return{'name':_0x121926[_0x89e3('0x33')],'type':_0x121926['type'][_0x89e3('0x34')]};});_0x590904[_0x89e3('0x35')]=_[_0x89e3('0x30')](_0xc8366c,_0x89e3('0x2d'));_0x590904[_0x89e3('0x36')]=_[_0x89e3('0x37')](_0x1583c2['query']);_0x590904[_0x89e3('0x38')]=_[_0x89e3('0x39')](_0x590904['model'],_0x590904[_0x89e3('0x36')]);_0x349cb6[_0x89e3('0x3a')]=_[_0x89e3('0x39')](_0x590904[_0x89e3('0x35')],qs['fields'](_0x1583c2[_0x89e3('0x36')][_0x89e3('0x3b')]));_0x349cb6['attributes']=_0x349cb6['attributes']['length']?_0x349cb6['attributes']:_0x590904['model'];if(!_0x1583c2[_0x89e3('0x36')]['hasOwnProperty'](_0x89e3('0x3c'))){_0x349cb6['limit']=qs['limit'](_0x1583c2[_0x89e3('0x36')]['limit']);_0x349cb6[_0x89e3('0x21')]=qs[_0x89e3('0x21')](_0x1583c2[_0x89e3('0x36')][_0x89e3('0x21')]);}_0x349cb6[_0x89e3('0x3d')]=qs[_0x89e3('0x3e')](_0x1583c2['query']['sort']);_0x349cb6[_0x89e3('0x3f')]=qs[_0x89e3('0x38')](_['pick'](_0x1583c2[_0x89e3('0x36')],_0x590904[_0x89e3('0x38')]),_0xc8366c);if(_0x1583c2[_0x89e3('0x36')][_0x89e3('0x40')]){_0x349cb6[_0x89e3('0x3f')]=_[_0x89e3('0x41')](_0x349cb6[_0x89e3('0x3f')],{'$or':_[_0x89e3('0x30')](_0xc8366c,function(_0x2eb44f){if(_0x2eb44f[_0x89e3('0x42')]!==_0x89e3('0x43')){var _0x2609bb={};_0x2609bb[_0x2eb44f['name']]={'$like':'%'+_0x1583c2[_0x89e3('0x36')][_0x89e3('0x40')]+'%'};return _0x2609bb;}})});}_0x349cb6=_['merge']({},_0x349cb6,_0x1583c2[_0x89e3('0x44')]);var _0x175aec={'where':_0x349cb6[_0x89e3('0x3f')]};return db[_0x89e3('0x31')][_0x89e3('0x24')](_0x175aec)[_0x89e3('0x2a')](function(_0x4a260b){_0x24c2b6[_0x89e3('0x24')]=_0x4a260b;if(_0x1583c2[_0x89e3('0x36')][_0x89e3('0x45')]){_0x349cb6[_0x89e3('0x46')]=[{'all':!![]}];}return db[_0x89e3('0x31')][_0x89e3('0x47')](_0x349cb6);})[_0x89e3('0x2a')](function(_0x279c90){_0x24c2b6[_0x89e3('0x48')]=_0x279c90;return _0x24c2b6;})['then'](respondWithFilteredResult(_0x11b276,_0x349cb6))[_0x89e3('0x49')](handleError(_0x11b276,null));};exports[_0x89e3('0x4a')]=function(_0x45a8b0,_0x1b75f5){var _0x44594b={'raw':!![],'where':{'id':_0x45a8b0[_0x89e3('0x4b')]['id']}},_0x3ff8c7={};_0x3ff8c7['model']=_[_0x89e3('0x37')](db[_0x89e3('0x31')][_0x89e3('0x32')]);_0x3ff8c7[_0x89e3('0x36')]=_['keys'](_0x45a8b0[_0x89e3('0x36')]);_0x3ff8c7['filters']=_[_0x89e3('0x39')](_0x3ff8c7['model'],_0x3ff8c7[_0x89e3('0x36')]);_0x44594b[_0x89e3('0x3a')]=_[_0x89e3('0x39')](_0x3ff8c7['model'],qs['fields'](_0x45a8b0[_0x89e3('0x36')][_0x89e3('0x3b')]));_0x44594b['attributes']=_0x44594b[_0x89e3('0x3a')][_0x89e3('0x4c')]?_0x44594b[_0x89e3('0x3a')]:_0x3ff8c7['model'];if(_0x45a8b0[_0x89e3('0x36')][_0x89e3('0x45')]){_0x44594b['include']=[{'all':!![]}];}_0x44594b=_[_0x89e3('0x41')]({},_0x44594b,_0x45a8b0[_0x89e3('0x44')]);return db['SquareMessage'][_0x89e3('0x4d')](_0x44594b)['then'](handleEntityNotFound(_0x1b75f5,null))['then'](respondWithResult(_0x1b75f5,null))['catch'](handleError(_0x1b75f5,null));};exports['create']=function(_0x165968,_0x3a8160){return db[_0x89e3('0x31')][_0x89e3('0x4e')](_0x165968[_0x89e3('0x4f')],{})[_0x89e3('0x2a')](respondWithResult(_0x3a8160,0xc9))['catch'](handleError(_0x3a8160,null));};exports[_0x89e3('0x29')]=function(_0x4ed525,_0x29dca3){if(_0x4ed525[_0x89e3('0x4f')]['id']){delete _0x4ed525[_0x89e3('0x4f')]['id'];}return db['SquareMessage'][_0x89e3('0x4d')]({'where':{'id':_0x4ed525[_0x89e3('0x4b')]['id']}})[_0x89e3('0x2a')](handleEntityNotFound(_0x29dca3,null))[_0x89e3('0x2a')](saveUpdates(_0x4ed525[_0x89e3('0x4f')],null))['then'](respondWithResult(_0x29dca3,null))['catch'](handleError(_0x29dca3,null));};exports[_0x89e3('0x2b')]=function(_0x38cd02,_0x2f60ed){return db['SquareMessage'][_0x89e3('0x4d')]({'where':{'id':_0x38cd02[_0x89e3('0x4b')]['id']}})[_0x89e3('0x2a')](handleEntityNotFound(_0x2f60ed,null))[_0x89e3('0x2a')](removeEntity(_0x2f60ed,null))[_0x89e3('0x49')](handleError(_0x2f60ed,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index ba7bd31..8cd0ba3 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 _0x8f98=['exports','define','SquareMessage','square_messages','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./squareMessage.attributes'];(function(_0x4f4d47,_0x5b2321){var _0x4ffe85=function(_0x5ca693){while(--_0x5ca693){_0x4f4d47['push'](_0x4f4d47['shift']());}};_0x4ffe85(++_0x5b2321);}(_0x8f98,0x6c));var _0x88f9=function(_0x212ba2,_0x210212){_0x212ba2=_0x212ba2-0x0;var _0x3c6e1f=_0x8f98[_0x212ba2];return _0x3c6e1f;};'use strict';var _=require(_0x88f9('0x0'));var util=require(_0x88f9('0x1'));var logger=require(_0x88f9('0x2'))(_0x88f9('0x3'));var moment=require(_0x88f9('0x4'));var BPromise=require(_0x88f9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x88f9('0x6'));var config=require(_0x88f9('0x7'));var attributes=require(_0x88f9('0x8'));module[_0x88f9('0x9')]=function(_0x340efd,_0x325fc7){return _0x340efd[_0x88f9('0xa')](_0x88f9('0xb'),attributes,{'tableName':_0x88f9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb39e=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./squareMessage.attributes','SquareMessage','square_messages','lodash'];(function(_0x2daef6,_0xcac228){var _0x62d030=function(_0x26a7d6){while(--_0x26a7d6){_0x2daef6['push'](_0x2daef6['shift']());}};_0x62d030(++_0xcac228);}(_0xb39e,0x1af));var _0xeb39=function(_0x332264,_0x15ad59){_0x332264=_0x332264-0x0;var _0x214cd2=_0xb39e[_0x332264];return _0x214cd2;};'use strict';var _=require(_0xeb39('0x0'));var util=require(_0xeb39('0x1'));var logger=require(_0xeb39('0x2'))(_0xeb39('0x3'));var moment=require(_0xeb39('0x4'));var BPromise=require(_0xeb39('0x5'));var rp=require(_0xeb39('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeb39('0x7'));var config=require(_0xeb39('0x8'));var attributes=require(_0xeb39('0x9'));module['exports']=function(_0x26ff30,_0x8e12a1){return _0x26ff30['define'](_0xeb39('0xa'),attributes,{'tableName':_0xeb39('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 9939567..d8e0b0d 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 _0x5501=['request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareMessage,\x20%s,\x20%s','message','info','catch','CreateSquareMessage','create','body','options','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5501,0x138));var _0x1550=function(_0x32ff40,_0x1c80ca){_0x32ff40=_0x32ff40-0x0;var _0x19c160=_0x5501[_0x32ff40];return _0x19c160;};'use strict';var _=require(_0x1550('0x0'));var util=require(_0x1550('0x1'));var moment=require(_0x1550('0x2'));var BPromise=require(_0x1550('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1550('0x4'));var db=require(_0x1550('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1550('0x6'))(_0x1550('0x7'));var config=require(_0x1550('0x8'));var jayson=require(_0x1550('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x23510a,_0x4b2ed4,_0xf49069){return new BPromise(function(_0x19d240,_0x1e0f64){return client[_0x1550('0xa')](_0x23510a,_0xf49069)[_0x1550('0xb')](function(_0x22caf4){logger['info']('SquareMessage,\x20%s,\x20%s',_0x4b2ed4,_0x1550('0xc'));logger[_0x1550('0xd')](_0x1550('0xe'),_0x4b2ed4,_0x1550('0xc'),JSON[_0x1550('0xf')](_0x22caf4));if(_0x22caf4['error']){if(_0x22caf4[_0x1550('0x10')][_0x1550('0x11')]===0x1f4){logger[_0x1550('0x10')](_0x1550('0x12'),_0x4b2ed4,_0x22caf4[_0x1550('0x10')][_0x1550('0x13')]);return _0x1e0f64(_0x22caf4[_0x1550('0x10')]['message']);}logger['error'](_0x1550('0x12'),_0x4b2ed4,_0x22caf4[_0x1550('0x10')][_0x1550('0x13')]);return _0x19d240(_0x22caf4['error'][_0x1550('0x13')]);}else{logger[_0x1550('0x14')](_0x1550('0x12'),_0x4b2ed4,'request\x20sent');_0x19d240(_0x22caf4['result'][_0x1550('0x13')]);}})[_0x1550('0x15')](function(_0x78b558){logger[_0x1550('0x10')](_0x1550('0x12'),_0x4b2ed4,_0x78b558);_0x1e0f64(_0x78b558);});});}exports[_0x1550('0x16')]=function(_0x221a1a){var _0x5c52c6=this;return new Promise(function(_0x30d8ef,_0x4f8fbe){return db['SquareMessage'][_0x1550('0x17')](_0x221a1a[_0x1550('0x18')],{'raw':_0x221a1a[_0x1550('0x19')]?_0x221a1a[_0x1550('0x19')][_0x1550('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0xc22721){logger[_0x1550('0x14')](_0x1550('0x16'),_0x221a1a);logger[_0x1550('0xd')](_0x1550('0x16'),_0x221a1a,JSON[_0x1550('0xf')](_0xc22721));_0x30d8ef(_0xc22721);})[_0x1550('0x15')](function(_0x2c1930){logger[_0x1550('0x10')](_0x1550('0x16'),_0x2c1930[_0x1550('0x13')],_0x221a1a);_0x4f8fbe(_0x5c52c6[_0x1550('0x10')](0x1f4,_0x2c1930[_0x1550('0x13')]));});});}; \ No newline at end of file +var _0x5520=['bluebird','randomstring','ioredis','../../config/logger','jayson/promise','http','request','then','SquareMessage,\x20%s,\x20%s','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','SquareMessage','create','body','options','raw','info','CreateSquareMessage','debug','lodash','util'];(function(_0xcf581b,_0x4359dd){var _0x4f454d=function(_0x182d58){while(--_0x182d58){_0xcf581b['push'](_0xcf581b['shift']());}};_0x4f454d(++_0x4359dd);}(_0x5520,0x9a));var _0x0552=function(_0x578a25,_0x368f7a){_0x578a25=_0x578a25-0x0;var _0x2a6ec0=_0x5520[_0x578a25];return _0x2a6ec0;};'use strict';var _=require(_0x0552('0x0'));var util=require(_0x0552('0x1'));var moment=require('moment');var BPromise=require(_0x0552('0x2'));var rs=require(_0x0552('0x3'));var fs=require('fs');var Redis=require(_0x0552('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0552('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0552('0x6'));var client=jayson['client'][_0x0552('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x56130d,_0x5ba433,_0x2f9b0f){return new BPromise(function(_0xdcc167,_0x2764e9){return client[_0x0552('0x8')](_0x56130d,_0x2f9b0f)[_0x0552('0x9')](function(_0xc84821){logger['info'](_0x0552('0xa'),_0x5ba433,_0x0552('0xb'));logger['debug'](_0x0552('0xc'),_0x5ba433,_0x0552('0xb'),JSON[_0x0552('0xd')](_0xc84821));if(_0xc84821[_0x0552('0xe')]){if(_0xc84821[_0x0552('0xe')][_0x0552('0xf')]===0x1f4){logger[_0x0552('0xe')](_0x0552('0xa'),_0x5ba433,_0xc84821[_0x0552('0xe')][_0x0552('0x10')]);return _0x2764e9(_0xc84821[_0x0552('0xe')][_0x0552('0x10')]);}logger[_0x0552('0xe')](_0x0552('0xa'),_0x5ba433,_0xc84821['error'][_0x0552('0x10')]);return _0xdcc167(_0xc84821[_0x0552('0xe')][_0x0552('0x10')]);}else{logger['info'](_0x0552('0xa'),_0x5ba433,_0x0552('0xb'));_0xdcc167(_0xc84821['result'][_0x0552('0x10')]);}})[_0x0552('0x11')](function(_0x1024b4){logger[_0x0552('0xe')](_0x0552('0xa'),_0x5ba433,_0x1024b4);_0x2764e9(_0x1024b4);});});}exports['CreateSquareMessage']=function(_0x20bd60){var _0x441393=this;return new Promise(function(_0x49b07f,_0x1cebfc){return db[_0x0552('0x12')][_0x0552('0x13')](_0x20bd60[_0x0552('0x14')],{'raw':_0x20bd60[_0x0552('0x15')]?_0x20bd60['options'][_0x0552('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x380a1b){logger[_0x0552('0x17')](_0x0552('0x18'),_0x20bd60);logger[_0x0552('0x19')](_0x0552('0x18'),_0x20bd60,JSON[_0x0552('0xd')](_0x380a1b));_0x49b07f(_0x380a1b);})[_0x0552('0x11')](function(_0x4e5973){logger['error']('CreateSquareMessage',_0x4e5973[_0x0552('0x10')],_0x20bd60);_0x1cebfc(_0x441393['error'](0x1f4,_0x4e5973[_0x0552('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index a56cfc8..6d99b7d 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 _0x0bab=['index','get','/:id','isAuthenticated','show','/:id/test','15s','post','create','put','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../config/environment','./squareOdbc.controller'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x0bab,0x173));var _0xb0ba=function(_0x2e48fc,_0x26a77f){_0x2e48fc=_0x2e48fc-0x0;var _0x1978d8=_0x0bab[_0x2e48fc];return _0x1978d8;};'use strict';var multer=require('multer');var util=require(_0xb0ba('0x0'));var path=require(_0xb0ba('0x1'));var timeout=require('connect-timeout');var express=require(_0xb0ba('0x2'));var router=express[_0xb0ba('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb0ba('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb0ba('0x5'));var controller=require(_0xb0ba('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xb0ba('0x7')]);router[_0xb0ba('0x8')](_0xb0ba('0x9'),auth[_0xb0ba('0xa')](),controller[_0xb0ba('0xb')]);router[_0xb0ba('0x8')](_0xb0ba('0xc'),auth['isAuthenticated'](),timeout(_0xb0ba('0xd')),controller['test']);router[_0xb0ba('0xe')]('/',auth['isAuthenticated'](),controller[_0xb0ba('0xf')]);router[_0xb0ba('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xb0ba('0x11')]);router[_0xb0ba('0x12')](_0xb0ba('0x9'),auth[_0xb0ba('0xa')](),controller[_0xb0ba('0x13')]);module[_0xb0ba('0x14')]=router; \ No newline at end of file +var _0xfc4d=['index','show','/:id/test','15s','test','post','create','/:id','update','destroy','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x54a761,_0x431fd4){var _0x37d1da=function(_0x5ca617){while(--_0x5ca617){_0x54a761['push'](_0x54a761['shift']());}};_0x37d1da(++_0x431fd4);}(_0xfc4d,0x106));var _0xdfc4=function(_0x2e76a7,_0x23871a){_0x2e76a7=_0x2e76a7-0x0;var _0x454cde=_0xfc4d[_0x2e76a7];return _0x454cde;};'use strict';var multer=require('multer');var util=require(_0xdfc4('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xdfc4('0x1'));var router=express[_0xdfc4('0x2')]();var fs_extra=require(_0xdfc4('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xdfc4('0x4'));var config=require(_0xdfc4('0x5'));var controller=require('./squareOdbc.controller');router[_0xdfc4('0x6')]('/',auth[_0xdfc4('0x7')](),controller[_0xdfc4('0x8')]);router['get']('/:id',auth[_0xdfc4('0x7')](),controller[_0xdfc4('0x9')]);router['get'](_0xdfc4('0xa'),auth[_0xdfc4('0x7')](),timeout(_0xdfc4('0xb')),controller[_0xdfc4('0xc')]);router[_0xdfc4('0xd')]('/',auth[_0xdfc4('0x7')](),controller[_0xdfc4('0xe')]);router['put'](_0xdfc4('0xf'),auth[_0xdfc4('0x7')](),controller[_0xdfc4('0x10')]);router['delete'](_0xdfc4('0xf'),auth[_0xdfc4('0x7')](),controller[_0xdfc4('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 869ef88..c02c07c 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 _0x0f20=['sequelize','STRING','name'];(function(_0x43cee5,_0x2a6034){var _0x444f48=function(_0x3f4c65){while(--_0x3f4c65){_0x43cee5['push'](_0x43cee5['shift']());}};_0x444f48(++_0x2a6034);}(_0x0f20,0xa8));var _0x00f2=function(_0x5decd3,_0x1d9804){_0x5decd3=_0x5decd3-0x0;var _0x429117=_0x0f20[_0x5decd3];return _0x429117;};'use strict';var Sequelize=require(_0x00f2('0x0'));module['exports']={'name':{'type':Sequelize[_0x00f2('0x1')],'unique':_0x00f2('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x00f2('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x92c2=['name','STRING'];(function(_0x4312f5,_0x2b97d2){var _0x3b7766=function(_0x1ba92d){while(--_0x1ba92d){_0x4312f5['push'](_0x4312f5['shift']());}};_0x3b7766(++_0x2b97d2);}(_0x92c2,0x19d));var _0x292c=function(_0x15d581,_0xcb8174){_0x15d581=_0x15d581-0x0;var _0x562a96=_0x92c2[_0x15d581];return _0x562a96;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x292c('0x0')],'unique':_0x292c('0x1'),'allowNull':![]},'dsn':{'type':Sequelize[_0x292c('0x0')]},'description':{'type':Sequelize[_0x292c('0x0')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index a022d1a..53f1382 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 _0x4e31=['fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','status','end','offset','undefined','count','set','reject','update','then','destroy','ODBC','UserProfileResource','sendStatus','error','stack','name','send','index','map','SquareOdbc','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','merge','options','includeAll','include','findAll','show','params','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','dsn','odbc','openSync','closeSync','rimraf'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x4e31,0x1cd));var _0x14e3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4e31[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x14e3('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x14e3('0x1'));var rp=require(_0x14e3('0x2'));var moment=require('moment');var BPromise=require(_0x14e3('0x3'));var Mustache=require('mustache');var util=require(_0x14e3('0x4'));var path=require(_0x14e3('0x5'));var sox=require(_0x14e3('0x6'));var csv=require(_0x14e3('0x7'));var ejs=require(_0x14e3('0x8'));var fs=require('fs');var fs_extra=require(_0x14e3('0x9'));var _=require('lodash');var squel=require(_0x14e3('0xa'));var crypto=require(_0x14e3('0xb'));var jsforce=require(_0x14e3('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x14e3('0x7'));var querystring=require(_0x14e3('0xd'));var Papa=require(_0x14e3('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x14e3('0xf'));var hardwareService=require(_0x14e3('0x10'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c0018,_0x4f569e){_0x4f569e=_0x4f569e||0xcc;return function(_0x50b846){if(_0x50b846){return _0x4c0018['sendStatus'](_0x4f569e);}return _0x4c0018[_0x14e3('0x11')](_0x4f569e)[_0x14e3('0x12')]();};}function respondWithResult(_0x38d2fd,_0xaaddcb){_0xaaddcb=_0xaaddcb||0xc8;return function(_0x1e75e6){if(_0x1e75e6){return _0x38d2fd[_0x14e3('0x11')](_0xaaddcb)['json'](_0x1e75e6);}};}function respondWithFilteredResult(_0x3f8f3d,_0x38ac49){return function(_0x104050){if(_0x104050){var _0x5d7b6c=typeof _0x38ac49[_0x14e3('0x13')]===_0x14e3('0x14')&&typeof _0x38ac49['limit']==='undefined';var _0x4a3155=_0x104050['count'];var _0xc3dfa=_0x5d7b6c?0x0:_0x38ac49[_0x14e3('0x13')];var _0x51a067=_0x5d7b6c?_0x104050[_0x14e3('0x15')]:_0x38ac49[_0x14e3('0x13')]+_0x38ac49['limit'];var _0x1de242;if(_0x51a067>=_0x4a3155){_0x51a067=_0x4a3155;_0x1de242=0xc8;}else{_0x1de242=0xce;}_0x3f8f3d['status'](_0x1de242);return _0x3f8f3d[_0x14e3('0x16')]('Content-Range',_0xc3dfa+'-'+_0x51a067+'/'+_0x4a3155)['json'](_0x104050);}return null;};}function patchUpdates(_0x424445){return function(_0x3805a0){try{jsonpatch['apply'](_0x3805a0,_0x424445,!![]);}catch(_0x46707e){return BPromise[_0x14e3('0x17')](_0x46707e);}return _0x3805a0['save']();};}function saveUpdates(_0x41956e,_0x3ee210){return function(_0x30edb6){if(_0x30edb6){return _0x30edb6[_0x14e3('0x18')](_0x41956e)[_0x14e3('0x19')](function(_0x28c493){return _0x28c493;});}return null;};}function removeEntity(_0x343a7d,_0x11b2ef){return function(_0x1c1e17){if(_0x1c1e17){return _0x1c1e17[_0x14e3('0x1a')]()[_0x14e3('0x19')](function(){var _0xa0ab21=_0x1c1e17['get']({'plain':!![]});var _0x44532d=_0x14e3('0x1b');return db[_0x14e3('0x1c')][_0x14e3('0x1a')]({'where':{'type':_0x44532d,'resourceId':_0xa0ab21['id']}})[_0x14e3('0x19')](function(){return _0x1c1e17;});})['then'](function(){_0x343a7d['status'](0xcc)[_0x14e3('0x12')]();});}};}function handleEntityNotFound(_0x3e3fad,_0xae93e3){return function(_0x96cfa2){if(!_0x96cfa2){_0x3e3fad[_0x14e3('0x1d')](0x194);}return _0x96cfa2;};}function handleError(_0x12afba,_0x51cff3){_0x51cff3=_0x51cff3||0x1f4;return function(_0x124db6){logger[_0x14e3('0x1e')](_0x124db6[_0x14e3('0x1f')]);if(_0x124db6[_0x14e3('0x20')]){delete _0x124db6[_0x14e3('0x20')];}_0x12afba['status'](_0x51cff3)[_0x14e3('0x21')](_0x124db6);};}exports[_0x14e3('0x22')]=function(_0x393d36,_0x2d9b3f){var _0x1082e0={},_0x5786a2={},_0x38794b={'count':0x0,'rows':[]};var _0x219524=_[_0x14e3('0x23')](db[_0x14e3('0x24')][_0x14e3('0x25')],function(_0x3e1503){return{'name':_0x3e1503[_0x14e3('0x26')],'type':_0x3e1503['type'][_0x14e3('0x27')]};});_0x5786a2['model']=_[_0x14e3('0x23')](_0x219524,_0x14e3('0x20'));_0x5786a2['query']=_[_0x14e3('0x28')](_0x393d36[_0x14e3('0x29')]);_0x5786a2[_0x14e3('0x2a')]=_[_0x14e3('0x2b')](_0x5786a2[_0x14e3('0x2c')],_0x5786a2[_0x14e3('0x29')]);_0x1082e0[_0x14e3('0x2d')]=_['intersection'](_0x5786a2[_0x14e3('0x2c')],qs[_0x14e3('0x2e')](_0x393d36[_0x14e3('0x29')][_0x14e3('0x2e')]));_0x1082e0['attributes']=_0x1082e0[_0x14e3('0x2d')][_0x14e3('0x2f')]?_0x1082e0[_0x14e3('0x2d')]:_0x5786a2['model'];if(!_0x393d36['query'][_0x14e3('0x30')](_0x14e3('0x31'))){_0x1082e0['limit']=qs['limit'](_0x393d36['query']['limit']);_0x1082e0[_0x14e3('0x13')]=qs[_0x14e3('0x13')](_0x393d36[_0x14e3('0x29')][_0x14e3('0x13')]);}_0x1082e0[_0x14e3('0x32')]=qs[_0x14e3('0x33')](_0x393d36[_0x14e3('0x29')]['sort']);_0x1082e0[_0x14e3('0x34')]=qs[_0x14e3('0x2a')](_[_0x14e3('0x35')](_0x393d36[_0x14e3('0x29')],_0x5786a2[_0x14e3('0x2a')]),_0x219524);if(_0x393d36[_0x14e3('0x29')][_0x14e3('0x36')]){_0x1082e0[_0x14e3('0x34')]=_['merge'](_0x1082e0[_0x14e3('0x34')],{'$or':_[_0x14e3('0x23')](_0x219524,function(_0x1fed1d){if(_0x1fed1d[_0x14e3('0x37')]!=='VIRTUAL'){var _0x5bedab={};_0x5bedab[_0x1fed1d['name']]={'$like':'%'+_0x393d36['query'][_0x14e3('0x36')]+'%'};return _0x5bedab;}})});}_0x1082e0=_[_0x14e3('0x38')]({},_0x1082e0,_0x393d36[_0x14e3('0x39')]);var _0x12ec2d={'where':_0x1082e0[_0x14e3('0x34')]};return db[_0x14e3('0x24')][_0x14e3('0x15')](_0x12ec2d)[_0x14e3('0x19')](function(_0x2c3537){_0x38794b[_0x14e3('0x15')]=_0x2c3537;if(_0x393d36['query'][_0x14e3('0x3a')]){_0x1082e0[_0x14e3('0x3b')]=[{'all':!![]}];}return db[_0x14e3('0x24')][_0x14e3('0x3c')](_0x1082e0);})[_0x14e3('0x19')](function(_0x28a006){_0x38794b['rows']=_0x28a006;return _0x38794b;})[_0x14e3('0x19')](respondWithFilteredResult(_0x2d9b3f,_0x1082e0))['catch'](handleError(_0x2d9b3f,null));};exports[_0x14e3('0x3d')]=function(_0x4ded3f,_0x2ee5ac){var _0x1255ef={'raw':!![],'where':{'id':_0x4ded3f[_0x14e3('0x3e')]['id']}},_0x178efd={};_0x178efd[_0x14e3('0x2c')]=_[_0x14e3('0x28')](db[_0x14e3('0x24')][_0x14e3('0x25')]);_0x178efd[_0x14e3('0x29')]=_[_0x14e3('0x28')](_0x4ded3f[_0x14e3('0x29')]);_0x178efd[_0x14e3('0x2a')]=_[_0x14e3('0x2b')](_0x178efd['model'],_0x178efd['query']);_0x1255ef[_0x14e3('0x2d')]=_['intersection'](_0x178efd[_0x14e3('0x2c')],qs[_0x14e3('0x2e')](_0x4ded3f[_0x14e3('0x29')][_0x14e3('0x2e')]));_0x1255ef[_0x14e3('0x2d')]=_0x1255ef[_0x14e3('0x2d')][_0x14e3('0x2f')]?_0x1255ef[_0x14e3('0x2d')]:_0x178efd[_0x14e3('0x2c')];if(_0x4ded3f[_0x14e3('0x29')][_0x14e3('0x3a')]){_0x1255ef[_0x14e3('0x3b')]=[{'all':!![]}];}_0x1255ef=_[_0x14e3('0x38')]({},_0x1255ef,_0x4ded3f[_0x14e3('0x39')]);return db[_0x14e3('0x24')]['find'](_0x1255ef)[_0x14e3('0x19')](handleEntityNotFound(_0x2ee5ac,null))[_0x14e3('0x19')](respondWithResult(_0x2ee5ac,null))[_0x14e3('0x3f')](handleError(_0x2ee5ac,null));};exports[_0x14e3('0x40')]=function(_0x11170e,_0x388342){return db['SquareOdbc']['create'](_0x11170e[_0x14e3('0x41')],{})['then'](function(_0x3dc051){var _0xe54873=_0x11170e[_0x14e3('0x42')][_0x14e3('0x43')]({'plain':!![]});if(!_0xe54873)throw new Error(_0x14e3('0x44'));if(_0xe54873[_0x14e3('0x45')]===_0x14e3('0x42')){var _0x552429=_0x3dc051[_0x14e3('0x43')]({'plain':!![]});var _0x5d9844=_0x14e3('0x1b');return db['UserProfileSection']['find']({'where':{'name':_0x5d9844,'userProfileId':_0xe54873['userProfileId']},'raw':!![]})[_0x14e3('0x19')](function(_0x128730){if(_0x128730&&_0x128730[_0x14e3('0x46')]===0x0){return db[_0x14e3('0x1c')][_0x14e3('0x40')]({'name':_0x552429[_0x14e3('0x20')],'resourceId':_0x552429['id'],'type':_0x128730[_0x14e3('0x20')],'sectionId':_0x128730['id']},{})[_0x14e3('0x19')](function(){return _0x3dc051;});}else{return _0x3dc051;}})[_0x14e3('0x3f')](function(_0x44cfb2){logger[_0x14e3('0x1e')](_0x14e3('0x47'),_0x44cfb2);throw _0x44cfb2;});}return _0x3dc051;})[_0x14e3('0x19')](respondWithResult(_0x388342,0xc9))['catch'](handleError(_0x388342,null));};exports[_0x14e3('0x18')]=function(_0x124091,_0x3b7eb0){if(_0x124091['body']['id']){delete _0x124091[_0x14e3('0x41')]['id'];}return db[_0x14e3('0x24')]['find']({'where':{'id':_0x124091[_0x14e3('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3b7eb0,null))[_0x14e3('0x19')](saveUpdates(_0x124091['body'],null))['then'](respondWithResult(_0x3b7eb0,null))[_0x14e3('0x3f')](handleError(_0x3b7eb0,null));};exports[_0x14e3('0x1a')]=function(_0x459d96,_0x25bc17){return db[_0x14e3('0x24')]['find']({'where':{'id':_0x459d96[_0x14e3('0x3e')]['id']}})['then'](handleEntityNotFound(_0x25bc17,null))[_0x14e3('0x19')](removeEntity(_0x25bc17,null))[_0x14e3('0x3f')](handleError(_0x25bc17,null));};exports['test']=function(_0x3af54a,_0x2703f1,_0x5c3306){var _0x2e91c8;return db[_0x14e3('0x24')][_0x14e3('0x48')]({'where':{'id':_0x3af54a[_0x14e3('0x3e')]['id']},'attributes':['id',_0x14e3('0x49')]})[_0x14e3('0x19')](handleEntityNotFound(_0x2703f1,null))[_0x14e3('0x19')](function(_0x2c2660){if(_0x2c2660){var _0x848ae2=require(_0x14e3('0x4a'))();_0x848ae2[_0x14e3('0x4b')](_0x2c2660['dsn']);_0x848ae2[_0x14e3('0x4c')]();return _0x2c2660;}})['then'](respondWithResult(_0x2703f1,null))[_0x14e3('0x3f')](handleError(_0x2703f1,null));}; \ No newline at end of file +var _0xb7eb=['sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','SquareOdbc','findAll','show','params','intersection','find','catch','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','odbc','openSync','dsn','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','get','ODBC','UserProfileResource','error','name','map','rawAttributes','fieldName','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x2bbad9,_0x1f3892){var _0x1683cb=function(_0x262672){while(--_0x262672){_0x2bbad9['push'](_0x2bbad9['shift']());}};_0x1683cb(++_0x1f3892);}(_0xb7eb,0x161));var _0xbb7e=function(_0x1b7ba8,_0x37c361){_0x1b7ba8=_0x1b7ba8-0x0;var _0x2dfb8b=_0xb7eb[_0x1b7ba8];return _0x2dfb8b;};'use strict';var emlformat=require(_0xbb7e('0x0'));var rimraf=require(_0xbb7e('0x1'));var zipdir=require(_0xbb7e('0x2'));var jsonpatch=require(_0xbb7e('0x3'));var rp=require(_0xbb7e('0x4'));var moment=require('moment');var BPromise=require(_0xbb7e('0x5'));var Mustache=require(_0xbb7e('0x6'));var util=require(_0xbb7e('0x7'));var path=require(_0xbb7e('0x8'));var sox=require(_0xbb7e('0x9'));var csv=require(_0xbb7e('0xa'));var ejs=require(_0xbb7e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xbb7e('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbb7e('0xa'));var querystring=require('querystring');var Papa=require(_0xbb7e('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbb7e('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbb7e('0xf'))('api');var utils=require(_0xbb7e('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0xbb7e('0x11'));var db=require(_0xbb7e('0x12'))['db'];function respondWithStatusCode(_0x14a12e,_0x38206c){_0x38206c=_0x38206c||0xcc;return function(_0x17079c){if(_0x17079c){return _0x14a12e[_0xbb7e('0x13')](_0x38206c);}return _0x14a12e['status'](_0x38206c)[_0xbb7e('0x14')]();};}function respondWithResult(_0x4fe86d,_0x428800){_0x428800=_0x428800||0xc8;return function(_0x4edac6){if(_0x4edac6){return _0x4fe86d['status'](_0x428800)[_0xbb7e('0x15')](_0x4edac6);}};}function respondWithFilteredResult(_0x157397,_0x2039bb){return function(_0xd7af71){if(_0xd7af71){var _0x1126a2=typeof _0x2039bb[_0xbb7e('0x16')]===_0xbb7e('0x17')&&typeof _0x2039bb[_0xbb7e('0x18')]===_0xbb7e('0x17');var _0x3805e0=_0xd7af71[_0xbb7e('0x19')];var _0x4c0064=_0x1126a2?0x0:_0x2039bb[_0xbb7e('0x16')];var _0x412c03=_0x1126a2?_0xd7af71[_0xbb7e('0x19')]:_0x2039bb[_0xbb7e('0x16')]+_0x2039bb[_0xbb7e('0x18')];var _0x533e8b;if(_0x412c03>=_0x3805e0){_0x412c03=_0x3805e0;_0x533e8b=0xc8;}else{_0x533e8b=0xce;}_0x157397[_0xbb7e('0x1a')](_0x533e8b);return _0x157397[_0xbb7e('0x1b')](_0xbb7e('0x1c'),_0x4c0064+'-'+_0x412c03+'/'+_0x3805e0)['json'](_0xd7af71);}return null;};}function patchUpdates(_0x36a840){return function(_0x160f07){try{jsonpatch[_0xbb7e('0x1d')](_0x160f07,_0x36a840,!![]);}catch(_0xc404d0){return BPromise[_0xbb7e('0x1e')](_0xc404d0);}return _0x160f07[_0xbb7e('0x1f')]();};}function saveUpdates(_0x8294cc,_0x50fc93){return function(_0x475f86){if(_0x475f86){return _0x475f86[_0xbb7e('0x20')](_0x8294cc)[_0xbb7e('0x21')](function(_0x25217c){return _0x25217c;});}return null;};}function removeEntity(_0x4c99b7,_0x34889d){return function(_0x2f492b){if(_0x2f492b){return _0x2f492b[_0xbb7e('0x22')]()[_0xbb7e('0x21')](function(){var _0x153e5c=_0x2f492b[_0xbb7e('0x23')]({'plain':!![]});var _0x41aa86=_0xbb7e('0x24');return db[_0xbb7e('0x25')][_0xbb7e('0x22')]({'where':{'type':_0x41aa86,'resourceId':_0x153e5c['id']}})['then'](function(){return _0x2f492b;});})[_0xbb7e('0x21')](function(){_0x4c99b7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x28763a,_0xfa1dff){return function(_0x123b95){if(!_0x123b95){_0x28763a['sendStatus'](0x194);}return _0x123b95;};}function handleError(_0x2e86e9,_0x2c248a){_0x2c248a=_0x2c248a||0x1f4;return function(_0x4454fc){logger[_0xbb7e('0x26')](_0x4454fc['stack']);if(_0x4454fc[_0xbb7e('0x27')]){delete _0x4454fc[_0xbb7e('0x27')];}_0x2e86e9[_0xbb7e('0x1a')](_0x2c248a)['send'](_0x4454fc);};}exports['index']=function(_0x16c304,_0x351a4e){var _0x21c539={},_0x2cc383={},_0x4f5122={'count':0x0,'rows':[]};var _0x1f8e75=_[_0xbb7e('0x28')](db['SquareOdbc'][_0xbb7e('0x29')],function(_0x4446ef){return{'name':_0x4446ef[_0xbb7e('0x2a')],'type':_0x4446ef['type']['key']};});_0x2cc383[_0xbb7e('0x2b')]=_[_0xbb7e('0x28')](_0x1f8e75,_0xbb7e('0x27'));_0x2cc383[_0xbb7e('0x2c')]=_[_0xbb7e('0x2d')](_0x16c304[_0xbb7e('0x2c')]);_0x2cc383['filters']=_['intersection'](_0x2cc383[_0xbb7e('0x2b')],_0x2cc383[_0xbb7e('0x2c')]);_0x21c539[_0xbb7e('0x2e')]=_['intersection'](_0x2cc383['model'],qs[_0xbb7e('0x2f')](_0x16c304['query'][_0xbb7e('0x2f')]));_0x21c539[_0xbb7e('0x2e')]=_0x21c539[_0xbb7e('0x2e')][_0xbb7e('0x30')]?_0x21c539[_0xbb7e('0x2e')]:_0x2cc383[_0xbb7e('0x2b')];if(!_0x16c304[_0xbb7e('0x2c')][_0xbb7e('0x31')](_0xbb7e('0x32'))){_0x21c539[_0xbb7e('0x18')]=qs[_0xbb7e('0x18')](_0x16c304[_0xbb7e('0x2c')][_0xbb7e('0x18')]);_0x21c539[_0xbb7e('0x16')]=qs['offset'](_0x16c304[_0xbb7e('0x2c')][_0xbb7e('0x16')]);}_0x21c539[_0xbb7e('0x33')]=qs[_0xbb7e('0x34')](_0x16c304[_0xbb7e('0x2c')]['sort']);_0x21c539[_0xbb7e('0x35')]=qs[_0xbb7e('0x36')](_[_0xbb7e('0x37')](_0x16c304['query'],_0x2cc383[_0xbb7e('0x36')]),_0x1f8e75);if(_0x16c304[_0xbb7e('0x2c')][_0xbb7e('0x38')]){_0x21c539['where']=_[_0xbb7e('0x39')](_0x21c539[_0xbb7e('0x35')],{'$or':_['map'](_0x1f8e75,function(_0x263ded){if(_0x263ded[_0xbb7e('0x3a')]!==_0xbb7e('0x3b')){var _0x442244={};_0x442244[_0x263ded['name']]={'$like':'%'+_0x16c304[_0xbb7e('0x2c')][_0xbb7e('0x38')]+'%'};return _0x442244;}})});}_0x21c539=_[_0xbb7e('0x39')]({},_0x21c539,_0x16c304[_0xbb7e('0x3c')]);var _0x2c873f={'where':_0x21c539[_0xbb7e('0x35')]};return db['SquareOdbc']['count'](_0x2c873f)['then'](function(_0x59d446){_0x4f5122['count']=_0x59d446;if(_0x16c304[_0xbb7e('0x2c')][_0xbb7e('0x3d')]){_0x21c539[_0xbb7e('0x3e')]=[{'all':!![]}];}return db[_0xbb7e('0x3f')][_0xbb7e('0x40')](_0x21c539);})[_0xbb7e('0x21')](function(_0x1c3ccf){_0x4f5122['rows']=_0x1c3ccf;return _0x4f5122;})[_0xbb7e('0x21')](respondWithFilteredResult(_0x351a4e,_0x21c539))['catch'](handleError(_0x351a4e,null));};exports[_0xbb7e('0x41')]=function(_0x492c87,_0x39c944){var _0x4ad899={'raw':!![],'where':{'id':_0x492c87[_0xbb7e('0x42')]['id']}},_0x14514e={};_0x14514e[_0xbb7e('0x2b')]=_[_0xbb7e('0x2d')](db[_0xbb7e('0x3f')][_0xbb7e('0x29')]);_0x14514e['query']=_[_0xbb7e('0x2d')](_0x492c87[_0xbb7e('0x2c')]);_0x14514e[_0xbb7e('0x36')]=_['intersection'](_0x14514e[_0xbb7e('0x2b')],_0x14514e[_0xbb7e('0x2c')]);_0x4ad899['attributes']=_[_0xbb7e('0x43')](_0x14514e['model'],qs[_0xbb7e('0x2f')](_0x492c87[_0xbb7e('0x2c')][_0xbb7e('0x2f')]));_0x4ad899['attributes']=_0x4ad899[_0xbb7e('0x2e')]['length']?_0x4ad899['attributes']:_0x14514e[_0xbb7e('0x2b')];if(_0x492c87[_0xbb7e('0x2c')][_0xbb7e('0x3d')]){_0x4ad899[_0xbb7e('0x3e')]=[{'all':!![]}];}_0x4ad899=_[_0xbb7e('0x39')]({},_0x4ad899,_0x492c87[_0xbb7e('0x3c')]);return db[_0xbb7e('0x3f')][_0xbb7e('0x44')](_0x4ad899)[_0xbb7e('0x21')](handleEntityNotFound(_0x39c944,null))[_0xbb7e('0x21')](respondWithResult(_0x39c944,null))[_0xbb7e('0x45')](handleError(_0x39c944,null));};exports[_0xbb7e('0x46')]=function(_0x4ad285,_0x1091bf){return db['SquareOdbc']['create'](_0x4ad285[_0xbb7e('0x47')],{})['then'](function(_0x3abb70){var _0xf3281=_0x4ad285['user']['get']({'plain':!![]});if(!_0xf3281)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xf3281[_0xbb7e('0x48')]===_0xbb7e('0x49')){var _0x4253af=_0x3abb70['get']({'plain':!![]});var _0x3ba9f6=_0xbb7e('0x24');return db[_0xbb7e('0x4a')][_0xbb7e('0x44')]({'where':{'name':_0x3ba9f6,'userProfileId':_0xf3281[_0xbb7e('0x4b')]},'raw':!![]})['then'](function(_0x33d0d2){if(_0x33d0d2&&_0x33d0d2[_0xbb7e('0x4c')]===0x0){return db['UserProfileResource'][_0xbb7e('0x46')]({'name':_0x4253af[_0xbb7e('0x27')],'resourceId':_0x4253af['id'],'type':_0x33d0d2[_0xbb7e('0x27')],'sectionId':_0x33d0d2['id']},{})[_0xbb7e('0x21')](function(){return _0x3abb70;});}else{return _0x3abb70;}})[_0xbb7e('0x45')](function(_0x11df73){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x11df73);throw _0x11df73;});}return _0x3abb70;})[_0xbb7e('0x21')](respondWithResult(_0x1091bf,0xc9))[_0xbb7e('0x45')](handleError(_0x1091bf,null));};exports[_0xbb7e('0x20')]=function(_0x35a9d6,_0x3e5c3b){if(_0x35a9d6[_0xbb7e('0x47')]['id']){delete _0x35a9d6['body']['id'];}return db['SquareOdbc'][_0xbb7e('0x44')]({'where':{'id':_0x35a9d6['params']['id']}})[_0xbb7e('0x21')](handleEntityNotFound(_0x3e5c3b,null))[_0xbb7e('0x21')](saveUpdates(_0x35a9d6[_0xbb7e('0x47')],null))[_0xbb7e('0x21')](respondWithResult(_0x3e5c3b,null))[_0xbb7e('0x45')](handleError(_0x3e5c3b,null));};exports[_0xbb7e('0x22')]=function(_0x4fe65c,_0x4e21c7){return db[_0xbb7e('0x3f')][_0xbb7e('0x44')]({'where':{'id':_0x4fe65c[_0xbb7e('0x42')]['id']}})['then'](handleEntityNotFound(_0x4e21c7,null))['then'](removeEntity(_0x4e21c7,null))[_0xbb7e('0x45')](handleError(_0x4e21c7,null));};exports['test']=function(_0x487d6e,_0x2f2866,_0x198a9e){var _0x3218f5;return db[_0xbb7e('0x3f')][_0xbb7e('0x44')]({'where':{'id':_0x487d6e[_0xbb7e('0x42')]['id']},'attributes':['id','dsn']})[_0xbb7e('0x21')](handleEntityNotFound(_0x2f2866,null))['then'](function(_0x467657){if(_0x467657){var _0x46a41d=require(_0xbb7e('0x4d'))();_0x46a41d[_0xbb7e('0x4e')](_0x467657[_0xbb7e('0x4f')]);_0x46a41d[_0xbb7e('0x50')]();return _0x467657;}})[_0xbb7e('0x21')](respondWithResult(_0x2f2866,null))[_0xbb7e('0x45')](handleError(_0x2f2866,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 6c0e912..0082eeb 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 _0x65b5=['bluebird','path','../../config/environment','./squareOdbc.attributes','exports','define','lodash','util','../../config/logger','moment'];(function(_0x5d16c2,_0x36abeb){var _0x992c8e=function(_0x3251a9){while(--_0x3251a9){_0x5d16c2['push'](_0x5d16c2['shift']());}};_0x992c8e(++_0x36abeb);}(_0x65b5,0x15a));var _0x565b=function(_0x5a43c3,_0x55cc14){_0x5a43c3=_0x5a43c3-0x0;var _0x28b9b3=_0x65b5[_0x5a43c3];return _0x28b9b3;};'use strict';var _=require(_0x565b('0x0'));var util=require(_0x565b('0x1'));var logger=require(_0x565b('0x2'))('api');var moment=require(_0x565b('0x3'));var BPromise=require(_0x565b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x565b('0x5'));var rimraf=require('rimraf');var config=require(_0x565b('0x6'));var attributes=require(_0x565b('0x7'));module[_0x565b('0x8')]=function(_0x4b257b,_0x571fb9){return _0x4b257b[_0x565b('0x9')]('SquareOdbc',attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2522=['rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x18bd0a,_0x5b2cb6){var _0xf42ae9=function(_0x442bfe){while(--_0x442bfe){_0x18bd0a['push'](_0x18bd0a['shift']());}};_0xf42ae9(++_0x5b2cb6);}(_0x2522,0x1e3));var _0x2252=function(_0x1312d9,_0x1f358c){_0x1312d9=_0x1312d9-0x0;var _0x450456=_0x2522[_0x1312d9];return _0x450456;};'use strict';var _=require(_0x2252('0x0'));var util=require(_0x2252('0x1'));var logger=require('../../config/logger')(_0x2252('0x2'));var moment=require(_0x2252('0x3'));var BPromise=require(_0x2252('0x4'));var rp=require(_0x2252('0x5'));var fs=require('fs');var path=require(_0x2252('0x6'));var rimraf=require(_0x2252('0x7'));var config=require(_0x2252('0x8'));var attributes=require(_0x2252('0x9'));module[_0x2252('0xa')]=function(_0x3ee900,_0x5baf08){return _0x3ee900[_0x2252('0xb')](_0x2252('0xc'),attributes,{'tableName':_0x2252('0xd'),'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 3f4b6b7..1e9dc63 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 _0xfbd2=['find','options','where','map','include','model','attributes','ShowSquareOdbc','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','request','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SquareOdbc'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xfbd2,0x17c));var _0x2fbd=function(_0x235c76,_0x5ad124){_0x235c76=_0x235c76-0x0;var _0x2e0e0c=_0xfbd2[_0x235c76];return _0x2e0e0c;};'use strict';var _=require(_0x2fbd('0x0'));var util=require(_0x2fbd('0x1'));var moment=require(_0x2fbd('0x2'));var BPromise=require(_0x2fbd('0x3'));var rs=require(_0x2fbd('0x4'));var fs=require('fs');var Redis=require(_0x2fbd('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2fbd('0x6'));var config=require(_0x2fbd('0x7'));var jayson=require(_0x2fbd('0x8'));var client=jayson[_0x2fbd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x301b0c,_0x376736,_0x2e5b07){return new BPromise(function(_0x629f9b,_0x4206cf){return client[_0x2fbd('0xa')](_0x301b0c,_0x2e5b07)['then'](function(_0xa67ecc){logger[_0x2fbd('0xb')](_0x2fbd('0xc'),_0x376736,_0x2fbd('0xd'));logger[_0x2fbd('0xe')](_0x2fbd('0xf'),_0x376736,'request\x20sent',JSON[_0x2fbd('0x10')](_0xa67ecc));if(_0xa67ecc[_0x2fbd('0x11')]){if(_0xa67ecc[_0x2fbd('0x11')][_0x2fbd('0x12')]===0x1f4){logger['error'](_0x2fbd('0xc'),_0x376736,_0xa67ecc['error'][_0x2fbd('0x13')]);return _0x4206cf(_0xa67ecc[_0x2fbd('0x11')]['message']);}logger[_0x2fbd('0x11')]('SquareOdbc,\x20%s,\x20%s',_0x376736,_0xa67ecc['error'][_0x2fbd('0x13')]);return _0x629f9b(_0xa67ecc[_0x2fbd('0x11')][_0x2fbd('0x13')]);}else{logger['info'](_0x2fbd('0xc'),_0x376736,'request\x20sent');_0x629f9b(_0xa67ecc[_0x2fbd('0x14')][_0x2fbd('0x13')]);}})[_0x2fbd('0x15')](function(_0x5b0ff6){logger[_0x2fbd('0x11')](_0x2fbd('0xc'),_0x376736,_0x5b0ff6);_0x4206cf(_0x5b0ff6);});});}exports['ShowSquareOdbc']=function(_0x58e4c3){var _0x4fe5f3=this;return new Promise(function(_0x22e8a1,_0x3f1c60){return db[_0x2fbd('0x16')][_0x2fbd('0x17')]({'raw':_0x58e4c3[_0x2fbd('0x18')]?_0x58e4c3[_0x2fbd('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x58e4c3[_0x2fbd('0x18')]?_0x58e4c3['options'][_0x2fbd('0x19')]||null:null,'attributes':_0x58e4c3[_0x2fbd('0x18')]?_0x58e4c3[_0x2fbd('0x18')]['attributes']||null:null,'include':_0x58e4c3['options']?_0x58e4c3[_0x2fbd('0x18')]['include']?_[_0x2fbd('0x1a')](_0x58e4c3[_0x2fbd('0x18')][_0x2fbd('0x1b')],function(_0x2c5092){return{'model':db[_0x2c5092[_0x2fbd('0x1c')]],'as':_0x2c5092['as'],'attributes':_0x2c5092[_0x2fbd('0x1d')],'include':_0x2c5092['include']?_[_0x2fbd('0x1a')](_0x2c5092[_0x2fbd('0x1b')],function(_0x4e03c0){return{'model':db[_0x4e03c0['model']],'as':_0x4e03c0['as'],'attributes':_0x4e03c0['attributes'],'include':_0x4e03c0[_0x2fbd('0x1b')]?_[_0x2fbd('0x1a')](_0x4e03c0[_0x2fbd('0x1b')],function(_0x15b41d){return{'model':db[_0x15b41d[_0x2fbd('0x1c')]],'as':_0x15b41d['as'],'attributes':_0x15b41d[_0x2fbd('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x7e0b99){logger[_0x2fbd('0xb')](_0x2fbd('0x1e'),_0x58e4c3);logger[_0x2fbd('0xe')](_0x2fbd('0x1e'),_0x58e4c3,JSON[_0x2fbd('0x10')](_0x7e0b99));_0x22e8a1(_0x7e0b99);})[_0x2fbd('0x15')](function(_0x8a9b3c){logger[_0x2fbd('0x11')](_0x2fbd('0x1e'),_0x8a9b3c[_0x2fbd('0x13')],_0x58e4c3);_0x3f1c60(_0x4fe5f3[_0x2fbd('0x11')](0x1f4,_0x8a9b3c[_0x2fbd('0x13')]));});});}; \ No newline at end of file +var _0xf3f5=['map','stringify','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','include','model'];(function(_0x34ea81,_0x149890){var _0x5529b9=function(_0x40dc86){while(--_0x40dc86){_0x34ea81['push'](_0x34ea81['shift']());}};_0x5529b9(++_0x149890);}(_0xf3f5,0x134));var _0x5f3f=function(_0x24a363,_0x2e7052){_0x24a363=_0x24a363-0x0;var _0x17e27d=_0xf3f5[_0x24a363];return _0x17e27d;};'use strict';var _=require('lodash');var util=require(_0x5f3f('0x0'));var moment=require(_0x5f3f('0x1'));var BPromise=require(_0x5f3f('0x2'));var rs=require(_0x5f3f('0x3'));var fs=require('fs');var Redis=require(_0x5f3f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5f3f('0x5'));var logger=require(_0x5f3f('0x6'))(_0x5f3f('0x7'));var config=require(_0x5f3f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5f3f('0x9')][_0x5f3f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x199be5,_0x3a95a0,_0x245a2c){return new BPromise(function(_0x53a022,_0x4b69a8){return client[_0x5f3f('0xb')](_0x199be5,_0x245a2c)[_0x5f3f('0xc')](function(_0x24056c){logger[_0x5f3f('0xd')](_0x5f3f('0xe'),_0x3a95a0,_0x5f3f('0xf'));logger[_0x5f3f('0x10')](_0x5f3f('0x11'),_0x3a95a0,_0x5f3f('0xf'),JSON['stringify'](_0x24056c));if(_0x24056c['error']){if(_0x24056c[_0x5f3f('0x12')][_0x5f3f('0x13')]===0x1f4){logger[_0x5f3f('0x12')]('SquareOdbc,\x20%s,\x20%s',_0x3a95a0,_0x24056c['error'][_0x5f3f('0x14')]);return _0x4b69a8(_0x24056c[_0x5f3f('0x12')][_0x5f3f('0x14')]);}logger[_0x5f3f('0x12')](_0x5f3f('0xe'),_0x3a95a0,_0x24056c['error'][_0x5f3f('0x14')]);return _0x53a022(_0x24056c[_0x5f3f('0x12')][_0x5f3f('0x14')]);}else{logger['info']('SquareOdbc,\x20%s,\x20%s',_0x3a95a0,_0x5f3f('0xf'));_0x53a022(_0x24056c[_0x5f3f('0x15')][_0x5f3f('0x14')]);}})[_0x5f3f('0x16')](function(_0x400850){logger[_0x5f3f('0x12')](_0x5f3f('0xe'),_0x3a95a0,_0x400850);_0x4b69a8(_0x400850);});});}exports[_0x5f3f('0x17')]=function(_0x56b309){var _0xf591e2=this;return new Promise(function(_0x45fd0e,_0x1f7198){return db[_0x5f3f('0x18')][_0x5f3f('0x19')]({'raw':_0x56b309[_0x5f3f('0x1a')]?_0x56b309[_0x5f3f('0x1a')][_0x5f3f('0x1b')]===undefined?!![]:![]:!![],'where':_0x56b309[_0x5f3f('0x1a')]?_0x56b309['options'][_0x5f3f('0x1c')]||null:null,'attributes':_0x56b309[_0x5f3f('0x1a')]?_0x56b309['options'][_0x5f3f('0x1d')]||null:null,'include':_0x56b309[_0x5f3f('0x1a')]?_0x56b309[_0x5f3f('0x1a')][_0x5f3f('0x1e')]?_['map'](_0x56b309['options'][_0x5f3f('0x1e')],function(_0x4c7862){return{'model':db[_0x4c7862[_0x5f3f('0x1f')]],'as':_0x4c7862['as'],'attributes':_0x4c7862[_0x5f3f('0x1d')],'include':_0x4c7862[_0x5f3f('0x1e')]?_[_0x5f3f('0x20')](_0x4c7862[_0x5f3f('0x1e')],function(_0x5047c3){return{'model':db[_0x5047c3[_0x5f3f('0x1f')]],'as':_0x5047c3['as'],'attributes':_0x5047c3[_0x5f3f('0x1d')],'include':_0x5047c3[_0x5f3f('0x1e')]?_[_0x5f3f('0x20')](_0x5047c3['include'],function(_0x4aa60a){return{'model':db[_0x4aa60a['model']],'as':_0x4aa60a['as'],'attributes':_0x4aa60a[_0x5f3f('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x453718){logger[_0x5f3f('0xd')](_0x5f3f('0x17'),_0x56b309);logger[_0x5f3f('0x10')](_0x5f3f('0x17'),_0x56b309,JSON[_0x5f3f('0x21')](_0x453718));_0x45fd0e(_0x453718);})[_0x5f3f('0x16')](function(_0x5bc64b){logger['error']('ShowSquareOdbc',_0x5bc64b[_0x5f3f('0x14')],_0x56b309);_0x1f7198(_0xf591e2['error'](0x1f4,_0x5bc64b[_0x5f3f('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 93d2ff2..17d6356 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 _0x61d0=['isAuthenticated','index','/:id','post','/:id/users','addUsers','put','delete','destroy','removeUsers','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./squareProject.controller','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x61d0,0x187));var _0x061d=function(_0x348652,_0x1ab849){_0x348652=_0x348652-0x0;var _0x18a9ea=_0x61d0[_0x348652];return _0x18a9ea;};'use strict';var multer=require(_0x061d('0x0'));var util=require('util');var path=require(_0x061d('0x1'));var timeout=require(_0x061d('0x2'));var express=require('express');var router=express[_0x061d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x061d('0x4'));var interaction=require(_0x061d('0x5'));var config=require('../../config/environment');var controller=require(_0x061d('0x6'));router[_0x061d('0x7')]('/',auth[_0x061d('0x8')](),controller[_0x061d('0x9')]);router[_0x061d('0x7')](_0x061d('0xa'),auth[_0x061d('0x8')](),controller['show']);router['get']('/:id/users',auth[_0x061d('0x8')](),controller['getUsers']);router[_0x061d('0xb')]('/',auth[_0x061d('0x8')](),controller['create']);router[_0x061d('0xb')](_0x061d('0xc'),auth[_0x061d('0x8')](),controller[_0x061d('0xd')]);router[_0x061d('0xe')](_0x061d('0xa'),auth[_0x061d('0x8')](),controller['update']);router[_0x061d('0xf')](_0x061d('0xa'),auth[_0x061d('0x8')](),controller[_0x061d('0x10')]);router[_0x061d('0xf')](_0x061d('0xc'),auth[_0x061d('0x8')](),controller[_0x061d('0x11')]);module[_0x061d('0x12')]=router; \ No newline at end of file +var _0xbb8d=['create','addUsers','put','delete','destroy','removeUsers','multer','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','isAuthenticated','index','get','/:id','show','/:id/users','post'];(function(_0x2ba885,_0x20763b){var _0x3a6fbd=function(_0x8a49b9){while(--_0x8a49b9){_0x2ba885['push'](_0x2ba885['shift']());}};_0x3a6fbd(++_0x20763b);}(_0xbb8d,0x146));var _0xdbb8=function(_0x6187dd,_0x1c03bf){_0x6187dd=_0x6187dd-0x0;var _0x11c240=_0xbb8d[_0x6187dd];return _0x11c240;};'use strict';var multer=require(_0xdbb8('0x0'));var util=require('util');var path=require(_0xdbb8('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xdbb8('0x2'));var auth=require(_0xdbb8('0x3'));var interaction=require(_0xdbb8('0x4'));var config=require(_0xdbb8('0x5'));var controller=require(_0xdbb8('0x6'));router['get']('/',auth[_0xdbb8('0x7')](),controller[_0xdbb8('0x8')]);router[_0xdbb8('0x9')](_0xdbb8('0xa'),auth['isAuthenticated'](),controller[_0xdbb8('0xb')]);router['get'](_0xdbb8('0xc'),auth[_0xdbb8('0x7')](),controller['getUsers']);router[_0xdbb8('0xd')]('/',auth[_0xdbb8('0x7')](),controller[_0xdbb8('0xe')]);router[_0xdbb8('0xd')](_0xdbb8('0xc'),auth[_0xdbb8('0x7')](),controller[_0xdbb8('0xf')]);router[_0xdbb8('0x10')](_0xdbb8('0xa'),auth[_0xdbb8('0x7')](),controller['update']);router[_0xdbb8('0x11')](_0xdbb8('0xa'),auth[_0xdbb8('0x7')](),controller[_0xdbb8('0x12')]);router[_0xdbb8('0x11')](_0xdbb8('0xc'),auth[_0xdbb8('0x7')](),controller[_0xdbb8('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index b6c5c7d..6119fc9 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 _0x9916=['getDataValue','toString','utf8','long','production','DATE','exports','name','STRING','TEXT','preproduction'];(function(_0xc43e79,_0xd89bb8){var _0x196cde=function(_0x5ca588){while(--_0x5ca588){_0xc43e79['push'](_0xc43e79['shift']());}};_0x196cde(++_0xd89bb8);}(_0x9916,0x145));var _0x6991=function(_0x41ecb0,_0x232c59){_0x41ecb0=_0x41ecb0-0x0;var _0x17b9e0=_0x9916[_0x41ecb0];return _0x17b9e0;};'use strict';var Sequelize=require('sequelize');module[_0x6991('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x6991('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x6991('0x2')]},'notes':{'type':Sequelize[_0x6991('0x3')]},'preproduction':{'type':Sequelize['BLOB']('long'),'get':function(){if(this['getDataValue'](_0x6991('0x4'))){return this[_0x6991('0x5')](_0x6991('0x4'))[_0x6991('0x6')](_0x6991('0x7'));}}},'production':{'type':Sequelize['BLOB'](_0x6991('0x8')),'get':function(){if(this[_0x6991('0x5')](_0x6991('0x9'))){return this['getDataValue'](_0x6991('0x9'))[_0x6991('0x6')](_0x6991('0x7'));}}},'savedAt':{'type':Sequelize[_0x6991('0xa')]},'publishedAt':{'type':Sequelize[_0x6991('0xa')]}}; \ No newline at end of file +var _0xbc12=['getDataValue','preproduction','production','toString','utf8','DATE','sequelize','exports','STRING','name','TEXT','BLOB','long'];(function(_0x1f96b0,_0x1e1008){var _0x64a518=function(_0x47d9bf){while(--_0x47d9bf){_0x1f96b0['push'](_0x1f96b0['shift']());}};_0x64a518(++_0x1e1008);}(_0xbc12,0x1da));var _0x2bc1=function(_0x4853fc,_0x52cd55){_0x4853fc=_0x4853fc-0x0;var _0x23be73=_0xbc12[_0x4853fc];return _0x23be73;};'use strict';var Sequelize=require(_0x2bc1('0x0'));module[_0x2bc1('0x1')]={'name':{'type':Sequelize[_0x2bc1('0x2')],'unique':_0x2bc1('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0x2bc1('0x4')]},'preproduction':{'type':Sequelize[_0x2bc1('0x5')](_0x2bc1('0x6')),'get':function(){if(this[_0x2bc1('0x7')](_0x2bc1('0x8'))){return this[_0x2bc1('0x7')](_0x2bc1('0x8'))['toString']('utf8');}}},'production':{'type':Sequelize['BLOB']('long'),'get':function(){if(this['getDataValue']('production')){return this[_0x2bc1('0x7')](_0x2bc1('0x9'))[_0x2bc1('0xa')](_0x2bc1('0xb'));}}},'savedAt':{'type':Sequelize[_0x2bc1('0xc')]},'publishedAt':{'type':Sequelize[_0x2bc1('0xc')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index b4d5042..c5b1836 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 _0x3c7c=['query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','SquareProjects','UserProfileSection','userProfileId','autoAssociation','addUsers','ids','removeUsers','emit','userSquareProject:remove','getUsers','findOne','User','pick','hasOwnProperty','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','get','UserProfileResource','then','sendStatus','error','stack','name','send','index','map','SquareProject','rawAttributes','fieldName','type'];(function(_0x9ccc82,_0x27a5d1){var _0x56f356=function(_0x5cf3ac){while(--_0x5cf3ac){_0x9ccc82['push'](_0x9ccc82['shift']());}};_0x56f356(++_0x27a5d1);}(_0x3c7c,0x1b7));var _0xc3c7=function(_0x335d2d,_0x26e065){_0x335d2d=_0x335d2d-0x0;var _0x379073=_0x3c7c[_0x335d2d];return _0x379073;};'use strict';var emlformat=require(_0xc3c7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc3c7('0x1'));var jsonpatch=require(_0xc3c7('0x2'));var rp=require(_0xc3c7('0x3'));var moment=require('moment');var BPromise=require(_0xc3c7('0x4'));var Mustache=require(_0xc3c7('0x5'));var util=require(_0xc3c7('0x6'));var path=require(_0xc3c7('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc3c7('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc3c7('0x9'));var squel=require(_0xc3c7('0xa'));var crypto=require(_0xc3c7('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xc3c7('0xc'));var toCsv=require(_0xc3c7('0xd'));var querystring=require(_0xc3c7('0xe'));var Papa=require(_0xc3c7('0xf'));var Redis=require('ioredis');var authService=require(_0xc3c7('0x10'));var qs=require(_0xc3c7('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc3c7('0x12'));var logger=require(_0xc3c7('0x13'))(_0xc3c7('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc3c7('0x15'));var db=require(_0xc3c7('0x16'))['db'];config[_0xc3c7('0x17')]=_[_0xc3c7('0x18')](config[_0xc3c7('0x17')],{'host':_0xc3c7('0x19'),'port':0x18eb});var socket=require(_0xc3c7('0x1a'))(new Redis(config[_0xc3c7('0x17')]));require(_0xc3c7('0x1b'))[_0xc3c7('0x1c')](socket);function respondWithStatusCode(_0x2e2a8f,_0xb064ac){_0xb064ac=_0xb064ac||0xcc;return function(_0x490e7a){if(_0x490e7a){return _0x2e2a8f['sendStatus'](_0xb064ac);}return _0x2e2a8f[_0xc3c7('0x1d')](_0xb064ac)[_0xc3c7('0x1e')]();};}function respondWithResult(_0x3d1a42,_0x3667e5){_0x3667e5=_0x3667e5||0xc8;return function(_0x45951e){if(_0x45951e){return _0x3d1a42[_0xc3c7('0x1d')](_0x3667e5)[_0xc3c7('0x1f')](_0x45951e);}};}function respondWithFilteredResult(_0x2bab79,_0x506d80){return function(_0x2b80b8){if(_0x2b80b8){var _0x52d52b=typeof _0x506d80[_0xc3c7('0x20')]==='undefined'&&typeof _0x506d80[_0xc3c7('0x21')]===_0xc3c7('0x22');var _0x2eb53f=_0x2b80b8[_0xc3c7('0x23')];var _0x2c4fa2=_0x52d52b?0x0:_0x506d80[_0xc3c7('0x20')];var _0x63c04f=_0x52d52b?_0x2b80b8[_0xc3c7('0x23')]:_0x506d80[_0xc3c7('0x20')]+_0x506d80[_0xc3c7('0x21')];var _0x39cfad;if(_0x63c04f>=_0x2eb53f){_0x63c04f=_0x2eb53f;_0x39cfad=0xc8;}else{_0x39cfad=0xce;}_0x2bab79[_0xc3c7('0x1d')](_0x39cfad);return _0x2bab79[_0xc3c7('0x24')](_0xc3c7('0x25'),_0x2c4fa2+'-'+_0x63c04f+'/'+_0x2eb53f)[_0xc3c7('0x1f')](_0x2b80b8);}return null;};}function patchUpdates(_0x23f66a){return function(_0x1a8e14){try{jsonpatch['apply'](_0x1a8e14,_0x23f66a,!![]);}catch(_0x4c4f06){return BPromise[_0xc3c7('0x26')](_0x4c4f06);}return _0x1a8e14[_0xc3c7('0x27')]();};}function saveUpdates(_0x33ad2b,_0x490222){return function(_0x3e0d05){if(_0x3e0d05){return _0x3e0d05[_0xc3c7('0x28')](_0x33ad2b)['then'](function(_0x6c8acc){return _0x6c8acc;});}return null;};}function removeEntity(_0x3a737c,_0x2dae90){return function(_0x9f3160){if(_0x9f3160){return _0x9f3160[_0xc3c7('0x29')]()['then'](function(){var _0xe5830d=_0x9f3160[_0xc3c7('0x2a')]({'plain':!![]});var _0x51541f='SquareProjects';return db[_0xc3c7('0x2b')]['destroy']({'where':{'type':_0x51541f,'resourceId':_0xe5830d['id']}})[_0xc3c7('0x2c')](function(){return _0x9f3160;});})[_0xc3c7('0x2c')](function(){_0x3a737c[_0xc3c7('0x1d')](0xcc)[_0xc3c7('0x1e')]();});}};}function handleEntityNotFound(_0x419001,_0x224130){return function(_0x5e2c57){if(!_0x5e2c57){_0x419001[_0xc3c7('0x2d')](0x194);}return _0x5e2c57;};}function handleError(_0x516fa7,_0x5ad03b){_0x5ad03b=_0x5ad03b||0x1f4;return function(_0x1666ca){logger[_0xc3c7('0x2e')](_0x1666ca[_0xc3c7('0x2f')]);if(_0x1666ca[_0xc3c7('0x30')]){delete _0x1666ca['name'];}_0x516fa7[_0xc3c7('0x1d')](_0x5ad03b)[_0xc3c7('0x31')](_0x1666ca);};}exports[_0xc3c7('0x32')]=function(_0xebaa14,_0x111e67){var _0x17e90e={},_0x25f724={},_0x362b01={'count':0x0,'rows':[]};var _0x25718b=_[_0xc3c7('0x33')](db[_0xc3c7('0x34')][_0xc3c7('0x35')],function(_0x3d32ca){return{'name':_0x3d32ca[_0xc3c7('0x36')],'type':_0x3d32ca[_0xc3c7('0x37')]['key']};});_0x25f724['model']=_[_0xc3c7('0x33')](_0x25718b,_0xc3c7('0x30'));_0x25f724[_0xc3c7('0x38')]=_['keys'](_0xebaa14[_0xc3c7('0x38')]);_0x25f724[_0xc3c7('0x39')]=_[_0xc3c7('0x3a')](_0x25f724[_0xc3c7('0x3b')],_0x25f724[_0xc3c7('0x38')]);_0x17e90e['attributes']=_[_0xc3c7('0x3a')](_0x25f724[_0xc3c7('0x3b')],qs[_0xc3c7('0x3c')](_0xebaa14['query'][_0xc3c7('0x3c')]));_0x17e90e['attributes']=_0x17e90e[_0xc3c7('0x3d')][_0xc3c7('0x3e')]?_0x17e90e[_0xc3c7('0x3d')]:_0x25f724['model'];if(!_0xebaa14[_0xc3c7('0x38')]['hasOwnProperty'](_0xc3c7('0x3f'))){_0x17e90e['limit']=qs[_0xc3c7('0x21')](_0xebaa14[_0xc3c7('0x38')]['limit']);_0x17e90e[_0xc3c7('0x20')]=qs[_0xc3c7('0x20')](_0xebaa14[_0xc3c7('0x38')][_0xc3c7('0x20')]);}_0x17e90e[_0xc3c7('0x40')]=qs['sort'](_0xebaa14[_0xc3c7('0x38')][_0xc3c7('0x41')]);_0x17e90e[_0xc3c7('0x42')]=qs[_0xc3c7('0x39')](_['pick'](_0xebaa14[_0xc3c7('0x38')],_0x25f724[_0xc3c7('0x39')]),_0x25718b);if(_0xebaa14[_0xc3c7('0x38')][_0xc3c7('0x43')]){_0x17e90e[_0xc3c7('0x42')]=_[_0xc3c7('0x44')](_0x17e90e[_0xc3c7('0x42')],{'$or':_[_0xc3c7('0x33')](_0x25718b,function(_0x215d5e){if(_0x215d5e[_0xc3c7('0x37')]!==_0xc3c7('0x45')){var _0x50168d={};_0x50168d[_0x215d5e[_0xc3c7('0x30')]]={'$like':'%'+_0xebaa14[_0xc3c7('0x38')][_0xc3c7('0x43')]+'%'};return _0x50168d;}})});}_0x17e90e=_['merge']({},_0x17e90e,_0xebaa14[_0xc3c7('0x46')]);var _0x298e91={'where':_0x17e90e['where']};return db[_0xc3c7('0x34')][_0xc3c7('0x23')](_0x298e91)[_0xc3c7('0x2c')](function(_0x183589){_0x362b01[_0xc3c7('0x23')]=_0x183589;if(_0xebaa14[_0xc3c7('0x38')][_0xc3c7('0x47')]){_0x17e90e[_0xc3c7('0x48')]=[{'all':!![]}];}return db[_0xc3c7('0x34')][_0xc3c7('0x49')](_0x17e90e);})[_0xc3c7('0x2c')](function(_0x3e4add){_0x362b01[_0xc3c7('0x4a')]=_0x3e4add;return _0x362b01;})[_0xc3c7('0x2c')](respondWithFilteredResult(_0x111e67,_0x17e90e))[_0xc3c7('0x4b')](handleError(_0x111e67,null));};exports[_0xc3c7('0x4c')]=function(_0x22cf78,_0x3d8a7c){var _0x38730e={'raw':![],'where':{'id':_0x22cf78[_0xc3c7('0x4d')]['id']}},_0x56b4be={};_0x56b4be[_0xc3c7('0x3b')]=_[_0xc3c7('0x4e')](db[_0xc3c7('0x34')]['rawAttributes']);_0x56b4be[_0xc3c7('0x38')]=_[_0xc3c7('0x4e')](_0x22cf78[_0xc3c7('0x38')]);_0x56b4be[_0xc3c7('0x39')]=_[_0xc3c7('0x3a')](_0x56b4be[_0xc3c7('0x3b')],_0x56b4be[_0xc3c7('0x38')]);_0x38730e['attributes']=_['intersection'](_0x56b4be[_0xc3c7('0x3b')],qs[_0xc3c7('0x3c')](_0x22cf78[_0xc3c7('0x38')][_0xc3c7('0x3c')]));_0x38730e[_0xc3c7('0x3d')]=_0x38730e[_0xc3c7('0x3d')][_0xc3c7('0x3e')]?_0x38730e[_0xc3c7('0x3d')]:_0x56b4be[_0xc3c7('0x3b')];if(_0x22cf78['query'][_0xc3c7('0x47')]){_0x38730e[_0xc3c7('0x48')]=[{'all':!![]}];}_0x38730e=_[_0xc3c7('0x44')]({},_0x38730e,_0x22cf78[_0xc3c7('0x46')]);return db[_0xc3c7('0x34')][_0xc3c7('0x4f')](_0x38730e)[_0xc3c7('0x2c')](handleEntityNotFound(_0x3d8a7c,null))[_0xc3c7('0x2c')](respondWithResult(_0x3d8a7c,null))[_0xc3c7('0x4b')](handleError(_0x3d8a7c,null));};exports[_0xc3c7('0x50')]=function(_0x49faee,_0x3dc89d){return db[_0xc3c7('0x34')][_0xc3c7('0x50')](_0x49faee[_0xc3c7('0x51')],{})['then'](function(_0x1982ef){var _0x44422b=_0x49faee['user']['get']({'plain':!![]});if(!_0x44422b)throw new Error(_0xc3c7('0x52'));if(_0x44422b[_0xc3c7('0x53')]===_0xc3c7('0x54')){var _0x10f5d7=_0x1982ef[_0xc3c7('0x2a')]({'plain':!![]});var _0x269a04=_0xc3c7('0x55');return db[_0xc3c7('0x56')]['find']({'where':{'name':_0x269a04,'userProfileId':_0x44422b[_0xc3c7('0x57')]},'raw':!![]})[_0xc3c7('0x2c')](function(_0x134da6){if(_0x134da6&&_0x134da6[_0xc3c7('0x58')]===0x0){return db[_0xc3c7('0x2b')][_0xc3c7('0x50')]({'name':_0x10f5d7[_0xc3c7('0x30')],'resourceId':_0x10f5d7['id'],'type':_0x134da6[_0xc3c7('0x30')],'sectionId':_0x134da6['id']},{})[_0xc3c7('0x2c')](function(){return _0x1982ef;});}else{return _0x1982ef;}})['catch'](function(_0x20681a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x20681a);throw _0x20681a;});}return _0x1982ef;})['then'](respondWithResult(_0x3dc89d,0xc9))[_0xc3c7('0x4b')](handleError(_0x3dc89d,null));};exports[_0xc3c7('0x28')]=function(_0x2afc84,_0x20781e){if(_0x2afc84[_0xc3c7('0x51')]['id']){delete _0x2afc84[_0xc3c7('0x51')]['id'];}return db[_0xc3c7('0x34')]['find']({'where':{'id':_0x2afc84[_0xc3c7('0x4d')]['id']}})[_0xc3c7('0x2c')](handleEntityNotFound(_0x20781e,null))[_0xc3c7('0x2c')](saveUpdates(_0x2afc84[_0xc3c7('0x51')],null))[_0xc3c7('0x2c')](respondWithResult(_0x20781e,null))['catch'](handleError(_0x20781e,null));};exports[_0xc3c7('0x29')]=function(_0x5dc511,_0x1e5e4a){return db[_0xc3c7('0x34')]['find']({'where':{'id':_0x5dc511[_0xc3c7('0x4d')]['id']}})[_0xc3c7('0x2c')](handleEntityNotFound(_0x1e5e4a,null))[_0xc3c7('0x2c')](removeEntity(_0x1e5e4a,null))[_0xc3c7('0x4b')](handleError(_0x1e5e4a,null));};exports[_0xc3c7('0x59')]=function(_0x4452cb,_0x4f69eb,_0x19db03){return db[_0xc3c7('0x34')][_0xc3c7('0x4f')]({'where':{'id':_0x4452cb[_0xc3c7('0x4d')]['id']}})[_0xc3c7('0x2c')](handleEntityNotFound(_0x4f69eb,null))[_0xc3c7('0x2c')](function(_0x95d587){if(_0x95d587){return _0x95d587[_0xc3c7('0x59')](_0x4452cb['body']['ids'],_['omit'](_0x4452cb['body'],[_0xc3c7('0x5a'),'id'])||{});}})['then'](respondWithResult(_0x4f69eb,null))[_0xc3c7('0x4b')](handleError(_0x4f69eb,null));};exports[_0xc3c7('0x5b')]=function(_0x850aa6,_0x2ad02f,_0xbef7cd){return db[_0xc3c7('0x34')][_0xc3c7('0x4f')]({'where':{'id':_0x850aa6[_0xc3c7('0x4d')]['id']}})[_0xc3c7('0x2c')](handleEntityNotFound(_0x2ad02f,null))[_0xc3c7('0x2c')](function(_0x1b54eb){if(_0x1b54eb){return _0x1b54eb['removeUsers'](_0x850aa6[_0xc3c7('0x38')][_0xc3c7('0x5a')])[_0xc3c7('0x2c')](function(){if(_['isArray'](_0x850aa6['query'][_0xc3c7('0x5a')])){for(var _0x32271b=0x0;_0x32271b<_0x850aa6[_0xc3c7('0x38')][_0xc3c7('0x5a')][_0xc3c7('0x3e')];_0x32271b+=0x1){socket[_0xc3c7('0x5c')](_0xc3c7('0x5d'),{'UserId':Number(_0x850aa6['query'][_0xc3c7('0x5a')][_0x32271b]),'SquareProjectId':Number(_0x850aa6[_0xc3c7('0x4d')]['id'])});}}else{socket['emit'](_0xc3c7('0x5d'),{'UserId':Number(_0x850aa6[_0xc3c7('0x38')][_0xc3c7('0x5a')]),'SquareProjectId':Number(_0x850aa6[_0xc3c7('0x4d')]['id'])});}});}})[_0xc3c7('0x2c')](respondWithStatusCode(_0x2ad02f,null))['catch'](handleError(_0x2ad02f,null));};exports[_0xc3c7('0x5e')]=function(_0x56908f,_0x219870,_0x52214f){var _0x4e5d2c={};var _0x427d59={};var _0x372e3;var _0x27f530;return db[_0xc3c7('0x34')][_0xc3c7('0x5f')]({'where':{'id':_0x56908f[_0xc3c7('0x4d')]['id']}})[_0xc3c7('0x2c')](handleEntityNotFound(_0x219870,null))[_0xc3c7('0x2c')](function(_0x14ec8b){if(_0x14ec8b){_0x372e3=_0x14ec8b;_0x427d59['model']=_[_0xc3c7('0x4e')](db[_0xc3c7('0x60')][_0xc3c7('0x35')]);_0x427d59[_0xc3c7('0x38')]=_[_0xc3c7('0x4e')](_0x56908f[_0xc3c7('0x38')]);_0x427d59[_0xc3c7('0x39')]=_[_0xc3c7('0x3a')](_0x427d59['model'],_0x427d59[_0xc3c7('0x38')]);_0x4e5d2c['attributes']=_['intersection'](_0x427d59[_0xc3c7('0x3b')],qs[_0xc3c7('0x3c')](_0x56908f[_0xc3c7('0x38')][_0xc3c7('0x3c')]));_0x4e5d2c['attributes']=_0x4e5d2c[_0xc3c7('0x3d')][_0xc3c7('0x3e')]?_0x4e5d2c[_0xc3c7('0x3d')]:_0x427d59['model'];_0x4e5d2c[_0xc3c7('0x40')]=qs[_0xc3c7('0x41')](_0x56908f[_0xc3c7('0x38')][_0xc3c7('0x41')]);_0x4e5d2c[_0xc3c7('0x42')]=qs[_0xc3c7('0x39')](_[_0xc3c7('0x61')](_0x56908f[_0xc3c7('0x38')],_0x427d59[_0xc3c7('0x39')]));if(_0x56908f[_0xc3c7('0x38')]['filter']){_0x4e5d2c[_0xc3c7('0x42')]=_[_0xc3c7('0x44')](_0x4e5d2c[_0xc3c7('0x42')],{'$or':_[_0xc3c7('0x33')](_0x4e5d2c[_0xc3c7('0x3d')],function(_0x15a78c){var _0x4f09a9={};_0x4f09a9[_0x15a78c]={'$like':'%'+_0x56908f[_0xc3c7('0x38')][_0xc3c7('0x43')]+'%'};return _0x4f09a9;})});}_0x4e5d2c=_[_0xc3c7('0x44')]({},_0x4e5d2c,_0x56908f[_0xc3c7('0x46')]);return _0x372e3[_0xc3c7('0x5e')](_0x4e5d2c);}})[_0xc3c7('0x2c')](function(_0x235d90){if(_0x235d90){_0x27f530=_0x235d90[_0xc3c7('0x3e')];if(!_0x56908f[_0xc3c7('0x38')][_0xc3c7('0x62')](_0xc3c7('0x3f'))){_0x4e5d2c['limit']=qs[_0xc3c7('0x21')](_0x56908f[_0xc3c7('0x38')][_0xc3c7('0x21')]);_0x4e5d2c['offset']=qs[_0xc3c7('0x20')](_0x56908f[_0xc3c7('0x38')][_0xc3c7('0x20')]);}return _0x372e3[_0xc3c7('0x5e')](_0x4e5d2c);}})[_0xc3c7('0x2c')](function(_0x1caf5f){if(_0x1caf5f){return _0x1caf5f?{'count':_0x27f530,'rows':_0x1caf5f}:null;}})['then'](respondWithResult(_0x219870,null))[_0xc3c7('0x4b')](handleError(_0x219870,null));}; \ No newline at end of file +var _0xe706=['save','update','then','destroy','SquareProjects','error','stack','name','index','map','SquareProject','fieldName','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','rawAttributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addUsers','ids','omit','removeUsers','isArray','length','emit','userSquareProject:remove','getUsers','User','sort','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./squareProject.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject'];(function(_0x836927,_0x30c0f8){var _0x37569f=function(_0x249acd){while(--_0x249acd){_0x836927['push'](_0x836927['shift']());}};_0x37569f(++_0x30c0f8);}(_0xe706,0x15c));var _0x6e70=function(_0x4b97c6,_0x21017c){_0x4b97c6=_0x4b97c6-0x0;var _0x342ead=_0xe706[_0x4b97c6];return _0x342ead;};'use strict';var emlformat=require(_0x6e70('0x0'));var rimraf=require(_0x6e70('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6e70('0x2'));var rp=require(_0x6e70('0x3'));var moment=require(_0x6e70('0x4'));var BPromise=require(_0x6e70('0x5'));var Mustache=require(_0x6e70('0x6'));var util=require(_0x6e70('0x7'));var path=require(_0x6e70('0x8'));var sox=require(_0x6e70('0x9'));var csv=require(_0x6e70('0xa'));var ejs=require(_0x6e70('0xb'));var fs=require('fs');var fs_extra=require(_0x6e70('0xc'));var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6e70('0x10'));var Redis=require(_0x6e70('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x6e70('0x12'));var as=require(_0x6e70('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x6e70('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x6e70('0x15'));var db=require(_0x6e70('0x16'))['db'];config['redis']=_[_0x6e70('0x17')](config['redis'],{'host':_0x6e70('0x18'),'port':0x18eb});var socket=require(_0x6e70('0x19'))(new Redis(config[_0x6e70('0x1a')]));require(_0x6e70('0x1b'))[_0x6e70('0x1c')](socket);function respondWithStatusCode(_0x253d1f,_0x3745c2){_0x3745c2=_0x3745c2||0xcc;return function(_0xf70430){if(_0xf70430){return _0x253d1f[_0x6e70('0x1d')](_0x3745c2);}return _0x253d1f[_0x6e70('0x1e')](_0x3745c2)[_0x6e70('0x1f')]();};}function respondWithResult(_0x4afc66,_0x87b20b){_0x87b20b=_0x87b20b||0xc8;return function(_0x2f06bf){if(_0x2f06bf){return _0x4afc66['status'](_0x87b20b)[_0x6e70('0x20')](_0x2f06bf);}};}function respondWithFilteredResult(_0x56e3ed,_0x3c2a38){return function(_0x2bbd35){if(_0x2bbd35){var _0x570fd9=typeof _0x3c2a38[_0x6e70('0x21')]===_0x6e70('0x22')&&typeof _0x3c2a38['limit']===_0x6e70('0x22');var _0x1a0c00=_0x2bbd35['count'];var _0x488828=_0x570fd9?0x0:_0x3c2a38[_0x6e70('0x21')];var _0x13ed55=_0x570fd9?_0x2bbd35[_0x6e70('0x23')]:_0x3c2a38['offset']+_0x3c2a38[_0x6e70('0x24')];var _0x19d4f1;if(_0x13ed55>=_0x1a0c00){_0x13ed55=_0x1a0c00;_0x19d4f1=0xc8;}else{_0x19d4f1=0xce;}_0x56e3ed[_0x6e70('0x1e')](_0x19d4f1);return _0x56e3ed['set'](_0x6e70('0x25'),_0x488828+'-'+_0x13ed55+'/'+_0x1a0c00)[_0x6e70('0x20')](_0x2bbd35);}return null;};}function patchUpdates(_0x53b998){return function(_0x273f85){try{jsonpatch[_0x6e70('0x26')](_0x273f85,_0x53b998,!![]);}catch(_0x3b57a7){return BPromise[_0x6e70('0x27')](_0x3b57a7);}return _0x273f85[_0x6e70('0x28')]();};}function saveUpdates(_0x4624bc,_0x5d03db){return function(_0x10da31){if(_0x10da31){return _0x10da31[_0x6e70('0x29')](_0x4624bc)[_0x6e70('0x2a')](function(_0x42305c){return _0x42305c;});}return null;};}function removeEntity(_0x2ddb0e,_0x2fb7b1){return function(_0x819f7a){if(_0x819f7a){return _0x819f7a[_0x6e70('0x2b')]()['then'](function(){var _0x16437b=_0x819f7a['get']({'plain':!![]});var _0x13ccc4=_0x6e70('0x2c');return db['UserProfileResource'][_0x6e70('0x2b')]({'where':{'type':_0x13ccc4,'resourceId':_0x16437b['id']}})[_0x6e70('0x2a')](function(){return _0x819f7a;});})[_0x6e70('0x2a')](function(){_0x2ddb0e[_0x6e70('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42f86e,_0x52d9de){return function(_0x278bac){if(!_0x278bac){_0x42f86e[_0x6e70('0x1d')](0x194);}return _0x278bac;};}function handleError(_0x383f80,_0x4a725f){_0x4a725f=_0x4a725f||0x1f4;return function(_0xbc55f8){logger[_0x6e70('0x2d')](_0xbc55f8[_0x6e70('0x2e')]);if(_0xbc55f8['name']){delete _0xbc55f8[_0x6e70('0x2f')];}_0x383f80[_0x6e70('0x1e')](_0x4a725f)['send'](_0xbc55f8);};}exports[_0x6e70('0x30')]=function(_0x1a519f,_0x4c52a4){var _0x36a653={},_0x411be2={},_0x3c3260={'count':0x0,'rows':[]};var _0x18b487=_[_0x6e70('0x31')](db[_0x6e70('0x32')]['rawAttributes'],function(_0x567cdc){return{'name':_0x567cdc[_0x6e70('0x33')],'type':_0x567cdc['type']['key']};});_0x411be2[_0x6e70('0x34')]=_[_0x6e70('0x31')](_0x18b487,'name');_0x411be2[_0x6e70('0x35')]=_[_0x6e70('0x36')](_0x1a519f[_0x6e70('0x35')]);_0x411be2[_0x6e70('0x37')]=_['intersection'](_0x411be2[_0x6e70('0x34')],_0x411be2['query']);_0x36a653[_0x6e70('0x38')]=_[_0x6e70('0x39')](_0x411be2['model'],qs[_0x6e70('0x3a')](_0x1a519f['query']['fields']));_0x36a653[_0x6e70('0x38')]=_0x36a653['attributes']['length']?_0x36a653[_0x6e70('0x38')]:_0x411be2[_0x6e70('0x34')];if(!_0x1a519f['query'][_0x6e70('0x3b')](_0x6e70('0x3c'))){_0x36a653[_0x6e70('0x24')]=qs[_0x6e70('0x24')](_0x1a519f['query'][_0x6e70('0x24')]);_0x36a653[_0x6e70('0x21')]=qs[_0x6e70('0x21')](_0x1a519f[_0x6e70('0x35')][_0x6e70('0x21')]);}_0x36a653[_0x6e70('0x3d')]=qs['sort'](_0x1a519f['query']['sort']);_0x36a653[_0x6e70('0x3e')]=qs[_0x6e70('0x37')](_[_0x6e70('0x3f')](_0x1a519f[_0x6e70('0x35')],_0x411be2[_0x6e70('0x37')]),_0x18b487);if(_0x1a519f[_0x6e70('0x35')][_0x6e70('0x40')]){_0x36a653['where']=_[_0x6e70('0x41')](_0x36a653[_0x6e70('0x3e')],{'$or':_[_0x6e70('0x31')](_0x18b487,function(_0x429cd3){if(_0x429cd3[_0x6e70('0x42')]!==_0x6e70('0x43')){var _0x27da7f={};_0x27da7f[_0x429cd3[_0x6e70('0x2f')]]={'$like':'%'+_0x1a519f['query']['filter']+'%'};return _0x27da7f;}})});}_0x36a653=_[_0x6e70('0x41')]({},_0x36a653,_0x1a519f[_0x6e70('0x44')]);var _0xa490d0={'where':_0x36a653['where']};return db[_0x6e70('0x32')][_0x6e70('0x23')](_0xa490d0)[_0x6e70('0x2a')](function(_0x4daa1c){_0x3c3260[_0x6e70('0x23')]=_0x4daa1c;if(_0x1a519f['query'][_0x6e70('0x45')]){_0x36a653[_0x6e70('0x46')]=[{'all':!![]}];}return db['SquareProject'][_0x6e70('0x47')](_0x36a653);})[_0x6e70('0x2a')](function(_0x15dda1){_0x3c3260['rows']=_0x15dda1;return _0x3c3260;})[_0x6e70('0x2a')](respondWithFilteredResult(_0x4c52a4,_0x36a653))[_0x6e70('0x48')](handleError(_0x4c52a4,null));};exports['show']=function(_0x58bd26,_0x51ff8c){var _0x152c6e={'raw':![],'where':{'id':_0x58bd26['params']['id']}},_0x498861={};_0x498861[_0x6e70('0x34')]=_[_0x6e70('0x36')](db[_0x6e70('0x32')][_0x6e70('0x49')]);_0x498861[_0x6e70('0x35')]=_[_0x6e70('0x36')](_0x58bd26[_0x6e70('0x35')]);_0x498861['filters']=_[_0x6e70('0x39')](_0x498861[_0x6e70('0x34')],_0x498861[_0x6e70('0x35')]);_0x152c6e['attributes']=_[_0x6e70('0x39')](_0x498861[_0x6e70('0x34')],qs['fields'](_0x58bd26['query'][_0x6e70('0x3a')]));_0x152c6e['attributes']=_0x152c6e[_0x6e70('0x38')]['length']?_0x152c6e[_0x6e70('0x38')]:_0x498861[_0x6e70('0x34')];if(_0x58bd26[_0x6e70('0x35')][_0x6e70('0x45')]){_0x152c6e['include']=[{'all':!![]}];}_0x152c6e=_[_0x6e70('0x41')]({},_0x152c6e,_0x58bd26[_0x6e70('0x44')]);return db[_0x6e70('0x32')][_0x6e70('0x4a')](_0x152c6e)[_0x6e70('0x2a')](handleEntityNotFound(_0x51ff8c,null))['then'](respondWithResult(_0x51ff8c,null))['catch'](handleError(_0x51ff8c,null));};exports[_0x6e70('0x4b')]=function(_0x1ba22d,_0x4c1d85){return db[_0x6e70('0x32')]['create'](_0x1ba22d[_0x6e70('0x4c')],{})[_0x6e70('0x2a')](function(_0x3cadd7){var _0x120feb=_0x1ba22d[_0x6e70('0x4d')][_0x6e70('0x4e')]({'plain':!![]});if(!_0x120feb)throw new Error(_0x6e70('0x4f'));if(_0x120feb[_0x6e70('0x50')]===_0x6e70('0x4d')){var _0x19428b=_0x3cadd7[_0x6e70('0x4e')]({'plain':!![]});var _0x53d04e=_0x6e70('0x2c');return db[_0x6e70('0x51')][_0x6e70('0x4a')]({'where':{'name':_0x53d04e,'userProfileId':_0x120feb['userProfileId']},'raw':!![]})['then'](function(_0x45623f){if(_0x45623f&&_0x45623f[_0x6e70('0x52')]===0x0){return db[_0x6e70('0x53')]['create']({'name':_0x19428b[_0x6e70('0x2f')],'resourceId':_0x19428b['id'],'type':_0x45623f[_0x6e70('0x2f')],'sectionId':_0x45623f['id']},{})[_0x6e70('0x2a')](function(){return _0x3cadd7;});}else{return _0x3cadd7;}})['catch'](function(_0x2d0c76){logger['error'](_0x6e70('0x54'),_0x2d0c76);throw _0x2d0c76;});}return _0x3cadd7;})[_0x6e70('0x2a')](respondWithResult(_0x4c1d85,0xc9))[_0x6e70('0x48')](handleError(_0x4c1d85,null));};exports['update']=function(_0x479b70,_0x1ae7ab){if(_0x479b70[_0x6e70('0x4c')]['id']){delete _0x479b70[_0x6e70('0x4c')]['id'];}return db[_0x6e70('0x32')][_0x6e70('0x4a')]({'where':{'id':_0x479b70[_0x6e70('0x55')]['id']}})[_0x6e70('0x2a')](handleEntityNotFound(_0x1ae7ab,null))[_0x6e70('0x2a')](saveUpdates(_0x479b70[_0x6e70('0x4c')],null))[_0x6e70('0x2a')](respondWithResult(_0x1ae7ab,null))[_0x6e70('0x48')](handleError(_0x1ae7ab,null));};exports[_0x6e70('0x2b')]=function(_0x320a7d,_0x451f0e){return db[_0x6e70('0x32')][_0x6e70('0x4a')]({'where':{'id':_0x320a7d['params']['id']}})['then'](handleEntityNotFound(_0x451f0e,null))[_0x6e70('0x2a')](removeEntity(_0x451f0e,null))[_0x6e70('0x48')](handleError(_0x451f0e,null));};exports[_0x6e70('0x56')]=function(_0x5eb05c,_0x4c4dbf,_0x3719a4){return db[_0x6e70('0x32')]['find']({'where':{'id':_0x5eb05c['params']['id']}})[_0x6e70('0x2a')](handleEntityNotFound(_0x4c4dbf,null))[_0x6e70('0x2a')](function(_0x49161d){if(_0x49161d){return _0x49161d[_0x6e70('0x56')](_0x5eb05c[_0x6e70('0x4c')][_0x6e70('0x57')],_[_0x6e70('0x58')](_0x5eb05c[_0x6e70('0x4c')],[_0x6e70('0x57'),'id'])||{});}})[_0x6e70('0x2a')](respondWithResult(_0x4c4dbf,null))[_0x6e70('0x48')](handleError(_0x4c4dbf,null));};exports['removeUsers']=function(_0x496539,_0x11f72d,_0x5d8f78){return db[_0x6e70('0x32')][_0x6e70('0x4a')]({'where':{'id':_0x496539[_0x6e70('0x55')]['id']}})[_0x6e70('0x2a')](handleEntityNotFound(_0x11f72d,null))[_0x6e70('0x2a')](function(_0x5a7c5c){if(_0x5a7c5c){return _0x5a7c5c[_0x6e70('0x59')](_0x496539[_0x6e70('0x35')]['ids'])[_0x6e70('0x2a')](function(){if(_[_0x6e70('0x5a')](_0x496539[_0x6e70('0x35')]['ids'])){for(var _0x168e94=0x0;_0x168e94<_0x496539[_0x6e70('0x35')][_0x6e70('0x57')][_0x6e70('0x5b')];_0x168e94+=0x1){socket[_0x6e70('0x5c')](_0x6e70('0x5d'),{'UserId':Number(_0x496539['query'][_0x6e70('0x57')][_0x168e94]),'SquareProjectId':Number(_0x496539[_0x6e70('0x55')]['id'])});}}else{socket[_0x6e70('0x5c')](_0x6e70('0x5d'),{'UserId':Number(_0x496539['query'][_0x6e70('0x57')]),'SquareProjectId':Number(_0x496539[_0x6e70('0x55')]['id'])});}});}})[_0x6e70('0x2a')](respondWithStatusCode(_0x11f72d,null))[_0x6e70('0x48')](handleError(_0x11f72d,null));};exports[_0x6e70('0x5e')]=function(_0x216fc0,_0x2f5811,_0x157247){var _0x5a0f3e={};var _0x26655c={};var _0x4b3e35;var _0x4a4cac;return db[_0x6e70('0x32')]['findOne']({'where':{'id':_0x216fc0[_0x6e70('0x55')]['id']}})[_0x6e70('0x2a')](handleEntityNotFound(_0x2f5811,null))[_0x6e70('0x2a')](function(_0xf51e45){if(_0xf51e45){_0x4b3e35=_0xf51e45;_0x26655c[_0x6e70('0x34')]=_[_0x6e70('0x36')](db[_0x6e70('0x5f')][_0x6e70('0x49')]);_0x26655c['query']=_['keys'](_0x216fc0[_0x6e70('0x35')]);_0x26655c[_0x6e70('0x37')]=_['intersection'](_0x26655c[_0x6e70('0x34')],_0x26655c['query']);_0x5a0f3e['attributes']=_[_0x6e70('0x39')](_0x26655c['model'],qs[_0x6e70('0x3a')](_0x216fc0['query'][_0x6e70('0x3a')]));_0x5a0f3e[_0x6e70('0x38')]=_0x5a0f3e[_0x6e70('0x38')][_0x6e70('0x5b')]?_0x5a0f3e[_0x6e70('0x38')]:_0x26655c['model'];_0x5a0f3e[_0x6e70('0x3d')]=qs[_0x6e70('0x60')](_0x216fc0['query']['sort']);_0x5a0f3e[_0x6e70('0x3e')]=qs[_0x6e70('0x37')](_[_0x6e70('0x3f')](_0x216fc0[_0x6e70('0x35')],_0x26655c[_0x6e70('0x37')]));if(_0x216fc0['query']['filter']){_0x5a0f3e[_0x6e70('0x3e')]=_['merge'](_0x5a0f3e['where'],{'$or':_[_0x6e70('0x31')](_0x5a0f3e[_0x6e70('0x38')],function(_0xdabbb){var _0x27ec5f={};_0x27ec5f[_0xdabbb]={'$like':'%'+_0x216fc0[_0x6e70('0x35')][_0x6e70('0x40')]+'%'};return _0x27ec5f;})});}_0x5a0f3e=_[_0x6e70('0x41')]({},_0x5a0f3e,_0x216fc0[_0x6e70('0x44')]);return _0x4b3e35[_0x6e70('0x5e')](_0x5a0f3e);}})[_0x6e70('0x2a')](function(_0x24690e){if(_0x24690e){_0x4a4cac=_0x24690e['length'];if(!_0x216fc0[_0x6e70('0x35')]['hasOwnProperty']('nolimit')){_0x5a0f3e[_0x6e70('0x24')]=qs['limit'](_0x216fc0[_0x6e70('0x35')][_0x6e70('0x24')]);_0x5a0f3e[_0x6e70('0x21')]=qs[_0x6e70('0x21')](_0x216fc0[_0x6e70('0x35')][_0x6e70('0x21')]);}return _0x4b3e35[_0x6e70('0x5e')](_0x5a0f3e);}})[_0x6e70('0x2a')](function(_0x4fabba){if(_0x4fabba){return _0x4fabba?{'count':_0x4a4cac,'rows':_0x4fabba}:null;}})[_0x6e70('0x2a')](respondWithResult(_0x2f5811,null))[_0x6e70('0x48')](handleError(_0x2f5811,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index e4a5fc9..0a92e00 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 _0x330b=['exports','events','../../mysqldb','SquareProject','save','update','emit','hasOwnProperty','hook'];(function(_0x1c57bf,_0x76315d){var _0x431581=function(_0x2162e3){while(--_0x2162e3){_0x1c57bf['push'](_0x1c57bf['shift']());}};_0x431581(++_0x76315d);}(_0x330b,0x1a8));var _0xb330=function(_0x7ed1f,_0xe724d3){_0x7ed1f=_0x7ed1f-0x0;var _0x58d101=_0x330b[_0x7ed1f];return _0x58d101;};'use strict';var EventEmitter=require(_0xb330('0x0'));var SquareProject=require(_0xb330('0x1'))['db'][_0xb330('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb330('0x3'),'afterUpdate':_0xb330('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3e4b84){return function(_0x187017,_0x3685ca,_0x192932){SquareProjectEvents['emit'](_0x3e4b84+':'+_0x187017['id'],_0x187017);SquareProjectEvents[_0xb330('0x5')](_0x3e4b84,_0x187017);_0x192932(null);};}for(var e in events){if(events[_0xb330('0x6')](e)){var event=events[e];SquareProject[_0xb330('0x7')](e,emitEvent(event));}}module[_0xb330('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0x1f0f=['hook','events','../../mysqldb','update','remove','emit','hasOwnProperty'];(function(_0x27d0d0,_0x246643){var _0x276679=function(_0x4ca960){while(--_0x4ca960){_0x27d0d0['push'](_0x27d0d0['shift']());}};_0x276679(++_0x246643);}(_0x1f0f,0x120));var _0xf1f0=function(_0x5f4015,_0x5169d6){_0x5f4015=_0x5f4015-0x0;var _0x2ea247=_0x1f0f[_0x5f4015];return _0x2ea247;};'use strict';var EventEmitter=require(_0xf1f0('0x0'));var SquareProject=require(_0xf1f0('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xf1f0('0x2'),'afterDestroy':_0xf1f0('0x3')};function emitEvent(_0x50255f){return function(_0x13c758,_0x4534d0,_0x50c6c8){SquareProjectEvents['emit'](_0x50255f+':'+_0x13c758['id'],_0x13c758);SquareProjectEvents[_0xf1f0('0x4')](_0x50255f,_0x13c758);_0x50c6c8(null);};}for(var e in events){if(events[_0xf1f0('0x5')](e)){var event=events[e];SquareProject[_0xf1f0('0x6')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 529f13a..a0358ca 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 _0xee51=['bluebird','path','rimraf','../../config/environment','exports','define','square_projects','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','changed','publishedAt','util','../../config/logger','api','moment'];(function(_0x50c154,_0x4e08a2){var _0x23aad4=function(_0xb549c1){while(--_0xb549c1){_0x50c154['push'](_0x50c154['shift']());}};_0x23aad4(++_0x4e08a2);}(_0xee51,0x13f));var _0x1ee5=function(_0x3a096c,_0x1f9d72){_0x3a096c=_0x3a096c-0x0;var _0x44a6a4=_0xee51[_0x3a096c];return _0x44a6a4;};'use strict';var _=require('lodash');var util=require(_0x1ee5('0x0'));var logger=require(_0x1ee5('0x1'))(_0x1ee5('0x2'));var moment=require(_0x1ee5('0x3'));var BPromise=require(_0x1ee5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1ee5('0x5'));var rimraf=require(_0x1ee5('0x6'));var config=require(_0x1ee5('0x7'));var attributes=require('./squareProject.attributes');module[_0x1ee5('0x8')]=function(_0x2178b7,_0x2338e0){return _0x2178b7[_0x1ee5('0x9')]('SquareProject',attributes,{'tableName':_0x1ee5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x34800c,_0x3c715d,_0x144ab5){if(_0x34800c['changed'](_0x1ee5('0xb'))){_0x34800c[_0x1ee5('0xc')]=moment()[_0x1ee5('0xd')](_0x1ee5('0xe'));}if(_0x34800c[_0x1ee5('0xf')]('production')){_0x34800c[_0x1ee5('0x10')]=moment()[_0x1ee5('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x144ab5(null,_0x34800c);}}});}; \ No newline at end of file +var _0xc056=['./squareProject.attributes','exports','SquareProject','square_projects','changed','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x3cfe43,_0x259ef0){var _0x3d926a=function(_0x27e365){while(--_0x27e365){_0x3cfe43['push'](_0x3cfe43['shift']());}};_0x3d926a(++_0x259ef0);}(_0xc056,0x1a2));var _0x6c05=function(_0x27fb12,_0x5e0be0){_0x27fb12=_0x27fb12-0x0;var _0x49a279=_0xc056[_0x27fb12];return _0x49a279;};'use strict';var _=require(_0x6c05('0x0'));var util=require(_0x6c05('0x1'));var logger=require(_0x6c05('0x2'))(_0x6c05('0x3'));var moment=require('moment');var BPromise=require(_0x6c05('0x4'));var rp=require(_0x6c05('0x5'));var fs=require('fs');var path=require(_0x6c05('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6c05('0x7'));module[_0x6c05('0x8')]=function(_0x542746,_0x41b3f9){return _0x542746['define'](_0x6c05('0x9'),attributes,{'tableName':_0x6c05('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5b3139,_0x467516,_0x4fc971){if(_0x5b3139[_0x6c05('0xb')]('preproduction')){_0x5b3139[_0x6c05('0xc')]=moment()[_0x6c05('0xd')](_0x6c05('0xe'));}if(_0x5b3139[_0x6c05('0xb')](_0x6c05('0xf'))){_0x5b3139[_0x6c05('0x10')]=moment()[_0x6c05('0xd')](_0x6c05('0xe'));}_0x4fc971(null,_0x5b3139);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index ce4d471..d1161ad 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 _0x5cc0=['catch','SquareProject','options','raw','where','attributes','map','include','model','info','ShowSquareProject','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','then','SquareProject,\x20%s,\x20%s','request\x20sent','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x2db379,_0x2dac86){var _0x521f80=function(_0xfa261f){while(--_0xfa261f){_0x2db379['push'](_0x2db379['shift']());}};_0x521f80(++_0x2dac86);}(_0x5cc0,0x78));var _0x05cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5cc0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x05cc('0x0'));var util=require(_0x05cc('0x1'));var moment=require(_0x05cc('0x2'));var BPromise=require(_0x05cc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x05cc('0x4'));var db=require(_0x05cc('0x5'))['db'];var utils=require(_0x05cc('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x05cc('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x05cc('0x8')]['http']({'port':0x232a});config[_0x05cc('0x9')]=_[_0x05cc('0xa')](config[_0x05cc('0x9')],{'host':_0x05cc('0xb'),'port':0x18eb});var socket=require(_0x05cc('0xc'))(new Redis(config[_0x05cc('0x9')]));require(_0x05cc('0xd'))[_0x05cc('0xe')](socket);function respondWithRpcPromise(_0x456fe9,_0x5e82af,_0x228c1e){return new BPromise(function(_0x41ecc0,_0xf96dc7){return client['request'](_0x456fe9,_0x228c1e)[_0x05cc('0xf')](function(_0x1f1866){logger['info'](_0x05cc('0x10'),_0x5e82af,_0x05cc('0x11'));logger['debug'](_0x05cc('0x12'),_0x5e82af,_0x05cc('0x11'),JSON[_0x05cc('0x13')](_0x1f1866));if(_0x1f1866[_0x05cc('0x14')]){if(_0x1f1866[_0x05cc('0x14')][_0x05cc('0x15')]===0x1f4){logger['error'](_0x05cc('0x10'),_0x5e82af,_0x1f1866['error'][_0x05cc('0x16')]);return _0xf96dc7(_0x1f1866[_0x05cc('0x14')][_0x05cc('0x16')]);}logger['error'](_0x05cc('0x10'),_0x5e82af,_0x1f1866[_0x05cc('0x14')]['message']);return _0x41ecc0(_0x1f1866['error'][_0x05cc('0x16')]);}else{logger['info'](_0x05cc('0x10'),_0x5e82af,_0x05cc('0x11'));_0x41ecc0(_0x1f1866[_0x05cc('0x17')][_0x05cc('0x16')]);}})[_0x05cc('0x18')](function(_0xdf6f75){logger[_0x05cc('0x14')](_0x05cc('0x10'),_0x5e82af,_0xdf6f75);_0xf96dc7(_0xdf6f75);});});}exports['ShowSquareProject']=function(_0x1fb214){var _0x3cf7cf=this;return new Promise(function(_0x35c7f3,_0x4a3001){return db[_0x05cc('0x19')]['find']({'raw':_0x1fb214[_0x05cc('0x1a')]?_0x1fb214[_0x05cc('0x1a')][_0x05cc('0x1b')]===undefined?!![]:![]:!![],'where':_0x1fb214[_0x05cc('0x1a')]?_0x1fb214[_0x05cc('0x1a')][_0x05cc('0x1c')]||null:null,'attributes':_0x1fb214[_0x05cc('0x1a')]?_0x1fb214[_0x05cc('0x1a')][_0x05cc('0x1d')]||null:null,'include':_0x1fb214[_0x05cc('0x1a')]?_0x1fb214[_0x05cc('0x1a')]['include']?_[_0x05cc('0x1e')](_0x1fb214[_0x05cc('0x1a')][_0x05cc('0x1f')],function(_0x6bae4a){return{'model':db[_0x6bae4a[_0x05cc('0x20')]],'as':_0x6bae4a['as'],'attributes':_0x6bae4a['attributes'],'include':_0x6bae4a[_0x05cc('0x1f')]?_[_0x05cc('0x1e')](_0x6bae4a['include'],function(_0x56151a){return{'model':db[_0x56151a[_0x05cc('0x20')]],'as':_0x56151a['as'],'attributes':_0x56151a[_0x05cc('0x1d')],'include':_0x56151a['include']?_[_0x05cc('0x1e')](_0x56151a[_0x05cc('0x1f')],function(_0x29c3c5){return{'model':db[_0x29c3c5['model']],'as':_0x29c3c5['as'],'attributes':_0x29c3c5[_0x05cc('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2f41fd){logger[_0x05cc('0x21')](_0x05cc('0x22'),_0x1fb214);logger[_0x05cc('0x23')](_0x05cc('0x22'),_0x1fb214,JSON['stringify'](_0x2f41fd));_0x35c7f3(_0x2f41fd);})[_0x05cc('0x18')](function(_0x3a89e5){logger[_0x05cc('0x14')](_0x05cc('0x22'),_0x3a89e5[_0x05cc('0x16')],_0x1fb214);_0x4a3001(_0x3cf7cf[_0x05cc('0x14')](0x1f4,_0x3a89e5[_0x05cc('0x16')]));});});}; \ No newline at end of file +var _0x5659=['request','then','info','request\x20sent','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SquareProject,\x20%s,\x20%s','result','catch','ShowSquareProject','find','options','raw','where','attributes','include','map','model','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./squareProject.socket','register'];(function(_0x5de7f2,_0x358f95){var _0x1095d3=function(_0xc6093c){while(--_0xc6093c){_0x5de7f2['push'](_0x5de7f2['shift']());}};_0x1095d3(++_0x358f95);}(_0x5659,0x1b7));var _0x9565=function(_0xe1b102,_0x542a72){_0xe1b102=_0xe1b102-0x0;var _0xed6dcc=_0x5659[_0xe1b102];return _0xed6dcc;};'use strict';var _=require(_0x9565('0x0'));var util=require('util');var moment=require(_0x9565('0x1'));var BPromise=require(_0x9565('0x2'));var rs=require(_0x9565('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9565('0x4'))['db'];var utils=require(_0x9565('0x5'));var logger=require(_0x9565('0x6'))(_0x9565('0x7'));var config=require(_0x9565('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9565('0x9')][_0x9565('0xa')]({'port':0x232a});config['redis']=_[_0x9565('0xb')](config[_0x9565('0xc')],{'host':_0x9565('0xd'),'port':0x18eb});var socket=require(_0x9565('0xe'))(new Redis(config[_0x9565('0xc')]));require(_0x9565('0xf'))[_0x9565('0x10')](socket);function respondWithRpcPromise(_0x322a65,_0x2cd99a,_0x38a5f2){return new BPromise(function(_0x4f5f49,_0x4b989e){return client[_0x9565('0x11')](_0x322a65,_0x38a5f2)[_0x9565('0x12')](function(_0x29c488){logger[_0x9565('0x13')]('SquareProject,\x20%s,\x20%s',_0x2cd99a,_0x9565('0x14'));logger['debug'](_0x9565('0x15'),_0x2cd99a,'request\x20sent',JSON[_0x9565('0x16')](_0x29c488));if(_0x29c488[_0x9565('0x17')]){if(_0x29c488[_0x9565('0x17')][_0x9565('0x18')]===0x1f4){logger[_0x9565('0x17')]('SquareProject,\x20%s,\x20%s',_0x2cd99a,_0x29c488[_0x9565('0x17')]['message']);return _0x4b989e(_0x29c488[_0x9565('0x17')][_0x9565('0x19')]);}logger['error'](_0x9565('0x1a'),_0x2cd99a,_0x29c488['error']['message']);return _0x4f5f49(_0x29c488[_0x9565('0x17')][_0x9565('0x19')]);}else{logger[_0x9565('0x13')]('SquareProject,\x20%s,\x20%s',_0x2cd99a,_0x9565('0x14'));_0x4f5f49(_0x29c488[_0x9565('0x1b')][_0x9565('0x19')]);}})[_0x9565('0x1c')](function(_0x522c3e){logger[_0x9565('0x17')]('SquareProject,\x20%s,\x20%s',_0x2cd99a,_0x522c3e);_0x4b989e(_0x522c3e);});});}exports[_0x9565('0x1d')]=function(_0x38ee96){var _0x291c5a=this;return new Promise(function(_0x5ad11f,_0x2fd247){return db['SquareProject'][_0x9565('0x1e')]({'raw':_0x38ee96[_0x9565('0x1f')]?_0x38ee96[_0x9565('0x1f')][_0x9565('0x20')]===undefined?!![]:![]:!![],'where':_0x38ee96['options']?_0x38ee96['options'][_0x9565('0x21')]||null:null,'attributes':_0x38ee96[_0x9565('0x1f')]?_0x38ee96[_0x9565('0x1f')][_0x9565('0x22')]||null:null,'include':_0x38ee96['options']?_0x38ee96[_0x9565('0x1f')][_0x9565('0x23')]?_[_0x9565('0x24')](_0x38ee96[_0x9565('0x1f')][_0x9565('0x23')],function(_0x3e22ac){return{'model':db[_0x3e22ac[_0x9565('0x25')]],'as':_0x3e22ac['as'],'attributes':_0x3e22ac[_0x9565('0x22')],'include':_0x3e22ac[_0x9565('0x23')]?_['map'](_0x3e22ac[_0x9565('0x23')],function(_0x4228ea){return{'model':db[_0x4228ea[_0x9565('0x25')]],'as':_0x4228ea['as'],'attributes':_0x4228ea[_0x9565('0x22')],'include':_0x4228ea['include']?_[_0x9565('0x24')](_0x4228ea[_0x9565('0x23')],function(_0x2c36ea){return{'model':db[_0x2c36ea[_0x9565('0x25')]],'as':_0x2c36ea['as'],'attributes':_0x2c36ea[_0x9565('0x22')]};}):[]};}):[]};}):[]:[]})[_0x9565('0x12')](function(_0x307c5e){logger[_0x9565('0x13')](_0x9565('0x1d'),_0x38ee96);logger['debug'](_0x9565('0x1d'),_0x38ee96,JSON[_0x9565('0x16')](_0x307c5e));_0x5ad11f(_0x307c5e);})['catch'](function(_0x301476){logger['error']('ShowSquareProject',_0x301476['message'],_0x38ee96);_0x2fd247(_0x291c5a[_0x9565('0x17')](0x1f4,_0x301476[_0x9565('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 530c125..e67f94b 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 _0x80c9=['remove','update','emit','removeListener','register','./squareProject.events','save'];(function(_0x2febc3,_0x24ff35){var _0x9eeb7c=function(_0x216e24){while(--_0x216e24){_0x2febc3['push'](_0x2febc3['shift']());}};_0x9eeb7c(++_0x24ff35);}(_0x80c9,0x1e1));var _0x980c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x80c9[_0x14add3];return _0x4a174f;};'use strict';var SquareProjectEvents=require(_0x980c('0x0'));var events=[_0x980c('0x1'),_0x980c('0x2'),_0x980c('0x3')];function createListener(_0x3db4de,_0x20d901){return function(_0x794db){_0x20d901[_0x980c('0x4')](_0x3db4de,_0x794db);};}function removeListener(_0x3cbe86,_0x30f0ec){return function(){SquareProjectEvents[_0x980c('0x5')](_0x3cbe86,_0x30f0ec);};}exports[_0x980c('0x6')]=function(_0x2fd56b){for(var _0x5da920=0x0,_0x4e5a73=events['length'];_0x5da920<_0x4e5a73;_0x5da920++){var _0x60ef2d=events[_0x5da920];var _0x1d2d63=createListener('squareProject:'+_0x60ef2d,_0x2fd56b);SquareProjectEvents['on'](_0x60ef2d,_0x1d2d63);}}; \ No newline at end of file +var _0x7f35=['save','remove','update','removeListener','register','length','squareProject:','./squareProject.events'];(function(_0x246e2e,_0x3a62f6){var _0x2ae634=function(_0x559518){while(--_0x559518){_0x246e2e['push'](_0x246e2e['shift']());}};_0x2ae634(++_0x3a62f6);}(_0x7f35,0x15f));var _0x57f3=function(_0x4b65ed,_0x5855cb){_0x4b65ed=_0x4b65ed-0x0;var _0x3a0588=_0x7f35[_0x4b65ed];return _0x3a0588;};'use strict';var SquareProjectEvents=require(_0x57f3('0x0'));var events=[_0x57f3('0x1'),_0x57f3('0x2'),_0x57f3('0x3')];function createListener(_0x2af04c,_0x9a5107){return function(_0x5d045d){_0x9a5107['emit'](_0x2af04c,_0x5d045d);};}function removeListener(_0x1d1d5d,_0x48f362){return function(){SquareProjectEvents[_0x57f3('0x4')](_0x1d1d5d,_0x48f362);};}exports[_0x57f3('0x5')]=function(_0x2a9b0f){for(var _0x1b5cc8=0x0,_0x5b75db=events[_0x57f3('0x6')];_0x1b5cc8<_0x5b75db;_0x1b5cc8++){var _0x12b968=events[_0x1b5cc8];var _0x587384=createListener(_0x57f3('0x7')+_0x12b968,_0x2a9b0f);SquareProjectEvents['on'](_0x12b968,_0x587384);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 2a3d99f..06f7bc2 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 _0x7fbe=['/:id','show','/:id/download','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','index'];(function(_0x2a9c07,_0xacf55){var _0x2001f0=function(_0x5a2d4d){while(--_0x5a2d4d){_0x2a9c07['push'](_0x2a9c07['shift']());}};_0x2001f0(++_0xacf55);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x7b842c,_0x393863){_0x7b842c=_0x7b842c-0x0;var _0x5c3f59=_0x7fbe[_0x7b842c];return _0x5c3f59;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')]('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xb')]);router[_0xe7fb('0x9')](_0xe7fb('0xc'),auth['isAuthenticated'](),controller[_0xe7fb('0xd')]);router[_0xe7fb('0x9')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller['download']);router['post']('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xf')]);router[_0xe7fb('0x10')](_0xe7fb('0xc'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x11')]);router[_0xe7fb('0x12')](_0xe7fb('0xc'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x13')]);module[_0xe7fb('0x14')]=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(_0x27dd31,_0x549f1e){var _0x5e0d55=function(_0x551be5){while(--_0x551be5){_0x27dd31['push'](_0x27dd31['shift']());}};_0x5e0d55(++_0x549f1e);}(_0xf494,0x1c6));var _0x4f49=function(_0x149e99,_0x593f97){_0x149e99=_0x149e99-0x0;var _0x5bb596=_0xf494[_0x149e99];return _0x5bb596;};'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 80a56f4..89c9bb5 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 _0x032e=['VIRTUAL','getDataValue','savePath','substring','lastIndexOf','sequelize','STRING'];(function(_0x23d189,_0x3aa2a5){var _0x2c75cf=function(_0x40f286){while(--_0x40f286){_0x23d189['push'](_0x23d189['shift']());}};_0x2c75cf(++_0x3aa2a5);}(_0x032e,0x124));var _0xe032=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x032e[_0xbb091];return _0x467a04;};'use strict';var Sequelize=require(_0xe032('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe032('0x1')]},'callerid':{'type':Sequelize[_0xe032('0x1')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xe032('0x1')]},'priority':{'type':Sequelize[_0xe032('0x1')]},'accountcode':{'type':Sequelize[_0xe032('0x1')]},'dnid':{'type':Sequelize[_0xe032('0x1')]},'projectName':{'type':Sequelize[_0xe032('0x1')]},'saveName':{'type':Sequelize[_0xe032('0x1')]},'filename':{'type':Sequelize[_0xe032('0x1')]},'savePath':{'type':Sequelize[_0xe032('0x1')]},'format':{'type':Sequelize[_0xe032('0x2')],'get':function(){var _0x1576c8='';var _0x3289b0=this[_0xe032('0x3')](_0xe032('0x4'));if(_0x3289b0){_0x1576c8=_0x3289b0[_0xe032('0x5')](_0x3289b0[_0xe032('0x6')]('.'));}return _0x1576c8;}}}; \ No newline at end of file +var _0x55ca=['sequelize','exports','STRING','VIRTUAL','getDataValue','substring','lastIndexOf'];(function(_0x2c4ef4,_0x21ffd7){var _0xb5b9f0=function(_0x15d0ea){while(--_0x15d0ea){_0x2c4ef4['push'](_0x2c4ef4['shift']());}};_0xb5b9f0(++_0x21ffd7);}(_0x55ca,0x126));var _0xa55c=function(_0x4e697a,_0x56a14b){_0x4e697a=_0x4e697a-0x0;var _0x88850c=_0x55ca[_0x4e697a];return _0x88850c;};'use strict';var Sequelize=require(_0xa55c('0x0'));module[_0xa55c('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xa55c('0x2')]},'extension':{'type':Sequelize[_0xa55c('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xa55c('0x2')]},'dnid':{'type':Sequelize[_0xa55c('0x2')]},'projectName':{'type':Sequelize[_0xa55c('0x2')]},'saveName':{'type':Sequelize[_0xa55c('0x2')]},'filename':{'type':Sequelize[_0xa55c('0x2')]},'savePath':{'type':Sequelize[_0xa55c('0x2')]},'format':{'type':Sequelize[_0xa55c('0x3')],'get':function(){var _0x4d0624='';var _0x2121fd=this[_0xa55c('0x4')]('savePath');if(_0x2121fd){_0x4d0624=_0x2121fd[_0xa55c('0x5')](_0x2121fd[_0xa55c('0x6')]('.'));}return _0x4d0624;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index b13c36a..1d893d1 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 _0x81de=['../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','SquareRecording','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','download','../../components/encryptor','uniqueid','savePath','filename','format','existsSync','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','Not\x20found','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x73865a,_0x451e72){var _0x47767f=function(_0x56aa35){while(--_0x56aa35){_0x73865a['push'](_0x73865a['shift']());}};_0x47767f(++_0x451e72);}(_0x81de,0x110));var _0xe81d=function(_0xab014e,_0x4f00d1){_0xab014e=_0xab014e-0x0;var _0x376735=_0x81de[_0xab014e];return _0x376735;};'use strict';var emlformat=require(_0xe81d('0x0'));var rimraf=require(_0xe81d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe81d('0x2'));var rp=require('request-promise');var moment=require(_0xe81d('0x3'));var BPromise=require(_0xe81d('0x4'));var Mustache=require(_0xe81d('0x5'));var util=require('util');var path=require('path');var sox=require(_0xe81d('0x6'));var csv=require('to-csv');var ejs=require(_0xe81d('0x7'));var fs=require('fs');var fs_extra=require(_0xe81d('0x8'));var _=require(_0xe81d('0x9'));var squel=require(_0xe81d('0xa'));var crypto=require(_0xe81d('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe81d('0xc'));var toCsv=require(_0xe81d('0xd'));var querystring=require(_0xe81d('0xe'));var Papa=require('papaparse');var Redis=require(_0xe81d('0xf'));var authService=require(_0xe81d('0x10'));var qs=require(_0xe81d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe81d('0x12'));var logger=require(_0xe81d('0x13'))(_0xe81d('0x14'));var utils=require(_0xe81d('0x15'));var config=require(_0xe81d('0x16'));var licenseUtil=require(_0xe81d('0x17'));var db=require(_0xe81d('0x18'))['db'];function respondWithStatusCode(_0x109c95,_0x53959e){_0x53959e=_0x53959e||0xcc;return function(_0x35116e){if(_0x35116e){return _0x109c95['sendStatus'](_0x53959e);}return _0x109c95[_0xe81d('0x19')](_0x53959e)[_0xe81d('0x1a')]();};}function respondWithResult(_0x2fe2d2,_0x3e363e){_0x3e363e=_0x3e363e||0xc8;return function(_0x237594){if(_0x237594){return _0x2fe2d2[_0xe81d('0x19')](_0x3e363e)[_0xe81d('0x1b')](_0x237594);}};}function respondWithFilteredResult(_0x1e79f6,_0xf92970){return function(_0x3da069){if(_0x3da069){var _0x473bc7=typeof _0xf92970[_0xe81d('0x1c')]==='undefined'&&typeof _0xf92970[_0xe81d('0x1d')]===_0xe81d('0x1e');var _0xec4175=_0x3da069[_0xe81d('0x1f')];var _0x4b6643=_0x473bc7?0x0:_0xf92970[_0xe81d('0x1c')];var _0x1ca804=_0x473bc7?_0x3da069[_0xe81d('0x1f')]:_0xf92970['offset']+_0xf92970[_0xe81d('0x1d')];var _0x24b993;if(_0x1ca804>=_0xec4175){_0x1ca804=_0xec4175;_0x24b993=0xc8;}else{_0x24b993=0xce;}_0x1e79f6[_0xe81d('0x19')](_0x24b993);return _0x1e79f6[_0xe81d('0x20')](_0xe81d('0x21'),_0x4b6643+'-'+_0x1ca804+'/'+_0xec4175)[_0xe81d('0x1b')](_0x3da069);}return null;};}function patchUpdates(_0x25c244){return function(_0x200cbc){try{jsonpatch[_0xe81d('0x22')](_0x200cbc,_0x25c244,!![]);}catch(_0x2124eb){return BPromise['reject'](_0x2124eb);}return _0x200cbc[_0xe81d('0x23')]();};}function saveUpdates(_0x22d22e,_0x4bb7b4){return function(_0x1cb2a5){if(_0x1cb2a5){return _0x1cb2a5[_0xe81d('0x24')](_0x22d22e)[_0xe81d('0x25')](function(_0x3a53bb){return _0x3a53bb;});}return null;};}function removeEntity(_0x150f29,_0x3cf823){return function(_0x40ae66){if(_0x40ae66){return _0x40ae66[_0xe81d('0x26')]()[_0xe81d('0x25')](function(){_0x150f29[_0xe81d('0x19')](0xcc)[_0xe81d('0x1a')]();});}};}function handleEntityNotFound(_0x46d1c9,_0x189b3){return function(_0x439987){if(!_0x439987){_0x46d1c9[_0xe81d('0x27')](0x194);}return _0x439987;};}function handleError(_0x17a808,_0x1d8537){_0x1d8537=_0x1d8537||0x1f4;return function(_0x41d820){logger[_0xe81d('0x28')](_0x41d820[_0xe81d('0x29')]);if(_0x41d820[_0xe81d('0x2a')]){delete _0x41d820[_0xe81d('0x2a')];}_0x17a808['status'](_0x1d8537)[_0xe81d('0x2b')](_0x41d820);};}exports[_0xe81d('0x2c')]=function(_0x195896,_0x53a0e6){var _0x450361={},_0x3b4287={},_0x1514a1={'count':0x0,'rows':[]};var _0x308d20=_[_0xe81d('0x2d')](db[_0xe81d('0x2e')][_0xe81d('0x2f')],function(_0x4227f3){return{'name':_0x4227f3[_0xe81d('0x30')],'type':_0x4227f3[_0xe81d('0x31')]['key']};});_0x3b4287[_0xe81d('0x32')]=_['map'](_0x308d20,_0xe81d('0x2a'));_0x3b4287['query']=_['keys'](_0x195896[_0xe81d('0x33')]);_0x3b4287[_0xe81d('0x34')]=_[_0xe81d('0x35')](_0x3b4287['model'],_0x3b4287['query']);_0x450361[_0xe81d('0x36')]=_['intersection'](_0x3b4287[_0xe81d('0x32')],qs['fields'](_0x195896[_0xe81d('0x33')][_0xe81d('0x37')]));_0x450361[_0xe81d('0x36')]=_0x450361['attributes'][_0xe81d('0x38')]?_0x450361[_0xe81d('0x36')]:_0x3b4287[_0xe81d('0x32')];if(!_0x195896[_0xe81d('0x33')][_0xe81d('0x39')](_0xe81d('0x3a'))){_0x450361[_0xe81d('0x1d')]=qs[_0xe81d('0x1d')](_0x195896[_0xe81d('0x33')]['limit']);_0x450361[_0xe81d('0x1c')]=qs[_0xe81d('0x1c')](_0x195896[_0xe81d('0x33')][_0xe81d('0x1c')]);}_0x450361[_0xe81d('0x3b')]=qs[_0xe81d('0x3c')](_0x195896[_0xe81d('0x33')][_0xe81d('0x3c')]);_0x450361[_0xe81d('0x3d')]=qs[_0xe81d('0x34')](_[_0xe81d('0x3e')](_0x195896['query'],_0x3b4287['filters']),_0x308d20);if(_0x195896[_0xe81d('0x33')][_0xe81d('0x3f')]){_0x450361[_0xe81d('0x3d')]=_[_0xe81d('0x40')](_0x450361[_0xe81d('0x3d')],{'$or':_[_0xe81d('0x2d')](_0x308d20,function(_0x56398f){if(_0x56398f['type']!=='VIRTUAL'){var _0x516a76={};_0x516a76[_0x56398f[_0xe81d('0x2a')]]={'$like':'%'+_0x195896[_0xe81d('0x33')][_0xe81d('0x3f')]+'%'};return _0x516a76;}})});}_0x450361=_['merge']({},_0x450361,_0x195896[_0xe81d('0x41')]);var _0x5416fa={'where':_0x450361['where']};return db[_0xe81d('0x2e')][_0xe81d('0x1f')](_0x5416fa)['then'](function(_0x1674f5){_0x1514a1[_0xe81d('0x1f')]=_0x1674f5;if(_0x195896[_0xe81d('0x33')][_0xe81d('0x42')]){_0x450361[_0xe81d('0x43')]=[{'all':!![]}];}return db[_0xe81d('0x2e')][_0xe81d('0x44')](_0x450361);})[_0xe81d('0x25')](function(_0x4da454){_0x1514a1['rows']=_0x4da454;return _0x1514a1;})[_0xe81d('0x25')](respondWithFilteredResult(_0x53a0e6,_0x450361))[_0xe81d('0x45')](handleError(_0x53a0e6,null));};exports[_0xe81d('0x46')]=function(_0x45c9a1,_0x3754c4){var _0x430503={'raw':!![],'where':{'id':_0x45c9a1[_0xe81d('0x47')]['id']}},_0x527d14={};_0x527d14['model']=_[_0xe81d('0x48')](db[_0xe81d('0x2e')][_0xe81d('0x2f')]);_0x527d14[_0xe81d('0x33')]=_[_0xe81d('0x48')](_0x45c9a1[_0xe81d('0x33')]);_0x527d14['filters']=_[_0xe81d('0x35')](_0x527d14['model'],_0x527d14[_0xe81d('0x33')]);_0x430503[_0xe81d('0x36')]=_[_0xe81d('0x35')](_0x527d14[_0xe81d('0x32')],qs['fields'](_0x45c9a1[_0xe81d('0x33')][_0xe81d('0x37')]));_0x430503[_0xe81d('0x36')]=_0x430503[_0xe81d('0x36')][_0xe81d('0x38')]?_0x430503[_0xe81d('0x36')]:_0x527d14[_0xe81d('0x32')];if(_0x45c9a1[_0xe81d('0x33')][_0xe81d('0x42')]){_0x430503[_0xe81d('0x43')]=[{'all':!![]}];}_0x430503=_['merge']({},_0x430503,_0x45c9a1['options']);return db[_0xe81d('0x2e')][_0xe81d('0x49')](_0x430503)['then'](handleEntityNotFound(_0x3754c4,null))[_0xe81d('0x25')](respondWithResult(_0x3754c4,null))[_0xe81d('0x45')](handleError(_0x3754c4,null));};exports['create']=function(_0x3d6031,_0x357fcd){return db[_0xe81d('0x2e')][_0xe81d('0x4a')](_0x3d6031[_0xe81d('0x4b')],{})[_0xe81d('0x25')](respondWithResult(_0x357fcd,0xc9))[_0xe81d('0x45')](handleError(_0x357fcd,null));};exports[_0xe81d('0x24')]=function(_0x19177f,_0x405bfe){if(_0x19177f[_0xe81d('0x4b')]['id']){delete _0x19177f[_0xe81d('0x4b')]['id'];}return db[_0xe81d('0x2e')]['find']({'where':{'id':_0x19177f['params']['id']}})[_0xe81d('0x25')](handleEntityNotFound(_0x405bfe,null))[_0xe81d('0x25')](saveUpdates(_0x19177f[_0xe81d('0x4b')],null))[_0xe81d('0x25')](respondWithResult(_0x405bfe,null))[_0xe81d('0x45')](handleError(_0x405bfe,null));};exports[_0xe81d('0x4c')]=function(_0x5cb418,_0x4282bf,_0x4a2f1e){var _0x2ddaf7=require(_0xe81d('0x4d'));var _0x5bf7fb=![];var _0xedb23f={};if(_0x5cb418[_0xe81d('0x33')][_0xe81d('0x31')]&&_0x5cb418['query'][_0xe81d('0x31')]===_0xe81d('0x4e')){_0xedb23f[_0xe81d('0x4e')]=_0x5cb418[_0xe81d('0x47')]['id'];}else{_0xedb23f['id']=_0x5cb418['params']['id'];}return db[_0xe81d('0x2e')][_0xe81d('0x49')]({'where':_0xedb23f,'attributes':['id',_0xe81d('0x4f'),_0xe81d('0x50')],'raw':!![]})['then'](handleEntityNotFound(_0x4282bf,null))[_0xe81d('0x25')](function(_0x29d631){if(_0x29d631){var _0xc2bff2=_0x29d631['savePath'];var _0xf5ae34=util[_0xe81d('0x51')]('%s.cypher',_0xc2bff2);if(fs[_0xe81d('0x52')](_0xf5ae34)){_0x5bf7fb=!![];return _0x2ddaf7['decryptFile'](_0xf5ae34,_0xc2bff2,config['secrets'][_0xe81d('0x53')])[_0xe81d('0x25')](function(){return _0x29d631;});}return _0x29d631;}})['then'](function(_0x9dd30b){if(_0x9dd30b){var _0x59a262=_0x9dd30b[_0xe81d('0x4f')];if(!fs['existsSync'](_0x59a262)){throw new db[(_0xe81d('0x54'))][(_0xe81d('0x55'))](_0xe81d('0x56'));}if(_0x9dd30b[_0xe81d('0x50')]){return _0x4282bf[_0xe81d('0x4c')](_0x59a262,_0x9dd30b['filename']+path[_0xe81d('0x57')](_0x59a262),function(){if(_0x5bf7fb){fs['unlink'](_0x59a262);}});}else{return _0x4282bf[_0xe81d('0x4c')](_0x59a262,function(_0x2f0188){if(_0x5bf7fb){fs[_0xe81d('0x58')](_0x59a262);}});}}})[_0xe81d('0x45')](function(_0x1b5dd6){if(_0x1b5dd6[_0xe81d('0x59')]===_0xe81d('0x56')){_0x4282bf[_0xe81d('0x19')](0x194)[_0xe81d('0x2b')](_0xe81d('0x5a'));}else{return handleError(_0x4282bf,null);}});};exports[_0xe81d('0x26')]=function(_0x223ec0,_0x49e7a3){return db[_0xe81d('0x2e')][_0xe81d('0x49')]({'where':{'id':_0x223ec0[_0xe81d('0x47')]['id']}})[_0xe81d('0x25')](function(_0x86532f){if(_[_0xe81d('0x5b')](_0x86532f)){throw new ReferenceError('Entity\x20not\x20found');}return _0x86532f;})['then'](function(_0x2b679c){var _0x4dd19f=_0x2b679c['savePath'];logger[_0xe81d('0x5c')](_0xe81d('0x5d'),_0x4dd19f);if(!_[_0xe81d('0x5b')](_0x2b679c[_0xe81d('0x4f')])&&fs[_0xe81d('0x52')](_0x4dd19f)){logger['info'](_0xe81d('0x5e')+_0x4dd19f+_0xe81d('0x5f'));fs[_0xe81d('0x60')](_0x4dd19f);}_0x4dd19f=_0x4dd19f+_0xe81d('0x61');if(!_['isNil'](_0x2b679c['savePath'])&&fs[_0xe81d('0x52')](_0x4dd19f)){logger['info']('File:\x20\x22'+_0x4dd19f+_0xe81d('0x5f'));fs[_0xe81d('0x60')](_0x4dd19f);}return _0x2b679c;})[_0xe81d('0x25')](function(_0x57283f){if(!_0x57283f)throw new InternalError();return _0x57283f[_0xe81d('0x26')]();})[_0xe81d('0x25')](function(){_0x49e7a3[_0xe81d('0x19')](0xcc)[_0xe81d('0x1a')]();})[_0xe81d('0x45')](handleError(_0x49e7a3,null));}; \ No newline at end of file +var _0xf50e=['order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','find','catch','create','body','../../components/encryptor','uniqueid','savePath','%s.cypher','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','SquareRecording\x20not\x20found','download','filename','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','info','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','reject','save','update','then','destroy','stack','name','index','map','SquareRecording','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x288bcb,_0x49604d){var _0x2c0faa=function(_0x46d235){while(--_0x46d235){_0x288bcb['push'](_0x288bcb['shift']());}};_0x2c0faa(++_0x49604d);}(_0xf50e,0x8c));var _0xef50=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0xf50e[_0x1b7368];return _0x25d54c;};'use strict';var emlformat=require(_0xef50('0x0'));var rimraf=require(_0xef50('0x1'));var zipdir=require(_0xef50('0x2'));var jsonpatch=require(_0xef50('0x3'));var rp=require(_0xef50('0x4'));var moment=require('moment');var BPromise=require(_0xef50('0x5'));var Mustache=require('mustache');var util=require(_0xef50('0x6'));var path=require(_0xef50('0x7'));var sox=require('sox');var csv=require(_0xef50('0x8'));var ejs=require(_0xef50('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xef50('0xa'));var squel=require('squel');var crypto=require(_0xef50('0xb'));var jsforce=require(_0xef50('0xc'));var deskjs=require(_0xef50('0xd'));var toCsv=require('to-csv');var querystring=require(_0xef50('0xe'));var Papa=require('papaparse');var Redis=require(_0xef50('0xf'));var authService=require(_0xef50('0x10'));var qs=require(_0xef50('0x11'));var as=require(_0xef50('0x12'));var hardwareService=require(_0xef50('0x13'));var logger=require(_0xef50('0x14'))(_0xef50('0x15'));var utils=require('../../config/utils');var config=require(_0xef50('0x16'));var licenseUtil=require(_0xef50('0x17'));var db=require(_0xef50('0x18'))['db'];function respondWithStatusCode(_0x1b5ef6,_0x3b637c){_0x3b637c=_0x3b637c||0xcc;return function(_0x1c68bc){if(_0x1c68bc){return _0x1b5ef6[_0xef50('0x19')](_0x3b637c);}return _0x1b5ef6[_0xef50('0x1a')](_0x3b637c)[_0xef50('0x1b')]();};}function respondWithResult(_0x9d5688,_0x39389b){_0x39389b=_0x39389b||0xc8;return function(_0x78c024){if(_0x78c024){return _0x9d5688['status'](_0x39389b)['json'](_0x78c024);}};}function respondWithFilteredResult(_0x1a11ef,_0xbce9f5){return function(_0x498206){if(_0x498206){var _0x39a88c=typeof _0xbce9f5[_0xef50('0x1c')]===_0xef50('0x1d')&&typeof _0xbce9f5[_0xef50('0x1e')]===_0xef50('0x1d');var _0xf59c74=_0x498206[_0xef50('0x1f')];var _0x37bba9=_0x39a88c?0x0:_0xbce9f5[_0xef50('0x1c')];var _0x45f13d=_0x39a88c?_0x498206[_0xef50('0x1f')]:_0xbce9f5[_0xef50('0x1c')]+_0xbce9f5['limit'];var _0x41eddd;if(_0x45f13d>=_0xf59c74){_0x45f13d=_0xf59c74;_0x41eddd=0xc8;}else{_0x41eddd=0xce;}_0x1a11ef[_0xef50('0x1a')](_0x41eddd);return _0x1a11ef[_0xef50('0x20')]('Content-Range',_0x37bba9+'-'+_0x45f13d+'/'+_0xf59c74)[_0xef50('0x21')](_0x498206);}return null;};}function patchUpdates(_0x32d6f6){return function(_0x2e7e02){try{jsonpatch['apply'](_0x2e7e02,_0x32d6f6,!![]);}catch(_0x421d49){return BPromise[_0xef50('0x22')](_0x421d49);}return _0x2e7e02[_0xef50('0x23')]();};}function saveUpdates(_0x10c223,_0x44cc68){return function(_0x351430){if(_0x351430){return _0x351430[_0xef50('0x24')](_0x10c223)[_0xef50('0x25')](function(_0x3e0e0c){return _0x3e0e0c;});}return null;};}function removeEntity(_0x77527c,_0x1d3567){return function(_0x53772b){if(_0x53772b){return _0x53772b[_0xef50('0x26')]()[_0xef50('0x25')](function(){_0x77527c[_0xef50('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45c3cd,_0xcf03a6){return function(_0x1c8a4a){if(!_0x1c8a4a){_0x45c3cd['sendStatus'](0x194);}return _0x1c8a4a;};}function handleError(_0x4e3ee4,_0x34c296){_0x34c296=_0x34c296||0x1f4;return function(_0x4670c7){logger['error'](_0x4670c7[_0xef50('0x27')]);if(_0x4670c7[_0xef50('0x28')]){delete _0x4670c7['name'];}_0x4e3ee4[_0xef50('0x1a')](_0x34c296)['send'](_0x4670c7);};}exports[_0xef50('0x29')]=function(_0x2d0f45,_0x54eb53){var _0x5ca131={},_0x37306f={},_0x5bc844={'count':0x0,'rows':[]};var _0x54816f=_[_0xef50('0x2a')](db[_0xef50('0x2b')][_0xef50('0x2c')],function(_0x5df976){return{'name':_0x5df976[_0xef50('0x2d')],'type':_0x5df976[_0xef50('0x2e')][_0xef50('0x2f')]};});_0x37306f[_0xef50('0x30')]=_[_0xef50('0x2a')](_0x54816f,_0xef50('0x28'));_0x37306f['query']=_[_0xef50('0x31')](_0x2d0f45['query']);_0x37306f[_0xef50('0x32')]=_[_0xef50('0x33')](_0x37306f[_0xef50('0x30')],_0x37306f[_0xef50('0x34')]);_0x5ca131[_0xef50('0x35')]=_['intersection'](_0x37306f[_0xef50('0x30')],qs['fields'](_0x2d0f45[_0xef50('0x34')][_0xef50('0x36')]));_0x5ca131['attributes']=_0x5ca131['attributes'][_0xef50('0x37')]?_0x5ca131[_0xef50('0x35')]:_0x37306f[_0xef50('0x30')];if(!_0x2d0f45[_0xef50('0x34')][_0xef50('0x38')](_0xef50('0x39'))){_0x5ca131[_0xef50('0x1e')]=qs['limit'](_0x2d0f45[_0xef50('0x34')][_0xef50('0x1e')]);_0x5ca131[_0xef50('0x1c')]=qs[_0xef50('0x1c')](_0x2d0f45[_0xef50('0x34')][_0xef50('0x1c')]);}_0x5ca131[_0xef50('0x3a')]=qs['sort'](_0x2d0f45[_0xef50('0x34')][_0xef50('0x3b')]);_0x5ca131[_0xef50('0x3c')]=qs[_0xef50('0x32')](_[_0xef50('0x3d')](_0x2d0f45['query'],_0x37306f['filters']),_0x54816f);if(_0x2d0f45[_0xef50('0x34')][_0xef50('0x3e')]){_0x5ca131[_0xef50('0x3c')]=_[_0xef50('0x3f')](_0x5ca131[_0xef50('0x3c')],{'$or':_['map'](_0x54816f,function(_0x2b8941){if(_0x2b8941[_0xef50('0x2e')]!==_0xef50('0x40')){var _0x536569={};_0x536569[_0x2b8941['name']]={'$like':'%'+_0x2d0f45[_0xef50('0x34')][_0xef50('0x3e')]+'%'};return _0x536569;}})});}_0x5ca131=_[_0xef50('0x3f')]({},_0x5ca131,_0x2d0f45[_0xef50('0x41')]);var _0x1dc162={'where':_0x5ca131[_0xef50('0x3c')]};return db['SquareRecording'][_0xef50('0x1f')](_0x1dc162)[_0xef50('0x25')](function(_0x311e23){_0x5bc844[_0xef50('0x1f')]=_0x311e23;if(_0x2d0f45[_0xef50('0x34')][_0xef50('0x42')]){_0x5ca131[_0xef50('0x43')]=[{'all':!![]}];}return db[_0xef50('0x2b')][_0xef50('0x44')](_0x5ca131);})['then'](function(_0x220563){_0x5bc844[_0xef50('0x45')]=_0x220563;return _0x5bc844;})[_0xef50('0x25')](respondWithFilteredResult(_0x54eb53,_0x5ca131))['catch'](handleError(_0x54eb53,null));};exports['show']=function(_0x4dab76,_0x316150){var _0x585c02={'raw':!![],'where':{'id':_0x4dab76[_0xef50('0x46')]['id']}},_0x36165d={};_0x36165d[_0xef50('0x30')]=_['keys'](db[_0xef50('0x2b')][_0xef50('0x2c')]);_0x36165d[_0xef50('0x34')]=_[_0xef50('0x31')](_0x4dab76[_0xef50('0x34')]);_0x36165d['filters']=_['intersection'](_0x36165d[_0xef50('0x30')],_0x36165d[_0xef50('0x34')]);_0x585c02[_0xef50('0x35')]=_[_0xef50('0x33')](_0x36165d[_0xef50('0x30')],qs[_0xef50('0x36')](_0x4dab76['query'][_0xef50('0x36')]));_0x585c02['attributes']=_0x585c02['attributes'][_0xef50('0x37')]?_0x585c02['attributes']:_0x36165d[_0xef50('0x30')];if(_0x4dab76[_0xef50('0x34')][_0xef50('0x42')]){_0x585c02[_0xef50('0x43')]=[{'all':!![]}];}_0x585c02=_['merge']({},_0x585c02,_0x4dab76[_0xef50('0x41')]);return db[_0xef50('0x2b')][_0xef50('0x47')](_0x585c02)[_0xef50('0x25')](handleEntityNotFound(_0x316150,null))['then'](respondWithResult(_0x316150,null))[_0xef50('0x48')](handleError(_0x316150,null));};exports['create']=function(_0x5cf637,_0x125c9e){return db[_0xef50('0x2b')][_0xef50('0x49')](_0x5cf637[_0xef50('0x4a')],{})[_0xef50('0x25')](respondWithResult(_0x125c9e,0xc9))[_0xef50('0x48')](handleError(_0x125c9e,null));};exports[_0xef50('0x24')]=function(_0x93fc49,_0xd54063){if(_0x93fc49[_0xef50('0x4a')]['id']){delete _0x93fc49[_0xef50('0x4a')]['id'];}return db[_0xef50('0x2b')][_0xef50('0x47')]({'where':{'id':_0x93fc49[_0xef50('0x46')]['id']}})[_0xef50('0x25')](handleEntityNotFound(_0xd54063,null))['then'](saveUpdates(_0x93fc49['body'],null))['then'](respondWithResult(_0xd54063,null))[_0xef50('0x48')](handleError(_0xd54063,null));};exports['download']=function(_0x6fc01f,_0x12cb3a,_0x4b3c35){var _0x53822d=require(_0xef50('0x4b'));var _0x4fc594=![];var _0x9fb7fc={};if(_0x6fc01f[_0xef50('0x34')][_0xef50('0x2e')]&&_0x6fc01f[_0xef50('0x34')][_0xef50('0x2e')]===_0xef50('0x4c')){_0x9fb7fc[_0xef50('0x4c')]=_0x6fc01f[_0xef50('0x46')]['id'];}else{_0x9fb7fc['id']=_0x6fc01f[_0xef50('0x46')]['id'];}return db['SquareRecording'][_0xef50('0x47')]({'where':_0x9fb7fc,'attributes':['id',_0xef50('0x4d'),'filename'],'raw':!![]})[_0xef50('0x25')](handleEntityNotFound(_0x12cb3a,null))[_0xef50('0x25')](function(_0xdec6c4){if(_0xdec6c4){var _0x356592=_0xdec6c4[_0xef50('0x4d')];var _0x33dbb6=util['format'](_0xef50('0x4e'),_0x356592);if(fs['existsSync'](_0x33dbb6)){_0x4fc594=!![];return _0x53822d[_0xef50('0x4f')](_0x33dbb6,_0x356592,config[_0xef50('0x50')][_0xef50('0x51')])[_0xef50('0x25')](function(){return _0xdec6c4;});}return _0xdec6c4;}})[_0xef50('0x25')](function(_0x3b924b){if(_0x3b924b){var _0x1333c9=_0x3b924b['savePath'];if(!fs[_0xef50('0x52')](_0x1333c9)){throw new db[(_0xef50('0x53'))][(_0xef50('0x54'))](_0xef50('0x55'));}if(_0x3b924b['filename']){return _0x12cb3a[_0xef50('0x56')](_0x1333c9,_0x3b924b[_0xef50('0x57')]+path['extname'](_0x1333c9),function(){if(_0x4fc594){fs['unlink'](_0x1333c9);}});}else{return _0x12cb3a[_0xef50('0x56')](_0x1333c9,function(_0x3701a5){if(_0x4fc594){fs[_0xef50('0x58')](_0x1333c9);}});}}})['catch'](function(_0x128b37){if(_0x128b37[_0xef50('0x59')]==='SquareRecording\x20not\x20found'){_0x12cb3a[_0xef50('0x1a')](0x194)['send'](_0xef50('0x5a'));}else{return handleError(_0x12cb3a,null);}});};exports[_0xef50('0x26')]=function(_0x1a118c,_0x259afb){return db['SquareRecording']['find']({'where':{'id':_0x1a118c[_0xef50('0x46')]['id']}})['then'](function(_0x9568db){if(_[_0xef50('0x5b')](_0x9568db)){throw new ReferenceError(_0xef50('0x5c'));}return _0x9568db;})[_0xef50('0x25')](function(_0x25e411){var _0x3e1c4e=_0x25e411[_0xef50('0x4d')];logger['info'](_0xef50('0x5d'),_0x3e1c4e);if(!_[_0xef50('0x5b')](_0x25e411[_0xef50('0x4d')])&&fs[_0xef50('0x52')](_0x3e1c4e)){logger['info'](_0xef50('0x5e')+_0x3e1c4e+_0xef50('0x5f'));fs['unlinkSync'](_0x3e1c4e);}_0x3e1c4e=_0x3e1c4e+_0xef50('0x60');if(!_[_0xef50('0x5b')](_0x25e411['savePath'])&&fs[_0xef50('0x52')](_0x3e1c4e)){logger[_0xef50('0x61')](_0xef50('0x5e')+_0x3e1c4e+_0xef50('0x5f'));fs[_0xef50('0x62')](_0x3e1c4e);}return _0x25e411;})[_0xef50('0x25')](function(_0x393cd3){if(!_0x393cd3)throw new InternalError();return _0x393cd3[_0xef50('0x26')]();})[_0xef50('0x25')](function(){_0x259afb[_0xef50('0x1a')](0xcc)[_0xef50('0x1b')]();})[_0xef50('0x48')](handleError(_0x259afb,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 2e74f93..a05df75 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 _0x9b2c=['request-promise','rimraf','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','square_recordings','util','../../config/logger','moment'];(function(_0x5960d1,_0x334d55){var _0x392307=function(_0x51d415){while(--_0x51d415){_0x5960d1['push'](_0x5960d1['shift']());}};_0x392307(++_0x334d55);}(_0x9b2c,0x189));var _0xc9b2=function(_0x143ce6,_0x46e089){_0x143ce6=_0x143ce6-0x0;var _0x33ed64=_0x9b2c[_0x143ce6];return _0x33ed64;};'use strict';var _=require('lodash');var util=require(_0xc9b2('0x0'));var logger=require(_0xc9b2('0x1'))('api');var moment=require(_0xc9b2('0x2'));var BPromise=require('bluebird');var rp=require(_0xc9b2('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc9b2('0x4'));var config=require(_0xc9b2('0x5'));var attributes=require(_0xc9b2('0x6'));module[_0xc9b2('0x7')]=function(_0x15be55,_0x3e6343){return _0x15be55[_0xc9b2('0x8')](_0xc9b2('0x9'),attributes,{'tableName':_0xc9b2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x36fe=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','define','SquareRecording','lodash','util','../../config/logger','api'];(function(_0x1e652d,_0x28d5bf){var _0x50a16d=function(_0x1b6994){while(--_0x1b6994){_0x1e652d['push'](_0x1e652d['shift']());}};_0x50a16d(++_0x28d5bf);}(_0x36fe,0x127));var _0xe36f=function(_0x278f93,_0x5d74c6){_0x278f93=_0x278f93-0x0;var _0x47d224=_0x36fe[_0x278f93];return _0x47d224;};'use strict';var _=require(_0xe36f('0x0'));var util=require(_0xe36f('0x1'));var logger=require(_0xe36f('0x2'))(_0xe36f('0x3'));var moment=require(_0xe36f('0x4'));var BPromise=require(_0xe36f('0x5'));var rp=require(_0xe36f('0x6'));var fs=require('fs');var path=require(_0xe36f('0x7'));var rimraf=require(_0xe36f('0x8'));var config=require(_0xe36f('0x9'));var attributes=require(_0xe36f('0xa'));module['exports']=function(_0x541bae,_0x485a51){return _0x541bae[_0xe36f('0xb')](_0xe36f('0xc'),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 458c965..cdfef4c 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 _0xe072=['catch','CreateSquareRecording','SquareRecording','create','body','options','raw','lodash','util','moment','randomstring','../../config/environment','jayson/promise','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result'];(function(_0x21f1d3,_0x5d60c7){var _0xad5b16=function(_0x3bece1){while(--_0x3bece1){_0x21f1d3['push'](_0x21f1d3['shift']());}};_0xad5b16(++_0x5d60c7);}(_0xe072,0x173));var _0x2e07=function(_0x14554e,_0x1b97f9){_0x14554e=_0x14554e-0x0;var _0x2e516f=_0xe072[_0x14554e];return _0x2e516f;};'use strict';var _=require(_0x2e07('0x0'));var util=require(_0x2e07('0x1'));var moment=require(_0x2e07('0x2'));var BPromise=require('bluebird');var rs=require(_0x2e07('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x2e07('0x4'));var jayson=require(_0x2e07('0x5'));var client=jayson[_0x2e07('0x6')][_0x2e07('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3160d9,_0x20ff0b,_0x391068){return new BPromise(function(_0x40c4f2,_0xfd0b63){return client[_0x2e07('0x8')](_0x3160d9,_0x391068)[_0x2e07('0x9')](function(_0x20d769){logger[_0x2e07('0xa')](_0x2e07('0xb'),_0x20ff0b,'request\x20sent');logger['debug'](_0x2e07('0xc'),_0x20ff0b,'request\x20sent',JSON[_0x2e07('0xd')](_0x20d769));if(_0x20d769[_0x2e07('0xe')]){if(_0x20d769[_0x2e07('0xe')][_0x2e07('0xf')]===0x1f4){logger[_0x2e07('0xe')](_0x2e07('0xb'),_0x20ff0b,_0x20d769[_0x2e07('0xe')][_0x2e07('0x10')]);return _0xfd0b63(_0x20d769['error'][_0x2e07('0x10')]);}logger[_0x2e07('0xe')](_0x2e07('0xb'),_0x20ff0b,_0x20d769[_0x2e07('0xe')][_0x2e07('0x10')]);return _0x40c4f2(_0x20d769[_0x2e07('0xe')][_0x2e07('0x10')]);}else{logger['info'](_0x2e07('0xb'),_0x20ff0b,_0x2e07('0x11'));_0x40c4f2(_0x20d769[_0x2e07('0x12')][_0x2e07('0x10')]);}})[_0x2e07('0x13')](function(_0xfdc782){logger['error'](_0x2e07('0xb'),_0x20ff0b,_0xfdc782);_0xfd0b63(_0xfdc782);});});}exports[_0x2e07('0x14')]=function(_0x42bfad){var _0x54223f=this;return new Promise(function(_0x5927cb,_0x5dbf67){return db[_0x2e07('0x15')][_0x2e07('0x16')](_0x42bfad[_0x2e07('0x17')],{'raw':_0x42bfad['options']?_0x42bfad[_0x2e07('0x18')][_0x2e07('0x19')]===undefined?!![]:![]:!![]})[_0x2e07('0x9')](function(_0x5db89b){logger['info'](_0x2e07('0x14'),_0x42bfad);logger['debug'](_0x2e07('0x14'),_0x42bfad,JSON[_0x2e07('0xd')](_0x5db89b));_0x5927cb(_0x5db89b);})[_0x2e07('0x13')](function(_0x349c11){logger[_0x2e07('0xe')](_0x2e07('0x14'),_0x349c11[_0x2e07('0x10')],_0x42bfad);_0x5dbf67(_0x54223f[_0x2e07('0xe')](0x1f4,_0x349c11[_0x2e07('0x10')]));});});}; \ No newline at end of file +var _0xd2a1=['SquareRecording','create','body','options','raw','then','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','SquareRecording,\x20%s,\x20%s','debug','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateSquareRecording'];(function(_0x487f51,_0x268f8f){var _0xaf1452=function(_0x228ab7){while(--_0x228ab7){_0x487f51['push'](_0x487f51['shift']());}};_0xaf1452(++_0x268f8f);}(_0xd2a1,0x11e));var _0x1d2a=function(_0x8261bb,_0x48e718){_0x8261bb=_0x8261bb-0x0;var _0x530867=_0xd2a1[_0x8261bb];return _0x530867;};'use strict';var _=require(_0x1d2a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1d2a('0x1'));var rs=require(_0x1d2a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1d2a('0x3'))['db'];var utils=require(_0x1d2a('0x4'));var logger=require(_0x1d2a('0x5'))('rpc');var config=require(_0x1d2a('0x6'));var jayson=require(_0x1d2a('0x7'));var client=jayson[_0x1d2a('0x8')][_0x1d2a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x41c9cc,_0x15e945,_0x200f09){return new BPromise(function(_0x42dbd5,_0x4eef44){return client['request'](_0x41c9cc,_0x200f09)['then'](function(_0x3ccfcb){logger[_0x1d2a('0xa')](_0x1d2a('0xb'),_0x15e945,'request\x20sent');logger[_0x1d2a('0xc')](_0x1d2a('0xd'),_0x15e945,_0x1d2a('0xe'),JSON[_0x1d2a('0xf')](_0x3ccfcb));if(_0x3ccfcb[_0x1d2a('0x10')]){if(_0x3ccfcb[_0x1d2a('0x10')][_0x1d2a('0x11')]===0x1f4){logger[_0x1d2a('0x10')](_0x1d2a('0xb'),_0x15e945,_0x3ccfcb[_0x1d2a('0x10')][_0x1d2a('0x12')]);return _0x4eef44(_0x3ccfcb[_0x1d2a('0x10')][_0x1d2a('0x12')]);}logger['error'](_0x1d2a('0xb'),_0x15e945,_0x3ccfcb[_0x1d2a('0x10')]['message']);return _0x42dbd5(_0x3ccfcb[_0x1d2a('0x10')][_0x1d2a('0x12')]);}else{logger['info'](_0x1d2a('0xb'),_0x15e945,_0x1d2a('0xe'));_0x42dbd5(_0x3ccfcb[_0x1d2a('0x13')]['message']);}})[_0x1d2a('0x14')](function(_0x532159){logger['error'](_0x1d2a('0xb'),_0x15e945,_0x532159);_0x4eef44(_0x532159);});});}exports[_0x1d2a('0x15')]=function(_0x4da893){var _0x405fed=this;return new Promise(function(_0xa9914f,_0x43b816){return db[_0x1d2a('0x16')][_0x1d2a('0x17')](_0x4da893[_0x1d2a('0x18')],{'raw':_0x4da893[_0x1d2a('0x19')]?_0x4da893[_0x1d2a('0x19')][_0x1d2a('0x1a')]===undefined?!![]:![]:!![]})[_0x1d2a('0x1b')](function(_0x392bdd){logger[_0x1d2a('0xa')](_0x1d2a('0x15'),_0x4da893);logger[_0x1d2a('0xc')](_0x1d2a('0x15'),_0x4da893,JSON[_0x1d2a('0xf')](_0x392bdd));_0xa9914f(_0x392bdd);})[_0x1d2a('0x14')](function(_0x12a66e){logger['error']('CreateSquareRecording',_0x12a66e[_0x1d2a('0x12')],_0x4da893);_0x43b816(_0x405fed[_0x1d2a('0x10')](0x1f4,_0x12a66e[_0x1d2a('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 92a5e56..7ed540a 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x35e15d,_0x5e16e3){var _0x3a53e2=function(_0x238c7f){while(--_0x238c7f){_0x35e15d['push'](_0x35e15d['shift']());}};_0x3a53e2(++_0x5e16e3);}(_0xbaf0,0x12a));var _0x0baf=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xbaf0[_0x126558];return _0x1f6d14;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file +var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0xe4f3c0,_0x1f0596){var _0x582771=function(_0x30bbf5){while(--_0x30bbf5){_0xe4f3c0['push'](_0xe4f3c0['shift']());}};_0x582771(++_0x1f0596);}(_0xbaf0,0x12a));var _0x0baf=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbaf0[_0x432682];return _0x463d05;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 51d8fe7..17b3165 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 _0xdb60=['STRING','DATE','BOOLEAN','exports'];(function(_0x311f44,_0x1d7f5b){var _0x46f1e6=function(_0x27342a){while(--_0x27342a){_0x311f44['push'](_0x311f44['shift']());}};_0x46f1e6(++_0x1d7f5b);}(_0xdb60,0xb3));var _0x0db6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xdb60[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0x0db6('0x0')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x0db6('0x1')]},'channel':{'type':Sequelize[_0x0db6('0x1')]},'language':{'type':Sequelize[_0x0db6('0x1')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x0db6('0x1')]},'version':{'type':Sequelize[_0x0db6('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x0db6('0x1')]},'callington':{'type':Sequelize[_0x0db6('0x1')]},'callingtns':{'type':Sequelize[_0x0db6('0x1')]},'dnid':{'type':Sequelize[_0x0db6('0x1')]},'rdnis':{'type':Sequelize[_0x0db6('0x1')]},'context':{'type':Sequelize[_0x0db6('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x0db6('0x1')]},'enhanced':{'type':Sequelize[_0x0db6('0x1')]},'accountcode':{'type':Sequelize[_0x0db6('0x1')]},'threadid':{'type':Sequelize[_0x0db6('0x1')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x0db6('0x2')]},'leaveAt':{'type':Sequelize[_0x0db6('0x2')]},'bot':{'type':Sequelize[_0x0db6('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x701c=['STRING','DATE','sequelize'];(function(_0x20e0f7,_0x5d013e){var _0xa34a9c=function(_0x542aa0){while(--_0x542aa0){_0x20e0f7['push'](_0x20e0f7['shift']());}};_0xa34a9c(++_0x5d013e);}(_0x701c,0x167));var _0xc701=function(_0x222472,_0x33ea87){_0x222472=_0x222472-0x0;var _0x5d601f=_0x701c[_0x222472];return _0x5d601f;};'use strict';var Sequelize=require(_0xc701('0x0'));module['exports']={'network':{'type':Sequelize[_0xc701('0x1')]},'network_script':{'type':Sequelize[_0xc701('0x1')]},'request':{'type':Sequelize[_0xc701('0x1')]},'channel':{'type':Sequelize[_0xc701('0x1')]},'language':{'type':Sequelize[_0xc701('0x1')]},'type':{'type':Sequelize[_0xc701('0x1')]},'uniqueid':{'type':Sequelize[_0xc701('0x1')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xc701('0x1')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0xc701('0x1')]},'callingani2':{'type':Sequelize[_0xc701('0x1')]},'callington':{'type':Sequelize[_0xc701('0x1')]},'callingtns':{'type':Sequelize[_0xc701('0x1')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0xc701('0x1')]},'context':{'type':Sequelize[_0xc701('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xc701('0x1')]},'enhanced':{'type':Sequelize[_0xc701('0x1')]},'accountcode':{'type':Sequelize[_0xc701('0x1')]},'threadid':{'type':Sequelize[_0xc701('0x1')]},'project_name':{'type':Sequelize[_0xc701('0x1')]},'joinAt':{'type':Sequelize[_0xc701('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index d3f94b3..fcd5279 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 _0x7676=['../../config/license/util','../../mysqldb','status','json','limit','undefined','count','set','Content-Range','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','VIRTUAL','merge','options','SquareReport','include','findAll','catch','show','params','includeAll','body','describe','eml-format','zip-dir','fast-json-patch','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x5d9937,_0x28b174){var _0x55672c=function(_0x3588db){while(--_0x3588db){_0x5d9937['push'](_0x5d9937['shift']());}};_0x55672c(++_0x28b174);}(_0x7676,0xc0));var _0x6767=function(_0x5e3490,_0x1af794){_0x5e3490=_0x5e3490-0x0;var _0x529751=_0x7676[_0x5e3490];return _0x529751;};'use strict';var emlformat=require(_0x6767('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6767('0x1'));var jsonpatch=require(_0x6767('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x6767('0x3'));var sox=require(_0x6767('0x4'));var csv=require('to-csv');var ejs=require(_0x6767('0x5'));var fs=require('fs');var fs_extra=require(_0x6767('0x6'));var _=require(_0x6767('0x7'));var squel=require(_0x6767('0x8'));var crypto=require('crypto');var jsforce=require(_0x6767('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x6767('0xa'));var querystring=require(_0x6767('0xb'));var Papa=require(_0x6767('0xc'));var Redis=require('ioredis');var authService=require(_0x6767('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x6767('0xe'));var hardwareService=require(_0x6767('0xf'));var logger=require(_0x6767('0x10'))(_0x6767('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6767('0x12'));var db=require(_0x6767('0x13'))['db'];function respondWithStatusCode(_0x2c3cfe,_0x54605f){_0x54605f=_0x54605f||0xcc;return function(_0x370160){if(_0x370160){return _0x2c3cfe['sendStatus'](_0x54605f);}return _0x2c3cfe['status'](_0x54605f)['end']();};}function respondWithResult(_0x5e7560,_0x5dc86f){_0x5dc86f=_0x5dc86f||0xc8;return function(_0x316bd1){if(_0x316bd1){return _0x5e7560[_0x6767('0x14')](_0x5dc86f)[_0x6767('0x15')](_0x316bd1);}};}function respondWithFilteredResult(_0x1c977d,_0x4d5bc8){return function(_0x40f5c0){if(_0x40f5c0){var _0x414251=typeof _0x4d5bc8['offset']==='undefined'&&typeof _0x4d5bc8[_0x6767('0x16')]===_0x6767('0x17');var _0x35e60c=_0x40f5c0['count'];var _0x16d92f=_0x414251?0x0:_0x4d5bc8['offset'];var _0x1d353b=_0x414251?_0x40f5c0[_0x6767('0x18')]:_0x4d5bc8['offset']+_0x4d5bc8[_0x6767('0x16')];var _0x682513;if(_0x1d353b>=_0x35e60c){_0x1d353b=_0x35e60c;_0x682513=0xc8;}else{_0x682513=0xce;}_0x1c977d[_0x6767('0x14')](_0x682513);return _0x1c977d[_0x6767('0x19')](_0x6767('0x1a'),_0x16d92f+'-'+_0x1d353b+'/'+_0x35e60c)[_0x6767('0x15')](_0x40f5c0);}return null;};}function patchUpdates(_0x5995f7){return function(_0x134216){try{jsonpatch['apply'](_0x134216,_0x5995f7,!![]);}catch(_0x4fb4a4){return BPromise['reject'](_0x4fb4a4);}return _0x134216[_0x6767('0x1b')]();};}function saveUpdates(_0x326f48,_0x124d96){return function(_0x1a678e){if(_0x1a678e){return _0x1a678e[_0x6767('0x1c')](_0x326f48)[_0x6767('0x1d')](function(_0x1b0216){return _0x1b0216;});}return null;};}function removeEntity(_0x38a3b8,_0x36f582){return function(_0x218a78){if(_0x218a78){return _0x218a78[_0x6767('0x1e')]()[_0x6767('0x1d')](function(){_0x38a3b8[_0x6767('0x14')](0xcc)[_0x6767('0x1f')]();});}};}function handleEntityNotFound(_0x11fa50,_0x56bd66){return function(_0x72b806){if(!_0x72b806){_0x11fa50[_0x6767('0x20')](0x194);}return _0x72b806;};}function handleError(_0x270d48,_0x487b80){_0x487b80=_0x487b80||0x1f4;return function(_0x24e567){logger[_0x6767('0x21')](_0x24e567[_0x6767('0x22')]);if(_0x24e567[_0x6767('0x23')]){delete _0x24e567['name'];}_0x270d48['status'](_0x487b80)[_0x6767('0x24')](_0x24e567);};}exports[_0x6767('0x25')]=function(_0x508ca3,_0x5d662d){var _0x583e68={},_0x4e3a3e={},_0x5091fb={'count':0x0,'rows':[]};var _0x82be15=_[_0x6767('0x26')](db['SquareReport'][_0x6767('0x27')],function(_0x19c700){return{'name':_0x19c700[_0x6767('0x28')],'type':_0x19c700[_0x6767('0x29')]['key']};});_0x4e3a3e[_0x6767('0x2a')]=_[_0x6767('0x26')](_0x82be15,'name');_0x4e3a3e[_0x6767('0x2b')]=_[_0x6767('0x2c')](_0x508ca3['query']);_0x4e3a3e[_0x6767('0x2d')]=_[_0x6767('0x2e')](_0x4e3a3e[_0x6767('0x2a')],_0x4e3a3e['query']);_0x583e68[_0x6767('0x2f')]=_[_0x6767('0x2e')](_0x4e3a3e[_0x6767('0x2a')],qs[_0x6767('0x30')](_0x508ca3[_0x6767('0x2b')][_0x6767('0x30')]));_0x583e68[_0x6767('0x2f')]=_0x583e68[_0x6767('0x2f')][_0x6767('0x31')]?_0x583e68[_0x6767('0x2f')]:_0x4e3a3e[_0x6767('0x2a')];if(!_0x508ca3[_0x6767('0x2b')][_0x6767('0x32')](_0x6767('0x33'))){_0x583e68[_0x6767('0x16')]=qs[_0x6767('0x16')](_0x508ca3[_0x6767('0x2b')]['limit']);_0x583e68[_0x6767('0x34')]=qs['offset'](_0x508ca3['query'][_0x6767('0x34')]);}_0x583e68[_0x6767('0x35')]=qs[_0x6767('0x36')](_0x508ca3[_0x6767('0x2b')]['sort']);_0x583e68[_0x6767('0x37')]=qs[_0x6767('0x2d')](_[_0x6767('0x38')](_0x508ca3[_0x6767('0x2b')],_0x4e3a3e['filters']),_0x82be15);if(_0x508ca3['query'][_0x6767('0x39')]){_0x583e68[_0x6767('0x37')]=_['merge'](_0x583e68[_0x6767('0x37')],{'$or':_[_0x6767('0x26')](_0x82be15,function(_0x1fd2d9){if(_0x1fd2d9['type']!==_0x6767('0x3a')){var _0x2f2084={};_0x2f2084[_0x1fd2d9['name']]={'$like':'%'+_0x508ca3['query'][_0x6767('0x39')]+'%'};return _0x2f2084;}})});}_0x583e68=_[_0x6767('0x3b')]({},_0x583e68,_0x508ca3[_0x6767('0x3c')]);var _0x3489a8={'where':_0x583e68[_0x6767('0x37')]};return db[_0x6767('0x3d')][_0x6767('0x18')](_0x3489a8)[_0x6767('0x1d')](function(_0x291d38){_0x5091fb[_0x6767('0x18')]=_0x291d38;if(_0x508ca3[_0x6767('0x2b')]['includeAll']){_0x583e68[_0x6767('0x3e')]=[{'all':!![]}];}return db[_0x6767('0x3d')][_0x6767('0x3f')](_0x583e68);})[_0x6767('0x1d')](function(_0x4b963b){_0x5091fb['rows']=_0x4b963b;return _0x5091fb;})[_0x6767('0x1d')](respondWithFilteredResult(_0x5d662d,_0x583e68))[_0x6767('0x40')](handleError(_0x5d662d,null));};exports[_0x6767('0x41')]=function(_0x368f64,_0x2d6f49){var _0x5153d6={'raw':!![],'where':{'id':_0x368f64[_0x6767('0x42')]['id']}},_0x27119a={};_0x27119a[_0x6767('0x2a')]=_[_0x6767('0x2c')](db[_0x6767('0x3d')]['rawAttributes']);_0x27119a['query']=_[_0x6767('0x2c')](_0x368f64[_0x6767('0x2b')]);_0x27119a[_0x6767('0x2d')]=_[_0x6767('0x2e')](_0x27119a[_0x6767('0x2a')],_0x27119a['query']);_0x5153d6['attributes']=_[_0x6767('0x2e')](_0x27119a[_0x6767('0x2a')],qs[_0x6767('0x30')](_0x368f64[_0x6767('0x2b')]['fields']));_0x5153d6[_0x6767('0x2f')]=_0x5153d6[_0x6767('0x2f')][_0x6767('0x31')]?_0x5153d6[_0x6767('0x2f')]:_0x27119a[_0x6767('0x2a')];if(_0x368f64[_0x6767('0x2b')][_0x6767('0x43')]){_0x5153d6[_0x6767('0x3e')]=[{'all':!![]}];}_0x5153d6=_[_0x6767('0x3b')]({},_0x5153d6,_0x368f64[_0x6767('0x3c')]);return db[_0x6767('0x3d')]['find'](_0x5153d6)[_0x6767('0x1d')](handleEntityNotFound(_0x2d6f49,null))['then'](respondWithResult(_0x2d6f49,null))[_0x6767('0x40')](handleError(_0x2d6f49,null));};exports['create']=function(_0x5f4e59,_0x5568f3){return db[_0x6767('0x3d')]['create'](_0x5f4e59[_0x6767('0x44')],{})[_0x6767('0x1d')](respondWithResult(_0x5568f3,0xc9))[_0x6767('0x40')](handleError(_0x5568f3,null));};exports['update']=function(_0x2b2a1c,_0x110510){if(_0x2b2a1c[_0x6767('0x44')]['id']){delete _0x2b2a1c['body']['id'];}return db['SquareReport']['find']({'where':{'id':_0x2b2a1c[_0x6767('0x42')]['id']}})['then'](handleEntityNotFound(_0x110510,null))[_0x6767('0x1d')](saveUpdates(_0x2b2a1c[_0x6767('0x44')],null))['then'](respondWithResult(_0x110510,null))[_0x6767('0x40')](handleError(_0x110510,null));};exports['destroy']=function(_0x1dd117,_0x16df55){return db[_0x6767('0x3d')]['find']({'where':{'id':_0x1dd117[_0x6767('0x42')]['id']}})[_0x6767('0x1d')](handleEntityNotFound(_0x16df55,null))[_0x6767('0x1d')](removeEntity(_0x16df55,null))[_0x6767('0x40')](handleError(_0x16df55,null));};exports['describe']=function(_0x3260db,_0x5cb480){return db[_0x6767('0x3d')][_0x6767('0x45')]()[_0x6767('0x1d')](respondWithResult(_0x5cb480,null))[_0x6767('0x40')](handleError(_0x5cb480,null));}; \ No newline at end of file +var _0x5f7f=['save','update','then','destroy','end','stack','name','send','map','SquareReport','fieldName','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','where','pick','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','keys','rawAttributes','length','options','create','body','find','describe','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','count','set','Content-Range','apply'];(function(_0x1a3cc7,_0x2900e3){var _0x338438=function(_0x5a4872){while(--_0x5a4872){_0x1a3cc7['push'](_0x1a3cc7['shift']());}};_0x338438(++_0x2900e3);}(_0x5f7f,0x70));var _0xf5f7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5f7f[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xf5f7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf5f7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf5f7('0x2'));var moment=require('moment');var BPromise=require(_0xf5f7('0x3'));var Mustache=require(_0xf5f7('0x4'));var util=require(_0xf5f7('0x5'));var path=require(_0xf5f7('0x6'));var sox=require(_0xf5f7('0x7'));var csv=require('to-csv');var ejs=require(_0xf5f7('0x8'));var fs=require('fs');var fs_extra=require(_0xf5f7('0x9'));var _=require(_0xf5f7('0xa'));var squel=require(_0xf5f7('0xb'));var crypto=require(_0xf5f7('0xc'));var jsforce=require(_0xf5f7('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf5f7('0xe'));var querystring=require(_0xf5f7('0xf'));var Papa=require(_0xf5f7('0x10'));var Redis=require(_0xf5f7('0x11'));var authService=require(_0xf5f7('0x12'));var qs=require(_0xf5f7('0x13'));var as=require(_0xf5f7('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf5f7('0x15'))(_0xf5f7('0x16'));var utils=require(_0xf5f7('0x17'));var config=require(_0xf5f7('0x18'));var licenseUtil=require(_0xf5f7('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5865,_0x401036){_0x401036=_0x401036||0xcc;return function(_0x5cca1f){if(_0x5cca1f){return _0x1a5865[_0xf5f7('0x1a')](_0x401036);}return _0x1a5865[_0xf5f7('0x1b')](_0x401036)['end']();};}function respondWithResult(_0x53ddf1,_0x4a82b8){_0x4a82b8=_0x4a82b8||0xc8;return function(_0x2b9cbb){if(_0x2b9cbb){return _0x53ddf1[_0xf5f7('0x1b')](_0x4a82b8)['json'](_0x2b9cbb);}};}function respondWithFilteredResult(_0x37c319,_0x286a78){return function(_0x1e6649){if(_0x1e6649){var _0x4f7776=typeof _0x286a78[_0xf5f7('0x1c')]===_0xf5f7('0x1d')&&typeof _0x286a78['limit']===_0xf5f7('0x1d');var _0x3469d9=_0x1e6649['count'];var _0x827671=_0x4f7776?0x0:_0x286a78[_0xf5f7('0x1c')];var _0x34a00f=_0x4f7776?_0x1e6649[_0xf5f7('0x1e')]:_0x286a78['offset']+_0x286a78['limit'];var _0x5887d4;if(_0x34a00f>=_0x3469d9){_0x34a00f=_0x3469d9;_0x5887d4=0xc8;}else{_0x5887d4=0xce;}_0x37c319[_0xf5f7('0x1b')](_0x5887d4);return _0x37c319[_0xf5f7('0x1f')](_0xf5f7('0x20'),_0x827671+'-'+_0x34a00f+'/'+_0x3469d9)['json'](_0x1e6649);}return null;};}function patchUpdates(_0x449419){return function(_0x1df216){try{jsonpatch[_0xf5f7('0x21')](_0x1df216,_0x449419,!![]);}catch(_0x576a29){return BPromise['reject'](_0x576a29);}return _0x1df216[_0xf5f7('0x22')]();};}function saveUpdates(_0x569388,_0x254ec3){return function(_0x24a30a){if(_0x24a30a){return _0x24a30a[_0xf5f7('0x23')](_0x569388)[_0xf5f7('0x24')](function(_0x1533d4){return _0x1533d4;});}return null;};}function removeEntity(_0x371c38,_0x41be87){return function(_0x246195){if(_0x246195){return _0x246195[_0xf5f7('0x25')]()[_0xf5f7('0x24')](function(){_0x371c38['status'](0xcc)[_0xf5f7('0x26')]();});}};}function handleEntityNotFound(_0x35319f,_0x2bee25){return function(_0x1a51a2){if(!_0x1a51a2){_0x35319f[_0xf5f7('0x1a')](0x194);}return _0x1a51a2;};}function handleError(_0x52cac1,_0x475a2d){_0x475a2d=_0x475a2d||0x1f4;return function(_0x3359be){logger['error'](_0x3359be[_0xf5f7('0x27')]);if(_0x3359be[_0xf5f7('0x28')]){delete _0x3359be['name'];}_0x52cac1[_0xf5f7('0x1b')](_0x475a2d)[_0xf5f7('0x29')](_0x3359be);};}exports['index']=function(_0x43c58a,_0x5ef925){var _0x15f3b1={},_0x1f7ed3={},_0x4b8395={'count':0x0,'rows':[]};var _0x36a29c=_[_0xf5f7('0x2a')](db[_0xf5f7('0x2b')]['rawAttributes'],function(_0x204cd4){return{'name':_0x204cd4[_0xf5f7('0x2c')],'type':_0x204cd4[_0xf5f7('0x2d')]['key']};});_0x1f7ed3[_0xf5f7('0x2e')]=_[_0xf5f7('0x2a')](_0x36a29c,_0xf5f7('0x28'));_0x1f7ed3[_0xf5f7('0x2f')]=_['keys'](_0x43c58a[_0xf5f7('0x2f')]);_0x1f7ed3[_0xf5f7('0x30')]=_[_0xf5f7('0x31')](_0x1f7ed3[_0xf5f7('0x2e')],_0x1f7ed3[_0xf5f7('0x2f')]);_0x15f3b1['attributes']=_[_0xf5f7('0x31')](_0x1f7ed3[_0xf5f7('0x2e')],qs[_0xf5f7('0x32')](_0x43c58a[_0xf5f7('0x2f')][_0xf5f7('0x32')]));_0x15f3b1[_0xf5f7('0x33')]=_0x15f3b1['attributes']['length']?_0x15f3b1[_0xf5f7('0x33')]:_0x1f7ed3[_0xf5f7('0x2e')];if(!_0x43c58a['query'][_0xf5f7('0x34')](_0xf5f7('0x35'))){_0x15f3b1[_0xf5f7('0x36')]=qs[_0xf5f7('0x36')](_0x43c58a['query'][_0xf5f7('0x36')]);_0x15f3b1[_0xf5f7('0x1c')]=qs['offset'](_0x43c58a[_0xf5f7('0x2f')][_0xf5f7('0x1c')]);}_0x15f3b1['order']=qs['sort'](_0x43c58a[_0xf5f7('0x2f')]['sort']);_0x15f3b1[_0xf5f7('0x37')]=qs[_0xf5f7('0x30')](_[_0xf5f7('0x38')](_0x43c58a[_0xf5f7('0x2f')],_0x1f7ed3[_0xf5f7('0x30')]),_0x36a29c);if(_0x43c58a[_0xf5f7('0x2f')]['filter']){_0x15f3b1[_0xf5f7('0x37')]=_[_0xf5f7('0x39')](_0x15f3b1[_0xf5f7('0x37')],{'$or':_[_0xf5f7('0x2a')](_0x36a29c,function(_0x983901){if(_0x983901[_0xf5f7('0x2d')]!==_0xf5f7('0x3a')){var _0x36b1f0={};_0x36b1f0[_0x983901[_0xf5f7('0x28')]]={'$like':'%'+_0x43c58a['query']['filter']+'%'};return _0x36b1f0;}})});}_0x15f3b1=_[_0xf5f7('0x39')]({},_0x15f3b1,_0x43c58a['options']);var _0x18d840={'where':_0x15f3b1[_0xf5f7('0x37')]};return db['SquareReport'][_0xf5f7('0x1e')](_0x18d840)['then'](function(_0x46d550){_0x4b8395['count']=_0x46d550;if(_0x43c58a[_0xf5f7('0x2f')][_0xf5f7('0x3b')]){_0x15f3b1[_0xf5f7('0x3c')]=[{'all':!![]}];}return db[_0xf5f7('0x2b')][_0xf5f7('0x3d')](_0x15f3b1);})['then'](function(_0x41b66a){_0x4b8395['rows']=_0x41b66a;return _0x4b8395;})['then'](respondWithFilteredResult(_0x5ef925,_0x15f3b1))[_0xf5f7('0x3e')](handleError(_0x5ef925,null));};exports[_0xf5f7('0x3f')]=function(_0x326d95,_0xaf68c){var _0x46ced7={'raw':!![],'where':{'id':_0x326d95[_0xf5f7('0x40')]['id']}},_0x2a8bba={};_0x2a8bba[_0xf5f7('0x2e')]=_[_0xf5f7('0x41')](db['SquareReport'][_0xf5f7('0x42')]);_0x2a8bba[_0xf5f7('0x2f')]=_['keys'](_0x326d95[_0xf5f7('0x2f')]);_0x2a8bba[_0xf5f7('0x30')]=_[_0xf5f7('0x31')](_0x2a8bba['model'],_0x2a8bba['query']);_0x46ced7[_0xf5f7('0x33')]=_['intersection'](_0x2a8bba[_0xf5f7('0x2e')],qs[_0xf5f7('0x32')](_0x326d95[_0xf5f7('0x2f')][_0xf5f7('0x32')]));_0x46ced7['attributes']=_0x46ced7[_0xf5f7('0x33')][_0xf5f7('0x43')]?_0x46ced7['attributes']:_0x2a8bba['model'];if(_0x326d95[_0xf5f7('0x2f')][_0xf5f7('0x3b')]){_0x46ced7['include']=[{'all':!![]}];}_0x46ced7=_['merge']({},_0x46ced7,_0x326d95[_0xf5f7('0x44')]);return db[_0xf5f7('0x2b')]['find'](_0x46ced7)[_0xf5f7('0x24')](handleEntityNotFound(_0xaf68c,null))[_0xf5f7('0x24')](respondWithResult(_0xaf68c,null))[_0xf5f7('0x3e')](handleError(_0xaf68c,null));};exports[_0xf5f7('0x45')]=function(_0x21d459,_0xaed501){return db[_0xf5f7('0x2b')][_0xf5f7('0x45')](_0x21d459['body'],{})[_0xf5f7('0x24')](respondWithResult(_0xaed501,0xc9))[_0xf5f7('0x3e')](handleError(_0xaed501,null));};exports[_0xf5f7('0x23')]=function(_0x567060,_0x4eabf9){if(_0x567060['body']['id']){delete _0x567060[_0xf5f7('0x46')]['id'];}return db[_0xf5f7('0x2b')][_0xf5f7('0x47')]({'where':{'id':_0x567060['params']['id']}})[_0xf5f7('0x24')](handleEntityNotFound(_0x4eabf9,null))['then'](saveUpdates(_0x567060[_0xf5f7('0x46')],null))['then'](respondWithResult(_0x4eabf9,null))[_0xf5f7('0x3e')](handleError(_0x4eabf9,null));};exports[_0xf5f7('0x25')]=function(_0x139b2a,_0x358a50){return db['SquareReport'][_0xf5f7('0x47')]({'where':{'id':_0x139b2a[_0xf5f7('0x40')]['id']}})[_0xf5f7('0x24')](handleEntityNotFound(_0x358a50,null))['then'](removeEntity(_0x358a50,null))[_0xf5f7('0x3e')](handleError(_0x358a50,null));};exports[_0xf5f7('0x48')]=function(_0x564f88,_0x45f161){return db['SquareReport'][_0xf5f7('0x48')]()[_0xf5f7('0x24')](respondWithResult(_0x45f161,null))[_0xf5f7('0x3e')](handleError(_0x45f161,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 1bbcbde..1f77e7c 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 _0xb1aa=['report_square','uid_pname','uniqueid','project_name','lodash','util','moment','bluebird','path','rimraf','../../config/environment','./squareReport.attributes','exports','define'];(function(_0x4f9e31,_0x3c713d){var _0x22880e=function(_0x971930){while(--_0x971930){_0x4f9e31['push'](_0x4f9e31['shift']());}};_0x22880e(++_0x3c713d);}(_0xb1aa,0x1c4));var _0xab1a=function(_0x353c9b,_0x963d4b){_0x353c9b=_0x353c9b-0x0;var _0x37b8f4=_0xb1aa[_0x353c9b];return _0x37b8f4;};'use strict';var _=require(_0xab1a('0x0'));var util=require(_0xab1a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xab1a('0x2'));var BPromise=require(_0xab1a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xab1a('0x4'));var rimraf=require(_0xab1a('0x5'));var config=require(_0xab1a('0x6'));var attributes=require(_0xab1a('0x7'));module[_0xab1a('0x8')]=function(_0x536c72,_0x4c0c9d){return _0x536c72[_0xab1a('0x9')]('SquareReport',attributes,{'tableName':_0xab1a('0xa'),'paranoid':![],'indexes':[{'name':_0xab1a('0xb'),'fields':[_0xab1a('0xc'),_0xab1a('0xd')]},{'name':'leaveAt','fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0x083c=['rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','uniqueid','project_name','leaveAt','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x3ee3d7,_0x1df7a8){var _0x46332a=function(_0x37cebe){while(--_0x37cebe){_0x3ee3d7['push'](_0x3ee3d7['shift']());}};_0x46332a(++_0x1df7a8);}(_0x083c,0x9b));var _0xc083=function(_0x35cc99,_0x5bb972){_0x35cc99=_0x35cc99-0x0;var _0x14373c=_0x083c[_0x35cc99];return _0x14373c;};'use strict';var _=require(_0xc083('0x0'));var util=require(_0xc083('0x1'));var logger=require(_0xc083('0x2'))(_0xc083('0x3'));var moment=require('moment');var BPromise=require(_0xc083('0x4'));var rp=require(_0xc083('0x5'));var fs=require('fs');var path=require(_0xc083('0x6'));var rimraf=require(_0xc083('0x7'));var config=require(_0xc083('0x8'));var attributes=require(_0xc083('0x9'));module[_0xc083('0xa')]=function(_0x18a942,_0x458158){return _0x18a942[_0xc083('0xb')](_0xc083('0xc'),attributes,{'tableName':_0xc083('0xd'),'paranoid':![],'indexes':[{'name':_0xc083('0xe'),'fields':[_0xc083('0xf'),_0xc083('0x10')]},{'name':_0xc083('0x11'),'fields':[_0xc083('0x11')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 4f1b085..09330cc 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 _0xda16=['attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','http','request','info','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareReport,\x20%s,\x20%s','message','result','catch','CreateSquareReport','SquareReport','options','raw','then','UpdateSquareReport','where'];(function(_0x2a3152,_0x1eb070){var _0x51f2c6=function(_0x12c4a0){while(--_0x12c4a0){_0x2a3152['push'](_0x2a3152['shift']());}};_0x51f2c6(++_0x1eb070);}(_0xda16,0xd4));var _0x6da1=function(_0x1cc1e3,_0x4598a4){_0x1cc1e3=_0x1cc1e3-0x0;var _0x2843cc=_0xda16[_0x1cc1e3];return _0x2843cc;};'use strict';var _=require(_0x6da1('0x0'));var util=require(_0x6da1('0x1'));var moment=require(_0x6da1('0x2'));var BPromise=require(_0x6da1('0x3'));var rs=require(_0x6da1('0x4'));var fs=require('fs');var Redis=require(_0x6da1('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6da1('0x6'))('rpc');var config=require(_0x6da1('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6da1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x27b748,_0x564aaa,_0x29dc03){return new BPromise(function(_0x465d97,_0x499f3a){return client[_0x6da1('0x9')](_0x27b748,_0x29dc03)['then'](function(_0x5b4d62){logger[_0x6da1('0xa')]('SquareReport,\x20%s,\x20%s',_0x564aaa,_0x6da1('0xb'));logger[_0x6da1('0xc')](_0x6da1('0xd'),_0x564aaa,_0x6da1('0xb'),JSON[_0x6da1('0xe')](_0x5b4d62));if(_0x5b4d62[_0x6da1('0xf')]){if(_0x5b4d62[_0x6da1('0xf')][_0x6da1('0x10')]===0x1f4){logger['error'](_0x6da1('0x11'),_0x564aaa,_0x5b4d62[_0x6da1('0xf')][_0x6da1('0x12')]);return _0x499f3a(_0x5b4d62[_0x6da1('0xf')][_0x6da1('0x12')]);}logger[_0x6da1('0xf')](_0x6da1('0x11'),_0x564aaa,_0x5b4d62['error'][_0x6da1('0x12')]);return _0x465d97(_0x5b4d62[_0x6da1('0xf')][_0x6da1('0x12')]);}else{logger[_0x6da1('0xa')](_0x6da1('0x11'),_0x564aaa,_0x6da1('0xb'));_0x465d97(_0x5b4d62[_0x6da1('0x13')][_0x6da1('0x12')]);}})[_0x6da1('0x14')](function(_0x397630){logger[_0x6da1('0xf')](_0x6da1('0x11'),_0x564aaa,_0x397630);_0x499f3a(_0x397630);});});}exports[_0x6da1('0x15')]=function(_0x34abf1){var _0x1a7ba8=this;return new Promise(function(_0x1b8c12,_0x273dda){return db[_0x6da1('0x16')]['create'](_0x34abf1['body'],{'raw':_0x34abf1['options']?_0x34abf1[_0x6da1('0x17')][_0x6da1('0x18')]===undefined?!![]:![]:!![]})[_0x6da1('0x19')](function(_0x1035aa){logger[_0x6da1('0xa')](_0x6da1('0x15'),_0x34abf1);logger['debug'](_0x6da1('0x15'),_0x34abf1,JSON[_0x6da1('0xe')](_0x1035aa));_0x1b8c12(_0x1035aa);})[_0x6da1('0x14')](function(_0x1d54a2){logger['error'](_0x6da1('0x15'),_0x1d54a2[_0x6da1('0x12')],_0x34abf1);_0x273dda(_0x1a7ba8[_0x6da1('0xf')](0x1f4,_0x1d54a2[_0x6da1('0x12')]));});});};exports[_0x6da1('0x1a')]=function(_0x18996f){var _0x1fa2eb=this;return new Promise(function(_0x104b10,_0x3c19ed){return db['SquareReport']['update'](_0x18996f['body'],{'raw':_0x18996f[_0x6da1('0x17')]?_0x18996f['options'][_0x6da1('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18996f[_0x6da1('0x17')]?_0x18996f[_0x6da1('0x17')][_0x6da1('0x1b')]||null:null,'attributes':_0x18996f[_0x6da1('0x17')]?_0x18996f[_0x6da1('0x17')][_0x6da1('0x1c')]||null:null,'limit':_0x18996f['options']?_0x18996f['options'][_0x6da1('0x1d')]||null:null})[_0x6da1('0x19')](function(_0x56d253){logger[_0x6da1('0xa')](_0x6da1('0x1a'),_0x18996f);logger['debug'](_0x6da1('0x1a'),_0x18996f,JSON[_0x6da1('0xe')](_0x56d253));_0x104b10(_0x56d253);})[_0x6da1('0x14')](function(_0x524c03){logger[_0x6da1('0xf')](_0x6da1('0x1a'),_0x524c03['message'],_0x18996f);_0x3c19ed(_0x1fa2eb[_0x6da1('0xf')](0x1f4,_0x524c03['message']));});});}; \ No newline at end of file +var _0x7a8f=['client','request','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateSquareReport','SquareReport','create','body','options','raw','then','UpdateSquareReport','update','where','attributes','limit','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x1c2492,_0x14b388){var _0x35469e=function(_0x54eee1){while(--_0x54eee1){_0x1c2492['push'](_0x1c2492['shift']());}};_0x35469e(++_0x14b388);}(_0x7a8f,0x131));var _0xf7a8=function(_0x10c216,_0x535ea9){_0x10c216=_0x10c216-0x0;var _0x4d2515=_0x7a8f[_0x10c216];return _0x4d2515;};'use strict';var _=require(_0xf7a8('0x0'));var util=require(_0xf7a8('0x1'));var moment=require('moment');var BPromise=require(_0xf7a8('0x2'));var rs=require(_0xf7a8('0x3'));var fs=require('fs');var Redis=require(_0xf7a8('0x4'));var db=require(_0xf7a8('0x5'))['db'];var utils=require(_0xf7a8('0x6'));var logger=require(_0xf7a8('0x7'))(_0xf7a8('0x8'));var config=require('../../config/environment');var jayson=require(_0xf7a8('0x9'));var client=jayson[_0xf7a8('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57fb36,_0x12ebbb,_0x126818){return new BPromise(function(_0x30a938,_0x5d61d9){return client[_0xf7a8('0xb')](_0x57fb36,_0x126818)['then'](function(_0x125347){logger['info'](_0xf7a8('0xc'),_0x12ebbb,_0xf7a8('0xd'));logger[_0xf7a8('0xe')](_0xf7a8('0xf'),_0x12ebbb,_0xf7a8('0xd'),JSON[_0xf7a8('0x10')](_0x125347));if(_0x125347[_0xf7a8('0x11')]){if(_0x125347[_0xf7a8('0x11')][_0xf7a8('0x12')]===0x1f4){logger['error'](_0xf7a8('0xc'),_0x12ebbb,_0x125347[_0xf7a8('0x11')]['message']);return _0x5d61d9(_0x125347['error'][_0xf7a8('0x13')]);}logger['error'](_0xf7a8('0xc'),_0x12ebbb,_0x125347[_0xf7a8('0x11')][_0xf7a8('0x13')]);return _0x30a938(_0x125347[_0xf7a8('0x11')]['message']);}else{logger[_0xf7a8('0x14')](_0xf7a8('0xc'),_0x12ebbb,_0xf7a8('0xd'));_0x30a938(_0x125347[_0xf7a8('0x15')]['message']);}})['catch'](function(_0x30c8af){logger[_0xf7a8('0x11')](_0xf7a8('0xc'),_0x12ebbb,_0x30c8af);_0x5d61d9(_0x30c8af);});});}exports[_0xf7a8('0x16')]=function(_0x37d07c){var _0x5608e6=this;return new Promise(function(_0x47dc01,_0x83e2b3){return db[_0xf7a8('0x17')][_0xf7a8('0x18')](_0x37d07c[_0xf7a8('0x19')],{'raw':_0x37d07c['options']?_0x37d07c[_0xf7a8('0x1a')][_0xf7a8('0x1b')]===undefined?!![]:![]:!![]})[_0xf7a8('0x1c')](function(_0x53c1c6){logger[_0xf7a8('0x14')](_0xf7a8('0x16'),_0x37d07c);logger[_0xf7a8('0xe')]('CreateSquareReport',_0x37d07c,JSON['stringify'](_0x53c1c6));_0x47dc01(_0x53c1c6);})['catch'](function(_0x55a59b){logger[_0xf7a8('0x11')]('CreateSquareReport',_0x55a59b[_0xf7a8('0x13')],_0x37d07c);_0x83e2b3(_0x5608e6[_0xf7a8('0x11')](0x1f4,_0x55a59b[_0xf7a8('0x13')]));});});};exports[_0xf7a8('0x1d')]=function(_0x51fe0e){var _0x5d0a61=this;return new Promise(function(_0x5f4f2c,_0x3bfe6b){return db[_0xf7a8('0x17')][_0xf7a8('0x1e')](_0x51fe0e['body'],{'raw':_0x51fe0e[_0xf7a8('0x1a')]?_0x51fe0e['options'][_0xf7a8('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51fe0e[_0xf7a8('0x1a')]?_0x51fe0e[_0xf7a8('0x1a')][_0xf7a8('0x1f')]||null:null,'attributes':_0x51fe0e['options']?_0x51fe0e[_0xf7a8('0x1a')][_0xf7a8('0x20')]||null:null,'limit':_0x51fe0e['options']?_0x51fe0e[_0xf7a8('0x1a')][_0xf7a8('0x21')]||null:null})['then'](function(_0x2ec78c){logger[_0xf7a8('0x14')](_0xf7a8('0x1d'),_0x51fe0e);logger['debug'](_0xf7a8('0x1d'),_0x51fe0e,JSON['stringify'](_0x2ec78c));_0x5f4f2c(_0x2ec78c);})[_0xf7a8('0x22')](function(_0x259607){logger[_0xf7a8('0x11')]('UpdateSquareReport',_0x259607[_0xf7a8('0x13')],_0x51fe0e);_0x3bfe6b(_0x5d0a61[_0xf7a8('0x11')](0x1f4,_0x259607[_0xf7a8('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 91d1eb3..aae4e2c 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 _0x1676=['isAuthenticated','index','/describe','/:id','create','put','delete','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get'];(function(_0x6c0123,_0x4c8d3b){var _0x5a87d2=function(_0x1ff614){while(--_0x1ff614){_0x6c0123['push'](_0x6c0123['shift']());}};_0x5a87d2(++_0x4c8d3b);}(_0x1676,0x16d));var _0x6167=function(_0x53721a,_0x474e0f){_0x53721a=_0x53721a-0x0;var _0x46dc81=_0x1676[_0x53721a];return _0x46dc81;};'use strict';var multer=require(_0x6167('0x0'));var util=require(_0x6167('0x1'));var path=require('path');var timeout=require(_0x6167('0x2'));var express=require(_0x6167('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6167('0x4'));var interaction=require(_0x6167('0x5'));var config=require(_0x6167('0x6'));var controller=require(_0x6167('0x7'));router[_0x6167('0x8')]('/',auth[_0x6167('0x9')](),controller[_0x6167('0xa')]);router[_0x6167('0x8')](_0x6167('0xb'),auth[_0x6167('0x9')](),controller['describe']);router[_0x6167('0x8')](_0x6167('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x6167('0x9')](),controller[_0x6167('0xd')]);router[_0x6167('0xe')](_0x6167('0xc'),auth[_0x6167('0x9')](),controller['update']);router[_0x6167('0xf')](_0x6167('0xc'),auth[_0x6167('0x9')](),controller['destroy']);module[_0x6167('0x10')]=router; \ No newline at end of file +var _0xa06a=['describe','show','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./squareReportDetail.controller','get','index','isAuthenticated'];(function(_0x2c5c7d,_0x49a7cf){var _0x4f54e1=function(_0x4d4b8d){while(--_0x4d4b8d){_0x2c5c7d['push'](_0x2c5c7d['shift']());}};_0x4f54e1(++_0x49a7cf);}(_0xa06a,0x72));var _0xaa06=function(_0x2e7125,_0x1896c0){_0x2e7125=_0x2e7125-0x0;var _0x140571=_0xa06a[_0x2e7125];return _0x140571;};'use strict';var multer=require(_0xaa06('0x0'));var util=require(_0xaa06('0x1'));var path=require(_0xaa06('0x2'));var timeout=require(_0xaa06('0x3'));var express=require(_0xaa06('0x4'));var router=express[_0xaa06('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xaa06('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xaa06('0x7'));var controller=require(_0xaa06('0x8'));router[_0xaa06('0x9')]('/',auth['isAuthenticated'](),controller[_0xaa06('0xa')]);router[_0xaa06('0x9')]('/describe',auth[_0xaa06('0xb')](),controller[_0xaa06('0xc')]);router['get']('/:id',auth[_0xaa06('0xb')](),controller[_0xaa06('0xd')]);router['post']('/',auth[_0xaa06('0xb')](),controller[_0xaa06('0xe')]);router[_0xaa06('0xf')](_0xaa06('0x10'),auth[_0xaa06('0xb')](),controller[_0xaa06('0x11')]);router[_0xaa06('0x12')](_0xaa06('0x10'),auth['isAuthenticated'](),controller[_0xaa06('0x13')]);module[_0xaa06('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 91af5d9..baa2575 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 _0x5b2d=['exports','STRING','TEXT','sequelize'];(function(_0x277b55,_0x8ba28){var _0xff0d15=function(_0x1beefc){while(--_0x1beefc){_0x277b55['push'](_0x277b55['shift']());}};_0xff0d15(++_0x8ba28);}(_0x5b2d,0x17f));var _0xd5b2=function(_0x980af9,_0x463080){_0x980af9=_0x980af9-0x0;var _0x2d5487=_0x5b2d[_0x980af9];return _0x2d5487;};'use strict';var Sequelize=require(_0xd5b2('0x0'));module[_0xd5b2('0x1')]={'uniqueid':{'type':Sequelize[_0xd5b2('0x2')]},'node':{'type':Sequelize[_0xd5b2('0x2')]},'application':{'type':Sequelize[_0xd5b2('0x2')]},'data':{'type':Sequelize[_0xd5b2('0x3')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9a57=['exports','STRING','sequelize'];(function(_0x1e081a,_0x482d6b){var _0x428209=function(_0x524b53){while(--_0x524b53){_0x1e081a['push'](_0x1e081a['shift']());}};_0x428209(++_0x482d6b);}(_0x9a57,0x16a));var _0x79a5=function(_0x1d50f2,_0x3c3ec6){_0x1d50f2=_0x1d50f2-0x0;var _0x3769b8=_0x9a57[_0x1d50f2];return _0x3769b8;};'use strict';var Sequelize=require(_0x79a5('0x0'));module[_0x79a5('0x1')]={'uniqueid':{'type':Sequelize[_0x79a5('0x2')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x79a5('0x2')]},'callerid':{'type':Sequelize[_0x79a5('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 08125f6..320ffa6 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 _0x5181=['save','then','sendStatus','error','stack','name','send','map','SquareDetailsReport','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','count','includeAll','include','rows','show','params','catch','create','body','update','find','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','limit','undefined','offset','status','Content-Range','apply'];(function(_0x2d61b2,_0x142947){var _0x12df89=function(_0x31c717){while(--_0x31c717){_0x2d61b2['push'](_0x2d61b2['shift']());}};_0x12df89(++_0x142947);}(_0x5181,0x19a));var _0x1518=function(_0x44f470,_0x74d1a8){_0x44f470=_0x44f470-0x0;var _0x54f0f5=_0x5181[_0x44f470];return _0x54f0f5;};'use strict';var emlformat=require(_0x1518('0x0'));var rimraf=require(_0x1518('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1518('0x2'));var rp=require(_0x1518('0x3'));var moment=require(_0x1518('0x4'));var BPromise=require(_0x1518('0x5'));var Mustache=require(_0x1518('0x6'));var util=require(_0x1518('0x7'));var path=require(_0x1518('0x8'));var sox=require(_0x1518('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1518('0xa'));var _=require(_0x1518('0xb'));var squel=require('squel');var crypto=require(_0x1518('0xc'));var jsforce=require(_0x1518('0xd'));var deskjs=require(_0x1518('0xe'));var toCsv=require(_0x1518('0xf'));var querystring=require(_0x1518('0x10'));var Papa=require(_0x1518('0x11'));var Redis=require(_0x1518('0x12'));var authService=require(_0x1518('0x13'));var qs=require(_0x1518('0x14'));var as=require(_0x1518('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1518('0x16'))('api');var utils=require(_0x1518('0x17'));var config=require(_0x1518('0x18'));var licenseUtil=require(_0x1518('0x19'));var db=require(_0x1518('0x1a'))['db'];function respondWithStatusCode(_0x19a13a,_0x5850f4){_0x5850f4=_0x5850f4||0xcc;return function(_0x57e056){if(_0x57e056){return _0x19a13a['sendStatus'](_0x5850f4);}return _0x19a13a['status'](_0x5850f4)[_0x1518('0x1b')]();};}function respondWithResult(_0xd601cf,_0x3d99b1){_0x3d99b1=_0x3d99b1||0xc8;return function(_0x124de9){if(_0x124de9){return _0xd601cf['status'](_0x3d99b1)['json'](_0x124de9);}};}function respondWithFilteredResult(_0x5f427a,_0x1e1a51){return function(_0x18a2f2){if(_0x18a2f2){var _0x4f0466=typeof _0x1e1a51['offset']==='undefined'&&typeof _0x1e1a51[_0x1518('0x1c')]===_0x1518('0x1d');var _0xd86fd0=_0x18a2f2['count'];var _0x2a9fed=_0x4f0466?0x0:_0x1e1a51[_0x1518('0x1e')];var _0x54c8a5=_0x4f0466?_0x18a2f2['count']:_0x1e1a51[_0x1518('0x1e')]+_0x1e1a51[_0x1518('0x1c')];var _0x54fd38;if(_0x54c8a5>=_0xd86fd0){_0x54c8a5=_0xd86fd0;_0x54fd38=0xc8;}else{_0x54fd38=0xce;}_0x5f427a[_0x1518('0x1f')](_0x54fd38);return _0x5f427a['set'](_0x1518('0x20'),_0x2a9fed+'-'+_0x54c8a5+'/'+_0xd86fd0)['json'](_0x18a2f2);}return null;};}function patchUpdates(_0x1b7399){return function(_0x4452da){try{jsonpatch[_0x1518('0x21')](_0x4452da,_0x1b7399,!![]);}catch(_0x288707){return BPromise['reject'](_0x288707);}return _0x4452da[_0x1518('0x22')]();};}function saveUpdates(_0x3a866b,_0x4584b0){return function(_0xe8736a){if(_0xe8736a){return _0xe8736a['update'](_0x3a866b)[_0x1518('0x23')](function(_0x5a816b){return _0x5a816b;});}return null;};}function removeEntity(_0xfcf2f0,_0x556b93){return function(_0x3148a6){if(_0x3148a6){return _0x3148a6['destroy']()[_0x1518('0x23')](function(){_0xfcf2f0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x867841,_0x19df7f){return function(_0x57d5bf){if(!_0x57d5bf){_0x867841[_0x1518('0x24')](0x194);}return _0x57d5bf;};}function handleError(_0x3a3513,_0x946e5b){_0x946e5b=_0x946e5b||0x1f4;return function(_0x533ac3){logger[_0x1518('0x25')](_0x533ac3[_0x1518('0x26')]);if(_0x533ac3[_0x1518('0x27')]){delete _0x533ac3[_0x1518('0x27')];}_0x3a3513['status'](_0x946e5b)[_0x1518('0x28')](_0x533ac3);};}exports['index']=function(_0x2d0d10,_0xcd6d1b){var _0x45444={},_0x5f3ed9={},_0x47d2da={'count':0x0,'rows':[]};var _0x26a643=_[_0x1518('0x29')](db[_0x1518('0x2a')][_0x1518('0x2b')],function(_0x701f69){return{'name':_0x701f69['fieldName'],'type':_0x701f69[_0x1518('0x2c')]['key']};});_0x5f3ed9[_0x1518('0x2d')]=_[_0x1518('0x29')](_0x26a643,_0x1518('0x27'));_0x5f3ed9[_0x1518('0x2e')]=_[_0x1518('0x2f')](_0x2d0d10['query']);_0x5f3ed9[_0x1518('0x30')]=_[_0x1518('0x31')](_0x5f3ed9[_0x1518('0x2d')],_0x5f3ed9[_0x1518('0x2e')]);_0x45444['attributes']=_['intersection'](_0x5f3ed9['model'],qs[_0x1518('0x32')](_0x2d0d10[_0x1518('0x2e')]['fields']));_0x45444['attributes']=_0x45444[_0x1518('0x33')][_0x1518('0x34')]?_0x45444[_0x1518('0x33')]:_0x5f3ed9[_0x1518('0x2d')];if(!_0x2d0d10[_0x1518('0x2e')][_0x1518('0x35')](_0x1518('0x36'))){_0x45444[_0x1518('0x1c')]=qs[_0x1518('0x1c')](_0x2d0d10[_0x1518('0x2e')][_0x1518('0x1c')]);_0x45444[_0x1518('0x1e')]=qs['offset'](_0x2d0d10['query']['offset']);}_0x45444['order']=qs['sort'](_0x2d0d10[_0x1518('0x2e')][_0x1518('0x37')]);_0x45444[_0x1518('0x38')]=qs[_0x1518('0x30')](_['pick'](_0x2d0d10[_0x1518('0x2e')],_0x5f3ed9[_0x1518('0x30')]),_0x26a643);if(_0x2d0d10['query'][_0x1518('0x39')]){_0x45444['where']=_['merge'](_0x45444['where'],{'$or':_[_0x1518('0x29')](_0x26a643,function(_0x40d3a0){if(_0x40d3a0[_0x1518('0x2c')]!==_0x1518('0x3a')){var _0x45a16a={};_0x45a16a[_0x40d3a0[_0x1518('0x27')]]={'$like':'%'+_0x2d0d10['query'][_0x1518('0x39')]+'%'};return _0x45a16a;}})});}_0x45444=_[_0x1518('0x3b')]({},_0x45444,_0x2d0d10[_0x1518('0x3c')]);var _0x1194b9={'where':_0x45444['where']};return db[_0x1518('0x2a')]['count'](_0x1194b9)[_0x1518('0x23')](function(_0x3ba725){_0x47d2da[_0x1518('0x3d')]=_0x3ba725;if(_0x2d0d10['query'][_0x1518('0x3e')]){_0x45444[_0x1518('0x3f')]=[{'all':!![]}];}return db[_0x1518('0x2a')]['findAll'](_0x45444);})['then'](function(_0x122b50){_0x47d2da[_0x1518('0x40')]=_0x122b50;return _0x47d2da;})[_0x1518('0x23')](respondWithFilteredResult(_0xcd6d1b,_0x45444))['catch'](handleError(_0xcd6d1b,null));};exports[_0x1518('0x41')]=function(_0x21070d,_0x416b7a){var _0x2ac678={'raw':!![],'where':{'id':_0x21070d[_0x1518('0x42')]['id']}},_0x2d8cb7={};_0x2d8cb7[_0x1518('0x2d')]=_[_0x1518('0x2f')](db[_0x1518('0x2a')]['rawAttributes']);_0x2d8cb7['query']=_[_0x1518('0x2f')](_0x21070d['query']);_0x2d8cb7['filters']=_[_0x1518('0x31')](_0x2d8cb7[_0x1518('0x2d')],_0x2d8cb7[_0x1518('0x2e')]);_0x2ac678[_0x1518('0x33')]=_['intersection'](_0x2d8cb7[_0x1518('0x2d')],qs['fields'](_0x21070d[_0x1518('0x2e')]['fields']));_0x2ac678['attributes']=_0x2ac678[_0x1518('0x33')][_0x1518('0x34')]?_0x2ac678[_0x1518('0x33')]:_0x2d8cb7['model'];if(_0x21070d[_0x1518('0x2e')][_0x1518('0x3e')]){_0x2ac678[_0x1518('0x3f')]=[{'all':!![]}];}_0x2ac678=_[_0x1518('0x3b')]({},_0x2ac678,_0x21070d['options']);return db[_0x1518('0x2a')]['find'](_0x2ac678)[_0x1518('0x23')](handleEntityNotFound(_0x416b7a,null))['then'](respondWithResult(_0x416b7a,null))[_0x1518('0x43')](handleError(_0x416b7a,null));};exports[_0x1518('0x44')]=function(_0x2111fd,_0x5b6eb4){return db[_0x1518('0x2a')][_0x1518('0x44')](_0x2111fd[_0x1518('0x45')],{})[_0x1518('0x23')](respondWithResult(_0x5b6eb4,0xc9))[_0x1518('0x43')](handleError(_0x5b6eb4,null));};exports[_0x1518('0x46')]=function(_0x657b50,_0x320fed){if(_0x657b50[_0x1518('0x45')]['id']){delete _0x657b50['body']['id'];}return db[_0x1518('0x2a')][_0x1518('0x47')]({'where':{'id':_0x657b50[_0x1518('0x42')]['id']}})[_0x1518('0x23')](handleEntityNotFound(_0x320fed,null))['then'](saveUpdates(_0x657b50['body'],null))[_0x1518('0x23')](respondWithResult(_0x320fed,null))[_0x1518('0x43')](handleError(_0x320fed,null));};exports[_0x1518('0x48')]=function(_0x339b9c,_0x30717a){return db[_0x1518('0x2a')][_0x1518('0x47')]({'where':{'id':_0x339b9c[_0x1518('0x42')]['id']}})[_0x1518('0x23')](handleEntityNotFound(_0x30717a,null))[_0x1518('0x23')](removeEntity(_0x30717a,null))['catch'](handleError(_0x30717a,null));};exports[_0x1518('0x49')]=function(_0x2e780f,_0x5a2cdf){return db[_0x1518('0x2a')]['describe']()[_0x1518('0x23')](respondWithResult(_0x5a2cdf,null))[_0x1518('0x43')](handleError(_0x5a2cdf,null));}; \ No newline at end of file +var _0x7ce1=['type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','then','show','params','rawAttributes','filters','includeAll','find','body','catch','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','index','map','SquareDetailsReport'];(function(_0x1c34e7,_0x33f9a8){var _0x378cb1=function(_0x10b5e3){while(--_0x10b5e3){_0x1c34e7['push'](_0x1c34e7['shift']());}};_0x378cb1(++_0x33f9a8);}(_0x7ce1,0x1e1));var _0x17ce=function(_0xe719ec,_0x5a280e){_0xe719ec=_0xe719ec-0x0;var _0x4842a1=_0x7ce1[_0xe719ec];return _0x4842a1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x17ce('0x0'));var zipdir=require(_0x17ce('0x1'));var jsonpatch=require(_0x17ce('0x2'));var rp=require(_0x17ce('0x3'));var moment=require(_0x17ce('0x4'));var BPromise=require(_0x17ce('0x5'));var Mustache=require(_0x17ce('0x6'));var util=require(_0x17ce('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x17ce('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x17ce('0x9'));var _=require(_0x17ce('0xa'));var squel=require(_0x17ce('0xb'));var crypto=require('crypto');var jsforce=require(_0x17ce('0xc'));var deskjs=require(_0x17ce('0xd'));var toCsv=require(_0x17ce('0x8'));var querystring=require('querystring');var Papa=require(_0x17ce('0xe'));var Redis=require(_0x17ce('0xf'));var authService=require(_0x17ce('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x17ce('0x11'));var hardwareService=require(_0x17ce('0x12'));var logger=require('../../config/logger')(_0x17ce('0x13'));var utils=require(_0x17ce('0x14'));var config=require(_0x17ce('0x15'));var licenseUtil=require(_0x17ce('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1eddc8,_0xd7207f){_0xd7207f=_0xd7207f||0xcc;return function(_0x405847){if(_0x405847){return _0x1eddc8[_0x17ce('0x17')](_0xd7207f);}return _0x1eddc8[_0x17ce('0x18')](_0xd7207f)[_0x17ce('0x19')]();};}function respondWithResult(_0x29dd19,_0x1237b6){_0x1237b6=_0x1237b6||0xc8;return function(_0x556e1c){if(_0x556e1c){return _0x29dd19[_0x17ce('0x18')](_0x1237b6)[_0x17ce('0x1a')](_0x556e1c);}};}function respondWithFilteredResult(_0x352b4c,_0xf87737){return function(_0x39a5f5){if(_0x39a5f5){var _0x3495f0=typeof _0xf87737['offset']===_0x17ce('0x1b')&&typeof _0xf87737['limit']===_0x17ce('0x1b');var _0x14e760=_0x39a5f5[_0x17ce('0x1c')];var _0xfbef3f=_0x3495f0?0x0:_0xf87737['offset'];var _0x1b5d0a=_0x3495f0?_0x39a5f5['count']:_0xf87737[_0x17ce('0x1d')]+_0xf87737[_0x17ce('0x1e')];var _0x808653;if(_0x1b5d0a>=_0x14e760){_0x1b5d0a=_0x14e760;_0x808653=0xc8;}else{_0x808653=0xce;}_0x352b4c[_0x17ce('0x18')](_0x808653);return _0x352b4c[_0x17ce('0x1f')](_0x17ce('0x20'),_0xfbef3f+'-'+_0x1b5d0a+'/'+_0x14e760)['json'](_0x39a5f5);}return null;};}function patchUpdates(_0x1ae113){return function(_0x2cff0c){try{jsonpatch[_0x17ce('0x21')](_0x2cff0c,_0x1ae113,!![]);}catch(_0x23fae3){return BPromise[_0x17ce('0x22')](_0x23fae3);}return _0x2cff0c[_0x17ce('0x23')]();};}function saveUpdates(_0x274b09,_0x1e63b3){return function(_0x4d8fa2){if(_0x4d8fa2){return _0x4d8fa2[_0x17ce('0x24')](_0x274b09)['then'](function(_0x1ceee4){return _0x1ceee4;});}return null;};}function removeEntity(_0x22aba6,_0x58844e){return function(_0x5e11f6){if(_0x5e11f6){return _0x5e11f6[_0x17ce('0x25')]()['then'](function(){_0x22aba6['status'](0xcc)[_0x17ce('0x19')]();});}};}function handleEntityNotFound(_0x573ece,_0x2b5925){return function(_0xe46942){if(!_0xe46942){_0x573ece[_0x17ce('0x17')](0x194);}return _0xe46942;};}function handleError(_0x5e33d2,_0x5549c3){_0x5549c3=_0x5549c3||0x1f4;return function(_0x14ff0b){logger[_0x17ce('0x26')](_0x14ff0b[_0x17ce('0x27')]);if(_0x14ff0b[_0x17ce('0x28')]){delete _0x14ff0b['name'];}_0x5e33d2['status'](_0x5549c3)['send'](_0x14ff0b);};}exports[_0x17ce('0x29')]=function(_0x3785a3,_0x98acfc){var _0x279f1e={},_0x5bb715={},_0x3a0f04={'count':0x0,'rows':[]};var _0x923802=_[_0x17ce('0x2a')](db[_0x17ce('0x2b')]['rawAttributes'],function(_0x4e6e83){return{'name':_0x4e6e83['fieldName'],'type':_0x4e6e83[_0x17ce('0x2c')][_0x17ce('0x2d')]};});_0x5bb715[_0x17ce('0x2e')]=_['map'](_0x923802,_0x17ce('0x28'));_0x5bb715[_0x17ce('0x2f')]=_[_0x17ce('0x30')](_0x3785a3[_0x17ce('0x2f')]);_0x5bb715['filters']=_[_0x17ce('0x31')](_0x5bb715[_0x17ce('0x2e')],_0x5bb715[_0x17ce('0x2f')]);_0x279f1e['attributes']=_['intersection'](_0x5bb715[_0x17ce('0x2e')],qs[_0x17ce('0x32')](_0x3785a3[_0x17ce('0x2f')][_0x17ce('0x32')]));_0x279f1e[_0x17ce('0x33')]=_0x279f1e['attributes'][_0x17ce('0x34')]?_0x279f1e['attributes']:_0x5bb715[_0x17ce('0x2e')];if(!_0x3785a3['query'][_0x17ce('0x35')](_0x17ce('0x36'))){_0x279f1e[_0x17ce('0x1e')]=qs[_0x17ce('0x1e')](_0x3785a3[_0x17ce('0x2f')][_0x17ce('0x1e')]);_0x279f1e['offset']=qs[_0x17ce('0x1d')](_0x3785a3['query'][_0x17ce('0x1d')]);}_0x279f1e[_0x17ce('0x37')]=qs[_0x17ce('0x38')](_0x3785a3[_0x17ce('0x2f')][_0x17ce('0x38')]);_0x279f1e[_0x17ce('0x39')]=qs['filters'](_[_0x17ce('0x3a')](_0x3785a3[_0x17ce('0x2f')],_0x5bb715['filters']),_0x923802);if(_0x3785a3[_0x17ce('0x2f')][_0x17ce('0x3b')]){_0x279f1e[_0x17ce('0x39')]=_[_0x17ce('0x3c')](_0x279f1e[_0x17ce('0x39')],{'$or':_[_0x17ce('0x2a')](_0x923802,function(_0x142e72){if(_0x142e72[_0x17ce('0x2c')]!==_0x17ce('0x3d')){var _0x1c4f30={};_0x1c4f30[_0x142e72['name']]={'$like':'%'+_0x3785a3[_0x17ce('0x2f')][_0x17ce('0x3b')]+'%'};return _0x1c4f30;}})});}_0x279f1e=_[_0x17ce('0x3c')]({},_0x279f1e,_0x3785a3[_0x17ce('0x3e')]);var _0x3c5f79={'where':_0x279f1e[_0x17ce('0x39')]};return db[_0x17ce('0x2b')][_0x17ce('0x1c')](_0x3c5f79)['then'](function(_0x40c75e){_0x3a0f04['count']=_0x40c75e;if(_0x3785a3[_0x17ce('0x2f')]['includeAll']){_0x279f1e[_0x17ce('0x3f')]=[{'all':!![]}];}return db[_0x17ce('0x2b')][_0x17ce('0x40')](_0x279f1e);})[_0x17ce('0x41')](function(_0x14f399){_0x3a0f04['rows']=_0x14f399;return _0x3a0f04;})[_0x17ce('0x41')](respondWithFilteredResult(_0x98acfc,_0x279f1e))['catch'](handleError(_0x98acfc,null));};exports[_0x17ce('0x42')]=function(_0x4fca3a,_0x3f19d3){var _0x16e1d6={'raw':!![],'where':{'id':_0x4fca3a[_0x17ce('0x43')]['id']}},_0x221bce={};_0x221bce[_0x17ce('0x2e')]=_[_0x17ce('0x30')](db[_0x17ce('0x2b')][_0x17ce('0x44')]);_0x221bce[_0x17ce('0x2f')]=_[_0x17ce('0x30')](_0x4fca3a[_0x17ce('0x2f')]);_0x221bce[_0x17ce('0x45')]=_[_0x17ce('0x31')](_0x221bce[_0x17ce('0x2e')],_0x221bce['query']);_0x16e1d6['attributes']=_['intersection'](_0x221bce[_0x17ce('0x2e')],qs[_0x17ce('0x32')](_0x4fca3a[_0x17ce('0x2f')][_0x17ce('0x32')]));_0x16e1d6['attributes']=_0x16e1d6[_0x17ce('0x33')]['length']?_0x16e1d6[_0x17ce('0x33')]:_0x221bce[_0x17ce('0x2e')];if(_0x4fca3a['query'][_0x17ce('0x46')]){_0x16e1d6['include']=[{'all':!![]}];}_0x16e1d6=_['merge']({},_0x16e1d6,_0x4fca3a['options']);return db[_0x17ce('0x2b')][_0x17ce('0x47')](_0x16e1d6)['then'](handleEntityNotFound(_0x3f19d3,null))[_0x17ce('0x41')](respondWithResult(_0x3f19d3,null))['catch'](handleError(_0x3f19d3,null));};exports['create']=function(_0x28d621,_0x506c32){return db[_0x17ce('0x2b')]['create'](_0x28d621[_0x17ce('0x48')],{})['then'](respondWithResult(_0x506c32,0xc9))['catch'](handleError(_0x506c32,null));};exports['update']=function(_0x1ee7be,_0x5b7d24){if(_0x1ee7be[_0x17ce('0x48')]['id']){delete _0x1ee7be[_0x17ce('0x48')]['id'];}return db['SquareDetailsReport'][_0x17ce('0x47')]({'where':{'id':_0x1ee7be[_0x17ce('0x43')]['id']}})['then'](handleEntityNotFound(_0x5b7d24,null))[_0x17ce('0x41')](saveUpdates(_0x1ee7be[_0x17ce('0x48')],null))['then'](respondWithResult(_0x5b7d24,null))[_0x17ce('0x49')](handleError(_0x5b7d24,null));};exports[_0x17ce('0x25')]=function(_0x4088cf,_0xf3447){return db[_0x17ce('0x2b')][_0x17ce('0x47')]({'where':{'id':_0x4088cf[_0x17ce('0x43')]['id']}})[_0x17ce('0x41')](handleEntityNotFound(_0xf3447,null))[_0x17ce('0x41')](removeEntity(_0xf3447,null))[_0x17ce('0x49')](handleError(_0xf3447,null));};exports[_0x17ce('0x4a')]=function(_0x3c165f,_0x47542e){return db[_0x17ce('0x2b')][_0x17ce('0x4a')]()['then'](respondWithResult(_0x47542e,null))[_0x17ce('0x49')](handleError(_0x47542e,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 03f54fd..7e9e487 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 _0xe206=['./squareReportDetail.attributes','exports','define','SquareDetailsReport','lodash','util','../../config/logger','moment','request-promise','rimraf'];(function(_0x49b71c,_0x54176f){var _0x2afb0e=function(_0x25b3bf){while(--_0x25b3bf){_0x49b71c['push'](_0x49b71c['shift']());}};_0x2afb0e(++_0x54176f);}(_0xe206,0xa4));var _0x6e20=function(_0xbeb808,_0x881ddf){_0xbeb808=_0xbeb808-0x0;var _0x5d6909=_0xe206[_0xbeb808];return _0x5d6909;};'use strict';var _=require(_0x6e20('0x0'));var util=require(_0x6e20('0x1'));var logger=require(_0x6e20('0x2'))('api');var moment=require(_0x6e20('0x3'));var BPromise=require('bluebird');var rp=require(_0x6e20('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6e20('0x5'));var config=require('../../config/environment');var attributes=require(_0x6e20('0x6'));module[_0x6e20('0x7')]=function(_0x1fd06e,_0x4b6d8d){return _0x1fd06e[_0x6e20('0x8')](_0x6e20('0x9'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd5bb=['define','report_square_details','util','../../config/logger','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xd5bb,0x1df));var _0xbd5b=function(_0x4d2cfb,_0x2f2265){_0x4d2cfb=_0x4d2cfb-0x0;var _0x309a9a=_0xd5bb[_0x4d2cfb];return _0x309a9a;};'use strict';var _=require('lodash');var util=require(_0xbd5b('0x0'));var logger=require(_0xbd5b('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbd5b('0x2'));var fs=require('fs');var path=require(_0xbd5b('0x3'));var rimraf=require(_0xbd5b('0x4'));var config=require(_0xbd5b('0x5'));var attributes=require('./squareReportDetail.attributes');module[_0xbd5b('0x6')]=function(_0x1ae3ca,_0x6b5e83){return _0x1ae3ca[_0xbd5b('0x7')]('SquareDetailsReport',attributes,{'tableName':_0xbd5b('0x8'),'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 f4f25ae..2e15f6b 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 _0x4bde=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','SquareDetailsReport,\x20%s,\x20%s','message','info','result','catch','CreateSquareDetailsReport','SquareDetailsReport','options','raw','stringify','lodash','util'];(function(_0x4da382,_0x4cfc5d){var _0x10073f=function(_0x32dc45){while(--_0x32dc45){_0x4da382['push'](_0x4da382['shift']());}};_0x10073f(++_0x4cfc5d);}(_0x4bde,0x1b1));var _0xe4bd=function(_0x4db0e3,_0x45b7a8){_0x4db0e3=_0x4db0e3-0x0;var _0x4b607b=_0x4bde[_0x4db0e3];return _0x4b607b;};'use strict';var _=require(_0xe4bd('0x0'));var util=require(_0xe4bd('0x1'));var moment=require(_0xe4bd('0x2'));var BPromise=require('bluebird');var rs=require(_0xe4bd('0x3'));var fs=require('fs');var Redis=require(_0xe4bd('0x4'));var db=require(_0xe4bd('0x5'))['db'];var utils=require(_0xe4bd('0x6'));var logger=require('../../config/logger')(_0xe4bd('0x7'));var config=require(_0xe4bd('0x8'));var jayson=require(_0xe4bd('0x9'));var client=jayson[_0xe4bd('0xa')][_0xe4bd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4008eb,_0x4c933b,_0x2cf33d){return new BPromise(function(_0xbd04ce,_0x262295){return client[_0xe4bd('0xc')](_0x4008eb,_0x2cf33d)[_0xe4bd('0xd')](function(_0x3ef7e7){logger['info']('SquareDetailsReport,\x20%s,\x20%s',_0x4c933b,'request\x20sent');logger[_0xe4bd('0xe')](_0xe4bd('0xf'),_0x4c933b,_0xe4bd('0x10'),JSON['stringify'](_0x3ef7e7));if(_0x3ef7e7[_0xe4bd('0x11')]){if(_0x3ef7e7[_0xe4bd('0x11')][_0xe4bd('0x12')]===0x1f4){logger[_0xe4bd('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0x4c933b,_0x3ef7e7[_0xe4bd('0x11')]['message']);return _0x262295(_0x3ef7e7[_0xe4bd('0x11')]['message']);}logger[_0xe4bd('0x11')](_0xe4bd('0x13'),_0x4c933b,_0x3ef7e7[_0xe4bd('0x11')][_0xe4bd('0x14')]);return _0xbd04ce(_0x3ef7e7[_0xe4bd('0x11')][_0xe4bd('0x14')]);}else{logger[_0xe4bd('0x15')](_0xe4bd('0x13'),_0x4c933b,_0xe4bd('0x10'));_0xbd04ce(_0x3ef7e7[_0xe4bd('0x16')][_0xe4bd('0x14')]);}})[_0xe4bd('0x17')](function(_0x470cd1){logger['error'](_0xe4bd('0x13'),_0x4c933b,_0x470cd1);_0x262295(_0x470cd1);});});}exports[_0xe4bd('0x18')]=function(_0x5982f4){var _0x1731a1=this;return new Promise(function(_0x3dccd4,_0x544b3c){return db[_0xe4bd('0x19')]['create'](_0x5982f4['body'],{'raw':_0x5982f4[_0xe4bd('0x1a')]?_0x5982f4[_0xe4bd('0x1a')][_0xe4bd('0x1b')]===undefined?!![]:![]:!![]})[_0xe4bd('0xd')](function(_0x10a234){logger[_0xe4bd('0x15')](_0xe4bd('0x18'),_0x5982f4);logger['debug'](_0xe4bd('0x18'),_0x5982f4,JSON[_0xe4bd('0x1c')](_0x10a234));_0x3dccd4(_0x10a234);})['catch'](function(_0x2a5f40){logger[_0xe4bd('0x11')](_0xe4bd('0x18'),_0x2a5f40[_0xe4bd('0x14')],_0x5982f4);_0x544b3c(_0x1731a1[_0xe4bd('0x11')](0x1f4,_0x2a5f40[_0xe4bd('0x14')]));});});}; \ No newline at end of file +var _0x0abf=['catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','then','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SquareDetailsReport,\x20%s,\x20%s','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result'];(function(_0x19463c,_0x6b8360){var _0x1ac9ca=function(_0x1ad403){while(--_0x1ad403){_0x19463c['push'](_0x19463c['shift']());}};_0x1ac9ca(++_0x6b8360);}(_0x0abf,0xe8));var _0xf0ab=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x0abf[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xf0ab('0x0'));var util=require('util');var moment=require(_0xf0ab('0x1'));var BPromise=require(_0xf0ab('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf0ab('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf0ab('0x4'))(_0xf0ab('0x5'));var config=require(_0xf0ab('0x6'));var jayson=require(_0xf0ab('0x7'));var client=jayson[_0xf0ab('0x8')][_0xf0ab('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x233afe,_0x57ff3b,_0x2c4628){return new BPromise(function(_0x3f7e2b,_0x3ca099){return client[_0xf0ab('0xa')](_0x233afe,_0x2c4628)['then'](function(_0x472508){logger[_0xf0ab('0xb')](_0xf0ab('0xc'),_0x57ff3b,'request\x20sent');logger['debug'](_0xf0ab('0xd'),_0x57ff3b,'request\x20sent',JSON[_0xf0ab('0xe')](_0x472508));if(_0x472508[_0xf0ab('0xf')]){if(_0x472508[_0xf0ab('0xf')][_0xf0ab('0x10')]===0x1f4){logger[_0xf0ab('0xf')](_0xf0ab('0xc'),_0x57ff3b,_0x472508[_0xf0ab('0xf')]['message']);return _0x3ca099(_0x472508[_0xf0ab('0xf')][_0xf0ab('0x11')]);}logger[_0xf0ab('0xf')](_0xf0ab('0xc'),_0x57ff3b,_0x472508[_0xf0ab('0xf')][_0xf0ab('0x11')]);return _0x3f7e2b(_0x472508[_0xf0ab('0xf')][_0xf0ab('0x11')]);}else{logger[_0xf0ab('0xb')](_0xf0ab('0xc'),_0x57ff3b,_0xf0ab('0x12'));_0x3f7e2b(_0x472508[_0xf0ab('0x13')][_0xf0ab('0x11')]);}})[_0xf0ab('0x14')](function(_0x230f40){logger['error'](_0xf0ab('0xc'),_0x57ff3b,_0x230f40);_0x3ca099(_0x230f40);});});}exports[_0xf0ab('0x15')]=function(_0x1803f0){var _0x1ffeb5=this;return new Promise(function(_0x776619,_0xb9a33){return db[_0xf0ab('0x16')][_0xf0ab('0x17')](_0x1803f0[_0xf0ab('0x18')],{'raw':_0x1803f0[_0xf0ab('0x19')]?_0x1803f0[_0xf0ab('0x19')][_0xf0ab('0x1a')]===undefined?!![]:![]:!![]})[_0xf0ab('0x1b')](function(_0x22a205){logger[_0xf0ab('0xb')](_0xf0ab('0x15'),_0x1803f0);logger['debug'](_0xf0ab('0x15'),_0x1803f0,JSON[_0xf0ab('0xe')](_0x22a205));_0x776619(_0x22a205);})[_0xf0ab('0x14')](function(_0x11ab3a){logger[_0xf0ab('0xf')](_0xf0ab('0x15'),_0x11ab3a[_0xf0ab('0x11')],_0x1803f0);_0xb9a33(_0x1ffeb5[_0xf0ab('0xf')](0x1f4,_0x11ab3a[_0xf0ab('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 865eac4..ede8990 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 _0xa001=['killProcess','exports','express','Router','../../components/auth/service','./system.controller','get','isAuthenticated','index','/process/:pid/kill'];(function(_0x123922,_0x4c13b7){var _0x583796=function(_0x52bc5a){while(--_0x52bc5a){_0x123922['push'](_0x123922['shift']());}};_0x583796(++_0x4c13b7);}(_0xa001,0x70));var _0x1a00=function(_0x6a785a,_0x3b6592){_0x6a785a=_0x6a785a-0x0;var _0x63a79c=_0xa001[_0x6a785a];return _0x63a79c;};'use strict';var express=require(_0x1a00('0x0'));var router=express[_0x1a00('0x1')]();var auth=require(_0x1a00('0x2'));var controller=require(_0x1a00('0x3'));router[_0x1a00('0x4')]('/',auth[_0x1a00('0x5')](),controller[_0x1a00('0x6')]);router[_0x1a00('0x4')](_0x1a00('0x7'),auth['isAuthenticated'](),controller[_0x1a00('0x8')]);module[_0x1a00('0x9')]=router; \ No newline at end of file +var _0x0b68=['./system.controller','get','isAuthenticated','index','/process/:pid/kill','killProcess','express','Router'];(function(_0x3f786d,_0x370069){var _0x51353d=function(_0x2c73e6){while(--_0x2c73e6){_0x3f786d['push'](_0x3f786d['shift']());}};_0x51353d(++_0x370069);}(_0x0b68,0x13e));var _0x80b6=function(_0x3430bb,_0x1ccdcb){_0x3430bb=_0x3430bb-0x0;var _0x36a88f=_0x0b68[_0x3430bb];return _0x36a88f;};'use strict';var express=require(_0x80b6('0x0'));var router=express[_0x80b6('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x80b6('0x2'));router[_0x80b6('0x3')]('/',auth[_0x80b6('0x4')](),controller[_0x80b6('0x5')]);router['get'](_0x80b6('0x6'),auth['isAuthenticated'](),controller[_0x80b6('0x7')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 0ac94b9..fe7ecbe 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 _0xac80=['pid','split','indexOf','format','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','../../config/logger','api','util','bluebird','lodash','error','name','status','send','index','then','catch','json','killProcess','components/import/cm','params'];(function(_0x2605dc,_0x50cf7e){var _0x4568c9=function(_0x447f7c){while(--_0x447f7c){_0x2605dc['push'](_0x2605dc['shift']());}};_0x4568c9(++_0x50cf7e);}(_0xac80,0x74));var _0x0ac8=function(_0x1c6a65,_0x9a977e){_0x1c6a65=_0x1c6a65-0x0;var _0x2410fb=_0xac80[_0x1c6a65];return _0x2410fb;};'use strict';var info=require('systeminformation');var exec=require('child_process')['exec'];var logger=require(_0x0ac8('0x0'))(_0x0ac8('0x1'));var util=require(_0x0ac8('0x2'));var BPromise=require(_0x0ac8('0x3'));var _=require(_0x0ac8('0x4'));function handleError(_0x5f3e51,_0x65c758,_0x312289){_0x65c758=_0x65c758||0x1f4;return function(_0x14a763){logger[_0x0ac8('0x5')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x312289,_0x65c758,util['inspect'](_0x14a763,{'showHidden':![],'depth':null}));delete _0x14a763[_0x0ac8('0x6')];_0x5f3e51[_0x0ac8('0x7')](_0x65c758)[_0x0ac8('0x8')](_0x14a763);};}exports[_0x0ac8('0x9')]=function(_0x569944,_0x116471){return info['getAllData']()[_0x0ac8('0xa')](function(_0x44cdbd){return _0x116471[_0x0ac8('0x7')](0xc8)['json'](_0x44cdbd);})[_0x0ac8('0xb')](function(_0x3ec5c2){return _0x116471[_0x0ac8('0x7')](0x1f4)[_0x0ac8('0xc')](_0x3ec5c2);});};exports[_0x0ac8('0xd')]=function(_0x527a36,_0x562e22){var _0x3dcf65=[_0x0ac8('0xe')];return new BPromise(function(_0x571817,_0x424a5e){return exec(util['format']('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x527a36[_0x0ac8('0xf')][_0x0ac8('0x10')]),function(_0x305e88,_0x734b86,_0xe4cab4){if(_0x305e88){return _0x424a5e(_0x305e88);}return _0x571817(_0x734b86);});})[_0x0ac8('0xa')](function(_0x4c8afc){var _0x332afd=![];var _0x300597=_0x4c8afc[_0x0ac8('0x11')](/\n/);for(var _0x35f5ce=0x0,_0x4bbbe0=_0x3dcf65['length'];_0x35f5ce<_0x4bbbe0,_0x332afd===![];_0x35f5ce+=0x1){if(_0x4c8afc[_0x0ac8('0x12')](_0x3dcf65[_0x35f5ce])>=0x0){_0x332afd=!![];}}if(!_0x332afd){throw new Error(util[_0x0ac8('0x13')](_0x0ac8('0x14'),_0x527a36[_0x0ac8('0xf')][_0x0ac8('0x10')]));}process[_0x0ac8('0x15')](_0x527a36[_0x0ac8('0xf')][_0x0ac8('0x10')],'SIGINT');return _0x562e22[_0x0ac8('0x7')](0xc8)['json']({'message':util[_0x0ac8('0x13')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x527a36[_0x0ac8('0xf')][_0x0ac8('0x10')])});})['catch'](handleError(_0x562e22,null,_0x0ac8('0xd')));}; \ No newline at end of file +var _0x5308=['lodash','error','name','status','send','index','getAllData','then','json','catch','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','pid','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','child_process','exec','api','util','bluebird'];(function(_0xd80294,_0x47dd7d){var _0x58edc2=function(_0xbc2ac6){while(--_0xbc2ac6){_0xd80294['push'](_0xd80294['shift']());}};_0x58edc2(++_0x47dd7d);}(_0x5308,0xaa));var _0x8530=function(_0x2c5255,_0x4340c3){_0x2c5255=_0x2c5255-0x0;var _0x30d0ea=_0x5308[_0x2c5255];return _0x30d0ea;};'use strict';var info=require('systeminformation');var exec=require(_0x8530('0x0'))[_0x8530('0x1')];var logger=require('../../config/logger')(_0x8530('0x2'));var util=require(_0x8530('0x3'));var BPromise=require(_0x8530('0x4'));var _=require(_0x8530('0x5'));function handleError(_0x49ba50,_0x5618d9,_0x3831d5){_0x5618d9=_0x5618d9||0x1f4;return function(_0x227e84){logger[_0x8530('0x6')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x3831d5,_0x5618d9,util['inspect'](_0x227e84,{'showHidden':![],'depth':null}));delete _0x227e84[_0x8530('0x7')];_0x49ba50[_0x8530('0x8')](_0x5618d9)[_0x8530('0x9')](_0x227e84);};}exports[_0x8530('0xa')]=function(_0x1fa8be,_0x44b671){return info[_0x8530('0xb')]()[_0x8530('0xc')](function(_0x2cc391){return _0x44b671[_0x8530('0x8')](0xc8)[_0x8530('0xd')](_0x2cc391);})[_0x8530('0xe')](function(_0x1a9b0f){return _0x44b671[_0x8530('0x8')](0x1f4)[_0x8530('0xd')](_0x1a9b0f);});};exports['killProcess']=function(_0x166493,_0x178bd7){var _0x23ba19=['components/import/cm'];return new BPromise(function(_0x513154,_0x330ed7){return exec(util[_0x8530('0xf')](_0x8530('0x10'),_0x166493[_0x8530('0x11')]['pid']),function(_0x22ea15,_0x1d2728,_0x3487c5){if(_0x22ea15){return _0x330ed7(_0x22ea15);}return _0x513154(_0x1d2728);});})[_0x8530('0xc')](function(_0x16bfe1){var _0x20d87a=![];var _0x43cdb4=_0x16bfe1['split'](/\n/);for(var _0x17fda4=0x0,_0x19ef2b=_0x23ba19[_0x8530('0x12')];_0x17fda4<_0x19ef2b,_0x20d87a===![];_0x17fda4+=0x1){if(_0x16bfe1[_0x8530('0x13')](_0x23ba19[_0x17fda4])>=0x0){_0x20d87a=!![];}}if(!_0x20d87a){throw new Error(util[_0x8530('0xf')](_0x8530('0x14'),_0x166493[_0x8530('0x11')]['pid']));}process[_0x8530('0x15')](_0x166493[_0x8530('0x11')][_0x8530('0x16')],_0x8530('0x17'));return _0x178bd7[_0x8530('0x8')](0xc8)[_0x8530('0xd')]({'message':util['format'](_0x8530('0x18'),_0x166493[_0x8530('0x11')][_0x8530('0x16')])});})[_0x8530('0xe')](handleError(_0x178bd7,null,'killProcess'));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index f0f7180..3fbbb76 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 _0x983f=['show','post','/:id','delete','destroy','exports','path','express','../../config/environment','./tag.controller','index','get','isAuthenticated'];(function(_0x415fa6,_0x1bb5a1){var _0x2b0f67=function(_0x3a81fc){while(--_0x3a81fc){_0x415fa6['push'](_0x415fa6['shift']());}};_0x2b0f67(++_0x1bb5a1);}(_0x983f,0xe3));var _0xf983=function(_0x49a666,_0x22791b){_0x49a666=_0x49a666-0x0;var _0x137ba3=_0x983f[_0x49a666];return _0x137ba3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf983('0x0'));var timeout=require('connect-timeout');var express=require(_0xf983('0x1'));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(_0xf983('0x2'));var controller=require(_0xf983('0x3'));router['get']('/',auth['isAuthenticated'](),controller[_0xf983('0x4')]);router[_0xf983('0x5')]('/:id',auth[_0xf983('0x6')](),controller[_0xf983('0x7')]);router[_0xf983('0x8')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xf983('0x9'),auth[_0xf983('0x6')](),controller['update']);router[_0xf983('0xa')](_0xf983('0x9'),auth['isAuthenticated'](),controller[_0xf983('0xb')]);module[_0xf983('0xc')]=router; \ No newline at end of file +var _0xc69d=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','util'];(function(_0x183d0e,_0x1f520f){var _0x278ff8=function(_0x49b6d1){while(--_0x49b6d1){_0x183d0e['push'](_0x183d0e['shift']());}};_0x278ff8(++_0x1f520f);}(_0xc69d,0x143));var _0xdc69=function(_0x28d7b5,_0x1305a4){_0x28d7b5=_0x28d7b5-0x0;var _0x1ed035=_0xc69d[_0x28d7b5];return _0x1ed035;};'use strict';var multer=require('multer');var util=require(_0xdc69('0x0'));var path=require(_0xdc69('0x1'));var timeout=require(_0xdc69('0x2'));var express=require('express');var router=express[_0xdc69('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xdc69('0x4'));var interaction=require(_0xdc69('0x5'));var config=require(_0xdc69('0x6'));var controller=require('./tag.controller');router[_0xdc69('0x7')]('/',auth[_0xdc69('0x8')](),controller[_0xdc69('0x9')]);router['get'](_0xdc69('0xa'),auth['isAuthenticated'](),controller[_0xdc69('0xb')]);router[_0xdc69('0xc')]('/',auth[_0xdc69('0x8')](),controller[_0xdc69('0xd')]);router['put'](_0xdc69('0xa'),auth[_0xdc69('0x8')](),controller[_0xdc69('0xe')]);router[_0xdc69('0xf')](_0xdc69('0xa'),auth[_0xdc69('0x8')](),controller[_0xdc69('0x10')]);module[_0xdc69('0x11')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 85c09dd..7c2a1f3 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 _0x7382=['exports','STRING'];(function(_0x153b36,_0x265eda){var _0x38b194=function(_0x2a4797){while(--_0x2a4797){_0x153b36['push'](_0x153b36['shift']());}};_0x38b194(++_0x265eda);}(_0x7382,0x1f2));var _0x2738=function(_0x80c685,_0x4ce1c2){_0x80c685=_0x80c685-0x0;var _0x22b6f0=_0x7382[_0x80c685];return _0x22b6f0;};'use strict';var Sequelize=require('sequelize');module[_0x2738('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x2738('0x1')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0x2738('0x1')]}}; \ No newline at end of file +var _0x6000=['sequelize','exports','STRING','name','#0091EA'];(function(_0x4d87a8,_0x3b6840){var _0xb03ba4=function(_0x1364b3){while(--_0x1364b3){_0x4d87a8['push'](_0x4d87a8['shift']());}};_0xb03ba4(++_0x3b6840);}(_0x6000,0x17c));var _0x0600=function(_0x507867,_0x320fcc){_0x507867=_0x507867-0x0;var _0x197372=_0x6000[_0x507867];return _0x197372;};'use strict';var Sequelize=require(_0x0600('0x0'));module[_0x0600('0x1')]={'name':{'type':Sequelize[_0x0600('0x2')],'unique':_0x0600('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x0600('0x2')],'defaultValue':_0x0600('0x4')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 8e265cb..a2dad7d 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 _0x2504=['update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','send','map','Tag','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','order','where','merge','VIRTUAL','filter','findAll','catch','show','params','rawAttributes','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x2504,0xee));var _0x4250=function(_0x405a37,_0x5aea5e){_0x405a37=_0x405a37-0x0;var _0x5c781b=_0x2504[_0x405a37];return _0x5c781b;};'use strict';var emlformat=require(_0x4250('0x0'));var rimraf=require(_0x4250('0x1'));var zipdir=require(_0x4250('0x2'));var jsonpatch=require(_0x4250('0x3'));var rp=require(_0x4250('0x4'));var moment=require(_0x4250('0x5'));var BPromise=require(_0x4250('0x6'));var Mustache=require(_0x4250('0x7'));var util=require(_0x4250('0x8'));var path=require(_0x4250('0x9'));var sox=require(_0x4250('0xa'));var csv=require(_0x4250('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4250('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x4250('0xd'));var jsforce=require(_0x4250('0xe'));var deskjs=require(_0x4250('0xf'));var toCsv=require(_0x4250('0xb'));var querystring=require(_0x4250('0x10'));var Papa=require('papaparse');var Redis=require(_0x4250('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4250('0x12'));var as=require(_0x4250('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4250('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x4250('0x15'));var licenseUtil=require(_0x4250('0x16'));var db=require(_0x4250('0x17'))['db'];function respondWithStatusCode(_0x3c1e7e,_0x2a496b){_0x2a496b=_0x2a496b||0xcc;return function(_0x5d62a0){if(_0x5d62a0){return _0x3c1e7e[_0x4250('0x18')](_0x2a496b);}return _0x3c1e7e[_0x4250('0x19')](_0x2a496b)[_0x4250('0x1a')]();};}function respondWithResult(_0x2c8a75,_0xfa4d8a){_0xfa4d8a=_0xfa4d8a||0xc8;return function(_0x33f317){if(_0x33f317){return _0x2c8a75['status'](_0xfa4d8a)[_0x4250('0x1b')](_0x33f317);}};}function respondWithFilteredResult(_0x46ba15,_0x1b0c66){return function(_0x3cff02){if(_0x3cff02){var _0x2979cd=typeof _0x1b0c66[_0x4250('0x1c')]===_0x4250('0x1d')&&typeof _0x1b0c66['limit']===_0x4250('0x1d');var _0x35d232=_0x3cff02[_0x4250('0x1e')];var _0x17a8a9=_0x2979cd?0x0:_0x1b0c66[_0x4250('0x1c')];var _0x30e48c=_0x2979cd?_0x3cff02[_0x4250('0x1e')]:_0x1b0c66['offset']+_0x1b0c66[_0x4250('0x1f')];var _0x4f0154;if(_0x30e48c>=_0x35d232){_0x30e48c=_0x35d232;_0x4f0154=0xc8;}else{_0x4f0154=0xce;}_0x46ba15['status'](_0x4f0154);return _0x46ba15[_0x4250('0x20')](_0x4250('0x21'),_0x17a8a9+'-'+_0x30e48c+'/'+_0x35d232)[_0x4250('0x1b')](_0x3cff02);}return null;};}function patchUpdates(_0x42c331){return function(_0x242cf1){try{jsonpatch[_0x4250('0x22')](_0x242cf1,_0x42c331,!![]);}catch(_0x1ba772){return BPromise[_0x4250('0x23')](_0x1ba772);}return _0x242cf1[_0x4250('0x24')]();};}function saveUpdates(_0x3818c0,_0x728862){return function(_0x30e2ae){if(_0x30e2ae){return _0x30e2ae['update'](_0x3818c0)[_0x4250('0x25')](function(_0x171df4){return _0x171df4;});}return null;};}function removeEntity(_0x1feb98,_0x523053){return function(_0x5d1a74){if(_0x5d1a74){return _0x5d1a74[_0x4250('0x26')]()[_0x4250('0x25')](function(){var _0x1c1294=_0x5d1a74[_0x4250('0x27')]({'plain':!![]});var _0x328ffb='Tags';return db[_0x4250('0x28')][_0x4250('0x26')]({'where':{'type':_0x328ffb,'resourceId':_0x1c1294['id']}})[_0x4250('0x25')](function(){return _0x5d1a74;});})['then'](function(){_0x1feb98['status'](0xcc)[_0x4250('0x1a')]();});}};}function handleEntityNotFound(_0x5d0fa2,_0x3e8b4d){return function(_0x1c4fa5){if(!_0x1c4fa5){_0x5d0fa2[_0x4250('0x18')](0x194);}return _0x1c4fa5;};}function handleError(_0x2cdfdf,_0xb82299){_0xb82299=_0xb82299||0x1f4;return function(_0x501c5f){logger[_0x4250('0x29')](_0x501c5f[_0x4250('0x2a')]);if(_0x501c5f['name']){delete _0x501c5f[_0x4250('0x2b')];}_0x2cdfdf['status'](_0xb82299)[_0x4250('0x2c')](_0x501c5f);};}exports['index']=function(_0x5e0fe6,_0xea7ccc){var _0x5f20d5={},_0x16b8a4={},_0x281be9={'count':0x0,'rows':[]};var _0x4bed2b=_[_0x4250('0x2d')](db[_0x4250('0x2e')]['rawAttributes'],function(_0x217188){return{'name':_0x217188[_0x4250('0x2f')],'type':_0x217188['type'][_0x4250('0x30')]};});_0x16b8a4[_0x4250('0x31')]=_[_0x4250('0x2d')](_0x4bed2b,_0x4250('0x2b'));_0x16b8a4[_0x4250('0x32')]=_[_0x4250('0x33')](_0x5e0fe6[_0x4250('0x32')]);_0x16b8a4[_0x4250('0x34')]=_[_0x4250('0x35')](_0x16b8a4[_0x4250('0x31')],_0x16b8a4[_0x4250('0x32')]);_0x5f20d5[_0x4250('0x36')]=_[_0x4250('0x35')](_0x16b8a4['model'],qs[_0x4250('0x37')](_0x5e0fe6['query'][_0x4250('0x37')]));_0x5f20d5[_0x4250('0x36')]=_0x5f20d5['attributes'][_0x4250('0x38')]?_0x5f20d5[_0x4250('0x36')]:_0x16b8a4[_0x4250('0x31')];if(!_0x5e0fe6[_0x4250('0x32')]['hasOwnProperty']('nolimit')){_0x5f20d5['limit']=qs[_0x4250('0x1f')](_0x5e0fe6[_0x4250('0x32')]['limit']);_0x5f20d5[_0x4250('0x1c')]=qs[_0x4250('0x1c')](_0x5e0fe6[_0x4250('0x32')][_0x4250('0x1c')]);}_0x5f20d5[_0x4250('0x39')]=qs['sort'](_0x5e0fe6[_0x4250('0x32')]['sort']);_0x5f20d5['where']=qs[_0x4250('0x34')](_['pick'](_0x5e0fe6[_0x4250('0x32')],_0x16b8a4[_0x4250('0x34')]),_0x4bed2b);if(_0x5e0fe6[_0x4250('0x32')]['filter']){_0x5f20d5[_0x4250('0x3a')]=_[_0x4250('0x3b')](_0x5f20d5[_0x4250('0x3a')],{'$or':_[_0x4250('0x2d')](_0x4bed2b,function(_0x3bcdbf){if(_0x3bcdbf['type']!==_0x4250('0x3c')){var _0x1d8459={};_0x1d8459[_0x3bcdbf[_0x4250('0x2b')]]={'$like':'%'+_0x5e0fe6[_0x4250('0x32')][_0x4250('0x3d')]+'%'};return _0x1d8459;}})});}_0x5f20d5=_[_0x4250('0x3b')]({},_0x5f20d5,_0x5e0fe6['options']);var _0x3a340a={'where':_0x5f20d5['where']};return db[_0x4250('0x2e')][_0x4250('0x1e')](_0x3a340a)[_0x4250('0x25')](function(_0x2a10b9){_0x281be9[_0x4250('0x1e')]=_0x2a10b9;if(_0x5e0fe6[_0x4250('0x32')]['includeAll']){_0x5f20d5['include']=[{'all':!![]}];}return db['Tag'][_0x4250('0x3e')](_0x5f20d5);})[_0x4250('0x25')](function(_0x2e4a22){_0x281be9['rows']=_0x2e4a22;return _0x281be9;})[_0x4250('0x25')](respondWithFilteredResult(_0xea7ccc,_0x5f20d5))[_0x4250('0x3f')](handleError(_0xea7ccc,null));};exports[_0x4250('0x40')]=function(_0x53fb93,_0x100727){var _0x307d2c={'raw':!![],'where':{'id':_0x53fb93[_0x4250('0x41')]['id']}},_0x366cb7={};_0x366cb7['model']=_['keys'](db[_0x4250('0x2e')][_0x4250('0x42')]);_0x366cb7[_0x4250('0x32')]=_[_0x4250('0x33')](_0x53fb93[_0x4250('0x32')]);_0x366cb7['filters']=_[_0x4250('0x35')](_0x366cb7['model'],_0x366cb7[_0x4250('0x32')]);_0x307d2c[_0x4250('0x36')]=_[_0x4250('0x35')](_0x366cb7['model'],qs[_0x4250('0x37')](_0x53fb93[_0x4250('0x32')][_0x4250('0x37')]));_0x307d2c['attributes']=_0x307d2c['attributes']['length']?_0x307d2c[_0x4250('0x36')]:_0x366cb7[_0x4250('0x31')];if(_0x53fb93[_0x4250('0x32')][_0x4250('0x43')]){_0x307d2c[_0x4250('0x44')]=[{'all':!![]}];}_0x307d2c=_[_0x4250('0x3b')]({},_0x307d2c,_0x53fb93['options']);return db[_0x4250('0x2e')][_0x4250('0x45')](_0x307d2c)[_0x4250('0x25')](handleEntityNotFound(_0x100727,null))['then'](respondWithResult(_0x100727,null))[_0x4250('0x3f')](handleError(_0x100727,null));};exports['create']=function(_0x5895ea,_0x2e0d9d){return db[_0x4250('0x2e')][_0x4250('0x46')](_0x5895ea[_0x4250('0x47')],{})[_0x4250('0x25')](function(_0x34d672){var _0x59d51a=_0x5895ea[_0x4250('0x48')]['get']({'plain':!![]});if(!_0x59d51a)throw new Error(_0x4250('0x49'));if(_0x59d51a[_0x4250('0x4a')]===_0x4250('0x48')){var _0x544048=_0x34d672[_0x4250('0x27')]({'plain':!![]});var _0x440aa4='Tags';return db['UserProfileSection']['find']({'where':{'name':_0x440aa4,'userProfileId':_0x59d51a[_0x4250('0x4b')]},'raw':!![]})['then'](function(_0x4e3158){if(_0x4e3158&&_0x4e3158[_0x4250('0x4c')]===0x0){return db[_0x4250('0x28')][_0x4250('0x46')]({'name':_0x544048[_0x4250('0x2b')],'resourceId':_0x544048['id'],'type':_0x4e3158[_0x4250('0x2b')],'sectionId':_0x4e3158['id']},{})['then'](function(){return _0x34d672;});}else{return _0x34d672;}})[_0x4250('0x3f')](function(_0xb82981){logger[_0x4250('0x29')](_0x4250('0x4d'),_0xb82981);throw _0xb82981;});}return _0x34d672;})['then'](respondWithResult(_0x2e0d9d,0xc9))[_0x4250('0x3f')](handleError(_0x2e0d9d,null));};exports[_0x4250('0x4e')]=function(_0x59efc0,_0xc7ba0){if(_0x59efc0[_0x4250('0x47')]['id']){delete _0x59efc0['body']['id'];}return db[_0x4250('0x2e')][_0x4250('0x45')]({'where':{'id':_0x59efc0[_0x4250('0x41')]['id']}})[_0x4250('0x25')](handleEntityNotFound(_0xc7ba0,null))[_0x4250('0x25')](saveUpdates(_0x59efc0[_0x4250('0x47')],null))[_0x4250('0x25')](respondWithResult(_0xc7ba0,null))['catch'](handleError(_0xc7ba0,null));};exports[_0x4250('0x26')]=function(_0x39e9f5,_0x6094fb){return db['Tag']['find']({'where':{'id':_0x39e9f5[_0x4250('0x41')]['id']}})[_0x4250('0x25')](handleEntityNotFound(_0x6094fb,null))['then'](removeEntity(_0x6094fb,null))[_0x4250('0x3f')](handleError(_0x6094fb,null));}; \ No newline at end of file +var _0xf3cd=['params','length','find','create','user','UserProfileSection','autoAssociation','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','get','Tags','UserProfileResource','error','stack','name','send','index','map','Tag','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show'];(function(_0x17508b,_0x44f92f){var _0x39895e=function(_0x2ed07f){while(--_0x2ed07f){_0x17508b['push'](_0x17508b['shift']());}};_0x39895e(++_0x44f92f);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x256d6a,_0x2f002f){_0x256d6a=_0x256d6a-0x0;var _0x460058=_0xf3cd[_0x256d6a];return _0x460058;};'use strict';var emlformat=require(_0xdf3c('0x0'));var rimraf=require(_0xdf3c('0x1'));var zipdir=require(_0xdf3c('0x2'));var jsonpatch=require(_0xdf3c('0x3'));var rp=require(_0xdf3c('0x4'));var moment=require(_0xdf3c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdf3c('0x6'));var util=require(_0xdf3c('0x7'));var path=require(_0xdf3c('0x8'));var sox=require('sox');var csv=require(_0xdf3c('0x9'));var ejs=require(_0xdf3c('0xa'));var fs=require('fs');var fs_extra=require(_0xdf3c('0xb'));var _=require(_0xdf3c('0xc'));var squel=require(_0xdf3c('0xd'));var crypto=require(_0xdf3c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xdf3c('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdf3c('0x10'));var Redis=require(_0xdf3c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xdf3c('0x12'));var as=require(_0xdf3c('0x13'));var hardwareService=require(_0xdf3c('0x14'));var logger=require(_0xdf3c('0x15'))(_0xdf3c('0x16'));var utils=require(_0xdf3c('0x17'));var config=require(_0xdf3c('0x18'));var licenseUtil=require(_0xdf3c('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d483c,_0x166ae5){_0x166ae5=_0x166ae5||0xcc;return function(_0x41fc33){if(_0x41fc33){return _0x1d483c[_0xdf3c('0x1a')](_0x166ae5);}return _0x1d483c['status'](_0x166ae5)[_0xdf3c('0x1b')]();};}function respondWithResult(_0x461079,_0x13ea5f){_0x13ea5f=_0x13ea5f||0xc8;return function(_0x5e0047){if(_0x5e0047){return _0x461079[_0xdf3c('0x1c')](_0x13ea5f)[_0xdf3c('0x1d')](_0x5e0047);}};}function respondWithFilteredResult(_0x173041,_0x4274fd){return function(_0x21e587){if(_0x21e587){var _0x1a7a5a=typeof _0x4274fd[_0xdf3c('0x1e')]===_0xdf3c('0x1f')&&typeof _0x4274fd[_0xdf3c('0x20')]===_0xdf3c('0x1f');var _0x54cdd4=_0x21e587[_0xdf3c('0x21')];var _0x465e7d=_0x1a7a5a?0x0:_0x4274fd[_0xdf3c('0x1e')];var _0x18d4ec=_0x1a7a5a?_0x21e587[_0xdf3c('0x21')]:_0x4274fd[_0xdf3c('0x1e')]+_0x4274fd[_0xdf3c('0x20')];var _0x3ee0af;if(_0x18d4ec>=_0x54cdd4){_0x18d4ec=_0x54cdd4;_0x3ee0af=0xc8;}else{_0x3ee0af=0xce;}_0x173041[_0xdf3c('0x1c')](_0x3ee0af);return _0x173041[_0xdf3c('0x22')](_0xdf3c('0x23'),_0x465e7d+'-'+_0x18d4ec+'/'+_0x54cdd4)[_0xdf3c('0x1d')](_0x21e587);}return null;};}function patchUpdates(_0x25487c){return function(_0x5d2390){try{jsonpatch['apply'](_0x5d2390,_0x25487c,!![]);}catch(_0x3aa254){return BPromise['reject'](_0x3aa254);}return _0x5d2390[_0xdf3c('0x24')]();};}function saveUpdates(_0x40e7ec,_0x36552e){return function(_0x38b319){if(_0x38b319){return _0x38b319[_0xdf3c('0x25')](_0x40e7ec)[_0xdf3c('0x26')](function(_0x50d8ca){return _0x50d8ca;});}return null;};}function removeEntity(_0x22a164,_0x213d75){return function(_0x13e3ca){if(_0x13e3ca){return _0x13e3ca[_0xdf3c('0x27')]()[_0xdf3c('0x26')](function(){var _0x3b5371=_0x13e3ca[_0xdf3c('0x28')]({'plain':!![]});var _0x155f54=_0xdf3c('0x29');return db[_0xdf3c('0x2a')]['destroy']({'where':{'type':_0x155f54,'resourceId':_0x3b5371['id']}})[_0xdf3c('0x26')](function(){return _0x13e3ca;});})[_0xdf3c('0x26')](function(){_0x22a164['status'](0xcc)[_0xdf3c('0x1b')]();});}};}function handleEntityNotFound(_0x59659e,_0x4eaced){return function(_0x508be9){if(!_0x508be9){_0x59659e[_0xdf3c('0x1a')](0x194);}return _0x508be9;};}function handleError(_0x186bba,_0x52b8f6){_0x52b8f6=_0x52b8f6||0x1f4;return function(_0x5c3b5a){logger[_0xdf3c('0x2b')](_0x5c3b5a[_0xdf3c('0x2c')]);if(_0x5c3b5a[_0xdf3c('0x2d')]){delete _0x5c3b5a[_0xdf3c('0x2d')];}_0x186bba['status'](_0x52b8f6)[_0xdf3c('0x2e')](_0x5c3b5a);};}exports[_0xdf3c('0x2f')]=function(_0x5386bf,_0x51e0a4){var _0x1f1d8a={},_0x46f0e3={},_0x36937e={'count':0x0,'rows':[]};var _0x540f3a=_[_0xdf3c('0x30')](db[_0xdf3c('0x31')][_0xdf3c('0x32')],function(_0x10099e){return{'name':_0x10099e['fieldName'],'type':_0x10099e[_0xdf3c('0x33')][_0xdf3c('0x34')]};});_0x46f0e3['model']=_[_0xdf3c('0x30')](_0x540f3a,_0xdf3c('0x2d'));_0x46f0e3[_0xdf3c('0x35')]=_[_0xdf3c('0x36')](_0x5386bf['query']);_0x46f0e3[_0xdf3c('0x37')]=_[_0xdf3c('0x38')](_0x46f0e3[_0xdf3c('0x39')],_0x46f0e3[_0xdf3c('0x35')]);_0x1f1d8a['attributes']=_[_0xdf3c('0x38')](_0x46f0e3[_0xdf3c('0x39')],qs['fields'](_0x5386bf['query'][_0xdf3c('0x3a')]));_0x1f1d8a['attributes']=_0x1f1d8a[_0xdf3c('0x3b')]['length']?_0x1f1d8a['attributes']:_0x46f0e3['model'];if(!_0x5386bf[_0xdf3c('0x35')][_0xdf3c('0x3c')](_0xdf3c('0x3d'))){_0x1f1d8a[_0xdf3c('0x20')]=qs['limit'](_0x5386bf['query'][_0xdf3c('0x20')]);_0x1f1d8a['offset']=qs[_0xdf3c('0x1e')](_0x5386bf[_0xdf3c('0x35')][_0xdf3c('0x1e')]);}_0x1f1d8a[_0xdf3c('0x3e')]=qs[_0xdf3c('0x3f')](_0x5386bf[_0xdf3c('0x35')][_0xdf3c('0x3f')]);_0x1f1d8a[_0xdf3c('0x40')]=qs[_0xdf3c('0x37')](_['pick'](_0x5386bf[_0xdf3c('0x35')],_0x46f0e3['filters']),_0x540f3a);if(_0x5386bf['query'][_0xdf3c('0x41')]){_0x1f1d8a['where']=_[_0xdf3c('0x42')](_0x1f1d8a['where'],{'$or':_[_0xdf3c('0x30')](_0x540f3a,function(_0x27ee91){if(_0x27ee91[_0xdf3c('0x33')]!==_0xdf3c('0x43')){var _0x3098cb={};_0x3098cb[_0x27ee91[_0xdf3c('0x2d')]]={'$like':'%'+_0x5386bf[_0xdf3c('0x35')][_0xdf3c('0x41')]+'%'};return _0x3098cb;}})});}_0x1f1d8a=_[_0xdf3c('0x42')]({},_0x1f1d8a,_0x5386bf[_0xdf3c('0x44')]);var _0x424acf={'where':_0x1f1d8a[_0xdf3c('0x40')]};return db['Tag']['count'](_0x424acf)[_0xdf3c('0x26')](function(_0x5752e6){_0x36937e[_0xdf3c('0x21')]=_0x5752e6;if(_0x5386bf[_0xdf3c('0x35')][_0xdf3c('0x45')]){_0x1f1d8a[_0xdf3c('0x46')]=[{'all':!![]}];}return db['Tag']['findAll'](_0x1f1d8a);})[_0xdf3c('0x26')](function(_0x33edab){_0x36937e[_0xdf3c('0x47')]=_0x33edab;return _0x36937e;})['then'](respondWithFilteredResult(_0x51e0a4,_0x1f1d8a))[_0xdf3c('0x48')](handleError(_0x51e0a4,null));};exports[_0xdf3c('0x49')]=function(_0x6fc3b6,_0x45b25a){var _0x5da4ef={'raw':!![],'where':{'id':_0x6fc3b6[_0xdf3c('0x4a')]['id']}},_0x127685={};_0x127685[_0xdf3c('0x39')]=_[_0xdf3c('0x36')](db[_0xdf3c('0x31')]['rawAttributes']);_0x127685[_0xdf3c('0x35')]=_[_0xdf3c('0x36')](_0x6fc3b6[_0xdf3c('0x35')]);_0x127685[_0xdf3c('0x37')]=_[_0xdf3c('0x38')](_0x127685[_0xdf3c('0x39')],_0x127685['query']);_0x5da4ef['attributes']=_[_0xdf3c('0x38')](_0x127685[_0xdf3c('0x39')],qs['fields'](_0x6fc3b6['query'][_0xdf3c('0x3a')]));_0x5da4ef[_0xdf3c('0x3b')]=_0x5da4ef[_0xdf3c('0x3b')][_0xdf3c('0x4b')]?_0x5da4ef[_0xdf3c('0x3b')]:_0x127685[_0xdf3c('0x39')];if(_0x6fc3b6[_0xdf3c('0x35')][_0xdf3c('0x45')]){_0x5da4ef[_0xdf3c('0x46')]=[{'all':!![]}];}_0x5da4ef=_['merge']({},_0x5da4ef,_0x6fc3b6[_0xdf3c('0x44')]);return db[_0xdf3c('0x31')][_0xdf3c('0x4c')](_0x5da4ef)[_0xdf3c('0x26')](handleEntityNotFound(_0x45b25a,null))[_0xdf3c('0x26')](respondWithResult(_0x45b25a,null))[_0xdf3c('0x48')](handleError(_0x45b25a,null));};exports[_0xdf3c('0x4d')]=function(_0x553f70,_0x1751a8){return db['Tag'][_0xdf3c('0x4d')](_0x553f70['body'],{})[_0xdf3c('0x26')](function(_0x28144f){var _0x2ec575=_0x553f70[_0xdf3c('0x4e')]['get']({'plain':!![]});if(!_0x2ec575)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2ec575['role']===_0xdf3c('0x4e')){var _0x5f5726=_0x28144f[_0xdf3c('0x28')]({'plain':!![]});var _0x3b92d6=_0xdf3c('0x29');return db[_0xdf3c('0x4f')][_0xdf3c('0x4c')]({'where':{'name':_0x3b92d6,'userProfileId':_0x2ec575['userProfileId']},'raw':!![]})['then'](function(_0x2371aa){if(_0x2371aa&&_0x2371aa[_0xdf3c('0x50')]===0x0){return db['UserProfileResource'][_0xdf3c('0x4d')]({'name':_0x5f5726[_0xdf3c('0x2d')],'resourceId':_0x5f5726['id'],'type':_0x2371aa[_0xdf3c('0x2d')],'sectionId':_0x2371aa['id']},{})[_0xdf3c('0x26')](function(){return _0x28144f;});}else{return _0x28144f;}})[_0xdf3c('0x48')](function(_0x46dfb1){logger[_0xdf3c('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x46dfb1);throw _0x46dfb1;});}return _0x28144f;})['then'](respondWithResult(_0x1751a8,0xc9))[_0xdf3c('0x48')](handleError(_0x1751a8,null));};exports[_0xdf3c('0x25')]=function(_0x1bca39,_0x1ad771){if(_0x1bca39[_0xdf3c('0x51')]['id']){delete _0x1bca39[_0xdf3c('0x51')]['id'];}return db[_0xdf3c('0x31')][_0xdf3c('0x4c')]({'where':{'id':_0x1bca39[_0xdf3c('0x4a')]['id']}})[_0xdf3c('0x26')](handleEntityNotFound(_0x1ad771,null))[_0xdf3c('0x26')](saveUpdates(_0x1bca39['body'],null))[_0xdf3c('0x26')](respondWithResult(_0x1ad771,null))['catch'](handleError(_0x1ad771,null));};exports['destroy']=function(_0x5052d5,_0x58fcbf){return db['Tag'][_0xdf3c('0x4c')]({'where':{'id':_0x5052d5[_0xdf3c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x58fcbf,null))[_0xdf3c('0x26')](removeEntity(_0x58fcbf,null))[_0xdf3c('0x48')](handleError(_0x58fcbf,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index ba0f531..b9092f7 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 _0x9906=['define','Tag','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./tag.attributes','exports'];(function(_0x3bf001,_0xfc5c13){var _0x1be18a=function(_0x3133e6){while(--_0x3133e6){_0x3bf001['push'](_0x3bf001['shift']());}};_0x1be18a(++_0xfc5c13);}(_0x9906,0xda));var _0x6990=function(_0x587291,_0xd5fce0){_0x587291=_0x587291-0x0;var _0x2cc693=_0x9906[_0x587291];return _0x2cc693;};'use strict';var _=require(_0x6990('0x0'));var util=require(_0x6990('0x1'));var logger=require('../../config/logger')(_0x6990('0x2'));var moment=require(_0x6990('0x3'));var BPromise=require(_0x6990('0x4'));var rp=require(_0x6990('0x5'));var fs=require('fs');var path=require(_0x6990('0x6'));var rimraf=require('rimraf');var config=require(_0x6990('0x7'));var attributes=require(_0x6990('0x8'));module[_0x6990('0x9')]=function(_0x3aad47,_0x781919){return _0x3aad47[_0x6990('0xa')](_0x6990('0xb'),attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeba1=['path','rimraf','../../config/environment','./tag.attributes','define','tools_tags','lodash','util','moment','request-promise'];(function(_0x2e43c6,_0x5276ac){var _0x3ba91e=function(_0x2d8356){while(--_0x2d8356){_0x2e43c6['push'](_0x2e43c6['shift']());}};_0x3ba91e(++_0x5276ac);}(_0xeba1,0x182));var _0x1eba=function(_0x1daac8,_0x2027e8){_0x1daac8=_0x1daac8-0x0;var _0x40072e=_0xeba1[_0x1daac8];return _0x40072e;};'use strict';var _=require(_0x1eba('0x0'));var util=require(_0x1eba('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1eba('0x2'));var BPromise=require('bluebird');var rp=require(_0x1eba('0x3'));var fs=require('fs');var path=require(_0x1eba('0x4'));var rimraf=require(_0x1eba('0x5'));var config=require(_0x1eba('0x6'));var attributes=require(_0x1eba('0x7'));module['exports']=function(_0x1a071a,_0xe55f2c){return _0x1a071a[_0x1eba('0x8')]('Tag',attributes,{'tableName':_0x1eba('0x9'),'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 765fb86..99f790c 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 _0xac31=['code','Tag,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','then','info','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x464f25,_0x1dcae3){var _0x4be4f9=function(_0x26907d){while(--_0x26907d){_0x464f25['push'](_0x464f25['shift']());}};_0x4be4f9(++_0x1dcae3);}(_0xac31,0xca));var _0x1ac3=function(_0x2d6646,_0x399a0f){_0x2d6646=_0x2d6646-0x0;var _0x108563=_0xac31[_0x2d6646];return _0x108563;};'use strict';var _=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var moment=require(_0x1ac3('0x2'));var BPromise=require(_0x1ac3('0x3'));var rs=require(_0x1ac3('0x4'));var fs=require('fs');var Redis=require(_0x1ac3('0x5'));var db=require(_0x1ac3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ac3('0x7'))(_0x1ac3('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1ac3('0x9')][_0x1ac3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bf9b1,_0x1be223,_0x157604){return new BPromise(function(_0x57893c,_0x2d17de){return client['request'](_0x2bf9b1,_0x157604)[_0x1ac3('0xb')](function(_0x40b64c){logger[_0x1ac3('0xc')]('Tag,\x20%s,\x20%s',_0x1be223,_0x1ac3('0xd'));logger[_0x1ac3('0xe')](_0x1ac3('0xf'),_0x1be223,_0x1ac3('0xd'),JSON[_0x1ac3('0x10')](_0x40b64c));if(_0x40b64c[_0x1ac3('0x11')]){if(_0x40b64c['error'][_0x1ac3('0x12')]===0x1f4){logger[_0x1ac3('0x11')](_0x1ac3('0x13'),_0x1be223,_0x40b64c[_0x1ac3('0x11')]['message']);return _0x2d17de(_0x40b64c[_0x1ac3('0x11')][_0x1ac3('0x14')]);}logger[_0x1ac3('0x11')](_0x1ac3('0x13'),_0x1be223,_0x40b64c['error'][_0x1ac3('0x14')]);return _0x57893c(_0x40b64c[_0x1ac3('0x11')]['message']);}else{logger[_0x1ac3('0xc')](_0x1ac3('0x13'),_0x1be223,_0x1ac3('0xd'));_0x57893c(_0x40b64c['result'][_0x1ac3('0x14')]);}})[_0x1ac3('0x15')](function(_0x23e6e9){logger['error'](_0x1ac3('0x13'),_0x1be223,_0x23e6e9);_0x2d17de(_0x23e6e9);});});} \ No newline at end of file +var _0x984b=['Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','bluebird','randomstring','ioredis','../../config/logger','rpc','client','http','then','info'];(function(_0x33f73a,_0x128fec){var _0x5bc327=function(_0x151a85){while(--_0x151a85){_0x33f73a['push'](_0x33f73a['shift']());}};_0x5bc327(++_0x128fec);}(_0x984b,0xee));var _0xb984=function(_0x1d0daa,_0xbd3eef){_0x1d0daa=_0x1d0daa-0x0;var _0x31aca8=_0x984b[_0x1d0daa];return _0x31aca8;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xb984('0x0'));var rs=require(_0xb984('0x1'));var fs=require('fs');var Redis=require(_0xb984('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb984('0x3'))(_0xb984('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb984('0x5')][_0xb984('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5a605a,_0x7405cd,_0x1a00d6){return new BPromise(function(_0x4d72b7,_0x37fd36){return client['request'](_0x5a605a,_0x1a00d6)[_0xb984('0x7')](function(_0x42dfd9){logger[_0xb984('0x8')](_0xb984('0x9'),_0x7405cd,_0xb984('0xa'));logger[_0xb984('0xb')](_0xb984('0xc'),_0x7405cd,_0xb984('0xa'),JSON[_0xb984('0xd')](_0x42dfd9));if(_0x42dfd9[_0xb984('0xe')]){if(_0x42dfd9[_0xb984('0xe')][_0xb984('0xf')]===0x1f4){logger['error'](_0xb984('0x9'),_0x7405cd,_0x42dfd9['error'][_0xb984('0x10')]);return _0x37fd36(_0x42dfd9[_0xb984('0xe')]['message']);}logger[_0xb984('0xe')](_0xb984('0x9'),_0x7405cd,_0x42dfd9['error'][_0xb984('0x10')]);return _0x4d72b7(_0x42dfd9[_0xb984('0xe')]['message']);}else{logger[_0xb984('0x8')](_0xb984('0x9'),_0x7405cd,'request\x20sent');_0x4d72b7(_0x42dfd9[_0xb984('0x11')]['message']);}})[_0xb984('0x12')](function(_0x1dc4df){logger[_0xb984('0xe')](_0xb984('0x9'),_0x7405cd,_0x1dc4df);_0x37fd36(_0x1dc4df);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 413be70..1007ad4 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(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'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 dfb53e5..6b34203 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(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0xb7e7,0x121));var _0x7b7e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xb7e7[_0x38a7ac];return _0x53061a;};'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(_0x5a3de5,_0x1a395c){var _0x1ceb88=function(_0x2f5ee6){while(--_0x2f5ee6){_0x5a3de5['push'](_0x5a3de5['shift']());}};_0x1ceb88(++_0x1a395c);}(_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/team/team.controller.js b/server/api/team/team.controller.js index a676496..76f40df 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 _0xc5e5=['Team','findAll','catch','show','params','includeAll','include','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','getQueues','findOne','isValidChannel','channel','Sequelize','Unknown\x20channel','toLowerCase','Queue','capitalize','Queues','addQueues','ValidationError','add','ids','removeQueues','addAgents','Voice','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','sequelize','through','QueueId','TeamVoiceQueue','penalty','User','findOrCreate','emit','online','voicePause','interface','UserVoiceQueueRt','isNil','format','SIP/%s','all','spread','removeAgents','parse','Queue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./team.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','Teams','UserProfileResource','end','error','stack','name','send','index','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options'];(function(_0x10b48a,_0x1a0a3f){var _0x2c4533=function(_0x5e4be6){while(--_0x5e4be6){_0x10b48a['push'](_0x10b48a['shift']());}};_0x2c4533(++_0x1a0a3f);}(_0xc5e5,0x1e1));var _0x5c5e=function(_0x18e38e,_0x20b7cd){_0x18e38e=_0x18e38e-0x0;var _0x6c41=_0xc5e5[_0x18e38e];return _0x6c41;};'use strict';var emlformat=require(_0x5c5e('0x0'));var rimraf=require(_0x5c5e('0x1'));var zipdir=require(_0x5c5e('0x2'));var jsonpatch=require(_0x5c5e('0x3'));var rp=require('request-promise');var moment=require(_0x5c5e('0x4'));var BPromise=require(_0x5c5e('0x5'));var Mustache=require(_0x5c5e('0x6'));var util=require(_0x5c5e('0x7'));var path=require(_0x5c5e('0x8'));var sox=require(_0x5c5e('0x9'));var csv=require(_0x5c5e('0xa'));var ejs=require(_0x5c5e('0xb'));var fs=require('fs');var fs_extra=require(_0x5c5e('0xc'));var _=require(_0x5c5e('0xd'));var squel=require(_0x5c5e('0xe'));var crypto=require('crypto');var jsforce=require(_0x5c5e('0xf'));var deskjs=require(_0x5c5e('0x10'));var toCsv=require(_0x5c5e('0xa'));var querystring=require(_0x5c5e('0x11'));var Papa=require(_0x5c5e('0x12'));var Redis=require(_0x5c5e('0x13'));var authService=require(_0x5c5e('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x5c5e('0x15'));var hardwareService=require(_0x5c5e('0x16'));var logger=require(_0x5c5e('0x17'))(_0x5c5e('0x18'));var utils=require(_0x5c5e('0x19'));var config=require(_0x5c5e('0x1a'));var licenseUtil=require(_0x5c5e('0x1b'));var db=require(_0x5c5e('0x1c'))['db'];config['redis']=_[_0x5c5e('0x1d')](config[_0x5c5e('0x1e')],{'host':_0x5c5e('0x1f'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5c5e('0x20'))[_0x5c5e('0x21')](socket);function respondWithStatusCode(_0x3cba01,_0x4e2349){_0x4e2349=_0x4e2349||0xcc;return function(_0x288c4b){if(_0x288c4b){return _0x3cba01[_0x5c5e('0x22')](_0x4e2349);}return _0x3cba01[_0x5c5e('0x23')](_0x4e2349)['end']();};}function respondWithResult(_0x3afa4a,_0x60c2d8){_0x60c2d8=_0x60c2d8||0xc8;return function(_0x3ac24){if(_0x3ac24){return _0x3afa4a[_0x5c5e('0x23')](_0x60c2d8)[_0x5c5e('0x24')](_0x3ac24);}};}function respondWithFilteredResult(_0x2235a3,_0x3a6f59){return function(_0x557b62){if(_0x557b62){var _0x358710=typeof _0x3a6f59[_0x5c5e('0x25')]===_0x5c5e('0x26')&&typeof _0x3a6f59['limit']===_0x5c5e('0x26');var _0x4d7734=_0x557b62[_0x5c5e('0x27')];var _0x2a39a1=_0x358710?0x0:_0x3a6f59[_0x5c5e('0x25')];var _0x31dbaa=_0x358710?_0x557b62['count']:_0x3a6f59[_0x5c5e('0x25')]+_0x3a6f59[_0x5c5e('0x28')];var _0x5420e1;if(_0x31dbaa>=_0x4d7734){_0x31dbaa=_0x4d7734;_0x5420e1=0xc8;}else{_0x5420e1=0xce;}_0x2235a3['status'](_0x5420e1);return _0x2235a3[_0x5c5e('0x29')](_0x5c5e('0x2a'),_0x2a39a1+'-'+_0x31dbaa+'/'+_0x4d7734)[_0x5c5e('0x24')](_0x557b62);}return null;};}function patchUpdates(_0x5ad422){return function(_0x123f0a){try{jsonpatch[_0x5c5e('0x2b')](_0x123f0a,_0x5ad422,!![]);}catch(_0x25068e){return BPromise[_0x5c5e('0x2c')](_0x25068e);}return _0x123f0a[_0x5c5e('0x2d')]();};}function saveUpdates(_0x4b5494,_0x51dd1d){return function(_0x287773){if(_0x287773){return _0x287773[_0x5c5e('0x2e')](_0x4b5494)['then'](function(_0x5c6ceb){return _0x5c6ceb;});}return null;};}function removeEntity(_0x22aaf1,_0xc48618){return function(_0x274543){if(_0x274543){return _0x274543[_0x5c5e('0x2f')]()[_0x5c5e('0x30')](function(){var _0x198a2c=_0x274543[_0x5c5e('0x31')]({'plain':!![]});var _0xf172d5=_0x5c5e('0x32');return db[_0x5c5e('0x33')][_0x5c5e('0x2f')]({'where':{'type':_0xf172d5,'resourceId':_0x198a2c['id']}})[_0x5c5e('0x30')](function(){return _0x274543;});})[_0x5c5e('0x30')](function(){_0x22aaf1[_0x5c5e('0x23')](0xcc)[_0x5c5e('0x34')]();});}};}function handleEntityNotFound(_0x3a864a,_0x56c72b){return function(_0x35ca1d){if(!_0x35ca1d){_0x3a864a[_0x5c5e('0x22')](0x194);}return _0x35ca1d;};}function handleError(_0x20ec8d,_0x17dacb){_0x17dacb=_0x17dacb||0x1f4;return function(_0x275838){logger[_0x5c5e('0x35')](_0x275838[_0x5c5e('0x36')]);if(_0x275838[_0x5c5e('0x37')]){delete _0x275838[_0x5c5e('0x37')];}_0x20ec8d[_0x5c5e('0x23')](_0x17dacb)[_0x5c5e('0x38')](_0x275838);};}exports[_0x5c5e('0x39')]=function(_0x13e534,_0x656e2){var _0x3e1116={},_0x155bd7={},_0x298de4={'count':0x0,'rows':[]};var _0x5c94a1=_['map'](db['Team'][_0x5c5e('0x3a')],function(_0x5519f5){return{'name':_0x5519f5['fieldName'],'type':_0x5519f5[_0x5c5e('0x3b')][_0x5c5e('0x3c')]};});_0x155bd7[_0x5c5e('0x3d')]=_[_0x5c5e('0x3e')](_0x5c94a1,_0x5c5e('0x37'));_0x155bd7['query']=_[_0x5c5e('0x3f')](_0x13e534[_0x5c5e('0x40')]);_0x155bd7[_0x5c5e('0x41')]=_[_0x5c5e('0x42')](_0x155bd7[_0x5c5e('0x3d')],_0x155bd7[_0x5c5e('0x40')]);_0x3e1116[_0x5c5e('0x43')]=_[_0x5c5e('0x42')](_0x155bd7[_0x5c5e('0x3d')],qs[_0x5c5e('0x44')](_0x13e534[_0x5c5e('0x40')]['fields']));_0x3e1116[_0x5c5e('0x43')]=_0x3e1116[_0x5c5e('0x43')][_0x5c5e('0x45')]?_0x3e1116[_0x5c5e('0x43')]:_0x155bd7[_0x5c5e('0x3d')];if(!_0x13e534[_0x5c5e('0x40')][_0x5c5e('0x46')]('nolimit')){_0x3e1116[_0x5c5e('0x28')]=qs[_0x5c5e('0x28')](_0x13e534[_0x5c5e('0x40')][_0x5c5e('0x28')]);_0x3e1116[_0x5c5e('0x25')]=qs[_0x5c5e('0x25')](_0x13e534[_0x5c5e('0x40')]['offset']);}_0x3e1116[_0x5c5e('0x47')]=qs[_0x5c5e('0x48')](_0x13e534[_0x5c5e('0x40')][_0x5c5e('0x48')]);_0x3e1116[_0x5c5e('0x49')]=qs['filters'](_[_0x5c5e('0x4a')](_0x13e534['query'],_0x155bd7[_0x5c5e('0x41')]),_0x5c94a1);if(_0x13e534[_0x5c5e('0x40')][_0x5c5e('0x4b')]){_0x3e1116[_0x5c5e('0x49')]=_['merge'](_0x3e1116[_0x5c5e('0x49')],{'$or':_[_0x5c5e('0x3e')](_0x5c94a1,function(_0x403ab8){if(_0x403ab8[_0x5c5e('0x3b')]!==_0x5c5e('0x4c')){var _0x5c902a={};_0x5c902a[_0x403ab8['name']]={'$like':'%'+_0x13e534[_0x5c5e('0x40')]['filter']+'%'};return _0x5c902a;}})});}_0x3e1116=_[_0x5c5e('0x4d')]({},_0x3e1116,_0x13e534[_0x5c5e('0x4e')]);var _0x5a429a={'where':_0x3e1116[_0x5c5e('0x49')]};return db[_0x5c5e('0x4f')][_0x5c5e('0x27')](_0x5a429a)[_0x5c5e('0x30')](function(_0x5192e1){_0x298de4[_0x5c5e('0x27')]=_0x5192e1;if(_0x13e534[_0x5c5e('0x40')]['includeAll']){_0x3e1116['include']=[{'all':!![]}];}return db[_0x5c5e('0x4f')][_0x5c5e('0x50')](_0x3e1116);})[_0x5c5e('0x30')](function(_0x5cf55d){_0x298de4['rows']=_0x5cf55d;return _0x298de4;})['then'](respondWithFilteredResult(_0x656e2,_0x3e1116))[_0x5c5e('0x51')](handleError(_0x656e2,null));};exports[_0x5c5e('0x52')]=function(_0x1b4159,_0xb355c4){var _0x144758={'raw':![],'where':{'id':_0x1b4159[_0x5c5e('0x53')]['id']}},_0x4d1c00={};_0x4d1c00['model']=_[_0x5c5e('0x3f')](db[_0x5c5e('0x4f')]['rawAttributes']);_0x4d1c00[_0x5c5e('0x40')]=_['keys'](_0x1b4159[_0x5c5e('0x40')]);_0x4d1c00[_0x5c5e('0x41')]=_[_0x5c5e('0x42')](_0x4d1c00[_0x5c5e('0x3d')],_0x4d1c00['query']);_0x144758[_0x5c5e('0x43')]=_[_0x5c5e('0x42')](_0x4d1c00['model'],qs[_0x5c5e('0x44')](_0x1b4159[_0x5c5e('0x40')][_0x5c5e('0x44')]));_0x144758[_0x5c5e('0x43')]=_0x144758[_0x5c5e('0x43')]['length']?_0x144758[_0x5c5e('0x43')]:_0x4d1c00['model'];if(_0x1b4159[_0x5c5e('0x40')][_0x5c5e('0x54')]){_0x144758[_0x5c5e('0x55')]=[{'all':!![]}];}_0x144758=_['merge']({},_0x144758,_0x1b4159[_0x5c5e('0x4e')]);return db[_0x5c5e('0x4f')][_0x5c5e('0x56')](_0x144758)['then'](handleEntityNotFound(_0xb355c4,null))[_0x5c5e('0x30')](respondWithResult(_0xb355c4,null))[_0x5c5e('0x51')](handleError(_0xb355c4,null));};exports[_0x5c5e('0x57')]=function(_0x413058,_0x35e3ef){return db[_0x5c5e('0x4f')][_0x5c5e('0x57')](_0x413058['body'],{})[_0x5c5e('0x30')](function(_0x12b9de){var _0x33c64e=_0x413058[_0x5c5e('0x58')][_0x5c5e('0x31')]({'plain':!![]});if(!_0x33c64e)throw new Error(_0x5c5e('0x59'));if(_0x33c64e[_0x5c5e('0x5a')]===_0x5c5e('0x58')){var _0x239c07=_0x12b9de[_0x5c5e('0x31')]({'plain':!![]});var _0xd096d=_0x5c5e('0x32');return db[_0x5c5e('0x5b')][_0x5c5e('0x56')]({'where':{'name':_0xd096d,'userProfileId':_0x33c64e[_0x5c5e('0x5c')]},'raw':!![]})[_0x5c5e('0x30')](function(_0x177969){if(_0x177969&&_0x177969[_0x5c5e('0x5d')]===0x0){return db[_0x5c5e('0x33')][_0x5c5e('0x57')]({'name':_0x239c07[_0x5c5e('0x37')],'resourceId':_0x239c07['id'],'type':_0x177969[_0x5c5e('0x37')],'sectionId':_0x177969['id']},{})[_0x5c5e('0x30')](function(){return _0x12b9de;});}else{return _0x12b9de;}})[_0x5c5e('0x51')](function(_0x8b0c3c){logger[_0x5c5e('0x35')](_0x5c5e('0x5e'),_0x8b0c3c);throw _0x8b0c3c;});}return _0x12b9de;})[_0x5c5e('0x30')](respondWithResult(_0x35e3ef,0xc9))[_0x5c5e('0x51')](handleError(_0x35e3ef,null));};exports[_0x5c5e('0x2e')]=function(_0x5487d6,_0xa7428){if(_0x5487d6['body']['id']){delete _0x5487d6[_0x5c5e('0x5f')]['id'];}return db['Team'][_0x5c5e('0x56')]({'where':{'id':_0x5487d6[_0x5c5e('0x53')]['id']}})[_0x5c5e('0x30')](handleEntityNotFound(_0xa7428,null))[_0x5c5e('0x30')](saveUpdates(_0x5487d6[_0x5c5e('0x5f')],null))['then'](respondWithResult(_0xa7428,null))[_0x5c5e('0x51')](handleError(_0xa7428,null));};exports[_0x5c5e('0x2f')]=function(_0x29b2bf,_0x5751ff){return db[_0x5c5e('0x4f')]['find']({'where':{'id':_0x29b2bf[_0x5c5e('0x53')]['id']}})['then'](handleEntityNotFound(_0x5751ff,null))[_0x5c5e('0x30')](removeEntity(_0x5751ff,null))[_0x5c5e('0x51')](handleError(_0x5751ff,null));};exports[_0x5c5e('0x60')]=function(_0x3959a3,_0x38ad7d,_0x5d5c5a){return db[_0x5c5e('0x4f')][_0x5c5e('0x61')]({'where':{'id':_0x3959a3[_0x5c5e('0x53')]['id']}})[_0x5c5e('0x30')](handleEntityNotFound(_0x38ad7d,null))['then'](function(_0x8835d9){if(!_0x3959a3[_0x5c5e('0x40')]['channel']||!utils[_0x5c5e('0x62')](_0x3959a3[_0x5c5e('0x40')][_0x5c5e('0x63')])){throw new db[(_0x5c5e('0x64'))]['ValidationError'](_0x5c5e('0x65'));}var _0x253d46={};var _0x3403b4={};_0x3403b4['model']=_['keys'](db[_['capitalize'](_0x3959a3['query'][_0x5c5e('0x63')][_0x5c5e('0x66')]())+_0x5c5e('0x67')][_0x5c5e('0x3a')]);_0x3403b4['query']=_[_0x5c5e('0x3f')](_0x3959a3[_0x5c5e('0x40')]);_0x3403b4[_0x5c5e('0x41')]=_[_0x5c5e('0x42')](_0x3403b4[_0x5c5e('0x3d')],_0x3403b4[_0x5c5e('0x40')]);_0x253d46[_0x5c5e('0x43')]=_['intersection'](_0x3403b4[_0x5c5e('0x3d')],qs['fields'](_0x3959a3[_0x5c5e('0x40')][_0x5c5e('0x44')]));_0x253d46[_0x5c5e('0x43')]=_0x253d46[_0x5c5e('0x43')]['length']?_0x253d46['attributes']:_0x3403b4[_0x5c5e('0x3d')];_0x253d46[_0x5c5e('0x28')]=qs[_0x5c5e('0x28')](_0x3959a3['query'][_0x5c5e('0x28')]);_0x253d46[_0x5c5e('0x25')]=qs[_0x5c5e('0x25')](_0x3959a3[_0x5c5e('0x40')][_0x5c5e('0x25')]);_0x253d46[_0x5c5e('0x47')]=qs[_0x5c5e('0x48')](_0x3959a3[_0x5c5e('0x40')]['sort']);_0x253d46[_0x5c5e('0x49')]=qs['filters'](_[_0x5c5e('0x4a')](_0x3959a3[_0x5c5e('0x40')],_0x3403b4[_0x5c5e('0x41')]));_0x253d46=_[_0x5c5e('0x4d')]({},_0x253d46,_0x3959a3[_0x5c5e('0x4e')]);return _0x8835d9['get'+_[_0x5c5e('0x68')](_0x3959a3[_0x5c5e('0x40')][_0x5c5e('0x63')][_0x5c5e('0x66')]())+_0x5c5e('0x69')](_0x253d46);})[_0x5c5e('0x30')](respondWithResult(_0x38ad7d,null))[_0x5c5e('0x51')](handleError(_0x38ad7d,null));};exports[_0x5c5e('0x6a')]=function(_0x17f66b,_0x37db71,_0x1bffa2){return db[_0x5c5e('0x4f')][_0x5c5e('0x61')]({'where':{'id':_0x17f66b[_0x5c5e('0x53')]['id']}})[_0x5c5e('0x30')](function(_0xbae4dd){if(_0xbae4dd){if(!_0x17f66b[_0x5c5e('0x5f')][_0x5c5e('0x63')]||!utils[_0x5c5e('0x62')](_0x17f66b['body'][_0x5c5e('0x63')])){throw new db['Sequelize'][(_0x5c5e('0x6b'))](_0x5c5e('0x65'));}return _0xbae4dd[_0x5c5e('0x6c')+_[_0x5c5e('0x68')](_0x17f66b['body'][_0x5c5e('0x63')][_0x5c5e('0x66')]())+_0x5c5e('0x69')](_0x17f66b[_0x5c5e('0x5f')][_0x5c5e('0x6d')]);}return null;})['then'](handleEntityNotFound(_0x37db71,null))[_0x5c5e('0x30')](respondWithStatusCode(_0x37db71,null))[_0x5c5e('0x51')](handleError(_0x37db71,null));};exports[_0x5c5e('0x6e')]=function(_0x47d2c8,_0x160e0b,_0x20a38e){return db['Team']['findOne']({'where':{'id':_0x47d2c8['params']['id']}})[_0x5c5e('0x30')](function(_0x407983){if(_0x407983){if(!_0x47d2c8[_0x5c5e('0x40')]['channel']||!utils[_0x5c5e('0x62')](_0x47d2c8[_0x5c5e('0x40')]['channel'])){throw new db['Sequelize'][(_0x5c5e('0x6b'))]('Unknown\x20channel');}return _0x407983['remove'+_['capitalize'](_0x47d2c8[_0x5c5e('0x40')]['channel'][_0x5c5e('0x66')]())+_0x5c5e('0x69')](_0x47d2c8[_0x5c5e('0x40')]['ids']);}return null;})[_0x5c5e('0x30')](handleEntityNotFound(_0x160e0b,null))[_0x5c5e('0x30')](respondWithStatusCode(_0x160e0b,null))[_0x5c5e('0x51')](handleError(_0x160e0b,null));};exports[_0x5c5e('0x6f')]=function(_0x382188,_0x973cf1){return db[_0x5c5e('0x4f')][_0x5c5e('0x56')]({'where':{'id':_0x382188[_0x5c5e('0x53')]['id']}})['then'](handleEntityNotFound(_0x973cf1,null))[_0x5c5e('0x30')](function(_0x4f68fa){if(_0x4f68fa){var _0x27df04=[_0x5c5e('0x70'),_0x5c5e('0x71'),_0x5c5e('0x72'),_0x5c5e('0x73'),_0x5c5e('0x74'),_0x5c5e('0x75'),_0x5c5e('0x76')];return db[_0x5c5e('0x77')]['transaction'](function(_0x4f1b76){var _0x5ef5f5=_[_0x5c5e('0x3e')](_0x27df04,function(_0x19f031){var _0x57cd11={'attributes':['id','name']};if(_0x19f031===_0x5c5e('0x70')){_0x57cd11[_0x5c5e('0x78')]={'attributes':['penalty']};}return _0x4f68fa[_0x5c5e('0x31')+_0x19f031+_0x5c5e('0x69')](_0x57cd11)['then'](function(_0x377a0d){var _0x28212c=_[_0x5c5e('0x3e')](_0x377a0d,function(_0xb9bb69){var _0x322ca8=_['map'](_0x382188['body'][_0x5c5e('0x6d')],function(_0x4b139d){var _0x4857ab={'where':{'UserId':_0x4b139d,[_0x19f031+_0x5c5e('0x79')]:_0xb9bb69['id']},'transaction':_0x4f1b76};if(_0x19f031===_0x5c5e('0x70')){_0x4857ab[_0x5c5e('0x1d')]={'penalty':_0xb9bb69[_0x5c5e('0x7a')][_0x5c5e('0x7b')]};}return db[_0x5c5e('0x7c')+_0x19f031+_0x5c5e('0x67')][_0x5c5e('0x7d')](_0x4857ab)[_0x5c5e('0x30')](function(){socket[_0x5c5e('0x7e')](_0x5c5e('0x58')+_0x19f031+'Queue:save',{'UserId':_0x4b139d,[_0x19f031+_0x5c5e('0x79')]:_0xb9bb69['id']});if(_0x19f031!=='Voice')return;return db[_0x5c5e('0x7c')][_0x5c5e('0x50')]({'where':{'id':_0x382188['body'][_0x5c5e('0x6d')],'online':0x1},'attributes':['id',_0x5c5e('0x37'),_0x5c5e('0x7f'),_0x5c5e('0x80'),_0x5c5e('0x81')],'raw':!![]})[_0x5c5e('0x30')](function(_0x4b9169){var _0x2dc668=_[_0x5c5e('0x3e')](_0x4b9169,function(_0x413dc7){return db[_0x5c5e('0x82')]['upsert']({'membername':_0x413dc7[_0x5c5e('0x37')],'UserId':_0x413dc7['id'],'queue_name':_0xb9bb69[_0x5c5e('0x37')],'VoiceQueueId':_0xb9bb69['id'],'interface':_[_0x5c5e('0x83')](_0x413dc7[_0x5c5e('0x81')])?util[_0x5c5e('0x84')](_0x5c5e('0x85'),_0x413dc7[_0x5c5e('0x37')]):_0x413dc7['interface'],'paused':_0x413dc7[_0x5c5e('0x80')]||![],'penalty':_0xb9bb69['TeamVoiceQueue'][_0x5c5e('0x7b')]},{'transaction':_0x4f1b76});});return Promise[_0x5c5e('0x86')](_0x2dc668);});});});return Promise[_0x5c5e('0x86')](_0x322ca8);});return Promise[_0x5c5e('0x86')](_0x28212c);});});return Promise['all'](_0x5ef5f5)['then'](function(){return _0x4f68fa[_0x5c5e('0x6f')](_0x382188['body'][_0x5c5e('0x6d')],{'transaction':_0x4f1b76})[_0x5c5e('0x87')](function(_0x58d94f){return _0x58d94f;});});});}})[_0x5c5e('0x30')](respondWithResult(_0x973cf1,null))[_0x5c5e('0x51')](handleError(_0x973cf1,null));};exports[_0x5c5e('0x88')]=function(_0xef0ba3,_0x446894){return db[_0x5c5e('0x4f')][_0x5c5e('0x56')]({'where':{'id':_0xef0ba3[_0x5c5e('0x53')]['id']}})[_0x5c5e('0x30')](handleEntityNotFound(_0x446894,null))[_0x5c5e('0x30')](function(_0x403740){if(_0x403740){var _0xf5075a=['Voice',_0x5c5e('0x71'),_0x5c5e('0x72'),_0x5c5e('0x73'),'Fax',_0x5c5e('0x75'),_0x5c5e('0x76')];return db[_0x5c5e('0x77')]['transaction'](function(_0x13b5a7){var _0x3ca67a=_[_0x5c5e('0x3e')](_0xf5075a,function(_0xf692a4){var _0x23553f={'attributes':['id',_0x5c5e('0x37')]};return _0x403740['get'+_0xf692a4+_0x5c5e('0x69')](_0x23553f)[_0x5c5e('0x30')](function(_0x461f07){var _0x4da3c2=_[_0x5c5e('0x3e')](_0x461f07,function(_0x469343){return _0x469343[_0x5c5e('0x88')](_0xef0ba3[_0x5c5e('0x40')][_0x5c5e('0x6d')],{'transaction':_0x13b5a7})[_0x5c5e('0x30')](function(){var _0x243880=JSON[_0x5c5e('0x89')]('['+_0xef0ba3['query']['ids']+']');var _0x12d1f4=_[_0x5c5e('0x3e')](_0x243880,function(_0x3b56d1){socket['emit'](_0x5c5e('0x58')+_0xf692a4+_0x5c5e('0x8a'),{'UserId':Number(_0x3b56d1),[_0xf692a4+_0x5c5e('0x79')]:_0x469343['id']});if(_0xf692a4!=='Voice')return;return db[_0x5c5e('0x82')]['destroy']({'where':{'VoiceQueueId':_0x469343['id'],'UserId':_0x3b56d1},'transaction':_0x13b5a7});});return Promise['all'](_0x12d1f4);});});return Promise[_0x5c5e('0x86')](_0x4da3c2);});});return Promise['all'](_0x3ca67a)[_0x5c5e('0x30')](function(){return _0x403740[_0x5c5e('0x88')](_0xef0ba3[_0x5c5e('0x40')][_0x5c5e('0x6d')],{'transaction':_0x13b5a7});});});}})['then'](respondWithStatusCode(_0x446894,null))[_0x5c5e('0x51')](handleError(_0x446894,null));};exports[_0x5c5e('0x8b')]=function(_0x5c4b84,_0x197832,_0x375a25){var _0x34365f={};var _0x53d0e2={};var _0x3eb552;var _0x595310;return db['Team'][_0x5c5e('0x61')]({'where':{'id':_0x5c4b84[_0x5c5e('0x53')]['id']}})[_0x5c5e('0x30')](handleEntityNotFound(_0x197832,null))[_0x5c5e('0x30')](function(_0x4ddcfc){if(_0x4ddcfc){_0x3eb552=_0x4ddcfc;_0x53d0e2['model']=_[_0x5c5e('0x3f')](db[_0x5c5e('0x7c')]['rawAttributes']);_0x53d0e2[_0x5c5e('0x40')]=_['keys'](_0x5c4b84['query']);_0x53d0e2['filters']=_['intersection'](_0x53d0e2[_0x5c5e('0x3d')],_0x53d0e2[_0x5c5e('0x40')]);_0x34365f[_0x5c5e('0x43')]=_[_0x5c5e('0x42')](_0x53d0e2[_0x5c5e('0x3d')],qs[_0x5c5e('0x44')](_0x5c4b84['query']['fields']));_0x34365f['attributes']=_0x34365f['attributes']['length']?_0x34365f[_0x5c5e('0x43')]:_0x53d0e2[_0x5c5e('0x3d')];_0x34365f[_0x5c5e('0x47')]=qs[_0x5c5e('0x48')](_0x5c4b84[_0x5c5e('0x40')][_0x5c5e('0x48')]);_0x34365f[_0x5c5e('0x49')]=qs['filters'](_[_0x5c5e('0x4a')](_0x5c4b84[_0x5c5e('0x40')],_0x53d0e2['filters']));if(_0x5c4b84[_0x5c5e('0x40')][_0x5c5e('0x4b')]){_0x34365f[_0x5c5e('0x49')]=_[_0x5c5e('0x4d')](_0x34365f[_0x5c5e('0x49')],{'$or':_['map'](_0x34365f[_0x5c5e('0x43')],function(_0x2d785d){var _0x93df3b={};_0x93df3b[_0x2d785d]={'$like':'%'+_0x5c4b84['query'][_0x5c5e('0x4b')]+'%'};return _0x93df3b;})});}_0x34365f=_[_0x5c5e('0x4d')]({},_0x34365f,_0x5c4b84['options']);return _0x3eb552[_0x5c5e('0x8b')](_0x34365f);}})[_0x5c5e('0x30')](function(_0x14798a){if(_0x14798a){_0x595310=_0x14798a[_0x5c5e('0x45')];if(!_0x5c4b84[_0x5c5e('0x40')][_0x5c5e('0x46')]('nolimit')){_0x34365f['limit']=qs[_0x5c5e('0x28')](_0x5c4b84[_0x5c5e('0x40')][_0x5c5e('0x28')]);_0x34365f[_0x5c5e('0x25')]=qs[_0x5c5e('0x25')](_0x5c4b84[_0x5c5e('0x40')][_0x5c5e('0x25')]);}return _0x3eb552[_0x5c5e('0x8b')](_0x34365f);}})['then'](function(_0x63ce51){if(_0x63ce51){return _0x63ce51?{'count':_0x595310,'rows':_0x63ce51}:null;}})['then'](respondWithResult(_0x197832,null))['catch'](handleError(_0x197832,null));}; \ No newline at end of file +var _0x5669=['isNil','format','SIP/%s','interface','voicePause','all','spread','removeAgents','Openchannel','Queue:remove','getAgents','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','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','../../mysqldb','redis','localhost','./team.socket','register','sendStatus','status','json','offset','undefined','limit','count','save','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','Team','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getQueues','channel','isValidChannel','toLowerCase','Queue','pick','capitalize','addQueues','findOne','Sequelize','Unknown\x20channel','add','Queues','removeQueues','ValidationError','remove','ids','addAgents','Voice','Chat','Mail','Sms','Fax','Whatsapp','sequelize','transaction','through','penalty','QueueId','defaults','TeamVoiceQueue','User','emit','Queue:save','online','UserVoiceQueueRt'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0x5669,0x19e));var _0x9566=function(_0x1ef167,_0x444fcd){_0x1ef167=_0x1ef167-0x0;var _0x594b71=_0x5669[_0x1ef167];return _0x594b71;};'use strict';var emlformat=require(_0x9566('0x0'));var rimraf=require(_0x9566('0x1'));var zipdir=require(_0x9566('0x2'));var jsonpatch=require(_0x9566('0x3'));var rp=require(_0x9566('0x4'));var moment=require(_0x9566('0x5'));var BPromise=require(_0x9566('0x6'));var Mustache=require(_0x9566('0x7'));var util=require(_0x9566('0x8'));var path=require(_0x9566('0x9'));var sox=require('sox');var csv=require(_0x9566('0xa'));var ejs=require(_0x9566('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9566('0xc'));var squel=require(_0x9566('0xd'));var crypto=require(_0x9566('0xe'));var jsforce=require(_0x9566('0xf'));var deskjs=require(_0x9566('0x10'));var toCsv=require(_0x9566('0xa'));var querystring=require(_0x9566('0x11'));var Papa=require(_0x9566('0x12'));var Redis=require(_0x9566('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x9566('0x14'));var as=require(_0x9566('0x15'));var hardwareService=require(_0x9566('0x16'));var logger=require(_0x9566('0x17'))('api');var utils=require(_0x9566('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x9566('0x19'));var db=require(_0x9566('0x1a'))['db'];config[_0x9566('0x1b')]=_['defaults'](config[_0x9566('0x1b')],{'host':_0x9566('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9566('0x1b')]));require(_0x9566('0x1d'))[_0x9566('0x1e')](socket);function respondWithStatusCode(_0x15e813,_0x2cfada){_0x2cfada=_0x2cfada||0xcc;return function(_0x22f935){if(_0x22f935){return _0x15e813[_0x9566('0x1f')](_0x2cfada);}return _0x15e813[_0x9566('0x20')](_0x2cfada)['end']();};}function respondWithResult(_0x484e94,_0x47053f){_0x47053f=_0x47053f||0xc8;return function(_0x14da07){if(_0x14da07){return _0x484e94[_0x9566('0x20')](_0x47053f)[_0x9566('0x21')](_0x14da07);}};}function respondWithFilteredResult(_0x25b4a1,_0x44201b){return function(_0x412bec){if(_0x412bec){var _0x33168b=typeof _0x44201b[_0x9566('0x22')]===_0x9566('0x23')&&typeof _0x44201b[_0x9566('0x24')]==='undefined';var _0x352ef0=_0x412bec[_0x9566('0x25')];var _0x527a63=_0x33168b?0x0:_0x44201b['offset'];var _0x263165=_0x33168b?_0x412bec[_0x9566('0x25')]:_0x44201b[_0x9566('0x22')]+_0x44201b[_0x9566('0x24')];var _0x38d4a6;if(_0x263165>=_0x352ef0){_0x263165=_0x352ef0;_0x38d4a6=0xc8;}else{_0x38d4a6=0xce;}_0x25b4a1[_0x9566('0x20')](_0x38d4a6);return _0x25b4a1['set']('Content-Range',_0x527a63+'-'+_0x263165+'/'+_0x352ef0)[_0x9566('0x21')](_0x412bec);}return null;};}function patchUpdates(_0x271305){return function(_0x1046d5){try{jsonpatch['apply'](_0x1046d5,_0x271305,!![]);}catch(_0x337abe){return BPromise['reject'](_0x337abe);}return _0x1046d5[_0x9566('0x26')]();};}function saveUpdates(_0x496a8e,_0x2c077f){return function(_0x516917){if(_0x516917){return _0x516917['update'](_0x496a8e)[_0x9566('0x27')](function(_0x478363){return _0x478363;});}return null;};}function removeEntity(_0x5c8699,_0x18d88e){return function(_0x241acc){if(_0x241acc){return _0x241acc[_0x9566('0x28')]()[_0x9566('0x27')](function(){var _0x2937a8=_0x241acc[_0x9566('0x29')]({'plain':!![]});var _0x2a72bb='Teams';return db[_0x9566('0x2a')]['destroy']({'where':{'type':_0x2a72bb,'resourceId':_0x2937a8['id']}})[_0x9566('0x27')](function(){return _0x241acc;});})[_0x9566('0x27')](function(){_0x5c8699[_0x9566('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x412732,_0x3dd6a8){return function(_0x5bcc60){if(!_0x5bcc60){_0x412732[_0x9566('0x1f')](0x194);}return _0x5bcc60;};}function handleError(_0x4a44ea,_0x4a7117){_0x4a7117=_0x4a7117||0x1f4;return function(_0x5f7d42){logger[_0x9566('0x2b')](_0x5f7d42[_0x9566('0x2c')]);if(_0x5f7d42[_0x9566('0x2d')]){delete _0x5f7d42[_0x9566('0x2d')];}_0x4a44ea['status'](_0x4a7117)[_0x9566('0x2e')](_0x5f7d42);};}exports[_0x9566('0x2f')]=function(_0x3e76e1,_0x23c94a){var _0x179c07={},_0x48298a={},_0x1cb8be={'count':0x0,'rows':[]};var _0x12839d=_[_0x9566('0x30')](db[_0x9566('0x31')][_0x9566('0x32')],function(_0x58ef16){return{'name':_0x58ef16[_0x9566('0x33')],'type':_0x58ef16['type'][_0x9566('0x34')]};});_0x48298a[_0x9566('0x35')]=_['map'](_0x12839d,_0x9566('0x2d'));_0x48298a['query']=_[_0x9566('0x36')](_0x3e76e1[_0x9566('0x37')]);_0x48298a[_0x9566('0x38')]=_[_0x9566('0x39')](_0x48298a[_0x9566('0x35')],_0x48298a[_0x9566('0x37')]);_0x179c07[_0x9566('0x3a')]=_[_0x9566('0x39')](_0x48298a[_0x9566('0x35')],qs[_0x9566('0x3b')](_0x3e76e1[_0x9566('0x37')][_0x9566('0x3b')]));_0x179c07['attributes']=_0x179c07['attributes']['length']?_0x179c07[_0x9566('0x3a')]:_0x48298a[_0x9566('0x35')];if(!_0x3e76e1[_0x9566('0x37')]['hasOwnProperty'](_0x9566('0x3c'))){_0x179c07[_0x9566('0x24')]=qs[_0x9566('0x24')](_0x3e76e1['query'][_0x9566('0x24')]);_0x179c07['offset']=qs['offset'](_0x3e76e1['query']['offset']);}_0x179c07[_0x9566('0x3d')]=qs[_0x9566('0x3e')](_0x3e76e1[_0x9566('0x37')]['sort']);_0x179c07[_0x9566('0x3f')]=qs[_0x9566('0x38')](_['pick'](_0x3e76e1[_0x9566('0x37')],_0x48298a['filters']),_0x12839d);if(_0x3e76e1[_0x9566('0x37')][_0x9566('0x40')]){_0x179c07[_0x9566('0x3f')]=_[_0x9566('0x41')](_0x179c07[_0x9566('0x3f')],{'$or':_[_0x9566('0x30')](_0x12839d,function(_0x1cb410){if(_0x1cb410[_0x9566('0x42')]!==_0x9566('0x43')){var _0x30c9be={};_0x30c9be[_0x1cb410[_0x9566('0x2d')]]={'$like':'%'+_0x3e76e1[_0x9566('0x37')][_0x9566('0x40')]+'%'};return _0x30c9be;}})});}_0x179c07=_[_0x9566('0x41')]({},_0x179c07,_0x3e76e1[_0x9566('0x44')]);var _0x40da44={'where':_0x179c07[_0x9566('0x3f')]};return db[_0x9566('0x31')][_0x9566('0x25')](_0x40da44)[_0x9566('0x27')](function(_0x58c4f6){_0x1cb8be[_0x9566('0x25')]=_0x58c4f6;if(_0x3e76e1['query']['includeAll']){_0x179c07[_0x9566('0x45')]=[{'all':!![]}];}return db[_0x9566('0x31')][_0x9566('0x46')](_0x179c07);})[_0x9566('0x27')](function(_0x30d3ca){_0x1cb8be[_0x9566('0x47')]=_0x30d3ca;return _0x1cb8be;})[_0x9566('0x27')](respondWithFilteredResult(_0x23c94a,_0x179c07))[_0x9566('0x48')](handleError(_0x23c94a,null));};exports['show']=function(_0x59c8b3,_0x4cace9){var _0xc354aa={'raw':![],'where':{'id':_0x59c8b3[_0x9566('0x49')]['id']}},_0x4f919c={};_0x4f919c[_0x9566('0x35')]=_[_0x9566('0x36')](db[_0x9566('0x31')]['rawAttributes']);_0x4f919c[_0x9566('0x37')]=_[_0x9566('0x36')](_0x59c8b3[_0x9566('0x37')]);_0x4f919c[_0x9566('0x38')]=_[_0x9566('0x39')](_0x4f919c[_0x9566('0x35')],_0x4f919c[_0x9566('0x37')]);_0xc354aa['attributes']=_[_0x9566('0x39')](_0x4f919c[_0x9566('0x35')],qs[_0x9566('0x3b')](_0x59c8b3[_0x9566('0x37')][_0x9566('0x3b')]));_0xc354aa[_0x9566('0x3a')]=_0xc354aa[_0x9566('0x3a')][_0x9566('0x4a')]?_0xc354aa[_0x9566('0x3a')]:_0x4f919c['model'];if(_0x59c8b3[_0x9566('0x37')]['includeAll']){_0xc354aa[_0x9566('0x45')]=[{'all':!![]}];}_0xc354aa=_[_0x9566('0x41')]({},_0xc354aa,_0x59c8b3[_0x9566('0x44')]);return db['Team'][_0x9566('0x4b')](_0xc354aa)[_0x9566('0x27')](handleEntityNotFound(_0x4cace9,null))[_0x9566('0x27')](respondWithResult(_0x4cace9,null))[_0x9566('0x48')](handleError(_0x4cace9,null));};exports['create']=function(_0x547c4c,_0x13f307){return db[_0x9566('0x31')][_0x9566('0x4c')](_0x547c4c[_0x9566('0x4d')],{})['then'](function(_0x9079b1){var _0x3fa2ac=_0x547c4c[_0x9566('0x4e')][_0x9566('0x29')]({'plain':!![]});if(!_0x3fa2ac)throw new Error(_0x9566('0x4f'));if(_0x3fa2ac[_0x9566('0x50')]==='user'){var _0x200eb8=_0x9079b1[_0x9566('0x29')]({'plain':!![]});var _0x3f0a83=_0x9566('0x51');return db[_0x9566('0x52')][_0x9566('0x4b')]({'where':{'name':_0x3f0a83,'userProfileId':_0x3fa2ac['userProfileId']},'raw':!![]})[_0x9566('0x27')](function(_0x2e07c7){if(_0x2e07c7&&_0x2e07c7[_0x9566('0x53')]===0x0){return db[_0x9566('0x2a')][_0x9566('0x4c')]({'name':_0x200eb8['name'],'resourceId':_0x200eb8['id'],'type':_0x2e07c7[_0x9566('0x2d')],'sectionId':_0x2e07c7['id']},{})[_0x9566('0x27')](function(){return _0x9079b1;});}else{return _0x9079b1;}})[_0x9566('0x48')](function(_0xf2bc41){logger[_0x9566('0x2b')](_0x9566('0x54'),_0xf2bc41);throw _0xf2bc41;});}return _0x9079b1;})[_0x9566('0x27')](respondWithResult(_0x13f307,0xc9))['catch'](handleError(_0x13f307,null));};exports[_0x9566('0x55')]=function(_0x2fd07a,_0x1e2021){if(_0x2fd07a[_0x9566('0x4d')]['id']){delete _0x2fd07a[_0x9566('0x4d')]['id'];}return db[_0x9566('0x31')]['find']({'where':{'id':_0x2fd07a[_0x9566('0x49')]['id']}})['then'](handleEntityNotFound(_0x1e2021,null))[_0x9566('0x27')](saveUpdates(_0x2fd07a[_0x9566('0x4d')],null))[_0x9566('0x27')](respondWithResult(_0x1e2021,null))[_0x9566('0x48')](handleError(_0x1e2021,null));};exports[_0x9566('0x28')]=function(_0x556f90,_0x1a5959){return db[_0x9566('0x31')][_0x9566('0x4b')]({'where':{'id':_0x556f90[_0x9566('0x49')]['id']}})[_0x9566('0x27')](handleEntityNotFound(_0x1a5959,null))[_0x9566('0x27')](removeEntity(_0x1a5959,null))[_0x9566('0x48')](handleError(_0x1a5959,null));};exports[_0x9566('0x56')]=function(_0x211638,_0x2c19d7,_0x2a8049){return db[_0x9566('0x31')]['findOne']({'where':{'id':_0x211638['params']['id']}})['then'](handleEntityNotFound(_0x2c19d7,null))[_0x9566('0x27')](function(_0x1a23f2){if(!_0x211638[_0x9566('0x37')][_0x9566('0x57')]||!utils[_0x9566('0x58')](_0x211638[_0x9566('0x37')][_0x9566('0x57')])){throw new db['Sequelize']['ValidationError']('Unknown\x20channel');}var _0xf2ce90={};var _0x4b30e7={};_0x4b30e7['model']=_['keys'](db[_['capitalize'](_0x211638[_0x9566('0x37')][_0x9566('0x57')][_0x9566('0x59')]())+_0x9566('0x5a')][_0x9566('0x32')]);_0x4b30e7[_0x9566('0x37')]=_[_0x9566('0x36')](_0x211638['query']);_0x4b30e7[_0x9566('0x38')]=_[_0x9566('0x39')](_0x4b30e7['model'],_0x4b30e7[_0x9566('0x37')]);_0xf2ce90['attributes']=_['intersection'](_0x4b30e7[_0x9566('0x35')],qs['fields'](_0x211638[_0x9566('0x37')][_0x9566('0x3b')]));_0xf2ce90[_0x9566('0x3a')]=_0xf2ce90[_0x9566('0x3a')][_0x9566('0x4a')]?_0xf2ce90[_0x9566('0x3a')]:_0x4b30e7['model'];_0xf2ce90['limit']=qs['limit'](_0x211638[_0x9566('0x37')]['limit']);_0xf2ce90[_0x9566('0x22')]=qs['offset'](_0x211638[_0x9566('0x37')][_0x9566('0x22')]);_0xf2ce90[_0x9566('0x3d')]=qs[_0x9566('0x3e')](_0x211638[_0x9566('0x37')][_0x9566('0x3e')]);_0xf2ce90[_0x9566('0x3f')]=qs[_0x9566('0x38')](_[_0x9566('0x5b')](_0x211638[_0x9566('0x37')],_0x4b30e7['filters']));_0xf2ce90=_['merge']({},_0xf2ce90,_0x211638[_0x9566('0x44')]);return _0x1a23f2[_0x9566('0x29')+_[_0x9566('0x5c')](_0x211638['query']['channel'][_0x9566('0x59')]())+'Queues'](_0xf2ce90);})[_0x9566('0x27')](respondWithResult(_0x2c19d7,null))[_0x9566('0x48')](handleError(_0x2c19d7,null));};exports[_0x9566('0x5d')]=function(_0x2520c3,_0x3f58c0,_0x251521){return db[_0x9566('0x31')][_0x9566('0x5e')]({'where':{'id':_0x2520c3['params']['id']}})[_0x9566('0x27')](function(_0x1bbd9b){if(_0x1bbd9b){if(!_0x2520c3[_0x9566('0x4d')]['channel']||!utils[_0x9566('0x58')](_0x2520c3[_0x9566('0x4d')][_0x9566('0x57')])){throw new db[(_0x9566('0x5f'))]['ValidationError'](_0x9566('0x60'));}return _0x1bbd9b[_0x9566('0x61')+_[_0x9566('0x5c')](_0x2520c3['body'][_0x9566('0x57')]['toLowerCase']())+_0x9566('0x62')](_0x2520c3['body']['ids']);}return null;})[_0x9566('0x27')](handleEntityNotFound(_0x3f58c0,null))['then'](respondWithStatusCode(_0x3f58c0,null))[_0x9566('0x48')](handleError(_0x3f58c0,null));};exports[_0x9566('0x63')]=function(_0x4e2dc1,_0x27558c,_0x4cf1c8){return db['Team'][_0x9566('0x5e')]({'where':{'id':_0x4e2dc1[_0x9566('0x49')]['id']}})[_0x9566('0x27')](function(_0x6424b0){if(_0x6424b0){if(!_0x4e2dc1[_0x9566('0x37')][_0x9566('0x57')]||!utils[_0x9566('0x58')](_0x4e2dc1['query'][_0x9566('0x57')])){throw new db[(_0x9566('0x5f'))][(_0x9566('0x64'))](_0x9566('0x60'));}return _0x6424b0[_0x9566('0x65')+_[_0x9566('0x5c')](_0x4e2dc1[_0x9566('0x37')][_0x9566('0x57')]['toLowerCase']())+_0x9566('0x62')](_0x4e2dc1[_0x9566('0x37')][_0x9566('0x66')]);}return null;})[_0x9566('0x27')](handleEntityNotFound(_0x27558c,null))[_0x9566('0x27')](respondWithStatusCode(_0x27558c,null))[_0x9566('0x48')](handleError(_0x27558c,null));};exports[_0x9566('0x67')]=function(_0x9049fa,_0x587f0b){return db[_0x9566('0x31')]['find']({'where':{'id':_0x9049fa[_0x9566('0x49')]['id']}})[_0x9566('0x27')](handleEntityNotFound(_0x587f0b,null))['then'](function(_0x329a57){if(_0x329a57){var _0x5341cf=[_0x9566('0x68'),_0x9566('0x69'),_0x9566('0x6a'),_0x9566('0x6b'),_0x9566('0x6c'),'Openchannel',_0x9566('0x6d')];return db[_0x9566('0x6e')][_0x9566('0x6f')](function(_0x1ba95e){var _0x2f9d12=_[_0x9566('0x30')](_0x5341cf,function(_0x19f802){var _0x4a76bb={'attributes':['id',_0x9566('0x2d')]};if(_0x19f802==='Voice'){_0x4a76bb[_0x9566('0x70')]={'attributes':[_0x9566('0x71')]};}return _0x329a57['get'+_0x19f802+_0x9566('0x62')](_0x4a76bb)[_0x9566('0x27')](function(_0x22c894){var _0x348108=_[_0x9566('0x30')](_0x22c894,function(_0x31b13c){var _0x3dd4de=_['map'](_0x9049fa[_0x9566('0x4d')][_0x9566('0x66')],function(_0x473cce){var _0x1c0f60={'where':{'UserId':_0x473cce,[_0x19f802+_0x9566('0x72')]:_0x31b13c['id']},'transaction':_0x1ba95e};if(_0x19f802===_0x9566('0x68')){_0x1c0f60[_0x9566('0x73')]={'penalty':_0x31b13c[_0x9566('0x74')][_0x9566('0x71')]};}return db[_0x9566('0x75')+_0x19f802+_0x9566('0x5a')]['findOrCreate'](_0x1c0f60)['then'](function(){socket[_0x9566('0x76')](_0x9566('0x4e')+_0x19f802+_0x9566('0x77'),{'UserId':_0x473cce,[_0x19f802+_0x9566('0x72')]:_0x31b13c['id']});if(_0x19f802!=='Voice')return;return db['User']['findAll']({'where':{'id':_0x9049fa[_0x9566('0x4d')][_0x9566('0x66')],'online':0x1},'attributes':['id',_0x9566('0x2d'),_0x9566('0x78'),'voicePause','interface'],'raw':!![]})[_0x9566('0x27')](function(_0x5733da){var _0x4b2ec5=_[_0x9566('0x30')](_0x5733da,function(_0x5d49f4){return db[_0x9566('0x79')]['upsert']({'membername':_0x5d49f4['name'],'UserId':_0x5d49f4['id'],'queue_name':_0x31b13c[_0x9566('0x2d')],'VoiceQueueId':_0x31b13c['id'],'interface':_[_0x9566('0x7a')](_0x5d49f4['interface'])?util[_0x9566('0x7b')](_0x9566('0x7c'),_0x5d49f4[_0x9566('0x2d')]):_0x5d49f4[_0x9566('0x7d')],'paused':_0x5d49f4[_0x9566('0x7e')]||![],'penalty':_0x31b13c[_0x9566('0x74')]['penalty']},{'transaction':_0x1ba95e});});return Promise[_0x9566('0x7f')](_0x4b2ec5);});});});return Promise[_0x9566('0x7f')](_0x3dd4de);});return Promise['all'](_0x348108);});});return Promise[_0x9566('0x7f')](_0x2f9d12)[_0x9566('0x27')](function(){return _0x329a57[_0x9566('0x67')](_0x9049fa['body'][_0x9566('0x66')],{'transaction':_0x1ba95e})[_0x9566('0x80')](function(_0xdd8239){return _0xdd8239;});});});}})[_0x9566('0x27')](respondWithResult(_0x587f0b,null))['catch'](handleError(_0x587f0b,null));};exports[_0x9566('0x81')]=function(_0x497754,_0x5c53a1){return db[_0x9566('0x31')]['find']({'where':{'id':_0x497754[_0x9566('0x49')]['id']}})[_0x9566('0x27')](handleEntityNotFound(_0x5c53a1,null))[_0x9566('0x27')](function(_0x88b677){if(_0x88b677){var _0x454025=['Voice','Chat',_0x9566('0x6a'),'Sms',_0x9566('0x6c'),_0x9566('0x82'),_0x9566('0x6d')];return db[_0x9566('0x6e')][_0x9566('0x6f')](function(_0x10e092){var _0x589294=_['map'](_0x454025,function(_0x2e42a3){var _0x211255={'attributes':['id',_0x9566('0x2d')]};return _0x88b677['get'+_0x2e42a3+'Queues'](_0x211255)[_0x9566('0x27')](function(_0x33dbac){var _0x2c7c12=_[_0x9566('0x30')](_0x33dbac,function(_0x55a333){return _0x55a333[_0x9566('0x81')](_0x497754['query']['ids'],{'transaction':_0x10e092})[_0x9566('0x27')](function(){var _0x5603c6=JSON['parse']('['+_0x497754[_0x9566('0x37')][_0x9566('0x66')]+']');var _0x4776cb=_['map'](_0x5603c6,function(_0x38a14a){socket['emit'](_0x9566('0x4e')+_0x2e42a3+_0x9566('0x83'),{'UserId':Number(_0x38a14a),[_0x2e42a3+'QueueId']:_0x55a333['id']});if(_0x2e42a3!==_0x9566('0x68'))return;return db[_0x9566('0x79')]['destroy']({'where':{'VoiceQueueId':_0x55a333['id'],'UserId':_0x38a14a},'transaction':_0x10e092});});return Promise[_0x9566('0x7f')](_0x4776cb);});});return Promise['all'](_0x2c7c12);});});return Promise[_0x9566('0x7f')](_0x589294)[_0x9566('0x27')](function(){return _0x88b677[_0x9566('0x81')](_0x497754[_0x9566('0x37')][_0x9566('0x66')],{'transaction':_0x10e092});});});}})[_0x9566('0x27')](respondWithStatusCode(_0x5c53a1,null))[_0x9566('0x48')](handleError(_0x5c53a1,null));};exports['getAgents']=function(_0x120200,_0x269d2f,_0x5528e6){var _0x5a0afe={};var _0x49c9ea={};var _0x16ae3c;var _0x13d06a;return db[_0x9566('0x31')][_0x9566('0x5e')]({'where':{'id':_0x120200[_0x9566('0x49')]['id']}})[_0x9566('0x27')](handleEntityNotFound(_0x269d2f,null))[_0x9566('0x27')](function(_0x3a6165){if(_0x3a6165){_0x16ae3c=_0x3a6165;_0x49c9ea[_0x9566('0x35')]=_[_0x9566('0x36')](db['User'][_0x9566('0x32')]);_0x49c9ea[_0x9566('0x37')]=_['keys'](_0x120200[_0x9566('0x37')]);_0x49c9ea[_0x9566('0x38')]=_[_0x9566('0x39')](_0x49c9ea[_0x9566('0x35')],_0x49c9ea[_0x9566('0x37')]);_0x5a0afe['attributes']=_['intersection'](_0x49c9ea[_0x9566('0x35')],qs[_0x9566('0x3b')](_0x120200['query']['fields']));_0x5a0afe['attributes']=_0x5a0afe[_0x9566('0x3a')][_0x9566('0x4a')]?_0x5a0afe[_0x9566('0x3a')]:_0x49c9ea[_0x9566('0x35')];_0x5a0afe[_0x9566('0x3d')]=qs[_0x9566('0x3e')](_0x120200['query'][_0x9566('0x3e')]);_0x5a0afe['where']=qs['filters'](_[_0x9566('0x5b')](_0x120200[_0x9566('0x37')],_0x49c9ea[_0x9566('0x38')]));if(_0x120200['query'][_0x9566('0x40')]){_0x5a0afe[_0x9566('0x3f')]=_['merge'](_0x5a0afe[_0x9566('0x3f')],{'$or':_[_0x9566('0x30')](_0x5a0afe[_0x9566('0x3a')],function(_0x4cc737){var _0x1ee827={};_0x1ee827[_0x4cc737]={'$like':'%'+_0x120200[_0x9566('0x37')][_0x9566('0x40')]+'%'};return _0x1ee827;})});}_0x5a0afe=_[_0x9566('0x41')]({},_0x5a0afe,_0x120200[_0x9566('0x44')]);return _0x16ae3c[_0x9566('0x84')](_0x5a0afe);}})[_0x9566('0x27')](function(_0x2dcc8c){if(_0x2dcc8c){_0x13d06a=_0x2dcc8c[_0x9566('0x4a')];if(!_0x120200[_0x9566('0x37')][_0x9566('0x85')](_0x9566('0x3c'))){_0x5a0afe[_0x9566('0x24')]=qs['limit'](_0x120200['query'][_0x9566('0x24')]);_0x5a0afe[_0x9566('0x22')]=qs['offset'](_0x120200[_0x9566('0x37')][_0x9566('0x22')]);}return _0x16ae3c[_0x9566('0x84')](_0x5a0afe);}})[_0x9566('0x27')](function(_0x2d18a3){if(_0x2d18a3){return _0x2d18a3?{'count':_0x13d06a,'rows':_0x2d18a3}:null;}})[_0x9566('0x27')](respondWithResult(_0x269d2f,null))[_0x9566('0x48')](handleError(_0x269d2f,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index c3c8133..4360861 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 _0xced0=['exports','events','../../mysqldb','Team','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x3f383c,_0x3ffca8){var _0x2759d7=function(_0x3452df){while(--_0x3452df){_0x3f383c['push'](_0x3f383c['shift']());}};_0x2759d7(++_0x3ffca8);}(_0xced0,0x177));var _0x0ced=function(_0x3d83ac,_0x1d0135){_0x3d83ac=_0x3d83ac-0x0;var _0x299760=_0xced0[_0x3d83ac];return _0x299760;};'use strict';var EventEmitter=require(_0x0ced('0x0'));var Team=require(_0x0ced('0x1'))['db'][_0x0ced('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x0ced('0x3')](0x0);var events={'afterCreate':_0x0ced('0x4'),'afterUpdate':_0x0ced('0x5'),'afterDestroy':_0x0ced('0x6')};function emitEvent(_0x1cec08){return function(_0x588fa3,_0x50c82a,_0x4e988d){TeamEvents[_0x0ced('0x7')](_0x1cec08+':'+_0x588fa3['id'],_0x588fa3);TeamEvents[_0x0ced('0x7')](_0x1cec08,_0x588fa3);_0x4e988d(null);};}for(var e in events){if(events[_0x0ced('0x8')](e)){var event=events[e];Team[_0x0ced('0x9')](e,emitEvent(event));}}module[_0x0ced('0xa')]=TeamEvents; \ No newline at end of file +var _0x2aa5=['exports','setMaxListeners','save','emit','hasOwnProperty','hook'];(function(_0x3d30f7,_0x224f7a){var _0x1dc95b=function(_0x61c427){while(--_0x61c427){_0x3d30f7['push'](_0x3d30f7['shift']());}};_0x1dc95b(++_0x224f7a);}(_0x2aa5,0x187));var _0x52aa=function(_0x96393a,_0x208343){_0x96393a=_0x96393a-0x0;var _0x576170=_0x2aa5[_0x96393a];return _0x576170;};'use strict';var EventEmitter=require('events');var Team=require('../../mysqldb')['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0x52aa('0x0')](0x0);var events={'afterCreate':_0x52aa('0x1'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2f14c6){return function(_0x52f129,_0x3de7e9,_0x39f331){TeamEvents[_0x52aa('0x2')](_0x2f14c6+':'+_0x52f129['id'],_0x52f129);TeamEvents['emit'](_0x2f14c6,_0x52f129);_0x39f331(null);};}for(var e in events){if(events[_0x52aa('0x3')](e)){var event=events[e];Team[_0x52aa('0x4')](e,emitEvent(event));}}module[_0x52aa('0x5')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 2ac696c..c1b0e23 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 _0x9f4b=['./team.attributes','exports','define','Team','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x288817,_0x33ce34){var _0x4198a6=function(_0x12f48c){while(--_0x12f48c){_0x288817['push'](_0x288817['shift']());}};_0x4198a6(++_0x33ce34);}(_0x9f4b,0xe0));var _0xb9f4=function(_0x224c30,_0x356d4c){_0x224c30=_0x224c30-0x0;var _0x3e3fa1=_0x9f4b[_0x224c30];return _0x3e3fa1;};'use strict';var _=require(_0xb9f4('0x0'));var util=require(_0xb9f4('0x1'));var logger=require(_0xb9f4('0x2'))(_0xb9f4('0x3'));var moment=require(_0xb9f4('0x4'));var BPromise=require(_0xb9f4('0x5'));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(_0xb9f4('0x6'));module[_0xb9f4('0x7')]=function(_0x5f5039,_0x49dd6e){return _0x5f5039[_0xb9f4('0x8')](_0xb9f4('0x9'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc6a8=['exports','define','teams','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./team.attributes'];(function(_0x2c7e69,_0xa76dd9){var _0x3cf5b6=function(_0x288aa8){while(--_0x288aa8){_0x2c7e69['push'](_0x2c7e69['shift']());}};_0x3cf5b6(++_0xa76dd9);}(_0xc6a8,0x1a7));var _0x8c6a=function(_0x391d12,_0x487f82){_0x391d12=_0x391d12-0x0;var _0x9f4b88=_0xc6a8[_0x391d12];return _0x9f4b88;};'use strict';var _=require(_0x8c6a('0x0'));var util=require('util');var logger=require(_0x8c6a('0x1'))('api');var moment=require(_0x8c6a('0x2'));var BPromise=require(_0x8c6a('0x3'));var rp=require(_0x8c6a('0x4'));var fs=require('fs');var path=require(_0x8c6a('0x5'));var rimraf=require(_0x8c6a('0x6'));var config=require(_0x8c6a('0x7'));var attributes=require(_0x8c6a('0x8'));module[_0x8c6a('0x9')]=function(_0x29fbdf,_0x113938){return _0x29fbdf[_0x8c6a('0xa')]('Team',attributes,{'tableName':_0x8c6a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index d788d95..1c3fcd3 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 _0x3934=['redis','localhost','socket.io-emitter','./team.socket','register','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http'];(function(_0x13e60d,_0x26b08e){var _0x536f64=function(_0x1f6df1){while(--_0x1f6df1){_0x13e60d['push'](_0x13e60d['shift']());}};_0x536f64(++_0x26b08e);}(_0x3934,0x116));var _0x4393=function(_0x54a512,_0x4af21f){_0x54a512=_0x54a512-0x0;var _0x4f6d62=_0x3934[_0x54a512];return _0x4f6d62;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4393('0x0'));var BPromise=require(_0x4393('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4393('0x2'));var db=require(_0x4393('0x3'))['db'];var utils=require(_0x4393('0x4'));var logger=require('../../config/logger')(_0x4393('0x5'));var config=require(_0x4393('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4393('0x7')]({'port':0x232a});config[_0x4393('0x8')]=_['defaults'](config[_0x4393('0x8')],{'host':_0x4393('0x9'),'port':0x18eb});var socket=require(_0x4393('0xa'))(new Redis(config[_0x4393('0x8')]));require(_0x4393('0xb'))[_0x4393('0xc')](socket);function respondWithRpcPromise(_0x3e143f,_0x1c2fd6,_0xbda3a5){return new BPromise(function(_0x198f9e,_0x5aca21){return client['request'](_0x3e143f,_0xbda3a5)['then'](function(_0x4c6f7a){logger['info'](_0x4393('0xd'),_0x1c2fd6,_0x4393('0xe'));logger[_0x4393('0xf')](_0x4393('0x10'),_0x1c2fd6,_0x4393('0xe'),JSON['stringify'](_0x4c6f7a));if(_0x4c6f7a[_0x4393('0x11')]){if(_0x4c6f7a['error'][_0x4393('0x12')]===0x1f4){logger[_0x4393('0x11')](_0x4393('0xd'),_0x1c2fd6,_0x4c6f7a[_0x4393('0x11')][_0x4393('0x13')]);return _0x5aca21(_0x4c6f7a[_0x4393('0x11')][_0x4393('0x13')]);}logger[_0x4393('0x11')](_0x4393('0xd'),_0x1c2fd6,_0x4c6f7a[_0x4393('0x11')][_0x4393('0x13')]);return _0x198f9e(_0x4c6f7a[_0x4393('0x11')]['message']);}else{logger[_0x4393('0x14')](_0x4393('0xd'),_0x1c2fd6,'request\x20sent');_0x198f9e(_0x4c6f7a['result']['message']);}})[_0x4393('0x15')](function(_0x1f1cd4){logger[_0x4393('0x11')](_0x4393('0xd'),_0x1c2fd6,_0x1f1cd4);_0x5aca21(_0x1f1cd4);});});} \ No newline at end of file +var _0x334f=['register','request','info','Team,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./team.socket'];(function(_0xb4f46c,_0x5c2b3e){var _0x2ff881=function(_0x35b1d8){while(--_0x35b1d8){_0xb4f46c['push'](_0xb4f46c['shift']());}};_0x2ff881(++_0x5c2b3e);}(_0x334f,0x18a));var _0xf334=function(_0x4f9989,_0x1905e0){_0x4f9989=_0x4f9989-0x0;var _0x371b80=_0x334f[_0x4f9989];return _0x371b80;};'use strict';var _=require('lodash');var util=require(_0xf334('0x0'));var moment=require(_0xf334('0x1'));var BPromise=require(_0xf334('0x2'));var rs=require(_0xf334('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf334('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf334('0x5'))('rpc');var config=require(_0xf334('0x6'));var jayson=require(_0xf334('0x7'));var client=jayson['client'][_0xf334('0x8')]({'port':0x232a});config['redis']=_[_0xf334('0x9')](config[_0xf334('0xa')],{'host':_0xf334('0xb'),'port':0x18eb});var socket=require(_0xf334('0xc'))(new Redis(config['redis']));require(_0xf334('0xd'))[_0xf334('0xe')](socket);function respondWithRpcPromise(_0x44e065,_0x8b6e41,_0x52e5f1){return new BPromise(function(_0x35af69,_0x12b2ca){return client[_0xf334('0xf')](_0x44e065,_0x52e5f1)['then'](function(_0x567b05){logger[_0xf334('0x10')](_0xf334('0x11'),_0x8b6e41,_0xf334('0x12'));logger[_0xf334('0x13')]('Team,\x20%s,\x20%s,\x20%s',_0x8b6e41,_0xf334('0x12'),JSON[_0xf334('0x14')](_0x567b05));if(_0x567b05[_0xf334('0x15')]){if(_0x567b05[_0xf334('0x15')]['code']===0x1f4){logger['error']('Team,\x20%s,\x20%s',_0x8b6e41,_0x567b05[_0xf334('0x15')][_0xf334('0x16')]);return _0x12b2ca(_0x567b05[_0xf334('0x15')][_0xf334('0x16')]);}logger[_0xf334('0x15')]('Team,\x20%s,\x20%s',_0x8b6e41,_0x567b05[_0xf334('0x15')][_0xf334('0x16')]);return _0x35af69(_0x567b05[_0xf334('0x15')][_0xf334('0x16')]);}else{logger[_0xf334('0x10')]('Team,\x20%s,\x20%s',_0x8b6e41,_0xf334('0x12'));_0x35af69(_0x567b05['result'][_0xf334('0x16')]);}})[_0xf334('0x17')](function(_0x1e7021){logger[_0xf334('0x15')](_0xf334('0x11'),_0x8b6e41,_0x1e7021);_0x12b2ca(_0x1e7021);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 0a11f57..0b46a40 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 _0x9c54=['./team.events','removeListener','length','team:'];(function(_0x520945,_0x28b144){var _0x17067a=function(_0x191ae1){while(--_0x191ae1){_0x520945['push'](_0x520945['shift']());}};_0x17067a(++_0x28b144);}(_0x9c54,0x120));var _0x49c5=function(_0x244ab5,_0xb34ac8){_0x244ab5=_0x244ab5-0x0;var _0x572f88=_0x9c54[_0x244ab5];return _0x572f88;};'use strict';var TeamEvents=require(_0x49c5('0x0'));var events=['save','remove','update'];function createListener(_0x5518b1,_0x23917e){return function(_0x414077){_0x23917e['emit'](_0x5518b1,_0x414077);};}function removeListener(_0xb14138,_0x1bc477){return function(){TeamEvents[_0x49c5('0x1')](_0xb14138,_0x1bc477);};}exports['register']=function(_0x5c54de){for(var _0x30798b=0x0,_0x12795e=events[_0x49c5('0x2')];_0x30798b<_0x12795e;_0x30798b++){var _0x1072c5=events[_0x30798b];var _0x2491e6=createListener(_0x49c5('0x3')+_0x1072c5,_0x5c54de);TeamEvents['on'](_0x1072c5,_0x2491e6);}}; \ No newline at end of file +var _0x9063=['register','team:','./team.events','save','remove','update','emit','removeListener'];(function(_0x373902,_0x17a9a3){var _0x39412b=function(_0x145495){while(--_0x145495){_0x373902['push'](_0x373902['shift']());}};_0x39412b(++_0x17a9a3);}(_0x9063,0x1a2));var _0x3906=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0x9063[_0x4dbaad];return _0x226c72;};'use strict';var TeamEvents=require(_0x3906('0x0'));var events=[_0x3906('0x1'),_0x3906('0x2'),_0x3906('0x3')];function createListener(_0x1937cc,_0x203f56){return function(_0x30ced4){_0x203f56[_0x3906('0x4')](_0x1937cc,_0x30ced4);};}function removeListener(_0x5ed74f,_0x3583bd){return function(){TeamEvents[_0x3906('0x5')](_0x5ed74f,_0x3583bd);};}exports[_0x3906('0x6')]=function(_0x17c286){for(var _0x79d5ae=0x0,_0x522b71=events['length'];_0x79d5ae<_0x522b71;_0x79d5ae++){var _0x4a8864=events[_0x79d5ae];var _0x331b42=createListener(_0x3906('0x7')+_0x4a8864,_0x17c286);TeamEvents['on'](_0x4a8864,_0x331b42);}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 7e304db..4e9e12c 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x24e721,_0x4aec0c){var _0x16434e=function(_0x273166){while(--_0x273166){_0x24e721['push'](_0x24e721['shift']());}};_0x16434e(++_0x4aec0c);}(_0x9c44,0x178));var _0x49c4=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x9c44[_0x8c43de];return _0xa6591b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x25e6fa,_0x2d9e51){var _0x10f97c=function(_0x245ee2){while(--_0x245ee2){_0x25e6fa['push'](_0x25e6fa['shift']());}};_0x10f97c(++_0x2d9e51);}(_0x70e0,0x17b));var _0x070e=function(_0x345190,_0x532780){_0x345190=_0x345190-0x0;var _0x34d0c9=_0x70e0[_0x345190];return _0x34d0c9;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 301e4fe..0781fee 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 _0x846c=['INTEGER','sequelize','exports'];(function(_0x18a436,_0x1dbe06){var _0x5c2cf8=function(_0x4712d1){while(--_0x4712d1){_0x18a436['push'](_0x18a436['shift']());}};_0x5c2cf8(++_0x1dbe06);}(_0x846c,0xf1));var _0xc846=function(_0x3a1f89,_0x472660){_0x3a1f89=_0x3a1f89-0x0;var _0x3ee895=_0x846c[_0x3a1f89];return _0x3ee895;};'use strict';var Sequelize=require(_0xc846('0x0'));module[_0xc846('0x1')]={'penalty':{'type':Sequelize[_0xc846('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x34e4=['INTEGER','exports'];(function(_0x4ba509,_0x22ae28){var _0x3c257a=function(_0x3895e2){while(--_0x3895e2){_0x4ba509['push'](_0x4ba509['shift']());}};_0x3c257a(++_0x22ae28);}(_0x34e4,0x87));var _0x434e=function(_0x5ba82a,_0x1bc646){_0x5ba82a=_0x5ba82a-0x0;var _0x4acbcd=_0x34e4[_0x5ba82a];return _0x4acbcd;};'use strict';var Sequelize=require('sequelize');module[_0x434e('0x0')]={'penalty':{'type':Sequelize[_0x434e('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index be55603..0bb8dcd 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 _0xf6fb=['define','TeamVoiceQueue','team_has_voice_queues','../../config/logger','api','bluebird','request-promise','rimraf','./teamVoiceQueue.attributes','exports'];(function(_0x5b142f,_0x10815a){var _0x327bbd=function(_0x56806f){while(--_0x56806f){_0x5b142f['push'](_0x5b142f['shift']());}};_0x327bbd(++_0x10815a);}(_0xf6fb,0x111));var _0xbf6f=function(_0x590851,_0x496bee){_0x590851=_0x590851-0x0;var _0x3b0115=_0xf6fb[_0x590851];return _0x3b0115;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xbf6f('0x0'))(_0xbf6f('0x1'));var moment=require('moment');var BPromise=require(_0xbf6f('0x2'));var rp=require(_0xbf6f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbf6f('0x4'));var config=require('../../config/environment');var attributes=require(_0xbf6f('0x5'));module[_0xbf6f('0x6')]=function(_0x2d8ffb,_0x370983){return _0x2d8ffb[_0xbf6f('0x7')](_0xbf6f('0x8'),attributes,{'tableName':_0xbf6f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4b84=['moment','path','rimraf','../../config/environment','TeamVoiceQueue','lodash','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4b84,0x1cc));var _0x44b8=function(_0x127a60,_0x37f33a){_0x127a60=_0x127a60-0x0;var _0xc1f6a3=_0x4b84[_0x127a60];return _0xc1f6a3;};'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('./teamVoiceQueue.attributes');module['exports']=function(_0x55f25d,_0x996a8b){return _0x55f25d['define'](_0x44b8('0x6'),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 050ee0f..2f98fa3 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 _0xb38a=['code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x20d0e6,_0x579837){var _0x4cc540=function(_0x27af00){while(--_0x27af00){_0x20d0e6['push'](_0x20d0e6['shift']());}};_0x4cc540(++_0x579837);}(_0xb38a,0x77));var _0xab38=function(_0x3230cc,_0xd34a78){_0x3230cc=_0x3230cc-0x0;var _0xd4f510=_0xb38a[_0x3230cc];return _0xd4f510;};'use strict';var _=require(_0xab38('0x0'));var util=require(_0xab38('0x1'));var moment=require(_0xab38('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xab38('0x3'));var db=require(_0xab38('0x4'))['db'];var utils=require(_0xab38('0x5'));var logger=require(_0xab38('0x6'))(_0xab38('0x7'));var config=require('../../config/environment');var jayson=require(_0xab38('0x8'));var client=jayson[_0xab38('0x9')][_0xab38('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5bf893,_0x195526,_0x12940b){return new BPromise(function(_0x34b995,_0x19a782){return client['request'](_0x5bf893,_0x12940b)[_0xab38('0xb')](function(_0x2fe098){logger[_0xab38('0xc')](_0xab38('0xd'),_0x195526,_0xab38('0xe'));logger[_0xab38('0xf')](_0xab38('0x10'),_0x195526,_0xab38('0xe'),JSON[_0xab38('0x11')](_0x2fe098));if(_0x2fe098[_0xab38('0x12')]){if(_0x2fe098[_0xab38('0x12')][_0xab38('0x13')]===0x1f4){logger[_0xab38('0x12')](_0xab38('0xd'),_0x195526,_0x2fe098[_0xab38('0x12')]['message']);return _0x19a782(_0x2fe098[_0xab38('0x12')][_0xab38('0x14')]);}logger[_0xab38('0x12')](_0xab38('0xd'),_0x195526,_0x2fe098['error'][_0xab38('0x14')]);return _0x34b995(_0x2fe098[_0xab38('0x12')][_0xab38('0x14')]);}else{logger[_0xab38('0xc')](_0xab38('0xd'),_0x195526,'request\x20sent');_0x34b995(_0x2fe098[_0xab38('0x15')][_0xab38('0x14')]);}})[_0xab38('0x16')](function(_0x4b646a){logger[_0xab38('0x12')](_0xab38('0xd'),_0x195526,_0x4b646a);_0x19a782(_0x4b646a);});});} \ No newline at end of file +var _0xcc73=['info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request'];(function(_0x568a61,_0x2124f8){var _0x334c3b=function(_0x1afc39){while(--_0x1afc39){_0x568a61['push'](_0x568a61['shift']());}};_0x334c3b(++_0x2124f8);}(_0xcc73,0x1cb));var _0x3cc7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xcc73[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x3cc7('0x0'));var moment=require(_0x3cc7('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3cc7('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x3cc7('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x3cc7('0x4'));var jayson=require(_0x3cc7('0x5'));var client=jayson[_0x3cc7('0x6')][_0x3cc7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x127590,_0x5604df,_0x416c48){return new BPromise(function(_0x37c184,_0x3f2dd7){return client[_0x3cc7('0x8')](_0x127590,_0x416c48)['then'](function(_0x2ff7ba){logger[_0x3cc7('0x9')](_0x3cc7('0xa'),_0x5604df,_0x3cc7('0xb'));logger[_0x3cc7('0xc')](_0x3cc7('0xd'),_0x5604df,_0x3cc7('0xb'),JSON['stringify'](_0x2ff7ba));if(_0x2ff7ba['error']){if(_0x2ff7ba[_0x3cc7('0xe')]['code']===0x1f4){logger[_0x3cc7('0xe')](_0x3cc7('0xa'),_0x5604df,_0x2ff7ba[_0x3cc7('0xe')][_0x3cc7('0xf')]);return _0x3f2dd7(_0x2ff7ba[_0x3cc7('0xe')][_0x3cc7('0xf')]);}logger[_0x3cc7('0xe')](_0x3cc7('0xa'),_0x5604df,_0x2ff7ba[_0x3cc7('0xe')][_0x3cc7('0xf')]);return _0x37c184(_0x2ff7ba[_0x3cc7('0xe')][_0x3cc7('0xf')]);}else{logger[_0x3cc7('0x9')](_0x3cc7('0xa'),_0x5604df,_0x3cc7('0xb'));_0x37c184(_0x2ff7ba[_0x3cc7('0x10')][_0x3cc7('0xf')]);}})[_0x3cc7('0x11')](function(_0x386a31){logger[_0x3cc7('0xe')](_0x3cc7('0xa'),_0x5604df,_0x386a31);_0x3f2dd7(_0x386a31);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 77f61ef..8c1e600 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 _0xa880=['isAuthenticated','index','get','/:id','show','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller'];(function(_0xc6615e,_0x129a49){var _0xff6625=function(_0xe82703){while(--_0xe82703){_0xc6615e['push'](_0xc6615e['shift']());}};_0xff6625(++_0x129a49);}(_0xa880,0x106));var _0x0a88=function(_0x3d5e72,_0x3ab167){_0x3d5e72=_0x3d5e72-0x0;var _0x2230e4=_0xa880[_0x3d5e72];return _0x2230e4;};'use strict';var multer=require(_0x0a88('0x0'));var util=require(_0x0a88('0x1'));var path=require(_0x0a88('0x2'));var timeout=require(_0x0a88('0x3'));var express=require(_0x0a88('0x4'));var router=express[_0x0a88('0x5')]();var fs_extra=require(_0x0a88('0x6'));var auth=require(_0x0a88('0x7'));var interaction=require(_0x0a88('0x8'));var config=require(_0x0a88('0x9'));var controller=require(_0x0a88('0xa'));router['get']('/',auth[_0x0a88('0xb')](),controller[_0x0a88('0xc')]);router[_0x0a88('0xd')](_0x0a88('0xe'),auth['isAuthenticated'](),controller[_0x0a88('0xf')]);router[_0x0a88('0x10')]('/',auth[_0x0a88('0xb')](),controller['create']);router['put']('/:id',auth[_0x0a88('0xb')](),controller[_0x0a88('0x11')]);router[_0x0a88('0x12')](_0x0a88('0xe'),auth[_0x0a88('0xb')](),controller[_0x0a88('0x13')]);module[_0x0a88('0x14')]=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(_0x39c6cd,_0x18abbc){var _0x5d37fa=function(_0x5cea0c){while(--_0x5cea0c){_0x39c6cd['push'](_0x39c6cd['shift']());}};_0x5d37fa(++_0x18abbc);}(_0x7708,0x188));var _0x8770=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0x7708[_0x2cf2e9];return _0xd3670d;};'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('./template.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/template/template.attributes.js b/server/api/template/template.attributes.js index 6e53418..3740315 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 _0xf3b2=['STRING','sequelize','exports'];(function(_0x50242b,_0xa100e3){var _0x5b7825=function(_0x384ccc){while(--_0x384ccc){_0x50242b['push'](_0x50242b['shift']());}};_0x5b7825(++_0xa100e3);}(_0xf3b2,0x1a2));var _0x2f3b=function(_0x45f4e9,_0x5246fd){_0x45f4e9=_0x45f4e9-0x0;var _0x559d8f=_0xf3b2[_0x45f4e9];return _0x559d8f;};'use strict';var Sequelize=require(_0x2f3b('0x0'));module[_0x2f3b('0x1')]={'name':{'type':Sequelize[_0x2f3b('0x2')]},'description':{'type':Sequelize[_0x2f3b('0x2')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xa009=['exports','STRING','TEXT'];(function(_0x24d61f,_0x38cebb){var _0x29ae79=function(_0x5ae6b7){while(--_0x5ae6b7){_0x24d61f['push'](_0x24d61f['shift']());}};_0x29ae79(++_0x38cebb);}(_0xa009,0xcf));var _0x9a00=function(_0x558b83,_0x10fb5e){_0x558b83=_0x558b83-0x0;var _0x23d2fe=_0xa009[_0x558b83];return _0x23d2fe;};'use strict';var Sequelize=require('sequelize');module[_0x9a00('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9a00('0x1')]},'html':{'type':Sequelize[_0x9a00('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 667c8b7..686e216 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 _0x599a=['update','destroy','then','get','Templates','UserProfileResource','end','error','name','send','index','map','Template','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','params','length','find','catch','create','body','user','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x18d949,_0x364c87){var _0x5d4e81=function(_0x328e62){while(--_0x328e62){_0x18d949['push'](_0x18d949['shift']());}};_0x5d4e81(++_0x364c87);}(_0x599a,0xcc));var _0xa599=function(_0x420b24,_0x382adc){_0x420b24=_0x420b24-0x0;var _0x4da552=_0x599a[_0x420b24];return _0x4da552;};'use strict';var emlformat=require(_0xa599('0x0'));var rimraf=require(_0xa599('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa599('0x2'));var rp=require(_0xa599('0x3'));var moment=require('moment');var BPromise=require(_0xa599('0x4'));var Mustache=require('mustache');var util=require(_0xa599('0x5'));var path=require('path');var sox=require(_0xa599('0x6'));var csv=require(_0xa599('0x7'));var ejs=require(_0xa599('0x8'));var fs=require('fs');var fs_extra=require(_0xa599('0x9'));var _=require(_0xa599('0xa'));var squel=require(_0xa599('0xb'));var crypto=require(_0xa599('0xc'));var jsforce=require(_0xa599('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa599('0x7'));var querystring=require(_0xa599('0xe'));var Papa=require(_0xa599('0xf'));var Redis=require(_0xa599('0x10'));var authService=require(_0xa599('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa599('0x12'))(_0xa599('0x13'));var utils=require(_0xa599('0x14'));var config=require(_0xa599('0x15'));var licenseUtil=require(_0xa599('0x16'));var db=require(_0xa599('0x17'))['db'];function respondWithStatusCode(_0x3944b5,_0x42942b){_0x42942b=_0x42942b||0xcc;return function(_0x3cf551){if(_0x3cf551){return _0x3944b5[_0xa599('0x18')](_0x42942b);}return _0x3944b5[_0xa599('0x19')](_0x42942b)['end']();};}function respondWithResult(_0x2e887f,_0x818dcc){_0x818dcc=_0x818dcc||0xc8;return function(_0xc90636){if(_0xc90636){return _0x2e887f[_0xa599('0x19')](_0x818dcc)[_0xa599('0x1a')](_0xc90636);}};}function respondWithFilteredResult(_0xf2e557,_0x409628){return function(_0x4bfb15){if(_0x4bfb15){var _0x31aa55=typeof _0x409628[_0xa599('0x1b')]===_0xa599('0x1c')&&typeof _0x409628[_0xa599('0x1d')]===_0xa599('0x1c');var _0x259c9e=_0x4bfb15[_0xa599('0x1e')];var _0x2e97f4=_0x31aa55?0x0:_0x409628[_0xa599('0x1b')];var _0x4a5b11=_0x31aa55?_0x4bfb15[_0xa599('0x1e')]:_0x409628[_0xa599('0x1b')]+_0x409628[_0xa599('0x1d')];var _0x57883f;if(_0x4a5b11>=_0x259c9e){_0x4a5b11=_0x259c9e;_0x57883f=0xc8;}else{_0x57883f=0xce;}_0xf2e557[_0xa599('0x19')](_0x57883f);return _0xf2e557[_0xa599('0x1f')](_0xa599('0x20'),_0x2e97f4+'-'+_0x4a5b11+'/'+_0x259c9e)[_0xa599('0x1a')](_0x4bfb15);}return null;};}function patchUpdates(_0x4ae661){return function(_0x46b64b){try{jsonpatch[_0xa599('0x21')](_0x46b64b,_0x4ae661,!![]);}catch(_0x3a9523){return BPromise[_0xa599('0x22')](_0x3a9523);}return _0x46b64b[_0xa599('0x23')]();};}function saveUpdates(_0x273262,_0x31e941){return function(_0x2743fb){if(_0x2743fb){return _0x2743fb[_0xa599('0x24')](_0x273262)['then'](function(_0x31881c){return _0x31881c;});}return null;};}function removeEntity(_0x48d204,_0x40b015){return function(_0x426830){if(_0x426830){return _0x426830[_0xa599('0x25')]()[_0xa599('0x26')](function(){var _0x6cd953=_0x426830[_0xa599('0x27')]({'plain':!![]});var _0x514d3a=_0xa599('0x28');return db[_0xa599('0x29')][_0xa599('0x25')]({'where':{'type':_0x514d3a,'resourceId':_0x6cd953['id']}})[_0xa599('0x26')](function(){return _0x426830;});})[_0xa599('0x26')](function(){_0x48d204[_0xa599('0x19')](0xcc)[_0xa599('0x2a')]();});}};}function handleEntityNotFound(_0x45d2df,_0x59582d){return function(_0x2596e8){if(!_0x2596e8){_0x45d2df[_0xa599('0x18')](0x194);}return _0x2596e8;};}function handleError(_0x52069d,_0x18d465){_0x18d465=_0x18d465||0x1f4;return function(_0x447ea6){logger[_0xa599('0x2b')](_0x447ea6['stack']);if(_0x447ea6[_0xa599('0x2c')]){delete _0x447ea6['name'];}_0x52069d[_0xa599('0x19')](_0x18d465)[_0xa599('0x2d')](_0x447ea6);};}exports[_0xa599('0x2e')]=function(_0x5a443e,_0x18de1d){var _0x1b614a={},_0x4ec60f={},_0x20108d={'count':0x0,'rows':[]};var _0x1829a6=_[_0xa599('0x2f')](db[_0xa599('0x30')][_0xa599('0x31')],function(_0x541c2a){return{'name':_0x541c2a[_0xa599('0x32')],'type':_0x541c2a[_0xa599('0x33')]['key']};});_0x4ec60f[_0xa599('0x34')]=_[_0xa599('0x2f')](_0x1829a6,'name');_0x4ec60f['query']=_[_0xa599('0x35')](_0x5a443e[_0xa599('0x36')]);_0x4ec60f[_0xa599('0x37')]=_[_0xa599('0x38')](_0x4ec60f[_0xa599('0x34')],_0x4ec60f[_0xa599('0x36')]);_0x1b614a[_0xa599('0x39')]=_[_0xa599('0x38')](_0x4ec60f[_0xa599('0x34')],qs['fields'](_0x5a443e[_0xa599('0x36')][_0xa599('0x3a')]));_0x1b614a[_0xa599('0x39')]=_0x1b614a[_0xa599('0x39')]['length']?_0x1b614a[_0xa599('0x39')]:_0x4ec60f[_0xa599('0x34')];if(!_0x5a443e[_0xa599('0x36')][_0xa599('0x3b')]('nolimit')){_0x1b614a[_0xa599('0x1d')]=qs[_0xa599('0x1d')](_0x5a443e['query'][_0xa599('0x1d')]);_0x1b614a[_0xa599('0x1b')]=qs[_0xa599('0x1b')](_0x5a443e['query']['offset']);}_0x1b614a[_0xa599('0x3c')]=qs[_0xa599('0x3d')](_0x5a443e[_0xa599('0x36')][_0xa599('0x3d')]);_0x1b614a[_0xa599('0x3e')]=qs[_0xa599('0x37')](_['pick'](_0x5a443e[_0xa599('0x36')],_0x4ec60f['filters']),_0x1829a6);if(_0x5a443e[_0xa599('0x36')][_0xa599('0x3f')]){_0x1b614a[_0xa599('0x3e')]=_[_0xa599('0x40')](_0x1b614a[_0xa599('0x3e')],{'$or':_[_0xa599('0x2f')](_0x1829a6,function(_0x4afe16){if(_0x4afe16[_0xa599('0x33')]!==_0xa599('0x41')){var _0x9b7072={};_0x9b7072[_0x4afe16[_0xa599('0x2c')]]={'$like':'%'+_0x5a443e[_0xa599('0x36')]['filter']+'%'};return _0x9b7072;}})});}_0x1b614a=_[_0xa599('0x40')]({},_0x1b614a,_0x5a443e['options']);var _0x3a208c={'where':_0x1b614a['where']};return db['Template'][_0xa599('0x1e')](_0x3a208c)[_0xa599('0x26')](function(_0xb4704b){_0x20108d[_0xa599('0x1e')]=_0xb4704b;if(_0x5a443e[_0xa599('0x36')][_0xa599('0x42')]){_0x1b614a[_0xa599('0x43')]=[{'all':!![]}];}return db[_0xa599('0x30')][_0xa599('0x44')](_0x1b614a);})[_0xa599('0x26')](function(_0x4831ff){_0x20108d[_0xa599('0x45')]=_0x4831ff;return _0x20108d;})[_0xa599('0x26')](respondWithFilteredResult(_0x18de1d,_0x1b614a))['catch'](handleError(_0x18de1d,null));};exports['show']=function(_0x3ab95d,_0x4e18d9){var _0x447a3b={'raw':!![],'where':{'id':_0x3ab95d[_0xa599('0x46')]['id']}},_0x34b02a={};_0x34b02a[_0xa599('0x34')]=_['keys'](db[_0xa599('0x30')]['rawAttributes']);_0x34b02a[_0xa599('0x36')]=_[_0xa599('0x35')](_0x3ab95d[_0xa599('0x36')]);_0x34b02a[_0xa599('0x37')]=_['intersection'](_0x34b02a[_0xa599('0x34')],_0x34b02a['query']);_0x447a3b[_0xa599('0x39')]=_[_0xa599('0x38')](_0x34b02a[_0xa599('0x34')],qs[_0xa599('0x3a')](_0x3ab95d[_0xa599('0x36')]['fields']));_0x447a3b['attributes']=_0x447a3b[_0xa599('0x39')][_0xa599('0x47')]?_0x447a3b[_0xa599('0x39')]:_0x34b02a[_0xa599('0x34')];if(_0x3ab95d[_0xa599('0x36')]['includeAll']){_0x447a3b[_0xa599('0x43')]=[{'all':!![]}];}_0x447a3b=_[_0xa599('0x40')]({},_0x447a3b,_0x3ab95d['options']);return db[_0xa599('0x30')][_0xa599('0x48')](_0x447a3b)[_0xa599('0x26')](handleEntityNotFound(_0x4e18d9,null))['then'](respondWithResult(_0x4e18d9,null))[_0xa599('0x49')](handleError(_0x4e18d9,null));};exports[_0xa599('0x4a')]=function(_0xd88d03,_0x3f3475){return db['Template'][_0xa599('0x4a')](_0xd88d03[_0xa599('0x4b')],{})['then'](function(_0x4a340a){var _0x2d61ac=_0xd88d03[_0xa599('0x4c')][_0xa599('0x27')]({'plain':!![]});if(!_0x2d61ac)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2d61ac['role']===_0xa599('0x4c')){var _0x2b40cd=_0x4a340a[_0xa599('0x27')]({'plain':!![]});var _0x13d209=_0xa599('0x28');return db[_0xa599('0x4d')][_0xa599('0x48')]({'where':{'name':_0x13d209,'userProfileId':_0x2d61ac[_0xa599('0x4e')]},'raw':!![]})['then'](function(_0x1a5b08){if(_0x1a5b08&&_0x1a5b08[_0xa599('0x4f')]===0x0){return db[_0xa599('0x29')][_0xa599('0x4a')]({'name':_0x2b40cd[_0xa599('0x2c')],'resourceId':_0x2b40cd['id'],'type':_0x1a5b08[_0xa599('0x2c')],'sectionId':_0x1a5b08['id']},{})[_0xa599('0x26')](function(){return _0x4a340a;});}else{return _0x4a340a;}})[_0xa599('0x49')](function(_0x43e459){logger[_0xa599('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x43e459);throw _0x43e459;});}return _0x4a340a;})['then'](respondWithResult(_0x3f3475,0xc9))[_0xa599('0x49')](handleError(_0x3f3475,null));};exports[_0xa599('0x24')]=function(_0x40d323,_0x5d2ca6){if(_0x40d323[_0xa599('0x4b')]['id']){delete _0x40d323[_0xa599('0x4b')]['id'];}return db['Template']['find']({'where':{'id':_0x40d323['params']['id']}})[_0xa599('0x26')](handleEntityNotFound(_0x5d2ca6,null))[_0xa599('0x26')](saveUpdates(_0x40d323[_0xa599('0x4b')],null))[_0xa599('0x26')](respondWithResult(_0x5d2ca6,null))[_0xa599('0x49')](handleError(_0x5d2ca6,null));};exports[_0xa599('0x25')]=function(_0x282630,_0x154fca){return db[_0xa599('0x30')][_0xa599('0x48')]({'where':{'id':_0x282630['params']['id']}})[_0xa599('0x26')](handleEntityNotFound(_0x154fca,null))[_0xa599('0x26')](removeEntity(_0x154fca,null))[_0xa599('0x49')](handleError(_0x154fca,null));}; \ No newline at end of file +var _0x2a21=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','Templates','UserProfileResource','end','error','stack','name','send','Template','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','map','type','options','includeAll','findAll','catch','show','params','keys','merge','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation'];(function(_0x1cbae6,_0x53733c){var _0x59aca1=function(_0x1334e7){while(--_0x1334e7){_0x1cbae6['push'](_0x1cbae6['shift']());}};_0x59aca1(++_0x53733c);}(_0x2a21,0x1aa));var _0x12a2=function(_0x2f2894,_0x4bff5a){_0x2f2894=_0x2f2894-0x0;var _0x217d1d=_0x2a21[_0x2f2894];return _0x217d1d;};'use strict';var emlformat=require(_0x12a2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x12a2('0x1'));var rp=require(_0x12a2('0x2'));var moment=require(_0x12a2('0x3'));var BPromise=require(_0x12a2('0x4'));var Mustache=require(_0x12a2('0x5'));var util=require(_0x12a2('0x6'));var path=require(_0x12a2('0x7'));var sox=require(_0x12a2('0x8'));var csv=require(_0x12a2('0x9'));var ejs=require(_0x12a2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x12a2('0xb'));var squel=require(_0x12a2('0xc'));var crypto=require('crypto');var jsforce=require(_0x12a2('0xd'));var deskjs=require(_0x12a2('0xe'));var toCsv=require(_0x12a2('0x9'));var querystring=require(_0x12a2('0xf'));var Papa=require(_0x12a2('0x10'));var Redis=require(_0x12a2('0x11'));var authService=require(_0x12a2('0x12'));var qs=require(_0x12a2('0x13'));var as=require(_0x12a2('0x14'));var hardwareService=require(_0x12a2('0x15'));var logger=require(_0x12a2('0x16'))(_0x12a2('0x17'));var utils=require(_0x12a2('0x18'));var config=require(_0x12a2('0x19'));var licenseUtil=require(_0x12a2('0x1a'));var db=require(_0x12a2('0x1b'))['db'];function respondWithStatusCode(_0x1b5572,_0x13b04f){_0x13b04f=_0x13b04f||0xcc;return function(_0x1fa273){if(_0x1fa273){return _0x1b5572[_0x12a2('0x1c')](_0x13b04f);}return _0x1b5572[_0x12a2('0x1d')](_0x13b04f)['end']();};}function respondWithResult(_0x2b79f3,_0x4ace8e){_0x4ace8e=_0x4ace8e||0xc8;return function(_0x15cd69){if(_0x15cd69){return _0x2b79f3['status'](_0x4ace8e)[_0x12a2('0x1e')](_0x15cd69);}};}function respondWithFilteredResult(_0x390d04,_0x547f1f){return function(_0x12ecf0){if(_0x12ecf0){var _0x8ba2ed=typeof _0x547f1f[_0x12a2('0x1f')]===_0x12a2('0x20')&&typeof _0x547f1f[_0x12a2('0x21')]===_0x12a2('0x20');var _0x42a249=_0x12ecf0[_0x12a2('0x22')];var _0x47e301=_0x8ba2ed?0x0:_0x547f1f[_0x12a2('0x1f')];var _0xe48aa1=_0x8ba2ed?_0x12ecf0[_0x12a2('0x22')]:_0x547f1f[_0x12a2('0x1f')]+_0x547f1f[_0x12a2('0x21')];var _0x2cba59;if(_0xe48aa1>=_0x42a249){_0xe48aa1=_0x42a249;_0x2cba59=0xc8;}else{_0x2cba59=0xce;}_0x390d04[_0x12a2('0x1d')](_0x2cba59);return _0x390d04[_0x12a2('0x23')]('Content-Range',_0x47e301+'-'+_0xe48aa1+'/'+_0x42a249)['json'](_0x12ecf0);}return null;};}function patchUpdates(_0xde8739){return function(_0x3cd034){try{jsonpatch[_0x12a2('0x24')](_0x3cd034,_0xde8739,!![]);}catch(_0x25a57a){return BPromise[_0x12a2('0x25')](_0x25a57a);}return _0x3cd034[_0x12a2('0x26')]();};}function saveUpdates(_0x3f420d,_0x48e7e2){return function(_0x4127e4){if(_0x4127e4){return _0x4127e4[_0x12a2('0x27')](_0x3f420d)[_0x12a2('0x28')](function(_0x449eb5){return _0x449eb5;});}return null;};}function removeEntity(_0x31aeb2,_0xaf98e7){return function(_0x5bd89f){if(_0x5bd89f){return _0x5bd89f[_0x12a2('0x29')]()[_0x12a2('0x28')](function(){var _0x54cb47=_0x5bd89f['get']({'plain':!![]});var _0x1821e5=_0x12a2('0x2a');return db[_0x12a2('0x2b')][_0x12a2('0x29')]({'where':{'type':_0x1821e5,'resourceId':_0x54cb47['id']}})[_0x12a2('0x28')](function(){return _0x5bd89f;});})[_0x12a2('0x28')](function(){_0x31aeb2[_0x12a2('0x1d')](0xcc)[_0x12a2('0x2c')]();});}};}function handleEntityNotFound(_0x284293,_0x221f27){return function(_0x463225){if(!_0x463225){_0x284293['sendStatus'](0x194);}return _0x463225;};}function handleError(_0x1ffa2d,_0x1c6508){_0x1c6508=_0x1c6508||0x1f4;return function(_0x517198){logger[_0x12a2('0x2d')](_0x517198[_0x12a2('0x2e')]);if(_0x517198[_0x12a2('0x2f')]){delete _0x517198[_0x12a2('0x2f')];}_0x1ffa2d[_0x12a2('0x1d')](_0x1c6508)[_0x12a2('0x30')](_0x517198);};}exports['index']=function(_0x5289a1,_0x28ef42){var _0x59fef0={},_0x12d6a0={},_0x14b106={'count':0x0,'rows':[]};var _0xaeb101=_['map'](db[_0x12a2('0x31')][_0x12a2('0x32')],function(_0x43a88b){return{'name':_0x43a88b[_0x12a2('0x33')],'type':_0x43a88b['type'][_0x12a2('0x34')]};});_0x12d6a0[_0x12a2('0x35')]=_['map'](_0xaeb101,_0x12a2('0x2f'));_0x12d6a0[_0x12a2('0x36')]=_['keys'](_0x5289a1[_0x12a2('0x36')]);_0x12d6a0['filters']=_[_0x12a2('0x37')](_0x12d6a0[_0x12a2('0x35')],_0x12d6a0['query']);_0x59fef0[_0x12a2('0x38')]=_[_0x12a2('0x37')](_0x12d6a0['model'],qs[_0x12a2('0x39')](_0x5289a1['query']['fields']));_0x59fef0['attributes']=_0x59fef0['attributes'][_0x12a2('0x3a')]?_0x59fef0[_0x12a2('0x38')]:_0x12d6a0[_0x12a2('0x35')];if(!_0x5289a1[_0x12a2('0x36')][_0x12a2('0x3b')](_0x12a2('0x3c'))){_0x59fef0[_0x12a2('0x21')]=qs[_0x12a2('0x21')](_0x5289a1[_0x12a2('0x36')]['limit']);_0x59fef0[_0x12a2('0x1f')]=qs[_0x12a2('0x1f')](_0x5289a1['query'][_0x12a2('0x1f')]);}_0x59fef0[_0x12a2('0x3d')]=qs[_0x12a2('0x3e')](_0x5289a1[_0x12a2('0x36')][_0x12a2('0x3e')]);_0x59fef0[_0x12a2('0x3f')]=qs[_0x12a2('0x40')](_[_0x12a2('0x41')](_0x5289a1['query'],_0x12d6a0['filters']),_0xaeb101);if(_0x5289a1['query'][_0x12a2('0x42')]){_0x59fef0[_0x12a2('0x3f')]=_['merge'](_0x59fef0['where'],{'$or':_[_0x12a2('0x43')](_0xaeb101,function(_0x1ec2a0){if(_0x1ec2a0[_0x12a2('0x44')]!=='VIRTUAL'){var _0x345b79={};_0x345b79[_0x1ec2a0['name']]={'$like':'%'+_0x5289a1[_0x12a2('0x36')][_0x12a2('0x42')]+'%'};return _0x345b79;}})});}_0x59fef0=_['merge']({},_0x59fef0,_0x5289a1[_0x12a2('0x45')]);var _0x1cdf9b={'where':_0x59fef0[_0x12a2('0x3f')]};return db[_0x12a2('0x31')][_0x12a2('0x22')](_0x1cdf9b)['then'](function(_0x1e8baa){_0x14b106[_0x12a2('0x22')]=_0x1e8baa;if(_0x5289a1[_0x12a2('0x36')][_0x12a2('0x46')]){_0x59fef0['include']=[{'all':!![]}];}return db['Template'][_0x12a2('0x47')](_0x59fef0);})[_0x12a2('0x28')](function(_0x1db965){_0x14b106['rows']=_0x1db965;return _0x14b106;})[_0x12a2('0x28')](respondWithFilteredResult(_0x28ef42,_0x59fef0))[_0x12a2('0x48')](handleError(_0x28ef42,null));};exports[_0x12a2('0x49')]=function(_0x4e8550,_0x4dd806){var _0x80a6f={'raw':!![],'where':{'id':_0x4e8550[_0x12a2('0x4a')]['id']}},_0x28f116={};_0x28f116[_0x12a2('0x35')]=_['keys'](db[_0x12a2('0x31')][_0x12a2('0x32')]);_0x28f116[_0x12a2('0x36')]=_[_0x12a2('0x4b')](_0x4e8550[_0x12a2('0x36')]);_0x28f116[_0x12a2('0x40')]=_[_0x12a2('0x37')](_0x28f116[_0x12a2('0x35')],_0x28f116[_0x12a2('0x36')]);_0x80a6f[_0x12a2('0x38')]=_['intersection'](_0x28f116['model'],qs['fields'](_0x4e8550[_0x12a2('0x36')]['fields']));_0x80a6f['attributes']=_0x80a6f['attributes']['length']?_0x80a6f['attributes']:_0x28f116[_0x12a2('0x35')];if(_0x4e8550['query'][_0x12a2('0x46')]){_0x80a6f['include']=[{'all':!![]}];}_0x80a6f=_[_0x12a2('0x4c')]({},_0x80a6f,_0x4e8550['options']);return db[_0x12a2('0x31')][_0x12a2('0x4d')](_0x80a6f)['then'](handleEntityNotFound(_0x4dd806,null))[_0x12a2('0x28')](respondWithResult(_0x4dd806,null))['catch'](handleError(_0x4dd806,null));};exports[_0x12a2('0x4e')]=function(_0x3af334,_0x1e0179){return db[_0x12a2('0x31')][_0x12a2('0x4e')](_0x3af334[_0x12a2('0x4f')],{})[_0x12a2('0x28')](function(_0x45ae69){var _0x49f73f=_0x3af334['user'][_0x12a2('0x50')]({'plain':!![]});if(!_0x49f73f)throw new Error(_0x12a2('0x51'));if(_0x49f73f[_0x12a2('0x52')]==='user'){var _0x173db7=_0x45ae69[_0x12a2('0x50')]({'plain':!![]});var _0xe9f869=_0x12a2('0x2a');return db['UserProfileSection']['find']({'where':{'name':_0xe9f869,'userProfileId':_0x49f73f['userProfileId']},'raw':!![]})[_0x12a2('0x28')](function(_0xa7fa8f){if(_0xa7fa8f&&_0xa7fa8f[_0x12a2('0x53')]===0x0){return db[_0x12a2('0x2b')][_0x12a2('0x4e')]({'name':_0x173db7[_0x12a2('0x2f')],'resourceId':_0x173db7['id'],'type':_0xa7fa8f['name'],'sectionId':_0xa7fa8f['id']},{})[_0x12a2('0x28')](function(){return _0x45ae69;});}else{return _0x45ae69;}})[_0x12a2('0x48')](function(_0x5d8b11){logger[_0x12a2('0x2d')](_0x12a2('0x54'),_0x5d8b11);throw _0x5d8b11;});}return _0x45ae69;})[_0x12a2('0x28')](respondWithResult(_0x1e0179,0xc9))['catch'](handleError(_0x1e0179,null));};exports[_0x12a2('0x27')]=function(_0x56cea5,_0xf21d03){if(_0x56cea5[_0x12a2('0x4f')]['id']){delete _0x56cea5[_0x12a2('0x4f')]['id'];}return db[_0x12a2('0x31')][_0x12a2('0x4d')]({'where':{'id':_0x56cea5[_0x12a2('0x4a')]['id']}})['then'](handleEntityNotFound(_0xf21d03,null))[_0x12a2('0x28')](saveUpdates(_0x56cea5[_0x12a2('0x4f')],null))[_0x12a2('0x28')](respondWithResult(_0xf21d03,null))[_0x12a2('0x48')](handleError(_0xf21d03,null));};exports['destroy']=function(_0x9c244,_0x3f5526){return db[_0x12a2('0x31')][_0x12a2('0x4d')]({'where':{'id':_0x9c244['params']['id']}})[_0x12a2('0x28')](handleEntityNotFound(_0x3f5526,null))[_0x12a2('0x28')](removeEntity(_0x3f5526,null))[_0x12a2('0x48')](handleError(_0x3f5526,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index b57092d..80a0348 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 _0xa5c9=['rimraf','../../config/environment','exports','Template','tools_templates','lodash','util','api','moment','request-promise','path'];(function(_0x3046d5,_0x3ad1da){var _0x12ab8c=function(_0x563759){while(--_0x563759){_0x3046d5['push'](_0x3046d5['shift']());}};_0x12ab8c(++_0x3ad1da);}(_0xa5c9,0x1c8));var _0x9a5c=function(_0x4d7116,_0xdb8175){_0x4d7116=_0x4d7116-0x0;var _0x4593dc=_0xa5c9[_0x4d7116];return _0x4593dc;};'use strict';var _=require(_0x9a5c('0x0'));var util=require(_0x9a5c('0x1'));var logger=require('../../config/logger')(_0x9a5c('0x2'));var moment=require(_0x9a5c('0x3'));var BPromise=require('bluebird');var rp=require(_0x9a5c('0x4'));var fs=require('fs');var path=require(_0x9a5c('0x5'));var rimraf=require(_0x9a5c('0x6'));var config=require(_0x9a5c('0x7'));var attributes=require('./template.attributes');module[_0x9a5c('0x8')]=function(_0xc7bdb9,_0x28fcd3){return _0xc7bdb9['define'](_0x9a5c('0x9'),attributes,{'tableName':_0x9a5c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x00cd=['Template','tools_templates','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./template.attributes','exports','define'];(function(_0x2d7a30,_0x159b40){var _0x57882f=function(_0x2654fd){while(--_0x2654fd){_0x2d7a30['push'](_0x2d7a30['shift']());}};_0x57882f(++_0x159b40);}(_0x00cd,0xd2));var _0xd00c=function(_0x5cc8,_0x1faa02){_0x5cc8=_0x5cc8-0x0;var _0x450661=_0x00cd[_0x5cc8];return _0x450661;};'use strict';var _=require(_0xd00c('0x0'));var util=require(_0xd00c('0x1'));var logger=require('../../config/logger')(_0xd00c('0x2'));var moment=require(_0xd00c('0x3'));var BPromise=require('bluebird');var rp=require(_0xd00c('0x4'));var fs=require('fs');var path=require(_0xd00c('0x5'));var rimraf=require(_0xd00c('0x6'));var config=require(_0xd00c('0x7'));var attributes=require(_0xd00c('0x8'));module[_0xd00c('0x9')]=function(_0x1b14d0,_0x311953){return _0x1b14d0[_0xd00c('0xa')](_0xd00c('0xb'),attributes,{'tableName':_0xd00c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 3321772..f2a4e55 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 _0xac4a=['util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','Template,\x20%s,\x20%s','message','result','catch','GetTemplate','Template','findAll','options','raw','where','limit','include','model','attributes','map','lodash'];(function(_0x28b343,_0x2561f8){var _0x14614a=function(_0x3b4b34){while(--_0x3b4b34){_0x28b343['push'](_0x28b343['shift']());}};_0x14614a(++_0x2561f8);}(_0xac4a,0x13f));var _0xaac4=function(_0x414fa7,_0x393530){_0x414fa7=_0x414fa7-0x0;var _0x1abcfb=_0xac4a[_0x414fa7];return _0x1abcfb;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('Template,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('Template,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});}exports[_0xaac4('0x15')]=function(_0x52085a){var _0x220630=this;return new Promise(function(_0x5b6fd6,_0x3ce35a){return db[_0xaac4('0x16')][_0xaac4('0x17')]({'raw':_0x52085a[_0xaac4('0x18')]?_0x52085a[_0xaac4('0x18')][_0xaac4('0x19')]===undefined?!![]:![]:!![],'where':_0x52085a[_0xaac4('0x18')]?_0x52085a[_0xaac4('0x18')][_0xaac4('0x1a')]||null:null,'attributes':_0x52085a['options']?_0x52085a[_0xaac4('0x18')]['attributes']||null:null,'limit':_0x52085a[_0xaac4('0x18')]?_0x52085a[_0xaac4('0x18')][_0xaac4('0x1b')]||null:null,'include':_0x52085a[_0xaac4('0x18')]?_0x52085a[_0xaac4('0x18')][_0xaac4('0x1c')]?_['map'](_0x52085a[_0xaac4('0x18')][_0xaac4('0x1c')],function(_0x174860){return{'model':db[_0x174860[_0xaac4('0x1d')]],'as':_0x174860['as'],'attributes':_0x174860[_0xaac4('0x1e')],'include':_0x174860[_0xaac4('0x1c')]?_[_0xaac4('0x1f')](_0x174860['include'],function(_0x24186b){return{'model':db[_0x24186b['model']],'as':_0x24186b['as'],'attributes':_0x24186b['attributes'],'include':_0x24186b['include']?_['map'](_0x24186b[_0xaac4('0x1c')],function(_0x17d25f){return{'model':db[_0x17d25f[_0xaac4('0x1d')]],'as':_0x17d25f['as'],'attributes':_0x17d25f[_0xaac4('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xaac4('0xa')](function(_0x249a5d){logger[_0xaac4('0xb')](_0xaac4('0x15'),_0x52085a);logger[_0xaac4('0xc')](_0xaac4('0x15'),_0x52085a,JSON['stringify'](_0x249a5d));_0x5b6fd6(_0x249a5d);})[_0xaac4('0x14')](function(_0x16b33c){logger[_0xaac4('0x10')](_0xaac4('0x15'),_0x16b33c[_0xaac4('0x12')],_0x52085a);_0x3ce35a(_0x220630[_0xaac4('0x10')](0x1f4,_0x16b33c['message']));});});}; \ No newline at end of file +var _0x4972=['../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','error','code','Template,\x20%s,\x20%s','message','catch','GetTemplate','Template','options','raw','where','attributes','map','include','model','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x38c6e2,_0x57e639){var _0x405654=function(_0x26b00f){while(--_0x26b00f){_0x38c6e2['push'](_0x38c6e2['shift']());}};_0x405654(++_0x57e639);}(_0x4972,0x130));var _0x2497=function(_0x46fbdc,_0x312e0d){_0x46fbdc=_0x46fbdc-0x0;var _0x5c519b=_0x4972[_0x46fbdc];return _0x5c519b;};'use strict';var _=require('lodash');var util=require(_0x2497('0x0'));var moment=require(_0x2497('0x1'));var BPromise=require('bluebird');var rs=require(_0x2497('0x2'));var fs=require('fs');var Redis=require(_0x2497('0x3'));var db=require(_0x2497('0x4'))['db'];var utils=require(_0x2497('0x5'));var logger=require(_0x2497('0x6'))(_0x2497('0x7'));var config=require(_0x2497('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2497('0x9')][_0x2497('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5124b2,_0x28c5b1,_0x24c0c5){return new BPromise(function(_0x12130d,_0x40db64){return client[_0x2497('0xb')](_0x5124b2,_0x24c0c5)[_0x2497('0xc')](function(_0xb63e8b){logger[_0x2497('0xd')]('Template,\x20%s,\x20%s',_0x28c5b1,_0x2497('0xe'));logger[_0x2497('0xf')](_0x2497('0x10'),_0x28c5b1,'request\x20sent',JSON['stringify'](_0xb63e8b));if(_0xb63e8b[_0x2497('0x11')]){if(_0xb63e8b[_0x2497('0x11')][_0x2497('0x12')]===0x1f4){logger['error'](_0x2497('0x13'),_0x28c5b1,_0xb63e8b[_0x2497('0x11')][_0x2497('0x14')]);return _0x40db64(_0xb63e8b[_0x2497('0x11')][_0x2497('0x14')]);}logger[_0x2497('0x11')](_0x2497('0x13'),_0x28c5b1,_0xb63e8b['error'][_0x2497('0x14')]);return _0x12130d(_0xb63e8b[_0x2497('0x11')][_0x2497('0x14')]);}else{logger[_0x2497('0xd')](_0x2497('0x13'),_0x28c5b1,'request\x20sent');_0x12130d(_0xb63e8b['result'][_0x2497('0x14')]);}})[_0x2497('0x15')](function(_0x3f3a6a){logger[_0x2497('0x11')]('Template,\x20%s,\x20%s',_0x28c5b1,_0x3f3a6a);_0x40db64(_0x3f3a6a);});});}exports[_0x2497('0x16')]=function(_0x4c94ad){var _0x141fba=this;return new Promise(function(_0x59ec89,_0x313200){return db[_0x2497('0x17')]['findAll']({'raw':_0x4c94ad[_0x2497('0x18')]?_0x4c94ad['options'][_0x2497('0x19')]===undefined?!![]:![]:!![],'where':_0x4c94ad[_0x2497('0x18')]?_0x4c94ad[_0x2497('0x18')][_0x2497('0x1a')]||null:null,'attributes':_0x4c94ad[_0x2497('0x18')]?_0x4c94ad[_0x2497('0x18')][_0x2497('0x1b')]||null:null,'limit':_0x4c94ad[_0x2497('0x18')]?_0x4c94ad[_0x2497('0x18')]['limit']||null:null,'include':_0x4c94ad[_0x2497('0x18')]?_0x4c94ad['options']['include']?_[_0x2497('0x1c')](_0x4c94ad['options'][_0x2497('0x1d')],function(_0x58f7ef){return{'model':db[_0x58f7ef[_0x2497('0x1e')]],'as':_0x58f7ef['as'],'attributes':_0x58f7ef[_0x2497('0x1b')],'include':_0x58f7ef[_0x2497('0x1d')]?_[_0x2497('0x1c')](_0x58f7ef[_0x2497('0x1d')],function(_0x557b5f){return{'model':db[_0x557b5f['model']],'as':_0x557b5f['as'],'attributes':_0x557b5f['attributes'],'include':_0x557b5f[_0x2497('0x1d')]?_['map'](_0x557b5f[_0x2497('0x1d')],function(_0xa1a075){return{'model':db[_0xa1a075['model']],'as':_0xa1a075['as'],'attributes':_0xa1a075[_0x2497('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2497('0xc')](function(_0x42b75a){logger[_0x2497('0xd')](_0x2497('0x16'),_0x4c94ad);logger['debug']('GetTemplate',_0x4c94ad,JSON['stringify'](_0x42b75a));_0x59ec89(_0x42b75a);})[_0x2497('0x15')](function(_0x31f00b){logger[_0x2497('0x11')](_0x2497('0x16'),_0x31f00b[_0x2497('0x14')],_0x4c94ad);_0x313200(_0x141fba[_0x2497('0x11')](0x1f4,_0x31f00b[_0x2497('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index bc583d9..3a89cc8 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 _0x4111=['path','express','Router','../../components/auth/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','create','addAllCondition','post','addAnyCondition','addAction','exports','util'];(function(_0x511cc0,_0x32a00a){var _0x3c136e=function(_0x19e836){while(--_0x19e836){_0x511cc0['push'](_0x511cc0['shift']());}};_0x3c136e(++_0x32a00a);}(_0x4111,0x1cb));var _0x1411=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4111[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x1411('0x0'));var path=require(_0x1411('0x1'));var timeout=require('connect-timeout');var express=require(_0x1411('0x2'));var router=express[_0x1411('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1411('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1411('0x5'));var controller=require(_0x1411('0x6'));router[_0x1411('0x7')]('/',auth[_0x1411('0x8')](),controller[_0x1411('0x9')]);router[_0x1411('0x7')](_0x1411('0xa'),auth[_0x1411('0x8')](),controller['show']);router[_0x1411('0x7')](_0x1411('0xb'),auth[_0x1411('0x8')](),controller[_0x1411('0xc')]);router[_0x1411('0x7')](_0x1411('0xd'),auth[_0x1411('0x8')](),controller[_0x1411('0xe')]);router[_0x1411('0x7')](_0x1411('0xf'),auth[_0x1411('0x8')](),controller[_0x1411('0x10')]);router['post']('/',auth[_0x1411('0x8')](),controller[_0x1411('0x11')]);router['post']('/:id/all_conditions',auth['isAuthenticated'](),controller[_0x1411('0x12')]);router[_0x1411('0x13')](_0x1411('0xd'),auth[_0x1411('0x8')](),controller[_0x1411('0x14')]);router[_0x1411('0x13')](_0x1411('0xf'),auth['isAuthenticated'](),controller[_0x1411('0x15')]);router['put'](_0x1411('0xa'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x1411('0x16')]=router; \ No newline at end of file +var _0x4377=['put','update','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','show','/:id/all_conditions','/:id/any_conditions','/:id/actions','post','create','addAllCondition','addAnyCondition'];(function(_0x10399b,_0x3d4cb0){var _0x3e8301=function(_0x1d3996){while(--_0x1d3996){_0x10399b['push'](_0x10399b['shift']());}};_0x3e8301(++_0x3d4cb0);}(_0x4377,0xcb));var _0x7437=function(_0x50475e,_0x3f8b2b){_0x50475e=_0x50475e-0x0;var _0x3996d9=_0x4377[_0x50475e];return _0x3996d9;};'use strict';var multer=require(_0x7437('0x0'));var util=require(_0x7437('0x1'));var path=require(_0x7437('0x2'));var timeout=require(_0x7437('0x3'));var express=require(_0x7437('0x4'));var router=express['Router']();var fs_extra=require(_0x7437('0x5'));var auth=require(_0x7437('0x6'));var interaction=require(_0x7437('0x7'));var config=require(_0x7437('0x8'));var controller=require(_0x7437('0x9'));router[_0x7437('0xa')]('/',auth[_0x7437('0xb')](),controller[_0x7437('0xc')]);router['get'](_0x7437('0xd'),auth[_0x7437('0xb')](),controller[_0x7437('0xe')]);router['get'](_0x7437('0xf'),auth[_0x7437('0xb')](),controller['getAllConditions']);router[_0x7437('0xa')](_0x7437('0x10'),auth[_0x7437('0xb')](),controller['getAnyConditions']);router[_0x7437('0xa')](_0x7437('0x11'),auth[_0x7437('0xb')](),controller['getActions']);router[_0x7437('0x12')]('/',auth[_0x7437('0xb')](),controller[_0x7437('0x13')]);router[_0x7437('0x12')]('/:id/all_conditions',auth[_0x7437('0xb')](),controller[_0x7437('0x14')]);router[_0x7437('0x12')](_0x7437('0x10'),auth['isAuthenticated'](),controller[_0x7437('0x15')]);router[_0x7437('0x12')](_0x7437('0x11'),auth[_0x7437('0xb')](),controller['addAction']);router[_0x7437('0x16')](_0x7437('0xd'),auth['isAuthenticated'](),controller[_0x7437('0x17')]);router['delete'](_0x7437('0xd'),auth[_0x7437('0xb')](),controller[_0x7437('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 6fc7e53..5947713 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 _0x37f0=['BOOLEAN','sequelize','exports','STRING'];(function(_0x567011,_0x273172){var _0x50ac02=function(_0x79f2ba){while(--_0x79f2ba){_0x567011['push'](_0x567011['shift']());}};_0x50ac02(++_0x273172);}(_0x37f0,0x18d));var _0x037f=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x37f0[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0x037f('0x0'));module[_0x037f('0x1')]={'name':{'type':Sequelize[_0x037f('0x2')]},'channel':{'type':Sequelize[_0x037f('0x2')]},'description':{'type':Sequelize[_0x037f('0x2')]},'status':{'type':Sequelize[_0x037f('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x4f84=['STRING'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x4f84,0x92));var _0x44f8=function(_0x22a3f0,_0x513d0e){_0x22a3f0=_0x22a3f0-0x0;var _0x2d8a9c=_0x4f84[_0x22a3f0];return _0x2d8a9c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x44f8('0x0')]},'channel':{'type':Sequelize[_0x44f8('0x0')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index e404798..c5b3b3a 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 _0x5162=['order','sort','where','pick','merge','VIRTUAL','filter','options','rows','catch','show','intersection','include','find','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addAllCondition','TriggerAllId','addAnyCondition','TriggerAnyId','Condition','getAllConditions','getAnyConditions','findOne','addAction','getActions','Action','eml-format','rimraf','fast-json-patch','moment','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','status','undefined','limit','count','offset','set','Content-Range','json','apply','save','update','then','destroy','Triggers','end','sendStatus','error','name','index','map','Trigger','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x2decbe,_0x3e7eee){var _0x4c6def=function(_0x303509){while(--_0x303509){_0x2decbe['push'](_0x2decbe['shift']());}};_0x4c6def(++_0x3e7eee);}(_0x5162,0x1eb));var _0x2516=function(_0x528404,_0x27a5ba){_0x528404=_0x528404-0x0;var _0xe59e6b=_0x5162[_0x528404];return _0xe59e6b;};'use strict';var emlformat=require(_0x2516('0x0'));var rimraf=require(_0x2516('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2516('0x2'));var rp=require('request-promise');var moment=require(_0x2516('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2516('0x4'));var util=require(_0x2516('0x5'));var path=require('path');var sox=require(_0x2516('0x6'));var csv=require(_0x2516('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2516('0x8'));var _=require('lodash');var squel=require(_0x2516('0x9'));var crypto=require(_0x2516('0xa'));var jsforce=require(_0x2516('0xb'));var deskjs=require(_0x2516('0xc'));var toCsv=require('to-csv');var querystring=require(_0x2516('0xd'));var Papa=require(_0x2516('0xe'));var Redis=require(_0x2516('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2516('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2516('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x2516('0x12'));var config=require(_0x2516('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x2516('0x14'))['db'];function respondWithStatusCode(_0x3e0060,_0xda8853){_0xda8853=_0xda8853||0xcc;return function(_0x43c41e){if(_0x43c41e){return _0x3e0060['sendStatus'](_0xda8853);}return _0x3e0060['status'](_0xda8853)['end']();};}function respondWithResult(_0x3463f2,_0x8daa10){_0x8daa10=_0x8daa10||0xc8;return function(_0x36a89c){if(_0x36a89c){return _0x3463f2[_0x2516('0x15')](_0x8daa10)['json'](_0x36a89c);}};}function respondWithFilteredResult(_0x41bb03,_0x1f512a){return function(_0x2ab3ca){if(_0x2ab3ca){var _0x2305a3=typeof _0x1f512a['offset']===_0x2516('0x16')&&typeof _0x1f512a[_0x2516('0x17')]===_0x2516('0x16');var _0x17afb0=_0x2ab3ca[_0x2516('0x18')];var _0x59b3cc=_0x2305a3?0x0:_0x1f512a[_0x2516('0x19')];var _0x1c1359=_0x2305a3?_0x2ab3ca[_0x2516('0x18')]:_0x1f512a['offset']+_0x1f512a[_0x2516('0x17')];var _0x3b5b4b;if(_0x1c1359>=_0x17afb0){_0x1c1359=_0x17afb0;_0x3b5b4b=0xc8;}else{_0x3b5b4b=0xce;}_0x41bb03['status'](_0x3b5b4b);return _0x41bb03[_0x2516('0x1a')](_0x2516('0x1b'),_0x59b3cc+'-'+_0x1c1359+'/'+_0x17afb0)[_0x2516('0x1c')](_0x2ab3ca);}return null;};}function patchUpdates(_0x10af4d){return function(_0x2d3627){try{jsonpatch[_0x2516('0x1d')](_0x2d3627,_0x10af4d,!![]);}catch(_0x4e1a75){return BPromise['reject'](_0x4e1a75);}return _0x2d3627[_0x2516('0x1e')]();};}function saveUpdates(_0x1b2985,_0x51d84a){return function(_0x46d4cd){if(_0x46d4cd){return _0x46d4cd[_0x2516('0x1f')](_0x1b2985)[_0x2516('0x20')](function(_0x199a66){return _0x199a66;});}return null;};}function removeEntity(_0x454851,_0x1c1e82){return function(_0x360cf7){if(_0x360cf7){return _0x360cf7[_0x2516('0x21')]()[_0x2516('0x20')](function(){var _0x3d4861=_0x360cf7['get']({'plain':!![]});var _0x4b52b9=_0x2516('0x22');return db['UserProfileResource'][_0x2516('0x21')]({'where':{'type':_0x4b52b9,'resourceId':_0x3d4861['id']}})['then'](function(){return _0x360cf7;});})[_0x2516('0x20')](function(){_0x454851[_0x2516('0x15')](0xcc)[_0x2516('0x23')]();});}};}function handleEntityNotFound(_0x21aec6,_0x394d67){return function(_0x2fd3d6){if(!_0x2fd3d6){_0x21aec6[_0x2516('0x24')](0x194);}return _0x2fd3d6;};}function handleError(_0x5ba1f3,_0xa4f5d2){_0xa4f5d2=_0xa4f5d2||0x1f4;return function(_0x23823e){logger[_0x2516('0x25')](_0x23823e['stack']);if(_0x23823e[_0x2516('0x26')]){delete _0x23823e[_0x2516('0x26')];}_0x5ba1f3[_0x2516('0x15')](_0xa4f5d2)['send'](_0x23823e);};}exports[_0x2516('0x27')]=function(_0xcdf1f3,_0x2a11d7){var _0x3c35d8={},_0xba7f49={},_0x48f4fb={'count':0x0,'rows':[]};var _0x46b39a=_[_0x2516('0x28')](db[_0x2516('0x29')][_0x2516('0x2a')],function(_0x518f50){return{'name':_0x518f50[_0x2516('0x2b')],'type':_0x518f50[_0x2516('0x2c')][_0x2516('0x2d')]};});_0xba7f49['model']=_[_0x2516('0x28')](_0x46b39a,_0x2516('0x26'));_0xba7f49[_0x2516('0x2e')]=_[_0x2516('0x2f')](_0xcdf1f3[_0x2516('0x2e')]);_0xba7f49[_0x2516('0x30')]=_['intersection'](_0xba7f49[_0x2516('0x31')],_0xba7f49['query']);_0x3c35d8[_0x2516('0x32')]=_['intersection'](_0xba7f49[_0x2516('0x31')],qs[_0x2516('0x33')](_0xcdf1f3[_0x2516('0x2e')][_0x2516('0x33')]));_0x3c35d8[_0x2516('0x32')]=_0x3c35d8['attributes'][_0x2516('0x34')]?_0x3c35d8[_0x2516('0x32')]:_0xba7f49[_0x2516('0x31')];if(!_0xcdf1f3[_0x2516('0x2e')][_0x2516('0x35')](_0x2516('0x36'))){_0x3c35d8[_0x2516('0x17')]=qs[_0x2516('0x17')](_0xcdf1f3['query'][_0x2516('0x17')]);_0x3c35d8[_0x2516('0x19')]=qs[_0x2516('0x19')](_0xcdf1f3[_0x2516('0x2e')][_0x2516('0x19')]);}_0x3c35d8[_0x2516('0x37')]=qs[_0x2516('0x38')](_0xcdf1f3['query'][_0x2516('0x38')]);_0x3c35d8[_0x2516('0x39')]=qs[_0x2516('0x30')](_[_0x2516('0x3a')](_0xcdf1f3['query'],_0xba7f49[_0x2516('0x30')]),_0x46b39a);if(_0xcdf1f3[_0x2516('0x2e')]['filter']){_0x3c35d8['where']=_[_0x2516('0x3b')](_0x3c35d8[_0x2516('0x39')],{'$or':_[_0x2516('0x28')](_0x46b39a,function(_0x22c8c0){if(_0x22c8c0[_0x2516('0x2c')]!==_0x2516('0x3c')){var _0x4f4bc5={};_0x4f4bc5[_0x22c8c0['name']]={'$like':'%'+_0xcdf1f3[_0x2516('0x2e')][_0x2516('0x3d')]+'%'};return _0x4f4bc5;}})});}_0x3c35d8=_['merge']({},_0x3c35d8,_0xcdf1f3[_0x2516('0x3e')]);var _0x2a7b6b={'where':_0x3c35d8[_0x2516('0x39')]};return db[_0x2516('0x29')][_0x2516('0x18')](_0x2a7b6b)[_0x2516('0x20')](function(_0x50dec6){_0x48f4fb[_0x2516('0x18')]=_0x50dec6;if(_0xcdf1f3[_0x2516('0x2e')]['includeAll']){_0x3c35d8['include']=[{'all':!![]}];}return db[_0x2516('0x29')]['findAll'](_0x3c35d8);})[_0x2516('0x20')](function(_0x881f99){_0x48f4fb[_0x2516('0x3f')]=_0x881f99;return _0x48f4fb;})['then'](respondWithFilteredResult(_0x2a11d7,_0x3c35d8))[_0x2516('0x40')](handleError(_0x2a11d7,null));};exports[_0x2516('0x41')]=function(_0x39a949,_0x2644c2){var _0x5e215b={'raw':![],'where':{'id':_0x39a949['params']['id']}},_0xa81531={};_0xa81531['model']=_['keys'](db['Trigger'][_0x2516('0x2a')]);_0xa81531[_0x2516('0x2e')]=_[_0x2516('0x2f')](_0x39a949[_0x2516('0x2e')]);_0xa81531['filters']=_[_0x2516('0x42')](_0xa81531[_0x2516('0x31')],_0xa81531[_0x2516('0x2e')]);_0x5e215b[_0x2516('0x32')]=_[_0x2516('0x42')](_0xa81531[_0x2516('0x31')],qs[_0x2516('0x33')](_0x39a949['query'][_0x2516('0x33')]));_0x5e215b[_0x2516('0x32')]=_0x5e215b['attributes'][_0x2516('0x34')]?_0x5e215b['attributes']:_0xa81531[_0x2516('0x31')];if(_0x39a949[_0x2516('0x2e')]['includeAll']){_0x5e215b[_0x2516('0x43')]=[{'all':!![]}];}_0x5e215b=_[_0x2516('0x3b')]({},_0x5e215b,_0x39a949[_0x2516('0x3e')]);return db['Trigger'][_0x2516('0x44')](_0x5e215b)[_0x2516('0x20')](handleEntityNotFound(_0x2644c2,null))[_0x2516('0x20')](respondWithResult(_0x2644c2,null))[_0x2516('0x40')](handleError(_0x2644c2,null));};exports[_0x2516('0x45')]=function(_0x145e36,_0x534077){return db[_0x2516('0x29')][_0x2516('0x45')](_0x145e36[_0x2516('0x46')],{})[_0x2516('0x20')](function(_0x53eadc){var _0x4df02f=_0x145e36[_0x2516('0x47')][_0x2516('0x48')]({'plain':!![]});if(!_0x4df02f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4df02f[_0x2516('0x49')]==='user'){var _0x1469c5=_0x53eadc[_0x2516('0x48')]({'plain':!![]});var _0x480e51=_0x2516('0x22');return db[_0x2516('0x4a')][_0x2516('0x44')]({'where':{'name':_0x480e51,'userProfileId':_0x4df02f[_0x2516('0x4b')]},'raw':!![]})[_0x2516('0x20')](function(_0x187b99){if(_0x187b99&&_0x187b99[_0x2516('0x4c')]===0x0){return db[_0x2516('0x4d')][_0x2516('0x45')]({'name':_0x1469c5[_0x2516('0x26')],'resourceId':_0x1469c5['id'],'type':_0x187b99[_0x2516('0x26')],'sectionId':_0x187b99['id']},{})['then'](function(){return _0x53eadc;});}else{return _0x53eadc;}})[_0x2516('0x40')](function(_0x2f0716){logger[_0x2516('0x25')](_0x2516('0x4e'),_0x2f0716);throw _0x2f0716;});}return _0x53eadc;})[_0x2516('0x20')](respondWithResult(_0x534077,0xc9))['catch'](handleError(_0x534077,null));};exports['update']=function(_0x227ccb,_0x493451){if(_0x227ccb[_0x2516('0x46')]['id']){delete _0x227ccb['body']['id'];}return db[_0x2516('0x29')][_0x2516('0x44')]({'where':{'id':_0x227ccb[_0x2516('0x4f')]['id']}})['then'](handleEntityNotFound(_0x493451,null))[_0x2516('0x20')](saveUpdates(_0x227ccb[_0x2516('0x46')],null))[_0x2516('0x20')](respondWithResult(_0x493451,null))[_0x2516('0x40')](handleError(_0x493451,null));};exports[_0x2516('0x21')]=function(_0x49fdd3,_0x4bf6d7){return db[_0x2516('0x29')][_0x2516('0x44')]({'where':{'id':_0x49fdd3['params']['id']}})[_0x2516('0x20')](handleEntityNotFound(_0x4bf6d7,null))[_0x2516('0x20')](removeEntity(_0x4bf6d7,null))['catch'](handleError(_0x4bf6d7,null));};exports[_0x2516('0x50')]=function(_0x5a7c6c,_0x3fe8ad,_0x4f09de){if(_0x5a7c6c[_0x2516('0x46')]['id']){delete _0x5a7c6c[_0x2516('0x46')]['id'];}return db[_0x2516('0x29')]['find']({'where':{'id':_0x5a7c6c[_0x2516('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3fe8ad,null))['then'](function(_0x2fe6b8){if(_0x2fe6b8){_0x5a7c6c[_0x2516('0x46')][_0x2516('0x51')]=_0x2fe6b8['id'];return db['Condition'][_0x2516('0x45')](_0x5a7c6c['body']);}})[_0x2516('0x20')](respondWithResult(_0x3fe8ad,null))[_0x2516('0x40')](handleError(_0x3fe8ad,null));};exports[_0x2516('0x52')]=function(_0x27058b,_0x5987cc,_0x15005a){if(_0x27058b[_0x2516('0x46')]['id']){delete _0x27058b['body']['id'];}return db[_0x2516('0x29')]['find']({'where':{'id':_0x27058b[_0x2516('0x4f')]['id']}})[_0x2516('0x20')](handleEntityNotFound(_0x5987cc,null))[_0x2516('0x20')](function(_0x5b5449){if(_0x5b5449){_0x27058b[_0x2516('0x46')][_0x2516('0x53')]=_0x5b5449['id'];return db[_0x2516('0x54')][_0x2516('0x45')](_0x27058b[_0x2516('0x46')]);}})['then'](respondWithResult(_0x5987cc,null))[_0x2516('0x40')](handleError(_0x5987cc,null));};exports[_0x2516('0x55')]=function(_0x64715b,_0xc32369,_0x390ba2){var _0x53eef9={};var _0x88b573={};var _0x510f54;var _0x52bad8;return db[_0x2516('0x29')]['findOne']({'where':{'id':_0x64715b['params']['id']}})[_0x2516('0x20')](handleEntityNotFound(_0xc32369,null))[_0x2516('0x20')](function(_0x356c78){if(_0x356c78){_0x510f54=_0x356c78;_0x88b573[_0x2516('0x31')]=_[_0x2516('0x2f')](db[_0x2516('0x54')][_0x2516('0x2a')]);_0x88b573['query']=_[_0x2516('0x2f')](_0x64715b[_0x2516('0x2e')]);_0x88b573[_0x2516('0x30')]=_['intersection'](_0x88b573[_0x2516('0x31')],_0x88b573['query']);_0x53eef9[_0x2516('0x32')]=_[_0x2516('0x42')](_0x88b573[_0x2516('0x31')],qs[_0x2516('0x33')](_0x64715b[_0x2516('0x2e')]['fields']));_0x53eef9[_0x2516('0x32')]=_0x53eef9[_0x2516('0x32')][_0x2516('0x34')]?_0x53eef9[_0x2516('0x32')]:_0x88b573[_0x2516('0x31')];_0x53eef9['order']=qs['sort'](_0x64715b[_0x2516('0x2e')]['sort']);_0x53eef9['where']=qs['filters'](_['pick'](_0x64715b[_0x2516('0x2e')],_0x88b573[_0x2516('0x30')]));if(_0x64715b[_0x2516('0x2e')][_0x2516('0x3d')]){_0x53eef9['where']=_[_0x2516('0x3b')](_0x53eef9[_0x2516('0x39')],{'$or':_[_0x2516('0x28')](_0x53eef9[_0x2516('0x32')],function(_0xd611f){var _0x23ae4f={};_0x23ae4f[_0xd611f]={'$like':'%'+_0x64715b['query'][_0x2516('0x3d')]+'%'};return _0x23ae4f;})});}_0x53eef9=_[_0x2516('0x3b')]({},_0x53eef9,_0x64715b[_0x2516('0x3e')]);return _0x510f54[_0x2516('0x55')](_0x53eef9);}})[_0x2516('0x20')](function(_0x4abaad){if(_0x4abaad){_0x52bad8=_0x4abaad[_0x2516('0x34')];if(!_0x64715b['query']['hasOwnProperty'](_0x2516('0x36'))){_0x53eef9[_0x2516('0x17')]=qs[_0x2516('0x17')](_0x64715b[_0x2516('0x2e')][_0x2516('0x17')]);_0x53eef9['offset']=qs[_0x2516('0x19')](_0x64715b[_0x2516('0x2e')][_0x2516('0x19')]);}return _0x510f54['getAllConditions'](_0x53eef9);}})[_0x2516('0x20')](function(_0x3a2f94){if(_0x3a2f94){return _0x3a2f94?{'count':_0x52bad8,'rows':_0x3a2f94}:null;}})[_0x2516('0x20')](respondWithResult(_0xc32369,null))['catch'](handleError(_0xc32369,null));};exports[_0x2516('0x56')]=function(_0x205fc8,_0x5946c3,_0x18a602){var _0x287630={};var _0x4cd92c={};var _0x118386;var _0x1e7847;return db[_0x2516('0x29')][_0x2516('0x57')]({'where':{'id':_0x205fc8[_0x2516('0x4f')]['id']}})[_0x2516('0x20')](handleEntityNotFound(_0x5946c3,null))[_0x2516('0x20')](function(_0x353b35){if(_0x353b35){_0x118386=_0x353b35;_0x4cd92c[_0x2516('0x31')]=_[_0x2516('0x2f')](db['Condition'][_0x2516('0x2a')]);_0x4cd92c[_0x2516('0x2e')]=_[_0x2516('0x2f')](_0x205fc8['query']);_0x4cd92c['filters']=_['intersection'](_0x4cd92c['model'],_0x4cd92c[_0x2516('0x2e')]);_0x287630[_0x2516('0x32')]=_[_0x2516('0x42')](_0x4cd92c[_0x2516('0x31')],qs[_0x2516('0x33')](_0x205fc8[_0x2516('0x2e')][_0x2516('0x33')]));_0x287630[_0x2516('0x32')]=_0x287630[_0x2516('0x32')]['length']?_0x287630['attributes']:_0x4cd92c[_0x2516('0x31')];_0x287630['order']=qs[_0x2516('0x38')](_0x205fc8[_0x2516('0x2e')][_0x2516('0x38')]);_0x287630[_0x2516('0x39')]=qs[_0x2516('0x30')](_[_0x2516('0x3a')](_0x205fc8['query'],_0x4cd92c[_0x2516('0x30')]));if(_0x205fc8['query'][_0x2516('0x3d')]){_0x287630[_0x2516('0x39')]=_['merge'](_0x287630[_0x2516('0x39')],{'$or':_[_0x2516('0x28')](_0x287630[_0x2516('0x32')],function(_0x53eddf){var _0x2d62b0={};_0x2d62b0[_0x53eddf]={'$like':'%'+_0x205fc8[_0x2516('0x2e')]['filter']+'%'};return _0x2d62b0;})});}_0x287630=_['merge']({},_0x287630,_0x205fc8[_0x2516('0x3e')]);return _0x118386[_0x2516('0x56')](_0x287630);}})[_0x2516('0x20')](function(_0xa06244){if(_0xa06244){_0x1e7847=_0xa06244[_0x2516('0x34')];if(!_0x205fc8[_0x2516('0x2e')]['hasOwnProperty'](_0x2516('0x36'))){_0x287630['limit']=qs[_0x2516('0x17')](_0x205fc8[_0x2516('0x2e')]['limit']);_0x287630[_0x2516('0x19')]=qs[_0x2516('0x19')](_0x205fc8['query'][_0x2516('0x19')]);}return _0x118386[_0x2516('0x56')](_0x287630);}})[_0x2516('0x20')](function(_0x57467f){if(_0x57467f){return _0x57467f?{'count':_0x1e7847,'rows':_0x57467f}:null;}})[_0x2516('0x20')](respondWithResult(_0x5946c3,null))[_0x2516('0x40')](handleError(_0x5946c3,null));};exports[_0x2516('0x58')]=function(_0x58a2b0,_0x2990cf,_0x382f34){if(_0x58a2b0[_0x2516('0x46')]['id']){delete _0x58a2b0[_0x2516('0x46')]['id'];}return db['Trigger'][_0x2516('0x44')]({'where':{'id':_0x58a2b0[_0x2516('0x4f')]['id']}})[_0x2516('0x20')](handleEntityNotFound(_0x2990cf,null))['then'](function(_0x15233b){if(_0x15233b){_0x58a2b0[_0x2516('0x46')]['TriggerId']=_0x15233b['id'];return db['Action'][_0x2516('0x45')](_0x58a2b0[_0x2516('0x46')]);}})['then'](respondWithResult(_0x2990cf,null))['catch'](handleError(_0x2990cf,null));};exports[_0x2516('0x59')]=function(_0x46788c,_0x50dcf5,_0x38c6d9){var _0xe9eaf7={};var _0x5b870e={};var _0x6dfee;var _0x4d6210;return db[_0x2516('0x29')][_0x2516('0x57')]({'where':{'id':_0x46788c[_0x2516('0x4f')]['id']}})[_0x2516('0x20')](handleEntityNotFound(_0x50dcf5,null))[_0x2516('0x20')](function(_0x2268f2){if(_0x2268f2){_0x6dfee=_0x2268f2;_0x5b870e[_0x2516('0x31')]=_[_0x2516('0x2f')](db[_0x2516('0x5a')][_0x2516('0x2a')]);_0x5b870e[_0x2516('0x2e')]=_['keys'](_0x46788c[_0x2516('0x2e')]);_0x5b870e[_0x2516('0x30')]=_[_0x2516('0x42')](_0x5b870e[_0x2516('0x31')],_0x5b870e[_0x2516('0x2e')]);_0xe9eaf7[_0x2516('0x32')]=_[_0x2516('0x42')](_0x5b870e[_0x2516('0x31')],qs[_0x2516('0x33')](_0x46788c[_0x2516('0x2e')][_0x2516('0x33')]));_0xe9eaf7[_0x2516('0x32')]=_0xe9eaf7['attributes']['length']?_0xe9eaf7[_0x2516('0x32')]:_0x5b870e[_0x2516('0x31')];_0xe9eaf7[_0x2516('0x37')]=qs[_0x2516('0x38')](_0x46788c[_0x2516('0x2e')][_0x2516('0x38')]);_0xe9eaf7['where']=qs['filters'](_[_0x2516('0x3a')](_0x46788c[_0x2516('0x2e')],_0x5b870e[_0x2516('0x30')]));if(_0x46788c[_0x2516('0x2e')]['filter']){_0xe9eaf7[_0x2516('0x39')]=_[_0x2516('0x3b')](_0xe9eaf7[_0x2516('0x39')],{'$or':_[_0x2516('0x28')](_0xe9eaf7[_0x2516('0x32')],function(_0x2afd45){var _0x2100c8={};_0x2100c8[_0x2afd45]={'$like':'%'+_0x46788c[_0x2516('0x2e')][_0x2516('0x3d')]+'%'};return _0x2100c8;})});}_0xe9eaf7=_[_0x2516('0x3b')]({},_0xe9eaf7,_0x46788c['options']);return _0x6dfee['getActions'](_0xe9eaf7);}})[_0x2516('0x20')](function(_0x3645a0){if(_0x3645a0){_0x4d6210=_0x3645a0[_0x2516('0x34')];if(!_0x46788c[_0x2516('0x2e')][_0x2516('0x35')](_0x2516('0x36'))){_0xe9eaf7[_0x2516('0x17')]=qs[_0x2516('0x17')](_0x46788c[_0x2516('0x2e')]['limit']);_0xe9eaf7[_0x2516('0x19')]=qs[_0x2516('0x19')](_0x46788c[_0x2516('0x2e')][_0x2516('0x19')]);}return _0x6dfee['getActions'](_0xe9eaf7);}})[_0x2516('0x20')](function(_0x419785){if(_0x419785){return _0x419785?{'count':_0x4d6210,'rows':_0x419785}:null;}})[_0x2516('0x20')](respondWithResult(_0x50dcf5,null))[_0x2516('0x40')](handleError(_0x50dcf5,null));}; \ No newline at end of file +var _0x77df=['query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','rows','catch','show','params','length','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','addAllCondition','TriggerAllId','addAnyCondition','TriggerAnyId','Condition','getAllConditions','findOne','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','then','get','Triggers','UserProfileResource','sendStatus','name','send','map','Trigger','rawAttributes','type','key','model','keys'];(function(_0xb92dde,_0x4f7e99){var _0xb99445=function(_0x5877f4){while(--_0x5877f4){_0xb92dde['push'](_0xb92dde['shift']());}};_0xb99445(++_0x4f7e99);}(_0x77df,0x1bc));var _0xf77d=function(_0x4defdd,_0xaae55e){_0x4defdd=_0x4defdd-0x0;var _0x95e813=_0x77df[_0x4defdd];return _0x95e813;};'use strict';var emlformat=require(_0xf77d('0x0'));var rimraf=require(_0xf77d('0x1'));var zipdir=require(_0xf77d('0x2'));var jsonpatch=require(_0xf77d('0x3'));var rp=require(_0xf77d('0x4'));var moment=require(_0xf77d('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf77d('0x6'));var path=require(_0xf77d('0x7'));var sox=require(_0xf77d('0x8'));var csv=require(_0xf77d('0x9'));var ejs=require(_0xf77d('0xa'));var fs=require('fs');var fs_extra=require(_0xf77d('0xb'));var _=require(_0xf77d('0xc'));var squel=require(_0xf77d('0xd'));var crypto=require(_0xf77d('0xe'));var jsforce=require(_0xf77d('0xf'));var deskjs=require(_0xf77d('0x10'));var toCsv=require('to-csv');var querystring=require(_0xf77d('0x11'));var Papa=require(_0xf77d('0x12'));var Redis=require('ioredis');var authService=require(_0xf77d('0x13'));var qs=require(_0xf77d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf77d('0x15'));var logger=require(_0xf77d('0x16'))(_0xf77d('0x17'));var utils=require(_0xf77d('0x18'));var config=require(_0xf77d('0x19'));var licenseUtil=require(_0xf77d('0x1a'));var db=require(_0xf77d('0x1b'))['db'];function respondWithStatusCode(_0x524f85,_0x1a4e1c){_0x1a4e1c=_0x1a4e1c||0xcc;return function(_0x8e8e41){if(_0x8e8e41){return _0x524f85['sendStatus'](_0x1a4e1c);}return _0x524f85[_0xf77d('0x1c')](_0x1a4e1c)[_0xf77d('0x1d')]();};}function respondWithResult(_0x7be576,_0x55b353){_0x55b353=_0x55b353||0xc8;return function(_0x4c3204){if(_0x4c3204){return _0x7be576[_0xf77d('0x1c')](_0x55b353)['json'](_0x4c3204);}};}function respondWithFilteredResult(_0x428412,_0x20e550){return function(_0x3d68ed){if(_0x3d68ed){var _0x15d1ae=typeof _0x20e550['offset']===_0xf77d('0x1e')&&typeof _0x20e550[_0xf77d('0x1f')]===_0xf77d('0x1e');var _0x171da5=_0x3d68ed[_0xf77d('0x20')];var _0x3943e0=_0x15d1ae?0x0:_0x20e550[_0xf77d('0x21')];var _0x5aa4ce=_0x15d1ae?_0x3d68ed[_0xf77d('0x20')]:_0x20e550[_0xf77d('0x21')]+_0x20e550[_0xf77d('0x1f')];var _0x409721;if(_0x5aa4ce>=_0x171da5){_0x5aa4ce=_0x171da5;_0x409721=0xc8;}else{_0x409721=0xce;}_0x428412['status'](_0x409721);return _0x428412[_0xf77d('0x22')](_0xf77d('0x23'),_0x3943e0+'-'+_0x5aa4ce+'/'+_0x171da5)[_0xf77d('0x24')](_0x3d68ed);}return null;};}function patchUpdates(_0x6c61a4){return function(_0x3bb2b8){try{jsonpatch[_0xf77d('0x25')](_0x3bb2b8,_0x6c61a4,!![]);}catch(_0x20acb7){return BPromise[_0xf77d('0x26')](_0x20acb7);}return _0x3bb2b8[_0xf77d('0x27')]();};}function saveUpdates(_0xd1b937,_0x20a8df){return function(_0x5a1187){if(_0x5a1187){return _0x5a1187[_0xf77d('0x28')](_0xd1b937)['then'](function(_0x9865b8){return _0x9865b8;});}return null;};}function removeEntity(_0xa47151,_0x1b53f0){return function(_0x19aa48){if(_0x19aa48){return _0x19aa48[_0xf77d('0x29')]()[_0xf77d('0x2a')](function(){var _0x1883c7=_0x19aa48[_0xf77d('0x2b')]({'plain':!![]});var _0x2dc816=_0xf77d('0x2c');return db[_0xf77d('0x2d')][_0xf77d('0x29')]({'where':{'type':_0x2dc816,'resourceId':_0x1883c7['id']}})[_0xf77d('0x2a')](function(){return _0x19aa48;});})[_0xf77d('0x2a')](function(){_0xa47151[_0xf77d('0x1c')](0xcc)[_0xf77d('0x1d')]();});}};}function handleEntityNotFound(_0x109dcb,_0x11794f){return function(_0x309952){if(!_0x309952){_0x109dcb[_0xf77d('0x2e')](0x194);}return _0x309952;};}function handleError(_0x5a674b,_0x3890bf){_0x3890bf=_0x3890bf||0x1f4;return function(_0x1adc6c){logger['error'](_0x1adc6c['stack']);if(_0x1adc6c['name']){delete _0x1adc6c[_0xf77d('0x2f')];}_0x5a674b[_0xf77d('0x1c')](_0x3890bf)[_0xf77d('0x30')](_0x1adc6c);};}exports['index']=function(_0xe5db3a,_0x30fec2){var _0x501d86={},_0x4ae9e7={},_0x40eea9={'count':0x0,'rows':[]};var _0x29c58c=_[_0xf77d('0x31')](db[_0xf77d('0x32')][_0xf77d('0x33')],function(_0x557972){return{'name':_0x557972['fieldName'],'type':_0x557972[_0xf77d('0x34')][_0xf77d('0x35')]};});_0x4ae9e7[_0xf77d('0x36')]=_[_0xf77d('0x31')](_0x29c58c,_0xf77d('0x2f'));_0x4ae9e7['query']=_[_0xf77d('0x37')](_0xe5db3a[_0xf77d('0x38')]);_0x4ae9e7[_0xf77d('0x39')]=_[_0xf77d('0x3a')](_0x4ae9e7[_0xf77d('0x36')],_0x4ae9e7[_0xf77d('0x38')]);_0x501d86[_0xf77d('0x3b')]=_['intersection'](_0x4ae9e7['model'],qs[_0xf77d('0x3c')](_0xe5db3a[_0xf77d('0x38')][_0xf77d('0x3c')]));_0x501d86['attributes']=_0x501d86[_0xf77d('0x3b')]['length']?_0x501d86[_0xf77d('0x3b')]:_0x4ae9e7[_0xf77d('0x36')];if(!_0xe5db3a['query'][_0xf77d('0x3d')](_0xf77d('0x3e'))){_0x501d86[_0xf77d('0x1f')]=qs[_0xf77d('0x1f')](_0xe5db3a[_0xf77d('0x38')][_0xf77d('0x1f')]);_0x501d86[_0xf77d('0x21')]=qs[_0xf77d('0x21')](_0xe5db3a[_0xf77d('0x38')][_0xf77d('0x21')]);}_0x501d86[_0xf77d('0x3f')]=qs['sort'](_0xe5db3a[_0xf77d('0x38')][_0xf77d('0x40')]);_0x501d86[_0xf77d('0x41')]=qs[_0xf77d('0x39')](_[_0xf77d('0x42')](_0xe5db3a[_0xf77d('0x38')],_0x4ae9e7[_0xf77d('0x39')]),_0x29c58c);if(_0xe5db3a['query'][_0xf77d('0x43')]){_0x501d86[_0xf77d('0x41')]=_[_0xf77d('0x44')](_0x501d86[_0xf77d('0x41')],{'$or':_[_0xf77d('0x31')](_0x29c58c,function(_0xe0566d){if(_0xe0566d[_0xf77d('0x34')]!==_0xf77d('0x45')){var _0x1d2bfd={};_0x1d2bfd[_0xe0566d[_0xf77d('0x2f')]]={'$like':'%'+_0xe5db3a[_0xf77d('0x38')][_0xf77d('0x43')]+'%'};return _0x1d2bfd;}})});}_0x501d86=_[_0xf77d('0x44')]({},_0x501d86,_0xe5db3a[_0xf77d('0x46')]);var _0x271db0={'where':_0x501d86[_0xf77d('0x41')]};return db['Trigger'][_0xf77d('0x20')](_0x271db0)[_0xf77d('0x2a')](function(_0x4f86b1){_0x40eea9[_0xf77d('0x20')]=_0x4f86b1;if(_0xe5db3a[_0xf77d('0x38')]['includeAll']){_0x501d86['include']=[{'all':!![]}];}return db[_0xf77d('0x32')]['findAll'](_0x501d86);})[_0xf77d('0x2a')](function(_0x2df49c){_0x40eea9[_0xf77d('0x47')]=_0x2df49c;return _0x40eea9;})[_0xf77d('0x2a')](respondWithFilteredResult(_0x30fec2,_0x501d86))[_0xf77d('0x48')](handleError(_0x30fec2,null));};exports[_0xf77d('0x49')]=function(_0x5a2e0e,_0x5a2842){var _0x3032f3={'raw':![],'where':{'id':_0x5a2e0e[_0xf77d('0x4a')]['id']}},_0x3a56d5={};_0x3a56d5[_0xf77d('0x36')]=_[_0xf77d('0x37')](db[_0xf77d('0x32')]['rawAttributes']);_0x3a56d5[_0xf77d('0x38')]=_[_0xf77d('0x37')](_0x5a2e0e[_0xf77d('0x38')]);_0x3a56d5['filters']=_[_0xf77d('0x3a')](_0x3a56d5['model'],_0x3a56d5[_0xf77d('0x38')]);_0x3032f3[_0xf77d('0x3b')]=_['intersection'](_0x3a56d5[_0xf77d('0x36')],qs[_0xf77d('0x3c')](_0x5a2e0e[_0xf77d('0x38')]['fields']));_0x3032f3['attributes']=_0x3032f3[_0xf77d('0x3b')][_0xf77d('0x4b')]?_0x3032f3[_0xf77d('0x3b')]:_0x3a56d5[_0xf77d('0x36')];if(_0x5a2e0e[_0xf77d('0x38')][_0xf77d('0x4c')]){_0x3032f3[_0xf77d('0x4d')]=[{'all':!![]}];}_0x3032f3=_[_0xf77d('0x44')]({},_0x3032f3,_0x5a2e0e[_0xf77d('0x46')]);return db[_0xf77d('0x32')][_0xf77d('0x4e')](_0x3032f3)[_0xf77d('0x2a')](handleEntityNotFound(_0x5a2842,null))['then'](respondWithResult(_0x5a2842,null))[_0xf77d('0x48')](handleError(_0x5a2842,null));};exports['create']=function(_0x56fe88,_0x2ccd53){return db[_0xf77d('0x32')][_0xf77d('0x4f')](_0x56fe88[_0xf77d('0x50')],{})[_0xf77d('0x2a')](function(_0x5df4f6){var _0x49a691=_0x56fe88[_0xf77d('0x51')][_0xf77d('0x2b')]({'plain':!![]});if(!_0x49a691)throw new Error(_0xf77d('0x52'));if(_0x49a691[_0xf77d('0x53')]===_0xf77d('0x51')){var _0x24cd4=_0x5df4f6[_0xf77d('0x2b')]({'plain':!![]});var _0x13820a=_0xf77d('0x2c');return db[_0xf77d('0x54')][_0xf77d('0x4e')]({'where':{'name':_0x13820a,'userProfileId':_0x49a691[_0xf77d('0x55')]},'raw':!![]})['then'](function(_0x6888e1){if(_0x6888e1&&_0x6888e1[_0xf77d('0x56')]===0x0){return db[_0xf77d('0x2d')][_0xf77d('0x4f')]({'name':_0x24cd4['name'],'resourceId':_0x24cd4['id'],'type':_0x6888e1[_0xf77d('0x2f')],'sectionId':_0x6888e1['id']},{})[_0xf77d('0x2a')](function(){return _0x5df4f6;});}else{return _0x5df4f6;}})[_0xf77d('0x48')](function(_0x548ab7){logger[_0xf77d('0x57')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x548ab7);throw _0x548ab7;});}return _0x5df4f6;})[_0xf77d('0x2a')](respondWithResult(_0x2ccd53,0xc9))[_0xf77d('0x48')](handleError(_0x2ccd53,null));};exports[_0xf77d('0x28')]=function(_0x5f5059,_0x3764d6){if(_0x5f5059['body']['id']){delete _0x5f5059[_0xf77d('0x50')]['id'];}return db[_0xf77d('0x32')][_0xf77d('0x4e')]({'where':{'id':_0x5f5059['params']['id']}})[_0xf77d('0x2a')](handleEntityNotFound(_0x3764d6,null))[_0xf77d('0x2a')](saveUpdates(_0x5f5059[_0xf77d('0x50')],null))['then'](respondWithResult(_0x3764d6,null))[_0xf77d('0x48')](handleError(_0x3764d6,null));};exports['destroy']=function(_0x5e202e,_0x18b515){return db[_0xf77d('0x32')][_0xf77d('0x4e')]({'where':{'id':_0x5e202e[_0xf77d('0x4a')]['id']}})[_0xf77d('0x2a')](handleEntityNotFound(_0x18b515,null))[_0xf77d('0x2a')](removeEntity(_0x18b515,null))[_0xf77d('0x48')](handleError(_0x18b515,null));};exports[_0xf77d('0x58')]=function(_0x1fbdc1,_0x504f00,_0x56a8bb){if(_0x1fbdc1[_0xf77d('0x50')]['id']){delete _0x1fbdc1[_0xf77d('0x50')]['id'];}return db[_0xf77d('0x32')][_0xf77d('0x4e')]({'where':{'id':_0x1fbdc1[_0xf77d('0x4a')]['id']}})[_0xf77d('0x2a')](handleEntityNotFound(_0x504f00,null))[_0xf77d('0x2a')](function(_0x5f57e2){if(_0x5f57e2){_0x1fbdc1[_0xf77d('0x50')][_0xf77d('0x59')]=_0x5f57e2['id'];return db['Condition']['create'](_0x1fbdc1[_0xf77d('0x50')]);}})['then'](respondWithResult(_0x504f00,null))['catch'](handleError(_0x504f00,null));};exports[_0xf77d('0x5a')]=function(_0x3b17e0,_0x503dd8,_0x4df4aa){if(_0x3b17e0['body']['id']){delete _0x3b17e0['body']['id'];}return db[_0xf77d('0x32')][_0xf77d('0x4e')]({'where':{'id':_0x3b17e0[_0xf77d('0x4a')]['id']}})[_0xf77d('0x2a')](handleEntityNotFound(_0x503dd8,null))['then'](function(_0x2c0bb5){if(_0x2c0bb5){_0x3b17e0[_0xf77d('0x50')][_0xf77d('0x5b')]=_0x2c0bb5['id'];return db[_0xf77d('0x5c')][_0xf77d('0x4f')](_0x3b17e0[_0xf77d('0x50')]);}})['then'](respondWithResult(_0x503dd8,null))[_0xf77d('0x48')](handleError(_0x503dd8,null));};exports[_0xf77d('0x5d')]=function(_0x225cd4,_0xa31465,_0x25d4c6){var _0x5d1e66={};var _0x4e2f8a={};var _0x3c49c2;var _0x4f0f45;return db[_0xf77d('0x32')][_0xf77d('0x5e')]({'where':{'id':_0x225cd4[_0xf77d('0x4a')]['id']}})[_0xf77d('0x2a')](handleEntityNotFound(_0xa31465,null))[_0xf77d('0x2a')](function(_0x41365c){if(_0x41365c){_0x3c49c2=_0x41365c;_0x4e2f8a['model']=_[_0xf77d('0x37')](db[_0xf77d('0x5c')]['rawAttributes']);_0x4e2f8a[_0xf77d('0x38')]=_['keys'](_0x225cd4['query']);_0x4e2f8a[_0xf77d('0x39')]=_[_0xf77d('0x3a')](_0x4e2f8a[_0xf77d('0x36')],_0x4e2f8a['query']);_0x5d1e66[_0xf77d('0x3b')]=_[_0xf77d('0x3a')](_0x4e2f8a[_0xf77d('0x36')],qs[_0xf77d('0x3c')](_0x225cd4[_0xf77d('0x38')][_0xf77d('0x3c')]));_0x5d1e66[_0xf77d('0x3b')]=_0x5d1e66[_0xf77d('0x3b')]['length']?_0x5d1e66['attributes']:_0x4e2f8a[_0xf77d('0x36')];_0x5d1e66['order']=qs['sort'](_0x225cd4['query'][_0xf77d('0x40')]);_0x5d1e66[_0xf77d('0x41')]=qs[_0xf77d('0x39')](_[_0xf77d('0x42')](_0x225cd4[_0xf77d('0x38')],_0x4e2f8a[_0xf77d('0x39')]));if(_0x225cd4['query'][_0xf77d('0x43')]){_0x5d1e66[_0xf77d('0x41')]=_[_0xf77d('0x44')](_0x5d1e66['where'],{'$or':_[_0xf77d('0x31')](_0x5d1e66[_0xf77d('0x3b')],function(_0x4fe137){var _0x4c94e8={};_0x4c94e8[_0x4fe137]={'$like':'%'+_0x225cd4[_0xf77d('0x38')][_0xf77d('0x43')]+'%'};return _0x4c94e8;})});}_0x5d1e66=_[_0xf77d('0x44')]({},_0x5d1e66,_0x225cd4['options']);return _0x3c49c2[_0xf77d('0x5d')](_0x5d1e66);}})[_0xf77d('0x2a')](function(_0x45a2c8){if(_0x45a2c8){_0x4f0f45=_0x45a2c8[_0xf77d('0x4b')];if(!_0x225cd4[_0xf77d('0x38')][_0xf77d('0x3d')]('nolimit')){_0x5d1e66[_0xf77d('0x1f')]=qs[_0xf77d('0x1f')](_0x225cd4[_0xf77d('0x38')]['limit']);_0x5d1e66[_0xf77d('0x21')]=qs['offset'](_0x225cd4[_0xf77d('0x38')][_0xf77d('0x21')]);}return _0x3c49c2[_0xf77d('0x5d')](_0x5d1e66);}})['then'](function(_0x1e8a5b){if(_0x1e8a5b){return _0x1e8a5b?{'count':_0x4f0f45,'rows':_0x1e8a5b}:null;}})[_0xf77d('0x2a')](respondWithResult(_0xa31465,null))[_0xf77d('0x48')](handleError(_0xa31465,null));};exports[_0xf77d('0x5f')]=function(_0x500f23,_0x7c5ba4,_0xafbd94){var _0x3ed0d0={};var _0x14ed4c={};var _0xc9fff8;var _0x244f72;return db[_0xf77d('0x32')]['findOne']({'where':{'id':_0x500f23['params']['id']}})[_0xf77d('0x2a')](handleEntityNotFound(_0x7c5ba4,null))[_0xf77d('0x2a')](function(_0xa44394){if(_0xa44394){_0xc9fff8=_0xa44394;_0x14ed4c['model']=_[_0xf77d('0x37')](db[_0xf77d('0x5c')][_0xf77d('0x33')]);_0x14ed4c[_0xf77d('0x38')]=_['keys'](_0x500f23[_0xf77d('0x38')]);_0x14ed4c[_0xf77d('0x39')]=_[_0xf77d('0x3a')](_0x14ed4c['model'],_0x14ed4c['query']);_0x3ed0d0[_0xf77d('0x3b')]=_['intersection'](_0x14ed4c['model'],qs[_0xf77d('0x3c')](_0x500f23['query'][_0xf77d('0x3c')]));_0x3ed0d0[_0xf77d('0x3b')]=_0x3ed0d0['attributes'][_0xf77d('0x4b')]?_0x3ed0d0[_0xf77d('0x3b')]:_0x14ed4c[_0xf77d('0x36')];_0x3ed0d0[_0xf77d('0x3f')]=qs[_0xf77d('0x40')](_0x500f23[_0xf77d('0x38')][_0xf77d('0x40')]);_0x3ed0d0[_0xf77d('0x41')]=qs[_0xf77d('0x39')](_[_0xf77d('0x42')](_0x500f23[_0xf77d('0x38')],_0x14ed4c['filters']));if(_0x500f23[_0xf77d('0x38')]['filter']){_0x3ed0d0[_0xf77d('0x41')]=_[_0xf77d('0x44')](_0x3ed0d0[_0xf77d('0x41')],{'$or':_[_0xf77d('0x31')](_0x3ed0d0[_0xf77d('0x3b')],function(_0x2afe74){var _0x11867d={};_0x11867d[_0x2afe74]={'$like':'%'+_0x500f23['query'][_0xf77d('0x43')]+'%'};return _0x11867d;})});}_0x3ed0d0=_[_0xf77d('0x44')]({},_0x3ed0d0,_0x500f23[_0xf77d('0x46')]);return _0xc9fff8[_0xf77d('0x5f')](_0x3ed0d0);}})['then'](function(_0x3b27fb){if(_0x3b27fb){_0x244f72=_0x3b27fb[_0xf77d('0x4b')];if(!_0x500f23[_0xf77d('0x38')]['hasOwnProperty'](_0xf77d('0x3e'))){_0x3ed0d0[_0xf77d('0x1f')]=qs[_0xf77d('0x1f')](_0x500f23[_0xf77d('0x38')][_0xf77d('0x1f')]);_0x3ed0d0[_0xf77d('0x21')]=qs['offset'](_0x500f23[_0xf77d('0x38')][_0xf77d('0x21')]);}return _0xc9fff8[_0xf77d('0x5f')](_0x3ed0d0);}})['then'](function(_0x1b6c90){if(_0x1b6c90){return _0x1b6c90?{'count':_0x244f72,'rows':_0x1b6c90}:null;}})['then'](respondWithResult(_0x7c5ba4,null))['catch'](handleError(_0x7c5ba4,null));};exports[_0xf77d('0x60')]=function(_0x14e104,_0x5d0512,_0x4275de){if(_0x14e104['body']['id']){delete _0x14e104['body']['id'];}return db[_0xf77d('0x32')][_0xf77d('0x4e')]({'where':{'id':_0x14e104[_0xf77d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5d0512,null))[_0xf77d('0x2a')](function(_0x32ba33){if(_0x32ba33){_0x14e104[_0xf77d('0x50')][_0xf77d('0x61')]=_0x32ba33['id'];return db['Action'][_0xf77d('0x4f')](_0x14e104[_0xf77d('0x50')]);}})[_0xf77d('0x2a')](respondWithResult(_0x5d0512,null))['catch'](handleError(_0x5d0512,null));};exports['getActions']=function(_0x236f7f,_0x3235f3,_0x158823){var _0x1e631d={};var _0x260957={};var _0x5561f1;var _0x591461;return db[_0xf77d('0x32')][_0xf77d('0x5e')]({'where':{'id':_0x236f7f[_0xf77d('0x4a')]['id']}})[_0xf77d('0x2a')](handleEntityNotFound(_0x3235f3,null))[_0xf77d('0x2a')](function(_0x9a6183){if(_0x9a6183){_0x5561f1=_0x9a6183;_0x260957[_0xf77d('0x36')]=_['keys'](db[_0xf77d('0x62')][_0xf77d('0x33')]);_0x260957['query']=_['keys'](_0x236f7f[_0xf77d('0x38')]);_0x260957[_0xf77d('0x39')]=_['intersection'](_0x260957['model'],_0x260957[_0xf77d('0x38')]);_0x1e631d[_0xf77d('0x3b')]=_[_0xf77d('0x3a')](_0x260957[_0xf77d('0x36')],qs['fields'](_0x236f7f[_0xf77d('0x38')][_0xf77d('0x3c')]));_0x1e631d[_0xf77d('0x3b')]=_0x1e631d[_0xf77d('0x3b')]['length']?_0x1e631d[_0xf77d('0x3b')]:_0x260957[_0xf77d('0x36')];_0x1e631d[_0xf77d('0x3f')]=qs[_0xf77d('0x40')](_0x236f7f[_0xf77d('0x38')][_0xf77d('0x40')]);_0x1e631d['where']=qs[_0xf77d('0x39')](_[_0xf77d('0x42')](_0x236f7f[_0xf77d('0x38')],_0x260957[_0xf77d('0x39')]));if(_0x236f7f[_0xf77d('0x38')][_0xf77d('0x43')]){_0x1e631d['where']=_[_0xf77d('0x44')](_0x1e631d[_0xf77d('0x41')],{'$or':_['map'](_0x1e631d[_0xf77d('0x3b')],function(_0x15e993){var _0x5a227b={};_0x5a227b[_0x15e993]={'$like':'%'+_0x236f7f[_0xf77d('0x38')][_0xf77d('0x43')]+'%'};return _0x5a227b;})});}_0x1e631d=_[_0xf77d('0x44')]({},_0x1e631d,_0x236f7f['options']);return _0x5561f1[_0xf77d('0x63')](_0x1e631d);}})[_0xf77d('0x2a')](function(_0x2a05d3){if(_0x2a05d3){_0x591461=_0x2a05d3[_0xf77d('0x4b')];if(!_0x236f7f['query'][_0xf77d('0x3d')](_0xf77d('0x3e'))){_0x1e631d['limit']=qs['limit'](_0x236f7f[_0xf77d('0x38')][_0xf77d('0x1f')]);_0x1e631d['offset']=qs['offset'](_0x236f7f['query'][_0xf77d('0x21')]);}return _0x5561f1[_0xf77d('0x63')](_0x1e631d);}})[_0xf77d('0x2a')](function(_0x5daacc){if(_0x5daacc){return _0x5daacc?{'count':_0x591461,'rows':_0x5daacc}:null;}})[_0xf77d('0x2a')](respondWithResult(_0x3235f3,null))[_0xf77d('0x48')](handleError(_0x3235f3,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 3176633..09eaea2 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 _0x14ee=['tools_triggers','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes','define','Trigger'];(function(_0x3c97e3,_0x49eed8){var _0x2acdab=function(_0x431541){while(--_0x431541){_0x3c97e3['push'](_0x3c97e3['shift']());}};_0x2acdab(++_0x49eed8);}(_0x14ee,0x115));var _0xe14e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x14ee[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe14e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe14e('0x1'));var moment=require(_0xe14e('0x2'));var BPromise=require(_0xe14e('0x3'));var rp=require(_0xe14e('0x4'));var fs=require('fs');var path=require(_0xe14e('0x5'));var rimraf=require(_0xe14e('0x6'));var config=require(_0xe14e('0x7'));var attributes=require(_0xe14e('0x8'));module['exports']=function(_0x55d396,_0x4c78d1){return _0x55d396[_0xe14e('0x9')](_0xe14e('0xa'),attributes,{'tableName':_0xe14e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9224=['define','Trigger','tools_triggers','util','../../config/logger','api','moment','bluebird','request-promise','./trigger.attributes'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0x9224,0xa3));var _0x4922=function(_0x4d665e,_0x38cefa){_0x4d665e=_0x4d665e-0x0;var _0x5bdb86=_0x9224[_0x4d665e];return _0x5bdb86;};'use strict';var _=require('lodash');var util=require(_0x4922('0x0'));var logger=require(_0x4922('0x1'))(_0x4922('0x2'));var moment=require(_0x4922('0x3'));var BPromise=require(_0x4922('0x4'));var rp=require(_0x4922('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4922('0x6'));module['exports']=function(_0x12601a,_0x1b7fc7){return _0x12601a[_0x4922('0x7')](_0x4922('0x8'),attributes,{'tableName':_0x4922('0x9'),'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 bbfb162..fc27826 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 _0x90fe=['limit','include','model','attributes','map','ShowTrigger','find','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetTrigger','Trigger','findAll','options','raw','where'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x90fe,0xdf));var _0xe90f=function(_0x3b5c00,_0x36017d){_0x3b5c00=_0x3b5c00-0x0;var _0x2b248c=_0x90fe[_0x3b5c00];return _0x2b248c;};'use strict';var _=require(_0xe90f('0x0'));var util=require('util');var moment=require(_0xe90f('0x1'));var BPromise=require(_0xe90f('0x2'));var rs=require(_0xe90f('0x3'));var fs=require('fs');var Redis=require(_0xe90f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe90f('0x5'));var logger=require(_0xe90f('0x6'))('rpc');var config=require(_0xe90f('0x7'));var jayson=require(_0xe90f('0x8'));var client=jayson[_0xe90f('0x9')][_0xe90f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e7fdd,_0x1653eb,_0x4f6cf0){return new BPromise(function(_0x501eb2,_0xba907b){return client[_0xe90f('0xb')](_0x1e7fdd,_0x4f6cf0)[_0xe90f('0xc')](function(_0x184b53){logger[_0xe90f('0xd')](_0xe90f('0xe'),_0x1653eb,_0xe90f('0xf'));logger[_0xe90f('0x10')](_0xe90f('0x11'),_0x1653eb,'request\x20sent',JSON[_0xe90f('0x12')](_0x184b53));if(_0x184b53[_0xe90f('0x13')]){if(_0x184b53[_0xe90f('0x13')]['code']===0x1f4){logger[_0xe90f('0x13')](_0xe90f('0xe'),_0x1653eb,_0x184b53[_0xe90f('0x13')][_0xe90f('0x14')]);return _0xba907b(_0x184b53[_0xe90f('0x13')]['message']);}logger[_0xe90f('0x13')](_0xe90f('0xe'),_0x1653eb,_0x184b53[_0xe90f('0x13')][_0xe90f('0x14')]);return _0x501eb2(_0x184b53[_0xe90f('0x13')][_0xe90f('0x14')]);}else{logger['info'](_0xe90f('0xe'),_0x1653eb,_0xe90f('0xf'));_0x501eb2(_0x184b53[_0xe90f('0x15')]['message']);}})[_0xe90f('0x16')](function(_0x36f53c){logger[_0xe90f('0x13')](_0xe90f('0xe'),_0x1653eb,_0x36f53c);_0xba907b(_0x36f53c);});});}exports[_0xe90f('0x17')]=function(_0x17c872){var _0x31b851=this;return new Promise(function(_0x4e04f0,_0x11d487){return db[_0xe90f('0x18')][_0xe90f('0x19')]({'raw':_0x17c872[_0xe90f('0x1a')]?_0x17c872[_0xe90f('0x1a')][_0xe90f('0x1b')]===undefined?!![]:![]:!![],'where':_0x17c872[_0xe90f('0x1a')]?_0x17c872[_0xe90f('0x1a')][_0xe90f('0x1c')]||null:null,'attributes':_0x17c872[_0xe90f('0x1a')]?_0x17c872['options']['attributes']||null:null,'limit':_0x17c872[_0xe90f('0x1a')]?_0x17c872[_0xe90f('0x1a')][_0xe90f('0x1d')]||null:null,'include':_0x17c872[_0xe90f('0x1a')]?_0x17c872[_0xe90f('0x1a')][_0xe90f('0x1e')]?_['map'](_0x17c872[_0xe90f('0x1a')][_0xe90f('0x1e')],function(_0x1345e7){return{'model':db[_0x1345e7[_0xe90f('0x1f')]],'as':_0x1345e7['as'],'attributes':_0x1345e7[_0xe90f('0x20')],'include':_0x1345e7[_0xe90f('0x1e')]?_[_0xe90f('0x21')](_0x1345e7['include'],function(_0x136123){return{'model':db[_0x136123['model']],'as':_0x136123['as'],'attributes':_0x136123['attributes'],'include':_0x136123['include']?_[_0xe90f('0x21')](_0x136123[_0xe90f('0x1e')],function(_0x299e40){return{'model':db[_0x299e40[_0xe90f('0x1f')]],'as':_0x299e40['as'],'attributes':_0x299e40[_0xe90f('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe90f('0xc')](function(_0xae8550){logger['info'](_0xe90f('0x17'),_0x17c872);logger[_0xe90f('0x10')](_0xe90f('0x17'),_0x17c872,JSON[_0xe90f('0x12')](_0xae8550));_0x4e04f0(_0xae8550);})[_0xe90f('0x16')](function(_0x2d0616){logger[_0xe90f('0x13')](_0xe90f('0x17'),_0x2d0616['message'],_0x17c872);_0x11d487(_0x31b851[_0xe90f('0x13')](0x1f4,_0x2d0616[_0xe90f('0x14')]));});});};exports[_0xe90f('0x22')]=function(_0x5cb057){var _0x1f72f4=this;return new Promise(function(_0x1b926b,_0x315c4f){return db[_0xe90f('0x18')][_0xe90f('0x23')]({'raw':_0x5cb057['options']?_0x5cb057['options'][_0xe90f('0x1b')]===undefined?!![]:![]:!![],'where':_0x5cb057['options']?_0x5cb057[_0xe90f('0x1a')]['where']||null:null,'attributes':_0x5cb057[_0xe90f('0x1a')]?_0x5cb057[_0xe90f('0x1a')]['attributes']||null:null,'include':_0x5cb057[_0xe90f('0x1a')]?_0x5cb057[_0xe90f('0x1a')][_0xe90f('0x1e')]?_[_0xe90f('0x21')](_0x5cb057['options'][_0xe90f('0x1e')],function(_0x142845){return{'model':db[_0x142845['model']],'as':_0x142845['as'],'attributes':_0x142845[_0xe90f('0x20')],'include':_0x142845[_0xe90f('0x1e')]?_[_0xe90f('0x21')](_0x142845['include'],function(_0x27a79c){return{'model':db[_0x27a79c['model']],'as':_0x27a79c['as'],'attributes':_0x27a79c[_0xe90f('0x20')],'include':_0x27a79c[_0xe90f('0x1e')]?_[_0xe90f('0x21')](_0x27a79c[_0xe90f('0x1e')],function(_0x68712a){return{'model':db[_0x68712a[_0xe90f('0x1f')]],'as':_0x68712a['as'],'attributes':_0x68712a[_0xe90f('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe90f('0xc')](function(_0x5c1451){logger[_0xe90f('0xd')]('ShowTrigger',_0x5cb057);logger[_0xe90f('0x10')](_0xe90f('0x22'),_0x5cb057,JSON['stringify'](_0x5c1451));_0x1b926b(_0x5c1451);})[_0xe90f('0x16')](function(_0x43cfe1){logger[_0xe90f('0x13')](_0xe90f('0x22'),_0x43cfe1[_0xe90f('0x14')],_0x5cb057);_0x315c4f(_0x1f72f4['error'](0x1f4,_0x43cfe1[_0xe90f('0x14')]));});});}; \ No newline at end of file +var _0x73aa=['map','model','attributes','info','GetTrigger','find','ShowTrigger','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','Trigger,\x20%s,\x20%s','debug','Trigger,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','Trigger','raw','options','where','limit','include'];(function(_0x32ee61,_0x3f1b2d){var _0x226c2f=function(_0x46ac3a){while(--_0x46ac3a){_0x32ee61['push'](_0x32ee61['shift']());}};_0x226c2f(++_0x3f1b2d);}(_0x73aa,0x103));var _0xa73a=function(_0x3b150c,_0x2f93f8){_0x3b150c=_0x3b150c-0x0;var _0x5cd414=_0x73aa[_0x3b150c];return _0x5cd414;};'use strict';var _=require(_0xa73a('0x0'));var util=require(_0xa73a('0x1'));var moment=require(_0xa73a('0x2'));var BPromise=require(_0xa73a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa73a('0x4'));var db=require(_0xa73a('0x5'))['db'];var utils=require(_0xa73a('0x6'));var logger=require(_0xa73a('0x7'))(_0xa73a('0x8'));var config=require(_0xa73a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa73a('0xa')][_0xa73a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d192d,_0x488336,_0x500ce0){return new BPromise(function(_0x56e09e,_0x117540){return client['request'](_0x5d192d,_0x500ce0)[_0xa73a('0xc')](function(_0x561982){logger['info'](_0xa73a('0xd'),_0x488336,'request\x20sent');logger[_0xa73a('0xe')](_0xa73a('0xf'),_0x488336,_0xa73a('0x10'),JSON[_0xa73a('0x11')](_0x561982));if(_0x561982['error']){if(_0x561982['error'][_0xa73a('0x12')]===0x1f4){logger['error']('Trigger,\x20%s,\x20%s',_0x488336,_0x561982[_0xa73a('0x13')][_0xa73a('0x14')]);return _0x117540(_0x561982['error']['message']);}logger['error'](_0xa73a('0xd'),_0x488336,_0x561982[_0xa73a('0x13')][_0xa73a('0x14')]);return _0x56e09e(_0x561982[_0xa73a('0x13')][_0xa73a('0x14')]);}else{logger['info'](_0xa73a('0xd'),_0x488336,'request\x20sent');_0x56e09e(_0x561982[_0xa73a('0x15')]['message']);}})[_0xa73a('0x16')](function(_0x244c8f){logger[_0xa73a('0x13')](_0xa73a('0xd'),_0x488336,_0x244c8f);_0x117540(_0x244c8f);});});}exports['GetTrigger']=function(_0x2f1e4f){var _0x334e7b=this;return new Promise(function(_0x5bf7e1,_0x1286e2){return db[_0xa73a('0x17')]['findAll']({'raw':_0x2f1e4f['options']?_0x2f1e4f['options'][_0xa73a('0x18')]===undefined?!![]:![]:!![],'where':_0x2f1e4f[_0xa73a('0x19')]?_0x2f1e4f[_0xa73a('0x19')][_0xa73a('0x1a')]||null:null,'attributes':_0x2f1e4f[_0xa73a('0x19')]?_0x2f1e4f[_0xa73a('0x19')]['attributes']||null:null,'limit':_0x2f1e4f['options']?_0x2f1e4f[_0xa73a('0x19')][_0xa73a('0x1b')]||null:null,'include':_0x2f1e4f['options']?_0x2f1e4f[_0xa73a('0x19')][_0xa73a('0x1c')]?_[_0xa73a('0x1d')](_0x2f1e4f[_0xa73a('0x19')][_0xa73a('0x1c')],function(_0x218e15){return{'model':db[_0x218e15[_0xa73a('0x1e')]],'as':_0x218e15['as'],'attributes':_0x218e15[_0xa73a('0x1f')],'include':_0x218e15[_0xa73a('0x1c')]?_['map'](_0x218e15[_0xa73a('0x1c')],function(_0x270ec1){return{'model':db[_0x270ec1[_0xa73a('0x1e')]],'as':_0x270ec1['as'],'attributes':_0x270ec1['attributes'],'include':_0x270ec1[_0xa73a('0x1c')]?_[_0xa73a('0x1d')](_0x270ec1[_0xa73a('0x1c')],function(_0x34ca7d){return{'model':db[_0x34ca7d[_0xa73a('0x1e')]],'as':_0x34ca7d['as'],'attributes':_0x34ca7d['attributes']};}):[]};}):[]};}):[]:[]})[_0xa73a('0xc')](function(_0x37bc95){logger[_0xa73a('0x20')]('GetTrigger',_0x2f1e4f);logger[_0xa73a('0xe')](_0xa73a('0x21'),_0x2f1e4f,JSON[_0xa73a('0x11')](_0x37bc95));_0x5bf7e1(_0x37bc95);})[_0xa73a('0x16')](function(_0x1332f2){logger['error'](_0xa73a('0x21'),_0x1332f2[_0xa73a('0x14')],_0x2f1e4f);_0x1286e2(_0x334e7b[_0xa73a('0x13')](0x1f4,_0x1332f2[_0xa73a('0x14')]));});});};exports['ShowTrigger']=function(_0xd148e5){var _0x1c0401=this;return new Promise(function(_0xc9a2a3,_0x2e85fd){return db[_0xa73a('0x17')][_0xa73a('0x22')]({'raw':_0xd148e5[_0xa73a('0x19')]?_0xd148e5['options'][_0xa73a('0x18')]===undefined?!![]:![]:!![],'where':_0xd148e5[_0xa73a('0x19')]?_0xd148e5[_0xa73a('0x19')]['where']||null:null,'attributes':_0xd148e5[_0xa73a('0x19')]?_0xd148e5[_0xa73a('0x19')]['attributes']||null:null,'include':_0xd148e5[_0xa73a('0x19')]?_0xd148e5[_0xa73a('0x19')][_0xa73a('0x1c')]?_['map'](_0xd148e5[_0xa73a('0x19')][_0xa73a('0x1c')],function(_0x13c254){return{'model':db[_0x13c254[_0xa73a('0x1e')]],'as':_0x13c254['as'],'attributes':_0x13c254[_0xa73a('0x1f')],'include':_0x13c254['include']?_[_0xa73a('0x1d')](_0x13c254['include'],function(_0x168876){return{'model':db[_0x168876[_0xa73a('0x1e')]],'as':_0x168876['as'],'attributes':_0x168876['attributes'],'include':_0x168876['include']?_[_0xa73a('0x1d')](_0x168876[_0xa73a('0x1c')],function(_0x589331){return{'model':db[_0x589331[_0xa73a('0x1e')]],'as':_0x589331['as'],'attributes':_0x589331['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x243ccf){logger['info']('ShowTrigger',_0xd148e5);logger[_0xa73a('0xe')](_0xa73a('0x23'),_0xd148e5,JSON[_0xa73a('0x11')](_0x243ccf));_0xc9a2a3(_0x243ccf);})[_0xa73a('0x16')](function(_0x38867f){logger[_0xa73a('0x13')](_0xa73a('0x23'),_0x38867f[_0xa73a('0x14')],_0xd148e5);_0x2e85fd(_0x1c0401[_0xa73a('0x13')](0x1f4,_0x38867f[_0xa73a('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index b3e060f..07cbeeb 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 _0x2426=['get','isAuthenticated','/:id','show','post','clone','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller'];(function(_0xc805f9,_0x1d9c1a){var _0x18392b=function(_0xcb74a8){while(--_0xcb74a8){_0xc805f9['push'](_0xc805f9['shift']());}};_0x18392b(++_0x1d9c1a);}(_0x2426,0x199));var _0x6242=function(_0x2e58c3,_0x25bf31){_0x2e58c3=_0x2e58c3-0x0;var _0x3a4ede=_0x2426[_0x2e58c3];return _0x3a4ede;};'use strict';var multer=require('multer');var util=require(_0x6242('0x0'));var path=require(_0x6242('0x1'));var timeout=require(_0x6242('0x2'));var express=require(_0x6242('0x3'));var router=express[_0x6242('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6242('0x5'));var interaction=require(_0x6242('0x6'));var config=require(_0x6242('0x7'));var controller=require(_0x6242('0x8'));router[_0x6242('0x9')]('/',auth[_0x6242('0xa')](),controller['index']);router[_0x6242('0x9')](_0x6242('0xb'),auth[_0x6242('0xa')](),controller[_0x6242('0xc')]);router[_0x6242('0xd')]('/:id/clone',auth['isAuthenticated'](),controller[_0x6242('0xe')]);router[_0x6242('0xd')]('/',auth[_0x6242('0xa')](),controller['create']);router['put'](_0x6242('0xb'),auth['isAuthenticated'](),controller[_0x6242('0xf')]);router[_0x6242('0x10')]('/:id',auth[_0x6242('0xa')](),controller[_0x6242('0x11')]);module[_0x6242('0x12')]=router; \ No newline at end of file +var _0x2b7d=['destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./trunk.controller','get','isAuthenticated','index','/:id','/:id/clone','clone','post','put','update','delete'];(function(_0x308ad9,_0x406497){var _0x1bb4f3=function(_0x25028b){while(--_0x25028b){_0x308ad9['push'](_0x308ad9['shift']());}};_0x1bb4f3(++_0x406497);}(_0x2b7d,0x131));var _0xd2b7=function(_0x2262c5,_0x28998f){_0x2262c5=_0x2262c5-0x0;var _0x33da3a=_0x2b7d[_0x2262c5];return _0x33da3a;};'use strict';var multer=require('multer');var util=require(_0xd2b7('0x0'));var path=require('path');var timeout=require(_0xd2b7('0x1'));var express=require(_0xd2b7('0x2'));var router=express[_0xd2b7('0x3')]();var fs_extra=require(_0xd2b7('0x4'));var auth=require(_0xd2b7('0x5'));var interaction=require(_0xd2b7('0x6'));var config=require('../../config/environment');var controller=require(_0xd2b7('0x7'));router[_0xd2b7('0x8')]('/',auth[_0xd2b7('0x9')](),controller[_0xd2b7('0xa')]);router['get'](_0xd2b7('0xb'),auth[_0xd2b7('0x9')](),controller['show']);router['post'](_0xd2b7('0xc'),auth[_0xd2b7('0x9')](),controller[_0xd2b7('0xd')]);router[_0xd2b7('0xe')]('/',auth[_0xd2b7('0x9')](),controller['create']);router[_0xd2b7('0xf')](_0xd2b7('0xb'),auth[_0xd2b7('0x9')](),controller[_0xd2b7('0x10')]);router[_0xd2b7('0x11')](_0xd2b7('0xb'),auth[_0xd2b7('0x9')](),controller[_0xd2b7('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 4b214fb..aecbd72 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 _0xdb91=['fingerprint','certificate','passive','actpass','dynamic','update,nonat','BOOLEAN','sequelize','exports','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB','STRING','udp','setDataValue','transport','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','auto','yes','outgoing','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','port,invite','join','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','refuse','originate','uas'];(function(_0x4c98b9,_0x1ad11b){var _0x3a257a=function(_0x147857){while(--_0x147857){_0x4c98b9['push'](_0x4c98b9['shift']());}};_0x3a257a(++_0x1ad11b);}(_0xdb91,0x97));var _0x1db9=function(_0x537cc4,_0x4f7915){_0x537cc4=_0x537cc4-0x0;var _0x4b9d3f=_0xdb91[_0x537cc4];return _0x4b9d3f;};'use strict';var Sequelize=require(_0x1db9('0x0'));module[_0x1db9('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x1db9('0x2')](_0x1db9('0x3'),_0x1db9('0x4'),_0x1db9('0x5')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1db9('0x6')},'callingpres':{'type':Sequelize[_0x1db9('0x2')](_0x1db9('0x7'),_0x1db9('0x8'),_0x1db9('0x9'),_0x1db9('0xa'),'PROHIB_NOT_SCREENED',_0x1db9('0xb'),'PROHIB_FAILED_SCREEN',_0x1db9('0xc'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x1db9('0xd')]},'secret':{'type':Sequelize[_0x1db9('0xd')]},'md5secret':{'type':Sequelize[_0x1db9('0xd')]},'remotesecret':{'type':Sequelize[_0x1db9('0xd')]},'transport':{'type':Sequelize[_0x1db9('0xd')],'defaultValue':_0x1db9('0xe'),'set':function(_0x49acde){this[_0x1db9('0xf')](_0x1db9('0x10'),_0x49acde?_0x49acde['join'](','):null);},'get':function(){return this[_0x1db9('0x11')](_0x1db9('0x10'))?this[_0x1db9('0x11')](_0x1db9('0x10'))['split'](','):null;},'comment':_0x1db9('0x12')},'dtmfmode':{'type':Sequelize[_0x1db9('0x2')](_0x1db9('0x13'),_0x1db9('0x14'),'shortinfo','inband',_0x1db9('0x15')),'defaultValue':_0x1db9('0x13')},'directmedia':{'type':Sequelize[_0x1db9('0x2')](_0x1db9('0x16'),'no','nonat','update',_0x1db9('0x17')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x1db9('0x2')](_0x1db9('0x16'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x1db9('0xd')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x1db9('0xd')],'defaultValue':'force_rport,comedia','set':function(_0x4a0d8a){this[_0x1db9('0xf')](_0x1db9('0x18'),_0x4a0d8a?_0x4a0d8a['join'](','):null);},'get':function(){return this[_0x1db9('0x11')](_0x1db9('0x18'))?this[_0x1db9('0x11')](_0x1db9('0x18'))[_0x1db9('0x19')](','):null;},'comment':_0x1db9('0x1a')},'callgroup':{'type':Sequelize[_0x1db9('0xd')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x1db9('0xd')]},'namedpickupgroup':{'type':Sequelize[_0x1db9('0xd')]},'language':{'type':Sequelize[_0x1db9('0xd')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x1db9('0xd')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x1db9('0xd')],'defaultValue':_0x1db9('0x1b')},'allow':{'type':Sequelize[_0x1db9('0xd')],'allowNull':![],'defaultValue':_0x1db9('0x1c'),'set':function(_0x260552){this[_0x1db9('0xf')](_0x1db9('0x1d'),_0x260552?_0x260552['join'](';'):_0x1db9('0x1c'));},'get':function(){return this[_0x1db9('0x11')](_0x1db9('0x1d'))?this[_0x1db9('0x11')](_0x1db9('0x1d'))[_0x1db9('0x19')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0x1db9('0x2')](_0x1db9('0x16'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x1db9('0x1e'),'set':function(_0xa8ee57){this[_0x1db9('0xf')]('insecure',_0xa8ee57?_0xa8ee57[_0x1db9('0x1f')](','):null);},'get':function(){return this['getDataValue'](_0x1db9('0x20'))?this[_0x1db9('0x11')](_0x1db9('0x20'))[_0x1db9('0x19')](','):null;},'comment':_0x1db9('0x21')},'trustrpid':{'type':Sequelize[_0x1db9('0x2')](_0x1db9('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x1db9('0x16'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x1db9('0x2')](_0x1db9('0x16'),'no',_0x1db9('0x22'))},'promiscredir':{'type':Sequelize[_0x1db9('0x2')](_0x1db9('0x16'),'no')},'useclientcode':{'type':Sequelize['ENUM']('yes','no')},'accountcode':{'type':Sequelize[_0x1db9('0x23')](0xb)},'setvar':{'type':Sequelize[_0x1db9('0xd')]},'callerid':{'type':Sequelize[_0x1db9('0xd')],'defaultValue':_0x1db9('0x24')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x1db9('0x2')]('yes','no'),'defaultValue':_0x1db9('0x16')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x1db9('0x2')](_0x1db9('0x16'),'no')},'allowsubscribe':{'type':Sequelize[_0x1db9('0x2')]('yes','no')},'allowtransfer':{'type':Sequelize[_0x1db9('0x2')](_0x1db9('0x16'),'no')},'ignoresdpversion':{'type':Sequelize[_0x1db9('0x2')]('yes','no')},'subscribecontext':{'type':Sequelize[_0x1db9('0xd')]},'template':{'type':Sequelize[_0x1db9('0xd')]},'videosupport':{'type':Sequelize[_0x1db9('0x2')](_0x1db9('0x16'),'no',_0x1db9('0x25')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x1db9('0x23')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x1db9('0x2')](_0x1db9('0x16'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize['ENUM']('accept',_0x1db9('0x26'),_0x1db9('0x27'))},'session_expires':{'type':Sequelize[_0x1db9('0x23')](0xb)},'session_minse':{'type':Sequelize[_0x1db9('0x23')](0xb)},'session_refresher':{'type':Sequelize['ENUM']('uac',_0x1db9('0x28')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x1db9('0xd')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x1db9('0xd')]},'fromuser':{'type':Sequelize[_0x1db9('0xd')]},'port':{'type':Sequelize[_0x1db9('0x23')](0x5)},'qualify':{'type':Sequelize[_0x1db9('0x2')](_0x1db9('0x16'),'no'),'defaultValue':_0x1db9('0x16')},'keepalive':{'type':Sequelize[_0x1db9('0x23')](0xb)},'defaultip':{'type':Sequelize[_0x1db9('0xd')]},'defaultuser':{'type':Sequelize[_0x1db9('0xd')]},'rtptimeout':{'type':Sequelize[_0x1db9('0x23')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x1db9('0x23')](0xb)},'sendrpid':{'type':Sequelize[_0x1db9('0x2')](_0x1db9('0x16'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x1db9('0xd')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x1db9('0x23')](0xb)},'timerb':{'type':Sequelize[_0x1db9('0x23')](0xb)},'qualifyfreq':{'type':Sequelize[_0x1db9('0x23')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x1db9('0xd')]},'unsolicited_mailbox':{'type':Sequelize[_0x1db9('0xd')]},'use_q850_reason':{'type':Sequelize[_0x1db9('0xd')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0x1db9('0x2')](_0x1db9('0x16'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x1db9('0x2')](_0x1db9('0x16'),'no')},'force_avp':{'type':Sequelize[_0x1db9('0x2')](_0x1db9('0x16'),'no')},'icesupport':{'type':Sequelize[_0x1db9('0x2')](_0x1db9('0x16'),'no')},'dtlsenable':{'type':Sequelize[_0x1db9('0x2')](_0x1db9('0x16'),'no')},'dtlsverify':{'type':Sequelize[_0x1db9('0x2')](_0x1db9('0x16'),'no',_0x1db9('0x29'),_0x1db9('0x2a'))},'dtlsrekey':{'type':Sequelize[_0x1db9('0x23')](0xb)},'dtlscertfile':{'type':Sequelize[_0x1db9('0xd')]},'dtlsprivatekey':{'type':Sequelize[_0x1db9('0xd')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x1db9('0xd')]},'dtlscapath':{'type':Sequelize[_0x1db9('0xd')]},'dtlssetup':{'type':Sequelize['ENUM']('active',_0x1db9('0x2b'),_0x1db9('0x2c')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x1db9('0xd')]},'usereqphone':{'type':Sequelize[_0x1db9('0x2')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x1db9('0xd')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x1db9('0x23')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM']('yes','no')},'subscribemwi':{'type':Sequelize[_0x1db9('0x2')](_0x1db9('0x16'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x1db9('0xd')]},'mohsuggest':{'type':Sequelize[_0x1db9('0xd')]},'parkinglot':{'type':Sequelize[_0x1db9('0xd')]},'description':{'type':Sequelize[_0x1db9('0xd')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0x1db9('0x2d')},'canreinvite':{'type':Sequelize[_0x1db9('0x2')](_0x1db9('0x16'),'no','nonat','update',_0x1db9('0x2e')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x1db9('0xd')]},'otherFields':{'type':Sequelize[_0x1db9('0xd')]},'active':{'type':Sequelize[_0x1db9('0x2f')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x1db9('0xd')],'defaultValue':'no'}}; \ No newline at end of file +var _0xe108=['uas','pai','fingerprint','certificate','active','passive','dynamic','update,nonat','BOOLEAN','exports','STRING','name','ENUM','user','peer','friend','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','setDataValue','join','getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','inband','yes','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','INTEGER','\x22\x22\x20<>','always','accept','originate','uac'];(function(_0x3c96ba,_0x4c9262){var _0x2f912f=function(_0x1aadde){while(--_0x1aadde){_0x3c96ba['push'](_0x3c96ba['shift']());}};_0x2f912f(++_0x4c9262);}(_0xe108,0x129));var _0x8e10=function(_0x129c27,_0x333c44){_0x129c27=_0x129c27-0x0;var _0x5a8017=_0xe108[_0x129c27];return _0x5a8017;};'use strict';var Sequelize=require('sequelize');module[_0x8e10('0x0')]={'name':{'type':Sequelize[_0x8e10('0x1')],'allowNull':![],'unique':_0x8e10('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x8e10('0x3')]('friend',_0x8e10('0x4'),_0x8e10('0x5')),'allowNull':![],'defaultValue':_0x8e10('0x6')},'context':{'type':Sequelize[_0x8e10('0x1')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x8e10('0x3')](_0x8e10('0x7'),_0x8e10('0x8'),_0x8e10('0x9'),_0x8e10('0xa'),_0x8e10('0xb'),'PROHIB_PASSED_SCREEN',_0x8e10('0xc'),_0x8e10('0xd'))},'deny':{'type':Sequelize[_0x8e10('0x1')]},'permit':{'type':Sequelize[_0x8e10('0x1')]},'secret':{'type':Sequelize[_0x8e10('0x1')]},'md5secret':{'type':Sequelize[_0x8e10('0x1')]},'remotesecret':{'type':Sequelize[_0x8e10('0x1')]},'transport':{'type':Sequelize[_0x8e10('0x1')],'defaultValue':'udp','set':function(_0x233c13){this[_0x8e10('0xe')]('transport',_0x233c13?_0x233c13[_0x8e10('0xf')](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0x8e10('0x10')](_0x8e10('0x11'))[_0x8e10('0x12')](','):null;},'comment':_0x8e10('0x13')},'dtmfmode':{'type':Sequelize['ENUM']('rfc2833',_0x8e10('0x14'),'shortinfo',_0x8e10('0x15'),'auto'),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0x8e10('0x16'),'no','nonat',_0x8e10('0x17'),_0x8e10('0x18')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x8e10('0x3')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x8e10('0x1')]},'directmediadeny':{'type':Sequelize[_0x8e10('0x1')]},'nat':{'type':Sequelize[_0x8e10('0x1')],'defaultValue':_0x8e10('0x19'),'set':function(_0x4d11b1){this[_0x8e10('0xe')](_0x8e10('0x1a'),_0x4d11b1?_0x4d11b1['join'](','):null);},'get':function(){return this['getDataValue'](_0x8e10('0x1a'))?this[_0x8e10('0x10')](_0x8e10('0x1a'))[_0x8e10('0x12')](','):null;},'comment':_0x8e10('0x1b')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x8e10('0x1')]},'pickupgroup':{'type':Sequelize[_0x8e10('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x8e10('0x1')]},'language':{'type':Sequelize[_0x8e10('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x8e10('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x8e10('0x1')],'defaultValue':_0x8e10('0x1c')},'allow':{'type':Sequelize[_0x8e10('0x1')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x5a29b5){this[_0x8e10('0xe')](_0x8e10('0x1d'),_0x5a29b5?_0x5a29b5[_0x8e10('0xf')](';'):_0x8e10('0x1e'));},'get':function(){return this[_0x8e10('0x10')]('allow')?this[_0x8e10('0x10')](_0x8e10('0x1d'))[_0x8e10('0x12')](';'):null;},'comment':_0x8e10('0x1f')},'autoframing':{'type':Sequelize[_0x8e10('0x3')]('yes','no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':'port,invite','set':function(_0x8bc4d){this[_0x8e10('0xe')](_0x8e10('0x20'),_0x8bc4d?_0x8bc4d[_0x8e10('0xf')](','):null);},'get':function(){return this[_0x8e10('0x10')](_0x8e10('0x20'))?this[_0x8e10('0x10')]('insecure')[_0x8e10('0x12')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x8e10('0x3')](_0x8e10('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x8e10('0x16'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x8e10('0x3')](_0x8e10('0x16'),'no','never')},'promiscredir':{'type':Sequelize[_0x8e10('0x3')](_0x8e10('0x16'),'no')},'useclientcode':{'type':Sequelize[_0x8e10('0x3')]('yes','no')},'accountcode':{'type':Sequelize[_0x8e10('0x21')](0xb)},'setvar':{'type':Sequelize[_0x8e10('0x1')]},'callerid':{'type':Sequelize[_0x8e10('0x1')],'defaultValue':_0x8e10('0x22')},'amaflags':{'type':Sequelize[_0x8e10('0x1')]},'callcounter':{'type':Sequelize[_0x8e10('0x3')](_0x8e10('0x16'),'no'),'defaultValue':_0x8e10('0x16')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x8e10('0x3')](_0x8e10('0x16'),'no')},'allowsubscribe':{'type':Sequelize[_0x8e10('0x3')]('yes','no')},'allowtransfer':{'type':Sequelize[_0x8e10('0x3')](_0x8e10('0x16'),'no')},'ignoresdpversion':{'type':Sequelize[_0x8e10('0x3')](_0x8e10('0x16'),'no')},'subscribecontext':{'type':Sequelize[_0x8e10('0x1')]},'template':{'type':Sequelize[_0x8e10('0x1')]},'videosupport':{'type':Sequelize['ENUM'](_0x8e10('0x16'),'no',_0x8e10('0x23')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x8e10('0x3')](_0x8e10('0x16'),'no')},'mailbox':{'type':Sequelize[_0x8e10('0x1')]},'session_timers':{'type':Sequelize[_0x8e10('0x3')](_0x8e10('0x24'),'refuse',_0x8e10('0x25'))},'session_expires':{'type':Sequelize[_0x8e10('0x21')](0xb)},'session_minse':{'type':Sequelize[_0x8e10('0x21')](0xb)},'session_refresher':{'type':Sequelize[_0x8e10('0x3')](_0x8e10('0x26'),_0x8e10('0x27')),'defaultValue':_0x8e10('0x27')},'t38pt_usertpsource':{'type':Sequelize[_0x8e10('0x1')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0x8e10('0x1')]},'port':{'type':Sequelize[_0x8e10('0x21')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0x8e10('0x16'),'no'),'defaultValue':_0x8e10('0x16')},'keepalive':{'type':Sequelize[_0x8e10('0x21')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x8e10('0x1')]},'rtptimeout':{'type':Sequelize[_0x8e10('0x21')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0x8e10('0x16'),'no',_0x8e10('0x28')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x8e10('0x1')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x8e10('0x21')](0xb)},'timerb':{'type':Sequelize[_0x8e10('0x21')](0xb)},'qualifyfreq':{'type':Sequelize[_0x8e10('0x21')](0xb)},'contactpermit':{'type':Sequelize[_0x8e10('0x1')]},'contactdeny':{'type':Sequelize[_0x8e10('0x1')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0x8e10('0x1')]},'use_q850_reason':{'type':Sequelize[_0x8e10('0x1')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0x8e10('0x3')](_0x8e10('0x16'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x8e10('0x3')]('yes','no')},'force_avp':{'type':Sequelize[_0x8e10('0x3')](_0x8e10('0x16'),'no')},'icesupport':{'type':Sequelize[_0x8e10('0x3')](_0x8e10('0x16'),'no')},'dtlsenable':{'type':Sequelize[_0x8e10('0x3')](_0x8e10('0x16'),'no')},'dtlsverify':{'type':Sequelize[_0x8e10('0x3')]('yes','no',_0x8e10('0x29'),_0x8e10('0x2a'))},'dtlsrekey':{'type':Sequelize[_0x8e10('0x21')](0xb)},'dtlscertfile':{'type':Sequelize[_0x8e10('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0x8e10('0x1')]},'dtlscipher':{'type':Sequelize[_0x8e10('0x1')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0x8e10('0x1')]},'dtlssetup':{'type':Sequelize[_0x8e10('0x3')](_0x8e10('0x2b'),_0x8e10('0x2c'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x8e10('0x1')]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x8e10('0x1')]},'call_limit':{'type':Sequelize[_0x8e10('0x21')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x8e10('0x3')]('yes','no')},'subscribemwi':{'type':Sequelize[_0x8e10('0x3')](_0x8e10('0x16'),'no')},'vmexten':{'type':Sequelize[_0x8e10('0x1')]},'mohinterpret':{'type':Sequelize[_0x8e10('0x1')]},'mohsuggest':{'type':Sequelize[_0x8e10('0x1')]},'parkinglot':{'type':Sequelize[_0x8e10('0x1')]},'description':{'type':Sequelize[_0x8e10('0x1')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0x8e10('0x2d')},'canreinvite':{'type':Sequelize['ENUM']('yes','no','nonat',_0x8e10('0x17'),_0x8e10('0x2e')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x8e10('0x1')]},'otherFields':{'type':Sequelize[_0x8e10('0x1')]},'active':{'type':Sequelize[_0x8e10('0x2f')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index 29d8566..768758b 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 _0x008c=['update','destroy','get','Trunks','UserProfileResource','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','Trunk','findAll','show','params','includeAll','include','options','clone','find','omit','createdAt','updatedAt','body','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','root','utf8','server/files/templates/registry.ejs','render','/etc/asterisk/sip_xcally_trunks.conf','registry','writeFileSync','Reload','chan_sip.so','server/files/templates/trunk.ejs','join','/etc/asterisk/sip_xcally_registers.conf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','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','jayson/promise','client','http','request','then','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','Trunk,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save'];(function(_0x30da2e,_0x146e54){var _0x794139=function(_0x25bd28){while(--_0x25bd28){_0x30da2e['push'](_0x30da2e['shift']());}};_0x794139(++_0x146e54);}(_0x008c,0x188));var _0xc008=function(_0x4727f1,_0x2ff773){_0x4727f1=_0x4727f1-0x0;var _0x2977ce=_0x008c[_0x4727f1];return _0x2977ce;};'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'];var jayson=require(_0xc008('0x18'));var client=jayson[_0xc008('0x19')][_0xc008('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x593f7a,_0x560e28,_0x33f44c,_0x50c1ab){return new BPromise(function(_0x25e13f,_0x4584e1){var _0x2073ef=_0x50c1ab||client;return _0x2073ef[_0xc008('0x1b')](_0x593f7a,_0x33f44c)[_0xc008('0x1c')](function(_0x5ee00b){logger['info']('Trunk,\x20%s,\x20%s',_0x560e28,_0xc008('0x1d'));logger[_0xc008('0x1e')](_0xc008('0x1f'),_0x560e28,_0xc008('0x1d'),JSON['stringify'](_0x5ee00b));if(_0x5ee00b['error']){if(_0x5ee00b['error']['code']===0x1f4){logger[_0xc008('0x20')](_0xc008('0x21'),_0x560e28,_0x5ee00b['error'][_0xc008('0x22')]);return _0x4584e1(_0x5ee00b['error']['message']);}logger['error']('Trunk,\x20%s,\x20%s',_0x560e28,_0x5ee00b[_0xc008('0x20')]['message']);return _0x25e13f(_0x5ee00b['error']['message']);}else{logger['info']('Trunk,\x20%s,\x20%s',_0x560e28,_0xc008('0x1d'));_0x25e13f(_0x5ee00b[_0xc008('0x23')][_0xc008('0x22')]);}})[_0xc008('0x24')](function(_0x11cc75){logger[_0xc008('0x20')]('Trunk,\x20%s,\x20%s',_0x560e28,_0x11cc75);_0x4584e1(_0x11cc75);});});}function respondWithStatusCode(_0x459fd9,_0x5c85f2){_0x5c85f2=_0x5c85f2||0xcc;return function(_0x58a6ea){if(_0x58a6ea){return _0x459fd9[_0xc008('0x25')](_0x5c85f2);}return _0x459fd9[_0xc008('0x26')](_0x5c85f2)[_0xc008('0x27')]();};}function respondWithResult(_0x3cb28c,_0x5410f5){_0x5410f5=_0x5410f5||0xc8;return function(_0x48582b){if(_0x48582b){return _0x3cb28c['status'](_0x5410f5)[_0xc008('0x28')](_0x48582b);}};}function respondWithFilteredResult(_0x15dade,_0x92c582){return function(_0x2e31c2){if(_0x2e31c2){var _0x5bebd9=typeof _0x92c582['offset']==='undefined'&&typeof _0x92c582['limit']==='undefined';var _0x3865c0=_0x2e31c2[_0xc008('0x29')];var _0x25eae4=_0x5bebd9?0x0:_0x92c582['offset'];var _0x24c14c=_0x5bebd9?_0x2e31c2[_0xc008('0x29')]:_0x92c582[_0xc008('0x2a')]+_0x92c582[_0xc008('0x2b')];var _0x4c5dec;if(_0x24c14c>=_0x3865c0){_0x24c14c=_0x3865c0;_0x4c5dec=0xc8;}else{_0x4c5dec=0xce;}_0x15dade[_0xc008('0x26')](_0x4c5dec);return _0x15dade[_0xc008('0x2c')]('Content-Range',_0x25eae4+'-'+_0x24c14c+'/'+_0x3865c0)['json'](_0x2e31c2);}return null;};}function patchUpdates(_0x539766){return function(_0x1032b2){try{jsonpatch[_0xc008('0x2d')](_0x1032b2,_0x539766,!![]);}catch(_0xf831f2){return BPromise[_0xc008('0x2e')](_0xf831f2);}return _0x1032b2[_0xc008('0x2f')]();};}function saveUpdates(_0xceebc3,_0x294f97){return function(_0x22d8e8){if(_0x22d8e8){return _0x22d8e8[_0xc008('0x30')](_0xceebc3)[_0xc008('0x1c')](function(_0x2f4b6b){return _0x2f4b6b;});}return null;};}function removeEntity(_0x1ac7c8,_0x596ee8){return function(_0x334a09){if(_0x334a09){return _0x334a09[_0xc008('0x31')]()['then'](function(){var _0xaf4b84=_0x334a09[_0xc008('0x32')]({'plain':!![]});var _0x383be7=_0xc008('0x33');return db[_0xc008('0x34')][_0xc008('0x31')]({'where':{'type':_0x383be7,'resourceId':_0xaf4b84['id']}})[_0xc008('0x1c')](function(){return _0x334a09;});})[_0xc008('0x1c')](function(){_0x1ac7c8[_0xc008('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x415b87,_0x389a40){return function(_0x459df4){if(!_0x459df4){_0x415b87[_0xc008('0x25')](0x194);}return _0x459df4;};}function handleError(_0x40002f,_0x315562){_0x315562=_0x315562||0x1f4;return function(_0x1667a0){logger['error'](_0x1667a0[_0xc008('0x35')]);if(_0x1667a0[_0xc008('0x36')]){delete _0x1667a0['name'];}_0x40002f[_0xc008('0x26')](_0x315562)[_0xc008('0x37')](_0x1667a0);};}exports['index']=function(_0x263473,_0x2e4ae1){var _0x280e9b={},_0x55ff48={},_0x53b353={'count':0x0,'rows':[]};var _0x478810=_[_0xc008('0x38')](db['Trunk'][_0xc008('0x39')],function(_0x3884dd){return{'name':_0x3884dd[_0xc008('0x3a')],'type':_0x3884dd[_0xc008('0x3b')][_0xc008('0x3c')]};});_0x55ff48[_0xc008('0x3d')]=_[_0xc008('0x38')](_0x478810,_0xc008('0x36'));_0x55ff48[_0xc008('0x3e')]=_[_0xc008('0x3f')](_0x263473[_0xc008('0x3e')]);_0x55ff48[_0xc008('0x40')]=_[_0xc008('0x41')](_0x55ff48[_0xc008('0x3d')],_0x55ff48['query']);_0x280e9b[_0xc008('0x42')]=_[_0xc008('0x41')](_0x55ff48[_0xc008('0x3d')],qs[_0xc008('0x43')](_0x263473['query'][_0xc008('0x43')]));_0x280e9b[_0xc008('0x42')]=_0x280e9b[_0xc008('0x42')][_0xc008('0x44')]?_0x280e9b[_0xc008('0x42')]:_0x55ff48['model'];if(!_0x263473[_0xc008('0x3e')][_0xc008('0x45')](_0xc008('0x46'))){_0x280e9b[_0xc008('0x2b')]=qs[_0xc008('0x2b')](_0x263473['query'][_0xc008('0x2b')]);_0x280e9b[_0xc008('0x2a')]=qs[_0xc008('0x2a')](_0x263473[_0xc008('0x3e')]['offset']);}_0x280e9b[_0xc008('0x47')]=qs[_0xc008('0x48')](_0x263473[_0xc008('0x3e')]['sort']);_0x280e9b[_0xc008('0x49')]=qs['filters'](_[_0xc008('0x4a')](_0x263473['query'],_0x55ff48[_0xc008('0x40')]),_0x478810);if(_0x263473[_0xc008('0x3e')]['filter']){_0x280e9b[_0xc008('0x49')]=_[_0xc008('0x4b')](_0x280e9b[_0xc008('0x49')],{'$or':_['map'](_0x478810,function(_0x1cec64){if(_0x1cec64[_0xc008('0x3b')]!==_0xc008('0x4c')){var _0x44fc5d={};_0x44fc5d[_0x1cec64[_0xc008('0x36')]]={'$like':'%'+_0x263473[_0xc008('0x3e')]['filter']+'%'};return _0x44fc5d;}})});}_0x280e9b=_['merge']({},_0x280e9b,_0x263473['options']);var _0x4552ed={'where':_0x280e9b[_0xc008('0x49')]};return db[_0xc008('0x4d')][_0xc008('0x29')](_0x4552ed)[_0xc008('0x1c')](function(_0x24f6a4){_0x53b353[_0xc008('0x29')]=_0x24f6a4;if(_0x263473[_0xc008('0x3e')]['includeAll']){_0x280e9b['include']=[{'all':!![]}];}return db['Trunk'][_0xc008('0x4e')](_0x280e9b);})[_0xc008('0x1c')](function(_0x158eae){_0x53b353['rows']=_0x158eae;return _0x53b353;})[_0xc008('0x1c')](respondWithFilteredResult(_0x2e4ae1,_0x280e9b))[_0xc008('0x24')](handleError(_0x2e4ae1,null));};exports[_0xc008('0x4f')]=function(_0x1c2c50,_0x4981b4){var _0x56e4ac={'raw':![],'where':{'id':_0x1c2c50[_0xc008('0x50')]['id']}},_0x17ec90={};_0x17ec90[_0xc008('0x3d')]=_[_0xc008('0x3f')](db['Trunk']['rawAttributes']);_0x17ec90[_0xc008('0x3e')]=_['keys'](_0x1c2c50[_0xc008('0x3e')]);_0x17ec90[_0xc008('0x40')]=_[_0xc008('0x41')](_0x17ec90['model'],_0x17ec90[_0xc008('0x3e')]);_0x56e4ac[_0xc008('0x42')]=_[_0xc008('0x41')](_0x17ec90[_0xc008('0x3d')],qs[_0xc008('0x43')](_0x1c2c50['query'][_0xc008('0x43')]));_0x56e4ac[_0xc008('0x42')]=_0x56e4ac['attributes'][_0xc008('0x44')]?_0x56e4ac[_0xc008('0x42')]:_0x17ec90['model'];if(_0x1c2c50['query'][_0xc008('0x51')]){_0x56e4ac[_0xc008('0x52')]=[{'all':!![]}];}_0x56e4ac=_[_0xc008('0x4b')]({},_0x56e4ac,_0x1c2c50[_0xc008('0x53')]);return db[_0xc008('0x4d')]['find'](_0x56e4ac)['then'](handleEntityNotFound(_0x4981b4,null))[_0xc008('0x1c')](respondWithResult(_0x4981b4,null))['catch'](handleError(_0x4981b4,null));};exports[_0xc008('0x54')]=function(_0x25d351,_0xf94fcb){var _0x2f1105={'where':{'id':_0x25d351[_0xc008('0x50')]['id']}},_0x44f42d={};_0x44f42d['model']=_[_0xc008('0x3f')](db[_0xc008('0x4d')][_0xc008('0x39')]);_0x2f1105[_0xc008('0x42')]=_[_0xc008('0x41')](_0x44f42d['model'],qs[_0xc008('0x43')](_0x25d351['query']['fields']));_0x2f1105['attributes']=_0x2f1105[_0xc008('0x42')][_0xc008('0x44')]?_0x2f1105[_0xc008('0x42')]:_0x44f42d['model'];if(_0x25d351[_0xc008('0x3e')][_0xc008('0x51')]){_0x2f1105[_0xc008('0x52')]=[{'all':!![]}];}_0x2f1105=_['merge']({},_0x2f1105,_0x25d351[_0xc008('0x53')]);return db[_0xc008('0x4d')][_0xc008('0x55')](_0x2f1105)[_0xc008('0x1c')](handleEntityNotFound(_0xf94fcb,null))['then'](function(_0x4022dd){if(_0x4022dd){var _0x4eaa6d=_0x4022dd[_0xc008('0x32')]({'plain':!![]});_0x4eaa6d=qs[_0xc008('0x56')](_0x4eaa6d,['id',_0xc008('0x57'),_0xc008('0x58')]);_0x25d351[_0xc008('0x59')]=_[_0xc008('0x56')](_0x25d351['body'],['id',_0xc008('0x57'),'updatedAt']);return db['Trunk'][_0xc008('0x5a')](_[_0xc008('0x4b')](_0x4eaa6d,_0x25d351['body']),{'include':_0x25d351[_0xc008('0x3e')][_0xc008('0x51')]?[{'all':!![]}]:undefined})[_0xc008('0x1c')](function(_0x4517c0){var _0x21ee6d=_0x25d351[_0xc008('0x5b')][_0xc008('0x32')]({'plain':!![]});if(!_0x21ee6d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x21ee6d[_0xc008('0x5c')]===_0xc008('0x5b')){var _0x3bfb15=_0x4517c0[_0xc008('0x32')]({'plain':!![]});var _0xb3ca0f=_0xc008('0x33');return db[_0xc008('0x5d')][_0xc008('0x55')]({'where':{'name':_0xb3ca0f,'userProfileId':_0x21ee6d[_0xc008('0x5e')]},'raw':!![]})[_0xc008('0x1c')](function(_0x1bef66){if(_0x1bef66&&_0x1bef66[_0xc008('0x5f')]===0x0){return db[_0xc008('0x34')][_0xc008('0x5a')]({'name':_0x3bfb15['name'],'resourceId':_0x3bfb15['id'],'type':_0x1bef66[_0xc008('0x36')],'sectionId':_0x1bef66['id']},{})[_0xc008('0x1c')](function(){return _0x4517c0;});}else{return _0x4517c0;}})[_0xc008('0x24')](function(_0x566dea){logger[_0xc008('0x20')](_0xc008('0x60'),_0x566dea);throw _0x566dea;});}return _0x4517c0;});}})['then'](respondWithResult(_0xf94fcb,0xc9))['catch'](handleError(_0xf94fcb,null));};exports[_0xc008('0x5a')]=function(_0x2a4c2b,_0x7bad14,_0x39083c){var _0x1a2ce7;return db[_0xc008('0x4d')][_0xc008('0x5a')](_0x2a4c2b[_0xc008('0x59')],{'raw':!![]})[_0xc008('0x1c')](function(_0x1b059b){_0x1a2ce7=_0x1b059b;return db[_0xc008('0x4d')]['findAll']({'raw':!![]});})[_0xc008('0x1c')](function(_0x25a52b){var _0xfdb5e3=fs[_0xc008('0x61')](path['join'](config[_0xc008('0x62')],'server/files/templates/trunk.ejs'),_0xc008('0x63'));var _0x46fa7b=fs[_0xc008('0x61')](path['join'](config[_0xc008('0x62')],_0xc008('0x64')),_0xc008('0x63'));var _0x553f5c=ejs[_0xc008('0x65')](_0xfdb5e3,{'trunks':_0x25a52b||[]});fs['writeFileSync'](_0xc008('0x66'),_0x553f5c);if(_0x1a2ce7[_0xc008('0x67')]){var _0x23012c=ejs[_0xc008('0x65')](_0x46fa7b,{'trunks':_0x25a52b||[]});fs[_0xc008('0x68')]('/etc/asterisk/sip_xcally_registers.conf',_0x23012c);}})[_0xc008('0x1c')](function(){return respondWithRpcPromise(_0xc008('0x69'),'create',{'module':_0xc008('0x6a')});})['then'](function(){var _0x278cbe=_0x2a4c2b['user'][_0xc008('0x32')]({'plain':!![]});if(!_0x278cbe)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x278cbe[_0xc008('0x5c')]===_0xc008('0x5b')){var _0x33d8e4=_0x1a2ce7[_0xc008('0x32')]({'plain':!![]});return db['UserProfileSection'][_0xc008('0x55')]({'where':{'name':_0xc008('0x33'),'userProfileId':_0x278cbe[_0xc008('0x5e')]},'raw':!![]})[_0xc008('0x1c')](function(_0x321500){if(_0x321500&&_0x321500[_0xc008('0x5f')]===0x0){return db[_0xc008('0x34')][_0xc008('0x5a')]({'name':_0x33d8e4['name'],'resourceId':_0x33d8e4['id'],'type':_0x321500[_0xc008('0x36')],'sectionId':_0x321500['id']},{})['then'](function(){return _0x1a2ce7;});}else{return _0x1a2ce7;}})['catch'](function(_0x4c84da){logger[_0xc008('0x20')](_0xc008('0x60'),_0x4c84da);throw _0x4c84da;});}return _0x1a2ce7;})[_0xc008('0x1c')](respondWithResult(_0x7bad14,0xc9))[_0xc008('0x24')](handleError(_0x7bad14,null));};exports[_0xc008('0x30')]=function(_0x2e9646,_0x23ef42,_0x519328){var _0x127bdf;return db['Trunk'][_0xc008('0x55')]({'where':{'id':_0x2e9646[_0xc008('0x50')]['id']}})[_0xc008('0x1c')](handleEntityNotFound(_0x23ef42,null))[_0xc008('0x1c')](saveUpdates(_0x2e9646[_0xc008('0x59')],null))[_0xc008('0x1c')](function(_0x23d4ff){if(_0x23d4ff){_0x127bdf=_0x23d4ff;return db[_0xc008('0x4d')][_0xc008('0x4e')]({'raw':!![]});}})[_0xc008('0x1c')](function(_0x334ed8){if(_0x334ed8){var _0x1dd9fe=fs['readFileSync'](path['join'](config[_0xc008('0x62')],_0xc008('0x6b')),_0xc008('0x63'));var _0x572d93=fs[_0xc008('0x61')](path[_0xc008('0x6c')](config['root'],'server/files/templates/registry.ejs'),'utf8');var _0x3fc44f=ejs[_0xc008('0x65')](_0x1dd9fe,{'trunks':_0x334ed8||[]});fs[_0xc008('0x68')](_0xc008('0x66'),_0x3fc44f);var _0x1101b8=ejs[_0xc008('0x65')](_0x572d93,{'trunks':_0x334ed8||[]});fs[_0xc008('0x68')](_0xc008('0x6d'),_0x1101b8);return respondWithRpcPromise(_0xc008('0x69'),_0xc008('0x30'),{'module':'chan_sip.so'});}return null;})['then'](function(_0xc644fe){if(_0xc644fe){return _0x127bdf;}})[_0xc008('0x1c')](respondWithResult(_0x23ef42,null))[_0xc008('0x24')](handleError(_0x23ef42,null));};exports[_0xc008('0x31')]=function(_0x2b94b2,_0x37fc2c,_0x4b434f){var _0x5794fe;return db[_0xc008('0x4d')][_0xc008('0x55')]({'where':{'id':_0x2b94b2[_0xc008('0x50')]['id']}})['then'](handleEntityNotFound(_0x37fc2c,null))['then'](removeEntity(_0x37fc2c,null))['then'](function(){return db['Trunk']['findAll']({'raw':!![]});})['then'](function(_0x276de2){var _0x52bf60=fs[_0xc008('0x61')](path['join'](config[_0xc008('0x62')],_0xc008('0x6b')),_0xc008('0x63'));var _0x5bc8b0=fs['readFileSync'](path[_0xc008('0x6c')](config['root'],_0xc008('0x64')),_0xc008('0x63'));var _0x544519=ejs[_0xc008('0x65')](_0x52bf60,{'trunks':_0x276de2});var _0x4db90b=ejs['render'](_0x5bc8b0,{'trunks':_0x276de2});fs[_0xc008('0x68')](_0xc008('0x66'),_0x544519);fs['writeFileSync'](_0xc008('0x6d'),_0x4db90b);return respondWithRpcPromise(_0xc008('0x69'),_0xc008('0x31'),{'module':'chan_sip.so'});})[_0xc008('0x24')](handleError(_0x37fc2c,null));}; \ No newline at end of file +var _0x425d=['readFileSync','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','UserProfileSection','userProfileId','/etc/asterisk/sip_xcally_trunks.conf','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','Trunk,\x20%s,\x20%s','result','catch','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','get','Trunks','UserProfileResource','stack','name','send','index','map','Trunk','rawAttributes','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','clone','find','omit','updatedAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8'];(function(_0x402957,_0x17b2c7){var _0x3e40c7=function(_0x133ab9){while(--_0x133ab9){_0x402957['push'](_0x402957['shift']());}};_0x3e40c7(++_0x17b2c7);}(_0x425d,0x1e0));var _0xd425=function(_0x3b6502,_0x152883){_0x3b6502=_0x3b6502-0x0;var _0x216fc9=_0x425d[_0x3b6502];return _0x216fc9;};'use strict';var emlformat=require(_0xd425('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd425('0x1'));var jsonpatch=require(_0xd425('0x2'));var rp=require(_0xd425('0x3'));var moment=require(_0xd425('0x4'));var BPromise=require(_0xd425('0x5'));var Mustache=require(_0xd425('0x6'));var util=require(_0xd425('0x7'));var path=require('path');var sox=require(_0xd425('0x8'));var csv=require(_0xd425('0x9'));var ejs=require(_0xd425('0xa'));var fs=require('fs');var fs_extra=require(_0xd425('0xb'));var _=require(_0xd425('0xc'));var squel=require(_0xd425('0xd'));var crypto=require('crypto');var jsforce=require(_0xd425('0xe'));var deskjs=require(_0xd425('0xf'));var toCsv=require(_0xd425('0x9'));var querystring=require(_0xd425('0x10'));var Papa=require(_0xd425('0x11'));var Redis=require(_0xd425('0x12'));var authService=require(_0xd425('0x13'));var qs=require(_0xd425('0x14'));var as=require(_0xd425('0x15'));var hardwareService=require(_0xd425('0x16'));var logger=require(_0xd425('0x17'))(_0xd425('0x18'));var utils=require(_0xd425('0x19'));var config=require(_0xd425('0x1a'));var licenseUtil=require(_0xd425('0x1b'));var db=require(_0xd425('0x1c'))['db'];var jayson=require(_0xd425('0x1d'));var client=jayson[_0xd425('0x1e')][_0xd425('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x18eafb,_0x51263f,_0x27318c,_0x17a498){return new BPromise(function(_0x336dc3,_0x5d3d60){var _0x309263=_0x17a498||client;return _0x309263[_0xd425('0x20')](_0x18eafb,_0x27318c)[_0xd425('0x21')](function(_0x41f34d){logger[_0xd425('0x22')]('Trunk,\x20%s,\x20%s',_0x51263f,_0xd425('0x23'));logger[_0xd425('0x24')](_0xd425('0x25'),_0x51263f,_0xd425('0x23'),JSON['stringify'](_0x41f34d));if(_0x41f34d[_0xd425('0x26')]){if(_0x41f34d[_0xd425('0x26')][_0xd425('0x27')]===0x1f4){logger[_0xd425('0x26')]('Trunk,\x20%s,\x20%s',_0x51263f,_0x41f34d['error']['message']);return _0x5d3d60(_0x41f34d['error'][_0xd425('0x28')]);}logger[_0xd425('0x26')](_0xd425('0x29'),_0x51263f,_0x41f34d['error'][_0xd425('0x28')]);return _0x336dc3(_0x41f34d[_0xd425('0x26')]['message']);}else{logger[_0xd425('0x22')](_0xd425('0x29'),_0x51263f,_0xd425('0x23'));_0x336dc3(_0x41f34d[_0xd425('0x2a')][_0xd425('0x28')]);}})[_0xd425('0x2b')](function(_0x2480a0){logger[_0xd425('0x26')](_0xd425('0x29'),_0x51263f,_0x2480a0);_0x5d3d60(_0x2480a0);});});}function respondWithStatusCode(_0x2b030b,_0x151ad9){_0x151ad9=_0x151ad9||0xcc;return function(_0x40e84b){if(_0x40e84b){return _0x2b030b['sendStatus'](_0x151ad9);}return _0x2b030b[_0xd425('0x2c')](_0x151ad9)[_0xd425('0x2d')]();};}function respondWithResult(_0x398985,_0x1908a5){_0x1908a5=_0x1908a5||0xc8;return function(_0x2afcdb){if(_0x2afcdb){return _0x398985[_0xd425('0x2c')](_0x1908a5)[_0xd425('0x2e')](_0x2afcdb);}};}function respondWithFilteredResult(_0x577e4b,_0x12f951){return function(_0x177de2){if(_0x177de2){var _0x1d8861=typeof _0x12f951['offset']===_0xd425('0x2f')&&typeof _0x12f951[_0xd425('0x30')]===_0xd425('0x2f');var _0x999fb9=_0x177de2[_0xd425('0x31')];var _0x185d7e=_0x1d8861?0x0:_0x12f951[_0xd425('0x32')];var _0x37b63c=_0x1d8861?_0x177de2[_0xd425('0x31')]:_0x12f951[_0xd425('0x32')]+_0x12f951['limit'];var _0x471e3e;if(_0x37b63c>=_0x999fb9){_0x37b63c=_0x999fb9;_0x471e3e=0xc8;}else{_0x471e3e=0xce;}_0x577e4b[_0xd425('0x2c')](_0x471e3e);return _0x577e4b[_0xd425('0x33')](_0xd425('0x34'),_0x185d7e+'-'+_0x37b63c+'/'+_0x999fb9)[_0xd425('0x2e')](_0x177de2);}return null;};}function patchUpdates(_0x1abf33){return function(_0x47405f){try{jsonpatch[_0xd425('0x35')](_0x47405f,_0x1abf33,!![]);}catch(_0x3ec51b){return BPromise[_0xd425('0x36')](_0x3ec51b);}return _0x47405f[_0xd425('0x37')]();};}function saveUpdates(_0x5f3dab,_0x316493){return function(_0x2a2a9b){if(_0x2a2a9b){return _0x2a2a9b[_0xd425('0x38')](_0x5f3dab)[_0xd425('0x21')](function(_0x28870f){return _0x28870f;});}return null;};}function removeEntity(_0x4eddbc,_0x4aa168){return function(_0x3badcc){if(_0x3badcc){return _0x3badcc['destroy']()['then'](function(){var _0x51669d=_0x3badcc[_0xd425('0x39')]({'plain':!![]});var _0xfb0c8=_0xd425('0x3a');return db[_0xd425('0x3b')]['destroy']({'where':{'type':_0xfb0c8,'resourceId':_0x51669d['id']}})[_0xd425('0x21')](function(){return _0x3badcc;});})[_0xd425('0x21')](function(){_0x4eddbc[_0xd425('0x2c')](0xcc)[_0xd425('0x2d')]();});}};}function handleEntityNotFound(_0x27b9e2,_0x1e12f2){return function(_0x35bbec){if(!_0x35bbec){_0x27b9e2['sendStatus'](0x194);}return _0x35bbec;};}function handleError(_0x363fb0,_0x59b3d3){_0x59b3d3=_0x59b3d3||0x1f4;return function(_0x22df81){logger[_0xd425('0x26')](_0x22df81[_0xd425('0x3c')]);if(_0x22df81['name']){delete _0x22df81[_0xd425('0x3d')];}_0x363fb0[_0xd425('0x2c')](_0x59b3d3)[_0xd425('0x3e')](_0x22df81);};}exports[_0xd425('0x3f')]=function(_0x58f36d,_0x1d38fa){var _0x3cf540={},_0x59e326={},_0x5d310e={'count':0x0,'rows':[]};var _0x48fc85=_[_0xd425('0x40')](db[_0xd425('0x41')][_0xd425('0x42')],function(_0x588688){return{'name':_0x588688['fieldName'],'type':_0x588688['type'][_0xd425('0x43')]};});_0x59e326[_0xd425('0x44')]=_[_0xd425('0x40')](_0x48fc85,_0xd425('0x3d'));_0x59e326[_0xd425('0x45')]=_[_0xd425('0x46')](_0x58f36d[_0xd425('0x45')]);_0x59e326['filters']=_[_0xd425('0x47')](_0x59e326[_0xd425('0x44')],_0x59e326[_0xd425('0x45')]);_0x3cf540['attributes']=_[_0xd425('0x47')](_0x59e326[_0xd425('0x44')],qs[_0xd425('0x48')](_0x58f36d['query'][_0xd425('0x48')]));_0x3cf540[_0xd425('0x49')]=_0x3cf540[_0xd425('0x49')][_0xd425('0x4a')]?_0x3cf540['attributes']:_0x59e326[_0xd425('0x44')];if(!_0x58f36d[_0xd425('0x45')][_0xd425('0x4b')](_0xd425('0x4c'))){_0x3cf540[_0xd425('0x30')]=qs[_0xd425('0x30')](_0x58f36d[_0xd425('0x45')]['limit']);_0x3cf540[_0xd425('0x32')]=qs[_0xd425('0x32')](_0x58f36d['query'][_0xd425('0x32')]);}_0x3cf540['order']=qs['sort'](_0x58f36d[_0xd425('0x45')]['sort']);_0x3cf540[_0xd425('0x4d')]=qs['filters'](_[_0xd425('0x4e')](_0x58f36d[_0xd425('0x45')],_0x59e326[_0xd425('0x4f')]),_0x48fc85);if(_0x58f36d[_0xd425('0x45')][_0xd425('0x50')]){_0x3cf540['where']=_[_0xd425('0x51')](_0x3cf540['where'],{'$or':_[_0xd425('0x40')](_0x48fc85,function(_0x55a15d){if(_0x55a15d[_0xd425('0x52')]!==_0xd425('0x53')){var _0x3fd2ce={};_0x3fd2ce[_0x55a15d[_0xd425('0x3d')]]={'$like':'%'+_0x58f36d[_0xd425('0x45')]['filter']+'%'};return _0x3fd2ce;}})});}_0x3cf540=_[_0xd425('0x51')]({},_0x3cf540,_0x58f36d[_0xd425('0x54')]);var _0x35e77b={'where':_0x3cf540[_0xd425('0x4d')]};return db[_0xd425('0x41')]['count'](_0x35e77b)[_0xd425('0x21')](function(_0x177704){_0x5d310e[_0xd425('0x31')]=_0x177704;if(_0x58f36d[_0xd425('0x45')][_0xd425('0x55')]){_0x3cf540[_0xd425('0x56')]=[{'all':!![]}];}return db['Trunk'][_0xd425('0x57')](_0x3cf540);})[_0xd425('0x21')](function(_0x5bfac6){_0x5d310e[_0xd425('0x58')]=_0x5bfac6;return _0x5d310e;})[_0xd425('0x21')](respondWithFilteredResult(_0x1d38fa,_0x3cf540))[_0xd425('0x2b')](handleError(_0x1d38fa,null));};exports[_0xd425('0x59')]=function(_0x5c0219,_0x54f1d){var _0x2b8882={'raw':![],'where':{'id':_0x5c0219[_0xd425('0x5a')]['id']}},_0x4552cd={};_0x4552cd[_0xd425('0x44')]=_['keys'](db['Trunk'][_0xd425('0x42')]);_0x4552cd['query']=_[_0xd425('0x46')](_0x5c0219[_0xd425('0x45')]);_0x4552cd['filters']=_[_0xd425('0x47')](_0x4552cd['model'],_0x4552cd['query']);_0x2b8882[_0xd425('0x49')]=_[_0xd425('0x47')](_0x4552cd[_0xd425('0x44')],qs[_0xd425('0x48')](_0x5c0219[_0xd425('0x45')][_0xd425('0x48')]));_0x2b8882[_0xd425('0x49')]=_0x2b8882[_0xd425('0x49')]['length']?_0x2b8882[_0xd425('0x49')]:_0x4552cd[_0xd425('0x44')];if(_0x5c0219[_0xd425('0x45')][_0xd425('0x55')]){_0x2b8882[_0xd425('0x56')]=[{'all':!![]}];}_0x2b8882=_[_0xd425('0x51')]({},_0x2b8882,_0x5c0219[_0xd425('0x54')]);return db[_0xd425('0x41')]['find'](_0x2b8882)['then'](handleEntityNotFound(_0x54f1d,null))['then'](respondWithResult(_0x54f1d,null))[_0xd425('0x2b')](handleError(_0x54f1d,null));};exports[_0xd425('0x5b')]=function(_0x3dec61,_0x3c6b49){var _0x59c286={'where':{'id':_0x3dec61['params']['id']}},_0x4fedc0={};_0x4fedc0['model']=_[_0xd425('0x46')](db[_0xd425('0x41')]['rawAttributes']);_0x59c286[_0xd425('0x49')]=_[_0xd425('0x47')](_0x4fedc0[_0xd425('0x44')],qs['fields'](_0x3dec61['query'][_0xd425('0x48')]));_0x59c286['attributes']=_0x59c286['attributes']['length']?_0x59c286[_0xd425('0x49')]:_0x4fedc0[_0xd425('0x44')];if(_0x3dec61[_0xd425('0x45')]['includeAll']){_0x59c286[_0xd425('0x56')]=[{'all':!![]}];}_0x59c286=_['merge']({},_0x59c286,_0x3dec61[_0xd425('0x54')]);return db[_0xd425('0x41')][_0xd425('0x5c')](_0x59c286)[_0xd425('0x21')](handleEntityNotFound(_0x3c6b49,null))[_0xd425('0x21')](function(_0xd261a){if(_0xd261a){var _0xa21f7c=_0xd261a[_0xd425('0x39')]({'plain':!![]});_0xa21f7c=qs[_0xd425('0x5d')](_0xa21f7c,['id','createdAt',_0xd425('0x5e')]);_0x3dec61[_0xd425('0x5f')]=_[_0xd425('0x5d')](_0x3dec61[_0xd425('0x5f')],['id','createdAt','updatedAt']);return db[_0xd425('0x41')][_0xd425('0x60')](_[_0xd425('0x51')](_0xa21f7c,_0x3dec61[_0xd425('0x5f')]),{'include':_0x3dec61[_0xd425('0x45')][_0xd425('0x55')]?[{'all':!![]}]:undefined})[_0xd425('0x21')](function(_0x44782a){var _0x1fcde4=_0x3dec61[_0xd425('0x61')][_0xd425('0x39')]({'plain':!![]});if(!_0x1fcde4)throw new Error(_0xd425('0x62'));if(_0x1fcde4[_0xd425('0x63')]===_0xd425('0x61')){var _0x5e72db=_0x44782a[_0xd425('0x39')]({'plain':!![]});var _0x343cc1=_0xd425('0x3a');return db['UserProfileSection']['find']({'where':{'name':_0x343cc1,'userProfileId':_0x1fcde4['userProfileId']},'raw':!![]})[_0xd425('0x21')](function(_0x34d065){if(_0x34d065&&_0x34d065[_0xd425('0x64')]===0x0){return db['UserProfileResource'][_0xd425('0x60')]({'name':_0x5e72db['name'],'resourceId':_0x5e72db['id'],'type':_0x34d065[_0xd425('0x3d')],'sectionId':_0x34d065['id']},{})[_0xd425('0x21')](function(){return _0x44782a;});}else{return _0x44782a;}})[_0xd425('0x2b')](function(_0x5113fc){logger[_0xd425('0x26')](_0xd425('0x65'),_0x5113fc);throw _0x5113fc;});}return _0x44782a;});}})[_0xd425('0x21')](respondWithResult(_0x3c6b49,0xc9))[_0xd425('0x2b')](handleError(_0x3c6b49,null));};exports[_0xd425('0x60')]=function(_0x43b1a9,_0x38a762,_0x44db7f){var _0xcb1a64;return db[_0xd425('0x41')][_0xd425('0x60')](_0x43b1a9[_0xd425('0x5f')],{'raw':!![]})[_0xd425('0x21')](function(_0x285d54){_0xcb1a64=_0x285d54;return db[_0xd425('0x41')][_0xd425('0x57')]({'raw':!![]});})[_0xd425('0x21')](function(_0x25cae6){var _0x541218=fs['readFileSync'](path[_0xd425('0x66')](config['root'],_0xd425('0x67')),_0xd425('0x68'));var _0xb407bb=fs[_0xd425('0x69')](path['join'](config[_0xd425('0x6a')],_0xd425('0x6b')),_0xd425('0x68'));var _0x689332=ejs[_0xd425('0x6c')](_0x541218,{'trunks':_0x25cae6||[]});fs[_0xd425('0x6d')]('/etc/asterisk/sip_xcally_trunks.conf',_0x689332);if(_0xcb1a64['registry']){var _0x3ccffe=ejs[_0xd425('0x6c')](_0xb407bb,{'trunks':_0x25cae6||[]});fs['writeFileSync'](_0xd425('0x6e'),_0x3ccffe);}})['then'](function(){return respondWithRpcPromise(_0xd425('0x6f'),_0xd425('0x60'),{'module':_0xd425('0x70')});})[_0xd425('0x21')](function(){var _0x376134=_0x43b1a9[_0xd425('0x61')][_0xd425('0x39')]({'plain':!![]});if(!_0x376134)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x376134[_0xd425('0x63')]===_0xd425('0x61')){var _0x24af3=_0xcb1a64[_0xd425('0x39')]({'plain':!![]});return db[_0xd425('0x71')]['find']({'where':{'name':_0xd425('0x3a'),'userProfileId':_0x376134[_0xd425('0x72')]},'raw':!![]})['then'](function(_0x2bb36f){if(_0x2bb36f&&_0x2bb36f[_0xd425('0x64')]===0x0){return db['UserProfileResource'][_0xd425('0x60')]({'name':_0x24af3[_0xd425('0x3d')],'resourceId':_0x24af3['id'],'type':_0x2bb36f[_0xd425('0x3d')],'sectionId':_0x2bb36f['id']},{})[_0xd425('0x21')](function(){return _0xcb1a64;});}else{return _0xcb1a64;}})[_0xd425('0x2b')](function(_0x572f23){logger[_0xd425('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x572f23);throw _0x572f23;});}return _0xcb1a64;})[_0xd425('0x21')](respondWithResult(_0x38a762,0xc9))[_0xd425('0x2b')](handleError(_0x38a762,null));};exports['update']=function(_0x2bf8e6,_0xcf7b51,_0x66d87b){var _0x1fc64d;return db['Trunk']['find']({'where':{'id':_0x2bf8e6[_0xd425('0x5a')]['id']}})[_0xd425('0x21')](handleEntityNotFound(_0xcf7b51,null))[_0xd425('0x21')](saveUpdates(_0x2bf8e6['body'],null))[_0xd425('0x21')](function(_0xb1479e){if(_0xb1479e){_0x1fc64d=_0xb1479e;return db['Trunk'][_0xd425('0x57')]({'raw':!![]});}})['then'](function(_0x998ad1){if(_0x998ad1){var _0x46346c=fs[_0xd425('0x69')](path[_0xd425('0x66')](config['root'],'server/files/templates/trunk.ejs'),_0xd425('0x68'));var _0x413a65=fs['readFileSync'](path[_0xd425('0x66')](config[_0xd425('0x6a')],'server/files/templates/registry.ejs'),_0xd425('0x68'));var _0x369f8b=ejs[_0xd425('0x6c')](_0x46346c,{'trunks':_0x998ad1||[]});fs[_0xd425('0x6d')](_0xd425('0x73'),_0x369f8b);var _0xf251e6=ejs[_0xd425('0x6c')](_0x413a65,{'trunks':_0x998ad1||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0xf251e6);return respondWithRpcPromise(_0xd425('0x6f'),'update',{'module':_0xd425('0x70')});}return null;})[_0xd425('0x21')](function(_0x58cad5){if(_0x58cad5){return _0x1fc64d;}})[_0xd425('0x21')](respondWithResult(_0xcf7b51,null))[_0xd425('0x2b')](handleError(_0xcf7b51,null));};exports['destroy']=function(_0x592c40,_0x750685,_0x242ed8){var _0x16eac6;return db[_0xd425('0x41')][_0xd425('0x5c')]({'where':{'id':_0x592c40[_0xd425('0x5a')]['id']}})[_0xd425('0x21')](handleEntityNotFound(_0x750685,null))[_0xd425('0x21')](removeEntity(_0x750685,null))['then'](function(){return db[_0xd425('0x41')][_0xd425('0x57')]({'raw':!![]});})['then'](function(_0x2bbcf3){var _0x1d386c=fs[_0xd425('0x69')](path[_0xd425('0x66')](config[_0xd425('0x6a')],_0xd425('0x67')),_0xd425('0x68'));var _0x2c3995=fs[_0xd425('0x69')](path[_0xd425('0x66')](config[_0xd425('0x6a')],'server/files/templates/registry.ejs'),_0xd425('0x68'));var _0x498e81=ejs['render'](_0x1d386c,{'trunks':_0x2bbcf3});var _0x2c8d63=ejs['render'](_0x2c3995,{'trunks':_0x2bbcf3});fs[_0xd425('0x6d')](_0xd425('0x73'),_0x498e81);fs[_0xd425('0x6d')](_0xd425('0x6e'),_0x2c8d63);return respondWithRpcPromise(_0xd425('0x6f'),_0xd425('0x74'),{'module':_0xd425('0x70')});})['catch'](handleError(_0x750685,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 28490c8..21f8e57 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 _0x5595=['rimraf','../../config/environment','./trunk.attributes','exports','Trunk','tools_trunks','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x1cf5d8,_0x2d66a4){var _0x1483fa=function(_0x358282){while(--_0x358282){_0x1cf5d8['push'](_0x1cf5d8['shift']());}};_0x1483fa(++_0x2d66a4);}(_0x5595,0xde));var _0x5559=function(_0x302482,_0x46d0c7){_0x302482=_0x302482-0x0;var _0x12ba81=_0x5595[_0x302482];return _0x12ba81;};'use strict';var _=require(_0x5559('0x0'));var util=require('util');var logger=require(_0x5559('0x1'))('api');var moment=require(_0x5559('0x2'));var BPromise=require(_0x5559('0x3'));var rp=require(_0x5559('0x4'));var fs=require('fs');var path=require(_0x5559('0x5'));var rimraf=require(_0x5559('0x6'));var config=require(_0x5559('0x7'));var attributes=require(_0x5559('0x8'));module[_0x5559('0x9')]=function(_0x36474d,_0x47bead){return _0x36474d['define'](_0x5559('0xa'),attributes,{'tableName':_0x5559('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7fab=['../../config/environment','./trunk.attributes','exports','define','Trunk','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x4897c1,_0x8cfd96){var _0x471c87=function(_0x4e380b){while(--_0x4e380b){_0x4897c1['push'](_0x4897c1['shift']());}};_0x471c87(++_0x8cfd96);}(_0x7fab,0x14f));var _0xb7fa=function(_0x11cbbd,_0x5d4106){_0x11cbbd=_0x11cbbd-0x0;var _0x153af2=_0x7fab[_0x11cbbd];return _0x153af2;};'use strict';var _=require('lodash');var util=require(_0xb7fa('0x0'));var logger=require(_0xb7fa('0x1'))('api');var moment=require(_0xb7fa('0x2'));var BPromise=require(_0xb7fa('0x3'));var rp=require(_0xb7fa('0x4'));var fs=require('fs');var path=require(_0xb7fa('0x5'));var rimraf=require('rimraf');var config=require(_0xb7fa('0x6'));var attributes=require(_0xb7fa('0x7'));module[_0xb7fa('0x8')]=function(_0x17c7ea,_0x1e2b8d){return _0x17c7ea[_0xb7fa('0x9')](_0xb7fa('0xa'),attributes,{'tableName':'tools_trunks','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 7d0456d..08bfc82 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 _0xf681=['ShowTrunk','find','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTrunk','Trunk','findAll','options','raw','where','limit','include','map','attributes','model'];(function(_0x49178b,_0x3a882b){var _0x2d73cc=function(_0x2e29aa){while(--_0x2e29aa){_0x49178b['push'](_0x49178b['shift']());}};_0x2d73cc(++_0x3a882b);}(_0xf681,0x6e));var _0x1f68=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xf681[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require(_0x1f68('0x0'));var moment=require(_0x1f68('0x1'));var BPromise=require(_0x1f68('0x2'));var rs=require(_0x1f68('0x3'));var fs=require('fs');var Redis=require(_0x1f68('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1f68('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x1f68('0x6'));var jayson=require(_0x1f68('0x7'));var client=jayson[_0x1f68('0x8')][_0x1f68('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x345375,_0x14522c,_0x2983a5){return new BPromise(function(_0x34761a,_0x5f1c0c){return client[_0x1f68('0xa')](_0x345375,_0x2983a5)[_0x1f68('0xb')](function(_0x18ea1c){logger[_0x1f68('0xc')](_0x1f68('0xd'),_0x14522c,_0x1f68('0xe'));logger[_0x1f68('0xf')](_0x1f68('0x10'),_0x14522c,_0x1f68('0xe'),JSON[_0x1f68('0x11')](_0x18ea1c));if(_0x18ea1c[_0x1f68('0x12')]){if(_0x18ea1c[_0x1f68('0x12')][_0x1f68('0x13')]===0x1f4){logger[_0x1f68('0x12')](_0x1f68('0xd'),_0x14522c,_0x18ea1c[_0x1f68('0x12')][_0x1f68('0x14')]);return _0x5f1c0c(_0x18ea1c[_0x1f68('0x12')][_0x1f68('0x14')]);}logger[_0x1f68('0x12')](_0x1f68('0xd'),_0x14522c,_0x18ea1c[_0x1f68('0x12')]['message']);return _0x34761a(_0x18ea1c[_0x1f68('0x12')]['message']);}else{logger[_0x1f68('0xc')](_0x1f68('0xd'),_0x14522c,_0x1f68('0xe'));_0x34761a(_0x18ea1c[_0x1f68('0x15')][_0x1f68('0x14')]);}})[_0x1f68('0x16')](function(_0x1761d6){logger[_0x1f68('0x12')](_0x1f68('0xd'),_0x14522c,_0x1761d6);_0x5f1c0c(_0x1761d6);});});}exports[_0x1f68('0x17')]=function(_0x521350){var _0x3a26f4=this;return new Promise(function(_0x55b5f4,_0x2f996e){return db[_0x1f68('0x18')][_0x1f68('0x19')]({'raw':_0x521350[_0x1f68('0x1a')]?_0x521350[_0x1f68('0x1a')][_0x1f68('0x1b')]===undefined?!![]:![]:!![],'where':_0x521350[_0x1f68('0x1a')]?_0x521350['options'][_0x1f68('0x1c')]||null:null,'attributes':_0x521350['options']?_0x521350[_0x1f68('0x1a')]['attributes']||null:null,'limit':_0x521350[_0x1f68('0x1a')]?_0x521350[_0x1f68('0x1a')][_0x1f68('0x1d')]||null:null,'include':_0x521350[_0x1f68('0x1a')]?_0x521350[_0x1f68('0x1a')][_0x1f68('0x1e')]?_[_0x1f68('0x1f')](_0x521350[_0x1f68('0x1a')][_0x1f68('0x1e')],function(_0x40ad4c){return{'model':db[_0x40ad4c['model']],'as':_0x40ad4c['as'],'attributes':_0x40ad4c[_0x1f68('0x20')],'include':_0x40ad4c[_0x1f68('0x1e')]?_[_0x1f68('0x1f')](_0x40ad4c[_0x1f68('0x1e')],function(_0x3be59b){return{'model':db[_0x3be59b[_0x1f68('0x21')]],'as':_0x3be59b['as'],'attributes':_0x3be59b['attributes'],'include':_0x3be59b[_0x1f68('0x1e')]?_[_0x1f68('0x1f')](_0x3be59b['include'],function(_0x2dad95){return{'model':db[_0x2dad95['model']],'as':_0x2dad95['as'],'attributes':_0x2dad95[_0x1f68('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x935681){logger[_0x1f68('0xc')](_0x1f68('0x17'),_0x521350);logger[_0x1f68('0xf')](_0x1f68('0x17'),_0x521350,JSON[_0x1f68('0x11')](_0x935681));_0x55b5f4(_0x935681);})['catch'](function(_0x58b2ff){logger['error'](_0x1f68('0x17'),_0x58b2ff[_0x1f68('0x14')],_0x521350);_0x2f996e(_0x3a26f4[_0x1f68('0x12')](0x1f4,_0x58b2ff[_0x1f68('0x14')]));});});};exports[_0x1f68('0x22')]=function(_0x3040da){var _0x4729fa=this;return new Promise(function(_0xfbe188,_0xf6ca83){return db[_0x1f68('0x18')][_0x1f68('0x23')]({'raw':_0x3040da[_0x1f68('0x1a')]?_0x3040da[_0x1f68('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x3040da[_0x1f68('0x1a')]?_0x3040da[_0x1f68('0x1a')]['where']||null:null,'attributes':_0x3040da[_0x1f68('0x1a')]?_0x3040da[_0x1f68('0x1a')][_0x1f68('0x20')]||null:null,'include':_0x3040da[_0x1f68('0x1a')]?_0x3040da[_0x1f68('0x1a')][_0x1f68('0x1e')]?_[_0x1f68('0x1f')](_0x3040da[_0x1f68('0x1a')][_0x1f68('0x1e')],function(_0x4c024d){return{'model':db[_0x4c024d[_0x1f68('0x21')]],'as':_0x4c024d['as'],'attributes':_0x4c024d[_0x1f68('0x20')],'include':_0x4c024d[_0x1f68('0x1e')]?_[_0x1f68('0x1f')](_0x4c024d[_0x1f68('0x1e')],function(_0x44a549){return{'model':db[_0x44a549[_0x1f68('0x21')]],'as':_0x44a549['as'],'attributes':_0x44a549[_0x1f68('0x20')],'include':_0x44a549[_0x1f68('0x1e')]?_['map'](_0x44a549[_0x1f68('0x1e')],function(_0x5bdbe6){return{'model':db[_0x5bdbe6[_0x1f68('0x21')]],'as':_0x5bdbe6['as'],'attributes':_0x5bdbe6[_0x1f68('0x20')]};}):[]};}):[]};}):[]:[]})[_0x1f68('0xb')](function(_0x3c4ec9){logger[_0x1f68('0xc')](_0x1f68('0x22'),_0x3040da);logger[_0x1f68('0xf')](_0x1f68('0x22'),_0x3040da,JSON['stringify'](_0x3c4ec9));_0xfbe188(_0x3c4ec9);})[_0x1f68('0x16')](function(_0x443915){logger[_0x1f68('0x12')](_0x1f68('0x22'),_0x443915[_0x1f68('0x14')],_0x3040da);_0xf6ca83(_0x4729fa[_0x1f68('0x12')](0x1f4,_0x443915[_0x1f68('0x14')]));});});}; \ No newline at end of file +var _0x5599=['find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','GetTrunk','Trunk','findAll','options','raw','include','map','attributes','model','stringify','ShowTrunk'];(function(_0x146f3d,_0x4d1d05){var _0x61c6f9=function(_0x2e03fb){while(--_0x2e03fb){_0x146f3d['push'](_0x146f3d['shift']());}};_0x61c6f9(++_0x4d1d05);}(_0x5599,0x1a6));var _0x9559=function(_0x587fdb,_0x50dd97){_0x587fdb=_0x587fdb-0x0;var _0x38ae8e=_0x5599[_0x587fdb];return _0x38ae8e;};'use strict';var _=require(_0x9559('0x0'));var util=require(_0x9559('0x1'));var moment=require(_0x9559('0x2'));var BPromise=require(_0x9559('0x3'));var rs=require(_0x9559('0x4'));var fs=require('fs');var Redis=require(_0x9559('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9559('0x6'));var logger=require(_0x9559('0x7'))('rpc');var config=require(_0x9559('0x8'));var jayson=require(_0x9559('0x9'));var client=jayson[_0x9559('0xa')][_0x9559('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x370ed5,_0x56d2cf,_0x20f2d3){return new BPromise(function(_0x3d9681,_0x30a866){return client[_0x9559('0xc')](_0x370ed5,_0x20f2d3)[_0x9559('0xd')](function(_0x58fd42){logger[_0x9559('0xe')](_0x9559('0xf'),_0x56d2cf,_0x9559('0x10'));logger[_0x9559('0x11')]('Trunk,\x20%s,\x20%s,\x20%s',_0x56d2cf,_0x9559('0x10'),JSON['stringify'](_0x58fd42));if(_0x58fd42['error']){if(_0x58fd42[_0x9559('0x12')][_0x9559('0x13')]===0x1f4){logger[_0x9559('0x12')](_0x9559('0xf'),_0x56d2cf,_0x58fd42[_0x9559('0x12')][_0x9559('0x14')]);return _0x30a866(_0x58fd42[_0x9559('0x12')]['message']);}logger[_0x9559('0x12')](_0x9559('0xf'),_0x56d2cf,_0x58fd42['error'][_0x9559('0x14')]);return _0x3d9681(_0x58fd42[_0x9559('0x12')][_0x9559('0x14')]);}else{logger[_0x9559('0xe')](_0x9559('0xf'),_0x56d2cf,'request\x20sent');_0x3d9681(_0x58fd42['result']['message']);}})[_0x9559('0x15')](function(_0x3be3b7){logger[_0x9559('0x12')](_0x9559('0xf'),_0x56d2cf,_0x3be3b7);_0x30a866(_0x3be3b7);});});}exports[_0x9559('0x16')]=function(_0x5c4469){var _0x301a9b=this;return new Promise(function(_0x1202e1,_0x474fdd){return db[_0x9559('0x17')][_0x9559('0x18')]({'raw':_0x5c4469[_0x9559('0x19')]?_0x5c4469[_0x9559('0x19')][_0x9559('0x1a')]===undefined?!![]:![]:!![],'where':_0x5c4469[_0x9559('0x19')]?_0x5c4469[_0x9559('0x19')]['where']||null:null,'attributes':_0x5c4469[_0x9559('0x19')]?_0x5c4469[_0x9559('0x19')]['attributes']||null:null,'limit':_0x5c4469[_0x9559('0x19')]?_0x5c4469[_0x9559('0x19')]['limit']||null:null,'include':_0x5c4469[_0x9559('0x19')]?_0x5c4469[_0x9559('0x19')][_0x9559('0x1b')]?_[_0x9559('0x1c')](_0x5c4469[_0x9559('0x19')][_0x9559('0x1b')],function(_0x5c5fa3){return{'model':db[_0x5c5fa3['model']],'as':_0x5c5fa3['as'],'attributes':_0x5c5fa3[_0x9559('0x1d')],'include':_0x5c5fa3['include']?_[_0x9559('0x1c')](_0x5c5fa3[_0x9559('0x1b')],function(_0x24e56d){return{'model':db[_0x24e56d[_0x9559('0x1e')]],'as':_0x24e56d['as'],'attributes':_0x24e56d[_0x9559('0x1d')],'include':_0x24e56d['include']?_[_0x9559('0x1c')](_0x24e56d['include'],function(_0x2c8a39){return{'model':db[_0x2c8a39[_0x9559('0x1e')]],'as':_0x2c8a39['as'],'attributes':_0x2c8a39[_0x9559('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9559('0xd')](function(_0x250c47){logger['info'](_0x9559('0x16'),_0x5c4469);logger[_0x9559('0x11')](_0x9559('0x16'),_0x5c4469,JSON[_0x9559('0x1f')](_0x250c47));_0x1202e1(_0x250c47);})['catch'](function(_0xccac13){logger[_0x9559('0x12')](_0x9559('0x16'),_0xccac13[_0x9559('0x14')],_0x5c4469);_0x474fdd(_0x301a9b[_0x9559('0x12')](0x1f4,_0xccac13[_0x9559('0x14')]));});});};exports[_0x9559('0x20')]=function(_0x24a8f1){var _0xe34727=this;return new Promise(function(_0x48b757,_0x25bc30){return db[_0x9559('0x17')][_0x9559('0x21')]({'raw':_0x24a8f1[_0x9559('0x19')]?_0x24a8f1[_0x9559('0x19')][_0x9559('0x1a')]===undefined?!![]:![]:!![],'where':_0x24a8f1['options']?_0x24a8f1['options'][_0x9559('0x22')]||null:null,'attributes':_0x24a8f1[_0x9559('0x19')]?_0x24a8f1[_0x9559('0x19')][_0x9559('0x1d')]||null:null,'include':_0x24a8f1[_0x9559('0x19')]?_0x24a8f1[_0x9559('0x19')][_0x9559('0x1b')]?_[_0x9559('0x1c')](_0x24a8f1['options'][_0x9559('0x1b')],function(_0x3bc813){return{'model':db[_0x3bc813[_0x9559('0x1e')]],'as':_0x3bc813['as'],'attributes':_0x3bc813['attributes'],'include':_0x3bc813[_0x9559('0x1b')]?_[_0x9559('0x1c')](_0x3bc813[_0x9559('0x1b')],function(_0x2e3662){return{'model':db[_0x2e3662[_0x9559('0x1e')]],'as':_0x2e3662['as'],'attributes':_0x2e3662[_0x9559('0x1d')],'include':_0x2e3662['include']?_[_0x9559('0x1c')](_0x2e3662['include'],function(_0x521159){return{'model':db[_0x521159[_0x9559('0x1e')]],'as':_0x521159['as'],'attributes':_0x521159[_0x9559('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9559('0xd')](function(_0x2bd2e5){logger[_0x9559('0xe')](_0x9559('0x20'),_0x24a8f1);logger[_0x9559('0x11')](_0x9559('0x20'),_0x24a8f1,JSON[_0x9559('0x1f')](_0x2bd2e5));_0x48b757(_0x2bd2e5);})['catch'](function(_0xa17fb4){logger[_0x9559('0x12')](_0x9559('0x20'),_0xa17fb4[_0x9559('0x14')],_0x24a8f1);_0x25bc30(_0xe34727[_0x9559('0x12')](0x1f4,_0xa17fb4[_0x9559('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 71cdc60..b00772b 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 _0x14b6=['removeSmsInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','isAuthenticated','index','get','/whoami','/presence','/:id','/:id/avatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','/:id/whatsapp/interactions','getTeams','getAgents','/:id/prefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','/create_many','bulkCreate','diskStorage','join','root','format','%s-%s','now','originalname','single','file','/:id/login','login','/:id/logout','logout','/:id/pause','/:id/unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addOpenchannelAccounts','addSmsAccounts','addWhatsappAccounts','/:id/square_projects','addSquareProjects','createApiKey','put','update','/:id/password','changePassword','delete','/:id/teams','removeTeams','removeMailInteractions','removeFaxInteractions'];(function(_0x3bd363,_0x128f0b){var _0x5ebc76=function(_0x1f3a18){while(--_0x1f3a18){_0x3bd363['push'](_0x3bd363['shift']());}};_0x5ebc76(++_0x128f0b);}(_0x14b6,0xeb));var _0x614b=function(_0x1d3244,_0x130236){_0x1d3244=_0x1d3244-0x0;var _0x5b62b3=_0x14b6[_0x1d3244];return _0x5b62b3;};'use strict';var multer=require(_0x614b('0x0'));var util=require(_0x614b('0x1'));var path=require(_0x614b('0x2'));var timeout=require(_0x614b('0x3'));var express=require('express');var router=express[_0x614b('0x4')]();var fs_extra=require(_0x614b('0x5'));var auth=require(_0x614b('0x6'));var interaction=require(_0x614b('0x7'));var config=require(_0x614b('0x8'));var controller=require(_0x614b('0x9'));router['get']('/',auth[_0x614b('0xa')](),controller[_0x614b('0xb')]);router['get']('/describe',auth[_0x614b('0xa')](),controller['describe']);router[_0x614b('0xc')](_0x614b('0xd'),auth['isAuthenticated'](),controller['whoami']);router[_0x614b('0xc')](_0x614b('0xe'),auth[_0x614b('0xa')](),controller['getPresence']);router['get'](_0x614b('0xf'),auth[_0x614b('0xa')](),controller['show']);router[_0x614b('0xc')](_0x614b('0x10'),controller['getAvatar']);router[_0x614b('0xc')](_0x614b('0x11'),auth['isAuthenticated'](),controller[_0x614b('0x12')]);router['get'](_0x614b('0x13'),auth['isAuthenticated'](),controller[_0x614b('0x14')]);router[_0x614b('0xc')](_0x614b('0x15'),auth[_0x614b('0xa')](),controller[_0x614b('0x16')]);router[_0x614b('0xc')](_0x614b('0x17'),auth['isAuthenticated'](),controller[_0x614b('0x18')]);router[_0x614b('0xc')](_0x614b('0x19'),auth[_0x614b('0xa')](),controller['getGroups']);router['get'](_0x614b('0x1a'),auth['isAuthenticated'](),controller[_0x614b('0x1b')]);router[_0x614b('0xc')](_0x614b('0x1c'),auth[_0x614b('0xa')](),controller[_0x614b('0x1d')]);router[_0x614b('0xc')](_0x614b('0x1e'),auth[_0x614b('0xa')](),controller[_0x614b('0x1f')]);router[_0x614b('0xc')](_0x614b('0x20'),auth[_0x614b('0xa')](),controller[_0x614b('0x21')]);router[_0x614b('0xc')](_0x614b('0x22'),auth[_0x614b('0xa')](),controller['getMailInteractions']);router[_0x614b('0xc')](_0x614b('0x23'),auth['isAuthenticated'](),controller[_0x614b('0x24')]);router[_0x614b('0xc')](_0x614b('0x25'),auth[_0x614b('0xa')](),controller['getFaxInteractions']);router['get'](_0x614b('0x26'),auth[_0x614b('0xa')](),controller['getWhatsappInteractions']);router['get']('/:id/teams',auth[_0x614b('0xa')](),controller[_0x614b('0x27')]);router[_0x614b('0xc')]('/:id/lists',auth[_0x614b('0xa')](),controller['getLists']);router[_0x614b('0xc')]('/:id/agents',auth[_0x614b('0xa')](),controller[_0x614b('0x28')]);router[_0x614b('0xc')](_0x614b('0x29'),auth[_0x614b('0xa')](),controller['getVoicePrefixes']);router[_0x614b('0xc')](_0x614b('0x2a'),auth[_0x614b('0xa')](),controller[_0x614b('0x2b')]);router[_0x614b('0xc')](_0x614b('0x2c'),auth[_0x614b('0xa')](),controller[_0x614b('0x2d')]);router[_0x614b('0xc')](_0x614b('0x2e'),auth['isAuthenticated'](),controller[_0x614b('0x2f')]);router[_0x614b('0xc')](_0x614b('0x30'),auth[_0x614b('0xa')](),controller['getSmsAccounts']);router[_0x614b('0xc')](_0x614b('0x31'),auth['isAuthenticated'](),controller[_0x614b('0x32')]);router[_0x614b('0xc')](_0x614b('0x33'),auth[_0x614b('0xa')](),controller[_0x614b('0x34')]);router[_0x614b('0xc')]('/:id/square_projects',auth['isAuthenticated'](),controller[_0x614b('0x35')]);router[_0x614b('0xc')](_0x614b('0x36'),auth[_0x614b('0xa')](),controller[_0x614b('0x37')]);router[_0x614b('0xc')](_0x614b('0x38'),auth[_0x614b('0xa')](),controller[_0x614b('0x39')]);router[_0x614b('0x3a')](_0x614b('0x13'),auth['isAuthenticated'](),controller[_0x614b('0x3b')]);router[_0x614b('0x3a')]('/',auth[_0x614b('0xa')](),controller['create']);router['post'](_0x614b('0x3c'),auth[_0x614b('0xa')](),controller[_0x614b('0x3d')]);router[_0x614b('0x3a')](_0x614b('0x15'),auth[_0x614b('0xa')](),controller['addQueues']);var upload=multer({'storage':multer[_0x614b('0x3e')]({'destination':function(_0x2a7d78,_0x1c5e2b,_0x297381){_0x297381(null,path[_0x614b('0x3f')](config[_0x614b('0x40')],'server/files/images/'));},'filename':function(_0x407ebc,_0x917e33,_0x5dfe98){_0x5dfe98(null,util[_0x614b('0x41')](_0x614b('0x42'),Date[_0x614b('0x43')](),_0x917e33[_0x614b('0x44')]));}})});router[_0x614b('0x3a')](_0x614b('0x10'),upload[_0x614b('0x45')](_0x614b('0x46')),controller['addAvatar']);router[_0x614b('0x3a')](_0x614b('0x47'),auth[_0x614b('0xa')](),controller[_0x614b('0x48')]);router['post'](_0x614b('0x49'),auth[_0x614b('0xa')](),controller[_0x614b('0x4a')]);router[_0x614b('0x3a')](_0x614b('0x4b'),auth[_0x614b('0xa')](),controller['pause']);router['post'](_0x614b('0x4c'),auth[_0x614b('0xa')](),controller['unpause']);router[_0x614b('0x3a')]('/:id/teams',auth[_0x614b('0xa')](),controller[_0x614b('0x4d')]);router[_0x614b('0x3a')](_0x614b('0x4e'),auth[_0x614b('0xa')](),controller[_0x614b('0x4f')]);router[_0x614b('0x3a')](_0x614b('0x50'),auth[_0x614b('0xa')](),controller[_0x614b('0x51')]);router[_0x614b('0x3a')](_0x614b('0x52'),auth[_0x614b('0xa')](),controller[_0x614b('0x53')]);router['post']('/:id/sms_interactions',auth[_0x614b('0xa')](),controller['addSmsInteractions']);router[_0x614b('0x3a')](_0x614b('0x54'),auth[_0x614b('0xa')](),controller[_0x614b('0x55')]);router['post'](_0x614b('0x56'),auth['isAuthenticated'](),controller[_0x614b('0x57')]);router[_0x614b('0x3a')]('/:id/fax_accounts',auth[_0x614b('0xa')](),controller[_0x614b('0x58')]);router[_0x614b('0x3a')](_0x614b('0x2c'),auth[_0x614b('0xa')](),controller['addMailAccounts']);router[_0x614b('0x3a')](_0x614b('0x2e'),auth['isAuthenticated'](),controller[_0x614b('0x59')]);router[_0x614b('0x3a')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0x614b('0x5a')]);router[_0x614b('0x3a')](_0x614b('0x31'),auth['isAuthenticated'](),controller['addChatWebsites']);router[_0x614b('0x3a')](_0x614b('0x33'),auth[_0x614b('0xa')](),controller[_0x614b('0x5b')]);router[_0x614b('0x3a')](_0x614b('0x5c'),auth[_0x614b('0xa')](),controller[_0x614b('0x5d')]);router[_0x614b('0x3a')](_0x614b('0x38'),auth['isAuthenticated'](),controller[_0x614b('0x5e')]);router[_0x614b('0x5f')](_0x614b('0xf'),auth[_0x614b('0xa')](),controller[_0x614b('0x60')]);router[_0x614b('0x5f')](_0x614b('0x61'),auth['isAuthenticated'](),controller[_0x614b('0x62')]);router[_0x614b('0x63')]('/:id/queues',auth['isAuthenticated'](),controller['removeQueues']);router['delete'](_0x614b('0x64'),auth[_0x614b('0xa')](),controller[_0x614b('0x65')]);router[_0x614b('0x63')](_0x614b('0xf'),auth[_0x614b('0xa')](),controller['destroy']);router[_0x614b('0x63')](_0x614b('0x4e'),auth[_0x614b('0xa')](),controller['removeChatInteractions']);router[_0x614b('0x63')](_0x614b('0x50'),auth[_0x614b('0xa')](),controller[_0x614b('0x66')]);router[_0x614b('0x63')]('/:id/fax_interactions',auth[_0x614b('0xa')](),controller[_0x614b('0x67')]);router[_0x614b('0x63')]('/:id/sms_interactions',auth[_0x614b('0xa')](),controller[_0x614b('0x68')]);router['delete'](_0x614b('0x54'),auth[_0x614b('0xa')](),controller['removeOpenchannelInteractions']);router[_0x614b('0x63')](_0x614b('0x56'),auth['isAuthenticated'](),controller['removeWhatsappInteractions']);router[_0x614b('0x63')](_0x614b('0x2a'),auth[_0x614b('0xa')](),controller[_0x614b('0x69')]);router[_0x614b('0x63')](_0x614b('0x2c'),auth[_0x614b('0xa')](),controller[_0x614b('0x6a')]);router[_0x614b('0x63')](_0x614b('0x2e'),auth[_0x614b('0xa')](),controller[_0x614b('0x6b')]);router['delete'](_0x614b('0x30'),auth[_0x614b('0xa')](),controller[_0x614b('0x6c')]);router[_0x614b('0x63')](_0x614b('0x31'),auth[_0x614b('0xa')](),controller[_0x614b('0x6d')]);router[_0x614b('0x63')](_0x614b('0x33'),auth[_0x614b('0xa')](),controller[_0x614b('0x6e')]);router[_0x614b('0x63')](_0x614b('0x5c'),auth[_0x614b('0xa')](),controller['removeSquareProjects']);router[_0x614b('0x63')](_0x614b('0x38'),auth[_0x614b('0xa')](),controller[_0x614b('0x6f')]);module[_0x614b('0x70')]=router; \ No newline at end of file +var _0x5ac8=['/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getAgents','getVoicePrefixes','/:id/fax_accounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','create','post','bulkCreate','addQueues','diskStorage','join','root','server/files/images/','%s-%s','single','file','addAvatar','/:id/login','login','/:id/logout','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','/:id/chat_websites','addChatWebsites','addWhatsappAccounts','addSquareProjects','createApiKey','update','put','/:id/password','changePassword','delete','removeTeams','destroy','/:id/mail_interactions','removeMailInteractions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','/whoami','whoami','/presence','getPresence','/:id','show','getAvatar'];(function(_0x1a5b97,_0x1f03f3){var _0x5d3683=function(_0x43b7d1){while(--_0x43b7d1){_0x1a5b97['push'](_0x1a5b97['shift']());}};_0x5d3683(++_0x1f03f3);}(_0x5ac8,0x1c5));var _0x85ac=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5ac8[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x85ac('0x0'));var util=require(_0x85ac('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x85ac('0x2'));var router=express[_0x85ac('0x3')]();var fs_extra=require(_0x85ac('0x4'));var auth=require(_0x85ac('0x5'));var interaction=require(_0x85ac('0x6'));var config=require(_0x85ac('0x7'));var controller=require('./user.controller');router[_0x85ac('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x85ac('0x8')](_0x85ac('0x9'),auth[_0x85ac('0xa')](),controller[_0x85ac('0xb')]);router['get'](_0x85ac('0xc'),auth['isAuthenticated'](),controller[_0x85ac('0xd')]);router['get'](_0x85ac('0xe'),auth[_0x85ac('0xa')](),controller[_0x85ac('0xf')]);router[_0x85ac('0x8')](_0x85ac('0x10'),auth[_0x85ac('0xa')](),controller[_0x85ac('0x11')]);router['get']('/:id/avatar',controller[_0x85ac('0x12')]);router['get'](_0x85ac('0x13'),auth[_0x85ac('0xa')](),controller[_0x85ac('0x14')]);router['get'](_0x85ac('0x15'),auth[_0x85ac('0xa')](),controller[_0x85ac('0x16')]);router[_0x85ac('0x8')](_0x85ac('0x17'),auth['isAuthenticated'](),controller[_0x85ac('0x18')]);router['get'](_0x85ac('0x19'),auth[_0x85ac('0xa')](),controller[_0x85ac('0x1a')]);router[_0x85ac('0x8')](_0x85ac('0x1b'),auth['isAuthenticated'](),controller[_0x85ac('0x1c')]);router[_0x85ac('0x8')](_0x85ac('0x1d'),auth[_0x85ac('0xa')](),controller[_0x85ac('0x1e')]);router[_0x85ac('0x8')](_0x85ac('0x1f'),auth[_0x85ac('0xa')](),controller[_0x85ac('0x20')]);router[_0x85ac('0x8')](_0x85ac('0x21'),auth[_0x85ac('0xa')](),controller[_0x85ac('0x22')]);router[_0x85ac('0x8')]('/:id/openchannel/interactions',auth[_0x85ac('0xa')](),controller[_0x85ac('0x23')]);router['get']('/:id/mail/interactions',auth[_0x85ac('0xa')](),controller[_0x85ac('0x24')]);router[_0x85ac('0x8')](_0x85ac('0x25'),auth[_0x85ac('0xa')](),controller[_0x85ac('0x26')]);router[_0x85ac('0x8')](_0x85ac('0x27'),auth['isAuthenticated'](),controller[_0x85ac('0x28')]);router[_0x85ac('0x8')]('/:id/whatsapp/interactions',auth[_0x85ac('0xa')](),controller[_0x85ac('0x29')]);router[_0x85ac('0x8')](_0x85ac('0x2a'),auth['isAuthenticated'](),controller[_0x85ac('0x2b')]);router[_0x85ac('0x8')](_0x85ac('0x2c'),auth[_0x85ac('0xa')](),controller['getLists']);router[_0x85ac('0x8')]('/:id/agents',auth[_0x85ac('0xa')](),controller[_0x85ac('0x2d')]);router[_0x85ac('0x8')]('/:id/prefixes',auth[_0x85ac('0xa')](),controller[_0x85ac('0x2e')]);router[_0x85ac('0x8')](_0x85ac('0x2f'),auth[_0x85ac('0xa')](),controller['getFaxAccounts']);router[_0x85ac('0x8')](_0x85ac('0x30'),auth[_0x85ac('0xa')](),controller[_0x85ac('0x31')]);router[_0x85ac('0x8')](_0x85ac('0x32'),auth[_0x85ac('0xa')](),controller['getOpenchannelAccounts']);router[_0x85ac('0x8')](_0x85ac('0x33'),auth[_0x85ac('0xa')](),controller[_0x85ac('0x34')]);router['get']('/:id/chat_websites',auth[_0x85ac('0xa')](),controller[_0x85ac('0x35')]);router[_0x85ac('0x8')](_0x85ac('0x36'),auth[_0x85ac('0xa')](),controller[_0x85ac('0x37')]);router[_0x85ac('0x8')](_0x85ac('0x38'),auth['isAuthenticated'](),controller[_0x85ac('0x39')]);router[_0x85ac('0x8')](_0x85ac('0x3a'),auth[_0x85ac('0xa')](),controller[_0x85ac('0x3b')]);router['get'](_0x85ac('0x3c'),auth[_0x85ac('0xa')](),controller[_0x85ac('0x3d')]);router['post'](_0x85ac('0x15'),auth[_0x85ac('0xa')](),controller['addContacts']);router['post']('/',auth[_0x85ac('0xa')](),controller[_0x85ac('0x3e')]);router[_0x85ac('0x3f')]('/create_many',auth['isAuthenticated'](),controller[_0x85ac('0x40')]);router[_0x85ac('0x3f')]('/:id/queues',auth[_0x85ac('0xa')](),controller[_0x85ac('0x41')]);var upload=multer({'storage':multer[_0x85ac('0x42')]({'destination':function(_0x2dfe1b,_0x26fcc7,_0x580b64){_0x580b64(null,path[_0x85ac('0x43')](config[_0x85ac('0x44')],_0x85ac('0x45')));},'filename':function(_0x2bfeb8,_0x1cd5ee,_0x22fc2b){_0x22fc2b(null,util['format'](_0x85ac('0x46'),Date['now'](),_0x1cd5ee['originalname']));}})});router['post']('/:id/avatar',upload[_0x85ac('0x47')](_0x85ac('0x48')),controller[_0x85ac('0x49')]);router[_0x85ac('0x3f')](_0x85ac('0x4a'),auth[_0x85ac('0xa')](),controller[_0x85ac('0x4b')]);router[_0x85ac('0x3f')](_0x85ac('0x4c'),auth['isAuthenticated'](),controller['logout']);router[_0x85ac('0x3f')]('/:id/pause',auth['isAuthenticated'](),controller[_0x85ac('0x4d')]);router[_0x85ac('0x3f')](_0x85ac('0x4e'),auth[_0x85ac('0xa')](),controller[_0x85ac('0x4f')]);router[_0x85ac('0x3f')](_0x85ac('0x2a'),auth['isAuthenticated'](),controller[_0x85ac('0x50')]);router['post'](_0x85ac('0x51'),auth['isAuthenticated'](),controller[_0x85ac('0x52')]);router[_0x85ac('0x3f')]('/:id/mail_interactions',auth['isAuthenticated'](),controller[_0x85ac('0x53')]);router[_0x85ac('0x3f')](_0x85ac('0x54'),auth[_0x85ac('0xa')](),controller[_0x85ac('0x55')]);router[_0x85ac('0x3f')](_0x85ac('0x56'),auth[_0x85ac('0xa')](),controller[_0x85ac('0x57')]);router[_0x85ac('0x3f')](_0x85ac('0x58'),auth[_0x85ac('0xa')](),controller[_0x85ac('0x59')]);router['post'](_0x85ac('0x5a'),auth['isAuthenticated'](),controller[_0x85ac('0x5b')]);router[_0x85ac('0x3f')]('/:id/fax_accounts',auth[_0x85ac('0xa')](),controller[_0x85ac('0x5c')]);router['post'](_0x85ac('0x30'),auth[_0x85ac('0xa')](),controller[_0x85ac('0x5d')]);router[_0x85ac('0x3f')](_0x85ac('0x32'),auth[_0x85ac('0xa')](),controller[_0x85ac('0x5e')]);router[_0x85ac('0x3f')]('/:id/sms_accounts',auth[_0x85ac('0xa')](),controller['addSmsAccounts']);router['post'](_0x85ac('0x5f'),auth['isAuthenticated'](),controller[_0x85ac('0x60')]);router[_0x85ac('0x3f')](_0x85ac('0x36'),auth[_0x85ac('0xa')](),controller[_0x85ac('0x61')]);router[_0x85ac('0x3f')]('/:id/square_projects',auth[_0x85ac('0xa')](),controller[_0x85ac('0x62')]);router[_0x85ac('0x3f')]('/:id/api_key',auth[_0x85ac('0xa')](),controller[_0x85ac('0x63')]);router['put'](_0x85ac('0x10'),auth[_0x85ac('0xa')](),controller[_0x85ac('0x64')]);router[_0x85ac('0x65')](_0x85ac('0x66'),auth[_0x85ac('0xa')](),controller[_0x85ac('0x67')]);router['delete'](_0x85ac('0x17'),auth[_0x85ac('0xa')](),controller['removeQueues']);router[_0x85ac('0x68')]('/:id/teams',auth['isAuthenticated'](),controller[_0x85ac('0x69')]);router[_0x85ac('0x68')](_0x85ac('0x10'),auth[_0x85ac('0xa')](),controller[_0x85ac('0x6a')]);router['delete'](_0x85ac('0x51'),auth[_0x85ac('0xa')](),controller['removeChatInteractions']);router[_0x85ac('0x68')](_0x85ac('0x6b'),auth[_0x85ac('0xa')](),controller[_0x85ac('0x6c')]);router[_0x85ac('0x68')](_0x85ac('0x54'),auth[_0x85ac('0xa')](),controller['removeFaxInteractions']);router[_0x85ac('0x68')]('/:id/sms_interactions',auth['isAuthenticated'](),controller['removeSmsInteractions']);router['delete']('/:id/openchannel_interactions',auth['isAuthenticated'](),controller[_0x85ac('0x6d')]);router['delete'](_0x85ac('0x5a'),auth['isAuthenticated'](),controller['removeWhatsappInteractions']);router[_0x85ac('0x68')]('/:id/fax_accounts',auth[_0x85ac('0xa')](),controller[_0x85ac('0x6e')]);router[_0x85ac('0x68')](_0x85ac('0x30'),auth[_0x85ac('0xa')](),controller[_0x85ac('0x6f')]);router[_0x85ac('0x68')](_0x85ac('0x32'),auth[_0x85ac('0xa')](),controller[_0x85ac('0x70')]);router[_0x85ac('0x68')](_0x85ac('0x33'),auth[_0x85ac('0xa')](),controller[_0x85ac('0x71')]);router[_0x85ac('0x68')]('/:id/chat_websites',auth[_0x85ac('0xa')](),controller['removeChatWebsites']);router['delete'](_0x85ac('0x36'),auth[_0x85ac('0xa')](),controller[_0x85ac('0x72')]);router[_0x85ac('0x68')]('/:id/square_projects',auth[_0x85ac('0xa')](),controller[_0x85ac('0x73')]);router[_0x85ac('0x68')]('/:id/api_key',auth[_0x85ac('0xa')](),controller[_0x85ac('0x74')]);module[_0x85ac('0x75')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 6833140..0abd8f7 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 _0x5bc1=['UNSIGNED','moment','util','lodash','exports','STRING','name','setDataValue','defaultuser','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','ENUM','admin','user','agent','local','INTEGER','accountcode','BOOLEAN','DATE','dynamic','friend','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','transport','split','rfc2833','shortinfo','inband','auto','yes','nonat','update','nat','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','certificate','update,nonat','TEXT','showWebBar','get','isArray','udp','wss','encryption','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','actpass','/etc/pki/tls/certs/motion.crt','rtcp_mux','permissions','map','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','loginAttempts'];(function(_0x2b6b34,_0xfee69c){var _0x1189d0=function(_0x12c61c){while(--_0x12c61c){_0x2b6b34['push'](_0x2b6b34['shift']());}};_0x1189d0(++_0xfee69c);}(_0x5bc1,0xb5));var _0x15bc=function(_0x525445,_0x4f8f42){_0x525445=_0x525445-0x0;var _0x48b600=_0x5bc1[_0x525445];return _0x48b600;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x15bc('0x0'));var util=require(_0x15bc('0x1'));var _=require(_0x15bc('0x2'));module[_0x15bc('0x3')]={'name':{'type':Sequelize[_0x15bc('0x4')],'allowNull':![],'unique':_0x15bc('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x5cd32c){this['setDataValue'](_0x15bc('0x5'),_0x5cd32c);this[_0x15bc('0x6')](_0x15bc('0x7'),_0x5cd32c);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x15bc('0x4')],'allowNull':![],'set':function(_0x483c6d){this[_0x15bc('0x6')](_0x15bc('0x8'),_0x483c6d);this[_0x15bc('0x6')](_0x15bc('0x9'),util[_0x15bc('0xa')](_0x15bc('0xb'),_0x483c6d,this[_0x15bc('0xc')](_0x15bc('0xd'))));}},'alias':{'type':Sequelize[_0x15bc('0x4')]},'email':{'type':Sequelize[_0x15bc('0x4')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x18b502){if(_0x18b502){this[_0x15bc('0x6')](_0x15bc('0xe'),_0x18b502['toLowerCase']());}}},'role':{'type':Sequelize[_0x15bc('0xf')](_0x15bc('0x10'),_0x15bc('0x11'),_0x15bc('0x12'),'telephone'),'allowNull':![]},'password':{'type':Sequelize[_0x15bc('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x15bc('0x4')],'defaultValue':_0x15bc('0x13')},'internal':{'type':Sequelize[_0x15bc('0x14')](0xb),'allowNull':![],'unique':_0x15bc('0xd'),'set':function(_0x3f546b){this[_0x15bc('0x6')](_0x15bc('0xd'),_0x3f546b);this[_0x15bc('0x6')](_0x15bc('0x15'),_0x3f546b);this[_0x15bc('0x6')](_0x15bc('0x9'),util[_0x15bc('0xa')](_0x15bc('0xb'),this['getDataValue'](_0x15bc('0x8')),_0x3f546b));}},'salt':{'type':Sequelize[_0x15bc('0x4')]},'phone':{'type':Sequelize[_0x15bc('0x4')]},'mobile':{'type':Sequelize[_0x15bc('0x4')]},'address':{'type':Sequelize[_0x15bc('0x4')]},'zipcode':{'type':Sequelize[_0x15bc('0x4')]},'userpic':{'type':Sequelize[_0x15bc('0x4')]},'city':{'type':Sequelize[_0x15bc('0x4')]},'country':{'type':Sequelize[_0x15bc('0x4')]},'online':{'type':Sequelize[_0x15bc('0x16')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x15bc('0x17')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x15bc('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x15bc('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x15bc('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x15bc('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x15bc('0x4')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x15bc('0x17')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x15bc('0x14')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x15bc('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x15bc('0x14')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x15bc('0x14')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x15bc('0x14')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x15bc('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x15bc('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x15bc('0x14')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x15bc('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x15bc('0x14')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x15bc('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x15bc('0x16')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x15bc('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0x15bc('0x4')],'allowNull':!![],'defaultValue':_0x15bc('0x18')},'ipaddr':{'type':Sequelize[_0x15bc('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0x15bc('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x15bc('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x15bc('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x15bc('0x14')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x15bc('0xf')](_0x15bc('0x19'),_0x15bc('0x11'),_0x15bc('0x1a')),'allowNull':!![],'defaultValue':_0x15bc('0x19')},'context':{'type':Sequelize[_0x15bc('0x4')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0x15bc('0xf')](_0x15bc('0x1b'),_0x15bc('0x1c'),_0x15bc('0x1d'),_0x15bc('0x1e'),_0x15bc('0x1f'),_0x15bc('0x20'),_0x15bc('0x21'),_0x15bc('0x22')),'allowNull':!![]},'deny':{'type':Sequelize[_0x15bc('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x15bc('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x15bc('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x15bc('0x4')],'allowNull':!![],'defaultValue':'udp','set':function(_0x4e78f3){this[_0x15bc('0x6')](_0x15bc('0x23'),_0x4e78f3?_0x4e78f3['join'](','):null);},'get':function(){return this['getDataValue'](_0x15bc('0x23'))?this[_0x15bc('0xc')](_0x15bc('0x23'))[_0x15bc('0x24')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x15bc('0xf')](_0x15bc('0x25'),'info',_0x15bc('0x26'),_0x15bc('0x27'),_0x15bc('0x28')),'allowNull':!![],'defaultValue':_0x15bc('0x25')},'directmedia':{'type':Sequelize[_0x15bc('0xf')](_0x15bc('0x29'),'no',_0x15bc('0x2a'),_0x15bc('0x2b'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x15bc('0xf')](_0x15bc('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x15bc('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x15bc('0x4')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x434b5b){this['setDataValue'](_0x15bc('0x2c'),_0x434b5b?_0x434b5b[_0x15bc('0x2d')](','):null);},'get':function(){return this[_0x15bc('0xc')](_0x15bc('0x2c'))?this['getDataValue'](_0x15bc('0x2c'))[_0x15bc('0x24')](','):null;},'comment':_0x15bc('0x2e')},'callgroup':{'type':Sequelize[_0x15bc('0x4')]},'namedcallgroup':{'type':Sequelize[_0x15bc('0x4')]},'pickupgroup':{'type':Sequelize[_0x15bc('0x4')]},'namedpickupgroup':{'type':Sequelize[_0x15bc('0x4')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x15bc('0x2f')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x15bc('0x30'),'set':function(_0x51a458){this[_0x15bc('0x6')]('allow',_0x51a458?_0x51a458[_0x15bc('0x2d')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x15bc('0xc')](_0x15bc('0x31'))?this[_0x15bc('0xc')](_0x15bc('0x31'))['split'](';'):null;},'comment':_0x15bc('0x32')},'autoframing':{'type':Sequelize[_0x15bc('0xf')](_0x15bc('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x2106fe){this[_0x15bc('0x6')](_0x15bc('0x33'),_0x2106fe?_0x2106fe['join'](','):null);},'get':function(){return this[_0x15bc('0xc')](_0x15bc('0x33'))?this[_0x15bc('0xc')]('insecure')['split'](','):null;},'comment':_0x15bc('0x34')},'trustrpid':{'type':Sequelize[_0x15bc('0xf')](_0x15bc('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x15bc('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x15bc('0xf')](_0x15bc('0x29'),'no',_0x15bc('0x35')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x15bc('0xf')](_0x15bc('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x15bc('0xf')](_0x15bc('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x15bc('0x14')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x15bc('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x15bc('0x4')],'allowNull':!![],'defaultValue':_0x15bc('0x36')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x15bc('0xf')](_0x15bc('0x29'),'no'),'allowNull':!![],'defaultValue':_0x15bc('0x29')},'busylevel':{'type':Sequelize[_0x15bc('0x14')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x15bc('0xf')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x15bc('0xf')](_0x15bc('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x15bc('0xf')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x15bc('0xf')](_0x15bc('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x15bc('0xf')](_0x15bc('0x29'),'no',_0x15bc('0x37')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x15bc('0x14')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x15bc('0xf')](_0x15bc('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x15bc('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x15bc('0xf')](_0x15bc('0x38'),_0x15bc('0x39'),_0x15bc('0x3a')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x15bc('0x14')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x15bc('0xf')](_0x15bc('0x3b'),_0x15bc('0x3c')),'allowNull':!![],'defaultValue':_0x15bc('0x3c')},'t38pt_usertpsource':{'type':Sequelize[_0x15bc('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x15bc('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x15bc('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0x15bc('0xf')](_0x15bc('0x29'),'no'),'allowNull':!![],'defaultValue':_0x15bc('0x29')},'keepalive':{'type':Sequelize[_0x15bc('0x14')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x15bc('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x15bc('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x15bc('0x14')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x15bc('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x15bc('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x15bc('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x15bc('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x15bc('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x15bc('0x14')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x15bc('0x14')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x15bc('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x15bc('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x15bc('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x15bc('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x15bc('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x15bc('0x14')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x15bc('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x15bc('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x15bc('0xf')](_0x15bc('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x15bc('0xf')](_0x15bc('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x15bc('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x15bc('0xf')]('yes','no','fingerprint',_0x15bc('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x15bc('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x15bc('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x15bc('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x15bc('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x15bc('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x15bc('0xf')]('active','passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x15bc('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x15bc('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x15bc('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x15bc('0x14')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x15bc('0x29'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x15bc('0xf')](_0x15bc('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x15bc('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x15bc('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x15bc('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x15bc('0xf')](_0x15bc('0x29'),'no',_0x15bc('0x2a'),_0x15bc('0x2b'),_0x15bc('0x3e')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x15bc('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x15bc('0x17')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x15bc('0x3f')]},'showWebBar':{'type':Sequelize[_0x15bc('0x14')],'defaultValue':0x0,'set':function(_0x46c6dd){this['setDataValue'](_0x15bc('0x40'),_0x46c6dd);var _0x1271b4=this[_0x15bc('0x41')]({'plain':!![]});switch(_0x46c6dd){case 0x0:case 0x1:var _0x409e12=_0x1271b4['transport']?_[_0x15bc('0x42')](_0x1271b4[_0x15bc('0x23')])?_0x1271b4['transport'][_0x15bc('0x2d')]():_0x1271b4[_0x15bc('0x23')]:_0x15bc('0x43');if(_0x409e12===_0x15bc('0x44')){_0x409e12=_0x15bc('0x43');}this['setDataValue'](_0x15bc('0x23'),_0x409e12);this[_0x15bc('0x6')](_0x15bc('0x45'),'no');this[_0x15bc('0x6')]('avpf',null);this[_0x15bc('0x6')]('force_avp',null);this['setDataValue'](_0x15bc('0x46'),null);this[_0x15bc('0x6')](_0x15bc('0x47'),null);this[_0x15bc('0x6')](_0x15bc('0x48'),null);this[_0x15bc('0x6')](_0x15bc('0x49'),null);this[_0x15bc('0x6')](_0x15bc('0x4a'),null);this['setDataValue'](_0x15bc('0x4b'),null);this[_0x15bc('0x6')]('rtcp_mux','no');break;case 0x2:this['setDataValue']('transport',_0x15bc('0x44'));this[_0x15bc('0x6')](_0x15bc('0x45'),_0x15bc('0x29'));this[_0x15bc('0x6')]('avpf',_0x15bc('0x29'));this[_0x15bc('0x6')]('force_avp',_0x15bc('0x29'));this[_0x15bc('0x6')](_0x15bc('0x46'),_0x15bc('0x29'));this['setDataValue']('dtlsenable',_0x15bc('0x29'));this[_0x15bc('0x6')](_0x15bc('0x48'),'no');this[_0x15bc('0x6')](_0x15bc('0x49'),_0x15bc('0x4c'));this[_0x15bc('0x6')]('dtlscertfile',_0x1271b4[_0x15bc('0x4a')]||_0x15bc('0x4d'));this[_0x15bc('0x6')]('dtlsprivatekey',_0x1271b4[_0x15bc('0x4b')]||'/etc/pki/tls/private/motion.key');this['setDataValue'](_0x15bc('0x4e'),_0x15bc('0x29'));break;default:}}},'permissions':{'type':Sequelize[_0x15bc('0x3f')],'set':function(_0x54e1bd){this[_0x15bc('0x6')](_0x15bc('0x4f'),_0x54e1bd?_0x54e1bd[_0x15bc('0x2d')](','):[]);},'get':function(){return this[_0x15bc('0xc')](_0x15bc('0x4f'))?_[_0x15bc('0x50')](this[_0x15bc('0xc')](_0x15bc('0x4f'))[_0x15bc('0x24')](','),function(_0x504211){return parseInt(_0x504211,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x15bc('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x15bc('0x4')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0x15bc('0x16')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x15bc('0x16')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x15bc('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x15bc('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x15bc('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x15bc('0x14')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0x15bc('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x15bc('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize[_0x15bc('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x15bc('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x15bc('0xc')](_0x15bc('0x51'))?this[_0x15bc('0xc')](_0x15bc('0x51')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x15bc('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x15bc('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x15bc('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x15bc('0x16')],'defaultValue':![],'set':function(_0x1ce9e8){if(typeof _0x1ce9e8===_0x15bc('0x52')){var _0x2ef50b=_0x1ce9e8==='1'?!![]:_0x1ce9e8==='0'?![]:_0x1ce9e8===_0x15bc('0x53')?!![]:_0x1ce9e8===_0x15bc('0x54')?![]:![];this[_0x15bc('0x6')]('screenrecording',_0x2ef50b);}else{this[_0x15bc('0x6')](_0x15bc('0x55'),_0x1ce9e8);}}},'blocked':{'type':Sequelize[_0x15bc('0x16')],'defaultValue':![],'set':function(_0x61acb0){this[_0x15bc('0x6')](_0x15bc('0x56'),_0x61acb0);if(_0x61acb0===!![]){this[_0x15bc('0x6')](_0x15bc('0x57'),moment());this[_0x15bc('0x6')](_0x15bc('0x58'),0x0);}else{this[_0x15bc('0x6')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x15bc('0x16')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x15bc('0x14')](0x5)[_0x15bc('0x59')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x15bc('0x16')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x15bc('0x16')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x15bc('0x16')],'defaultValue':!![]}}; \ No newline at end of file +var _0xb1ef=['PROHIB_PASSED_SCREEN','PROHIB','udp','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','auto','yes','update','outgoing','force_rport,comedia','nat','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','accept','refuse','originate','uac','uas','fingerprint','certificate','active','passive','actpass','nonat','update,nonat','TEXT','get','isArray','encryption','avpf','force_avp','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','wss','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','rtcp_mux','permissions','map','string','true','screenrecording','blocked','loginAttempts','UNSIGNED','sequelize','moment','lodash','exports','STRING','name','setDataValue','The\x20name\x20of\x20the\x20user','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','user','agent','INTEGER','accountcode','fullname','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','peer','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED'];(function(_0xbb9dbf,_0x5dafa4){var _0x30223c=function(_0xaa9ca){while(--_0xaa9ca){_0xbb9dbf['push'](_0xbb9dbf['shift']());}};_0x30223c(++_0x5dafa4);}(_0xb1ef,0x93));var _0xfb1e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb1ef[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xfb1e('0x0'));var moment=require(_0xfb1e('0x1'));var util=require('util');var _=require(_0xfb1e('0x2'));module[_0xfb1e('0x3')]={'name':{'type':Sequelize[_0xfb1e('0x4')],'allowNull':![],'unique':_0xfb1e('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0xb70c57){this[_0xfb1e('0x6')](_0xfb1e('0x5'),_0xb70c57);this[_0xfb1e('0x6')]('defaultuser',_0xb70c57);},'comment':_0xfb1e('0x7')},'fullname':{'type':Sequelize[_0xfb1e('0x4')],'allowNull':![],'set':function(_0x1455fa){this[_0xfb1e('0x6')]('fullname',_0x1455fa);this['setDataValue'](_0xfb1e('0x8'),util[_0xfb1e('0x9')](_0xfb1e('0xa'),_0x1455fa,this[_0xfb1e('0xb')](_0xfb1e('0xc'))));}},'alias':{'type':Sequelize[_0xfb1e('0x4')]},'email':{'type':Sequelize[_0xfb1e('0x4')],'allowNull':![],'unique':_0xfb1e('0xd'),'validate':{'isEmail':!![]},'set':function(_0x5a8fef){if(_0x5a8fef){this[_0xfb1e('0x6')](_0xfb1e('0xd'),_0x5a8fef[_0xfb1e('0xe')]());}}},'role':{'type':Sequelize[_0xfb1e('0xf')](_0xfb1e('0x10'),_0xfb1e('0x11'),_0xfb1e('0x12'),'telephone'),'allowNull':![]},'password':{'type':Sequelize[_0xfb1e('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xfb1e('0x4')],'defaultValue':'local'},'internal':{'type':Sequelize[_0xfb1e('0x13')](0xb),'allowNull':![],'unique':_0xfb1e('0xc'),'set':function(_0x1cd003){this[_0xfb1e('0x6')](_0xfb1e('0xc'),_0x1cd003);this['setDataValue'](_0xfb1e('0x14'),_0x1cd003);this[_0xfb1e('0x6')](_0xfb1e('0x8'),util[_0xfb1e('0x9')](_0xfb1e('0xa'),this['getDataValue'](_0xfb1e('0x15')),_0x1cd003));}},'salt':{'type':Sequelize[_0xfb1e('0x4')]},'phone':{'type':Sequelize[_0xfb1e('0x4')]},'mobile':{'type':Sequelize[_0xfb1e('0x4')]},'address':{'type':Sequelize[_0xfb1e('0x4')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0xfb1e('0x4')]},'city':{'type':Sequelize[_0xfb1e('0x4')]},'country':{'type':Sequelize[_0xfb1e('0x4')]},'online':{'type':Sequelize[_0xfb1e('0x16')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xfb1e('0x17')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xfb1e('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xfb1e('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xfb1e('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xfb1e('0x4')],'defaultValue':_0xfb1e('0x18')},'lastPauseAt':{'type':Sequelize[_0xfb1e('0x17')]},'chatCapacity':{'type':Sequelize[_0xfb1e('0x13')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xfb1e('0x13')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xfb1e('0x13')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xfb1e('0x13')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xfb1e('0x13')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xfb1e('0x13')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xfb1e('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xfb1e('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xfb1e('0x13')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xfb1e('0x13')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xfb1e('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xfb1e('0x13')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xfb1e('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xfb1e('0x16')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xfb1e('0x19')},'ipaddr':{'type':Sequelize[_0xfb1e('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0xfb1e('0x13')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xfb1e('0x13')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xfb1e('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xfb1e('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xfb1e('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xfb1e('0x13')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xfb1e('0xf')]('friend',_0xfb1e('0x11'),_0xfb1e('0x1a')),'allowNull':!![],'defaultValue':_0xfb1e('0x1b')},'context':{'type':Sequelize[_0xfb1e('0x4')],'allowNull':!![],'defaultValue':_0xfb1e('0x1c')},'callingpres':{'type':Sequelize[_0xfb1e('0xf')](_0xfb1e('0x1d'),_0xfb1e('0x1e'),'ALLOWED_FAILED_SCREEN',_0xfb1e('0x1f'),_0xfb1e('0x20'),_0xfb1e('0x21'),'PROHIB_FAILED_SCREEN',_0xfb1e('0x22')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0xfb1e('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0xfb1e('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xfb1e('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xfb1e('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0xfb1e('0x4')],'allowNull':!![],'defaultValue':_0xfb1e('0x23'),'set':function(_0x141031){this[_0xfb1e('0x6')](_0xfb1e('0x24'),_0x141031?_0x141031['join'](','):null);},'get':function(){return this[_0xfb1e('0xb')](_0xfb1e('0x24'))?this['getDataValue'](_0xfb1e('0x24'))[_0xfb1e('0x25')](','):null;},'comment':_0xfb1e('0x26')},'dtmfmode':{'type':Sequelize[_0xfb1e('0xf')](_0xfb1e('0x27'),_0xfb1e('0x28'),'shortinfo','inband',_0xfb1e('0x29')),'allowNull':!![],'defaultValue':_0xfb1e('0x27')},'directmedia':{'type':Sequelize['ENUM'](_0xfb1e('0x2a'),'no','nonat',_0xfb1e('0x2b'),_0xfb1e('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xfb1e('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xfb1e('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0xfb1e('0x4')],'allowNull':!![],'defaultValue':_0xfb1e('0x2d'),'set':function(_0x5e3ab7){this['setDataValue'](_0xfb1e('0x2e'),_0x5e3ab7?_0x5e3ab7[_0xfb1e('0x2f')](','):null);},'get':function(){return this[_0xfb1e('0xb')]('nat')?this['getDataValue'](_0xfb1e('0x2e'))[_0xfb1e('0x25')](','):null;},'comment':_0xfb1e('0x30')},'callgroup':{'type':Sequelize[_0xfb1e('0x4')]},'namedcallgroup':{'type':Sequelize[_0xfb1e('0x4')]},'pickupgroup':{'type':Sequelize[_0xfb1e('0x4')]},'namedpickupgroup':{'type':Sequelize[_0xfb1e('0x4')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0xfb1e('0x4')],'allowNull':![],'defaultValue':_0xfb1e('0x31')},'allow':{'type':Sequelize[_0xfb1e('0x4')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x220512){this[_0xfb1e('0x6')](_0xfb1e('0x32'),_0x220512?_0x220512[_0xfb1e('0x2f')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xfb1e('0xb')]('allow')?this[_0xfb1e('0xb')]('allow')['split'](';'):null;},'comment':_0xfb1e('0x33')},'autoframing':{'type':Sequelize['ENUM'](_0xfb1e('0x2a'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xfb1e('0x4')],'allowNull':!![],'set':function(_0x300b6e){this[_0xfb1e('0x6')](_0xfb1e('0x34'),_0x300b6e?_0x300b6e[_0xfb1e('0x2f')](','):null);},'get':function(){return this[_0xfb1e('0xb')](_0xfb1e('0x34'))?this[_0xfb1e('0xb')](_0xfb1e('0x34'))[_0xfb1e('0x25')](','):null;},'comment':_0xfb1e('0x35')},'trustrpid':{'type':Sequelize[_0xfb1e('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xfb1e('0xf')](_0xfb1e('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xfb1e('0xf')]('yes','no',_0xfb1e('0x36')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0xfb1e('0x2a'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xfb1e('0xf')](_0xfb1e('0x2a'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xfb1e('0x13')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xfb1e('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xfb1e('0x37')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xfb1e('0xf')]('yes','no'),'allowNull':!![],'defaultValue':_0xfb1e('0x2a')},'busylevel':{'type':Sequelize[_0xfb1e('0x13')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0xfb1e('0x2a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xfb1e('0xf')]('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xfb1e('0xf')](_0xfb1e('0x2a'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xfb1e('0xf')](_0xfb1e('0x2a'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xfb1e('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0xfb1e('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xfb1e('0xf')](_0xfb1e('0x2a'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xfb1e('0x13')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xfb1e('0xf')](_0xfb1e('0x2a'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xfb1e('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xfb1e('0xf')](_0xfb1e('0x38'),_0xfb1e('0x39'),_0xfb1e('0x3a')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xfb1e('0x13')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xfb1e('0x13')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0xfb1e('0x3b'),'uas'),'allowNull':!![],'defaultValue':_0xfb1e('0x3c')},'t38pt_usertpsource':{'type':Sequelize[_0xfb1e('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0xfb1e('0xf')](_0xfb1e('0x2a'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xfb1e('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xfb1e('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xfb1e('0x13')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xfb1e('0xf')](_0xfb1e('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xfb1e('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xfb1e('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xfb1e('0x13')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xfb1e('0x13')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xfb1e('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xfb1e('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xfb1e('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xfb1e('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xfb1e('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xfb1e('0xf')](_0xfb1e('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xfb1e('0xf')](_0xfb1e('0x2a'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xfb1e('0xf')](_0xfb1e('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xfb1e('0xf')](_0xfb1e('0x2a'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xfb1e('0xf')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xfb1e('0xf')](_0xfb1e('0x2a'),'no',_0xfb1e('0x3d'),_0xfb1e('0x3e')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xfb1e('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xfb1e('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xfb1e('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xfb1e('0xf')](_0xfb1e('0x3f'),_0xfb1e('0x40'),_0xfb1e('0x41')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xfb1e('0xf')](_0xfb1e('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xfb1e('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xfb1e('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xfb1e('0x13')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0xfb1e('0x2a'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xfb1e('0xf')](_0xfb1e('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xfb1e('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xfb1e('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xfb1e('0xf')](_0xfb1e('0x2a'),'no',_0xfb1e('0x42'),_0xfb1e('0x2b'),_0xfb1e('0x43')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xfb1e('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xfb1e('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0xfb1e('0x17')]},'passwordResetAt':{'type':Sequelize[_0xfb1e('0x17')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xfb1e('0x44')]},'showWebBar':{'type':Sequelize[_0xfb1e('0x13')],'defaultValue':0x0,'set':function(_0x19ca81){this[_0xfb1e('0x6')]('showWebBar',_0x19ca81);var _0x22963d=this[_0xfb1e('0x45')]({'plain':!![]});switch(_0x19ca81){case 0x0:case 0x1:var _0x5bbd81=_0x22963d['transport']?_[_0xfb1e('0x46')](_0x22963d[_0xfb1e('0x24')])?_0x22963d['transport'][_0xfb1e('0x2f')]():_0x22963d[_0xfb1e('0x24')]:_0xfb1e('0x23');if(_0x5bbd81==='wss'){_0x5bbd81=_0xfb1e('0x23');}this['setDataValue']('transport',_0x5bbd81);this['setDataValue'](_0xfb1e('0x47'),'no');this[_0xfb1e('0x6')](_0xfb1e('0x48'),null);this[_0xfb1e('0x6')](_0xfb1e('0x49'),null);this[_0xfb1e('0x6')]('icesupport',null);this[_0xfb1e('0x6')]('dtlsenable',null);this[_0xfb1e('0x6')](_0xfb1e('0x4a'),null);this['setDataValue'](_0xfb1e('0x4b'),null);this['setDataValue'](_0xfb1e('0x4c'),null);this[_0xfb1e('0x6')](_0xfb1e('0x4d'),null);this['setDataValue']('rtcp_mux','no');break;case 0x2:this[_0xfb1e('0x6')](_0xfb1e('0x24'),_0xfb1e('0x4e'));this[_0xfb1e('0x6')](_0xfb1e('0x47'),'yes');this[_0xfb1e('0x6')](_0xfb1e('0x48'),'yes');this[_0xfb1e('0x6')]('force_avp',_0xfb1e('0x2a'));this[_0xfb1e('0x6')]('icesupport',_0xfb1e('0x2a'));this[_0xfb1e('0x6')]('dtlsenable',_0xfb1e('0x2a'));this[_0xfb1e('0x6')](_0xfb1e('0x4a'),'no');this[_0xfb1e('0x6')](_0xfb1e('0x4b'),_0xfb1e('0x41'));this['setDataValue'](_0xfb1e('0x4c'),_0x22963d['dtlscertfile']||_0xfb1e('0x4f'));this['setDataValue']('dtlsprivatekey',_0x22963d[_0xfb1e('0x4d')]||_0xfb1e('0x50'));this[_0xfb1e('0x6')](_0xfb1e('0x51'),_0xfb1e('0x2a'));break;default:}}},'permissions':{'type':Sequelize[_0xfb1e('0x44')],'set':function(_0x18dd28){this[_0xfb1e('0x6')](_0xfb1e('0x52'),_0x18dd28?_0x18dd28[_0xfb1e('0x2f')](','):[]);},'get':function(){return this[_0xfb1e('0xb')]('permissions')?_[_0xfb1e('0x53')](this[_0xfb1e('0xb')](_0xfb1e('0x52'))['split'](','),function(_0x167765){return parseInt(_0x167765,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xfb1e('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xfb1e('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0xfb1e('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0xfb1e('0x16')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xfb1e('0x16')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xfb1e('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xfb1e('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xfb1e('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xfb1e('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xfb1e('0x13')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xfb1e('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xfb1e('0x13')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xfb1e('0xf')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xfb1e('0x4')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xfb1e('0xb')]('phoneBarEnableScreenRecordingByAgent')?this[_0xfb1e('0xb')]('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xfb1e('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xfb1e('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xfb1e('0x16')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xfb1e('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x439fee){if(typeof _0x439fee===_0xfb1e('0x54')){var _0x3b1718=_0x439fee==='1'?!![]:_0x439fee==='0'?![]:_0x439fee===_0xfb1e('0x55')?!![]:_0x439fee==='false'?![]:![];this[_0xfb1e('0x6')](_0xfb1e('0x56'),_0x3b1718);}else{this['setDataValue'](_0xfb1e('0x56'),_0x439fee);}}},'blocked':{'type':Sequelize[_0xfb1e('0x16')],'defaultValue':![],'set':function(_0x9222eb){this[_0xfb1e('0x6')](_0xfb1e('0x57'),_0x9222eb);if(_0x9222eb===!![]){this[_0xfb1e('0x6')]('blockedAt',moment());this[_0xfb1e('0x6')](_0xfb1e('0x58'),0x0);}else{this[_0xfb1e('0x6')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0xfb1e('0x17')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xfb1e('0x13')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xfb1e('0x16')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xfb1e('0x16')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xfb1e('0x13')](0x5)[_0xfb1e('0x59')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xfb1e('0x16')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 768ca86..a1a7f00 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 _0x6f2f=['CmList','List','Tag','Tags','color','tag','nolimit','rawAttributes','Queue','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','ChatInteraction','getChatInteractions','OpenchannelInteraction','getOpenchannelInteractions','getMailInteractions','getSmsInteractions','getFaxInteractions','FaxInteraction','getWhatsappInteractions','phone','mobile','intrf','SIP/%s','user:%s','headers','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','device','PAUSE','LOGININPAUSE','bulkCreate','concat','isMiddleware','resolve','logout','pause','updateAttributes','getChannels','type','DEFAULT\x20PAUSE','unpause','voicePause','mailPause','chatPause','faxPause','openchannelPause','whatsapppause','pauseType','lastPauseAt','QueuePause','manual','getTeams','Team','Voice','getChatQueues','setDataValue','Chat','getMailQueues','getSmsQueues','Sms','getFaxQueues','Fax','getOpenchannelQueues','Openchannel','flatten','transaction','addAgent','getDataValue','QueueId','removeTeams','Mail','Whatsapp','removeAgent','getLists','getAgents','values','addChatInteractions','removeChatInteractions','isArray','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','MailAccount','getMailAccounts','addMailAccounts','OpenchannelAccount','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','ChatWebsite','getChatWebsites','addChatWebsites','removeChatWebsites','WhatsappAccount','getWhatsappAccounts','addWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$gte','$lt','$lte','$ne','$eq','$between','$notIn','$like','$notLike','$iLike','$contained','$any','firstName','lastName','Contact','getApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','generateApiKey','iat','nonce','removeApiKey','apiKeyNonce','apiKeyIat','whoami','getPresence','teams','queues','lower','asc','desc','substring','uniqBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','idle','unknown','ringing','voiceStatus','busy','slice','charAt','toUpperCase','SELECT','ui.','field','ui.createdAt','_interactions','ui.UserId\x20=\x20?','OpenTabs','moment','bluebird','squel','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','socket.io-emitter','redis','./user.socket','register','defaults','client','http','request','then','info','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','User,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','get','role','admin','user','Agents','agent','Telephones','telephone','filter','ignore','map','value','includes','name','end','stack','send','index','User','fieldName','key','password','getOptions','where','query','include','attributes','push','findAll','rows','true','length','chat','dataValues','sms','fax','whatsapp','all','show','params','model','salt','keys','filters','intersection','fields','includeAll','merge','options','find','openTabs','openchannel','body','describe','addContacts','ids','omit','Setting','findById','validatePasswordPattern','max','internal','isNil','min_internal','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','sequelize','QueryTypes','from','voicemail','mailbox','VoiceMail','fullname','email','permissions','101','103','113','110','107','108','109','100','111','114','115','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','isEmpty','changePassword','newPassword','Sequelize','authenticate','oldPassword','Wrong\x20credentials','ValidationError','Invalid\x20body\x20format.\x20Use\x20newPassword','securePassword','enforcePasswordHistory','previousPasswords','validatePasswordHistory','addQueues','channel','online','loginInPause','interface','isValidChannel','Unknown\x20channel','add','toLowerCase','Queues','penalty','spread','emit','capitalize','Queue:save','voice','VoiceQueue','format','each','upsert','removeQueues','remove','Queue:remove','UserVoiceQueueRt','addAvatar','file','join','root','userpic','download','existsSync','server/files/images/','getOpenTabs','mail','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','SmsOpenTabs','WhatsappOpenTabs','getContacts','findOne','CmContact','order','sort','pick','hasOwnProperty'];(function(_0x1a2b01,_0x5a668f){var _0x20f169=function(_0x589994){while(--_0x589994){_0x1a2b01['push'](_0x1a2b01['shift']());}};_0x20f169(++_0x5a668f);}(_0x6f2f,0xbe));var _0xf6f2=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x6f2f[_0x5f1391];return _0x50ebe3;};'use strict';var moment=require(_0xf6f2('0x0'));var BPromise=require(_0xf6f2('0x1'));var util=require('util');var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0xf6f2('0x2'));var jayson=require('jayson/promise');var Redis=require('ioredis');var authService=require(_0xf6f2('0x3'));var qs=require(_0xf6f2('0x4'));var logger=require(_0xf6f2('0x5'))('api');var utils=require('../../config/utils');var config=require(_0xf6f2('0x6'));var licenseUtil=require(_0xf6f2('0x7'));var db=require(_0xf6f2('0x8'))['db'];var socket=require(_0xf6f2('0x9'))(new Redis(config[_0xf6f2('0xa')]));require(_0xf6f2('0xb'))[_0xf6f2('0xc')](socket);config[_0xf6f2('0xa')]=_[_0xf6f2('0xd')](config[_0xf6f2('0xa')],{'host':'localhost','port':0x18eb});var client=jayson[_0xf6f2('0xe')][_0xf6f2('0xf')]({'port':0x232a});var values;function respondWithRpcPromise(_0x2a4325,_0x1885d1,_0x4d261c,_0x4ca76a){return new BPromise(function(_0x535252,_0x3f42b5){var _0x113991=_0x4ca76a||client;return _0x113991[_0xf6f2('0x10')](_0x2a4325,_0x4d261c)[_0xf6f2('0x11')](function(_0x1626ce){logger[_0xf6f2('0x12')]('User,\x20%s,\x20%s',_0x1885d1,_0xf6f2('0x13'));logger[_0xf6f2('0x14')](_0xf6f2('0x15'),_0x1885d1,_0xf6f2('0x13'),JSON[_0xf6f2('0x16')](_0x1626ce));if(_0x1626ce['error']){if(_0x1626ce[_0xf6f2('0x17')][_0xf6f2('0x18')]===0x1f4){logger[_0xf6f2('0x17')](_0xf6f2('0x19'),_0x1885d1,_0x1626ce[_0xf6f2('0x17')][_0xf6f2('0x1a')]);return _0x3f42b5(_0x1626ce[_0xf6f2('0x17')][_0xf6f2('0x1a')]);}logger[_0xf6f2('0x17')](_0xf6f2('0x19'),_0x1885d1,_0x1626ce[_0xf6f2('0x17')][_0xf6f2('0x1a')]);return _0x535252(_0x1626ce[_0xf6f2('0x17')][_0xf6f2('0x1a')]);}else{logger[_0xf6f2('0x12')]('User,\x20%s,\x20%s',_0x1885d1,'request\x20sent');_0x535252(_0x1626ce[_0xf6f2('0x1b')]['message']);}})[_0xf6f2('0x1c')](function(_0xe01b4d){logger[_0xf6f2('0x17')](_0xf6f2('0x19'),_0x1885d1,_0xe01b4d);_0x3f42b5(_0xe01b4d);});});}function respondWithStatusCode(_0x5929cf,_0xd020e6){_0xd020e6=_0xd020e6||0xcc;return function(_0x24ff98){if(_0x24ff98){return _0x5929cf[_0xf6f2('0x1d')](_0xd020e6);}return _0x5929cf[_0xf6f2('0x1e')](_0xd020e6)['end']();};}function respondWithResult(_0x19be8e,_0x54cb23){_0x54cb23=_0x54cb23||0xc8;return function(_0x17a750){if(_0x17a750){return _0x19be8e['status'](_0x54cb23)[_0xf6f2('0x1f')](_0x17a750);}};}function respondWithFilteredResult(_0x151905,_0x582862){return function(_0x196d4f){if(_0x196d4f){var _0x3e751a=typeof _0x582862[_0xf6f2('0x20')]===_0xf6f2('0x21')&&typeof _0x582862[_0xf6f2('0x22')]===_0xf6f2('0x21');var _0x3304ec=_0x196d4f[_0xf6f2('0x23')];var _0x5dac6a=_0x3e751a?0x0:_0x582862[_0xf6f2('0x20')];var _0x2081f6=_0x3e751a?_0x196d4f[_0xf6f2('0x23')]:_0x582862[_0xf6f2('0x20')]+_0x582862[_0xf6f2('0x22')];var _0x341495;if(_0x2081f6>=_0x3304ec){_0x2081f6=_0x3304ec;_0x341495=0xc8;}else{_0x341495=0xce;}_0x151905[_0xf6f2('0x1e')](_0x341495);return _0x151905[_0xf6f2('0x24')](_0xf6f2('0x25'),_0x5dac6a+'-'+_0x2081f6+'/'+_0x3304ec)[_0xf6f2('0x1f')](_0x196d4f);}return null;};}function saveUpdates(_0x2c643d){return function(_0x4accfe){if(_0x4accfe){return _0x4accfe[_0xf6f2('0x26')](_0x2c643d)[_0xf6f2('0x11')](function(_0x17c63f){return _0x17c63f;});}return null;};}function removeEntity(_0x458171){return function(_0x1a08f3){if(_0x1a08f3){return _0x1a08f3[_0xf6f2('0x27')]()[_0xf6f2('0x11')](function(){var _0x13d05d=_0x1a08f3[_0xf6f2('0x28')]({'plain':!![]});if(_0x13d05d[_0xf6f2('0x29')]===_0xf6f2('0x2a'))return;var _0x7cf6b0=[{'name':'Users','value':_0xf6f2('0x2b'),'ignore':!![]},{'name':_0xf6f2('0x2c'),'value':_0xf6f2('0x2d'),'ignore':![]},{'name':_0xf6f2('0x2e'),'value':_0xf6f2('0x2f'),'ignore':![]}];var _0x3a421f=_(_0x7cf6b0)[_0xf6f2('0x30')](_0xf6f2('0x31'))[_0xf6f2('0x32')](_0xf6f2('0x33'))[_0xf6f2('0x33')]();if(_[_0xf6f2('0x34')](_0x3a421f,_0x13d05d[_0xf6f2('0x29')])){return;}var _0x5c23b2=_['find'](_0x7cf6b0,['value',_0x13d05d[_0xf6f2('0x29')]])[_0xf6f2('0x35')];return db['UserProfileResource']['destroy']({'where':{'type':_0x5c23b2,'resourceId':_0x13d05d['id']}})[_0xf6f2('0x11')](function(){return _0x1a08f3;});})[_0xf6f2('0x11')](function(){_0x458171[_0xf6f2('0x1e')](0xcc)[_0xf6f2('0x36')]();});}};}function handleEntityNotFound(_0xce0c28){return function(_0xcda69b){if(!_0xcda69b){_0xce0c28['sendStatus'](0x194);}return _0xcda69b;};}function handleError(_0x2e633d,_0x53e7eb){_0x53e7eb=_0x53e7eb||0x1f4;return function(_0x33139f){logger[_0xf6f2('0x17')](_0x33139f[_0xf6f2('0x37')]);if(_0x33139f[_0xf6f2('0x35')]){delete _0x33139f['name'];}_0x2e633d[_0xf6f2('0x1e')](_0x53e7eb)[_0xf6f2('0x38')](_0x33139f);};}exports[_0xf6f2('0x39')]=function(_0x4bf2df,_0xabae89){var _0x213923={},_0x1e3726={'count':0x0,'rows':[]};var _0x598489=_(db[_0xf6f2('0x3a')]['rawAttributes'])[_0xf6f2('0x32')](function(_0xb312d9){return{'name':_0xb312d9[_0xf6f2('0x3b')],'type':_0xb312d9['type'][_0xf6f2('0x3c')]};})[_0xf6f2('0x30')](function(_0x10bebb){return!_[_0xf6f2('0x34')]([_0xf6f2('0x3d'),'salt'],_0x10bebb[_0xf6f2('0x35')]);})[_0xf6f2('0x33')]();_0x213923=qs[_0xf6f2('0x3e')](_0x598489,_0x4bf2df);var _0xe94cb4={'where':_0x213923[_0xf6f2('0x3f')]};return db[_0xf6f2('0x3a')][_0xf6f2('0x23')](_0xe94cb4)['then'](function(_0xa48cc4){_0x1e3726[_0xf6f2('0x23')]=_0xa48cc4;if(_0x4bf2df[_0xf6f2('0x40')]['includeAll']){_0x213923[_0xf6f2('0x41')]=[{'all':!![]}];}if(!_[_0xf6f2('0x34')](_0x213923[_0xf6f2('0x42')],'id')){_0x213923[_0xf6f2('0x42')][_0xf6f2('0x43')]('id');}return db['User'][_0xf6f2('0x44')](_0x213923);})[_0xf6f2('0x11')](function(_0x34ba3a){_0x1e3726[_0xf6f2('0x45')]=_0x34ba3a;if(_0x4bf2df[_0xf6f2('0x40')]['openTabs']===_0xf6f2('0x46')){var _0x5f2a9f=[];for(var _0x1a7e1e=0x0;_0x1a7e1e<_0x1e3726[_0xf6f2('0x45')][_0xf6f2('0x47')];_0x1a7e1e++){_0x5f2a9f[_0xf6f2('0x43')](get_open_tabs(_0xf6f2('0x48'),_0x1e3726[_0xf6f2('0x45')][_0x1a7e1e][_0xf6f2('0x49')]));_0x5f2a9f[_0xf6f2('0x43')](get_open_tabs(_0xf6f2('0x4a'),_0x1e3726[_0xf6f2('0x45')][_0x1a7e1e][_0xf6f2('0x49')]));_0x5f2a9f['push'](get_open_tabs(_0xf6f2('0x4b'),_0x1e3726[_0xf6f2('0x45')][_0x1a7e1e][_0xf6f2('0x49')]));_0x5f2a9f['push'](get_open_tabs('mail',_0x1e3726['rows'][_0x1a7e1e][_0xf6f2('0x49')]));_0x5f2a9f[_0xf6f2('0x43')](get_open_tabs('openchannel',_0x1e3726['rows'][_0x1a7e1e][_0xf6f2('0x49')]));_0x5f2a9f[_0xf6f2('0x43')](get_open_tabs(_0xf6f2('0x4c'),_0x1e3726[_0xf6f2('0x45')][_0x1a7e1e][_0xf6f2('0x49')]));}return BPromise[_0xf6f2('0x4d')](_0x5f2a9f)['then'](function(_0x5b4737){return _0x1e3726;});}else{return _0x1e3726;}})['then'](respondWithFilteredResult(_0xabae89,_0x213923))['catch'](handleError(_0xabae89,null));};exports[_0xf6f2('0x4e')]=function(_0x56f00f,_0x37927d){var _0x353d76={'raw':![],'where':{'id':_0x56f00f[_0xf6f2('0x4f')]['id']}},_0x2b9274={};_0x2b9274[_0xf6f2('0x50')]=_['differenceBy'](_['keys'](db[_0xf6f2('0x3a')]['rawAttributes']),['password',_0xf6f2('0x51')]);_0x2b9274[_0xf6f2('0x40')]=_[_0xf6f2('0x52')](_0x56f00f[_0xf6f2('0x40')]);_0x2b9274[_0xf6f2('0x53')]=_[_0xf6f2('0x54')](_0x2b9274['model'],_0x2b9274[_0xf6f2('0x40')]);_0x353d76[_0xf6f2('0x42')]=_['intersection'](_0x2b9274[_0xf6f2('0x50')],qs[_0xf6f2('0x55')](_0x56f00f[_0xf6f2('0x40')]['fields']));_0x353d76[_0xf6f2('0x42')]=_0x353d76[_0xf6f2('0x42')][_0xf6f2('0x47')]?_0x353d76[_0xf6f2('0x42')]:_0x2b9274[_0xf6f2('0x50')];if(_0x56f00f[_0xf6f2('0x40')][_0xf6f2('0x56')]){_0x353d76[_0xf6f2('0x41')]=[{'all':!![]}];}_0x353d76=_[_0xf6f2('0x57')]({},_0x353d76,_0x56f00f[_0xf6f2('0x58')]);if(!_[_0xf6f2('0x34')](_0x353d76['attributes'],'id')){_0x353d76[_0xf6f2('0x42')][_0xf6f2('0x43')]('id');}return db[_0xf6f2('0x3a')][_0xf6f2('0x59')](_0x353d76)[_0xf6f2('0x11')](handleEntityNotFound(_0x37927d,null))[_0xf6f2('0x11')](function(_0x43221e){var _0x22e7d1=[];values=_0x43221e;if(_0x56f00f[_0xf6f2('0x40')][_0xf6f2('0x5a')]==='true'){_0x22e7d1[_0xf6f2('0x43')](get_open_tabs(_0xf6f2('0x48'),_0x43221e['dataValues']));_0x22e7d1[_0xf6f2('0x43')](get_open_tabs('sms',_0x43221e['dataValues']));_0x22e7d1[_0xf6f2('0x43')](get_open_tabs(_0xf6f2('0x5b'),_0x43221e[_0xf6f2('0x49')]));_0x22e7d1[_0xf6f2('0x43')](get_open_tabs(_0xf6f2('0x4c'),_0x43221e[_0xf6f2('0x49')]));_0x22e7d1[_0xf6f2('0x43')](get_open_tabs(_0xf6f2('0x4b'),_0x43221e['dataValues']));_0x22e7d1[_0xf6f2('0x43')](get_open_tabs('mail',_0x43221e[_0xf6f2('0x49')]));return BPromise['all'](_0x22e7d1);}else{return values;}})[_0xf6f2('0x11')](function(_0x3e43db){return values;})[_0xf6f2('0x11')](respondWithResult(_0x37927d,null))[_0xf6f2('0x1c')](handleError(_0x37927d,null));};exports['update']=function(_0x44a099,_0x322cb1){if(_0x44a099['body']['id']){delete _0x44a099[_0xf6f2('0x5c')]['id'];}delete _0x44a099[_0xf6f2('0x5c')]['role'];return db[_0xf6f2('0x3a')][_0xf6f2('0x59')]({'where':{'id':_0x44a099[_0xf6f2('0x4f')]['id']}})[_0xf6f2('0x11')](handleEntityNotFound(_0x322cb1,null))[_0xf6f2('0x11')](saveUpdates(_0x44a099[_0xf6f2('0x5c')],null))[_0xf6f2('0x11')](respondWithResult(_0x322cb1,null))[_0xf6f2('0x1c')](handleError(_0x322cb1,null));};exports['describe']=function(_0x2c5aaa,_0x213c3f){return db['User'][_0xf6f2('0x5d')]()['then'](respondWithResult(_0x213c3f,null))['catch'](handleError(_0x213c3f,null));};exports[_0xf6f2('0x5e')]=function(_0x141d68,_0x1def57){return db['User'][_0xf6f2('0x59')]({'where':{'id':_0x141d68[_0xf6f2('0x4f')]['id']}})[_0xf6f2('0x11')](handleEntityNotFound(_0x1def57,null))[_0xf6f2('0x11')](function(_0x4c7e76){if(_0x4c7e76){return _0x4c7e76['addContacts'](_0x141d68[_0xf6f2('0x5c')][_0xf6f2('0x5f')],_[_0xf6f2('0x60')](_0x141d68[_0xf6f2('0x5c')],[_0xf6f2('0x5f'),'id'])||{});}})[_0xf6f2('0x11')](respondWithResult(_0x1def57,null))[_0xf6f2('0x1c')](handleError(_0x1def57,null));};function validateUser(_0x2ec204){return new BPromise(function(_0x508460,_0x3651dd){if(_0x2ec204['internal'])return _0x508460(_0x2ec204);return db[_0xf6f2('0x61')][_0xf6f2('0x62')](0x1)['then'](function(_0x2af307){if(_0x2af307['securePassword'])authService[_0xf6f2('0x63')](_0x2ec204[_0xf6f2('0x3d')]);db['User'][_0xf6f2('0x64')](_0xf6f2('0x65'))[_0xf6f2('0x11')](function(_0x16a26e){if(_[_0xf6f2('0x66')](_0x16a26e)){_0x2ec204['internal']=_0x2af307[_0xf6f2('0x67')]||0x1;return;}if(_[_0xf6f2('0x66')](_0x2af307[_0xf6f2('0x67')])||_0x2af307[_0xf6f2('0x67')]===_0x16a26e){_0x2ec204['internal']=_0x16a26e+0x1;return;}if(_0x2af307[_0xf6f2('0x67')]>_0x16a26e){_0x2ec204[_0xf6f2('0x65')]=_0x2af307[_0xf6f2('0x67')];return;}return db['sequelize']['query'](_0xf6f2('0x68'),{'type':db[_0xf6f2('0x69')][_0xf6f2('0x6a')]['SELECT']})[_0xf6f2('0x11')](function(_0x69ab02){if(_0x69ab02&&_0x69ab02[_0xf6f2('0x47')]){for(var _0x5a2ad6=0x0,_0x3bc3bb=_0x69ab02[_0xf6f2('0x47')];_0x5a2ad6<_0x3bc3bb&&_[_0xf6f2('0x66')](_0x2ec204[_0xf6f2('0x65')]);_0x5a2ad6++){if(_0x2af307['min_internal']<=_0x69ab02[_0x5a2ad6][_0xf6f2('0x6b')]){_0x2ec204[_0xf6f2('0x65')]=_0x69ab02[_0x5a2ad6]['from'];}else if(_0x2af307[_0xf6f2('0x67')]>_0x69ab02[_0x5a2ad6][_0xf6f2('0x6b')]&&_0x2af307[_0xf6f2('0x67')]<=_0x69ab02[_0x5a2ad6]['to']){_0x2ec204['internal']=_0x2af307[_0xf6f2('0x67')];}}}if(_[_0xf6f2('0x66')](_0x2ec204[_0xf6f2('0x65')])){_0x2ec204[_0xf6f2('0x65')]=_0x16a26e+0x1;}return _0x508460(_0x2ec204);});});})[_0xf6f2('0x1c')](function(_0x7d461f){_0x3651dd(_0x7d461f);});});}function updateUser(_0x25dbc5){return new BPromise(function(_0x1866a5,_0xe4279b){try{if(_0x25dbc5[_0xf6f2('0x6c')]){_0x25dbc5[_0xf6f2('0x6d')]=_0x25dbc5[_0xf6f2('0x65')];_0x25dbc5[_0xf6f2('0x6e')]={'mailbox':_0x25dbc5[_0xf6f2('0x65')],'password':_0x25dbc5[_0xf6f2('0x3d')],'fullname':_0x25dbc5[_0xf6f2('0x6f')],'email':_0x25dbc5[_0xf6f2('0x70')]};}if(_0x25dbc5[_0xf6f2('0x29')]===_0xf6f2('0x2d')){if(!_0x25dbc5[_0xf6f2('0x71')])_0x25dbc5[_0xf6f2('0x71')]=[_0xf6f2('0x72'),'102',_0xf6f2('0x73'),_0xf6f2('0x74'),_0xf6f2('0x75'),'104','105','106',_0xf6f2('0x76'),_0xf6f2('0x77'),_0xf6f2('0x78'),_0xf6f2('0x79'),_0xf6f2('0x7a'),_0xf6f2('0x7b'),_0xf6f2('0x7c')];}_0x1866a5(_0x25dbc5);}catch(_0x2170d2){_0xe4279b(_0x2170d2);}});}exports[_0xf6f2('0x7d')]=function(_0xcf3079,_0x184cd0){if(_0xcf3079['user'][_0xf6f2('0x29')]===_0xf6f2('0x2d'))throw new Error(_0xf6f2('0x7e'));if(_0xcf3079[_0xf6f2('0x5c')][_0xf6f2('0x29')]==='user'&&_0xcf3079['user'][_0xf6f2('0x29')]!==_0xf6f2('0x2a')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0xcf3079[_0xf6f2('0x5c')][_0xf6f2('0x29')]===_0xf6f2('0x2a')&&_0xcf3079['user']['role']!==_0xf6f2('0x2a')){throw new Error(_0xf6f2('0x7f'));}return licenseUtil[_0xf6f2('0x80')]([_0xcf3079['body']])[_0xf6f2('0x11')](function(){return validateUser(_0xcf3079[_0xf6f2('0x5c')]);})[_0xf6f2('0x11')](function(_0x403a21){return updateUser(_0x403a21)['then'](function(_0x25ec3e){if(_0x25ec3e[_0xf6f2('0x29')]==='admin'){_0x25ec3e[_0xf6f2('0x81')]=_0xcf3079[_0xf6f2('0x2b')][_0xf6f2('0x81')];delete _0x25ec3e[_0xf6f2('0x82')];}return _0x25ec3e;});})[_0xf6f2('0x11')](function(_0x28b0ff){return db['User'][_0xf6f2('0x7d')](_0x28b0ff,{'include':[{'model':db[_0xf6f2('0x6e')],'as':_0xf6f2('0x6e')}]});})[_0xf6f2('0x11')](function(_0x3f41d1){if(_0xcf3079[_0xf6f2('0x5c')][_0xf6f2('0x29')]===_0xf6f2('0x2b'))return _0x3f41d1;if(_0xcf3079[_0xf6f2('0x2b')][_0xf6f2('0x29')]!==_0xf6f2('0x2b'))return _0x3f41d1;return db[_0xf6f2('0x83')][_0xf6f2('0x59')]({'where':{'name':_0x3f41d1[_0xf6f2('0x29')]==='agent'?_0xf6f2('0x2c'):'Telephones','userProfileId':_0xcf3079[_0xf6f2('0x2b')][_0xf6f2('0x82')]},'raw':!![]})['then'](function(_0xd54d4c){if(!_0xd54d4c||_0xd54d4c[_0xf6f2('0x84')]!=0x0)return _0x3f41d1;return db[_0xf6f2('0x85')][_0xf6f2('0x7d')]({'name':_0x3f41d1[_0xf6f2('0x35')],'resourceId':_0x3f41d1['id'],'type':_0xd54d4c[_0xf6f2('0x35')],'sectionId':_0xd54d4c['id']},{})[_0xf6f2('0x11')](function(){return _0x3f41d1;});})[_0xf6f2('0x1c')](function(_0x4b5450){logger['error'](_0xf6f2('0x86'),_0x4b5450);throw _0x4b5450;});})[_0xf6f2('0x11')](respondWithResult(_0x184cd0,0xc9))[_0xf6f2('0x1c')](handleError(_0x184cd0,null));};exports['bulkCreate']=function(_0x6e038c,_0x24705d){var _0x21221c=_0x6e038c['body'];var _0x35d474=[];if(_0x6e038c[_0xf6f2('0x2b')][_0xf6f2('0x29')]==='agent')throw new Error(_0xf6f2('0x7e'));if(_['some'](_0x21221c,[_0xf6f2('0x29'),_0xf6f2('0x2b')])&&_0x6e038c[_0xf6f2('0x2b')]['role']!==_0xf6f2('0x2a')){throw new Error(_0xf6f2('0x87'));}if(_[_0xf6f2('0x88')](_0x21221c,[_0xf6f2('0x29'),_0xf6f2('0x2a')])&&_0x6e038c[_0xf6f2('0x2b')][_0xf6f2('0x29')]!==_0xf6f2('0x2a')){throw new Error(_0xf6f2('0x89'));}return licenseUtil['checkUserLimits'](_0x21221c)[_0xf6f2('0x11')](function(){return validateUser(_0x21221c[0x0]);})[_0xf6f2('0x11')](function(){for(var _0x578d5e=0x1;_0x578d5e<_0x21221c[_0xf6f2('0x47')];_0x578d5e++){var _0x6e6558=_0x21221c[_0x578d5e-0x1][_0xf6f2('0x65')];if(!_0x21221c[_0x578d5e][_0xf6f2('0x65')])_0x21221c[_0x578d5e][_0xf6f2('0x65')]=_0x6e6558+0x1;_0x35d474['push'](validateUser(_0x21221c[_0x578d5e]));}return BPromise['all'](_0x35d474);})['then'](function(){_0x35d474=[];for(var _0x300e6d=0x0;_0x300e6d<_0x21221c['length'];_0x300e6d++){_0x35d474['push'](updateUser(_0x21221c[_0x300e6d]));}return BPromise['all'](_0x35d474);})[_0xf6f2('0x11')](function(){return BPromise['each'](_0x21221c,function(_0x294ff6){return db['User'][_0xf6f2('0x7d')](_0x294ff6,{'include':[{'model':db[_0xf6f2('0x6e')],'as':_0xf6f2('0x6e')}]})['then'](function(_0x12fdbb){_0x294ff6['id']=_0x12fdbb['id'];return _0x294ff6;});});})[_0xf6f2('0x11')](function(_0x2beb57){if(_0x6e038c[_0xf6f2('0x5c')]['role']===_0xf6f2('0x2b'))return _0x2beb57;if(_0x6e038c['user']['role']!=='user')return _0x2beb57;var _0x56cdfd=_['some'](_0x2beb57,function(_0x15b1ae){return _0x15b1ae[_0xf6f2('0x29')]===_0xf6f2('0x2d')||_0x15b1ae['role']===_0xf6f2('0x2f');});if(!_0x56cdfd)return _0x2beb57;return db['UserProfileSection'][_0xf6f2('0x44')]({'where':{'name':{'$or':[_0xf6f2('0x2c'),'Telephones']},'userProfileId':_0x6e038c[_0xf6f2('0x2b')][_0xf6f2('0x82')]},'raw':!![]})['then'](function(_0x454e89){if(_[_0xf6f2('0x8a')](_0x454e89)||!_[_0xf6f2('0x88')](_0x454e89,[_0xf6f2('0x84'),0x0]))return _0x2beb57;_0x35d474=[];var _0x23685b=_(_0x454e89)['map'](function(_0x1f989e){if(_0x1f989e[_0xf6f2('0x84')]===0x1)return;return _0x1f989e['name']==='Agents'?_0xf6f2('0x2d'):_0xf6f2('0x2f');})['compact']()[_0xf6f2('0x33')]();for(var _0x53cd73=0x0;_0x53cd73<_0x2beb57[_0xf6f2('0x47')];_0x53cd73++){if(!_[_0xf6f2('0x34')](_0x23685b,_0x2beb57[_0x53cd73]['role']))return;var _0x3cd76d=_0x2beb57[_0x53cd73][_0xf6f2('0x29')]===_0xf6f2('0x2d')?'Agents':'Telephones';_0x35d474[_0xf6f2('0x43')](db['UserProfileResource'][_0xf6f2('0x7d')]({'name':_0x2beb57[_0x53cd73][_0xf6f2('0x35')],'resourceId':_0x2beb57[_0x53cd73]['id'],'type':_0x3cd76d,'sectionId':_[_0xf6f2('0x59')](_0x454e89,[_0xf6f2('0x35'),_0x3cd76d])['id']},{}));}return BPromise['all'](_0x35d474);});})[_0xf6f2('0x11')](respondWithResult(_0x24705d,0xc9))[_0xf6f2('0x1c')](handleError(_0x24705d,null));};exports[_0xf6f2('0x8b')]=function(_0x15f3d0,_0xfb5ae9){if(_0x15f3d0[_0xf6f2('0x5c')]['id']){delete _0x15f3d0[_0xf6f2('0x5c')]['id'];}return db[_0xf6f2('0x3a')]['find']({'where':{'id':_0x15f3d0[_0xf6f2('0x4f')]['id']}})[_0xf6f2('0x11')](function(_0x7f6e69){if(!_0x7f6e69)return null;if(_0x7f6e69['id']===_0x15f3d0[_0xf6f2('0x2b')]['id']){if(!_0x15f3d0['body']['oldPassword']||!_0x15f3d0['body'][_0xf6f2('0x8c')]){throw new db[(_0xf6f2('0x8d'))]['ValidationError']('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x7f6e69[_0xf6f2('0x8e')](_0x15f3d0['body'][_0xf6f2('0x8f')])){throw new db['Sequelize']['ValidationError'](_0xf6f2('0x90'));}if(_0x15f3d0[_0xf6f2('0x5c')]['oldPassword']===_0x15f3d0[_0xf6f2('0x5c')][_0xf6f2('0x8c')]){throw new db[(_0xf6f2('0x8d'))][(_0xf6f2('0x91'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x15f3d0[_0xf6f2('0x2b')]['role']===_0xf6f2('0x2a')){if(!_0x15f3d0[_0xf6f2('0x5c')][_0xf6f2('0x8c')]){throw new db[(_0xf6f2('0x8d'))][(_0xf6f2('0x91'))](_0xf6f2('0x92'));}}else if(_0x15f3d0[_0xf6f2('0x2b')][_0xf6f2('0x29')]===_0xf6f2('0x2b')){if(!_0x15f3d0['body'][_0xf6f2('0x8c')]){throw new db[(_0xf6f2('0x8d'))][(_0xf6f2('0x91'))](_0xf6f2('0x92'));}if(_0x7f6e69[_0xf6f2('0x29')]!==_0xf6f2('0x2d')){throw new db[(_0xf6f2('0x8d'))][(_0xf6f2('0x91'))]('Unauthorized');}}else{throw new db['Sequelize']['ValidationError']('Unauthorized');}return _0x7f6e69;})['then'](handleEntityNotFound(_0xfb5ae9,null))[_0xf6f2('0x11')](function(_0xdd4d0f){return db['Setting']['findOne']({'attributes':['id',_0xf6f2('0x93'),'enforcePasswordHistory','passwordHistoryLimit']})[_0xf6f2('0x11')](function(_0x4d7580){if(_0x4d7580[_0xf6f2('0x93')])authService[_0xf6f2('0x63')](_0x15f3d0[_0xf6f2('0x5c')][_0xf6f2('0x8c')]);if(!_0x4d7580[_0xf6f2('0x94')]||!_0xdd4d0f[_0xf6f2('0x95')])return _0xdd4d0f;authService[_0xf6f2('0x96')](_0x15f3d0[_0xf6f2('0x5c')]['newPassword'],_0xdd4d0f[_0xf6f2('0x95')],_0x4d7580['passwordHistoryLimit']);return _0xdd4d0f;})[_0xf6f2('0x11')](saveUpdates({'password':_0x15f3d0[_0xf6f2('0x5c')][_0xf6f2('0x8c')],'passwordResetAt':_0x15f3d0['user']['id']==_0x15f3d0['params']['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x15f3d0[_0xf6f2('0x5c')]['newPassword'],_0xdd4d0f[_0xf6f2('0x95')])},null));})[_0xf6f2('0x11')](respondWithResult(_0xfb5ae9,null))['catch'](handleError(_0xfb5ae9,null));};exports[_0xf6f2('0x97')]=function(_0xbd9697,_0x185be2){var _0x48a9e9=_0xbd9697[_0xf6f2('0x5c')][_0xf6f2('0x98')];return db[_0xf6f2('0x3a')][_0xf6f2('0x59')]({'where':{'id':_0xbd9697['params']['id']},'attributes':['id',_0xf6f2('0x35'),_0xf6f2('0x29'),_0xf6f2('0x99'),_0xf6f2('0x9a'),'voicePause',_0xf6f2('0x9b')]})[_0xf6f2('0x11')](handleEntityNotFound(_0x185be2,null))[_0xf6f2('0x11')](function(_0xa7b942){if(_0xa7b942){if(!utils[_0xf6f2('0x9c')](_0x48a9e9)){throw new db['Sequelize']['ValidationError'](_0xf6f2('0x9d'));}return _0xa7b942[_0xf6f2('0x9e')+_['capitalize'](_0x48a9e9[_0xf6f2('0x9f')]())+_0xf6f2('0xa0')](_0xbd9697['body'][_0xf6f2('0x5f')],{'penalty':_0xbd9697['body'][_0xf6f2('0xa1')]||0x0})[_0xf6f2('0xa2')](function(_0x4f1dfd){for(var _0x2dd37d=0x0;_0x2dd37d<_0xbd9697['body']['ids'][_0xf6f2('0x47')];_0x2dd37d+=0x1){var _0xac4fce={'UserId':Number(_0xbd9697[_0xf6f2('0x4f')]['id'])};_0xac4fce[_['capitalize'](_0x48a9e9['toLowerCase']())+'QueueId']=Number(_0xbd9697[_0xf6f2('0x5c')][_0xf6f2('0x5f')][_0x2dd37d]);socket[_0xf6f2('0xa3')](_0xf6f2('0x2b')+_[_0xf6f2('0xa4')](_0x48a9e9[_0xf6f2('0x9f')]())+_0xf6f2('0xa5'),_0xac4fce);}return _0x4f1dfd;})['then'](function(){if(_0x48a9e9===_0xf6f2('0xa6')){return db[_0xf6f2('0xa7')][_0xf6f2('0x44')]({'where':{'id':_0xbd9697[_0xf6f2('0x5c')]['ids']||[]},'raw':!![],'attributes':['id',_0xf6f2('0x35')]});}})['then'](function(_0xb29988){var _0x25803d=_0xa7b942[_0xf6f2('0x28')]({'plain':!![]});var _0x24e8d5=[];if(_0x48a9e9===_0xf6f2('0xa6')&&_0x25803d[_0xf6f2('0x29')]===_0xf6f2('0x2d')&&_0x25803d[_0xf6f2('0x99')]){for(var _0x3d38bf=0x0;_0x3d38bf<_0xb29988[_0xf6f2('0x47')];_0x3d38bf+=0x1){_0x24e8d5[_0xf6f2('0x43')]({'membername':_0x25803d['name'],'UserId':_0x25803d['id'],'queue_name':_0xb29988[_0x3d38bf][_0xf6f2('0x35')],'VoiceQueueId':_0xb29988[_0x3d38bf]['id'],'interface':_[_0xf6f2('0x66')](_0x25803d[_0xf6f2('0x9b')])?util[_0xf6f2('0xa8')]('SIP/%s',_0x25803d['name']):_0x25803d[_0xf6f2('0x9b')],'paused':_0x25803d['voicePause']||![],'penalty':_0xbd9697[_0xf6f2('0x5c')][_0xf6f2('0xa1')]||0x0});}return BPromise[_0xf6f2('0xa9')](_0x24e8d5,function(_0x455c68){return db['UserVoiceQueueRt'][_0xf6f2('0xaa')](_0x455c68);});}return _0xa7b942;});}})[_0xf6f2('0x11')](respondWithStatusCode(_0x185be2,null))[_0xf6f2('0x1c')](handleError(_0x185be2,null));};exports[_0xf6f2('0xab')]=function(_0x129f5c,_0x466a42){var _0x14c575;return db[_0xf6f2('0x3a')][_0xf6f2('0x59')]({'where':{'id':_0x129f5c[_0xf6f2('0x4f')]['id']},'attributes':['id','name',_0xf6f2('0x29')]})[_0xf6f2('0x11')](handleEntityNotFound(_0x466a42,null))['then'](function(_0x3cef61){if(_0x3cef61){_0x14c575=_0x3cef61;if(!_0x129f5c[_0xf6f2('0x40')][_0xf6f2('0x98')]||!utils[_0xf6f2('0x9c')](_0x129f5c[_0xf6f2('0x40')][_0xf6f2('0x98')])){throw new db['Sequelize'][(_0xf6f2('0x91'))]('Unknown\x20channel');}return _0x3cef61[_0xf6f2('0xac')+_[_0xf6f2('0xa4')](_0x129f5c[_0xf6f2('0x40')][_0xf6f2('0x98')][_0xf6f2('0x9f')]())+_0xf6f2('0xa0')](_0x129f5c[_0xf6f2('0x40')][_0xf6f2('0x5f')]);}})['then'](function(_0x419653){if(_['isArray'](_0x129f5c[_0xf6f2('0x40')][_0xf6f2('0x5f')])){for(var _0x290ef6=0x0;_0x290ef6<_0x129f5c[_0xf6f2('0x40')][_0xf6f2('0x5f')][_0xf6f2('0x47')];_0x290ef6+=0x1){var _0x3609ec={'UserId':Number(_0x129f5c[_0xf6f2('0x4f')]['id'])};_0x3609ec[_[_0xf6f2('0xa4')](_0x129f5c[_0xf6f2('0x40')][_0xf6f2('0x98')][_0xf6f2('0x9f')]())+'QueueId']=Number(_0x129f5c[_0xf6f2('0x40')][_0xf6f2('0x5f')][_0x290ef6]);socket[_0xf6f2('0xa3')](_0xf6f2('0x2b')+_[_0xf6f2('0xa4')](_0x129f5c[_0xf6f2('0x40')]['channel']['toLowerCase']())+_0xf6f2('0xad'),_0x3609ec);}}else{var _0x3609ec={'UserId':Number(_0x129f5c[_0xf6f2('0x4f')]['id'])};_0x3609ec[_[_0xf6f2('0xa4')](_0x129f5c[_0xf6f2('0x40')]['channel']['toLowerCase']())+'QueueId']=Number(_0x129f5c[_0xf6f2('0x40')]['ids']);socket[_0xf6f2('0xa3')](_0xf6f2('0x2b')+_[_0xf6f2('0xa4')](_0x129f5c[_0xf6f2('0x40')][_0xf6f2('0x98')][_0xf6f2('0x9f')]())+'Queue:remove',_0x3609ec);}return _0x419653;})['then'](function(){if(_0x129f5c['query'][_0xf6f2('0x98')]===_0xf6f2('0xa6')){return db[_0xf6f2('0xae')][_0xf6f2('0x27')]({'where':{'UserId':_0x129f5c['params']['id'],'VoiceQueueId':_0x129f5c[_0xf6f2('0x40')][_0xf6f2('0x5f')]},'individualHooks':!![]})[_0xf6f2('0x11')](function(){return _0x14c575;});}return _0x14c575;})['then'](respondWithStatusCode(_0x466a42,null))[_0xf6f2('0x1c')](handleError(_0x466a42,null));};exports[_0xf6f2('0xaf')]=function(_0x13fb5f,_0x1ee544){_0x13fb5f[_0xf6f2('0x5c')]['userpic']=_0x13fb5f[_0xf6f2('0xb0')]['filename'];return db[_0xf6f2('0x3a')][_0xf6f2('0x59')]({'where':{'id':_0x13fb5f[_0xf6f2('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1ee544,null))[_0xf6f2('0x11')](saveUpdates(_0x13fb5f[_0xf6f2('0x5c')],null))['then'](respondWithResult(_0x1ee544,null))[_0xf6f2('0x1c')](handleError(_0x1ee544,null));};exports['getAvatar']=function(_0x45ecd5,_0x3a0285){var _0x1cf799=path[_0xf6f2('0xb1')](config[_0xf6f2('0xb2')],'server/files/images/logos/default_profile.png');return db[_0xf6f2('0x3a')][_0xf6f2('0x59')]({'where':{'id':_0x45ecd5['params']['id']},'attributes':['id',_0xf6f2('0xb3')],'raw':!![]})['then'](handleEntityNotFound(_0x3a0285,null))[_0xf6f2('0x11')](function(_0x432c12){if(_0x432c12){if(_[_0xf6f2('0x66')](_0x432c12[_0xf6f2('0xb3')])){return _0x3a0285[_0xf6f2('0xb4')](_0x1cf799);}else{if(!fs[_0xf6f2('0xb5')](path['join'](config[_0xf6f2('0xb2')],_0xf6f2('0xb6'),_0x432c12[_0xf6f2('0xb3')]))){return _0x3a0285[_0xf6f2('0xb4')](_0x1cf799);}return _0x3a0285[_0xf6f2('0xb4')](path[_0xf6f2('0xb1')](config[_0xf6f2('0xb2')],'server/files/images/',_0x432c12[_0xf6f2('0xb3')]));}}})['catch'](handleError(_0x3a0285,null));};exports[_0xf6f2('0xb7')]=function(_0x29ec65,_0x5371fa){return db['User'][_0xf6f2('0x59')]({'where':{'id':_0x29ec65['params']['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x5371fa,null))['then'](function(_0x2fd4b2){var _0x358f51=[];values=_0x2fd4b2[_0xf6f2('0x49')];_0x358f51[_0xf6f2('0x43')](get_open_tabs(_0xf6f2('0x48'),_0x2fd4b2['dataValues']));_0x358f51[_0xf6f2('0x43')](get_open_tabs(_0xf6f2('0x4a'),_0x2fd4b2[_0xf6f2('0x49')]));_0x358f51[_0xf6f2('0x43')](get_open_tabs(_0xf6f2('0x5b'),_0x2fd4b2[_0xf6f2('0x49')]));_0x358f51[_0xf6f2('0x43')](get_open_tabs('whatsapp',_0x2fd4b2[_0xf6f2('0x49')]));_0x358f51[_0xf6f2('0x43')](get_open_tabs(_0xf6f2('0x4b'),_0x2fd4b2[_0xf6f2('0x49')]));_0x358f51[_0xf6f2('0x43')](get_open_tabs(_0xf6f2('0xb8'),_0x2fd4b2[_0xf6f2('0x49')]));return BPromise['all'](_0x358f51);})[_0xf6f2('0x11')](function(_0x552fe9){var _0x280936=[];if(_0x552fe9){for(var _0x3be39b=0x0;_0x3be39b=_0x2d68ca){_0x4ee0b5=_0x2d68ca;_0x21f817=0xc8;}else{_0x21f817=0xce;}_0x4b24cb[_0xd4fa('0x1f')](_0x21f817);return _0x4b24cb['set'](_0xd4fa('0x25'),_0x3c6d17+'-'+_0x4ee0b5+'/'+_0x2d68ca)[_0xd4fa('0x20')](_0x14ea6e);}return null;};}function saveUpdates(_0x1b16ba){return function(_0x5345c4){if(_0x5345c4){return _0x5345c4[_0xd4fa('0x26')](_0x1b16ba)[_0xd4fa('0x14')](function(_0x59a46a){return _0x59a46a;});}return null;};}function removeEntity(_0x182406){return function(_0x1c0fd8){if(_0x1c0fd8){return _0x1c0fd8['destroy']()[_0xd4fa('0x14')](function(){var _0x21a96b=_0x1c0fd8[_0xd4fa('0x27')]({'plain':!![]});if(_0x21a96b[_0xd4fa('0x28')]===_0xd4fa('0x29'))return;var _0x32bfb5=[{'name':_0xd4fa('0x2a'),'value':_0xd4fa('0x2b'),'ignore':!![]},{'name':'Agents','value':_0xd4fa('0x2c'),'ignore':![]},{'name':_0xd4fa('0x2d'),'value':_0xd4fa('0x2e'),'ignore':![]}];var _0x3c982c=_(_0x32bfb5)['filter'](_0xd4fa('0x2f'))[_0xd4fa('0x30')](_0xd4fa('0x31'))[_0xd4fa('0x31')]();if(_['includes'](_0x3c982c,_0x21a96b['role'])){return;}var _0x59f899=_['find'](_0x32bfb5,[_0xd4fa('0x31'),_0x21a96b[_0xd4fa('0x28')]])['name'];return db['UserProfileResource']['destroy']({'where':{'type':_0x59f899,'resourceId':_0x21a96b['id']}})['then'](function(){return _0x1c0fd8;});})[_0xd4fa('0x14')](function(){_0x182406[_0xd4fa('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43148f){return function(_0x43df3b){if(!_0x43df3b){_0x43148f['sendStatus'](0x194);}return _0x43df3b;};}function handleError(_0x3dd5ca,_0x59d9e6){_0x59d9e6=_0x59d9e6||0x1f4;return function(_0x38cd33){logger['error'](_0x38cd33[_0xd4fa('0x32')]);if(_0x38cd33[_0xd4fa('0x33')]){delete _0x38cd33[_0xd4fa('0x33')];}_0x3dd5ca[_0xd4fa('0x1f')](_0x59d9e6)[_0xd4fa('0x34')](_0x38cd33);};}exports['index']=function(_0x3f2fd4,_0x43c5da){var _0x3e0f5b={},_0x28bc55={'count':0x0,'rows':[]};var _0xe7b22a=_(db[_0xd4fa('0x35')]['rawAttributes'])[_0xd4fa('0x30')](function(_0x9d5b3f){return{'name':_0x9d5b3f[_0xd4fa('0x36')],'type':_0x9d5b3f[_0xd4fa('0x37')][_0xd4fa('0x38')]};})['filter'](function(_0x4146a8){return!_['includes']([_0xd4fa('0x39'),_0xd4fa('0x3a')],_0x4146a8['name']);})['value']();_0x3e0f5b=qs['getOptions'](_0xe7b22a,_0x3f2fd4);var _0x26772b={'where':_0x3e0f5b[_0xd4fa('0x3b')]};return db[_0xd4fa('0x35')]['count'](_0x26772b)[_0xd4fa('0x14')](function(_0x9012c5){_0x28bc55[_0xd4fa('0x24')]=_0x9012c5;if(_0x3f2fd4[_0xd4fa('0x3c')]['includeAll']){_0x3e0f5b['include']=[{'all':!![]}];}if(!_[_0xd4fa('0x3d')](_0x3e0f5b[_0xd4fa('0x3e')],'id')){_0x3e0f5b[_0xd4fa('0x3e')][_0xd4fa('0x3f')]('id');}return db[_0xd4fa('0x35')]['findAll'](_0x3e0f5b);})[_0xd4fa('0x14')](function(_0x17344f){_0x28bc55[_0xd4fa('0x40')]=_0x17344f;if(_0x3f2fd4[_0xd4fa('0x3c')][_0xd4fa('0x41')]===_0xd4fa('0x42')){var _0x44efeb=[];for(var _0x5c153b=0x0;_0x5c153b<_0x28bc55[_0xd4fa('0x40')][_0xd4fa('0x43')];_0x5c153b++){_0x44efeb[_0xd4fa('0x3f')](get_open_tabs(_0xd4fa('0x44'),_0x28bc55['rows'][_0x5c153b][_0xd4fa('0x45')]));_0x44efeb[_0xd4fa('0x3f')](get_open_tabs(_0xd4fa('0x46'),_0x28bc55[_0xd4fa('0x40')][_0x5c153b][_0xd4fa('0x45')]));_0x44efeb[_0xd4fa('0x3f')](get_open_tabs(_0xd4fa('0x47'),_0x28bc55[_0xd4fa('0x40')][_0x5c153b][_0xd4fa('0x45')]));_0x44efeb[_0xd4fa('0x3f')](get_open_tabs(_0xd4fa('0x48'),_0x28bc55[_0xd4fa('0x40')][_0x5c153b][_0xd4fa('0x45')]));_0x44efeb[_0xd4fa('0x3f')](get_open_tabs(_0xd4fa('0x49'),_0x28bc55['rows'][_0x5c153b][_0xd4fa('0x45')]));_0x44efeb[_0xd4fa('0x3f')](get_open_tabs(_0xd4fa('0x4a'),_0x28bc55['rows'][_0x5c153b][_0xd4fa('0x45')]));}return BPromise[_0xd4fa('0x4b')](_0x44efeb)[_0xd4fa('0x14')](function(_0x48fdca){return _0x28bc55;});}else{return _0x28bc55;}})['then'](respondWithFilteredResult(_0x43c5da,_0x3e0f5b))[_0xd4fa('0x1d')](handleError(_0x43c5da,null));};exports['show']=function(_0x135397,_0x53a14a){var _0x105120={'raw':![],'where':{'id':_0x135397[_0xd4fa('0x4c')]['id']}},_0x4c2fbc={};_0x4c2fbc[_0xd4fa('0x4d')]=_[_0xd4fa('0x4e')](_[_0xd4fa('0x4f')](db[_0xd4fa('0x35')][_0xd4fa('0x50')]),['password','salt']);_0x4c2fbc[_0xd4fa('0x3c')]=_[_0xd4fa('0x4f')](_0x135397[_0xd4fa('0x3c')]);_0x4c2fbc[_0xd4fa('0x51')]=_[_0xd4fa('0x52')](_0x4c2fbc[_0xd4fa('0x4d')],_0x4c2fbc[_0xd4fa('0x3c')]);_0x105120[_0xd4fa('0x3e')]=_['intersection'](_0x4c2fbc[_0xd4fa('0x4d')],qs[_0xd4fa('0x53')](_0x135397[_0xd4fa('0x3c')][_0xd4fa('0x53')]));_0x105120[_0xd4fa('0x3e')]=_0x105120[_0xd4fa('0x3e')][_0xd4fa('0x43')]?_0x105120[_0xd4fa('0x3e')]:_0x4c2fbc[_0xd4fa('0x4d')];if(_0x135397[_0xd4fa('0x3c')]['includeAll']){_0x105120['include']=[{'all':!![]}];}_0x105120=_[_0xd4fa('0x54')]({},_0x105120,_0x135397[_0xd4fa('0x55')]);if(!_['includes'](_0x105120[_0xd4fa('0x3e')],'id')){_0x105120[_0xd4fa('0x3e')][_0xd4fa('0x3f')]('id');}return db['User']['find'](_0x105120)[_0xd4fa('0x14')](handleEntityNotFound(_0x53a14a,null))[_0xd4fa('0x14')](function(_0x224fd6){var _0x36aaf7=[];values=_0x224fd6;if(_0x135397[_0xd4fa('0x3c')][_0xd4fa('0x41')]===_0xd4fa('0x42')){_0x36aaf7['push'](get_open_tabs(_0xd4fa('0x44'),_0x224fd6[_0xd4fa('0x45')]));_0x36aaf7[_0xd4fa('0x3f')](get_open_tabs(_0xd4fa('0x46'),_0x224fd6['dataValues']));_0x36aaf7[_0xd4fa('0x3f')](get_open_tabs(_0xd4fa('0x49'),_0x224fd6[_0xd4fa('0x45')]));_0x36aaf7[_0xd4fa('0x3f')](get_open_tabs(_0xd4fa('0x4a'),_0x224fd6[_0xd4fa('0x45')]));_0x36aaf7[_0xd4fa('0x3f')](get_open_tabs(_0xd4fa('0x47'),_0x224fd6['dataValues']));_0x36aaf7['push'](get_open_tabs(_0xd4fa('0x48'),_0x224fd6[_0xd4fa('0x45')]));return BPromise[_0xd4fa('0x4b')](_0x36aaf7);}else{return values;}})[_0xd4fa('0x14')](function(_0x101113){return values;})[_0xd4fa('0x14')](respondWithResult(_0x53a14a,null))[_0xd4fa('0x1d')](handleError(_0x53a14a,null));};exports[_0xd4fa('0x26')]=function(_0xbfe8e9,_0x2ee6e5){if(_0xbfe8e9[_0xd4fa('0x56')]['id']){delete _0xbfe8e9[_0xd4fa('0x56')]['id'];}delete _0xbfe8e9[_0xd4fa('0x56')]['role'];return db['User'][_0xd4fa('0x57')]({'where':{'id':_0xbfe8e9['params']['id']}})[_0xd4fa('0x14')](handleEntityNotFound(_0x2ee6e5,null))['then'](saveUpdates(_0xbfe8e9[_0xd4fa('0x56')],null))[_0xd4fa('0x14')](respondWithResult(_0x2ee6e5,null))[_0xd4fa('0x1d')](handleError(_0x2ee6e5,null));};exports['describe']=function(_0x1981de,_0x1ce8aa){return db[_0xd4fa('0x35')][_0xd4fa('0x58')]()['then'](respondWithResult(_0x1ce8aa,null))[_0xd4fa('0x1d')](handleError(_0x1ce8aa,null));};exports['addContacts']=function(_0x1abf7d,_0x42bd69){return db[_0xd4fa('0x35')][_0xd4fa('0x57')]({'where':{'id':_0x1abf7d[_0xd4fa('0x4c')]['id']}})[_0xd4fa('0x14')](handleEntityNotFound(_0x42bd69,null))[_0xd4fa('0x14')](function(_0x515b78){if(_0x515b78){return _0x515b78[_0xd4fa('0x59')](_0x1abf7d[_0xd4fa('0x56')]['ids'],_[_0xd4fa('0x5a')](_0x1abf7d['body'],[_0xd4fa('0x5b'),'id'])||{});}})['then'](respondWithResult(_0x42bd69,null))[_0xd4fa('0x1d')](handleError(_0x42bd69,null));};function validateUser(_0x21e57f){return new BPromise(function(_0x3d098a,_0x6b47bb){if(_0x21e57f[_0xd4fa('0x5c')])return _0x3d098a(_0x21e57f);return db['Setting'][_0xd4fa('0x5d')](0x1)[_0xd4fa('0x14')](function(_0xb2c0c9){if(_0xb2c0c9[_0xd4fa('0x5e')])authService['validatePasswordPattern'](_0x21e57f[_0xd4fa('0x39')]);db[_0xd4fa('0x35')][_0xd4fa('0x5f')](_0xd4fa('0x5c'))[_0xd4fa('0x14')](function(_0x3cc349){if(_[_0xd4fa('0x60')](_0x3cc349)){_0x21e57f[_0xd4fa('0x5c')]=_0xb2c0c9[_0xd4fa('0x61')]||0x1;return;}if(_[_0xd4fa('0x60')](_0xb2c0c9[_0xd4fa('0x61')])||_0xb2c0c9[_0xd4fa('0x61')]===_0x3cc349){_0x21e57f['internal']=_0x3cc349+0x1;return;}if(_0xb2c0c9['min_internal']>_0x3cc349){_0x21e57f[_0xd4fa('0x5c')]=_0xb2c0c9[_0xd4fa('0x61')];return;}return db['sequelize'][_0xd4fa('0x3c')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db['sequelize'][_0xd4fa('0x62')]['SELECT']})[_0xd4fa('0x14')](function(_0x3a60d0){if(_0x3a60d0&&_0x3a60d0[_0xd4fa('0x43')]){for(var _0x19ff9e=0x0,_0x2eb2f7=_0x3a60d0[_0xd4fa('0x43')];_0x19ff9e<_0x2eb2f7&&_[_0xd4fa('0x60')](_0x21e57f[_0xd4fa('0x5c')]);_0x19ff9e++){if(_0xb2c0c9[_0xd4fa('0x61')]<=_0x3a60d0[_0x19ff9e][_0xd4fa('0x63')]){_0x21e57f[_0xd4fa('0x5c')]=_0x3a60d0[_0x19ff9e][_0xd4fa('0x63')];}else if(_0xb2c0c9[_0xd4fa('0x61')]>_0x3a60d0[_0x19ff9e][_0xd4fa('0x63')]&&_0xb2c0c9[_0xd4fa('0x61')]<=_0x3a60d0[_0x19ff9e]['to']){_0x21e57f[_0xd4fa('0x5c')]=_0xb2c0c9['min_internal'];}}}if(_[_0xd4fa('0x60')](_0x21e57f['internal'])){_0x21e57f[_0xd4fa('0x5c')]=_0x3cc349+0x1;}return _0x3d098a(_0x21e57f);});});})['catch'](function(_0x4eebf6){_0x6b47bb(_0x4eebf6);});});}function updateUser(_0xfc5123){return new BPromise(function(_0x211d4a,_0x40f3d3){try{if(_0xfc5123[_0xd4fa('0x64')]){_0xfc5123[_0xd4fa('0x65')]=_0xfc5123[_0xd4fa('0x5c')];_0xfc5123[_0xd4fa('0x66')]={'mailbox':_0xfc5123[_0xd4fa('0x5c')],'password':_0xfc5123[_0xd4fa('0x39')],'fullname':_0xfc5123[_0xd4fa('0x67')],'email':_0xfc5123[_0xd4fa('0x68')]};}if(_0xfc5123[_0xd4fa('0x28')]===_0xd4fa('0x2c')){if(!_0xfc5123[_0xd4fa('0x69')])_0xfc5123[_0xd4fa('0x69')]=[_0xd4fa('0x6a'),_0xd4fa('0x6b'),_0xd4fa('0x6c'),_0xd4fa('0x6d'),_0xd4fa('0x6e'),_0xd4fa('0x6f'),'105','106',_0xd4fa('0x70'),'108',_0xd4fa('0x71'),'100',_0xd4fa('0x72'),_0xd4fa('0x73'),_0xd4fa('0x74')];}_0x211d4a(_0xfc5123);}catch(_0x299221){_0x40f3d3(_0x299221);}});}exports['create']=function(_0x4bd6ab,_0x2cca20){if(_0x4bd6ab[_0xd4fa('0x2b')]['role']==='agent')throw new Error(_0xd4fa('0x75'));if(_0x4bd6ab['body'][_0xd4fa('0x28')]===_0xd4fa('0x2b')&&_0x4bd6ab[_0xd4fa('0x2b')][_0xd4fa('0x28')]!==_0xd4fa('0x29')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x4bd6ab['body'][_0xd4fa('0x28')]===_0xd4fa('0x29')&&_0x4bd6ab[_0xd4fa('0x2b')][_0xd4fa('0x28')]!=='admin'){throw new Error(_0xd4fa('0x76'));}return licenseUtil[_0xd4fa('0x77')]([_0x4bd6ab['body']])['then'](function(){return validateUser(_0x4bd6ab[_0xd4fa('0x56')]);})['then'](function(_0x23e7a8){return updateUser(_0x23e7a8)[_0xd4fa('0x14')](function(_0x13fa0f){if(_0x13fa0f[_0xd4fa('0x28')]===_0xd4fa('0x29')){_0x13fa0f[_0xd4fa('0x78')]=_0x4bd6ab[_0xd4fa('0x2b')]['settingsEnabled'];delete _0x13fa0f['userProfileId'];}return _0x13fa0f;});})['then'](function(_0x2308c4){return db[_0xd4fa('0x35')][_0xd4fa('0x79')](_0x2308c4,{'include':[{'model':db[_0xd4fa('0x66')],'as':_0xd4fa('0x66')}]});})[_0xd4fa('0x14')](function(_0x5be621){if(_0x4bd6ab[_0xd4fa('0x56')][_0xd4fa('0x28')]===_0xd4fa('0x2b'))return _0x5be621;if(_0x4bd6ab[_0xd4fa('0x2b')]['role']!==_0xd4fa('0x2b'))return _0x5be621;return db[_0xd4fa('0x7a')][_0xd4fa('0x57')]({'where':{'name':_0x5be621[_0xd4fa('0x28')]===_0xd4fa('0x2c')?_0xd4fa('0x7b'):_0xd4fa('0x2d'),'userProfileId':_0x4bd6ab['user'][_0xd4fa('0x7c')]},'raw':!![]})[_0xd4fa('0x14')](function(_0x45b0b8){if(!_0x45b0b8||_0x45b0b8[_0xd4fa('0x7d')]!=0x0)return _0x5be621;return db[_0xd4fa('0x7e')][_0xd4fa('0x79')]({'name':_0x5be621[_0xd4fa('0x33')],'resourceId':_0x5be621['id'],'type':_0x45b0b8[_0xd4fa('0x33')],'sectionId':_0x45b0b8['id']},{})[_0xd4fa('0x14')](function(){return _0x5be621;});})['catch'](function(_0x4c402d){logger[_0xd4fa('0x1a')](_0xd4fa('0x7f'),_0x4c402d);throw _0x4c402d;});})[_0xd4fa('0x14')](respondWithResult(_0x2cca20,0xc9))[_0xd4fa('0x1d')](handleError(_0x2cca20,null));};exports[_0xd4fa('0x80')]=function(_0x270ad5,_0x2e5580){var _0x8736c3=_0x270ad5['body'];var _0x177554=[];if(_0x270ad5[_0xd4fa('0x2b')][_0xd4fa('0x28')]==='agent')throw new Error(_0xd4fa('0x75'));if(_['some'](_0x8736c3,[_0xd4fa('0x28'),_0xd4fa('0x2b')])&&_0x270ad5[_0xd4fa('0x2b')][_0xd4fa('0x28')]!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0xd4fa('0x81')](_0x8736c3,[_0xd4fa('0x28'),'admin'])&&_0x270ad5[_0xd4fa('0x2b')][_0xd4fa('0x28')]!==_0xd4fa('0x29')){throw new Error(_0xd4fa('0x82'));}return licenseUtil['checkUserLimits'](_0x8736c3)[_0xd4fa('0x14')](function(){return validateUser(_0x8736c3[0x0]);})[_0xd4fa('0x14')](function(){for(var _0x2c5217=0x1;_0x2c5217<_0x8736c3[_0xd4fa('0x43')];_0x2c5217++){var _0x2e258a=_0x8736c3[_0x2c5217-0x1]['internal'];if(!_0x8736c3[_0x2c5217]['internal'])_0x8736c3[_0x2c5217][_0xd4fa('0x5c')]=_0x2e258a+0x1;_0x177554[_0xd4fa('0x3f')](validateUser(_0x8736c3[_0x2c5217]));}return BPromise[_0xd4fa('0x4b')](_0x177554);})[_0xd4fa('0x14')](function(){_0x177554=[];for(var _0x31aa5c=0x0;_0x31aa5c<_0x8736c3['length'];_0x31aa5c++){_0x177554['push'](updateUser(_0x8736c3[_0x31aa5c]));}return BPromise['all'](_0x177554);})[_0xd4fa('0x14')](function(){return BPromise[_0xd4fa('0x83')](_0x8736c3,function(_0x270ef5){return db[_0xd4fa('0x35')][_0xd4fa('0x79')](_0x270ef5,{'include':[{'model':db['VoiceMail'],'as':_0xd4fa('0x66')}]})[_0xd4fa('0x14')](function(_0x497f32){_0x270ef5['id']=_0x497f32['id'];return _0x270ef5;});});})['then'](function(_0x594915){if(_0x270ad5['body'][_0xd4fa('0x28')]==='user')return _0x594915;if(_0x270ad5[_0xd4fa('0x2b')][_0xd4fa('0x28')]!==_0xd4fa('0x2b'))return _0x594915;var _0x431b32=_['some'](_0x594915,function(_0x53b025){return _0x53b025[_0xd4fa('0x28')]===_0xd4fa('0x2c')||_0x53b025[_0xd4fa('0x28')]==='telephone';});if(!_0x431b32)return _0x594915;return db['UserProfileSection']['findAll']({'where':{'name':{'$or':[_0xd4fa('0x7b'),_0xd4fa('0x2d')]},'userProfileId':_0x270ad5[_0xd4fa('0x2b')]['userProfileId']},'raw':!![]})[_0xd4fa('0x14')](function(_0x8aaa1a){if(_['isEmpty'](_0x8aaa1a)||!_[_0xd4fa('0x81')](_0x8aaa1a,['autoAssociation',0x0]))return _0x594915;_0x177554=[];var _0x230238=_(_0x8aaa1a)[_0xd4fa('0x30')](function(_0x193aa9){if(_0x193aa9[_0xd4fa('0x7d')]===0x1)return;return _0x193aa9[_0xd4fa('0x33')]===_0xd4fa('0x7b')?_0xd4fa('0x2c'):_0xd4fa('0x2e');})[_0xd4fa('0x84')]()[_0xd4fa('0x31')]();for(var _0x4095ab=0x0;_0x4095ab<_0x594915[_0xd4fa('0x43')];_0x4095ab++){if(!_['includes'](_0x230238,_0x594915[_0x4095ab]['role']))return;var _0x350d86=_0x594915[_0x4095ab][_0xd4fa('0x28')]==='agent'?_0xd4fa('0x7b'):_0xd4fa('0x2d');_0x177554[_0xd4fa('0x3f')](db[_0xd4fa('0x7e')][_0xd4fa('0x79')]({'name':_0x594915[_0x4095ab][_0xd4fa('0x33')],'resourceId':_0x594915[_0x4095ab]['id'],'type':_0x350d86,'sectionId':_['find'](_0x8aaa1a,[_0xd4fa('0x33'),_0x350d86])['id']},{}));}return BPromise[_0xd4fa('0x4b')](_0x177554);});})['then'](respondWithResult(_0x2e5580,0xc9))['catch'](handleError(_0x2e5580,null));};exports[_0xd4fa('0x85')]=function(_0x185966,_0x4ab3f3){if(_0x185966[_0xd4fa('0x56')]['id']){delete _0x185966['body']['id'];}return db[_0xd4fa('0x35')][_0xd4fa('0x57')]({'where':{'id':_0x185966[_0xd4fa('0x4c')]['id']}})[_0xd4fa('0x14')](function(_0x184df0){if(!_0x184df0)return null;if(_0x184df0['id']===_0x185966[_0xd4fa('0x2b')]['id']){if(!_0x185966['body'][_0xd4fa('0x86')]||!_0x185966[_0xd4fa('0x56')]['newPassword']){throw new db[(_0xd4fa('0x87'))]['ValidationError'](_0xd4fa('0x88'));}if(!_0x184df0[_0xd4fa('0x89')](_0x185966['body'][_0xd4fa('0x86')])){throw new db[(_0xd4fa('0x87'))]['ValidationError'](_0xd4fa('0x8a'));}if(_0x185966['body'][_0xd4fa('0x86')]===_0x185966[_0xd4fa('0x56')][_0xd4fa('0x8b')]){throw new db['Sequelize'][(_0xd4fa('0x8c'))](_0xd4fa('0x8d'));}}else if(_0x185966[_0xd4fa('0x2b')]['role']===_0xd4fa('0x29')){if(!_0x185966[_0xd4fa('0x56')][_0xd4fa('0x8b')]){throw new db[(_0xd4fa('0x87'))][(_0xd4fa('0x8c'))](_0xd4fa('0x8e'));}}else if(_0x185966[_0xd4fa('0x2b')]['role']===_0xd4fa('0x2b')){if(!_0x185966[_0xd4fa('0x56')]['newPassword']){throw new db[(_0xd4fa('0x87'))][(_0xd4fa('0x8c'))](_0xd4fa('0x8e'));}if(_0x184df0['role']!==_0xd4fa('0x2c')){throw new db[(_0xd4fa('0x87'))][(_0xd4fa('0x8c'))](_0xd4fa('0x75'));}}else{throw new db[(_0xd4fa('0x87'))][(_0xd4fa('0x8c'))](_0xd4fa('0x75'));}return _0x184df0;})[_0xd4fa('0x14')](handleEntityNotFound(_0x4ab3f3,null))['then'](function(_0x386e11){return db[_0xd4fa('0x8f')][_0xd4fa('0x90')]({'attributes':['id',_0xd4fa('0x5e'),'enforcePasswordHistory',_0xd4fa('0x91')]})[_0xd4fa('0x14')](function(_0x4a4d0d){if(_0x4a4d0d['securePassword'])authService[_0xd4fa('0x92')](_0x185966[_0xd4fa('0x56')][_0xd4fa('0x8b')]);if(!_0x4a4d0d[_0xd4fa('0x93')]||!_0x386e11[_0xd4fa('0x94')])return _0x386e11;authService[_0xd4fa('0x95')](_0x185966[_0xd4fa('0x56')][_0xd4fa('0x8b')],_0x386e11[_0xd4fa('0x94')],_0x4a4d0d[_0xd4fa('0x91')]);return _0x386e11;})['then'](saveUpdates({'password':_0x185966[_0xd4fa('0x56')][_0xd4fa('0x8b')],'passwordResetAt':_0x185966['user']['id']==_0x185966[_0xd4fa('0x4c')]['id']?moment():null,'previousPasswords':authService[_0xd4fa('0x96')](_0x185966[_0xd4fa('0x56')][_0xd4fa('0x8b')],_0x386e11[_0xd4fa('0x94')])},null));})[_0xd4fa('0x14')](respondWithResult(_0x4ab3f3,null))[_0xd4fa('0x1d')](handleError(_0x4ab3f3,null));};exports[_0xd4fa('0x97')]=function(_0x233f7b,_0x1b6a4d){var _0x12d545=_0x233f7b[_0xd4fa('0x56')][_0xd4fa('0x98')];return db['User'][_0xd4fa('0x57')]({'where':{'id':_0x233f7b[_0xd4fa('0x4c')]['id']},'attributes':['id','name',_0xd4fa('0x28'),_0xd4fa('0x99'),'loginInPause',_0xd4fa('0x9a'),_0xd4fa('0x9b')]})[_0xd4fa('0x14')](handleEntityNotFound(_0x1b6a4d,null))[_0xd4fa('0x14')](function(_0x4fd3b2){if(_0x4fd3b2){if(!utils[_0xd4fa('0x9c')](_0x12d545)){throw new db[(_0xd4fa('0x87'))][(_0xd4fa('0x8c'))](_0xd4fa('0x9d'));}return _0x4fd3b2['add'+_[_0xd4fa('0x9e')](_0x12d545[_0xd4fa('0x9f')]())+_0xd4fa('0xa0')](_0x233f7b[_0xd4fa('0x56')]['ids'],{'penalty':_0x233f7b['body'][_0xd4fa('0xa1')]||0x0})['spread'](function(_0x96448a){for(var _0x495b93=0x0;_0x495b93<_0x233f7b[_0xd4fa('0x56')][_0xd4fa('0x5b')][_0xd4fa('0x43')];_0x495b93+=0x1){var _0x3e80cb={'UserId':Number(_0x233f7b['params']['id'])};_0x3e80cb[_[_0xd4fa('0x9e')](_0x12d545[_0xd4fa('0x9f')]())+_0xd4fa('0xa2')]=Number(_0x233f7b[_0xd4fa('0x56')][_0xd4fa('0x5b')][_0x495b93]);socket[_0xd4fa('0xa3')]('user'+_[_0xd4fa('0x9e')](_0x12d545[_0xd4fa('0x9f')]())+_0xd4fa('0xa4'),_0x3e80cb);}return _0x96448a;})[_0xd4fa('0x14')](function(){if(_0x12d545===_0xd4fa('0xa5')){return db[_0xd4fa('0xa6')]['findAll']({'where':{'id':_0x233f7b['body']['ids']||[]},'raw':!![],'attributes':['id',_0xd4fa('0x33')]});}})[_0xd4fa('0x14')](function(_0x44e170){var _0x3203df=_0x4fd3b2[_0xd4fa('0x27')]({'plain':!![]});var _0x47126d=[];if(_0x12d545==='voice'&&_0x3203df['role']===_0xd4fa('0x2c')&&_0x3203df[_0xd4fa('0x99')]){for(var _0x46bfac=0x0;_0x46bfac<_0x44e170[_0xd4fa('0x43')];_0x46bfac+=0x1){_0x47126d['push']({'membername':_0x3203df['name'],'UserId':_0x3203df['id'],'queue_name':_0x44e170[_0x46bfac][_0xd4fa('0x33')],'VoiceQueueId':_0x44e170[_0x46bfac]['id'],'interface':_[_0xd4fa('0x60')](_0x3203df[_0xd4fa('0x9b')])?util[_0xd4fa('0xa7')](_0xd4fa('0xa8'),_0x3203df[_0xd4fa('0x33')]):_0x3203df[_0xd4fa('0x9b')],'paused':_0x3203df[_0xd4fa('0x9a')]||![],'penalty':_0x233f7b[_0xd4fa('0x56')][_0xd4fa('0xa1')]||0x0});}return BPromise[_0xd4fa('0x83')](_0x47126d,function(_0x2fc822){return db['UserVoiceQueueRt'][_0xd4fa('0xa9')](_0x2fc822);});}return _0x4fd3b2;});}})[_0xd4fa('0x14')](respondWithStatusCode(_0x1b6a4d,null))['catch'](handleError(_0x1b6a4d,null));};exports['removeQueues']=function(_0x303bd5,_0x461a95){var _0x2f54ce;return db[_0xd4fa('0x35')][_0xd4fa('0x57')]({'where':{'id':_0x303bd5['params']['id']},'attributes':['id',_0xd4fa('0x33'),'role']})['then'](handleEntityNotFound(_0x461a95,null))[_0xd4fa('0x14')](function(_0x112e21){if(_0x112e21){_0x2f54ce=_0x112e21;if(!_0x303bd5[_0xd4fa('0x3c')]['channel']||!utils[_0xd4fa('0x9c')](_0x303bd5['query'][_0xd4fa('0x98')])){throw new db[(_0xd4fa('0x87'))][(_0xd4fa('0x8c'))](_0xd4fa('0x9d'));}return _0x112e21[_0xd4fa('0xaa')+_['capitalize'](_0x303bd5[_0xd4fa('0x3c')][_0xd4fa('0x98')][_0xd4fa('0x9f')]())+_0xd4fa('0xa0')](_0x303bd5[_0xd4fa('0x3c')]['ids']);}})[_0xd4fa('0x14')](function(_0x1086a9){if(_[_0xd4fa('0xab')](_0x303bd5[_0xd4fa('0x3c')][_0xd4fa('0x5b')])){for(var _0xfecc95=0x0;_0xfecc95<_0x303bd5[_0xd4fa('0x3c')][_0xd4fa('0x5b')][_0xd4fa('0x43')];_0xfecc95+=0x1){var _0x193410={'UserId':Number(_0x303bd5[_0xd4fa('0x4c')]['id'])};_0x193410[_[_0xd4fa('0x9e')](_0x303bd5[_0xd4fa('0x3c')][_0xd4fa('0x98')][_0xd4fa('0x9f')]())+'QueueId']=Number(_0x303bd5['query']['ids'][_0xfecc95]);socket['emit']('user'+_['capitalize'](_0x303bd5['query'][_0xd4fa('0x98')][_0xd4fa('0x9f')]())+_0xd4fa('0xac'),_0x193410);}}else{var _0x193410={'UserId':Number(_0x303bd5['params']['id'])};_0x193410[_[_0xd4fa('0x9e')](_0x303bd5['query'][_0xd4fa('0x98')][_0xd4fa('0x9f')]())+_0xd4fa('0xa2')]=Number(_0x303bd5['query'][_0xd4fa('0x5b')]);socket[_0xd4fa('0xa3')](_0xd4fa('0x2b')+_['capitalize'](_0x303bd5[_0xd4fa('0x3c')][_0xd4fa('0x98')][_0xd4fa('0x9f')]())+_0xd4fa('0xac'),_0x193410);}return _0x1086a9;})['then'](function(){if(_0x303bd5[_0xd4fa('0x3c')][_0xd4fa('0x98')]===_0xd4fa('0xa5')){return db[_0xd4fa('0xad')][_0xd4fa('0xae')]({'where':{'UserId':_0x303bd5['params']['id'],'VoiceQueueId':_0x303bd5['query'][_0xd4fa('0x5b')]},'individualHooks':!![]})[_0xd4fa('0x14')](function(){return _0x2f54ce;});}return _0x2f54ce;})['then'](respondWithStatusCode(_0x461a95,null))[_0xd4fa('0x1d')](handleError(_0x461a95,null));};exports[_0xd4fa('0xaf')]=function(_0x305fec,_0x31167c){_0x305fec[_0xd4fa('0x56')][_0xd4fa('0xb0')]=_0x305fec[_0xd4fa('0xb1')]['filename'];return db[_0xd4fa('0x35')][_0xd4fa('0x57')]({'where':{'id':_0x305fec['params']['id']}})[_0xd4fa('0x14')](handleEntityNotFound(_0x31167c,null))[_0xd4fa('0x14')](saveUpdates(_0x305fec[_0xd4fa('0x56')],null))['then'](respondWithResult(_0x31167c,null))[_0xd4fa('0x1d')](handleError(_0x31167c,null));};exports[_0xd4fa('0xb2')]=function(_0x529965,_0x4cb02d){var _0x20a0cb=path[_0xd4fa('0xb3')](config[_0xd4fa('0xb4')],_0xd4fa('0xb5'));return db[_0xd4fa('0x35')][_0xd4fa('0x57')]({'where':{'id':_0x529965[_0xd4fa('0x4c')]['id']},'attributes':['id',_0xd4fa('0xb0')],'raw':!![]})[_0xd4fa('0x14')](handleEntityNotFound(_0x4cb02d,null))['then'](function(_0x367533){if(_0x367533){if(_[_0xd4fa('0x60')](_0x367533[_0xd4fa('0xb0')])){return _0x4cb02d[_0xd4fa('0xb6')](_0x20a0cb);}else{if(!fs[_0xd4fa('0xb7')](path[_0xd4fa('0xb3')](config[_0xd4fa('0xb4')],_0xd4fa('0xb8'),_0x367533[_0xd4fa('0xb0')]))){return _0x4cb02d[_0xd4fa('0xb6')](_0x20a0cb);}return _0x4cb02d['download'](path[_0xd4fa('0xb3')](config[_0xd4fa('0xb4')],_0xd4fa('0xb8'),_0x367533['userpic']));}}})['catch'](handleError(_0x4cb02d,null));};exports['getOpenTabs']=function(_0x3dcec5,_0xe60111){return db[_0xd4fa('0x35')][_0xd4fa('0x57')]({'where':{'id':_0x3dcec5[_0xd4fa('0x4c')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0xe60111,null))['then'](function(_0x31bcf8){var _0x1d433d=[];values=_0x31bcf8[_0xd4fa('0x45')];_0x1d433d[_0xd4fa('0x3f')](get_open_tabs(_0xd4fa('0x44'),_0x31bcf8[_0xd4fa('0x45')]));_0x1d433d[_0xd4fa('0x3f')](get_open_tabs('sms',_0x31bcf8[_0xd4fa('0x45')]));_0x1d433d[_0xd4fa('0x3f')](get_open_tabs('openchannel',_0x31bcf8[_0xd4fa('0x45')]));_0x1d433d[_0xd4fa('0x3f')](get_open_tabs(_0xd4fa('0x4a'),_0x31bcf8[_0xd4fa('0x45')]));_0x1d433d['push'](get_open_tabs('fax',_0x31bcf8[_0xd4fa('0x45')]));_0x1d433d[_0xd4fa('0x3f')](get_open_tabs('mail',_0x31bcf8['dataValues']));return BPromise['all'](_0x1d433d);})[_0xd4fa('0x14')](function(_0x37c06b){var _0x3c8c13=[];if(_0x37c06b){for(var _0x200b3d=0x0;_0x200b3d=_0x36044b['agents']){throw new Error(_0xed5c('0x51'));}})['then'](function(){if(_0x3c739d){return db[_0xed5c('0x2e')][_0xed5c('0x4b')]({'where':{'membername':_0x3c739d[_0xed5c('0x2b')]},'individualHooks':!![]});}})[_0xed5c('0x11')](function(){if(_0x3c739d){return _0x3c739d['getVoiceQueues']({'raw':!![]});}})[_0xed5c('0x11')](function(_0x1a6a89){if(_0x3c739d){if(_0x1a6a89){var _0xe86db=[];_0x53639f=_0x1a6a89;if(_0x53639f[_0xed5c('0x31')]){for(var _0x20b942=0x0;_0x20b942<_0x53639f['length'];_0x20b942++){_0xe86db[_0xed5c('0x47')](db[_0xed5c('0x2e')][_0xed5c('0x52')]({'membername':_0x3c739d[_0xed5c('0x2b')],'UserId':_0x3c739d['id'],'queue_name':_0x53639f[_0x20b942][_0xed5c('0x2b')],'VoiceQueueId':_0x53639f[_0x20b942]['id'],'interface':_0xb3dcea,'paused':_0x3c739d[_0xed5c('0x53')]||![],'penalty':_0x53639f[_0x20b942][_0xed5c('0x54')]||0x0}));}return BPromise[_0xed5c('0x48')](_0xe86db);}}}})[_0xed5c('0x11')](function(){if(_0x3c739d){return db['MemberReport'][_0xed5c('0x1d')]({'where':{'membername':_0x3c739d[_0xed5c('0x2b')],'exitAt':null}});}})[_0xed5c('0x11')](function(_0x3bc52c){if(_0x3c739d){if(_0x3bc52c&&_0x3bc52c['length']){var _0x46eaea=[];_0x3bc52c[_0xed5c('0x4c')](function(_0x5e308d){_0x46eaea[_0xed5c('0x47')](_0x5e308d[_0xed5c('0x2f')]({'exitAt':moment()['format'](_0xed5c('0x32'))}));});return BPromise[_0xed5c('0x48')](_0x46eaea);}}})[_0xed5c('0x11')](function(_0x43f4fe){if(_0x3c739d){var _0x36237c=[];var _0x3c4ec5=[];var _0x24127b=utils[_0xed5c('0x34')]();var _0x35fd3d={'membername':_0x3c739d['name'],'interface':_0xb3dcea,'enterAt':moment()['format'](_0xed5c('0x32')),'role':_0x3c739d[_0xed5c('0x3a')],'internal':_0x3c739d[_0xed5c('0x2c')]};_0x24127b['forEach'](function(_0x8c7d89){_0x36237c[_0xed5c('0x47')](_['merge']({'channel':_0x8c7d89,'type':_0xed5c('0x55'),'data1':_0xed5c('0x56'),'data2':_0xb3dcea},_0x35fd3d));if(_0x3c739d['loginInPause']){_0x3c4ec5['push'](_[_0xed5c('0x57')]({'channel':_0x8c7d89,'type':_0xed5c('0x30'),'data1':_0xed5c('0x58')},_0x35fd3d));}});return db[_0xed5c('0x3c')][_0xed5c('0x59')](_0x36237c['concat'](_0x3c4ec5),{'individualHooks':!![]});}})['then'](function(){if(_0x3c739d){return _0x3c739d[_0xed5c('0x2f')]({'online':!![],'lastLoginAt':moment()[_0xed5c('0x37')](_0xed5c('0x32')),'voicePause':_0x3c739d['loginInPause']||![],'mailPause':_0x3c739d[_0xed5c('0x53')]||![],'chatPause':_0x3c739d[_0xed5c('0x53')]||![],'faxPause':_0x3c739d[_0xed5c('0x53')]||![],'smsPause':_0x3c739d[_0xed5c('0x53')]||![],'openchannelPause':_0x3c739d['loginInPause']||![],'pauseType':_0x3c739d[_0xed5c('0x53')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0xed5c('0x37')](_0xed5c('0x32')),'interface':_0xb3dcea});}})[_0xed5c('0x11')](function(_0x342435){_0x22a730(_0x342435);})[_0xed5c('0x1c')](function(_0x2f5a1a){_0x948188(_0x30a23d['error'](0x1f4,_0x2f5a1a[_0xed5c('0x1a')]));});});}; \ No newline at end of file +var _0x49e9=['LOGININPAUSE','bulkCreate','concat','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','./user.socket','register','request','info','debug','User,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','User,\x20%s,\x20%s','message','result','catch','User','findAll','options','raw','where','attributes','limit','include','map','model','GetUser','stringify','ShowUser','find','PauseUser','internal','interface','then','UserVoiceQueueRt','MemberReport','PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','push','name','isNil','SIP/%s','type','DEFAULT\x20PAUSE','role','body','update','UnpauseUser','Unknown\x20channel','channel','voice','mail','fax','sms','openchannel','whatsapp','system','set','%s%s','Pause','forEach','all','findOne','destroy','LoginUser','mobile','phone','loginInPause','count','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','getChannels','LOGIN','callysquare'];(function(_0x2a557a,_0x585b4a){var _0x439f83=function(_0x23f445){while(--_0x23f445){_0x2a557a['push'](_0x2a557a['shift']());}};_0x439f83(++_0x585b4a);}(_0x49e9,0xbf));var _0x949e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x49e9[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x949e('0x0'));var moment=require('moment');var BPromise=require(_0x949e('0x1'));var rs=require(_0x949e('0x2'));var fs=require('fs');var Redis=require(_0x949e('0x3'));var db=require(_0x949e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x949e('0x5'))('rpc');var config=require(_0x949e('0x6'));var jayson=require(_0x949e('0x7'));var client=jayson[_0x949e('0x8')][_0x949e('0x9')]({'port':0x232a});config[_0x949e('0xa')]=_['defaults'](config['redis'],{'host':_0x949e('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x949e('0xa')]));require(_0x949e('0xc'))[_0x949e('0xd')](socket);function respondWithRpcPromise(_0x21c532,_0x14dbce,_0x2c2d6b){return new BPromise(function(_0x3be5e8,_0x3eaf23){return client[_0x949e('0xe')](_0x21c532,_0x2c2d6b)['then'](function(_0x1e4e48){logger[_0x949e('0xf')]('User,\x20%s,\x20%s',_0x14dbce,'request\x20sent');logger[_0x949e('0x10')](_0x949e('0x11'),_0x14dbce,_0x949e('0x12'),JSON['stringify'](_0x1e4e48));if(_0x1e4e48['error']){if(_0x1e4e48[_0x949e('0x13')][_0x949e('0x14')]===0x1f4){logger[_0x949e('0x13')](_0x949e('0x15'),_0x14dbce,_0x1e4e48[_0x949e('0x13')][_0x949e('0x16')]);return _0x3eaf23(_0x1e4e48['error']['message']);}logger[_0x949e('0x13')](_0x949e('0x15'),_0x14dbce,_0x1e4e48[_0x949e('0x13')][_0x949e('0x16')]);return _0x3be5e8(_0x1e4e48[_0x949e('0x13')]['message']);}else{logger['info'](_0x949e('0x15'),_0x14dbce,'request\x20sent');_0x3be5e8(_0x1e4e48[_0x949e('0x17')][_0x949e('0x16')]);}})[_0x949e('0x18')](function(_0x1a5c40){logger[_0x949e('0x13')](_0x949e('0x15'),_0x14dbce,_0x1a5c40);_0x3eaf23(_0x1a5c40);});});}exports['GetUser']=function(_0xe29b19){var _0x235fbe=this;return new Promise(function(_0x513f64,_0x59e210){return db[_0x949e('0x19')][_0x949e('0x1a')]({'raw':_0xe29b19['options']?_0xe29b19[_0x949e('0x1b')][_0x949e('0x1c')]===undefined?!![]:![]:!![],'where':_0xe29b19[_0x949e('0x1b')]?_0xe29b19['options'][_0x949e('0x1d')]||null:null,'attributes':_0xe29b19['options']?_0xe29b19[_0x949e('0x1b')][_0x949e('0x1e')]||null:null,'limit':_0xe29b19[_0x949e('0x1b')]?_0xe29b19['options'][_0x949e('0x1f')]||null:null,'include':_0xe29b19[_0x949e('0x1b')]?_0xe29b19[_0x949e('0x1b')][_0x949e('0x20')]?_[_0x949e('0x21')](_0xe29b19[_0x949e('0x1b')]['include'],function(_0xb3a723){return{'model':db[_0xb3a723[_0x949e('0x22')]],'as':_0xb3a723['as'],'attributes':_0xb3a723['attributes'],'include':_0xb3a723[_0x949e('0x20')]?_[_0x949e('0x21')](_0xb3a723['include'],function(_0x36eb55){return{'model':db[_0x36eb55[_0x949e('0x22')]],'as':_0x36eb55['as'],'attributes':_0x36eb55[_0x949e('0x1e')],'include':_0x36eb55['include']?_['map'](_0x36eb55[_0x949e('0x20')],function(_0x25e9c7){return{'model':db[_0x25e9c7['model']],'as':_0x25e9c7['as'],'attributes':_0x25e9c7[_0x949e('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3c8cd6){logger[_0x949e('0xf')](_0x949e('0x23'),_0xe29b19);logger[_0x949e('0x10')](_0x949e('0x23'),_0xe29b19,JSON[_0x949e('0x24')](_0x3c8cd6));_0x513f64(_0x3c8cd6);})['catch'](function(_0x20b4ae){logger[_0x949e('0x13')](_0x949e('0x23'),_0x20b4ae['message'],_0xe29b19);_0x59e210(_0x235fbe[_0x949e('0x13')](0x1f4,_0x20b4ae['message']));});});};exports[_0x949e('0x25')]=function(_0x2ff353){var _0x4b5ed1=this;return new Promise(function(_0x2251f6,_0x4ce275){return db['User'][_0x949e('0x26')]({'raw':_0x2ff353[_0x949e('0x1b')]?_0x2ff353[_0x949e('0x1b')][_0x949e('0x1c')]===undefined?!![]:![]:!![],'where':_0x2ff353[_0x949e('0x1b')]?_0x2ff353[_0x949e('0x1b')][_0x949e('0x1d')]||null:null,'attributes':_0x2ff353[_0x949e('0x1b')]?_0x2ff353[_0x949e('0x1b')][_0x949e('0x1e')]||null:null,'include':_0x2ff353[_0x949e('0x1b')]?_0x2ff353[_0x949e('0x1b')][_0x949e('0x20')]?_[_0x949e('0x21')](_0x2ff353[_0x949e('0x1b')][_0x949e('0x20')],function(_0x569c71){return{'model':db[_0x569c71[_0x949e('0x22')]],'as':_0x569c71['as'],'attributes':_0x569c71['attributes'],'include':_0x569c71[_0x949e('0x20')]?_[_0x949e('0x21')](_0x569c71[_0x949e('0x20')],function(_0x1d5040){return{'model':db[_0x1d5040[_0x949e('0x22')]],'as':_0x1d5040['as'],'attributes':_0x1d5040[_0x949e('0x1e')],'include':_0x1d5040[_0x949e('0x20')]?_[_0x949e('0x21')](_0x1d5040[_0x949e('0x20')],function(_0x89b223){return{'model':db[_0x89b223[_0x949e('0x22')]],'as':_0x89b223['as'],'attributes':_0x89b223['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e9732){logger[_0x949e('0xf')](_0x949e('0x25'),_0x2ff353);logger['debug'](_0x949e('0x25'),_0x2ff353,JSON[_0x949e('0x24')](_0x5e9732));_0x2251f6(_0x5e9732);})[_0x949e('0x18')](function(_0x2e659f){logger[_0x949e('0x13')](_0x949e('0x25'),_0x2e659f[_0x949e('0x16')],_0x2ff353);_0x4ce275(_0x4b5ed1[_0x949e('0x13')](0x1f4,_0x2e659f[_0x949e('0x16')]));});});};exports[_0x949e('0x27')]=function(_0x46922b){var _0x42e3eb=this;return new Promise(function(_0x24017a,_0x261c11){var _0x3b0f84;return db[_0x949e('0x19')][_0x949e('0x26')]({'where':_0x46922b[_0x949e('0x1b')][_0x949e('0x1d')]||{},'attributes':['id','name','role',_0x949e('0x28'),_0x949e('0x29')]})[_0x949e('0x2a')](function(_0x14f6ce){if(_0x14f6ce){_0x3b0f84=_0x14f6ce;return db[_0x949e('0x2b')]['update']({'paused':0x1},{'where':{'UserId':_0x3b0f84['id']},'individualHooks':!![]});}})[_0x949e('0x2a')](function(){if(_0x3b0f84){return db[_0x949e('0x2c')][_0x949e('0x1a')]({'where':{'membername':_0x3b0f84['name'],'type':_0x949e('0x2d'),'exitAt':null}});}})[_0x949e('0x2a')](function(_0x49f570){if(_0x3b0f84){if(_0x49f570&&_0x49f570[_0x949e('0x2e')]){var _0x1d48fb=moment()[_0x949e('0x2f')](_0x949e('0x30'));for(var _0x2f565c=0x0,_0xd249ca=_0x49f570[_0x949e('0x2e')];_0x2f565c<_0xd249ca;_0x2f565c++){_0x49f570[_0x2f565c][_0x949e('0x31')]({'exitAt':_0x1d48fb});}}}})[_0x949e('0x2a')](function(){if(_0x3b0f84){var _0x230e0f=[];var _0x12f162=utils['getChannels']();_0x12f162['forEach'](function(_0x5519e2){_0x230e0f[_0x949e('0x32')]({'channel':_0x5519e2,'membername':_0x3b0f84[_0x949e('0x33')],'interface':_[_0x949e('0x34')](_0x3b0f84[_0x949e('0x29')])?util[_0x949e('0x2f')](_0x949e('0x35'),_0x3b0f84['name']):_0x3b0f84['interface'],'type':'PAUSE','enterAt':moment()[_0x949e('0x2f')](_0x949e('0x30')),'data1':_0x46922b['body'][_0x949e('0x36')]||_0x949e('0x37'),'role':_0x3b0f84[_0x949e('0x38')],'internal':_0x3b0f84['internal'],'uniqueid':_0x46922b[_0x949e('0x39')]['uniqueid']||null});});return db[_0x949e('0x2c')]['bulkCreate'](_0x230e0f,{'individualHooks':!![]});}})[_0x949e('0x2a')](function(){if(_0x3b0f84){return _0x3b0f84[_0x949e('0x3a')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x46922b[_0x949e('0x39')][_0x949e('0x36')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x949e('0x2f')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x949e('0x2a')](function(_0x495893){_0x24017a(_0x495893);})['catch'](function(_0x2bf8ed){_0x261c11(_0x42e3eb[_0x949e('0x13')](0x1f4,_0x2bf8ed['message']));});});};exports[_0x949e('0x3b')]=function(_0x197090){var _0x4322db=this;return new Promise(function(_0x37cb8d,_0x53e144){var _0x5e0883;return db[_0x949e('0x19')]['findOne']({'where':_0x197090[_0x949e('0x1b')][_0x949e('0x1d')]||{},'attributes':['id','name']})['then'](function(_0x5cf329){if(_0x5cf329){_0x5e0883=_0x5cf329;if(_0x197090[_0x949e('0x39')]['channel']&&!utils['isValidChannel'](_0x197090['body']['channel'])){throw new Error(_0x949e('0x3c'));}switch(_0x197090['body'][_0x949e('0x3d')]){case _0x949e('0x3e'):return db['UserVoiceQueueRt'][_0x949e('0x3a')]({'paused':0x0},{'where':{'UserId':_0x5e0883['id']}})[_0x949e('0x2a')](function(){return db[_0x949e('0x2c')][_0x949e('0x26')]({'where':{'channel':_0x197090[_0x949e('0x39')][_0x949e('0x3d')],'membername':_0x5e0883[_0x949e('0x33')],'type':_0x949e('0x2d'),'exitAt':null}});})['then'](function(_0x3e032b){if(_0x3e032b){return _0x3e032b['update']({'exitAt':moment()[_0x949e('0x2f')](_0x949e('0x30')),'data2':'system'},{'individualHooks':!![]});}return null;})[_0x949e('0x2a')](function(){return _0x5e0883['update']({'voicePause':![]});});case _0x949e('0x3f'):case'chat':case _0x949e('0x40'):case _0x949e('0x41'):case _0x949e('0x42'):case _0x949e('0x43'):return db[_0x949e('0x2c')][_0x949e('0x26')]({'where':{'channel':_0x197090[_0x949e('0x39')][_0x949e('0x3d')],'membername':_0x5e0883[_0x949e('0x33')],'type':_0x949e('0x2d'),'exitAt':null}})[_0x949e('0x2a')](function(_0x287a89){return _0x287a89[_0x949e('0x3a')]({'exitAt':moment()['format'](_0x949e('0x30')),'data2':_0x949e('0x44')},{'individualHooks':!![]});})[_0x949e('0x2a')](function(){var _0x4e348e={};_[_0x949e('0x45')](_0x4e348e,util[_0x949e('0x2f')](_0x949e('0x46'),_0x197090['body']['channel'],_0x949e('0x47')),![]);return _0x5e0883[_0x949e('0x3a')](_0x4e348e);});default:return db['UserVoiceQueueRt'][_0x949e('0x3a')]({'paused':0x0},{'where':{'UserId':_0x5e0883['id']}})[_0x949e('0x2a')](function(){return db[_0x949e('0x2c')]['findAll']({'where':{'membername':_0x5e0883[_0x949e('0x33')],'type':'PAUSE','exitAt':null}});})['then'](function(_0x257ca2){var _0x4281ac=[];_0x257ca2[_0x949e('0x48')](function(_0xa9a1c4){_0x4281ac[_0x949e('0x32')](_0xa9a1c4[_0x949e('0x3a')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':'system'}));});return BPromise[_0x949e('0x49')](_0x4281ac);})[_0x949e('0x2a')](function(){return _0x5e0883[_0x949e('0x3a')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x949e('0x2a')](function(_0x4718a){_0x37cb8d(_0x4718a);})[_0x949e('0x18')](function(_0x3eff79){_0x53e144(_0x4322db['error'](0x1f4,_0x3eff79[_0x949e('0x16')]));});});};exports['LogoutUser']=function(_0x5bd8ee){var _0x113868=this;return new Promise(function(_0x4bd61f,_0x171a18){var _0x21b77e;return db['User'][_0x949e('0x4a')]({'where':_0x5bd8ee[_0x949e('0x1b')]['where']||{},'attributes':['id',_0x949e('0x33')]})[_0x949e('0x2a')](function(_0x5c022a){if(_0x5c022a){_0x21b77e=_0x5c022a;return db[_0x949e('0x2b')][_0x949e('0x4b')]({'where':{'membername':_0x21b77e['name']},'individualHooks':!![]});}})[_0x949e('0x2a')](function(){if(_0x21b77e){return db[_0x949e('0x2c')]['findAll']({'where':{'membername':_0x21b77e[_0x949e('0x33')],'exitAt':null}});}})[_0x949e('0x2a')](function(_0x1d9908){if(_0x21b77e){if(_0x1d9908&&_0x1d9908[_0x949e('0x2e')]){var _0x4d060e=[];_0x1d9908['forEach'](function(_0x56c45f){_0x4d060e[_0x949e('0x32')](_0x56c45f['update']({'exitAt':moment()[_0x949e('0x2f')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x949e('0x49')](_0x4d060e);}}})['then'](function(){if(_0x21b77e){return _0x21b77e[_0x949e('0x3a')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x949e('0x2a')](function(_0x1d92f7){_0x4bd61f(_0x1d92f7);})[_0x949e('0x18')](function(_0x214f50){_0x171a18(_0x113868[_0x949e('0x13')](0x1f4,_0x214f50[_0x949e('0x16')]));});});};exports[_0x949e('0x4c')]=function(_0x2369e4){var _0x53d0d9=this;return new Promise(function(_0x58c9a0,_0x3e4e7e){var _0x4bb749;var _0x32a570;var _0x5387e4;var _0x2a02fe;return db[_0x949e('0x19')][_0x949e('0x4a')]({'where':_0x2369e4[_0x949e('0x1b')]['where']||{},'attributes':['id',_0x949e('0x33'),_0x949e('0x38'),_0x949e('0x4d'),_0x949e('0x4e'),_0x949e('0x28'),_0x949e('0x4f'),'interface']})[_0x949e('0x2a')](function(_0x29453a){if(_0x29453a){_0x4bb749=_0x29453a;_0x2a02fe=_0x2369e4[_0x949e('0x39')]['interface']?_0x2369e4[_0x949e('0x39')]['interface']:util['format'](_0x949e('0x35'),_0x4bb749['name']);return db[_0x949e('0x19')][_0x949e('0x50')]({'where':{'role':_0x949e('0x51'),'online':!![],'id':{'$ne':_0x4bb749['id']}}});}})[_0x949e('0x2a')](function(_0x54a5ef){if(_0x54a5ef){_0x5387e4=_0x54a5ef;return require(_0x949e('0x52'))[_0x949e('0x53')]();}})[_0x949e('0x2a')](function(_0x375b2c){if(_0x375b2c&&_0x375b2c[_0x949e('0x54')]&&_0x5387e4>=_0x375b2c['agents']){throw new Error(_0x949e('0x55'));}})['then'](function(){if(_0x4bb749){return db[_0x949e('0x2b')]['destroy']({'where':{'membername':_0x4bb749[_0x949e('0x33')]},'individualHooks':!![]});}})['then'](function(){if(_0x4bb749){return _0x4bb749[_0x949e('0x56')]({'raw':!![]});}})['then'](function(_0x7ea712){if(_0x4bb749){if(_0x7ea712){var _0x396332=[];_0x32a570=_0x7ea712;if(_0x32a570[_0x949e('0x2e')]){for(var _0x36b841=0x0;_0x36b841<_0x32a570['length'];_0x36b841++){_0x396332[_0x949e('0x32')](db['UserVoiceQueueRt'][_0x949e('0x57')]({'membername':_0x4bb749[_0x949e('0x33')],'UserId':_0x4bb749['id'],'queue_name':_0x32a570[_0x36b841]['name'],'VoiceQueueId':_0x32a570[_0x36b841]['id'],'interface':_0x2a02fe,'paused':_0x4bb749['loginInPause']||![],'penalty':_0x32a570[_0x36b841]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x949e('0x49')](_0x396332);}}}})[_0x949e('0x2a')](function(){if(_0x4bb749){return db[_0x949e('0x2c')][_0x949e('0x1a')]({'where':{'membername':_0x4bb749['name'],'exitAt':null}});}})[_0x949e('0x2a')](function(_0x2ad1c3){if(_0x4bb749){if(_0x2ad1c3&&_0x2ad1c3[_0x949e('0x2e')]){var _0x5ebecb=[];_0x2ad1c3[_0x949e('0x48')](function(_0x3e2c83){_0x5ebecb[_0x949e('0x32')](_0x3e2c83[_0x949e('0x3a')]({'exitAt':moment()[_0x949e('0x2f')](_0x949e('0x30'))}));});return BPromise['all'](_0x5ebecb);}}})[_0x949e('0x2a')](function(_0x194968){if(_0x4bb749){var _0x1e15c7=[];var _0x433df6=[];var _0x35dd48=utils[_0x949e('0x58')]();var _0x35a2d1={'membername':_0x4bb749[_0x949e('0x33')],'interface':_0x2a02fe,'enterAt':moment()[_0x949e('0x2f')](_0x949e('0x30')),'role':_0x4bb749[_0x949e('0x38')],'internal':_0x4bb749[_0x949e('0x28')]};_0x35dd48[_0x949e('0x48')](function(_0x21b2b5){_0x1e15c7[_0x949e('0x32')](_['merge']({'channel':_0x21b2b5,'type':_0x949e('0x59'),'data1':_0x949e('0x5a'),'data2':_0x2a02fe},_0x35a2d1));if(_0x4bb749['loginInPause']){_0x433df6[_0x949e('0x32')](_['merge']({'channel':_0x21b2b5,'type':_0x949e('0x2d'),'data1':_0x949e('0x5b')},_0x35a2d1));}});return db[_0x949e('0x2c')][_0x949e('0x5c')](_0x1e15c7[_0x949e('0x5d')](_0x433df6),{'individualHooks':!![]});}})['then'](function(){if(_0x4bb749){return _0x4bb749[_0x949e('0x3a')]({'online':!![],'lastLoginAt':moment()[_0x949e('0x2f')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x4bb749[_0x949e('0x4f')]||![],'mailPause':_0x4bb749[_0x949e('0x4f')]||![],'chatPause':_0x4bb749[_0x949e('0x4f')]||![],'faxPause':_0x4bb749[_0x949e('0x4f')]||![],'smsPause':_0x4bb749[_0x949e('0x4f')]||![],'openchannelPause':_0x4bb749[_0x949e('0x4f')]||![],'pauseType':_0x4bb749[_0x949e('0x4f')]?_0x949e('0x5b'):null,'lastPauseAt':moment()[_0x949e('0x2f')](_0x949e('0x30')),'interface':_0x2a02fe});}})[_0x949e('0x2a')](function(_0x3a5cc5){_0x58c9a0(_0x3a5cc5);})['catch'](function(_0x49569e){_0x3e4e7e(_0x53d0d9[_0x949e('0x13')](0x1f4,_0x49569e[_0x949e('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 5be4dc6..bba2e79 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 _0x91b6=['save','remove','emit','register','length','./user.events'];(function(_0x17bb31,_0x2fc6f8){var _0x505c71=function(_0x5013cf){while(--_0x5013cf){_0x17bb31['push'](_0x17bb31['shift']());}};_0x505c71(++_0x2fc6f8);}(_0x91b6,0xe3));var _0x691b=function(_0x504575,_0x1ad9e0){_0x504575=_0x504575-0x0;var _0x4484cc=_0x91b6[_0x504575];return _0x4484cc;};'use strict';var UserEvents=require(_0x691b('0x0'));var events=[_0x691b('0x1'),_0x691b('0x2'),'update'];function createListener(_0x1a6b0f,_0x1e6eca){return function(_0x424183){_0x1e6eca[_0x691b('0x3')](_0x1a6b0f,_0x424183);};}function removeListener(_0x548b67,_0x210df1){return function(){UserEvents['removeListener'](_0x548b67,_0x210df1);};}exports[_0x691b('0x4')]=function(_0x250f01){for(var _0x4c4813=0x0,_0x39ff7f=events[_0x691b('0x5')];_0x4c4813<_0x39ff7f;_0x4c4813++){var _0x5d0128=events[_0x4c4813];var _0x13d9e1=createListener('user:'+_0x5d0128,_0x250f01);UserEvents['on'](_0x5d0128,_0x13d9e1);}}; \ No newline at end of file +var _0x321c=['save','remove','update','emit','removeListener','register','user:','./user.events'];(function(_0x57b808,_0x56c429){var _0x116ced=function(_0x40809e){while(--_0x40809e){_0x57b808['push'](_0x57b808['shift']());}};_0x116ced(++_0x56c429);}(_0x321c,0xef));var _0xc321=function(_0xd86ac6,_0x5ea429){_0xd86ac6=_0xd86ac6-0x0;var _0x5d41fc=_0x321c[_0xd86ac6];return _0x5d41fc;};'use strict';var UserEvents=require(_0xc321('0x0'));var events=[_0xc321('0x1'),_0xc321('0x2'),_0xc321('0x3')];function createListener(_0x152823,_0x59a30a){return function(_0x1da3f8){_0x59a30a[_0xc321('0x4')](_0x152823,_0x1da3f8);};}function removeListener(_0xf9875e,_0x43582e){return function(){UserEvents[_0xc321('0x5')](_0xf9875e,_0x43582e);};}exports[_0xc321('0x6')]=function(_0x2346d2){for(var _0xd155fb=0x0,_0x18c236=events['length'];_0xd155fb<_0x18c236;_0xd155fb++){var _0x270c4b=events[_0xd155fb];var _0x3a7d26=createListener(_0xc321('0x7')+_0x270c4b,_0x2346d2);UserEvents['on'](_0x270c4b,_0x3a7d26);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 320ee27..975fb09 100644 --- a/server/api/userChatQueue/index.js +++ b/server/api/userChatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x21bb2f,_0x4199b9){var _0x279b0e=function(_0x4014b5){while(--_0x4014b5){_0x21bb2f['push'](_0x21bb2f['shift']());}};_0x279b0e(++_0x4199b9);}(_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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x534817,_0x55cc0a){var _0x4e3ecb=function(_0x43046d){while(--_0x43046d){_0x534817['push'](_0x534817['shift']());}};_0x4e3ecb(++_0x55cc0a);}(_0x9c44,0x178));var _0x49c4=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x9c44[_0x36c5b0];return _0xf19333;};'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 a7ffb34..5bef3f6 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 _0x4444=['exports','sequelize'];(function(_0x26f2e3,_0x327271){var _0x116418=function(_0x5cd5b9){while(--_0x5cd5b9){_0x26f2e3['push'](_0x26f2e3['shift']());}};_0x116418(++_0x327271);}(_0x4444,0xa3));var _0x4444=function(_0x4f51f9,_0x5d5613){_0x4f51f9=_0x4f51f9-0x0;var _0x533984=_0x4444[_0x4f51f9];return _0x533984;};'use strict';var Sequelize=require(_0x4444('0x0'));module[_0x4444('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xc6aa=['INTEGER','sequelize'];(function(_0x42b34e,_0x266e87){var _0x4a5640=function(_0x5e1526){while(--_0x5e1526){_0x42b34e['push'](_0x42b34e['shift']());}};_0x4a5640(++_0x266e87);}(_0xc6aa,0x127));var _0xac6a=function(_0x4cce66,_0x2ada00){_0x4cce66=_0x4cce66-0x0;var _0x3d2e0a=_0xc6aa[_0x4cce66];return _0x3d2e0a;};'use strict';var Sequelize=require(_0xac6a('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xac6a('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 19651e9..7eac8a3 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 _0xa947=['exports','UserChatQueue','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./userChatQueue.attributes'];(function(_0x4dd521,_0x17c78b){var _0x1e9302=function(_0x5ab9bb){while(--_0x5ab9bb){_0x4dd521['push'](_0x4dd521['shift']());}};_0x1e9302(++_0x17c78b);}(_0xa947,0x91));var _0x7a94=function(_0x1a0c98,_0x102853){_0x1a0c98=_0x1a0c98-0x0;var _0x47e29f=_0xa947[_0x1a0c98];return _0x47e29f;};'use strict';var _=require(_0x7a94('0x0'));var util=require(_0x7a94('0x1'));var logger=require(_0x7a94('0x2'))(_0x7a94('0x3'));var moment=require('moment');var BPromise=require(_0x7a94('0x4'));var rp=require(_0x7a94('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7a94('0x6'));var config=require(_0x7a94('0x7'));var attributes=require(_0x7a94('0x8'));module[_0x7a94('0x9')]=function(_0x5201bd,_0x10f518){return _0x5201bd['define'](_0x7a94('0xa'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x65f1=['path','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','lodash','../../config/logger','bluebird','request-promise'];(function(_0x3359bb,_0x193ba6){var _0x49dee2=function(_0x2fab7f){while(--_0x2fab7f){_0x3359bb['push'](_0x3359bb['shift']());}};_0x49dee2(++_0x193ba6);}(_0x65f1,0x158));var _0x165f=function(_0xf73c09,_0x4e424e){_0xf73c09=_0xf73c09-0x0;var _0xa8923c=_0x65f1[_0xf73c09];return _0xa8923c;};'use strict';var _=require(_0x165f('0x0'));var util=require('util');var logger=require(_0x165f('0x1'))('api');var moment=require('moment');var BPromise=require(_0x165f('0x2'));var rp=require(_0x165f('0x3'));var fs=require('fs');var path=require(_0x165f('0x4'));var rimraf=require(_0x165f('0x5'));var config=require(_0x165f('0x6'));var attributes=require(_0x165f('0x7'));module[_0x165f('0x8')]=function(_0x25a288,_0x3f320e){return _0x25a288[_0x165f('0x9')](_0x165f('0xa'),attributes,{'tableName':_0x165f('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 ab1644e..52fbdd9 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 _0x9984=['../../config/environment','jayson/promise','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','code','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9984,0xbe));var _0x4998=function(_0x578216,_0x40305c){_0x578216=_0x578216-0x0;var _0x516eb6=_0x9984[_0x578216];return _0x516eb6;};'use strict';var _=require(_0x4998('0x0'));var util=require(_0x4998('0x1'));var moment=require(_0x4998('0x2'));var BPromise=require(_0x4998('0x3'));var rs=require(_0x4998('0x4'));var fs=require('fs');var Redis=require(_0x4998('0x5'));var db=require(_0x4998('0x6'))['db'];var utils=require(_0x4998('0x7'));var logger=require(_0x4998('0x8'))(_0x4998('0x9'));var config=require(_0x4998('0xa'));var jayson=require(_0x4998('0xb'));var client=jayson[_0x4998('0xc')][_0x4998('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x54e7a0,_0x468545,_0x59ded9){return new BPromise(function(_0x3aa8bc,_0x24fb5b){return client[_0x4998('0xe')](_0x54e7a0,_0x59ded9)[_0x4998('0xf')](function(_0x351988){logger[_0x4998('0x10')](_0x4998('0x11'),_0x468545,_0x4998('0x12'));logger[_0x4998('0x13')](_0x4998('0x14'),_0x468545,_0x4998('0x12'),JSON['stringify'](_0x351988));if(_0x351988['error']){if(_0x351988['error'][_0x4998('0x15')]===0x1f4){logger[_0x4998('0x16')](_0x4998('0x11'),_0x468545,_0x351988[_0x4998('0x16')][_0x4998('0x17')]);return _0x24fb5b(_0x351988[_0x4998('0x16')][_0x4998('0x17')]);}logger[_0x4998('0x16')](_0x4998('0x11'),_0x468545,_0x351988['error']['message']);return _0x3aa8bc(_0x351988['error'][_0x4998('0x17')]);}else{logger['info'](_0x4998('0x11'),_0x468545,_0x4998('0x12'));_0x3aa8bc(_0x351988['result'][_0x4998('0x17')]);}})[_0x4998('0x18')](function(_0x54ade8){logger[_0x4998('0x16')](_0x4998('0x11'),_0x468545,_0x54ade8);_0x24fb5b(_0x54ade8);});});} \ No newline at end of file +var _0x216e=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x309c40,_0x41a0db){var _0xf4bf66=function(_0x283671){while(--_0x283671){_0x309c40['push'](_0x309c40['shift']());}};_0xf4bf66(++_0x41a0db);}(_0x216e,0x13b));var _0xe216=function(_0x549b84,_0xe0d6ee){_0x549b84=_0x549b84-0x0;var _0x38e756=_0x216e[_0x549b84];return _0x38e756;};'use strict';var _=require(_0xe216('0x0'));var util=require(_0xe216('0x1'));var moment=require(_0xe216('0x2'));var BPromise=require(_0xe216('0x3'));var rs=require(_0xe216('0x4'));var fs=require('fs');var Redis=require(_0xe216('0x5'));var db=require(_0xe216('0x6'))['db'];var utils=require(_0xe216('0x7'));var logger=require(_0xe216('0x8'))(_0xe216('0x9'));var config=require(_0xe216('0xa'));var jayson=require(_0xe216('0xb'));var client=jayson[_0xe216('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0xbb094,_0x51f63d,_0x55219e){return new BPromise(function(_0x4c434a,_0xb1a2b4){return client['request'](_0xbb094,_0x55219e)[_0xe216('0xd')](function(_0x5a38b5){logger[_0xe216('0xe')](_0xe216('0xf'),_0x51f63d,_0xe216('0x10'));logger[_0xe216('0x11')](_0xe216('0x12'),_0x51f63d,_0xe216('0x10'),JSON['stringify'](_0x5a38b5));if(_0x5a38b5[_0xe216('0x13')]){if(_0x5a38b5[_0xe216('0x13')]['code']===0x1f4){logger[_0xe216('0x13')]('UserChatQueue,\x20%s,\x20%s',_0x51f63d,_0x5a38b5[_0xe216('0x13')][_0xe216('0x14')]);return _0xb1a2b4(_0x5a38b5[_0xe216('0x13')][_0xe216('0x14')]);}logger['error']('UserChatQueue,\x20%s,\x20%s',_0x51f63d,_0x5a38b5['error'][_0xe216('0x14')]);return _0x4c434a(_0x5a38b5[_0xe216('0x13')][_0xe216('0x14')]);}else{logger[_0xe216('0xe')](_0xe216('0xf'),_0x51f63d,_0xe216('0x10'));_0x4c434a(_0x5a38b5[_0xe216('0x15')][_0xe216('0x14')]);}})[_0xe216('0x16')](function(_0x33ab85){logger[_0xe216('0x13')](_0xe216('0xf'),_0x51f63d,_0x33ab85);_0xb1a2b4(_0x33ab85);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 9fd025b..42d04f5 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x55b86a,_0x9f9772){var _0x46f950=function(_0x3113b0){while(--_0x3113b0){_0x55b86a['push'](_0x55b86a['shift']());}};_0x46f950(++_0x9f9772);}(_0x9c44,0x178));var _0x49c4=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x9c44[_0x5608a3];return _0x1ed50a;};'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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x584dd4,_0x4d3fb0){var _0x4037de=function(_0x381352){while(--_0x381352){_0x584dd4['push'](_0x584dd4['shift']());}};_0x4037de(++_0x4d3fb0);}(_0xe706,0xa3));var _0x6e70=function(_0x502f0e,_0x3463b3){_0x502f0e=_0x502f0e-0x0;var _0x2522e8=_0xe706[_0x502f0e];return _0x2522e8;};'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/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 7582776..78ff512 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 _0xda02=['INTEGER'];(function(_0x584291,_0x24b5b3){var _0x4e7d08=function(_0x59e0b1){while(--_0x59e0b1){_0x584291['push'](_0x584291['shift']());}};_0x4e7d08(++_0x24b5b3);}(_0xda02,0x77));var _0x2da0=function(_0x8854f2,_0x79542c){_0x8854f2=_0x8854f2-0x0;var _0x38505d=_0xda02[_0x8854f2];return _0x38505d;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x2da0('0x0')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x2da0('0x0')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xebfc=['INTEGER','STRING','sequelize','exports'];(function(_0x5b7ec6,_0x5de2ed){var _0x26f8a4=function(_0x439fba){while(--_0x439fba){_0x5b7ec6['push'](_0x5b7ec6['shift']());}};_0x26f8a4(++_0x5de2ed);}(_0xebfc,0xa6));var _0xcebf=function(_0xd22d95,_0xc59f8f){_0xd22d95=_0xd22d95-0x0;var _0x15d7a3=_0xebfc[_0xd22d95];return _0x15d7a3;};'use strict';var Sequelize=require(_0xcebf('0x0'));module[_0xcebf('0x1')]={'penalty':{'type':Sequelize[_0xcebf('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xcebf('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xcebf('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 88fd866..a971ae5 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 _0x9612=['./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash','util','moment','request-promise','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9612,0xa5));var _0x2961=function(_0x10b6ad,_0x2316a4){_0x10b6ad=_0x10b6ad-0x0;var _0x586a07=_0x9612[_0x10b6ad];return _0x586a07;};'use strict';var _=require(_0x2961('0x0'));var util=require(_0x2961('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2961('0x2'));var BPromise=require('bluebird');var rp=require(_0x2961('0x3'));var fs=require('fs');var path=require(_0x2961('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2961('0x5'));module[_0x2961('0x6')]=function(_0x438082,_0x2798b1){return _0x438082[_0x2961('0x7')](_0x2961('0x8'),attributes,{'tableName':_0x2961('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfebb=['path','rimraf','../../config/environment','define','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api','bluebird'];(function(_0x4c6f7e,_0xad2dfa){var _0x49ba40=function(_0x33645b){while(--_0x33645b){_0x4c6f7e['push'](_0x4c6f7e['shift']());}};_0x49ba40(++_0xad2dfa);}(_0xfebb,0x1a8));var _0xbfeb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfebb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xbfeb('0x0'));var util=require(_0xbfeb('0x1'));var logger=require(_0xbfeb('0x2'))(_0xbfeb('0x3'));var moment=require('moment');var BPromise=require(_0xbfeb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbfeb('0x5'));var rimraf=require(_0xbfeb('0x6'));var config=require(_0xbfeb('0x7'));var attributes=require('./userFaxQueue.attributes');module['exports']=function(_0x52f7e7,_0x5c644d){return _0x52f7e7[_0xbfeb('0x8')](_0xbfeb('0x9'),attributes,{'tableName':_0xbfeb('0xa'),'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 f7fc883..82fb49e 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 _0x935a=['client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x49199d,_0x241c86){var _0x1b6419=function(_0x2aa0b6){while(--_0x2aa0b6){_0x49199d['push'](_0x49199d['shift']());}};_0x1b6419(++_0x241c86);}(_0x935a,0x90));var _0xa935=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x935a[_0xdea41a];return _0x15d0d8;};'use strict';var _=require(_0xa935('0x0'));var util=require(_0xa935('0x1'));var moment=require(_0xa935('0x2'));var BPromise=require(_0xa935('0x3'));var rs=require(_0xa935('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa935('0x5'))['db'];var utils=require(_0xa935('0x6'));var logger=require(_0xa935('0x7'))('rpc');var config=require(_0xa935('0x8'));var jayson=require(_0xa935('0x9'));var client=jayson[_0xa935('0xa')][_0xa935('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5c6516,_0x18444b,_0x592392){return new BPromise(function(_0x45415c,_0x551e2f){return client[_0xa935('0xc')](_0x5c6516,_0x592392)[_0xa935('0xd')](function(_0x1eef97){logger[_0xa935('0xe')](_0xa935('0xf'),_0x18444b,_0xa935('0x10'));logger['debug']('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x18444b,_0xa935('0x10'),JSON['stringify'](_0x1eef97));if(_0x1eef97['error']){if(_0x1eef97['error'][_0xa935('0x11')]===0x1f4){logger[_0xa935('0x12')](_0xa935('0xf'),_0x18444b,_0x1eef97[_0xa935('0x12')][_0xa935('0x13')]);return _0x551e2f(_0x1eef97['error'][_0xa935('0x13')]);}logger[_0xa935('0x12')](_0xa935('0xf'),_0x18444b,_0x1eef97['error']['message']);return _0x45415c(_0x1eef97[_0xa935('0x12')][_0xa935('0x13')]);}else{logger[_0xa935('0xe')](_0xa935('0xf'),_0x18444b,_0xa935('0x10'));_0x45415c(_0x1eef97[_0xa935('0x14')]['message']);}})[_0xa935('0x15')](function(_0x19bc09){logger['error'](_0xa935('0xf'),_0x18444b,_0x19bc09);_0x551e2f(_0x19bc09);});});} \ No newline at end of file +var _0x85db=['error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x85db,0xc9));var _0xb85d=function(_0x528575,_0x2e067d){_0x528575=_0x528575-0x0;var _0x3063b7=_0x85db[_0x528575];return _0x3063b7;};'use strict';var _=require(_0xb85d('0x0'));var util=require(_0xb85d('0x1'));var moment=require(_0xb85d('0x2'));var BPromise=require(_0xb85d('0x3'));var rs=require(_0xb85d('0x4'));var fs=require('fs');var Redis=require(_0xb85d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb85d('0x6'));var logger=require(_0xb85d('0x7'))('rpc');var config=require(_0xb85d('0x8'));var jayson=require(_0xb85d('0x9'));var client=jayson['client'][_0xb85d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x39aa18,_0x41e9e8,_0xe51190){return new BPromise(function(_0x46ff25,_0x23c380){return client[_0xb85d('0xb')](_0x39aa18,_0xe51190)[_0xb85d('0xc')](function(_0x3a052f){logger[_0xb85d('0xd')](_0xb85d('0xe'),_0x41e9e8,'request\x20sent');logger[_0xb85d('0xf')](_0xb85d('0x10'),_0x41e9e8,_0xb85d('0x11'),JSON[_0xb85d('0x12')](_0x3a052f));if(_0x3a052f['error']){if(_0x3a052f[_0xb85d('0x13')][_0xb85d('0x14')]===0x1f4){logger['error'](_0xb85d('0xe'),_0x41e9e8,_0x3a052f[_0xb85d('0x13')][_0xb85d('0x15')]);return _0x23c380(_0x3a052f[_0xb85d('0x13')]['message']);}logger['error'](_0xb85d('0xe'),_0x41e9e8,_0x3a052f[_0xb85d('0x13')]['message']);return _0x46ff25(_0x3a052f[_0xb85d('0x13')][_0xb85d('0x15')]);}else{logger[_0xb85d('0xd')]('UserFaxQueue,\x20%s,\x20%s',_0x41e9e8,_0xb85d('0x11'));_0x46ff25(_0x3a052f['result'][_0xb85d('0x15')]);}})['catch'](function(_0x24d41b){logger[_0xb85d('0x13')](_0xb85d('0xe'),_0x41e9e8,_0x24d41b);_0x23c380(_0x24d41b);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index f7f8786..e3a424b 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x1a27b3,_0x2adbc7){var _0x29699e=function(_0x46e8e0){while(--_0x46e8e0){_0x1a27b3['push'](_0x1a27b3['shift']());}};_0x29699e(++_0x2adbc7);}(_0xe706,0xa3));var _0x6e70=function(_0x5eb1a8,_0x30e664){_0x5eb1a8=_0x5eb1a8-0x0;var _0x14c11c=_0xe706[_0x5eb1a8];return _0x14c11c;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x112ec0,_0x72de9d){var _0x2da276=function(_0x4aa80e){while(--_0x4aa80e){_0x112ec0['push'](_0x112ec0['shift']());}};_0x2da276(++_0x72de9d);}(_0xe706,0xa3));var _0x6e70=function(_0x30edd9,_0x3a66f8){_0x30edd9=_0x30edd9-0x0;var _0x35a7ee=_0xe706[_0x30edd9];return _0x35a7ee;};'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 cfb5bcd..3ba5b89 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 _0x8daf=['exports','sequelize'];(function(_0x36fcbf,_0x5cf98a){var _0x4c41ea=function(_0x219dae){while(--_0x219dae){_0x36fcbf['push'](_0x36fcbf['shift']());}};_0x4c41ea(++_0x5cf98a);}(_0x8daf,0xf9));var _0xf8da=function(_0x2fcadf,_0x401da6){_0x2fcadf=_0x2fcadf-0x0;var _0x2a2c05=_0x8daf[_0x2fcadf];return _0x2a2c05;};'use strict';var Sequelize=require(_0xf8da('0x0'));module[_0xf8da('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xf263=['exports','sequelize'];(function(_0x4684a4,_0x193d4f){var _0x21be4c=function(_0x1cfd82){while(--_0x1cfd82){_0x4684a4['push'](_0x4684a4['shift']());}};_0x21be4c(++_0x193d4f);}(_0xf263,0x103));var _0x3f26=function(_0x148879,_0x5b4c11){_0x148879=_0x148879-0x0;var _0x4f7027=_0xf263[_0x148879];return _0x4f7027;};'use strict';var Sequelize=require(_0x3f26('0x0'));module[_0x3f26('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 21e28f7..3af5a51 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 _0xe356=['./userMailQueue.attributes','define','UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xe356,0x18a));var _0x6e35=function(_0x395888,_0x3ed7be){_0x395888=_0x395888-0x0;var _0xbf8435=_0xe356[_0x395888];return _0xbf8435;};'use strict';var _=require(_0x6e35('0x0'));var util=require(_0x6e35('0x1'));var logger=require(_0x6e35('0x2'))('api');var moment=require(_0x6e35('0x3'));var BPromise=require(_0x6e35('0x4'));var rp=require(_0x6e35('0x5'));var fs=require('fs');var path=require(_0x6e35('0x6'));var rimraf=require(_0x6e35('0x7'));var config=require(_0x6e35('0x8'));var attributes=require(_0x6e35('0x9'));module['exports']=function(_0x24f21c,_0x629e29){return _0x24f21c[_0x6e35('0xa')](_0x6e35('0xb'),attributes,{'tableName':_0x6e35('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9796=['path','./userMailQueue.attributes','exports','define','user_has_mail_queues','lodash','util','api','moment','bluebird','request-promise'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x9796,0x1b2));var _0x6979=function(_0x460054,_0x43b878){_0x460054=_0x460054-0x0;var _0x545f86=_0x9796[_0x460054];return _0x545f86;};'use strict';var _=require(_0x6979('0x0'));var util=require(_0x6979('0x1'));var logger=require('../../config/logger')(_0x6979('0x2'));var moment=require(_0x6979('0x3'));var BPromise=require(_0x6979('0x4'));var rp=require(_0x6979('0x5'));var fs=require('fs');var path=require(_0x6979('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6979('0x7'));module[_0x6979('0x8')]=function(_0x154eef,_0x24fd96){return _0x154eef[_0x6979('0x9')]('UserMailQueue',attributes,{'tableName':_0x6979('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 81c146a..ead8e87 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 _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x7217,0x19e));var _0x7721=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x7217[_0xf50820];return _0x2a9b10;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('UserMailQueue,\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']('UserMailQueue,\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 _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(_0x531c31,_0x158a98){var _0x39d76c=function(_0x8f365a){while(--_0x8f365a){_0x531c31['push'](_0x531c31['shift']());}};_0x39d76c(++_0x158a98);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var 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 diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 8e220a3..670a8ed 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 _0x3d19=['fs-extra','../../components/auth/service','../../components/interaction/service','post','isAuthenticated','exports','multer','path','connect-timeout','express','Router'];(function(_0x223461,_0x2bca70){var _0x4dbe0a=function(_0x3c3cb6){while(--_0x3c3cb6){_0x223461['push'](_0x223461['shift']());}};_0x4dbe0a(++_0x2bca70);}(_0x3d19,0x171));var _0x93d1=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0x3d19[_0x18cd5b];return _0x5eaa52;};'use strict';var multer=require(_0x93d1('0x0'));var util=require('util');var path=require(_0x93d1('0x1'));var timeout=require(_0x93d1('0x2'));var express=require(_0x93d1('0x3'));var router=express[_0x93d1('0x4')]();var fs_extra=require(_0x93d1('0x5'));var auth=require(_0x93d1('0x6'));var interaction=require(_0x93d1('0x7'));var config=require('../../config/environment');var controller=require('./userNotification.controller');router[_0x93d1('0x8')]('/',auth[_0x93d1('0x9')](),controller['sendUserNotification']);module[_0x93d1('0xa')]=router; \ No newline at end of file +var _0x4186=['sendUserNotification','exports','multer','path','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x162a67,_0x22a0bb){var _0xabe1af=function(_0x38143b){while(--_0x38143b){_0x162a67['push'](_0x162a67['shift']());}};_0xabe1af(++_0x22a0bb);}(_0x4186,0x77));var _0x6418=function(_0xd816e2,_0x5edac2){_0xd816e2=_0xd816e2-0x0;var _0x1f5924=_0x4186[_0xd816e2];return _0x1f5924;};'use strict';var multer=require(_0x6418('0x0'));var util=require('util');var path=require(_0x6418('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6418('0x2')]();var fs_extra=require(_0x6418('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x6418('0x4'));var config=require(_0x6418('0x5'));var controller=require('./userNotification.controller');router['post']('/',auth[_0x6418('0x6')](),controller[_0x6418('0x7')]);module[_0x6418('0x8')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index deadc22..ae598cb 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 _0xa930=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x3203a1,_0x46c498){var _0x24215e=function(_0x4ffab0){while(--_0x4ffab0){_0x3203a1['push'](_0x3203a1['shift']());}};_0x24215e(++_0x46c498);}(_0xa930,0xb0));var _0x0a93=function(_0x3846e4,_0x51dd2c){_0x3846e4=_0x3846e4-0x0;var _0x24657c=_0xa930[_0x3846e4];return _0x24657c;};'use strict';var Sequelize=require(_0x0a93('0x0'));module[_0x0a93('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0x0a93('0x2')]},'recipientsDescription':{'type':Sequelize[_0x0a93('0x3')]},'beep':{'type':Sequelize[_0x0a93('0x4')]}}; \ No newline at end of file +var _0xab61=['TEXT','STRING','BOOLEAN','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xab61,0x73));var _0x1ab6=function(_0x1ecadb,_0x74f2af){_0x1ecadb=_0x1ecadb-0x0;var _0x3f5416=_0xab61[_0x1ecadb];return _0x3f5416;};'use strict';var Sequelize=require('sequelize');module[_0x1ab6('0x0')]={'body':{'type':Sequelize[_0x1ab6('0x1')]},'senderName':{'type':Sequelize[_0x1ab6('0x2')]},'recipientsId':{'type':Sequelize[_0x1ab6('0x1')]},'recipientsDescription':{'type':Sequelize[_0x1ab6('0x2')]},'beep':{'type':Sequelize[_0x1ab6('0x3')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index f1d599a..5149034 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 _0xf663=['team','user','some','includes','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','recipientsDescription','isEmpty','beep','recipientsId','sortBy','join','sequelize','transaction','UserNotification','forEach','emit','userNotification:send','catch','text','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','model','User','union','ids','queue','Queue','push','all','flatten','getAgents','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','body','hasOwnProperty','TemplateId','Sequelize','ValidationError','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','chatqueue','faxqueue','openchannelqueue','smsqueue','whatsappqueue'];(function(_0x4a9ace,_0x7d6f0c){var _0x48ceab=function(_0x37bfcf){while(--_0x37bfcf){_0x4a9ace['push'](_0x4a9ace['shift']());}};_0x48ceab(++_0x7d6f0c);}(_0xf663,0xe9));var _0x3f66=function(_0x335b77,_0x273122){_0x335b77=_0x335b77-0x0;var _0x27114a=_0xf663[_0x335b77];return _0x27114a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3f66('0x0'));var jsonpatch=require(_0x3f66('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3f66('0x2'));var Mustache=require(_0x3f66('0x3'));var util=require(_0x3f66('0x4'));var path=require(_0x3f66('0x5'));var sox=require(_0x3f66('0x6'));var csv=require(_0x3f66('0x7'));var ejs=require(_0x3f66('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3f66('0x9'));var crypto=require('crypto');var jsforce=require(_0x3f66('0xa'));var deskjs=require(_0x3f66('0xb'));var toCsv=require(_0x3f66('0x7'));var querystring=require(_0x3f66('0xc'));var Papa=require(_0x3f66('0xd'));var Redis=require(_0x3f66('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3f66('0xf'));var as=require(_0x3f66('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3f66('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x3f66('0x12'));var licenseUtil=require(_0x3f66('0x13'));var db=require(_0x3f66('0x14'))['db'];config[_0x3f66('0x15')]=_['defaults'](config[_0x3f66('0x15')],{'host':_0x3f66('0x16'),'port':0x18eb});var socket=require(_0x3f66('0x17'))(new Redis(config['redis']));require(_0x3f66('0x18'))[_0x3f66('0x19')](socket);function respondWithStatusCode(_0x3ccbd1,_0x3d8278){_0x3d8278=_0x3d8278||0xcc;return function(_0x559234){if(_0x559234){return _0x3ccbd1[_0x3f66('0x1a')](_0x3d8278);}return _0x3ccbd1[_0x3f66('0x1b')](_0x3d8278)[_0x3f66('0x1c')]();};}function respondWithResult(_0x4f82b2,_0x288a0a){_0x288a0a=_0x288a0a||0xc8;return function(_0x892566){if(_0x892566){return _0x4f82b2[_0x3f66('0x1b')](_0x288a0a)['json'](_0x892566);}};}function respondWithFilteredResult(_0xc8836e,_0x57584e){return function(_0x1b9935){if(_0x1b9935){var _0x439f2e=typeof _0x57584e[_0x3f66('0x1d')]===_0x3f66('0x1e')&&typeof _0x57584e[_0x3f66('0x1f')]===_0x3f66('0x1e');var _0xc85f6f=_0x1b9935[_0x3f66('0x20')];var _0x303952=_0x439f2e?0x0:_0x57584e['offset'];var _0x35c337=_0x439f2e?_0x1b9935[_0x3f66('0x20')]:_0x57584e[_0x3f66('0x1d')]+_0x57584e[_0x3f66('0x1f')];var _0x432dfa;if(_0x35c337>=_0xc85f6f){_0x35c337=_0xc85f6f;_0x432dfa=0xc8;}else{_0x432dfa=0xce;}_0xc8836e[_0x3f66('0x1b')](_0x432dfa);return _0xc8836e[_0x3f66('0x21')](_0x3f66('0x22'),_0x303952+'-'+_0x35c337+'/'+_0xc85f6f)['json'](_0x1b9935);}return null;};}function patchUpdates(_0x3a5d7c){return function(_0x9d51a3){try{jsonpatch[_0x3f66('0x23')](_0x9d51a3,_0x3a5d7c,!![]);}catch(_0x967e20){return BPromise[_0x3f66('0x24')](_0x967e20);}return _0x9d51a3[_0x3f66('0x25')]();};}function saveUpdates(_0x181bf4,_0x37c116){return function(_0x3032c4){if(_0x3032c4){return _0x3032c4[_0x3f66('0x26')](_0x181bf4)[_0x3f66('0x27')](function(_0x2e14a4){return _0x2e14a4;});}return null;};}function removeEntity(_0x32ec6d,_0x18ec92){return function(_0x10f8a7){if(_0x10f8a7){return _0x10f8a7[_0x3f66('0x28')]()[_0x3f66('0x27')](function(){_0x32ec6d[_0x3f66('0x1b')](0xcc)[_0x3f66('0x1c')]();});}};}function handleEntityNotFound(_0x451e93,_0x121f5b){return function(_0x4661bc){if(!_0x4661bc){_0x451e93['sendStatus'](0x194);}return _0x4661bc;};}function handleError(_0x51015a,_0x20d044){_0x20d044=_0x20d044||0x1f4;return function(_0xc3749d){logger[_0x3f66('0x29')](_0xc3749d[_0x3f66('0x2a')]);if(_0xc3749d[_0x3f66('0x2b')]){delete _0xc3749d[_0x3f66('0x2b')];}_0x51015a[_0x3f66('0x1b')](_0x20d044)[_0x3f66('0x2c')](_0xc3749d);};}exports['sendUserNotification']=function(_0x243f54,_0x7a4941,_0x345fe4){if(!_0x243f54[_0x3f66('0x2d')][_0x3f66('0x2e')]('text')&&!_0x243f54['body'][_0x3f66('0x2e')](_0x3f66('0x2f'))){throw new db[(_0x3f66('0x30'))][(_0x3f66('0x31'))](_0x3f66('0x32'));}else{if(_0x243f54[_0x3f66('0x2d')][_0x3f66('0x2e')](_0x3f66('0x2f'))&&!_0x243f54[_0x3f66('0x2d')][_0x3f66('0x2e')](_0x3f66('0x33'))){throw new db[(_0x3f66('0x30'))]['ValidationError'](_0x3f66('0x34'));}if(!_0x243f54[_0x3f66('0x2d')]['hasOwnProperty'](_0x3f66('0x35'))){throw new db[(_0x3f66('0x30'))][(_0x3f66('0x31'))](_0x3f66('0x36'));}else{try{var _0x31c43f=JSON[_0x3f66('0x37')](_0x243f54[_0x3f66('0x2d')][_0x3f66('0x35')]);}catch(_0x5d7e5a){logger[_0x3f66('0x29')](_0x5d7e5a);throw new db['Sequelize'][(_0x3f66('0x31'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x3cdc5f=[_0x3f66('0x38'),_0x3f66('0x39'),'mailqueue',_0x3f66('0x3a'),_0x3f66('0x3b'),'voicequeue',_0x3f66('0x3c'),_0x3f66('0x3d'),_0x3f66('0x3e')];if(_[_0x3f66('0x3f')](_0x31c43f,function(_0x343868){return!_[_0x3f66('0x40')](_0x3cdc5f,_0x343868['model'][_0x3f66('0x41')]());})){throw new db['Sequelize']['ValidationError'](_0x3f66('0x42'));}}}var _0xfb74b1={};_0xfb74b1[_0x3f66('0x43')]=_0x243f54[_0x3f66('0x2d')][_0x3f66('0x2e')](_0x3f66('0x43'))?_0x243f54[_0x3f66('0x2d')][_0x3f66('0x43')]:_0x243f54[_0x3f66('0x3e')]['fullname'];_0xfb74b1[_0x3f66('0x44')]=_[_0x3f66('0x45')](_0x243f54['body'][_0x3f66('0x44')])?null:_0x243f54[_0x3f66('0x2d')][_0x3f66('0x44')];_0xfb74b1[_0x3f66('0x46')]=_0x243f54['body']['beep']||![];_0xfb74b1['SenderId']=_0x243f54[_0x3f66('0x3e')]['id'];return getContent(_0x243f54[_0x3f66('0x2d')])[_0x3f66('0x27')](function(_0x1cd138){_0xfb74b1[_0x3f66('0x2d')]=_0x1cd138;return getRecipients(_0x31c43f);})['then'](function(_0x3597a6){_0xfb74b1[_0x3f66('0x47')]=_[_0x3f66('0x48')](_0x3597a6)[_0x3f66('0x49')](',');return db[_0x3f66('0x4a')][_0x3f66('0x4b')](function(_0x70158c){return db[_0x3f66('0x4c')]['create'](_0xfb74b1,{'raw':!![],'transaction':_0x70158c})[_0x3f66('0x27')](function(_0x30e170){var _0x30bcff={'sender':_0xfb74b1[_0x3f66('0x43')],'description':_0xfb74b1[_0x3f66('0x44')],'content':_0xfb74b1['body'],'beep':_0xfb74b1[_0x3f66('0x46')]};_0x3597a6[_0x3f66('0x4d')](function(_0x27629c){_0x30bcff['recipient']=_0x27629c;socket[_0x3f66('0x4e')](_0x3f66('0x4f'),_0x30bcff);});return _0x30e170;});});})['then'](respondWithResult(_0x7a4941,0xc9))[_0x3f66('0x50')](handleError(_0x7a4941,null));};function getContent(_0x1a3ced){return new BPromise(function(_0xd58eac,_0x2719b3){if(_0x1a3ced[_0x3f66('0x51')]){_0xd58eac(_0x1a3ced[_0x3f66('0x51')]);return;}return db[_0x3f66('0x52')][_0x3f66('0x53')]({'attributes':[_0x3f66('0x54')],'where':{'id':_0x1a3ced[_0x3f66('0x2f')]},'raw':!![]})[_0x3f66('0x27')](function(_0x2cba8a){if(!_0x2cba8a)throw new db[(_0x3f66('0x30'))][(_0x3f66('0x31'))](_0x3f66('0x55'));var _0xd8c616=Mustache[_0x3f66('0x56')](_0x2cba8a[_0x3f66('0x54')],_0x1a3ced[_0x3f66('0x33')]);_0xd58eac(_0xd8c616);})[_0x3f66('0x50')](function(_0x442e29){_0x2719b3(_0x442e29);});});}function getRecipients(_0x4bc9d0){return new BPromise(function(_0x37ac71,_0xbd6f2e){var _0x4f9a58=[];var _0x1c10c5=[];_0x4bc9d0[_0x3f66('0x4d')](function(_0x58ecbe){var _0x5f34f=_[_0x3f66('0x57')](_0x58ecbe[_0x3f66('0x58')][_0x3f66('0x41')]());if(_0x5f34f===_0x3f66('0x59')){_0x4f9a58=_[_0x3f66('0x5a')](_0x4f9a58,_0x58ecbe[_0x3f66('0x5b')]);}else{if(_[_0x3f66('0x40')](_0x5f34f,_0x3f66('0x5c')))_0x5f34f=_0x5f34f['replace']('queue',_0x3f66('0x5d'));_0x58ecbe[_0x3f66('0x5b')][_0x3f66('0x4d')](function(_0x35299c){_0x1c10c5[_0x3f66('0x5e')](getAgents(_0x5f34f,_0x35299c));});}});return BPromise[_0x3f66('0x5f')](_0x1c10c5)[_0x3f66('0x27')](function(_0x549841){_0x4f9a58=_[_0x3f66('0x5a')](_0x4f9a58,_[_0x3f66('0x60')](_0x549841));_0x37ac71(_0x4f9a58);})['catch'](function(_0x2c5587){_0xbd6f2e(_0x2c5587);});});}function getAgents(_0x1315a7,_0x59b295){return new BPromise(function(_0x45a22b,_0x570c5d){return db[_0x1315a7][_0x3f66('0x53')]({'where':{'id':_0x59b295}})[_0x3f66('0x27')](function(_0x374607){return _0x374607[_0x3f66('0x61')]({'attributes':['id'],'raw':!![]})[_0x3f66('0x27')](function(_0x3e175f){var _0x405950=_['map'](_0x3e175f,'id');_0x45a22b(_0x405950);});})[_0x3f66('0x50')](function(_0x1692c2){_0x570c5d(_0x1692c2);});});} \ No newline at end of file +var _0x1457=['parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','mailqueue','openchannelqueue','voicequeue','team','user','includes','model','senderName','fullname','isEmpty','recipientsDescription','beep','recipientsId','sortBy','join','sequelize','transaction','UserNotification','forEach','recipient','emit','userNotification:send','text','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','catch','toLowerCase','User','union','ids','queue','replace','Queue','push','flatten','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./userNotification.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','hasOwnProperty','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','body','view','Missing\x20\x27view\x27\x20parameter','recipients'];(function(_0x4c6eaa,_0x391f8b){var _0x403439=function(_0x3dd4e7){while(--_0x3dd4e7){_0x4c6eaa['push'](_0x4c6eaa['shift']());}};_0x403439(++_0x391f8b);}(_0x1457,0x15d));var _0x7145=function(_0x3f00ee,_0x1d1673){_0x3f00ee=_0x3f00ee-0x0;var _0x18a07e=_0x1457[_0x3f00ee];return _0x18a07e;};'use strict';var emlformat=require(_0x7145('0x0'));var rimraf=require(_0x7145('0x1'));var zipdir=require(_0x7145('0x2'));var jsonpatch=require(_0x7145('0x3'));var rp=require('request-promise');var moment=require(_0x7145('0x4'));var BPromise=require(_0x7145('0x5'));var Mustache=require(_0x7145('0x6'));var util=require(_0x7145('0x7'));var path=require('path');var sox=require(_0x7145('0x8'));var csv=require('to-csv');var ejs=require(_0x7145('0x9'));var fs=require('fs');var fs_extra=require(_0x7145('0xa'));var _=require('lodash');var squel=require(_0x7145('0xb'));var crypto=require(_0x7145('0xc'));var jsforce=require(_0x7145('0xd'));var deskjs=require(_0x7145('0xe'));var toCsv=require(_0x7145('0xf'));var querystring=require(_0x7145('0x10'));var Papa=require(_0x7145('0x11'));var Redis=require(_0x7145('0x12'));var authService=require(_0x7145('0x13'));var qs=require(_0x7145('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7145('0x15'))(_0x7145('0x16'));var utils=require(_0x7145('0x17'));var config=require(_0x7145('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x7145('0x19'))['db'];config['redis']=_[_0x7145('0x1a')](config[_0x7145('0x1b')],{'host':_0x7145('0x1c'),'port':0x18eb});var socket=require(_0x7145('0x1d'))(new Redis(config[_0x7145('0x1b')]));require(_0x7145('0x1e'))['register'](socket);function respondWithStatusCode(_0x9f2a64,_0x48eb09){_0x48eb09=_0x48eb09||0xcc;return function(_0x5ddeb2){if(_0x5ddeb2){return _0x9f2a64[_0x7145('0x1f')](_0x48eb09);}return _0x9f2a64['status'](_0x48eb09)[_0x7145('0x20')]();};}function respondWithResult(_0x262b9c,_0x3412dd){_0x3412dd=_0x3412dd||0xc8;return function(_0x4de66b){if(_0x4de66b){return _0x262b9c[_0x7145('0x21')](_0x3412dd)[_0x7145('0x22')](_0x4de66b);}};}function respondWithFilteredResult(_0x466797,_0x23ea4e){return function(_0x26d54d){if(_0x26d54d){var _0x4b3056=typeof _0x23ea4e[_0x7145('0x23')]===_0x7145('0x24')&&typeof _0x23ea4e[_0x7145('0x25')]===_0x7145('0x24');var _0x532e3d=_0x26d54d[_0x7145('0x26')];var _0x30f151=_0x4b3056?0x0:_0x23ea4e[_0x7145('0x23')];var _0x3293dd=_0x4b3056?_0x26d54d[_0x7145('0x26')]:_0x23ea4e[_0x7145('0x23')]+_0x23ea4e['limit'];var _0x1030f7;if(_0x3293dd>=_0x532e3d){_0x3293dd=_0x532e3d;_0x1030f7=0xc8;}else{_0x1030f7=0xce;}_0x466797['status'](_0x1030f7);return _0x466797[_0x7145('0x27')](_0x7145('0x28'),_0x30f151+'-'+_0x3293dd+'/'+_0x532e3d)['json'](_0x26d54d);}return null;};}function patchUpdates(_0x1bef4a){return function(_0xc048d0){try{jsonpatch[_0x7145('0x29')](_0xc048d0,_0x1bef4a,!![]);}catch(_0xeea007){return BPromise['reject'](_0xeea007);}return _0xc048d0[_0x7145('0x2a')]();};}function saveUpdates(_0x1fa1e9,_0x330237){return function(_0x3475b9){if(_0x3475b9){return _0x3475b9[_0x7145('0x2b')](_0x1fa1e9)[_0x7145('0x2c')](function(_0x267a3f){return _0x267a3f;});}return null;};}function removeEntity(_0x5f4764,_0xfda72c){return function(_0xd8f675){if(_0xd8f675){return _0xd8f675[_0x7145('0x2d')]()[_0x7145('0x2c')](function(){_0x5f4764[_0x7145('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d485d,_0x40bb69){return function(_0xb55ca8){if(!_0xb55ca8){_0x2d485d[_0x7145('0x1f')](0x194);}return _0xb55ca8;};}function handleError(_0x109362,_0x39cc45){_0x39cc45=_0x39cc45||0x1f4;return function(_0x41915d){logger[_0x7145('0x2e')](_0x41915d[_0x7145('0x2f')]);if(_0x41915d[_0x7145('0x30')]){delete _0x41915d['name'];}_0x109362['status'](_0x39cc45)[_0x7145('0x31')](_0x41915d);};}exports['sendUserNotification']=function(_0x1c8188,_0x4db3c1,_0x37d2be){if(!_0x1c8188['body'][_0x7145('0x32')]('text')&&!_0x1c8188['body']['hasOwnProperty'](_0x7145('0x33'))){throw new db[(_0x7145('0x34'))][(_0x7145('0x35'))](_0x7145('0x36'));}else{if(_0x1c8188[_0x7145('0x37')]['hasOwnProperty'](_0x7145('0x33'))&&!_0x1c8188['body'][_0x7145('0x32')](_0x7145('0x38'))){throw new db[(_0x7145('0x34'))][(_0x7145('0x35'))](_0x7145('0x39'));}if(!_0x1c8188[_0x7145('0x37')][_0x7145('0x32')](_0x7145('0x3a'))){throw new db['Sequelize']['ValidationError']('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x4183cc=JSON[_0x7145('0x3b')](_0x1c8188[_0x7145('0x37')][_0x7145('0x3a')]);}catch(_0x5fc1d2){logger[_0x7145('0x2e')](_0x5fc1d2);throw new db[(_0x7145('0x34'))][(_0x7145('0x35'))](_0x7145('0x3c'));}var _0x52096b=[_0x7145('0x3d'),'faxqueue',_0x7145('0x3e'),_0x7145('0x3f'),'smsqueue',_0x7145('0x40'),'whatsappqueue',_0x7145('0x41'),_0x7145('0x42')];if(_['some'](_0x4183cc,function(_0x3ef9ba){return!_[_0x7145('0x43')](_0x52096b,_0x3ef9ba[_0x7145('0x44')]['toLowerCase']());})){throw new db[(_0x7145('0x34'))][(_0x7145('0x35'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x3e9c30={};_0x3e9c30[_0x7145('0x45')]=_0x1c8188[_0x7145('0x37')][_0x7145('0x32')](_0x7145('0x45'))?_0x1c8188[_0x7145('0x37')][_0x7145('0x45')]:_0x1c8188[_0x7145('0x42')][_0x7145('0x46')];_0x3e9c30['recipientsDescription']=_[_0x7145('0x47')](_0x1c8188['body'][_0x7145('0x48')])?null:_0x1c8188[_0x7145('0x37')][_0x7145('0x48')];_0x3e9c30[_0x7145('0x49')]=_0x1c8188['body'][_0x7145('0x49')]||![];_0x3e9c30['SenderId']=_0x1c8188[_0x7145('0x42')]['id'];return getContent(_0x1c8188[_0x7145('0x37')])[_0x7145('0x2c')](function(_0x2be05c){_0x3e9c30[_0x7145('0x37')]=_0x2be05c;return getRecipients(_0x4183cc);})[_0x7145('0x2c')](function(_0x3d7723){_0x3e9c30[_0x7145('0x4a')]=_[_0x7145('0x4b')](_0x3d7723)[_0x7145('0x4c')](',');return db[_0x7145('0x4d')][_0x7145('0x4e')](function(_0xc8a2ed){return db[_0x7145('0x4f')]['create'](_0x3e9c30,{'raw':!![],'transaction':_0xc8a2ed})[_0x7145('0x2c')](function(_0x40effe){var _0x2d76e9={'sender':_0x3e9c30['senderName'],'description':_0x3e9c30['recipientsDescription'],'content':_0x3e9c30[_0x7145('0x37')],'beep':_0x3e9c30[_0x7145('0x49')]};_0x3d7723[_0x7145('0x50')](function(_0x5642ea){_0x2d76e9[_0x7145('0x51')]=_0x5642ea;socket[_0x7145('0x52')](_0x7145('0x53'),_0x2d76e9);});return _0x40effe;});});})[_0x7145('0x2c')](respondWithResult(_0x4db3c1,0xc9))['catch'](handleError(_0x4db3c1,null));};function getContent(_0x537fe3){return new BPromise(function(_0x1edac7,_0x2a0584){if(_0x537fe3[_0x7145('0x54')]){_0x1edac7(_0x537fe3[_0x7145('0x54')]);return;}return db[_0x7145('0x55')][_0x7145('0x56')]({'attributes':[_0x7145('0x57')],'where':{'id':_0x537fe3['TemplateId']},'raw':!![]})[_0x7145('0x2c')](function(_0x346292){if(!_0x346292)throw new db[(_0x7145('0x34'))][(_0x7145('0x35'))](_0x7145('0x58'));var _0x28629b=Mustache[_0x7145('0x59')](_0x346292[_0x7145('0x57')],_0x537fe3['view']);_0x1edac7(_0x28629b);})[_0x7145('0x5a')](function(_0x5cd806){_0x2a0584(_0x5cd806);});});}function getRecipients(_0x33a534){return new BPromise(function(_0x52f347,_0x49a384){var _0x505ad0=[];var _0x20fc10=[];_0x33a534[_0x7145('0x50')](function(_0x209374){var _0x2487e9=_['startCase'](_0x209374[_0x7145('0x44')][_0x7145('0x5b')]());if(_0x2487e9===_0x7145('0x5c')){_0x505ad0=_[_0x7145('0x5d')](_0x505ad0,_0x209374[_0x7145('0x5e')]);}else{if(_[_0x7145('0x43')](_0x2487e9,_0x7145('0x5f')))_0x2487e9=_0x2487e9[_0x7145('0x60')](_0x7145('0x5f'),_0x7145('0x61'));_0x209374[_0x7145('0x5e')]['forEach'](function(_0x198a3a){_0x20fc10[_0x7145('0x62')](getAgents(_0x2487e9,_0x198a3a));});}});return BPromise['all'](_0x20fc10)['then'](function(_0x2d9ca8){_0x505ad0=_[_0x7145('0x5d')](_0x505ad0,_[_0x7145('0x63')](_0x2d9ca8));_0x52f347(_0x505ad0);})[_0x7145('0x5a')](function(_0x4be07a){_0x49a384(_0x4be07a);});});}function getAgents(_0x485374,_0x5c277f){return new BPromise(function(_0x14afdc,_0x359e19){return db[_0x485374][_0x7145('0x56')]({'where':{'id':_0x5c277f}})[_0x7145('0x2c')](function(_0x26687f){return _0x26687f[_0x7145('0x64')]({'attributes':['id'],'raw':!![]})['then'](function(_0x431779){var _0x5cc437=_[_0x7145('0x65')](_0x431779,'id');_0x14afdc(_0x5cc437);});})[_0x7145('0x5a')](function(_0x5e9b9a){_0x359e19(_0x5e9b9a);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index d4d03a8..4d1b699 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 _0x17e5=['../../mysqldb','UserNotification','setMaxListeners','save','remove','emit','hook','exports'];(function(_0x1ccb2c,_0x3f9aa6){var _0x21155c=function(_0x4cac7c){while(--_0x4cac7c){_0x1ccb2c['push'](_0x1ccb2c['shift']());}};_0x21155c(++_0x3f9aa6);}(_0x17e5,0x1a8));var _0x517e=function(_0x299b94,_0x524564){_0x299b94=_0x299b94-0x0;var _0x507968=_0x17e5[_0x299b94];return _0x507968;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0x517e('0x0'))['db'][_0x517e('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x517e('0x2')](0x0);var events={'afterCreate':_0x517e('0x3'),'afterUpdate':'update','afterDestroy':_0x517e('0x4')};function emitEvent(_0x45ddce){return function(_0x4923be,_0x1d09d5,_0x1ae4a2){UserNotificationEvents[_0x517e('0x5')](_0x45ddce+':'+_0x4923be['id'],_0x4923be);UserNotificationEvents['emit'](_0x45ddce,_0x4923be);_0x1ae4a2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0x517e('0x6')](e,emitEvent(event));}}module[_0x517e('0x7')]=UserNotificationEvents; \ No newline at end of file +var _0xfb39=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','UserNotification','setMaxListeners','save','update'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xfb39,0xe1));var _0x9fb3=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xfb39[_0x6131cd];return _0x47e916;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0x9fb3('0x0'))['db'][_0x9fb3('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x9fb3('0x2')](0x0);var events={'afterCreate':_0x9fb3('0x3'),'afterUpdate':_0x9fb3('0x4'),'afterDestroy':_0x9fb3('0x5')};function emitEvent(_0x34307f){return function(_0x5f404e,_0x584ea5,_0x471a8a){UserNotificationEvents['emit'](_0x34307f+':'+_0x5f404e['id'],_0x5f404e);UserNotificationEvents[_0x9fb3('0x6')](_0x34307f,_0x5f404e);_0x471a8a(null);};}for(var e in events){if(events[_0x9fb3('0x7')](e)){var event=events[e];UserNotification[_0x9fb3('0x8')](e,emitEvent(event));}}module[_0x9fb3('0x9')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 4fbeb20..7a5a312 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 _0xec1b=['userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./userNotification.attributes','exports','define','UserNotification'];(function(_0x1f9e17,_0x127015){var _0x4fda50=function(_0x5c8ad4){while(--_0x5c8ad4){_0x1f9e17['push'](_0x1f9e17['shift']());}};_0x4fda50(++_0x127015);}(_0xec1b,0xe4));var _0xbec1=function(_0x5abb00,_0x342d70){_0x5abb00=_0x5abb00-0x0;var _0xf9b854=_0xec1b[_0x5abb00];return _0xf9b854;};'use strict';var _=require(_0xbec1('0x0'));var util=require(_0xbec1('0x1'));var logger=require(_0xbec1('0x2'))(_0xbec1('0x3'));var moment=require(_0xbec1('0x4'));var BPromise=require('bluebird');var rp=require(_0xbec1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbec1('0x6'));var config=require(_0xbec1('0x7'));var attributes=require(_0xbec1('0x8'));module[_0xbec1('0x9')]=function(_0x492708,_0x2d96b8){return _0x492708[_0xbec1('0xa')](_0xbec1('0xb'),attributes,{'tableName':_0xbec1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbec1('0xd'),'collate':_0xbec1('0xe')});}; \ No newline at end of file +var _0x2540=['path','rimraf','../../config/environment','exports','define','userNotifications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment'];(function(_0x30aa5f,_0x17c38d){var _0x377211=function(_0x277a82){while(--_0x277a82){_0x30aa5f['push'](_0x30aa5f['shift']());}};_0x377211(++_0x17c38d);}(_0x2540,0x110));var _0x0254=function(_0x2a67fe,_0x295c09){_0x2a67fe=_0x2a67fe-0x0;var _0x57e726=_0x2540[_0x2a67fe];return _0x57e726;};'use strict';var _=require('lodash');var util=require(_0x0254('0x0'));var logger=require(_0x0254('0x1'))(_0x0254('0x2'));var moment=require(_0x0254('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0254('0x4'));var rimraf=require(_0x0254('0x5'));var config=require(_0x0254('0x6'));var attributes=require('./userNotification.attributes');module[_0x0254('0x7')]=function(_0x7d4ed7,_0xbaae62){return _0x7d4ed7[_0x0254('0x8')]('UserNotification',attributes,{'tableName':_0x0254('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0254('0xa'),'collate':_0x0254('0xb')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index d15665d..6c5ede9 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 _0x84e8=['socket.io-emitter','register','request','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','redis','defaults'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x84e8,0x12e));var _0x884e=function(_0x2d3910,_0x1893be){_0x2d3910=_0x2d3910-0x0;var _0x50af63=_0x84e8[_0x2d3910];return _0x50af63;};'use strict';var _=require('lodash');var util=require(_0x884e('0x0'));var moment=require('moment');var BPromise=require(_0x884e('0x1'));var rs=require(_0x884e('0x2'));var fs=require('fs');var Redis=require(_0x884e('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x884e('0x4'))(_0x884e('0x5'));var config=require('../../config/environment');var jayson=require(_0x884e('0x6'));var client=jayson[_0x884e('0x7')]['http']({'port':0x232a});config[_0x884e('0x8')]=_[_0x884e('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x884e('0xa'))(new Redis(config['redis']));require('./userNotification.socket')[_0x884e('0xb')](socket);function respondWithRpcPromise(_0x36e6e3,_0x2d668e,_0x334514){return new BPromise(function(_0x17a9d2,_0x4e626e){return client[_0x884e('0xc')](_0x36e6e3,_0x334514)['then'](function(_0x57b2f2){logger[_0x884e('0xd')](_0x884e('0xe'),_0x2d668e,_0x884e('0xf'));logger[_0x884e('0x10')](_0x884e('0x11'),_0x2d668e,_0x884e('0xf'),JSON[_0x884e('0x12')](_0x57b2f2));if(_0x57b2f2[_0x884e('0x13')]){if(_0x57b2f2[_0x884e('0x13')][_0x884e('0x14')]===0x1f4){logger[_0x884e('0x13')](_0x884e('0xe'),_0x2d668e,_0x57b2f2[_0x884e('0x13')][_0x884e('0x15')]);return _0x4e626e(_0x57b2f2['error'][_0x884e('0x15')]);}logger[_0x884e('0x13')](_0x884e('0xe'),_0x2d668e,_0x57b2f2[_0x884e('0x13')][_0x884e('0x15')]);return _0x17a9d2(_0x57b2f2[_0x884e('0x13')][_0x884e('0x15')]);}else{logger[_0x884e('0xd')](_0x884e('0xe'),_0x2d668e,'request\x20sent');_0x17a9d2(_0x57b2f2[_0x884e('0x16')][_0x884e('0x15')]);}})[_0x884e('0x17')](function(_0x49d04f){logger[_0x884e('0x13')](_0x884e('0xe'),_0x2d668e,_0x49d04f);_0x4e626e(_0x49d04f);});});} \ No newline at end of file +var _0xe28d=['code','message','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./userNotification.socket','register','request','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x11dc39,_0x491115){var _0x457277=function(_0x1d77cd){while(--_0x1d77cd){_0x11dc39['push'](_0x11dc39['shift']());}};_0x457277(++_0x491115);}(_0xe28d,0x155));var _0xde28=function(_0x417955,_0x4ed8c8){_0x417955=_0x417955-0x0;var _0x3a94ef=_0xe28d[_0x417955];return _0x3a94ef;};'use strict';var _=require('lodash');var util=require(_0xde28('0x0'));var moment=require(_0xde28('0x1'));var BPromise=require(_0xde28('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xde28('0x3'));var db=require(_0xde28('0x4'))['db'];var utils=require(_0xde28('0x5'));var logger=require(_0xde28('0x6'))(_0xde28('0x7'));var config=require(_0xde28('0x8'));var jayson=require(_0xde28('0x9'));var client=jayson[_0xde28('0xa')][_0xde28('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xde28('0xc')],{'host':_0xde28('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xde28('0xc')]));require(_0xde28('0xe'))[_0xde28('0xf')](socket);function respondWithRpcPromise(_0x1a1b48,_0x336dd7,_0x483a3d){return new BPromise(function(_0x5b4956,_0x35d5da){return client[_0xde28('0x10')](_0x1a1b48,_0x483a3d)['then'](function(_0x2722c7){logger[_0xde28('0x11')](_0xde28('0x12'),_0x336dd7,_0xde28('0x13'));logger[_0xde28('0x14')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x336dd7,_0xde28('0x13'),JSON[_0xde28('0x15')](_0x2722c7));if(_0x2722c7[_0xde28('0x16')]){if(_0x2722c7['error'][_0xde28('0x17')]===0x1f4){logger[_0xde28('0x16')](_0xde28('0x12'),_0x336dd7,_0x2722c7[_0xde28('0x16')][_0xde28('0x18')]);return _0x35d5da(_0x2722c7[_0xde28('0x16')][_0xde28('0x18')]);}logger[_0xde28('0x16')](_0xde28('0x12'),_0x336dd7,_0x2722c7[_0xde28('0x16')][_0xde28('0x18')]);return _0x5b4956(_0x2722c7[_0xde28('0x16')][_0xde28('0x18')]);}else{logger[_0xde28('0x11')](_0xde28('0x12'),_0x336dd7,_0xde28('0x13'));_0x5b4956(_0x2722c7['result'][_0xde28('0x18')]);}})[_0xde28('0x19')](function(_0x2576e3){logger['error']('UserNotification,\x20%s,\x20%s',_0x336dd7,_0x2576e3);_0x35d5da(_0x2576e3);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 4ac3ff2..d69e666 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 _0x6e19=['remove','emit','removeListener','register','length','userNotification:','./userNotification.events'];(function(_0xbe7cd0,_0xe54007){var _0x46ef3e=function(_0x4ff0cf){while(--_0x4ff0cf){_0xbe7cd0['push'](_0xbe7cd0['shift']());}};_0x46ef3e(++_0xe54007);}(_0x6e19,0x13a));var _0x96e1=function(_0x24bb72,_0x121fe9){_0x24bb72=_0x24bb72-0x0;var _0x462e48=_0x6e19[_0x24bb72];return _0x462e48;};'use strict';var UserNotificationEvents=require(_0x96e1('0x0'));var events=['save',_0x96e1('0x1'),'update'];function createListener(_0x1b0585,_0x4aa740){return function(_0x2c4b68){_0x4aa740[_0x96e1('0x2')](_0x1b0585,_0x2c4b68);};}function removeListener(_0x3af5ca,_0x5659cd){return function(){UserNotificationEvents[_0x96e1('0x3')](_0x3af5ca,_0x5659cd);};}exports[_0x96e1('0x4')]=function(_0x299b5a){for(var _0x31d8f7=0x0,_0x54e9c6=events[_0x96e1('0x5')];_0x31d8f7<_0x54e9c6;_0x31d8f7++){var _0x1f94e1=events[_0x31d8f7];var _0x5152de=createListener(_0x96e1('0x6')+_0x1f94e1,_0x299b5a);UserNotificationEvents['on'](_0x1f94e1,_0x5152de);}}; \ No newline at end of file +var _0x6e04=['update','emit','removeListener','register','length','userNotification:','./userNotification.events','save'];(function(_0x4b584c,_0xa6d83a){var _0xb94eb3=function(_0x3b8837){while(--_0x3b8837){_0x4b584c['push'](_0x4b584c['shift']());}};_0xb94eb3(++_0xa6d83a);}(_0x6e04,0x136));var _0x46e0=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0x6e04[_0x342700];return _0x53406f;};'use strict';var UserNotificationEvents=require(_0x46e0('0x0'));var events=[_0x46e0('0x1'),'remove',_0x46e0('0x2')];function createListener(_0x4dff8a,_0x104544){return function(_0x364ca8){_0x104544[_0x46e0('0x3')](_0x4dff8a,_0x364ca8);};}function removeListener(_0x250fb4,_0x1b90ae){return function(){UserNotificationEvents[_0x46e0('0x4')](_0x250fb4,_0x1b90ae);};}exports[_0x46e0('0x5')]=function(_0x730a53){for(var _0x218020=0x0,_0x1de96a=events[_0x46e0('0x6')];_0x218020<_0x1de96a;_0x218020++){var _0x59b762=events[_0x218020];var _0x17795a=createListener(_0x46e0('0x7')+_0x59b762,_0x730a53);UserNotificationEvents['on'](_0x59b762,_0x17795a);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index bb22766..2c35eef 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x5f28e6,_0x166c61){var _0x48b540=function(_0x1a6105){while(--_0x1a6105){_0x5f28e6['push'](_0x5f28e6['shift']());}};_0x48b540(++_0x166c61);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x54d52,_0x2473ba){_0x54d52=_0x54d52-0x0;var _0x968345=_0xcb91[_0x54d52];return _0x968345;};'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(_0x1ba4f3,_0x2b9446){var _0x5b2afc=function(_0x36110d){while(--_0x36110d){_0x1ba4f3['push'](_0x1ba4f3['shift']());}};_0x5b2afc(++_0x2b9446);}(_0x70e0,0x17b));var _0x070e=function(_0x32c2f7,_0x480469){_0x32c2f7=_0x32c2f7-0x0;var _0x4052e5=_0x70e0[_0x32c2f7];return _0x4052e5;};'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 686720e..8942b85 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 _0xc22d=['INTEGER','exports'];(function(_0x687372,_0x38814a){var _0x5ef088=function(_0xd27711){while(--_0xd27711){_0x687372['push'](_0x687372['shift']());}};_0x5ef088(++_0x38814a);}(_0xc22d,0x151));var _0xdc22=function(_0x141932,_0x537fec){_0x141932=_0x141932-0x0;var _0x43d494=_0xc22d[_0x141932];return _0x43d494;};'use strict';var Sequelize=require('sequelize');module[_0xdc22('0x0')]={'penalty':{'type':Sequelize[_0xdc22('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe5af=['INTEGER','sequelize','exports'];(function(_0x3c76ce,_0x59b0f6){var _0x47fb17=function(_0x23a1d1){while(--_0x23a1d1){_0x3c76ce['push'](_0x3c76ce['shift']());}};_0x47fb17(++_0x59b0f6);}(_0xe5af,0x136));var _0xfe5a=function(_0x2d47ed,_0x260bb5){_0x2d47ed=_0x2d47ed-0x0;var _0x1f53f5=_0xe5af[_0x2d47ed];return _0x1f53f5;};'use strict';var Sequelize=require(_0xfe5a('0x0'));module[_0xfe5a('0x1')]={'penalty':{'type':Sequelize[_0xfe5a('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 f0d1021..f25eeed 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 _0x3ad5=['./userOpenchannelQueue.attributes','exports','UserOpenchannelQueue','util','moment','request-promise','path','../../config/environment'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x3ad5,0x9b));var _0x53ad=function(_0x5d8c19,_0x55089c){_0x5d8c19=_0x5d8c19-0x0;var _0x486ffd=_0x3ad5[_0x5d8c19];return _0x486ffd;};'use strict';var _=require('lodash');var util=require(_0x53ad('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x53ad('0x1'));var BPromise=require('bluebird');var rp=require(_0x53ad('0x2'));var fs=require('fs');var path=require(_0x53ad('0x3'));var rimraf=require('rimraf');var config=require(_0x53ad('0x4'));var attributes=require(_0x53ad('0x5'));module[_0x53ad('0x6')]=function(_0x17f244,_0x2ffac4){return _0x17f244['define'](_0x53ad('0x7'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2a76=['./userOpenchannelQueue.attributes','define','UserOpenchannelQueue','user_has_openchannel_queues','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3868c4,_0x1b3ccc){var _0x56cfd2=function(_0xadabc0){while(--_0xadabc0){_0x3868c4['push'](_0x3868c4['shift']());}};_0x56cfd2(++_0x1b3ccc);}(_0x2a76,0x1bc));var _0x62a7=function(_0x4cf4e0,_0x25e3cc){_0x4cf4e0=_0x4cf4e0-0x0;var _0x557b41=_0x2a76[_0x4cf4e0];return _0x557b41;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x62a7('0x0'));var moment=require(_0x62a7('0x1'));var BPromise=require(_0x62a7('0x2'));var rp=require(_0x62a7('0x3'));var fs=require('fs');var path=require(_0x62a7('0x4'));var rimraf=require(_0x62a7('0x5'));var config=require(_0x62a7('0x6'));var attributes=require(_0x62a7('0x7'));module['exports']=function(_0xf474a5,_0x59c121){return _0xf474a5[_0x62a7('0x8')](_0x62a7('0x9'),attributes,{'tableName':_0x62a7('0xa'),'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 f53bc2b..48f18cd 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 _0x850f=['rpc','../../config/environment','jayson/promise','then','info','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','UserOpenchannelQueue,\x20%s,\x20%s','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0x49020b,_0x22b7f9){var _0x3a2d41=function(_0x158979){while(--_0x158979){_0x49020b['push'](_0x49020b['shift']());}};_0x3a2d41(++_0x22b7f9);}(_0x850f,0x1af));var _0xf850=function(_0x4b363a,_0x1a2eb5){_0x4b363a=_0x4b363a-0x0;var _0x2afa1e=_0x850f[_0x4b363a];return _0x2afa1e;};'use strict';var _=require('lodash');var util=require(_0xf850('0x0'));var moment=require(_0xf850('0x1'));var BPromise=require(_0xf850('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf850('0x3'));var db=require(_0xf850('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf850('0x5'))(_0xf850('0x6'));var config=require(_0xf850('0x7'));var jayson=require(_0xf850('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x505827,_0x12e5fa,_0x4c2b04){return new BPromise(function(_0x5cf436,_0xb36f47){return client['request'](_0x505827,_0x4c2b04)[_0xf850('0x9')](function(_0x5a4553){logger[_0xf850('0xa')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x12e5fa,'request\x20sent');logger[_0xf850('0xb')](_0xf850('0xc'),_0x12e5fa,'request\x20sent',JSON[_0xf850('0xd')](_0x5a4553));if(_0x5a4553[_0xf850('0xe')]){if(_0x5a4553[_0xf850('0xe')]['code']===0x1f4){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x12e5fa,_0x5a4553[_0xf850('0xe')][_0xf850('0xf')]);return _0xb36f47(_0x5a4553[_0xf850('0xe')]['message']);}logger[_0xf850('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x12e5fa,_0x5a4553[_0xf850('0xe')]['message']);return _0x5cf436(_0x5a4553[_0xf850('0xe')][_0xf850('0xf')]);}else{logger[_0xf850('0xa')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x12e5fa,_0xf850('0x10'));_0x5cf436(_0x5a4553[_0xf850('0x11')][_0xf850('0xf')]);}})['catch'](function(_0xf52c79){logger['error'](_0xf850('0x12'),_0x12e5fa,_0xf52c79);_0xb36f47(_0xf52c79);});});} \ No newline at end of file +var _0xb58b=['message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x41ef4b,_0x5b0985){var _0x3d3cfe=function(_0xcbfe28){while(--_0xcbfe28){_0x41ef4b['push'](_0x41ef4b['shift']());}};_0x3d3cfe(++_0x5b0985);}(_0xb58b,0x142));var _0xbb58=function(_0x10c535,_0x392043){_0x10c535=_0x10c535-0x0;var _0x51eb08=_0xb58b[_0x10c535];return _0x51eb08;};'use strict';var _=require('lodash');var util=require(_0xbb58('0x0'));var moment=require(_0xbb58('0x1'));var BPromise=require(_0xbb58('0x2'));var rs=require(_0xbb58('0x3'));var fs=require('fs');var Redis=require(_0xbb58('0x4'));var db=require(_0xbb58('0x5'))['db'];var utils=require(_0xbb58('0x6'));var logger=require(_0xbb58('0x7'))('rpc');var config=require(_0xbb58('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbb58('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x21e00b,_0x1b1dce,_0x246eb7){return new BPromise(function(_0x563b0f,_0x29f463){return client[_0xbb58('0xa')](_0x21e00b,_0x246eb7)['then'](function(_0x3d1edf){logger['info'](_0xbb58('0xb'),_0x1b1dce,'request\x20sent');logger[_0xbb58('0xc')](_0xbb58('0xd'),_0x1b1dce,_0xbb58('0xe'),JSON[_0xbb58('0xf')](_0x3d1edf));if(_0x3d1edf[_0xbb58('0x10')]){if(_0x3d1edf['error'][_0xbb58('0x11')]===0x1f4){logger[_0xbb58('0x10')](_0xbb58('0xb'),_0x1b1dce,_0x3d1edf[_0xbb58('0x10')]['message']);return _0x29f463(_0x3d1edf[_0xbb58('0x10')]['message']);}logger[_0xbb58('0x10')](_0xbb58('0xb'),_0x1b1dce,_0x3d1edf['error'][_0xbb58('0x12')]);return _0x563b0f(_0x3d1edf[_0xbb58('0x10')][_0xbb58('0x12')]);}else{logger['info']('UserOpenchannelQueue,\x20%s,\x20%s',_0x1b1dce,_0xbb58('0xe'));_0x563b0f(_0x3d1edf['result'][_0xbb58('0x12')]);}})[_0xbb58('0x13')](function(_0x191de6){logger[_0xbb58('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x1b1dce,_0x191de6);_0x29f463(_0x191de6);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 26e4094..567dd52 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 _0xa5ef=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/sections','/:id/resources','getResources','post','/:id/clone','clone','addSections','put','update','delete','destroy','removeSections','exports'];(function(_0x5a5395,_0x5361f6){var _0x4da43d=function(_0x149941){while(--_0x149941){_0x5a5395['push'](_0x5a5395['shift']());}};_0x4da43d(++_0x5361f6);}(_0xa5ef,0x1dc));var _0xfa5e=function(_0x12d5e9,_0x1decd6){_0x12d5e9=_0x12d5e9-0x0;var _0x343939=_0xa5ef[_0x12d5e9];return _0x343939;};'use strict';var multer=require(_0xfa5e('0x0'));var util=require('util');var path=require(_0xfa5e('0x1'));var timeout=require(_0xfa5e('0x2'));var express=require(_0xfa5e('0x3'));var router=express[_0xfa5e('0x4')]();var fs_extra=require(_0xfa5e('0x5'));var auth=require(_0xfa5e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xfa5e('0x7'));var controller=require(_0xfa5e('0x8'));router[_0xfa5e('0x9')]('/',auth[_0xfa5e('0xa')](),controller[_0xfa5e('0xb')]);router[_0xfa5e('0x9')](_0xfa5e('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xfa5e('0x9')](_0xfa5e('0xd'),auth['isAuthenticated'](),controller[_0xfa5e('0xe')]);router[_0xfa5e('0x9')](_0xfa5e('0xf'),auth[_0xfa5e('0xa')](),controller['getSections']);router['get'](_0xfa5e('0x10'),auth[_0xfa5e('0xa')](),controller[_0xfa5e('0x11')]);router[_0xfa5e('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0xfa5e('0x12')](_0xfa5e('0x13'),auth[_0xfa5e('0xa')](),controller[_0xfa5e('0x14')]);router[_0xfa5e('0x12')]('/:id/sections',auth[_0xfa5e('0xa')](),controller[_0xfa5e('0x15')]);router[_0xfa5e('0x12')](_0xfa5e('0x10'),auth[_0xfa5e('0xa')](),controller['addResources']);router[_0xfa5e('0x16')](_0xfa5e('0xd'),auth[_0xfa5e('0xa')](),controller[_0xfa5e('0x17')]);router[_0xfa5e('0x18')]('/:id',auth[_0xfa5e('0xa')](),controller[_0xfa5e('0x19')]);router[_0xfa5e('0x18')]('/:id/sections',auth[_0xfa5e('0xa')](),controller[_0xfa5e('0x1a')]);router[_0xfa5e('0x18')](_0xfa5e('0x10'),auth[_0xfa5e('0xa')](),controller['removeResources']);module[_0xfa5e('0x1b')]=router; \ No newline at end of file +var _0xebed=['/:id/sections','getSections','getResources','post','create','addResources','delete','destroy','/:id/resources','removeResources','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','/describe','isAuthenticated','describe','get','/:id','show'];(function(_0x4416a4,_0x562fd6){var _0xadbdae=function(_0x190f3b){while(--_0x190f3b){_0x4416a4['push'](_0x4416a4['shift']());}};_0xadbdae(++_0x562fd6);}(_0xebed,0x10f));var _0xdebe=function(_0x6dd5c,_0x4bfc19){_0x6dd5c=_0x6dd5c-0x0;var _0x5a87fa=_0xebed[_0x6dd5c];return _0x5a87fa;};'use strict';var multer=require(_0xdebe('0x0'));var util=require('util');var path=require(_0xdebe('0x1'));var timeout=require(_0xdebe('0x2'));var express=require(_0xdebe('0x3'));var router=express[_0xdebe('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xdebe('0x5'));var interaction=require(_0xdebe('0x6'));var config=require(_0xdebe('0x7'));var controller=require(_0xdebe('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xdebe('0x9'),auth[_0xdebe('0xa')](),controller[_0xdebe('0xb')]);router[_0xdebe('0xc')](_0xdebe('0xd'),auth[_0xdebe('0xa')](),controller[_0xdebe('0xe')]);router['get'](_0xdebe('0xf'),auth[_0xdebe('0xa')](),controller[_0xdebe('0x10')]);router[_0xdebe('0xc')]('/:id/resources',auth[_0xdebe('0xa')](),controller[_0xdebe('0x11')]);router[_0xdebe('0x12')]('/',auth['isAuthenticated'](),controller[_0xdebe('0x13')]);router[_0xdebe('0x12')]('/:id/clone',auth[_0xdebe('0xa')](),controller['clone']);router[_0xdebe('0x12')](_0xdebe('0xf'),auth[_0xdebe('0xa')](),controller['addSections']);router[_0xdebe('0x12')]('/:id/resources',auth[_0xdebe('0xa')](),controller[_0xdebe('0x14')]);router['put'](_0xdebe('0xd'),auth[_0xdebe('0xa')](),controller['update']);router[_0xdebe('0x15')](_0xdebe('0xd'),auth[_0xdebe('0xa')](),controller[_0xdebe('0x16')]);router[_0xdebe('0x15')]('/:id/sections',auth[_0xdebe('0xa')](),controller['removeSections']);router[_0xdebe('0x15')](_0xdebe('0x17'),auth['isAuthenticated'](),controller[_0xdebe('0x18')]);module[_0xdebe('0x19')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index a8a04b8..bbc1e21 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 _0x718d=['split','BOOLEAN','sequelize','STRING','name','setDataValue','crudPermissions','join','getDataValue'];(function(_0x4847fd,_0x3694a7){var _0x495358=function(_0x180f9a){while(--_0x180f9a){_0x4847fd['push'](_0x4847fd['shift']());}};_0x495358(++_0x3694a7);}(_0x718d,0x107));var _0xd718=function(_0x212d6d,_0x30a647){_0x212d6d=_0x212d6d-0x0;var _0x46b2d1=_0x718d[_0x212d6d];return _0x46b2d1;};'use strict';var Sequelize=require(_0xd718('0x0'));module['exports']={'name':{'type':Sequelize[_0xd718('0x1')],'allowNull':![],'unique':_0xd718('0x2')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x128a07){this[_0xd718('0x3')](_0xd718('0x4'),_0x128a07?_0x128a07[_0xd718('0x5')](''):[]);},'get':function(){return this[_0xd718('0x6')](_0xd718('0x4'))?this[_0xd718('0x6')](_0xd718('0x4'))[_0xd718('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xd718('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xd718('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xd718('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xd718('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xd718('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xd718('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xd718('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xd718('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xd718('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0xce4e=['crudPermissions','getDataValue','BOOLEAN','sequelize','STRING','name','join'];(function(_0x540aa8,_0x2e5451){var _0x9b4c8a=function(_0x34647e){while(--_0x34647e){_0x540aa8['push'](_0x540aa8['shift']());}};_0x9b4c8a(++_0x2e5451);}(_0xce4e,0x65));var _0xece4=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xce4e[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0xece4('0x0'));module['exports']={'name':{'type':Sequelize[_0xece4('0x1')],'allowNull':![],'unique':_0xece4('0x2')},'crudPermissions':{'type':Sequelize[_0xece4('0x1')],'set':function(_0x31f86e){this['setDataValue']('crudPermissions',_0x31f86e?_0x31f86e[_0xece4('0x3')](''):[]);},'get':function(){return this['getDataValue'](_0xece4('0x4'))?this[_0xece4('0x5')](_0xece4('0x4'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xece4('0x6')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xece4('0x6')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xece4('0x6')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xece4('0x6')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xece4('0x6')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xece4('0x6')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 3529af8..9d3a9f9 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 _0x86dc=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','json','limit','undefined','offset','set','Content-Range','apply','reject','save','update','then','end','error','stack','send','index','map','UserProfile','rawAttributes','fieldName','key','name','query','keys','filters','intersection','model','attributes','length','nolimit','order','where','pick','filter','merge','type','options','count','findAll','catch','show','params','fields','create','body','clone','includeAll','include','get','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','sectionId','userProfileId','Resources','UserProfileResource','find','destroy','describe','UserProfileSection','push','removeSections','ids','enabled','includes','isEmpty','subsections','autoAssociation','findOne','forEach','resourceId','bulkCreate','removeResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','eml-format','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','ioredis','../../components/auth/service'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x86dc,0x13e));var _0xc86d=function(_0x538d29,_0x23d646){_0x538d29=_0x538d29-0x0;var _0x227dd4=_0x86dc[_0x538d29];return _0x227dd4;};'use strict';var emlformat=require(_0xc86d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc86d('0x1'));var rp=require(_0xc86d('0x2'));var moment=require(_0xc86d('0x3'));var BPromise=require(_0xc86d('0x4'));var Mustache=require('mustache');var util=require(_0xc86d('0x5'));var path=require('path');var sox=require(_0xc86d('0x6'));var csv=require('to-csv');var ejs=require(_0xc86d('0x7'));var fs=require('fs');var fs_extra=require(_0xc86d('0x8'));var _=require(_0xc86d('0x9'));var squel=require('squel');var crypto=require(_0xc86d('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xc86d('0xb'));var toCsv=require(_0xc86d('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc86d('0xd'));var authService=require(_0xc86d('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xc86d('0xf'));var hardwareService=require(_0xc86d('0x10'));var logger=require(_0xc86d('0x11'))(_0xc86d('0x12'));var utils=require(_0xc86d('0x13'));var config=require(_0xc86d('0x14'));var licenseUtil=require(_0xc86d('0x15'));var db=require(_0xc86d('0x16'))['db'];config[_0xc86d('0x17')]=_[_0xc86d('0x18')](config[_0xc86d('0x17')],{'host':_0xc86d('0x19'),'port':0x18eb});var socket=require(_0xc86d('0x1a'))(new Redis(config[_0xc86d('0x17')]));require(_0xc86d('0x1b'))[_0xc86d('0x1c')](socket);function respondWithStatusCode(_0x176ce1,_0x313c16){_0x313c16=_0x313c16||0xcc;return function(_0x2bc469){if(_0x2bc469){return _0x176ce1[_0xc86d('0x1d')](_0x313c16);}return _0x176ce1[_0xc86d('0x1e')](_0x313c16)['end']();};}function respondWithResult(_0x4fb8e7,_0x49af1f){_0x49af1f=_0x49af1f||0xc8;return function(_0x3a253c){if(_0x3a253c){return _0x4fb8e7[_0xc86d('0x1e')](_0x49af1f)[_0xc86d('0x1f')](_0x3a253c);}};}function respondWithFilteredResult(_0x2a9459,_0x3a95c2){return function(_0x3d7e72){if(_0x3d7e72){var _0x279406=typeof _0x3a95c2['offset']==='undefined'&&typeof _0x3a95c2[_0xc86d('0x20')]===_0xc86d('0x21');var _0x445863=_0x3d7e72['count'];var _0x36c81d=_0x279406?0x0:_0x3a95c2[_0xc86d('0x22')];var _0x4f1efc=_0x279406?_0x3d7e72['count']:_0x3a95c2[_0xc86d('0x22')]+_0x3a95c2[_0xc86d('0x20')];var _0x548f59;if(_0x4f1efc>=_0x445863){_0x4f1efc=_0x445863;_0x548f59=0xc8;}else{_0x548f59=0xce;}_0x2a9459[_0xc86d('0x1e')](_0x548f59);return _0x2a9459[_0xc86d('0x23')](_0xc86d('0x24'),_0x36c81d+'-'+_0x4f1efc+'/'+_0x445863)[_0xc86d('0x1f')](_0x3d7e72);}return null;};}function patchUpdates(_0x57d804){return function(_0x2a0308){try{jsonpatch[_0xc86d('0x25')](_0x2a0308,_0x57d804,!![]);}catch(_0xad7be1){return BPromise[_0xc86d('0x26')](_0xad7be1);}return _0x2a0308[_0xc86d('0x27')]();};}function saveUpdates(_0x56278d,_0x38fb11){return function(_0x419afa){if(_0x419afa){return _0x419afa[_0xc86d('0x28')](_0x56278d)[_0xc86d('0x29')](function(_0x27d636){return _0x27d636;});}return null;};}function removeEntity(_0x5347f7,_0x1458fe){return function(_0x54303e){if(_0x54303e){return _0x54303e['destroy']()['then'](function(){_0x5347f7[_0xc86d('0x1e')](0xcc)[_0xc86d('0x2a')]();});}};}function handleEntityNotFound(_0x273c5a,_0x1e29be){return function(_0xd8b255){if(!_0xd8b255){_0x273c5a[_0xc86d('0x1d')](0x194);}return _0xd8b255;};}function handleError(_0x2fabc0,_0x2a35b3){_0x2a35b3=_0x2a35b3||0x1f4;return function(_0x4db581){logger[_0xc86d('0x2b')](_0x4db581[_0xc86d('0x2c')]);if(_0x4db581['name']){delete _0x4db581['name'];}_0x2fabc0[_0xc86d('0x1e')](_0x2a35b3)[_0xc86d('0x2d')](_0x4db581);};}exports[_0xc86d('0x2e')]=function(_0x271b23,_0x384bc9){var _0x217415={},_0x27e478={},_0x5a4ef1={'count':0x0,'rows':[]};var _0x5bda1c=_[_0xc86d('0x2f')](db[_0xc86d('0x30')][_0xc86d('0x31')],function(_0x219673){return{'name':_0x219673[_0xc86d('0x32')],'type':_0x219673['type'][_0xc86d('0x33')]};});_0x27e478['model']=_[_0xc86d('0x2f')](_0x5bda1c,_0xc86d('0x34'));_0x27e478[_0xc86d('0x35')]=_[_0xc86d('0x36')](_0x271b23[_0xc86d('0x35')]);_0x27e478[_0xc86d('0x37')]=_[_0xc86d('0x38')](_0x27e478[_0xc86d('0x39')],_0x27e478[_0xc86d('0x35')]);_0x217415['attributes']=_['intersection'](_0x27e478['model'],qs['fields'](_0x271b23['query']['fields']));_0x217415[_0xc86d('0x3a')]=_0x217415[_0xc86d('0x3a')][_0xc86d('0x3b')]?_0x217415[_0xc86d('0x3a')]:_0x27e478[_0xc86d('0x39')];if(!_0x271b23[_0xc86d('0x35')]['hasOwnProperty'](_0xc86d('0x3c'))){_0x217415[_0xc86d('0x20')]=qs[_0xc86d('0x20')](_0x271b23[_0xc86d('0x35')][_0xc86d('0x20')]);_0x217415[_0xc86d('0x22')]=qs[_0xc86d('0x22')](_0x271b23[_0xc86d('0x35')][_0xc86d('0x22')]);}_0x217415[_0xc86d('0x3d')]=qs['sort'](_0x271b23[_0xc86d('0x35')]['sort']);_0x217415[_0xc86d('0x3e')]=qs[_0xc86d('0x37')](_[_0xc86d('0x3f')](_0x271b23['query'],_0x27e478[_0xc86d('0x37')]),_0x5bda1c);if(_0x271b23[_0xc86d('0x35')][_0xc86d('0x40')]){_0x217415['where']=_[_0xc86d('0x41')](_0x217415[_0xc86d('0x3e')],{'$or':_[_0xc86d('0x2f')](_0x5bda1c,function(_0x3de4f3){if(_0x3de4f3[_0xc86d('0x42')]!=='VIRTUAL'){var _0x25e94e={};_0x25e94e[_0x3de4f3[_0xc86d('0x34')]]={'$like':'%'+_0x271b23[_0xc86d('0x35')][_0xc86d('0x40')]+'%'};return _0x25e94e;}})});}_0x217415=_[_0xc86d('0x41')]({},_0x217415,_0x271b23[_0xc86d('0x43')]);var _0x562fec={'where':_0x217415[_0xc86d('0x3e')]};return db['UserProfile'][_0xc86d('0x44')](_0x562fec)[_0xc86d('0x29')](function(_0x39bdc7){_0x5a4ef1[_0xc86d('0x44')]=_0x39bdc7;if(_0x271b23['query']['includeAll']){_0x217415['include']=[{'all':!![]}];}return db[_0xc86d('0x30')][_0xc86d('0x45')](_0x217415);})[_0xc86d('0x29')](function(_0x2c3f3d){_0x5a4ef1['rows']=_0x2c3f3d;return _0x5a4ef1;})[_0xc86d('0x29')](respondWithFilteredResult(_0x384bc9,_0x217415))[_0xc86d('0x46')](handleError(_0x384bc9,null));};exports[_0xc86d('0x47')]=function(_0x2562a2,_0x1a6494){var _0x5395bd={'raw':![],'where':{'id':_0x2562a2[_0xc86d('0x48')]['id']}},_0x36c0af={};_0x36c0af[_0xc86d('0x39')]=_[_0xc86d('0x36')](db['UserProfile'][_0xc86d('0x31')]);_0x36c0af['query']=_['keys'](_0x2562a2[_0xc86d('0x35')]);_0x36c0af['filters']=_[_0xc86d('0x38')](_0x36c0af[_0xc86d('0x39')],_0x36c0af[_0xc86d('0x35')]);_0x5395bd[_0xc86d('0x3a')]=_['intersection'](_0x36c0af[_0xc86d('0x39')],qs[_0xc86d('0x49')](_0x2562a2[_0xc86d('0x35')]['fields']));_0x5395bd['attributes']=_0x5395bd[_0xc86d('0x3a')]['length']?_0x5395bd[_0xc86d('0x3a')]:_0x36c0af[_0xc86d('0x39')];if(_0x2562a2[_0xc86d('0x35')]['includeAll']){_0x5395bd['include']=[{'all':!![]}];}_0x5395bd=_[_0xc86d('0x41')]({},_0x5395bd,_0x2562a2[_0xc86d('0x43')]);return db[_0xc86d('0x30')]['find'](_0x5395bd)[_0xc86d('0x29')](handleEntityNotFound(_0x1a6494,null))['then'](respondWithResult(_0x1a6494,null))[_0xc86d('0x46')](handleError(_0x1a6494,null));};exports[_0xc86d('0x4a')]=function(_0x57231e,_0x485e8b){return db[_0xc86d('0x30')]['create'](_0x57231e[_0xc86d('0x4b')],{})['then'](respondWithResult(_0x485e8b,0xc9))[_0xc86d('0x46')](handleError(_0x485e8b,null));};exports[_0xc86d('0x4c')]=function(_0x47474a,_0x52c6e0){var _0x505aaf={'where':{'id':_0x47474a[_0xc86d('0x48')]['id']}},_0x29dbbe={};_0x29dbbe[_0xc86d('0x39')]=_[_0xc86d('0x36')](db['UserProfile'][_0xc86d('0x31')]);_0x505aaf[_0xc86d('0x3a')]=_[_0xc86d('0x38')](_0x29dbbe[_0xc86d('0x39')],qs[_0xc86d('0x49')](_0x47474a[_0xc86d('0x35')]['fields']));_0x505aaf[_0xc86d('0x3a')]=_0x505aaf[_0xc86d('0x3a')][_0xc86d('0x3b')]?_0x505aaf[_0xc86d('0x3a')]:_0x29dbbe[_0xc86d('0x39')];if(_0x47474a[_0xc86d('0x35')][_0xc86d('0x4d')]){_0x505aaf[_0xc86d('0x4e')]=[{'all':!![]}];}_0x505aaf=_['merge']({},_0x505aaf,_0x47474a['options']);return db[_0xc86d('0x30')]['find'](_0x505aaf)[_0xc86d('0x29')](handleEntityNotFound(_0x52c6e0,null))[_0xc86d('0x29')](function(_0x52da8c){if(_0x52da8c){var _0x3c24ae=_0x52da8c[_0xc86d('0x4f')]({'plain':!![]});_0x3c24ae=qs[_0xc86d('0x50')](_0x3c24ae,['id',_0xc86d('0x51'),_0xc86d('0x52'),_0xc86d('0x53')]);_0x47474a[_0xc86d('0x4b')]=_[_0xc86d('0x50')](_0x47474a['body'],['id',_0xc86d('0x51'),_0xc86d('0x52')]);return db[_0xc86d('0x54')][_0xc86d('0x55')](function(_0x4da22d){return db[_0xc86d('0x30')]['create'](_[_0xc86d('0x41')](_0x3c24ae,_0x47474a[_0xc86d('0x4b')]),{'include':_0x47474a[_0xc86d('0x35')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x4da22d})[_0xc86d('0x29')](function(_0x12a877){var _0x909d61=_0x12a877[_0xc86d('0x4f')]({'plain':!![]});return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x47474a[_0xc86d('0x48')]['id']},'raw':!![]})['then'](function(_0xbe263a){if(_0xbe263a){return BPromise['each'](_0xbe263a,function(_0x41b5ce){return new BPromise(function(_0x80e0ca,_0xfadb15){if(_0x41b5ce['autoAssociation']===null||_0x41b5ce['autoAssociation']===0x1)_0x80e0ca(null);return db['UserProfileResource'][_0xc86d('0x45')]({'where':{'sectionId':_0x41b5ce['id']},'raw':!![]})[_0xc86d('0x29')](function(_0x234af8){var _0xa28234=_[_0xc86d('0x2f')](_0x234af8,function(_0x3ed64b){return qs['omit'](_0x3ed64b,['id','createdAt',_0xc86d('0x52'),_0xc86d('0x56')]);});_0x80e0ca(_0xa28234);})[_0xc86d('0x46')](function(_0x3bb71c){_0xfadb15(_0x3bb71c);});})[_0xc86d('0x29')](function(_0x465aac){var _0x4237fa=qs[_0xc86d('0x50')](_0x41b5ce,['id',_0xc86d('0x51'),'updatedAt']);_0x4237fa[_0xc86d('0x57')]=_0x909d61['id'];if(_0x465aac)_0x4237fa[_0xc86d('0x58')]=_0x465aac;return _0x4237fa;})['then'](function(_0x547981){return db['UserProfileSection'][_0xc86d('0x4a')](_0x547981,{'include':[{'model':db[_0xc86d('0x59')],'as':_0xc86d('0x58')}],'raw':!![],'transaction':_0x4da22d});});})[_0xc86d('0x29')](function(){return _0x909d61;});}});});});}})[_0xc86d('0x29')](respondWithResult(_0x52c6e0,0xc9))[_0xc86d('0x46')](handleError(_0x52c6e0,null));};exports[_0xc86d('0x28')]=function(_0xf99be1,_0x4a12fe){if(_0xf99be1[_0xc86d('0x4b')]['id']){delete _0xf99be1['body']['id'];}return db[_0xc86d('0x30')][_0xc86d('0x5a')]({'where':{'id':_0xf99be1[_0xc86d('0x48')]['id']}})[_0xc86d('0x29')](handleEntityNotFound(_0x4a12fe,null))[_0xc86d('0x29')](saveUpdates(_0xf99be1[_0xc86d('0x4b')],null))[_0xc86d('0x29')](respondWithResult(_0x4a12fe,null))[_0xc86d('0x46')](handleError(_0x4a12fe,null));};exports[_0xc86d('0x5b')]=function(_0x2a11c0,_0x32df56){return db[_0xc86d('0x30')]['find']({'where':{'id':_0x2a11c0[_0xc86d('0x48')]['id']}})[_0xc86d('0x29')](handleEntityNotFound(_0x32df56,null))[_0xc86d('0x29')](removeEntity(_0x32df56,null))[_0xc86d('0x46')](handleError(_0x32df56,null));};exports[_0xc86d('0x5c')]=function(_0x34741d,_0x4cacd3){return db['UserProfile'][_0xc86d('0x5c')]()[_0xc86d('0x29')](respondWithResult(_0x4cacd3,null))[_0xc86d('0x46')](handleError(_0x4cacd3,null));};exports['addSections']=function(_0x4334e3,_0x2172c3){var _0x542d27=_0x4334e3['body'];return db[_0xc86d('0x30')][_0xc86d('0x5a')]({'where':{'id':_0x4334e3[_0xc86d('0x48')]['id']}})[_0xc86d('0x29')](handleEntityNotFound(_0x2172c3,null))[_0xc86d('0x29')](function(_0x151e26){if(_0x151e26){return db[_0xc86d('0x54')][_0xc86d('0x55')](function(_0x1b5ea7){return db[_0xc86d('0x5d')][_0xc86d('0x5b')]({'where':{'userProfileId':_0x4334e3[_0xc86d('0x48')]['id'],'sectionId':_[_0xc86d('0x2f')](_0x542d27,function(_0x160cb1){return _0x160cb1[_0xc86d('0x56')];})},'transaction':_0x1b5ea7})[_0xc86d('0x29')](function(){var _0x20ce5b=_[_0xc86d('0x2f')](_0x542d27,function(_0x5909e0){_0x5909e0[_0xc86d('0x57')]=_0x4334e3[_0xc86d('0x48')]['id'];return _0x5909e0;});var _0x52ad43=[];return BPromise['each'](_0x20ce5b,function(_0x3ad079){return db['UserProfileSection'][_0xc86d('0x4a')](_0x3ad079,{'include':[{'model':db[_0xc86d('0x59')],'as':_0xc86d('0x58')}],'raw':!![],'transaction':_0x1b5ea7})['then'](function(_0x2b3fd3){_0x52ad43[_0xc86d('0x5e')](_0x2b3fd3[_0xc86d('0x4f')]({'plain':!![]}));});})[_0xc86d('0x29')](function(){return _0x52ad43;});});});}})[_0xc86d('0x29')](function(_0x104472){return _0x104472;})[_0xc86d('0x29')](respondWithResult(_0x2172c3,null))['catch'](handleError(_0x2172c3,null));};exports[_0xc86d('0x5f')]=function(_0x224b33,_0x61ca65){var _0x48224e;return db[_0xc86d('0x30')][_0xc86d('0x5a')]({'where':{'id':_0x224b33[_0xc86d('0x48')]['id']},'attributes':['id',_0xc86d('0x34')]})[_0xc86d('0x29')](handleEntityNotFound(_0x61ca65,null))[_0xc86d('0x29')](function(_0x3ab2e9){if(_0x3ab2e9){_0x48224e=_0x3ab2e9;return db[_0xc86d('0x5d')][_0xc86d('0x5b')]({'where':{'userProfileId':_0x224b33[_0xc86d('0x48')]['id'],'sectionId':_0x224b33[_0xc86d('0x35')][_0xc86d('0x60')]}});}})[_0xc86d('0x29')](function(){return _0x48224e;})[_0xc86d('0x29')](respondWithStatusCode(_0x61ca65,null))[_0xc86d('0x46')](handleError(_0x61ca65,null));};exports['getSections']=function(_0x34e77e,_0xc2d3c8){var _0x29e307=[];var _0x5c7345=[];return db[_0xc86d('0x5d')][_0xc86d('0x45')]({'where':{'userProfileId':_0x34e77e[_0xc86d('0x48')]['id']},'raw':!![]})[_0xc86d('0x29')](function(_0x322e30){_0x29e307=_[_0xc86d('0x40')](_0x322e30,function(_0x504b67){return _0x504b67[_0xc86d('0x61')]===0x1||_[_0xc86d('0x62')]([0x3eb,0x709],_0x504b67['sectionId']);});if(!_[_0xc86d('0x63')](_0x29e307)){return _[_0xc86d('0x2f')](_0x29e307,function(_0x43a3bc){return _0x43a3bc['sectionId'];});}else{return;}})[_0xc86d('0x29')](function(_0x335992){if(_0x335992)_0x5c7345=_0x335992;if(_[_0xc86d('0x62')](_0x5c7345,0x64)){var _0xe39522=_[_0xc86d('0x5a')](_0x29e307,{'sectionId':0x64});return hasDefaultDashboard(_0xe39522)['then'](function(_0x541a5e){return _[_0xc86d('0x2f')](_0x29e307,function(_0x512f2e){if(_0x512f2e['sectionId']===0x64){_0x512f2e[_0xc86d('0x64')]=_0x541a5e;}return _0x512f2e;});});}else{return;}})['then'](function(_0x302f5d){if(_0x302f5d)_0x29e307=_0x302f5d;if(_[_0xc86d('0x62')](_0x5c7345,0x3eb)){var _0xa17588=_[_0xc86d('0x5a')](_0x29e307,{'sectionId':0x3eb});return getCustomDashboards(_0xa17588)[_0xc86d('0x29')](function(_0x2abe0b){return _[_0xc86d('0x2f')](_0x29e307,function(_0x2b70b7){if(_0xa17588[_0xc86d('0x61')]){if(_0x2b70b7[_0xc86d('0x56')]===0x3eb){_0x2b70b7[_0xc86d('0x64')]=_0x2abe0b;}}else{if(_0x2b70b7[_0xc86d('0x56')]===0x64){_0x2b70b7[_0xc86d('0x64')]=_0x2abe0b;}}return _0x2b70b7;});});}else{return;}})['then'](function(_0x2643f3){if(_0x2643f3)_0x29e307=_0x2643f3;if(_[_0xc86d('0x62')](_0x5c7345,0x709)){var _0x5ace7e=_['find'](_0x29e307,{'sectionId':0x709});return getPlugins(_0x5ace7e)['then'](function(_0x2789ad){if(_0x5ace7e[_0xc86d('0x61')]){return _[_0xc86d('0x2f')](_0x29e307,function(_0x93317e){if(_0x93317e[_0xc86d('0x56')]===0x709){_0x93317e[_0xc86d('0x64')]=_0x2789ad;}return _0x93317e;});}else{var _0x3ef3cb={'sectionId':0x76c,'enabled':0x1,'subsections':_0x2789ad};var _0x5b1af8=_[_0xc86d('0x2f')](_0x29e307);_0x5b1af8[_0xc86d('0x5e')](_0x3ef3cb);return _0x5b1af8;}});}else{return;}})[_0xc86d('0x29')](function(_0x4c5e64){if(_0x4c5e64)_0x29e307=_0x4c5e64;return _[_0xc86d('0x40')](_0x29e307,[_0xc86d('0x61'),0x1]);})['then'](respondWithResult(_0xc2d3c8,null))[_0xc86d('0x46')](handleError(_0xc2d3c8,null));};function hasDefaultDashboard(_0x45520f){var _0x568467=[0x65];return new BPromise(function(_0xe99aa6,_0x54998e){try{if(_0x45520f[_0xc86d('0x65')]){_0xe99aa6(_0x568467);}else{return db[_0xc86d('0x59')][_0xc86d('0x66')]({'where':{'sectionId':_0x45520f['id']},'raw':!![]})['then'](function(_0x3a53a4){_0x3a53a4?_0xe99aa6(_0x568467):_0xe99aa6();});}}catch(_0x19fa2f){_0x54998e(_0x19fa2f);}});}function getCustomDashboards(_0x2948d3){var _0xe20161=[];return new BPromise(function(_0x17eb20,_0xa1d94a){try{if(_0x2948d3[_0xc86d('0x65')]){return db['Dashboard'][_0xc86d('0x45')]({'raw':!![]})[_0xc86d('0x29')](function(_0x33d492){_0x33d492['forEach'](function(_0x2ffbc7){_0xe20161[_0xc86d('0x5e')](_0x2ffbc7['id']+0x1869f);});_0x17eb20(_0xe20161);});}else{return db[_0xc86d('0x59')][_0xc86d('0x45')]({'where':{'sectionId':_0x2948d3['id']},'raw':!![]})['then'](function(_0x2b3dcf){_0x2b3dcf[_0xc86d('0x67')](function(_0x4e69ae){_0xe20161['push'](_0x4e69ae[_0xc86d('0x68')]+0x1869f);});_0x17eb20(_0xe20161);});}}catch(_0x27f63d){_0xa1d94a(_0x27f63d);}});}function getPlugins(_0x570a11){var _0x3bf107=[];return new BPromise(function(_0x3e46a3,_0x1a0616){try{if(_0x570a11[_0xc86d('0x65')]){return db['Plugin'][_0xc86d('0x45')]({'raw':!![]})['then'](function(_0x1bf8d4){_0x1bf8d4[_0xc86d('0x67')](function(_0x2f8652){_0x3bf107[_0xc86d('0x5e')](_0x2f8652['id']+0x15b38);});_0x3e46a3(_0x3bf107);});}else{return db[_0xc86d('0x59')][_0xc86d('0x45')]({'where':{'sectionId':_0x570a11['id']},'raw':!![]})[_0xc86d('0x29')](function(_0x2bf77a){_0x2bf77a['forEach'](function(_0x1a52e2){_0x3bf107[_0xc86d('0x5e')](_0x1a52e2[_0xc86d('0x68')]+0x15b38);});_0x3e46a3(_0x3bf107);});}}catch(_0x429c45){_0x1a0616(_0x429c45);}});}exports['addResources']=function(_0x963bc2,_0x54fa5d){return db[_0xc86d('0x30')][_0xc86d('0x5a')]({'where':{'id':_0x963bc2[_0xc86d('0x48')]['id']}})[_0xc86d('0x29')](handleEntityNotFound(_0x54fa5d,null))[_0xc86d('0x29')](function(_0x3fe5ce){if(_0x3fe5ce){return db[_0xc86d('0x54')]['transaction'](function(_0x37f708){return db[_0xc86d('0x5d')]['findAll']({'where':{'userProfileId':_0x963bc2['params']['id']},'attributes':['id'],'raw':!![]})[_0xc86d('0x29')](function(_0x40761f){if(_0x40761f){return db['UserProfileSection'][_0xc86d('0x5b')]({'where':{'userProfileId':_0x963bc2[_0xc86d('0x48')]['id'],'id':_[_0xc86d('0x2f')](_0x40761f,function(_0x360615){return _0x360615['id'];})},'transaction':_0x37f708});}})[_0xc86d('0x29')](function(_0x1c14d6){var _0x2c1431=_[_0xc86d('0x2f')](_0x963bc2[_0xc86d('0x4b')],function(_0x48b1b5){_0x48b1b5['userProfileId']=_0x963bc2[_0xc86d('0x48')]['id'];return _0x48b1b5;});return db[_0xc86d('0x5d')][_0xc86d('0x69')](_0x2c1431,{'raw':!![],'transaction':_0x37f708});})['then'](function(_0x389f19){var _0x1b3bcb=_[_0xc86d('0x40')](_['map'](_0x389f19,function(_0x24719d){return _0x24719d[_0xc86d('0x4f')]({'plain':!![]});}),{'includeAll':![]});if(_0x1b3bcb){return db['UserProfileSection'][_0xc86d('0x45')]({'where':{'userProfileId':_0x963bc2[_0xc86d('0x48')]['id'],'sectionId':_[_0xc86d('0x2f')](_0x1b3bcb,function(_0x731435){return _0x731435[_0xc86d('0x56')];})},'attributes':['id',_0xc86d('0x56')],'raw':!![]})[_0xc86d('0x29')](function(_0x553ab0){var _0x2a09d9=_[_0xc86d('0x2f')](_0x963bc2['body'],function(_0x513639){_0x513639[_0xc86d('0x57')]=_0x963bc2[_0xc86d('0x48')]['id'];return _0x513639;});return db['UserProfileResource'][_0xc86d('0x69')](_0x2a09d9,{'raw':!![],'transaction':_0x37f708});});}})[_0xc86d('0x46')](handleError(_0x54fa5d,null));});}})[_0xc86d('0x29')](function(_0x36435f){var _0x30c4d5=_['map'](_0x36435f,function(_0x50d2ae){return _0x50d2ae[_0xc86d('0x4f')]({'plain':!![]});});})['then'](respondWithResult(_0x54fa5d,null))[_0xc86d('0x46')](handleError(_0x54fa5d,null));};exports[_0xc86d('0x6a')]=function(_0x505ffa,_0xc628a1,_0x3105c5){return db[_0xc86d('0x30')][_0xc86d('0x5a')]({'where':{'id':_0x505ffa['params']['id']}})[_0xc86d('0x29')](handleEntityNotFound(_0xc628a1,null))['then'](function(_0x36035b){if(_0x36035b){return _0x36035b['removeResources'](_0x505ffa[_0xc86d('0x35')]['ids']);}})[_0xc86d('0x29')](respondWithStatusCode(_0xc628a1,null))[_0xc86d('0x46')](handleError(_0xc628a1,null));};exports['getResources']=function(_0x3ce441,_0x49c64e){var _0x5d322c={};if(!_0x3ce441[_0xc86d('0x35')][_0xc86d('0x6b')])throw new Error(_0xc86d('0x6c'));if(!_0x3ce441[_0xc86d('0x35')]['hasOwnProperty'](_0xc86d('0x3c'))){_0x5d322c['limit']=qs[_0xc86d('0x20')](_0x3ce441[_0xc86d('0x35')][_0xc86d('0x20')]);_0x5d322c[_0xc86d('0x22')]=qs[_0xc86d('0x22')](_0x3ce441[_0xc86d('0x35')][_0xc86d('0x22')]);}return db['UserProfile'][_0xc86d('0x5a')]({'where':{'id':_0x3ce441[_0xc86d('0x48')]['id']}})[_0xc86d('0x29')](function(_0x180f1c){if(!_0x180f1c)throw new Error(_0xc86d('0x6d')+_0x3ce441['params']['id']);return db[_0xc86d('0x30')][_0xc86d('0x6e')](_0x3ce441);})[_0xc86d('0x29')](respondWithFilteredResult(_0x49c64e,_0x5d322c))[_0xc86d('0x46')](handleError(_0x49c64e,null));}; \ No newline at end of file +var _0x8579=['push','ids','getSections','enabled','includes','isEmpty','subsections','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','name','send','UserProfile','rawAttributes','fieldName','type','key','model','map','keys','intersection','attributes','fields','query','hasOwnProperty','nolimit','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','length','find','catch','create','body','clone','get','omit','createdAt','crudPermissions','updatedAt','sequelize','UserProfileSection','each','autoAssociation','UserProfileResource','userProfileId','Resources','describe','addSections','transaction','sectionId'];(function(_0x6bfda8,_0x3a7a4d){var _0x1441b6=function(_0x1d517a){while(--_0x1d517a){_0x6bfda8['push'](_0x6bfda8['shift']());}};_0x1441b6(++_0x3a7a4d);}(_0x8579,0x16c));var _0x9857=function(_0x56961e,_0x1f56e7){_0x56961e=_0x56961e-0x0;var _0x54743d=_0x8579[_0x56961e];return _0x54743d;};'use strict';var emlformat=require(_0x9857('0x0'));var rimraf=require(_0x9857('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9857('0x2'));var rp=require(_0x9857('0x3'));var moment=require(_0x9857('0x4'));var BPromise=require(_0x9857('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x9857('0x6'));var ejs=require(_0x9857('0x7'));var fs=require('fs');var fs_extra=require(_0x9857('0x8'));var _=require(_0x9857('0x9'));var squel=require(_0x9857('0xa'));var crypto=require(_0x9857('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9857('0xc'));var toCsv=require(_0x9857('0x6'));var querystring=require(_0x9857('0xd'));var Papa=require(_0x9857('0xe'));var Redis=require(_0x9857('0xf'));var authService=require(_0x9857('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9857('0x11'))(_0x9857('0x12'));var utils=require(_0x9857('0x13'));var config=require(_0x9857('0x14'));var licenseUtil=require(_0x9857('0x15'));var db=require(_0x9857('0x16'))['db'];config[_0x9857('0x17')]=_[_0x9857('0x18')](config[_0x9857('0x17')],{'host':_0x9857('0x19'),'port':0x18eb});var socket=require(_0x9857('0x1a'))(new Redis(config[_0x9857('0x17')]));require(_0x9857('0x1b'))[_0x9857('0x1c')](socket);function respondWithStatusCode(_0xae57c8,_0x334105){_0x334105=_0x334105||0xcc;return function(_0x211cf2){if(_0x211cf2){return _0xae57c8[_0x9857('0x1d')](_0x334105);}return _0xae57c8[_0x9857('0x1e')](_0x334105)[_0x9857('0x1f')]();};}function respondWithResult(_0x5b2cf9,_0x3e0d3b){_0x3e0d3b=_0x3e0d3b||0xc8;return function(_0x40943e){if(_0x40943e){return _0x5b2cf9[_0x9857('0x1e')](_0x3e0d3b)[_0x9857('0x20')](_0x40943e);}};}function respondWithFilteredResult(_0x369993,_0x2a06db){return function(_0x5f46a0){if(_0x5f46a0){var _0x4ae16d=typeof _0x2a06db['offset']==='undefined'&&typeof _0x2a06db[_0x9857('0x21')]===_0x9857('0x22');var _0x1f7dd4=_0x5f46a0[_0x9857('0x23')];var _0x118089=_0x4ae16d?0x0:_0x2a06db[_0x9857('0x24')];var _0xb7c90e=_0x4ae16d?_0x5f46a0[_0x9857('0x23')]:_0x2a06db[_0x9857('0x24')]+_0x2a06db[_0x9857('0x21')];var _0x5e0683;if(_0xb7c90e>=_0x1f7dd4){_0xb7c90e=_0x1f7dd4;_0x5e0683=0xc8;}else{_0x5e0683=0xce;}_0x369993[_0x9857('0x1e')](_0x5e0683);return _0x369993[_0x9857('0x25')](_0x9857('0x26'),_0x118089+'-'+_0xb7c90e+'/'+_0x1f7dd4)[_0x9857('0x20')](_0x5f46a0);}return null;};}function patchUpdates(_0x3d17c4){return function(_0x2b16eb){try{jsonpatch[_0x9857('0x27')](_0x2b16eb,_0x3d17c4,!![]);}catch(_0x3c4201){return BPromise[_0x9857('0x28')](_0x3c4201);}return _0x2b16eb['save']();};}function saveUpdates(_0x2a90c3,_0x39450a){return function(_0x6e76a8){if(_0x6e76a8){return _0x6e76a8[_0x9857('0x29')](_0x2a90c3)[_0x9857('0x2a')](function(_0xea1406){return _0xea1406;});}return null;};}function removeEntity(_0x4948b8,_0x27bdb6){return function(_0x456ad2){if(_0x456ad2){return _0x456ad2[_0x9857('0x2b')]()[_0x9857('0x2a')](function(){_0x4948b8[_0x9857('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x321c89,_0x2f9e5d){return function(_0x233a25){if(!_0x233a25){_0x321c89[_0x9857('0x1d')](0x194);}return _0x233a25;};}function handleError(_0x5e4a85,_0x2d086c){_0x2d086c=_0x2d086c||0x1f4;return function(_0x124721){logger[_0x9857('0x2c')](_0x124721['stack']);if(_0x124721[_0x9857('0x2d')]){delete _0x124721['name'];}_0x5e4a85[_0x9857('0x1e')](_0x2d086c)[_0x9857('0x2e')](_0x124721);};}exports['index']=function(_0xf015a3,_0x2553fa){var _0x2cd562={},_0x15c636={},_0x520c29={'count':0x0,'rows':[]};var _0xbe1e2f=_['map'](db[_0x9857('0x2f')][_0x9857('0x30')],function(_0x40eee2){return{'name':_0x40eee2[_0x9857('0x31')],'type':_0x40eee2[_0x9857('0x32')][_0x9857('0x33')]};});_0x15c636[_0x9857('0x34')]=_[_0x9857('0x35')](_0xbe1e2f,_0x9857('0x2d'));_0x15c636['query']=_[_0x9857('0x36')](_0xf015a3['query']);_0x15c636['filters']=_[_0x9857('0x37')](_0x15c636[_0x9857('0x34')],_0x15c636['query']);_0x2cd562[_0x9857('0x38')]=_[_0x9857('0x37')](_0x15c636[_0x9857('0x34')],qs[_0x9857('0x39')](_0xf015a3[_0x9857('0x3a')][_0x9857('0x39')]));_0x2cd562[_0x9857('0x38')]=_0x2cd562[_0x9857('0x38')]['length']?_0x2cd562['attributes']:_0x15c636[_0x9857('0x34')];if(!_0xf015a3['query'][_0x9857('0x3b')](_0x9857('0x3c'))){_0x2cd562[_0x9857('0x21')]=qs['limit'](_0xf015a3[_0x9857('0x3a')][_0x9857('0x21')]);_0x2cd562[_0x9857('0x24')]=qs['offset'](_0xf015a3['query'][_0x9857('0x24')]);}_0x2cd562['order']=qs[_0x9857('0x3d')](_0xf015a3['query'][_0x9857('0x3d')]);_0x2cd562[_0x9857('0x3e')]=qs['filters'](_['pick'](_0xf015a3['query'],_0x15c636[_0x9857('0x3f')]),_0xbe1e2f);if(_0xf015a3['query'][_0x9857('0x40')]){_0x2cd562['where']=_['merge'](_0x2cd562[_0x9857('0x3e')],{'$or':_[_0x9857('0x35')](_0xbe1e2f,function(_0x103b47){if(_0x103b47['type']!==_0x9857('0x41')){var _0x406757={};_0x406757[_0x103b47[_0x9857('0x2d')]]={'$like':'%'+_0xf015a3[_0x9857('0x3a')][_0x9857('0x40')]+'%'};return _0x406757;}})});}_0x2cd562=_[_0x9857('0x42')]({},_0x2cd562,_0xf015a3[_0x9857('0x43')]);var _0x374348={'where':_0x2cd562[_0x9857('0x3e')]};return db[_0x9857('0x2f')][_0x9857('0x23')](_0x374348)[_0x9857('0x2a')](function(_0x7dd63c){_0x520c29[_0x9857('0x23')]=_0x7dd63c;if(_0xf015a3[_0x9857('0x3a')][_0x9857('0x44')]){_0x2cd562[_0x9857('0x45')]=[{'all':!![]}];}return db['UserProfile'][_0x9857('0x46')](_0x2cd562);})[_0x9857('0x2a')](function(_0xa19f0f){_0x520c29[_0x9857('0x47')]=_0xa19f0f;return _0x520c29;})[_0x9857('0x2a')](respondWithFilteredResult(_0x2553fa,_0x2cd562))['catch'](handleError(_0x2553fa,null));};exports[_0x9857('0x48')]=function(_0x2e2c42,_0x2b2fbd){var _0x4c7fdd={'raw':![],'where':{'id':_0x2e2c42[_0x9857('0x49')]['id']}},_0xdd5d00={};_0xdd5d00[_0x9857('0x34')]=_[_0x9857('0x36')](db[_0x9857('0x2f')][_0x9857('0x30')]);_0xdd5d00['query']=_['keys'](_0x2e2c42[_0x9857('0x3a')]);_0xdd5d00['filters']=_['intersection'](_0xdd5d00[_0x9857('0x34')],_0xdd5d00[_0x9857('0x3a')]);_0x4c7fdd[_0x9857('0x38')]=_['intersection'](_0xdd5d00[_0x9857('0x34')],qs['fields'](_0x2e2c42[_0x9857('0x3a')]['fields']));_0x4c7fdd[_0x9857('0x38')]=_0x4c7fdd[_0x9857('0x38')][_0x9857('0x4a')]?_0x4c7fdd[_0x9857('0x38')]:_0xdd5d00['model'];if(_0x2e2c42[_0x9857('0x3a')]['includeAll']){_0x4c7fdd[_0x9857('0x45')]=[{'all':!![]}];}_0x4c7fdd=_[_0x9857('0x42')]({},_0x4c7fdd,_0x2e2c42['options']);return db['UserProfile'][_0x9857('0x4b')](_0x4c7fdd)[_0x9857('0x2a')](handleEntityNotFound(_0x2b2fbd,null))[_0x9857('0x2a')](respondWithResult(_0x2b2fbd,null))[_0x9857('0x4c')](handleError(_0x2b2fbd,null));};exports['create']=function(_0x292a2d,_0x1d6424){return db[_0x9857('0x2f')][_0x9857('0x4d')](_0x292a2d[_0x9857('0x4e')],{})[_0x9857('0x2a')](respondWithResult(_0x1d6424,0xc9))[_0x9857('0x4c')](handleError(_0x1d6424,null));};exports[_0x9857('0x4f')]=function(_0x30e348,_0xc93cb8){var _0x1d3bed={'where':{'id':_0x30e348['params']['id']}},_0xb32ea9={};_0xb32ea9[_0x9857('0x34')]=_['keys'](db[_0x9857('0x2f')][_0x9857('0x30')]);_0x1d3bed['attributes']=_[_0x9857('0x37')](_0xb32ea9[_0x9857('0x34')],qs[_0x9857('0x39')](_0x30e348[_0x9857('0x3a')]['fields']));_0x1d3bed[_0x9857('0x38')]=_0x1d3bed[_0x9857('0x38')][_0x9857('0x4a')]?_0x1d3bed['attributes']:_0xb32ea9[_0x9857('0x34')];if(_0x30e348['query'][_0x9857('0x44')]){_0x1d3bed['include']=[{'all':!![]}];}_0x1d3bed=_['merge']({},_0x1d3bed,_0x30e348[_0x9857('0x43')]);return db[_0x9857('0x2f')]['find'](_0x1d3bed)['then'](handleEntityNotFound(_0xc93cb8,null))[_0x9857('0x2a')](function(_0x47a4a1){if(_0x47a4a1){var _0x37363f=_0x47a4a1[_0x9857('0x50')]({'plain':!![]});_0x37363f=qs[_0x9857('0x51')](_0x37363f,['id',_0x9857('0x52'),'updatedAt',_0x9857('0x53')]);_0x30e348[_0x9857('0x4e')]=_[_0x9857('0x51')](_0x30e348[_0x9857('0x4e')],['id',_0x9857('0x52'),_0x9857('0x54')]);return db[_0x9857('0x55')]['transaction'](function(_0x8817c7){return db[_0x9857('0x2f')][_0x9857('0x4d')](_[_0x9857('0x42')](_0x37363f,_0x30e348[_0x9857('0x4e')]),{'include':_0x30e348[_0x9857('0x3a')][_0x9857('0x44')]?[{'all':!![]}]:undefined,'transaction':_0x8817c7})[_0x9857('0x2a')](function(_0xfa889a){var _0x248ef4=_0xfa889a[_0x9857('0x50')]({'plain':!![]});return db[_0x9857('0x56')][_0x9857('0x46')]({'where':{'userProfileId':_0x30e348['params']['id']},'raw':!![]})['then'](function(_0x4db599){if(_0x4db599){return BPromise[_0x9857('0x57')](_0x4db599,function(_0x51031e){return new BPromise(function(_0x38b3f7,_0x460458){if(_0x51031e['autoAssociation']===null||_0x51031e[_0x9857('0x58')]===0x1)_0x38b3f7(null);return db[_0x9857('0x59')][_0x9857('0x46')]({'where':{'sectionId':_0x51031e['id']},'raw':!![]})[_0x9857('0x2a')](function(_0x4f68cf){var _0x43472d=_[_0x9857('0x35')](_0x4f68cf,function(_0xce39f6){return qs['omit'](_0xce39f6,['id',_0x9857('0x52'),'updatedAt','sectionId']);});_0x38b3f7(_0x43472d);})[_0x9857('0x4c')](function(_0x95cebc){_0x460458(_0x95cebc);});})[_0x9857('0x2a')](function(_0x56278d){var _0x160d4e=qs[_0x9857('0x51')](_0x51031e,['id',_0x9857('0x52'),_0x9857('0x54')]);_0x160d4e[_0x9857('0x5a')]=_0x248ef4['id'];if(_0x56278d)_0x160d4e[_0x9857('0x5b')]=_0x56278d;return _0x160d4e;})[_0x9857('0x2a')](function(_0x4ab4af){return db[_0x9857('0x56')][_0x9857('0x4d')](_0x4ab4af,{'include':[{'model':db['UserProfileResource'],'as':_0x9857('0x5b')}],'raw':!![],'transaction':_0x8817c7});});})[_0x9857('0x2a')](function(){return _0x248ef4;});}});});});}})[_0x9857('0x2a')](respondWithResult(_0xc93cb8,0xc9))[_0x9857('0x4c')](handleError(_0xc93cb8,null));};exports[_0x9857('0x29')]=function(_0x2a20ee,_0x1245e1){if(_0x2a20ee[_0x9857('0x4e')]['id']){delete _0x2a20ee[_0x9857('0x4e')]['id'];}return db[_0x9857('0x2f')][_0x9857('0x4b')]({'where':{'id':_0x2a20ee[_0x9857('0x49')]['id']}})['then'](handleEntityNotFound(_0x1245e1,null))[_0x9857('0x2a')](saveUpdates(_0x2a20ee[_0x9857('0x4e')],null))[_0x9857('0x2a')](respondWithResult(_0x1245e1,null))[_0x9857('0x4c')](handleError(_0x1245e1,null));};exports[_0x9857('0x2b')]=function(_0x33014b,_0x177a6b){return db['UserProfile']['find']({'where':{'id':_0x33014b[_0x9857('0x49')]['id']}})[_0x9857('0x2a')](handleEntityNotFound(_0x177a6b,null))[_0x9857('0x2a')](removeEntity(_0x177a6b,null))[_0x9857('0x4c')](handleError(_0x177a6b,null));};exports[_0x9857('0x5c')]=function(_0x2d60f1,_0xe60f1c){return db[_0x9857('0x2f')][_0x9857('0x5c')]()[_0x9857('0x2a')](respondWithResult(_0xe60f1c,null))[_0x9857('0x4c')](handleError(_0xe60f1c,null));};exports[_0x9857('0x5d')]=function(_0x17aaf7,_0x5c6edd){var _0x2cbd50=_0x17aaf7['body'];return db['UserProfile']['find']({'where':{'id':_0x17aaf7['params']['id']}})[_0x9857('0x2a')](handleEntityNotFound(_0x5c6edd,null))[_0x9857('0x2a')](function(_0x13ff8f){if(_0x13ff8f){return db['sequelize'][_0x9857('0x5e')](function(_0x1a8868){return db[_0x9857('0x56')][_0x9857('0x2b')]({'where':{'userProfileId':_0x17aaf7[_0x9857('0x49')]['id'],'sectionId':_['map'](_0x2cbd50,function(_0x3072bc){return _0x3072bc[_0x9857('0x5f')];})},'transaction':_0x1a8868})[_0x9857('0x2a')](function(){var _0x40e709=_[_0x9857('0x35')](_0x2cbd50,function(_0x1269f3){_0x1269f3[_0x9857('0x5a')]=_0x17aaf7[_0x9857('0x49')]['id'];return _0x1269f3;});var _0x3aae2a=[];return BPromise['each'](_0x40e709,function(_0x50f12d){return db['UserProfileSection'][_0x9857('0x4d')](_0x50f12d,{'include':[{'model':db[_0x9857('0x59')],'as':_0x9857('0x5b')}],'raw':!![],'transaction':_0x1a8868})['then'](function(_0xdc7ff1){_0x3aae2a[_0x9857('0x60')](_0xdc7ff1['get']({'plain':!![]}));});})[_0x9857('0x2a')](function(){return _0x3aae2a;});});});}})[_0x9857('0x2a')](function(_0x40380c){return _0x40380c;})[_0x9857('0x2a')](respondWithResult(_0x5c6edd,null))['catch'](handleError(_0x5c6edd,null));};exports['removeSections']=function(_0x27ecc0,_0x3ab6c2){var _0x264bb2;return db[_0x9857('0x2f')][_0x9857('0x4b')]({'where':{'id':_0x27ecc0[_0x9857('0x49')]['id']},'attributes':['id',_0x9857('0x2d')]})[_0x9857('0x2a')](handleEntityNotFound(_0x3ab6c2,null))[_0x9857('0x2a')](function(_0x51df7c){if(_0x51df7c){_0x264bb2=_0x51df7c;return db[_0x9857('0x56')][_0x9857('0x2b')]({'where':{'userProfileId':_0x27ecc0['params']['id'],'sectionId':_0x27ecc0['query'][_0x9857('0x61')]}});}})[_0x9857('0x2a')](function(){return _0x264bb2;})[_0x9857('0x2a')](respondWithStatusCode(_0x3ab6c2,null))['catch'](handleError(_0x3ab6c2,null));};exports[_0x9857('0x62')]=function(_0x2dd3a8,_0x44a580){var _0x4b31f4=[];var _0x35e6c1=[];return db['UserProfileSection'][_0x9857('0x46')]({'where':{'userProfileId':_0x2dd3a8['params']['id']},'raw':!![]})[_0x9857('0x2a')](function(_0x1065ac){_0x4b31f4=_['filter'](_0x1065ac,function(_0x3e802a){return _0x3e802a[_0x9857('0x63')]===0x1||_[_0x9857('0x64')]([0x3eb,0x709],_0x3e802a[_0x9857('0x5f')]);});if(!_[_0x9857('0x65')](_0x4b31f4)){return _[_0x9857('0x35')](_0x4b31f4,function(_0x5b680b){return _0x5b680b[_0x9857('0x5f')];});}else{return;}})[_0x9857('0x2a')](function(_0x530756){if(_0x530756)_0x35e6c1=_0x530756;if(_[_0x9857('0x64')](_0x35e6c1,0x64)){var _0x5d7a2d=_[_0x9857('0x4b')](_0x4b31f4,{'sectionId':0x64});return hasDefaultDashboard(_0x5d7a2d)['then'](function(_0x142765){return _[_0x9857('0x35')](_0x4b31f4,function(_0x31b778){if(_0x31b778[_0x9857('0x5f')]===0x64){_0x31b778[_0x9857('0x66')]=_0x142765;}return _0x31b778;});});}else{return;}})['then'](function(_0xff950){if(_0xff950)_0x4b31f4=_0xff950;if(_[_0x9857('0x64')](_0x35e6c1,0x3eb)){var _0x136464=_[_0x9857('0x4b')](_0x4b31f4,{'sectionId':0x3eb});return getCustomDashboards(_0x136464)['then'](function(_0x15269e){return _[_0x9857('0x35')](_0x4b31f4,function(_0x13e290){if(_0x136464[_0x9857('0x63')]){if(_0x13e290[_0x9857('0x5f')]===0x3eb){_0x13e290['subsections']=_0x15269e;}}else{if(_0x13e290[_0x9857('0x5f')]===0x64){_0x13e290[_0x9857('0x66')]=_0x15269e;}}return _0x13e290;});});}else{return;}})[_0x9857('0x2a')](function(_0xa80deb){if(_0xa80deb)_0x4b31f4=_0xa80deb;if(_[_0x9857('0x64')](_0x35e6c1,0x709)){var _0x10edd9=_[_0x9857('0x4b')](_0x4b31f4,{'sectionId':0x709});return getPlugins(_0x10edd9)[_0x9857('0x2a')](function(_0x42c915){if(_0x10edd9['enabled']){return _['map'](_0x4b31f4,function(_0x2a5c79){if(_0x2a5c79[_0x9857('0x5f')]===0x709){_0x2a5c79['subsections']=_0x42c915;}return _0x2a5c79;});}else{var _0x25ff07={'sectionId':0x76c,'enabled':0x1,'subsections':_0x42c915};var _0x1b9fb6=_[_0x9857('0x35')](_0x4b31f4);_0x1b9fb6[_0x9857('0x60')](_0x25ff07);return _0x1b9fb6;}});}else{return;}})['then'](function(_0x2634e8){if(_0x2634e8)_0x4b31f4=_0x2634e8;return _[_0x9857('0x40')](_0x4b31f4,[_0x9857('0x63'),0x1]);})[_0x9857('0x2a')](respondWithResult(_0x44a580,null))[_0x9857('0x4c')](handleError(_0x44a580,null));};function hasDefaultDashboard(_0x307021){var _0x708041=[0x65];return new BPromise(function(_0x3829bd,_0x32d738){try{if(_0x307021[_0x9857('0x58')]){_0x3829bd(_0x708041);}else{return db['UserProfileResource'][_0x9857('0x67')]({'where':{'sectionId':_0x307021['id']},'raw':!![]})[_0x9857('0x2a')](function(_0x5d9b30){_0x5d9b30?_0x3829bd(_0x708041):_0x3829bd();});}}catch(_0x8022b5){_0x32d738(_0x8022b5);}});}function getCustomDashboards(_0x58dca1){var _0x2d8780=[];return new BPromise(function(_0x14612a,_0x2111e3){try{if(_0x58dca1[_0x9857('0x58')]){return db[_0x9857('0x68')][_0x9857('0x46')]({'raw':!![]})['then'](function(_0x34a828){_0x34a828[_0x9857('0x69')](function(_0x2cb5a7){_0x2d8780[_0x9857('0x60')](_0x2cb5a7['id']+0x1869f);});_0x14612a(_0x2d8780);});}else{return db[_0x9857('0x59')][_0x9857('0x46')]({'where':{'sectionId':_0x58dca1['id']},'raw':!![]})['then'](function(_0x34b14b){_0x34b14b[_0x9857('0x69')](function(_0x5f20af){_0x2d8780[_0x9857('0x60')](_0x5f20af[_0x9857('0x6a')]+0x1869f);});_0x14612a(_0x2d8780);});}}catch(_0x34de9e){_0x2111e3(_0x34de9e);}});}function getPlugins(_0x5658f9){var _0x561ace=[];return new BPromise(function(_0x2f2690,_0x462ba1){try{if(_0x5658f9['autoAssociation']){return db[_0x9857('0x6b')][_0x9857('0x46')]({'raw':!![]})[_0x9857('0x2a')](function(_0x716599){_0x716599['forEach'](function(_0x3b4267){_0x561ace[_0x9857('0x60')](_0x3b4267['id']+0x15b38);});_0x2f2690(_0x561ace);});}else{return db[_0x9857('0x59')][_0x9857('0x46')]({'where':{'sectionId':_0x5658f9['id']},'raw':!![]})[_0x9857('0x2a')](function(_0x530c5){_0x530c5[_0x9857('0x69')](function(_0x571532){_0x561ace[_0x9857('0x60')](_0x571532['resourceId']+0x15b38);});_0x2f2690(_0x561ace);});}}catch(_0x888c71){_0x462ba1(_0x888c71);}});}exports[_0x9857('0x6c')]=function(_0x48e7c0,_0x12d608){return db[_0x9857('0x2f')][_0x9857('0x4b')]({'where':{'id':_0x48e7c0[_0x9857('0x49')]['id']}})[_0x9857('0x2a')](handleEntityNotFound(_0x12d608,null))[_0x9857('0x2a')](function(_0xf55f00){if(_0xf55f00){return db[_0x9857('0x55')][_0x9857('0x5e')](function(_0x4eabbf){return db[_0x9857('0x56')][_0x9857('0x46')]({'where':{'userProfileId':_0x48e7c0['params']['id']},'attributes':['id'],'raw':!![]})[_0x9857('0x2a')](function(_0x59a31e){if(_0x59a31e){return db[_0x9857('0x56')][_0x9857('0x2b')]({'where':{'userProfileId':_0x48e7c0[_0x9857('0x49')]['id'],'id':_[_0x9857('0x35')](_0x59a31e,function(_0x4bc7e0){return _0x4bc7e0['id'];})},'transaction':_0x4eabbf});}})['then'](function(_0x2d0bc8){var _0x1c3e71=_[_0x9857('0x35')](_0x48e7c0[_0x9857('0x4e')],function(_0x525400){_0x525400['userProfileId']=_0x48e7c0[_0x9857('0x49')]['id'];return _0x525400;});return db[_0x9857('0x56')][_0x9857('0x6d')](_0x1c3e71,{'raw':!![],'transaction':_0x4eabbf});})[_0x9857('0x2a')](function(_0xa0f47f){var _0x621b73=_['filter'](_[_0x9857('0x35')](_0xa0f47f,function(_0x37e9b8){return _0x37e9b8[_0x9857('0x50')]({'plain':!![]});}),{'includeAll':![]});if(_0x621b73){return db['UserProfileSection'][_0x9857('0x46')]({'where':{'userProfileId':_0x48e7c0[_0x9857('0x49')]['id'],'sectionId':_[_0x9857('0x35')](_0x621b73,function(_0x299d90){return _0x299d90[_0x9857('0x5f')];})},'attributes':['id','sectionId'],'raw':!![]})[_0x9857('0x2a')](function(_0x164425){var _0x1a69f7=_[_0x9857('0x35')](_0x48e7c0[_0x9857('0x4e')],function(_0x464e33){_0x464e33[_0x9857('0x5a')]=_0x48e7c0[_0x9857('0x49')]['id'];return _0x464e33;});return db[_0x9857('0x59')][_0x9857('0x6d')](_0x1a69f7,{'raw':!![],'transaction':_0x4eabbf});});}})['catch'](handleError(_0x12d608,null));});}})['then'](function(_0x3d2a8){var _0x2a5174=_[_0x9857('0x35')](_0x3d2a8,function(_0x45c96a){return _0x45c96a['get']({'plain':!![]});});})['then'](respondWithResult(_0x12d608,null))[_0x9857('0x4c')](handleError(_0x12d608,null));};exports[_0x9857('0x6e')]=function(_0x298b62,_0x155d22,_0x425cbc){return db[_0x9857('0x2f')][_0x9857('0x4b')]({'where':{'id':_0x298b62[_0x9857('0x49')]['id']}})[_0x9857('0x2a')](handleEntityNotFound(_0x155d22,null))[_0x9857('0x2a')](function(_0x140953){if(_0x140953){return _0x140953[_0x9857('0x6e')](_0x298b62[_0x9857('0x3a')][_0x9857('0x61')]);}})['then'](respondWithStatusCode(_0x155d22,null))['catch'](handleError(_0x155d22,null));};exports[_0x9857('0x6f')]=function(_0x259bcd,_0xfd68c9){var _0x417f4d={};if(!_0x259bcd[_0x9857('0x3a')][_0x9857('0x70')])throw new Error(_0x9857('0x71'));if(!_0x259bcd[_0x9857('0x3a')][_0x9857('0x3b')]('nolimit')){_0x417f4d['limit']=qs[_0x9857('0x21')](_0x259bcd[_0x9857('0x3a')][_0x9857('0x21')]);_0x417f4d[_0x9857('0x24')]=qs['offset'](_0x259bcd['query'][_0x9857('0x24')]);}return db['UserProfile'][_0x9857('0x4b')]({'where':{'id':_0x259bcd['params']['id']}})[_0x9857('0x2a')](function(_0x5f0d8d){if(!_0x5f0d8d)throw new Error(_0x9857('0x72')+_0x259bcd[_0x9857('0x49')]['id']);return db[_0x9857('0x2f')]['getResources'](_0x259bcd);})['then'](respondWithFilteredResult(_0xfd68c9,_0x417f4d))['catch'](handleError(_0xfd68c9,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index ffa9a9d..84106bf 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 _0xa498=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','UserProfile'];(function(_0x154192,_0x2d360f){var _0x3c2792=function(_0x2e257b){while(--_0x2e257b){_0x154192['push'](_0x154192['shift']());}};_0x3c2792(++_0x2d360f);}(_0xa498,0x1d6));var _0x8a49=function(_0x503950,_0x5022eb){_0x503950=_0x503950-0x0;var _0x1657a9=_0xa498[_0x503950];return _0x1657a9;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x8a49('0x0'))['db'][_0x8a49('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x8a49('0x2'),'afterDestroy':_0x8a49('0x3')};function emitEvent(_0x1d4dd2){return function(_0x65eb15,_0x2f362e,_0x5aaf52){UserProfileEvents[_0x8a49('0x4')](_0x1d4dd2+':'+_0x65eb15['id'],_0x65eb15);UserProfileEvents['emit'](_0x1d4dd2,_0x65eb15);_0x5aaf52(null);};}for(var e in events){if(events[_0x8a49('0x5')](e)){var event=events[e];UserProfile[_0x8a49('0x6')](e,emitEvent(event));}}module[_0x8a49('0x7')]=UserProfileEvents; \ No newline at end of file +var _0x3c85=['remove','emit','events','../../mysqldb','UserProfile','setMaxListeners'];(function(_0x18a5ac,_0x250666){var _0x57ab11=function(_0x31bcf0){while(--_0x31bcf0){_0x18a5ac['push'](_0x18a5ac['shift']());}};_0x57ab11(++_0x250666);}(_0x3c85,0x1a0));var _0x53c8=function(_0x1153d7,_0x161f3b){_0x1153d7=_0x1153d7-0x0;var _0x1db8cc=_0x3c85[_0x1153d7];return _0x1db8cc;};'use strict';var EventEmitter=require(_0x53c8('0x0'));var UserProfile=require(_0x53c8('0x1'))['db'][_0x53c8('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x53c8('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x53c8('0x4')};function emitEvent(_0xcc2f5f){return function(_0x44a11e,_0x4be799,_0x270365){UserProfileEvents[_0x53c8('0x5')](_0xcc2f5f+':'+_0x44a11e['id'],_0x44a11e);UserProfileEvents[_0x53c8('0x5')](_0xcc2f5f,_0x44a11e);_0x270365(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 847ba9c..4b46b5a 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 _0xc794=['FaxQueue','faxaccounts','inboundroutes','internalroutes','VoiceExtension','VoiceContext','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','User','agent','Telephones','role','VoiceQueues','name','queue','VoiceQueue','type','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelAccount','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','agents','telephones','Users','admin','user','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','Disposition','Dashboard','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','Tag','templates','triggers','Trigger','trunks','Trunk','variables','Variable','Plugin','extractedreports','Reports','metrics','AnalyticMetric','charAt','slice','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','query','OpenTabs','define','user_profiles','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','push','UserProfileSection','find','params','ignore','length','autoAssociation','all','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','offset','order','sort','merge','foreignKey','options','include','reportType','default','reportId','DefaultReports','custom','CustomReports','count','rows','includeAll','Tags','color','tag','ThroughTags','openTabs','true','dataValues','sms','fax','openchannel','whatsapp','./userProfile.attributes','models','filter','field','value','findAll','then','associatedResources','catch','model','map','UserProfileResource','AnalyticExtractedReport','resourceId','toLowerCase','childModel','SquareProject','squarerecordings','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','chatwebsites','ChatWebsite','faxqueues'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xc794,0x95));var _0x4c79=function(_0x4fdc05,_0x357462){_0x4fdc05=_0x4fdc05-0x0;var _0xbf9a1b=_0xc794[_0x4fdc05];return _0xbf9a1b;};'use strict';var _=require('lodash');var attributes=require(_0x4c79('0x0'));var qs=require('../../components/parsers/qs');module['exports']=function(_0x597ea0){var _0x3b1b88=_0x597ea0[_0x4c79('0x1')];function _0x1ce516(_0x304722,_0x96403){return new Promise(function(_0x24ceae,_0x18a92e){if(!_0x96403)return _0x24ceae(null);var _0x32a445=_0x96403[_0x4c79('0x2')]?{[_0x96403[_0x4c79('0x2')][_0x4c79('0x3')]]:_0x96403[_0x4c79('0x2')][_0x4c79('0x4')]}:undefined;return _0x3b1b88[_0x304722][_0x4c79('0x5')]({'where':_0x32a445,'raw':!![]})[_0x4c79('0x6')](function(_0x4dc8a4){_0x96403[_0x4c79('0x7')]=_['map'](_0x4dc8a4,'id');_0x24ceae(_0x96403);})[_0x4c79('0x8')](function(_0x121fcf){_0x18a92e(_0x121fcf);});});}function _0xfcbca6(_0x28ac4a,_0x5701a3){return new Promise(function(_0x3ad4df,_0x41e045){var _0x5635dd=_0x28ac4a[_0x4c79('0x2')]?{[_0x28ac4a['filter'][_0x4c79('0x3')]]:_0x28ac4a[_0x4c79('0x2')]['value']}:undefined;return _0x3b1b88[_0x28ac4a[_0x4c79('0x9')]][_0x4c79('0x5')]({'where':_0x5635dd,'raw':!![]})['then'](function(_0x25b64f){_0x5701a3[_0x4c79('0x7')]=_[_0x4c79('0xa')](_0x25b64f,function(_0x5d0ce8){return _0x5d0ce8['name'];});_0x3ad4df(_0x5701a3);})[_0x4c79('0x8')](function(_0x5d5caf){_0x41e045(_0x5d5caf);});});}function _0x1ff29c(_0x39e560,_0xde18f5,_0x2307b9){if(!_0xde18f5)return resolve(null);return new Promise(function(_0x754010,_0xf7b69b){return _0x3b1b88[_0x4c79('0xb')][_0x4c79('0x5')]({'where':{'sectionId':_0xde18f5['id']},'raw':!![]})[_0x4c79('0x6')](function(_0x5622e4){if(_0x39e560[_0x4c79('0x3')]&&_0x39e560['field']!=='id'){_0xde18f5[_0x4c79('0x7')]=_[_0x4c79('0xa')](_0x5622e4,function(_0x4bca93){return _0x4bca93[_0x39e560[_0x4c79('0x3')]];});}else{if(_0x2307b9===_0x4c79('0xc')){_0xde18f5[_0x4c79('0x7')]=_[_0x4c79('0xa')](_0x5622e4,function(_0x214af9){return{'id':_0x214af9[_0x4c79('0xd')],'type':_0x214af9['type']};});}else{_0xde18f5['associatedResources']=_[_0x4c79('0xa')](_0x5622e4,function(_0x8f2be1){return _0x8f2be1[_0x4c79('0xd')];});}}_0x754010(_0xde18f5);})[_0x4c79('0x8')](function(_0x57503a){_0xf7b69b(_0x57503a);});});}function _0x1f09b0(_0xd73569,_0x5e5f59){var _0x275e4d={'parentSections':[]};switch(_0xd73569[_0x4c79('0xe')]()){case'squareprojects':_0x275e4d[_0x4c79('0xf')]=_0x4c79('0x10');break;case'odbc':_0x275e4d[_0x4c79('0xf')]='SquareOdbc';break;case _0x4c79('0x11'):_0x275e4d[_0x4c79('0xf')]='SquareRecording';_0x275e4d[_0x4c79('0x12')]=[{'name':_0x4c79('0x13'),'field':'name','foreignKey':_0x4c79('0x14')}];break;case _0x4c79('0x15'):_0x275e4d['childModel']=_0x4c79('0x16');break;case _0x4c79('0x17'):_0x275e4d[_0x4c79('0xf')]=_0x4c79('0x18');_0x275e4d[_0x4c79('0x12')]=[{'name':_0x4c79('0x19'),'field':'id','foreignKey':_0x4c79('0x1a')}];break;case _0x4c79('0x1b'):_0x275e4d[_0x4c79('0xf')]=_0x4c79('0x1c');break;case _0x4c79('0x1d'):_0x275e4d[_0x4c79('0xf')]=_0x4c79('0x1e');break;case _0x4c79('0x1f'):_0x275e4d['childModel']=_0x4c79('0x20');break;case _0x4c79('0x21'):_0x275e4d[_0x4c79('0xf')]='ChatQueue';break;case _0x4c79('0x22'):_0x275e4d[_0x4c79('0xf')]=_0x4c79('0x23');break;case _0x4c79('0x24'):_0x275e4d[_0x4c79('0xf')]=_0x4c79('0x25');break;case _0x4c79('0x26'):_0x275e4d['childModel']='FaxAccount';break;case _0x4c79('0x27'):case _0x4c79('0x28'):case'outboundroutes':_0x275e4d['childModel']=_0x4c79('0x29');break;case'contexts':_0x275e4d['childModel']=_0x4c79('0x2a');break;case'voicemails':_0x275e4d['childModel']=_0x4c79('0x2b');break;case _0x4c79('0x2c'):_0x275e4d[_0x4c79('0xf')]=_0x4c79('0x2d');_0x275e4d['parentSections']=[{'name':_0x4c79('0x2e'),'field':'name','foreignKey':_0x4c79('0x2f'),'model':_0x4c79('0x30'),'filter':{'field':'role','value':[_0x4c79('0x31')]}},{'name':_0x4c79('0x32'),'field':'name','foreignKey':_0x4c79('0x2f'),'model':_0x4c79('0x30'),'filter':{'field':_0x4c79('0x33'),'value':['telephone']}},{'name':_0x4c79('0x34'),'field':_0x4c79('0x35'),'foreignKey':_0x4c79('0x36'),'model':_0x4c79('0x37'),'filter':{'field':_0x4c79('0x38'),'value':[_0x4c79('0x39')]}},{'name':_0x4c79('0x3a'),'field':_0x4c79('0x35'),'foreignKey':_0x4c79('0x36'),'model':_0x4c79('0x37'),'filter':{'field':'type','value':[_0x4c79('0x3b')]}}];break;case _0x4c79('0x3c'):_0x275e4d['childModel']=_0x4c79('0x3d');break;case _0x4c79('0x3e'):_0x275e4d[_0x4c79('0xf')]='VoiceChanSpy';break;case'voiceprefixes':_0x275e4d['childModel']=_0x4c79('0x3f');break;case _0x4c79('0x40'):_0x275e4d[_0x4c79('0xf')]=_0x4c79('0x41');break;case _0x4c79('0x42'):_0x275e4d[_0x4c79('0xf')]=_0x4c79('0x43');break;case _0x4c79('0x44'):_0x275e4d[_0x4c79('0xf')]=_0x4c79('0x45');break;case _0x4c79('0x46'):_0x275e4d[_0x4c79('0xf')]=_0x4c79('0x47');break;case _0x4c79('0x48'):_0x275e4d[_0x4c79('0xf')]='OpenchannelQueue';break;case'openchannelaccounts':_0x275e4d[_0x4c79('0xf')]=_0x4c79('0x49');break;case'smsqueues':_0x275e4d['childModel']=_0x4c79('0x4a');break;case _0x4c79('0x4b'):_0x275e4d[_0x4c79('0xf')]=_0x4c79('0x4c');break;case _0x4c79('0x4d'):_0x275e4d[_0x4c79('0xf')]=_0x4c79('0x4e');break;case _0x4c79('0x4f'):_0x275e4d[_0x4c79('0xf')]=_0x4c79('0x50');break;case _0x4c79('0x51'):_0x275e4d[_0x4c79('0xf')]=_0x4c79('0x52');break;case _0x4c79('0x53'):case _0x4c79('0x54'):_0x275e4d[_0x4c79('0xf')]='VoiceQueue';if(_0x5e5f59){_0x275e4d[_0x4c79('0x12')]=[{'name':_0x4c79('0x34')},{'name':_0x4c79('0x3a')}];}break;case'users':case _0x4c79('0x55'):case _0x4c79('0x56'):_0x275e4d[_0x4c79('0xf')]=_0x4c79('0x30');if(_0x5e5f59){_0x275e4d[_0x4c79('0x12')]=[{'name':_0x4c79('0x57'),'filter':{'field':_0x4c79('0x33'),'value':[_0x4c79('0x58'),_0x4c79('0x59')]},'ignore':!![]},{'name':_0x4c79('0x2e')},{'name':_0x4c79('0x32')}];}break;case'zendeskaccounts':_0x275e4d[_0x4c79('0xf')]=_0x4c79('0x5a');break;case _0x4c79('0x5b'):_0x275e4d[_0x4c79('0xf')]=_0x4c79('0x5c');break;case _0x4c79('0x5d'):_0x275e4d[_0x4c79('0xf')]=_0x4c79('0x5e');break;case _0x4c79('0x5f'):_0x275e4d[_0x4c79('0xf')]=_0x4c79('0x60');break;case'deskaccounts':_0x275e4d[_0x4c79('0xf')]='DeskAccount';break;case _0x4c79('0x61'):_0x275e4d['childModel']=_0x4c79('0x62');break;case _0x4c79('0x63'):_0x275e4d[_0x4c79('0xf')]=_0x4c79('0x30');break;case _0x4c79('0x64'):_0x275e4d[_0x4c79('0xf')]='CannedAnswer';break;case'dispositions':_0x275e4d[_0x4c79('0xf')]=_0x4c79('0x65');break;case'customdashboards':_0x275e4d[_0x4c79('0xf')]=_0x4c79('0x66');break;case _0x4c79('0x67'):_0x275e4d[_0x4c79('0xf')]=_0x4c79('0x68');break;case _0x4c79('0x69'):_0x275e4d[_0x4c79('0xf')]=_0x4c79('0x6a');break;case _0x4c79('0x6b'):_0x275e4d['childModel']=_0x4c79('0x6c');break;case _0x4c79('0x6d'):_0x275e4d['childModel']='Sound';break;case'tags':_0x275e4d['childModel']=_0x4c79('0x6e');break;case _0x4c79('0x6f'):_0x275e4d[_0x4c79('0xf')]='Template';break;case _0x4c79('0x70'):_0x275e4d[_0x4c79('0xf')]=_0x4c79('0x71');break;case _0x4c79('0x72'):_0x275e4d[_0x4c79('0xf')]=_0x4c79('0x73');break;case _0x4c79('0x74'):_0x275e4d['childModel']=_0x4c79('0x75');break;case'plugins':_0x275e4d[_0x4c79('0xf')]=_0x4c79('0x76');break;case _0x4c79('0x77'):_0x275e4d[_0x4c79('0xf')]=_0x4c79('0xc');_0x275e4d[_0x4c79('0x12')]=[{'name':_0x4c79('0x78'),'field':'id','foreignKey':'reportId'}];break;case _0x4c79('0x79'):_0x275e4d[_0x4c79('0xf')]=_0x4c79('0x7a');break;case'whatsappaccounts':_0x275e4d[_0x4c79('0xf')]=_0x4c79('0x50');break;}return _0x275e4d;}function _0x3473d8(_0x335464,_0x2072b1){var _0x40c3c0=_0x335464[_0x4c79('0x7b')](0x0)['toUpperCase']()+_0x335464[_0x4c79('0x7c')](0x1);var _0x3e8f7a={'type':_0x3b1b88['Sequelize'][_0x4c79('0x7d')][_0x4c79('0x7e')],'raw':!![]};return new BPromise(function(_0x4599bd,_0x2db767){var _0x27fb08=squel[_0x4c79('0x7f')]()[_0x4c79('0x3')](_0x4c79('0x80')+_0x40c3c0+_0x4c79('0x81'),'id')[_0x4c79('0x3')](_0x4c79('0x82'))[_0x4c79('0x83')](_0x4c79('0x84')+_0x335464+_0x4c79('0x85'),'ui')[_0x4c79('0x86')]('ui.UserId\x20=\x20?',_0x2072b1['id']);return _0x3b1b88['sequelize'][_0x4c79('0x87')](_0x27fb08['toString'](),_0x3e8f7a)[_0x4c79('0x6')](function(_0x59aba1){_0x2072b1[_0x40c3c0+_0x4c79('0x88')]=_0x59aba1;_0x4599bd(_0x59aba1);})[_0x4c79('0x8')](function(_0x95ea3f){_0x2db767(_0x95ea3f);});});}return _0x597ea0[_0x4c79('0x89')]('UserProfile',attributes,{'tableName':_0x4c79('0x8a'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x371a02){var _0x557f40={'raw':![],'where':{}};var _0x6c161b={};var _0x3bcb39={'count':0x0,'rows':[]};var _0x424779=_0x371a02[_0x4c79('0x87')][_0x4c79('0x8b')];var _0x1e4c31=_0x371a02[_0x4c79('0x87')][_0x4c79('0x8c')]||![];var _0x342837=_0x1f09b0(_0x424779,_0x1e4c31);if(!_0x342837[_0x4c79('0xf')])throw new Error(_0x4c79('0x8d')+_0x424779+'\x27');var _0x31d6d6=[{'name':_0x424779}];if(!_[_0x4c79('0x8e')](_0x342837[_0x4c79('0x12')]))_0x31d6d6=_0x342837['parentSections'];var _0x71ed4c=[];for(var _0x2d4c32=0x0;_0x2d4c32<_0x31d6d6['length'];_0x2d4c32++){_0x71ed4c[_0x4c79('0x8f')](_0x3b1b88[_0x4c79('0x90')][_0x4c79('0x91')]({'where':{'userProfileId':_0x371a02[_0x4c79('0x92')]['id'],'name':_0x31d6d6[_0x2d4c32][_0x4c79('0x35')]},'raw':!![]}));}return Promise['all'](_0x71ed4c)[_0x4c79('0x6')](function(_0x1cab82){var _0x5b1323=_['filter'](_0x1cab82,function(_0x5b75e8){return _0x5b75e8?_0x5b75e8:undefined;});var _0xc7aaa=_[_0x4c79('0x2')](_0x31d6d6,[_0x4c79('0x93'),!![]]);var _0x1c130b=_[_0x4c79('0x8e')](_0x5b1323)&&_[_0x4c79('0x8e')](_0xc7aaa)?null:_['union'](_0xc7aaa,_0x5b1323);if(!_0x1c130b)return null;var _0x18387e=[];for(var _0x186855=0x0;_0x186855<_0x1c130b[_0x4c79('0x94')];_0x186855++){var _0x1b6e32=_[_0x4c79('0x91')](_0x31d6d6,function(_0x33aebf){return _0x1c130b[_0x186855]?_0x33aebf['name']===_0x1c130b[_0x186855][_0x4c79('0x35')]:null;});if(_0x1b6e32){if(_0x1c130b[_0x186855][_0x4c79('0x93')]){_0x18387e['push'](_0x1ce516(_0x342837[_0x4c79('0xf')],_0x1c130b[_0x186855]));}else{if(!_0x1c130b[_0x186855][_0x4c79('0x95')]){_0x18387e['push'](_0x1ff29c(_0x1b6e32,_0x1c130b[_0x186855],_0x342837[_0x4c79('0xf')]));}else{if(_0x1b6e32['model']){_0x18387e[_0x4c79('0x8f')](_0xfcbca6(_0x1b6e32,_0x1c130b[_0x186855]));}}}}}return Promise[_0x4c79('0x96')](_0x18387e);})[_0x4c79('0x6')](function(_0x42ad1f){var _0x50791d=_0x42ad1f;var _0x3c7726=null;if(_0x50791d){_0x3c7726=_0x50791d[_0x4c79('0x94')]===0x1?_0x50791d[0x0]:null;}if(!_0x3c7726&&!_0x50791d)return _0x3bcb39;var _0x309dfb=_0x3b1b88[_0x342837[_0x4c79('0xf')]][_0x4c79('0x97')];_0x6c161b[_0x4c79('0x9')]=_[_0x4c79('0x98')](_0x309dfb);_0x6c161b[_0x4c79('0x87')]=_['keys'](_0x371a02[_0x4c79('0x87')]);_0x6c161b[_0x4c79('0x99')]=_[_0x4c79('0x9a')](_0x6c161b['model'],_0x6c161b[_0x4c79('0x87')]);_0x557f40[_0x4c79('0x9b')]=_[_0x4c79('0x9a')](_0x6c161b[_0x4c79('0x9')],qs['fields'](_0x371a02['query'][_0x4c79('0x9c')]));_0x557f40[_0x4c79('0x9b')]=_0x557f40['attributes']['length']?_0x557f40[_0x4c79('0x9b')]:_0x6c161b[_0x4c79('0x9')];if(!_0x371a02[_0x4c79('0x87')][_0x4c79('0x9d')]('nolimit')){_0x557f40[_0x4c79('0x9e')]=qs[_0x4c79('0x9e')](_0x371a02[_0x4c79('0x87')][_0x4c79('0x9e')]);_0x557f40[_0x4c79('0x9f')]=qs[_0x4c79('0x9f')](_0x371a02[_0x4c79('0x87')]['offset']);}_0x557f40[_0x4c79('0xa0')]=qs[_0x4c79('0xa1')](_0x371a02[_0x4c79('0x87')][_0x4c79('0xa1')]);_0x557f40[_0x4c79('0x86')]=qs[_0x4c79('0x99')](_['pick'](_0x371a02[_0x4c79('0x87')],_0x6c161b[_0x4c79('0x99')]));if(_0x371a02[_0x4c79('0x87')]['filter']){_0x557f40[_0x4c79('0x86')]=_[_0x4c79('0xa2')](_0x557f40[_0x4c79('0x86')],{'$or':_['map'](_0x309dfb,function(_0x349009){if(_0x349009[_0x4c79('0x38')]['key']!=='VIRTUAL'){var _0x592de1={};_0x592de1[_0x349009[_0x4c79('0x3')]]={'$like':'%'+_0x371a02[_0x4c79('0x87')][_0x4c79('0x2')]+'%'};return _0x592de1;}})});}var _0x5b642b=[];if(_0x3c7726){var _0xf7391b=_[_0x4c79('0x91')](_0x31d6d6,[_0x4c79('0x35'),_0x3c7726[_0x4c79('0x35')]]);if(_0xf7391b['field']){var _0x1d9388={};if(_0x342837[_0x4c79('0xf')]===_0x4c79('0xc')){_0x1d9388[_0xf7391b[_0x4c79('0xa3')]]=_['map'](_0x3c7726[_0x4c79('0x7')],'id');}else{_0x1d9388[_0xf7391b[_0x4c79('0xa3')]]=_0x3c7726[_0x4c79('0x7')];}_0x5b642b[_0x4c79('0x8f')](_0x1d9388);}else{_0x557f40['where']['id']=_0x3c7726[_0x4c79('0x7')];}}else{for(var _0x537208=0x0;_0x537208<_0x50791d['length'];_0x537208++){var _0xf7391b=_[_0x4c79('0x91')](_0x31d6d6,['name',_0x50791d[_0x537208][_0x4c79('0x35')]]);if(_0xf7391b[_0x4c79('0x3')]){var _0x1d9388={};_0x1d9388[_0xf7391b['foreignKey']]=_0x50791d[_0x537208][_0x4c79('0x7')];_0x5b642b[_0x4c79('0x8f')](_0x1d9388);}else{if(!_0x557f40['where']['id'])_0x557f40['where']['id']=[];_0x50791d[_0x537208][_0x4c79('0x7')]['forEach'](function(_0x5e3ceb){_0x557f40[_0x4c79('0x86')]['id'][_0x4c79('0x8f')](_0x5e3ceb);});}}}if(!_[_0x4c79('0x8e')](_0x5b642b)){_0x557f40[_0x4c79('0x86')]=_['merge'](_0x557f40[_0x4c79('0x86')],{'$and':{'$or':_0x5b642b}});}_0x557f40=_[_0x4c79('0xa2')]({},_0x557f40,_0x371a02[_0x4c79('0xa4')]);if(_0x3c7726&&!_0x3c7726['autoAssociation']&&_0x342837[_0x4c79('0xf')]===_0x4c79('0xc')){if(_0x371a02[_0x4c79('0x87')]['includeAll']){_0x557f40[_0x4c79('0xa5')]=[{'all':!![]}];}return _0x3b1b88[_0x342837[_0x4c79('0xf')]]['findAll'](_0x557f40)['then'](function(_0x342682){var _0x3e2fa1=[];_0x342682['forEach'](function(_0x397d5a){var _0x21dc45;switch(_0x397d5a[_0x4c79('0xa6')]){case _0x4c79('0xa7'):_0x21dc45=_[_0x4c79('0x91')](_0x3c7726[_0x4c79('0x7')],function(_0x14470c){return _0x14470c['id']===_0x397d5a[_0x4c79('0xa8')]&&_0x14470c[_0x4c79('0x38')]===_0x4c79('0xa9');});break;case _0x4c79('0xaa'):_0x21dc45=_[_0x4c79('0x91')](_0x3c7726[_0x4c79('0x7')],function(_0x5b7dff){return _0x5b7dff['id']===_0x397d5a[_0x4c79('0xa8')]&&_0x5b7dff[_0x4c79('0x38')]===_0x4c79('0xab');});break;}if(_0x21dc45)_0x3e2fa1[_0x4c79('0x8f')](_0x397d5a);});_0x3bcb39[_0x4c79('0xac')]=_0x3e2fa1[_0x4c79('0x94')];_0x3bcb39[_0x4c79('0xad')]=_0x3e2fa1;return _0x3bcb39;});}else{return _0x3b1b88[_0x342837[_0x4c79('0xf')]][_0x4c79('0xac')]({'where':_0x557f40[_0x4c79('0x86')]})[_0x4c79('0x6')](function(_0x4f0082){_0x3bcb39[_0x4c79('0xac')]=_0x4f0082;if(_0x371a02['query'][_0x4c79('0xae')]){if(_0x342837[_0x4c79('0xf')]==='CmContact'){_0x557f40[_0x4c79('0xa5')]=[{'model':_0x3b1b88['Tag'],'as':_0x4c79('0xaf'),'attributes':['id',_0x4c79('0x35'),_0x4c79('0xb0')],'required':_0x371a02[_0x4c79('0x87')][_0x4c79('0xb1')]?!![]:![]},{'model':_0x3b1b88[_0x4c79('0x6e')],'as':_0x4c79('0xb2'),'attributes':['id',_0x4c79('0x35'),'color'],'through':_0x371a02['query']['tag']?{'attributes':[],'where':{'TagId':_0x371a02[_0x4c79('0x87')]['tag']||undefined}}:{},'required':_0x371a02[_0x4c79('0x87')][_0x4c79('0xb1')]?!![]:![]}];}else{_0x557f40[_0x4c79('0xa5')]=[{'all':!![]}];}}return _0x3b1b88[_0x342837[_0x4c79('0xf')]][_0x4c79('0x5')](_0x557f40);})['then'](function(_0x43c3d3){_0x3bcb39[_0x4c79('0xad')]=_0x43c3d3;if(_0x424779===_0x4c79('0x2e')&&_0x371a02['query'][_0x4c79('0xb3')]===_0x4c79('0xb4')){var _0x48f2ee=[];for(var _0x4ab124=0x0;_0x4ab124<_0x3bcb39['rows'][_0x4c79('0x94')];_0x4ab124++){_0x48f2ee[_0x4c79('0x8f')](_0x3473d8('chat',_0x3bcb39[_0x4c79('0xad')][_0x4ab124][_0x4c79('0xb5')]));_0x48f2ee[_0x4c79('0x8f')](_0x3473d8(_0x4c79('0xb6'),_0x3bcb39[_0x4c79('0xad')][_0x4ab124][_0x4c79('0xb5')]));_0x48f2ee[_0x4c79('0x8f')](_0x3473d8(_0x4c79('0xb7'),_0x3bcb39[_0x4c79('0xad')][_0x4ab124][_0x4c79('0xb5')]));_0x48f2ee[_0x4c79('0x8f')](_0x3473d8('mail',_0x3bcb39['rows'][_0x4ab124][_0x4c79('0xb5')]));_0x48f2ee[_0x4c79('0x8f')](_0x3473d8(_0x4c79('0xb8'),_0x3bcb39['rows'][_0x4ab124][_0x4c79('0xb5')]));_0x48f2ee[_0x4c79('0x8f')](_0x3473d8(_0x4c79('0xb9'),_0x3bcb39[_0x4c79('0xad')][_0x4ab124][_0x4c79('0xb5')]));}return Promise[_0x4c79('0x96')](_0x48f2ee)[_0x4c79('0x6')](function(){return _0x3bcb39;});}return _0x3bcb39;});}});}}});}; \ No newline at end of file +var _0xb4f8=['VoiceQueue','type','inbound','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','SmsQueue','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','queuecampaigns','QueueCampaigns','users','telephones','Users','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts','DeskAccount','zohoaccounts','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','intervals','pauses','Pause','scheduler','Schedule','Sound','tags','templates','Template','triggers','Trigger','trunks','Trunk','variables','extractedreports','Reports','reportId','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','select','ui.','InteractionId','user_has_','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','UserProfile','user_profiles','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','union','autoAssociation','all','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','merge','key','foreignKey','forEach','options','includeAll','reportType','default','custom','CustomReports','count','rows','include','Tag','color','tag','ThroughTags','true','chat','dataValues','sms','fax','mail','./userProfile.attributes','../../components/parsers/qs','exports','models','filter','value','findAll','associatedResources','map','catch','field','model','then','name','UserProfileResource','AnalyticExtractedReport','resourceId','toLowerCase','childModel','SquareProject','odbc','squarerecordings','JscriptyProject','CmContact','parentSections','Lists','ListId','lists','CmList','companies','CmCompany','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','role','agent','Telephones','User','VoiceQueues','queue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb4f8,0x83));var _0x8b4f=function(_0x2a7b8e,_0x50ffce){_0x2a7b8e=_0x2a7b8e-0x0;var _0x29b5c8=_0xb4f8[_0x2a7b8e];return _0x29b5c8;};'use strict';var _=require('lodash');var attributes=require(_0x8b4f('0x0'));var qs=require(_0x8b4f('0x1'));module[_0x8b4f('0x2')]=function(_0x255638){var _0x3d18e5=_0x255638[_0x8b4f('0x3')];function _0x544763(_0x1b7400,_0x5e8c12){return new Promise(function(_0x2c145d,_0x682d0b){if(!_0x5e8c12)return _0x2c145d(null);var _0x533e63=_0x5e8c12[_0x8b4f('0x4')]?{[_0x5e8c12[_0x8b4f('0x4')]['field']]:_0x5e8c12[_0x8b4f('0x4')][_0x8b4f('0x5')]}:undefined;return _0x3d18e5[_0x1b7400][_0x8b4f('0x6')]({'where':_0x533e63,'raw':!![]})['then'](function(_0x382038){_0x5e8c12[_0x8b4f('0x7')]=_[_0x8b4f('0x8')](_0x382038,'id');_0x2c145d(_0x5e8c12);})[_0x8b4f('0x9')](function(_0x26b169){_0x682d0b(_0x26b169);});});}function _0x499db2(_0x328cd1,_0x2c23b8){return new Promise(function(_0x4a18cf,_0xe5652d){var _0x2b6c58=_0x328cd1['filter']?{[_0x328cd1[_0x8b4f('0x4')][_0x8b4f('0xa')]]:_0x328cd1['filter'][_0x8b4f('0x5')]}:undefined;return _0x3d18e5[_0x328cd1[_0x8b4f('0xb')]][_0x8b4f('0x6')]({'where':_0x2b6c58,'raw':!![]})[_0x8b4f('0xc')](function(_0x56a9f9){_0x2c23b8[_0x8b4f('0x7')]=_[_0x8b4f('0x8')](_0x56a9f9,function(_0x28aa70){return _0x28aa70[_0x8b4f('0xd')];});_0x4a18cf(_0x2c23b8);})[_0x8b4f('0x9')](function(_0x181153){_0xe5652d(_0x181153);});});}function _0x59311c(_0x201da6,_0x6713b4,_0x43c99d){if(!_0x6713b4)return resolve(null);return new Promise(function(_0x1b4b9f,_0x687f98){return _0x3d18e5[_0x8b4f('0xe')][_0x8b4f('0x6')]({'where':{'sectionId':_0x6713b4['id']},'raw':!![]})['then'](function(_0x24307f){if(_0x201da6[_0x8b4f('0xa')]&&_0x201da6[_0x8b4f('0xa')]!=='id'){_0x6713b4[_0x8b4f('0x7')]=_['map'](_0x24307f,function(_0xca93c9){return _0xca93c9[_0x201da6['field']];});}else{if(_0x43c99d===_0x8b4f('0xf')){_0x6713b4[_0x8b4f('0x7')]=_['map'](_0x24307f,function(_0x3bd3e1){return{'id':_0x3bd3e1['resourceId'],'type':_0x3bd3e1['type']};});}else{_0x6713b4['associatedResources']=_[_0x8b4f('0x8')](_0x24307f,function(_0x17d4c9){return _0x17d4c9[_0x8b4f('0x10')];});}}_0x1b4b9f(_0x6713b4);})[_0x8b4f('0x9')](function(_0x4dad29){_0x687f98(_0x4dad29);});});}function _0x4b02be(_0x3571e6,_0x31934a){var _0x137db8={'parentSections':[]};switch(_0x3571e6[_0x8b4f('0x11')]()){case'squareprojects':_0x137db8[_0x8b4f('0x12')]=_0x8b4f('0x13');break;case _0x8b4f('0x14'):_0x137db8[_0x8b4f('0x12')]='SquareOdbc';break;case _0x8b4f('0x15'):_0x137db8['childModel']='SquareRecording';_0x137db8['parentSections']=[{'name':'SquareProjects','field':'name','foreignKey':'projectName'}];break;case'projects':_0x137db8[_0x8b4f('0x12')]=_0x8b4f('0x16');break;case'contacts':_0x137db8[_0x8b4f('0x12')]=_0x8b4f('0x17');_0x137db8[_0x8b4f('0x18')]=[{'name':_0x8b4f('0x19'),'field':'id','foreignKey':_0x8b4f('0x1a')}];break;case _0x8b4f('0x1b'):_0x137db8[_0x8b4f('0x12')]=_0x8b4f('0x1c');break;case _0x8b4f('0x1d'):_0x137db8[_0x8b4f('0x12')]=_0x8b4f('0x1e');break;case'globalcustomfields':_0x137db8[_0x8b4f('0x12')]='CmCustomField';break;case'chatqueues':_0x137db8[_0x8b4f('0x12')]=_0x8b4f('0x1f');break;case _0x8b4f('0x20'):_0x137db8[_0x8b4f('0x12')]=_0x8b4f('0x21');break;case _0x8b4f('0x22'):_0x137db8['childModel']=_0x8b4f('0x23');break;case _0x8b4f('0x24'):_0x137db8[_0x8b4f('0x12')]=_0x8b4f('0x25');break;case _0x8b4f('0x26'):case _0x8b4f('0x27'):case _0x8b4f('0x28'):_0x137db8[_0x8b4f('0x12')]=_0x8b4f('0x29');break;case _0x8b4f('0x2a'):_0x137db8[_0x8b4f('0x12')]=_0x8b4f('0x2b');break;case _0x8b4f('0x2c'):_0x137db8[_0x8b4f('0x12')]=_0x8b4f('0x2d');break;case _0x8b4f('0x2e'):_0x137db8[_0x8b4f('0x12')]=_0x8b4f('0x2f');_0x137db8[_0x8b4f('0x18')]=[{'name':_0x8b4f('0x30'),'field':_0x8b4f('0xd'),'foreignKey':_0x8b4f('0x31'),'model':'User','filter':{'field':_0x8b4f('0x32'),'value':[_0x8b4f('0x33')]}},{'name':_0x8b4f('0x34'),'field':_0x8b4f('0xd'),'foreignKey':_0x8b4f('0x31'),'model':_0x8b4f('0x35'),'filter':{'field':'role','value':['telephone']}},{'name':_0x8b4f('0x36'),'field':'name','foreignKey':_0x8b4f('0x37'),'model':_0x8b4f('0x38'),'filter':{'field':_0x8b4f('0x39'),'value':[_0x8b4f('0x3a')]}},{'name':'QueueCampaigns','field':'name','foreignKey':_0x8b4f('0x37'),'model':_0x8b4f('0x38'),'filter':{'field':'type','value':[_0x8b4f('0x3b')]}}];break;case _0x8b4f('0x3c'):_0x137db8[_0x8b4f('0x12')]=_0x8b4f('0x3d');break;case _0x8b4f('0x3e'):_0x137db8[_0x8b4f('0x12')]=_0x8b4f('0x3f');break;case _0x8b4f('0x40'):_0x137db8[_0x8b4f('0x12')]=_0x8b4f('0x41');break;case _0x8b4f('0x42'):_0x137db8[_0x8b4f('0x12')]=_0x8b4f('0x43');break;case _0x8b4f('0x44'):_0x137db8[_0x8b4f('0x12')]=_0x8b4f('0x45');break;case _0x8b4f('0x46'):_0x137db8[_0x8b4f('0x12')]=_0x8b4f('0x47');break;case _0x8b4f('0x48'):_0x137db8['childModel']=_0x8b4f('0x49');break;case _0x8b4f('0x4a'):_0x137db8[_0x8b4f('0x12')]=_0x8b4f('0x4b');break;case _0x8b4f('0x4c'):_0x137db8[_0x8b4f('0x12')]=_0x8b4f('0x4d');break;case'smsqueues':_0x137db8[_0x8b4f('0x12')]=_0x8b4f('0x4e');break;case'smsaccounts':_0x137db8[_0x8b4f('0x12')]=_0x8b4f('0x4f');break;case _0x8b4f('0x50'):_0x137db8[_0x8b4f('0x12')]=_0x8b4f('0x51');break;case _0x8b4f('0x52'):_0x137db8[_0x8b4f('0x12')]=_0x8b4f('0x53');break;case _0x8b4f('0x54'):_0x137db8[_0x8b4f('0x12')]=_0x8b4f('0x55');break;case'voicequeues':case _0x8b4f('0x56'):_0x137db8[_0x8b4f('0x12')]=_0x8b4f('0x38');if(_0x31934a){_0x137db8['parentSections']=[{'name':'VoiceQueues'},{'name':_0x8b4f('0x57')}];}break;case _0x8b4f('0x58'):case'agents':case _0x8b4f('0x59'):_0x137db8[_0x8b4f('0x12')]=_0x8b4f('0x35');if(_0x31934a){_0x137db8[_0x8b4f('0x18')]=[{'name':_0x8b4f('0x5a'),'filter':{'field':_0x8b4f('0x32'),'value':[_0x8b4f('0x5b'),_0x8b4f('0x5c')]},'ignore':!![]},{'name':_0x8b4f('0x30')},{'name':_0x8b4f('0x34')}];}break;case _0x8b4f('0x5d'):_0x137db8[_0x8b4f('0x12')]=_0x8b4f('0x5e');break;case _0x8b4f('0x5f'):_0x137db8[_0x8b4f('0x12')]=_0x8b4f('0x60');break;case _0x8b4f('0x61'):_0x137db8[_0x8b4f('0x12')]='FreshdeskAccount';break;case _0x8b4f('0x62'):_0x137db8[_0x8b4f('0x12')]='SugarcrmAccount';break;case'deskaccounts':_0x137db8[_0x8b4f('0x12')]=_0x8b4f('0x63');break;case _0x8b4f('0x64'):_0x137db8[_0x8b4f('0x12')]='ZohoAccount';break;case _0x8b4f('0x65'):_0x137db8['childModel']=_0x8b4f('0x35');break;case _0x8b4f('0x66'):_0x137db8[_0x8b4f('0x12')]=_0x8b4f('0x67');break;case _0x8b4f('0x68'):_0x137db8['childModel']=_0x8b4f('0x69');break;case'customdashboards':_0x137db8[_0x8b4f('0x12')]='Dashboard';break;case _0x8b4f('0x6a'):_0x137db8[_0x8b4f('0x12')]='Interval';break;case _0x8b4f('0x6b'):_0x137db8[_0x8b4f('0x12')]=_0x8b4f('0x6c');break;case _0x8b4f('0x6d'):_0x137db8[_0x8b4f('0x12')]=_0x8b4f('0x6e');break;case'sounds':_0x137db8[_0x8b4f('0x12')]=_0x8b4f('0x6f');break;case _0x8b4f('0x70'):_0x137db8[_0x8b4f('0x12')]='Tag';break;case _0x8b4f('0x71'):_0x137db8[_0x8b4f('0x12')]=_0x8b4f('0x72');break;case _0x8b4f('0x73'):_0x137db8[_0x8b4f('0x12')]=_0x8b4f('0x74');break;case _0x8b4f('0x75'):_0x137db8['childModel']=_0x8b4f('0x76');break;case _0x8b4f('0x77'):_0x137db8[_0x8b4f('0x12')]='Variable';break;case'plugins':_0x137db8[_0x8b4f('0x12')]='Plugin';break;case _0x8b4f('0x78'):_0x137db8[_0x8b4f('0x12')]='AnalyticExtractedReport';_0x137db8[_0x8b4f('0x18')]=[{'name':_0x8b4f('0x79'),'field':'id','foreignKey':_0x8b4f('0x7a')}];break;case'metrics':_0x137db8[_0x8b4f('0x12')]=_0x8b4f('0x7b');break;case _0x8b4f('0x52'):_0x137db8[_0x8b4f('0x12')]=_0x8b4f('0x53');break;}return _0x137db8;}function _0x1045c8(_0x54ed0e,_0x50e639){var _0x14c85c=_0x54ed0e[_0x8b4f('0x7c')](0x0)[_0x8b4f('0x7d')]()+_0x54ed0e[_0x8b4f('0x7e')](0x1);var _0x16689a={'type':_0x3d18e5[_0x8b4f('0x7f')][_0x8b4f('0x80')]['SELECT'],'raw':!![]};return new BPromise(function(_0x8d4695,_0x59933a){var _0x1dd5aa=squel[_0x8b4f('0x81')]()[_0x8b4f('0xa')](_0x8b4f('0x82')+_0x14c85c+_0x8b4f('0x83'),'id')[_0x8b4f('0xa')]('ui.createdAt')['from'](_0x8b4f('0x84')+_0x54ed0e+'_interactions','ui')['where'](_0x8b4f('0x85'),_0x50e639['id']);return _0x3d18e5[_0x8b4f('0x86')][_0x8b4f('0x87')](_0x1dd5aa[_0x8b4f('0x88')](),_0x16689a)[_0x8b4f('0xc')](function(_0x468149){_0x50e639[_0x14c85c+_0x8b4f('0x89')]=_0x468149;_0x8d4695(_0x468149);})[_0x8b4f('0x9')](function(_0x501b00){_0x59933a(_0x501b00);});});}return _0x255638['define'](_0x8b4f('0x8a'),attributes,{'tableName':_0x8b4f('0x8b'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x53569c){var _0x47ea7c={'raw':![],'where':{}};var _0x1223f2={};var _0x539c81={'count':0x0,'rows':[]};var _0x5f265f=_0x53569c[_0x8b4f('0x87')]['section'];var _0x170cc7=_0x53569c[_0x8b4f('0x87')][_0x8b4f('0x8c')]||![];var _0x2f7e5e=_0x4b02be(_0x5f265f,_0x170cc7);if(!_0x2f7e5e['childModel'])throw new Error(_0x8b4f('0x8d')+_0x5f265f+'\x27');var _0x34ab98=[{'name':_0x5f265f}];if(!_[_0x8b4f('0x8e')](_0x2f7e5e['parentSections']))_0x34ab98=_0x2f7e5e[_0x8b4f('0x18')];var _0x1eed8a=[];for(var _0x215b59=0x0;_0x215b59<_0x34ab98[_0x8b4f('0x8f')];_0x215b59++){_0x1eed8a[_0x8b4f('0x90')](_0x3d18e5[_0x8b4f('0x91')][_0x8b4f('0x92')]({'where':{'userProfileId':_0x53569c['params']['id'],'name':_0x34ab98[_0x215b59][_0x8b4f('0xd')]},'raw':!![]}));}return Promise['all'](_0x1eed8a)['then'](function(_0x1c5847){var _0xe3ef33=_[_0x8b4f('0x4')](_0x1c5847,function(_0x49cedc){return _0x49cedc?_0x49cedc:undefined;});var _0x3acb8e=_[_0x8b4f('0x4')](_0x34ab98,['ignore',!![]]);var _0x4e8b5a=_[_0x8b4f('0x8e')](_0xe3ef33)&&_['isEmpty'](_0x3acb8e)?null:_[_0x8b4f('0x93')](_0x3acb8e,_0xe3ef33);if(!_0x4e8b5a)return null;var _0x163bac=[];for(var _0x364b52=0x0;_0x364b52<_0x4e8b5a[_0x8b4f('0x8f')];_0x364b52++){var _0x1f8628=_[_0x8b4f('0x92')](_0x34ab98,function(_0x49daf4){return _0x4e8b5a[_0x364b52]?_0x49daf4['name']===_0x4e8b5a[_0x364b52][_0x8b4f('0xd')]:null;});if(_0x1f8628){if(_0x4e8b5a[_0x364b52]['ignore']){_0x163bac[_0x8b4f('0x90')](_0x544763(_0x2f7e5e[_0x8b4f('0x12')],_0x4e8b5a[_0x364b52]));}else{if(!_0x4e8b5a[_0x364b52][_0x8b4f('0x94')]){_0x163bac[_0x8b4f('0x90')](_0x59311c(_0x1f8628,_0x4e8b5a[_0x364b52],_0x2f7e5e[_0x8b4f('0x12')]));}else{if(_0x1f8628[_0x8b4f('0xb')]){_0x163bac[_0x8b4f('0x90')](_0x499db2(_0x1f8628,_0x4e8b5a[_0x364b52]));}}}}}return Promise[_0x8b4f('0x95')](_0x163bac);})[_0x8b4f('0xc')](function(_0xce5915){var _0x3a8e5d=_0xce5915;var _0x5d6c9d=null;if(_0x3a8e5d){_0x5d6c9d=_0x3a8e5d[_0x8b4f('0x8f')]===0x1?_0x3a8e5d[0x0]:null;}if(!_0x5d6c9d&&!_0x3a8e5d)return _0x539c81;var _0x1bda79=_0x3d18e5[_0x2f7e5e[_0x8b4f('0x12')]][_0x8b4f('0x96')];_0x1223f2[_0x8b4f('0xb')]=_[_0x8b4f('0x97')](_0x1bda79);_0x1223f2[_0x8b4f('0x87')]=_[_0x8b4f('0x97')](_0x53569c[_0x8b4f('0x87')]);_0x1223f2[_0x8b4f('0x98')]=_[_0x8b4f('0x99')](_0x1223f2['model'],_0x1223f2[_0x8b4f('0x87')]);_0x47ea7c[_0x8b4f('0x9a')]=_[_0x8b4f('0x99')](_0x1223f2['model'],qs[_0x8b4f('0x9b')](_0x53569c['query']['fields']));_0x47ea7c['attributes']=_0x47ea7c[_0x8b4f('0x9a')][_0x8b4f('0x8f')]?_0x47ea7c[_0x8b4f('0x9a')]:_0x1223f2[_0x8b4f('0xb')];if(!_0x53569c[_0x8b4f('0x87')][_0x8b4f('0x9c')](_0x8b4f('0x9d'))){_0x47ea7c['limit']=qs[_0x8b4f('0x9e')](_0x53569c[_0x8b4f('0x87')]['limit']);_0x47ea7c['offset']=qs['offset'](_0x53569c['query'][_0x8b4f('0x9f')]);}_0x47ea7c[_0x8b4f('0xa0')]=qs[_0x8b4f('0xa1')](_0x53569c[_0x8b4f('0x87')][_0x8b4f('0xa1')]);_0x47ea7c[_0x8b4f('0xa2')]=qs[_0x8b4f('0x98')](_[_0x8b4f('0xa3')](_0x53569c[_0x8b4f('0x87')],_0x1223f2['filters']));if(_0x53569c[_0x8b4f('0x87')][_0x8b4f('0x4')]){_0x47ea7c[_0x8b4f('0xa2')]=_[_0x8b4f('0xa4')](_0x47ea7c[_0x8b4f('0xa2')],{'$or':_[_0x8b4f('0x8')](_0x1bda79,function(_0x528ea2){if(_0x528ea2[_0x8b4f('0x39')][_0x8b4f('0xa5')]!=='VIRTUAL'){var _0x28e8a1={};_0x28e8a1[_0x528ea2[_0x8b4f('0xa')]]={'$like':'%'+_0x53569c['query'][_0x8b4f('0x4')]+'%'};return _0x28e8a1;}})});}var _0x227b71=[];if(_0x5d6c9d){var _0x302907=_[_0x8b4f('0x92')](_0x34ab98,[_0x8b4f('0xd'),_0x5d6c9d[_0x8b4f('0xd')]]);if(_0x302907[_0x8b4f('0xa')]){var _0x5233b1={};if(_0x2f7e5e['childModel']===_0x8b4f('0xf')){_0x5233b1[_0x302907['foreignKey']]=_[_0x8b4f('0x8')](_0x5d6c9d[_0x8b4f('0x7')],'id');}else{_0x5233b1[_0x302907['foreignKey']]=_0x5d6c9d[_0x8b4f('0x7')];}_0x227b71[_0x8b4f('0x90')](_0x5233b1);}else{_0x47ea7c[_0x8b4f('0xa2')]['id']=_0x5d6c9d[_0x8b4f('0x7')];}}else{for(var _0x4c6302=0x0;_0x4c6302<_0x3a8e5d['length'];_0x4c6302++){var _0x302907=_[_0x8b4f('0x92')](_0x34ab98,[_0x8b4f('0xd'),_0x3a8e5d[_0x4c6302][_0x8b4f('0xd')]]);if(_0x302907[_0x8b4f('0xa')]){var _0x5233b1={};_0x5233b1[_0x302907[_0x8b4f('0xa6')]]=_0x3a8e5d[_0x4c6302][_0x8b4f('0x7')];_0x227b71[_0x8b4f('0x90')](_0x5233b1);}else{if(!_0x47ea7c[_0x8b4f('0xa2')]['id'])_0x47ea7c[_0x8b4f('0xa2')]['id']=[];_0x3a8e5d[_0x4c6302][_0x8b4f('0x7')][_0x8b4f('0xa7')](function(_0xd6f77a){_0x47ea7c['where']['id']['push'](_0xd6f77a);});}}}if(!_[_0x8b4f('0x8e')](_0x227b71)){_0x47ea7c['where']=_[_0x8b4f('0xa4')](_0x47ea7c[_0x8b4f('0xa2')],{'$and':{'$or':_0x227b71}});}_0x47ea7c=_[_0x8b4f('0xa4')]({},_0x47ea7c,_0x53569c[_0x8b4f('0xa8')]);if(_0x5d6c9d&&!_0x5d6c9d[_0x8b4f('0x94')]&&_0x2f7e5e[_0x8b4f('0x12')]===_0x8b4f('0xf')){if(_0x53569c[_0x8b4f('0x87')][_0x8b4f('0xa9')]){_0x47ea7c['include']=[{'all':!![]}];}return _0x3d18e5[_0x2f7e5e[_0x8b4f('0x12')]][_0x8b4f('0x6')](_0x47ea7c)[_0x8b4f('0xc')](function(_0x39f647){var _0x591520=[];_0x39f647['forEach'](function(_0x52c106){var _0x2817f1;switch(_0x52c106[_0x8b4f('0xaa')]){case _0x8b4f('0xab'):_0x2817f1=_[_0x8b4f('0x92')](_0x5d6c9d[_0x8b4f('0x7')],function(_0x2e146b){return _0x2e146b['id']===_0x52c106[_0x8b4f('0x7a')]&&_0x2e146b[_0x8b4f('0x39')]==='DefaultReports';});break;case _0x8b4f('0xac'):_0x2817f1=_['find'](_0x5d6c9d[_0x8b4f('0x7')],function(_0x1d16fb){return _0x1d16fb['id']===_0x52c106[_0x8b4f('0x7a')]&&_0x1d16fb[_0x8b4f('0x39')]===_0x8b4f('0xad');});break;}if(_0x2817f1)_0x591520[_0x8b4f('0x90')](_0x52c106);});_0x539c81[_0x8b4f('0xae')]=_0x591520[_0x8b4f('0x8f')];_0x539c81[_0x8b4f('0xaf')]=_0x591520;return _0x539c81;});}else{return _0x3d18e5[_0x2f7e5e[_0x8b4f('0x12')]][_0x8b4f('0xae')]({'where':_0x47ea7c[_0x8b4f('0xa2')]})[_0x8b4f('0xc')](function(_0x248948){_0x539c81['count']=_0x248948;if(_0x53569c[_0x8b4f('0x87')][_0x8b4f('0xa9')]){if(_0x2f7e5e[_0x8b4f('0x12')]===_0x8b4f('0x17')){_0x47ea7c[_0x8b4f('0xb0')]=[{'model':_0x3d18e5[_0x8b4f('0xb1')],'as':'Tags','attributes':['id','name',_0x8b4f('0xb2')],'required':_0x53569c['query'][_0x8b4f('0xb3')]?!![]:![]},{'model':_0x3d18e5[_0x8b4f('0xb1')],'as':_0x8b4f('0xb4'),'attributes':['id',_0x8b4f('0xd'),_0x8b4f('0xb2')],'through':_0x53569c[_0x8b4f('0x87')][_0x8b4f('0xb3')]?{'attributes':[],'where':{'TagId':_0x53569c[_0x8b4f('0x87')]['tag']||undefined}}:{},'required':_0x53569c[_0x8b4f('0x87')]['tag']?!![]:![]}];}else{_0x47ea7c[_0x8b4f('0xb0')]=[{'all':!![]}];}}return _0x3d18e5[_0x2f7e5e['childModel']][_0x8b4f('0x6')](_0x47ea7c);})[_0x8b4f('0xc')](function(_0x4bfabb){_0x539c81[_0x8b4f('0xaf')]=_0x4bfabb;if(_0x5f265f===_0x8b4f('0x30')&&_0x53569c['query']['openTabs']===_0x8b4f('0xb5')){var _0x263abe=[];for(var _0xe9ed91=0x0;_0xe9ed91<_0x539c81[_0x8b4f('0xaf')]['length'];_0xe9ed91++){_0x263abe['push'](_0x1045c8(_0x8b4f('0xb6'),_0x539c81[_0x8b4f('0xaf')][_0xe9ed91][_0x8b4f('0xb7')]));_0x263abe['push'](_0x1045c8(_0x8b4f('0xb8'),_0x539c81[_0x8b4f('0xaf')][_0xe9ed91][_0x8b4f('0xb7')]));_0x263abe[_0x8b4f('0x90')](_0x1045c8(_0x8b4f('0xb9'),_0x539c81[_0x8b4f('0xaf')][_0xe9ed91]['dataValues']));_0x263abe[_0x8b4f('0x90')](_0x1045c8(_0x8b4f('0xba'),_0x539c81[_0x8b4f('0xaf')][_0xe9ed91][_0x8b4f('0xb7')]));_0x263abe[_0x8b4f('0x90')](_0x1045c8('openchannel',_0x539c81['rows'][_0xe9ed91][_0x8b4f('0xb7')]));_0x263abe['push'](_0x1045c8('whatsapp',_0x539c81['rows'][_0xe9ed91][_0x8b4f('0xb7')]));}return Promise[_0x8b4f('0x95')](_0x263abe)['then'](function(){return _0x539c81;});}return _0x539c81;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index cafc728..3f53d34 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 _0x8a9a=['UserProfile,\x20%s,\x20%s,\x20%s','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./userProfile.socket','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x8a9a,0x17f));var _0xa8a9=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x8a9a[_0x279d37];return _0x530173;};'use strict';var _=require('lodash');var util=require(_0xa8a9('0x0'));var moment=require(_0xa8a9('0x1'));var BPromise=require(_0xa8a9('0x2'));var rs=require(_0xa8a9('0x3'));var fs=require('fs');var Redis=require(_0xa8a9('0x4'));var db=require(_0xa8a9('0x5'))['db'];var utils=require(_0xa8a9('0x6'));var logger=require(_0xa8a9('0x7'))(_0xa8a9('0x8'));var config=require(_0xa8a9('0x9'));var jayson=require(_0xa8a9('0xa'));var client=jayson[_0xa8a9('0xb')]['http']({'port':0x232a});config[_0xa8a9('0xc')]=_['defaults'](config[_0xa8a9('0xc')],{'host':_0xa8a9('0xd'),'port':0x18eb});var socket=require(_0xa8a9('0xe'))(new Redis(config[_0xa8a9('0xc')]));require(_0xa8a9('0xf'))['register'](socket);function respondWithRpcPromise(_0x2f9391,_0x50071a,_0x58e265){return new BPromise(function(_0x2743ed,_0x4f4af8){return client[_0xa8a9('0x10')](_0x2f9391,_0x58e265)[_0xa8a9('0x11')](function(_0x5815e4){logger[_0xa8a9('0x12')](_0xa8a9('0x13'),_0x50071a,_0xa8a9('0x14'));logger[_0xa8a9('0x15')](_0xa8a9('0x16'),_0x50071a,_0xa8a9('0x14'),JSON['stringify'](_0x5815e4));if(_0x5815e4[_0xa8a9('0x17')]){if(_0x5815e4[_0xa8a9('0x17')][_0xa8a9('0x18')]===0x1f4){logger['error']('UserProfile,\x20%s,\x20%s',_0x50071a,_0x5815e4[_0xa8a9('0x17')][_0xa8a9('0x19')]);return _0x4f4af8(_0x5815e4[_0xa8a9('0x17')]['message']);}logger[_0xa8a9('0x17')](_0xa8a9('0x13'),_0x50071a,_0x5815e4['error']['message']);return _0x2743ed(_0x5815e4[_0xa8a9('0x17')][_0xa8a9('0x19')]);}else{logger[_0xa8a9('0x12')](_0xa8a9('0x13'),_0x50071a,_0xa8a9('0x14'));_0x2743ed(_0x5815e4[_0xa8a9('0x1a')]['message']);}})['catch'](function(_0x3a7ae7){logger['error']('UserProfile,\x20%s,\x20%s',_0x50071a,_0x3a7ae7);_0x4f4af8(_0x3a7ae7);});});} \ No newline at end of file +var _0xdf5d=['socket.io-emitter','./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0xa8602d,_0x85ad4e){var _0x2dd01d=function(_0x2c8eba){while(--_0x2c8eba){_0xa8602d['push'](_0xa8602d['shift']());}};_0x2dd01d(++_0x85ad4e);}(_0xdf5d,0x126));var _0xddf5=function(_0x11c939,_0x2ef5e3){_0x11c939=_0x11c939-0x0;var _0x39f62e=_0xdf5d[_0x11c939];return _0x39f62e;};'use strict';var _=require(_0xddf5('0x0'));var util=require(_0xddf5('0x1'));var moment=require(_0xddf5('0x2'));var BPromise=require(_0xddf5('0x3'));var rs=require(_0xddf5('0x4'));var fs=require('fs');var Redis=require(_0xddf5('0x5'));var db=require(_0xddf5('0x6'))['db'];var utils=require(_0xddf5('0x7'));var logger=require('../../config/logger')(_0xddf5('0x8'));var config=require(_0xddf5('0x9'));var jayson=require(_0xddf5('0xa'));var client=jayson[_0xddf5('0xb')][_0xddf5('0xc')]({'port':0x232a});config[_0xddf5('0xd')]=_[_0xddf5('0xe')](config[_0xddf5('0xd')],{'host':_0xddf5('0xf'),'port':0x18eb});var socket=require(_0xddf5('0x10'))(new Redis(config[_0xddf5('0xd')]));require(_0xddf5('0x11'))[_0xddf5('0x12')](socket);function respondWithRpcPromise(_0x3e50f2,_0x10191b,_0x3e675b){return new BPromise(function(_0x5a4f45,_0x161973){return client[_0xddf5('0x13')](_0x3e50f2,_0x3e675b)[_0xddf5('0x14')](function(_0x10245f){logger[_0xddf5('0x15')](_0xddf5('0x16'),_0x10191b,_0xddf5('0x17'));logger[_0xddf5('0x18')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x10191b,'request\x20sent',JSON[_0xddf5('0x19')](_0x10245f));if(_0x10245f[_0xddf5('0x1a')]){if(_0x10245f[_0xddf5('0x1a')][_0xddf5('0x1b')]===0x1f4){logger[_0xddf5('0x1a')](_0xddf5('0x16'),_0x10191b,_0x10245f[_0xddf5('0x1a')][_0xddf5('0x1c')]);return _0x161973(_0x10245f['error'][_0xddf5('0x1c')]);}logger[_0xddf5('0x1a')](_0xddf5('0x16'),_0x10191b,_0x10245f[_0xddf5('0x1a')][_0xddf5('0x1c')]);return _0x5a4f45(_0x10245f['error'][_0xddf5('0x1c')]);}else{logger['info'](_0xddf5('0x16'),_0x10191b,'request\x20sent');_0x5a4f45(_0x10245f[_0xddf5('0x1d')][_0xddf5('0x1c')]);}})[_0xddf5('0x1e')](function(_0x1cd984){logger['error']('UserProfile,\x20%s,\x20%s',_0x10191b,_0x1cd984);_0x161973(_0x1cd984);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 62bb8d8..d0a44c9 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 _0x5aa0=['save','remove','update','removeListener','register','userProfile:','./userProfile.events'];(function(_0x35ec65,_0x3eaced){var _0xe1551a=function(_0x47abdc){while(--_0x47abdc){_0x35ec65['push'](_0x35ec65['shift']());}};_0xe1551a(++_0x3eaced);}(_0x5aa0,0xc3));var _0x05aa=function(_0x253c31,_0x41dd37){_0x253c31=_0x253c31-0x0;var _0x3548f3=_0x5aa0[_0x253c31];return _0x3548f3;};'use strict';var UserProfileEvents=require(_0x05aa('0x0'));var events=[_0x05aa('0x1'),_0x05aa('0x2'),_0x05aa('0x3')];function createListener(_0x4fe548,_0x54cd22){return function(_0x1235be){_0x54cd22['emit'](_0x4fe548,_0x1235be);};}function removeListener(_0x4bef9c,_0x4aad5d){return function(){UserProfileEvents[_0x05aa('0x4')](_0x4bef9c,_0x4aad5d);};}exports[_0x05aa('0x5')]=function(_0x3d37dc){for(var _0x5b6f26=0x0,_0x3c1525=events['length'];_0x5b6f26<_0x3c1525;_0x5b6f26++){var _0x2f45ed=events[_0x5b6f26];var _0x52eb17=createListener(_0x05aa('0x6')+_0x2f45ed,_0x3d37dc);UserProfileEvents['on'](_0x2f45ed,_0x52eb17);}}; \ No newline at end of file +var _0xe931=['userProfile:','save','remove','update','emit','removeListener','register','length'];(function(_0x19183b,_0x488a4d){var _0x438d3a=function(_0x15f0d9){while(--_0x15f0d9){_0x19183b['push'](_0x19183b['shift']());}};_0x438d3a(++_0x488a4d);}(_0xe931,0x179));var _0x1e93=function(_0x49db92,_0x4764cc){_0x49db92=_0x49db92-0x0;var _0x4d1ac7=_0xe931[_0x49db92];return _0x4d1ac7;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x1e93('0x0'),_0x1e93('0x1'),_0x1e93('0x2')];function createListener(_0x2ffea7,_0x588363){return function(_0x463823){_0x588363[_0x1e93('0x3')](_0x2ffea7,_0x463823);};}function removeListener(_0x273048,_0x3db932){return function(){UserProfileEvents[_0x1e93('0x4')](_0x273048,_0x3db932);};}exports[_0x1e93('0x5')]=function(_0x4e3db4){for(var _0x230aad=0x0,_0x40b2d7=events[_0x1e93('0x6')];_0x230aad<_0x40b2d7;_0x230aad++){var _0x559234=events[_0x230aad];var _0x1eacf9=createListener(_0x1e93('0x7')+_0x559234,_0x4e3db4);UserProfileEvents['on'](_0x559234,_0x1eacf9);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 5b7e068..2e594e9 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 _0xfb49=['../../config/environment','./userProfileResource.controller','get','index','/describe','isAuthenticated','describe','show','post','put','/:id','update','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xfb49,0x13a));var _0x9fb4=function(_0x555ebb,_0x4b1b68){_0x555ebb=_0x555ebb-0x0;var _0x3c0a4a=_0xfb49[_0x555ebb];return _0x3c0a4a;};'use strict';var multer=require(_0x9fb4('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9fb4('0x1'));var express=require(_0x9fb4('0x2'));var router=express[_0x9fb4('0x3')]();var fs_extra=require(_0x9fb4('0x4'));var auth=require(_0x9fb4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9fb4('0x6'));var controller=require(_0x9fb4('0x7'));router[_0x9fb4('0x8')]('/',auth['isAuthenticated'](),controller[_0x9fb4('0x9')]);router[_0x9fb4('0x8')](_0x9fb4('0xa'),auth[_0x9fb4('0xb')](),controller[_0x9fb4('0xc')]);router[_0x9fb4('0x8')]('/:id',auth[_0x9fb4('0xb')](),controller[_0x9fb4('0xd')]);router[_0x9fb4('0xe')]('/',auth[_0x9fb4('0xb')](),controller['create']);router[_0x9fb4('0xf')](_0x9fb4('0x10'),auth[_0x9fb4('0xb')](),controller[_0x9fb4('0x11')]);router[_0x9fb4('0x12')]('/:id',auth[_0x9fb4('0xb')](),controller[_0x9fb4('0x13')]);module['exports']=router; \ No newline at end of file +var _0xb92c=['connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','/describe','describe','post','put','/:id','update','destroy','util','path'];(function(_0xf35bc1,_0x510803){var _0xa6b162=function(_0x1e5cc8){while(--_0x1e5cc8){_0xf35bc1['push'](_0xf35bc1['shift']());}};_0xa6b162(++_0x510803);}(_0xb92c,0x1c9));var _0xcb92=function(_0x5d5b4b,_0x5a810e){_0x5d5b4b=_0x5d5b4b-0x0;var _0x5707a5=_0xb92c[_0x5d5b4b];return _0x5707a5;};'use strict';var multer=require('multer');var util=require(_0xcb92('0x0'));var path=require(_0xcb92('0x1'));var timeout=require(_0xcb92('0x2'));var express=require(_0xcb92('0x3'));var router=express['Router']();var fs_extra=require(_0xcb92('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcb92('0x5'));var config=require(_0xcb92('0x6'));var controller=require(_0xcb92('0x7'));router[_0xcb92('0x8')]('/',auth[_0xcb92('0x9')](),controller['index']);router[_0xcb92('0x8')](_0xcb92('0xa'),auth[_0xcb92('0x9')](),controller[_0xcb92('0xb')]);router['get']('/:id',auth[_0xcb92('0x9')](),controller['show']);router[_0xcb92('0xc')]('/',auth[_0xcb92('0x9')](),controller['create']);router[_0xcb92('0xd')](_0xcb92('0xe'),auth[_0xcb92('0x9')](),controller[_0xcb92('0xf')]);router['delete']('/:id',auth[_0xcb92('0x9')](),controller[_0xcb92('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 5f10280..5e8e75e 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 _0xa853=['INTEGER','exports'];(function(_0x1dfce3,_0x491d21){var _0x127504=function(_0x3028cb){while(--_0x3028cb){_0x1dfce3['push'](_0x1dfce3['shift']());}};_0x127504(++_0x491d21);}(_0xa853,0x1b9));var _0x3a85=function(_0x32d51f,_0x8fc467){_0x32d51f=_0x32d51f-0x0;var _0x56237d=_0xa853[_0x32d51f];return _0x56237d;};'use strict';var Sequelize=require('sequelize');module[_0x3a85('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0x3a85('0x1')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xfd2a=['INTEGER','STRING','exports'];(function(_0x5c4e16,_0x113035){var _0x36044a=function(_0xde2f25){while(--_0xde2f25){_0x5c4e16['push'](_0x5c4e16['shift']());}};_0x36044a(++_0x113035);}(_0xfd2a,0x137));var _0xafd2=function(_0x256b72,_0x340985){_0x256b72=_0x256b72-0x0;var _0x2183e3=_0xfd2a[_0x256b72];return _0x2183e3;};'use strict';var Sequelize=require('sequelize');module[_0xafd2('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0xafd2('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xafd2('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index e854c48..93b1836 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 _0xba34=['../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','UserProfileResource','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x46ae5a,_0x2a38d0){var _0x434986=function(_0x22735d){while(--_0x22735d){_0x46ae5a['push'](_0x46ae5a['shift']());}};_0x434986(++_0x2a38d0);}(_0xba34,0x119));var _0x4ba3=function(_0x38e159,_0x34246b){_0x38e159=_0x38e159-0x0;var _0x511ae7=_0xba34[_0x38e159];return _0x511ae7;};'use strict';var emlformat=require(_0x4ba3('0x0'));var rimraf=require(_0x4ba3('0x1'));var zipdir=require(_0x4ba3('0x2'));var jsonpatch=require(_0x4ba3('0x3'));var rp=require(_0x4ba3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ba3('0x5'));var path=require(_0x4ba3('0x6'));var sox=require(_0x4ba3('0x7'));var csv=require(_0x4ba3('0x8'));var ejs=require(_0x4ba3('0x9'));var fs=require('fs');var fs_extra=require(_0x4ba3('0xa'));var _=require(_0x4ba3('0xb'));var squel=require('squel');var crypto=require(_0x4ba3('0xc'));var jsforce=require(_0x4ba3('0xd'));var deskjs=require(_0x4ba3('0xe'));var toCsv=require(_0x4ba3('0x8'));var querystring=require(_0x4ba3('0xf'));var Papa=require(_0x4ba3('0x10'));var Redis=require(_0x4ba3('0x11'));var authService=require(_0x4ba3('0x12'));var qs=require(_0x4ba3('0x13'));var as=require(_0x4ba3('0x14'));var hardwareService=require(_0x4ba3('0x15'));var logger=require('../../config/logger')(_0x4ba3('0x16'));var utils=require(_0x4ba3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4ba3('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1073d4,_0x52f55c){_0x52f55c=_0x52f55c||0xcc;return function(_0x256f02){if(_0x256f02){return _0x1073d4[_0x4ba3('0x19')](_0x52f55c);}return _0x1073d4[_0x4ba3('0x1a')](_0x52f55c)[_0x4ba3('0x1b')]();};}function respondWithResult(_0x2bc796,_0x3d2ace){_0x3d2ace=_0x3d2ace||0xc8;return function(_0x3a74f7){if(_0x3a74f7){return _0x2bc796[_0x4ba3('0x1a')](_0x3d2ace)[_0x4ba3('0x1c')](_0x3a74f7);}};}function respondWithFilteredResult(_0x401366,_0x36638b){return function(_0x301359){if(_0x301359){var _0x29a9d1=typeof _0x36638b[_0x4ba3('0x1d')]===_0x4ba3('0x1e')&&typeof _0x36638b[_0x4ba3('0x1f')]==='undefined';var _0x382fd0=_0x301359[_0x4ba3('0x20')];var _0x5ff7ce=_0x29a9d1?0x0:_0x36638b[_0x4ba3('0x1d')];var _0x556290=_0x29a9d1?_0x301359[_0x4ba3('0x20')]:_0x36638b[_0x4ba3('0x1d')]+_0x36638b[_0x4ba3('0x1f')];var _0x1e2ce5;if(_0x556290>=_0x382fd0){_0x556290=_0x382fd0;_0x1e2ce5=0xc8;}else{_0x1e2ce5=0xce;}_0x401366[_0x4ba3('0x1a')](_0x1e2ce5);return _0x401366[_0x4ba3('0x21')]('Content-Range',_0x5ff7ce+'-'+_0x556290+'/'+_0x382fd0)['json'](_0x301359);}return null;};}function patchUpdates(_0x2278b0){return function(_0x579d9f){try{jsonpatch[_0x4ba3('0x22')](_0x579d9f,_0x2278b0,!![]);}catch(_0x163967){return BPromise[_0x4ba3('0x23')](_0x163967);}return _0x579d9f[_0x4ba3('0x24')]();};}function saveUpdates(_0x46f1f5,_0x278a23){return function(_0x4a0823){if(_0x4a0823){return _0x4a0823[_0x4ba3('0x25')](_0x46f1f5)[_0x4ba3('0x26')](function(_0x5c28f9){return _0x5c28f9;});}return null;};}function removeEntity(_0x28bb3d,_0x4ffe39){return function(_0x1ae4de){if(_0x1ae4de){return _0x1ae4de[_0x4ba3('0x27')]()[_0x4ba3('0x26')](function(){_0x28bb3d[_0x4ba3('0x1a')](0xcc)[_0x4ba3('0x1b')]();});}};}function handleEntityNotFound(_0xe29a49,_0x159596){return function(_0xe1f7d2){if(!_0xe1f7d2){_0xe29a49[_0x4ba3('0x19')](0x194);}return _0xe1f7d2;};}function handleError(_0x2e67a0,_0x50c729){_0x50c729=_0x50c729||0x1f4;return function(_0x252f37){logger[_0x4ba3('0x28')](_0x252f37[_0x4ba3('0x29')]);if(_0x252f37['name']){delete _0x252f37[_0x4ba3('0x2a')];}_0x2e67a0[_0x4ba3('0x1a')](_0x50c729)[_0x4ba3('0x2b')](_0x252f37);};}exports['index']=function(_0x10cae6,_0x843276){var _0x34ecb4={},_0x22394d={},_0x4a339e={'count':0x0,'rows':[]};var _0x590108=_[_0x4ba3('0x2c')](db[_0x4ba3('0x2d')][_0x4ba3('0x2e')],function(_0x19f039){return{'name':_0x19f039[_0x4ba3('0x2f')],'type':_0x19f039[_0x4ba3('0x30')]['key']};});_0x22394d[_0x4ba3('0x31')]=_[_0x4ba3('0x2c')](_0x590108,_0x4ba3('0x2a'));_0x22394d[_0x4ba3('0x32')]=_[_0x4ba3('0x33')](_0x10cae6[_0x4ba3('0x32')]);_0x22394d[_0x4ba3('0x34')]=_[_0x4ba3('0x35')](_0x22394d[_0x4ba3('0x31')],_0x22394d[_0x4ba3('0x32')]);_0x34ecb4['attributes']=_['intersection'](_0x22394d['model'],qs[_0x4ba3('0x36')](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x36')]));_0x34ecb4[_0x4ba3('0x37')]=_0x34ecb4[_0x4ba3('0x37')][_0x4ba3('0x38')]?_0x34ecb4[_0x4ba3('0x37')]:_0x22394d[_0x4ba3('0x31')];if(!_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x39')](_0x4ba3('0x3a'))){_0x34ecb4[_0x4ba3('0x1f')]=qs['limit'](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x1f')]);_0x34ecb4[_0x4ba3('0x1d')]=qs['offset'](_0x10cae6[_0x4ba3('0x32')]['offset']);}_0x34ecb4[_0x4ba3('0x3b')]=qs[_0x4ba3('0x3c')](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x3c')]);_0x34ecb4[_0x4ba3('0x3d')]=qs[_0x4ba3('0x34')](_['pick'](_0x10cae6[_0x4ba3('0x32')],_0x22394d[_0x4ba3('0x34')]),_0x590108);if(_0x10cae6[_0x4ba3('0x32')]['filter']){_0x34ecb4[_0x4ba3('0x3d')]=_[_0x4ba3('0x3e')](_0x34ecb4['where'],{'$or':_[_0x4ba3('0x2c')](_0x590108,function(_0x503777){if(_0x503777['type']!==_0x4ba3('0x3f')){var _0x1acc74={};_0x1acc74[_0x503777[_0x4ba3('0x2a')]]={'$like':'%'+_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x40')]+'%'};return _0x1acc74;}})});}_0x34ecb4=_['merge']({},_0x34ecb4,_0x10cae6[_0x4ba3('0x41')]);var _0x10e4b5={'where':_0x34ecb4[_0x4ba3('0x3d')]};return db[_0x4ba3('0x2d')][_0x4ba3('0x20')](_0x10e4b5)[_0x4ba3('0x26')](function(_0x349af4){_0x4a339e[_0x4ba3('0x20')]=_0x349af4;if(_0x10cae6['query'][_0x4ba3('0x42')]){_0x34ecb4[_0x4ba3('0x43')]=[{'all':!![]}];}return db[_0x4ba3('0x2d')][_0x4ba3('0x44')](_0x34ecb4);})[_0x4ba3('0x26')](function(_0x25b2c9){_0x4a339e[_0x4ba3('0x45')]=_0x25b2c9;return _0x4a339e;})[_0x4ba3('0x26')](respondWithFilteredResult(_0x843276,_0x34ecb4))[_0x4ba3('0x46')](handleError(_0x843276,null));};exports[_0x4ba3('0x47')]=function(_0x3b9a0a,_0x1c58d2){var _0x1d031b={'raw':![],'where':{'id':_0x3b9a0a['params']['id']}},_0x28b649={};_0x28b649['model']=_['keys'](db['UserProfileResource']['rawAttributes']);_0x28b649[_0x4ba3('0x32')]=_['keys'](_0x3b9a0a[_0x4ba3('0x32')]);_0x28b649['filters']=_[_0x4ba3('0x35')](_0x28b649[_0x4ba3('0x31')],_0x28b649[_0x4ba3('0x32')]);_0x1d031b[_0x4ba3('0x37')]=_[_0x4ba3('0x35')](_0x28b649['model'],qs[_0x4ba3('0x36')](_0x3b9a0a['query'][_0x4ba3('0x36')]));_0x1d031b['attributes']=_0x1d031b[_0x4ba3('0x37')][_0x4ba3('0x38')]?_0x1d031b[_0x4ba3('0x37')]:_0x28b649[_0x4ba3('0x31')];if(_0x3b9a0a[_0x4ba3('0x32')][_0x4ba3('0x42')]){_0x1d031b[_0x4ba3('0x43')]=[{'all':!![]}];}_0x1d031b=_['merge']({},_0x1d031b,_0x3b9a0a[_0x4ba3('0x41')]);return db[_0x4ba3('0x2d')][_0x4ba3('0x48')](_0x1d031b)[_0x4ba3('0x26')](handleEntityNotFound(_0x1c58d2,null))[_0x4ba3('0x26')](respondWithResult(_0x1c58d2,null))['catch'](handleError(_0x1c58d2,null));};exports['create']=function(_0xa4bbb2,_0x1fe115){return db[_0x4ba3('0x2d')]['create'](_0xa4bbb2[_0x4ba3('0x49')],{})[_0x4ba3('0x26')](respondWithResult(_0x1fe115,0xc9))[_0x4ba3('0x46')](handleError(_0x1fe115,null));};exports['update']=function(_0x47f588,_0x34dc04){if(_0x47f588['body']['id']){delete _0x47f588[_0x4ba3('0x49')]['id'];}return db[_0x4ba3('0x2d')][_0x4ba3('0x48')]({'where':{'id':_0x47f588[_0x4ba3('0x4a')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x34dc04,null))[_0x4ba3('0x26')](saveUpdates(_0x47f588['body'],null))[_0x4ba3('0x26')](respondWithResult(_0x34dc04,null))[_0x4ba3('0x46')](handleError(_0x34dc04,null));};exports['destroy']=function(_0x325475,_0x12ae6f){return db[_0x4ba3('0x2d')][_0x4ba3('0x48')]({'where':{'id':_0x325475[_0x4ba3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x12ae6f,null))[_0x4ba3('0x26')](removeEntity(_0x12ae6f,null))[_0x4ba3('0x46')](handleError(_0x12ae6f,null));};exports['describe']=function(_0x43f820,_0x19d70f){return db[_0x4ba3('0x2d')][_0x4ba3('0x4b')]()[_0x4ba3('0x26')](respondWithResult(_0x19d70f,null))[_0x4ba3('0x46')](handleError(_0x19d70f,null));}; \ No newline at end of file +var _0x5496=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','UserProfileResource','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','rows','catch','show','params','keys','fields','include','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils'];(function(_0x4e6954,_0x3f2f48){var _0x302a6d=function(_0x46930f){while(--_0x46930f){_0x4e6954['push'](_0x4e6954['shift']());}};_0x302a6d(++_0x3f2f48);}(_0x5496,0x175));var _0x6549=function(_0x40177f,_0x1bfbc0){_0x40177f=_0x40177f-0x0;var _0x1495d4=_0x5496[_0x40177f];return _0x1495d4;};'use strict';var emlformat=require(_0x6549('0x0'));var rimraf=require(_0x6549('0x1'));var zipdir=require(_0x6549('0x2'));var jsonpatch=require(_0x6549('0x3'));var rp=require(_0x6549('0x4'));var moment=require('moment');var BPromise=require(_0x6549('0x5'));var Mustache=require('mustache');var util=require(_0x6549('0x6'));var path=require(_0x6549('0x7'));var sox=require(_0x6549('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6549('0x9'));var _=require(_0x6549('0xa'));var squel=require('squel');var crypto=require(_0x6549('0xb'));var jsforce=require(_0x6549('0xc'));var deskjs=require(_0x6549('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6549('0xe'));var Papa=require(_0x6549('0xf'));var Redis=require(_0x6549('0x10'));var authService=require(_0x6549('0x11'));var qs=require(_0x6549('0x12'));var as=require(_0x6549('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6549('0x14'));var utils=require(_0x6549('0x15'));var config=require(_0x6549('0x16'));var licenseUtil=require(_0x6549('0x17'));var db=require(_0x6549('0x18'))['db'];function respondWithStatusCode(_0x5bc018,_0x4dfb06){_0x4dfb06=_0x4dfb06||0xcc;return function(_0x3f844f){if(_0x3f844f){return _0x5bc018[_0x6549('0x19')](_0x4dfb06);}return _0x5bc018['status'](_0x4dfb06)[_0x6549('0x1a')]();};}function respondWithResult(_0x150fc8,_0x195d25){_0x195d25=_0x195d25||0xc8;return function(_0x12b068){if(_0x12b068){return _0x150fc8[_0x6549('0x1b')](_0x195d25)[_0x6549('0x1c')](_0x12b068);}};}function respondWithFilteredResult(_0x55c112,_0x5db86d){return function(_0x384f75){if(_0x384f75){var _0x25da29=typeof _0x5db86d['offset']===_0x6549('0x1d')&&typeof _0x5db86d[_0x6549('0x1e')]===_0x6549('0x1d');var _0x387e60=_0x384f75[_0x6549('0x1f')];var _0x53b12b=_0x25da29?0x0:_0x5db86d['offset'];var _0x26a212=_0x25da29?_0x384f75['count']:_0x5db86d['offset']+_0x5db86d[_0x6549('0x1e')];var _0x1e5079;if(_0x26a212>=_0x387e60){_0x26a212=_0x387e60;_0x1e5079=0xc8;}else{_0x1e5079=0xce;}_0x55c112[_0x6549('0x1b')](_0x1e5079);return _0x55c112[_0x6549('0x20')](_0x6549('0x21'),_0x53b12b+'-'+_0x26a212+'/'+_0x387e60)['json'](_0x384f75);}return null;};}function patchUpdates(_0x228117){return function(_0x4b40c1){try{jsonpatch[_0x6549('0x22')](_0x4b40c1,_0x228117,!![]);}catch(_0x72322b){return BPromise[_0x6549('0x23')](_0x72322b);}return _0x4b40c1[_0x6549('0x24')]();};}function saveUpdates(_0x22bcf8,_0x12d547){return function(_0x427b47){if(_0x427b47){return _0x427b47[_0x6549('0x25')](_0x22bcf8)[_0x6549('0x26')](function(_0x6ae00c){return _0x6ae00c;});}return null;};}function removeEntity(_0x40d3f9,_0x1fbfa4){return function(_0x23c0ba){if(_0x23c0ba){return _0x23c0ba['destroy']()[_0x6549('0x26')](function(){_0x40d3f9[_0x6549('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x126967,_0x29f89e){return function(_0x3768cb){if(!_0x3768cb){_0x126967['sendStatus'](0x194);}return _0x3768cb;};}function handleError(_0x31a95,_0xfb51a1){_0xfb51a1=_0xfb51a1||0x1f4;return function(_0x14de1f){logger[_0x6549('0x27')](_0x14de1f[_0x6549('0x28')]);if(_0x14de1f[_0x6549('0x29')]){delete _0x14de1f[_0x6549('0x29')];}_0x31a95[_0x6549('0x1b')](_0xfb51a1)['send'](_0x14de1f);};}exports[_0x6549('0x2a')]=function(_0x136518,_0x17fdfb){var _0x4c605c={},_0x3f1502={},_0x4acaf5={'count':0x0,'rows':[]};var _0x4f0ad1=_['map'](db[_0x6549('0x2b')][_0x6549('0x2c')],function(_0x4f3069){return{'name':_0x4f3069[_0x6549('0x2d')],'type':_0x4f3069[_0x6549('0x2e')][_0x6549('0x2f')]};});_0x3f1502[_0x6549('0x30')]=_[_0x6549('0x31')](_0x4f0ad1,_0x6549('0x29'));_0x3f1502[_0x6549('0x32')]=_['keys'](_0x136518[_0x6549('0x32')]);_0x3f1502[_0x6549('0x33')]=_[_0x6549('0x34')](_0x3f1502[_0x6549('0x30')],_0x3f1502[_0x6549('0x32')]);_0x4c605c[_0x6549('0x35')]=_['intersection'](_0x3f1502[_0x6549('0x30')],qs['fields'](_0x136518[_0x6549('0x32')]['fields']));_0x4c605c[_0x6549('0x35')]=_0x4c605c[_0x6549('0x35')][_0x6549('0x36')]?_0x4c605c['attributes']:_0x3f1502[_0x6549('0x30')];if(!_0x136518[_0x6549('0x32')][_0x6549('0x37')](_0x6549('0x38'))){_0x4c605c['limit']=qs['limit'](_0x136518['query'][_0x6549('0x1e')]);_0x4c605c[_0x6549('0x39')]=qs['offset'](_0x136518[_0x6549('0x32')][_0x6549('0x39')]);}_0x4c605c[_0x6549('0x3a')]=qs[_0x6549('0x3b')](_0x136518[_0x6549('0x32')]['sort']);_0x4c605c['where']=qs[_0x6549('0x33')](_[_0x6549('0x3c')](_0x136518[_0x6549('0x32')],_0x3f1502[_0x6549('0x33')]),_0x4f0ad1);if(_0x136518[_0x6549('0x32')][_0x6549('0x3d')]){_0x4c605c[_0x6549('0x3e')]=_[_0x6549('0x3f')](_0x4c605c[_0x6549('0x3e')],{'$or':_[_0x6549('0x31')](_0x4f0ad1,function(_0x525f82){if(_0x525f82[_0x6549('0x2e')]!==_0x6549('0x40')){var _0x2ea977={};_0x2ea977[_0x525f82[_0x6549('0x29')]]={'$like':'%'+_0x136518[_0x6549('0x32')]['filter']+'%'};return _0x2ea977;}})});}_0x4c605c=_['merge']({},_0x4c605c,_0x136518['options']);var _0x22b919={'where':_0x4c605c[_0x6549('0x3e')]};return db[_0x6549('0x2b')][_0x6549('0x1f')](_0x22b919)['then'](function(_0x56ce9f){_0x4acaf5[_0x6549('0x1f')]=_0x56ce9f;if(_0x136518[_0x6549('0x32')][_0x6549('0x41')]){_0x4c605c['include']=[{'all':!![]}];}return db[_0x6549('0x2b')]['findAll'](_0x4c605c);})[_0x6549('0x26')](function(_0x2ec614){_0x4acaf5[_0x6549('0x42')]=_0x2ec614;return _0x4acaf5;})[_0x6549('0x26')](respondWithFilteredResult(_0x17fdfb,_0x4c605c))[_0x6549('0x43')](handleError(_0x17fdfb,null));};exports[_0x6549('0x44')]=function(_0xbbfdc9,_0x4deaab){var _0x132625={'raw':![],'where':{'id':_0xbbfdc9[_0x6549('0x45')]['id']}},_0x309f45={};_0x309f45[_0x6549('0x30')]=_[_0x6549('0x46')](db[_0x6549('0x2b')][_0x6549('0x2c')]);_0x309f45[_0x6549('0x32')]=_[_0x6549('0x46')](_0xbbfdc9[_0x6549('0x32')]);_0x309f45[_0x6549('0x33')]=_[_0x6549('0x34')](_0x309f45[_0x6549('0x30')],_0x309f45[_0x6549('0x32')]);_0x132625[_0x6549('0x35')]=_[_0x6549('0x34')](_0x309f45['model'],qs[_0x6549('0x47')](_0xbbfdc9[_0x6549('0x32')][_0x6549('0x47')]));_0x132625[_0x6549('0x35')]=_0x132625['attributes'][_0x6549('0x36')]?_0x132625['attributes']:_0x309f45[_0x6549('0x30')];if(_0xbbfdc9[_0x6549('0x32')]['includeAll']){_0x132625[_0x6549('0x48')]=[{'all':!![]}];}_0x132625=_[_0x6549('0x3f')]({},_0x132625,_0xbbfdc9[_0x6549('0x49')]);return db[_0x6549('0x2b')][_0x6549('0x4a')](_0x132625)['then'](handleEntityNotFound(_0x4deaab,null))['then'](respondWithResult(_0x4deaab,null))[_0x6549('0x43')](handleError(_0x4deaab,null));};exports[_0x6549('0x4b')]=function(_0x41d675,_0x1712f3){return db[_0x6549('0x2b')]['create'](_0x41d675[_0x6549('0x4c')],{})[_0x6549('0x26')](respondWithResult(_0x1712f3,0xc9))[_0x6549('0x43')](handleError(_0x1712f3,null));};exports[_0x6549('0x25')]=function(_0xa4c650,_0x25a6ee){if(_0xa4c650[_0x6549('0x4c')]['id']){delete _0xa4c650[_0x6549('0x4c')]['id'];}return db['UserProfileResource'][_0x6549('0x4a')]({'where':{'id':_0xa4c650['params']['id']}})[_0x6549('0x26')](handleEntityNotFound(_0x25a6ee,null))[_0x6549('0x26')](saveUpdates(_0xa4c650[_0x6549('0x4c')],null))['then'](respondWithResult(_0x25a6ee,null))[_0x6549('0x43')](handleError(_0x25a6ee,null));};exports[_0x6549('0x4d')]=function(_0x2ef4d2,_0x5300c8){return db[_0x6549('0x2b')][_0x6549('0x4a')]({'where':{'id':_0x2ef4d2[_0x6549('0x45')]['id']}})[_0x6549('0x26')](handleEntityNotFound(_0x5300c8,null))[_0x6549('0x26')](removeEntity(_0x5300c8,null))[_0x6549('0x43')](handleError(_0x5300c8,null));};exports['describe']=function(_0x28af00,_0x4bbc61){return db[_0x6549('0x2b')][_0x6549('0x4e')]()[_0x6549('0x26')](respondWithResult(_0x4bbc61,null))[_0x6549('0x43')](handleError(_0x4bbc61,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 05283b3..e765342 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 _0xed5f=['user_profile_has_resources','resourceId','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./userProfileResource.attributes','UserProfileResource'];(function(_0x46361e,_0x243aaf){var _0x14e302=function(_0x9ebecf){while(--_0x9ebecf){_0x46361e['push'](_0x46361e['shift']());}};_0x14e302(++_0x243aaf);}(_0xed5f,0x1a6));var _0xfed5=function(_0x37657b,_0x2ae142){_0x37657b=_0x37657b-0x0;var _0x572f86=_0xed5f[_0x37657b];return _0x572f86;};'use strict';var _=require(_0xfed5('0x0'));var util=require(_0xfed5('0x1'));var logger=require(_0xfed5('0x2'))(_0xfed5('0x3'));var moment=require(_0xfed5('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfed5('0x5'));var rimraf=require(_0xfed5('0x6'));var config=require(_0xfed5('0x7'));var attributes=require(_0xfed5('0x8'));module['exports']=function(_0x483255,_0x1a71cb){return _0x483255['define'](_0xfed5('0x9'),attributes,{'tableName':_0xfed5('0xa'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xfed5('0xb'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x70df=['../../config/environment','./userProfileResource.attributes','exports','UserProfileResource','user_profile_has_resources','lodash','util','bluebird'];(function(_0x4ec1da,_0xa0c8c6){var _0x440948=function(_0x3c7936){while(--_0x3c7936){_0x4ec1da['push'](_0x4ec1da['shift']());}};_0x440948(++_0xa0c8c6);}(_0x70df,0xb5));var _0xf70d=function(_0x4a14dc,_0x5255ac){_0x4a14dc=_0x4a14dc-0x0;var _0x1be944=_0x70df[_0x4a14dc];return _0x1be944;};'use strict';var _=require(_0xf70d('0x0'));var util=require(_0xf70d('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xf70d('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf70d('0x3'));var attributes=require(_0xf70d('0x4'));module[_0xf70d('0x5')]=function(_0x530ee8,_0x7a4c32){return _0x530ee8['define'](_0xf70d('0x6'),attributes,{'tableName':_0xf70d('0x7'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['resourceId','sectionId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 6448254..4f32958 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 _0xf59d=['jayson/promise','client','request','then','info','UserProfileResource,\x20%s,\x20%s','debug','request\x20sent','code','message','error','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x310c83,_0x33eed5){var _0x41eb41=function(_0x7cbad){while(--_0x7cbad){_0x310c83['push'](_0x310c83['shift']());}};_0x41eb41(++_0x33eed5);}(_0xf59d,0x121));var _0xdf59=function(_0x146eed,_0x547c97){_0x146eed=_0x146eed-0x0;var _0x17cdc4=_0xf59d[_0x146eed];return _0x17cdc4;};'use strict';var _=require(_0xdf59('0x0'));var util=require(_0xdf59('0x1'));var moment=require(_0xdf59('0x2'));var BPromise=require(_0xdf59('0x3'));var rs=require(_0xdf59('0x4'));var fs=require('fs');var Redis=require(_0xdf59('0x5'));var db=require(_0xdf59('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xdf59('0x7'))(_0xdf59('0x8'));var config=require(_0xdf59('0x9'));var jayson=require(_0xdf59('0xa'));var client=jayson[_0xdf59('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3299f7,_0x112445,_0x28ce47){return new BPromise(function(_0x38ecc0,_0x5c4643){return client[_0xdf59('0xc')](_0x3299f7,_0x28ce47)[_0xdf59('0xd')](function(_0x2a859e){logger[_0xdf59('0xe')](_0xdf59('0xf'),_0x112445,'request\x20sent');logger[_0xdf59('0x10')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x112445,_0xdf59('0x11'),JSON['stringify'](_0x2a859e));if(_0x2a859e['error']){if(_0x2a859e['error'][_0xdf59('0x12')]===0x1f4){logger['error'](_0xdf59('0xf'),_0x112445,_0x2a859e['error'][_0xdf59('0x13')]);return _0x5c4643(_0x2a859e[_0xdf59('0x14')]['message']);}logger[_0xdf59('0x14')]('UserProfileResource,\x20%s,\x20%s',_0x112445,_0x2a859e['error'][_0xdf59('0x13')]);return _0x38ecc0(_0x2a859e[_0xdf59('0x14')][_0xdf59('0x13')]);}else{logger[_0xdf59('0xe')](_0xdf59('0xf'),_0x112445,_0xdf59('0x11'));_0x38ecc0(_0x2a859e[_0xdf59('0x15')][_0xdf59('0x13')]);}})[_0xdf59('0x16')](function(_0x149811){logger[_0xdf59('0x14')](_0xdf59('0xf'),_0x112445,_0x149811);_0x5c4643(_0x149811);});});} \ No newline at end of file +var _0xa31c=['then','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa31c,0x171));var _0xca31=function(_0x4c16cf,_0x311772){_0x4c16cf=_0x4c16cf-0x0;var _0x1ac4ae=_0xa31c[_0x4c16cf];return _0x1ac4ae;};'use strict';var _=require(_0xca31('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xca31('0x1'));var rs=require(_0xca31('0x2'));var fs=require('fs');var Redis=require(_0xca31('0x3'));var db=require(_0xca31('0x4'))['db'];var utils=require(_0xca31('0x5'));var logger=require(_0xca31('0x6'))('rpc');var config=require(_0xca31('0x7'));var jayson=require(_0xca31('0x8'));var client=jayson[_0xca31('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x319aff,_0x5a7285,_0x5bed64){return new BPromise(function(_0x45ee89,_0x2e4a74){return client[_0xca31('0xa')](_0x319aff,_0x5bed64)[_0xca31('0xb')](function(_0x2793a1){logger['info'](_0xca31('0xc'),_0x5a7285,_0xca31('0xd'));logger[_0xca31('0xe')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x5a7285,'request\x20sent',JSON[_0xca31('0xf')](_0x2793a1));if(_0x2793a1[_0xca31('0x10')]){if(_0x2793a1[_0xca31('0x10')]['code']===0x1f4){logger['error'](_0xca31('0xc'),_0x5a7285,_0x2793a1[_0xca31('0x10')][_0xca31('0x11')]);return _0x2e4a74(_0x2793a1[_0xca31('0x10')][_0xca31('0x11')]);}logger[_0xca31('0x10')]('UserProfileResource,\x20%s,\x20%s',_0x5a7285,_0x2793a1['error']['message']);return _0x45ee89(_0x2793a1['error'][_0xca31('0x11')]);}else{logger[_0xca31('0x12')]('UserProfileResource,\x20%s,\x20%s',_0x5a7285,_0xca31('0xd'));_0x45ee89(_0x2793a1['result']['message']);}})['catch'](function(_0x13e85c){logger[_0xca31('0x10')](_0xca31('0xc'),_0x5a7285,_0x13e85c);_0x2e4a74(_0x13e85c);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index ac53fa4..9f7bb2c 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 _0xb3e0=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','update','delete'];(function(_0x23125f,_0x54a910){var _0x3c8b6e=function(_0x5d4f44){while(--_0x5d4f44){_0x23125f['push'](_0x23125f['shift']());}};_0x3c8b6e(++_0x54a910);}(_0xb3e0,0xf4));var _0x0b3e=function(_0x4be43e,_0x22febf){_0x4be43e=_0x4be43e-0x0;var _0xb3b959=_0xb3e0[_0x4be43e];return _0xb3b959;};'use strict';var multer=require(_0x0b3e('0x0'));var util=require(_0x0b3e('0x1'));var path=require(_0x0b3e('0x2'));var timeout=require(_0x0b3e('0x3'));var express=require(_0x0b3e('0x4'));var router=express[_0x0b3e('0x5')]();var fs_extra=require(_0x0b3e('0x6'));var auth=require(_0x0b3e('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x0b3e('0x8'));var controller=require(_0x0b3e('0x9'));router[_0x0b3e('0xa')]('/',auth[_0x0b3e('0xb')](),controller[_0x0b3e('0xc')]);router['get'](_0x0b3e('0xd'),auth[_0x0b3e('0xb')](),controller['describe']);router['get'](_0x0b3e('0xe'),auth[_0x0b3e('0xb')](),controller[_0x0b3e('0xf')]);router[_0x0b3e('0x10')]('/',auth[_0x0b3e('0xb')](),controller[_0x0b3e('0x11')]);router['put'](_0x0b3e('0xe'),auth['isAuthenticated'](),controller[_0x0b3e('0x12')]);router[_0x0b3e('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x0b3e('0x14')]);module[_0x0b3e('0x15')]=router; \ No newline at end of file +var _0xc5fb=['index','get','/describe','describe','show','create','put','/:id','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','isAuthenticated'];(function(_0x180a6b,_0x2bef08){var _0x19543b=function(_0x2226ec){while(--_0x2226ec){_0x180a6b['push'](_0x180a6b['shift']());}};_0x19543b(++_0x2bef08);}(_0xc5fb,0x8f));var _0xbc5f=function(_0x18ce30,_0x437d06){_0x18ce30=_0x18ce30-0x0;var _0x4471a3=_0xc5fb[_0x18ce30];return _0x4471a3;};'use strict';var multer=require('multer');var util=require(_0xbc5f('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbc5f('0x1'));var router=express[_0xbc5f('0x2')]();var fs_extra=require(_0xbc5f('0x3'));var auth=require(_0xbc5f('0x4'));var interaction=require(_0xbc5f('0x5'));var config=require(_0xbc5f('0x6'));var controller=require(_0xbc5f('0x7'));router['get']('/',auth[_0xbc5f('0x8')](),controller[_0xbc5f('0x9')]);router[_0xbc5f('0xa')](_0xbc5f('0xb'),auth[_0xbc5f('0x8')](),controller[_0xbc5f('0xc')]);router[_0xbc5f('0xa')]('/:id',auth[_0xbc5f('0x8')](),controller[_0xbc5f('0xd')]);router['post']('/',auth[_0xbc5f('0x8')](),controller[_0xbc5f('0xe')]);router[_0xbc5f('0xf')](_0xbc5f('0x10'),auth[_0xbc5f('0x8')](),controller['update']);router['delete'](_0xbc5f('0x10'),auth[_0xbc5f('0x8')](),controller[_0xbc5f('0x11')]);module[_0xbc5f('0x12')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 274af9d..87e5f0e 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 _0xf4f4=['INTEGER','BOOLEAN','setDataValue','join','getDataValue','crudPermissions','split','sequelize','exports','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x256f90,_0x2187a6){_0x256f90=_0x256f90-0x0;var _0x415016=_0xf4f4[_0x256f90];return _0x415016;};'use strict';var Sequelize=require(_0x4f4f('0x0'));module[_0x4f4f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x4f4f('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x4f4f('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x4f4f('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x4f4f('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x4f4f('0x2')],'set':function(_0x510b24){this[_0x4f4f('0x5')]('crudPermissions',_0x510b24?_0x510b24[_0x4f4f('0x6')](''):[]);},'get':function(){return this[_0x4f4f('0x7')](_0x4f4f('0x8'))?this[_0x4f4f('0x7')](_0x4f4f('0x8'))[_0x4f4f('0x9')](''):[];}}}; \ No newline at end of file +var _0x69d3=['crudPermissions','split','sequelize','exports','STRING','INTEGER','BOOLEAN','join','getDataValue'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x69d3,0xda));var _0x369d=function(_0x24d707,_0x4063d7){_0x24d707=_0x24d707-0x0;var _0x20c44c=_0x69d3[_0x24d707];return _0x20c44c;};'use strict';var Sequelize=require(_0x369d('0x0'));module[_0x369d('0x1')]={'name':{'type':Sequelize[_0x369d('0x2')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0x369d('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x369d('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0xe38740){this['setDataValue']('crudPermissions',_0xe38740?_0xe38740[_0x369d('0x5')](''):[]);},'get':function(){return this[_0x369d('0x6')](_0x369d('0x7'))?this[_0x369d('0x6')](_0x369d('0x7'))[_0x369d('0x8')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index e34a3c4..592bc03 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 _0x7dd5=['reject','save','then','destroy','end','stack','name','send','index','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filters','filter','VIRTUAL','options','includeAll','include','UserProfileSection','findAll','catch','show','params','keys','rawAttributes','merge','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply'];(function(_0x98197,_0xea7356){var _0x5d9199=function(_0x135375){while(--_0x135375){_0x98197['push'](_0x98197['shift']());}};_0x5d9199(++_0xea7356);}(_0x7dd5,0x11b));var _0x57dd=function(_0x3fca37,_0x1dcf07){_0x3fca37=_0x3fca37-0x0;var _0xd06fd5=_0x7dd5[_0x3fca37];return _0xd06fd5;};'use strict';var emlformat=require(_0x57dd('0x0'));var rimraf=require(_0x57dd('0x1'));var zipdir=require(_0x57dd('0x2'));var jsonpatch=require(_0x57dd('0x3'));var rp=require(_0x57dd('0x4'));var moment=require(_0x57dd('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x57dd('0x6'));var util=require(_0x57dd('0x7'));var path=require(_0x57dd('0x8'));var sox=require(_0x57dd('0x9'));var csv=require(_0x57dd('0xa'));var ejs=require(_0x57dd('0xb'));var fs=require('fs');var fs_extra=require(_0x57dd('0xc'));var _=require(_0x57dd('0xd'));var squel=require(_0x57dd('0xe'));var crypto=require(_0x57dd('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x57dd('0x10'));var toCsv=require(_0x57dd('0xa'));var querystring=require('querystring');var Papa=require(_0x57dd('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x57dd('0x12'));var as=require(_0x57dd('0x13'));var hardwareService=require(_0x57dd('0x14'));var logger=require(_0x57dd('0x15'))(_0x57dd('0x16'));var utils=require(_0x57dd('0x17'));var config=require(_0x57dd('0x18'));var licenseUtil=require(_0x57dd('0x19'));var db=require(_0x57dd('0x1a'))['db'];function respondWithStatusCode(_0x177f52,_0x5b14b5){_0x5b14b5=_0x5b14b5||0xcc;return function(_0x4cf556){if(_0x4cf556){return _0x177f52[_0x57dd('0x1b')](_0x5b14b5);}return _0x177f52[_0x57dd('0x1c')](_0x5b14b5)['end']();};}function respondWithResult(_0x53a479,_0x422edf){_0x422edf=_0x422edf||0xc8;return function(_0x23c220){if(_0x23c220){return _0x53a479[_0x57dd('0x1c')](_0x422edf)['json'](_0x23c220);}};}function respondWithFilteredResult(_0x29ad23,_0x211435){return function(_0x5b3f4e){if(_0x5b3f4e){var _0x351922=typeof _0x211435[_0x57dd('0x1d')]===_0x57dd('0x1e')&&typeof _0x211435[_0x57dd('0x1f')]===_0x57dd('0x1e');var _0xd75746=_0x5b3f4e[_0x57dd('0x20')];var _0x128525=_0x351922?0x0:_0x211435[_0x57dd('0x1d')];var _0x1e3844=_0x351922?_0x5b3f4e[_0x57dd('0x20')]:_0x211435[_0x57dd('0x1d')]+_0x211435[_0x57dd('0x1f')];var _0x3cdd96;if(_0x1e3844>=_0xd75746){_0x1e3844=_0xd75746;_0x3cdd96=0xc8;}else{_0x3cdd96=0xce;}_0x29ad23[_0x57dd('0x1c')](_0x3cdd96);return _0x29ad23[_0x57dd('0x21')](_0x57dd('0x22'),_0x128525+'-'+_0x1e3844+'/'+_0xd75746)[_0x57dd('0x23')](_0x5b3f4e);}return null;};}function patchUpdates(_0x5ec0fe){return function(_0xc08fa7){try{jsonpatch[_0x57dd('0x24')](_0xc08fa7,_0x5ec0fe,!![]);}catch(_0x4f694c){return BPromise[_0x57dd('0x25')](_0x4f694c);}return _0xc08fa7[_0x57dd('0x26')]();};}function saveUpdates(_0x553473,_0x42ed35){return function(_0x9f4da4){if(_0x9f4da4){return _0x9f4da4['update'](_0x553473)[_0x57dd('0x27')](function(_0x362537){return _0x362537;});}return null;};}function removeEntity(_0x38ab95,_0x525fb6){return function(_0x5a8f09){if(_0x5a8f09){return _0x5a8f09[_0x57dd('0x28')]()['then'](function(){_0x38ab95[_0x57dd('0x1c')](0xcc)[_0x57dd('0x29')]();});}};}function handleEntityNotFound(_0x4aeaae,_0xb12a64){return function(_0x2e32f9){if(!_0x2e32f9){_0x4aeaae['sendStatus'](0x194);}return _0x2e32f9;};}function handleError(_0x5a3747,_0x5a6732){_0x5a6732=_0x5a6732||0x1f4;return function(_0x5f2c12){logger['error'](_0x5f2c12[_0x57dd('0x2a')]);if(_0x5f2c12[_0x57dd('0x2b')]){delete _0x5f2c12[_0x57dd('0x2b')];}_0x5a3747[_0x57dd('0x1c')](_0x5a6732)[_0x57dd('0x2c')](_0x5f2c12);};}exports[_0x57dd('0x2d')]=function(_0x4b34e6,_0x6ea50a){var _0x3e310f={},_0x58c391={},_0x3f32ba={'count':0x0,'rows':[]};var _0x3db8a6=_['map'](db['UserProfileSection']['rawAttributes'],function(_0x3e5d30){return{'name':_0x3e5d30[_0x57dd('0x2e')],'type':_0x3e5d30[_0x57dd('0x2f')][_0x57dd('0x30')]};});_0x58c391[_0x57dd('0x31')]=_[_0x57dd('0x32')](_0x3db8a6,_0x57dd('0x2b'));_0x58c391[_0x57dd('0x33')]=_['keys'](_0x4b34e6[_0x57dd('0x33')]);_0x58c391['filters']=_[_0x57dd('0x34')](_0x58c391['model'],_0x58c391[_0x57dd('0x33')]);_0x3e310f[_0x57dd('0x35')]=_[_0x57dd('0x34')](_0x58c391[_0x57dd('0x31')],qs[_0x57dd('0x36')](_0x4b34e6[_0x57dd('0x33')][_0x57dd('0x36')]));_0x3e310f[_0x57dd('0x35')]=_0x3e310f[_0x57dd('0x35')][_0x57dd('0x37')]?_0x3e310f[_0x57dd('0x35')]:_0x58c391[_0x57dd('0x31')];if(!_0x4b34e6[_0x57dd('0x33')][_0x57dd('0x38')](_0x57dd('0x39'))){_0x3e310f[_0x57dd('0x1f')]=qs[_0x57dd('0x1f')](_0x4b34e6['query'][_0x57dd('0x1f')]);_0x3e310f[_0x57dd('0x1d')]=qs[_0x57dd('0x1d')](_0x4b34e6[_0x57dd('0x33')][_0x57dd('0x1d')]);}_0x3e310f[_0x57dd('0x3a')]=qs['sort'](_0x4b34e6[_0x57dd('0x33')]['sort']);_0x3e310f[_0x57dd('0x3b')]=qs['filters'](_[_0x57dd('0x3c')](_0x4b34e6[_0x57dd('0x33')],_0x58c391[_0x57dd('0x3d')]),_0x3db8a6);if(_0x4b34e6[_0x57dd('0x33')][_0x57dd('0x3e')]){_0x3e310f[_0x57dd('0x3b')]=_['merge'](_0x3e310f[_0x57dd('0x3b')],{'$or':_[_0x57dd('0x32')](_0x3db8a6,function(_0x5809ab){if(_0x5809ab[_0x57dd('0x2f')]!==_0x57dd('0x3f')){var _0x216a78={};_0x216a78[_0x5809ab[_0x57dd('0x2b')]]={'$like':'%'+_0x4b34e6[_0x57dd('0x33')][_0x57dd('0x3e')]+'%'};return _0x216a78;}})});}_0x3e310f=_['merge']({},_0x3e310f,_0x4b34e6[_0x57dd('0x40')]);var _0x4976c7={'where':_0x3e310f[_0x57dd('0x3b')]};return db['UserProfileSection'][_0x57dd('0x20')](_0x4976c7)[_0x57dd('0x27')](function(_0x1deb99){_0x3f32ba[_0x57dd('0x20')]=_0x1deb99;if(_0x4b34e6[_0x57dd('0x33')][_0x57dd('0x41')]){_0x3e310f[_0x57dd('0x42')]=[{'all':!![]}];}return db[_0x57dd('0x43')][_0x57dd('0x44')](_0x3e310f);})[_0x57dd('0x27')](function(_0xa02c6e){_0x3f32ba['rows']=_0xa02c6e;return _0x3f32ba;})[_0x57dd('0x27')](respondWithFilteredResult(_0x6ea50a,_0x3e310f))[_0x57dd('0x45')](handleError(_0x6ea50a,null));};exports[_0x57dd('0x46')]=function(_0x2c495a,_0x5f5a08){var _0x1d7c38={'raw':![],'where':{'id':_0x2c495a[_0x57dd('0x47')]['id']}},_0x1af511={};_0x1af511[_0x57dd('0x31')]=_[_0x57dd('0x48')](db[_0x57dd('0x43')][_0x57dd('0x49')]);_0x1af511[_0x57dd('0x33')]=_['keys'](_0x2c495a[_0x57dd('0x33')]);_0x1af511[_0x57dd('0x3d')]=_[_0x57dd('0x34')](_0x1af511[_0x57dd('0x31')],_0x1af511[_0x57dd('0x33')]);_0x1d7c38['attributes']=_[_0x57dd('0x34')](_0x1af511[_0x57dd('0x31')],qs['fields'](_0x2c495a[_0x57dd('0x33')]['fields']));_0x1d7c38[_0x57dd('0x35')]=_0x1d7c38[_0x57dd('0x35')][_0x57dd('0x37')]?_0x1d7c38[_0x57dd('0x35')]:_0x1af511[_0x57dd('0x31')];if(_0x2c495a['query'][_0x57dd('0x41')]){_0x1d7c38[_0x57dd('0x42')]=[{'all':!![]}];}_0x1d7c38=_[_0x57dd('0x4a')]({},_0x1d7c38,_0x2c495a[_0x57dd('0x40')]);return db[_0x57dd('0x43')][_0x57dd('0x4b')](_0x1d7c38)[_0x57dd('0x27')](handleEntityNotFound(_0x5f5a08,null))[_0x57dd('0x27')](respondWithResult(_0x5f5a08,null))[_0x57dd('0x45')](handleError(_0x5f5a08,null));};exports[_0x57dd('0x4c')]=function(_0x4ff367,_0x2f06fd){return db[_0x57dd('0x43')][_0x57dd('0x4c')](_0x4ff367[_0x57dd('0x4d')],{})[_0x57dd('0x27')](respondWithResult(_0x2f06fd,0xc9))[_0x57dd('0x45')](handleError(_0x2f06fd,null));};exports[_0x57dd('0x4e')]=function(_0x2e68d6,_0x7f2440){if(_0x2e68d6['body']['id']){delete _0x2e68d6[_0x57dd('0x4d')]['id'];}return db[_0x57dd('0x43')][_0x57dd('0x4b')]({'where':{'id':_0x2e68d6['params']['id']}})[_0x57dd('0x27')](handleEntityNotFound(_0x7f2440,null))[_0x57dd('0x27')](saveUpdates(_0x2e68d6[_0x57dd('0x4d')],null))['then'](respondWithResult(_0x7f2440,null))['catch'](handleError(_0x7f2440,null));};exports['destroy']=function(_0x5df102,_0x4c420e){return db[_0x57dd('0x43')][_0x57dd('0x4b')]({'where':{'id':_0x5df102[_0x57dd('0x47')]['id']}})[_0x57dd('0x27')](handleEntityNotFound(_0x4c420e,null))[_0x57dd('0x27')](removeEntity(_0x4c420e,null))['catch'](handleError(_0x4c420e,null));};exports[_0x57dd('0x4f')]=function(_0x288740,_0x2b3bc0){return db[_0x57dd('0x43')][_0x57dd('0x4f')]()[_0x57dd('0x27')](respondWithResult(_0x2b3bc0,null))[_0x57dd('0x45')](handleError(_0x2b3bc0,null));}; \ No newline at end of file +var _0x5fd3=['end','error','name','index','map','UserProfileSection','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','filters','filter','merge','where','options','includeAll','rows','show','params','rawAttributes','include','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','then'];(function(_0x36aa25,_0x5a31d6){var _0x37e89d=function(_0x483820){while(--_0x483820){_0x36aa25['push'](_0x36aa25['shift']());}};_0x37e89d(++_0x5a31d6);}(_0x5fd3,0x193));var _0x35fd=function(_0xf1d1f1,_0x4dc58f){_0xf1d1f1=_0xf1d1f1-0x0;var _0x15f08c=_0x5fd3[_0xf1d1f1];return _0x15f08c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x35fd('0x0'));var zipdir=require(_0x35fd('0x1'));var jsonpatch=require(_0x35fd('0x2'));var rp=require('request-promise');var moment=require(_0x35fd('0x3'));var BPromise=require(_0x35fd('0x4'));var Mustache=require(_0x35fd('0x5'));var util=require(_0x35fd('0x6'));var path=require('path');var sox=require(_0x35fd('0x7'));var csv=require(_0x35fd('0x8'));var ejs=require(_0x35fd('0x9'));var fs=require('fs');var fs_extra=require(_0x35fd('0xa'));var _=require(_0x35fd('0xb'));var squel=require(_0x35fd('0xc'));var crypto=require(_0x35fd('0xd'));var jsforce=require(_0x35fd('0xe'));var deskjs=require(_0x35fd('0xf'));var toCsv=require(_0x35fd('0x8'));var querystring=require('querystring');var Papa=require(_0x35fd('0x10'));var Redis=require(_0x35fd('0x11'));var authService=require(_0x35fd('0x12'));var qs=require(_0x35fd('0x13'));var as=require(_0x35fd('0x14'));var hardwareService=require(_0x35fd('0x15'));var logger=require(_0x35fd('0x16'))(_0x35fd('0x17'));var utils=require(_0x35fd('0x18'));var config=require(_0x35fd('0x19'));var licenseUtil=require(_0x35fd('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x58703f,_0x1f2821){_0x1f2821=_0x1f2821||0xcc;return function(_0x252734){if(_0x252734){return _0x58703f[_0x35fd('0x1b')](_0x1f2821);}return _0x58703f[_0x35fd('0x1c')](_0x1f2821)['end']();};}function respondWithResult(_0x3c0cd0,_0x4e2d61){_0x4e2d61=_0x4e2d61||0xc8;return function(_0x278b90){if(_0x278b90){return _0x3c0cd0[_0x35fd('0x1c')](_0x4e2d61)[_0x35fd('0x1d')](_0x278b90);}};}function respondWithFilteredResult(_0x4c9523,_0x137841){return function(_0xe2a7e3){if(_0xe2a7e3){var _0x32b0ed=typeof _0x137841[_0x35fd('0x1e')]===_0x35fd('0x1f')&&typeof _0x137841['limit']===_0x35fd('0x1f');var _0x436b5d=_0xe2a7e3[_0x35fd('0x20')];var _0x468cab=_0x32b0ed?0x0:_0x137841[_0x35fd('0x1e')];var _0x24429f=_0x32b0ed?_0xe2a7e3[_0x35fd('0x20')]:_0x137841['offset']+_0x137841[_0x35fd('0x21')];var _0x39be4b;if(_0x24429f>=_0x436b5d){_0x24429f=_0x436b5d;_0x39be4b=0xc8;}else{_0x39be4b=0xce;}_0x4c9523[_0x35fd('0x1c')](_0x39be4b);return _0x4c9523[_0x35fd('0x22')](_0x35fd('0x23'),_0x468cab+'-'+_0x24429f+'/'+_0x436b5d)[_0x35fd('0x1d')](_0xe2a7e3);}return null;};}function patchUpdates(_0x488d1c){return function(_0x4582e8){try{jsonpatch['apply'](_0x4582e8,_0x488d1c,!![]);}catch(_0x267b0f){return BPromise[_0x35fd('0x24')](_0x267b0f);}return _0x4582e8[_0x35fd('0x25')]();};}function saveUpdates(_0x31b8e9,_0x30ff66){return function(_0x50d9c4){if(_0x50d9c4){return _0x50d9c4[_0x35fd('0x26')](_0x31b8e9)['then'](function(_0x6db6fb){return _0x6db6fb;});}return null;};}function removeEntity(_0x7c1c3d,_0xf36f48){return function(_0x226952){if(_0x226952){return _0x226952[_0x35fd('0x27')]()[_0x35fd('0x28')](function(){_0x7c1c3d[_0x35fd('0x1c')](0xcc)[_0x35fd('0x29')]();});}};}function handleEntityNotFound(_0x39f1ae,_0x5699fe){return function(_0x14cd52){if(!_0x14cd52){_0x39f1ae[_0x35fd('0x1b')](0x194);}return _0x14cd52;};}function handleError(_0x3cd761,_0x344ae4){_0x344ae4=_0x344ae4||0x1f4;return function(_0x331e62){logger[_0x35fd('0x2a')](_0x331e62['stack']);if(_0x331e62[_0x35fd('0x2b')]){delete _0x331e62[_0x35fd('0x2b')];}_0x3cd761[_0x35fd('0x1c')](_0x344ae4)['send'](_0x331e62);};}exports[_0x35fd('0x2c')]=function(_0x102b56,_0x4c3d5c){var _0x4a8ae4={},_0x5c37b9={},_0x46325b={'count':0x0,'rows':[]};var _0x532742=_[_0x35fd('0x2d')](db[_0x35fd('0x2e')]['rawAttributes'],function(_0x21f235){return{'name':_0x21f235['fieldName'],'type':_0x21f235[_0x35fd('0x2f')][_0x35fd('0x30')]};});_0x5c37b9[_0x35fd('0x31')]=_[_0x35fd('0x2d')](_0x532742,_0x35fd('0x2b'));_0x5c37b9[_0x35fd('0x32')]=_[_0x35fd('0x33')](_0x102b56[_0x35fd('0x32')]);_0x5c37b9['filters']=_[_0x35fd('0x34')](_0x5c37b9[_0x35fd('0x31')],_0x5c37b9[_0x35fd('0x32')]);_0x4a8ae4[_0x35fd('0x35')]=_[_0x35fd('0x34')](_0x5c37b9[_0x35fd('0x31')],qs[_0x35fd('0x36')](_0x102b56['query']['fields']));_0x4a8ae4[_0x35fd('0x35')]=_0x4a8ae4[_0x35fd('0x35')][_0x35fd('0x37')]?_0x4a8ae4[_0x35fd('0x35')]:_0x5c37b9[_0x35fd('0x31')];if(!_0x102b56[_0x35fd('0x32')]['hasOwnProperty'](_0x35fd('0x38'))){_0x4a8ae4[_0x35fd('0x21')]=qs[_0x35fd('0x21')](_0x102b56[_0x35fd('0x32')][_0x35fd('0x21')]);_0x4a8ae4[_0x35fd('0x1e')]=qs['offset'](_0x102b56[_0x35fd('0x32')][_0x35fd('0x1e')]);}_0x4a8ae4['order']=qs[_0x35fd('0x39')](_0x102b56[_0x35fd('0x32')][_0x35fd('0x39')]);_0x4a8ae4['where']=qs[_0x35fd('0x3a')](_['pick'](_0x102b56[_0x35fd('0x32')],_0x5c37b9[_0x35fd('0x3a')]),_0x532742);if(_0x102b56[_0x35fd('0x32')][_0x35fd('0x3b')]){_0x4a8ae4['where']=_[_0x35fd('0x3c')](_0x4a8ae4[_0x35fd('0x3d')],{'$or':_['map'](_0x532742,function(_0x376433){if(_0x376433['type']!=='VIRTUAL'){var _0x50623c={};_0x50623c[_0x376433['name']]={'$like':'%'+_0x102b56[_0x35fd('0x32')][_0x35fd('0x3b')]+'%'};return _0x50623c;}})});}_0x4a8ae4=_['merge']({},_0x4a8ae4,_0x102b56[_0x35fd('0x3e')]);var _0x2e0018={'where':_0x4a8ae4[_0x35fd('0x3d')]};return db[_0x35fd('0x2e')][_0x35fd('0x20')](_0x2e0018)[_0x35fd('0x28')](function(_0x1438c1){_0x46325b[_0x35fd('0x20')]=_0x1438c1;if(_0x102b56['query'][_0x35fd('0x3f')]){_0x4a8ae4['include']=[{'all':!![]}];}return db[_0x35fd('0x2e')]['findAll'](_0x4a8ae4);})[_0x35fd('0x28')](function(_0x314986){_0x46325b[_0x35fd('0x40')]=_0x314986;return _0x46325b;})['then'](respondWithFilteredResult(_0x4c3d5c,_0x4a8ae4))['catch'](handleError(_0x4c3d5c,null));};exports[_0x35fd('0x41')]=function(_0x3acc34,_0x18e340){var _0x517ff7={'raw':![],'where':{'id':_0x3acc34[_0x35fd('0x42')]['id']}},_0x4679df={};_0x4679df[_0x35fd('0x31')]=_['keys'](db[_0x35fd('0x2e')][_0x35fd('0x43')]);_0x4679df['query']=_[_0x35fd('0x33')](_0x3acc34[_0x35fd('0x32')]);_0x4679df[_0x35fd('0x3a')]=_[_0x35fd('0x34')](_0x4679df[_0x35fd('0x31')],_0x4679df[_0x35fd('0x32')]);_0x517ff7['attributes']=_[_0x35fd('0x34')](_0x4679df[_0x35fd('0x31')],qs[_0x35fd('0x36')](_0x3acc34[_0x35fd('0x32')][_0x35fd('0x36')]));_0x517ff7[_0x35fd('0x35')]=_0x517ff7['attributes']['length']?_0x517ff7[_0x35fd('0x35')]:_0x4679df['model'];if(_0x3acc34['query'][_0x35fd('0x3f')]){_0x517ff7[_0x35fd('0x44')]=[{'all':!![]}];}_0x517ff7=_['merge']({},_0x517ff7,_0x3acc34['options']);return db[_0x35fd('0x2e')][_0x35fd('0x45')](_0x517ff7)[_0x35fd('0x28')](handleEntityNotFound(_0x18e340,null))['then'](respondWithResult(_0x18e340,null))[_0x35fd('0x46')](handleError(_0x18e340,null));};exports[_0x35fd('0x47')]=function(_0x5a4cb3,_0x46dae0){return db[_0x35fd('0x2e')]['create'](_0x5a4cb3[_0x35fd('0x48')],{})[_0x35fd('0x28')](respondWithResult(_0x46dae0,0xc9))[_0x35fd('0x46')](handleError(_0x46dae0,null));};exports['update']=function(_0x4296b2,_0x4b7c17){if(_0x4296b2[_0x35fd('0x48')]['id']){delete _0x4296b2[_0x35fd('0x48')]['id'];}return db[_0x35fd('0x2e')][_0x35fd('0x45')]({'where':{'id':_0x4296b2[_0x35fd('0x42')]['id']}})[_0x35fd('0x28')](handleEntityNotFound(_0x4b7c17,null))['then'](saveUpdates(_0x4296b2[_0x35fd('0x48')],null))['then'](respondWithResult(_0x4b7c17,null))[_0x35fd('0x46')](handleError(_0x4b7c17,null));};exports[_0x35fd('0x27')]=function(_0x2155fb,_0x8760fa){return db[_0x35fd('0x2e')][_0x35fd('0x45')]({'where':{'id':_0x2155fb[_0x35fd('0x42')]['id']}})['then'](handleEntityNotFound(_0x8760fa,null))[_0x35fd('0x28')](removeEntity(_0x8760fa,null))[_0x35fd('0x46')](handleError(_0x8760fa,null));};exports[_0x35fd('0x49')]=function(_0x567bc8,_0x5edb67){return db[_0x35fd('0x2e')][_0x35fd('0x49')]()[_0x35fd('0x28')](respondWithResult(_0x5edb67,null))[_0x35fd('0x46')](handleError(_0x5edb67,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 67f5f8f..32e516c 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 _0x0512=['exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userProfileSection.attributes'];(function(_0x377016,_0x1c7d6d){var _0x3575da=function(_0xecaff9){while(--_0xecaff9){_0x377016['push'](_0x377016['shift']());}};_0x3575da(++_0x1c7d6d);}(_0x0512,0x1e6));var _0x2051=function(_0x55e099,_0x3bd8a9){_0x55e099=_0x55e099-0x0;var _0xcc67fb=_0x0512[_0x55e099];return _0xcc67fb;};'use strict';var _=require(_0x2051('0x0'));var util=require(_0x2051('0x1'));var logger=require(_0x2051('0x2'))(_0x2051('0x3'));var moment=require(_0x2051('0x4'));var BPromise=require(_0x2051('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2051('0x6'));var rimraf=require(_0x2051('0x7'));var config=require(_0x2051('0x8'));var attributes=require(_0x2051('0x9'));module[_0x2051('0xa')]=function(_0x5b7b33,_0x4ea450){return _0x5b7b33[_0x2051('0xb')](_0x2051('0xc'),attributes,{'tableName':_0x2051('0xd'),'paranoid':![],'indexes':[{'name':_0x2051('0xe'),'fields':[_0x2051('0xf'),'userProfileId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x08af=['rimraf','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','lodash','util','api','bluebird','request-promise','path'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x08af,0x1c2));var _0xf08a=function(_0xe30e17,_0xce02be){_0xe30e17=_0xe30e17-0x0;var _0x2342c9=_0x08af[_0xe30e17];return _0x2342c9;};'use strict';var _=require(_0xf08a('0x0'));var util=require(_0xf08a('0x1'));var logger=require('../../config/logger')(_0xf08a('0x2'));var moment=require('moment');var BPromise=require(_0xf08a('0x3'));var rp=require(_0xf08a('0x4'));var fs=require('fs');var path=require(_0xf08a('0x5'));var rimraf=require(_0xf08a('0x6'));var config=require('../../config/environment');var attributes=require('./userProfileSection.attributes');module['exports']=function(_0x14ab52,_0x1671bc){return _0x14ab52[_0xf08a('0x7')](_0xf08a('0x8'),attributes,{'tableName':_0xf08a('0x9'),'paranoid':![],'indexes':[{'name':_0xf08a('0xa'),'fields':[_0xf08a('0xb'),'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 253b6fe..faa2a8a 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 _0x3178=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','UserProfileSection,\x20%s,\x20%s','message','lodash','util','bluebird','randomstring','ioredis'];(function(_0x7c0074,_0x1ffdcf){var _0x13e95b=function(_0x521212){while(--_0x521212){_0x7c0074['push'](_0x7c0074['shift']());}};_0x13e95b(++_0x1ffdcf);}(_0x3178,0x7f));var _0x8317=function(_0xc03fac,_0x5e8753){_0xc03fac=_0xc03fac-0x0;var _0xa1af02=_0x3178[_0xc03fac];return _0xa1af02;};'use strict';var _=require(_0x8317('0x0'));var util=require(_0x8317('0x1'));var moment=require('moment');var BPromise=require(_0x8317('0x2'));var rs=require(_0x8317('0x3'));var fs=require('fs');var Redis=require(_0x8317('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8317('0x5'));var logger=require(_0x8317('0x6'))(_0x8317('0x7'));var config=require(_0x8317('0x8'));var jayson=require(_0x8317('0x9'));var client=jayson[_0x8317('0xa')][_0x8317('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x29976b,_0x49c705,_0x83d6d3){return new BPromise(function(_0x3cff10,_0xf37701){return client[_0x8317('0xc')](_0x29976b,_0x83d6d3)[_0x8317('0xd')](function(_0x3c7eb7){logger[_0x8317('0xe')]('UserProfileSection,\x20%s,\x20%s',_0x49c705,'request\x20sent');logger[_0x8317('0xf')](_0x8317('0x10'),_0x49c705,_0x8317('0x11'),JSON[_0x8317('0x12')](_0x3c7eb7));if(_0x3c7eb7[_0x8317('0x13')]){if(_0x3c7eb7[_0x8317('0x13')]['code']===0x1f4){logger['error'](_0x8317('0x14'),_0x49c705,_0x3c7eb7[_0x8317('0x13')][_0x8317('0x15')]);return _0xf37701(_0x3c7eb7[_0x8317('0x13')][_0x8317('0x15')]);}logger[_0x8317('0x13')]('UserProfileSection,\x20%s,\x20%s',_0x49c705,_0x3c7eb7['error'][_0x8317('0x15')]);return _0x3cff10(_0x3c7eb7[_0x8317('0x13')][_0x8317('0x15')]);}else{logger[_0x8317('0xe')](_0x8317('0x14'),_0x49c705,_0x8317('0x11'));_0x3cff10(_0x3c7eb7['result'][_0x8317('0x15')]);}})['catch'](function(_0x2db59f){logger['error'](_0x8317('0x14'),_0x49c705,_0x2db59f);_0xf37701(_0x2db59f);});});} \ No newline at end of file +var _0x9997=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','error','code','message','catch','UserProfileSection,\x20%s,\x20%s','moment','bluebird','randomstring','ioredis'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9997,0xcb));var _0x7999=function(_0xa45395,_0x5579e6){_0xa45395=_0xa45395-0x0;var _0x3c83d2=_0x9997[_0xa45395];return _0x3c83d2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7999('0x0'));var BPromise=require(_0x7999('0x1'));var rs=require(_0x7999('0x2'));var fs=require('fs');var Redis=require(_0x7999('0x3'));var db=require(_0x7999('0x4'))['db'];var utils=require(_0x7999('0x5'));var logger=require(_0x7999('0x6'))(_0x7999('0x7'));var config=require(_0x7999('0x8'));var jayson=require(_0x7999('0x9'));var client=jayson[_0x7999('0xa')][_0x7999('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1948bc,_0x1d26c4,_0x5bd4b6){return new BPromise(function(_0x518f7c,_0x263404){return client[_0x7999('0xc')](_0x1948bc,_0x5bd4b6)[_0x7999('0xd')](function(_0x341feb){logger[_0x7999('0xe')]('UserProfileSection,\x20%s,\x20%s',_0x1d26c4,_0x7999('0xf'));logger[_0x7999('0x10')](_0x7999('0x11'),_0x1d26c4,'request\x20sent',JSON['stringify'](_0x341feb));if(_0x341feb[_0x7999('0x12')]){if(_0x341feb['error'][_0x7999('0x13')]===0x1f4){logger[_0x7999('0x12')]('UserProfileSection,\x20%s,\x20%s',_0x1d26c4,_0x341feb[_0x7999('0x12')][_0x7999('0x14')]);return _0x263404(_0x341feb['error'][_0x7999('0x14')]);}logger['error']('UserProfileSection,\x20%s,\x20%s',_0x1d26c4,_0x341feb['error']['message']);return _0x518f7c(_0x341feb['error'][_0x7999('0x14')]);}else{logger[_0x7999('0xe')]('UserProfileSection,\x20%s,\x20%s',_0x1d26c4,_0x7999('0xf'));_0x518f7c(_0x341feb['result'][_0x7999('0x14')]);}})[_0x7999('0x15')](function(_0x2095ae){logger[_0x7999('0x12')](_0x7999('0x16'),_0x1d26c4,_0x2095ae);_0x263404(_0x2095ae);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 4a655fa..da859ff 100644 --- a/server/api/userSmsQueue/index.js +++ b/server/api/userSmsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x1b2b2e,_0x36c4c4){var _0x105738=function(_0xa77172){while(--_0xa77172){_0x1b2b2e['push'](_0x1b2b2e['shift']());}};_0x105738(++_0x36c4c4);}(_0xe706,0xa3));var _0x6e70=function(_0x5442d1,_0x193d0e){_0x5442d1=_0x5442d1-0x0;var _0x2f0eaf=_0xe706[_0x5442d1];return _0x2f0eaf;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x2f6994,_0x4d0ec1){var _0x10244b=function(_0x2ecbba){while(--_0x2ecbba){_0x2f6994['push'](_0x2f6994['shift']());}};_0x10244b(++_0x4d0ec1);}(_0xe706,0xa3));var _0x6e70=function(_0x5eab9b,_0x113241){_0x5eab9b=_0x5eab9b-0x0;var _0x16bbc5=_0xe706[_0x5eab9b];return _0x16bbc5;};'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 c35196e..16da91b 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 _0x13f6=['exports'];(function(_0x4f2fdb,_0x3b3d53){var _0x21dc29=function(_0x1b15f6){while(--_0x1b15f6){_0x4f2fdb['push'](_0x4f2fdb['shift']());}};_0x21dc29(++_0x3b3d53);}(_0x13f6,0xaf));var _0x613f=function(_0x2dd085,_0x14a9de){_0x2dd085=_0x2dd085-0x0;var _0x18f010=_0x13f6[_0x2dd085];return _0x18f010;};'use strict';var Sequelize=require('sequelize');module[_0x613f('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xc0d2=['exports','INTEGER'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xc0d2,0x98));var _0x2c0d=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xc0d2[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require('sequelize');module[_0x2c0d('0x0')]={'penalty':{'type':Sequelize[_0x2c0d('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index c463a5c..140e45e 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 _0x2581=['request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api','moment'];(function(_0x539b0c,_0x4a8fbd){var _0x33d740=function(_0x21071f){while(--_0x21071f){_0x539b0c['push'](_0x539b0c['shift']());}};_0x33d740(++_0x4a8fbd);}(_0x2581,0xcb));var _0x1258=function(_0x402c34,_0x4582fd){_0x402c34=_0x402c34-0x0;var _0x2bad90=_0x2581[_0x402c34];return _0x2bad90;};'use strict';var _=require(_0x1258('0x0'));var util=require(_0x1258('0x1'));var logger=require(_0x1258('0x2'))(_0x1258('0x3'));var moment=require(_0x1258('0x4'));var BPromise=require('bluebird');var rp=require(_0x1258('0x5'));var fs=require('fs');var path=require(_0x1258('0x6'));var rimraf=require(_0x1258('0x7'));var config=require(_0x1258('0x8'));var attributes=require(_0x1258('0x9'));module[_0x1258('0xa')]=function(_0x16c926,_0x2aeafc){return _0x16c926['define'](_0x1258('0xb'),attributes,{'tableName':_0x1258('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9bd9=['lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./userSmsQueue.attributes','define','UserSmsQueue','user_has_sms_queues'];(function(_0x40dd56,_0x726ca5){var _0x4f850f=function(_0x5f899e){while(--_0x5f899e){_0x40dd56['push'](_0x40dd56['shift']());}};_0x4f850f(++_0x726ca5);}(_0x9bd9,0x1a4));var _0x99bd=function(_0x2053aa,_0x3df40e){_0x2053aa=_0x2053aa-0x0;var _0x30f5bb=_0x9bd9[_0x2053aa];return _0x30f5bb;};'use strict';var _=require(_0x99bd('0x0'));var util=require(_0x99bd('0x1'));var logger=require(_0x99bd('0x2'))(_0x99bd('0x3'));var moment=require(_0x99bd('0x4'));var BPromise=require(_0x99bd('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x99bd('0x6'));var rimraf=require('rimraf');var config=require(_0x99bd('0x7'));var attributes=require(_0x99bd('0x8'));module['exports']=function(_0xa1cd99,_0x45b939){return _0xa1cd99[_0x99bd('0x9')](_0x99bd('0xa'),attributes,{'tableName':_0x99bd('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 33e2e39..f3d451e 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 _0xcd75=['code','message','info','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','error'];(function(_0x24b052,_0x3da042){var _0x433bc1=function(_0x4c20cc){while(--_0x4c20cc){_0x24b052['push'](_0x24b052['shift']());}};_0x433bc1(++_0x3da042);}(_0xcd75,0x14f));var _0x5cd7=function(_0x15500e,_0x278771){_0x15500e=_0x15500e-0x0;var _0x19a57b=_0xcd75[_0x15500e];return _0x19a57b;};'use strict';var _=require(_0x5cd7('0x0'));var util=require(_0x5cd7('0x1'));var moment=require('moment');var BPromise=require(_0x5cd7('0x2'));var rs=require(_0x5cd7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5cd7('0x4'))['db'];var utils=require(_0x5cd7('0x5'));var logger=require(_0x5cd7('0x6'))(_0x5cd7('0x7'));var config=require(_0x5cd7('0x8'));var jayson=require(_0x5cd7('0x9'));var client=jayson[_0x5cd7('0xa')][_0x5cd7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13bf21,_0x2aaf5,_0x3b7cf8){return new BPromise(function(_0x55dcc1,_0x31c6fd){return client['request'](_0x13bf21,_0x3b7cf8)['then'](function(_0x4ca899){logger['info'](_0x5cd7('0xc'),_0x2aaf5,_0x5cd7('0xd'));logger[_0x5cd7('0xe')](_0x5cd7('0xf'),_0x2aaf5,_0x5cd7('0xd'),JSON['stringify'](_0x4ca899));if(_0x4ca899['error']){if(_0x4ca899[_0x5cd7('0x10')][_0x5cd7('0x11')]===0x1f4){logger[_0x5cd7('0x10')](_0x5cd7('0xc'),_0x2aaf5,_0x4ca899['error'][_0x5cd7('0x12')]);return _0x31c6fd(_0x4ca899[_0x5cd7('0x10')][_0x5cd7('0x12')]);}logger['error'](_0x5cd7('0xc'),_0x2aaf5,_0x4ca899['error']['message']);return _0x55dcc1(_0x4ca899[_0x5cd7('0x10')][_0x5cd7('0x12')]);}else{logger[_0x5cd7('0x13')]('UserSmsQueue,\x20%s,\x20%s',_0x2aaf5,_0x5cd7('0xd'));_0x55dcc1(_0x4ca899[_0x5cd7('0x14')][_0x5cd7('0x12')]);}})[_0x5cd7('0x15')](function(_0x482252){logger[_0x5cd7('0x10')](_0x5cd7('0xc'),_0x2aaf5,_0x482252);_0x31c6fd(_0x482252);});});} \ No newline at end of file +var _0x19f6=['../../config/environment','jayson/promise','request','then','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1937a2,_0x1bbffd){var _0x3347c7=function(_0x2021c3){while(--_0x2021c3){_0x1937a2['push'](_0x1937a2['shift']());}};_0x3347c7(++_0x1bbffd);}(_0x19f6,0x1f0));var _0x619f=function(_0x4ac4d4,_0x5d7418){_0x4ac4d4=_0x4ac4d4-0x0;var _0x272afb=_0x19f6[_0x4ac4d4];return _0x272afb;};'use strict';var _=require(_0x619f('0x0'));var util=require(_0x619f('0x1'));var moment=require(_0x619f('0x2'));var BPromise=require(_0x619f('0x3'));var rs=require(_0x619f('0x4'));var fs=require('fs');var Redis=require(_0x619f('0x5'));var db=require(_0x619f('0x6'))['db'];var utils=require(_0x619f('0x7'));var logger=require(_0x619f('0x8'))(_0x619f('0x9'));var config=require(_0x619f('0xa'));var jayson=require(_0x619f('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x52b898,_0x168271,_0x362ab8){return new BPromise(function(_0x185676,_0x2070b7){return client[_0x619f('0xc')](_0x52b898,_0x362ab8)[_0x619f('0xd')](function(_0x15b9e0){logger['info'](_0x619f('0xe'),_0x168271,_0x619f('0xf'));logger[_0x619f('0x10')](_0x619f('0x11'),_0x168271,'request\x20sent',JSON[_0x619f('0x12')](_0x15b9e0));if(_0x15b9e0[_0x619f('0x13')]){if(_0x15b9e0[_0x619f('0x13')]['code']===0x1f4){logger[_0x619f('0x13')](_0x619f('0xe'),_0x168271,_0x15b9e0['error']['message']);return _0x2070b7(_0x15b9e0[_0x619f('0x13')][_0x619f('0x14')]);}logger[_0x619f('0x13')](_0x619f('0xe'),_0x168271,_0x15b9e0[_0x619f('0x13')][_0x619f('0x14')]);return _0x185676(_0x15b9e0[_0x619f('0x13')]['message']);}else{logger[_0x619f('0x15')](_0x619f('0xe'),_0x168271,_0x619f('0xf'));_0x185676(_0x15b9e0['result'][_0x619f('0x14')]);}})[_0x619f('0x16')](function(_0x841d0c){logger['error'](_0x619f('0xe'),_0x168271,_0x841d0c);_0x2070b7(_0x841d0c);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 09521db..f1e5923 100644 --- a/server/api/userVoiceQueue/index.js +++ b/server/api/userVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x53ad58,_0x3fb489){var _0x554b03=function(_0x5769ba){while(--_0x5769ba){_0x53ad58['push'](_0x53ad58['shift']());}};_0x554b03(++_0x3fb489);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x402282,_0x615de3){var _0x4f65af=function(_0x4a20f7){while(--_0x4a20f7){_0x402282['push'](_0x402282['shift']());}};_0x4f65af(++_0x615de3);}(_0x9c44,0x178));var _0x49c4=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x9c44[_0x36c5b0];return _0xf19333;};'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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 2cd9644..514366e 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 _0x3ea4=['INTEGER','sequelize','exports'];(function(_0x335dc3,_0x349fe3){var _0x5ddcc6=function(_0x940123){while(--_0x940123){_0x335dc3['push'](_0x335dc3['shift']());}};_0x5ddcc6(++_0x349fe3);}(_0x3ea4,0xd6));var _0x43ea=function(_0xf16b1,_0x33c637){_0xf16b1=_0xf16b1-0x0;var _0x26f94d=_0x3ea4[_0xf16b1];return _0x26f94d;};'use strict';var Sequelize=require(_0x43ea('0x0'));module[_0x43ea('0x1')]={'penalty':{'type':Sequelize[_0x43ea('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xaab9=['sequelize'];(function(_0x19e04f,_0x22871f){var _0xce29ee=function(_0x8961c5){while(--_0x8961c5){_0x19e04f['push'](_0x19e04f['shift']());}};_0xce29ee(++_0x22871f);}(_0xaab9,0x159));var _0x9aab=function(_0x515a62,_0x909878){_0x515a62=_0x515a62-0x0;var _0x2aca9c=_0xaab9[_0x515a62];return _0x2aca9c;};'use strict';var Sequelize=require(_0x9aab('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index a5e55b3..9730ad2 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 _0x7366=['path','rimraf','exports','define','UserVoiceQueue','user_has_voice_queues','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1cbdd9,_0x420c37){var _0x99a966=function(_0x6fe48c){while(--_0x6fe48c){_0x1cbdd9['push'](_0x1cbdd9['shift']());}};_0x99a966(++_0x420c37);}(_0x7366,0x13e));var _0x6736=function(_0x293fec,_0x133f38){_0x293fec=_0x293fec-0x0;var _0x405724=_0x7366[_0x293fec];return _0x405724;};'use strict';var _=require(_0x6736('0x0'));var util=require('util');var logger=require(_0x6736('0x1'))(_0x6736('0x2'));var moment=require(_0x6736('0x3'));var BPromise=require(_0x6736('0x4'));var rp=require(_0x6736('0x5'));var fs=require('fs');var path=require(_0x6736('0x6'));var rimraf=require(_0x6736('0x7'));var config=require('../../config/environment');var attributes=require('./userVoiceQueue.attributes');module[_0x6736('0x8')]=function(_0x546607,_0xbf1bac){return _0x546607[_0x6736('0x9')](_0x6736('0xa'),attributes,{'tableName':_0x6736('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcc6f=['lodash','util','../../config/logger','moment','request-promise','rimraf','./userVoiceQueue.attributes','exports','define','user_has_voice_queues'];(function(_0xa5c26,_0x3c5023){var _0x12ea09=function(_0x5da2e3){while(--_0x5da2e3){_0xa5c26['push'](_0xa5c26['shift']());}};_0x12ea09(++_0x3c5023);}(_0xcc6f,0x118));var _0xfcc6=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xcc6f[_0x1969a7];return _0x3d665f;};'use strict';var _=require(_0xfcc6('0x0'));var util=require(_0xfcc6('0x1'));var logger=require(_0xfcc6('0x2'))('api');var moment=require(_0xfcc6('0x3'));var BPromise=require('bluebird');var rp=require(_0xfcc6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfcc6('0x5'));var config=require('../../config/environment');var attributes=require(_0xfcc6('0x6'));module[_0xfcc6('0x7')]=function(_0x3beeb1,_0x4e8792){return _0x3beeb1[_0xfcc6('0x8')]('UserVoiceQueue',attributes,{'tableName':_0xfcc6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index be9ee35..497dd01 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 _0x2228=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','message','info','catch','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x464212,_0x10211c){var _0x19fe7a=function(_0x3c4c8f){while(--_0x3c4c8f){_0x464212['push'](_0x464212['shift']());}};_0x19fe7a(++_0x10211c);}(_0x2228,0x121));var _0x8222=function(_0xe4d394,_0x172eb7){_0xe4d394=_0xe4d394-0x0;var _0x492843=_0x2228[_0xe4d394];return _0x492843;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8222('0x0'));var BPromise=require(_0x8222('0x1'));var rs=require(_0x8222('0x2'));var fs=require('fs');var Redis=require(_0x8222('0x3'));var db=require(_0x8222('0x4'))['db'];var utils=require(_0x8222('0x5'));var logger=require(_0x8222('0x6'))(_0x8222('0x7'));var config=require(_0x8222('0x8'));var jayson=require(_0x8222('0x9'));var client=jayson[_0x8222('0xa')][_0x8222('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f209c,_0x55480e,_0x59bcc3){return new BPromise(function(_0x51bebb,_0x5c12b4){return client['request'](_0x2f209c,_0x59bcc3)[_0x8222('0xc')](function(_0x47ebcd){logger['info'](_0x8222('0xd'),_0x55480e,_0x8222('0xe'));logger[_0x8222('0xf')](_0x8222('0x10'),_0x55480e,'request\x20sent',JSON['stringify'](_0x47ebcd));if(_0x47ebcd[_0x8222('0x11')]){if(_0x47ebcd[_0x8222('0x11')]['code']===0x1f4){logger[_0x8222('0x11')](_0x8222('0xd'),_0x55480e,_0x47ebcd[_0x8222('0x11')][_0x8222('0x12')]);return _0x5c12b4(_0x47ebcd[_0x8222('0x11')]['message']);}logger[_0x8222('0x11')](_0x8222('0xd'),_0x55480e,_0x47ebcd[_0x8222('0x11')]['message']);return _0x51bebb(_0x47ebcd[_0x8222('0x11')][_0x8222('0x12')]);}else{logger[_0x8222('0x13')](_0x8222('0xd'),_0x55480e,_0x8222('0xe'));_0x51bebb(_0x47ebcd['result'][_0x8222('0x12')]);}})[_0x8222('0x14')](function(_0x4ff7d0){logger[_0x8222('0x11')](_0x8222('0xd'),_0x55480e,_0x4ff7d0);_0x5c12b4(_0x4ff7d0);});});} \ No newline at end of file +var _0xcbab=['rpc','../../config/environment','jayson/promise','client','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','ioredis','../../mysqldb'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0xcbab,0xb8));var _0xbcba=function(_0x1416ff,_0x49f1e1){_0x1416ff=_0x1416ff-0x0;var _0x4e28e0=_0xcbab[_0x1416ff];return _0x4e28e0;};'use strict';var _=require(_0xbcba('0x0'));var util=require(_0xbcba('0x1'));var moment=require(_0xbcba('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbcba('0x3'));var db=require(_0xbcba('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xbcba('0x5'));var config=require(_0xbcba('0x6'));var jayson=require(_0xbcba('0x7'));var client=jayson[_0xbcba('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7154fe,_0x4a5d30,_0x3575e9){return new BPromise(function(_0x5793c0,_0x541561){return client[_0xbcba('0x9')](_0x7154fe,_0x3575e9)[_0xbcba('0xa')](function(_0x4dc167){logger[_0xbcba('0xb')](_0xbcba('0xc'),_0x4a5d30,_0xbcba('0xd'));logger[_0xbcba('0xe')](_0xbcba('0xf'),_0x4a5d30,_0xbcba('0xd'),JSON[_0xbcba('0x10')](_0x4dc167));if(_0x4dc167[_0xbcba('0x11')]){if(_0x4dc167['error']['code']===0x1f4){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x4a5d30,_0x4dc167['error'][_0xbcba('0x12')]);return _0x541561(_0x4dc167[_0xbcba('0x11')][_0xbcba('0x12')]);}logger[_0xbcba('0x11')](_0xbcba('0xc'),_0x4a5d30,_0x4dc167[_0xbcba('0x11')]['message']);return _0x5793c0(_0x4dc167[_0xbcba('0x11')][_0xbcba('0x12')]);}else{logger[_0xbcba('0xb')](_0xbcba('0xc'),_0x4a5d30,_0xbcba('0xd'));_0x5793c0(_0x4dc167[_0xbcba('0x13')][_0xbcba('0x12')]);}})[_0xbcba('0x14')](function(_0x37f0d6){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x4a5d30,_0x37f0d6);_0x541561(_0x37f0d6);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 040baee..7f2a331 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x498bc3,_0x20297b){var _0x32467f=function(_0x15f4ee){while(--_0x15f4ee){_0x498bc3['push'](_0x498bc3['shift']());}};_0x32467f(++_0x20297b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x888385,_0x9cdc66){_0x888385=_0x888385-0x0;var _0x22d5c2=_0xcb91[_0x888385];return _0x22d5c2;};'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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x6c013c,_0x5bdd2c){var _0x32cd3a=function(_0x13fc92){while(--_0x13fc92){_0x6c013c['push'](_0x6c013c['shift']());}};_0x32cd3a(++_0x5bdd2c);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 4c76836..2b7bb24 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 _0x41c4=['INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface','exports'];(function(_0x496962,_0x50ce30){var _0x355bd5=function(_0x3946e5){while(--_0x3946e5){_0x496962['push'](_0x496962['shift']());}};_0x355bd5(++_0x50ce30);}(_0x41c4,0x1ee));var _0x441c=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x41c4[_0x376b45];return _0x2341b3;};'use strict';var Sequelize=require('sequelize');module[_0x441c('0x0')]={'uniqueid':{'type':Sequelize[_0x441c('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x441c('0x2')},'membername':{'type':Sequelize[_0x441c('0x3')],'allowNull':![],'comment':_0x441c('0x2')},'UserId':{'type':Sequelize[_0x441c('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x441c('0x3')],'allowNull':![],'unique':_0x441c('0x4'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0x441c('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0x441c('0x3')],'allowNull':![],'unique':_0x441c('0x4'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x441c('0x2')},'paused':{'type':Sequelize[_0x441c('0x1')](0xb),'defaultValue':0x0,'comment':_0x441c('0x2')}}; \ No newline at end of file +var _0x42ff=['sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x1b40ee,_0x319ff1){var _0x4667ce=function(_0x15994b){while(--_0x15994b){_0x1b40ee['push'](_0x1b40ee['shift']());}};_0x4667ce(++_0x319ff1);}(_0x42ff,0xa8));var _0xf42f=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x42ff[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0xf42f('0x0'));module[_0xf42f('0x1')]={'uniqueid':{'type':Sequelize[_0xf42f('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xf42f('0x3')},'membername':{'type':Sequelize[_0xf42f('0x4')],'allowNull':![],'comment':_0xf42f('0x3')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0xf42f('0x4')],'allowNull':![],'unique':_0xf42f('0x5'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0xf42f('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0xf42f('0x4')],'allowNull':![],'unique':_0xf42f('0x5'),'comment':_0xf42f('0x3')},'penalty':{'type':Sequelize[_0xf42f('0x2')](0xb),'defaultValue':0x0,'comment':_0xf42f('0x3')},'paused':{'type':Sequelize[_0xf42f('0x2')](0xb),'defaultValue':0x0,'comment':_0xf42f('0x3')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 9d53773..0fd14bd 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 _0x4d5d=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners'];(function(_0xd48408,_0x293f03){var _0x5c8816=function(_0x434971){while(--_0x434971){_0xd48408['push'](_0xd48408['shift']());}};_0x5c8816(++_0x293f03);}(_0x4d5d,0x188));var _0xd4d5=function(_0x33d9c5,_0x2c159d){_0x33d9c5=_0x33d9c5-0x0;var _0x28f547=_0x4d5d[_0x33d9c5];return _0x28f547;};'use strict';var EventEmitter=require(_0xd4d5('0x0'));var UserVoiceQueueRt=require(_0xd4d5('0x1'))['db'][_0xd4d5('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xd4d5('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd4d5('0x4'),'afterDestroy':'remove'};function emitEvent(_0x118ae7){return function(_0x3f5bc6,_0x3416c9,_0x54774c){UserVoiceQueueRtEvents[_0xd4d5('0x5')](_0x118ae7+':'+_0x3f5bc6['id'],_0x3f5bc6);UserVoiceQueueRtEvents[_0xd4d5('0x5')](_0x118ae7,_0x3f5bc6);_0x54774c(null);};}for(var e in events){if(events[_0xd4d5('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0xd4d5('0x7')](e,emitEvent(event));}}module[_0xd4d5('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x1ad0=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','update','remove','emit'];(function(_0x355f0e,_0x2d6127){var _0x496069=function(_0x5155d2){while(--_0x5155d2){_0x355f0e['push'](_0x355f0e['shift']());}};_0x496069(++_0x2d6127);}(_0x1ad0,0x174));var _0x01ad=function(_0x52121e,_0x4e7ac8){_0x52121e=_0x52121e-0x0;var _0x2d7778=_0x1ad0[_0x52121e];return _0x2d7778;};'use strict';var EventEmitter=require(_0x01ad('0x0'));var UserVoiceQueueRt=require(_0x01ad('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x01ad('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x01ad('0x3'),'afterDestroy':_0x01ad('0x4')};function emitEvent(_0x28b72c){return function(_0x2a3961,_0x4e29b2,_0x508c83){UserVoiceQueueRtEvents[_0x01ad('0x5')](_0x28b72c+':'+_0x2a3961['id'],_0x2a3961);UserVoiceQueueRtEvents['emit'](_0x28b72c,_0x2a3961);_0x508c83(null);};}for(var e in events){if(events[_0x01ad('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0x01ad('0x7')](e,emitEvent(event));}}module[_0x01ad('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 8ec0e88..617c4cb 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 _0xd51f=['exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes'];(function(_0x9fd314,_0x4ea791){var _0x39d36a=function(_0x358f07){while(--_0x358f07){_0x9fd314['push'](_0x9fd314['shift']());}};_0x39d36a(++_0x4ea791);}(_0xd51f,0x1be));var _0xfd51=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xd51f[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0xfd51('0x0'));var util=require('util');var logger=require(_0xfd51('0x1'))(_0xfd51('0x2'));var moment=require(_0xfd51('0x3'));var BPromise=require('bluebird');var rp=require(_0xfd51('0x4'));var fs=require('fs');var path=require(_0xfd51('0x5'));var rimraf=require(_0xfd51('0x6'));var config=require(_0xfd51('0x7'));var attributes=require(_0xfd51('0x8'));module[_0xfd51('0x9')]=function(_0x19f984,_0x2819bb){return _0x19f984[_0xfd51('0xa')](_0xfd51('0xb'),attributes,{'tableName':_0xfd51('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x96c1=['define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','api','moment','request-promise','rimraf','../../config/environment','./userVoiceQueueRt.attributes'];(function(_0x20ef76,_0x372e10){var _0x57c9c8=function(_0x9f8347){while(--_0x9f8347){_0x20ef76['push'](_0x20ef76['shift']());}};_0x57c9c8(++_0x372e10);}(_0x96c1,0x1c5));var _0x196c=function(_0x57ba10,_0x109d97){_0x57ba10=_0x57ba10-0x0;var _0x3b2cea=_0x96c1[_0x57ba10];return _0x3b2cea;};'use strict';var _=require(_0x196c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x196c('0x1'));var moment=require(_0x196c('0x2'));var BPromise=require('bluebird');var rp=require(_0x196c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x196c('0x4'));var config=require(_0x196c('0x5'));var attributes=require(_0x196c('0x6'));module['exports']=function(_0x2ce12f,_0x4d3927){return _0x2ce12f[_0x196c('0x7')](_0x196c('0x8'),attributes,{'tableName':_0x196c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index 57ef76f..e34ab0d 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 _0x1c30=['rpc','client','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','request','info','UserVoiceQueueRt,\x20%s,\x20%s','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','sequelize','COUNT','literal','outboundQueuePauses','then','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4f2b8c,_0x4012c8){var _0x1226ae=function(_0x495689){while(--_0x495689){_0x4f2b8c['push'](_0x4f2b8c['shift']());}};_0x1226ae(++_0x4012c8);}(_0x1c30,0x156));var _0x01c3=function(_0x5c814d,_0x4d81c7){_0x5c814d=_0x5c814d-0x0;var _0x89b71=_0x1c30[_0x5c814d];return _0x89b71;};'use strict';var _=require(_0x01c3('0x0'));var util=require(_0x01c3('0x1'));var moment=require(_0x01c3('0x2'));var BPromise=require(_0x01c3('0x3'));var rs=require(_0x01c3('0x4'));var fs=require('fs');var Redis=require(_0x01c3('0x5'));var db=require(_0x01c3('0x6'))['db'];var utils=require(_0x01c3('0x7'));var logger=require('../../config/logger')(_0x01c3('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x01c3('0x9')]['http']({'port':0x232a});config['redis']=_[_0x01c3('0xa')](config['redis'],{'host':_0x01c3('0xb'),'port':0x18eb});var socket=require(_0x01c3('0xc'))(new Redis(config['redis']));require(_0x01c3('0xd'))['register'](socket);function respondWithRpcPromise(_0x1ff0cc,_0x201468,_0x43d92a){return new BPromise(function(_0x2dd50f,_0x202079){return client[_0x01c3('0xe')](_0x1ff0cc,_0x43d92a)['then'](function(_0x66ae04){logger[_0x01c3('0xf')](_0x01c3('0x10'),_0x201468,'request\x20sent');logger[_0x01c3('0x11')](_0x01c3('0x12'),_0x201468,_0x01c3('0x13'),JSON['stringify'](_0x66ae04));if(_0x66ae04[_0x01c3('0x14')]){if(_0x66ae04[_0x01c3('0x14')]['code']===0x1f4){logger[_0x01c3('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x201468,_0x66ae04[_0x01c3('0x14')][_0x01c3('0x15')]);return _0x202079(_0x66ae04['error'][_0x01c3('0x15')]);}logger['error'](_0x01c3('0x10'),_0x201468,_0x66ae04[_0x01c3('0x14')][_0x01c3('0x15')]);return _0x2dd50f(_0x66ae04[_0x01c3('0x14')][_0x01c3('0x15')]);}else{logger[_0x01c3('0xf')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x201468,_0x01c3('0x13'));_0x2dd50f(_0x66ae04[_0x01c3('0x16')][_0x01c3('0x15')]);}})[_0x01c3('0x17')](function(_0xdf8e27){logger[_0x01c3('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x201468,_0xdf8e27);_0x202079(_0xdf8e27);});});}exports[_0x01c3('0x18')]=function(_0x3acc05){var _0x323851=this;return new Promise(function(_0x46d1cc,_0x9d8a2f){return db[_0x01c3('0x19')][_0x01c3('0x1a')]({'raw':_0x3acc05[_0x01c3('0x1b')]?_0x3acc05[_0x01c3('0x1b')][_0x01c3('0x1c')]===undefined?!![]:![]:!![],'where':_0x3acc05[_0x01c3('0x1b')]?_0x3acc05['options']['where']||null:null,'attributes':[[db[_0x01c3('0x1d')]['fn'](_0x01c3('0x1e'),db[_0x01c3('0x1d')]['fn']('IF',db[_0x01c3('0x1d')][_0x01c3('0x1f')]('`paused`\x20=\x201,\x201,\x20null'))),_0x01c3('0x20')]]})[_0x01c3('0x21')](function(_0x4b7609){logger[_0x01c3('0xf')](_0x01c3('0x18'),_0x3acc05);logger[_0x01c3('0x11')](_0x01c3('0x18'),_0x3acc05,JSON[_0x01c3('0x22')](_0x4b7609));_0x46d1cc(_0x4b7609);})[_0x01c3('0x17')](function(_0x3babd3){logger['error'](_0x01c3('0x18'),_0x3babd3[_0x01c3('0x15')],_0x3acc05);_0x9d8a2f(_0x323851[_0x01c3('0x14')](0x1f4,_0x3babd3[_0x01c3('0x15')]));});});}; \ No newline at end of file +var _0x5eae=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./userVoiceQueueRt.socket','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVoiceQueueRtPauses','findAll','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null'];(function(_0x1ed184,_0x27b33b){var _0x23e4a1=function(_0x1f8369){while(--_0x1f8369){_0x1ed184['push'](_0x1ed184['shift']());}};_0x23e4a1(++_0x27b33b);}(_0x5eae,0x103));var _0xe5ea=function(_0x220ff1,_0x11341d){_0x220ff1=_0x220ff1-0x0;var _0x1ec5ed=_0x5eae[_0x220ff1];return _0x1ec5ed;};'use strict';var _=require(_0xe5ea('0x0'));var util=require(_0xe5ea('0x1'));var moment=require(_0xe5ea('0x2'));var BPromise=require(_0xe5ea('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe5ea('0x4'));var db=require(_0xe5ea('0x5'))['db'];var utils=require(_0xe5ea('0x6'));var logger=require(_0xe5ea('0x7'))(_0xe5ea('0x8'));var config=require('../../config/environment');var jayson=require(_0xe5ea('0x9'));var client=jayson[_0xe5ea('0xa')][_0xe5ea('0xb')]({'port':0x232a});config[_0xe5ea('0xc')]=_['defaults'](config[_0xe5ea('0xc')],{'host':_0xe5ea('0xd'),'port':0x18eb});var socket=require(_0xe5ea('0xe'))(new Redis(config[_0xe5ea('0xc')]));require(_0xe5ea('0xf'))['register'](socket);function respondWithRpcPromise(_0x29d846,_0x3f8a26,_0x4a95ef){return new BPromise(function(_0x30728c,_0xb1809b){return client[_0xe5ea('0x10')](_0x29d846,_0x4a95ef)[_0xe5ea('0x11')](function(_0x4ee87a){logger[_0xe5ea('0x12')](_0xe5ea('0x13'),_0x3f8a26,_0xe5ea('0x14'));logger[_0xe5ea('0x15')](_0xe5ea('0x16'),_0x3f8a26,_0xe5ea('0x14'),JSON[_0xe5ea('0x17')](_0x4ee87a));if(_0x4ee87a[_0xe5ea('0x18')]){if(_0x4ee87a[_0xe5ea('0x18')][_0xe5ea('0x19')]===0x1f4){logger[_0xe5ea('0x18')](_0xe5ea('0x13'),_0x3f8a26,_0x4ee87a['error'][_0xe5ea('0x1a')]);return _0xb1809b(_0x4ee87a[_0xe5ea('0x18')][_0xe5ea('0x1a')]);}logger[_0xe5ea('0x18')](_0xe5ea('0x13'),_0x3f8a26,_0x4ee87a[_0xe5ea('0x18')][_0xe5ea('0x1a')]);return _0x30728c(_0x4ee87a[_0xe5ea('0x18')][_0xe5ea('0x1a')]);}else{logger[_0xe5ea('0x12')](_0xe5ea('0x13'),_0x3f8a26,_0xe5ea('0x14'));_0x30728c(_0x4ee87a['result']['message']);}})[_0xe5ea('0x1b')](function(_0x28e591){logger[_0xe5ea('0x18')](_0xe5ea('0x13'),_0x3f8a26,_0x28e591);_0xb1809b(_0x28e591);});});}exports[_0xe5ea('0x1c')]=function(_0x56561f){var _0x1209de=this;return new Promise(function(_0x4f8c20,_0x49b7ad){return db['UserVoiceQueueRt'][_0xe5ea('0x1d')]({'raw':_0x56561f[_0xe5ea('0x1e')]?_0x56561f[_0xe5ea('0x1e')][_0xe5ea('0x1f')]===undefined?!![]:![]:!![],'where':_0x56561f[_0xe5ea('0x1e')]?_0x56561f[_0xe5ea('0x1e')][_0xe5ea('0x20')]||null:null,'attributes':[[db[_0xe5ea('0x21')]['fn'](_0xe5ea('0x22'),db[_0xe5ea('0x21')]['fn']('IF',db[_0xe5ea('0x21')][_0xe5ea('0x23')](_0xe5ea('0x24')))),'outboundQueuePauses']]})['then'](function(_0x40f6fc){logger[_0xe5ea('0x12')](_0xe5ea('0x1c'),_0x56561f);logger[_0xe5ea('0x15')](_0xe5ea('0x1c'),_0x56561f,JSON[_0xe5ea('0x17')](_0x40f6fc));_0x4f8c20(_0x40f6fc);})[_0xe5ea('0x1b')](function(_0x5b040f){logger[_0xe5ea('0x18')](_0xe5ea('0x1c'),_0x5b040f[_0xe5ea('0x1a')],_0x56561f);_0x49b7ad(_0x1209de[_0xe5ea('0x18')](0x1f4,_0x5b040f[_0xe5ea('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index bf569a3..22a6045 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 _0x7e4b=['save','update','emit','removeListener','register','userVoiceQueueRt:','./userVoiceQueueRt.events'];(function(_0x3b68ff,_0x4b03a5){var _0x589872=function(_0x576a06){while(--_0x576a06){_0x3b68ff['push'](_0x3b68ff['shift']());}};_0x589872(++_0x4b03a5);}(_0x7e4b,0x84));var _0xb7e4=function(_0x5441de,_0x3b30ab){_0x5441de=_0x5441de-0x0;var _0x324e43=_0x7e4b[_0x5441de];return _0x324e43;};'use strict';var UserVoiceQueueRtEvents=require(_0xb7e4('0x0'));var events=[_0xb7e4('0x1'),'remove',_0xb7e4('0x2')];function createListener(_0x802d62,_0x546114){return function(_0x3d3eed){_0x546114[_0xb7e4('0x3')](_0x802d62,_0x3d3eed);};}function removeListener(_0x2fca1d,_0x32f781){return function(){UserVoiceQueueRtEvents[_0xb7e4('0x4')](_0x2fca1d,_0x32f781);};}exports[_0xb7e4('0x5')]=function(_0x39c1fd){for(var _0x2f1b05=0x0,_0x1d49a7=events['length'];_0x2f1b05<_0x1d49a7;_0x2f1b05++){var _0x334af2=events[_0x2f1b05];var _0x5e4a34=createListener(_0xb7e4('0x6')+_0x334af2,_0x39c1fd);UserVoiceQueueRtEvents['on'](_0x334af2,_0x5e4a34);}}; \ No newline at end of file +var _0x37c5=['remove','update','emit','removeListener','userVoiceQueueRt:','save'];(function(_0x150f7e,_0x4ac445){var _0x306945=function(_0x6b0485){while(--_0x6b0485){_0x150f7e['push'](_0x150f7e['shift']());}};_0x306945(++_0x4ac445);}(_0x37c5,0xa7));var _0x537c=function(_0x402d4f,_0x295820){_0x402d4f=_0x402d4f-0x0;var _0x359867=_0x37c5[_0x402d4f];return _0x359867;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x537c('0x0'),_0x537c('0x1'),_0x537c('0x2')];function createListener(_0x11f076,_0x1c5b5f){return function(_0x183b59){_0x1c5b5f[_0x537c('0x3')](_0x11f076,_0x183b59);};}function removeListener(_0x42bd15,_0x2c0854){return function(){UserVoiceQueueRtEvents[_0x537c('0x4')](_0x42bd15,_0x2c0854);};}exports['register']=function(_0x42c86a){for(var _0x1156f4=0x0,_0x336920=events['length'];_0x1156f4<_0x336920;_0x1156f4++){var _0x36bf4a=events[_0x1156f4];var _0x67f986=createListener(_0x537c('0x5')+_0x36bf4a,_0x42c86a);UserVoiceQueueRtEvents['on'](_0x36bf4a,_0x67f986);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 053590d..9410e74 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(_0x56e80c,_0xd0f2eb){var _0x2ece80=function(_0x222104){while(--_0x222104){_0x56e80c['push'](_0x56e80c['shift']());}};_0x2ece80(++_0xd0f2eb);}(_0x9c44,0x178));var _0x49c4=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x9c44[_0x45d55e];return _0x29812a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x155292,_0x53ba99){var _0x56389f=function(_0x481517){while(--_0x481517){_0x155292['push'](_0x155292['shift']());}};_0x56389f(++_0x53ba99);}(_0x70e0,0x17b));var _0x070e=function(_0x1593d3,_0x4002d0){_0x1593d3=_0x1593d3-0x0;var _0x453e7e=_0x70e0[_0x1593d3];return _0x453e7e;};'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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index d9d6f2e..99034a1 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 _0xc1a6=['sequelize','exports','INTEGER'];(function(_0x362046,_0x5cf93f){var _0x419ffe=function(_0x18cb42){while(--_0x18cb42){_0x362046['push'](_0x362046['shift']());}};_0x419ffe(++_0x5cf93f);}(_0xc1a6,0xc6));var _0x6c1a=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xc1a6[_0xbb091];return _0x467a04;};'use strict';var Sequelize=require(_0x6c1a('0x0'));module[_0x6c1a('0x1')]={'penalty':{'type':Sequelize[_0x6c1a('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x33bf=['exports','INTEGER','sequelize'];(function(_0x2bb13f,_0x407ab8){var _0x21e336=function(_0x5509f4){while(--_0x5509f4){_0x2bb13f['push'](_0x2bb13f['shift']());}};_0x21e336(++_0x407ab8);}(_0x33bf,0x125));var _0xf33b=function(_0x79cd47,_0x16102d){_0x79cd47=_0x79cd47-0x0;var _0x3b9484=_0x33bf[_0x79cd47];return _0x3b9484;};'use strict';var Sequelize=require(_0xf33b('0x0'));module[_0xf33b('0x1')]={'penalty':{'type':Sequelize[_0xf33b('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 9b81ace..b02fac9 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 _0x0818=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','define','user_has_whatsapp_queues','util','../../config/logger'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0818,0x15a));var _0x8081=function(_0x4d6a4d,_0x3c9aaf){_0x4d6a4d=_0x4d6a4d-0x0;var _0x5d06cc=_0x0818[_0x4d6a4d];return _0x5d06cc;};'use strict';var _=require('lodash');var util=require(_0x8081('0x0'));var logger=require(_0x8081('0x1'))(_0x8081('0x2'));var moment=require(_0x8081('0x3'));var BPromise=require(_0x8081('0x4'));var rp=require(_0x8081('0x5'));var fs=require('fs');var path=require(_0x8081('0x6'));var rimraf=require(_0x8081('0x7'));var config=require(_0x8081('0x8'));var attributes=require(_0x8081('0x9'));module['exports']=function(_0x20acfa,_0x156bdc){return _0x20acfa[_0x8081('0xa')]('UserWhatsappQueue',attributes,{'tableName':_0x8081('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d26=['lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','user_has_whatsapp_queues'];(function(_0x22a846,_0x4a7afe){var _0x2c8431=function(_0x56952d){while(--_0x56952d){_0x22a846['push'](_0x22a846['shift']());}};_0x2c8431(++_0x4a7afe);}(_0x7d26,0x11e));var _0x67d2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7d26[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x67d2('0x0'));var util=require('util');var logger=require(_0x67d2('0x1'))(_0x67d2('0x2'));var moment=require('moment');var BPromise=require(_0x67d2('0x3'));var rp=require(_0x67d2('0x4'));var fs=require('fs');var path=require(_0x67d2('0x5'));var rimraf=require(_0x67d2('0x6'));var config=require(_0x67d2('0x7'));var attributes=require(_0x67d2('0x8'));module[_0x67d2('0x9')]=function(_0x3343fc,_0x44e59b){return _0x3343fc['define']('UserWhatsappQueue',attributes,{'tableName':_0x67d2('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 4bc2bf3..47f7504 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 _0x5c84=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','ioredis','../../mysqldb'];(function(_0xd6d2b9,_0x48c95a){var _0x2a51c5=function(_0x5133ce){while(--_0x5133ce){_0xd6d2b9['push'](_0xd6d2b9['shift']());}};_0x2a51c5(++_0x48c95a);}(_0x5c84,0x1ca));var _0x45c8=function(_0x25abc5,_0x51df2c){_0x25abc5=_0x25abc5-0x0;var _0x241cbb=_0x5c84[_0x25abc5];return _0x241cbb;};'use strict';var _=require(_0x45c8('0x0'));var util=require(_0x45c8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x45c8('0x2'));var db=require(_0x45c8('0x3'))['db'];var utils=require(_0x45c8('0x4'));var logger=require(_0x45c8('0x5'))('rpc');var config=require(_0x45c8('0x6'));var jayson=require(_0x45c8('0x7'));var client=jayson[_0x45c8('0x8')][_0x45c8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e95b8,_0x2ed71a,_0x14f633){return new BPromise(function(_0xeda095,_0x5e949d){return client[_0x45c8('0xa')](_0x5e95b8,_0x14f633)[_0x45c8('0xb')](function(_0xcce490){logger[_0x45c8('0xc')](_0x45c8('0xd'),_0x2ed71a,'request\x20sent');logger[_0x45c8('0xe')](_0x45c8('0xf'),_0x2ed71a,_0x45c8('0x10'),JSON[_0x45c8('0x11')](_0xcce490));if(_0xcce490[_0x45c8('0x12')]){if(_0xcce490[_0x45c8('0x12')][_0x45c8('0x13')]===0x1f4){logger[_0x45c8('0x12')](_0x45c8('0xd'),_0x2ed71a,_0xcce490[_0x45c8('0x12')][_0x45c8('0x14')]);return _0x5e949d(_0xcce490[_0x45c8('0x12')][_0x45c8('0x14')]);}logger[_0x45c8('0x12')]('UserWhatsappQueue,\x20%s,\x20%s',_0x2ed71a,_0xcce490[_0x45c8('0x12')][_0x45c8('0x14')]);return _0xeda095(_0xcce490[_0x45c8('0x12')][_0x45c8('0x14')]);}else{logger[_0x45c8('0xc')](_0x45c8('0xd'),_0x2ed71a,_0x45c8('0x10'));_0xeda095(_0xcce490[_0x45c8('0x15')][_0x45c8('0x14')]);}})['catch'](function(_0x3a8c35){logger[_0x45c8('0x12')]('UserWhatsappQueue,\x20%s,\x20%s',_0x2ed71a,_0x3a8c35);_0x5e949d(_0x3a8c35);});});} \ No newline at end of file +var _0x3a66=['jayson/promise','client','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x3f6cb0,_0xd95c79){var _0x2bcd8f=function(_0x5acbec){while(--_0x5acbec){_0x3f6cb0['push'](_0x3f6cb0['shift']());}};_0x2bcd8f(++_0xd95c79);}(_0x3a66,0x1b2));var _0x63a6=function(_0x1ccbcc,_0x5c948b){_0x1ccbcc=_0x1ccbcc-0x0;var _0x1e873f=_0x3a66[_0x1ccbcc];return _0x1e873f;};'use strict';var _=require(_0x63a6('0x0'));var util=require(_0x63a6('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x63a6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x63a6('0x3'));var logger=require(_0x63a6('0x4'))(_0x63a6('0x5'));var config=require('../../config/environment');var jayson=require(_0x63a6('0x6'));var client=jayson[_0x63a6('0x7')][_0x63a6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x519fd4,_0x91384c,_0x3b3a73){return new BPromise(function(_0x56356d,_0x273189){return client[_0x63a6('0x9')](_0x519fd4,_0x3b3a73)[_0x63a6('0xa')](function(_0x3faf9e){logger[_0x63a6('0xb')](_0x63a6('0xc'),_0x91384c,_0x63a6('0xd'));logger[_0x63a6('0xe')](_0x63a6('0xf'),_0x91384c,_0x63a6('0xd'),JSON[_0x63a6('0x10')](_0x3faf9e));if(_0x3faf9e[_0x63a6('0x11')]){if(_0x3faf9e['error'][_0x63a6('0x12')]===0x1f4){logger['error'](_0x63a6('0xc'),_0x91384c,_0x3faf9e[_0x63a6('0x11')]['message']);return _0x273189(_0x3faf9e[_0x63a6('0x11')][_0x63a6('0x13')]);}logger[_0x63a6('0x11')]('UserWhatsappQueue,\x20%s,\x20%s',_0x91384c,_0x3faf9e['error']['message']);return _0x56356d(_0x3faf9e['error'][_0x63a6('0x13')]);}else{logger[_0x63a6('0xb')]('UserWhatsappQueue,\x20%s,\x20%s',_0x91384c,_0x63a6('0xd'));_0x56356d(_0x3faf9e[_0x63a6('0x14')][_0x63a6('0x13')]);}})[_0x63a6('0x15')](function(_0x2644c0){logger[_0x63a6('0x11')](_0x63a6('0xc'),_0x91384c,_0x2644c0);_0x273189(_0x2644c0);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 4ba3fae..cc2c6e7 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 _0xc02d=['../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','index','/:id','isAuthenticated','create','put','delete','destroy','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x4b5b90,_0x25f0f5){var _0x1ad181=function(_0x45d59c){while(--_0x45d59c){_0x4b5b90['push'](_0x4b5b90['shift']());}};_0x1ad181(++_0x25f0f5);}(_0xc02d,0x1aa));var _0xdc02=function(_0x3b44a0,_0x240182){_0x3b44a0=_0x3b44a0-0x0;var _0x359a80=_0xc02d[_0x3b44a0];return _0x359a80;};'use strict';var multer=require('multer');var util=require(_0xdc02('0x0'));var path=require(_0xdc02('0x1'));var timeout=require(_0xdc02('0x2'));var express=require(_0xdc02('0x3'));var router=express[_0xdc02('0x4')]();var fs_extra=require(_0xdc02('0x5'));var auth=require(_0xdc02('0x6'));var interaction=require(_0xdc02('0x7'));var config=require(_0xdc02('0x8'));var controller=require(_0xdc02('0x9'));router[_0xdc02('0xa')]('/',auth['isAuthenticated'](),controller[_0xdc02('0xb')]);router[_0xdc02('0xa')](_0xdc02('0xc'),auth[_0xdc02('0xd')](),controller['show']);router['post']('/',auth[_0xdc02('0xd')](),controller[_0xdc02('0xe')]);router[_0xdc02('0xf')]('/:id',auth[_0xdc02('0xd')](),controller['update']);router[_0xdc02('0x10')](_0xdc02('0xc'),auth[_0xdc02('0xd')](),controller[_0xdc02('0x11')]);module['exports']=router; \ No newline at end of file +var _0xe64a=['create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','isAuthenticated','index','get','/:id','show','post'];(function(_0xf77fa6,_0x4c9df8){var _0x5bd317=function(_0x4af34a){while(--_0x4af34a){_0xf77fa6['push'](_0xf77fa6['shift']());}};_0x5bd317(++_0x4c9df8);}(_0xe64a,0x1e0));var _0xae64=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xe64a[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0xae64('0x0'));var util=require(_0xae64('0x1'));var path=require(_0xae64('0x2'));var timeout=require(_0xae64('0x3'));var express=require(_0xae64('0x4'));var router=express[_0xae64('0x5')]();var fs_extra=require(_0xae64('0x6'));var auth=require(_0xae64('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./variable.controller');router['get']('/',auth[_0xae64('0x8')](),controller[_0xae64('0x9')]);router[_0xae64('0xa')](_0xae64('0xb'),auth[_0xae64('0x8')](),controller[_0xae64('0xc')]);router[_0xae64('0xd')]('/',auth[_0xae64('0x8')](),controller[_0xae64('0xe')]);router[_0xae64('0xf')](_0xae64('0xb'),auth['isAuthenticated'](),controller[_0xae64('0x10')]);router['delete']('/:id',auth[_0xae64('0x8')](),controller[_0xae64('0x11')]);module[_0xae64('0x12')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 712108c..c35e6f4 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 _0x09f1=['exports','name','STRING','sequelize'];(function(_0x21b99d,_0x46fbc9){var _0x31335a=function(_0x3985a8){while(--_0x3985a8){_0x21b99d['push'](_0x21b99d['shift']());}};_0x31335a(++_0x46fbc9);}(_0x09f1,0xbf));var _0x109f=function(_0x155fdf,_0x4e743c){_0x155fdf=_0x155fdf-0x0;var _0x31a9a1=_0x09f1[_0x155fdf];return _0x31a9a1;};'use strict';var Sequelize=require(_0x109f('0x0'));module[_0x109f('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x109f('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x109f('0x3')]}}; \ No newline at end of file +var _0xbdb7=['name','sequelize','exports','STRING'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xbdb7,0x125));var _0x7bdb=function(_0xf51c06,_0x388e5b){_0xf51c06=_0xf51c06-0x0;var _0x1d5420=_0xbdb7[_0xf51c06];return _0x1d5420;};'use strict';var Sequelize=require(_0x7bdb('0x0'));module[_0x7bdb('0x1')]={'name':{'type':Sequelize[_0x7bdb('0x2')],'unique':_0x7bdb('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7bdb('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 1a04878..493621b 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 _0xe38c=['includeAll','include','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','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','sox','to-csv','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','offset','undefined','limit','count','status','Content-Range','json','reject','save','update','destroy','then','get','UserProfileResource','end','error','name','send','index','map','Variable','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','options'];(function(_0x55d829,_0x43f06c){var _0x52163b=function(_0x493cd8){while(--_0x493cd8){_0x55d829['push'](_0x55d829['shift']());}};_0x52163b(++_0x43f06c);}(_0xe38c,0x19f));var _0xce38=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xe38c[_0x56482c];return _0x5aae7a;};'use strict';var emlformat=require(_0xce38('0x0'));var rimraf=require(_0xce38('0x1'));var zipdir=require(_0xce38('0x2'));var jsonpatch=require(_0xce38('0x3'));var rp=require(_0xce38('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xce38('0x5'));var util=require(_0xce38('0x6'));var path=require(_0xce38('0x7'));var sox=require(_0xce38('0x8'));var csv=require(_0xce38('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xce38('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xce38('0xb'));var deskjs=require(_0xce38('0xc'));var toCsv=require(_0xce38('0x9'));var querystring=require(_0xce38('0xd'));var Papa=require(_0xce38('0xe'));var Redis=require(_0xce38('0xf'));var authService=require(_0xce38('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xce38('0x11'));var hardwareService=require(_0xce38('0x12'));var logger=require(_0xce38('0x13'))(_0xce38('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xce38('0x15'));var db=require(_0xce38('0x16'))['db'];function respondWithStatusCode(_0x21d0d0,_0x523c73){_0x523c73=_0x523c73||0xcc;return function(_0x2bef61){if(_0x2bef61){return _0x21d0d0['sendStatus'](_0x523c73);}return _0x21d0d0['status'](_0x523c73)['end']();};}function respondWithResult(_0x4c8fbe,_0xd5a6ce){_0xd5a6ce=_0xd5a6ce||0xc8;return function(_0x5dd50d){if(_0x5dd50d){return _0x4c8fbe['status'](_0xd5a6ce)['json'](_0x5dd50d);}};}function respondWithFilteredResult(_0x1ac18b,_0x461957){return function(_0x360ebe){if(_0x360ebe){var _0xd3c0ab=typeof _0x461957[_0xce38('0x17')]===_0xce38('0x18')&&typeof _0x461957[_0xce38('0x19')]===_0xce38('0x18');var _0xefa76c=_0x360ebe[_0xce38('0x1a')];var _0xb3aae2=_0xd3c0ab?0x0:_0x461957['offset'];var _0x11bfc6=_0xd3c0ab?_0x360ebe[_0xce38('0x1a')]:_0x461957[_0xce38('0x17')]+_0x461957[_0xce38('0x19')];var _0x19cf73;if(_0x11bfc6>=_0xefa76c){_0x11bfc6=_0xefa76c;_0x19cf73=0xc8;}else{_0x19cf73=0xce;}_0x1ac18b[_0xce38('0x1b')](_0x19cf73);return _0x1ac18b['set'](_0xce38('0x1c'),_0xb3aae2+'-'+_0x11bfc6+'/'+_0xefa76c)[_0xce38('0x1d')](_0x360ebe);}return null;};}function patchUpdates(_0xe28ffd){return function(_0x50084f){try{jsonpatch['apply'](_0x50084f,_0xe28ffd,!![]);}catch(_0x2b0f69){return BPromise[_0xce38('0x1e')](_0x2b0f69);}return _0x50084f[_0xce38('0x1f')]();};}function saveUpdates(_0x417542,_0x8a0c40){return function(_0x16e851){if(_0x16e851){return _0x16e851[_0xce38('0x20')](_0x417542)['then'](function(_0x5b4205){return _0x5b4205;});}return null;};}function removeEntity(_0x2bccb9,_0x4860b1){return function(_0x43ddd3){if(_0x43ddd3){return _0x43ddd3[_0xce38('0x21')]()[_0xce38('0x22')](function(){var _0x248952=_0x43ddd3[_0xce38('0x23')]({'plain':!![]});var _0x26279b='Variables';return db[_0xce38('0x24')][_0xce38('0x21')]({'where':{'type':_0x26279b,'resourceId':_0x248952['id']}})[_0xce38('0x22')](function(){return _0x43ddd3;});})[_0xce38('0x22')](function(){_0x2bccb9[_0xce38('0x1b')](0xcc)[_0xce38('0x25')]();});}};}function handleEntityNotFound(_0xcd3856,_0x52fb83){return function(_0x2d45b9){if(!_0x2d45b9){_0xcd3856['sendStatus'](0x194);}return _0x2d45b9;};}function handleError(_0x30b5f5,_0x462889){_0x462889=_0x462889||0x1f4;return function(_0x10a3e3){logger[_0xce38('0x26')](_0x10a3e3['stack']);if(_0x10a3e3[_0xce38('0x27')]){delete _0x10a3e3[_0xce38('0x27')];}_0x30b5f5['status'](_0x462889)[_0xce38('0x28')](_0x10a3e3);};}exports[_0xce38('0x29')]=function(_0x153d4f,_0x55beda){var _0x40117e={},_0x21983a={},_0x3d714b={'count':0x0,'rows':[]};var _0x453dc2=_[_0xce38('0x2a')](db[_0xce38('0x2b')][_0xce38('0x2c')],function(_0x435f8d){return{'name':_0x435f8d[_0xce38('0x2d')],'type':_0x435f8d[_0xce38('0x2e')][_0xce38('0x2f')]};});_0x21983a[_0xce38('0x30')]=_[_0xce38('0x2a')](_0x453dc2,_0xce38('0x27'));_0x21983a[_0xce38('0x31')]=_[_0xce38('0x32')](_0x153d4f['query']);_0x21983a[_0xce38('0x33')]=_['intersection'](_0x21983a['model'],_0x21983a[_0xce38('0x31')]);_0x40117e[_0xce38('0x34')]=_[_0xce38('0x35')](_0x21983a['model'],qs['fields'](_0x153d4f['query'][_0xce38('0x36')]));_0x40117e[_0xce38('0x34')]=_0x40117e[_0xce38('0x34')][_0xce38('0x37')]?_0x40117e[_0xce38('0x34')]:_0x21983a['model'];if(!_0x153d4f[_0xce38('0x31')][_0xce38('0x38')]('nolimit')){_0x40117e[_0xce38('0x19')]=qs['limit'](_0x153d4f[_0xce38('0x31')][_0xce38('0x19')]);_0x40117e[_0xce38('0x17')]=qs[_0xce38('0x17')](_0x153d4f[_0xce38('0x31')][_0xce38('0x17')]);}_0x40117e[_0xce38('0x39')]=qs[_0xce38('0x3a')](_0x153d4f['query'][_0xce38('0x3a')]);_0x40117e['where']=qs[_0xce38('0x33')](_[_0xce38('0x3b')](_0x153d4f['query'],_0x21983a[_0xce38('0x33')]),_0x453dc2);if(_0x153d4f[_0xce38('0x31')][_0xce38('0x3c')]){_0x40117e[_0xce38('0x3d')]=_['merge'](_0x40117e[_0xce38('0x3d')],{'$or':_[_0xce38('0x2a')](_0x453dc2,function(_0x3b3ebe){if(_0x3b3ebe[_0xce38('0x2e')]!==_0xce38('0x3e')){var _0x424d7b={};_0x424d7b[_0x3b3ebe[_0xce38('0x27')]]={'$like':'%'+_0x153d4f['query'][_0xce38('0x3c')]+'%'};return _0x424d7b;}})});}_0x40117e=_[_0xce38('0x3f')]({},_0x40117e,_0x153d4f[_0xce38('0x40')]);var _0x2f5576={'where':_0x40117e[_0xce38('0x3d')]};return db[_0xce38('0x2b')][_0xce38('0x1a')](_0x2f5576)['then'](function(_0x27a894){_0x3d714b['count']=_0x27a894;if(_0x153d4f['query'][_0xce38('0x41')]){_0x40117e[_0xce38('0x42')]=[{'all':!![]}];}return db[_0xce38('0x2b')]['findAll'](_0x40117e);})[_0xce38('0x22')](function(_0x3e1300){_0x3d714b[_0xce38('0x43')]=_0x3e1300;return _0x3d714b;})[_0xce38('0x22')](respondWithFilteredResult(_0x55beda,_0x40117e))[_0xce38('0x44')](handleError(_0x55beda,null));};exports[_0xce38('0x45')]=function(_0x221028,_0x2dd0ed){var _0x576a07={'raw':!![],'where':{'id':_0x221028[_0xce38('0x46')]['id']}},_0x2f8378={};_0x2f8378[_0xce38('0x30')]=_['keys'](db[_0xce38('0x2b')][_0xce38('0x2c')]);_0x2f8378[_0xce38('0x31')]=_['keys'](_0x221028[_0xce38('0x31')]);_0x2f8378[_0xce38('0x33')]=_[_0xce38('0x35')](_0x2f8378[_0xce38('0x30')],_0x2f8378[_0xce38('0x31')]);_0x576a07[_0xce38('0x34')]=_['intersection'](_0x2f8378[_0xce38('0x30')],qs['fields'](_0x221028[_0xce38('0x31')][_0xce38('0x36')]));_0x576a07['attributes']=_0x576a07['attributes'][_0xce38('0x37')]?_0x576a07[_0xce38('0x34')]:_0x2f8378[_0xce38('0x30')];if(_0x221028[_0xce38('0x31')]['includeAll']){_0x576a07[_0xce38('0x42')]=[{'all':!![]}];}_0x576a07=_[_0xce38('0x3f')]({},_0x576a07,_0x221028['options']);return db['Variable'][_0xce38('0x47')](_0x576a07)['then'](handleEntityNotFound(_0x2dd0ed,null))[_0xce38('0x22')](respondWithResult(_0x2dd0ed,null))['catch'](handleError(_0x2dd0ed,null));};exports[_0xce38('0x48')]=function(_0x567a60,_0xcf5a6f){return db['Variable'][_0xce38('0x48')](_0x567a60[_0xce38('0x49')],{})[_0xce38('0x22')](function(_0x4c56e7){var _0x42aa58=_0x567a60['user']['get']({'plain':!![]});if(!_0x42aa58)throw new Error(_0xce38('0x4a'));if(_0x42aa58[_0xce38('0x4b')]===_0xce38('0x4c')){var _0x39f88a=_0x4c56e7[_0xce38('0x23')]({'plain':!![]});var _0x1f09d3='Variables';return db[_0xce38('0x4d')]['find']({'where':{'name':_0x1f09d3,'userProfileId':_0x42aa58['userProfileId']},'raw':!![]})[_0xce38('0x22')](function(_0x306e45){if(_0x306e45&&_0x306e45[_0xce38('0x4e')]===0x0){return db[_0xce38('0x24')][_0xce38('0x48')]({'name':_0x39f88a[_0xce38('0x27')],'resourceId':_0x39f88a['id'],'type':_0x306e45[_0xce38('0x27')],'sectionId':_0x306e45['id']},{})['then'](function(){return _0x4c56e7;});}else{return _0x4c56e7;}})[_0xce38('0x44')](function(_0x2f8ec8){logger[_0xce38('0x26')](_0xce38('0x4f'),_0x2f8ec8);throw _0x2f8ec8;});}return _0x4c56e7;})['then'](respondWithResult(_0xcf5a6f,0xc9))[_0xce38('0x44')](handleError(_0xcf5a6f,null));};exports['update']=function(_0x52410b,_0x3735d1){if(_0x52410b['body']['id']){delete _0x52410b[_0xce38('0x49')]['id'];}return db[_0xce38('0x2b')][_0xce38('0x47')]({'where':{'id':_0x52410b['params']['id']}})[_0xce38('0x22')](handleEntityNotFound(_0x3735d1,null))[_0xce38('0x22')](saveUpdates(_0x52410b[_0xce38('0x49')],null))[_0xce38('0x22')](respondWithResult(_0x3735d1,null))[_0xce38('0x44')](handleError(_0x3735d1,null));};exports[_0xce38('0x21')]=function(_0x10cc91,_0x8987af){return db[_0xce38('0x2b')][_0xce38('0x47')]({'where':{'id':_0x10cc91[_0xce38('0x46')]['id']}})['then'](handleEntityNotFound(_0x8987af,null))[_0xce38('0x22')](removeEntity(_0x8987af,null))[_0xce38('0x44')](handleError(_0x8987af,null));}; \ No newline at end of file +var _0x89f8=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','UserProfileResource','end','error','stack','name','send','index','Variable','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Variables','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x2aa9d0,_0x43b70c){var _0x42c22d=function(_0x2c7447){while(--_0x2c7447){_0x2aa9d0['push'](_0x2aa9d0['shift']());}};_0x42c22d(++_0x43b70c);}(_0x89f8,0xaa));var _0x889f=function(_0xf61586,_0x56b0c4){_0xf61586=_0xf61586-0x0;var _0x2b6eb3=_0x89f8[_0xf61586];return _0x2b6eb3;};'use strict';var emlformat=require(_0x889f('0x0'));var rimraf=require(_0x889f('0x1'));var zipdir=require(_0x889f('0x2'));var jsonpatch=require(_0x889f('0x3'));var rp=require('request-promise');var moment=require(_0x889f('0x4'));var BPromise=require(_0x889f('0x5'));var Mustache=require(_0x889f('0x6'));var util=require(_0x889f('0x7'));var path=require(_0x889f('0x8'));var sox=require(_0x889f('0x9'));var csv=require(_0x889f('0xa'));var ejs=require(_0x889f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x889f('0xc'));var squel=require('squel');var crypto=require(_0x889f('0xd'));var jsforce=require(_0x889f('0xe'));var deskjs=require(_0x889f('0xf'));var toCsv=require(_0x889f('0xa'));var querystring=require('querystring');var Papa=require(_0x889f('0x10'));var Redis=require(_0x889f('0x11'));var authService=require(_0x889f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x889f('0x13'));var hardwareService=require(_0x889f('0x14'));var logger=require('../../config/logger')(_0x889f('0x15'));var utils=require(_0x889f('0x16'));var config=require(_0x889f('0x17'));var licenseUtil=require(_0x889f('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x435a4b,_0x518001){_0x518001=_0x518001||0xcc;return function(_0xbdd5f7){if(_0xbdd5f7){return _0x435a4b['sendStatus'](_0x518001);}return _0x435a4b[_0x889f('0x19')](_0x518001)['end']();};}function respondWithResult(_0x216a57,_0x465982){_0x465982=_0x465982||0xc8;return function(_0xdb863a){if(_0xdb863a){return _0x216a57[_0x889f('0x19')](_0x465982)['json'](_0xdb863a);}};}function respondWithFilteredResult(_0x1bf892,_0x450001){return function(_0x1cfcb2){if(_0x1cfcb2){var _0xdd73d0=typeof _0x450001[_0x889f('0x1a')]===_0x889f('0x1b')&&typeof _0x450001[_0x889f('0x1c')]===_0x889f('0x1b');var _0x25f56d=_0x1cfcb2[_0x889f('0x1d')];var _0x5dbf26=_0xdd73d0?0x0:_0x450001[_0x889f('0x1a')];var _0x4b3968=_0xdd73d0?_0x1cfcb2[_0x889f('0x1d')]:_0x450001['offset']+_0x450001['limit'];var _0x14de78;if(_0x4b3968>=_0x25f56d){_0x4b3968=_0x25f56d;_0x14de78=0xc8;}else{_0x14de78=0xce;}_0x1bf892[_0x889f('0x19')](_0x14de78);return _0x1bf892[_0x889f('0x1e')](_0x889f('0x1f'),_0x5dbf26+'-'+_0x4b3968+'/'+_0x25f56d)[_0x889f('0x20')](_0x1cfcb2);}return null;};}function patchUpdates(_0x55d6fc){return function(_0x198a80){try{jsonpatch[_0x889f('0x21')](_0x198a80,_0x55d6fc,!![]);}catch(_0xac8ebe){return BPromise['reject'](_0xac8ebe);}return _0x198a80[_0x889f('0x22')]();};}function saveUpdates(_0xd179c0,_0x4750f9){return function(_0x33673b){if(_0x33673b){return _0x33673b[_0x889f('0x23')](_0xd179c0)[_0x889f('0x24')](function(_0x15d55b){return _0x15d55b;});}return null;};}function removeEntity(_0x118018,_0x134564){return function(_0x31f714){if(_0x31f714){return _0x31f714[_0x889f('0x25')]()[_0x889f('0x24')](function(){var _0x2aba31=_0x31f714['get']({'plain':!![]});var _0x57ba4a='Variables';return db[_0x889f('0x26')]['destroy']({'where':{'type':_0x57ba4a,'resourceId':_0x2aba31['id']}})[_0x889f('0x24')](function(){return _0x31f714;});})[_0x889f('0x24')](function(){_0x118018[_0x889f('0x19')](0xcc)[_0x889f('0x27')]();});}};}function handleEntityNotFound(_0x4900c2,_0x184ddb){return function(_0x2cd754){if(!_0x2cd754){_0x4900c2['sendStatus'](0x194);}return _0x2cd754;};}function handleError(_0x5872e2,_0x3f246e){_0x3f246e=_0x3f246e||0x1f4;return function(_0x303592){logger[_0x889f('0x28')](_0x303592[_0x889f('0x29')]);if(_0x303592['name']){delete _0x303592[_0x889f('0x2a')];}_0x5872e2[_0x889f('0x19')](_0x3f246e)[_0x889f('0x2b')](_0x303592);};}exports[_0x889f('0x2c')]=function(_0x1551ac,_0x29d490){var _0x40dae6={},_0x324be3={},_0xb9699b={'count':0x0,'rows':[]};var _0x479e41=_['map'](db[_0x889f('0x2d')]['rawAttributes'],function(_0x14d518){return{'name':_0x14d518[_0x889f('0x2e')],'type':_0x14d518[_0x889f('0x2f')][_0x889f('0x30')]};});_0x324be3[_0x889f('0x31')]=_['map'](_0x479e41,_0x889f('0x2a'));_0x324be3['query']=_[_0x889f('0x32')](_0x1551ac[_0x889f('0x33')]);_0x324be3['filters']=_['intersection'](_0x324be3['model'],_0x324be3[_0x889f('0x33')]);_0x40dae6[_0x889f('0x34')]=_[_0x889f('0x35')](_0x324be3[_0x889f('0x31')],qs[_0x889f('0x36')](_0x1551ac[_0x889f('0x33')][_0x889f('0x36')]));_0x40dae6[_0x889f('0x34')]=_0x40dae6[_0x889f('0x34')][_0x889f('0x37')]?_0x40dae6[_0x889f('0x34')]:_0x324be3['model'];if(!_0x1551ac[_0x889f('0x33')][_0x889f('0x38')](_0x889f('0x39'))){_0x40dae6[_0x889f('0x1c')]=qs[_0x889f('0x1c')](_0x1551ac['query'][_0x889f('0x1c')]);_0x40dae6[_0x889f('0x1a')]=qs['offset'](_0x1551ac[_0x889f('0x33')][_0x889f('0x1a')]);}_0x40dae6[_0x889f('0x3a')]=qs[_0x889f('0x3b')](_0x1551ac[_0x889f('0x33')][_0x889f('0x3b')]);_0x40dae6[_0x889f('0x3c')]=qs[_0x889f('0x3d')](_['pick'](_0x1551ac[_0x889f('0x33')],_0x324be3[_0x889f('0x3d')]),_0x479e41);if(_0x1551ac[_0x889f('0x33')][_0x889f('0x3e')]){_0x40dae6[_0x889f('0x3c')]=_[_0x889f('0x3f')](_0x40dae6['where'],{'$or':_['map'](_0x479e41,function(_0x1a51b0){if(_0x1a51b0[_0x889f('0x2f')]!=='VIRTUAL'){var _0x5b9186={};_0x5b9186[_0x1a51b0[_0x889f('0x2a')]]={'$like':'%'+_0x1551ac['query'][_0x889f('0x3e')]+'%'};return _0x5b9186;}})});}_0x40dae6=_[_0x889f('0x3f')]({},_0x40dae6,_0x1551ac[_0x889f('0x40')]);var _0x36fea6={'where':_0x40dae6[_0x889f('0x3c')]};return db['Variable']['count'](_0x36fea6)[_0x889f('0x24')](function(_0x14c915){_0xb9699b[_0x889f('0x1d')]=_0x14c915;if(_0x1551ac[_0x889f('0x33')][_0x889f('0x41')]){_0x40dae6[_0x889f('0x42')]=[{'all':!![]}];}return db[_0x889f('0x2d')][_0x889f('0x43')](_0x40dae6);})[_0x889f('0x24')](function(_0x2e97ac){_0xb9699b[_0x889f('0x44')]=_0x2e97ac;return _0xb9699b;})['then'](respondWithFilteredResult(_0x29d490,_0x40dae6))[_0x889f('0x45')](handleError(_0x29d490,null));};exports[_0x889f('0x46')]=function(_0x3c16c2,_0xa83a3d){var _0x5c776e={'raw':!![],'where':{'id':_0x3c16c2[_0x889f('0x47')]['id']}},_0x2ef371={};_0x2ef371[_0x889f('0x31')]=_[_0x889f('0x32')](db[_0x889f('0x2d')][_0x889f('0x48')]);_0x2ef371[_0x889f('0x33')]=_[_0x889f('0x32')](_0x3c16c2['query']);_0x2ef371[_0x889f('0x3d')]=_[_0x889f('0x35')](_0x2ef371[_0x889f('0x31')],_0x2ef371[_0x889f('0x33')]);_0x5c776e[_0x889f('0x34')]=_[_0x889f('0x35')](_0x2ef371[_0x889f('0x31')],qs[_0x889f('0x36')](_0x3c16c2[_0x889f('0x33')]['fields']));_0x5c776e[_0x889f('0x34')]=_0x5c776e[_0x889f('0x34')][_0x889f('0x37')]?_0x5c776e['attributes']:_0x2ef371[_0x889f('0x31')];if(_0x3c16c2[_0x889f('0x33')][_0x889f('0x41')]){_0x5c776e['include']=[{'all':!![]}];}_0x5c776e=_[_0x889f('0x3f')]({},_0x5c776e,_0x3c16c2[_0x889f('0x40')]);return db[_0x889f('0x2d')][_0x889f('0x49')](_0x5c776e)[_0x889f('0x24')](handleEntityNotFound(_0xa83a3d,null))[_0x889f('0x24')](respondWithResult(_0xa83a3d,null))[_0x889f('0x45')](handleError(_0xa83a3d,null));};exports[_0x889f('0x4a')]=function(_0x4ba285,_0x2b6412){return db['Variable']['create'](_0x4ba285[_0x889f('0x4b')],{})[_0x889f('0x24')](function(_0x26dfc6){var _0x2189ad=_0x4ba285[_0x889f('0x4c')][_0x889f('0x4d')]({'plain':!![]});if(!_0x2189ad)throw new Error(_0x889f('0x4e'));if(_0x2189ad[_0x889f('0x4f')]==='user'){var _0x15bd57=_0x26dfc6[_0x889f('0x4d')]({'plain':!![]});var _0xd19bfc=_0x889f('0x50');return db[_0x889f('0x51')][_0x889f('0x49')]({'where':{'name':_0xd19bfc,'userProfileId':_0x2189ad[_0x889f('0x52')]},'raw':!![]})['then'](function(_0x421684){if(_0x421684&&_0x421684[_0x889f('0x53')]===0x0){return db['UserProfileResource'][_0x889f('0x4a')]({'name':_0x15bd57['name'],'resourceId':_0x15bd57['id'],'type':_0x421684[_0x889f('0x2a')],'sectionId':_0x421684['id']},{})['then'](function(){return _0x26dfc6;});}else{return _0x26dfc6;}})['catch'](function(_0x11fe08){logger[_0x889f('0x28')](_0x889f('0x54'),_0x11fe08);throw _0x11fe08;});}return _0x26dfc6;})['then'](respondWithResult(_0x2b6412,0xc9))[_0x889f('0x45')](handleError(_0x2b6412,null));};exports[_0x889f('0x23')]=function(_0x1bb0ab,_0x519bb0){if(_0x1bb0ab['body']['id']){delete _0x1bb0ab[_0x889f('0x4b')]['id'];}return db[_0x889f('0x2d')][_0x889f('0x49')]({'where':{'id':_0x1bb0ab[_0x889f('0x47')]['id']}})[_0x889f('0x24')](handleEntityNotFound(_0x519bb0,null))['then'](saveUpdates(_0x1bb0ab[_0x889f('0x4b')],null))['then'](respondWithResult(_0x519bb0,null))[_0x889f('0x45')](handleError(_0x519bb0,null));};exports[_0x889f('0x25')]=function(_0x275468,_0x301a06){return db[_0x889f('0x2d')][_0x889f('0x49')]({'where':{'id':_0x275468['params']['id']}})[_0x889f('0x24')](handleEntityNotFound(_0x301a06,null))[_0x889f('0x24')](removeEntity(_0x301a06,null))[_0x889f('0x45')](handleError(_0x301a06,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index be9baba..b9e10b8 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 _0x390f=['lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','define','Variable','tools_variables'];(function(_0x2f9625,_0x4efdd8){var _0x56e181=function(_0x1e2151){while(--_0x1e2151){_0x2f9625['push'](_0x2f9625['shift']());}};_0x56e181(++_0x4efdd8);}(_0x390f,0x1c3));var _0xf390=function(_0xed9fea,_0x5ed774){_0xed9fea=_0xed9fea-0x0;var _0x198f12=_0x390f[_0xed9fea];return _0x198f12;};'use strict';var _=require(_0xf390('0x0'));var util=require(_0xf390('0x1'));var logger=require(_0xf390('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf390('0x3'));var rp=require(_0xf390('0x4'));var fs=require('fs');var path=require(_0xf390('0x5'));var rimraf=require(_0xf390('0x6'));var config=require(_0xf390('0x7'));var attributes=require('./variable.attributes');module['exports']=function(_0x571245,_0x384afa){return _0x571245[_0xf390('0x8')](_0xf390('0x9'),attributes,{'tableName':_0xf390('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x35d4=['../../config/logger','api','moment','bluebird','path','../../config/environment','./variable.attributes','exports','define','Variable','lodash'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x35d4,0xe6));var _0x435d=function(_0x552a69,_0x56d245){_0x552a69=_0x552a69-0x0;var _0x410f85=_0x35d4[_0x552a69];return _0x410f85;};'use strict';var _=require(_0x435d('0x0'));var util=require('util');var logger=require(_0x435d('0x1'))(_0x435d('0x2'));var moment=require(_0x435d('0x3'));var BPromise=require(_0x435d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x435d('0x5'));var rimraf=require('rimraf');var config=require(_0x435d('0x6'));var attributes=require(_0x435d('0x7'));module[_0x435d('0x8')]=function(_0x27f901,_0x4bdb60){return _0x27f901[_0x435d('0x9')](_0x435d('0xa'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index 3d2a0d6..4b45961 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 _0xabce=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowVariable','Variable','find','options','attributes','map','include','model','catch','lodash','util'];(function(_0x28c6a2,_0x295b05){var _0x593dc9=function(_0x2cb32d){while(--_0x2cb32d){_0x28c6a2['push'](_0x28c6a2['shift']());}};_0x593dc9(++_0x295b05);}(_0xabce,0x103));var _0xeabc=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xabce[_0x5e3b04];return _0x1fc44d;};'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')]('Variable,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}exports[_0xeabc('0x14')]=function(_0x58a3c0){var _0x16f08b=this;return new Promise(function(_0x31dd53,_0x31f52a){return db[_0xeabc('0x15')][_0xeabc('0x16')]({'raw':_0x58a3c0['options']?_0x58a3c0[_0xeabc('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')]['where']||null:null,'attributes':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')][_0xeabc('0x18')]||null:null,'include':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')]['include']?_[_0xeabc('0x19')](_0x58a3c0[_0xeabc('0x17')][_0xeabc('0x1a')],function(_0x5bdd57){return{'model':db[_0x5bdd57[_0xeabc('0x1b')]],'as':_0x5bdd57['as'],'attributes':_0x5bdd57[_0xeabc('0x18')],'include':_0x5bdd57[_0xeabc('0x1a')]?_[_0xeabc('0x19')](_0x5bdd57['include'],function(_0x109e1d){return{'model':db[_0x109e1d['model']],'as':_0x109e1d['as'],'attributes':_0x109e1d[_0xeabc('0x18')],'include':_0x109e1d['include']?_[_0xeabc('0x19')](_0x109e1d[_0xeabc('0x1a')],function(_0x269621){return{'model':db[_0x269621[_0xeabc('0x1b')]],'as':_0x269621['as'],'attributes':_0x269621[_0xeabc('0x18')]};}):[]};}):[]};}):[]:[]})[_0xeabc('0x9')](function(_0x131722){logger['info']('ShowVariable',_0x58a3c0);logger[_0xeabc('0xd')]('ShowVariable',_0x58a3c0,JSON[_0xeabc('0xf')](_0x131722));_0x31dd53(_0x131722);})[_0xeabc('0x1c')](function(_0x48fb52){logger[_0xeabc('0x10')](_0xeabc('0x14'),_0x48fb52[_0xeabc('0x12')],_0x58a3c0);_0x31f52a(_0x16f08b[_0xeabc('0x10')](0x1f4,_0x48fb52[_0xeabc('0x12')]));});});}; \ No newline at end of file +var _0x814b=['model','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowVariable','options','where','include','map','attributes'];(function(_0x154d4f,_0x14fd31){var _0x56771c=function(_0x5b0dcd){while(--_0x5b0dcd){_0x154d4f['push'](_0x154d4f['shift']());}};_0x56771c(++_0x14fd31);}(_0x814b,0x1a2));var _0xb814=function(_0x3a7a9c,_0x24f7d6){_0x3a7a9c=_0x3a7a9c-0x0;var _0x59156e=_0x814b[_0x3a7a9c];return _0x59156e;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Variable,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}exports[_0xb814('0x18')]=function(_0x55ba16){var _0x270598=this;return new Promise(function(_0xfac75b,_0x4c3007){return db['Variable']['find']({'raw':_0x55ba16[_0xb814('0x19')]?_0x55ba16['options']['raw']===undefined?!![]:![]:!![],'where':_0x55ba16[_0xb814('0x19')]?_0x55ba16[_0xb814('0x19')][_0xb814('0x1a')]||null:null,'attributes':_0x55ba16['options']?_0x55ba16[_0xb814('0x19')]['attributes']||null:null,'include':_0x55ba16[_0xb814('0x19')]?_0x55ba16[_0xb814('0x19')][_0xb814('0x1b')]?_[_0xb814('0x1c')](_0x55ba16[_0xb814('0x19')][_0xb814('0x1b')],function(_0x1f5d40){return{'model':db[_0x1f5d40['model']],'as':_0x1f5d40['as'],'attributes':_0x1f5d40[_0xb814('0x1d')],'include':_0x1f5d40['include']?_[_0xb814('0x1c')](_0x1f5d40[_0xb814('0x1b')],function(_0x31c7ec){return{'model':db[_0x31c7ec[_0xb814('0x1e')]],'as':_0x31c7ec['as'],'attributes':_0x31c7ec[_0xb814('0x1d')],'include':_0x31c7ec[_0xb814('0x1b')]?_[_0xb814('0x1c')](_0x31c7ec['include'],function(_0x392222){return{'model':db[_0x392222[_0xb814('0x1e')]],'as':_0x392222['as'],'attributes':_0x392222[_0xb814('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb814('0xd')](function(_0x32ed56){logger[_0xb814('0xe')](_0xb814('0x18'),_0x55ba16);logger[_0xb814('0x11')]('ShowVariable',_0x55ba16,JSON[_0xb814('0x1f')](_0x32ed56));_0xfac75b(_0x32ed56);})[_0xb814('0x17')](function(_0x52ed64){logger[_0xb814('0x13')](_0xb814('0x18'),_0x52ed64[_0xb814('0x15')],_0x55ba16);_0x4c3007(_0x270598['error'](0x1f4,_0x52ed64[_0xb814('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 9f2eee4..2b750bf 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 _0x636f=['./version.controller','get','/fetch','isAuthenticated','canUpdate','fetch','reset','/pull','/restart','restart','migrations','exports','../../components/auth/service'];(function(_0x49a02a,_0x6d46e9){var _0x172807=function(_0x4c1f1f){while(--_0x4c1f1f){_0x49a02a['push'](_0x49a02a['shift']());}};_0x172807(++_0x6d46e9);}(_0x636f,0xa8));var _0xf636=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x636f[_0x397e5f];return _0x5302b8;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0xf636('0x0'));var controller=require(_0xf636('0x1'));router[_0xf636('0x2')]('/',controller['index']);router['get'](_0xf636('0x3'),auth[_0xf636('0x4')](),auth[_0xf636('0x5')](),controller[_0xf636('0x6')]);router['get']('/reset',auth['isAuthenticated'](),auth[_0xf636('0x5')](),controller[_0xf636('0x7')]);router[_0xf636('0x2')](_0xf636('0x8'),auth[_0xf636('0x4')](),auth[_0xf636('0x5')](),controller['pull']);router[_0xf636('0x2')](_0xf636('0x9'),auth[_0xf636('0x4')](),controller[_0xf636('0xa')]);router[_0xf636('0x2')]('/migrations',controller[_0xf636('0xb')]);module[_0xf636('0xc')]=router; \ No newline at end of file +var _0x2f3d=['/pull','canUpdate','pull','/restart','restart','migrations','express','Router','../../components/auth/service','index','get','/fetch','isAuthenticated','/reset','reset'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x2f3d,0xba));var _0xd2f3=function(_0x2e208e,_0x471b71){_0x2e208e=_0x2e208e-0x0;var _0x5e773f=_0x2f3d[_0x2e208e];return _0x5e773f;};'use strict';var express=require(_0xd2f3('0x0'));var router=express[_0xd2f3('0x1')]();var auth=require(_0xd2f3('0x2'));var controller=require('./version.controller');router['get']('/',controller[_0xd2f3('0x3')]);router[_0xd2f3('0x4')](_0xd2f3('0x5'),auth[_0xd2f3('0x6')](),auth['canUpdate'](),controller['fetch']);router[_0xd2f3('0x4')](_0xd2f3('0x7'),auth[_0xd2f3('0x6')](),auth['canUpdate'](),controller[_0xd2f3('0x8')]);router[_0xd2f3('0x4')](_0xd2f3('0x9'),auth[_0xd2f3('0x6')](),auth[_0xd2f3('0xa')](),controller[_0xd2f3('0xb')]);router['get'](_0xd2f3('0xc'),auth[_0xd2f3('0x6')](),controller[_0xd2f3('0xd')]);router[_0xd2f3('0x4')]('/migrations',controller[_0xd2f3('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 4a6be13..761a5a6 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 _0xdbb6=['Migration','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','simple-git','root','query','latest','fetch','tags','exports','2.0.0','json','status','origin','error','info','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','server','length','replace','.js','push','sort','sequelize'];(function(_0x41c793,_0x393a99){var _0x40cd60=function(_0xe0b0bb){while(--_0xe0b0bb){_0x41c793['push'](_0x41c793['shift']());}};_0x40cd60(++_0x393a99);}(_0xdbb6,0x116));var _0x6dbb=function(_0x422016,_0x2c2dcc){_0x422016=_0x422016-0x0;var _0x17a7d7=_0xdbb6[_0x422016];return _0x17a7d7;};'use strict';var Umzug=require(_0x6dbb('0x0'));var path=require(_0x6dbb('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x6dbb('0x2'))(module,_0x6dbb('0x3'));var compareVersions=require(_0x6dbb('0x4'));var exec=require(_0x6dbb('0x5'))[_0x6dbb('0x6')];var db=require(_0x6dbb('0x7'))['db'];var config=require(_0x6dbb('0x8'));var pm2=require(_0x6dbb('0x9'));var logger=require('../../config/logger')('update');var git=require(_0x6dbb('0xa'))(config[_0x6dbb('0xb')]);exports['index']=function(_0x5b9164,_0x454f6e){var _0x2c9c9d={'current':module['exports'][_0x6dbb('0x3')],'phonebar':0x2};if(_0x5b9164[_0x6dbb('0xc')]&&_0x5b9164[_0x6dbb('0xc')][_0x6dbb('0xd')]){return git[_0x6dbb('0xe')]()[_0x6dbb('0xf')](function(_0xd0dabe,_0x7469d4){_0x2c9c9d[_0x6dbb('0xd')]=(_0xd0dabe?module[_0x6dbb('0x10')][_0x6dbb('0x3')]:_0x7469d4[_0x6dbb('0xd')])||_0x6dbb('0x11');return _0x454f6e['status'](0xc8)[_0x6dbb('0x12')](_0x2c9c9d);});}else{return _0x454f6e[_0x6dbb('0x13')](0xc8)[_0x6dbb('0x12')](_0x2c9c9d);}};exports[_0x6dbb('0xe')]=function(_0x340761,_0x5bd645){return git[_0x6dbb('0xe')]([_0x6dbb('0x14'),'master'],function(_0x43de9e){if(_0x43de9e){logger[_0x6dbb('0x15')](_0x43de9e);return _0x5bd645['status'](0x1f4)['json'](_0x43de9e);}logger[_0x6dbb('0x16')]('git\x20fetch');return _0x5bd645[_0x6dbb('0x13')](0xc8)[_0x6dbb('0x12')]({'output':_0x6dbb('0x17')});});};exports[_0x6dbb('0x18')]=function(_0xcbb9d9,_0x26d751){return git['reset']([_0x6dbb('0x19'),_0x6dbb('0x1a')],function(_0x173873){if(_0x173873){logger[_0x6dbb('0x15')](_0x173873);return _0x26d751[_0x6dbb('0x13')](0x1f4)[_0x6dbb('0x12')](_0x173873);}logger['info'](_0x6dbb('0x1b'));return _0x26d751['status'](0xc8)[_0x6dbb('0x12')]({'output':_0x6dbb('0x1c')});});};exports[_0x6dbb('0x1d')]=function(_0xfcd5d8,_0x18c9cd){exec(_0x6dbb('0x1e'),function(_0x2daae4,_0x1a6f27,_0x42d281){logger[_0x6dbb('0x16')](_0x1a6f27);logger[_0x6dbb('0x16')](_0x42d281);if(_0x2daae4){logger[_0x6dbb('0x15')](_0x2daae4);return _0x18c9cd['status'](0x1f4)[_0x6dbb('0x12')](_0x2daae4);}return _0x18c9cd[_0x6dbb('0x13')](0xc8)[_0x6dbb('0x12')]({'output':_0x1a6f27});});};exports['restart']=function(_0x130d6d,_0x130b9a){return pm2[_0x6dbb('0x1f')](_0x6dbb('0x20'))[_0x6dbb('0x21')](function(_0x2eb6e0){logger[_0x6dbb('0x16')]('pm2\x20restart\x20motion\x20%s',_0x2eb6e0);return _0x130b9a[_0x6dbb('0x13')](0xc8)['json']({'output':_0x6dbb('0x22')});})[_0x6dbb('0x23')](function(_0x173808){logger[_0x6dbb('0x15')](_0x173808);return _0x130b9a[_0x6dbb('0x13')](0x1f4)[_0x6dbb('0x12')](_0x173808);});};exports[_0x6dbb('0x24')]=function(_0x58b355,_0x5c0d3a){var _0x48b07c=fs[_0x6dbb('0x25')](path[_0x6dbb('0x26')](config['root'],_0x6dbb('0x27'),_0x6dbb('0x24')));var _0x4dda00=[];for(var _0x1412ee=0x0;_0x1412ee<_0x48b07c[_0x6dbb('0x28')];_0x1412ee++){var _0x5cffeb=_0x48b07c[_0x1412ee][_0x6dbb('0x29')](_0x6dbb('0x2a'),'');if(compareVersions(module[_0x6dbb('0x10')][_0x6dbb('0x3')],_0x5cffeb)===-0x1){_0x4dda00[_0x6dbb('0x2b')](_0x5cffeb);}}if(_0x4dda00[_0x6dbb('0x28')]){var _0x11bf80=_0x4dda00[_0x6dbb('0x2c')](compareVersions);var _0x1f9a72=new Umzug({'storage':_0x6dbb('0x2d'),'storageOptions':{'model':db[_0x6dbb('0x2e')],'modelName':_0x6dbb('0x2e'),'columnName':'version'},'migrations':{'params':[db['sequelize']['getQueryInterface'](),db[_0x6dbb('0x2d')][_0x6dbb('0x2f')],function(){throw new Error(_0x6dbb('0x30'));}],'path':path['join'](config[_0x6dbb('0xb')],_0x6dbb('0x27'),_0x6dbb('0x24')),'pattern':/\.js$/}});_0x1f9a72['up']({'migrations':_[_0x6dbb('0x31')](_0x11bf80,function(_0x218461){return _0x218461+'.js';})})[_0x6dbb('0x21')](function(){return _0x5c0d3a[_0x6dbb('0x13')](0xc8)[_0x6dbb('0x12')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x6dbb('0x10')]['version']+_0x6dbb('0x32')+_[_0x6dbb('0x33')](_0x11bf80),'migrations':_[_0x6dbb('0x26')](_0x11bf80)});})['catch'](function(_0x58c187){if(_0x58c187 instanceof db['sequelize'][_0x6dbb('0x34')]){return _0x5c0d3a[_0x6dbb('0x13')](0xc8)[_0x6dbb('0x12')]({'output':_0x6dbb('0x35')});}else{return _0x5c0d3a[_0x6dbb('0x13')](0x1f4)[_0x6dbb('0x12')](_0x58c187);}});}else{return _0x5c0d3a[_0x6dbb('0x13')](0xc8)[_0x6dbb('0x12')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file +var _0xa7fc=['version','child_process','exec','../../config/pm2','../../config/logger','update','simple-git','root','exports','query','latest','tags','2.0.0','status','json','fetch','origin','master','git\x20fetch','reset','--hard','error','git\x20reset\x20--hard','npm\x20install\x20--production','info','restart','motion2','then','catch','migrations','join','server','.js','length','Migration','getQueryInterface','sequelize','constructor','map','Database\x20migrated\x20successfully\x20from\x20version\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo'];(function(_0x21b911,_0x2b1559){var _0x3f42ed=function(_0x510619){while(--_0x510619){_0x21b911['push'](_0x21b911['shift']());}};_0x3f42ed(++_0x2b1559);}(_0xa7fc,0x174));var _0xca7f=function(_0x19159a,_0x1cb5c3){_0x19159a=_0x19159a-0x0;var _0xa677f4=_0xa7fc[_0x19159a];return _0xa677f4;};'use strict';var Umzug=require(_0xca7f('0x0'));var path=require(_0xca7f('0x1'));var fs=require('fs');var _=require(_0xca7f('0x2'));var pkginfo=require(_0xca7f('0x3'))(module,_0xca7f('0x4'));var compareVersions=require('compare-versions');var exec=require(_0xca7f('0x5'))[_0xca7f('0x6')];var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var pm2=require(_0xca7f('0x7'));var logger=require(_0xca7f('0x8'))(_0xca7f('0x9'));var git=require(_0xca7f('0xa'))(config[_0xca7f('0xb')]);exports['index']=function(_0x2c4208,_0x290ad1){var _0x560e68={'current':module[_0xca7f('0xc')][_0xca7f('0x4')],'phonebar':0x2};if(_0x2c4208[_0xca7f('0xd')]&&_0x2c4208[_0xca7f('0xd')][_0xca7f('0xe')]){return git['fetch']()[_0xca7f('0xf')](function(_0x2a0b63,_0x3a87c4){_0x560e68['latest']=(_0x2a0b63?module[_0xca7f('0xc')]['version']:_0x3a87c4[_0xca7f('0xe')])||_0xca7f('0x10');return _0x290ad1[_0xca7f('0x11')](0xc8)[_0xca7f('0x12')](_0x560e68);});}else{return _0x290ad1['status'](0xc8)[_0xca7f('0x12')](_0x560e68);}};exports[_0xca7f('0x13')]=function(_0x3b7a85,_0x3864e4){return git['fetch']([_0xca7f('0x14'),_0xca7f('0x15')],function(_0x69ea4f){if(_0x69ea4f){logger['error'](_0x69ea4f);return _0x3864e4[_0xca7f('0x11')](0x1f4)[_0xca7f('0x12')](_0x69ea4f);}logger['info'](_0xca7f('0x16'));return _0x3864e4[_0xca7f('0x11')](0xc8)[_0xca7f('0x12')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0xca7f('0x17')]=function(_0xf1626b,_0x1233ae){return git[_0xca7f('0x17')]([_0xca7f('0x18'),'FETCH_HEAD'],function(_0x1b5563){if(_0x1b5563){logger[_0xca7f('0x19')](_0x1b5563);return _0x1233ae['status'](0x1f4)[_0xca7f('0x12')](_0x1b5563);}logger['info']('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x1233ae[_0xca7f('0x11')](0xc8)['json']({'output':_0xca7f('0x1a')});});};exports['pull']=function(_0x1f3bed,_0x1bd0f8){exec(_0xca7f('0x1b'),function(_0xca9641,_0x54f548,_0x236f35){logger[_0xca7f('0x1c')](_0x54f548);logger[_0xca7f('0x1c')](_0x236f35);if(_0xca9641){logger[_0xca7f('0x19')](_0xca9641);return _0x1bd0f8['status'](0x1f4)[_0xca7f('0x12')](_0xca9641);}return _0x1bd0f8[_0xca7f('0x11')](0xc8)['json']({'output':_0x54f548});});};exports[_0xca7f('0x1d')]=function(_0x2ef416,_0x396f5a){return pm2[_0xca7f('0x1d')](_0xca7f('0x1e'))[_0xca7f('0x1f')](function(_0x10a3e4){logger['info']('pm2\x20restart\x20motion\x20%s',_0x10a3e4);return _0x396f5a[_0xca7f('0x11')](0xc8)['json']({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0xca7f('0x20')](function(_0x49efb2){logger[_0xca7f('0x19')](_0x49efb2);return _0x396f5a[_0xca7f('0x11')](0x1f4)['json'](_0x49efb2);});};exports[_0xca7f('0x21')]=function(_0x506219,_0x2ecab1){var _0x141314=fs['readdirSync'](path[_0xca7f('0x22')](config['root'],_0xca7f('0x23'),_0xca7f('0x21')));var _0x166bca=[];for(var _0x1f342e=0x0;_0x1f342e<_0x141314['length'];_0x1f342e++){var _0x241cbd=_0x141314[_0x1f342e]['replace'](_0xca7f('0x24'),'');if(compareVersions(module[_0xca7f('0xc')][_0xca7f('0x4')],_0x241cbd)===-0x1){_0x166bca['push'](_0x241cbd);}}if(_0x166bca[_0xca7f('0x25')]){var _0x5df787=_0x166bca['sort'](compareVersions);var _0x268f86=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0xca7f('0x26')],'modelName':_0xca7f('0x26'),'columnName':'version'},'migrations':{'params':[db['sequelize'][_0xca7f('0x27')](),db[_0xca7f('0x28')][_0xca7f('0x29')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0xca7f('0x22')](config[_0xca7f('0xb')],_0xca7f('0x23'),_0xca7f('0x21')),'pattern':/\.js$/}});_0x268f86['up']({'migrations':_[_0xca7f('0x2a')](_0x5df787,function(_0x5c885e){return _0x5c885e+'.js';})})[_0xca7f('0x1f')](function(){return _0x2ecab1['status'](0xc8)['json']({'output':_0xca7f('0x2b')+module[_0xca7f('0xc')][_0xca7f('0x4')]+'\x20to\x20'+_[_0xca7f('0x2c')](_0x5df787),'migrations':_[_0xca7f('0x22')](_0x5df787)});})[_0xca7f('0x20')](function(_0x5ab01f){if(_0x5ab01f instanceof db['sequelize'][_0xca7f('0x2d')]){return _0x2ecab1[_0xca7f('0x11')](0xc8)[_0xca7f('0x12')]({'output':_0xca7f('0x2e')});}else{return _0x2ecab1[_0xca7f('0x11')](0x1f4)[_0xca7f('0x12')](_0x5ab01f);}});}else{return _0x2ecab1[_0xca7f('0x11')](0xc8)[_0xca7f('0x12')]({'output':_0xca7f('0x2e')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 03e067b..860236c 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 _0xb457=['post','create','put','/:id','update','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show'];(function(_0x144fab,_0x2b256e){var _0x44dbeb=function(_0x4b29e0){while(--_0x4b29e0){_0x144fab['push'](_0x144fab['shift']());}};_0x44dbeb(++_0x2b256e);}(_0xb457,0x93));var _0x7b45=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xb457[_0x5d6456];return _0x4d66c1;};'use strict';var multer=require(_0x7b45('0x0'));var util=require(_0x7b45('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7b45('0x2')]();var fs_extra=require(_0x7b45('0x3'));var auth=require(_0x7b45('0x4'));var interaction=require(_0x7b45('0x5'));var config=require(_0x7b45('0x6'));var controller=require('./voiceAgentReport.controller');router[_0x7b45('0x7')]('/',auth[_0x7b45('0x8')](),controller[_0x7b45('0x9')]);router[_0x7b45('0x7')](_0x7b45('0xa'),auth[_0x7b45('0x8')](),controller[_0x7b45('0xb')]);router[_0x7b45('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x7b45('0xc')]);router[_0x7b45('0xd')]('/',auth[_0x7b45('0x8')](),controller[_0x7b45('0xe')]);router[_0x7b45('0xf')](_0x7b45('0x10'),auth['isAuthenticated'](),controller[_0x7b45('0x11')]);router['delete'](_0x7b45('0x10'),auth['isAuthenticated'](),controller[_0x7b45('0x12')]);module[_0x7b45('0x13')]=router; \ No newline at end of file +var _0x8ad7=['isAuthenticated','/describe','describe','/:id','show','post','put','delete','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get'];(function(_0x25f606,_0xe3b185){var _0x2fc873=function(_0x446d8f){while(--_0x446d8f){_0x25f606['push'](_0x25f606['shift']());}};_0x2fc873(++_0xe3b185);}(_0x8ad7,0x1ab));var _0x78ad=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x8ad7[_0x5c2e3e];return _0x53f64a;};'use strict';var multer=require(_0x78ad('0x0'));var util=require('util');var path=require(_0x78ad('0x1'));var timeout=require(_0x78ad('0x2'));var express=require('express');var router=express[_0x78ad('0x3')]();var fs_extra=require(_0x78ad('0x4'));var auth=require(_0x78ad('0x5'));var interaction=require(_0x78ad('0x6'));var config=require(_0x78ad('0x7'));var controller=require(_0x78ad('0x8'));router[_0x78ad('0x9')]('/',auth[_0x78ad('0xa')](),controller['index']);router[_0x78ad('0x9')](_0x78ad('0xb'),auth[_0x78ad('0xa')](),controller[_0x78ad('0xc')]);router[_0x78ad('0x9')](_0x78ad('0xd'),auth[_0x78ad('0xa')](),controller[_0x78ad('0xe')]);router[_0x78ad('0xf')]('/',auth[_0x78ad('0xa')](),controller['create']);router[_0x78ad('0x10')](_0x78ad('0xd'),auth[_0x78ad('0xa')](),controller['update']);router[_0x78ad('0x11')](_0x78ad('0xd'),auth[_0x78ad('0xa')](),controller[_0x78ad('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 98b7402..51aede3 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 _0x4639=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING','DATE','BOOLEAN','INTEGER'];(function(_0x41188f,_0x43488c){var _0x356950=function(_0x5c9350){while(--_0x5c9350){_0x41188f['push'](_0x41188f['shift']());}};_0x356950(++_0x43488c);}(_0x4639,0x115));var _0x9463=function(_0x494986,_0x4debb8){_0x494986=_0x494986-0x0;var _0x1c805b=_0x4639[_0x494986];return _0x1c805b;};'use strict';var Sequelize=require(_0x9463('0x0'));module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x9463('0x1')]},'calleridnum':{'type':Sequelize[_0x9463('0x1')]},'calleridname':{'type':Sequelize[_0x9463('0x1')]},'queue':{'type':Sequelize[_0x9463('0x1')]},'interface':{'type':Sequelize[_0x9463('0x1')]},'membername':{'type':Sequelize[_0x9463('0x1')]},'agentcalledAt':{'type':Sequelize[_0x9463('0x2')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0x9463('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x9463('0x2')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x9463('0x3')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x9463('0x4')]},'agentacw':{'type':Sequelize[_0x9463('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x9463('0x4')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x9463('0x1')]},'channel':{'type':Sequelize[_0x9463('0x1')]},'channelstate':{'type':Sequelize[_0x9463('0x4')]},'channelstatedesc':{'type':Sequelize[_0x9463('0x1')]},'connectedlinenum':{'type':Sequelize[_0x9463('0x1')]},'connectedlinename':{'type':Sequelize[_0x9463('0x1')]},'language':{'type':Sequelize[_0x9463('0x1')]},'accountcode':{'type':Sequelize[_0x9463('0x1')]},'context':{'type':Sequelize[_0x9463('0x1')]},'exten':{'type':Sequelize[_0x9463('0x1')]},'priority':{'type':Sequelize[_0x9463('0x1')]},'destchannel':{'type':Sequelize[_0x9463('0x1')]},'destchannelstate':{'type':Sequelize[_0x9463('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x9463('0x1')]},'destcalleridnum':{'type':Sequelize[_0x9463('0x1')]},'destcalleridname':{'type':Sequelize[_0x9463('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x9463('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x9463('0x1')]},'destlanguage':{'type':Sequelize[_0x9463('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x9463('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x9463('0x1')]},'destuniqueid':{'type':Sequelize[_0x9463('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x9463('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x9463('0x1')]},'transfer':{'type':Sequelize[_0x9463('0x3')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x9463('0x5')},'transferexten':{'type':Sequelize[_0x9463('0x1')]},'transferuniqueid':{'type':Sequelize[_0x9463('0x1')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x676c=['sequelize','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x2d5752,_0x30dbc5){var _0xa96a1c=function(_0x45b51d){while(--_0x45b51d){_0x2d5752['push'](_0x2d5752['shift']());}};_0xa96a1c(++_0x30dbc5);}(_0x676c,0x198));var _0xc676=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x676c[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xc676('0x0'));module[_0xc676('0x1')]={'type':{'type':Sequelize[_0xc676('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xc676('0x2')]},'calleridname':{'type':Sequelize[_0xc676('0x2')]},'queue':{'type':Sequelize[_0xc676('0x2')]},'interface':{'type':Sequelize[_0xc676('0x2')]},'membername':{'type':Sequelize[_0xc676('0x2')]},'agentcalledAt':{'type':Sequelize[_0xc676('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0xc676('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xc676('0x3')]},'agentdumpAt':{'type':Sequelize[_0xc676('0x3')]},'holdtime':{'type':Sequelize[_0xc676('0x4')]},'agentcomplete':{'type':Sequelize[_0xc676('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xc676('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xc676('0x4')]},'reason':{'type':Sequelize[_0xc676('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xc676('0x4')]},'channelstatedesc':{'type':Sequelize[_0xc676('0x2')]},'connectedlinenum':{'type':Sequelize[_0xc676('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xc676('0x2')]},'context':{'type':Sequelize[_0xc676('0x2')]},'exten':{'type':Sequelize[_0xc676('0x2')]},'priority':{'type':Sequelize[_0xc676('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xc676('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xc676('0x2')]},'destcalleridnum':{'type':Sequelize[_0xc676('0x2')]},'destcalleridname':{'type':Sequelize[_0xc676('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xc676('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xc676('0x2')]},'destlanguage':{'type':Sequelize[_0xc676('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xc676('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xc676('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xc676('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xc676('0x2')]},'transferuniqueid':{'type':Sequelize[_0xc676('0x2')]},'agententerreason':{'type':Sequelize[_0xc676('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 a153f75..5001b6d 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(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'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(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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 d05ce7f..1c8c8ea 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 _0xc949=['path','rimraf','./voiceAgentReport.attributes','exports','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','../../config/logger','api','moment','bluebird'];(function(_0xf7058b,_0x22c9b7){var _0x24cbf0=function(_0x2997ac){while(--_0x2997ac){_0xf7058b['push'](_0xf7058b['shift']());}};_0x24cbf0(++_0x22c9b7);}(_0xc949,0x181));var _0x9c94=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0xc949[_0xefd519];return _0x4bb882;};'use strict';var _=require(_0x9c94('0x0'));var util=require('util');var logger=require(_0x9c94('0x1'))(_0x9c94('0x2'));var moment=require(_0x9c94('0x3'));var BPromise=require(_0x9c94('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9c94('0x5'));var rimraf=require(_0x9c94('0x6'));var config=require('../../config/environment');var attributes=require(_0x9c94('0x7'));module[_0x9c94('0x8')]=function(_0x46d560,_0x1357ac){return _0x46d560['define'](_0x9c94('0x9'),attributes,{'tableName':_0x9c94('0xa'),'paranoid':![],'indexes':[{'fields':[_0x9c94('0xb'),_0x9c94('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf1e1=['exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes'];(function(_0x1db9e2,_0x404040){var _0x18bb46=function(_0x45001d){while(--_0x45001d){_0x1db9e2['push'](_0x1db9e2['shift']());}};_0x18bb46(++_0x404040);}(_0xf1e1,0x102));var _0x1f1e=function(_0x493dda,_0x1528d3){_0x493dda=_0x493dda-0x0;var _0x31a5a6=_0xf1e1[_0x493dda];return _0x31a5a6;};'use strict';var _=require(_0x1f1e('0x0'));var util=require('util');var logger=require(_0x1f1e('0x1'))('api');var moment=require(_0x1f1e('0x2'));var BPromise=require('bluebird');var rp=require(_0x1f1e('0x3'));var fs=require('fs');var path=require(_0x1f1e('0x4'));var rimraf=require(_0x1f1e('0x5'));var config=require(_0x1f1e('0x6'));var attributes=require(_0x1f1e('0x7'));module[_0x1f1e('0x8')]=function(_0x1bdcee,_0x3242af){return _0x1bdcee[_0x1f1e('0x9')](_0x1f1e('0xa'),attributes,{'tableName':_0x1f1e('0xb'),'paranoid':![],'indexes':[{'fields':[_0x1f1e('0xc'),_0x1f1e('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index af30c40..5ee2a86 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 _0xf596=['then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','create','body','options','raw','CreateVoiceAgentReport','UpdateVoiceAgentReport','VoiceAgentReport','update','where','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request'];(function(_0x291d2e,_0x5d43e3){var _0x53a151=function(_0x20fe0e){while(--_0x20fe0e){_0x291d2e['push'](_0x291d2e['shift']());}};_0x53a151(++_0x5d43e3);}(_0xf596,0xdb));var _0x6f59=function(_0x343de6,_0x5848c8){_0x343de6=_0x343de6-0x0;var _0x565a=_0xf596[_0x343de6];return _0x565a;};'use strict';var _=require(_0x6f59('0x0'));var util=require(_0x6f59('0x1'));var moment=require(_0x6f59('0x2'));var BPromise=require(_0x6f59('0x3'));var rs=require(_0x6f59('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6f59('0x5'))['db'];var utils=require(_0x6f59('0x6'));var logger=require(_0x6f59('0x7'))('rpc');var config=require(_0x6f59('0x8'));var jayson=require(_0x6f59('0x9'));var client=jayson[_0x6f59('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3de956,_0x3368df,_0x3ea895){return new BPromise(function(_0x58c574,_0x1417e8){return client[_0x6f59('0xb')](_0x3de956,_0x3ea895)[_0x6f59('0xc')](function(_0x3e11a1){logger[_0x6f59('0xd')](_0x6f59('0xe'),_0x3368df,_0x6f59('0xf'));logger[_0x6f59('0x10')](_0x6f59('0x11'),_0x3368df,'request\x20sent',JSON[_0x6f59('0x12')](_0x3e11a1));if(_0x3e11a1[_0x6f59('0x13')]){if(_0x3e11a1[_0x6f59('0x13')][_0x6f59('0x14')]===0x1f4){logger['error'](_0x6f59('0xe'),_0x3368df,_0x3e11a1[_0x6f59('0x13')]['message']);return _0x1417e8(_0x3e11a1[_0x6f59('0x13')][_0x6f59('0x15')]);}logger[_0x6f59('0x13')](_0x6f59('0xe'),_0x3368df,_0x3e11a1[_0x6f59('0x13')][_0x6f59('0x15')]);return _0x58c574(_0x3e11a1[_0x6f59('0x13')][_0x6f59('0x15')]);}else{logger[_0x6f59('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x3368df,_0x6f59('0xf'));_0x58c574(_0x3e11a1['result'][_0x6f59('0x15')]);}})[_0x6f59('0x16')](function(_0x173578){logger[_0x6f59('0x13')](_0x6f59('0xe'),_0x3368df,_0x173578);_0x1417e8(_0x173578);});});}exports['CreateVoiceAgentReport']=function(_0x43302d){var _0x2a2be3=this;return new Promise(function(_0x110f35,_0x14be3e){return db['VoiceAgentReport'][_0x6f59('0x17')](_0x43302d[_0x6f59('0x18')],{'raw':_0x43302d[_0x6f59('0x19')]?_0x43302d[_0x6f59('0x19')][_0x6f59('0x1a')]===undefined?!![]:![]:!![]})[_0x6f59('0xc')](function(_0x312a0e){logger[_0x6f59('0xd')](_0x6f59('0x1b'),_0x43302d);logger[_0x6f59('0x10')](_0x6f59('0x1b'),_0x43302d,JSON[_0x6f59('0x12')](_0x312a0e));_0x110f35(_0x312a0e);})[_0x6f59('0x16')](function(_0x10e273){logger[_0x6f59('0x13')](_0x6f59('0x1b'),_0x10e273[_0x6f59('0x15')],_0x43302d);_0x14be3e(_0x2a2be3[_0x6f59('0x13')](0x1f4,_0x10e273['message']));});});};exports[_0x6f59('0x1c')]=function(_0x1b7dcf){var _0x4e1f56=this;return new Promise(function(_0x19e71d,_0xf6cb22){return db[_0x6f59('0x1d')][_0x6f59('0x1e')](_0x1b7dcf[_0x6f59('0x18')],{'raw':_0x1b7dcf[_0x6f59('0x19')]?_0x1b7dcf[_0x6f59('0x19')][_0x6f59('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7dcf[_0x6f59('0x19')]?_0x1b7dcf['options'][_0x6f59('0x1f')]||null:null,'attributes':_0x1b7dcf[_0x6f59('0x19')]?_0x1b7dcf[_0x6f59('0x19')]['attributes']||null:null,'limit':_0x1b7dcf[_0x6f59('0x19')]?_0x1b7dcf[_0x6f59('0x19')][_0x6f59('0x20')]||null:null})[_0x6f59('0xc')](function(_0x32280f){logger[_0x6f59('0xd')](_0x6f59('0x1c'),_0x1b7dcf);logger[_0x6f59('0x10')](_0x6f59('0x1c'),_0x1b7dcf,JSON['stringify'](_0x32280f));_0x19e71d(_0x32280f);})[_0x6f59('0x16')](function(_0x14d684){logger[_0x6f59('0x13')]('UpdateVoiceAgentReport',_0x14d684[_0x6f59('0x15')],_0x1b7dcf);_0xf6cb22(_0x4e1f56[_0x6f59('0x13')](0x1f4,_0x14d684[_0x6f59('0x15')]));});});}; \ No newline at end of file +var _0x0150=['VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','VoiceAgentReport','create','body','options','raw','CreateVoiceAgentReport','stringify','UpdateVoiceAgentReport','where','limit','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x41c381,_0x1176bd){var _0x427981=function(_0x508843){while(--_0x508843){_0x41c381['push'](_0x41c381['shift']());}};_0x427981(++_0x1176bd);}(_0x0150,0x148));var _0x0015=function(_0x11ff06,_0x34724f){_0x11ff06=_0x11ff06-0x0;var _0xa566e6=_0x0150[_0x11ff06];return _0xa566e6;};'use strict';var _=require(_0x0015('0x0'));var util=require('util');var moment=require(_0x0015('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0015('0x2'));var db=require(_0x0015('0x3'))['db'];var utils=require(_0x0015('0x4'));var logger=require(_0x0015('0x5'))(_0x0015('0x6'));var config=require('../../config/environment');var jayson=require(_0x0015('0x7'));var client=jayson[_0x0015('0x8')][_0x0015('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x49eae6,_0xfa3124,_0x586dc1){return new BPromise(function(_0x1d7ca2,_0x2fc8f9){return client[_0x0015('0xa')](_0x49eae6,_0x586dc1)[_0x0015('0xb')](function(_0x433349){logger[_0x0015('0xc')](_0x0015('0xd'),_0xfa3124,_0x0015('0xe'));logger[_0x0015('0xf')](_0x0015('0x10'),_0xfa3124,_0x0015('0xe'),JSON['stringify'](_0x433349));if(_0x433349[_0x0015('0x11')]){if(_0x433349[_0x0015('0x11')][_0x0015('0x12')]===0x1f4){logger['error'](_0x0015('0xd'),_0xfa3124,_0x433349[_0x0015('0x11')][_0x0015('0x13')]);return _0x2fc8f9(_0x433349[_0x0015('0x11')][_0x0015('0x13')]);}logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0xfa3124,_0x433349[_0x0015('0x11')][_0x0015('0x13')]);return _0x1d7ca2(_0x433349[_0x0015('0x11')]['message']);}else{logger[_0x0015('0xc')](_0x0015('0xd'),_0xfa3124,'request\x20sent');_0x1d7ca2(_0x433349['result'][_0x0015('0x13')]);}})[_0x0015('0x14')](function(_0x58f36c){logger[_0x0015('0x11')]('VoiceAgentReport,\x20%s,\x20%s',_0xfa3124,_0x58f36c);_0x2fc8f9(_0x58f36c);});});}exports['CreateVoiceAgentReport']=function(_0x29ef92){var _0x14b48c=this;return new Promise(function(_0x5b07a4,_0x41a5e9){return db[_0x0015('0x15')][_0x0015('0x16')](_0x29ef92[_0x0015('0x17')],{'raw':_0x29ef92[_0x0015('0x18')]?_0x29ef92[_0x0015('0x18')][_0x0015('0x19')]===undefined?!![]:![]:!![]})[_0x0015('0xb')](function(_0x598b2a){logger['info'](_0x0015('0x1a'),_0x29ef92);logger[_0x0015('0xf')](_0x0015('0x1a'),_0x29ef92,JSON[_0x0015('0x1b')](_0x598b2a));_0x5b07a4(_0x598b2a);})['catch'](function(_0x5440cc){logger[_0x0015('0x11')](_0x0015('0x1a'),_0x5440cc[_0x0015('0x13')],_0x29ef92);_0x41a5e9(_0x14b48c[_0x0015('0x11')](0x1f4,_0x5440cc[_0x0015('0x13')]));});});};exports[_0x0015('0x1c')]=function(_0x16a173){var _0xccb976=this;return new Promise(function(_0xe8fd26,_0x24f070){return db[_0x0015('0x15')]['update'](_0x16a173[_0x0015('0x17')],{'raw':_0x16a173[_0x0015('0x18')]?_0x16a173[_0x0015('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16a173[_0x0015('0x18')]?_0x16a173[_0x0015('0x18')][_0x0015('0x1d')]||null:null,'attributes':_0x16a173[_0x0015('0x18')]?_0x16a173['options']['attributes']||null:null,'limit':_0x16a173[_0x0015('0x18')]?_0x16a173['options'][_0x0015('0x1e')]||null:null})[_0x0015('0xb')](function(_0x4339d7){logger[_0x0015('0xc')](_0x0015('0x1c'),_0x16a173);logger['debug'](_0x0015('0x1c'),_0x16a173,JSON[_0x0015('0x1b')](_0x4339d7));_0xe8fd26(_0x4339d7);})[_0x0015('0x14')](function(_0x291338){logger['error'](_0x0015('0x1c'),_0x291338['message'],_0x16a173);_0x24f070(_0xccb976[_0x0015('0x11')](0x1f4,_0x291338[_0x0015('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 07e097f..6ddb782 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 _0xaba6=['destroy','exports','multer','util','fs-extra','../../components/auth/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','describe','/:id','post','create','put','update'];(function(_0x2a9cd0,_0x339b90){var _0x95eca8=function(_0x4ac46b){while(--_0x4ac46b){_0x2a9cd0['push'](_0x2a9cd0['shift']());}};_0x95eca8(++_0x339b90);}(_0xaba6,0xe2));var _0x6aba=function(_0x45911d,_0x25b782){_0x45911d=_0x45911d-0x0;var _0x387de2=_0xaba6[_0x45911d];return _0x387de2;};'use strict';var multer=require(_0x6aba('0x0'));var util=require(_0x6aba('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x6aba('0x2'));var auth=require(_0x6aba('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x6aba('0x4'));var controller=require(_0x6aba('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x6aba('0x6')]('/describe',auth[_0x6aba('0x7')](),controller[_0x6aba('0x8')]);router['get'](_0x6aba('0x9'),auth[_0x6aba('0x7')](),controller['show']);router[_0x6aba('0xa')]('/',auth[_0x6aba('0x7')](),controller[_0x6aba('0xb')]);router[_0x6aba('0xc')](_0x6aba('0x9'),auth[_0x6aba('0x7')](),controller[_0x6aba('0xd')]);router['delete'](_0x6aba('0x9'),auth[_0x6aba('0x7')](),controller[_0x6aba('0xe')]);module[_0x6aba('0xf')]=router; \ No newline at end of file +var _0x56a4=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','index','isAuthenticated','describe','post','create','put','/:id','update','delete','destroy','multer','util'];(function(_0x5323dc,_0x335776){var _0x22a9bd=function(_0x2a937d){while(--_0x2a937d){_0x5323dc['push'](_0x5323dc['shift']());}};_0x22a9bd(++_0x335776);}(_0x56a4,0x11b));var _0x456a=function(_0x466b8c,_0x492ed0){_0x466b8c=_0x466b8c-0x0;var _0x3f461d=_0x56a4[_0x466b8c];return _0x3f461d;};'use strict';var multer=require(_0x456a('0x0'));var util=require(_0x456a('0x1'));var path=require('path');var timeout=require(_0x456a('0x2'));var express=require(_0x456a('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x456a('0x4'));var interaction=require(_0x456a('0x5'));var config=require(_0x456a('0x6'));var controller=require(_0x456a('0x7'));router[_0x456a('0x8')]('/',auth['isAuthenticated'](),controller[_0x456a('0x9')]);router['get']('/describe',auth[_0x456a('0xa')](),controller[_0x456a('0xb')]);router[_0x456a('0x8')]('/:id',auth[_0x456a('0xa')](),controller['show']);router[_0x456a('0xc')]('/',auth[_0x456a('0xa')](),controller[_0x456a('0xd')]);router[_0x456a('0xe')](_0x456a('0xf'),auth[_0x456a('0xa')](),controller[_0x456a('0x10')]);router[_0x456a('0x11')](_0x456a('0xf'),auth[_0x456a('0xa')](),controller[_0x456a('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index dbbcc3f..ef73832 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 _0x51f9=['ENUM','outbound','inbound-fax','STRING','DATE','sequelize'];(function(_0x4ff939,_0x5f54ea){var _0x3f8ba8=function(_0x25e6f7){while(--_0x25e6f7){_0x4ff939['push'](_0x4ff939['shift']());}};_0x3f8ba8(++_0x5f54ea);}(_0x51f9,0x1eb));var _0x951f=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x51f9[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0x951f('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x951f('0x1')]('inbound','internal',_0x951f('0x2'),_0x951f('0x3'),'outbound-fax','dialer')},'tag':{'type':Sequelize[_0x951f('0x4')]},'accountcode':{'type':Sequelize[_0x951f('0x4')]},'source':{'type':Sequelize[_0x951f('0x4')]},'destination':{'type':Sequelize[_0x951f('0x4')]},'destinationcontext':{'type':Sequelize[_0x951f('0x4')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x951f('0x4')]},'destinationchannel':{'type':Sequelize[_0x951f('0x4')]},'lastapplication':{'type':Sequelize[_0x951f('0x4')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x951f('0x5')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x951f('0x5')]},'endtime':{'type':Sequelize[_0x951f('0x5')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x951f('0x4')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x951f('0x4')]},'userThirdDisposition':{'type':Sequelize[_0x951f('0x4')]},'note':{'type':Sequelize[_0x951f('0x4')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0x951f('0x4')]}}; \ No newline at end of file +var _0x1f75=['internal','inbound-fax','outbound-fax','dialer','DATE','INTEGER','exports','STRING','ENUM','inbound'];(function(_0x4e94b2,_0x4e0528){var _0x560fb4=function(_0x4afec4){while(--_0x4afec4){_0x4e94b2['push'](_0x4e94b2['shift']());}};_0x560fb4(++_0x4e0528);}(_0x1f75,0x13c));var _0x51f7=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x1f75[_0x618414];return _0x21c19a;};'use strict';var Sequelize=require('sequelize');module[_0x51f7('0x0')]={'uniqueid':{'type':Sequelize[_0x51f7('0x1')]},'type':{'type':Sequelize[_0x51f7('0x2')](_0x51f7('0x3'),_0x51f7('0x4'),'outbound',_0x51f7('0x5'),_0x51f7('0x6'),_0x51f7('0x7'))},'tag':{'type':Sequelize[_0x51f7('0x1')]},'accountcode':{'type':Sequelize[_0x51f7('0x1')]},'source':{'type':Sequelize[_0x51f7('0x1')]},'destination':{'type':Sequelize[_0x51f7('0x1')]},'destinationcontext':{'type':Sequelize[_0x51f7('0x1')]},'callerid':{'type':Sequelize[_0x51f7('0x1')]},'channel':{'type':Sequelize[_0x51f7('0x1')]},'destinationchannel':{'type':Sequelize[_0x51f7('0x1')]},'lastapplication':{'type':Sequelize[_0x51f7('0x1')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x51f7('0x8')]},'systemanswertime':{'type':Sequelize[_0x51f7('0x8')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x51f7('0x8')]},'duration':{'type':Sequelize[_0x51f7('0x9')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x51f7('0x1')]},'amaflags':{'type':Sequelize[_0x51f7('0x1')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0x51f7('0x1')]},'userSecondDisposition':{'type':Sequelize[_0x51f7('0x1')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x51f7('0x1')]},'prefix':{'type':Sequelize[_0x51f7('0x1')]},'routeid':{'type':Sequelize[_0x51f7('0x9')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 8b5137d..4b65046 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 _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(_0x184f99,_0x58777c){var _0x296740=function(_0x466819){while(--_0x466819){_0x184f99['push'](_0x184f99['shift']());}};_0x296740(++_0x58777c);}(_0xdb28,0x106));var _0x8db2=function(_0x189581,_0x19f1ae){_0x189581=_0x189581-0x0;var _0x43e660=_0xdb28[_0x189581];return _0x43e660;};'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 +var _0x2ef3=['pick','filter','merge','options','VoiceCallReport','then','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','keys','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x2ef3,0xba));var _0x32ef=function(_0x44af85,_0x30e719){_0x44af85=_0x44af85-0x0;var _0x4894b3=_0x2ef3[_0x44af85];return _0x4894b3;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['VoiceCallReport'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'attributes':['id',_0x32ef('0x27'),_0x32ef('0x41'),_0x32ef('0x42')],'model':db[_0x32ef('0x43')],'as':'User'}];}return db['VoiceCallReport'][_0x32ef('0x44')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x2a33dd){_0x3c569d[_0x32ef('0x45')]=_0x2a33dd;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x46')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x47')]=function(_0x5d2f06,_0x4744ba){var _0x4bc5bc={'raw':!![],'where':{'id':_0x5d2f06[_0x32ef('0x48')]['id']}},_0xcb3c08={};_0xcb3c08[_0x32ef('0x2e')]=_[_0x32ef('0x49')](db[_0x32ef('0x3d')][_0x32ef('0x2a')]);_0xcb3c08[_0x32ef('0x2f')]=_[_0x32ef('0x49')](_0x5d2f06[_0x32ef('0x2f')]);_0xcb3c08[_0x32ef('0x30')]=_['intersection'](_0xcb3c08[_0x32ef('0x2e')],_0xcb3c08['query']);_0x4bc5bc[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0xcb3c08[_0x32ef('0x2e')],qs['fields'](_0x5d2f06[_0x32ef('0x2f')][_0x32ef('0x33')]));_0x4bc5bc[_0x32ef('0x31')]=_0x4bc5bc[_0x32ef('0x31')][_0x32ef('0x34')]?_0x4bc5bc[_0x32ef('0x31')]:_0xcb3c08[_0x32ef('0x2e')];if(_0x5d2f06['query']['includeAll']){_0x4bc5bc[_0x32ef('0x40')]=[{'all':!![]}];}_0x4bc5bc=_[_0x32ef('0x3b')]({},_0x4bc5bc,_0x5d2f06[_0x32ef('0x3c')]);return db[_0x32ef('0x3d')][_0x32ef('0x4a')](_0x4bc5bc)[_0x32ef('0x3e')](handleEntityNotFound(_0x4744ba,null))[_0x32ef('0x3e')](respondWithResult(_0x4744ba,null))[_0x32ef('0x46')](handleError(_0x4744ba,null));};exports[_0x32ef('0x4b')]=function(_0x1ebedf,_0x35a294){return db[_0x32ef('0x3d')][_0x32ef('0x4b')](_0x1ebedf['body'],{})[_0x32ef('0x3e')](respondWithResult(_0x35a294,0xc9))[_0x32ef('0x46')](handleError(_0x35a294,null));};exports[_0x32ef('0x4c')]=function(_0xd42609,_0x1cc9f3){return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'id':_0xd42609[_0x32ef('0x48')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x1cc9f3,null))[_0x32ef('0x3e')](removeEntity(_0x1cc9f3,null))[_0x32ef('0x46')](handleError(_0x1cc9f3,null));};exports[_0x32ef('0x4d')]=function(_0x272377,_0x326445){return db[_0x32ef('0x3d')][_0x32ef('0x4d')]()[_0x32ef('0x3e')](respondWithResult(_0x326445,null))[_0x32ef('0x46')](handleError(_0x326445,null));};exports['update']=function(_0x515ac9,_0x179c2f){if(_0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')]){delete _0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')];}return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'uniqueid':_0x515ac9[_0x32ef('0x48')]['id'],'UserId':{'$or':[null,_0x515ac9[_0x32ef('0x50')]['id']]}}})[_0x32ef('0x3e')](handleEntityNotFound(_0x179c2f,null))[_0x32ef('0x3e')](saveUpdates(_0x515ac9['body'],null))[_0x32ef('0x3e')](respondWithResult(_0x179c2f,null))[_0x32ef('0x46')](handleError(_0x179c2f,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index c2b2aae..1fb5767 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 _0xfa20=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','VoiceCallReport','report_call','uniqueid','lodash'];(function(_0x51113f,_0x5f056c){var _0x205716=function(_0x3c07a8){while(--_0x3c07a8){_0x51113f['push'](_0x51113f['shift']());}};_0x205716(++_0x5f056c);}(_0xfa20,0x141));var _0x0fa2=function(_0x3287a6,_0x35e598){_0x3287a6=_0x3287a6-0x0;var _0x9c6449=_0xfa20[_0x3287a6];return _0x9c6449;};'use strict';var _=require(_0x0fa2('0x0'));var util=require(_0x0fa2('0x1'));var logger=require(_0x0fa2('0x2'))(_0x0fa2('0x3'));var moment=require(_0x0fa2('0x4'));var BPromise=require(_0x0fa2('0x5'));var rp=require(_0x0fa2('0x6'));var fs=require('fs');var path=require(_0x0fa2('0x7'));var rimraf=require(_0x0fa2('0x8'));var config=require(_0x0fa2('0x9'));var attributes=require(_0x0fa2('0xa'));module['exports']=function(_0x19387c,_0x2247e9){return _0x19387c['define'](_0x0fa2('0xb'),attributes,{'tableName':_0x0fa2('0xc'),'paranoid':![],'indexes':[{'fields':[_0x0fa2('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1f4b=['rimraf','../../config/environment','VoiceCallReport','report_call','lodash','api','request-promise','path'];(function(_0x23d7a7,_0x4b0f57){var _0x43f390=function(_0x3528d0){while(--_0x3528d0){_0x23d7a7['push'](_0x23d7a7['shift']());}};_0x43f390(++_0x4b0f57);}(_0x1f4b,0x1a4));var _0xb1f4=function(_0x41699c,_0x317092){_0x41699c=_0x41699c-0x0;var _0xb1e0ad=_0x1f4b[_0x41699c];return _0xb1e0ad;};'use strict';var _=require(_0xb1f4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb1f4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb1f4('0x2'));var fs=require('fs');var path=require(_0xb1f4('0x3'));var rimraf=require(_0xb1f4('0x4'));var config=require(_0xb1f4('0x5'));var attributes=require('./voiceCallReport.attributes');module['exports']=function(_0x40c9c1,_0x1c0fd6){return _0x40c9c1['define'](_0xb1f4('0x6'),attributes,{'tableName':_0xb1f4('0x7'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 492398b..adffda1 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 _0x5172=['client','http','request','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVoiceCallReport','VoiceCallReport','options','where','limit','include','model','attributes','map','then','catch','CreateVoiceCallReport','create','body','raw','UpdateVoiceCallReport','update','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x17afed,_0x5003ee){var _0x180e9e=function(_0x541c15){while(--_0x541c15){_0x17afed['push'](_0x17afed['shift']());}};_0x180e9e(++_0x5003ee);}(_0x5172,0x1ec));var _0x2517=function(_0x421f85,_0x318885){_0x421f85=_0x421f85-0x0;var _0x3b3638=_0x5172[_0x421f85];return _0x3b3638;};'use strict';var _=require(_0x2517('0x0'));var util=require(_0x2517('0x1'));var moment=require(_0x2517('0x2'));var BPromise=require(_0x2517('0x3'));var rs=require(_0x2517('0x4'));var fs=require('fs');var Redis=require(_0x2517('0x5'));var db=require(_0x2517('0x6'))['db'];var utils=require(_0x2517('0x7'));var logger=require(_0x2517('0x8'))(_0x2517('0x9'));var config=require(_0x2517('0xa'));var jayson=require(_0x2517('0xb'));var client=jayson[_0x2517('0xc')][_0x2517('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3c62b8,_0x433a91,_0x45070c){return new BPromise(function(_0x3fef24,_0xa36b25){return client[_0x2517('0xe')](_0x3c62b8,_0x45070c)['then'](function(_0x32152d){logger[_0x2517('0xf')](_0x2517('0x10'),_0x433a91,_0x2517('0x11'));logger[_0x2517('0x12')](_0x2517('0x13'),_0x433a91,_0x2517('0x11'),JSON[_0x2517('0x14')](_0x32152d));if(_0x32152d[_0x2517('0x15')]){if(_0x32152d[_0x2517('0x15')][_0x2517('0x16')]===0x1f4){logger[_0x2517('0x15')](_0x2517('0x10'),_0x433a91,_0x32152d[_0x2517('0x15')][_0x2517('0x17')]);return _0xa36b25(_0x32152d[_0x2517('0x15')][_0x2517('0x17')]);}logger[_0x2517('0x15')](_0x2517('0x10'),_0x433a91,_0x32152d[_0x2517('0x15')][_0x2517('0x17')]);return _0x3fef24(_0x32152d[_0x2517('0x15')][_0x2517('0x17')]);}else{logger['info'](_0x2517('0x10'),_0x433a91,_0x2517('0x11'));_0x3fef24(_0x32152d[_0x2517('0x18')]['message']);}})['catch'](function(_0x9ce406){logger[_0x2517('0x15')](_0x2517('0x10'),_0x433a91,_0x9ce406);_0xa36b25(_0x9ce406);});});}exports[_0x2517('0x19')]=function(_0x4814a6){var _0x5187a9=this;return new Promise(function(_0x391a57,_0x2bd450){return db[_0x2517('0x1a')]['findAll']({'raw':_0x4814a6['options']?_0x4814a6[_0x2517('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x4814a6['options']?_0x4814a6[_0x2517('0x1b')][_0x2517('0x1c')]||null:null,'attributes':_0x4814a6[_0x2517('0x1b')]?_0x4814a6[_0x2517('0x1b')]['attributes']||null:null,'limit':_0x4814a6[_0x2517('0x1b')]?_0x4814a6['options'][_0x2517('0x1d')]||null:null,'include':_0x4814a6['options']?_0x4814a6[_0x2517('0x1b')][_0x2517('0x1e')]?_['map'](_0x4814a6[_0x2517('0x1b')][_0x2517('0x1e')],function(_0xdb9f56){return{'model':db[_0xdb9f56[_0x2517('0x1f')]],'as':_0xdb9f56['as'],'attributes':_0xdb9f56[_0x2517('0x20')],'include':_0xdb9f56[_0x2517('0x1e')]?_[_0x2517('0x21')](_0xdb9f56['include'],function(_0x5f27e1){return{'model':db[_0x5f27e1['model']],'as':_0x5f27e1['as'],'attributes':_0x5f27e1[_0x2517('0x20')],'include':_0x5f27e1['include']?_[_0x2517('0x21')](_0x5f27e1['include'],function(_0x4bf106){return{'model':db[_0x4bf106[_0x2517('0x1f')]],'as':_0x4bf106['as'],'attributes':_0x4bf106['attributes']};}):[]};}):[]};}):[]:[]})[_0x2517('0x22')](function(_0x323acd){logger['info'](_0x2517('0x19'),_0x4814a6);logger[_0x2517('0x12')](_0x2517('0x19'),_0x4814a6,JSON['stringify'](_0x323acd));_0x391a57(_0x323acd);})[_0x2517('0x23')](function(_0x386b58){logger[_0x2517('0x15')](_0x2517('0x19'),_0x386b58[_0x2517('0x17')],_0x4814a6);_0x2bd450(_0x5187a9[_0x2517('0x15')](0x1f4,_0x386b58[_0x2517('0x17')]));});});};exports[_0x2517('0x24')]=function(_0x1c4362){var _0xb07c43=this;return new Promise(function(_0x1d64f9,_0x2f4383){return db[_0x2517('0x1a')][_0x2517('0x25')](_0x1c4362[_0x2517('0x26')],{'raw':_0x1c4362['options']?_0x1c4362[_0x2517('0x1b')][_0x2517('0x27')]===undefined?!![]:![]:!![]})['then'](function(_0x2080a4){logger[_0x2517('0xf')](_0x2517('0x24'),_0x1c4362);logger['debug'](_0x2517('0x24'),_0x1c4362,JSON['stringify'](_0x2080a4));_0x1d64f9(_0x2080a4);})[_0x2517('0x23')](function(_0x12c32f){logger['error']('CreateVoiceCallReport',_0x12c32f[_0x2517('0x17')],_0x1c4362);_0x2f4383(_0xb07c43['error'](0x1f4,_0x12c32f[_0x2517('0x17')]));});});};exports[_0x2517('0x28')]=function(_0x500ade){var _0x51773e=this;return new Promise(function(_0x5b7acb,_0x497180){return db[_0x2517('0x1a')][_0x2517('0x29')](_0x500ade[_0x2517('0x26')],{'raw':_0x500ade[_0x2517('0x1b')]?_0x500ade[_0x2517('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x500ade[_0x2517('0x1b')]?_0x500ade[_0x2517('0x1b')][_0x2517('0x1c')]||null:null,'attributes':_0x500ade[_0x2517('0x1b')]?_0x500ade[_0x2517('0x1b')][_0x2517('0x20')]||null:null,'limit':_0x500ade[_0x2517('0x1b')]?_0x500ade[_0x2517('0x1b')][_0x2517('0x1d')]||null:null})[_0x2517('0x22')](function(_0x4eb337){logger[_0x2517('0xf')]('UpdateVoiceCallReport',_0x500ade);logger[_0x2517('0x12')]('UpdateVoiceCallReport',_0x500ade,JSON[_0x2517('0x14')](_0x4eb337));_0x5b7acb(_0x4eb337);})[_0x2517('0x23')](function(_0x1bf58b){logger[_0x2517('0x15')](_0x2517('0x28'),_0x1bf58b[_0x2517('0x17')],_0x500ade);_0x497180(_0x51773e['error'](0x1f4,_0x1bf58b['message']));});});}; \ No newline at end of file +var _0x7b62=['map','model','include','info','stringify','catch','CreateVoiceCallReport','create','UpdateVoiceCallReport','update','where','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','request\x20sent','debug','error','VoiceCallReport,\x20%s,\x20%s','message','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','attributes'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x7b62,0xab));var _0x27b6=function(_0x2c5826,_0x47bf55){_0x2c5826=_0x2c5826-0x0;var _0x1058e1=_0x7b62[_0x2c5826];return _0x1058e1;};'use strict';var _=require(_0x27b6('0x0'));var util=require(_0x27b6('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x27b6('0x2'));var db=require(_0x27b6('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x27b6('0x4'))(_0x27b6('0x5'));var config=require('../../config/environment');var jayson=require(_0x27b6('0x6'));var client=jayson[_0x27b6('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c1cd0,_0x52b27a,_0x148787){return new BPromise(function(_0x11e890,_0xa5a7e3){return client[_0x27b6('0x8')](_0x4c1cd0,_0x148787)[_0x27b6('0x9')](function(_0x53bd51){logger['info']('VoiceCallReport,\x20%s,\x20%s',_0x52b27a,_0x27b6('0xa'));logger[_0x27b6('0xb')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x52b27a,_0x27b6('0xa'),JSON['stringify'](_0x53bd51));if(_0x53bd51[_0x27b6('0xc')]){if(_0x53bd51[_0x27b6('0xc')]['code']===0x1f4){logger[_0x27b6('0xc')](_0x27b6('0xd'),_0x52b27a,_0x53bd51[_0x27b6('0xc')][_0x27b6('0xe')]);return _0xa5a7e3(_0x53bd51[_0x27b6('0xc')][_0x27b6('0xe')]);}logger[_0x27b6('0xc')](_0x27b6('0xd'),_0x52b27a,_0x53bd51[_0x27b6('0xc')][_0x27b6('0xe')]);return _0x11e890(_0x53bd51[_0x27b6('0xc')][_0x27b6('0xe')]);}else{logger['info'](_0x27b6('0xd'),_0x52b27a,_0x27b6('0xa'));_0x11e890(_0x53bd51['result'][_0x27b6('0xe')]);}})['catch'](function(_0x462f32){logger[_0x27b6('0xc')](_0x27b6('0xd'),_0x52b27a,_0x462f32);_0xa5a7e3(_0x462f32);});});}exports[_0x27b6('0xf')]=function(_0x3c4513){var _0x1df940=this;return new Promise(function(_0x4ca608,_0x2a40e3){return db[_0x27b6('0x10')][_0x27b6('0x11')]({'raw':_0x3c4513[_0x27b6('0x12')]?_0x3c4513[_0x27b6('0x12')][_0x27b6('0x13')]===undefined?!![]:![]:!![],'where':_0x3c4513[_0x27b6('0x12')]?_0x3c4513['options']['where']||null:null,'attributes':_0x3c4513[_0x27b6('0x12')]?_0x3c4513[_0x27b6('0x12')][_0x27b6('0x14')]||null:null,'limit':_0x3c4513[_0x27b6('0x12')]?_0x3c4513[_0x27b6('0x12')]['limit']||null:null,'include':_0x3c4513[_0x27b6('0x12')]?_0x3c4513['options']['include']?_[_0x27b6('0x15')](_0x3c4513['options']['include'],function(_0x481186){return{'model':db[_0x481186[_0x27b6('0x16')]],'as':_0x481186['as'],'attributes':_0x481186['attributes'],'include':_0x481186[_0x27b6('0x17')]?_[_0x27b6('0x15')](_0x481186[_0x27b6('0x17')],function(_0x8a4198){return{'model':db[_0x8a4198['model']],'as':_0x8a4198['as'],'attributes':_0x8a4198['attributes'],'include':_0x8a4198[_0x27b6('0x17')]?_[_0x27b6('0x15')](_0x8a4198[_0x27b6('0x17')],function(_0x393085){return{'model':db[_0x393085['model']],'as':_0x393085['as'],'attributes':_0x393085[_0x27b6('0x14')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3e4cc9){logger[_0x27b6('0x18')]('GetVoiceCallReport',_0x3c4513);logger['debug'](_0x27b6('0xf'),_0x3c4513,JSON[_0x27b6('0x19')](_0x3e4cc9));_0x4ca608(_0x3e4cc9);})[_0x27b6('0x1a')](function(_0xc3c616){logger['error'](_0x27b6('0xf'),_0xc3c616[_0x27b6('0xe')],_0x3c4513);_0x2a40e3(_0x1df940['error'](0x1f4,_0xc3c616[_0x27b6('0xe')]));});});};exports[_0x27b6('0x1b')]=function(_0x117144){var _0x2b82b8=this;return new Promise(function(_0x1ba625,_0x4950d4){return db[_0x27b6('0x10')][_0x27b6('0x1c')](_0x117144['body'],{'raw':_0x117144[_0x27b6('0x12')]?_0x117144['options'][_0x27b6('0x13')]===undefined?!![]:![]:!![]})[_0x27b6('0x9')](function(_0x23aa65){logger['info'](_0x27b6('0x1b'),_0x117144);logger[_0x27b6('0xb')](_0x27b6('0x1b'),_0x117144,JSON['stringify'](_0x23aa65));_0x1ba625(_0x23aa65);})[_0x27b6('0x1a')](function(_0x566091){logger[_0x27b6('0xc')](_0x27b6('0x1b'),_0x566091[_0x27b6('0xe')],_0x117144);_0x4950d4(_0x2b82b8[_0x27b6('0xc')](0x1f4,_0x566091['message']));});});};exports[_0x27b6('0x1d')]=function(_0x1047e5){var _0x12ef59=this;return new Promise(function(_0x58ac04,_0x34bdfa){return db[_0x27b6('0x10')][_0x27b6('0x1e')](_0x1047e5['body'],{'raw':_0x1047e5[_0x27b6('0x12')]?_0x1047e5[_0x27b6('0x12')][_0x27b6('0x13')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1047e5['options']?_0x1047e5[_0x27b6('0x12')][_0x27b6('0x1f')]||null:null,'attributes':_0x1047e5[_0x27b6('0x12')]?_0x1047e5['options'][_0x27b6('0x14')]||null:null,'limit':_0x1047e5[_0x27b6('0x12')]?_0x1047e5[_0x27b6('0x12')]['limit']||null:null})[_0x27b6('0x9')](function(_0x5e5ead){logger['info'](_0x27b6('0x1d'),_0x1047e5);logger[_0x27b6('0xb')]('UpdateVoiceCallReport',_0x1047e5,JSON[_0x27b6('0x19')](_0x5e5ead));_0x58ac04(_0x5e5ead);})[_0x27b6('0x1a')](function(_0x2df3aa){logger[_0x27b6('0xc')](_0x27b6('0x1d'),_0x2df3aa[_0x27b6('0xe')],_0x1047e5);_0x34bdfa(_0x12ef59[_0x27b6('0xc')](0x1f4,_0x2df3aa[_0x27b6('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 6aed826..60f0aea 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 _0xe299=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','post','create','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x518294,_0x3845b3){var _0x227a02=function(_0x259dee){while(--_0x259dee){_0x518294['push'](_0x518294['shift']());}};_0x227a02(++_0x3845b3);}(_0xe299,0x1c5));var _0x9e29=function(_0x5bdf81,_0x377084){_0x5bdf81=_0x5bdf81-0x0;var _0x3dac91=_0xe299[_0x5bdf81];return _0x3dac91;};'use strict';var multer=require(_0x9e29('0x0'));var util=require(_0x9e29('0x1'));var path=require('path');var timeout=require(_0x9e29('0x2'));var express=require(_0x9e29('0x3'));var router=express[_0x9e29('0x4')]();var fs_extra=require(_0x9e29('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9e29('0x6'));var config=require(_0x9e29('0x7'));var controller=require(_0x9e29('0x8'));router[_0x9e29('0x9')]('/',auth[_0x9e29('0xa')](),controller[_0x9e29('0xb')]);router['get'](_0x9e29('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x9e29('0xd')]('/',auth[_0x9e29('0xa')](),controller[_0x9e29('0xe')]);router['put'](_0x9e29('0xc'),auth[_0x9e29('0xa')](),controller[_0x9e29('0xf')]);router[_0x9e29('0x10')](_0x9e29('0xc'),auth[_0x9e29('0xa')](),controller[_0x9e29('0x11')]);module[_0x9e29('0x12')]=router; \ No newline at end of file +var _0x1865=['multer','util','path','connect-timeout','express','../../components/auth/service','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show','post','create','update','destroy'];(function(_0x436c63,_0xd7a233){var _0xc8ed64=function(_0xbaf5f9){while(--_0xbaf5f9){_0x436c63['push'](_0x436c63['shift']());}};_0xc8ed64(++_0xd7a233);}(_0x1865,0xc0));var _0x5186=function(_0x4b5c9b,_0x4f5b16){_0x4b5c9b=_0x4b5c9b-0x0;var _0x3af66f=_0x1865[_0x4b5c9b];return _0x3af66f;};'use strict';var multer=require(_0x5186('0x0'));var util=require(_0x5186('0x1'));var path=require(_0x5186('0x2'));var timeout=require(_0x5186('0x3'));var express=require(_0x5186('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5186('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5186('0x6'));router[_0x5186('0x7')]('/',auth[_0x5186('0x8')](),controller[_0x5186('0x9')]);router[_0x5186('0x7')](_0x5186('0xa'),auth['isAuthenticated'](),controller[_0x5186('0xb')]);router[_0x5186('0xc')]('/',auth[_0x5186('0x8')](),controller[_0x5186('0xd')]);router['put'](_0x5186('0xa'),auth[_0x5186('0x8')](),controller[_0x5186('0xe')]);router['delete'](_0x5186('0xa'),auth['isAuthenticated'](),controller[_0x5186('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 629748c..71d6e32 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 _0x3aa8=['split','BOOLEAN','sequelize','STRING','name','setDataValue','options','join','getDataValue'];(function(_0x3f473d,_0x406151){var _0x56bba1=function(_0x5f488c){while(--_0x5f488c){_0x3f473d['push'](_0x3f473d['shift']());}};_0x56bba1(++_0x406151);}(_0x3aa8,0x80));var _0x83aa=function(_0x2d644d,_0x5ed363){_0x2d644d=_0x2d644d-0x0;var _0x4e645a=_0x3aa8[_0x2d644d];return _0x4e645a;};'use strict';var Sequelize=require(_0x83aa('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x83aa('0x1')],'unique':_0x83aa('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x83aa('0x1')],'set':function(_0xe409ba){this[_0x83aa('0x3')](_0x83aa('0x4'),_0xe409ba?_0xe409ba[_0x83aa('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0x83aa('0x4'))?this[_0x83aa('0x6')]('options')[_0x83aa('0x7')](''):[];}},'auth':{'type':Sequelize[_0x83aa('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x83aa('0x1')]},'record':{'type':Sequelize[_0x83aa('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x83aa('0x1')]}}; \ No newline at end of file +var _0x1e6b=['STRING','name','setDataValue','options','join','getDataValue','split','BOOLEAN','sequelize','exports'];(function(_0x2b72ec,_0x46d5f6){var _0x2a206b=function(_0xc6bd37){while(--_0xc6bd37){_0x2b72ec['push'](_0x2b72ec['shift']());}};_0x2a206b(++_0x46d5f6);}(_0x1e6b,0x184));var _0xb1e6=function(_0x4d4c0f,_0x4a5f51){_0x4d4c0f=_0x4d4c0f-0x0;var _0x4e5d4a=_0x1e6b[_0x4d4c0f];return _0x4e5d4a;};'use strict';var Sequelize=require(_0xb1e6('0x0'));module[_0xb1e6('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xb1e6('0x2')],'unique':_0xb1e6('0x3'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x167aff){this[_0xb1e6('0x4')](_0xb1e6('0x5'),_0x167aff?_0x167aff[_0xb1e6('0x6')](''):[]);},'get':function(){return this[_0xb1e6('0x7')](_0xb1e6('0x5'))?this[_0xb1e6('0x7')](_0xb1e6('0x5'))[_0xb1e6('0x8')](''):[];}},'auth':{'type':Sequelize[_0xb1e6('0x9')],'defaultValue':![]},'password':{'type':Sequelize[_0xb1e6('0x2')]},'record':{'type':Sequelize[_0xb1e6('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xb1e6('0x2')]},'description':{'type':Sequelize[_0xb1e6('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 3002a28..9b78d9f 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 _0xdeb3=['to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','status','end','json','undefined','limit','offset','Content-Range','apply','reject','save','update','then','destroy','get','ChanSpies','UserProfileResource','error','stack','name','map','VoiceChanSpy','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','catch','show','params','rawAttributes','create','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto'];(function(_0xd1c39b,_0x16f0c6){var _0x58f5bc=function(_0x412cf3){while(--_0x412cf3){_0xd1c39b['push'](_0xd1c39b['shift']());}};_0x58f5bc(++_0x16f0c6);}(_0xdeb3,0xeb));var _0x3deb=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xdeb3[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0x3deb('0x0'));var rimraf=require(_0x3deb('0x1'));var zipdir=require(_0x3deb('0x2'));var jsonpatch=require(_0x3deb('0x3'));var rp=require(_0x3deb('0x4'));var moment=require(_0x3deb('0x5'));var BPromise=require(_0x3deb('0x6'));var Mustache=require(_0x3deb('0x7'));var util=require(_0x3deb('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3deb('0x9'));var fs=require('fs');var fs_extra=require(_0x3deb('0xa'));var _=require(_0x3deb('0xb'));var squel=require(_0x3deb('0xc'));var crypto=require(_0x3deb('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3deb('0xe'));var querystring=require(_0x3deb('0xf'));var Papa=require(_0x3deb('0x10'));var Redis=require(_0x3deb('0x11'));var authService=require(_0x3deb('0x12'));var qs=require(_0x3deb('0x13'));var as=require(_0x3deb('0x14'));var hardwareService=require(_0x3deb('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x3deb('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x3deb('0x17'))['db'];function respondWithStatusCode(_0x21f596,_0x78aa81){_0x78aa81=_0x78aa81||0xcc;return function(_0x1055dc){if(_0x1055dc){return _0x21f596['sendStatus'](_0x78aa81);}return _0x21f596[_0x3deb('0x18')](_0x78aa81)[_0x3deb('0x19')]();};}function respondWithResult(_0x1a651d,_0x228e23){_0x228e23=_0x228e23||0xc8;return function(_0x329f3a){if(_0x329f3a){return _0x1a651d[_0x3deb('0x18')](_0x228e23)[_0x3deb('0x1a')](_0x329f3a);}};}function respondWithFilteredResult(_0xa25716,_0x4a291e){return function(_0x428f90){if(_0x428f90){var _0xa45605=typeof _0x4a291e['offset']===_0x3deb('0x1b')&&typeof _0x4a291e[_0x3deb('0x1c')]==='undefined';var _0x5cd9db=_0x428f90['count'];var _0x2a8ec4=_0xa45605?0x0:_0x4a291e[_0x3deb('0x1d')];var _0x4adbaa=_0xa45605?_0x428f90['count']:_0x4a291e[_0x3deb('0x1d')]+_0x4a291e[_0x3deb('0x1c')];var _0xb6be32;if(_0x4adbaa>=_0x5cd9db){_0x4adbaa=_0x5cd9db;_0xb6be32=0xc8;}else{_0xb6be32=0xce;}_0xa25716[_0x3deb('0x18')](_0xb6be32);return _0xa25716['set'](_0x3deb('0x1e'),_0x2a8ec4+'-'+_0x4adbaa+'/'+_0x5cd9db)[_0x3deb('0x1a')](_0x428f90);}return null;};}function patchUpdates(_0xbd82de){return function(_0x4ceab2){try{jsonpatch[_0x3deb('0x1f')](_0x4ceab2,_0xbd82de,!![]);}catch(_0x144671){return BPromise[_0x3deb('0x20')](_0x144671);}return _0x4ceab2[_0x3deb('0x21')]();};}function saveUpdates(_0x22ea80,_0x543014){return function(_0x35843b){if(_0x35843b){return _0x35843b[_0x3deb('0x22')](_0x22ea80)[_0x3deb('0x23')](function(_0x428869){return _0x428869;});}return null;};}function removeEntity(_0x12f415,_0x385e2a){return function(_0x3f3d52){if(_0x3f3d52){return _0x3f3d52[_0x3deb('0x24')]()['then'](function(){var _0xd42d62=_0x3f3d52[_0x3deb('0x25')]({'plain':!![]});var _0x1aacbd=_0x3deb('0x26');return db[_0x3deb('0x27')]['destroy']({'where':{'type':_0x1aacbd,'resourceId':_0xd42d62['id']}})[_0x3deb('0x23')](function(){return _0x3f3d52;});})[_0x3deb('0x23')](function(){_0x12f415[_0x3deb('0x18')](0xcc)[_0x3deb('0x19')]();});}};}function handleEntityNotFound(_0xec30ee,_0x331065){return function(_0xff692b){if(!_0xff692b){_0xec30ee['sendStatus'](0x194);}return _0xff692b;};}function handleError(_0x56b62c,_0x24b32d){_0x24b32d=_0x24b32d||0x1f4;return function(_0x520f24){logger[_0x3deb('0x28')](_0x520f24[_0x3deb('0x29')]);if(_0x520f24[_0x3deb('0x2a')]){delete _0x520f24['name'];}_0x56b62c[_0x3deb('0x18')](_0x24b32d)['send'](_0x520f24);};}exports['index']=function(_0x14ffa1,_0x205c22){var _0x29a190={},_0x7ecaa2={},_0x5c42ad={'count':0x0,'rows':[]};var _0x494dba=_[_0x3deb('0x2b')](db[_0x3deb('0x2c')]['rawAttributes'],function(_0x5bcac3){return{'name':_0x5bcac3[_0x3deb('0x2d')],'type':_0x5bcac3[_0x3deb('0x2e')][_0x3deb('0x2f')]};});_0x7ecaa2['model']=_[_0x3deb('0x2b')](_0x494dba,'name');_0x7ecaa2[_0x3deb('0x30')]=_[_0x3deb('0x31')](_0x14ffa1[_0x3deb('0x30')]);_0x7ecaa2[_0x3deb('0x32')]=_[_0x3deb('0x33')](_0x7ecaa2[_0x3deb('0x34')],_0x7ecaa2[_0x3deb('0x30')]);_0x29a190[_0x3deb('0x35')]=_[_0x3deb('0x33')](_0x7ecaa2[_0x3deb('0x34')],qs['fields'](_0x14ffa1[_0x3deb('0x30')][_0x3deb('0x36')]));_0x29a190[_0x3deb('0x35')]=_0x29a190[_0x3deb('0x35')][_0x3deb('0x37')]?_0x29a190[_0x3deb('0x35')]:_0x7ecaa2[_0x3deb('0x34')];if(!_0x14ffa1[_0x3deb('0x30')][_0x3deb('0x38')](_0x3deb('0x39'))){_0x29a190[_0x3deb('0x1c')]=qs[_0x3deb('0x1c')](_0x14ffa1[_0x3deb('0x30')][_0x3deb('0x1c')]);_0x29a190[_0x3deb('0x1d')]=qs[_0x3deb('0x1d')](_0x14ffa1['query']['offset']);}_0x29a190[_0x3deb('0x3a')]=qs[_0x3deb('0x3b')](_0x14ffa1[_0x3deb('0x30')]['sort']);_0x29a190[_0x3deb('0x3c')]=qs['filters'](_[_0x3deb('0x3d')](_0x14ffa1['query'],_0x7ecaa2[_0x3deb('0x32')]),_0x494dba);if(_0x14ffa1['query'][_0x3deb('0x3e')]){_0x29a190[_0x3deb('0x3c')]=_[_0x3deb('0x3f')](_0x29a190[_0x3deb('0x3c')],{'$or':_['map'](_0x494dba,function(_0x12ce28){if(_0x12ce28['type']!==_0x3deb('0x40')){var _0x30ed7c={};_0x30ed7c[_0x12ce28[_0x3deb('0x2a')]]={'$like':'%'+_0x14ffa1[_0x3deb('0x30')][_0x3deb('0x3e')]+'%'};return _0x30ed7c;}})});}_0x29a190=_[_0x3deb('0x3f')]({},_0x29a190,_0x14ffa1[_0x3deb('0x41')]);var _0x26973c={'where':_0x29a190['where']};return db[_0x3deb('0x2c')]['count'](_0x26973c)['then'](function(_0x5bbbfa){_0x5c42ad[_0x3deb('0x42')]=_0x5bbbfa;if(_0x14ffa1[_0x3deb('0x30')][_0x3deb('0x43')]){_0x29a190[_0x3deb('0x44')]=[{'all':!![]}];}return db[_0x3deb('0x2c')][_0x3deb('0x45')](_0x29a190);})[_0x3deb('0x23')](function(_0x4eed4a){_0x5c42ad['rows']=_0x4eed4a;return _0x5c42ad;})[_0x3deb('0x23')](respondWithFilteredResult(_0x205c22,_0x29a190))[_0x3deb('0x46')](handleError(_0x205c22,null));};exports[_0x3deb('0x47')]=function(_0x1e8979,_0x303e2e){var _0x4d4c13={'raw':![],'where':{'id':_0x1e8979[_0x3deb('0x48')]['id']}},_0x1fa3ca={};_0x1fa3ca[_0x3deb('0x34')]=_['keys'](db[_0x3deb('0x2c')][_0x3deb('0x49')]);_0x1fa3ca[_0x3deb('0x30')]=_[_0x3deb('0x31')](_0x1e8979[_0x3deb('0x30')]);_0x1fa3ca['filters']=_[_0x3deb('0x33')](_0x1fa3ca[_0x3deb('0x34')],_0x1fa3ca[_0x3deb('0x30')]);_0x4d4c13['attributes']=_['intersection'](_0x1fa3ca[_0x3deb('0x34')],qs[_0x3deb('0x36')](_0x1e8979[_0x3deb('0x30')][_0x3deb('0x36')]));_0x4d4c13[_0x3deb('0x35')]=_0x4d4c13['attributes'][_0x3deb('0x37')]?_0x4d4c13[_0x3deb('0x35')]:_0x1fa3ca[_0x3deb('0x34')];if(_0x1e8979[_0x3deb('0x30')][_0x3deb('0x43')]){_0x4d4c13[_0x3deb('0x44')]=[{'all':!![]}];}_0x4d4c13=_[_0x3deb('0x3f')]({},_0x4d4c13,_0x1e8979[_0x3deb('0x41')]);return db[_0x3deb('0x2c')]['find'](_0x4d4c13)[_0x3deb('0x23')](handleEntityNotFound(_0x303e2e,null))[_0x3deb('0x23')](respondWithResult(_0x303e2e,null))[_0x3deb('0x46')](handleError(_0x303e2e,null));};exports[_0x3deb('0x4a')]=function(_0x448505,_0x4b3cd6){return db[_0x3deb('0x2c')][_0x3deb('0x4a')](_0x448505['body'],{})['then'](function(_0x55cdaa){var _0x864bd2=_0x448505[_0x3deb('0x4b')]['get']({'plain':!![]});if(!_0x864bd2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x864bd2[_0x3deb('0x4c')]===_0x3deb('0x4b')){var _0x8aabc0=_0x55cdaa[_0x3deb('0x25')]({'plain':!![]});var _0x47f001=_0x3deb('0x26');return db[_0x3deb('0x4d')][_0x3deb('0x4e')]({'where':{'name':_0x47f001,'userProfileId':_0x864bd2[_0x3deb('0x4f')]},'raw':!![]})[_0x3deb('0x23')](function(_0x1e53e4){if(_0x1e53e4&&_0x1e53e4[_0x3deb('0x50')]===0x0){return db[_0x3deb('0x27')]['create']({'name':_0x8aabc0['name'],'resourceId':_0x8aabc0['id'],'type':_0x1e53e4[_0x3deb('0x2a')],'sectionId':_0x1e53e4['id']},{})[_0x3deb('0x23')](function(){return _0x55cdaa;});}else{return _0x55cdaa;}})[_0x3deb('0x46')](function(_0x46a180){logger[_0x3deb('0x28')](_0x3deb('0x51'),_0x46a180);throw _0x46a180;});}return _0x55cdaa;})[_0x3deb('0x23')](respondWithResult(_0x4b3cd6,0xc9))[_0x3deb('0x46')](handleError(_0x4b3cd6,null));};exports[_0x3deb('0x22')]=function(_0x22b8e1,_0x2111e0){if(_0x22b8e1[_0x3deb('0x52')]['id']){delete _0x22b8e1[_0x3deb('0x52')]['id'];}return db[_0x3deb('0x2c')]['find']({'where':{'id':_0x22b8e1['params']['id']}})[_0x3deb('0x23')](handleEntityNotFound(_0x2111e0,null))['then'](saveUpdates(_0x22b8e1['body'],null))[_0x3deb('0x23')](respondWithResult(_0x2111e0,null))[_0x3deb('0x46')](handleError(_0x2111e0,null));};exports[_0x3deb('0x24')]=function(_0x4195b5,_0x59a3c0){return db[_0x3deb('0x2c')][_0x3deb('0x4e')]({'where':{'id':_0x4195b5[_0x3deb('0x48')]['id']}})[_0x3deb('0x23')](handleEntityNotFound(_0x59a3c0,null))[_0x3deb('0x23')](removeEntity(_0x59a3c0,null))[_0x3deb('0x46')](handleError(_0x59a3c0,null));}; \ No newline at end of file +var _0xd2ea=['params','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','apply','reject','save','update','then','get','ChanSpies','UserProfileResource','destroy','end','sendStatus','error','stack','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show'];(function(_0x313d3f,_0x3c51a3){var _0x10660e=function(_0x5c551a){while(--_0x5c551a){_0x313d3f['push'](_0x313d3f['shift']());}};_0x10660e(++_0x3c51a3);}(_0xd2ea,0x15f));var _0xad2e=function(_0x4be93,_0x56355b){_0x4be93=_0x4be93-0x0;var _0x4dcee8=_0xd2ea[_0x4be93];return _0x4dcee8;};'use strict';var emlformat=require(_0xad2e('0x0'));var rimraf=require(_0xad2e('0x1'));var zipdir=require(_0xad2e('0x2'));var jsonpatch=require(_0xad2e('0x3'));var rp=require(_0xad2e('0x4'));var moment=require('moment');var BPromise=require(_0xad2e('0x5'));var Mustache=require(_0xad2e('0x6'));var util=require(_0xad2e('0x7'));var path=require(_0xad2e('0x8'));var sox=require(_0xad2e('0x9'));var csv=require(_0xad2e('0xa'));var ejs=require(_0xad2e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xad2e('0xc'));var squel=require(_0xad2e('0xd'));var crypto=require(_0xad2e('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xad2e('0xf'));var toCsv=require(_0xad2e('0xa'));var querystring=require('querystring');var Papa=require(_0xad2e('0x10'));var Redis=require('ioredis');var authService=require(_0xad2e('0x11'));var qs=require(_0xad2e('0x12'));var as=require(_0xad2e('0x13'));var hardwareService=require(_0xad2e('0x14'));var logger=require('../../config/logger')(_0xad2e('0x15'));var utils=require('../../config/utils');var config=require(_0xad2e('0x16'));var licenseUtil=require(_0xad2e('0x17'));var db=require(_0xad2e('0x18'))['db'];function respondWithStatusCode(_0x42e2f2,_0x59a342){_0x59a342=_0x59a342||0xcc;return function(_0x27fb5a){if(_0x27fb5a){return _0x42e2f2['sendStatus'](_0x59a342);}return _0x42e2f2[_0xad2e('0x19')](_0x59a342)['end']();};}function respondWithResult(_0x4fbabc,_0x4a812b){_0x4a812b=_0x4a812b||0xc8;return function(_0x5c96a7){if(_0x5c96a7){return _0x4fbabc[_0xad2e('0x19')](_0x4a812b)[_0xad2e('0x1a')](_0x5c96a7);}};}function respondWithFilteredResult(_0x1646d5,_0x2b6945){return function(_0x17e6ac){if(_0x17e6ac){var _0x4180aa=typeof _0x2b6945[_0xad2e('0x1b')]===_0xad2e('0x1c')&&typeof _0x2b6945[_0xad2e('0x1d')]===_0xad2e('0x1c');var _0x2af208=_0x17e6ac[_0xad2e('0x1e')];var _0x34f946=_0x4180aa?0x0:_0x2b6945[_0xad2e('0x1b')];var _0x163e83=_0x4180aa?_0x17e6ac['count']:_0x2b6945[_0xad2e('0x1b')]+_0x2b6945[_0xad2e('0x1d')];var _0x489585;if(_0x163e83>=_0x2af208){_0x163e83=_0x2af208;_0x489585=0xc8;}else{_0x489585=0xce;}_0x1646d5['status'](_0x489585);return _0x1646d5['set']('Content-Range',_0x34f946+'-'+_0x163e83+'/'+_0x2af208)[_0xad2e('0x1a')](_0x17e6ac);}return null;};}function patchUpdates(_0x293adc){return function(_0x5549db){try{jsonpatch[_0xad2e('0x1f')](_0x5549db,_0x293adc,!![]);}catch(_0x1796f7){return BPromise[_0xad2e('0x20')](_0x1796f7);}return _0x5549db[_0xad2e('0x21')]();};}function saveUpdates(_0x23c0b6,_0x102169){return function(_0x154d54){if(_0x154d54){return _0x154d54[_0xad2e('0x22')](_0x23c0b6)[_0xad2e('0x23')](function(_0xd907a9){return _0xd907a9;});}return null;};}function removeEntity(_0x20e664,_0x207517){return function(_0x2e1c95){if(_0x2e1c95){return _0x2e1c95['destroy']()[_0xad2e('0x23')](function(){var _0x2e8887=_0x2e1c95[_0xad2e('0x24')]({'plain':!![]});var _0x350c66=_0xad2e('0x25');return db[_0xad2e('0x26')][_0xad2e('0x27')]({'where':{'type':_0x350c66,'resourceId':_0x2e8887['id']}})[_0xad2e('0x23')](function(){return _0x2e1c95;});})[_0xad2e('0x23')](function(){_0x20e664['status'](0xcc)[_0xad2e('0x28')]();});}};}function handleEntityNotFound(_0x5d675f,_0x2b2bc2){return function(_0x28ef72){if(!_0x28ef72){_0x5d675f[_0xad2e('0x29')](0x194);}return _0x28ef72;};}function handleError(_0x11bfa9,_0x5aec9d){_0x5aec9d=_0x5aec9d||0x1f4;return function(_0x1676e5){logger[_0xad2e('0x2a')](_0x1676e5[_0xad2e('0x2b')]);if(_0x1676e5[_0xad2e('0x2c')]){delete _0x1676e5[_0xad2e('0x2c')];}_0x11bfa9['status'](_0x5aec9d)[_0xad2e('0x2d')](_0x1676e5);};}exports[_0xad2e('0x2e')]=function(_0x2a0dc7,_0x4379f4){var _0x42fe6c={},_0x9b4a23={},_0x409f58={'count':0x0,'rows':[]};var _0x3e3d86=_[_0xad2e('0x2f')](db[_0xad2e('0x30')][_0xad2e('0x31')],function(_0x56330e){return{'name':_0x56330e[_0xad2e('0x32')],'type':_0x56330e['type'][_0xad2e('0x33')]};});_0x9b4a23[_0xad2e('0x34')]=_[_0xad2e('0x2f')](_0x3e3d86,_0xad2e('0x2c'));_0x9b4a23[_0xad2e('0x35')]=_['keys'](_0x2a0dc7[_0xad2e('0x35')]);_0x9b4a23[_0xad2e('0x36')]=_['intersection'](_0x9b4a23[_0xad2e('0x34')],_0x9b4a23[_0xad2e('0x35')]);_0x42fe6c['attributes']=_[_0xad2e('0x37')](_0x9b4a23[_0xad2e('0x34')],qs[_0xad2e('0x38')](_0x2a0dc7[_0xad2e('0x35')][_0xad2e('0x38')]));_0x42fe6c[_0xad2e('0x39')]=_0x42fe6c[_0xad2e('0x39')]['length']?_0x42fe6c[_0xad2e('0x39')]:_0x9b4a23[_0xad2e('0x34')];if(!_0x2a0dc7['query'][_0xad2e('0x3a')](_0xad2e('0x3b'))){_0x42fe6c[_0xad2e('0x1d')]=qs[_0xad2e('0x1d')](_0x2a0dc7[_0xad2e('0x35')][_0xad2e('0x1d')]);_0x42fe6c['offset']=qs['offset'](_0x2a0dc7[_0xad2e('0x35')]['offset']);}_0x42fe6c[_0xad2e('0x3c')]=qs[_0xad2e('0x3d')](_0x2a0dc7[_0xad2e('0x35')][_0xad2e('0x3d')]);_0x42fe6c[_0xad2e('0x3e')]=qs['filters'](_[_0xad2e('0x3f')](_0x2a0dc7[_0xad2e('0x35')],_0x9b4a23['filters']),_0x3e3d86);if(_0x2a0dc7['query']['filter']){_0x42fe6c[_0xad2e('0x3e')]=_['merge'](_0x42fe6c['where'],{'$or':_[_0xad2e('0x2f')](_0x3e3d86,function(_0x18f926){if(_0x18f926[_0xad2e('0x40')]!==_0xad2e('0x41')){var _0x6f4fbc={};_0x6f4fbc[_0x18f926[_0xad2e('0x2c')]]={'$like':'%'+_0x2a0dc7[_0xad2e('0x35')]['filter']+'%'};return _0x6f4fbc;}})});}_0x42fe6c=_[_0xad2e('0x42')]({},_0x42fe6c,_0x2a0dc7[_0xad2e('0x43')]);var _0x46684d={'where':_0x42fe6c[_0xad2e('0x3e')]};return db[_0xad2e('0x30')]['count'](_0x46684d)[_0xad2e('0x23')](function(_0x554ed8){_0x409f58[_0xad2e('0x1e')]=_0x554ed8;if(_0x2a0dc7[_0xad2e('0x35')][_0xad2e('0x44')]){_0x42fe6c[_0xad2e('0x45')]=[{'all':!![]}];}return db[_0xad2e('0x30')][_0xad2e('0x46')](_0x42fe6c);})[_0xad2e('0x23')](function(_0x27a0d3){_0x409f58[_0xad2e('0x47')]=_0x27a0d3;return _0x409f58;})[_0xad2e('0x23')](respondWithFilteredResult(_0x4379f4,_0x42fe6c))[_0xad2e('0x48')](handleError(_0x4379f4,null));};exports[_0xad2e('0x49')]=function(_0x1d18d0,_0x1b78f9){var _0xf7b911={'raw':![],'where':{'id':_0x1d18d0[_0xad2e('0x4a')]['id']}},_0x2ad9a0={};_0x2ad9a0[_0xad2e('0x34')]=_[_0xad2e('0x4b')](db[_0xad2e('0x30')]['rawAttributes']);_0x2ad9a0[_0xad2e('0x35')]=_[_0xad2e('0x4b')](_0x1d18d0[_0xad2e('0x35')]);_0x2ad9a0[_0xad2e('0x36')]=_[_0xad2e('0x37')](_0x2ad9a0[_0xad2e('0x34')],_0x2ad9a0[_0xad2e('0x35')]);_0xf7b911['attributes']=_[_0xad2e('0x37')](_0x2ad9a0['model'],qs[_0xad2e('0x38')](_0x1d18d0[_0xad2e('0x35')][_0xad2e('0x38')]));_0xf7b911[_0xad2e('0x39')]=_0xf7b911[_0xad2e('0x39')]['length']?_0xf7b911[_0xad2e('0x39')]:_0x2ad9a0[_0xad2e('0x34')];if(_0x1d18d0[_0xad2e('0x35')][_0xad2e('0x44')]){_0xf7b911[_0xad2e('0x45')]=[{'all':!![]}];}_0xf7b911=_['merge']({},_0xf7b911,_0x1d18d0[_0xad2e('0x43')]);return db[_0xad2e('0x30')][_0xad2e('0x4c')](_0xf7b911)[_0xad2e('0x23')](handleEntityNotFound(_0x1b78f9,null))['then'](respondWithResult(_0x1b78f9,null))['catch'](handleError(_0x1b78f9,null));};exports[_0xad2e('0x4d')]=function(_0x343e4f,_0x4d2c66){return db['VoiceChanSpy'][_0xad2e('0x4d')](_0x343e4f['body'],{})[_0xad2e('0x23')](function(_0x2fb7d9){var _0x5196bf=_0x343e4f[_0xad2e('0x4e')][_0xad2e('0x24')]({'plain':!![]});if(!_0x5196bf)throw new Error(_0xad2e('0x4f'));if(_0x5196bf[_0xad2e('0x50')]==='user'){var _0x527c93=_0x2fb7d9[_0xad2e('0x24')]({'plain':!![]});var _0x2d2af3=_0xad2e('0x25');return db[_0xad2e('0x51')][_0xad2e('0x4c')]({'where':{'name':_0x2d2af3,'userProfileId':_0x5196bf[_0xad2e('0x52')]},'raw':!![]})[_0xad2e('0x23')](function(_0x3e90d0){if(_0x3e90d0&&_0x3e90d0['autoAssociation']===0x0){return db[_0xad2e('0x26')]['create']({'name':_0x527c93[_0xad2e('0x2c')],'resourceId':_0x527c93['id'],'type':_0x3e90d0[_0xad2e('0x2c')],'sectionId':_0x3e90d0['id']},{})[_0xad2e('0x23')](function(){return _0x2fb7d9;});}else{return _0x2fb7d9;}})[_0xad2e('0x48')](function(_0x450448){logger[_0xad2e('0x2a')](_0xad2e('0x53'),_0x450448);throw _0x450448;});}return _0x2fb7d9;})['then'](respondWithResult(_0x4d2c66,0xc9))[_0xad2e('0x48')](handleError(_0x4d2c66,null));};exports['update']=function(_0x2d2dc2,_0x4222a7){if(_0x2d2dc2[_0xad2e('0x54')]['id']){delete _0x2d2dc2[_0xad2e('0x54')]['id'];}return db['VoiceChanSpy'][_0xad2e('0x4c')]({'where':{'id':_0x2d2dc2[_0xad2e('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4222a7,null))[_0xad2e('0x23')](saveUpdates(_0x2d2dc2['body'],null))[_0xad2e('0x23')](respondWithResult(_0x4222a7,null))[_0xad2e('0x48')](handleError(_0x4222a7,null));};exports[_0xad2e('0x27')]=function(_0xee4026,_0x243d14){return db[_0xad2e('0x30')][_0xad2e('0x4c')]({'where':{'id':_0xee4026[_0xad2e('0x4a')]['id']}})[_0xad2e('0x23')](handleEntityNotFound(_0x243d14,null))['then'](removeEntity(_0x243d14,null))[_0xad2e('0x48')](handleError(_0x243d14,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 29fbd99..402dc33 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 _0xe39a=['models','VoiceChanSpy','destroy','VoiceExtension','bulkCreate','lodash','util','./voiceChanSpy.attributes','context','from-sip','%s%s','prefix','system','push','Set','format','chanspy','record','merge','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal','User','agent','then','catch','exports'];(function(_0x2ff238,_0x1811d2){var _0x204a56=function(_0x5bf2e1){while(--_0x5bf2e1){_0x2ff238['push'](_0x2ff238['shift']());}};_0x204a56(++_0x1811d2);}(_0xe39a,0x7a));var _0xae39=function(_0x57a234,_0xd3ea21){_0x57a234=_0x57a234-0x0;var _0x4d799f=_0xe39a[_0x57a234];return _0x4d799f;};'use strict';var _=require(_0xae39('0x0'));var util=require(_0xae39('0x1'));var BPromise=require('bluebird');var attributes=require(_0xae39('0x2'));var getUserApplications=function(_0x279f2a,_0x293901,_0xb378d2){var _0x345c30=0x1;var _0xead729=[];var _0x37f001={'context':_0x293901[_0xae39('0x3')]||_0xae39('0x4'),'exten':util['format'](_0xae39('0x5'),_0x279f2a[_0xae39('0x6')],_0xb378d2),'type':_0xae39('0x7'),'isApp':![],'ChanSpyId':_0x279f2a['id'],'UserId':_0x293901['id']};_0xead729[_0xae39('0x8')](_['merge']({'app':_0xae39('0x9'),'appdata':util[_0xae39('0xa')]('CDR(type)=%s',_0xae39('0xb')),'priority':_0x345c30++},_0x37f001));if(_0x279f2a[_0xae39('0xc')]){_0xead729[_0xae39('0x8')](_[_0xae39('0xd')]({'app':_0xae39('0xe'),'appdata':util[_0xae39('0xa')](_0xae39('0xf'),_0x279f2a[_0xae39('0x10')]),'priority':_0x345c30++},_0x37f001));}if(_0x279f2a[_0xae39('0x11')]){_0xead729[_0xae39('0x8')](_['merge']({'app':_0xae39('0x12'),'appdata':_0x279f2a[_0xae39('0x13')],'priority':_0x345c30++},_0x37f001));}_0xead729['push'](_['merge']({'app':_0xae39('0x14'),'appdata':util[_0xae39('0xa')](_0xae39('0x15'),_0x293901[_0xae39('0x16')],_0x279f2a[_0xae39('0x17')]?_0x279f2a['options'][_0xae39('0x18')](''):''),'priority':_0x345c30++},_0x37f001));if(_0x279f2a['record']){_0xead729[_0xae39('0x8')](_[_0xae39('0xd')]({'app':_0xae39('0x19'),'priority':_0x345c30++},_0x37f001));}return _0xead729;};var getChanSpyApplications=function(_0x34bea8,_0x101919){var _0x5a0954=[];for(var _0x266bae=0x0,_0x797fac=0x1;_0x266bae<_0x101919[_0xae39('0x1a')];_0x266bae++,_0x797fac=0x1){_0x5a0954=_0x5a0954[_0xae39('0x1b')](getUserApplications(_0x34bea8,_0x101919[_0x266bae],_0x101919[_0x266bae][_0xae39('0x1c')]));if(_0x101919[_0x266bae][_0xae39('0x1c')]!=_0x101919[_0x266bae]['name']){_0x5a0954=_0x5a0954[_0xae39('0x1b')](getUserApplications(_0x34bea8,_0x101919[_0x266bae],_0x101919[_0x266bae][_0xae39('0x16')]));}}return _0x5a0954;};var getChanSpyPromise=function(_0x3eb328,_0x17f4e7){return new BPromise(function(_0x7d372c,_0x283983){return _0x3eb328[_0xae39('0x1d')]['findAll']({'attributes':['id','name',_0xae39('0x1c')],'where':{'role':_0xae39('0x1e'),'chanspy':!![]},'raw':!![]})[_0xae39('0x1f')](function(_0x187ac9){if(_0x187ac9){return _0x7d372c(getChanSpyApplications(_0x17f4e7,_0x187ac9));}return _0x7d372c([]);})[_0xae39('0x20')](function(_0x528caf){_0x283983(_0x528caf);});});};module[_0xae39('0x21')]=function(_0x360f07,_0x3b3b9b){var _0x4ab066=_0x360f07[_0xae39('0x22')];return _0x360f07['define'](_0xae39('0x23'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x26a927,_0x556aef,_0x1536fd){return getChanSpyPromise(_0x4ab066,_0x26a927)[_0xae39('0x1f')](function(_0x285af0){if(_0x285af0&&_0x285af0['length']){return _0x4ab066['VoiceExtension']['bulkCreate'](_0x285af0);}})[_0xae39('0x1f')](function(){_0x1536fd();})[_0xae39('0x20')](function(_0x113071){_0x1536fd(_0x113071);});},'afterUpdate':function(_0x421f24,_0x49df15,_0x2f5826){return _0x4ab066['VoiceExtension'][_0xae39('0x24')]({'where':{'ChanSpyId':_0x421f24['id']}})['then'](function(){return getChanSpyPromise(_0x4ab066,_0x421f24);})[_0xae39('0x1f')](function(_0x26cbbd){if(_0x26cbbd&&_0x26cbbd['length']){return _0x4ab066[_0xae39('0x25')][_0xae39('0x26')](_0x26cbbd);}})[_0xae39('0x1f')](function(){_0x2f5826();})[_0xae39('0x20')](function(_0x136e2c){_0x2f5826(_0x136e2c);});},'afterDestroy':function(_0x4753b9,_0x2db998,_0x3c6269){return _0x4ab066[_0xae39('0x25')][_0xae39('0x24')]({'where':{'ChanSpyId':_0x4753b9['id']}})[_0xae39('0x1f')](function(){_0x3c6269();})[_0xae39('0x20')](function(_0x15182e){_0x3c6269(_0x15182e);});}}});}; \ No newline at end of file +var _0xe95f=['Set','CDR(type)=%s','chanspy','record','push','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','ChanSpy','SIP/%s,%s','options','StopMixMonitor','length','concat','internal','name','User','then','catch','exports','models','define','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash','util','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','merge'];(function(_0x37e343,_0x5dbfea){var _0xf688dc=function(_0x3b4766){while(--_0x3b4766){_0x37e343['push'](_0x37e343['shift']());}};_0xf688dc(++_0x5dbfea);}(_0xe95f,0x1d7));var _0xfe95=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe95f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfe95('0x0'));var util=require(_0xfe95('0x1'));var BPromise=require('bluebird');var attributes=require(_0xfe95('0x2'));var getUserApplications=function(_0x412f5e,_0x5081d6,_0x1f6c3a){var _0x59fb47=0x1;var _0x5b63ec=[];var _0x587a7d={'context':_0x5081d6[_0xfe95('0x3')]||_0xfe95('0x4'),'exten':util[_0xfe95('0x5')](_0xfe95('0x6'),_0x412f5e[_0xfe95('0x7')],_0x1f6c3a),'type':_0xfe95('0x8'),'isApp':![],'ChanSpyId':_0x412f5e['id'],'UserId':_0x5081d6['id']};_0x5b63ec['push'](_[_0xfe95('0x9')]({'app':_0xfe95('0xa'),'appdata':util['format'](_0xfe95('0xb'),_0xfe95('0xc')),'priority':_0x59fb47++},_0x587a7d));if(_0x412f5e[_0xfe95('0xd')]){_0x5b63ec[_0xfe95('0xe')](_[_0xfe95('0x9')]({'app':_0xfe95('0xf'),'appdata':util['format'](_0xfe95('0x10'),_0x412f5e[_0xfe95('0x11')]),'priority':_0x59fb47++},_0x587a7d));}if(_0x412f5e[_0xfe95('0x12')]){_0x5b63ec['push'](_[_0xfe95('0x9')]({'app':'Authenticate','appdata':_0x412f5e['password'],'priority':_0x59fb47++},_0x587a7d));}_0x5b63ec[_0xfe95('0xe')](_[_0xfe95('0x9')]({'app':_0xfe95('0x13'),'appdata':util[_0xfe95('0x5')](_0xfe95('0x14'),_0x5081d6['name'],_0x412f5e[_0xfe95('0x15')]?_0x412f5e[_0xfe95('0x15')]['join'](''):''),'priority':_0x59fb47++},_0x587a7d));if(_0x412f5e[_0xfe95('0xd')]){_0x5b63ec[_0xfe95('0xe')](_['merge']({'app':_0xfe95('0x16'),'priority':_0x59fb47++},_0x587a7d));}return _0x5b63ec;};var getChanSpyApplications=function(_0x4f5ce9,_0x506df5){var _0x4423d0=[];for(var _0x5a660a=0x0,_0x39b441=0x1;_0x5a660a<_0x506df5[_0xfe95('0x17')];_0x5a660a++,_0x39b441=0x1){_0x4423d0=_0x4423d0[_0xfe95('0x18')](getUserApplications(_0x4f5ce9,_0x506df5[_0x5a660a],_0x506df5[_0x5a660a][_0xfe95('0x19')]));if(_0x506df5[_0x5a660a]['internal']!=_0x506df5[_0x5a660a][_0xfe95('0x1a')]){_0x4423d0=_0x4423d0['concat'](getUserApplications(_0x4f5ce9,_0x506df5[_0x5a660a],_0x506df5[_0x5a660a][_0xfe95('0x1a')]));}}return _0x4423d0;};var getChanSpyPromise=function(_0x59f49f,_0x2d3e3a){return new BPromise(function(_0x44ed78,_0x1fc90e){return _0x59f49f[_0xfe95('0x1b')]['findAll']({'attributes':['id',_0xfe95('0x1a'),_0xfe95('0x19')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0xfe95('0x1c')](function(_0x326cf1){if(_0x326cf1){return _0x44ed78(getChanSpyApplications(_0x2d3e3a,_0x326cf1));}return _0x44ed78([]);})[_0xfe95('0x1d')](function(_0x332b7c){_0x1fc90e(_0x332b7c);});});};module[_0xfe95('0x1e')]=function(_0x44ed99,_0x3750e9){var _0x50280f=_0x44ed99[_0xfe95('0x1f')];return _0x44ed99[_0xfe95('0x20')]('VoiceChanSpy',attributes,{'tableName':_0xfe95('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x21cfc5,_0x556e99,_0xd7ec27){return getChanSpyPromise(_0x50280f,_0x21cfc5)[_0xfe95('0x1c')](function(_0x271af9){if(_0x271af9&&_0x271af9['length']){return _0x50280f[_0xfe95('0x22')][_0xfe95('0x23')](_0x271af9);}})[_0xfe95('0x1c')](function(){_0xd7ec27();})['catch'](function(_0x2eba30){_0xd7ec27(_0x2eba30);});},'afterUpdate':function(_0x1189f1,_0x2870b7,_0x4e825e){return _0x50280f['VoiceExtension'][_0xfe95('0x24')]({'where':{'ChanSpyId':_0x1189f1['id']}})[_0xfe95('0x1c')](function(){return getChanSpyPromise(_0x50280f,_0x1189f1);})[_0xfe95('0x1c')](function(_0x58465d){if(_0x58465d&&_0x58465d['length']){return _0x50280f[_0xfe95('0x22')][_0xfe95('0x23')](_0x58465d);}})['then'](function(){_0x4e825e();})[_0xfe95('0x1d')](function(_0x23bb3c){_0x4e825e(_0x23bb3c);});},'afterDestroy':function(_0x187eae,_0x409567,_0x30a8b2){return _0x50280f[_0xfe95('0x22')]['destroy']({'where':{'ChanSpyId':_0x187eae['id']}})['then'](function(){_0x30a8b2();})[_0xfe95('0x1d')](function(_0xb5b54d){_0x30a8b2(_0xb5b54d);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 6cab555..7e7bec2 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 _0x263f=['client','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0xa4928c,_0x16b89c){var _0x27cc29=function(_0x14b819){while(--_0x14b819){_0xa4928c['push'](_0xa4928c['shift']());}};_0x27cc29(++_0x16b89c);}(_0x263f,0x182));var _0xf263=function(_0x4f890c,_0x5f0d98){_0x4f890c=_0x4f890c-0x0;var _0x53cc03=_0x263f[_0x4f890c];return _0x53cc03;};'use strict';var _=require(_0xf263('0x0'));var util=require(_0xf263('0x1'));var moment=require(_0xf263('0x2'));var BPromise=require(_0xf263('0x3'));var rs=require(_0xf263('0x4'));var fs=require('fs');var Redis=require(_0xf263('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf263('0x6'));var logger=require(_0xf263('0x7'))(_0xf263('0x8'));var config=require('../../config/environment');var jayson=require(_0xf263('0x9'));var client=jayson[_0xf263('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4fded6,_0xa2b1b0,_0x9644ab){return new BPromise(function(_0xa2e77e,_0x16ff53){return client['request'](_0x4fded6,_0x9644ab)[_0xf263('0xb')](function(_0x26504c){logger[_0xf263('0xc')](_0xf263('0xd'),_0xa2b1b0,_0xf263('0xe'));logger[_0xf263('0xf')](_0xf263('0x10'),_0xa2b1b0,'request\x20sent',JSON[_0xf263('0x11')](_0x26504c));if(_0x26504c['error']){if(_0x26504c[_0xf263('0x12')]['code']===0x1f4){logger['error'](_0xf263('0xd'),_0xa2b1b0,_0x26504c[_0xf263('0x12')][_0xf263('0x13')]);return _0x16ff53(_0x26504c[_0xf263('0x12')][_0xf263('0x13')]);}logger[_0xf263('0x12')](_0xf263('0xd'),_0xa2b1b0,_0x26504c['error'][_0xf263('0x13')]);return _0xa2e77e(_0x26504c['error'][_0xf263('0x13')]);}else{logger[_0xf263('0xc')](_0xf263('0xd'),_0xa2b1b0,_0xf263('0xe'));_0xa2e77e(_0x26504c[_0xf263('0x14')][_0xf263('0x13')]);}})[_0xf263('0x15')](function(_0x57c655){logger['error'](_0xf263('0xd'),_0xa2b1b0,_0x57c655);_0x16ff53(_0x57c655);});});} \ No newline at end of file +var _0xd52d=['jayson/promise','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x574e41,_0x2afd79){var _0x2c0516=function(_0x1a3146){while(--_0x1a3146){_0x574e41['push'](_0x574e41['shift']());}};_0x2c0516(++_0x2afd79);}(_0xd52d,0x1c7));var _0xdd52=function(_0x455c86,_0x4da22d){_0x455c86=_0x455c86-0x0;var _0x4b69f2=_0xd52d[_0x455c86];return _0x4b69f2;};'use strict';var _=require('lodash');var util=require(_0xdd52('0x0'));var moment=require(_0xdd52('0x1'));var BPromise=require('bluebird');var rs=require(_0xdd52('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xdd52('0x3'));var logger=require(_0xdd52('0x4'))(_0xdd52('0x5'));var config=require(_0xdd52('0x6'));var jayson=require(_0xdd52('0x7'));var client=jayson[_0xdd52('0x8')][_0xdd52('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x18d01d,_0x4ca1a2,_0x1b8b74){return new BPromise(function(_0x6ab1e3,_0x8a6170){return client[_0xdd52('0xa')](_0x18d01d,_0x1b8b74)[_0xdd52('0xb')](function(_0xb6616a){logger[_0xdd52('0xc')](_0xdd52('0xd'),_0x4ca1a2,_0xdd52('0xe'));logger[_0xdd52('0xf')](_0xdd52('0x10'),_0x4ca1a2,_0xdd52('0xe'),JSON[_0xdd52('0x11')](_0xb6616a));if(_0xb6616a['error']){if(_0xb6616a[_0xdd52('0x12')][_0xdd52('0x13')]===0x1f4){logger[_0xdd52('0x12')](_0xdd52('0xd'),_0x4ca1a2,_0xb6616a[_0xdd52('0x12')][_0xdd52('0x14')]);return _0x8a6170(_0xb6616a['error'][_0xdd52('0x14')]);}logger[_0xdd52('0x12')](_0xdd52('0xd'),_0x4ca1a2,_0xb6616a['error'][_0xdd52('0x14')]);return _0x6ab1e3(_0xb6616a[_0xdd52('0x12')][_0xdd52('0x14')]);}else{logger[_0xdd52('0xc')](_0xdd52('0xd'),_0x4ca1a2,_0xdd52('0xe'));_0x6ab1e3(_0xb6616a[_0xdd52('0x15')][_0xdd52('0x14')]);}})['catch'](function(_0x468c7a){logger['error'](_0xdd52('0xd'),_0x4ca1a2,_0x468c7a);_0x8a6170(_0x468c7a);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index d2b32bf..40a876a 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 _0x275c=['../../components/interaction/service','../../config/environment','./voiceContext.controller','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x522dbf,_0x37abca){var _0x5d80d3=function(_0x1d5b4c){while(--_0x1d5b4c){_0x522dbf['push'](_0x522dbf['shift']());}};_0x5d80d3(++_0x37abca);}(_0x275c,0x162));var _0xc275=function(_0x4395e8,_0x51daeb){_0x4395e8=_0x4395e8-0x0;var _0x20886c=_0x275c[_0x4395e8];return _0x20886c;};'use strict';var multer=require(_0xc275('0x0'));var util=require(_0xc275('0x1'));var path=require(_0xc275('0x2'));var timeout=require(_0xc275('0x3'));var express=require(_0xc275('0x4'));var router=express[_0xc275('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc275('0x6'));var interaction=require(_0xc275('0x7'));var config=require(_0xc275('0x8'));var controller=require(_0xc275('0x9'));router['get']('/',auth[_0xc275('0xa')](),controller[_0xc275('0xb')]);router['get'](_0xc275('0xc'),auth[_0xc275('0xa')](),controller['show']);router[_0xc275('0xd')]('/',auth[_0xc275('0xa')](),controller[_0xc275('0xe')]);router[_0xc275('0xf')]('/:id',auth[_0xc275('0xa')](),controller[_0xc275('0x10')]);router[_0xc275('0x11')]('/:id',auth[_0xc275('0xa')](),controller[_0xc275('0x12')]);module['exports']=router; \ No newline at end of file +var _0x548b=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','create','put','update','delete','/:id','destroy','exports'];(function(_0x4e7daa,_0x1aa970){var _0xb37abd=function(_0x2f78c7){while(--_0x2f78c7){_0x4e7daa['push'](_0x4e7daa['shift']());}};_0xb37abd(++_0x1aa970);}(_0x548b,0x130));var _0xb548=function(_0x17a366,_0x5cc23b){_0x17a366=_0x17a366-0x0;var _0x33a325=_0x548b[_0x17a366];return _0x33a325;};'use strict';var multer=require(_0xb548('0x0'));var util=require(_0xb548('0x1'));var path=require(_0xb548('0x2'));var timeout=require(_0xb548('0x3'));var express=require(_0xb548('0x4'));var router=express['Router']();var fs_extra=require(_0xb548('0x5'));var auth=require(_0xb548('0x6'));var interaction=require(_0xb548('0x7'));var config=require(_0xb548('0x8'));var controller=require(_0xb548('0x9'));router[_0xb548('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb548('0xa')]('/:id',auth[_0xb548('0xb')](),controller['show']);router['post']('/',auth[_0xb548('0xb')](),controller[_0xb548('0xc')]);router[_0xb548('0xd')]('/:id',auth[_0xb548('0xb')](),controller[_0xb548('0xe')]);router[_0xb548('0xf')](_0xb548('0x10'),auth[_0xb548('0xb')](),controller[_0xb548('0x11')]);module[_0xb548('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 060c1eb..c0f84c9 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 _0x6d65=['STRING','name','BOOLEAN','exports'];(function(_0x5216b9,_0x115733){var _0x565112=function(_0x2bc025){while(--_0x2bc025){_0x5216b9['push'](_0x5216b9['shift']());}};_0x565112(++_0x115733);}(_0x6d65,0x9f));var _0x56d6=function(_0x47ba45,_0x5e325a){_0x47ba45=_0x47ba45-0x0;var _0x352b97=_0x6d65[_0x47ba45];return _0x352b97;};'use strict';var Sequelize=require('sequelize');module[_0x56d6('0x0')]={'name':{'type':Sequelize[_0x56d6('0x1')],'unique':_0x56d6('0x2')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x56d6('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf874=['BOOLEAN','sequelize','exports','STRING'];(function(_0x2e3b0b,_0x4bfc88){var _0xac080d=function(_0x15cd27){while(--_0x15cd27){_0x2e3b0b['push'](_0x2e3b0b['shift']());}};_0xac080d(++_0x4bfc88);}(_0xf874,0x121));var _0x4f87=function(_0x23a583,_0x1f3c36){_0x23a583=_0x23a583-0x0;var _0x416ca1=_0xf874[_0x23a583];return _0x416ca1;};'use strict';var Sequelize=require(_0x4f87('0x0'));module[_0x4f87('0x1')]={'name':{'type':Sequelize[_0x4f87('0x2')],'unique':'name'},'description':{'type':Sequelize[_0x4f87('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x4f87('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index ac208be..a3b8644 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 _0x8c8b=['UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','writeFileSync','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','jayson/promise','client','http','then','VoiceContext,\x20%s,\x20%s','request\x20sent','error','code','message','info','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','Contexts','destroy','stack','name','send','index','map','VoiceContext','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','rows','show','params','find','create','body','findAll','root','server/files/templates/context.ejs','utf8','render','Reload','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x8c8b,0x134));var _0xb8c8=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8c8b[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xb8c8('0x0'));var rimraf=require(_0xb8c8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb8c8('0x2'));var rp=require(_0xb8c8('0x3'));var moment=require('moment');var BPromise=require(_0xb8c8('0x4'));var Mustache=require(_0xb8c8('0x5'));var util=require(_0xb8c8('0x6'));var path=require('path');var sox=require(_0xb8c8('0x7'));var csv=require(_0xb8c8('0x8'));var ejs=require(_0xb8c8('0x9'));var fs=require('fs');var fs_extra=require(_0xb8c8('0xa'));var _=require(_0xb8c8('0xb'));var squel=require(_0xb8c8('0xc'));var crypto=require('crypto');var jsforce=require(_0xb8c8('0xd'));var deskjs=require(_0xb8c8('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb8c8('0xf'));var Papa=require('papaparse');var Redis=require(_0xb8c8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb8c8('0x11'));var as=require(_0xb8c8('0x12'));var hardwareService=require(_0xb8c8('0x13'));var logger=require('../../config/logger')(_0xb8c8('0x14'));var utils=require('../../config/utils');var config=require(_0xb8c8('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xb8c8('0x16'))['db'];var jayson=require(_0xb8c8('0x17'));var client=jayson[_0xb8c8('0x18')][_0xb8c8('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x311882,_0x167719,_0xba41d0,_0x899242){return new BPromise(function(_0x9534e0,_0x5071b8){var _0x3f8095=_0x899242||client;return _0x3f8095['request'](_0x311882,_0xba41d0)[_0xb8c8('0x1a')](function(_0x27af55){logger['info'](_0xb8c8('0x1b'),_0x167719,_0xb8c8('0x1c'));logger['debug']('VoiceContext,\x20%s,\x20%s,\x20%s',_0x167719,_0xb8c8('0x1c'),JSON['stringify'](_0x27af55));if(_0x27af55[_0xb8c8('0x1d')]){if(_0x27af55['error'][_0xb8c8('0x1e')]===0x1f4){logger['error'](_0xb8c8('0x1b'),_0x167719,_0x27af55[_0xb8c8('0x1d')][_0xb8c8('0x1f')]);return _0x5071b8(_0x27af55[_0xb8c8('0x1d')][_0xb8c8('0x1f')]);}logger['error'](_0xb8c8('0x1b'),_0x167719,_0x27af55[_0xb8c8('0x1d')][_0xb8c8('0x1f')]);return _0x9534e0(_0x27af55[_0xb8c8('0x1d')][_0xb8c8('0x1f')]);}else{logger[_0xb8c8('0x20')]('VoiceContext,\x20%s,\x20%s',_0x167719,_0xb8c8('0x1c'));_0x9534e0(_0x27af55['result']['message']);}})[_0xb8c8('0x21')](function(_0x48b3f2){logger[_0xb8c8('0x1d')](_0xb8c8('0x1b'),_0x167719,_0x48b3f2);_0x5071b8(_0x48b3f2);});});}function respondWithStatusCode(_0x266351,_0x26f1e3){_0x26f1e3=_0x26f1e3||0xcc;return function(_0x2c3e9a){if(_0x2c3e9a){return _0x266351[_0xb8c8('0x22')](_0x26f1e3);}return _0x266351[_0xb8c8('0x23')](_0x26f1e3)[_0xb8c8('0x24')]();};}function respondWithResult(_0x4a597c,_0x42f105){_0x42f105=_0x42f105||0xc8;return function(_0x39d428){if(_0x39d428){return _0x4a597c[_0xb8c8('0x23')](_0x42f105)[_0xb8c8('0x25')](_0x39d428);}};}function respondWithFilteredResult(_0x1fd20a,_0x526640){return function(_0x4b3c31){if(_0x4b3c31){var _0x2b559b=typeof _0x526640[_0xb8c8('0x26')]===_0xb8c8('0x27')&&typeof _0x526640['limit']===_0xb8c8('0x27');var _0x5b556a=_0x4b3c31['count'];var _0x249cef=_0x2b559b?0x0:_0x526640['offset'];var _0x482a97=_0x2b559b?_0x4b3c31[_0xb8c8('0x28')]:_0x526640['offset']+_0x526640[_0xb8c8('0x29')];var _0x2896b6;if(_0x482a97>=_0x5b556a){_0x482a97=_0x5b556a;_0x2896b6=0xc8;}else{_0x2896b6=0xce;}_0x1fd20a[_0xb8c8('0x23')](_0x2896b6);return _0x1fd20a[_0xb8c8('0x2a')](_0xb8c8('0x2b'),_0x249cef+'-'+_0x482a97+'/'+_0x5b556a)['json'](_0x4b3c31);}return null;};}function patchUpdates(_0x529f83){return function(_0x371cce){try{jsonpatch[_0xb8c8('0x2c')](_0x371cce,_0x529f83,!![]);}catch(_0x388143){return BPromise['reject'](_0x388143);}return _0x371cce[_0xb8c8('0x2d')]();};}function saveUpdates(_0x53a9fd,_0x4409b7){return function(_0x59b476){if(_0x59b476){return _0x59b476[_0xb8c8('0x2e')](_0x53a9fd)[_0xb8c8('0x1a')](function(_0x2dc245){return _0x2dc245;});}return null;};}function removeEntity(_0xb71890,_0x4b72f6){return function(_0x155530){if(_0x155530){return _0x155530['destroy']()['then'](function(){var _0x4d87ab=_0x155530['get']({'plain':!![]});var _0x1873ba=_0xb8c8('0x2f');return db['UserProfileResource'][_0xb8c8('0x30')]({'where':{'type':_0x1873ba,'resourceId':_0x4d87ab['id']}})['then'](function(){return _0x155530;});})[_0xb8c8('0x1a')](function(){_0xb71890[_0xb8c8('0x23')](0xcc)[_0xb8c8('0x24')]();});}};}function handleEntityNotFound(_0x2b87cb,_0x59231d){return function(_0x3e0891){if(!_0x3e0891){_0x2b87cb['sendStatus'](0x194);}return _0x3e0891;};}function handleError(_0x29aeb0,_0x2c7c4a){_0x2c7c4a=_0x2c7c4a||0x1f4;return function(_0x1d1668){logger['error'](_0x1d1668[_0xb8c8('0x31')]);if(_0x1d1668[_0xb8c8('0x32')]){delete _0x1d1668[_0xb8c8('0x32')];}_0x29aeb0[_0xb8c8('0x23')](_0x2c7c4a)[_0xb8c8('0x33')](_0x1d1668);};}exports[_0xb8c8('0x34')]=function(_0x329398,_0x5c7d31){var _0x5a89a9={},_0x2da0d4={},_0xbe079={'count':0x0,'rows':[]};var _0x1d99c3=_[_0xb8c8('0x35')](db[_0xb8c8('0x36')][_0xb8c8('0x37')],function(_0x257e98){return{'name':_0x257e98[_0xb8c8('0x38')],'type':_0x257e98[_0xb8c8('0x39')][_0xb8c8('0x3a')]};});_0x2da0d4['model']=_[_0xb8c8('0x35')](_0x1d99c3,_0xb8c8('0x32'));_0x2da0d4[_0xb8c8('0x3b')]=_[_0xb8c8('0x3c')](_0x329398[_0xb8c8('0x3b')]);_0x2da0d4[_0xb8c8('0x3d')]=_['intersection'](_0x2da0d4['model'],_0x2da0d4[_0xb8c8('0x3b')]);_0x5a89a9['attributes']=_[_0xb8c8('0x3e')](_0x2da0d4[_0xb8c8('0x3f')],qs[_0xb8c8('0x40')](_0x329398[_0xb8c8('0x3b')][_0xb8c8('0x40')]));_0x5a89a9[_0xb8c8('0x41')]=_0x5a89a9[_0xb8c8('0x41')][_0xb8c8('0x42')]?_0x5a89a9[_0xb8c8('0x41')]:_0x2da0d4[_0xb8c8('0x3f')];if(!_0x329398[_0xb8c8('0x3b')]['hasOwnProperty'](_0xb8c8('0x43'))){_0x5a89a9[_0xb8c8('0x29')]=qs[_0xb8c8('0x29')](_0x329398['query'][_0xb8c8('0x29')]);_0x5a89a9[_0xb8c8('0x26')]=qs[_0xb8c8('0x26')](_0x329398[_0xb8c8('0x3b')]['offset']);}_0x5a89a9[_0xb8c8('0x44')]=qs['sort'](_0x329398[_0xb8c8('0x3b')][_0xb8c8('0x45')]);_0x5a89a9[_0xb8c8('0x46')]=qs[_0xb8c8('0x3d')](_[_0xb8c8('0x47')](_0x329398[_0xb8c8('0x3b')],_0x2da0d4[_0xb8c8('0x3d')]),_0x1d99c3);if(_0x329398[_0xb8c8('0x3b')][_0xb8c8('0x48')]){_0x5a89a9['where']=_[_0xb8c8('0x49')](_0x5a89a9[_0xb8c8('0x46')],{'$or':_['map'](_0x1d99c3,function(_0x17124f){if(_0x17124f[_0xb8c8('0x39')]!=='VIRTUAL'){var _0x526ae8={};_0x526ae8[_0x17124f[_0xb8c8('0x32')]]={'$like':'%'+_0x329398[_0xb8c8('0x3b')][_0xb8c8('0x48')]+'%'};return _0x526ae8;}})});}_0x5a89a9=_['merge']({},_0x5a89a9,_0x329398[_0xb8c8('0x4a')]);var _0x286252={'where':_0x5a89a9[_0xb8c8('0x46')]};return db['VoiceContext']['count'](_0x286252)[_0xb8c8('0x1a')](function(_0x50e3a5){_0xbe079[_0xb8c8('0x28')]=_0x50e3a5;if(_0x329398[_0xb8c8('0x3b')][_0xb8c8('0x4b')]){_0x5a89a9['include']=[{'all':!![]}];}return db[_0xb8c8('0x36')]['findAll'](_0x5a89a9);})[_0xb8c8('0x1a')](function(_0x4afbc1){_0xbe079[_0xb8c8('0x4c')]=_0x4afbc1;return _0xbe079;})['then'](respondWithFilteredResult(_0x5c7d31,_0x5a89a9))['catch'](handleError(_0x5c7d31,null));};exports[_0xb8c8('0x4d')]=function(_0x2a9324,_0x4b88f0){var _0x460159={'raw':![],'where':{'id':_0x2a9324[_0xb8c8('0x4e')]['id']}},_0x19a732={};_0x19a732[_0xb8c8('0x3f')]=_[_0xb8c8('0x3c')](db['VoiceContext'][_0xb8c8('0x37')]);_0x19a732[_0xb8c8('0x3b')]=_[_0xb8c8('0x3c')](_0x2a9324['query']);_0x19a732[_0xb8c8('0x3d')]=_[_0xb8c8('0x3e')](_0x19a732[_0xb8c8('0x3f')],_0x19a732['query']);_0x460159['attributes']=_[_0xb8c8('0x3e')](_0x19a732[_0xb8c8('0x3f')],qs['fields'](_0x2a9324[_0xb8c8('0x3b')]['fields']));_0x460159[_0xb8c8('0x41')]=_0x460159['attributes']['length']?_0x460159['attributes']:_0x19a732[_0xb8c8('0x3f')];if(_0x2a9324[_0xb8c8('0x3b')][_0xb8c8('0x4b')]){_0x460159['include']=[{'all':!![]}];}_0x460159=_[_0xb8c8('0x49')]({},_0x460159,_0x2a9324[_0xb8c8('0x4a')]);return db[_0xb8c8('0x36')][_0xb8c8('0x4f')](_0x460159)['then'](handleEntityNotFound(_0x4b88f0,null))['then'](respondWithResult(_0x4b88f0,null))[_0xb8c8('0x21')](handleError(_0x4b88f0,null));};exports[_0xb8c8('0x50')]=function(_0x561724,_0x5be016,_0x74dece){var _0x31b657;return db[_0xb8c8('0x36')][_0xb8c8('0x50')](_0x561724[_0xb8c8('0x51')],{'raw':!![]})[_0xb8c8('0x1a')](function(_0x634a94){_0x31b657=_0x634a94;return db['VoiceContext'][_0xb8c8('0x52')]({'raw':!![]});})['then'](function(_0xb0a530){var _0x1aed9d=fs['readFileSync'](path['join'](config[_0xb8c8('0x53')],_0xb8c8('0x54')),_0xb8c8('0x55'));var _0x3ac32c=ejs[_0xb8c8('0x56')](_0x1aed9d,{'contexts':_0xb0a530||[]});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x3ac32c);})[_0xb8c8('0x1a')](function(){return respondWithRpcPromise(_0xb8c8('0x57'),_0xb8c8('0x50'),{'module':'chan_sip.so'});})[_0xb8c8('0x1a')](function(){var _0x1b3731=_0x561724[_0xb8c8('0x58')][_0xb8c8('0x59')]({'plain':!![]});if(!_0x1b3731)throw new Error(_0xb8c8('0x5a'));if(_0x1b3731[_0xb8c8('0x5b')]==='user'){var _0x3e6c40=_0x31b657['get']({'plain':!![]});return db[_0xb8c8('0x5c')]['find']({'where':{'name':_0xb8c8('0x2f'),'userProfileId':_0x1b3731['userProfileId']},'raw':!![]})[_0xb8c8('0x1a')](function(_0x116d48){if(_0x116d48&&_0x116d48[_0xb8c8('0x5d')]===0x0){return db['UserProfileResource'][_0xb8c8('0x50')]({'name':_0x3e6c40[_0xb8c8('0x32')],'resourceId':_0x3e6c40['id'],'type':_0x116d48[_0xb8c8('0x32')],'sectionId':_0x116d48['id']},{})[_0xb8c8('0x1a')](function(){return _0x31b657;});}else{return _0x31b657;}})[_0xb8c8('0x21')](function(_0x3c6b1c){logger['error'](_0xb8c8('0x5e'),_0x3c6b1c);throw _0x3c6b1c;});}return _0x31b657;})['then'](respondWithResult(_0x5be016,0xc9))[_0xb8c8('0x21')](handleError(_0x5be016,null));};exports[_0xb8c8('0x2e')]=function(_0x34895e,_0x489039,_0x5bcfa4){var _0x373bfd;return db['VoiceContext'][_0xb8c8('0x4f')]({'where':{'id':_0x34895e[_0xb8c8('0x4e')]['id']}})[_0xb8c8('0x1a')](handleEntityNotFound(_0x489039,null))['then'](saveUpdates(_0x34895e[_0xb8c8('0x51')],null))[_0xb8c8('0x1a')](function(_0x37e612){if(_0x37e612){_0x373bfd=_0x37e612;return db[_0xb8c8('0x36')]['findAll']({'raw':!![]});}})[_0xb8c8('0x1a')](function(_0x330b43){var _0x2aafaa=fs[_0xb8c8('0x5f')](path[_0xb8c8('0x60')](config['root'],_0xb8c8('0x54')),'utf8');var _0x290498=ejs[_0xb8c8('0x56')](_0x2aafaa,{'contexts':_0x330b43||[]});fs['writeFileSync'](_0xb8c8('0x61'),_0x290498);})[_0xb8c8('0x1a')](function(){return respondWithRpcPromise(_0xb8c8('0x57'),'update',{'module':_0xb8c8('0x62')});})[_0xb8c8('0x1a')](function(){return _0x373bfd;})[_0xb8c8('0x1a')](respondWithResult(_0x489039,null))[_0xb8c8('0x21')](handleError(_0x489039,null));};exports['destroy']=function(_0x44819d,_0x2836ac,_0x421df9){var _0x416ac1;return db[_0xb8c8('0x36')][_0xb8c8('0x4f')]({'where':{'id':_0x44819d[_0xb8c8('0x4e')]['id']}})[_0xb8c8('0x1a')](handleEntityNotFound(_0x2836ac,null))[_0xb8c8('0x1a')](removeEntity(_0x2836ac,null))[_0xb8c8('0x1a')](function(){return db[_0xb8c8('0x36')][_0xb8c8('0x52')]({'raw':!![]});})[_0xb8c8('0x1a')](function(_0x2a7d5e){var _0x3d352c=fs[_0xb8c8('0x5f')](path['join'](config[_0xb8c8('0x53')],_0xb8c8('0x54')),_0xb8c8('0x55'));var _0x18d639=ejs['render'](_0x3d352c,{'contexts':_0x2a7d5e});fs[_0xb8c8('0x63')](_0xb8c8('0x61'),_0x18d639);return respondWithRpcPromise(_0xb8c8('0x57'),_0xb8c8('0x30'),{'module':_0xb8c8('0x62')});})[_0xb8c8('0x21')](handleError(_0x2836ac,null));}; \ No newline at end of file +var _0xc828=['fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','params','length','options','find','create','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','chan_sip.so','user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','zip-dir','moment','mustache','util','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../config/license/util','jayson/promise','client','request','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','get','Contexts','UserProfileResource','then','name','send','index','VoiceContext','rawAttributes'];(function(_0x50cca1,_0xa36c31){var _0x443362=function(_0x16793e){while(--_0x16793e){_0x50cca1['push'](_0x50cca1['shift']());}};_0x443362(++_0xa36c31);}(_0xc828,0x8a));var _0x8c82=function(_0x493a8c,_0x16385c){_0x493a8c=_0x493a8c-0x0;var _0x4e0b14=_0xc828[_0x493a8c];return _0x4e0b14;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8c82('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8c82('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x8c82('0x2'));var util=require(_0x8c82('0x3'));var path=require('path');var sox=require(_0x8c82('0x4'));var csv=require(_0x8c82('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8c82('0x6'));var _=require(_0x8c82('0x7'));var squel=require('squel');var crypto=require(_0x8c82('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x8c82('0x9'));var toCsv=require(_0x8c82('0x5'));var querystring=require(_0x8c82('0xa'));var Papa=require(_0x8c82('0xb'));var Redis=require(_0x8c82('0xc'));var authService=require(_0x8c82('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8c82('0xe'))(_0x8c82('0xf'));var utils=require('../../config/utils');var config=require(_0x8c82('0x10'));var licenseUtil=require(_0x8c82('0x11'));var db=require('../../mysqldb')['db'];var jayson=require(_0x8c82('0x12'));var client=jayson[_0x8c82('0x13')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16ca67,_0x7a8a60,_0x345e0e,_0x1f9aa6){return new BPromise(function(_0x5e8c3b,_0x256265){var _0x191282=_0x1f9aa6||client;return _0x191282[_0x8c82('0x14')](_0x16ca67,_0x345e0e)['then'](function(_0x34565a){logger['info'](_0x8c82('0x15'),_0x7a8a60,_0x8c82('0x16'));logger[_0x8c82('0x17')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x7a8a60,_0x8c82('0x16'),JSON['stringify'](_0x34565a));if(_0x34565a['error']){if(_0x34565a[_0x8c82('0x18')][_0x8c82('0x19')]===0x1f4){logger[_0x8c82('0x18')](_0x8c82('0x15'),_0x7a8a60,_0x34565a[_0x8c82('0x18')][_0x8c82('0x1a')]);return _0x256265(_0x34565a['error'][_0x8c82('0x1a')]);}logger[_0x8c82('0x18')](_0x8c82('0x15'),_0x7a8a60,_0x34565a[_0x8c82('0x18')][_0x8c82('0x1a')]);return _0x5e8c3b(_0x34565a[_0x8c82('0x18')]['message']);}else{logger[_0x8c82('0x1b')]('VoiceContext,\x20%s,\x20%s',_0x7a8a60,_0x8c82('0x16'));_0x5e8c3b(_0x34565a['result'][_0x8c82('0x1a')]);}})[_0x8c82('0x1c')](function(_0x2e8de9){logger[_0x8c82('0x18')](_0x8c82('0x15'),_0x7a8a60,_0x2e8de9);_0x256265(_0x2e8de9);});});}function respondWithStatusCode(_0x3ae77c,_0x561387){_0x561387=_0x561387||0xcc;return function(_0x27cb86){if(_0x27cb86){return _0x3ae77c[_0x8c82('0x1d')](_0x561387);}return _0x3ae77c['status'](_0x561387)[_0x8c82('0x1e')]();};}function respondWithResult(_0x23edd1,_0x5c2d5e){_0x5c2d5e=_0x5c2d5e||0xc8;return function(_0x476ffb){if(_0x476ffb){return _0x23edd1[_0x8c82('0x1f')](_0x5c2d5e)[_0x8c82('0x20')](_0x476ffb);}};}function respondWithFilteredResult(_0x43441a,_0x32a2b6){return function(_0x238141){if(_0x238141){var _0x4ab172=typeof _0x32a2b6[_0x8c82('0x21')]===_0x8c82('0x22')&&typeof _0x32a2b6[_0x8c82('0x23')]===_0x8c82('0x22');var _0x29d599=_0x238141['count'];var _0x214806=_0x4ab172?0x0:_0x32a2b6[_0x8c82('0x21')];var _0x5196f6=_0x4ab172?_0x238141[_0x8c82('0x24')]:_0x32a2b6[_0x8c82('0x21')]+_0x32a2b6[_0x8c82('0x23')];var _0x81578f;if(_0x5196f6>=_0x29d599){_0x5196f6=_0x29d599;_0x81578f=0xc8;}else{_0x81578f=0xce;}_0x43441a[_0x8c82('0x1f')](_0x81578f);return _0x43441a[_0x8c82('0x25')](_0x8c82('0x26'),_0x214806+'-'+_0x5196f6+'/'+_0x29d599)['json'](_0x238141);}return null;};}function patchUpdates(_0x56a611){return function(_0x2da257){try{jsonpatch[_0x8c82('0x27')](_0x2da257,_0x56a611,!![]);}catch(_0x25c9f0){return BPromise[_0x8c82('0x28')](_0x25c9f0);}return _0x2da257[_0x8c82('0x29')]();};}function saveUpdates(_0x217870,_0x2ddb5e){return function(_0x5c77c4){if(_0x5c77c4){return _0x5c77c4['update'](_0x217870)['then'](function(_0x51499f){return _0x51499f;});}return null;};}function removeEntity(_0x4fbf00,_0xb31988){return function(_0x3e4ee8){if(_0x3e4ee8){return _0x3e4ee8[_0x8c82('0x2a')]()['then'](function(){var _0x3145d3=_0x3e4ee8[_0x8c82('0x2b')]({'plain':!![]});var _0x3bd734=_0x8c82('0x2c');return db[_0x8c82('0x2d')][_0x8c82('0x2a')]({'where':{'type':_0x3bd734,'resourceId':_0x3145d3['id']}})[_0x8c82('0x2e')](function(){return _0x3e4ee8;});})[_0x8c82('0x2e')](function(){_0x4fbf00[_0x8c82('0x1f')](0xcc)[_0x8c82('0x1e')]();});}};}function handleEntityNotFound(_0x1b7f66,_0x5d7807){return function(_0x420fff){if(!_0x420fff){_0x1b7f66[_0x8c82('0x1d')](0x194);}return _0x420fff;};}function handleError(_0x5b1186,_0x9c8581){_0x9c8581=_0x9c8581||0x1f4;return function(_0x36842e){logger['error'](_0x36842e['stack']);if(_0x36842e[_0x8c82('0x2f')]){delete _0x36842e['name'];}_0x5b1186[_0x8c82('0x1f')](_0x9c8581)[_0x8c82('0x30')](_0x36842e);};}exports[_0x8c82('0x31')]=function(_0x510588,_0x2c8f0f){var _0x14a29f={},_0x16fc24={},_0x381818={'count':0x0,'rows':[]};var _0x375a9d=_['map'](db[_0x8c82('0x32')][_0x8c82('0x33')],function(_0xd1f710){return{'name':_0xd1f710[_0x8c82('0x34')],'type':_0xd1f710[_0x8c82('0x35')][_0x8c82('0x36')]};});_0x16fc24[_0x8c82('0x37')]=_[_0x8c82('0x38')](_0x375a9d,'name');_0x16fc24[_0x8c82('0x39')]=_[_0x8c82('0x3a')](_0x510588['query']);_0x16fc24[_0x8c82('0x3b')]=_['intersection'](_0x16fc24[_0x8c82('0x37')],_0x16fc24['query']);_0x14a29f[_0x8c82('0x3c')]=_[_0x8c82('0x3d')](_0x16fc24[_0x8c82('0x37')],qs[_0x8c82('0x3e')](_0x510588['query'][_0x8c82('0x3e')]));_0x14a29f['attributes']=_0x14a29f[_0x8c82('0x3c')]['length']?_0x14a29f[_0x8c82('0x3c')]:_0x16fc24[_0x8c82('0x37')];if(!_0x510588['query'][_0x8c82('0x3f')](_0x8c82('0x40'))){_0x14a29f[_0x8c82('0x23')]=qs['limit'](_0x510588[_0x8c82('0x39')][_0x8c82('0x23')]);_0x14a29f[_0x8c82('0x21')]=qs[_0x8c82('0x21')](_0x510588[_0x8c82('0x39')]['offset']);}_0x14a29f['order']=qs[_0x8c82('0x41')](_0x510588[_0x8c82('0x39')]['sort']);_0x14a29f[_0x8c82('0x42')]=qs[_0x8c82('0x3b')](_['pick'](_0x510588['query'],_0x16fc24['filters']),_0x375a9d);if(_0x510588['query'][_0x8c82('0x43')]){_0x14a29f[_0x8c82('0x42')]=_[_0x8c82('0x44')](_0x14a29f[_0x8c82('0x42')],{'$or':_['map'](_0x375a9d,function(_0x2cbc5a){if(_0x2cbc5a[_0x8c82('0x35')]!==_0x8c82('0x45')){var _0x47aa02={};_0x47aa02[_0x2cbc5a[_0x8c82('0x2f')]]={'$like':'%'+_0x510588[_0x8c82('0x39')][_0x8c82('0x43')]+'%'};return _0x47aa02;}})});}_0x14a29f=_[_0x8c82('0x44')]({},_0x14a29f,_0x510588['options']);var _0x30ae2b={'where':_0x14a29f['where']};return db[_0x8c82('0x32')][_0x8c82('0x24')](_0x30ae2b)[_0x8c82('0x2e')](function(_0x4c673e){_0x381818[_0x8c82('0x24')]=_0x4c673e;if(_0x510588['query'][_0x8c82('0x46')]){_0x14a29f[_0x8c82('0x47')]=[{'all':!![]}];}return db[_0x8c82('0x32')][_0x8c82('0x48')](_0x14a29f);})[_0x8c82('0x2e')](function(_0x3d9e89){_0x381818[_0x8c82('0x49')]=_0x3d9e89;return _0x381818;})[_0x8c82('0x2e')](respondWithFilteredResult(_0x2c8f0f,_0x14a29f))[_0x8c82('0x1c')](handleError(_0x2c8f0f,null));};exports['show']=function(_0x463796,_0x348c70){var _0x583dde={'raw':![],'where':{'id':_0x463796[_0x8c82('0x4a')]['id']}},_0x5bdad2={};_0x5bdad2['model']=_[_0x8c82('0x3a')](db[_0x8c82('0x32')][_0x8c82('0x33')]);_0x5bdad2[_0x8c82('0x39')]=_['keys'](_0x463796[_0x8c82('0x39')]);_0x5bdad2[_0x8c82('0x3b')]=_[_0x8c82('0x3d')](_0x5bdad2[_0x8c82('0x37')],_0x5bdad2[_0x8c82('0x39')]);_0x583dde[_0x8c82('0x3c')]=_[_0x8c82('0x3d')](_0x5bdad2['model'],qs[_0x8c82('0x3e')](_0x463796[_0x8c82('0x39')][_0x8c82('0x3e')]));_0x583dde[_0x8c82('0x3c')]=_0x583dde[_0x8c82('0x3c')][_0x8c82('0x4b')]?_0x583dde['attributes']:_0x5bdad2[_0x8c82('0x37')];if(_0x463796[_0x8c82('0x39')][_0x8c82('0x46')]){_0x583dde[_0x8c82('0x47')]=[{'all':!![]}];}_0x583dde=_[_0x8c82('0x44')]({},_0x583dde,_0x463796[_0x8c82('0x4c')]);return db[_0x8c82('0x32')][_0x8c82('0x4d')](_0x583dde)[_0x8c82('0x2e')](handleEntityNotFound(_0x348c70,null))[_0x8c82('0x2e')](respondWithResult(_0x348c70,null))[_0x8c82('0x1c')](handleError(_0x348c70,null));};exports[_0x8c82('0x4e')]=function(_0x4b94ee,_0xac57f5,_0x31be6a){var _0x3b4fde;return db['VoiceContext'][_0x8c82('0x4e')](_0x4b94ee['body'],{'raw':!![]})[_0x8c82('0x2e')](function(_0x57b2bd){_0x3b4fde=_0x57b2bd;return db[_0x8c82('0x32')]['findAll']({'raw':!![]});})[_0x8c82('0x2e')](function(_0x868e41){var _0x19e040=fs[_0x8c82('0x4f')](path[_0x8c82('0x50')](config[_0x8c82('0x51')],_0x8c82('0x52')),_0x8c82('0x53'));var _0x515995=ejs[_0x8c82('0x54')](_0x19e040,{'contexts':_0x868e41||[]});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x515995);})[_0x8c82('0x2e')](function(){return respondWithRpcPromise('Reload','create',{'module':_0x8c82('0x55')});})[_0x8c82('0x2e')](function(){var _0xba849a=_0x4b94ee[_0x8c82('0x56')][_0x8c82('0x2b')]({'plain':!![]});if(!_0xba849a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xba849a[_0x8c82('0x57')]===_0x8c82('0x56')){var _0x26b28b=_0x3b4fde[_0x8c82('0x2b')]({'plain':!![]});return db['UserProfileSection'][_0x8c82('0x4d')]({'where':{'name':_0x8c82('0x2c'),'userProfileId':_0xba849a[_0x8c82('0x58')]},'raw':!![]})[_0x8c82('0x2e')](function(_0x5d0581){if(_0x5d0581&&_0x5d0581['autoAssociation']===0x0){return db[_0x8c82('0x2d')][_0x8c82('0x4e')]({'name':_0x26b28b['name'],'resourceId':_0x26b28b['id'],'type':_0x5d0581['name'],'sectionId':_0x5d0581['id']},{})[_0x8c82('0x2e')](function(){return _0x3b4fde;});}else{return _0x3b4fde;}})[_0x8c82('0x1c')](function(_0x58e958){logger['error'](_0x8c82('0x59'),_0x58e958);throw _0x58e958;});}return _0x3b4fde;})[_0x8c82('0x2e')](respondWithResult(_0xac57f5,0xc9))[_0x8c82('0x1c')](handleError(_0xac57f5,null));};exports[_0x8c82('0x5a')]=function(_0x385912,_0x3ece61,_0x40ea2a){var _0x67ef;return db[_0x8c82('0x32')][_0x8c82('0x4d')]({'where':{'id':_0x385912[_0x8c82('0x4a')]['id']}})[_0x8c82('0x2e')](handleEntityNotFound(_0x3ece61,null))[_0x8c82('0x2e')](saveUpdates(_0x385912[_0x8c82('0x5b')],null))[_0x8c82('0x2e')](function(_0x1d956e){if(_0x1d956e){_0x67ef=_0x1d956e;return db[_0x8c82('0x32')][_0x8c82('0x48')]({'raw':!![]});}})['then'](function(_0x3884b1){var _0x5455f7=fs[_0x8c82('0x4f')](path[_0x8c82('0x50')](config[_0x8c82('0x51')],_0x8c82('0x52')),'utf8');var _0x180488=ejs[_0x8c82('0x54')](_0x5455f7,{'contexts':_0x3884b1||[]});fs[_0x8c82('0x5c')](_0x8c82('0x5d'),_0x180488);})['then'](function(){return respondWithRpcPromise(_0x8c82('0x5e'),_0x8c82('0x5a'),{'module':_0x8c82('0x55')});})[_0x8c82('0x2e')](function(){return _0x67ef;})[_0x8c82('0x2e')](respondWithResult(_0x3ece61,null))[_0x8c82('0x1c')](handleError(_0x3ece61,null));};exports[_0x8c82('0x2a')]=function(_0x30f9df,_0x2505c7,_0x4a5a27){var _0x2a5e14;return db['VoiceContext'][_0x8c82('0x4d')]({'where':{'id':_0x30f9df[_0x8c82('0x4a')]['id']}})[_0x8c82('0x2e')](handleEntityNotFound(_0x2505c7,null))[_0x8c82('0x2e')](removeEntity(_0x2505c7,null))['then'](function(){return db[_0x8c82('0x32')][_0x8c82('0x48')]({'raw':!![]});})[_0x8c82('0x2e')](function(_0x5d30cb){var _0x38fbf5=fs['readFileSync'](path[_0x8c82('0x50')](config[_0x8c82('0x51')],_0x8c82('0x52')),_0x8c82('0x53'));var _0x3481e3=ejs['render'](_0x38fbf5,{'contexts':_0x5d30cb});fs[_0x8c82('0x5c')](_0x8c82('0x5d'),_0x3481e3);return respondWithRpcPromise(_0x8c82('0x5e'),_0x8c82('0x2a'),{'module':_0x8c82('0x55')});})[_0x8c82('0x1c')](handleError(_0x2505c7,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 46be56d..5a2deba 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 _0xdea1=['request-promise','path','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','lodash','../../config/logger','api','moment','bluebird'];(function(_0x5e16ba,_0x362b40){var _0x392b96=function(_0x58c61f){while(--_0x58c61f){_0x5e16ba['push'](_0x5e16ba['shift']());}};_0x392b96(++_0x362b40);}(_0xdea1,0xdf));var _0x1dea=function(_0x2ae4a0,_0x310e91){_0x2ae4a0=_0x2ae4a0-0x0;var _0x5a9f6b=_0xdea1[_0x2ae4a0];return _0x5a9f6b;};'use strict';var _=require(_0x1dea('0x0'));var util=require('util');var logger=require(_0x1dea('0x1'))(_0x1dea('0x2'));var moment=require(_0x1dea('0x3'));var BPromise=require(_0x1dea('0x4'));var rp=require(_0x1dea('0x5'));var fs=require('fs');var path=require(_0x1dea('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1dea('0x7'));module[_0x1dea('0x8')]=function(_0x29ef7f,_0x2fae5f){return _0x29ef7f[_0x1dea('0x9')](_0x1dea('0xa'),attributes,{'tableName':_0x1dea('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd058=['exports','VoiceContext','voice_contexts','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceContext.attributes'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0xd058,0xe7));var _0x8d05=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xd058[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require('lodash');var util=require(_0x8d05('0x0'));var logger=require(_0x8d05('0x1'))(_0x8d05('0x2'));var moment=require(_0x8d05('0x3'));var BPromise=require(_0x8d05('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8d05('0x5'));var rimraf=require(_0x8d05('0x6'));var config=require(_0x8d05('0x7'));var attributes=require(_0x8d05('0x8'));module[_0x8d05('0x9')]=function(_0x5bf637,_0x1913aa){return _0x5bf637['define'](_0x8d05('0xa'),attributes,{'tableName':_0x8d05('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 045e2fd..c2d9f97 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 _0x5761=['util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x31c5fd,_0x33131f){var _0x3799ab=function(_0x1538bf){while(--_0x1538bf){_0x31c5fd['push'](_0x31c5fd['shift']());}};_0x3799ab(++_0x33131f);}(_0x5761,0x107));var _0x1576=function(_0x3c840c,_0x5ac2d0){_0x3c840c=_0x3c840c-0x0;var _0x30b880=_0x5761[_0x3c840c];return _0x30b880;};'use strict';var _=require(_0x1576('0x0'));var util=require(_0x1576('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1576('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1576('0x3'))['db'];var utils=require(_0x1576('0x4'));var logger=require(_0x1576('0x5'))(_0x1576('0x6'));var config=require(_0x1576('0x7'));var jayson=require(_0x1576('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x30f503,_0x21d3bd,_0x229cee){return new BPromise(function(_0x1f814b,_0x5ab69b){return client[_0x1576('0x9')](_0x30f503,_0x229cee)[_0x1576('0xa')](function(_0x561917){logger[_0x1576('0xb')]('VoiceContext,\x20%s,\x20%s',_0x21d3bd,'request\x20sent');logger[_0x1576('0xc')](_0x1576('0xd'),_0x21d3bd,_0x1576('0xe'),JSON[_0x1576('0xf')](_0x561917));if(_0x561917[_0x1576('0x10')]){if(_0x561917['error'][_0x1576('0x11')]===0x1f4){logger['error'](_0x1576('0x12'),_0x21d3bd,_0x561917[_0x1576('0x10')][_0x1576('0x13')]);return _0x5ab69b(_0x561917[_0x1576('0x10')][_0x1576('0x13')]);}logger[_0x1576('0x10')](_0x1576('0x12'),_0x21d3bd,_0x561917[_0x1576('0x10')][_0x1576('0x13')]);return _0x1f814b(_0x561917['error'][_0x1576('0x13')]);}else{logger['info'](_0x1576('0x12'),_0x21d3bd,_0x1576('0xe'));_0x1f814b(_0x561917[_0x1576('0x14')][_0x1576('0x13')]);}})[_0x1576('0x15')](function(_0x288749){logger['error'](_0x1576('0x12'),_0x21d3bd,_0x288749);_0x5ab69b(_0x288749);});});} \ No newline at end of file +var _0x1ca7=['catch','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','info','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result'];(function(_0x39d5b5,_0x340609){var _0x4aac9e=function(_0x586d09){while(--_0x586d09){_0x39d5b5['push'](_0x39d5b5['shift']());}};_0x4aac9e(++_0x340609);}(_0x1ca7,0x157));var _0x71ca=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x1ca7[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x71ca('0x0'));var util=require(_0x71ca('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x71ca('0x2'));var db=require(_0x71ca('0x3'))['db'];var utils=require(_0x71ca('0x4'));var logger=require('../../config/logger')(_0x71ca('0x5'));var config=require(_0x71ca('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x71ca('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2d5d49,_0x31444d,_0xa06a89){return new BPromise(function(_0x4f25f6,_0x378012){return client[_0x71ca('0x8')](_0x2d5d49,_0xa06a89)['then'](function(_0x2ad516){logger[_0x71ca('0x9')](_0x71ca('0xa'),_0x31444d,'request\x20sent');logger[_0x71ca('0xb')](_0x71ca('0xc'),_0x31444d,_0x71ca('0xd'),JSON[_0x71ca('0xe')](_0x2ad516));if(_0x2ad516[_0x71ca('0xf')]){if(_0x2ad516[_0x71ca('0xf')]['code']===0x1f4){logger[_0x71ca('0xf')](_0x71ca('0xa'),_0x31444d,_0x2ad516['error'][_0x71ca('0x10')]);return _0x378012(_0x2ad516[_0x71ca('0xf')][_0x71ca('0x10')]);}logger[_0x71ca('0xf')](_0x71ca('0xa'),_0x31444d,_0x2ad516[_0x71ca('0xf')][_0x71ca('0x10')]);return _0x4f25f6(_0x2ad516[_0x71ca('0xf')][_0x71ca('0x10')]);}else{logger[_0x71ca('0x9')]('VoiceContext,\x20%s,\x20%s',_0x31444d,'request\x20sent');_0x4f25f6(_0x2ad516[_0x71ca('0x11')]['message']);}})[_0x71ca('0x12')](function(_0x22f5f9){logger['error']('VoiceContext,\x20%s,\x20%s',_0x31444d,_0x22f5f9);_0x378012(_0x22f5f9);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index ef508c6..df0afda 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 _0xb6ec=['express','Router','fs-extra','../../components/interaction/service','./voiceDialReport.controller','get','isAuthenticated','index','/:id','show','create','update','destroy','exports','multer','util','path'];(function(_0x4c4683,_0x241657){var _0x78ee7e=function(_0x4c9489){while(--_0x4c9489){_0x4c4683['push'](_0x4c4683['shift']());}};_0x78ee7e(++_0x241657);}(_0xb6ec,0x74));var _0xcb6e=function(_0x57b0a9,_0x7fd7ed){_0x57b0a9=_0x57b0a9-0x0;var _0x28486b=_0xb6ec[_0x57b0a9];return _0x28486b;};'use strict';var multer=require(_0xcb6e('0x0'));var util=require(_0xcb6e('0x1'));var path=require(_0xcb6e('0x2'));var timeout=require('connect-timeout');var express=require(_0xcb6e('0x3'));var router=express[_0xcb6e('0x4')]();var fs_extra=require(_0xcb6e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xcb6e('0x6'));var config=require('../../config/environment');var controller=require(_0xcb6e('0x7'));router[_0xcb6e('0x8')]('/',auth[_0xcb6e('0x9')](),controller[_0xcb6e('0xa')]);router[_0xcb6e('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xcb6e('0x8')](_0xcb6e('0xb'),auth[_0xcb6e('0x9')](),controller[_0xcb6e('0xc')]);router['post']('/',auth[_0xcb6e('0x9')](),controller[_0xcb6e('0xd')]);router['put'](_0xcb6e('0xb'),auth['isAuthenticated'](),controller[_0xcb6e('0xe')]);router['delete'](_0xcb6e('0xb'),auth[_0xcb6e('0x9')](),controller[_0xcb6e('0xf')]);module[_0xcb6e('0x10')]=router; \ No newline at end of file +var _0x1a5b=['delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update'];(function(_0x45ca47,_0x1838c7){var _0x15efe9=function(_0xd8ce4b){while(--_0xd8ce4b){_0x45ca47['push'](_0x45ca47['shift']());}};_0x15efe9(++_0x1838c7);}(_0x1a5b,0x153));var _0xb1a5=function(_0x49322d,_0x368f4f){_0x49322d=_0x49322d-0x0;var _0x495c8e=_0x1a5b[_0x49322d];return _0x495c8e;};'use strict';var multer=require(_0xb1a5('0x0'));var util=require(_0xb1a5('0x1'));var path=require(_0xb1a5('0x2'));var timeout=require(_0xb1a5('0x3'));var express=require(_0xb1a5('0x4'));var router=express['Router']();var fs_extra=require(_0xb1a5('0x5'));var auth=require(_0xb1a5('0x6'));var interaction=require(_0xb1a5('0x7'));var config=require(_0xb1a5('0x8'));var controller=require(_0xb1a5('0x9'));router[_0xb1a5('0xa')]('/',auth[_0xb1a5('0xb')](),controller[_0xb1a5('0xc')]);router[_0xb1a5('0xa')](_0xb1a5('0xd'),auth['isAuthenticated'](),controller[_0xb1a5('0xe')]);router[_0xb1a5('0xa')](_0xb1a5('0xf'),auth[_0xb1a5('0xb')](),controller[_0xb1a5('0x10')]);router[_0xb1a5('0x11')]('/',auth[_0xb1a5('0xb')](),controller[_0xb1a5('0x12')]);router[_0xb1a5('0x13')](_0xb1a5('0xf'),auth['isAuthenticated'](),controller[_0xb1a5('0x14')]);router[_0xb1a5('0x15')](_0xb1a5('0xf'),auth[_0xb1a5('0xb')](),controller[_0xb1a5('0x16')]);module[_0xb1a5('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index daf26e4..85eda24 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 _0x54ef=['STRING','INTEGER','DATE','called,connect,complete','sequelize','exports'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x54ef,0x112));var _0xf54e=function(_0x4aa902,_0x4b4012){_0x4aa902=_0x4aa902-0x0;var _0x3406f4=_0x54ef[_0x4aa902];return _0x3406f4;};'use strict';var Sequelize=require(_0xf54e('0x0'));module[_0xf54e('0x1')]={'privilege':{'type':Sequelize[_0xf54e('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xf54e('0x3')]},'channelstatedesc':{'type':Sequelize[_0xf54e('0x2')]},'calleridnum':{'type':Sequelize[_0xf54e('0x2')]},'calleridname':{'type':Sequelize[_0xf54e('0x2')]},'connectedlinenum':{'type':Sequelize[_0xf54e('0x2')]},'connectedlinename':{'type':Sequelize[_0xf54e('0x2')]},'language':{'type':Sequelize[_0xf54e('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xf54e('0x2')]},'priority':{'type':Sequelize[_0xf54e('0x3')]},'uniqueid':{'type':Sequelize[_0xf54e('0x2')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xf54e('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xf54e('0x2')]},'destcalleridnum':{'type':Sequelize[_0xf54e('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xf54e('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xf54e('0x2')]},'destlanguage':{'type':Sequelize[_0xf54e('0x2')]},'destaccountcode':{'type':Sequelize[_0xf54e('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xf54e('0x2')]},'destpriority':{'type':Sequelize[_0xf54e('0x3')]},'destuniqueid':{'type':Sequelize[_0xf54e('0x2')]},'destlinkedid':{'type':Sequelize[_0xf54e('0x2')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0xf54e('0x2')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xf54e('0x4')]},'lastevent':{'type':Sequelize[_0xf54e('0x2')],'comment':_0xf54e('0x5')},'routeId':{'type':Sequelize[_0xf54e('0x3')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xf54e('0x3')]},'billableseconds':{'type':Sequelize[_0xf54e('0x3')]}}; \ No newline at end of file +var _0x9957=['INTEGER','DATE','called,connect,complete','sequelize','exports','STRING'];(function(_0x8dbda0,_0x222851){var _0x53c5ed=function(_0x270e06){while(--_0x270e06){_0x8dbda0['push'](_0x8dbda0['shift']());}};_0x53c5ed(++_0x222851);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'privilege':{'type':Sequelize[_0x7995('0x2')]},'channel':{'type':Sequelize[_0x7995('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x7995('0x2')]},'calleridnum':{'type':Sequelize[_0x7995('0x2')]},'calleridname':{'type':Sequelize[_0x7995('0x2')]},'connectedlinenum':{'type':Sequelize[_0x7995('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x7995('0x2')]},'accountcode':{'type':Sequelize[_0x7995('0x2')]},'context':{'type':Sequelize[_0x7995('0x2')]},'exten':{'type':Sequelize[_0x7995('0x2')]},'priority':{'type':Sequelize[_0x7995('0x3')]},'uniqueid':{'type':Sequelize[_0x7995('0x2')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x7995('0x2')]},'destchannelstate':{'type':Sequelize[_0x7995('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x7995('0x2')]},'destcalleridname':{'type':Sequelize[_0x7995('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x7995('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x7995('0x2')]},'destlanguage':{'type':Sequelize[_0x7995('0x2')]},'destaccountcode':{'type':Sequelize[_0x7995('0x2')]},'destcontext':{'type':Sequelize[_0x7995('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x7995('0x3')]},'destuniqueid':{'type':Sequelize[_0x7995('0x2')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x7995('0x2')]},'dialstatus':{'type':Sequelize[_0x7995('0x2')]},'starttime':{'type':Sequelize[_0x7995('0x4')]},'answertime':{'type':Sequelize[_0x7995('0x4')]},'endtime':{'type':Sequelize[_0x7995('0x4')]},'lastevent':{'type':Sequelize[_0x7995('0x2')],'comment':_0x7995('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0x7995('0x3')]},'billableseconds':{'type':Sequelize[_0x7995('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 68c48f9..39d1210 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 _0x0eb0=['destroy','end','error','stack','name','send','map','VoiceDialReport','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','rawAttributes','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','moment','mustache','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','reject','save','update','then'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x0eb0,0x1e5));var _0x00eb=function(_0x36671b,_0xd609f4){_0x36671b=_0x36671b-0x0;var _0x42061c=_0x0eb0[_0x36671b];return _0x42061c;};'use strict';var emlformat=require(_0x00eb('0x0'));var rimraf=require(_0x00eb('0x1'));var zipdir=require(_0x00eb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x00eb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x00eb('0x4'));var util=require('util');var path=require(_0x00eb('0x5'));var sox=require(_0x00eb('0x6'));var csv=require(_0x00eb('0x7'));var ejs=require(_0x00eb('0x8'));var fs=require('fs');var fs_extra=require(_0x00eb('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x00eb('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x00eb('0xb'));var toCsv=require(_0x00eb('0x7'));var querystring=require(_0x00eb('0xc'));var Papa=require('papaparse');var Redis=require(_0x00eb('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x00eb('0xe'));var hardwareService=require(_0x00eb('0xf'));var logger=require(_0x00eb('0x10'))(_0x00eb('0x11'));var utils=require(_0x00eb('0x12'));var config=require(_0x00eb('0x13'));var licenseUtil=require(_0x00eb('0x14'));var db=require(_0x00eb('0x15'))['db'];function respondWithStatusCode(_0xd51f2b,_0x5912d0){_0x5912d0=_0x5912d0||0xcc;return function(_0x1f9ab9){if(_0x1f9ab9){return _0xd51f2b[_0x00eb('0x16')](_0x5912d0);}return _0xd51f2b['status'](_0x5912d0)['end']();};}function respondWithResult(_0x15de2c,_0x143da7){_0x143da7=_0x143da7||0xc8;return function(_0x248dfd){if(_0x248dfd){return _0x15de2c[_0x00eb('0x17')](_0x143da7)[_0x00eb('0x18')](_0x248dfd);}};}function respondWithFilteredResult(_0x47baa3,_0x3691c1){return function(_0x51f894){if(_0x51f894){var _0xe2dac6=typeof _0x3691c1[_0x00eb('0x19')]===_0x00eb('0x1a')&&typeof _0x3691c1[_0x00eb('0x1b')]===_0x00eb('0x1a');var _0x1383dd=_0x51f894[_0x00eb('0x1c')];var _0x117bc3=_0xe2dac6?0x0:_0x3691c1['offset'];var _0x357b11=_0xe2dac6?_0x51f894[_0x00eb('0x1c')]:_0x3691c1[_0x00eb('0x19')]+_0x3691c1[_0x00eb('0x1b')];var _0x2ed692;if(_0x357b11>=_0x1383dd){_0x357b11=_0x1383dd;_0x2ed692=0xc8;}else{_0x2ed692=0xce;}_0x47baa3['status'](_0x2ed692);return _0x47baa3['set']('Content-Range',_0x117bc3+'-'+_0x357b11+'/'+_0x1383dd)[_0x00eb('0x18')](_0x51f894);}return null;};}function patchUpdates(_0x58b6e1){return function(_0x59bfcf){try{jsonpatch['apply'](_0x59bfcf,_0x58b6e1,!![]);}catch(_0x34d626){return BPromise[_0x00eb('0x1d')](_0x34d626);}return _0x59bfcf[_0x00eb('0x1e')]();};}function saveUpdates(_0x32de09,_0x4e3356){return function(_0x2c987b){if(_0x2c987b){return _0x2c987b[_0x00eb('0x1f')](_0x32de09)[_0x00eb('0x20')](function(_0x1a219e){return _0x1a219e;});}return null;};}function removeEntity(_0x14cac9,_0x183a69){return function(_0x1623b8){if(_0x1623b8){return _0x1623b8[_0x00eb('0x21')]()[_0x00eb('0x20')](function(){_0x14cac9[_0x00eb('0x17')](0xcc)[_0x00eb('0x22')]();});}};}function handleEntityNotFound(_0x1bca65,_0x53f989){return function(_0x38d586){if(!_0x38d586){_0x1bca65[_0x00eb('0x16')](0x194);}return _0x38d586;};}function handleError(_0x158f7e,_0x294b29){_0x294b29=_0x294b29||0x1f4;return function(_0x33ee0f){logger[_0x00eb('0x23')](_0x33ee0f[_0x00eb('0x24')]);if(_0x33ee0f['name']){delete _0x33ee0f[_0x00eb('0x25')];}_0x158f7e[_0x00eb('0x17')](_0x294b29)[_0x00eb('0x26')](_0x33ee0f);};}exports['index']=function(_0x587d54,_0x341f5b){var _0x3d850b={},_0x3e024b={},_0x1ca16d={'count':0x0,'rows':[]};var _0x57d17f=_[_0x00eb('0x27')](db[_0x00eb('0x28')]['rawAttributes'],function(_0x379d8b){return{'name':_0x379d8b[_0x00eb('0x29')],'type':_0x379d8b[_0x00eb('0x2a')][_0x00eb('0x2b')]};});_0x3e024b[_0x00eb('0x2c')]=_[_0x00eb('0x27')](_0x57d17f,_0x00eb('0x25'));_0x3e024b[_0x00eb('0x2d')]=_[_0x00eb('0x2e')](_0x587d54[_0x00eb('0x2d')]);_0x3e024b['filters']=_[_0x00eb('0x2f')](_0x3e024b[_0x00eb('0x2c')],_0x3e024b[_0x00eb('0x2d')]);_0x3d850b['attributes']=_['intersection'](_0x3e024b[_0x00eb('0x2c')],qs[_0x00eb('0x30')](_0x587d54['query'][_0x00eb('0x30')]));_0x3d850b['attributes']=_0x3d850b[_0x00eb('0x31')][_0x00eb('0x32')]?_0x3d850b[_0x00eb('0x31')]:_0x3e024b[_0x00eb('0x2c')];if(!_0x587d54[_0x00eb('0x2d')][_0x00eb('0x33')](_0x00eb('0x34'))){_0x3d850b[_0x00eb('0x1b')]=qs['limit'](_0x587d54['query'][_0x00eb('0x1b')]);_0x3d850b[_0x00eb('0x19')]=qs[_0x00eb('0x19')](_0x587d54[_0x00eb('0x2d')][_0x00eb('0x19')]);}_0x3d850b[_0x00eb('0x35')]=qs[_0x00eb('0x36')](_0x587d54[_0x00eb('0x2d')]['sort']);_0x3d850b[_0x00eb('0x37')]=qs[_0x00eb('0x38')](_[_0x00eb('0x39')](_0x587d54[_0x00eb('0x2d')],_0x3e024b['filters']),_0x57d17f);if(_0x587d54[_0x00eb('0x2d')][_0x00eb('0x3a')]){_0x3d850b[_0x00eb('0x37')]=_[_0x00eb('0x3b')](_0x3d850b[_0x00eb('0x37')],{'$or':_['map'](_0x57d17f,function(_0x397de0){if(_0x397de0['type']!==_0x00eb('0x3c')){var _0xccf95={};_0xccf95[_0x397de0[_0x00eb('0x25')]]={'$like':'%'+_0x587d54[_0x00eb('0x2d')]['filter']+'%'};return _0xccf95;}})});}_0x3d850b=_[_0x00eb('0x3b')]({},_0x3d850b,_0x587d54['options']);var _0x257fe5={'where':_0x3d850b[_0x00eb('0x37')]};return db['VoiceDialReport']['count'](_0x257fe5)[_0x00eb('0x20')](function(_0x365ab6){_0x1ca16d['count']=_0x365ab6;if(_0x587d54[_0x00eb('0x2d')][_0x00eb('0x3d')]){_0x3d850b[_0x00eb('0x3e')]=[{'all':!![]}];}return db['VoiceDialReport'][_0x00eb('0x3f')](_0x3d850b);})[_0x00eb('0x20')](function(_0x2b6b7d){_0x1ca16d[_0x00eb('0x40')]=_0x2b6b7d;return _0x1ca16d;})[_0x00eb('0x20')](respondWithFilteredResult(_0x341f5b,_0x3d850b))[_0x00eb('0x41')](handleError(_0x341f5b,null));};exports[_0x00eb('0x42')]=function(_0x255a5c,_0x155245){var _0x1fd826={'raw':!![],'where':{'id':_0x255a5c['params']['id']}},_0x247e06={};_0x247e06['model']=_[_0x00eb('0x2e')](db[_0x00eb('0x28')][_0x00eb('0x43')]);_0x247e06[_0x00eb('0x2d')]=_['keys'](_0x255a5c[_0x00eb('0x2d')]);_0x247e06[_0x00eb('0x38')]=_[_0x00eb('0x2f')](_0x247e06['model'],_0x247e06[_0x00eb('0x2d')]);_0x1fd826[_0x00eb('0x31')]=_[_0x00eb('0x2f')](_0x247e06[_0x00eb('0x2c')],qs[_0x00eb('0x30')](_0x255a5c[_0x00eb('0x2d')]['fields']));_0x1fd826[_0x00eb('0x31')]=_0x1fd826['attributes'][_0x00eb('0x32')]?_0x1fd826[_0x00eb('0x31')]:_0x247e06[_0x00eb('0x2c')];if(_0x255a5c[_0x00eb('0x2d')][_0x00eb('0x3d')]){_0x1fd826[_0x00eb('0x3e')]=[{'all':!![]}];}_0x1fd826=_[_0x00eb('0x3b')]({},_0x1fd826,_0x255a5c[_0x00eb('0x44')]);return db[_0x00eb('0x28')][_0x00eb('0x45')](_0x1fd826)[_0x00eb('0x20')](handleEntityNotFound(_0x155245,null))[_0x00eb('0x20')](respondWithResult(_0x155245,null))['catch'](handleError(_0x155245,null));};exports[_0x00eb('0x46')]=function(_0xf586d8,_0x3a8180){return db[_0x00eb('0x28')][_0x00eb('0x46')](_0xf586d8[_0x00eb('0x47')],{})[_0x00eb('0x20')](respondWithResult(_0x3a8180,0xc9))[_0x00eb('0x41')](handleError(_0x3a8180,null));};exports[_0x00eb('0x1f')]=function(_0x572e89,_0x44d289){if(_0x572e89['body']['id']){delete _0x572e89['body']['id'];}return db[_0x00eb('0x28')][_0x00eb('0x45')]({'where':{'id':_0x572e89[_0x00eb('0x48')]['id']}})[_0x00eb('0x20')](handleEntityNotFound(_0x44d289,null))[_0x00eb('0x20')](saveUpdates(_0x572e89[_0x00eb('0x47')],null))['then'](respondWithResult(_0x44d289,null))[_0x00eb('0x41')](handleError(_0x44d289,null));};exports[_0x00eb('0x21')]=function(_0x3d1751,_0x433078){return db['VoiceDialReport'][_0x00eb('0x45')]({'where':{'id':_0x3d1751[_0x00eb('0x48')]['id']}})[_0x00eb('0x20')](handleEntityNotFound(_0x433078,null))[_0x00eb('0x20')](removeEntity(_0x433078,null))['catch'](handleError(_0x433078,null));};exports[_0x00eb('0x49')]=function(_0x12ed72,_0x40198b){return db[_0x00eb('0x28')][_0x00eb('0x49')]()[_0x00eb('0x20')](respondWithResult(_0x40198b,null))[_0x00eb('0x41')](handleError(_0x40198b,null));}; \ No newline at end of file +var _0xf0f7=['map','VoiceDialReport','rawAttributes','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','includeAll','rows','catch','show','params','include','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','path','sox','to-csv','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','sendStatus','stack','name','status','index'];(function(_0x337216,_0x4184e2){var _0x113fdb=function(_0x34e656){while(--_0x34e656){_0x337216['push'](_0x337216['shift']());}};_0x113fdb(++_0x4184e2);}(_0xf0f7,0x16c));var _0x7f0f=function(_0x45763e,_0x531454){_0x45763e=_0x45763e-0x0;var _0x5e8b07=_0xf0f7[_0x45763e];return _0x5e8b07;};'use strict';var emlformat=require(_0x7f0f('0x0'));var rimraf=require(_0x7f0f('0x1'));var zipdir=require(_0x7f0f('0x2'));var jsonpatch=require(_0x7f0f('0x3'));var rp=require(_0x7f0f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x7f0f('0x5'));var sox=require(_0x7f0f('0x6'));var csv=require(_0x7f0f('0x7'));var ejs=require(_0x7f0f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7f0f('0x9'));var crypto=require(_0x7f0f('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x7f0f('0xb'));var toCsv=require(_0x7f0f('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7f0f('0xc'));var authService=require(_0x7f0f('0xd'));var qs=require(_0x7f0f('0xe'));var as=require(_0x7f0f('0xf'));var hardwareService=require(_0x7f0f('0x10'));var logger=require('../../config/logger')(_0x7f0f('0x11'));var utils=require(_0x7f0f('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x7f0f('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a7372,_0x44b688){_0x44b688=_0x44b688||0xcc;return function(_0x208e92){if(_0x208e92){return _0x2a7372['sendStatus'](_0x44b688);}return _0x2a7372['status'](_0x44b688)[_0x7f0f('0x14')]();};}function respondWithResult(_0x4a1390,_0x269d86){_0x269d86=_0x269d86||0xc8;return function(_0x13474b){if(_0x13474b){return _0x4a1390['status'](_0x269d86)['json'](_0x13474b);}};}function respondWithFilteredResult(_0x3db07c,_0x308712){return function(_0x3485a6){if(_0x3485a6){var _0x213542=typeof _0x308712[_0x7f0f('0x15')]===_0x7f0f('0x16')&&typeof _0x308712[_0x7f0f('0x17')]===_0x7f0f('0x16');var _0x5f3419=_0x3485a6[_0x7f0f('0x18')];var _0x592e48=_0x213542?0x0:_0x308712['offset'];var _0x134739=_0x213542?_0x3485a6[_0x7f0f('0x18')]:_0x308712[_0x7f0f('0x15')]+_0x308712[_0x7f0f('0x17')];var _0x2b3e94;if(_0x134739>=_0x5f3419){_0x134739=_0x5f3419;_0x2b3e94=0xc8;}else{_0x2b3e94=0xce;}_0x3db07c['status'](_0x2b3e94);return _0x3db07c[_0x7f0f('0x19')](_0x7f0f('0x1a'),_0x592e48+'-'+_0x134739+'/'+_0x5f3419)[_0x7f0f('0x1b')](_0x3485a6);}return null;};}function patchUpdates(_0x2714db){return function(_0x4636ff){try{jsonpatch[_0x7f0f('0x1c')](_0x4636ff,_0x2714db,!![]);}catch(_0x392eec){return BPromise['reject'](_0x392eec);}return _0x4636ff[_0x7f0f('0x1d')]();};}function saveUpdates(_0x492486,_0x3a76ac){return function(_0x124f2e){if(_0x124f2e){return _0x124f2e[_0x7f0f('0x1e')](_0x492486)[_0x7f0f('0x1f')](function(_0x4f6098){return _0x4f6098;});}return null;};}function removeEntity(_0x5ba9d5,_0x15c187){return function(_0x5cb6c0){if(_0x5cb6c0){return _0x5cb6c0[_0x7f0f('0x20')]()[_0x7f0f('0x1f')](function(){_0x5ba9d5['status'](0xcc)[_0x7f0f('0x14')]();});}};}function handleEntityNotFound(_0x11ce32,_0xb18067){return function(_0x14e600){if(!_0x14e600){_0x11ce32[_0x7f0f('0x21')](0x194);}return _0x14e600;};}function handleError(_0x420851,_0x49d9f9){_0x49d9f9=_0x49d9f9||0x1f4;return function(_0x19891d){logger['error'](_0x19891d[_0x7f0f('0x22')]);if(_0x19891d[_0x7f0f('0x23')]){delete _0x19891d[_0x7f0f('0x23')];}_0x420851[_0x7f0f('0x24')](_0x49d9f9)['send'](_0x19891d);};}exports[_0x7f0f('0x25')]=function(_0x130244,_0x594a47){var _0x5bc8e={},_0x3eb864={},_0x1f28ec={'count':0x0,'rows':[]};var _0x54ed8a=_[_0x7f0f('0x26')](db[_0x7f0f('0x27')][_0x7f0f('0x28')],function(_0x155ad0){return{'name':_0x155ad0['fieldName'],'type':_0x155ad0['type'][_0x7f0f('0x29')]};});_0x3eb864[_0x7f0f('0x2a')]=_['map'](_0x54ed8a,_0x7f0f('0x23'));_0x3eb864[_0x7f0f('0x2b')]=_[_0x7f0f('0x2c')](_0x130244[_0x7f0f('0x2b')]);_0x3eb864['filters']=_[_0x7f0f('0x2d')](_0x3eb864['model'],_0x3eb864[_0x7f0f('0x2b')]);_0x5bc8e[_0x7f0f('0x2e')]=_[_0x7f0f('0x2d')](_0x3eb864[_0x7f0f('0x2a')],qs[_0x7f0f('0x2f')](_0x130244[_0x7f0f('0x2b')][_0x7f0f('0x2f')]));_0x5bc8e[_0x7f0f('0x2e')]=_0x5bc8e['attributes'][_0x7f0f('0x30')]?_0x5bc8e[_0x7f0f('0x2e')]:_0x3eb864[_0x7f0f('0x2a')];if(!_0x130244[_0x7f0f('0x2b')]['hasOwnProperty'](_0x7f0f('0x31'))){_0x5bc8e[_0x7f0f('0x17')]=qs['limit'](_0x130244['query'][_0x7f0f('0x17')]);_0x5bc8e[_0x7f0f('0x15')]=qs[_0x7f0f('0x15')](_0x130244[_0x7f0f('0x2b')][_0x7f0f('0x15')]);}_0x5bc8e[_0x7f0f('0x32')]=qs[_0x7f0f('0x33')](_0x130244['query'][_0x7f0f('0x33')]);_0x5bc8e[_0x7f0f('0x34')]=qs['filters'](_[_0x7f0f('0x35')](_0x130244['query'],_0x3eb864['filters']),_0x54ed8a);if(_0x130244[_0x7f0f('0x2b')][_0x7f0f('0x36')]){_0x5bc8e[_0x7f0f('0x34')]=_[_0x7f0f('0x37')](_0x5bc8e['where'],{'$or':_['map'](_0x54ed8a,function(_0x270d03){if(_0x270d03['type']!=='VIRTUAL'){var _0x31bf3b={};_0x31bf3b[_0x270d03[_0x7f0f('0x23')]]={'$like':'%'+_0x130244[_0x7f0f('0x2b')][_0x7f0f('0x36')]+'%'};return _0x31bf3b;}})});}_0x5bc8e=_[_0x7f0f('0x37')]({},_0x5bc8e,_0x130244['options']);var _0x15418b={'where':_0x5bc8e[_0x7f0f('0x34')]};return db[_0x7f0f('0x27')][_0x7f0f('0x18')](_0x15418b)[_0x7f0f('0x1f')](function(_0x5ac85b){_0x1f28ec['count']=_0x5ac85b;if(_0x130244[_0x7f0f('0x2b')][_0x7f0f('0x38')]){_0x5bc8e['include']=[{'all':!![]}];}return db[_0x7f0f('0x27')]['findAll'](_0x5bc8e);})[_0x7f0f('0x1f')](function(_0x164446){_0x1f28ec[_0x7f0f('0x39')]=_0x164446;return _0x1f28ec;})['then'](respondWithFilteredResult(_0x594a47,_0x5bc8e))[_0x7f0f('0x3a')](handleError(_0x594a47,null));};exports[_0x7f0f('0x3b')]=function(_0x31c3f8,_0x2c9c54){var _0x168c30={'raw':!![],'where':{'id':_0x31c3f8[_0x7f0f('0x3c')]['id']}},_0x3ed739={};_0x3ed739[_0x7f0f('0x2a')]=_[_0x7f0f('0x2c')](db[_0x7f0f('0x27')]['rawAttributes']);_0x3ed739['query']=_[_0x7f0f('0x2c')](_0x31c3f8[_0x7f0f('0x2b')]);_0x3ed739['filters']=_[_0x7f0f('0x2d')](_0x3ed739[_0x7f0f('0x2a')],_0x3ed739[_0x7f0f('0x2b')]);_0x168c30['attributes']=_[_0x7f0f('0x2d')](_0x3ed739[_0x7f0f('0x2a')],qs[_0x7f0f('0x2f')](_0x31c3f8[_0x7f0f('0x2b')]['fields']));_0x168c30[_0x7f0f('0x2e')]=_0x168c30[_0x7f0f('0x2e')]['length']?_0x168c30[_0x7f0f('0x2e')]:_0x3ed739[_0x7f0f('0x2a')];if(_0x31c3f8[_0x7f0f('0x2b')]['includeAll']){_0x168c30[_0x7f0f('0x3d')]=[{'all':!![]}];}_0x168c30=_[_0x7f0f('0x37')]({},_0x168c30,_0x31c3f8[_0x7f0f('0x3e')]);return db[_0x7f0f('0x27')][_0x7f0f('0x3f')](_0x168c30)[_0x7f0f('0x1f')](handleEntityNotFound(_0x2c9c54,null))[_0x7f0f('0x1f')](respondWithResult(_0x2c9c54,null))[_0x7f0f('0x3a')](handleError(_0x2c9c54,null));};exports[_0x7f0f('0x40')]=function(_0x5f336e,_0x580bc9){return db[_0x7f0f('0x27')][_0x7f0f('0x40')](_0x5f336e[_0x7f0f('0x41')],{})[_0x7f0f('0x1f')](respondWithResult(_0x580bc9,0xc9))['catch'](handleError(_0x580bc9,null));};exports[_0x7f0f('0x1e')]=function(_0x3befbb,_0x5f1fc9){if(_0x3befbb[_0x7f0f('0x41')]['id']){delete _0x3befbb['body']['id'];}return db[_0x7f0f('0x27')][_0x7f0f('0x3f')]({'where':{'id':_0x3befbb[_0x7f0f('0x3c')]['id']}})[_0x7f0f('0x1f')](handleEntityNotFound(_0x5f1fc9,null))[_0x7f0f('0x1f')](saveUpdates(_0x3befbb[_0x7f0f('0x41')],null))[_0x7f0f('0x1f')](respondWithResult(_0x5f1fc9,null))[_0x7f0f('0x3a')](handleError(_0x5f1fc9,null));};exports[_0x7f0f('0x20')]=function(_0x3cc65a,_0x365334){return db[_0x7f0f('0x27')]['find']({'where':{'id':_0x3cc65a[_0x7f0f('0x3c')]['id']}})[_0x7f0f('0x1f')](handleEntityNotFound(_0x365334,null))[_0x7f0f('0x1f')](removeEntity(_0x365334,null))[_0x7f0f('0x3a')](handleError(_0x365334,null));};exports[_0x7f0f('0x42')]=function(_0xf19e0f,_0x528b1e){return db[_0x7f0f('0x27')][_0x7f0f('0x42')]()[_0x7f0f('0x1f')](respondWithResult(_0x528b1e,null))[_0x7f0f('0x3a')](handleError(_0x528b1e,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 65c0aca..53c3d46 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 _0x0c65=['moment','bluebird','request-promise','path','../../config/environment','./voiceDialReport.attributes','define','VoiceDialReport','report_dial','uniqueid','lodash','../../config/logger','api'];(function(_0x3c9e74,_0x4334c5){var _0x4fea21=function(_0x5a2cbb){while(--_0x5a2cbb){_0x3c9e74['push'](_0x3c9e74['shift']());}};_0x4fea21(++_0x4334c5);}(_0x0c65,0x19d));var _0x50c6=function(_0x5ce363,_0x44ee1b){_0x5ce363=_0x5ce363-0x0;var _0x160171=_0x0c65[_0x5ce363];return _0x160171;};'use strict';var _=require(_0x50c6('0x0'));var util=require('util');var logger=require(_0x50c6('0x1'))(_0x50c6('0x2'));var moment=require(_0x50c6('0x3'));var BPromise=require(_0x50c6('0x4'));var rp=require(_0x50c6('0x5'));var fs=require('fs');var path=require(_0x50c6('0x6'));var rimraf=require('rimraf');var config=require(_0x50c6('0x7'));var attributes=require(_0x50c6('0x8'));module['exports']=function(_0x4087c4,_0x55d805){return _0x4087c4[_0x50c6('0x9')](_0x50c6('0xa'),attributes,{'tableName':_0x50c6('0xb'),'paranoid':![],'indexes':[{'fields':[_0x50c6('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x12fa=['./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x367759,_0x73d72){var _0x216ca0=function(_0x3ddf6c){while(--_0x3ddf6c){_0x367759['push'](_0x367759['shift']());}};_0x216ca0(++_0x73d72);}(_0x12fa,0x130));var _0xa12f=function(_0x2eccaf,_0x33a2c2){_0x2eccaf=_0x2eccaf-0x0;var _0x21cfed=_0x12fa[_0x2eccaf];return _0x21cfed;};'use strict';var _=require(_0xa12f('0x0'));var util=require(_0xa12f('0x1'));var logger=require(_0xa12f('0x2'))('api');var moment=require(_0xa12f('0x3'));var BPromise=require(_0xa12f('0x4'));var rp=require(_0xa12f('0x5'));var fs=require('fs');var path=require(_0xa12f('0x6'));var rimraf=require('rimraf');var config=require(_0xa12f('0x7'));var attributes=require(_0xa12f('0x8'));module[_0xa12f('0x9')]=function(_0x2d81a3,_0x27a291){return _0x2d81a3[_0xa12f('0xa')](_0xa12f('0xb'),attributes,{'tableName':_0xa12f('0xc'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 037a693..3521093 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 _0x4a9d=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateVoiceDialReport','body','options','raw','stringify','UpdateVoiceDialReport','VoiceDialReport','update','where','attributes','limit','moment','bluebird','randomstring','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4a9d,0x137));var _0xd4a9=function(_0x75be6b,_0x2e4f4d){_0x75be6b=_0x75be6b-0x0;var _0x294f32=_0x4a9d[_0x75be6b];return _0x294f32;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd4a9('0x0'));var BPromise=require(_0xd4a9('0x1'));var rs=require(_0xd4a9('0x2'));var fs=require('fs');var Redis=require(_0xd4a9('0x3'));var db=require(_0xd4a9('0x4'))['db'];var utils=require(_0xd4a9('0x5'));var logger=require(_0xd4a9('0x6'))(_0xd4a9('0x7'));var config=require(_0xd4a9('0x8'));var jayson=require(_0xd4a9('0x9'));var client=jayson[_0xd4a9('0xa')][_0xd4a9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x8f3d71,_0xba3b7b,_0x9090){return new BPromise(function(_0x27adbd,_0x5bb677){return client[_0xd4a9('0xc')](_0x8f3d71,_0x9090)[_0xd4a9('0xd')](function(_0x568381){logger[_0xd4a9('0xe')](_0xd4a9('0xf'),_0xba3b7b,_0xd4a9('0x10'));logger[_0xd4a9('0x11')](_0xd4a9('0x12'),_0xba3b7b,'request\x20sent',JSON['stringify'](_0x568381));if(_0x568381[_0xd4a9('0x13')]){if(_0x568381[_0xd4a9('0x13')][_0xd4a9('0x14')]===0x1f4){logger[_0xd4a9('0x13')](_0xd4a9('0xf'),_0xba3b7b,_0x568381[_0xd4a9('0x13')][_0xd4a9('0x15')]);return _0x5bb677(_0x568381[_0xd4a9('0x13')][_0xd4a9('0x15')]);}logger[_0xd4a9('0x13')]('VoiceDialReport,\x20%s,\x20%s',_0xba3b7b,_0x568381[_0xd4a9('0x13')][_0xd4a9('0x15')]);return _0x27adbd(_0x568381[_0xd4a9('0x13')][_0xd4a9('0x15')]);}else{logger[_0xd4a9('0xe')](_0xd4a9('0xf'),_0xba3b7b,_0xd4a9('0x10'));_0x27adbd(_0x568381[_0xd4a9('0x16')]['message']);}})[_0xd4a9('0x17')](function(_0xc10416){logger[_0xd4a9('0x13')](_0xd4a9('0xf'),_0xba3b7b,_0xc10416);_0x5bb677(_0xc10416);});});}exports[_0xd4a9('0x18')]=function(_0x5457e4){var _0x7334c4=this;return new Promise(function(_0x59d710,_0x1d39ac){return db['VoiceDialReport']['create'](_0x5457e4[_0xd4a9('0x19')],{'raw':_0x5457e4[_0xd4a9('0x1a')]?_0x5457e4[_0xd4a9('0x1a')][_0xd4a9('0x1b')]===undefined?!![]:![]:!![]})[_0xd4a9('0xd')](function(_0x5b4bac){logger['info']('CreateVoiceDialReport',_0x5457e4);logger['debug'](_0xd4a9('0x18'),_0x5457e4,JSON[_0xd4a9('0x1c')](_0x5b4bac));_0x59d710(_0x5b4bac);})[_0xd4a9('0x17')](function(_0x5bbce1){logger['error']('CreateVoiceDialReport',_0x5bbce1['message'],_0x5457e4);_0x1d39ac(_0x7334c4[_0xd4a9('0x13')](0x1f4,_0x5bbce1['message']));});});};exports[_0xd4a9('0x1d')]=function(_0x1c445c){var _0x4dd95f=this;return new Promise(function(_0x179eaf,_0x11a1d6){return db[_0xd4a9('0x1e')][_0xd4a9('0x1f')](_0x1c445c['body'],{'raw':_0x1c445c['options']?_0x1c445c[_0xd4a9('0x1a')][_0xd4a9('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c445c[_0xd4a9('0x1a')]?_0x1c445c[_0xd4a9('0x1a')][_0xd4a9('0x20')]||null:null,'attributes':_0x1c445c[_0xd4a9('0x1a')]?_0x1c445c['options'][_0xd4a9('0x21')]||null:null,'limit':_0x1c445c[_0xd4a9('0x1a')]?_0x1c445c[_0xd4a9('0x1a')][_0xd4a9('0x22')]||null:null})[_0xd4a9('0xd')](function(_0x14cd1b){logger[_0xd4a9('0xe')]('UpdateVoiceDialReport',_0x1c445c);logger['debug'](_0xd4a9('0x1d'),_0x1c445c,JSON[_0xd4a9('0x1c')](_0x14cd1b));_0x179eaf(_0x14cd1b);})['catch'](function(_0x25b5f5){logger[_0xd4a9('0x13')](_0xd4a9('0x1d'),_0x25b5f5['message'],_0x1c445c);_0x11a1d6(_0x4dd95f['error'](0x1f4,_0x25b5f5[_0xd4a9('0x15')]));});});}; \ No newline at end of file +var _0xae0d=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','info','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceDialReport,\x20%s,\x20%s','message','result','catch','body','raw','then','CreateVoiceDialReport','VoiceDialReport','update','options','where','limit','UpdateVoiceDialReport','lodash'];(function(_0x1e8fef,_0x52615d){var _0x4e9d94=function(_0x595d3e){while(--_0x595d3e){_0x1e8fef['push'](_0x1e8fef['shift']());}};_0x4e9d94(++_0x52615d);}(_0xae0d,0x107));var _0xdae0=function(_0x2cde33,_0x315cfc){_0x2cde33=_0x2cde33-0x0;var _0x441759=_0xae0d[_0x2cde33];return _0x441759;};'use strict';var _=require(_0xdae0('0x0'));var util=require(_0xdae0('0x1'));var moment=require(_0xdae0('0x2'));var BPromise=require(_0xdae0('0x3'));var rs=require(_0xdae0('0x4'));var fs=require('fs');var Redis=require(_0xdae0('0x5'));var db=require(_0xdae0('0x6'))['db'];var utils=require(_0xdae0('0x7'));var logger=require(_0xdae0('0x8'))(_0xdae0('0x9'));var config=require('../../config/environment');var jayson=require(_0xdae0('0xa'));var client=jayson['client'][_0xdae0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x38a760,_0x208a6c,_0x122bd3){return new BPromise(function(_0x50aaa0,_0x25345e){return client['request'](_0x38a760,_0x122bd3)['then'](function(_0x595e72){logger[_0xdae0('0xc')]('VoiceDialReport,\x20%s,\x20%s',_0x208a6c,'request\x20sent');logger[_0xdae0('0xd')](_0xdae0('0xe'),_0x208a6c,_0xdae0('0xf'),JSON[_0xdae0('0x10')](_0x595e72));if(_0x595e72['error']){if(_0x595e72[_0xdae0('0x11')][_0xdae0('0x12')]===0x1f4){logger[_0xdae0('0x11')](_0xdae0('0x13'),_0x208a6c,_0x595e72['error'][_0xdae0('0x14')]);return _0x25345e(_0x595e72[_0xdae0('0x11')][_0xdae0('0x14')]);}logger['error'](_0xdae0('0x13'),_0x208a6c,_0x595e72[_0xdae0('0x11')][_0xdae0('0x14')]);return _0x50aaa0(_0x595e72[_0xdae0('0x11')]['message']);}else{logger['info'](_0xdae0('0x13'),_0x208a6c,_0xdae0('0xf'));_0x50aaa0(_0x595e72[_0xdae0('0x15')]['message']);}})[_0xdae0('0x16')](function(_0x25c5d4){logger[_0xdae0('0x11')](_0xdae0('0x13'),_0x208a6c,_0x25c5d4);_0x25345e(_0x25c5d4);});});}exports['CreateVoiceDialReport']=function(_0x565bcb){var _0x2c05ca=this;return new Promise(function(_0x27ca1e,_0x52f9ca){return db['VoiceDialReport']['create'](_0x565bcb[_0xdae0('0x17')],{'raw':_0x565bcb['options']?_0x565bcb['options'][_0xdae0('0x18')]===undefined?!![]:![]:!![]})[_0xdae0('0x19')](function(_0x5c0fab){logger['info'](_0xdae0('0x1a'),_0x565bcb);logger[_0xdae0('0xd')](_0xdae0('0x1a'),_0x565bcb,JSON[_0xdae0('0x10')](_0x5c0fab));_0x27ca1e(_0x5c0fab);})[_0xdae0('0x16')](function(_0x27737d){logger[_0xdae0('0x11')]('CreateVoiceDialReport',_0x27737d[_0xdae0('0x14')],_0x565bcb);_0x52f9ca(_0x2c05ca['error'](0x1f4,_0x27737d['message']));});});};exports['UpdateVoiceDialReport']=function(_0x293d75){var _0x3c35a1=this;return new Promise(function(_0x12ad6f,_0x342228){return db[_0xdae0('0x1b')][_0xdae0('0x1c')](_0x293d75['body'],{'raw':_0x293d75['options']?_0x293d75[_0xdae0('0x1d')][_0xdae0('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x293d75[_0xdae0('0x1d')]?_0x293d75['options'][_0xdae0('0x1e')]||null:null,'attributes':_0x293d75[_0xdae0('0x1d')]?_0x293d75['options']['attributes']||null:null,'limit':_0x293d75[_0xdae0('0x1d')]?_0x293d75[_0xdae0('0x1d')][_0xdae0('0x1f')]||null:null})['then'](function(_0x1b8cda){logger[_0xdae0('0xc')]('UpdateVoiceDialReport',_0x293d75);logger[_0xdae0('0xd')](_0xdae0('0x20'),_0x293d75,JSON[_0xdae0('0x10')](_0x1b8cda));_0x12ad6f(_0x1b8cda);})[_0xdae0('0x16')](function(_0x3b2a4f){logger['error'](_0xdae0('0x20'),_0x3b2a4f[_0xdae0('0x14')],_0x293d75);_0x342228(_0x3c35a1[_0xdae0('0x11')](0x1f4,_0x3b2a4f[_0xdae0('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index ea47ef2..17dc6ad 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 _0x2d8a=['isAuthenticated','index','/:id','show','post','create','/:id/applications','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get'];(function(_0x5d69a5,_0x1549c7){var _0x153227=function(_0x1f3cba){while(--_0x1f3cba){_0x5d69a5['push'](_0x5d69a5['shift']());}};_0x153227(++_0x1549c7);}(_0x2d8a,0x73));var _0xa2d8=function(_0x19d415,_0x143df5){_0x19d415=_0x19d415-0x0;var _0x59ac43=_0x2d8a[_0x19d415];return _0x59ac43;};'use strict';var multer=require(_0xa2d8('0x0'));var util=require(_0xa2d8('0x1'));var path=require('path');var timeout=require(_0xa2d8('0x2'));var express=require(_0xa2d8('0x3'));var router=express[_0xa2d8('0x4')]();var fs_extra=require(_0xa2d8('0x5'));var auth=require(_0xa2d8('0x6'));var interaction=require(_0xa2d8('0x7'));var config=require(_0xa2d8('0x8'));var controller=require(_0xa2d8('0x9'));router[_0xa2d8('0xa')]('/',auth[_0xa2d8('0xb')](),controller[_0xa2d8('0xc')]);router[_0xa2d8('0xa')](_0xa2d8('0xd'),auth[_0xa2d8('0xb')](),controller[_0xa2d8('0xe')]);router[_0xa2d8('0xf')]('/',auth[_0xa2d8('0xb')](),controller[_0xa2d8('0x10')]);router[_0xa2d8('0xf')](_0xa2d8('0x11'),auth['isAuthenticated'](),controller['addApplications']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xa2d8('0x12')]);router[_0xa2d8('0x13')](_0xa2d8('0xd'),auth[_0xa2d8('0xb')](),controller[_0xa2d8('0x14')]);module['exports']=router; \ No newline at end of file +var _0x4cfe=['show','post','create','put','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','index','isAuthenticated'];(function(_0x181d06,_0x44bf9f){var _0x2f84a0=function(_0x9afdb2){while(--_0x9afdb2){_0x181d06['push'](_0x181d06['shift']());}};_0x2f84a0(++_0x44bf9f);}(_0x4cfe,0x104));var _0xe4cf=function(_0x596f85,_0x22694e){_0x596f85=_0x596f85-0x0;var _0x5092b9=_0x4cfe[_0x596f85];return _0x5092b9;};'use strict';var multer=require(_0xe4cf('0x0'));var util=require(_0xe4cf('0x1'));var path=require(_0xe4cf('0x2'));var timeout=require(_0xe4cf('0x3'));var express=require(_0xe4cf('0x4'));var router=express[_0xe4cf('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xe4cf('0x6'));var interaction=require(_0xe4cf('0x7'));var config=require(_0xe4cf('0x8'));var controller=require(_0xe4cf('0x9'));router[_0xe4cf('0xa')]('/',auth['isAuthenticated'](),controller[_0xe4cf('0xb')]);router[_0xe4cf('0xa')]('/:id',auth[_0xe4cf('0xc')](),controller[_0xe4cf('0xd')]);router[_0xe4cf('0xe')]('/',auth[_0xe4cf('0xc')](),controller[_0xe4cf('0xf')]);router[_0xe4cf('0xe')]('/:id/applications',auth[_0xe4cf('0xc')](),controller['addApplications']);router[_0xe4cf('0x10')]('/:id',auth[_0xe4cf('0xc')](),controller['update']);router[_0xe4cf('0x11')](_0xe4cf('0x12'),auth[_0xe4cf('0xc')](),controller[_0xe4cf('0x13')]);module[_0xe4cf('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index b2e91ea..aaa4291 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 _0x83b2=['compositeIndex','STRING','NoOp','ENUM','inbound','outbound','internal','inbound-fax','system','any','INTEGER','wav','VIRTUAL','getDataValue','exten','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x83b2,0x174));var _0x283b=function(_0x268b44,_0x20fe4e){_0x268b44=_0x268b44-0x0;var _0x3bc9de=_0x83b2[_0x268b44];return _0x3bc9de;};'use strict';var Sequelize=require(_0x283b('0x0'));module[_0x283b('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x283b('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x283b('0x2')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0x283b('0x3')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x283b('0x3')],'allowNull':![],'defaultValue':_0x283b('0x4')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x283b('0x5')](_0x283b('0x6'),_0x283b('0x7'),_0x283b('0x8'),_0x283b('0x9'),'outbound-fax',_0x283b('0xa'),_0x283b('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0x283b('0x3')]},'interval':{'type':Sequelize[_0x283b('0x3')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0x283b('0xc')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0x283b('0x3')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x283b('0xc')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0x283b('0xd')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0x283b('0xe')],'get':function(_0x367189){return this[_0x283b('0xf')](_0x283b('0x10'));}},'alias':{'type':Sequelize[_0x283b('0x3')],'allowNull':!![]}}; \ No newline at end of file +var _0xf377=['inbound','outbound','internal','outbound-fax','system','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','sequelize','exports','STRING','compositeIndex','ENUM'];(function(_0x1832c5,_0x30682b){var _0x1eba69=function(_0x4c8dd1){while(--_0x4c8dd1){_0x1832c5['push'](_0x1832c5['shift']());}};_0x1eba69(++_0x30682b);}(_0xf377,0x1ea));var _0x7f37=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0xf377[_0x15bc81];return _0x59440e;};'use strict';var Sequelize=require(_0x7f37('0x0'));module[_0x7f37('0x1')]={'context':{'type':Sequelize[_0x7f37('0x2')],'allowNull':![],'unique':_0x7f37('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x7f37('0x2')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0x7f37('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x7f37('0x3')},'tag':{'type':Sequelize[_0x7f37('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0x7f37('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x7f37('0x4')](_0x7f37('0x5'),_0x7f37('0x6'),_0x7f37('0x7'),'inbound-fax',_0x7f37('0x8'),_0x7f37('0x9'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0x7f37('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0x7f37('0xa')]},'isApp':{'type':Sequelize[_0x7f37('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0x7f37('0xb')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x7f37('0xa')]},'recordingFormat':{'type':Sequelize[_0x7f37('0x2')],'defaultValue':_0x7f37('0xc')},'answer':{'type':Sequelize[_0x7f37('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x7f37('0xd')],'get':function(_0x4e3ce0){return this[_0x7f37('0xe')]('exten');}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index d7a8d1e..b8e1f10 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 _0x0b82=['params','keys','include','create','body','startsWith','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','inbound','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','findOne','sequelize','transaction','VoiceExtensionId','rewriteDial','true','createRouting','bulkCreate','cast(priority\x20as\x20unsigned)','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','./voiceExtension.socket','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','get','InboundRoutes','OutboundRoutes','outbound','InternalRoutes','filter','ignore','map','value','includes','find','name','UserProfileResource','error','stack','send','index','rawAttributes','type','key','model','intersection','query','fields','attributes','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options','includeAll','VoiceExtension','findAll','rows','catch','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0b82,0x92));var _0x20b8=function(_0x327b5e,_0x519464){_0x327b5e=_0x327b5e-0x0;var _0x4118fb=_0x0b82[_0x327b5e];return _0x4118fb;};'use strict';var emlformat=require(_0x20b8('0x0'));var rimraf=require(_0x20b8('0x1'));var zipdir=require(_0x20b8('0x2'));var jsonpatch=require(_0x20b8('0x3'));var rp=require(_0x20b8('0x4'));var moment=require(_0x20b8('0x5'));var BPromise=require(_0x20b8('0x6'));var Mustache=require(_0x20b8('0x7'));var util=require(_0x20b8('0x8'));var path=require(_0x20b8('0x9'));var sox=require(_0x20b8('0xa'));var csv=require(_0x20b8('0xb'));var ejs=require(_0x20b8('0xc'));var fs=require('fs');var fs_extra=require(_0x20b8('0xd'));var _=require(_0x20b8('0xe'));var squel=require(_0x20b8('0xf'));var crypto=require(_0x20b8('0x10'));var jsforce=require(_0x20b8('0x11'));var deskjs=require('desk.js');var toCsv=require(_0x20b8('0xb'));var querystring=require('querystring');var Papa=require(_0x20b8('0x12'));var Redis=require(_0x20b8('0x13'));var authService=require(_0x20b8('0x14'));var qs=require(_0x20b8('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x20b8('0x16'));var logger=require(_0x20b8('0x17'))(_0x20b8('0x18'));var utils=require(_0x20b8('0x19'));var config=require(_0x20b8('0x1a'));var licenseUtil=require(_0x20b8('0x1b'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x20b8('0x1c')](config[_0x20b8('0x1d')],{'host':_0x20b8('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x20b8('0x1f'))['register'](socket);function respondWithStatusCode(_0x1b66a3,_0x5b864d){_0x5b864d=_0x5b864d||0xcc;return function(_0x39033c){if(_0x39033c){return _0x1b66a3[_0x20b8('0x20')](_0x5b864d);}return _0x1b66a3[_0x20b8('0x21')](_0x5b864d)['end']();};}function respondWithResult(_0x5b88e6,_0x33ee5e){_0x33ee5e=_0x33ee5e||0xc8;return function(_0x1b414f){if(_0x1b414f){return _0x5b88e6[_0x20b8('0x21')](_0x33ee5e)[_0x20b8('0x22')](_0x1b414f);}};}function respondWithFilteredResult(_0x531be1,_0x49ac70){return function(_0x16dadb){if(_0x16dadb){var _0x561e80=typeof _0x49ac70['offset']===_0x20b8('0x23')&&typeof _0x49ac70[_0x20b8('0x24')]===_0x20b8('0x23');var _0x500df2=_0x16dadb[_0x20b8('0x25')];var _0x395593=_0x561e80?0x0:_0x49ac70['offset'];var _0x1bdc81=_0x561e80?_0x16dadb[_0x20b8('0x25')]:_0x49ac70[_0x20b8('0x26')]+_0x49ac70[_0x20b8('0x24')];var _0x16bf3b;if(_0x1bdc81>=_0x500df2){_0x1bdc81=_0x500df2;_0x16bf3b=0xc8;}else{_0x16bf3b=0xce;}_0x531be1[_0x20b8('0x21')](_0x16bf3b);return _0x531be1[_0x20b8('0x27')](_0x20b8('0x28'),_0x395593+'-'+_0x1bdc81+'/'+_0x500df2)[_0x20b8('0x22')](_0x16dadb);}return null;};}function patchUpdates(_0x308a65){return function(_0x2d7ef7){try{jsonpatch[_0x20b8('0x29')](_0x2d7ef7,_0x308a65,!![]);}catch(_0x298ae2){return BPromise[_0x20b8('0x2a')](_0x298ae2);}return _0x2d7ef7[_0x20b8('0x2b')]();};}function saveUpdates(_0x4ede13,_0x312b07){return function(_0x472199){if(_0x472199){return _0x472199['update'](_0x4ede13)[_0x20b8('0x2c')](function(_0x162013){return _0x162013;});}return null;};}function removeEntity(_0x5e6fbf,_0x2322f4){return function(_0x3f3eae){if(_0x3f3eae){return _0x3f3eae[_0x20b8('0x2d')]()['then'](function(){var _0x852325=_0x3f3eae[_0x20b8('0x2e')]({'plain':!![]});var _0x56c1e1=[{'name':_0x20b8('0x2f'),'value':'inbound','ignore':![]},{'name':_0x20b8('0x30'),'value':_0x20b8('0x31'),'ignore':![]},{'name':_0x20b8('0x32'),'value':'internal','ignore':![]}];var _0x33c9b6=_(_0x56c1e1)[_0x20b8('0x33')](_0x20b8('0x34'))[_0x20b8('0x35')](_0x20b8('0x36'))[_0x20b8('0x36')]();if(_[_0x20b8('0x37')](_0x33c9b6,_0x852325['type'])){return;}var _0x269d84=_[_0x20b8('0x38')](_0x56c1e1,[_0x20b8('0x36'),_0x852325['type']])[_0x20b8('0x39')];return db[_0x20b8('0x3a')][_0x20b8('0x2d')]({'where':{'type':_0x269d84,'resourceId':_0x852325['id']}})[_0x20b8('0x2c')](function(){return _0x3f3eae;});})[_0x20b8('0x2c')](function(){_0x5e6fbf[_0x20b8('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b5508,_0xf3aa0b){return function(_0xf83a67){if(!_0xf83a67){_0x3b5508[_0x20b8('0x20')](0x194);}return _0xf83a67;};}function handleError(_0x582050,_0x3eb7e7){_0x3eb7e7=_0x3eb7e7||0x1f4;return function(_0x2bed20){logger[_0x20b8('0x3b')](_0x2bed20[_0x20b8('0x3c')]);if(_0x2bed20[_0x20b8('0x39')]){delete _0x2bed20[_0x20b8('0x39')];}_0x582050['status'](_0x3eb7e7)[_0x20b8('0x3d')](_0x2bed20);};}exports[_0x20b8('0x3e')]=function(_0x2b932a,_0x4b2f3b){var _0x5f02a5={},_0x17d39d={},_0x301338={'count':0x0,'rows':[]};var _0x3490b4=_['map'](db['VoiceExtension'][_0x20b8('0x3f')],function(_0x2eac74){return{'name':_0x2eac74['fieldName'],'type':_0x2eac74[_0x20b8('0x40')][_0x20b8('0x41')]};});_0x17d39d[_0x20b8('0x42')]=_[_0x20b8('0x35')](_0x3490b4,'name');_0x17d39d['query']=_['keys'](_0x2b932a['query']);_0x17d39d['filters']=_[_0x20b8('0x43')](_0x17d39d[_0x20b8('0x42')],_0x17d39d[_0x20b8('0x44')]);_0x5f02a5['attributes']=_[_0x20b8('0x43')](_0x17d39d['model'],qs[_0x20b8('0x45')](_0x2b932a[_0x20b8('0x44')][_0x20b8('0x45')]));_0x5f02a5[_0x20b8('0x46')]=_0x5f02a5[_0x20b8('0x46')]['length']?_0x5f02a5[_0x20b8('0x46')]:_0x17d39d['model'];if(!_0x2b932a[_0x20b8('0x44')]['hasOwnProperty'](_0x20b8('0x47'))){_0x5f02a5[_0x20b8('0x24')]=qs[_0x20b8('0x24')](_0x2b932a[_0x20b8('0x44')]['limit']);_0x5f02a5[_0x20b8('0x26')]=qs['offset'](_0x2b932a[_0x20b8('0x44')][_0x20b8('0x26')]);}_0x5f02a5[_0x20b8('0x48')]=qs[_0x20b8('0x49')](_0x2b932a[_0x20b8('0x44')][_0x20b8('0x49')]);_0x5f02a5[_0x20b8('0x4a')]=qs[_0x20b8('0x4b')](_[_0x20b8('0x4c')](_0x2b932a[_0x20b8('0x44')],_0x17d39d[_0x20b8('0x4b')]),_0x3490b4);if(_0x2b932a[_0x20b8('0x44')][_0x20b8('0x33')]){_0x5f02a5[_0x20b8('0x4a')]=_[_0x20b8('0x4d')](_0x5f02a5[_0x20b8('0x4a')],{'$or':_[_0x20b8('0x35')](_0x3490b4,function(_0x5d7c94){if(_0x5d7c94[_0x20b8('0x40')]!==_0x20b8('0x4e')){var _0x4d2e6a={};_0x4d2e6a[_0x5d7c94[_0x20b8('0x39')]]={'$like':'%'+_0x2b932a[_0x20b8('0x44')][_0x20b8('0x33')]+'%'};return _0x4d2e6a;}})});}_0x5f02a5=_[_0x20b8('0x4d')]({},_0x5f02a5,_0x2b932a[_0x20b8('0x4f')]);var _0x56c70a={'where':_0x5f02a5[_0x20b8('0x4a')]};return db['VoiceExtension']['count'](_0x56c70a)[_0x20b8('0x2c')](function(_0x52cf43){_0x301338['count']=_0x52cf43;if(_0x2b932a[_0x20b8('0x44')][_0x20b8('0x50')]){_0x5f02a5['include']=[{'all':!![]}];}return db[_0x20b8('0x51')][_0x20b8('0x52')](_0x5f02a5);})[_0x20b8('0x2c')](function(_0x4566db){_0x301338[_0x20b8('0x53')]=_0x4566db;return _0x301338;})['then'](respondWithFilteredResult(_0x4b2f3b,_0x5f02a5))[_0x20b8('0x54')](handleError(_0x4b2f3b,null));};exports[_0x20b8('0x55')]=function(_0x39f5af,_0x1411c0){var _0x2441fa={'raw':![],'where':{'id':_0x39f5af[_0x20b8('0x56')]['id']}},_0x5711e8={};_0x5711e8['model']=_[_0x20b8('0x57')](db[_0x20b8('0x51')]['rawAttributes']);_0x5711e8[_0x20b8('0x44')]=_[_0x20b8('0x57')](_0x39f5af[_0x20b8('0x44')]);_0x5711e8[_0x20b8('0x4b')]=_['intersection'](_0x5711e8[_0x20b8('0x42')],_0x5711e8['query']);_0x2441fa[_0x20b8('0x46')]=_[_0x20b8('0x43')](_0x5711e8[_0x20b8('0x42')],qs[_0x20b8('0x45')](_0x39f5af['query'][_0x20b8('0x45')]));_0x2441fa[_0x20b8('0x46')]=_0x2441fa[_0x20b8('0x46')]['length']?_0x2441fa[_0x20b8('0x46')]:_0x5711e8[_0x20b8('0x42')];if(_0x39f5af[_0x20b8('0x44')][_0x20b8('0x50')]){_0x2441fa[_0x20b8('0x58')]=[{'all':!![]}];}_0x2441fa=_[_0x20b8('0x4d')]({},_0x2441fa,_0x39f5af[_0x20b8('0x4f')]);return db[_0x20b8('0x51')][_0x20b8('0x38')](_0x2441fa)[_0x20b8('0x2c')](handleEntityNotFound(_0x1411c0,null))[_0x20b8('0x2c')](respondWithResult(_0x1411c0,null))['catch'](handleError(_0x1411c0,null));};exports[_0x20b8('0x2d')]=function(_0x16471d,_0x1dbed0){return db[_0x20b8('0x51')][_0x20b8('0x38')]({'where':{'id':_0x16471d[_0x20b8('0x56')]['id']}})['then'](handleEntityNotFound(_0x1dbed0,null))['then'](removeEntity(_0x1dbed0,null))[_0x20b8('0x54')](handleError(_0x1dbed0,null));};exports[_0x20b8('0x59')]=function(_0x2c6bf8,_0x507f09){if(_0x2c6bf8[_0x20b8('0x5a')][_0x20b8('0x40')]===_0x20b8('0x31')&&!_[_0x20b8('0x5b')](_0x2c6bf8[_0x20b8('0x5a')][_0x20b8('0x5c')],'_')){_0x2c6bf8['body'][_0x20b8('0x5c')]='_'[_0x20b8('0x5d')](_0x2c6bf8[_0x20b8('0x5a')][_0x20b8('0x5c')]);}return db['VoiceExtension'][_0x20b8('0x59')](_0x2c6bf8[_0x20b8('0x5a')],{'raw':![]})['then'](function(_0x44a66f){var _0x7ff5b1=_0x2c6bf8[_0x20b8('0x5e')][_0x20b8('0x2e')]({'plain':!![]});if(!_0x7ff5b1)throw new Error(_0x20b8('0x5f'));if(_0x7ff5b1[_0x20b8('0x60')]===_0x20b8('0x5e')){var _0x5c8a4c=_0x44a66f[_0x20b8('0x2e')]({'plain':!![]});var _0x67414d=[{'name':'InboundRoutes','value':_0x20b8('0x61')},{'name':_0x20b8('0x30'),'value':_0x20b8('0x31')},{'name':'InternalRoutes','value':'internal'}];var _0x45a380=_[_0x20b8('0x38')](_0x67414d,[_0x20b8('0x36'),_0x5c8a4c[_0x20b8('0x40')]])[_0x20b8('0x39')];return db[_0x20b8('0x62')][_0x20b8('0x38')]({'where':{'name':_0x45a380,'userProfileId':_0x7ff5b1['userProfileId']},'raw':!![]})[_0x20b8('0x2c')](function(_0x6bfe81){if(_0x6bfe81&&_0x6bfe81['autoAssociation']===0x0){return db[_0x20b8('0x3a')][_0x20b8('0x59')]({'name':_0x5c8a4c['name'],'resourceId':_0x5c8a4c['id'],'type':_0x6bfe81['name'],'sectionId':_0x6bfe81['id']},{})[_0x20b8('0x2c')](function(){return _0x44a66f;});}else{return _0x44a66f;}})['catch'](function(_0x4de830){logger[_0x20b8('0x3b')](_0x20b8('0x63'),_0x4de830);throw _0x4de830;});}return _0x44a66f;})['then'](respondWithResult(_0x507f09,0xc9))[_0x20b8('0x54')](handleError(_0x507f09,null));};exports[_0x20b8('0x64')]=function(_0x407fef,_0xa1786){if(_0x407fef[_0x20b8('0x5a')]['id']){delete _0x407fef[_0x20b8('0x5a')]['id'];}return db[_0x20b8('0x51')][_0x20b8('0x38')]({'where':{'id':_0x407fef[_0x20b8('0x56')]['id']}})[_0x20b8('0x2c')](handleEntityNotFound(_0xa1786,null))[_0x20b8('0x2c')](function(_0x4c3a62){if(_0x4c3a62){return db[_0x20b8('0x51')][_0x20b8('0x64')](_['pick'](_0x407fef['body'],[_0x20b8('0x5c'),_0x20b8('0x65'),'description',_0x20b8('0x66'),_0x20b8('0x67'),_0x20b8('0x68'),_0x20b8('0x69')]),{'where':{'context':_0x4c3a62[_0x20b8('0x65')],'exten':_0x4c3a62[_0x20b8('0x5c')]},'individualHooks':!![]})[_0x20b8('0x2c')](function(_0x35998d){return _0x35998d;});}return null;})[_0x20b8('0x2c')](respondWithStatusCode(_0xa1786,null))['catch'](handleError(_0xa1786,null));};exports[_0x20b8('0x6a')]=function(_0x921e14,_0x1bec56){return db[_0x20b8('0x51')][_0x20b8('0x6b')]({'where':{'id':_0x921e14['params']['id']}})['then'](function(_0x591983){if(_0x591983){return db[_0x20b8('0x6c')][_0x20b8('0x6d')](function(_0x2cd237){return db[_0x20b8('0x51')]['destroy']({'where':{'VoiceExtensionId':_0x921e14['params']['id']},'transaction':_0x2cd237})['then'](function(){var _0x16258d=_[_0x20b8('0x35')](_0x921e14[_0x20b8('0x5a')],function(_0x4bafdc){_0x4bafdc[_0x20b8('0x6e')]=_0x921e14[_0x20b8('0x56')]['id'];_0x4bafdc['isApp']=!![];return _0x4bafdc;});var _0x51b639=_0x921e14['query'][_0x20b8('0x6f')]&&_0x921e14[_0x20b8('0x44')]['rewriteDial']['toLowerCase']()===_0x20b8('0x70')?!![]:![];return _0x591983[_0x20b8('0x71')](_0x16258d,_0x51b639);})[_0x20b8('0x2c')](function(_0x24914b){return db[_0x20b8('0x51')][_0x20b8('0x72')](_0x24914b,{'transaction':_0x2cd237});});})[_0x20b8('0x2c')](function(){return db[_0x20b8('0x51')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x921e14['params']['id']},'order':_0x20b8('0x73')});});}})['then'](respondWithResult(_0x1bec56,null))['catch'](handleError(_0x1bec56,null));}; \ No newline at end of file +var _0x0c9d=['addApplications','findOne','sequelize','transaction','VoiceExtensionId','rewriteDial','toLowerCase','true','createRouting','bulkCreate','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','offset','undefined','count','limit','apply','reject','save','update','then','destroy','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','map','value','includes','find','type','end','error','stack','name','send','index','VoiceExtension','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','startsWith','concat','exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','description','cutdigits','alias'];(function(_0x1652c9,_0x4cb5f5){var _0x387cf7=function(_0x3cc7bd){while(--_0x3cc7bd){_0x1652c9['push'](_0x1652c9['shift']());}};_0x387cf7(++_0x4cb5f5);}(_0x0c9d,0xf4));var _0xd0c9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c9d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xd0c9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd0c9('0x1'));var jsonpatch=require(_0xd0c9('0x2'));var rp=require(_0xd0c9('0x3'));var moment=require(_0xd0c9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd0c9('0x5'));var util=require(_0xd0c9('0x6'));var path=require(_0xd0c9('0x7'));var sox=require(_0xd0c9('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(_0xd0c9('0x9'));var crypto=require(_0xd0c9('0xa'));var jsforce=require(_0xd0c9('0xb'));var deskjs=require(_0xd0c9('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd0c9('0xd'));var Papa=require(_0xd0c9('0xe'));var Redis=require(_0xd0c9('0xf'));var authService=require(_0xd0c9('0x10'));var qs=require(_0xd0c9('0x11'));var as=require(_0xd0c9('0x12'));var hardwareService=require(_0xd0c9('0x13'));var logger=require(_0xd0c9('0x14'))(_0xd0c9('0x15'));var utils=require(_0xd0c9('0x16'));var config=require(_0xd0c9('0x17'));var licenseUtil=require(_0xd0c9('0x18'));var db=require(_0xd0c9('0x19'))['db'];config[_0xd0c9('0x1a')]=_[_0xd0c9('0x1b')](config[_0xd0c9('0x1a')],{'host':_0xd0c9('0x1c'),'port':0x18eb});var socket=require(_0xd0c9('0x1d'))(new Redis(config[_0xd0c9('0x1a')]));require(_0xd0c9('0x1e'))[_0xd0c9('0x1f')](socket);function respondWithStatusCode(_0x4fdf7f,_0x1c4323){_0x1c4323=_0x1c4323||0xcc;return function(_0x2dbd37){if(_0x2dbd37){return _0x4fdf7f[_0xd0c9('0x20')](_0x1c4323);}return _0x4fdf7f[_0xd0c9('0x21')](_0x1c4323)['end']();};}function respondWithResult(_0x54d3f6,_0x4b1996){_0x4b1996=_0x4b1996||0xc8;return function(_0x4a225c){if(_0x4a225c){return _0x54d3f6[_0xd0c9('0x21')](_0x4b1996)['json'](_0x4a225c);}};}function respondWithFilteredResult(_0x4201f4,_0x34d517){return function(_0x14c6ea){if(_0x14c6ea){var _0x4e8029=typeof _0x34d517[_0xd0c9('0x22')]===_0xd0c9('0x23')&&typeof _0x34d517['limit']===_0xd0c9('0x23');var _0x3c84c6=_0x14c6ea['count'];var _0x1f8444=_0x4e8029?0x0:_0x34d517[_0xd0c9('0x22')];var _0x26d4e4=_0x4e8029?_0x14c6ea[_0xd0c9('0x24')]:_0x34d517[_0xd0c9('0x22')]+_0x34d517[_0xd0c9('0x25')];var _0x49e35a;if(_0x26d4e4>=_0x3c84c6){_0x26d4e4=_0x3c84c6;_0x49e35a=0xc8;}else{_0x49e35a=0xce;}_0x4201f4[_0xd0c9('0x21')](_0x49e35a);return _0x4201f4['set']('Content-Range',_0x1f8444+'-'+_0x26d4e4+'/'+_0x3c84c6)['json'](_0x14c6ea);}return null;};}function patchUpdates(_0x219d64){return function(_0x59e9b1){try{jsonpatch[_0xd0c9('0x26')](_0x59e9b1,_0x219d64,!![]);}catch(_0x4ccb1c){return BPromise[_0xd0c9('0x27')](_0x4ccb1c);}return _0x59e9b1[_0xd0c9('0x28')]();};}function saveUpdates(_0x2157cb,_0x546a1b){return function(_0xed747d){if(_0xed747d){return _0xed747d[_0xd0c9('0x29')](_0x2157cb)[_0xd0c9('0x2a')](function(_0x1b6538){return _0x1b6538;});}return null;};}function removeEntity(_0x10155a,_0xa02691){return function(_0x1d8a26){if(_0x1d8a26){return _0x1d8a26[_0xd0c9('0x2b')]()[_0xd0c9('0x2a')](function(){var _0x5041af=_0x1d8a26[_0xd0c9('0x2c')]({'plain':!![]});var _0x206374=[{'name':_0xd0c9('0x2d'),'value':_0xd0c9('0x2e'),'ignore':![]},{'name':_0xd0c9('0x2f'),'value':_0xd0c9('0x30'),'ignore':![]},{'name':_0xd0c9('0x31'),'value':_0xd0c9('0x32'),'ignore':![]}];var _0xfddcc1=_(_0x206374)[_0xd0c9('0x33')]('ignore')[_0xd0c9('0x34')](_0xd0c9('0x35'))[_0xd0c9('0x35')]();if(_[_0xd0c9('0x36')](_0xfddcc1,_0x5041af['type'])){return;}var _0x1e00bc=_[_0xd0c9('0x37')](_0x206374,[_0xd0c9('0x35'),_0x5041af[_0xd0c9('0x38')]])['name'];return db['UserProfileResource'][_0xd0c9('0x2b')]({'where':{'type':_0x1e00bc,'resourceId':_0x5041af['id']}})[_0xd0c9('0x2a')](function(){return _0x1d8a26;});})[_0xd0c9('0x2a')](function(){_0x10155a[_0xd0c9('0x21')](0xcc)[_0xd0c9('0x39')]();});}};}function handleEntityNotFound(_0x5eaf9f,_0x1d39f8){return function(_0x32b6e6){if(!_0x32b6e6){_0x5eaf9f[_0xd0c9('0x20')](0x194);}return _0x32b6e6;};}function handleError(_0x504953,_0xf1b8a7){_0xf1b8a7=_0xf1b8a7||0x1f4;return function(_0x45006f){logger[_0xd0c9('0x3a')](_0x45006f[_0xd0c9('0x3b')]);if(_0x45006f[_0xd0c9('0x3c')]){delete _0x45006f[_0xd0c9('0x3c')];}_0x504953['status'](_0xf1b8a7)[_0xd0c9('0x3d')](_0x45006f);};}exports[_0xd0c9('0x3e')]=function(_0x590a92,_0x383269){var _0x3b0178={},_0x6f556e={},_0x115bd2={'count':0x0,'rows':[]};var _0x6a61c7=_[_0xd0c9('0x34')](db[_0xd0c9('0x3f')][_0xd0c9('0x40')],function(_0x440d96){return{'name':_0x440d96[_0xd0c9('0x41')],'type':_0x440d96[_0xd0c9('0x38')][_0xd0c9('0x42')]};});_0x6f556e[_0xd0c9('0x43')]=_[_0xd0c9('0x34')](_0x6a61c7,_0xd0c9('0x3c'));_0x6f556e[_0xd0c9('0x44')]=_[_0xd0c9('0x45')](_0x590a92[_0xd0c9('0x44')]);_0x6f556e[_0xd0c9('0x46')]=_[_0xd0c9('0x47')](_0x6f556e[_0xd0c9('0x43')],_0x6f556e['query']);_0x3b0178[_0xd0c9('0x48')]=_[_0xd0c9('0x47')](_0x6f556e[_0xd0c9('0x43')],qs[_0xd0c9('0x49')](_0x590a92[_0xd0c9('0x44')][_0xd0c9('0x49')]));_0x3b0178[_0xd0c9('0x48')]=_0x3b0178[_0xd0c9('0x48')][_0xd0c9('0x4a')]?_0x3b0178['attributes']:_0x6f556e['model'];if(!_0x590a92[_0xd0c9('0x44')][_0xd0c9('0x4b')]('nolimit')){_0x3b0178[_0xd0c9('0x25')]=qs[_0xd0c9('0x25')](_0x590a92['query']['limit']);_0x3b0178[_0xd0c9('0x22')]=qs['offset'](_0x590a92[_0xd0c9('0x44')]['offset']);}_0x3b0178[_0xd0c9('0x4c')]=qs[_0xd0c9('0x4d')](_0x590a92[_0xd0c9('0x44')][_0xd0c9('0x4d')]);_0x3b0178['where']=qs[_0xd0c9('0x46')](_[_0xd0c9('0x4e')](_0x590a92['query'],_0x6f556e[_0xd0c9('0x46')]),_0x6a61c7);if(_0x590a92['query'][_0xd0c9('0x33')]){_0x3b0178[_0xd0c9('0x4f')]=_[_0xd0c9('0x50')](_0x3b0178[_0xd0c9('0x4f')],{'$or':_[_0xd0c9('0x34')](_0x6a61c7,function(_0x2d4390){if(_0x2d4390[_0xd0c9('0x38')]!==_0xd0c9('0x51')){var _0x204bde={};_0x204bde[_0x2d4390[_0xd0c9('0x3c')]]={'$like':'%'+_0x590a92[_0xd0c9('0x44')][_0xd0c9('0x33')]+'%'};return _0x204bde;}})});}_0x3b0178=_[_0xd0c9('0x50')]({},_0x3b0178,_0x590a92[_0xd0c9('0x52')]);var _0x1b514c={'where':_0x3b0178[_0xd0c9('0x4f')]};return db['VoiceExtension']['count'](_0x1b514c)['then'](function(_0x1f33f4){_0x115bd2[_0xd0c9('0x24')]=_0x1f33f4;if(_0x590a92['query'][_0xd0c9('0x53')]){_0x3b0178[_0xd0c9('0x54')]=[{'all':!![]}];}return db[_0xd0c9('0x3f')][_0xd0c9('0x55')](_0x3b0178);})['then'](function(_0x1a034a){_0x115bd2[_0xd0c9('0x56')]=_0x1a034a;return _0x115bd2;})[_0xd0c9('0x2a')](respondWithFilteredResult(_0x383269,_0x3b0178))[_0xd0c9('0x57')](handleError(_0x383269,null));};exports[_0xd0c9('0x58')]=function(_0x232677,_0xe09971){var _0xae1cf5={'raw':![],'where':{'id':_0x232677[_0xd0c9('0x59')]['id']}},_0x10bfb7={};_0x10bfb7[_0xd0c9('0x43')]=_[_0xd0c9('0x45')](db[_0xd0c9('0x3f')]['rawAttributes']);_0x10bfb7['query']=_[_0xd0c9('0x45')](_0x232677[_0xd0c9('0x44')]);_0x10bfb7[_0xd0c9('0x46')]=_['intersection'](_0x10bfb7['model'],_0x10bfb7['query']);_0xae1cf5[_0xd0c9('0x48')]=_[_0xd0c9('0x47')](_0x10bfb7[_0xd0c9('0x43')],qs[_0xd0c9('0x49')](_0x232677[_0xd0c9('0x44')]['fields']));_0xae1cf5[_0xd0c9('0x48')]=_0xae1cf5['attributes'][_0xd0c9('0x4a')]?_0xae1cf5[_0xd0c9('0x48')]:_0x10bfb7[_0xd0c9('0x43')];if(_0x232677[_0xd0c9('0x44')]['includeAll']){_0xae1cf5['include']=[{'all':!![]}];}_0xae1cf5=_[_0xd0c9('0x50')]({},_0xae1cf5,_0x232677['options']);return db[_0xd0c9('0x3f')][_0xd0c9('0x37')](_0xae1cf5)[_0xd0c9('0x2a')](handleEntityNotFound(_0xe09971,null))[_0xd0c9('0x2a')](respondWithResult(_0xe09971,null))[_0xd0c9('0x57')](handleError(_0xe09971,null));};exports[_0xd0c9('0x2b')]=function(_0x391139,_0x4a9e19){return db[_0xd0c9('0x3f')][_0xd0c9('0x37')]({'where':{'id':_0x391139[_0xd0c9('0x59')]['id']}})['then'](handleEntityNotFound(_0x4a9e19,null))['then'](removeEntity(_0x4a9e19,null))[_0xd0c9('0x57')](handleError(_0x4a9e19,null));};exports[_0xd0c9('0x5a')]=function(_0x430ff8,_0x2b63e9){if(_0x430ff8[_0xd0c9('0x5b')][_0xd0c9('0x38')]==='outbound'&&!_[_0xd0c9('0x5c')](_0x430ff8[_0xd0c9('0x5b')]['exten'],'_')){_0x430ff8[_0xd0c9('0x5b')]['exten']='_'[_0xd0c9('0x5d')](_0x430ff8[_0xd0c9('0x5b')][_0xd0c9('0x5e')]);}return db[_0xd0c9('0x3f')][_0xd0c9('0x5a')](_0x430ff8[_0xd0c9('0x5b')],{'raw':![]})[_0xd0c9('0x2a')](function(_0x1273b1){var _0x43c33c=_0x430ff8[_0xd0c9('0x5f')]['get']({'plain':!![]});if(!_0x43c33c)throw new Error(_0xd0c9('0x60'));if(_0x43c33c[_0xd0c9('0x61')]===_0xd0c9('0x5f')){var _0x1add8e=_0x1273b1[_0xd0c9('0x2c')]({'plain':!![]});var _0x19403c=[{'name':_0xd0c9('0x2d'),'value':_0xd0c9('0x2e')},{'name':_0xd0c9('0x2f'),'value':_0xd0c9('0x30')},{'name':'InternalRoutes','value':_0xd0c9('0x32')}];var _0x2f6a75=_['find'](_0x19403c,['value',_0x1add8e[_0xd0c9('0x38')]])[_0xd0c9('0x3c')];return db[_0xd0c9('0x62')][_0xd0c9('0x37')]({'where':{'name':_0x2f6a75,'userProfileId':_0x43c33c[_0xd0c9('0x63')]},'raw':!![]})[_0xd0c9('0x2a')](function(_0x2866f0){if(_0x2866f0&&_0x2866f0[_0xd0c9('0x64')]===0x0){return db[_0xd0c9('0x65')][_0xd0c9('0x5a')]({'name':_0x1add8e['name'],'resourceId':_0x1add8e['id'],'type':_0x2866f0[_0xd0c9('0x3c')],'sectionId':_0x2866f0['id']},{})[_0xd0c9('0x2a')](function(){return _0x1273b1;});}else{return _0x1273b1;}})[_0xd0c9('0x57')](function(_0x550e42){logger[_0xd0c9('0x3a')](_0xd0c9('0x66'),_0x550e42);throw _0x550e42;});}return _0x1273b1;})['then'](respondWithResult(_0x2b63e9,0xc9))['catch'](handleError(_0x2b63e9,null));};exports['update']=function(_0x427480,_0x53a9e3){if(_0x427480[_0xd0c9('0x5b')]['id']){delete _0x427480[_0xd0c9('0x5b')]['id'];}return db[_0xd0c9('0x3f')][_0xd0c9('0x37')]({'where':{'id':_0x427480[_0xd0c9('0x59')]['id']}})[_0xd0c9('0x2a')](handleEntityNotFound(_0x53a9e3,null))[_0xd0c9('0x2a')](function(_0x3b40a1){if(_0x3b40a1){return db['VoiceExtension'][_0xd0c9('0x29')](_[_0xd0c9('0x4e')](_0x427480['body'],['exten',_0xd0c9('0x67'),_0xd0c9('0x68'),'recordingFormat',_0xd0c9('0x69'),'mandatoryDisposition',_0xd0c9('0x6a')]),{'where':{'context':_0x3b40a1['context'],'exten':_0x3b40a1['exten']},'individualHooks':!![]})[_0xd0c9('0x2a')](function(_0x485287){return _0x485287;});}return null;})[_0xd0c9('0x2a')](respondWithStatusCode(_0x53a9e3,null))[_0xd0c9('0x57')](handleError(_0x53a9e3,null));};exports[_0xd0c9('0x6b')]=function(_0x460ef0,_0x5c75c0){return db['VoiceExtension'][_0xd0c9('0x6c')]({'where':{'id':_0x460ef0[_0xd0c9('0x59')]['id']}})[_0xd0c9('0x2a')](function(_0x49f49c){if(_0x49f49c){return db[_0xd0c9('0x6d')][_0xd0c9('0x6e')](function(_0xb4bbe4){return db[_0xd0c9('0x3f')][_0xd0c9('0x2b')]({'where':{'VoiceExtensionId':_0x460ef0[_0xd0c9('0x59')]['id']},'transaction':_0xb4bbe4})['then'](function(){var _0x1468d4=_[_0xd0c9('0x34')](_0x460ef0[_0xd0c9('0x5b')],function(_0x497b5b){_0x497b5b[_0xd0c9('0x6f')]=_0x460ef0['params']['id'];_0x497b5b['isApp']=!![];return _0x497b5b;});var _0x1f63c1=_0x460ef0['query']['rewriteDial']&&_0x460ef0[_0xd0c9('0x44')][_0xd0c9('0x70')][_0xd0c9('0x71')]()===_0xd0c9('0x72')?!![]:![];return _0x49f49c[_0xd0c9('0x73')](_0x1468d4,_0x1f63c1);})['then'](function(_0xf0057a){return db[_0xd0c9('0x3f')][_0xd0c9('0x74')](_0xf0057a,{'transaction':_0xb4bbe4});});})[_0xd0c9('0x2a')](function(){return db[_0xd0c9('0x3f')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x460ef0['params']['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})[_0xd0c9('0x2a')](respondWithResult(_0x5c75c0,null))[_0xd0c9('0x57')](handleError(_0x5c75c0,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 531c81c..ad75fe9 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 _0x3512=['VoiceExtension','setMaxListeners','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x1a88f9,_0x3fd16c){var _0x400c80=function(_0x210cc5){while(--_0x210cc5){_0x1a88f9['push'](_0x1a88f9['shift']());}};_0x400c80(++_0x3fd16c);}(_0x3512,0x1b7));var _0x2351=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x3512[_0x59ee6f];return _0x4c0979;};'use strict';var EventEmitter=require(_0x2351('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0x2351('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x2351('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2351('0x3'),'afterDestroy':_0x2351('0x4')};function emitEvent(_0x48961d){return function(_0x37b138,_0x3bbf95,_0xb96388){VoiceExtensionEvents[_0x2351('0x5')](_0x48961d+':'+_0x37b138['id'],_0x37b138);VoiceExtensionEvents[_0x2351('0x5')](_0x48961d,_0x37b138);_0xb96388(null);};}for(var e in events){if(events[_0x2351('0x6')](e)){var event=events[e];VoiceExtension[_0x2351('0x7')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file +var _0x40ce=['exports','events','../../mysqldb','setMaxListeners','save','remove','hasOwnProperty','hook'];(function(_0x1c527d,_0x1d78e9){var _0x5d0279=function(_0x328ffe){while(--_0x328ffe){_0x1c527d['push'](_0x1c527d['shift']());}};_0x5d0279(++_0x1d78e9);}(_0x40ce,0x129));var _0xe40c=function(_0x1e401c,_0x46fc83){_0x1e401c=_0x1e401c-0x0;var _0x2f3d00=_0x40ce[_0x1e401c];return _0x2f3d00;};'use strict';var EventEmitter=require(_0xe40c('0x0'));var VoiceExtension=require(_0xe40c('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xe40c('0x2')](0x0);var events={'afterCreate':_0xe40c('0x3'),'afterUpdate':'update','afterDestroy':_0xe40c('0x4')};function emitEvent(_0x25a568){return function(_0x4a8396,_0x23dbac,_0x61d059){VoiceExtensionEvents['emit'](_0x25a568+':'+_0x4a8396['id'],_0x4a8396);VoiceExtensionEvents['emit'](_0x25a568,_0x4a8396);_0x61d059(null);};}for(var e in events){if(events[_0xe40c('0x5')](e)){var event=events[e];VoiceExtension[_0xe40c('0x6')](e,emitEvent(event));}}module[_0xe40c('0x7')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 2f949ce..43e173e 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 _0xb7d4=['exten','alias','CDR(routeAlias)=','CDR(routeid)=','push','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','NoOp','CDR(destination)=','cutdigits','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url','length','param','phone','prefix','${EXTEN:','join','none','indexOf','U(xcally-mixmonitor-context)','isEmpty','Interval','findAll','interval','IntervalId','then','intervals','map','filter','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','appType','custom','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','priority','last','define','voice_extensions','util','lodash','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','context'];(function(_0x5a6333,_0x270dea){var _0x1244c6=function(_0x4dae26){while(--_0x4dae26){_0x5a6333['push'](_0x5a6333['shift']());}};_0x1244c6(++_0x270dea);}(_0xb7d4,0x1b3));var _0x4b7d=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xb7d4[_0x4b2436];return _0x4f5ab2;};'use strict';var util=require(_0x4b7d('0x0'));var _=require(_0x4b7d('0x1'));var attributes=require(_0x4b7d('0x2'));module[_0x4b7d('0x3')]=function(_0x49a837){var _0x16d4ab=_0x49a837[_0x4b7d('0x4')];function _0x27186b(_0x42e763){var _0x6d376f=0x2;var _0xe5d9f2=[{'type':_0x42e763[_0x4b7d('0x5')],'app':_0x4b7d('0x6'),'appdata':_0x4b7d('0x7')+_0x42e763[_0x4b7d('0x5')],'context':_0x42e763[_0x4b7d('0x8')],'exten':_0x42e763[_0x4b7d('0x9')],'priority':_0x6d376f++,'VoiceExtensionId':_0x42e763['id']},{'type':_0x42e763[_0x4b7d('0x5')],'app':_0x42e763[_0x4b7d('0xa')]?_0x4b7d('0x6'):'NoOp','appdata':_0x42e763[_0x4b7d('0xa')]?_0x4b7d('0xb')+_0x42e763[_0x4b7d('0xa')]:'No\x20alias\x20set','context':_0x42e763['context'],'exten':_0x42e763['exten'],'priority':_0x6d376f++,'VoiceExtensionId':_0x42e763['id']}];if(_0x42e763[_0x4b7d('0x5')]==='inbound'){_0xe5d9f2['push']({'type':'inbound','app':_0x4b7d('0x6'),'appdata':_0x4b7d('0xc')+_0x42e763['id'],'context':_0x42e763[_0x4b7d('0x8')],'exten':_0x42e763[_0x4b7d('0x9')],'priority':_0x6d376f++,'VoiceExtensionId':_0x42e763['id']});}_0xe5d9f2[_0x4b7d('0xd')]({'type':_0x42e763[_0x4b7d('0x5')],'app':_0x4b7d('0x6'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x42e763['context'],'exten':_0x42e763[_0x4b7d('0x9')],'priority':_0x6d376f++,'VoiceExtensionId':_0x42e763['id']},{'type':_0x42e763[_0x4b7d('0x5')],'app':_0x4b7d('0x6'),'appdata':_0x4b7d('0xe'),'context':_0x42e763[_0x4b7d('0x8')],'exten':_0x42e763['exten'],'priority':_0x6d376f++,'VoiceExtensionId':_0x42e763['id']},{'type':_0x42e763[_0x4b7d('0x5')],'app':_0x4b7d('0x6'),'appdata':_0x4b7d('0xf'),'context':_0x42e763[_0x4b7d('0x8')],'exten':_0x42e763[_0x4b7d('0x9')],'priority':_0x6d376f++,'VoiceExtensionId':_0x42e763['id']});return _0xe5d9f2;}function _0x5ab59f(_0x5a5ff3){var _0x28f10b=0x2;var _0x1287f1=[{'type':_0x4b7d('0x10'),'app':'Set','appdata':_0x4b7d('0x11'),'context':_0x5a5ff3[_0x4b7d('0x8')],'exten':_0x5a5ff3[_0x4b7d('0x9')],'priority':_0x28f10b++,'VoiceExtensionId':_0x5a5ff3['id']},{'type':_0x4b7d('0x10'),'app':_0x5a5ff3['alias']?'Set':_0x4b7d('0x12'),'appdata':_0x5a5ff3[_0x4b7d('0xa')]?_0x4b7d('0xb')+_0x5a5ff3[_0x4b7d('0xa')]:'No\x20alias\x20set','context':_0x5a5ff3['context'],'exten':_0x5a5ff3[_0x4b7d('0x9')],'priority':_0x28f10b++,'VoiceExtensionId':_0x5a5ff3['id']},{'type':'outbound','app':_0x4b7d('0x6'),'appdata':_0x4b7d('0x13')+(_0x5a5ff3['cutdigits']?'${EXTEN:'+_0x5a5ff3[_0x4b7d('0x14')]+'}':'${EXTEN}'),'context':_0x5a5ff3[_0x4b7d('0x8')],'exten':_0x5a5ff3[_0x4b7d('0x9')],'priority':_0x28f10b++,'VoiceExtensionId':_0x5a5ff3['id']},{'type':'outbound','app':'Set','appdata':_0x4b7d('0xc')+_0x5a5ff3['id'],'context':_0x5a5ff3[_0x4b7d('0x8')],'exten':_0x5a5ff3[_0x4b7d('0x9')],'priority':_0x28f10b++,'VoiceExtensionId':_0x5a5ff3['id']},{'type':_0x4b7d('0x10'),'app':_0x4b7d('0x15'),'appdata':_0x4b7d('0x16')+(_0x28f10b+0x2)+_0x4b7d('0x17')+(_0x28f10b+0x1)+')','context':_0x5a5ff3[_0x4b7d('0x8')],'exten':_0x5a5ff3[_0x4b7d('0x9')],'priority':_0x28f10b++,'VoiceExtensionId':_0x5a5ff3['id']},{'type':_0x4b7d('0x10'),'app':_0x4b7d('0x6'),'appdata':_0x5a5ff3[_0x4b7d('0x14')]?_0x4b7d('0x18')+_0x5a5ff3['cutdigits']+'}':_0x4b7d('0x19'),'context':_0x5a5ff3['context'],'exten':_0x5a5ff3[_0x4b7d('0x9')],'priority':_0x28f10b++,'VoiceExtensionId':_0x5a5ff3['id']},{'type':_0x4b7d('0x10'),'app':_0x4b7d('0x6'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x5a5ff3[_0x4b7d('0x8')],'exten':_0x5a5ff3[_0x4b7d('0x9')],'priority':_0x28f10b++,'VoiceExtensionId':_0x5a5ff3['id']},{'type':'outbound','app':_0x4b7d('0x6'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x5a5ff3[_0x4b7d('0x8')],'exten':_0x5a5ff3[_0x4b7d('0x9')],'priority':_0x28f10b++,'VoiceExtensionId':_0x5a5ff3['id']},{'type':_0x4b7d('0x10'),'app':_0x4b7d('0x6'),'appdata':_0x4b7d('0xf'),'context':_0x5a5ff3[_0x4b7d('0x8')],'exten':_0x5a5ff3[_0x4b7d('0x9')],'priority':_0x28f10b++,'VoiceExtensionId':_0x5a5ff3['id']},{'type':'outbound','app':_0x4b7d('0x6'),'appdata':_0x4b7d('0x1a')+_0x5a5ff3['id'],'context':_0x5a5ff3[_0x4b7d('0x8')],'exten':_0x5a5ff3[_0x4b7d('0x9')],'priority':_0x28f10b++,'VoiceExtensionId':_0x5a5ff3['id']}];if(_0x5a5ff3[_0x4b7d('0x1b')](_0x4b7d('0x1c'))&&_0x5a5ff3[_0x4b7d('0x1c')]!=='none'){_0x1287f1[_0x4b7d('0xd')]({'type':_0x4b7d('0x10'),'app':_0x4b7d('0x6'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x5a5ff3['context'],'exten':_0x5a5ff3[_0x4b7d('0x9')],'priority':_0x28f10b++,'VoiceExtensionId':_0x5a5ff3['id']},{'type':_0x4b7d('0x10'),'app':'Set','appdata':_0x4b7d('0x1d')+_0x5a5ff3[_0x4b7d('0x1c')]||_0x4b7d('0x1e'),'context':_0x5a5ff3[_0x4b7d('0x8')],'exten':_0x5a5ff3[_0x4b7d('0x9')],'priority':_0x28f10b++,'VoiceExtensionId':_0x5a5ff3['id']});}return _0x1287f1;}function _0x5bdb23(_0xd3c5a7){var _0x570ac4=[{'name':_0x4b7d('0x1f'),'param':0x0},{'name':_0x4b7d('0x20'),'param':0x1},{'name':_0x4b7d('0x21'),'param':0x2},{'name':_0x4b7d('0x22'),'param':0x3}];var _0x5200a6={};var _0x43e077=_0xd3c5a7['split'](',');var _0x2118c0=[];for(var _0x4c86ba=0x0;_0x4c86ba<_0x570ac4[_0x4b7d('0x23')];_0x4c86ba++){switch(_0x570ac4[_0x4c86ba]['name']){case _0x4b7d('0x1f'):_0x5200a6[_0x4b7d('0x1f')]=_0x43e077[_0x570ac4[_0x4c86ba][_0x4b7d('0x24')]]['split']('/')[0x1];_0x5200a6[_0x4b7d('0x25')]=_0x43e077[_0x570ac4[_0x4c86ba][_0x4b7d('0x24')]]['split']('/')[0x2];_0x5200a6['prefix']=_0x5200a6[_0x4b7d('0x25')]?_0x5200a6[_0x4b7d('0x25')]['split']('$')[0x0]:undefined;_0x5200a6[_0x4b7d('0x25')]=route[_0x4b7d('0x14')]?(_0x5200a6[_0x4b7d('0x26')]||'')+_0x4b7d('0x27')+route[_0x4b7d('0x14')]+'}':(_0x5200a6[_0x4b7d('0x26')]||'')+'${EXTEN}';_0x2118c0[_0x570ac4[_0x4c86ba]['param']]=['SIP',_0x5200a6['trunk'],_0x5200a6[_0x4b7d('0x25')]][_0x4b7d('0x28')]('/');break;case _0x4b7d('0x21'):_0x5200a6[_0x4b7d('0x21')]=_0x43e077[_0x570ac4[_0x4c86ba]['param']];if(route['recordingFormat']!==_0x4b7d('0x29')){if(_0x5200a6['options'][_0x4b7d('0x2a')](_0x4b7d('0x2b'))<0x0){_0x5200a6[_0x4b7d('0x21')]+=_0x4b7d('0x2b');}}else{_0x5200a6['options']=_0x5200a6['options']['replace'](_0x4b7d('0x2b'),'');}_0x2118c0[_0x570ac4[_0x4c86ba][_0x4b7d('0x24')]]=_0x5200a6[_0x4b7d('0x21')];break;default:_0x2118c0[_0x570ac4[_0x4c86ba]['param']]=_0x43e077[_0x570ac4[_0x4c86ba][_0x4b7d('0x24')]];}}return _0x2118c0[_0x4b7d('0x28')](',');}function _0x3f4bd5(_0x4932ac,_0x222bcb,_0x5b6875,_0x488cac){return new Promise(function(_0x23e092,_0x3e62f7){var _0x3392b4=[];if(_[_0x4b7d('0x2c')](_0x222bcb))return _0x23e092(_0x3392b4);_0x16d4ab[_0x4b7d('0x2d')][_0x4b7d('0x2e')]({'attributes':['id',_0x4b7d('0x2f'),_0x4b7d('0x30')],'raw':!![]})[_0x4b7d('0x31')](function(_0x1b5b4d){for(var _0x1b336a=0x0,_0x168310=0x0;_0x1b336a<_0x222bcb[_0x4b7d('0x23')];_0x1b336a++,_0x168310=0x0){var _0x3d045c=_0x222bcb[_0x1b336a];var _0x7e1b56=[];var _0x430f5f=[];if(_0x3d045c[_0x4b7d('0x2f')]!=='*,*,*,*'){_0x3d045c[_0x4b7d('0x32')]=[_0x3d045c['interval']];}else{_0x3d045c[_0x4b7d('0x32')]=_0x3d045c[_0x4b7d('0x30')]?_[_0x4b7d('0x33')](_[_0x4b7d('0x34')](_0x1b5b4d,{'IntervalId':_0x3d045c[_0x4b7d('0x30')]}),'interval'):[];}_0x3d045c[_0x4b7d('0x8')]=_0x4932ac[_0x4b7d('0x8')];_0x3d045c[_0x4b7d('0x9')]=_0x4932ac[_0x4b7d('0x9')];if(_0x3d045c['type'])_0x3d045c[_0x4b7d('0x5')]=_0x3d045c['type'][_0x4b7d('0x35')]();if(_0x4932ac[_0x4b7d('0x5')]===_0x4b7d('0x10')){if(_0x3d045c['hasOwnProperty'](_0x4b7d('0x36'))&&_0x3d045c['tag']&&_0x3d045c[_0x4b7d('0x36')]!=='--'){_0x7e1b56[_0x4b7d('0xd')]({'type':_0x3d045c['type'][_0x4b7d('0x35')](),'app':_0x4b7d('0x6'),'appdata':_0x4b7d('0x37')+_0x3d045c[_0x4b7d('0x36')],'context':_0x4932ac[_0x4b7d('0x8')],'exten':_0x4932ac[_0x4b7d('0x9')],'priority':_0x3d045c[_0x4b7d('0x32')][_0x4b7d('0x23')]+_0x5b6875+_0x168310++,'VoiceExtensionId':_0x4932ac['id']});}_0x7e1b56['push']({'type':_0x3d045c[_0x4b7d('0x5')]['toLowerCase'](),'app':'ExecIf','appdata':_0x4b7d('0x38')+(_0x3d045c[_0x4b7d('0x39')]?_0x4b7d('0x3a')+_0x3d045c[_0x4b7d('0x39')]+')':_0x4b7d('0x3b')),'context':_0x4932ac[_0x4b7d('0x8')],'exten':_0x4932ac[_0x4b7d('0x9')],'priority':_0x3d045c[_0x4b7d('0x32')]['length']+_0x5b6875+_0x168310++,'VoiceExtensionId':_0x4932ac['id']});}else{if(_0x3d045c[_0x4b7d('0x1b')](_0x4b7d('0x3c'))){if([_0x4b7d('0x3d'),'playback']['includes'](_0x3d045c['app'][_0x4b7d('0x35')]())&&_0x3d045c[_0x4b7d('0x3e')]!==_0x4b7d('0x3f')){if(_0x3d045c['answer']){_0x7e1b56[_0x4b7d('0xd')]({'type':_0x3d045c[_0x4b7d('0x5')][_0x4b7d('0x35')](),'app':_0x4b7d('0x15'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x4932ac[_0x4b7d('0x8')],'exten':_0x4932ac[_0x4b7d('0x9')],'priority':_0x3d045c['intervals']['length']+_0x5b6875+_0x168310++,'VoiceExtensionId':_0x4932ac['id']});_0x7e1b56['push']({'type':_0x3d045c[_0x4b7d('0x5')][_0x4b7d('0x35')](),'app':_0x4b7d('0x6'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x4932ac[_0x4b7d('0x8')],'exten':_0x4932ac[_0x4b7d('0x9')],'priority':_0x3d045c[_0x4b7d('0x32')][_0x4b7d('0x23')]+_0x5b6875+_0x168310++,'VoiceExtensionId':_0x4932ac['id']});}else{_0x7e1b56[_0x4b7d('0xd')]({'type':_0x3d045c['type'][_0x4b7d('0x35')](),'app':_0x4b7d('0x15'),'appdata':_0x4b7d('0x40'),'context':_0x4932ac[_0x4b7d('0x8')],'exten':_0x4932ac[_0x4b7d('0x9')],'priority':_0x3d045c[_0x4b7d('0x32')][_0x4b7d('0x23')]+_0x5b6875+_0x168310++,'VoiceExtensionId':_0x4932ac['id']});_0x7e1b56[_0x4b7d('0xd')]({'type':_0x3d045c[_0x4b7d('0x5')]['toLowerCase'](),'app':_0x4b7d('0x6'),'appdata':_0x4b7d('0x41'),'context':_0x4932ac[_0x4b7d('0x8')],'exten':_0x4932ac[_0x4b7d('0x9')],'priority':_0x3d045c[_0x4b7d('0x32')][_0x4b7d('0x23')]+_0x5b6875+_0x168310++,'VoiceExtensionId':_0x4932ac['id']});}}}}for(var _0x59393e=0x0;_0x59393e<_0x3d045c[_0x4b7d('0x32')][_0x4b7d('0x23')];_0x59393e++){var _0x115a8e=_0x5b6875+_0x3d045c[_0x4b7d('0x32')][_0x4b7d('0x23')];var _0x4079a1=_0x59393e===_0x3d045c[_0x4b7d('0x32')][_0x4b7d('0x23')]-0x1?_0x5b6875+_0x7e1b56[_0x4b7d('0x23')]+_0x430f5f[_0x4b7d('0x23')]+0x2:_0x5b6875+_0x59393e+0x1;_0x7e1b56[_0x4b7d('0x42')](_0x59393e,0x0,{'type':_0x4932ac['type'],'app':_0x4b7d('0x43'),'appdata':_0x3d045c['intervals'][_0x59393e]+'?'+_0x4932ac[_0x4b7d('0x8')]+_0x4b7d('0x44')+_0x115a8e+':'+_0x4932ac[_0x4b7d('0x8')]+_0x4b7d('0x44')+_0x4079a1,'exten':_0x4932ac['exten'],'context':_0x4932ac[_0x4b7d('0x8')],'priority':_0x5b6875+_0x59393e,'VoiceExtensionId':_0x4932ac['id']});}if(_0x488cac&&_0x3d045c[_0x4b7d('0x3e')]===_0x4b7d('0x45'))_0x3d045c['appdata']=_0x5bdb23(_0x3d045c['appdata']);_0x3d045c[_0x4b7d('0x46')]=_0x7e1b56[_0x4b7d('0x23')]?_[_0x4b7d('0x47')](_0x7e1b56)[_0x4b7d('0x46')]+0x1:_0x5b6875;_0x3392b4=_['concat'](_0x3392b4,_0x7e1b56,[_0x3d045c],_0x430f5f);_0x5b6875=_[_0x4b7d('0x47')](_0x3392b4)[_0x4b7d('0x46')]+0x1;}return _0x23e092(_0x3392b4);})['catch'](function(_0x5c5b03){_0x3e62f7(_0x5c5b03);});});}return _0x49a837[_0x4b7d('0x48')]('VoiceExtension',attributes,{'tableName':_0x4b7d('0x49'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0xbdbbe,_0x43f98d){var _0x442e78=this;var _0x5236c0=_0x442e78['type']===_0x4b7d('0x10')?_0x5ab59f(_0x442e78):_0x27186b(_0x442e78);return _0x3f4bd5(_0x442e78,_0xbdbbe,_['last'](_0x5236c0)[_0x4b7d('0x46')]+0x1,_0x43f98d)['then'](function(_0x31e4a4){var _0x403ca8=_['concat'](_0x5236c0,_0x31e4a4);_0x403ca8[_0x4b7d('0xd')]({'type':_0x442e78[_0x4b7d('0x5')],'app':'Hangup','exten':_0x442e78[_0x4b7d('0x9')],'context':_0x442e78[_0x4b7d('0x8')],'priority':_[_0x4b7d('0x47')](_0x403ca8)[_0x4b7d('0x46')]+0x1,'VoiceExtensionId':_0x442e78['id']});return _0x403ca8;});}}});}; \ No newline at end of file +var _0xa038=['includes','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','appType','outboundDial','appdata','priority','last','catch','VoiceExtension','voice_extensions','Hangup','util','lodash','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','context','exten','NoOp','CDR(routeAlias)=','alias','inbound','push','CDR(routeid)=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-ANSWER=0','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_FORMAT=','timeout','options','url','length','name','param','phone','split','prefix','SIP','trunk','join','none','indexOf','U(xcally-mixmonitor-context)','isEmpty','findAll','interval','IntervalId','then','*,*,*,*','intervals','map','filter','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','queue','playback'];(function(_0xc0d9bc,_0x2bd6be){var _0x32ff73=function(_0x28c592){while(--_0x28c592){_0xc0d9bc['push'](_0xc0d9bc['shift']());}};_0x32ff73(++_0x2bd6be);}(_0xa038,0x15a));var _0x8a03=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0xa038[_0x2adbeb];return _0x5e18a6;};'use strict';var util=require(_0x8a03('0x0'));var _=require(_0x8a03('0x1'));var attributes=require(_0x8a03('0x2'));module[_0x8a03('0x3')]=function(_0x517626){var _0x36dd4c=_0x517626[_0x8a03('0x4')];function _0x3f3907(_0x3d560b){var _0x8d17ae=0x2;var _0x155c8e=[{'type':_0x3d560b[_0x8a03('0x5')],'app':_0x8a03('0x6'),'appdata':_0x8a03('0x7')+_0x3d560b[_0x8a03('0x5')],'context':_0x3d560b[_0x8a03('0x8')],'exten':_0x3d560b[_0x8a03('0x9')],'priority':_0x8d17ae++,'VoiceExtensionId':_0x3d560b['id']},{'type':_0x3d560b['type'],'app':_0x3d560b['alias']?_0x8a03('0x6'):_0x8a03('0xa'),'appdata':_0x3d560b['alias']?_0x8a03('0xb')+_0x3d560b[_0x8a03('0xc')]:'No\x20alias\x20set','context':_0x3d560b['context'],'exten':_0x3d560b[_0x8a03('0x9')],'priority':_0x8d17ae++,'VoiceExtensionId':_0x3d560b['id']}];if(_0x3d560b[_0x8a03('0x5')]===_0x8a03('0xd')){_0x155c8e[_0x8a03('0xe')]({'type':_0x8a03('0xd'),'app':'Set','appdata':_0x8a03('0xf')+_0x3d560b['id'],'context':_0x3d560b[_0x8a03('0x8')],'exten':_0x3d560b[_0x8a03('0x9')],'priority':_0x8d17ae++,'VoiceExtensionId':_0x3d560b['id']});}_0x155c8e[_0x8a03('0xe')]({'type':_0x3d560b[_0x8a03('0x5')],'app':_0x8a03('0x6'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x3d560b[_0x8a03('0x8')],'exten':_0x3d560b[_0x8a03('0x9')],'priority':_0x8d17ae++,'VoiceExtensionId':_0x3d560b['id']},{'type':_0x3d560b[_0x8a03('0x5')],'app':_0x8a03('0x6'),'appdata':_0x8a03('0x10'),'context':_0x3d560b['context'],'exten':_0x3d560b[_0x8a03('0x9')],'priority':_0x8d17ae++,'VoiceExtensionId':_0x3d560b['id']},{'type':_0x3d560b['type'],'app':_0x8a03('0x6'),'appdata':_0x8a03('0x11'),'context':_0x3d560b[_0x8a03('0x8')],'exten':_0x3d560b[_0x8a03('0x9')],'priority':_0x8d17ae++,'VoiceExtensionId':_0x3d560b['id']});return _0x155c8e;}function _0x3b7d2f(_0x7cc188){var _0x3053e2=0x2;var _0x45dcbb=[{'type':_0x8a03('0x12'),'app':_0x8a03('0x6'),'appdata':_0x8a03('0x13'),'context':_0x7cc188[_0x8a03('0x8')],'exten':_0x7cc188[_0x8a03('0x9')],'priority':_0x3053e2++,'VoiceExtensionId':_0x7cc188['id']},{'type':'outbound','app':_0x7cc188[_0x8a03('0xc')]?_0x8a03('0x6'):_0x8a03('0xa'),'appdata':_0x7cc188['alias']?_0x8a03('0xb')+_0x7cc188['alias']:'No\x20alias\x20set','context':_0x7cc188[_0x8a03('0x8')],'exten':_0x7cc188[_0x8a03('0x9')],'priority':_0x3053e2++,'VoiceExtensionId':_0x7cc188['id']},{'type':_0x8a03('0x12'),'app':_0x8a03('0x6'),'appdata':_0x8a03('0x14')+(_0x7cc188[_0x8a03('0x15')]?_0x8a03('0x16')+_0x7cc188['cutdigits']+'}':_0x8a03('0x17')),'context':_0x7cc188[_0x8a03('0x8')],'exten':_0x7cc188[_0x8a03('0x9')],'priority':_0x3053e2++,'VoiceExtensionId':_0x7cc188['id']},{'type':_0x8a03('0x12'),'app':_0x8a03('0x6'),'appdata':_0x8a03('0xf')+_0x7cc188['id'],'context':_0x7cc188[_0x8a03('0x8')],'exten':_0x7cc188['exten'],'priority':_0x3053e2++,'VoiceExtensionId':_0x7cc188['id']},{'type':_0x8a03('0x12'),'app':_0x8a03('0x18'),'appdata':_0x8a03('0x19')+(_0x3053e2+0x2)+_0x8a03('0x1a')+(_0x3053e2+0x1)+')','context':_0x7cc188['context'],'exten':_0x7cc188['exten'],'priority':_0x3053e2++,'VoiceExtensionId':_0x7cc188['id']},{'type':'outbound','app':_0x8a03('0x6'),'appdata':_0x7cc188['cutdigits']?_0x8a03('0x1b')+_0x7cc188[_0x8a03('0x15')]+'}':_0x8a03('0x1c'),'context':_0x7cc188[_0x8a03('0x8')],'exten':_0x7cc188[_0x8a03('0x9')],'priority':_0x3053e2++,'VoiceExtensionId':_0x7cc188['id']},{'type':_0x8a03('0x12'),'app':_0x8a03('0x6'),'appdata':_0x8a03('0x1d'),'context':_0x7cc188[_0x8a03('0x8')],'exten':_0x7cc188[_0x8a03('0x9')],'priority':_0x3053e2++,'VoiceExtensionId':_0x7cc188['id']},{'type':'outbound','app':_0x8a03('0x6'),'appdata':_0x8a03('0x10'),'context':_0x7cc188[_0x8a03('0x8')],'exten':_0x7cc188['exten'],'priority':_0x3053e2++,'VoiceExtensionId':_0x7cc188['id']},{'type':'outbound','app':_0x8a03('0x6'),'appdata':_0x8a03('0x11'),'context':_0x7cc188['context'],'exten':_0x7cc188[_0x8a03('0x9')],'priority':_0x3053e2++,'VoiceExtensionId':_0x7cc188['id']},{'type':_0x8a03('0x12'),'app':_0x8a03('0x6'),'appdata':_0x8a03('0x1e')+_0x7cc188['id'],'context':_0x7cc188[_0x8a03('0x8')],'exten':_0x7cc188[_0x8a03('0x9')],'priority':_0x3053e2++,'VoiceExtensionId':_0x7cc188['id']}];if(_0x7cc188[_0x8a03('0x1f')](_0x8a03('0x20'))&&_0x7cc188[_0x8a03('0x20')]!=='none'){_0x45dcbb[_0x8a03('0xe')]({'type':'outbound','app':_0x8a03('0x6'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x7cc188[_0x8a03('0x8')],'exten':_0x7cc188[_0x8a03('0x9')],'priority':_0x3053e2++,'VoiceExtensionId':_0x7cc188['id']},{'type':'outbound','app':_0x8a03('0x6'),'appdata':_0x8a03('0x21')+_0x7cc188[_0x8a03('0x20')]||'wav','context':_0x7cc188[_0x8a03('0x8')],'exten':_0x7cc188[_0x8a03('0x9')],'priority':_0x3053e2++,'VoiceExtensionId':_0x7cc188['id']});}return _0x45dcbb;}function _0x476765(_0x255d4e){var _0x369a9b=[{'name':'trunk','param':0x0},{'name':_0x8a03('0x22'),'param':0x1},{'name':_0x8a03('0x23'),'param':0x2},{'name':_0x8a03('0x24'),'param':0x3}];var _0x327e4e={};var _0x574f2b=_0x255d4e['split'](',');var _0x1db061=[];for(var _0x20f074=0x0;_0x20f074<_0x369a9b[_0x8a03('0x25')];_0x20f074++){switch(_0x369a9b[_0x20f074][_0x8a03('0x26')]){case'trunk':_0x327e4e['trunk']=_0x574f2b[_0x369a9b[_0x20f074][_0x8a03('0x27')]]['split']('/')[0x1];_0x327e4e[_0x8a03('0x28')]=_0x574f2b[_0x369a9b[_0x20f074][_0x8a03('0x27')]][_0x8a03('0x29')]('/')[0x2];_0x327e4e['prefix']=_0x327e4e[_0x8a03('0x28')]?_0x327e4e['phone']['split']('$')[0x0]:undefined;_0x327e4e[_0x8a03('0x28')]=route[_0x8a03('0x15')]?(_0x327e4e[_0x8a03('0x2a')]||'')+_0x8a03('0x16')+route['cutdigits']+'}':(_0x327e4e[_0x8a03('0x2a')]||'')+_0x8a03('0x17');_0x1db061[_0x369a9b[_0x20f074]['param']]=[_0x8a03('0x2b'),_0x327e4e[_0x8a03('0x2c')],_0x327e4e[_0x8a03('0x28')]][_0x8a03('0x2d')]('/');break;case _0x8a03('0x23'):_0x327e4e['options']=_0x574f2b[_0x369a9b[_0x20f074][_0x8a03('0x27')]];if(route['recordingFormat']!==_0x8a03('0x2e')){if(_0x327e4e[_0x8a03('0x23')][_0x8a03('0x2f')]('U(xcally-mixmonitor-context)')<0x0){_0x327e4e[_0x8a03('0x23')]+=_0x8a03('0x30');}}else{_0x327e4e['options']=_0x327e4e[_0x8a03('0x23')]['replace'](_0x8a03('0x30'),'');}_0x1db061[_0x369a9b[_0x20f074][_0x8a03('0x27')]]=_0x327e4e[_0x8a03('0x23')];break;default:_0x1db061[_0x369a9b[_0x20f074][_0x8a03('0x27')]]=_0x574f2b[_0x369a9b[_0x20f074][_0x8a03('0x27')]];}}return _0x1db061[_0x8a03('0x2d')](',');}function _0x4ef6d8(_0x270d65,_0x3d7c2b,_0x5d7837,_0x452333){return new Promise(function(_0x5cf7fb,_0x3db9a5){var _0x525999=[];if(_[_0x8a03('0x31')](_0x3d7c2b))return _0x5cf7fb(_0x525999);_0x36dd4c['Interval'][_0x8a03('0x32')]({'attributes':['id',_0x8a03('0x33'),_0x8a03('0x34')],'raw':!![]})[_0x8a03('0x35')](function(_0x37fc07){for(var _0x3311c0=0x0,_0x1e282f=0x0;_0x3311c0<_0x3d7c2b[_0x8a03('0x25')];_0x3311c0++,_0x1e282f=0x0){var _0xdf8f89=_0x3d7c2b[_0x3311c0];var _0x4bc1f3=[];var _0x32b4e8=[];if(_0xdf8f89[_0x8a03('0x33')]!==_0x8a03('0x36')){_0xdf8f89['intervals']=[_0xdf8f89[_0x8a03('0x33')]];}else{_0xdf8f89[_0x8a03('0x37')]=_0xdf8f89['IntervalId']?_[_0x8a03('0x38')](_[_0x8a03('0x39')](_0x37fc07,{'IntervalId':_0xdf8f89[_0x8a03('0x34')]}),_0x8a03('0x33')):[];}_0xdf8f89[_0x8a03('0x8')]=_0x270d65[_0x8a03('0x8')];_0xdf8f89[_0x8a03('0x9')]=_0x270d65['exten'];if(_0xdf8f89['type'])_0xdf8f89[_0x8a03('0x5')]=_0xdf8f89[_0x8a03('0x5')][_0x8a03('0x3a')]();if(_0x270d65[_0x8a03('0x5')]===_0x8a03('0x12')){if(_0xdf8f89[_0x8a03('0x1f')](_0x8a03('0x3b'))&&_0xdf8f89['tag']&&_0xdf8f89['tag']!=='--'){_0x4bc1f3['push']({'type':_0xdf8f89[_0x8a03('0x5')][_0x8a03('0x3a')](),'app':_0x8a03('0x6'),'appdata':_0x8a03('0x3c')+_0xdf8f89['tag'],'context':_0x270d65[_0x8a03('0x8')],'exten':_0x270d65[_0x8a03('0x9')],'priority':_0xdf8f89[_0x8a03('0x37')][_0x8a03('0x25')]+_0x5d7837+_0x1e282f++,'VoiceExtensionId':_0x270d65['id']});}_0x4bc1f3[_0x8a03('0xe')]({'type':_0xdf8f89['type']['toLowerCase'](),'app':_0x8a03('0x18'),'appdata':_0x8a03('0x3d')+(_0xdf8f89['callerID']?'Set(CALLERID(all)='+_0xdf8f89['callerID']+')':'NoOp(No\x20number\x20available)'),'context':_0x270d65['context'],'exten':_0x270d65[_0x8a03('0x9')],'priority':_0xdf8f89[_0x8a03('0x37')][_0x8a03('0x25')]+_0x5d7837+_0x1e282f++,'VoiceExtensionId':_0x270d65['id']});}else{if(_0xdf8f89[_0x8a03('0x1f')]('answer')){if([_0x8a03('0x3e'),_0x8a03('0x3f')][_0x8a03('0x40')](_0xdf8f89['app'][_0x8a03('0x3a')]())&&_0xdf8f89['appType']!==_0x8a03('0x41')){if(_0xdf8f89[_0x8a03('0x42')]){_0x4bc1f3[_0x8a03('0xe')]({'type':_0xdf8f89['type'][_0x8a03('0x3a')](),'app':'ExecIf','appdata':_0x8a03('0x43'),'context':_0x270d65['context'],'exten':_0x270d65[_0x8a03('0x9')],'priority':_0xdf8f89[_0x8a03('0x37')][_0x8a03('0x25')]+_0x5d7837+_0x1e282f++,'VoiceExtensionId':_0x270d65['id']});_0x4bc1f3[_0x8a03('0xe')]({'type':_0xdf8f89[_0x8a03('0x5')]['toLowerCase'](),'app':_0x8a03('0x6'),'appdata':_0x8a03('0x44'),'context':_0x270d65[_0x8a03('0x8')],'exten':_0x270d65[_0x8a03('0x9')],'priority':_0xdf8f89[_0x8a03('0x37')][_0x8a03('0x25')]+_0x5d7837+_0x1e282f++,'VoiceExtensionId':_0x270d65['id']});}else{_0x4bc1f3[_0x8a03('0xe')]({'type':_0xdf8f89[_0x8a03('0x5')][_0x8a03('0x3a')](),'app':_0x8a03('0x18'),'appdata':_0x8a03('0x45'),'context':_0x270d65[_0x8a03('0x8')],'exten':_0x270d65[_0x8a03('0x9')],'priority':_0xdf8f89['intervals'][_0x8a03('0x25')]+_0x5d7837+_0x1e282f++,'VoiceExtensionId':_0x270d65['id']});_0x4bc1f3[_0x8a03('0xe')]({'type':_0xdf8f89['type'][_0x8a03('0x3a')](),'app':'Set','appdata':_0x8a03('0x46'),'context':_0x270d65['context'],'exten':_0x270d65[_0x8a03('0x9')],'priority':_0xdf8f89[_0x8a03('0x37')][_0x8a03('0x25')]+_0x5d7837+_0x1e282f++,'VoiceExtensionId':_0x270d65['id']});}}}}for(var _0xe3e6=0x0;_0xe3e6<_0xdf8f89[_0x8a03('0x37')]['length'];_0xe3e6++){var _0x1c4930=_0x5d7837+_0xdf8f89[_0x8a03('0x37')][_0x8a03('0x25')];var _0x482efd=_0xe3e6===_0xdf8f89[_0x8a03('0x37')][_0x8a03('0x25')]-0x1?_0x5d7837+_0x4bc1f3['length']+_0x32b4e8[_0x8a03('0x25')]+0x2:_0x5d7837+_0xe3e6+0x1;_0x4bc1f3[_0x8a03('0x47')](_0xe3e6,0x0,{'type':_0x270d65['type'],'app':'GotoIfTime','appdata':_0xdf8f89[_0x8a03('0x37')][_0xe3e6]+'?'+_0x270d65[_0x8a03('0x8')]+_0x8a03('0x48')+_0x1c4930+':'+_0x270d65['context']+_0x8a03('0x48')+_0x482efd,'exten':_0x270d65[_0x8a03('0x9')],'context':_0x270d65['context'],'priority':_0x5d7837+_0xe3e6,'VoiceExtensionId':_0x270d65['id']});}if(_0x452333&&_0xdf8f89[_0x8a03('0x49')]===_0x8a03('0x4a'))_0xdf8f89[_0x8a03('0x4b')]=_0x476765(_0xdf8f89[_0x8a03('0x4b')]);_0xdf8f89[_0x8a03('0x4c')]=_0x4bc1f3[_0x8a03('0x25')]?_[_0x8a03('0x4d')](_0x4bc1f3)['priority']+0x1:_0x5d7837;_0x525999=_['concat'](_0x525999,_0x4bc1f3,[_0xdf8f89],_0x32b4e8);_0x5d7837=_[_0x8a03('0x4d')](_0x525999)[_0x8a03('0x4c')]+0x1;}return _0x5cf7fb(_0x525999);})[_0x8a03('0x4e')](function(_0x4a7ab5){_0x3db9a5(_0x4a7ab5);});});}return _0x517626['define'](_0x8a03('0x4f'),attributes,{'tableName':_0x8a03('0x50'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x3b9def,_0x4a57f6){var _0x5e94fe=this;var _0xb43385=_0x5e94fe[_0x8a03('0x5')]===_0x8a03('0x12')?_0x3b7d2f(_0x5e94fe):_0x3f3907(_0x5e94fe);return _0x4ef6d8(_0x5e94fe,_0x3b9def,_[_0x8a03('0x4d')](_0xb43385)[_0x8a03('0x4c')]+0x1,_0x4a57f6)['then'](function(_0x5efbdf){var _0x1759e0=_['concat'](_0xb43385,_0x5efbdf);_0x1759e0[_0x8a03('0xe')]({'type':_0x5e94fe[_0x8a03('0x5')],'app':_0x8a03('0x51'),'exten':_0x5e94fe['exten'],'context':_0x5e94fe[_0x8a03('0x8')],'priority':_['last'](_0x1759e0)[_0x8a03('0x4c')]+0x1,'VoiceExtensionId':_0x5e94fe['id']});return _0x1759e0;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 969551d..1f03394 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 _0x1b9b=['client','http','defaults','redis','localhost','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetVoiceExtension','VoiceExtension','findAll','options','raw','attributes','limit','map','include','model','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x2ee5aa,_0x616538){var _0x2e87cf=function(_0x164e26){while(--_0x164e26){_0x2ee5aa['push'](_0x2ee5aa['shift']());}};_0x2e87cf(++_0x616538);}(_0x1b9b,0x89));var _0xb1b9=function(_0x53a2eb,_0x233bfa){_0x53a2eb=_0x53a2eb-0x0;var _0x3430be=_0x1b9b[_0x53a2eb];return _0x3430be;};'use strict';var _=require(_0xb1b9('0x0'));var util=require('util');var moment=require(_0xb1b9('0x1'));var BPromise=require(_0xb1b9('0x2'));var rs=require(_0xb1b9('0x3'));var fs=require('fs');var Redis=require(_0xb1b9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb1b9('0x5'));var logger=require(_0xb1b9('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb1b9('0x7')][_0xb1b9('0x8')]({'port':0x232a});config['redis']=_[_0xb1b9('0x9')](config[_0xb1b9('0xa')],{'host':_0xb1b9('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb1b9('0xa')]));require(_0xb1b9('0xc'))[_0xb1b9('0xd')](socket);function respondWithRpcPromise(_0x509e87,_0x178bb4,_0x535387){return new BPromise(function(_0x31b546,_0x5a6c8c){return client[_0xb1b9('0xe')](_0x509e87,_0x535387)[_0xb1b9('0xf')](function(_0x1595a6){logger[_0xb1b9('0x10')](_0xb1b9('0x11'),_0x178bb4,_0xb1b9('0x12'));logger[_0xb1b9('0x13')](_0xb1b9('0x14'),_0x178bb4,'request\x20sent',JSON[_0xb1b9('0x15')](_0x1595a6));if(_0x1595a6[_0xb1b9('0x16')]){if(_0x1595a6[_0xb1b9('0x16')]['code']===0x1f4){logger[_0xb1b9('0x16')](_0xb1b9('0x11'),_0x178bb4,_0x1595a6[_0xb1b9('0x16')][_0xb1b9('0x17')]);return _0x5a6c8c(_0x1595a6[_0xb1b9('0x16')][_0xb1b9('0x17')]);}logger['error'](_0xb1b9('0x11'),_0x178bb4,_0x1595a6['error'][_0xb1b9('0x17')]);return _0x31b546(_0x1595a6[_0xb1b9('0x16')][_0xb1b9('0x17')]);}else{logger[_0xb1b9('0x10')]('VoiceExtension,\x20%s,\x20%s',_0x178bb4,_0xb1b9('0x12'));_0x31b546(_0x1595a6[_0xb1b9('0x18')][_0xb1b9('0x17')]);}})['catch'](function(_0x26d012){logger[_0xb1b9('0x16')](_0xb1b9('0x11'),_0x178bb4,_0x26d012);_0x5a6c8c(_0x26d012);});});}exports[_0xb1b9('0x19')]=function(_0xc556e5){var _0x5dfcdf=this;return new Promise(function(_0x4aa7b9,_0x550998){return db[_0xb1b9('0x1a')][_0xb1b9('0x1b')]({'raw':_0xc556e5[_0xb1b9('0x1c')]?_0xc556e5[_0xb1b9('0x1c')][_0xb1b9('0x1d')]===undefined?!![]:![]:!![],'where':_0xc556e5[_0xb1b9('0x1c')]?_0xc556e5['options']['where']||null:null,'attributes':_0xc556e5[_0xb1b9('0x1c')]?_0xc556e5[_0xb1b9('0x1c')][_0xb1b9('0x1e')]||null:null,'limit':_0xc556e5['options']?_0xc556e5[_0xb1b9('0x1c')][_0xb1b9('0x1f')]||null:null,'include':_0xc556e5['options']?_0xc556e5[_0xb1b9('0x1c')]['include']?_[_0xb1b9('0x20')](_0xc556e5['options'][_0xb1b9('0x21')],function(_0x578116){return{'model':db[_0x578116[_0xb1b9('0x22')]],'as':_0x578116['as'],'attributes':_0x578116[_0xb1b9('0x1e')],'include':_0x578116[_0xb1b9('0x21')]?_[_0xb1b9('0x20')](_0x578116[_0xb1b9('0x21')],function(_0x5f45e8){return{'model':db[_0x5f45e8[_0xb1b9('0x22')]],'as':_0x5f45e8['as'],'attributes':_0x5f45e8[_0xb1b9('0x1e')],'include':_0x5f45e8[_0xb1b9('0x21')]?_[_0xb1b9('0x20')](_0x5f45e8[_0xb1b9('0x21')],function(_0x3531f0){return{'model':db[_0x3531f0[_0xb1b9('0x22')]],'as':_0x3531f0['as'],'attributes':_0x3531f0['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x59d433){logger[_0xb1b9('0x10')](_0xb1b9('0x19'),_0xc556e5);logger[_0xb1b9('0x13')](_0xb1b9('0x19'),_0xc556e5,JSON[_0xb1b9('0x15')](_0x59d433));_0x4aa7b9(_0x59d433);})[_0xb1b9('0x23')](function(_0x3a733c){logger[_0xb1b9('0x16')](_0xb1b9('0x19'),_0x3a733c[_0xb1b9('0x17')],_0xc556e5);_0x550998(_0x5dfcdf[_0xb1b9('0x16')](0x1f4,_0x3a733c[_0xb1b9('0x17')]));});});}; \ No newline at end of file +var _0x4989=['stringify','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','where','attributes','limit','include','map','model','lodash','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent'];(function(_0x5b847f,_0x59d01a){var _0x53984c=function(_0x31990d){while(--_0x31990d){_0x5b847f['push'](_0x5b847f['shift']());}};_0x53984c(++_0x59d01a);}(_0x4989,0x79));var _0x9498=function(_0x539fb2,_0x5b6718){_0x539fb2=_0x539fb2-0x0;var _0x4d583d=_0x4989[_0x539fb2];return _0x4d583d;};'use strict';var _=require(_0x9498('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9498('0x1'));var rs=require(_0x9498('0x2'));var fs=require('fs');var Redis=require(_0x9498('0x3'));var db=require(_0x9498('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9498('0x5'));var config=require('../../config/environment');var jayson=require(_0x9498('0x6'));var client=jayson[_0x9498('0x7')]['http']({'port':0x232a});config[_0x9498('0x8')]=_[_0x9498('0x9')](config[_0x9498('0x8')],{'host':_0x9498('0xa'),'port':0x18eb});var socket=require(_0x9498('0xb'))(new Redis(config[_0x9498('0x8')]));require(_0x9498('0xc'))[_0x9498('0xd')](socket);function respondWithRpcPromise(_0x2cd88f,_0x212a2d,_0x1e7440){return new BPromise(function(_0x5ce9bf,_0x1926af){return client[_0x9498('0xe')](_0x2cd88f,_0x1e7440)[_0x9498('0xf')](function(_0x51f0b1){logger[_0x9498('0x10')](_0x9498('0x11'),_0x212a2d,'request\x20sent');logger['debug']('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x212a2d,_0x9498('0x12'),JSON[_0x9498('0x13')](_0x51f0b1));if(_0x51f0b1[_0x9498('0x14')]){if(_0x51f0b1[_0x9498('0x14')][_0x9498('0x15')]===0x1f4){logger[_0x9498('0x14')]('VoiceExtension,\x20%s,\x20%s',_0x212a2d,_0x51f0b1[_0x9498('0x14')][_0x9498('0x16')]);return _0x1926af(_0x51f0b1[_0x9498('0x14')][_0x9498('0x16')]);}logger[_0x9498('0x14')](_0x9498('0x11'),_0x212a2d,_0x51f0b1[_0x9498('0x14')][_0x9498('0x16')]);return _0x5ce9bf(_0x51f0b1[_0x9498('0x14')][_0x9498('0x16')]);}else{logger[_0x9498('0x10')](_0x9498('0x11'),_0x212a2d,_0x9498('0x12'));_0x5ce9bf(_0x51f0b1[_0x9498('0x17')][_0x9498('0x16')]);}})[_0x9498('0x18')](function(_0x5d775d){logger[_0x9498('0x14')](_0x9498('0x11'),_0x212a2d,_0x5d775d);_0x1926af(_0x5d775d);});});}exports[_0x9498('0x19')]=function(_0x192436){var _0x4e09d5=this;return new Promise(function(_0x2d14d3,_0x58521c){return db[_0x9498('0x1a')][_0x9498('0x1b')]({'raw':_0x192436[_0x9498('0x1c')]?_0x192436['options']['raw']===undefined?!![]:![]:!![],'where':_0x192436['options']?_0x192436[_0x9498('0x1c')][_0x9498('0x1d')]||null:null,'attributes':_0x192436['options']?_0x192436[_0x9498('0x1c')][_0x9498('0x1e')]||null:null,'limit':_0x192436[_0x9498('0x1c')]?_0x192436[_0x9498('0x1c')][_0x9498('0x1f')]||null:null,'include':_0x192436[_0x9498('0x1c')]?_0x192436[_0x9498('0x1c')][_0x9498('0x20')]?_[_0x9498('0x21')](_0x192436['options'][_0x9498('0x20')],function(_0x7c9682){return{'model':db[_0x7c9682[_0x9498('0x22')]],'as':_0x7c9682['as'],'attributes':_0x7c9682['attributes'],'include':_0x7c9682[_0x9498('0x20')]?_[_0x9498('0x21')](_0x7c9682[_0x9498('0x20')],function(_0x2f9262){return{'model':db[_0x2f9262[_0x9498('0x22')]],'as':_0x2f9262['as'],'attributes':_0x2f9262['attributes'],'include':_0x2f9262['include']?_[_0x9498('0x21')](_0x2f9262[_0x9498('0x20')],function(_0x191b4e){return{'model':db[_0x191b4e[_0x9498('0x22')]],'as':_0x191b4e['as'],'attributes':_0x191b4e[_0x9498('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9498('0xf')](function(_0xf47729){logger[_0x9498('0x10')](_0x9498('0x19'),_0x192436);logger['debug']('GetVoiceExtension',_0x192436,JSON[_0x9498('0x13')](_0xf47729));_0x2d14d3(_0xf47729);})['catch'](function(_0x5edc83){logger[_0x9498('0x14')](_0x9498('0x19'),_0x5edc83['message'],_0x192436);_0x58521c(_0x4e09d5['error'](0x1f4,_0x5edc83[_0x9498('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 35f9da0..e844563 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 _0xe14b=['removeListener','register','length','./voiceExtension.events','save','emit'];(function(_0x413f87,_0x12c5c0){var _0xb4ae8c=function(_0x3a4910){while(--_0x3a4910){_0x413f87['push'](_0x413f87['shift']());}};_0xb4ae8c(++_0x12c5c0);}(_0xe14b,0x93));var _0xbe14=function(_0x424378,_0x54908f){_0x424378=_0x424378-0x0;var _0x21e4b3=_0xe14b[_0x424378];return _0x21e4b3;};'use strict';var VoiceExtensionEvents=require(_0xbe14('0x0'));var events=[_0xbe14('0x1'),'remove','update'];function createListener(_0x11c3a0,_0x36393a){return function(_0x48a116){_0x36393a[_0xbe14('0x2')](_0x11c3a0,_0x48a116);};}function removeListener(_0x5ce8fb,_0x496c04){return function(){VoiceExtensionEvents[_0xbe14('0x3')](_0x5ce8fb,_0x496c04);};}exports[_0xbe14('0x4')]=function(_0x1fe204){for(var _0x1ff100=0x0,_0x1d9ade=events[_0xbe14('0x5')];_0x1ff100<_0x1d9ade;_0x1ff100++){var _0x196fca=events[_0x1ff100];var _0x566ae7=createListener('voiceExtension:'+_0x196fca,_0x1fe204);VoiceExtensionEvents['on'](_0x196fca,_0x566ae7);}}; \ No newline at end of file +var _0xe14b=['removeListener','register','length','./voiceExtension.events','save','emit'];(function(_0x331976,_0x519862){var _0x2c8f24=function(_0x38b461){while(--_0x38b461){_0x331976['push'](_0x331976['shift']());}};_0x2c8f24(++_0x519862);}(_0xe14b,0x93));var _0xbe14=function(_0xa5293,_0x28409a){_0xa5293=_0xa5293-0x0;var _0x5050da=_0xe14b[_0xa5293];return _0x5050da;};'use strict';var VoiceExtensionEvents=require(_0xbe14('0x0'));var events=[_0xbe14('0x1'),'remove','update'];function createListener(_0x11c3a0,_0x36393a){return function(_0x48a116){_0x36393a[_0xbe14('0x2')](_0x11c3a0,_0x48a116);};}function removeListener(_0x5ce8fb,_0x496c04){return function(){VoiceExtensionEvents[_0xbe14('0x3')](_0x5ce8fb,_0x496c04);};}exports[_0xbe14('0x4')]=function(_0x1fe204){for(var _0x1ff100=0x0,_0x1d9ade=events[_0xbe14('0x5')];_0x1ff100<_0x1d9ade;_0x1ff100++){var _0x196fca=events[_0x1ff100];var _0x566ae7=createListener('voiceExtension:'+_0x196fca,_0x1fe204);VoiceExtensionEvents['on'](_0x196fca,_0x566ae7);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 63cd1df..3cd5d34 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 _0x47c5=['create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceMail.controller','get','index','/:id','isAuthenticated','show','/:id/messages','getMessages','post'];(function(_0x4f3463,_0x5a1ee7){var _0x5f0e49=function(_0x41419f){while(--_0x41419f){_0x4f3463['push'](_0x4f3463['shift']());}};_0x5f0e49(++_0x5a1ee7);}(_0x47c5,0x165));var _0x547c=function(_0x43f756,_0xae9f58){_0x43f756=_0x43f756-0x0;var _0x5ba710=_0x47c5[_0x43f756];return _0x5ba710;};'use strict';var multer=require(_0x547c('0x0'));var util=require(_0x547c('0x1'));var path=require(_0x547c('0x2'));var timeout=require(_0x547c('0x3'));var express=require(_0x547c('0x4'));var router=express[_0x547c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x547c('0x6'));var interaction=require(_0x547c('0x7'));var config=require('../../config/environment');var controller=require(_0x547c('0x8'));router[_0x547c('0x9')]('/',auth['isAuthenticated'](),controller[_0x547c('0xa')]);router[_0x547c('0x9')](_0x547c('0xb'),auth[_0x547c('0xc')](),controller[_0x547c('0xd')]);router[_0x547c('0x9')](_0x547c('0xe'),auth[_0x547c('0xc')](),controller[_0x547c('0xf')]);router[_0x547c('0x10')]('/',auth[_0x547c('0xc')](),controller[_0x547c('0x11')]);router[_0x547c('0x12')](_0x547c('0xb'),auth[_0x547c('0xc')](),controller[_0x547c('0x13')]);router[_0x547c('0x14')]('/:id',auth[_0x547c('0xc')](),controller[_0x547c('0x15')]);module['exports']=router; \ No newline at end of file +var _0x7096=['../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','getMessages','post','create','put','update','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x5da4ec,_0x5d7bf0){var _0x5076af=function(_0x54f950){while(--_0x54f950){_0x5da4ec['push'](_0x5da4ec['shift']());}};_0x5076af(++_0x5d7bf0);}(_0x7096,0x10c));var _0x6709=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x7096[_0x1e7b16];return _0x37fadc;};'use strict';var multer=require('multer');var util=require(_0x6709('0x0'));var path=require('path');var timeout=require(_0x6709('0x1'));var express=require('express');var router=express[_0x6709('0x2')]();var fs_extra=require(_0x6709('0x3'));var auth=require(_0x6709('0x4'));var interaction=require(_0x6709('0x5'));var config=require(_0x6709('0x6'));var controller=require(_0x6709('0x7'));router[_0x6709('0x8')]('/',auth[_0x6709('0x9')](),controller[_0x6709('0xa')]);router[_0x6709('0x8')](_0x6709('0xb'),auth[_0x6709('0x9')](),controller[_0x6709('0xc')]);router['get']('/:id/messages',auth[_0x6709('0x9')](),controller[_0x6709('0xd')]);router[_0x6709('0xe')]('/',auth[_0x6709('0x9')](),controller[_0x6709('0xf')]);router[_0x6709('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x6709('0x11')]);router[_0x6709('0x12')](_0x6709('0xb'),auth[_0x6709('0x9')](),controller[_0x6709('0x13')]);module[_0x6709('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 ec24f50..8d75658 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 _0xf4af=['sequelize','STRING','from-voicemail','contest_mailbox','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','\x20-\x20','getDataValue','mailbox'];(function(_0x13be0d,_0x1091c7){var _0x1711a6=function(_0x1c3a1d){while(--_0x1c3a1d){_0x13be0d['push'](_0x13be0d['shift']());}};_0x1711a6(++_0x1091c7);}(_0xf4af,0x1a0));var _0xff4a=function(_0x5afbd5,_0x48a693){_0x5afbd5=_0x5afbd5-0x0;var _0x298511=_0xf4af[_0x5afbd5];return _0x298511;};'use strict';var Sequelize=require(_0xff4a('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0xff4a('0x1')]},'context':{'type':Sequelize[_0xff4a('0x1')],'defaultValue':_0xff4a('0x2'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0xff4a('0x3')},'password':{'type':Sequelize[_0xff4a('0x1')]},'fullname':{'type':Sequelize[_0xff4a('0x1')]},'email':{'type':Sequelize[_0xff4a('0x1')],'validate':{'isEmail':!![]},'set':function(_0x329504){this['setDataValue']('email',typeof _0x329504===_0xff4a('0x4')&&_0x329504[_0xff4a('0x5')]()?_0x329504[_0xff4a('0x5')]():null);}},'pager':{'type':Sequelize[_0xff4a('0x1')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0xff4a('0x6')},'attach':{'type':Sequelize[_0xff4a('0x7')]('yes','no'),'defaultValue':_0xff4a('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0xff4a('0x7')]('yes','no'),'defaultValue':_0xff4a('0x8'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0xff4a('0x1')]},'review':{'type':Sequelize[_0xff4a('0x7')](_0xff4a('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xff4a('0x7')](_0xff4a('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xff4a('0x7')](_0xff4a('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xff4a('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xff4a('0x7')](_0xff4a('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xff4a('0x7')](_0xff4a('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0xff4a('0x8'),'no'),'defaultValue':_0xff4a('0x8'),'allowNull':![]},'forcename':{'type':Sequelize[_0xff4a('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0xff4a('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0xff4a('0x8'),'no'),'defaultValue':_0xff4a('0x8'),'allowNull':![]},'stamp':{'type':_0xff4a('0xa')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0xff4a('0x1')]},'maxsecs':{'type':Sequelize[_0xff4a('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xff4a('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xff4a('0xc')],'get':function(){return this['getDataValue']('fullname')+_0xff4a('0xd')+this[_0xff4a('0xe')](_0xff4a('0xf'));}}}; \ No newline at end of file +var _0x84b1=['email','string','trim','central','ENUM','yes','INTEGER','VIRTUAL','fullname','\x20-\x20','getDataValue','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x84b1,0xb6));var _0x184b=function(_0x17d965,_0x263535){_0x17d965=_0x17d965-0x0;var _0x4f6009=_0x84b1[_0x17d965];return _0x4f6009;};'use strict';var Sequelize=require(_0x184b('0x0'));module[_0x184b('0x1')]={'customer_id':{'type':Sequelize[_0x184b('0x2')]},'context':{'type':Sequelize[_0x184b('0x2')],'defaultValue':_0x184b('0x3'),'unique':_0x184b('0x4')},'mailbox':{'type':Sequelize[_0x184b('0x2')],'defaultValue':'','allowNull':![],'unique':_0x184b('0x4')},'password':{'type':Sequelize[_0x184b('0x2')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x184b('0x2')],'validate':{'isEmail':!![]},'set':function(_0x3f458a){this['setDataValue'](_0x184b('0x5'),typeof _0x3f458a===_0x184b('0x6')&&_0x3f458a[_0x184b('0x7')]()?_0x3f458a[_0x184b('0x7')]():null);}},'pager':{'type':Sequelize[_0x184b('0x2')]},'tz':{'type':Sequelize[_0x184b('0x2')],'defaultValue':_0x184b('0x8')},'attach':{'type':Sequelize[_0x184b('0x9')](_0x184b('0xa'),'no'),'defaultValue':_0x184b('0xa'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0x184b('0xa'),'no'),'defaultValue':_0x184b('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0x184b('0x2')]},'callback':{'type':Sequelize[_0x184b('0x2')]},'review':{'type':Sequelize[_0x184b('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x184b('0x9')](_0x184b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0x184b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x184b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x184b('0x9')](_0x184b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x184b('0x9')](_0x184b('0xa'),'no'),'defaultValue':_0x184b('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0x184b('0x9')](_0x184b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x184b('0x9')](_0x184b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x184b('0x9')]('yes','no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x184b('0x2')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x184b('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x184b('0xc')],'get':function(){return this['getDataValue'](_0x184b('0xd'))+_0x184b('0xe')+this[_0x184b('0xf')](_0x184b('0x10'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 121ecb0..18607ce 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 _0x5eb8=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','get','Voicemails','UserProfileResource','sendStatus','error','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','includeAll','include','VoiceMail','findAll','rows','catch','show','params','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','VoiceMailMessage','pick','filter','mailbox'];(function(_0x432666,_0x1987fd){var _0x411329=function(_0x53dc4d){while(--_0x53dc4d){_0x432666['push'](_0x432666['shift']());}};_0x411329(++_0x1987fd);}(_0x5eb8,0xb0));var _0x85eb=function(_0x366e51,_0x3a0178){_0x366e51=_0x366e51-0x0;var _0x4e23e3=_0x5eb8[_0x366e51];return _0x4e23e3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x85eb('0x0'));var jsonpatch=require(_0x85eb('0x1'));var rp=require(_0x85eb('0x2'));var moment=require(_0x85eb('0x3'));var BPromise=require(_0x85eb('0x4'));var Mustache=require(_0x85eb('0x5'));var util=require(_0x85eb('0x6'));var path=require(_0x85eb('0x7'));var sox=require(_0x85eb('0x8'));var csv=require(_0x85eb('0x9'));var ejs=require(_0x85eb('0xa'));var fs=require('fs');var fs_extra=require(_0x85eb('0xb'));var _=require('lodash');var squel=require(_0x85eb('0xc'));var crypto=require(_0x85eb('0xd'));var jsforce=require(_0x85eb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x85eb('0x9'));var querystring=require('querystring');var Papa=require(_0x85eb('0xf'));var Redis=require(_0x85eb('0x10'));var authService=require(_0x85eb('0x11'));var qs=require(_0x85eb('0x12'));var as=require(_0x85eb('0x13'));var hardwareService=require(_0x85eb('0x14'));var logger=require(_0x85eb('0x15'))('api');var utils=require(_0x85eb('0x16'));var config=require(_0x85eb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x85eb('0x18'))['db'];function respondWithStatusCode(_0x784583,_0x2f42ba){_0x2f42ba=_0x2f42ba||0xcc;return function(_0x259f72){if(_0x259f72){return _0x784583['sendStatus'](_0x2f42ba);}return _0x784583['status'](_0x2f42ba)[_0x85eb('0x19')]();};}function respondWithResult(_0x5c760a,_0x18ca53){_0x18ca53=_0x18ca53||0xc8;return function(_0x23a82a){if(_0x23a82a){return _0x5c760a[_0x85eb('0x1a')](_0x18ca53)[_0x85eb('0x1b')](_0x23a82a);}};}function respondWithFilteredResult(_0x183b0c,_0x49efdf){return function(_0x2e5c0a){if(_0x2e5c0a){var _0x59237b=typeof _0x49efdf[_0x85eb('0x1c')]===_0x85eb('0x1d')&&typeof _0x49efdf[_0x85eb('0x1e')]===_0x85eb('0x1d');var _0x5dbeda=_0x2e5c0a['count'];var _0x50d2a8=_0x59237b?0x0:_0x49efdf[_0x85eb('0x1c')];var _0x39ca96=_0x59237b?_0x2e5c0a[_0x85eb('0x1f')]:_0x49efdf[_0x85eb('0x1c')]+_0x49efdf[_0x85eb('0x1e')];var _0x34f875;if(_0x39ca96>=_0x5dbeda){_0x39ca96=_0x5dbeda;_0x34f875=0xc8;}else{_0x34f875=0xce;}_0x183b0c['status'](_0x34f875);return _0x183b0c[_0x85eb('0x20')](_0x85eb('0x21'),_0x50d2a8+'-'+_0x39ca96+'/'+_0x5dbeda)[_0x85eb('0x1b')](_0x2e5c0a);}return null;};}function patchUpdates(_0x4e8041){return function(_0x4b4b38){try{jsonpatch['apply'](_0x4b4b38,_0x4e8041,!![]);}catch(_0x55b9e4){return BPromise[_0x85eb('0x22')](_0x55b9e4);}return _0x4b4b38[_0x85eb('0x23')]();};}function saveUpdates(_0x329fc5,_0x255ca7){return function(_0x465c74){if(_0x465c74){return _0x465c74[_0x85eb('0x24')](_0x329fc5)['then'](function(_0x5491d5){return _0x5491d5;});}return null;};}function removeEntity(_0x5b48d9,_0x298e84){return function(_0x1426c8){if(_0x1426c8){return _0x1426c8[_0x85eb('0x25')]()[_0x85eb('0x26')](function(){var _0x312b3e=_0x1426c8[_0x85eb('0x27')]({'plain':!![]});var _0x5dfc96=_0x85eb('0x28');return db[_0x85eb('0x29')][_0x85eb('0x25')]({'where':{'type':_0x5dfc96,'resourceId':_0x312b3e['id']}})[_0x85eb('0x26')](function(){return _0x1426c8;});})[_0x85eb('0x26')](function(){_0x5b48d9['status'](0xcc)[_0x85eb('0x19')]();});}};}function handleEntityNotFound(_0x792d3a,_0x291557){return function(_0x3e7eb9){if(!_0x3e7eb9){_0x792d3a[_0x85eb('0x2a')](0x194);}return _0x3e7eb9;};}function handleError(_0x29d262,_0x50541a){_0x50541a=_0x50541a||0x1f4;return function(_0x562792){logger[_0x85eb('0x2b')](_0x562792['stack']);if(_0x562792[_0x85eb('0x2c')]){delete _0x562792['name'];}_0x29d262[_0x85eb('0x1a')](_0x50541a)[_0x85eb('0x2d')](_0x562792);};}exports[_0x85eb('0x2e')]=function(_0x1d9278,_0xa67e1c){var _0xf4ac13={},_0x41ed76={},_0x5decd5={'count':0x0,'rows':[]};var _0x237f19=_[_0x85eb('0x2f')](db['VoiceMail'][_0x85eb('0x30')],function(_0x5af2de){return{'name':_0x5af2de['fieldName'],'type':_0x5af2de[_0x85eb('0x31')][_0x85eb('0x32')]};});_0x41ed76[_0x85eb('0x33')]=_[_0x85eb('0x2f')](_0x237f19,_0x85eb('0x2c'));_0x41ed76[_0x85eb('0x34')]=_[_0x85eb('0x35')](_0x1d9278[_0x85eb('0x34')]);_0x41ed76[_0x85eb('0x36')]=_[_0x85eb('0x37')](_0x41ed76['model'],_0x41ed76[_0x85eb('0x34')]);_0xf4ac13[_0x85eb('0x38')]=_['intersection'](_0x41ed76['model'],qs[_0x85eb('0x39')](_0x1d9278[_0x85eb('0x34')][_0x85eb('0x39')]));_0xf4ac13[_0x85eb('0x38')]=_0xf4ac13[_0x85eb('0x38')][_0x85eb('0x3a')]?_0xf4ac13[_0x85eb('0x38')]:_0x41ed76[_0x85eb('0x33')];if(!_0x1d9278[_0x85eb('0x34')][_0x85eb('0x3b')](_0x85eb('0x3c'))){_0xf4ac13[_0x85eb('0x1e')]=qs[_0x85eb('0x1e')](_0x1d9278[_0x85eb('0x34')]['limit']);_0xf4ac13[_0x85eb('0x1c')]=qs[_0x85eb('0x1c')](_0x1d9278['query']['offset']);}_0xf4ac13[_0x85eb('0x3d')]=qs[_0x85eb('0x3e')](_0x1d9278['query'][_0x85eb('0x3e')]);_0xf4ac13['where']=qs[_0x85eb('0x36')](_['pick'](_0x1d9278[_0x85eb('0x34')],_0x41ed76['filters']),_0x237f19);if(_0x1d9278[_0x85eb('0x34')]['filter']){_0xf4ac13[_0x85eb('0x3f')]=_[_0x85eb('0x40')](_0xf4ac13['where'],{'$or':_[_0x85eb('0x2f')](_0x237f19,function(_0x5a1c15){if(_0x5a1c15[_0x85eb('0x31')]!==_0x85eb('0x41')){var _0x5c0156={};_0x5c0156[_0x5a1c15[_0x85eb('0x2c')]]={'$like':'%'+_0x1d9278['query']['filter']+'%'};return _0x5c0156;}})});}_0xf4ac13=_[_0x85eb('0x40')]({},_0xf4ac13,_0x1d9278['options']);var _0x17cc20={'where':_0xf4ac13[_0x85eb('0x3f')]};return db['VoiceMail']['count'](_0x17cc20)[_0x85eb('0x26')](function(_0x422ec3){_0x5decd5['count']=_0x422ec3;if(_0x1d9278['query'][_0x85eb('0x42')]){_0xf4ac13[_0x85eb('0x43')]=[{'all':!![]}];}return db[_0x85eb('0x44')][_0x85eb('0x45')](_0xf4ac13);})[_0x85eb('0x26')](function(_0x5b7411){_0x5decd5[_0x85eb('0x46')]=_0x5b7411;return _0x5decd5;})[_0x85eb('0x26')](respondWithFilteredResult(_0xa67e1c,_0xf4ac13))[_0x85eb('0x47')](handleError(_0xa67e1c,null));};exports[_0x85eb('0x48')]=function(_0x2ed39d,_0xbc43a7){var _0x40e2a2={'raw':!![],'where':{'id':_0x2ed39d[_0x85eb('0x49')]['id']}},_0x3e11a8={};_0x3e11a8['model']=_[_0x85eb('0x35')](db[_0x85eb('0x44')]['rawAttributes']);_0x3e11a8[_0x85eb('0x34')]=_[_0x85eb('0x35')](_0x2ed39d[_0x85eb('0x34')]);_0x3e11a8[_0x85eb('0x36')]=_[_0x85eb('0x37')](_0x3e11a8[_0x85eb('0x33')],_0x3e11a8['query']);_0x40e2a2[_0x85eb('0x38')]=_[_0x85eb('0x37')](_0x3e11a8[_0x85eb('0x33')],qs[_0x85eb('0x39')](_0x2ed39d[_0x85eb('0x34')][_0x85eb('0x39')]));_0x40e2a2[_0x85eb('0x38')]=_0x40e2a2[_0x85eb('0x38')]['length']?_0x40e2a2[_0x85eb('0x38')]:_0x3e11a8[_0x85eb('0x33')];if(_0x2ed39d[_0x85eb('0x34')][_0x85eb('0x42')]){_0x40e2a2[_0x85eb('0x43')]=[{'all':!![]}];}_0x40e2a2=_[_0x85eb('0x40')]({},_0x40e2a2,_0x2ed39d[_0x85eb('0x4a')]);return db[_0x85eb('0x44')][_0x85eb('0x4b')](_0x40e2a2)[_0x85eb('0x26')](handleEntityNotFound(_0xbc43a7,null))[_0x85eb('0x26')](respondWithResult(_0xbc43a7,null))[_0x85eb('0x47')](handleError(_0xbc43a7,null));};exports['create']=function(_0x11da79,_0x2c951b){return db[_0x85eb('0x44')]['create'](_0x11da79[_0x85eb('0x4c')],{})[_0x85eb('0x26')](function(_0x2cf928){var _0xd2f302=_0x11da79[_0x85eb('0x4d')]['get']({'plain':!![]});if(!_0xd2f302)throw new Error(_0x85eb('0x4e'));if(_0xd2f302[_0x85eb('0x4f')]===_0x85eb('0x4d')){var _0x50e264=_0x2cf928[_0x85eb('0x27')]({'plain':!![]});var _0x4550fd=_0x85eb('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x4550fd,'userProfileId':_0xd2f302[_0x85eb('0x50')]},'raw':!![]})['then'](function(_0x5ed98a){if(_0x5ed98a&&_0x5ed98a[_0x85eb('0x51')]===0x0){return db['UserProfileResource'][_0x85eb('0x52')]({'name':_0x50e264[_0x85eb('0x2c')],'resourceId':_0x50e264['id'],'type':_0x5ed98a['name'],'sectionId':_0x5ed98a['id']},{})['then'](function(){return _0x2cf928;});}else{return _0x2cf928;}})[_0x85eb('0x47')](function(_0x249511){logger[_0x85eb('0x2b')](_0x85eb('0x53'),_0x249511);throw _0x249511;});}return _0x2cf928;})[_0x85eb('0x26')](respondWithResult(_0x2c951b,0xc9))['catch'](handleError(_0x2c951b,null));};exports[_0x85eb('0x24')]=function(_0x30062e,_0x270bb2){if(_0x30062e[_0x85eb('0x4c')]['id']){delete _0x30062e[_0x85eb('0x4c')]['id'];}return db['VoiceMail'][_0x85eb('0x4b')]({'where':{'id':_0x30062e['params']['id']}})[_0x85eb('0x26')](handleEntityNotFound(_0x270bb2,null))[_0x85eb('0x26')](saveUpdates(_0x30062e['body'],null))[_0x85eb('0x26')](respondWithResult(_0x270bb2,null))[_0x85eb('0x47')](handleError(_0x270bb2,null));};exports[_0x85eb('0x25')]=function(_0x26e04a,_0x214ef7){return db[_0x85eb('0x44')]['find']({'where':{'id':_0x26e04a[_0x85eb('0x49')]['id']}})['then'](handleEntityNotFound(_0x214ef7,null))[_0x85eb('0x26')](removeEntity(_0x214ef7,null))[_0x85eb('0x47')](handleError(_0x214ef7,null));};exports['getMessages']=function(_0x152452,_0x2a0f8b,_0x4a3af9){return db[_0x85eb('0x44')]['findOne']({'where':{'id':_0x152452[_0x85eb('0x49')]['id']}})[_0x85eb('0x26')](handleEntityNotFound(_0x2a0f8b,null))[_0x85eb('0x26')](function(_0x13c0b3){var _0x45a201;var _0x15d4a7={},_0x5a729e={};_0x5a729e[_0x85eb('0x33')]=_[_0x85eb('0x35')](db[_0x85eb('0x54')][_0x85eb('0x30')]);_0x5a729e[_0x85eb('0x34')]=_[_0x85eb('0x35')](_0x152452[_0x85eb('0x34')]);_0x5a729e[_0x85eb('0x36')]=_[_0x85eb('0x37')](_0x5a729e[_0x85eb('0x33')],_0x5a729e[_0x85eb('0x34')]);_0x15d4a7['attributes']=_[_0x85eb('0x37')](_0x5a729e[_0x85eb('0x33')],qs[_0x85eb('0x39')](_0x152452[_0x85eb('0x34')][_0x85eb('0x39')]));_0x15d4a7[_0x85eb('0x38')]=_0x15d4a7['attributes'][_0x85eb('0x3a')]?_0x15d4a7['attributes']:_0x5a729e[_0x85eb('0x33')];if(!_0x152452[_0x85eb('0x34')][_0x85eb('0x3b')](_0x85eb('0x3c'))){_0x15d4a7[_0x85eb('0x1e')]=qs['limit'](_0x152452[_0x85eb('0x34')][_0x85eb('0x1e')]);_0x15d4a7[_0x85eb('0x1c')]=qs[_0x85eb('0x1c')](_0x152452[_0x85eb('0x34')][_0x85eb('0x1c')]);}_0x15d4a7[_0x85eb('0x3d')]=qs[_0x85eb('0x3e')](_0x152452['query'][_0x85eb('0x3e')]);_0x15d4a7['where']=qs[_0x85eb('0x36')](_[_0x85eb('0x55')](_0x152452[_0x85eb('0x34')],_0x5a729e[_0x85eb('0x36')]));if(_0x152452[_0x85eb('0x34')]['filter']){_0x15d4a7[_0x85eb('0x3f')]=_[_0x85eb('0x40')](_0x15d4a7[_0x85eb('0x3f')],{'$or':_[_0x85eb('0x2f')](_0x15d4a7[_0x85eb('0x38')],function(_0x419b24){var _0x562ffa={};_0x562ffa[_0x419b24]={'$like':'%'+_0x152452['query'][_0x85eb('0x56')]+'%'};return _0x562ffa;})});}_0x15d4a7['where']=_[_0x85eb('0x40')](_0x15d4a7[_0x85eb('0x3f')],{'mailboxuser':_0x13c0b3[_0x85eb('0x57')]});_0x15d4a7=_[_0x85eb('0x40')]({},_0x15d4a7,_0x152452[_0x85eb('0x4a')]);return db[_0x85eb('0x54')]['findAndCountAll'](_0x15d4a7)[_0x85eb('0x26')](respondWithFilteredResult(_0x2a0f8b,_0x15d4a7));})[_0x85eb('0x47')](handleError(_0x2a0f8b,null));}; \ No newline at end of file +var _0xbdb7=['map','query','filters','intersection','model','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','keys','fields','include','find','create','body','role','user','get','Voicemails','UserProfileSection','userProfileId','autoAssociation','destroy','getMessages','findOne','nolimit','mailbox','VoiceMailMessage','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save','update','UserProfileResource','then','sendStatus','error','stack','name','send','index','VoiceMail','rawAttributes','fieldName'];(function(_0x35876e,_0x38da6e){var _0x2e736d=function(_0x1dd161){while(--_0x1dd161){_0x35876e['push'](_0x35876e['shift']());}};_0x2e736d(++_0x38da6e);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x13e724,_0x296739){_0x13e724=_0x13e724-0x0;var _0x334a44=_0xbdb7[_0x13e724];return _0x334a44;};'use strict';var emlformat=require(_0x7bdb('0x0'));var rimraf=require(_0x7bdb('0x1'));var zipdir=require(_0x7bdb('0x2'));var jsonpatch=require(_0x7bdb('0x3'));var rp=require(_0x7bdb('0x4'));var moment=require(_0x7bdb('0x5'));var BPromise=require(_0x7bdb('0x6'));var Mustache=require(_0x7bdb('0x7'));var util=require(_0x7bdb('0x8'));var path=require('path');var sox=require(_0x7bdb('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7bdb('0xa'));var _=require(_0x7bdb('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7bdb('0xc'));var deskjs=require(_0x7bdb('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7bdb('0xe'));var Redis=require(_0x7bdb('0xf'));var authService=require(_0x7bdb('0x10'));var qs=require(_0x7bdb('0x11'));var as=require(_0x7bdb('0x12'));var hardwareService=require(_0x7bdb('0x13'));var logger=require(_0x7bdb('0x14'))(_0x7bdb('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7bdb('0x16'))['db'];function respondWithStatusCode(_0x25e3cb,_0x496613){_0x496613=_0x496613||0xcc;return function(_0x8d74ff){if(_0x8d74ff){return _0x25e3cb['sendStatus'](_0x496613);}return _0x25e3cb['status'](_0x496613)[_0x7bdb('0x17')]();};}function respondWithResult(_0x46dd4a,_0x4fd91a){_0x4fd91a=_0x4fd91a||0xc8;return function(_0x50eeca){if(_0x50eeca){return _0x46dd4a['status'](_0x4fd91a)[_0x7bdb('0x18')](_0x50eeca);}};}function respondWithFilteredResult(_0x195b2e,_0xe9919f){return function(_0x25d417){if(_0x25d417){var _0x31c909=typeof _0xe9919f[_0x7bdb('0x19')]===_0x7bdb('0x1a')&&typeof _0xe9919f[_0x7bdb('0x1b')]==='undefined';var _0x1c5750=_0x25d417[_0x7bdb('0x1c')];var _0x5723f4=_0x31c909?0x0:_0xe9919f[_0x7bdb('0x19')];var _0x4ffd4b=_0x31c909?_0x25d417[_0x7bdb('0x1c')]:_0xe9919f[_0x7bdb('0x19')]+_0xe9919f['limit'];var _0x3e5f8e;if(_0x4ffd4b>=_0x1c5750){_0x4ffd4b=_0x1c5750;_0x3e5f8e=0xc8;}else{_0x3e5f8e=0xce;}_0x195b2e[_0x7bdb('0x1d')](_0x3e5f8e);return _0x195b2e[_0x7bdb('0x1e')](_0x7bdb('0x1f'),_0x5723f4+'-'+_0x4ffd4b+'/'+_0x1c5750)[_0x7bdb('0x18')](_0x25d417);}return null;};}function patchUpdates(_0x5bfc35){return function(_0x49f353){try{jsonpatch[_0x7bdb('0x20')](_0x49f353,_0x5bfc35,!![]);}catch(_0xcb25f2){return BPromise['reject'](_0xcb25f2);}return _0x49f353[_0x7bdb('0x21')]();};}function saveUpdates(_0x118ea1,_0x346c72){return function(_0x3f53e7){if(_0x3f53e7){return _0x3f53e7[_0x7bdb('0x22')](_0x118ea1)['then'](function(_0x1d37ac){return _0x1d37ac;});}return null;};}function removeEntity(_0xdad53d,_0x40c447){return function(_0x3a456f){if(_0x3a456f){return _0x3a456f['destroy']()['then'](function(){var _0x3c423f=_0x3a456f['get']({'plain':!![]});var _0x47abaf='Voicemails';return db[_0x7bdb('0x23')]['destroy']({'where':{'type':_0x47abaf,'resourceId':_0x3c423f['id']}})[_0x7bdb('0x24')](function(){return _0x3a456f;});})[_0x7bdb('0x24')](function(){_0xdad53d[_0x7bdb('0x1d')](0xcc)[_0x7bdb('0x17')]();});}};}function handleEntityNotFound(_0x2a494e,_0x523869){return function(_0x10e818){if(!_0x10e818){_0x2a494e[_0x7bdb('0x25')](0x194);}return _0x10e818;};}function handleError(_0x399b62,_0xe1141d){_0xe1141d=_0xe1141d||0x1f4;return function(_0x371e8a){logger[_0x7bdb('0x26')](_0x371e8a[_0x7bdb('0x27')]);if(_0x371e8a[_0x7bdb('0x28')]){delete _0x371e8a[_0x7bdb('0x28')];}_0x399b62[_0x7bdb('0x1d')](_0xe1141d)[_0x7bdb('0x29')](_0x371e8a);};}exports[_0x7bdb('0x2a')]=function(_0x5b386d,_0x388a45){var _0x23fc3a={},_0x8f7672={},_0x9f5c1={'count':0x0,'rows':[]};var _0x29eac5=_['map'](db[_0x7bdb('0x2b')][_0x7bdb('0x2c')],function(_0x9ac56){return{'name':_0x9ac56[_0x7bdb('0x2d')],'type':_0x9ac56['type']['key']};});_0x8f7672['model']=_[_0x7bdb('0x2e')](_0x29eac5,'name');_0x8f7672[_0x7bdb('0x2f')]=_['keys'](_0x5b386d[_0x7bdb('0x2f')]);_0x8f7672[_0x7bdb('0x30')]=_[_0x7bdb('0x31')](_0x8f7672['model'],_0x8f7672[_0x7bdb('0x2f')]);_0x23fc3a['attributes']=_['intersection'](_0x8f7672[_0x7bdb('0x32')],qs['fields'](_0x5b386d[_0x7bdb('0x2f')]['fields']));_0x23fc3a['attributes']=_0x23fc3a[_0x7bdb('0x33')][_0x7bdb('0x34')]?_0x23fc3a[_0x7bdb('0x33')]:_0x8f7672[_0x7bdb('0x32')];if(!_0x5b386d[_0x7bdb('0x2f')][_0x7bdb('0x35')]('nolimit')){_0x23fc3a[_0x7bdb('0x1b')]=qs[_0x7bdb('0x1b')](_0x5b386d[_0x7bdb('0x2f')][_0x7bdb('0x1b')]);_0x23fc3a[_0x7bdb('0x19')]=qs[_0x7bdb('0x19')](_0x5b386d[_0x7bdb('0x2f')][_0x7bdb('0x19')]);}_0x23fc3a[_0x7bdb('0x36')]=qs['sort'](_0x5b386d['query'][_0x7bdb('0x37')]);_0x23fc3a[_0x7bdb('0x38')]=qs[_0x7bdb('0x30')](_[_0x7bdb('0x39')](_0x5b386d[_0x7bdb('0x2f')],_0x8f7672['filters']),_0x29eac5);if(_0x5b386d['query'][_0x7bdb('0x3a')]){_0x23fc3a['where']=_[_0x7bdb('0x3b')](_0x23fc3a['where'],{'$or':_[_0x7bdb('0x2e')](_0x29eac5,function(_0x5d1826){if(_0x5d1826['type']!==_0x7bdb('0x3c')){var _0x2d578e={};_0x2d578e[_0x5d1826[_0x7bdb('0x28')]]={'$like':'%'+_0x5b386d[_0x7bdb('0x2f')][_0x7bdb('0x3a')]+'%'};return _0x2d578e;}})});}_0x23fc3a=_[_0x7bdb('0x3b')]({},_0x23fc3a,_0x5b386d[_0x7bdb('0x3d')]);var _0x501aff={'where':_0x23fc3a['where']};return db[_0x7bdb('0x2b')][_0x7bdb('0x1c')](_0x501aff)[_0x7bdb('0x24')](function(_0x3509e4){_0x9f5c1[_0x7bdb('0x1c')]=_0x3509e4;if(_0x5b386d[_0x7bdb('0x2f')][_0x7bdb('0x3e')]){_0x23fc3a['include']=[{'all':!![]}];}return db['VoiceMail'][_0x7bdb('0x3f')](_0x23fc3a);})[_0x7bdb('0x24')](function(_0x4636f8){_0x9f5c1[_0x7bdb('0x40')]=_0x4636f8;return _0x9f5c1;})['then'](respondWithFilteredResult(_0x388a45,_0x23fc3a))[_0x7bdb('0x41')](handleError(_0x388a45,null));};exports['show']=function(_0x37029b,_0x27de25){var _0x218361={'raw':!![],'where':{'id':_0x37029b[_0x7bdb('0x42')]['id']}},_0x264f3a={};_0x264f3a[_0x7bdb('0x32')]=_[_0x7bdb('0x43')](db[_0x7bdb('0x2b')][_0x7bdb('0x2c')]);_0x264f3a['query']=_[_0x7bdb('0x43')](_0x37029b[_0x7bdb('0x2f')]);_0x264f3a['filters']=_[_0x7bdb('0x31')](_0x264f3a['model'],_0x264f3a[_0x7bdb('0x2f')]);_0x218361[_0x7bdb('0x33')]=_[_0x7bdb('0x31')](_0x264f3a[_0x7bdb('0x32')],qs[_0x7bdb('0x44')](_0x37029b['query'][_0x7bdb('0x44')]));_0x218361[_0x7bdb('0x33')]=_0x218361[_0x7bdb('0x33')][_0x7bdb('0x34')]?_0x218361[_0x7bdb('0x33')]:_0x264f3a['model'];if(_0x37029b[_0x7bdb('0x2f')][_0x7bdb('0x3e')]){_0x218361[_0x7bdb('0x45')]=[{'all':!![]}];}_0x218361=_[_0x7bdb('0x3b')]({},_0x218361,_0x37029b[_0x7bdb('0x3d')]);return db[_0x7bdb('0x2b')][_0x7bdb('0x46')](_0x218361)[_0x7bdb('0x24')](handleEntityNotFound(_0x27de25,null))[_0x7bdb('0x24')](respondWithResult(_0x27de25,null))[_0x7bdb('0x41')](handleError(_0x27de25,null));};exports['create']=function(_0x189cf8,_0x58c4bc){return db['VoiceMail'][_0x7bdb('0x47')](_0x189cf8[_0x7bdb('0x48')],{})['then'](function(_0x37780a){var _0x186809=_0x189cf8['user']['get']({'plain':!![]});if(!_0x186809)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x186809[_0x7bdb('0x49')]===_0x7bdb('0x4a')){var _0x2fab74=_0x37780a[_0x7bdb('0x4b')]({'plain':!![]});var _0x33687b=_0x7bdb('0x4c');return db[_0x7bdb('0x4d')][_0x7bdb('0x46')]({'where':{'name':_0x33687b,'userProfileId':_0x186809[_0x7bdb('0x4e')]},'raw':!![]})[_0x7bdb('0x24')](function(_0x5a8d4a){if(_0x5a8d4a&&_0x5a8d4a[_0x7bdb('0x4f')]===0x0){return db['UserProfileResource'][_0x7bdb('0x47')]({'name':_0x2fab74[_0x7bdb('0x28')],'resourceId':_0x2fab74['id'],'type':_0x5a8d4a[_0x7bdb('0x28')],'sectionId':_0x5a8d4a['id']},{})[_0x7bdb('0x24')](function(){return _0x37780a;});}else{return _0x37780a;}})['catch'](function(_0x258f29){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x258f29);throw _0x258f29;});}return _0x37780a;})[_0x7bdb('0x24')](respondWithResult(_0x58c4bc,0xc9))[_0x7bdb('0x41')](handleError(_0x58c4bc,null));};exports['update']=function(_0x4e17f3,_0x49bb3f){if(_0x4e17f3[_0x7bdb('0x48')]['id']){delete _0x4e17f3['body']['id'];}return db['VoiceMail'][_0x7bdb('0x46')]({'where':{'id':_0x4e17f3[_0x7bdb('0x42')]['id']}})[_0x7bdb('0x24')](handleEntityNotFound(_0x49bb3f,null))[_0x7bdb('0x24')](saveUpdates(_0x4e17f3['body'],null))[_0x7bdb('0x24')](respondWithResult(_0x49bb3f,null))['catch'](handleError(_0x49bb3f,null));};exports[_0x7bdb('0x50')]=function(_0x7f2d89,_0x82f990){return db[_0x7bdb('0x2b')][_0x7bdb('0x46')]({'where':{'id':_0x7f2d89[_0x7bdb('0x42')]['id']}})['then'](handleEntityNotFound(_0x82f990,null))[_0x7bdb('0x24')](removeEntity(_0x82f990,null))[_0x7bdb('0x41')](handleError(_0x82f990,null));};exports[_0x7bdb('0x51')]=function(_0x58658e,_0x2b5493,_0x1d9927){return db['VoiceMail'][_0x7bdb('0x52')]({'where':{'id':_0x58658e['params']['id']}})[_0x7bdb('0x24')](handleEntityNotFound(_0x2b5493,null))[_0x7bdb('0x24')](function(_0x4f3f8c){var _0x478bbd;var _0x21a54f={},_0x2a6c5b={};_0x2a6c5b['model']=_[_0x7bdb('0x43')](db['VoiceMailMessage'][_0x7bdb('0x2c')]);_0x2a6c5b['query']=_['keys'](_0x58658e[_0x7bdb('0x2f')]);_0x2a6c5b[_0x7bdb('0x30')]=_[_0x7bdb('0x31')](_0x2a6c5b[_0x7bdb('0x32')],_0x2a6c5b[_0x7bdb('0x2f')]);_0x21a54f[_0x7bdb('0x33')]=_[_0x7bdb('0x31')](_0x2a6c5b[_0x7bdb('0x32')],qs[_0x7bdb('0x44')](_0x58658e[_0x7bdb('0x2f')][_0x7bdb('0x44')]));_0x21a54f[_0x7bdb('0x33')]=_0x21a54f['attributes'][_0x7bdb('0x34')]?_0x21a54f[_0x7bdb('0x33')]:_0x2a6c5b['model'];if(!_0x58658e[_0x7bdb('0x2f')][_0x7bdb('0x35')](_0x7bdb('0x53'))){_0x21a54f[_0x7bdb('0x1b')]=qs[_0x7bdb('0x1b')](_0x58658e['query'][_0x7bdb('0x1b')]);_0x21a54f[_0x7bdb('0x19')]=qs[_0x7bdb('0x19')](_0x58658e['query'][_0x7bdb('0x19')]);}_0x21a54f[_0x7bdb('0x36')]=qs[_0x7bdb('0x37')](_0x58658e[_0x7bdb('0x2f')][_0x7bdb('0x37')]);_0x21a54f[_0x7bdb('0x38')]=qs[_0x7bdb('0x30')](_[_0x7bdb('0x39')](_0x58658e[_0x7bdb('0x2f')],_0x2a6c5b['filters']));if(_0x58658e[_0x7bdb('0x2f')][_0x7bdb('0x3a')]){_0x21a54f[_0x7bdb('0x38')]=_[_0x7bdb('0x3b')](_0x21a54f[_0x7bdb('0x38')],{'$or':_[_0x7bdb('0x2e')](_0x21a54f[_0x7bdb('0x33')],function(_0x86c6ed){var _0x4565c2={};_0x4565c2[_0x86c6ed]={'$like':'%'+_0x58658e[_0x7bdb('0x2f')][_0x7bdb('0x3a')]+'%'};return _0x4565c2;})});}_0x21a54f[_0x7bdb('0x38')]=_[_0x7bdb('0x3b')](_0x21a54f['where'],{'mailboxuser':_0x4f3f8c[_0x7bdb('0x54')]});_0x21a54f=_['merge']({},_0x21a54f,_0x58658e[_0x7bdb('0x3d')]);return db[_0x7bdb('0x55')][_0x7bdb('0x56')](_0x21a54f)['then'](respondWithFilteredResult(_0x2b5493,_0x21a54f));})[_0x7bdb('0x41')](handleError(_0x2b5493,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 861a467..0241712 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 _0xe3a1=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','./voiceMail.attributes','exports','define','VoiceMail','mailbox_context','mailbox','context'];(function(_0x544a8f,_0x264129){var _0x672182=function(_0x35be15){while(--_0x35be15){_0x544a8f['push'](_0x544a8f['shift']());}};_0x672182(++_0x264129);}(_0xe3a1,0x10a));var _0x1e3a=function(_0x2c82fd,_0x233dc7){_0x2c82fd=_0x2c82fd-0x0;var _0x5f10db=_0xe3a1[_0x2c82fd];return _0x5f10db;};'use strict';var _=require(_0x1e3a('0x0'));var util=require('util');var logger=require(_0x1e3a('0x1'))('api');var moment=require(_0x1e3a('0x2'));var BPromise=require(_0x1e3a('0x3'));var rp=require(_0x1e3a('0x4'));var fs=require('fs');var path=require(_0x1e3a('0x5'));var rimraf=require(_0x1e3a('0x6'));var config=require('../../config/environment');var attributes=require(_0x1e3a('0x7'));module[_0x1e3a('0x8')]=function(_0x499fdf,_0x47ef2d){return _0x499fdf[_0x1e3a('0x9')](_0x1e3a('0xa'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0x1e3a('0xb'),'fields':[_0x1e3a('0xc'),_0x1e3a('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7bfe=['util','../../config/logger','api','path','rimraf','../../config/environment','./voiceMail.attributes','define','VoiceMail','voice_voicemail','mailbox','context','lodash'];(function(_0x1ce8fd,_0x1fd875){var _0xd5cdb5=function(_0x1efa4d){while(--_0x1efa4d){_0x1ce8fd['push'](_0x1ce8fd['shift']());}};_0xd5cdb5(++_0x1fd875);}(_0x7bfe,0x15e));var _0xe7bf=function(_0x48a538,_0x9f4b5){_0x48a538=_0x48a538-0x0;var _0x1531f4=_0x7bfe[_0x48a538];return _0x1531f4;};'use strict';var _=require(_0xe7bf('0x0'));var util=require(_0xe7bf('0x1'));var logger=require(_0xe7bf('0x2'))(_0xe7bf('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe7bf('0x4'));var rimraf=require(_0xe7bf('0x5'));var config=require(_0xe7bf('0x6'));var attributes=require(_0xe7bf('0x7'));module['exports']=function(_0x5e4b2d,_0x1a1db5){return _0x5e4b2d[_0xe7bf('0x8')](_0xe7bf('0x9'),attributes,{'tableName':_0xe7bf('0xa'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0xe7bf('0xb'),_0xe7bf('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index cf0d10d..488d2c5 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 _0x7a94=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x354eab,_0x4ba996){var _0x1a7fc1=function(_0x4fe192){while(--_0x4fe192){_0x354eab['push'](_0x354eab['shift']());}};_0x1a7fc1(++_0x4ba996);}(_0x7a94,0x1a8));var _0x47a9=function(_0xe695dc,_0x227af8){_0xe695dc=_0xe695dc-0x0;var _0x487e07=_0x7a94[_0xe695dc];return _0x487e07;};'use strict';var _=require(_0x47a9('0x0'));var util=require(_0x47a9('0x1'));var moment=require(_0x47a9('0x2'));var BPromise=require(_0x47a9('0x3'));var rs=require(_0x47a9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x47a9('0x5'))['db'];var utils=require(_0x47a9('0x6'));var logger=require(_0x47a9('0x7'))('rpc');var config=require(_0x47a9('0x8'));var jayson=require(_0x47a9('0x9'));var client=jayson[_0x47a9('0xa')][_0x47a9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x14b56d,_0x23e612,_0x1edda4){return new BPromise(function(_0xd9adb,_0x51c6fe){return client[_0x47a9('0xc')](_0x14b56d,_0x1edda4)[_0x47a9('0xd')](function(_0x2e048d){logger[_0x47a9('0xe')](_0x47a9('0xf'),_0x23e612,_0x47a9('0x10'));logger[_0x47a9('0x11')](_0x47a9('0x12'),_0x23e612,_0x47a9('0x10'),JSON[_0x47a9('0x13')](_0x2e048d));if(_0x2e048d[_0x47a9('0x14')]){if(_0x2e048d[_0x47a9('0x14')][_0x47a9('0x15')]===0x1f4){logger[_0x47a9('0x14')](_0x47a9('0xf'),_0x23e612,_0x2e048d[_0x47a9('0x14')][_0x47a9('0x16')]);return _0x51c6fe(_0x2e048d[_0x47a9('0x14')][_0x47a9('0x16')]);}logger[_0x47a9('0x14')](_0x47a9('0xf'),_0x23e612,_0x2e048d[_0x47a9('0x14')][_0x47a9('0x16')]);return _0xd9adb(_0x2e048d['error']['message']);}else{logger[_0x47a9('0xe')](_0x47a9('0xf'),_0x23e612,'request\x20sent');_0xd9adb(_0x2e048d[_0x47a9('0x17')][_0x47a9('0x16')]);}})[_0x47a9('0x18')](function(_0x4cab86){logger['error'](_0x47a9('0xf'),_0x23e612,_0x4cab86);_0x51c6fe(_0x4cab86);});});} \ No newline at end of file +var _0xdac4=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util'];(function(_0xb5167,_0x569307){var _0x16eaf0=function(_0x4207ee){while(--_0x4207ee){_0xb5167['push'](_0xb5167['shift']());}};_0x16eaf0(++_0x569307);}(_0xdac4,0x1ae));var _0x4dac=function(_0x47b891,_0x448882){_0x47b891=_0x47b891-0x0;var _0x4d9fa5=_0xdac4[_0x47b891];return _0x4d9fa5;};'use strict';var _=require(_0x4dac('0x0'));var util=require(_0x4dac('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4dac('0x2'));var fs=require('fs');var Redis=require(_0x4dac('0x3'));var db=require(_0x4dac('0x4'))['db'];var utils=require(_0x4dac('0x5'));var logger=require('../../config/logger')(_0x4dac('0x6'));var config=require(_0x4dac('0x7'));var jayson=require(_0x4dac('0x8'));var client=jayson[_0x4dac('0x9')][_0x4dac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a1e4a,_0x20665a,_0x22e3d6){return new BPromise(function(_0x474010,_0x312293){return client[_0x4dac('0xb')](_0x2a1e4a,_0x22e3d6)[_0x4dac('0xc')](function(_0x3b3904){logger['info'](_0x4dac('0xd'),_0x20665a,_0x4dac('0xe'));logger[_0x4dac('0xf')](_0x4dac('0x10'),_0x20665a,_0x4dac('0xe'),JSON[_0x4dac('0x11')](_0x3b3904));if(_0x3b3904[_0x4dac('0x12')]){if(_0x3b3904[_0x4dac('0x12')][_0x4dac('0x13')]===0x1f4){logger[_0x4dac('0x12')](_0x4dac('0xd'),_0x20665a,_0x3b3904[_0x4dac('0x12')]['message']);return _0x312293(_0x3b3904[_0x4dac('0x12')][_0x4dac('0x14')]);}logger['error']('VoiceMail,\x20%s,\x20%s',_0x20665a,_0x3b3904[_0x4dac('0x12')][_0x4dac('0x14')]);return _0x474010(_0x3b3904[_0x4dac('0x12')][_0x4dac('0x14')]);}else{logger[_0x4dac('0x15')](_0x4dac('0xd'),_0x20665a,_0x4dac('0xe'));_0x474010(_0x3b3904[_0x4dac('0x16')][_0x4dac('0x14')]);}})[_0x4dac('0x17')](function(_0x3af1d0){logger[_0x4dac('0x12')](_0x4dac('0xd'),_0x20665a,_0x3af1d0);_0x312293(_0x3af1d0);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 2015a0c..128aa1f 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 _0xa33d=['../../config/environment','./voiceMailMessage.controller','isAuthenticated','index','get','/:id','show','/:id/download','download','post','create','put','update','delete','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x29ce14,_0x334166){var _0x48f289=function(_0x288d11){while(--_0x288d11){_0x29ce14['push'](_0x29ce14['shift']());}};_0x48f289(++_0x334166);}(_0xa33d,0x170));var _0xda33=function(_0x15d0a2,_0x4dd3f7){_0x15d0a2=_0x15d0a2-0x0;var _0x2a9c8d=_0xa33d[_0x15d0a2];return _0x2a9c8d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xda33('0x0'));var timeout=require('connect-timeout');var express=require(_0xda33('0x1'));var router=express[_0xda33('0x2')]();var fs_extra=require(_0xda33('0x3'));var auth=require(_0xda33('0x4'));var interaction=require(_0xda33('0x5'));var config=require(_0xda33('0x6'));var controller=require(_0xda33('0x7'));router['get']('/',auth[_0xda33('0x8')](),controller[_0xda33('0x9')]);router[_0xda33('0xa')](_0xda33('0xb'),auth['isAuthenticated'](),controller[_0xda33('0xc')]);router['get'](_0xda33('0xd'),auth[_0xda33('0x8')](),controller[_0xda33('0xe')]);router[_0xda33('0xf')]('/',auth[_0xda33('0x8')](),controller[_0xda33('0x10')]);router[_0xda33('0x11')](_0xda33('0xb'),auth[_0xda33('0x8')](),controller[_0xda33('0x12')]);router[_0xda33('0x13')](_0xda33('0xb'),auth[_0xda33('0x8')](),controller[_0xda33('0x14')]);module[_0xda33('0x15')]=router; \ No newline at end of file +var _0x0b21=['show','get','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','isAuthenticated','/:id'];(function(_0x4171ce,_0x1c78e0){var _0x151812=function(_0x129fbe){while(--_0x129fbe){_0x4171ce['push'](_0x4171ce['shift']());}};_0x151812(++_0x1c78e0);}(_0x0b21,0x100));var _0x10b2=function(_0x366d91,_0x4abd6c){_0x366d91=_0x366d91-0x0;var _0x11ac2c=_0x0b21[_0x366d91];return _0x11ac2c;};'use strict';var multer=require(_0x10b2('0x0'));var util=require('util');var path=require(_0x10b2('0x1'));var timeout=require(_0x10b2('0x2'));var express=require('express');var router=express[_0x10b2('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x10b2('0x4'));var interaction=require(_0x10b2('0x5'));var config=require(_0x10b2('0x6'));var controller=require(_0x10b2('0x7'));router['get']('/',auth[_0x10b2('0x8')](),controller['index']);router['get'](_0x10b2('0x9'),auth[_0x10b2('0x8')](),controller[_0x10b2('0xa')]);router[_0x10b2('0xb')]('/:id/download',auth[_0x10b2('0x8')](),controller['download']);router[_0x10b2('0xc')]('/',auth[_0x10b2('0x8')](),controller[_0x10b2('0xd')]);router[_0x10b2('0xe')](_0x10b2('0x9'),auth[_0x10b2('0x8')](),controller[_0x10b2('0xf')]);router[_0x10b2('0x10')](_0x10b2('0x9'),auth[_0x10b2('0x8')](),controller[_0x10b2('0x11')]);module[_0x10b2('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index a8b1a65..9c83038 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 _0xdc4c=['long','TIMESTAMP','literal','sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB'];(function(_0x40326d,_0x535665){var _0x3bb05b=function(_0xbe6959){while(--_0xbe6959){_0x40326d['push'](_0x40326d['shift']());}};_0x3bb05b(++_0x535665);}(_0xdc4c,0x193));var _0xcdc4=function(_0x58a650,_0x3e8776){_0x58a650=_0x58a650-0x0;var _0x358a4d=_0xdc4c[_0x58a650];return _0x358a4d;};'use strict';var Sequelize=require(_0xcdc4('0x0'));module[_0xcdc4('0x1')]={'name':{'type':Sequelize[_0xcdc4('0x2')],'get':function(_0x184fbe){return this[_0xcdc4('0x3')]('id');}},'msgnum':{'type':Sequelize[_0xcdc4('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xcdc4('0x5')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xcdc4('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0xcdc4('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0xcdc4('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0xcdc4('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xcdc4('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xcdc4('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0xcdc4('0x6')](_0xcdc4('0x7')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0xcdc4('0x5')],'defaultValue':''},'stamp':{'type':_0xcdc4('0x8'),'defaultValue':Sequelize[_0xcdc4('0x9')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0x8edb=['sequelize','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0x5346b0,_0x5c93f2){var _0x4d07ce=function(_0x485168){while(--_0x485168){_0x5346b0['push'](_0x5346b0['shift']());}};_0x4d07ce(++_0x5c93f2);}(_0x8edb,0x168));var _0xb8ed=function(_0x1c0c46,_0x3b22f9){_0x1c0c46=_0x1c0c46-0x0;var _0x419585=_0x8edb[_0x1c0c46];return _0x419585;};'use strict';var Sequelize=require(_0xb8ed('0x0'));module['exports']={'name':{'type':Sequelize[_0xb8ed('0x1')],'get':function(_0x16b197){return this[_0xb8ed('0x2')]('id');}},'msgnum':{'type':Sequelize[_0xb8ed('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xb8ed('0x4')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0xb8ed('0x4')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0xb8ed('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xb8ed('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0xb8ed('0x5')](_0xb8ed('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0xb8ed('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xb8ed('0x4')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0xb8ed('0x7')](_0xb8ed('0x8'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index ef542ea..7b6abb7 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 _0x51bd=['msg_id','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','where','merge','VIRTUAL','options','VoiceMailMessage','includeAll','rows','params','include','find','catch','create','body','destroy','recording'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0x51bd,0x108));var _0xd51b=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x51bd[_0x4e676e];return _0x336a3c;};'use strict';var emlformat=require(_0xd51b('0x0'));var rimraf=require(_0xd51b('0x1'));var zipdir=require(_0xd51b('0x2'));var jsonpatch=require(_0xd51b('0x3'));var rp=require(_0xd51b('0x4'));var moment=require(_0xd51b('0x5'));var BPromise=require(_0xd51b('0x6'));var Mustache=require('mustache');var util=require(_0xd51b('0x7'));var path=require(_0xd51b('0x8'));var sox=require(_0xd51b('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd51b('0xa'));var _=require(_0xd51b('0xb'));var squel=require(_0xd51b('0xc'));var crypto=require(_0xd51b('0xd'));var jsforce=require(_0xd51b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd51b('0xf'));var querystring=require(_0xd51b('0x10'));var Papa=require(_0xd51b('0x11'));var Redis=require(_0xd51b('0x12'));var authService=require(_0xd51b('0x13'));var qs=require(_0xd51b('0x14'));var as=require(_0xd51b('0x15'));var hardwareService=require(_0xd51b('0x16'));var logger=require(_0xd51b('0x17'))('api');var utils=require(_0xd51b('0x18'));var config=require(_0xd51b('0x19'));var licenseUtil=require(_0xd51b('0x1a'));var db=require(_0xd51b('0x1b'))['db'];function respondWithStatusCode(_0xeaab34,_0x1056c9){_0x1056c9=_0x1056c9||0xcc;return function(_0x5e215d){if(_0x5e215d){return _0xeaab34[_0xd51b('0x1c')](_0x1056c9);}return _0xeaab34[_0xd51b('0x1d')](_0x1056c9)['end']();};}function respondWithResult(_0x27bbe8,_0x44136c){_0x44136c=_0x44136c||0xc8;return function(_0x47bc7b){if(_0x47bc7b){return _0x27bbe8['status'](_0x44136c)[_0xd51b('0x1e')](_0x47bc7b);}};}function respondWithFilteredResult(_0xb76df7,_0x2e40d1){return function(_0x10a07a){if(_0x10a07a){var _0x3f616a=typeof _0x2e40d1[_0xd51b('0x1f')]===_0xd51b('0x20')&&typeof _0x2e40d1[_0xd51b('0x21')]===_0xd51b('0x20');var _0x28d674=_0x10a07a[_0xd51b('0x22')];var _0x15708a=_0x3f616a?0x0:_0x2e40d1['offset'];var _0x11cfad=_0x3f616a?_0x10a07a['count']:_0x2e40d1['offset']+_0x2e40d1[_0xd51b('0x21')];var _0x156939;if(_0x11cfad>=_0x28d674){_0x11cfad=_0x28d674;_0x156939=0xc8;}else{_0x156939=0xce;}_0xb76df7[_0xd51b('0x1d')](_0x156939);return _0xb76df7[_0xd51b('0x23')](_0xd51b('0x24'),_0x15708a+'-'+_0x11cfad+'/'+_0x28d674)[_0xd51b('0x1e')](_0x10a07a);}return null;};}function patchUpdates(_0x58d27e){return function(_0x227edd){try{jsonpatch[_0xd51b('0x25')](_0x227edd,_0x58d27e,!![]);}catch(_0x1cc071){return BPromise['reject'](_0x1cc071);}return _0x227edd[_0xd51b('0x26')]();};}function saveUpdates(_0x2c3a0a,_0x3ae81a){return function(_0x1cc29f){if(_0x1cc29f){return _0x1cc29f[_0xd51b('0x27')](_0x2c3a0a)[_0xd51b('0x28')](function(_0x2eb228){return _0x2eb228;});}return null;};}function removeEntity(_0x516827,_0x34952f){return function(_0x64ec51){if(_0x64ec51){return _0x64ec51['destroy']()[_0xd51b('0x28')](function(){_0x516827['status'](0xcc)[_0xd51b('0x29')]();});}};}function handleEntityNotFound(_0xa20b4a,_0x160d51){return function(_0x27771b){if(!_0x27771b){_0xa20b4a[_0xd51b('0x1c')](0x194);}return _0x27771b;};}function handleError(_0x594bee,_0x51a519){_0x51a519=_0x51a519||0x1f4;return function(_0x42e66e){logger[_0xd51b('0x2a')](_0x42e66e[_0xd51b('0x2b')]);if(_0x42e66e[_0xd51b('0x2c')]){delete _0x42e66e[_0xd51b('0x2c')];}_0x594bee[_0xd51b('0x1d')](_0x51a519)[_0xd51b('0x2d')](_0x42e66e);};}exports[_0xd51b('0x2e')]=function(_0x3a7689,_0x19e864){var _0x3b3408={},_0x2489a9={},_0x3b3c59={'count':0x0,'rows':[]};var _0x818453=_[_0xd51b('0x2f')](db['VoiceMailMessage'][_0xd51b('0x30')],function(_0x2da729){return{'name':_0x2da729[_0xd51b('0x31')],'type':_0x2da729[_0xd51b('0x32')][_0xd51b('0x33')]};});_0x2489a9[_0xd51b('0x34')]=_[_0xd51b('0x35')](_[_0xd51b('0x2f')](_0x818453,_0xd51b('0x2c')),[_0xd51b('0x2c')]);_0x2489a9[_0xd51b('0x36')]=_[_0xd51b('0x37')](_0x3a7689[_0xd51b('0x36')]);_0x2489a9[_0xd51b('0x38')]=_[_0xd51b('0x39')](_0x2489a9[_0xd51b('0x34')],_0x2489a9[_0xd51b('0x36')]);_0x3b3408[_0xd51b('0x3a')]=_[_0xd51b('0x39')](_0x2489a9[_0xd51b('0x34')],qs[_0xd51b('0x3b')](_0x3a7689[_0xd51b('0x36')]['fields']));_0x3b3408[_0xd51b('0x3a')]=_0x3b3408[_0xd51b('0x3a')][_0xd51b('0x3c')]?_0x3b3408[_0xd51b('0x3a')]:_0x2489a9[_0xd51b('0x34')];if(!_0x3a7689['query']['hasOwnProperty'](_0xd51b('0x3d'))){_0x3b3408['limit']=qs[_0xd51b('0x21')](_0x3a7689[_0xd51b('0x36')][_0xd51b('0x21')]);_0x3b3408['offset']=qs[_0xd51b('0x1f')](_0x3a7689[_0xd51b('0x36')][_0xd51b('0x1f')]);}_0x3b3408[_0xd51b('0x3e')]=qs[_0xd51b('0x3f')](_0x3a7689[_0xd51b('0x36')][_0xd51b('0x3f')]);_0x3b3408['where']=qs[_0xd51b('0x38')](_[_0xd51b('0x40')](_0x3a7689['query'],_0x2489a9[_0xd51b('0x38')]),_0x818453);if(_0x3a7689[_0xd51b('0x36')]['filter']){_0x3b3408[_0xd51b('0x41')]=_[_0xd51b('0x42')](_0x3b3408[_0xd51b('0x41')],{'$or':_[_0xd51b('0x2f')](_0x818453,function(_0x50a47d){if(_0x50a47d[_0xd51b('0x32')]!==_0xd51b('0x43')){var _0x599d97={};_0x599d97[_0x50a47d['name']]={'$like':'%'+_0x3a7689['query']['filter']+'%'};return _0x599d97;}})});}_0x3b3408=_[_0xd51b('0x42')]({},_0x3b3408,_0x3a7689[_0xd51b('0x44')]);var _0x13af7f={'where':_0x3b3408[_0xd51b('0x41')]};return db[_0xd51b('0x45')][_0xd51b('0x22')](_0x13af7f)[_0xd51b('0x28')](function(_0x535cd6){_0x3b3c59[_0xd51b('0x22')]=_0x535cd6;if(_0x3a7689[_0xd51b('0x36')][_0xd51b('0x46')]){_0x3b3408['include']=[{'all':!![]}];}return db[_0xd51b('0x45')]['findAll'](_0x3b3408);})[_0xd51b('0x28')](function(_0x4b200f){_0x3b3c59[_0xd51b('0x47')]=_0x4b200f;return _0x3b3c59;})[_0xd51b('0x28')](respondWithFilteredResult(_0x19e864,_0x3b3408))['catch'](handleError(_0x19e864,null));};exports['show']=function(_0x53d529,_0x3ecbb1){var _0x5d0972={'raw':!![],'where':{'id':_0x53d529[_0xd51b('0x48')]['id']}},_0x2f8b37={};_0x2f8b37[_0xd51b('0x34')]=_[_0xd51b('0x37')](db['VoiceMailMessage'][_0xd51b('0x30')]);_0x2f8b37[_0xd51b('0x36')]=_[_0xd51b('0x37')](_0x53d529[_0xd51b('0x36')]);_0x2f8b37[_0xd51b('0x38')]=_['intersection'](_0x2f8b37[_0xd51b('0x34')],_0x2f8b37['query']);_0x5d0972['attributes']=_[_0xd51b('0x39')](_0x2f8b37[_0xd51b('0x34')],qs[_0xd51b('0x3b')](_0x53d529[_0xd51b('0x36')][_0xd51b('0x3b')]));_0x5d0972[_0xd51b('0x3a')]=_0x5d0972[_0xd51b('0x3a')]['length']?_0x5d0972[_0xd51b('0x3a')]:_0x2f8b37[_0xd51b('0x34')];if(_0x53d529[_0xd51b('0x36')][_0xd51b('0x46')]){_0x5d0972[_0xd51b('0x49')]=[{'all':!![]}];}_0x5d0972=_[_0xd51b('0x42')]({},_0x5d0972,_0x53d529[_0xd51b('0x44')]);return db[_0xd51b('0x45')][_0xd51b('0x4a')](_0x5d0972)[_0xd51b('0x28')](handleEntityNotFound(_0x3ecbb1,null))['then'](respondWithResult(_0x3ecbb1,null))[_0xd51b('0x4b')](handleError(_0x3ecbb1,null));};exports[_0xd51b('0x4c')]=function(_0x450944,_0x380dd6){return db[_0xd51b('0x45')][_0xd51b('0x4c')](_0x450944['body'],{})[_0xd51b('0x28')](respondWithResult(_0x380dd6,0xc9))[_0xd51b('0x4b')](handleError(_0x380dd6,null));};exports[_0xd51b('0x27')]=function(_0x10cedc,_0x4412c7){if(_0x10cedc['body']['id']){delete _0x10cedc[_0xd51b('0x4d')]['id'];}return db['VoiceMailMessage'][_0xd51b('0x4a')]({'where':{'id':_0x10cedc[_0xd51b('0x48')]['id']}})[_0xd51b('0x28')](handleEntityNotFound(_0x4412c7,null))[_0xd51b('0x28')](saveUpdates(_0x10cedc[_0xd51b('0x4d')],null))[_0xd51b('0x28')](respondWithResult(_0x4412c7,null))[_0xd51b('0x4b')](handleError(_0x4412c7,null));};exports[_0xd51b('0x4e')]=function(_0x356e4b,_0x4ac75a){return db[_0xd51b('0x45')][_0xd51b('0x4a')]({'where':{'id':_0x356e4b['params']['id']}})[_0xd51b('0x28')](handleEntityNotFound(_0x4ac75a,null))[_0xd51b('0x28')](removeEntity(_0x4ac75a,null))[_0xd51b('0x4b')](handleError(_0x4ac75a,null));};exports['download']=function(_0x570516,_0x408aac,_0x3a200d){return db[_0xd51b('0x45')]['find']({'where':{'id':_0x570516[_0xd51b('0x48')]['id']},'attributes':['id',_0xd51b('0x4f'),_0xd51b('0x50')]})[_0xd51b('0x28')](handleEntityNotFound(_0x408aac,null))[_0xd51b('0x28')](function(_0x18aca0){if(_0x18aca0){if(!_0x18aca0[_0xd51b('0x4f')]){throw new db['Sequelize']['ValidationError'](_0xd51b('0x51'));}var _0x455ab8={'Content-Type':_0xd51b('0x52'),'Content-Disposition':_0xd51b('0x53')};if(_0x18aca0[_0xd51b('0x50')]){_0x455ab8[_0xd51b('0x54')]=_0xd51b('0x55')+_0x18aca0[_0xd51b('0x50')]+'.wav\x22';}_0x408aac[_0xd51b('0x23')](_0x455ab8);return _0x408aac[_0xd51b('0x2d')](new Buffer(_0x18aca0[_0xd51b('0x4f')]));}})[_0xd51b('0x4b')](handleError(_0x408aac,null));}; \ No newline at end of file +var _0xf82f=['find','create','body','update','download','recording','msg_id','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','set','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','then','destroy','error','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','include','rows','catch','show','params','length','includeAll'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xf82f,0x166));var _0xff82=function(_0x1d0aed,_0x30609c){_0x1d0aed=_0x1d0aed-0x0;var _0xe96a7b=_0xf82f[_0x1d0aed];return _0xe96a7b;};'use strict';var emlformat=require(_0xff82('0x0'));var rimraf=require(_0xff82('0x1'));var zipdir=require(_0xff82('0x2'));var jsonpatch=require(_0xff82('0x3'));var rp=require('request-promise');var moment=require(_0xff82('0x4'));var BPromise=require(_0xff82('0x5'));var Mustache=require(_0xff82('0x6'));var util=require(_0xff82('0x7'));var path=require(_0xff82('0x8'));var sox=require(_0xff82('0x9'));var csv=require('to-csv');var ejs=require(_0xff82('0xa'));var fs=require('fs');var fs_extra=require(_0xff82('0xb'));var _=require(_0xff82('0xc'));var squel=require(_0xff82('0xd'));var crypto=require(_0xff82('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xff82('0xf'));var querystring=require(_0xff82('0x10'));var Papa=require(_0xff82('0x11'));var Redis=require(_0xff82('0x12'));var authService=require(_0xff82('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xff82('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xff82('0x15'))(_0xff82('0x16'));var utils=require(_0xff82('0x17'));var config=require(_0xff82('0x18'));var licenseUtil=require(_0xff82('0x19'));var db=require(_0xff82('0x1a'))['db'];function respondWithStatusCode(_0x27863d,_0x1f5172){_0x1f5172=_0x1f5172||0xcc;return function(_0x125535){if(_0x125535){return _0x27863d[_0xff82('0x1b')](_0x1f5172);}return _0x27863d[_0xff82('0x1c')](_0x1f5172)[_0xff82('0x1d')]();};}function respondWithResult(_0x301493,_0xdb53a4){_0xdb53a4=_0xdb53a4||0xc8;return function(_0x4ffd68){if(_0x4ffd68){return _0x301493[_0xff82('0x1c')](_0xdb53a4)[_0xff82('0x1e')](_0x4ffd68);}};}function respondWithFilteredResult(_0x1c18c2,_0x1402eb){return function(_0x31bbfa){if(_0x31bbfa){var _0x11a03e=typeof _0x1402eb['offset']===_0xff82('0x1f')&&typeof _0x1402eb[_0xff82('0x20')]==='undefined';var _0x1e9e71=_0x31bbfa[_0xff82('0x21')];var _0x562be2=_0x11a03e?0x0:_0x1402eb[_0xff82('0x22')];var _0x34af1a=_0x11a03e?_0x31bbfa[_0xff82('0x21')]:_0x1402eb['offset']+_0x1402eb[_0xff82('0x20')];var _0x8ed092;if(_0x34af1a>=_0x1e9e71){_0x34af1a=_0x1e9e71;_0x8ed092=0xc8;}else{_0x8ed092=0xce;}_0x1c18c2[_0xff82('0x1c')](_0x8ed092);return _0x1c18c2['set'](_0xff82('0x23'),_0x562be2+'-'+_0x34af1a+'/'+_0x1e9e71)['json'](_0x31bbfa);}return null;};}function patchUpdates(_0x29b637){return function(_0x2dd26e){try{jsonpatch[_0xff82('0x24')](_0x2dd26e,_0x29b637,!![]);}catch(_0x5a074e){return BPromise[_0xff82('0x25')](_0x5a074e);}return _0x2dd26e['save']();};}function saveUpdates(_0x33ec49,_0xc3a0b9){return function(_0x482e98){if(_0x482e98){return _0x482e98['update'](_0x33ec49)[_0xff82('0x26')](function(_0x7c4302){return _0x7c4302;});}return null;};}function removeEntity(_0x1e397c,_0x474476){return function(_0x25a550){if(_0x25a550){return _0x25a550[_0xff82('0x27')]()[_0xff82('0x26')](function(){_0x1e397c[_0xff82('0x1c')](0xcc)[_0xff82('0x1d')]();});}};}function handleEntityNotFound(_0x2958ec,_0x4e90b7){return function(_0x75fcdd){if(!_0x75fcdd){_0x2958ec[_0xff82('0x1b')](0x194);}return _0x75fcdd;};}function handleError(_0x315243,_0x58c2fd){_0x58c2fd=_0x58c2fd||0x1f4;return function(_0x1b3c95){logger[_0xff82('0x28')](_0x1b3c95['stack']);if(_0x1b3c95[_0xff82('0x29')]){delete _0x1b3c95[_0xff82('0x29')];}_0x315243['status'](_0x58c2fd)[_0xff82('0x2a')](_0x1b3c95);};}exports[_0xff82('0x2b')]=function(_0x52c01f,_0x1f251a){var _0xbb02aa={},_0x1ebfd8={},_0x1c74c9={'count':0x0,'rows':[]};var _0x435779=_[_0xff82('0x2c')](db[_0xff82('0x2d')][_0xff82('0x2e')],function(_0x59c1a5){return{'name':_0x59c1a5[_0xff82('0x2f')],'type':_0x59c1a5[_0xff82('0x30')]['key']};});_0x1ebfd8[_0xff82('0x31')]=_['differenceBy'](_[_0xff82('0x2c')](_0x435779,'name'),['name']);_0x1ebfd8[_0xff82('0x32')]=_[_0xff82('0x33')](_0x52c01f[_0xff82('0x32')]);_0x1ebfd8['filters']=_[_0xff82('0x34')](_0x1ebfd8['model'],_0x1ebfd8[_0xff82('0x32')]);_0xbb02aa[_0xff82('0x35')]=_[_0xff82('0x34')](_0x1ebfd8[_0xff82('0x31')],qs[_0xff82('0x36')](_0x52c01f[_0xff82('0x32')][_0xff82('0x36')]));_0xbb02aa[_0xff82('0x35')]=_0xbb02aa[_0xff82('0x35')]['length']?_0xbb02aa[_0xff82('0x35')]:_0x1ebfd8['model'];if(!_0x52c01f['query']['hasOwnProperty'](_0xff82('0x37'))){_0xbb02aa[_0xff82('0x20')]=qs[_0xff82('0x20')](_0x52c01f['query']['limit']);_0xbb02aa[_0xff82('0x22')]=qs[_0xff82('0x22')](_0x52c01f[_0xff82('0x32')][_0xff82('0x22')]);}_0xbb02aa[_0xff82('0x38')]=qs[_0xff82('0x39')](_0x52c01f['query'][_0xff82('0x39')]);_0xbb02aa[_0xff82('0x3a')]=qs[_0xff82('0x3b')](_[_0xff82('0x3c')](_0x52c01f['query'],_0x1ebfd8['filters']),_0x435779);if(_0x52c01f[_0xff82('0x32')][_0xff82('0x3d')]){_0xbb02aa[_0xff82('0x3a')]=_['merge'](_0xbb02aa[_0xff82('0x3a')],{'$or':_[_0xff82('0x2c')](_0x435779,function(_0xb88742){if(_0xb88742['type']!==_0xff82('0x3e')){var _0x1a98d0={};_0x1a98d0[_0xb88742[_0xff82('0x29')]]={'$like':'%'+_0x52c01f[_0xff82('0x32')]['filter']+'%'};return _0x1a98d0;}})});}_0xbb02aa=_[_0xff82('0x3f')]({},_0xbb02aa,_0x52c01f[_0xff82('0x40')]);var _0x27bb5c={'where':_0xbb02aa['where']};return db[_0xff82('0x2d')]['count'](_0x27bb5c)[_0xff82('0x26')](function(_0x85130f){_0x1c74c9[_0xff82('0x21')]=_0x85130f;if(_0x52c01f[_0xff82('0x32')]['includeAll']){_0xbb02aa[_0xff82('0x41')]=[{'all':!![]}];}return db['VoiceMailMessage']['findAll'](_0xbb02aa);})[_0xff82('0x26')](function(_0x40019e){_0x1c74c9[_0xff82('0x42')]=_0x40019e;return _0x1c74c9;})[_0xff82('0x26')](respondWithFilteredResult(_0x1f251a,_0xbb02aa))[_0xff82('0x43')](handleError(_0x1f251a,null));};exports[_0xff82('0x44')]=function(_0x6ebf8b,_0x378385){var _0x331be9={'raw':!![],'where':{'id':_0x6ebf8b[_0xff82('0x45')]['id']}},_0x13543b={};_0x13543b[_0xff82('0x31')]=_['keys'](db[_0xff82('0x2d')][_0xff82('0x2e')]);_0x13543b['query']=_['keys'](_0x6ebf8b[_0xff82('0x32')]);_0x13543b[_0xff82('0x3b')]=_['intersection'](_0x13543b['model'],_0x13543b[_0xff82('0x32')]);_0x331be9[_0xff82('0x35')]=_['intersection'](_0x13543b[_0xff82('0x31')],qs[_0xff82('0x36')](_0x6ebf8b[_0xff82('0x32')][_0xff82('0x36')]));_0x331be9[_0xff82('0x35')]=_0x331be9['attributes'][_0xff82('0x46')]?_0x331be9['attributes']:_0x13543b[_0xff82('0x31')];if(_0x6ebf8b['query'][_0xff82('0x47')]){_0x331be9[_0xff82('0x41')]=[{'all':!![]}];}_0x331be9=_[_0xff82('0x3f')]({},_0x331be9,_0x6ebf8b['options']);return db[_0xff82('0x2d')][_0xff82('0x48')](_0x331be9)[_0xff82('0x26')](handleEntityNotFound(_0x378385,null))['then'](respondWithResult(_0x378385,null))['catch'](handleError(_0x378385,null));};exports[_0xff82('0x49')]=function(_0x318366,_0x5b8e17){return db[_0xff82('0x2d')][_0xff82('0x49')](_0x318366[_0xff82('0x4a')],{})[_0xff82('0x26')](respondWithResult(_0x5b8e17,0xc9))[_0xff82('0x43')](handleError(_0x5b8e17,null));};exports[_0xff82('0x4b')]=function(_0x23d6fe,_0x51ee0f){if(_0x23d6fe['body']['id']){delete _0x23d6fe[_0xff82('0x4a')]['id'];}return db[_0xff82('0x2d')]['find']({'where':{'id':_0x23d6fe[_0xff82('0x45')]['id']}})[_0xff82('0x26')](handleEntityNotFound(_0x51ee0f,null))['then'](saveUpdates(_0x23d6fe[_0xff82('0x4a')],null))['then'](respondWithResult(_0x51ee0f,null))[_0xff82('0x43')](handleError(_0x51ee0f,null));};exports[_0xff82('0x27')]=function(_0x2c297a,_0x593c5d){return db[_0xff82('0x2d')]['find']({'where':{'id':_0x2c297a['params']['id']}})[_0xff82('0x26')](handleEntityNotFound(_0x593c5d,null))[_0xff82('0x26')](removeEntity(_0x593c5d,null))[_0xff82('0x43')](handleError(_0x593c5d,null));};exports[_0xff82('0x4c')]=function(_0x337c1f,_0x42cfa0,_0x1de32f){return db['VoiceMailMessage'][_0xff82('0x48')]({'where':{'id':_0x337c1f[_0xff82('0x45')]['id']},'attributes':['id',_0xff82('0x4d'),_0xff82('0x4e')]})[_0xff82('0x26')](handleEntityNotFound(_0x42cfa0,null))[_0xff82('0x26')](function(_0x43225a){if(_0x43225a){if(!_0x43225a[_0xff82('0x4d')]){throw new db[(_0xff82('0x4f'))]['ValidationError'](_0xff82('0x50'));}var _0x58002d={'Content-Type':_0xff82('0x51'),'Content-Disposition':_0xff82('0x52')};if(_0x43225a[_0xff82('0x4e')]){_0x58002d[_0xff82('0x53')]=_0xff82('0x54')+_0x43225a[_0xff82('0x4e')]+'.wav\x22';}_0x42cfa0[_0xff82('0x55')](_0x58002d);return _0x42cfa0[_0xff82('0x2a')](new Buffer(_0x43225a[_0xff82('0x4d')]));}})[_0xff82('0x43')](handleError(_0x42cfa0,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 97e4a8e..a0a28c5 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 _0x587f=['moment','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','api'];(function(_0x460f2,_0x24a187){var _0x11b925=function(_0x1c426a){while(--_0x1c426a){_0x460f2['push'](_0x460f2['shift']());}};_0x11b925(++_0x24a187);}(_0x587f,0x10a));var _0xf587=function(_0x58418a,_0x3d9f06){_0x58418a=_0x58418a-0x0;var _0x2716bf=_0x587f[_0x58418a];return _0x2716bf;};'use strict';var _=require(_0xf587('0x0'));var util=require(_0xf587('0x1'));var logger=require(_0xf587('0x2'))(_0xf587('0x3'));var moment=require(_0xf587('0x4'));var BPromise=require('bluebird');var rp=require(_0xf587('0x5'));var fs=require('fs');var path=require(_0xf587('0x6'));var rimraf=require(_0xf587('0x7'));var config=require(_0xf587('0x8'));var attributes=require(_0xf587('0x9'));module[_0xf587('0xa')]=function(_0x3484af,_0x2edcc8){return _0x3484af[_0xf587('0xb')](_0xf587('0xc'),attributes,{'tableName':_0xf587('0xd'),'paranoid':![],'indexes':[{'name':_0xf587('0xe'),'fields':[_0xf587('0xe')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9f1f=['api','moment','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','define','voice_voicemail_messages','dir','lodash','util','../../config/logger'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x9f1f,0x14f));var _0xf9f1=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0x9f1f[_0x474bc0];return _0x4b24cf;};'use strict';var _=require(_0xf9f1('0x0'));var util=require(_0xf9f1('0x1'));var logger=require(_0xf9f1('0x2'))(_0xf9f1('0x3'));var moment=require(_0xf9f1('0x4'));var BPromise=require('bluebird');var rp=require(_0xf9f1('0x5'));var fs=require('fs');var path=require(_0xf9f1('0x6'));var rimraf=require(_0xf9f1('0x7'));var config=require(_0xf9f1('0x8'));var attributes=require(_0xf9f1('0x9'));module['exports']=function(_0x5252f8,_0x2537a7){return _0x5252f8[_0xf9f1('0xa')]('VoiceMailMessage',attributes,{'tableName':_0xf9f1('0xb'),'paranoid':![],'indexes':[{'name':_0xf9f1('0xc'),'fields':[_0xf9f1('0xc')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 5da8bd2..63192c5 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 _0xa670=['code','message','result','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2ffc88,_0x5e91cb){var _0x52b5aa=function(_0x16a15e){while(--_0x16a15e){_0x2ffc88['push'](_0x2ffc88['shift']());}};_0x52b5aa(++_0x5e91cb);}(_0xa670,0xff));var _0x0a67=function(_0xcd190a,_0x1a5398){_0xcd190a=_0xcd190a-0x0;var _0x3c9ef4=_0xa670[_0xcd190a];return _0x3c9ef4;};'use strict';var _=require(_0x0a67('0x0'));var util=require(_0x0a67('0x1'));var moment=require(_0x0a67('0x2'));var BPromise=require('bluebird');var rs=require(_0x0a67('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0a67('0x4'));var logger=require(_0x0a67('0x5'))(_0x0a67('0x6'));var config=require(_0x0a67('0x7'));var jayson=require(_0x0a67('0x8'));var client=jayson['client'][_0x0a67('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x49929e,_0x8e51fc,_0x122780){return new BPromise(function(_0x525d75,_0x24f39c){return client['request'](_0x49929e,_0x122780)[_0x0a67('0xa')](function(_0x91995a){logger[_0x0a67('0xb')](_0x0a67('0xc'),_0x8e51fc,_0x0a67('0xd'));logger[_0x0a67('0xe')](_0x0a67('0xf'),_0x8e51fc,'request\x20sent',JSON[_0x0a67('0x10')](_0x91995a));if(_0x91995a[_0x0a67('0x11')]){if(_0x91995a[_0x0a67('0x11')][_0x0a67('0x12')]===0x1f4){logger['error'](_0x0a67('0xc'),_0x8e51fc,_0x91995a[_0x0a67('0x11')][_0x0a67('0x13')]);return _0x24f39c(_0x91995a[_0x0a67('0x11')]['message']);}logger[_0x0a67('0x11')]('VoiceMailMessage,\x20%s,\x20%s',_0x8e51fc,_0x91995a[_0x0a67('0x11')]['message']);return _0x525d75(_0x91995a[_0x0a67('0x11')][_0x0a67('0x13')]);}else{logger[_0x0a67('0xb')](_0x0a67('0xc'),_0x8e51fc,'request\x20sent');_0x525d75(_0x91995a[_0x0a67('0x14')]['message']);}})['catch'](function(_0x15e744){logger[_0x0a67('0x11')](_0x0a67('0xc'),_0x8e51fc,_0x15e744);_0x24f39c(_0x15e744);});});} \ No newline at end of file +var _0xb5bd=['lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceMailMessage,\x20%s,\x20%s','message','request\x20sent','result','catch'];(function(_0x20c3d8,_0x4fc6e0){var _0x491186=function(_0x39b5fc){while(--_0x39b5fc){_0x20c3d8['push'](_0x20c3d8['shift']());}};_0x491186(++_0x4fc6e0);}(_0xb5bd,0xe6));var _0xdb5b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb5bd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xdb5b('0x0'));var util=require('util');var moment=require(_0xdb5b('0x1'));var BPromise=require('bluebird');var rs=require(_0xdb5b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdb5b('0x3'))['db'];var utils=require(_0xdb5b('0x4'));var logger=require(_0xdb5b('0x5'))(_0xdb5b('0x6'));var config=require(_0xdb5b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xdb5b('0x8')][_0xdb5b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4279c0,_0x5b1d97,_0x430d98){return new BPromise(function(_0x2eda5e,_0x408869){return client[_0xdb5b('0xa')](_0x4279c0,_0x430d98)[_0xdb5b('0xb')](function(_0x24060d){logger[_0xdb5b('0xc')]('VoiceMailMessage,\x20%s,\x20%s',_0x5b1d97,'request\x20sent');logger[_0xdb5b('0xd')](_0xdb5b('0xe'),_0x5b1d97,'request\x20sent',JSON[_0xdb5b('0xf')](_0x24060d));if(_0x24060d[_0xdb5b('0x10')]){if(_0x24060d[_0xdb5b('0x10')][_0xdb5b('0x11')]===0x1f4){logger['error'](_0xdb5b('0x12'),_0x5b1d97,_0x24060d[_0xdb5b('0x10')][_0xdb5b('0x13')]);return _0x408869(_0x24060d['error']['message']);}logger[_0xdb5b('0x10')](_0xdb5b('0x12'),_0x5b1d97,_0x24060d[_0xdb5b('0x10')][_0xdb5b('0x13')]);return _0x2eda5e(_0x24060d[_0xdb5b('0x10')][_0xdb5b('0x13')]);}else{logger[_0xdb5b('0xc')](_0xdb5b('0x12'),_0x5b1d97,_0xdb5b('0x14'));_0x2eda5e(_0x24060d[_0xdb5b('0x15')][_0xdb5b('0x13')]);}})[_0xdb5b('0x16')](function(_0x547f48){logger[_0xdb5b('0x10')](_0xdb5b('0x12'),_0x5b1d97,_0x547f48);_0x408869(_0x547f48);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 65084b6..75eefb7 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 _0x3d94=['show','/:id/sounds','getSounds','post','create','addSound','/:id','update','destroy','/:id/sounds/:id2','removeSound','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index'];(function(_0x6b5967,_0x848f6){var _0x1cec3d=function(_0x546a0d){while(--_0x546a0d){_0x6b5967['push'](_0x6b5967['shift']());}};_0x1cec3d(++_0x848f6);}(_0x3d94,0x1ad));var _0x43d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3d94[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x43d9('0x0'));var path=require(_0x43d9('0x1'));var timeout=require(_0x43d9('0x2'));var express=require(_0x43d9('0x3'));var router=express['Router']();var fs_extra=require(_0x43d9('0x4'));var auth=require(_0x43d9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x43d9('0x6'));var controller=require(_0x43d9('0x7'));router[_0x43d9('0x8')]('/',auth[_0x43d9('0x9')](),controller[_0x43d9('0xa')]);router[_0x43d9('0x8')]('/:id',auth[_0x43d9('0x9')](),controller[_0x43d9('0xb')]);router['get'](_0x43d9('0xc'),auth['isAuthenticated'](),controller[_0x43d9('0xd')]);router[_0x43d9('0xe')]('/',auth['isAuthenticated'](),controller[_0x43d9('0xf')]);router['post']('/:id/sounds',auth[_0x43d9('0x9')](),controller[_0x43d9('0x10')]);router['put'](_0x43d9('0x11'),auth[_0x43d9('0x9')](),controller[_0x43d9('0x12')]);router['delete'](_0x43d9('0x11'),auth[_0x43d9('0x9')](),controller[_0x43d9('0x13')]);router['delete'](_0x43d9('0x14'),auth[_0x43d9('0x9')](),controller[_0x43d9('0x15')]);module['exports']=router; \ No newline at end of file +var _0xf618=['delete','/:id/sounds/:id2','removeSound','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','/:id','show','getSounds','post','create','/:id/sounds','addSound','put'];(function(_0x1c461e,_0x1b98ff){var _0x1dce4f=function(_0x5cbdf0){while(--_0x5cbdf0){_0x1c461e['push'](_0x1c461e['shift']());}};_0x1dce4f(++_0x1b98ff);}(_0xf618,0xb3));var _0x8f61=function(_0x4108cf,_0x1065eb){_0x4108cf=_0x4108cf-0x0;var _0x1383df=_0xf618[_0x4108cf];return _0x1383df;};'use strict';var multer=require(_0x8f61('0x0'));var util=require(_0x8f61('0x1'));var path=require(_0x8f61('0x2'));var timeout=require(_0x8f61('0x3'));var express=require('express');var router=express[_0x8f61('0x4')]();var fs_extra=require(_0x8f61('0x5'));var auth=require(_0x8f61('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8f61('0x7'));var controller=require(_0x8f61('0x8'));router[_0x8f61('0x9')]('/',auth[_0x8f61('0xa')](),controller['index']);router[_0x8f61('0x9')](_0x8f61('0xb'),auth[_0x8f61('0xa')](),controller[_0x8f61('0xc')]);router[_0x8f61('0x9')]('/:id/sounds',auth['isAuthenticated'](),controller[_0x8f61('0xd')]);router[_0x8f61('0xe')]('/',auth[_0x8f61('0xa')](),controller[_0x8f61('0xf')]);router[_0x8f61('0xe')](_0x8f61('0x10'),auth[_0x8f61('0xa')](),controller[_0x8f61('0x11')]);router[_0x8f61('0x12')](_0x8f61('0xb'),auth[_0x8f61('0xa')](),controller['update']);router[_0x8f61('0x13')]('/:id',auth[_0x8f61('0xa')](),controller['destroy']);router[_0x8f61('0x13')](_0x8f61('0x14'),auth['isAuthenticated'](),controller[_0x8f61('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index c1bb2bc..2fabf1b 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 _0x340e=['ENUM','custom','files','quietmp3nb','quietmp3','exports','STRING','name'];(function(_0x18265c,_0xfae450){var _0xf60565=function(_0xb16970){while(--_0xb16970){_0x18265c['push'](_0x18265c['shift']());}};_0xf60565(++_0xfae450);}(_0x340e,0xed));var _0xe340=function(_0x533dd9,_0x49a469){_0x533dd9=_0x533dd9-0x0;var _0x5088c6=_0x340e[_0x533dd9];return _0x5088c6;};'use strict';var Sequelize=require('sequelize');module[_0xe340('0x0')]={'name':{'type':Sequelize[_0xe340('0x1')],'allowNull':![],'unique':_0xe340('0x2')},'mode':{'type':Sequelize[_0xe340('0x3')](_0xe340('0x4'),_0xe340('0x5'),'mp3nb',_0xe340('0x6'),_0xe340('0x7'),'mp3'),'allowNull':!![],'defaultValue':_0xe340('0x5')},'directory':{'type':Sequelize[_0xe340('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0xe340('0x1')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0xe340('0x1')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0xe340('0x1')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0xd342=['sequelize','exports','STRING','ENUM','mp3nb','quietmp3nb','quietmp3','mp3','alpha','TIMESTAMP','BOOLEAN'];(function(_0x2a719b,_0x715ab9){var _0x3d468c=function(_0x113d87){while(--_0x113d87){_0x2a719b['push'](_0x2a719b['shift']());}};_0x3d468c(++_0x715ab9);}(_0xd342,0xd1));var _0x2d34=function(_0x3777f9,_0x9189f7){_0x3777f9=_0x3777f9-0x0;var _0x2bc887=_0xd342[_0x3777f9];return _0x2bc887;};'use strict';var Sequelize=require(_0x2d34('0x0'));module[_0x2d34('0x1')]={'name':{'type':Sequelize[_0x2d34('0x2')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x2d34('0x3')]('custom','files',_0x2d34('0x4'),_0x2d34('0x5'),_0x2d34('0x6'),_0x2d34('0x7')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x2d34('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x2d34('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x2d34('0x2')],'allowNull':!![],'defaultValue':_0x2d34('0x8')},'format':{'type':Sequelize[_0x2d34('0x2')],'allowNull':!![]},'stamp':{'type':_0x2d34('0x9')},'defaultEntry':{'type':Sequelize[_0x2d34('0xa')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index 20aaeae..edf774e 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 _0xaeef=['findAll','rows','catch','show','params','includeAll','find','update','body','create','sequelize','transaction','mode','files','directory','server/files/moh','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','join','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','root','removeSound','findOne','id2','getSounds','eml-format','fast-json-patch','request-promise','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','apply','save','then','get','MusicOnHolds','UserProfileResource','destroy','error','stack','name','send','map','VoiceMusicOnHold','rawAttributes','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options'];(function(_0x182b0a,_0x19bab4){var _0x5e2580=function(_0x383632){while(--_0x383632){_0x182b0a['push'](_0x182b0a['shift']());}};_0x5e2580(++_0x19bab4);}(_0xaeef,0x171));var _0xfaee=function(_0x509a73,_0x5dd81f){_0x509a73=_0x509a73-0x0;var _0x100c31=_0xaeef[_0x509a73];return _0x100c31;};'use strict';var emlformat=require(_0xfaee('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfaee('0x1'));var rp=require(_0xfaee('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfaee('0x3'));var path=require(_0xfaee('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfaee('0x5'));var fs=require('fs');var fs_extra=require(_0xfaee('0x6'));var _=require(_0xfaee('0x7'));var squel=require(_0xfaee('0x8'));var crypto=require(_0xfaee('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xfaee('0xa'));var toCsv=require('to-csv');var querystring=require(_0xfaee('0xb'));var Papa=require(_0xfaee('0xc'));var Redis=require(_0xfaee('0xd'));var authService=require(_0xfaee('0xe'));var qs=require(_0xfaee('0xf'));var as=require(_0xfaee('0x10'));var hardwareService=require(_0xfaee('0x11'));var logger=require(_0xfaee('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xfaee('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xfaee('0x14'))['db'];function respondWithStatusCode(_0x53648b,_0x3f5e08){_0x3f5e08=_0x3f5e08||0xcc;return function(_0x5a630c){if(_0x5a630c){return _0x53648b[_0xfaee('0x15')](_0x3f5e08);}return _0x53648b[_0xfaee('0x16')](_0x3f5e08)['end']();};}function respondWithResult(_0x565a91,_0x1e0408){_0x1e0408=_0x1e0408||0xc8;return function(_0x1f585b){if(_0x1f585b){return _0x565a91[_0xfaee('0x16')](_0x1e0408)['json'](_0x1f585b);}};}function respondWithFilteredResult(_0x2aad43,_0x1e03a7){return function(_0x14e749){if(_0x14e749){var _0x54e887=typeof _0x1e03a7[_0xfaee('0x17')]===_0xfaee('0x18')&&typeof _0x1e03a7['limit']===_0xfaee('0x18');var _0x36e4d6=_0x14e749[_0xfaee('0x19')];var _0x110942=_0x54e887?0x0:_0x1e03a7[_0xfaee('0x17')];var _0x5125d0=_0x54e887?_0x14e749[_0xfaee('0x19')]:_0x1e03a7[_0xfaee('0x17')]+_0x1e03a7[_0xfaee('0x1a')];var _0xfcea72;if(_0x5125d0>=_0x36e4d6){_0x5125d0=_0x36e4d6;_0xfcea72=0xc8;}else{_0xfcea72=0xce;}_0x2aad43[_0xfaee('0x16')](_0xfcea72);return _0x2aad43[_0xfaee('0x1b')](_0xfaee('0x1c'),_0x110942+'-'+_0x5125d0+'/'+_0x36e4d6)['json'](_0x14e749);}return null;};}function patchUpdates(_0x3e4534){return function(_0x1dad62){try{jsonpatch[_0xfaee('0x1d')](_0x1dad62,_0x3e4534,!![]);}catch(_0x3f2ce6){return BPromise['reject'](_0x3f2ce6);}return _0x1dad62[_0xfaee('0x1e')]();};}function saveUpdates(_0x4dab7f,_0x146276){return function(_0x462508){if(_0x462508){return _0x462508['update'](_0x4dab7f)[_0xfaee('0x1f')](function(_0x1c349b){return _0x1c349b;});}return null;};}function removeEntity(_0x10fee9,_0x3fd787){return function(_0x3ee782){if(_0x3ee782){return _0x3ee782['destroy']()[_0xfaee('0x1f')](function(){var _0x1f1246=_0x3ee782[_0xfaee('0x20')]({'plain':!![]});var _0x3c5a56=_0xfaee('0x21');return db[_0xfaee('0x22')][_0xfaee('0x23')]({'where':{'type':_0x3c5a56,'resourceId':_0x1f1246['id']}})[_0xfaee('0x1f')](function(){return _0x3ee782;});})[_0xfaee('0x1f')](function(){_0x10fee9[_0xfaee('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0xdb25c4,_0xdad668){return function(_0x1030b1){if(!_0x1030b1){_0xdb25c4[_0xfaee('0x15')](0x194);}return _0x1030b1;};}function handleError(_0x49d8cb,_0x2fe207){_0x2fe207=_0x2fe207||0x1f4;return function(_0x3fb175){logger[_0xfaee('0x24')](_0x3fb175[_0xfaee('0x25')]);if(_0x3fb175[_0xfaee('0x26')]){delete _0x3fb175['name'];}_0x49d8cb[_0xfaee('0x16')](_0x2fe207)[_0xfaee('0x27')](_0x3fb175);};}exports['index']=function(_0x13bb63,_0xb06d85){var _0x2b6aa3={},_0x162f5f={},_0x2e40d4={'count':0x0,'rows':[]};var _0x5b20c2=_[_0xfaee('0x28')](db[_0xfaee('0x29')][_0xfaee('0x2a')],function(_0x88a45a){return{'name':_0x88a45a['fieldName'],'type':_0x88a45a[_0xfaee('0x2b')][_0xfaee('0x2c')]};});_0x162f5f[_0xfaee('0x2d')]=_['map'](_0x5b20c2,_0xfaee('0x26'));_0x162f5f['query']=_[_0xfaee('0x2e')](_0x13bb63[_0xfaee('0x2f')]);_0x162f5f['filters']=_['intersection'](_0x162f5f[_0xfaee('0x2d')],_0x162f5f[_0xfaee('0x2f')]);_0x2b6aa3[_0xfaee('0x30')]=_[_0xfaee('0x31')](_0x162f5f[_0xfaee('0x2d')],qs[_0xfaee('0x32')](_0x13bb63[_0xfaee('0x2f')]['fields']));_0x2b6aa3[_0xfaee('0x30')]=_0x2b6aa3[_0xfaee('0x30')][_0xfaee('0x33')]?_0x2b6aa3[_0xfaee('0x30')]:_0x162f5f[_0xfaee('0x2d')];if(!_0x13bb63[_0xfaee('0x2f')][_0xfaee('0x34')](_0xfaee('0x35'))){_0x2b6aa3[_0xfaee('0x1a')]=qs['limit'](_0x13bb63[_0xfaee('0x2f')][_0xfaee('0x1a')]);_0x2b6aa3[_0xfaee('0x17')]=qs[_0xfaee('0x17')](_0x13bb63[_0xfaee('0x2f')][_0xfaee('0x17')]);}_0x2b6aa3[_0xfaee('0x36')]=qs[_0xfaee('0x37')](_0x13bb63[_0xfaee('0x2f')][_0xfaee('0x37')]);delete _0x13bb63[_0xfaee('0x2f')][_0xfaee('0x37')];_0x2b6aa3[_0xfaee('0x38')]=qs[_0xfaee('0x39')](_[_0xfaee('0x3a')](_0x13bb63[_0xfaee('0x2f')],_0x162f5f[_0xfaee('0x39')]),_0x5b20c2);if(_0x13bb63['query']['filter']){_0x2b6aa3['where']=_[_0xfaee('0x3b')](_0x2b6aa3[_0xfaee('0x38')],{'$or':_['map'](_0x5b20c2,function(_0x53463b){if(_0x53463b['type']!==_0xfaee('0x3c')){var _0x197cd4={};_0x197cd4[_0x53463b[_0xfaee('0x26')]]={'$like':'%'+_0x13bb63[_0xfaee('0x2f')][_0xfaee('0x3d')]+'%'};return _0x197cd4;}})});}_0x2b6aa3=_['merge']({},_0x2b6aa3,_0x13bb63[_0xfaee('0x3e')]);var _0x1cf97b={'where':_0x2b6aa3['where']};return db['VoiceMusicOnHold'][_0xfaee('0x19')](_0x1cf97b)[_0xfaee('0x1f')](function(_0x439e8f){_0x2e40d4[_0xfaee('0x19')]=_0x439e8f;if(_0x13bb63[_0xfaee('0x2f')]['includeAll']){_0x2b6aa3['include']=[{'all':!![]}];}return db[_0xfaee('0x29')][_0xfaee('0x3f')](_0x2b6aa3);})[_0xfaee('0x1f')](function(_0x442569){_0x2e40d4[_0xfaee('0x40')]=_0x442569;return _0x2e40d4;})[_0xfaee('0x1f')](respondWithFilteredResult(_0xb06d85,_0x2b6aa3))[_0xfaee('0x41')](handleError(_0xb06d85,null));};exports[_0xfaee('0x42')]=function(_0x35ef6f,_0x1e61af){var _0xc430ce={'raw':![],'where':{'id':_0x35ef6f[_0xfaee('0x43')]['id']}},_0x59d4d5={};_0x59d4d5[_0xfaee('0x2d')]=_[_0xfaee('0x2e')](db['VoiceMusicOnHold'][_0xfaee('0x2a')]);_0x59d4d5[_0xfaee('0x2f')]=_[_0xfaee('0x2e')](_0x35ef6f[_0xfaee('0x2f')]);_0x59d4d5['filters']=_[_0xfaee('0x31')](_0x59d4d5[_0xfaee('0x2d')],_0x59d4d5[_0xfaee('0x2f')]);_0xc430ce['attributes']=_[_0xfaee('0x31')](_0x59d4d5[_0xfaee('0x2d')],qs[_0xfaee('0x32')](_0x35ef6f[_0xfaee('0x2f')][_0xfaee('0x32')]));_0xc430ce[_0xfaee('0x30')]=_0xc430ce[_0xfaee('0x30')][_0xfaee('0x33')]?_0xc430ce[_0xfaee('0x30')]:_0x59d4d5[_0xfaee('0x2d')];if(_0x35ef6f[_0xfaee('0x2f')][_0xfaee('0x44')]){_0xc430ce['include']=[{'all':!![]}];}_0xc430ce=_[_0xfaee('0x3b')]({},_0xc430ce,_0x35ef6f[_0xfaee('0x3e')]);return db[_0xfaee('0x29')][_0xfaee('0x45')](_0xc430ce)[_0xfaee('0x1f')](handleEntityNotFound(_0x1e61af,null))[_0xfaee('0x1f')](respondWithResult(_0x1e61af,null))[_0xfaee('0x41')](handleError(_0x1e61af,null));};exports[_0xfaee('0x46')]=function(_0x101d1a,_0x3a4520){if(_0x101d1a[_0xfaee('0x47')]['id']){delete _0x101d1a[_0xfaee('0x47')]['id'];}return db[_0xfaee('0x29')][_0xfaee('0x45')]({'where':{'id':_0x101d1a[_0xfaee('0x43')]['id']}})['then'](handleEntityNotFound(_0x3a4520,null))[_0xfaee('0x1f')](saveUpdates(_0x101d1a[_0xfaee('0x47')],null))[_0xfaee('0x1f')](respondWithResult(_0x3a4520,null))[_0xfaee('0x41')](handleError(_0x3a4520,null));};exports[_0xfaee('0x48')]=function(_0x38a8ad,_0x56c85b,_0x3c29f1){return db[_0xfaee('0x49')][_0xfaee('0x4a')](function(_0x29c713){if(_0x38a8ad[_0xfaee('0x47')][_0xfaee('0x4b')]===_0xfaee('0x4c')){_0x38a8ad[_0xfaee('0x47')][_0xfaee('0x4d')]=path['join'](config['root'],_0xfaee('0x4e'),_0x38a8ad[_0xfaee('0x47')][_0xfaee('0x26')]);}return db['VoiceMusicOnHold']['create'](_0x38a8ad[_0xfaee('0x47')],{'transaction':_0x29c713})['then'](function(_0x5c2ab9){if(_0x38a8ad['body'][_0xfaee('0x4b')]===_0xfaee('0x4c')){fs['mkdirSync'](_0x5c2ab9[_0xfaee('0x4d')],parseInt(_0xfaee('0x4f'),0x8));}var _0x573a19=_0x38a8ad[_0xfaee('0x50')][_0xfaee('0x20')]({'plain':!![]});if(!_0x573a19)throw new Error(_0xfaee('0x51'));if(_0x573a19[_0xfaee('0x52')]===_0xfaee('0x50')){var _0x206b1a=_0x5c2ab9['get']({'plain':!![]});return db['UserProfileSection'][_0xfaee('0x45')]({'where':{'name':_0xfaee('0x21'),'userProfileId':_0x573a19[_0xfaee('0x53')]},'raw':!![]})[_0xfaee('0x1f')](function(_0x195bf5){if(_0x195bf5&&_0x195bf5[_0xfaee('0x54')]===0x0){return db[_0xfaee('0x22')][_0xfaee('0x48')]({'name':_0x206b1a['name'],'resourceId':_0x206b1a['id'],'type':_0x195bf5[_0xfaee('0x26')],'sectionId':_0x195bf5['id']},{})['then'](function(){return _0x5c2ab9;});}else{return _0x5c2ab9;}})[_0xfaee('0x41')](function(_0x485f56){logger['error'](_0xfaee('0x55'),_0x485f56);});}return _0x5c2ab9;});})[_0xfaee('0x1f')](respondWithResult(_0x56c85b,0xc9))[_0xfaee('0x41')](handleError(_0x56c85b,null));};exports[_0xfaee('0x23')]=function(_0x5e694b,_0x26619e,_0x3de8e6){var _0x390749;return db[_0xfaee('0x29')][_0xfaee('0x45')]({'where':{'id':_0x5e694b['params']['id']}})[_0xfaee('0x1f')](function(_0x159d5c){if(_0x159d5c){return db['sequelize'][_0xfaee('0x4a')](function(_0x3a7687){return _0x159d5c[_0xfaee('0x23')]({'transaction':_0x3a7687,'raw':!![]})[_0xfaee('0x1f')](function(_0x361951){if(_0x361951[_0xfaee('0x4d')]){fs[_0xfaee('0x56')](_0x361951[_0xfaee('0x4d')])[_0xfaee('0x57')](function(_0x23f2ff){fs[_0xfaee('0x58')](path[_0xfaee('0x59')](_0x361951['directory'],_0x23f2ff));});fs[_0xfaee('0x5a')](_0x361951[_0xfaee('0x4d')]);}return _0x361951;});})['catch'](function(_0x20e106){throw new db[(_0xfaee('0x5b'))][(_0xfaee('0x5c'))](_0x20e106[_0xfaee('0x5d')]);});}})['then'](handleEntityNotFound(_0x26619e,null))[_0xfaee('0x1f')](removeEntity(_0x26619e,null))[_0xfaee('0x41')](handleError(_0x26619e,null));};exports[_0xfaee('0x5e')]=function(_0x27647e,_0xa8d371,_0x233cdc){return db[_0xfaee('0x49')][_0xfaee('0x4a')](function(_0x486045){var _0x351fe1;return db[_0xfaee('0x29')][_0xfaee('0x45')]({'where':{'id':_0x27647e[_0xfaee('0x43')]['id']}})['then'](function(_0x4f715b){if(_0x4f715b){_0x351fe1=_0x4f715b;return _0x4f715b[_0xfaee('0x5e')](_0x27647e['body']['id'],{'transaction':_0x486045});}})[_0xfaee('0x1f')](function(_0x5e4a76){if(_0x5e4a76){return db[_0xfaee('0x5f')]['findOne']({'where':{'id':_0x27647e['body']['id']},'attributes':['id','name',_0xfaee('0x60'),_0xfaee('0x61'),_0xfaee('0x62')],'raw':!![]});}})['then'](function(_0x47ee38){if(_0x47ee38){var _0x56fde7=path['join'](config['root'],_0xfaee('0x63'),util[_0xfaee('0x64')](_0xfaee('0x65'),path[_0xfaee('0x66')](_0x47ee38[_0xfaee('0x60')],path['extname'](_0x47ee38[_0xfaee('0x60')])),_0x47ee38[_0xfaee('0x61')]));var _0x20aefa=path[_0xfaee('0x59')](config[_0xfaee('0x67')],'server/files/moh',_0x351fe1['name'],util[_0xfaee('0x64')]('%s.%s',_0x47ee38[_0xfaee('0x26')],_0x47ee38['converted_format']));fs['symlinkSync'](_0x56fde7,_0x20aefa);return _0x47ee38;}})[_0xfaee('0x41')](function(_0xe86c02){throw new db['Sequelize'][(_0xfaee('0x5c'))](_0xe86c02['message']);});})['then'](handleEntityNotFound(_0xa8d371,null))[_0xfaee('0x1f')](respondWithResult(_0xa8d371,0xc9))[_0xfaee('0x41')](handleError(_0xa8d371,null));};exports[_0xfaee('0x68')]=function(_0x43d803,_0x19412c,_0x268f98){return db['sequelize'][_0xfaee('0x4a')](function(_0x414e25){var _0x2b0e84;return db[_0xfaee('0x29')][_0xfaee('0x69')]({'where':{'id':_0x43d803['params']['id']}})[_0xfaee('0x1f')](handleEntityNotFound(_0x19412c,null))[_0xfaee('0x1f')](function(_0x3aa52f){if(_0x3aa52f){_0x2b0e84=_0x3aa52f;return _0x3aa52f['removeSound'](_0x43d803[_0xfaee('0x43')][_0xfaee('0x6a')]);}})[_0xfaee('0x1f')](function(_0x53814d){if(_0x53814d){return db['Sound'][_0xfaee('0x69')]({'where':{'id':_0x43d803['params']['id2']},'attributes':['id',_0xfaee('0x26'),_0xfaee('0x60'),_0xfaee('0x61'),_0xfaee('0x62')],'raw':!![]});}})[_0xfaee('0x1f')](function(_0xbe35d3){if(_0xbe35d3){fs['unlinkSync'](path[_0xfaee('0x59')](_0x2b0e84[_0xfaee('0x4d')],util['format']('%s.%s',_0xbe35d3[_0xfaee('0x26')],_0xbe35d3['converted_format'])));return _0xbe35d3;}})[_0xfaee('0x41')](function(_0x93c585){throw new db['Sequelize'][(_0xfaee('0x5c'))](_0x93c585[_0xfaee('0x5d')]);});})[_0xfaee('0x1f')](handleEntityNotFound(_0x19412c,null))[_0xfaee('0x1f')](respondWithStatusCode(_0x19412c,0xcc))['catch'](handleError(_0x19412c,null));};exports[_0xfaee('0x6b')]=function(_0x32b358,_0x2144ab,_0x48d4aa){var _0xabbc67={};var _0x1a8d29={};var _0x38ca86;var _0x3d0a86;return db[_0xfaee('0x29')][_0xfaee('0x69')]({'where':{'id':_0x32b358[_0xfaee('0x43')]['id']}})[_0xfaee('0x1f')](handleEntityNotFound(_0x2144ab,null))['then'](function(_0x340796){if(_0x340796){_0x38ca86=_0x340796;_0x1a8d29['model']=_['keys'](db[_0xfaee('0x5f')][_0xfaee('0x2a')]);_0x1a8d29[_0xfaee('0x2f')]=_['keys'](_0x32b358[_0xfaee('0x2f')]);_0x1a8d29['filters']=_[_0xfaee('0x31')](_0x1a8d29[_0xfaee('0x2d')],_0x1a8d29['query']);_0xabbc67[_0xfaee('0x30')]=_[_0xfaee('0x31')](_0x1a8d29[_0xfaee('0x2d')],qs[_0xfaee('0x32')](_0x32b358[_0xfaee('0x2f')][_0xfaee('0x32')]));_0xabbc67[_0xfaee('0x30')]=_0xabbc67[_0xfaee('0x30')]['length']?_0xabbc67[_0xfaee('0x30')]:_0x1a8d29['model'];_0xabbc67[_0xfaee('0x36')]=qs['sort'](_0x32b358['query']['sort']);_0xabbc67[_0xfaee('0x38')]=qs[_0xfaee('0x39')](_[_0xfaee('0x3a')](_0x32b358[_0xfaee('0x2f')],_0x1a8d29[_0xfaee('0x39')]));if(_0x32b358['query']['filter']){_0xabbc67[_0xfaee('0x38')]=_[_0xfaee('0x3b')](_0xabbc67[_0xfaee('0x38')],{'$or':_['map'](_0xabbc67['attributes'],function(_0x1ed604){var _0x570e38={};_0x570e38[_0x1ed604]={'$like':'%'+_0x32b358['query'][_0xfaee('0x3d')]+'%'};return _0x570e38;})});}_0xabbc67=_[_0xfaee('0x3b')]({},_0xabbc67,_0x32b358[_0xfaee('0x3e')]);return _0x38ca86[_0xfaee('0x6b')](_0xabbc67);}})[_0xfaee('0x1f')](function(_0x1696aa){if(_0x1696aa){_0x3d0a86=_0x1696aa['length'];if(!_0x32b358[_0xfaee('0x2f')]['hasOwnProperty'](_0xfaee('0x35'))){_0xabbc67[_0xfaee('0x1a')]=qs[_0xfaee('0x1a')](_0x32b358['query'][_0xfaee('0x1a')]);_0xabbc67[_0xfaee('0x17')]=qs[_0xfaee('0x17')](_0x32b358[_0xfaee('0x2f')]['offset']);}return _0x38ca86['getSounds'](_0xabbc67);}})[_0xfaee('0x1f')](function(_0x2569e0){if(_0x2569e0){return _0x2569e0?{'count':_0x3d0a86,'rows':_0x2569e0}:null;}})[_0xfaee('0x1f')](respondWithResult(_0x2144ab,null))['catch'](handleError(_0x2144ab,null));}; \ No newline at end of file +var _0x9574=['lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','then','get','MusicOnHolds','UserProfileResource','destroy','error','stack','name','send','index','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','params','attributes','options','find','update','body','catch','create','mode','files','directory','server/files/moh','mkdirSync','0777','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','forEach','unlinkSync','join','rmdirSync','Sequelize','ValidationError','message','addSound','sequelize','Sound','findOne','save_name','converted_format','root','server/files/sounds/converted','format','%s.%s','basename','extname','removeSound','id2','createdAt','getSounds','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','fs-extra'];(function(_0x459335,_0x2e95dd){var _0x50f00b=function(_0x5ccdaf){while(--_0x5ccdaf){_0x459335['push'](_0x459335['shift']());}};_0x50f00b(++_0x2e95dd);}(_0x9574,0x65));var _0x4957=function(_0x141aff,_0x2337d0){_0x141aff=_0x141aff-0x0;var _0x11bf99=_0x9574[_0x141aff];return _0x11bf99;};'use strict';var emlformat=require(_0x4957('0x0'));var rimraf=require(_0x4957('0x1'));var zipdir=require(_0x4957('0x2'));var jsonpatch=require(_0x4957('0x3'));var rp=require(_0x4957('0x4'));var moment=require(_0x4957('0x5'));var BPromise=require(_0x4957('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x4957('0x7'));var csv=require(_0x4957('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4957('0x9'));var _=require(_0x4957('0xa'));var squel=require(_0x4957('0xb'));var crypto=require(_0x4957('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4957('0xd'));var toCsv=require(_0x4957('0x8'));var querystring=require(_0x4957('0xe'));var Papa=require('papaparse');var Redis=require(_0x4957('0xf'));var authService=require(_0x4957('0x10'));var qs=require(_0x4957('0x11'));var as=require(_0x4957('0x12'));var hardwareService=require(_0x4957('0x13'));var logger=require(_0x4957('0x14'))('api');var utils=require(_0x4957('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4957('0x16'))['db'];function respondWithStatusCode(_0x1928c3,_0x4d32ea){_0x4d32ea=_0x4d32ea||0xcc;return function(_0x4553a9){if(_0x4553a9){return _0x1928c3[_0x4957('0x17')](_0x4d32ea);}return _0x1928c3[_0x4957('0x18')](_0x4d32ea)['end']();};}function respondWithResult(_0x4646cc,_0x4afd68){_0x4afd68=_0x4afd68||0xc8;return function(_0x33484d){if(_0x33484d){return _0x4646cc[_0x4957('0x18')](_0x4afd68)[_0x4957('0x19')](_0x33484d);}};}function respondWithFilteredResult(_0x15af1e,_0x18c91f){return function(_0x205664){if(_0x205664){var _0x301326=typeof _0x18c91f[_0x4957('0x1a')]===_0x4957('0x1b')&&typeof _0x18c91f[_0x4957('0x1c')]===_0x4957('0x1b');var _0x1dc096=_0x205664[_0x4957('0x1d')];var _0x5ce255=_0x301326?0x0:_0x18c91f['offset'];var _0x517c9c=_0x301326?_0x205664['count']:_0x18c91f['offset']+_0x18c91f[_0x4957('0x1c')];var _0x18da10;if(_0x517c9c>=_0x1dc096){_0x517c9c=_0x1dc096;_0x18da10=0xc8;}else{_0x18da10=0xce;}_0x15af1e[_0x4957('0x18')](_0x18da10);return _0x15af1e['set'](_0x4957('0x1e'),_0x5ce255+'-'+_0x517c9c+'/'+_0x1dc096)[_0x4957('0x19')](_0x205664);}return null;};}function patchUpdates(_0x325abd){return function(_0x4e1690){try{jsonpatch[_0x4957('0x1f')](_0x4e1690,_0x325abd,!![]);}catch(_0x1bd841){return BPromise['reject'](_0x1bd841);}return _0x4e1690[_0x4957('0x20')]();};}function saveUpdates(_0x1fc59c,_0x274526){return function(_0x4e72ab){if(_0x4e72ab){return _0x4e72ab['update'](_0x1fc59c)[_0x4957('0x21')](function(_0x4c0cb3){return _0x4c0cb3;});}return null;};}function removeEntity(_0x2d65d4,_0x125724){return function(_0x414047){if(_0x414047){return _0x414047['destroy']()[_0x4957('0x21')](function(){var _0x5821e2=_0x414047[_0x4957('0x22')]({'plain':!![]});var _0x326f45=_0x4957('0x23');return db[_0x4957('0x24')][_0x4957('0x25')]({'where':{'type':_0x326f45,'resourceId':_0x5821e2['id']}})['then'](function(){return _0x414047;});})[_0x4957('0x21')](function(){_0x2d65d4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5087b4,_0x40ccf3){return function(_0x3ec4c4){if(!_0x3ec4c4){_0x5087b4[_0x4957('0x17')](0x194);}return _0x3ec4c4;};}function handleError(_0x12c8f4,_0x2246a1){_0x2246a1=_0x2246a1||0x1f4;return function(_0x4a9f54){logger[_0x4957('0x26')](_0x4a9f54[_0x4957('0x27')]);if(_0x4a9f54[_0x4957('0x28')]){delete _0x4a9f54[_0x4957('0x28')];}_0x12c8f4[_0x4957('0x18')](_0x2246a1)[_0x4957('0x29')](_0x4a9f54);};}exports[_0x4957('0x2a')]=function(_0x3a27d0,_0x4bf19f){var _0x2f8a02={},_0x285548={},_0x162ef2={'count':0x0,'rows':[]};var _0x3cf619=_['map'](db[_0x4957('0x2b')][_0x4957('0x2c')],function(_0x1f44b7){return{'name':_0x1f44b7[_0x4957('0x2d')],'type':_0x1f44b7[_0x4957('0x2e')][_0x4957('0x2f')]};});_0x285548[_0x4957('0x30')]=_[_0x4957('0x31')](_0x3cf619,_0x4957('0x28'));_0x285548['query']=_[_0x4957('0x32')](_0x3a27d0[_0x4957('0x33')]);_0x285548[_0x4957('0x34')]=_['intersection'](_0x285548[_0x4957('0x30')],_0x285548[_0x4957('0x33')]);_0x2f8a02['attributes']=_[_0x4957('0x35')](_0x285548[_0x4957('0x30')],qs[_0x4957('0x36')](_0x3a27d0[_0x4957('0x33')]['fields']));_0x2f8a02['attributes']=_0x2f8a02['attributes'][_0x4957('0x37')]?_0x2f8a02['attributes']:_0x285548['model'];if(!_0x3a27d0[_0x4957('0x33')][_0x4957('0x38')](_0x4957('0x39'))){_0x2f8a02[_0x4957('0x1c')]=qs['limit'](_0x3a27d0[_0x4957('0x33')]['limit']);_0x2f8a02[_0x4957('0x1a')]=qs['offset'](_0x3a27d0[_0x4957('0x33')]['offset']);}_0x2f8a02[_0x4957('0x3a')]=qs[_0x4957('0x3b')](_0x3a27d0[_0x4957('0x33')][_0x4957('0x3b')]);delete _0x3a27d0[_0x4957('0x33')][_0x4957('0x3b')];_0x2f8a02[_0x4957('0x3c')]=qs[_0x4957('0x34')](_[_0x4957('0x3d')](_0x3a27d0[_0x4957('0x33')],_0x285548['filters']),_0x3cf619);if(_0x3a27d0[_0x4957('0x33')][_0x4957('0x3e')]){_0x2f8a02[_0x4957('0x3c')]=_[_0x4957('0x3f')](_0x2f8a02[_0x4957('0x3c')],{'$or':_[_0x4957('0x31')](_0x3cf619,function(_0x5eceec){if(_0x5eceec[_0x4957('0x2e')]!=='VIRTUAL'){var _0x38b4e2={};_0x38b4e2[_0x5eceec[_0x4957('0x28')]]={'$like':'%'+_0x3a27d0[_0x4957('0x33')]['filter']+'%'};return _0x38b4e2;}})});}_0x2f8a02=_['merge']({},_0x2f8a02,_0x3a27d0['options']);var _0x14c6f4={'where':_0x2f8a02[_0x4957('0x3c')]};return db[_0x4957('0x2b')][_0x4957('0x1d')](_0x14c6f4)[_0x4957('0x21')](function(_0x11c9c9){_0x162ef2[_0x4957('0x1d')]=_0x11c9c9;if(_0x3a27d0[_0x4957('0x33')][_0x4957('0x40')]){_0x2f8a02[_0x4957('0x41')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x4957('0x42')](_0x2f8a02);})[_0x4957('0x21')](function(_0x18dbe9){_0x162ef2['rows']=_0x18dbe9;return _0x162ef2;})[_0x4957('0x21')](respondWithFilteredResult(_0x4bf19f,_0x2f8a02))['catch'](handleError(_0x4bf19f,null));};exports['show']=function(_0x1aabba,_0x1f1364){var _0x1978bc={'raw':![],'where':{'id':_0x1aabba[_0x4957('0x43')]['id']}},_0x4d14b3={};_0x4d14b3['model']=_[_0x4957('0x32')](db[_0x4957('0x2b')][_0x4957('0x2c')]);_0x4d14b3[_0x4957('0x33')]=_[_0x4957('0x32')](_0x1aabba[_0x4957('0x33')]);_0x4d14b3[_0x4957('0x34')]=_[_0x4957('0x35')](_0x4d14b3[_0x4957('0x30')],_0x4d14b3[_0x4957('0x33')]);_0x1978bc[_0x4957('0x44')]=_[_0x4957('0x35')](_0x4d14b3[_0x4957('0x30')],qs[_0x4957('0x36')](_0x1aabba[_0x4957('0x33')]['fields']));_0x1978bc[_0x4957('0x44')]=_0x1978bc[_0x4957('0x44')]['length']?_0x1978bc['attributes']:_0x4d14b3[_0x4957('0x30')];if(_0x1aabba[_0x4957('0x33')]['includeAll']){_0x1978bc[_0x4957('0x41')]=[{'all':!![]}];}_0x1978bc=_[_0x4957('0x3f')]({},_0x1978bc,_0x1aabba[_0x4957('0x45')]);return db['VoiceMusicOnHold'][_0x4957('0x46')](_0x1978bc)[_0x4957('0x21')](handleEntityNotFound(_0x1f1364,null))[_0x4957('0x21')](respondWithResult(_0x1f1364,null))['catch'](handleError(_0x1f1364,null));};exports[_0x4957('0x47')]=function(_0x2c66e1,_0x596150){if(_0x2c66e1['body']['id']){delete _0x2c66e1[_0x4957('0x48')]['id'];}return db[_0x4957('0x2b')]['find']({'where':{'id':_0x2c66e1['params']['id']}})[_0x4957('0x21')](handleEntityNotFound(_0x596150,null))[_0x4957('0x21')](saveUpdates(_0x2c66e1[_0x4957('0x48')],null))[_0x4957('0x21')](respondWithResult(_0x596150,null))[_0x4957('0x49')](handleError(_0x596150,null));};exports[_0x4957('0x4a')]=function(_0x502a32,_0x7b2737,_0x289f4c){return db['sequelize']['transaction'](function(_0x164924){if(_0x502a32[_0x4957('0x48')][_0x4957('0x4b')]===_0x4957('0x4c')){_0x502a32[_0x4957('0x48')][_0x4957('0x4d')]=path['join'](config['root'],_0x4957('0x4e'),_0x502a32[_0x4957('0x48')]['name']);}return db[_0x4957('0x2b')]['create'](_0x502a32[_0x4957('0x48')],{'transaction':_0x164924})[_0x4957('0x21')](function(_0x57d63b){if(_0x502a32[_0x4957('0x48')]['mode']===_0x4957('0x4c')){fs[_0x4957('0x4f')](_0x57d63b['directory'],parseInt(_0x4957('0x50'),0x8));}var _0x309322=_0x502a32[_0x4957('0x51')]['get']({'plain':!![]});if(!_0x309322)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x309322[_0x4957('0x52')]==='user'){var _0x2b28ef=_0x57d63b[_0x4957('0x22')]({'plain':!![]});return db[_0x4957('0x53')][_0x4957('0x46')]({'where':{'name':_0x4957('0x23'),'userProfileId':_0x309322[_0x4957('0x54')]},'raw':!![]})[_0x4957('0x21')](function(_0x4f6528){if(_0x4f6528&&_0x4f6528[_0x4957('0x55')]===0x0){return db['UserProfileResource'][_0x4957('0x4a')]({'name':_0x2b28ef['name'],'resourceId':_0x2b28ef['id'],'type':_0x4f6528[_0x4957('0x28')],'sectionId':_0x4f6528['id']},{})[_0x4957('0x21')](function(){return _0x57d63b;});}else{return _0x57d63b;}})[_0x4957('0x49')](function(_0x407dc1){logger['error'](_0x4957('0x56'),_0x407dc1);});}return _0x57d63b;});})[_0x4957('0x21')](respondWithResult(_0x7b2737,0xc9))['catch'](handleError(_0x7b2737,null));};exports['destroy']=function(_0x362dc5,_0x29a778,_0x1fdb4f){var _0x535cc3;return db['VoiceMusicOnHold'][_0x4957('0x46')]({'where':{'id':_0x362dc5['params']['id']}})[_0x4957('0x21')](function(_0x11524b){if(_0x11524b){return db['sequelize'][_0x4957('0x57')](function(_0x64befa){return _0x11524b[_0x4957('0x25')]({'transaction':_0x64befa,'raw':!![]})[_0x4957('0x21')](function(_0x5ec0bd){if(_0x5ec0bd[_0x4957('0x4d')]){fs['readdirSync'](_0x5ec0bd[_0x4957('0x4d')])[_0x4957('0x58')](function(_0x348798){fs[_0x4957('0x59')](path[_0x4957('0x5a')](_0x5ec0bd['directory'],_0x348798));});fs[_0x4957('0x5b')](_0x5ec0bd[_0x4957('0x4d')]);}return _0x5ec0bd;});})[_0x4957('0x49')](function(_0x51d963){throw new db[(_0x4957('0x5c'))][(_0x4957('0x5d'))](_0x51d963[_0x4957('0x5e')]);});}})[_0x4957('0x21')](handleEntityNotFound(_0x29a778,null))[_0x4957('0x21')](removeEntity(_0x29a778,null))[_0x4957('0x49')](handleError(_0x29a778,null));};exports[_0x4957('0x5f')]=function(_0x3bd9b0,_0x544350,_0x59509a){return db[_0x4957('0x60')][_0x4957('0x57')](function(_0x5e5406){var _0x4d1a48;return db[_0x4957('0x2b')][_0x4957('0x46')]({'where':{'id':_0x3bd9b0[_0x4957('0x43')]['id']}})[_0x4957('0x21')](function(_0x2861c5){if(_0x2861c5){_0x4d1a48=_0x2861c5;return _0x2861c5['addSound'](_0x3bd9b0['body']['id'],{'transaction':_0x5e5406});}})[_0x4957('0x21')](function(_0x135237){if(_0x135237){return db[_0x4957('0x61')][_0x4957('0x62')]({'where':{'id':_0x3bd9b0[_0x4957('0x48')]['id']},'attributes':['id','name',_0x4957('0x63'),_0x4957('0x64'),'createdAt'],'raw':!![]});}})[_0x4957('0x21')](function(_0x22e417){if(_0x22e417){var _0xf23778=path[_0x4957('0x5a')](config[_0x4957('0x65')],_0x4957('0x66'),util[_0x4957('0x67')](_0x4957('0x68'),path[_0x4957('0x69')](_0x22e417['save_name'],path[_0x4957('0x6a')](_0x22e417[_0x4957('0x63')])),_0x22e417['converted_format']));var _0x175dae=path[_0x4957('0x5a')](config[_0x4957('0x65')],'server/files/moh',_0x4d1a48[_0x4957('0x28')],util[_0x4957('0x67')]('%s.%s',_0x22e417[_0x4957('0x28')],_0x22e417[_0x4957('0x64')]));fs['symlinkSync'](_0xf23778,_0x175dae);return _0x22e417;}})['catch'](function(_0x3e5a50){throw new db[(_0x4957('0x5c'))]['ValidationError'](_0x3e5a50[_0x4957('0x5e')]);});})['then'](handleEntityNotFound(_0x544350,null))['then'](respondWithResult(_0x544350,0xc9))[_0x4957('0x49')](handleError(_0x544350,null));};exports[_0x4957('0x6b')]=function(_0x44bd40,_0x285816,_0x21056a){return db[_0x4957('0x60')][_0x4957('0x57')](function(_0x557466){var _0x2c6ba4;return db['VoiceMusicOnHold'][_0x4957('0x62')]({'where':{'id':_0x44bd40['params']['id']}})[_0x4957('0x21')](handleEntityNotFound(_0x285816,null))[_0x4957('0x21')](function(_0x4ebd17){if(_0x4ebd17){_0x2c6ba4=_0x4ebd17;return _0x4ebd17['removeSound'](_0x44bd40[_0x4957('0x43')][_0x4957('0x6c')]);}})['then'](function(_0x20c2e5){if(_0x20c2e5){return db['Sound'][_0x4957('0x62')]({'where':{'id':_0x44bd40[_0x4957('0x43')]['id2']},'attributes':['id',_0x4957('0x28'),'save_name',_0x4957('0x64'),_0x4957('0x6d')],'raw':!![]});}})['then'](function(_0x470c4a){if(_0x470c4a){fs[_0x4957('0x59')](path['join'](_0x2c6ba4[_0x4957('0x4d')],util[_0x4957('0x67')](_0x4957('0x68'),_0x470c4a[_0x4957('0x28')],_0x470c4a[_0x4957('0x64')])));return _0x470c4a;}})[_0x4957('0x49')](function(_0x33a8eb){throw new db['Sequelize'][(_0x4957('0x5d'))](_0x33a8eb[_0x4957('0x5e')]);});})['then'](handleEntityNotFound(_0x285816,null))[_0x4957('0x21')](respondWithStatusCode(_0x285816,0xcc))[_0x4957('0x49')](handleError(_0x285816,null));};exports[_0x4957('0x6e')]=function(_0x40995f,_0xe1f205,_0x11835d){var _0x3ce3cc={};var _0x2247b5={};var _0x3e6954;var _0x37fda3;return db[_0x4957('0x2b')][_0x4957('0x62')]({'where':{'id':_0x40995f[_0x4957('0x43')]['id']}})[_0x4957('0x21')](handleEntityNotFound(_0xe1f205,null))[_0x4957('0x21')](function(_0x202fc7){if(_0x202fc7){_0x3e6954=_0x202fc7;_0x2247b5[_0x4957('0x30')]=_['keys'](db[_0x4957('0x61')][_0x4957('0x2c')]);_0x2247b5[_0x4957('0x33')]=_['keys'](_0x40995f[_0x4957('0x33')]);_0x2247b5[_0x4957('0x34')]=_[_0x4957('0x35')](_0x2247b5[_0x4957('0x30')],_0x2247b5[_0x4957('0x33')]);_0x3ce3cc[_0x4957('0x44')]=_[_0x4957('0x35')](_0x2247b5['model'],qs[_0x4957('0x36')](_0x40995f[_0x4957('0x33')][_0x4957('0x36')]));_0x3ce3cc[_0x4957('0x44')]=_0x3ce3cc[_0x4957('0x44')][_0x4957('0x37')]?_0x3ce3cc[_0x4957('0x44')]:_0x2247b5[_0x4957('0x30')];_0x3ce3cc['order']=qs[_0x4957('0x3b')](_0x40995f[_0x4957('0x33')][_0x4957('0x3b')]);_0x3ce3cc[_0x4957('0x3c')]=qs[_0x4957('0x34')](_['pick'](_0x40995f[_0x4957('0x33')],_0x2247b5[_0x4957('0x34')]));if(_0x40995f[_0x4957('0x33')][_0x4957('0x3e')]){_0x3ce3cc[_0x4957('0x3c')]=_[_0x4957('0x3f')](_0x3ce3cc[_0x4957('0x3c')],{'$or':_[_0x4957('0x31')](_0x3ce3cc['attributes'],function(_0x421be5){var _0x3ca912={};_0x3ca912[_0x421be5]={'$like':'%'+_0x40995f['query']['filter']+'%'};return _0x3ca912;})});}_0x3ce3cc=_[_0x4957('0x3f')]({},_0x3ce3cc,_0x40995f[_0x4957('0x45')]);return _0x3e6954[_0x4957('0x6e')](_0x3ce3cc);}})['then'](function(_0x24c373){if(_0x24c373){_0x37fda3=_0x24c373['length'];if(!_0x40995f['query'][_0x4957('0x38')]('nolimit')){_0x3ce3cc[_0x4957('0x1c')]=qs[_0x4957('0x1c')](_0x40995f[_0x4957('0x33')][_0x4957('0x1c')]);_0x3ce3cc[_0x4957('0x1a')]=qs['offset'](_0x40995f['query'][_0x4957('0x1a')]);}return _0x3e6954[_0x4957('0x6e')](_0x3ce3cc);}})[_0x4957('0x21')](function(_0x339171){if(_0x339171){return _0x339171?{'count':_0x37fda3,'rows':_0x339171}:null;}})[_0x4957('0x21')](respondWithResult(_0xe1f205,null))[_0x4957('0x49')](handleError(_0xe1f205,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index ca1eaae..e9f02c3 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 _0x9bc3=['../../config/logger','api','moment','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','define','VoiceMusicOnHold','voice_musiconhold','lodash','util'];(function(_0x50a026,_0x1dcf3a){var _0x3dd42b=function(_0x4e60e9){while(--_0x4e60e9){_0x50a026['push'](_0x50a026['shift']());}};_0x3dd42b(++_0x1dcf3a);}(_0x9bc3,0xe2));var _0x39bc=function(_0x2af53e,_0x2222e5){_0x2af53e=_0x2af53e-0x0;var _0x4ed385=_0x9bc3[_0x2af53e];return _0x4ed385;};'use strict';var _=require(_0x39bc('0x0'));var util=require(_0x39bc('0x1'));var logger=require(_0x39bc('0x2'))(_0x39bc('0x3'));var moment=require(_0x39bc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x39bc('0x5'));var rimraf=require(_0x39bc('0x6'));var config=require(_0x39bc('0x7'));var attributes=require(_0x39bc('0x8'));module['exports']=function(_0x2d0170,_0x4db879){return _0x2d0170[_0x39bc('0x9')](_0x39bc('0xa'),attributes,{'tableName':_0x39bc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4375=['./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4375,0x198));var _0x5437=function(_0x108732,_0xbf2673){_0x108732=_0x108732-0x0;var _0x5d0863=_0x4375[_0x108732];return _0x5d0863;};'use strict';var _=require(_0x5437('0x0'));var util=require(_0x5437('0x1'));var logger=require(_0x5437('0x2'))('api');var moment=require(_0x5437('0x3'));var BPromise=require(_0x5437('0x4'));var rp=require(_0x5437('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5437('0x6'));var config=require(_0x5437('0x7'));var attributes=require(_0x5437('0x8'));module[_0x5437('0x9')]=function(_0x2af151,_0x5668b3){return _0x2af151[_0x5437('0xa')](_0x5437('0xb'),attributes,{'tableName':_0x5437('0xc'),'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 0499ed7..4190ed3 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x347452,_0x4a2ee4){var _0x204ebf=function(_0x2dde96){while(--_0x2dde96){_0x347452['push'](_0x347452['shift']());}};_0x204ebf(++_0x4a2ee4);}(_0x70e0,0x17b));var _0x070e=function(_0x2f4d3b,_0x4d8152){_0x2f4d3b=_0x2f4d3b-0x0;var _0x4d2f79=_0x70e0[_0x2f4d3b];return _0x4d2f79;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file +var _0xe706=['http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x566f71,_0x2e6855){var _0x3c0aa9=function(_0x556a66){while(--_0x556a66){_0x566f71['push'](_0x566f71['shift']());}};_0x3c0aa9(++_0x2e6855);}(_0xe706,0xa3));var _0x6e70=function(_0x337dd9,_0x54e3f3){_0x337dd9=_0x337dd9-0x0;var _0x20f4fc=_0xe706[_0x337dd9];return _0x20f4fc;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 370cfb1..6252ea4 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 _0x5907=['get','/:id/users','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','isAuthenticated','/describe','describe'];(function(_0xfa52b,_0x33f677){var _0x26828f=function(_0x2d21ae){while(--_0x2d21ae){_0xfa52b['push'](_0xfa52b['shift']());}};_0x26828f(++_0x33f677);}(_0x5907,0x1db));var _0x7590=function(_0x57b3a7,_0x11538c){_0x57b3a7=_0x57b3a7-0x0;var _0x41b803=_0x5907[_0x57b3a7];return _0x41b803;};'use strict';var multer=require(_0x7590('0x0'));var util=require(_0x7590('0x1'));var path=require(_0x7590('0x2'));var timeout=require(_0x7590('0x3'));var express=require(_0x7590('0x4'));var router=express[_0x7590('0x5')]();var fs_extra=require(_0x7590('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7590('0x7'));var controller=require('./voicePrefix.controller');router['get']('/',auth[_0x7590('0x8')](),controller['index']);router['get'](_0x7590('0x9'),auth[_0x7590('0x8')](),controller[_0x7590('0xa')]);router[_0x7590('0xb')]('/:id',auth[_0x7590('0x8')](),controller['show']);router[_0x7590('0xb')](_0x7590('0xc'),auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0x7590('0x8')](),controller['create']);router['post'](_0x7590('0xc'),auth['isAuthenticated'](),controller['addAgents']);router[_0x7590('0xd')](_0x7590('0xe'),auth['isAuthenticated'](),controller[_0x7590('0xf')]);router[_0x7590('0x10')](_0x7590('0xe'),auth[_0x7590('0x8')](),controller[_0x7590('0x11')]);router['delete']('/:id/users',auth[_0x7590('0x8')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xd54e=['multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','/:id','show','/:id/users','getAgents','post','addAgents','put','update','delete','destroy','exports'];(function(_0x5b062e,_0x18210e){var _0x1ab2b3=function(_0x290cf5){while(--_0x290cf5){_0x5b062e['push'](_0x5b062e['shift']());}};_0x1ab2b3(++_0x18210e);}(_0xd54e,0xd2));var _0xed54=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd54e[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xed54('0x0'));var util=require(_0xed54('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xed54('0x2'));var router=express['Router']();var fs_extra=require(_0xed54('0x3'));var auth=require(_0xed54('0x4'));var interaction=require(_0xed54('0x5'));var config=require(_0xed54('0x6'));var controller=require(_0xed54('0x7'));router[_0xed54('0x8')]('/',auth[_0xed54('0x9')](),controller['index']);router[_0xed54('0x8')]('/describe',auth[_0xed54('0x9')](),controller['describe']);router[_0xed54('0x8')](_0xed54('0xa'),auth[_0xed54('0x9')](),controller[_0xed54('0xb')]);router[_0xed54('0x8')](_0xed54('0xc'),auth['isAuthenticated'](),controller[_0xed54('0xd')]);router['post']('/',auth[_0xed54('0x9')](),controller['create']);router[_0xed54('0xe')](_0xed54('0xc'),auth[_0xed54('0x9')](),controller[_0xed54('0xf')]);router[_0xed54('0x10')](_0xed54('0xa'),auth[_0xed54('0x9')](),controller[_0xed54('0x11')]);router[_0xed54('0x12')](_0xed54('0xa'),auth[_0xed54('0x9')](),controller[_0xed54('0x13')]);router[_0xed54('0x12')](_0xed54('0xc'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xed54('0x14')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 4361f29..1ac1646 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 _0xf9ac=['name','INTEGER','exports','STRING','getDataValue'];(function(_0x79cd47,_0x16102d){var _0x3b9484=function(_0x23db95){while(--_0x23db95){_0x79cd47['push'](_0x79cd47['shift']());}};_0x3b9484(++_0x16102d);}(_0xf9ac,0x15b));var _0xcf9a=function(_0x484339,_0x37f834){_0x484339=_0x484339-0x0;var _0x30d3bc=_0xf9ac[_0x484339];return _0x30d3bc;};'use strict';var Sequelize=require('sequelize');module[_0xcf9a('0x0')]={'name':{'type':Sequelize[_0xcf9a('0x1')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x7b054b){return'system-'+this[_0xcf9a('0x2')](_0xcf9a('0x3'))+'-';}},'description':{'type':Sequelize[_0xcf9a('0x1')]},'callerIdAll':{'type':Sequelize[_0xcf9a('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0xcf9a('0x4')]}}; \ No newline at end of file +var _0x676a=['name','VIRTUAL','getDataValue','INTEGER','sequelize','STRING'];(function(_0xe57fea,_0x497f53){var _0x4bee58=function(_0x18dd65){while(--_0x18dd65){_0xe57fea['push'](_0xe57fea['shift']());}};_0x4bee58(++_0x497f53);}(_0x676a,0x7c));var _0xa676=function(_0x1c0f3d,_0x55a9e2){_0x1c0f3d=_0x1c0f3d-0x0;var _0x4d71a8=_0x676a[_0x1c0f3d];return _0x4d71a8;};'use strict';var Sequelize=require(_0xa676('0x0'));module['exports']={'name':{'type':Sequelize[_0xa676('0x1')],'allowNull':![],'unique':_0xa676('0x2')},'prefix':{'type':Sequelize[_0xa676('0x3')],'get':function(_0x557d85){return'system-'+this[_0xa676('0x4')](_0xa676('0x2'))+'-';}},'description':{'type':Sequelize[_0xa676('0x1')]},'callerIdAll':{'type':Sequelize[_0xa676('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0xa676('0x5')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 189f23e..c0840a9 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 _0x29b1=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','localhost','redis','./voicePrefix.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','VoicePrefixes','error','stack','name','send','index','map','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','filter','options','includeAll','VoicePrefix','findAll','rows','rawAttributes','include','find','catch','create','sequelize','transaction','body','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtension','bulkCreate','prefix','Set','CDR(prefix)=','PREFIX-CALLERIDALL=','push','No\x20callerid\x20available','goto','context','${EXTEN:','charAt','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','params','userVoicePrefix:remove','getAgents','findOne','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x29b1,0x16d));var _0x129b=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0x29b1[_0x4b7b62];return _0x2280df;};'use strict';var emlformat=require(_0x129b('0x0'));var rimraf=require(_0x129b('0x1'));var zipdir=require(_0x129b('0x2'));var jsonpatch=require(_0x129b('0x3'));var rp=require(_0x129b('0x4'));var moment=require('moment');var BPromise=require(_0x129b('0x5'));var Mustache=require(_0x129b('0x6'));var util=require(_0x129b('0x7'));var path=require(_0x129b('0x8'));var sox=require(_0x129b('0x9'));var csv=require(_0x129b('0xa'));var ejs=require(_0x129b('0xb'));var fs=require('fs');var fs_extra=require(_0x129b('0xc'));var _=require('lodash');var squel=require(_0x129b('0xd'));var crypto=require('crypto');var jsforce=require(_0x129b('0xe'));var deskjs=require(_0x129b('0xf'));var toCsv=require('to-csv');var querystring=require(_0x129b('0x10'));var Papa=require(_0x129b('0x11'));var Redis=require('ioredis');var authService=require(_0x129b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x129b('0x13'));var hardwareService=require(_0x129b('0x14'));var logger=require(_0x129b('0x15'))('api');var utils=require(_0x129b('0x16'));var config=require(_0x129b('0x17'));var licenseUtil=require(_0x129b('0x18'));var db=require(_0x129b('0x19'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x129b('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x129b('0x1b')]));require(_0x129b('0x1c'))[_0x129b('0x1d')](socket);function respondWithStatusCode(_0x52137c,_0x41b681){_0x41b681=_0x41b681||0xcc;return function(_0x47e53c){if(_0x47e53c){return _0x52137c[_0x129b('0x1e')](_0x41b681);}return _0x52137c[_0x129b('0x1f')](_0x41b681)[_0x129b('0x20')]();};}function respondWithResult(_0x50d62b,_0x46a6a4){_0x46a6a4=_0x46a6a4||0xc8;return function(_0x453ba2){if(_0x453ba2){return _0x50d62b[_0x129b('0x1f')](_0x46a6a4)[_0x129b('0x21')](_0x453ba2);}};}function respondWithFilteredResult(_0x30785a,_0x123acc){return function(_0x135b42){if(_0x135b42){var _0x169d4c=typeof _0x123acc[_0x129b('0x22')]===_0x129b('0x23')&&typeof _0x123acc[_0x129b('0x24')]===_0x129b('0x23');var _0x4ec534=_0x135b42[_0x129b('0x25')];var _0x46bcfa=_0x169d4c?0x0:_0x123acc[_0x129b('0x22')];var _0x338428=_0x169d4c?_0x135b42[_0x129b('0x25')]:_0x123acc[_0x129b('0x22')]+_0x123acc[_0x129b('0x24')];var _0x229473;if(_0x338428>=_0x4ec534){_0x338428=_0x4ec534;_0x229473=0xc8;}else{_0x229473=0xce;}_0x30785a[_0x129b('0x1f')](_0x229473);return _0x30785a[_0x129b('0x26')](_0x129b('0x27'),_0x46bcfa+'-'+_0x338428+'/'+_0x4ec534)[_0x129b('0x21')](_0x135b42);}return null;};}function patchUpdates(_0x491624){return function(_0x29c2e1){try{jsonpatch[_0x129b('0x28')](_0x29c2e1,_0x491624,!![]);}catch(_0x8f270d){return BPromise[_0x129b('0x29')](_0x8f270d);}return _0x29c2e1['save']();};}function saveUpdates(_0x4fedcd,_0x31bccc){return function(_0x5b345e){if(_0x5b345e){return _0x5b345e[_0x129b('0x2a')](_0x4fedcd)[_0x129b('0x2b')](function(_0x4c733d){return _0x4c733d;});}return null;};}function removeEntity(_0x5922fe,_0x38788f){return function(_0x1c6d9f){if(_0x1c6d9f){return _0x1c6d9f[_0x129b('0x2c')]()[_0x129b('0x2b')](function(){var _0x45e6be=_0x1c6d9f[_0x129b('0x2d')]({'plain':!![]});var _0x42d623=_0x129b('0x2e');return db['UserProfileResource'][_0x129b('0x2c')]({'where':{'type':_0x42d623,'resourceId':_0x45e6be['id']}})[_0x129b('0x2b')](function(){return _0x1c6d9f;});})['then'](function(){_0x5922fe[_0x129b('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4179e1,_0x4d1017){return function(_0x204e67){if(!_0x204e67){_0x4179e1[_0x129b('0x1e')](0x194);}return _0x204e67;};}function handleError(_0x24eb29,_0x2dcd11){_0x2dcd11=_0x2dcd11||0x1f4;return function(_0x917382){logger[_0x129b('0x2f')](_0x917382[_0x129b('0x30')]);if(_0x917382[_0x129b('0x31')]){delete _0x917382[_0x129b('0x31')];}_0x24eb29['status'](_0x2dcd11)[_0x129b('0x32')](_0x917382);};}exports[_0x129b('0x33')]=function(_0x480338,_0x1bf137){var _0x1b0ab7={},_0x1f5677={},_0x50835a={'count':0x0,'rows':[]};var _0x17e5ed=_[_0x129b('0x34')](db['VoicePrefix']['rawAttributes'],function(_0x2e3b88){return{'name':_0x2e3b88['fieldName'],'type':_0x2e3b88[_0x129b('0x35')]['key']};});_0x1f5677[_0x129b('0x36')]=_[_0x129b('0x34')](_0x17e5ed,'name');_0x1f5677[_0x129b('0x37')]=_[_0x129b('0x38')](_0x480338[_0x129b('0x37')]);_0x1f5677['filters']=_[_0x129b('0x39')](_0x1f5677[_0x129b('0x36')],_0x1f5677[_0x129b('0x37')]);_0x1b0ab7[_0x129b('0x3a')]=_['intersection'](_0x1f5677['model'],qs[_0x129b('0x3b')](_0x480338[_0x129b('0x37')]['fields']));_0x1b0ab7[_0x129b('0x3a')]=_0x1b0ab7[_0x129b('0x3a')][_0x129b('0x3c')]?_0x1b0ab7['attributes']:_0x1f5677['model'];if(!_0x480338[_0x129b('0x37')][_0x129b('0x3d')](_0x129b('0x3e'))){_0x1b0ab7['limit']=qs[_0x129b('0x24')](_0x480338[_0x129b('0x37')]['limit']);_0x1b0ab7[_0x129b('0x22')]=qs[_0x129b('0x22')](_0x480338['query']['offset']);}_0x1b0ab7[_0x129b('0x3f')]=qs[_0x129b('0x40')](_0x480338[_0x129b('0x37')][_0x129b('0x40')]);_0x1b0ab7[_0x129b('0x41')]=qs[_0x129b('0x42')](_[_0x129b('0x43')](_0x480338['query'],_0x1f5677['filters']),_0x17e5ed);if(_0x480338[_0x129b('0x37')]['filter']){_0x1b0ab7[_0x129b('0x41')]=_[_0x129b('0x44')](_0x1b0ab7[_0x129b('0x41')],{'$or':_[_0x129b('0x34')](_0x17e5ed,function(_0x4171cb){if(_0x4171cb[_0x129b('0x35')]!=='VIRTUAL'){var _0x501f58={};_0x501f58[_0x4171cb[_0x129b('0x31')]]={'$like':'%'+_0x480338['query'][_0x129b('0x45')]+'%'};return _0x501f58;}})});}_0x1b0ab7=_[_0x129b('0x44')]({},_0x1b0ab7,_0x480338[_0x129b('0x46')]);var _0x3f0432={'where':_0x1b0ab7['where']};return db['VoicePrefix']['count'](_0x3f0432)[_0x129b('0x2b')](function(_0x4bbd59){_0x50835a[_0x129b('0x25')]=_0x4bbd59;if(_0x480338['query'][_0x129b('0x47')]){_0x1b0ab7['include']=[{'all':!![]}];}return db[_0x129b('0x48')][_0x129b('0x49')](_0x1b0ab7);})[_0x129b('0x2b')](function(_0x3e24b3){_0x50835a[_0x129b('0x4a')]=_0x3e24b3;return _0x50835a;})[_0x129b('0x2b')](respondWithFilteredResult(_0x1bf137,_0x1b0ab7))['catch'](handleError(_0x1bf137,null));};exports['show']=function(_0x51a79a,_0x277396){var _0x115918={'raw':![],'where':{'id':_0x51a79a['params']['id']}},_0x148cae={};_0x148cae['model']=_[_0x129b('0x38')](db[_0x129b('0x48')][_0x129b('0x4b')]);_0x148cae[_0x129b('0x37')]=_[_0x129b('0x38')](_0x51a79a[_0x129b('0x37')]);_0x148cae['filters']=_[_0x129b('0x39')](_0x148cae[_0x129b('0x36')],_0x148cae['query']);_0x115918[_0x129b('0x3a')]=_[_0x129b('0x39')](_0x148cae[_0x129b('0x36')],qs[_0x129b('0x3b')](_0x51a79a[_0x129b('0x37')][_0x129b('0x3b')]));_0x115918[_0x129b('0x3a')]=_0x115918[_0x129b('0x3a')][_0x129b('0x3c')]?_0x115918[_0x129b('0x3a')]:_0x148cae[_0x129b('0x36')];if(_0x51a79a[_0x129b('0x37')][_0x129b('0x47')]){_0x115918[_0x129b('0x4c')]=[{'all':!![]}];}_0x115918=_[_0x129b('0x44')]({},_0x115918,_0x51a79a[_0x129b('0x46')]);return db[_0x129b('0x48')][_0x129b('0x4d')](_0x115918)[_0x129b('0x2b')](handleEntityNotFound(_0x277396,null))[_0x129b('0x2b')](respondWithResult(_0x277396,null))['catch'](handleError(_0x277396,null));};exports[_0x129b('0x2c')]=function(_0x128d59,_0x37dcfd){return db[_0x129b('0x48')]['find']({'where':{'id':_0x128d59['params']['id']}})[_0x129b('0x2b')](handleEntityNotFound(_0x37dcfd,null))[_0x129b('0x2b')](removeEntity(_0x37dcfd,null))[_0x129b('0x4e')](handleError(_0x37dcfd,null));};exports['describe']=function(_0x484c50,_0x1426f9){return db[_0x129b('0x48')]['describe']()[_0x129b('0x2b')](respondWithResult(_0x1426f9,null))[_0x129b('0x4e')](handleError(_0x1426f9,null));};exports[_0x129b('0x4f')]=function(_0x527cb5,_0x2ef589){var _0x4590a9;return db[_0x129b('0x50')][_0x129b('0x51')](function(_0x49bda0){return db['VoicePrefix'][_0x129b('0x4f')](_0x527cb5[_0x129b('0x52')],{'transaction':_0x49bda0})[_0x129b('0x2b')](function(_0x1d37a8){_0x4590a9=_0x1d37a8[_0x129b('0x2d')]({'plain':!![]});return db['VoiceExtension'][_0x129b('0x4d')]({'where':{'id':_0x4590a9[_0x129b('0x53')]},'raw':!![]})[_0x129b('0x2b')](function(_0x21e5fe){return createVoicePrefixExtensions(_0x4590a9,_0x21e5fe,_0x49bda0);});});})[_0x129b('0x2b')](function(){var _0x1fb041=_0x527cb5[_0x129b('0x54')][_0x129b('0x2d')]({'plain':!![]});if(!_0x1fb041)throw new Error(_0x129b('0x55'));if(_0x1fb041[_0x129b('0x56')]===_0x129b('0x54')){var _0x15152d=_0x4590a9;return db[_0x129b('0x57')][_0x129b('0x4d')]({'where':{'name':_0x129b('0x2e'),'userProfileId':_0x1fb041[_0x129b('0x58')]},'raw':!![]})[_0x129b('0x2b')](function(_0x59f400){if(_0x59f400&&_0x59f400[_0x129b('0x59')]===0x0){return db[_0x129b('0x5a')][_0x129b('0x4f')]({'name':_0x15152d[_0x129b('0x31')],'resourceId':_0x15152d['id'],'type':_0x59f400[_0x129b('0x31')],'sectionId':_0x59f400['id']},{})[_0x129b('0x2b')](function(){return _0x4590a9;});}else{return _0x4590a9;}})[_0x129b('0x4e')](function(_0x10f4a5){logger['error'](_0x129b('0x5b'),_0x10f4a5);throw _0x10f4a5;});}return _0x4590a9;})['then'](respondWithResult(_0x2ef589,null))[_0x129b('0x4e')](handleError(_0x2ef589,null));};function Extension(_0x56fa31,_0x484442,_0x4a76cf,_0x2d3260){this['context']=_0x129b('0x5c');this[_0x129b('0x5d')]=_0x56fa31;this[_0x129b('0x5e')]=_0x4a76cf;this[_0x129b('0x35')]=_0x129b('0x5f');this[_0x129b('0x60')]=_0x129b('0x61');this[_0x129b('0x62')]=_0x484442;this[_0x129b('0x63')]=_0x2d3260;}function createVoicePrefixExtensions(_0x1f6fab,_0x4809ec,_0x2fc87e){return new BPromise(function(_0x126810,_0x4638be){var _0x508745=new Extension(formatPrefixName(_0x1f6fab['prefix']),0x1,_0x129b('0x64'),_0x129b('0x65'));_0x508745[_0x129b('0x66')]=_0x1f6fab['id'];return db[_0x129b('0x67')][_0x129b('0x4f')](_0x508745,{'transaction':_0x2fc87e})[_0x129b('0x2b')](function(_0x57304d){var _0x290b5d=_0x57304d[_0x129b('0x2d')]({'plain':!![]});var _0x36ed65=_[_0x129b('0x34')](addVoicePrefixExtensions(_0x1f6fab,_0x4809ec),function(_0x58f7b3){_0x58f7b3[_0x129b('0x53')]=_0x290b5d['id'];_0x58f7b3[_0x129b('0x66')]=_0x1f6fab['id'];return _0x58f7b3;});return db[_0x129b('0x67')][_0x129b('0x68')](_0x36ed65,{'transaction':_0x2fc87e})[_0x129b('0x2b')](function(_0x20545d){if(!_0x20545d){return _0x4638be('Extensions\x20creation\x20failed');}else{return _0x126810(_0x20545d);}})[_0x129b('0x4e')](function(_0x58288a){return _0x4638be(_0x58288a);});});;});};function addVoicePrefixExtensions(_0x9a966b,_0x579722){var _0x10f7f1=[];var _0x37a6eb=formatPrefixName(_0x9a966b[_0x129b('0x69')]);_0x10f7f1['push'](new Extension(_0x37a6eb,0x2,_0x129b('0x6a'),_0x129b('0x6b')+_0x9a966b[_0x129b('0x31')]));if(_0x9a966b['callerIdAll']){_0x10f7f1['push'](new Extension(_0x37a6eb,0x3,_0x129b('0x6a'),_0x129b('0x6c')+_0x9a966b['callerIdAll']));}else{_0x10f7f1[_0x129b('0x6d')](new Extension(_0x37a6eb,0x3,_0x129b('0x64'),_0x129b('0x6e')));}_0x10f7f1['push'](new Extension(_0x37a6eb,0x4,_0x129b('0x6f'),_0x579722[_0x129b('0x70')]+','+_0x129b('0x71')+(0x8+_0x9a966b['name'][_0x129b('0x3c')])+'}'+','+0x1));return _0x10f7f1;}function formatPrefixName(_0x316874){var _0x42ab53='_';for(var _0xbc6310=0x0;_0xbc6310<_0x316874[_0x129b('0x3c')];_0xbc6310++){if(_0x316874['charAt'](_0xbc6310)=='-'){_0x42ab53+=_0x316874[_0x129b('0x72')](_0xbc6310);}else{_0x42ab53+='['+_0x316874['charAt'](_0xbc6310)+']';}}_0x42ab53+='.';return _0x42ab53;}exports[_0x129b('0x2a')]=function(_0x5a34a6,_0x29198a,_0x37517b){var _0x1ab712=_0x5a34a6[_0x129b('0x52')];_0x1ab712['prefix']='system-'+_0x1ab712['name']+'-';return db[_0x129b('0x50')][_0x129b('0x51')](function(_0x2539ff){return db['VoicePrefix'][_0x129b('0x2a')](_0x1ab712,{'where':{'id':_0x1ab712['id']},'transaction':_0x2539ff})[_0x129b('0x2b')](function(){return db[_0x129b('0x67')][_0x129b('0x2c')]({'where':{'VoicePrefixId':_0x1ab712['id']},'transaction':_0x2539ff})[_0x129b('0x2b')](function(){return db[_0x129b('0x67')][_0x129b('0x4d')]({'where':{'id':_0x1ab712['VoiceExtensionId']},'raw':!![]})['then'](function(_0x7d58f3){return createVoicePrefixExtensions(_0x1ab712,_0x7d58f3,_0x2539ff);});});});})[_0x129b('0x2b')](function(){return db['VoicePrefix'][_0x129b('0x73')](_0x1ab712['id']);})[_0x129b('0x2b')](respondWithResult(_0x29198a,null))[_0x129b('0x4e')](handleError(_0x29198a,null));};exports[_0x129b('0x74')]=function(_0x2c6692,_0x39af9f,_0x18ffe1){return db[_0x129b('0x48')]['find']({'where':{'id':_0x2c6692['params']['id']}})[_0x129b('0x2b')](handleEntityNotFound(_0x39af9f,null))['then'](function(_0x36379c){if(_0x36379c){return _0x36379c['addAgents'](_0x2c6692[_0x129b('0x52')][_0x129b('0x75')],_[_0x129b('0x76')](_0x2c6692[_0x129b('0x52')],[_0x129b('0x75'),'id'])||{})[_0x129b('0x77')](function(_0x3cf6a5){for(var _0x442787=0x0;_0x442787<_0x2c6692['body'][_0x129b('0x75')][_0x129b('0x3c')];_0x442787+=0x1){socket[_0x129b('0x78')](_0x129b('0x79'),{'UserId':Number(_0x2c6692[_0x129b('0x52')]['ids'][_0x442787]),'VoicePrefixId':Number(_0x2c6692['params']['id'])});}return _0x3cf6a5;});}})['then'](respondWithResult(_0x39af9f,null))[_0x129b('0x4e')](handleError(_0x39af9f,null));};exports[_0x129b('0x7a')]=function(_0x1e753d,_0x2bdcf3,_0x2cc35a){return db[_0x129b('0x48')][_0x129b('0x4d')]({'where':{'id':_0x1e753d[_0x129b('0x7b')]['id']}})[_0x129b('0x2b')](handleEntityNotFound(_0x2bdcf3,null))[_0x129b('0x2b')](function(_0x3282f8){if(_0x3282f8){return _0x3282f8[_0x129b('0x7a')](_0x1e753d['query']['ids'])[_0x129b('0x2b')](function(){if(_['isArray'](_0x1e753d['query']['ids'])){for(var _0x306947=0x0;_0x306947<_0x1e753d[_0x129b('0x37')]['ids'][_0x129b('0x3c')];_0x306947+=0x1){socket[_0x129b('0x78')](_0x129b('0x7c'),{'UserId':Number(_0x1e753d[_0x129b('0x37')][_0x129b('0x75')][_0x306947]),'VoicePrefixId':Number(_0x1e753d[_0x129b('0x7b')]['id'])});}}else{socket[_0x129b('0x78')](_0x129b('0x7c'),{'UserId':Number(_0x1e753d[_0x129b('0x37')]['ids']),'VoicePrefixId':Number(_0x1e753d[_0x129b('0x7b')]['id'])});}});}})[_0x129b('0x2b')](respondWithStatusCode(_0x2bdcf3,null))['catch'](handleError(_0x2bdcf3,null));};exports[_0x129b('0x7d')]=function(_0x43f508,_0x21558b,_0x1cb559){var _0x2de89f={};var _0x412f7d={};var _0x47a1ed;var _0x2c2908;return db[_0x129b('0x48')][_0x129b('0x7e')]({'where':{'id':_0x43f508['params']['id']}})[_0x129b('0x2b')](handleEntityNotFound(_0x21558b,null))['then'](function(_0x261acd){if(_0x261acd){_0x47a1ed=_0x261acd;_0x412f7d[_0x129b('0x36')]=_[_0x129b('0x38')](db[_0x129b('0x7f')]['rawAttributes']);_0x412f7d[_0x129b('0x37')]=_[_0x129b('0x38')](_0x43f508[_0x129b('0x37')]);_0x412f7d[_0x129b('0x42')]=_[_0x129b('0x39')](_0x412f7d[_0x129b('0x36')],_0x412f7d[_0x129b('0x37')]);_0x2de89f[_0x129b('0x3a')]=_['intersection'](_0x412f7d[_0x129b('0x36')],qs['fields'](_0x43f508[_0x129b('0x37')][_0x129b('0x3b')]));_0x2de89f['attributes']=_0x2de89f[_0x129b('0x3a')][_0x129b('0x3c')]?_0x2de89f[_0x129b('0x3a')]:_0x412f7d[_0x129b('0x36')];_0x2de89f[_0x129b('0x3f')]=qs[_0x129b('0x40')](_0x43f508[_0x129b('0x37')][_0x129b('0x40')]);_0x2de89f[_0x129b('0x41')]=qs[_0x129b('0x42')](_[_0x129b('0x43')](_0x43f508[_0x129b('0x37')],_0x412f7d[_0x129b('0x42')]));if(_0x43f508[_0x129b('0x37')][_0x129b('0x45')]){_0x2de89f[_0x129b('0x41')]=_[_0x129b('0x44')](_0x2de89f[_0x129b('0x41')],{'$or':_['map'](_0x2de89f[_0x129b('0x3a')],function(_0x479fda){var _0x49c53c={};_0x49c53c[_0x479fda]={'$like':'%'+_0x43f508[_0x129b('0x37')][_0x129b('0x45')]+'%'};return _0x49c53c;})});}_0x2de89f=_[_0x129b('0x44')]({},_0x2de89f,_0x43f508[_0x129b('0x46')]);return _0x47a1ed[_0x129b('0x7d')](_0x2de89f);}})[_0x129b('0x2b')](function(_0x103244){if(_0x103244){_0x2c2908=_0x103244[_0x129b('0x3c')];if(!_0x43f508[_0x129b('0x37')]['hasOwnProperty'](_0x129b('0x3e'))){_0x2de89f[_0x129b('0x24')]=qs['limit'](_0x43f508[_0x129b('0x37')][_0x129b('0x24')]);_0x2de89f[_0x129b('0x22')]=qs[_0x129b('0x22')](_0x43f508[_0x129b('0x37')][_0x129b('0x22')]);}return _0x47a1ed['getAgents'](_0x2de89f);}})['then'](function(_0x31fdc1){if(_0x31fdc1){return _0x31fdc1?{'count':_0x2c2908,'rows':_0x31fdc1}:null;}})[_0x129b('0x2b')](respondWithResult(_0x21558b,null))[_0x129b('0x4e')](handleError(_0x21558b,null));}; \ No newline at end of file +var _0x38d0=['VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','exten','app','system','description','Voice\x20Prefix\x20Extension','priority','Voice\x20Prefix','VoicePrefixId','VoiceExtension','bulkCreate','Extensions\x20creation\x20failed','prefix','push','Set','callerIdAll','goto','${EXTEN:','charAt','system-','findById','addAgents','ids','omit','body','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','User','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','get','VoicePrefixes','UserProfileResource','destroy','then','end','error','stack','name','send','VoicePrefix','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','describe','create','sequelize','transaction'];(function(_0x4404ff,_0x13d7a9){var _0x5e7b19=function(_0x13847a){while(--_0x13847a){_0x4404ff['push'](_0x4404ff['shift']());}};_0x5e7b19(++_0x13d7a9);}(_0x38d0,0x123));var _0x038d=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x38d0[_0x29d94e];return _0x106237;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x038d('0x0'));var zipdir=require(_0x038d('0x1'));var jsonpatch=require(_0x038d('0x2'));var rp=require('request-promise');var moment=require(_0x038d('0x3'));var BPromise=require(_0x038d('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x038d('0x5'));var sox=require('sox');var csv=require(_0x038d('0x6'));var ejs=require(_0x038d('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x038d('0x8'));var squel=require(_0x038d('0x9'));var crypto=require(_0x038d('0xa'));var jsforce=require(_0x038d('0xb'));var deskjs=require(_0x038d('0xc'));var toCsv=require(_0x038d('0x6'));var querystring=require(_0x038d('0xd'));var Papa=require(_0x038d('0xe'));var Redis=require(_0x038d('0xf'));var authService=require(_0x038d('0x10'));var qs=require(_0x038d('0x11'));var as=require(_0x038d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x038d('0x13'))(_0x038d('0x14'));var utils=require(_0x038d('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x038d('0x16'));var db=require(_0x038d('0x17'))['db'];config[_0x038d('0x18')]=_[_0x038d('0x19')](config[_0x038d('0x18')],{'host':_0x038d('0x1a'),'port':0x18eb});var socket=require(_0x038d('0x1b'))(new Redis(config[_0x038d('0x18')]));require(_0x038d('0x1c'))['register'](socket);function respondWithStatusCode(_0x5adcd5,_0x5b764a){_0x5b764a=_0x5b764a||0xcc;return function(_0xd27ef8){if(_0xd27ef8){return _0x5adcd5[_0x038d('0x1d')](_0x5b764a);}return _0x5adcd5['status'](_0x5b764a)['end']();};}function respondWithResult(_0x4e4960,_0x483822){_0x483822=_0x483822||0xc8;return function(_0x1be3f6){if(_0x1be3f6){return _0x4e4960[_0x038d('0x1e')](_0x483822)[_0x038d('0x1f')](_0x1be3f6);}};}function respondWithFilteredResult(_0x2b5feb,_0x39cca1){return function(_0x42c17f){if(_0x42c17f){var _0x3e8d0f=typeof _0x39cca1[_0x038d('0x20')]===_0x038d('0x21')&&typeof _0x39cca1[_0x038d('0x22')]===_0x038d('0x21');var _0x21773e=_0x42c17f[_0x038d('0x23')];var _0x34206d=_0x3e8d0f?0x0:_0x39cca1['offset'];var _0x5a1bc8=_0x3e8d0f?_0x42c17f[_0x038d('0x23')]:_0x39cca1[_0x038d('0x20')]+_0x39cca1[_0x038d('0x22')];var _0x1a8efc;if(_0x5a1bc8>=_0x21773e){_0x5a1bc8=_0x21773e;_0x1a8efc=0xc8;}else{_0x1a8efc=0xce;}_0x2b5feb[_0x038d('0x1e')](_0x1a8efc);return _0x2b5feb[_0x038d('0x24')](_0x038d('0x25'),_0x34206d+'-'+_0x5a1bc8+'/'+_0x21773e)['json'](_0x42c17f);}return null;};}function patchUpdates(_0x89c6f1){return function(_0x4d1100){try{jsonpatch[_0x038d('0x26')](_0x4d1100,_0x89c6f1,!![]);}catch(_0x4eaaff){return BPromise['reject'](_0x4eaaff);}return _0x4d1100[_0x038d('0x27')]();};}function saveUpdates(_0x3611ff,_0x230020){return function(_0x1e3709){if(_0x1e3709){return _0x1e3709[_0x038d('0x28')](_0x3611ff)['then'](function(_0x107d51){return _0x107d51;});}return null;};}function removeEntity(_0x3e1286,_0x1dc3f3){return function(_0x5c7db6){if(_0x5c7db6){return _0x5c7db6['destroy']()['then'](function(){var _0x4379d9=_0x5c7db6[_0x038d('0x29')]({'plain':!![]});var _0x15babc=_0x038d('0x2a');return db[_0x038d('0x2b')][_0x038d('0x2c')]({'where':{'type':_0x15babc,'resourceId':_0x4379d9['id']}})[_0x038d('0x2d')](function(){return _0x5c7db6;});})['then'](function(){_0x3e1286['status'](0xcc)[_0x038d('0x2e')]();});}};}function handleEntityNotFound(_0x1f7cdb,_0x33fa99){return function(_0x56df41){if(!_0x56df41){_0x1f7cdb[_0x038d('0x1d')](0x194);}return _0x56df41;};}function handleError(_0x215b2e,_0x595188){_0x595188=_0x595188||0x1f4;return function(_0x5a5c4e){logger[_0x038d('0x2f')](_0x5a5c4e[_0x038d('0x30')]);if(_0x5a5c4e[_0x038d('0x31')]){delete _0x5a5c4e[_0x038d('0x31')];}_0x215b2e['status'](_0x595188)[_0x038d('0x32')](_0x5a5c4e);};}exports['index']=function(_0x1ea796,_0x7fa97b){var _0x53e114={},_0x217ab6={},_0x412c6a={'count':0x0,'rows':[]};var _0x22911b=_['map'](db[_0x038d('0x33')][_0x038d('0x34')],function(_0x5203a1){return{'name':_0x5203a1[_0x038d('0x35')],'type':_0x5203a1[_0x038d('0x36')][_0x038d('0x37')]};});_0x217ab6['model']=_[_0x038d('0x38')](_0x22911b,_0x038d('0x31'));_0x217ab6[_0x038d('0x39')]=_[_0x038d('0x3a')](_0x1ea796['query']);_0x217ab6[_0x038d('0x3b')]=_[_0x038d('0x3c')](_0x217ab6[_0x038d('0x3d')],_0x217ab6[_0x038d('0x39')]);_0x53e114[_0x038d('0x3e')]=_['intersection'](_0x217ab6[_0x038d('0x3d')],qs[_0x038d('0x3f')](_0x1ea796[_0x038d('0x39')][_0x038d('0x3f')]));_0x53e114['attributes']=_0x53e114[_0x038d('0x3e')][_0x038d('0x40')]?_0x53e114[_0x038d('0x3e')]:_0x217ab6[_0x038d('0x3d')];if(!_0x1ea796['query'][_0x038d('0x41')](_0x038d('0x42'))){_0x53e114['limit']=qs[_0x038d('0x22')](_0x1ea796['query'][_0x038d('0x22')]);_0x53e114[_0x038d('0x20')]=qs['offset'](_0x1ea796['query']['offset']);}_0x53e114[_0x038d('0x43')]=qs[_0x038d('0x44')](_0x1ea796[_0x038d('0x39')]['sort']);_0x53e114['where']=qs['filters'](_[_0x038d('0x45')](_0x1ea796[_0x038d('0x39')],_0x217ab6[_0x038d('0x3b')]),_0x22911b);if(_0x1ea796[_0x038d('0x39')]['filter']){_0x53e114[_0x038d('0x46')]=_[_0x038d('0x47')](_0x53e114[_0x038d('0x46')],{'$or':_[_0x038d('0x38')](_0x22911b,function(_0xa7c1c4){if(_0xa7c1c4[_0x038d('0x36')]!==_0x038d('0x48')){var _0x223c97={};_0x223c97[_0xa7c1c4[_0x038d('0x31')]]={'$like':'%'+_0x1ea796[_0x038d('0x39')][_0x038d('0x49')]+'%'};return _0x223c97;}})});}_0x53e114=_[_0x038d('0x47')]({},_0x53e114,_0x1ea796[_0x038d('0x4a')]);var _0x3051a2={'where':_0x53e114[_0x038d('0x46')]};return db[_0x038d('0x33')][_0x038d('0x23')](_0x3051a2)[_0x038d('0x2d')](function(_0x171545){_0x412c6a[_0x038d('0x23')]=_0x171545;if(_0x1ea796[_0x038d('0x39')][_0x038d('0x4b')]){_0x53e114[_0x038d('0x4c')]=[{'all':!![]}];}return db['VoicePrefix'][_0x038d('0x4d')](_0x53e114);})['then'](function(_0x547f4b){_0x412c6a[_0x038d('0x4e')]=_0x547f4b;return _0x412c6a;})[_0x038d('0x2d')](respondWithFilteredResult(_0x7fa97b,_0x53e114))[_0x038d('0x4f')](handleError(_0x7fa97b,null));};exports[_0x038d('0x50')]=function(_0x299e94,_0x38f7e1){var _0x2911ed={'raw':![],'where':{'id':_0x299e94[_0x038d('0x51')]['id']}},_0x27b774={};_0x27b774[_0x038d('0x3d')]=_[_0x038d('0x3a')](db[_0x038d('0x33')][_0x038d('0x34')]);_0x27b774['query']=_[_0x038d('0x3a')](_0x299e94[_0x038d('0x39')]);_0x27b774[_0x038d('0x3b')]=_[_0x038d('0x3c')](_0x27b774[_0x038d('0x3d')],_0x27b774[_0x038d('0x39')]);_0x2911ed[_0x038d('0x3e')]=_[_0x038d('0x3c')](_0x27b774['model'],qs[_0x038d('0x3f')](_0x299e94[_0x038d('0x39')][_0x038d('0x3f')]));_0x2911ed[_0x038d('0x3e')]=_0x2911ed[_0x038d('0x3e')][_0x038d('0x40')]?_0x2911ed[_0x038d('0x3e')]:_0x27b774[_0x038d('0x3d')];if(_0x299e94[_0x038d('0x39')][_0x038d('0x4b')]){_0x2911ed['include']=[{'all':!![]}];}_0x2911ed=_[_0x038d('0x47')]({},_0x2911ed,_0x299e94[_0x038d('0x4a')]);return db['VoicePrefix'][_0x038d('0x52')](_0x2911ed)[_0x038d('0x2d')](handleEntityNotFound(_0x38f7e1,null))[_0x038d('0x2d')](respondWithResult(_0x38f7e1,null))[_0x038d('0x4f')](handleError(_0x38f7e1,null));};exports[_0x038d('0x2c')]=function(_0x4780ca,_0x4e35dd){return db['VoicePrefix']['find']({'where':{'id':_0x4780ca[_0x038d('0x51')]['id']}})[_0x038d('0x2d')](handleEntityNotFound(_0x4e35dd,null))['then'](removeEntity(_0x4e35dd,null))[_0x038d('0x4f')](handleError(_0x4e35dd,null));};exports[_0x038d('0x53')]=function(_0x4bba6a,_0x3844d3){return db['VoicePrefix'][_0x038d('0x53')]()[_0x038d('0x2d')](respondWithResult(_0x3844d3,null))['catch'](handleError(_0x3844d3,null));};exports[_0x038d('0x54')]=function(_0x21822b,_0x1294d6){var _0x2684e6;return db[_0x038d('0x55')][_0x038d('0x56')](function(_0x55f50f){return db[_0x038d('0x33')][_0x038d('0x54')](_0x21822b['body'],{'transaction':_0x55f50f})[_0x038d('0x2d')](function(_0x439686){_0x2684e6=_0x439686[_0x038d('0x29')]({'plain':!![]});return db['VoiceExtension'][_0x038d('0x52')]({'where':{'id':_0x2684e6[_0x038d('0x57')]},'raw':!![]})[_0x038d('0x2d')](function(_0x3d30c4){return createVoicePrefixExtensions(_0x2684e6,_0x3d30c4,_0x55f50f);});});})[_0x038d('0x2d')](function(){var _0xe9356b=_0x21822b[_0x038d('0x58')]['get']({'plain':!![]});if(!_0xe9356b)throw new Error(_0x038d('0x59'));if(_0xe9356b[_0x038d('0x5a')]===_0x038d('0x58')){var _0x13c509=_0x2684e6;return db[_0x038d('0x5b')]['find']({'where':{'name':_0x038d('0x2a'),'userProfileId':_0xe9356b['userProfileId']},'raw':!![]})[_0x038d('0x2d')](function(_0x1ed7b9){if(_0x1ed7b9&&_0x1ed7b9[_0x038d('0x5c')]===0x0){return db[_0x038d('0x2b')][_0x038d('0x54')]({'name':_0x13c509['name'],'resourceId':_0x13c509['id'],'type':_0x1ed7b9[_0x038d('0x31')],'sectionId':_0x1ed7b9['id']},{})[_0x038d('0x2d')](function(){return _0x2684e6;});}else{return _0x2684e6;}})[_0x038d('0x4f')](function(_0xa60e86){logger[_0x038d('0x2f')](_0x038d('0x5d'),_0xa60e86);throw _0xa60e86;});}return _0x2684e6;})[_0x038d('0x2d')](respondWithResult(_0x1294d6,null))[_0x038d('0x4f')](handleError(_0x1294d6,null));};function Extension(_0x4aadd7,_0x397dd6,_0x8b2cae,_0x1ff554){this[_0x038d('0x5e')]='from-sip';this[_0x038d('0x5f')]=_0x4aadd7;this[_0x038d('0x60')]=_0x8b2cae;this[_0x038d('0x36')]=_0x038d('0x61');this[_0x038d('0x62')]=_0x038d('0x63');this[_0x038d('0x64')]=_0x397dd6;this['appdata']=_0x1ff554;}function createVoicePrefixExtensions(_0x6ef17e,_0x1444de,_0x4f6d18){return new BPromise(function(_0x59b2f6,_0x2bb18d){var _0x2cf8bc=new Extension(formatPrefixName(_0x6ef17e['prefix']),0x1,'NoOp',_0x038d('0x65'));_0x2cf8bc[_0x038d('0x66')]=_0x6ef17e['id'];return db[_0x038d('0x67')]['create'](_0x2cf8bc,{'transaction':_0x4f6d18})[_0x038d('0x2d')](function(_0x495be9){var _0x182e73=_0x495be9['get']({'plain':!![]});var _0x1a7caf=_[_0x038d('0x38')](addVoicePrefixExtensions(_0x6ef17e,_0x1444de),function(_0x3ee828){_0x3ee828[_0x038d('0x57')]=_0x182e73['id'];_0x3ee828['VoicePrefixId']=_0x6ef17e['id'];return _0x3ee828;});return db['VoiceExtension'][_0x038d('0x68')](_0x1a7caf,{'transaction':_0x4f6d18})[_0x038d('0x2d')](function(_0x46ac89){if(!_0x46ac89){return _0x2bb18d(_0x038d('0x69'));}else{return _0x59b2f6(_0x46ac89);}})[_0x038d('0x4f')](function(_0x2a61d8){return _0x2bb18d(_0x2a61d8);});});;});};function addVoicePrefixExtensions(_0x2f2c9d,_0x2738c8){var _0x1f0fce=[];var _0x52878d=formatPrefixName(_0x2f2c9d[_0x038d('0x6a')]);_0x1f0fce[_0x038d('0x6b')](new Extension(_0x52878d,0x2,_0x038d('0x6c'),'CDR(prefix)='+_0x2f2c9d[_0x038d('0x31')]));if(_0x2f2c9d[_0x038d('0x6d')]){_0x1f0fce[_0x038d('0x6b')](new Extension(_0x52878d,0x3,_0x038d('0x6c'),'PREFIX-CALLERIDALL='+_0x2f2c9d[_0x038d('0x6d')]));}else{_0x1f0fce['push'](new Extension(_0x52878d,0x3,'NoOp','No\x20callerid\x20available'));}_0x1f0fce[_0x038d('0x6b')](new Extension(_0x52878d,0x4,_0x038d('0x6e'),_0x2738c8['context']+','+_0x038d('0x6f')+(0x8+_0x2f2c9d['name']['length'])+'}'+','+0x1));return _0x1f0fce;}function formatPrefixName(_0x5d5ea7){var _0x51cd44='_';for(var _0x20c5e3=0x0;_0x20c5e3<_0x5d5ea7[_0x038d('0x40')];_0x20c5e3++){if(_0x5d5ea7[_0x038d('0x70')](_0x20c5e3)=='-'){_0x51cd44+=_0x5d5ea7[_0x038d('0x70')](_0x20c5e3);}else{_0x51cd44+='['+_0x5d5ea7[_0x038d('0x70')](_0x20c5e3)+']';}}_0x51cd44+='.';return _0x51cd44;}exports[_0x038d('0x28')]=function(_0x230d52,_0xf2445,_0x35c96e){var _0x194599=_0x230d52['body'];_0x194599[_0x038d('0x6a')]=_0x038d('0x71')+_0x194599['name']+'-';return db[_0x038d('0x55')][_0x038d('0x56')](function(_0x2b7e79){return db[_0x038d('0x33')][_0x038d('0x28')](_0x194599,{'where':{'id':_0x194599['id']},'transaction':_0x2b7e79})[_0x038d('0x2d')](function(){return db[_0x038d('0x67')]['destroy']({'where':{'VoicePrefixId':_0x194599['id']},'transaction':_0x2b7e79})[_0x038d('0x2d')](function(){return db['VoiceExtension'][_0x038d('0x52')]({'where':{'id':_0x194599[_0x038d('0x57')]},'raw':!![]})['then'](function(_0x3ee3d9){return createVoicePrefixExtensions(_0x194599,_0x3ee3d9,_0x2b7e79);});});});})['then'](function(){return db[_0x038d('0x33')][_0x038d('0x72')](_0x194599['id']);})['then'](respondWithResult(_0xf2445,null))['catch'](handleError(_0xf2445,null));};exports['addAgents']=function(_0x1a9bd3,_0x3602a3,_0x598f08){return db[_0x038d('0x33')][_0x038d('0x52')]({'where':{'id':_0x1a9bd3[_0x038d('0x51')]['id']}})[_0x038d('0x2d')](handleEntityNotFound(_0x3602a3,null))[_0x038d('0x2d')](function(_0x16545a){if(_0x16545a){return _0x16545a[_0x038d('0x73')](_0x1a9bd3['body'][_0x038d('0x74')],_[_0x038d('0x75')](_0x1a9bd3[_0x038d('0x76')],[_0x038d('0x74'),'id'])||{})['spread'](function(_0x15f6fe){for(var _0x1b12e9=0x0;_0x1b12e9<_0x1a9bd3[_0x038d('0x76')][_0x038d('0x74')][_0x038d('0x40')];_0x1b12e9+=0x1){socket[_0x038d('0x77')](_0x038d('0x78'),{'UserId':Number(_0x1a9bd3[_0x038d('0x76')][_0x038d('0x74')][_0x1b12e9]),'VoicePrefixId':Number(_0x1a9bd3[_0x038d('0x51')]['id'])});}return _0x15f6fe;});}})[_0x038d('0x2d')](respondWithResult(_0x3602a3,null))[_0x038d('0x4f')](handleError(_0x3602a3,null));};exports[_0x038d('0x79')]=function(_0x95c299,_0x3e2640,_0x44ac43){return db['VoicePrefix']['find']({'where':{'id':_0x95c299['params']['id']}})[_0x038d('0x2d')](handleEntityNotFound(_0x3e2640,null))['then'](function(_0x1fab00){if(_0x1fab00){return _0x1fab00[_0x038d('0x79')](_0x95c299[_0x038d('0x39')][_0x038d('0x74')])[_0x038d('0x2d')](function(){if(_[_0x038d('0x7a')](_0x95c299['query'][_0x038d('0x74')])){for(var _0x52a66d=0x0;_0x52a66d<_0x95c299['query'][_0x038d('0x74')][_0x038d('0x40')];_0x52a66d+=0x1){socket[_0x038d('0x77')](_0x038d('0x7b'),{'UserId':Number(_0x95c299[_0x038d('0x39')][_0x038d('0x74')][_0x52a66d]),'VoicePrefixId':Number(_0x95c299[_0x038d('0x51')]['id'])});}}else{socket[_0x038d('0x77')](_0x038d('0x7b'),{'UserId':Number(_0x95c299[_0x038d('0x39')][_0x038d('0x74')]),'VoicePrefixId':Number(_0x95c299[_0x038d('0x51')]['id'])});}});}})['then'](respondWithStatusCode(_0x3e2640,null))[_0x038d('0x4f')](handleError(_0x3e2640,null));};exports[_0x038d('0x7c')]=function(_0xfbda6d,_0x440db5,_0x7d2904){var _0x2b41fe={};var _0x585494={};var _0x46b9d6;var _0xd7101a;return db[_0x038d('0x33')]['findOne']({'where':{'id':_0xfbda6d[_0x038d('0x51')]['id']}})[_0x038d('0x2d')](handleEntityNotFound(_0x440db5,null))['then'](function(_0x29d462){if(_0x29d462){_0x46b9d6=_0x29d462;_0x585494[_0x038d('0x3d')]=_['keys'](db[_0x038d('0x7d')]['rawAttributes']);_0x585494['query']=_[_0x038d('0x3a')](_0xfbda6d[_0x038d('0x39')]);_0x585494[_0x038d('0x3b')]=_[_0x038d('0x3c')](_0x585494[_0x038d('0x3d')],_0x585494[_0x038d('0x39')]);_0x2b41fe[_0x038d('0x3e')]=_[_0x038d('0x3c')](_0x585494[_0x038d('0x3d')],qs[_0x038d('0x3f')](_0xfbda6d[_0x038d('0x39')]['fields']));_0x2b41fe['attributes']=_0x2b41fe[_0x038d('0x3e')]['length']?_0x2b41fe[_0x038d('0x3e')]:_0x585494[_0x038d('0x3d')];_0x2b41fe[_0x038d('0x43')]=qs['sort'](_0xfbda6d[_0x038d('0x39')][_0x038d('0x44')]);_0x2b41fe[_0x038d('0x46')]=qs[_0x038d('0x3b')](_['pick'](_0xfbda6d['query'],_0x585494[_0x038d('0x3b')]));if(_0xfbda6d[_0x038d('0x39')][_0x038d('0x49')]){_0x2b41fe['where']=_[_0x038d('0x47')](_0x2b41fe['where'],{'$or':_['map'](_0x2b41fe[_0x038d('0x3e')],function(_0x38e342){var _0x47b41a={};_0x47b41a[_0x38e342]={'$like':'%'+_0xfbda6d[_0x038d('0x39')][_0x038d('0x49')]+'%'};return _0x47b41a;})});}_0x2b41fe=_[_0x038d('0x47')]({},_0x2b41fe,_0xfbda6d[_0x038d('0x4a')]);return _0x46b9d6[_0x038d('0x7c')](_0x2b41fe);}})['then'](function(_0x5111a6){if(_0x5111a6){_0xd7101a=_0x5111a6['length'];if(!_0xfbda6d[_0x038d('0x39')]['hasOwnProperty'](_0x038d('0x42'))){_0x2b41fe[_0x038d('0x22')]=qs['limit'](_0xfbda6d[_0x038d('0x39')][_0x038d('0x22')]);_0x2b41fe['offset']=qs[_0x038d('0x20')](_0xfbda6d[_0x038d('0x39')]['offset']);}return _0x46b9d6[_0x038d('0x7c')](_0x2b41fe);}})[_0x038d('0x2d')](function(_0x5d439b){if(_0x5d439b){return _0x5d439b?{'count':_0xd7101a,'rows':_0x5d439b}:null;}})['then'](respondWithResult(_0x440db5,null))[_0x038d('0x4f')](handleError(_0x440db5,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 15fae3c..57ce88a 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 _0x0506=['exports','events','../../mysqldb','VoicePrefix','update','emit','hasOwnProperty','hook'];(function(_0x14a913,_0x1329b5){var _0x4ce6e9=function(_0x10d39f){while(--_0x10d39f){_0x14a913['push'](_0x14a913['shift']());}};_0x4ce6e9(++_0x1329b5);}(_0x0506,0x89));var _0x6050=function(_0x28496c,_0x4049ce){_0x28496c=_0x28496c-0x0;var _0x1d3d40=_0x0506[_0x28496c];return _0x1d3d40;};'use strict';var EventEmitter=require(_0x6050('0x0'));var VoicePrefix=require(_0x6050('0x1'))['db'][_0x6050('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x6050('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2d9cac){return function(_0x568ca5,_0x520946,_0x589ef9){VoicePrefixEvents[_0x6050('0x4')](_0x2d9cac+':'+_0x568ca5['id'],_0x568ca5);VoicePrefixEvents[_0x6050('0x4')](_0x2d9cac,_0x568ca5);_0x589ef9(null);};}for(var e in events){if(events[_0x6050('0x5')](e)){var event=events[e];VoicePrefix[_0x6050('0x6')](e,emitEvent(event));}}module[_0x6050('0x7')]=VoicePrefixEvents; \ No newline at end of file +var _0x6b06=['hook','exports','events','../../mysqldb','VoicePrefix','save','remove','emit','hasOwnProperty'];(function(_0x73005,_0x4c3c9b){var _0x2bf653=function(_0x1324c7){while(--_0x1324c7){_0x73005['push'](_0x73005['shift']());}};_0x2bf653(++_0x4c3c9b);}(_0x6b06,0xfe));var _0x66b0=function(_0x35cefa,_0x25921f){_0x35cefa=_0x35cefa-0x0;var _0x1b972a=_0x6b06[_0x35cefa];return _0x1b972a;};'use strict';var EventEmitter=require(_0x66b0('0x0'));var VoicePrefix=require(_0x66b0('0x1'))['db'][_0x66b0('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x66b0('0x3'),'afterUpdate':'update','afterDestroy':_0x66b0('0x4')};function emitEvent(_0xd15ace){return function(_0x22bbda,_0x1475d3,_0x563ef0){VoicePrefixEvents[_0x66b0('0x5')](_0xd15ace+':'+_0x22bbda['id'],_0x22bbda);VoicePrefixEvents['emit'](_0xd15ace,_0x22bbda);_0x563ef0(null);};}for(var e in events){if(events[_0x66b0('0x6')](e)){var event=events[e];VoicePrefix[_0x66b0('0x7')](e,emitEvent(event));}}module[_0x66b0('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 e7abf4a..9bf8ca7 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 _0x857d=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','lodash','util'];(function(_0x549cbe,_0x207b54){var _0x1e3dc7=function(_0x3ef7cd){while(--_0x3ef7cd){_0x549cbe['push'](_0x549cbe['shift']());}};_0x1e3dc7(++_0x207b54);}(_0x857d,0xb4));var _0xd857=function(_0x1df9cf,_0x224ea0){_0x1df9cf=_0x1df9cf-0x0;var _0x1d9cba=_0x857d[_0x1df9cf];return _0x1d9cba;};'use strict';var _=require(_0xd857('0x0'));var util=require(_0xd857('0x1'));var logger=require(_0xd857('0x2'))(_0xd857('0x3'));var moment=require(_0xd857('0x4'));var BPromise=require(_0xd857('0x5'));var rp=require(_0xd857('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd857('0x7'));var config=require(_0xd857('0x8'));var attributes=require(_0xd857('0x9'));module[_0xd857('0xa')]=function(_0x4e4a8b,_0x58c515){return _0x4e4a8b[_0xd857('0xb')](_0xd857('0xc'),attributes,{'tableName':_0xd857('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc4cc=['request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','define','voice_prefixes','util','../../config/logger','api','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc4cc,0xb7));var _0xcc4c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc4cc[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xcc4c('0x0'));var logger=require(_0xcc4c('0x1'))(_0xcc4c('0x2'));var moment=require('moment');var BPromise=require(_0xcc4c('0x3'));var rp=require(_0xcc4c('0x4'));var fs=require('fs');var path=require(_0xcc4c('0x5'));var rimraf=require(_0xcc4c('0x6'));var config=require(_0xcc4c('0x7'));var attributes=require(_0xcc4c('0x8'));module['exports']=function(_0x3d0cca,_0x249769){return _0x3d0cca[_0xcc4c('0x9')]('VoicePrefix',attributes,{'tableName':_0xcc4c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index 9921d82..80c14f0 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 _0xb511=['rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','then','info','VoicePrefix,\x20%s,\x20%s','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x1d156c,_0x3ec309){var _0x4b96a4=function(_0x1d58d5){while(--_0x1d58d5){_0x1d156c['push'](_0x1d156c['shift']());}};_0x4b96a4(++_0x3ec309);}(_0xb511,0x165));var _0x1b51=function(_0x4a03dd,_0x23d065){_0x4a03dd=_0x4a03dd-0x0;var _0x25b7b6=_0xb511[_0x4a03dd];return _0x25b7b6;};'use strict';var _=require(_0x1b51('0x0'));var util=require(_0x1b51('0x1'));var moment=require(_0x1b51('0x2'));var BPromise=require('bluebird');var rs=require(_0x1b51('0x3'));var fs=require('fs');var Redis=require(_0x1b51('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1b51('0x5'));var logger=require(_0x1b51('0x6'))(_0x1b51('0x7'));var config=require('../../config/environment');var jayson=require(_0x1b51('0x8'));var client=jayson[_0x1b51('0x9')]['http']({'port':0x232a});config[_0x1b51('0xa')]=_[_0x1b51('0xb')](config['redis'],{'host':_0x1b51('0xc'),'port':0x18eb});var socket=require(_0x1b51('0xd'))(new Redis(config[_0x1b51('0xa')]));require(_0x1b51('0xe'))[_0x1b51('0xf')](socket);function respondWithRpcPromise(_0x388fa7,_0x16a25b,_0x220ca2){return new BPromise(function(_0x4d01be,_0x337839){return client[_0x1b51('0x10')](_0x388fa7,_0x220ca2)[_0x1b51('0x11')](function(_0x3cc22d){logger[_0x1b51('0x12')](_0x1b51('0x13'),_0x16a25b,'request\x20sent');logger[_0x1b51('0x14')](_0x1b51('0x15'),_0x16a25b,_0x1b51('0x16'),JSON[_0x1b51('0x17')](_0x3cc22d));if(_0x3cc22d[_0x1b51('0x18')]){if(_0x3cc22d[_0x1b51('0x18')][_0x1b51('0x19')]===0x1f4){logger['error'](_0x1b51('0x13'),_0x16a25b,_0x3cc22d['error']['message']);return _0x337839(_0x3cc22d[_0x1b51('0x18')][_0x1b51('0x1a')]);}logger['error'](_0x1b51('0x13'),_0x16a25b,_0x3cc22d[_0x1b51('0x18')][_0x1b51('0x1a')]);return _0x4d01be(_0x3cc22d['error'][_0x1b51('0x1a')]);}else{logger[_0x1b51('0x12')](_0x1b51('0x13'),_0x16a25b,_0x1b51('0x16'));_0x4d01be(_0x3cc22d['result'][_0x1b51('0x1a')]);}})[_0x1b51('0x1b')](function(_0x153c33){logger['error']('VoicePrefix,\x20%s,\x20%s',_0x16a25b,_0x153c33);_0x337839(_0x153c33);});});} \ No newline at end of file +var _0x7880=['defaults','localhost','register','request','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7880,0x1f4));var _0x0788=function(_0x37d317,_0x46dcc1){_0x37d317=_0x37d317-0x0;var _0x2c757f=_0x7880[_0x37d317];return _0x2c757f;};'use strict';var _=require('lodash');var util=require(_0x0788('0x0'));var moment=require(_0x0788('0x1'));var BPromise=require(_0x0788('0x2'));var rs=require(_0x0788('0x3'));var fs=require('fs');var Redis=require(_0x0788('0x4'));var db=require(_0x0788('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0788('0x6'))(_0x0788('0x7'));var config=require(_0x0788('0x8'));var jayson=require(_0x0788('0x9'));var client=jayson[_0x0788('0xa')][_0x0788('0xb')]({'port':0x232a});config[_0x0788('0xc')]=_[_0x0788('0xd')](config[_0x0788('0xc')],{'host':_0x0788('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0788('0xc')]));require('./voicePrefix.socket')[_0x0788('0xf')](socket);function respondWithRpcPromise(_0x53b2f2,_0x433c26,_0x3c6d18){return new BPromise(function(_0x1f9ff6,_0xee8670){return client[_0x0788('0x10')](_0x53b2f2,_0x3c6d18)['then'](function(_0x1920b3){logger[_0x0788('0x11')](_0x0788('0x12'),_0x433c26,_0x0788('0x13'));logger[_0x0788('0x14')](_0x0788('0x15'),_0x433c26,_0x0788('0x13'),JSON['stringify'](_0x1920b3));if(_0x1920b3[_0x0788('0x16')]){if(_0x1920b3[_0x0788('0x16')][_0x0788('0x17')]===0x1f4){logger[_0x0788('0x16')]('VoicePrefix,\x20%s,\x20%s',_0x433c26,_0x1920b3[_0x0788('0x16')]['message']);return _0xee8670(_0x1920b3[_0x0788('0x16')][_0x0788('0x18')]);}logger[_0x0788('0x16')](_0x0788('0x12'),_0x433c26,_0x1920b3[_0x0788('0x16')][_0x0788('0x18')]);return _0x1f9ff6(_0x1920b3['error']['message']);}else{logger[_0x0788('0x11')](_0x0788('0x12'),_0x433c26,'request\x20sent');_0x1f9ff6(_0x1920b3[_0x0788('0x19')][_0x0788('0x18')]);}})[_0x0788('0x1a')](function(_0x52c339){logger[_0x0788('0x16')](_0x0788('0x12'),_0x433c26,_0x52c339);_0xee8670(_0x52c339);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 8fde682..1cc7828 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 _0x85cf=['remove','update','emit','register','length','voicePrefix:','save'];(function(_0x35d3b9,_0x28d658){var _0x9fc7c2=function(_0x43f15d){while(--_0x43f15d){_0x35d3b9['push'](_0x35d3b9['shift']());}};_0x9fc7c2(++_0x28d658);}(_0x85cf,0x76));var _0xf85c=function(_0x4bc7ea,_0x5e3b49){_0x4bc7ea=_0x4bc7ea-0x0;var _0x5a2f25=_0x85cf[_0x4bc7ea];return _0x5a2f25;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0xf85c('0x0'),_0xf85c('0x1'),_0xf85c('0x2')];function createListener(_0xc9366f,_0x39bbfd){return function(_0x240fa2){_0x39bbfd[_0xf85c('0x3')](_0xc9366f,_0x240fa2);};}function removeListener(_0x156922,_0x495110){return function(){VoicePrefixEvents['removeListener'](_0x156922,_0x495110);};}exports[_0xf85c('0x4')]=function(_0x3a5a32){for(var _0x51ac85=0x0,_0x386a60=events[_0xf85c('0x5')];_0x51ac85<_0x386a60;_0x51ac85++){var _0xe1be83=events[_0x51ac85];var _0x1bebcf=createListener(_0xf85c('0x6')+_0xe1be83,_0x3a5a32);VoicePrefixEvents['on'](_0xe1be83,_0x1bebcf);}}; \ No newline at end of file +var _0x255f=['emit','removeListener','register','voicePrefix:','./voicePrefix.events','remove','update'];(function(_0x1451c1,_0x1657f1){var _0x24da3f=function(_0x485c81){while(--_0x485c81){_0x1451c1['push'](_0x1451c1['shift']());}};_0x24da3f(++_0x1657f1);}(_0x255f,0x185));var _0xf255=function(_0xf7a5d6,_0x4c671e){_0xf7a5d6=_0xf7a5d6-0x0;var _0xe21476=_0x255f[_0xf7a5d6];return _0xe21476;};'use strict';var VoicePrefixEvents=require(_0xf255('0x0'));var events=['save',_0xf255('0x1'),_0xf255('0x2')];function createListener(_0xba19b,_0x4fae55){return function(_0x3984f5){_0x4fae55[_0xf255('0x3')](_0xba19b,_0x3984f5);};}function removeListener(_0x474ac5,_0x151b29){return function(){VoicePrefixEvents[_0xf255('0x4')](_0x474ac5,_0x151b29);};}exports[_0xf255('0x5')]=function(_0xc1d19f){for(var _0x5bbed0=0x0,_0x1236fb=events['length'];_0x5bbed0<_0x1236fb;_0x5bbed0++){var _0x481d8c=events[_0x5bbed0];var _0x4a533f=createListener(_0xf255('0x6')+_0x481d8c,_0xc1d19f);VoicePrefixEvents['on'](_0x481d8c,_0x4a533f);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index c58296d..1bc268b 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 _0x8d00=['getTeams','/:id/users','/:id/members','getMembers','getLists','/:id/blacklists','getBlackLists','create','post','/:id/clone','clone','addTeams','addAgents','/:id/lists','addLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x8d00,0x6d));var _0x08d0=function(_0x34a580,_0x6dffeb){_0x34a580=_0x34a580-0x0;var _0x3e268d=_0x8d00[_0x34a580];return _0x3e268d;};'use strict';var multer=require(_0x08d0('0x0'));var util=require(_0x08d0('0x1'));var path=require('path');var timeout=require(_0x08d0('0x2'));var express=require('express');var router=express[_0x08d0('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x08d0('0x4'));var interaction=require(_0x08d0('0x5'));var config=require(_0x08d0('0x6'));var controller=require('./voiceQueue.controller');router['get']('/',auth[_0x08d0('0x7')](),controller[_0x08d0('0x8')]);router[_0x08d0('0x9')](_0x08d0('0xa'),auth[_0x08d0('0x7')](),controller[_0x08d0('0xb')]);router['get'](_0x08d0('0xc'),auth[_0x08d0('0x7')](),controller[_0x08d0('0xd')]);router[_0x08d0('0x9')]('/:id/hopper_histories',auth[_0x08d0('0x7')](),controller[_0x08d0('0xe')]);router['get'](_0x08d0('0xf'),auth[_0x08d0('0x7')](),controller[_0x08d0('0x10')]);router[_0x08d0('0x9')](_0x08d0('0x11'),auth['isAuthenticated'](),controller[_0x08d0('0x12')]);router[_0x08d0('0x9')](_0x08d0('0x13'),auth[_0x08d0('0x7')](),controller[_0x08d0('0x14')]);router[_0x08d0('0x9')](_0x08d0('0x15'),auth[_0x08d0('0x7')](),controller['getAgents']);router[_0x08d0('0x9')](_0x08d0('0x16'),auth[_0x08d0('0x7')](),controller[_0x08d0('0x17')]);router[_0x08d0('0x9')]('/:id/lists',auth[_0x08d0('0x7')](),controller[_0x08d0('0x18')]);router[_0x08d0('0x9')](_0x08d0('0x19'),auth['isAuthenticated'](),controller[_0x08d0('0x1a')]);router['post']('/',auth['isAuthenticated'](),controller[_0x08d0('0x1b')]);router[_0x08d0('0x1c')](_0x08d0('0x1d'),auth[_0x08d0('0x7')](),controller[_0x08d0('0x1e')]);router['post'](_0x08d0('0x13'),auth[_0x08d0('0x7')](),controller[_0x08d0('0x1f')]);router['post'](_0x08d0('0x15'),auth['isAuthenticated'](),controller[_0x08d0('0x20')]);router['post'](_0x08d0('0x21'),auth[_0x08d0('0x7')](),controller[_0x08d0('0x22')]);router[_0x08d0('0x1c')]('/:id/blacklists',auth[_0x08d0('0x7')](),controller['addBlackLists']);router['put'](_0x08d0('0xa'),auth[_0x08d0('0x7')](),controller[_0x08d0('0x23')]);router[_0x08d0('0x24')](_0x08d0('0xa'),auth[_0x08d0('0x7')](),controller[_0x08d0('0x25')]);router[_0x08d0('0x24')](_0x08d0('0x13'),auth[_0x08d0('0x7')](),controller[_0x08d0('0x26')]);router[_0x08d0('0x24')]('/:id/users',auth[_0x08d0('0x7')](),controller[_0x08d0('0x27')]);router[_0x08d0('0x24')](_0x08d0('0x21'),auth[_0x08d0('0x7')](),controller[_0x08d0('0x28')]);router[_0x08d0('0x24')](_0x08d0('0x19'),auth[_0x08d0('0x7')](),controller[_0x08d0('0x29')]);module[_0x08d0('0x2a')]=router; \ No newline at end of file +var _0x38a0=['addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeBlackLists','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated','index','show','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/users','getAgents','/:id/members','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','/:id/teams','addTeams','addAgents','addLists'];(function(_0x57e155,_0x53eee7){var _0x4ebd79=function(_0x352cd2){while(--_0x352cd2){_0x57e155['push'](_0x57e155['shift']());}};_0x4ebd79(++_0x53eee7);}(_0x38a0,0x1ec));var _0x038a=function(_0x18c85e,_0x5db650){_0x18c85e=_0x18c85e-0x0;var _0x1c7e11=_0x38a0[_0x18c85e];return _0x1c7e11;};'use strict';var multer=require(_0x038a('0x0'));var util=require(_0x038a('0x1'));var path=require(_0x038a('0x2'));var timeout=require(_0x038a('0x3'));var express=require(_0x038a('0x4'));var router=express['Router']();var fs_extra=require(_0x038a('0x5'));var auth=require(_0x038a('0x6'));var interaction=require(_0x038a('0x7'));var config=require(_0x038a('0x8'));var controller=require(_0x038a('0x9'));router[_0x038a('0xa')]('/',auth[_0x038a('0xb')](),controller[_0x038a('0xc')]);router[_0x038a('0xa')]('/:id',auth[_0x038a('0xb')](),controller[_0x038a('0xd')]);router[_0x038a('0xa')]('/:id/hoppers',auth[_0x038a('0xb')](),controller[_0x038a('0xe')]);router[_0x038a('0xa')](_0x038a('0xf'),auth[_0x038a('0xb')](),controller[_0x038a('0x10')]);router[_0x038a('0xa')](_0x038a('0x11'),auth['isAuthenticated'](),controller[_0x038a('0x12')]);router['get'](_0x038a('0x13'),auth[_0x038a('0xb')](),controller[_0x038a('0x14')]);router[_0x038a('0xa')]('/:id/teams',auth[_0x038a('0xb')](),controller['getTeams']);router[_0x038a('0xa')](_0x038a('0x15'),auth[_0x038a('0xb')](),controller[_0x038a('0x16')]);router['get'](_0x038a('0x17'),auth[_0x038a('0xb')](),controller['getMembers']);router[_0x038a('0xa')](_0x038a('0x18'),auth[_0x038a('0xb')](),controller[_0x038a('0x19')]);router[_0x038a('0xa')](_0x038a('0x1a'),auth[_0x038a('0xb')](),controller[_0x038a('0x1b')]);router[_0x038a('0x1c')]('/',auth[_0x038a('0xb')](),controller[_0x038a('0x1d')]);router[_0x038a('0x1c')](_0x038a('0x1e'),auth[_0x038a('0xb')](),controller[_0x038a('0x1f')]);router[_0x038a('0x1c')](_0x038a('0x20'),auth['isAuthenticated'](),controller[_0x038a('0x21')]);router['post'](_0x038a('0x15'),auth['isAuthenticated'](),controller[_0x038a('0x22')]);router[_0x038a('0x1c')](_0x038a('0x18'),auth[_0x038a('0xb')](),controller[_0x038a('0x23')]);router['post'](_0x038a('0x1a'),auth['isAuthenticated'](),controller[_0x038a('0x24')]);router[_0x038a('0x25')](_0x038a('0x26'),auth['isAuthenticated'](),controller[_0x038a('0x27')]);router['delete'](_0x038a('0x26'),auth[_0x038a('0xb')](),controller['destroy']);router[_0x038a('0x28')](_0x038a('0x20'),auth[_0x038a('0xb')](),controller[_0x038a('0x29')]);router['delete'](_0x038a('0x15'),auth['isAuthenticated'](),controller[_0x038a('0x2a')]);router[_0x038a('0x28')](_0x038a('0x18'),auth[_0x038a('0xb')](),controller['removeLists']);router['delete']('/:id/blacklists',auth['isAuthenticated'](),controller[_0x038a('0x2b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index a000076..83fed7f 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 _0x8075=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','name','inbound','outbound','STRING','default','ringall','fewestcalls','random','rrmemory','linear','wrandom','rrordered','setDataValue','strategy','getDataValue','type','dialMethod','booked','roundrobin','progressive','predictive','power','INTEGER','ENUM','yes','all','once','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','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)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#RecallMe\x20Timeout\x20(min:1)','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\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)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x205dd4,_0x56dad9){var _0x2cc869=function(_0x1ae57c){while(--_0x1ae57c){_0x205dd4['push'](_0x205dd4['shift']());}};_0x2cc869(++_0x56dad9);}(_0x8075,0xab));var _0x5807=function(_0x3355d2,_0xccef9a){_0x3355d2=_0x3355d2-0x0;var _0x5b6bda=_0x8075[_0x3355d2];return _0x5b6bda;};'use strict';var Sequelize=require(_0x5807('0x0'));module[_0x5807('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x5807('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x5807('0x3'),_0x5807('0x4')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x5807('0x5')],'defaultValue':_0x5807('0x6')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x5807('0x7'),'leastrecent',_0x5807('0x8'),_0x5807('0x9'),_0x5807('0xa'),_0x5807('0xb'),_0x5807('0xc'),_0x5807('0xd')),'allowNull':![],'defaultValue':'ringall','set':function(_0x47f3dc){this[_0x5807('0xe')](_0x5807('0xf'),_0x47f3dc?_0x47f3dc:_0x5807('0xa'));},'get':function(){var _0x121888=this[_0x5807('0x10')](_0x5807('0x11'));var _0xa1ec39=this[_0x5807('0x10')](_0x5807('0x12'));var _0x33a81a=this[_0x5807('0x10')]('strategy');if(_0x121888===_0x5807('0x3')){return _0x33a81a;}if(_0xa1ec39===_0x5807('0x13')&&_0x33a81a===_0x5807('0xa')||_0xa1ec39===_0x5807('0x13')&&_0x33a81a===_0x5807('0x14')){return _0x33a81a;}if(_0xa1ec39===_0x5807('0x15')||_0xa1ec39===_0x5807('0x16')||_0xa1ec39===_0x5807('0x17')){return _0x33a81a;}return null;}},'servicelevel':{'type':Sequelize[_0x5807('0x18')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x5807('0x5')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x5807('0x18')](0xb)},'timeout':{'type':Sequelize[_0x5807('0x18')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x5807('0x18')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x5807('0x5')]},'weight':{'type':Sequelize[_0x5807('0x18')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x5807('0x18')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x5807('0x19')](_0x5807('0x1a'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0x5807('0x19')](_0x5807('0x1a'),'no',_0x5807('0x1b')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x5807('0x18')](0xb)},'autopausebusy':{'type':Sequelize[_0x5807('0x19')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x5807('0x19')](_0x5807('0x1a'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x5807('0x18')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x5807('0x19')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x5807('0x19')](_0x5807('0x1a'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x5807('0x19')](_0x5807('0x1a'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x5807('0x19')](_0x5807('0x1a'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x5807('0x5')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x5807('0x5')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x5807('0x18')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x5807('0x19')](_0x5807('0x1a'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x5807('0x1a'),'no'),'defaultValue':_0x5807('0x1a')},'announce_holdtime':{'type':Sequelize['ENUM'](_0x5807('0x1a'),'no',_0x5807('0x1c')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x5807('0x5')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x5807('0x1a'),'no')},'announce_position_limit':{'type':Sequelize[_0x5807('0x18')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x5807('0x19')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x5807('0x5')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x5807('0x5')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x5807('0x5')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x5807('0x5')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x5807('0x5')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x5807('0x5')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x5807('0x5')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0x5807('0x5')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x220540){this[_0x5807('0xe')](_0x5807('0x1d'),_0x220540?_0x220540[_0x5807('0x1e')](','):[]);},'get':function(){return this[_0x5807('0x10')](_0x5807('0x1d'))?this[_0x5807('0x10')]('periodic_announce')[_0x5807('0x1f')](','):[];}},'joinempty':{'type':Sequelize[_0x5807('0x5')],'defaultValue':'yes','set':function(_0x50585b){this[_0x5807('0xe')](_0x5807('0x20'),_0x50585b?_0x50585b[_0x5807('0x1e')](','):undefined);},'get':function(){return this[_0x5807('0x10')](_0x5807('0x20'))?this[_0x5807('0x10')]('joinempty')[_0x5807('0x1f')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x5807('0x5')],'defaultValue':'no','set':function(_0x2682ac){this[_0x5807('0xe')]('leavewhenempty',_0x2682ac?_0x2682ac[_0x5807('0x1e')](','):undefined);},'get':function(){return this[_0x5807('0x10')](_0x5807('0x21'))?this[_0x5807('0x10')](_0x5807('0x21'))[_0x5807('0x1f')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x5807('0x1a'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x5807('0x19')](_0x5807('0x1a'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x5807('0x18')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x5807('0x19')](_0x5807('0x1a'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x5807('0x5')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x5807('0x22')],'defaultValue':0x0,'set':function(_0x59f8b3){this['setDataValue'](_0x5807('0x23'),_0x59f8b3);if(_0x59f8b3){if(this[_0x5807('0x10')]('wrapuptime')<0x2){this[_0x5807('0xe')](_0x5807('0x24'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x5807('0x18')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize['ENUM']('preview',_0x5807('0x15'),_0x5807('0x17'),_0x5807('0x16'),_0x5807('0x13')),'defaultValue':_0x5807('0x15'),'comment':_0x5807('0x25')},'dialLimitChannel':{'type':Sequelize[_0x5807('0x18')](0x4)[_0x5807('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x5807('0x27')},'dialLimitQueue':{'type':Sequelize[_0x5807('0x18')](0x4)[_0x5807('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x5807('0x28')](0x2)[_0x5807('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x5807('0x29')},'dialPredictiveOptimization':{'type':Sequelize[_0x5807('0x19')](_0x5807('0x2a'),_0x5807('0x2b')),'defaultValue':_0x5807('0x2b'),'comment':_0x5807('0x2c')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x5807('0x28')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x5807('0x2d')},'dialPredictiveInterval':{'type':Sequelize[_0x5807('0x18')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x5807('0x2e')},'dialOriginateCallerIdName':{'type':Sequelize[_0x5807('0x5')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x5807('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5807('0x2f')},'dialQueueOptions':{'type':Sequelize[_0x5807('0x5')],'defaultValue':_0x5807('0x30'),'comment':_0x5807('0x31')},'dialQueueTimeout':{'type':Sequelize[_0x5807('0x18')](0x3)[_0x5807('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5807('0x32')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0x5807('0x33')},'dialCongestionMaxRetry':{'type':Sequelize[_0x5807('0x18')](0x3)[_0x5807('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5807('0x34')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x5807('0x18')](0x5)[_0x5807('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5807('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5807('0x35')},'dialBusyRetryFrequency':{'type':Sequelize[_0x5807('0x18')](0x5)[_0x5807('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x5807('0x18')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x5807('0x36')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5807('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5807('0x37')},'dialGlobalMaxRetry':{'type':Sequelize[_0x5807('0x18')](0x3)[_0x5807('0x26')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x5807('0x38')},'dialTimezone':{'type':Sequelize[_0x5807('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x5807('0x5')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x5807('0x5')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x5807('0x19')]('always',_0x5807('0x39'),_0x5807('0x3a')),'defaultValue':_0x5807('0x3b')},'dialAMDActive':{'type':Sequelize[_0x5807('0x22')],'defaultValue':0x0,'comment':_0x5807('0x3c')},'dialAMDInitialSilence':{'type':Sequelize[_0x5807('0x18')](0x9)[_0x5807('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x5807('0x3d')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x5807('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x5807('0x3e')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x5807('0x18')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x5807('0x18')](0x9)[_0x5807('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x5807('0x18')](0x9)[_0x5807('0x26')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x5807('0x3f')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x5807('0x18')](0x9)[_0x5807('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x5807('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x5807('0x40')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x5807('0x18')](0x9)[_0x5807('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0x5807('0x18')](0x5)[_0x5807('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x5807('0x41')},'dialRecallInQueue':{'type':Sequelize[_0x5807('0x22')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0x5807('0x42')),'defaultValue':_0x5807('0x43')},'dialQueueProject2':{'type':Sequelize[_0x5807('0x5')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x5807('0x22')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x5807('0x18')](0x3)[_0x5807('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5807('0x44')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x5807('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5807('0x45')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5807('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5807('0x46')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x5807('0x18')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5807('0x47')},'dialDropMaxRetry':{'type':Sequelize[_0x5807('0x18')](0x3)[_0x5807('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5807('0x48')},'dialDropRetryFrequency':{'type':Sequelize[_0x5807('0x18')](0x5)[_0x5807('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5807('0x49')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x5807('0x18')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5807('0x4a')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x5807('0x18')](0x5)[_0x5807('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5807('0x4b')},'dialMachineMaxRetry':{'type':Sequelize[_0x5807('0x18')](0x3)[_0x5807('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5807('0x4c')},'dialMachineRetryFrequency':{'type':Sequelize[_0x5807('0x18')](0x5)[_0x5807('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5807('0x4d')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5807('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5807('0x4e')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x5807('0x18')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5807('0x4f')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5807('0x18')],'allowNull':!![],'comment':_0x5807('0x50')},'mandatoryDisposition':{'type':Sequelize[_0x5807('0x22')],'defaultValue':![],'comment':_0x5807('0x51'),'set':function(_0x1092e8){if(!_0x1092e8)this[_0x5807('0xe')](_0x5807('0x52'),null);this[_0x5807('0xe')](_0x5807('0x53'),_0x1092e8);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x5807('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x5807('0x18')](0x3)[_0x5807('0x26')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0x34aa=['acw','wrapuptime','Active/Disactive\x20Campaign','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','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)','07:00-22:00,*,*,*','never','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\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)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','STRING','name','ENUM','inbound','default','ringall','leastrecent','fewestcalls','random','rrmemory','linear','rrordered','setDataValue','strategy','getDataValue','type','dialMethod','booked','roundrobin','predictive','power','INTEGER','yes','once','join','periodic_announce','split','joinempty','leavewhenempty','BOOLEAN'];(function(_0x565d0a,_0x4927cc){var _0x24c211=function(_0x18ae2b){while(--_0x18ae2b){_0x565d0a['push'](_0x565d0a['shift']());}};_0x24c211(++_0x4927cc);}(_0x34aa,0x171));var _0xa34a=function(_0x3d73ba,_0x356e23){_0x3d73ba=_0x3d73ba-0x0;var _0x47e406=_0x34aa[_0x3d73ba];return _0x47e406;};'use strict';var Sequelize=require(_0xa34a('0x0'));module['exports']={'name':{'type':Sequelize[_0xa34a('0x1')],'allowNull':![],'unique':_0xa34a('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xa34a('0x3')](_0xa34a('0x4'),'outbound'),'allowNull':![],'defaultValue':_0xa34a('0x4')},'musiconhold':{'type':Sequelize[_0xa34a('0x1')],'defaultValue':_0xa34a('0x5')},'announce':{'type':Sequelize[_0xa34a('0x1')],'defaultValue':''},'strategy':{'type':Sequelize[_0xa34a('0x3')]('rr',_0xa34a('0x6'),_0xa34a('0x7'),_0xa34a('0x8'),_0xa34a('0x9'),_0xa34a('0xa'),_0xa34a('0xb'),'wrandom',_0xa34a('0xc')),'allowNull':![],'defaultValue':_0xa34a('0x6'),'set':function(_0x35f231){this[_0xa34a('0xd')](_0xa34a('0xe'),_0x35f231?_0x35f231:'rrmemory');},'get':function(){var _0x864029=this[_0xa34a('0xf')](_0xa34a('0x10'));var _0x275d67=this[_0xa34a('0xf')](_0xa34a('0x11'));var _0x1282e5=this['getDataValue'](_0xa34a('0xe'));if(_0x864029===_0xa34a('0x4')){return _0x1282e5;}if(_0x275d67===_0xa34a('0x12')&&_0x1282e5==='rrmemory'||_0x275d67===_0xa34a('0x12')&&_0x1282e5===_0xa34a('0x13')){return _0x1282e5;}if(_0x275d67==='progressive'||_0x275d67===_0xa34a('0x14')||_0x275d67===_0xa34a('0x15')){return _0x1282e5;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xa34a('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xa34a('0x16')](0xb)},'timeout':{'type':Sequelize[_0xa34a('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xa34a('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xa34a('0x1')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xa34a('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0xa34a('0x17'),'no'),'defaultValue':_0xa34a('0x17')},'autopause':{'type':Sequelize[_0xa34a('0x3')](_0xa34a('0x17'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xa34a('0x16')](0xb)},'autopausebusy':{'type':Sequelize[_0xa34a('0x3')](_0xa34a('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xa34a('0x3')](_0xa34a('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xa34a('0x3')](_0xa34a('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xa34a('0x3')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xa34a('0x3')](_0xa34a('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xa34a('0x3')](_0xa34a('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xa34a('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xa34a('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xa34a('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xa34a('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0xa34a('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xa34a('0x3')](_0xa34a('0x17'),'no'),'defaultValue':_0xa34a('0x17')},'announce_holdtime':{'type':Sequelize[_0xa34a('0x3')](_0xa34a('0x17'),'no',_0xa34a('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xa34a('0x3')](_0xa34a('0x17'),'no')},'announce_position_limit':{'type':Sequelize[_0xa34a('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xa34a('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xa34a('0x1')]},'queue_youarenext':{'type':Sequelize[_0xa34a('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xa34a('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xa34a('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xa34a('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xa34a('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xa34a('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xa34a('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0xa34a('0x1')]},'queue_quantity2':{'type':Sequelize[_0xa34a('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0xa34a('0x1')]},'queue_less_than':{'type':Sequelize[_0xa34a('0x1')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x1034d3){this[_0xa34a('0xd')]('periodic_announce',_0x1034d3?_0x1034d3[_0xa34a('0x19')](','):[]);},'get':function(){return this[_0xa34a('0xf')]('periodic_announce')?this['getDataValue'](_0xa34a('0x1a'))[_0xa34a('0x1b')](','):[];}},'joinempty':{'type':Sequelize[_0xa34a('0x1')],'defaultValue':_0xa34a('0x17'),'set':function(_0xa8890c){this[_0xa34a('0xd')]('joinempty',_0xa8890c?_0xa8890c[_0xa34a('0x19')](','):undefined);},'get':function(){return this[_0xa34a('0xf')]('joinempty')?this[_0xa34a('0xf')](_0xa34a('0x1c'))[_0xa34a('0x1b')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xa34a('0x1')],'defaultValue':'no','set':function(_0x5edbf1){this[_0xa34a('0xd')](_0xa34a('0x1d'),_0x5edbf1?_0x5edbf1[_0xa34a('0x19')](','):undefined);},'get':function(){return this['getDataValue'](_0xa34a('0x1d'))?this[_0xa34a('0xf')](_0xa34a('0x1d'))[_0xa34a('0x1b')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xa34a('0x3')](_0xa34a('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xa34a('0x3')](_0xa34a('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xa34a('0x1')]},'description':{'type':Sequelize[_0xa34a('0x1')]},'acw':{'type':Sequelize[_0xa34a('0x1e')],'defaultValue':0x0,'set':function(_0xc74618){this['setDataValue'](_0xa34a('0x1f'),_0xc74618);if(_0xc74618){if(this[_0xa34a('0xf')](_0xa34a('0x20'))<0x2){this[_0xa34a('0xd')](_0xa34a('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xa34a('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xa34a('0x21')},'dialMethod':{'type':Sequelize[_0xa34a('0x3')]('preview',_0xa34a('0x22'),'power',_0xa34a('0x14'),_0xa34a('0x12')),'defaultValue':_0xa34a('0x22'),'comment':_0xa34a('0x23')},'dialLimitChannel':{'type':Sequelize[_0xa34a('0x16')](0x4)[_0xa34a('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xa34a('0x25')},'dialLimitQueue':{'type':Sequelize[_0xa34a('0x16')](0x4)[_0xa34a('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0xa34a('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xa34a('0x26')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0xa34a('0x27'),_0xa34a('0x28')),'defaultValue':_0xa34a('0x28'),'comment':_0xa34a('0x29')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0xa34a('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xa34a('0x2a')},'dialPredictiveInterval':{'type':Sequelize[_0xa34a('0x16')](0x3)[_0xa34a('0x24')],'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[_0xa34a('0x16')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa34a('0x2b')},'dialQueueOptions':{'type':Sequelize[_0xa34a('0x1')],'defaultValue':_0xa34a('0x2c'),'comment':_0xa34a('0x2d')},'dialQueueTimeout':{'type':Sequelize[_0xa34a('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa34a('0x2e')},'dialQueueProject':{'type':Sequelize[_0xa34a('0x1')],'comment':_0xa34a('0x2f')},'dialCongestionMaxRetry':{'type':Sequelize[_0xa34a('0x16')](0x3)[_0xa34a('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa34a('0x30')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa34a('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa34a('0x31')},'dialBusyMaxRetry':{'type':Sequelize[_0xa34a('0x16')](0x3)[_0xa34a('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa34a('0x32')},'dialBusyRetryFrequency':{'type':Sequelize[_0xa34a('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa34a('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa34a('0x24')],'defaultValue':0x3,'comment':_0xa34a('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xa34a('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa34a('0x35')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa34a('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xa34a('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xa34a('0x1')],'defaultValue':_0xa34a('0x36')},'dialPrefix':{'type':Sequelize[_0xa34a('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xa34a('0x3')]('always',_0xa34a('0x37'),'onlyIfOpen'),'defaultValue':_0xa34a('0x38')},'dialAMDActive':{'type':Sequelize[_0xa34a('0x1e')],'defaultValue':0x0,'comment':_0xa34a('0x39')},'dialAMDInitialSilence':{'type':Sequelize[_0xa34a('0x16')](0x9)[_0xa34a('0x24')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xa34a('0x3a')},'dialAMDGreeting':{'type':Sequelize[_0xa34a('0x16')](0x9)[_0xa34a('0x24')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xa34a('0x16')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xa34a('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xa34a('0x16')](0x9)[_0xa34a('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xa34a('0x16')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xa34a('0x3b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xa34a('0x16')](0x9)[_0xa34a('0x24')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xa34a('0x3c')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xa34a('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xa34a('0x16')](0x9)[_0xa34a('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa34a('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0xa34a('0x16')](0x5)[_0xa34a('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xa34a('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0xa34a('0x1e')],'defaultValue':0x0,'comment':_0xa34a('0x40')},'dialOrderByScheduledAt':{'type':Sequelize[_0xa34a('0x3')]('DESC',_0xa34a('0x41')),'defaultValue':_0xa34a('0x42')},'dialQueueProject2':{'type':Sequelize[_0xa34a('0x1')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0xa34a('0x1e')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xa34a('0x1e')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa34a('0x43')},'dialCutDigit':{'type':Sequelize[_0xa34a('0x16')](0x3)[_0xa34a('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa34a('0x44')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xa34a('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa34a('0x45')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xa34a('0x16')](0x5)[_0xa34a('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa34a('0x46')},'dialDropMaxRetry':{'type':Sequelize[_0xa34a('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa34a('0x47')},'dialDropRetryFrequency':{'type':Sequelize[_0xa34a('0x16')](0x5)[_0xa34a('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa34a('0x48')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xa34a('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa34a('0x49')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa34a('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa34a('0x4a')},'dialMachineMaxRetry':{'type':Sequelize[_0xa34a('0x16')](0x3)[_0xa34a('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa34a('0x4b')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa34a('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xa34a('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa34a('0x4c')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xa34a('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa34a('0x4d')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa34a('0x16')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xa34a('0x1e')],'defaultValue':![],'comment':_0xa34a('0x4e'),'set':function(_0x490708){if(!_0x490708)this['setDataValue'](_0xa34a('0x4f'),null);this['setDataValue']('mandatoryDisposition',_0x490708);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xa34a('0x16')](0x3)[_0xa34a('0x24')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xa34a('0x16')](0x3)[_0xa34a('0x24')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 9d9c9aa..5db67a3 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 _0xa3dc=['pick','filter','map','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','create','user','inbound','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt','body','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CmHopper','order','getHopperHistories','findOne','VoiceQueueId','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','addTeams','Team','User','online','interface','Agents','forEach','penalty','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','voicePause','emit','userVoiceQueue:save','ids','tq.TeamId','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','sequelize','toString','TeamId','all','compact','transaction','removeTeams','isEmpty','userVoiceQueue:remove','addAgents','spread','push','removeAgents','getAgents','getMembers','CmList','getLists','addLists','omit','dialCheckDuplicateType','always','insert','cm_hopper','phone','scheduledAt','ListId','select','field','NOW()','ContactId','CmListId','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','into','fromQuery','cm_contacts','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','redis','defaults','socket.io-emitter','./voiceQueue.socket','register','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','VoiceQueues','QueueCampaigns','outbound','ignore','value','includes','type','find','name','UserProfileResource','error','VoiceQueue','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where'];(function(_0x4cc97a,_0x3665fc){var _0x941ddd=function(_0x454b9b){while(--_0x454b9b){_0x4cc97a['push'](_0x4cc97a['shift']());}};_0x941ddd(++_0x3665fc);}(_0xa3dc,0x128));var _0xca3d=function(_0x31888b,_0x13aa56){_0x31888b=_0x31888b-0x0;var _0x3051fd=_0xa3dc[_0x31888b];return _0x3051fd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xca3d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xca3d('0x1'));var rp=require(_0xca3d('0x2'));var moment=require(_0xca3d('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xca3d('0x4'));var path=require(_0xca3d('0x5'));var sox=require(_0xca3d('0x6'));var csv=require('to-csv');var ejs=require(_0xca3d('0x7'));var fs=require('fs');var fs_extra=require(_0xca3d('0x8'));var _=require(_0xca3d('0x9'));var squel=require(_0xca3d('0xa'));var crypto=require(_0xca3d('0xb'));var jsforce=require(_0xca3d('0xc'));var deskjs=require(_0xca3d('0xd'));var toCsv=require(_0xca3d('0xe'));var querystring=require(_0xca3d('0xf'));var Papa=require(_0xca3d('0x10'));var Redis=require(_0xca3d('0x11'));var authService=require(_0xca3d('0x12'));var qs=require(_0xca3d('0x13'));var as=require(_0xca3d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xca3d('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xca3d('0x16'));var db=require('../../mysqldb')['db'];config[_0xca3d('0x17')]=_[_0xca3d('0x18')](config[_0xca3d('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xca3d('0x19'))(new Redis(config['redis']));require(_0xca3d('0x1a'))[_0xca3d('0x1b')](socket);function respondWithStatusCode(_0x6be114,_0x5b5ee3){_0x5b5ee3=_0x5b5ee3||0xcc;return function(_0x19178c){if(_0x19178c){return _0x6be114[_0xca3d('0x1c')](_0x5b5ee3);}return _0x6be114['status'](_0x5b5ee3)[_0xca3d('0x1d')]();};}function respondWithResult(_0x36ffdf,_0x3b3ca5){_0x3b3ca5=_0x3b3ca5||0xc8;return function(_0x53c74c){if(_0x53c74c){return _0x36ffdf[_0xca3d('0x1e')](_0x3b3ca5)[_0xca3d('0x1f')](_0x53c74c);}};}function respondWithFilteredResult(_0x292f36,_0x46d91c){return function(_0x2bd39c){if(_0x2bd39c){var _0x5a4cbd=typeof _0x46d91c[_0xca3d('0x20')]==='undefined'&&typeof _0x46d91c[_0xca3d('0x21')]===_0xca3d('0x22');var _0x596e39=_0x2bd39c[_0xca3d('0x23')];var _0x1af110=_0x5a4cbd?0x0:_0x46d91c['offset'];var _0x3d69d4=_0x5a4cbd?_0x2bd39c[_0xca3d('0x23')]:_0x46d91c['offset']+_0x46d91c['limit'];var _0x11ba88;if(_0x3d69d4>=_0x596e39){_0x3d69d4=_0x596e39;_0x11ba88=0xc8;}else{_0x11ba88=0xce;}_0x292f36['status'](_0x11ba88);return _0x292f36[_0xca3d('0x24')](_0xca3d('0x25'),_0x1af110+'-'+_0x3d69d4+'/'+_0x596e39)[_0xca3d('0x1f')](_0x2bd39c);}return null;};}function patchUpdates(_0x20b85a){return function(_0x5d3ba6){try{jsonpatch[_0xca3d('0x26')](_0x5d3ba6,_0x20b85a,!![]);}catch(_0x2e6ab4){return BPromise[_0xca3d('0x27')](_0x2e6ab4);}return _0x5d3ba6[_0xca3d('0x28')]();};}function saveUpdates(_0x2bf9e7,_0x337e78){return function(_0x1670a9){if(_0x1670a9){return _0x1670a9[_0xca3d('0x29')](_0x2bf9e7)[_0xca3d('0x2a')](function(_0x57f76d){return _0x57f76d;});}return null;};}function removeEntity(_0x5a2567,_0x10110c){return function(_0x4c57e9){if(_0x4c57e9){return _0x4c57e9[_0xca3d('0x2b')]()[_0xca3d('0x2a')](function(){var _0x4d265b=_0x4c57e9[_0xca3d('0x2c')]({'plain':!![]});var _0x18e1bc=[{'name':_0xca3d('0x2d'),'value':'inbound','ignore':![]},{'name':_0xca3d('0x2e'),'value':_0xca3d('0x2f'),'ignore':![]}];var _0x3c77c5=_(_0x18e1bc)['filter'](_0xca3d('0x30'))['map'](_0xca3d('0x31'))[_0xca3d('0x31')]();if(_[_0xca3d('0x32')](_0x3c77c5,_0x4d265b[_0xca3d('0x33')])){return;}var _0x556002=_[_0xca3d('0x34')](_0x18e1bc,[_0xca3d('0x31'),_0x4d265b['type']])[_0xca3d('0x35')];return db[_0xca3d('0x36')][_0xca3d('0x2b')]({'where':{'type':_0x556002,'resourceId':_0x4d265b['id']}})[_0xca3d('0x2a')](function(){return _0x4c57e9;});})[_0xca3d('0x2a')](function(){_0x5a2567[_0xca3d('0x1e')](0xcc)[_0xca3d('0x1d')]();});}};}function handleEntityNotFound(_0x2ff1f0,_0x18523f){return function(_0x815d60){if(!_0x815d60){_0x2ff1f0[_0xca3d('0x1c')](0x194);}return _0x815d60;};}function handleError(_0x34140b,_0x145f82){_0x145f82=_0x145f82||0x1f4;return function(_0x98df16){logger[_0xca3d('0x37')](_0x98df16['stack']);if(_0x98df16[_0xca3d('0x35')]){delete _0x98df16[_0xca3d('0x35')];}_0x34140b['status'](_0x145f82)['send'](_0x98df16);};}exports['index']=function(_0x3774ad,_0x55ce6c){var _0x3e40b1={},_0xcf5ef8={},_0x29db71={'count':0x0,'rows':[]};var _0xe1aea2=_['map'](db[_0xca3d('0x38')]['rawAttributes'],function(_0x575c2e){return{'name':_0x575c2e[_0xca3d('0x39')],'type':_0x575c2e[_0xca3d('0x33')][_0xca3d('0x3a')]};});_0xcf5ef8[_0xca3d('0x3b')]=_['map'](_0xe1aea2,'name');_0xcf5ef8[_0xca3d('0x3c')]=_['keys'](_0x3774ad['query']);_0xcf5ef8[_0xca3d('0x3d')]=_[_0xca3d('0x3e')](_0xcf5ef8[_0xca3d('0x3b')],_0xcf5ef8['query']);_0x3e40b1[_0xca3d('0x3f')]=_[_0xca3d('0x3e')](_0xcf5ef8['model'],qs[_0xca3d('0x40')](_0x3774ad[_0xca3d('0x3c')][_0xca3d('0x40')]));_0x3e40b1[_0xca3d('0x3f')]=_0x3e40b1['attributes'][_0xca3d('0x41')]?_0x3e40b1[_0xca3d('0x3f')]:_0xcf5ef8[_0xca3d('0x3b')];if(!_0x3774ad[_0xca3d('0x3c')][_0xca3d('0x42')](_0xca3d('0x43'))){_0x3e40b1[_0xca3d('0x21')]=qs[_0xca3d('0x21')](_0x3774ad['query']['limit']);_0x3e40b1[_0xca3d('0x20')]=qs['offset'](_0x3774ad[_0xca3d('0x3c')][_0xca3d('0x20')]);}_0x3e40b1['order']=qs[_0xca3d('0x44')](_0x3774ad['query'][_0xca3d('0x44')]);_0x3e40b1[_0xca3d('0x45')]=qs[_0xca3d('0x3d')](_[_0xca3d('0x46')](_0x3774ad[_0xca3d('0x3c')],_0xcf5ef8[_0xca3d('0x3d')]),_0xe1aea2);if(_0x3774ad['query'][_0xca3d('0x47')]){_0x3e40b1[_0xca3d('0x45')]=_['merge'](_0x3e40b1[_0xca3d('0x45')],{'$or':_[_0xca3d('0x48')](_0xe1aea2,function(_0x3c53d9){if(_0x3c53d9[_0xca3d('0x33')]!=='VIRTUAL'){var _0x4362b4={};_0x4362b4[_0x3c53d9[_0xca3d('0x35')]]={'$like':'%'+_0x3774ad[_0xca3d('0x3c')][_0xca3d('0x47')]+'%'};return _0x4362b4;}})});}_0x3e40b1=_[_0xca3d('0x49')]({},_0x3e40b1,_0x3774ad[_0xca3d('0x4a')]);var _0x43f2c3={'where':_0x3e40b1[_0xca3d('0x45')]};return db[_0xca3d('0x38')][_0xca3d('0x23')](_0x43f2c3)['then'](function(_0x4b633f){_0x29db71[_0xca3d('0x23')]=_0x4b633f;if(_0x3774ad[_0xca3d('0x3c')][_0xca3d('0x4b')]){_0x3e40b1[_0xca3d('0x4c')]=[{'all':!![]}];}return db[_0xca3d('0x38')][_0xca3d('0x4d')](_0x3e40b1);})[_0xca3d('0x2a')](function(_0x409f11){_0x29db71[_0xca3d('0x4e')]=_0x409f11;return _0x29db71;})[_0xca3d('0x2a')](respondWithFilteredResult(_0x55ce6c,_0x3e40b1))[_0xca3d('0x4f')](handleError(_0x55ce6c,null));};exports[_0xca3d('0x50')]=function(_0x118cfa,_0x5d087d){var _0x363095={'raw':![],'where':{'id':_0x118cfa[_0xca3d('0x51')]['id']}},_0x33993a={};_0x33993a['model']=_[_0xca3d('0x52')](db[_0xca3d('0x38')][_0xca3d('0x53')]);_0x33993a[_0xca3d('0x3c')]=_['keys'](_0x118cfa[_0xca3d('0x3c')]);_0x33993a[_0xca3d('0x3d')]=_[_0xca3d('0x3e')](_0x33993a['model'],_0x33993a['query']);_0x363095[_0xca3d('0x3f')]=_[_0xca3d('0x3e')](_0x33993a[_0xca3d('0x3b')],qs[_0xca3d('0x40')](_0x118cfa['query'][_0xca3d('0x40')]));_0x363095[_0xca3d('0x3f')]=_0x363095[_0xca3d('0x3f')][_0xca3d('0x41')]?_0x363095[_0xca3d('0x3f')]:_0x33993a[_0xca3d('0x3b')];if(_0x118cfa['query'][_0xca3d('0x4b')]){_0x363095[_0xca3d('0x4c')]=[{'all':!![]}];}_0x363095=_['merge']({},_0x363095,_0x118cfa['options']);return db[_0xca3d('0x38')]['find'](_0x363095)[_0xca3d('0x2a')](handleEntityNotFound(_0x5d087d,null))['then'](respondWithResult(_0x5d087d,null))[_0xca3d('0x4f')](handleError(_0x5d087d,null));};exports['create']=function(_0x4f86fb,_0x5229c7){return db[_0xca3d('0x38')][_0xca3d('0x54')](_0x4f86fb['body'],{})[_0xca3d('0x2a')](function(_0x37f117){var _0x4bfa63=_0x4f86fb[_0xca3d('0x55')][_0xca3d('0x2c')]({'plain':!![]});if(!_0x4bfa63)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4bfa63['role']===_0xca3d('0x55')){var _0x1ce689=_0x37f117['get']({'plain':!![]});var _0xe2b448=[{'name':_0xca3d('0x2d'),'value':_0xca3d('0x56')},{'name':'QueueCampaigns','value':_0xca3d('0x2f')}];var _0x3f4848=_[_0xca3d('0x34')](_0xe2b448,[_0xca3d('0x31'),_0x1ce689[_0xca3d('0x33')]])[_0xca3d('0x35')];return db[_0xca3d('0x57')][_0xca3d('0x34')]({'where':{'name':_0x3f4848,'userProfileId':_0x4bfa63[_0xca3d('0x58')]},'raw':!![]})['then'](function(_0x10bb5c){if(_0x10bb5c&&_0x10bb5c[_0xca3d('0x59')]===0x0){return db[_0xca3d('0x36')][_0xca3d('0x54')]({'name':_0x1ce689[_0xca3d('0x35')],'resourceId':_0x1ce689['id'],'type':_0x10bb5c[_0xca3d('0x35')],'sectionId':_0x10bb5c['id']},{})[_0xca3d('0x2a')](function(){return _0x37f117;});}else{return _0x37f117;}})[_0xca3d('0x4f')](function(_0x21e900){logger['error'](_0xca3d('0x5a'),_0x21e900);throw _0x21e900;});}return _0x37f117;})['then'](respondWithResult(_0x5229c7,0xc9))[_0xca3d('0x4f')](handleError(_0x5229c7,null));};exports['clone']=function(_0x2aaecd,_0x31519b){var _0x2ee0a8={'where':{'id':_0x2aaecd['params']['id']}},_0x3b25f2={};_0x3b25f2[_0xca3d('0x3b')]=_[_0xca3d('0x52')](db[_0xca3d('0x38')][_0xca3d('0x53')]);_0x2ee0a8[_0xca3d('0x3f')]=_[_0xca3d('0x3e')](_0x3b25f2[_0xca3d('0x3b')],qs[_0xca3d('0x40')](_0x2aaecd['query'][_0xca3d('0x40')]));_0x2ee0a8[_0xca3d('0x3f')]=_0x2ee0a8['attributes'][_0xca3d('0x41')]?_0x2ee0a8[_0xca3d('0x3f')]:_0x3b25f2[_0xca3d('0x3b')];if(_0x2aaecd['query'][_0xca3d('0x4b')]){_0x2ee0a8[_0xca3d('0x4c')]=[{'all':!![]}];}_0x2ee0a8=_['merge']({},_0x2ee0a8,_0x2aaecd[_0xca3d('0x4a')]);return db['VoiceQueue'][_0xca3d('0x34')](_0x2ee0a8)[_0xca3d('0x2a')](handleEntityNotFound(_0x31519b,null))[_0xca3d('0x2a')](function(_0xd8004b){if(_0xd8004b){var _0x1b19d4=_0xd8004b[_0xca3d('0x2c')]({'plain':!![]});_0x1b19d4=qs['omit'](_0x1b19d4,['id',_0xca3d('0x5b'),'updatedAt']);_0x2aaecd[_0xca3d('0x5c')]=_['omit'](_0x2aaecd['body'],['id',_0xca3d('0x5b'),_0xca3d('0x5d')]);return db[_0xca3d('0x38')][_0xca3d('0x54')](_[_0xca3d('0x49')](_0x1b19d4,_0x2aaecd[_0xca3d('0x5c')]),{'include':_0x2aaecd[_0xca3d('0x3c')][_0xca3d('0x4b')]?[{'all':!![]}]:undefined})[_0xca3d('0x2a')](function(_0x49a83c){var _0x466e94=_0x2aaecd[_0xca3d('0x55')][_0xca3d('0x2c')]({'plain':!![]});if(!_0x466e94)throw new Error(_0xca3d('0x5e'));if(_0x466e94[_0xca3d('0x5f')]==='user'){var _0x2d8d95=_0x49a83c['get']({'plain':!![]});var _0x182c29=[{'name':_0xca3d('0x2d'),'value':'inbound'},{'name':_0xca3d('0x2e'),'value':_0xca3d('0x2f')}];var _0x56d262=_[_0xca3d('0x34')](_0x182c29,['value',_0x2d8d95['type']])[_0xca3d('0x35')];return db[_0xca3d('0x57')][_0xca3d('0x34')]({'where':{'name':_0x56d262,'userProfileId':_0x466e94[_0xca3d('0x58')]},'raw':!![]})['then'](function(_0x183eec){if(_0x183eec&&_0x183eec['autoAssociation']===0x0){return db[_0xca3d('0x36')][_0xca3d('0x54')]({'name':_0x2d8d95['name'],'resourceId':_0x2d8d95['id'],'type':_0x183eec[_0xca3d('0x35')],'sectionId':_0x183eec['id']},{})[_0xca3d('0x2a')](function(){return _0x49a83c;});}else{return _0x49a83c;}})[_0xca3d('0x4f')](function(_0x80ccdf){logger[_0xca3d('0x37')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x80ccdf);throw _0x80ccdf;});}return _0x49a83c;});}})[_0xca3d('0x2a')](respondWithResult(_0x31519b,0xc9))['catch'](handleError(_0x31519b,null));};exports['update']=function(_0x373ad9,_0x3c2803){if(_0x373ad9[_0xca3d('0x5c')]['id']){delete _0x373ad9[_0xca3d('0x5c')]['id'];}return db[_0xca3d('0x38')]['find']({'where':{'id':_0x373ad9['params']['id']}})[_0xca3d('0x2a')](handleEntityNotFound(_0x3c2803,null))['then'](saveUpdates(_0x373ad9['body'],null))[_0xca3d('0x2a')](respondWithResult(_0x3c2803,null))[_0xca3d('0x4f')](handleError(_0x3c2803,null));};exports[_0xca3d('0x2b')]=function(_0xe23a3d,_0x3dc5d3){return db[_0xca3d('0x38')][_0xca3d('0x34')]({'where':{'id':_0xe23a3d[_0xca3d('0x51')]['id']}})[_0xca3d('0x2a')](handleEntityNotFound(_0x3dc5d3,null))[_0xca3d('0x2a')](removeEntity(_0x3dc5d3,null))['catch'](handleError(_0x3dc5d3,null));};exports['getHoppers']=function(_0x2a454e,_0x2f34bb,_0x3d1560){var _0x188a36={'raw':![],'where':{}};var _0x1e92b7={};var _0x35370c={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x2a454e[_0xca3d('0x51')]['id']}})[_0xca3d('0x2a')](handleEntityNotFound(_0x2f34bb,null))[_0xca3d('0x2a')](function(_0x786c17){if(_0x786c17){_0x1e92b7[_0xca3d('0x3b')]=_['keys'](db[_0xca3d('0x60')][_0xca3d('0x53')]);_0x1e92b7[_0xca3d('0x3c')]=_[_0xca3d('0x52')](_0x2a454e[_0xca3d('0x3c')]);_0x1e92b7[_0xca3d('0x3d')]=_[_0xca3d('0x3e')](_0x1e92b7['model'],_0x1e92b7[_0xca3d('0x3c')]);_0x188a36['attributes']=_[_0xca3d('0x3e')](_0x1e92b7[_0xca3d('0x3b')],qs['fields'](_0x2a454e['query'][_0xca3d('0x40')]));_0x188a36[_0xca3d('0x3f')]=_0x188a36[_0xca3d('0x3f')][_0xca3d('0x41')]?_0x188a36[_0xca3d('0x3f')]:_0x1e92b7[_0xca3d('0x3b')];if(!_0x2a454e[_0xca3d('0x3c')]['hasOwnProperty']('nolimit')){_0x188a36[_0xca3d('0x21')]=qs[_0xca3d('0x21')](_0x2a454e[_0xca3d('0x3c')][_0xca3d('0x21')]);_0x188a36[_0xca3d('0x20')]=qs['offset'](_0x2a454e[_0xca3d('0x3c')][_0xca3d('0x20')]);}_0x188a36[_0xca3d('0x61')]=qs['sort'](_0x2a454e['query']['sort']);_0x188a36[_0xca3d('0x45')]=qs[_0xca3d('0x3d')](_[_0xca3d('0x46')](_0x2a454e['query'],_0x1e92b7[_0xca3d('0x3d')]));_0x188a36[_0xca3d('0x45')]['VoiceQueueId']=_0x786c17['id'];if(_0x2a454e['query'][_0xca3d('0x47')]){_0x188a36[_0xca3d('0x45')]=_[_0xca3d('0x49')](_0x188a36[_0xca3d('0x45')],{'$or':_[_0xca3d('0x48')](_0x188a36[_0xca3d('0x3f')],function(_0x48dcb5){var _0x2c9747={};_0x2c9747[_0x48dcb5]={'$like':'%'+_0x2a454e['query'][_0xca3d('0x47')]+'%'};return _0x2c9747;})});}_0x188a36=_['merge']({},_0x188a36,_0x2a454e['options']);return db[_0xca3d('0x60')][_0xca3d('0x23')]({'where':_0x188a36['where']})[_0xca3d('0x2a')](function(_0x30f24d){_0x35370c[_0xca3d('0x23')]=_0x30f24d;if(_0x2a454e[_0xca3d('0x3c')]['includeAll']){_0x188a36['include']=[{'all':!![]}];}return db[_0xca3d('0x60')][_0xca3d('0x4d')](_0x188a36);})[_0xca3d('0x2a')](function(_0x45f3cc){_0x35370c[_0xca3d('0x4e')]=_0x45f3cc;return _0x35370c;});}})[_0xca3d('0x2a')](respondWithFilteredResult(_0x2f34bb,_0x188a36))[_0xca3d('0x4f')](handleError(_0x2f34bb,null));};exports[_0xca3d('0x62')]=function(_0x848f7d,_0x140467,_0x2e1996){var _0x1554fd={'raw':!![],'where':{}};var _0x26c7e0={};var _0x4a8efb={'count':0x0,'rows':[]};return db[_0xca3d('0x38')][_0xca3d('0x63')]({'where':{'id':_0x848f7d['params']['id']}})[_0xca3d('0x2a')](handleEntityNotFound(_0x140467,null))['then'](function(_0x27be70){if(_0x27be70){_0x26c7e0[_0xca3d('0x3b')]=_[_0xca3d('0x52')](db['CmHopperHistory'][_0xca3d('0x53')]);_0x26c7e0[_0xca3d('0x3c')]=_['keys'](_0x848f7d[_0xca3d('0x3c')]);_0x26c7e0[_0xca3d('0x3d')]=_['intersection'](_0x26c7e0['model'],_0x26c7e0[_0xca3d('0x3c')]);_0x1554fd['attributes']=_['intersection'](_0x26c7e0[_0xca3d('0x3b')],qs[_0xca3d('0x40')](_0x848f7d[_0xca3d('0x3c')][_0xca3d('0x40')]));_0x1554fd['attributes']=_0x1554fd[_0xca3d('0x3f')][_0xca3d('0x41')]?_0x1554fd[_0xca3d('0x3f')]:_0x26c7e0['model'];if(!_0x848f7d[_0xca3d('0x3c')][_0xca3d('0x42')](_0xca3d('0x43'))){_0x1554fd[_0xca3d('0x21')]=qs['limit'](_0x848f7d[_0xca3d('0x3c')][_0xca3d('0x21')]);_0x1554fd[_0xca3d('0x20')]=qs[_0xca3d('0x20')](_0x848f7d['query'][_0xca3d('0x20')]);}_0x1554fd[_0xca3d('0x61')]=qs[_0xca3d('0x44')](_0x848f7d[_0xca3d('0x3c')][_0xca3d('0x44')]);_0x1554fd[_0xca3d('0x45')]=qs[_0xca3d('0x3d')](_[_0xca3d('0x46')](_0x848f7d['query'],_0x26c7e0[_0xca3d('0x3d')]));_0x1554fd[_0xca3d('0x45')][_0xca3d('0x64')]=_0x27be70['id'];if(_0x848f7d['query'][_0xca3d('0x47')]){_0x1554fd[_0xca3d('0x45')]=_[_0xca3d('0x49')](_0x1554fd[_0xca3d('0x45')],{'$or':_[_0xca3d('0x48')](_0x1554fd['attributes'],function(_0x1ee69e){var _0x589f50={};_0x589f50[_0x1ee69e]={'$like':'%'+_0x848f7d[_0xca3d('0x3c')][_0xca3d('0x47')]+'%'};return _0x589f50;})});}_0x1554fd=_[_0xca3d('0x49')]({},_0x1554fd,_0x848f7d['options']);return db[_0xca3d('0x65')][_0xca3d('0x23')]({'where':_0x1554fd[_0xca3d('0x45')]})[_0xca3d('0x2a')](function(_0x20242b){_0x4a8efb[_0xca3d('0x23')]=_0x20242b;if(_0x848f7d['query'][_0xca3d('0x4b')]){_0x1554fd[_0xca3d('0x4c')]=[{'all':!![]}];}return db[_0xca3d('0x65')][_0xca3d('0x4d')](_0x1554fd);})[_0xca3d('0x2a')](function(_0x1a814e){_0x4a8efb['rows']=_0x1a814e;return _0x4a8efb;});}})[_0xca3d('0x2a')](respondWithFilteredResult(_0x140467,_0x1554fd))[_0xca3d('0x4f')](handleError(_0x140467,null));};exports[_0xca3d('0x66')]=function(_0x448374,_0x463bdc,_0x338e0f){var _0x392ee3={'raw':!![],'where':{}};var _0x2fe33e={};var _0x2d772b={'count':0x0,'rows':[]};return db[_0xca3d('0x38')][_0xca3d('0x63')]({'where':{'id':_0x448374[_0xca3d('0x51')]['id']}})[_0xca3d('0x2a')](handleEntityNotFound(_0x463bdc,null))[_0xca3d('0x2a')](function(_0x2a82e2){if(_0x2a82e2){_0x2fe33e[_0xca3d('0x3b')]=_[_0xca3d('0x52')](db[_0xca3d('0x67')]['rawAttributes']);_0x2fe33e[_0xca3d('0x3c')]=_['keys'](_0x448374[_0xca3d('0x3c')]);_0x2fe33e[_0xca3d('0x3d')]=_[_0xca3d('0x3e')](_0x2fe33e[_0xca3d('0x3b')],_0x2fe33e[_0xca3d('0x3c')]);_0x392ee3['attributes']=_[_0xca3d('0x3e')](_0x2fe33e['model'],qs[_0xca3d('0x40')](_0x448374[_0xca3d('0x3c')]['fields']));_0x392ee3[_0xca3d('0x3f')]=_0x392ee3[_0xca3d('0x3f')][_0xca3d('0x41')]?_0x392ee3[_0xca3d('0x3f')]:_0x2fe33e[_0xca3d('0x3b')];if(!_0x448374[_0xca3d('0x3c')]['hasOwnProperty'](_0xca3d('0x43'))){_0x392ee3[_0xca3d('0x21')]=qs['limit'](_0x448374[_0xca3d('0x3c')][_0xca3d('0x21')]);_0x392ee3[_0xca3d('0x20')]=qs[_0xca3d('0x20')](_0x448374[_0xca3d('0x3c')][_0xca3d('0x20')]);}_0x392ee3[_0xca3d('0x61')]=qs[_0xca3d('0x44')](_0x448374[_0xca3d('0x3c')]['sort']);_0x392ee3['where']=qs[_0xca3d('0x3d')](_[_0xca3d('0x46')](_0x448374[_0xca3d('0x3c')],_0x2fe33e['filters']));_0x392ee3[_0xca3d('0x45')][_0xca3d('0x64')]=_0x2a82e2['id'];if(_0x448374['query'][_0xca3d('0x47')]){_0x392ee3['where']=_[_0xca3d('0x49')](_0x392ee3['where'],{'$or':_[_0xca3d('0x48')](_0x392ee3['attributes'],function(_0x4e8a08){var _0xaf271f={};_0xaf271f[_0x4e8a08]={'$like':'%'+_0x448374['query'][_0xca3d('0x47')]+'%'};return _0xaf271f;})});}_0x392ee3=_['merge']({},_0x392ee3,_0x448374['options']);return db[_0xca3d('0x67')][_0xca3d('0x23')]({'where':_0x392ee3[_0xca3d('0x45')]})[_0xca3d('0x2a')](function(_0x5be383){_0x2d772b[_0xca3d('0x23')]=_0x5be383;if(_0x448374[_0xca3d('0x3c')][_0xca3d('0x4b')]){_0x392ee3['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0xca3d('0x4d')](_0x392ee3);})['then'](function(_0x42357b){_0x2d772b[_0xca3d('0x4e')]=_0x42357b;return _0x2d772b;});}})['then'](respondWithFilteredResult(_0x463bdc,_0x392ee3))[_0xca3d('0x4f')](handleError(_0x463bdc,null));};exports[_0xca3d('0x68')]=function(_0x438343,_0x9b07c3,_0x50bf72){var _0x3a85ac={'raw':!![],'where':{}};var _0x5ca2b3={};var _0x273359={'count':0x0,'rows':[]};return db[_0xca3d('0x38')]['findOne']({'where':{'id':_0x438343[_0xca3d('0x51')]['id']}})[_0xca3d('0x2a')](handleEntityNotFound(_0x9b07c3,null))['then'](function(_0x7babae){if(_0x7babae){_0x5ca2b3['model']=_['keys'](db['CmHopperBlack'][_0xca3d('0x53')]);_0x5ca2b3[_0xca3d('0x3c')]=_[_0xca3d('0x52')](_0x438343['query']);_0x5ca2b3[_0xca3d('0x3d')]=_[_0xca3d('0x3e')](_0x5ca2b3[_0xca3d('0x3b')],_0x5ca2b3[_0xca3d('0x3c')]);_0x3a85ac[_0xca3d('0x3f')]=_[_0xca3d('0x3e')](_0x5ca2b3[_0xca3d('0x3b')],qs[_0xca3d('0x40')](_0x438343[_0xca3d('0x3c')][_0xca3d('0x40')]));_0x3a85ac[_0xca3d('0x3f')]=_0x3a85ac['attributes'][_0xca3d('0x41')]?_0x3a85ac['attributes']:_0x5ca2b3[_0xca3d('0x3b')];if(!_0x438343['query']['hasOwnProperty'](_0xca3d('0x43'))){_0x3a85ac['limit']=qs[_0xca3d('0x21')](_0x438343['query'][_0xca3d('0x21')]);_0x3a85ac[_0xca3d('0x20')]=qs[_0xca3d('0x20')](_0x438343[_0xca3d('0x3c')][_0xca3d('0x20')]);}_0x3a85ac[_0xca3d('0x61')]=qs[_0xca3d('0x44')](_0x438343[_0xca3d('0x3c')]['sort']);_0x3a85ac[_0xca3d('0x45')]=qs[_0xca3d('0x3d')](_[_0xca3d('0x46')](_0x438343['query'],_0x5ca2b3[_0xca3d('0x3d')]));_0x3a85ac[_0xca3d('0x45')][_0xca3d('0x64')]=_0x7babae['id'];if(_0x438343[_0xca3d('0x3c')]['filter']){_0x3a85ac['where']=_[_0xca3d('0x49')](_0x3a85ac[_0xca3d('0x45')],{'$or':_[_0xca3d('0x48')](_0x3a85ac[_0xca3d('0x3f')],function(_0x126f0e){var _0x11a8f2={};_0x11a8f2[_0x126f0e]={'$like':'%'+_0x438343[_0xca3d('0x3c')][_0xca3d('0x47')]+'%'};return _0x11a8f2;})});}_0x3a85ac=_[_0xca3d('0x49')]({},_0x3a85ac,_0x438343['options']);return db[_0xca3d('0x69')][_0xca3d('0x23')]({'where':_0x3a85ac[_0xca3d('0x45')]})[_0xca3d('0x2a')](function(_0x5718fa){_0x273359[_0xca3d('0x23')]=_0x5718fa;if(_0x438343[_0xca3d('0x3c')][_0xca3d('0x4b')]){_0x3a85ac[_0xca3d('0x4c')]=[{'all':!![]}];}return db[_0xca3d('0x69')][_0xca3d('0x4d')](_0x3a85ac);})[_0xca3d('0x2a')](function(_0x3c9f65){_0x273359['rows']=_0x3c9f65;return _0x273359;});}})[_0xca3d('0x2a')](respondWithFilteredResult(_0x9b07c3,_0x3a85ac))[_0xca3d('0x4f')](handleError(_0x9b07c3,null));};exports[_0xca3d('0x6a')]=function(_0x44e610,_0xda5306,_0x580553){var _0xc4a0f3={};var _0x2d4db0={};var _0x59c952;var _0x4a26bd;return db[_0xca3d('0x38')]['findOne']({'where':{'id':_0x44e610[_0xca3d('0x51')]['id']}})[_0xca3d('0x2a')](handleEntityNotFound(_0xda5306,null))[_0xca3d('0x2a')](function(_0x3edb1d){if(_0x3edb1d){_0x59c952=_0x3edb1d;_0x2d4db0['model']=_['keys'](db['Team'][_0xca3d('0x53')]);_0x2d4db0['query']=_[_0xca3d('0x52')](_0x44e610[_0xca3d('0x3c')]);_0x2d4db0[_0xca3d('0x3d')]=_[_0xca3d('0x3e')](_0x2d4db0[_0xca3d('0x3b')],_0x2d4db0[_0xca3d('0x3c')]);_0xc4a0f3[_0xca3d('0x3f')]=_[_0xca3d('0x3e')](_0x2d4db0[_0xca3d('0x3b')],qs[_0xca3d('0x40')](_0x44e610[_0xca3d('0x3c')][_0xca3d('0x40')]));_0xc4a0f3['attributes']=_0xc4a0f3[_0xca3d('0x3f')]['length']?_0xc4a0f3['attributes']:_0x2d4db0[_0xca3d('0x3b')];_0xc4a0f3[_0xca3d('0x61')]=qs['sort'](_0x44e610['query'][_0xca3d('0x44')]);_0xc4a0f3[_0xca3d('0x45')]=qs[_0xca3d('0x3d')](_[_0xca3d('0x46')](_0x44e610[_0xca3d('0x3c')],_0x2d4db0[_0xca3d('0x3d')]));if(_0x44e610['query']['filter']){_0xc4a0f3[_0xca3d('0x45')]=_['merge'](_0xc4a0f3['where'],{'$or':_['map'](_0xc4a0f3['attributes'],function(_0x4521ce){var _0x4743d4={};_0x4743d4[_0x4521ce]={'$like':'%'+_0x44e610[_0xca3d('0x3c')]['filter']+'%'};return _0x4743d4;})});}_0xc4a0f3=_[_0xca3d('0x49')]({},_0xc4a0f3,_0x44e610[_0xca3d('0x4a')]);return _0x59c952[_0xca3d('0x6a')](_0xc4a0f3);}})['then'](function(_0xd0a79d){if(_0xd0a79d){_0x4a26bd=_0xd0a79d['length'];if(!_0x44e610[_0xca3d('0x3c')][_0xca3d('0x42')](_0xca3d('0x43'))){_0xc4a0f3['limit']=qs[_0xca3d('0x21')](_0x44e610['query'][_0xca3d('0x21')]);_0xc4a0f3['offset']=qs[_0xca3d('0x20')](_0x44e610[_0xca3d('0x3c')]['offset']);}return _0x59c952[_0xca3d('0x6a')](_0xc4a0f3);}})['then'](function(_0x3973f7){if(_0x3973f7){return _0x3973f7?{'count':_0x4a26bd,'rows':_0x3973f7}:null;}})[_0xca3d('0x2a')](respondWithResult(_0xda5306,null))[_0xca3d('0x4f')](handleError(_0xda5306,null));};exports[_0xca3d('0x6b')]=function(_0x55d682,_0x3c8526,_0x12335f){var _0x1c8c9f=_0x55d682[_0xca3d('0x5c')]['teams'];var _0x3de0f5=_[_0xca3d('0x48')](_0x1c8c9f,'id');return db[_0xca3d('0x6c')][_0xca3d('0x4d')]({'where':{'id':_0x3de0f5},'attributes':['id'],'include':[{'model':db[_0xca3d('0x6d')],'as':'Agents','attributes':['id','name',_0xca3d('0x6e'),'voicePause',_0xca3d('0x6f')],'raw':!![]}]})[_0xca3d('0x2a')](function(_0x5f59e1){if(_0x5f59e1){var _0x4b867d=_['flatMap'](_0x5f59e1,function(_0x1fbfad){var _0x21bac6=_0x1fbfad[_0xca3d('0x2c')]({'plain':!![]});_0x21bac6[_0xca3d('0x70')][_0xca3d('0x71')](function(_0x1eaf36){_0x1eaf36[_0xca3d('0x72')]=_['find'](_0x1c8c9f,{'id':_0x21bac6['id']})[_0xca3d('0x72')];});return _0x21bac6[_0xca3d('0x70')];});return db[_0xca3d('0x38')]['find']({'where':{'id':_0x55d682[_0xca3d('0x51')]['id']}})[_0xca3d('0x2a')](function(_0xa6724e){return db['sequelize']['transaction'](function(_0x744744){return _0xa6724e[_0xca3d('0x6b')](_0x3de0f5,{'transaction':_0x744744})[_0xca3d('0x2a')](function(){return BPromise[_0xca3d('0x73')](_0x1c8c9f,function(_0x3e7ea5){return db[_0xca3d('0x74')][_0xca3d('0x75')]({'TeamId':_0x3e7ea5['id'],'VoiceQueueId':_0x55d682[_0xca3d('0x51')]['id'],'penalty':_0x3e7ea5[_0xca3d('0x72')]},{'transaction':_0x744744});});})['then'](function(){return BPromise[_0xca3d('0x73')](_0x4b867d,function(_0x4a1f92){return db[_0xca3d('0x76')][_0xca3d('0x77')]({'where':{'UserId':_0x4a1f92['id'],'VoiceQueueId':_0x55d682['params']['id']},'defaults':{'penalty':_0x4a1f92[_0xca3d('0x72')]},'transaction':_0x744744});});})[_0xca3d('0x2a')](function(){return BPromise['each'](_['filter'](_0x4b867d,{'online':!![]}),function(_0x38e3e4){return db[_0xca3d('0x78')][_0xca3d('0x75')]({'membername':_0x38e3e4[_0xca3d('0x35')],'UserId':_0x38e3e4['id'],'queue_name':_0xa6724e['name'],'VoiceQueueId':_0xa6724e['id'],'interface':_[_0xca3d('0x79')](_0x38e3e4[_0xca3d('0x6f')])?util[_0xca3d('0x7a')](_0xca3d('0x7b'),_0x38e3e4[_0xca3d('0x35')]):_0x38e3e4['interface'],'paused':_0x38e3e4[_0xca3d('0x7c')]||![],'penalty':_0x38e3e4['penalty']},{'transaction':_0x744744});});})[_0xca3d('0x2a')](function(){_0x4b867d['forEach'](function(_0x52cfdb){socket[_0xca3d('0x7d')](_0xca3d('0x7e'),{'UserId':_0x52cfdb['id'],'VoiceQueueId':_0xa6724e['id']});});});});});}})[_0xca3d('0x2a')](respondWithStatusCode(_0x3c8526,null))[_0xca3d('0x4f')](handleError(_0x3c8526,null));};exports['removeTeams']=function(_0x2fc458,_0x34be3a,_0x10b9cc){return db[_0xca3d('0x6c')][_0xca3d('0x4d')]({'where':{'id':_0x2fc458[_0xca3d('0x3c')][_0xca3d('0x7f')]},'attributes':['id'],'include':[{'model':db[_0xca3d('0x6d')],'as':_0xca3d('0x70'),'attributes':['id'],'raw':!![]}]})[_0xca3d('0x2a')](handleEntityNotFound(_0x34be3a,null))[_0xca3d('0x2a')](function(_0x28d827){var _0x47ae77=_[_0xca3d('0x48')](_0x28d827,'id');var _0x108ea0=[];var _0x20d629=[];var _0xa245b4=squel['select']();_0xa245b4['field'](_0xca3d('0x80'))['from'](_0xca3d('0x81'),'tq')[_0xca3d('0x82')](_0xca3d('0x83'),'ut',_0xca3d('0x84'))[_0xca3d('0x45')](_0xca3d('0x85'),_0x2fc458[_0xca3d('0x51')]['id']);for(var _0x194bd0=0x0;_0x194bd0<_0x28d827[_0xca3d('0x41')];_0x194bd0+=0x1){let _0x472b6a=_0x28d827[_0x194bd0];for(var _0x185328=0x0;_0x185328<_0x472b6a[_0xca3d('0x70')][_0xca3d('0x41')];_0x185328+=0x1){let _0x3c4d9c=_0x472b6a['Agents'][_0x185328];var _0x16d145=_0xa245b4['clone']();_0x16d145['where'](_0xca3d('0x86'),_0x3c4d9c['id']);_0x20d629['push'](db[_0xca3d('0x87')][_0xca3d('0x3c')](_0x16d145[_0xca3d('0x88')](),{'type':db[_0xca3d('0x87')]['QueryTypes']['SELECT']})['then'](function(_0x2cbc07){if(_0x2cbc07[_0xca3d('0x41')]===0x1){return _0x3c4d9c['id'];}else{var _0xce6a6e=_['every'](_['map'](_0x2cbc07,_0xca3d('0x89')),function(_0xb497da){return _[_0xca3d('0x32')](_0x47ae77,_0xb497da);});if(_0xce6a6e){return _0x3c4d9c['id'];}}}));}}return BPromise[_0xca3d('0x8a')](_0x20d629)[_0xca3d('0x2a')](function(_0x578f06){_0x108ea0=_(_0x108ea0)['union'](_0x578f06)[_0xca3d('0x8b')]()[_0xca3d('0x31')]();return db[_0xca3d('0x38')]['find']({'where':{'id':_0x2fc458['params']['id']}})['then'](function(_0x5b5ed5){return db[_0xca3d('0x87')][_0xca3d('0x8c')](function(_0x5268f1){return _0x5b5ed5[_0xca3d('0x8d')](_0x2fc458['query'][_0xca3d('0x7f')],{'transaction':_0x5268f1})[_0xca3d('0x2a')](function(){if(!_[_0xca3d('0x8e')](_0x108ea0)){return _0x5b5ed5['removeAgents'](_0x108ea0,{'transaction':_0x5268f1})[_0xca3d('0x2a')](function(){return db['UserVoiceQueueRt'][_0xca3d('0x2b')]({'where':{'VoiceQueueId':_0x2fc458['params']['id'],'UserId':_0x108ea0},'transaction':_0x5268f1});});}})[_0xca3d('0x2a')](function(){_0x108ea0[_0xca3d('0x71')](function(_0x55b6a3){socket['emit'](_0xca3d('0x8f'),{'UserId':_0x55b6a3,'VoiceQueueId':_0x5b5ed5['id']});});});});});});})[_0xca3d('0x2a')](respondWithStatusCode(_0x34be3a,null))[_0xca3d('0x4f')](handleError(_0x34be3a,null));};exports[_0xca3d('0x90')]=function(_0x5c781b,_0x30a83d,_0x3570e7){var _0x5c6e5e,_0x557693;return db['VoiceQueue'][_0xca3d('0x34')]({'where':{'id':_0x5c781b[_0xca3d('0x51')]['id']}})['then'](handleEntityNotFound(_0x30a83d,null))[_0xca3d('0x2a')](function(_0x5186f8){if(_0x5186f8){_0x557693=_0x5186f8;return _0x5186f8[_0xca3d('0x90')](_0x5c781b[_0xca3d('0x5c')][_0xca3d('0x7f')],_['omit'](_0x5c781b[_0xca3d('0x5c')],[_0xca3d('0x7f'),'id'])||{})[_0xca3d('0x91')](function(_0x1136ad){for(var _0x144a8b=0x0;_0x144a8b<_0x5c781b[_0xca3d('0x5c')]['ids'][_0xca3d('0x41')];_0x144a8b+=0x1){socket[_0xca3d('0x7d')](_0xca3d('0x7e'),{'UserId':Number(_0x5c781b['body'][_0xca3d('0x7f')][_0x144a8b]),'VoiceQueueId':Number(_0x5c781b[_0xca3d('0x51')]['id'])});}return _0x1136ad;});}})[_0xca3d('0x2a')](function(_0x3d55ae){_0x5c6e5e=_0x3d55ae||[];if(_0x557693){return db[_0xca3d('0x6d')]['findAll']({'where':{'id':_0x5c781b[_0xca3d('0x5c')][_0xca3d('0x7f')]},'attributes':['id',_0xca3d('0x35'),_0xca3d('0x6e'),_0xca3d('0x7c'),_0xca3d('0x6f')],'raw':!![]});}})[_0xca3d('0x2a')](function(_0xf4d0a0){if(!_[_0xca3d('0x8e')](_0xf4d0a0)){var _0x2fd873=[];for(var _0x205ed2=0x0;_0x205ed2<_0xf4d0a0['length'];_0x205ed2++){if(_0xf4d0a0[_0x205ed2][_0xca3d('0x6e')]){_0x2fd873[_0xca3d('0x92')](db[_0xca3d('0x78')][_0xca3d('0x75')]({'membername':_0xf4d0a0[_0x205ed2][_0xca3d('0x35')],'UserId':_0xf4d0a0[_0x205ed2]['id'],'queue_name':_0x557693[_0xca3d('0x35')],'VoiceQueueId':_0x557693['id'],'interface':_[_0xca3d('0x79')](_0xf4d0a0[_0x205ed2][_0xca3d('0x6f')])?util[_0xca3d('0x7a')](_0xca3d('0x7b'),_0xf4d0a0[_0x205ed2][_0xca3d('0x35')]):_0xf4d0a0[_0x205ed2]['interface'],'paused':_0xf4d0a0[_0x205ed2][_0xca3d('0x7c')]||![],'penalty':_0x5c781b[_0xca3d('0x5c')][_0xca3d('0x72')]||0x0}));}}return BPromise[_0xca3d('0x8a')](_0x2fd873);}})[_0xca3d('0x2a')](function(){return _0x5c6e5e;})[_0xca3d('0x2a')](respondWithResult(_0x30a83d,null))['catch'](handleError(_0x30a83d,null));};exports[_0xca3d('0x93')]=function(_0x42e899,_0x58305d,_0x56f6ba){return db[_0xca3d('0x38')][_0xca3d('0x34')]({'where':{'id':_0x42e899[_0xca3d('0x51')]['id']}})[_0xca3d('0x2a')](handleEntityNotFound(_0x58305d,null))[_0xca3d('0x2a')](function(_0x261d0b){if(_0x261d0b){return _0x261d0b[_0xca3d('0x93')](_0x42e899['query'][_0xca3d('0x7f')])[_0xca3d('0x2a')](function(){if(_['isArray'](_0x42e899[_0xca3d('0x3c')][_0xca3d('0x7f')])){for(var _0x279ab6=0x0;_0x279ab6<_0x42e899[_0xca3d('0x3c')][_0xca3d('0x7f')][_0xca3d('0x41')];_0x279ab6+=0x1){socket[_0xca3d('0x7d')](_0xca3d('0x8f'),{'UserId':Number(_0x42e899[_0xca3d('0x3c')][_0xca3d('0x7f')][_0x279ab6]),'VoiceQueueId':Number(_0x42e899[_0xca3d('0x51')]['id'])});}}else{socket['emit'](_0xca3d('0x8f'),{'UserId':Number(_0x42e899[_0xca3d('0x3c')][_0xca3d('0x7f')]),'VoiceQueueId':Number(_0x42e899[_0xca3d('0x51')]['id'])});}});}})['then'](function(_0x525994){return db[_0xca3d('0x78')][_0xca3d('0x2b')]({'where':{'VoiceQueueId':_0x42e899['params']['id'],'UserId':_0x42e899[_0xca3d('0x3c')][_0xca3d('0x7f')]}})[_0xca3d('0x2a')](function(){return _0x525994;});})[_0xca3d('0x2a')](respondWithStatusCode(_0x58305d,null))[_0xca3d('0x4f')](handleError(_0x58305d,null));};exports[_0xca3d('0x94')]=function(_0x4fd264,_0x5e6af2,_0xe4fcfc){var _0x3e4373={};var _0x3fc117={};var _0x7bdef4;var _0x4fa345;return db[_0xca3d('0x38')][_0xca3d('0x63')]({'where':{'id':_0x4fd264[_0xca3d('0x51')]['id']}})['then'](handleEntityNotFound(_0x5e6af2,null))[_0xca3d('0x2a')](function(_0x5529d3){if(_0x5529d3){_0x7bdef4=_0x5529d3;_0x3fc117[_0xca3d('0x3b')]=_['keys'](db[_0xca3d('0x6d')][_0xca3d('0x53')]);_0x3fc117[_0xca3d('0x3c')]=_[_0xca3d('0x52')](_0x4fd264[_0xca3d('0x3c')]);_0x3fc117[_0xca3d('0x3d')]=_[_0xca3d('0x3e')](_0x3fc117[_0xca3d('0x3b')],_0x3fc117[_0xca3d('0x3c')]);_0x3e4373['attributes']=_[_0xca3d('0x3e')](_0x3fc117[_0xca3d('0x3b')],qs[_0xca3d('0x40')](_0x4fd264[_0xca3d('0x3c')][_0xca3d('0x40')]));_0x3e4373[_0xca3d('0x3f')]=_0x3e4373[_0xca3d('0x3f')][_0xca3d('0x41')]?_0x3e4373['attributes']:_0x3fc117['model'];_0x3e4373[_0xca3d('0x61')]=qs[_0xca3d('0x44')](_0x4fd264[_0xca3d('0x3c')][_0xca3d('0x44')]);_0x3e4373[_0xca3d('0x45')]=qs[_0xca3d('0x3d')](_[_0xca3d('0x46')](_0x4fd264[_0xca3d('0x3c')],_0x3fc117[_0xca3d('0x3d')]));if(_0x4fd264['query'][_0xca3d('0x47')]){_0x3e4373[_0xca3d('0x45')]=_[_0xca3d('0x49')](_0x3e4373[_0xca3d('0x45')],{'$or':_['map'](_0x3e4373[_0xca3d('0x3f')],function(_0x1e20d){var _0x2ddc37={};_0x2ddc37[_0x1e20d]={'$like':'%'+_0x4fd264[_0xca3d('0x3c')]['filter']+'%'};return _0x2ddc37;})});}_0x3e4373=_['merge']({},_0x3e4373,_0x4fd264[_0xca3d('0x4a')]);return _0x7bdef4['getAgents'](_0x3e4373);}})['then'](function(_0x878510){if(_0x878510){_0x4fa345=_0x878510[_0xca3d('0x41')];if(!_0x4fd264[_0xca3d('0x3c')]['hasOwnProperty'](_0xca3d('0x43'))){_0x3e4373[_0xca3d('0x21')]=qs[_0xca3d('0x21')](_0x4fd264[_0xca3d('0x3c')][_0xca3d('0x21')]);_0x3e4373[_0xca3d('0x20')]=qs[_0xca3d('0x20')](_0x4fd264['query']['offset']);}return _0x7bdef4[_0xca3d('0x94')](_0x3e4373);}})['then'](function(_0x2fb52f){if(_0x2fb52f){return _0x2fb52f?{'count':_0x4fa345,'rows':_0x2fb52f}:null;}})[_0xca3d('0x2a')](respondWithResult(_0x5e6af2,null))[_0xca3d('0x4f')](handleError(_0x5e6af2,null));};exports[_0xca3d('0x95')]=function(_0x37d010,_0xef509a,_0x3ef8b0){var _0xf7aa1c={};var _0x4bd00e={};var _0x2dba54;var _0xd88efa;return db[_0xca3d('0x38')]['findOne']({'where':{'id':_0x37d010['params']['id']}})[_0xca3d('0x2a')](handleEntityNotFound(_0xef509a,null))[_0xca3d('0x2a')](function(_0xb54b4){if(_0xb54b4){_0x2dba54=_0xb54b4;_0x4bd00e[_0xca3d('0x3b')]=_[_0xca3d('0x52')](db[_0xca3d('0x78')]['rawAttributes']);_0x4bd00e[_0xca3d('0x3c')]=_[_0xca3d('0x52')](_0x37d010[_0xca3d('0x3c')]);_0x4bd00e[_0xca3d('0x3d')]=_[_0xca3d('0x3e')](_0x4bd00e[_0xca3d('0x3b')],_0x4bd00e[_0xca3d('0x3c')]);_0xf7aa1c[_0xca3d('0x3f')]=_[_0xca3d('0x3e')](_0x4bd00e['model'],qs[_0xca3d('0x40')](_0x37d010[_0xca3d('0x3c')][_0xca3d('0x40')]));_0xf7aa1c[_0xca3d('0x3f')]=_0xf7aa1c[_0xca3d('0x3f')]['length']?_0xf7aa1c['attributes']:_0x4bd00e[_0xca3d('0x3b')];_0xf7aa1c['order']=qs['sort'](_0x37d010[_0xca3d('0x3c')][_0xca3d('0x44')]);_0xf7aa1c['where']=qs['filters'](_['pick'](_0x37d010['query'],_0x4bd00e[_0xca3d('0x3d')]));if(_0x37d010['query'][_0xca3d('0x47')]){_0xf7aa1c[_0xca3d('0x45')]=_[_0xca3d('0x49')](_0xf7aa1c[_0xca3d('0x45')],{'$or':_[_0xca3d('0x48')](_0xf7aa1c[_0xca3d('0x3f')],function(_0x1a4186){var _0x2033b7={};_0x2033b7[_0x1a4186]={'$like':'%'+_0x37d010['query'][_0xca3d('0x47')]+'%'};return _0x2033b7;})});}_0xf7aa1c=_[_0xca3d('0x49')]({},_0xf7aa1c,_0x37d010['options']);return _0x2dba54[_0xca3d('0x95')](_0xf7aa1c);}})[_0xca3d('0x2a')](function(_0xc2013b){if(_0xc2013b){_0xd88efa=_0xc2013b[_0xca3d('0x41')];if(!_0x37d010[_0xca3d('0x3c')][_0xca3d('0x42')]('nolimit')){_0xf7aa1c[_0xca3d('0x21')]=qs['limit'](_0x37d010['query'][_0xca3d('0x21')]);_0xf7aa1c[_0xca3d('0x20')]=qs['offset'](_0x37d010[_0xca3d('0x3c')][_0xca3d('0x20')]);}return _0x2dba54[_0xca3d('0x95')](_0xf7aa1c);}})[_0xca3d('0x2a')](function(_0x1e0479){return _0x1e0479?{'count':_0xd88efa,'rows':_0x1e0479}:null;})[_0xca3d('0x2a')](respondWithResult(_0xef509a,null))[_0xca3d('0x4f')](handleError(_0xef509a,null));};exports['getLists']=function(_0x1e65d5,_0x42e6a2,_0x171c03){var _0x529d92={};var _0x1950aa={};var _0x419fa1;var _0x2ff2d7;return db['VoiceQueue'][_0xca3d('0x63')]({'where':{'id':_0x1e65d5[_0xca3d('0x51')]['id']}})['then'](handleEntityNotFound(_0x42e6a2,null))['then'](function(_0x4cbb67){if(_0x4cbb67){_0x419fa1=_0x4cbb67;_0x1950aa[_0xca3d('0x3b')]=_[_0xca3d('0x52')](db[_0xca3d('0x96')]['rawAttributes']);_0x1950aa['query']=_[_0xca3d('0x52')](_0x1e65d5[_0xca3d('0x3c')]);_0x1950aa['filters']=_['intersection'](_0x1950aa[_0xca3d('0x3b')],_0x1950aa['query']);_0x529d92['attributes']=_['intersection'](_0x1950aa['model'],qs['fields'](_0x1e65d5[_0xca3d('0x3c')][_0xca3d('0x40')]));_0x529d92['attributes']=_0x529d92[_0xca3d('0x3f')][_0xca3d('0x41')]?_0x529d92['attributes']:_0x1950aa[_0xca3d('0x3b')];_0x529d92['order']=qs['sort'](_0x1e65d5['query'][_0xca3d('0x44')]);_0x529d92['where']=qs[_0xca3d('0x3d')](_['pick'](_0x1e65d5['query'],_0x1950aa[_0xca3d('0x3d')]));if(_0x1e65d5[_0xca3d('0x3c')][_0xca3d('0x47')]){_0x529d92[_0xca3d('0x45')]=_[_0xca3d('0x49')](_0x529d92['where'],{'$or':_[_0xca3d('0x48')](_0x529d92[_0xca3d('0x3f')],function(_0x462dd3){var _0x58532e={};_0x58532e[_0x462dd3]={'$like':'%'+_0x1e65d5[_0xca3d('0x3c')]['filter']+'%'};return _0x58532e;})});}_0x529d92=_[_0xca3d('0x49')]({},_0x529d92,_0x1e65d5[_0xca3d('0x4a')]);return _0x419fa1[_0xca3d('0x97')](_0x529d92);}})['then'](function(_0x5e32b6){if(_0x5e32b6){_0x2ff2d7=_0x5e32b6[_0xca3d('0x41')];if(!_0x1e65d5[_0xca3d('0x3c')][_0xca3d('0x42')](_0xca3d('0x43'))){_0x529d92[_0xca3d('0x21')]=qs[_0xca3d('0x21')](_0x1e65d5[_0xca3d('0x3c')][_0xca3d('0x21')]);_0x529d92[_0xca3d('0x20')]=qs[_0xca3d('0x20')](_0x1e65d5[_0xca3d('0x3c')]['offset']);}return _0x419fa1[_0xca3d('0x97')](_0x529d92);}})[_0xca3d('0x2a')](function(_0xff5b40){if(_0xff5b40){return _0xff5b40?{'count':_0x2ff2d7,'rows':_0xff5b40}:null;}})[_0xca3d('0x2a')](respondWithResult(_0x42e6a2,null))[_0xca3d('0x4f')](handleError(_0x42e6a2,null));};exports[_0xca3d('0x98')]=function(_0x34598b,_0x18b956,_0x10a157){var _0x10b96f,_0x10558d;return db['VoiceQueue'][_0xca3d('0x34')]({'where':{'id':_0x34598b[_0xca3d('0x51')]['id']}})[_0xca3d('0x2a')](handleEntityNotFound(_0x18b956,null))[_0xca3d('0x2a')](function(_0x531602){if(_0x531602){_0x10558d=_0x531602;return _0x531602[_0xca3d('0x98')](_0x34598b[_0xca3d('0x5c')][_0xca3d('0x7f')],_[_0xca3d('0x99')](_0x34598b[_0xca3d('0x5c')],[_0xca3d('0x7f'),'id'])||{});}return null;})[_0xca3d('0x91')](function(_0x520f83){var _0x176a49;_0x10b96f=_0x520f83||[];var _0x304e96=[];if(_0x520f83){for(var _0x4a6f44=0x0;_0x4a6f44<_0x520f83[_0xca3d('0x41')];_0x4a6f44+=0x1){var _0xb62bfa=_0x520f83[_0x4a6f44][_0xca3d('0x2c')]({'plain':!![]});_0x10558d['dialCheckDuplicateType']=_0x34598b['body']['dialCheckDuplicateType']?_0x34598b[_0xca3d('0x5c')][_0xca3d('0x9a')]:_0x10558d[_0xca3d('0x9a')];switch(_0x10558d['dialCheckDuplicateType']){case _0xca3d('0x9b'):_0x176a49=squel[_0xca3d('0x9c')]()['into'](_0xca3d('0x9d'))['fromQuery']([_0xca3d('0x9e'),_0xca3d('0x9f'),'ContactId',_0xca3d('0xa0'),_0xca3d('0x64'),_0xca3d('0x5b'),'updatedAt'],squel[_0xca3d('0xa1')]()['field'](_0xca3d('0x9e'),_0xca3d('0x9e'))[_0xca3d('0xa2')](_0xca3d('0xa3'),_0xca3d('0x9f'))[_0xca3d('0xa2')]('id',_0xca3d('0xa4'))['field'](_0xb62bfa[_0xca3d('0xa5')]['toString'](),_0xca3d('0xa0'))[_0xca3d('0xa2')](_0x34598b[_0xca3d('0x51')]['id'][_0xca3d('0x88')](),'VoiceQueueId')[_0xca3d('0xa2')](_0xca3d('0xa3'),_0xca3d('0x5b'))[_0xca3d('0xa2')](_0xca3d('0xa3'),_0xca3d('0x5d'))[_0xca3d('0xa6')]('cm_contacts')['where'](_0xca3d('0xa7'))['where'](_0xca3d('0xa8'),_0xb62bfa[_0xca3d('0xa5')][_0xca3d('0x88')]())[_0xca3d('0x45')](_0xca3d('0xa9'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xca3d('0xa1')]()[_0xca3d('0xa2')](_0xca3d('0xaa'))['from'](_0xca3d('0xab'))[_0xca3d('0x45')](_0xca3d('0x85'),_0x34598b[_0xca3d('0x51')]['id'][_0xca3d('0x88')]()))['where'](_0xca3d('0xac'),squel[_0xca3d('0xa1')]()[_0xca3d('0xa2')](_0xca3d('0xad'))['from'](_0xca3d('0x9d'))['where'](_0xca3d('0x85'),_0x34598b['params']['id'][_0xca3d('0x88')]())))['toString']();break;case _0xca3d('0xae'):_0x176a49=squel[_0xca3d('0x9c')]()[_0xca3d('0xaf')](_0xca3d('0x9d'))[_0xca3d('0xb0')]([_0xca3d('0x9e'),_0xca3d('0x9f'),_0xca3d('0xa4'),_0xca3d('0xa0'),_0xca3d('0x64'),_0xca3d('0x5b'),_0xca3d('0x5d')],squel['select']()[_0xca3d('0xa2')](_0xca3d('0x9e'),'phone')['field'](_0xca3d('0xa3'),_0xca3d('0x9f'))[_0xca3d('0xa2')]('id',_0xca3d('0xa4'))['field'](_0xb62bfa[_0xca3d('0xa5')][_0xca3d('0x88')](),_0xca3d('0xa0'))['field'](_0x34598b['params']['id'][_0xca3d('0x88')](),_0xca3d('0x64'))[_0xca3d('0xa2')](_0xca3d('0xa3'),_0xca3d('0x5b'))[_0xca3d('0xa2')]('NOW()',_0xca3d('0x5d'))[_0xca3d('0xa6')](_0xca3d('0xb1'))[_0xca3d('0x45')](_0xca3d('0xa7'))['where'](_0xca3d('0xa8'),_0xb62bfa[_0xca3d('0xa5')]['toString']())[_0xca3d('0x45')](_0xca3d('0xa9'))[_0xca3d('0x45')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xca3d('0xa2')]('COALESCE(phone,\x27\x27)')[_0xca3d('0xa6')]('cm_hopper')[_0xca3d('0x45')](_0xca3d('0x85'),_0x34598b[_0xca3d('0x51')]['id'][_0xca3d('0x88')]())))[_0xca3d('0x88')]();break;default:_0x176a49=squel['insert']()['into'](_0xca3d('0x9d'))[_0xca3d('0xb0')](['phone',_0xca3d('0x9f'),_0xca3d('0xa4'),_0xca3d('0xa0'),'VoiceQueueId',_0xca3d('0x5b'),'updatedAt'],squel[_0xca3d('0xa1')]()[_0xca3d('0xa2')](_0xca3d('0x9e'),_0xca3d('0x9e'))['field'](_0xca3d('0xa3'),_0xca3d('0x9f'))[_0xca3d('0xa2')]('id','ContactId')['field'](_0xb62bfa['CmListId']['toString'](),_0xca3d('0xa0'))[_0xca3d('0xa2')](_0x34598b[_0xca3d('0x51')]['id'][_0xca3d('0x88')](),_0xca3d('0x64'))[_0xca3d('0xa2')](_0xca3d('0xa3'),_0xca3d('0x5b'))[_0xca3d('0xa2')]('NOW()',_0xca3d('0x5d'))[_0xca3d('0xa6')]('cm_contacts')['where'](_0xca3d('0xa7'))[_0xca3d('0x45')](_0xca3d('0xa8'),_0xb62bfa['CmListId'][_0xca3d('0x88')]())[_0xca3d('0x45')]('phone\x20IS\x20NOT\x20NULL'))[_0xca3d('0x88')]();}_0x304e96['push'](db[_0xca3d('0x87')][_0xca3d('0x3c')](_0x176a49));}return BPromise[_0xca3d('0x8a')](_0x304e96);}})[_0xca3d('0x2a')](function(){return _0x10b96f;})[_0xca3d('0x2a')](respondWithResult(_0x18b956,null))[_0xca3d('0x4f')](handleError(_0x18b956,null));};exports[_0xca3d('0xb2')]=function(_0x22402f,_0x2bbc13,_0xa5663e){return db[_0xca3d('0x38')][_0xca3d('0x34')]({'where':{'id':_0x22402f[_0xca3d('0x51')]['id']}})[_0xca3d('0x2a')](handleEntityNotFound(_0x2bbc13,null))['then'](function(_0x56f89f){if(_0x56f89f){return _0x56f89f['removeLists'](_0x22402f[_0xca3d('0x3c')]['ids']);}})[_0xca3d('0x2a')](function(_0x4567f){if(_0x4567f){return db[_0xca3d('0x60')][_0xca3d('0x2b')]({'where':{'ListId':_0x22402f[_0xca3d('0x3c')][_0xca3d('0x7f')],'VoiceQueueId':_0x22402f[_0xca3d('0x51')]['id']}})[_0xca3d('0x2a')](function(){return _0x4567f;});}})[_0xca3d('0x2a')](respondWithStatusCode(_0x2bbc13,null))[_0xca3d('0x4f')](handleError(_0x2bbc13,null));};exports[_0xca3d('0xb3')]=function(_0x1bb5a6,_0x4516f2,_0x462910){var _0x4c131a={};var _0x28960f={};var _0x3347b0;var _0x50cce0;return db[_0xca3d('0x38')][_0xca3d('0x63')]({'where':{'id':_0x1bb5a6[_0xca3d('0x51')]['id']}})[_0xca3d('0x2a')](handleEntityNotFound(_0x4516f2,null))[_0xca3d('0x2a')](function(_0x44a82d){if(_0x44a82d){_0x3347b0=_0x44a82d;_0x28960f[_0xca3d('0x3b')]=_[_0xca3d('0x52')](db[_0xca3d('0x96')][_0xca3d('0x53')]);_0x28960f['query']=_[_0xca3d('0x52')](_0x1bb5a6['query']);_0x28960f['filters']=_[_0xca3d('0x3e')](_0x28960f[_0xca3d('0x3b')],_0x28960f['query']);_0x4c131a['attributes']=_['intersection'](_0x28960f['model'],qs[_0xca3d('0x40')](_0x1bb5a6[_0xca3d('0x3c')][_0xca3d('0x40')]));_0x4c131a[_0xca3d('0x3f')]=_0x4c131a[_0xca3d('0x3f')][_0xca3d('0x41')]?_0x4c131a['attributes']:_0x28960f[_0xca3d('0x3b')];_0x4c131a[_0xca3d('0x61')]=qs[_0xca3d('0x44')](_0x1bb5a6[_0xca3d('0x3c')][_0xca3d('0x44')]);_0x4c131a['where']=qs[_0xca3d('0x3d')](_[_0xca3d('0x46')](_0x1bb5a6['query'],_0x28960f[_0xca3d('0x3d')]));if(_0x1bb5a6[_0xca3d('0x3c')][_0xca3d('0x47')]){_0x4c131a['where']=_['merge'](_0x4c131a[_0xca3d('0x45')],{'$or':_[_0xca3d('0x48')](_0x4c131a['attributes'],function(_0x3b3980){var _0x5a2487={};_0x5a2487[_0x3b3980]={'$like':'%'+_0x1bb5a6[_0xca3d('0x3c')][_0xca3d('0x47')]+'%'};return _0x5a2487;})});}_0x4c131a=_[_0xca3d('0x49')]({},_0x4c131a,_0x1bb5a6[_0xca3d('0x4a')]);return _0x3347b0[_0xca3d('0xb3')](_0x4c131a);}})[_0xca3d('0x2a')](function(_0x3c0d82){if(_0x3c0d82){_0x50cce0=_0x3c0d82[_0xca3d('0x41')];if(!_0x1bb5a6['query'][_0xca3d('0x42')](_0xca3d('0x43'))){_0x4c131a[_0xca3d('0x21')]=qs[_0xca3d('0x21')](_0x1bb5a6[_0xca3d('0x3c')][_0xca3d('0x21')]);_0x4c131a['offset']=qs[_0xca3d('0x20')](_0x1bb5a6[_0xca3d('0x3c')][_0xca3d('0x20')]);}return _0x3347b0[_0xca3d('0xb3')](_0x4c131a);}})[_0xca3d('0x2a')](function(_0x405a58){if(_0x405a58){return _0x405a58?{'count':_0x50cce0,'rows':_0x405a58}:null;}})[_0xca3d('0x2a')](respondWithResult(_0x4516f2,null))['catch'](handleError(_0x4516f2,null));};exports[_0xca3d('0xb4')]=function(_0xefbd0a,_0x3dc259,_0x3ceea9){var _0x2637e2,_0x4bcb11;return db[_0xca3d('0x38')][_0xca3d('0x34')]({'where':{'id':_0xefbd0a['params']['id']}})['then'](handleEntityNotFound(_0x3dc259,null))[_0xca3d('0x2a')](function(_0x17dc8f){if(_0x17dc8f){_0x4bcb11=_0x17dc8f;return _0x17dc8f[_0xca3d('0xb4')](_0xefbd0a[_0xca3d('0x5c')][_0xca3d('0x7f')],_[_0xca3d('0x99')](_0xefbd0a[_0xca3d('0x5c')],[_0xca3d('0x7f'),'id'])||{});}return null;})[_0xca3d('0x91')](function(_0x14c4a4){var _0x325090;_0x2637e2=_0x14c4a4||[];var _0x5691a5=[];if(_0x14c4a4){for(var _0x1dffde=0x0;_0x1dffde<_0x14c4a4[_0xca3d('0x41')];_0x1dffde+=0x1){var _0x41d205=_0x14c4a4[_0x1dffde][_0xca3d('0x2c')]({'plain':!![]});_0x325090=squel['insert']()['into'](_0xca3d('0xb5'))['fromQuery']([_0xca3d('0x9e'),_0xca3d('0xa4'),'ListId',_0xca3d('0x64'),_0xca3d('0x5b'),_0xca3d('0x5d')],squel[_0xca3d('0xa1')]()['field'](_0xca3d('0x9e'),_0xca3d('0x9e'))[_0xca3d('0xa2')]('id',_0xca3d('0xa4'))[_0xca3d('0xa2')](_0x41d205[_0xca3d('0xa5')][_0xca3d('0x88')](),_0xca3d('0xa0'))[_0xca3d('0xa2')](_0xefbd0a[_0xca3d('0x51')]['id'][_0xca3d('0x88')](),_0xca3d('0x64'))[_0xca3d('0xa2')]('NOW()',_0xca3d('0x5b'))[_0xca3d('0xa2')](_0xca3d('0xa3'),_0xca3d('0x5d'))[_0xca3d('0xa6')](_0xca3d('0xb1'))[_0xca3d('0x45')](_0xca3d('0xa7'))['where']('ListId\x20=\x20?',_0x41d205['CmListId'][_0xca3d('0x88')]())[_0xca3d('0x45')](_0xca3d('0xa9')))[_0xca3d('0x88')]();_0x5691a5[_0xca3d('0x92')](db[_0xca3d('0x87')]['query'](_0x325090));}return BPromise[_0xca3d('0x8a')](_0x5691a5);}})[_0xca3d('0x2a')](function(){return _0x2637e2;})[_0xca3d('0x2a')](respondWithResult(_0x3dc259,null))['catch'](handleError(_0x3dc259,null));};exports[_0xca3d('0xb6')]=function(_0x1e2747,_0x11ffe4,_0x7b55b7){return db[_0xca3d('0x38')]['find']({'where':{'id':_0x1e2747[_0xca3d('0x51')]['id']}})[_0xca3d('0x2a')](handleEntityNotFound(_0x11ffe4,null))['then'](function(_0x8290ff){if(_0x8290ff){return _0x8290ff[_0xca3d('0xb6')](_0x1e2747[_0xca3d('0x3c')]['ids']);}})[_0xca3d('0x2a')](function(_0x391825){if(_0x391825){return db[_0xca3d('0x69')]['destroy']({'where':{'ListId':_0x1e2747[_0xca3d('0x3c')][_0xca3d('0x7f')],'VoiceQueueId':_0x1e2747[_0xca3d('0x51')]['id']}})[_0xca3d('0x2a')](function(){return _0x391825;});}})['then'](respondWithStatusCode(_0x11ffe4,null))[_0xca3d('0x4f')](handleError(_0x11ffe4,null));}; \ No newline at end of file +var _0xf204=['sort','where','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','show','params','keys','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','autoAssociation','update','getHoppers','findOne','CmHopper','VoiceQueueId','getHopperHistories','CmHopperHistory','hasOwnProperty','nolimit','pick','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','Agents','online','voicePause','flatMap','forEach','penalty','sequelize','transaction','addTeams','each','TeamVoiceQueue','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','upsert','isNil','interface','format','SIP/%s','emit','removeTeams','ids','User','field','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','push','every','TeamId','all','union','compact','isEmpty','removeAgents','addAgents','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','ContactId','ListId','select','phone','scheduledAt','CmListId','toString','NOW()','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','onlyIfOpen','fromQuery','deletedAt\x20IS\x20NULL','COALESCE(phone,\x27\x27)','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','offset','undefined','limit','set','Content-Range','json','save','destroy','then','get','VoiceQueues','inbound','QueueCampaigns','outbound','includes','find','value','type','name','UserProfileResource','status','stack','send','index','map','VoiceQueue','fieldName','key','model','query','filters','intersection','fields','attributes','length','order'];(function(_0x22ac02,_0x183aec){var _0x20cc5c=function(_0x1e0bd9){while(--_0x1e0bd9){_0x22ac02['push'](_0x22ac02['shift']());}};_0x20cc5c(++_0x183aec);}(_0xf204,0x1ef));var _0x4f20=function(_0x2f4ed6,_0x20961a){_0x2f4ed6=_0x2f4ed6-0x0;var _0x3751fe=_0xf204[_0x2f4ed6];return _0x3751fe;};'use strict';var emlformat=require(_0x4f20('0x0'));var rimraf=require(_0x4f20('0x1'));var zipdir=require(_0x4f20('0x2'));var jsonpatch=require(_0x4f20('0x3'));var rp=require(_0x4f20('0x4'));var moment=require(_0x4f20('0x5'));var BPromise=require(_0x4f20('0x6'));var Mustache=require(_0x4f20('0x7'));var util=require(_0x4f20('0x8'));var path=require(_0x4f20('0x9'));var sox=require(_0x4f20('0xa'));var csv=require('to-csv');var ejs=require(_0x4f20('0xb'));var fs=require('fs');var fs_extra=require(_0x4f20('0xc'));var _=require(_0x4f20('0xd'));var squel=require(_0x4f20('0xe'));var crypto=require(_0x4f20('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4f20('0x10'));var querystring=require(_0x4f20('0x11'));var Papa=require('papaparse');var Redis=require(_0x4f20('0x12'));var authService=require(_0x4f20('0x13'));var qs=require(_0x4f20('0x14'));var as=require(_0x4f20('0x15'));var hardwareService=require(_0x4f20('0x16'));var logger=require('../../config/logger')(_0x4f20('0x17'));var utils=require('../../config/utils');var config=require(_0x4f20('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x4f20('0x19'))['db'];config[_0x4f20('0x1a')]=_[_0x4f20('0x1b')](config[_0x4f20('0x1a')],{'host':_0x4f20('0x1c'),'port':0x18eb});var socket=require(_0x4f20('0x1d'))(new Redis(config['redis']));require('./voiceQueue.socket')[_0x4f20('0x1e')](socket);function respondWithStatusCode(_0x4e80c3,_0x1cc278){_0x1cc278=_0x1cc278||0xcc;return function(_0x248c0d){if(_0x248c0d){return _0x4e80c3[_0x4f20('0x1f')](_0x1cc278);}return _0x4e80c3['status'](_0x1cc278)[_0x4f20('0x20')]();};}function respondWithResult(_0xd1e895,_0x2a579a){_0x2a579a=_0x2a579a||0xc8;return function(_0x43e504){if(_0x43e504){return _0xd1e895['status'](_0x2a579a)['json'](_0x43e504);}};}function respondWithFilteredResult(_0x141474,_0x4d3c0d){return function(_0x48b77d){if(_0x48b77d){var _0x4c92fc=typeof _0x4d3c0d[_0x4f20('0x21')]===_0x4f20('0x22')&&typeof _0x4d3c0d[_0x4f20('0x23')]===_0x4f20('0x22');var _0x3950df=_0x48b77d['count'];var _0xd5a433=_0x4c92fc?0x0:_0x4d3c0d['offset'];var _0x227cb2=_0x4c92fc?_0x48b77d['count']:_0x4d3c0d[_0x4f20('0x21')]+_0x4d3c0d['limit'];var _0x42d4b9;if(_0x227cb2>=_0x3950df){_0x227cb2=_0x3950df;_0x42d4b9=0xc8;}else{_0x42d4b9=0xce;}_0x141474['status'](_0x42d4b9);return _0x141474[_0x4f20('0x24')](_0x4f20('0x25'),_0xd5a433+'-'+_0x227cb2+'/'+_0x3950df)[_0x4f20('0x26')](_0x48b77d);}return null;};}function patchUpdates(_0x36abd5){return function(_0x3e338e){try{jsonpatch['apply'](_0x3e338e,_0x36abd5,!![]);}catch(_0x564c77){return BPromise['reject'](_0x564c77);}return _0x3e338e[_0x4f20('0x27')]();};}function saveUpdates(_0x287e23,_0x5cf195){return function(_0x56b411){if(_0x56b411){return _0x56b411['update'](_0x287e23)['then'](function(_0x684129){return _0x684129;});}return null;};}function removeEntity(_0x2fba8b,_0x11239e){return function(_0x4238e9){if(_0x4238e9){return _0x4238e9[_0x4f20('0x28')]()[_0x4f20('0x29')](function(){var _0x2671bd=_0x4238e9[_0x4f20('0x2a')]({'plain':!![]});var _0x361294=[{'name':_0x4f20('0x2b'),'value':_0x4f20('0x2c'),'ignore':![]},{'name':_0x4f20('0x2d'),'value':_0x4f20('0x2e'),'ignore':![]}];var _0x292146=_(_0x361294)['filter']('ignore')['map']('value')['value']();if(_[_0x4f20('0x2f')](_0x292146,_0x2671bd['type'])){return;}var _0x5866e0=_[_0x4f20('0x30')](_0x361294,[_0x4f20('0x31'),_0x2671bd[_0x4f20('0x32')]])[_0x4f20('0x33')];return db[_0x4f20('0x34')][_0x4f20('0x28')]({'where':{'type':_0x5866e0,'resourceId':_0x2671bd['id']}})[_0x4f20('0x29')](function(){return _0x4238e9;});})[_0x4f20('0x29')](function(){_0x2fba8b[_0x4f20('0x35')](0xcc)[_0x4f20('0x20')]();});}};}function handleEntityNotFound(_0xf63a41,_0x3afcd6){return function(_0x3b3aec){if(!_0x3b3aec){_0xf63a41[_0x4f20('0x1f')](0x194);}return _0x3b3aec;};}function handleError(_0x2a7483,_0x1bb1c3){_0x1bb1c3=_0x1bb1c3||0x1f4;return function(_0xb2feed){logger['error'](_0xb2feed[_0x4f20('0x36')]);if(_0xb2feed['name']){delete _0xb2feed[_0x4f20('0x33')];}_0x2a7483[_0x4f20('0x35')](_0x1bb1c3)[_0x4f20('0x37')](_0xb2feed);};}exports[_0x4f20('0x38')]=function(_0x3ce4ab,_0x71d24){var _0xe398ba={},_0x38b748={},_0x37da81={'count':0x0,'rows':[]};var _0x503a25=_[_0x4f20('0x39')](db[_0x4f20('0x3a')]['rawAttributes'],function(_0x30e64c){return{'name':_0x30e64c[_0x4f20('0x3b')],'type':_0x30e64c['type'][_0x4f20('0x3c')]};});_0x38b748[_0x4f20('0x3d')]=_[_0x4f20('0x39')](_0x503a25,_0x4f20('0x33'));_0x38b748['query']=_['keys'](_0x3ce4ab[_0x4f20('0x3e')]);_0x38b748[_0x4f20('0x3f')]=_[_0x4f20('0x40')](_0x38b748[_0x4f20('0x3d')],_0x38b748[_0x4f20('0x3e')]);_0xe398ba['attributes']=_[_0x4f20('0x40')](_0x38b748[_0x4f20('0x3d')],qs[_0x4f20('0x41')](_0x3ce4ab[_0x4f20('0x3e')][_0x4f20('0x41')]));_0xe398ba['attributes']=_0xe398ba[_0x4f20('0x42')][_0x4f20('0x43')]?_0xe398ba['attributes']:_0x38b748['model'];if(!_0x3ce4ab['query']['hasOwnProperty']('nolimit')){_0xe398ba['limit']=qs['limit'](_0x3ce4ab[_0x4f20('0x3e')][_0x4f20('0x23')]);_0xe398ba['offset']=qs[_0x4f20('0x21')](_0x3ce4ab['query']['offset']);}_0xe398ba[_0x4f20('0x44')]=qs[_0x4f20('0x45')](_0x3ce4ab[_0x4f20('0x3e')][_0x4f20('0x45')]);_0xe398ba[_0x4f20('0x46')]=qs['filters'](_['pick'](_0x3ce4ab['query'],_0x38b748[_0x4f20('0x3f')]),_0x503a25);if(_0x3ce4ab['query']['filter']){_0xe398ba[_0x4f20('0x46')]=_[_0x4f20('0x47')](_0xe398ba['where'],{'$or':_[_0x4f20('0x39')](_0x503a25,function(_0x1a965a){if(_0x1a965a[_0x4f20('0x32')]!==_0x4f20('0x48')){var _0x3489bf={};_0x3489bf[_0x1a965a[_0x4f20('0x33')]]={'$like':'%'+_0x3ce4ab[_0x4f20('0x3e')][_0x4f20('0x49')]+'%'};return _0x3489bf;}})});}_0xe398ba=_[_0x4f20('0x47')]({},_0xe398ba,_0x3ce4ab[_0x4f20('0x4a')]);var _0x5c24b8={'where':_0xe398ba['where']};return db['VoiceQueue'][_0x4f20('0x4b')](_0x5c24b8)[_0x4f20('0x29')](function(_0x480ecc){_0x37da81[_0x4f20('0x4b')]=_0x480ecc;if(_0x3ce4ab[_0x4f20('0x3e')][_0x4f20('0x4c')]){_0xe398ba[_0x4f20('0x4d')]=[{'all':!![]}];}return db[_0x4f20('0x3a')][_0x4f20('0x4e')](_0xe398ba);})[_0x4f20('0x29')](function(_0x24ef03){_0x37da81[_0x4f20('0x4f')]=_0x24ef03;return _0x37da81;})['then'](respondWithFilteredResult(_0x71d24,_0xe398ba))['catch'](handleError(_0x71d24,null));};exports[_0x4f20('0x50')]=function(_0x3da850,_0x4c590a){var _0x27e52f={'raw':![],'where':{'id':_0x3da850[_0x4f20('0x51')]['id']}},_0x576a5f={};_0x576a5f['model']=_[_0x4f20('0x52')](db['VoiceQueue'][_0x4f20('0x53')]);_0x576a5f[_0x4f20('0x3e')]=_[_0x4f20('0x52')](_0x3da850[_0x4f20('0x3e')]);_0x576a5f[_0x4f20('0x3f')]=_[_0x4f20('0x40')](_0x576a5f['model'],_0x576a5f[_0x4f20('0x3e')]);_0x27e52f['attributes']=_['intersection'](_0x576a5f[_0x4f20('0x3d')],qs[_0x4f20('0x41')](_0x3da850[_0x4f20('0x3e')][_0x4f20('0x41')]));_0x27e52f['attributes']=_0x27e52f[_0x4f20('0x42')][_0x4f20('0x43')]?_0x27e52f[_0x4f20('0x42')]:_0x576a5f[_0x4f20('0x3d')];if(_0x3da850[_0x4f20('0x3e')][_0x4f20('0x4c')]){_0x27e52f[_0x4f20('0x4d')]=[{'all':!![]}];}_0x27e52f=_[_0x4f20('0x47')]({},_0x27e52f,_0x3da850['options']);return db[_0x4f20('0x3a')][_0x4f20('0x30')](_0x27e52f)['then'](handleEntityNotFound(_0x4c590a,null))[_0x4f20('0x29')](respondWithResult(_0x4c590a,null))['catch'](handleError(_0x4c590a,null));};exports[_0x4f20('0x54')]=function(_0x51ecc6,_0x19681e){return db[_0x4f20('0x3a')][_0x4f20('0x54')](_0x51ecc6[_0x4f20('0x55')],{})[_0x4f20('0x29')](function(_0x242ce7){var _0x44ec0b=_0x51ecc6[_0x4f20('0x56')]['get']({'plain':!![]});if(!_0x44ec0b)throw new Error(_0x4f20('0x57'));if(_0x44ec0b['role']===_0x4f20('0x56')){var _0x37df0b=_0x242ce7[_0x4f20('0x2a')]({'plain':!![]});var _0x3eab5f=[{'name':_0x4f20('0x2b'),'value':_0x4f20('0x2c')},{'name':_0x4f20('0x2d'),'value':_0x4f20('0x2e')}];var _0x5ea8d9=_['find'](_0x3eab5f,[_0x4f20('0x31'),_0x37df0b[_0x4f20('0x32')]])[_0x4f20('0x33')];return db[_0x4f20('0x58')]['find']({'where':{'name':_0x5ea8d9,'userProfileId':_0x44ec0b[_0x4f20('0x59')]},'raw':!![]})[_0x4f20('0x29')](function(_0x3e7848){if(_0x3e7848&&_0x3e7848['autoAssociation']===0x0){return db['UserProfileResource'][_0x4f20('0x54')]({'name':_0x37df0b['name'],'resourceId':_0x37df0b['id'],'type':_0x3e7848[_0x4f20('0x33')],'sectionId':_0x3e7848['id']},{})[_0x4f20('0x29')](function(){return _0x242ce7;});}else{return _0x242ce7;}})[_0x4f20('0x5a')](function(_0x31c908){logger[_0x4f20('0x5b')](_0x4f20('0x5c'),_0x31c908);throw _0x31c908;});}return _0x242ce7;})[_0x4f20('0x29')](respondWithResult(_0x19681e,0xc9))['catch'](handleError(_0x19681e,null));};exports[_0x4f20('0x5d')]=function(_0x3e5b21,_0x2347c1){var _0x8c48a8={'where':{'id':_0x3e5b21['params']['id']}},_0x26b394={};_0x26b394[_0x4f20('0x3d')]=_['keys'](db[_0x4f20('0x3a')][_0x4f20('0x53')]);_0x8c48a8[_0x4f20('0x42')]=_[_0x4f20('0x40')](_0x26b394[_0x4f20('0x3d')],qs[_0x4f20('0x41')](_0x3e5b21[_0x4f20('0x3e')][_0x4f20('0x41')]));_0x8c48a8[_0x4f20('0x42')]=_0x8c48a8[_0x4f20('0x42')][_0x4f20('0x43')]?_0x8c48a8[_0x4f20('0x42')]:_0x26b394[_0x4f20('0x3d')];if(_0x3e5b21['query'][_0x4f20('0x4c')]){_0x8c48a8[_0x4f20('0x4d')]=[{'all':!![]}];}_0x8c48a8=_[_0x4f20('0x47')]({},_0x8c48a8,_0x3e5b21['options']);return db[_0x4f20('0x3a')][_0x4f20('0x30')](_0x8c48a8)[_0x4f20('0x29')](handleEntityNotFound(_0x2347c1,null))[_0x4f20('0x29')](function(_0x2a3e77){if(_0x2a3e77){var _0x22b3db=_0x2a3e77[_0x4f20('0x2a')]({'plain':!![]});_0x22b3db=qs[_0x4f20('0x5e')](_0x22b3db,['id','createdAt',_0x4f20('0x5f')]);_0x3e5b21[_0x4f20('0x55')]=_[_0x4f20('0x5e')](_0x3e5b21[_0x4f20('0x55')],['id',_0x4f20('0x60'),_0x4f20('0x5f')]);return db[_0x4f20('0x3a')][_0x4f20('0x54')](_[_0x4f20('0x47')](_0x22b3db,_0x3e5b21[_0x4f20('0x55')]),{'include':_0x3e5b21[_0x4f20('0x3e')][_0x4f20('0x4c')]?[{'all':!![]}]:undefined})['then'](function(_0xc39fc8){var _0x23e5d9=_0x3e5b21['user']['get']({'plain':!![]});if(!_0x23e5d9)throw new Error(_0x4f20('0x57'));if(_0x23e5d9['role']===_0x4f20('0x56')){var _0x3fb055=_0xc39fc8[_0x4f20('0x2a')]({'plain':!![]});var _0x3529cd=[{'name':'VoiceQueues','value':_0x4f20('0x2c')},{'name':_0x4f20('0x2d'),'value':'outbound'}];var _0x4e5381=_[_0x4f20('0x30')](_0x3529cd,['value',_0x3fb055[_0x4f20('0x32')]])[_0x4f20('0x33')];return db[_0x4f20('0x58')][_0x4f20('0x30')]({'where':{'name':_0x4e5381,'userProfileId':_0x23e5d9['userProfileId']},'raw':!![]})[_0x4f20('0x29')](function(_0x39a2d0){if(_0x39a2d0&&_0x39a2d0[_0x4f20('0x61')]===0x0){return db[_0x4f20('0x34')][_0x4f20('0x54')]({'name':_0x3fb055['name'],'resourceId':_0x3fb055['id'],'type':_0x39a2d0['name'],'sectionId':_0x39a2d0['id']},{})[_0x4f20('0x29')](function(){return _0xc39fc8;});}else{return _0xc39fc8;}})[_0x4f20('0x5a')](function(_0x97cb22){logger[_0x4f20('0x5b')](_0x4f20('0x5c'),_0x97cb22);throw _0x97cb22;});}return _0xc39fc8;});}})[_0x4f20('0x29')](respondWithResult(_0x2347c1,0xc9))[_0x4f20('0x5a')](handleError(_0x2347c1,null));};exports[_0x4f20('0x62')]=function(_0x2a519c,_0x3d523d){if(_0x2a519c[_0x4f20('0x55')]['id']){delete _0x2a519c[_0x4f20('0x55')]['id'];}return db[_0x4f20('0x3a')][_0x4f20('0x30')]({'where':{'id':_0x2a519c[_0x4f20('0x51')]['id']}})[_0x4f20('0x29')](handleEntityNotFound(_0x3d523d,null))[_0x4f20('0x29')](saveUpdates(_0x2a519c['body'],null))['then'](respondWithResult(_0x3d523d,null))[_0x4f20('0x5a')](handleError(_0x3d523d,null));};exports[_0x4f20('0x28')]=function(_0x3f5797,_0x40474f){return db['VoiceQueue'][_0x4f20('0x30')]({'where':{'id':_0x3f5797[_0x4f20('0x51')]['id']}})['then'](handleEntityNotFound(_0x40474f,null))['then'](removeEntity(_0x40474f,null))[_0x4f20('0x5a')](handleError(_0x40474f,null));};exports[_0x4f20('0x63')]=function(_0x14d31c,_0x2f3dbc,_0x45e68f){var _0x30142b={'raw':![],'where':{}};var _0x2487a7={};var _0x43760b={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x4f20('0x64')]({'where':{'id':_0x14d31c[_0x4f20('0x51')]['id']}})[_0x4f20('0x29')](handleEntityNotFound(_0x2f3dbc,null))['then'](function(_0x5c23b3){if(_0x5c23b3){_0x2487a7[_0x4f20('0x3d')]=_[_0x4f20('0x52')](db[_0x4f20('0x65')]['rawAttributes']);_0x2487a7[_0x4f20('0x3e')]=_[_0x4f20('0x52')](_0x14d31c['query']);_0x2487a7['filters']=_[_0x4f20('0x40')](_0x2487a7[_0x4f20('0x3d')],_0x2487a7[_0x4f20('0x3e')]);_0x30142b[_0x4f20('0x42')]=_[_0x4f20('0x40')](_0x2487a7[_0x4f20('0x3d')],qs[_0x4f20('0x41')](_0x14d31c[_0x4f20('0x3e')]['fields']));_0x30142b[_0x4f20('0x42')]=_0x30142b[_0x4f20('0x42')][_0x4f20('0x43')]?_0x30142b['attributes']:_0x2487a7[_0x4f20('0x3d')];if(!_0x14d31c[_0x4f20('0x3e')]['hasOwnProperty']('nolimit')){_0x30142b[_0x4f20('0x23')]=qs[_0x4f20('0x23')](_0x14d31c[_0x4f20('0x3e')][_0x4f20('0x23')]);_0x30142b['offset']=qs[_0x4f20('0x21')](_0x14d31c[_0x4f20('0x3e')][_0x4f20('0x21')]);}_0x30142b['order']=qs['sort'](_0x14d31c[_0x4f20('0x3e')][_0x4f20('0x45')]);_0x30142b[_0x4f20('0x46')]=qs['filters'](_['pick'](_0x14d31c[_0x4f20('0x3e')],_0x2487a7[_0x4f20('0x3f')]));_0x30142b['where'][_0x4f20('0x66')]=_0x5c23b3['id'];if(_0x14d31c['query'][_0x4f20('0x49')]){_0x30142b['where']=_[_0x4f20('0x47')](_0x30142b[_0x4f20('0x46')],{'$or':_[_0x4f20('0x39')](_0x30142b[_0x4f20('0x42')],function(_0x1d7e12){var _0x1e16b2={};_0x1e16b2[_0x1d7e12]={'$like':'%'+_0x14d31c['query'][_0x4f20('0x49')]+'%'};return _0x1e16b2;})});}_0x30142b=_[_0x4f20('0x47')]({},_0x30142b,_0x14d31c[_0x4f20('0x4a')]);return db['CmHopper']['count']({'where':_0x30142b[_0x4f20('0x46')]})[_0x4f20('0x29')](function(_0x342403){_0x43760b['count']=_0x342403;if(_0x14d31c[_0x4f20('0x3e')][_0x4f20('0x4c')]){_0x30142b['include']=[{'all':!![]}];}return db[_0x4f20('0x65')][_0x4f20('0x4e')](_0x30142b);})[_0x4f20('0x29')](function(_0x2f0787){_0x43760b[_0x4f20('0x4f')]=_0x2f0787;return _0x43760b;});}})['then'](respondWithFilteredResult(_0x2f3dbc,_0x30142b))[_0x4f20('0x5a')](handleError(_0x2f3dbc,null));};exports[_0x4f20('0x67')]=function(_0x1fc7ed,_0x4d1eda,_0x3441db){var _0x585bbd={'raw':!![],'where':{}};var _0xa52d4f={};var _0x2063ed={'count':0x0,'rows':[]};return db[_0x4f20('0x3a')][_0x4f20('0x64')]({'where':{'id':_0x1fc7ed['params']['id']}})[_0x4f20('0x29')](handleEntityNotFound(_0x4d1eda,null))[_0x4f20('0x29')](function(_0x50a198){if(_0x50a198){_0xa52d4f[_0x4f20('0x3d')]=_[_0x4f20('0x52')](db[_0x4f20('0x68')][_0x4f20('0x53')]);_0xa52d4f[_0x4f20('0x3e')]=_[_0x4f20('0x52')](_0x1fc7ed[_0x4f20('0x3e')]);_0xa52d4f[_0x4f20('0x3f')]=_['intersection'](_0xa52d4f['model'],_0xa52d4f[_0x4f20('0x3e')]);_0x585bbd[_0x4f20('0x42')]=_['intersection'](_0xa52d4f[_0x4f20('0x3d')],qs[_0x4f20('0x41')](_0x1fc7ed[_0x4f20('0x3e')][_0x4f20('0x41')]));_0x585bbd[_0x4f20('0x42')]=_0x585bbd['attributes']['length']?_0x585bbd[_0x4f20('0x42')]:_0xa52d4f[_0x4f20('0x3d')];if(!_0x1fc7ed[_0x4f20('0x3e')][_0x4f20('0x69')](_0x4f20('0x6a'))){_0x585bbd[_0x4f20('0x23')]=qs[_0x4f20('0x23')](_0x1fc7ed['query'][_0x4f20('0x23')]);_0x585bbd['offset']=qs['offset'](_0x1fc7ed[_0x4f20('0x3e')][_0x4f20('0x21')]);}_0x585bbd[_0x4f20('0x44')]=qs[_0x4f20('0x45')](_0x1fc7ed[_0x4f20('0x3e')][_0x4f20('0x45')]);_0x585bbd[_0x4f20('0x46')]=qs[_0x4f20('0x3f')](_[_0x4f20('0x6b')](_0x1fc7ed[_0x4f20('0x3e')],_0xa52d4f[_0x4f20('0x3f')]));_0x585bbd[_0x4f20('0x46')]['VoiceQueueId']=_0x50a198['id'];if(_0x1fc7ed[_0x4f20('0x3e')]['filter']){_0x585bbd[_0x4f20('0x46')]=_[_0x4f20('0x47')](_0x585bbd['where'],{'$or':_[_0x4f20('0x39')](_0x585bbd[_0x4f20('0x42')],function(_0x13392c){var _0x288edf={};_0x288edf[_0x13392c]={'$like':'%'+_0x1fc7ed[_0x4f20('0x3e')]['filter']+'%'};return _0x288edf;})});}_0x585bbd=_['merge']({},_0x585bbd,_0x1fc7ed[_0x4f20('0x4a')]);return db[_0x4f20('0x68')][_0x4f20('0x4b')]({'where':_0x585bbd[_0x4f20('0x46')]})[_0x4f20('0x29')](function(_0x4c96f5){_0x2063ed[_0x4f20('0x4b')]=_0x4c96f5;if(_0x1fc7ed[_0x4f20('0x3e')][_0x4f20('0x4c')]){_0x585bbd[_0x4f20('0x4d')]=[{'all':!![]}];}return db[_0x4f20('0x68')]['findAll'](_0x585bbd);})[_0x4f20('0x29')](function(_0x4a7e80){_0x2063ed[_0x4f20('0x4f')]=_0x4a7e80;return _0x2063ed;});}})[_0x4f20('0x29')](respondWithFilteredResult(_0x4d1eda,_0x585bbd))[_0x4f20('0x5a')](handleError(_0x4d1eda,null));};exports[_0x4f20('0x6c')]=function(_0x2e12c8,_0x2add7c,_0x2bf0e9){var _0xf53f43={'raw':!![],'where':{}};var _0xc95718={};var _0x91a574={'count':0x0,'rows':[]};return db[_0x4f20('0x3a')][_0x4f20('0x64')]({'where':{'id':_0x2e12c8[_0x4f20('0x51')]['id']}})[_0x4f20('0x29')](handleEntityNotFound(_0x2add7c,null))[_0x4f20('0x29')](function(_0x59386c){if(_0x59386c){_0xc95718[_0x4f20('0x3d')]=_['keys'](db[_0x4f20('0x6d')][_0x4f20('0x53')]);_0xc95718[_0x4f20('0x3e')]=_[_0x4f20('0x52')](_0x2e12c8['query']);_0xc95718['filters']=_[_0x4f20('0x40')](_0xc95718[_0x4f20('0x3d')],_0xc95718[_0x4f20('0x3e')]);_0xf53f43[_0x4f20('0x42')]=_[_0x4f20('0x40')](_0xc95718[_0x4f20('0x3d')],qs[_0x4f20('0x41')](_0x2e12c8[_0x4f20('0x3e')][_0x4f20('0x41')]));_0xf53f43['attributes']=_0xf53f43[_0x4f20('0x42')][_0x4f20('0x43')]?_0xf53f43[_0x4f20('0x42')]:_0xc95718[_0x4f20('0x3d')];if(!_0x2e12c8[_0x4f20('0x3e')][_0x4f20('0x69')](_0x4f20('0x6a'))){_0xf53f43['limit']=qs[_0x4f20('0x23')](_0x2e12c8[_0x4f20('0x3e')][_0x4f20('0x23')]);_0xf53f43[_0x4f20('0x21')]=qs['offset'](_0x2e12c8['query']['offset']);}_0xf53f43[_0x4f20('0x44')]=qs[_0x4f20('0x45')](_0x2e12c8[_0x4f20('0x3e')][_0x4f20('0x45')]);_0xf53f43[_0x4f20('0x46')]=qs['filters'](_[_0x4f20('0x6b')](_0x2e12c8['query'],_0xc95718[_0x4f20('0x3f')]));_0xf53f43[_0x4f20('0x46')][_0x4f20('0x66')]=_0x59386c['id'];if(_0x2e12c8['query'][_0x4f20('0x49')]){_0xf53f43['where']=_[_0x4f20('0x47')](_0xf53f43[_0x4f20('0x46')],{'$or':_[_0x4f20('0x39')](_0xf53f43[_0x4f20('0x42')],function(_0xef87fd){var _0x254a42={};_0x254a42[_0xef87fd]={'$like':'%'+_0x2e12c8[_0x4f20('0x3e')]['filter']+'%'};return _0x254a42;})});}_0xf53f43=_[_0x4f20('0x47')]({},_0xf53f43,_0x2e12c8[_0x4f20('0x4a')]);return db['CmHopperFinal'][_0x4f20('0x4b')]({'where':_0xf53f43[_0x4f20('0x46')]})[_0x4f20('0x29')](function(_0x47fcbe){_0x91a574[_0x4f20('0x4b')]=_0x47fcbe;if(_0x2e12c8[_0x4f20('0x3e')][_0x4f20('0x4c')]){_0xf53f43['include']=[{'all':!![]}];}return db[_0x4f20('0x6d')]['findAll'](_0xf53f43);})['then'](function(_0x3ecd9a){_0x91a574['rows']=_0x3ecd9a;return _0x91a574;});}})['then'](respondWithFilteredResult(_0x2add7c,_0xf53f43))[_0x4f20('0x5a')](handleError(_0x2add7c,null));};exports[_0x4f20('0x6e')]=function(_0x6d073c,_0x5cfafa,_0x525346){var _0x5ca1f7={'raw':!![],'where':{}};var _0xb43505={};var _0x190b71={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x4f20('0x64')]({'where':{'id':_0x6d073c[_0x4f20('0x51')]['id']}})[_0x4f20('0x29')](handleEntityNotFound(_0x5cfafa,null))['then'](function(_0x331c5f){if(_0x331c5f){_0xb43505[_0x4f20('0x3d')]=_['keys'](db[_0x4f20('0x6f')][_0x4f20('0x53')]);_0xb43505['query']=_[_0x4f20('0x52')](_0x6d073c[_0x4f20('0x3e')]);_0xb43505[_0x4f20('0x3f')]=_[_0x4f20('0x40')](_0xb43505[_0x4f20('0x3d')],_0xb43505['query']);_0x5ca1f7['attributes']=_['intersection'](_0xb43505[_0x4f20('0x3d')],qs[_0x4f20('0x41')](_0x6d073c[_0x4f20('0x3e')][_0x4f20('0x41')]));_0x5ca1f7['attributes']=_0x5ca1f7['attributes'][_0x4f20('0x43')]?_0x5ca1f7['attributes']:_0xb43505[_0x4f20('0x3d')];if(!_0x6d073c[_0x4f20('0x3e')]['hasOwnProperty'](_0x4f20('0x6a'))){_0x5ca1f7[_0x4f20('0x23')]=qs[_0x4f20('0x23')](_0x6d073c[_0x4f20('0x3e')][_0x4f20('0x23')]);_0x5ca1f7['offset']=qs[_0x4f20('0x21')](_0x6d073c[_0x4f20('0x3e')][_0x4f20('0x21')]);}_0x5ca1f7[_0x4f20('0x44')]=qs['sort'](_0x6d073c[_0x4f20('0x3e')][_0x4f20('0x45')]);_0x5ca1f7[_0x4f20('0x46')]=qs[_0x4f20('0x3f')](_[_0x4f20('0x6b')](_0x6d073c[_0x4f20('0x3e')],_0xb43505[_0x4f20('0x3f')]));_0x5ca1f7['where'][_0x4f20('0x66')]=_0x331c5f['id'];if(_0x6d073c[_0x4f20('0x3e')]['filter']){_0x5ca1f7[_0x4f20('0x46')]=_[_0x4f20('0x47')](_0x5ca1f7[_0x4f20('0x46')],{'$or':_[_0x4f20('0x39')](_0x5ca1f7[_0x4f20('0x42')],function(_0x46f03d){var _0x3730ff={};_0x3730ff[_0x46f03d]={'$like':'%'+_0x6d073c[_0x4f20('0x3e')]['filter']+'%'};return _0x3730ff;})});}_0x5ca1f7=_[_0x4f20('0x47')]({},_0x5ca1f7,_0x6d073c[_0x4f20('0x4a')]);return db[_0x4f20('0x6f')]['count']({'where':_0x5ca1f7['where']})['then'](function(_0x18c980){_0x190b71[_0x4f20('0x4b')]=_0x18c980;if(_0x6d073c[_0x4f20('0x3e')]['includeAll']){_0x5ca1f7[_0x4f20('0x4d')]=[{'all':!![]}];}return db[_0x4f20('0x6f')][_0x4f20('0x4e')](_0x5ca1f7);})[_0x4f20('0x29')](function(_0x17a351){_0x190b71[_0x4f20('0x4f')]=_0x17a351;return _0x190b71;});}})[_0x4f20('0x29')](respondWithFilteredResult(_0x5cfafa,_0x5ca1f7))[_0x4f20('0x5a')](handleError(_0x5cfafa,null));};exports[_0x4f20('0x70')]=function(_0x119542,_0x1a402d,_0x547a90){var _0x1c6029={};var _0x219684={};var _0x59e6af;var _0x156a2b;return db[_0x4f20('0x3a')]['findOne']({'where':{'id':_0x119542[_0x4f20('0x51')]['id']}})[_0x4f20('0x29')](handleEntityNotFound(_0x1a402d,null))['then'](function(_0x250acc){if(_0x250acc){_0x59e6af=_0x250acc;_0x219684[_0x4f20('0x3d')]=_[_0x4f20('0x52')](db['Team'][_0x4f20('0x53')]);_0x219684[_0x4f20('0x3e')]=_[_0x4f20('0x52')](_0x119542[_0x4f20('0x3e')]);_0x219684['filters']=_[_0x4f20('0x40')](_0x219684[_0x4f20('0x3d')],_0x219684[_0x4f20('0x3e')]);_0x1c6029[_0x4f20('0x42')]=_['intersection'](_0x219684['model'],qs[_0x4f20('0x41')](_0x119542[_0x4f20('0x3e')]['fields']));_0x1c6029[_0x4f20('0x42')]=_0x1c6029[_0x4f20('0x42')][_0x4f20('0x43')]?_0x1c6029[_0x4f20('0x42')]:_0x219684[_0x4f20('0x3d')];_0x1c6029[_0x4f20('0x44')]=qs[_0x4f20('0x45')](_0x119542['query'][_0x4f20('0x45')]);_0x1c6029[_0x4f20('0x46')]=qs[_0x4f20('0x3f')](_['pick'](_0x119542[_0x4f20('0x3e')],_0x219684[_0x4f20('0x3f')]));if(_0x119542[_0x4f20('0x3e')][_0x4f20('0x49')]){_0x1c6029[_0x4f20('0x46')]=_[_0x4f20('0x47')](_0x1c6029['where'],{'$or':_[_0x4f20('0x39')](_0x1c6029[_0x4f20('0x42')],function(_0x1d8e4f){var _0x51c2fb={};_0x51c2fb[_0x1d8e4f]={'$like':'%'+_0x119542[_0x4f20('0x3e')][_0x4f20('0x49')]+'%'};return _0x51c2fb;})});}_0x1c6029=_[_0x4f20('0x47')]({},_0x1c6029,_0x119542[_0x4f20('0x4a')]);return _0x59e6af[_0x4f20('0x70')](_0x1c6029);}})[_0x4f20('0x29')](function(_0x2bea4e){if(_0x2bea4e){_0x156a2b=_0x2bea4e[_0x4f20('0x43')];if(!_0x119542[_0x4f20('0x3e')]['hasOwnProperty'](_0x4f20('0x6a'))){_0x1c6029['limit']=qs['limit'](_0x119542[_0x4f20('0x3e')][_0x4f20('0x23')]);_0x1c6029[_0x4f20('0x21')]=qs[_0x4f20('0x21')](_0x119542['query'][_0x4f20('0x21')]);}return _0x59e6af[_0x4f20('0x70')](_0x1c6029);}})[_0x4f20('0x29')](function(_0x4d31b0){if(_0x4d31b0){return _0x4d31b0?{'count':_0x156a2b,'rows':_0x4d31b0}:null;}})['then'](respondWithResult(_0x1a402d,null))[_0x4f20('0x5a')](handleError(_0x1a402d,null));};exports['addTeams']=function(_0x229ece,_0x521daf,_0x16f320){var _0x38b0d3=_0x229ece[_0x4f20('0x55')]['teams'];var _0x15368f=_[_0x4f20('0x39')](_0x38b0d3,'id');return db[_0x4f20('0x71')][_0x4f20('0x4e')]({'where':{'id':_0x15368f},'attributes':['id'],'include':[{'model':db['User'],'as':_0x4f20('0x72'),'attributes':['id','name',_0x4f20('0x73'),_0x4f20('0x74'),'interface'],'raw':!![]}]})['then'](function(_0x2df115){if(_0x2df115){var _0x139dfb=_[_0x4f20('0x75')](_0x2df115,function(_0x2c8d8f){var _0x128542=_0x2c8d8f['get']({'plain':!![]});_0x128542[_0x4f20('0x72')][_0x4f20('0x76')](function(_0xe05e43){_0xe05e43[_0x4f20('0x77')]=_[_0x4f20('0x30')](_0x38b0d3,{'id':_0x128542['id']})[_0x4f20('0x77')];});return _0x128542[_0x4f20('0x72')];});return db[_0x4f20('0x3a')][_0x4f20('0x30')]({'where':{'id':_0x229ece[_0x4f20('0x51')]['id']}})[_0x4f20('0x29')](function(_0x1fd15d){return db[_0x4f20('0x78')][_0x4f20('0x79')](function(_0xff27bd){return _0x1fd15d[_0x4f20('0x7a')](_0x15368f,{'transaction':_0xff27bd})['then'](function(){return BPromise[_0x4f20('0x7b')](_0x38b0d3,function(_0x7dfde7){return db[_0x4f20('0x7c')]['upsert']({'TeamId':_0x7dfde7['id'],'VoiceQueueId':_0x229ece[_0x4f20('0x51')]['id'],'penalty':_0x7dfde7[_0x4f20('0x77')]},{'transaction':_0xff27bd});});})[_0x4f20('0x29')](function(){return BPromise[_0x4f20('0x7b')](_0x139dfb,function(_0xf2aad0){return db[_0x4f20('0x7d')][_0x4f20('0x7e')]({'where':{'UserId':_0xf2aad0['id'],'VoiceQueueId':_0x229ece[_0x4f20('0x51')]['id']},'defaults':{'penalty':_0xf2aad0[_0x4f20('0x77')]},'transaction':_0xff27bd});});})['then'](function(){return BPromise['each'](_['filter'](_0x139dfb,{'online':!![]}),function(_0x12fa91){return db[_0x4f20('0x7f')][_0x4f20('0x80')]({'membername':_0x12fa91[_0x4f20('0x33')],'UserId':_0x12fa91['id'],'queue_name':_0x1fd15d[_0x4f20('0x33')],'VoiceQueueId':_0x1fd15d['id'],'interface':_[_0x4f20('0x81')](_0x12fa91[_0x4f20('0x82')])?util[_0x4f20('0x83')](_0x4f20('0x84'),_0x12fa91[_0x4f20('0x33')]):_0x12fa91[_0x4f20('0x82')],'paused':_0x12fa91['voicePause']||![],'penalty':_0x12fa91[_0x4f20('0x77')]},{'transaction':_0xff27bd});});})[_0x4f20('0x29')](function(){_0x139dfb[_0x4f20('0x76')](function(_0x1196ca){socket[_0x4f20('0x85')]('userVoiceQueue:save',{'UserId':_0x1196ca['id'],'VoiceQueueId':_0x1fd15d['id']});});});});});}})[_0x4f20('0x29')](respondWithStatusCode(_0x521daf,null))[_0x4f20('0x5a')](handleError(_0x521daf,null));};exports[_0x4f20('0x86')]=function(_0x1e5357,_0x3f5048,_0x988ed5){return db['Team']['findAll']({'where':{'id':_0x1e5357[_0x4f20('0x3e')][_0x4f20('0x87')]},'attributes':['id'],'include':[{'model':db[_0x4f20('0x88')],'as':_0x4f20('0x72'),'attributes':['id'],'raw':!![]}]})[_0x4f20('0x29')](handleEntityNotFound(_0x3f5048,null))[_0x4f20('0x29')](function(_0x34f5d3){var _0x33111e=_[_0x4f20('0x39')](_0x34f5d3,'id');var _0x22d643=[];var _0x4ff7da=[];var _0x1a1d71=squel['select']();_0x1a1d71[_0x4f20('0x89')]('tq.TeamId')[_0x4f20('0x8a')]('team_has_voice_queues','tq')[_0x4f20('0x8b')](_0x4f20('0x8c'),'ut',_0x4f20('0x8d'))['where']('VoiceQueueId\x20=\x20?',_0x1e5357[_0x4f20('0x51')]['id']);for(var _0x42e81f=0x0;_0x42e81f<_0x34f5d3[_0x4f20('0x43')];_0x42e81f+=0x1){let _0x52e426=_0x34f5d3[_0x42e81f];for(var _0x2686b0=0x0;_0x2686b0<_0x52e426[_0x4f20('0x72')][_0x4f20('0x43')];_0x2686b0+=0x1){let _0x17496a=_0x52e426[_0x4f20('0x72')][_0x2686b0];var _0x3bccbf=_0x1a1d71['clone']();_0x3bccbf[_0x4f20('0x46')]('ut.UserId\x20=\x20?',_0x17496a['id']);_0x4ff7da[_0x4f20('0x8e')](db[_0x4f20('0x78')]['query'](_0x3bccbf['toString'](),{'type':db[_0x4f20('0x78')]['QueryTypes']['SELECT']})[_0x4f20('0x29')](function(_0x251bff){if(_0x251bff[_0x4f20('0x43')]===0x1){return _0x17496a['id'];}else{var _0x2b6c10=_[_0x4f20('0x8f')](_[_0x4f20('0x39')](_0x251bff,_0x4f20('0x90')),function(_0x53f624){return _[_0x4f20('0x2f')](_0x33111e,_0x53f624);});if(_0x2b6c10){return _0x17496a['id'];}}}));}}return BPromise[_0x4f20('0x91')](_0x4ff7da)['then'](function(_0x48df15){_0x22d643=_(_0x22d643)[_0x4f20('0x92')](_0x48df15)[_0x4f20('0x93')]()[_0x4f20('0x31')]();return db[_0x4f20('0x3a')][_0x4f20('0x30')]({'where':{'id':_0x1e5357[_0x4f20('0x51')]['id']}})[_0x4f20('0x29')](function(_0x4b5632){return db[_0x4f20('0x78')]['transaction'](function(_0x5bdcca){return _0x4b5632['removeTeams'](_0x1e5357[_0x4f20('0x3e')][_0x4f20('0x87')],{'transaction':_0x5bdcca})[_0x4f20('0x29')](function(){if(!_[_0x4f20('0x94')](_0x22d643)){return _0x4b5632[_0x4f20('0x95')](_0x22d643,{'transaction':_0x5bdcca})['then'](function(){return db[_0x4f20('0x7f')][_0x4f20('0x28')]({'where':{'VoiceQueueId':_0x1e5357['params']['id'],'UserId':_0x22d643},'transaction':_0x5bdcca});});}})[_0x4f20('0x29')](function(){_0x22d643[_0x4f20('0x76')](function(_0x159e63){socket[_0x4f20('0x85')]('userVoiceQueue:remove',{'UserId':_0x159e63,'VoiceQueueId':_0x4b5632['id']});});});});});});})[_0x4f20('0x29')](respondWithStatusCode(_0x3f5048,null))[_0x4f20('0x5a')](handleError(_0x3f5048,null));};exports[_0x4f20('0x96')]=function(_0x33f259,_0x44ea58,_0x1c39dd){var _0x434364,_0x116269;return db[_0x4f20('0x3a')][_0x4f20('0x30')]({'where':{'id':_0x33f259[_0x4f20('0x51')]['id']}})['then'](handleEntityNotFound(_0x44ea58,null))[_0x4f20('0x29')](function(_0x346b47){if(_0x346b47){_0x116269=_0x346b47;return _0x346b47[_0x4f20('0x96')](_0x33f259['body']['ids'],_[_0x4f20('0x5e')](_0x33f259[_0x4f20('0x55')],[_0x4f20('0x87'),'id'])||{})['spread'](function(_0x2a9bdb){for(var _0x1705aa=0x0;_0x1705aa<_0x33f259[_0x4f20('0x55')][_0x4f20('0x87')][_0x4f20('0x43')];_0x1705aa+=0x1){socket[_0x4f20('0x85')]('userVoiceQueue:save',{'UserId':Number(_0x33f259[_0x4f20('0x55')]['ids'][_0x1705aa]),'VoiceQueueId':Number(_0x33f259['params']['id'])});}return _0x2a9bdb;});}})[_0x4f20('0x29')](function(_0x3c02a4){_0x434364=_0x3c02a4||[];if(_0x116269){return db[_0x4f20('0x88')][_0x4f20('0x4e')]({'where':{'id':_0x33f259[_0x4f20('0x55')][_0x4f20('0x87')]},'attributes':['id','name','online','voicePause',_0x4f20('0x82')],'raw':!![]});}})['then'](function(_0x40d5df){if(!_[_0x4f20('0x94')](_0x40d5df)){var _0x52e7d9=[];for(var _0x909c16=0x0;_0x909c16<_0x40d5df[_0x4f20('0x43')];_0x909c16++){if(_0x40d5df[_0x909c16][_0x4f20('0x73')]){_0x52e7d9['push'](db['UserVoiceQueueRt'][_0x4f20('0x80')]({'membername':_0x40d5df[_0x909c16][_0x4f20('0x33')],'UserId':_0x40d5df[_0x909c16]['id'],'queue_name':_0x116269[_0x4f20('0x33')],'VoiceQueueId':_0x116269['id'],'interface':_[_0x4f20('0x81')](_0x40d5df[_0x909c16][_0x4f20('0x82')])?util[_0x4f20('0x83')](_0x4f20('0x84'),_0x40d5df[_0x909c16]['name']):_0x40d5df[_0x909c16]['interface'],'paused':_0x40d5df[_0x909c16][_0x4f20('0x74')]||![],'penalty':_0x33f259['body'][_0x4f20('0x77')]||0x0}));}}return BPromise[_0x4f20('0x91')](_0x52e7d9);}})['then'](function(){return _0x434364;})[_0x4f20('0x29')](respondWithResult(_0x44ea58,null))[_0x4f20('0x5a')](handleError(_0x44ea58,null));};exports[_0x4f20('0x95')]=function(_0x38aa56,_0x1f7ea1,_0x359790){return db['VoiceQueue'][_0x4f20('0x30')]({'where':{'id':_0x38aa56[_0x4f20('0x51')]['id']}})[_0x4f20('0x29')](handleEntityNotFound(_0x1f7ea1,null))[_0x4f20('0x29')](function(_0x5500c9){if(_0x5500c9){return _0x5500c9[_0x4f20('0x95')](_0x38aa56[_0x4f20('0x3e')][_0x4f20('0x87')])[_0x4f20('0x29')](function(){if(_[_0x4f20('0x97')](_0x38aa56[_0x4f20('0x3e')][_0x4f20('0x87')])){for(var _0x25490e=0x0;_0x25490e<_0x38aa56[_0x4f20('0x3e')][_0x4f20('0x87')][_0x4f20('0x43')];_0x25490e+=0x1){socket['emit'](_0x4f20('0x98'),{'UserId':Number(_0x38aa56[_0x4f20('0x3e')][_0x4f20('0x87')][_0x25490e]),'VoiceQueueId':Number(_0x38aa56[_0x4f20('0x51')]['id'])});}}else{socket[_0x4f20('0x85')](_0x4f20('0x98'),{'UserId':Number(_0x38aa56[_0x4f20('0x3e')][_0x4f20('0x87')]),'VoiceQueueId':Number(_0x38aa56[_0x4f20('0x51')]['id'])});}});}})[_0x4f20('0x29')](function(_0x4b97cd){return db[_0x4f20('0x7f')][_0x4f20('0x28')]({'where':{'VoiceQueueId':_0x38aa56[_0x4f20('0x51')]['id'],'UserId':_0x38aa56['query'][_0x4f20('0x87')]}})[_0x4f20('0x29')](function(){return _0x4b97cd;});})[_0x4f20('0x29')](respondWithStatusCode(_0x1f7ea1,null))[_0x4f20('0x5a')](handleError(_0x1f7ea1,null));};exports[_0x4f20('0x99')]=function(_0x20e98f,_0x548825,_0x30e873){var _0xed32d3={};var _0x425d7e={};var _0x1c6e9a;var _0x1b1adc;return db[_0x4f20('0x3a')][_0x4f20('0x64')]({'where':{'id':_0x20e98f[_0x4f20('0x51')]['id']}})[_0x4f20('0x29')](handleEntityNotFound(_0x548825,null))[_0x4f20('0x29')](function(_0x27aa7f){if(_0x27aa7f){_0x1c6e9a=_0x27aa7f;_0x425d7e[_0x4f20('0x3d')]=_['keys'](db[_0x4f20('0x88')][_0x4f20('0x53')]);_0x425d7e[_0x4f20('0x3e')]=_[_0x4f20('0x52')](_0x20e98f[_0x4f20('0x3e')]);_0x425d7e[_0x4f20('0x3f')]=_['intersection'](_0x425d7e['model'],_0x425d7e[_0x4f20('0x3e')]);_0xed32d3[_0x4f20('0x42')]=_[_0x4f20('0x40')](_0x425d7e[_0x4f20('0x3d')],qs[_0x4f20('0x41')](_0x20e98f[_0x4f20('0x3e')]['fields']));_0xed32d3[_0x4f20('0x42')]=_0xed32d3[_0x4f20('0x42')][_0x4f20('0x43')]?_0xed32d3[_0x4f20('0x42')]:_0x425d7e[_0x4f20('0x3d')];_0xed32d3[_0x4f20('0x44')]=qs[_0x4f20('0x45')](_0x20e98f['query'][_0x4f20('0x45')]);_0xed32d3[_0x4f20('0x46')]=qs[_0x4f20('0x3f')](_[_0x4f20('0x6b')](_0x20e98f[_0x4f20('0x3e')],_0x425d7e['filters']));if(_0x20e98f[_0x4f20('0x3e')][_0x4f20('0x49')]){_0xed32d3[_0x4f20('0x46')]=_[_0x4f20('0x47')](_0xed32d3['where'],{'$or':_[_0x4f20('0x39')](_0xed32d3['attributes'],function(_0x236178){var _0x26330a={};_0x26330a[_0x236178]={'$like':'%'+_0x20e98f['query'][_0x4f20('0x49')]+'%'};return _0x26330a;})});}_0xed32d3=_[_0x4f20('0x47')]({},_0xed32d3,_0x20e98f[_0x4f20('0x4a')]);return _0x1c6e9a[_0x4f20('0x99')](_0xed32d3);}})[_0x4f20('0x29')](function(_0xe6e844){if(_0xe6e844){_0x1b1adc=_0xe6e844[_0x4f20('0x43')];if(!_0x20e98f[_0x4f20('0x3e')][_0x4f20('0x69')](_0x4f20('0x6a'))){_0xed32d3[_0x4f20('0x23')]=qs['limit'](_0x20e98f[_0x4f20('0x3e')][_0x4f20('0x23')]);_0xed32d3['offset']=qs['offset'](_0x20e98f[_0x4f20('0x3e')][_0x4f20('0x21')]);}return _0x1c6e9a[_0x4f20('0x99')](_0xed32d3);}})[_0x4f20('0x29')](function(_0x5de5de){if(_0x5de5de){return _0x5de5de?{'count':_0x1b1adc,'rows':_0x5de5de}:null;}})['then'](respondWithResult(_0x548825,null))[_0x4f20('0x5a')](handleError(_0x548825,null));};exports[_0x4f20('0x9a')]=function(_0x32c0b1,_0x28376a,_0x92a707){var _0x31aa81={};var _0x1a2b5c={};var _0x403725;var _0x44befa;return db[_0x4f20('0x3a')]['findOne']({'where':{'id':_0x32c0b1[_0x4f20('0x51')]['id']}})[_0x4f20('0x29')](handleEntityNotFound(_0x28376a,null))[_0x4f20('0x29')](function(_0x3d645d){if(_0x3d645d){_0x403725=_0x3d645d;_0x1a2b5c[_0x4f20('0x3d')]=_[_0x4f20('0x52')](db[_0x4f20('0x7f')]['rawAttributes']);_0x1a2b5c[_0x4f20('0x3e')]=_['keys'](_0x32c0b1['query']);_0x1a2b5c[_0x4f20('0x3f')]=_[_0x4f20('0x40')](_0x1a2b5c[_0x4f20('0x3d')],_0x1a2b5c[_0x4f20('0x3e')]);_0x31aa81[_0x4f20('0x42')]=_['intersection'](_0x1a2b5c[_0x4f20('0x3d')],qs[_0x4f20('0x41')](_0x32c0b1[_0x4f20('0x3e')][_0x4f20('0x41')]));_0x31aa81[_0x4f20('0x42')]=_0x31aa81['attributes'][_0x4f20('0x43')]?_0x31aa81[_0x4f20('0x42')]:_0x1a2b5c[_0x4f20('0x3d')];_0x31aa81[_0x4f20('0x44')]=qs[_0x4f20('0x45')](_0x32c0b1[_0x4f20('0x3e')][_0x4f20('0x45')]);_0x31aa81['where']=qs[_0x4f20('0x3f')](_['pick'](_0x32c0b1['query'],_0x1a2b5c['filters']));if(_0x32c0b1[_0x4f20('0x3e')][_0x4f20('0x49')]){_0x31aa81[_0x4f20('0x46')]=_[_0x4f20('0x47')](_0x31aa81[_0x4f20('0x46')],{'$or':_[_0x4f20('0x39')](_0x31aa81[_0x4f20('0x42')],function(_0x5a94ee){var _0x1c4bab={};_0x1c4bab[_0x5a94ee]={'$like':'%'+_0x32c0b1[_0x4f20('0x3e')][_0x4f20('0x49')]+'%'};return _0x1c4bab;})});}_0x31aa81=_[_0x4f20('0x47')]({},_0x31aa81,_0x32c0b1[_0x4f20('0x4a')]);return _0x403725[_0x4f20('0x9a')](_0x31aa81);}})['then'](function(_0x3a081b){if(_0x3a081b){_0x44befa=_0x3a081b[_0x4f20('0x43')];if(!_0x32c0b1[_0x4f20('0x3e')]['hasOwnProperty'](_0x4f20('0x6a'))){_0x31aa81[_0x4f20('0x23')]=qs[_0x4f20('0x23')](_0x32c0b1[_0x4f20('0x3e')][_0x4f20('0x23')]);_0x31aa81[_0x4f20('0x21')]=qs[_0x4f20('0x21')](_0x32c0b1['query'][_0x4f20('0x21')]);}return _0x403725[_0x4f20('0x9a')](_0x31aa81);}})[_0x4f20('0x29')](function(_0x5f2a98){return _0x5f2a98?{'count':_0x44befa,'rows':_0x5f2a98}:null;})['then'](respondWithResult(_0x28376a,null))[_0x4f20('0x5a')](handleError(_0x28376a,null));};exports[_0x4f20('0x9b')]=function(_0x3f8cd4,_0x3ae83b,_0x503f7c){var _0x25b51c={};var _0xe67271={};var _0x148b26;var _0x552c19;return db[_0x4f20('0x3a')][_0x4f20('0x64')]({'where':{'id':_0x3f8cd4[_0x4f20('0x51')]['id']}})['then'](handleEntityNotFound(_0x3ae83b,null))[_0x4f20('0x29')](function(_0x14f5c1){if(_0x14f5c1){_0x148b26=_0x14f5c1;_0xe67271[_0x4f20('0x3d')]=_[_0x4f20('0x52')](db[_0x4f20('0x9c')]['rawAttributes']);_0xe67271[_0x4f20('0x3e')]=_['keys'](_0x3f8cd4[_0x4f20('0x3e')]);_0xe67271[_0x4f20('0x3f')]=_[_0x4f20('0x40')](_0xe67271[_0x4f20('0x3d')],_0xe67271[_0x4f20('0x3e')]);_0x25b51c['attributes']=_['intersection'](_0xe67271[_0x4f20('0x3d')],qs[_0x4f20('0x41')](_0x3f8cd4[_0x4f20('0x3e')]['fields']));_0x25b51c[_0x4f20('0x42')]=_0x25b51c[_0x4f20('0x42')][_0x4f20('0x43')]?_0x25b51c[_0x4f20('0x42')]:_0xe67271[_0x4f20('0x3d')];_0x25b51c[_0x4f20('0x44')]=qs[_0x4f20('0x45')](_0x3f8cd4[_0x4f20('0x3e')][_0x4f20('0x45')]);_0x25b51c['where']=qs[_0x4f20('0x3f')](_[_0x4f20('0x6b')](_0x3f8cd4[_0x4f20('0x3e')],_0xe67271[_0x4f20('0x3f')]));if(_0x3f8cd4[_0x4f20('0x3e')]['filter']){_0x25b51c[_0x4f20('0x46')]=_[_0x4f20('0x47')](_0x25b51c[_0x4f20('0x46')],{'$or':_[_0x4f20('0x39')](_0x25b51c[_0x4f20('0x42')],function(_0x112ec7){var _0x43d402={};_0x43d402[_0x112ec7]={'$like':'%'+_0x3f8cd4[_0x4f20('0x3e')][_0x4f20('0x49')]+'%'};return _0x43d402;})});}_0x25b51c=_[_0x4f20('0x47')]({},_0x25b51c,_0x3f8cd4['options']);return _0x148b26[_0x4f20('0x9b')](_0x25b51c);}})[_0x4f20('0x29')](function(_0x12d404){if(_0x12d404){_0x552c19=_0x12d404[_0x4f20('0x43')];if(!_0x3f8cd4[_0x4f20('0x3e')]['hasOwnProperty'](_0x4f20('0x6a'))){_0x25b51c[_0x4f20('0x23')]=qs[_0x4f20('0x23')](_0x3f8cd4['query'][_0x4f20('0x23')]);_0x25b51c[_0x4f20('0x21')]=qs['offset'](_0x3f8cd4['query'][_0x4f20('0x21')]);}return _0x148b26[_0x4f20('0x9b')](_0x25b51c);}})[_0x4f20('0x29')](function(_0x274c2d){if(_0x274c2d){return _0x274c2d?{'count':_0x552c19,'rows':_0x274c2d}:null;}})['then'](respondWithResult(_0x3ae83b,null))[_0x4f20('0x5a')](handleError(_0x3ae83b,null));};exports[_0x4f20('0x9d')]=function(_0x2fd73c,_0x2b6af9,_0x104a86){var _0x2e29cc,_0x598e38;return db[_0x4f20('0x3a')]['find']({'where':{'id':_0x2fd73c[_0x4f20('0x51')]['id']}})['then'](handleEntityNotFound(_0x2b6af9,null))[_0x4f20('0x29')](function(_0x5cf2ed){if(_0x5cf2ed){_0x598e38=_0x5cf2ed;return _0x5cf2ed[_0x4f20('0x9d')](_0x2fd73c[_0x4f20('0x55')]['ids'],_[_0x4f20('0x5e')](_0x2fd73c[_0x4f20('0x55')],[_0x4f20('0x87'),'id'])||{});}return null;})[_0x4f20('0x9e')](function(_0x38a739){var _0x131b5d;_0x2e29cc=_0x38a739||[];var _0x1e6a55=[];if(_0x38a739){for(var _0x58fdfa=0x0;_0x58fdfa<_0x38a739['length'];_0x58fdfa+=0x1){var _0x44d7a3=_0x38a739[_0x58fdfa][_0x4f20('0x2a')]({'plain':!![]});_0x598e38[_0x4f20('0x9f')]=_0x2fd73c[_0x4f20('0x55')][_0x4f20('0x9f')]?_0x2fd73c[_0x4f20('0x55')][_0x4f20('0x9f')]:_0x598e38['dialCheckDuplicateType'];switch(_0x598e38[_0x4f20('0x9f')]){case _0x4f20('0xa0'):_0x131b5d=squel[_0x4f20('0xa1')]()[_0x4f20('0xa2')](_0x4f20('0xa3'))['fromQuery'](['phone','scheduledAt',_0x4f20('0xa4'),_0x4f20('0xa5'),_0x4f20('0x66'),_0x4f20('0x60'),_0x4f20('0x5f')],squel[_0x4f20('0xa6')]()[_0x4f20('0x89')](_0x4f20('0xa7'),'phone')[_0x4f20('0x89')]('NOW()',_0x4f20('0xa8'))[_0x4f20('0x89')]('id',_0x4f20('0xa4'))[_0x4f20('0x89')](_0x44d7a3[_0x4f20('0xa9')][_0x4f20('0xaa')](),_0x4f20('0xa5'))[_0x4f20('0x89')](_0x2fd73c[_0x4f20('0x51')]['id'][_0x4f20('0xaa')](),_0x4f20('0x66'))[_0x4f20('0x89')](_0x4f20('0xab'),_0x4f20('0x60'))[_0x4f20('0x89')](_0x4f20('0xab'),_0x4f20('0x5f'))[_0x4f20('0x8a')](_0x4f20('0xac'))[_0x4f20('0x46')]('deletedAt\x20IS\x20NULL')[_0x4f20('0x46')](_0x4f20('0xad'),_0x44d7a3[_0x4f20('0xa9')][_0x4f20('0xaa')]())[_0x4f20('0x46')](_0x4f20('0xae'))['where'](_0x4f20('0xaf'),squel[_0x4f20('0xa6')]()[_0x4f20('0x89')](_0x4f20('0xb0'))[_0x4f20('0x8a')](_0x4f20('0xb1'))[_0x4f20('0x46')](_0x4f20('0xb2'),_0x2fd73c['params']['id'][_0x4f20('0xaa')]()))['where'](_0x4f20('0xaf'),squel[_0x4f20('0xa6')]()[_0x4f20('0x89')]('COALESCE(phone,\x27\x27)')[_0x4f20('0x8a')](_0x4f20('0xa3'))[_0x4f20('0x46')](_0x4f20('0xb2'),_0x2fd73c[_0x4f20('0x51')]['id']['toString']())))['toString']();break;case _0x4f20('0xb3'):_0x131b5d=squel[_0x4f20('0xa1')]()['into'](_0x4f20('0xa3'))[_0x4f20('0xb4')]([_0x4f20('0xa7'),_0x4f20('0xa8'),_0x4f20('0xa4'),'ListId',_0x4f20('0x66'),_0x4f20('0x60'),'updatedAt'],squel[_0x4f20('0xa6')]()[_0x4f20('0x89')]('phone','phone')[_0x4f20('0x89')]('NOW()',_0x4f20('0xa8'))[_0x4f20('0x89')]('id',_0x4f20('0xa4'))['field'](_0x44d7a3[_0x4f20('0xa9')][_0x4f20('0xaa')](),'ListId')['field'](_0x2fd73c['params']['id'][_0x4f20('0xaa')](),'VoiceQueueId')[_0x4f20('0x89')](_0x4f20('0xab'),'createdAt')[_0x4f20('0x89')](_0x4f20('0xab'),_0x4f20('0x5f'))[_0x4f20('0x8a')](_0x4f20('0xac'))[_0x4f20('0x46')](_0x4f20('0xb5'))['where'](_0x4f20('0xad'),_0x44d7a3[_0x4f20('0xa9')]['toString']())[_0x4f20('0x46')](_0x4f20('0xae'))[_0x4f20('0x46')](_0x4f20('0xaf'),squel[_0x4f20('0xa6')]()['field'](_0x4f20('0xb6'))[_0x4f20('0x8a')]('cm_hopper')['where']('VoiceQueueId\x20=\x20?',_0x2fd73c[_0x4f20('0x51')]['id']['toString']())))[_0x4f20('0xaa')]();break;default:_0x131b5d=squel[_0x4f20('0xa1')]()[_0x4f20('0xa2')](_0x4f20('0xa3'))['fromQuery']([_0x4f20('0xa7'),'scheduledAt',_0x4f20('0xa4'),_0x4f20('0xa5'),_0x4f20('0x66'),_0x4f20('0x60'),_0x4f20('0x5f')],squel[_0x4f20('0xa6')]()[_0x4f20('0x89')]('phone',_0x4f20('0xa7'))[_0x4f20('0x89')](_0x4f20('0xab'),'scheduledAt')['field']('id','ContactId')['field'](_0x44d7a3['CmListId'][_0x4f20('0xaa')](),_0x4f20('0xa5'))[_0x4f20('0x89')](_0x2fd73c[_0x4f20('0x51')]['id']['toString'](),_0x4f20('0x66'))[_0x4f20('0x89')](_0x4f20('0xab'),_0x4f20('0x60'))[_0x4f20('0x89')]('NOW()',_0x4f20('0x5f'))['from'](_0x4f20('0xac'))[_0x4f20('0x46')](_0x4f20('0xb5'))[_0x4f20('0x46')](_0x4f20('0xad'),_0x44d7a3['CmListId']['toString']())[_0x4f20('0x46')](_0x4f20('0xae')))[_0x4f20('0xaa')]();}_0x1e6a55[_0x4f20('0x8e')](db[_0x4f20('0x78')]['query'](_0x131b5d));}return BPromise[_0x4f20('0x91')](_0x1e6a55);}})[_0x4f20('0x29')](function(){return _0x2e29cc;})[_0x4f20('0x29')](respondWithResult(_0x2b6af9,null))['catch'](handleError(_0x2b6af9,null));};exports[_0x4f20('0xb7')]=function(_0x586ad5,_0x46b35d,_0x56a733){return db[_0x4f20('0x3a')][_0x4f20('0x30')]({'where':{'id':_0x586ad5['params']['id']}})['then'](handleEntityNotFound(_0x46b35d,null))[_0x4f20('0x29')](function(_0x5853ab){if(_0x5853ab){return _0x5853ab[_0x4f20('0xb7')](_0x586ad5[_0x4f20('0x3e')][_0x4f20('0x87')]);}})[_0x4f20('0x29')](function(_0x41d725){if(_0x41d725){return db[_0x4f20('0x65')][_0x4f20('0x28')]({'where':{'ListId':_0x586ad5[_0x4f20('0x3e')][_0x4f20('0x87')],'VoiceQueueId':_0x586ad5[_0x4f20('0x51')]['id']}})[_0x4f20('0x29')](function(){return _0x41d725;});}})[_0x4f20('0x29')](respondWithStatusCode(_0x46b35d,null))[_0x4f20('0x5a')](handleError(_0x46b35d,null));};exports['getBlackLists']=function(_0x311de3,_0x56f03e,_0x35b953){var _0x222a97={};var _0x10ee09={};var _0x8cab0d;var _0x47a238;return db['VoiceQueue'][_0x4f20('0x64')]({'where':{'id':_0x311de3[_0x4f20('0x51')]['id']}})[_0x4f20('0x29')](handleEntityNotFound(_0x56f03e,null))[_0x4f20('0x29')](function(_0xb3053e){if(_0xb3053e){_0x8cab0d=_0xb3053e;_0x10ee09['model']=_[_0x4f20('0x52')](db[_0x4f20('0x9c')]['rawAttributes']);_0x10ee09[_0x4f20('0x3e')]=_[_0x4f20('0x52')](_0x311de3['query']);_0x10ee09[_0x4f20('0x3f')]=_[_0x4f20('0x40')](_0x10ee09[_0x4f20('0x3d')],_0x10ee09[_0x4f20('0x3e')]);_0x222a97['attributes']=_['intersection'](_0x10ee09[_0x4f20('0x3d')],qs[_0x4f20('0x41')](_0x311de3[_0x4f20('0x3e')][_0x4f20('0x41')]));_0x222a97[_0x4f20('0x42')]=_0x222a97[_0x4f20('0x42')][_0x4f20('0x43')]?_0x222a97[_0x4f20('0x42')]:_0x10ee09[_0x4f20('0x3d')];_0x222a97[_0x4f20('0x44')]=qs['sort'](_0x311de3['query'][_0x4f20('0x45')]);_0x222a97['where']=qs[_0x4f20('0x3f')](_[_0x4f20('0x6b')](_0x311de3[_0x4f20('0x3e')],_0x10ee09[_0x4f20('0x3f')]));if(_0x311de3[_0x4f20('0x3e')][_0x4f20('0x49')]){_0x222a97[_0x4f20('0x46')]=_['merge'](_0x222a97['where'],{'$or':_[_0x4f20('0x39')](_0x222a97[_0x4f20('0x42')],function(_0x1bade9){var _0x3568ab={};_0x3568ab[_0x1bade9]={'$like':'%'+_0x311de3[_0x4f20('0x3e')][_0x4f20('0x49')]+'%'};return _0x3568ab;})});}_0x222a97=_[_0x4f20('0x47')]({},_0x222a97,_0x311de3[_0x4f20('0x4a')]);return _0x8cab0d[_0x4f20('0xb8')](_0x222a97);}})['then'](function(_0x838476){if(_0x838476){_0x47a238=_0x838476[_0x4f20('0x43')];if(!_0x311de3[_0x4f20('0x3e')][_0x4f20('0x69')]('nolimit')){_0x222a97['limit']=qs[_0x4f20('0x23')](_0x311de3['query'][_0x4f20('0x23')]);_0x222a97[_0x4f20('0x21')]=qs[_0x4f20('0x21')](_0x311de3['query'][_0x4f20('0x21')]);}return _0x8cab0d[_0x4f20('0xb8')](_0x222a97);}})[_0x4f20('0x29')](function(_0x3be5fb){if(_0x3be5fb){return _0x3be5fb?{'count':_0x47a238,'rows':_0x3be5fb}:null;}})['then'](respondWithResult(_0x56f03e,null))['catch'](handleError(_0x56f03e,null));};exports['addBlackLists']=function(_0x9d73ac,_0x5f560a,_0x2e491c){var _0x35422b,_0x295956;return db[_0x4f20('0x3a')][_0x4f20('0x30')]({'where':{'id':_0x9d73ac[_0x4f20('0x51')]['id']}})[_0x4f20('0x29')](handleEntityNotFound(_0x5f560a,null))[_0x4f20('0x29')](function(_0x3ba883){if(_0x3ba883){_0x295956=_0x3ba883;return _0x3ba883[_0x4f20('0xb9')](_0x9d73ac[_0x4f20('0x55')][_0x4f20('0x87')],_[_0x4f20('0x5e')](_0x9d73ac[_0x4f20('0x55')],[_0x4f20('0x87'),'id'])||{});}return null;})['spread'](function(_0x5db091){var _0x3bc4d7;_0x35422b=_0x5db091||[];var _0x12cef6=[];if(_0x5db091){for(var _0x1431dc=0x0;_0x1431dc<_0x5db091['length'];_0x1431dc+=0x1){var _0xe434a8=_0x5db091[_0x1431dc][_0x4f20('0x2a')]({'plain':!![]});_0x3bc4d7=squel[_0x4f20('0xa1')]()[_0x4f20('0xa2')](_0x4f20('0xba'))[_0x4f20('0xb4')]([_0x4f20('0xa7'),'ContactId',_0x4f20('0xa5'),_0x4f20('0x66'),_0x4f20('0x60'),_0x4f20('0x5f')],squel['select']()[_0x4f20('0x89')](_0x4f20('0xa7'),_0x4f20('0xa7'))[_0x4f20('0x89')]('id','ContactId')[_0x4f20('0x89')](_0xe434a8['CmListId'][_0x4f20('0xaa')](),_0x4f20('0xa5'))[_0x4f20('0x89')](_0x9d73ac[_0x4f20('0x51')]['id'][_0x4f20('0xaa')](),_0x4f20('0x66'))[_0x4f20('0x89')](_0x4f20('0xab'),_0x4f20('0x60'))['field'](_0x4f20('0xab'),_0x4f20('0x5f'))['from'](_0x4f20('0xac'))[_0x4f20('0x46')](_0x4f20('0xb5'))[_0x4f20('0x46')](_0x4f20('0xad'),_0xe434a8['CmListId'][_0x4f20('0xaa')]())[_0x4f20('0x46')](_0x4f20('0xae')))[_0x4f20('0xaa')]();_0x12cef6[_0x4f20('0x8e')](db['sequelize']['query'](_0x3bc4d7));}return BPromise[_0x4f20('0x91')](_0x12cef6);}})[_0x4f20('0x29')](function(){return _0x35422b;})[_0x4f20('0x29')](respondWithResult(_0x5f560a,null))[_0x4f20('0x5a')](handleError(_0x5f560a,null));};exports[_0x4f20('0xbb')]=function(_0x91fc92,_0x46eef0,_0x2f1757){return db[_0x4f20('0x3a')]['find']({'where':{'id':_0x91fc92[_0x4f20('0x51')]['id']}})[_0x4f20('0x29')](handleEntityNotFound(_0x46eef0,null))[_0x4f20('0x29')](function(_0xe1182f){if(_0xe1182f){return _0xe1182f[_0x4f20('0xbb')](_0x91fc92['query'][_0x4f20('0x87')]);}})[_0x4f20('0x29')](function(_0x5a9de4){if(_0x5a9de4){return db[_0x4f20('0x6f')][_0x4f20('0x28')]({'where':{'ListId':_0x91fc92['query'][_0x4f20('0x87')],'VoiceQueueId':_0x91fc92[_0x4f20('0x51')]['id']}})[_0x4f20('0x29')](function(){return _0x5a9de4;});}})[_0x4f20('0x29')](respondWithStatusCode(_0x46eef0,null))[_0x4f20('0x5a')](handleError(_0x46eef0,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 52ab57c..43aa848 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 _0xc207=['remove','emit','hook','exports','../../mysqldb','VoiceQueue','save','update'];(function(_0x4afdb1,_0x3881f8){var _0x90bdf2=function(_0x1ed64c){while(--_0x1ed64c){_0x4afdb1['push'](_0x4afdb1['shift']());}};_0x90bdf2(++_0x3881f8);}(_0xc207,0x18c));var _0x7c20=function(_0x4421a0,_0x1525bc){_0x4421a0=_0x4421a0-0x0;var _0x5626d0=_0xc207[_0x4421a0];return _0x5626d0;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x7c20('0x0'))['db'][_0x7c20('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7c20('0x2'),'afterUpdate':_0x7c20('0x3'),'afterDestroy':_0x7c20('0x4')};function emitEvent(_0x30e7fb){return function(_0x2357c0,_0xc454bd,_0x3e5282){VoiceQueueEvents['emit'](_0x30e7fb+':'+_0x2357c0['id'],_0x2357c0);VoiceQueueEvents[_0x7c20('0x5')](_0x30e7fb,_0x2357c0);_0x3e5282(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x7c20('0x6')](e,emitEvent(event));}}module[_0x7c20('0x7')]=VoiceQueueEvents; \ No newline at end of file +var _0x06be=['hook','events','../../mysqldb','update','remove','emit'];(function(_0x35e3b8,_0x1f543f){var _0xae5b9a=function(_0x483dd6){while(--_0x483dd6){_0x35e3b8['push'](_0x35e3b8['shift']());}};_0xae5b9a(++_0x1f543f);}(_0x06be,0x163));var _0xe06b=function(_0x6bfe36,_0x561e94){_0x6bfe36=_0x6bfe36-0x0;var _0x493699=_0x06be[_0x6bfe36];return _0x493699;};'use strict';var EventEmitter=require(_0xe06b('0x0'));var VoiceQueue=require(_0xe06b('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xe06b('0x2'),'afterDestroy':_0xe06b('0x3')};function emitEvent(_0x5b7581){return function(_0x2f5ee0,_0x290671,_0x27f132){VoiceQueueEvents['emit'](_0x5b7581+':'+_0x2f5ee0['id'],_0x2f5ee0);VoiceQueueEvents[_0xe06b('0x4')](_0x5b7581,_0x2f5ee0);_0x27f132(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0xe06b('0x5')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 9d6b0f9..7c78dc2 100644 --- a/server/api/voiceQueue/voiceQueue.model.js +++ b/server/api/voiceQueue/voiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['request-promise','path','./voiceQueue.attributes','define','VoiceQueue','voice_queues','../../config/logger','api','moment','bluebird'];(function(_0x30fde3,_0x69fd6){var _0x45703f=function(_0x470c4e){while(--_0x470c4e){_0x30fde3['push'](_0x30fde3['shift']());}};_0x45703f(++_0x69fd6);}(_0x9c44,0x178));var _0x49c4=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x9c44[_0x2d2c16];return _0x53f2fb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c44=['request-promise','path','./voiceQueue.attributes','define','VoiceQueue','voice_queues','../../config/logger','api','moment','bluebird'];(function(_0x32cc93,_0x130b83){var _0x3711c3=function(_0x145fc1){while(--_0x145fc1){_0x32cc93['push'](_0x32cc93['shift']());}};_0x3711c3(++_0x130b83);}(_0x9c44,0x178));var _0x49c4=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x9c44[_0x273c39];return _0x46d6b5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 2b6bdeb..5394b88 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 _0x7ce4=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','info','debug','stringify','error','code','VoiceQueue,\x20%s,\x20%s','message','request\x20sent','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','attributes','include','map','model','ShowVoiceQueue','find','lodash','util','bluebird'];(function(_0x5bcf32,_0x40523f){var _0x914a10=function(_0x217a8c){while(--_0x217a8c){_0x5bcf32['push'](_0x5bcf32['shift']());}};_0x914a10(++_0x40523f);}(_0x7ce4,0x1dd));var _0x47ce=function(_0x1416e5,_0x14cbcb){_0x1416e5=_0x1416e5-0x0;var _0x2d765f=_0x7ce4[_0x1416e5];return _0x2d765f;};'use strict';var _=require(_0x47ce('0x0'));var util=require(_0x47ce('0x1'));var moment=require('moment');var BPromise=require(_0x47ce('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x47ce('0x3'));var db=require(_0x47ce('0x4'))['db'];var utils=require(_0x47ce('0x5'));var logger=require(_0x47ce('0x6'))('rpc');var config=require(_0x47ce('0x7'));var jayson=require(_0x47ce('0x8'));var client=jayson[_0x47ce('0x9')][_0x47ce('0xa')]({'port':0x232a});config[_0x47ce('0xb')]=_[_0x47ce('0xc')](config[_0x47ce('0xb')],{'host':_0x47ce('0xd'),'port':0x18eb});var socket=require(_0x47ce('0xe'))(new Redis(config[_0x47ce('0xb')]));require(_0x47ce('0xf'))[_0x47ce('0x10')](socket);function respondWithRpcPromise(_0x4161f5,_0x44419a,_0x65a936){return new BPromise(function(_0x24566c,_0x502501){return client[_0x47ce('0x11')](_0x4161f5,_0x65a936)[_0x47ce('0x12')](function(_0x1dc582){logger[_0x47ce('0x13')]('VoiceQueue,\x20%s,\x20%s',_0x44419a,'request\x20sent');logger[_0x47ce('0x14')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x44419a,'request\x20sent',JSON[_0x47ce('0x15')](_0x1dc582));if(_0x1dc582[_0x47ce('0x16')]){if(_0x1dc582[_0x47ce('0x16')][_0x47ce('0x17')]===0x1f4){logger[_0x47ce('0x16')](_0x47ce('0x18'),_0x44419a,_0x1dc582[_0x47ce('0x16')][_0x47ce('0x19')]);return _0x502501(_0x1dc582[_0x47ce('0x16')][_0x47ce('0x19')]);}logger[_0x47ce('0x16')](_0x47ce('0x18'),_0x44419a,_0x1dc582[_0x47ce('0x16')]['message']);return _0x24566c(_0x1dc582[_0x47ce('0x16')][_0x47ce('0x19')]);}else{logger[_0x47ce('0x13')](_0x47ce('0x18'),_0x44419a,_0x47ce('0x1a'));_0x24566c(_0x1dc582[_0x47ce('0x1b')]['message']);}})[_0x47ce('0x1c')](function(_0x4da201){logger[_0x47ce('0x16')](_0x47ce('0x18'),_0x44419a,_0x4da201);_0x502501(_0x4da201);});});}exports[_0x47ce('0x1d')]=function(_0x5069ac){var _0x4968dc=this;return new Promise(function(_0x5c3e57,_0x26740f){return db[_0x47ce('0x1e')][_0x47ce('0x1f')]({'raw':_0x5069ac[_0x47ce('0x20')]?_0x5069ac[_0x47ce('0x20')][_0x47ce('0x21')]===undefined?!![]:![]:!![],'where':_0x5069ac[_0x47ce('0x20')]?_0x5069ac['options']['where']||null:null,'attributes':_0x5069ac[_0x47ce('0x20')]?_0x5069ac[_0x47ce('0x20')][_0x47ce('0x22')]||null:null,'limit':_0x5069ac['options']?_0x5069ac[_0x47ce('0x20')]['limit']||null:null,'include':_0x5069ac[_0x47ce('0x20')]?_0x5069ac['options'][_0x47ce('0x23')]?_[_0x47ce('0x24')](_0x5069ac[_0x47ce('0x20')][_0x47ce('0x23')],function(_0x62ea2e){return{'model':db[_0x62ea2e[_0x47ce('0x25')]],'as':_0x62ea2e['as'],'attributes':_0x62ea2e[_0x47ce('0x22')],'include':_0x62ea2e[_0x47ce('0x23')]?_[_0x47ce('0x24')](_0x62ea2e[_0x47ce('0x23')],function(_0x37ff53){return{'model':db[_0x37ff53[_0x47ce('0x25')]],'as':_0x37ff53['as'],'attributes':_0x37ff53['attributes'],'include':_0x37ff53['include']?_[_0x47ce('0x24')](_0x37ff53['include'],function(_0x3fa574){return{'model':db[_0x3fa574[_0x47ce('0x25')]],'as':_0x3fa574['as'],'attributes':_0x3fa574[_0x47ce('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2d15fa){logger[_0x47ce('0x13')](_0x47ce('0x1d'),_0x5069ac);logger[_0x47ce('0x14')]('GetVoiceQueue',_0x5069ac,JSON['stringify'](_0x2d15fa));_0x5c3e57(_0x2d15fa);})[_0x47ce('0x1c')](function(_0x396a72){logger[_0x47ce('0x16')]('GetVoiceQueue',_0x396a72[_0x47ce('0x19')],_0x5069ac);_0x26740f(_0x4968dc[_0x47ce('0x16')](0x1f4,_0x396a72[_0x47ce('0x19')]));});});};exports[_0x47ce('0x26')]=function(_0x5c6d4a){var _0x46ee4d=this;return new Promise(function(_0x7d5df9,_0x571e39){return db[_0x47ce('0x1e')][_0x47ce('0x27')]({'raw':_0x5c6d4a[_0x47ce('0x20')]?_0x5c6d4a[_0x47ce('0x20')][_0x47ce('0x21')]===undefined?!![]:![]:!![],'where':_0x5c6d4a[_0x47ce('0x20')]?_0x5c6d4a[_0x47ce('0x20')]['where']||null:null,'attributes':_0x5c6d4a[_0x47ce('0x20')]?_0x5c6d4a['options']['attributes']||null:null,'include':_0x5c6d4a[_0x47ce('0x20')]?_0x5c6d4a[_0x47ce('0x20')][_0x47ce('0x23')]?_[_0x47ce('0x24')](_0x5c6d4a[_0x47ce('0x20')][_0x47ce('0x23')],function(_0x48e372){return{'model':db[_0x48e372[_0x47ce('0x25')]],'as':_0x48e372['as'],'attributes':_0x48e372['attributes'],'include':_0x48e372['include']?_[_0x47ce('0x24')](_0x48e372[_0x47ce('0x23')],function(_0x3af280){return{'model':db[_0x3af280[_0x47ce('0x25')]],'as':_0x3af280['as'],'attributes':_0x3af280[_0x47ce('0x22')],'include':_0x3af280[_0x47ce('0x23')]?_['map'](_0x3af280[_0x47ce('0x23')],function(_0x472f40){return{'model':db[_0x472f40['model']],'as':_0x472f40['as'],'attributes':_0x472f40[_0x47ce('0x22')]};}):[]};}):[]};}):[]:[]})[_0x47ce('0x12')](function(_0x388384){logger[_0x47ce('0x13')](_0x47ce('0x26'),_0x5c6d4a);logger[_0x47ce('0x14')](_0x47ce('0x26'),_0x5c6d4a,JSON[_0x47ce('0x15')](_0x388384));_0x7d5df9(_0x388384);})[_0x47ce('0x1c')](function(_0x2fd36a){logger[_0x47ce('0x16')](_0x47ce('0x26'),_0x2fd36a['message'],_0x5c6d4a);_0x571e39(_0x46ee4d['error'](0x1f4,_0x2fd36a[_0x47ce('0x19')]));});});}; \ No newline at end of file +var _0x9595=['code','error','message','VoiceQueue,\x20%s,\x20%s','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','where','attributes','limit','include','map','model','find','raw','ShowVoiceQueue','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','then','info','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3a7042,_0x13b008){var _0x426247=function(_0x45798f){while(--_0x45798f){_0x3a7042['push'](_0x3a7042['shift']());}};_0x426247(++_0x13b008);}(_0x9595,0x172));var _0x5959=function(_0x2830,_0x56fb48){_0x2830=_0x2830-0x0;var _0x5a7e73=_0x9595[_0x2830];return _0x5a7e73;};'use strict';var _=require('lodash');var util=require(_0x5959('0x0'));var moment=require(_0x5959('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5959('0x2'));var db=require(_0x5959('0x3'))['db'];var utils=require(_0x5959('0x4'));var logger=require(_0x5959('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5959('0x6')][_0x5959('0x7')]({'port':0x232a});config[_0x5959('0x8')]=_[_0x5959('0x9')](config[_0x5959('0x8')],{'host':_0x5959('0xa'),'port':0x18eb});var socket=require(_0x5959('0xb'))(new Redis(config[_0x5959('0x8')]));require(_0x5959('0xc'))[_0x5959('0xd')](socket);function respondWithRpcPromise(_0xcaeab9,_0x43b07d,_0x51d8f4){return new BPromise(function(_0x517994,_0x19f8c5){return client['request'](_0xcaeab9,_0x51d8f4)[_0x5959('0xe')](function(_0x3cb1e8){logger[_0x5959('0xf')]('VoiceQueue,\x20%s,\x20%s',_0x43b07d,_0x5959('0x10'));logger[_0x5959('0x11')](_0x5959('0x12'),_0x43b07d,_0x5959('0x10'),JSON[_0x5959('0x13')](_0x3cb1e8));if(_0x3cb1e8['error']){if(_0x3cb1e8['error'][_0x5959('0x14')]===0x1f4){logger[_0x5959('0x15')]('VoiceQueue,\x20%s,\x20%s',_0x43b07d,_0x3cb1e8[_0x5959('0x15')][_0x5959('0x16')]);return _0x19f8c5(_0x3cb1e8[_0x5959('0x15')]['message']);}logger[_0x5959('0x15')](_0x5959('0x17'),_0x43b07d,_0x3cb1e8[_0x5959('0x15')][_0x5959('0x16')]);return _0x517994(_0x3cb1e8[_0x5959('0x15')][_0x5959('0x16')]);}else{logger[_0x5959('0xf')](_0x5959('0x17'),_0x43b07d,_0x5959('0x10'));_0x517994(_0x3cb1e8[_0x5959('0x18')][_0x5959('0x16')]);}})[_0x5959('0x19')](function(_0x2284c0){logger[_0x5959('0x15')](_0x5959('0x17'),_0x43b07d,_0x2284c0);_0x19f8c5(_0x2284c0);});});}exports[_0x5959('0x1a')]=function(_0x3d7843){var _0x2a1729=this;return new Promise(function(_0x155940,_0x4cef85){return db[_0x5959('0x1b')][_0x5959('0x1c')]({'raw':_0x3d7843[_0x5959('0x1d')]?_0x3d7843[_0x5959('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x3d7843[_0x5959('0x1d')]?_0x3d7843['options'][_0x5959('0x1e')]||null:null,'attributes':_0x3d7843['options']?_0x3d7843[_0x5959('0x1d')][_0x5959('0x1f')]||null:null,'limit':_0x3d7843[_0x5959('0x1d')]?_0x3d7843[_0x5959('0x1d')][_0x5959('0x20')]||null:null,'include':_0x3d7843[_0x5959('0x1d')]?_0x3d7843['options'][_0x5959('0x21')]?_[_0x5959('0x22')](_0x3d7843['options']['include'],function(_0x400377){return{'model':db[_0x400377[_0x5959('0x23')]],'as':_0x400377['as'],'attributes':_0x400377[_0x5959('0x1f')],'include':_0x400377[_0x5959('0x21')]?_[_0x5959('0x22')](_0x400377[_0x5959('0x21')],function(_0xb09b6b){return{'model':db[_0xb09b6b[_0x5959('0x23')]],'as':_0xb09b6b['as'],'attributes':_0xb09b6b['attributes'],'include':_0xb09b6b['include']?_['map'](_0xb09b6b[_0x5959('0x21')],function(_0x31fce3){return{'model':db[_0x31fce3[_0x5959('0x23')]],'as':_0x31fce3['as'],'attributes':_0x31fce3['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f1baa){logger[_0x5959('0xf')](_0x5959('0x1a'),_0x3d7843);logger[_0x5959('0x11')]('GetVoiceQueue',_0x3d7843,JSON[_0x5959('0x13')](_0x4f1baa));_0x155940(_0x4f1baa);})[_0x5959('0x19')](function(_0x55ea8){logger[_0x5959('0x15')](_0x5959('0x1a'),_0x55ea8[_0x5959('0x16')],_0x3d7843);_0x4cef85(_0x2a1729[_0x5959('0x15')](0x1f4,_0x55ea8['message']));});});};exports['ShowVoiceQueue']=function(_0x3ac48f){var _0x157b19=this;return new Promise(function(_0x1fa62e,_0x7062a7){return db[_0x5959('0x1b')][_0x5959('0x24')]({'raw':_0x3ac48f[_0x5959('0x1d')]?_0x3ac48f[_0x5959('0x1d')][_0x5959('0x25')]===undefined?!![]:![]:!![],'where':_0x3ac48f[_0x5959('0x1d')]?_0x3ac48f[_0x5959('0x1d')][_0x5959('0x1e')]||null:null,'attributes':_0x3ac48f[_0x5959('0x1d')]?_0x3ac48f[_0x5959('0x1d')][_0x5959('0x1f')]||null:null,'include':_0x3ac48f[_0x5959('0x1d')]?_0x3ac48f[_0x5959('0x1d')][_0x5959('0x21')]?_['map'](_0x3ac48f[_0x5959('0x1d')][_0x5959('0x21')],function(_0x481a0a){return{'model':db[_0x481a0a[_0x5959('0x23')]],'as':_0x481a0a['as'],'attributes':_0x481a0a[_0x5959('0x1f')],'include':_0x481a0a[_0x5959('0x21')]?_[_0x5959('0x22')](_0x481a0a[_0x5959('0x21')],function(_0xc31d05){return{'model':db[_0xc31d05[_0x5959('0x23')]],'as':_0xc31d05['as'],'attributes':_0xc31d05[_0x5959('0x1f')],'include':_0xc31d05[_0x5959('0x21')]?_['map'](_0xc31d05[_0x5959('0x21')],function(_0x517e6f){return{'model':db[_0x517e6f[_0x5959('0x23')]],'as':_0x517e6f['as'],'attributes':_0x517e6f[_0x5959('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4cdfa7){logger[_0x5959('0xf')](_0x5959('0x26'),_0x3ac48f);logger[_0x5959('0x11')](_0x5959('0x26'),_0x3ac48f,JSON[_0x5959('0x13')](_0x4cdfa7));_0x1fa62e(_0x4cdfa7);})[_0x5959('0x19')](function(_0x36cced){logger[_0x5959('0x15')]('ShowVoiceQueue',_0x36cced[_0x5959('0x16')],_0x3ac48f);_0x7062a7(_0x157b19[_0x5959('0x15')](0x1f4,_0x36cced['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 57d3767..26cfed8 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 _0xd543=['save','update','emit','removeListener','register','length','./voiceQueue.events'];(function(_0x4ff091,_0x94e491){var _0x1bb7f1=function(_0x104e2a){while(--_0x104e2a){_0x4ff091['push'](_0x4ff091['shift']());}};_0x1bb7f1(++_0x94e491);}(_0xd543,0x125));var _0x3d54=function(_0x4e294e,_0x11912f){_0x4e294e=_0x4e294e-0x0;var _0x4bfeb6=_0xd543[_0x4e294e];return _0x4bfeb6;};'use strict';var VoiceQueueEvents=require(_0x3d54('0x0'));var events=[_0x3d54('0x1'),'remove',_0x3d54('0x2')];function createListener(_0x6c95f6,_0x54864b){return function(_0x5d895d){_0x54864b[_0x3d54('0x3')](_0x6c95f6,_0x5d895d);};}function removeListener(_0x489e4a,_0x286beb){return function(){VoiceQueueEvents[_0x3d54('0x4')](_0x489e4a,_0x286beb);};}exports[_0x3d54('0x5')]=function(_0x175224){for(var _0x3d5085=0x0,_0x5a1199=events[_0x3d54('0x6')];_0x3d5085<_0x5a1199;_0x3d5085++){var _0x2c0e35=events[_0x3d5085];var _0x24ddc7=createListener('voiceQueue:'+_0x2c0e35,_0x175224);VoiceQueueEvents['on'](_0x2c0e35,_0x24ddc7);}}; \ No newline at end of file +var _0x2c6e=['removeListener','register','length','voiceQueue:','./voiceQueue.events','remove','update','emit'];(function(_0x362f5e,_0x3d8573){var _0x3083e6=function(_0x1d4e51){while(--_0x1d4e51){_0x362f5e['push'](_0x362f5e['shift']());}};_0x3083e6(++_0x3d8573);}(_0x2c6e,0x1f4));var _0xe2c6=function(_0x4c5641,_0x3c4357){_0x4c5641=_0x4c5641-0x0;var _0x10ed0a=_0x2c6e[_0x4c5641];return _0x10ed0a;};'use strict';var VoiceQueueEvents=require(_0xe2c6('0x0'));var events=['save',_0xe2c6('0x1'),_0xe2c6('0x2')];function createListener(_0x1dd8e7,_0x747840){return function(_0x4aa672){_0x747840[_0xe2c6('0x3')](_0x1dd8e7,_0x4aa672);};}function removeListener(_0x4551c4,_0x3e6807){return function(){VoiceQueueEvents[_0xe2c6('0x4')](_0x4551c4,_0x3e6807);};}exports[_0xe2c6('0x5')]=function(_0x3a0fbd){for(var _0x2ebfc3=0x0,_0x1b9a69=events[_0xe2c6('0x6')];_0x2ebfc3<_0x1b9a69;_0x2ebfc3++){var _0x235fa8=events[_0x2ebfc3];var _0x29c18e=createListener(_0xe2c6('0x7')+_0x235fa8,_0x3a0fbd);VoiceQueueEvents['on'](_0x235fa8,_0x29c18e);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 0f80dca..c127f75 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 _0xc652=['getVoiceQueuesReport','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./voiceQueueReport.controller','get','isAuthenticated','index','/describe'];(function(_0x3c7ec9,_0x7e16ff){var _0x4e925e=function(_0x377ffa){while(--_0x377ffa){_0x3c7ec9['push'](_0x3c7ec9['shift']());}};_0x4e925e(++_0x7e16ff);}(_0xc652,0x86));var _0x2c65=function(_0x5b34c0,_0x3ad403){_0x5b34c0=_0x5b34c0-0x0;var _0x242bd3=_0xc652[_0x5b34c0];return _0x242bd3;};'use strict';var multer=require(_0x2c65('0x0'));var util=require(_0x2c65('0x1'));var path=require(_0x2c65('0x2'));var timeout=require(_0x2c65('0x3'));var express=require(_0x2c65('0x4'));var router=express[_0x2c65('0x5')]();var fs_extra=require(_0x2c65('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x2c65('0x7'));var config=require('../../config/environment');var controller=require(_0x2c65('0x8'));router[_0x2c65('0x9')]('/',auth[_0x2c65('0xa')](),controller[_0x2c65('0xb')]);router['get'](_0x2c65('0xc'),auth[_0x2c65('0xa')](),controller['describe']);router[_0x2c65('0x9')]('/index',auth[_0x2c65('0xa')](),controller[_0x2c65('0xd')]);router[_0x2c65('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x2c65('0xe')]('/',auth[_0x2c65('0xa')](),controller[_0x2c65('0xf')]);router[_0x2c65('0x10')](_0x2c65('0x11'),auth['isAuthenticated'](),controller[_0x2c65('0x12')]);router[_0x2c65('0x13')](_0x2c65('0x11'),auth['isAuthenticated'](),controller[_0x2c65('0x14')]);module['exports']=router; \ No newline at end of file +var _0xf3f1=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','index','get','/describe','isAuthenticated','describe','/index','getVoiceQueuesReport','/:id','post','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra'];(function(_0x16a223,_0x31b6e8){var _0x5ded66=function(_0x25eb5f){while(--_0x25eb5f){_0x16a223['push'](_0x16a223['shift']());}};_0x5ded66(++_0x31b6e8);}(_0xf3f1,0x17b));var _0x1f3f=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xf3f1[_0x543084];return _0x306a57;};'use strict';var multer=require('multer');var util=require(_0x1f3f('0x0'));var path=require('path');var timeout=require(_0x1f3f('0x1'));var express=require(_0x1f3f('0x2'));var router=express[_0x1f3f('0x3')]();var fs_extra=require(_0x1f3f('0x4'));var auth=require(_0x1f3f('0x5'));var interaction=require(_0x1f3f('0x6'));var config=require(_0x1f3f('0x7'));var controller=require(_0x1f3f('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x1f3f('0x9')]);router[_0x1f3f('0xa')](_0x1f3f('0xb'),auth[_0x1f3f('0xc')](),controller[_0x1f3f('0xd')]);router[_0x1f3f('0xa')](_0x1f3f('0xe'),auth[_0x1f3f('0xc')](),controller[_0x1f3f('0xf')]);router[_0x1f3f('0xa')](_0x1f3f('0x10'),auth[_0x1f3f('0xc')](),controller['show']);router[_0x1f3f('0x11')]('/',auth[_0x1f3f('0xc')](),controller[_0x1f3f('0x12')]);router[_0x1f3f('0x13')](_0x1f3f('0x10'),auth[_0x1f3f('0xc')](),controller[_0x1f3f('0x14')]);router[_0x1f3f('0x15')](_0x1f3f('0x10'),auth[_0x1f3f('0xc')](),controller[_0x1f3f('0x16')]);module[_0x1f3f('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 091bded..a5cef40 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 _0xd03c=['seconds','setDataValue','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff'];(function(_0x3b3e01,_0x2e7761){var _0x4ad9f6=function(_0x8c7f4f){while(--_0x8c7f4f){_0x3b3e01['push'](_0x3b3e01['shift']());}};_0x4ad9f6(++_0x2e7761);}(_0xd03c,0x6f));var _0xcd03=function(_0x409562,_0x4fc288){_0x409562=_0x409562-0x0;var _0x425ffa=_0xd03c[_0x409562];return _0x425ffa;};'use strict';var Sequelize=require(_0xcd03('0x0'));var moment=require('moment');module[_0xcd03('0x1')]={'type':{'type':Sequelize[_0xcd03('0x2')]},'uniqueid':{'type':Sequelize[_0xcd03('0x2')]},'calleridnum':{'type':Sequelize[_0xcd03('0x2')]},'calleridname':{'type':Sequelize[_0xcd03('0x2')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0xcd03('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0xcd03('0x3')],'set':function(_0x3fb7f7){var _0x546271=moment(_0x3fb7f7);var _0x230847=moment(this[_0xcd03('0x4')](_0xcd03('0x5')))[_0xcd03('0x6')](_0xcd03('0x7'));var _0x1df0cc=_0x546271[_0xcd03('0x8')](_0x230847,_0xcd03('0x9'));this['setDataValue']('queuecallerleaveAt',_0x3fb7f7);this[_0xcd03('0xa')](_0xcd03('0xb'),_0x1df0cc||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0xcd03('0xc')]},'queuecallerabandon':{'type':Sequelize[_0xcd03('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xcd03('0x3')]},'queuecallercomplete':{'type':Sequelize[_0xcd03('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xcd03('0x3')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0xcd03('0x2')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0xcd03('0xc')]},'channel':{'type':Sequelize[_0xcd03('0x2')]},'connectedlinenum':{'type':Sequelize[_0xcd03('0x2')]},'connectedlinename':{'type':Sequelize[_0xcd03('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xcd03('0x2')]},'holdtime':{'type':Sequelize[_0xcd03('0xc')]},'mohtime':{'type':Sequelize[_0xcd03('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xcd03('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xcd03('0x2')]},'transfer':{'type':Sequelize[_0xcd03('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xcd03('0x2')],'comment':_0xcd03('0xe')},'transferexten':{'type':Sequelize[_0xcd03('0x2')]},'transferuniqueid':{'type':Sequelize[_0xcd03('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xcd03('0x2')]},'thirdDisposition':{'type':Sequelize[_0xcd03('0x2')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xfba0=['STRING','DATE','getDataValue','queuecallerjoinAt','format','diff','seconds','queuecallerleaveAt','setDataValue','holdtime','INTEGER','BOOLEAN','sequelize','moment'];(function(_0x408220,_0x5a2067){var _0x44c244=function(_0x2f0778){while(--_0x2f0778){_0x408220['push'](_0x408220['shift']());}};_0x44c244(++_0x5a2067);}(_0xfba0,0x132));var _0x0fba=function(_0x2e475c,_0xf4ebf8){_0x2e475c=_0x2e475c-0x0;var _0x34b987=_0xfba0[_0x2e475c];return _0x34b987;};'use strict';var Sequelize=require(_0x0fba('0x0'));var moment=require(_0x0fba('0x1'));module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x0fba('0x2')]},'calleridnum':{'type':Sequelize[_0x0fba('0x2')]},'calleridname':{'type':Sequelize[_0x0fba('0x2')]},'queue':{'type':Sequelize[_0x0fba('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x0fba('0x3')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x5420bf){var _0x351aa9=moment(_0x5420bf);var _0x15d54c=moment(this[_0x0fba('0x4')](_0x0fba('0x5')))[_0x0fba('0x6')]('YYYY-MM-DD\x20HH:mm:ss');var _0x4fa00c=_0x351aa9[_0x0fba('0x7')](_0x15d54c,_0x0fba('0x8'));this['setDataValue'](_0x0fba('0x9'),_0x5420bf);this[_0x0fba('0xa')](_0x0fba('0xb'),_0x4fa00c||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x0fba('0xc')]},'queuecallerabandon':{'type':Sequelize[_0x0fba('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x0fba('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x0fba('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x0fba('0x3')]},'queuecallerexit':{'type':Sequelize[_0x0fba('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x0fba('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x0fba('0x2')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x0fba('0xc')]},'channel':{'type':Sequelize[_0x0fba('0x2')]},'connectedlinenum':{'type':Sequelize[_0x0fba('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x0fba('0x2')]},'exten':{'type':Sequelize[_0x0fba('0x2')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x0fba('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x0fba('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x0fba('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x0fba('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x0fba('0x2')]},'transferuniqueid':{'type':Sequelize[_0x0fba('0x2')]},'disposition':{'type':Sequelize[_0x0fba('0x2')]},'secondDisposition':{'type':Sequelize[_0x0fba('0x2')]},'thirdDisposition':{'type':Sequelize[_0x0fba('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x0fba('0xc')],'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 ae48e99..7d2ca99 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 _0x172b=['reject','save','update','then','error','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','where','VIRTUAL','filter','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','destroy','describe','getVoiceQueuesReport','order','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply'];(function(_0x6e1e2a,_0xf9cd0f){var _0x558e58=function(_0x849644){while(--_0x849644){_0x6e1e2a['push'](_0x6e1e2a['shift']());}};_0x558e58(++_0xf9cd0f);}(_0x172b,0x1e0));var _0xb172=function(_0x32bea3,_0x3ed963){_0x32bea3=_0x32bea3-0x0;var _0x2eecca=_0x172b[_0x32bea3];return _0x2eecca;};'use strict';var emlformat=require(_0xb172('0x0'));var rimraf=require(_0xb172('0x1'));var zipdir=require(_0xb172('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb172('0x3'));var moment=require(_0xb172('0x4'));var BPromise=require(_0xb172('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb172('0x6'));var sox=require('sox');var csv=require(_0xb172('0x7'));var ejs=require(_0xb172('0x8'));var fs=require('fs');var fs_extra=require(_0xb172('0x9'));var _=require('lodash');var squel=require(_0xb172('0xa'));var crypto=require(_0xb172('0xb'));var jsforce=require(_0xb172('0xc'));var deskjs=require(_0xb172('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb172('0xe'));var Papa=require(_0xb172('0xf'));var Redis=require(_0xb172('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb172('0x11'));var as=require(_0xb172('0x12'));var hardwareService=require(_0xb172('0x13'));var logger=require(_0xb172('0x14'))('api');var utils=require(_0xb172('0x15'));var config=require(_0xb172('0x16'));var licenseUtil=require(_0xb172('0x17'));var db=require(_0xb172('0x18'))['db'];config[_0xb172('0x19')]=_[_0xb172('0x1a')](config['redis'],{'host':_0xb172('0x1b'),'port':0x18eb});var socket=require(_0xb172('0x1c'))(new Redis(config[_0xb172('0x19')]));require(_0xb172('0x1d'))[_0xb172('0x1e')](socket);function respondWithStatusCode(_0x57cc1f,_0xf2c392){_0xf2c392=_0xf2c392||0xcc;return function(_0x3998ba){if(_0x3998ba){return _0x57cc1f[_0xb172('0x1f')](_0xf2c392);}return _0x57cc1f['status'](_0xf2c392)[_0xb172('0x20')]();};}function respondWithResult(_0x153163,_0xf373b){_0xf373b=_0xf373b||0xc8;return function(_0x18d171){if(_0x18d171){return _0x153163[_0xb172('0x21')](_0xf373b)[_0xb172('0x22')](_0x18d171);}};}function respondWithFilteredResult(_0x381b90,_0x2913f7){return function(_0x1f2824){if(_0x1f2824){var _0x19602a=typeof _0x2913f7['offset']===_0xb172('0x23')&&typeof _0x2913f7[_0xb172('0x24')]===_0xb172('0x23');var _0x67d6ea=_0x1f2824[_0xb172('0x25')];var _0xf0019d=_0x19602a?0x0:_0x2913f7['offset'];var _0x167fcd=_0x19602a?_0x1f2824['count']:_0x2913f7[_0xb172('0x26')]+_0x2913f7[_0xb172('0x24')];var _0x1485f5;if(_0x167fcd>=_0x67d6ea){_0x167fcd=_0x67d6ea;_0x1485f5=0xc8;}else{_0x1485f5=0xce;}_0x381b90[_0xb172('0x21')](_0x1485f5);return _0x381b90[_0xb172('0x27')](_0xb172('0x28'),_0xf0019d+'-'+_0x167fcd+'/'+_0x67d6ea)['json'](_0x1f2824);}return null;};}function patchUpdates(_0x51d893){return function(_0x2b3744){try{jsonpatch[_0xb172('0x29')](_0x2b3744,_0x51d893,!![]);}catch(_0x3adce0){return BPromise[_0xb172('0x2a')](_0x3adce0);}return _0x2b3744[_0xb172('0x2b')]();};}function saveUpdates(_0x457b07,_0x225141){return function(_0x480198){if(_0x480198){return _0x480198[_0xb172('0x2c')](_0x457b07)[_0xb172('0x2d')](function(_0xf4bf3){return _0xf4bf3;});}return null;};}function removeEntity(_0x1d18af,_0x4f8cd1){return function(_0x3b3e20){if(_0x3b3e20){return _0x3b3e20['destroy']()[_0xb172('0x2d')](function(){_0x1d18af[_0xb172('0x21')](0xcc)[_0xb172('0x20')]();});}};}function handleEntityNotFound(_0x5c2dcc,_0x3f3998){return function(_0x1063b2){if(!_0x1063b2){_0x5c2dcc[_0xb172('0x1f')](0x194);}return _0x1063b2;};}function handleError(_0x2fb332,_0x36a233){_0x36a233=_0x36a233||0x1f4;return function(_0x2809cb){logger[_0xb172('0x2e')](_0x2809cb['stack']);if(_0x2809cb[_0xb172('0x2f')]){delete _0x2809cb[_0xb172('0x2f')];}_0x2fb332[_0xb172('0x21')](_0x36a233)[_0xb172('0x30')](_0x2809cb);};}exports[_0xb172('0x31')]=function(_0x43a7f,_0x4d7fa8){var _0x4d59cf={},_0x53a54c={},_0x36cb5c={'count':0x0,'rows':[]};var _0x15ba5f=_[_0xb172('0x32')](db[_0xb172('0x33')][_0xb172('0x34')],function(_0x1fb90b){return{'name':_0x1fb90b[_0xb172('0x35')],'type':_0x1fb90b[_0xb172('0x36')][_0xb172('0x37')]};});_0x53a54c[_0xb172('0x38')]=_[_0xb172('0x32')](_0x15ba5f,_0xb172('0x2f'));_0x53a54c[_0xb172('0x39')]=_[_0xb172('0x3a')](_0x43a7f[_0xb172('0x39')]);_0x53a54c[_0xb172('0x3b')]=_['intersection'](_0x53a54c['model'],_0x53a54c['query']);_0x4d59cf[_0xb172('0x3c')]=_[_0xb172('0x3d')](_0x53a54c[_0xb172('0x38')],qs[_0xb172('0x3e')](_0x43a7f[_0xb172('0x39')]['fields']));_0x4d59cf[_0xb172('0x3c')]=_0x4d59cf['attributes'][_0xb172('0x3f')]?_0x4d59cf[_0xb172('0x3c')]:_0x53a54c[_0xb172('0x38')];if(!_0x43a7f['query'][_0xb172('0x40')](_0xb172('0x41'))){_0x4d59cf[_0xb172('0x24')]=qs[_0xb172('0x24')](_0x43a7f[_0xb172('0x39')][_0xb172('0x24')]);_0x4d59cf[_0xb172('0x26')]=qs['offset'](_0x43a7f[_0xb172('0x39')][_0xb172('0x26')]);}_0x4d59cf['order']=qs['sort'](_0x43a7f[_0xb172('0x39')][_0xb172('0x42')]);_0x4d59cf['where']=qs[_0xb172('0x3b')](_[_0xb172('0x43')](_0x43a7f['query'],_0x53a54c[_0xb172('0x3b')]),_0x15ba5f);if(_0x43a7f['query']['filter']){_0x4d59cf['where']=_['merge'](_0x4d59cf[_0xb172('0x44')],{'$or':_[_0xb172('0x32')](_0x15ba5f,function(_0x1acd9c){if(_0x1acd9c['type']!==_0xb172('0x45')){var _0x4e2aba={};_0x4e2aba[_0x1acd9c[_0xb172('0x2f')]]={'$like':'%'+_0x43a7f['query'][_0xb172('0x46')]+'%'};return _0x4e2aba;}})});}_0x4d59cf=_[_0xb172('0x47')]({},_0x4d59cf,_0x43a7f['options']);var _0x30681c={'where':_0x4d59cf[_0xb172('0x44')]};return db[_0xb172('0x33')][_0xb172('0x25')](_0x30681c)[_0xb172('0x2d')](function(_0x2c4db3){_0x36cb5c[_0xb172('0x25')]=_0x2c4db3;if(_0x43a7f[_0xb172('0x39')][_0xb172('0x48')]){_0x4d59cf[_0xb172('0x49')]=[{'all':!![]}];}return db[_0xb172('0x33')][_0xb172('0x4a')](_0x4d59cf);})['then'](function(_0x441ee0){_0x36cb5c[_0xb172('0x4b')]=_0x441ee0;return _0x36cb5c;})[_0xb172('0x2d')](respondWithFilteredResult(_0x4d7fa8,_0x4d59cf))[_0xb172('0x4c')](handleError(_0x4d7fa8,null));};exports[_0xb172('0x4d')]=function(_0x31328c,_0x4ddd98){var _0x378e57={'raw':![],'where':{'id':_0x31328c[_0xb172('0x4e')]['id']}},_0x46f4c5={};_0x46f4c5[_0xb172('0x38')]=_[_0xb172('0x3a')](db[_0xb172('0x33')][_0xb172('0x34')]);_0x46f4c5[_0xb172('0x39')]=_[_0xb172('0x3a')](_0x31328c[_0xb172('0x39')]);_0x46f4c5[_0xb172('0x3b')]=_[_0xb172('0x3d')](_0x46f4c5[_0xb172('0x38')],_0x46f4c5[_0xb172('0x39')]);_0x378e57['attributes']=_[_0xb172('0x3d')](_0x46f4c5['model'],qs[_0xb172('0x3e')](_0x31328c[_0xb172('0x39')][_0xb172('0x3e')]));_0x378e57['attributes']=_0x378e57[_0xb172('0x3c')]['length']?_0x378e57['attributes']:_0x46f4c5[_0xb172('0x38')];if(_0x31328c[_0xb172('0x39')][_0xb172('0x48')]){_0x378e57['include']=[{'all':!![]}];}_0x378e57=_[_0xb172('0x47')]({},_0x378e57,_0x31328c[_0xb172('0x4f')]);return db[_0xb172('0x33')][_0xb172('0x50')](_0x378e57)[_0xb172('0x2d')](handleEntityNotFound(_0x4ddd98,null))[_0xb172('0x2d')](respondWithResult(_0x4ddd98,null))[_0xb172('0x4c')](handleError(_0x4ddd98,null));};exports[_0xb172('0x51')]=function(_0x246cee,_0x211c80){return db[_0xb172('0x33')][_0xb172('0x51')](_0x246cee[_0xb172('0x52')],{})[_0xb172('0x2d')](respondWithResult(_0x211c80,0xc9))[_0xb172('0x4c')](handleError(_0x211c80,null));};exports['update']=function(_0x5329a8,_0x5012c8){if(_0x5329a8['body']['id']){delete _0x5329a8[_0xb172('0x52')]['id'];}return db[_0xb172('0x33')][_0xb172('0x50')]({'where':{'id':_0x5329a8[_0xb172('0x4e')]['id']}})[_0xb172('0x2d')](handleEntityNotFound(_0x5012c8,null))[_0xb172('0x2d')](saveUpdates(_0x5329a8[_0xb172('0x52')],null))[_0xb172('0x2d')](respondWithResult(_0x5012c8,null))[_0xb172('0x4c')](handleError(_0x5012c8,null));};exports[_0xb172('0x53')]=function(_0x1e2b11,_0x3a1dc3){return db['VoiceQueueReport']['find']({'where':{'id':_0x1e2b11[_0xb172('0x4e')]['id']}})[_0xb172('0x2d')](handleEntityNotFound(_0x3a1dc3,null))[_0xb172('0x2d')](removeEntity(_0x3a1dc3,null))[_0xb172('0x4c')](handleError(_0x3a1dc3,null));};exports[_0xb172('0x54')]=function(_0x4e7486,_0x6b2689){return db[_0xb172('0x33')][_0xb172('0x54')]()['then'](respondWithResult(_0x6b2689,null))[_0xb172('0x4c')](handleError(_0x6b2689,null));};exports[_0xb172('0x55')]=function(_0x1f114c,_0x152818){var _0x36a391={},_0x5e01b9={},_0x3fcdb1={'count':0x0,'rows':[]};_0x5e01b9[_0xb172('0x38')]=_[_0xb172('0x3a')](db[_0xb172('0x33')][_0xb172('0x34')]);_0x5e01b9[_0xb172('0x39')]=_[_0xb172('0x3a')](_0x1f114c[_0xb172('0x39')]);_0x5e01b9[_0xb172('0x3b')]=_[_0xb172('0x3d')](_0x5e01b9[_0xb172('0x38')],_0x5e01b9[_0xb172('0x39')]);_0x36a391[_0xb172('0x3c')]=_[_0xb172('0x3d')](_0x5e01b9[_0xb172('0x38')],qs[_0xb172('0x3e')](_0x1f114c[_0xb172('0x39')][_0xb172('0x3e')]));_0x36a391[_0xb172('0x3c')]=_0x36a391['attributes'][_0xb172('0x3f')]?_0x36a391[_0xb172('0x3c')]:_0x5e01b9[_0xb172('0x38')];if(!_0x1f114c['query'][_0xb172('0x40')](_0xb172('0x41'))){_0x36a391[_0xb172('0x24')]=qs[_0xb172('0x24')](_0x1f114c['query']['limit']);_0x36a391['offset']=qs[_0xb172('0x26')](_0x1f114c[_0xb172('0x39')][_0xb172('0x26')]);}_0x36a391[_0xb172('0x56')]=qs[_0xb172('0x42')](_0x1f114c['query']['sort']);_0x36a391[_0xb172('0x44')]=qs[_0xb172('0x3b')](_['pick'](_0x1f114c['query'],_0x5e01b9[_0xb172('0x3b')]));if(_0x1f114c[_0xb172('0x39')]['filter']){_0x36a391[_0xb172('0x44')]=_[_0xb172('0x47')](_0x36a391[_0xb172('0x44')],{'$or':_[_0xb172('0x32')](_0x36a391[_0xb172('0x3c')],function(_0x956e21){var _0x18d305={};_0x18d305[_0x956e21]={'$like':'%'+_0x1f114c['query'][_0xb172('0x46')]+'%'};return _0x18d305;})});}_0x36a391=_['merge']({},_0x36a391,_0x1f114c[_0xb172('0x4f')]);var _0x3ea067={'where':_0x36a391[_0xb172('0x44')]};return db[_0xb172('0x33')][_0xb172('0x25')](_0x3ea067)[_0xb172('0x2d')](function(_0x4dbf00){_0x3fcdb1[_0xb172('0x25')]=_0x4dbf00;if(_0x1f114c[_0xb172('0x39')]['includeAll']){_0x36a391[_0xb172('0x49')]=[{'all':!![]}];}return db[_0xb172('0x33')][_0xb172('0x4a')](_0x36a391);})[_0xb172('0x2d')](function(_0x3ccb34){_0x3fcdb1['rows']=_0x3ccb34;return _0x3fcdb1;})[_0xb172('0x2d')](respondWithFilteredResult(_0x152818,_0x36a391,_0xb172('0x55')))[_0xb172('0x4c')](handleError(_0x152818,null,_0xb172('0x55')));}; \ No newline at end of file +var _0xc0a1=['include','findAll','rows','catch','show','params','keys','rawAttributes','intersection','find','create','body','update','describe','getVoiceQueuesReport','hasOwnProperty','nolimit','order','pick','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','stack','send','map','VoiceQueueReport','fieldName','type','key','model','query','filters','attributes','fields','length','sort','where','filter','merge','VIRTUAL','options','includeAll'];(function(_0x50234d,_0x4192db){var _0x5c3edf=function(_0x401862){while(--_0x401862){_0x50234d['push'](_0x50234d['shift']());}};_0x5c3edf(++_0x4192db);}(_0xc0a1,0x16f));var _0x1c0a=function(_0x24f107,_0x3c6c88){_0x24f107=_0x24f107-0x0;var _0x5116ab=_0xc0a1[_0x24f107];return _0x5116ab;};'use strict';var emlformat=require(_0x1c0a('0x0'));var rimraf=require(_0x1c0a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1c0a('0x2'));var rp=require('request-promise');var moment=require(_0x1c0a('0x3'));var BPromise=require(_0x1c0a('0x4'));var Mustache=require(_0x1c0a('0x5'));var util=require(_0x1c0a('0x6'));var path=require('path');var sox=require(_0x1c0a('0x7'));var csv=require(_0x1c0a('0x8'));var ejs=require(_0x1c0a('0x9'));var fs=require('fs');var fs_extra=require(_0x1c0a('0xa'));var _=require(_0x1c0a('0xb'));var squel=require('squel');var crypto=require(_0x1c0a('0xc'));var jsforce=require(_0x1c0a('0xd'));var deskjs=require(_0x1c0a('0xe'));var toCsv=require(_0x1c0a('0x8'));var querystring=require(_0x1c0a('0xf'));var Papa=require(_0x1c0a('0x10'));var Redis=require(_0x1c0a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1c0a('0x12'));var as=require(_0x1c0a('0x13'));var hardwareService=require(_0x1c0a('0x14'));var logger=require(_0x1c0a('0x15'))(_0x1c0a('0x16'));var utils=require(_0x1c0a('0x17'));var config=require(_0x1c0a('0x18'));var licenseUtil=require(_0x1c0a('0x19'));var db=require(_0x1c0a('0x1a'))['db'];config[_0x1c0a('0x1b')]=_[_0x1c0a('0x1c')](config[_0x1c0a('0x1b')],{'host':_0x1c0a('0x1d'),'port':0x18eb});var socket=require(_0x1c0a('0x1e'))(new Redis(config[_0x1c0a('0x1b')]));require(_0x1c0a('0x1f'))[_0x1c0a('0x20')](socket);function respondWithStatusCode(_0x21ed06,_0xdad1ec){_0xdad1ec=_0xdad1ec||0xcc;return function(_0x351156){if(_0x351156){return _0x21ed06[_0x1c0a('0x21')](_0xdad1ec);}return _0x21ed06[_0x1c0a('0x22')](_0xdad1ec)[_0x1c0a('0x23')]();};}function respondWithResult(_0x84c9ba,_0xb7ba67){_0xb7ba67=_0xb7ba67||0xc8;return function(_0x13b84b){if(_0x13b84b){return _0x84c9ba[_0x1c0a('0x22')](_0xb7ba67)['json'](_0x13b84b);}};}function respondWithFilteredResult(_0x8c073c,_0x190ad7){return function(_0x57b513){if(_0x57b513){var _0x225260=typeof _0x190ad7['offset']===_0x1c0a('0x24')&&typeof _0x190ad7[_0x1c0a('0x25')]===_0x1c0a('0x24');var _0x448215=_0x57b513[_0x1c0a('0x26')];var _0x315189=_0x225260?0x0:_0x190ad7[_0x1c0a('0x27')];var _0x112961=_0x225260?_0x57b513[_0x1c0a('0x26')]:_0x190ad7[_0x1c0a('0x27')]+_0x190ad7[_0x1c0a('0x25')];var _0x40879e;if(_0x112961>=_0x448215){_0x112961=_0x448215;_0x40879e=0xc8;}else{_0x40879e=0xce;}_0x8c073c[_0x1c0a('0x22')](_0x40879e);return _0x8c073c[_0x1c0a('0x28')](_0x1c0a('0x29'),_0x315189+'-'+_0x112961+'/'+_0x448215)[_0x1c0a('0x2a')](_0x57b513);}return null;};}function patchUpdates(_0x28e901){return function(_0x12bfe3){try{jsonpatch[_0x1c0a('0x2b')](_0x12bfe3,_0x28e901,!![]);}catch(_0x7edf08){return BPromise[_0x1c0a('0x2c')](_0x7edf08);}return _0x12bfe3[_0x1c0a('0x2d')]();};}function saveUpdates(_0x41bdb4,_0xe64633){return function(_0xc08a95){if(_0xc08a95){return _0xc08a95['update'](_0x41bdb4)[_0x1c0a('0x2e')](function(_0x640df9){return _0x640df9;});}return null;};}function removeEntity(_0x37e76b,_0x13907f){return function(_0x484760){if(_0x484760){return _0x484760[_0x1c0a('0x2f')]()[_0x1c0a('0x2e')](function(){_0x37e76b[_0x1c0a('0x22')](0xcc)[_0x1c0a('0x23')]();});}};}function handleEntityNotFound(_0x133182,_0x240bba){return function(_0x1c1167){if(!_0x1c1167){_0x133182[_0x1c0a('0x21')](0x194);}return _0x1c1167;};}function handleError(_0x29c364,_0x4f2c95){_0x4f2c95=_0x4f2c95||0x1f4;return function(_0x1ff1a0){logger['error'](_0x1ff1a0[_0x1c0a('0x30')]);if(_0x1ff1a0['name']){delete _0x1ff1a0['name'];}_0x29c364[_0x1c0a('0x22')](_0x4f2c95)[_0x1c0a('0x31')](_0x1ff1a0);};}exports['index']=function(_0x1a2745,_0x519000){var _0x49ad95={},_0x404df4={},_0x3291f4={'count':0x0,'rows':[]};var _0x5f44bf=_[_0x1c0a('0x32')](db[_0x1c0a('0x33')]['rawAttributes'],function(_0x2ae6b6){return{'name':_0x2ae6b6[_0x1c0a('0x34')],'type':_0x2ae6b6[_0x1c0a('0x35')][_0x1c0a('0x36')]};});_0x404df4[_0x1c0a('0x37')]=_[_0x1c0a('0x32')](_0x5f44bf,'name');_0x404df4['query']=_['keys'](_0x1a2745[_0x1c0a('0x38')]);_0x404df4[_0x1c0a('0x39')]=_['intersection'](_0x404df4['model'],_0x404df4[_0x1c0a('0x38')]);_0x49ad95[_0x1c0a('0x3a')]=_['intersection'](_0x404df4[_0x1c0a('0x37')],qs[_0x1c0a('0x3b')](_0x1a2745[_0x1c0a('0x38')][_0x1c0a('0x3b')]));_0x49ad95[_0x1c0a('0x3a')]=_0x49ad95[_0x1c0a('0x3a')][_0x1c0a('0x3c')]?_0x49ad95[_0x1c0a('0x3a')]:_0x404df4[_0x1c0a('0x37')];if(!_0x1a2745['query']['hasOwnProperty']('nolimit')){_0x49ad95[_0x1c0a('0x25')]=qs[_0x1c0a('0x25')](_0x1a2745[_0x1c0a('0x38')]['limit']);_0x49ad95['offset']=qs[_0x1c0a('0x27')](_0x1a2745[_0x1c0a('0x38')][_0x1c0a('0x27')]);}_0x49ad95['order']=qs['sort'](_0x1a2745[_0x1c0a('0x38')][_0x1c0a('0x3d')]);_0x49ad95[_0x1c0a('0x3e')]=qs[_0x1c0a('0x39')](_['pick'](_0x1a2745[_0x1c0a('0x38')],_0x404df4['filters']),_0x5f44bf);if(_0x1a2745[_0x1c0a('0x38')][_0x1c0a('0x3f')]){_0x49ad95['where']=_[_0x1c0a('0x40')](_0x49ad95['where'],{'$or':_['map'](_0x5f44bf,function(_0x5e4f92){if(_0x5e4f92['type']!==_0x1c0a('0x41')){var _0x625c29={};_0x625c29[_0x5e4f92['name']]={'$like':'%'+_0x1a2745[_0x1c0a('0x38')][_0x1c0a('0x3f')]+'%'};return _0x625c29;}})});}_0x49ad95=_[_0x1c0a('0x40')]({},_0x49ad95,_0x1a2745[_0x1c0a('0x42')]);var _0x10db46={'where':_0x49ad95[_0x1c0a('0x3e')]};return db[_0x1c0a('0x33')]['count'](_0x10db46)[_0x1c0a('0x2e')](function(_0x1bd875){_0x3291f4['count']=_0x1bd875;if(_0x1a2745[_0x1c0a('0x38')][_0x1c0a('0x43')]){_0x49ad95[_0x1c0a('0x44')]=[{'all':!![]}];}return db[_0x1c0a('0x33')][_0x1c0a('0x45')](_0x49ad95);})[_0x1c0a('0x2e')](function(_0x1fcae3){_0x3291f4[_0x1c0a('0x46')]=_0x1fcae3;return _0x3291f4;})[_0x1c0a('0x2e')](respondWithFilteredResult(_0x519000,_0x49ad95))[_0x1c0a('0x47')](handleError(_0x519000,null));};exports[_0x1c0a('0x48')]=function(_0x2c1e2e,_0x14022e){var _0x5496ea={'raw':![],'where':{'id':_0x2c1e2e[_0x1c0a('0x49')]['id']}},_0xa96db4={};_0xa96db4['model']=_[_0x1c0a('0x4a')](db[_0x1c0a('0x33')][_0x1c0a('0x4b')]);_0xa96db4[_0x1c0a('0x38')]=_[_0x1c0a('0x4a')](_0x2c1e2e[_0x1c0a('0x38')]);_0xa96db4['filters']=_[_0x1c0a('0x4c')](_0xa96db4[_0x1c0a('0x37')],_0xa96db4[_0x1c0a('0x38')]);_0x5496ea['attributes']=_['intersection'](_0xa96db4[_0x1c0a('0x37')],qs[_0x1c0a('0x3b')](_0x2c1e2e[_0x1c0a('0x38')][_0x1c0a('0x3b')]));_0x5496ea['attributes']=_0x5496ea[_0x1c0a('0x3a')]['length']?_0x5496ea[_0x1c0a('0x3a')]:_0xa96db4[_0x1c0a('0x37')];if(_0x2c1e2e['query']['includeAll']){_0x5496ea[_0x1c0a('0x44')]=[{'all':!![]}];}_0x5496ea=_[_0x1c0a('0x40')]({},_0x5496ea,_0x2c1e2e[_0x1c0a('0x42')]);return db['VoiceQueueReport'][_0x1c0a('0x4d')](_0x5496ea)[_0x1c0a('0x2e')](handleEntityNotFound(_0x14022e,null))[_0x1c0a('0x2e')](respondWithResult(_0x14022e,null))[_0x1c0a('0x47')](handleError(_0x14022e,null));};exports[_0x1c0a('0x4e')]=function(_0x10a732,_0x5af43b){return db[_0x1c0a('0x33')][_0x1c0a('0x4e')](_0x10a732[_0x1c0a('0x4f')],{})[_0x1c0a('0x2e')](respondWithResult(_0x5af43b,0xc9))[_0x1c0a('0x47')](handleError(_0x5af43b,null));};exports[_0x1c0a('0x50')]=function(_0x568188,_0x58842e){if(_0x568188[_0x1c0a('0x4f')]['id']){delete _0x568188['body']['id'];}return db[_0x1c0a('0x33')][_0x1c0a('0x4d')]({'where':{'id':_0x568188[_0x1c0a('0x49')]['id']}})['then'](handleEntityNotFound(_0x58842e,null))[_0x1c0a('0x2e')](saveUpdates(_0x568188['body'],null))['then'](respondWithResult(_0x58842e,null))[_0x1c0a('0x47')](handleError(_0x58842e,null));};exports[_0x1c0a('0x2f')]=function(_0x4756a5,_0x1c6c18){return db['VoiceQueueReport'][_0x1c0a('0x4d')]({'where':{'id':_0x4756a5[_0x1c0a('0x49')]['id']}})[_0x1c0a('0x2e')](handleEntityNotFound(_0x1c6c18,null))['then'](removeEntity(_0x1c6c18,null))[_0x1c0a('0x47')](handleError(_0x1c6c18,null));};exports[_0x1c0a('0x51')]=function(_0x4018e4,_0x1093bd){return db[_0x1c0a('0x33')][_0x1c0a('0x51')]()[_0x1c0a('0x2e')](respondWithResult(_0x1093bd,null))[_0x1c0a('0x47')](handleError(_0x1093bd,null));};exports[_0x1c0a('0x52')]=function(_0x1daba1,_0x4b80bf){var _0x2a723f={},_0x5ae15e={},_0x432543={'count':0x0,'rows':[]};_0x5ae15e[_0x1c0a('0x37')]=_[_0x1c0a('0x4a')](db[_0x1c0a('0x33')][_0x1c0a('0x4b')]);_0x5ae15e['query']=_[_0x1c0a('0x4a')](_0x1daba1['query']);_0x5ae15e[_0x1c0a('0x39')]=_['intersection'](_0x5ae15e[_0x1c0a('0x37')],_0x5ae15e[_0x1c0a('0x38')]);_0x2a723f[_0x1c0a('0x3a')]=_[_0x1c0a('0x4c')](_0x5ae15e[_0x1c0a('0x37')],qs[_0x1c0a('0x3b')](_0x1daba1[_0x1c0a('0x38')][_0x1c0a('0x3b')]));_0x2a723f[_0x1c0a('0x3a')]=_0x2a723f[_0x1c0a('0x3a')][_0x1c0a('0x3c')]?_0x2a723f['attributes']:_0x5ae15e['model'];if(!_0x1daba1[_0x1c0a('0x38')][_0x1c0a('0x53')](_0x1c0a('0x54'))){_0x2a723f['limit']=qs[_0x1c0a('0x25')](_0x1daba1[_0x1c0a('0x38')][_0x1c0a('0x25')]);_0x2a723f['offset']=qs[_0x1c0a('0x27')](_0x1daba1[_0x1c0a('0x38')][_0x1c0a('0x27')]);}_0x2a723f[_0x1c0a('0x55')]=qs['sort'](_0x1daba1[_0x1c0a('0x38')][_0x1c0a('0x3d')]);_0x2a723f['where']=qs[_0x1c0a('0x39')](_[_0x1c0a('0x56')](_0x1daba1[_0x1c0a('0x38')],_0x5ae15e[_0x1c0a('0x39')]));if(_0x1daba1[_0x1c0a('0x38')][_0x1c0a('0x3f')]){_0x2a723f['where']=_[_0x1c0a('0x40')](_0x2a723f['where'],{'$or':_['map'](_0x2a723f[_0x1c0a('0x3a')],function(_0x15ff57){var _0x527dae={};_0x527dae[_0x15ff57]={'$like':'%'+_0x1daba1['query'][_0x1c0a('0x3f')]+'%'};return _0x527dae;})});}_0x2a723f=_['merge']({},_0x2a723f,_0x1daba1[_0x1c0a('0x42')]);var _0x4a8e38={'where':_0x2a723f[_0x1c0a('0x3e')]};return db['VoiceQueueReport'][_0x1c0a('0x26')](_0x4a8e38)['then'](function(_0xb306bb){_0x432543['count']=_0xb306bb;if(_0x1daba1['query']['includeAll']){_0x2a723f[_0x1c0a('0x44')]=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x2a723f);})[_0x1c0a('0x2e')](function(_0x309af3){_0x432543[_0x1c0a('0x46')]=_0x309af3;return _0x432543;})[_0x1c0a('0x2e')](respondWithFilteredResult(_0x4b80bf,_0x2a723f,_0x1c0a('0x52')))[_0x1c0a('0x47')](handleError(_0x4b80bf,null,_0x1c0a('0x52')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 32d61c9..8b183ae 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 _0x3a92=['hook','exports','events','../../mysqldb','VoiceQueueReport','save','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3a92,0x14a));var _0x23a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3a92[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x23a9('0x0'));var VoiceQueueReport=require(_0x23a9('0x1'))['db'][_0x23a9('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x23a9('0x3'),'afterUpdate':_0x23a9('0x4'),'afterDestroy':'remove'};function emitEvent(_0x513da4){return function(_0x4171cb,_0x4ba701,_0x3520c3){VoiceQueueReportEvents[_0x23a9('0x5')](_0x513da4+':'+_0x4171cb['id'],_0x4171cb);VoiceQueueReportEvents[_0x23a9('0x5')](_0x513da4,_0x4171cb);_0x3520c3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0x23a9('0x6')](e,emitEvent(event));}}module[_0x23a9('0x7')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x3829=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save','update'];(function(_0xad4538,_0x848334){var _0x33b7b0=function(_0x2bc6b8){while(--_0x2bc6b8){_0xad4538['push'](_0xad4538['shift']());}};_0x33b7b0(++_0x848334);}(_0x3829,0x1a3));var _0x9382=function(_0x2d91e3,_0x2a40db){_0x2d91e3=_0x2d91e3-0x0;var _0x3efffc=_0x3829[_0x2d91e3];return _0x3efffc;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0x9382('0x0'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x9382('0x1')](0x0);var events={'afterCreate':_0x9382('0x2'),'afterUpdate':_0x9382('0x3'),'afterDestroy':_0x9382('0x4')};function emitEvent(_0x30bf4d){return function(_0x11191f,_0x439a77,_0x5d6529){VoiceQueueReportEvents[_0x9382('0x5')](_0x30bf4d+':'+_0x11191f['id'],_0x11191f);VoiceQueueReportEvents[_0x9382('0x5')](_0x30bf4d,_0x11191f);_0x5d6529(null);};}for(var e in events){if(events[_0x9382('0x6')](e)){var event=events[e];VoiceQueueReport[_0x9382('0x7')](e,emitEvent(event));}}module[_0x9382('0x8')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 8055f01..e8a1512 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 _0x10ce=['exports','uniqueid','calleridnum','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes'];(function(_0x51553f,_0x5b4b7b){var _0x318110=function(_0x2f7018){while(--_0x2f7018){_0x51553f['push'](_0x51553f['shift']());}};_0x318110(++_0x5b4b7b);}(_0x10ce,0x1d7));var _0xe10c=function(_0x537a0d,_0x12efae){_0x537a0d=_0x537a0d-0x0;var _0x2cff5a=_0x10ce[_0x537a0d];return _0x2cff5a;};'use strict';var _=require(_0xe10c('0x0'));var util=require(_0xe10c('0x1'));var logger=require(_0xe10c('0x2'))(_0xe10c('0x3'));var moment=require(_0xe10c('0x4'));var BPromise=require('bluebird');var rp=require(_0xe10c('0x5'));var fs=require('fs');var path=require(_0xe10c('0x6'));var rimraf=require(_0xe10c('0x7'));var config=require(_0xe10c('0x8'));var attributes=require(_0xe10c('0x9'));module[_0xe10c('0xa')]=function(_0x5a6bb7,_0x2dde0e){return _0x5a6bb7['define']('VoiceQueueReport',attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0xe10c('0xb')]},{'fields':[_0xe10c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x671e=['./voiceQueueReport.attributes','exports','define','report_queue','uniqueid','calleridnum','lodash','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x671e,0x1e7));var _0xe671=function(_0x5bc536,_0x28a842){_0x5bc536=_0x5bc536-0x0;var _0x568b0b=_0x671e[_0x5bc536];return _0x568b0b;};'use strict';var _=require(_0xe671('0x0'));var util=require(_0xe671('0x1'));var logger=require(_0xe671('0x2'))(_0xe671('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe671('0x4'));var fs=require('fs');var path=require(_0xe671('0x5'));var rimraf=require(_0xe671('0x6'));var config=require('../../config/environment');var attributes=require(_0xe671('0x7'));module[_0xe671('0x8')]=function(_0x2b02be,_0x41ca40){return _0x2b02be[_0xe671('0x9')]('VoiceQueueReport',attributes,{'tableName':_0xe671('0xa'),'paranoid':![],'indexes':[{'fields':[_0xe671('0xb')]},{'fields':[_0xe671('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 6e60e61..4b82f36 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 _0xa212=['then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','debug','CreateVoiceQueueReport','body','UpdateVoiceQueueReport','VoiceQueueReport','update','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register'];(function(_0x515ef1,_0x476d57){var _0x2081a6=function(_0x310edf){while(--_0x310edf){_0x515ef1['push'](_0x515ef1['shift']());}};_0x2081a6(++_0x476d57);}(_0xa212,0x1f4));var _0x2a21=function(_0x4167d0,_0x56d592){_0x4167d0=_0x4167d0-0x0;var _0x33cc61=_0xa212[_0x4167d0];return _0x33cc61;};'use strict';var _=require(_0x2a21('0x0'));var util=require(_0x2a21('0x1'));var moment=require('moment');var BPromise=require(_0x2a21('0x2'));var rs=require(_0x2a21('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2a21('0x4'))['db'];var utils=require(_0x2a21('0x5'));var logger=require(_0x2a21('0x6'))(_0x2a21('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2a21('0x8')][_0x2a21('0x9')]({'port':0x232a});config[_0x2a21('0xa')]=_[_0x2a21('0xb')](config[_0x2a21('0xa')],{'host':_0x2a21('0xc'),'port':0x18eb});var socket=require(_0x2a21('0xd'))(new Redis(config[_0x2a21('0xa')]));require(_0x2a21('0xe'))[_0x2a21('0xf')](socket);function respondWithRpcPromise(_0x5dd813,_0x48bb21,_0x4b2c53){return new BPromise(function(_0x3a7a9,_0x4fdaa8){return client['request'](_0x5dd813,_0x4b2c53)[_0x2a21('0x10')](function(_0x3bbd7b){logger[_0x2a21('0x11')](_0x2a21('0x12'),_0x48bb21,_0x2a21('0x13'));logger['debug'](_0x2a21('0x14'),_0x48bb21,_0x2a21('0x13'),JSON[_0x2a21('0x15')](_0x3bbd7b));if(_0x3bbd7b[_0x2a21('0x16')]){if(_0x3bbd7b['error'][_0x2a21('0x17')]===0x1f4){logger[_0x2a21('0x16')](_0x2a21('0x12'),_0x48bb21,_0x3bbd7b[_0x2a21('0x16')]['message']);return _0x4fdaa8(_0x3bbd7b['error'][_0x2a21('0x18')]);}logger[_0x2a21('0x16')](_0x2a21('0x12'),_0x48bb21,_0x3bbd7b['error'][_0x2a21('0x18')]);return _0x3a7a9(_0x3bbd7b[_0x2a21('0x16')][_0x2a21('0x18')]);}else{logger[_0x2a21('0x11')](_0x2a21('0x12'),_0x48bb21,_0x2a21('0x13'));_0x3a7a9(_0x3bbd7b[_0x2a21('0x19')][_0x2a21('0x18')]);}})[_0x2a21('0x1a')](function(_0x1a1fc3){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x48bb21,_0x1a1fc3);_0x4fdaa8(_0x1a1fc3);});});}exports[_0x2a21('0x1b')]=function(_0x37e300){var _0x361946=this;return new Promise(function(_0x36d72f,_0x575f22){return db['VoiceQueueReport'][_0x2a21('0x1c')]({'raw':_0x37e300[_0x2a21('0x1d')]?_0x37e300[_0x2a21('0x1d')][_0x2a21('0x1e')]===undefined?!![]:![]:!![],'where':_0x37e300[_0x2a21('0x1d')]?_0x37e300[_0x2a21('0x1d')][_0x2a21('0x1f')]||null:null,'attributes':_0x37e300[_0x2a21('0x1d')]?_0x37e300['options'][_0x2a21('0x20')]||null:null,'limit':_0x37e300['options']?_0x37e300['options'][_0x2a21('0x21')]||null:null,'include':_0x37e300[_0x2a21('0x1d')]?_0x37e300[_0x2a21('0x1d')][_0x2a21('0x22')]?_[_0x2a21('0x23')](_0x37e300['options'][_0x2a21('0x22')],function(_0x3bbc53){return{'model':db[_0x3bbc53[_0x2a21('0x24')]],'as':_0x3bbc53['as'],'attributes':_0x3bbc53[_0x2a21('0x20')],'include':_0x3bbc53[_0x2a21('0x22')]?_[_0x2a21('0x23')](_0x3bbc53[_0x2a21('0x22')],function(_0x3bcde5){return{'model':db[_0x3bcde5[_0x2a21('0x24')]],'as':_0x3bcde5['as'],'attributes':_0x3bcde5[_0x2a21('0x20')],'include':_0x3bcde5[_0x2a21('0x22')]?_[_0x2a21('0x23')](_0x3bcde5[_0x2a21('0x22')],function(_0x3d869b){return{'model':db[_0x3d869b[_0x2a21('0x24')]],'as':_0x3d869b['as'],'attributes':_0x3d869b[_0x2a21('0x20')]};}):[]};}):[]};}):[]:[]})[_0x2a21('0x10')](function(_0x5cba71){logger[_0x2a21('0x11')](_0x2a21('0x1b'),_0x37e300);logger[_0x2a21('0x25')]('GetVoiceQueueReport',_0x37e300,JSON[_0x2a21('0x15')](_0x5cba71));_0x36d72f(_0x5cba71);})[_0x2a21('0x1a')](function(_0x3043bd){logger[_0x2a21('0x16')](_0x2a21('0x1b'),_0x3043bd[_0x2a21('0x18')],_0x37e300);_0x575f22(_0x361946['error'](0x1f4,_0x3043bd[_0x2a21('0x18')]));});});};exports[_0x2a21('0x26')]=function(_0x5d1c4a){var _0x42109f=this;return new Promise(function(_0x3ede04,_0x121af9){return db['VoiceQueueReport']['create'](_0x5d1c4a[_0x2a21('0x27')],{'raw':_0x5d1c4a[_0x2a21('0x1d')]?_0x5d1c4a[_0x2a21('0x1d')][_0x2a21('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x1bbf4f){logger['info'](_0x2a21('0x26'),_0x5d1c4a);logger['debug']('CreateVoiceQueueReport',_0x5d1c4a,JSON[_0x2a21('0x15')](_0x1bbf4f));_0x3ede04(_0x1bbf4f);})[_0x2a21('0x1a')](function(_0x52cc85){logger[_0x2a21('0x16')](_0x2a21('0x26'),_0x52cc85['message'],_0x5d1c4a);_0x121af9(_0x42109f[_0x2a21('0x16')](0x1f4,_0x52cc85[_0x2a21('0x18')]));});});};exports[_0x2a21('0x28')]=function(_0x5c58c8){var _0x133789=this;return new Promise(function(_0x54826c,_0x11c683){return db[_0x2a21('0x29')][_0x2a21('0x2a')](_0x5c58c8[_0x2a21('0x27')],{'raw':_0x5c58c8[_0x2a21('0x1d')]?_0x5c58c8['options'][_0x2a21('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c58c8[_0x2a21('0x1d')]?_0x5c58c8['options'][_0x2a21('0x1f')]||null:null,'attributes':_0x5c58c8[_0x2a21('0x1d')]?_0x5c58c8['options'][_0x2a21('0x20')]||null:null,'limit':_0x5c58c8['options']?_0x5c58c8[_0x2a21('0x1d')][_0x2a21('0x21')]||null:null})['then'](function(_0x4f1efb){logger[_0x2a21('0x11')](_0x2a21('0x28'),_0x5c58c8);logger[_0x2a21('0x25')]('UpdateVoiceQueueReport',_0x5c58c8,JSON[_0x2a21('0x15')](_0x4f1efb));_0x54826c(_0x4f1efb);})[_0x2a21('0x1a')](function(_0x177801){logger['error']('UpdateVoiceQueueReport',_0x177801[_0x2a21('0x18')],_0x5c58c8);_0x11c683(_0x133789['error'](0x1f4,_0x177801[_0x2a21('0x18')]));});});}; \ No newline at end of file +var _0x2732=['GetVoiceQueueReport','VoiceQueueReport','findAll','options','where','attributes','include','map','model','CreateVoiceQueueReport','create','body','raw','UpdateVoiceQueueReport','update','limit','lodash','util','moment','ioredis','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x3bb5b4,_0x128455){var _0x586c60=function(_0x179226){while(--_0x179226){_0x3bb5b4['push'](_0x3bb5b4['shift']());}};_0x586c60(++_0x128455);}(_0x2732,0x106));var _0x2273=function(_0xc9fae3,_0x2418bd){_0xc9fae3=_0xc9fae3-0x0;var _0x45190a=_0x2732[_0xc9fae3];return _0x45190a;};'use strict';var _=require(_0x2273('0x0'));var util=require(_0x2273('0x1'));var moment=require(_0x2273('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2273('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2273('0x4'));var config=require(_0x2273('0x5'));var jayson=require(_0x2273('0x6'));var client=jayson['client'][_0x2273('0x7')]({'port':0x232a});config[_0x2273('0x8')]=_[_0x2273('0x9')](config[_0x2273('0x8')],{'host':_0x2273('0xa'),'port':0x18eb});var socket=require(_0x2273('0xb'))(new Redis(config[_0x2273('0x8')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithRpcPromise(_0x426598,_0x45eb57,_0x4ca9bd){return new BPromise(function(_0x1417ca,_0x5e210b){return client[_0x2273('0xc')](_0x426598,_0x4ca9bd)[_0x2273('0xd')](function(_0x3421c8){logger[_0x2273('0xe')](_0x2273('0xf'),_0x45eb57,_0x2273('0x10'));logger[_0x2273('0x11')](_0x2273('0x12'),_0x45eb57,_0x2273('0x10'),JSON[_0x2273('0x13')](_0x3421c8));if(_0x3421c8[_0x2273('0x14')]){if(_0x3421c8[_0x2273('0x14')][_0x2273('0x15')]===0x1f4){logger['error'](_0x2273('0xf'),_0x45eb57,_0x3421c8[_0x2273('0x14')][_0x2273('0x16')]);return _0x5e210b(_0x3421c8['error'][_0x2273('0x16')]);}logger['error'](_0x2273('0xf'),_0x45eb57,_0x3421c8[_0x2273('0x14')][_0x2273('0x16')]);return _0x1417ca(_0x3421c8['error'][_0x2273('0x16')]);}else{logger[_0x2273('0xe')](_0x2273('0xf'),_0x45eb57,_0x2273('0x10'));_0x1417ca(_0x3421c8[_0x2273('0x17')][_0x2273('0x16')]);}})[_0x2273('0x18')](function(_0x12b5c9){logger['error'](_0x2273('0xf'),_0x45eb57,_0x12b5c9);_0x5e210b(_0x12b5c9);});});}exports[_0x2273('0x19')]=function(_0x10d644){var _0x391cd2=this;return new Promise(function(_0x559dc3,_0x550d53){return db[_0x2273('0x1a')][_0x2273('0x1b')]({'raw':_0x10d644[_0x2273('0x1c')]?_0x10d644['options']['raw']===undefined?!![]:![]:!![],'where':_0x10d644[_0x2273('0x1c')]?_0x10d644[_0x2273('0x1c')][_0x2273('0x1d')]||null:null,'attributes':_0x10d644[_0x2273('0x1c')]?_0x10d644[_0x2273('0x1c')][_0x2273('0x1e')]||null:null,'limit':_0x10d644[_0x2273('0x1c')]?_0x10d644[_0x2273('0x1c')]['limit']||null:null,'include':_0x10d644[_0x2273('0x1c')]?_0x10d644[_0x2273('0x1c')][_0x2273('0x1f')]?_[_0x2273('0x20')](_0x10d644[_0x2273('0x1c')]['include'],function(_0x4ecfd1){return{'model':db[_0x4ecfd1[_0x2273('0x21')]],'as':_0x4ecfd1['as'],'attributes':_0x4ecfd1[_0x2273('0x1e')],'include':_0x4ecfd1[_0x2273('0x1f')]?_[_0x2273('0x20')](_0x4ecfd1[_0x2273('0x1f')],function(_0x4616ec){return{'model':db[_0x4616ec[_0x2273('0x21')]],'as':_0x4616ec['as'],'attributes':_0x4616ec[_0x2273('0x1e')],'include':_0x4616ec['include']?_[_0x2273('0x20')](_0x4616ec['include'],function(_0x23fd2c){return{'model':db[_0x23fd2c['model']],'as':_0x23fd2c['as'],'attributes':_0x23fd2c[_0x2273('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1fa32b){logger[_0x2273('0xe')](_0x2273('0x19'),_0x10d644);logger[_0x2273('0x11')](_0x2273('0x19'),_0x10d644,JSON['stringify'](_0x1fa32b));_0x559dc3(_0x1fa32b);})[_0x2273('0x18')](function(_0x3105c3){logger[_0x2273('0x14')]('GetVoiceQueueReport',_0x3105c3['message'],_0x10d644);_0x550d53(_0x391cd2[_0x2273('0x14')](0x1f4,_0x3105c3[_0x2273('0x16')]));});});};exports[_0x2273('0x22')]=function(_0x36a5b7){var _0x3fbeaf=this;return new Promise(function(_0x56e11c,_0x2253e9){return db[_0x2273('0x1a')][_0x2273('0x23')](_0x36a5b7[_0x2273('0x24')],{'raw':_0x36a5b7[_0x2273('0x1c')]?_0x36a5b7['options'][_0x2273('0x25')]===undefined?!![]:![]:!![]})[_0x2273('0xd')](function(_0xc94f35){logger['info'](_0x2273('0x22'),_0x36a5b7);logger['debug'](_0x2273('0x22'),_0x36a5b7,JSON['stringify'](_0xc94f35));_0x56e11c(_0xc94f35);})[_0x2273('0x18')](function(_0x5713d8){logger[_0x2273('0x14')](_0x2273('0x22'),_0x5713d8[_0x2273('0x16')],_0x36a5b7);_0x2253e9(_0x3fbeaf[_0x2273('0x14')](0x1f4,_0x5713d8['message']));});});};exports[_0x2273('0x26')]=function(_0x1ab522){var _0x3536e3=this;return new Promise(function(_0x5a0ba4,_0x1fecbc){return db[_0x2273('0x1a')][_0x2273('0x27')](_0x1ab522[_0x2273('0x24')],{'raw':_0x1ab522[_0x2273('0x1c')]?_0x1ab522[_0x2273('0x1c')][_0x2273('0x25')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ab522[_0x2273('0x1c')]?_0x1ab522[_0x2273('0x1c')]['where']||null:null,'attributes':_0x1ab522['options']?_0x1ab522['options']['attributes']||null:null,'limit':_0x1ab522[_0x2273('0x1c')]?_0x1ab522['options'][_0x2273('0x28')]||null:null})[_0x2273('0xd')](function(_0x1fe5d7){logger[_0x2273('0xe')](_0x2273('0x26'),_0x1ab522);logger['debug'](_0x2273('0x26'),_0x1ab522,JSON[_0x2273('0x13')](_0x1fe5d7));_0x5a0ba4(_0x1fe5d7);})[_0x2273('0x18')](function(_0x20dd7b){logger[_0x2273('0x14')](_0x2273('0x26'),_0x20dd7b[_0x2273('0x16')],_0x1ab522);_0x1fecbc(_0x3536e3[_0x2273('0x14')](0x1f4,_0x20dd7b[_0x2273('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 7320e14..5f64984 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 _0x7b83=['save','remove','emit','removeListener','register','./voiceQueueReport.events'];(function(_0x233b29,_0x167b3e){var _0x9346e0=function(_0x1bc2db){while(--_0x1bc2db){_0x233b29['push'](_0x233b29['shift']());}};_0x9346e0(++_0x167b3e);}(_0x7b83,0xa1));var _0x37b8=function(_0x40c547,_0x4638bc){_0x40c547=_0x40c547-0x0;var _0x4c67bf=_0x7b83[_0x40c547];return _0x4c67bf;};'use strict';var VoiceQueueReportEvents=require(_0x37b8('0x0'));var events=[_0x37b8('0x1'),_0x37b8('0x2'),'update'];function createListener(_0x562827,_0x788dfd){return function(_0x37c7d0){_0x788dfd[_0x37b8('0x3')](_0x562827,_0x37c7d0);};}function removeListener(_0x48aaa1,_0x420271){return function(){VoiceQueueReportEvents[_0x37b8('0x4')](_0x48aaa1,_0x420271);};}exports[_0x37b8('0x5')]=function(_0x2a5439){for(var _0x4102eb=0x0,_0x220cd2=events['length'];_0x4102eb<_0x220cd2;_0x4102eb++){var _0x45e094=events[_0x4102eb];var _0xc3ab5b=createListener('voiceQueueReport:'+_0x45e094,_0x2a5439);VoiceQueueReportEvents['on'](_0x45e094,_0xc3ab5b);}}; \ No newline at end of file +var _0x2cde=['update','emit','register','length','voiceQueueReport:','./voiceQueueReport.events','save','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2cde,0x1ed));var _0xe2cd=function(_0x4326eb,_0x1801c5){_0x4326eb=_0x4326eb-0x0;var _0x2735a3=_0x2cde[_0x4326eb];return _0x2735a3;};'use strict';var VoiceQueueReportEvents=require(_0xe2cd('0x0'));var events=[_0xe2cd('0x1'),_0xe2cd('0x2'),_0xe2cd('0x3')];function createListener(_0x443c98,_0x238874){return function(_0x2f4fc7){_0x238874[_0xe2cd('0x4')](_0x443c98,_0x2f4fc7);};}function removeListener(_0x21475e,_0xae6ee3){return function(){VoiceQueueReportEvents['removeListener'](_0x21475e,_0xae6ee3);};}exports[_0xe2cd('0x5')]=function(_0x337ac8){for(var _0x5af2d2=0x0,_0x500a6c=events[_0xe2cd('0x6')];_0x5af2d2<_0x500a6c;_0x5af2d2++){var _0x22e3a7=events[_0x5af2d2];var _0x5b2b59=createListener(_0xe2cd('0x7')+_0x22e3a7,_0x337ac8);VoiceQueueReportEvents['on'](_0x22e3a7,_0x5b2b59);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 702e6ab..127f49d 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 _0x8782=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','isAuthenticated','get','/:id','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x4f9415,_0x11717e){var _0x487c86=function(_0x41cbd6){while(--_0x41cbd6){_0x4f9415['push'](_0x4f9415['shift']());}};_0x487c86(++_0x11717e);}(_0x8782,0x17a));var _0x2878=function(_0x407565,_0x4c4d59){_0x407565=_0x407565-0x0;var _0x543a7c=_0x8782[_0x407565];return _0x543a7c;};'use strict';var multer=require(_0x2878('0x0'));var util=require(_0x2878('0x1'));var path=require(_0x2878('0x2'));var timeout=require(_0x2878('0x3'));var express=require(_0x2878('0x4'));var router=express[_0x2878('0x5')]();var fs_extra=require(_0x2878('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x2878('0x7'));var config=require(_0x2878('0x8'));var controller=require(_0x2878('0x9'));router['get']('/',auth[_0x2878('0xa')](),controller['index']);router[_0x2878('0xb')](_0x2878('0xc'),auth[_0x2878('0xa')](),controller['show']);router[_0x2878('0xd')]('/',auth['isAuthenticated'](),controller[_0x2878('0xe')]);router[_0x2878('0xf')](_0x2878('0xc'),auth[_0x2878('0xa')](),controller[_0x2878('0x10')]);router[_0x2878('0x11')](_0x2878('0xc'),auth[_0x2878('0xa')](),controller[_0x2878('0x12')]);module[_0x2878('0x13')]=router; \ No newline at end of file +var _0x053f=['isAuthenticated','show','create','put','destroy','multer','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','index','/:id'];(function(_0x2913fb,_0x56f496){var _0x147bad=function(_0x4f2b6c){while(--_0x4f2b6c){_0x2913fb['push'](_0x2913fb['shift']());}};_0x147bad(++_0x56f496);}(_0x053f,0x7d));var _0xf053=function(_0x379e23,_0x2cd7d8){_0x379e23=_0x379e23-0x0;var _0x7fc2dc=_0x053f[_0x379e23];return _0x7fc2dc;};'use strict';var multer=require(_0xf053('0x0'));var util=require('util');var path=require(_0xf053('0x1'));var timeout=require(_0xf053('0x2'));var express=require(_0xf053('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf053('0x4'));var config=require(_0xf053('0x5'));var controller=require(_0xf053('0x6'));router[_0xf053('0x7')]('/',auth['isAuthenticated'](),controller[_0xf053('0x8')]);router[_0xf053('0x7')](_0xf053('0x9'),auth[_0xf053('0xa')](),controller[_0xf053('0xb')]);router['post']('/',auth[_0xf053('0xa')](),controller[_0xf053('0xc')]);router[_0xf053('0xd')](_0xf053('0x9'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xf053('0xa')](),controller[_0xf053('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 40d281e..13853dc 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 _0x5c1f=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','exports','STRING'];(function(_0x4690a8,_0x250671){var _0x52e447=function(_0x5d74f6){while(--_0x5d74f6){_0x4690a8['push'](_0x4690a8['shift']());}};_0x52e447(++_0x250671);}(_0x5c1f,0x1b3));var _0xf5c1=function(_0x48c4ef,_0x319d44){_0x48c4ef=_0x48c4ef-0x0;var _0x435715=_0x5c1f[_0x48c4ef];return _0x435715;};'use strict';var Sequelize=require(_0xf5c1('0x0'));var moment=require('moment');module[_0xf5c1('0x1')]={'time':{'type':Sequelize[_0xf5c1('0x2')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xf5c1('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xf5c1('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xf5c1('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xf5c1('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xf5c1('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xf5c1('0x3')],'allowNull':![],'defaultValue':moment()[_0xf5c1('0x4')](_0xf5c1('0x5'))}}; \ No newline at end of file +var _0x0af5=['exports','STRING','format','YYYY-MM-DD\x20HH:mm:ss','moment'];(function(_0x510850,_0xe75806){var _0x4874ad=function(_0x5b9da2){while(--_0x5b9da2){_0x510850['push'](_0x510850['shift']());}};_0x4874ad(++_0xe75806);}(_0x0af5,0x158));var _0x50af=function(_0x5d8963,_0x10b680){_0x5d8963=_0x5d8963-0x0;var _0x1cab3c=_0x0af5[_0x5d8963];return _0x1cab3c;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x50af('0x0'));module[_0x50af('0x1')]={'time':{'type':Sequelize[_0x50af('0x2')]},'callid':{'type':Sequelize[_0x50af('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x50af('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x50af('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x50af('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x50af('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x50af('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x50af('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x50af('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x50af('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0x50af('0x3')](_0x50af('0x4'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 9a56355..9a6d974 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 _0xdf0a=['map','rawAttributes','fieldName','type','keys','query','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','where','pick','filters','filter','merge','VIRTUAL','options','VoiceQueuesLog','include','rows','catch','show','params','length','includeAll','create','body','find','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','limit','undefined','offset','count','set','Content-Range','json','reject','save','update','then','error','stack','name','index'];(function(_0x4480f8,_0x364a3d){var _0x4550f6=function(_0x49e8ca){while(--_0x49e8ca){_0x4480f8['push'](_0x4480f8['shift']());}};_0x4550f6(++_0x364a3d);}(_0xdf0a,0x148));var _0xadf0=function(_0xf44739,_0x4568b1){_0xf44739=_0xf44739-0x0;var _0x12edaf=_0xdf0a[_0xf44739];return _0x12edaf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xadf0('0x0'));var zipdir=require(_0xadf0('0x1'));var jsonpatch=require(_0xadf0('0x2'));var rp=require(_0xadf0('0x3'));var moment=require(_0xadf0('0x4'));var BPromise=require(_0xadf0('0x5'));var Mustache=require(_0xadf0('0x6'));var util=require('util');var path=require(_0xadf0('0x7'));var sox=require(_0xadf0('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xadf0('0x9'));var _=require(_0xadf0('0xa'));var squel=require(_0xadf0('0xb'));var crypto=require(_0xadf0('0xc'));var jsforce=require(_0xadf0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xadf0('0xe'));var querystring=require('querystring');var Papa=require(_0xadf0('0xf'));var Redis=require(_0xadf0('0x10'));var authService=require(_0xadf0('0x11'));var qs=require(_0xadf0('0x12'));var as=require(_0xadf0('0x13'));var hardwareService=require(_0xadf0('0x14'));var logger=require(_0xadf0('0x15'))(_0xadf0('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xadf0('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x347333,_0x35863c){_0x35863c=_0x35863c||0xcc;return function(_0x5a5515){if(_0x5a5515){return _0x347333[_0xadf0('0x18')](_0x35863c);}return _0x347333[_0xadf0('0x19')](_0x35863c)[_0xadf0('0x1a')]();};}function respondWithResult(_0x4bdbc1,_0x318121){_0x318121=_0x318121||0xc8;return function(_0x277382){if(_0x277382){return _0x4bdbc1[_0xadf0('0x19')](_0x318121)['json'](_0x277382);}};}function respondWithFilteredResult(_0x6ac337,_0xe5d1d7){return function(_0x39b044){if(_0x39b044){var _0x51cd2f=typeof _0xe5d1d7['offset']==='undefined'&&typeof _0xe5d1d7[_0xadf0('0x1b')]===_0xadf0('0x1c');var _0x447022=_0x39b044['count'];var _0x13d71a=_0x51cd2f?0x0:_0xe5d1d7[_0xadf0('0x1d')];var _0x29fea6=_0x51cd2f?_0x39b044[_0xadf0('0x1e')]:_0xe5d1d7[_0xadf0('0x1d')]+_0xe5d1d7[_0xadf0('0x1b')];var _0x20bc77;if(_0x29fea6>=_0x447022){_0x29fea6=_0x447022;_0x20bc77=0xc8;}else{_0x20bc77=0xce;}_0x6ac337['status'](_0x20bc77);return _0x6ac337[_0xadf0('0x1f')](_0xadf0('0x20'),_0x13d71a+'-'+_0x29fea6+'/'+_0x447022)[_0xadf0('0x21')](_0x39b044);}return null;};}function patchUpdates(_0x37d206){return function(_0x1a4f10){try{jsonpatch['apply'](_0x1a4f10,_0x37d206,!![]);}catch(_0x1bdb37){return BPromise[_0xadf0('0x22')](_0x1bdb37);}return _0x1a4f10[_0xadf0('0x23')]();};}function saveUpdates(_0x345928,_0x771d9){return function(_0x417fcc){if(_0x417fcc){return _0x417fcc[_0xadf0('0x24')](_0x345928)[_0xadf0('0x25')](function(_0x2c859f){return _0x2c859f;});}return null;};}function removeEntity(_0x2f58d5,_0x3dae8b){return function(_0x4a2d71){if(_0x4a2d71){return _0x4a2d71['destroy']()[_0xadf0('0x25')](function(){_0x2f58d5[_0xadf0('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1736ff,_0x22bd12){return function(_0x30d5b5){if(!_0x30d5b5){_0x1736ff[_0xadf0('0x18')](0x194);}return _0x30d5b5;};}function handleError(_0x382141,_0x383dd7){_0x383dd7=_0x383dd7||0x1f4;return function(_0x4bc936){logger[_0xadf0('0x26')](_0x4bc936[_0xadf0('0x27')]);if(_0x4bc936[_0xadf0('0x28')]){delete _0x4bc936[_0xadf0('0x28')];}_0x382141[_0xadf0('0x19')](_0x383dd7)['send'](_0x4bc936);};}exports[_0xadf0('0x29')]=function(_0x374148,_0xdbd88e){var _0x36ae37={},_0x57ca0a={},_0x399f8b={'count':0x0,'rows':[]};var _0x44d735=_[_0xadf0('0x2a')](db['VoiceQueuesLog'][_0xadf0('0x2b')],function(_0x200a26){return{'name':_0x200a26[_0xadf0('0x2c')],'type':_0x200a26[_0xadf0('0x2d')]['key']};});_0x57ca0a['model']=_[_0xadf0('0x2a')](_0x44d735,_0xadf0('0x28'));_0x57ca0a['query']=_[_0xadf0('0x2e')](_0x374148[_0xadf0('0x2f')]);_0x57ca0a['filters']=_['intersection'](_0x57ca0a[_0xadf0('0x30')],_0x57ca0a['query']);_0x36ae37[_0xadf0('0x31')]=_[_0xadf0('0x32')](_0x57ca0a[_0xadf0('0x30')],qs[_0xadf0('0x33')](_0x374148['query'][_0xadf0('0x33')]));_0x36ae37[_0xadf0('0x31')]=_0x36ae37[_0xadf0('0x31')]['length']?_0x36ae37[_0xadf0('0x31')]:_0x57ca0a[_0xadf0('0x30')];if(!_0x374148[_0xadf0('0x2f')][_0xadf0('0x34')](_0xadf0('0x35'))){_0x36ae37[_0xadf0('0x1b')]=qs[_0xadf0('0x1b')](_0x374148[_0xadf0('0x2f')]['limit']);_0x36ae37[_0xadf0('0x1d')]=qs[_0xadf0('0x1d')](_0x374148['query']['offset']);}_0x36ae37[_0xadf0('0x36')]=qs['sort'](_0x374148[_0xadf0('0x2f')]['sort']);_0x36ae37[_0xadf0('0x37')]=qs['filters'](_[_0xadf0('0x38')](_0x374148[_0xadf0('0x2f')],_0x57ca0a[_0xadf0('0x39')]),_0x44d735);if(_0x374148['query'][_0xadf0('0x3a')]){_0x36ae37['where']=_[_0xadf0('0x3b')](_0x36ae37[_0xadf0('0x37')],{'$or':_[_0xadf0('0x2a')](_0x44d735,function(_0x57eb83){if(_0x57eb83[_0xadf0('0x2d')]!==_0xadf0('0x3c')){var _0x50f65f={};_0x50f65f[_0x57eb83[_0xadf0('0x28')]]={'$like':'%'+_0x374148[_0xadf0('0x2f')]['filter']+'%'};return _0x50f65f;}})});}_0x36ae37=_[_0xadf0('0x3b')]({},_0x36ae37,_0x374148[_0xadf0('0x3d')]);var _0x3b0f6b={'where':_0x36ae37['where']};return db[_0xadf0('0x3e')][_0xadf0('0x1e')](_0x3b0f6b)[_0xadf0('0x25')](function(_0x565780){_0x399f8b[_0xadf0('0x1e')]=_0x565780;if(_0x374148[_0xadf0('0x2f')]['includeAll']){_0x36ae37[_0xadf0('0x3f')]=[{'all':!![]}];}return db[_0xadf0('0x3e')]['findAll'](_0x36ae37);})[_0xadf0('0x25')](function(_0x45263a){_0x399f8b[_0xadf0('0x40')]=_0x45263a;return _0x399f8b;})[_0xadf0('0x25')](respondWithFilteredResult(_0xdbd88e,_0x36ae37))[_0xadf0('0x41')](handleError(_0xdbd88e,null));};exports[_0xadf0('0x42')]=function(_0x3e3e45,_0x5671f3){var _0x188a65={'raw':!![],'where':{'id':_0x3e3e45[_0xadf0('0x43')]['id']}},_0x166761={};_0x166761[_0xadf0('0x30')]=_[_0xadf0('0x2e')](db['VoiceQueuesLog'][_0xadf0('0x2b')]);_0x166761[_0xadf0('0x2f')]=_[_0xadf0('0x2e')](_0x3e3e45['query']);_0x166761[_0xadf0('0x39')]=_[_0xadf0('0x32')](_0x166761[_0xadf0('0x30')],_0x166761[_0xadf0('0x2f')]);_0x188a65['attributes']=_[_0xadf0('0x32')](_0x166761['model'],qs['fields'](_0x3e3e45[_0xadf0('0x2f')][_0xadf0('0x33')]));_0x188a65[_0xadf0('0x31')]=_0x188a65['attributes'][_0xadf0('0x44')]?_0x188a65['attributes']:_0x166761[_0xadf0('0x30')];if(_0x3e3e45[_0xadf0('0x2f')][_0xadf0('0x45')]){_0x188a65[_0xadf0('0x3f')]=[{'all':!![]}];}_0x188a65=_[_0xadf0('0x3b')]({},_0x188a65,_0x3e3e45['options']);return db['VoiceQueuesLog']['find'](_0x188a65)['then'](handleEntityNotFound(_0x5671f3,null))[_0xadf0('0x25')](respondWithResult(_0x5671f3,null))['catch'](handleError(_0x5671f3,null));};exports[_0xadf0('0x46')]=function(_0x526e94,_0x45efc6){return db[_0xadf0('0x3e')]['create'](_0x526e94[_0xadf0('0x47')],{})['then'](respondWithResult(_0x45efc6,0xc9))[_0xadf0('0x41')](handleError(_0x45efc6,null));};exports[_0xadf0('0x24')]=function(_0x5a5b34,_0x423089){if(_0x5a5b34[_0xadf0('0x47')]['id']){delete _0x5a5b34[_0xadf0('0x47')]['id'];}return db[_0xadf0('0x3e')][_0xadf0('0x48')]({'where':{'id':_0x5a5b34['params']['id']}})[_0xadf0('0x25')](handleEntityNotFound(_0x423089,null))[_0xadf0('0x25')](saveUpdates(_0x5a5b34[_0xadf0('0x47')],null))['then'](respondWithResult(_0x423089,null))['catch'](handleError(_0x423089,null));};exports[_0xadf0('0x49')]=function(_0x1a83ab,_0x2c6eb8){return db['VoiceQueuesLog'][_0xadf0('0x48')]({'where':{'id':_0x1a83ab['params']['id']}})[_0xadf0('0x25')](handleEntityNotFound(_0x2c6eb8,null))[_0xadf0('0x25')](removeEntity(_0x2c6eb8,null))['catch'](handleError(_0x2c6eb8,null));}; \ No newline at end of file +var _0x1819=['attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','includeAll','include','findAll','rows','catch','show','params','keys','options','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','update','then','end','stack','name','send','index','VoiceQueuesLog','rawAttributes','fieldName','type','model','map','query','intersection'];(function(_0x2f90d8,_0x480000){var _0x21011a=function(_0x1bc8a5){while(--_0x1bc8a5){_0x2f90d8['push'](_0x2f90d8['shift']());}};_0x21011a(++_0x480000);}(_0x1819,0x1ce));var _0x9181=function(_0x4ca333,_0x1218a3){_0x4ca333=_0x4ca333-0x0;var _0x13b2e1=_0x1819[_0x4ca333];return _0x13b2e1;};'use strict';var emlformat=require(_0x9181('0x0'));var rimraf=require(_0x9181('0x1'));var zipdir=require(_0x9181('0x2'));var jsonpatch=require(_0x9181('0x3'));var rp=require('request-promise');var moment=require(_0x9181('0x4'));var BPromise=require(_0x9181('0x5'));var Mustache=require('mustache');var util=require(_0x9181('0x6'));var path=require(_0x9181('0x7'));var sox=require(_0x9181('0x8'));var csv=require(_0x9181('0x9'));var ejs=require(_0x9181('0xa'));var fs=require('fs');var fs_extra=require(_0x9181('0xb'));var _=require(_0x9181('0xc'));var squel=require(_0x9181('0xd'));var crypto=require('crypto');var jsforce=require(_0x9181('0xe'));var deskjs=require(_0x9181('0xf'));var toCsv=require('to-csv');var querystring=require(_0x9181('0x10'));var Papa=require(_0x9181('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9181('0x12'));var as=require(_0x9181('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9181('0x14'));var utils=require(_0x9181('0x15'));var config=require(_0x9181('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x9181('0x17'))['db'];function respondWithStatusCode(_0x349d38,_0x410dea){_0x410dea=_0x410dea||0xcc;return function(_0x149680){if(_0x149680){return _0x349d38[_0x9181('0x18')](_0x410dea);}return _0x349d38[_0x9181('0x19')](_0x410dea)['end']();};}function respondWithResult(_0x51e365,_0x2ba54a){_0x2ba54a=_0x2ba54a||0xc8;return function(_0x54a855){if(_0x54a855){return _0x51e365[_0x9181('0x19')](_0x2ba54a)[_0x9181('0x1a')](_0x54a855);}};}function respondWithFilteredResult(_0x4f22da,_0x42e69e){return function(_0x3b353a){if(_0x3b353a){var _0x51f1ac=typeof _0x42e69e['offset']===_0x9181('0x1b')&&typeof _0x42e69e[_0x9181('0x1c')]==='undefined';var _0x21bcba=_0x3b353a[_0x9181('0x1d')];var _0x1e7db1=_0x51f1ac?0x0:_0x42e69e['offset'];var _0x77585a=_0x51f1ac?_0x3b353a[_0x9181('0x1d')]:_0x42e69e[_0x9181('0x1e')]+_0x42e69e['limit'];var _0x10924c;if(_0x77585a>=_0x21bcba){_0x77585a=_0x21bcba;_0x10924c=0xc8;}else{_0x10924c=0xce;}_0x4f22da['status'](_0x10924c);return _0x4f22da[_0x9181('0x1f')](_0x9181('0x20'),_0x1e7db1+'-'+_0x77585a+'/'+_0x21bcba)[_0x9181('0x1a')](_0x3b353a);}return null;};}function patchUpdates(_0x4f548d){return function(_0x2d2f7f){try{jsonpatch['apply'](_0x2d2f7f,_0x4f548d,!![]);}catch(_0x14025f){return BPromise[_0x9181('0x21')](_0x14025f);}return _0x2d2f7f['save']();};}function saveUpdates(_0x3fe396,_0xb690a){return function(_0x109bcd){if(_0x109bcd){return _0x109bcd[_0x9181('0x22')](_0x3fe396)[_0x9181('0x23')](function(_0x475abe){return _0x475abe;});}return null;};}function removeEntity(_0x24ca44,_0x1cbcec){return function(_0x35f035){if(_0x35f035){return _0x35f035['destroy']()[_0x9181('0x23')](function(){_0x24ca44[_0x9181('0x19')](0xcc)[_0x9181('0x24')]();});}};}function handleEntityNotFound(_0x897aa,_0x30a76a){return function(_0x4c12d7){if(!_0x4c12d7){_0x897aa[_0x9181('0x18')](0x194);}return _0x4c12d7;};}function handleError(_0x461785,_0x19133c){_0x19133c=_0x19133c||0x1f4;return function(_0x20bac8){logger['error'](_0x20bac8[_0x9181('0x25')]);if(_0x20bac8[_0x9181('0x26')]){delete _0x20bac8['name'];}_0x461785[_0x9181('0x19')](_0x19133c)[_0x9181('0x27')](_0x20bac8);};}exports[_0x9181('0x28')]=function(_0x5e2adb,_0x25cb79){var _0x4d002c={},_0x34250b={},_0x36e44d={'count':0x0,'rows':[]};var _0xa32926=_['map'](db[_0x9181('0x29')][_0x9181('0x2a')],function(_0x4ff868){return{'name':_0x4ff868[_0x9181('0x2b')],'type':_0x4ff868[_0x9181('0x2c')]['key']};});_0x34250b[_0x9181('0x2d')]=_[_0x9181('0x2e')](_0xa32926,_0x9181('0x26'));_0x34250b[_0x9181('0x2f')]=_['keys'](_0x5e2adb['query']);_0x34250b['filters']=_[_0x9181('0x30')](_0x34250b[_0x9181('0x2d')],_0x34250b[_0x9181('0x2f')]);_0x4d002c[_0x9181('0x31')]=_[_0x9181('0x30')](_0x34250b['model'],qs[_0x9181('0x32')](_0x5e2adb['query'][_0x9181('0x32')]));_0x4d002c[_0x9181('0x31')]=_0x4d002c[_0x9181('0x31')][_0x9181('0x33')]?_0x4d002c['attributes']:_0x34250b[_0x9181('0x2d')];if(!_0x5e2adb[_0x9181('0x2f')][_0x9181('0x34')](_0x9181('0x35'))){_0x4d002c[_0x9181('0x1c')]=qs['limit'](_0x5e2adb[_0x9181('0x2f')][_0x9181('0x1c')]);_0x4d002c[_0x9181('0x1e')]=qs[_0x9181('0x1e')](_0x5e2adb['query'][_0x9181('0x1e')]);}_0x4d002c['order']=qs[_0x9181('0x36')](_0x5e2adb['query']['sort']);_0x4d002c['where']=qs[_0x9181('0x37')](_[_0x9181('0x38')](_0x5e2adb[_0x9181('0x2f')],_0x34250b['filters']),_0xa32926);if(_0x5e2adb[_0x9181('0x2f')][_0x9181('0x39')]){_0x4d002c[_0x9181('0x3a')]=_[_0x9181('0x3b')](_0x4d002c[_0x9181('0x3a')],{'$or':_[_0x9181('0x2e')](_0xa32926,function(_0x5ea9c3){if(_0x5ea9c3[_0x9181('0x2c')]!=='VIRTUAL'){var _0x1ecab8={};_0x1ecab8[_0x5ea9c3['name']]={'$like':'%'+_0x5e2adb['query'][_0x9181('0x39')]+'%'};return _0x1ecab8;}})});}_0x4d002c=_['merge']({},_0x4d002c,_0x5e2adb['options']);var _0x40e43b={'where':_0x4d002c['where']};return db[_0x9181('0x29')][_0x9181('0x1d')](_0x40e43b)[_0x9181('0x23')](function(_0x5ac983){_0x36e44d[_0x9181('0x1d')]=_0x5ac983;if(_0x5e2adb['query'][_0x9181('0x3c')]){_0x4d002c[_0x9181('0x3d')]=[{'all':!![]}];}return db[_0x9181('0x29')][_0x9181('0x3e')](_0x4d002c);})['then'](function(_0x3e1cd2){_0x36e44d[_0x9181('0x3f')]=_0x3e1cd2;return _0x36e44d;})[_0x9181('0x23')](respondWithFilteredResult(_0x25cb79,_0x4d002c))[_0x9181('0x40')](handleError(_0x25cb79,null));};exports[_0x9181('0x41')]=function(_0x2205ca,_0xcdcc7){var _0x2f3ba3={'raw':!![],'where':{'id':_0x2205ca[_0x9181('0x42')]['id']}},_0x2c5adc={};_0x2c5adc['model']=_[_0x9181('0x43')](db[_0x9181('0x29')][_0x9181('0x2a')]);_0x2c5adc[_0x9181('0x2f')]=_[_0x9181('0x43')](_0x2205ca['query']);_0x2c5adc[_0x9181('0x37')]=_[_0x9181('0x30')](_0x2c5adc[_0x9181('0x2d')],_0x2c5adc[_0x9181('0x2f')]);_0x2f3ba3[_0x9181('0x31')]=_[_0x9181('0x30')](_0x2c5adc[_0x9181('0x2d')],qs[_0x9181('0x32')](_0x2205ca['query'][_0x9181('0x32')]));_0x2f3ba3[_0x9181('0x31')]=_0x2f3ba3[_0x9181('0x31')][_0x9181('0x33')]?_0x2f3ba3['attributes']:_0x2c5adc[_0x9181('0x2d')];if(_0x2205ca[_0x9181('0x2f')][_0x9181('0x3c')]){_0x2f3ba3[_0x9181('0x3d')]=[{'all':!![]}];}_0x2f3ba3=_[_0x9181('0x3b')]({},_0x2f3ba3,_0x2205ca[_0x9181('0x44')]);return db[_0x9181('0x29')]['find'](_0x2f3ba3)['then'](handleEntityNotFound(_0xcdcc7,null))['then'](respondWithResult(_0xcdcc7,null))[_0x9181('0x40')](handleError(_0xcdcc7,null));};exports[_0x9181('0x45')]=function(_0x308875,_0x38cbf0){return db['VoiceQueuesLog']['create'](_0x308875[_0x9181('0x46')],{})[_0x9181('0x23')](respondWithResult(_0x38cbf0,0xc9))[_0x9181('0x40')](handleError(_0x38cbf0,null));};exports['update']=function(_0x44bd7,_0x1b8455){if(_0x44bd7[_0x9181('0x46')]['id']){delete _0x44bd7['body']['id'];}return db[_0x9181('0x29')][_0x9181('0x47')]({'where':{'id':_0x44bd7['params']['id']}})['then'](handleEntityNotFound(_0x1b8455,null))[_0x9181('0x23')](saveUpdates(_0x44bd7[_0x9181('0x46')],null))['then'](respondWithResult(_0x1b8455,null))[_0x9181('0x40')](handleError(_0x1b8455,null));};exports[_0x9181('0x48')]=function(_0x59cb64,_0x18d30a){return db['VoiceQueuesLog'][_0x9181('0x47')]({'where':{'id':_0x59cb64[_0x9181('0x42')]['id']}})['then'](handleEntityNotFound(_0x18d30a,null))['then'](removeEntity(_0x18d30a,null))['catch'](handleError(_0x18d30a,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 3121bc6..79be2da 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 _0x1714=['rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x1714,0x160));var _0x4171=function(_0x5e5fa2,_0xca8c02){_0x5e5fa2=_0x5e5fa2-0x0;var _0x12c987=_0x1714[_0x5e5fa2];return _0x12c987;};'use strict';var _=require(_0x4171('0x0'));var util=require(_0x4171('0x1'));var logger=require(_0x4171('0x2'))(_0x4171('0x3'));var moment=require(_0x4171('0x4'));var BPromise=require(_0x4171('0x5'));var rp=require(_0x4171('0x6'));var fs=require('fs');var path=require(_0x4171('0x7'));var rimraf=require(_0x4171('0x8'));var config=require(_0x4171('0x9'));var attributes=require(_0x4171('0xa'));module[_0x4171('0xb')]=function(_0x3e12f6,_0x409436){return _0x3e12f6[_0x4171('0xc')](_0x4171('0xd'),attributes,{'tableName':_0x4171('0xe'),'paranoid':![],'indexes':[{'name':_0x4171('0xf'),'fields':[_0x4171('0x10'),_0x4171('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0xf1c5=['rimraf','../../config/environment','define','voice_queues_log','event_dtm','event','dtm','api','moment','bluebird','request-promise'];(function(_0x485ba7,_0x3b5d42){var _0x5ec0b6=function(_0x38340f){while(--_0x38340f){_0x485ba7['push'](_0x485ba7['shift']());}};_0x5ec0b6(++_0x3b5d42);}(_0xf1c5,0x151));var _0x5f1c=function(_0x27de9a,_0x5f2c97){_0x27de9a=_0x27de9a-0x0;var _0x43b0d1=_0xf1c5[_0x27de9a];return _0x43b0d1;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x5f1c('0x0'));var moment=require(_0x5f1c('0x1'));var BPromise=require(_0x5f1c('0x2'));var rp=require(_0x5f1c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5f1c('0x4'));var config=require(_0x5f1c('0x5'));var attributes=require('./voiceQueuesLog.attributes');module['exports']=function(_0xba695b,_0x589ce4){return _0xba695b[_0x5f1c('0x6')]('VoiceQueuesLog',attributes,{'tableName':_0x5f1c('0x7'),'paranoid':![],'indexes':[{'name':_0x5f1c('0x8'),'fields':[_0x5f1c('0x9'),_0x5f1c('0xa')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index fc6c530..3616d44 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 _0x1e91=['VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','result','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug'];(function(_0x11c225,_0x117302){var _0x488623=function(_0x227765){while(--_0x227765){_0x11c225['push'](_0x11c225['shift']());}};_0x488623(++_0x117302);}(_0x1e91,0xe3));var _0x11e9=function(_0x3ad7ad,_0x291a8d){_0x3ad7ad=_0x3ad7ad-0x0;var _0x225a60=_0x1e91[_0x3ad7ad];return _0x225a60;};'use strict';var _=require('lodash');var util=require(_0x11e9('0x0'));var moment=require('moment');var BPromise=require(_0x11e9('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x11e9('0x2'));var db=require(_0x11e9('0x3'))['db'];var utils=require(_0x11e9('0x4'));var logger=require(_0x11e9('0x5'))('rpc');var config=require(_0x11e9('0x6'));var jayson=require(_0x11e9('0x7'));var client=jayson[_0x11e9('0x8')][_0x11e9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20954e,_0x32ced5,_0x56ef81){return new BPromise(function(_0x579026,_0xc95e3c){return client[_0x11e9('0xa')](_0x20954e,_0x56ef81)[_0x11e9('0xb')](function(_0x1a4fd8){logger[_0x11e9('0xc')]('VoiceQueuesLog,\x20%s,\x20%s',_0x32ced5,_0x11e9('0xd'));logger[_0x11e9('0xe')](_0x11e9('0xf'),_0x32ced5,_0x11e9('0xd'),JSON[_0x11e9('0x10')](_0x1a4fd8));if(_0x1a4fd8[_0x11e9('0x11')]){if(_0x1a4fd8[_0x11e9('0x11')][_0x11e9('0x12')]===0x1f4){logger[_0x11e9('0x11')](_0x11e9('0x13'),_0x32ced5,_0x1a4fd8['error'][_0x11e9('0x14')]);return _0xc95e3c(_0x1a4fd8[_0x11e9('0x11')][_0x11e9('0x14')]);}logger[_0x11e9('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x32ced5,_0x1a4fd8[_0x11e9('0x11')]['message']);return _0x579026(_0x1a4fd8['error'][_0x11e9('0x14')]);}else{logger[_0x11e9('0xc')](_0x11e9('0x13'),_0x32ced5,_0x11e9('0xd'));_0x579026(_0x1a4fd8[_0x11e9('0x15')][_0x11e9('0x14')]);}})['catch'](function(_0x952f3f){logger[_0x11e9('0x11')](_0x11e9('0x13'),_0x32ced5,_0x952f3f);_0xc95e3c(_0x952f3f);});});} \ No newline at end of file +var _0x64bb=['error','code','message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceQueuesLog,\x20%s,\x20%s','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x64bb,0x68));var _0xb64b=function(_0x519333,_0x10bea4){_0x519333=_0x519333-0x0;var _0x246657=_0x64bb[_0x519333];return _0x246657;};'use strict';var _=require('lodash');var util=require(_0xb64b('0x0'));var moment=require(_0xb64b('0x1'));var BPromise=require('bluebird');var rs=require(_0xb64b('0x2'));var fs=require('fs');var Redis=require(_0xb64b('0x3'));var db=require(_0xb64b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb64b('0x5'))(_0xb64b('0x6'));var config=require(_0xb64b('0x7'));var jayson=require(_0xb64b('0x8'));var client=jayson[_0xb64b('0x9')][_0xb64b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2acae4,_0xeedfc2,_0x35bd4d){return new BPromise(function(_0x3fed6e,_0x21b2f7){return client['request'](_0x2acae4,_0x35bd4d)[_0xb64b('0xb')](function(_0xb58607){logger[_0xb64b('0xc')](_0xb64b('0xd'),_0xeedfc2,'request\x20sent');logger['debug'](_0xb64b('0xe'),_0xeedfc2,'request\x20sent',JSON[_0xb64b('0xf')](_0xb58607));if(_0xb58607[_0xb64b('0x10')]){if(_0xb58607[_0xb64b('0x10')][_0xb64b('0x11')]===0x1f4){logger[_0xb64b('0x10')](_0xb64b('0xd'),_0xeedfc2,_0xb58607[_0xb64b('0x10')][_0xb64b('0x12')]);return _0x21b2f7(_0xb58607[_0xb64b('0x10')][_0xb64b('0x12')]);}logger[_0xb64b('0x10')](_0xb64b('0xd'),_0xeedfc2,_0xb58607[_0xb64b('0x10')][_0xb64b('0x12')]);return _0x3fed6e(_0xb58607[_0xb64b('0x10')][_0xb64b('0x12')]);}else{logger[_0xb64b('0xc')](_0xb64b('0xd'),_0xeedfc2,'request\x20sent');_0x3fed6e(_0xb58607['result'][_0xb64b('0x12')]);}})[_0xb64b('0x13')](function(_0x4636d5){logger[_0xb64b('0x10')](_0xb64b('0xd'),_0xeedfc2,_0x4636d5);_0x21b2f7(_0x4636d5);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 2427827..d7133ef 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 _0xa971=['/:id','show','/:id/downloads','/:id/transcribe','post','runTranscribe','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','describe'];(function(_0x5b290f,_0x3f6490){var _0x3b54f4=function(_0x4f6353){while(--_0x4f6353){_0x5b290f['push'](_0x5b290f['shift']());}};_0x3b54f4(++_0x3f6490);}(_0xa971,0xdc));var _0x1a97=function(_0x43ddd1,_0x3f4da1){_0x43ddd1=_0x43ddd1-0x0;var _0x13da10=_0xa971[_0x43ddd1];return _0x13da10;};'use strict';var multer=require(_0x1a97('0x0'));var util=require(_0x1a97('0x1'));var path=require('path');var timeout=require(_0x1a97('0x2'));var express=require(_0x1a97('0x3'));var router=express[_0x1a97('0x4')]();var fs_extra=require(_0x1a97('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1a97('0x6'));var controller=require('./voiceRecording.controller');router[_0x1a97('0x7')]('/',auth[_0x1a97('0x8')](),controller[_0x1a97('0x9')]);router[_0x1a97('0x7')]('/describe',auth[_0x1a97('0x8')](),controller[_0x1a97('0xa')]);router[_0x1a97('0x7')](_0x1a97('0xb'),auth['isAuthenticated'](),controller[_0x1a97('0xc')]);router[_0x1a97('0x7')]('/:id/download',auth[_0x1a97('0x8')](),controller['download']);router[_0x1a97('0x7')](_0x1a97('0xd'),controller['downloads']);router[_0x1a97('0x7')](_0x1a97('0xe'),auth[_0x1a97('0x8')](),controller['downloadTranscribe']);router['post']('/',auth[_0x1a97('0x8')](),controller['create']);router[_0x1a97('0xf')](_0x1a97('0xe'),auth['isAuthenticated'](),controller[_0x1a97('0x10')]);router[_0x1a97('0x11')]('/:id',auth[_0x1a97('0x8')](),controller[_0x1a97('0x12')]);router[_0x1a97('0x13')](_0x1a97('0xb'),auth[_0x1a97('0x8')](),controller[_0x1a97('0x14')]);module['exports']=router; \ No newline at end of file +var _0x46dc=['../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','describe','/:id','/:id/download','download','downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','put','destroy','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4f51c4,_0x3bb380){var _0xd7d2cf=function(_0x3031f4){while(--_0x3031f4){_0x4f51c4['push'](_0x4f51c4['shift']());}};_0xd7d2cf(++_0x3bb380);}(_0x46dc,0x1f4));var _0xc46d=function(_0xd1f420,_0x390898){_0xd1f420=_0xd1f420-0x0;var _0x48c383=_0x46dc[_0xd1f420];return _0x48c383;};'use strict';var multer=require('multer');var util=require(_0xc46d('0x0'));var path=require('path');var timeout=require(_0xc46d('0x1'));var express=require(_0xc46d('0x2'));var router=express['Router']();var fs_extra=require(_0xc46d('0x3'));var auth=require(_0xc46d('0x4'));var interaction=require(_0xc46d('0x5'));var config=require(_0xc46d('0x6'));var controller=require(_0xc46d('0x7'));router[_0xc46d('0x8')]('/',auth[_0xc46d('0x9')](),controller[_0xc46d('0xa')]);router[_0xc46d('0x8')]('/describe',auth[_0xc46d('0x9')](),controller[_0xc46d('0xb')]);router[_0xc46d('0x8')](_0xc46d('0xc'),auth[_0xc46d('0x9')](),controller['show']);router[_0xc46d('0x8')](_0xc46d('0xd'),auth[_0xc46d('0x9')](),controller[_0xc46d('0xe')]);router[_0xc46d('0x8')]('/:id/downloads',controller[_0xc46d('0xf')]);router['get'](_0xc46d('0x10'),auth[_0xc46d('0x9')](),controller[_0xc46d('0x11')]);router[_0xc46d('0x12')]('/',auth[_0xc46d('0x9')](),controller[_0xc46d('0x13')]);router['post'](_0xc46d('0x10'),auth[_0xc46d('0x9')](),controller[_0xc46d('0x14')]);router[_0xc46d('0x15')](_0xc46d('0xc'),auth[_0xc46d('0x9')](),controller['update']);router['delete'](_0xc46d('0xc'),auth[_0xc46d('0x9')](),controller[_0xc46d('0x16')]);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 8e0534a..4bf6a4e 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(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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 11a8b5e..ecf2dfc 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 _0x134f=['NEW','data2','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','.txt','Transcript\x20not\x20available','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','uuid/v4','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','apply','save','update','then','error','name','send','index','map','VoiceRecording','rawAttributes','type','differenceBy','format','keys','query','intersection','attributes','model','fields','length','nolimit','sort','where','pick','filters','filter','merge','options','includeAll','include','rows','catch','show','params','find','create','body','describe','download','../../components/encryptor','uniqueid','value','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','MD5','col','token','push','$and','decryptFile','secrets','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','existsSync','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','File:\x20\x22','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)','Location','bucket','Bucket','location','TranscriptionJobName','transcribeName','TranscriptionJob','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','%s.cypher','recording','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeRegion','language','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','transcribeAccountId','Cloud\x20Provider\x20not\x20configured','data1','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available'];(function(_0x5c1996,_0x2fceb7){var _0x1d64e0=function(_0x218939){while(--_0x218939){_0x5c1996['push'](_0x5c1996['shift']());}};_0x1d64e0(++_0x2fceb7);}(_0x134f,0x135));var _0xf134=function(_0x389c9f,_0x5d3e49){_0x389c9f=_0x389c9f-0x0;var _0x22a908=_0x134f[_0x389c9f];return _0x22a908;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf134('0x0'));var zipdir=require(_0xf134('0x1'));var jsonpatch=require(_0xf134('0x2'));var rp=require(_0xf134('0x3'));var moment=require(_0xf134('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf134('0x5'));var util=require(_0xf134('0x6'));var path=require(_0xf134('0x7'));var sox=require(_0xf134('0x8'));var csv=require(_0xf134('0x9'));var ejs=require(_0xf134('0xa'));var fs=require('fs');var fs_extra=require(_0xf134('0xb'));var _=require(_0xf134('0xc'));var squel=require('squel');var crypto=require(_0xf134('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf134('0xe'));var toCsv=require(_0xf134('0x9'));var querystring=require(_0xf134('0xf'));var Papa=require(_0xf134('0x10'));var AWS=require('aws-sdk');var uuidv4=require(_0xf134('0x11'));var Redis=require('ioredis');var authService=require(_0xf134('0x12'));var qs=require(_0xf134('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf134('0x14'));var logger=require(_0xf134('0x15'))('api');var utils=require(_0xf134('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xf134('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cca20,_0x2b4388){_0x2b4388=_0x2b4388||0xcc;return function(_0x1fe01b){if(_0x1fe01b){return _0x4cca20[_0xf134('0x18')](_0x2b4388);}return _0x4cca20['status'](_0x2b4388)[_0xf134('0x19')]();};}function respondWithResult(_0x93037,_0x3e6369){_0x3e6369=_0x3e6369||0xc8;return function(_0x25df9f){if(_0x25df9f){return _0x93037['status'](_0x3e6369)['json'](_0x25df9f);}};}function respondWithFilteredResult(_0x37dd9e,_0x358d1d){return function(_0x1146fd){if(_0x1146fd){var _0x5a39c6=typeof _0x358d1d[_0xf134('0x1a')]===_0xf134('0x1b')&&typeof _0x358d1d[_0xf134('0x1c')]===_0xf134('0x1b');var _0x2db3a4=_0x1146fd['count'];var _0x4e099f=_0x5a39c6?0x0:_0x358d1d[_0xf134('0x1a')];var _0x5644f0=_0x5a39c6?_0x1146fd[_0xf134('0x1d')]:_0x358d1d[_0xf134('0x1a')]+_0x358d1d[_0xf134('0x1c')];var _0xc23e80;if(_0x5644f0>=_0x2db3a4){_0x5644f0=_0x2db3a4;_0xc23e80=0xc8;}else{_0xc23e80=0xce;}_0x37dd9e[_0xf134('0x1e')](_0xc23e80);return _0x37dd9e[_0xf134('0x1f')](_0xf134('0x20'),_0x4e099f+'-'+_0x5644f0+'/'+_0x2db3a4)[_0xf134('0x21')](_0x1146fd);}return null;};}function patchUpdates(_0x18f8f1){return function(_0x227daf){try{jsonpatch[_0xf134('0x22')](_0x227daf,_0x18f8f1,!![]);}catch(_0x167352){return BPromise['reject'](_0x167352);}return _0x227daf[_0xf134('0x23')]();};}function saveUpdates(_0x151186,_0x55747c){return function(_0x2a4331){if(_0x2a4331){return _0x2a4331[_0xf134('0x24')](_0x151186)[_0xf134('0x25')](function(_0x23e4d6){return _0x23e4d6;});}return null;};}function removeEntity(_0x5e85ec,_0x4b894d){return function(_0x35beec){if(_0x35beec){return _0x35beec['destroy']()[_0xf134('0x25')](function(){_0x5e85ec['status'](0xcc)[_0xf134('0x19')]();});}};}function handleEntityNotFound(_0x555016,_0x2fada6){return function(_0x2b118e){if(!_0x2b118e){_0x555016[_0xf134('0x18')](0x194);}return _0x2b118e;};}function handleError(_0x411c3b,_0x3665bc){_0x3665bc=_0x3665bc||0x1f4;return function(_0x543916){logger[_0xf134('0x26')](_0x543916['stack']);if(_0x543916[_0xf134('0x27')]){delete _0x543916[_0xf134('0x27')];}_0x411c3b[_0xf134('0x1e')](_0x3665bc)[_0xf134('0x28')](_0x543916);};}exports[_0xf134('0x29')]=function(_0x42dc2e,_0x17c456){var _0x322be1={},_0x2aa9d0={},_0x589b50={'count':0x0,'rows':[]};var _0x251a9f=_[_0xf134('0x2a')](db[_0xf134('0x2b')][_0xf134('0x2c')],function(_0x48fbce){return{'name':_0x48fbce['fieldName'],'type':_0x48fbce[_0xf134('0x2d')]['key']};});_0x2aa9d0['model']=_[_0xf134('0x2e')](_[_0xf134('0x2a')](_0x251a9f,'name'),[_0xf134('0x2f')]);_0x2aa9d0['query']=_[_0xf134('0x30')](_0x42dc2e[_0xf134('0x31')]);_0x2aa9d0['filters']=_[_0xf134('0x32')](_0x2aa9d0['model'],_0x2aa9d0[_0xf134('0x31')]);_0x322be1[_0xf134('0x33')]=_[_0xf134('0x32')](_0x2aa9d0[_0xf134('0x34')],qs[_0xf134('0x35')](_0x42dc2e[_0xf134('0x31')]['fields']));_0x322be1['attributes']=_0x322be1[_0xf134('0x33')][_0xf134('0x36')]?_0x322be1[_0xf134('0x33')]:_0x2aa9d0['model'];if(!_0x42dc2e[_0xf134('0x31')]['hasOwnProperty'](_0xf134('0x37'))){_0x322be1[_0xf134('0x1c')]=qs[_0xf134('0x1c')](_0x42dc2e[_0xf134('0x31')][_0xf134('0x1c')]);_0x322be1['offset']=qs[_0xf134('0x1a')](_0x42dc2e[_0xf134('0x31')]['offset']);}_0x322be1['order']=qs['sort'](_0x42dc2e[_0xf134('0x31')][_0xf134('0x38')]);_0x322be1[_0xf134('0x39')]=qs['filters'](_[_0xf134('0x3a')](_0x42dc2e[_0xf134('0x31')],_0x2aa9d0[_0xf134('0x3b')]),_0x251a9f);if(_0x42dc2e[_0xf134('0x31')][_0xf134('0x3c')]){_0x322be1[_0xf134('0x39')]=_[_0xf134('0x3d')](_0x322be1[_0xf134('0x39')],{'$or':_[_0xf134('0x2a')](_0x251a9f,function(_0x5a6fdf){if(_0x5a6fdf['type']!=='VIRTUAL'){var _0x492e4f={};_0x492e4f[_0x5a6fdf[_0xf134('0x27')]]={'$like':'%'+_0x42dc2e['query'][_0xf134('0x3c')]+'%'};return _0x492e4f;}})});}_0x322be1=_[_0xf134('0x3d')]({},_0x322be1,_0x42dc2e[_0xf134('0x3e')]);var _0x5af956={'where':_0x322be1['where']};return db[_0xf134('0x2b')][_0xf134('0x1d')](_0x5af956)[_0xf134('0x25')](function(_0x4bcdad){_0x589b50['count']=_0x4bcdad;if(_0x42dc2e[_0xf134('0x31')][_0xf134('0x3f')]){_0x322be1[_0xf134('0x40')]=[{'all':!![]}];}return db[_0xf134('0x2b')]['findAll'](_0x322be1);})['then'](function(_0x308000){_0x589b50[_0xf134('0x41')]=_0x308000;return _0x589b50;})[_0xf134('0x25')](respondWithFilteredResult(_0x17c456,_0x322be1))[_0xf134('0x42')](handleError(_0x17c456,null));};exports[_0xf134('0x43')]=function(_0x16e678,_0x470645){var _0x3169e0={'raw':![],'where':{'id':_0x16e678[_0xf134('0x44')]['id']}},_0x2d7620={};_0x2d7620[_0xf134('0x34')]=_[_0xf134('0x30')](db[_0xf134('0x2b')][_0xf134('0x2c')]);_0x2d7620['query']=_['keys'](_0x16e678[_0xf134('0x31')]);_0x2d7620[_0xf134('0x3b')]=_['intersection'](_0x2d7620[_0xf134('0x34')],_0x2d7620[_0xf134('0x31')]);_0x3169e0[_0xf134('0x33')]=_['intersection'](_0x2d7620['model'],qs[_0xf134('0x35')](_0x16e678[_0xf134('0x31')][_0xf134('0x35')]));_0x3169e0['attributes']=_0x3169e0[_0xf134('0x33')]['length']?_0x3169e0[_0xf134('0x33')]:_0x2d7620['model'];if(_0x16e678[_0xf134('0x31')][_0xf134('0x3f')]){_0x3169e0[_0xf134('0x40')]=[{'all':!![]}];}_0x3169e0=_['merge']({},_0x3169e0,_0x16e678[_0xf134('0x3e')]);return db[_0xf134('0x2b')][_0xf134('0x45')](_0x3169e0)['then'](handleEntityNotFound(_0x470645,null))[_0xf134('0x25')](respondWithResult(_0x470645,null))[_0xf134('0x42')](handleError(_0x470645,null));};exports[_0xf134('0x46')]=function(_0x3fed08,_0x425907){return db['VoiceRecording']['create'](_0x3fed08[_0xf134('0x47')],{})[_0xf134('0x25')](respondWithResult(_0x425907,0xc9))[_0xf134('0x42')](handleError(_0x425907,null));};exports[_0xf134('0x24')]=function(_0x1e9b09,_0xfbd98d){if(_0x1e9b09[_0xf134('0x47')]['id']){delete _0x1e9b09[_0xf134('0x47')]['id'];}return db[_0xf134('0x2b')][_0xf134('0x45')]({'where':{'id':_0x1e9b09[_0xf134('0x44')]['id']}})[_0xf134('0x25')](handleEntityNotFound(_0xfbd98d,null))[_0xf134('0x25')](saveUpdates(_0x1e9b09['body'],null))[_0xf134('0x25')](respondWithResult(_0xfbd98d,null))[_0xf134('0x42')](handleError(_0xfbd98d,null));};exports[_0xf134('0x48')]=function(_0xa7bb32,_0xd83764){return db[_0xf134('0x2b')][_0xf134('0x48')]()['then'](respondWithResult(_0xd83764,null))[_0xf134('0x42')](handleError(_0xd83764,null));};exports[_0xf134('0x49')]=function(_0x1fb842,_0x17234a,_0xc40033){var _0x4fe9f6=require(_0xf134('0x4a'));var _0x55786f=![];var _0x346ade={};if(_0x1fb842[_0xf134('0x31')]['type']&&_0x1fb842[_0xf134('0x31')][_0xf134('0x2d')]===_0xf134('0x4b')){_0x346ade['uniqueid']=_0x1fb842[_0xf134('0x44')]['id'];}else{_0x346ade['id']=_0x1fb842[_0xf134('0x44')]['id'];}return db['VoiceRecording']['find']({'where':_0x346ade,'attributes':['id',_0xf134('0x4c')],'raw':!![]})[_0xf134('0x25')](handleEntityNotFound(_0x17234a,null))[_0xf134('0x25')](function(_0x17800b){if(_0x17800b){var _0x2e93b7=_0x17800b['value'];var _0xc7766=util[_0xf134('0x2f')]('%s.cypher',_0x2e93b7);if(fs['existsSync'](_0xc7766)){_0x55786f=!![];return _0x4fe9f6['decryptFile'](_0xc7766,_0x2e93b7,config['secrets']['recording'])[_0xf134('0x25')](function(){return _0x17800b;});}return _0x17800b;}})['then'](function(_0x1e39ba){if(_0x1e39ba){var _0x214dbb=_0x1e39ba[_0xf134('0x4c')];if(!fs['existsSync'](_0x214dbb)){throw new db[(_0xf134('0x4d'))][(_0xf134('0x4e'))](_0xf134('0x4f'));}if(_0x1e39ba[_0xf134('0x50')]){return _0x17234a['download'](_0x214dbb,_0x1e39ba['filename']+path[_0xf134('0x51')](_0x214dbb),function(){if(_0x55786f){fs[_0xf134('0x52')](_0x214dbb);}});}else{return _0x17234a[_0xf134('0x49')](_0x214dbb,function(_0x429bbd){if(_0x55786f){fs[_0xf134('0x52')](_0x214dbb);}});}}})[_0xf134('0x42')](function(_0x4f140d){if(_0x4f140d[_0xf134('0x53')]===_0xf134('0x4f')){_0x17234a[_0xf134('0x1e')](0x194)[_0xf134('0x28')](_0xf134('0x54'));}else{return handleError(_0x17234a,null);}});};exports[_0xf134('0x55')]=function(_0xb40df4,_0x4d3f96,_0x40b182){var _0x22ca65=require('../../components/encryptor');var _0x28945a=![];var _0x13cd10={'$and':[db['sequelize'][_0xf134('0x39')](db['sequelize']['fn'](_0xf134('0x56'),db['sequelize'][_0xf134('0x57')](_0xf134('0x4b'))),_0xb40df4[_0xf134('0x31')][_0xf134('0x58')])]};if(_0xb40df4[_0xf134('0x31')][_0xf134('0x2d')]&&_0xb40df4['query']['type']===_0xf134('0x4b')){_0x13cd10['$and'][_0xf134('0x59')]({'uniqueid':_0xb40df4[_0xf134('0x44')]['id']});}else{_0x13cd10[_0xf134('0x5a')]['push']({'id':_0xb40df4[_0xf134('0x44')]['id']});}return db[_0xf134('0x2b')][_0xf134('0x45')]({'where':_0x13cd10,'attributes':['id',_0xf134('0x4c')],'raw':!![]})['then'](handleEntityNotFound(_0x4d3f96,null))['then'](function(_0x204df7){if(_0x204df7){var _0x203f81=util[_0xf134('0x2f')]('%s.cypher',_0x204df7[_0xf134('0x4c')]);if(fs['existsSync'](_0x203f81)){_0x28945a=!![];return _0x22ca65[_0xf134('0x5b')](_0x203f81,_0x204df7[_0xf134('0x4c')],config[_0xf134('0x5c')]['recording'])[_0xf134('0x25')](function(){return _0x204df7;});}return _0x204df7;}})[_0xf134('0x25')](function(_0x406a6a){if(_0x406a6a){if(!fs['existsSync'](_0x406a6a[_0xf134('0x4c')])){throw new db[(_0xf134('0x4d'))][(_0xf134('0x4e'))](_0xf134('0x4f'));}if(_0x406a6a['filename']){return _0x4d3f96[_0xf134('0x49')](_0x406a6a[_0xf134('0x4c')],_0x406a6a[_0xf134('0x50')]+path['extname'](_0x406a6a[_0xf134('0x4c')]),function(){if(_0x28945a){fs[_0xf134('0x52')](_0x406a6a[_0xf134('0x4c')]);}});}else{return _0x4d3f96[_0xf134('0x49')](_0x406a6a[_0xf134('0x4c')],function(_0x21b2b1){if(_0x28945a){fs['unlink'](_0x406a6a[_0xf134('0x4c')]);}});}}})[_0xf134('0x42')](handleError(_0x4d3f96,null));};exports[_0xf134('0x5d')]=function(_0x401753,_0x4fb5e0){return db['VoiceRecording'][_0xf134('0x45')]({'where':{'id':_0x401753[_0xf134('0x44')]['id']}})[_0xf134('0x25')](function(_0x18c0cc){if(_[_0xf134('0x5e')](_0x18c0cc)){throw new ReferenceError(_0xf134('0x5f'));}return _0x18c0cc;})[_0xf134('0x25')](function(_0x548b5a){var _0xa77606=_0x548b5a['value'];logger[_0xf134('0x60')](_0xf134('0x61'),_0xa77606);if(!_[_0xf134('0x5e')](_0x548b5a[_0xf134('0x4c')])&&fs[_0xf134('0x62')](_0xa77606)){logger['info']('File:\x20\x22'+_0xa77606+_0xf134('0x63'));fs[_0xf134('0x64')](_0xa77606);}_0xa77606=_0xa77606+'.cypher';if(!_[_0xf134('0x5e')](_0x548b5a['value'])&&fs['existsSync'](_0xa77606)){logger['info'](_0xf134('0x65')+_0xa77606+_0xf134('0x63'));fs[_0xf134('0x64')](_0xa77606);}return _0x548b5a;})['then'](function(_0x5e5659){if(!_0x5e5659)throw new InternalError();return _0x5e5659['destroy']();})[_0xf134('0x25')](function(){_0x4fb5e0['status'](0xcc)[_0xf134('0x19')]();})['catch'](handleError(_0x4fb5e0,null));};function getBucketslist(_0x153f41,_0x3de74e,_0x4fc2ed){return new Promise(function(_0x3a95b3,_0xcde439){var _0x4962cc=new AWS['S3']({'accessKeyId':_0x3de74e,'secretAccessKey':_0x153f41,'region':_0x4fc2ed});_0x4962cc['listBuckets']({},function(_0x1a882c,_0x4afd75){if(_0x1a882c){return _0xcde439(_0x1a882c);}else{return _0x3a95b3(_0x4afd75);}});});}function createBucket(_0x53a670,_0xc7facb,_0x532ec9,_0x3c7244){return new Promise(function(_0x44da5b,_0x1eb4e5){var _0x261ac4=new AWS['S3']({'accessKeyId':_0xc7facb,'secretAccessKey':_0x53a670,'region':_0x532ec9});_0x261ac4[_0xf134('0x66')]({'Bucket':_0x3c7244},function(_0xa22f01,_0x3b2e40){if(_0xa22f01){return _0x1eb4e5(_0xa22f01);}else{return _0x44da5b(_0x3b2e40);}});});}function uploadFile(_0x4d7d93,_0x48e44d,_0x5d30fb,_0x30e378,_0x12c4aa,_0xd5e548){return new Promise(function(_0x3e0352,_0x126d15){var _0x426abc=new AWS['S3']({'accessKeyId':_0x48e44d,'secretAccessKey':_0x4d7d93,'region':_0x5d30fb});_0x426abc[_0xf134('0x67')]({'Bucket':_0x30e378,'Key':_0x12c4aa,'Body':_0xd5e548},function(_0x4c9b34,_0x5c758f){if(_0x4c9b34){return _0x126d15(_0x4c9b34);}else{return _0x3e0352(_0x5c758f);}});});}function startTranscribe(_0x27ebd3,_0x3d09c9,_0x459fd2,_0xf8d75b,_0x183146,_0x304050){return new Promise(function(_0x538db3,_0x5928f5){var _0x176a95=new AWS[(_0xf134('0x68'))]({'accessKeyId':_0x3d09c9,'secretAccessKey':_0x27ebd3,'region':_0x459fd2});_0x176a95[_0xf134('0x69')]({'TranscriptionJobName':_0xf8d75b,'LanguageCode':_0x183146,'Media':{'MediaFileUri':_0x304050}},function(_0x5f583a,_0x270c72){if(_0x5f583a){return _0x5928f5(_0x5f583a);}else{return _0x538db3(_0x270c72);}});});}function transcribe(_0x59a9ff,_0x377af4,_0x2e6ccd,_0x5537a6,_0x5ee4a8,_0x2d8689,_0x49ae89){return new Promise(function(_0x24c533,_0x592b5a){var _0x14e450={};logger['info'](util[_0xf134('0x2f')](_0xf134('0x6a'),_0x59a9ff,_0x5ee4a8));return uploadFile(_0x377af4,_0x2e6ccd,_0x5537a6,_0x5ee4a8,path[_0xf134('0x6b')](_0x2d8689),fs[_0xf134('0x6c')](_0x2d8689))[_0xf134('0x25')](function(_0xe88305){logger['info'](util['format'](_0xf134('0x6d'),_0x59a9ff,_0x5ee4a8,_0xe88305[_0xf134('0x6e')]));_0x14e450[_0xf134('0x6f')]=_0xe88305[_0xf134('0x70')];_0x14e450[_0xf134('0x71')]=_0xe88305[_0xf134('0x6e')];logger[_0xf134('0x60')](util[_0xf134('0x2f')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x59a9ff));return startTranscribe(_0x377af4,_0x2e6ccd,_0x5537a6,uuidv4(),_0x49ae89,_0xe88305[_0xf134('0x6e')]);})[_0xf134('0x25')](function(_0x3f90e3){logger[_0xf134('0x60')](util[_0xf134('0x2f')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x59a9ff,_0x3f90e3['TranscriptionJob'][_0xf134('0x72')]));_0x14e450[_0xf134('0x73')]=_0x3f90e3[_0xf134('0x74')][_0xf134('0x72')];_0x14e450[_0xf134('0x75')]=_0x3f90e3[_0xf134('0x74')][_0xf134('0x76')];return _0x24c533(_0x14e450);})['catch'](function(_0x331edd){return _0x592b5a(_0x331edd);});});}exports[_0xf134('0x77')]=function(_0x3a0578,_0x3d943f,_0x40c199){var _0x1ff8a7;var _0x5a4890;var _0x25e577;var _0x24c62d=require(_0xf134('0x4a'));return db[_0xf134('0x2b')][_0xf134('0x78')]({'where':{'id':_0x3a0578['params']['id']}})['then'](function(_0x370c4f){if(_0x370c4f){var _0x5b2067=util['format'](_0xf134('0x79'),_0x370c4f['value']);if(fs[_0xf134('0x62')](_0x5b2067)){cypher=!![];return _0x24c62d[_0xf134('0x5b')](_0x5b2067,_0x370c4f[_0xf134('0x4c')],config[_0xf134('0x5c')][_0xf134('0x7a')])[_0xf134('0x25')](function(){return _0x370c4f;});}return _0x370c4f;}})[_0xf134('0x25')](function(_0x10f785){if(!_0x10f785){throw new db['Sequelize'][(_0xf134('0x4e'))](_0xf134('0x7b'));}_0x5a4890=_0x10f785;return db[_0xf134('0x7c')]['findOne']({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x3d943f,null))[_0xf134('0x25')](function(_0x4446c1){if(_0x4446c1){_0x1ff8a7=_0x4446c1;if(!_0x1ff8a7[_0xf134('0x7d')]||!_0x1ff8a7['transcribeAccountId']||!_0x1ff8a7[_0xf134('0x7e')]||!_0x1ff8a7[_0xf134('0x7f')]||!_0x1ff8a7[_0xf134('0x6f')]){throw new db['Sequelize']['ValidationError']('Transcribe\x20not\x20configured');}if(_0x3a0578[_0xf134('0x47')][_0xf134('0x80')]&&(!_0x1ff8a7[_0xf134('0x81')]||!_0x1ff8a7[_0xf134('0x82')]||!_0x1ff8a7[_0xf134('0x83')]||!_0x1ff8a7[_0xf134('0x7f')]||!_0x1ff8a7[_0xf134('0x6f')])){throw new db[(_0xf134('0x4d'))]['ValidationError'](_0xf134('0x84'));}return db[_0xf134('0x85')][_0xf134('0x78')]({'where':{'id':_0x1ff8a7[_0xf134('0x86')]}});}})['then'](function(_0x49b927){if(!_0x49b927){throw new db[(_0xf134('0x4d'))][(_0xf134('0x4e'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x49b927['data1']||!_0x49b927['data2']){throw new db[(_0xf134('0x4d'))]['ValidationError'](_0xf134('0x87'));}_0x25e577=_0x49b927;return getBucketslist(_0x25e577[_0xf134('0x88')],_0x25e577['data2'],_0x1ff8a7[_0xf134('0x7e')]);})['then'](function(_0xe673d2){if(_0xe673d2&&_0xe673d2[_0xf134('0x89')]){var _0x12ef34=_['find'](_0xe673d2['Buckets'],function(_0x153fbf){return _0x153fbf[_0xf134('0x8a')]===_0x1ff8a7['bucket'];});if(!_0x12ef34){logger[_0xf134('0x60')](util[_0xf134('0x2f')](_0xf134('0x8b'),_0x3a0578[_0xf134('0x44')]['id'],_0x1ff8a7[_0xf134('0x6f')]));return createBucket(_0x25e577[_0xf134('0x88')],_0x25e577['data2'],_0x1ff8a7[_0xf134('0x7e')],_0x1ff8a7[_0xf134('0x6f')]);}logger[_0xf134('0x60')](util[_0xf134('0x2f')](_0xf134('0x8c'),_0x3a0578[_0xf134('0x44')]['id'],_0x1ff8a7[_0xf134('0x6f')]));return;}})[_0xf134('0x25')](function(_0x5004f1){if(_0x5a4890[_0xf134('0x75')]===_0xf134('0x8d')){return transcribe(_0x3a0578['params']['id'],_0x25e577[_0xf134('0x88')],_0x25e577[_0xf134('0x8e')],_0x1ff8a7[_0xf134('0x7e')],_0x1ff8a7['bucket'],_0x5a4890[_0xf134('0x4c')],_0x1ff8a7[_0xf134('0x7f')]);}else{logger[_0xf134('0x60')](util[_0xf134('0x2f')](_0xf134('0x8f'),_0x3a0578[_0xf134('0x44')]['id']));return{'transcribeStatus':_0xf134('0x90')};}})['then'](function(_0x490047){if(_0x490047){_0x490047[_0xf134('0x91')]=_0x3a0578[_0xf134('0x47')]['runSentiment'];return _0x5a4890[_0xf134('0x92')](_0x490047);}})[_0xf134('0x25')](respondWithResult(_0x3d943f,null))[_0xf134('0x42')](handleError(_0x3d943f,null));};function writeFile(_0x5efcca,_0x9c3b55){return new Promise(function(_0x5a62dd,_0x2a90a5){fs[_0xf134('0x93')](_0x9c3b55,_0x5efcca,function(_0x35875e,_0x41fd8b){if(_0x35875e){return _0x2a90a5(_0x35875e);}else{return _0x5a62dd(_0x41fd8b);}});});}exports['downloadTranscribe']=function(_0x1a77e6,_0x28fc12,_0x17b9ec){return db[_0xf134('0x2b')][_0xf134('0x78')]({'where':{'id':_0x1a77e6[_0xf134('0x44')]['id']}})['then'](handleEntityNotFound(_0x28fc12))[_0xf134('0x25')](function(_0x1314c5){if(_0x1314c5&&_0x1314c5['fileText']){var _0x7c11b0=_0x1314c5['fileText'];var _0xd94ae1=config['root']+'/server/files/transcribes/transcribe_'+_0x1314c5['id']+_0xf134('0x94');if(fs[_0xf134('0x62')](_0xd94ae1)){return _0xd94ae1;}return writeFile(_0x7c11b0,_0xd94ae1)[_0xf134('0x25')](function(){return _0xd94ae1;});}else{throw new db['Sequelize'][(_0xf134('0x4e'))](_0xf134('0x95'));}})['then'](function(_0x4ef46c){return _0x28fc12[_0xf134('0x49')](_0x4ef46c);})[_0xf134('0x42')](handleError(_0x28fc12));}; \ No newline at end of file +var _0xebb6=['then','destroy','stack','name','send','index','map','VoiceRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','secrets','recording','Sequelize','filename','extname','unlink','message','VoiceRecording\x20not\x20found','Not\x20found','downloads','sequelize','MD5','col','token','push','$and','existsSync','decryptFile','ValidationError','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','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)','Location','Bucket','location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','transcribeName','TranscriptionJob','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribeAccountId','transcribeRegion','language','bucket','runSentiment','sentiment','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','Buckets','Name','data2','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','zip-dir','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','uuid/v4','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update'];(function(_0x337a40,_0x34f5fe){var _0x2dd1c8=function(_0x525a4d){while(--_0x525a4d){_0x337a40['push'](_0x337a40['shift']());}};_0x2dd1c8(++_0x34f5fe);}(_0xebb6,0x1b7));var _0x6ebb=function(_0x42f009,_0x5e27b1){_0x42f009=_0x42f009-0x0;var _0x22a1e0=_0xebb6[_0x42f009];return _0x22a1e0;};'use strict';var emlformat=require(_0x6ebb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6ebb('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6ebb('0x2'));var Mustache=require('mustache');var util=require(_0x6ebb('0x3'));var path=require(_0x6ebb('0x4'));var sox=require(_0x6ebb('0x5'));var csv=require(_0x6ebb('0x6'));var ejs=require(_0x6ebb('0x7'));var fs=require('fs');var fs_extra=require(_0x6ebb('0x8'));var _=require(_0x6ebb('0x9'));var squel=require(_0x6ebb('0xa'));var crypto=require(_0x6ebb('0xb'));var jsforce=require(_0x6ebb('0xc'));var deskjs=require(_0x6ebb('0xd'));var toCsv=require(_0x6ebb('0x6'));var querystring=require(_0x6ebb('0xe'));var Papa=require(_0x6ebb('0xf'));var AWS=require('aws-sdk');var uuidv4=require(_0x6ebb('0x10'));var Redis=require('ioredis');var authService=require(_0x6ebb('0x11'));var qs=require(_0x6ebb('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6ebb('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x6ebb('0x14'));var config=require(_0x6ebb('0x15'));var licenseUtil=require(_0x6ebb('0x16'));var db=require(_0x6ebb('0x17'))['db'];function respondWithStatusCode(_0x183738,_0x52923a){_0x52923a=_0x52923a||0xcc;return function(_0x1d22f8){if(_0x1d22f8){return _0x183738[_0x6ebb('0x18')](_0x52923a);}return _0x183738[_0x6ebb('0x19')](_0x52923a)[_0x6ebb('0x1a')]();};}function respondWithResult(_0x1aeaf1,_0x3ffc69){_0x3ffc69=_0x3ffc69||0xc8;return function(_0x25bea0){if(_0x25bea0){return _0x1aeaf1[_0x6ebb('0x19')](_0x3ffc69)[_0x6ebb('0x1b')](_0x25bea0);}};}function respondWithFilteredResult(_0x4e02d2,_0x58bb5f){return function(_0x2f44c4){if(_0x2f44c4){var _0x394511=typeof _0x58bb5f[_0x6ebb('0x1c')]===_0x6ebb('0x1d')&&typeof _0x58bb5f['limit']===_0x6ebb('0x1d');var _0x38c1c3=_0x2f44c4['count'];var _0x4bc830=_0x394511?0x0:_0x58bb5f[_0x6ebb('0x1c')];var _0xa4cafd=_0x394511?_0x2f44c4[_0x6ebb('0x1e')]:_0x58bb5f[_0x6ebb('0x1c')]+_0x58bb5f[_0x6ebb('0x1f')];var _0x532630;if(_0xa4cafd>=_0x38c1c3){_0xa4cafd=_0x38c1c3;_0x532630=0xc8;}else{_0x532630=0xce;}_0x4e02d2['status'](_0x532630);return _0x4e02d2[_0x6ebb('0x20')](_0x6ebb('0x21'),_0x4bc830+'-'+_0xa4cafd+'/'+_0x38c1c3)[_0x6ebb('0x1b')](_0x2f44c4);}return null;};}function patchUpdates(_0x469f30){return function(_0x4ac616){try{jsonpatch[_0x6ebb('0x22')](_0x4ac616,_0x469f30,!![]);}catch(_0x7230ff){return BPromise[_0x6ebb('0x23')](_0x7230ff);}return _0x4ac616[_0x6ebb('0x24')]();};}function saveUpdates(_0x46a5f5,_0x20035b){return function(_0xcc7c0f){if(_0xcc7c0f){return _0xcc7c0f[_0x6ebb('0x25')](_0x46a5f5)[_0x6ebb('0x26')](function(_0x105758){return _0x105758;});}return null;};}function removeEntity(_0x4cf27e,_0x46699c){return function(_0x4bf857){if(_0x4bf857){return _0x4bf857[_0x6ebb('0x27')]()['then'](function(){_0x4cf27e[_0x6ebb('0x19')](0xcc)[_0x6ebb('0x1a')]();});}};}function handleEntityNotFound(_0x3f203d,_0x56ac67){return function(_0x34e5de){if(!_0x34e5de){_0x3f203d['sendStatus'](0x194);}return _0x34e5de;};}function handleError(_0x4d1f12,_0xafe0b6){_0xafe0b6=_0xafe0b6||0x1f4;return function(_0x371d93){logger['error'](_0x371d93[_0x6ebb('0x28')]);if(_0x371d93[_0x6ebb('0x29')]){delete _0x371d93['name'];}_0x4d1f12[_0x6ebb('0x19')](_0xafe0b6)[_0x6ebb('0x2a')](_0x371d93);};}exports[_0x6ebb('0x2b')]=function(_0x1c7e07,_0x48416a){var _0x410fee={},_0x4cdf03={},_0x389878={'count':0x0,'rows':[]};var _0x5b691a=_[_0x6ebb('0x2c')](db[_0x6ebb('0x2d')][_0x6ebb('0x2e')],function(_0x3fc553){return{'name':_0x3fc553[_0x6ebb('0x2f')],'type':_0x3fc553[_0x6ebb('0x30')][_0x6ebb('0x31')]};});_0x4cdf03[_0x6ebb('0x32')]=_[_0x6ebb('0x33')](_['map'](_0x5b691a,_0x6ebb('0x29')),[_0x6ebb('0x34')]);_0x4cdf03[_0x6ebb('0x35')]=_[_0x6ebb('0x36')](_0x1c7e07[_0x6ebb('0x35')]);_0x4cdf03[_0x6ebb('0x37')]=_[_0x6ebb('0x38')](_0x4cdf03['model'],_0x4cdf03[_0x6ebb('0x35')]);_0x410fee[_0x6ebb('0x39')]=_['intersection'](_0x4cdf03[_0x6ebb('0x32')],qs[_0x6ebb('0x3a')](_0x1c7e07[_0x6ebb('0x35')]['fields']));_0x410fee[_0x6ebb('0x39')]=_0x410fee[_0x6ebb('0x39')][_0x6ebb('0x3b')]?_0x410fee[_0x6ebb('0x39')]:_0x4cdf03['model'];if(!_0x1c7e07[_0x6ebb('0x35')][_0x6ebb('0x3c')](_0x6ebb('0x3d'))){_0x410fee[_0x6ebb('0x1f')]=qs['limit'](_0x1c7e07[_0x6ebb('0x35')][_0x6ebb('0x1f')]);_0x410fee[_0x6ebb('0x1c')]=qs[_0x6ebb('0x1c')](_0x1c7e07[_0x6ebb('0x35')]['offset']);}_0x410fee['order']=qs[_0x6ebb('0x3e')](_0x1c7e07[_0x6ebb('0x35')]['sort']);_0x410fee[_0x6ebb('0x3f')]=qs[_0x6ebb('0x37')](_[_0x6ebb('0x40')](_0x1c7e07['query'],_0x4cdf03[_0x6ebb('0x37')]),_0x5b691a);if(_0x1c7e07[_0x6ebb('0x35')][_0x6ebb('0x41')]){_0x410fee[_0x6ebb('0x3f')]=_[_0x6ebb('0x42')](_0x410fee[_0x6ebb('0x3f')],{'$or':_[_0x6ebb('0x2c')](_0x5b691a,function(_0x1eee35){if(_0x1eee35['type']!==_0x6ebb('0x43')){var _0xe36cf2={};_0xe36cf2[_0x1eee35[_0x6ebb('0x29')]]={'$like':'%'+_0x1c7e07['query'][_0x6ebb('0x41')]+'%'};return _0xe36cf2;}})});}_0x410fee=_[_0x6ebb('0x42')]({},_0x410fee,_0x1c7e07[_0x6ebb('0x44')]);var _0x2f8d4f={'where':_0x410fee[_0x6ebb('0x3f')]};return db[_0x6ebb('0x2d')][_0x6ebb('0x1e')](_0x2f8d4f)['then'](function(_0x2e2ae8){_0x389878[_0x6ebb('0x1e')]=_0x2e2ae8;if(_0x1c7e07['query'][_0x6ebb('0x45')]){_0x410fee[_0x6ebb('0x46')]=[{'all':!![]}];}return db['VoiceRecording'][_0x6ebb('0x47')](_0x410fee);})['then'](function(_0x56514c){_0x389878[_0x6ebb('0x48')]=_0x56514c;return _0x389878;})[_0x6ebb('0x26')](respondWithFilteredResult(_0x48416a,_0x410fee))[_0x6ebb('0x49')](handleError(_0x48416a,null));};exports[_0x6ebb('0x4a')]=function(_0x573b46,_0x57784d){var _0x20d05c={'raw':![],'where':{'id':_0x573b46[_0x6ebb('0x4b')]['id']}},_0x24ad8c={};_0x24ad8c[_0x6ebb('0x32')]=_[_0x6ebb('0x36')](db[_0x6ebb('0x2d')][_0x6ebb('0x2e')]);_0x24ad8c[_0x6ebb('0x35')]=_[_0x6ebb('0x36')](_0x573b46[_0x6ebb('0x35')]);_0x24ad8c[_0x6ebb('0x37')]=_[_0x6ebb('0x38')](_0x24ad8c[_0x6ebb('0x32')],_0x24ad8c[_0x6ebb('0x35')]);_0x20d05c[_0x6ebb('0x39')]=_[_0x6ebb('0x38')](_0x24ad8c[_0x6ebb('0x32')],qs[_0x6ebb('0x3a')](_0x573b46['query'][_0x6ebb('0x3a')]));_0x20d05c[_0x6ebb('0x39')]=_0x20d05c[_0x6ebb('0x39')][_0x6ebb('0x3b')]?_0x20d05c[_0x6ebb('0x39')]:_0x24ad8c[_0x6ebb('0x32')];if(_0x573b46[_0x6ebb('0x35')][_0x6ebb('0x45')]){_0x20d05c[_0x6ebb('0x46')]=[{'all':!![]}];}_0x20d05c=_[_0x6ebb('0x42')]({},_0x20d05c,_0x573b46[_0x6ebb('0x44')]);return db[_0x6ebb('0x2d')]['find'](_0x20d05c)[_0x6ebb('0x26')](handleEntityNotFound(_0x57784d,null))['then'](respondWithResult(_0x57784d,null))['catch'](handleError(_0x57784d,null));};exports[_0x6ebb('0x4c')]=function(_0x785dc2,_0x1d59e7){return db[_0x6ebb('0x2d')]['create'](_0x785dc2[_0x6ebb('0x4d')],{})[_0x6ebb('0x26')](respondWithResult(_0x1d59e7,0xc9))['catch'](handleError(_0x1d59e7,null));};exports[_0x6ebb('0x25')]=function(_0x3aade4,_0x352bb2){if(_0x3aade4[_0x6ebb('0x4d')]['id']){delete _0x3aade4[_0x6ebb('0x4d')]['id'];}return db[_0x6ebb('0x2d')][_0x6ebb('0x4e')]({'where':{'id':_0x3aade4[_0x6ebb('0x4b')]['id']}})['then'](handleEntityNotFound(_0x352bb2,null))['then'](saveUpdates(_0x3aade4['body'],null))[_0x6ebb('0x26')](respondWithResult(_0x352bb2,null))['catch'](handleError(_0x352bb2,null));};exports[_0x6ebb('0x4f')]=function(_0x3c6e23,_0x4a30f4){return db[_0x6ebb('0x2d')][_0x6ebb('0x4f')]()[_0x6ebb('0x26')](respondWithResult(_0x4a30f4,null))[_0x6ebb('0x49')](handleError(_0x4a30f4,null));};exports[_0x6ebb('0x50')]=function(_0x48f5f4,_0x504ece,_0x1be854){var _0xce5ba8=require(_0x6ebb('0x51'));var _0x262e8e=![];var _0x298b86={};if(_0x48f5f4[_0x6ebb('0x35')][_0x6ebb('0x30')]&&_0x48f5f4[_0x6ebb('0x35')]['type']==='uniqueid'){_0x298b86[_0x6ebb('0x52')]=_0x48f5f4[_0x6ebb('0x4b')]['id'];}else{_0x298b86['id']=_0x48f5f4[_0x6ebb('0x4b')]['id'];}return db[_0x6ebb('0x2d')][_0x6ebb('0x4e')]({'where':_0x298b86,'attributes':['id',_0x6ebb('0x53')],'raw':!![]})[_0x6ebb('0x26')](handleEntityNotFound(_0x504ece,null))[_0x6ebb('0x26')](function(_0x2005d8){if(_0x2005d8){var _0x4d3834=_0x2005d8['value'];var _0x14e6d7=util['format'](_0x6ebb('0x54'),_0x4d3834);if(fs['existsSync'](_0x14e6d7)){_0x262e8e=!![];return _0xce5ba8['decryptFile'](_0x14e6d7,_0x4d3834,config[_0x6ebb('0x55')][_0x6ebb('0x56')])[_0x6ebb('0x26')](function(){return _0x2005d8;});}return _0x2005d8;}})[_0x6ebb('0x26')](function(_0x25d92c){if(_0x25d92c){var _0x37ec0b=_0x25d92c[_0x6ebb('0x53')];if(!fs['existsSync'](_0x37ec0b)){throw new db[(_0x6ebb('0x57'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x25d92c[_0x6ebb('0x58')]){return _0x504ece['download'](_0x37ec0b,_0x25d92c[_0x6ebb('0x58')]+path[_0x6ebb('0x59')](_0x37ec0b),function(){if(_0x262e8e){fs[_0x6ebb('0x5a')](_0x37ec0b);}});}else{return _0x504ece[_0x6ebb('0x50')](_0x37ec0b,function(_0xf7bbae){if(_0x262e8e){fs[_0x6ebb('0x5a')](_0x37ec0b);}});}}})[_0x6ebb('0x49')](function(_0x22d8ca){if(_0x22d8ca[_0x6ebb('0x5b')]===_0x6ebb('0x5c')){_0x504ece[_0x6ebb('0x19')](0x194)[_0x6ebb('0x2a')](_0x6ebb('0x5d'));}else{return handleError(_0x504ece,null);}});};exports[_0x6ebb('0x5e')]=function(_0x3618a9,_0x5c35b5,_0x38f69b){var _0x356c38=require(_0x6ebb('0x51'));var _0x25a2cd=![];var _0x5b26da={'$and':[db['sequelize']['where'](db[_0x6ebb('0x5f')]['fn'](_0x6ebb('0x60'),db[_0x6ebb('0x5f')][_0x6ebb('0x61')](_0x6ebb('0x52'))),_0x3618a9[_0x6ebb('0x35')][_0x6ebb('0x62')])]};if(_0x3618a9[_0x6ebb('0x35')][_0x6ebb('0x30')]&&_0x3618a9['query'][_0x6ebb('0x30')]===_0x6ebb('0x52')){_0x5b26da['$and'][_0x6ebb('0x63')]({'uniqueid':_0x3618a9[_0x6ebb('0x4b')]['id']});}else{_0x5b26da[_0x6ebb('0x64')][_0x6ebb('0x63')]({'id':_0x3618a9['params']['id']});}return db[_0x6ebb('0x2d')][_0x6ebb('0x4e')]({'where':_0x5b26da,'attributes':['id',_0x6ebb('0x53')],'raw':!![]})[_0x6ebb('0x26')](handleEntityNotFound(_0x5c35b5,null))[_0x6ebb('0x26')](function(_0x198af7){if(_0x198af7){var _0x430c82=util['format'](_0x6ebb('0x54'),_0x198af7[_0x6ebb('0x53')]);if(fs[_0x6ebb('0x65')](_0x430c82)){_0x25a2cd=!![];return _0x356c38[_0x6ebb('0x66')](_0x430c82,_0x198af7['value'],config[_0x6ebb('0x55')]['recording'])['then'](function(){return _0x198af7;});}return _0x198af7;}})['then'](function(_0x2e23a2){if(_0x2e23a2){if(!fs[_0x6ebb('0x65')](_0x2e23a2['value'])){throw new db[(_0x6ebb('0x57'))][(_0x6ebb('0x67'))](_0x6ebb('0x5c'));}if(_0x2e23a2['filename']){return _0x5c35b5[_0x6ebb('0x50')](_0x2e23a2['value'],_0x2e23a2['filename']+path[_0x6ebb('0x59')](_0x2e23a2[_0x6ebb('0x53')]),function(){if(_0x25a2cd){fs[_0x6ebb('0x5a')](_0x2e23a2[_0x6ebb('0x53')]);}});}else{return _0x5c35b5['download'](_0x2e23a2[_0x6ebb('0x53')],function(_0x4a3db3){if(_0x25a2cd){fs[_0x6ebb('0x5a')](_0x2e23a2['value']);}});}}})[_0x6ebb('0x49')](handleError(_0x5c35b5,null));};exports[_0x6ebb('0x27')]=function(_0x10a12f,_0x1f2550){return db[_0x6ebb('0x2d')][_0x6ebb('0x4e')]({'where':{'id':_0x10a12f[_0x6ebb('0x4b')]['id']}})[_0x6ebb('0x26')](function(_0x3278ae){if(_['isNil'](_0x3278ae)){throw new ReferenceError(_0x6ebb('0x68'));}return _0x3278ae;})[_0x6ebb('0x26')](function(_0x1bc9e0){var _0x489baf=_0x1bc9e0[_0x6ebb('0x53')];logger[_0x6ebb('0x69')](_0x6ebb('0x6a'),_0x489baf);if(!_[_0x6ebb('0x6b')](_0x1bc9e0['value'])&&fs[_0x6ebb('0x65')](_0x489baf)){logger['info'](_0x6ebb('0x6c')+_0x489baf+_0x6ebb('0x6d'));fs[_0x6ebb('0x6e')](_0x489baf);}_0x489baf=_0x489baf+_0x6ebb('0x6f');if(!_[_0x6ebb('0x6b')](_0x1bc9e0[_0x6ebb('0x53')])&&fs['existsSync'](_0x489baf)){logger[_0x6ebb('0x69')](_0x6ebb('0x6c')+_0x489baf+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x6ebb('0x6e')](_0x489baf);}return _0x1bc9e0;})[_0x6ebb('0x26')](function(_0xc2f57e){if(!_0xc2f57e)throw new InternalError();return _0xc2f57e[_0x6ebb('0x27')]();})[_0x6ebb('0x26')](function(){_0x1f2550['status'](0xcc)['end']();})['catch'](handleError(_0x1f2550,null));};function getBucketslist(_0x55b71d,_0x5474e9,_0x4bebde){return new Promise(function(_0x4e0b41,_0x5ed60b){var _0x522ceb=new AWS['S3']({'accessKeyId':_0x5474e9,'secretAccessKey':_0x55b71d,'region':_0x4bebde});_0x522ceb[_0x6ebb('0x70')]({},function(_0x2d481d,_0x506318){if(_0x2d481d){return _0x5ed60b(_0x2d481d);}else{return _0x4e0b41(_0x506318);}});});}function createBucket(_0x368091,_0x3e13b5,_0x154de5,_0x2c3995){return new Promise(function(_0x469fd7,_0x2d7c7e){var _0x19813e=new AWS['S3']({'accessKeyId':_0x3e13b5,'secretAccessKey':_0x368091,'region':_0x154de5});_0x19813e['createBucket']({'Bucket':_0x2c3995},function(_0x15273b,_0x372b43){if(_0x15273b){return _0x2d7c7e(_0x15273b);}else{return _0x469fd7(_0x372b43);}});});}function uploadFile(_0x3df09d,_0xa38a9f,_0x35cec7,_0x447ea0,_0x7f79e8,_0x306f2f){return new Promise(function(_0x429ced,_0x70766a){var _0x38c49a=new AWS['S3']({'accessKeyId':_0xa38a9f,'secretAccessKey':_0x3df09d,'region':_0x35cec7});_0x38c49a[_0x6ebb('0x71')]({'Bucket':_0x447ea0,'Key':_0x7f79e8,'Body':_0x306f2f},function(_0x35af70,_0x204d2f){if(_0x35af70){return _0x70766a(_0x35af70);}else{return _0x429ced(_0x204d2f);}});});}function startTranscribe(_0x3cb746,_0x113853,_0x2b7d0e,_0x36d6a3,_0x593cec,_0x4e356b){return new Promise(function(_0x1d2f7f,_0x1ebb71){var _0x228890=new AWS[(_0x6ebb('0x72'))]({'accessKeyId':_0x113853,'secretAccessKey':_0x3cb746,'region':_0x2b7d0e});_0x228890[_0x6ebb('0x73')]({'TranscriptionJobName':_0x36d6a3,'LanguageCode':_0x593cec,'Media':{'MediaFileUri':_0x4e356b}},function(_0x1e4347,_0x13a340){if(_0x1e4347){return _0x1ebb71(_0x1e4347);}else{return _0x1d2f7f(_0x13a340);}});});}function transcribe(_0x43b482,_0x218fd7,_0x3a0c0d,_0x2611d2,_0xeda213,_0x1f8d16,_0xefaad0){return new Promise(function(_0x393a8f,_0x2745fd){var _0x101e03={};logger['info'](util[_0x6ebb('0x34')](_0x6ebb('0x74'),_0x43b482,_0xeda213));return uploadFile(_0x218fd7,_0x3a0c0d,_0x2611d2,_0xeda213,path[_0x6ebb('0x75')](_0x1f8d16),fs[_0x6ebb('0x76')](_0x1f8d16))['then'](function(_0x416ef4){logger['info'](util[_0x6ebb('0x34')](_0x6ebb('0x77'),_0x43b482,_0xeda213,_0x416ef4[_0x6ebb('0x78')]));_0x101e03['bucket']=_0x416ef4[_0x6ebb('0x79')];_0x101e03[_0x6ebb('0x7a')]=_0x416ef4['Location'];logger['info'](util['format']('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x43b482));return startTranscribe(_0x218fd7,_0x3a0c0d,_0x2611d2,uuidv4(),_0xefaad0,_0x416ef4[_0x6ebb('0x78')]);})['then'](function(_0x432fd3){logger['info'](util[_0x6ebb('0x34')](_0x6ebb('0x7b'),_0x43b482,_0x432fd3['TranscriptionJob']['TranscriptionJobName']));_0x101e03[_0x6ebb('0x7c')]=_0x432fd3[_0x6ebb('0x7d')][_0x6ebb('0x7e')];_0x101e03[_0x6ebb('0x7f')]=_0x432fd3[_0x6ebb('0x7d')][_0x6ebb('0x80')];return _0x393a8f(_0x101e03);})[_0x6ebb('0x49')](function(_0x54012a){return _0x2745fd(_0x54012a);});});}exports[_0x6ebb('0x81')]=function(_0x30cfe1,_0x57cbb6,_0xc14947){var _0x4cf9a9;var _0x3ff3cf;var _0x1e0cd5;var _0x304bff=require(_0x6ebb('0x51'));return db[_0x6ebb('0x2d')][_0x6ebb('0x82')]({'where':{'id':_0x30cfe1[_0x6ebb('0x4b')]['id']}})[_0x6ebb('0x26')](function(_0xfd1940){if(_0xfd1940){var _0x286e5a=util[_0x6ebb('0x34')](_0x6ebb('0x54'),_0xfd1940[_0x6ebb('0x53')]);if(fs['existsSync'](_0x286e5a)){cypher=!![];return _0x304bff['decryptFile'](_0x286e5a,_0xfd1940['value'],config[_0x6ebb('0x55')][_0x6ebb('0x56')])[_0x6ebb('0x26')](function(){return _0xfd1940;});}return _0xfd1940;}})[_0x6ebb('0x26')](function(_0x4aacd7){if(!_0x4aacd7){throw new db['Sequelize'][(_0x6ebb('0x67'))](_0x6ebb('0x83'));}_0x3ff3cf=_0x4aacd7;return db[_0x6ebb('0x84')][_0x6ebb('0x82')]({'where':{'id':0x1}});})[_0x6ebb('0x26')](handleEntityNotFound(_0x57cbb6,null))[_0x6ebb('0x26')](function(_0x4d3cc8){if(_0x4d3cc8){_0x4cf9a9=_0x4d3cc8;if(!_0x4cf9a9['transcribe']||!_0x4cf9a9[_0x6ebb('0x85')]||!_0x4cf9a9[_0x6ebb('0x86')]||!_0x4cf9a9[_0x6ebb('0x87')]||!_0x4cf9a9[_0x6ebb('0x88')]){throw new db[(_0x6ebb('0x57'))][(_0x6ebb('0x67'))]('Transcribe\x20not\x20configured');}if(_0x30cfe1['body'][_0x6ebb('0x89')]&&(!_0x4cf9a9[_0x6ebb('0x8a')]||!_0x4cf9a9[_0x6ebb('0x8b')]||!_0x4cf9a9['sentimentRegion']||!_0x4cf9a9[_0x6ebb('0x87')]||!_0x4cf9a9[_0x6ebb('0x88')])){throw new db[(_0x6ebb('0x57'))][(_0x6ebb('0x67'))](_0x6ebb('0x8c'));}return db[_0x6ebb('0x8d')]['findOne']({'where':{'id':_0x4cf9a9['transcribeAccountId']}});}})[_0x6ebb('0x26')](function(_0x32f467){if(!_0x32f467){throw new db[(_0x6ebb('0x57'))][(_0x6ebb('0x67'))](_0x6ebb('0x8e'));}if(!_0x32f467[_0x6ebb('0x8f')]||!_0x32f467['data2']){throw new db[(_0x6ebb('0x57'))]['ValidationError'](_0x6ebb('0x90'));}_0x1e0cd5=_0x32f467;return getBucketslist(_0x1e0cd5[_0x6ebb('0x8f')],_0x1e0cd5['data2'],_0x4cf9a9[_0x6ebb('0x86')]);})['then'](function(_0x1ee96e){if(_0x1ee96e&&_0x1ee96e[_0x6ebb('0x91')]){var _0x2ae8df=_[_0x6ebb('0x4e')](_0x1ee96e[_0x6ebb('0x91')],function(_0x5daf62){return _0x5daf62[_0x6ebb('0x92')]===_0x4cf9a9[_0x6ebb('0x88')];});if(!_0x2ae8df){logger[_0x6ebb('0x69')](util['format']('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x30cfe1[_0x6ebb('0x4b')]['id'],_0x4cf9a9[_0x6ebb('0x88')]));return createBucket(_0x1e0cd5[_0x6ebb('0x8f')],_0x1e0cd5[_0x6ebb('0x93')],_0x4cf9a9[_0x6ebb('0x86')],_0x4cf9a9['bucket']);}logger['info'](util[_0x6ebb('0x34')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x30cfe1[_0x6ebb('0x4b')]['id'],_0x4cf9a9[_0x6ebb('0x88')]));return;}})[_0x6ebb('0x26')](function(_0x140277){if(_0x3ff3cf[_0x6ebb('0x7f')]===_0x6ebb('0x94')){return transcribe(_0x30cfe1[_0x6ebb('0x4b')]['id'],_0x1e0cd5[_0x6ebb('0x8f')],_0x1e0cd5[_0x6ebb('0x93')],_0x4cf9a9[_0x6ebb('0x86')],_0x4cf9a9[_0x6ebb('0x88')],_0x3ff3cf[_0x6ebb('0x53')],_0x4cf9a9[_0x6ebb('0x87')]);}else{logger[_0x6ebb('0x69')](util[_0x6ebb('0x34')](_0x6ebb('0x95'),_0x30cfe1[_0x6ebb('0x4b')]['id']));return{'transcribeStatus':_0x6ebb('0x96')};}})[_0x6ebb('0x26')](function(_0x5da51e){if(_0x5da51e){_0x5da51e[_0x6ebb('0x97')]=_0x30cfe1[_0x6ebb('0x4d')][_0x6ebb('0x89')];return _0x3ff3cf[_0x6ebb('0x98')](_0x5da51e);}})[_0x6ebb('0x26')](respondWithResult(_0x57cbb6,null))[_0x6ebb('0x49')](handleError(_0x57cbb6,null));};function writeFile(_0x5b831f,_0x1a044c){return new Promise(function(_0x2bf5d0,_0x520c2c){fs['writeFile'](_0x1a044c,_0x5b831f,function(_0x1812e7,_0x564db0){if(_0x1812e7){return _0x520c2c(_0x1812e7);}else{return _0x2bf5d0(_0x564db0);}});});}exports[_0x6ebb('0x99')]=function(_0x2c1e6e,_0x2c52f7,_0x264233){return db[_0x6ebb('0x2d')]['findOne']({'where':{'id':_0x2c1e6e[_0x6ebb('0x4b')]['id']}})[_0x6ebb('0x26')](handleEntityNotFound(_0x2c52f7))[_0x6ebb('0x26')](function(_0x34b689){if(_0x34b689&&_0x34b689[_0x6ebb('0x9a')]){var _0x86eb11=_0x34b689[_0x6ebb('0x9a')];var _0x3698fb=config[_0x6ebb('0x9b')]+_0x6ebb('0x9c')+_0x34b689['id']+_0x6ebb('0x9d');if(fs[_0x6ebb('0x65')](_0x3698fb)){return _0x3698fb;}return writeFile(_0x86eb11,_0x3698fb)['then'](function(){return _0x3698fb;});}else{throw new db[(_0x6ebb('0x57'))][(_0x6ebb('0x67'))](_0x6ebb('0x9e'));}})[_0x6ebb('0x26')](function(_0x2fa8b5){return _0x2c52f7[_0x6ebb('0x50')](_0x2fa8b5);})['catch'](handleError(_0x2c52f7));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 06044fa..6d49e5c 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 _0xf759=['./voiceRecording.attributes','define','voice_recordings','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4da356,_0x5235e1){var _0x321b07=function(_0x2bc6f4){while(--_0x2bc6f4){_0x4da356['push'](_0x4da356['shift']());}};_0x321b07(++_0x5235e1);}(_0xf759,0x154));var _0x9f75=function(_0x23e32a,_0x29e4d3){_0x23e32a=_0x23e32a-0x0;var _0x179aa6=_0xf759[_0x23e32a];return _0x179aa6;};'use strict';var _=require(_0x9f75('0x0'));var util=require(_0x9f75('0x1'));var logger=require(_0x9f75('0x2'))(_0x9f75('0x3'));var moment=require(_0x9f75('0x4'));var BPromise=require(_0x9f75('0x5'));var rp=require(_0x9f75('0x6'));var fs=require('fs');var path=require(_0x9f75('0x7'));var rimraf=require(_0x9f75('0x8'));var config=require(_0x9f75('0x9'));var attributes=require(_0x9f75('0xa'));module['exports']=function(_0x2f40ae,_0x58d750){return _0x2f40ae[_0x9f75('0xb')]('VoiceRecording',attributes,{'tableName':_0x9f75('0xc'),'paranoid':![],'indexes':[{'name':_0x9f75('0xd'),'fields':[_0x9f75('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5e0d=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports','uniqueid','lodash','util'];(function(_0x336c29,_0x523f5a){var _0x1b9e36=function(_0x365662){while(--_0x365662){_0x336c29['push'](_0x336c29['shift']());}};_0x1b9e36(++_0x523f5a);}(_0x5e0d,0x10c));var _0xd5e0=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x5e0d[_0x30ae5e];return _0x1f2e93;};'use strict';var _=require(_0xd5e0('0x0'));var util=require(_0xd5e0('0x1'));var logger=require(_0xd5e0('0x2'))(_0xd5e0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd5e0('0x4'));var fs=require('fs');var path=require(_0xd5e0('0x5'));var rimraf=require(_0xd5e0('0x6'));var config=require(_0xd5e0('0x7'));var attributes=require('./voiceRecording.attributes');module[_0xd5e0('0x8')]=function(_0x4b0c80,_0x14b4fd){return _0x4b0c80['define']('VoiceRecording',attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0xd5e0('0x9'),'fields':[_0xd5e0('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index fd3e6e5..5b5cea0 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 _0x32b6=['jayson/promise','client','http','request','then','debug','request\x20sent','stringify','error','code','VoiceRecording,\x20%s,\x20%s','message','info','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','limit','catch','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher','encryptFile','secrets','recording','unlink','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x32b6,0x1d1));var _0x632b=function(_0x2d70f0,_0xda7fb1){_0x2d70f0=_0x2d70f0-0x0;var _0x231b2d=_0x32b6[_0x2d70f0];return _0x231b2d;};'use strict';var _=require(_0x632b('0x0'));var util=require(_0x632b('0x1'));var moment=require('moment');var BPromise=require(_0x632b('0x2'));var rs=require(_0x632b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x632b('0x4'));var logger=require(_0x632b('0x5'))(_0x632b('0x6'));var config=require(_0x632b('0x7'));var jayson=require(_0x632b('0x8'));var client=jayson[_0x632b('0x9')][_0x632b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10458a,_0x3bbf43,_0x43d6c7){return new BPromise(function(_0x5128f5,_0x33d711){return client[_0x632b('0xb')](_0x10458a,_0x43d6c7)[_0x632b('0xc')](function(_0x174201){logger['info']('VoiceRecording,\x20%s,\x20%s',_0x3bbf43,'request\x20sent');logger[_0x632b('0xd')]('VoiceRecording,\x20%s,\x20%s,\x20%s',_0x3bbf43,_0x632b('0xe'),JSON[_0x632b('0xf')](_0x174201));if(_0x174201[_0x632b('0x10')]){if(_0x174201[_0x632b('0x10')][_0x632b('0x11')]===0x1f4){logger[_0x632b('0x10')](_0x632b('0x12'),_0x3bbf43,_0x174201[_0x632b('0x10')][_0x632b('0x13')]);return _0x33d711(_0x174201['error'][_0x632b('0x13')]);}logger[_0x632b('0x10')](_0x632b('0x12'),_0x3bbf43,_0x174201['error'][_0x632b('0x13')]);return _0x5128f5(_0x174201[_0x632b('0x10')][_0x632b('0x13')]);}else{logger[_0x632b('0x14')](_0x632b('0x12'),_0x3bbf43,_0x632b('0xe'));_0x5128f5(_0x174201['result'][_0x632b('0x13')]);}})['catch'](function(_0x4fdef2){logger[_0x632b('0x10')]('VoiceRecording,\x20%s,\x20%s',_0x3bbf43,_0x4fdef2);_0x33d711(_0x4fdef2);});});}exports[_0x632b('0x15')]=function(_0x3bb27f){var _0x28c472=this;return new Promise(function(_0x51c894,_0x2f3e88){return db[_0x632b('0x16')][_0x632b('0x17')](_0x3bb27f[_0x632b('0x18')],{'raw':_0x3bb27f['options']?_0x3bb27f[_0x632b('0x19')][_0x632b('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3bb27f['options']?_0x3bb27f[_0x632b('0x19')]['where']||null:null,'attributes':_0x3bb27f['options']?_0x3bb27f[_0x632b('0x19')]['attributes']||null:null,'limit':_0x3bb27f[_0x632b('0x19')]?_0x3bb27f[_0x632b('0x19')][_0x632b('0x1b')]||null:null})['then'](function(_0x10fc32){logger[_0x632b('0x14')]('UpdateVoiceRecording',_0x3bb27f);logger[_0x632b('0xd')](_0x632b('0x15'),_0x3bb27f,JSON[_0x632b('0xf')](_0x10fc32));_0x51c894(_0x10fc32);})[_0x632b('0x1c')](function(_0x45d017){logger[_0x632b('0x10')]('UpdateVoiceRecording',_0x45d017['message'],_0x3bb27f);_0x2f3e88(_0x28c472[_0x632b('0x10')](0x1f4,_0x45d017['message']));});});};exports[_0x632b('0x1d')]=function(_0x954fa0){var _0x5d6855=this;return new Promise(function(_0x273e89,_0x3f4eab){var _0x29d9aa=require(_0x632b('0x1e'));var _0x4728a8;return db[_0x632b('0x1f')][_0x632b('0x20')]({'attributes':['id',_0x632b('0x21')],'where':{'id':0x1},'raw':!![]})[_0x632b('0xc')](function(_0x4f8410){_0x4728a8=_0x4f8410;return db[_0x632b('0x16')][_0x632b('0x22')](_0x954fa0[_0x632b('0x18')]);})[_0x632b('0xc')](function(_0x17a5ba){if(_0x4728a8[_0x632b('0x21')]&&fs[_0x632b('0x23')](_0x17a5ba[_0x632b('0x24')])){var _0x1ace1b=util[_0x632b('0x25')](_0x632b('0x26'),_0x17a5ba[_0x632b('0x24')]);return _0x29d9aa[_0x632b('0x27')](_0x17a5ba[_0x632b('0x24')],_0x1ace1b,config[_0x632b('0x28')][_0x632b('0x29')])[_0x632b('0xc')](function(){fs[_0x632b('0x2a')](_0x17a5ba[_0x632b('0x24')]);logger[_0x632b('0x14')]('CreateVoiceRecording\x20file\x20encrypted');return _0x17a5ba;});}return _0x17a5ba;})[_0x632b('0xc')](function(_0x4401dc){logger[_0x632b('0x14')](_0x632b('0x1d'),_0x954fa0);logger['debug'](_0x632b('0x1d'),_0x954fa0,JSON['stringify'](_0x4401dc));_0x273e89(_0x4401dc);})[_0x632b('0x1c')](function(_0x15b22d){logger['error'](_0x632b('0x1d'),_0x15b22d[_0x632b('0x13')],_0x954fa0);_0x3f4eab(_0x5d6855[_0x632b('0x10')](0x1f4,_0x15b22d[_0x632b('0x13')]));});});}; \ No newline at end of file +var _0x0295=['client','http','then','info','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','VoiceRecording,\x20%s,\x20%s','message','result','catch','VoiceRecording','update','body','options','where','limit','UpdateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3ad54a,_0x33f0e2){var _0x18f50f=function(_0x342bbc){while(--_0x342bbc){_0x3ad54a['push'](_0x3ad54a['shift']());}};_0x18f50f(++_0x33f0e2);}(_0x0295,0x1f0));var _0x5029=function(_0x253ac6,_0x2c4e61){_0x253ac6=_0x253ac6-0x0;var _0x53c386=_0x0295[_0x253ac6];return _0x53c386;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5029('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5029('0x2'))['db'];var utils=require(_0x5029('0x3'));var logger=require(_0x5029('0x4'))(_0x5029('0x5'));var config=require(_0x5029('0x6'));var jayson=require(_0x5029('0x7'));var client=jayson[_0x5029('0x8')][_0x5029('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b3cd,_0x502a62,_0x54978f){return new BPromise(function(_0x4ee867,_0xf4459b){return client['request'](_0x5b3cd,_0x54978f)[_0x5029('0xa')](function(_0x5bccfc){logger[_0x5029('0xb')]('VoiceRecording,\x20%s,\x20%s',_0x502a62,_0x5029('0xc'));logger[_0x5029('0xd')](_0x5029('0xe'),_0x502a62,'request\x20sent',JSON[_0x5029('0xf')](_0x5bccfc));if(_0x5bccfc[_0x5029('0x10')]){if(_0x5bccfc[_0x5029('0x10')]['code']===0x1f4){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc['error']['message']);return _0xf4459b(_0x5bccfc['error']['message']);}logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);return _0x4ee867(_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);}else{logger[_0x5029('0xb')](_0x5029('0x11'),_0x502a62,_0x5029('0xc'));_0x4ee867(_0x5bccfc[_0x5029('0x13')][_0x5029('0x12')]);}})[_0x5029('0x14')](function(_0x3786b5){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x3786b5);_0xf4459b(_0x3786b5);});});}exports['UpdateVoiceRecording']=function(_0x1ed567){var _0x31a155=this;return new Promise(function(_0x35de81,_0x4902f3){return db[_0x5029('0x15')][_0x5029('0x16')](_0x1ed567[_0x5029('0x17')],{'raw':_0x1ed567['options']?_0x1ed567[_0x5029('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ed567[_0x5029('0x18')]?_0x1ed567[_0x5029('0x18')][_0x5029('0x19')]||null:null,'attributes':_0x1ed567[_0x5029('0x18')]?_0x1ed567['options']['attributes']||null:null,'limit':_0x1ed567[_0x5029('0x18')]?_0x1ed567['options'][_0x5029('0x1a')]||null:null})[_0x5029('0xa')](function(_0x1eb228){logger[_0x5029('0xb')](_0x5029('0x1b'),_0x1ed567);logger[_0x5029('0xd')](_0x5029('0x1b'),_0x1ed567,JSON[_0x5029('0xf')](_0x1eb228));_0x35de81(_0x1eb228);})[_0x5029('0x14')](function(_0x4ceaae){logger['error']('UpdateVoiceRecording',_0x4ceaae[_0x5029('0x12')],_0x1ed567);_0x4902f3(_0x31a155[_0x5029('0x10')](0x1f4,_0x4ceaae['message']));});});};exports['CreateVoiceRecording']=function(_0x181da0){var _0x1e7e61=this;return new Promise(function(_0x36d810,_0x5527fc){var _0x2c501f=require(_0x5029('0x1c'));var _0x5e45c4;return db[_0x5029('0x1d')][_0x5029('0x1e')]({'attributes':['id',_0x5029('0x1f')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x32da06){_0x5e45c4=_0x32da06;return db[_0x5029('0x15')][_0x5029('0x20')](_0x181da0['body']);})[_0x5029('0xa')](function(_0x2bb398){if(_0x5e45c4['callRecordingEncryption']&&fs[_0x5029('0x21')](_0x2bb398[_0x5029('0x22')])){var _0x4434ff=util[_0x5029('0x23')](_0x5029('0x24'),_0x2bb398[_0x5029('0x22')]);return _0x2c501f[_0x5029('0x25')](_0x2bb398[_0x5029('0x22')],_0x4434ff,config[_0x5029('0x26')][_0x5029('0x27')])[_0x5029('0xa')](function(){fs[_0x5029('0x28')](_0x2bb398['value']);logger[_0x5029('0xb')]('CreateVoiceRecording\x20file\x20encrypted');return _0x2bb398;});}return _0x2bb398;})[_0x5029('0xa')](function(_0x4f672e){logger['info'](_0x5029('0x29'),_0x181da0);logger[_0x5029('0xd')](_0x5029('0x29'),_0x181da0,JSON['stringify'](_0x4f672e));_0x36d810(_0x4f672e);})[_0x5029('0x14')](function(_0x15d882){logger[_0x5029('0x10')](_0x5029('0x29'),_0x15d882[_0x5029('0x12')],_0x181da0);_0x5527fc(_0x1e7e61[_0x5029('0x10')](0x1f4,_0x15d882[_0x5029('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 74d8630..2a74f6d 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 _0x1e74=['/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','describe'];(function(_0x2452d6,_0x58fb87){var _0x4de32e=function(_0x3f6192){while(--_0x3f6192){_0x2452d6['push'](_0x2452d6['shift']());}};_0x4de32e(++_0x58fb87);}(_0x1e74,0x11c));var _0x41e7=function(_0x1bcbe6,_0x5a3bc1){_0x1bcbe6=_0x1bcbe6-0x0;var _0x36cc73=_0x1e74[_0x1bcbe6];return _0x36cc73;};'use strict';var multer=require(_0x41e7('0x0'));var util=require(_0x41e7('0x1'));var path=require(_0x41e7('0x2'));var timeout=require(_0x41e7('0x3'));var express=require(_0x41e7('0x4'));var router=express[_0x41e7('0x5')]();var fs_extra=require(_0x41e7('0x6'));var auth=require(_0x41e7('0x7'));var interaction=require(_0x41e7('0x8'));var config=require(_0x41e7('0x9'));var controller=require(_0x41e7('0xa'));router[_0x41e7('0xb')]('/',auth[_0x41e7('0xc')](),controller[_0x41e7('0xd')]);router[_0x41e7('0xb')]('/describe',auth[_0x41e7('0xc')](),controller[_0x41e7('0xe')]);router['get'](_0x41e7('0xf'),auth[_0x41e7('0xc')](),controller[_0x41e7('0x10')]);router[_0x41e7('0x11')]('/',auth[_0x41e7('0xc')](),controller[_0x41e7('0x12')]);router[_0x41e7('0x13')](_0x41e7('0xf'),auth[_0x41e7('0xc')](),controller[_0x41e7('0x14')]);router['delete'](_0x41e7('0xf'),auth[_0x41e7('0xc')](),controller[_0x41e7('0x15')]);module[_0x41e7('0x16')]=router; \ No newline at end of file +var _0xf184=['exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','put','update','delete','destroy'];(function(_0x13bea0,_0x3b3583){var _0x47ae7f=function(_0x1e890e){while(--_0x1e890e){_0x13bea0['push'](_0x13bea0['shift']());}};_0x47ae7f(++_0x3b3583);}(_0xf184,0xeb));var _0x4f18=function(_0x42f6b1,_0x560c04){_0x42f6b1=_0x42f6b1-0x0;var _0x39b69f=_0xf184[_0x42f6b1];return _0x39b69f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4f18('0x0'));var timeout=require(_0x4f18('0x1'));var express=require(_0x4f18('0x2'));var router=express[_0x4f18('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4f18('0x4'));var interaction=require(_0x4f18('0x5'));var config=require('../../config/environment');var controller=require(_0x4f18('0x6'));router[_0x4f18('0x7')]('/',auth[_0x4f18('0x8')](),controller[_0x4f18('0x9')]);router[_0x4f18('0x7')]('/describe',auth[_0x4f18('0x8')](),controller[_0x4f18('0xa')]);router['get'](_0x4f18('0xb'),auth[_0x4f18('0x8')](),controller[_0x4f18('0xc')]);router['post']('/',auth[_0x4f18('0x8')](),controller['create']);router[_0x4f18('0xd')](_0x4f18('0xb'),auth['isAuthenticated'](),controller[_0x4f18('0xe')]);router[_0x4f18('0xf')](_0x4f18('0xb'),auth[_0x4f18('0x8')](),controller[_0x4f18('0x10')]);module[_0x4f18('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index d57f047..099727e 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 _0x816d=['ENUM','Yes','moment','blind','attended','STRING'];(function(_0x3653c7,_0x58e9eb){var _0x22d36a=function(_0xf0b9e0){while(--_0xf0b9e0){_0x3653c7['push'](_0x3653c7['shift']());}};_0x22d36a(++_0x58e9eb);}(_0x816d,0xf8));var _0xd816=function(_0x5dac28,_0x31bef7){_0x5dac28=_0x5dac28-0x0;var _0x2d5552=_0x816d[_0x5dac28];return _0x2d5552;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xd816('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xd816('0x1'),_0xd816('0x2'))},'result':{'type':Sequelize[_0xd816('0x3')]},'transfererchannel':{'type':Sequelize[_0xd816('0x3')]},'transferercalleridnum':{'type':Sequelize[_0xd816('0x3')]},'transferercalleridname':{'type':Sequelize[_0xd816('0x3')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0xd816('0x3')]},'transfereraccountcode':{'type':Sequelize[_0xd816('0x3')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0xd816('0x3')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0xd816('0x3')]},'transfereeconnectedlinename':{'type':Sequelize[_0xd816('0x3')]},'transfereeaccountcode':{'type':Sequelize[_0xd816('0x3')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0xd816('0x3')]},'isexternal':{'type':Sequelize[_0xd816('0x4')](_0xd816('0x5'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xd816('0x3')]}}; \ No newline at end of file +var _0x5e28=['ENUM','blind','attended','STRING','Yes','sequelize','exports'];(function(_0x1e1b5a,_0x13b534){var _0x3206db=function(_0x5d6c2f){while(--_0x5d6c2f){_0x1e1b5a['push'](_0x1e1b5a['shift']());}};_0x3206db(++_0x13b534);}(_0x5e28,0x1d3));var _0x85e2=function(_0x58c851,_0x1f3d96){_0x58c851=_0x58c851-0x0;var _0x534d8a=_0x5e28[_0x58c851];return _0x534d8a;};'use strict';var Sequelize=require(_0x85e2('0x0'));var moment=require('moment');module[_0x85e2('0x1')]={'type':{'type':Sequelize[_0x85e2('0x2')](_0x85e2('0x3'),_0x85e2('0x4'))},'result':{'type':Sequelize[_0x85e2('0x5')]},'transfererchannel':{'type':Sequelize[_0x85e2('0x5')]},'transferercalleridnum':{'type':Sequelize[_0x85e2('0x5')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x85e2('0x5')]},'transfereraccountcode':{'type':Sequelize[_0x85e2('0x5')]},'transferercontext':{'type':Sequelize[_0x85e2('0x5')]},'transfererexten':{'type':Sequelize[_0x85e2('0x5')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0x85e2('0x5')]},'transfereecalleridname':{'type':Sequelize[_0x85e2('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x85e2('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x85e2('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0x85e2('0x5')]},'transfereecontext':{'type':Sequelize[_0x85e2('0x5')]},'transfereeexten':{'type':Sequelize[_0x85e2('0x5')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0x85e2('0x2')](_0x85e2('0x6'),'No')},'context':{'type':Sequelize[_0x85e2('0x5')]},'extension':{'type':Sequelize[_0x85e2('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 02c53ee..484fdd0 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 _0xdb32=['key','map','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','params','keys','include','create','body','update','find','describe','eml-format','zip-dir','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/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','undefined','limit','count','offset','status','set','apply','reject','save','destroy','then','sendStatus','error','name','send','index','VoiceTransferReport','rawAttributes','fieldName','type'];(function(_0x2c9527,_0x3d3e1d){var _0x2fd230=function(_0x301888){while(--_0x301888){_0x2c9527['push'](_0x2c9527['shift']());}};_0x2fd230(++_0x3d3e1d);}(_0xdb32,0xbe));var _0x2db3=function(_0x5c92b4,_0x3ac3b2){_0x5c92b4=_0x5c92b4-0x0;var _0x4bc8b7=_0xdb32[_0x5c92b4];return _0x4bc8b7;};'use strict';var emlformat=require(_0x2db3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2db3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2db3('0x2'));var moment=require(_0x2db3('0x3'));var BPromise=require(_0x2db3('0x4'));var Mustache=require(_0x2db3('0x5'));var util=require(_0x2db3('0x6'));var path=require(_0x2db3('0x7'));var sox=require(_0x2db3('0x8'));var csv=require('to-csv');var ejs=require(_0x2db3('0x9'));var fs=require('fs');var fs_extra=require(_0x2db3('0xa'));var _=require(_0x2db3('0xb'));var squel=require('squel');var crypto=require(_0x2db3('0xc'));var jsforce=require(_0x2db3('0xd'));var deskjs=require(_0x2db3('0xe'));var toCsv=require(_0x2db3('0xf'));var querystring=require(_0x2db3('0x10'));var Papa=require(_0x2db3('0x11'));var Redis=require(_0x2db3('0x12'));var authService=require(_0x2db3('0x13'));var qs=require(_0x2db3('0x14'));var as=require(_0x2db3('0x15'));var hardwareService=require(_0x2db3('0x16'));var logger=require(_0x2db3('0x17'))('api');var utils=require(_0x2db3('0x18'));var config=require(_0x2db3('0x19'));var licenseUtil=require(_0x2db3('0x1a'));var db=require(_0x2db3('0x1b'))['db'];function respondWithStatusCode(_0x17f1a2,_0x23a968){_0x23a968=_0x23a968||0xcc;return function(_0x394537){if(_0x394537){return _0x17f1a2['sendStatus'](_0x23a968);}return _0x17f1a2['status'](_0x23a968)[_0x2db3('0x1c')]();};}function respondWithResult(_0x29118b,_0x1fc83f){_0x1fc83f=_0x1fc83f||0xc8;return function(_0x249b03){if(_0x249b03){return _0x29118b['status'](_0x1fc83f)[_0x2db3('0x1d')](_0x249b03);}};}function respondWithFilteredResult(_0x184015,_0x2ddcbc){return function(_0x594da7){if(_0x594da7){var _0x5840ca=typeof _0x2ddcbc['offset']===_0x2db3('0x1e')&&typeof _0x2ddcbc[_0x2db3('0x1f')]===_0x2db3('0x1e');var _0x81e373=_0x594da7[_0x2db3('0x20')];var _0xf4775a=_0x5840ca?0x0:_0x2ddcbc['offset'];var _0xeda10=_0x5840ca?_0x594da7[_0x2db3('0x20')]:_0x2ddcbc[_0x2db3('0x21')]+_0x2ddcbc[_0x2db3('0x1f')];var _0x5036d8;if(_0xeda10>=_0x81e373){_0xeda10=_0x81e373;_0x5036d8=0xc8;}else{_0x5036d8=0xce;}_0x184015[_0x2db3('0x22')](_0x5036d8);return _0x184015[_0x2db3('0x23')]('Content-Range',_0xf4775a+'-'+_0xeda10+'/'+_0x81e373)[_0x2db3('0x1d')](_0x594da7);}return null;};}function patchUpdates(_0x3a2966){return function(_0x31776d){try{jsonpatch[_0x2db3('0x24')](_0x31776d,_0x3a2966,!![]);}catch(_0x54c4f5){return BPromise[_0x2db3('0x25')](_0x54c4f5);}return _0x31776d[_0x2db3('0x26')]();};}function saveUpdates(_0x48eaf6,_0x4a752c){return function(_0x528c05){if(_0x528c05){return _0x528c05['update'](_0x48eaf6)['then'](function(_0x57a289){return _0x57a289;});}return null;};}function removeEntity(_0x171d4a,_0x1a10a8){return function(_0xd03662){if(_0xd03662){return _0xd03662[_0x2db3('0x27')]()[_0x2db3('0x28')](function(){_0x171d4a[_0x2db3('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55093b,_0x424bbb){return function(_0x5fb65d){if(!_0x5fb65d){_0x55093b[_0x2db3('0x29')](0x194);}return _0x5fb65d;};}function handleError(_0x54f29f,_0x4e5b5a){_0x4e5b5a=_0x4e5b5a||0x1f4;return function(_0x3d6061){logger[_0x2db3('0x2a')](_0x3d6061['stack']);if(_0x3d6061[_0x2db3('0x2b')]){delete _0x3d6061[_0x2db3('0x2b')];}_0x54f29f[_0x2db3('0x22')](_0x4e5b5a)[_0x2db3('0x2c')](_0x3d6061);};}exports[_0x2db3('0x2d')]=function(_0x572657,_0x51d280){var _0x33d15c={},_0x989e8f={},_0x55469c={'count':0x0,'rows':[]};var _0x2d8708=_['map'](db[_0x2db3('0x2e')][_0x2db3('0x2f')],function(_0x20e000){return{'name':_0x20e000[_0x2db3('0x30')],'type':_0x20e000[_0x2db3('0x31')][_0x2db3('0x32')]};});_0x989e8f['model']=_[_0x2db3('0x33')](_0x2d8708,_0x2db3('0x2b'));_0x989e8f[_0x2db3('0x34')]=_['keys'](_0x572657[_0x2db3('0x34')]);_0x989e8f[_0x2db3('0x35')]=_[_0x2db3('0x36')](_0x989e8f[_0x2db3('0x37')],_0x989e8f[_0x2db3('0x34')]);_0x33d15c['attributes']=_['intersection'](_0x989e8f[_0x2db3('0x37')],qs['fields'](_0x572657[_0x2db3('0x34')][_0x2db3('0x38')]));_0x33d15c[_0x2db3('0x39')]=_0x33d15c[_0x2db3('0x39')][_0x2db3('0x3a')]?_0x33d15c['attributes']:_0x989e8f[_0x2db3('0x37')];if(!_0x572657[_0x2db3('0x34')]['hasOwnProperty'](_0x2db3('0x3b'))){_0x33d15c['limit']=qs[_0x2db3('0x1f')](_0x572657['query'][_0x2db3('0x1f')]);_0x33d15c[_0x2db3('0x21')]=qs[_0x2db3('0x21')](_0x572657[_0x2db3('0x34')][_0x2db3('0x21')]);}_0x33d15c[_0x2db3('0x3c')]=qs['sort'](_0x572657[_0x2db3('0x34')][_0x2db3('0x3d')]);_0x33d15c[_0x2db3('0x3e')]=qs['filters'](_[_0x2db3('0x3f')](_0x572657[_0x2db3('0x34')],_0x989e8f['filters']),_0x2d8708);if(_0x572657[_0x2db3('0x34')]['filter']){_0x33d15c[_0x2db3('0x3e')]=_[_0x2db3('0x40')](_0x33d15c[_0x2db3('0x3e')],{'$or':_[_0x2db3('0x33')](_0x2d8708,function(_0x5d6586){if(_0x5d6586[_0x2db3('0x31')]!==_0x2db3('0x41')){var _0x5a655c={};_0x5a655c[_0x5d6586[_0x2db3('0x2b')]]={'$like':'%'+_0x572657[_0x2db3('0x34')][_0x2db3('0x42')]+'%'};return _0x5a655c;}})});}_0x33d15c=_[_0x2db3('0x40')]({},_0x33d15c,_0x572657[_0x2db3('0x43')]);var _0x268b99={'where':_0x33d15c[_0x2db3('0x3e')]};return db[_0x2db3('0x2e')][_0x2db3('0x20')](_0x268b99)[_0x2db3('0x28')](function(_0x36e166){_0x55469c[_0x2db3('0x20')]=_0x36e166;if(_0x572657[_0x2db3('0x34')][_0x2db3('0x44')]){_0x33d15c['include']=[{'all':!![]}];}return db[_0x2db3('0x2e')][_0x2db3('0x45')](_0x33d15c);})['then'](function(_0x293acd){_0x55469c[_0x2db3('0x46')]=_0x293acd;return _0x55469c;})[_0x2db3('0x28')](respondWithFilteredResult(_0x51d280,_0x33d15c))[_0x2db3('0x47')](handleError(_0x51d280,null));};exports['show']=function(_0x404dea,_0x34fe6c){var _0x31afc0={'raw':!![],'where':{'id':_0x404dea[_0x2db3('0x48')]['id']}},_0x23a703={};_0x23a703['model']=_[_0x2db3('0x49')](db['VoiceTransferReport'][_0x2db3('0x2f')]);_0x23a703[_0x2db3('0x34')]=_[_0x2db3('0x49')](_0x404dea[_0x2db3('0x34')]);_0x23a703[_0x2db3('0x35')]=_[_0x2db3('0x36')](_0x23a703[_0x2db3('0x37')],_0x23a703[_0x2db3('0x34')]);_0x31afc0[_0x2db3('0x39')]=_[_0x2db3('0x36')](_0x23a703[_0x2db3('0x37')],qs['fields'](_0x404dea[_0x2db3('0x34')]['fields']));_0x31afc0[_0x2db3('0x39')]=_0x31afc0['attributes'][_0x2db3('0x3a')]?_0x31afc0[_0x2db3('0x39')]:_0x23a703[_0x2db3('0x37')];if(_0x404dea[_0x2db3('0x34')]['includeAll']){_0x31afc0[_0x2db3('0x4a')]=[{'all':!![]}];}_0x31afc0=_[_0x2db3('0x40')]({},_0x31afc0,_0x404dea[_0x2db3('0x43')]);return db[_0x2db3('0x2e')]['find'](_0x31afc0)[_0x2db3('0x28')](handleEntityNotFound(_0x34fe6c,null))[_0x2db3('0x28')](respondWithResult(_0x34fe6c,null))[_0x2db3('0x47')](handleError(_0x34fe6c,null));};exports[_0x2db3('0x4b')]=function(_0x4b1f39,_0x35ba47){return db[_0x2db3('0x2e')]['create'](_0x4b1f39[_0x2db3('0x4c')],{})['then'](respondWithResult(_0x35ba47,0xc9))['catch'](handleError(_0x35ba47,null));};exports[_0x2db3('0x4d')]=function(_0x2778fd,_0x43faa8){if(_0x2778fd[_0x2db3('0x4c')]['id']){delete _0x2778fd[_0x2db3('0x4c')]['id'];}return db['VoiceTransferReport']['find']({'where':{'id':_0x2778fd['params']['id']}})[_0x2db3('0x28')](handleEntityNotFound(_0x43faa8,null))[_0x2db3('0x28')](saveUpdates(_0x2778fd[_0x2db3('0x4c')],null))['then'](respondWithResult(_0x43faa8,null))[_0x2db3('0x47')](handleError(_0x43faa8,null));};exports[_0x2db3('0x27')]=function(_0x14c804,_0x4b008c){return db[_0x2db3('0x2e')][_0x2db3('0x4e')]({'where':{'id':_0x14c804[_0x2db3('0x48')]['id']}})[_0x2db3('0x28')](handleEntityNotFound(_0x4b008c,null))[_0x2db3('0x28')](removeEntity(_0x4b008c,null))[_0x2db3('0x47')](handleError(_0x4b008c,null));};exports[_0x2db3('0x4f')]=function(_0x53eabb,_0x4c6446){return db[_0x2db3('0x2e')]['describe']()['then'](respondWithResult(_0x4c6446,null))[_0x2db3('0x47')](handleError(_0x4c6446,null));}; \ No newline at end of file +var _0x2472=['squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','VoiceTransferReport','type','key','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','create','body','find','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0x2472,0x12c));var _0x2247=function(_0x58c551,_0x51531a){_0x58c551=_0x58c551-0x0;var _0x19dc36=_0x2472[_0x58c551];return _0x19dc36;};'use strict';var emlformat=require(_0x2247('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2247('0x1'));var rp=require(_0x2247('0x2'));var moment=require(_0x2247('0x3'));var BPromise=require(_0x2247('0x4'));var Mustache=require('mustache');var util=require(_0x2247('0x5'));var path=require(_0x2247('0x6'));var sox=require(_0x2247('0x7'));var csv=require(_0x2247('0x8'));var ejs=require(_0x2247('0x9'));var fs=require('fs');var fs_extra=require(_0x2247('0xa'));var _=require(_0x2247('0xb'));var squel=require(_0x2247('0xc'));var crypto=require(_0x2247('0xd'));var jsforce=require(_0x2247('0xe'));var deskjs=require(_0x2247('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2247('0x10'));var Papa=require(_0x2247('0x11'));var Redis=require('ioredis');var authService=require(_0x2247('0x12'));var qs=require(_0x2247('0x13'));var as=require(_0x2247('0x14'));var hardwareService=require(_0x2247('0x15'));var logger=require('../../config/logger')(_0x2247('0x16'));var utils=require(_0x2247('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2247('0x18'));var db=require(_0x2247('0x19'))['db'];function respondWithStatusCode(_0x372b72,_0x779668){_0x779668=_0x779668||0xcc;return function(_0x1d43b9){if(_0x1d43b9){return _0x372b72[_0x2247('0x1a')](_0x779668);}return _0x372b72[_0x2247('0x1b')](_0x779668)[_0x2247('0x1c')]();};}function respondWithResult(_0xf9fc9,_0x1a119b){_0x1a119b=_0x1a119b||0xc8;return function(_0x44aca2){if(_0x44aca2){return _0xf9fc9[_0x2247('0x1b')](_0x1a119b)[_0x2247('0x1d')](_0x44aca2);}};}function respondWithFilteredResult(_0x18419a,_0x345920){return function(_0x3fed31){if(_0x3fed31){var _0x1b479a=typeof _0x345920[_0x2247('0x1e')]===_0x2247('0x1f')&&typeof _0x345920[_0x2247('0x20')]===_0x2247('0x1f');var _0x5c1408=_0x3fed31[_0x2247('0x21')];var _0x40b6be=_0x1b479a?0x0:_0x345920['offset'];var _0x2e045c=_0x1b479a?_0x3fed31[_0x2247('0x21')]:_0x345920['offset']+_0x345920[_0x2247('0x20')];var _0x3a3467;if(_0x2e045c>=_0x5c1408){_0x2e045c=_0x5c1408;_0x3a3467=0xc8;}else{_0x3a3467=0xce;}_0x18419a[_0x2247('0x1b')](_0x3a3467);return _0x18419a[_0x2247('0x22')](_0x2247('0x23'),_0x40b6be+'-'+_0x2e045c+'/'+_0x5c1408)[_0x2247('0x1d')](_0x3fed31);}return null;};}function patchUpdates(_0x3c8731){return function(_0x28d2c1){try{jsonpatch[_0x2247('0x24')](_0x28d2c1,_0x3c8731,!![]);}catch(_0x129b35){return BPromise[_0x2247('0x25')](_0x129b35);}return _0x28d2c1['save']();};}function saveUpdates(_0xda8361,_0x3bae4f){return function(_0x242dfc){if(_0x242dfc){return _0x242dfc[_0x2247('0x26')](_0xda8361)[_0x2247('0x27')](function(_0x1dca83){return _0x1dca83;});}return null;};}function removeEntity(_0x50911e,_0x1dc39f){return function(_0x369e96){if(_0x369e96){return _0x369e96[_0x2247('0x28')]()[_0x2247('0x27')](function(){_0x50911e[_0x2247('0x1b')](0xcc)[_0x2247('0x1c')]();});}};}function handleEntityNotFound(_0x597db3,_0x182be2){return function(_0x56f341){if(!_0x56f341){_0x597db3[_0x2247('0x1a')](0x194);}return _0x56f341;};}function handleError(_0x3129d1,_0x294add){_0x294add=_0x294add||0x1f4;return function(_0x55abdb){logger['error'](_0x55abdb[_0x2247('0x29')]);if(_0x55abdb[_0x2247('0x2a')]){delete _0x55abdb[_0x2247('0x2a')];}_0x3129d1[_0x2247('0x1b')](_0x294add)[_0x2247('0x2b')](_0x55abdb);};}exports[_0x2247('0x2c')]=function(_0x4ac484,_0x54e694){var _0x2420b9={},_0x1afc5d={},_0x3e4264={'count':0x0,'rows':[]};var _0x27ecb6=_['map'](db[_0x2247('0x2d')]['rawAttributes'],function(_0xefaa9a){return{'name':_0xefaa9a['fieldName'],'type':_0xefaa9a[_0x2247('0x2e')][_0x2247('0x2f')]};});_0x1afc5d['model']=_[_0x2247('0x30')](_0x27ecb6,'name');_0x1afc5d[_0x2247('0x31')]=_[_0x2247('0x32')](_0x4ac484[_0x2247('0x31')]);_0x1afc5d[_0x2247('0x33')]=_[_0x2247('0x34')](_0x1afc5d['model'],_0x1afc5d[_0x2247('0x31')]);_0x2420b9[_0x2247('0x35')]=_['intersection'](_0x1afc5d[_0x2247('0x36')],qs[_0x2247('0x37')](_0x4ac484[_0x2247('0x31')][_0x2247('0x37')]));_0x2420b9[_0x2247('0x35')]=_0x2420b9[_0x2247('0x35')][_0x2247('0x38')]?_0x2420b9[_0x2247('0x35')]:_0x1afc5d['model'];if(!_0x4ac484[_0x2247('0x31')][_0x2247('0x39')](_0x2247('0x3a'))){_0x2420b9[_0x2247('0x20')]=qs[_0x2247('0x20')](_0x4ac484[_0x2247('0x31')][_0x2247('0x20')]);_0x2420b9[_0x2247('0x1e')]=qs['offset'](_0x4ac484[_0x2247('0x31')][_0x2247('0x1e')]);}_0x2420b9[_0x2247('0x3b')]=qs[_0x2247('0x3c')](_0x4ac484[_0x2247('0x31')][_0x2247('0x3c')]);_0x2420b9['where']=qs['filters'](_[_0x2247('0x3d')](_0x4ac484[_0x2247('0x31')],_0x1afc5d[_0x2247('0x33')]),_0x27ecb6);if(_0x4ac484[_0x2247('0x31')][_0x2247('0x3e')]){_0x2420b9[_0x2247('0x3f')]=_[_0x2247('0x40')](_0x2420b9[_0x2247('0x3f')],{'$or':_[_0x2247('0x30')](_0x27ecb6,function(_0x33136b){if(_0x33136b[_0x2247('0x2e')]!==_0x2247('0x41')){var _0xb53827={};_0xb53827[_0x33136b[_0x2247('0x2a')]]={'$like':'%'+_0x4ac484[_0x2247('0x31')][_0x2247('0x3e')]+'%'};return _0xb53827;}})});}_0x2420b9=_[_0x2247('0x40')]({},_0x2420b9,_0x4ac484[_0x2247('0x42')]);var _0x38a843={'where':_0x2420b9[_0x2247('0x3f')]};return db['VoiceTransferReport'][_0x2247('0x21')](_0x38a843)['then'](function(_0x486cad){_0x3e4264['count']=_0x486cad;if(_0x4ac484[_0x2247('0x31')][_0x2247('0x43')]){_0x2420b9[_0x2247('0x44')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x2247('0x45')](_0x2420b9);})['then'](function(_0x25d930){_0x3e4264[_0x2247('0x46')]=_0x25d930;return _0x3e4264;})['then'](respondWithFilteredResult(_0x54e694,_0x2420b9))[_0x2247('0x47')](handleError(_0x54e694,null));};exports['show']=function(_0x35072,_0x2545f5){var _0x2c342e={'raw':!![],'where':{'id':_0x35072[_0x2247('0x48')]['id']}},_0x4141b1={};_0x4141b1[_0x2247('0x36')]=_['keys'](db[_0x2247('0x2d')][_0x2247('0x49')]);_0x4141b1[_0x2247('0x31')]=_['keys'](_0x35072[_0x2247('0x31')]);_0x4141b1[_0x2247('0x33')]=_['intersection'](_0x4141b1[_0x2247('0x36')],_0x4141b1[_0x2247('0x31')]);_0x2c342e[_0x2247('0x35')]=_['intersection'](_0x4141b1[_0x2247('0x36')],qs[_0x2247('0x37')](_0x35072[_0x2247('0x31')][_0x2247('0x37')]));_0x2c342e[_0x2247('0x35')]=_0x2c342e[_0x2247('0x35')][_0x2247('0x38')]?_0x2c342e['attributes']:_0x4141b1[_0x2247('0x36')];if(_0x35072[_0x2247('0x31')][_0x2247('0x43')]){_0x2c342e['include']=[{'all':!![]}];}_0x2c342e=_[_0x2247('0x40')]({},_0x2c342e,_0x35072[_0x2247('0x42')]);return db[_0x2247('0x2d')]['find'](_0x2c342e)[_0x2247('0x27')](handleEntityNotFound(_0x2545f5,null))[_0x2247('0x27')](respondWithResult(_0x2545f5,null))['catch'](handleError(_0x2545f5,null));};exports['create']=function(_0x4493f9,_0x57d465){return db[_0x2247('0x2d')][_0x2247('0x4a')](_0x4493f9[_0x2247('0x4b')],{})[_0x2247('0x27')](respondWithResult(_0x57d465,0xc9))[_0x2247('0x47')](handleError(_0x57d465,null));};exports[_0x2247('0x26')]=function(_0x298d6f,_0x515af8){if(_0x298d6f[_0x2247('0x4b')]['id']){delete _0x298d6f[_0x2247('0x4b')]['id'];}return db[_0x2247('0x2d')][_0x2247('0x4c')]({'where':{'id':_0x298d6f[_0x2247('0x48')]['id']}})[_0x2247('0x27')](handleEntityNotFound(_0x515af8,null))['then'](saveUpdates(_0x298d6f[_0x2247('0x4b')],null))['then'](respondWithResult(_0x515af8,null))[_0x2247('0x47')](handleError(_0x515af8,null));};exports['destroy']=function(_0x855853,_0x43152a){return db['VoiceTransferReport'][_0x2247('0x4c')]({'where':{'id':_0x855853[_0x2247('0x48')]['id']}})[_0x2247('0x27')](handleEntityNotFound(_0x43152a,null))['then'](removeEntity(_0x43152a,null))['catch'](handleError(_0x43152a,null));};exports[_0x2247('0x4d')]=function(_0x17920e,_0x472724){return db[_0x2247('0x2d')][_0x2247('0x4d')]()[_0x2247('0x27')](respondWithResult(_0x472724,null))[_0x2247('0x47')](handleError(_0x472724,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index b271ec3..61a09d3 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 _0x909c=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','report_call_transfer','lodash','../../config/logger','api'];(function(_0x3a9172,_0x4c96e7){var _0x4ab5f9=function(_0x25d07c){while(--_0x25d07c){_0x3a9172['push'](_0x3a9172['shift']());}};_0x4ab5f9(++_0x4c96e7);}(_0x909c,0x131));var _0xc909=function(_0x8055e4,_0x59c828){_0x8055e4=_0x8055e4-0x0;var _0x18888e=_0x909c[_0x8055e4];return _0x18888e;};'use strict';var _=require(_0xc909('0x0'));var util=require('util');var logger=require(_0xc909('0x1'))(_0xc909('0x2'));var moment=require(_0xc909('0x3'));var BPromise=require(_0xc909('0x4'));var rp=require(_0xc909('0x5'));var fs=require('fs');var path=require(_0xc909('0x6'));var rimraf=require(_0xc909('0x7'));var config=require(_0xc909('0x8'));var attributes=require('./voiceTransferReport.attributes');module['exports']=function(_0x5e93a2,_0x56d750){return _0x5e93a2[_0xc909('0x9')]('VoiceTransferReport',attributes,{'tableName':_0xc909('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf3b5=['api','moment','request-promise','path','rimraf','./voiceTransferReport.attributes','exports','VoiceTransferReport','lodash','../../config/logger'];(function(_0x555dca,_0x3e8633){var _0x5ef5ff=function(_0x58d561){while(--_0x58d561){_0x555dca['push'](_0x555dca['shift']());}};_0x5ef5ff(++_0x3e8633);}(_0xf3b5,0x76));var _0x5f3b=function(_0xdc0d6e,_0x30dda7){_0xdc0d6e=_0xdc0d6e-0x0;var _0xe471ee=_0xf3b5[_0xdc0d6e];return _0xe471ee;};'use strict';var _=require(_0x5f3b('0x0'));var util=require('util');var logger=require(_0x5f3b('0x1'))(_0x5f3b('0x2'));var moment=require(_0x5f3b('0x3'));var BPromise=require('bluebird');var rp=require(_0x5f3b('0x4'));var fs=require('fs');var path=require(_0x5f3b('0x5'));var rimraf=require(_0x5f3b('0x6'));var config=require('../../config/environment');var attributes=require(_0x5f3b('0x7'));module[_0x5f3b('0x8')]=function(_0x12b7c6,_0x29dd78){return _0x12b7c6['define'](_0x5f3b('0x9'),attributes,{'tableName':'report_call_transfer','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 e6483ac..f053a8f 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 _0x5eb8=['code','VoiceTransferReport,\x20%s,\x20%s','message','result','VoiceTransferReport','body','options','info','CreateVoiceTransferReport','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x540511,_0x201e3b){var _0x5c1ac6=function(_0xdacf37){while(--_0xdacf37){_0x540511['push'](_0x540511['shift']());}};_0x5c1ac6(++_0x201e3b);}(_0x5eb8,0x106));var _0x85eb=function(_0xe09d0,_0x1e55d0){_0xe09d0=_0xe09d0-0x0;var _0x44ad05=_0x5eb8[_0xe09d0];return _0x44ad05;};'use strict';var _=require(_0x85eb('0x0'));var util=require(_0x85eb('0x1'));var moment=require(_0x85eb('0x2'));var BPromise=require('bluebird');var rs=require(_0x85eb('0x3'));var fs=require('fs');var Redis=require(_0x85eb('0x4'));var db=require(_0x85eb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x85eb('0x6'))(_0x85eb('0x7'));var config=require('../../config/environment');var jayson=require(_0x85eb('0x8'));var client=jayson[_0x85eb('0x9')][_0x85eb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xdbecd,_0x44c705,_0xd19546){return new BPromise(function(_0x1e3ff5,_0x1c6a3b){return client[_0x85eb('0xb')](_0xdbecd,_0xd19546)[_0x85eb('0xc')](function(_0x28c77d){logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x44c705,'request\x20sent');logger[_0x85eb('0xd')](_0x85eb('0xe'),_0x44c705,_0x85eb('0xf'),JSON[_0x85eb('0x10')](_0x28c77d));if(_0x28c77d[_0x85eb('0x11')]){if(_0x28c77d[_0x85eb('0x11')][_0x85eb('0x12')]===0x1f4){logger[_0x85eb('0x11')](_0x85eb('0x13'),_0x44c705,_0x28c77d[_0x85eb('0x11')][_0x85eb('0x14')]);return _0x1c6a3b(_0x28c77d['error'][_0x85eb('0x14')]);}logger[_0x85eb('0x11')](_0x85eb('0x13'),_0x44c705,_0x28c77d[_0x85eb('0x11')][_0x85eb('0x14')]);return _0x1e3ff5(_0x28c77d[_0x85eb('0x11')][_0x85eb('0x14')]);}else{logger['info'](_0x85eb('0x13'),_0x44c705,_0x85eb('0xf'));_0x1e3ff5(_0x28c77d[_0x85eb('0x15')][_0x85eb('0x14')]);}})['catch'](function(_0x3e6960){logger[_0x85eb('0x11')](_0x85eb('0x13'),_0x44c705,_0x3e6960);_0x1c6a3b(_0x3e6960);});});}exports['CreateVoiceTransferReport']=function(_0xe5155f){var _0x4800d0=this;return new Promise(function(_0x94a7fc,_0x193b3b){return db[_0x85eb('0x16')]['create'](_0xe5155f[_0x85eb('0x17')],{'raw':_0xe5155f[_0x85eb('0x18')]?_0xe5155f[_0x85eb('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x85eb('0xc')](function(_0x5ce603){logger[_0x85eb('0x19')]('CreateVoiceTransferReport',_0xe5155f);logger[_0x85eb('0xd')](_0x85eb('0x1a'),_0xe5155f,JSON[_0x85eb('0x10')](_0x5ce603));_0x94a7fc(_0x5ce603);})[_0x85eb('0x1b')](function(_0x567919){logger[_0x85eb('0x11')](_0x85eb('0x1a'),_0x567919[_0x85eb('0x14')],_0xe5155f);_0x193b3b(_0x4800d0[_0x85eb('0x11')](0x1f4,_0x567919[_0x85eb('0x14')]));});});}; \ No newline at end of file +var _0x1e74=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateVoiceTransferReport','create','body','options','raw','stringify','lodash','moment','randomstring'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1e74,0x13c));var _0x41e7=function(_0xe77286,_0x4bb229){_0xe77286=_0xe77286-0x0;var _0x53448e=_0x1e74[_0xe77286];return _0x53448e;};'use strict';var _=require(_0x41e7('0x0'));var util=require('util');var moment=require(_0x41e7('0x1'));var BPromise=require('bluebird');var rs=require(_0x41e7('0x2'));var fs=require('fs');var Redis=require(_0x41e7('0x3'));var db=require(_0x41e7('0x4'))['db'];var utils=require(_0x41e7('0x5'));var logger=require(_0x41e7('0x6'))('rpc');var config=require(_0x41e7('0x7'));var jayson=require(_0x41e7('0x8'));var client=jayson[_0x41e7('0x9')][_0x41e7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58d45b,_0x58cd09,_0x493a24){return new BPromise(function(_0x10588e,_0x216360){return client[_0x41e7('0xb')](_0x58d45b,_0x493a24)[_0x41e7('0xc')](function(_0x391d0a){logger['info'](_0x41e7('0xd'),_0x58cd09,_0x41e7('0xe'));logger[_0x41e7('0xf')](_0x41e7('0x10'),_0x58cd09,_0x41e7('0xe'),JSON['stringify'](_0x391d0a));if(_0x391d0a[_0x41e7('0x11')]){if(_0x391d0a[_0x41e7('0x11')][_0x41e7('0x12')]===0x1f4){logger['error'](_0x41e7('0xd'),_0x58cd09,_0x391d0a[_0x41e7('0x11')][_0x41e7('0x13')]);return _0x216360(_0x391d0a['error'][_0x41e7('0x13')]);}logger[_0x41e7('0x11')](_0x41e7('0xd'),_0x58cd09,_0x391d0a[_0x41e7('0x11')][_0x41e7('0x13')]);return _0x10588e(_0x391d0a[_0x41e7('0x11')][_0x41e7('0x13')]);}else{logger[_0x41e7('0x14')](_0x41e7('0xd'),_0x58cd09,_0x41e7('0xe'));_0x10588e(_0x391d0a[_0x41e7('0x15')][_0x41e7('0x13')]);}})[_0x41e7('0x16')](function(_0x11e077){logger['error'](_0x41e7('0xd'),_0x58cd09,_0x11e077);_0x216360(_0x11e077);});});}exports[_0x41e7('0x17')]=function(_0x47ad76){var _0x5494cf=this;return new Promise(function(_0x36dc8e,_0x47fa17){return db['VoiceTransferReport'][_0x41e7('0x18')](_0x47ad76[_0x41e7('0x19')],{'raw':_0x47ad76[_0x41e7('0x1a')]?_0x47ad76[_0x41e7('0x1a')][_0x41e7('0x1b')]===undefined?!![]:![]:!![]})[_0x41e7('0xc')](function(_0x2bd910){logger[_0x41e7('0x14')]('CreateVoiceTransferReport',_0x47ad76);logger['debug'](_0x41e7('0x17'),_0x47ad76,JSON[_0x41e7('0x1c')](_0x2bd910));_0x36dc8e(_0x2bd910);})['catch'](function(_0x413d3b){logger['error'](_0x41e7('0x17'),_0x413d3b[_0x41e7('0x13')],_0x47ad76);_0x47fa17(_0x5494cf['error'](0x1f4,_0x413d3b[_0x41e7('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 9cadcd0..5b92124 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 _0x543e=['/originate','isAuthenticated','originate','canUpdate','answer','/hold','hold','/unhold','unhold','calls','/transfer','transfer','express','Router','../../components/auth/service','./webbar.controller','post'];(function(_0x1a799d,_0x37b9d0){var _0x30aef3=function(_0x1296b4){while(--_0x1296b4){_0x1a799d['push'](_0x1a799d['shift']());}};_0x30aef3(++_0x37b9d0);}(_0x543e,0x1b5));var _0xe543=function(_0x2e7982,_0x2d9e36){_0x2e7982=_0x2e7982-0x0;var _0x5b3b05=_0x543e[_0x2e7982];return _0x5b3b05;};'use strict';var express=require(_0xe543('0x0'));var router=express[_0xe543('0x1')]();var auth=require(_0xe543('0x2'));var controller=require(_0xe543('0x3'));router[_0xe543('0x4')](_0xe543('0x5'),auth[_0xe543('0x6')](),auth['canUpdate'](),controller[_0xe543('0x7')]);router[_0xe543('0x4')]('/hangup',auth['isAuthenticated'](),auth[_0xe543('0x8')](),controller['hangup']);router[_0xe543('0x4')]('/answer',auth[_0xe543('0x6')](),auth[_0xe543('0x8')](),controller[_0xe543('0x9')]);router[_0xe543('0x4')](_0xe543('0xa'),auth['isAuthenticated'](),auth[_0xe543('0x8')](),controller[_0xe543('0xb')]);router[_0xe543('0x4')](_0xe543('0xc'),auth['isAuthenticated'](),auth[_0xe543('0x8')](),controller[_0xe543('0xd')]);router[_0xe543('0x4')]('/calls',auth[_0xe543('0x6')](),auth['canUpdate'](),controller[_0xe543('0xe')]);router[_0xe543('0x4')](_0xe543('0xf'),auth['isAuthenticated'](),auth[_0xe543('0x8')](),controller[_0xe543('0x10')]);module['exports']=router; \ No newline at end of file +var _0x6082=['express','Router','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','canUpdate','/answer','answer','/hold','/unhold','/calls','calls','/transfer','transfer','exports'];(function(_0x2ff762,_0x342c0b){var _0x158b02=function(_0x13c38e){while(--_0x13c38e){_0x2ff762['push'](_0x2ff762['shift']());}};_0x158b02(++_0x342c0b);}(_0x6082,0x1dc));var _0x2608=function(_0x3a8d14,_0x420bb8){_0x3a8d14=_0x3a8d14-0x0;var _0xe544c4=_0x6082[_0x3a8d14];return _0xe544c4;};'use strict';var express=require(_0x2608('0x0'));var router=express[_0x2608('0x1')]();var auth=require(_0x2608('0x2'));var controller=require(_0x2608('0x3'));router[_0x2608('0x4')](_0x2608('0x5'),auth[_0x2608('0x6')](),auth['canUpdate'](),controller['originate']);router[_0x2608('0x4')]('/hangup',auth[_0x2608('0x6')](),auth[_0x2608('0x7')](),controller['hangup']);router[_0x2608('0x4')](_0x2608('0x8'),auth[_0x2608('0x6')](),auth[_0x2608('0x7')](),controller[_0x2608('0x9')]);router[_0x2608('0x4')](_0x2608('0xa'),auth['isAuthenticated'](),auth[_0x2608('0x7')](),controller['hold']);router[_0x2608('0x4')](_0x2608('0xb'),auth[_0x2608('0x6')](),auth[_0x2608('0x7')](),controller['unhold']);router[_0x2608('0x4')](_0x2608('0xc'),auth[_0x2608('0x6')](),auth[_0x2608('0x7')](),controller[_0x2608('0xd')]);router[_0x2608('0x4')](_0x2608('0xe'),auth[_0x2608('0x6')](),auth[_0x2608('0x7')](),controller[_0x2608('0xf')]);module[_0x2608('0x10')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 94ab535..c0b109b 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 _0x702d=['message','result','catch','User','agent','then','VoiceChannels','filter','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','body','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','json','originate\x20executed!','userId','hangup\x20executed!','answer','answer\x20fired:','validate','webbar:answer','answer\x20executed!','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','unhold\x20executed!','all','conference\x20fired:','webbar:conference','conference\x20executed!','transfer\x20fired:','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','jayson/promise','client','http','../../config/logger','ioredis','defaults','redis','localhost','number','userId\x20is\x20required','string','callNumber\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','error','stack','name','status','send','NotFound'];(function(_0x1fafcd,_0x4a6ae7){var _0x240aa0=function(_0x27a075){while(--_0x27a075){_0x1fafcd['push'](_0x1fafcd['shift']());}};_0x240aa0(++_0x4a6ae7);}(_0x702d,0x147));var _0xd702=function(_0x4cfbb9,_0xeee76f){_0x4cfbb9=_0x4cfbb9-0x0;var _0x8e0ce1=_0x702d[_0x4cfbb9];return _0x8e0ce1;};'use strict';var path=require(_0xd702('0x0'));var fs=require('fs');var _=require(_0xd702('0x1'));var db=require(_0xd702('0x2'))['db'];var config=require(_0xd702('0x3'));var util=require(_0xd702('0x4'));var BPromise=require('bluebird');var jayson=require(_0xd702('0x5'));var amiClient=jayson[_0xd702('0x6')][_0xd702('0x7')]({'port':0x232a});var logger=require(_0xd702('0x8'))('webbarapi');var Redis=require(_0xd702('0x9'));config['redis']=_[_0xd702('0xa')](config[_0xd702('0xb')],{'host':_0xd702('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd702('0xb')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0xd702('0xd'),'required':[!![],_0xd702('0xe')]},'callNumber':{'type':_0xd702('0xf'),'required':[!![],_0xd702('0x10')]},'callerId':{'type':_0xd702('0xf')},'callbackUrl':{'type':_0xd702('0xf')}});var hangupValidation=new Schema({'userId':{'type':_0xd702('0xd'),'required':[!![],_0xd702('0xe')]},'sessionId':{'type':_0xd702('0xf'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xd702('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0xd702('0xd'),'required':[!![],_0xd702('0xe')]},'sessionId':{'type':_0xd702('0xf'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0xd702('0xf'),'required':[!![],_0xd702('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0xd702('0xd'),'required':[!![],_0xd702('0xe')]},'sessionId':{'type':_0xd702('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xd702('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xd702('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xd702('0xd'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0xd702('0xd'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x268c66,_0x210c32,_0x55b93e){logger[_0xd702('0x12')](_0x268c66,_0x210c32,JSON[_0xd702('0x13')](_0x55b93e));io['to'](_0x268c66)[_0xd702('0x14')](_0x210c32,_0x55b93e);}function handleError(_0x4fdbbd){return function(_0x5b3b1d){console[_0xd702('0x15')]('handleError:',_0x5b3b1d,_0x5b3b1d instanceof RangeError);logger[_0xd702('0x16')](_0x5b3b1d[_0xd702('0x17')]);if(_0x5b3b1d instanceof RangeError){if(_0x5b3b1d[_0xd702('0x18')]){delete _0x5b3b1d[_0xd702('0x18')];}_0x4fdbbd[_0xd702('0x19')](0x194)[_0xd702('0x1a')](_0x5b3b1d);}else{if(_0x5b3b1d[_0xd702('0x18')]){delete _0x5b3b1d['name'];}_0x4fdbbd['status'](0x1f4)['send'](_0x5b3b1d);}};}function checkError(){return function(_0x55516e){if(!_0x55516e){throw new RangeError(_0xd702('0x1b'));}return _0x55516e;};}function respondWithRpcPromise(_0x5cbff4,_0x211200){return new BPromise(function(_0x5d91fd,_0xc4c246){var _0x5824ec=amiClient;return _0x5824ec['request'](_0x5cbff4,_0x211200)['then'](function(_0x21c00e){if(_0x21c00e[_0xd702('0x16')]){if(_0x21c00e[_0xd702('0x16')]['code']===0x1f4){return _0xc4c246(_0x21c00e[_0xd702('0x16')][_0xd702('0x1c')]);}return _0x5d91fd(_0x21c00e[_0xd702('0x16')][_0xd702('0x1c')]);}else{_0x5d91fd(_0x21c00e[_0xd702('0x1d')]);}})[_0xd702('0x1e')](function(_0x94c58d){_0xc4c246(_0x94c58d);});});}function getAgent(_0x45ca87){return db[_0xd702('0x1f')]['findOne']({'where':{'id':_0x45ca87,'role':_0xd702('0x20')}})[_0xd702('0x21')](checkError());}function getAgentCheckSession(_0x25e96a,_0x335202){return new BPromise(function(_0xbe4518,_0x38505d){var _0x797156=respondWithRpcPromise(_0xd702('0x22'));var _0x5f1084=getAgent(_0x25e96a);Promise['all']([_0x797156,_0x5f1084])[_0xd702('0x21')](function(_0x43cd38){var _0x56bc8d=_0x43cd38[0x0];var _0x45cd22=_0x43cd38[0x1];var _0xee8bf1=_[_0xd702('0x23')](_0x56bc8d[_0xd702('0x24')],function(_0x56e9cd){return _0x56e9cd[_0xd702('0x25')]==_0x45cd22['id']&&_0x56e9cd[_0xd702('0x26')]==_0x335202;});if(_0xee8bf1[_0xd702('0x27')]==0x1){_0xbe4518(_0x45cd22);}else{_0x38505d(new RangeError(_0xd702('0x28')+_0x335202+_0xd702('0x29')));}});});}exports['originate']=function(_0x1b1056,_0x219f41){logger[_0xd702('0x12')]('originate\x20fired:',_0x1b1056[_0xd702('0x2a')]);var _0x563103=originateValidation['validate'](_0x1b1056[_0xd702('0x2a')]);if(_0x563103[_0xd702('0x27')]>0x0){return _0x219f41[_0xd702('0x19')](0x190)['json'](_0x563103);}var _0x7b8af3=_0x1b1056[_0xd702('0x2a')]['userId'];var _0x208f50=_0x1b1056[_0xd702('0x2a')][_0xd702('0x2b')];var _0xd244cc=_0x1b1056[_0xd702('0x2a')][_0xd702('0x2c')];var _0x401f92=_0x1b1056[_0xd702('0x2a')][_0xd702('0x2d')];return getAgent(_0x7b8af3)[_0xd702('0x21')](function(_0x9f458b){logger[_0xd702('0x12')](_0xd702('0x2e'),_0x9f458b['name']);emit(util[_0xd702('0x2f')](_0xd702('0x30'),_0x9f458b[_0xd702('0x18')]),_0xd702('0x31'),{'callNumber':_0x208f50,'callerId':_0xd244cc,'callbackUrl':_0x401f92});return _0x219f41[_0xd702('0x19')](0xc8)[_0xd702('0x32')]({'error':![],'message':_0xd702('0x33')});})['catch'](handleError(_0x219f41));};exports['hangup']=function(_0x138d54,_0x1810ee){logger['info']('hangup\x20fired:',_0x138d54[_0xd702('0x2a')]);var _0x234795=hangupValidation['validate'](_0x138d54[_0xd702('0x2a')]);if(_0x234795[_0xd702('0x27')]>0x0){return _0x1810ee[_0xd702('0x19')](0x190)['json'](_0x234795);}var _0x3444c8=_0x138d54[_0xd702('0x2a')][_0xd702('0x34')];var _0x506c4a=_0x138d54[_0xd702('0x2a')]['sessionId'];return getAgent(_0x3444c8)[_0xd702('0x21')](function(_0x239bec){logger[_0xd702('0x12')](_0xd702('0x2e'),_0x239bec[_0xd702('0x18')]);emit(util[_0xd702('0x2f')](_0xd702('0x30'),_0x239bec[_0xd702('0x18')]),'webbar:hangup',{'sessionId':_0x506c4a});return _0x1810ee[_0xd702('0x19')](0xc8)[_0xd702('0x32')]({'error':![],'message':_0xd702('0x35')});})[_0xd702('0x1e')](handleError(_0x1810ee));};exports[_0xd702('0x36')]=function(_0x5ecb10,_0x203f5d){logger[_0xd702('0x12')](_0xd702('0x37'),_0x5ecb10['body']);var _0xd48ad0=answerValidation[_0xd702('0x38')](_0x5ecb10[_0xd702('0x2a')]);if(_0xd48ad0[_0xd702('0x27')]>0x0){return _0x203f5d['status'](0x190)[_0xd702('0x32')](_0xd48ad0);}var _0xfa5e9=_0x5ecb10[_0xd702('0x2a')][_0xd702('0x34')];var _0x185e4a=_0x5ecb10['body'][_0xd702('0x26')];return getAgent(_0xfa5e9)[_0xd702('0x21')](function(_0x5b1ab7){logger['info'](_0xd702('0x2e'),_0x5b1ab7[_0xd702('0x18')]);emit(util[_0xd702('0x2f')](_0xd702('0x30'),_0x5b1ab7[_0xd702('0x18')]),_0xd702('0x39'),{'sessionId':_0x185e4a});return _0x203f5d[_0xd702('0x19')](0xc8)[_0xd702('0x32')]({'error':![],'message':_0xd702('0x3a')});})['catch'](handleError(_0x203f5d));};exports['hold']=function(_0xbf6235,_0x58047c){logger[_0xd702('0x12')]('hold\x20fired:',_0xbf6235[_0xd702('0x2a')]);var _0x58a56f=holdValidation[_0xd702('0x38')](_0xbf6235['body']);if(_0x58a56f[_0xd702('0x27')]>0x0){return _0x58047c[_0xd702('0x19')](0x190)['json'](_0x58a56f);}var _0x160f5e=_0xbf6235[_0xd702('0x2a')][_0xd702('0x34')];var _0x18012d=_0xbf6235[_0xd702('0x2a')]['sessionId'];return getAgent(_0x160f5e)[_0xd702('0x21')](function(_0x14c1db){logger[_0xd702('0x12')]('entityFound:',_0x14c1db[_0xd702('0x18')]);emit(util['format'](_0xd702('0x30'),_0x14c1db[_0xd702('0x18')]),_0xd702('0x3b'),{'sessionId':_0x18012d});return _0x58047c['status'](0xc8)['json']({'error':![],'message':_0xd702('0x3c')});})[_0xd702('0x1e')](handleError(_0x58047c));};exports[_0xd702('0x3d')]=function(_0x397e91,_0x16e59b){logger[_0xd702('0x12')](_0xd702('0x3e'),_0x397e91[_0xd702('0x2a')]);var _0x7da555=unholdValidation[_0xd702('0x38')](_0x397e91['body']);if(_0x7da555['length']>0x0){return _0x16e59b[_0xd702('0x19')](0x190)[_0xd702('0x32')](_0x7da555);}var _0x229d47=_0x397e91['body']['userId'];var _0x831383=_0x397e91['body'][_0xd702('0x26')];return getAgent(_0x229d47)[_0xd702('0x21')](function(_0x18ef24){logger[_0xd702('0x12')](_0xd702('0x2e'),_0x18ef24[_0xd702('0x18')]);emit(util[_0xd702('0x2f')](_0xd702('0x30'),_0x18ef24[_0xd702('0x18')]),'webbar:unhold',{'sessionId':_0x831383});return _0x16e59b[_0xd702('0x19')](0xc8)[_0xd702('0x32')]({'error':![],'message':_0xd702('0x3f')});})[_0xd702('0x1e')](handleError(_0x16e59b));};exports['calls']=function(_0x3f3045,_0x4e542a){logger[_0xd702('0x12')]('calls\x20fired:',_0x4e542a['body']);var _0x2a31c0=callsValidation[_0xd702('0x38')](_0x3f3045[_0xd702('0x2a')]);if(_0x2a31c0[_0xd702('0x27')]>0x0){return _0x4e542a[_0xd702('0x19')](0x190)[_0xd702('0x32')](_0x2a31c0);}var _0x5db532=_0x3f3045[_0xd702('0x2a')][_0xd702('0x34')];var _0x55719b=respondWithRpcPromise(_0xd702('0x22'));var _0x316520=getAgent(_0x5db532);return Promise[_0xd702('0x40')]([_0x55719b,_0x316520])[_0xd702('0x21')](function(_0x34a194){var _0x27e588=_0x34a194[0x0];var _0x554ab8=_0x34a194[0x1];var _0x2186e7=_[_0xd702('0x23')](_0x27e588[_0xd702('0x24')],function(_0x2e536a){return _0x2e536a[_0xd702('0x25')]==_0x554ab8['id'];});return _0x4e542a['status'](0xc8)['json']({'count':_0x2186e7[_0xd702('0x27')],'rows':_0x2186e7});})['catch'](handleError(_0x4e542a));};exports['conference']=function(_0x2fa2c7,_0x48e348){logger[_0xd702('0x12')](_0xd702('0x41'),_0x2fa2c7[_0xd702('0x2a')]);var _0x1ea97e=conferenceValidation['validate'](_0x2fa2c7[_0xd702('0x2a')]);if(_0x1ea97e['length']>0x0){return _0x48e348[_0xd702('0x19')](0x190)['json'](_0x1ea97e);}var _0x4453c5=_0x2fa2c7[_0xd702('0x2a')][_0xd702('0x34')];return getAgent(_0x4453c5)[_0xd702('0x21')](function(_0x329642){logger[_0xd702('0x12')](_0xd702('0x2e'),_0x329642['name']);emit(util['format'](_0xd702('0x30'),_0x329642['name']),_0xd702('0x42'));return _0x48e348[_0xd702('0x19')](0xc8)['json']({'error':![],'message':_0xd702('0x43')});})[_0xd702('0x1e')](handleError(_0x48e348));};exports['transfer']=function(_0x1dbf12,_0x5e88cb){logger[_0xd702('0x12')](_0xd702('0x44'),_0x1dbf12[_0xd702('0x2a')]);var _0xc9611d=transferValidation['validate'](_0x1dbf12[_0xd702('0x2a')]);if(_0xc9611d[_0xd702('0x27')]>0x0){return _0x5e88cb[_0xd702('0x19')](0x190)[_0xd702('0x32')](_0xc9611d);}var _0x36a782=_0x1dbf12['body'][_0xd702('0x34')];var _0x1c514e=_0x1dbf12[_0xd702('0x2a')][_0xd702('0x26')];var _0x29fc86=_0x1dbf12[_0xd702('0x2a')]['transferNumber'];return getAgent(_0x36a782)[_0xd702('0x21')](function(_0x4f3e4f){logger[_0xd702('0x12')](_0xd702('0x2e'),_0x4f3e4f[_0xd702('0x18')]);emit(util[_0xd702('0x2f')]('user:%s',_0x4f3e4f[_0xd702('0x18')]),_0xd702('0x45'),{'sessionId':_0x1c514e,'transferNumber':_0x29fc86});return _0x5e88cb[_0xd702('0x19')](0xc8)[_0xd702('0x32')]({'error':![],'message':_0xd702('0x46')});})['catch'](handleError(_0x5e88cb));}; \ No newline at end of file +var _0x049e=['ioredis','redis','defaults','localhost','socket.io-emitter','number','userId\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','handleError:','name','status','send','request','error','message','result','catch','User','findOne','agent','then','VoiceChannels','all','filter','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','validate','body','json','userId','callNumber','callbackUrl','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','hangup\x20executed!','answer','webbar:answer','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','conference\x20fired:','webbar:conference','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../config/environment','bluebird','jayson/promise','client','http','../../config/logger'];(function(_0x49bf83,_0x3a54dc){var _0x339b39=function(_0x4ed39e){while(--_0x4ed39e){_0x49bf83['push'](_0x49bf83['shift']());}};_0x339b39(++_0x3a54dc);}(_0x049e,0x16a));var _0xe049=function(_0x3b1b23,_0x21bccd){_0x3b1b23=_0x3b1b23-0x0;var _0x1efc85=_0x049e[_0x3b1b23];return _0x1efc85;};'use strict';var path=require(_0xe049('0x0'));var fs=require('fs');var _=require(_0xe049('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0xe049('0x2'));var util=require('util');var BPromise=require(_0xe049('0x3'));var jayson=require(_0xe049('0x4'));var amiClient=jayson[_0xe049('0x5')][_0xe049('0x6')]({'port':0x232a});var logger=require(_0xe049('0x7'))('webbarapi');var Redis=require(_0xe049('0x8'));config[_0xe049('0x9')]=_[_0xe049('0xa')](config[_0xe049('0x9')],{'host':_0xe049('0xb'),'port':0x18eb});var io=require(_0xe049('0xc'))(new Redis(config[_0xe049('0x9')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0xe049('0xd'),'required':[!![],_0xe049('0xe')]},'callNumber':{'type':_0xe049('0xf'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':'string'},'callbackUrl':{'type':_0xe049('0xf')}});var hangupValidation=new Schema({'userId':{'type':_0xe049('0xd'),'required':[!![],_0xe049('0xe')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xe049('0xf'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xe049('0xd'),'required':[!![],_0xe049('0xe')]},'sessionId':{'type':_0xe049('0xf'),'required':[!![],_0xe049('0x10')]},'transferNumber':{'type':_0xe049('0xf'),'required':[!![],_0xe049('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0xe049('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xe049('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xe049('0xd'),'required':[!![],_0xe049('0xe')]},'sessionId':{'type':_0xe049('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0xe049('0xe')]}});var conferenceValidation=new Schema({'userId':{'type':_0xe049('0xd'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x388be0,_0x26b40c,_0x526d25){logger[_0xe049('0x12')](_0x388be0,_0x26b40c,JSON[_0xe049('0x13')](_0x526d25));io['to'](_0x388be0)['emit'](_0x26b40c,_0x526d25);}function handleError(_0x400a88){return function(_0x54c303){console['log'](_0xe049('0x14'),_0x54c303,_0x54c303 instanceof RangeError);logger['error'](_0x54c303['stack']);if(_0x54c303 instanceof RangeError){if(_0x54c303[_0xe049('0x15')]){delete _0x54c303[_0xe049('0x15')];}_0x400a88['status'](0x194)['send'](_0x54c303);}else{if(_0x54c303[_0xe049('0x15')]){delete _0x54c303[_0xe049('0x15')];}_0x400a88[_0xe049('0x16')](0x1f4)[_0xe049('0x17')](_0x54c303);}};}function checkError(){return function(_0x517aea){if(!_0x517aea){throw new RangeError('NotFound');}return _0x517aea;};}function respondWithRpcPromise(_0x11ceaa,_0x154fde){return new BPromise(function(_0x572a80,_0x36a03b){var _0x3f14eb=amiClient;return _0x3f14eb[_0xe049('0x18')](_0x11ceaa,_0x154fde)['then'](function(_0x197358){if(_0x197358[_0xe049('0x19')]){if(_0x197358['error']['code']===0x1f4){return _0x36a03b(_0x197358['error'][_0xe049('0x1a')]);}return _0x572a80(_0x197358['error']['message']);}else{_0x572a80(_0x197358[_0xe049('0x1b')]);}})[_0xe049('0x1c')](function(_0x53620b){_0x36a03b(_0x53620b);});});}function getAgent(_0x1f5233){return db[_0xe049('0x1d')][_0xe049('0x1e')]({'where':{'id':_0x1f5233,'role':_0xe049('0x1f')}})[_0xe049('0x20')](checkError());}function getAgentCheckSession(_0x1843b8,_0x5b0e64){return new BPromise(function(_0x50552d,_0x7f5538){var _0x542c7c=respondWithRpcPromise(_0xe049('0x21'));var _0x495d33=getAgent(_0x1843b8);Promise[_0xe049('0x22')]([_0x542c7c,_0x495d33])[_0xe049('0x20')](function(_0x5adcd6){var _0x432a6e=_0x5adcd6[0x0];var _0x364630=_0x5adcd6[0x1];var _0xb64700=_[_0xe049('0x23')](_0x432a6e[_0xe049('0x24')],function(_0x4055fc){return _0x4055fc[_0xe049('0x25')]==_0x364630['id']&&_0x4055fc[_0xe049('0x26')]==_0x5b0e64;});if(_0xb64700[_0xe049('0x27')]==0x1){_0x50552d(_0x364630);}else{_0x7f5538(new RangeError(_0xe049('0x28')+_0x5b0e64+_0xe049('0x29')));}});});}exports['originate']=function(_0x397dc3,_0x1e99c8){logger['info']('originate\x20fired:',_0x397dc3['body']);var _0x4c1499=originateValidation[_0xe049('0x2a')](_0x397dc3[_0xe049('0x2b')]);if(_0x4c1499[_0xe049('0x27')]>0x0){return _0x1e99c8[_0xe049('0x16')](0x190)[_0xe049('0x2c')](_0x4c1499);}var _0x5e2a91=_0x397dc3[_0xe049('0x2b')][_0xe049('0x2d')];var _0x2fd840=_0x397dc3[_0xe049('0x2b')][_0xe049('0x2e')];var _0x493844=_0x397dc3[_0xe049('0x2b')]['callerId'];var _0x1fc008=_0x397dc3['body'][_0xe049('0x2f')];return getAgent(_0x5e2a91)[_0xe049('0x20')](function(_0x2f8834){logger[_0xe049('0x12')](_0xe049('0x30'),_0x2f8834[_0xe049('0x15')]);emit(util[_0xe049('0x31')](_0xe049('0x32'),_0x2f8834[_0xe049('0x15')]),_0xe049('0x33'),{'callNumber':_0x2fd840,'callerId':_0x493844,'callbackUrl':_0x1fc008});return _0x1e99c8[_0xe049('0x16')](0xc8)['json']({'error':![],'message':_0xe049('0x34')});})[_0xe049('0x1c')](handleError(_0x1e99c8));};exports[_0xe049('0x35')]=function(_0x2abc8d,_0x3e042e){logger[_0xe049('0x12')](_0xe049('0x36'),_0x2abc8d[_0xe049('0x2b')]);var _0x54df1a=hangupValidation[_0xe049('0x2a')](_0x2abc8d[_0xe049('0x2b')]);if(_0x54df1a[_0xe049('0x27')]>0x0){return _0x3e042e[_0xe049('0x16')](0x190)[_0xe049('0x2c')](_0x54df1a);}var _0xe17673=_0x2abc8d[_0xe049('0x2b')][_0xe049('0x2d')];var _0x2a840f=_0x2abc8d[_0xe049('0x2b')]['sessionId'];return getAgent(_0xe17673)[_0xe049('0x20')](function(_0x176374){logger[_0xe049('0x12')]('entityFound:',_0x176374[_0xe049('0x15')]);emit(util['format']('user:%s',_0x176374[_0xe049('0x15')]),'webbar:hangup',{'sessionId':_0x2a840f});return _0x3e042e[_0xe049('0x16')](0xc8)[_0xe049('0x2c')]({'error':![],'message':_0xe049('0x37')});})[_0xe049('0x1c')](handleError(_0x3e042e));};exports[_0xe049('0x38')]=function(_0x587ea9,_0x4261da){logger[_0xe049('0x12')]('answer\x20fired:',_0x587ea9['body']);var _0x29915f=answerValidation[_0xe049('0x2a')](_0x587ea9[_0xe049('0x2b')]);if(_0x29915f[_0xe049('0x27')]>0x0){return _0x4261da[_0xe049('0x16')](0x190)[_0xe049('0x2c')](_0x29915f);}var _0x56a309=_0x587ea9[_0xe049('0x2b')][_0xe049('0x2d')];var _0x5c04f6=_0x587ea9[_0xe049('0x2b')][_0xe049('0x26')];return getAgent(_0x56a309)[_0xe049('0x20')](function(_0x2f5258){logger[_0xe049('0x12')]('entityFound:',_0x2f5258['name']);emit(util[_0xe049('0x31')](_0xe049('0x32'),_0x2f5258[_0xe049('0x15')]),_0xe049('0x39'),{'sessionId':_0x5c04f6});return _0x4261da[_0xe049('0x16')](0xc8)[_0xe049('0x2c')]({'error':![],'message':'answer\x20executed!'});})[_0xe049('0x1c')](handleError(_0x4261da));};exports[_0xe049('0x3a')]=function(_0x5dadbf,_0x374ce2){logger['info'](_0xe049('0x3b'),_0x5dadbf['body']);var _0x1112bf=holdValidation['validate'](_0x5dadbf[_0xe049('0x2b')]);if(_0x1112bf[_0xe049('0x27')]>0x0){return _0x374ce2[_0xe049('0x16')](0x190)[_0xe049('0x2c')](_0x1112bf);}var _0x22eeb1=_0x5dadbf['body'][_0xe049('0x2d')];var _0x2310ff=_0x5dadbf[_0xe049('0x2b')][_0xe049('0x26')];return getAgent(_0x22eeb1)[_0xe049('0x20')](function(_0x3c15a2){logger[_0xe049('0x12')](_0xe049('0x30'),_0x3c15a2[_0xe049('0x15')]);emit(util['format']('user:%s',_0x3c15a2[_0xe049('0x15')]),_0xe049('0x3c'),{'sessionId':_0x2310ff});return _0x374ce2[_0xe049('0x16')](0xc8)[_0xe049('0x2c')]({'error':![],'message':_0xe049('0x3d')});})[_0xe049('0x1c')](handleError(_0x374ce2));};exports[_0xe049('0x3e')]=function(_0x2e4dce,_0x23692f){logger[_0xe049('0x12')](_0xe049('0x3f'),_0x2e4dce['body']);var _0x36346a=unholdValidation[_0xe049('0x2a')](_0x2e4dce[_0xe049('0x2b')]);if(_0x36346a[_0xe049('0x27')]>0x0){return _0x23692f[_0xe049('0x16')](0x190)[_0xe049('0x2c')](_0x36346a);}var _0x373a49=_0x2e4dce['body']['userId'];var _0x57b3ff=_0x2e4dce[_0xe049('0x2b')][_0xe049('0x26')];return getAgent(_0x373a49)['then'](function(_0x2e361b){logger[_0xe049('0x12')](_0xe049('0x30'),_0x2e361b[_0xe049('0x15')]);emit(util['format']('user:%s',_0x2e361b[_0xe049('0x15')]),_0xe049('0x40'),{'sessionId':_0x57b3ff});return _0x23692f['status'](0xc8)['json']({'error':![],'message':_0xe049('0x41')});})['catch'](handleError(_0x23692f));};exports[_0xe049('0x42')]=function(_0x2a1e06,_0x567c52){logger[_0xe049('0x12')]('calls\x20fired:',_0x567c52[_0xe049('0x2b')]);var _0x3ec963=callsValidation['validate'](_0x2a1e06[_0xe049('0x2b')]);if(_0x3ec963[_0xe049('0x27')]>0x0){return _0x567c52[_0xe049('0x16')](0x190)[_0xe049('0x2c')](_0x3ec963);}var _0x421d54=_0x2a1e06[_0xe049('0x2b')][_0xe049('0x2d')];var _0x1be891=respondWithRpcPromise(_0xe049('0x21'));var _0x35f367=getAgent(_0x421d54);return Promise['all']([_0x1be891,_0x35f367])[_0xe049('0x20')](function(_0x47390a){var _0xa2a8e4=_0x47390a[0x0];var _0x4d2b67=_0x47390a[0x1];var _0x1434eb=_[_0xe049('0x23')](_0xa2a8e4[_0xe049('0x24')],function(_0x156f71){return _0x156f71[_0xe049('0x25')]==_0x4d2b67['id'];});return _0x567c52[_0xe049('0x16')](0xc8)[_0xe049('0x2c')]({'count':_0x1434eb['length'],'rows':_0x1434eb});})[_0xe049('0x1c')](handleError(_0x567c52));};exports['conference']=function(_0x440b63,_0x51f90a){logger[_0xe049('0x12')](_0xe049('0x43'),_0x440b63[_0xe049('0x2b')]);var _0x3646e9=conferenceValidation[_0xe049('0x2a')](_0x440b63['body']);if(_0x3646e9[_0xe049('0x27')]>0x0){return _0x51f90a[_0xe049('0x16')](0x190)[_0xe049('0x2c')](_0x3646e9);}var _0xad43b0=_0x440b63[_0xe049('0x2b')][_0xe049('0x2d')];return getAgent(_0xad43b0)[_0xe049('0x20')](function(_0x2e4e9f){logger['info']('entityFound:',_0x2e4e9f[_0xe049('0x15')]);emit(util[_0xe049('0x31')]('user:%s',_0x2e4e9f[_0xe049('0x15')]),_0xe049('0x44'));return _0x51f90a[_0xe049('0x16')](0xc8)[_0xe049('0x2c')]({'error':![],'message':'conference\x20executed!'});})['catch'](handleError(_0x51f90a));};exports[_0xe049('0x45')]=function(_0x57290e,_0x4386c5){logger[_0xe049('0x12')](_0xe049('0x46'),_0x57290e[_0xe049('0x2b')]);var _0x1ffabc=transferValidation[_0xe049('0x2a')](_0x57290e[_0xe049('0x2b')]);if(_0x1ffabc[_0xe049('0x27')]>0x0){return _0x4386c5['status'](0x190)[_0xe049('0x2c')](_0x1ffabc);}var _0x371b78=_0x57290e[_0xe049('0x2b')][_0xe049('0x2d')];var _0x3b002e=_0x57290e['body'][_0xe049('0x26')];var _0x236f0b=_0x57290e[_0xe049('0x2b')][_0xe049('0x47')];return getAgent(_0x371b78)['then'](function(_0x5511ac){logger[_0xe049('0x12')](_0xe049('0x30'),_0x5511ac[_0xe049('0x15')]);emit(util[_0xe049('0x31')](_0xe049('0x32'),_0x5511ac[_0xe049('0x15')]),_0xe049('0x48'),{'sessionId':_0x3b002e,'transferNumber':_0x236f0b});return _0x4386c5[_0xe049('0x16')](0xc8)[_0xe049('0x2c')]({'error':![],'message':_0xe049('0x49')});})[_0xe049('0x1c')](handleError(_0x4386c5));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 4bf8b27..5322fa7 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 _0x8952=['getAgents','/:id/applications','create','/:id/dispositions','addDisposition','post','/:id/canned_answers','addAnswer','/:id/users','addAgents','addApplications','/:id/notify','notify','send','put','update','delete','destroy','removeAgents','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','getAnswers'];(function(_0x49ca08,_0x2a4505){var _0x5663aa=function(_0x585f2a){while(--_0x585f2a){_0x49ca08['push'](_0x49ca08['shift']());}};_0x5663aa(++_0x2a4505);}(_0x8952,0x17e));var _0x2895=function(_0x59b8d7,_0x47a6a1){_0x59b8d7=_0x59b8d7-0x0;var _0x16c2ca=_0x8952[_0x59b8d7];return _0x16c2ca;};'use strict';var multer=require('multer');var util=require(_0x2895('0x0'));var path=require(_0x2895('0x1'));var timeout=require(_0x2895('0x2'));var express=require(_0x2895('0x3'));var router=express[_0x2895('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2895('0x5'));var interaction=require(_0x2895('0x6'));var config=require(_0x2895('0x7'));var controller=require('./whatsappAccount.controller');router[_0x2895('0x8')]('/',auth[_0x2895('0x9')](),controller[_0x2895('0xa')]);router['get']('/describe',auth[_0x2895('0x9')](),controller[_0x2895('0xb')]);router[_0x2895('0x8')](_0x2895('0xc'),auth[_0x2895('0x9')](),controller['show']);router[_0x2895('0x8')]('/:id/dispositions',auth[_0x2895('0x9')](),controller['getDispositions']);router['get']('/:id/canned_answers',auth[_0x2895('0x9')](),controller[_0x2895('0xd')]);router[_0x2895('0x8')]('/:id/users',auth[_0x2895('0x9')](),controller[_0x2895('0xe')]);router['get'](_0x2895('0xf'),auth[_0x2895('0x9')](),controller['getApplications']);router['post']('/',auth[_0x2895('0x9')](),controller[_0x2895('0x10')]);router['post'](_0x2895('0x11'),auth[_0x2895('0x9')](),controller[_0x2895('0x12')]);router[_0x2895('0x13')](_0x2895('0x14'),auth[_0x2895('0x9')](),controller[_0x2895('0x15')]);router[_0x2895('0x13')](_0x2895('0x16'),auth[_0x2895('0x9')](),controller[_0x2895('0x17')]);router[_0x2895('0x13')](_0x2895('0xf'),auth[_0x2895('0x9')](),controller[_0x2895('0x18')]);router[_0x2895('0x13')](_0x2895('0x19'),controller[_0x2895('0x1a')]);router['post']('/:id/send',auth['isAuthenticated'](),controller[_0x2895('0x1b')]);router[_0x2895('0x1c')](_0x2895('0xc'),auth['isAuthenticated'](),controller[_0x2895('0x1d')]);router[_0x2895('0x1e')](_0x2895('0xc'),auth[_0x2895('0x9')](),controller[_0x2895('0x1f')]);router['delete'](_0x2895('0x11'),auth[_0x2895('0x9')](),controller['removeDispositions']);router[_0x2895('0x1e')](_0x2895('0x14'),auth[_0x2895('0x9')](),controller['removeAnswers']);router['delete'](_0x2895('0x16'),auth[_0x2895('0x9')](),controller[_0x2895('0x20')]);module['exports']=router; \ No newline at end of file +var _0x4137=['get','index','/describe','isAuthenticated','/:id','show','getDispositions','/:id/canned_answers','/:id/users','getAgents','/:id/applications','create','/:id/dispositions','post','addAnswer','addAgents','addApplications','notify','/:id/send','put','update','delete','destroy','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller'];(function(_0x469532,_0x511126){var _0x2a6ddf=function(_0x38f3e2){while(--_0x38f3e2){_0x469532['push'](_0x469532['shift']());}};_0x2a6ddf(++_0x511126);}(_0x4137,0xf8));var _0x7413=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x4137[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var path=require(_0x7413('0x2'));var timeout=require(_0x7413('0x3'));var express=require(_0x7413('0x4'));var router=express[_0x7413('0x5')]();var fs_extra=require(_0x7413('0x6'));var auth=require(_0x7413('0x7'));var interaction=require(_0x7413('0x8'));var config=require(_0x7413('0x9'));var controller=require(_0x7413('0xa'));router[_0x7413('0xb')]('/',auth['isAuthenticated'](),controller[_0x7413('0xc')]);router[_0x7413('0xb')](_0x7413('0xd'),auth[_0x7413('0xe')](),controller['describe']);router[_0x7413('0xb')](_0x7413('0xf'),auth['isAuthenticated'](),controller[_0x7413('0x10')]);router[_0x7413('0xb')]('/:id/dispositions',auth[_0x7413('0xe')](),controller[_0x7413('0x11')]);router[_0x7413('0xb')](_0x7413('0x12'),auth[_0x7413('0xe')](),controller['getAnswers']);router[_0x7413('0xb')](_0x7413('0x13'),auth['isAuthenticated'](),controller[_0x7413('0x14')]);router[_0x7413('0xb')](_0x7413('0x15'),auth['isAuthenticated'](),controller['getApplications']);router['post']('/',auth[_0x7413('0xe')](),controller[_0x7413('0x16')]);router['post'](_0x7413('0x17'),auth[_0x7413('0xe')](),controller['addDisposition']);router[_0x7413('0x18')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x7413('0x19')]);router['post'](_0x7413('0x13'),auth['isAuthenticated'](),controller[_0x7413('0x1a')]);router[_0x7413('0x18')](_0x7413('0x15'),auth[_0x7413('0xe')](),controller[_0x7413('0x1b')]);router[_0x7413('0x18')]('/:id/notify',controller[_0x7413('0x1c')]);router[_0x7413('0x18')](_0x7413('0x1d'),auth[_0x7413('0xe')](),controller['send']);router[_0x7413('0x1e')](_0x7413('0xf'),auth[_0x7413('0xe')](),controller[_0x7413('0x1f')]);router[_0x7413('0x20')](_0x7413('0xf'),auth[_0x7413('0xe')](),controller[_0x7413('0x21')]);router['delete']('/:id/dispositions',auth[_0x7413('0xe')](),controller['removeDispositions']);router[_0x7413('0x20')](_0x7413('0x12'),auth[_0x7413('0xe')](),controller[_0x7413('0x22')]);router[_0x7413('0x20')](_0x7413('0x13'),auth[_0x7413('0xe')](),controller[_0x7413('0x23')]);module[_0x7413('0x24')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index f3f8445..375d2f7 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 _0xfe23=['mandatoryDispositionPauseId','sequelize','exports','STRING','name','generate','ENUM','twilio','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x39b148,_0x37726e){var _0x17a5ef=function(_0x35a1c0){while(--_0x35a1c0){_0x39b148['push'](_0x39b148['shift']());}};_0x17a5ef(++_0x37726e);}(_0xfe23,0x14b));var _0x3fe2=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xfe23[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0x3fe2('0x0'));var rs=require('randomstring');module[_0x3fe2('0x1')]={'name':{'type':Sequelize[_0x3fe2('0x2')],'unique':_0x3fe2('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x3fe2('0x2')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x3fe2('0x2')],'defaultValue':function(){return rs[_0x3fe2('0x4')]();}},'phone':{'type':Sequelize[_0x3fe2('0x2')]},'type':{'type':Sequelize[_0x3fe2('0x5')](_0x3fe2('0x6'))},'accountSid':{'type':Sequelize[_0x3fe2('0x2')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x3fe2('0x7')],'defaultValue':function(){return _0x3fe2('0x8');}},'notificationSound':{'type':Sequelize[_0x3fe2('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x3fe2('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x3fe2('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3fe2('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3fe2('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3fe2('0xa')],'comment':_0x3fe2('0xb')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x3fe2('0xc'),'set':function(_0x299783){if(!_0x299783){this[_0x3fe2('0xd')](_0x3fe2('0xe'),null);}this[_0x3fe2('0xd')]('mandatoryDisposition',_0x299783);}},'description':{'type':Sequelize[_0x3fe2('0x2')]}}; \ No newline at end of file +var _0x8290=['randomstring','exports','STRING','name','generate','ENUM','twilio','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue'];(function(_0xa041de,_0x3600e2){var _0x1d654c=function(_0x295d70){while(--_0x295d70){_0xa041de['push'](_0xa041de['shift']());}};_0x1d654c(++_0x3600e2);}(_0x8290,0x134));var _0x0829=function(_0x22a542,_0x5e60ff){_0x22a542=_0x22a542-0x0;var _0x3c1203=_0x8290[_0x22a542];return _0x3c1203;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x0829('0x0'));module[_0x0829('0x1')]={'name':{'type':Sequelize[_0x0829('0x2')],'unique':_0x0829('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x0829('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x0829('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x0829('0x4')]();}},'phone':{'type':Sequelize[_0x0829('0x2')]},'type':{'type':Sequelize[_0x0829('0x5')](_0x0829('0x6'))},'accountSid':{'type':Sequelize[_0x0829('0x2')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x0829('0x7')],'defaultValue':function(){return _0x0829('0x8');}},'notificationSound':{'type':Sequelize[_0x0829('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x0829('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0829('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0829('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0829('0xa')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x0829('0x9')],'defaultValue':![],'comment':_0x0829('0xb'),'set':function(_0x4b3cea){if(!_0x4b3cea){this['setDataValue'](_0x0829('0xc'),null);}this[_0x0829('0xd')]('mandatoryDisposition',_0x4b3cea);}},'description':{'type':Sequelize[_0x0829('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 4454134..64c10ec 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 _0x654d=['WhatsappAccounts','stack','name','send','index','Pause','WhatsappAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','merge','VIRTUAL','filter','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','mandatoryDispositionPause','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','hasOwnProperty','nolimit','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','getAgents','User','WhatsappApplication','findAndCountAll','priority','getApplications','notify','whatsapp','Applications','account','applications','orderBy','asc','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','whatsapp:','Body','messageId','MessageSid','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','list','CmContact','WhatsappInteraction','interaction','created','push','close','unmanaged','WhatsappMessage','AttachmentId','UserId','agent','waitForTheAssignedAgent','startRouting','Start','receiveMessage','entity\x20found','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','List','user','dataValues','Messages','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./whatsappAccount.socket','jayson/promise','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','destroy','get'];(function(_0x47e93d,_0x26bbdd){var _0xe86c46=function(_0x10e072){while(--_0x10e072){_0x47e93d['push'](_0x47e93d['shift']());}};_0xe86c46(++_0x26bbdd);}(_0x654d,0x80));var _0xd654=function(_0x4cab31,_0xf719a2){_0x4cab31=_0x4cab31-0x0;var _0x236639=_0x654d[_0x4cab31];return _0x236639;};'use strict';var emlformat=require(_0xd654('0x0'));var rimraf=require(_0xd654('0x1'));var zipdir=require(_0xd654('0x2'));var jsonpatch=require(_0xd654('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd654('0x4'));var Mustache=require(_0xd654('0x5'));var util=require(_0xd654('0x6'));var path=require(_0xd654('0x7'));var sox=require(_0xd654('0x8'));var csv=require('to-csv');var ejs=require(_0xd654('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd654('0xa'));var squel=require(_0xd654('0xb'));var crypto=require(_0xd654('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd654('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd654('0xe'));var Redis=require('ioredis');var authService=require(_0xd654('0xf'));var qs=require(_0xd654('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd654('0x11'));var logger=require('../../config/logger')(_0xd654('0x12'));var utils=require('../../config/utils');var config=require(_0xd654('0x13'));var licenseUtil=require(_0xd654('0x14'));var db=require(_0xd654('0x15'))['db'];config['redis']=_[_0xd654('0x16')](config[_0xd654('0x17')],{'host':_0xd654('0x18'),'port':0x18eb});var socket=require(_0xd654('0x19'))(new Redis(config[_0xd654('0x17')]));require(_0xd654('0x1a'))['register'](socket);var jayson=require(_0xd654('0x1b'));var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x512a89,_0x1e4aaa,_0x34d033,_0x151b72){return new BPromise(function(_0x21f88f,_0x2387d6){var _0x3b4ff5=_0x151b72||client;return _0x3b4ff5[_0xd654('0x1c')](_0x512a89,_0x34d033)[_0xd654('0x1d')](function(_0x288c27){logger[_0xd654('0x1e')](_0xd654('0x1f'),_0x1e4aaa,_0xd654('0x20'));logger['debug'](_0xd654('0x21'),_0x1e4aaa,'request\x20sent',JSON[_0xd654('0x22')](_0x288c27));if(_0x288c27[_0xd654('0x23')]){if(_0x288c27['error'][_0xd654('0x24')]===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x1e4aaa,_0x288c27[_0xd654('0x23')][_0xd654('0x25')]);return _0x2387d6(_0x288c27[_0xd654('0x23')][_0xd654('0x25')]);}logger[_0xd654('0x23')]('WhatsappAccount,\x20%s,\x20%s',_0x1e4aaa,_0x288c27[_0xd654('0x23')][_0xd654('0x25')]);return _0x21f88f(_0x288c27[_0xd654('0x23')][_0xd654('0x25')]);}else{logger['info'](_0xd654('0x1f'),_0x1e4aaa,_0xd654('0x20'));_0x21f88f(_0x288c27[_0xd654('0x26')]['message']);}})['catch'](function(_0x4bb2a2){logger[_0xd654('0x23')]('WhatsappAccount,\x20%s,\x20%s',_0x1e4aaa,_0x4bb2a2);_0x2387d6(_0x4bb2a2);});});}function respondWithStatusCode(_0x1a6234,_0x658b9c){_0x658b9c=_0x658b9c||0xcc;return function(_0x4a7435){if(_0x4a7435){return _0x1a6234[_0xd654('0x27')](_0x658b9c);}return _0x1a6234[_0xd654('0x28')](_0x658b9c)['end']();};}function respondWithResult(_0x275b3b,_0x45d802){_0x45d802=_0x45d802||0xc8;return function(_0x5e8974){if(_0x5e8974){return _0x275b3b['status'](_0x45d802)['json'](_0x5e8974);}};}function respondWithFilteredResult(_0x9e84e0,_0x32e7f9){return function(_0x5d9ab5){if(_0x5d9ab5){var _0x43547c=typeof _0x32e7f9[_0xd654('0x29')]===_0xd654('0x2a')&&typeof _0x32e7f9[_0xd654('0x2b')]===_0xd654('0x2a');var _0x44f085=_0x5d9ab5[_0xd654('0x2c')];var _0x3b3944=_0x43547c?0x0:_0x32e7f9[_0xd654('0x29')];var _0x466f22=_0x43547c?_0x5d9ab5[_0xd654('0x2c')]:_0x32e7f9[_0xd654('0x29')]+_0x32e7f9[_0xd654('0x2b')];var _0x38ad87;if(_0x466f22>=_0x44f085){_0x466f22=_0x44f085;_0x38ad87=0xc8;}else{_0x38ad87=0xce;}_0x9e84e0['status'](_0x38ad87);return _0x9e84e0[_0xd654('0x2d')](_0xd654('0x2e'),_0x3b3944+'-'+_0x466f22+'/'+_0x44f085)[_0xd654('0x2f')](_0x5d9ab5);}return null;};}function patchUpdates(_0x16c82a){return function(_0x355e7c){try{jsonpatch[_0xd654('0x30')](_0x355e7c,_0x16c82a,!![]);}catch(_0x219364){return BPromise['reject'](_0x219364);}return _0x355e7c[_0xd654('0x31')]();};}function saveUpdates(_0x5b9d61,_0x34a80d){return function(_0x10d77d){if(_0x10d77d){return _0x10d77d['update'](_0x5b9d61)[_0xd654('0x1d')](function(_0x1dfb4b){return _0x1dfb4b;});}return null;};}function removeEntity(_0x2018b7,_0x13045c){return function(_0x21bc5a){if(_0x21bc5a){return _0x21bc5a[_0xd654('0x32')]()['then'](function(){var _0x2d7c3e=_0x21bc5a[_0xd654('0x33')]({'plain':!![]});var _0x16f4c2=_0xd654('0x34');return db['UserProfileResource']['destroy']({'where':{'type':_0x16f4c2,'resourceId':_0x2d7c3e['id']}})[_0xd654('0x1d')](function(){return _0x21bc5a;});})['then'](function(){_0x2018b7[_0xd654('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54a72a,_0x439526){return function(_0x26de77){if(!_0x26de77){_0x54a72a[_0xd654('0x27')](0x194);}return _0x26de77;};}function handleError(_0x311e86,_0x5ce1f1){_0x5ce1f1=_0x5ce1f1||0x1f4;return function(_0xc304d8){logger[_0xd654('0x23')](_0xc304d8[_0xd654('0x35')]);if(_0xc304d8['name']){delete _0xc304d8[_0xd654('0x36')];}_0x311e86[_0xd654('0x28')](_0x5ce1f1)[_0xd654('0x37')](_0xc304d8);};}exports[_0xd654('0x38')]=function(_0xc9dfdd,_0x5015fa){var _0x4b2a3d={'include':[{'model':db[_0xd654('0x39')],'as':'mandatoryDispositionPause'}]},_0x231a5c={},_0x598731={'count':0x0,'rows':[]};var _0x1b7415=_['map'](db[_0xd654('0x3a')][_0xd654('0x3b')],function(_0x1f0303){return{'name':_0x1f0303[_0xd654('0x3c')],'type':_0x1f0303[_0xd654('0x3d')][_0xd654('0x3e')]};});_0x231a5c[_0xd654('0x3f')]=_[_0xd654('0x40')](_0x1b7415,_0xd654('0x36'));_0x231a5c[_0xd654('0x41')]=_[_0xd654('0x42')](_0xc9dfdd['query']);_0x231a5c[_0xd654('0x43')]=_[_0xd654('0x44')](_0x231a5c[_0xd654('0x3f')],_0x231a5c[_0xd654('0x41')]);_0x4b2a3d['attributes']=_[_0xd654('0x44')](_0x231a5c['model'],qs[_0xd654('0x45')](_0xc9dfdd[_0xd654('0x41')][_0xd654('0x45')]));_0x4b2a3d[_0xd654('0x46')]=_0x4b2a3d['attributes'][_0xd654('0x47')]?_0x4b2a3d['attributes']:_0x231a5c[_0xd654('0x3f')];if(!_0xc9dfdd['query']['hasOwnProperty']('nolimit')){_0x4b2a3d[_0xd654('0x2b')]=qs['limit'](_0xc9dfdd['query'][_0xd654('0x2b')]);_0x4b2a3d[_0xd654('0x29')]=qs[_0xd654('0x29')](_0xc9dfdd[_0xd654('0x41')][_0xd654('0x29')]);}_0x4b2a3d[_0xd654('0x48')]=qs[_0xd654('0x49')](_0xc9dfdd[_0xd654('0x41')]['sort']);_0x4b2a3d[_0xd654('0x4a')]=qs['filters'](_[_0xd654('0x4b')](_0xc9dfdd[_0xd654('0x41')],_0x231a5c[_0xd654('0x43')]),_0x1b7415);if(_0xc9dfdd[_0xd654('0x41')]['filter']){_0x4b2a3d[_0xd654('0x4a')]=_[_0xd654('0x4c')](_0x4b2a3d['where'],{'$or':_[_0xd654('0x40')](_0x1b7415,function(_0x1d0cfe){if(_0x1d0cfe[_0xd654('0x3d')]!==_0xd654('0x4d')){var _0x23d64f={};_0x23d64f[_0x1d0cfe['name']]={'$like':'%'+_0xc9dfdd['query'][_0xd654('0x4e')]+'%'};return _0x23d64f;}})});}_0x4b2a3d=_[_0xd654('0x4c')]({},_0x4b2a3d,_0xc9dfdd['options']);var _0x3e7f66={'where':_0x4b2a3d[_0xd654('0x4a')]};return db[_0xd654('0x3a')][_0xd654('0x2c')](_0x3e7f66)['then'](function(_0x26766a){_0x598731['count']=_0x26766a;if(_0xc9dfdd[_0xd654('0x41')]['includeAll']){_0x4b2a3d[_0xd654('0x4f')]=[{'all':!![]}];}return db[_0xd654('0x3a')][_0xd654('0x50')](_0x4b2a3d);})[_0xd654('0x1d')](function(_0x59d082){_0x598731[_0xd654('0x51')]=_0x59d082;return _0x598731;})['then'](respondWithFilteredResult(_0x5015fa,_0x4b2a3d))[_0xd654('0x52')](handleError(_0x5015fa,null));};exports[_0xd654('0x53')]=function(_0x13f515,_0x21231b){var _0x3e3924={'raw':![],'where':{'id':_0x13f515[_0xd654('0x54')]['id']},'include':[{'model':db[_0xd654('0x39')],'as':'mandatoryDispositionPause'}]},_0x59adba={};_0x59adba[_0xd654('0x3f')]=_[_0xd654('0x42')](db['WhatsappAccount'][_0xd654('0x3b')]);_0x59adba[_0xd654('0x41')]=_['keys'](_0x13f515[_0xd654('0x41')]);_0x59adba['filters']=_['intersection'](_0x59adba['model'],_0x59adba['query']);_0x3e3924['attributes']=_[_0xd654('0x44')](_0x59adba[_0xd654('0x3f')],qs['fields'](_0x13f515['query'][_0xd654('0x45')]));_0x3e3924['attributes']=_0x3e3924[_0xd654('0x46')][_0xd654('0x47')]?_0x3e3924[_0xd654('0x46')]:_0x59adba[_0xd654('0x3f')];if(_0x13f515[_0xd654('0x41')][_0xd654('0x55')]){_0x3e3924['include']=[{'all':!![]}];}_0x3e3924=_['merge']({},_0x3e3924,_0x13f515[_0xd654('0x56')]);return db[_0xd654('0x3a')][_0xd654('0x57')](_0x3e3924)[_0xd654('0x1d')](handleEntityNotFound(_0x21231b,null))['then'](respondWithResult(_0x21231b,null))['catch'](handleError(_0x21231b,null));};exports[_0xd654('0x58')]=function(_0x4344a6,_0x20062b){return db[_0xd654('0x3a')]['create'](_0x4344a6[_0xd654('0x59')],{})[_0xd654('0x1d')](function(_0xb5708b){var _0xf70263=_0x4344a6['user'][_0xd654('0x33')]({'plain':!![]});if(!_0xf70263)throw new Error(_0xd654('0x5a'));if(_0xf70263['role']==='user'){var _0x556e1d=_0xb5708b[_0xd654('0x33')]({'plain':!![]});var _0x1148ce='WhatsappAccounts';return db[_0xd654('0x5b')][_0xd654('0x57')]({'where':{'name':_0x1148ce,'userProfileId':_0xf70263['userProfileId']},'raw':!![]})[_0xd654('0x1d')](function(_0x47faa4){if(_0x47faa4&&_0x47faa4[_0xd654('0x5c')]===0x0){return db[_0xd654('0x5d')]['create']({'name':_0x556e1d[_0xd654('0x36')],'resourceId':_0x556e1d['id'],'type':_0x47faa4[_0xd654('0x36')],'sectionId':_0x47faa4['id']},{})[_0xd654('0x1d')](function(){return _0xb5708b;});}else{return _0xb5708b;}})[_0xd654('0x52')](function(_0x2a564c){logger['error'](_0xd654('0x5e'),_0x2a564c);throw _0x2a564c;});}return _0xb5708b;})[_0xd654('0x1d')](respondWithResult(_0x20062b,0xc9))[_0xd654('0x52')](handleError(_0x20062b,null));};exports[_0xd654('0x5f')]=function(_0x1983d9,_0x134a7d){if(_0x1983d9[_0xd654('0x59')]['id']){delete _0x1983d9[_0xd654('0x59')]['id'];}return db['WhatsappAccount'][_0xd654('0x57')]({'where':{'id':_0x1983d9[_0xd654('0x54')]['id']},'include':[{'model':db[_0xd654('0x39')],'as':_0xd654('0x60')}]})['then'](handleEntityNotFound(_0x134a7d,null))[_0xd654('0x1d')](saveUpdates(_0x1983d9[_0xd654('0x59')],null))[_0xd654('0x1d')](respondWithResult(_0x134a7d,null))[_0xd654('0x52')](handleError(_0x134a7d,null));};exports['destroy']=function(_0x5d5e93,_0x48a34b){return db[_0xd654('0x3a')][_0xd654('0x57')]({'where':{'id':_0x5d5e93[_0xd654('0x54')]['id']}})[_0xd654('0x1d')](handleEntityNotFound(_0x48a34b,null))[_0xd654('0x1d')](removeEntity(_0x48a34b,null))[_0xd654('0x52')](handleError(_0x48a34b,null));};exports[_0xd654('0x61')]=function(_0x4ddc18,_0x53d2c1){return db[_0xd654('0x3a')]['describe']()[_0xd654('0x1d')](respondWithResult(_0x53d2c1,null))[_0xd654('0x52')](handleError(_0x53d2c1,null));};exports[_0xd654('0x62')]=function(_0x504aff,_0x46fafa,_0x1bc9c4){if(_0x504aff[_0xd654('0x59')]['id']){delete _0x504aff[_0xd654('0x59')]['id'];}return db[_0xd654('0x3a')][_0xd654('0x57')]({'where':{'id':_0x504aff['params']['id']}})[_0xd654('0x1d')](handleEntityNotFound(_0x46fafa,null))['then'](function(_0x4c67a1){if(_0x4c67a1){_0x504aff[_0xd654('0x59')][_0xd654('0x63')]=_0x4c67a1['id'];return db[_0xd654('0x64')][_0xd654('0x58')](_0x504aff[_0xd654('0x59')]);}})['then'](respondWithResult(_0x46fafa,null))[_0xd654('0x52')](handleError(_0x46fafa,null));};exports[_0xd654('0x65')]=function(_0x24ff85,_0x4ce197,_0x35d4a5){var _0x4350b6={'raw':![],'where':{}};var _0x5e078b={};var _0x494770={'count':0x0,'rows':[]};return db[_0xd654('0x3a')][_0xd654('0x66')]({'where':{'id':_0x24ff85[_0xd654('0x54')]['id']}})[_0xd654('0x1d')](handleEntityNotFound(_0x4ce197,null))[_0xd654('0x1d')](function(_0x48aa55){if(_0x48aa55){_0x5e078b[_0xd654('0x3f')]=_['keys'](db['Disposition']['rawAttributes']);_0x5e078b['query']=_[_0xd654('0x42')](_0x24ff85[_0xd654('0x41')]);_0x5e078b[_0xd654('0x43')]=_[_0xd654('0x44')](_0x5e078b[_0xd654('0x3f')],_0x5e078b['query']);_0x4350b6[_0xd654('0x46')]=_['intersection'](_0x5e078b[_0xd654('0x3f')],qs[_0xd654('0x45')](_0x24ff85[_0xd654('0x41')][_0xd654('0x45')]));_0x4350b6[_0xd654('0x46')]=_0x4350b6[_0xd654('0x46')][_0xd654('0x47')]?_0x4350b6[_0xd654('0x46')]:_0x5e078b[_0xd654('0x3f')];if(!_0x24ff85['query'][_0xd654('0x67')](_0xd654('0x68'))){_0x4350b6[_0xd654('0x2b')]=qs[_0xd654('0x2b')](_0x24ff85[_0xd654('0x41')][_0xd654('0x2b')]);_0x4350b6[_0xd654('0x29')]=qs[_0xd654('0x29')](_0x24ff85[_0xd654('0x41')]['offset']);}_0x4350b6[_0xd654('0x48')]=qs[_0xd654('0x49')](_0x24ff85[_0xd654('0x41')][_0xd654('0x49')]);_0x4350b6[_0xd654('0x4a')]=qs[_0xd654('0x43')](_[_0xd654('0x4b')](_0x24ff85[_0xd654('0x41')],_0x5e078b[_0xd654('0x43')]));_0x4350b6[_0xd654('0x4a')][_0xd654('0x63')]=_0x48aa55['id'];if(_0x24ff85['query'][_0xd654('0x4e')]){_0x4350b6['where']=_['merge'](_0x4350b6['where'],{'$or':_[_0xd654('0x40')](_0x4350b6[_0xd654('0x46')],function(_0x598ec0){var _0xb388f6={};_0xb388f6[_0x598ec0]={'$like':'%'+_0x24ff85[_0xd654('0x41')][_0xd654('0x4e')]+'%'};return _0xb388f6;})});}_0x4350b6=_[_0xd654('0x4c')]({},_0x4350b6,_0x24ff85[_0xd654('0x56')]);return db['Disposition'][_0xd654('0x2c')]({'where':_0x4350b6[_0xd654('0x4a')]})[_0xd654('0x1d')](function(_0x17fb7f){_0x494770['count']=_0x17fb7f;if(_0x24ff85['query']['includeAll']){_0x4350b6['include']=[{'all':!![]}];}return db[_0xd654('0x64')][_0xd654('0x50')](_0x4350b6);})[_0xd654('0x1d')](function(_0x287a36){_0x494770[_0xd654('0x51')]=_0x287a36;return _0x494770;});}})['then'](respondWithFilteredResult(_0x4ce197,_0x4350b6))[_0xd654('0x52')](handleError(_0x4ce197,null));};exports[_0xd654('0x69')]=function(_0xee960,_0x397797,_0x43881f){return db['WhatsappAccount'][_0xd654('0x57')]({'where':{'id':_0xee960['params']['id']}})[_0xd654('0x1d')](handleEntityNotFound(_0x397797,null))['then'](function(_0x1277b8){if(_0x1277b8){return _0x1277b8[_0xd654('0x69')](_0xee960[_0xd654('0x41')][_0xd654('0x6a')]);}})['then'](respondWithStatusCode(_0x397797,null))['catch'](handleError(_0x397797,null));};exports[_0xd654('0x6b')]=function(_0x3aaa63,_0x4a50d0,_0x5cc5ec){if(_0x3aaa63[_0xd654('0x59')]['id']){delete _0x3aaa63['body']['id'];}return db[_0xd654('0x3a')][_0xd654('0x57')]({'where':{'id':_0x3aaa63['params']['id']}})[_0xd654('0x1d')](handleEntityNotFound(_0x4a50d0,null))[_0xd654('0x1d')](function(_0x53f041){if(_0x53f041){_0x3aaa63['body'][_0xd654('0x63')]=_0x53f041['id'];return db[_0xd654('0x6c')][_0xd654('0x58')](_0x3aaa63[_0xd654('0x59')]);}})[_0xd654('0x1d')](respondWithResult(_0x4a50d0,null))[_0xd654('0x52')](handleError(_0x4a50d0,null));};exports['getAnswers']=function(_0x5ddd87,_0x205c7a,_0x5baca8){var _0x57f53a={'raw':![],'where':{}};var _0x44d99c={};var _0x589cd4={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0xd654('0x66')]({'where':{'id':_0x5ddd87[_0xd654('0x54')]['id']}})[_0xd654('0x1d')](handleEntityNotFound(_0x205c7a,null))[_0xd654('0x1d')](function(_0x51ab3b){if(_0x51ab3b){_0x44d99c[_0xd654('0x3f')]=_[_0xd654('0x42')](db[_0xd654('0x6c')][_0xd654('0x3b')]);_0x44d99c[_0xd654('0x41')]=_['keys'](_0x5ddd87[_0xd654('0x41')]);_0x44d99c[_0xd654('0x43')]=_[_0xd654('0x44')](_0x44d99c[_0xd654('0x3f')],_0x44d99c[_0xd654('0x41')]);_0x57f53a[_0xd654('0x46')]=_[_0xd654('0x44')](_0x44d99c['model'],qs[_0xd654('0x45')](_0x5ddd87[_0xd654('0x41')]['fields']));_0x57f53a[_0xd654('0x46')]=_0x57f53a[_0xd654('0x46')][_0xd654('0x47')]?_0x57f53a[_0xd654('0x46')]:_0x44d99c[_0xd654('0x3f')];if(!_0x5ddd87[_0xd654('0x41')]['hasOwnProperty'](_0xd654('0x68'))){_0x57f53a[_0xd654('0x2b')]=qs['limit'](_0x5ddd87[_0xd654('0x41')][_0xd654('0x2b')]);_0x57f53a['offset']=qs[_0xd654('0x29')](_0x5ddd87[_0xd654('0x41')][_0xd654('0x29')]);}_0x57f53a[_0xd654('0x48')]=qs[_0xd654('0x49')](_0x5ddd87[_0xd654('0x41')][_0xd654('0x49')]);_0x57f53a[_0xd654('0x4a')]=qs['filters'](_[_0xd654('0x4b')](_0x5ddd87['query'],_0x44d99c['filters']));_0x57f53a[_0xd654('0x4a')]['WhatsappAccountId']=_0x51ab3b['id'];if(_0x5ddd87[_0xd654('0x41')][_0xd654('0x4e')]){_0x57f53a['where']=_[_0xd654('0x4c')](_0x57f53a[_0xd654('0x4a')],{'$or':_[_0xd654('0x40')](_0x57f53a[_0xd654('0x46')],function(_0x3ab74d){var _0x52e1ec={};_0x52e1ec[_0x3ab74d]={'$like':'%'+_0x5ddd87[_0xd654('0x41')][_0xd654('0x4e')]+'%'};return _0x52e1ec;})});}_0x57f53a=_[_0xd654('0x4c')]({},_0x57f53a,_0x5ddd87[_0xd654('0x56')]);return db[_0xd654('0x6c')][_0xd654('0x2c')]({'where':_0x57f53a[_0xd654('0x4a')]})[_0xd654('0x1d')](function(_0x17b149){_0x589cd4[_0xd654('0x2c')]=_0x17b149;if(_0x5ddd87[_0xd654('0x41')][_0xd654('0x55')]){_0x57f53a['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xd654('0x50')](_0x57f53a);})[_0xd654('0x1d')](function(_0x10ab80){_0x589cd4['rows']=_0x10ab80;return _0x589cd4;});}})[_0xd654('0x1d')](respondWithFilteredResult(_0x205c7a,_0x57f53a))[_0xd654('0x52')](handleError(_0x205c7a,null));};exports[_0xd654('0x6d')]=function(_0x408741,_0x5a3c40,_0x8fdd28){return db['WhatsappAccount'][_0xd654('0x57')]({'where':{'id':_0x408741[_0xd654('0x54')]['id']}})[_0xd654('0x1d')](handleEntityNotFound(_0x5a3c40,null))[_0xd654('0x1d')](function(_0x364d64){if(_0x364d64){return _0x364d64[_0xd654('0x6d')](_0x408741['query'][_0xd654('0x6a')]);}})[_0xd654('0x1d')](respondWithStatusCode(_0x5a3c40,null))[_0xd654('0x52')](handleError(_0x5a3c40,null));};exports[_0xd654('0x6e')]=function(_0x1a249b,_0x4b2e48,_0x393f20){return db[_0xd654('0x3a')][_0xd654('0x57')]({'where':{'id':_0x1a249b['params']['id']}})[_0xd654('0x1d')](handleEntityNotFound(_0x4b2e48,null))[_0xd654('0x1d')](function(_0x3b78ca){if(_0x3b78ca){return _0x3b78ca[_0xd654('0x6e')](_0x1a249b[_0xd654('0x59')][_0xd654('0x6a')],_[_0xd654('0x6f')](_0x1a249b[_0xd654('0x59')],[_0xd654('0x6a'),'id'])||{})[_0xd654('0x70')](function(_0x353ebe){for(var _0x14f6e3=0x0;_0x14f6e3<_0x1a249b[_0xd654('0x59')][_0xd654('0x6a')][_0xd654('0x47')];_0x14f6e3+=0x1){socket[_0xd654('0x71')](_0xd654('0x72'),{'UserId':Number(_0x1a249b[_0xd654('0x59')][_0xd654('0x6a')][_0x14f6e3]),'WhatsappAccountId':Number(_0x1a249b[_0xd654('0x54')]['id'])});}return _0x353ebe;});}})[_0xd654('0x1d')](respondWithResult(_0x4b2e48,null))['catch'](handleError(_0x4b2e48,null));};exports['removeAgents']=function(_0x5c4874,_0x3c8131,_0x5a855b){return db['WhatsappAccount']['find']({'where':{'id':_0x5c4874[_0xd654('0x54')]['id']}})[_0xd654('0x1d')](handleEntityNotFound(_0x3c8131,null))['then'](function(_0x2607b3){if(_0x2607b3){return _0x2607b3[_0xd654('0x73')](_0x5c4874[_0xd654('0x41')][_0xd654('0x6a')])['then'](function(){if(_[_0xd654('0x74')](_0x5c4874['query']['ids'])){for(var _0x226666=0x0;_0x226666<_0x5c4874['query']['ids'][_0xd654('0x47')];_0x226666+=0x1){socket[_0xd654('0x71')]('userWhatsappAccount:remove',{'UserId':Number(_0x5c4874[_0xd654('0x41')]['ids'][_0x226666]),'WhatsappAccountId':Number(_0x5c4874[_0xd654('0x54')]['id'])});}}else{socket[_0xd654('0x71')]('userWhatsappAccount:remove',{'UserId':Number(_0x5c4874['query'][_0xd654('0x6a')]),'WhatsappAccountId':Number(_0x5c4874[_0xd654('0x54')]['id'])});}});}})[_0xd654('0x1d')](respondWithStatusCode(_0x3c8131,null))[_0xd654('0x52')](handleError(_0x3c8131,null));};exports[_0xd654('0x75')]=function(_0x2da4b6,_0x142646,_0x189cbf){var _0x58c9d2={};var _0x112b2d={};var _0x5140c8;var _0x127186;return db[_0xd654('0x3a')][_0xd654('0x66')]({'where':{'id':_0x2da4b6[_0xd654('0x54')]['id']}})['then'](handleEntityNotFound(_0x142646,null))['then'](function(_0x7eb59f){if(_0x7eb59f){_0x5140c8=_0x7eb59f;_0x112b2d[_0xd654('0x3f')]=_[_0xd654('0x42')](db[_0xd654('0x76')]['rawAttributes']);_0x112b2d[_0xd654('0x41')]=_[_0xd654('0x42')](_0x2da4b6[_0xd654('0x41')]);_0x112b2d['filters']=_[_0xd654('0x44')](_0x112b2d[_0xd654('0x3f')],_0x112b2d[_0xd654('0x41')]);_0x58c9d2[_0xd654('0x46')]=_[_0xd654('0x44')](_0x112b2d[_0xd654('0x3f')],qs['fields'](_0x2da4b6[_0xd654('0x41')][_0xd654('0x45')]));_0x58c9d2[_0xd654('0x46')]=_0x58c9d2[_0xd654('0x46')][_0xd654('0x47')]?_0x58c9d2[_0xd654('0x46')]:_0x112b2d[_0xd654('0x3f')];_0x58c9d2[_0xd654('0x48')]=qs[_0xd654('0x49')](_0x2da4b6[_0xd654('0x41')]['sort']);_0x58c9d2[_0xd654('0x4a')]=qs[_0xd654('0x43')](_[_0xd654('0x4b')](_0x2da4b6[_0xd654('0x41')],_0x112b2d[_0xd654('0x43')]));if(_0x2da4b6[_0xd654('0x41')][_0xd654('0x4e')]){_0x58c9d2[_0xd654('0x4a')]=_[_0xd654('0x4c')](_0x58c9d2[_0xd654('0x4a')],{'$or':_['map'](_0x58c9d2[_0xd654('0x46')],function(_0x337e2b){var _0x1a74f5={};_0x1a74f5[_0x337e2b]={'$like':'%'+_0x2da4b6[_0xd654('0x41')][_0xd654('0x4e')]+'%'};return _0x1a74f5;})});}_0x58c9d2=_[_0xd654('0x4c')]({},_0x58c9d2,_0x2da4b6[_0xd654('0x56')]);return _0x5140c8['getAgents'](_0x58c9d2);}})['then'](function(_0xf40594){if(_0xf40594){_0x127186=_0xf40594['length'];if(!_0x2da4b6[_0xd654('0x41')]['hasOwnProperty'](_0xd654('0x68'))){_0x58c9d2[_0xd654('0x2b')]=qs['limit'](_0x2da4b6[_0xd654('0x41')][_0xd654('0x2b')]);_0x58c9d2[_0xd654('0x29')]=qs[_0xd654('0x29')](_0x2da4b6[_0xd654('0x41')][_0xd654('0x29')]);}return _0x5140c8[_0xd654('0x75')](_0x58c9d2);}})[_0xd654('0x1d')](function(_0x13d8bb){if(_0x13d8bb){return _0x13d8bb?{'count':_0x127186,'rows':_0x13d8bb}:null;}})['then'](respondWithResult(_0x142646,null))[_0xd654('0x52')](handleError(_0x142646,null));};exports['addApplications']=function(_0x5e7d16,_0x47b8e6,_0x2d8bad){return db[_0xd654('0x3a')]['findOne']({'where':{'id':_0x5e7d16['params']['id']}})[_0xd654('0x1d')](handleEntityNotFound(_0x47b8e6,null))[_0xd654('0x1d')](function(_0x3fdac7){if(_0x3fdac7){return db['sequelize']['transaction'](function(_0x5c7b9b){return db[_0xd654('0x77')][_0xd654('0x32')]({'where':{'WhatsappAccountId':_0x5e7d16[_0xd654('0x54')]['id']},'transaction':_0x5c7b9b})['then'](function(_0x1dacfb){var _0x3dd4ba=_['map'](_0x5e7d16['body'],function(_0x4e51c3){_0x4e51c3[_0xd654('0x63')]=_0x5e7d16['params']['id'];return _0x4e51c3;});return db[_0xd654('0x77')]['bulkCreate'](_0x3dd4ba,{'transaction':_0x5c7b9b});});})['then'](function(){return db[_0xd654('0x77')][_0xd654('0x78')]({'where':{'WhatsappAccountId':_0x5e7d16['params']['id']},'order':_0xd654('0x79')});});}})[_0xd654('0x1d')](respondWithResult(_0x47b8e6,null))[_0xd654('0x52')](handleError(_0x47b8e6,null));};exports['getApplications']=function(_0x394f55,_0x47f1b8,_0x42b78a){var _0x173d5a={};var _0x35dd50={};var _0x57cc22;var _0x1e2246;return db[_0xd654('0x3a')][_0xd654('0x66')]({'where':{'id':_0x394f55['params']['id']}})[_0xd654('0x1d')](handleEntityNotFound(_0x47f1b8,null))['then'](function(_0x344aaa){if(_0x344aaa){_0x57cc22=_0x344aaa;_0x35dd50['model']=_['keys'](db[_0xd654('0x77')][_0xd654('0x3b')]);_0x35dd50[_0xd654('0x41')]=_[_0xd654('0x42')](_0x394f55['query']);_0x35dd50[_0xd654('0x43')]=_[_0xd654('0x44')](_0x35dd50[_0xd654('0x3f')],_0x35dd50['query']);_0x173d5a[_0xd654('0x46')]=_['intersection'](_0x35dd50[_0xd654('0x3f')],qs[_0xd654('0x45')](_0x394f55[_0xd654('0x41')]['fields']));_0x173d5a[_0xd654('0x46')]=_0x173d5a[_0xd654('0x46')][_0xd654('0x47')]?_0x173d5a[_0xd654('0x46')]:_0x35dd50[_0xd654('0x3f')];_0x173d5a[_0xd654('0x48')]=qs[_0xd654('0x49')](_0x394f55[_0xd654('0x41')]['sort']);_0x173d5a['where']=qs[_0xd654('0x43')](_[_0xd654('0x4b')](_0x394f55[_0xd654('0x41')],_0x35dd50[_0xd654('0x43')]));if(_0x394f55[_0xd654('0x41')][_0xd654('0x4e')]){_0x173d5a[_0xd654('0x4a')]=_[_0xd654('0x4c')](_0x173d5a[_0xd654('0x4a')],{'$or':_[_0xd654('0x40')](_0x173d5a[_0xd654('0x46')],function(_0xa71dff){var _0x5624e6={};_0x5624e6[_0xa71dff]={'$like':'%'+_0x394f55[_0xd654('0x41')]['filter']+'%'};return _0x5624e6;})});}_0x173d5a=_['merge']({},_0x173d5a,_0x394f55['options']);return _0x57cc22['getApplications'](_0x173d5a);}})[_0xd654('0x1d')](function(_0x473194){if(_0x473194){_0x1e2246=_0x473194[_0xd654('0x47')];if(!_0x394f55[_0xd654('0x41')][_0xd654('0x67')](_0xd654('0x68'))){_0x173d5a[_0xd654('0x2b')]=qs[_0xd654('0x2b')](_0x394f55[_0xd654('0x41')][_0xd654('0x2b')]);_0x173d5a[_0xd654('0x29')]=qs[_0xd654('0x29')](_0x394f55['query']['offset']);}return _0x57cc22[_0xd654('0x7a')](_0x173d5a);}})[_0xd654('0x1d')](function(_0x3f3906){if(_0x3f3906){return _0x3f3906?{'count':_0x1e2246,'rows':_0x3f3906}:null;}})['then'](respondWithResult(_0x47f1b8,null))[_0xd654('0x52')](handleError(_0x47f1b8,null));};exports[_0xd654('0x7b')]=function(_0x26dfad,_0x5ec064,_0x5f3aa4){var _0x3ccff8={'channel':_0xd654('0x7c')};var _0x4d8ed2=[];var _0x57bcf0=[];var _0x113921={};return db[_0xd654('0x3a')][_0xd654('0x57')]({'where':{'id':_0x26dfad[_0xd654('0x54')]['id']},'include':[{'model':db[_0xd654('0x77')],'as':_0xd654('0x7d')}]})[_0xd654('0x1d')](handleEntityNotFound(_0x5ec064,null))[_0xd654('0x1d')](function(_0x9b8025){_0x3ccff8[_0xd654('0x7e')]=_0x9b8025;_0x3ccff8[_0xd654('0x7f')]=_[_0xd654('0x80')](_0x9b8025[_0xd654('0x7d')],[_0xd654('0x79')],[_0xd654('0x81')]);if(_0x3ccff8[_0xd654('0x7e')][_0xd654('0x7d')]){delete _0x3ccff8[_0xd654('0x7e')][_0xd654('0x7d')];}return db['CmContact'][_0xd654('0x61')]();})[_0xd654('0x1d')](function(_0x5b21a1){if(!_0x5b21a1){throw new db['Sequelize'][(_0xd654('0x82'))]('no\x20available\x20attributes');}_0x4d8ed2=_[_0xd654('0x83')](_[_0xd654('0x42')](_0x5b21a1),[_0xd654('0x84'),_0xd654('0x85')]);_0x57bcf0=_['difference'](_[_0xd654('0x42')](_0x5b21a1),['createdAt','updatedAt',_0xd654('0x86'),_0xd654('0x87')]);_0x3ccff8[_0xd654('0x59')]={'mapKey':_0xd654('0x88')};if(_0x3ccff8['account'][_0xd654('0x3d')]&&_0x3ccff8[_0xd654('0x7e')][_0xd654('0x3d')]===_0xd654('0x89')){_0x3ccff8['body'][_0xd654('0x8a')]=_0x26dfad[_0xd654('0x59')]['From']['replace'](_0xd654('0x8b'),'');_0x3ccff8[_0xd654('0x59')]['body']=_0x26dfad[_0xd654('0x59')][_0xd654('0x8c')];_0x3ccff8[_0xd654('0x59')][_0xd654('0x8d')]=_0x26dfad['body'][_0xd654('0x8e')];}if(_0x3ccff8[_0xd654('0x59')]['id']){delete _0x3ccff8[_0xd654('0x59')]['id'];}if(_[_0xd654('0x8f')](_0x3ccff8[_0xd654('0x59')]['from'])){throw new db[(_0xd654('0x90'))][(_0xd654('0x82'))](_0xd654('0x91'));}if(_['isNil'](_0x3ccff8[_0xd654('0x59')][_0xd654('0x59')])||_0x3ccff8['body'][_0xd654('0x59')]===''){throw new db['Sequelize'][(_0xd654('0x82'))](_0xd654('0x92'));}if(_[_0xd654('0x8f')](_0x3ccff8['body'][_0xd654('0x93')])){throw new db[(_0xd654('0x90'))]['ValidationError'](_0xd654('0x94')+_0x57bcf0);}if(!_[_0xd654('0x95')](_0x57bcf0,_0x3ccff8['body'][_0xd654('0x93')])){throw new db[(_0xd654('0x90'))][(_0xd654('0x82'))](_0xd654('0x96')+_0x57bcf0);}_0x113921[_0x3ccff8[_0xd654('0x59')][_0xd654('0x93')]]=_0x3ccff8['body'][_0xd654('0x8a')];return db['CmList']['find']({'where':{'id':_0x3ccff8[_0xd654('0x7e')][_0xd654('0x87')]},'include':[{'model':db['CmContact'],'as':_0xd654('0x97'),'where':_0x113921,'limit':0x1,'order':[['updatedAt',_0xd654('0x98')]]}]});})[_0xd654('0x1d')](handleEntityNotFound(_0x5ec064,null))[_0xd654('0x1d')](function(_0x18926c){if(_0x18926c){_0x3ccff8[_0xd654('0x99')]=_[_0xd654('0x6f')](_0x18926c,[_0xd654('0x97')]);if(_0x18926c[_0xd654('0x97')][_0xd654('0x47')]){return _0x18926c['Contacts'][0x0];}var _0x2da48c=_[_0xd654('0x16')](_0x3ccff8[_0xd654('0x59')],{'firstName':_0x3ccff8[_0xd654('0x59')]['from'],'ListId':_0x18926c['id']});_0x2da48c[_0x3ccff8[_0xd654('0x59')][_0xd654('0x93')]]=_0x3ccff8[_0xd654('0x59')][_0xd654('0x8a')];return db[_0xd654('0x9a')][_0xd654('0x58')](_0x2da48c,{'fields':_0x4d8ed2,'raw':!![]});}})[_0xd654('0x1d')](handleEntityNotFound(_0x5ec064,null))[_0xd654('0x1d')](function(_0x3af2c1){if(_0x3af2c1){_0x3ccff8['contact']=_0x3af2c1;var _0xede983={'ContactId':_0x3af2c1['id'],'phone':_0x3ccff8['body'][_0xd654('0x8a')],'WhatsappAccountId':_0x26dfad['params']['id']};var _0x293985={'ContactId':_0x3af2c1['id'],'WhatsappAccountId':_0x26dfad['params']['id'],'closed':![]};return db['WhatsappInteraction'][_0xd654('0x57')]({'where':_0x293985})[_0xd654('0x1d')](function(_0x3e3843){if(_0x3e3843){return[_0x3e3843,![]];}return db[_0xd654('0x9b')][_0xd654('0x58')](_0xede983)[_0xd654('0x1d')](function(_0x3588ba){return[_0x3588ba,!![]];});});}})[_0xd654('0x70')](function(_0x48ef59,_0x105827){_0x3ccff8[_0xd654('0x9c')]=_0x48ef59['get']({'plain':!![]});_0x3ccff8[_0xd654('0x9c')][_0xd654('0x9d')]=![];if(_0x105827){if(_0x3ccff8['account']['autoclose']){_0x3ccff8['applications'][_0xd654('0x9e')]({'id':0x0,'priority':_0x3ccff8[_0xd654('0x7f')]['length']+0x1,'app':_0xd654('0x9f'),'appdata':_0xd654('0xa0'),'interval':'*,*,*,*'});}_0x3ccff8[_0xd654('0x9c')][_0xd654('0x9d')]=!![];}return db[_0xd654('0xa1')][_0xd654('0x58')]({'phone':_0x3ccff8['body'][_0xd654('0x8a')],'messageId':_0x3ccff8[_0xd654('0x59')][_0xd654('0x8d')],'body':_0x3ccff8['body'][_0xd654('0x59')],'WhatsappAccountId':_0x26dfad['params']['id'],'WhatsappInteractionId':_0x48ef59['id'],'direction':'in','ContactId':_0x48ef59['ContactId'],'AttachmentId':_0x3ccff8[_0xd654('0x59')][_0xd654('0xa2')]});})[_0xd654('0x1d')](function(_0x4d8947){_0x3ccff8[_0xd654('0x25')]=_0x4d8947;if(_0x3ccff8[_0xd654('0x9c')]['UserId']){return db[_0xd654('0x76')][_0xd654('0x57')]({'attributes':['id',_0xd654('0x36')],'where':{'id':_0x3ccff8[_0xd654('0x9c')][_0xd654('0xa3')]}})[_0xd654('0x1d')](function(_0x5aeb02){if(_0x5aeb02){_0x3ccff8['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xd654('0xa4'),'appdata':_0x5aeb02[_0xd654('0x36')]+','+(_0x3ccff8[_0xd654('0x7e')][_0xd654('0xa5')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0xd654('0xa6'),_0x3ccff8);});}return respondWithRpcPromise(_0xd654('0xa7'),_0xd654('0xa6'),_0x3ccff8);})['then'](function(_0x5f4b7c){if(_0x5f4b7c){var _0x46ed94=0xc8;var _0x2e8b67=_0xd654('0xa8');logger['info'](_0xd654('0x21'),_0x2e8b67,_0x46ed94,_0xd654('0xa9'));logger[_0xd654('0xaa')](_0xd654('0xab'),_0x2e8b67,_0x46ed94,_0xd654('0xa9'),JSON[_0xd654('0x22')](_0x5f4b7c));if(_0x3ccff8[_0xd654('0x7e')][_0xd654('0x3d')]===_0xd654('0x89')){return _0x5ec064[_0xd654('0x28')](_0x46ed94)[_0xd654('0x2d')](_0xd654('0xac'),_0xd654('0xad'))[_0xd654('0x37')](_0xd654('0xae'));}else{return _0x5ec064[_0xd654('0x28')](_0x46ed94)[_0xd654('0x2f')](_0x5f4b7c);}}})[_0xd654('0x52')](handleError(_0x5ec064,null));};exports['send']=function(_0x2d29b1,_0xfbd2eb,_0x316502){var _0x2f2c9e,_0x3e1cf8,_0x505321;if(_[_0xd654('0x8f')](_0x2d29b1[_0xd654('0x59')]['body'])||_0x2d29b1[_0xd654('0x59')]['body']===''){throw new db['Sequelize']['ValidationError'](_0xd654('0x92'));}if(_[_0xd654('0x8f')](_0x2d29b1[_0xd654('0x59')]['to'])){throw new db[(_0xd654('0x90'))][(_0xd654('0x82'))](_0xd654('0xaf'));}_0x2f2c9e=_0x2d29b1[_0xd654('0x59')]['to'];return db[_0xd654('0x3a')][_0xd654('0x57')]({'where':{'id':_0x2d29b1[_0xd654('0x54')]['id']},'include':[{'model':db['CmList'],'as':_0xd654('0xb0'),'include':[{'model':db[_0xd654('0x9a')],'as':_0xd654('0x97'),'where':{'mobile':_0x2f2c9e},'limit':0x1,'order':[[_0xd654('0x85'),_0xd654('0x98')]]}]}]})[_0xd654('0x1d')](handleEntityNotFound(_0xfbd2eb,null))[_0xd654('0x1d')](function(_0x3ec6db){if(_0x3ec6db&&_0x3ec6db[_0xd654('0xb0')]){_0x3e1cf8=_0x3ec6db[_0xd654('0x33')]({'plain':!![]});if(_0x3e1cf8['List']&&_0x3e1cf8[_0xd654('0xb0')][_0xd654('0x97')]['length']){return _0x3e1cf8[_0xd654('0xb0')][_0xd654('0x97')][0x0];}return db['CmContact'][_0xd654('0x58')](_[_0xd654('0x16')](_0x2d29b1['body'],{'firstName':_0x2f2c9e,'mobile':_0x2f2c9e,'phone':_0x2f2c9e,'ListId':_0x3e1cf8['ListId']}));}})[_0xd654('0x1d')](handleEntityNotFound(_0xfbd2eb,null))[_0xd654('0x1d')](function(_0x9f6481){if(_0x9f6481){_0x505321=_0x9f6481;return db[_0xd654('0x9b')][_0xd654('0x57')]({'where':{'ContactId':_0x505321['id'],'closed':![],'WhatsappAccountId':_0x3e1cf8['id']}})[_0xd654('0x1d')](function(_0x189a5c){if(_0x189a5c){return[_0x189a5c,![]];}return db[_0xd654('0x9b')][_0xd654('0x58')]({'UserId':_0x2d29b1[_0xd654('0xb1')]['id'],'ContactId':_0x505321['id'],'WhatsappAccountId':_0x3e1cf8['id'],'phone':_0x2f2c9e,'firstMsgDirection':'out','Messages':[_[_0xd654('0x4c')](_0x2d29b1[_0xd654('0x59')],{'read':![],'body':_0x2d29b1[_0xd654('0x59')]['body'],'phone':_0x2f2c9e,'WhatsappAccountId':_0x3e1cf8['id'],'UserId':_0x2d29b1[_0xd654('0xb1')]['id'],'ContactId':_0x505321['id']})]},{'include':[{'model':db[_0xd654('0xa1')],'as':'Messages'}]})[_0xd654('0x1d')](function(_0x1adbaa){return[_0x1adbaa,!![]];});});}})[_0xd654('0x70')](function(_0x575fcd,_0x2bdb26){if(_0x2bdb26){return _0x575fcd;}return db[_0xd654('0xa1')][_0xd654('0x58')](_[_0xd654('0x4c')](_0x2d29b1[_0xd654('0x59')],{'read':![],'body':_0x2d29b1[_0xd654('0x59')][_0xd654('0x59')],'phone':_0x2f2c9e,'WhatsappAccountId':_0x3e1cf8['id'],'WhatsappInteractionId':_0x575fcd['id'],'UserId':_0x2d29b1[_0xd654('0xb1')]['id'],'ContactId':_0x505321['id']}))['then'](function(_0xf696f){_0x575fcd[_0xd654('0xb2')][_0xd654('0xb3')]=[];_0x575fcd[_0xd654('0xb2')]['Messages'][_0xd654('0x9e')](_0xf696f[_0xd654('0xb2')]);return _0x575fcd;});})[_0xd654('0x1d')](respondWithResult(_0xfbd2eb,null))[_0xd654('0x52')](handleError(_0xfbd2eb,null));}; \ No newline at end of file +var _0x06c3=['set','apply','update','get','WhatsappAccounts','destroy','sendStatus','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','type','key','model','keys','query','filters','attributes','intersection','fields','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','WhatsappAccountId','Disposition','getDispositions','findOne','hasOwnProperty','nolimit','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addAgents','spread','emit','removeAgents','isArray','userWhatsappAccount:remove','User','getAgents','addApplications','sequelize','transaction','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','notify','whatsapp','account','applications','orderBy','Applications','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','replace','whatsapp:','MessageSid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','list','omit','defaults','contact','interaction','created','push','unmanaged','WhatsappMessage','messageId','ContactId','AttachmentId','UserId','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','\x0a','json','to\x20is\x20mandatory','List','WhatsappInteraction','out','Messages','dataValues','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','register','jayson/promise','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','end','offset','undefined','limit','count'];(function(_0x540100,_0x228bda){var _0x1c1fe7=function(_0x5b0151){while(--_0x5b0151){_0x540100['push'](_0x540100['shift']());}};_0x1c1fe7(++_0x228bda);}(_0x06c3,0x86));var _0x306c=function(_0x1734d6,_0x8ab859){_0x1734d6=_0x1734d6-0x0;var _0x37edf7=_0x06c3[_0x1734d6];return _0x37edf7;};'use strict';var emlformat=require(_0x306c('0x0'));var rimraf=require(_0x306c('0x1'));var zipdir=require(_0x306c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x306c('0x3'));var moment=require(_0x306c('0x4'));var BPromise=require(_0x306c('0x5'));var Mustache=require(_0x306c('0x6'));var util=require('util');var path=require(_0x306c('0x7'));var sox=require(_0x306c('0x8'));var csv=require(_0x306c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x306c('0xa'));var _=require(_0x306c('0xb'));var squel=require('squel');var crypto=require(_0x306c('0xc'));var jsforce=require(_0x306c('0xd'));var deskjs=require(_0x306c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x306c('0xf'));var Papa=require(_0x306c('0x10'));var Redis=require(_0x306c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x306c('0x12'));var as=require(_0x306c('0x13'));var hardwareService=require(_0x306c('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x306c('0x15'));var config=require(_0x306c('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x306c('0x17'))['db'];config[_0x306c('0x18')]=_['defaults'](config[_0x306c('0x18')],{'host':_0x306c('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x306c('0x18')]));require('./whatsappAccount.socket')[_0x306c('0x1a')](socket);var jayson=require(_0x306c('0x1b'));var client=jayson[_0x306c('0x1c')][_0x306c('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x46b6c9,_0x461a7a,_0x19d6df,_0x2e7604){return new BPromise(function(_0x1e3507,_0x32aa34){var _0x3a09d9=_0x2e7604||client;return _0x3a09d9[_0x306c('0x1e')](_0x46b6c9,_0x19d6df)[_0x306c('0x1f')](function(_0x4700bf){logger[_0x306c('0x20')](_0x306c('0x21'),_0x461a7a,'request\x20sent');logger[_0x306c('0x22')](_0x306c('0x23'),_0x461a7a,_0x306c('0x24'),JSON[_0x306c('0x25')](_0x4700bf));if(_0x4700bf[_0x306c('0x26')]){if(_0x4700bf[_0x306c('0x26')][_0x306c('0x27')]===0x1f4){logger[_0x306c('0x26')](_0x306c('0x21'),_0x461a7a,_0x4700bf[_0x306c('0x26')]['message']);return _0x32aa34(_0x4700bf[_0x306c('0x26')][_0x306c('0x28')]);}logger[_0x306c('0x26')](_0x306c('0x21'),_0x461a7a,_0x4700bf['error'][_0x306c('0x28')]);return _0x1e3507(_0x4700bf[_0x306c('0x26')][_0x306c('0x28')]);}else{logger[_0x306c('0x20')](_0x306c('0x21'),_0x461a7a,_0x306c('0x24'));_0x1e3507(_0x4700bf[_0x306c('0x29')][_0x306c('0x28')]);}})[_0x306c('0x2a')](function(_0x17e7c5){logger[_0x306c('0x26')](_0x306c('0x21'),_0x461a7a,_0x17e7c5);_0x32aa34(_0x17e7c5);});});}function respondWithStatusCode(_0xb23b23,_0x4ee65e){_0x4ee65e=_0x4ee65e||0xcc;return function(_0x5b8ad9){if(_0x5b8ad9){return _0xb23b23['sendStatus'](_0x4ee65e);}return _0xb23b23[_0x306c('0x2b')](_0x4ee65e)[_0x306c('0x2c')]();};}function respondWithResult(_0x52d3df,_0x3a4ceb){_0x3a4ceb=_0x3a4ceb||0xc8;return function(_0x5c02c3){if(_0x5c02c3){return _0x52d3df[_0x306c('0x2b')](_0x3a4ceb)['json'](_0x5c02c3);}};}function respondWithFilteredResult(_0x114f69,_0x9a14){return function(_0x2c62ec){if(_0x2c62ec){var _0x1622ef=typeof _0x9a14[_0x306c('0x2d')]===_0x306c('0x2e')&&typeof _0x9a14[_0x306c('0x2f')]===_0x306c('0x2e');var _0x3176b6=_0x2c62ec[_0x306c('0x30')];var _0x28fbcd=_0x1622ef?0x0:_0x9a14[_0x306c('0x2d')];var _0x469078=_0x1622ef?_0x2c62ec[_0x306c('0x30')]:_0x9a14[_0x306c('0x2d')]+_0x9a14['limit'];var _0x186056;if(_0x469078>=_0x3176b6){_0x469078=_0x3176b6;_0x186056=0xc8;}else{_0x186056=0xce;}_0x114f69[_0x306c('0x2b')](_0x186056);return _0x114f69[_0x306c('0x31')]('Content-Range',_0x28fbcd+'-'+_0x469078+'/'+_0x3176b6)['json'](_0x2c62ec);}return null;};}function patchUpdates(_0x52f9c1){return function(_0x459c4e){try{jsonpatch[_0x306c('0x32')](_0x459c4e,_0x52f9c1,!![]);}catch(_0x5c8ff0){return BPromise['reject'](_0x5c8ff0);}return _0x459c4e['save']();};}function saveUpdates(_0x361c6d,_0x4d158e){return function(_0x1eb1d0){if(_0x1eb1d0){return _0x1eb1d0[_0x306c('0x33')](_0x361c6d)[_0x306c('0x1f')](function(_0x40e0e5){return _0x40e0e5;});}return null;};}function removeEntity(_0x54bf05,_0x2e4da9){return function(_0x2292f6){if(_0x2292f6){return _0x2292f6['destroy']()[_0x306c('0x1f')](function(){var _0x45b223=_0x2292f6[_0x306c('0x34')]({'plain':!![]});var _0x34d902=_0x306c('0x35');return db['UserProfileResource'][_0x306c('0x36')]({'where':{'type':_0x34d902,'resourceId':_0x45b223['id']}})['then'](function(){return _0x2292f6;});})[_0x306c('0x1f')](function(){_0x54bf05['status'](0xcc)[_0x306c('0x2c')]();});}};}function handleEntityNotFound(_0x3b2c81,_0x7249ab){return function(_0x4f3ac9){if(!_0x4f3ac9){_0x3b2c81[_0x306c('0x37')](0x194);}return _0x4f3ac9;};}function handleError(_0x21991e,_0x25bde8){_0x25bde8=_0x25bde8||0x1f4;return function(_0x5cf818){logger[_0x306c('0x26')](_0x5cf818['stack']);if(_0x5cf818['name']){delete _0x5cf818[_0x306c('0x38')];}_0x21991e['status'](_0x25bde8)[_0x306c('0x39')](_0x5cf818);};}exports[_0x306c('0x3a')]=function(_0x24a8ec,_0xb3d932){var _0x5cf980={'include':[{'model':db[_0x306c('0x3b')],'as':_0x306c('0x3c')}]},_0x3ac7b1={},_0x2a619f={'count':0x0,'rows':[]};var _0x59bb55=_[_0x306c('0x3d')](db[_0x306c('0x3e')][_0x306c('0x3f')],function(_0x3e149f){return{'name':_0x3e149f['fieldName'],'type':_0x3e149f[_0x306c('0x40')][_0x306c('0x41')]};});_0x3ac7b1[_0x306c('0x42')]=_[_0x306c('0x3d')](_0x59bb55,_0x306c('0x38'));_0x3ac7b1['query']=_[_0x306c('0x43')](_0x24a8ec[_0x306c('0x44')]);_0x3ac7b1[_0x306c('0x45')]=_['intersection'](_0x3ac7b1[_0x306c('0x42')],_0x3ac7b1[_0x306c('0x44')]);_0x5cf980[_0x306c('0x46')]=_[_0x306c('0x47')](_0x3ac7b1[_0x306c('0x42')],qs[_0x306c('0x48')](_0x24a8ec[_0x306c('0x44')][_0x306c('0x48')]));_0x5cf980[_0x306c('0x46')]=_0x5cf980[_0x306c('0x46')]['length']?_0x5cf980[_0x306c('0x46')]:_0x3ac7b1[_0x306c('0x42')];if(!_0x24a8ec[_0x306c('0x44')]['hasOwnProperty']('nolimit')){_0x5cf980[_0x306c('0x2f')]=qs[_0x306c('0x2f')](_0x24a8ec['query'][_0x306c('0x2f')]);_0x5cf980[_0x306c('0x2d')]=qs[_0x306c('0x2d')](_0x24a8ec[_0x306c('0x44')]['offset']);}_0x5cf980[_0x306c('0x49')]=qs[_0x306c('0x4a')](_0x24a8ec[_0x306c('0x44')]['sort']);_0x5cf980[_0x306c('0x4b')]=qs[_0x306c('0x45')](_[_0x306c('0x4c')](_0x24a8ec[_0x306c('0x44')],_0x3ac7b1[_0x306c('0x45')]),_0x59bb55);if(_0x24a8ec[_0x306c('0x44')][_0x306c('0x4d')]){_0x5cf980[_0x306c('0x4b')]=_[_0x306c('0x4e')](_0x5cf980['where'],{'$or':_[_0x306c('0x3d')](_0x59bb55,function(_0x4accf9){if(_0x4accf9['type']!==_0x306c('0x4f')){var _0x397260={};_0x397260[_0x4accf9[_0x306c('0x38')]]={'$like':'%'+_0x24a8ec[_0x306c('0x44')][_0x306c('0x4d')]+'%'};return _0x397260;}})});}_0x5cf980=_[_0x306c('0x4e')]({},_0x5cf980,_0x24a8ec[_0x306c('0x50')]);var _0x33b848={'where':_0x5cf980[_0x306c('0x4b')]};return db['WhatsappAccount'][_0x306c('0x30')](_0x33b848)['then'](function(_0x308239){_0x2a619f['count']=_0x308239;if(_0x24a8ec[_0x306c('0x44')][_0x306c('0x51')]){_0x5cf980[_0x306c('0x52')]=[{'all':!![]}];}return db[_0x306c('0x3e')][_0x306c('0x53')](_0x5cf980);})[_0x306c('0x1f')](function(_0x43f29a){_0x2a619f[_0x306c('0x54')]=_0x43f29a;return _0x2a619f;})[_0x306c('0x1f')](respondWithFilteredResult(_0xb3d932,_0x5cf980))[_0x306c('0x2a')](handleError(_0xb3d932,null));};exports[_0x306c('0x55')]=function(_0xcbaf5a,_0x3da5c0){var _0x56eaf6={'raw':![],'where':{'id':_0xcbaf5a['params']['id']},'include':[{'model':db['Pause'],'as':_0x306c('0x3c')}]},_0x172ac6={};_0x172ac6['model']=_[_0x306c('0x43')](db[_0x306c('0x3e')][_0x306c('0x3f')]);_0x172ac6['query']=_[_0x306c('0x43')](_0xcbaf5a['query']);_0x172ac6[_0x306c('0x45')]=_[_0x306c('0x47')](_0x172ac6[_0x306c('0x42')],_0x172ac6[_0x306c('0x44')]);_0x56eaf6[_0x306c('0x46')]=_[_0x306c('0x47')](_0x172ac6[_0x306c('0x42')],qs[_0x306c('0x48')](_0xcbaf5a[_0x306c('0x44')][_0x306c('0x48')]));_0x56eaf6[_0x306c('0x46')]=_0x56eaf6[_0x306c('0x46')][_0x306c('0x56')]?_0x56eaf6[_0x306c('0x46')]:_0x172ac6['model'];if(_0xcbaf5a[_0x306c('0x44')][_0x306c('0x51')]){_0x56eaf6[_0x306c('0x52')]=[{'all':!![]}];}_0x56eaf6=_['merge']({},_0x56eaf6,_0xcbaf5a[_0x306c('0x50')]);return db[_0x306c('0x3e')][_0x306c('0x57')](_0x56eaf6)['then'](handleEntityNotFound(_0x3da5c0,null))[_0x306c('0x1f')](respondWithResult(_0x3da5c0,null))['catch'](handleError(_0x3da5c0,null));};exports['create']=function(_0xd4d5bd,_0x4da8b9){return db['WhatsappAccount'][_0x306c('0x58')](_0xd4d5bd[_0x306c('0x59')],{})[_0x306c('0x1f')](function(_0x54b900){var _0x3bf641=_0xd4d5bd[_0x306c('0x5a')][_0x306c('0x34')]({'plain':!![]});if(!_0x3bf641)throw new Error(_0x306c('0x5b'));if(_0x3bf641[_0x306c('0x5c')]===_0x306c('0x5a')){var _0x5a1396=_0x54b900[_0x306c('0x34')]({'plain':!![]});var _0x444370='WhatsappAccounts';return db[_0x306c('0x5d')]['find']({'where':{'name':_0x444370,'userProfileId':_0x3bf641['userProfileId']},'raw':!![]})[_0x306c('0x1f')](function(_0x1b2b4d){if(_0x1b2b4d&&_0x1b2b4d[_0x306c('0x5e')]===0x0){return db['UserProfileResource']['create']({'name':_0x5a1396[_0x306c('0x38')],'resourceId':_0x5a1396['id'],'type':_0x1b2b4d[_0x306c('0x38')],'sectionId':_0x1b2b4d['id']},{})[_0x306c('0x1f')](function(){return _0x54b900;});}else{return _0x54b900;}})['catch'](function(_0xc9f930){logger['error'](_0x306c('0x5f'),_0xc9f930);throw _0xc9f930;});}return _0x54b900;})[_0x306c('0x1f')](respondWithResult(_0x4da8b9,0xc9))[_0x306c('0x2a')](handleError(_0x4da8b9,null));};exports[_0x306c('0x33')]=function(_0x53134a,_0x5d2a0c){if(_0x53134a[_0x306c('0x59')]['id']){delete _0x53134a[_0x306c('0x59')]['id'];}return db[_0x306c('0x3e')]['find']({'where':{'id':_0x53134a[_0x306c('0x60')]['id']},'include':[{'model':db[_0x306c('0x3b')],'as':'mandatoryDispositionPause'}]})[_0x306c('0x1f')](handleEntityNotFound(_0x5d2a0c,null))['then'](saveUpdates(_0x53134a[_0x306c('0x59')],null))[_0x306c('0x1f')](respondWithResult(_0x5d2a0c,null))['catch'](handleError(_0x5d2a0c,null));};exports[_0x306c('0x36')]=function(_0x4d8720,_0x574dc2){return db[_0x306c('0x3e')]['find']({'where':{'id':_0x4d8720[_0x306c('0x60')]['id']}})[_0x306c('0x1f')](handleEntityNotFound(_0x574dc2,null))['then'](removeEntity(_0x574dc2,null))[_0x306c('0x2a')](handleError(_0x574dc2,null));};exports['describe']=function(_0x4957b1,_0x32485a){return db[_0x306c('0x3e')][_0x306c('0x61')]()[_0x306c('0x1f')](respondWithResult(_0x32485a,null))[_0x306c('0x2a')](handleError(_0x32485a,null));};exports['addDisposition']=function(_0x5c251a,_0x1e3270,_0x1a57e9){if(_0x5c251a['body']['id']){delete _0x5c251a[_0x306c('0x59')]['id'];}return db[_0x306c('0x3e')][_0x306c('0x57')]({'where':{'id':_0x5c251a[_0x306c('0x60')]['id']}})['then'](handleEntityNotFound(_0x1e3270,null))[_0x306c('0x1f')](function(_0x2f87a6){if(_0x2f87a6){_0x5c251a[_0x306c('0x59')][_0x306c('0x62')]=_0x2f87a6['id'];return db[_0x306c('0x63')][_0x306c('0x58')](_0x5c251a[_0x306c('0x59')]);}})[_0x306c('0x1f')](respondWithResult(_0x1e3270,null))[_0x306c('0x2a')](handleError(_0x1e3270,null));};exports[_0x306c('0x64')]=function(_0x2becb4,_0xc7b64f,_0x199372){var _0x2a3935={'raw':![],'where':{}};var _0x330615={};var _0x21905f={'count':0x0,'rows':[]};return db[_0x306c('0x3e')][_0x306c('0x65')]({'where':{'id':_0x2becb4[_0x306c('0x60')]['id']}})[_0x306c('0x1f')](handleEntityNotFound(_0xc7b64f,null))['then'](function(_0x3e4c57){if(_0x3e4c57){_0x330615[_0x306c('0x42')]=_[_0x306c('0x43')](db['Disposition'][_0x306c('0x3f')]);_0x330615[_0x306c('0x44')]=_[_0x306c('0x43')](_0x2becb4[_0x306c('0x44')]);_0x330615[_0x306c('0x45')]=_['intersection'](_0x330615[_0x306c('0x42')],_0x330615[_0x306c('0x44')]);_0x2a3935[_0x306c('0x46')]=_[_0x306c('0x47')](_0x330615[_0x306c('0x42')],qs[_0x306c('0x48')](_0x2becb4[_0x306c('0x44')][_0x306c('0x48')]));_0x2a3935[_0x306c('0x46')]=_0x2a3935[_0x306c('0x46')]['length']?_0x2a3935['attributes']:_0x330615['model'];if(!_0x2becb4[_0x306c('0x44')][_0x306c('0x66')](_0x306c('0x67'))){_0x2a3935[_0x306c('0x2f')]=qs['limit'](_0x2becb4[_0x306c('0x44')][_0x306c('0x2f')]);_0x2a3935[_0x306c('0x2d')]=qs[_0x306c('0x2d')](_0x2becb4['query'][_0x306c('0x2d')]);}_0x2a3935[_0x306c('0x49')]=qs[_0x306c('0x4a')](_0x2becb4[_0x306c('0x44')][_0x306c('0x4a')]);_0x2a3935[_0x306c('0x4b')]=qs[_0x306c('0x45')](_[_0x306c('0x4c')](_0x2becb4['query'],_0x330615[_0x306c('0x45')]));_0x2a3935[_0x306c('0x4b')][_0x306c('0x62')]=_0x3e4c57['id'];if(_0x2becb4['query']['filter']){_0x2a3935[_0x306c('0x4b')]=_['merge'](_0x2a3935[_0x306c('0x4b')],{'$or':_[_0x306c('0x3d')](_0x2a3935['attributes'],function(_0x51507a){var _0x4da477={};_0x4da477[_0x51507a]={'$like':'%'+_0x2becb4[_0x306c('0x44')]['filter']+'%'};return _0x4da477;})});}_0x2a3935=_[_0x306c('0x4e')]({},_0x2a3935,_0x2becb4[_0x306c('0x50')]);return db[_0x306c('0x63')][_0x306c('0x30')]({'where':_0x2a3935[_0x306c('0x4b')]})[_0x306c('0x1f')](function(_0x110dd5){_0x21905f[_0x306c('0x30')]=_0x110dd5;if(_0x2becb4[_0x306c('0x44')][_0x306c('0x51')]){_0x2a3935[_0x306c('0x52')]=[{'all':!![]}];}return db[_0x306c('0x63')][_0x306c('0x53')](_0x2a3935);})[_0x306c('0x1f')](function(_0x5609f4){_0x21905f[_0x306c('0x54')]=_0x5609f4;return _0x21905f;});}})[_0x306c('0x1f')](respondWithFilteredResult(_0xc7b64f,_0x2a3935))[_0x306c('0x2a')](handleError(_0xc7b64f,null));};exports[_0x306c('0x68')]=function(_0x4fc42b,_0x593b60,_0x496ac){return db[_0x306c('0x3e')]['find']({'where':{'id':_0x4fc42b[_0x306c('0x60')]['id']}})[_0x306c('0x1f')](handleEntityNotFound(_0x593b60,null))['then'](function(_0x34b89a){if(_0x34b89a){return _0x34b89a[_0x306c('0x68')](_0x4fc42b['query'][_0x306c('0x69')]);}})[_0x306c('0x1f')](respondWithStatusCode(_0x593b60,null))[_0x306c('0x2a')](handleError(_0x593b60,null));};exports[_0x306c('0x6a')]=function(_0x5ce83f,_0x6224c8,_0x322b05){if(_0x5ce83f['body']['id']){delete _0x5ce83f['body']['id'];}return db[_0x306c('0x3e')][_0x306c('0x57')]({'where':{'id':_0x5ce83f['params']['id']}})[_0x306c('0x1f')](handleEntityNotFound(_0x6224c8,null))['then'](function(_0x2f39fe){if(_0x2f39fe){_0x5ce83f['body']['WhatsappAccountId']=_0x2f39fe['id'];return db[_0x306c('0x6b')][_0x306c('0x58')](_0x5ce83f[_0x306c('0x59')]);}})[_0x306c('0x1f')](respondWithResult(_0x6224c8,null))[_0x306c('0x2a')](handleError(_0x6224c8,null));};exports[_0x306c('0x6c')]=function(_0x579c1f,_0x45078b,_0x528451){var _0x44b44f={'raw':![],'where':{}};var _0x13f0e1={};var _0x2c5c9f={'count':0x0,'rows':[]};return db[_0x306c('0x3e')][_0x306c('0x65')]({'where':{'id':_0x579c1f[_0x306c('0x60')]['id']}})[_0x306c('0x1f')](handleEntityNotFound(_0x45078b,null))[_0x306c('0x1f')](function(_0x468c11){if(_0x468c11){_0x13f0e1[_0x306c('0x42')]=_[_0x306c('0x43')](db[_0x306c('0x6b')][_0x306c('0x3f')]);_0x13f0e1[_0x306c('0x44')]=_[_0x306c('0x43')](_0x579c1f['query']);_0x13f0e1[_0x306c('0x45')]=_[_0x306c('0x47')](_0x13f0e1[_0x306c('0x42')],_0x13f0e1['query']);_0x44b44f[_0x306c('0x46')]=_[_0x306c('0x47')](_0x13f0e1[_0x306c('0x42')],qs['fields'](_0x579c1f['query'][_0x306c('0x48')]));_0x44b44f[_0x306c('0x46')]=_0x44b44f[_0x306c('0x46')][_0x306c('0x56')]?_0x44b44f[_0x306c('0x46')]:_0x13f0e1['model'];if(!_0x579c1f[_0x306c('0x44')][_0x306c('0x66')](_0x306c('0x67'))){_0x44b44f[_0x306c('0x2f')]=qs['limit'](_0x579c1f['query'][_0x306c('0x2f')]);_0x44b44f[_0x306c('0x2d')]=qs[_0x306c('0x2d')](_0x579c1f[_0x306c('0x44')]['offset']);}_0x44b44f['order']=qs[_0x306c('0x4a')](_0x579c1f[_0x306c('0x44')][_0x306c('0x4a')]);_0x44b44f['where']=qs[_0x306c('0x45')](_['pick'](_0x579c1f[_0x306c('0x44')],_0x13f0e1[_0x306c('0x45')]));_0x44b44f[_0x306c('0x4b')][_0x306c('0x62')]=_0x468c11['id'];if(_0x579c1f['query'][_0x306c('0x4d')]){_0x44b44f['where']=_[_0x306c('0x4e')](_0x44b44f[_0x306c('0x4b')],{'$or':_[_0x306c('0x3d')](_0x44b44f[_0x306c('0x46')],function(_0x4e06a4){var _0x38a145={};_0x38a145[_0x4e06a4]={'$like':'%'+_0x579c1f[_0x306c('0x44')]['filter']+'%'};return _0x38a145;})});}_0x44b44f=_[_0x306c('0x4e')]({},_0x44b44f,_0x579c1f['options']);return db['CannedAnswer'][_0x306c('0x30')]({'where':_0x44b44f[_0x306c('0x4b')]})[_0x306c('0x1f')](function(_0x7a4f52){_0x2c5c9f[_0x306c('0x30')]=_0x7a4f52;if(_0x579c1f[_0x306c('0x44')][_0x306c('0x51')]){_0x44b44f['include']=[{'all':!![]}];}return db[_0x306c('0x6b')][_0x306c('0x53')](_0x44b44f);})['then'](function(_0x29d3ad){_0x2c5c9f[_0x306c('0x54')]=_0x29d3ad;return _0x2c5c9f;});}})['then'](respondWithFilteredResult(_0x45078b,_0x44b44f))['catch'](handleError(_0x45078b,null));};exports[_0x306c('0x6d')]=function(_0x1c4301,_0x794a2b,_0x3da6c4){return db[_0x306c('0x3e')][_0x306c('0x57')]({'where':{'id':_0x1c4301[_0x306c('0x60')]['id']}})[_0x306c('0x1f')](handleEntityNotFound(_0x794a2b,null))[_0x306c('0x1f')](function(_0x3c323d){if(_0x3c323d){return _0x3c323d[_0x306c('0x6d')](_0x1c4301[_0x306c('0x44')][_0x306c('0x69')]);}})[_0x306c('0x1f')](respondWithStatusCode(_0x794a2b,null))[_0x306c('0x2a')](handleError(_0x794a2b,null));};exports[_0x306c('0x6e')]=function(_0x1dca1b,_0x3def45,_0x171e5a){return db['WhatsappAccount']['find']({'where':{'id':_0x1dca1b['params']['id']}})[_0x306c('0x1f')](handleEntityNotFound(_0x3def45,null))[_0x306c('0x1f')](function(_0x1fe7cf){if(_0x1fe7cf){return _0x1fe7cf[_0x306c('0x6e')](_0x1dca1b[_0x306c('0x59')][_0x306c('0x69')],_['omit'](_0x1dca1b['body'],[_0x306c('0x69'),'id'])||{})[_0x306c('0x6f')](function(_0x2cbdff){for(var _0x2ba51c=0x0;_0x2ba51c<_0x1dca1b[_0x306c('0x59')][_0x306c('0x69')][_0x306c('0x56')];_0x2ba51c+=0x1){socket[_0x306c('0x70')]('userWhatsappAccount:save',{'UserId':Number(_0x1dca1b[_0x306c('0x59')]['ids'][_0x2ba51c]),'WhatsappAccountId':Number(_0x1dca1b[_0x306c('0x60')]['id'])});}return _0x2cbdff;});}})[_0x306c('0x1f')](respondWithResult(_0x3def45,null))[_0x306c('0x2a')](handleError(_0x3def45,null));};exports[_0x306c('0x71')]=function(_0x2a39ac,_0x2f80d7,_0x3939fe){return db[_0x306c('0x3e')][_0x306c('0x57')]({'where':{'id':_0x2a39ac[_0x306c('0x60')]['id']}})[_0x306c('0x1f')](handleEntityNotFound(_0x2f80d7,null))[_0x306c('0x1f')](function(_0x4f2564){if(_0x4f2564){return _0x4f2564[_0x306c('0x71')](_0x2a39ac['query'][_0x306c('0x69')])[_0x306c('0x1f')](function(){if(_[_0x306c('0x72')](_0x2a39ac['query'][_0x306c('0x69')])){for(var _0x5954b5=0x0;_0x5954b5<_0x2a39ac[_0x306c('0x44')][_0x306c('0x69')][_0x306c('0x56')];_0x5954b5+=0x1){socket[_0x306c('0x70')]('userWhatsappAccount:remove',{'UserId':Number(_0x2a39ac[_0x306c('0x44')][_0x306c('0x69')][_0x5954b5]),'WhatsappAccountId':Number(_0x2a39ac['params']['id'])});}}else{socket[_0x306c('0x70')](_0x306c('0x73'),{'UserId':Number(_0x2a39ac[_0x306c('0x44')][_0x306c('0x69')]),'WhatsappAccountId':Number(_0x2a39ac['params']['id'])});}});}})[_0x306c('0x1f')](respondWithStatusCode(_0x2f80d7,null))[_0x306c('0x2a')](handleError(_0x2f80d7,null));};exports['getAgents']=function(_0x229091,_0x5ce29b,_0x2d4ef7){var _0x532313={};var _0x17c1db={};var _0x10fef9;var _0x57a369;return db[_0x306c('0x3e')][_0x306c('0x65')]({'where':{'id':_0x229091[_0x306c('0x60')]['id']}})[_0x306c('0x1f')](handleEntityNotFound(_0x5ce29b,null))[_0x306c('0x1f')](function(_0x441ab5){if(_0x441ab5){_0x10fef9=_0x441ab5;_0x17c1db[_0x306c('0x42')]=_[_0x306c('0x43')](db[_0x306c('0x74')]['rawAttributes']);_0x17c1db[_0x306c('0x44')]=_['keys'](_0x229091['query']);_0x17c1db[_0x306c('0x45')]=_[_0x306c('0x47')](_0x17c1db['model'],_0x17c1db['query']);_0x532313[_0x306c('0x46')]=_[_0x306c('0x47')](_0x17c1db[_0x306c('0x42')],qs[_0x306c('0x48')](_0x229091['query'][_0x306c('0x48')]));_0x532313['attributes']=_0x532313[_0x306c('0x46')][_0x306c('0x56')]?_0x532313['attributes']:_0x17c1db[_0x306c('0x42')];_0x532313[_0x306c('0x49')]=qs[_0x306c('0x4a')](_0x229091[_0x306c('0x44')][_0x306c('0x4a')]);_0x532313['where']=qs[_0x306c('0x45')](_[_0x306c('0x4c')](_0x229091[_0x306c('0x44')],_0x17c1db['filters']));if(_0x229091[_0x306c('0x44')]['filter']){_0x532313[_0x306c('0x4b')]=_['merge'](_0x532313[_0x306c('0x4b')],{'$or':_[_0x306c('0x3d')](_0x532313[_0x306c('0x46')],function(_0x492349){var _0x116cea={};_0x116cea[_0x492349]={'$like':'%'+_0x229091['query'][_0x306c('0x4d')]+'%'};return _0x116cea;})});}_0x532313=_[_0x306c('0x4e')]({},_0x532313,_0x229091['options']);return _0x10fef9[_0x306c('0x75')](_0x532313);}})['then'](function(_0x482949){if(_0x482949){_0x57a369=_0x482949['length'];if(!_0x229091[_0x306c('0x44')][_0x306c('0x66')](_0x306c('0x67'))){_0x532313[_0x306c('0x2f')]=qs['limit'](_0x229091['query'][_0x306c('0x2f')]);_0x532313[_0x306c('0x2d')]=qs[_0x306c('0x2d')](_0x229091['query'][_0x306c('0x2d')]);}return _0x10fef9[_0x306c('0x75')](_0x532313);}})['then'](function(_0x5dbff1){if(_0x5dbff1){return _0x5dbff1?{'count':_0x57a369,'rows':_0x5dbff1}:null;}})[_0x306c('0x1f')](respondWithResult(_0x5ce29b,null))[_0x306c('0x2a')](handleError(_0x5ce29b,null));};exports[_0x306c('0x76')]=function(_0x49518f,_0x2446d9,_0x4c006c){return db[_0x306c('0x3e')][_0x306c('0x65')]({'where':{'id':_0x49518f[_0x306c('0x60')]['id']}})[_0x306c('0x1f')](handleEntityNotFound(_0x2446d9,null))['then'](function(_0x552f44){if(_0x552f44){return db[_0x306c('0x77')][_0x306c('0x78')](function(_0x22e777){return db['WhatsappApplication']['destroy']({'where':{'WhatsappAccountId':_0x49518f[_0x306c('0x60')]['id']},'transaction':_0x22e777})[_0x306c('0x1f')](function(_0x438c19){var _0x27fdd2=_[_0x306c('0x3d')](_0x49518f[_0x306c('0x59')],function(_0x193c79){_0x193c79[_0x306c('0x62')]=_0x49518f[_0x306c('0x60')]['id'];return _0x193c79;});return db[_0x306c('0x79')][_0x306c('0x7a')](_0x27fdd2,{'transaction':_0x22e777});});})[_0x306c('0x1f')](function(){return db[_0x306c('0x79')][_0x306c('0x7b')]({'where':{'WhatsappAccountId':_0x49518f[_0x306c('0x60')]['id']},'order':_0x306c('0x7c')});});}})['then'](respondWithResult(_0x2446d9,null))[_0x306c('0x2a')](handleError(_0x2446d9,null));};exports[_0x306c('0x7d')]=function(_0xdc8102,_0x39bd0d,_0xcad72c){var _0x25150b={};var _0x8c492d={};var _0x1d351d;var _0x191430;return db[_0x306c('0x3e')][_0x306c('0x65')]({'where':{'id':_0xdc8102[_0x306c('0x60')]['id']}})['then'](handleEntityNotFound(_0x39bd0d,null))[_0x306c('0x1f')](function(_0x5b4748){if(_0x5b4748){_0x1d351d=_0x5b4748;_0x8c492d[_0x306c('0x42')]=_['keys'](db[_0x306c('0x79')][_0x306c('0x3f')]);_0x8c492d['query']=_['keys'](_0xdc8102[_0x306c('0x44')]);_0x8c492d[_0x306c('0x45')]=_[_0x306c('0x47')](_0x8c492d[_0x306c('0x42')],_0x8c492d[_0x306c('0x44')]);_0x25150b[_0x306c('0x46')]=_[_0x306c('0x47')](_0x8c492d['model'],qs[_0x306c('0x48')](_0xdc8102[_0x306c('0x44')][_0x306c('0x48')]));_0x25150b[_0x306c('0x46')]=_0x25150b['attributes']['length']?_0x25150b[_0x306c('0x46')]:_0x8c492d[_0x306c('0x42')];_0x25150b['order']=qs['sort'](_0xdc8102[_0x306c('0x44')][_0x306c('0x4a')]);_0x25150b[_0x306c('0x4b')]=qs[_0x306c('0x45')](_[_0x306c('0x4c')](_0xdc8102[_0x306c('0x44')],_0x8c492d[_0x306c('0x45')]));if(_0xdc8102[_0x306c('0x44')][_0x306c('0x4d')]){_0x25150b[_0x306c('0x4b')]=_[_0x306c('0x4e')](_0x25150b['where'],{'$or':_[_0x306c('0x3d')](_0x25150b[_0x306c('0x46')],function(_0x50d0a8){var _0x4e8905={};_0x4e8905[_0x50d0a8]={'$like':'%'+_0xdc8102['query'][_0x306c('0x4d')]+'%'};return _0x4e8905;})});}_0x25150b=_[_0x306c('0x4e')]({},_0x25150b,_0xdc8102[_0x306c('0x50')]);return _0x1d351d[_0x306c('0x7d')](_0x25150b);}})[_0x306c('0x1f')](function(_0x509a6b){if(_0x509a6b){_0x191430=_0x509a6b[_0x306c('0x56')];if(!_0xdc8102[_0x306c('0x44')][_0x306c('0x66')](_0x306c('0x67'))){_0x25150b['limit']=qs[_0x306c('0x2f')](_0xdc8102[_0x306c('0x44')]['limit']);_0x25150b[_0x306c('0x2d')]=qs[_0x306c('0x2d')](_0xdc8102[_0x306c('0x44')]['offset']);}return _0x1d351d['getApplications'](_0x25150b);}})[_0x306c('0x1f')](function(_0x2f099d){if(_0x2f099d){return _0x2f099d?{'count':_0x191430,'rows':_0x2f099d}:null;}})[_0x306c('0x1f')](respondWithResult(_0x39bd0d,null))[_0x306c('0x2a')](handleError(_0x39bd0d,null));};exports[_0x306c('0x7e')]=function(_0x54c230,_0x3322f3,_0x5458d0){var _0x44d4b8={'channel':_0x306c('0x7f')};var _0x2e01d9=[];var _0x5646c0=[];var _0x3c0e36={};return db[_0x306c('0x3e')][_0x306c('0x57')]({'where':{'id':_0x54c230[_0x306c('0x60')]['id']},'include':[{'model':db[_0x306c('0x79')],'as':'Applications'}]})['then'](handleEntityNotFound(_0x3322f3,null))['then'](function(_0x5f04ce){_0x44d4b8[_0x306c('0x80')]=_0x5f04ce;_0x44d4b8[_0x306c('0x81')]=_[_0x306c('0x82')](_0x5f04ce[_0x306c('0x83')],['priority'],['asc']);if(_0x44d4b8['account'][_0x306c('0x83')]){delete _0x44d4b8['account'][_0x306c('0x83')];}return db[_0x306c('0x84')][_0x306c('0x61')]();})['then'](function(_0x2e4be3){if(!_0x2e4be3){throw new db[(_0x306c('0x85'))][(_0x306c('0x86'))]('no\x20available\x20attributes');}_0x2e01d9=_[_0x306c('0x87')](_[_0x306c('0x43')](_0x2e4be3),[_0x306c('0x88'),_0x306c('0x89')]);_0x5646c0=_[_0x306c('0x87')](_[_0x306c('0x43')](_0x2e4be3),['createdAt',_0x306c('0x89'),_0x306c('0x8a'),_0x306c('0x8b')]);_0x44d4b8[_0x306c('0x59')]={'mapKey':_0x306c('0x8c')};if(_0x44d4b8[_0x306c('0x80')][_0x306c('0x40')]&&_0x44d4b8[_0x306c('0x80')][_0x306c('0x40')]===_0x306c('0x8d')){_0x44d4b8['body'][_0x306c('0x8e')]=_0x54c230['body']['From'][_0x306c('0x8f')](_0x306c('0x90'),'');_0x44d4b8[_0x306c('0x59')][_0x306c('0x59')]=_0x54c230['body']['Body'];_0x44d4b8[_0x306c('0x59')]['messageId']=_0x54c230[_0x306c('0x59')][_0x306c('0x91')];}if(_0x44d4b8['body']['id']){delete _0x44d4b8['body']['id'];}if(_[_0x306c('0x92')](_0x44d4b8[_0x306c('0x59')][_0x306c('0x8e')])){throw new db[(_0x306c('0x85'))][(_0x306c('0x86'))](_0x306c('0x93'));}if(_[_0x306c('0x92')](_0x44d4b8[_0x306c('0x59')][_0x306c('0x59')])||_0x44d4b8[_0x306c('0x59')][_0x306c('0x59')]===''){throw new db[(_0x306c('0x85'))][(_0x306c('0x86'))](_0x306c('0x94'));}if(_[_0x306c('0x92')](_0x44d4b8[_0x306c('0x59')][_0x306c('0x95')])){throw new db['Sequelize'][(_0x306c('0x86'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5646c0);}if(!_['includes'](_0x5646c0,_0x44d4b8[_0x306c('0x59')][_0x306c('0x95')])){throw new db['Sequelize'][(_0x306c('0x86'))](_0x306c('0x96')+_0x5646c0);}_0x3c0e36[_0x44d4b8['body']['mapKey']]=_0x44d4b8[_0x306c('0x59')][_0x306c('0x8e')];return db[_0x306c('0x97')][_0x306c('0x57')]({'where':{'id':_0x44d4b8[_0x306c('0x80')][_0x306c('0x8b')]},'include':[{'model':db['CmContact'],'as':_0x306c('0x98'),'where':_0x3c0e36,'limit':0x1,'order':[[_0x306c('0x89'),'DESC']]}]});})[_0x306c('0x1f')](handleEntityNotFound(_0x3322f3,null))['then'](function(_0x29f317){if(_0x29f317){_0x44d4b8[_0x306c('0x99')]=_[_0x306c('0x9a')](_0x29f317,[_0x306c('0x98')]);if(_0x29f317[_0x306c('0x98')][_0x306c('0x56')]){return _0x29f317[_0x306c('0x98')][0x0];}var _0x204a1e=_[_0x306c('0x9b')](_0x44d4b8[_0x306c('0x59')],{'firstName':_0x44d4b8['body']['from'],'ListId':_0x29f317['id']});_0x204a1e[_0x44d4b8[_0x306c('0x59')][_0x306c('0x95')]]=_0x44d4b8[_0x306c('0x59')][_0x306c('0x8e')];return db[_0x306c('0x84')][_0x306c('0x58')](_0x204a1e,{'fields':_0x2e01d9,'raw':!![]});}})[_0x306c('0x1f')](handleEntityNotFound(_0x3322f3,null))[_0x306c('0x1f')](function(_0x2bef80){if(_0x2bef80){_0x44d4b8[_0x306c('0x9c')]=_0x2bef80;var _0x56100c={'ContactId':_0x2bef80['id'],'phone':_0x44d4b8[_0x306c('0x59')][_0x306c('0x8e')],'WhatsappAccountId':_0x54c230[_0x306c('0x60')]['id']};var _0x58a460={'ContactId':_0x2bef80['id'],'WhatsappAccountId':_0x54c230[_0x306c('0x60')]['id'],'closed':![]};return db['WhatsappInteraction'][_0x306c('0x57')]({'where':_0x58a460})['then'](function(_0x553085){if(_0x553085){return[_0x553085,![]];}return db['WhatsappInteraction'][_0x306c('0x58')](_0x56100c)[_0x306c('0x1f')](function(_0x423f2e){return[_0x423f2e,!![]];});});}})['spread'](function(_0x44db7c,_0x173214){_0x44d4b8['interaction']=_0x44db7c[_0x306c('0x34')]({'plain':!![]});_0x44d4b8[_0x306c('0x9d')][_0x306c('0x9e')]=![];if(_0x173214){if(_0x44d4b8[_0x306c('0x80')]['autoclose']){_0x44d4b8['applications'][_0x306c('0x9f')]({'id':0x0,'priority':_0x44d4b8[_0x306c('0x81')][_0x306c('0x56')]+0x1,'app':'close','appdata':_0x306c('0xa0'),'interval':'*,*,*,*'});}_0x44d4b8[_0x306c('0x9d')]['created']=!![];}return db[_0x306c('0xa1')]['create']({'phone':_0x44d4b8[_0x306c('0x59')][_0x306c('0x8e')],'messageId':_0x44d4b8[_0x306c('0x59')][_0x306c('0xa2')],'body':_0x44d4b8[_0x306c('0x59')][_0x306c('0x59')],'WhatsappAccountId':_0x54c230[_0x306c('0x60')]['id'],'WhatsappInteractionId':_0x44db7c['id'],'direction':'in','ContactId':_0x44db7c[_0x306c('0xa3')],'AttachmentId':_0x44d4b8[_0x306c('0x59')][_0x306c('0xa4')]});})[_0x306c('0x1f')](function(_0x2e13a2){_0x44d4b8[_0x306c('0x28')]=_0x2e13a2;if(_0x44d4b8[_0x306c('0x9d')][_0x306c('0xa5')]){return db[_0x306c('0x74')]['find']({'attributes':['id',_0x306c('0x38')],'where':{'id':_0x44d4b8[_0x306c('0x9d')][_0x306c('0xa5')]}})['then'](function(_0x4422a2){if(_0x4422a2){_0x44d4b8[_0x306c('0x81')]['unshift']({'id':0x0,'priority':0x0,'app':_0x306c('0xa6'),'appdata':_0x4422a2['name']+','+(_0x44d4b8[_0x306c('0x80')][_0x306c('0xa7')]||0xa),'interval':_0x306c('0xa8')});}return respondWithRpcPromise(_0x306c('0xa9'),_0x306c('0xaa'),_0x44d4b8);});}return respondWithRpcPromise('Start',_0x306c('0xaa'),_0x44d4b8);})['then'](function(_0xdd2a92){if(_0xdd2a92){var _0x2818be=0xc8;var _0x34315b=_0x306c('0xab');logger[_0x306c('0x20')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x34315b,_0x2818be,_0x306c('0xac'));logger[_0x306c('0x22')](_0x306c('0xad'),_0x34315b,_0x2818be,_0x306c('0xac'),JSON[_0x306c('0x25')](_0xdd2a92));if(_0x44d4b8['account'][_0x306c('0x40')]===_0x306c('0x8d')){return _0x3322f3[_0x306c('0x2b')](_0x2818be)['set'](_0x306c('0xae'),'text/xml')[_0x306c('0x39')](_0x306c('0xaf'));}else{return _0x3322f3['status'](_0x2818be)[_0x306c('0xb0')](_0xdd2a92);}}})[_0x306c('0x2a')](handleError(_0x3322f3,null));};exports[_0x306c('0x39')]=function(_0x245845,_0x15791d,_0x3cdfe5){var _0x44958a,_0x314044,_0x4931ff;if(_[_0x306c('0x92')](_0x245845[_0x306c('0x59')][_0x306c('0x59')])||_0x245845[_0x306c('0x59')]['body']===''){throw new db[(_0x306c('0x85'))][(_0x306c('0x86'))](_0x306c('0x94'));}if(_[_0x306c('0x92')](_0x245845[_0x306c('0x59')]['to'])){throw new db['Sequelize']['ValidationError'](_0x306c('0xb1'));}_0x44958a=_0x245845[_0x306c('0x59')]['to'];return db[_0x306c('0x3e')][_0x306c('0x57')]({'where':{'id':_0x245845[_0x306c('0x60')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x306c('0x84')],'as':_0x306c('0x98'),'where':{'mobile':_0x44958a},'limit':0x1,'order':[[_0x306c('0x89'),'DESC']]}]}]})[_0x306c('0x1f')](handleEntityNotFound(_0x15791d,null))[_0x306c('0x1f')](function(_0x4911b9){if(_0x4911b9&&_0x4911b9['List']){_0x314044=_0x4911b9[_0x306c('0x34')]({'plain':!![]});if(_0x314044['List']&&_0x314044['List'][_0x306c('0x98')][_0x306c('0x56')]){return _0x314044[_0x306c('0xb2')]['Contacts'][0x0];}return db[_0x306c('0x84')][_0x306c('0x58')](_['defaults'](_0x245845[_0x306c('0x59')],{'firstName':_0x44958a,'mobile':_0x44958a,'phone':_0x44958a,'ListId':_0x314044[_0x306c('0x8b')]}));}})[_0x306c('0x1f')](handleEntityNotFound(_0x15791d,null))[_0x306c('0x1f')](function(_0x4133fd){if(_0x4133fd){_0x4931ff=_0x4133fd;return db[_0x306c('0xb3')][_0x306c('0x57')]({'where':{'ContactId':_0x4931ff['id'],'closed':![],'WhatsappAccountId':_0x314044['id']}})[_0x306c('0x1f')](function(_0xd9294a){if(_0xd9294a){return[_0xd9294a,![]];}return db['WhatsappInteraction'][_0x306c('0x58')]({'UserId':_0x245845['user']['id'],'ContactId':_0x4931ff['id'],'WhatsappAccountId':_0x314044['id'],'phone':_0x44958a,'firstMsgDirection':_0x306c('0xb4'),'Messages':[_['merge'](_0x245845['body'],{'read':![],'body':_0x245845['body'][_0x306c('0x59')],'phone':_0x44958a,'WhatsappAccountId':_0x314044['id'],'UserId':_0x245845[_0x306c('0x5a')]['id'],'ContactId':_0x4931ff['id']})]},{'include':[{'model':db[_0x306c('0xa1')],'as':_0x306c('0xb5')}]})[_0x306c('0x1f')](function(_0xa84b56){return[_0xa84b56,!![]];});});}})[_0x306c('0x6f')](function(_0x56e3fb,_0x4ff87e){if(_0x4ff87e){return _0x56e3fb;}return db['WhatsappMessage'][_0x306c('0x58')](_[_0x306c('0x4e')](_0x245845[_0x306c('0x59')],{'read':![],'body':_0x245845[_0x306c('0x59')][_0x306c('0x59')],'phone':_0x44958a,'WhatsappAccountId':_0x314044['id'],'WhatsappInteractionId':_0x56e3fb['id'],'UserId':_0x245845[_0x306c('0x5a')]['id'],'ContactId':_0x4931ff['id']}))[_0x306c('0x1f')](function(_0x35c981){_0x56e3fb['dataValues'][_0x306c('0xb5')]=[];_0x56e3fb[_0x306c('0xb6')][_0x306c('0xb5')][_0x306c('0x9f')](_0x35c981[_0x306c('0xb6')]);return _0x56e3fb;});})[_0x306c('0x1f')](respondWithResult(_0x15791d,null))[_0x306c('0x2a')](handleError(_0x15791d,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 24e3c8f..8685e4d 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 _0x16d1=['hook','exports','WhatsappAccount','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x16d1,0xba));var _0x116d=function(_0x2d6b81,_0x57cbd8){_0x2d6b81=_0x2d6b81-0x0;var _0x2c59f6=_0x16d1[_0x2d6b81];return _0x2c59f6;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require('../../mysqldb')['db'][_0x116d('0x0')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x116d('0x1')](0x0);var events={'afterCreate':_0x116d('0x2'),'afterUpdate':'update','afterDestroy':_0x116d('0x3')};function emitEvent(_0x9f2214){return function(_0x34aba1,_0x5cf839,_0x10b62c){WhatsappAccountEvents['emit'](_0x9f2214+':'+_0x34aba1['id'],_0x34aba1);WhatsappAccountEvents[_0x116d('0x4')](_0x9f2214,_0x34aba1);_0x10b62c(null);};}for(var e in events){if(events[_0x116d('0x5')](e)){var event=events[e];WhatsappAccount[_0x116d('0x6')](e,emitEvent(event));}}module[_0x116d('0x7')]=WhatsappAccountEvents; \ No newline at end of file +var _0x58e0=['remove','emit','hasOwnProperty','exports','WhatsappAccount','setMaxListeners'];(function(_0xbf2c69,_0x4275a9){var _0x519b42=function(_0x2978ac){while(--_0x2978ac){_0xbf2c69['push'](_0xbf2c69['shift']());}};_0x519b42(++_0x4275a9);}(_0x58e0,0x142));var _0x058e=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x58e0[_0x4e676e];return _0x336a3c;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require('../../mysqldb')['db'][_0x058e('0x0')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x058e('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x058e('0x2')};function emitEvent(_0x32c7ac){return function(_0x501f87,_0x751884,_0x1454c9){WhatsappAccountEvents[_0x058e('0x3')](_0x32c7ac+':'+_0x501f87['id'],_0x501f87);WhatsappAccountEvents['emit'](_0x32c7ac,_0x501f87);_0x1454c9(null);};}for(var e in events){if(events[_0x058e('0x4')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0x058e('0x5')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index a5a1a0d..5356b3a 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 _0x9c94=['define','whatsapp_accounts','util','api','moment','request-promise','rimraf','../../config/environment','./whatsappAccount.attributes'];(function(_0xc5775d,_0x3701ab){var _0x3b4edd=function(_0x37c3cb){while(--_0x37c3cb){_0xc5775d['push'](_0xc5775d['shift']());}};_0x3b4edd(++_0x3701ab);}(_0x9c94,0x107));var _0x49c9=function(_0x119280,_0x439c3e){_0x119280=_0x119280-0x0;var _0x481797=_0x9c94[_0x119280];return _0x481797;};'use strict';var _=require('lodash');var util=require(_0x49c9('0x0'));var logger=require('../../config/logger')(_0x49c9('0x1'));var moment=require(_0x49c9('0x2'));var BPromise=require('bluebird');var rp=require(_0x49c9('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x49c9('0x4'));var config=require(_0x49c9('0x5'));var attributes=require(_0x49c9('0x6'));module['exports']=function(_0x515732,_0x9b0e7){return _0x515732[_0x49c9('0x7')]('WhatsappAccount',attributes,{'tableName':_0x49c9('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x72a0=['request-promise','path','../../config/environment','exports','define','whatsapp_accounts','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x34f32c,_0x39fe66){var _0x54de91=function(_0xeee1e7){while(--_0xeee1e7){_0x34f32c['push'](_0x34f32c['shift']());}};_0x54de91(++_0x39fe66);}(_0x72a0,0x10e));var _0x072a=function(_0x4455f8,_0x16cb74){_0x4455f8=_0x4455f8-0x0;var _0x5b64ce=_0x72a0[_0x4455f8];return _0x5b64ce;};'use strict';var _=require(_0x072a('0x0'));var util=require(_0x072a('0x1'));var logger=require(_0x072a('0x2'))(_0x072a('0x3'));var moment=require(_0x072a('0x4'));var BPromise=require(_0x072a('0x5'));var rp=require(_0x072a('0x6'));var fs=require('fs');var path=require(_0x072a('0x7'));var rimraf=require('rimraf');var config=require(_0x072a('0x8'));var attributes=require('./whatsappAccount.attributes');module[_0x072a('0x9')]=function(_0xa902b9,_0x5e3b97){return _0xa902b9[_0x072a('0xa')]('WhatsappAccount',attributes,{'tableName':_0x072a('0xb'),'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 12f61f0..5c42b1e 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 _0x3ef7=['code','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','attributes','include','map','model','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./whatsappAccount.socket','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x12a4d9,_0x4696c2){var _0x305516=function(_0x59196f){while(--_0x59196f){_0x12a4d9['push'](_0x12a4d9['shift']());}};_0x305516(++_0x4696c2);}(_0x3ef7,0xa2));var _0x73ef=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3ef7[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x73ef('0x0'));var util=require('util');var moment=require(_0x73ef('0x1'));var BPromise=require(_0x73ef('0x2'));var rs=require(_0x73ef('0x3'));var fs=require('fs');var Redis=require(_0x73ef('0x4'));var db=require(_0x73ef('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x73ef('0x6'))(_0x73ef('0x7'));var config=require(_0x73ef('0x8'));var jayson=require(_0x73ef('0x9'));var client=jayson['client'][_0x73ef('0xa')]({'port':0x232a});config[_0x73ef('0xb')]=_[_0x73ef('0xc')](config[_0x73ef('0xb')],{'host':_0x73ef('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x73ef('0xb')]));require(_0x73ef('0xe'))['register'](socket);function respondWithRpcPromise(_0x1055e1,_0x21bfed,_0x364470){return new BPromise(function(_0x3bd4c9,_0x33aa09){return client['request'](_0x1055e1,_0x364470)[_0x73ef('0xf')](function(_0x111ce3){logger[_0x73ef('0x10')](_0x73ef('0x11'),_0x21bfed,_0x73ef('0x12'));logger[_0x73ef('0x13')](_0x73ef('0x14'),_0x21bfed,_0x73ef('0x12'),JSON[_0x73ef('0x15')](_0x111ce3));if(_0x111ce3[_0x73ef('0x16')]){if(_0x111ce3[_0x73ef('0x16')][_0x73ef('0x17')]===0x1f4){logger[_0x73ef('0x16')]('WhatsappAccount,\x20%s,\x20%s',_0x21bfed,_0x111ce3[_0x73ef('0x16')]['message']);return _0x33aa09(_0x111ce3[_0x73ef('0x16')][_0x73ef('0x18')]);}logger[_0x73ef('0x16')]('WhatsappAccount,\x20%s,\x20%s',_0x21bfed,_0x111ce3[_0x73ef('0x16')][_0x73ef('0x18')]);return _0x3bd4c9(_0x111ce3['error'][_0x73ef('0x18')]);}else{logger[_0x73ef('0x10')](_0x73ef('0x11'),_0x21bfed,_0x73ef('0x12'));_0x3bd4c9(_0x111ce3[_0x73ef('0x19')]['message']);}})[_0x73ef('0x1a')](function(_0x4dc000){logger[_0x73ef('0x16')]('WhatsappAccount,\x20%s,\x20%s',_0x21bfed,_0x4dc000);_0x33aa09(_0x4dc000);});});}exports[_0x73ef('0x1b')]=function(_0x2168ec){var _0x36d02f=this;return new Promise(function(_0x2c4d28,_0x35d733){return db[_0x73ef('0x1c')][_0x73ef('0x1d')]({'raw':_0x2168ec[_0x73ef('0x1e')]?_0x2168ec['options'][_0x73ef('0x1f')]===undefined?!![]:![]:!![],'where':_0x2168ec[_0x73ef('0x1e')]?_0x2168ec[_0x73ef('0x1e')][_0x73ef('0x20')]||null:null,'attributes':_0x2168ec['options']?_0x2168ec[_0x73ef('0x1e')][_0x73ef('0x21')]||null:null,'include':_0x2168ec[_0x73ef('0x1e')]?_0x2168ec[_0x73ef('0x1e')][_0x73ef('0x22')]?_[_0x73ef('0x23')](_0x2168ec[_0x73ef('0x1e')][_0x73ef('0x22')],function(_0x173e2d){return{'model':db[_0x173e2d[_0x73ef('0x24')]],'as':_0x173e2d['as'],'attributes':_0x173e2d['attributes'],'include':_0x173e2d[_0x73ef('0x22')]?_[_0x73ef('0x23')](_0x173e2d['include'],function(_0x5ad215){return{'model':db[_0x5ad215[_0x73ef('0x24')]],'as':_0x5ad215['as'],'attributes':_0x5ad215['attributes'],'include':_0x5ad215['include']?_[_0x73ef('0x23')](_0x5ad215[_0x73ef('0x22')],function(_0x2153e3){return{'model':db[_0x2153e3[_0x73ef('0x24')]],'as':_0x2153e3['as'],'attributes':_0x2153e3['attributes']};}):[]};}):[]};}):[]:[]})[_0x73ef('0xf')](function(_0x4fa6e2){logger[_0x73ef('0x10')]('ShowWhatsappAccount',_0x2168ec);logger[_0x73ef('0x13')](_0x73ef('0x1b'),_0x2168ec,JSON[_0x73ef('0x15')](_0x4fa6e2));_0x2c4d28(_0x4fa6e2);})[_0x73ef('0x1a')](function(_0x19c821){logger[_0x73ef('0x16')](_0x73ef('0x1b'),_0x19c821['message'],_0x2168ec);_0x35d733(_0x36d02f[_0x73ef('0x16')](0x1f4,_0x19c821[_0x73ef('0x18')]));});});}; \ No newline at end of file +var _0xaa61=['request\x20sent','debug','stringify','error','code','message','result','catch','WhatsappAccount','find','options','where','attributes','map','include','ShowWhatsappAccount','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./whatsappAccount.socket','request','then','info','WhatsappAccount,\x20%s,\x20%s'];(function(_0x266b0c,_0x4fb269){var _0xd1bfa7=function(_0x36c2d2){while(--_0x36c2d2){_0x266b0c['push'](_0x266b0c['shift']());}};_0xd1bfa7(++_0x4fb269);}(_0xaa61,0x1cc));var _0x1aa6=function(_0x117b15,_0x83a5ff){_0x117b15=_0x117b15-0x0;var _0x2b8ba9=_0xaa61[_0x117b15];return _0x2b8ba9;};'use strict';var _=require(_0x1aa6('0x0'));var util=require(_0x1aa6('0x1'));var moment=require(_0x1aa6('0x2'));var BPromise=require(_0x1aa6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1aa6('0x4'));var db=require(_0x1aa6('0x5'))['db'];var utils=require(_0x1aa6('0x6'));var logger=require(_0x1aa6('0x7'))(_0x1aa6('0x8'));var config=require(_0x1aa6('0x9'));var jayson=require(_0x1aa6('0xa'));var client=jayson[_0x1aa6('0xb')][_0x1aa6('0xc')]({'port':0x232a});config[_0x1aa6('0xd')]=_[_0x1aa6('0xe')](config[_0x1aa6('0xd')],{'host':_0x1aa6('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1aa6('0xd')]));require(_0x1aa6('0x10'))['register'](socket);function respondWithRpcPromise(_0x482d87,_0xc76131,_0x460c8c){return new BPromise(function(_0x1c2169,_0x320ccd){return client[_0x1aa6('0x11')](_0x482d87,_0x460c8c)[_0x1aa6('0x12')](function(_0x290abd){logger[_0x1aa6('0x13')](_0x1aa6('0x14'),_0xc76131,_0x1aa6('0x15'));logger[_0x1aa6('0x16')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0xc76131,_0x1aa6('0x15'),JSON[_0x1aa6('0x17')](_0x290abd));if(_0x290abd[_0x1aa6('0x18')]){if(_0x290abd[_0x1aa6('0x18')][_0x1aa6('0x19')]===0x1f4){logger[_0x1aa6('0x18')]('WhatsappAccount,\x20%s,\x20%s',_0xc76131,_0x290abd[_0x1aa6('0x18')][_0x1aa6('0x1a')]);return _0x320ccd(_0x290abd['error'][_0x1aa6('0x1a')]);}logger[_0x1aa6('0x18')](_0x1aa6('0x14'),_0xc76131,_0x290abd[_0x1aa6('0x18')][_0x1aa6('0x1a')]);return _0x1c2169(_0x290abd[_0x1aa6('0x18')][_0x1aa6('0x1a')]);}else{logger['info'](_0x1aa6('0x14'),_0xc76131,'request\x20sent');_0x1c2169(_0x290abd[_0x1aa6('0x1b')]['message']);}})[_0x1aa6('0x1c')](function(_0x4f4502){logger[_0x1aa6('0x18')](_0x1aa6('0x14'),_0xc76131,_0x4f4502);_0x320ccd(_0x4f4502);});});}exports['ShowWhatsappAccount']=function(_0x7bab3e){var _0x4bd1a8=this;return new Promise(function(_0x5ac4ae,_0x1effc3){return db[_0x1aa6('0x1d')][_0x1aa6('0x1e')]({'raw':_0x7bab3e[_0x1aa6('0x1f')]?_0x7bab3e['options']['raw']===undefined?!![]:![]:!![],'where':_0x7bab3e[_0x1aa6('0x1f')]?_0x7bab3e['options'][_0x1aa6('0x20')]||null:null,'attributes':_0x7bab3e[_0x1aa6('0x1f')]?_0x7bab3e[_0x1aa6('0x1f')][_0x1aa6('0x21')]||null:null,'include':_0x7bab3e['options']?_0x7bab3e[_0x1aa6('0x1f')]['include']?_[_0x1aa6('0x22')](_0x7bab3e[_0x1aa6('0x1f')][_0x1aa6('0x23')],function(_0x1375f1){return{'model':db[_0x1375f1['model']],'as':_0x1375f1['as'],'attributes':_0x1375f1[_0x1aa6('0x21')],'include':_0x1375f1['include']?_[_0x1aa6('0x22')](_0x1375f1['include'],function(_0x4c3594){return{'model':db[_0x4c3594['model']],'as':_0x4c3594['as'],'attributes':_0x4c3594[_0x1aa6('0x21')],'include':_0x4c3594['include']?_[_0x1aa6('0x22')](_0x4c3594['include'],function(_0x5caab2){return{'model':db[_0x5caab2['model']],'as':_0x5caab2['as'],'attributes':_0x5caab2[_0x1aa6('0x21')]};}):[]};}):[]};}):[]:[]})[_0x1aa6('0x12')](function(_0x3d2ef4){logger[_0x1aa6('0x13')](_0x1aa6('0x24'),_0x7bab3e);logger['debug'](_0x1aa6('0x24'),_0x7bab3e,JSON[_0x1aa6('0x17')](_0x3d2ef4));_0x5ac4ae(_0x3d2ef4);})[_0x1aa6('0x1c')](function(_0x3b84b5){logger['error'](_0x1aa6('0x24'),_0x3b84b5['message'],_0x7bab3e);_0x1effc3(_0x4bd1a8[_0x1aa6('0x18')](0x1f4,_0x3b84b5['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 522bb28..f394b21 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 _0xb447=['remove','emit','removeListener','register','length','whatsappAccount:','save'];(function(_0x2746b0,_0x3dacf0){var _0x35a4af=function(_0x309580){while(--_0x309580){_0x2746b0['push'](_0x2746b0['shift']());}};_0x35a4af(++_0x3dacf0);}(_0xb447,0x156));var _0x7b44=function(_0xece9e3,_0x1e3745){_0xece9e3=_0xece9e3-0x0;var _0x23444d=_0xb447[_0xece9e3];return _0x23444d;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0x7b44('0x0'),_0x7b44('0x1'),'update'];function createListener(_0x25e286,_0x3245e4){return function(_0xe571c2){_0x3245e4[_0x7b44('0x2')](_0x25e286,_0xe571c2);};}function removeListener(_0x738518,_0x16668f){return function(){WhatsappAccountEvents[_0x7b44('0x3')](_0x738518,_0x16668f);};}exports[_0x7b44('0x4')]=function(_0x51c7bb){for(var _0x36a385=0x0,_0x177928=events[_0x7b44('0x5')];_0x36a385<_0x177928;_0x36a385++){var _0x2ef54a=events[_0x36a385];var _0x15e08a=createListener(_0x7b44('0x6')+_0x2ef54a,_0x51c7bb);WhatsappAccountEvents['on'](_0x2ef54a,_0x15e08a);}}; \ No newline at end of file +var _0x8f05=['whatsappAccount:','./whatsappAccount.events','save','remove','update','emit','register'];(function(_0x35485a,_0x91cdd4){var _0x5148e6=function(_0x27ed1d){while(--_0x27ed1d){_0x35485a['push'](_0x35485a['shift']());}};_0x5148e6(++_0x91cdd4);}(_0x8f05,0x135));var _0x58f0=function(_0x261a7a,_0x41243f){_0x261a7a=_0x261a7a-0x0;var _0x21afdb=_0x8f05[_0x261a7a];return _0x21afdb;};'use strict';var WhatsappAccountEvents=require(_0x58f0('0x0'));var events=[_0x58f0('0x1'),_0x58f0('0x2'),_0x58f0('0x3')];function createListener(_0x26bf94,_0x16cd53){return function(_0x36357f){_0x16cd53[_0x58f0('0x4')](_0x26bf94,_0x36357f);};}function removeListener(_0xfa08bc,_0x3ac598){return function(){WhatsappAccountEvents['removeListener'](_0xfa08bc,_0x3ac598);};}exports[_0x58f0('0x5')]=function(_0x2478ef){for(var _0x1c33d9=0x0,_0x3dafcb=events['length'];_0x1c33d9<_0x3dafcb;_0x1c33d9++){var _0x1f7155=events[_0x1c33d9];var _0x5ef553=createListener(_0x58f0('0x6')+_0x1f7155,_0x2478ef);WhatsappAccountEvents['on'](_0x1f7155,_0x5ef553);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 3f14fc4..22d8ce3 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 _0x78bb=['isAuthenticated','show','post','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x78bb,0x172));var _0xb78b=function(_0x1e4f2d,_0x22e2bb){_0x1e4f2d=_0x1e4f2d-0x0;var _0xd05ce5=_0x78bb[_0x1e4f2d];return _0xd05ce5;};'use strict';var multer=require(_0xb78b('0x0'));var util=require(_0xb78b('0x1'));var path=require(_0xb78b('0x2'));var timeout=require(_0xb78b('0x3'));var express=require('express');var router=express[_0xb78b('0x4')]();var fs_extra=require(_0xb78b('0x5'));var auth=require(_0xb78b('0x6'));var interaction=require(_0xb78b('0x7'));var config=require(_0xb78b('0x8'));var controller=require('./whatsappApplication.controller');router[_0xb78b('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb78b('0x9')]('/:id',auth[_0xb78b('0xa')](),controller[_0xb78b('0xb')]);router[_0xb78b('0xc')]('/',auth[_0xb78b('0xa')](),controller[_0xb78b('0xd')]);router[_0xb78b('0xe')](_0xb78b('0xf'),auth[_0xb78b('0xa')](),controller[_0xb78b('0x10')]);router['delete']('/:id',auth[_0xb78b('0xa')](),controller[_0xb78b('0x11')]);module[_0xb78b('0x12')]=router; \ No newline at end of file +var _0xdb1d=['Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','put','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0xc0a831,_0x37a703){var _0x1a52da=function(_0x86f20e){while(--_0x86f20e){_0xc0a831['push'](_0xc0a831['shift']());}};_0x1a52da(++_0x37a703);}(_0xdb1d,0x19b));var _0xddb1=function(_0x13ee11,_0x129ca5){_0x13ee11=_0x13ee11-0x0;var _0xfe3915=_0xdb1d[_0x13ee11];return _0xfe3915;};'use strict';var multer=require(_0xddb1('0x0'));var util=require(_0xddb1('0x1'));var path=require(_0xddb1('0x2'));var timeout=require(_0xddb1('0x3'));var express=require(_0xddb1('0x4'));var router=express[_0xddb1('0x5')]();var fs_extra=require(_0xddb1('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xddb1('0x7'));var config=require(_0xddb1('0x8'));var controller=require('./whatsappApplication.controller');router[_0xddb1('0x9')]('/',auth[_0xddb1('0xa')](),controller[_0xddb1('0xb')]);router[_0xddb1('0x9')](_0xddb1('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xddb1('0xa')](),controller['create']);router[_0xddb1('0xd')](_0xddb1('0xc'),auth[_0xddb1('0xa')](),controller['update']);router['delete'](_0xddb1('0xc'),auth[_0xddb1('0xa')](),controller[_0xddb1('0xe')]);module[_0xddb1('0xf')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 6453b87..ac462a8 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 _0x84e5=['noop','TEXT','*,*,*,*','exports','STRING'];(function(_0x5d0001,_0x14edeb){var _0x56d984=function(_0x165a79){while(--_0x165a79){_0x5d0001['push'](_0x5d0001['shift']());}};_0x56d984(++_0x14edeb);}(_0x84e5,0x111));var _0x584e=function(_0x265aa2,_0x220072){_0x265aa2=_0x265aa2-0x0;var _0x447a3a=_0x84e5[_0x265aa2];return _0x447a3a;};'use strict';var Sequelize=require('sequelize');module[_0x584e('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x584e('0x1')],'allowNull':![],'defaultValue':_0x584e('0x2')},'appdata':{'type':Sequelize[_0x584e('0x3')]()},'description':{'type':Sequelize[_0x584e('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x584e('0x4')}}; \ No newline at end of file +var _0x1fab=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x2b9e8a,_0x7b21d4){var _0x520e67=function(_0x22bce8){while(--_0x22bce8){_0x2b9e8a['push'](_0x2b9e8a['shift']());}};_0x520e67(++_0x7b21d4);}(_0x1fab,0xa4));var _0xb1fa=function(_0x10545e,_0x130108){_0x10545e=_0x10545e-0x0;var _0x546f7c=_0x1fab[_0x10545e];return _0x546f7c;};'use strict';var Sequelize=require(_0xb1fa('0x0'));module[_0xb1fa('0x1')]={'priority':{'type':Sequelize[_0xb1fa('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xb1fa('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xb1fa('0x4')]()},'description':{'type':Sequelize[_0xb1fa('0x3')]},'interval':{'type':Sequelize[_0xb1fa('0x3')],'defaultValue':_0xb1fa('0x5')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index dd6952d..3ce01b1 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 _0x9b0d=['filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','WhatsappApplication','includeAll','findAll','rows','show','params','include','catch','create','body','update','find','destroy','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','rawAttributes','type','key','query','keys'];(function(_0x42ca10,_0x737816){var _0x3544aa=function(_0x107197){while(--_0x107197){_0x42ca10['push'](_0x42ca10['shift']());}};_0x3544aa(++_0x737816);}(_0x9b0d,0xb7));var _0xd9b0=function(_0x2e0785,_0x5c6f4d){_0x2e0785=_0x2e0785-0x0;var _0x55459b=_0x9b0d[_0x2e0785];return _0x55459b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd9b0('0x0'));var zipdir=require(_0xd9b0('0x1'));var jsonpatch=require(_0xd9b0('0x2'));var rp=require(_0xd9b0('0x3'));var moment=require('moment');var BPromise=require(_0xd9b0('0x4'));var Mustache=require(_0xd9b0('0x5'));var util=require(_0xd9b0('0x6'));var path=require(_0xd9b0('0x7'));var sox=require('sox');var csv=require(_0xd9b0('0x8'));var ejs=require(_0xd9b0('0x9'));var fs=require('fs');var fs_extra=require(_0xd9b0('0xa'));var _=require(_0xd9b0('0xb'));var squel=require(_0xd9b0('0xc'));var crypto=require(_0xd9b0('0xd'));var jsforce=require(_0xd9b0('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd9b0('0x8'));var querystring=require(_0xd9b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xd9b0('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd9b0('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd9b0('0x12'));var logger=require(_0xd9b0('0x13'))(_0xd9b0('0x14'));var utils=require(_0xd9b0('0x15'));var config=require(_0xd9b0('0x16'));var licenseUtil=require(_0xd9b0('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29e9e0,_0x76bb6e){_0x76bb6e=_0x76bb6e||0xcc;return function(_0x4e0210){if(_0x4e0210){return _0x29e9e0[_0xd9b0('0x18')](_0x76bb6e);}return _0x29e9e0[_0xd9b0('0x19')](_0x76bb6e)[_0xd9b0('0x1a')]();};}function respondWithResult(_0x46321d,_0x2a15b1){_0x2a15b1=_0x2a15b1||0xc8;return function(_0x13a800){if(_0x13a800){return _0x46321d['status'](_0x2a15b1)[_0xd9b0('0x1b')](_0x13a800);}};}function respondWithFilteredResult(_0x579aa7,_0x2908a1){return function(_0x288dd4){if(_0x288dd4){var _0x141fea=typeof _0x2908a1[_0xd9b0('0x1c')]===_0xd9b0('0x1d')&&typeof _0x2908a1[_0xd9b0('0x1e')]===_0xd9b0('0x1d');var _0x584d2d=_0x288dd4[_0xd9b0('0x1f')];var _0x3ffdc8=_0x141fea?0x0:_0x2908a1[_0xd9b0('0x1c')];var _0x1b9b8f=_0x141fea?_0x288dd4[_0xd9b0('0x1f')]:_0x2908a1[_0xd9b0('0x1c')]+_0x2908a1[_0xd9b0('0x1e')];var _0x485cdf;if(_0x1b9b8f>=_0x584d2d){_0x1b9b8f=_0x584d2d;_0x485cdf=0xc8;}else{_0x485cdf=0xce;}_0x579aa7[_0xd9b0('0x19')](_0x485cdf);return _0x579aa7['set'](_0xd9b0('0x20'),_0x3ffdc8+'-'+_0x1b9b8f+'/'+_0x584d2d)['json'](_0x288dd4);}return null;};}function patchUpdates(_0x225823){return function(_0x77c318){try{jsonpatch[_0xd9b0('0x21')](_0x77c318,_0x225823,!![]);}catch(_0x3df41b){return BPromise[_0xd9b0('0x22')](_0x3df41b);}return _0x77c318[_0xd9b0('0x23')]();};}function saveUpdates(_0x549cfe,_0x5ecfe7){return function(_0x132710){if(_0x132710){return _0x132710['update'](_0x549cfe)[_0xd9b0('0x24')](function(_0x283da7){return _0x283da7;});}return null;};}function removeEntity(_0x11c443,_0x5a1f95){return function(_0x222229){if(_0x222229){return _0x222229['destroy']()['then'](function(){_0x11c443[_0xd9b0('0x19')](0xcc)[_0xd9b0('0x1a')]();});}};}function handleEntityNotFound(_0x5569c3,_0x3d90f0){return function(_0x4b9935){if(!_0x4b9935){_0x5569c3[_0xd9b0('0x18')](0x194);}return _0x4b9935;};}function handleError(_0xf06e12,_0x1c7ece){_0x1c7ece=_0x1c7ece||0x1f4;return function(_0xe07b77){logger[_0xd9b0('0x25')](_0xe07b77[_0xd9b0('0x26')]);if(_0xe07b77[_0xd9b0('0x27')]){delete _0xe07b77[_0xd9b0('0x27')];}_0xf06e12[_0xd9b0('0x19')](_0x1c7ece)[_0xd9b0('0x28')](_0xe07b77);};}exports[_0xd9b0('0x29')]=function(_0x233aae,_0x160c43){var _0x8be573={},_0x16cd85={},_0x23b2d8={'count':0x0,'rows':[]};var _0x4f5cdc=_[_0xd9b0('0x2a')](db['WhatsappApplication'][_0xd9b0('0x2b')],function(_0x1f8bc8){return{'name':_0x1f8bc8['fieldName'],'type':_0x1f8bc8[_0xd9b0('0x2c')][_0xd9b0('0x2d')]};});_0x16cd85['model']=_[_0xd9b0('0x2a')](_0x4f5cdc,_0xd9b0('0x27'));_0x16cd85[_0xd9b0('0x2e')]=_[_0xd9b0('0x2f')](_0x233aae[_0xd9b0('0x2e')]);_0x16cd85[_0xd9b0('0x30')]=_[_0xd9b0('0x31')](_0x16cd85[_0xd9b0('0x32')],_0x16cd85['query']);_0x8be573[_0xd9b0('0x33')]=_[_0xd9b0('0x31')](_0x16cd85[_0xd9b0('0x32')],qs[_0xd9b0('0x34')](_0x233aae['query']['fields']));_0x8be573[_0xd9b0('0x33')]=_0x8be573['attributes'][_0xd9b0('0x35')]?_0x8be573[_0xd9b0('0x33')]:_0x16cd85['model'];if(!_0x233aae['query'][_0xd9b0('0x36')](_0xd9b0('0x37'))){_0x8be573[_0xd9b0('0x1e')]=qs[_0xd9b0('0x1e')](_0x233aae[_0xd9b0('0x2e')][_0xd9b0('0x1e')]);_0x8be573[_0xd9b0('0x1c')]=qs[_0xd9b0('0x1c')](_0x233aae['query'][_0xd9b0('0x1c')]);}_0x8be573[_0xd9b0('0x38')]=qs[_0xd9b0('0x39')](_0x233aae[_0xd9b0('0x2e')][_0xd9b0('0x39')]);_0x8be573[_0xd9b0('0x3a')]=qs[_0xd9b0('0x30')](_[_0xd9b0('0x3b')](_0x233aae[_0xd9b0('0x2e')],_0x16cd85[_0xd9b0('0x30')]),_0x4f5cdc);if(_0x233aae[_0xd9b0('0x2e')][_0xd9b0('0x3c')]){_0x8be573[_0xd9b0('0x3a')]=_[_0xd9b0('0x3d')](_0x8be573[_0xd9b0('0x3a')],{'$or':_[_0xd9b0('0x2a')](_0x4f5cdc,function(_0x1d04de){if(_0x1d04de[_0xd9b0('0x2c')]!==_0xd9b0('0x3e')){var _0x18dc45={};_0x18dc45[_0x1d04de['name']]={'$like':'%'+_0x233aae['query'][_0xd9b0('0x3c')]+'%'};return _0x18dc45;}})});}_0x8be573=_['merge']({},_0x8be573,_0x233aae[_0xd9b0('0x3f')]);var _0x353fd7={'where':_0x8be573[_0xd9b0('0x3a')]};return db[_0xd9b0('0x40')][_0xd9b0('0x1f')](_0x353fd7)[_0xd9b0('0x24')](function(_0x359b3e){_0x23b2d8[_0xd9b0('0x1f')]=_0x359b3e;if(_0x233aae[_0xd9b0('0x2e')][_0xd9b0('0x41')]){_0x8be573['include']=[{'all':!![]}];}return db[_0xd9b0('0x40')][_0xd9b0('0x42')](_0x8be573);})['then'](function(_0x1f5333){_0x23b2d8[_0xd9b0('0x43')]=_0x1f5333;return _0x23b2d8;})[_0xd9b0('0x24')](respondWithFilteredResult(_0x160c43,_0x8be573))['catch'](handleError(_0x160c43,null));};exports[_0xd9b0('0x44')]=function(_0x225800,_0x418113){var _0x3a09aa={'raw':!![],'where':{'id':_0x225800[_0xd9b0('0x45')]['id']}},_0x285ca9={};_0x285ca9[_0xd9b0('0x32')]=_[_0xd9b0('0x2f')](db[_0xd9b0('0x40')][_0xd9b0('0x2b')]);_0x285ca9[_0xd9b0('0x2e')]=_[_0xd9b0('0x2f')](_0x225800[_0xd9b0('0x2e')]);_0x285ca9[_0xd9b0('0x30')]=_[_0xd9b0('0x31')](_0x285ca9[_0xd9b0('0x32')],_0x285ca9[_0xd9b0('0x2e')]);_0x3a09aa[_0xd9b0('0x33')]=_['intersection'](_0x285ca9[_0xd9b0('0x32')],qs[_0xd9b0('0x34')](_0x225800['query'][_0xd9b0('0x34')]));_0x3a09aa[_0xd9b0('0x33')]=_0x3a09aa[_0xd9b0('0x33')]['length']?_0x3a09aa['attributes']:_0x285ca9[_0xd9b0('0x32')];if(_0x225800[_0xd9b0('0x2e')][_0xd9b0('0x41')]){_0x3a09aa[_0xd9b0('0x46')]=[{'all':!![]}];}_0x3a09aa=_[_0xd9b0('0x3d')]({},_0x3a09aa,_0x225800[_0xd9b0('0x3f')]);return db[_0xd9b0('0x40')]['find'](_0x3a09aa)[_0xd9b0('0x24')](handleEntityNotFound(_0x418113,null))['then'](respondWithResult(_0x418113,null))[_0xd9b0('0x47')](handleError(_0x418113,null));};exports[_0xd9b0('0x48')]=function(_0xd11f53,_0x32857f){return db[_0xd9b0('0x40')][_0xd9b0('0x48')](_0xd11f53[_0xd9b0('0x49')],{})[_0xd9b0('0x24')](respondWithResult(_0x32857f,0xc9))['catch'](handleError(_0x32857f,null));};exports[_0xd9b0('0x4a')]=function(_0x982ccd,_0x2618a0){if(_0x982ccd[_0xd9b0('0x49')]['id']){delete _0x982ccd[_0xd9b0('0x49')]['id'];}return db[_0xd9b0('0x40')][_0xd9b0('0x4b')]({'where':{'id':_0x982ccd[_0xd9b0('0x45')]['id']}})[_0xd9b0('0x24')](handleEntityNotFound(_0x2618a0,null))[_0xd9b0('0x24')](saveUpdates(_0x982ccd[_0xd9b0('0x49')],null))[_0xd9b0('0x24')](respondWithResult(_0x2618a0,null))[_0xd9b0('0x47')](handleError(_0x2618a0,null));};exports[_0xd9b0('0x4c')]=function(_0x39ca70,_0x795b17){return db['WhatsappApplication'][_0xd9b0('0x4b')]({'where':{'id':_0x39ca70[_0xd9b0('0x45')]['id']}})[_0xd9b0('0x24')](handleEntityNotFound(_0x795b17,null))[_0xd9b0('0x24')](removeEntity(_0x795b17,null))[_0xd9b0('0x47')](handleError(_0x795b17,null));}; \ No newline at end of file +var _0x75dc=['query','filters','intersection','model','attributes','fields','length','nolimit','limit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','map','WhatsappApplication','fieldName','type','keys'];(function(_0x28611e,_0x586726){var _0x530f69=function(_0x407906){while(--_0x407906){_0x28611e['push'](_0x28611e['shift']());}};_0x530f69(++_0x586726);}(_0x75dc,0x1d7));var _0xc75d=function(_0x8d8f23,_0x8c1961){_0x8d8f23=_0x8d8f23-0x0;var _0x22bf54=_0x75dc[_0x8d8f23];return _0x22bf54;};'use strict';var emlformat=require(_0xc75d('0x0'));var rimraf=require(_0xc75d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc75d('0x2'));var BPromise=require(_0xc75d('0x3'));var Mustache=require(_0xc75d('0x4'));var util=require(_0xc75d('0x5'));var path=require(_0xc75d('0x6'));var sox=require(_0xc75d('0x7'));var csv=require('to-csv');var ejs=require(_0xc75d('0x8'));var fs=require('fs');var fs_extra=require(_0xc75d('0x9'));var _=require(_0xc75d('0xa'));var squel=require('squel');var crypto=require(_0xc75d('0xb'));var jsforce=require(_0xc75d('0xc'));var deskjs=require(_0xc75d('0xd'));var toCsv=require(_0xc75d('0xe'));var querystring=require('querystring');var Papa=require(_0xc75d('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc75d('0x10'));var as=require(_0xc75d('0x11'));var hardwareService=require(_0xc75d('0x12'));var logger=require(_0xc75d('0x13'))('api');var utils=require(_0xc75d('0x14'));var config=require(_0xc75d('0x15'));var licenseUtil=require(_0xc75d('0x16'));var db=require(_0xc75d('0x17'))['db'];function respondWithStatusCode(_0x1a7984,_0x2521fd){_0x2521fd=_0x2521fd||0xcc;return function(_0xd5e22b){if(_0xd5e22b){return _0x1a7984['sendStatus'](_0x2521fd);}return _0x1a7984[_0xc75d('0x18')](_0x2521fd)[_0xc75d('0x19')]();};}function respondWithResult(_0x3f01a0,_0x421b53){_0x421b53=_0x421b53||0xc8;return function(_0x5171a2){if(_0x5171a2){return _0x3f01a0['status'](_0x421b53)[_0xc75d('0x1a')](_0x5171a2);}};}function respondWithFilteredResult(_0x182f56,_0x174998){return function(_0x1b0bfc){if(_0x1b0bfc){var _0x1d49b9=typeof _0x174998[_0xc75d('0x1b')]===_0xc75d('0x1c')&&typeof _0x174998['limit']===_0xc75d('0x1c');var _0x1fe446=_0x1b0bfc[_0xc75d('0x1d')];var _0x389804=_0x1d49b9?0x0:_0x174998[_0xc75d('0x1b')];var _0x47f6b6=_0x1d49b9?_0x1b0bfc[_0xc75d('0x1d')]:_0x174998['offset']+_0x174998['limit'];var _0x3933c5;if(_0x47f6b6>=_0x1fe446){_0x47f6b6=_0x1fe446;_0x3933c5=0xc8;}else{_0x3933c5=0xce;}_0x182f56[_0xc75d('0x18')](_0x3933c5);return _0x182f56[_0xc75d('0x1e')](_0xc75d('0x1f'),_0x389804+'-'+_0x47f6b6+'/'+_0x1fe446)[_0xc75d('0x1a')](_0x1b0bfc);}return null;};}function patchUpdates(_0x576117){return function(_0x3d4141){try{jsonpatch[_0xc75d('0x20')](_0x3d4141,_0x576117,!![]);}catch(_0x208f36){return BPromise[_0xc75d('0x21')](_0x208f36);}return _0x3d4141[_0xc75d('0x22')]();};}function saveUpdates(_0x1b614f,_0x2181e1){return function(_0x2327ec){if(_0x2327ec){return _0x2327ec['update'](_0x1b614f)[_0xc75d('0x23')](function(_0x296456){return _0x296456;});}return null;};}function removeEntity(_0x18589b,_0x4314cc){return function(_0x5ef8d0){if(_0x5ef8d0){return _0x5ef8d0[_0xc75d('0x24')]()[_0xc75d('0x23')](function(){_0x18589b[_0xc75d('0x18')](0xcc)[_0xc75d('0x19')]();});}};}function handleEntityNotFound(_0xae25c2,_0x2e1687){return function(_0x478787){if(!_0x478787){_0xae25c2[_0xc75d('0x25')](0x194);}return _0x478787;};}function handleError(_0x39ab16,_0x56f6f8){_0x56f6f8=_0x56f6f8||0x1f4;return function(_0x4dcda0){logger[_0xc75d('0x26')](_0x4dcda0[_0xc75d('0x27')]);if(_0x4dcda0[_0xc75d('0x28')]){delete _0x4dcda0[_0xc75d('0x28')];}_0x39ab16[_0xc75d('0x18')](_0x56f6f8)[_0xc75d('0x29')](_0x4dcda0);};}exports['index']=function(_0x56fe50,_0x3d8329){var _0x17f45b={},_0x50a7be={},_0x2ba845={'count':0x0,'rows':[]};var _0x19cd53=_[_0xc75d('0x2a')](db[_0xc75d('0x2b')]['rawAttributes'],function(_0x3f285a){return{'name':_0x3f285a[_0xc75d('0x2c')],'type':_0x3f285a[_0xc75d('0x2d')]['key']};});_0x50a7be['model']=_[_0xc75d('0x2a')](_0x19cd53,_0xc75d('0x28'));_0x50a7be['query']=_[_0xc75d('0x2e')](_0x56fe50[_0xc75d('0x2f')]);_0x50a7be[_0xc75d('0x30')]=_[_0xc75d('0x31')](_0x50a7be[_0xc75d('0x32')],_0x50a7be[_0xc75d('0x2f')]);_0x17f45b[_0xc75d('0x33')]=_[_0xc75d('0x31')](_0x50a7be[_0xc75d('0x32')],qs[_0xc75d('0x34')](_0x56fe50[_0xc75d('0x2f')][_0xc75d('0x34')]));_0x17f45b[_0xc75d('0x33')]=_0x17f45b['attributes'][_0xc75d('0x35')]?_0x17f45b[_0xc75d('0x33')]:_0x50a7be[_0xc75d('0x32')];if(!_0x56fe50[_0xc75d('0x2f')]['hasOwnProperty'](_0xc75d('0x36'))){_0x17f45b[_0xc75d('0x37')]=qs[_0xc75d('0x37')](_0x56fe50['query']['limit']);_0x17f45b['offset']=qs['offset'](_0x56fe50[_0xc75d('0x2f')][_0xc75d('0x1b')]);}_0x17f45b['order']=qs[_0xc75d('0x38')](_0x56fe50[_0xc75d('0x2f')][_0xc75d('0x38')]);_0x17f45b[_0xc75d('0x39')]=qs[_0xc75d('0x30')](_[_0xc75d('0x3a')](_0x56fe50[_0xc75d('0x2f')],_0x50a7be[_0xc75d('0x30')]),_0x19cd53);if(_0x56fe50[_0xc75d('0x2f')][_0xc75d('0x3b')]){_0x17f45b['where']=_['merge'](_0x17f45b[_0xc75d('0x39')],{'$or':_[_0xc75d('0x2a')](_0x19cd53,function(_0xd13743){if(_0xd13743[_0xc75d('0x2d')]!==_0xc75d('0x3c')){var _0x530f36={};_0x530f36[_0xd13743[_0xc75d('0x28')]]={'$like':'%'+_0x56fe50[_0xc75d('0x2f')][_0xc75d('0x3b')]+'%'};return _0x530f36;}})});}_0x17f45b=_[_0xc75d('0x3d')]({},_0x17f45b,_0x56fe50[_0xc75d('0x3e')]);var _0x5ea99f={'where':_0x17f45b[_0xc75d('0x39')]};return db[_0xc75d('0x2b')]['count'](_0x5ea99f)['then'](function(_0x3eab05){_0x2ba845[_0xc75d('0x1d')]=_0x3eab05;if(_0x56fe50[_0xc75d('0x2f')][_0xc75d('0x3f')]){_0x17f45b[_0xc75d('0x40')]=[{'all':!![]}];}return db[_0xc75d('0x2b')][_0xc75d('0x41')](_0x17f45b);})['then'](function(_0x1a5698){_0x2ba845[_0xc75d('0x42')]=_0x1a5698;return _0x2ba845;})['then'](respondWithFilteredResult(_0x3d8329,_0x17f45b))['catch'](handleError(_0x3d8329,null));};exports[_0xc75d('0x43')]=function(_0x1eebcc,_0xd0160b){var _0x5cc989={'raw':!![],'where':{'id':_0x1eebcc[_0xc75d('0x44')]['id']}},_0x22d4d9={};_0x22d4d9[_0xc75d('0x32')]=_[_0xc75d('0x2e')](db[_0xc75d('0x2b')][_0xc75d('0x45')]);_0x22d4d9['query']=_['keys'](_0x1eebcc[_0xc75d('0x2f')]);_0x22d4d9[_0xc75d('0x30')]=_[_0xc75d('0x31')](_0x22d4d9[_0xc75d('0x32')],_0x22d4d9[_0xc75d('0x2f')]);_0x5cc989[_0xc75d('0x33')]=_[_0xc75d('0x31')](_0x22d4d9[_0xc75d('0x32')],qs[_0xc75d('0x34')](_0x1eebcc[_0xc75d('0x2f')][_0xc75d('0x34')]));_0x5cc989[_0xc75d('0x33')]=_0x5cc989[_0xc75d('0x33')][_0xc75d('0x35')]?_0x5cc989[_0xc75d('0x33')]:_0x22d4d9[_0xc75d('0x32')];if(_0x1eebcc[_0xc75d('0x2f')][_0xc75d('0x3f')]){_0x5cc989[_0xc75d('0x40')]=[{'all':!![]}];}_0x5cc989=_['merge']({},_0x5cc989,_0x1eebcc[_0xc75d('0x3e')]);return db[_0xc75d('0x2b')][_0xc75d('0x46')](_0x5cc989)['then'](handleEntityNotFound(_0xd0160b,null))['then'](respondWithResult(_0xd0160b,null))[_0xc75d('0x47')](handleError(_0xd0160b,null));};exports['create']=function(_0x58f81d,_0x255225){return db[_0xc75d('0x2b')][_0xc75d('0x48')](_0x58f81d[_0xc75d('0x49')],{})['then'](respondWithResult(_0x255225,0xc9))[_0xc75d('0x47')](handleError(_0x255225,null));};exports['update']=function(_0x1d2c6d,_0x17d063){if(_0x1d2c6d[_0xc75d('0x49')]['id']){delete _0x1d2c6d[_0xc75d('0x49')]['id'];}return db[_0xc75d('0x2b')][_0xc75d('0x46')]({'where':{'id':_0x1d2c6d['params']['id']}})['then'](handleEntityNotFound(_0x17d063,null))[_0xc75d('0x23')](saveUpdates(_0x1d2c6d[_0xc75d('0x49')],null))['then'](respondWithResult(_0x17d063,null))[_0xc75d('0x47')](handleError(_0x17d063,null));};exports['destroy']=function(_0x240887,_0x369191){return db[_0xc75d('0x2b')][_0xc75d('0x46')]({'where':{'id':_0x240887['params']['id']}})[_0xc75d('0x23')](handleEntityNotFound(_0x369191,null))['then'](removeEntity(_0x369191,null))[_0xc75d('0x47')](handleError(_0x369191,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index c8eaae6..2754a42 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 _0x4944=['moment','bluebird','request-promise','rimraf','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api'];(function(_0xe2680e,_0x2f5445){var _0x25f5f7=function(_0x44effb){while(--_0x44effb){_0xe2680e['push'](_0xe2680e['shift']());}};_0x25f5f7(++_0x2f5445);}(_0x4944,0x6d));var _0x4494=function(_0x43089e,_0x475dd4){_0x43089e=_0x43089e-0x0;var _0x104150=_0x4944[_0x43089e];return _0x104150;};'use strict';var _=require(_0x4494('0x0'));var util=require('util');var logger=require(_0x4494('0x1'))(_0x4494('0x2'));var moment=require(_0x4494('0x3'));var BPromise=require(_0x4494('0x4'));var rp=require(_0x4494('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4494('0x6'));var config=require('../../config/environment');var attributes=require(_0x4494('0x7'));module[_0x4494('0x8')]=function(_0x38480d,_0xb94d02){return _0x38480d[_0x4494('0x9')](_0x4494('0xa'),attributes,{'tableName':_0x4494('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4494('0xc'),'collate':_0x4494('0xd')});}; \ No newline at end of file +var _0xe647=['utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4'];(function(_0x1fc7c0,_0x86e3dd){var _0x191df7=function(_0x40ad50){while(--_0x40ad50){_0x1fc7c0['push'](_0x1fc7c0['shift']());}};_0x191df7(++_0x86e3dd);}(_0xe647,0x16d));var _0x7e64=function(_0x5e12a6,_0x5b010d){_0x5e12a6=_0x5e12a6-0x0;var _0x7c8f37=_0xe647[_0x5e12a6];return _0x7c8f37;};'use strict';var _=require(_0x7e64('0x0'));var util=require(_0x7e64('0x1'));var logger=require('../../config/logger')(_0x7e64('0x2'));var moment=require(_0x7e64('0x3'));var BPromise=require(_0x7e64('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7e64('0x5'));var config=require(_0x7e64('0x6'));var attributes=require(_0x7e64('0x7'));module[_0x7e64('0x8')]=function(_0x221235,_0x552ed3){return _0x221235[_0x7e64('0x9')](_0x7e64('0xa'),attributes,{'tableName':_0x7e64('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7e64('0xc'),'collate':_0x7e64('0xd')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 933c7fc..47ecdcd 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 _0xeec6=['then','info','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','WhatsappApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x557fd2,_0x2c0a7a){var _0x1b54a2=function(_0x2e439b){while(--_0x2e439b){_0x557fd2['push'](_0x557fd2['shift']());}};_0x1b54a2(++_0x2c0a7a);}(_0xeec6,0x1c2));var _0x6eec=function(_0x4b6804,_0x301b24){_0x4b6804=_0x4b6804-0x0;var _0x11b4f1=_0xeec6[_0x4b6804];return _0x11b4f1;};'use strict';var _=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var moment=require(_0x6eec('0x2'));var BPromise=require(_0x6eec('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6eec('0x4'));var db=require(_0x6eec('0x5'))['db'];var utils=require(_0x6eec('0x6'));var logger=require(_0x6eec('0x7'))(_0x6eec('0x8'));var config=require(_0x6eec('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6eec('0xa')][_0x6eec('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48064a,_0x5a5e47,_0x1c810e){return new BPromise(function(_0x3443c2,_0x834c2){return client['request'](_0x48064a,_0x1c810e)[_0x6eec('0xc')](function(_0x3aca38){logger[_0x6eec('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x5a5e47,'request\x20sent');logger['debug'](_0x6eec('0xe'),_0x5a5e47,_0x6eec('0xf'),JSON['stringify'](_0x3aca38));if(_0x3aca38['error']){if(_0x3aca38[_0x6eec('0x10')]['code']===0x1f4){logger[_0x6eec('0x10')](_0x6eec('0x11'),_0x5a5e47,_0x3aca38[_0x6eec('0x10')][_0x6eec('0x12')]);return _0x834c2(_0x3aca38[_0x6eec('0x10')]['message']);}logger[_0x6eec('0x10')](_0x6eec('0x11'),_0x5a5e47,_0x3aca38[_0x6eec('0x10')][_0x6eec('0x12')]);return _0x3443c2(_0x3aca38[_0x6eec('0x10')][_0x6eec('0x12')]);}else{logger[_0x6eec('0xd')](_0x6eec('0x11'),_0x5a5e47,_0x6eec('0xf'));_0x3443c2(_0x3aca38[_0x6eec('0x13')]['message']);}})[_0x6eec('0x14')](function(_0x5f1f33){logger[_0x6eec('0x10')](_0x6eec('0x11'),_0x5a5e47,_0x5f1f33);_0x834c2(_0x5f1f33);});});} \ No newline at end of file +var _0x425d=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0xc5d705,_0x16cc4d){var _0xb5b2c8=function(_0x176f67){while(--_0x176f67){_0xc5d705['push'](_0xc5d705['shift']());}};_0xb5b2c8(++_0x16cc4d);}(_0x425d,0x1e0));var _0xd425=function(_0x1d8c86,_0x35919a){_0x1d8c86=_0x1d8c86-0x0;var _0x47c8a5=_0x425d[_0x1d8c86];return _0x47c8a5;};'use strict';var _=require(_0xd425('0x0'));var util=require('util');var moment=require(_0xd425('0x1'));var BPromise=require(_0xd425('0x2'));var rs=require(_0xd425('0x3'));var fs=require('fs');var Redis=require(_0xd425('0x4'));var db=require(_0xd425('0x5'))['db'];var utils=require(_0xd425('0x6'));var logger=require(_0xd425('0x7'))('rpc');var config=require(_0xd425('0x8'));var jayson=require(_0xd425('0x9'));var client=jayson[_0xd425('0xa')][_0xd425('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d97d9,_0x1d2ed0,_0x50b061){return new BPromise(function(_0xb6ba8e,_0x374c3d){return client[_0xd425('0xc')](_0x1d97d9,_0x50b061)[_0xd425('0xd')](function(_0x2db9da){logger[_0xd425('0xe')](_0xd425('0xf'),_0x1d2ed0,_0xd425('0x10'));logger[_0xd425('0x11')](_0xd425('0x12'),_0x1d2ed0,_0xd425('0x10'),JSON[_0xd425('0x13')](_0x2db9da));if(_0x2db9da[_0xd425('0x14')]){if(_0x2db9da[_0xd425('0x14')][_0xd425('0x15')]===0x1f4){logger[_0xd425('0x14')](_0xd425('0xf'),_0x1d2ed0,_0x2db9da[_0xd425('0x14')][_0xd425('0x16')]);return _0x374c3d(_0x2db9da[_0xd425('0x14')]['message']);}logger[_0xd425('0x14')](_0xd425('0xf'),_0x1d2ed0,_0x2db9da[_0xd425('0x14')]['message']);return _0xb6ba8e(_0x2db9da[_0xd425('0x14')][_0xd425('0x16')]);}else{logger[_0xd425('0xe')](_0xd425('0xf'),_0x1d2ed0,_0xd425('0x10'));_0xb6ba8e(_0x2db9da['result'][_0xd425('0x16')]);}})[_0xd425('0x17')](function(_0x7e267e){logger[_0xd425('0x14')]('WhatsappApplication,\x20%s,\x20%s',_0x1d2ed0,_0x7e267e);_0x374c3d(_0x7e267e);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index ed6a983..f34a365 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 _0xafb9=['update','delete','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','isAuthenticated','describe','show','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','whatsapp','whatsappinteraction:addtags','addTags','put','/:id','tracked','whatsappinteraction:update'];(function(_0x3bd868,_0x49db8c){var _0x577e18=function(_0x9c59d6){while(--_0x9c59d6){_0x3bd868['push'](_0x3bd868['shift']());}};_0x577e18(++_0x49db8c);}(_0xafb9,0x68));var _0x9afb=function(_0x2404e1,_0x463c16){_0x2404e1=_0x2404e1-0x0;var _0x27486b=_0xafb9[_0x2404e1];return _0x27486b;};'use strict';var multer=require(_0x9afb('0x0'));var util=require(_0x9afb('0x1'));var path=require(_0x9afb('0x2'));var timeout=require(_0x9afb('0x3'));var express=require(_0x9afb('0x4'));var router=express[_0x9afb('0x5')]();var fs_extra=require(_0x9afb('0x6'));var auth=require(_0x9afb('0x7'));var interaction=require(_0x9afb('0x8'));var config=require('../../config/environment');var controller=require('./whatsappInteraction.controller');router[_0x9afb('0x9')]('/',auth['isAuthenticated'](),controller[_0x9afb('0xa')]);router['get']('/describe',auth[_0x9afb('0xb')](),controller[_0x9afb('0xc')]);router[_0x9afb('0x9')]('/:id',auth[_0x9afb('0xb')](),controller[_0x9afb('0xd')]);router[_0x9afb('0x9')](_0x9afb('0xe'),auth[_0x9afb('0xb')](),controller['getMessages']);router['get'](_0x9afb('0xf'),auth[_0x9afb('0xb')](),controller[_0x9afb('0x10')]);router[_0x9afb('0x11')]('/',auth[_0x9afb('0xb')](),controller[_0x9afb('0x12')]);router[_0x9afb('0x11')](_0x9afb('0xe'),auth[_0x9afb('0xb')](),controller[_0x9afb('0x13')]);router['post'](_0x9afb('0x14'),auth['isAuthenticated'](),interaction['tracked'](_0x9afb('0x15'),_0x9afb('0x16')),controller[_0x9afb('0x17')]);router[_0x9afb('0x18')](_0x9afb('0x19'),auth[_0x9afb('0xb')](),interaction[_0x9afb('0x1a')]('whatsapp',_0x9afb('0x1b')),controller[_0x9afb('0x1c')]);router[_0x9afb('0x1d')](_0x9afb('0x19'),auth[_0x9afb('0xb')](),interaction['tracked'](_0x9afb('0x15'),'whatsappinteraction:destroy'),controller[_0x9afb('0x1e')]);router[_0x9afb('0x1d')]('/:id/tags',auth['isAuthenticated'](),controller[_0x9afb('0x1f')]);module[_0x9afb('0x20')]=router; \ No newline at end of file +var _0xfd20=['download','post','create','/:id/messages','addMessage','tracked','whatsapp','whatsappinteraction:addtags','put','whatsappinteraction:update','delete','whatsappinteraction:destroy','/:id/tags','removeTags','exports','util','express','Router','../../components/auth/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','describe','/:id','show','getMessages','/:id/download'];(function(_0x329d59,_0xae2550){var _0x2ff3bb=function(_0x2f9019){while(--_0x2f9019){_0x329d59['push'](_0x329d59['shift']());}};_0x2ff3bb(++_0xae2550);}(_0xfd20,0x66));var _0x0fd2=function(_0x5ae268,_0x4b3d90){_0x5ae268=_0x5ae268-0x0;var _0x3fea8b=_0xfd20[_0x5ae268];return _0x3fea8b;};'use strict';var multer=require('multer');var util=require(_0x0fd2('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0fd2('0x1'));var router=express[_0x0fd2('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x0fd2('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0fd2('0x4'));var controller=require(_0x0fd2('0x5'));router[_0x0fd2('0x6')]('/',auth[_0x0fd2('0x7')](),controller[_0x0fd2('0x8')]);router['get']('/describe',auth[_0x0fd2('0x7')](),controller[_0x0fd2('0x9')]);router[_0x0fd2('0x6')](_0x0fd2('0xa'),auth[_0x0fd2('0x7')](),controller[_0x0fd2('0xb')]);router[_0x0fd2('0x6')]('/:id/messages',auth[_0x0fd2('0x7')](),controller[_0x0fd2('0xc')]);router['get'](_0x0fd2('0xd'),auth['isAuthenticated'](),controller[_0x0fd2('0xe')]);router[_0x0fd2('0xf')]('/',auth[_0x0fd2('0x7')](),controller[_0x0fd2('0x10')]);router[_0x0fd2('0xf')](_0x0fd2('0x11'),auth[_0x0fd2('0x7')](),controller[_0x0fd2('0x12')]);router['post']('/:id/tags',auth[_0x0fd2('0x7')](),interaction[_0x0fd2('0x13')](_0x0fd2('0x14'),_0x0fd2('0x15')),controller['addTags']);router[_0x0fd2('0x16')]('/:id',auth['isAuthenticated'](),interaction[_0x0fd2('0x13')]('whatsapp',_0x0fd2('0x17')),controller['update']);router[_0x0fd2('0x18')]('/:id',auth[_0x0fd2('0x7')](),interaction[_0x0fd2('0x13')]('whatsapp',_0x0fd2('0x19')),controller['destroy']);router[_0x0fd2('0x18')](_0x0fd2('0x1a'),auth[_0x0fd2('0x7')](),controller[_0x0fd2('0x1b')]);module[_0x0fd2('0x1c')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 52ad11e..849d643 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 _0xea89=['ENUM','out','sequelize','moment','exports','BOOLEAN','DATE','STRING'];(function(_0x463efb,_0x5a4680){var _0x58a131=function(_0x15472a){while(--_0x15472a){_0x463efb['push'](_0x463efb['shift']());}};_0x58a131(++_0x5a4680);}(_0xea89,0x1e2));var _0x9ea8=function(_0x5312a2,_0x22da34){_0x5312a2=_0x5312a2-0x0;var _0x1f3b06=_0xea89[_0x5312a2];return _0x1f3b06;};'use strict';var Sequelize=require(_0x9ea8('0x0'));var moment=require(_0x9ea8('0x1'));module[_0x9ea8('0x2')]={'closed':{'type':Sequelize[_0x9ea8('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9ea8('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x9ea8('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x9ea8('0x5')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x9ea8('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x9ea8('0x6')]('in',_0x9ea8('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9ea8('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x9ea8('0x6')]('in',_0x9ea8('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x9ea8('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x8375=['BOOLEAN','DATE','STRING','ENUM','out','moment','exports'];(function(_0xe9da72,_0x1603e8){var _0xa418e5=function(_0x2bba23){while(--_0x2bba23){_0xe9da72['push'](_0xe9da72['shift']());}};_0xa418e5(++_0x1603e8);}(_0x8375,0x132));var _0x5837=function(_0x147479,_0x324379){_0x147479=_0x147479-0x0;var _0x22c37c=_0x8375[_0x147479];return _0x22c37c;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x5837('0x0'));module[_0x5837('0x1')]={'closed':{'type':Sequelize[_0x5837('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5837('0x3')]},'disposition':{'type':Sequelize[_0x5837('0x4')]},'secondDisposition':{'type':Sequelize[_0x5837('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x5837('0x4')]},'phone':{'type':Sequelize[_0x5837('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x5837('0x5')]('in',_0x5837('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x5837('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x5837('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x5837('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index b1a1ceb..4a41f25 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 _0x27bf=['Tag','removeTags','download','unix','join','tmp','root','server','format','transcript-%d-%s.zip','User','CmContact','lastName','Attachment','Messages','direction','secret','WhatsappAccount','Account','Owner','get','mkdirSync','Whatsapp','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','basename','existsSync','createReadStream','pipe','out','System','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','reject','save','then','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','catch','index','WhatsappInteraction','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','sort','where','pick','select','field','color','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','from','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','sqlOperator','length','conditions','find','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','text','start','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','unreadMessages','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','i.*','c.firstName','Contact.firstName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','o.fullname','groupBy','WhatsappInteractionId','push','all','rows','show','rawAttributes','include','options','create','params','destroy','describe','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','nolimit','$gte','includeAll','findAll','setTags','spread'];(function(_0x8319e4,_0x1d1ec8){var _0x37ca5d=function(_0x2536a0){while(--_0x2536a0){_0x8319e4['push'](_0x8319e4['shift']());}};_0x37ca5d(++_0x1d1ec8);}(_0x27bf,0x117));var _0xf27b=function(_0x4f0ca5,_0x389278){_0x4f0ca5=_0x4f0ca5-0x0;var _0x2131f5=_0x27bf[_0x4f0ca5];return _0x2131f5;};'use strict';var emlformat=require(_0xf27b('0x0'));var rimraf=require(_0xf27b('0x1'));var zipdir=require(_0xf27b('0x2'));var jsonpatch=require(_0xf27b('0x3'));var rp=require(_0xf27b('0x4'));var moment=require(_0xf27b('0x5'));var BPromise=require(_0xf27b('0x6'));var Mustache=require(_0xf27b('0x7'));var util=require(_0xf27b('0x8'));var path=require(_0xf27b('0x9'));var sox=require(_0xf27b('0xa'));var csv=require('to-csv');var ejs=require(_0xf27b('0xb'));var fs=require('fs');var fs_extra=require(_0xf27b('0xc'));var _=require(_0xf27b('0xd'));var squel=require(_0xf27b('0xe'));var crypto=require(_0xf27b('0xf'));var jsforce=require(_0xf27b('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xf27b('0x11'));var querystring=require(_0xf27b('0x12'));var Papa=require(_0xf27b('0x13'));var Redis=require(_0xf27b('0x14'));var authService=require(_0xf27b('0x15'));var qs=require(_0xf27b('0x16'));var as=require(_0xf27b('0x17'));var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf27b('0x18'));var utils=require('../../config/utils');var config=require(_0xf27b('0x19'));var licenseUtil=require(_0xf27b('0x1a'));var db=require(_0xf27b('0x1b'))['db'];config[_0xf27b('0x1c')]=_['defaults'](config[_0xf27b('0x1c')],{'host':_0xf27b('0x1d'),'port':0x18eb});var socket=require(_0xf27b('0x1e'))(new Redis(config[_0xf27b('0x1c')]));require('./whatsappInteraction.socket')[_0xf27b('0x1f')](socket);function respondWithStatusCode(_0x3b7f5f,_0x5e7853){_0x5e7853=_0x5e7853||0xcc;return function(_0x552f2d){if(_0x552f2d){return _0x3b7f5f[_0xf27b('0x20')](_0x5e7853);}return _0x3b7f5f['status'](_0x5e7853)[_0xf27b('0x21')]();};}function respondWithResult(_0x12db19,_0x1fc319){_0x1fc319=_0x1fc319||0xc8;return function(_0x5305d9){if(_0x5305d9){return _0x12db19[_0xf27b('0x22')](_0x1fc319)[_0xf27b('0x23')](_0x5305d9);}};}function respondWithFilteredResult(_0x1350d8,_0x4ae833){return function(_0x472f1a){if(_0x472f1a){var _0x2f6382=typeof _0x4ae833[_0xf27b('0x24')]===_0xf27b('0x25')&&typeof _0x4ae833[_0xf27b('0x26')]===_0xf27b('0x25');var _0x28b7e6=_0x472f1a[_0xf27b('0x27')];var _0x27042a=_0x2f6382?0x0:_0x4ae833['offset'];var _0x12502e=_0x2f6382?_0x472f1a['count']:_0x4ae833[_0xf27b('0x24')]+_0x4ae833[_0xf27b('0x26')];var _0x4124b5;if(_0x12502e>=_0x28b7e6){_0x12502e=_0x28b7e6;_0x4124b5=0xc8;}else{_0x4124b5=0xce;}_0x1350d8[_0xf27b('0x22')](_0x4124b5);return _0x1350d8['set'](_0xf27b('0x28'),_0x27042a+'-'+_0x12502e+'/'+_0x28b7e6)[_0xf27b('0x23')](_0x472f1a);}return null;};}function patchUpdates(_0x1c586e){return function(_0x38902c){try{jsonpatch['apply'](_0x38902c,_0x1c586e,!![]);}catch(_0x3f4814){return BPromise[_0xf27b('0x29')](_0x3f4814);}return _0x38902c[_0xf27b('0x2a')]();};}function saveUpdates(_0xd9a319,_0x2a975d){return function(_0x262c11){if(_0x262c11){return _0x262c11['update'](_0xd9a319)['then'](function(_0x5017ec){return _0x5017ec;});}return null;};}function removeEntity(_0x1422c3,_0x3e26c9){return function(_0x1166db){if(_0x1166db){return _0x1166db['destroy']()[_0xf27b('0x2b')](function(){_0x1422c3['status'](0xcc)[_0xf27b('0x21')]();});}};}function handleEntityNotFound(_0x190729,_0x2817cd){return function(_0x1502ad){if(!_0x1502ad){_0x190729['sendStatus'](0x194);}return _0x1502ad;};}function handleError(_0x3ff5bc,_0x280246){_0x280246=_0x280246||0x1f4;return function(_0x564943){logger[_0xf27b('0x2c')](_0x564943[_0xf27b('0x2d')]);if(_0x564943[_0xf27b('0x2e')]){delete _0x564943[_0xf27b('0x2e')];}_0x3ff5bc[_0xf27b('0x22')](_0x280246)[_0xf27b('0x2f')](_0x564943);};}function getInteractionUsers(_0x5eddd6,_0x5202c1){return new BPromise(function(_0x780e4,_0x2b0cb9){try{if(_0x5202c1[_0x5eddd6['id']]){_0x5eddd6[_0xf27b('0x30')]=_[_0xf27b('0x31')](_0x5202c1[_0x5eddd6['id']],function(_0x6033f1){return{'id':_0x6033f1['id'],'fullname':_0x6033f1[_0xf27b('0x32')]};});}}catch(_0x9b7f){_0x2b0cb9(_0x9b7f);}_0x780e4(_0x5eddd6);});}function getInteractionTags(_0x174080,_0x159c89){return new BPromise(function(_0x4ddacc,_0x83c81c){try{if(_0x174080[_0xf27b('0x33')]){_0x174080[_0xf27b('0x34')]=[];_0x174080[_0xf27b('0x33')][_0xf27b('0x35')](',')['forEach'](function(_0x30fb76){_0x174080[_0xf27b('0x34')]['push'](_0x159c89[_0x30fb76]);});}delete _0x174080['TagIds'];}catch(_0x291096){_0x83c81c(_0x291096);}_0x4ddacc(_0x174080);});}function updateWhatsappInteraction(_0x3c61d3,_0x3afeca,_0x457291){return new BPromise(function(_0x4ce989,_0x5dacdb){return getInteractionUsers(_0x3c61d3,_0x457291)[_0xf27b('0x2b')](function(_0x35ded7){return getInteractionTags(_0x35ded7,_0x3afeca);})['then'](function(_0x4d4ac6){_0x4ce989(_0x4d4ac6);})[_0xf27b('0x36')](function(_0x21698e){_0x5dacdb(_0x21698e);});});}exports[_0xf27b('0x37')]=function(_0x2ebafd,_0x3f435a){var _0x537ca9={},_0x5cec25={},_0x3441bd={'count':0x0,'rows':[]};var _0x210ae4=_[_0xf27b('0x31')](db[_0xf27b('0x38')]['rawAttributes'],function(_0x2272a4){return{'name':_0x2272a4[_0xf27b('0x39')],'type':_0x2272a4[_0xf27b('0x3a')][_0xf27b('0x3b')]};});_0x5cec25[_0xf27b('0x3c')]=_['map'](_0x210ae4,_0xf27b('0x2e'));_0x5cec25[_0xf27b('0x3d')]=_[_0xf27b('0x3e')](_0x2ebafd[_0xf27b('0x3d')]);_0x5cec25[_0xf27b('0x3f')]=_[_0xf27b('0x40')](_0x5cec25['model'],_0x5cec25[_0xf27b('0x3d')]);_0x537ca9['attributes']=_[_0xf27b('0x40')](_0x5cec25[_0xf27b('0x3c')],qs[_0xf27b('0x41')](_0x2ebafd['query'][_0xf27b('0x41')]));_0x537ca9[_0xf27b('0x42')]=_0x537ca9[_0xf27b('0x42')]['length']?_0x537ca9[_0xf27b('0x42')]:_0x5cec25[_0xf27b('0x3c')];if(!_0x2ebafd[_0xf27b('0x3d')][_0xf27b('0x43')]('nolimit')){_0x537ca9['limit']=qs['limit'](_0x2ebafd[_0xf27b('0x3d')][_0xf27b('0x26')]);_0x537ca9[_0xf27b('0x24')]=qs[_0xf27b('0x24')](_0x2ebafd['query'][_0xf27b('0x24')]);}_0x537ca9['order']=qs[_0xf27b('0x44')](_0x2ebafd[_0xf27b('0x3d')][_0xf27b('0x44')]);_0x537ca9[_0xf27b('0x45')]=qs[_0xf27b('0x3f')](_[_0xf27b('0x46')](_0x2ebafd[_0xf27b('0x3d')],_0x5cec25[_0xf27b('0x3f')]),_0x210ae4);var _0x1a1e13=[];var _0x8913e5=squel[_0xf27b('0x47')]()[_0xf27b('0x48')]('id')[_0xf27b('0x48')](_0xf27b('0x2e'))[_0xf27b('0x48')](_0xf27b('0x49'))['from'](_0xf27b('0x4a'));var _0x75cfea=squel[_0xf27b('0x47')]()['field'](_0xf27b('0x4b'))[_0xf27b('0x48')](_0xf27b('0x4c'))[_0xf27b('0x48')](_0xf27b('0x4d'))[_0xf27b('0x4e')](_0xf27b('0x4f'),'ui')[_0xf27b('0x50')](_0xf27b('0x51'),'u',_0xf27b('0x52'));var _0x5cde81=squel[_0xf27b('0x47')]()[_0xf27b('0x4e')](_0xf27b('0x53'),'i')[_0xf27b('0x50')](_0xf27b('0x54'),'c',_0xf27b('0x55'))['left_join']('users','o',_0xf27b('0x56'))[_0xf27b('0x50')](_0xf27b('0x57'),'a',_0xf27b('0x58'))[_0xf27b('0x50')](_0xf27b('0x59'),'me','me.WhatsappInteractionId\x20=\x20i.id')[_0xf27b('0x50')]('whatsapp_interaction_has_tags','it',_0xf27b('0x5a'))[_0xf27b('0x50')](_0xf27b('0x4a'),'t',_0xf27b('0x5b'));var _0x479f98=squel['expr']();var _0x33148b=[];var _0x320915=squel[_0xf27b('0x5c')]();var _0x22186c;if(_0x2ebafd['query']['search']){_0x22186c=as[_0xf27b('0x5d')](_0x2ebafd[_0xf27b('0x3d')]['search']);var _0xe4ea01=_0x22186c[_0xf27b('0x5e')];for(var _0x253f6b=0x0;_0x253f6b<_0x22186c['conditions'][_0xf27b('0x5f')];_0x253f6b++){var _0x5b929e=_0x22186c[_0xf27b('0x60')][_0x253f6b];var _0x512319='i';var _0x4d4413=_[_0xf27b('0x61')](_0x210ae4,['name',_0x5b929e[_0xf27b('0x48')]]);if(!_0x4d4413){switch(_0x5b929e['field']){case'unreadMessages':if(_0x5b929e[_0xf27b('0x62')]==0x1){_0x5cde81[_0xf27b('0x63')]('`'+_0x5b929e['field']+'`\x20=\x200');}else{_0x5cde81['having']('`'+_0x5b929e[_0xf27b('0x48')]+_0xf27b('0x64'));}break;case _0xf27b('0x65'):if(_0x5b929e[_0xf27b('0x66')]===_0xf27b('0x67')){if(_0x5b929e[_0xf27b('0x62')][_0xf27b('0x35')]('\x20')[_0xf27b('0x5f')]>0x1){_0x479f98[_0xe4ea01](_0xf27b('0x68'),qs['getFullTextValue'](_0x5b929e[_0xf27b('0x62')]),null);}else{var _0x144bb6='%'+_0x5b929e['value']+'%';_0x479f98[_0xe4ea01]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x144bb6,_0x144bb6,_0x144bb6);}}else{_0x4d4413=_['find'](_0x210ae4,[_0xf27b('0x2e'),'ContactId']);_0x5b929e[_0xf27b('0x48')]=_0xf27b('0x69');_0x13aea3=as[_0xf27b('0x6a')](_0x512319,_0x4d4413[_0xf27b('0x3a')],_0x5b929e);_0x479f98[_0xe4ea01](_0x13aea3[_0xf27b('0x6b')],_0x13aea3[_0xf27b('0x62')][_0xf27b('0x6c')],_0x13aea3[_0xf27b('0x62')]['end']);}break;case'Tag':var _0x3ab5eb=_0x5b929e[_0xf27b('0x62')][_0xf27b('0x35')](',')[_0xf27b('0x31')](function(_0x2d2665){return Number(_0x2d2665);});_0x3ab5eb[_0xf27b('0x6d')](function(_0x16d3ad){_0x320915['or'](_0xf27b('0x6e'),'%,'+_0x16d3ad+',%');});_0x33148b=_[_0xf27b('0x6f')](_0x33148b,_0x3ab5eb);break;case'User':if(_0x5b929e[_0xf27b('0x66')]===_0xf27b('0x67')){_0x479f98[_0xe4ea01](_0xf27b('0x70'),'%'+_0x5b929e['value']+'%',null);}else{_0x4d4413=_[_0xf27b('0x61')](_0x210ae4,['name',_0xf27b('0x71')]);_0x5b929e[_0xf27b('0x48')]=_0xf27b('0x71');_0x13aea3=as['buildExpression'](_0x512319,_0x4d4413[_0xf27b('0x3a')],_0x5b929e);_0x479f98[_0xe4ea01](_0x13aea3[_0xf27b('0x6b')],_0x13aea3[_0xf27b('0x62')][_0xf27b('0x6c')],_0x13aea3[_0xf27b('0x62')][_0xf27b('0x21')]);}break;case _0xf27b('0x72'):_0x13aea3=as[_0xf27b('0x6a')]('me',null,_0x5b929e);_0x479f98[_0xe4ea01](_0x13aea3[_0xf27b('0x6b')],_0x13aea3[_0xf27b('0x62')][_0xf27b('0x6c')],_0x13aea3[_0xf27b('0x62')][_0xf27b('0x21')]);break;}}else{var _0x13aea3=as[_0xf27b('0x6a')](_0x512319,_0x4d4413[_0xf27b('0x3a')],_0x5b929e);_0x479f98[_0xe4ea01](_0x13aea3[_0xf27b('0x6b')],_0x13aea3['value'][_0xf27b('0x6c')],_0x13aea3[_0xf27b('0x62')][_0xf27b('0x21')]);}}}else{var _0x3cb377=_(_0x2ebafd['query'])['keys']()['map'](function(_0x1e7be3){return _[_0xf27b('0x73')](_0x210ae4,[_0xf27b('0x2e'),_0x1e7be3])?_0x1e7be3:undefined;})[_0xf27b('0x74')]()['value']();if(!_[_0xf27b('0x75')](_0x3cb377)){_0x3cb377[_0xf27b('0x6d')](function(_0x4482ef){if(_0x4482ef===_0xf27b('0x76')){_0x5cde81[_0xf27b('0x45')](_0xf27b('0x77'),[][_0xf27b('0x78')](_0x2ebafd[_0xf27b('0x3d')][_0x4482ef]));}else if(_0x4482ef===_0xf27b('0x79')){var _0x581926=JSON[_0xf27b('0x7a')](_0x2ebafd[_0xf27b('0x3d')][_0x4482ef])['$gte'];var _0x45bd9c=JSON['parse'](_0x2ebafd[_0xf27b('0x3d')][_0x4482ef])['$lte'];_0x5cde81[_0xf27b('0x45')](_0xf27b('0x7b'),_0x581926,_0x45bd9c);}else{if(_0x2ebafd[_0xf27b('0x3d')][_0x4482ef]==='null'){_0x5cde81[_0xf27b('0x45')]('i.'+_0x4482ef+_0xf27b('0x7c'));}else{_0x5cde81[_0xf27b('0x45')]('i.'+_0x4482ef+_0xf27b('0x7d'),_0x2ebafd[_0xf27b('0x3d')][_0x4482ef]);}}});}if(_0x2ebafd['query'][_0xf27b('0x7e')]){if(_0x2ebafd[_0xf27b('0x3d')][_0xf27b('0x7e')]==0x1){_0x5cde81[_0xf27b('0x63')](_0xf27b('0x7f'));}else{_0x5cde81[_0xf27b('0x63')](_0xf27b('0x80'));}}if(_0x2ebafd[_0xf27b('0x3d')][_0xf27b('0x81')]){_0x33148b=_[_0xf27b('0x82')](_0x2ebafd[_0xf27b('0x3d')][_0xf27b('0x81')])?_0x2ebafd['query']['tag']:new Array(_0x2ebafd[_0xf27b('0x3d')][_0xf27b('0x81')]);_0x33148b[_0xf27b('0x6d')](function(_0x2f551c){_0x320915['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2f551c+',%');});}if(_0x2ebafd[_0xf27b('0x3d')][_0xf27b('0x83')]){var _0x36cfad=_0x2ebafd[_0xf27b('0x3d')][_0xf27b('0x83')][_0xf27b('0x84')]('\x5c','\x5c\x5c')[_0xf27b('0x84')](/'/g,'\x27\x27');if(qs[_0xf27b('0x85')](_0x36cfad)){_0x479f98['or'](_0xf27b('0x86'),_0x36cfad+'%')['or']('i.phone\x20LIKE\x20?',_0x36cfad+'%');}else{_0x479f98['or'](_0xf27b('0x87'),qs[_0xf27b('0x88')](_0x36cfad))['or'](_0xf27b('0x89'),_0x36cfad+'%');}}}_0x5cde81[_0xf27b('0x45')](_0x479f98);_0x5cde81[_0xf27b('0x8a')](_0xf27b('0x8b'));var _0x5093c3={'type':db[_0xf27b('0x8c')][_0xf27b('0x8d')][_0xf27b('0x8e')],'raw':!![]};var _0x4c8f6a=_0x5cde81[_0xf27b('0x8f')]();_0x4c8f6a[_0xf27b('0x48')](_0xf27b('0x8b'));_0x4c8f6a['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xf27b('0x90'));if(_0x537ca9['order']){_0x537ca9[_0xf27b('0x91')]['forEach'](function(_0x1e3a88){var _0x29b0ba=_0x1e3a88[0x0]===_0xf27b('0x92')?_0x1e3a88[0x0]:'i.'+_0x1e3a88[0x0];_0x5cde81[_0xf27b('0x91')](_0x29b0ba,_0x1e3a88[0x1]===_0xf27b('0x93')?![]:!![]);});}if(!_[_0xf27b('0x75')](_0x33148b)){_0x5cde81[_0xf27b('0x63')](_0x320915);_0x4c8f6a[_0xf27b('0x45')](_0xf27b('0x94'),_0x33148b);}BPromise[_0xf27b('0x95')]()['then'](function(){if(!_0x22186c){if(_0x2ebafd[_0xf27b('0x3d')][_0xf27b('0x76')])return;_0x4c8f6a[_0xf27b('0x45')](_0xf27b('0x96'));_0x5cde81[_0xf27b('0x45')](_0xf27b('0x96'));return;}if(_0x2ebafd[_0xf27b('0x97')][_0xf27b('0x98')]!==_0xf27b('0x99'))return;return _0x2ebafd[_0xf27b('0x97')]['getWhatsappAccounts']({'attributes':['id'],'raw':!![]})[_0xf27b('0x2b')](function(_0x22a74b){if(_['isEmpty'](_0x22a74b)){_0x4c8f6a[_0xf27b('0x45')](_0xf27b('0x9a'));_0x5cde81[_0xf27b('0x45')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x4c8f6a[_0xf27b('0x45')](_0xf27b('0x77'),_[_0xf27b('0x31')](_0x22a74b,'id'));_0x5cde81['where'](_0xf27b('0x77'),_[_0xf27b('0x31')](_0x22a74b,'id'));}});})[_0xf27b('0x2b')](function(){if(_0x2ebafd[_0xf27b('0x97')]['role']===_0xf27b('0x99')&&!_0x22186c&&!_0x2ebafd[_0xf27b('0x3d')][_0xf27b('0x76')])return[];return db[_0xf27b('0x9b')][_0xf27b('0x3d')](_0x4c8f6a[_0xf27b('0x9c')](),_0x5093c3);})['then'](function(_0x20c747){_0x3441bd[_0xf27b('0x27')]=_0x20c747['length'];if(_0x3441bd[_0xf27b('0x27')]===0x0)return[];return db[_0xf27b('0x9b')]['query'](_0x8913e5['toString'](),_0x5093c3)['then'](function(_0x17f3a4){_0x1a1e13=_['keyBy'](_0x17f3a4,'id');_0x5093c3=_[_0xf27b('0x9d')](_0x5093c3,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2ebafd[_0xf27b('0x3d')]['fields']){_0x537ca9[_0xf27b('0x42')][_0xf27b('0x6d')](function(_0x4bf8dc){_0x5cde81['field']('i.'+_0x4bf8dc);});}else{_0x5cde81['field'](_0xf27b('0x9e'),'unreadMessages');_0x5cde81[_0xf27b('0x48')](_0xf27b('0x9f'),_0xf27b('0xa0'));_0x5cde81['field']('a.mandatoryDisposition','Account.mandatoryDisposition');_0x5cde81[_0xf27b('0x48')]('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',_0xf27b('0x92'));_0x5cde81[_0xf27b('0x48')](_0xf27b('0xa1'));_0x5cde81['field'](_0xf27b('0xa2'),_0xf27b('0xa3'));_0x5cde81['field']('c.lastName','Contact.lastName');_0x5cde81[_0xf27b('0x48')](_0xf27b('0xa4'),_0xf27b('0xa5'));_0x5cde81['field'](_0xf27b('0xa6'),_0xf27b('0xa7'));_0x5cde81[_0xf27b('0x48')]('c.mobile',_0xf27b('0xa8'));_0x5cde81[_0xf27b('0x48')]('c.fax','Contact.fax');_0x5cde81['field'](_0xf27b('0xa9'),'Owner.fullname');_0x5cde81[_0xf27b('0x48')]('o.internal','Owner.internal');_0x5cde81[_0xf27b('0x48')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xf27b('0x33'));}if(_0x537ca9[_0xf27b('0x26')])_0x5cde81[_0xf27b('0x26')](_0x537ca9[_0xf27b('0x26')]);if(_0x537ca9[_0xf27b('0x24')])_0x5cde81[_0xf27b('0x24')](_0x537ca9[_0xf27b('0x24')]);return db[_0xf27b('0x9b')][_0xf27b('0x3d')](_0x5cde81[_0xf27b('0x9c')](),_0x5093c3);})[_0xf27b('0x2b')](function(_0x278217){if(_0x278217[_0xf27b('0x5f')]>0x0)_0x75cfea[_0xf27b('0x45')]('ui.WhatsappInteractionId\x20IN\x20?',_[_0xf27b('0x31')](_0x278217,'id'));return db['sequelize'][_0xf27b('0x3d')](_0x75cfea[_0xf27b('0x9c')](),_0x5093c3)[_0xf27b('0x2b')](function(_0x380d48){var _0x52e00d=_[_0xf27b('0xaa')](_0x380d48,_0xf27b('0xab'));var _0x4c8dfc=[];_0x278217[_0xf27b('0x6d')](function(_0x55b213){_0x4c8dfc[_0xf27b('0xac')](updateWhatsappInteraction(_0x55b213,_0x1a1e13,_0x52e00d));});return BPromise[_0xf27b('0xad')](_0x4c8dfc);});});})['then'](function(_0x429005){_0x3441bd[_0xf27b('0xae')]=_0x429005;return _0x3441bd;})[_0xf27b('0x2b')](respondWithFilteredResult(_0x3f435a,_0x537ca9))[_0xf27b('0x36')](handleError(_0x3f435a,null));};exports[_0xf27b('0xaf')]=function(_0x500f8b,_0x2553ca){var _0xc79f29={'raw':![],'where':{'id':_0x500f8b['params']['id']}},_0x32f0e9={};_0x32f0e9[_0xf27b('0x3c')]=_[_0xf27b('0x3e')](db['WhatsappInteraction'][_0xf27b('0xb0')]);_0x32f0e9[_0xf27b('0x3d')]=_['keys'](_0x500f8b['query']);_0x32f0e9[_0xf27b('0x3f')]=_['intersection'](_0x32f0e9['model'],_0x32f0e9['query']);_0xc79f29['attributes']=_[_0xf27b('0x40')](_0x32f0e9[_0xf27b('0x3c')],qs['fields'](_0x500f8b['query'][_0xf27b('0x41')]));_0xc79f29['attributes']=_0xc79f29[_0xf27b('0x42')][_0xf27b('0x5f')]?_0xc79f29[_0xf27b('0x42')]:_0x32f0e9[_0xf27b('0x3c')];if(_0x500f8b['query']['includeAll']){_0xc79f29[_0xf27b('0xb1')]=[{'all':!![]}];}_0xc79f29=_[_0xf27b('0x9d')]({},_0xc79f29,_0x500f8b[_0xf27b('0xb2')]);return db['WhatsappInteraction'][_0xf27b('0x61')](_0xc79f29)['then'](handleEntityNotFound(_0x2553ca,null))['then'](respondWithResult(_0x2553ca,null))[_0xf27b('0x36')](handleError(_0x2553ca,null));};exports[_0xf27b('0xb3')]=function(_0x576211,_0x254b1e){return db[_0xf27b('0x38')]['create'](_0x576211['body'],{})[_0xf27b('0x2b')](respondWithResult(_0x254b1e,0xc9))['catch'](handleError(_0x254b1e,null));};exports['update']=function(_0x2baabd,_0x25d710){if(_0x2baabd['body']['id']){delete _0x2baabd[_0xf27b('0x72')]['id'];}return db[_0xf27b('0x38')]['find']({'where':{'id':_0x2baabd[_0xf27b('0xb4')]['id']}})['then'](handleEntityNotFound(_0x25d710,null))['then'](saveUpdates(_0x2baabd[_0xf27b('0x72')],null))[_0xf27b('0x2b')](respondWithResult(_0x25d710,null))['catch'](handleError(_0x25d710,null));};exports[_0xf27b('0xb5')]=function(_0x1a845d,_0x2304a0){return db[_0xf27b('0x38')]['find']({'where':{'id':_0x1a845d[_0xf27b('0xb4')]['id']}})['then'](handleEntityNotFound(_0x2304a0,null))[_0xf27b('0x2b')](removeEntity(_0x2304a0,null))[_0xf27b('0x36')](handleError(_0x2304a0,null));};exports[_0xf27b('0xb6')]=function(_0x54bc5f,_0x53d7f8){return db[_0xf27b('0x38')][_0xf27b('0xb6')]()[_0xf27b('0x2b')](respondWithResult(_0x53d7f8,null))['catch'](handleError(_0x53d7f8,null));};exports[_0xf27b('0xb7')]=function(_0x2ef6a0,_0x579bc9,_0x5305ba){return db[_0xf27b('0xb8')][_0xf27b('0x61')]({'where':{'id':_0x2ef6a0[_0xf27b('0xb4')]['id']}})[_0xf27b('0x2b')](handleEntityNotFound(_0x579bc9,null))['then'](function(_0x598549){if(_0x598549){return _0x598549['addMessage'](_0x2ef6a0['body'][_0xf27b('0xb9')],_[_0xf27b('0xba')](_0x2ef6a0[_0xf27b('0x72')],[_0xf27b('0xb9'),'id'])||{});}})[_0xf27b('0x2b')](respondWithResult(_0x579bc9,null))[_0xf27b('0x36')](handleError(_0x579bc9,null));};exports[_0xf27b('0xbb')]=function(_0x15db43,_0x21e44c,_0x2890df){var _0x172369={'raw':![],'where':{}};var _0x330dca={};var _0x1fd52a={'count':0x0,'rows':[]};return db[_0xf27b('0x38')][_0xf27b('0xbc')]({'where':{'id':_0x15db43[_0xf27b('0xb4')]['id']}})[_0xf27b('0x2b')](handleEntityNotFound(_0x21e44c,null))[_0xf27b('0x2b')](function(_0x657d41){if(_0x657d41){_0x330dca['model']=_['keys'](db[_0xf27b('0xb8')][_0xf27b('0xb0')]);_0x330dca[_0xf27b('0x3d')]=_[_0xf27b('0x3e')](_0x15db43[_0xf27b('0x3d')]);_0x330dca[_0xf27b('0x3f')]=_[_0xf27b('0x40')](_0x330dca[_0xf27b('0x3c')],_0x330dca['query']);_0x172369['attributes']=_[_0xf27b('0x40')](_0x330dca[_0xf27b('0x3c')],qs[_0xf27b('0x41')](_0x15db43[_0xf27b('0x3d')][_0xf27b('0x41')]));_0x172369[_0xf27b('0x42')]=_0x172369[_0xf27b('0x42')][_0xf27b('0x5f')]?_0x172369['attributes']:_0x330dca[_0xf27b('0x3c')];if(!_0x15db43[_0xf27b('0x3d')]['hasOwnProperty'](_0xf27b('0xbd'))){_0x172369['limit']=qs[_0xf27b('0x26')](_0x15db43['query'][_0xf27b('0x26')]);_0x172369[_0xf27b('0x24')]=qs[_0xf27b('0x24')](_0x15db43[_0xf27b('0x3d')][_0xf27b('0x24')]);}_0x172369[_0xf27b('0x91')]=qs['sort'](_0x15db43[_0xf27b('0x3d')][_0xf27b('0x44')]);_0x172369[_0xf27b('0x45')]=qs[_0xf27b('0x3f')](_[_0xf27b('0x46')](_0x15db43['query'],_0x330dca['filters']));_0x172369[_0xf27b('0x45')][_0xf27b('0xab')]=_0x657d41['id'];if(_0x15db43[_0xf27b('0x3d')][_0xf27b('0x83')]){_0x172369[_0xf27b('0x45')]=_[_0xf27b('0x9d')](_0x172369[_0xf27b('0x45')],{'$or':_[_0xf27b('0x31')](_0x172369[_0xf27b('0x42')],function(_0x13fde7){var _0x3f2613={};_0x3f2613[_0x13fde7]={'$like':'%'+_0x15db43['query'][_0xf27b('0x83')]+'%'};return _0x3f2613;})});}if(_0x15db43[_0xf27b('0x3d')][_0xf27b('0xbe')]){var _0x3fa476=_0x15db43[_0xf27b('0x3d')]['$gte']['split'](',');var _0x2881df={};_0x2881df[_0x3fa476[0x0]]={'$gte':moment(_0x3fa476[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x172369[_0xf27b('0x45')]=_[_0xf27b('0x9d')](_0x172369[_0xf27b('0x45')],_0x2881df);}_0x172369=_['merge']({},_0x172369,_0x15db43[_0xf27b('0xb2')]);return db[_0xf27b('0xb8')][_0xf27b('0x27')]({'where':_0x172369[_0xf27b('0x45')]})[_0xf27b('0x2b')](function(_0x6c21e6){_0x1fd52a[_0xf27b('0x27')]=_0x6c21e6;if(_0x15db43[_0xf27b('0x3d')][_0xf27b('0xbf')]){_0x172369[_0xf27b('0xb1')]=[{'all':!![]}];}return db[_0xf27b('0xb8')][_0xf27b('0xc0')](_0x172369);})[_0xf27b('0x2b')](function(_0x40f489){_0x1fd52a['rows']=_0x40f489;return _0x1fd52a;});}})[_0xf27b('0x2b')](respondWithFilteredResult(_0x21e44c,_0x172369))[_0xf27b('0x36')](handleError(_0x21e44c,null));};exports['addTags']=function(_0x41a75a,_0x2c2732,_0x1e4b8e){return db['WhatsappInteraction']['find']({'where':{'id':_0x41a75a[_0xf27b('0xb4')]['id']}})['then'](handleEntityNotFound(_0x2c2732,null))[_0xf27b('0x2b')](function(_0x5ac058){if(_0x5ac058){return _0x5ac058[_0xf27b('0xc1')](_0x41a75a[_0xf27b('0x72')][_0xf27b('0xb9')],_[_0xf27b('0xba')](_0x41a75a[_0xf27b('0x72')],[_0xf27b('0xb9'),'id'])||{})[_0xf27b('0xc2')](function(){return db[_0xf27b('0xc3')][_0xf27b('0xc0')]({'attributes':['id',_0xf27b('0x2e'),_0xf27b('0x49')],'where':{'id':_0x41a75a[_0xf27b('0x72')]['ids']}});})[_0xf27b('0x2b')](function(_0x15dff8){socket['emit']('whatsappInteractionTags:save',{'id':Number(_0x41a75a['params']['id']),'tags':_0x15dff8||[]});return{'id':Number(_0x41a75a[_0xf27b('0xb4')]['id']),'tags':_0x15dff8||[]};});}})[_0xf27b('0x2b')](respondWithResult(_0x2c2732,null))['catch'](handleError(_0x2c2732,null));};exports[_0xf27b('0xc4')]=function(_0x5ca9b5,_0x3e0d76,_0x457cc6){return db[_0xf27b('0x38')][_0xf27b('0x61')]({'where':{'id':_0x5ca9b5[_0xf27b('0xb4')]['id']}})[_0xf27b('0x2b')](handleEntityNotFound(_0x3e0d76,null))['then'](function(_0x3f1906){if(_0x3f1906){return _0x3f1906[_0xf27b('0xc4')](_0x5ca9b5[_0xf27b('0x3d')]['ids']);}})['then'](respondWithStatusCode(_0x3e0d76,null))[_0xf27b('0x36')](handleError(_0x3e0d76,null));};exports[_0xf27b('0xc5')]=function(_0x3e0195,_0x1b935c){var _0x1e16ac=moment()[_0xf27b('0xc6')]()[_0xf27b('0x9c')]();var _0x288609=path[_0xf27b('0xc7')](config['root'],'server','files',_0xf27b('0xc8'));var _0x2c7ad5=path[_0xf27b('0xc7')](config[_0xf27b('0xc9')],_0xf27b('0xca'),'files','attachments');var _0x459ad3=path[_0xf27b('0xc7')](_0x288609,_0x1e16ac);var _0x2a8d0d=util[_0xf27b('0xcb')](_0xf27b('0xcc'),_0x3e0195[_0xf27b('0xb4')]['id'],_0x1e16ac);var _0x12cdee=path[_0xf27b('0xc7')](_0x288609,_0x2a8d0d);var _0x83dd3a=[];_0x83dd3a['push']({'model':db['User'],'as':_0xf27b('0xcd'),'attributes':['id',_0xf27b('0x32')],'raw':!![]});_0x83dd3a['push']({'model':db[_0xf27b('0xce')],'as':_0xf27b('0x65'),'attributes':['id','firstName',_0xf27b('0xcf')],'raw':!![]});if(_0x3e0195[_0xf27b('0x3d')]['attachments']){_0x83dd3a['push']({'model':db[_0xf27b('0xd0')],'as':'Attachment','raw':!![]});}var _0x5d6ba1=[{'model':db[_0xf27b('0xb8')],'as':_0xf27b('0xd1'),'attributes':['id',_0xf27b('0x72'),_0xf27b('0x79'),_0xf27b('0xd2'),_0xf27b('0xd3'),_0xf27b('0x7e')],'include':_0x83dd3a}];_0x5d6ba1['push']({'model':db[_0xf27b('0xd4')],'as':_0xf27b('0xd5'),'attributes':['id',_0xf27b('0x2e')]});_0x5d6ba1[_0xf27b('0xac')]({'model':db[_0xf27b('0xcd')],'as':_0xf27b('0xd6'),'attributes':['id',_0xf27b('0x32')]});return db[_0xf27b('0x38')][_0xf27b('0x61')]({'where':{'id':_0x3e0195[_0xf27b('0xb4')]['id']},'include':_0x5d6ba1})[_0xf27b('0x2b')](handleEntityNotFound(_0x1b935c,null))[_0xf27b('0x2b')](function(_0x3e340d){if(_0x3e340d){var _0x6f629f=_0x3e340d[_0xf27b('0xd7')]({'plain':!![]});fs[_0xf27b('0xd8')](_0x459ad3);var _0x5a71ce={'channel':_0xf27b('0xd9'),'account':_0x6f629f['Account'][_0xf27b('0x2e')],'agent':_0x6f629f[_0xf27b('0xd6')]?_0x6f629f['Owner'][_0xf27b('0x32')]:_0xf27b('0xda'),'createdAt':moment(_0x6f629f[_0xf27b('0x79')])[_0xf27b('0xcb')](_0xf27b('0xdb'))[_0xf27b('0x9c')](),'closedAt':_0x6f629f[_0xf27b('0xdc')]?moment(_0x6f629f[_0xf27b('0xdd')])[_0xf27b('0xcb')](_0xf27b('0xdb'))[_0xf27b('0x9c')]():'','disposition':_0x6f629f['disposition'],'messages':_(_0x6f629f['Messages'])['filter']({'secret':![]})[_0xf27b('0x31')](function(_0x471e5c){if(_0x471e5c[_0xf27b('0xd0')]){var _0x3665e3=path[_0xf27b('0xc7')](_0x2c7ad5,_0x471e5c[_0xf27b('0xd0')][_0xf27b('0xde')]);if(fs[_0xf27b('0xdf')](_0x3665e3)){fs[_0xf27b('0xe0')](_0x3665e3)[_0xf27b('0xe1')](fs['createWriteStream'](path[_0xf27b('0xc7')](_0x459ad3,_0x471e5c[_0xf27b('0xd0')][_0xf27b('0xde')])));}}return{'date':moment(_0x471e5c['createdAt'])[_0xf27b('0xcb')]('YYYY-MM-DD\x20HH:mm:ss')[_0xf27b('0x9c')](),'sender':_0x471e5c[_0xf27b('0xd2')]===_0xf27b('0xe2')?_0x471e5c[_0xf27b('0xcd')]?_0x471e5c['User']['fullname']:_0xf27b('0xe3'):_0x471e5c[_0xf27b('0x65')]['firstName']+(_0x471e5c['Contact'][_0xf27b('0xcf')]?'\x20'+_0x471e5c['Contact'][_0xf27b('0xcf')]:''),'body':_0x471e5c[_0xf27b('0xd0')]?_0x471e5c[_0xf27b('0xd0')][_0xf27b('0xde')]:_0x471e5c[_0xf27b('0x72')],'direction':_0x471e5c[_0xf27b('0xd2')]==='out'?'A':'C','secret':_0x471e5c['secret'],'read':_0x471e5c['read'],'attachment':_0x471e5c['Attachment']};})['value']()};return ejs[_0xf27b('0xe4')](path['join'](config['root'],_0xf27b('0xca'),_0xf27b('0xe5'),_0xf27b('0xe6')),{'interaction':_0x5a71ce})[_0xf27b('0x2b')](function(_0x1c4d3a){var _0x130a07=path['join'](_0x459ad3,_0xf27b('0xe7')+_0x6f629f['id']+'-'+_0x1e16ac+_0xf27b('0xe8'));var _0x46a8f6={'path':_0x130a07,'channel':_0xf27b('0xd9'),'interactionId':_0x6f629f['id']};return pdf[_0xf27b('0xe9')](_0x1c4d3a,_0x46a8f6);})[_0xf27b('0x2b')](function(){return new BPromise(function(_0x25c1c3,_0xfc97b2){zipdir(_0x459ad3,{'saveTo':_0x12cdee},function(_0x340173,_0x23584d){if(_0x340173)return _0xfc97b2(_0x340173);return _0x25c1c3(_0x23584d);});})[_0xf27b('0x2b')](function(){return new BPromise(function(_0x96cea0,_0x5bd9a1){rimraf(_0x459ad3,function(_0x376ea6){if(_0x376ea6)_0x5bd9a1(_0x376ea6);return _0x96cea0();});});})[_0xf27b('0x2b')](function(){return _0x1b935c[_0xf27b('0xc5')](_0x12cdee,_0x2a8d0d,function(_0x50228f){if(_0x50228f){console[_0xf27b('0xea')](_0xf27b('0xeb'),_0x50228f);}else{fs[_0xf27b('0xec')](_0x12cdee);}});});});}else{return _0x1b935c[_0xf27b('0x20')](0xc8);}})[_0xf27b('0x36')](handleError(_0x1b935c,null));}; \ No newline at end of file +var _0xd1d4=['disposition','existsSync','createReadStream','pipe','createWriteStream','out','basename','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','unlinkSync','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','status','end','offset','limit','undefined','count','set','Content-Range','json','reject','save','update','then','destroy','sendStatus','error','name','send','Users','map','TagIds','forEach','push','index','WhatsappInteraction','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','field','from','tools_tags','select','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','cm_contacts','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','t.id\x20=\x20it.TagId','expr','parseSearch','search','conditions','unreadMessages','`\x20=\x200','having','`\x20>\x200','Contact','operator','$substring','value','split','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','some','compact','isEmpty','where','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','clone','contactName','DESC','t.id\x20IN\x20?','resolve','WhatsappAccountId','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','i.WhatsappAccountId\x20IN\x20?','role','sequelize','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','rows','catch','show','includeAll','include','options','create','body','params','describe','addMessage','ids','omit','getMessages','findOne','WhatsappInteractionId','merge','format','YYYY-MM-DD\x20HH:mm:ss','WhatsappMessage','findAll','addTags','setTags','removeTags','download','unix','join','server','files','tmp','root','attachments','firstName','lastName','Attachment','Messages','direction','secret','WhatsappAccount','Owner','get','mkdirSync','Whatsapp','fullname','N.A.','closed','closedAt'];(function(_0x3920ea,_0x32d682){var _0x6cc56=function(_0x3d8376){while(--_0x3d8376){_0x3920ea['push'](_0x3920ea['shift']());}};_0x6cc56(++_0x32d682);}(_0xd1d4,0xfb));var _0x4d1d=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0xd1d4[_0x1ae5ab];return _0x1ce001;};'use strict';var emlformat=require(_0x4d1d('0x0'));var rimraf=require(_0x4d1d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4d1d('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4d1d('0x3'));var Mustache=require(_0x4d1d('0x4'));var util=require(_0x4d1d('0x5'));var path=require(_0x4d1d('0x6'));var sox=require(_0x4d1d('0x7'));var csv=require(_0x4d1d('0x8'));var ejs=require(_0x4d1d('0x9'));var fs=require('fs');var fs_extra=require(_0x4d1d('0xa'));var _=require(_0x4d1d('0xb'));var squel=require(_0x4d1d('0xc'));var crypto=require(_0x4d1d('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4d1d('0x8'));var querystring=require(_0x4d1d('0xe'));var Papa=require('papaparse');var Redis=require(_0x4d1d('0xf'));var authService=require(_0x4d1d('0x10'));var qs=require(_0x4d1d('0x11'));var as=require(_0x4d1d('0x12'));var pdf=require(_0x4d1d('0x13'));var hardwareService=require(_0x4d1d('0x14'));var logger=require(_0x4d1d('0x15'))(_0x4d1d('0x16'));var utils=require(_0x4d1d('0x17'));var config=require(_0x4d1d('0x18'));var licenseUtil=require(_0x4d1d('0x19'));var db=require(_0x4d1d('0x1a'))['db'];config[_0x4d1d('0x1b')]=_['defaults'](config[_0x4d1d('0x1b')],{'host':_0x4d1d('0x1c'),'port':0x18eb});var socket=require(_0x4d1d('0x1d'))(new Redis(config[_0x4d1d('0x1b')]));require('./whatsappInteraction.socket')['register'](socket);function respondWithStatusCode(_0x58ef11,_0x1e5897){_0x1e5897=_0x1e5897||0xcc;return function(_0x1db7a6){if(_0x1db7a6){return _0x58ef11['sendStatus'](_0x1e5897);}return _0x58ef11[_0x4d1d('0x1e')](_0x1e5897)[_0x4d1d('0x1f')]();};}function respondWithResult(_0x3c1f04,_0xe7c5da){_0xe7c5da=_0xe7c5da||0xc8;return function(_0x5d232d){if(_0x5d232d){return _0x3c1f04['status'](_0xe7c5da)['json'](_0x5d232d);}};}function respondWithFilteredResult(_0x45f981,_0x83eb5a){return function(_0x3bea29){if(_0x3bea29){var _0x38d465=typeof _0x83eb5a[_0x4d1d('0x20')]==='undefined'&&typeof _0x83eb5a[_0x4d1d('0x21')]===_0x4d1d('0x22');var _0x40250e=_0x3bea29[_0x4d1d('0x23')];var _0x10c894=_0x38d465?0x0:_0x83eb5a[_0x4d1d('0x20')];var _0x1a5dae=_0x38d465?_0x3bea29['count']:_0x83eb5a[_0x4d1d('0x20')]+_0x83eb5a['limit'];var _0x32089d;if(_0x1a5dae>=_0x40250e){_0x1a5dae=_0x40250e;_0x32089d=0xc8;}else{_0x32089d=0xce;}_0x45f981[_0x4d1d('0x1e')](_0x32089d);return _0x45f981[_0x4d1d('0x24')](_0x4d1d('0x25'),_0x10c894+'-'+_0x1a5dae+'/'+_0x40250e)[_0x4d1d('0x26')](_0x3bea29);}return null;};}function patchUpdates(_0x2e0b46){return function(_0x1a93e5){try{jsonpatch['apply'](_0x1a93e5,_0x2e0b46,!![]);}catch(_0x410916){return BPromise[_0x4d1d('0x27')](_0x410916);}return _0x1a93e5[_0x4d1d('0x28')]();};}function saveUpdates(_0x7b13a5,_0x2d060b){return function(_0x50e7b0){if(_0x50e7b0){return _0x50e7b0[_0x4d1d('0x29')](_0x7b13a5)[_0x4d1d('0x2a')](function(_0x33f17e){return _0x33f17e;});}return null;};}function removeEntity(_0x2a49a8,_0x20ac5b){return function(_0x5cf5f3){if(_0x5cf5f3){return _0x5cf5f3[_0x4d1d('0x2b')]()['then'](function(){_0x2a49a8[_0x4d1d('0x1e')](0xcc)[_0x4d1d('0x1f')]();});}};}function handleEntityNotFound(_0x3f672b,_0xc33dea){return function(_0x476ee3){if(!_0x476ee3){_0x3f672b[_0x4d1d('0x2c')](0x194);}return _0x476ee3;};}function handleError(_0x54e905,_0x666c88){_0x666c88=_0x666c88||0x1f4;return function(_0x322e0f){logger[_0x4d1d('0x2d')](_0x322e0f['stack']);if(_0x322e0f[_0x4d1d('0x2e')]){delete _0x322e0f[_0x4d1d('0x2e')];}_0x54e905['status'](_0x666c88)[_0x4d1d('0x2f')](_0x322e0f);};}function getInteractionUsers(_0x3298f4,_0x3bd19b){return new BPromise(function(_0x3400b3,_0x475773){try{if(_0x3bd19b[_0x3298f4['id']]){_0x3298f4[_0x4d1d('0x30')]=_[_0x4d1d('0x31')](_0x3bd19b[_0x3298f4['id']],function(_0x664a6e){return{'id':_0x664a6e['id'],'fullname':_0x664a6e['fullname']};});}}catch(_0x5118d1){_0x475773(_0x5118d1);}_0x3400b3(_0x3298f4);});}function getInteractionTags(_0x2276d3,_0x497472){return new BPromise(function(_0x51c501,_0x3cd88d){try{if(_0x2276d3['TagIds']){_0x2276d3['Tags']=[];_0x2276d3[_0x4d1d('0x32')]['split'](',')[_0x4d1d('0x33')](function(_0x5079e8){_0x2276d3['Tags'][_0x4d1d('0x34')](_0x497472[_0x5079e8]);});}delete _0x2276d3[_0x4d1d('0x32')];}catch(_0xfc40cc){_0x3cd88d(_0xfc40cc);}_0x51c501(_0x2276d3);});}function updateWhatsappInteraction(_0x1dbf43,_0x5b05a2,_0x4f15a7){return new BPromise(function(_0x2aa965,_0x2ef12c){return getInteractionUsers(_0x1dbf43,_0x4f15a7)[_0x4d1d('0x2a')](function(_0x10d509){return getInteractionTags(_0x10d509,_0x5b05a2);})[_0x4d1d('0x2a')](function(_0x11f638){_0x2aa965(_0x11f638);})['catch'](function(_0x9682e8){_0x2ef12c(_0x9682e8);});});}exports[_0x4d1d('0x35')]=function(_0xf306e4,_0x3332c3){var _0x15bd75={},_0x24bd80={},_0x5e3f8e={'count':0x0,'rows':[]};var _0x20c657=_[_0x4d1d('0x31')](db[_0x4d1d('0x36')][_0x4d1d('0x37')],function(_0x5579ca){return{'name':_0x5579ca[_0x4d1d('0x38')],'type':_0x5579ca[_0x4d1d('0x39')]['key']};});_0x24bd80['model']=_[_0x4d1d('0x31')](_0x20c657,_0x4d1d('0x2e'));_0x24bd80['query']=_[_0x4d1d('0x3a')](_0xf306e4[_0x4d1d('0x3b')]);_0x24bd80[_0x4d1d('0x3c')]=_[_0x4d1d('0x3d')](_0x24bd80[_0x4d1d('0x3e')],_0x24bd80[_0x4d1d('0x3b')]);_0x15bd75[_0x4d1d('0x3f')]=_[_0x4d1d('0x3d')](_0x24bd80[_0x4d1d('0x3e')],qs[_0x4d1d('0x40')](_0xf306e4[_0x4d1d('0x3b')]['fields']));_0x15bd75[_0x4d1d('0x3f')]=_0x15bd75[_0x4d1d('0x3f')][_0x4d1d('0x41')]?_0x15bd75['attributes']:_0x24bd80[_0x4d1d('0x3e')];if(!_0xf306e4[_0x4d1d('0x3b')][_0x4d1d('0x42')](_0x4d1d('0x43'))){_0x15bd75[_0x4d1d('0x21')]=qs[_0x4d1d('0x21')](_0xf306e4['query'][_0x4d1d('0x21')]);_0x15bd75[_0x4d1d('0x20')]=qs[_0x4d1d('0x20')](_0xf306e4['query']['offset']);}_0x15bd75[_0x4d1d('0x44')]=qs['sort'](_0xf306e4[_0x4d1d('0x3b')][_0x4d1d('0x45')]);_0x15bd75['where']=qs['filters'](_[_0x4d1d('0x46')](_0xf306e4[_0x4d1d('0x3b')],_0x24bd80[_0x4d1d('0x3c')]),_0x20c657);var _0x206993=[];var _0xc8e512=squel['select']()[_0x4d1d('0x47')]('id')[_0x4d1d('0x47')](_0x4d1d('0x2e'))[_0x4d1d('0x47')]('color')[_0x4d1d('0x48')](_0x4d1d('0x49'));var _0x1a153c=squel[_0x4d1d('0x4a')]()[_0x4d1d('0x47')](_0x4d1d('0x4b'))['field'](_0x4d1d('0x4c'))[_0x4d1d('0x47')](_0x4d1d('0x4d'))[_0x4d1d('0x48')](_0x4d1d('0x4e'),'ui')[_0x4d1d('0x4f')](_0x4d1d('0x50'),'u',_0x4d1d('0x51'));var _0x57a7ed=squel[_0x4d1d('0x4a')]()['from'](_0x4d1d('0x52'),'i')[_0x4d1d('0x4f')](_0x4d1d('0x53'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x4d1d('0x50'),'o',_0x4d1d('0x54'))['left_join'](_0x4d1d('0x55'),'a',_0x4d1d('0x56'))[_0x4d1d('0x4f')](_0x4d1d('0x57'),'me',_0x4d1d('0x58'))['left_join'](_0x4d1d('0x59'),'it','it.WhatsappInteractionId\x20=\x20i.id')['left_join'](_0x4d1d('0x49'),'t',_0x4d1d('0x5a'));var _0xa218ee=squel[_0x4d1d('0x5b')]();var _0x3cd194=[];var _0xd60459=squel['expr']();var _0x2f9da0;if(_0xf306e4[_0x4d1d('0x3b')]['search']){_0x2f9da0=as[_0x4d1d('0x5c')](_0xf306e4[_0x4d1d('0x3b')][_0x4d1d('0x5d')]);var _0x1f91bc=_0x2f9da0['sqlOperator'];for(var _0x30378f=0x0;_0x30378f<_0x2f9da0[_0x4d1d('0x5e')][_0x4d1d('0x41')];_0x30378f++){var _0x12b9ce=_0x2f9da0[_0x4d1d('0x5e')][_0x30378f];var _0x61acde='i';var _0x58a58c=_['find'](_0x20c657,[_0x4d1d('0x2e'),_0x12b9ce[_0x4d1d('0x47')]]);if(!_0x58a58c){switch(_0x12b9ce[_0x4d1d('0x47')]){case _0x4d1d('0x5f'):if(_0x12b9ce['value']==0x1){_0x57a7ed['having']('`'+_0x12b9ce[_0x4d1d('0x47')]+_0x4d1d('0x60'));}else{_0x57a7ed[_0x4d1d('0x61')]('`'+_0x12b9ce[_0x4d1d('0x47')]+_0x4d1d('0x62'));}break;case _0x4d1d('0x63'):if(_0x12b9ce[_0x4d1d('0x64')]===_0x4d1d('0x65')){if(_0x12b9ce[_0x4d1d('0x66')][_0x4d1d('0x67')]('\x20')[_0x4d1d('0x41')]>0x1){_0xa218ee[_0x1f91bc]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x4d1d('0x68')](_0x12b9ce[_0x4d1d('0x66')]),null);}else{var _0x2537b1='%'+_0x12b9ce[_0x4d1d('0x66')]+'%';_0xa218ee[_0x1f91bc](_0x4d1d('0x69'),_0x2537b1,_0x2537b1,_0x2537b1);}}else{_0x58a58c=_[_0x4d1d('0x6a')](_0x20c657,[_0x4d1d('0x2e'),_0x4d1d('0x6b')]);_0x12b9ce['field']=_0x4d1d('0x6b');_0x22cc82=as[_0x4d1d('0x6c')](_0x61acde,_0x58a58c['type'],_0x12b9ce);_0xa218ee[_0x1f91bc](_0x22cc82[_0x4d1d('0x6d')],_0x22cc82[_0x4d1d('0x66')][_0x4d1d('0x6e')],_0x22cc82['value'][_0x4d1d('0x1f')]);}break;case _0x4d1d('0x6f'):var _0x268ed3=_0x12b9ce[_0x4d1d('0x66')][_0x4d1d('0x67')](',')[_0x4d1d('0x31')](function(_0x55ce2f){return Number(_0x55ce2f);});_0x268ed3['forEach'](function(_0x2b049e){_0xd60459['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2b049e+',%');});_0x3cd194=_[_0x4d1d('0x70')](_0x3cd194,_0x268ed3);break;case _0x4d1d('0x71'):if(_0x12b9ce[_0x4d1d('0x64')]===_0x4d1d('0x65')){_0xa218ee[_0x1f91bc](_0x4d1d('0x72'),'%'+_0x12b9ce['value']+'%',null);}else{_0x58a58c=_[_0x4d1d('0x6a')](_0x20c657,[_0x4d1d('0x2e'),_0x4d1d('0x73')]);_0x12b9ce['field']=_0x4d1d('0x73');_0x22cc82=as[_0x4d1d('0x6c')](_0x61acde,_0x58a58c[_0x4d1d('0x39')],_0x12b9ce);_0xa218ee[_0x1f91bc](_0x22cc82[_0x4d1d('0x6d')],_0x22cc82[_0x4d1d('0x66')][_0x4d1d('0x6e')],_0x22cc82[_0x4d1d('0x66')][_0x4d1d('0x1f')]);}break;case'body':_0x22cc82=as[_0x4d1d('0x6c')]('me',null,_0x12b9ce);_0xa218ee[_0x1f91bc](_0x22cc82[_0x4d1d('0x6d')],_0x22cc82[_0x4d1d('0x66')][_0x4d1d('0x6e')],_0x22cc82[_0x4d1d('0x66')][_0x4d1d('0x1f')]);break;}}else{var _0x22cc82=as[_0x4d1d('0x6c')](_0x61acde,_0x58a58c[_0x4d1d('0x39')],_0x12b9ce);_0xa218ee[_0x1f91bc](_0x22cc82['text'],_0x22cc82['value']['start'],_0x22cc82[_0x4d1d('0x66')]['end']);}}}else{var _0x4546fc=_(_0xf306e4['query'])[_0x4d1d('0x3a')]()[_0x4d1d('0x31')](function(_0x202a6a){return _[_0x4d1d('0x74')](_0x20c657,[_0x4d1d('0x2e'),_0x202a6a])?_0x202a6a:undefined;})[_0x4d1d('0x75')]()['value']();if(!_[_0x4d1d('0x76')](_0x4546fc)){_0x4546fc[_0x4d1d('0x33')](function(_0x5ea7cb){if(_0x5ea7cb==='WhatsappAccountId'){_0x57a7ed[_0x4d1d('0x77')]('i.WhatsappAccountId\x20IN\x20?',[][_0x4d1d('0x78')](_0xf306e4[_0x4d1d('0x3b')][_0x5ea7cb]));}else if(_0x5ea7cb===_0x4d1d('0x79')){var _0x5a3c36=JSON[_0x4d1d('0x7a')](_0xf306e4[_0x4d1d('0x3b')][_0x5ea7cb])[_0x4d1d('0x7b')];var _0x130036=JSON['parse'](_0xf306e4[_0x4d1d('0x3b')][_0x5ea7cb])[_0x4d1d('0x7c')];_0x57a7ed[_0x4d1d('0x77')](_0x4d1d('0x7d'),_0x5a3c36,_0x130036);}else{if(_0xf306e4[_0x4d1d('0x3b')][_0x5ea7cb]===_0x4d1d('0x7e')){_0x57a7ed[_0x4d1d('0x77')]('i.'+_0x5ea7cb+_0x4d1d('0x7f'));}else{_0x57a7ed[_0x4d1d('0x77')]('i.'+_0x5ea7cb+_0x4d1d('0x80'),_0xf306e4[_0x4d1d('0x3b')][_0x5ea7cb]);}}});}if(_0xf306e4[_0x4d1d('0x3b')]['read']){if(_0xf306e4['query'][_0x4d1d('0x81')]==0x1){_0x57a7ed['having'](_0x4d1d('0x82'));}else{_0x57a7ed[_0x4d1d('0x61')](_0x4d1d('0x83'));}}if(_0xf306e4[_0x4d1d('0x3b')][_0x4d1d('0x84')]){_0x3cd194=_[_0x4d1d('0x85')](_0xf306e4[_0x4d1d('0x3b')]['tag'])?_0xf306e4[_0x4d1d('0x3b')][_0x4d1d('0x84')]:new Array(_0xf306e4[_0x4d1d('0x3b')]['tag']);_0x3cd194[_0x4d1d('0x33')](function(_0x1ef51f){_0xd60459['or'](_0x4d1d('0x86'),'%,'+_0x1ef51f+',%');});}if(_0xf306e4['query']['filter']){var _0x112db7=_0xf306e4['query'][_0x4d1d('0x87')][_0x4d1d('0x88')]('\x5c','\x5c\x5c')[_0x4d1d('0x88')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x112db7)){_0xa218ee['or'](_0x4d1d('0x89'),_0x112db7+'%')['or'](_0x4d1d('0x8a'),_0x112db7+'%');}else{_0xa218ee['or'](_0x4d1d('0x8b'),qs['getFullTextValue'](_0x112db7))['or'](_0x4d1d('0x8c'),_0x112db7+'%');}}}_0x57a7ed[_0x4d1d('0x77')](_0xa218ee);_0x57a7ed['group'](_0x4d1d('0x8d'));var _0x5dad19={'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]};var _0x532ef3=_0x57a7ed[_0x4d1d('0x8e')]();_0x532ef3[_0x4d1d('0x47')](_0x4d1d('0x8d'));_0x532ef3[_0x4d1d('0x47')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x4d1d('0x5f'));if(_0x15bd75[_0x4d1d('0x44')]){_0x15bd75['order'][_0x4d1d('0x33')](function(_0x1c0791){var _0x52fe31=_0x1c0791[0x0]===_0x4d1d('0x8f')?_0x1c0791[0x0]:'i.'+_0x1c0791[0x0];_0x57a7ed['order'](_0x52fe31,_0x1c0791[0x1]===_0x4d1d('0x90')?![]:!![]);});}if(!_[_0x4d1d('0x76')](_0x3cd194)){_0x57a7ed[_0x4d1d('0x61')](_0xd60459);_0x532ef3[_0x4d1d('0x77')](_0x4d1d('0x91'),_0x3cd194);}BPromise[_0x4d1d('0x92')]()[_0x4d1d('0x2a')](function(){if(!_0x2f9da0){if(_0xf306e4[_0x4d1d('0x3b')][_0x4d1d('0x93')])return;_0x532ef3[_0x4d1d('0x77')](_0x4d1d('0x94'));_0x57a7ed['where'](_0x4d1d('0x94'));return;}if(_0xf306e4[_0x4d1d('0x95')]['role']!==_0x4d1d('0x96'))return;return _0xf306e4['user'][_0x4d1d('0x97')]({'attributes':['id'],'raw':!![]})['then'](function(_0x596739){if(_[_0x4d1d('0x76')](_0x596739)){_0x532ef3[_0x4d1d('0x77')](_0x4d1d('0x98'));_0x57a7ed[_0x4d1d('0x77')](_0x4d1d('0x98'));}else{_0x532ef3[_0x4d1d('0x77')]('i.WhatsappAccountId\x20IN\x20?',_[_0x4d1d('0x31')](_0x596739,'id'));_0x57a7ed['where'](_0x4d1d('0x99'),_['map'](_0x596739,'id'));}});})[_0x4d1d('0x2a')](function(){if(_0xf306e4[_0x4d1d('0x95')][_0x4d1d('0x9a')]===_0x4d1d('0x96')&&!_0x2f9da0&&!_0xf306e4[_0x4d1d('0x3b')][_0x4d1d('0x93')])return[];return db[_0x4d1d('0x9b')][_0x4d1d('0x3b')](_0x532ef3['toString'](),_0x5dad19);})[_0x4d1d('0x2a')](function(_0x493046){_0x5e3f8e[_0x4d1d('0x23')]=_0x493046['length'];if(_0x5e3f8e[_0x4d1d('0x23')]===0x0)return[];return db[_0x4d1d('0x9b')][_0x4d1d('0x3b')](_0xc8e512[_0x4d1d('0x9c')](),_0x5dad19)[_0x4d1d('0x2a')](function(_0x4ab25d){_0x206993=_[_0x4d1d('0x9d')](_0x4ab25d,'id');_0x5dad19=_['merge'](_0x5dad19,{'model':db[_0x4d1d('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xf306e4[_0x4d1d('0x3b')][_0x4d1d('0x40')]){_0x15bd75['attributes'][_0x4d1d('0x33')](function(_0x4a0c18){_0x57a7ed[_0x4d1d('0x47')]('i.'+_0x4a0c18);});}else{_0x57a7ed['field'](_0x4d1d('0x9e'),_0x4d1d('0x5f'));_0x57a7ed[_0x4d1d('0x47')](_0x4d1d('0x9f'),_0x4d1d('0xa0'));_0x57a7ed['field'](_0x4d1d('0xa1'),_0x4d1d('0xa2'));_0x57a7ed['field'](_0x4d1d('0xa3'),'contactName');_0x57a7ed[_0x4d1d('0x47')](_0x4d1d('0xa4'));_0x57a7ed[_0x4d1d('0x47')](_0x4d1d('0xa5'),_0x4d1d('0xa6'));_0x57a7ed[_0x4d1d('0x47')]('c.lastName',_0x4d1d('0xa7'));_0x57a7ed[_0x4d1d('0x47')](_0x4d1d('0xa8'),'Contact.email');_0x57a7ed[_0x4d1d('0x47')]('c.phone','Contact.phone');_0x57a7ed[_0x4d1d('0x47')](_0x4d1d('0xa9'),_0x4d1d('0xaa'));_0x57a7ed[_0x4d1d('0x47')](_0x4d1d('0xab'),_0x4d1d('0xac'));_0x57a7ed[_0x4d1d('0x47')](_0x4d1d('0xad'),_0x4d1d('0xae'));_0x57a7ed[_0x4d1d('0x47')]('o.internal',_0x4d1d('0xaf'));_0x57a7ed[_0x4d1d('0x47')](_0x4d1d('0xb0'),'TagIds');}if(_0x15bd75[_0x4d1d('0x21')])_0x57a7ed[_0x4d1d('0x21')](_0x15bd75['limit']);if(_0x15bd75['offset'])_0x57a7ed[_0x4d1d('0x20')](_0x15bd75[_0x4d1d('0x20')]);return db['sequelize']['query'](_0x57a7ed[_0x4d1d('0x9c')](),_0x5dad19);})[_0x4d1d('0x2a')](function(_0x4c4dfc){if(_0x4c4dfc[_0x4d1d('0x41')]>0x0)_0x1a153c['where'](_0x4d1d('0xb1'),_['map'](_0x4c4dfc,'id'));return db[_0x4d1d('0x9b')][_0x4d1d('0x3b')](_0x1a153c[_0x4d1d('0x9c')](),_0x5dad19)[_0x4d1d('0x2a')](function(_0x4f840c){var _0x4883c8=_['groupBy'](_0x4f840c,'WhatsappInteractionId');var _0x47656e=[];_0x4c4dfc['forEach'](function(_0x472a23){_0x47656e[_0x4d1d('0x34')](updateWhatsappInteraction(_0x472a23,_0x206993,_0x4883c8));});return BPromise['all'](_0x47656e);});});})[_0x4d1d('0x2a')](function(_0x145327){_0x5e3f8e[_0x4d1d('0xb2')]=_0x145327;return _0x5e3f8e;})[_0x4d1d('0x2a')](respondWithFilteredResult(_0x3332c3,_0x15bd75))[_0x4d1d('0xb3')](handleError(_0x3332c3,null));};exports[_0x4d1d('0xb4')]=function(_0x28b064,_0x89c52b){var _0x10d275={'raw':![],'where':{'id':_0x28b064['params']['id']}},_0x328a15={};_0x328a15[_0x4d1d('0x3e')]=_[_0x4d1d('0x3a')](db[_0x4d1d('0x36')][_0x4d1d('0x37')]);_0x328a15[_0x4d1d('0x3b')]=_[_0x4d1d('0x3a')](_0x28b064[_0x4d1d('0x3b')]);_0x328a15[_0x4d1d('0x3c')]=_[_0x4d1d('0x3d')](_0x328a15[_0x4d1d('0x3e')],_0x328a15[_0x4d1d('0x3b')]);_0x10d275[_0x4d1d('0x3f')]=_[_0x4d1d('0x3d')](_0x328a15['model'],qs[_0x4d1d('0x40')](_0x28b064[_0x4d1d('0x3b')][_0x4d1d('0x40')]));_0x10d275[_0x4d1d('0x3f')]=_0x10d275[_0x4d1d('0x3f')]['length']?_0x10d275['attributes']:_0x328a15['model'];if(_0x28b064['query'][_0x4d1d('0xb5')]){_0x10d275[_0x4d1d('0xb6')]=[{'all':!![]}];}_0x10d275=_['merge']({},_0x10d275,_0x28b064[_0x4d1d('0xb7')]);return db[_0x4d1d('0x36')][_0x4d1d('0x6a')](_0x10d275)[_0x4d1d('0x2a')](handleEntityNotFound(_0x89c52b,null))['then'](respondWithResult(_0x89c52b,null))['catch'](handleError(_0x89c52b,null));};exports[_0x4d1d('0xb8')]=function(_0x184447,_0x30b323){return db[_0x4d1d('0x36')][_0x4d1d('0xb8')](_0x184447[_0x4d1d('0xb9')],{})[_0x4d1d('0x2a')](respondWithResult(_0x30b323,0xc9))['catch'](handleError(_0x30b323,null));};exports['update']=function(_0x44292c,_0x447a25){if(_0x44292c[_0x4d1d('0xb9')]['id']){delete _0x44292c[_0x4d1d('0xb9')]['id'];}return db[_0x4d1d('0x36')]['find']({'where':{'id':_0x44292c[_0x4d1d('0xba')]['id']}})[_0x4d1d('0x2a')](handleEntityNotFound(_0x447a25,null))['then'](saveUpdates(_0x44292c[_0x4d1d('0xb9')],null))[_0x4d1d('0x2a')](respondWithResult(_0x447a25,null))['catch'](handleError(_0x447a25,null));};exports[_0x4d1d('0x2b')]=function(_0x35c563,_0x312080){return db[_0x4d1d('0x36')]['find']({'where':{'id':_0x35c563[_0x4d1d('0xba')]['id']}})['then'](handleEntityNotFound(_0x312080,null))[_0x4d1d('0x2a')](removeEntity(_0x312080,null))[_0x4d1d('0xb3')](handleError(_0x312080,null));};exports['describe']=function(_0x1a405c,_0x2e6148){return db[_0x4d1d('0x36')][_0x4d1d('0xbb')]()[_0x4d1d('0x2a')](respondWithResult(_0x2e6148,null))[_0x4d1d('0xb3')](handleError(_0x2e6148,null));};exports[_0x4d1d('0xbc')]=function(_0x35adbd,_0xa843b0,_0x5daab2){return db['WhatsappMessage']['find']({'where':{'id':_0x35adbd[_0x4d1d('0xba')]['id']}})[_0x4d1d('0x2a')](handleEntityNotFound(_0xa843b0,null))[_0x4d1d('0x2a')](function(_0x2df59e){if(_0x2df59e){return _0x2df59e[_0x4d1d('0xbc')](_0x35adbd[_0x4d1d('0xb9')][_0x4d1d('0xbd')],_[_0x4d1d('0xbe')](_0x35adbd[_0x4d1d('0xb9')],[_0x4d1d('0xbd'),'id'])||{});}})[_0x4d1d('0x2a')](respondWithResult(_0xa843b0,null))[_0x4d1d('0xb3')](handleError(_0xa843b0,null));};exports[_0x4d1d('0xbf')]=function(_0x364b23,_0xc8c458,_0x4b37eb){var _0x45f3f3={'raw':![],'where':{}};var _0x6349a0={};var _0x3abc03={'count':0x0,'rows':[]};return db[_0x4d1d('0x36')][_0x4d1d('0xc0')]({'where':{'id':_0x364b23[_0x4d1d('0xba')]['id']}})['then'](handleEntityNotFound(_0xc8c458,null))[_0x4d1d('0x2a')](function(_0x240a78){if(_0x240a78){_0x6349a0['model']=_['keys'](db['WhatsappMessage'][_0x4d1d('0x37')]);_0x6349a0[_0x4d1d('0x3b')]=_[_0x4d1d('0x3a')](_0x364b23[_0x4d1d('0x3b')]);_0x6349a0[_0x4d1d('0x3c')]=_[_0x4d1d('0x3d')](_0x6349a0[_0x4d1d('0x3e')],_0x6349a0['query']);_0x45f3f3[_0x4d1d('0x3f')]=_['intersection'](_0x6349a0[_0x4d1d('0x3e')],qs[_0x4d1d('0x40')](_0x364b23[_0x4d1d('0x3b')]['fields']));_0x45f3f3['attributes']=_0x45f3f3['attributes'][_0x4d1d('0x41')]?_0x45f3f3[_0x4d1d('0x3f')]:_0x6349a0[_0x4d1d('0x3e')];if(!_0x364b23[_0x4d1d('0x3b')][_0x4d1d('0x42')](_0x4d1d('0x43'))){_0x45f3f3[_0x4d1d('0x21')]=qs[_0x4d1d('0x21')](_0x364b23['query'][_0x4d1d('0x21')]);_0x45f3f3[_0x4d1d('0x20')]=qs[_0x4d1d('0x20')](_0x364b23[_0x4d1d('0x3b')][_0x4d1d('0x20')]);}_0x45f3f3[_0x4d1d('0x44')]=qs['sort'](_0x364b23[_0x4d1d('0x3b')][_0x4d1d('0x45')]);_0x45f3f3[_0x4d1d('0x77')]=qs['filters'](_[_0x4d1d('0x46')](_0x364b23['query'],_0x6349a0['filters']));_0x45f3f3['where'][_0x4d1d('0xc1')]=_0x240a78['id'];if(_0x364b23['query'][_0x4d1d('0x87')]){_0x45f3f3[_0x4d1d('0x77')]=_[_0x4d1d('0xc2')](_0x45f3f3[_0x4d1d('0x77')],{'$or':_['map'](_0x45f3f3['attributes'],function(_0x5cac86){var _0x41f474={};_0x41f474[_0x5cac86]={'$like':'%'+_0x364b23[_0x4d1d('0x3b')]['filter']+'%'};return _0x41f474;})});}if(_0x364b23['query']['$gte']){var _0x4f2d8f=_0x364b23[_0x4d1d('0x3b')][_0x4d1d('0x7b')][_0x4d1d('0x67')](',');var _0x567a15={};_0x567a15[_0x4f2d8f[0x0]]={'$gte':moment(_0x4f2d8f[0x1])[_0x4d1d('0xc3')](_0x4d1d('0xc4'))};_0x45f3f3[_0x4d1d('0x77')]=_[_0x4d1d('0xc2')](_0x45f3f3['where'],_0x567a15);}_0x45f3f3=_[_0x4d1d('0xc2')]({},_0x45f3f3,_0x364b23[_0x4d1d('0xb7')]);return db[_0x4d1d('0xc5')][_0x4d1d('0x23')]({'where':_0x45f3f3['where']})['then'](function(_0xc21e33){_0x3abc03[_0x4d1d('0x23')]=_0xc21e33;if(_0x364b23[_0x4d1d('0x3b')][_0x4d1d('0xb5')]){_0x45f3f3[_0x4d1d('0xb6')]=[{'all':!![]}];}return db['WhatsappMessage'][_0x4d1d('0xc6')](_0x45f3f3);})[_0x4d1d('0x2a')](function(_0x26fac0){_0x3abc03[_0x4d1d('0xb2')]=_0x26fac0;return _0x3abc03;});}})[_0x4d1d('0x2a')](respondWithFilteredResult(_0xc8c458,_0x45f3f3))['catch'](handleError(_0xc8c458,null));};exports[_0x4d1d('0xc7')]=function(_0x74809d,_0x3b298a,_0x2a3bc8){return db[_0x4d1d('0x36')][_0x4d1d('0x6a')]({'where':{'id':_0x74809d['params']['id']}})['then'](handleEntityNotFound(_0x3b298a,null))[_0x4d1d('0x2a')](function(_0x5afa65){if(_0x5afa65){return _0x5afa65[_0x4d1d('0xc8')](_0x74809d[_0x4d1d('0xb9')][_0x4d1d('0xbd')],_[_0x4d1d('0xbe')](_0x74809d[_0x4d1d('0xb9')],[_0x4d1d('0xbd'),'id'])||{})['spread'](function(){return db[_0x4d1d('0x6f')][_0x4d1d('0xc6')]({'attributes':['id',_0x4d1d('0x2e'),'color'],'where':{'id':_0x74809d[_0x4d1d('0xb9')]['ids']}});})[_0x4d1d('0x2a')](function(_0x5b90c4){socket['emit']('whatsappInteractionTags:save',{'id':Number(_0x74809d[_0x4d1d('0xba')]['id']),'tags':_0x5b90c4||[]});return{'id':Number(_0x74809d[_0x4d1d('0xba')]['id']),'tags':_0x5b90c4||[]};});}})[_0x4d1d('0x2a')](respondWithResult(_0x3b298a,null))[_0x4d1d('0xb3')](handleError(_0x3b298a,null));};exports[_0x4d1d('0xc9')]=function(_0xba64b1,_0xd0b9fb,_0x434ea7){return db['WhatsappInteraction']['find']({'where':{'id':_0xba64b1[_0x4d1d('0xba')]['id']}})['then'](handleEntityNotFound(_0xd0b9fb,null))['then'](function(_0x50b323){if(_0x50b323){return _0x50b323[_0x4d1d('0xc9')](_0xba64b1[_0x4d1d('0x3b')][_0x4d1d('0xbd')]);}})[_0x4d1d('0x2a')](respondWithStatusCode(_0xd0b9fb,null))[_0x4d1d('0xb3')](handleError(_0xd0b9fb,null));};exports[_0x4d1d('0xca')]=function(_0x1ef80f,_0x344d22){var _0x4d0b6e=moment()[_0x4d1d('0xcb')]()['toString']();var _0x14f0c1=path[_0x4d1d('0xcc')](config['root'],_0x4d1d('0xcd'),_0x4d1d('0xce'),_0x4d1d('0xcf'));var _0x573a3f=path[_0x4d1d('0xcc')](config[_0x4d1d('0xd0')],'server',_0x4d1d('0xce'),_0x4d1d('0xd1'));var _0x4c0ad5=path[_0x4d1d('0xcc')](_0x14f0c1,_0x4d0b6e);var _0x56fdc3=util[_0x4d1d('0xc3')]('transcript-%d-%s.zip',_0x1ef80f[_0x4d1d('0xba')]['id'],_0x4d0b6e);var _0x46c542=path[_0x4d1d('0xcc')](_0x14f0c1,_0x56fdc3);var _0x526445=[];_0x526445[_0x4d1d('0x34')]({'model':db['User'],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x526445[_0x4d1d('0x34')]({'model':db['CmContact'],'as':_0x4d1d('0x63'),'attributes':['id',_0x4d1d('0xd2'),_0x4d1d('0xd3')],'raw':!![]});if(_0x1ef80f[_0x4d1d('0x3b')][_0x4d1d('0xd1')]){_0x526445[_0x4d1d('0x34')]({'model':db['Attachment'],'as':_0x4d1d('0xd4'),'raw':!![]});}var _0x149df1=[{'model':db[_0x4d1d('0xc5')],'as':_0x4d1d('0xd5'),'attributes':['id',_0x4d1d('0xb9'),_0x4d1d('0x79'),_0x4d1d('0xd6'),_0x4d1d('0xd7'),'read'],'include':_0x526445}];_0x149df1[_0x4d1d('0x34')]({'model':db[_0x4d1d('0xd8')],'as':'Account','attributes':['id',_0x4d1d('0x2e')]});_0x149df1['push']({'model':db[_0x4d1d('0x71')],'as':_0x4d1d('0xd9'),'attributes':['id','fullname']});return db[_0x4d1d('0x36')][_0x4d1d('0x6a')]({'where':{'id':_0x1ef80f['params']['id']},'include':_0x149df1})['then'](handleEntityNotFound(_0x344d22,null))[_0x4d1d('0x2a')](function(_0x49bb26){if(_0x49bb26){var _0x85dcb5=_0x49bb26[_0x4d1d('0xda')]({'plain':!![]});fs[_0x4d1d('0xdb')](_0x4c0ad5);var _0x1b2f61={'channel':_0x4d1d('0xdc'),'account':_0x85dcb5['Account'][_0x4d1d('0x2e')],'agent':_0x85dcb5[_0x4d1d('0xd9')]?_0x85dcb5[_0x4d1d('0xd9')][_0x4d1d('0xdd')]:_0x4d1d('0xde'),'createdAt':moment(_0x85dcb5[_0x4d1d('0x79')])[_0x4d1d('0xc3')](_0x4d1d('0xc4'))[_0x4d1d('0x9c')](),'closedAt':_0x85dcb5[_0x4d1d('0xdf')]?moment(_0x85dcb5[_0x4d1d('0xe0')])['format'](_0x4d1d('0xc4'))[_0x4d1d('0x9c')]():'','disposition':_0x85dcb5[_0x4d1d('0xe1')],'messages':_(_0x85dcb5[_0x4d1d('0xd5')])[_0x4d1d('0x87')]({'secret':![]})['map'](function(_0x5a7248){if(_0x5a7248['Attachment']){var _0x6f7c6=path['join'](_0x573a3f,_0x5a7248[_0x4d1d('0xd4')]['basename']);if(fs[_0x4d1d('0xe2')](_0x6f7c6)){fs[_0x4d1d('0xe3')](_0x6f7c6)[_0x4d1d('0xe4')](fs[_0x4d1d('0xe5')](path[_0x4d1d('0xcc')](_0x4c0ad5,_0x5a7248[_0x4d1d('0xd4')]['basename'])));}}return{'date':moment(_0x5a7248['createdAt'])[_0x4d1d('0xc3')](_0x4d1d('0xc4'))[_0x4d1d('0x9c')](),'sender':_0x5a7248[_0x4d1d('0xd6')]===_0x4d1d('0xe6')?_0x5a7248[_0x4d1d('0x71')]?_0x5a7248[_0x4d1d('0x71')][_0x4d1d('0xdd')]:'System':_0x5a7248[_0x4d1d('0x63')][_0x4d1d('0xd2')]+(_0x5a7248[_0x4d1d('0x63')][_0x4d1d('0xd3')]?'\x20'+_0x5a7248[_0x4d1d('0x63')][_0x4d1d('0xd3')]:''),'body':_0x5a7248['Attachment']?_0x5a7248[_0x4d1d('0xd4')][_0x4d1d('0xe7')]:_0x5a7248[_0x4d1d('0xb9')],'direction':_0x5a7248[_0x4d1d('0xd6')]==='out'?'A':'C','secret':_0x5a7248[_0x4d1d('0xd7')],'read':_0x5a7248['read'],'attachment':_0x5a7248[_0x4d1d('0xd4')]};})[_0x4d1d('0x66')]()};return ejs[_0x4d1d('0xe8')](path[_0x4d1d('0xcc')](config[_0x4d1d('0xd0')],_0x4d1d('0xcd'),_0x4d1d('0xe9'),_0x4d1d('0xea')),{'interaction':_0x1b2f61})[_0x4d1d('0x2a')](function(_0x1770ce){var _0x51d3a5=path[_0x4d1d('0xcc')](_0x4c0ad5,_0x4d1d('0xeb')+_0x85dcb5['id']+'-'+_0x4d0b6e+_0x4d1d('0xec'));var _0x38c72a={'path':_0x51d3a5,'channel':'Whatsapp','interactionId':_0x85dcb5['id']};return pdf['createPdfFromHTML'](_0x1770ce,_0x38c72a);})[_0x4d1d('0x2a')](function(){return new BPromise(function(_0x346e1e,_0x8dca2a){zipdir(_0x4c0ad5,{'saveTo':_0x46c542},function(_0x472188,_0x310505){if(_0x472188)return _0x8dca2a(_0x472188);return _0x346e1e(_0x310505);});})[_0x4d1d('0x2a')](function(){return new BPromise(function(_0x4c3df6,_0x598328){rimraf(_0x4c0ad5,function(_0x3f8319){if(_0x3f8319)_0x598328(_0x3f8319);return _0x4c3df6();});});})[_0x4d1d('0x2a')](function(){return _0x344d22['download'](_0x46c542,_0x56fdc3,function(_0x1360c9){if(_0x1360c9){console['log']('err',_0x1360c9);}else{fs[_0x4d1d('0xed')](_0x46c542);}});});});}else{return _0x344d22[_0x4d1d('0x2c')](0xc8);}})[_0x4d1d('0xb3')](handleError(_0x344d22,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index b1dca43..04ede1d 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 _0x26bc=['remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','save','update'];(function(_0x287a47,_0x2f731c){var _0x3fb726=function(_0xbedc33){while(--_0xbedc33){_0x287a47['push'](_0x287a47['shift']());}};_0x3fb726(++_0x2f731c);}(_0x26bc,0x162));var _0xc26b=function(_0x2a1d7b,_0x2baf66){_0x2a1d7b=_0x2a1d7b-0x0;var _0x24187b=_0x26bc[_0x2a1d7b];return _0x24187b;};'use strict';var EventEmitter=require(_0xc26b('0x0'));var WhatsappInteraction=require(_0xc26b('0x1'))['db'][_0xc26b('0x2')];var WhatsappMessage=require(_0xc26b('0x1'))['db'][_0xc26b('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc26b('0x4'),'afterUpdate':_0xc26b('0x5'),'afterDestroy':_0xc26b('0x6')};function emitEvent(_0x4d8d28){return function(_0xdd0a64,_0x5c87f7,_0x299ad8){_0xdd0a64[_0xc26b('0x7')]({'attributes':['id'],'raw':!![]})[_0xc26b('0x8')](function(_0x5c2f6f){_0xdd0a64[_0xc26b('0x9')](_0xc26b('0xa'),_0x5c2f6f[_0xc26b('0xb')](function(_0x15cfa5){return{'id':_0x15cfa5['id']};}));return WhatsappMessage[_0xc26b('0xc')]({'where':{'WhatsappInteractionId':_0xdd0a64['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc26b('0x8')](function(_0x22af41){_0xdd0a64[_0xc26b('0x9')](_0xc26b('0xd'),_0x22af41[_0xc26b('0xe')]);WhatsappInteractionEvents['emit'](_0x4d8d28+':'+_0xdd0a64['id'],_0xdd0a64);WhatsappInteractionEvents[_0xc26b('0xf')](_0x4d8d28,_0xdd0a64);_0x299ad8(null);})[_0xc26b('0x10')](_0x299ad8(null));};}for(var e in events){if(events[_0xc26b('0x11')](e)){var event=events[e];WhatsappInteraction[_0xc26b('0x12')](e,emitEvent(event));}}module[_0xc26b('0x13')]=WhatsappInteractionEvents; \ No newline at end of file +var _0xadcc=['WhatsappInteraction','../../mysqldb','WhatsappMessage','setMaxListeners','save','getUsers','then','setDataValue','Users','map','findAll','length','emit','catch','hasOwnProperty','hook','events'];(function(_0x1865cf,_0x53eca7){var _0x2e48d6=function(_0x120671){while(--_0x120671){_0x1865cf['push'](_0x1865cf['shift']());}};_0x2e48d6(++_0x53eca7);}(_0xadcc,0x76));var _0xcadc=function(_0x5e5e48,_0x1e4059){_0x5e5e48=_0x5e5e48-0x0;var _0x21e617=_0xadcc[_0x5e5e48];return _0x21e617;};'use strict';var EventEmitter=require(_0xcadc('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0xcadc('0x1')];var WhatsappMessage=require(_0xcadc('0x2'))['db'][_0xcadc('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xcadc('0x4')](0x0);var events={'afterCreate':_0xcadc('0x5'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x23b7d1){return function(_0x333f8c,_0x40f07f,_0x25ab60){_0x333f8c[_0xcadc('0x6')]({'attributes':['id'],'raw':!![]})[_0xcadc('0x7')](function(_0x4a0567){_0x333f8c[_0xcadc('0x8')](_0xcadc('0x9'),_0x4a0567[_0xcadc('0xa')](function(_0x14af1e){return{'id':_0x14af1e['id']};}));return WhatsappMessage[_0xcadc('0xb')]({'where':{'WhatsappInteractionId':_0x333f8c['id'],'direction':'in','read':![]},'raw':!![]});})[_0xcadc('0x7')](function(_0x38cfee){_0x333f8c['setDataValue']('unreadMessages',_0x38cfee[_0xcadc('0xc')]);WhatsappInteractionEvents[_0xcadc('0xd')](_0x23b7d1+':'+_0x333f8c['id'],_0x333f8c);WhatsappInteractionEvents['emit'](_0x23b7d1,_0x333f8c);_0x25ab60(null);})[_0xcadc('0xe')](_0x25ab60(null));};}for(var e in events){if(events[_0xcadc('0xf')](e)){var event=events[e];WhatsappInteraction[_0xcadc('0x10')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index aa16c90..92fc69a 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 _0xb8c1=['request-promise','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird'];(function(_0x540133,_0x41783f){var _0x26b6e9=function(_0x10ebe3){while(--_0x10ebe3){_0x540133['push'](_0x540133['shift']());}};_0x26b6e9(++_0x41783f);}(_0xb8c1,0x91));var _0x1b8c=function(_0x18e69f,_0x2d3896){_0x18e69f=_0x18e69f-0x0;var _0x43d6d1=_0xb8c1[_0x18e69f];return _0x43d6d1;};'use strict';var _=require('lodash');var util=require(_0x1b8c('0x0'));var logger=require(_0x1b8c('0x1'))(_0x1b8c('0x2'));var moment=require(_0x1b8c('0x3'));var BPromise=require(_0x1b8c('0x4'));var rp=require(_0x1b8c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1b8c('0x6'));module[_0x1b8c('0x7')]=function(_0x44804c,_0x460b86){return _0x44804c[_0x1b8c('0x8')](_0x1b8c('0x9'),attributes,{'tableName':_0x1b8c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xd96ed1,_0x4e0510,_0x24de68){if(_0xd96ed1[_0x1b8c('0xb')]('closed')){_0xd96ed1[_0x1b8c('0xc')]=moment()[_0x1b8c('0xd')](_0x1b8c('0xe'));}_0x24de68(null,_0xd96ed1);}}});}; \ No newline at end of file +var _0xd798=['closedAt','YYYY-MM-DD\x20HH:mm:ss','api','moment','path','rimraf','../../config/environment','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed'];(function(_0x17406e,_0x1049fd){var _0x2bfc5a=function(_0x2aae05){while(--_0x2aae05){_0x17406e['push'](_0x17406e['shift']());}};_0x2bfc5a(++_0x1049fd);}(_0xd798,0x77));var _0x8d79=function(_0x49fbb2,_0x31267d){_0x49fbb2=_0x49fbb2-0x0;var _0x48f40f=_0xd798[_0x49fbb2];return _0x48f40f;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x8d79('0x0'));var moment=require(_0x8d79('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8d79('0x2'));var rimraf=require(_0x8d79('0x3'));var config=require(_0x8d79('0x4'));var attributes=require('./whatsappInteraction.attributes');module[_0x8d79('0x5')]=function(_0x310be1,_0x3306e9){return _0x310be1[_0x8d79('0x6')](_0x8d79('0x7'),attributes,{'tableName':_0x8d79('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x767442,_0x2848f7,_0x1ff4dc){if(_0x767442[_0x8d79('0x9')](_0x8d79('0xa'))){_0x767442[_0x8d79('0xb')]=moment()['format'](_0x8d79('0xc'));}_0x1ff4dc(null,_0x767442);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 0db304b..9c31277 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 _0x9beb=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','then','info','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','WhatsappInteraction,\x20%s,\x20%s','message','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','options','raw','where','AddTagsToWhatsappInteraction','addTags','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x9beb,0x133));var _0xb9be=function(_0x393043,_0x143c24){_0x393043=_0x393043-0x0;var _0x50c9e1=_0x9beb[_0x393043];return _0x50c9e1;};'use strict';var _=require(_0xb9be('0x0'));var util=require(_0xb9be('0x1'));var moment=require(_0xb9be('0x2'));var BPromise=require(_0xb9be('0x3'));var rs=require(_0xb9be('0x4'));var fs=require('fs');var Redis=require(_0xb9be('0x5'));var db=require(_0xb9be('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb9be('0x7'))(_0xb9be('0x8'));var config=require(_0xb9be('0x9'));var jayson=require(_0xb9be('0xa'));var client=jayson['client'][_0xb9be('0xb')]({'port':0x232a});config[_0xb9be('0xc')]=_[_0xb9be('0xd')](config[_0xb9be('0xc')],{'host':_0xb9be('0xe'),'port':0x18eb});var socket=require(_0xb9be('0xf'))(new Redis(config[_0xb9be('0xc')]));require(_0xb9be('0x10'))[_0xb9be('0x11')](socket);function respondWithRpcPromise(_0x4f42a4,_0xda122c,_0x1e00f2){return new BPromise(function(_0x3ab4df,_0x16b672){return client['request'](_0x4f42a4,_0x1e00f2)[_0xb9be('0x12')](function(_0x44e991){logger[_0xb9be('0x13')]('WhatsappInteraction,\x20%s,\x20%s',_0xda122c,'request\x20sent');logger[_0xb9be('0x14')](_0xb9be('0x15'),_0xda122c,_0xb9be('0x16'),JSON[_0xb9be('0x17')](_0x44e991));if(_0x44e991[_0xb9be('0x18')]){if(_0x44e991[_0xb9be('0x18')]['code']===0x1f4){logger[_0xb9be('0x18')](_0xb9be('0x19'),_0xda122c,_0x44e991[_0xb9be('0x18')][_0xb9be('0x1a')]);return _0x16b672(_0x44e991[_0xb9be('0x18')][_0xb9be('0x1a')]);}logger[_0xb9be('0x18')](_0xb9be('0x19'),_0xda122c,_0x44e991[_0xb9be('0x18')][_0xb9be('0x1a')]);return _0x3ab4df(_0x44e991['error'][_0xb9be('0x1a')]);}else{logger['info'](_0xb9be('0x19'),_0xda122c,_0xb9be('0x16'));_0x3ab4df(_0x44e991['result'][_0xb9be('0x1a')]);}})[_0xb9be('0x1b')](function(_0x51e002){logger[_0xb9be('0x18')]('WhatsappInteraction,\x20%s,\x20%s',_0xda122c,_0x51e002);_0x16b672(_0x51e002);});});}exports[_0xb9be('0x1c')]=function(_0x3cef3d){var _0x50f7e3=this;return new Promise(function(_0x1c172b,_0x4f3d90){return db[_0xb9be('0x1d')][_0xb9be('0x1e')](_0x3cef3d['body'],{'raw':_0x3cef3d[_0xb9be('0x1f')]?_0x3cef3d['options'][_0xb9be('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3cef3d[_0xb9be('0x1f')]?_0x3cef3d['options'][_0xb9be('0x21')]||null:null,'attributes':_0x3cef3d[_0xb9be('0x1f')]?_0x3cef3d[_0xb9be('0x1f')]['attributes']||null:null,'limit':_0x3cef3d['options']?_0x3cef3d[_0xb9be('0x1f')]['limit']||null:null})['then'](function(_0x31a54c){logger[_0xb9be('0x13')](_0xb9be('0x1c'),_0x3cef3d);logger['debug'](_0xb9be('0x1c'),_0x3cef3d,JSON['stringify'](_0x31a54c));_0x1c172b(_0x31a54c);})[_0xb9be('0x1b')](function(_0x5d6d56){logger['error'](_0xb9be('0x1c'),_0x5d6d56[_0xb9be('0x1a')],_0x3cef3d);_0x4f3d90(_0x50f7e3[_0xb9be('0x18')](0x1f4,_0x5d6d56[_0xb9be('0x1a')]));});});};exports[_0xb9be('0x22')]=function(_0x49c977){return new Promise(function(_0x5e1d8f,_0x155c9f){return db[_0xb9be('0x1d')]['find']({'where':_0x49c977['options']?_0x49c977[_0xb9be('0x1f')][_0xb9be('0x21')]||null:null})[_0xb9be('0x12')](function(_0xc3e677){if(_0xc3e677){return _0xc3e677[_0xb9be('0x23')](_0x49c977['body']['ids'],_[_0xb9be('0x24')](_0x49c977['body'],['ids','id'])||{});}})[_0xb9be('0x25')](function(_0x3bf0fb){logger[_0xb9be('0x13')](_0xb9be('0x26'),_0x49c977);logger[_0xb9be('0x14')](_0xb9be('0x26'),_0x49c977,JSON[_0xb9be('0x17')](_0x3bf0fb));_0x5e1d8f(_0x3bf0fb);})[_0xb9be('0x1b')](function(_0x4071b7){logger[_0xb9be('0x18')](_0xb9be('0x26'),_0x4071b7[_0xb9be('0x1a')],_0x49c977);_0x155c9f(_this[_0xb9be('0x18')](0x1f4,_0x4071b7[_0xb9be('0x1a')]));});});}; \ No newline at end of file +var _0xbc90=['info','WhatsappInteraction,\x20%s,\x20%s','debug','stringify','error','code','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','limit','find','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then'];(function(_0x187279,_0x26d152){var _0x3da59d=function(_0x41c808){while(--_0x41c808){_0x187279['push'](_0x187279['shift']());}};_0x3da59d(++_0x26d152);}(_0xbc90,0x10c));var _0x0bc9=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xbc90[_0x39096d];return _0x13da4f;};'use strict';var _=require(_0x0bc9('0x0'));var util=require(_0x0bc9('0x1'));var moment=require(_0x0bc9('0x2'));var BPromise=require(_0x0bc9('0x3'));var rs=require(_0x0bc9('0x4'));var fs=require('fs');var Redis=require(_0x0bc9('0x5'));var db=require(_0x0bc9('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0bc9('0x7'))(_0x0bc9('0x8'));var config=require(_0x0bc9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0bc9('0xa')]['http']({'port':0x232a});config['redis']=_[_0x0bc9('0xb')](config[_0x0bc9('0xc')],{'host':_0x0bc9('0xd'),'port':0x18eb});var socket=require(_0x0bc9('0xe'))(new Redis(config['redis']));require(_0x0bc9('0xf'))[_0x0bc9('0x10')](socket);function respondWithRpcPromise(_0x1eb860,_0x48eb7f,_0x5dfecd){return new BPromise(function(_0x3ed9ce,_0x51bac0){return client[_0x0bc9('0x11')](_0x1eb860,_0x5dfecd)[_0x0bc9('0x12')](function(_0x545c06){logger[_0x0bc9('0x13')](_0x0bc9('0x14'),_0x48eb7f,'request\x20sent');logger[_0x0bc9('0x15')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x48eb7f,'request\x20sent',JSON[_0x0bc9('0x16')](_0x545c06));if(_0x545c06[_0x0bc9('0x17')]){if(_0x545c06[_0x0bc9('0x17')][_0x0bc9('0x18')]===0x1f4){logger[_0x0bc9('0x17')](_0x0bc9('0x14'),_0x48eb7f,_0x545c06[_0x0bc9('0x17')]['message']);return _0x51bac0(_0x545c06[_0x0bc9('0x17')][_0x0bc9('0x19')]);}logger[_0x0bc9('0x17')](_0x0bc9('0x14'),_0x48eb7f,_0x545c06[_0x0bc9('0x17')][_0x0bc9('0x19')]);return _0x3ed9ce(_0x545c06['error'][_0x0bc9('0x19')]);}else{logger[_0x0bc9('0x13')](_0x0bc9('0x14'),_0x48eb7f,'request\x20sent');_0x3ed9ce(_0x545c06[_0x0bc9('0x1a')]['message']);}})[_0x0bc9('0x1b')](function(_0x342310){logger['error'](_0x0bc9('0x14'),_0x48eb7f,_0x342310);_0x51bac0(_0x342310);});});}exports[_0x0bc9('0x1c')]=function(_0x31a059){var _0x166946=this;return new Promise(function(_0x477ad4,_0x2c5248){return db[_0x0bc9('0x1d')][_0x0bc9('0x1e')](_0x31a059[_0x0bc9('0x1f')],{'raw':_0x31a059[_0x0bc9('0x20')]?_0x31a059['options'][_0x0bc9('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x31a059[_0x0bc9('0x20')]?_0x31a059[_0x0bc9('0x20')][_0x0bc9('0x22')]||null:null,'attributes':_0x31a059[_0x0bc9('0x20')]?_0x31a059[_0x0bc9('0x20')]['attributes']||null:null,'limit':_0x31a059[_0x0bc9('0x20')]?_0x31a059[_0x0bc9('0x20')][_0x0bc9('0x23')]||null:null})['then'](function(_0x93372){logger[_0x0bc9('0x13')]('UpdateWhatsappInteraction',_0x31a059);logger[_0x0bc9('0x15')](_0x0bc9('0x1c'),_0x31a059,JSON[_0x0bc9('0x16')](_0x93372));_0x477ad4(_0x93372);})['catch'](function(_0x430253){logger['error'](_0x0bc9('0x1c'),_0x430253[_0x0bc9('0x19')],_0x31a059);_0x2c5248(_0x166946['error'](0x1f4,_0x430253[_0x0bc9('0x19')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x5bda68){return new Promise(function(_0x28cf51,_0x5b40f2){return db['WhatsappInteraction'][_0x0bc9('0x24')]({'where':_0x5bda68['options']?_0x5bda68[_0x0bc9('0x20')]['where']||null:null})[_0x0bc9('0x12')](function(_0x3aeb7e){if(_0x3aeb7e){return _0x3aeb7e['addTags'](_0x5bda68[_0x0bc9('0x1f')][_0x0bc9('0x25')],_[_0x0bc9('0x26')](_0x5bda68['body'],[_0x0bc9('0x25'),'id'])||{});}})[_0x0bc9('0x27')](function(_0x1220a5){logger[_0x0bc9('0x13')]('AddTags',_0x5bda68);logger['debug']('AddTags',_0x5bda68,JSON['stringify'](_0x1220a5));_0x28cf51(_0x1220a5);})[_0x0bc9('0x1b')](function(_0x4b1d21){logger[_0x0bc9('0x17')](_0x0bc9('0x28'),_0x4b1d21['message'],_0x5bda68);_0x5b40f2(_this[_0x0bc9('0x17')](0x1f4,_0x4b1d21[_0x0bc9('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 88a2567..d4c009d 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 _0xd971=['update','emit','removeListener','length','./whatsappInteraction.events','save'];(function(_0x4706a6,_0x5a1c63){var _0x1bb705=function(_0x484ebb){while(--_0x484ebb){_0x4706a6['push'](_0x4706a6['shift']());}};_0x1bb705(++_0x5a1c63);}(_0xd971,0x18a));var _0x1d97=function(_0x448ae2,_0x1676f5){_0x448ae2=_0x448ae2-0x0;var _0x4fdd34=_0xd971[_0x448ae2];return _0x4fdd34;};'use strict';var WhatsappInteractionEvents=require(_0x1d97('0x0'));var events=[_0x1d97('0x1'),'remove',_0x1d97('0x2')];function createListener(_0x27bc62,_0x355886){return function(_0x263e32){_0x355886[_0x1d97('0x3')](_0x27bc62,_0x263e32);};}function removeListener(_0x3ca7e2,_0x594d23){return function(){WhatsappInteractionEvents[_0x1d97('0x4')](_0x3ca7e2,_0x594d23);};}exports['register']=function(_0x67625d){for(var _0x28e685=0x0,_0x4f37af=events[_0x1d97('0x5')];_0x28e685<_0x4f37af;_0x28e685++){var _0x361171=events[_0x28e685];var _0x1aa759=createListener('whatsappInteraction:'+_0x361171,_0x67625d);WhatsappInteractionEvents['on'](_0x361171,_0x1aa759);}}; \ No newline at end of file +var _0x883c=['remove','update','emit','removeListener','register','length','whatsappInteraction:','./whatsappInteraction.events','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x883c,0xd6));var _0xc883=function(_0x4d5556,_0x3b80bd){_0x4d5556=_0x4d5556-0x0;var _0x257985=_0x883c[_0x4d5556];return _0x257985;};'use strict';var WhatsappInteractionEvents=require(_0xc883('0x0'));var events=[_0xc883('0x1'),_0xc883('0x2'),_0xc883('0x3')];function createListener(_0x2aed1a,_0x40b075){return function(_0x3b3d94){_0x40b075[_0xc883('0x4')](_0x2aed1a,_0x3b3d94);};}function removeListener(_0x25703f,_0x436e55){return function(){WhatsappInteractionEvents[_0xc883('0x5')](_0x25703f,_0x436e55);};}exports[_0xc883('0x6')]=function(_0x182af3){for(var _0x31e047=0x0,_0x10c25c=events[_0xc883('0x7')];_0x31e047<_0x10c25c;_0x31e047++){var _0x3d94ae=events[_0x31e047];var _0x49141c=createListener(_0xc883('0x8')+_0x3d94ae,_0x182af3);WhatsappInteractionEvents['on'](_0x3d94ae,_0x49141c);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 8645608..d874142 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 _0x8822=['delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappMessage.controller','isAuthenticated','index','/describe','get','/:id','show','post','tracked','whatsapp','whatsappmessage:create','create','status','put','update','/:id/accept','accept','/:id/reject','reject'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x8822,0x15e));var _0x2882=function(_0x18e184,_0x497c5e){_0x18e184=_0x18e184-0x0;var _0x5f4c49=_0x8822[_0x18e184];return _0x5f4c49;};'use strict';var multer=require(_0x2882('0x0'));var util=require(_0x2882('0x1'));var path=require('path');var timeout=require(_0x2882('0x2'));var express=require(_0x2882('0x3'));var router=express[_0x2882('0x4')]();var fs_extra=require(_0x2882('0x5'));var auth=require(_0x2882('0x6'));var interaction=require(_0x2882('0x7'));var config=require('../../config/environment');var controller=require(_0x2882('0x8'));router['get']('/',auth[_0x2882('0x9')](),controller[_0x2882('0xa')]);router['get'](_0x2882('0xb'),auth[_0x2882('0x9')](),controller['describe']);router[_0x2882('0xc')](_0x2882('0xd'),auth[_0x2882('0x9')](),controller[_0x2882('0xe')]);router[_0x2882('0xf')]('/',auth['isAuthenticated'](),interaction[_0x2882('0x10')](_0x2882('0x11'),_0x2882('0x12')),controller[_0x2882('0x13')]);router['post']('/:id/status',controller[_0x2882('0x14')]);router[_0x2882('0x15')](_0x2882('0xd'),auth[_0x2882('0x9')](),controller[_0x2882('0x16')]);router[_0x2882('0x15')](_0x2882('0x17'),auth[_0x2882('0x9')](),controller[_0x2882('0x18')]);router[_0x2882('0x15')](_0x2882('0x19'),auth['isAuthenticated'](),controller[_0x2882('0x1a')]);router[_0x2882('0x1b')](_0x2882('0xd'),auth[_0x2882('0x9')](),controller[_0x2882('0x1c')]);module['exports']=router; \ No newline at end of file +var _0xb2bf=['isAuthenticated','describe','/:id','show','post','whatsapp','whatsappmessage:create','create','status','put','update','accept','/:id/reject','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./whatsappMessage.controller','get','index'];(function(_0x4c366e,_0x41cfdf){var _0x1089f9=function(_0x2e3ba5){while(--_0x2e3ba5){_0x4c366e['push'](_0x4c366e['shift']());}};_0x1089f9(++_0x41cfdf);}(_0xb2bf,0x1ea));var _0xfb2b=function(_0x43f489,_0x2b4fea){_0x43f489=_0x43f489-0x0;var _0x4134b4=_0xb2bf[_0x43f489];return _0x4134b4;};'use strict';var multer=require('multer');var util=require(_0xfb2b('0x0'));var path=require(_0xfb2b('0x1'));var timeout=require(_0xfb2b('0x2'));var express=require(_0xfb2b('0x3'));var router=express[_0xfb2b('0x4')]();var fs_extra=require(_0xfb2b('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfb2b('0x6'));var controller=require(_0xfb2b('0x7'));router[_0xfb2b('0x8')]('/',auth['isAuthenticated'](),controller[_0xfb2b('0x9')]);router[_0xfb2b('0x8')]('/describe',auth[_0xfb2b('0xa')](),controller[_0xfb2b('0xb')]);router[_0xfb2b('0x8')](_0xfb2b('0xc'),auth[_0xfb2b('0xa')](),controller[_0xfb2b('0xd')]);router[_0xfb2b('0xe')]('/',auth[_0xfb2b('0xa')](),interaction['tracked'](_0xfb2b('0xf'),_0xfb2b('0x10')),controller[_0xfb2b('0x11')]);router[_0xfb2b('0xe')]('/:id/status',controller[_0xfb2b('0x12')]);router[_0xfb2b('0x13')](_0xfb2b('0xc'),auth[_0xfb2b('0xa')](),controller[_0xfb2b('0x14')]);router[_0xfb2b('0x13')]('/:id/accept',auth['isAuthenticated'](),controller[_0xfb2b('0x15')]);router[_0xfb2b('0x13')](_0xfb2b('0x16'),auth[_0xfb2b('0xa')](),controller['reject']);router[_0xfb2b('0x17')](_0xfb2b('0xc'),auth[_0xfb2b('0xa')](),controller['destroy']);module[_0xfb2b('0x18')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index f0d59d8..f5151c6 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 _0x21f2=['exports','TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0x1d50c9,_0x276cb9){var _0x2b8211=function(_0x5040c3){while(--_0x5040c3){_0x1d50c9['push'](_0x1d50c9['shift']());}};_0x2b8211(++_0x276cb9);}(_0x21f2,0x158));var _0x221f=function(_0x5cca21,_0x16b49f){_0x5cca21=_0x5cca21-0x0;var _0xaa5774=_0x21f2[_0x5cca21];return _0xaa5774;};'use strict';var Sequelize=require('sequelize');module[_0x221f('0x0')]={'body':{'type':Sequelize[_0x221f('0x1')](_0x221f('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x221f('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x221f('0x4')]('in',_0x221f('0x5')),'defaultValue':_0x221f('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x221f('0x6')](0xbe)},'phone':{'type':Sequelize[_0x221f('0x6')]},'readAt':{'type':Sequelize[_0x221f('0x7')]},'secret':{'type':Sequelize[_0x221f('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x221f('0x1')]}}; \ No newline at end of file +var _0xa5c9=['STRING','DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x415260,_0x41cd34){var _0x4f3381=function(_0x13a799){while(--_0x13a799){_0x415260['push'](_0x415260['shift']());}};_0x4f3381(++_0x41cd34);}(_0xa5c9,0xda));var _0x9a5c=function(_0x44b3bd,_0x44c97d){_0x44b3bd=_0x44b3bd-0x0;var _0x1efc4a=_0xa5c9[_0x44b3bd];return _0x1efc4a;};'use strict';var Sequelize=require(_0x9a5c('0x0'));module[_0x9a5c('0x1')]={'body':{'type':Sequelize[_0x9a5c('0x2')](_0x9a5c('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x9a5c('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9a5c('0x5')]('in',_0x9a5c('0x6')),'defaultValue':_0x9a5c('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x9a5c('0x7')](0xbe)},'phone':{'type':Sequelize[_0x9a5c('0x7')]},'readAt':{'type':Sequelize[_0x9a5c('0x8')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x9a5c('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 840fce3..51f7edb 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 _0xf230=['Content-Range','reject','update','then','stack','name','index','map','WhatsappMessage','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','show','params','keys','includeAll','include','find','create','body','destroy','describe','whatsapp-interactions','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','WhatsappInteraction','isNil','read1stAt','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','agent','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','../../config/logger','WhatsappInteractionId','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','rejectMessage','Sequelize','contact','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x81f0fc,_0x2c5785){var _0xd4667d=function(_0x5c4849){while(--_0x5c4849){_0x81f0fc['push'](_0x81f0fc['shift']());}};_0xd4667d(++_0x2c5785);}(_0xf230,0xea));var _0x0f23=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xf230[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x0f23('0x0'));var rimraf=require(_0x0f23('0x1'));var zipdir=require(_0x0f23('0x2'));var jsonpatch=require(_0x0f23('0x3'));var rp=require(_0x0f23('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0f23('0x5'));var util=require(_0x0f23('0x6'));var path=require(_0x0f23('0x7'));var sox=require('sox');var csv=require(_0x0f23('0x8'));var ejs=require(_0x0f23('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0f23('0xa'));var squel=require('squel');var crypto=require(_0x0f23('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0f23('0xc'));var toCsv=require(_0x0f23('0x8'));var querystring=require(_0x0f23('0xd'));var Papa=require(_0x0f23('0xe'));var Redis=require('ioredis');var authService=require(_0x0f23('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x0f23('0x10'));var hardwareService=require(_0x0f23('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x0f23('0x12'));var config=require(_0x0f23('0x13'));var licenseUtil=require(_0x0f23('0x14'));var db=require(_0x0f23('0x15'))['db'];config['redis']=_[_0x0f23('0x16')](config[_0x0f23('0x17')],{'host':_0x0f23('0x18'),'port':0x18eb});var socket=require(_0x0f23('0x19'))(new Redis(config[_0x0f23('0x17')]));require(_0x0f23('0x1a'))[_0x0f23('0x1b')](socket);var jayson=require(_0x0f23('0x1c'));var client=jayson[_0x0f23('0x1d')][_0x0f23('0x1e')]({'port':0x232c});var client9002=jayson[_0x0f23('0x1d')][_0x0f23('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x4ed26d,_0x10f544,_0x2ef2a6,_0x52e976){return new BPromise(function(_0x186863,_0x423880){var _0x296b90=_0x52e976||client;return _0x296b90[_0x0f23('0x1f')](_0x4ed26d,_0x2ef2a6)['then'](function(_0x3c68d0){logger[_0x0f23('0x20')](_0x0f23('0x21'),_0x10f544,_0x0f23('0x22'));logger[_0x0f23('0x23')](_0x0f23('0x24'),_0x10f544,'request\x20sent',JSON[_0x0f23('0x25')](_0x3c68d0));if(_0x3c68d0[_0x0f23('0x26')]){if(_0x3c68d0[_0x0f23('0x26')][_0x0f23('0x27')]===0x1f4){logger['error'](_0x0f23('0x21'),_0x10f544,_0x3c68d0[_0x0f23('0x26')][_0x0f23('0x28')]);return _0x423880(_0x3c68d0[_0x0f23('0x26')][_0x0f23('0x28')]);}logger[_0x0f23('0x26')](_0x0f23('0x21'),_0x10f544,_0x3c68d0[_0x0f23('0x26')]['message']);return _0x186863(_0x3c68d0['error'][_0x0f23('0x28')]);}else{logger[_0x0f23('0x20')](_0x0f23('0x21'),_0x10f544,_0x0f23('0x22'));_0x186863(_0x3c68d0[_0x0f23('0x29')][_0x0f23('0x28')]);}})[_0x0f23('0x2a')](function(_0x2ebac5){logger[_0x0f23('0x26')](_0x0f23('0x21'),_0x10f544,_0x2ebac5);_0x423880(_0x2ebac5);});});}function respondWithStatusCode(_0xb168d2,_0x2cfad4){_0x2cfad4=_0x2cfad4||0xcc;return function(_0x23961e){if(_0x23961e){return _0xb168d2[_0x0f23('0x2b')](_0x2cfad4);}return _0xb168d2[_0x0f23('0x2c')](_0x2cfad4)[_0x0f23('0x2d')]();};}function respondWithResult(_0x11ac00,_0x579e89){_0x579e89=_0x579e89||0xc8;return function(_0x2789d4){if(_0x2789d4){return _0x11ac00['status'](_0x579e89)[_0x0f23('0x2e')](_0x2789d4);}};}function respondWithFilteredResult(_0x470d36,_0x461275){return function(_0x123009){if(_0x123009){var _0x1b67d7=typeof _0x461275[_0x0f23('0x2f')]===_0x0f23('0x30')&&typeof _0x461275[_0x0f23('0x31')]===_0x0f23('0x30');var _0x265170=_0x123009['count'];var _0x2a3541=_0x1b67d7?0x0:_0x461275[_0x0f23('0x2f')];var _0x1785a2=_0x1b67d7?_0x123009[_0x0f23('0x32')]:_0x461275['offset']+_0x461275['limit'];var _0x416669;if(_0x1785a2>=_0x265170){_0x1785a2=_0x265170;_0x416669=0xc8;}else{_0x416669=0xce;}_0x470d36[_0x0f23('0x2c')](_0x416669);return _0x470d36[_0x0f23('0x33')](_0x0f23('0x34'),_0x2a3541+'-'+_0x1785a2+'/'+_0x265170)['json'](_0x123009);}return null;};}function patchUpdates(_0x5afac9){return function(_0x57ead3){try{jsonpatch['apply'](_0x57ead3,_0x5afac9,!![]);}catch(_0x398515){return BPromise[_0x0f23('0x35')](_0x398515);}return _0x57ead3['save']();};}function saveUpdates(_0x351fda,_0x3a001c){return function(_0x2fb345){if(_0x2fb345){return _0x2fb345[_0x0f23('0x36')](_0x351fda)[_0x0f23('0x37')](function(_0x4c4f5c){return _0x4c4f5c;});}return null;};}function removeEntity(_0x522e7b,_0x58ba85){return function(_0xb166e3){if(_0xb166e3){return _0xb166e3['destroy']()[_0x0f23('0x37')](function(){_0x522e7b['status'](0xcc)[_0x0f23('0x2d')]();});}};}function handleEntityNotFound(_0x127cbd,_0x161dad){return function(_0xa6cba0){if(!_0xa6cba0){_0x127cbd[_0x0f23('0x2b')](0x194);}return _0xa6cba0;};}function handleError(_0x1ca8be,_0x5761ff){_0x5761ff=_0x5761ff||0x1f4;return function(_0x324673){logger[_0x0f23('0x26')](_0x324673[_0x0f23('0x38')]);if(_0x324673['name']){delete _0x324673[_0x0f23('0x39')];}_0x1ca8be[_0x0f23('0x2c')](_0x5761ff)['send'](_0x324673);};}exports[_0x0f23('0x3a')]=function(_0x4b2d6c,_0x3ebe98){var _0x2a45a2={},_0x2aaa6c={},_0x4f5875={'count':0x0,'rows':[]};var _0xe3e207=_[_0x0f23('0x3b')](db[_0x0f23('0x3c')][_0x0f23('0x3d')],function(_0x158ed0){return{'name':_0x158ed0[_0x0f23('0x3e')],'type':_0x158ed0[_0x0f23('0x3f')][_0x0f23('0x40')]};});_0x2aaa6c['model']=_[_0x0f23('0x3b')](_0xe3e207,'name');_0x2aaa6c[_0x0f23('0x41')]=_['keys'](_0x4b2d6c[_0x0f23('0x41')]);_0x2aaa6c[_0x0f23('0x42')]=_['intersection'](_0x2aaa6c['model'],_0x2aaa6c[_0x0f23('0x41')]);_0x2a45a2['attributes']=_[_0x0f23('0x43')](_0x2aaa6c[_0x0f23('0x44')],qs[_0x0f23('0x45')](_0x4b2d6c[_0x0f23('0x41')]['fields']));_0x2a45a2[_0x0f23('0x46')]=_0x2a45a2['attributes'][_0x0f23('0x47')]?_0x2a45a2[_0x0f23('0x46')]:_0x2aaa6c[_0x0f23('0x44')];if(!_0x4b2d6c[_0x0f23('0x41')][_0x0f23('0x48')]('nolimit')){_0x2a45a2[_0x0f23('0x31')]=qs[_0x0f23('0x31')](_0x4b2d6c[_0x0f23('0x41')]['limit']);_0x2a45a2['offset']=qs['offset'](_0x4b2d6c['query'][_0x0f23('0x2f')]);}_0x2a45a2[_0x0f23('0x49')]=qs[_0x0f23('0x4a')](_0x4b2d6c[_0x0f23('0x41')][_0x0f23('0x4a')]);_0x2a45a2[_0x0f23('0x4b')]=qs[_0x0f23('0x42')](_[_0x0f23('0x4c')](_0x4b2d6c[_0x0f23('0x41')],_0x2aaa6c[_0x0f23('0x42')]),_0xe3e207);if(_0x4b2d6c[_0x0f23('0x41')][_0x0f23('0x4d')]){_0x2a45a2['where']=_[_0x0f23('0x4e')](_0x2a45a2['where'],{'$or':_[_0x0f23('0x3b')](_0xe3e207,function(_0x23f80c){if(_0x23f80c['type']!==_0x0f23('0x4f')){var _0x364f13={};_0x364f13[_0x23f80c['name']]={'$like':'%'+_0x4b2d6c[_0x0f23('0x41')][_0x0f23('0x4d')]+'%'};return _0x364f13;}})});}_0x2a45a2=_['merge']({},_0x2a45a2,_0x4b2d6c[_0x0f23('0x50')]);var _0xf7b2a6={'where':_0x2a45a2[_0x0f23('0x4b')]};return db['WhatsappMessage'][_0x0f23('0x32')](_0xf7b2a6)['then'](function(_0x39f7a1){_0x4f5875[_0x0f23('0x32')]=_0x39f7a1;if(_0x4b2d6c[_0x0f23('0x41')]['includeAll']){_0x2a45a2['include']=[{'all':!![]}];}return db['WhatsappMessage'][_0x0f23('0x51')](_0x2a45a2);})['then'](function(_0x3392cb){_0x4f5875[_0x0f23('0x52')]=_0x3392cb;return _0x4f5875;})[_0x0f23('0x37')](respondWithFilteredResult(_0x3ebe98,_0x2a45a2))['catch'](handleError(_0x3ebe98,null));};exports[_0x0f23('0x53')]=function(_0x4898d8,_0xe2298){var _0x583216={'raw':!![],'where':{'id':_0x4898d8[_0x0f23('0x54')]['id']}},_0x5c806f={};_0x5c806f[_0x0f23('0x44')]=_[_0x0f23('0x55')](db[_0x0f23('0x3c')][_0x0f23('0x3d')]);_0x5c806f['query']=_[_0x0f23('0x55')](_0x4898d8[_0x0f23('0x41')]);_0x5c806f['filters']=_['intersection'](_0x5c806f[_0x0f23('0x44')],_0x5c806f['query']);_0x583216[_0x0f23('0x46')]=_[_0x0f23('0x43')](_0x5c806f[_0x0f23('0x44')],qs['fields'](_0x4898d8[_0x0f23('0x41')][_0x0f23('0x45')]));_0x583216[_0x0f23('0x46')]=_0x583216['attributes']['length']?_0x583216[_0x0f23('0x46')]:_0x5c806f[_0x0f23('0x44')];if(_0x4898d8[_0x0f23('0x41')][_0x0f23('0x56')]){_0x583216[_0x0f23('0x57')]=[{'all':!![]}];}_0x583216=_['merge']({},_0x583216,_0x4898d8[_0x0f23('0x50')]);return db['WhatsappMessage'][_0x0f23('0x58')](_0x583216)[_0x0f23('0x37')](handleEntityNotFound(_0xe2298,null))['then'](respondWithResult(_0xe2298,null))['catch'](handleError(_0xe2298,null));};exports[_0x0f23('0x59')]=function(_0x4ba023,_0x4e2b1e){return db[_0x0f23('0x3c')]['create'](_0x4ba023['body'],{})[_0x0f23('0x37')](respondWithResult(_0x4e2b1e,0xc9))[_0x0f23('0x2a')](handleError(_0x4e2b1e,null));};exports['update']=function(_0x384521,_0x595eae){if(_0x384521[_0x0f23('0x5a')]['id']){delete _0x384521[_0x0f23('0x5a')]['id'];}return db[_0x0f23('0x3c')][_0x0f23('0x58')]({'where':{'id':_0x384521[_0x0f23('0x54')]['id']}})[_0x0f23('0x37')](handleEntityNotFound(_0x595eae,null))[_0x0f23('0x37')](saveUpdates(_0x384521[_0x0f23('0x5a')],null))[_0x0f23('0x37')](respondWithResult(_0x595eae,null))[_0x0f23('0x2a')](handleError(_0x595eae,null));};exports[_0x0f23('0x5b')]=function(_0x1095eb,_0x2aec0f){return db['WhatsappMessage'][_0x0f23('0x58')]({'where':{'id':_0x1095eb[_0x0f23('0x54')]['id']}})['then'](handleEntityNotFound(_0x2aec0f,null))['then'](removeEntity(_0x2aec0f,null))[_0x0f23('0x2a')](handleError(_0x2aec0f,null));};exports['describe']=function(_0x4582f2,_0x45a19a){return db[_0x0f23('0x3c')][_0x0f23('0x5c')]()['then'](respondWithResult(_0x45a19a,null))['catch'](handleError(_0x45a19a,null));};var interaction_log=require('../../config/logger')(_0x0f23('0x5d'));exports[_0x0f23('0x5e')]=function(_0x37e2be,_0x4e91d9,_0x578637){var _0x32bd29={'agent':{},'channel':_0x0f23('0x5f')};if(_0x37e2be[_0x0f23('0x5a')]['id']){delete _0x37e2be[_0x0f23('0x5a')]['id'];}_0x37e2be[_0x0f23('0x5a')][_0x0f23('0x60')]=!![];_0x37e2be[_0x0f23('0x5a')][_0x0f23('0x61')]=moment()[_0x0f23('0x62')](_0x0f23('0x63'));_0x37e2be[_0x0f23('0x5a')][_0x0f23('0x64')]=_0x37e2be[_0x0f23('0x5a')]['UserId']||_0x37e2be[_0x0f23('0x65')]['id'];_0x32bd29['agent']['id']=_0x37e2be[_0x0f23('0x5a')][_0x0f23('0x64')];return db[_0x0f23('0x3c')][_0x0f23('0x58')]({'where':{'id':_0x37e2be[_0x0f23('0x54')]['id'],'UserId':null}})[_0x0f23('0x37')](handleEntityNotFound(_0x4e91d9,null))[_0x0f23('0x37')](saveUpdates(_0x37e2be['body'],null))[_0x0f23('0x37')](function(_0x4ae489){if(_0x4ae489){_0x32bd29['message']=_0x4ae489[_0x0f23('0x66')]({'plain':!![]});return db[_0x0f23('0x67')]['find']({'where':{'id':_0x4ae489['WhatsappInteractionId']}});}return null;})[_0x0f23('0x37')](handleEntityNotFound(_0x4e91d9,null))[_0x0f23('0x37')](function(_0x1dc2b5){if(_0x1dc2b5){return _0x1dc2b5['update']({'UserId':_0x37e2be[_0x0f23('0x5a')]['UserId'],'read1stAt':_[_0x0f23('0x68')](_0x1dc2b5[_0x0f23('0x69')])?moment()['format'](_0x0f23('0x63')):undefined});}return null;})[_0x0f23('0x37')](function(_0x260543){if(_0x260543){_0x32bd29['interaction']=_0x260543['get']({'plain':!![]});interaction_log[_0x0f23('0x20')](_0x0f23('0x6a'),_0x37e2be[_0x0f23('0x65')]['id'],_0x37e2be['user']['name'],_0x37e2be[_0x0f23('0x65')]['role'],_0x32bd29[_0x0f23('0x6b')]['id'],_0x37e2be['body']?JSON['stringify'](_0x37e2be['body']):'null');return respondWithRpcPromise(_0x0f23('0x6c'),'acceptMessage',_0x32bd29);}return null;})[_0x0f23('0x37')](function(_0x274780){var _0x52bf05=_0x0f23('0x6d')+_0x274780[_0x0f23('0x28')][_0x0f23('0x6e')];return db[_0x0f23('0x6f')][_0x0f23('0x41')](_0x52bf05,{'type':db['Sequelize'][_0x0f23('0x70')][_0x0f23('0x71')],'raw':!![]})['then'](function(_0x1922e8){return _0x1922e8;});})[_0x0f23('0x37')](function(_0x57a517){if(_0x57a517){_0x32bd29[_0x0f23('0x28')]['contact']=_0x57a517[0x0];if(!_0x37e2be[_0x0f23('0x5a')][_0x0f23('0x64')])return;return db['User'][_0x0f23('0x58')]({'where':{'id':_0x37e2be[_0x0f23('0x5a')]['UserId'],'role':_0x0f23('0x72')},'attributes':['id',_0x0f23('0x39'),_0x0f23('0x73'),_0x0f23('0x74'),_0x0f23('0x75')],'raw':!![]});}return null;})[_0x0f23('0x37')](function(_0x251e46){if(!_0x251e46)return null;_0x32bd29[_0x0f23('0x28')]['agent']=_0x251e46;return _0x32bd29;})[_0x0f23('0x37')](function(_0x5f2c57){if(_0x5f2c57){if(_0x37e2be['body'][_0x0f23('0x76')]){_0x32bd29[_0x0f23('0x28')][_0x0f23('0x77')]=util[_0x0f23('0x62')](_0x0f23('0x78'),_0x37e2be[_0x0f23('0x65')][_0x0f23('0x39')]);_0x32bd29[_0x0f23('0x28')][_0x0f23('0x79')]=_0x32bd29[_0x0f23('0x79')];_0x32bd29[_0x0f23('0x28')][_0x0f23('0x7a')]=_0x0f23('0x5e');return respondWithRpcPromise(_0x0f23('0x7b'),_0x0f23('0x7b'),{'event':'acceptmessage','message':_0x32bd29['message']},client9002)['then'](function(){return _0x32bd29;});}return _0x32bd29;}return null;})[_0x0f23('0x37')](respondWithResult(_0x4e91d9,null))['catch'](handleError(_0x4e91d9,null));};var interaction_log=require(_0x0f23('0x7c'))('whatsapp-interactions');exports[_0x0f23('0x35')]=function(_0x16fbc9,_0x30bcb6,_0xb9c07b){var _0x2bfaf4={'agent':{},'channel':_0x0f23('0x5f')};if(_0x16fbc9[_0x0f23('0x5a')]['id']){delete _0x16fbc9[_0x0f23('0x5a')]['id'];}_0x16fbc9[_0x0f23('0x5a')][_0x0f23('0x64')]=_0x16fbc9[_0x0f23('0x5a')][_0x0f23('0x64')]||_0x16fbc9[_0x0f23('0x65')]['id'];_0x2bfaf4[_0x0f23('0x72')]['id']=_0x16fbc9[_0x0f23('0x5a')][_0x0f23('0x64')];return db['WhatsappMessage'][_0x0f23('0x58')]({'where':{'id':_0x16fbc9['params']['id'],'UserId':null}})[_0x0f23('0x37')](handleEntityNotFound(_0x30bcb6,null))['then'](function(_0x5c7571){if(_0x5c7571){_0x2bfaf4['message']=_0x5c7571[_0x0f23('0x66')]({'plain':!![]});return db['WhatsappInteraction'][_0x0f23('0x58')]({'where':{'id':_0x5c7571[_0x0f23('0x7d')]}});}return null;})['then'](handleEntityNotFound(_0x30bcb6,null))[_0x0f23('0x37')](function(_0x43b6a8){if(_0x43b6a8){_0x2bfaf4[_0x0f23('0x6b')]=_0x43b6a8[_0x0f23('0x66')]({'plain':!![]});interaction_log[_0x0f23('0x20')](_0x0f23('0x7e'),_0x16fbc9[_0x0f23('0x65')]['id'],_0x16fbc9[_0x0f23('0x65')]['name'],_0x16fbc9[_0x0f23('0x65')][_0x0f23('0x7f')],_0x2bfaf4[_0x0f23('0x6b')]['id'],_0x16fbc9[_0x0f23('0x5a')]?JSON['stringify'](_0x16fbc9[_0x0f23('0x5a')]):_0x0f23('0x80'));return respondWithRpcPromise(_0x0f23('0x81'),_0x0f23('0x82'),_0x2bfaf4);}return null;})['then'](function(_0x33ecd9){var _0x78a838=_0x0f23('0x6d')+_0x33ecd9[_0x0f23('0x28')][_0x0f23('0x6e')];return db[_0x0f23('0x6f')][_0x0f23('0x41')](_0x78a838,{'type':db[_0x0f23('0x83')][_0x0f23('0x70')][_0x0f23('0x71')],'raw':!![]})[_0x0f23('0x37')](function(_0x5a1e65){return _0x5a1e65;});})['then'](function(_0x42ae13){if(_0x42ae13){_0x2bfaf4[_0x0f23('0x28')][_0x0f23('0x84')]=_0x42ae13[0x0];if(!_0x16fbc9[_0x0f23('0x5a')][_0x0f23('0x64')])return;return db['User'][_0x0f23('0x58')]({'where':{'id':_0x16fbc9[_0x0f23('0x5a')]['UserId'],'role':'agent'},'attributes':['id',_0x0f23('0x39'),_0x0f23('0x73'),_0x0f23('0x74'),_0x0f23('0x75')],'raw':!![]});}return null;})[_0x0f23('0x37')](function(_0x5a152e){if(!_0x5a152e)return null;_0x2bfaf4[_0x0f23('0x28')][_0x0f23('0x72')]=_0x5a152e;return _0x2bfaf4;})[_0x0f23('0x37')](function(_0x338cf8){if(_0x338cf8){_0x338cf8[_0x0f23('0x28')][_0x0f23('0x77')]=util[_0x0f23('0x62')](_0x0f23('0x78'),_0x16fbc9[_0x0f23('0x65')]['name']);_0x338cf8[_0x0f23('0x28')][_0x0f23('0x79')]=_0x2bfaf4[_0x0f23('0x79')];_0x338cf8['message']['event']='reject';respondWithRpcPromise(_0x0f23('0x7b'),_0x0f23('0x7b'),{'event':_0x0f23('0x85'),'message':_0x338cf8[_0x0f23('0x28')]},client9002);return _0x2bfaf4;}return null;})[_0x0f23('0x37')](respondWithResult(_0x30bcb6,null))[_0x0f23('0x2a')](handleError(_0x30bcb6,null));};exports[_0x0f23('0x2c')]=function(_0x1908dd,_0x8d8669,_0x528042){if(_0x1908dd[_0x0f23('0x5a')]['id']){delete _0x1908dd[_0x0f23('0x5a')]['id'];}var _0x2e1974;return db[_0x0f23('0x3c')][_0x0f23('0x58')]({'where':{'id':_0x1908dd[_0x0f23('0x54')]['id']}})[_0x0f23('0x37')](handleEntityNotFound(_0x8d8669,null))[_0x0f23('0x37')](function(_0x433d15){if(_0x433d15){_0x2e1974=_0x433d15;return db[_0x0f23('0x86')][_0x0f23('0x58')]({'where':{'id':_0x433d15[_0x0f23('0x87')]}});}})[_0x0f23('0x37')](handleEntityNotFound(_0x8d8669,null))['then'](function(_0x56f181){if(_0x56f181){logger['debug'](_0x0f23('0x88'),_0x0f23('0x2c'),_0x0f23('0x89'),_0x56f181['type'],util[_0x0f23('0x8a')](_0x1908dd['body'],{'showHidden':![],'depth':null}));switch(_0x56f181[_0x0f23('0x3f')]){case _0x0f23('0x8b'):if(_0x1908dd['body'][_0x0f23('0x8c')]&&_0x1908dd[_0x0f23('0x5a')][_0x0f23('0x8c')]===_0x2e1974[_0x0f23('0x8d')]&&_0x1908dd[_0x0f23('0x5a')][_0x0f23('0x8e')]&&_0x1908dd[_0x0f23('0x5a')][_0x0f23('0x8e')]===_0x0f23('0x60')){return _0x2e1974[_0x0f23('0x36')]({'read':!![]});}else{logger['error']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x0f23('0x2c'),_0x0f23('0x8b'),util['inspect'](_0x1908dd[_0x0f23('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x2e1974;}})['then'](respondWithResult(_0x8d8669,null))[_0x0f23('0x2a')](handleError(_0x8d8669,null));}; \ No newline at end of file +var _0xb7f0=['UserId','get','WhatsappInteraction','WhatsappInteractionId','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','contact','User','agent','email','internal','manual','interface','channel','event','EventManager','acceptmessage','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','QueryTypes','SELECT','SIP/%s','rejectmessage','WhatsappAccount','WhatsappAccountId','received\x20delivery\x20report\x20from','twilio','MessageSid','MessageStatus','read','WhatsappAccount,\x20%s,\x20%s,\x20%s','inspect','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','end','status','json','offset','undefined','limit','count','set','apply','save','update','destroy','sendStatus','stack','name','send','map','WhatsappMessage','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','show','params','keys','rawAttributes','options','create','body','find','describe','whatsapp-interactions','accept','whatsapp','readAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x26d48d,_0x101199){var _0x5be7ab=function(_0x13bfb6){while(--_0x13bfb6){_0x26d48d['push'](_0x26d48d['shift']());}};_0x5be7ab(++_0x101199);}(_0xb7f0,0x1c7));var _0x0b7f=function(_0x31ad86,_0x2fce0e){_0x31ad86=_0x31ad86-0x0;var _0x5e3989=_0xb7f0[_0x31ad86];return _0x5e3989;};'use strict';var emlformat=require(_0x0b7f('0x0'));var rimraf=require(_0x0b7f('0x1'));var zipdir=require(_0x0b7f('0x2'));var jsonpatch=require(_0x0b7f('0x3'));var rp=require(_0x0b7f('0x4'));var moment=require('moment');var BPromise=require(_0x0b7f('0x5'));var Mustache=require(_0x0b7f('0x6'));var util=require(_0x0b7f('0x7'));var path=require(_0x0b7f('0x8'));var sox=require(_0x0b7f('0x9'));var csv=require(_0x0b7f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0b7f('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0b7f('0xc'));var toCsv=require(_0x0b7f('0xa'));var querystring=require(_0x0b7f('0xd'));var Papa=require(_0x0b7f('0xe'));var Redis=require(_0x0b7f('0xf'));var authService=require(_0x0b7f('0x10'));var qs=require(_0x0b7f('0x11'));var as=require(_0x0b7f('0x12'));var hardwareService=require(_0x0b7f('0x13'));var logger=require(_0x0b7f('0x14'))(_0x0b7f('0x15'));var utils=require('../../config/utils');var config=require(_0x0b7f('0x16'));var licenseUtil=require(_0x0b7f('0x17'));var db=require(_0x0b7f('0x18'))['db'];config[_0x0b7f('0x19')]=_[_0x0b7f('0x1a')](config['redis'],{'host':_0x0b7f('0x1b'),'port':0x18eb});var socket=require(_0x0b7f('0x1c'))(new Redis(config[_0x0b7f('0x19')]));require('./whatsappMessage.socket')['register'](socket);var jayson=require(_0x0b7f('0x1d'));var client=jayson[_0x0b7f('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0x0b7f('0x1e')][_0x0b7f('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x19950c,_0x44500c,_0x359491,_0x4f2b62){return new BPromise(function(_0x53260a,_0x3676d3){var _0x320219=_0x4f2b62||client;return _0x320219['request'](_0x19950c,_0x359491)[_0x0b7f('0x20')](function(_0xd377af){logger[_0x0b7f('0x21')](_0x0b7f('0x22'),_0x44500c,_0x0b7f('0x23'));logger['debug'](_0x0b7f('0x24'),_0x44500c,_0x0b7f('0x23'),JSON[_0x0b7f('0x25')](_0xd377af));if(_0xd377af[_0x0b7f('0x26')]){if(_0xd377af[_0x0b7f('0x26')][_0x0b7f('0x27')]===0x1f4){logger[_0x0b7f('0x26')]('WhatsappMessage,\x20%s,\x20%s',_0x44500c,_0xd377af['error'][_0x0b7f('0x28')]);return _0x3676d3(_0xd377af[_0x0b7f('0x26')][_0x0b7f('0x28')]);}logger[_0x0b7f('0x26')]('WhatsappMessage,\x20%s,\x20%s',_0x44500c,_0xd377af[_0x0b7f('0x26')][_0x0b7f('0x28')]);return _0x53260a(_0xd377af[_0x0b7f('0x26')][_0x0b7f('0x28')]);}else{logger[_0x0b7f('0x21')]('WhatsappMessage,\x20%s,\x20%s',_0x44500c,'request\x20sent');_0x53260a(_0xd377af['result'][_0x0b7f('0x28')]);}})[_0x0b7f('0x29')](function(_0x45e84e){logger['error'](_0x0b7f('0x22'),_0x44500c,_0x45e84e);_0x3676d3(_0x45e84e);});});}function respondWithStatusCode(_0x2742a6,_0x474179){_0x474179=_0x474179||0xcc;return function(_0x1f4f61){if(_0x1f4f61){return _0x2742a6['sendStatus'](_0x474179);}return _0x2742a6['status'](_0x474179)[_0x0b7f('0x2a')]();};}function respondWithResult(_0x1eb8c2,_0x3640a2){_0x3640a2=_0x3640a2||0xc8;return function(_0x2727c6){if(_0x2727c6){return _0x1eb8c2[_0x0b7f('0x2b')](_0x3640a2)[_0x0b7f('0x2c')](_0x2727c6);}};}function respondWithFilteredResult(_0x513c57,_0x5eda10){return function(_0x2ba6d6){if(_0x2ba6d6){var _0x415c33=typeof _0x5eda10[_0x0b7f('0x2d')]===_0x0b7f('0x2e')&&typeof _0x5eda10[_0x0b7f('0x2f')]==='undefined';var _0x6aca48=_0x2ba6d6[_0x0b7f('0x30')];var _0x524288=_0x415c33?0x0:_0x5eda10[_0x0b7f('0x2d')];var _0x2b671e=_0x415c33?_0x2ba6d6[_0x0b7f('0x30')]:_0x5eda10[_0x0b7f('0x2d')]+_0x5eda10[_0x0b7f('0x2f')];var _0x18f348;if(_0x2b671e>=_0x6aca48){_0x2b671e=_0x6aca48;_0x18f348=0xc8;}else{_0x18f348=0xce;}_0x513c57['status'](_0x18f348);return _0x513c57[_0x0b7f('0x31')]('Content-Range',_0x524288+'-'+_0x2b671e+'/'+_0x6aca48)['json'](_0x2ba6d6);}return null;};}function patchUpdates(_0x25f71b){return function(_0x2ef6ad){try{jsonpatch[_0x0b7f('0x32')](_0x2ef6ad,_0x25f71b,!![]);}catch(_0x52be4e){return BPromise['reject'](_0x52be4e);}return _0x2ef6ad[_0x0b7f('0x33')]();};}function saveUpdates(_0x5be9fd,_0x523cfb){return function(_0x58a321){if(_0x58a321){return _0x58a321[_0x0b7f('0x34')](_0x5be9fd)[_0x0b7f('0x20')](function(_0x157d51){return _0x157d51;});}return null;};}function removeEntity(_0x2641cd,_0x49c91b){return function(_0x16b67d){if(_0x16b67d){return _0x16b67d[_0x0b7f('0x35')]()[_0x0b7f('0x20')](function(){_0x2641cd[_0x0b7f('0x2b')](0xcc)[_0x0b7f('0x2a')]();});}};}function handleEntityNotFound(_0x5e350a,_0x24d8d6){return function(_0x4e6005){if(!_0x4e6005){_0x5e350a[_0x0b7f('0x36')](0x194);}return _0x4e6005;};}function handleError(_0x251a3c,_0x43b5c4){_0x43b5c4=_0x43b5c4||0x1f4;return function(_0x8a90ec){logger[_0x0b7f('0x26')](_0x8a90ec[_0x0b7f('0x37')]);if(_0x8a90ec[_0x0b7f('0x38')]){delete _0x8a90ec[_0x0b7f('0x38')];}_0x251a3c['status'](_0x43b5c4)[_0x0b7f('0x39')](_0x8a90ec);};}exports['index']=function(_0xe1bd81,_0x6a5e35){var _0x530bbe={},_0x2066f3={},_0x46d70e={'count':0x0,'rows':[]};var _0x253303=_[_0x0b7f('0x3a')](db[_0x0b7f('0x3b')]['rawAttributes'],function(_0xc7e8f7){return{'name':_0xc7e8f7[_0x0b7f('0x3c')],'type':_0xc7e8f7[_0x0b7f('0x3d')][_0x0b7f('0x3e')]};});_0x2066f3[_0x0b7f('0x3f')]=_['map'](_0x253303,_0x0b7f('0x38'));_0x2066f3['query']=_['keys'](_0xe1bd81[_0x0b7f('0x40')]);_0x2066f3[_0x0b7f('0x41')]=_[_0x0b7f('0x42')](_0x2066f3[_0x0b7f('0x3f')],_0x2066f3[_0x0b7f('0x40')]);_0x530bbe[_0x0b7f('0x43')]=_['intersection'](_0x2066f3[_0x0b7f('0x3f')],qs[_0x0b7f('0x44')](_0xe1bd81['query'][_0x0b7f('0x44')]));_0x530bbe[_0x0b7f('0x43')]=_0x530bbe[_0x0b7f('0x43')][_0x0b7f('0x45')]?_0x530bbe['attributes']:_0x2066f3[_0x0b7f('0x3f')];if(!_0xe1bd81[_0x0b7f('0x40')][_0x0b7f('0x46')](_0x0b7f('0x47'))){_0x530bbe[_0x0b7f('0x2f')]=qs[_0x0b7f('0x2f')](_0xe1bd81[_0x0b7f('0x40')][_0x0b7f('0x2f')]);_0x530bbe[_0x0b7f('0x2d')]=qs['offset'](_0xe1bd81[_0x0b7f('0x40')][_0x0b7f('0x2d')]);}_0x530bbe[_0x0b7f('0x48')]=qs[_0x0b7f('0x49')](_0xe1bd81[_0x0b7f('0x40')][_0x0b7f('0x49')]);_0x530bbe[_0x0b7f('0x4a')]=qs[_0x0b7f('0x41')](_[_0x0b7f('0x4b')](_0xe1bd81['query'],_0x2066f3[_0x0b7f('0x41')]),_0x253303);if(_0xe1bd81['query'][_0x0b7f('0x4c')]){_0x530bbe[_0x0b7f('0x4a')]=_[_0x0b7f('0x4d')](_0x530bbe['where'],{'$or':_['map'](_0x253303,function(_0x215d79){if(_0x215d79[_0x0b7f('0x3d')]!==_0x0b7f('0x4e')){var _0x2a3a20={};_0x2a3a20[_0x215d79['name']]={'$like':'%'+_0xe1bd81[_0x0b7f('0x40')]['filter']+'%'};return _0x2a3a20;}})});}_0x530bbe=_[_0x0b7f('0x4d')]({},_0x530bbe,_0xe1bd81['options']);var _0xbe2cd8={'where':_0x530bbe[_0x0b7f('0x4a')]};return db[_0x0b7f('0x3b')][_0x0b7f('0x30')](_0xbe2cd8)['then'](function(_0xe5232a){_0x46d70e['count']=_0xe5232a;if(_0xe1bd81['query'][_0x0b7f('0x4f')]){_0x530bbe[_0x0b7f('0x50')]=[{'all':!![]}];}return db['WhatsappMessage'][_0x0b7f('0x51')](_0x530bbe);})[_0x0b7f('0x20')](function(_0x5855aa){_0x46d70e['rows']=_0x5855aa;return _0x46d70e;})[_0x0b7f('0x20')](respondWithFilteredResult(_0x6a5e35,_0x530bbe))[_0x0b7f('0x29')](handleError(_0x6a5e35,null));};exports[_0x0b7f('0x52')]=function(_0x607c1e,_0x471de9){var _0x129a0e={'raw':!![],'where':{'id':_0x607c1e[_0x0b7f('0x53')]['id']}},_0xc327b9={};_0xc327b9[_0x0b7f('0x3f')]=_[_0x0b7f('0x54')](db[_0x0b7f('0x3b')][_0x0b7f('0x55')]);_0xc327b9['query']=_[_0x0b7f('0x54')](_0x607c1e[_0x0b7f('0x40')]);_0xc327b9[_0x0b7f('0x41')]=_[_0x0b7f('0x42')](_0xc327b9['model'],_0xc327b9[_0x0b7f('0x40')]);_0x129a0e['attributes']=_[_0x0b7f('0x42')](_0xc327b9[_0x0b7f('0x3f')],qs[_0x0b7f('0x44')](_0x607c1e[_0x0b7f('0x40')][_0x0b7f('0x44')]));_0x129a0e[_0x0b7f('0x43')]=_0x129a0e[_0x0b7f('0x43')][_0x0b7f('0x45')]?_0x129a0e[_0x0b7f('0x43')]:_0xc327b9[_0x0b7f('0x3f')];if(_0x607c1e[_0x0b7f('0x40')][_0x0b7f('0x4f')]){_0x129a0e[_0x0b7f('0x50')]=[{'all':!![]}];}_0x129a0e=_['merge']({},_0x129a0e,_0x607c1e[_0x0b7f('0x56')]);return db['WhatsappMessage']['find'](_0x129a0e)[_0x0b7f('0x20')](handleEntityNotFound(_0x471de9,null))['then'](respondWithResult(_0x471de9,null))[_0x0b7f('0x29')](handleError(_0x471de9,null));};exports[_0x0b7f('0x57')]=function(_0x2ef7cc,_0x194d77){return db['WhatsappMessage']['create'](_0x2ef7cc['body'],{})['then'](respondWithResult(_0x194d77,0xc9))[_0x0b7f('0x29')](handleError(_0x194d77,null));};exports[_0x0b7f('0x34')]=function(_0x2807a6,_0x36ccd7){if(_0x2807a6[_0x0b7f('0x58')]['id']){delete _0x2807a6[_0x0b7f('0x58')]['id'];}return db['WhatsappMessage']['find']({'where':{'id':_0x2807a6[_0x0b7f('0x53')]['id']}})[_0x0b7f('0x20')](handleEntityNotFound(_0x36ccd7,null))[_0x0b7f('0x20')](saveUpdates(_0x2807a6[_0x0b7f('0x58')],null))['then'](respondWithResult(_0x36ccd7,null))[_0x0b7f('0x29')](handleError(_0x36ccd7,null));};exports[_0x0b7f('0x35')]=function(_0x1eee87,_0x4a11d8){return db[_0x0b7f('0x3b')][_0x0b7f('0x59')]({'where':{'id':_0x1eee87['params']['id']}})[_0x0b7f('0x20')](handleEntityNotFound(_0x4a11d8,null))[_0x0b7f('0x20')](removeEntity(_0x4a11d8,null))[_0x0b7f('0x29')](handleError(_0x4a11d8,null));};exports[_0x0b7f('0x5a')]=function(_0xebe411,_0x24cd9e){return db[_0x0b7f('0x3b')][_0x0b7f('0x5a')]()[_0x0b7f('0x20')](respondWithResult(_0x24cd9e,null))[_0x0b7f('0x29')](handleError(_0x24cd9e,null));};var interaction_log=require(_0x0b7f('0x14'))(_0x0b7f('0x5b'));exports[_0x0b7f('0x5c')]=function(_0x3a886d,_0x23372b,_0xc779b4){var _0x5e7ad0={'agent':{},'channel':_0x0b7f('0x5d')};if(_0x3a886d[_0x0b7f('0x58')]['id']){delete _0x3a886d['body']['id'];}_0x3a886d[_0x0b7f('0x58')]['read']=!![];_0x3a886d['body'][_0x0b7f('0x5e')]=moment()[_0x0b7f('0x5f')](_0x0b7f('0x60'));_0x3a886d['body'][_0x0b7f('0x61')]=_0x3a886d[_0x0b7f('0x58')][_0x0b7f('0x61')]||_0x3a886d['user']['id'];_0x5e7ad0['agent']['id']=_0x3a886d[_0x0b7f('0x58')][_0x0b7f('0x61')];return db[_0x0b7f('0x3b')]['find']({'where':{'id':_0x3a886d[_0x0b7f('0x53')]['id'],'UserId':null}})[_0x0b7f('0x20')](handleEntityNotFound(_0x23372b,null))[_0x0b7f('0x20')](saveUpdates(_0x3a886d[_0x0b7f('0x58')],null))['then'](function(_0x2b6b39){if(_0x2b6b39){_0x5e7ad0[_0x0b7f('0x28')]=_0x2b6b39[_0x0b7f('0x62')]({'plain':!![]});return db[_0x0b7f('0x63')][_0x0b7f('0x59')]({'where':{'id':_0x2b6b39[_0x0b7f('0x64')]}});}return null;})[_0x0b7f('0x20')](handleEntityNotFound(_0x23372b,null))[_0x0b7f('0x20')](function(_0x444960){if(_0x444960){return _0x444960[_0x0b7f('0x34')]({'UserId':_0x3a886d['body'][_0x0b7f('0x61')],'read1stAt':_['isNil'](_0x444960['read1stAt'])?moment()[_0x0b7f('0x5f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x0b7f('0x20')](function(_0x4410a5){if(_0x4410a5){_0x5e7ad0[_0x0b7f('0x65')]=_0x4410a5[_0x0b7f('0x62')]({'plain':!![]});interaction_log['info'](_0x0b7f('0x66'),_0x3a886d[_0x0b7f('0x67')]['id'],_0x3a886d[_0x0b7f('0x67')]['name'],_0x3a886d[_0x0b7f('0x67')]['role'],_0x5e7ad0['interaction']['id'],_0x3a886d[_0x0b7f('0x58')]?JSON[_0x0b7f('0x25')](_0x3a886d[_0x0b7f('0x58')]):_0x0b7f('0x68'));return respondWithRpcPromise(_0x0b7f('0x69'),_0x0b7f('0x6a'),_0x5e7ad0);}return null;})[_0x0b7f('0x20')](function(_0x2bffcb){var _0x1ef359=_0x0b7f('0x6b')+_0x2bffcb[_0x0b7f('0x28')][_0x0b7f('0x6c')];return db['sequelize'][_0x0b7f('0x40')](_0x1ef359,{'type':db[_0x0b7f('0x6d')]['QueryTypes']['SELECT'],'raw':!![]})[_0x0b7f('0x20')](function(_0x488a9f){return _0x488a9f;});})['then'](function(_0x51b620){if(_0x51b620){_0x5e7ad0[_0x0b7f('0x28')][_0x0b7f('0x6e')]=_0x51b620[0x0];if(!_0x3a886d[_0x0b7f('0x58')][_0x0b7f('0x61')])return;return db[_0x0b7f('0x6f')]['find']({'where':{'id':_0x3a886d[_0x0b7f('0x58')][_0x0b7f('0x61')],'role':_0x0b7f('0x70')},'attributes':['id',_0x0b7f('0x38'),'fullname',_0x0b7f('0x71'),_0x0b7f('0x72')],'raw':!![]});}return null;})[_0x0b7f('0x20')](function(_0x321357){if(!_0x321357)return null;_0x5e7ad0[_0x0b7f('0x28')][_0x0b7f('0x70')]=_0x321357;return _0x5e7ad0;})[_0x0b7f('0x20')](function(_0x3ae1db){if(_0x3ae1db){if(_0x3a886d['body'][_0x0b7f('0x73')]){_0x5e7ad0[_0x0b7f('0x28')][_0x0b7f('0x74')]=util['format']('SIP/%s',_0x3a886d[_0x0b7f('0x67')]['name']);_0x5e7ad0[_0x0b7f('0x28')]['channel']=_0x5e7ad0[_0x0b7f('0x75')];_0x5e7ad0['message'][_0x0b7f('0x76')]=_0x0b7f('0x5c');return respondWithRpcPromise(_0x0b7f('0x77'),_0x0b7f('0x77'),{'event':_0x0b7f('0x78'),'message':_0x5e7ad0[_0x0b7f('0x28')]},client9002)[_0x0b7f('0x20')](function(){return _0x5e7ad0;});}return _0x5e7ad0;}return null;})['then'](respondWithResult(_0x23372b,null))[_0x0b7f('0x29')](handleError(_0x23372b,null));};var interaction_log=require(_0x0b7f('0x14'))('whatsapp-interactions');exports['reject']=function(_0x237469,_0x24147c,_0x3a999c){var _0x5190d2={'agent':{},'channel':'whatsapp'};if(_0x237469[_0x0b7f('0x58')]['id']){delete _0x237469[_0x0b7f('0x58')]['id'];}_0x237469[_0x0b7f('0x58')][_0x0b7f('0x61')]=_0x237469[_0x0b7f('0x58')][_0x0b7f('0x61')]||_0x237469[_0x0b7f('0x67')]['id'];_0x5190d2[_0x0b7f('0x70')]['id']=_0x237469[_0x0b7f('0x58')]['UserId'];return db[_0x0b7f('0x3b')][_0x0b7f('0x59')]({'where':{'id':_0x237469[_0x0b7f('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x24147c,null))[_0x0b7f('0x20')](function(_0x5d3ce9){if(_0x5d3ce9){_0x5190d2[_0x0b7f('0x28')]=_0x5d3ce9['get']({'plain':!![]});return db[_0x0b7f('0x63')][_0x0b7f('0x59')]({'where':{'id':_0x5d3ce9[_0x0b7f('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x24147c,null))[_0x0b7f('0x20')](function(_0x1267c8){if(_0x1267c8){_0x5190d2[_0x0b7f('0x65')]=_0x1267c8['get']({'plain':!![]});interaction_log[_0x0b7f('0x21')](_0x0b7f('0x79'),_0x237469[_0x0b7f('0x67')]['id'],_0x237469[_0x0b7f('0x67')][_0x0b7f('0x38')],_0x237469[_0x0b7f('0x67')]['role'],_0x5190d2[_0x0b7f('0x65')]['id'],_0x237469[_0x0b7f('0x58')]?JSON[_0x0b7f('0x25')](_0x237469[_0x0b7f('0x58')]):_0x0b7f('0x68'));return respondWithRpcPromise(_0x0b7f('0x7a'),_0x0b7f('0x7b'),_0x5190d2);}return null;})[_0x0b7f('0x20')](function(_0x4253c6){var _0x336e19='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4253c6[_0x0b7f('0x28')][_0x0b7f('0x6c')];return db[_0x0b7f('0x7c')]['query'](_0x336e19,{'type':db['Sequelize'][_0x0b7f('0x7d')][_0x0b7f('0x7e')],'raw':!![]})[_0x0b7f('0x20')](function(_0x908d03){return _0x908d03;});})['then'](function(_0x4a6027){if(_0x4a6027){_0x5190d2[_0x0b7f('0x28')][_0x0b7f('0x6e')]=_0x4a6027[0x0];if(!_0x237469[_0x0b7f('0x58')][_0x0b7f('0x61')])return;return db['User'][_0x0b7f('0x59')]({'where':{'id':_0x237469[_0x0b7f('0x58')]['UserId'],'role':_0x0b7f('0x70')},'attributes':['id',_0x0b7f('0x38'),'fullname',_0x0b7f('0x71'),_0x0b7f('0x72')],'raw':!![]});}return null;})['then'](function(_0x1b3355){if(!_0x1b3355)return null;_0x5190d2['message']['agent']=_0x1b3355;return _0x5190d2;})['then'](function(_0x2fd263){if(_0x2fd263){_0x2fd263[_0x0b7f('0x28')][_0x0b7f('0x74')]=util[_0x0b7f('0x5f')](_0x0b7f('0x7f'),_0x237469['user']['name']);_0x2fd263[_0x0b7f('0x28')][_0x0b7f('0x75')]=_0x5190d2[_0x0b7f('0x75')];_0x2fd263['message'][_0x0b7f('0x76')]='reject';respondWithRpcPromise(_0x0b7f('0x77'),_0x0b7f('0x77'),{'event':_0x0b7f('0x80'),'message':_0x2fd263[_0x0b7f('0x28')]},client9002);return _0x5190d2;}return null;})[_0x0b7f('0x20')](respondWithResult(_0x24147c,null))[_0x0b7f('0x29')](handleError(_0x24147c,null));};exports[_0x0b7f('0x2b')]=function(_0x5dfb60,_0x4baf4f,_0xccc6a7){if(_0x5dfb60[_0x0b7f('0x58')]['id']){delete _0x5dfb60[_0x0b7f('0x58')]['id'];}var _0x4dd4bb;return db[_0x0b7f('0x3b')][_0x0b7f('0x59')]({'where':{'id':_0x5dfb60[_0x0b7f('0x53')]['id']}})[_0x0b7f('0x20')](handleEntityNotFound(_0x4baf4f,null))[_0x0b7f('0x20')](function(_0x1586a5){if(_0x1586a5){_0x4dd4bb=_0x1586a5;return db[_0x0b7f('0x81')][_0x0b7f('0x59')]({'where':{'id':_0x1586a5[_0x0b7f('0x82')]}});}})[_0x0b7f('0x20')](handleEntityNotFound(_0x4baf4f,null))[_0x0b7f('0x20')](function(_0x292bae){if(_0x292bae){logger['debug']('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0x0b7f('0x2b'),_0x0b7f('0x83'),_0x292bae[_0x0b7f('0x3d')],util['inspect'](_0x5dfb60[_0x0b7f('0x58')],{'showHidden':![],'depth':null}));switch(_0x292bae[_0x0b7f('0x3d')]){case _0x0b7f('0x84'):if(_0x5dfb60[_0x0b7f('0x58')][_0x0b7f('0x85')]&&_0x5dfb60[_0x0b7f('0x58')]['MessageSid']===_0x4dd4bb['messageId']&&_0x5dfb60[_0x0b7f('0x58')][_0x0b7f('0x86')]&&_0x5dfb60[_0x0b7f('0x58')]['MessageStatus']===_0x0b7f('0x87')){return _0x4dd4bb['update']({'read':!![]});}else{logger[_0x0b7f('0x26')](_0x0b7f('0x88'),_0x0b7f('0x2b'),'twilio',util[_0x0b7f('0x89')](_0x5dfb60[_0x0b7f('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x4dd4bb;}})[_0x0b7f('0x20')](respondWithResult(_0x4baf4f,null))[_0x0b7f('0x29')](handleError(_0x4baf4f,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 5a5ba63..d01b8eb 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 _0xd52d=['WhatsappMessage','save','emit','hasOwnProperty','hook','../../mysqldb'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xd52d,0x1c7));var _0xdd52=function(_0x1eaf2e,_0x56e834){_0x1eaf2e=_0x1eaf2e-0x0;var _0x36e8aa=_0xd52d[_0x1eaf2e];return _0x36e8aa;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0xdd52('0x0'))['db'][_0xdd52('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdd52('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1dfed5){return function(_0x211062,_0x30fb04,_0x29a95e){WhatsappMessageEvents[_0xdd52('0x3')](_0x1dfed5+':'+_0x211062['id'],_0x211062);WhatsappMessageEvents[_0xdd52('0x3')](_0x1dfed5,_0x211062);_0x29a95e(null);};}for(var e in events){if(events[_0xdd52('0x4')](e)){var event=events[e];WhatsappMessage[_0xdd52('0x5')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file +var _0xc788=['WhatsappMessage','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x50f9ab,_0x5009b4){var _0x58dda4=function(_0x5f1ff5){while(--_0x5f1ff5){_0x50f9ab['push'](_0x50f9ab['shift']());}};_0x58dda4(++_0x5009b4);}(_0xc788,0xc4));var _0x8c78=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc788[_0x4a9fb1];return _0x348672;};'use strict';var EventEmitter=require(_0x8c78('0x0'));var WhatsappMessage=require(_0x8c78('0x1'))['db'][_0x8c78('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x8c78('0x3'),'afterDestroy':_0x8c78('0x4')};function emitEvent(_0x23eec0){return function(_0x1d0670,_0x386f0a,_0x5498f9){WhatsappMessageEvents[_0x8c78('0x5')](_0x23eec0+':'+_0x1d0670['id'],_0x1d0670);WhatsappMessageEvents[_0x8c78('0x5')](_0x23eec0,_0x1d0670);_0x5498f9(null);};}for(var e in events){if(events[_0x8c78('0x6')](e)){var event=events[e];WhatsappMessage[_0x8c78('0x7')](e,emitEvent(event));}}module[_0x8c78('0x8')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index d5596ba..c5c098b 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 _0x37b4=['findOne','then','update','createdAt','catch','error','WhatsappAccount','WhatsappAccountId','type','accountSid','authToken','messages','create','whatsapp:','phone','remote','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','twilio','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','define','whatsapp_messages','messageId','FULLTEXT','get','direction','toLowerCase','out','secret','UserId','WhatsappInteraction'];(function(_0xcfd9c6,_0x21836f){var _0x5b02e7=function(_0x4c9115){while(--_0x4c9115){_0xcfd9c6['push'](_0xcfd9c6['shift']());}};_0x5b02e7(++_0x21836f);}(_0x37b4,0xef));var _0x437b=function(_0x43371b,_0x1cb4cf){_0x43371b=_0x43371b-0x0;var _0x19cd26=_0x37b4[_0x43371b];return _0x19cd26;};'use strict';var _=require(_0x437b('0x0'));var util=require('util');var logger=require(_0x437b('0x1'))(_0x437b('0x2'));var moment=require(_0x437b('0x3'));var BPromise=require('bluebird');var rp=require(_0x437b('0x4'));var fs=require('fs');var path=require(_0x437b('0x5'));var rimraf=require(_0x437b('0x6'));var config=require(_0x437b('0x7'));var attributes=require('./whatsappMessage.attributes');module['exports']=function(_0x1bab79,_0x560099){return _0x1bab79[_0x437b('0x8')]('WhatsappMessage',attributes,{'tableName':_0x437b('0x9'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x437b('0xa')]},{'name':'fti_whatsapp_messages','fields':['body'],'type':_0x437b('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xfcf11a,_0x5ee65b,_0x474464){var _0x4ca515=_0x1bab79['models'];var _0x33f17d=_0xfcf11a[_0x437b('0xc')]({'plain':!![]});if(_0x33f17d[_0x437b('0xd')][_0x437b('0xe')]()==='in'||_0x33f17d['direction'][_0x437b('0xe')]()===_0x437b('0xf')&&!_0x33f17d[_0x437b('0x10')]&&!_['isNil'](_0x33f17d[_0x437b('0x11')])){_0x4ca515[_0x437b('0x12')][_0x437b('0x13')]({'where':{'id':_0x33f17d['WhatsappInteractionId']}})[_0x437b('0x14')](function(_0x56524c){if(_0x56524c){_0x56524c[_0x437b('0x15')]({'lastMsgAt':_0x33f17d[_0x437b('0x16')],'lastMsgDirection':_0x33f17d[_0x437b('0xd')]['toLowerCase']()});}})[_0x437b('0x17')](function(_0x159076){console[_0x437b('0x18')](_0x159076);});}if(_0x33f17d[_0x437b('0xd')]===_0x437b('0xf')&&!_0x33f17d[_0x437b('0x10')]){var _0x53bb67;_0x4ca515[_0x437b('0x19')]['find']({'where':{'id':_0x33f17d[_0x437b('0x1a')]},'raw':!![]})[_0x437b('0x14')](function(_0x1c91bc){_0x53bb67=_0x1c91bc;if(_0x53bb67&&_0x53bb67[_0x437b('0x1b')]){switch(_0x53bb67['type']){case'twilio':var _0x589939=require('twilio');if(_0x53bb67[_0x437b('0x1c')]&&_0x53bb67[_0x437b('0x1d')]&&_0x53bb67['phone']){var _0x2db7fc=new _0x589939(_0x53bb67['accountSid'],_0x53bb67[_0x437b('0x1d')]);_0x2db7fc[_0x437b('0x1e')][_0x437b('0x1f')]({'body':_0x33f17d['body'],'to':'whatsapp:'+_0x33f17d['phone'],'from':_0x437b('0x20')+_0x53bb67[_0x437b('0x21')],'statusCallback':_0x53bb67[_0x437b('0x22')]+_0x437b('0x23')+_0x33f17d['id']+_0x437b('0x24')+_0x53bb67[_0x437b('0x25')]})[_0x437b('0x14')](function(_0x18869f){if(_0x18869f[_0x437b('0x26')]){return _0xfcf11a[_0x437b('0x15')]({'messageId':_0x18869f[_0x437b('0x26')]});}})['catch'](function(_0x3ec9e6){logger[_0x437b('0x18')](_0x437b('0x27'),_0x437b('0x28'),_0x437b('0x29'),util['inspect'](_0x3ec9e6,{'showHidden':![],'depth':null}));});}else{logger[_0x437b('0x18')](_0x437b('0x27'),'afterCreate',_0x437b('0x29'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;}}})['finally'](function(){_0x474464();});}else{_0x474464();}}},'charset':'utf8mb4','collate':_0x437b('0x2a')});}; \ No newline at end of file +var _0xd7a4=['toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','update','catch','WhatsappAccount','find','WhatsappAccountId','then','type','twilio','authToken','phone','messages','create','whatsapp:','remote','/status?token=','token','sid','error','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','WhatsappMessage','messageId','fti_whatsapp_messages','body','models','get','direction'];(function(_0x535c2b,_0x13368b){var _0x347f9d=function(_0x1c3b4d){while(--_0x1c3b4d){_0x535c2b['push'](_0x535c2b['shift']());}};_0x347f9d(++_0x13368b);}(_0xd7a4,0x11f));var _0x4d7a=function(_0x5859f8,_0x28a2c3){_0x5859f8=_0x5859f8-0x0;var _0x2bb13f=_0xd7a4[_0x5859f8];return _0x2bb13f;};'use strict';var _=require(_0x4d7a('0x0'));var util=require(_0x4d7a('0x1'));var logger=require(_0x4d7a('0x2'))(_0x4d7a('0x3'));var moment=require(_0x4d7a('0x4'));var BPromise=require(_0x4d7a('0x5'));var rp=require(_0x4d7a('0x6'));var fs=require('fs');var path=require(_0x4d7a('0x7'));var rimraf=require(_0x4d7a('0x8'));var config=require(_0x4d7a('0x9'));var attributes=require('./whatsappMessage.attributes');module[_0x4d7a('0xa')]=function(_0x4756b1,_0x13b3b2){return _0x4756b1[_0x4d7a('0xb')](_0x4d7a('0xc'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0x4d7a('0xd'),'fields':[_0x4d7a('0xd')]},{'name':_0x4d7a('0xe'),'fields':[_0x4d7a('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x89280b,_0x2d6cf4,_0x25aa80){var _0x47108b=_0x4756b1[_0x4d7a('0x10')];var _0x3719c7=_0x89280b[_0x4d7a('0x11')]({'plain':!![]});if(_0x3719c7[_0x4d7a('0x12')]['toLowerCase']()==='in'||_0x3719c7[_0x4d7a('0x12')][_0x4d7a('0x13')]()===_0x4d7a('0x14')&&!_0x3719c7[_0x4d7a('0x15')]&&!_[_0x4d7a('0x16')](_0x3719c7[_0x4d7a('0x17')])){_0x47108b[_0x4d7a('0x18')][_0x4d7a('0x19')]({'where':{'id':_0x3719c7[_0x4d7a('0x1a')]}})['then'](function(_0x527412){if(_0x527412){_0x527412[_0x4d7a('0x1b')]({'lastMsgAt':_0x3719c7['createdAt'],'lastMsgDirection':_0x3719c7['direction']['toLowerCase']()});}})[_0x4d7a('0x1c')](function(_0x258683){console['error'](_0x258683);});}if(_0x3719c7[_0x4d7a('0x12')]===_0x4d7a('0x14')&&!_0x3719c7[_0x4d7a('0x15')]){var _0x3a2d96;_0x47108b[_0x4d7a('0x1d')][_0x4d7a('0x1e')]({'where':{'id':_0x3719c7[_0x4d7a('0x1f')]},'raw':!![]})[_0x4d7a('0x20')](function(_0x5a3a2f){_0x3a2d96=_0x5a3a2f;if(_0x3a2d96&&_0x3a2d96[_0x4d7a('0x21')]){switch(_0x3a2d96[_0x4d7a('0x21')]){case _0x4d7a('0x22'):var _0xa101db=require(_0x4d7a('0x22'));if(_0x3a2d96['accountSid']&&_0x3a2d96[_0x4d7a('0x23')]&&_0x3a2d96[_0x4d7a('0x24')]){var _0x54b59f=new _0xa101db(_0x3a2d96['accountSid'],_0x3a2d96[_0x4d7a('0x23')]);_0x54b59f[_0x4d7a('0x25')][_0x4d7a('0x26')]({'body':_0x3719c7[_0x4d7a('0xf')],'to':_0x4d7a('0x27')+_0x3719c7[_0x4d7a('0x24')],'from':_0x4d7a('0x27')+_0x3a2d96[_0x4d7a('0x24')],'statusCallback':_0x3a2d96[_0x4d7a('0x28')]+'/api/whatsapp/messages/'+_0x3719c7['id']+_0x4d7a('0x29')+_0x3a2d96[_0x4d7a('0x2a')]})['then'](function(_0x2b8eb0){if(_0x2b8eb0['sid']){return _0x89280b[_0x4d7a('0x1b')]({'messageId':_0x2b8eb0[_0x4d7a('0x2b')]});}})[_0x4d7a('0x1c')](function(_0xf8f019){logger[_0x4d7a('0x2c')](_0x4d7a('0x2d'),_0x4d7a('0x2e'),_0x4d7a('0x22'),util['inspect'](_0xf8f019,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x4d7a('0x2d'),_0x4d7a('0x2e'),_0x4d7a('0x22'),_0x4d7a('0x2f'));}break;}}})[_0x4d7a('0x30')](function(){_0x25aa80();});}else{_0x25aa80();}}},'charset':_0x4d7a('0x31'),'collate':_0x4d7a('0x32')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index a884275..e3d8c12 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 _0xe7f4=['stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','WhatsappMessage,\x20%s,\x20%s','message','result','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw'];(function(_0x3edc8c,_0x44cc99){var _0x537440=function(_0x23db2d){while(--_0x23db2d){_0x3edc8c['push'](_0x3edc8c['shift']());}};_0x537440(++_0x44cc99);}(_0xe7f4,0xf6));var _0x4e7f=function(_0x3ba924,_0x3b99f0){_0x3ba924=_0x3ba924-0x0;var _0x4cc1df=_0xe7f4[_0x3ba924];return _0x4cc1df;};'use strict';var _=require(_0x4e7f('0x0'));var util=require(_0x4e7f('0x1'));var moment=require(_0x4e7f('0x2'));var BPromise=require(_0x4e7f('0x3'));var rs=require(_0x4e7f('0x4'));var fs=require('fs');var Redis=require(_0x4e7f('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4e7f('0x6'))('rpc');var config=require(_0x4e7f('0x7'));var jayson=require(_0x4e7f('0x8'));var client=jayson[_0x4e7f('0x9')][_0x4e7f('0xa')]({'port':0x232a});config['redis']=_[_0x4e7f('0xb')](config[_0x4e7f('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x4e7f('0xd'))(new Redis(config['redis']));require(_0x4e7f('0xe'))[_0x4e7f('0xf')](socket);function respondWithRpcPromise(_0x5ceb3c,_0x170dce,_0x17dade){return new BPromise(function(_0x542e46,_0x3af019){return client[_0x4e7f('0x10')](_0x5ceb3c,_0x17dade)[_0x4e7f('0x11')](function(_0x1d869d){logger[_0x4e7f('0x12')]('WhatsappMessage,\x20%s,\x20%s',_0x170dce,_0x4e7f('0x13'));logger[_0x4e7f('0x14')](_0x4e7f('0x15'),_0x170dce,_0x4e7f('0x13'),JSON['stringify'](_0x1d869d));if(_0x1d869d[_0x4e7f('0x16')]){if(_0x1d869d[_0x4e7f('0x16')][_0x4e7f('0x17')]===0x1f4){logger[_0x4e7f('0x16')](_0x4e7f('0x18'),_0x170dce,_0x1d869d[_0x4e7f('0x16')][_0x4e7f('0x19')]);return _0x3af019(_0x1d869d[_0x4e7f('0x16')]['message']);}logger[_0x4e7f('0x16')](_0x4e7f('0x18'),_0x170dce,_0x1d869d[_0x4e7f('0x16')][_0x4e7f('0x19')]);return _0x542e46(_0x1d869d[_0x4e7f('0x16')][_0x4e7f('0x19')]);}else{logger[_0x4e7f('0x12')](_0x4e7f('0x18'),_0x170dce,_0x4e7f('0x13'));_0x542e46(_0x1d869d[_0x4e7f('0x1a')][_0x4e7f('0x19')]);}})[_0x4e7f('0x1b')](function(_0x3daf78){logger[_0x4e7f('0x16')](_0x4e7f('0x18'),_0x170dce,_0x3daf78);_0x3af019(_0x3daf78);});});}exports[_0x4e7f('0x1c')]=function(_0x9caab){var _0x249229=this;return new Promise(function(_0x49c59a,_0x6f2d84){return db[_0x4e7f('0x1d')][_0x4e7f('0x1e')](_0x9caab[_0x4e7f('0x1f')],{'raw':_0x9caab['options']?_0x9caab[_0x4e7f('0x20')][_0x4e7f('0x21')]===undefined?!![]:![]:!![]})[_0x4e7f('0x11')](function(_0x6c7d01){logger[_0x4e7f('0x12')](_0x4e7f('0x1c'),_0x9caab);logger[_0x4e7f('0x14')]('CreateWhatsappMessage',_0x9caab,JSON[_0x4e7f('0x22')](_0x6c7d01));_0x49c59a(_0x6c7d01);})[_0x4e7f('0x1b')](function(_0x2988fb){logger[_0x4e7f('0x16')]('CreateWhatsappMessage',_0x2988fb[_0x4e7f('0x19')],_0x9caab);_0x6f2d84(_0x249229[_0x4e7f('0x16')](0x1f4,_0x2988fb[_0x4e7f('0x19')]));});});}; \ No newline at end of file +var _0xadde=['result','catch','CreateWhatsappMessage','WhatsappMessage','options','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','info','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message'];(function(_0x4ced03,_0x1fc06c){var _0x440ba8=function(_0x37d448){while(--_0x37d448){_0x4ced03['push'](_0x4ced03['shift']());}};_0x440ba8(++_0x1fc06c);}(_0xadde,0x1c1));var _0xeadd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xadde[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xeadd('0x0'));var util=require(_0xeadd('0x1'));var moment=require(_0xeadd('0x2'));var BPromise=require(_0xeadd('0x3'));var rs=require(_0xeadd('0x4'));var fs=require('fs');var Redis=require(_0xeadd('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xeadd('0x6'));var logger=require(_0xeadd('0x7'))(_0xeadd('0x8'));var config=require(_0xeadd('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xeadd('0xa')]({'port':0x232a});config[_0xeadd('0xb')]=_[_0xeadd('0xc')](config[_0xeadd('0xb')],{'host':_0xeadd('0xd'),'port':0x18eb});var socket=require(_0xeadd('0xe'))(new Redis(config['redis']));require(_0xeadd('0xf'))[_0xeadd('0x10')](socket);function respondWithRpcPromise(_0x1e97db,_0x4d8d98,_0x393387){return new BPromise(function(_0x1d2322,_0x36ea07){return client[_0xeadd('0x11')](_0x1e97db,_0x393387)['then'](function(_0x40491c){logger[_0xeadd('0x12')]('WhatsappMessage,\x20%s,\x20%s',_0x4d8d98,_0xeadd('0x13'));logger[_0xeadd('0x14')](_0xeadd('0x15'),_0x4d8d98,_0xeadd('0x13'),JSON[_0xeadd('0x16')](_0x40491c));if(_0x40491c[_0xeadd('0x17')]){if(_0x40491c['error'][_0xeadd('0x18')]===0x1f4){logger[_0xeadd('0x17')](_0xeadd('0x19'),_0x4d8d98,_0x40491c[_0xeadd('0x17')]['message']);return _0x36ea07(_0x40491c[_0xeadd('0x17')][_0xeadd('0x1a')]);}logger[_0xeadd('0x17')](_0xeadd('0x19'),_0x4d8d98,_0x40491c[_0xeadd('0x17')][_0xeadd('0x1a')]);return _0x1d2322(_0x40491c[_0xeadd('0x17')]['message']);}else{logger[_0xeadd('0x12')](_0xeadd('0x19'),_0x4d8d98,_0xeadd('0x13'));_0x1d2322(_0x40491c[_0xeadd('0x1b')][_0xeadd('0x1a')]);}})[_0xeadd('0x1c')](function(_0xe68eb3){logger[_0xeadd('0x17')](_0xeadd('0x19'),_0x4d8d98,_0xe68eb3);_0x36ea07(_0xe68eb3);});});}exports[_0xeadd('0x1d')]=function(_0x5917d6){var _0xb20e14=this;return new Promise(function(_0x5704a1,_0x4b026b){return db[_0xeadd('0x1e')]['create'](_0x5917d6['body'],{'raw':_0x5917d6[_0xeadd('0x1f')]?_0x5917d6[_0xeadd('0x1f')][_0xeadd('0x20')]===undefined?!![]:![]:!![]})[_0xeadd('0x21')](function(_0x2f6e9c){logger[_0xeadd('0x12')](_0xeadd('0x1d'),_0x5917d6);logger[_0xeadd('0x14')](_0xeadd('0x1d'),_0x5917d6,JSON[_0xeadd('0x16')](_0x2f6e9c));_0x5704a1(_0x2f6e9c);})[_0xeadd('0x1c')](function(_0x3d37c9){logger[_0xeadd('0x17')](_0xeadd('0x1d'),_0x3d37c9[_0xeadd('0x1a')],_0x5917d6);_0x4b026b(_0xb20e14[_0xeadd('0x17')](0x1f4,_0x3d37c9[_0xeadd('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index c8f8944..534d32f 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 _0x3852=['length','whatsappMessage:','./whatsappMessage.events','save','remove','update','removeListener','register'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x3852,0x122));var _0x2385=function(_0x183049,_0x4b279){_0x183049=_0x183049-0x0;var _0xbea4b8=_0x3852[_0x183049];return _0xbea4b8;};'use strict';var WhatsappMessageEvents=require(_0x2385('0x0'));var events=[_0x2385('0x1'),_0x2385('0x2'),_0x2385('0x3')];function createListener(_0x39192b,_0x421eeb){return function(_0x1d1178){_0x421eeb['emit'](_0x39192b,_0x1d1178);};}function removeListener(_0x193f50,_0x536343){return function(){WhatsappMessageEvents[_0x2385('0x4')](_0x193f50,_0x536343);};}exports[_0x2385('0x5')]=function(_0xf53af9){for(var _0x228e7c=0x0,_0x2998c1=events[_0x2385('0x6')];_0x228e7c<_0x2998c1;_0x228e7c++){var _0x225760=events[_0x228e7c];var _0x176560=createListener(_0x2385('0x7')+_0x225760,_0xf53af9);WhatsappMessageEvents['on'](_0x225760,_0x176560);}}; \ No newline at end of file +var _0x3fba=['register','length','whatsappMessage:','save','remove','removeListener'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x3fba,0x1b9));var _0xa3fb=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x3fba[_0x46698a];return _0x356db0;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0xa3fb('0x0'),_0xa3fb('0x1'),'update'];function createListener(_0x1a59b1,_0x4153ea){return function(_0x354d28){_0x4153ea['emit'](_0x1a59b1,_0x354d28);};}function removeListener(_0x22388c,_0x245683){return function(){WhatsappMessageEvents[_0xa3fb('0x2')](_0x22388c,_0x245683);};}exports[_0xa3fb('0x3')]=function(_0x35a3e7){for(var _0x18e77f=0x0,_0x3d87f8=events[_0xa3fb('0x4')];_0x18e77f<_0x3d87f8;_0x18e77f++){var _0x30b3f0=events[_0x18e77f];var _0x30fa72=createListener(_0xa3fb('0x5')+_0x30b3f0,_0x35a3e7);WhatsappMessageEvents['on'](_0x30b3f0,_0x30fa72);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index d51cd96..54974ea 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 _0x0d4d=['/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','create','addTeams','post','addAgents','put','update','destroy','delete','/:id/users','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./whatsappQueue.controller','get','isAuthenticated','/describe'];(function(_0x224f65,_0x4750bf){var _0x3f921c=function(_0x1b5f64){while(--_0x1b5f64){_0x224f65['push'](_0x224f65['shift']());}};_0x3f921c(++_0x4750bf);}(_0x0d4d,0x10d));var _0xd0d4=function(_0x22b02c,_0x457c85){_0x22b02c=_0x22b02c-0x0;var _0x35542e=_0x0d4d[_0x22b02c];return _0x35542e;};'use strict';var multer=require(_0xd0d4('0x0'));var util=require(_0xd0d4('0x1'));var path=require(_0xd0d4('0x2'));var timeout=require('connect-timeout');var express=require(_0xd0d4('0x3'));var router=express[_0xd0d4('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd0d4('0x5'));var interaction=require(_0xd0d4('0x6'));var config=require('../../config/environment');var controller=require(_0xd0d4('0x7'));router[_0xd0d4('0x8')]('/',auth[_0xd0d4('0x9')](),controller['index']);router[_0xd0d4('0x8')](_0xd0d4('0xa'),auth[_0xd0d4('0x9')](),controller['describe']);router[_0xd0d4('0x8')](_0xd0d4('0xb'),auth[_0xd0d4('0x9')](),controller[_0xd0d4('0xc')]);router[_0xd0d4('0x8')](_0xd0d4('0xd'),auth[_0xd0d4('0x9')](),controller[_0xd0d4('0xe')]);router[_0xd0d4('0x8')](_0xd0d4('0xf'),auth[_0xd0d4('0x9')](),controller[_0xd0d4('0x10')]);router[_0xd0d4('0x8')]('/:id/users',auth[_0xd0d4('0x9')](),controller[_0xd0d4('0x11')]);router['post']('/',auth[_0xd0d4('0x9')](),controller[_0xd0d4('0x12')]);router['post']('/:id/teams',auth[_0xd0d4('0x9')](),controller[_0xd0d4('0x13')]);router[_0xd0d4('0x14')]('/:id/users',auth[_0xd0d4('0x9')](),controller[_0xd0d4('0x15')]);router[_0xd0d4('0x16')]('/:id',auth[_0xd0d4('0x9')](),controller[_0xd0d4('0x17')]);router['delete'](_0xd0d4('0xb'),auth[_0xd0d4('0x9')](),controller[_0xd0d4('0x18')]);router[_0xd0d4('0x19')]('/:id/teams',auth[_0xd0d4('0x9')](),controller['removeTeams']);router[_0xd0d4('0x19')](_0xd0d4('0x1a'),auth[_0xd0d4('0x9')](),controller['removeAgents']);module[_0xd0d4('0x1b')]=router; \ No newline at end of file +var _0x2454=['get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','/:id/teams','getTeams','getAgents','create','post','addTeams','/:id/users','put','update','destroy','delete','removeAgents','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./whatsappQueue.controller'];(function(_0x1a80db,_0x39be26){var _0x143503=function(_0x7b5ad4){while(--_0x7b5ad4){_0x1a80db['push'](_0x1a80db['shift']());}};_0x143503(++_0x39be26);}(_0x2454,0xc3));var _0x4245=function(_0x2e2638,_0x14f599){_0x2e2638=_0x2e2638-0x0;var _0x5d59a7=_0x2454[_0x2e2638];return _0x5d59a7;};'use strict';var multer=require(_0x4245('0x0'));var util=require(_0x4245('0x1'));var path=require(_0x4245('0x2'));var timeout=require('connect-timeout');var express=require(_0x4245('0x3'));var router=express[_0x4245('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4245('0x5'));var config=require(_0x4245('0x6'));var controller=require(_0x4245('0x7'));router[_0x4245('0x8')]('/',auth[_0x4245('0x9')](),controller[_0x4245('0xa')]);router[_0x4245('0x8')](_0x4245('0xb'),auth['isAuthenticated'](),controller[_0x4245('0xc')]);router[_0x4245('0x8')](_0x4245('0xd'),auth['isAuthenticated'](),controller[_0x4245('0xe')]);router[_0x4245('0x8')](_0x4245('0xf'),auth[_0x4245('0x9')](),controller['getMembers']);router[_0x4245('0x8')](_0x4245('0x10'),auth['isAuthenticated'](),controller[_0x4245('0x11')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x4245('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4245('0x13')]);router[_0x4245('0x14')]('/:id/teams',auth[_0x4245('0x9')](),controller[_0x4245('0x15')]);router[_0x4245('0x14')](_0x4245('0x16'),auth[_0x4245('0x9')](),controller['addAgents']);router[_0x4245('0x17')](_0x4245('0xd'),auth['isAuthenticated'](),controller[_0x4245('0x18')]);router['delete']('/:id',auth[_0x4245('0x9')](),controller[_0x4245('0x19')]);router[_0x4245('0x1a')](_0x4245('0x10'),auth[_0x4245('0x9')](),controller['removeTeams']);router[_0x4245('0x1a')](_0x4245('0x16'),auth[_0x4245('0x9')](),controller[_0x4245('0x1b')]);module[_0x4245('0x1c')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 23ae7ec..30f04a8 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 _0xba33=['roundrobin','sequelize','exports','STRING','name','ENUM','rrmemory','beepall'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0xba33,0xf1));var _0x3ba3=function(_0x192c12,_0x2f58d5){_0x192c12=_0x192c12-0x0;var _0x2b7e21=_0xba33[_0x192c12];return _0x2b7e21;};'use strict';var Sequelize=require(_0x3ba3('0x0'));module[_0x3ba3('0x1')]={'name':{'type':Sequelize[_0x3ba3('0x2')],'unique':_0x3ba3('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3ba3('0x4')](_0x3ba3('0x5'),_0x3ba3('0x6'),_0x3ba3('0x7'))},'description':{'type':Sequelize[_0x3ba3('0x2')]}}; \ No newline at end of file +var _0xa101=['STRING','sequelize','exports','name','INTEGER','rrmemory','beepall'];(function(_0x2d5355,_0x14ec2e){var _0xde6d73=function(_0x2f301c){while(--_0x2f301c){_0x2d5355['push'](_0x2d5355['shift']());}};_0xde6d73(++_0x14ec2e);}(_0xa101,0x15f));var _0x1a10=function(_0x2962b4,_0x4b0786){_0x2962b4=_0x2962b4-0x0;var _0x411b7d=_0xa101[_0x2962b4];return _0x411b7d;};'use strict';var Sequelize=require(_0x1a10('0x0'));module[_0x1a10('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x1a10('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x1a10('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x1a10('0x4'),_0x1a10('0x5'),'roundrobin')},'description':{'type':Sequelize[_0x1a10('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index df1b1a7..8e12c8c 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 _0xcee1=['UserProfileResource','end','sendStatus','error','name','send','index','map','WhatsappQueue','rawAttributes','type','key','query','intersection','model','fields','attributes','length','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','describe','getMembers','UserWhatsappQueue','WhatsappQueueId','options','User','findAndCountAll','UserId','whatsappPause','updatedAt','format','%s/%s','SIP','createdAt','findOne','Team','getTeams','hasOwnProperty','addTeams','ids','Agents','voicePause','sequelize','transaction','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','join','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','all','compact','value','isEmpty','removeAgents','userWhatsappQueue:remove','omit','isArray','getAgents','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./whatsappQueue.socket','status','offset','undefined','limit','count','set','apply','reject','then','destroy','WhatsappQueues'];(function(_0x23d643,_0x3a341e){var _0x18d292=function(_0x54fdeb){while(--_0x54fdeb){_0x23d643['push'](_0x23d643['shift']());}};_0x18d292(++_0x3a341e);}(_0xcee1,0xe3));var _0x1cee=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xcee1[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x1cee('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1cee('0x1'));var rp=require('request-promise');var moment=require(_0x1cee('0x2'));var BPromise=require(_0x1cee('0x3'));var Mustache=require(_0x1cee('0x4'));var util=require(_0x1cee('0x5'));var path=require(_0x1cee('0x6'));var sox=require(_0x1cee('0x7'));var csv=require('to-csv');var ejs=require(_0x1cee('0x8'));var fs=require('fs');var fs_extra=require(_0x1cee('0x9'));var _=require(_0x1cee('0xa'));var squel=require('squel');var crypto=require(_0x1cee('0xb'));var jsforce=require(_0x1cee('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1cee('0xd'));var Papa=require(_0x1cee('0xe'));var Redis=require('ioredis');var authService=require(_0x1cee('0xf'));var qs=require(_0x1cee('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1cee('0x11'));var logger=require(_0x1cee('0x12'))(_0x1cee('0x13'));var utils=require(_0x1cee('0x14'));var config=require(_0x1cee('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x1cee('0x16'))['db'];config[_0x1cee('0x17')]=_['defaults'](config[_0x1cee('0x17')],{'host':_0x1cee('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1cee('0x17')]));require(_0x1cee('0x19'))['register'](socket);function respondWithStatusCode(_0x591eeb,_0x180457){_0x180457=_0x180457||0xcc;return function(_0x54042d){if(_0x54042d){return _0x591eeb['sendStatus'](_0x180457);}return _0x591eeb[_0x1cee('0x1a')](_0x180457)['end']();};}function respondWithResult(_0x1c47ff,_0x515632){_0x515632=_0x515632||0xc8;return function(_0x433ac7){if(_0x433ac7){return _0x1c47ff['status'](_0x515632)['json'](_0x433ac7);}};}function respondWithFilteredResult(_0xa7769f,_0x1f2f85){return function(_0x144016){if(_0x144016){var _0x42fa8a=typeof _0x1f2f85[_0x1cee('0x1b')]===_0x1cee('0x1c')&&typeof _0x1f2f85[_0x1cee('0x1d')]===_0x1cee('0x1c');var _0x2e8d2d=_0x144016[_0x1cee('0x1e')];var _0x5db29a=_0x42fa8a?0x0:_0x1f2f85[_0x1cee('0x1b')];var _0x6c617b=_0x42fa8a?_0x144016[_0x1cee('0x1e')]:_0x1f2f85[_0x1cee('0x1b')]+_0x1f2f85['limit'];var _0x3b7c06;if(_0x6c617b>=_0x2e8d2d){_0x6c617b=_0x2e8d2d;_0x3b7c06=0xc8;}else{_0x3b7c06=0xce;}_0xa7769f[_0x1cee('0x1a')](_0x3b7c06);return _0xa7769f[_0x1cee('0x1f')]('Content-Range',_0x5db29a+'-'+_0x6c617b+'/'+_0x2e8d2d)['json'](_0x144016);}return null;};}function patchUpdates(_0x23077e){return function(_0x54db2a){try{jsonpatch[_0x1cee('0x20')](_0x54db2a,_0x23077e,!![]);}catch(_0x276ec2){return BPromise[_0x1cee('0x21')](_0x276ec2);}return _0x54db2a['save']();};}function saveUpdates(_0x4d2094,_0x451c06){return function(_0x566d95){if(_0x566d95){return _0x566d95['update'](_0x4d2094)[_0x1cee('0x22')](function(_0x6554e){return _0x6554e;});}return null;};}function removeEntity(_0x1bdf88,_0x20058d){return function(_0x1beacf){if(_0x1beacf){return _0x1beacf[_0x1cee('0x23')]()['then'](function(){var _0x3df3ee=_0x1beacf['get']({'plain':!![]});var _0x790b38=_0x1cee('0x24');return db[_0x1cee('0x25')]['destroy']({'where':{'type':_0x790b38,'resourceId':_0x3df3ee['id']}})['then'](function(){return _0x1beacf;});})['then'](function(){_0x1bdf88[_0x1cee('0x1a')](0xcc)[_0x1cee('0x26')]();});}};}function handleEntityNotFound(_0x53d435,_0x54b6fe){return function(_0x35d8a2){if(!_0x35d8a2){_0x53d435[_0x1cee('0x27')](0x194);}return _0x35d8a2;};}function handleError(_0x18cd43,_0x9f99c6){_0x9f99c6=_0x9f99c6||0x1f4;return function(_0x429c6e){logger[_0x1cee('0x28')](_0x429c6e['stack']);if(_0x429c6e['name']){delete _0x429c6e[_0x1cee('0x29')];}_0x18cd43[_0x1cee('0x1a')](_0x9f99c6)[_0x1cee('0x2a')](_0x429c6e);};}exports[_0x1cee('0x2b')]=function(_0x13d5c6,_0x42e5e9){var _0x3f94c5={},_0x1021eb={},_0x404af5={'count':0x0,'rows':[]};var _0x4f83e0=_[_0x1cee('0x2c')](db[_0x1cee('0x2d')][_0x1cee('0x2e')],function(_0x14f487){return{'name':_0x14f487['fieldName'],'type':_0x14f487[_0x1cee('0x2f')][_0x1cee('0x30')]};});_0x1021eb['model']=_['map'](_0x4f83e0,_0x1cee('0x29'));_0x1021eb[_0x1cee('0x31')]=_['keys'](_0x13d5c6[_0x1cee('0x31')]);_0x1021eb['filters']=_['intersection'](_0x1021eb['model'],_0x1021eb[_0x1cee('0x31')]);_0x3f94c5['attributes']=_[_0x1cee('0x32')](_0x1021eb[_0x1cee('0x33')],qs[_0x1cee('0x34')](_0x13d5c6[_0x1cee('0x31')][_0x1cee('0x34')]));_0x3f94c5[_0x1cee('0x35')]=_0x3f94c5[_0x1cee('0x35')][_0x1cee('0x36')]?_0x3f94c5[_0x1cee('0x35')]:_0x1021eb[_0x1cee('0x33')];if(!_0x13d5c6['query']['hasOwnProperty'](_0x1cee('0x37'))){_0x3f94c5['limit']=qs[_0x1cee('0x1d')](_0x13d5c6[_0x1cee('0x31')][_0x1cee('0x1d')]);_0x3f94c5['offset']=qs[_0x1cee('0x1b')](_0x13d5c6[_0x1cee('0x31')]['offset']);}_0x3f94c5[_0x1cee('0x38')]=qs[_0x1cee('0x39')](_0x13d5c6['query'][_0x1cee('0x39')]);_0x3f94c5['where']=qs['filters'](_[_0x1cee('0x3a')](_0x13d5c6[_0x1cee('0x31')],_0x1021eb[_0x1cee('0x3b')]),_0x4f83e0);if(_0x13d5c6[_0x1cee('0x31')][_0x1cee('0x3c')]){_0x3f94c5[_0x1cee('0x3d')]=_[_0x1cee('0x3e')](_0x3f94c5[_0x1cee('0x3d')],{'$or':_['map'](_0x4f83e0,function(_0x3252e5){if(_0x3252e5[_0x1cee('0x2f')]!==_0x1cee('0x3f')){var _0x2267d6={};_0x2267d6[_0x3252e5['name']]={'$like':'%'+_0x13d5c6[_0x1cee('0x31')]['filter']+'%'};return _0x2267d6;}})});}_0x3f94c5=_[_0x1cee('0x3e')]({},_0x3f94c5,_0x13d5c6['options']);var _0x2d8f2d={'where':_0x3f94c5[_0x1cee('0x3d')]};return db['WhatsappQueue']['count'](_0x2d8f2d)[_0x1cee('0x22')](function(_0x591f6c){_0x404af5[_0x1cee('0x1e')]=_0x591f6c;if(_0x13d5c6['query'][_0x1cee('0x40')]){_0x3f94c5[_0x1cee('0x41')]=[{'all':!![]}];}return db[_0x1cee('0x2d')][_0x1cee('0x42')](_0x3f94c5);})[_0x1cee('0x22')](function(_0x2d464b){_0x404af5[_0x1cee('0x43')]=_0x2d464b;return _0x404af5;})[_0x1cee('0x22')](respondWithFilteredResult(_0x42e5e9,_0x3f94c5))[_0x1cee('0x44')](handleError(_0x42e5e9,null));};exports[_0x1cee('0x45')]=function(_0x16e682,_0x4333b0){var _0x46109f={'raw':!![],'where':{'id':_0x16e682[_0x1cee('0x46')]['id']}},_0xf5ae0f={};_0xf5ae0f[_0x1cee('0x33')]=_[_0x1cee('0x47')](db['WhatsappQueue']['rawAttributes']);_0xf5ae0f[_0x1cee('0x31')]=_[_0x1cee('0x47')](_0x16e682['query']);_0xf5ae0f[_0x1cee('0x3b')]=_[_0x1cee('0x32')](_0xf5ae0f[_0x1cee('0x33')],_0xf5ae0f['query']);_0x46109f[_0x1cee('0x35')]=_[_0x1cee('0x32')](_0xf5ae0f[_0x1cee('0x33')],qs['fields'](_0x16e682[_0x1cee('0x31')]['fields']));_0x46109f[_0x1cee('0x35')]=_0x46109f['attributes'][_0x1cee('0x36')]?_0x46109f[_0x1cee('0x35')]:_0xf5ae0f[_0x1cee('0x33')];if(_0x16e682[_0x1cee('0x31')][_0x1cee('0x40')]){_0x46109f[_0x1cee('0x41')]=[{'all':!![]}];}_0x46109f=_[_0x1cee('0x3e')]({},_0x46109f,_0x16e682['options']);return db[_0x1cee('0x2d')][_0x1cee('0x48')](_0x46109f)['then'](handleEntityNotFound(_0x4333b0,null))['then'](respondWithResult(_0x4333b0,null))[_0x1cee('0x44')](handleError(_0x4333b0,null));};exports[_0x1cee('0x49')]=function(_0x4e0e1d,_0x92f75f){return db['WhatsappQueue'][_0x1cee('0x49')](_0x4e0e1d[_0x1cee('0x4a')],{})[_0x1cee('0x22')](function(_0x550484){var _0x5f107d=_0x4e0e1d[_0x1cee('0x4b')][_0x1cee('0x4c')]({'plain':!![]});if(!_0x5f107d)throw new Error(_0x1cee('0x4d'));if(_0x5f107d[_0x1cee('0x4e')]===_0x1cee('0x4b')){var _0x83fd5c=_0x550484['get']({'plain':!![]});var _0x58b672=_0x1cee('0x24');return db[_0x1cee('0x4f')][_0x1cee('0x48')]({'where':{'name':_0x58b672,'userProfileId':_0x5f107d['userProfileId']},'raw':!![]})[_0x1cee('0x22')](function(_0x397fa3){if(_0x397fa3&&_0x397fa3[_0x1cee('0x50')]===0x0){return db[_0x1cee('0x25')]['create']({'name':_0x83fd5c[_0x1cee('0x29')],'resourceId':_0x83fd5c['id'],'type':_0x397fa3[_0x1cee('0x29')],'sectionId':_0x397fa3['id']},{})[_0x1cee('0x22')](function(){return _0x550484;});}else{return _0x550484;}})[_0x1cee('0x44')](function(_0x44672c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44672c);throw _0x44672c;});}return _0x550484;})[_0x1cee('0x22')](respondWithResult(_0x92f75f,0xc9))[_0x1cee('0x44')](handleError(_0x92f75f,null));};exports['update']=function(_0x1dcc2f,_0x27aa9c){if(_0x1dcc2f[_0x1cee('0x4a')]['id']){delete _0x1dcc2f[_0x1cee('0x4a')]['id'];}return db[_0x1cee('0x2d')][_0x1cee('0x48')]({'where':{'id':_0x1dcc2f[_0x1cee('0x46')]['id']}})[_0x1cee('0x22')](handleEntityNotFound(_0x27aa9c,null))[_0x1cee('0x22')](saveUpdates(_0x1dcc2f['body'],null))[_0x1cee('0x22')](respondWithResult(_0x27aa9c,null))[_0x1cee('0x44')](handleError(_0x27aa9c,null));};exports[_0x1cee('0x23')]=function(_0xdabd52,_0x5983de){return db[_0x1cee('0x2d')][_0x1cee('0x48')]({'where':{'id':_0xdabd52[_0x1cee('0x46')]['id']}})[_0x1cee('0x22')](handleEntityNotFound(_0x5983de,null))[_0x1cee('0x22')](removeEntity(_0x5983de,null))[_0x1cee('0x44')](handleError(_0x5983de,null));};exports[_0x1cee('0x51')]=function(_0x341fbf,_0x94372f){return db[_0x1cee('0x2d')]['describe']()[_0x1cee('0x22')](respondWithResult(_0x94372f,null))['catch'](handleError(_0x94372f,null));};exports[_0x1cee('0x52')]=function(_0x19d2f4,_0x2b6b0b,_0x4f443c){var _0x25df90={'raw':!![],'where':{}},_0x2d33f7={},_0x1bda5c;return db[_0x1cee('0x2d')]['findOne']({'where':{'id':_0x19d2f4[_0x1cee('0x46')]['id']}})[_0x1cee('0x22')](handleEntityNotFound(_0x2b6b0b,null))['then'](function(_0x20cff3){if(_0x20cff3){_0x1bda5c=_0x20cff3[_0x1cee('0x4c')]({'plain':!![]});_0x2d33f7[_0x1cee('0x33')]=_[_0x1cee('0x47')](db[_0x1cee('0x53')][_0x1cee('0x2e')]);_0x2d33f7[_0x1cee('0x31')]=_[_0x1cee('0x47')](_0x19d2f4[_0x1cee('0x31')]);_0x2d33f7['filters']=_['intersection'](_0x2d33f7[_0x1cee('0x33')],_0x2d33f7['query']);_0x25df90[_0x1cee('0x35')]=_[_0x1cee('0x32')](_0x2d33f7[_0x1cee('0x33')],qs[_0x1cee('0x34')](_0x19d2f4['query'][_0x1cee('0x34')]));_0x25df90[_0x1cee('0x35')]=_0x25df90[_0x1cee('0x35')][_0x1cee('0x36')]?_0x25df90[_0x1cee('0x35')]:_0x2d33f7[_0x1cee('0x33')];if(!_0x19d2f4['query']['hasOwnProperty'](_0x1cee('0x37'))){_0x25df90['limit']=qs[_0x1cee('0x1d')](_0x19d2f4[_0x1cee('0x31')]['limit']);_0x25df90[_0x1cee('0x1b')]=qs[_0x1cee('0x1b')](_0x19d2f4[_0x1cee('0x31')][_0x1cee('0x1b')]);}_0x25df90[_0x1cee('0x38')]=qs['sort'](_0x19d2f4[_0x1cee('0x31')][_0x1cee('0x39')]);_0x25df90[_0x1cee('0x3d')]=qs[_0x1cee('0x3b')](_['pick'](_0x19d2f4['query'],_0x2d33f7['filters']));_0x25df90[_0x1cee('0x3d')][_0x1cee('0x54')]=_0x20cff3['id'];if(_0x19d2f4[_0x1cee('0x31')]['filter']){_0x25df90['where']=_[_0x1cee('0x3e')](_0x25df90[_0x1cee('0x3d')],{'$or':_[_0x1cee('0x2c')](_0x25df90[_0x1cee('0x35')],function(_0xee45e2){var _0x17f4a0={};_0x17f4a0[_0xee45e2]={'$like':'%'+_0x19d2f4[_0x1cee('0x31')][_0x1cee('0x3c')]+'%'};return _0x17f4a0;})});}_0x25df90=_[_0x1cee('0x3e')]({},_0x25df90,_0x19d2f4[_0x1cee('0x55')]);return db[_0x1cee('0x53')][_0x1cee('0x42')](_0x25df90);}})[_0x1cee('0x22')](function(_0x1d264d){if(_0x1d264d){return db[_0x1cee('0x56')][_0x1cee('0x57')]({'where':{'id':_[_0x1cee('0x2c')](_0x1d264d,_0x1cee('0x58')),'role':'agent'},'attributes':['id',_0x1cee('0x29'),_0x1cee('0x59'),_0x1cee('0x5a'),'createdAt']});}})[_0x1cee('0x22')](function(_0x47ac90){if(_0x47ac90){return{'count':_0x47ac90[_0x1cee('0x1e')],'rows':_['map'](_0x47ac90['rows'],function(_0x22e302){return{'membername':_0x22e302[_0x1cee('0x29')],'UserId':_0x22e302['id'],'queue_name':_0x1bda5c[_0x1cee('0x29')],'WhatsappQueueId':_0x1bda5c['id'],'interface':util[_0x1cee('0x5b')](_0x1cee('0x5c'),_0x1cee('0x5d'),_0x22e302[_0x1cee('0x29')]),'penalty':0x0,'paused':_0x22e302[_0x1cee('0x59')],'createdAt':_0x22e302[_0x1cee('0x5e')],'updatedAt':_0x22e302[_0x1cee('0x5a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1cee('0x22')](respondWithFilteredResult(_0x2b6b0b,_0x25df90))[_0x1cee('0x44')](handleError(_0x2b6b0b,null));};exports['getTeams']=function(_0x27e987,_0x10549b,_0x2fbf68){var _0x232a3b={};var _0x5c39eb={};var _0x15a94b;var _0x507e83;return db['WhatsappQueue'][_0x1cee('0x5f')]({'where':{'id':_0x27e987[_0x1cee('0x46')]['id']}})['then'](handleEntityNotFound(_0x10549b,null))[_0x1cee('0x22')](function(_0x59b632){if(_0x59b632){_0x15a94b=_0x59b632;_0x5c39eb['model']=_['keys'](db[_0x1cee('0x60')][_0x1cee('0x2e')]);_0x5c39eb[_0x1cee('0x31')]=_['keys'](_0x27e987[_0x1cee('0x31')]);_0x5c39eb[_0x1cee('0x3b')]=_[_0x1cee('0x32')](_0x5c39eb[_0x1cee('0x33')],_0x5c39eb[_0x1cee('0x31')]);_0x232a3b[_0x1cee('0x35')]=_['intersection'](_0x5c39eb[_0x1cee('0x33')],qs[_0x1cee('0x34')](_0x27e987[_0x1cee('0x31')][_0x1cee('0x34')]));_0x232a3b[_0x1cee('0x35')]=_0x232a3b[_0x1cee('0x35')]['length']?_0x232a3b[_0x1cee('0x35')]:_0x5c39eb[_0x1cee('0x33')];_0x232a3b[_0x1cee('0x38')]=qs['sort'](_0x27e987[_0x1cee('0x31')]['sort']);_0x232a3b[_0x1cee('0x3d')]=qs[_0x1cee('0x3b')](_['pick'](_0x27e987[_0x1cee('0x31')],_0x5c39eb[_0x1cee('0x3b')]));if(_0x27e987[_0x1cee('0x31')][_0x1cee('0x3c')]){_0x232a3b['where']=_[_0x1cee('0x3e')](_0x232a3b[_0x1cee('0x3d')],{'$or':_['map'](_0x232a3b[_0x1cee('0x35')],function(_0x40837d){var _0x5898d5={};_0x5898d5[_0x40837d]={'$like':'%'+_0x27e987[_0x1cee('0x31')][_0x1cee('0x3c')]+'%'};return _0x5898d5;})});}_0x232a3b=_[_0x1cee('0x3e')]({},_0x232a3b,_0x27e987[_0x1cee('0x55')]);return _0x15a94b[_0x1cee('0x61')](_0x232a3b);}})[_0x1cee('0x22')](function(_0x2bd54a){if(_0x2bd54a){_0x507e83=_0x2bd54a[_0x1cee('0x36')];if(!_0x27e987['query'][_0x1cee('0x62')](_0x1cee('0x37'))){_0x232a3b['limit']=qs['limit'](_0x27e987[_0x1cee('0x31')][_0x1cee('0x1d')]);_0x232a3b[_0x1cee('0x1b')]=qs[_0x1cee('0x1b')](_0x27e987['query'][_0x1cee('0x1b')]);}return _0x15a94b['getTeams'](_0x232a3b);}})[_0x1cee('0x22')](function(_0x387a33){if(_0x387a33){return _0x387a33?{'count':_0x507e83,'rows':_0x387a33}:null;}})['then'](respondWithResult(_0x10549b,null))[_0x1cee('0x44')](handleError(_0x10549b,null));};exports[_0x1cee('0x63')]=function(_0x4e2f29,_0x4f20e3,_0x2a1a99){var _0x8bdd2d=_0x4e2f29['body'][_0x1cee('0x64')];return db[_0x1cee('0x60')]['findAll']({'where':{'id':_0x8bdd2d},'attributes':['id'],'include':[{'model':db['User'],'as':_0x1cee('0x65'),'attributes':['id',_0x1cee('0x29'),'online',_0x1cee('0x66'),'interface'],'raw':!![]}]})['then'](function(_0x1a49f8){if(_0x1a49f8){var _0x5effed=_['flatMap'](_0x1a49f8,function(_0x3e36b8){var _0x104290=_0x3e36b8[_0x1cee('0x4c')]({'plain':!![]});return _0x104290['Agents'];});return db[_0x1cee('0x2d')]['find']({'where':{'id':_0x4e2f29[_0x1cee('0x46')]['id']}})[_0x1cee('0x22')](function(_0x1f49b8){return db[_0x1cee('0x67')][_0x1cee('0x68')](function(_0x2ddac9){return _0x1f49b8[_0x1cee('0x63')](_0x8bdd2d,{'transaction':_0x2ddac9})['then'](function(){return BPromise['each'](_0x5effed,function(_0x18c37c){return db[_0x1cee('0x53')][_0x1cee('0x69')]({'where':{'UserId':_0x18c37c['id'],'WhatsappQueueId':_0x4e2f29[_0x1cee('0x46')]['id']},'transaction':_0x2ddac9});});})[_0x1cee('0x22')](function(){_0x5effed[_0x1cee('0x6a')](function(_0x18ba97){socket[_0x1cee('0x6b')](_0x1cee('0x6c'),{'UserId':_0x18ba97['id'],'WhatsappQueueId':_0x1f49b8['id']});});});});});}})[_0x1cee('0x22')](respondWithStatusCode(_0x4f20e3,null))['catch'](handleError(_0x4f20e3,null));};exports[_0x1cee('0x6d')]=function(_0x44c31c,_0x1f0455,_0x48808a){return db[_0x1cee('0x60')]['findAll']({'where':{'id':_0x44c31c[_0x1cee('0x31')][_0x1cee('0x64')]},'attributes':['id'],'include':[{'model':db[_0x1cee('0x56')],'as':_0x1cee('0x65'),'attributes':['id'],'raw':!![]}]})[_0x1cee('0x22')](handleEntityNotFound(_0x1f0455,null))[_0x1cee('0x22')](function(_0xe954ad){var _0x5c347a=_['map'](_0xe954ad,'id');var _0xb93a25=[];var _0x220375=[];var _0x494f31=squel[_0x1cee('0x6e')]();_0x494f31[_0x1cee('0x6f')](_0x1cee('0x70'))[_0x1cee('0x71')]('team_has_whatsapp_queues','tq')[_0x1cee('0x72')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x1cee('0x3d')](_0x1cee('0x73'),_0x44c31c['params']['id']);for(var _0x260202=0x0;_0x260202<_0xe954ad[_0x1cee('0x36')];_0x260202+=0x1){let _0x3cd4d2=_0xe954ad[_0x260202];for(var _0x5f54fd=0x0;_0x5f54fd<_0x3cd4d2[_0x1cee('0x65')]['length'];_0x5f54fd+=0x1){let _0x2618a5=_0x3cd4d2[_0x1cee('0x65')][_0x5f54fd];var _0x315075=_0x494f31[_0x1cee('0x74')]();_0x315075[_0x1cee('0x3d')](_0x1cee('0x75'),_0x2618a5['id']);_0x220375[_0x1cee('0x76')](db[_0x1cee('0x67')][_0x1cee('0x31')](_0x315075[_0x1cee('0x77')](),{'type':db['sequelize'][_0x1cee('0x78')][_0x1cee('0x79')]})[_0x1cee('0x22')](function(_0x49df2e){if(_0x49df2e[_0x1cee('0x36')]===0x1){return _0x2618a5['id'];}else{var _0x32659f=_['every'](_[_0x1cee('0x2c')](_0x49df2e,_0x1cee('0x7a')),function(_0x1655c3){return _['includes'](_0x5c347a,_0x1655c3);});if(_0x32659f){return _0x2618a5['id'];}}}));}}return BPromise[_0x1cee('0x7b')](_0x220375)[_0x1cee('0x22')](function(_0x4a5c48){_0xb93a25=_(_0xb93a25)['union'](_0x4a5c48)[_0x1cee('0x7c')]()[_0x1cee('0x7d')]();return db[_0x1cee('0x2d')][_0x1cee('0x48')]({'where':{'id':_0x44c31c['params']['id']}})[_0x1cee('0x22')](function(_0x5156d5){return db['sequelize'][_0x1cee('0x68')](function(_0x4cc110){return _0x5156d5['removeTeams'](_0x44c31c['query'][_0x1cee('0x64')],{'transaction':_0x4cc110})['then'](function(){if(!_[_0x1cee('0x7e')](_0xb93a25)){return _0x5156d5[_0x1cee('0x7f')](_0xb93a25,{'transaction':_0x4cc110});}})[_0x1cee('0x22')](function(){_0xb93a25[_0x1cee('0x6a')](function(_0x12facd){socket[_0x1cee('0x6b')](_0x1cee('0x80'),{'UserId':_0x12facd,'WhatsappQueueId':_0x5156d5['id']});});});});});});})[_0x1cee('0x22')](respondWithStatusCode(_0x1f0455,null))[_0x1cee('0x44')](handleError(_0x1f0455,null));};exports['addAgents']=function(_0x402ab9,_0x1faf2b,_0x238fbc){return db['WhatsappQueue']['find']({'where':{'id':_0x402ab9[_0x1cee('0x46')]['id']}})[_0x1cee('0x22')](handleEntityNotFound(_0x1faf2b,null))[_0x1cee('0x22')](function(_0x2c9918){if(_0x2c9918){return _0x2c9918['addAgents'](_0x402ab9[_0x1cee('0x4a')][_0x1cee('0x64')],_[_0x1cee('0x81')](_0x402ab9[_0x1cee('0x4a')],['ids','id'])||{})['spread'](function(_0xe663da){for(var _0x437f18=0x0;_0x437f18<_0x402ab9['body'][_0x1cee('0x64')][_0x1cee('0x36')];_0x437f18+=0x1){socket['emit']('userWhatsappQueue:save',{'UserId':Number(_0x402ab9[_0x1cee('0x4a')]['ids'][_0x437f18]),'WhatsappQueueId':Number(_0x402ab9[_0x1cee('0x46')]['id'])});}return _0xe663da;});}})['then'](respondWithResult(_0x1faf2b,null))['catch'](handleError(_0x1faf2b,null));};exports[_0x1cee('0x7f')]=function(_0x5405e2,_0x1809ba,_0x2c815a){return db[_0x1cee('0x2d')]['find']({'where':{'id':_0x5405e2['params']['id']}})[_0x1cee('0x22')](handleEntityNotFound(_0x1809ba,null))[_0x1cee('0x22')](function(_0x18464e){if(_0x18464e){return _0x18464e['removeAgents'](_0x5405e2[_0x1cee('0x31')]['ids'])['then'](function(){if(_[_0x1cee('0x82')](_0x5405e2[_0x1cee('0x31')][_0x1cee('0x64')])){for(var _0x4b82b3=0x0;_0x4b82b3<_0x5405e2[_0x1cee('0x31')][_0x1cee('0x64')][_0x1cee('0x36')];_0x4b82b3+=0x1){socket[_0x1cee('0x6b')](_0x1cee('0x80'),{'UserId':Number(_0x5405e2['query'][_0x1cee('0x64')][_0x4b82b3]),'WhatsappQueueId':Number(_0x5405e2['params']['id'])});}}else{socket['emit'](_0x1cee('0x80'),{'UserId':Number(_0x5405e2[_0x1cee('0x31')][_0x1cee('0x64')]),'WhatsappQueueId':Number(_0x5405e2[_0x1cee('0x46')]['id'])});}});}})[_0x1cee('0x22')](respondWithStatusCode(_0x1809ba,null))['catch'](handleError(_0x1809ba,null));};exports[_0x1cee('0x83')]=function(_0x4e13e6,_0x26343a,_0xa20f6d){var _0x5e7897={};var _0x67a5cf={};var _0x4d40c4;var _0x563ad6;return db[_0x1cee('0x2d')][_0x1cee('0x5f')]({'where':{'id':_0x4e13e6['params']['id']}})[_0x1cee('0x22')](handleEntityNotFound(_0x26343a,null))['then'](function(_0x442d6e){if(_0x442d6e){_0x4d40c4=_0x442d6e;_0x67a5cf['model']=_[_0x1cee('0x47')](db[_0x1cee('0x56')][_0x1cee('0x2e')]);_0x67a5cf[_0x1cee('0x31')]=_[_0x1cee('0x47')](_0x4e13e6[_0x1cee('0x31')]);_0x67a5cf[_0x1cee('0x3b')]=_[_0x1cee('0x32')](_0x67a5cf['model'],_0x67a5cf[_0x1cee('0x31')]);_0x5e7897[_0x1cee('0x35')]=_[_0x1cee('0x32')](_0x67a5cf['model'],qs[_0x1cee('0x34')](_0x4e13e6['query']['fields']));_0x5e7897[_0x1cee('0x35')]=_0x5e7897[_0x1cee('0x35')][_0x1cee('0x36')]?_0x5e7897[_0x1cee('0x35')]:_0x67a5cf[_0x1cee('0x33')];_0x5e7897[_0x1cee('0x38')]=qs[_0x1cee('0x39')](_0x4e13e6[_0x1cee('0x31')][_0x1cee('0x39')]);_0x5e7897['where']=qs['filters'](_[_0x1cee('0x3a')](_0x4e13e6[_0x1cee('0x31')],_0x67a5cf['filters']));if(_0x4e13e6['query']['filter']){_0x5e7897[_0x1cee('0x3d')]=_[_0x1cee('0x3e')](_0x5e7897[_0x1cee('0x3d')],{'$or':_['map'](_0x5e7897[_0x1cee('0x35')],function(_0x588ccc){var _0x34658d={};_0x34658d[_0x588ccc]={'$like':'%'+_0x4e13e6['query'][_0x1cee('0x3c')]+'%'};return _0x34658d;})});}_0x5e7897=_[_0x1cee('0x3e')]({},_0x5e7897,_0x4e13e6['options']);return _0x4d40c4['getAgents'](_0x5e7897);}})[_0x1cee('0x22')](function(_0x26aecc){if(_0x26aecc){_0x563ad6=_0x26aecc[_0x1cee('0x36')];if(!_0x4e13e6['query']['hasOwnProperty'](_0x1cee('0x37'))){_0x5e7897[_0x1cee('0x1d')]=qs['limit'](_0x4e13e6['query']['limit']);_0x5e7897['offset']=qs['offset'](_0x4e13e6[_0x1cee('0x31')][_0x1cee('0x1b')]);}return _0x4d40c4[_0x1cee('0x83')](_0x5e7897);}})[_0x1cee('0x22')](function(_0x3d63c7){if(_0x3d63c7){return _0x3d63c7?{'count':_0x563ad6,'rows':_0x3d63c7}:null;}})['then'](respondWithResult(_0x26343a,null))[_0x1cee('0x44')](handleError(_0x26343a,null));}; \ No newline at end of file +var _0xeb0b=['from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','includes','union','compact','value','transaction','removeAgents','userWhatsappQueue:remove','addAgents','spread','emit','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','WhatsappQueues','stack','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','describe','getMembers','findOne','UserWhatsappQueue','nolimit','WhatsappQueueId','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','addTeams','ids','Team','Agents','online','voicePause','interface','flatMap','sequelize','findOrCreate','userWhatsappQueue:save','removeTeams','User','select','field','tq.TeamId'];(function(_0x4d6b35,_0x13884a){var _0x5545b7=function(_0x58ac0b){while(--_0x58ac0b){_0x4d6b35['push'](_0x4d6b35['shift']());}};_0x5545b7(++_0x13884a);}(_0xeb0b,0xa3));var _0xbeb0=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xeb0b[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require(_0xbeb0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbeb0('0x1'));var jsonpatch=require(_0xbeb0('0x2'));var rp=require(_0xbeb0('0x3'));var moment=require(_0xbeb0('0x4'));var BPromise=require(_0xbeb0('0x5'));var Mustache=require('mustache');var util=require(_0xbeb0('0x6'));var path=require(_0xbeb0('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbeb0('0x8'));var _=require(_0xbeb0('0x9'));var squel=require(_0xbeb0('0xa'));var crypto=require(_0xbeb0('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xbeb0('0xc'));var toCsv=require('to-csv');var querystring=require(_0xbeb0('0xd'));var Papa=require(_0xbeb0('0xe'));var Redis=require(_0xbeb0('0xf'));var authService=require(_0xbeb0('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xbeb0('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbeb0('0x12'))(_0xbeb0('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xbeb0('0x14'));var db=require(_0xbeb0('0x15'))['db'];config['redis']=_[_0xbeb0('0x16')](config[_0xbeb0('0x17')],{'host':_0xbeb0('0x18'),'port':0x18eb});var socket=require(_0xbeb0('0x19'))(new Redis(config[_0xbeb0('0x17')]));require(_0xbeb0('0x1a'))[_0xbeb0('0x1b')](socket);function respondWithStatusCode(_0x42e81b,_0x249692){_0x249692=_0x249692||0xcc;return function(_0x3e0175){if(_0x3e0175){return _0x42e81b[_0xbeb0('0x1c')](_0x249692);}return _0x42e81b[_0xbeb0('0x1d')](_0x249692)[_0xbeb0('0x1e')]();};}function respondWithResult(_0x3cde6d,_0x51f7a0){_0x51f7a0=_0x51f7a0||0xc8;return function(_0x45956f){if(_0x45956f){return _0x3cde6d[_0xbeb0('0x1d')](_0x51f7a0)[_0xbeb0('0x1f')](_0x45956f);}};}function respondWithFilteredResult(_0x218697,_0x45a94c){return function(_0x376d03){if(_0x376d03){var _0x4287a2=typeof _0x45a94c[_0xbeb0('0x20')]===_0xbeb0('0x21')&&typeof _0x45a94c['limit']==='undefined';var _0x4124b3=_0x376d03[_0xbeb0('0x22')];var _0x1fec08=_0x4287a2?0x0:_0x45a94c[_0xbeb0('0x20')];var _0x8eb26c=_0x4287a2?_0x376d03[_0xbeb0('0x22')]:_0x45a94c[_0xbeb0('0x20')]+_0x45a94c[_0xbeb0('0x23')];var _0x355824;if(_0x8eb26c>=_0x4124b3){_0x8eb26c=_0x4124b3;_0x355824=0xc8;}else{_0x355824=0xce;}_0x218697[_0xbeb0('0x1d')](_0x355824);return _0x218697[_0xbeb0('0x24')](_0xbeb0('0x25'),_0x1fec08+'-'+_0x8eb26c+'/'+_0x4124b3)['json'](_0x376d03);}return null;};}function patchUpdates(_0x5a6cb5){return function(_0x48bd80){try{jsonpatch[_0xbeb0('0x26')](_0x48bd80,_0x5a6cb5,!![]);}catch(_0xd1506e){return BPromise[_0xbeb0('0x27')](_0xd1506e);}return _0x48bd80[_0xbeb0('0x28')]();};}function saveUpdates(_0x3f9817,_0xd22c96){return function(_0x133e1e){if(_0x133e1e){return _0x133e1e[_0xbeb0('0x29')](_0x3f9817)[_0xbeb0('0x2a')](function(_0x5bd43b){return _0x5bd43b;});}return null;};}function removeEntity(_0xa4f1b2,_0x1b56fe){return function(_0x4ed2d2){if(_0x4ed2d2){return _0x4ed2d2[_0xbeb0('0x2b')]()[_0xbeb0('0x2a')](function(){var _0x86ae0e=_0x4ed2d2[_0xbeb0('0x2c')]({'plain':!![]});var _0x274d49=_0xbeb0('0x2d');return db['UserProfileResource'][_0xbeb0('0x2b')]({'where':{'type':_0x274d49,'resourceId':_0x86ae0e['id']}})[_0xbeb0('0x2a')](function(){return _0x4ed2d2;});})[_0xbeb0('0x2a')](function(){_0xa4f1b2[_0xbeb0('0x1d')](0xcc)[_0xbeb0('0x1e')]();});}};}function handleEntityNotFound(_0x3c3c7b,_0x18bd9f){return function(_0x552c0f){if(!_0x552c0f){_0x3c3c7b[_0xbeb0('0x1c')](0x194);}return _0x552c0f;};}function handleError(_0x50b2ea,_0x39f7d4){_0x39f7d4=_0x39f7d4||0x1f4;return function(_0x3da4e9){logger['error'](_0x3da4e9[_0xbeb0('0x2e')]);if(_0x3da4e9[_0xbeb0('0x2f')]){delete _0x3da4e9[_0xbeb0('0x2f')];}_0x50b2ea['status'](_0x39f7d4)[_0xbeb0('0x30')](_0x3da4e9);};}exports[_0xbeb0('0x31')]=function(_0x379f3b,_0x53afaa){var _0x46b84b={},_0x41b58b={},_0x4339b7={'count':0x0,'rows':[]};var _0xee584b=_[_0xbeb0('0x32')](db[_0xbeb0('0x33')][_0xbeb0('0x34')],function(_0x10496f){return{'name':_0x10496f[_0xbeb0('0x35')],'type':_0x10496f['type'][_0xbeb0('0x36')]};});_0x41b58b[_0xbeb0('0x37')]=_[_0xbeb0('0x32')](_0xee584b,'name');_0x41b58b[_0xbeb0('0x38')]=_[_0xbeb0('0x39')](_0x379f3b[_0xbeb0('0x38')]);_0x41b58b[_0xbeb0('0x3a')]=_[_0xbeb0('0x3b')](_0x41b58b['model'],_0x41b58b[_0xbeb0('0x38')]);_0x46b84b[_0xbeb0('0x3c')]=_[_0xbeb0('0x3b')](_0x41b58b[_0xbeb0('0x37')],qs[_0xbeb0('0x3d')](_0x379f3b[_0xbeb0('0x38')][_0xbeb0('0x3d')]));_0x46b84b['attributes']=_0x46b84b[_0xbeb0('0x3c')]['length']?_0x46b84b[_0xbeb0('0x3c')]:_0x41b58b[_0xbeb0('0x37')];if(!_0x379f3b[_0xbeb0('0x38')][_0xbeb0('0x3e')]('nolimit')){_0x46b84b[_0xbeb0('0x23')]=qs[_0xbeb0('0x23')](_0x379f3b['query'][_0xbeb0('0x23')]);_0x46b84b[_0xbeb0('0x20')]=qs[_0xbeb0('0x20')](_0x379f3b[_0xbeb0('0x38')][_0xbeb0('0x20')]);}_0x46b84b[_0xbeb0('0x3f')]=qs[_0xbeb0('0x40')](_0x379f3b['query'][_0xbeb0('0x40')]);_0x46b84b[_0xbeb0('0x41')]=qs[_0xbeb0('0x3a')](_[_0xbeb0('0x42')](_0x379f3b[_0xbeb0('0x38')],_0x41b58b[_0xbeb0('0x3a')]),_0xee584b);if(_0x379f3b[_0xbeb0('0x38')][_0xbeb0('0x43')]){_0x46b84b[_0xbeb0('0x41')]=_[_0xbeb0('0x44')](_0x46b84b['where'],{'$or':_['map'](_0xee584b,function(_0x1efe90){if(_0x1efe90[_0xbeb0('0x45')]!==_0xbeb0('0x46')){var _0x9aee94={};_0x9aee94[_0x1efe90[_0xbeb0('0x2f')]]={'$like':'%'+_0x379f3b[_0xbeb0('0x38')][_0xbeb0('0x43')]+'%'};return _0x9aee94;}})});}_0x46b84b=_['merge']({},_0x46b84b,_0x379f3b[_0xbeb0('0x47')]);var _0x49ac55={'where':_0x46b84b[_0xbeb0('0x41')]};return db['WhatsappQueue'][_0xbeb0('0x22')](_0x49ac55)[_0xbeb0('0x2a')](function(_0x4931e9){_0x4339b7[_0xbeb0('0x22')]=_0x4931e9;if(_0x379f3b[_0xbeb0('0x38')][_0xbeb0('0x48')]){_0x46b84b[_0xbeb0('0x49')]=[{'all':!![]}];}return db[_0xbeb0('0x33')][_0xbeb0('0x4a')](_0x46b84b);})['then'](function(_0x2392ad){_0x4339b7[_0xbeb0('0x4b')]=_0x2392ad;return _0x4339b7;})[_0xbeb0('0x2a')](respondWithFilteredResult(_0x53afaa,_0x46b84b))['catch'](handleError(_0x53afaa,null));};exports[_0xbeb0('0x4c')]=function(_0x154b3f,_0x4203d3){var _0x51df2e={'raw':!![],'where':{'id':_0x154b3f[_0xbeb0('0x4d')]['id']}},_0x35a66a={};_0x35a66a[_0xbeb0('0x37')]=_[_0xbeb0('0x39')](db[_0xbeb0('0x33')]['rawAttributes']);_0x35a66a['query']=_[_0xbeb0('0x39')](_0x154b3f[_0xbeb0('0x38')]);_0x35a66a['filters']=_[_0xbeb0('0x3b')](_0x35a66a[_0xbeb0('0x37')],_0x35a66a[_0xbeb0('0x38')]);_0x51df2e[_0xbeb0('0x3c')]=_['intersection'](_0x35a66a[_0xbeb0('0x37')],qs[_0xbeb0('0x3d')](_0x154b3f[_0xbeb0('0x38')]['fields']));_0x51df2e[_0xbeb0('0x3c')]=_0x51df2e[_0xbeb0('0x3c')][_0xbeb0('0x4e')]?_0x51df2e[_0xbeb0('0x3c')]:_0x35a66a[_0xbeb0('0x37')];if(_0x154b3f[_0xbeb0('0x38')]['includeAll']){_0x51df2e['include']=[{'all':!![]}];}_0x51df2e=_[_0xbeb0('0x44')]({},_0x51df2e,_0x154b3f[_0xbeb0('0x47')]);return db[_0xbeb0('0x33')]['find'](_0x51df2e)['then'](handleEntityNotFound(_0x4203d3,null))[_0xbeb0('0x2a')](respondWithResult(_0x4203d3,null))[_0xbeb0('0x4f')](handleError(_0x4203d3,null));};exports[_0xbeb0('0x50')]=function(_0x52edc7,_0x315e40){return db[_0xbeb0('0x33')][_0xbeb0('0x50')](_0x52edc7['body'],{})[_0xbeb0('0x2a')](function(_0x1e8bc4){var _0x41234d=_0x52edc7['user'][_0xbeb0('0x2c')]({'plain':!![]});if(!_0x41234d)throw new Error(_0xbeb0('0x51'));if(_0x41234d[_0xbeb0('0x52')]==='user'){var _0xc697d6=_0x1e8bc4[_0xbeb0('0x2c')]({'plain':!![]});var _0x5711ac='WhatsappQueues';return db[_0xbeb0('0x53')]['find']({'where':{'name':_0x5711ac,'userProfileId':_0x41234d['userProfileId']},'raw':!![]})['then'](function(_0x36e330){if(_0x36e330&&_0x36e330[_0xbeb0('0x54')]===0x0){return db[_0xbeb0('0x55')][_0xbeb0('0x50')]({'name':_0xc697d6[_0xbeb0('0x2f')],'resourceId':_0xc697d6['id'],'type':_0x36e330[_0xbeb0('0x2f')],'sectionId':_0x36e330['id']},{})[_0xbeb0('0x2a')](function(){return _0x1e8bc4;});}else{return _0x1e8bc4;}})[_0xbeb0('0x4f')](function(_0x13c1f6){logger['error'](_0xbeb0('0x56'),_0x13c1f6);throw _0x13c1f6;});}return _0x1e8bc4;})[_0xbeb0('0x2a')](respondWithResult(_0x315e40,0xc9))['catch'](handleError(_0x315e40,null));};exports[_0xbeb0('0x29')]=function(_0x497246,_0x1fe9fa){if(_0x497246['body']['id']){delete _0x497246[_0xbeb0('0x57')]['id'];}return db[_0xbeb0('0x33')][_0xbeb0('0x58')]({'where':{'id':_0x497246[_0xbeb0('0x4d')]['id']}})[_0xbeb0('0x2a')](handleEntityNotFound(_0x1fe9fa,null))[_0xbeb0('0x2a')](saveUpdates(_0x497246[_0xbeb0('0x57')],null))[_0xbeb0('0x2a')](respondWithResult(_0x1fe9fa,null))[_0xbeb0('0x4f')](handleError(_0x1fe9fa,null));};exports['destroy']=function(_0x1676df,_0x40a43a){return db[_0xbeb0('0x33')][_0xbeb0('0x58')]({'where':{'id':_0x1676df['params']['id']}})[_0xbeb0('0x2a')](handleEntityNotFound(_0x40a43a,null))[_0xbeb0('0x2a')](removeEntity(_0x40a43a,null))[_0xbeb0('0x4f')](handleError(_0x40a43a,null));};exports[_0xbeb0('0x59')]=function(_0x4419ec,_0x42fa00){return db[_0xbeb0('0x33')][_0xbeb0('0x59')]()[_0xbeb0('0x2a')](respondWithResult(_0x42fa00,null))[_0xbeb0('0x4f')](handleError(_0x42fa00,null));};exports[_0xbeb0('0x5a')]=function(_0x2614c6,_0x308a17,_0x243bff){var _0x1eafd6={'raw':!![],'where':{}},_0x47b704={},_0x3b068a;return db[_0xbeb0('0x33')][_0xbeb0('0x5b')]({'where':{'id':_0x2614c6[_0xbeb0('0x4d')]['id']}})[_0xbeb0('0x2a')](handleEntityNotFound(_0x308a17,null))['then'](function(_0x1faa05){if(_0x1faa05){_0x3b068a=_0x1faa05[_0xbeb0('0x2c')]({'plain':!![]});_0x47b704[_0xbeb0('0x37')]=_['keys'](db[_0xbeb0('0x5c')][_0xbeb0('0x34')]);_0x47b704[_0xbeb0('0x38')]=_[_0xbeb0('0x39')](_0x2614c6[_0xbeb0('0x38')]);_0x47b704[_0xbeb0('0x3a')]=_[_0xbeb0('0x3b')](_0x47b704[_0xbeb0('0x37')],_0x47b704[_0xbeb0('0x38')]);_0x1eafd6['attributes']=_[_0xbeb0('0x3b')](_0x47b704['model'],qs[_0xbeb0('0x3d')](_0x2614c6[_0xbeb0('0x38')][_0xbeb0('0x3d')]));_0x1eafd6[_0xbeb0('0x3c')]=_0x1eafd6[_0xbeb0('0x3c')][_0xbeb0('0x4e')]?_0x1eafd6['attributes']:_0x47b704[_0xbeb0('0x37')];if(!_0x2614c6[_0xbeb0('0x38')][_0xbeb0('0x3e')](_0xbeb0('0x5d'))){_0x1eafd6[_0xbeb0('0x23')]=qs[_0xbeb0('0x23')](_0x2614c6[_0xbeb0('0x38')][_0xbeb0('0x23')]);_0x1eafd6[_0xbeb0('0x20')]=qs[_0xbeb0('0x20')](_0x2614c6['query'][_0xbeb0('0x20')]);}_0x1eafd6[_0xbeb0('0x3f')]=qs[_0xbeb0('0x40')](_0x2614c6[_0xbeb0('0x38')][_0xbeb0('0x40')]);_0x1eafd6[_0xbeb0('0x41')]=qs[_0xbeb0('0x3a')](_[_0xbeb0('0x42')](_0x2614c6[_0xbeb0('0x38')],_0x47b704[_0xbeb0('0x3a')]));_0x1eafd6['where'][_0xbeb0('0x5e')]=_0x1faa05['id'];if(_0x2614c6[_0xbeb0('0x38')][_0xbeb0('0x43')]){_0x1eafd6['where']=_[_0xbeb0('0x44')](_0x1eafd6[_0xbeb0('0x41')],{'$or':_['map'](_0x1eafd6[_0xbeb0('0x3c')],function(_0x8bd9c0){var _0x45c2dd={};_0x45c2dd[_0x8bd9c0]={'$like':'%'+_0x2614c6['query'][_0xbeb0('0x43')]+'%'};return _0x45c2dd;})});}_0x1eafd6=_[_0xbeb0('0x44')]({},_0x1eafd6,_0x2614c6[_0xbeb0('0x47')]);return db['UserWhatsappQueue'][_0xbeb0('0x4a')](_0x1eafd6);}})[_0xbeb0('0x2a')](function(_0x13b5df){if(_0x13b5df){return db['User'][_0xbeb0('0x5f')]({'where':{'id':_[_0xbeb0('0x32')](_0x13b5df,_0xbeb0('0x60')),'role':_0xbeb0('0x61')},'attributes':['id',_0xbeb0('0x2f'),_0xbeb0('0x62'),_0xbeb0('0x63'),_0xbeb0('0x64')]});}})[_0xbeb0('0x2a')](function(_0x3a8378){if(_0x3a8378){return{'count':_0x3a8378['count'],'rows':_[_0xbeb0('0x32')](_0x3a8378[_0xbeb0('0x4b')],function(_0x1a1fdf){return{'membername':_0x1a1fdf['name'],'UserId':_0x1a1fdf['id'],'queue_name':_0x3b068a['name'],'WhatsappQueueId':_0x3b068a['id'],'interface':util[_0xbeb0('0x65')](_0xbeb0('0x66'),_0xbeb0('0x67'),_0x1a1fdf[_0xbeb0('0x2f')]),'penalty':0x0,'paused':_0x1a1fdf[_0xbeb0('0x62')],'createdAt':_0x1a1fdf[_0xbeb0('0x64')],'updatedAt':_0x1a1fdf['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xbeb0('0x2a')](respondWithFilteredResult(_0x308a17,_0x1eafd6))[_0xbeb0('0x4f')](handleError(_0x308a17,null));};exports[_0xbeb0('0x68')]=function(_0x5c0d4b,_0x452d99,_0x15da85){var _0x5360e1={};var _0x545638={};var _0x2dd27b;var _0x421e94;return db[_0xbeb0('0x33')][_0xbeb0('0x5b')]({'where':{'id':_0x5c0d4b['params']['id']}})[_0xbeb0('0x2a')](handleEntityNotFound(_0x452d99,null))[_0xbeb0('0x2a')](function(_0x28042b){if(_0x28042b){_0x2dd27b=_0x28042b;_0x545638[_0xbeb0('0x37')]=_[_0xbeb0('0x39')](db['Team'][_0xbeb0('0x34')]);_0x545638['query']=_[_0xbeb0('0x39')](_0x5c0d4b[_0xbeb0('0x38')]);_0x545638[_0xbeb0('0x3a')]=_[_0xbeb0('0x3b')](_0x545638[_0xbeb0('0x37')],_0x545638[_0xbeb0('0x38')]);_0x5360e1['attributes']=_[_0xbeb0('0x3b')](_0x545638[_0xbeb0('0x37')],qs[_0xbeb0('0x3d')](_0x5c0d4b[_0xbeb0('0x38')][_0xbeb0('0x3d')]));_0x5360e1[_0xbeb0('0x3c')]=_0x5360e1[_0xbeb0('0x3c')]['length']?_0x5360e1[_0xbeb0('0x3c')]:_0x545638['model'];_0x5360e1[_0xbeb0('0x3f')]=qs[_0xbeb0('0x40')](_0x5c0d4b[_0xbeb0('0x38')][_0xbeb0('0x40')]);_0x5360e1['where']=qs[_0xbeb0('0x3a')](_[_0xbeb0('0x42')](_0x5c0d4b[_0xbeb0('0x38')],_0x545638['filters']));if(_0x5c0d4b[_0xbeb0('0x38')][_0xbeb0('0x43')]){_0x5360e1[_0xbeb0('0x41')]=_[_0xbeb0('0x44')](_0x5360e1[_0xbeb0('0x41')],{'$or':_[_0xbeb0('0x32')](_0x5360e1[_0xbeb0('0x3c')],function(_0x9712db){var _0x7180da={};_0x7180da[_0x9712db]={'$like':'%'+_0x5c0d4b[_0xbeb0('0x38')][_0xbeb0('0x43')]+'%'};return _0x7180da;})});}_0x5360e1=_[_0xbeb0('0x44')]({},_0x5360e1,_0x5c0d4b[_0xbeb0('0x47')]);return _0x2dd27b[_0xbeb0('0x68')](_0x5360e1);}})[_0xbeb0('0x2a')](function(_0x32b217){if(_0x32b217){_0x421e94=_0x32b217['length'];if(!_0x5c0d4b[_0xbeb0('0x38')][_0xbeb0('0x3e')](_0xbeb0('0x5d'))){_0x5360e1[_0xbeb0('0x23')]=qs[_0xbeb0('0x23')](_0x5c0d4b[_0xbeb0('0x38')][_0xbeb0('0x23')]);_0x5360e1[_0xbeb0('0x20')]=qs[_0xbeb0('0x20')](_0x5c0d4b[_0xbeb0('0x38')]['offset']);}return _0x2dd27b[_0xbeb0('0x68')](_0x5360e1);}})[_0xbeb0('0x2a')](function(_0x48f3d7){if(_0x48f3d7){return _0x48f3d7?{'count':_0x421e94,'rows':_0x48f3d7}:null;}})[_0xbeb0('0x2a')](respondWithResult(_0x452d99,null))[_0xbeb0('0x4f')](handleError(_0x452d99,null));};exports[_0xbeb0('0x69')]=function(_0x27e0e2,_0x5407a1,_0x58cd2c){var _0x1c8322=_0x27e0e2['body'][_0xbeb0('0x6a')];return db[_0xbeb0('0x6b')][_0xbeb0('0x4a')]({'where':{'id':_0x1c8322},'attributes':['id'],'include':[{'model':db['User'],'as':_0xbeb0('0x6c'),'attributes':['id',_0xbeb0('0x2f'),_0xbeb0('0x6d'),_0xbeb0('0x6e'),_0xbeb0('0x6f')],'raw':!![]}]})[_0xbeb0('0x2a')](function(_0x4bd475){if(_0x4bd475){var _0x47fff6=_[_0xbeb0('0x70')](_0x4bd475,function(_0x3cda2a){var _0x58b1fa=_0x3cda2a['get']({'plain':!![]});return _0x58b1fa[_0xbeb0('0x6c')];});return db['WhatsappQueue'][_0xbeb0('0x58')]({'where':{'id':_0x27e0e2[_0xbeb0('0x4d')]['id']}})[_0xbeb0('0x2a')](function(_0x12f306){return db[_0xbeb0('0x71')]['transaction'](function(_0x40dedc){return _0x12f306['addTeams'](_0x1c8322,{'transaction':_0x40dedc})[_0xbeb0('0x2a')](function(){return BPromise['each'](_0x47fff6,function(_0x1b88d5){return db[_0xbeb0('0x5c')][_0xbeb0('0x72')]({'where':{'UserId':_0x1b88d5['id'],'WhatsappQueueId':_0x27e0e2[_0xbeb0('0x4d')]['id']},'transaction':_0x40dedc});});})[_0xbeb0('0x2a')](function(){_0x47fff6['forEach'](function(_0x1ffa0f){socket['emit'](_0xbeb0('0x73'),{'UserId':_0x1ffa0f['id'],'WhatsappQueueId':_0x12f306['id']});});});});});}})[_0xbeb0('0x2a')](respondWithStatusCode(_0x5407a1,null))['catch'](handleError(_0x5407a1,null));};exports[_0xbeb0('0x74')]=function(_0x458653,_0xebf1f1,_0x3625e2){return db[_0xbeb0('0x6b')]['findAll']({'where':{'id':_0x458653[_0xbeb0('0x38')]['ids']},'attributes':['id'],'include':[{'model':db[_0xbeb0('0x75')],'as':_0xbeb0('0x6c'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0xebf1f1,null))[_0xbeb0('0x2a')](function(_0x1504ec){var _0x4206cd=_[_0xbeb0('0x32')](_0x1504ec,'id');var _0x475f65=[];var _0x519b8c=[];var _0x572ff5=squel[_0xbeb0('0x76')]();_0x572ff5[_0xbeb0('0x77')](_0xbeb0('0x78'))[_0xbeb0('0x79')](_0xbeb0('0x7a'),'tq')[_0xbeb0('0x7b')](_0xbeb0('0x7c'),'ut',_0xbeb0('0x7d'))[_0xbeb0('0x41')](_0xbeb0('0x7e'),_0x458653[_0xbeb0('0x4d')]['id']);for(var _0xd2efd3=0x0;_0xd2efd3<_0x1504ec[_0xbeb0('0x4e')];_0xd2efd3+=0x1){let _0x326baf=_0x1504ec[_0xd2efd3];for(var _0x2361ec=0x0;_0x2361ec<_0x326baf['Agents'][_0xbeb0('0x4e')];_0x2361ec+=0x1){let _0x314eed=_0x326baf['Agents'][_0x2361ec];var _0x20643d=_0x572ff5['clone']();_0x20643d[_0xbeb0('0x41')](_0xbeb0('0x7f'),_0x314eed['id']);_0x519b8c['push'](db['sequelize'][_0xbeb0('0x38')](_0x20643d['toString'](),{'type':db[_0xbeb0('0x71')][_0xbeb0('0x80')][_0xbeb0('0x81')]})[_0xbeb0('0x2a')](function(_0x76c4fd){if(_0x76c4fd[_0xbeb0('0x4e')]===0x1){return _0x314eed['id'];}else{var _0x5e1c6c=_[_0xbeb0('0x82')](_[_0xbeb0('0x32')](_0x76c4fd,'TeamId'),function(_0x24df0e){return _[_0xbeb0('0x83')](_0x4206cd,_0x24df0e);});if(_0x5e1c6c){return _0x314eed['id'];}}}));}}return BPromise['all'](_0x519b8c)[_0xbeb0('0x2a')](function(_0x1d5167){_0x475f65=_(_0x475f65)[_0xbeb0('0x84')](_0x1d5167)[_0xbeb0('0x85')]()[_0xbeb0('0x86')]();return db['WhatsappQueue'][_0xbeb0('0x58')]({'where':{'id':_0x458653[_0xbeb0('0x4d')]['id']}})[_0xbeb0('0x2a')](function(_0x3c624a){return db[_0xbeb0('0x71')][_0xbeb0('0x87')](function(_0x386380){return _0x3c624a[_0xbeb0('0x74')](_0x458653[_0xbeb0('0x38')]['ids'],{'transaction':_0x386380})[_0xbeb0('0x2a')](function(){if(!_['isEmpty'](_0x475f65)){return _0x3c624a[_0xbeb0('0x88')](_0x475f65,{'transaction':_0x386380});}})['then'](function(){_0x475f65['forEach'](function(_0x13f922){socket['emit'](_0xbeb0('0x89'),{'UserId':_0x13f922,'WhatsappQueueId':_0x3c624a['id']});});});});});});})['then'](respondWithStatusCode(_0xebf1f1,null))['catch'](handleError(_0xebf1f1,null));};exports[_0xbeb0('0x8a')]=function(_0x1768af,_0x9680ee,_0x49314b){return db[_0xbeb0('0x33')]['find']({'where':{'id':_0x1768af['params']['id']}})['then'](handleEntityNotFound(_0x9680ee,null))[_0xbeb0('0x2a')](function(_0x2c4e44){if(_0x2c4e44){return _0x2c4e44[_0xbeb0('0x8a')](_0x1768af[_0xbeb0('0x57')][_0xbeb0('0x6a')],_['omit'](_0x1768af['body'],['ids','id'])||{})[_0xbeb0('0x8b')](function(_0x148525){for(var _0x4ce363=0x0;_0x4ce363<_0x1768af['body'][_0xbeb0('0x6a')][_0xbeb0('0x4e')];_0x4ce363+=0x1){socket[_0xbeb0('0x8c')](_0xbeb0('0x73'),{'UserId':Number(_0x1768af[_0xbeb0('0x57')][_0xbeb0('0x6a')][_0x4ce363]),'WhatsappQueueId':Number(_0x1768af['params']['id'])});}return _0x148525;});}})[_0xbeb0('0x2a')](respondWithResult(_0x9680ee,null))['catch'](handleError(_0x9680ee,null));};exports[_0xbeb0('0x88')]=function(_0x27a1bf,_0x4e6373,_0x3d3c46){return db['WhatsappQueue'][_0xbeb0('0x58')]({'where':{'id':_0x27a1bf['params']['id']}})['then'](handleEntityNotFound(_0x4e6373,null))[_0xbeb0('0x2a')](function(_0x3d3a57){if(_0x3d3a57){return _0x3d3a57['removeAgents'](_0x27a1bf['query'][_0xbeb0('0x6a')])[_0xbeb0('0x2a')](function(){if(_['isArray'](_0x27a1bf[_0xbeb0('0x38')][_0xbeb0('0x6a')])){for(var _0x1b2de5=0x0;_0x1b2de5<_0x27a1bf['query']['ids'][_0xbeb0('0x4e')];_0x1b2de5+=0x1){socket['emit'](_0xbeb0('0x89'),{'UserId':Number(_0x27a1bf[_0xbeb0('0x38')][_0xbeb0('0x6a')][_0x1b2de5]),'WhatsappQueueId':Number(_0x27a1bf[_0xbeb0('0x4d')]['id'])});}}else{socket['emit'](_0xbeb0('0x89'),{'UserId':Number(_0x27a1bf[_0xbeb0('0x38')]['ids']),'WhatsappQueueId':Number(_0x27a1bf['params']['id'])});}});}})[_0xbeb0('0x2a')](respondWithStatusCode(_0x4e6373,null))[_0xbeb0('0x4f')](handleError(_0x4e6373,null));};exports[_0xbeb0('0x8d')]=function(_0x5d96f0,_0x196ac9,_0xfa162e){var _0x4121c9={};var _0x7421ea={};var _0x38d259;var _0x4c8d11;return db[_0xbeb0('0x33')]['findOne']({'where':{'id':_0x5d96f0[_0xbeb0('0x4d')]['id']}})['then'](handleEntityNotFound(_0x196ac9,null))[_0xbeb0('0x2a')](function(_0x542217){if(_0x542217){_0x38d259=_0x542217;_0x7421ea['model']=_[_0xbeb0('0x39')](db[_0xbeb0('0x75')][_0xbeb0('0x34')]);_0x7421ea[_0xbeb0('0x38')]=_['keys'](_0x5d96f0[_0xbeb0('0x38')]);_0x7421ea[_0xbeb0('0x3a')]=_['intersection'](_0x7421ea['model'],_0x7421ea[_0xbeb0('0x38')]);_0x4121c9[_0xbeb0('0x3c')]=_[_0xbeb0('0x3b')](_0x7421ea[_0xbeb0('0x37')],qs[_0xbeb0('0x3d')](_0x5d96f0[_0xbeb0('0x38')][_0xbeb0('0x3d')]));_0x4121c9['attributes']=_0x4121c9[_0xbeb0('0x3c')][_0xbeb0('0x4e')]?_0x4121c9['attributes']:_0x7421ea[_0xbeb0('0x37')];_0x4121c9[_0xbeb0('0x3f')]=qs[_0xbeb0('0x40')](_0x5d96f0[_0xbeb0('0x38')]['sort']);_0x4121c9['where']=qs['filters'](_[_0xbeb0('0x42')](_0x5d96f0[_0xbeb0('0x38')],_0x7421ea['filters']));if(_0x5d96f0[_0xbeb0('0x38')][_0xbeb0('0x43')]){_0x4121c9['where']=_[_0xbeb0('0x44')](_0x4121c9[_0xbeb0('0x41')],{'$or':_[_0xbeb0('0x32')](_0x4121c9[_0xbeb0('0x3c')],function(_0x4b93a6){var _0xddc7a6={};_0xddc7a6[_0x4b93a6]={'$like':'%'+_0x5d96f0[_0xbeb0('0x38')]['filter']+'%'};return _0xddc7a6;})});}_0x4121c9=_[_0xbeb0('0x44')]({},_0x4121c9,_0x5d96f0[_0xbeb0('0x47')]);return _0x38d259[_0xbeb0('0x8d')](_0x4121c9);}})[_0xbeb0('0x2a')](function(_0x5021be){if(_0x5021be){_0x4c8d11=_0x5021be[_0xbeb0('0x4e')];if(!_0x5d96f0[_0xbeb0('0x38')][_0xbeb0('0x3e')](_0xbeb0('0x5d'))){_0x4121c9[_0xbeb0('0x23')]=qs['limit'](_0x5d96f0[_0xbeb0('0x38')][_0xbeb0('0x23')]);_0x4121c9[_0xbeb0('0x20')]=qs[_0xbeb0('0x20')](_0x5d96f0[_0xbeb0('0x38')][_0xbeb0('0x20')]);}return _0x38d259['getAgents'](_0x4121c9);}})[_0xbeb0('0x2a')](function(_0x13f6ca){if(_0x13f6ca){return _0x13f6ca?{'count':_0x4c8d11,'rows':_0x13f6ca}:null;}})[_0xbeb0('0x2a')](respondWithResult(_0x196ac9,null))[_0xbeb0('0x4f')](handleError(_0x196ac9,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 47e1eb5..f7b354c 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 _0x3afd=['remove','emit','hook','exports','../../mysqldb','WhatsappQueue','setMaxListeners','save','update'];(function(_0x237bf7,_0xb851fc){var _0x5928ba=function(_0x14c0d0){while(--_0x14c0d0){_0x237bf7['push'](_0x237bf7['shift']());}};_0x5928ba(++_0xb851fc);}(_0x3afd,0x124));var _0xd3af=function(_0x8e9386,_0x3cc60f){_0x8e9386=_0x8e9386-0x0;var _0x4abf26=_0x3afd[_0x8e9386];return _0x4abf26;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0xd3af('0x0'))['db'][_0xd3af('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xd3af('0x2')](0x0);var events={'afterCreate':_0xd3af('0x3'),'afterUpdate':_0xd3af('0x4'),'afterDestroy':_0xd3af('0x5')};function emitEvent(_0x5941bb){return function(_0x3c9f21,_0x366d30,_0xbea1d5){WhatsappQueueEvents['emit'](_0x5941bb+':'+_0x3c9f21['id'],_0x3c9f21);WhatsappQueueEvents[_0xd3af('0x6')](_0x5941bb,_0x3c9f21);_0xbea1d5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0xd3af('0x7')](e,emitEvent(event));}}module[_0xd3af('0x8')]=WhatsappQueueEvents; \ No newline at end of file +var _0xea8a=['exports','../../mysqldb','setMaxListeners','save','emit','hasOwnProperty','hook'];(function(_0x9d9470,_0x38cbdd){var _0x4e38e2=function(_0x1b565a){while(--_0x1b565a){_0x9d9470['push'](_0x9d9470['shift']());}};_0x4e38e2(++_0x38cbdd);}(_0xea8a,0x104));var _0xaea8=function(_0x58c818,_0x5abf57){_0x58c818=_0x58c818-0x0;var _0x1c6243=_0xea8a[_0x58c818];return _0x1c6243;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0xaea8('0x0'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xaea8('0x1')](0x0);var events={'afterCreate':_0xaea8('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x342fda){return function(_0x1fc6a1,_0x4de47a,_0x1a1c0a){WhatsappQueueEvents[_0xaea8('0x3')](_0x342fda+':'+_0x1fc6a1['id'],_0x1fc6a1);WhatsappQueueEvents['emit'](_0x342fda,_0x1fc6a1);_0x1a1c0a(null);};}for(var e in events){if(events[_0xaea8('0x4')](e)){var event=events[e];WhatsappQueue[_0xaea8('0x5')](e,emitEvent(event));}}module[_0xaea8('0x6')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 74e8540..cc7f779 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 _0xc027=['request-promise','path','./whatsappQueue.attributes','exports','define','WhatsappQueue','whatsapp_queues','util','api','bluebird'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xc027,0xf7));var _0x7c02=function(_0x48093b,_0x6f8029){_0x48093b=_0x48093b-0x0;var _0x562fbf=_0xc027[_0x48093b];return _0x562fbf;};'use strict';var _=require('lodash');var util=require(_0x7c02('0x0'));var logger=require('../../config/logger')(_0x7c02('0x1'));var moment=require('moment');var BPromise=require(_0x7c02('0x2'));var rp=require(_0x7c02('0x3'));var fs=require('fs');var path=require(_0x7c02('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7c02('0x5'));module[_0x7c02('0x6')]=function(_0x49bdb4,_0x25e3b9){return _0x49bdb4[_0x7c02('0x7')](_0x7c02('0x8'),attributes,{'tableName':_0x7c02('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa3fe=['bluebird','path','../../config/environment','./whatsappQueue.attributes','exports','define','whatsapp_queues','lodash','util','api','moment'];(function(_0x47b40e,_0x2fa148){var _0x51672f=function(_0xabb175){while(--_0xabb175){_0x47b40e['push'](_0x47b40e['shift']());}};_0x51672f(++_0x2fa148);}(_0xa3fe,0xb7));var _0xea3f=function(_0x28796b,_0x41e9f8){_0x28796b=_0x28796b-0x0;var _0x2d20b0=_0xa3fe[_0x28796b];return _0x2d20b0;};'use strict';var _=require(_0xea3f('0x0'));var util=require(_0xea3f('0x1'));var logger=require('../../config/logger')(_0xea3f('0x2'));var moment=require(_0xea3f('0x3'));var BPromise=require(_0xea3f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xea3f('0x5'));var rimraf=require('rimraf');var config=require(_0xea3f('0x6'));var attributes=require(_0xea3f('0x7'));module[_0xea3f('0x8')]=function(_0x10a181,_0x3b3e44){return _0x10a181[_0xea3f('0x9')]('WhatsappQueue',attributes,{'tableName':_0xea3f('0xa'),'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 44137e3..698f915 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 _0xd515=['ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./whatsappQueue.socket','register','request','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetWhatsappQueue','options','raw','where','attributes','map','include','then','ShowWhatsappQueue','WhatsappQueue','find','model','lodash','moment','randomstring'];(function(_0x4dbc5d,_0x3fab33){var _0x48893d=function(_0x2fe406){while(--_0x2fe406){_0x4dbc5d['push'](_0x4dbc5d['shift']());}};_0x48893d(++_0x3fab33);}(_0xd515,0x19f));var _0x5d51=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd515[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x5d51('0x0'));var util=require('util');var moment=require(_0x5d51('0x1'));var BPromise=require('bluebird');var rs=require(_0x5d51('0x2'));var fs=require('fs');var Redis=require(_0x5d51('0x3'));var db=require(_0x5d51('0x4'))['db'];var utils=require(_0x5d51('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x5d51('0x6'));var jayson=require(_0x5d51('0x7'));var client=jayson[_0x5d51('0x8')][_0x5d51('0x9')]({'port':0x232a});config[_0x5d51('0xa')]=_[_0x5d51('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5d51('0xc'))(new Redis(config[_0x5d51('0xa')]));require(_0x5d51('0xd'))[_0x5d51('0xe')](socket);function respondWithRpcPromise(_0x33b5c7,_0x155bd5,_0x34f26c){return new BPromise(function(_0xa3dc5d,_0x5d589f){return client[_0x5d51('0xf')](_0x33b5c7,_0x34f26c)['then'](function(_0x303b14){logger['info'](_0x5d51('0x10'),_0x155bd5,_0x5d51('0x11'));logger[_0x5d51('0x12')](_0x5d51('0x13'),_0x155bd5,'request\x20sent',JSON[_0x5d51('0x14')](_0x303b14));if(_0x303b14[_0x5d51('0x15')]){if(_0x303b14[_0x5d51('0x15')]['code']===0x1f4){logger[_0x5d51('0x15')](_0x5d51('0x10'),_0x155bd5,_0x303b14[_0x5d51('0x15')][_0x5d51('0x16')]);return _0x5d589f(_0x303b14[_0x5d51('0x15')][_0x5d51('0x16')]);}logger[_0x5d51('0x15')](_0x5d51('0x10'),_0x155bd5,_0x303b14[_0x5d51('0x15')][_0x5d51('0x16')]);return _0xa3dc5d(_0x303b14[_0x5d51('0x15')][_0x5d51('0x16')]);}else{logger[_0x5d51('0x17')](_0x5d51('0x10'),_0x155bd5,'request\x20sent');_0xa3dc5d(_0x303b14[_0x5d51('0x18')]['message']);}})[_0x5d51('0x19')](function(_0x3d2301){logger['error'](_0x5d51('0x10'),_0x155bd5,_0x3d2301);_0x5d589f(_0x3d2301);});});}exports[_0x5d51('0x1a')]=function(_0x932ea6){var _0x5e94f8=this;return new Promise(function(_0x33186c,_0x241693){return db['WhatsappQueue']['findAll']({'raw':_0x932ea6[_0x5d51('0x1b')]?_0x932ea6[_0x5d51('0x1b')][_0x5d51('0x1c')]===undefined?!![]:![]:!![],'where':_0x932ea6[_0x5d51('0x1b')]?_0x932ea6[_0x5d51('0x1b')][_0x5d51('0x1d')]||null:null,'attributes':_0x932ea6[_0x5d51('0x1b')]?_0x932ea6['options'][_0x5d51('0x1e')]||null:null,'limit':_0x932ea6[_0x5d51('0x1b')]?_0x932ea6[_0x5d51('0x1b')]['limit']||null:null,'include':_0x932ea6['options']?_0x932ea6[_0x5d51('0x1b')]['include']?_[_0x5d51('0x1f')](_0x932ea6[_0x5d51('0x1b')][_0x5d51('0x20')],function(_0x3c9cb1){return{'model':db[_0x3c9cb1['model']],'as':_0x3c9cb1['as'],'attributes':_0x3c9cb1[_0x5d51('0x1e')],'include':_0x3c9cb1['include']?_['map'](_0x3c9cb1[_0x5d51('0x20')],function(_0x142d05){return{'model':db[_0x142d05['model']],'as':_0x142d05['as'],'attributes':_0x142d05[_0x5d51('0x1e')],'include':_0x142d05[_0x5d51('0x20')]?_[_0x5d51('0x1f')](_0x142d05['include'],function(_0x3139c9){return{'model':db[_0x3139c9['model']],'as':_0x3139c9['as'],'attributes':_0x3139c9[_0x5d51('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x5d51('0x21')](function(_0x18e901){logger[_0x5d51('0x17')](_0x5d51('0x1a'),_0x932ea6);logger[_0x5d51('0x12')](_0x5d51('0x1a'),_0x932ea6,JSON['stringify'](_0x18e901));_0x33186c(_0x18e901);})['catch'](function(_0x22261f){logger[_0x5d51('0x15')](_0x5d51('0x1a'),_0x22261f['message'],_0x932ea6);_0x241693(_0x5e94f8[_0x5d51('0x15')](0x1f4,_0x22261f[_0x5d51('0x16')]));});});};exports[_0x5d51('0x22')]=function(_0x474aa2){var _0x2425da=this;return new Promise(function(_0x52e7f6,_0x29497c){return db[_0x5d51('0x23')][_0x5d51('0x24')]({'raw':_0x474aa2[_0x5d51('0x1b')]?_0x474aa2[_0x5d51('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x474aa2[_0x5d51('0x1b')]?_0x474aa2[_0x5d51('0x1b')][_0x5d51('0x1d')]||null:null,'attributes':_0x474aa2[_0x5d51('0x1b')]?_0x474aa2[_0x5d51('0x1b')][_0x5d51('0x1e')]||null:null,'include':_0x474aa2[_0x5d51('0x1b')]?_0x474aa2[_0x5d51('0x1b')][_0x5d51('0x20')]?_[_0x5d51('0x1f')](_0x474aa2[_0x5d51('0x1b')][_0x5d51('0x20')],function(_0x144eaf){return{'model':db[_0x144eaf[_0x5d51('0x25')]],'as':_0x144eaf['as'],'attributes':_0x144eaf[_0x5d51('0x1e')],'include':_0x144eaf['include']?_['map'](_0x144eaf['include'],function(_0x1fc021){return{'model':db[_0x1fc021[_0x5d51('0x25')]],'as':_0x1fc021['as'],'attributes':_0x1fc021[_0x5d51('0x1e')],'include':_0x1fc021[_0x5d51('0x20')]?_[_0x5d51('0x1f')](_0x1fc021[_0x5d51('0x20')],function(_0x47a350){return{'model':db[_0x47a350[_0x5d51('0x25')]],'as':_0x47a350['as'],'attributes':_0x47a350['attributes']};}):[]};}):[]};}):[]:[]})[_0x5d51('0x21')](function(_0x1738cc){logger[_0x5d51('0x17')]('ShowWhatsappQueue',_0x474aa2);logger[_0x5d51('0x12')](_0x5d51('0x22'),_0x474aa2,JSON['stringify'](_0x1738cc));_0x52e7f6(_0x1738cc);})[_0x5d51('0x19')](function(_0xb3a563){logger[_0x5d51('0x15')](_0x5d51('0x22'),_0xb3a563[_0x5d51('0x16')],_0x474aa2);_0x29497c(_0x2425da[_0x5d51('0x15')](0x1f4,_0xb3a563[_0x5d51('0x16')]));});});}; \ No newline at end of file +var _0x31c7=['raw','attributes','limit','include','model','map','then','GetWhatsappQueue','ShowWhatsappQueue','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','WhatsappQueue','findAll','options'];(function(_0x21ecc8,_0x2bdead){var _0x510c1d=function(_0x3b6862){while(--_0x3b6862){_0x21ecc8['push'](_0x21ecc8['shift']());}};_0x510c1d(++_0x2bdead);}(_0x31c7,0x11a));var _0x731c=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x31c7[_0x49b207];return _0x2dc8fa;};'use strict';var _=require('lodash');var util=require(_0x731c('0x0'));var moment=require(_0x731c('0x1'));var BPromise=require(_0x731c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x731c('0x3'));var db=require(_0x731c('0x4'))['db'];var utils=require(_0x731c('0x5'));var logger=require(_0x731c('0x6'))(_0x731c('0x7'));var config=require(_0x731c('0x8'));var jayson=require(_0x731c('0x9'));var client=jayson['client'][_0x731c('0xa')]({'port':0x232a});config[_0x731c('0xb')]=_['defaults'](config[_0x731c('0xb')],{'host':_0x731c('0xc'),'port':0x18eb});var socket=require(_0x731c('0xd'))(new Redis(config['redis']));require(_0x731c('0xe'))[_0x731c('0xf')](socket);function respondWithRpcPromise(_0x2aa2e4,_0x28cff2,_0x15aec6){return new BPromise(function(_0x1f3fe2,_0x3a7bd7){return client[_0x731c('0x10')](_0x2aa2e4,_0x15aec6)['then'](function(_0x3ea614){logger['info'](_0x731c('0x11'),_0x28cff2,_0x731c('0x12'));logger[_0x731c('0x13')](_0x731c('0x14'),_0x28cff2,'request\x20sent',JSON[_0x731c('0x15')](_0x3ea614));if(_0x3ea614[_0x731c('0x16')]){if(_0x3ea614[_0x731c('0x16')]['code']===0x1f4){logger['error'](_0x731c('0x11'),_0x28cff2,_0x3ea614[_0x731c('0x16')][_0x731c('0x17')]);return _0x3a7bd7(_0x3ea614[_0x731c('0x16')][_0x731c('0x17')]);}logger[_0x731c('0x16')](_0x731c('0x11'),_0x28cff2,_0x3ea614[_0x731c('0x16')]['message']);return _0x1f3fe2(_0x3ea614[_0x731c('0x16')][_0x731c('0x17')]);}else{logger[_0x731c('0x18')]('WhatsappQueue,\x20%s,\x20%s',_0x28cff2,'request\x20sent');_0x1f3fe2(_0x3ea614[_0x731c('0x19')]['message']);}})[_0x731c('0x1a')](function(_0x48fcb7){logger[_0x731c('0x16')]('WhatsappQueue,\x20%s,\x20%s',_0x28cff2,_0x48fcb7);_0x3a7bd7(_0x48fcb7);});});}exports['GetWhatsappQueue']=function(_0x2de1fb){var _0x2b08cb=this;return new Promise(function(_0x42875d,_0x16ded5){return db[_0x731c('0x1b')][_0x731c('0x1c')]({'raw':_0x2de1fb[_0x731c('0x1d')]?_0x2de1fb['options'][_0x731c('0x1e')]===undefined?!![]:![]:!![],'where':_0x2de1fb['options']?_0x2de1fb['options']['where']||null:null,'attributes':_0x2de1fb[_0x731c('0x1d')]?_0x2de1fb[_0x731c('0x1d')][_0x731c('0x1f')]||null:null,'limit':_0x2de1fb[_0x731c('0x1d')]?_0x2de1fb[_0x731c('0x1d')][_0x731c('0x20')]||null:null,'include':_0x2de1fb[_0x731c('0x1d')]?_0x2de1fb[_0x731c('0x1d')]['include']?_['map'](_0x2de1fb['options'][_0x731c('0x21')],function(_0x4df89d){return{'model':db[_0x4df89d[_0x731c('0x22')]],'as':_0x4df89d['as'],'attributes':_0x4df89d[_0x731c('0x1f')],'include':_0x4df89d[_0x731c('0x21')]?_[_0x731c('0x23')](_0x4df89d['include'],function(_0x384404){return{'model':db[_0x384404[_0x731c('0x22')]],'as':_0x384404['as'],'attributes':_0x384404[_0x731c('0x1f')],'include':_0x384404[_0x731c('0x21')]?_[_0x731c('0x23')](_0x384404[_0x731c('0x21')],function(_0x31f433){return{'model':db[_0x31f433[_0x731c('0x22')]],'as':_0x31f433['as'],'attributes':_0x31f433[_0x731c('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x731c('0x24')](function(_0x1a774d){logger[_0x731c('0x18')](_0x731c('0x25'),_0x2de1fb);logger[_0x731c('0x13')]('GetWhatsappQueue',_0x2de1fb,JSON[_0x731c('0x15')](_0x1a774d));_0x42875d(_0x1a774d);})[_0x731c('0x1a')](function(_0x1ff793){logger[_0x731c('0x16')](_0x731c('0x25'),_0x1ff793['message'],_0x2de1fb);_0x16ded5(_0x2b08cb['error'](0x1f4,_0x1ff793[_0x731c('0x17')]));});});};exports[_0x731c('0x26')]=function(_0x539613){var _0x1d7d59=this;return new Promise(function(_0x342e41,_0x3bb058){return db[_0x731c('0x1b')]['find']({'raw':_0x539613[_0x731c('0x1d')]?_0x539613[_0x731c('0x1d')][_0x731c('0x1e')]===undefined?!![]:![]:!![],'where':_0x539613[_0x731c('0x1d')]?_0x539613[_0x731c('0x1d')]['where']||null:null,'attributes':_0x539613['options']?_0x539613[_0x731c('0x1d')][_0x731c('0x1f')]||null:null,'include':_0x539613[_0x731c('0x1d')]?_0x539613['options']['include']?_[_0x731c('0x23')](_0x539613[_0x731c('0x1d')][_0x731c('0x21')],function(_0x3fa539){return{'model':db[_0x3fa539[_0x731c('0x22')]],'as':_0x3fa539['as'],'attributes':_0x3fa539[_0x731c('0x1f')],'include':_0x3fa539[_0x731c('0x21')]?_[_0x731c('0x23')](_0x3fa539[_0x731c('0x21')],function(_0x31a4fc){return{'model':db[_0x31a4fc['model']],'as':_0x31a4fc['as'],'attributes':_0x31a4fc[_0x731c('0x1f')],'include':_0x31a4fc['include']?_[_0x731c('0x23')](_0x31a4fc['include'],function(_0x57b862){return{'model':db[_0x57b862[_0x731c('0x22')]],'as':_0x57b862['as'],'attributes':_0x57b862[_0x731c('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x731c('0x24')](function(_0x4573ad){logger[_0x731c('0x18')](_0x731c('0x26'),_0x539613);logger['debug'](_0x731c('0x26'),_0x539613,JSON[_0x731c('0x15')](_0x4573ad));_0x342e41(_0x4573ad);})[_0x731c('0x1a')](function(_0x3c8bae){logger['error']('ShowWhatsappQueue',_0x3c8bae[_0x731c('0x17')],_0x539613);_0x3bb058(_0x1d7d59[_0x731c('0x16')](0x1f4,_0x3c8bae['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index e9dfd65..e08ac5a 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 _0xa6e5=['./whatsappQueue.events','remove','update','removeListener','register','length'];(function(_0x599ec1,_0x52c00d){var _0x55cbfa=function(_0x2b51d9){while(--_0x2b51d9){_0x599ec1['push'](_0x599ec1['shift']());}};_0x55cbfa(++_0x52c00d);}(_0xa6e5,0x120));var _0x5a6e=function(_0x12b2aa,_0x4f8322){_0x12b2aa=_0x12b2aa-0x0;var _0x43b70f=_0xa6e5[_0x12b2aa];return _0x43b70f;};'use strict';var WhatsappQueueEvents=require(_0x5a6e('0x0'));var events=['save',_0x5a6e('0x1'),_0x5a6e('0x2')];function createListener(_0x33230c,_0x4506bb){return function(_0x449f71){_0x4506bb['emit'](_0x33230c,_0x449f71);};}function removeListener(_0x4d79d8,_0x32d444){return function(){WhatsappQueueEvents[_0x5a6e('0x3')](_0x4d79d8,_0x32d444);};}exports[_0x5a6e('0x4')]=function(_0x10e8a0){for(var _0x52bb42=0x0,_0x2a788d=events[_0x5a6e('0x5')];_0x52bb42<_0x2a788d;_0x52bb42++){var _0xc3da51=events[_0x52bb42];var _0xa1e2d8=createListener('whatsappQueue:'+_0xc3da51,_0x10e8a0);WhatsappQueueEvents['on'](_0xc3da51,_0xa1e2d8);}}; \ No newline at end of file +var _0x6871=['save','remove','update','emit','removeListener','register','length','whatsappQueue:','./whatsappQueue.events'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x6871,0x1a6));var _0x1687=function(_0x2d2180,_0x44bbca){_0x2d2180=_0x2d2180-0x0;var _0x1fe90e=_0x6871[_0x2d2180];return _0x1fe90e;};'use strict';var WhatsappQueueEvents=require(_0x1687('0x0'));var events=[_0x1687('0x1'),_0x1687('0x2'),_0x1687('0x3')];function createListener(_0x4d8102,_0x3069ca){return function(_0x1c7037){_0x3069ca[_0x1687('0x4')](_0x4d8102,_0x1c7037);};}function removeListener(_0x189a21,_0x15c129){return function(){WhatsappQueueEvents[_0x1687('0x5')](_0x189a21,_0x15c129);};}exports[_0x1687('0x6')]=function(_0x130311){for(var _0x8e7aa8=0x0,_0x4fc8aa=events[_0x1687('0x7')];_0x8e7aa8<_0x4fc8aa;_0x8e7aa8++){var _0xebe97a=events[_0x8e7aa8];var _0x7d2ae3=createListener(_0x1687('0x8')+_0xebe97a,_0x130311);WhatsappQueueEvents['on'](_0xebe97a,_0x7d2ae3);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index ff43b8a..db9123e 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 _0x7abb=['./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','/:id','update','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x7abb,0x1f0));var _0xb7ab=function(_0x4ec527,_0x4cc420){_0x4ec527=_0x4ec527-0x0;var _0x38101a=_0x7abb[_0x4ec527];return _0x38101a;};'use strict';var multer=require('multer');var util=require(_0xb7ab('0x0'));var path=require(_0xb7ab('0x1'));var timeout=require(_0xb7ab('0x2'));var express=require(_0xb7ab('0x3'));var router=express['Router']();var fs_extra=require(_0xb7ab('0x4'));var auth=require(_0xb7ab('0x5'));var interaction=require(_0xb7ab('0x6'));var config=require(_0xb7ab('0x7'));var controller=require(_0xb7ab('0x8'));router[_0xb7ab('0x9')]('/',auth[_0xb7ab('0xa')](),controller[_0xb7ab('0xb')]);router[_0xb7ab('0x9')](_0xb7ab('0xc'),auth['isAuthenticated'](),controller[_0xb7ab('0xd')]);router['get']('/:id',auth[_0xb7ab('0xa')](),controller[_0xb7ab('0xe')]);router[_0xb7ab('0xf')]('/',auth['isAuthenticated'](),controller[_0xb7ab('0x10')]);router['put'](_0xb7ab('0x11'),auth[_0xb7ab('0xa')](),controller[_0xb7ab('0x12')]);router['delete'](_0xb7ab('0x11'),auth[_0xb7ab('0xa')](),controller[_0xb7ab('0x13')]);module[_0xb7ab('0x14')]=router; \ No newline at end of file +var _0xb2b8=['isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get'];(function(_0x2db8d1,_0x4347c6){var _0x46a91e=function(_0x3c5fc8){while(--_0x3c5fc8){_0x2db8d1['push'](_0x2db8d1['shift']());}};_0x46a91e(++_0x4347c6);}(_0xb2b8,0x89));var _0x8b2b=function(_0x1e4dd9,_0x28f4b0){_0x1e4dd9=_0x1e4dd9-0x0;var _0x5c0cd1=_0xb2b8[_0x1e4dd9];return _0x5c0cd1;};'use strict';var multer=require('multer');var util=require(_0x8b2b('0x0'));var path=require(_0x8b2b('0x1'));var timeout=require(_0x8b2b('0x2'));var express=require('express');var router=express[_0x8b2b('0x3')]();var fs_extra=require(_0x8b2b('0x4'));var auth=require(_0x8b2b('0x5'));var interaction=require(_0x8b2b('0x6'));var config=require(_0x8b2b('0x7'));var controller=require(_0x8b2b('0x8'));router[_0x8b2b('0x9')]('/',auth[_0x8b2b('0xa')](),controller[_0x8b2b('0xb')]);router[_0x8b2b('0x9')](_0x8b2b('0xc'),auth[_0x8b2b('0xa')](),controller['describe']);router[_0x8b2b('0x9')](_0x8b2b('0xd'),auth['isAuthenticated'](),controller[_0x8b2b('0xe')]);router[_0x8b2b('0xf')]('/',auth[_0x8b2b('0xa')](),controller[_0x8b2b('0x10')]);router[_0x8b2b('0x11')](_0x8b2b('0xd'),auth['isAuthenticated'](),controller[_0x8b2b('0x12')]);router[_0x8b2b('0x13')](_0x8b2b('0xd'),auth[_0x8b2b('0xa')](),controller[_0x8b2b('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index ee10e89..7859241 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(_0x225ed0,_0x4588f0){var _0x251288=function(_0x43d869){while(--_0x43d869){_0x225ed0['push'](_0x225ed0['shift']());}};_0x251288(++_0x4588f0);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'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(_0xaf6e56,_0x47e68b){var _0x86a388=function(_0x18f33f){while(--_0x18f33f){_0xaf6e56['push'](_0xaf6e56['shift']());}};_0x86a388(++_0x47e68b);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 043e4ae..6215571 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 _0x2547=['order','where','pick','filter','merge','VIRTUAL','options','WhatsappQueueReport','includeAll','include','rows','catch','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2547,0x1cd));var _0x7254=function(_0x2a0a2c,_0x1f8ee5){_0x2a0a2c=_0x2a0a2c-0x0;var _0x4ba7c5=_0x2547[_0x2a0a2c];return _0x4ba7c5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7254('0x0'));var zipdir=require(_0x7254('0x1'));var jsonpatch=require(_0x7254('0x2'));var rp=require(_0x7254('0x3'));var moment=require(_0x7254('0x4'));var BPromise=require(_0x7254('0x5'));var Mustache=require(_0x7254('0x6'));var util=require(_0x7254('0x7'));var path=require('path');var sox=require(_0x7254('0x8'));var csv=require(_0x7254('0x9'));var ejs=require(_0x7254('0xa'));var fs=require('fs');var fs_extra=require(_0x7254('0xb'));var _=require('lodash');var squel=require(_0x7254('0xc'));var crypto=require(_0x7254('0xd'));var jsforce=require(_0x7254('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7254('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7254('0xf'));var qs=require(_0x7254('0x10'));var as=require(_0x7254('0x11'));var hardwareService=require(_0x7254('0x12'));var logger=require(_0x7254('0x13'))(_0x7254('0x14'));var utils=require('../../config/utils');var config=require(_0x7254('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x7254('0x16'))['db'];function respondWithStatusCode(_0x53fc4f,_0x16c08e){_0x16c08e=_0x16c08e||0xcc;return function(_0x2bfff8){if(_0x2bfff8){return _0x53fc4f[_0x7254('0x17')](_0x16c08e);}return _0x53fc4f[_0x7254('0x18')](_0x16c08e)[_0x7254('0x19')]();};}function respondWithResult(_0x395a8a,_0x124192){_0x124192=_0x124192||0xc8;return function(_0x21cecc){if(_0x21cecc){return _0x395a8a[_0x7254('0x18')](_0x124192)[_0x7254('0x1a')](_0x21cecc);}};}function respondWithFilteredResult(_0x38a99c,_0x1ee5cb){return function(_0x163c8c){if(_0x163c8c){var _0x535065=typeof _0x1ee5cb[_0x7254('0x1b')]===_0x7254('0x1c')&&typeof _0x1ee5cb[_0x7254('0x1d')]===_0x7254('0x1c');var _0x3b5f06=_0x163c8c[_0x7254('0x1e')];var _0x2737e0=_0x535065?0x0:_0x1ee5cb['offset'];var _0x1f48f6=_0x535065?_0x163c8c[_0x7254('0x1e')]:_0x1ee5cb[_0x7254('0x1b')]+_0x1ee5cb[_0x7254('0x1d')];var _0x2a1ddc;if(_0x1f48f6>=_0x3b5f06){_0x1f48f6=_0x3b5f06;_0x2a1ddc=0xc8;}else{_0x2a1ddc=0xce;}_0x38a99c[_0x7254('0x18')](_0x2a1ddc);return _0x38a99c[_0x7254('0x1f')](_0x7254('0x20'),_0x2737e0+'-'+_0x1f48f6+'/'+_0x3b5f06)[_0x7254('0x1a')](_0x163c8c);}return null;};}function patchUpdates(_0x3b6cb6){return function(_0x2594b8){try{jsonpatch[_0x7254('0x21')](_0x2594b8,_0x3b6cb6,!![]);}catch(_0xc617b6){return BPromise[_0x7254('0x22')](_0xc617b6);}return _0x2594b8[_0x7254('0x23')]();};}function saveUpdates(_0x95ceaa,_0x2bb2fe){return function(_0x46c0a2){if(_0x46c0a2){return _0x46c0a2[_0x7254('0x24')](_0x95ceaa)[_0x7254('0x25')](function(_0x1be69b){return _0x1be69b;});}return null;};}function removeEntity(_0x50c34b,_0x493bfd){return function(_0x136ea3){if(_0x136ea3){return _0x136ea3[_0x7254('0x26')]()[_0x7254('0x25')](function(){_0x50c34b[_0x7254('0x18')](0xcc)[_0x7254('0x19')]();});}};}function handleEntityNotFound(_0x36b5d5,_0x133aee){return function(_0x5d6df5){if(!_0x5d6df5){_0x36b5d5[_0x7254('0x17')](0x194);}return _0x5d6df5;};}function handleError(_0x21a579,_0x2b4f46){_0x2b4f46=_0x2b4f46||0x1f4;return function(_0x494cdb){logger[_0x7254('0x27')](_0x494cdb['stack']);if(_0x494cdb[_0x7254('0x28')]){delete _0x494cdb[_0x7254('0x28')];}_0x21a579['status'](_0x2b4f46)[_0x7254('0x29')](_0x494cdb);};}exports[_0x7254('0x2a')]=function(_0x4f684c,_0x14cbea){var _0x6c4927={},_0x37cb5c={},_0xb9198b={'count':0x0,'rows':[]};var _0x43bf02=_[_0x7254('0x2b')](db['WhatsappQueueReport'][_0x7254('0x2c')],function(_0x2dba3f){return{'name':_0x2dba3f['fieldName'],'type':_0x2dba3f[_0x7254('0x2d')][_0x7254('0x2e')]};});_0x37cb5c[_0x7254('0x2f')]=_['map'](_0x43bf02,_0x7254('0x28'));_0x37cb5c[_0x7254('0x30')]=_[_0x7254('0x31')](_0x4f684c[_0x7254('0x30')]);_0x37cb5c[_0x7254('0x32')]=_[_0x7254('0x33')](_0x37cb5c[_0x7254('0x2f')],_0x37cb5c['query']);_0x6c4927[_0x7254('0x34')]=_['intersection'](_0x37cb5c['model'],qs[_0x7254('0x35')](_0x4f684c[_0x7254('0x30')][_0x7254('0x35')]));_0x6c4927[_0x7254('0x34')]=_0x6c4927[_0x7254('0x34')][_0x7254('0x36')]?_0x6c4927[_0x7254('0x34')]:_0x37cb5c[_0x7254('0x2f')];if(!_0x4f684c[_0x7254('0x30')][_0x7254('0x37')](_0x7254('0x38'))){_0x6c4927[_0x7254('0x1d')]=qs[_0x7254('0x1d')](_0x4f684c[_0x7254('0x30')]['limit']);_0x6c4927[_0x7254('0x1b')]=qs[_0x7254('0x1b')](_0x4f684c[_0x7254('0x30')][_0x7254('0x1b')]);}_0x6c4927[_0x7254('0x39')]=qs['sort'](_0x4f684c[_0x7254('0x30')]['sort']);_0x6c4927[_0x7254('0x3a')]=qs[_0x7254('0x32')](_[_0x7254('0x3b')](_0x4f684c[_0x7254('0x30')],_0x37cb5c[_0x7254('0x32')]),_0x43bf02);if(_0x4f684c['query'][_0x7254('0x3c')]){_0x6c4927['where']=_[_0x7254('0x3d')](_0x6c4927[_0x7254('0x3a')],{'$or':_['map'](_0x43bf02,function(_0x1485a0){if(_0x1485a0[_0x7254('0x2d')]!==_0x7254('0x3e')){var _0x9273ee={};_0x9273ee[_0x1485a0[_0x7254('0x28')]]={'$like':'%'+_0x4f684c[_0x7254('0x30')]['filter']+'%'};return _0x9273ee;}})});}_0x6c4927=_[_0x7254('0x3d')]({},_0x6c4927,_0x4f684c[_0x7254('0x3f')]);var _0x105b8c={'where':_0x6c4927['where']};return db[_0x7254('0x40')][_0x7254('0x1e')](_0x105b8c)[_0x7254('0x25')](function(_0x4824d5){_0xb9198b[_0x7254('0x1e')]=_0x4824d5;if(_0x4f684c[_0x7254('0x30')][_0x7254('0x41')]){_0x6c4927[_0x7254('0x42')]=[{'all':!![]}];}return db[_0x7254('0x40')]['findAll'](_0x6c4927);})['then'](function(_0x25004f){_0xb9198b[_0x7254('0x43')]=_0x25004f;return _0xb9198b;})[_0x7254('0x25')](respondWithFilteredResult(_0x14cbea,_0x6c4927))[_0x7254('0x44')](handleError(_0x14cbea,null));};exports['show']=function(_0x53a7a7,_0x29821a){var _0x565cd8={'raw':!![],'where':{'id':_0x53a7a7[_0x7254('0x45')]['id']}},_0x2ae22e={};_0x2ae22e[_0x7254('0x2f')]=_[_0x7254('0x31')](db['WhatsappQueueReport']['rawAttributes']);_0x2ae22e[_0x7254('0x30')]=_[_0x7254('0x31')](_0x53a7a7[_0x7254('0x30')]);_0x2ae22e[_0x7254('0x32')]=_[_0x7254('0x33')](_0x2ae22e['model'],_0x2ae22e['query']);_0x565cd8[_0x7254('0x34')]=_[_0x7254('0x33')](_0x2ae22e[_0x7254('0x2f')],qs['fields'](_0x53a7a7[_0x7254('0x30')][_0x7254('0x35')]));_0x565cd8['attributes']=_0x565cd8[_0x7254('0x34')][_0x7254('0x36')]?_0x565cd8[_0x7254('0x34')]:_0x2ae22e[_0x7254('0x2f')];if(_0x53a7a7['query'][_0x7254('0x41')]){_0x565cd8[_0x7254('0x42')]=[{'all':!![]}];}_0x565cd8=_['merge']({},_0x565cd8,_0x53a7a7[_0x7254('0x3f')]);return db[_0x7254('0x40')][_0x7254('0x46')](_0x565cd8)['then'](handleEntityNotFound(_0x29821a,null))[_0x7254('0x25')](respondWithResult(_0x29821a,null))[_0x7254('0x44')](handleError(_0x29821a,null));};exports['create']=function(_0x5f101e,_0x10b32f){return db['WhatsappQueueReport'][_0x7254('0x47')](_0x5f101e[_0x7254('0x48')],{})['then'](respondWithResult(_0x10b32f,0xc9))['catch'](handleError(_0x10b32f,null));};exports[_0x7254('0x24')]=function(_0xc40bc5,_0x38bcd5){if(_0xc40bc5[_0x7254('0x48')]['id']){delete _0xc40bc5[_0x7254('0x48')]['id'];}return db[_0x7254('0x40')]['find']({'where':{'id':_0xc40bc5[_0x7254('0x45')]['id']}})['then'](handleEntityNotFound(_0x38bcd5,null))[_0x7254('0x25')](saveUpdates(_0xc40bc5[_0x7254('0x48')],null))[_0x7254('0x25')](respondWithResult(_0x38bcd5,null))['catch'](handleError(_0x38bcd5,null));};exports[_0x7254('0x26')]=function(_0x1c1a0e,_0x252758){return db['WhatsappQueueReport'][_0x7254('0x46')]({'where':{'id':_0x1c1a0e[_0x7254('0x45')]['id']}})[_0x7254('0x25')](handleEntityNotFound(_0x252758,null))[_0x7254('0x25')](removeEntity(_0x252758,null))[_0x7254('0x44')](handleError(_0x252758,null));};exports['describe']=function(_0x5e66c6,_0x24c532){return db[_0x7254('0x40')][_0x7254('0x49')]()[_0x7254('0x25')](respondWithResult(_0x24c532,null))[_0x7254('0x44')](handleError(_0x24c532,null));}; \ No newline at end of file +var _0x7334=['create','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','name','send','map','WhatsappQueueReport','type','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','length','include','find'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7334,0x184));var _0x4733=function(_0x352ead,_0x48f4b8){_0x352ead=_0x352ead-0x0;var _0x4f063c=_0x7334[_0x352ead];return _0x4f063c;};'use strict';var emlformat=require(_0x4733('0x0'));var rimraf=require(_0x4733('0x1'));var zipdir=require(_0x4733('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4733('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4733('0x4'));var util=require(_0x4733('0x5'));var path=require(_0x4733('0x6'));var sox=require(_0x4733('0x7'));var csv=require(_0x4733('0x8'));var ejs=require(_0x4733('0x9'));var fs=require('fs');var fs_extra=require(_0x4733('0xa'));var _=require(_0x4733('0xb'));var squel=require(_0x4733('0xc'));var crypto=require(_0x4733('0xd'));var jsforce=require(_0x4733('0xe'));var deskjs=require(_0x4733('0xf'));var toCsv=require(_0x4733('0x8'));var querystring=require(_0x4733('0x10'));var Papa=require(_0x4733('0x11'));var Redis=require(_0x4733('0x12'));var authService=require(_0x4733('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x4733('0x14'));var hardwareService=require(_0x4733('0x15'));var logger=require('../../config/logger')(_0x4733('0x16'));var utils=require('../../config/utils');var config=require(_0x4733('0x17'));var licenseUtil=require(_0x4733('0x18'));var db=require(_0x4733('0x19'))['db'];function respondWithStatusCode(_0x461f74,_0x100ecd){_0x100ecd=_0x100ecd||0xcc;return function(_0x1c146c){if(_0x1c146c){return _0x461f74[_0x4733('0x1a')](_0x100ecd);}return _0x461f74['status'](_0x100ecd)[_0x4733('0x1b')]();};}function respondWithResult(_0x543caf,_0x4327f3){_0x4327f3=_0x4327f3||0xc8;return function(_0x1a22e4){if(_0x1a22e4){return _0x543caf[_0x4733('0x1c')](_0x4327f3)[_0x4733('0x1d')](_0x1a22e4);}};}function respondWithFilteredResult(_0x3813df,_0x167016){return function(_0x12f111){if(_0x12f111){var _0x9fff=typeof _0x167016[_0x4733('0x1e')]==='undefined'&&typeof _0x167016[_0x4733('0x1f')]===_0x4733('0x20');var _0x47b129=_0x12f111[_0x4733('0x21')];var _0x1d2fb6=_0x9fff?0x0:_0x167016[_0x4733('0x1e')];var _0x384e0c=_0x9fff?_0x12f111['count']:_0x167016['offset']+_0x167016[_0x4733('0x1f')];var _0x3b730a;if(_0x384e0c>=_0x47b129){_0x384e0c=_0x47b129;_0x3b730a=0xc8;}else{_0x3b730a=0xce;}_0x3813df['status'](_0x3b730a);return _0x3813df[_0x4733('0x22')](_0x4733('0x23'),_0x1d2fb6+'-'+_0x384e0c+'/'+_0x47b129)[_0x4733('0x1d')](_0x12f111);}return null;};}function patchUpdates(_0x7a4e0){return function(_0x493cd3){try{jsonpatch[_0x4733('0x24')](_0x493cd3,_0x7a4e0,!![]);}catch(_0xb45e1){return BPromise['reject'](_0xb45e1);}return _0x493cd3[_0x4733('0x25')]();};}function saveUpdates(_0x18da47,_0x478e34){return function(_0x15a291){if(_0x15a291){return _0x15a291[_0x4733('0x26')](_0x18da47)[_0x4733('0x27')](function(_0x1a0643){return _0x1a0643;});}return null;};}function removeEntity(_0x3a2542,_0x24db74){return function(_0x180049){if(_0x180049){return _0x180049[_0x4733('0x28')]()['then'](function(){_0x3a2542[_0x4733('0x1c')](0xcc)[_0x4733('0x1b')]();});}};}function handleEntityNotFound(_0x7884e5,_0x2cb247){return function(_0x30ee9b){if(!_0x30ee9b){_0x7884e5[_0x4733('0x1a')](0x194);}return _0x30ee9b;};}function handleError(_0x24fc0d,_0xc3ab0a){_0xc3ab0a=_0xc3ab0a||0x1f4;return function(_0x13bc12){logger[_0x4733('0x29')](_0x13bc12['stack']);if(_0x13bc12[_0x4733('0x2a')]){delete _0x13bc12['name'];}_0x24fc0d['status'](_0xc3ab0a)[_0x4733('0x2b')](_0x13bc12);};}exports['index']=function(_0xcde4f4,_0x479989){var _0x4abc0d={},_0x517c73={},_0x2976b0={'count':0x0,'rows':[]};var _0x3bfe53=_[_0x4733('0x2c')](db[_0x4733('0x2d')]['rawAttributes'],function(_0x538a7c){return{'name':_0x538a7c['fieldName'],'type':_0x538a7c[_0x4733('0x2e')]['key']};});_0x517c73['model']=_[_0x4733('0x2c')](_0x3bfe53,_0x4733('0x2a'));_0x517c73[_0x4733('0x2f')]=_['keys'](_0xcde4f4['query']);_0x517c73[_0x4733('0x30')]=_[_0x4733('0x31')](_0x517c73[_0x4733('0x32')],_0x517c73[_0x4733('0x2f')]);_0x4abc0d[_0x4733('0x33')]=_['intersection'](_0x517c73[_0x4733('0x32')],qs[_0x4733('0x34')](_0xcde4f4[_0x4733('0x2f')][_0x4733('0x34')]));_0x4abc0d[_0x4733('0x33')]=_0x4abc0d['attributes']['length']?_0x4abc0d[_0x4733('0x33')]:_0x517c73[_0x4733('0x32')];if(!_0xcde4f4[_0x4733('0x2f')][_0x4733('0x35')](_0x4733('0x36'))){_0x4abc0d['limit']=qs[_0x4733('0x1f')](_0xcde4f4[_0x4733('0x2f')][_0x4733('0x1f')]);_0x4abc0d['offset']=qs[_0x4733('0x1e')](_0xcde4f4[_0x4733('0x2f')][_0x4733('0x1e')]);}_0x4abc0d[_0x4733('0x37')]=qs[_0x4733('0x38')](_0xcde4f4[_0x4733('0x2f')][_0x4733('0x38')]);_0x4abc0d[_0x4733('0x39')]=qs['filters'](_[_0x4733('0x3a')](_0xcde4f4['query'],_0x517c73[_0x4733('0x30')]),_0x3bfe53);if(_0xcde4f4[_0x4733('0x2f')][_0x4733('0x3b')]){_0x4abc0d[_0x4733('0x39')]=_[_0x4733('0x3c')](_0x4abc0d[_0x4733('0x39')],{'$or':_[_0x4733('0x2c')](_0x3bfe53,function(_0x15ab49){if(_0x15ab49['type']!==_0x4733('0x3d')){var _0x68d682={};_0x68d682[_0x15ab49['name']]={'$like':'%'+_0xcde4f4[_0x4733('0x2f')][_0x4733('0x3b')]+'%'};return _0x68d682;}})});}_0x4abc0d=_['merge']({},_0x4abc0d,_0xcde4f4[_0x4733('0x3e')]);var _0x50849a={'where':_0x4abc0d[_0x4733('0x39')]};return db['WhatsappQueueReport'][_0x4733('0x21')](_0x50849a)[_0x4733('0x27')](function(_0x5d4b95){_0x2976b0['count']=_0x5d4b95;if(_0xcde4f4[_0x4733('0x2f')][_0x4733('0x3f')]){_0x4abc0d['include']=[{'all':!![]}];}return db[_0x4733('0x2d')][_0x4733('0x40')](_0x4abc0d);})[_0x4733('0x27')](function(_0x28ed14){_0x2976b0[_0x4733('0x41')]=_0x28ed14;return _0x2976b0;})[_0x4733('0x27')](respondWithFilteredResult(_0x479989,_0x4abc0d))[_0x4733('0x42')](handleError(_0x479989,null));};exports[_0x4733('0x43')]=function(_0x1f04dd,_0x42e055){var _0x444471={'raw':!![],'where':{'id':_0x1f04dd[_0x4733('0x44')]['id']}},_0x1d32df={};_0x1d32df[_0x4733('0x32')]=_[_0x4733('0x45')](db[_0x4733('0x2d')][_0x4733('0x46')]);_0x1d32df[_0x4733('0x2f')]=_['keys'](_0x1f04dd[_0x4733('0x2f')]);_0x1d32df[_0x4733('0x30')]=_[_0x4733('0x31')](_0x1d32df[_0x4733('0x32')],_0x1d32df[_0x4733('0x2f')]);_0x444471[_0x4733('0x33')]=_[_0x4733('0x31')](_0x1d32df[_0x4733('0x32')],qs[_0x4733('0x34')](_0x1f04dd[_0x4733('0x2f')][_0x4733('0x34')]));_0x444471[_0x4733('0x33')]=_0x444471[_0x4733('0x33')][_0x4733('0x47')]?_0x444471['attributes']:_0x1d32df['model'];if(_0x1f04dd[_0x4733('0x2f')][_0x4733('0x3f')]){_0x444471[_0x4733('0x48')]=[{'all':!![]}];}_0x444471=_[_0x4733('0x3c')]({},_0x444471,_0x1f04dd[_0x4733('0x3e')]);return db[_0x4733('0x2d')][_0x4733('0x49')](_0x444471)[_0x4733('0x27')](handleEntityNotFound(_0x42e055,null))[_0x4733('0x27')](respondWithResult(_0x42e055,null))[_0x4733('0x42')](handleError(_0x42e055,null));};exports['create']=function(_0x4c5f4e,_0x51e201){return db['WhatsappQueueReport'][_0x4733('0x4a')](_0x4c5f4e[_0x4733('0x4b')],{})[_0x4733('0x27')](respondWithResult(_0x51e201,0xc9))[_0x4733('0x42')](handleError(_0x51e201,null));};exports[_0x4733('0x26')]=function(_0x45b9cf,_0x1c6abf){if(_0x45b9cf[_0x4733('0x4b')]['id']){delete _0x45b9cf[_0x4733('0x4b')]['id'];}return db[_0x4733('0x2d')]['find']({'where':{'id':_0x45b9cf['params']['id']}})[_0x4733('0x27')](handleEntityNotFound(_0x1c6abf,null))['then'](saveUpdates(_0x45b9cf[_0x4733('0x4b')],null))[_0x4733('0x27')](respondWithResult(_0x1c6abf,null))[_0x4733('0x42')](handleError(_0x1c6abf,null));};exports['destroy']=function(_0x3f2a78,_0x45c9ad){return db[_0x4733('0x2d')][_0x4733('0x49')]({'where':{'id':_0x3f2a78[_0x4733('0x44')]['id']}})[_0x4733('0x27')](handleEntityNotFound(_0x45c9ad,null))[_0x4733('0x27')](removeEntity(_0x45c9ad,null))[_0x4733('0x42')](handleError(_0x45c9ad,null));};exports[_0x4733('0x4c')]=function(_0x5af8c7,_0x31fb69){return db[_0x4733('0x2d')][_0x4733('0x4c')]()['then'](respondWithResult(_0x31fb69,null))[_0x4733('0x42')](handleError(_0x31fb69,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 4ff3cf1..20cc54d 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 _0x3a2b=['moment','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x3a2b,0x1d8));var _0xb3a2=function(_0x3975af,_0x2feca3){_0x3975af=_0x3975af-0x0;var _0x37b36f=_0x3a2b[_0x3975af];return _0x37b36f;};'use strict';var _=require(_0xb3a2('0x0'));var util=require(_0xb3a2('0x1'));var logger=require(_0xb3a2('0x2'))(_0xb3a2('0x3'));var moment=require(_0xb3a2('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb3a2('0x5'));var rimraf=require(_0xb3a2('0x6'));var config=require(_0xb3a2('0x7'));var attributes=require(_0xb3a2('0x8'));module[_0xb3a2('0x9')]=function(_0x1324db,_0x4dbe65){return _0x1324db[_0xb3a2('0xa')](_0xb3a2('0xb'),attributes,{'tableName':_0xb3a2('0xc'),'paranoid':![],'indexes':[{'name':_0xb3a2('0xd'),'fields':[_0xb3a2('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdd30=['exports','uniqueid','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x250977,_0x5bdbba){var _0x1f9304=function(_0x3a3b17){while(--_0x3a3b17){_0x250977['push'](_0x250977['shift']());}};_0x1f9304(++_0x5bdbba);}(_0xdd30,0x102));var _0x0dd3=function(_0xc66583,_0x404ee3){_0xc66583=_0xc66583-0x0;var _0x580314=_0xdd30[_0xc66583];return _0x580314;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x0dd3('0x0'));var moment=require(_0x0dd3('0x1'));var BPromise=require(_0x0dd3('0x2'));var rp=require(_0x0dd3('0x3'));var fs=require('fs');var path=require(_0x0dd3('0x4'));var rimraf=require(_0x0dd3('0x5'));var config=require('../../config/environment');var attributes=require('./whatsappQueueReport.attributes');module[_0x0dd3('0x6')]=function(_0x16898a,_0x33ab1e){return _0x16898a['define']('WhatsappQueueReport',attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0x0dd3('0x7'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 32b2234..b563f1f 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 _0x1451=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','http','then','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','create','body','options','info','CreateWhatsappQueueReport','catch','UpdateWhatsappQueueReport','WhatsappQueueReport','update','raw','attributes','lodash','util','bluebird'];(function(_0x28f32c,_0x4cc342){var _0x355402=function(_0xdb5032){while(--_0xdb5032){_0x28f32c['push'](_0x28f32c['shift']());}};_0x355402(++_0x4cc342);}(_0x1451,0x193));var _0x1145=function(_0x155719,_0x123b9d){_0x155719=_0x155719-0x0;var _0x41e840=_0x1451[_0x155719];return _0x41e840;};'use strict';var _=require(_0x1145('0x0'));var util=require(_0x1145('0x1'));var moment=require('moment');var BPromise=require(_0x1145('0x2'));var rs=require(_0x1145('0x3'));var fs=require('fs');var Redis=require(_0x1145('0x4'));var db=require(_0x1145('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1145('0x6'))(_0x1145('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x1145('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x506a5e,_0x130155,_0x4a14b7){return new BPromise(function(_0x140006,_0x1793d3){return client['request'](_0x506a5e,_0x4a14b7)[_0x1145('0x9')](function(_0x341fa9){logger['info'](_0x1145('0xa'),_0x130155,_0x1145('0xb'));logger[_0x1145('0xc')](_0x1145('0xd'),_0x130155,_0x1145('0xb'),JSON[_0x1145('0xe')](_0x341fa9));if(_0x341fa9[_0x1145('0xf')]){if(_0x341fa9[_0x1145('0xf')][_0x1145('0x10')]===0x1f4){logger[_0x1145('0xf')](_0x1145('0xa'),_0x130155,_0x341fa9['error'][_0x1145('0x11')]);return _0x1793d3(_0x341fa9[_0x1145('0xf')][_0x1145('0x11')]);}logger[_0x1145('0xf')](_0x1145('0xa'),_0x130155,_0x341fa9[_0x1145('0xf')][_0x1145('0x11')]);return _0x140006(_0x341fa9[_0x1145('0xf')]['message']);}else{logger['info'](_0x1145('0xa'),_0x130155,'request\x20sent');_0x140006(_0x341fa9['result']['message']);}})['catch'](function(_0x209c1f){logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x130155,_0x209c1f);_0x1793d3(_0x209c1f);});});}exports['CreateWhatsappQueueReport']=function(_0xcd4e72){var _0x4b30ad=this;return new Promise(function(_0x31c9ed,_0x18a056){return db['WhatsappQueueReport'][_0x1145('0x12')](_0xcd4e72[_0x1145('0x13')],{'raw':_0xcd4e72[_0x1145('0x14')]?_0xcd4e72[_0x1145('0x14')]['raw']===undefined?!![]:![]:!![]})[_0x1145('0x9')](function(_0x1ce483){logger[_0x1145('0x15')]('CreateWhatsappQueueReport',_0xcd4e72);logger[_0x1145('0xc')](_0x1145('0x16'),_0xcd4e72,JSON['stringify'](_0x1ce483));_0x31c9ed(_0x1ce483);})[_0x1145('0x17')](function(_0x3cb29e){logger[_0x1145('0xf')](_0x1145('0x16'),_0x3cb29e[_0x1145('0x11')],_0xcd4e72);_0x18a056(_0x4b30ad[_0x1145('0xf')](0x1f4,_0x3cb29e['message']));});});};exports[_0x1145('0x18')]=function(_0x39ebb2){var _0x3c23f8=this;return new Promise(function(_0x5e3081,_0x1e3b81){return db[_0x1145('0x19')][_0x1145('0x1a')](_0x39ebb2[_0x1145('0x13')],{'raw':_0x39ebb2[_0x1145('0x14')]?_0x39ebb2[_0x1145('0x14')][_0x1145('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x39ebb2['options']?_0x39ebb2[_0x1145('0x14')]['where']||null:null,'attributes':_0x39ebb2['options']?_0x39ebb2['options'][_0x1145('0x1c')]||null:null,'limit':_0x39ebb2[_0x1145('0x14')]?_0x39ebb2['options']['limit']||null:null})[_0x1145('0x9')](function(_0x372b88){logger[_0x1145('0x15')](_0x1145('0x18'),_0x39ebb2);logger[_0x1145('0xc')](_0x1145('0x18'),_0x39ebb2,JSON[_0x1145('0xe')](_0x372b88));_0x5e3081(_0x372b88);})[_0x1145('0x17')](function(_0x1179e8){logger['error']('UpdateWhatsappQueueReport',_0x1179e8[_0x1145('0x11')],_0x39ebb2);_0x1e3b81(_0x3c23f8[_0x1145('0xf')](0x1f4,_0x1179e8[_0x1145('0x11')]));});});}; \ No newline at end of file +var _0xce97=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','UpdateWhatsappQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x5c1e19,_0x45a4db){var _0xbdc160=function(_0x41f7fc){while(--_0x41f7fc){_0x5c1e19['push'](_0x5c1e19['shift']());}};_0xbdc160(++_0x45a4db);}(_0xce97,0x8e));var _0x7ce9=function(_0x31e3ce,_0x1329da){_0x31e3ce=_0x31e3ce-0x0;var _0xa92a9d=_0xce97[_0x31e3ce];return _0xa92a9d;};'use strict';var _=require(_0x7ce9('0x0'));var util=require(_0x7ce9('0x1'));var moment=require(_0x7ce9('0x2'));var BPromise=require(_0x7ce9('0x3'));var rs=require(_0x7ce9('0x4'));var fs=require('fs');var Redis=require(_0x7ce9('0x5'));var db=require(_0x7ce9('0x6'))['db'];var utils=require(_0x7ce9('0x7'));var logger=require(_0x7ce9('0x8'))(_0x7ce9('0x9'));var config=require(_0x7ce9('0xa'));var jayson=require(_0x7ce9('0xb'));var client=jayson['client'][_0x7ce9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x446ed8,_0xddde6a,_0x1a388e){return new BPromise(function(_0x212fc5,_0x3b3234){return client[_0x7ce9('0xd')](_0x446ed8,_0x1a388e)[_0x7ce9('0xe')](function(_0x5b6b78){logger[_0x7ce9('0xf')](_0x7ce9('0x10'),_0xddde6a,'request\x20sent');logger[_0x7ce9('0x11')](_0x7ce9('0x12'),_0xddde6a,_0x7ce9('0x13'),JSON[_0x7ce9('0x14')](_0x5b6b78));if(_0x5b6b78['error']){if(_0x5b6b78[_0x7ce9('0x15')][_0x7ce9('0x16')]===0x1f4){logger[_0x7ce9('0x15')](_0x7ce9('0x10'),_0xddde6a,_0x5b6b78['error'][_0x7ce9('0x17')]);return _0x3b3234(_0x5b6b78[_0x7ce9('0x15')]['message']);}logger[_0x7ce9('0x15')](_0x7ce9('0x10'),_0xddde6a,_0x5b6b78[_0x7ce9('0x15')][_0x7ce9('0x17')]);return _0x212fc5(_0x5b6b78[_0x7ce9('0x15')][_0x7ce9('0x17')]);}else{logger[_0x7ce9('0xf')]('WhatsappQueueReport,\x20%s,\x20%s',_0xddde6a,_0x7ce9('0x13'));_0x212fc5(_0x5b6b78[_0x7ce9('0x18')][_0x7ce9('0x17')]);}})[_0x7ce9('0x19')](function(_0x529065){logger[_0x7ce9('0x15')]('WhatsappQueueReport,\x20%s,\x20%s',_0xddde6a,_0x529065);_0x3b3234(_0x529065);});});}exports[_0x7ce9('0x1a')]=function(_0x1eae67){var _0x513c0b=this;return new Promise(function(_0x2def53,_0x457f81){return db[_0x7ce9('0x1b')][_0x7ce9('0x1c')](_0x1eae67[_0x7ce9('0x1d')],{'raw':_0x1eae67[_0x7ce9('0x1e')]?_0x1eae67['options'][_0x7ce9('0x1f')]===undefined?!![]:![]:!![]})[_0x7ce9('0xe')](function(_0x570618){logger[_0x7ce9('0xf')](_0x7ce9('0x1a'),_0x1eae67);logger[_0x7ce9('0x11')]('CreateWhatsappQueueReport',_0x1eae67,JSON['stringify'](_0x570618));_0x2def53(_0x570618);})[_0x7ce9('0x19')](function(_0x58cf33){logger[_0x7ce9('0x15')](_0x7ce9('0x1a'),_0x58cf33[_0x7ce9('0x17')],_0x1eae67);_0x457f81(_0x513c0b[_0x7ce9('0x15')](0x1f4,_0x58cf33['message']));});});};exports[_0x7ce9('0x20')]=function(_0x19391f){var _0x11f033=this;return new Promise(function(_0x1352b1,_0x5c7077){return db[_0x7ce9('0x1b')][_0x7ce9('0x21')](_0x19391f[_0x7ce9('0x1d')],{'raw':_0x19391f[_0x7ce9('0x1e')]?_0x19391f[_0x7ce9('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19391f['options']?_0x19391f[_0x7ce9('0x1e')][_0x7ce9('0x22')]||null:null,'attributes':_0x19391f[_0x7ce9('0x1e')]?_0x19391f['options'][_0x7ce9('0x23')]||null:null,'limit':_0x19391f[_0x7ce9('0x1e')]?_0x19391f[_0x7ce9('0x1e')][_0x7ce9('0x24')]||null:null})[_0x7ce9('0xe')](function(_0xd5d625){logger[_0x7ce9('0xf')](_0x7ce9('0x20'),_0x19391f);logger[_0x7ce9('0x11')]('UpdateWhatsappQueueReport',_0x19391f,JSON[_0x7ce9('0x14')](_0xd5d625));_0x1352b1(_0xd5d625);})[_0x7ce9('0x19')](function(_0x3c3451){logger[_0x7ce9('0x15')]('UpdateWhatsappQueueReport',_0x3c3451['message'],_0x19391f);_0x5c7077(_0x11f033[_0x7ce9('0x15')](0x1f4,_0x3c3451[_0x7ce9('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 15515fe..4c17c86 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 _0x51de=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','destroy','connect-timeout'];(function(_0x2ac07d,_0x45eee2){var _0x367b0c=function(_0x2995b6){while(--_0x2995b6){_0x2ac07d['push'](_0x2ac07d['shift']());}};_0x367b0c(++_0x45eee2);}(_0x51de,0x143));var _0xe51d=function(_0x2ebbca,_0x3e0847){_0x2ebbca=_0x2ebbca-0x0;var _0x36edf2=_0x51de[_0x2ebbca];return _0x36edf2;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xe51d('0x0'));var express=require('express');var router=express[_0xe51d('0x1')]();var fs_extra=require(_0xe51d('0x2'));var auth=require(_0xe51d('0x3'));var interaction=require(_0xe51d('0x4'));var config=require(_0xe51d('0x5'));var controller=require('./whatsappTransferReport.controller');router[_0xe51d('0x6')]('/',auth[_0xe51d('0x7')](),controller[_0xe51d('0x8')]);router['get'](_0xe51d('0x9'),auth[_0xe51d('0x7')](),controller[_0xe51d('0xa')]);router['get'](_0xe51d('0xb'),auth['isAuthenticated'](),controller[_0xe51d('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe51d('0xd')]);router[_0xe51d('0xe')](_0xe51d('0xb'),auth['isAuthenticated'](),controller[_0xe51d('0xf')]);router[_0xe51d('0x10')](_0xe51d('0xb'),auth['isAuthenticated'](),controller[_0xe51d('0x11')]);module['exports']=router; \ No newline at end of file +var _0x3760=['/:id','update','delete','destroy','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','describe','post','create','put'];(function(_0x4f7449,_0x407356){var _0x21e3cb=function(_0x40f623){while(--_0x40f623){_0x4f7449['push'](_0x4f7449['shift']());}};_0x21e3cb(++_0x407356);}(_0x3760,0x194));var _0x0376=function(_0xdeefbd,_0x9e1b3d){_0xdeefbd=_0xdeefbd-0x0;var _0x4ff63f=_0x3760[_0xdeefbd];return _0x4ff63f;};'use strict';var multer=require(_0x0376('0x0'));var util=require('util');var path=require(_0x0376('0x1'));var timeout=require(_0x0376('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0376('0x3'));var interaction=require(_0x0376('0x4'));var config=require('../../config/environment');var controller=require(_0x0376('0x5'));router[_0x0376('0x6')]('/',auth[_0x0376('0x7')](),controller[_0x0376('0x8')]);router[_0x0376('0x6')](_0x0376('0x9'),auth[_0x0376('0x7')](),controller[_0x0376('0xa')]);router[_0x0376('0x6')]('/:id',auth[_0x0376('0x7')](),controller['show']);router[_0x0376('0xb')]('/',auth[_0x0376('0x7')](),controller[_0x0376('0xc')]);router[_0x0376('0xd')](_0x0376('0xe'),auth[_0x0376('0x7')](),controller[_0x0376('0xf')]);router[_0x0376('0x10')]('/:id',auth[_0x0376('0x7')](),controller[_0x0376('0x11')]);module[_0x0376('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 55e3935..6e32766 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 _0x0abf=['sequelize','STRING','ENUM','queue'];(function(_0x4e3923,_0x460856){var _0x274c25=function(_0x24466c){while(--_0x24466c){_0x4e3923['push'](_0x4e3923['shift']());}};_0x274c25(++_0x460856);}(_0x0abf,0xe8));var _0xf0ab=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0abf[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xf0ab('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xf0ab('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xf0ab('0x2')]('account','agent',_0xf0ab('0x3')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x1e7b=['DATE','sequelize','exports','ENUM','account','queue'];(function(_0x3216b7,_0x424861){var _0x3beb31=function(_0x112750){while(--_0x112750){_0x3216b7['push'](_0x3216b7['shift']());}};_0x3beb31(++_0x424861);}(_0x1e7b,0x12d));var _0xb1e7=function(_0x2c507b,_0x343d21){_0x2c507b=_0x2c507b-0x0;var _0x346f0d=_0x1e7b[_0x2c507b];return _0x346f0d;};'use strict';var Sequelize=require(_0xb1e7('0x0'));module[_0xb1e7('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb1e7('0x2')](_0xb1e7('0x3'),'agent',_0xb1e7('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xb1e7('0x5')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 599c52a..33212dc 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 _0x95b5=['../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','sendStatus','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','WhatsappTransferReport','includeAll','include','catch','show','params','keys','intersection','update','body','find','describe','eml-format','zip-dir','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x55dd7b,_0x4865f8){var _0x12664f=function(_0x12fdb4){while(--_0x12fdb4){_0x55dd7b['push'](_0x55dd7b['shift']());}};_0x12664f(++_0x4865f8);}(_0x95b5,0x143));var _0x595b=function(_0xafdf47,_0x38b5b3){_0xafdf47=_0xafdf47-0x0;var _0x1e6c17=_0x95b5[_0xafdf47];return _0x1e6c17;};'use strict';var emlformat=require(_0x595b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x595b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x595b('0x2'));var sox=require(_0x595b('0x3'));var csv=require(_0x595b('0x4'));var ejs=require(_0x595b('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x595b('0x6'));var jsforce=require(_0x595b('0x7'));var deskjs=require(_0x595b('0x8'));var toCsv=require(_0x595b('0x4'));var querystring=require(_0x595b('0x9'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x595b('0xa'));var qs=require(_0x595b('0xb'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x595b('0xc'));var logger=require(_0x595b('0xd'))(_0x595b('0xe'));var utils=require('../../config/utils');var config=require(_0x595b('0xf'));var licenseUtil=require(_0x595b('0x10'));var db=require(_0x595b('0x11'))['db'];function respondWithStatusCode(_0x7df826,_0x3c845c){_0x3c845c=_0x3c845c||0xcc;return function(_0x28f05a){if(_0x28f05a){return _0x7df826['sendStatus'](_0x3c845c);}return _0x7df826[_0x595b('0x12')](_0x3c845c)['end']();};}function respondWithResult(_0x576e58,_0x1c2f8b){_0x1c2f8b=_0x1c2f8b||0xc8;return function(_0x26a88a){if(_0x26a88a){return _0x576e58[_0x595b('0x12')](_0x1c2f8b)[_0x595b('0x13')](_0x26a88a);}};}function respondWithFilteredResult(_0x48429d,_0x1ab11e){return function(_0x385f64){if(_0x385f64){var _0x549fbf=typeof _0x1ab11e[_0x595b('0x14')]===_0x595b('0x15')&&typeof _0x1ab11e[_0x595b('0x16')]==='undefined';var _0x3bacd7=_0x385f64[_0x595b('0x17')];var _0x6a4d52=_0x549fbf?0x0:_0x1ab11e[_0x595b('0x14')];var _0x32aaf0=_0x549fbf?_0x385f64[_0x595b('0x17')]:_0x1ab11e[_0x595b('0x14')]+_0x1ab11e[_0x595b('0x16')];var _0x2fb087;if(_0x32aaf0>=_0x3bacd7){_0x32aaf0=_0x3bacd7;_0x2fb087=0xc8;}else{_0x2fb087=0xce;}_0x48429d[_0x595b('0x12')](_0x2fb087);return _0x48429d[_0x595b('0x18')](_0x595b('0x19'),_0x6a4d52+'-'+_0x32aaf0+'/'+_0x3bacd7)[_0x595b('0x13')](_0x385f64);}return null;};}function patchUpdates(_0x50ec9e){return function(_0xbf59e3){try{jsonpatch[_0x595b('0x1a')](_0xbf59e3,_0x50ec9e,!![]);}catch(_0x31245b){return BPromise[_0x595b('0x1b')](_0x31245b);}return _0xbf59e3[_0x595b('0x1c')]();};}function saveUpdates(_0x4cd310,_0x2eaed6){return function(_0x378444){if(_0x378444){return _0x378444['update'](_0x4cd310)['then'](function(_0x1413c0){return _0x1413c0;});}return null;};}function removeEntity(_0x385df3,_0x3218b1){return function(_0x3cfaa5){if(_0x3cfaa5){return _0x3cfaa5[_0x595b('0x1d')]()[_0x595b('0x1e')](function(){_0x385df3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x30856e,_0x2ac807){return function(_0x4c3444){if(!_0x4c3444){_0x30856e[_0x595b('0x1f')](0x194);}return _0x4c3444;};}function handleError(_0x4cb3f5,_0x30ed66){_0x30ed66=_0x30ed66||0x1f4;return function(_0x34babd){logger['error'](_0x34babd[_0x595b('0x20')]);if(_0x34babd[_0x595b('0x21')]){delete _0x34babd[_0x595b('0x21')];}_0x4cb3f5[_0x595b('0x12')](_0x30ed66)['send'](_0x34babd);};}exports[_0x595b('0x22')]=function(_0x1cd13c,_0x4820ca){var _0x2739ad={},_0x1f2e34={},_0x120696={'count':0x0,'rows':[]};var _0x5df2ae=_[_0x595b('0x23')](db['WhatsappTransferReport'][_0x595b('0x24')],function(_0x92622f){return{'name':_0x92622f[_0x595b('0x25')],'type':_0x92622f[_0x595b('0x26')][_0x595b('0x27')]};});_0x1f2e34['model']=_[_0x595b('0x23')](_0x5df2ae,'name');_0x1f2e34['query']=_['keys'](_0x1cd13c['query']);_0x1f2e34['filters']=_['intersection'](_0x1f2e34[_0x595b('0x28')],_0x1f2e34[_0x595b('0x29')]);_0x2739ad['attributes']=_['intersection'](_0x1f2e34[_0x595b('0x28')],qs[_0x595b('0x2a')](_0x1cd13c[_0x595b('0x29')][_0x595b('0x2a')]));_0x2739ad[_0x595b('0x2b')]=_0x2739ad[_0x595b('0x2b')][_0x595b('0x2c')]?_0x2739ad[_0x595b('0x2b')]:_0x1f2e34[_0x595b('0x28')];if(!_0x1cd13c[_0x595b('0x29')][_0x595b('0x2d')]('nolimit')){_0x2739ad['limit']=qs[_0x595b('0x16')](_0x1cd13c['query'][_0x595b('0x16')]);_0x2739ad[_0x595b('0x14')]=qs[_0x595b('0x14')](_0x1cd13c[_0x595b('0x29')][_0x595b('0x14')]);}_0x2739ad[_0x595b('0x2e')]=qs[_0x595b('0x2f')](_0x1cd13c[_0x595b('0x29')][_0x595b('0x2f')]);_0x2739ad[_0x595b('0x30')]=qs[_0x595b('0x31')](_[_0x595b('0x32')](_0x1cd13c['query'],_0x1f2e34['filters']),_0x5df2ae);if(_0x1cd13c['query'][_0x595b('0x33')]){_0x2739ad['where']=_[_0x595b('0x34')](_0x2739ad[_0x595b('0x30')],{'$or':_[_0x595b('0x23')](_0x5df2ae,function(_0x2bfbe8){if(_0x2bfbe8[_0x595b('0x26')]!==_0x595b('0x35')){var _0x51be1b={};_0x51be1b[_0x2bfbe8[_0x595b('0x21')]]={'$like':'%'+_0x1cd13c[_0x595b('0x29')][_0x595b('0x33')]+'%'};return _0x51be1b;}})});}_0x2739ad=_['merge']({},_0x2739ad,_0x1cd13c[_0x595b('0x36')]);var _0x3cbcd2={'where':_0x2739ad['where']};return db[_0x595b('0x37')][_0x595b('0x17')](_0x3cbcd2)[_0x595b('0x1e')](function(_0x3fe172){_0x120696[_0x595b('0x17')]=_0x3fe172;if(_0x1cd13c[_0x595b('0x29')][_0x595b('0x38')]){_0x2739ad[_0x595b('0x39')]=[{'all':!![]}];}return db[_0x595b('0x37')]['findAll'](_0x2739ad);})['then'](function(_0x21e453){_0x120696['rows']=_0x21e453;return _0x120696;})[_0x595b('0x1e')](respondWithFilteredResult(_0x4820ca,_0x2739ad))[_0x595b('0x3a')](handleError(_0x4820ca,null));};exports[_0x595b('0x3b')]=function(_0x125912,_0x21cc38){var _0x4c890c={'raw':!![],'where':{'id':_0x125912[_0x595b('0x3c')]['id']}},_0x526133={};_0x526133[_0x595b('0x28')]=_[_0x595b('0x3d')](db[_0x595b('0x37')]['rawAttributes']);_0x526133[_0x595b('0x29')]=_[_0x595b('0x3d')](_0x125912['query']);_0x526133[_0x595b('0x31')]=_['intersection'](_0x526133[_0x595b('0x28')],_0x526133[_0x595b('0x29')]);_0x4c890c['attributes']=_[_0x595b('0x3e')](_0x526133['model'],qs[_0x595b('0x2a')](_0x125912['query'][_0x595b('0x2a')]));_0x4c890c[_0x595b('0x2b')]=_0x4c890c[_0x595b('0x2b')][_0x595b('0x2c')]?_0x4c890c[_0x595b('0x2b')]:_0x526133[_0x595b('0x28')];if(_0x125912[_0x595b('0x29')][_0x595b('0x38')]){_0x4c890c['include']=[{'all':!![]}];}_0x4c890c=_[_0x595b('0x34')]({},_0x4c890c,_0x125912[_0x595b('0x36')]);return db[_0x595b('0x37')]['find'](_0x4c890c)[_0x595b('0x1e')](handleEntityNotFound(_0x21cc38,null))[_0x595b('0x1e')](respondWithResult(_0x21cc38,null))[_0x595b('0x3a')](handleError(_0x21cc38,null));};exports['create']=function(_0x1c39df,_0x585590){return db[_0x595b('0x37')]['create'](_0x1c39df['body'],{})[_0x595b('0x1e')](respondWithResult(_0x585590,0xc9))[_0x595b('0x3a')](handleError(_0x585590,null));};exports[_0x595b('0x3f')]=function(_0x29da32,_0x5c3d43){if(_0x29da32[_0x595b('0x40')]['id']){delete _0x29da32[_0x595b('0x40')]['id'];}return db[_0x595b('0x37')][_0x595b('0x41')]({'where':{'id':_0x29da32[_0x595b('0x3c')]['id']}})[_0x595b('0x1e')](handleEntityNotFound(_0x5c3d43,null))['then'](saveUpdates(_0x29da32[_0x595b('0x40')],null))[_0x595b('0x1e')](respondWithResult(_0x5c3d43,null))[_0x595b('0x3a')](handleError(_0x5c3d43,null));};exports[_0x595b('0x1d')]=function(_0x209920,_0x15c7b5){return db[_0x595b('0x37')][_0x595b('0x41')]({'where':{'id':_0x209920[_0x595b('0x3c')]['id']}})['then'](handleEntityNotFound(_0x15c7b5,null))[_0x595b('0x1e')](removeEntity(_0x15c7b5,null))['catch'](handleError(_0x15c7b5,null));};exports['describe']=function(_0x18f5eb,_0x2cca73){return db['WhatsappTransferReport'][_0x595b('0x42')]()[_0x595b('0x1e')](respondWithResult(_0x2cca73,null))[_0x595b('0x3a')](handleError(_0x2cca73,null));}; \ No newline at end of file +var _0x8316=['merge','VIRTUAL','includeAll','include','findAll','catch','show','params','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','offset','count','limit','apply','reject','save','then','destroy','end','error','stack','name','index','map','WhatsappTransferReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8316,0x137));var _0x6831=function(_0x588bc8,_0x3dd589){_0x588bc8=_0x588bc8-0x0;var _0xd854d5=_0x8316[_0x588bc8];return _0xd854d5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6831('0x0'));var zipdir=require(_0x6831('0x1'));var jsonpatch=require(_0x6831('0x2'));var rp=require(_0x6831('0x3'));var moment=require(_0x6831('0x4'));var BPromise=require(_0x6831('0x5'));var Mustache=require(_0x6831('0x6'));var util=require('util');var path=require(_0x6831('0x7'));var sox=require(_0x6831('0x8'));var csv=require(_0x6831('0x9'));var ejs=require(_0x6831('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6831('0xb'));var squel=require(_0x6831('0xc'));var crypto=require(_0x6831('0xd'));var jsforce=require(_0x6831('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6831('0x9'));var querystring=require(_0x6831('0xf'));var Papa=require(_0x6831('0x10'));var Redis=require(_0x6831('0x11'));var authService=require(_0x6831('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x6831('0x13'));var hardwareService=require(_0x6831('0x14'));var logger=require(_0x6831('0x15'))(_0x6831('0x16'));var utils=require(_0x6831('0x17'));var config=require(_0x6831('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x6831('0x19'))['db'];function respondWithStatusCode(_0x5e5976,_0x4661e5){_0x4661e5=_0x4661e5||0xcc;return function(_0x211e0a){if(_0x211e0a){return _0x5e5976[_0x6831('0x1a')](_0x4661e5);}return _0x5e5976[_0x6831('0x1b')](_0x4661e5)['end']();};}function respondWithResult(_0xc5311b,_0x14c6f1){_0x14c6f1=_0x14c6f1||0xc8;return function(_0x2c7af7){if(_0x2c7af7){return _0xc5311b['status'](_0x14c6f1)[_0x6831('0x1c')](_0x2c7af7);}};}function respondWithFilteredResult(_0x15d9df,_0x29cf36){return function(_0x3efa33){if(_0x3efa33){var _0x4a1cf3=typeof _0x29cf36['offset']===_0x6831('0x1d')&&typeof _0x29cf36['limit']===_0x6831('0x1d');var _0x1796d9=_0x3efa33['count'];var _0x10feab=_0x4a1cf3?0x0:_0x29cf36[_0x6831('0x1e')];var _0x2f0bec=_0x4a1cf3?_0x3efa33[_0x6831('0x1f')]:_0x29cf36[_0x6831('0x1e')]+_0x29cf36[_0x6831('0x20')];var _0x5300d3;if(_0x2f0bec>=_0x1796d9){_0x2f0bec=_0x1796d9;_0x5300d3=0xc8;}else{_0x5300d3=0xce;}_0x15d9df[_0x6831('0x1b')](_0x5300d3);return _0x15d9df['set']('Content-Range',_0x10feab+'-'+_0x2f0bec+'/'+_0x1796d9)[_0x6831('0x1c')](_0x3efa33);}return null;};}function patchUpdates(_0x10d84b){return function(_0x4bb13e){try{jsonpatch[_0x6831('0x21')](_0x4bb13e,_0x10d84b,!![]);}catch(_0x56eb93){return BPromise[_0x6831('0x22')](_0x56eb93);}return _0x4bb13e[_0x6831('0x23')]();};}function saveUpdates(_0x2f8f33,_0x4b3b6c){return function(_0x15f12){if(_0x15f12){return _0x15f12['update'](_0x2f8f33)[_0x6831('0x24')](function(_0x41a108){return _0x41a108;});}return null;};}function removeEntity(_0x2e5c0b,_0x4e69b6){return function(_0x58bf60){if(_0x58bf60){return _0x58bf60[_0x6831('0x25')]()[_0x6831('0x24')](function(){_0x2e5c0b['status'](0xcc)[_0x6831('0x26')]();});}};}function handleEntityNotFound(_0x5d3029,_0x3e0fae){return function(_0x7e53a8){if(!_0x7e53a8){_0x5d3029[_0x6831('0x1a')](0x194);}return _0x7e53a8;};}function handleError(_0x3f896c,_0x51cfb6){_0x51cfb6=_0x51cfb6||0x1f4;return function(_0x51bdbb){logger[_0x6831('0x27')](_0x51bdbb[_0x6831('0x28')]);if(_0x51bdbb[_0x6831('0x29')]){delete _0x51bdbb['name'];}_0x3f896c[_0x6831('0x1b')](_0x51cfb6)['send'](_0x51bdbb);};}exports[_0x6831('0x2a')]=function(_0x57b03e,_0x344668){var _0x226532={},_0x4f2b78={},_0x35b889={'count':0x0,'rows':[]};var _0x337f12=_[_0x6831('0x2b')](db[_0x6831('0x2c')][_0x6831('0x2d')],function(_0x36ab5b){return{'name':_0x36ab5b[_0x6831('0x2e')],'type':_0x36ab5b[_0x6831('0x2f')][_0x6831('0x30')]};});_0x4f2b78[_0x6831('0x31')]=_[_0x6831('0x2b')](_0x337f12,'name');_0x4f2b78[_0x6831('0x32')]=_[_0x6831('0x33')](_0x57b03e[_0x6831('0x32')]);_0x4f2b78['filters']=_[_0x6831('0x34')](_0x4f2b78[_0x6831('0x31')],_0x4f2b78[_0x6831('0x32')]);_0x226532[_0x6831('0x35')]=_[_0x6831('0x34')](_0x4f2b78['model'],qs[_0x6831('0x36')](_0x57b03e[_0x6831('0x32')][_0x6831('0x36')]));_0x226532[_0x6831('0x35')]=_0x226532['attributes'][_0x6831('0x37')]?_0x226532[_0x6831('0x35')]:_0x4f2b78[_0x6831('0x31')];if(!_0x57b03e[_0x6831('0x32')][_0x6831('0x38')](_0x6831('0x39'))){_0x226532[_0x6831('0x20')]=qs['limit'](_0x57b03e['query'][_0x6831('0x20')]);_0x226532[_0x6831('0x1e')]=qs[_0x6831('0x1e')](_0x57b03e['query']['offset']);}_0x226532[_0x6831('0x3a')]=qs[_0x6831('0x3b')](_0x57b03e['query'][_0x6831('0x3b')]);_0x226532[_0x6831('0x3c')]=qs[_0x6831('0x3d')](_[_0x6831('0x3e')](_0x57b03e['query'],_0x4f2b78['filters']),_0x337f12);if(_0x57b03e['query'][_0x6831('0x3f')]){_0x226532['where']=_[_0x6831('0x40')](_0x226532[_0x6831('0x3c')],{'$or':_[_0x6831('0x2b')](_0x337f12,function(_0x9e47ae){if(_0x9e47ae['type']!==_0x6831('0x41')){var _0x670a49={};_0x670a49[_0x9e47ae[_0x6831('0x29')]]={'$like':'%'+_0x57b03e[_0x6831('0x32')][_0x6831('0x3f')]+'%'};return _0x670a49;}})});}_0x226532=_[_0x6831('0x40')]({},_0x226532,_0x57b03e['options']);var _0x37d189={'where':_0x226532[_0x6831('0x3c')]};return db[_0x6831('0x2c')][_0x6831('0x1f')](_0x37d189)[_0x6831('0x24')](function(_0x2e0bab){_0x35b889[_0x6831('0x1f')]=_0x2e0bab;if(_0x57b03e['query'][_0x6831('0x42')]){_0x226532[_0x6831('0x43')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0x6831('0x44')](_0x226532);})['then'](function(_0x1228a2){_0x35b889['rows']=_0x1228a2;return _0x35b889;})[_0x6831('0x24')](respondWithFilteredResult(_0x344668,_0x226532))[_0x6831('0x45')](handleError(_0x344668,null));};exports[_0x6831('0x46')]=function(_0x13f876,_0x56a751){var _0x1ead07={'raw':!![],'where':{'id':_0x13f876[_0x6831('0x47')]['id']}},_0x4d1696={};_0x4d1696[_0x6831('0x31')]=_['keys'](db[_0x6831('0x2c')][_0x6831('0x2d')]);_0x4d1696[_0x6831('0x32')]=_[_0x6831('0x33')](_0x13f876['query']);_0x4d1696['filters']=_['intersection'](_0x4d1696[_0x6831('0x31')],_0x4d1696[_0x6831('0x32')]);_0x1ead07[_0x6831('0x35')]=_['intersection'](_0x4d1696[_0x6831('0x31')],qs['fields'](_0x13f876[_0x6831('0x32')]['fields']));_0x1ead07[_0x6831('0x35')]=_0x1ead07[_0x6831('0x35')][_0x6831('0x37')]?_0x1ead07[_0x6831('0x35')]:_0x4d1696[_0x6831('0x31')];if(_0x13f876[_0x6831('0x32')][_0x6831('0x42')]){_0x1ead07[_0x6831('0x43')]=[{'all':!![]}];}_0x1ead07=_[_0x6831('0x40')]({},_0x1ead07,_0x13f876['options']);return db['WhatsappTransferReport'][_0x6831('0x48')](_0x1ead07)[_0x6831('0x24')](handleEntityNotFound(_0x56a751,null))[_0x6831('0x24')](respondWithResult(_0x56a751,null))[_0x6831('0x45')](handleError(_0x56a751,null));};exports[_0x6831('0x49')]=function(_0x34da54,_0x136ac1){return db[_0x6831('0x2c')][_0x6831('0x49')](_0x34da54['body'],{})['then'](respondWithResult(_0x136ac1,0xc9))[_0x6831('0x45')](handleError(_0x136ac1,null));};exports['update']=function(_0x56f2fd,_0x1c16a7){if(_0x56f2fd[_0x6831('0x4a')]['id']){delete _0x56f2fd[_0x6831('0x4a')]['id'];}return db[_0x6831('0x2c')]['find']({'where':{'id':_0x56f2fd['params']['id']}})[_0x6831('0x24')](handleEntityNotFound(_0x1c16a7,null))[_0x6831('0x24')](saveUpdates(_0x56f2fd[_0x6831('0x4a')],null))[_0x6831('0x24')](respondWithResult(_0x1c16a7,null))['catch'](handleError(_0x1c16a7,null));};exports[_0x6831('0x25')]=function(_0x5d665a,_0x1ac87f){return db[_0x6831('0x2c')][_0x6831('0x48')]({'where':{'id':_0x5d665a['params']['id']}})[_0x6831('0x24')](handleEntityNotFound(_0x1ac87f,null))[_0x6831('0x24')](removeEntity(_0x1ac87f,null))[_0x6831('0x45')](handleError(_0x1ac87f,null));};exports['describe']=function(_0x3be64d,_0x19781f){return db[_0x6831('0x2c')]['describe']()['then'](respondWithResult(_0x19781f,null))[_0x6831('0x45')](handleError(_0x19781f,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 67d95e7..9b18817 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 _0xccbe=['../../config/environment','./whatsappTransferReport.attributes','exports','define','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4042d7,_0x46c717){var _0x344f6e=function(_0x1d79e3){while(--_0x1d79e3){_0x4042d7['push'](_0x4042d7['shift']());}};_0x344f6e(++_0x46c717);}(_0xccbe,0x1b7));var _0xeccb=function(_0x4687df,_0x12099c){_0x4687df=_0x4687df-0x0;var _0x32eaef=_0xccbe[_0x4687df];return _0x32eaef;};'use strict';var _=require(_0xeccb('0x0'));var util=require(_0xeccb('0x1'));var logger=require(_0xeccb('0x2'))(_0xeccb('0x3'));var moment=require(_0xeccb('0x4'));var BPromise=require(_0xeccb('0x5'));var rp=require(_0xeccb('0x6'));var fs=require('fs');var path=require(_0xeccb('0x7'));var rimraf=require(_0xeccb('0x8'));var config=require(_0xeccb('0x9'));var attributes=require(_0xeccb('0xa'));module[_0xeccb('0xb')]=function(_0xf38129,_0x32f39a){return _0xf38129[_0xeccb('0xc')]('WhatsappTransferReport',attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0xeccb('0xd'),'fields':[_0xeccb('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x51c5=['./whatsappTransferReport.attributes','exports','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x32aa89,_0xdde04c){var _0x268c53=function(_0x594fd9){while(--_0x594fd9){_0x32aa89['push'](_0x32aa89['shift']());}};_0x268c53(++_0xdde04c);}(_0x51c5,0x161));var _0x551c=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0x51c5[_0x5ddaac];return _0x2a9c58;};'use strict';var _=require(_0x551c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x551c('0x1'));var moment=require(_0x551c('0x2'));var BPromise=require(_0x551c('0x3'));var rp=require(_0x551c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x551c('0x5'));var config=require(_0x551c('0x6'));var attributes=require(_0x551c('0x7'));module[_0x551c('0x8')]=function(_0x5b050f,_0x567daa){return _0x5b050f['define'](_0x551c('0x9'),attributes,{'tableName':_0x551c('0xa'),'paranoid':![],'indexes':[{'name':_0x551c('0xb'),'fields':[_0x551c('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 8e5b964..14d5de4 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 _0x3c0c=['../../config/logger','rpc','jayson/promise','http','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3c0c,0x94));var _0xc3c0=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x3c0c[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0xc3c0('0x0'));var util=require('util');var moment=require(_0xc3c0('0x1'));var BPromise=require('bluebird');var rs=require(_0xc3c0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc3c0('0x3'))['db'];var utils=require(_0xc3c0('0x4'));var logger=require(_0xc3c0('0x5'))(_0xc3c0('0x6'));var config=require('../../config/environment');var jayson=require(_0xc3c0('0x7'));var client=jayson['client'][_0xc3c0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2e0320,_0x2833bb,_0x2aad9c){return new BPromise(function(_0x30b32e,_0x41d878){return client['request'](_0x2e0320,_0x2aad9c)['then'](function(_0x111d23){logger['info'](_0xc3c0('0x9'),_0x2833bb,_0xc3c0('0xa'));logger[_0xc3c0('0xb')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x2833bb,_0xc3c0('0xa'),JSON[_0xc3c0('0xc')](_0x111d23));if(_0x111d23['error']){if(_0x111d23[_0xc3c0('0xd')][_0xc3c0('0xe')]===0x1f4){logger[_0xc3c0('0xd')](_0xc3c0('0x9'),_0x2833bb,_0x111d23['error']['message']);return _0x41d878(_0x111d23[_0xc3c0('0xd')]['message']);}logger[_0xc3c0('0xd')](_0xc3c0('0x9'),_0x2833bb,_0x111d23[_0xc3c0('0xd')]['message']);return _0x30b32e(_0x111d23['error'][_0xc3c0('0xf')]);}else{logger['info'](_0xc3c0('0x9'),_0x2833bb,_0xc3c0('0xa'));_0x30b32e(_0x111d23[_0xc3c0('0x10')][_0xc3c0('0xf')]);}})['catch'](function(_0x7c817f){logger[_0xc3c0('0xd')]('WhatsappTransferReport,\x20%s,\x20%s',_0x2833bb,_0x7c817f);_0x41d878(_0x7c817f);});});} \ No newline at end of file +var _0xe4a5=['debug','stringify','error','WhatsappTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent'];(function(_0x14cbda,_0x429baf){var _0xd763df=function(_0x37d61b){while(--_0x37d61b){_0x14cbda['push'](_0x14cbda['shift']());}};_0xd763df(++_0x429baf);}(_0xe4a5,0xa8));var _0x5e4a=function(_0x306250,_0x2c44ce){_0x306250=_0x306250-0x0;var _0x39e362=_0xe4a5[_0x306250];return _0x39e362;};'use strict';var _=require(_0x5e4a('0x0'));var util=require(_0x5e4a('0x1'));var moment=require(_0x5e4a('0x2'));var BPromise=require(_0x5e4a('0x3'));var rs=require(_0x5e4a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5e4a('0x5'))['db'];var utils=require(_0x5e4a('0x6'));var logger=require(_0x5e4a('0x7'))(_0x5e4a('0x8'));var config=require(_0x5e4a('0x9'));var jayson=require(_0x5e4a('0xa'));var client=jayson[_0x5e4a('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x381313,_0x426084,_0x3c1ae7){return new BPromise(function(_0x2559b6,_0x2bf765){return client[_0x5e4a('0xc')](_0x381313,_0x3c1ae7)[_0x5e4a('0xd')](function(_0x523437){logger[_0x5e4a('0xe')]('WhatsappTransferReport,\x20%s,\x20%s',_0x426084,_0x5e4a('0xf'));logger[_0x5e4a('0x10')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x426084,_0x5e4a('0xf'),JSON[_0x5e4a('0x11')](_0x523437));if(_0x523437['error']){if(_0x523437[_0x5e4a('0x12')]['code']===0x1f4){logger['error'](_0x5e4a('0x13'),_0x426084,_0x523437['error'][_0x5e4a('0x14')]);return _0x2bf765(_0x523437[_0x5e4a('0x12')][_0x5e4a('0x14')]);}logger[_0x5e4a('0x12')](_0x5e4a('0x13'),_0x426084,_0x523437[_0x5e4a('0x12')]['message']);return _0x2559b6(_0x523437[_0x5e4a('0x12')][_0x5e4a('0x14')]);}else{logger[_0x5e4a('0xe')](_0x5e4a('0x13'),_0x426084,_0x5e4a('0xf'));_0x2559b6(_0x523437[_0x5e4a('0x15')]['message']);}})[_0x5e4a('0x16')](function(_0x33f780){logger[_0x5e4a('0x12')](_0x5e4a('0x13'),_0x426084,_0x33f780);_0x2bf765(_0x33f780);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index b44f93c..bc1e6f4 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9e2a=['app','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','listen','then','start','info','Online\x20apps:','join','Offline\x20apps:','filter','status','online','name','None','seedDB','./config/seedDB','default','./config/license','catch','error','exit','lodash','./rpc','./config/environment'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x9e2a,0x10b));var _0xa9e2=function(_0xb475a2,_0x4ce5c9){_0xb475a2=_0xb475a2-0x0;var _0x38be70=_0x9e2a[_0xb475a2];return _0x38be70;};'use strict';var _=require(_0xa9e2('0x0'));var mysqldb=require('./mysqldb');var rpc=require(_0xa9e2('0x1'));var config=require(_0xa9e2('0x2'));var logger=require('./config/logger')(_0xa9e2('0x3'));var pm2=require('./config/pm2');var pm2Config=require(_0xa9e2('0x4'));var schedule=require(_0xa9e2('0x5'));var chat=require(_0xa9e2('0x6'));var whatsapp=require(_0xa9e2('0x7'));var transcribe=require(_0xa9e2('0x8'));function main(){return mysqldb['db'][_0xa9e2('0x9')][_0xa9e2('0xa')]()['then'](function(){return rpc[_0xa9e2('0xb')]();})[_0xa9e2('0xc')](function(_0x461857){logger['info'](_0x461857);return chat[_0xa9e2('0xd')]();})[_0xa9e2('0xc')](function(){return whatsapp[_0xa9e2('0xd')]();})[_0xa9e2('0xc')](function(){return schedule[_0xa9e2('0xd')]();})[_0xa9e2('0xc')](function(){return transcribe[_0xa9e2('0xd')]();})[_0xa9e2('0xc')](function(_0x4f5085){logger[_0xa9e2('0xe')](_0x4f5085);return pm2[_0xa9e2('0xd')](pm2Config);})[_0xa9e2('0xc')](function(_0x3d9a3f){logger[_0xa9e2('0xe')](_0xa9e2('0xf'),_['map'](_['filter'](_0x3d9a3f,{'status':'online'}),'name')[_0xa9e2('0x10')]());logger['info'](_0xa9e2('0x11'),_['map'](_[_0xa9e2('0x12')](_0x3d9a3f,function(_0x3b1b88){return _0x3b1b88[_0xa9e2('0x13')]!==_0xa9e2('0x14');}),_0xa9e2('0x15'))['join']()||_0xa9e2('0x16'));config[_0xa9e2('0x17')]&&require(_0xa9e2('0x18'))[_0xa9e2('0x19')]();require(_0xa9e2('0x1a'))[_0xa9e2('0x19')]();})[_0xa9e2('0x1b')](function(_0x5409f9){logger[_0xa9e2('0x1c')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x5409f9);process[_0xa9e2('0x1d')](0x1);});}main(); \ No newline at end of file +var _0xa48a=['./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','sync','then','start','info','Online\x20apps:','map','filter','online','name','join','Offline\x20apps:','status','None','default','./config/license','catch','error','exit','lodash','./mysqldb','./rpc','./config/environment','./config/pm2/config'];(function(_0x5f4e09,_0x52daaf){var _0x1f1f94=function(_0x53a8fc){while(--_0x53a8fc){_0x5f4e09['push'](_0x5f4e09['shift']());}};_0x1f1f94(++_0x52daaf);}(_0xa48a,0x97));var _0xaa48=function(_0x19d030,_0x36034f){_0x19d030=_0x19d030-0x0;var _0x320a53=_0xa48a[_0x19d030];return _0x320a53;};'use strict';var _=require(_0xaa48('0x0'));var mysqldb=require(_0xaa48('0x1'));var rpc=require(_0xaa48('0x2'));var config=require(_0xaa48('0x3'));var logger=require('./config/logger')('app');var pm2=require('./config/pm2');var pm2Config=require(_0xaa48('0x4'));var schedule=require(_0xaa48('0x5'));var chat=require(_0xaa48('0x6'));var whatsapp=require(_0xaa48('0x7'));var transcribe=require('./config/schedule/transcribe');function main(){return mysqldb['db']['sequelize'][_0xaa48('0x8')]()[_0xaa48('0x9')](function(){return rpc['listen']();})[_0xaa48('0x9')](function(_0x3e079e){logger['info'](_0x3e079e);return chat['start']();})[_0xaa48('0x9')](function(){return whatsapp['start']();})[_0xaa48('0x9')](function(){return schedule[_0xaa48('0xa')]();})['then'](function(){return transcribe[_0xaa48('0xa')]();})['then'](function(_0x470c32){logger[_0xaa48('0xb')](_0x470c32);return pm2[_0xaa48('0xa')](pm2Config);})[_0xaa48('0x9')](function(_0xd04c0a){logger[_0xaa48('0xb')](_0xaa48('0xc'),_[_0xaa48('0xd')](_[_0xaa48('0xe')](_0xd04c0a,{'status':_0xaa48('0xf')}),_0xaa48('0x10'))[_0xaa48('0x11')]());logger[_0xaa48('0xb')](_0xaa48('0x12'),_[_0xaa48('0xd')](_[_0xaa48('0xe')](_0xd04c0a,function(_0x2b9f7e){return _0x2b9f7e[_0xaa48('0x13')]!==_0xaa48('0xf');}),_0xaa48('0x10'))['join']()||_0xaa48('0x14'));config['seedDB']&&require('./config/seedDB')[_0xaa48('0x15')]();require(_0xaa48('0x16'))[_0xaa48('0x15')]();})[_0xaa48('0x17')](function(_0xa17228){logger[_0xaa48('0x18')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0xa17228);process[_0xaa48('0x19')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index ccb69be..36fba48 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 _0x74d6=['add','minutes','Invalid\x20API\x20access\x20key','Unknown\x20authorization\x20format','User\x20object\x20not\x20found.','canUpdate','update','Forbidden','isMiddleware','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','cookie','motion.token','redirect','/dashboards/general','isNil','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','split','length','unshift','join','promisify','sign','secret','payload','verify','session','randomBytes','hex','floor','toString','apiKeyIat','HS512','../../mysqldb','../../config/environment','../encryptor','lodash','jsonwebtoken','express-jwt','basic-auth','crypto','bluebird','util','moment','secrets','fullname','name','internal','email','userpic','permissions','chatPause','mailPause','faxPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','alias','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadAttachments','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','params','closed','status','disposition','unmanaged','json','Unmanaged.','Forbidden.','catch','headers','authorization','startsWith','Basic','User','find','authenticate','pass','Wrong\x20credentials.','Bearer','query','apikey','getUuid','then','sub','findOne','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blocked','blockedAt'];(function(_0xd59d96,_0x310864){var _0x5c18d3=function(_0x49f976){while(--_0x49f976){_0xd59d96['push'](_0xd59d96['shift']());}};_0x5c18d3(++_0x310864);}(_0x74d6,0xaf));var _0x674d=function(_0x283b55,_0x279bee){_0x283b55=_0x283b55-0x0;var _0x192e58=_0x74d6[_0x283b55];return _0x192e58;};'use strict';var db=require(_0x674d('0x0'))['db'];var config=require(_0x674d('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require('../../config/license/util');var encryptor=require(_0x674d('0x2'));var _=require(_0x674d('0x3'));var jwt=require(_0x674d('0x4'));var expressJwt=require(_0x674d('0x5'));var compose=require('composable-middleware');var basicAuth=require(_0x674d('0x6'));var crypto=require(_0x674d('0x7'));var BPromise=require(_0x674d('0x8'));var util=require(_0x674d('0x9'));var moment=require(_0x674d('0xa'));var validateJwt=expressJwt({'secret':config[_0x674d('0xb')]['session']});var userAttributes=['id','role',_0x674d('0xc'),_0x674d('0xd'),_0x674d('0xe'),_0x674d('0xf'),_0x674d('0x10'),_0x674d('0x11'),'md5secret','voicePause',_0x674d('0x12'),_0x674d('0x13'),_0x674d('0x14'),'smsPause','openchannelPause',_0x674d('0x15'),_0x674d('0x16'),_0x674d('0x17'),_0x674d('0x18'),_0x674d('0x19'),_0x674d('0x1a'),'passwordResetAt',_0x674d('0x1b'),'phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd',_0x674d('0x1c'),_0x674d('0x1d'),_0x674d('0x1e'),_0x674d('0x1f'),_0x674d('0x20'),_0x674d('0x21'),_0x674d('0x22'),'hotdesk',_0x674d('0x23'),_0x674d('0x24'),_0x674d('0x25'),_0x674d('0x26'),_0x674d('0x27'),_0x674d('0x28'),'downloadOmnichannelInteractions',_0x674d('0x29')];exports[_0x674d('0x2a')]=function(){return this[_0x674d('0x2b')](!![])[_0x674d('0x2c')](function(_0x4f2407,_0x191bae,_0x3409ac){if(_0x4f2407[_0x674d('0x2d')]){_0x3409ac();}else{return db[_0x674d('0x2e')]['findOne']({'where':{'id':_0x4f2407[_0x674d('0x2f')]['id']},'attributes':['id',_0x674d('0x30'),'disposition'],'raw':!![]})['then'](function(_0x401362){if(_0x401362&&_0x401362[_0x674d('0x30')]){return _0x191bae[_0x674d('0x31')](_0x401362[_0x674d('0x32')]===_0x674d('0x33')?0x195:0x193)[_0x674d('0x34')]({'message':_0x401362[_0x674d('0x32')]==='unmanaged'?_0x674d('0x35'):_0x674d('0x36')});}else{_0x3409ac();}})[_0x674d('0x37')](function(_0x4906a9){_0x3409ac(_0x4906a9);});}});};exports['isAuthenticated']=function isAuthenticated(_0x89a8d1){return compose()['use'](function(_0x12335c,_0x356bf2,_0x2b8c66){var _0x1674c6;if(_0x12335c[_0x674d('0x38')][_0x674d('0x39')]){if(_[_0x674d('0x3a')](_0x12335c['headers']['authorization'],_0x674d('0x3b'))){var _0x33bca7=basicAuth(_0x12335c);db[_0x674d('0x3c')][_0x674d('0x3d')]({'where':{'name':_0x33bca7[_0x674d('0xd')]}})['then'](function(_0x17c158){if(!_0x17c158||!_0x17c158[_0x674d('0x3e')](_0x33bca7[_0x674d('0x3f')])){return _0x356bf2[_0x674d('0x31')](0x191)['json']({'message':_0x674d('0x40')});}_0x12335c[_0x674d('0x2d')]={'id':_0x17c158['id']};_0x2b8c66();})[_0x674d('0x37')](function(_0x2eaabc){_0x2b8c66(_0x2eaabc);});}else if(_[_0x674d('0x3a')](_0x12335c[_0x674d('0x38')]['authorization'],_0x674d('0x41'))){validateJwt(_0x12335c,_0x356bf2,_0x2b8c66);}else{if(_0x89a8d1){_0x2b8c66();}else{return _0x356bf2[_0x674d('0x31')](0x193)[_0x674d('0x34')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x12335c[_0x674d('0x42')][_0x674d('0x43')]){try{var _0x1047f1={'audience':hardwareConf[_0x674d('0x44')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x12335c[_0x674d('0x42')][_0x674d('0x43')],_0x1047f1)[_0x674d('0x45')](function(_0x229979){return db[_0x674d('0x3c')]['find']({'where':{'id':_0x229979[_0x674d('0x46')]}})['then'](function(_0x2c7fc3){_0x1674c6=_0x2c7fc3;return db['Setting'][_0x674d('0x47')]({'where':{'id':0x1},'attributes':[_0x674d('0x48'),_0x674d('0x49')],'raw':!![]});})[_0x674d('0x45')](function(_0x2c1243){if(!_0x1674c6||!_[_0x674d('0x4a')](_0x1674c6[_0x674d('0x4b')],_0x229979[_0x674d('0x4c')])){return _0x356bf2[_0x674d('0x31')](0x191)['json']({'message':_0x674d('0x4d')});}if(_0x1674c6[_0x674d('0x4e')]){return _0x356bf2['status'](0x191)[_0x674d('0x34')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x1674c6[_0x674d('0x4f')]){if(_0x2c1243['blockDuration']>0x0){if(moment(_0x1674c6[_0x674d('0x50')])[_0x674d('0x51')](_0x2c1243[_0x674d('0x49')],_0x674d('0x52'))>moment()){return _0x356bf2[_0x674d('0x31')](0x191)[_0x674d('0x34')]({'message':_0x674d('0x53')});}}else{return _0x356bf2['status'](0x191)[_0x674d('0x34')]({'message':_0x674d('0x53')});}}_0x12335c[_0x674d('0x2d')]={'id':_0x1674c6['id']};_0x2b8c66();});})['catch'](function(){return _0x356bf2[_0x674d('0x31')](0x191)[_0x674d('0x34')]({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x119c0c){_0x2b8c66(_0x119c0c);}}else if(_0x89a8d1){_0x2b8c66();}else{return _0x356bf2['status'](0x193)[_0x674d('0x34')]({'message':_0x674d('0x54')});}})[_0x674d('0x2c')](function(_0x228d96,_0x31cedb,_0x1639e7){if(_0x228d96[_0x674d('0x2d')]){db[_0x674d('0x3c')][_0x674d('0x3d')]({'where':{'id':_0x228d96[_0x674d('0x2d')]['id']},'attributes':userAttributes})['then'](function(_0x31009f){if(!_0x31009f){return _0x31cedb[_0x674d('0x31')](0x194)[_0x674d('0x34')]({'message':'User\x20not\x20found.'});}_0x228d96[_0x674d('0x2d')]=_0x31009f;_0x1639e7();})[_0x674d('0x37')](function(_0x1fb312){_0x1639e7(_0x1fb312);});}else if(_0x89a8d1){_0x1639e7();}else{return _0x31cedb['status'](0x194)[_0x674d('0x34')]({'message':_0x674d('0x55')});}});};exports[_0x674d('0x56')]=function canUpdate(){return compose()['use'](function(_0x12b88b,_0x30edb8,_0x27b345){return licenseUtil['getLicense']()['then'](function(_0x45b627){if(_0x45b627[_0x674d('0x57')]){_0x27b345();}else{return _0x30edb8['status'](0x193)[_0x674d('0x34')]({'message':_0x674d('0x58')});}})[_0x674d('0x37')](function(_0x57751a){_0x27b345(_0x57751a);});});};exports[_0x674d('0x59')]=function(_0x73f952,_0xa0b5e0,_0x329052){_0x73f952['isMiddleware']=!![];return _0x329052();};exports[_0x674d('0x5a')]=function signToken(_0x2155b2){return signJwt(_0x2155b2);};exports['setTokenCookie']=function(_0x27785c,_0x181af8){if(!_0x27785c['user']){return _0x181af8[_0x674d('0x31')](0x194)[_0x674d('0x34')]({'message':_0x674d('0x5b')});}var _0x599e36={'payload':{'id':_0x27785c[_0x674d('0x2d')]['id'],'role':_0x27785c[_0x674d('0x2d')][_0x674d('0x5c')]},'options':{'expiresIn':0x15180}};return signJwt(_0x599e36)[_0x674d('0x45')](function(_0x4c219b){_0x181af8[_0x674d('0x5d')](_0x674d('0x5e'),_0x4c219b);_0x181af8[_0x674d('0x5f')](_0x674d('0x60'));})[_0x674d('0x37')](function(_0x40061c){return _0x181af8[_0x674d('0x31')](0x1f4)['send'](_0x40061c);});};exports['retrieveApiKey']=function(_0x120f89){if(_[_0x674d('0x61')](_0x120f89['apiKeyNonce'])||_['isNil'](_0x120f89['apiKeyIat'])){return null;}else{return createJwt(_0x120f89);}};exports[_0x674d('0x62')]=function(_0xcf0609){_0xcf0609['apiKeyNonce']=generateNonce();_0xcf0609['apiKeyIat']=generateIssuedAt();return createJwt(_0xcf0609);};exports[_0x674d('0x63')]=function(_0xc6ad1b,_0x6547df){var _0x5c3c8a=_0xc6ad1b[_0x674d('0x42')][_0x674d('0x43')];if(_0x5c3c8a){var _0x38de34={'nonce':_0x6547df[_0x674d('0x4b')],'iat':_0x6547df['apiKeyIat'],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x5c3c8a,_0x38de34)['then'](function(){return generateApiKey(_0x6547df);});}else{throw{'message':_0x674d('0x64')};}};exports[_0x674d('0x65')]=function(_0x22ed91){var _0xf543c6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0xf543c6['test'](_0x22ed91))throw new db[(_0x674d('0x66'))][(_0x674d('0x67'))](_0x674d('0x68'));return;};exports[_0x674d('0x69')]=function(_0x470309,_0x5f03de,_0x2efccd){var _0x465d9b=encryptor[_0x674d('0x6a')](_0x5f03de)['split'](',');for(var _0x354907=0x0;_0x354907<_0x2efccd;_0x354907++){if(!_0x465d9b[_0x354907])break;if(_0x470309[_0x674d('0x6b')]()===_0x465d9b[_0x354907][_0x674d('0x6b')]()){var _0x468393=util[_0x674d('0x6c')](_0x674d('0x6d'),_0x2efccd);if(_0x2efccd===0x1){_0x468393=_0x674d('0x6e');}throw new db['Sequelize'][(_0x674d('0x67'))](_0x468393);}}return;};exports[_0x674d('0x6f')]=function(_0x424b22,_0x2d0889){var _0x5e07a2=_0x2d0889?encryptor[_0x674d('0x6a')](_0x2d0889)[_0x674d('0x70')](','):[];if(_0x5e07a2[_0x674d('0x71')]===0x5){_0x5e07a2['splice'](-0x1,0x1);}_0x5e07a2[_0x674d('0x72')](_0x424b22);return encryptor['encryptString'](_0x5e07a2[_0x674d('0x73')](','));};function signJwt(_0x5e8563){var _0x4e484a=BPromise[_0x674d('0x74')](jwt[_0x674d('0x75')],{'context':jwt});var _0x2b448c=_0x5e8563[_0x674d('0x76')]||config[_0x674d('0xb')]['session'];return new BPromise(function(_0x27547a,_0x5da447){_0x4e484a(_0x5e8563[_0x674d('0x77')],_0x2b448c,_0x5e8563['options'])['then'](function(_0x5d6695){_0x27547a(_0x5d6695);})[_0x674d('0x37')](function(_0x284878){_0x5da447(_0x284878);});});}function verifyJwt(_0x2be81d,_0x47cb61,_0x1df510){var _0x46b5c4=BPromise[_0x674d('0x74')](jwt[_0x674d('0x78')],{'context':jwt});var _0x377467=_0x1df510||config[_0x674d('0xb')][_0x674d('0x79')];return new BPromise(function(_0x162867,_0x5bd87a){_0x46b5c4(_0x2be81d,_0x377467,_0x47cb61)[_0x674d('0x45')](function(_0x3387d4){_0x162867(_0x3387d4);})[_0x674d('0x37')](function(_0x5672e2){_0x5bd87a(_0x5672e2);});});}function generateNonce(){return crypto[_0x674d('0x7a')](0x10)['toString'](_0x674d('0x7b'));}function generateIssuedAt(){return Math[_0x674d('0x7c')](Date['now']()/0x3e8)[_0x674d('0x7d')]();}function createJwt(_0x27a9dd){var _0xe995b1={'payload':{'iat':_0x27a9dd[_0x674d('0x7e')],'nonce':_0x27a9dd[_0x674d('0x4b')]},'options':{'algorithm':_0x674d('0x7f'),'subject':_0x27a9dd['id'][_0x674d('0x7d')](),'issuer':hardwareConf[_0x674d('0x44')](),'audience':hardwareConf[_0x674d('0x44')]()}};return signJwt(_0xe995b1)[_0x674d('0x45')](function(_0x4986ab){return{'iat':_0x27a9dd[_0x674d('0x7e')],'nonce':_0x27a9dd['apiKeyNonce'],'token':_0x4986ab};});} \ No newline at end of file +var _0x1007=['permissions','voicePause','chatPause','mailPause','smsPause','openchannelPause','pauseType','lastLoginAt','lastPauseAt','crudPermissions','alias','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','userProfileId','privacyEnabled','settingsEnabled','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','isChatInteractionAuthorized','isAuthenticated','use','user','findOne','closed','disposition','then','status','unmanaged','json','Unmanaged.','Forbidden.','headers','startsWith','authorization','Basic','User','find','authenticate','pass','Bearer','Unknown\x20authorization\x20format','query','getUuid','apikey','sub','Setting','allowedLoginAttempts','blockDuration','isEqual','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','catch','User\x20not\x20found.','User\x20object\x20not\x20found.','getLicense','update','Forbidden','signToken','setTokenCookie','cookie','motion.token','redirect','send','retrieveApiKey','isNil','apiKeyNonce','apiKeyIat','generateApiKey','regenerateApiKey','validatePasswordPattern','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','split','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','splice','unshift','encryptString','join','promisify','sign','secret','payload','options','randomBytes','toString','floor','HS512','../../config/environment','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','basic-auth','crypto','bluebird','util','moment','secrets','session','role','fullname','name','internal','email','userpic'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x1007,0xe5));var _0x7100=function(_0x1fe10c,_0x302bf7){_0x1fe10c=_0x1fe10c-0x0;var _0x1b37be=_0x1007[_0x1fe10c];return _0x1b37be;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0x7100('0x0'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0x7100('0x1'));var encryptor=require(_0x7100('0x2'));var _=require(_0x7100('0x3'));var jwt=require(_0x7100('0x4'));var expressJwt=require(_0x7100('0x5'));var compose=require('composable-middleware');var basicAuth=require(_0x7100('0x6'));var crypto=require(_0x7100('0x7'));var BPromise=require(_0x7100('0x8'));var util=require(_0x7100('0x9'));var moment=require(_0x7100('0xa'));var validateJwt=expressJwt({'secret':config[_0x7100('0xb')][_0x7100('0xc')]});var userAttributes=['id',_0x7100('0xd'),_0x7100('0xe'),_0x7100('0xf'),_0x7100('0x10'),_0x7100('0x11'),_0x7100('0x12'),_0x7100('0x13'),'md5secret',_0x7100('0x14'),_0x7100('0x15'),_0x7100('0x16'),'faxPause',_0x7100('0x17'),_0x7100('0x18'),_0x7100('0x19'),'showWebBar',_0x7100('0x1a'),_0x7100('0x1b'),_0x7100('0x1c'),'allowmessenger','passwordResetAt',_0x7100('0x1d'),_0x7100('0x1e'),'phoneBarAutoAnswerDelay',_0x7100('0x1f'),_0x7100('0x20'),_0x7100('0x21'),_0x7100('0x22'),_0x7100('0x23'),_0x7100('0x24'),_0x7100('0x25'),_0x7100('0x26'),'hotdesk','interface',_0x7100('0x27'),_0x7100('0x28'),_0x7100('0x29'),'wssPort',_0x7100('0x2a'),_0x7100('0x2b'),_0x7100('0x2c')];exports[_0x7100('0x2d')]=function(){return this[_0x7100('0x2e')](!![])[_0x7100('0x2f')](function(_0x27a988,_0x133307,_0x30d989){if(_0x27a988[_0x7100('0x30')]){_0x30d989();}else{return db['ChatInteraction'][_0x7100('0x31')]({'where':{'id':_0x27a988['params']['id']},'attributes':['id',_0x7100('0x32'),_0x7100('0x33')],'raw':!![]})[_0x7100('0x34')](function(_0x5b3002){if(_0x5b3002&&_0x5b3002[_0x7100('0x32')]){return _0x133307[_0x7100('0x35')](_0x5b3002[_0x7100('0x33')]===_0x7100('0x36')?0x195:0x193)[_0x7100('0x37')]({'message':_0x5b3002[_0x7100('0x33')]===_0x7100('0x36')?_0x7100('0x38'):_0x7100('0x39')});}else{_0x30d989();}})['catch'](function(_0x5383f1){_0x30d989(_0x5383f1);});}});};exports[_0x7100('0x2e')]=function isAuthenticated(_0x5cd83e){return compose()['use'](function(_0x42405a,_0x2e493e,_0x5192bb){var _0x1b59ec;if(_0x42405a[_0x7100('0x3a')]['authorization']){if(_[_0x7100('0x3b')](_0x42405a['headers'][_0x7100('0x3c')],_0x7100('0x3d'))){var _0x26f428=basicAuth(_0x42405a);db[_0x7100('0x3e')][_0x7100('0x3f')]({'where':{'name':_0x26f428[_0x7100('0xf')]}})[_0x7100('0x34')](function(_0x1014c4){if(!_0x1014c4||!_0x1014c4[_0x7100('0x40')](_0x26f428[_0x7100('0x41')])){return _0x2e493e[_0x7100('0x35')](0x191)['json']({'message':'Wrong\x20credentials.'});}_0x42405a['user']={'id':_0x1014c4['id']};_0x5192bb();})['catch'](function(_0x5854ee){_0x5192bb(_0x5854ee);});}else if(_[_0x7100('0x3b')](_0x42405a[_0x7100('0x3a')]['authorization'],_0x7100('0x42'))){validateJwt(_0x42405a,_0x2e493e,_0x5192bb);}else{if(_0x5cd83e){_0x5192bb();}else{return _0x2e493e['status'](0x193)[_0x7100('0x37')]({'message':_0x7100('0x43')});}}}else if(_0x42405a[_0x7100('0x44')]['apikey']){try{var _0x519a26={'audience':hardwareConf[_0x7100('0x45')](),'issuer':hardwareConf[_0x7100('0x45')]()};verifyJwt(_0x42405a[_0x7100('0x44')][_0x7100('0x46')],_0x519a26)['then'](function(_0x42b429){return db[_0x7100('0x3e')]['find']({'where':{'id':_0x42b429[_0x7100('0x47')]}})[_0x7100('0x34')](function(_0x49282a){_0x1b59ec=_0x49282a;return db[_0x7100('0x48')][_0x7100('0x31')]({'where':{'id':0x1},'attributes':[_0x7100('0x49'),_0x7100('0x4a')],'raw':!![]});})[_0x7100('0x34')](function(_0x4eec90){if(!_0x1b59ec||!_[_0x7100('0x4b')](_0x1b59ec['apiKeyNonce'],_0x42b429[_0x7100('0x4c')])){return _0x2e493e['status'](0x191)[_0x7100('0x37')]({'message':_0x7100('0x4d')});}if(_0x1b59ec[_0x7100('0x4e')]){return _0x2e493e[_0x7100('0x35')](0x191)[_0x7100('0x37')]({'message':_0x7100('0x4f')});}if(_0x1b59ec[_0x7100('0x50')]){if(_0x4eec90[_0x7100('0x4a')]>0x0){if(moment(_0x1b59ec[_0x7100('0x51')])[_0x7100('0x52')](_0x4eec90['blockDuration'],'minutes')>moment()){return _0x2e493e[_0x7100('0x35')](0x191)[_0x7100('0x37')]({'message':_0x7100('0x4f')});}}else{return _0x2e493e[_0x7100('0x35')](0x191)[_0x7100('0x37')]({'message':_0x7100('0x4f')});}}_0x42405a[_0x7100('0x30')]={'id':_0x1b59ec['id']};_0x5192bb();});})[_0x7100('0x53')](function(){return _0x2e493e['status'](0x191)['json']({'message':_0x7100('0x4f')});});}catch(_0x7b77e5){_0x5192bb(_0x7b77e5);}}else if(_0x5cd83e){_0x5192bb();}else{return _0x2e493e[_0x7100('0x35')](0x193)[_0x7100('0x37')]({'message':_0x7100('0x43')});}})[_0x7100('0x2f')](function(_0x2b0b45,_0x2279b7,_0x5506c7){if(_0x2b0b45[_0x7100('0x30')]){db[_0x7100('0x3e')][_0x7100('0x3f')]({'where':{'id':_0x2b0b45['user']['id']},'attributes':userAttributes})[_0x7100('0x34')](function(_0x20a6fd){if(!_0x20a6fd){return _0x2279b7[_0x7100('0x35')](0x194)[_0x7100('0x37')]({'message':_0x7100('0x54')});}_0x2b0b45[_0x7100('0x30')]=_0x20a6fd;_0x5506c7();})[_0x7100('0x53')](function(_0x1fa271){_0x5506c7(_0x1fa271);});}else if(_0x5cd83e){_0x5506c7();}else{return _0x2279b7[_0x7100('0x35')](0x194)[_0x7100('0x37')]({'message':_0x7100('0x55')});}});};exports['canUpdate']=function canUpdate(){return compose()[_0x7100('0x2f')](function(_0x26f30a,_0xef321e,_0x10e08f){return licenseUtil[_0x7100('0x56')]()[_0x7100('0x34')](function(_0x16c417){if(_0x16c417[_0x7100('0x57')]){_0x10e08f();}else{return _0xef321e[_0x7100('0x35')](0x193)[_0x7100('0x37')]({'message':_0x7100('0x58')});}})[_0x7100('0x53')](function(_0x43258c){_0x10e08f(_0x43258c);});});};exports['isMiddleware']=function(_0x21975d,_0x458d0b,_0xa7bf82){_0x21975d['isMiddleware']=!![];return _0xa7bf82();};exports[_0x7100('0x59')]=function signToken(_0x4c8fbf){return signJwt(_0x4c8fbf);};exports[_0x7100('0x5a')]=function(_0x212651,_0x516011){if(!_0x212651[_0x7100('0x30')]){return _0x516011['status'](0x194)['json']({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x1bfd7e={'payload':{'id':_0x212651['user']['id'],'role':_0x212651[_0x7100('0x30')][_0x7100('0xd')]},'options':{'expiresIn':0x15180}};return signJwt(_0x1bfd7e)[_0x7100('0x34')](function(_0xafad38){_0x516011[_0x7100('0x5b')](_0x7100('0x5c'),_0xafad38);_0x516011[_0x7100('0x5d')]('/dashboards/general');})[_0x7100('0x53')](function(_0x27e541){return _0x516011[_0x7100('0x35')](0x1f4)[_0x7100('0x5e')](_0x27e541);});};exports[_0x7100('0x5f')]=function(_0x4fbd7b){if(_[_0x7100('0x60')](_0x4fbd7b[_0x7100('0x61')])||_['isNil'](_0x4fbd7b[_0x7100('0x62')])){return null;}else{return createJwt(_0x4fbd7b);}};exports[_0x7100('0x63')]=function(_0xc202cb){_0xc202cb[_0x7100('0x61')]=generateNonce();_0xc202cb[_0x7100('0x62')]=generateIssuedAt();return createJwt(_0xc202cb);};exports[_0x7100('0x64')]=function(_0x52bda0,_0x5232fa){var _0x290fb4=_0x52bda0['query'][_0x7100('0x46')];if(_0x290fb4){var _0x4a273f={'nonce':_0x5232fa[_0x7100('0x61')],'iat':_0x5232fa[_0x7100('0x62')],'audience':hardwareConf[_0x7100('0x45')](),'issuer':hardwareConf[_0x7100('0x45')]()};return verifyJwt(_0x290fb4,_0x4a273f)[_0x7100('0x34')](function(){return generateApiKey(_0x5232fa);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports[_0x7100('0x65')]=function(_0x417fe4){var _0x3b071d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x3b071d[_0x7100('0x66')](_0x417fe4))throw new db['Sequelize'][(_0x7100('0x67'))](_0x7100('0x68'));return;};exports[_0x7100('0x69')]=function(_0x1cc103,_0x4717be,_0x451e39){var _0x4e2e40=encryptor['decryptString'](_0x4717be)[_0x7100('0x6a')](',');for(var _0x5067ee=0x0;_0x5067ee<_0x451e39;_0x5067ee++){if(!_0x4e2e40[_0x5067ee])break;if(_0x1cc103['toLowerCase']()===_0x4e2e40[_0x5067ee]['toLowerCase']()){var _0x5b8160=util[_0x7100('0x6b')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x451e39);if(_0x451e39===0x1){_0x5b8160=_0x7100('0x6c');}throw new db['Sequelize']['ValidationError'](_0x5b8160);}}return;};exports[_0x7100('0x6d')]=function(_0x189437,_0x19c2e6){var _0x14d45a=_0x19c2e6?encryptor['decryptString'](_0x19c2e6)['split'](','):[];if(_0x14d45a[_0x7100('0x6e')]===0x5){_0x14d45a[_0x7100('0x6f')](-0x1,0x1);}_0x14d45a[_0x7100('0x70')](_0x189437);return encryptor[_0x7100('0x71')](_0x14d45a[_0x7100('0x72')](','));};function signJwt(_0x1b2b21){var _0x3fca41=BPromise[_0x7100('0x73')](jwt[_0x7100('0x74')],{'context':jwt});var _0x3e112c=_0x1b2b21[_0x7100('0x75')]||config[_0x7100('0xb')][_0x7100('0xc')];return new BPromise(function(_0x4a8115,_0x29fa06){_0x3fca41(_0x1b2b21[_0x7100('0x76')],_0x3e112c,_0x1b2b21[_0x7100('0x77')])[_0x7100('0x34')](function(_0x4d97f5){_0x4a8115(_0x4d97f5);})[_0x7100('0x53')](function(_0x25d354){_0x29fa06(_0x25d354);});});}function verifyJwt(_0x3671be,_0x24b288,_0xbc11e7){var _0x27f95e=BPromise[_0x7100('0x73')](jwt['verify'],{'context':jwt});var _0x5691d8=_0xbc11e7||config[_0x7100('0xb')][_0x7100('0xc')];return new BPromise(function(_0x10eed9,_0x3690d9){_0x27f95e(_0x3671be,_0x5691d8,_0x24b288)[_0x7100('0x34')](function(_0x3b3d1d){_0x10eed9(_0x3b3d1d);})[_0x7100('0x53')](function(_0x529292){_0x3690d9(_0x529292);});});}function generateNonce(){return crypto[_0x7100('0x78')](0x10)[_0x7100('0x79')]('hex');}function generateIssuedAt(){return Math[_0x7100('0x7a')](Date['now']()/0x3e8)[_0x7100('0x79')]();}function createJwt(_0x1b6fb7){var _0x312235={'payload':{'iat':_0x1b6fb7[_0x7100('0x62')],'nonce':_0x1b6fb7['apiKeyNonce']},'options':{'algorithm':_0x7100('0x7b'),'subject':_0x1b6fb7['id']['toString'](),'issuer':hardwareConf[_0x7100('0x45')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x312235)['then'](function(_0x3cbce5){return{'iat':_0x1b6fb7[_0x7100('0x62')],'nonce':_0x1b6fb7['apiKeyNonce'],'token':_0x3cbce5};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 4098a00..76671ed 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 _0xb64a=['secrets','aes-256-ctr','aes192','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','update','binary','write','end','close','unlink','decryptFile','createDecipher','encryptString','secret','utf8','base64','final','bluebird','lodash','../../config/environment','../../config/logger','app'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xb64a,0xf0));var _0xab64=function(_0x5d3de4,_0x1da281){_0x5d3de4=_0x5d3de4-0x0;var _0x10d032=_0xb64a[_0x5d3de4];return _0x10d032;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0xab64('0x0'));var _=require(_0xab64('0x1'));var config=require(_0xab64('0x2'));var logger=require(_0xab64('0x3'))(_0xab64('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xab64('0x5')]['session'],'algorithm':_0xab64('0x6')};const fileOptions={'algorithm':_0xab64('0x7')};if(config[_0xab64('0x8')]&&config[_0xab64('0x8')][_0xab64('0x9')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0xab64('0x9')]);if(isSupported){fileOptions['algorithm']=config['encrypt'][_0xab64('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xab64('0xa')](',\x20');logger['error'](config[_0xab64('0x8')][_0xab64('0x9')],_0xab64('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x399233){return AES_SUPPORTED_RX[_0xab64('0xc')](_0x399233);}function getSupportedCiphers(){return crypto[_0xab64('0xd')]()[_0xab64('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0x236b91){return getSupportedCiphers()[_0xab64('0xf')](_0x236b91)>-0x1;}function combineOptions(_0x418bb1){var _0x1e8e69={};for(var _0x524cf6 in fileOptions){if(fileOptions[_0xab64('0x10')](_0x524cf6)){_0x1e8e69[_0x524cf6]=fileOptions[_0x524cf6];}}if(_0x418bb1){for(var _0x3ce280 in _0x418bb1){if(_0x418bb1[_0xab64('0x10')](_0x3ce280)){_0x1e8e69[_0x3ce280]=_0x418bb1[_0x3ce280];}}}return _0x1e8e69;}exports[_0xab64('0x11')]=function(_0x12313e,_0x3af153,_0x856b53,_0x188304){return new BPromise(function(_0x39ad63,_0x44fdb3){_0x188304=combineOptions(_0x188304);var _0x2f0414=new Buffer(_0x856b53);var _0x536464=fs[_0xab64('0x12')](_0x12313e);var _0x289114=fs[_0xab64('0x13')](_0x3af153);var _0x218909=crypto[_0xab64('0x14')](_0x188304[_0xab64('0x9')],_0x2f0414);_0x536464['on'](_0xab64('0x15'),function(_0x13b324){var _0x586244=new Buffer(_0x218909[_0xab64('0x16')](_0x13b324),_0xab64('0x17'));_0x289114[_0xab64('0x18')](_0x586244);});_0x536464['on'](_0xab64('0x19'),function(){try{var _0x1f8187=new Buffer(_0x218909['final'](_0xab64('0x17')),_0xab64('0x17'));_0x289114['write'](_0x1f8187);_0x289114[_0xab64('0x19')]();_0x289114['on'](_0xab64('0x1a'),function(){return _0x39ad63(_0x3af153);});}catch(_0x40f2cc){fs[_0xab64('0x1b')](_0x3af153);return _0x44fdb3(_0x40f2cc);}});});};exports[_0xab64('0x1c')]=function(_0xe19ea6,_0xaf9138,_0x330680,_0x461095){return new BPromise(function(_0xb4b5e4,_0x1c64f6){_0x461095=combineOptions(_0x461095);var _0x1f2c30=new Buffer(_0x330680);var _0x45fbbc=fs[_0xab64('0x12')](_0xe19ea6);var _0x39212d=fs[_0xab64('0x13')](_0xaf9138);var _0x463269=crypto[_0xab64('0x1d')](_0x461095[_0xab64('0x9')],_0x1f2c30);_0x45fbbc['on'](_0xab64('0x15'),function(_0x1e7e5b){var _0x2c6ef5=new Buffer(_0x463269[_0xab64('0x16')](_0x1e7e5b),'binary');_0x39212d[_0xab64('0x18')](_0x2c6ef5);});_0x45fbbc['on'](_0xab64('0x19'),function(){try{var _0x594570=new Buffer(_0x463269['final'](_0xab64('0x17')),'binary');_0x39212d['write'](_0x594570);_0x39212d[_0xab64('0x19')]();_0x39212d['on']('close',function(){return _0xb4b5e4(_0xaf9138);});}catch(_0x17a871){fs[_0xab64('0x1b')](_0xaf9138);return _0x1c64f6(_0x17a871);}});});};exports[_0xab64('0x1e')]=function(_0x2bc9ea,_0x1d981f,_0x4c849d){var _0x6af4d9=_0x4c849d||stringOptions[_0xab64('0x9')];var _0x40fd68=_0x1d981f||stringOptions[_0xab64('0x1f')];var _0x2897f2=crypto[_0xab64('0x14')](_0x6af4d9,_0x40fd68);var _0xa7a679=_0x2897f2[_0xab64('0x16')](_0x2bc9ea,_0xab64('0x20'),_0xab64('0x21'));_0xa7a679+=_0x2897f2[_0xab64('0x22')](_0xab64('0x21'));return _0xa7a679;};exports['decryptString']=function(_0x48e274,_0x9135c7,_0x4a2b90){var _0x5a31d7=_0x4a2b90||stringOptions[_0xab64('0x9')];var _0x57a4e1=_0x9135c7||stringOptions[_0xab64('0x1f')];var _0x208236=crypto[_0xab64('0x1d')](_0x5a31d7,_0x57a4e1);var _0x396a6c=_0x208236[_0xab64('0x16')](_0x48e274,'base64',_0xab64('0x20'));_0x396a6c+=_0x208236[_0xab64('0x22')](_0xab64('0x20'));return _0x396a6c;}; \ No newline at end of file +var _0xa657=['is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','getCiphers','indexOf','hasOwnProperty','createReadStream','createCipher','data','update','write','end','final','binary','close','unlink','decryptFile','createWriteStream','createDecipher','encryptString','secret','utf8','base64','bluebird','lodash','../../config/environment','../../config/logger','secrets','session','encrypt','algorithm','error'];(function(_0xea4dda,_0x23e21c){var _0x20d219=function(_0x148d68){while(--_0x148d68){_0xea4dda['push'](_0xea4dda['shift']());}};_0x20d219(++_0x23e21c);}(_0xa657,0x17d));var _0x7a65=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa657[_0x3dd15e];return _0x231fd0;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x7a65('0x0'));var _=require(_0x7a65('0x1'));var config=require(_0x7a65('0x2'));var logger=require(_0x7a65('0x3'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x7a65('0x4')][_0x7a65('0x5')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':'aes192'};if(config['encrypt']&&config[_0x7a65('0x6')][_0x7a65('0x7')]){var isSupported=isAlgorithmSupported(config['encrypt']['algorithm']);if(isSupported){fileOptions[_0x7a65('0x7')]=config[_0x7a65('0x6')][_0x7a65('0x7')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0x7a65('0x8')](config[_0x7a65('0x6')]['algorithm'],_0x7a65('0x9'),supportedAlgorithms);}}function isASupportedCipher(_0x26968a){return AES_SUPPORTED_RX['test'](_0x26968a);}function getSupportedCiphers(){return crypto[_0x7a65('0xa')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x1a9552){return getSupportedCiphers()[_0x7a65('0xb')](_0x1a9552)>-0x1;}function combineOptions(_0x29ad8f){var _0x4e4c80={};for(var _0x31cd9 in fileOptions){if(fileOptions[_0x7a65('0xc')](_0x31cd9)){_0x4e4c80[_0x31cd9]=fileOptions[_0x31cd9];}}if(_0x29ad8f){for(var _0x1c177a in _0x29ad8f){if(_0x29ad8f[_0x7a65('0xc')](_0x1c177a)){_0x4e4c80[_0x1c177a]=_0x29ad8f[_0x1c177a];}}}return _0x4e4c80;}exports['encryptFile']=function(_0xf6b02f,_0x2826a2,_0x383220,_0x47d9c4){return new BPromise(function(_0xccd4c2,_0x5d253b){_0x47d9c4=combineOptions(_0x47d9c4);var _0x25317f=new Buffer(_0x383220);var _0x9bf2a2=fs[_0x7a65('0xd')](_0xf6b02f);var _0x51e719=fs['createWriteStream'](_0x2826a2);var _0x2227ef=crypto[_0x7a65('0xe')](_0x47d9c4[_0x7a65('0x7')],_0x25317f);_0x9bf2a2['on'](_0x7a65('0xf'),function(_0x58e2b2){var _0x4da995=new Buffer(_0x2227ef[_0x7a65('0x10')](_0x58e2b2),'binary');_0x51e719[_0x7a65('0x11')](_0x4da995);});_0x9bf2a2['on'](_0x7a65('0x12'),function(){try{var _0x4aae46=new Buffer(_0x2227ef[_0x7a65('0x13')]('binary'),_0x7a65('0x14'));_0x51e719['write'](_0x4aae46);_0x51e719['end']();_0x51e719['on'](_0x7a65('0x15'),function(){return _0xccd4c2(_0x2826a2);});}catch(_0x5b90b3){fs[_0x7a65('0x16')](_0x2826a2);return _0x5d253b(_0x5b90b3);}});});};exports[_0x7a65('0x17')]=function(_0x341a0b,_0x33ebb1,_0x372d1e,_0x355310){return new BPromise(function(_0x216c2c,_0x224bc0){_0x355310=combineOptions(_0x355310);var _0x41f697=new Buffer(_0x372d1e);var _0x2906e6=fs[_0x7a65('0xd')](_0x341a0b);var _0x5ddbc7=fs[_0x7a65('0x18')](_0x33ebb1);var _0x3a84a6=crypto[_0x7a65('0x19')](_0x355310[_0x7a65('0x7')],_0x41f697);_0x2906e6['on']('data',function(_0xf6aff6){var _0x522372=new Buffer(_0x3a84a6['update'](_0xf6aff6),_0x7a65('0x14'));_0x5ddbc7[_0x7a65('0x11')](_0x522372);});_0x2906e6['on'](_0x7a65('0x12'),function(){try{var _0x916a35=new Buffer(_0x3a84a6[_0x7a65('0x13')](_0x7a65('0x14')),_0x7a65('0x14'));_0x5ddbc7[_0x7a65('0x11')](_0x916a35);_0x5ddbc7['end']();_0x5ddbc7['on'](_0x7a65('0x15'),function(){return _0x216c2c(_0x33ebb1);});}catch(_0x501480){fs['unlink'](_0x33ebb1);return _0x224bc0(_0x501480);}});});};exports[_0x7a65('0x1a')]=function(_0x1739b5,_0x36c626,_0x1dbe96){var _0x56aefd=_0x1dbe96||stringOptions[_0x7a65('0x7')];var _0x220595=_0x36c626||stringOptions[_0x7a65('0x1b')];var _0x199278=crypto[_0x7a65('0xe')](_0x56aefd,_0x220595);var _0x3b01dd=_0x199278['update'](_0x1739b5,_0x7a65('0x1c'),'base64');_0x3b01dd+=_0x199278[_0x7a65('0x13')]('base64');return _0x3b01dd;};exports['decryptString']=function(_0x392e2c,_0x560443,_0x308b9a){var _0x1d1562=_0x308b9a||stringOptions[_0x7a65('0x7')];var _0xe1a1f=_0x560443||stringOptions[_0x7a65('0x1b')];var _0x6ba311=crypto[_0x7a65('0x19')](_0x1d1562,_0xe1a1f);var _0x207c7a=_0x6ba311[_0x7a65('0x10')](_0x392e2c,_0x7a65('0x1d'),_0x7a65('0x1c'));_0x207c7a+=_0x6ba311[_0x7a65('0x13')](_0x7a65('0x1c'));return _0x207c7a;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 4cf43e7..26d4c37 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 _0x693f=['%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','existsSync','join','mkdirSync','%s%d.%s','%s.%s','csv','writeFileSync','zip','info','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit','util','path','lodash','to-csv','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','format','CSV','Setting','find','split','splitSizeCsv','then','query','QueryTypes','SELECT','num','length','push','sequelize'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x693f,0x9d));var _0xf693=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x693f[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0xf693('0x0'));var path=require(_0xf693('0x1'));var _=require(_0xf693('0x2'));var csv=require(_0xf693('0x3'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0xf693('0x4'));var rimraf=require(_0xf693('0x5'));var db=require(_0xf693('0x6'))['db'];var dbH=require(_0xf693('0x6'))[_0xf693('0x7')];var logger=require(_0xf693('0x8'))(_0xf693('0x9'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xf693('0xa')][0x3];var PATH=process[_0xf693('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x5b91c5,_0x22f362){var _0x594505={'status':_0x5b91c5};var _0x38e78a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x22f362){_0x594505['savename']=_0x22f362;}return db[_0xf693('0xb')][_0xf693('0xc')](_0x594505,_0x38e78a);}function main(){var _0x48984a=0x1388;var _0x4b09d6;logger['info'](util[_0xf693('0xd')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xf693('0xe')));return db[_0xf693('0xf')][_0xf693('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xf693('0x11'),_0xf693('0x12')]})['then'](function(_0x5d0d4c){if(_0x5d0d4c){_0x4b09d6=_0x5d0d4c;_0x48984a=_0x4b09d6[_0xf693('0x12')]||0x1388;}})[_0xf693('0x13')](function(){return dbH['sequelize'][_0xf693('0x14')](util[_0xf693('0xd')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize'][_0xf693('0x15')][_0xf693('0x16')]});})[_0xf693('0x13')](function(_0x208f32){if(!_0x208f32[0x0][_0xf693('0x17')]){return analyticExtractedReport('Empty');}var _0x1d9278=[];var _0x1c0dfc=0x0;var _0x3c8084=!![];if(_0x208f32&&_0x208f32[_0xf693('0x18')]){var _0x345539=_0x208f32[0x0][_0xf693('0x17')]%(_0x1c0dfc+_0x48984a);if(_0x4b09d6['split']){for(;_0x3c8084;_0x1c0dfc+=_0x48984a,_0x345539=_0x208f32[0x0]['num']%(_0x1c0dfc+_0x48984a)){if(_0x345539==0x0||_0x345539==_0x208f32[0x0]['num']){_0x3c8084=![];}_0x1d9278[_0xf693('0x19')](dbH[_0xf693('0x1a')][_0xf693('0x14')](util[_0xf693('0xd')](_0xf693('0x1b'),QUERY,_0x48984a,_0x1c0dfc),{'type':dbH['sequelize'][_0xf693('0x15')][_0xf693('0x16')]}));}}else{_0x1d9278[_0xf693('0x19')](dbH[_0xf693('0x1a')][_0xf693('0x14')](QUERY,{'type':dbH[_0xf693('0x1a')][_0xf693('0x15')][_0xf693('0x16')]}));}}var _0x50b20e=path[_0xf693('0x1c')](PATH);var _0x1188c6=path[_0xf693('0x1d')](PATH,_0xf693('0x1e'));var _0x400398=_0x4b09d6[_0xf693('0x11')]&&_0x1d9278[_0xf693('0x18')]>0x1;var _0x5407f5=[];if(!fs[_0xf693('0x1f')](path[_0xf693('0x20')](_0x50b20e,_0x1188c6))&&_0x400398){fs[_0xf693('0x21')](path[_0xf693('0x20')](_0x50b20e,_0x1188c6));}return BPromise['each'](_0x1d9278,function(_0x950632){_0x5407f5[_0xf693('0x19')](_0x950632);})[_0xf693('0x13')](function(){for(var _0x2245af=0x0;_0x2245af<_0x5407f5[_0xf693('0x18')];_0x2245af+=0x1){var _0xbbbf29;var _0x1c6ff2=_0x5407f5[_0x2245af];if(_0x400398){_0xbbbf29=path[_0xf693('0x20')](_0x50b20e,_0x1188c6,util[_0xf693('0xd')](_0xf693('0x22'),_0x1188c6,_0x2245af,'csv'));}else{_0xbbbf29=path[_0xf693('0x20')](_0x50b20e,util[_0xf693('0xd')](_0xf693('0x23'),_0x1188c6,_0xf693('0x24')));}fs[_0xf693('0x25')](_0xbbbf29,csv(_0x1c6ff2));}})[_0xf693('0x13')](function(){if(_0x400398){zipdir(path[_0xf693('0x20')](_0x50b20e,_0x1188c6),{'saveTo':path[_0xf693('0x20')](_0x50b20e,util['format'](_0xf693('0x23'),_0x1188c6,_0xf693('0x26')))},function(_0x3580c5,_0x19b4dc){});rimraf(path['join'](_0x50b20e,_0x1188c6),function(){});}})['then'](function(){logger[_0xf693('0x27')](util[_0xf693('0xd')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xf693('0xe')));return analyticExtractedReport(_0xf693('0x28'),_0x400398?util[_0xf693('0xd')](_0xf693('0x23'),_0x1188c6,_0x400398?'zip':_0xf693('0x24')):null);});})[_0xf693('0x29')](function(_0xa9b406){logger[_0xf693('0x27')](util[_0xf693('0xd')](_0xf693('0x2a'),EXTRACTED_REPORT_ID,_0xf693('0xe')),util[_0xf693('0x2b')](_0xa9b406,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xf693('0x2c')](function(){process[_0xf693('0x2d')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x2504=['mkdirSync','each','%s%d.%s','csv','%s.%s','writeFileSync','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','info','format','CSV','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','push','SELECT','dirname','basename','length','join'];(function(_0x441400,_0x450981){var _0xe93d27=function(_0x5a2196){while(--_0x5a2196){_0x441400['push'](_0x441400['shift']());}};_0xe93d27(++_0x450981);}(_0x2504,0xee));var _0x4250=function(_0x2fd0a9,_0x19f19a){_0x2fd0a9=_0x2fd0a9-0x0;var _0x5eaca1=_0x2504[_0x2fd0a9];return _0x5eaca1;};'use strict';var util=require(_0x4250('0x0'));var path=require(_0x4250('0x1'));var _=require(_0x4250('0x2'));var csv=require(_0x4250('0x3'));var fs=require('fs');var BPromise=require(_0x4250('0x4'));var zipdir=require(_0x4250('0x5'));var rimraf=require(_0x4250('0x6'));var db=require(_0x4250('0x7'))['db'];var dbH=require(_0x4250('0x7'))[_0x4250('0x8')];var logger=require(_0x4250('0x9'))(_0x4250('0xa'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x4250('0xb')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x5a5286,_0x370998){var _0x477312={'status':_0x5a5286};var _0x1a3b57={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x370998){_0x477312[_0x4250('0xc')]=_0x370998;}return db[_0x4250('0xd')]['update'](_0x477312,_0x1a3b57);}function main(){var _0x1016b9=0x1388;var _0x49bf26;logger[_0x4250('0xe')](util[_0x4250('0xf')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x4250('0x10')));return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x4250('0x11'),_0x4250('0x12')]})[_0x4250('0x13')](function(_0x3c1e7e){if(_0x3c1e7e){_0x49bf26=_0x3c1e7e;_0x1016b9=_0x49bf26[_0x4250('0x12')]||0x1388;}})['then'](function(){return dbH[_0x4250('0x14')][_0x4250('0x15')](util[_0x4250('0xf')](_0x4250('0x16'),QUERY),{'type':dbH[_0x4250('0x14')][_0x4250('0x17')]['SELECT']});})[_0x4250('0x13')](function(_0x46ba15){if(!_0x46ba15[0x0][_0x4250('0x18')]){return analyticExtractedReport(_0x4250('0x19'));}var _0x2979cd=[];var _0x9907b4=0x0;var _0x3d9a6d=!![];if(_0x46ba15&&_0x46ba15['length']){var _0x69aabe=_0x46ba15[0x0][_0x4250('0x18')]%(_0x9907b4+_0x1016b9);if(_0x49bf26[_0x4250('0x11')]){for(;_0x3d9a6d;_0x9907b4+=_0x1016b9,_0x69aabe=_0x46ba15[0x0][_0x4250('0x18')]%(_0x9907b4+_0x1016b9)){if(_0x69aabe==0x0||_0x69aabe==_0x46ba15[0x0][_0x4250('0x18')]){_0x3d9a6d=![];}_0x2979cd[_0x4250('0x1a')](dbH[_0x4250('0x14')]['query'](util[_0x4250('0xf')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1016b9,_0x9907b4),{'type':dbH['sequelize'][_0x4250('0x17')][_0x4250('0x1b')]}));}}else{_0x2979cd[_0x4250('0x1a')](dbH[_0x4250('0x14')][_0x4250('0x15')](QUERY,{'type':dbH[_0x4250('0x14')][_0x4250('0x17')][_0x4250('0x1b')]}));}}var _0x309745=path[_0x4250('0x1c')](PATH);var _0x728862=path[_0x4250('0x1d')](PATH,'.csv');var _0x1fb26e=_0x49bf26[_0x4250('0x11')]&&_0x2979cd[_0x4250('0x1e')]>0x1;var _0x523053=[];if(!fs['existsSync'](path[_0x4250('0x1f')](_0x309745,_0x728862))&&_0x1fb26e){fs[_0x4250('0x20')](path[_0x4250('0x1f')](_0x309745,_0x728862));}return BPromise[_0x4250('0x21')](_0x2979cd,function(_0x328ffb){_0x523053['push'](_0x328ffb);})[_0x4250('0x13')](function(){for(var _0x24169c=0x0;_0x24169c<_0x523053[_0x4250('0x1e')];_0x24169c+=0x1){var _0x559d06;var _0x5b155e=_0x523053[_0x24169c];if(_0x1fb26e){_0x559d06=path[_0x4250('0x1f')](_0x309745,_0x728862,util['format'](_0x4250('0x22'),_0x728862,_0x24169c,_0x4250('0x23')));}else{_0x559d06=path[_0x4250('0x1f')](_0x309745,util[_0x4250('0xf')](_0x4250('0x24'),_0x728862,'csv'));}fs[_0x4250('0x25')](_0x559d06,csv(_0x5b155e));}})[_0x4250('0x13')](function(){if(_0x1fb26e){zipdir(path['join'](_0x309745,_0x728862),{'saveTo':path[_0x4250('0x1f')](_0x309745,util['format'](_0x4250('0x24'),_0x728862,'zip'))},function(_0x5e0fe6,_0xea7ccc){});rimraf(path['join'](_0x309745,_0x728862),function(){});}})[_0x4250('0x13')](function(){logger[_0x4250('0xe')](util['format'](_0x4250('0x26'),EXTRACTED_REPORT_ID,_0x4250('0x10')));return analyticExtractedReport('Completed',_0x1fb26e?util[_0x4250('0xf')](_0x4250('0x24'),_0x728862,_0x1fb26e?'zip':_0x4250('0x23')):null);});})[_0x4250('0x27')](function(_0x11ea78){logger[_0x4250('0xe')](util[_0x4250('0xf')](_0x4250('0x28'),EXTRACTED_REPORT_ID,_0x4250('0x10')),util[_0x4250('0x29')](_0x11ea78,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x4250('0x2a'));})[_0x4250('0x2b')](function(){process[_0x4250('0x2c')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 3a513ea..4f22c74 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 _0xf747=['%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','createWriteStream','finish','error','end','createPdfFromHTML','path','lodash','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','jsdom','JSDOM','window','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','map','tableHeader','pick','toString','value','fill','length','auto','body','push','concat','chunk','keys','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','landscape','\x20/\x20','footer','Arial','black','right','num','Empty','dirname','basename','.pdf','join','%s.%s','pdf','Setting','find','split','then','splitSizePdf','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','QueryTypes','SELECT','query','existsSync','mkdirSync','flatten','createPdfKitDocument','%s%d.%s','zip','CSV','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','info','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf'];(function(_0xda4a3f,_0x3c73ef){var _0x1b84c9=function(_0x50087c){while(--_0x50087c){_0xda4a3f['push'](_0xda4a3f['shift']());}};_0x1b84c9(++_0x3c73ef);}(_0xf747,0x181));var _0x7f74=function(_0x473a62,_0x394331){_0x473a62=_0x473a62-0x0;var _0x5812bf=_0xf747[_0x473a62];return _0x5812bf;};'use strict';var _=require(_0x7f74('0x0'));var fs=require('fs');var util=require('util');var path=require('path');var moment=require(_0x7f74('0x1'));var htmlToPdfmake=require(_0x7f74('0x2'));var PdfPrinter=require(_0x7f74('0x3'));var zipdir=require(_0x7f74('0x4'));var rimraf=require('rimraf');var JSDOM=require(_0x7f74('0x5'))[_0x7f74('0x6')];var window=new JSDOM('')[_0x7f74('0x7')];var db=require('../../mysqldb')['db'];var dbH=require(_0x7f74('0x8'))[_0x7f74('0x9')];var logger=require(_0x7f74('0xa'))(_0x7f74('0xb'));var EXTRACTED_REPORT_ID=Number(process[_0x7f74('0xc')][0x2]);var QUERY=process[_0x7f74('0xc')][0x3];var PATH=process[_0x7f74('0xc')][0x4];var NAME=process[_0x7f74('0xc')][0x5];var FORMAT=_0x7f74('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x24d213,_0x2efb7b){var _0x44fb80={'status':_0x24d213};var _0x5d1502={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2efb7b){_0x44fb80[_0x7f74('0xe')]=_0x2efb7b;}return db[_0x7f74('0xf')]['update'](_0x44fb80,_0x5d1502);}function getHeaders(_0x63582f){return _[_0x7f74('0x10')](_0x63582f,function(_0x19c6b0){return{'text':_0x19c6b0,'style':_0x7f74('0x11')};});}function getRows(_0x404e2f,_0x2a0b1b){return _[_0x7f74('0x10')](_0x2a0b1b,function(_0x3d5fbb){return _(_0x3d5fbb)[_0x7f74('0x12')](_0x404e2f)['map'](function(_0x5b6af3){return _0x5b6af3?_[_0x7f74('0x13')](_0x5b6af3):'';})[_0x7f74('0x14')]();});}function createTable(_0x2cc9f2,_0x459a9d){var _0xd40f3b={'widths':_[_0x7f74('0x15')](Array(_0x2cc9f2[_0x7f74('0x16')]),0x91),'heights':function(_0x5dee4c){return _0x5dee4c===0x0?_0x7f74('0x17'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x1ad7a6=getHeaders(_0x2cc9f2);_0xd40f3b[_0x7f74('0x18')][_0x7f74('0x19')](_0x1ad7a6);var _0x294a41=getRows(_0x2cc9f2,_0x459a9d);_0xd40f3b[_0x7f74('0x18')]=_0xd40f3b[_0x7f74('0x18')][_0x7f74('0x1a')](_0x294a41);return _0xd40f3b;}function createTables(_0x31230f){var _0xa9ca25=[];var _0x4d729f=_[_0x7f74('0x1b')](Object[_0x7f74('0x1c')](_0x31230f[0x0]),0x5);_0x4d729f['forEach'](function(_0x15403f){_0xa9ca25[_0x7f74('0x19')](createTable(_0x15403f,_0x31230f));});return _0xa9ca25;}function getPDFDocDefinition(_0xe50bbe){var _0x4c6112=util[_0x7f74('0x1d')](_0x7f74('0x1e'),NAME,EXTRACTED_REPORT[_0x7f74('0x1f')],moment(EXTRACTED_REPORT[_0x7f74('0x20')])[_0x7f74('0x1d')](FORMAT),moment(EXTRACTED_REPORT[_0x7f74('0x21')])[_0x7f74('0x1d')](FORMAT));var _0xfa3173=[];for(var _0x2cd644=0x0;_0x2cd644<_0xe50bbe[_0x7f74('0x16')];_0x2cd644++){var _0x3759e1=[];if(_0x2cd644===0x0){_0x3759e1[_0x7f74('0x19')]({'text':_0x4c6112,'style':_0x7f74('0x22')});}var _0x219f7c={'table':_0xe50bbe[_0x2cd644]};if(_0x2cd644>0x0){_0x219f7c['pageBreak']='before';_0x219f7c['margin']=[0x0,0x46,0x0,0x0];}_0x3759e1[_0x7f74('0x19')](_0x219f7c);_0xfa3173[_0x7f74('0x19')](_0x3759e1);}return{'pageSize':'A4','pageOrientation':_0x7f74('0x23'),'content':_0xfa3173,'footer':function(_0x557081,_0x4571a6){return{'text':_0x557081[_0x7f74('0x13')]()+_0x7f74('0x24')+_0x4571a6,'style':_0x7f74('0x25')};},'defaultStyle':{'font':_0x7f74('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x7f74('0x27')},'footer':{'alignment':_0x7f74('0x28'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x59b8e8){var _0x774fb3=0x1388;var _0x12b761;if(!_0x59b8e8[0x0][_0x7f74('0x29')]){return analyticExtractedReport(_0x7f74('0x2a'));}var _0x248617=[];var _0xc4b139=0x0;var _0x33b138=!![];var _0x27cbe0=path[_0x7f74('0x2b')](PATH);var _0x2caf66=path[_0x7f74('0x2c')](PATH,_0x7f74('0x2d'));var _0x17181f=path[_0x7f74('0x2e')](_0x27cbe0,util['format'](_0x7f74('0x2f'),_0x2caf66,_0x7f74('0x30')));var _0xfe5192=![];return db[_0x7f74('0x31')][_0x7f74('0x32')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x7f74('0x33'),'splitSizePdf']})[_0x7f74('0x34')](function(_0x2e3462){if(_0x2e3462){_0x12b761=_0x2e3462;_0x774fb3=_0x12b761[_0x7f74('0x35')]||0x3e8;}})[_0x7f74('0x34')](function(){if(_0x59b8e8&&_0x59b8e8['length']){var _0x2a3b60=_0x59b8e8[0x0][_0x7f74('0x29')]%(_0xc4b139+_0x774fb3);if(_0x12b761[_0x7f74('0x33')]){for(;_0x33b138;_0xc4b139+=_0x774fb3,_0x2a3b60=_0x59b8e8[0x0][_0x7f74('0x29')]%(_0xc4b139+_0x774fb3)){if(_0x2a3b60==0x0||_0x2a3b60==_0x59b8e8[0x0][_0x7f74('0x29')]){_0x33b138=![];}_0x248617['push'](dbH['sequelize']['query'](util[_0x7f74('0x1d')](_0x7f74('0x36'),QUERY,_0x774fb3,_0xc4b139),{'type':dbH[_0x7f74('0x37')][_0x7f74('0x38')][_0x7f74('0x39')]}));}}else{_0x248617['push'](dbH['sequelize'][_0x7f74('0x3a')](QUERY,{'type':dbH['sequelize'][_0x7f74('0x38')][_0x7f74('0x39')]}));}}_0xfe5192=_0x12b761['split']&&_0x248617[_0x7f74('0x16')]>0x1;if(!fs[_0x7f74('0x3b')](path[_0x7f74('0x2e')](_0x27cbe0,_0x2caf66))&&_0xfe5192){fs[_0x7f74('0x3c')](path[_0x7f74('0x2e')](_0x27cbe0,_0x2caf66));}return Promise['all'](_0x248617);})[_0x7f74('0x34')](function(_0xf08ef9){return createTables(_[_0x7f74('0x3d')](_0xf08ef9));})['then'](function(_0x3ea2b9){var _0x2b7c8c=getPDFDocDefinition(_0x3ea2b9);var _0x29879f=getPDFPrinter();var _0x50272c=_0x29879f[_0x7f74('0x3e')](_0x2b7c8c);if(_0xfe5192)_0x17181f=path[_0x7f74('0x2e')](_0x27cbe0,_0x2caf66,util[_0x7f74('0x1d')](_0x7f74('0x3f'),_0x2caf66,index,_0x7f74('0x30')));return writePDFDocument(_0x50272c,_0x17181f);})[_0x7f74('0x34')](function(){if(!_0xfe5192)return;zipdir(path[_0x7f74('0x2e')](_0x27cbe0,_0x2caf66),{'saveTo':path[_0x7f74('0x2e')](_0x27cbe0,util['format']('%s.%s',_0x2caf66,_0x7f74('0x40')))},function(_0x24e429){if(_0x24e429)throw _0x24e429;return;});})[_0x7f74('0x34')](function(){if(!_0xfe5192)return;rimraf(path[_0x7f74('0x2e')](_0x27cbe0,_0x2caf66),function(){});})[_0x7f74('0x34')](function(){logger['info'](util[_0x7f74('0x1d')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x7f74('0x41')));return analyticExtractedReport(_0x7f74('0x42'),_0xfe5192?util[_0x7f74('0x1d')](_0x7f74('0x2f'),_0x2caf66,_0xfe5192?_0x7f74('0x40'):'pdf'):null);});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util['format'](_0x7f74('0x43'),EXTRACTED_REPORT_ID,_0x7f74('0x44')));return db[_0x7f74('0xf')][_0x7f74('0x45')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x3c1ab3){EXTRACTED_REPORT=_0x3c1ab3;return dbH[_0x7f74('0x37')]['query'](util[_0x7f74('0x1d')](_0x7f74('0x46'),QUERY),{'type':dbH[_0x7f74('0x37')][_0x7f74('0x38')][_0x7f74('0x39')]});})[_0x7f74('0x34')](extractReport)[_0x7f74('0x47')](function(_0x3135f2){logger[_0x7f74('0x48')](util[_0x7f74('0x1d')](_0x7f74('0x49'),EXTRACTED_REPORT_ID,_0x7f74('0x44')),util[_0x7f74('0x4a')](_0x3135f2,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x7f74('0x4b'));})[_0x7f74('0x4c')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x2cf266=new PdfPrinter({'Arial':{'normal':__dirname+_0x7f74('0x4d'),'bold':__dirname+_0x7f74('0x4e'),'italics':__dirname+_0x7f74('0x4f'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x2cf266;}function getPDFDocDefinitionFromHTML(_0x440cee,_0x8af0d1){var _0x5c5051=util[_0x7f74('0x1d')](_0x7f74('0x50'),_0x8af0d1[_0x7f74('0x51')],_0x8af0d1[_0x7f74('0x52')]);var _0x5a35a3=moment()[_0x7f74('0x1d')](_0x7f74('0x53'))[_0x7f74('0x13')]();var _0x339eae=htmlToPdfmake(_0x440cee,{'window':window,'tableAutoSize':!![]});return{'content':[_0x339eae],'defaultStyle':{'font':_0x7f74('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x7f74('0x54'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x7f74('0x54')}},'header':function(){return[{'text':_0x7f74('0x55'),'style':_0x7f74('0x22')}];},'footer':function(_0x298cdc,_0x36f9d1){return[{'text':util[_0x7f74('0x1d')](_0x7f74('0x56'),_0x5c5051,_0x298cdc,_0x36f9d1,_0x5a35a3),'style':_0x7f74('0x25')}];}};}function writePDFDocument(_0x4bfeee,_0x3df947){return new Promise(function(_0x16389e,_0x40082b){var _0x3f26fa=_0x4bfeee['pipe'](fs[_0x7f74('0x57')](_0x3df947));_0x3f26fa['on'](_0x7f74('0x58'),function(){_0x16389e('finish');});_0x3f26fa['on'](_0x7f74('0x59'),function(_0x458420){_0x40082b(_0x458420);});_0x4bfeee[_0x7f74('0x5a')]();});}exports[_0x7f74('0x5b')]=function(_0xd1664d,_0x44b234){var _0x378b30=getPDFPrinter();var _0x459c41=getPDFDocDefinitionFromHTML(_0xd1664d,_0x44b234);var _0x579de7=_0x378b30[_0x7f74('0x3e')](_0x459c41);return writePDFDocument(_0x579de7,_0x44b234[_0x7f74('0x5c')])[_0x7f74('0x47')](function(_0x2479eb){throw _0x2479eb;});}; \ No newline at end of file +var _0x354d=['JSDOM','window','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','pick','toString','value','fill','length','auto','push','body','concat','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','endDate','pageBreak','before','margin','landscape','\x20/\x20','footer','Arial','black','right','num','Empty','basename','.pdf','join','%s.%s','pdf','Setting','find','split','splitSizePdf','then','query','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','QueryTypes','SELECT','existsSync','mkdirSync','all','createPdfKitDocument','zip','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','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-bold-italic.ttf','%s\x20#%d','channel','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','createPdfFromHTML','lodash','util','path','moment','pdfmake/src/printer','zip-dir','rimraf','jsdom'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x354d,0x15c));var _0xd354=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x354d[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xd354('0x0'));var fs=require('fs');var util=require(_0xd354('0x1'));var path=require(_0xd354('0x2'));var moment=require(_0xd354('0x3'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0xd354('0x4'));var zipdir=require(_0xd354('0x5'));var rimraf=require(_0xd354('0x6'));var JSDOM=require(_0xd354('0x7'))[_0xd354('0x8')];var window=new JSDOM('')[_0xd354('0x9')];var db=require(_0xd354('0xa'))['db'];var dbH=require(_0xd354('0xa'))[_0xd354('0xb')];var logger=require(_0xd354('0xc'))(_0xd354('0xd'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xd354('0xe')][0x3];var PATH=process[_0xd354('0xe')][0x4];var NAME=process[_0xd354('0xe')][0x5];var FORMAT=_0xd354('0xf');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x3424e0,_0x2fe91e){var _0x2671f2={'status':_0x3424e0};var _0x18c2c3={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2fe91e){_0x2671f2[_0xd354('0x10')]=_0x2fe91e;}return db[_0xd354('0x11')][_0xd354('0x12')](_0x2671f2,_0x18c2c3);}function getHeaders(_0x53eb0e){return _[_0xd354('0x13')](_0x53eb0e,function(_0x301018){return{'text':_0x301018,'style':'tableHeader'};});}function getRows(_0x4a934b,_0x14696c){return _['map'](_0x14696c,function(_0x45a646){return _(_0x45a646)[_0xd354('0x14')](_0x4a934b)['map'](function(_0x3a4aad){return _0x3a4aad?_[_0xd354('0x15')](_0x3a4aad):'';})[_0xd354('0x16')]();});}function createTable(_0x3fa72f,_0x3c5b72){var _0x230822={'widths':_[_0xd354('0x17')](Array(_0x3fa72f[_0xd354('0x18')]),0x91),'heights':function(_0x17d158){return _0x17d158===0x0?_0xd354('0x19'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x5efaeb=getHeaders(_0x3fa72f);_0x230822['body'][_0xd354('0x1a')](_0x5efaeb);var _0x117f6d=getRows(_0x3fa72f,_0x3c5b72);_0x230822[_0xd354('0x1b')]=_0x230822[_0xd354('0x1b')][_0xd354('0x1c')](_0x117f6d);return _0x230822;}function createTables(_0x2fa8e9){var _0x3a5f4d=[];var _0x5d5956=_[_0xd354('0x1d')](Object[_0xd354('0x1e')](_0x2fa8e9[0x0]),0x5);_0x5d5956[_0xd354('0x1f')](function(_0x456407){_0x3a5f4d[_0xd354('0x1a')](createTable(_0x456407,_0x2fa8e9));});return _0x3a5f4d;}function getPDFDocDefinition(_0x1a5967){var _0x5e3cf9=util[_0xd354('0x20')](_0xd354('0x21'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0xd354('0x22')])[_0xd354('0x20')](FORMAT),moment(EXTRACTED_REPORT[_0xd354('0x23')])[_0xd354('0x20')](FORMAT));var _0x4b61de=[];for(var _0x57dbe6=0x0;_0x57dbe6<_0x1a5967['length'];_0x57dbe6++){var _0x57cf5b=[];if(_0x57dbe6===0x0){_0x57cf5b['push']({'text':_0x5e3cf9,'style':'header'});}var _0x22daa3={'table':_0x1a5967[_0x57dbe6]};if(_0x57dbe6>0x0){_0x22daa3[_0xd354('0x24')]=_0xd354('0x25');_0x22daa3[_0xd354('0x26')]=[0x0,0x46,0x0,0x0];}_0x57cf5b[_0xd354('0x1a')](_0x22daa3);_0x4b61de[_0xd354('0x1a')](_0x57cf5b);}return{'pageSize':'A4','pageOrientation':_0xd354('0x27'),'content':_0x4b61de,'footer':function(_0x4e6a59,_0x4c739c){return{'text':_0x4e6a59[_0xd354('0x15')]()+_0xd354('0x28')+_0x4c739c,'style':_0xd354('0x29')};},'defaultStyle':{'font':_0xd354('0x2a')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xd354('0x2b')},'footer':{'alignment':_0xd354('0x2c'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x1b4796){var _0x403cf7=0x1388;var _0x16389a;if(!_0x1b4796[0x0][_0xd354('0x2d')]){return analyticExtractedReport(_0xd354('0x2e'));}var _0x5452ab=[];var _0x5cf13a=0x0;var _0x4e0a2d=!![];var _0x9947dc=path['dirname'](PATH);var _0x4173ee=path[_0xd354('0x2f')](PATH,_0xd354('0x30'));var _0x3a3271=path[_0xd354('0x31')](_0x9947dc,util[_0xd354('0x20')](_0xd354('0x32'),_0x4173ee,_0xd354('0x33')));var _0x3e5704=![];return db[_0xd354('0x34')][_0xd354('0x35')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xd354('0x36'),_0xd354('0x37')]})[_0xd354('0x38')](function(_0x3391be){if(_0x3391be){_0x16389a=_0x3391be;_0x403cf7=_0x16389a['splitSizePdf']||0x3e8;}})[_0xd354('0x38')](function(){if(_0x1b4796&&_0x1b4796['length']){var _0x51db56=_0x1b4796[0x0][_0xd354('0x2d')]%(_0x5cf13a+_0x403cf7);if(_0x16389a[_0xd354('0x36')]){for(;_0x4e0a2d;_0x5cf13a+=_0x403cf7,_0x51db56=_0x1b4796[0x0]['num']%(_0x5cf13a+_0x403cf7)){if(_0x51db56==0x0||_0x51db56==_0x1b4796[0x0][_0xd354('0x2d')]){_0x4e0a2d=![];}_0x5452ab[_0xd354('0x1a')](dbH['sequelize'][_0xd354('0x39')](util[_0xd354('0x20')](_0xd354('0x3a'),QUERY,_0x403cf7,_0x5cf13a),{'type':dbH[_0xd354('0x3b')][_0xd354('0x3c')][_0xd354('0x3d')]}));}}else{_0x5452ab['push'](dbH[_0xd354('0x3b')][_0xd354('0x39')](QUERY,{'type':dbH[_0xd354('0x3b')][_0xd354('0x3c')]['SELECT']}));}}_0x3e5704=_0x16389a[_0xd354('0x36')]&&_0x5452ab[_0xd354('0x18')]>0x1;if(!fs[_0xd354('0x3e')](path[_0xd354('0x31')](_0x9947dc,_0x4173ee))&&_0x3e5704){fs[_0xd354('0x3f')](path['join'](_0x9947dc,_0x4173ee));}return Promise[_0xd354('0x40')](_0x5452ab);})[_0xd354('0x38')](function(_0x3d4be6){return createTables(_['flatten'](_0x3d4be6));})[_0xd354('0x38')](function(_0x5a39bb){var _0x3c0d0b=getPDFDocDefinition(_0x5a39bb);var _0x4e571b=getPDFPrinter();var _0x1b75f3=_0x4e571b[_0xd354('0x41')](_0x3c0d0b);if(_0x3e5704)_0x3a3271=path['join'](_0x9947dc,_0x4173ee,util[_0xd354('0x20')]('%s%d.%s',_0x4173ee,index,_0xd354('0x33')));return writePDFDocument(_0x1b75f3,_0x3a3271);})[_0xd354('0x38')](function(){if(!_0x3e5704)return;zipdir(path[_0xd354('0x31')](_0x9947dc,_0x4173ee),{'saveTo':path[_0xd354('0x31')](_0x9947dc,util['format'](_0xd354('0x32'),_0x4173ee,'zip'))},function(_0x3b936f){if(_0x3b936f)throw _0x3b936f;return;});})['then'](function(){if(!_0x3e5704)return;rimraf(path[_0xd354('0x31')](_0x9947dc,_0x4173ee),function(){});})['then'](function(){logger['info'](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport('Completed',_0x3e5704?util['format'](_0xd354('0x32'),_0x4173ee,_0x3e5704?_0xd354('0x42'):_0xd354('0x33')):null);});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xd354('0x43')](util[_0xd354('0x20')](_0xd354('0x44'),EXTRACTED_REPORT_ID,_0xd354('0x45')));return db[_0xd354('0x11')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0xd354('0x38')](function(_0x50873b){EXTRACTED_REPORT=_0x50873b;return dbH[_0xd354('0x3b')][_0xd354('0x39')](util['format'](_0xd354('0x46'),QUERY),{'type':dbH[_0xd354('0x3b')][_0xd354('0x3c')][_0xd354('0x3d')]});})[_0xd354('0x38')](extractReport)[_0xd354('0x47')](function(_0x29d840){logger[_0xd354('0x43')](util[_0xd354('0x20')](_0xd354('0x48'),EXTRACTED_REPORT_ID,_0xd354('0x45')),util[_0xd354('0x49')](_0x29d840,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xd354('0x4a'));})['finally'](function(){process[_0xd354('0x4b')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x39c3d7=new PdfPrinter({'Arial':{'normal':__dirname+_0xd354('0x4c'),'bold':__dirname+_0xd354('0x4d'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0xd354('0x4e')}});return _0x39c3d7;}function getPDFDocDefinitionFromHTML(_0x429a8c,_0xfef428){var _0x32cd68=util[_0xd354('0x20')](_0xd354('0x4f'),_0xfef428[_0xd354('0x50')],_0xfef428['interactionId']);var _0x6c30b9=moment()[_0xd354('0x20')](_0xd354('0x51'))[_0xd354('0x15')]();var _0x2b1f24=htmlToPdfmake(_0x429a8c,{'window':window,'tableAutoSize':!![]});return{'content':[_0x2b1f24],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xd354('0x52'),'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':_0xd354('0x52')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':'header'}];},'footer':function(_0x41627d,_0x280652){return[{'text':util['format'](_0xd354('0x53'),_0x32cd68,_0x41627d,_0x280652,_0x6c30b9),'style':'footer'}];}};}function writePDFDocument(_0x346afa,_0x66700e){return new Promise(function(_0xaca27e,_0x1eaad9){var _0x5cd024=_0x346afa[_0xd354('0x54')](fs[_0xd354('0x55')](_0x66700e));_0x5cd024['on'](_0xd354('0x56'),function(){_0xaca27e(_0xd354('0x56'));});_0x5cd024['on'](_0xd354('0x57'),function(_0x25ff9d){_0x1eaad9(_0x25ff9d);});_0x346afa['end']();});}exports[_0xd354('0x58')]=function(_0x132e21,_0x58e8cb){var _0x477f1f=getPDFPrinter();var _0x2b7b37=getPDFDocDefinitionFromHTML(_0x132e21,_0x58e8cb);var _0x29b0ba=_0x477f1f[_0xd354('0x41')](_0x2b7b37);return writePDFDocument(_0x29b0ba,_0x58e8cb[_0xd354('0x2')])[_0xd354('0x47')](function(_0x184d30){throw _0x184d30;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 7674561..7ddfd78 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 _0xa474=['push','%s\x20limit\x20%d\x20OFFSET\x20%d','.xlsx','length','existsSync','join','mkdirSync','xlsx','writeFileSync','binary','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','info','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','json2xls','bluebird','zip-dir','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','then','splitSizeXlsx','sequelize','query','QueryTypes','SELECT','num'];(function(_0xff7ade,_0x424e72){var _0x5e4abd=function(_0x2d2ac3){while(--_0x2d2ac3){_0xff7ade['push'](_0xff7ade['shift']());}};_0x5e4abd(++_0x424e72);}(_0xa474,0xc4));var _0x4a47=function(_0x2a23b8,_0x257b92){_0x2a23b8=_0x2a23b8-0x0;var _0x54e9d6=_0xa474[_0x2a23b8];return _0x54e9d6;};'use strict';var util=require(_0x4a47('0x0'));var path=require(_0x4a47('0x1'));var _=require(_0x4a47('0x2'));var fs=require('fs');var json2xls=require(_0x4a47('0x3'));var BPromise=require(_0x4a47('0x4'));var zipdir=require(_0x4a47('0x5'));var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0x4a47('0x6'))(_0x4a47('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x4a47('0x8')][0x2]);var QUERY=process[_0x4a47('0x8')][0x3];var PATH=process[_0x4a47('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x582414,_0x16f640){var _0x14e15e={'status':_0x582414};var _0x56caab={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x16f640){_0x14e15e[_0x4a47('0x9')]=_0x16f640;}return db[_0x4a47('0xa')][_0x4a47('0xb')](_0x14e15e,_0x56caab);}function main(){var _0x56afa4=0x1388;var _0xed84cd;logger['info'](util[_0x4a47('0xc')](_0x4a47('0xd'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0x4a47('0xe')][_0x4a47('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x4a47('0x10'),'splitSizeXlsx']})[_0x4a47('0x11')](function(_0x55e084){if(_0x55e084){_0xed84cd=_0x55e084;_0x56afa4=_0xed84cd[_0x4a47('0x12')]||0x1388;}})[_0x4a47('0x11')](function(){return dbH[_0x4a47('0x13')][_0x4a47('0x14')](util[_0x4a47('0xc')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x4a47('0x13')][_0x4a47('0x15')][_0x4a47('0x16')]});})[_0x4a47('0x11')](function(_0x55d9d4){if(!_0x55d9d4[0x0][_0x4a47('0x17')]){return analyticExtractedReport('Empty');}var _0x3a2e6f=[];var _0x173185=0x0;var _0x2beded=!![];if(_0xed84cd[_0x4a47('0x10')]){if(_0x55d9d4&&_0x55d9d4['length']){var _0x182b97=_0x55d9d4[0x0][_0x4a47('0x17')]%(_0x173185+_0x56afa4);for(;_0x2beded;_0x173185+=_0x56afa4,_0x182b97=_0x55d9d4[0x0][_0x4a47('0x17')]%(_0x173185+_0x56afa4)){if(_0x182b97==0x0||_0x182b97==_0x55d9d4[0x0][_0x4a47('0x17')]){_0x2beded=![];}_0x3a2e6f[_0x4a47('0x18')](dbH['sequelize'][_0x4a47('0x14')](util['format'](_0x4a47('0x19'),QUERY,_0x56afa4,_0x173185),{'type':dbH[_0x4a47('0x13')][_0x4a47('0x15')][_0x4a47('0x16')]}));}}}else{_0x3a2e6f[_0x4a47('0x18')](dbH[_0x4a47('0x13')][_0x4a47('0x14')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0x4a47('0x16')]}));}var _0x3db6dd=path['dirname'](PATH);var _0x529401=path['basename'](PATH,_0x4a47('0x1a'));var _0x12eb2d=_0xed84cd[_0x4a47('0x10')]&&_0x3a2e6f[_0x4a47('0x1b')]>0x1;var _0x469b65=[];if(!fs[_0x4a47('0x1c')](path[_0x4a47('0x1d')](_0x3db6dd,_0x529401))&&_0x12eb2d){fs[_0x4a47('0x1e')](path[_0x4a47('0x1d')](_0x3db6dd,_0x529401));}return BPromise['each'](_0x3a2e6f,function(_0x175fd2){_0x469b65[_0x4a47('0x18')](_0x175fd2);})['then'](function(){for(var _0xec3fb1=0x0;_0xec3fb1<_0x469b65[_0x4a47('0x1b')];_0xec3fb1+=0x1){var _0x57855e;var _0x1a59de=_0x469b65[_0xec3fb1];if(_0x12eb2d){_0x57855e=path[_0x4a47('0x1d')](_0x3db6dd,_0x529401,util[_0x4a47('0xc')]('%s%d.%s',_0x529401,_0xec3fb1,_0x4a47('0x1f')));}else{_0x57855e=path[_0x4a47('0x1d')](_0x3db6dd,util[_0x4a47('0xc')]('%s.%s',_0x529401,'xlsx'));}fs[_0x4a47('0x20')](_0x57855e,json2xls(_0x1a59de),_0x4a47('0x21'));}})[_0x4a47('0x11')](function(){if(_0x12eb2d){zipdir(path[_0x4a47('0x1d')](_0x3db6dd,_0x529401),{'saveTo':path[_0x4a47('0x1d')](_0x3db6dd,util[_0x4a47('0xc')](_0x4a47('0x22'),_0x529401,_0x4a47('0x23')))},function(_0x11a904,_0x4dad10){});rimraf(path[_0x4a47('0x1d')](_0x3db6dd,_0x529401),function(){});}})[_0x4a47('0x11')](function(){logger['info'](util[_0x4a47('0xc')](_0x4a47('0x24'),EXTRACTED_REPORT_ID,_0x4a47('0x25')));return analyticExtractedReport('Completed',_0x12eb2d?util[_0x4a47('0xc')](_0x4a47('0x22'),_0x529401,_0x12eb2d?_0x4a47('0x23'):_0x4a47('0x1f')):null);});})['catch'](function(_0x586dd1){logger[_0x4a47('0x26')](util['format'](_0x4a47('0x27'),EXTRACTED_REPORT_ID,_0x4a47('0x25')),util[_0x4a47('0x28')](_0x586dd1,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x4a47('0x29'));})[_0x4a47('0x2a')](function(){process[_0x4a47('0x2b')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xb00a=['then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','length','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','.xlsx','join','each','%s%d.%s','xlsx','%s.%s','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','json2xls','bluebird','zip-dir','../../mysqldb','dbH','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx'];(function(_0x508685,_0x9f94af){var _0x976a76=function(_0x1bcb05){while(--_0x1bcb05){_0x508685['push'](_0x508685['shift']());}};_0x976a76(++_0x9f94af);}(_0xb00a,0x1d1));var _0xab00=function(_0x4a1bc4,_0x35a731){_0x4a1bc4=_0x4a1bc4-0x0;var _0x2a65dd=_0xb00a[_0x4a1bc4];return _0x2a65dd;};'use strict';var util=require(_0xab00('0x0'));var path=require(_0xab00('0x1'));var _=require(_0xab00('0x2'));var fs=require('fs');var json2xls=require(_0xab00('0x3'));var BPromise=require(_0xab00('0x4'));var zipdir=require(_0xab00('0x5'));var rimraf=require('rimraf');var db=require(_0xab00('0x6'))['db'];var dbH=require('../../mysqldb')[_0xab00('0x7')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xab00('0x8')][0x3];var PATH=process[_0xab00('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xf3c888,_0x1d4253){var _0x5ecbc5={'status':_0xf3c888};var _0x35501a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1d4253){_0x5ecbc5['savename']=_0x1d4253;}return db[_0xab00('0x9')][_0xab00('0xa')](_0x5ecbc5,_0x35501a);}function main(){var _0x14b976=0x1388;var _0x105097;logger[_0xab00('0xb')](util[_0xab00('0xc')](_0xab00('0xd'),EXTRACTED_REPORT_ID,_0xab00('0xe')));return db[_0xab00('0xf')][_0xab00('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xab00('0x11'),'splitSizeXlsx']})['then'](function(_0x2a6aae){if(_0x2a6aae){_0x105097=_0x2a6aae;_0x14b976=_0x105097[_0xab00('0x12')]||0x1388;}})[_0xab00('0x13')](function(){return dbH[_0xab00('0x14')]['query'](util[_0xab00('0xc')](_0xab00('0x15'),QUERY),{'type':dbH[_0xab00('0x14')][_0xab00('0x16')]['SELECT']});})[_0xab00('0x13')](function(_0x505d91){if(!_0x505d91[0x0][_0xab00('0x17')]){return analyticExtractedReport('Empty');}var _0x56c29d=[];var _0x1e17fe=0x0;var _0x18eeff=!![];if(_0x105097[_0xab00('0x11')]){if(_0x505d91&&_0x505d91[_0xab00('0x18')]){var _0x18ce07=_0x505d91[0x0][_0xab00('0x17')]%(_0x1e17fe+_0x14b976);for(;_0x18eeff;_0x1e17fe+=_0x14b976,_0x18ce07=_0x505d91[0x0][_0xab00('0x17')]%(_0x1e17fe+_0x14b976)){if(_0x18ce07==0x0||_0x18ce07==_0x505d91[0x0]['num']){_0x18eeff=![];}_0x56c29d[_0xab00('0x19')](dbH[_0xab00('0x14')][_0xab00('0x1a')](util[_0xab00('0xc')](_0xab00('0x1b'),QUERY,_0x14b976,_0x1e17fe),{'type':dbH['sequelize'][_0xab00('0x16')]['SELECT']}));}}}else{_0x56c29d[_0xab00('0x19')](dbH[_0xab00('0x14')][_0xab00('0x1a')](QUERY,{'type':dbH[_0xab00('0x14')][_0xab00('0x16')][_0xab00('0x1c')]}));}var _0x5a67af=path[_0xab00('0x1d')](PATH);var _0x556b06=path['basename'](PATH,_0xab00('0x1e'));var _0x38b414=_0x105097[_0xab00('0x11')]&&_0x56c29d[_0xab00('0x18')]>0x1;var _0x54ace3=[];if(!fs['existsSync'](path[_0xab00('0x1f')](_0x5a67af,_0x556b06))&&_0x38b414){fs['mkdirSync'](path[_0xab00('0x1f')](_0x5a67af,_0x556b06));}return BPromise[_0xab00('0x20')](_0x56c29d,function(_0x844a3b){_0x54ace3[_0xab00('0x19')](_0x844a3b);})[_0xab00('0x13')](function(){for(var _0x41cd38=0x0;_0x41cd38<_0x54ace3['length'];_0x41cd38+=0x1){var _0x23e63e;var _0x12e2d3=_0x54ace3[_0x41cd38];if(_0x38b414){_0x23e63e=path[_0xab00('0x1f')](_0x5a67af,_0x556b06,util[_0xab00('0xc')](_0xab00('0x21'),_0x556b06,_0x41cd38,_0xab00('0x22')));}else{_0x23e63e=path['join'](_0x5a67af,util[_0xab00('0xc')](_0xab00('0x23'),_0x556b06,_0xab00('0x22')));}fs['writeFileSync'](_0x23e63e,json2xls(_0x12e2d3),'binary');}})[_0xab00('0x13')](function(){if(_0x38b414){zipdir(path['join'](_0x5a67af,_0x556b06),{'saveTo':path[_0xab00('0x1f')](_0x5a67af,util[_0xab00('0xc')]('%s.%s',_0x556b06,'zip'))},function(_0x2e3391,_0x56b690){});rimraf(path[_0xab00('0x1f')](_0x5a67af,_0x556b06),function(){});}})['then'](function(){logger[_0xab00('0xb')](util[_0xab00('0xc')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xab00('0xe')));return analyticExtractedReport(_0xab00('0x24'),_0x38b414?util[_0xab00('0xc')](_0xab00('0x23'),_0x556b06,_0x38b414?_0xab00('0x25'):_0xab00('0x22')):null);});})[_0xab00('0x26')](function(_0x782ca4){logger[_0xab00('0xb')](util['format'](_0xab00('0x27'),EXTRACTED_REPORT_ID,_0xab00('0xe')),util[_0xab00('0x28')](_0x782ca4,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xab00('0x29'));})[_0xab00('0x2a')](function(){process[_0xab00('0x2b')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 3379e2d..f31adf2 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 _0x676e=['VoiceExtensionId','inbound','push','CDR(routeid)=','outbound','extension','cutdigits','${EXTEN:','${EXTEN}','$[${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','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','IntervalId','map','tag','CDR(tag)=','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','answer','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','sortBy','catch','error','rewrite','lodash','util','Interval','then','intervals','models','VoiceExtension','findAll','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','find','type','Set','format','CDR(type)=%s','context'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x676e,0xcd));var _0xe676=function(_0x1c5950,_0x49e128){_0x1c5950=_0x1c5950-0x0;var _0x2b720a=_0x676e[_0x1c5950];return _0x2b720a;};'use strict';var _=require(_0xe676('0x0'));var util=require(_0xe676('0x1'));function rewrite(_0x520330,_0x4cd129){var _0x14716c=this;return _0x520330['models'][_0xe676('0x2')]['findAll']({'raw':!![]})[_0xe676('0x3')](function(_0x33dd7c){_0x14716c[_0xe676('0x4')]=_0x33dd7c;return _0x520330[_0xe676('0x5')]['VoiceExtension']['findAll']({'where':{'IntervalId':_0x4cd129['IntervalId']},'raw':!![]});})[_0xe676('0x3')](function(_0x2045f4){return _0x520330[_0xe676('0x5')][_0xe676('0x6')][_0xe676('0x7')]({'where':{'exten':{'$in':_['uniq'](_['map'](_0x2045f4,_0xe676('0x8')))}},'order':[{'raw':_0xe676('0x9')}],'raw':!![]});})[_0xe676('0x3')](function(_0x48c9e5){var _0x471113=_[_0xe676('0xa')](_0x48c9e5,{'priority':'1'});var _0x55098b=_[_0xe676('0xa')](_0x48c9e5,{'isApp':0x1});var _0x35acd3=_[_0xe676('0xb')](_0x55098b,'exten');var _0x46c16e=[_0xe676('0xc'),_0xe676('0xd')];var _0x2270e4=[];var _0x4d0c58=[];for(var _0x4bb3ef in _0x35acd3){if(_0x35acd3[_0xe676('0xe')](_0x4bb3ef)){_0x14716c[_0xe676('0xf')]=0x2;_0x14716c[_0xe676('0x10')]=[];_0x14716c['extension']=_[_0xe676('0x11')](_0x471113,{'exten':_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x8')]});_0x14716c[_0xe676('0x10')]['push']({'type':_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x12')],'app':_0xe676('0x13'),'appdata':util[_0xe676('0x14')](_0xe676('0x15'),_0x35acd3[_0x4bb3ef][0x0]['type']),'context':_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x16')],'exten':_0x35acd3[_0x4bb3ef][0x0]['exten'],'priority':_0x14716c[_0xe676('0xf')]++,'VoiceExtensionId':_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x17')]});if(_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x12')]===_0xe676('0x18')){_0x14716c[_0xe676('0x10')][_0xe676('0x19')]({'type':_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x12')],'app':_0xe676('0x13'),'appdata':_0xe676('0x1a')+_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x17')],'context':_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x16')],'exten':_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x8')],'priority':_0x14716c[_0xe676('0xf')]++,'VoiceExtensionId':_0x35acd3[_0x4bb3ef][0x0]['VoiceExtensionId']});}else if(_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x12')]===_0xe676('0x1b')){if(_0x14716c[_0xe676('0x1c')]){_0x14716c[_0xe676('0x10')][_0xe676('0x19')]({'type':_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x12')],'app':'Set','appdata':'CDR(destination)='+(_0x14716c[_0xe676('0x1c')][_0xe676('0x1d')]?_0xe676('0x1e')+_0x14716c['extension']['cutdigits']+'}':_0xe676('0x1f')),'context':_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x16')],'exten':_0x35acd3[_0x4bb3ef][0x0]['exten'],'priority':_0x14716c['priority']++,'VoiceExtensionId':_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x17')]});}_0x14716c[_0xe676('0x10')][_0xe676('0x19')]({'type':_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x12')],'app':_0xe676('0x13'),'appdata':'CDR(routeid)='+_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x17')],'context':_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x16')],'exten':_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x8')],'priority':_0x14716c[_0xe676('0xf')]++,'VoiceExtensionId':_0x35acd3[_0x4bb3ef][0x0]['VoiceExtensionId']});var _0x1c0e2c=_0x14716c[_0xe676('0xf')]++;_0x14716c[_0xe676('0x10')][_0xe676('0x19')]({'type':_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x12')],'app':'ExecIf','appdata':_0xe676('0x20')+(_0x1c0e2c+0x2)+_0xe676('0x21')+(_0x1c0e2c+0x1)+')','context':_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x16')],'exten':_0x35acd3[_0x4bb3ef][0x0]['exten'],'priority':_0x1c0e2c,'VoiceExtensionId':_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x17')]});if(_0x14716c[_0xe676('0x1c')]){_0x14716c['extensions'][_0xe676('0x19')]({'type':_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x12')],'app':'Set','appdata':_0x14716c[_0xe676('0x1c')][_0xe676('0x1d')]?_0xe676('0x22')+_0x14716c[_0xe676('0x1c')][_0xe676('0x1d')]+'}':'CDR(prefix)=noprefix','context':_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x16')],'exten':_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x8')],'priority':_0x14716c['priority']++,'VoiceExtensionId':_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x17')]});}_0x14716c[_0xe676('0x10')]['push']({'type':_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x12')],'app':_0xe676('0x13'),'appdata':_0xe676('0x23')+_0x35acd3[_0x4bb3ef][0x0]['VoiceExtensionId'],'context':_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x16')],'exten':_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x8')],'priority':_0x14716c['priority']++,'VoiceExtensionId':_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x17')]});if(_0x14716c[_0xe676('0x1c')]&&_0x14716c['extension'][_0xe676('0xe')]('recordingFormat')&&_0x14716c['extension'][_0xe676('0x24')]!=='none'){_0x14716c[_0xe676('0x10')]['push']({'type':_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x12')],'app':'Set','appdata':_0xe676('0x25'),'context':_0x35acd3[_0x4bb3ef][0x0]['context'],'exten':_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x8')],'priority':_0x14716c[_0xe676('0xf')]++,'VoiceExtensionId':_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x17')]});_0x14716c[_0xe676('0x10')][_0xe676('0x19')]({'type':_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x12')],'app':_0xe676('0x13'),'appdata':_0xe676('0x26')+_0x14716c[_0xe676('0x1c')][_0xe676('0x24')]||_0xe676('0x27'),'context':_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x16')],'exten':_0x35acd3[_0x4bb3ef][0x0]['exten'],'priority':_0x14716c[_0xe676('0xf')]++,'VoiceExtensionId':_0x35acd3[_0x4bb3ef][0x0]['VoiceExtensionId']});}}_0x14716c[_0xe676('0x10')][_0xe676('0x19')]({'type':_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x12')],'app':'Set','appdata':_0xe676('0x28'),'context':_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x16')],'exten':_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x8')],'priority':_0x14716c['priority']++,'VoiceExtensionId':_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x17')]});_0x14716c['extensions'][_0xe676('0x19')]({'type':_0x35acd3[_0x4bb3ef][0x0]['type'],'app':_0xe676('0x13'),'appdata':_0xe676('0x29'),'context':_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x16')],'exten':_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x8')],'priority':_0x14716c[_0xe676('0xf')]++,'VoiceExtensionId':_0x35acd3[_0x4bb3ef][0x0]['VoiceExtensionId']});_0x14716c[_0xe676('0x10')]['push']({'type':_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x12')],'app':_0xe676('0x13'),'appdata':_0xe676('0x2a'),'context':_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x16')],'exten':_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x8')],'priority':_0x14716c['priority']++,'VoiceExtensionId':_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x17')]});for(var _0x32c02f=0x0,_0xe2c62a=0x0;_0x32c02f<_0x35acd3[_0x4bb3ef][_0xe676('0x2b')];_0x32c02f+=0x1,_0xe2c62a=0x0){var _0x4dd0e0=_0x35acd3[_0x4bb3ef][_0x32c02f];if(_0x4dd0e0[_0xe676('0x12')]){_0x4dd0e0[_0xe676('0x12')]=_0x4dd0e0['type'][_0xe676('0x2c')]();}var _0x2329da=[];var _0x10241c=[];delete _0x4dd0e0['id'];delete _0x4dd0e0[_0xe676('0x2d')];delete _0x4dd0e0[_0xe676('0x2e')];var _0x3c8a4c=_0x4dd0e0[_0xe676('0x2f')]!==_0xe676('0x30')?[_0x4dd0e0[_0xe676('0x2f')]]:_0x4dd0e0[_0xe676('0x31')]?_[_0xe676('0x32')](_['filter'](_0x14716c[_0xe676('0x4')],{'IntervalId':_0x4dd0e0[_0xe676('0x31')]}),_0xe676('0x2f')):[];if(_0x4dd0e0[_0xe676('0xe')](_0xe676('0x33'))){if(_0x4dd0e0[_0xe676('0x33')]&&_0x4dd0e0[_0xe676('0x33')]!=='--'){_0x2329da[_0xe676('0x19')]({'type':_0x4dd0e0[_0xe676('0x12')],'app':_0xe676('0x13'),'appdata':_0xe676('0x34')+_0x4dd0e0[_0xe676('0x33')],'context':_0x4dd0e0[_0xe676('0x16')],'exten':_0x4dd0e0['exten'],'priority':_0x3c8a4c['length']+_0x14716c[_0xe676('0xf')]+_0xe2c62a++,'VoiceExtensionId':_0x4dd0e0[_0xe676('0x17')]});}}if(_0x4dd0e0[_0xe676('0x12')]===_0xe676('0x1b')&&_0x4dd0e0[_0xe676('0xe')]('callerID')){if(_0x4dd0e0[_0xe676('0x35')]){_0x2329da[_0xe676('0x19')]({'type':_0x4dd0e0[_0xe676('0x12')],'app':_0xe676('0x36'),'appdata':_0xe676('0x37')+_0x4dd0e0[_0xe676('0x35')]+')','context':_0x4dd0e0[_0xe676('0x16')],'exten':_0x4dd0e0[_0xe676('0x8')],'priority':_0x3c8a4c[_0xe676('0x2b')]+_0x14716c['priority']+_0xe2c62a++,'VoiceExtensionId':_0x4dd0e0['VoiceExtensionId']});}else{_0x2329da[_0xe676('0x19')]({'type':_0x4dd0e0[_0xe676('0x12')],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x4dd0e0[_0xe676('0x16')],'exten':_0x4dd0e0[_0xe676('0x8')],'priority':_0x3c8a4c[_0xe676('0x2b')]+_0x14716c[_0xe676('0xf')]+_0xe2c62a++,'VoiceExtensionId':_0x4dd0e0['VoiceExtensionId']});}}if(_0x4dd0e0[_0xe676('0xe')](_0xe676('0x38'))){if(_0x46c16e[_0xe676('0x39')](_0x4dd0e0[_0xe676('0x3a')][_0xe676('0x2c')]())>=0x0&&_0x4dd0e0[_0xe676('0x3b')]!==_0xe676('0x3c')){if(_0x4dd0e0[_0xe676('0x38')]){_0x2329da[_0xe676('0x19')]({'type':_0x4dd0e0[_0xe676('0x12')],'app':_0xe676('0x36'),'appdata':_0xe676('0x3d'),'context':_0x4dd0e0[_0xe676('0x16')],'exten':_0x4dd0e0[_0xe676('0x8')],'priority':_0x3c8a4c['length']+_0x14716c[_0xe676('0xf')]+_0xe2c62a++,'VoiceExtensionId':_0x4dd0e0[_0xe676('0x17')]});_0x2329da[_0xe676('0x19')]({'type':_0x4dd0e0[_0xe676('0x12')],'app':_0xe676('0x13'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x4dd0e0[_0xe676('0x16')],'exten':_0x4dd0e0['exten'],'priority':_0x3c8a4c[_0xe676('0x2b')]+_0x14716c['priority']+_0xe2c62a++,'VoiceExtensionId':_0x4dd0e0[_0xe676('0x17')]});}else{_0x2329da[_0xe676('0x19')]({'type':_0x4dd0e0[_0xe676('0x12')],'app':'ExecIf','appdata':_0xe676('0x3e'),'context':_0x4dd0e0[_0xe676('0x16')],'exten':_0x4dd0e0['exten'],'priority':_0x3c8a4c[_0xe676('0x2b')]+_0x14716c['priority']+_0xe2c62a++,'VoiceExtensionId':_0x4dd0e0[_0xe676('0x17')]});_0x2329da[_0xe676('0x19')]({'type':_0x4dd0e0[_0xe676('0x12')],'app':_0xe676('0x13'),'appdata':_0xe676('0x3f'),'context':_0x4dd0e0[_0xe676('0x16')],'exten':_0x4dd0e0[_0xe676('0x8')],'priority':_0x3c8a4c[_0xe676('0x2b')]+_0x14716c[_0xe676('0xf')]+_0xe2c62a++,'VoiceExtensionId':_0x4dd0e0[_0xe676('0x17')]});}}}for(var _0x1d91c2=0x0;_0x1d91c2<_0x3c8a4c['length'];_0x1d91c2+=0x1){var _0x403aa=_0x14716c[_0xe676('0xf')]+_0x3c8a4c[_0xe676('0x2b')];var _0x5da622=_0x1d91c2===_0x3c8a4c[_0xe676('0x2b')]-0x1?_0x14716c['priority']+_0x2329da[_0xe676('0x2b')]+_0x10241c['length']+0x2:_0x14716c['priority']+_0x1d91c2+0x1;_0x2329da['splice'](_0x1d91c2,0x0,{'type':_0x4dd0e0['type'],'app':_0xe676('0x40'),'appdata':_0x3c8a4c[_0x1d91c2]+'?'+_0x4dd0e0[_0xe676('0x16')]+_0xe676('0x41')+_0x403aa+':'+_0x4dd0e0[_0xe676('0x16')]+_0xe676('0x41')+_0x5da622,'exten':_0x4dd0e0['exten'],'context':_0x4dd0e0['context'],'priority':_0x14716c[_0xe676('0xf')]+_0x1d91c2,'VoiceExtensionId':_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x17')]});}_0x4dd0e0[_0xe676('0xf')]=_0x2329da[_0xe676('0x2b')]?_[_0xe676('0x42')](_0x2329da)[_0xe676('0xf')]+0x1:_0x14716c[_0xe676('0xf')];_0x14716c[_0xe676('0xf')]=(_0x10241c[_0xe676('0x2b')]?_[_0xe676('0x42')](_0x10241c)[_0xe676('0xf')]:_0x4dd0e0[_0xe676('0xf')])+0x1;_0x14716c[_0xe676('0x10')]=_[_0xe676('0x43')](_0x14716c['extensions'],_0x2329da,[_0x4dd0e0],_0x10241c);}_0x14716c['extensions']['push']({'type':_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x12')],'app':_0xe676('0x44'),'exten':_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x8')],'context':_0x35acd3[_0x4bb3ef][0x0]['context'],'priority':_0x14716c['priority'],'VoiceExtensionId':_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x17')]});_0x2270e4[_0xe676('0x19')](_0x35acd3[_0x4bb3ef][0x0][_0xe676('0x17')]);_0x4d0c58=_[_0xe676('0x43')](_0x4d0c58,_0x14716c[_0xe676('0x10')]);}}return _0x520330[_0xe676('0x45')](function(_0x2dc348){return _0x520330[_0xe676('0x5')][_0xe676('0x6')][_0xe676('0x46')]({'where':{'VoiceExtensionId':{'$in':_0x2270e4}},'transaction':_0x2dc348})['then'](function(_0x5c0c0d){return _0x520330['models'][_0xe676('0x6')][_0xe676('0x47')](_[_0xe676('0x48')](_0x4d0c58,_0xe676('0xf')),{'transaction':_0x2dc348});});});})[_0xe676('0x49')](function(_0x437030){console[_0xe676('0x4a')](_0x437030);});}exports[_0xe676('0x4b')]=rewrite; \ No newline at end of file +var _0x81d7=['Hangup','transaction','sortBy','error','util','models','Interval','findAll','then','intervals','IntervalId','VoiceExtension','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','find','type','context','VoiceExtensionId','inbound','push','Set','CDR(routeid)=','extension','CDR(destination)=','cutdigits','${EXTEN:','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','outbound','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','concat'];(function(_0x5d4634,_0x3981d8){var _0xaa86be=function(_0x3e08e4){while(--_0x3e08e4){_0x5d4634['push'](_0x5d4634['shift']());}};_0xaa86be(++_0x3981d8);}(_0x81d7,0xd6));var _0x781d=function(_0x507425,_0x2446b6){_0x507425=_0x507425-0x0;var _0x5b7ab3=_0x81d7[_0x507425];return _0x5b7ab3;};'use strict';var _=require('lodash');var util=require(_0x781d('0x0'));function rewrite(_0x5b0651,_0x63f838){var _0x138e8c=this;return _0x5b0651[_0x781d('0x1')][_0x781d('0x2')][_0x781d('0x3')]({'raw':!![]})[_0x781d('0x4')](function(_0x3352ea){_0x138e8c[_0x781d('0x5')]=_0x3352ea;return _0x5b0651[_0x781d('0x1')]['VoiceExtension']['findAll']({'where':{'IntervalId':_0x63f838[_0x781d('0x6')]},'raw':!![]});})['then'](function(_0x176fd2){return _0x5b0651[_0x781d('0x1')][_0x781d('0x7')][_0x781d('0x3')]({'where':{'exten':{'$in':_[_0x781d('0x8')](_[_0x781d('0x9')](_0x176fd2,_0x781d('0xa')))}},'order':[{'raw':_0x781d('0xb')}],'raw':!![]});})['then'](function(_0x52020a){var _0x297e44=_['filter'](_0x52020a,{'priority':'1'});var _0x4df49=_[_0x781d('0xc')](_0x52020a,{'isApp':0x1});var _0x184924=_[_0x781d('0xd')](_0x4df49,_0x781d('0xa'));var _0x504e94=[_0x781d('0xe'),_0x781d('0xf')];var _0x12300d=[];var _0x228996=[];for(var _0x1aed25 in _0x184924){if(_0x184924[_0x781d('0x10')](_0x1aed25)){_0x138e8c[_0x781d('0x11')]=0x2;_0x138e8c[_0x781d('0x12')]=[];_0x138e8c['extension']=_[_0x781d('0x13')](_0x297e44,{'exten':_0x184924[_0x1aed25][0x0][_0x781d('0xa')]});_0x138e8c[_0x781d('0x12')]['push']({'type':_0x184924[_0x1aed25][0x0]['type'],'app':'Set','appdata':util['format']('CDR(type)=%s',_0x184924[_0x1aed25][0x0][_0x781d('0x14')]),'context':_0x184924[_0x1aed25][0x0][_0x781d('0x15')],'exten':_0x184924[_0x1aed25][0x0][_0x781d('0xa')],'priority':_0x138e8c['priority']++,'VoiceExtensionId':_0x184924[_0x1aed25][0x0][_0x781d('0x16')]});if(_0x184924[_0x1aed25][0x0][_0x781d('0x14')]===_0x781d('0x17')){_0x138e8c['extensions'][_0x781d('0x18')]({'type':_0x184924[_0x1aed25][0x0][_0x781d('0x14')],'app':_0x781d('0x19'),'appdata':_0x781d('0x1a')+_0x184924[_0x1aed25][0x0]['VoiceExtensionId'],'context':_0x184924[_0x1aed25][0x0][_0x781d('0x15')],'exten':_0x184924[_0x1aed25][0x0]['exten'],'priority':_0x138e8c[_0x781d('0x11')]++,'VoiceExtensionId':_0x184924[_0x1aed25][0x0][_0x781d('0x16')]});}else if(_0x184924[_0x1aed25][0x0][_0x781d('0x14')]==='outbound'){if(_0x138e8c[_0x781d('0x1b')]){_0x138e8c[_0x781d('0x12')][_0x781d('0x18')]({'type':_0x184924[_0x1aed25][0x0][_0x781d('0x14')],'app':_0x781d('0x19'),'appdata':_0x781d('0x1c')+(_0x138e8c[_0x781d('0x1b')][_0x781d('0x1d')]?_0x781d('0x1e')+_0x138e8c['extension'][_0x781d('0x1d')]+'}':'${EXTEN}'),'context':_0x184924[_0x1aed25][0x0][_0x781d('0x15')],'exten':_0x184924[_0x1aed25][0x0][_0x781d('0xa')],'priority':_0x138e8c['priority']++,'VoiceExtensionId':_0x184924[_0x1aed25][0x0]['VoiceExtensionId']});}_0x138e8c['extensions'][_0x781d('0x18')]({'type':_0x184924[_0x1aed25][0x0][_0x781d('0x14')],'app':_0x781d('0x19'),'appdata':_0x781d('0x1a')+_0x184924[_0x1aed25][0x0]['VoiceExtensionId'],'context':_0x184924[_0x1aed25][0x0]['context'],'exten':_0x184924[_0x1aed25][0x0][_0x781d('0xa')],'priority':_0x138e8c[_0x781d('0x11')]++,'VoiceExtensionId':_0x184924[_0x1aed25][0x0][_0x781d('0x16')]});var _0x294c91=_0x138e8c[_0x781d('0x11')]++;_0x138e8c[_0x781d('0x12')]['push']({'type':_0x184924[_0x1aed25][0x0][_0x781d('0x14')],'app':_0x781d('0x1f'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x294c91+0x2)+_0x781d('0x20')+(_0x294c91+0x1)+')','context':_0x184924[_0x1aed25][0x0]['context'],'exten':_0x184924[_0x1aed25][0x0][_0x781d('0xa')],'priority':_0x294c91,'VoiceExtensionId':_0x184924[_0x1aed25][0x0]['VoiceExtensionId']});if(_0x138e8c[_0x781d('0x1b')]){_0x138e8c[_0x781d('0x12')][_0x781d('0x18')]({'type':_0x184924[_0x1aed25][0x0][_0x781d('0x14')],'app':'Set','appdata':_0x138e8c[_0x781d('0x1b')][_0x781d('0x1d')]?_0x781d('0x21')+_0x138e8c[_0x781d('0x1b')][_0x781d('0x1d')]+'}':_0x781d('0x22'),'context':_0x184924[_0x1aed25][0x0][_0x781d('0x15')],'exten':_0x184924[_0x1aed25][0x0][_0x781d('0xa')],'priority':_0x138e8c[_0x781d('0x11')]++,'VoiceExtensionId':_0x184924[_0x1aed25][0x0][_0x781d('0x16')]});}_0x138e8c['extensions'][_0x781d('0x18')]({'type':_0x184924[_0x1aed25][0x0][_0x781d('0x14')],'app':_0x781d('0x19'),'appdata':_0x781d('0x23')+_0x184924[_0x1aed25][0x0]['VoiceExtensionId'],'context':_0x184924[_0x1aed25][0x0]['context'],'exten':_0x184924[_0x1aed25][0x0]['exten'],'priority':_0x138e8c[_0x781d('0x11')]++,'VoiceExtensionId':_0x184924[_0x1aed25][0x0][_0x781d('0x16')]});if(_0x138e8c[_0x781d('0x1b')]&&_0x138e8c['extension'][_0x781d('0x10')](_0x781d('0x24'))&&_0x138e8c['extension'][_0x781d('0x24')]!==_0x781d('0x25')){_0x138e8c['extensions'][_0x781d('0x18')]({'type':_0x184924[_0x1aed25][0x0][_0x781d('0x14')],'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x184924[_0x1aed25][0x0][_0x781d('0x15')],'exten':_0x184924[_0x1aed25][0x0]['exten'],'priority':_0x138e8c[_0x781d('0x11')]++,'VoiceExtensionId':_0x184924[_0x1aed25][0x0][_0x781d('0x16')]});_0x138e8c['extensions'][_0x781d('0x18')]({'type':_0x184924[_0x1aed25][0x0][_0x781d('0x14')],'app':'Set','appdata':_0x781d('0x26')+_0x138e8c[_0x781d('0x1b')][_0x781d('0x24')]||_0x781d('0x27'),'context':_0x184924[_0x1aed25][0x0][_0x781d('0x15')],'exten':_0x184924[_0x1aed25][0x0][_0x781d('0xa')],'priority':_0x138e8c[_0x781d('0x11')]++,'VoiceExtensionId':_0x184924[_0x1aed25][0x0]['VoiceExtensionId']});}}_0x138e8c['extensions'][_0x781d('0x18')]({'type':_0x184924[_0x1aed25][0x0][_0x781d('0x14')],'app':_0x781d('0x19'),'appdata':_0x781d('0x28'),'context':_0x184924[_0x1aed25][0x0][_0x781d('0x15')],'exten':_0x184924[_0x1aed25][0x0][_0x781d('0xa')],'priority':_0x138e8c[_0x781d('0x11')]++,'VoiceExtensionId':_0x184924[_0x1aed25][0x0][_0x781d('0x16')]});_0x138e8c[_0x781d('0x12')][_0x781d('0x18')]({'type':_0x184924[_0x1aed25][0x0][_0x781d('0x14')],'app':'Set','appdata':_0x781d('0x29'),'context':_0x184924[_0x1aed25][0x0][_0x781d('0x15')],'exten':_0x184924[_0x1aed25][0x0]['exten'],'priority':_0x138e8c[_0x781d('0x11')]++,'VoiceExtensionId':_0x184924[_0x1aed25][0x0][_0x781d('0x16')]});_0x138e8c[_0x781d('0x12')][_0x781d('0x18')]({'type':_0x184924[_0x1aed25][0x0][_0x781d('0x14')],'app':_0x781d('0x19'),'appdata':_0x781d('0x2a'),'context':_0x184924[_0x1aed25][0x0][_0x781d('0x15')],'exten':_0x184924[_0x1aed25][0x0]['exten'],'priority':_0x138e8c['priority']++,'VoiceExtensionId':_0x184924[_0x1aed25][0x0][_0x781d('0x16')]});for(var _0x328c96=0x0,_0x412157=0x0;_0x328c96<_0x184924[_0x1aed25][_0x781d('0x2b')];_0x328c96+=0x1,_0x412157=0x0){var _0x158eee=_0x184924[_0x1aed25][_0x328c96];if(_0x158eee['type']){_0x158eee[_0x781d('0x14')]=_0x158eee[_0x781d('0x14')][_0x781d('0x2c')]();}var _0x5ae5fb=[];var _0xcaa86a=[];delete _0x158eee['id'];delete _0x158eee[_0x781d('0x2d')];delete _0x158eee[_0x781d('0x2e')];var _0x2668a9=_0x158eee[_0x781d('0x2f')]!==_0x781d('0x30')?[_0x158eee[_0x781d('0x2f')]]:_0x158eee[_0x781d('0x6')]?_[_0x781d('0x9')](_[_0x781d('0xc')](_0x138e8c['intervals'],{'IntervalId':_0x158eee[_0x781d('0x6')]}),'interval'):[];if(_0x158eee[_0x781d('0x10')](_0x781d('0x31'))){if(_0x158eee[_0x781d('0x31')]&&_0x158eee[_0x781d('0x31')]!=='--'){_0x5ae5fb['push']({'type':_0x158eee['type'],'app':_0x781d('0x19'),'appdata':_0x781d('0x32')+_0x158eee[_0x781d('0x31')],'context':_0x158eee['context'],'exten':_0x158eee[_0x781d('0xa')],'priority':_0x2668a9['length']+_0x138e8c[_0x781d('0x11')]+_0x412157++,'VoiceExtensionId':_0x158eee['VoiceExtensionId']});}}if(_0x158eee[_0x781d('0x14')]===_0x781d('0x33')&&_0x158eee[_0x781d('0x10')](_0x781d('0x34'))){if(_0x158eee[_0x781d('0x34')]){_0x5ae5fb['push']({'type':_0x158eee['type'],'app':_0x781d('0x1f'),'appdata':_0x781d('0x35')+_0x158eee[_0x781d('0x34')]+')','context':_0x158eee[_0x781d('0x15')],'exten':_0x158eee[_0x781d('0xa')],'priority':_0x2668a9[_0x781d('0x2b')]+_0x138e8c[_0x781d('0x11')]+_0x412157++,'VoiceExtensionId':_0x158eee[_0x781d('0x16')]});}else{_0x5ae5fb[_0x781d('0x18')]({'type':_0x158eee[_0x781d('0x14')],'app':_0x781d('0x1f'),'appdata':_0x781d('0x36'),'context':_0x158eee[_0x781d('0x15')],'exten':_0x158eee[_0x781d('0xa')],'priority':_0x2668a9[_0x781d('0x2b')]+_0x138e8c[_0x781d('0x11')]+_0x412157++,'VoiceExtensionId':_0x158eee['VoiceExtensionId']});}}if(_0x158eee['hasOwnProperty'](_0x781d('0x37'))){if(_0x504e94[_0x781d('0x38')](_0x158eee['app'][_0x781d('0x2c')]())>=0x0&&_0x158eee[_0x781d('0x39')]!==_0x781d('0x3a')){if(_0x158eee[_0x781d('0x37')]){_0x5ae5fb['push']({'type':_0x158eee[_0x781d('0x14')],'app':_0x781d('0x1f'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x158eee[_0x781d('0x15')],'exten':_0x158eee[_0x781d('0xa')],'priority':_0x2668a9['length']+_0x138e8c[_0x781d('0x11')]+_0x412157++,'VoiceExtensionId':_0x158eee[_0x781d('0x16')]});_0x5ae5fb['push']({'type':_0x158eee[_0x781d('0x14')],'app':_0x781d('0x19'),'appdata':_0x781d('0x3b'),'context':_0x158eee['context'],'exten':_0x158eee['exten'],'priority':_0x2668a9['length']+_0x138e8c[_0x781d('0x11')]+_0x412157++,'VoiceExtensionId':_0x158eee[_0x781d('0x16')]});}else{_0x5ae5fb[_0x781d('0x18')]({'type':_0x158eee[_0x781d('0x14')],'app':_0x781d('0x1f'),'appdata':_0x781d('0x3c'),'context':_0x158eee['context'],'exten':_0x158eee[_0x781d('0xa')],'priority':_0x2668a9['length']+_0x138e8c[_0x781d('0x11')]+_0x412157++,'VoiceExtensionId':_0x158eee[_0x781d('0x16')]});_0x5ae5fb['push']({'type':_0x158eee[_0x781d('0x14')],'app':_0x781d('0x19'),'appdata':_0x781d('0x3d'),'context':_0x158eee['context'],'exten':_0x158eee['exten'],'priority':_0x2668a9[_0x781d('0x2b')]+_0x138e8c[_0x781d('0x11')]+_0x412157++,'VoiceExtensionId':_0x158eee[_0x781d('0x16')]});}}}for(var _0x5152cf=0x0;_0x5152cf<_0x2668a9[_0x781d('0x2b')];_0x5152cf+=0x1){var _0x428db5=_0x138e8c[_0x781d('0x11')]+_0x2668a9['length'];var _0x42d3f8=_0x5152cf===_0x2668a9[_0x781d('0x2b')]-0x1?_0x138e8c[_0x781d('0x11')]+_0x5ae5fb['length']+_0xcaa86a['length']+0x2:_0x138e8c[_0x781d('0x11')]+_0x5152cf+0x1;_0x5ae5fb['splice'](_0x5152cf,0x0,{'type':_0x158eee[_0x781d('0x14')],'app':_0x781d('0x3e'),'appdata':_0x2668a9[_0x5152cf]+'?'+_0x158eee[_0x781d('0x15')]+_0x781d('0x3f')+_0x428db5+':'+_0x158eee['context']+_0x781d('0x3f')+_0x42d3f8,'exten':_0x158eee[_0x781d('0xa')],'context':_0x158eee[_0x781d('0x15')],'priority':_0x138e8c[_0x781d('0x11')]+_0x5152cf,'VoiceExtensionId':_0x184924[_0x1aed25][0x0][_0x781d('0x16')]});}_0x158eee['priority']=_0x5ae5fb[_0x781d('0x2b')]?_[_0x781d('0x40')](_0x5ae5fb)[_0x781d('0x11')]+0x1:_0x138e8c[_0x781d('0x11')];_0x138e8c[_0x781d('0x11')]=(_0xcaa86a[_0x781d('0x2b')]?_[_0x781d('0x40')](_0xcaa86a)[_0x781d('0x11')]:_0x158eee['priority'])+0x1;_0x138e8c[_0x781d('0x12')]=_[_0x781d('0x41')](_0x138e8c['extensions'],_0x5ae5fb,[_0x158eee],_0xcaa86a);}_0x138e8c[_0x781d('0x12')][_0x781d('0x18')]({'type':_0x184924[_0x1aed25][0x0][_0x781d('0x14')],'app':_0x781d('0x42'),'exten':_0x184924[_0x1aed25][0x0][_0x781d('0xa')],'context':_0x184924[_0x1aed25][0x0][_0x781d('0x15')],'priority':_0x138e8c[_0x781d('0x11')],'VoiceExtensionId':_0x184924[_0x1aed25][0x0]['VoiceExtensionId']});_0x12300d[_0x781d('0x18')](_0x184924[_0x1aed25][0x0][_0x781d('0x16')]);_0x228996=_[_0x781d('0x41')](_0x228996,_0x138e8c[_0x781d('0x12')]);}}return _0x5b0651[_0x781d('0x43')](function(_0x5e7ea6){return _0x5b0651[_0x781d('0x1')]['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':{'$in':_0x12300d}},'transaction':_0x5e7ea6})[_0x781d('0x4')](function(_0x380e86){return _0x5b0651['models'][_0x781d('0x7')]['bulkCreate'](_[_0x781d('0x44')](_0x228996,'priority'),{'transaction':_0x5e7ea6});});});})['catch'](function(_0x36de16){console[_0x781d('0x45')](_0x36de16);});}exports['rewrite']=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 995cf85..5c89944 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 _0x9cc8=['contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','pause','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','defaults','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','undefined','argv','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','push','pick','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','from','cm_contacts','where','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','id\x20IN\x20?','cm_hopper_final','ListId\x20=\x20?','str','cm_hopper_black','VoiceQueue','outbound','Lists','then','get','dialCheckDuplicateType','always','sequelize','query','VoiceQueueId','catch','onlyIfOpen','all','CmList','BlackLists','Campaign','findAll','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit'];(function(_0x4f7cf,_0x43bf1a){var _0x83883=function(_0xf60b8b){while(--_0xf60b8b){_0x4f7cf['push'](_0x4f7cf['shift']());}};_0x83883(++_0x43bf1a);}(_0x9cc8,0x83));var _0x89cc=function(_0x2a6f57,_0x530329){_0x2a6f57=_0x2a6f57-0x0;var _0x2969f1=_0x9cc8[_0x2a6f57];return _0x2969f1;};'use strict';var BPromise=require(_0x89cc('0x0'));var util=require(_0x89cc('0x1'));var _=require('lodash');var fs=require('fs');var squel=require('squel');var Papa=require(_0x89cc('0x2'));var Redis=require(_0x89cc('0x3'));var db=require(_0x89cc('0x4'))['db'];var config=require(_0x89cc('0x5'));var logger=require(_0x89cc('0x6'))(_0x89cc('0x7'));config['redis']=_[_0x89cc('0x8')](config[_0x89cc('0x9')],{'host':_0x89cc('0xa'),'port':0x18eb});var socket=require(_0x89cc('0xb'))(new Redis(config[_0x89cc('0x9')]));require(_0x89cc('0xc'))[_0x89cc('0xd')](socket);try{if(!process['argv'][0x2]||process['argv'][0x2]===_0x89cc('0xe')||process[_0x89cc('0xf')][0x2]==='null'){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x89cc('0xf')][0x2];if(!process[_0x89cc('0xf')][0x3]||process[_0x89cc('0xf')][0x3]===_0x89cc('0xe')||process[_0x89cc('0xf')][0x3]===_0x89cc('0x10')||!process[_0x89cc('0xf')][0x4]||process[_0x89cc('0xf')][0x4]==='undefined'||process[_0x89cc('0xf')][0x4]==='null'){throw new Error(_0x89cc('0x11'));}var FIELDS=_[_0x89cc('0x12')](process[_0x89cc('0xf')][0x3][_0x89cc('0x13')](','),process['argv'][0x4][_0x89cc('0x13')](','));if(!process['argv'][0x5]||process[_0x89cc('0xf')][0x5]===_0x89cc('0xe')||process[_0x89cc('0xf')][0x5]==='null'){throw new Error(_0x89cc('0x14'));}var LISTID=process[_0x89cc('0xf')][0x5];var COMPANYID=process[_0x89cc('0xf')][0x6]&&process[_0x89cc('0xf')][0x6]!=='undefined'&&process['argv'][0x6]!==_0x89cc('0x10')?process[_0x89cc('0xf')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process['argv'][0x7]!==_0x89cc('0xe')&&process[_0x89cc('0xf')][0x7]!==_0x89cc('0x10')?process[_0x89cc('0xf')][0x7]:null;if(!process['argv'][0x8]||process[_0x89cc('0xf')][0x8]===_0x89cc('0xe')||process['argv'][0x8]===_0x89cc('0x10')){throw new Error(_0x89cc('0x15'));}var SOCKET_TIMESTAMP=process[_0x89cc('0xf')][0x8];}catch(_0x272201){logger[_0x89cc('0x16')](_0x272201);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(_0x6f6293,_0x14315a,_0x4d53f5,_0x566620){var _0x467b83={'message':_0x14315a};_0x467b83[_0x6f6293]=!![];if(_0x4d53f5){_0x467b83[_0x89cc('0x17')]=_0x4d53f5;}if(_0x566620){_0x467b83[_0x89cc('0x18')]=_0x566620;}return _0x467b83;}function isEmail(_0x334a89){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))*$/[_0x89cc('0x19')](_0x334a89);}function checkRow(_0x3cb140,_0x325bec,_0x1d8400){return new BPromise(function(_0x1b1df1,_0x89ae57){if(_['isNil'](_0x3cb140)){return _0x89ae57(handleCheckRowError(_0x89cc('0x16'),_0x89cc('0x1a'),null,_0x1d8400));}if(_0x3cb140['errors']&&_0x3cb140[_0x89cc('0x1b')][_0x89cc('0x1c')]){var _0x3758f8=_[_0x89cc('0x1d')](_0x3cb140['errors'],_0x89cc('0x1e'))[_0x89cc('0x1f')](';');return _0x89ae57(handleCheckRowError('error',_0x3758f8,null,_0x1d8400));}var _0x11ce18={};for(var _0x1c6b4e in FIELDS){if(FIELDS[_0x89cc('0x20')](_0x1c6b4e)&&FIELDS[_0x1c6b4e]){_0x11ce18[_0x1c6b4e]=_0x3cb140[_0x89cc('0x21')][0x0][FIELDS[_0x1c6b4e]]||_0x3cb140[_0x89cc('0x21')][0x0]['\ufeff'+FIELDS[_0x1c6b4e]];}}if(!_0x11ce18[_0x89cc('0x22')]){return _0x89ae57(handleCheckRowError(_0x89cc('0x16'),_0x89cc('0x23'),null,_0x1d8400));}if(!_0x11ce18[_0x89cc('0x24')]){return _0x89ae57(handleCheckRowError(_0x89cc('0x16'),_0x89cc('0x25'),null,_0x1d8400));}if(_0x11ce18[_0x89cc('0x26')]){var _0x554ebf=moment(_0x11ce18['birthDate'],_0x89cc('0x27'));if(!_0x554ebf[_0x89cc('0x28')]()){return _0x89ae57(handleCheckRowError(_0x89cc('0x16'),_0x89cc('0x29'),null,_0x1d8400));}}if(_0x11ce18[_0x89cc('0x2a')]){if(!isEmail(_0x11ce18['email'])){return _0x89ae57(handleCheckRowError(_0x89cc('0x16'),_0x89cc('0x2b'),null,_0x1d8400));}}_0x11ce18[_0x89cc('0x2c')]=LISTID;_0x11ce18[_0x89cc('0x2d')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x325bec){var _0x4641f7={};for(var _0x5ec46a=0x0,_0x56b6b5=DUPLICATES[_0x89cc('0x1c')];_0x5ec46a<_0x56b6b5;_0x5ec46a+=0x1){_0x4641f7[DUPLICATES[_0x5ec46a]]=_0x11ce18[DUPLICATES[_0x5ec46a]];}var _0x1a0a1c=_[_0x89cc('0x2e')](_0x325bec,_0x4641f7);if(_0x1a0a1c){return _0x89ae57(handleCheckRowError(_0x89cc('0x2f'),_0x89cc('0x30'),_0x1a0a1c,_0x1d8400));}}return db[_0x89cc('0x31')][_0x89cc('0x32')](_0x11ce18,{'raw':!![],'hooks':![],'fields':_[_0x89cc('0x33')](_0x11ce18)})['then'](function(_0x693c90){if(DUPLICATES&&DUPLICATES['length']&&_0x325bec){_0x325bec[_0x89cc('0x34')](_[_0x89cc('0x35')](_0x11ce18,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x693c90['id'];return _0x1b1df1();})['catch'](function(_0x5ceb05){return _0x89ae57(handleCheckRowError('error',_0x89cc('0x36')+(_0x5ceb05[_0x89cc('0x1e')]||JSON[_0x89cc('0x37')](_0x5ceb05)),null,_0x1d8400));});});}function checkHopper(){function _0x3dad99(){return function(_0x414f31){logger[_0x89cc('0x16')]('cmContact',_0x89cc('0x38'),util[_0x89cc('0x39')](_0x414f31,{'showHidden':![],'depth':null}));};}var _0x35a43d=function(_0x182023,_0x1ca0b7){var _0x49fcbf=squel[_0x89cc('0x3a')]()[_0x89cc('0x3b')](_0x89cc('0x3c'))[_0x89cc('0x3d')]([_0x89cc('0x24'),_0x89cc('0x3e'),_0x89cc('0x3f'),_0x89cc('0x2c'),_0x1ca0b7,_0x89cc('0x40'),_0x89cc('0x41')],squel[_0x89cc('0x42')]()[_0x89cc('0x43')](_0x89cc('0x24'),_0x89cc('0x24'))[_0x89cc('0x43')](_0x89cc('0x44'),_0x89cc('0x3e'))[_0x89cc('0x43')]('id','ContactId')[_0x89cc('0x43')](LISTID[_0x89cc('0x45')](),'ListId')[_0x89cc('0x43')](_0x182023['id'][_0x89cc('0x45')](),_0x1ca0b7)[_0x89cc('0x43')](_0x89cc('0x44'),_0x89cc('0x40'))[_0x89cc('0x43')](_0x89cc('0x44'),_0x89cc('0x41'))[_0x89cc('0x46')](_0x89cc('0x47'))[_0x89cc('0x48')](_0x89cc('0x49'))[_0x89cc('0x48')]('ListId\x20=\x20?',LISTID['toString']())['where'](_0x89cc('0x4a'))[_0x89cc('0x48')](_0x89cc('0x4b'),squel['select']()['field']('phone')[_0x89cc('0x46')](_0x89cc('0x3c'))[_0x89cc('0x48')](_0x1ca0b7+_0x89cc('0x4c'),_0x182023['id'][_0x89cc('0x45')]())))[_0x89cc('0x45')]();return _0x49fcbf;};var _0x58a30b=function(_0x22fe13,_0x365716){var _0x5444a0=squel[_0x89cc('0x3a')]()[_0x89cc('0x3b')](_0x89cc('0x3c'))[_0x89cc('0x3d')](['phone',_0x89cc('0x3e'),_0x89cc('0x3f'),_0x89cc('0x2c'),_0x365716,_0x89cc('0x40'),'updatedAt'],squel[_0x89cc('0x42')]()['field']('phone','phone')['field'](_0x89cc('0x44'),_0x89cc('0x3e'))[_0x89cc('0x43')]('id',_0x89cc('0x3f'))[_0x89cc('0x43')](LISTID['toString'](),'ListId')['field'](_0x22fe13['id'][_0x89cc('0x45')](),_0x365716)['field'](_0x89cc('0x44'),_0x89cc('0x40'))[_0x89cc('0x43')](_0x89cc('0x44'),_0x89cc('0x41'))[_0x89cc('0x46')](_0x89cc('0x47'))[_0x89cc('0x48')](_0x89cc('0x49'))[_0x89cc('0x48')]('ListId\x20=\x20?',LISTID[_0x89cc('0x45')]())[_0x89cc('0x48')](_0x89cc('0x4d'),squel['str'](hopperContacts))[_0x89cc('0x48')]('phone\x20IS\x20NOT\x20NULL')[_0x89cc('0x48')]('phone\x20NOT\x20IN\x20(?)',squel[_0x89cc('0x42')]()['field']('calleridnum')[_0x89cc('0x46')](_0x89cc('0x4e'))['where'](_0x365716+_0x89cc('0x4c'),_0x22fe13['id'][_0x89cc('0x45')]()))[_0x89cc('0x48')](_0x89cc('0x4b'),squel[_0x89cc('0x42')]()[_0x89cc('0x43')](_0x89cc('0x24'))[_0x89cc('0x46')](_0x89cc('0x3c'))[_0x89cc('0x48')](_0x365716+_0x89cc('0x4c'),_0x22fe13['id'][_0x89cc('0x45')]())))[_0x89cc('0x45')]();return _0x5444a0;};function _0x2cf49e(_0x3fe732,_0x1e081b){var _0x5c7372=squel[_0x89cc('0x3a')]()[_0x89cc('0x3b')](_0x89cc('0x3c'))[_0x89cc('0x3d')]([_0x89cc('0x24'),_0x89cc('0x3e'),_0x89cc('0x3f'),_0x89cc('0x2c'),_0x1e081b,_0x89cc('0x40'),_0x89cc('0x41')],squel[_0x89cc('0x42')]()[_0x89cc('0x43')](_0x89cc('0x24'),_0x89cc('0x24'))[_0x89cc('0x43')](_0x89cc('0x44'),_0x89cc('0x3e'))[_0x89cc('0x43')]('id',_0x89cc('0x3f'))['field'](LISTID[_0x89cc('0x45')](),_0x89cc('0x2c'))[_0x89cc('0x43')](_0x3fe732['id'][_0x89cc('0x45')](),_0x1e081b)['field'](_0x89cc('0x44'),_0x89cc('0x40'))['field'](_0x89cc('0x44'),_0x89cc('0x41'))[_0x89cc('0x46')](_0x89cc('0x47'))[_0x89cc('0x48')](_0x89cc('0x49'))[_0x89cc('0x48')](_0x89cc('0x4f'),LISTID[_0x89cc('0x45')]())[_0x89cc('0x48')](_0x89cc('0x4d'),squel[_0x89cc('0x50')](hopperContacts))[_0x89cc('0x48')](_0x89cc('0x4a')))[_0x89cc('0x45')]();return _0x5c7372;}function _0x4a377d(_0x5474ce,_0x5c2c28){var _0x55268d=squel['insert']()[_0x89cc('0x3b')](_0x89cc('0x51'))[_0x89cc('0x3d')]([_0x89cc('0x24'),_0x89cc('0x3f'),_0x89cc('0x2c'),_0x5c2c28,_0x89cc('0x40'),_0x89cc('0x41')],squel[_0x89cc('0x42')]()['field'](_0x89cc('0x24'),_0x89cc('0x24'))[_0x89cc('0x43')]('id','ContactId')[_0x89cc('0x43')](LISTID[_0x89cc('0x45')](),_0x89cc('0x2c'))[_0x89cc('0x43')](_0x5474ce['id'][_0x89cc('0x45')](),_0x5c2c28)[_0x89cc('0x43')](_0x89cc('0x44'),_0x89cc('0x40'))['field'](_0x89cc('0x44'),'updatedAt')['from']('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x89cc('0x48')]('ListId\x20=\x20?',LISTID['toString']())[_0x89cc('0x48')](_0x89cc('0x4d'),squel['str'](hopperContacts))[_0x89cc('0x48')]('phone\x20IS\x20NOT\x20NULL'))[_0x89cc('0x45')]();return _0x55268d;}return db[_0x89cc('0x52')]['findAll']({'where':{'type':_0x89cc('0x53')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db['CmList'],'as':_0x89cc('0x54'),'where':{'id':LISTID}}]})[_0x89cc('0x55')](function(_0x23b04c){var _0x1b3bbc=[];if(_0x23b04c){var _0x54ccbf;for(var _0x10232f=0x0,_0x1281ac;_0x10232f<_0x23b04c[_0x89cc('0x1c')];_0x10232f+=0x1){_0x1281ac=_0x23b04c[_0x10232f][_0x89cc('0x56')]({'plain':!![]});switch(_0x1281ac[_0x89cc('0x57')]){case _0x89cc('0x58'):_0x1b3bbc[_0x89cc('0x34')](db[_0x89cc('0x59')][_0x89cc('0x5a')](_0x58a30b(_0x1281ac,_0x89cc('0x5b')))[_0x89cc('0x55')](function(){})[_0x89cc('0x5c')](_0x3dad99()));break;case _0x89cc('0x5d'):_0x1b3bbc[_0x89cc('0x34')](db[_0x89cc('0x59')][_0x89cc('0x5a')](_0x35a43d(_0x1281ac,_0x89cc('0x5b')))[_0x89cc('0x55')](function(){})[_0x89cc('0x5c')](_0x3dad99()));break;default:_0x1b3bbc[_0x89cc('0x34')](db['sequelize'][_0x89cc('0x5a')](_0x2cf49e(_0x1281ac,'VoiceQueueId'))['then'](function(){})[_0x89cc('0x5c')](_0x3dad99()));}}}return _0x1b3bbc;})[_0x89cc('0x5e')]()[_0x89cc('0x55')](function(){return db[_0x89cc('0x52')]['findAll']({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0x89cc('0x5f')],'as':_0x89cc('0x60'),'where':{'id':LISTID}}]})[_0x89cc('0x55')](function(_0x844dcb){var _0x2a6d82=[];if(_0x844dcb){var _0x1bee23;for(var _0x5cf894=0x0,_0x663e1a;_0x5cf894<_0x844dcb[_0x89cc('0x1c')];_0x5cf894+=0x1){_0x663e1a=_0x844dcb[_0x5cf894]['get']({'plain':!![]});_0x2a6d82[_0x89cc('0x34')](db[_0x89cc('0x59')][_0x89cc('0x5a')](_0x4a377d(_0x663e1a,_0x89cc('0x5b')))['then'](function(){})[_0x89cc('0x5c')](_0x3dad99()));}}return _0x2a6d82;})[_0x89cc('0x5e')]();})[_0x89cc('0x55')](function(){return db[_0x89cc('0x61')][_0x89cc('0x62')]({'attributes':['id',_0x89cc('0x57')],'include':[{'model':db[_0x89cc('0x5f')],'as':_0x89cc('0x54'),'where':{'id':LISTID}}]})[_0x89cc('0x55')](function(_0x5e11c9){var _0x41f3fc=[];if(_0x5e11c9){for(var _0x1fc472=0x0,_0x308dd8;_0x1fc472<_0x5e11c9[_0x89cc('0x1c')];_0x1fc472+=0x1){_0x308dd8=_0x5e11c9[_0x1fc472][_0x89cc('0x56')]({'plain':!![]});switch(_0x308dd8[_0x89cc('0x57')]){case _0x89cc('0x58'):_0x41f3fc[_0x89cc('0x34')](db['sequelize'][_0x89cc('0x5a')](_0x58a30b(_0x308dd8,'CampaignId'))[_0x89cc('0x55')](function(){})['catch'](_0x3dad99()));break;case'onlyIfOpen':_0x41f3fc[_0x89cc('0x34')](db['sequelize'][_0x89cc('0x5a')](_0x35a43d(_0x308dd8,'CampaignId'))[_0x89cc('0x55')](function(){})[_0x89cc('0x5c')](_0x3dad99()));break;default:_0x41f3fc[_0x89cc('0x34')](db['sequelize'][_0x89cc('0x5a')](_0x2cf49e(_0x308dd8,_0x89cc('0x63')))[_0x89cc('0x55')](function(){})[_0x89cc('0x5c')](_0x3dad99()));}}}return _0x41f3fc;})[_0x89cc('0x5e')]();})['then'](function(){return db[_0x89cc('0x61')]['findAll']({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x89cc('0x60'),'where':{'id':LISTID}}]})['then'](function(_0x1c594d){var _0x391caa=[];if(_0x1c594d){for(var _0x37efc5=0x0,_0x2019d5;_0x37efc5<_0x1c594d['length'];_0x37efc5+=0x1){_0x2019d5=_0x1c594d[_0x37efc5][_0x89cc('0x56')]({'plain':!![]});_0x391caa[_0x89cc('0x34')](db['sequelize'][_0x89cc('0x5a')](_0x4a377d(_0x2019d5,'CampaignId'))[_0x89cc('0x55')](function(){})[_0x89cc('0x5c')](_0x3dad99()));}}return _0x391caa;})[_0x89cc('0x5e')]();})[_0x89cc('0x5c')](function(_0x35e9e3){logger[_0x89cc('0x16')](_0x89cc('0x64'),_0x89cc('0x65'),_0x35e9e3[_0x89cc('0x1e')]);});}var processPromises=function(_0x5d0d6c){return BPromise[_0x89cc('0x5e')](promises)['then'](function(_0x1c35f6){})[_0x89cc('0x5c')](function(_0x130214){logger['error'](_0x89cc('0x66'),JSON[_0x89cc('0x37')](_0x130214));})[_0x89cc('0x67')](function(){socket[_0x89cc('0x68')](_0x89cc('0x69')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x5d0d6c){return _0x5d0d6c[_0x89cc('0x6a')]();}});};var endCsv=function(){return BPromise[_0x89cc('0x6b')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x89cc('0x55')](function(){socket[_0x89cc('0x68')](_0x89cc('0x69')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x89cc('0x6c')](FILEPATH);}catch(_0x2f6bee){logger[_0x89cc('0x16')](_0x89cc('0x6d'),JSON[_0x89cc('0x37')](_0x2f6bee));}finally{process[_0x89cc('0x6e')](0x0);}});};process['on'](_0x89cc('0x6f'),function(){logger[_0x89cc('0x70')](_0x89cc('0x71'));endCsv();});function main(){return BPromise['resolve']()[_0x89cc('0x55')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x89cc('0x13')](',');return db[_0x89cc('0x31')][_0x89cc('0x62')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x515171){var _0x552510=fs[_0x89cc('0x72')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x552510,{'header':!![],'skipEmptyLines':!![],'step':function(_0x4cc41c,_0x25ce42){total+=0x1;var _0x31ed2c=total;promises['push'](checkRow(_0x4cc41c,_0x515171,_0x31ed2c)['then'](function(){success+=0x1;})[_0x89cc('0x5c')](function(_0x3871bf){if(_0x3871bf[_0x89cc('0x16')]){errors+=0x1;delete _0x3871bf[_0x89cc('0x16')];}else if(_0x3871bf[_0x89cc('0x2f')]){duplicates+=0x1;delete _0x3871bf[_0x89cc('0x2f')];}rows[_0x89cc('0x34')](_0x3871bf);}));if(total%0xc8===0x0){_0x25ce42[_0x89cc('0x73')]();return processPromises(_0x25ce42);}},'complete':function(){return processPromises()[_0x89cc('0x55')](function(){logger['info'](_0x89cc('0x74'));endCsv();});},'error':function(_0x1ecc5f,_0x49257c){logger[_0x89cc('0x70')]('CSV\x20parse\x20error',JSON[_0x89cc('0x37')](_0x1ecc5f));endCsv();}});})[_0x89cc('0x5c')](function(_0x3a8c7c){logger[_0x89cc('0x16')](_0x89cc('0x75'),JSON[_0x89cc('0x37')](_0x3a8c7c));});}main(); \ No newline at end of file +var _0x9e19=['../../../mysqldb','../../../config/environment','../../../config/logger','api','defaults','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','null','Missing\x20filepath\x20parameter!','undefined','Missing\x20binding\x20parameters!','split','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','CompanyId','duplicate','keys','then','push','pick','stringify','cmContact','checkHopper','inspect','insert','scheduledAt','ContactId','ListId','updatedAt','select','field','NOW()','toString','createdAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','into','cm_hopper','fromQuery','ListId\x20=\x20?','str','calleridnum','\x20=\x20?','id\x20IN\x20?','findAll','dialCheckDuplicateType','CmList','sequelize','query','VoiceQueueId','catch','onlyIfOpen','all','VoiceQueue','outbound','get','Lists','always','CampaignId','Campaign','BlackLists','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','resume','resolve','emit','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','info','CSV\x20import\x20process\x20stopped!','createReadStream','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','lodash','squel','papaparse','ioredis'];(function(_0x53f126,_0x2a450a){var _0x4d613d=function(_0x19bd53){while(--_0x19bd53){_0x53f126['push'](_0x53f126['shift']());}};_0x4d613d(++_0x2a450a);}(_0x9e19,0x146));var _0x99e1=function(_0x35bd6c,_0x585087){_0x35bd6c=_0x35bd6c-0x0;var _0x2f421d=_0x9e19[_0x35bd6c];return _0x2f421d;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x99e1('0x0'));var fs=require('fs');var squel=require(_0x99e1('0x1'));var Papa=require(_0x99e1('0x2'));var Redis=require(_0x99e1('0x3'));var db=require(_0x99e1('0x4'))['db'];var config=require(_0x99e1('0x5'));var logger=require(_0x99e1('0x6'))(_0x99e1('0x7'));config['redis']=_[_0x99e1('0x8')](config[_0x99e1('0x9')],{'host':_0x99e1('0xa'),'port':0x18eb});var socket=require(_0x99e1('0xb'))(new Redis(config['redis']));require(_0x99e1('0xc'))[_0x99e1('0xd')](socket);try{if(!process[_0x99e1('0xe')][0x2]||process[_0x99e1('0xe')][0x2]==='undefined'||process[_0x99e1('0xe')][0x2]===_0x99e1('0xf')){throw new Error(_0x99e1('0x10'));}var FILEPATH=process[_0x99e1('0xe')][0x2];if(!process['argv'][0x3]||process[_0x99e1('0xe')][0x3]===_0x99e1('0x11')||process[_0x99e1('0xe')][0x3]==='null'||!process[_0x99e1('0xe')][0x4]||process['argv'][0x4]===_0x99e1('0x11')||process[_0x99e1('0xe')][0x4]===_0x99e1('0xf')){throw new Error(_0x99e1('0x12'));}var FIELDS=_['zipObject'](process[_0x99e1('0xe')][0x3][_0x99e1('0x13')](','),process[_0x99e1('0xe')][0x4]['split'](','));if(!process[_0x99e1('0xe')][0x5]||process[_0x99e1('0xe')][0x5]===_0x99e1('0x11')||process[_0x99e1('0xe')][0x5]===_0x99e1('0xf')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x99e1('0xe')][0x6]&&process[_0x99e1('0xe')][0x6]!==_0x99e1('0x11')&&process[_0x99e1('0xe')][0x6]!==_0x99e1('0xf')?process[_0x99e1('0xe')][0x6]:null;var DUPLICATES=process[_0x99e1('0xe')][0x7]&&process[_0x99e1('0xe')][0x7]!==_0x99e1('0x11')&&process['argv'][0x7]!==_0x99e1('0xf')?process[_0x99e1('0xe')][0x7]:null;if(!process[_0x99e1('0xe')][0x8]||process[_0x99e1('0xe')][0x8]==='undefined'||process[_0x99e1('0xe')][0x8]===_0x99e1('0xf')){throw new Error(_0x99e1('0x14'));}var SOCKET_TIMESTAMP=process[_0x99e1('0xe')][0x8];}catch(_0x5022a5){logger[_0x99e1('0x15')](_0x5022a5);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(_0x3f24c2,_0x102275,_0x225b86,_0x4dff10){var _0x2c77e3={'message':_0x102275};_0x2c77e3[_0x3f24c2]=!![];if(_0x225b86){_0x2c77e3[_0x99e1('0x16')]=_0x225b86;}if(_0x4dff10){_0x2c77e3[_0x99e1('0x17')]=_0x4dff10;}return _0x2c77e3;}function isEmail(_0x5891bd){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))*$/[_0x99e1('0x18')](_0x5891bd);}function checkRow(_0x17479d,_0x4756bc,_0x3439a6){return new BPromise(function(_0x4a8828,_0x524adf){if(_['isNil'](_0x17479d)){return _0x524adf(handleCheckRowError(_0x99e1('0x15'),_0x99e1('0x19'),null,_0x3439a6));}if(_0x17479d[_0x99e1('0x1a')]&&_0x17479d[_0x99e1('0x1a')][_0x99e1('0x1b')]){var _0x573a02=_['map'](_0x17479d[_0x99e1('0x1a')],_0x99e1('0x1c'))[_0x99e1('0x1d')](';');return _0x524adf(handleCheckRowError('error',_0x573a02,null,_0x3439a6));}var _0x3b35eb={};for(var _0xc51918 in FIELDS){if(FIELDS[_0x99e1('0x1e')](_0xc51918)&&FIELDS[_0xc51918]){_0x3b35eb[_0xc51918]=_0x17479d[_0x99e1('0x1f')][0x0][FIELDS[_0xc51918]]||_0x17479d[_0x99e1('0x1f')][0x0]['\ufeff'+FIELDS[_0xc51918]];}}if(!_0x3b35eb[_0x99e1('0x20')]){return _0x524adf(handleCheckRowError('error',_0x99e1('0x21'),null,_0x3439a6));}if(!_0x3b35eb[_0x99e1('0x22')]){return _0x524adf(handleCheckRowError('error',_0x99e1('0x23'),null,_0x3439a6));}if(_0x3b35eb['birthDate']){var _0x496d5c=moment(_0x3b35eb[_0x99e1('0x24')],_0x99e1('0x25'));if(!_0x496d5c[_0x99e1('0x26')]()){return _0x524adf(handleCheckRowError(_0x99e1('0x15'),_0x99e1('0x27'),null,_0x3439a6));}}if(_0x3b35eb[_0x99e1('0x28')]){if(!isEmail(_0x3b35eb[_0x99e1('0x28')])){return _0x524adf(handleCheckRowError('error',_0x99e1('0x29'),null,_0x3439a6));}}_0x3b35eb['ListId']=LISTID;_0x3b35eb[_0x99e1('0x2a')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x99e1('0x1b')]&&_0x4756bc){var _0x3cdf7b={};for(var _0x1710b5=0x0,_0x517ea7=DUPLICATES[_0x99e1('0x1b')];_0x1710b5<_0x517ea7;_0x1710b5+=0x1){_0x3cdf7b[DUPLICATES[_0x1710b5]]=_0x3b35eb[DUPLICATES[_0x1710b5]];}var _0x505e93=_['find'](_0x4756bc,_0x3cdf7b);if(_0x505e93){return _0x524adf(handleCheckRowError(_0x99e1('0x2b'),'Duplicate\x20Contact',_0x505e93,_0x3439a6));}}return db['CmContact']['create'](_0x3b35eb,{'raw':!![],'hooks':![],'fields':_[_0x99e1('0x2c')](_0x3b35eb)})[_0x99e1('0x2d')](function(_0x13f850){if(DUPLICATES&&DUPLICATES[_0x99e1('0x1b')]&&_0x4756bc){_0x4756bc[_0x99e1('0x2e')](_[_0x99e1('0x2f')](_0x3b35eb,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x13f850['id'];return _0x4a8828();})['catch'](function(_0x4d04f1){return _0x524adf(handleCheckRowError(_0x99e1('0x15'),'Error\x20while\x20creating\x20contact:\x20'+(_0x4d04f1[_0x99e1('0x1c')]||JSON[_0x99e1('0x30')](_0x4d04f1)),null,_0x3439a6));});});}function checkHopper(){function _0x5cd400(){return function(_0x243784){logger['error'](_0x99e1('0x31'),_0x99e1('0x32'),util[_0x99e1('0x33')](_0x243784,{'showHidden':![],'depth':null}));};}var _0x506d71=function(_0x52790e,_0x19aa93){var _0x268cbe=squel[_0x99e1('0x34')]()['into']('cm_hopper')['fromQuery']([_0x99e1('0x22'),_0x99e1('0x35'),_0x99e1('0x36'),_0x99e1('0x37'),_0x19aa93,'createdAt',_0x99e1('0x38')],squel[_0x99e1('0x39')]()[_0x99e1('0x3a')](_0x99e1('0x22'),_0x99e1('0x22'))[_0x99e1('0x3a')](_0x99e1('0x3b'),_0x99e1('0x35'))[_0x99e1('0x3a')]('id',_0x99e1('0x36'))[_0x99e1('0x3a')](LISTID[_0x99e1('0x3c')](),_0x99e1('0x37'))[_0x99e1('0x3a')](_0x52790e['id'][_0x99e1('0x3c')](),_0x19aa93)[_0x99e1('0x3a')](_0x99e1('0x3b'),_0x99e1('0x3d'))[_0x99e1('0x3a')]('NOW()',_0x99e1('0x38'))[_0x99e1('0x3e')](_0x99e1('0x3f'))[_0x99e1('0x40')](_0x99e1('0x41'))[_0x99e1('0x40')]('ListId\x20=\x20?',LISTID[_0x99e1('0x3c')]())['where'](_0x99e1('0x42'))[_0x99e1('0x40')](_0x99e1('0x43'),squel[_0x99e1('0x39')]()[_0x99e1('0x3a')]('phone')[_0x99e1('0x3e')]('cm_hopper')[_0x99e1('0x40')](_0x19aa93+'\x20=\x20?',_0x52790e['id'][_0x99e1('0x3c')]())))[_0x99e1('0x3c')]();return _0x268cbe;};var _0xaf70c6=function(_0x1fbea0,_0x3e1ad8){var _0x144bf2=squel[_0x99e1('0x34')]()[_0x99e1('0x44')](_0x99e1('0x45'))[_0x99e1('0x46')]([_0x99e1('0x22'),_0x99e1('0x35'),'ContactId','ListId',_0x3e1ad8,_0x99e1('0x3d'),_0x99e1('0x38')],squel[_0x99e1('0x39')]()[_0x99e1('0x3a')]('phone','phone')[_0x99e1('0x3a')](_0x99e1('0x3b'),_0x99e1('0x35'))[_0x99e1('0x3a')]('id',_0x99e1('0x36'))[_0x99e1('0x3a')](LISTID[_0x99e1('0x3c')](),_0x99e1('0x37'))[_0x99e1('0x3a')](_0x1fbea0['id']['toString'](),_0x3e1ad8)[_0x99e1('0x3a')](_0x99e1('0x3b'),'createdAt')[_0x99e1('0x3a')](_0x99e1('0x3b'),_0x99e1('0x38'))[_0x99e1('0x3e')](_0x99e1('0x3f'))[_0x99e1('0x40')](_0x99e1('0x41'))['where'](_0x99e1('0x47'),LISTID[_0x99e1('0x3c')]())[_0x99e1('0x40')]('id\x20IN\x20?',squel[_0x99e1('0x48')](hopperContacts))[_0x99e1('0x40')](_0x99e1('0x42'))['where'](_0x99e1('0x43'),squel[_0x99e1('0x39')]()[_0x99e1('0x3a')](_0x99e1('0x49'))[_0x99e1('0x3e')]('cm_hopper_final')['where'](_0x3e1ad8+_0x99e1('0x4a'),_0x1fbea0['id'][_0x99e1('0x3c')]()))['where'](_0x99e1('0x43'),squel[_0x99e1('0x39')]()['field'](_0x99e1('0x22'))[_0x99e1('0x3e')]('cm_hopper')[_0x99e1('0x40')](_0x3e1ad8+_0x99e1('0x4a'),_0x1fbea0['id'][_0x99e1('0x3c')]())))['toString']();return _0x144bf2;};function _0x8abbf4(_0x23d9d8,_0x50568d){var _0x3b5ffa=squel[_0x99e1('0x34')]()[_0x99e1('0x44')](_0x99e1('0x45'))['fromQuery']([_0x99e1('0x22'),_0x99e1('0x35'),_0x99e1('0x36'),_0x99e1('0x37'),_0x50568d,_0x99e1('0x3d'),'updatedAt'],squel[_0x99e1('0x39')]()[_0x99e1('0x3a')](_0x99e1('0x22'),_0x99e1('0x22'))[_0x99e1('0x3a')](_0x99e1('0x3b'),'scheduledAt')[_0x99e1('0x3a')]('id',_0x99e1('0x36'))[_0x99e1('0x3a')](LISTID[_0x99e1('0x3c')](),_0x99e1('0x37'))[_0x99e1('0x3a')](_0x23d9d8['id'][_0x99e1('0x3c')](),_0x50568d)[_0x99e1('0x3a')](_0x99e1('0x3b'),'createdAt')[_0x99e1('0x3a')]('NOW()',_0x99e1('0x38'))[_0x99e1('0x3e')]('cm_contacts')[_0x99e1('0x40')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',LISTID[_0x99e1('0x3c')]())['where'](_0x99e1('0x4b'),squel['str'](hopperContacts))[_0x99e1('0x40')]('phone\x20IS\x20NOT\x20NULL'))['toString']();return _0x3b5ffa;}function _0x349f35(_0xb59ab3,_0x338461){var _0x1584f4=squel['insert']()['into']('cm_hopper_black')['fromQuery']([_0x99e1('0x22'),_0x99e1('0x36'),_0x99e1('0x37'),_0x338461,'createdAt','updatedAt'],squel[_0x99e1('0x39')]()['field'](_0x99e1('0x22'),_0x99e1('0x22'))[_0x99e1('0x3a')]('id',_0x99e1('0x36'))[_0x99e1('0x3a')](LISTID[_0x99e1('0x3c')](),'ListId')['field'](_0xb59ab3['id'][_0x99e1('0x3c')](),_0x338461)[_0x99e1('0x3a')](_0x99e1('0x3b'),_0x99e1('0x3d'))['field'](_0x99e1('0x3b'),_0x99e1('0x38'))[_0x99e1('0x3e')](_0x99e1('0x3f'))['where'](_0x99e1('0x41'))[_0x99e1('0x40')](_0x99e1('0x47'),LISTID[_0x99e1('0x3c')]())['where'](_0x99e1('0x4b'),squel['str'](hopperContacts))[_0x99e1('0x40')](_0x99e1('0x42')))[_0x99e1('0x3c')]();return _0x1584f4;}return db['VoiceQueue'][_0x99e1('0x4c')]({'where':{'type':'outbound'},'attributes':['id',_0x99e1('0x4d')],'include':[{'model':db[_0x99e1('0x4e')],'as':'Lists','where':{'id':LISTID}}]})[_0x99e1('0x2d')](function(_0x291188){var _0x214584=[];if(_0x291188){var _0x3e5be0;for(var _0x56d810=0x0,_0x19f615;_0x56d810<_0x291188[_0x99e1('0x1b')];_0x56d810+=0x1){_0x19f615=_0x291188[_0x56d810]['get']({'plain':!![]});switch(_0x19f615['dialCheckDuplicateType']){case'always':_0x214584[_0x99e1('0x2e')](db[_0x99e1('0x4f')][_0x99e1('0x50')](_0xaf70c6(_0x19f615,_0x99e1('0x51')))[_0x99e1('0x2d')](function(){})[_0x99e1('0x52')](_0x5cd400()));break;case _0x99e1('0x53'):_0x214584[_0x99e1('0x2e')](db[_0x99e1('0x4f')][_0x99e1('0x50')](_0x506d71(_0x19f615,_0x99e1('0x51')))[_0x99e1('0x2d')](function(){})['catch'](_0x5cd400()));break;default:_0x214584[_0x99e1('0x2e')](db[_0x99e1('0x4f')][_0x99e1('0x50')](_0x8abbf4(_0x19f615,'VoiceQueueId'))[_0x99e1('0x2d')](function(){})[_0x99e1('0x52')](_0x5cd400()));}}}return _0x214584;})[_0x99e1('0x54')]()['then'](function(){return db[_0x99e1('0x55')][_0x99e1('0x4c')]({'where':{'type':_0x99e1('0x56')},'attributes':['id'],'include':[{'model':db['CmList'],'as':'BlackLists','where':{'id':LISTID}}]})[_0x99e1('0x2d')](function(_0x582711){var _0x2258d3=[];if(_0x582711){var _0x1638fb;for(var _0x116edb=0x0,_0x3ad746;_0x116edb<_0x582711['length'];_0x116edb+=0x1){_0x3ad746=_0x582711[_0x116edb][_0x99e1('0x57')]({'plain':!![]});_0x2258d3[_0x99e1('0x2e')](db[_0x99e1('0x4f')][_0x99e1('0x50')](_0x349f35(_0x3ad746,'VoiceQueueId'))[_0x99e1('0x2d')](function(){})[_0x99e1('0x52')](_0x5cd400()));}}return _0x2258d3;})[_0x99e1('0x54')]();})[_0x99e1('0x2d')](function(){return db['Campaign'][_0x99e1('0x4c')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x99e1('0x4e')],'as':_0x99e1('0x58'),'where':{'id':LISTID}}]})[_0x99e1('0x2d')](function(_0x1226bf){var _0x51e787=[];if(_0x1226bf){for(var _0x5da02e=0x0,_0x321ac4;_0x5da02e<_0x1226bf[_0x99e1('0x1b')];_0x5da02e+=0x1){_0x321ac4=_0x1226bf[_0x5da02e][_0x99e1('0x57')]({'plain':!![]});switch(_0x321ac4[_0x99e1('0x4d')]){case _0x99e1('0x59'):_0x51e787[_0x99e1('0x2e')](db['sequelize'][_0x99e1('0x50')](_0xaf70c6(_0x321ac4,_0x99e1('0x5a')))[_0x99e1('0x2d')](function(){})[_0x99e1('0x52')](_0x5cd400()));break;case _0x99e1('0x53'):_0x51e787[_0x99e1('0x2e')](db[_0x99e1('0x4f')][_0x99e1('0x50')](_0x506d71(_0x321ac4,_0x99e1('0x5a')))[_0x99e1('0x2d')](function(){})[_0x99e1('0x52')](_0x5cd400()));break;default:_0x51e787['push'](db['sequelize']['query'](_0x8abbf4(_0x321ac4,_0x99e1('0x5a')))[_0x99e1('0x2d')](function(){})[_0x99e1('0x52')](_0x5cd400()));}}}return _0x51e787;})[_0x99e1('0x54')]();})['then'](function(){return db[_0x99e1('0x5b')][_0x99e1('0x4c')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x99e1('0x5c'),'where':{'id':LISTID}}]})['then'](function(_0x52f5d6){var _0x58bea8=[];if(_0x52f5d6){for(var _0xd19589=0x0,_0x1bef1b;_0xd19589<_0x52f5d6[_0x99e1('0x1b')];_0xd19589+=0x1){_0x1bef1b=_0x52f5d6[_0xd19589]['get']({'plain':!![]});_0x58bea8[_0x99e1('0x2e')](db[_0x99e1('0x4f')]['query'](_0x349f35(_0x1bef1b,_0x99e1('0x5a')))[_0x99e1('0x2d')](function(){})[_0x99e1('0x52')](_0x5cd400()));}}return _0x58bea8;})[_0x99e1('0x54')]();})['catch'](function(_0xfb42bc){logger[_0x99e1('0x15')](_0x99e1('0x5d'),_0x99e1('0x5e'),_0xfb42bc['message']);});}var processPromises=function(_0x11ade9){return BPromise[_0x99e1('0x54')](promises)[_0x99e1('0x2d')](function(_0x38eb7e){})[_0x99e1('0x52')](function(_0x2f9313){logger['error'](_0x99e1('0x5f'),JSON[_0x99e1('0x30')](_0x2f9313));})[_0x99e1('0x60')](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x11ade9){return _0x11ade9[_0x99e1('0x61')]();}});};var endCsv=function(){return BPromise[_0x99e1('0x62')]()[_0x99e1('0x2d')](function(){if(hopperContacts){return checkHopper();}})[_0x99e1('0x2d')](function(){socket[_0x99e1('0x63')](_0x99e1('0x64')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x99e1('0x65')](FILEPATH);}catch(_0x51c261){logger[_0x99e1('0x15')](_0x99e1('0x66'),JSON[_0x99e1('0x30')](_0x51c261));}finally{process[_0x99e1('0x67')](0x0);}});};process['on']('SIGINT',function(){logger[_0x99e1('0x68')](_0x99e1('0x69'));endCsv();});function main(){return BPromise[_0x99e1('0x62')]()[_0x99e1('0x2d')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x99e1('0x13')](',');return db['CmContact'][_0x99e1('0x4c')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x99e1('0x2d')](function(_0x5543e1){var _0x42207a=fs[_0x99e1('0x6a')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x42207a,{'header':!![],'skipEmptyLines':!![],'step':function(_0x581847,_0x3996c3){total+=0x1;var _0xebd84c=total;promises[_0x99e1('0x2e')](checkRow(_0x581847,_0x5543e1,_0xebd84c)[_0x99e1('0x2d')](function(){success+=0x1;})[_0x99e1('0x52')](function(_0x308afb){if(_0x308afb[_0x99e1('0x15')]){errors+=0x1;delete _0x308afb[_0x99e1('0x15')];}else if(_0x308afb[_0x99e1('0x2b')]){duplicates+=0x1;delete _0x308afb[_0x99e1('0x2b')];}rows[_0x99e1('0x2e')](_0x308afb);}));if(total%0xc8===0x0){_0x3996c3['pause']();return processPromises(_0x3996c3);}},'complete':function(){return processPromises()[_0x99e1('0x2d')](function(){logger[_0x99e1('0x68')](_0x99e1('0x6b'));endCsv();});},'error':function(_0x4bd182,_0x5d3db5){logger[_0x99e1('0x68')](_0x99e1('0x6c'),JSON[_0x99e1('0x30')](_0x4bd182));endCsv();}});})[_0x99e1('0x52')](function(_0x364a76){logger[_0x99e1('0x15')](_0x99e1('0x6d'),JSON[_0x99e1('0x30')](_0x364a76));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index c65d5e7..f508b9e 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 _0x7dcf=['ioredis','../../../mysqldb','../../../config/logger','import','defaults','redis','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','select','field','from','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','AdditionalPhones','push','split','all','then','length','filter','CmContactHasItem','updated','create','PHONE','inserted','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','cm_hopper','fromQuery','phone','ContactId','ListId','createdAt','priority','recallme','fields','cm_contacts','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','into','updatedAt','join','cm_contacts.ListId\x20=\x20','cm_hopper_black','ListId\x20=\x20?','\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_hopper.ListId\x20=\x20?','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','MIN(id)','min_id','Received\x20SIGINT','message','errors','code','info','spread','catch','error','main','stringify','start','binding','clone','socket_timestamp','root','server/files/tmp','.csv','ContactItemType','name','keys','writeFileSync','parse','createReadStream','data','rows','_description','isNil','hasOwnProperty','trim','replace','scheduledat','isValid','isNaN','UserId','includes','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','find','itemTypeId','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','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\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','each','contactTypeId','voice_queues_has_cm_lists','VoiceQueueId','voice_queues_has_cm_blacklists','voice_queues','campaigns','campaigns_has_cm_blacklists','CampaignId','finish','affectedRows','unlink','exit','complete','argv','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel'];(function(_0x5f3ebf,_0x53ab27){var _0x514167=function(_0x5b9ad4){while(--_0x5b9ad4){_0x5f3ebf['push'](_0x5f3ebf['shift']());}};_0x514167(++_0x53ab27);}(_0x7dcf,0x1df));var _0xf7dc=function(_0x3cf7df,_0x43b053){_0x3cf7df=_0x3cf7df-0x0;var _0x52ca51=_0x7dcf[_0x3cf7df];return _0x52ca51;};'use strict';var fs=require('fs');var path=require(_0xf7dc('0x0'));var _=require(_0xf7dc('0x1'));var Papa=require(_0xf7dc('0x2'));var util=require(_0xf7dc('0x3'));var BPromise=require(_0xf7dc('0x4'));var moment=require(_0xf7dc('0x5'));var squel=require(_0xf7dc('0x6'));var Redis=require(_0xf7dc('0x7'));var db=require(_0xf7dc('0x8'))['db'];var config=require('../../../config/environment');var logger=require(_0xf7dc('0x9'))(_0xf7dc('0xa'));config['redis']=_[_0xf7dc('0xb')](config[_0xf7dc('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xf7dc('0xd'))(new Redis(config[_0xf7dc('0xc')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0xf7dc('0xe')](_0xf7dc('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x5b8401){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'](_0x5b8401);}function selectNotIn(_0x519950,_0x1eecce,_0x47f516,_0x1c88c1,_0x51385c){return squel[_0xf7dc('0x10')]()[_0xf7dc('0x11')]('phone')[_0xf7dc('0x12')](_0x1c88c1)['join'](_0x1eecce,null,_0x1eecce+_0xf7dc('0x13')+_0x1c88c1+'.'+_0x47f516)[_0xf7dc('0x14')](_0x1c88c1+'.'+_0x47f516+'\x20=\x20'+_0x519950+'.'+_0x47f516)[_0xf7dc('0x14')](_0x1eecce+_0xf7dc('0x15')+_0x51385c['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x23a5da,_0x32c835){promisesAdditionalPhones=[];return db[_0xf7dc('0x16')][_0xf7dc('0x17')]({'raw':!![],'attributes':['id',_0xf7dc('0x18')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})['then'](function(_0x42da16){if(_0x42da16!==null){var _0x28f284=[];for(var _0x1bd62d=0x0;_0x1bd62d<_0x42da16['length'];_0x1bd62d++){var _0x554e92=_0x42da16[_0x1bd62d];_0x28f284[_0xf7dc('0x19')](insertAdditionalPhones(_0x554e92));}}Promise['all'](_0x28f284)['then'](function(){_0x23a5da({'val':0x1});});});});}function insertAdditionalPhones(_0x39bff8){return new Promise(function(_0x22aa12,_0xdde818){var _0x105538=_0x39bff8[_0xf7dc('0x18')];var _0x27ad85=_0x105538[_0xf7dc('0x1a')](';');var _0x1174eb=[];orderBy=0x0;for(var _0x20c347=0x0;_0x20c347<_0x27ad85['length'];_0x20c347++){_0x1174eb[_0xf7dc('0x19')](splitAdditionalPhone(_0x39bff8['id'],_0x27ad85[_0x20c347]));}Promise[_0xf7dc('0x1b')](_0x1174eb)[_0xf7dc('0x1c')](function(){_0x22aa12({'val':_0x27ad85['length']});});});}function splitAdditionalPhone(_0xe8849d,_0x26e7c7){return new Promise(function(_0x3fecfc,_0x39e606){var _0x79cca0=_0x26e7c7[_0xf7dc('0x1a')](':');var _0x58954b=_0x79cca0[0x0];var _0x5a36eb=_0x79cca0[0x1];if(_0x5a36eb!==''){var _0x3ece47=_0x5a36eb[_0xf7dc('0x1a')]('|');var _0x16a20f=[];for(var _0x2ba109=0x0;_0x2ba109<_0x3ece47[_0xf7dc('0x1d')];_0x2ba109++){if(_0x3ece47[_0x2ba109]!==''){var _0x3c5f5a=_[_0xf7dc('0x1e')](promisesAdditionalPhones,{'contactId':_0xe8849d,'phone':_0x3ece47[_0x2ba109]});if(_0x3c5f5a[_0xf7dc('0x1d')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0xe8849d,'contactTypeId':_0x58954b,'phone':_0x3ece47[_0x2ba109],'orderBy':orderBy});}}}_0x3fecfc({'ok':0x1});}else _0x3fecfc({'res':0x0});});}function createAdditionalPhone(_0x3b7dd5,_0x3d01e1,_0x3be943,_0x35bdc4){var _0x3a3492='';var _0x28565f='';var _0x558d8d=_0x3be943[_0xf7dc('0x1a')]('§');_0x3a3492=_0x558d8d[0x0];if(_0x558d8d[_0xf7dc('0x1d')]==0x2)_0x28565f=_0x558d8d[0x1];return new Promise(function(_0x382161,_0x10250b){return db[_0xf7dc('0x1f')]['findOne']({'where':{'CmContactId':_0x3b7dd5,'item':_0x3a3492}})[_0xf7dc('0x1c')](function(_0x196e5d){if(_0x196e5d){return db[_0xf7dc('0x1f')]['update']({'ItemTypeId':_0x3d01e1,'description':_0x28565f,'OrderBy':_0x35bdc4},{'where':{'CmContactId':_0x3b7dd5,'item':_0x3a3492}})[_0xf7dc('0x1c')](function(_0x598152){_0x382161({'res':_0xf7dc('0x20')});});}else{return db[_0xf7dc('0x1f')][_0xf7dc('0x21')]({'CmContactId':_0x3b7dd5,'item':_0x3a3492,'description':_0x28565f,'ItemTypeId':_0x3d01e1,'OrderBy':_0x35bdc4,'ItemClass':_0xf7dc('0x22')})[_0xf7dc('0x1c')](function(_0x1155ce){_0x382161({'res':_0xf7dc('0x23')});});}});});}function insertCmHopper(_0x1b7616,_0x67488a,_0x2ed663,_0x11bc89,_0xdb47d3){var _0x28876a=[_0xf7dc('0x24'),'cm_contacts.scheduledat',_0xf7dc('0x25'),_0xf7dc('0x26'),_0x67488a+'.'+_0x11bc89,_0xf7dc('0x27'),_0xf7dc('0x28'),_0xf7dc('0x29'),_0xf7dc('0x2a'),'\x22'+_0xdb47d3+'\x22'];return squel[_0xf7dc('0x2b')]()['into'](_0xf7dc('0x2c'))[_0xf7dc('0x2d')]([_0xf7dc('0x2e'),'scheduledat',_0xf7dc('0x2f'),_0xf7dc('0x30'),_0x11bc89,_0xf7dc('0x31'),'updatedAt',_0xf7dc('0x32'),'UserId',_0xf7dc('0x33')],squel['select']()[_0xf7dc('0x34')](_0x28876a)[_0xf7dc('0x12')](_0x67488a)['join'](_0xf7dc('0x35'),null,'cm_contacts.ListId\x20=\x20'+_0x67488a+'.CmListId')['join'](_0x2ed663,null,_0x2ed663+_0xf7dc('0x13')+_0x67488a+'.'+_0x11bc89)['where'](_0x67488a+_0xf7dc('0x36'),_0x1b7616)[_0xf7dc('0x14')](_0xf7dc('0x37'),NOW)[_0xf7dc('0x14')](_0xf7dc('0x38'),selectNotIn(_0x67488a,_0x2ed663,_0x11bc89,_0xf7dc('0x2c'),[_0xf7dc('0x39'),_0xf7dc('0x3a')]))[_0xf7dc('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x67488a,_0x2ed663,_0x11bc89,'cm_hopper',[_0xf7dc('0x39')])))[_0xf7dc('0x3b')]();}function insertCmHopperBlack(_0x3a84a3,_0x3e4e79,_0x4b57a8,_0x501c31){var _0x4214fe=[_0xf7dc('0x24'),_0xf7dc('0x25'),_0xf7dc('0x26'),_0x3e4e79+'.'+_0x501c31,_0xf7dc('0x27'),_0xf7dc('0x28')];return squel['insert']()[_0xf7dc('0x3c')]('cm_hopper_black')['fromQuery']([_0xf7dc('0x2e'),_0xf7dc('0x2f'),_0xf7dc('0x30'),_0x501c31,_0xf7dc('0x31'),_0xf7dc('0x3d')],squel[_0xf7dc('0x10')]()[_0xf7dc('0x34')](_0x4214fe)[_0xf7dc('0x12')](_0x3e4e79)[_0xf7dc('0x3e')](_0xf7dc('0x35'),null,_0xf7dc('0x3f')+_0x3e4e79+'.CmListId')['join'](_0x4b57a8,null,_0x4b57a8+_0xf7dc('0x13')+_0x3e4e79+'.'+_0x501c31)['where'](_0x3e4e79+_0xf7dc('0x36'),_0x3a84a3)[_0xf7dc('0x14')](_0xf7dc('0x37'),NOW)[_0xf7dc('0x14')](_0xf7dc('0x38'),squel['select']()[_0xf7dc('0x11')]('phone')[_0xf7dc('0x12')](_0xf7dc('0x40'))[_0xf7dc('0x14')](_0xf7dc('0x41'),_0x3a84a3)[_0xf7dc('0x14')](_0x501c31+_0xf7dc('0x42'),_0x3e4e79+'.'+_0x501c31)))[_0xf7dc('0x3b')]();}function insertCmHopperAdditionalPhones(_0x1f8a51){var _0x577f03=[_0xf7dc('0x43'),_0xf7dc('0x44'),'cm_contact_has_items.OrderBy',_0xf7dc('0x45'),_0xf7dc('0x46')];return squel[_0xf7dc('0x2b')]()[_0xf7dc('0x3c')](_0xf7dc('0x47'))[_0xf7dc('0x2d')]([_0xf7dc('0x48'),_0xf7dc('0x2e'),_0xf7dc('0x49'),'createdAt',_0xf7dc('0x3d')],squel[_0xf7dc('0x10')]()[_0xf7dc('0x34')](_0x577f03)[_0xf7dc('0x12')](_0xf7dc('0x2c'))[_0xf7dc('0x3e')](_0xf7dc('0x35'),null,_0xf7dc('0x4a'))['join'](_0xf7dc('0x4b'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0xf7dc('0x14')](_0xf7dc('0x4c'),_0x1f8a51)[_0xf7dc('0x14')](_0xf7dc('0x37'),NOW))['toString']();}function insertCmContact(_0x2186d3,_0x248efd,_0x57a529,_0x3efcb2){var _0x2b8db6=_['concat'](_['keys'](_0x3efcb2),[_0xf7dc('0x30'),_0xf7dc('0x4d'),'createdAt',_0xf7dc('0x3d')]);return squel[_0xf7dc('0x2b')]()['into'](_0xf7dc('0x35'))[_0xf7dc('0x2d')](_0x2b8db6,squel[_0xf7dc('0x10')]()['fields'](_0x2b8db6)['from'](_0x248efd)[_0xf7dc('0x14')]('('+_0x57a529[_0xf7dc('0x3e')](',')+_0xf7dc('0x4e'),squel['select']()['fields'](_0x57a529)[_0xf7dc('0x12')](_0xf7dc('0x35'))[_0xf7dc('0x14')](_0xf7dc('0x41'),_0x2186d3)['where'](_0xf7dc('0x4f')))[_0xf7dc('0x14')]('id\x20IN\x20?',squel['select']()[_0xf7dc('0x11')](_0xf7dc('0x50'),_0xf7dc('0x51'))['from'](_0x248efd)['group'](_0x57a529[_0xf7dc('0x3e')](','))))[_0xf7dc('0x3b')]();}function handleStop(){logger['info'](_0xf7dc('0x52'));stopped=!![];}function handleUncaughtException(_0x3e14c8){logger['error'](_0x3e14c8[_0xf7dc('0x53')]);process['exit'](0x1);}function handleError(_0x5cae54,_0x26a483){stats[_0xf7dc('0x54')][_0xf7dc('0x19')]({'name':_0x26a483[_0xf7dc('0x55')],'message':_0x26a483[_0xf7dc('0x53')],'row':_0x5cae54});}function handleQuery(_0x1d0737){logger[_0xf7dc('0x56')](_0x1d0737);return db['sequelize']['query'](_0x1d0737)[_0xf7dc('0x57')](function(_0xaa94e9){results[_0xf7dc('0x19')](_0xaa94e9);})[_0xf7dc('0x58')](function(_0x24357a){logger[_0xf7dc('0x59')](_0x24357a[_0xf7dc('0x53')]);});}function main(_0x54c742,_0x15f646,_0x5bc25e,_0x14d1ee){logger[_0xf7dc('0x56')](_0xf7dc('0x5a'),_0x54c742,JSON[_0xf7dc('0x5b')](_0x15f646));process['send'](_0xf7dc('0x5c'));var _0xe12031=_0x15f646[_0xf7dc('0x5d')];var _0x52253b=_[_0xf7dc('0x5e')](_0xe12031);var _0x27f1ce=_0x15f646[_0xf7dc('0x5f')];var _0x4ff372=path[_0xf7dc('0x3e')](config[_0xf7dc('0x60')],_0xf7dc('0x61'),_0x27f1ce+_0xf7dc('0x62'));logger[_0xf7dc('0x56')]('body',_0x15f646);db[_0xf7dc('0x63')][_0xf7dc('0x17')]({'raw':!![],'attributes':['id',_0xf7dc('0x64')]})[_0xf7dc('0x1c')](function(_0x104814){for(var _0x42a159=0x0;_0x42a159<_0x104814['length'];_0x42a159++){if(_0x104814[_0x42a159]['name']in _0xe12031){contactItemTypes[_0xf7dc('0x19')](_0x104814[_0x42a159]);delete _0x52253b[_0x104814[_0x42a159]['name']];hasAdditionalPhones=!![];}for(var _0x325bbc in _0xe12031){if(_0x104814[_0x42a159]['name']+'_description'===_0x325bbc){phoneDescriptions[_0xf7dc('0x19')]({'itemTypeId':_0x104814[_0x42a159]['id'],'description':_0x325bbc});delete _0x52253b[_0x325bbc];}}}if(hasAdditionalPhones)_0x52253b['AdditionalPhones']='';var _0x21ac80=_[_0xf7dc('0x65')](_0x52253b)[_0xf7dc('0x3e')]();logger[_0xf7dc('0x56')]('header',_0x21ac80);fs[_0xf7dc('0x66')](_0x4ff372,_0x21ac80+'\x0a');Papa[_0xf7dc('0x67')](fs[_0xf7dc('0x68')](_0x54c742),{'header':!![],'skipEmptyLines':!![],'step':function(_0x569c4e,_0x28757f){try{for(var _0xa58fd1=0x0,_0xe3310e=[];_0xa58fd1<_0x569c4e[_0xf7dc('0x69')][_0xf7dc('0x1d')];_0xa58fd1++){stats[_0xf7dc('0x6a')]+=0x1;if(_0x569c4e[_0xf7dc('0x54')][_0xa58fd1]){handleError(_0x569c4e[_0xf7dc('0x69')][_0xa58fd1],_0x569c4e[_0xf7dc('0x54')][_0xa58fd1]);}else{var _0x3afcf7=[];var _0xa9c344=[];var _0x28424c={};for(var _0x3fa3fd in _0xe12031){let _0x4abaa1=contactItemTypes['find'](_0x2847aa=>_0x2847aa[_0xf7dc('0x64')]===_0x3fa3fd);let _0x2d3882=contactItemTypes['find'](_0x5be50b=>_0x5be50b[_0xf7dc('0x64')]+_0xf7dc('0x6b')===_0x3fa3fd);if(_[_0xf7dc('0x6c')](_0x4abaa1)&&_[_0xf7dc('0x6c')](_0x2d3882)){if(_0xe12031[_0xf7dc('0x6d')](_0x3fa3fd)){if(_0x569c4e[_0xf7dc('0x69')][_0xa58fd1][_0xe12031[_0x3fa3fd]]){var _0x1b6187=_[_0xf7dc('0x6e')](_0x569c4e['data'][_0xa58fd1][_0xe12031[_0x3fa3fd]][_0xf7dc('0x6f')](/"/g,'\x27'));switch(_0x3fa3fd){case _0xf7dc('0x70'):var _0x5eebb7=moment(_0x1b6187,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x5eebb7[_0xf7dc('0x71')]()){_0xe3310e['push']('\x22'+_0x1b6187+'\x22');}else{_0x3afcf7['push']('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xf7dc('0x32'):var _0x14ce31=parseInt(_0x1b6187);_0x1b6187=_[_0xf7dc('0x72')](_0x14ce31)||_0x14ce31<0x0||_0x14ce31>0x4?_0x14d1ee?0x3:0x2:_0x14ce31;_0xe3310e[_0xf7dc('0x19')]('\x22'+_0x1b6187+'\x22');break;case _0xf7dc('0x73'):var _0x29b98b=parseInt(_0x1b6187);if(_['isNumber'](_0x29b98b)&&_[_0xf7dc('0x74')](_0x5bc25e,_0x29b98b)){_0xe3310e[_0xf7dc('0x19')]('\x22'+_0x29b98b+'\x22');}else{_0x3afcf7['push'](_0xf7dc('0x75'));}break;case'email':if(isEmail(_0x1b6187)){_0xe3310e[_0xf7dc('0x19')]('\x22'+_0x1b6187+'\x22');}else{_0x3afcf7[_0xf7dc('0x19')](_0xf7dc('0x76'));}break;case _0xf7dc('0x77'):var _0x32a0d0=moment(_0x1b6187,'YYYY-MM-DD',!![]);if(_0x32a0d0[_0xf7dc('0x71')]()){_0xe3310e[_0xf7dc('0x19')]('\x22'+_0x1b6187+'\x22');}else{_0x3afcf7[_0xf7dc('0x19')](_0xf7dc('0x78'));}break;default:_0xe3310e[_0xf7dc('0x19')]('\x22'+_0x1b6187+'\x22');}}else{switch(_0x3fa3fd){case _0xf7dc('0x79'):case'phone':_0x3afcf7[_0xf7dc('0x19')](_0x3fa3fd+_0xf7dc('0x7a'));break;default:_0xe3310e['push']('\x22\x22');}}}}else{var _0x4d345f='';if(!_[_0xf7dc('0x6c')](_0x4abaa1)){if(!_0x28424c['hasOwnProperty'](_0x4abaa1['id'])){for(var _0x50fb42=0x0;_0x50fb42<_0xe12031[_0x3fa3fd][_0xf7dc('0x1d')];_0x50fb42++){var _0x1b6187=_[_0xf7dc('0x6e')](_0x569c4e[_0xf7dc('0x69')][_0xa58fd1][_0xe12031[_0x3fa3fd][_0x50fb42]][_0xf7dc('0x6f')](/"/g,'\x27'));var _0x14c969=phoneDescriptions[_0xf7dc('0x7b')](_0x190faf=>_0x190faf[_0xf7dc('0x7c')]===_0x4abaa1['id']);if(!_['isNil'](_0x14c969)){var _0x563db9=_['trim'](_0x569c4e[_0xf7dc('0x69')][_0xa58fd1][_0xe12031[_0x14c969['description']][0x0]][_0xf7dc('0x6f')](/"/g,'\x27'));if(!_[_0xf7dc('0x6c')](_0x563db9))_0x1b6187=_0x1b6187+'§'+_0x563db9;}if(_0x4d345f=='')_0x4d345f=_0x1b6187;else _0x4d345f+='|'+_0x1b6187;}_0xa9c344[_0xf7dc('0x19')](_0x4abaa1['id']+':'+_0x4d345f);_0x28424c[_0x4abaa1['id']]=0x1;}}}}if(hasAdditionalPhones){_0xe3310e[_0xf7dc('0x19')]('\x22'+_0xa9c344[_0xf7dc('0x3e')](';')+'\x22');}if(_0x3afcf7[_0xf7dc('0x1d')]){handleError(_0x569c4e[_0xf7dc('0x69')][_0xa58fd1],{'code':_0xf7dc('0x7d'),'message':_0x3afcf7['join']()});}else{fs[_0xf7dc('0x7e')](_0x4ff372,_0xe3310e[_0xf7dc('0x3e')]()+'\x0a');}_0xe3310e=[];}if(!(stats[_0xf7dc('0x6a')]%0xc8)){socket[_0xf7dc('0x7f')](_0xf7dc('0x80')+_0x27f1ce,stats);stats['errors']=[];}}if(stopped){logger[_0xf7dc('0x56')](_0xf7dc('0x81'));_0x28757f[_0xf7dc('0x82')]();}}catch(_0x27de55){handleError(_0x569c4e[_0xf7dc('0x69')][_0xa58fd1],{'code':_0xf7dc('0x83'),'message':_0x27de55[_0xf7dc('0x53')]});logger[_0xf7dc('0x59')](_0xf7dc('0x84'),_0x27de55[_0xf7dc('0x53')]);}},'complete':function(){try{var _0x3ddee7=[];var _0x2e4ce5='cm_contacts';if(_0x15f646[_0xf7dc('0x85')]&&_0x15f646[_0xf7dc('0x85')]['length']){_0x2e4ce5=_0xf7dc('0x86')+_0x27f1ce;_0x3ddee7['push'](_0xf7dc('0x87')+_0x2e4ce5+_0xf7dc('0x88'));}logger[_0xf7dc('0x56')](_0xf7dc('0x89'),contactItemTypes[_0xf7dc('0x1d')]);var _0x270374=util[_0xf7dc('0xe')](_0xf7dc('0x8a'),_0x4ff372,_0x2e4ce5,_0x21ac80,_0x15f646['ListId'],_0x15f646[_0xf7dc('0x4d')]||null,NOW,NOW);if(_['isNil'](_0xe12031['scheduledat'])){_0x270374+=_0xf7dc('0x8b');}_0x3ddee7[_0xf7dc('0x19')](_0x270374);if(_0x15f646[_0xf7dc('0x85')]&&_0x15f646[_0xf7dc('0x85')][_0xf7dc('0x1d')]){_0x3ddee7[_0xf7dc('0x19')](insertCmContact(_0x15f646[_0xf7dc('0x30')],_0x2e4ce5,_0x15f646[_0xf7dc('0x85')],_0xe12031));_0x3ddee7[_0xf7dc('0x19')]('DROP\x20TABLE\x20'+_0x2e4ce5+';');}BPromise[_0xf7dc('0x8c')](_0x3ddee7,handleQuery)[_0xf7dc('0x1c')](function(_0x5c0a36){BPromise[_0xf7dc('0x1b')]([handleAdditionalPhones()])[_0xf7dc('0x1c')](function(){_0x3ddee7=[];for(var _0x16125a=0x0;_0x16125a\x20\x20');}var _0x239b17=path[_0xf7dc('0x3e')](config[_0xf7dc('0x60')],_0xf7dc('0x61'),process[_0xf7dc('0x9a')][0x2]);if(!fs['existsSync'](_0x239b17)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x2e7872={};try{_0x2e7872=JSON[_0xf7dc('0x67')](process[_0xf7dc('0x9a')][0x3]);if(!_0x2e7872['binding']){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x2e7872['binding'][_0xf7dc('0x2e')]){throw new Error(_0xf7dc('0x9b'));}if(!_0x2e7872[_0xf7dc('0x5d')][_0xf7dc('0x79')]){throw new Error(_0xf7dc('0x9c'));}var _0x274023=0x0;if(_0x2e7872[_0xf7dc('0x5d')][_0xf7dc('0x73')]){_0x274023=0x1;}if(!_0x2e7872[_0xf7dc('0x30')]){throw new Error(_0xf7dc('0x9d'));}}catch(_0x586a06){throw new Error(_0xf7dc('0x9e'));}var _0x10f631=[];try{_0x10f631=_[_0xf7dc('0x9f')](JSON[_0xf7dc('0x67')](process[_0xf7dc('0x9a')][0x4]),'id');}catch(_0x34d913){logger['info']('No\x20agent\x20available');}main(_0x239b17,_0x2e7872,_0x10f631,_0x274023);}validate();process['on'](_0xf7dc('0xa0'),handleStop);process['on'](_0xf7dc('0xa1'),handleUncaughtException); \ No newline at end of file +var _0x0bda=['../../../config/environment','../../../config/logger','import','defaults','redis','localhost','format','test','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','AdditionalPhones','then','length','push','all','split','filter','CmContactHasItem','findOne','update','create','PHONE','inserted','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','scheduledat','ContactId','ListId','updatedAt','UserId','select','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','cm_contacts.createdAt','cm_hopper_black','createdAt','.CmListId','\x20=\x20?','cm_hopper.id','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','fromQuery','CmHopperId','OrderBy','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_contacts.createdAt\x20=\x20?','keys','CompanyId','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','errors','code','sequelize','query','spread','catch','error','message','main','stringify','start','binding','clone','socket_timestamp','server/files/tmp','ContactItemType','name','_description','header','parse','createReadStream','data','rows','find','isNil','trim','replace','YYYY-MM-DD\x20HH:mm:ss','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','includes','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','hasOwnProperty','itemTypeId','description','SystemRow','appendFileSync','emit','contact:import:','abort','SystemError','step','duplicates','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\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','each','contactId','contactTypeId','orderBy','voice_queues_has_cm_lists','voice_queues','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','finish','affectedRows','unlink','exit','complete','argv','root','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','lodash','util','bluebird','moment','ioredis'];(function(_0x23d7e7,_0x471b25){var _0x17ef3e=function(_0x2428f5){while(--_0x2428f5){_0x23d7e7['push'](_0x23d7e7['shift']());}};_0x17ef3e(++_0x471b25);}(_0x0bda,0xa0));var _0xa0bd=function(_0x1e16f1,_0x316699){_0x1e16f1=_0x1e16f1-0x0;var _0x225225=_0x0bda[_0x1e16f1];return _0x225225;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0xa0bd('0x0'));var Papa=require('papaparse');var util=require(_0xa0bd('0x1'));var BPromise=require(_0xa0bd('0x2'));var moment=require(_0xa0bd('0x3'));var squel=require('squel');var Redis=require(_0xa0bd('0x4'));var db=require('../../../mysqldb')['db'];var config=require(_0xa0bd('0x5'));var logger=require(_0xa0bd('0x6'))(_0xa0bd('0x7'));config['redis']=_[_0xa0bd('0x8')](config[_0xa0bd('0x9')],{'host':_0xa0bd('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0xa0bd('0xb')]('YYYY-MM-DD\x20HH:mm:ss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x4ad8ae){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))*$/[_0xa0bd('0xc')](_0x4ad8ae);}function selectNotIn(_0xdacf84,_0x43f37c,_0x29636e,_0x5a4049,_0x1636cc){return squel['select']()[_0xa0bd('0xd')](_0xa0bd('0xe'))[_0xa0bd('0xf')](_0x5a4049)[_0xa0bd('0x10')](_0x43f37c,null,_0x43f37c+_0xa0bd('0x11')+_0x5a4049+'.'+_0x29636e)[_0xa0bd('0x12')](_0x5a4049+'.'+_0x29636e+_0xa0bd('0x13')+_0xdacf84+'.'+_0x29636e)[_0xa0bd('0x12')](_0x43f37c+_0xa0bd('0x14')+_0x1636cc[_0xa0bd('0x10')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x372bcd,_0x14f639){promisesAdditionalPhones=[];return db[_0xa0bd('0x15')][_0xa0bd('0x16')]({'raw':!![],'attributes':['id',_0xa0bd('0x17')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0xa0bd('0x18')](function(_0x4d1495){if(_0x4d1495!==null){var _0x18ae14=[];for(var _0x1c3254=0x0;_0x1c3254<_0x4d1495[_0xa0bd('0x19')];_0x1c3254++){var _0x441c3a=_0x4d1495[_0x1c3254];_0x18ae14[_0xa0bd('0x1a')](insertAdditionalPhones(_0x441c3a));}}Promise[_0xa0bd('0x1b')](_0x18ae14)['then'](function(){_0x372bcd({'val':0x1});});});});}function insertAdditionalPhones(_0xc2d520){return new Promise(function(_0x4582f3,_0x45e395){var _0x57e523=_0xc2d520['AdditionalPhones'];var _0x1e5060=_0x57e523[_0xa0bd('0x1c')](';');var _0x545632=[];orderBy=0x0;for(var _0xf9bfbc=0x0;_0xf9bfbc<_0x1e5060[_0xa0bd('0x19')];_0xf9bfbc++){_0x545632[_0xa0bd('0x1a')](splitAdditionalPhone(_0xc2d520['id'],_0x1e5060[_0xf9bfbc]));}Promise[_0xa0bd('0x1b')](_0x545632)[_0xa0bd('0x18')](function(){_0x4582f3({'val':_0x1e5060[_0xa0bd('0x19')]});});});}function splitAdditionalPhone(_0x15f0f5,_0x50e74d){return new Promise(function(_0x2a5572,_0x4ff3bb){var _0x132957=_0x50e74d[_0xa0bd('0x1c')](':');var _0x5516f3=_0x132957[0x0];var _0x23d6c6=_0x132957[0x1];if(_0x23d6c6!==''){var _0x283d86=_0x23d6c6[_0xa0bd('0x1c')]('|');var _0x24c2a9=[];for(var _0x155df5=0x0;_0x155df5<_0x283d86[_0xa0bd('0x19')];_0x155df5++){if(_0x283d86[_0x155df5]!==''){var _0x5b7257=_[_0xa0bd('0x1d')](promisesAdditionalPhones,{'contactId':_0x15f0f5,'phone':_0x283d86[_0x155df5]});if(_0x5b7257[_0xa0bd('0x19')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x15f0f5,'contactTypeId':_0x5516f3,'phone':_0x283d86[_0x155df5],'orderBy':orderBy});}}}_0x2a5572({'ok':0x1});}else _0x2a5572({'res':0x0});});}function createAdditionalPhone(_0x45381e,_0x590557,_0x582427,_0x43f115){var _0x1c7f26='';var _0x57fe0f='';var _0x4af9bc=_0x582427['split']('§');_0x1c7f26=_0x4af9bc[0x0];if(_0x4af9bc[_0xa0bd('0x19')]==0x2)_0x57fe0f=_0x4af9bc[0x1];return new Promise(function(_0x6d23d9,_0x3af5b5){return db[_0xa0bd('0x1e')][_0xa0bd('0x1f')]({'where':{'CmContactId':_0x45381e,'item':_0x1c7f26}})[_0xa0bd('0x18')](function(_0x44df78){if(_0x44df78){return db[_0xa0bd('0x1e')][_0xa0bd('0x20')]({'ItemTypeId':_0x590557,'description':_0x57fe0f,'OrderBy':_0x43f115},{'where':{'CmContactId':_0x45381e,'item':_0x1c7f26}})[_0xa0bd('0x18')](function(_0x3d5fa8){_0x6d23d9({'res':'updated'});});}else{return db[_0xa0bd('0x1e')][_0xa0bd('0x21')]({'CmContactId':_0x45381e,'item':_0x1c7f26,'description':_0x57fe0f,'ItemTypeId':_0x590557,'OrderBy':_0x43f115,'ItemClass':_0xa0bd('0x22')})[_0xa0bd('0x18')](function(_0x2251da){_0x6d23d9({'res':_0xa0bd('0x23')});});}});});}function insertCmHopper(_0x19d4db,_0x41fe86,_0x3eae4d,_0x253634,_0x55bcf2){var _0x39b251=['cm_contacts.phone',_0xa0bd('0x24'),_0xa0bd('0x25'),'cm_contacts.ListId',_0x41fe86+'.'+_0x253634,'cm_contacts.createdAt',_0xa0bd('0x26'),_0xa0bd('0x27'),_0xa0bd('0x28'),'\x22'+_0x55bcf2+'\x22'];return squel[_0xa0bd('0x29')]()[_0xa0bd('0x2a')](_0xa0bd('0x2b'))['fromQuery']([_0xa0bd('0xe'),_0xa0bd('0x2c'),_0xa0bd('0x2d'),_0xa0bd('0x2e'),_0x253634,'createdAt',_0xa0bd('0x2f'),'priority',_0xa0bd('0x30'),'recallme'],squel[_0xa0bd('0x31')]()[_0xa0bd('0x32')](_0x39b251)['from'](_0x41fe86)[_0xa0bd('0x10')](_0xa0bd('0x33'),null,_0xa0bd('0x34')+_0x41fe86+'.CmListId')[_0xa0bd('0x10')](_0x3eae4d,null,_0x3eae4d+_0xa0bd('0x11')+_0x41fe86+'.'+_0x253634)['where'](_0x41fe86+_0xa0bd('0x35'),_0x19d4db)[_0xa0bd('0x12')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xa0bd('0x12')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x41fe86,_0x3eae4d,_0x253634,_0xa0bd('0x2b'),[_0xa0bd('0x36'),_0xa0bd('0x37')]))[_0xa0bd('0x12')](_0xa0bd('0x38'),selectNotIn(_0x41fe86,_0x3eae4d,_0x253634,'cm_hopper',[_0xa0bd('0x36')])))[_0xa0bd('0x39')]();}function insertCmHopperBlack(_0x3a3e09,_0x5dc49f,_0x46818a,_0x157f8d){var _0x597af6=['cm_contacts.phone',_0xa0bd('0x25'),'cm_contacts.ListId',_0x5dc49f+'.'+_0x157f8d,_0xa0bd('0x3a'),_0xa0bd('0x26')];return squel[_0xa0bd('0x29')]()[_0xa0bd('0x2a')](_0xa0bd('0x3b'))['fromQuery'](['phone','ContactId',_0xa0bd('0x2e'),_0x157f8d,_0xa0bd('0x3c'),_0xa0bd('0x2f')],squel[_0xa0bd('0x31')]()[_0xa0bd('0x32')](_0x597af6)[_0xa0bd('0xf')](_0x5dc49f)[_0xa0bd('0x10')](_0xa0bd('0x33'),null,'cm_contacts.ListId\x20=\x20'+_0x5dc49f+_0xa0bd('0x3d'))[_0xa0bd('0x10')](_0x46818a,null,_0x46818a+'.id\x20=\x20'+_0x5dc49f+'.'+_0x157f8d)[_0xa0bd('0x12')](_0x5dc49f+_0xa0bd('0x35'),_0x3a3e09)[_0xa0bd('0x12')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0xa0bd('0x38'),squel[_0xa0bd('0x31')]()[_0xa0bd('0xd')](_0xa0bd('0xe'))[_0xa0bd('0xf')](_0xa0bd('0x3b'))['where']('ListId\x20=\x20?',_0x3a3e09)['where'](_0x157f8d+_0xa0bd('0x3e'),_0x5dc49f+'.'+_0x157f8d)))[_0xa0bd('0x39')]();}function insertCmHopperAdditionalPhones(_0x5def25){var _0x394528=[_0xa0bd('0x3f'),'cm_contact_has_items.item',_0xa0bd('0x40'),_0xa0bd('0x41'),_0xa0bd('0x42')];return squel[_0xa0bd('0x29')]()['into'](_0xa0bd('0x43'))[_0xa0bd('0x44')]([_0xa0bd('0x45'),_0xa0bd('0xe'),_0xa0bd('0x46'),_0xa0bd('0x3c'),_0xa0bd('0x2f')],squel['select']()[_0xa0bd('0x32')](_0x394528)[_0xa0bd('0xf')](_0xa0bd('0x2b'))[_0xa0bd('0x10')]('cm_contacts',null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')['join'](_0xa0bd('0x47'),null,_0xa0bd('0x48'))[_0xa0bd('0x12')]('cm_hopper.ListId\x20=\x20?',_0x5def25)['where'](_0xa0bd('0x49'),NOW))['toString']();}function insertCmContact(_0x4ffaee,_0x5f0443,_0x1f9288,_0x100a78){var _0x37000c=_['concat'](_[_0xa0bd('0x4a')](_0x100a78),['ListId',_0xa0bd('0x4b'),_0xa0bd('0x3c'),'updatedAt']);return squel[_0xa0bd('0x29')]()['into'](_0xa0bd('0x33'))[_0xa0bd('0x44')](_0x37000c,squel[_0xa0bd('0x31')]()[_0xa0bd('0x32')](_0x37000c)[_0xa0bd('0xf')](_0x5f0443)[_0xa0bd('0x12')]('('+_0x1f9288[_0xa0bd('0x10')](',')+')\x20NOT\x20IN\x20?',squel[_0xa0bd('0x31')]()['fields'](_0x1f9288)[_0xa0bd('0xf')](_0xa0bd('0x33'))[_0xa0bd('0x12')]('ListId\x20=\x20?',_0x4ffaee)[_0xa0bd('0x12')]('deletedAt\x20IS\x20NULL'))[_0xa0bd('0x12')](_0xa0bd('0x4c'),squel['select']()['field'](_0xa0bd('0x4d'),_0xa0bd('0x4e'))[_0xa0bd('0xf')](_0x5f0443)[_0xa0bd('0x4f')](_0x1f9288[_0xa0bd('0x10')](','))))[_0xa0bd('0x39')]();}function handleStop(){logger[_0xa0bd('0x50')](_0xa0bd('0x51'));stopped=!![];}function handleUncaughtException(_0x1519c2){logger['error'](_0x1519c2['message']);process['exit'](0x1);}function handleError(_0x308834,_0x63acf2){stats[_0xa0bd('0x52')][_0xa0bd('0x1a')]({'name':_0x63acf2[_0xa0bd('0x53')],'message':_0x63acf2['message'],'row':_0x308834});}function handleQuery(_0x27738a){logger[_0xa0bd('0x50')](_0x27738a);return db[_0xa0bd('0x54')][_0xa0bd('0x55')](_0x27738a)[_0xa0bd('0x56')](function(_0x136469){results['push'](_0x136469);})[_0xa0bd('0x57')](function(_0x438693){logger[_0xa0bd('0x58')](_0x438693[_0xa0bd('0x59')]);});}function main(_0x2b5ed8,_0x10836e,_0x3f24a3,_0xe9a16e){logger[_0xa0bd('0x50')](_0xa0bd('0x5a'),_0x2b5ed8,JSON[_0xa0bd('0x5b')](_0x10836e));process['send'](_0xa0bd('0x5c'));var _0x15bb45=_0x10836e[_0xa0bd('0x5d')];var _0xda5e0d=_[_0xa0bd('0x5e')](_0x15bb45);var _0xc19522=_0x10836e[_0xa0bd('0x5f')];var _0xd38fa1=path[_0xa0bd('0x10')](config['root'],_0xa0bd('0x60'),_0xc19522+'.csv');logger[_0xa0bd('0x50')]('body',_0x10836e);db[_0xa0bd('0x61')]['findAll']({'raw':!![],'attributes':['id',_0xa0bd('0x62')]})[_0xa0bd('0x18')](function(_0x5f20ea){for(var _0x12b44c=0x0;_0x12b44c<_0x5f20ea['length'];_0x12b44c++){if(_0x5f20ea[_0x12b44c][_0xa0bd('0x62')]in _0x15bb45){contactItemTypes[_0xa0bd('0x1a')](_0x5f20ea[_0x12b44c]);delete _0xda5e0d[_0x5f20ea[_0x12b44c][_0xa0bd('0x62')]];hasAdditionalPhones=!![];}for(var _0x3b931b in _0x15bb45){if(_0x5f20ea[_0x12b44c][_0xa0bd('0x62')]+_0xa0bd('0x63')===_0x3b931b){phoneDescriptions[_0xa0bd('0x1a')]({'itemTypeId':_0x5f20ea[_0x12b44c]['id'],'description':_0x3b931b});delete _0xda5e0d[_0x3b931b];}}}if(hasAdditionalPhones)_0xda5e0d[_0xa0bd('0x17')]='';var _0x476e26=_[_0xa0bd('0x4a')](_0xda5e0d)[_0xa0bd('0x10')]();logger['info'](_0xa0bd('0x64'),_0x476e26);fs['writeFileSync'](_0xd38fa1,_0x476e26+'\x0a');Papa[_0xa0bd('0x65')](fs[_0xa0bd('0x66')](_0x2b5ed8),{'header':!![],'skipEmptyLines':!![],'step':function(_0x361607,_0x59c973){try{for(var _0x384d39=0x0,_0x4918d4=[];_0x384d39<_0x361607[_0xa0bd('0x67')][_0xa0bd('0x19')];_0x384d39++){stats[_0xa0bd('0x68')]+=0x1;if(_0x361607[_0xa0bd('0x52')][_0x384d39]){handleError(_0x361607['data'][_0x384d39],_0x361607[_0xa0bd('0x52')][_0x384d39]);}else{var _0x1f4786=[];var _0x16ca55=[];var _0x596bc6={};for(var _0x3dec2b in _0x15bb45){let _0x532d05=contactItemTypes[_0xa0bd('0x69')](_0x488388=>_0x488388[_0xa0bd('0x62')]===_0x3dec2b);let _0x40f160=contactItemTypes[_0xa0bd('0x69')](_0x3f7482=>_0x3f7482[_0xa0bd('0x62')]+'_description'===_0x3dec2b);if(_[_0xa0bd('0x6a')](_0x532d05)&&_[_0xa0bd('0x6a')](_0x40f160)){if(_0x15bb45['hasOwnProperty'](_0x3dec2b)){if(_0x361607[_0xa0bd('0x67')][_0x384d39][_0x15bb45[_0x3dec2b]]){var _0x3948f0=_[_0xa0bd('0x6b')](_0x361607[_0xa0bd('0x67')][_0x384d39][_0x15bb45[_0x3dec2b]][_0xa0bd('0x6c')](/"/g,'\x27'));switch(_0x3dec2b){case'scheduledat':var _0x3d6e43=moment(_0x3948f0,_0xa0bd('0x6d'),!![]);if(_0x3d6e43['isValid']()){_0x4918d4[_0xa0bd('0x1a')]('\x22'+_0x3948f0+'\x22');}else{_0x1f4786['push'](_0xa0bd('0x6e'));}break;case'priority':var _0x58c61c=parseInt(_0x3948f0);_0x3948f0=_['isNaN'](_0x58c61c)||_0x58c61c<0x0||_0x58c61c>0x4?_0xe9a16e?0x3:0x2:_0x58c61c;_0x4918d4['push']('\x22'+_0x3948f0+'\x22');break;case _0xa0bd('0x30'):var _0x859240=parseInt(_0x3948f0);if(_[_0xa0bd('0x6f')](_0x859240)&&_[_0xa0bd('0x70')](_0x3f24a3,_0x859240)){_0x4918d4[_0xa0bd('0x1a')]('\x22'+_0x859240+'\x22');}else{_0x1f4786[_0xa0bd('0x1a')](_0xa0bd('0x71'));}break;case'email':if(isEmail(_0x3948f0)){_0x4918d4[_0xa0bd('0x1a')]('\x22'+_0x3948f0+'\x22');}else{_0x1f4786[_0xa0bd('0x1a')](_0xa0bd('0x72'));}break;case _0xa0bd('0x73'):var _0x1476be=moment(_0x3948f0,_0xa0bd('0x74'),!![]);if(_0x1476be[_0xa0bd('0x75')]()){_0x4918d4[_0xa0bd('0x1a')]('\x22'+_0x3948f0+'\x22');}else{_0x1f4786[_0xa0bd('0x1a')](_0xa0bd('0x76'));}break;default:_0x4918d4[_0xa0bd('0x1a')]('\x22'+_0x3948f0+'\x22');}}else{switch(_0x3dec2b){case _0xa0bd('0x77'):case _0xa0bd('0xe'):_0x1f4786[_0xa0bd('0x1a')](_0x3dec2b+_0xa0bd('0x78'));break;default:_0x4918d4['push']('\x22\x22');}}}}else{var _0x498ae8='';if(!_[_0xa0bd('0x6a')](_0x532d05)){if(!_0x596bc6[_0xa0bd('0x79')](_0x532d05['id'])){for(var _0xc95a1c=0x0;_0xc95a1c<_0x15bb45[_0x3dec2b][_0xa0bd('0x19')];_0xc95a1c++){var _0x3948f0=_['trim'](_0x361607['data'][_0x384d39][_0x15bb45[_0x3dec2b][_0xc95a1c]][_0xa0bd('0x6c')](/"/g,'\x27'));var _0x24e7b5=phoneDescriptions[_0xa0bd('0x69')](_0x508427=>_0x508427[_0xa0bd('0x7a')]===_0x532d05['id']);if(!_[_0xa0bd('0x6a')](_0x24e7b5)){var _0x2d1517=_['trim'](_0x361607[_0xa0bd('0x67')][_0x384d39][_0x15bb45[_0x24e7b5[_0xa0bd('0x7b')]][0x0]][_0xa0bd('0x6c')](/"/g,'\x27'));if(!_[_0xa0bd('0x6a')](_0x2d1517))_0x3948f0=_0x3948f0+'§'+_0x2d1517;}if(_0x498ae8=='')_0x498ae8=_0x3948f0;else _0x498ae8+='|'+_0x3948f0;}_0x16ca55[_0xa0bd('0x1a')](_0x532d05['id']+':'+_0x498ae8);_0x596bc6[_0x532d05['id']]=0x1;}}}}if(hasAdditionalPhones){_0x4918d4[_0xa0bd('0x1a')]('\x22'+_0x16ca55[_0xa0bd('0x10')](';')+'\x22');}if(_0x1f4786['length']){handleError(_0x361607[_0xa0bd('0x67')][_0x384d39],{'code':_0xa0bd('0x7c'),'message':_0x1f4786[_0xa0bd('0x10')]()});}else{fs[_0xa0bd('0x7d')](_0xd38fa1,_0x4918d4[_0xa0bd('0x10')]()+'\x0a');}_0x4918d4=[];}if(!(stats[_0xa0bd('0x68')]%0xc8)){socket[_0xa0bd('0x7e')](_0xa0bd('0x7f')+_0xc19522,stats);stats[_0xa0bd('0x52')]=[];}}if(stopped){logger[_0xa0bd('0x50')]('Abort\x20parser');_0x59c973[_0xa0bd('0x80')]();}}catch(_0x326fef){handleError(_0x361607[_0xa0bd('0x67')][_0x384d39],{'code':_0xa0bd('0x81'),'message':_0x326fef[_0xa0bd('0x59')]});logger[_0xa0bd('0x58')](_0xa0bd('0x82'),_0x326fef[_0xa0bd('0x59')]);}},'complete':function(){try{var _0xb42789=[];var _0x50c680='cm_contacts';if(_0x10836e[_0xa0bd('0x83')]&&_0x10836e[_0xa0bd('0x83')][_0xa0bd('0x19')]){_0x50c680='cm_contacts_'+_0xc19522;_0xb42789[_0xa0bd('0x1a')](_0xa0bd('0x84')+_0x50c680+_0xa0bd('0x85'));}logger[_0xa0bd('0x50')](_0xa0bd('0x86'),contactItemTypes[_0xa0bd('0x19')]);var _0x5e409e=util[_0xa0bd('0xb')](_0xa0bd('0x87'),_0xd38fa1,_0x50c680,_0x476e26,_0x10836e[_0xa0bd('0x2e')],_0x10836e[_0xa0bd('0x4b')]||null,NOW,NOW);if(_[_0xa0bd('0x6a')](_0x15bb45['scheduledat'])){_0x5e409e+=',\x20scheduledAt\x20=\x20NOW()';}_0xb42789[_0xa0bd('0x1a')](_0x5e409e);if(_0x10836e['duplicates']&&_0x10836e['duplicates'][_0xa0bd('0x19')]){_0xb42789[_0xa0bd('0x1a')](insertCmContact(_0x10836e['ListId'],_0x50c680,_0x10836e[_0xa0bd('0x83')],_0x15bb45));_0xb42789[_0xa0bd('0x1a')]('DROP\x20TABLE\x20'+_0x50c680+';');}BPromise[_0xa0bd('0x88')](_0xb42789,handleQuery)[_0xa0bd('0x18')](function(_0xcaf4e){BPromise[_0xa0bd('0x1b')]([handleAdditionalPhones()])[_0xa0bd('0x18')](function(){_0xb42789=[];for(var _0x505afa=0x0;_0x505afa\x20\x20');}var _0x52f398=path[_0xa0bd('0x10')](config[_0xa0bd('0x99')],'server/files/tmp',process[_0xa0bd('0x98')][0x2]);if(!fs[_0xa0bd('0x9a')](_0x52f398)){throw new Error(_0xa0bd('0x9b'));}var _0x228c91={};try{_0x228c91=JSON['parse'](process[_0xa0bd('0x98')][0x3]);if(!_0x228c91['binding']){throw new Error(_0xa0bd('0x9c'));}if(!_0x228c91[_0xa0bd('0x5d')][_0xa0bd('0xe')]){throw new Error(_0xa0bd('0x9d'));}if(!_0x228c91[_0xa0bd('0x5d')][_0xa0bd('0x77')]){throw new Error(_0xa0bd('0x9e'));}var _0x4b0537=0x0;if(_0x228c91[_0xa0bd('0x5d')][_0xa0bd('0x30')]){_0x4b0537=0x1;}if(!_0x228c91[_0xa0bd('0x2e')]){throw new Error(_0xa0bd('0x9f'));}}catch(_0x2e2ea2){throw new Error(_0xa0bd('0xa0'));}var _0x1f4aa8=[];try{_0x1f4aa8=_[_0xa0bd('0xa1')](JSON[_0xa0bd('0x65')](process[_0xa0bd('0x98')][0x4]),'id');}catch(_0x1e362c){logger[_0xa0bd('0x50')](_0xa0bd('0xa2'));}main(_0x52f398,_0x228c91,_0x1f4aa8,_0x4b0537);}validate();process['on'](_0xa0bd('0xa3'),handleStop);process['on'](_0xa0bd('0xa4'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/import/cm/csvUpdates.js b/server/components/import/cm/csvUpdates.js index 2e80564..c210411 100644 --- a/server/components/import/cm/csvUpdates.js +++ b/server/components/import/cm/csvUpdates.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x18c9=['path','lodash','papaparse','util','bluebird','moment','ioredis','../../../mysqldb','../../../config/logger','redis','defaults','localhost','socket.io-emitter','format','YYYYMMDDHHmmss','test','field','phone','from','join','.id\x20=\x20','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','select\x20*\x20from\x20','isNil','AdditionalPhones','all','then','error','message','push','length','split','filter','CmContactHasItem','updated','create','inserted','CmContact','update','CmHopper','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','fromQuery','ContactId','createdAt','updatedAt','UserId','recallme','select','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','cm_contacts.phone','cm_hopper_black','ListId','ListId\x20=\x20?','\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','keys','CompanyId','id\x20IN\x20?','MIN(id)','min_id','info','Received\x20SIGINT','code','spread','catch','main','start','binding','clone','socket_timestamp','server/files/tmp','.csv','body','ContactItemType','name','_description','parse','createReadStream','data','rows','errors','find','hasOwnProperty','trim','replace','scheduledat','YYYY-MM-DD\x20HH:mm:ss','priority','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','isValid','firstName','\x20not\x20specified','description','SystemRow','appendFileSync','contact:import:','abort','step','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','CIS\x20len','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','contact','contactId','orderBy','DROP\x20TABLE\x20','each','finish','affectedRows','emit','unlink','exit','complete','argv','root','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','uncaughtException'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x18c9,0x13c));var _0x918c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x18c9[_0xa464c9];return _0x3d73c4;};'use strict';var fs=require('fs');var path=require(_0x918c('0x0'));var _=require(_0x918c('0x1'));var Papa=require(_0x918c('0x2'));var util=require(_0x918c('0x3'));var BPromise=require(_0x918c('0x4'));var moment=require(_0x918c('0x5'));var squel=require('squel');var Redis=require(_0x918c('0x6'));var db=require(_0x918c('0x7'))['db'];var config=require('../../../config/environment');var logger=require(_0x918c('0x8'))('import');config[_0x918c('0x9')]=_[_0x918c('0xa')](config[_0x918c('0x9')],{'host':_0x918c('0xb'),'port':0x18eb});var socket=require(_0x918c('0xc'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x918c('0xd')]('YYYY-MM-DD\x20HH:mm:ss');var tempTableName='cm_contacts_temp_'+moment()[_0x918c('0xd')](_0x918c('0xe'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x43db3b){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))*$/[_0x918c('0xf')](_0x43db3b);}function selectNotIn(_0x288b2f,_0x1f3fbf,_0x17919b,_0x3709fc,_0x4a11be){return squel['select']()[_0x918c('0x10')](_0x918c('0x11'))[_0x918c('0x12')](_0x3709fc)[_0x918c('0x13')](_0x1f3fbf,null,_0x1f3fbf+_0x918c('0x14')+_0x3709fc+'.'+_0x17919b)['where'](_0x3709fc+'.'+_0x17919b+_0x918c('0x15')+_0x288b2f+'.'+_0x17919b)[_0x918c('0x16')](_0x1f3fbf+_0x918c('0x17')+_0x4a11be[_0x918c('0x13')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x1bd619,_0x2e3470){promisesAdditionalPhones=[];promisesContact=[];return db[_0x918c('0x18')][_0x918c('0x19')](_0x918c('0x1a')+tempTableName)['spread'](function(_0x51b1bd){if(_0x51b1bd!==null){var _0x50f880=[];for(var _0x5baa51=0x0;_0x5baa51<_0x51b1bd['length'];_0x5baa51++){var _0x19d3eb=_0x51b1bd[_0x5baa51];if(!_['isNil'](_0x19d3eb[_0x918c('0x11')])){if(!_[_0x918c('0x1b')](_0x19d3eb[_0x918c('0x1c')]))_0x50f880['push'](insertAdditionalPhones(_0x19d3eb));promisesContact['push']({'contact':_0x19d3eb});}}}Promise[_0x918c('0x1d')](_0x50f880)[_0x918c('0x1e')](function(){_0x1bd619({'val':0x1});});})['catch'](function(_0x1b7dbd){logger[_0x918c('0x1f')](_0x1b7dbd[_0x918c('0x20')]);});});}function insertAdditionalPhones(_0x1c4a58){return new Promise(function(_0x5b7526,_0xcfd3e6){var _0x4a2178=_0x1c4a58['AdditionalPhones'];if(_['isNil'](_0x4a2178))_0xcfd3e6({'val':0x0});else{var _0x30fe20=_0x4a2178['split'](';');var _0x5c27d1=[];orderBy=0x0;for(var _0x33d952=0x0;_0x33d952<_0x30fe20['length'];_0x33d952++){_0x5c27d1[_0x918c('0x21')](splitAdditionalPhone(_0x1c4a58['id'],_0x30fe20[_0x33d952]));}Promise[_0x918c('0x1d')](_0x5c27d1)['then'](function(){_0x5b7526({'val':_0x30fe20[_0x918c('0x22')]});});}});}function splitAdditionalPhone(_0x30fd1b,_0x27c08b){return new Promise(function(_0x1b395c,_0x59799f){var _0x27a7d6=_0x27c08b[_0x918c('0x23')](':');var _0x2f22f5=_0x27a7d6[0x0];var _0x1b7f9c=_0x27a7d6[0x1];if(_0x1b7f9c!==''){var _0x124e3d=_0x1b7f9c[_0x918c('0x23')]('|');var _0x4cf95c=[];for(var _0xed8db9=0x0;_0xed8db9<_0x124e3d[_0x918c('0x22')];_0xed8db9++){if(_0x124e3d[_0xed8db9]!==''){var _0x9aca49=_[_0x918c('0x24')](promisesAdditionalPhones,{'contactId':_0x30fd1b,'phone':_0x124e3d[_0xed8db9]});if(_0x9aca49['length']==0x0){orderBy++;promisesAdditionalPhones[_0x918c('0x21')]({'contactId':_0x30fd1b,'contactTypeId':_0x2f22f5,'phone':_0x124e3d[_0xed8db9],'orderBy':orderBy});}}}_0x1b395c({'ok':0x1});}else _0x1b395c({'res':0x0});});}function createAdditionalPhone(_0x3b16d0,_0x48fa8c,_0x2af472,_0x2ffb5f){var _0x1f4f17='';var _0x146579='';var _0x1f1932=_0x2af472[_0x918c('0x23')]('§');_0x1f4f17=_0x1f1932[0x0];if(_0x1f1932[_0x918c('0x22')]==0x2)_0x146579=_0x1f1932[0x1];return new Promise(function(_0x464341,_0x1372a1){return db[_0x918c('0x25')]['findOne']({'where':{'CmContactId':_0x3b16d0,'item':_0x1f4f17}})[_0x918c('0x1e')](function(_0x38c253){if(_0x38c253){return db['CmContactHasItem']['update']({'ItemTypeId':_0x48fa8c,'description':_0x146579,'OrderBy':_0x2ffb5f},{'where':{'CmContactId':_0x3b16d0,'item':_0x1f4f17}})[_0x918c('0x1e')](function(_0x2cba74){_0x464341({'res':_0x918c('0x26')});});}else{return db['CmContactHasItem'][_0x918c('0x27')]({'CmContactId':_0x3b16d0,'item':_0x1f4f17,'ItemTypeId':_0x48fa8c,'description':_0x146579,'OrderBy':_0x2ffb5f,'ItemClass':'PHONE'})[_0x918c('0x1e')](function(_0x133e7b){_0x464341({'res':_0x918c('0x28')});});}});});}function updateContact(_0x2c7693){return new Promise(function(_0x1476cb,_0x55c3c9){var _0x18b46a=_0x2c7693['id'];delete _0x2c7693['id'];return db[_0x918c('0x29')][_0x918c('0x2a')](_0x2c7693,{'where':{'id':_0x18b46a}})[_0x918c('0x1e')](function(_0x90222e){updatedRows+=0x1;return db[_0x918c('0x2b')]['update']({'phone':_0x2c7693['phone']},{'where':{'ContactId':_0x18b46a}})[_0x918c('0x1e')](function(_0x58deca){_0x1476cb({'ret':'OK'});});});});}function insertCmHopper(_0x12fb8d,_0x4bdb92,_0x4c527d,_0x19658d,_0x2d8aea){var _0x8e6fdd=['cm_contacts.phone','cm_contacts.scheduledat',_0x918c('0x2c'),_0x918c('0x2d'),_0x4bdb92+'.'+_0x19658d,'cm_contacts.createdAt',_0x918c('0x2e'),_0x918c('0x2f'),_0x918c('0x30'),'\x22'+_0x2d8aea+'\x22'];return squel[_0x918c('0x31')]()[_0x918c('0x32')]('cm_hopper')[_0x918c('0x33')]([_0x918c('0x11'),'scheduledat',_0x918c('0x34'),'ListId',_0x19658d,_0x918c('0x35'),_0x918c('0x36'),'priority',_0x918c('0x37'),_0x918c('0x38')],squel[_0x918c('0x39')]()[_0x918c('0x3a')](_0x8e6fdd)[_0x918c('0x12')](_0x4bdb92)[_0x918c('0x13')](_0x918c('0x3b'),null,_0x918c('0x3c')+_0x4bdb92+_0x918c('0x3d'))[_0x918c('0x13')](_0x4c527d,null,_0x4c527d+'.id\x20=\x20'+_0x4bdb92+'.'+_0x19658d)[_0x918c('0x16')](_0x4bdb92+_0x918c('0x3e'),_0x12fb8d)[_0x918c('0x16')](_0x918c('0x3f'),NOW)[_0x918c('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x4bdb92,_0x4c527d,_0x19658d,_0x918c('0x40'),[_0x918c('0x41'),_0x918c('0x42')]))[_0x918c('0x16')](_0x918c('0x43'),selectNotIn(_0x4bdb92,_0x4c527d,_0x19658d,'cm_hopper',[_0x918c('0x41')])))[_0x918c('0x44')]();}function insertCmHopperBlack(_0x12b4cd,_0x56b795,_0x275adf,_0x598f3d){var _0x409865=[_0x918c('0x45'),_0x918c('0x2c'),_0x918c('0x2d'),_0x56b795+'.'+_0x598f3d,'cm_contacts.createdAt',_0x918c('0x2e')];return squel[_0x918c('0x31')]()[_0x918c('0x32')](_0x918c('0x46'))['fromQuery']([_0x918c('0x11'),_0x918c('0x34'),_0x918c('0x47'),_0x598f3d,'createdAt',_0x918c('0x36')],squel['select']()[_0x918c('0x3a')](_0x409865)[_0x918c('0x12')](_0x56b795)[_0x918c('0x13')](_0x918c('0x3b'),null,_0x918c('0x3c')+_0x56b795+_0x918c('0x3d'))[_0x918c('0x13')](_0x275adf,null,_0x275adf+_0x918c('0x14')+_0x56b795+'.'+_0x598f3d)[_0x918c('0x16')](_0x56b795+'.CmListId\x20=\x20?',_0x12b4cd)[_0x918c('0x16')](_0x918c('0x3f'),NOW)[_0x918c('0x16')](_0x918c('0x43'),squel[_0x918c('0x39')]()[_0x918c('0x10')]('phone')[_0x918c('0x12')]('cm_hopper_black')[_0x918c('0x16')](_0x918c('0x48'),_0x12b4cd)[_0x918c('0x16')](_0x598f3d+_0x918c('0x49'),_0x56b795+'.'+_0x598f3d)))[_0x918c('0x44')]();}function insertCmHopperAdditionalPhones(_0xa02d00){var _0x26ea2f=[_0x918c('0x4a'),_0x918c('0x4b'),_0x918c('0x4c'),'cm_contact_has_items.createdAt',_0x918c('0x4d')];return squel[_0x918c('0x31')]()['into'](_0x918c('0x4e'))[_0x918c('0x33')]([_0x918c('0x4f'),_0x918c('0x11'),_0x918c('0x50'),'createdAt','updatedAt'],squel[_0x918c('0x39')]()[_0x918c('0x3a')](_0x26ea2f)[_0x918c('0x12')](_0x918c('0x40'))['join'](_0x918c('0x3b'),null,_0x918c('0x51'))[_0x918c('0x13')](_0x918c('0x52'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0x918c('0x16')]('cm_hopper.ListId\x20=\x20?',_0xa02d00)['where'](_0x918c('0x3f'),NOW))['toString']();}function insertCmContact(_0x420c75,_0x36104a,_0x58e97e,_0x52cc0b){var _0x2add75=_['concat'](_[_0x918c('0x53')](_0x52cc0b),['ListId',_0x918c('0x54'),_0x918c('0x35'),_0x918c('0x36')]);return squel[_0x918c('0x31')]()['into'](_0x918c('0x3b'))[_0x918c('0x33')](_0x2add75,squel['select']()[_0x918c('0x3a')](_0x2add75)[_0x918c('0x12')](_0x36104a)[_0x918c('0x16')]('('+_0x58e97e[_0x918c('0x13')](',')+')\x20NOT\x20IN\x20?',squel[_0x918c('0x39')]()[_0x918c('0x3a')](_0x58e97e)[_0x918c('0x12')](_0x918c('0x3b'))[_0x918c('0x16')](_0x918c('0x48'),_0x420c75))[_0x918c('0x16')](_0x918c('0x55'),squel[_0x918c('0x39')]()['field'](_0x918c('0x56'),_0x918c('0x57'))[_0x918c('0x12')](_0x36104a)['group'](_0x58e97e[_0x918c('0x13')](','))))[_0x918c('0x44')]();}function handleStop(){logger[_0x918c('0x58')](_0x918c('0x59'));stopped=!![];}function handleUncaughtException(_0x1be1b0){logger[_0x918c('0x1f')](_0x1be1b0[_0x918c('0x20')]);process['exit'](0x1);}function handleError(_0x23dcc2,_0x514e99){stats['errors'][_0x918c('0x21')]({'name':_0x514e99[_0x918c('0x5a')],'message':_0x514e99[_0x918c('0x20')],'row':_0x23dcc2});}function handleQuery(_0x502e99){logger[_0x918c('0x58')](_0x502e99);return db[_0x918c('0x18')]['query'](_0x502e99)[_0x918c('0x5b')](function(_0xbfabce){results['push'](_0xbfabce);})[_0x918c('0x5c')](function(_0x14a0de){logger[_0x918c('0x1f')](_0x14a0de[_0x918c('0x20')]);});}function main(_0x5783ed,_0x3fdf27,_0x402050,_0x188344){logger[_0x918c('0x58')](_0x918c('0x5d'),_0x5783ed,JSON['stringify'](_0x3fdf27));process['send'](_0x918c('0x5e'));var _0x4c8d8c=_0x3fdf27[_0x918c('0x5f')];var _0x30f903=_[_0x918c('0x60')](_0x4c8d8c);var _0x1111f1=_0x3fdf27[_0x918c('0x61')];var _0x496692=path[_0x918c('0x13')](config['root'],_0x918c('0x62'),_0x1111f1+_0x918c('0x63'));logger[_0x918c('0x58')](_0x918c('0x64'),_0x3fdf27);db[_0x918c('0x65')]['findAll']({'raw':!![],'attributes':['id','name']})[_0x918c('0x1e')](function(_0x557d3c){for(var _0x3a7aff=0x0;_0x3a7aff<_0x557d3c['length'];_0x3a7aff++){if(_0x557d3c[_0x3a7aff][_0x918c('0x66')]in _0x4c8d8c){contactItemTypes[_0x918c('0x21')](_0x557d3c[_0x3a7aff]);delete _0x30f903[_0x557d3c[_0x3a7aff][_0x918c('0x66')]];hasAdditionalPhones=!![];}for(var _0xb0eec2 in _0x4c8d8c){if(_0x557d3c[_0x3a7aff][_0x918c('0x66')]+_0x918c('0x67')===_0xb0eec2){phoneDescriptions[_0x918c('0x21')]({'itemTypeId':_0x557d3c[_0x3a7aff]['id'],'description':_0xb0eec2});delete _0x30f903[_0xb0eec2];}}}if(hasAdditionalPhones)_0x30f903[_0x918c('0x1c')]='';var _0x361ca1=_[_0x918c('0x53')](_0x30f903)[_0x918c('0x13')]();logger[_0x918c('0x58')]('header',_0x361ca1);fs['writeFileSync'](_0x496692,_0x361ca1+'\x0a');Papa[_0x918c('0x68')](fs[_0x918c('0x69')](_0x5783ed),{'header':!![],'skipEmptyLines':!![],'step':function(_0x432960,_0x47b33b){try{for(var _0x57717f=0x0,_0x2b6581=[];_0x57717f<_0x432960[_0x918c('0x6a')][_0x918c('0x22')];_0x57717f++){stats[_0x918c('0x6b')]+=0x1;if(_0x432960[_0x918c('0x6c')][_0x57717f]){handleError(_0x432960[_0x918c('0x6a')][_0x57717f],_0x432960['errors'][_0x57717f]);}else{var _0x276146=[];var _0x286487=[];var _0x3d865a={};for(var _0x503faf in _0x4c8d8c){let _0x3870b1=contactItemTypes[_0x918c('0x6d')](_0x2defa5=>_0x2defa5[_0x918c('0x66')]===_0x503faf);let _0x5a4b8b=contactItemTypes['find'](_0x3fcf9b=>_0x3fcf9b[_0x918c('0x66')]+'_description'===_0x503faf);if(_['isNil'](_0x3870b1)&&_['isNil'](_0x5a4b8b)){if(_0x4c8d8c[_0x918c('0x6e')](_0x503faf)){if(_0x432960[_0x918c('0x6a')][_0x57717f][_0x4c8d8c[_0x503faf]]){var _0x53e477=_[_0x918c('0x6f')](_0x432960[_0x918c('0x6a')][_0x57717f][_0x4c8d8c[_0x503faf]][_0x918c('0x70')](/"/g,'\x27'));switch(_0x503faf){case _0x918c('0x71'):var _0x11d527=moment(_0x53e477,_0x918c('0x72'),!![]);if(_0x11d527['isValid']()){_0x2b6581[_0x918c('0x21')]('\x22'+_0x53e477+'\x22');}else{_0x276146['push']('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x918c('0x73'):var _0xe53eb2=parseInt(_0x53e477);_0x53e477=_['isNaN'](_0xe53eb2)||_0xe53eb2<0x0||_0xe53eb2>0x4?_0x188344?0x3:0x2:_0xe53eb2;_0x2b6581[_0x918c('0x21')]('\x22'+_0x53e477+'\x22');break;case'UserId':var _0x404909=parseInt(_0x53e477);if(_[_0x918c('0x74')](_0x404909)&&_[_0x918c('0x75')](_0x402050,_0x404909)){_0x2b6581[_0x918c('0x21')]('\x22'+_0x404909+'\x22');}else{_0x276146[_0x918c('0x21')](_0x918c('0x76'));}break;case _0x918c('0x77'):if(isEmail(_0x53e477)){_0x2b6581['push']('\x22'+_0x53e477+'\x22');}else{_0x276146[_0x918c('0x21')](_0x918c('0x78'));}break;case _0x918c('0x79'):var _0x4292a9=moment(_0x53e477,_0x918c('0x7a'),!![]);if(_0x4292a9[_0x918c('0x7b')]()){_0x2b6581[_0x918c('0x21')]('\x22'+_0x53e477+'\x22');}else{_0x276146[_0x918c('0x21')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x2b6581[_0x918c('0x21')]('\x22'+_0x53e477+'\x22');}}else{switch(_0x503faf){case _0x918c('0x7c'):case _0x918c('0x11'):_0x276146[_0x918c('0x21')](_0x503faf+_0x918c('0x7d'));break;default:_0x2b6581[_0x918c('0x21')]('\x22\x22');}}}}else{var _0x54acce='';if(!_[_0x918c('0x1b')](_0x3870b1)){if(!_0x3d865a[_0x918c('0x6e')](_0x3870b1['id'])){for(var _0x3496df=0x0;_0x3496df<_0x4c8d8c[_0x503faf][_0x918c('0x22')];_0x3496df++){var _0x53e477=_[_0x918c('0x6f')](_0x432960[_0x918c('0x6a')][_0x57717f][_0x4c8d8c[_0x503faf][_0x3496df]][_0x918c('0x70')](/"/g,'\x27'));var _0x3ad580=phoneDescriptions[_0x918c('0x6d')](_0x43bbd1=>_0x43bbd1['itemTypeId']===_0x3870b1['id']);if(!_['isNil'](_0x3ad580)){var _0x3fb26b=_['trim'](_0x432960[_0x918c('0x6a')][_0x57717f][_0x4c8d8c[_0x3ad580[_0x918c('0x7e')]][0x0]][_0x918c('0x70')](/"/g,'\x27'));if(!_['isNil'](_0x3fb26b))_0x53e477=_0x53e477+'§'+_0x3fb26b;}if(_0x54acce=='')_0x54acce=_0x53e477;else _0x54acce+='|'+_0x53e477;}_0x286487[_0x918c('0x21')](_0x3870b1['id']+':'+_0x54acce);_0x3d865a[_0x3870b1['id']]=0x1;}}}}if(hasAdditionalPhones){_0x2b6581[_0x918c('0x21')]('\x22'+_0x286487[_0x918c('0x13')](';')+'\x22');}if(_0x276146['length']){handleError(_0x432960[_0x918c('0x6a')][_0x57717f],{'code':_0x918c('0x7f'),'message':_0x276146[_0x918c('0x13')]()});}else{fs[_0x918c('0x80')](_0x496692,_0x2b6581[_0x918c('0x13')]()+'\x0a');}_0x2b6581=[];}if(!(stats[_0x918c('0x6b')]%0xc8)){socket['emit'](_0x918c('0x81')+_0x1111f1,stats);stats['errors']=[];}}if(stopped){logger[_0x918c('0x58')]('Abort\x20parser');_0x47b33b[_0x918c('0x82')]();}}catch(_0x39f8b9){handleError(_0x432960[_0x918c('0x6a')][_0x57717f],{'code':'SystemError','message':_0x39f8b9['message']});logger[_0x918c('0x1f')](_0x918c('0x83'),_0x39f8b9['message']);}},'complete':function(){try{var _0x565718=[];var _0x3d71ed=tempTableName;_0x565718[_0x918c('0x21')](_0x918c('0x84')+_0x3d71ed+_0x918c('0x85'));logger['info'](_0x918c('0x86'),contactItemTypes[_0x918c('0x22')]);var _0x3d09a2=util[_0x918c('0xd')](_0x918c('0x87'),_0x496692,_0x3d71ed,_0x361ca1,_0x3fdf27['ListId'],_0x3fdf27[_0x918c('0x54')]||null,NOW,NOW);if(_['isNil'](_0x4c8d8c[_0x918c('0x71')])){_0x3d09a2+=_0x918c('0x88');}_0x565718[_0x918c('0x21')](_0x3d09a2);BPromise['each'](_0x565718,handleQuery)['then'](function(_0x539a43){BPromise[_0x918c('0x1d')]([handleAdditionalPhones()])[_0x918c('0x1e')](function(){_0x565718=[];for(var _0x47ed1d=0x0;_0x47ed1d\x20\x20');}var _0x510583=path[_0x918c('0x13')](config[_0x918c('0x95')],_0x918c('0x62'),process[_0x918c('0x94')][0x2]);if(!fs[_0x918c('0x96')](_0x510583)){throw new Error(_0x918c('0x97'));}var _0x2d7705={};try{_0x2d7705=JSON[_0x918c('0x68')](process[_0x918c('0x94')][0x3]);if(!_0x2d7705[_0x918c('0x5f')]){throw new Error(_0x918c('0x98'));}var _0xb2178b=0x0;if(_0x2d7705[_0x918c('0x5f')][_0x918c('0x37')]){_0xb2178b=0x1;}if(!_0x2d7705['ListId']){throw new Error(_0x918c('0x99'));}}catch(_0x49e9ae){throw new Error(_0x918c('0x9a'));}var _0x3ffc5d=[];try{_0x3ffc5d=_[_0x918c('0x9b')](JSON[_0x918c('0x68')](process[_0x918c('0x94')][0x4]),'id');}catch(_0x338327){logger[_0x918c('0x58')](_0x918c('0x9c'));}main(_0x510583,_0x2d7705,_0x3ffc5d,_0xb2178b);}validate();process['on']('SIGINT',handleStop);process['on'](_0x918c('0x9d'),handleUncaughtException); \ No newline at end of file +var _0x27c8=['ListId','createdAt','updatedAt','priority','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','cm_hopper_black','.CmListId','ListId\x20=\x20?','cm_contact_has_items.item','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','toString','keys','CompanyId','id\x20IN\x20?','MIN(id)','min_id','group','info','error','message','errors','sequelize','main','stringify','send','start','binding','socket_timestamp','server/files/tmp','.csv','findAll','name','_description','header','writeFileSync','parse','rows','find','hasOwnProperty','data','trim','replace','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','description','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','step','\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','scheduledat',',\x20scheduledAt\x20=\x20NOW()','contact','contactId','orderBy','DROP\x20TABLE\x20','each','finish','affectedRows','unlink','exit','complete','argv','arguments\x20\x20\x20','root','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','UserId','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','lodash','papaparse','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','defaults','redis','localhost','socket.io-emitter','format','YYYYMMDDHHmmss','select','field','from','join','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','query','select\x20*\x20from\x20','spread','length','isNil','phone','AdditionalPhones','push','all','catch','then','split','CmContactHasItem','update','updated','create','inserted','CmContact','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','ContactId'];(function(_0x2ccd5e,_0x3deb44){var _0x1a758e=function(_0x535991){while(--_0x535991){_0x2ccd5e['push'](_0x2ccd5e['shift']());}};_0x1a758e(++_0x3deb44);}(_0x27c8,0x6a));var _0x827c=function(_0x1aaf12,_0x30be4f){_0x1aaf12=_0x1aaf12-0x0;var _0x4a073d=_0x27c8[_0x1aaf12];return _0x4a073d;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x827c('0x0'));var Papa=require(_0x827c('0x1'));var util=require('util');var BPromise=require('bluebird');var moment=require(_0x827c('0x2'));var squel=require(_0x827c('0x3'));var Redis=require(_0x827c('0x4'));var db=require(_0x827c('0x5'))['db'];var config=require(_0x827c('0x6'));var logger=require(_0x827c('0x7'))('import');config['redis']=_[_0x827c('0x8')](config[_0x827c('0x9')],{'host':_0x827c('0xa'),'port':0x18eb});var socket=require(_0x827c('0xb'))(new Redis(config[_0x827c('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x827c('0xc')]('YYYY-MM-DD\x20HH:mm:ss');var tempTableName='cm_contacts_temp_'+moment()[_0x827c('0xc')](_0x827c('0xd'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x544f14){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'](_0x544f14);}function selectNotIn(_0x3f0a30,_0x193193,_0x5124eb,_0x154957,_0x2fea87){return squel[_0x827c('0xe')]()[_0x827c('0xf')]('phone')[_0x827c('0x10')](_0x154957)[_0x827c('0x11')](_0x193193,null,_0x193193+'.id\x20=\x20'+_0x154957+'.'+_0x5124eb)[_0x827c('0x12')](_0x154957+'.'+_0x5124eb+_0x827c('0x13')+_0x3f0a30+'.'+_0x5124eb)[_0x827c('0x12')](_0x193193+_0x827c('0x14')+_0x2fea87[_0x827c('0x11')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x5908fa,_0x4bfea6){promisesAdditionalPhones=[];promisesContact=[];return db['sequelize'][_0x827c('0x15')](_0x827c('0x16')+tempTableName)[_0x827c('0x17')](function(_0xba16b4){if(_0xba16b4!==null){var _0x515268=[];for(var _0x364b64=0x0;_0x364b64<_0xba16b4[_0x827c('0x18')];_0x364b64++){var _0x33d53b=_0xba16b4[_0x364b64];if(!_[_0x827c('0x19')](_0x33d53b[_0x827c('0x1a')])){if(!_['isNil'](_0x33d53b[_0x827c('0x1b')]))_0x515268['push'](insertAdditionalPhones(_0x33d53b));promisesContact[_0x827c('0x1c')]({'contact':_0x33d53b});}}}Promise[_0x827c('0x1d')](_0x515268)['then'](function(){_0x5908fa({'val':0x1});});})[_0x827c('0x1e')](function(_0x3b5aca){logger['error'](_0x3b5aca['message']);});});}function insertAdditionalPhones(_0x34d572){return new Promise(function(_0x1dd6e9,_0x12dc17){var _0x4749dd=_0x34d572['AdditionalPhones'];if(_['isNil'](_0x4749dd))_0x12dc17({'val':0x0});else{var _0x59abbb=_0x4749dd['split'](';');var _0xecdaaa=[];orderBy=0x0;for(var _0x56e5f9=0x0;_0x56e5f9<_0x59abbb[_0x827c('0x18')];_0x56e5f9++){_0xecdaaa[_0x827c('0x1c')](splitAdditionalPhone(_0x34d572['id'],_0x59abbb[_0x56e5f9]));}Promise[_0x827c('0x1d')](_0xecdaaa)[_0x827c('0x1f')](function(){_0x1dd6e9({'val':_0x59abbb['length']});});}});}function splitAdditionalPhone(_0x1f5e1d,_0xfd7e82){return new Promise(function(_0x23b2de,_0x4130fe){var _0x529da3=_0xfd7e82[_0x827c('0x20')](':');var _0x1af639=_0x529da3[0x0];var _0x6e751c=_0x529da3[0x1];if(_0x6e751c!==''){var _0xfbbd3c=_0x6e751c[_0x827c('0x20')]('|');var _0xbca4af=[];for(var _0x283950=0x0;_0x283950<_0xfbbd3c[_0x827c('0x18')];_0x283950++){if(_0xfbbd3c[_0x283950]!==''){var _0x260b16=_['filter'](promisesAdditionalPhones,{'contactId':_0x1f5e1d,'phone':_0xfbbd3c[_0x283950]});if(_0x260b16['length']==0x0){orderBy++;promisesAdditionalPhones[_0x827c('0x1c')]({'contactId':_0x1f5e1d,'contactTypeId':_0x1af639,'phone':_0xfbbd3c[_0x283950],'orderBy':orderBy});}}}_0x23b2de({'ok':0x1});}else _0x23b2de({'res':0x0});});}function createAdditionalPhone(_0x5e000f,_0x534757,_0xd7f73d,_0x1c58fe){var _0x5d4dcc='';var _0x3ab50f='';var _0x1b0220=_0xd7f73d[_0x827c('0x20')]('§');_0x5d4dcc=_0x1b0220[0x0];if(_0x1b0220['length']==0x2)_0x3ab50f=_0x1b0220[0x1];return new Promise(function(_0x513aec,_0x156b92){return db[_0x827c('0x21')]['findOne']({'where':{'CmContactId':_0x5e000f,'item':_0x5d4dcc}})[_0x827c('0x1f')](function(_0x296b64){if(_0x296b64){return db['CmContactHasItem'][_0x827c('0x22')]({'ItemTypeId':_0x534757,'description':_0x3ab50f,'OrderBy':_0x1c58fe},{'where':{'CmContactId':_0x5e000f,'item':_0x5d4dcc}})[_0x827c('0x1f')](function(_0x4dc938){_0x513aec({'res':_0x827c('0x23')});});}else{return db[_0x827c('0x21')][_0x827c('0x24')]({'CmContactId':_0x5e000f,'item':_0x5d4dcc,'ItemTypeId':_0x534757,'description':_0x3ab50f,'OrderBy':_0x1c58fe,'ItemClass':'PHONE'})[_0x827c('0x1f')](function(_0x14f2a6){_0x513aec({'res':_0x827c('0x25')});});}});});}function updateContact(_0x122f11){return new Promise(function(_0x2332fc,_0x5a195b){var _0x5ebfb6=_0x122f11['id'];delete _0x122f11['id'];return db[_0x827c('0x26')][_0x827c('0x22')](_0x122f11,{'where':{'id':_0x5ebfb6}})[_0x827c('0x1f')](function(_0x5c97dd){updatedRows+=0x1;return db['CmHopper'][_0x827c('0x22')]({'phone':_0x122f11[_0x827c('0x1a')]},{'where':{'ContactId':_0x5ebfb6}})[_0x827c('0x1f')](function(_0x195e2f){_0x2332fc({'ret':'OK'});});});});}function insertCmHopper(_0x33b7d8,_0x10fae0,_0x4322c1,_0x3463cd,_0x3f2318){var _0x47b2de=[_0x827c('0x27'),'cm_contacts.scheduledat',_0x827c('0x28'),_0x827c('0x29'),_0x10fae0+'.'+_0x3463cd,'cm_contacts.createdAt',_0x827c('0x2a'),_0x827c('0x2b'),_0x827c('0x2c'),'\x22'+_0x3f2318+'\x22'];return squel[_0x827c('0x2d')]()[_0x827c('0x2e')](_0x827c('0x2f'))[_0x827c('0x30')]([_0x827c('0x1a'),'scheduledat',_0x827c('0x31'),_0x827c('0x32'),_0x3463cd,_0x827c('0x33'),_0x827c('0x34'),_0x827c('0x35'),'UserId',_0x827c('0x36')],squel[_0x827c('0xe')]()[_0x827c('0x37')](_0x47b2de)[_0x827c('0x10')](_0x10fae0)[_0x827c('0x11')](_0x827c('0x38'),null,_0x827c('0x39')+_0x10fae0+'.CmListId')['join'](_0x4322c1,null,_0x4322c1+_0x827c('0x3a')+_0x10fae0+'.'+_0x3463cd)[_0x827c('0x12')](_0x10fae0+_0x827c('0x3b'),_0x33b7d8)[_0x827c('0x12')](_0x827c('0x3c'),NOW)[_0x827c('0x12')](_0x827c('0x3d'),selectNotIn(_0x10fae0,_0x4322c1,_0x3463cd,_0x827c('0x2f'),[_0x827c('0x3e'),_0x827c('0x3f')]))['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x10fae0,_0x4322c1,_0x3463cd,'cm_hopper',[_0x827c('0x3e')])))['toString']();}function insertCmHopperBlack(_0x297510,_0x3886c0,_0xdfb300,_0x5225fb){var _0x3a271f=[_0x827c('0x27'),'cm_contacts.id',_0x827c('0x29'),_0x3886c0+'.'+_0x5225fb,'cm_contacts.createdAt','cm_contacts.updatedAt'];return squel[_0x827c('0x2d')]()['into'](_0x827c('0x40'))[_0x827c('0x30')]([_0x827c('0x1a'),_0x827c('0x31'),_0x827c('0x32'),_0x5225fb,_0x827c('0x33'),_0x827c('0x34')],squel[_0x827c('0xe')]()[_0x827c('0x37')](_0x3a271f)[_0x827c('0x10')](_0x3886c0)['join'](_0x827c('0x38'),null,_0x827c('0x39')+_0x3886c0+_0x827c('0x41'))[_0x827c('0x11')](_0xdfb300,null,_0xdfb300+_0x827c('0x3a')+_0x3886c0+'.'+_0x5225fb)['where'](_0x3886c0+'.CmListId\x20=\x20?',_0x297510)[_0x827c('0x12')](_0x827c('0x3c'),NOW)[_0x827c('0x12')](_0x827c('0x3d'),squel['select']()[_0x827c('0xf')](_0x827c('0x1a'))['from'](_0x827c('0x40'))['where'](_0x827c('0x42'),_0x297510)[_0x827c('0x12')](_0x5225fb+'\x20=\x20?',_0x3886c0+'.'+_0x5225fb)))['toString']();}function insertCmHopperAdditionalPhones(_0x3e9522){var _0x1ad50e=['cm_hopper.id',_0x827c('0x43'),'cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt',_0x827c('0x44')];return squel[_0x827c('0x2d')]()['into'](_0x827c('0x45'))['fromQuery']([_0x827c('0x46'),_0x827c('0x1a'),_0x827c('0x47'),_0x827c('0x33'),_0x827c('0x34')],squel['select']()[_0x827c('0x37')](_0x1ad50e)[_0x827c('0x10')](_0x827c('0x2f'))[_0x827c('0x11')](_0x827c('0x38'),null,_0x827c('0x48'))[_0x827c('0x11')](_0x827c('0x49'),null,_0x827c('0x4a'))[_0x827c('0x12')](_0x827c('0x4b'),_0x3e9522)[_0x827c('0x12')](_0x827c('0x3c'),NOW))[_0x827c('0x4c')]();}function insertCmContact(_0x2e5c41,_0x29d723,_0x592f49,_0x2d1633){var _0x4800d0=_['concat'](_[_0x827c('0x4d')](_0x2d1633),[_0x827c('0x32'),_0x827c('0x4e'),_0x827c('0x33'),'updatedAt']);return squel['insert']()[_0x827c('0x2e')](_0x827c('0x38'))[_0x827c('0x30')](_0x4800d0,squel['select']()[_0x827c('0x37')](_0x4800d0)['from'](_0x29d723)[_0x827c('0x12')]('('+_0x592f49[_0x827c('0x11')](',')+')\x20NOT\x20IN\x20?',squel[_0x827c('0xe')]()[_0x827c('0x37')](_0x592f49)['from'](_0x827c('0x38'))[_0x827c('0x12')](_0x827c('0x42'),_0x2e5c41))[_0x827c('0x12')](_0x827c('0x4f'),squel[_0x827c('0xe')]()[_0x827c('0xf')](_0x827c('0x50'),_0x827c('0x51'))['from'](_0x29d723)[_0x827c('0x52')](_0x592f49[_0x827c('0x11')](','))))['toString']();}function handleStop(){logger[_0x827c('0x53')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x128a5e){logger[_0x827c('0x54')](_0x128a5e[_0x827c('0x55')]);process['exit'](0x1);}function handleError(_0x1704fa,_0x3c4810){stats[_0x827c('0x56')][_0x827c('0x1c')]({'name':_0x3c4810['code'],'message':_0x3c4810[_0x827c('0x55')],'row':_0x1704fa});}function handleQuery(_0x483740){logger[_0x827c('0x53')](_0x483740);return db[_0x827c('0x57')][_0x827c('0x15')](_0x483740)[_0x827c('0x17')](function(_0x2edd72){results[_0x827c('0x1c')](_0x2edd72);})[_0x827c('0x1e')](function(_0x62c462){logger['error'](_0x62c462[_0x827c('0x55')]);});}function main(_0x3f970c,_0x4733f3,_0x237331,_0x8ad23f){logger[_0x827c('0x53')](_0x827c('0x58'),_0x3f970c,JSON[_0x827c('0x59')](_0x4733f3));process[_0x827c('0x5a')](_0x827c('0x5b'));var _0x3f8b91=_0x4733f3[_0x827c('0x5c')];var _0x30a69d=_['clone'](_0x3f8b91);var _0x385d54=_0x4733f3[_0x827c('0x5d')];var _0x37e5f5=path[_0x827c('0x11')](config['root'],_0x827c('0x5e'),_0x385d54+_0x827c('0x5f'));logger[_0x827c('0x53')]('body',_0x4733f3);db['ContactItemType'][_0x827c('0x60')]({'raw':!![],'attributes':['id',_0x827c('0x61')]})[_0x827c('0x1f')](function(_0x5831c9){for(var _0x5e3ab2=0x0;_0x5e3ab2<_0x5831c9[_0x827c('0x18')];_0x5e3ab2++){if(_0x5831c9[_0x5e3ab2]['name']in _0x3f8b91){contactItemTypes[_0x827c('0x1c')](_0x5831c9[_0x5e3ab2]);delete _0x30a69d[_0x5831c9[_0x5e3ab2][_0x827c('0x61')]];hasAdditionalPhones=!![];}for(var _0x1b2aec in _0x3f8b91){if(_0x5831c9[_0x5e3ab2][_0x827c('0x61')]+_0x827c('0x62')===_0x1b2aec){phoneDescriptions[_0x827c('0x1c')]({'itemTypeId':_0x5831c9[_0x5e3ab2]['id'],'description':_0x1b2aec});delete _0x30a69d[_0x1b2aec];}}}if(hasAdditionalPhones)_0x30a69d[_0x827c('0x1b')]='';var _0x28fa95=_['keys'](_0x30a69d)['join']();logger[_0x827c('0x53')](_0x827c('0x63'),_0x28fa95);fs[_0x827c('0x64')](_0x37e5f5,_0x28fa95+'\x0a');Papa[_0x827c('0x65')](fs['createReadStream'](_0x3f970c),{'header':!![],'skipEmptyLines':!![],'step':function(_0x368a1a,_0x49aa32){try{for(var _0x5bb4ab=0x0,_0x170ede=[];_0x5bb4ab<_0x368a1a['data'][_0x827c('0x18')];_0x5bb4ab++){stats[_0x827c('0x66')]+=0x1;if(_0x368a1a['errors'][_0x5bb4ab]){handleError(_0x368a1a['data'][_0x5bb4ab],_0x368a1a[_0x827c('0x56')][_0x5bb4ab]);}else{var _0x396d82=[];var _0x2e3852=[];var _0x152d85={};for(var _0x23e701 in _0x3f8b91){let _0x47f5ae=contactItemTypes[_0x827c('0x67')](_0x1b3f61=>_0x1b3f61[_0x827c('0x61')]===_0x23e701);let _0x51a945=contactItemTypes[_0x827c('0x67')](_0x170da1=>_0x170da1['name']+'_description'===_0x23e701);if(_[_0x827c('0x19')](_0x47f5ae)&&_['isNil'](_0x51a945)){if(_0x3f8b91[_0x827c('0x68')](_0x23e701)){if(_0x368a1a[_0x827c('0x69')][_0x5bb4ab][_0x3f8b91[_0x23e701]]){var _0x10decb=_[_0x827c('0x6a')](_0x368a1a[_0x827c('0x69')][_0x5bb4ab][_0x3f8b91[_0x23e701]][_0x827c('0x6b')](/"/g,'\x27'));switch(_0x23e701){case'scheduledat':var _0x44d557=moment(_0x10decb,_0x827c('0x6c'),!![]);if(_0x44d557[_0x827c('0x6d')]()){_0x170ede[_0x827c('0x1c')]('\x22'+_0x10decb+'\x22');}else{_0x396d82[_0x827c('0x1c')](_0x827c('0x6e'));}break;case _0x827c('0x35'):var _0x598b80=parseInt(_0x10decb);_0x10decb=_['isNaN'](_0x598b80)||_0x598b80<0x0||_0x598b80>0x4?_0x8ad23f?0x3:0x2:_0x598b80;_0x170ede[_0x827c('0x1c')]('\x22'+_0x10decb+'\x22');break;case'UserId':var _0x21ea63=parseInt(_0x10decb);if(_[_0x827c('0x6f')](_0x21ea63)&&_[_0x827c('0x70')](_0x237331,_0x21ea63)){_0x170ede[_0x827c('0x1c')]('\x22'+_0x21ea63+'\x22');}else{_0x396d82['push'](_0x827c('0x71'));}break;case _0x827c('0x72'):if(isEmail(_0x10decb)){_0x170ede['push']('\x22'+_0x10decb+'\x22');}else{_0x396d82[_0x827c('0x1c')](_0x827c('0x73'));}break;case _0x827c('0x74'):var _0x557fb9=moment(_0x10decb,_0x827c('0x75'),!![]);if(_0x557fb9[_0x827c('0x6d')]()){_0x170ede[_0x827c('0x1c')]('\x22'+_0x10decb+'\x22');}else{_0x396d82['push'](_0x827c('0x76'));}break;default:_0x170ede[_0x827c('0x1c')]('\x22'+_0x10decb+'\x22');}}else{switch(_0x23e701){case'firstName':case _0x827c('0x1a'):_0x396d82[_0x827c('0x1c')](_0x23e701+_0x827c('0x77'));break;default:_0x170ede[_0x827c('0x1c')]('\x22\x22');}}}}else{var _0x111e29='';if(!_[_0x827c('0x19')](_0x47f5ae)){if(!_0x152d85[_0x827c('0x68')](_0x47f5ae['id'])){for(var _0x25e92b=0x0;_0x25e92b<_0x3f8b91[_0x23e701]['length'];_0x25e92b++){var _0x10decb=_[_0x827c('0x6a')](_0x368a1a[_0x827c('0x69')][_0x5bb4ab][_0x3f8b91[_0x23e701][_0x25e92b]][_0x827c('0x6b')](/"/g,'\x27'));var _0x459715=phoneDescriptions[_0x827c('0x67')](_0xbaa3a1=>_0xbaa3a1['itemTypeId']===_0x47f5ae['id']);if(!_[_0x827c('0x19')](_0x459715)){var _0x59830b=_[_0x827c('0x6a')](_0x368a1a['data'][_0x5bb4ab][_0x3f8b91[_0x459715[_0x827c('0x78')]][0x0]][_0x827c('0x6b')](/"/g,'\x27'));if(!_[_0x827c('0x19')](_0x59830b))_0x10decb=_0x10decb+'§'+_0x59830b;}if(_0x111e29=='')_0x111e29=_0x10decb;else _0x111e29+='|'+_0x10decb;}_0x2e3852[_0x827c('0x1c')](_0x47f5ae['id']+':'+_0x111e29);_0x152d85[_0x47f5ae['id']]=0x1;}}}}if(hasAdditionalPhones){_0x170ede[_0x827c('0x1c')]('\x22'+_0x2e3852[_0x827c('0x11')](';')+'\x22');}if(_0x396d82[_0x827c('0x18')]){handleError(_0x368a1a[_0x827c('0x69')][_0x5bb4ab],{'code':_0x827c('0x79'),'message':_0x396d82[_0x827c('0x11')]()});}else{fs[_0x827c('0x7a')](_0x37e5f5,_0x170ede[_0x827c('0x11')]()+'\x0a');}_0x170ede=[];}if(!(stats[_0x827c('0x66')]%0xc8)){socket[_0x827c('0x7b')](_0x827c('0x7c')+_0x385d54,stats);stats[_0x827c('0x56')]=[];}}if(stopped){logger[_0x827c('0x53')](_0x827c('0x7d'));_0x49aa32[_0x827c('0x7e')]();}}catch(_0x2077dc){handleError(_0x368a1a[_0x827c('0x69')][_0x5bb4ab],{'code':'SystemError','message':_0x2077dc[_0x827c('0x55')]});logger[_0x827c('0x54')](_0x827c('0x7f'),_0x2077dc[_0x827c('0x55')]);}},'complete':function(){try{var _0x58fa1d=[];var _0x54a635=tempTableName;_0x58fa1d[_0x827c('0x1c')]('CREATE\x20TABLE\x20'+_0x54a635+_0x827c('0x80'));logger['info'](_0x827c('0x81'),contactItemTypes[_0x827c('0x18')]);var _0x509737=util[_0x827c('0xc')](_0x827c('0x82'),_0x37e5f5,_0x54a635,_0x28fa95,_0x4733f3[_0x827c('0x32')],_0x4733f3[_0x827c('0x4e')]||null,NOW,NOW);if(_[_0x827c('0x19')](_0x3f8b91[_0x827c('0x83')])){_0x509737+=_0x827c('0x84');}_0x58fa1d['push'](_0x509737);BPromise['each'](_0x58fa1d,handleQuery)[_0x827c('0x1f')](function(_0x58b7bd){BPromise[_0x827c('0x1d')]([handleAdditionalPhones()])[_0x827c('0x1f')](function(){_0x58fa1d=[];for(var _0x3cf42f=0x0;_0x3cf42f=_0x471a80){return _0x5bcd60['status'](0x193)[_0x6677('0x12')]({'message':util[_0x6677('0x9')](_0x6677('0x13'),_0x3c6b27)});}_0x2241d9();})[_0x6677('0x14')](function(_0x3bdce1){_0x2241d9(_0x3bdce1);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x6677('0x15')],{'where':{'$or':[{'role':'admin'},{'role':'user'}]}});}exports[_0x6677('0x16')]=isUserLimit; \ No newline at end of file +var _0xc009=['then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','admin','isUserLimit','crypto','util','../../mysqldb','../../config/environment','data1','license','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','parse','use','findOne'];(function(_0x919445,_0x5467dc){var _0x511b3e=function(_0xde10f3){while(--_0xde10f3){_0x919445['push'](_0x919445['shift']());}};_0x511b3e(++_0x5467dc);}(_0xc009,0xc9));var _0x9c00=function(_0x336084,_0x4253b4){_0x336084=_0x336084-0x0;var _0x1b2940=_0xc009[_0x336084];return _0x1b2940;};'use strict';var crypto=require(_0x9c00('0x0'));var util=require(_0x9c00('0x1'));var compose=require('composable-middleware');var db=require(_0x9c00('0x2'))['db'];var config=require(_0x9c00('0x3'));function getValueFromLicense(_0x5a94dd,_0x5c8be1){if(_0x5a94dd&&_0x5c8be1){if(_0x5c8be1[_0x9c00('0x4')]&&_0x5c8be1['license']){var _0x429dba=_0x5c8be1[_0x9c00('0x4')];var _0x437fa6=_0x5c8be1[_0x9c00('0x5')];var _0x30aace=_0x429dba['split']('-')[0x4];var _0x41d55b=_0x429dba['split']('-')[0x0];var _0x1627e2=crypto['createDecipher'](_0x9c00('0x6'),util[_0x9c00('0x7')](_0x9c00('0x8'),_0x30aace,_0x429dba,_0x41d55b));var _0x2ad043=_0x1627e2[_0x9c00('0x9')](_0x437fa6,_0x9c00('0xa'),_0x9c00('0xb'));_0x2ad043+=_0x1627e2['final'](_0x9c00('0xb'));var _0x39c0d4=JSON[_0x9c00('0xc')](_0x2ad043);return _0x39c0d4['hasOwnProperty'](_0x5a94dd)?_0x39c0d4[_0x5a94dd]:null;}}return null;}function isLimit(_0x1435ac,_0x2b55ff,_0x7bec7d,_0x2aca16){var _0x54e4fe=_0x2b55ff;return compose()[_0x9c00('0xd')](function(_0xbf8446,_0x55ca10,_0x2fc8bd){return db['License'][_0x9c00('0xe')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x44b387){var _0x1a34cf=getValueFromLicense(_0x1435ac,_0x44b387);return _0x1a34cf?_0x1a34cf:_0x54e4fe;})[_0x9c00('0xf')](function(_0x20dccc){_0x54e4fe=_0x20dccc;return _0x7bec7d[_0x9c00('0x10')](_0x2aca16);})[_0x9c00('0xf')](function(_0xa09593){if(_0xa09593>=_0x54e4fe){return _0x55ca10[_0x9c00('0x11')](0x193)[_0x9c00('0x12')]({'message':util[_0x9c00('0x7')](_0x9c00('0x13'),_0x1435ac)});}_0x2fc8bd();})[_0x9c00('0x14')](function(_0x4ef291){_0x2fc8bd(_0x4ef291);});});}function isUserLimit(){return isLimit(_0x9c00('0x15'),0x1,db['User'],{'where':{'$or':[{'role':_0x9c00('0x16')},{'role':'user'}]}});}exports[_0x9c00('0x17')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index fdcff79..cb4339c 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 _0x346d=['filter','indexOf','map','conditions','buildExpression','DATE','$eq','value','includes','$gt','operator','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','$ne','<>\x20?','$substring','$startsWith','$endsWith','$lt','<\x20?','>\x20?','$lte','<=\x20?','$gte','BETWEEN\x20?\x20AND\x20?','start','$between','shift','pop','hours','minutes','seconds','parseSearch','sqlOperator','startsWith','and','replace','split','length','slice','match','forEach'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x346d,0x1ae));var _0xd346=function(_0x2d17ec,_0x54eb4d){_0x2d17ec=_0x2d17ec-0x0;var _0x162002=_0x346d[_0x2d17ec];return _0x162002;};'use strict';var _=require('lodash');var moment=require('moment');exports[_0xd346('0x0')]=function(_0x335334){var _0xeab033={'conditions':[]};_0xeab033[_0xd346('0x1')]=_[_0xd346('0x2')](_0x335334,'[$or]')?'or':_0xd346('0x3');var _0x248213=_0x335334[_0xd346('0x4')]('[$and]','')['replace']('[$or]','')[_0xd346('0x5')]('||');for(var _0x10062a=0x0;_0x10062a<_0x248213[_0xd346('0x6')];_0x10062a++){var _0x160914=_0x248213[_0x10062a]['split'](':=');var _0x579228=_0x160914[0x0];var _0x430799=_0x160914[_0xd346('0x7')](0x1);_0x430799['forEach'](function(_0x260898){var _0x50d369=_0x260898[_0xd346('0x5')]('[')['shift']();var _0x2dbb2b=_0x260898[_0xd346('0x8')](/\[(.*?)\]/g);_0x2dbb2b[_0xd346('0x9')](function(_0x277258){var _0x1e5e98=_0x277258[_0xd346('0x5')]('[')[_0xd346('0xa')](function(_0x1fbd3f){return _0x1fbd3f[_0xd346('0xb')](']')>-0x1;})[_0xd346('0xc')](function(_0x9daf72){return _0x9daf72[_0xd346('0x5')](']')[0x0];})[0x0];_0xeab033[_0xd346('0xd')]['push']({'field':_0x579228,'operator':_0x50d369,'value':_0x1e5e98});});});}return _0xeab033;};exports[_0xd346('0xe')]=function(_0x2ef0cd,_0x490e04,_0x401dae){var _0x2e1336={};if(_0x490e04===_0xd346('0xf')){if(_0x401dae['operator']===_0xd346('0x10')){_0x401dae['operator']='$between';_0x401dae[_0xd346('0x11')]+=','+_0x401dae[_0xd346('0x11')];}else if(_[_0xd346('0x12')]([_0xd346('0x13'),'$lte'],_0x401dae[_0xd346('0x14')])){_0x401dae[_0xd346('0x11')]=moment(_0x401dae[_0xd346('0x11')])[_0xd346('0x15')](0x1,_0xd346('0x16'))[_0xd346('0x17')](_0xd346('0x18'));}}if(_0x401dae['castTo']){_0x490e04=_0x401dae[_0xd346('0x19')];_0x2e1336[_0xd346('0x1a')]=_0xd346('0x1b')+_0x2ef0cd+'.'+_0x401dae[_0xd346('0x1c')]+'\x20AS\x20'+_0x401dae[_0xd346('0x19')]+')\x20'+parseOperator(_0x401dae['operator']);}else{_0x2e1336['text']=_0x2ef0cd+'.'+_0x401dae[_0xd346('0x1c')]+'\x20'+parseOperator(_0x401dae[_0xd346('0x14')]);}if(_[_0xd346('0x12')](['$ne',_0xd346('0x1d')],_0x401dae[_0xd346('0x14')]))_0x2e1336[_0xd346('0x1a')]='('+_0x2e1336[_0xd346('0x1a')]+_0xd346('0x1e')+_0x2ef0cd+'.'+_0x401dae[_0xd346('0x1c')]+_0xd346('0x1f');_0x2e1336['value']=parseValue(_0x490e04,_0x401dae[_0xd346('0x14')],_0x401dae[_0xd346('0x11')]);return _0x2e1336;};function parseOperator(_0x3d85f9){var _0x1d29fb;switch(_0x3d85f9){case _0xd346('0x20'):_0x1d29fb=_0xd346('0x21');break;case _0xd346('0x1d'):_0x1d29fb=_0xd346('0x22');break;case'$eq':_0x1d29fb=_0xd346('0x23');break;case _0xd346('0x24'):_0x1d29fb=_0xd346('0x25');break;case _0xd346('0x26'):case _0xd346('0x27'):case _0xd346('0x28'):_0x1d29fb='LIKE\x20?';break;case _0xd346('0x29'):_0x1d29fb=_0xd346('0x2a');break;case'$gt':_0x1d29fb=_0xd346('0x2b');break;case _0xd346('0x2c'):_0x1d29fb=_0xd346('0x2d');break;case _0xd346('0x2e'):_0x1d29fb='>=\x20?';break;case'$between':_0x1d29fb=_0xd346('0x2f');break;}return _0x1d29fb;}function parseValue(_0x429fa9,_0x1d3cfb,_0x1cbcca){var _0x5ca7f8={'start':undefined,'end':undefined};switch(_0x1d3cfb){case _0xd346('0x20'):case _0xd346('0x1d'):_0x5ca7f8[_0xd346('0x30')]=_0x1cbcca['split'](',');break;case _0xd346('0x26'):_0x5ca7f8[_0xd346('0x30')]='%'+_0x1cbcca+'%';break;case _0xd346('0x27'):_0x5ca7f8['start']=_0x1cbcca+'%';break;case'$endsWith':_0x5ca7f8[_0xd346('0x30')]='%'+_0x1cbcca;break;case _0xd346('0x31'):var _0x2d4f2a=_0x1cbcca[_0xd346('0x5')](',');var _0x1cbcca=_0x2d4f2a[_0xd346('0x32')]();var _0x435fb0=_0x2d4f2a[_0xd346('0x33')]();if(_0x429fa9==='DATE'){_0x1cbcca=moment(_0x1cbcca)['utcOffset'](0x0,!![])[_0xd346('0x17')]();_0x435fb0=moment(_0x435fb0)['utcOffset'](0x0,!![])[_0xd346('0x15')](0x17,_0xd346('0x34'))[_0xd346('0x15')](0x3b,_0xd346('0x35'))['add'](0x3b,_0xd346('0x36'))['format']();}_0x5ca7f8={'start':_0x1cbcca,'end':_0x435fb0};break;default:_0x5ca7f8[_0xd346('0x30')]=_0x1cbcca;break;}return _0x5ca7f8;} \ No newline at end of file +var _0x5b18=['operator','$eq','$between','value','includes','$gt','add','days','format','YYYY-MM-DD','castTo','text','CAST(','\x20AS\x20','field','$notIn','\x20OR\x20','\x20IS\x20NULL)','IN\x20?','NOT\x20IN\x20?','=\x20?','$ne','$substring','$startsWith','$endsWith','LIKE\x20?','<\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','$in','start','pop','utcOffset','seconds','lodash','moment','sqlOperator','startsWith','[$or]','replace','[$and]','length','split','slice','forEach','match','map','conditions','push','buildExpression','DATE'];(function(_0x118397,_0x437396){var _0x40a381=function(_0x8e8451){while(--_0x8e8451){_0x118397['push'](_0x118397['shift']());}};_0x40a381(++_0x437396);}(_0x5b18,0xf8));var _0x85b1=function(_0x423035,_0x51ddeb){_0x423035=_0x423035-0x0;var _0x3645fc=_0x5b18[_0x423035];return _0x3645fc;};'use strict';var _=require(_0x85b1('0x0'));var moment=require(_0x85b1('0x1'));exports['parseSearch']=function(_0x384c78){var _0x56b4c8={'conditions':[]};_0x56b4c8[_0x85b1('0x2')]=_[_0x85b1('0x3')](_0x384c78,_0x85b1('0x4'))?'or':'and';var _0x24d5f2=_0x384c78[_0x85b1('0x5')](_0x85b1('0x6'),'')['replace']('[$or]','')['split']('||');for(var _0x5822d7=0x0;_0x5822d7<_0x24d5f2[_0x85b1('0x7')];_0x5822d7++){var _0x3786e7=_0x24d5f2[_0x5822d7][_0x85b1('0x8')](':=');var _0x3bb663=_0x3786e7[0x0];var _0x30dc81=_0x3786e7[_0x85b1('0x9')](0x1);_0x30dc81[_0x85b1('0xa')](function(_0x76af8c){var _0x14c5a7=_0x76af8c[_0x85b1('0x8')]('[')['shift']();var _0x137028=_0x76af8c[_0x85b1('0xb')](/\[(.*?)\]/g);_0x137028[_0x85b1('0xa')](function(_0x1be0eb){var _0x4cb636=_0x1be0eb[_0x85b1('0x8')]('[')['filter'](function(_0x26f532){return _0x26f532['indexOf'](']')>-0x1;})[_0x85b1('0xc')](function(_0x1a4dfe){return _0x1a4dfe['split'](']')[0x0];})[0x0];_0x56b4c8[_0x85b1('0xd')][_0x85b1('0xe')]({'field':_0x3bb663,'operator':_0x14c5a7,'value':_0x4cb636});});});}return _0x56b4c8;};exports[_0x85b1('0xf')]=function(_0x166f99,_0xe686ae,_0xbcb87b){var _0x1cf447={};if(_0xe686ae===_0x85b1('0x10')){if(_0xbcb87b[_0x85b1('0x11')]===_0x85b1('0x12')){_0xbcb87b[_0x85b1('0x11')]=_0x85b1('0x13');_0xbcb87b[_0x85b1('0x14')]+=','+_0xbcb87b[_0x85b1('0x14')];}else if(_[_0x85b1('0x15')]([_0x85b1('0x16'),'$lte'],_0xbcb87b['operator'])){_0xbcb87b['value']=moment(_0xbcb87b['value'])[_0x85b1('0x17')](0x1,_0x85b1('0x18'))[_0x85b1('0x19')](_0x85b1('0x1a'));}}if(_0xbcb87b['castTo']){_0xe686ae=_0xbcb87b[_0x85b1('0x1b')];_0x1cf447[_0x85b1('0x1c')]=_0x85b1('0x1d')+_0x166f99+'.'+_0xbcb87b['field']+_0x85b1('0x1e')+_0xbcb87b[_0x85b1('0x1b')]+')\x20'+parseOperator(_0xbcb87b[_0x85b1('0x11')]);}else{_0x1cf447[_0x85b1('0x1c')]=_0x166f99+'.'+_0xbcb87b[_0x85b1('0x1f')]+'\x20'+parseOperator(_0xbcb87b[_0x85b1('0x11')]);}if(_[_0x85b1('0x15')](['$ne',_0x85b1('0x20')],_0xbcb87b['operator']))_0x1cf447['text']='('+_0x1cf447[_0x85b1('0x1c')]+_0x85b1('0x21')+_0x166f99+'.'+_0xbcb87b['field']+_0x85b1('0x22');_0x1cf447[_0x85b1('0x14')]=parseValue(_0xe686ae,_0xbcb87b[_0x85b1('0x11')],_0xbcb87b[_0x85b1('0x14')]);return _0x1cf447;};function parseOperator(_0x15473c){var _0x18a2e2;switch(_0x15473c){case'$in':_0x18a2e2=_0x85b1('0x23');break;case'$notIn':_0x18a2e2=_0x85b1('0x24');break;case _0x85b1('0x12'):_0x18a2e2=_0x85b1('0x25');break;case _0x85b1('0x26'):_0x18a2e2='<>\x20?';break;case _0x85b1('0x27'):case _0x85b1('0x28'):case _0x85b1('0x29'):_0x18a2e2=_0x85b1('0x2a');break;case'$lt':_0x18a2e2=_0x85b1('0x2b');break;case _0x85b1('0x16'):_0x18a2e2='>\x20?';break;case'$lte':_0x18a2e2=_0x85b1('0x2c');break;case _0x85b1('0x2d'):_0x18a2e2=_0x85b1('0x2e');break;case _0x85b1('0x13'):_0x18a2e2=_0x85b1('0x2f');break;}return _0x18a2e2;}function parseValue(_0x53a0ac,_0x410075,_0xb42b0){var _0xeafb57={'start':undefined,'end':undefined};switch(_0x410075){case _0x85b1('0x30'):case _0x85b1('0x20'):_0xeafb57[_0x85b1('0x31')]=_0xb42b0[_0x85b1('0x8')](',');break;case _0x85b1('0x27'):_0xeafb57[_0x85b1('0x31')]='%'+_0xb42b0+'%';break;case _0x85b1('0x28'):_0xeafb57[_0x85b1('0x31')]=_0xb42b0+'%';break;case _0x85b1('0x29'):_0xeafb57['start']='%'+_0xb42b0;break;case _0x85b1('0x13'):var _0x341d6d=_0xb42b0[_0x85b1('0x8')](',');var _0xb42b0=_0x341d6d['shift']();var _0x2e1cd1=_0x341d6d[_0x85b1('0x32')]();if(_0x53a0ac===_0x85b1('0x10')){_0xb42b0=moment(_0xb42b0)[_0x85b1('0x33')](0x0,!![])['format']();_0x2e1cd1=moment(_0x2e1cd1)[_0x85b1('0x33')](0x0,!![])['add'](0x17,'hours')[_0x85b1('0x17')](0x3b,'minutes')[_0x85b1('0x17')](0x3b,_0x85b1('0x34'))[_0x85b1('0x19')]();}_0xeafb57={'start':_0xb42b0,'end':_0x2e1cd1};break;default:_0xeafb57[_0x85b1('0x31')]=_0xb42b0;break;}return _0xeafb57;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 9590dca..104044f 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 _0xdf5e=['$id','model','intersection','fields','attributes','hasOwnProperty','order','where','filter','merge','map','VIRTUAL','lower','options','sequelize','parse','keys','includes','split','filters','isEmpty','type','DATE','$gte','format','YYYY-MM-DD','utc','$lte','name','uniqueid','isArray','limit','offset','sort','indexOf','priority','cast','col','unsigned','substr','omit','isString','length','unset','isNumeric','match','^[+]?[0-9]*$','isEmail','replace','join','getOptions','query'];(function(_0x40142d,_0x14d02d){var _0x8bc5c5=function(_0x24c4cb){while(--_0x24c4cb){_0x40142d['push'](_0x40142d['shift']());}};_0x8bc5c5(++_0x14d02d);}(_0xdf5e,0xde));var _0xedf5=function(_0x3b1e3f,_0xf8826b){_0x3b1e3f=_0x3b1e3f-0x0;var _0x3b1cd3=_0xdf5e[_0x3b1e3f];return _0x3b1cd3;};'use strict';var _=require('lodash');var sequelize=require(_0xedf5('0x0'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x1098d0){var _0x1d5f76=['ne'];try{var _0x46e071=JSON[_0xedf5('0x1')](_0x1098d0);var _0x5db4dd=Object[_0xedf5('0x2')](_0x46e071)[0x0];return _0x1d5f76[_0xedf5('0x3')](_0x5db4dd);}catch(_0x281afe){return![];}}function getOperatorValue(_0x4f2918){var _0x4cd55b=JSON[_0xedf5('0x1')](_0x4f2918);var _0x5e16a1=Object['keys'](_0x4cd55b)[0x0];var _0x5938e4=_0x4cd55b[_0x5e16a1];return{['$'+_0x5e16a1]:_0x5938e4};}exports['fields']=function(_0x5fc01a){var _0x2ae438=null;if(_0x5fc01a){_0x2ae438=_0x5fc01a[_0xedf5('0x4')](',');}return _0x2ae438;};exports[_0xedf5('0x5')]=function(_0x5475fc,_0x2786f2){var _0x35cdbd={};if(!_[_0xedf5('0x6')](_0x5475fc)){_['forOwn'](_0x5475fc,function(_0x3f1457,_0x3110aa){try{if(_0x2786f2){var _0xb8b80a=_['find'](_0x2786f2,{'name':_0x3110aa})||{};if(hasSequelizeOperator(_0x3f1457)){_0x35cdbd[_0x3110aa]=getOperatorValue(_0x3f1457);}else if(_0xb8b80a[_0xedf5('0x7')]===_0xedf5('0x8')&&_['isPlainObject'](_0x3f1457)){var _0x15a085=JSON[_0xedf5('0x1')](_0x3f1457);var _0x4a00fb={'$gte':moment(moment(_0x15a085[_0xedf5('0x9')])[_0xedf5('0xa')](_0xedf5('0xb')))[_0xedf5('0xc')]()[_0xedf5('0xa')](),'$lte':moment(moment(_0x15a085[_0xedf5('0xd')])['format'](_0xedf5('0xb')))[_0xedf5('0xc')]()['subtract'](0x1,'s')[_0xedf5('0xa')]()};_0x35cdbd[_0x3110aa]=_0x4a00fb;}else if(_0xb8b80a[_0xedf5('0xe')]===_0xedf5('0xf')){_0x35cdbd[_0x3110aa]=_0x3f1457;}else{_0x35cdbd[_0x3110aa]=_[_0xedf5('0x10')](_0x3f1457)?_0x3f1457:JSON[_0xedf5('0x1')](_0x3f1457);}}else{_0x35cdbd[_0x3110aa]=_[_0xedf5('0x10')](_0x3f1457)?_0x3f1457:JSON[_0xedf5('0x1')](_0x3f1457);}}catch(_0x5d79d8){_0x35cdbd[_0x3110aa]=_0x3f1457[_0xedf5('0x4')](',');}});}return _0x35cdbd;};exports[_0xedf5('0x11')]=function(_0x53b91e){_0x53b91e=parseInt(_0x53b91e,0xa);if(!_0x53b91e||_0x53b91e<0x0){_0x53b91e=LIMIT_VALUE;}return _0x53b91e;};exports[_0xedf5('0x12')]=function(_0x2e5187){_0x2e5187=parseInt(_0x2e5187,0xa);if(!_0x2e5187||_0x2e5187<0x0){_0x2e5187=0x0;}return _0x2e5187;};exports[_0xedf5('0x13')]=function(_0x37112d){var _0x4c8947,_0x5f0f92=null;if(_0x37112d){_0x4c8947=_0x37112d[_0xedf5('0x4')](',');_0x5f0f92=_['map'](_0x4c8947,function(_0x5ece74){if(_0x5ece74[_0xedf5('0x14')]('-')===0x0){return[_0x5ece74===_0xedf5('0x15')?sequelize[_0xedf5('0x16')](sequelize[_0xedf5('0x17')](_0xedf5('0x15')),_0xedf5('0x18')):_0x5ece74[_0xedf5('0x19')](0x1),'DESC'];}else{return[_0x5ece74===_0xedf5('0x15')?sequelize[_0xedf5('0x16')](sequelize[_0xedf5('0x17')](_0xedf5('0x15')),_0xedf5('0x18')):_0x5ece74,'ASC'];}});}return _0x5f0f92;};exports[_0xedf5('0x1a')]=function(_0x3fb914,_0x155f3a){if(_[_0xedf5('0x6')](_0x3fb914)){return _0x3fb914;}if(_['isArray'](_0x3fb914)){for(var _0x4d273c=0x0;_0x4d273c<_0x3fb914['length'];_0x4d273c+=0x1){_0x3fb914[_0x4d273c]=this[_0xedf5('0x1a')](_0x3fb914[_0x4d273c],_0x155f3a);}return _0x3fb914;}if(!_['isObject'](_0x3fb914)){return _0x3fb914;}if(_[_0xedf5('0x1b')](_0x155f3a)){_0x155f3a=[_0x155f3a];}if(!_[_0xedf5('0x10')](_0x155f3a)){return _0x3fb914;}for(var _0x20d8a9=0x0;_0x20d8a9<_0x155f3a[_0xedf5('0x1c')];_0x20d8a9+=0x1){_[_0xedf5('0x1d')](_0x3fb914,_0x155f3a[_0x20d8a9]);}for(var _0x16bf2f in _0x3fb914){if(_0x3fb914['hasOwnProperty'](_0x16bf2f)){_0x3fb914[_0x16bf2f]=this[_0xedf5('0x1a')](_0x3fb914[_0x16bf2f],_0x155f3a);}}return _0x3fb914;};exports[_0xedf5('0x1e')]=function(_0x5e5f6c){return _0x5e5f6c[_0xedf5('0x1f')](RegExp(_0xedf5('0x20')))?!![]:![];};exports[_0xedf5('0x21')]=function(_0x5bc60f){return _0x5bc60f['match'](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x430aed){var _0x1469ee=[];_0x430aed['split'](/[ ,]+/)['forEach'](function(_0x55e302){_0x55e302=_0x55e302[_0xedf5('0x22')](/([^:]")"+/g,'$1');_0x55e302='+'+_0x55e302+'*';if(_0x55e302[_0xedf5('0x3')]('@'))_0x55e302='\x22'+_0x55e302+'\x22';_0x1469ee['push'](_0x55e302);});return _0x1469ee[_0xedf5('0x23')]('\x20');};exports[_0xedf5('0x24')]=function(_0xe99610,_0x2535d4,_0x3e9130){var _0x34ab46={},_0x1b97c2={};if(_0x2535d4[_0xedf5('0x25')][_0xedf5('0x26')]){_0x2535d4[_0xedf5('0x25')]['id']=_0x2535d4[_0xedf5('0x25')]['$id'];delete _0x2535d4['query'][_0xedf5('0x26')];}_0x34ab46[_0xedf5('0x27')]=_['map'](_0xe99610,_0xedf5('0xe'));_0x34ab46[_0xedf5('0x25')]=_[_0xedf5('0x2')](_0x2535d4[_0xedf5('0x25')]);_0x34ab46[_0xedf5('0x5')]=_[_0xedf5('0x28')](_0x34ab46[_0xedf5('0x27')],_0x34ab46['query']);_0x1b97c2['attributes']=_[_0xedf5('0x28')](_0x34ab46[_0xedf5('0x27')],this[_0xedf5('0x29')](_0x2535d4['query'][_0xedf5('0x29')]));_0x1b97c2['attributes']=_0x1b97c2[_0xedf5('0x2a')][_0xedf5('0x1c')]?_0x1b97c2[_0xedf5('0x2a')]:_0x34ab46[_0xedf5('0x27')];if(!_0x2535d4[_0xedf5('0x25')][_0xedf5('0x2b')]('nolimit')){_0x1b97c2[_0xedf5('0x11')]=this[_0xedf5('0x11')](_0x2535d4[_0xedf5('0x25')][_0xedf5('0x11')]);_0x1b97c2[_0xedf5('0x12')]=this[_0xedf5('0x12')](_0x2535d4[_0xedf5('0x25')][_0xedf5('0x12')]);}_0x1b97c2[_0xedf5('0x2c')]=this[_0xedf5('0x13')](_0x2535d4[_0xedf5('0x25')]['sort']);_0x1b97c2[_0xedf5('0x2d')]=this[_0xedf5('0x5')](_['pick'](_0x2535d4['query'],_0x34ab46[_0xedf5('0x5')]),_0xe99610);if(_0x2535d4[_0xedf5('0x25')][_0xedf5('0x2e')]){_0x1b97c2[_0xedf5('0x2d')]=_[_0xedf5('0x2f')](_0x1b97c2[_0xedf5('0x2d')],{'$or':_[_0xedf5('0x30')](_0xe99610,function(_0x214398){if(_0x214398['type']!==_0xedf5('0x31')){if(_0x3e9130){return sequelize[_0xedf5('0x2d')](sequelize['fn']('lower',sequelize[_0xedf5('0x17')](_0x214398[_0xedf5('0xe')])),{'$like':sequelize['fn'](_0xedf5('0x32'),'%'+_0x2535d4['query']['filter']+'%')});}else{var _0x3ed899={};_0x3ed899[_0x214398[_0xedf5('0xe')]]={'$like':'%'+_0x2535d4[_0xedf5('0x25')]['filter']+'%'};return _0x3ed899;}}})});}_0x1b97c2=_[_0xedf5('0x2f')]({},_0x1b97c2,_0x2535d4[_0xedf5('0x33')]);return _0x1b97c2;}; \ No newline at end of file +var _0xda6e=['forEach','replace','join','getOptions','query','$id','model','intersection','attributes','nolimit','offset','order','sort','pick','filter','merge','where','VIRTUAL','lower','options','lodash','parse','keys','includes','fields','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','$lte','subtract','name','uniqueid','isArray','split','limit','map','col','priority','unsigned','substr','ASC','omit','isObject','length','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0xda6e,0x16a));var _0xeda6=function(_0x58d092,_0x36a559){_0x58d092=_0x58d092-0x0;var _0xe2d411=_0xda6e[_0x58d092];return _0xe2d411;};'use strict';var _=require(_0xeda6('0x0'));var sequelize=require('sequelize');var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x20b6bb){var _0x59d276=['ne'];try{var _0x1f4bb1=JSON[_0xeda6('0x1')](_0x20b6bb);var _0x8ec619=Object[_0xeda6('0x2')](_0x1f4bb1)[0x0];return _0x59d276[_0xeda6('0x3')](_0x8ec619);}catch(_0xa1934a){return![];}}function getOperatorValue(_0x62da15){var _0x1d4708=JSON[_0xeda6('0x1')](_0x62da15);var _0x5794e1=Object[_0xeda6('0x2')](_0x1d4708)[0x0];var _0x5c34dc=_0x1d4708[_0x5794e1];return{['$'+_0x5794e1]:_0x5c34dc};}exports[_0xeda6('0x4')]=function(_0x2fc39f){var _0x18594e=null;if(_0x2fc39f){_0x18594e=_0x2fc39f['split'](',');}return _0x18594e;};exports[_0xeda6('0x5')]=function(_0x122939,_0x54da9a){var _0xcb3a57={};if(!_[_0xeda6('0x6')](_0x122939)){_[_0xeda6('0x7')](_0x122939,function(_0x411f41,_0x272793){try{if(_0x54da9a){var _0x518e60=_[_0xeda6('0x8')](_0x54da9a,{'name':_0x272793})||{};if(hasSequelizeOperator(_0x411f41)){_0xcb3a57[_0x272793]=getOperatorValue(_0x411f41);}else if(_0x518e60[_0xeda6('0x9')]===_0xeda6('0xa')&&_[_0xeda6('0xb')](_0x411f41)){var _0x5e7c0e=JSON['parse'](_0x411f41);var _0x4068c3={'$gte':moment(moment(_0x5e7c0e[_0xeda6('0xc')])[_0xeda6('0xd')](_0xeda6('0xe')))['utc']()['format'](),'$lte':moment(moment(_0x5e7c0e[_0xeda6('0xf')])['format']('YYYY-MM-DD'))['utc']()[_0xeda6('0x10')](0x1,'s')[_0xeda6('0xd')]()};_0xcb3a57[_0x272793]=_0x4068c3;}else if(_0x518e60[_0xeda6('0x11')]===_0xeda6('0x12')){_0xcb3a57[_0x272793]=_0x411f41;}else{_0xcb3a57[_0x272793]=_[_0xeda6('0x13')](_0x411f41)?_0x411f41:JSON['parse'](_0x411f41);}}else{_0xcb3a57[_0x272793]=_['isArray'](_0x411f41)?_0x411f41:JSON[_0xeda6('0x1')](_0x411f41);}}catch(_0x4f4917){_0xcb3a57[_0x272793]=_0x411f41[_0xeda6('0x14')](',');}});}return _0xcb3a57;};exports[_0xeda6('0x15')]=function(_0x1455bb){_0x1455bb=parseInt(_0x1455bb,0xa);if(!_0x1455bb||_0x1455bb<0x0){_0x1455bb=LIMIT_VALUE;}return _0x1455bb;};exports['offset']=function(_0x210633){_0x210633=parseInt(_0x210633,0xa);if(!_0x210633||_0x210633<0x0){_0x210633=0x0;}return _0x210633;};exports['sort']=function(_0x338eed){var _0x2d083a,_0x55b21a=null;if(_0x338eed){_0x2d083a=_0x338eed[_0xeda6('0x14')](',');_0x55b21a=_[_0xeda6('0x16')](_0x2d083a,function(_0x577954){if(_0x577954['indexOf']('-')===0x0){return[_0x577954==='priority'?sequelize['cast'](sequelize[_0xeda6('0x17')](_0xeda6('0x18')),_0xeda6('0x19')):_0x577954[_0xeda6('0x1a')](0x1),'DESC'];}else{return[_0x577954===_0xeda6('0x18')?sequelize['cast'](sequelize['col'](_0xeda6('0x18')),'unsigned'):_0x577954,_0xeda6('0x1b')];}});}return _0x55b21a;};exports[_0xeda6('0x1c')]=function(_0x40572a,_0x323e0c){if(_['isEmpty'](_0x40572a)){return _0x40572a;}if(_[_0xeda6('0x13')](_0x40572a)){for(var _0x13dd72=0x0;_0x13dd72<_0x40572a['length'];_0x13dd72+=0x1){_0x40572a[_0x13dd72]=this[_0xeda6('0x1c')](_0x40572a[_0x13dd72],_0x323e0c);}return _0x40572a;}if(!_[_0xeda6('0x1d')](_0x40572a)){return _0x40572a;}if(_['isString'](_0x323e0c)){_0x323e0c=[_0x323e0c];}if(!_['isArray'](_0x323e0c)){return _0x40572a;}for(var _0x562fa9=0x0;_0x562fa9<_0x323e0c[_0xeda6('0x1e')];_0x562fa9+=0x1){_[_0xeda6('0x1f')](_0x40572a,_0x323e0c[_0x562fa9]);}for(var _0x279058 in _0x40572a){if(_0x40572a[_0xeda6('0x20')](_0x279058)){_0x40572a[_0x279058]=this['omit'](_0x40572a[_0x279058],_0x323e0c);}}return _0x40572a;};exports[_0xeda6('0x21')]=function(_0xddf158){return _0xddf158[_0xeda6('0x22')](RegExp(_0xeda6('0x23')))?!![]:![];};exports[_0xeda6('0x24')]=function(_0x323865){return _0x323865['match'](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x217746){var _0x928ad4=[];_0x217746[_0xeda6('0x14')](/[ ,]+/)[_0xeda6('0x25')](function(_0x512a49){_0x512a49=_0x512a49[_0xeda6('0x26')](/([^:]")"+/g,'$1');_0x512a49='+'+_0x512a49+'*';if(_0x512a49[_0xeda6('0x3')]('@'))_0x512a49='\x22'+_0x512a49+'\x22';_0x928ad4['push'](_0x512a49);});return _0x928ad4[_0xeda6('0x27')]('\x20');};exports[_0xeda6('0x28')]=function(_0x379754,_0x1e736e,_0xb9f453){var _0x466469={},_0x2c7f35={};if(_0x1e736e['query']['$id']){_0x1e736e['query']['id']=_0x1e736e[_0xeda6('0x29')][_0xeda6('0x2a')];delete _0x1e736e[_0xeda6('0x29')][_0xeda6('0x2a')];}_0x466469[_0xeda6('0x2b')]=_[_0xeda6('0x16')](_0x379754,_0xeda6('0x11'));_0x466469[_0xeda6('0x29')]=_[_0xeda6('0x2')](_0x1e736e[_0xeda6('0x29')]);_0x466469[_0xeda6('0x5')]=_[_0xeda6('0x2c')](_0x466469[_0xeda6('0x2b')],_0x466469['query']);_0x2c7f35[_0xeda6('0x2d')]=_[_0xeda6('0x2c')](_0x466469['model'],this[_0xeda6('0x4')](_0x1e736e[_0xeda6('0x29')]['fields']));_0x2c7f35[_0xeda6('0x2d')]=_0x2c7f35['attributes'][_0xeda6('0x1e')]?_0x2c7f35[_0xeda6('0x2d')]:_0x466469['model'];if(!_0x1e736e[_0xeda6('0x29')]['hasOwnProperty'](_0xeda6('0x2e'))){_0x2c7f35['limit']=this[_0xeda6('0x15')](_0x1e736e['query'][_0xeda6('0x15')]);_0x2c7f35[_0xeda6('0x2f')]=this['offset'](_0x1e736e[_0xeda6('0x29')][_0xeda6('0x2f')]);}_0x2c7f35[_0xeda6('0x30')]=this[_0xeda6('0x31')](_0x1e736e['query']['sort']);_0x2c7f35['where']=this[_0xeda6('0x5')](_[_0xeda6('0x32')](_0x1e736e[_0xeda6('0x29')],_0x466469['filters']),_0x379754);if(_0x1e736e['query'][_0xeda6('0x33')]){_0x2c7f35['where']=_[_0xeda6('0x34')](_0x2c7f35[_0xeda6('0x35')],{'$or':_['map'](_0x379754,function(_0xbeeed2){if(_0xbeeed2[_0xeda6('0x9')]!==_0xeda6('0x36')){if(_0xb9f453){return sequelize[_0xeda6('0x35')](sequelize['fn'](_0xeda6('0x37'),sequelize[_0xeda6('0x17')](_0xbeeed2[_0xeda6('0x11')])),{'$like':sequelize['fn'](_0xeda6('0x37'),'%'+_0x1e736e['query'][_0xeda6('0x33')]+'%')});}else{var _0x2e3e21={};_0x2e3e21[_0xbeeed2['name']]={'$like':'%'+_0x1e736e[_0xeda6('0x29')]['filter']+'%'};return _0x2e3e21;}}})});}_0x2c7f35=_[_0xeda6('0x34')]({},_0x2c7f35,_0x1e736e[_0xeda6('0x38')]);return _0x2c7f35;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 248487b..04823cb 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x039b=['appPath','join','public','development','test','root','use','json\x20replacer','toISOString','split','views','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','50mb','json','initialize','body-parser','method-override','errorhandler','path','cors','moment','./environment','../mysqldb','get','set'];(function(_0x3d1a9f,_0x394606){var _0x3f0c79=function(_0x22f7ad){while(--_0x22f7ad){_0x3d1a9f['push'](_0x3d1a9f['shift']());}};_0x3f0c79(++_0x394606);}(_0x039b,0x1a8));var _0xb039=function(_0x469c3c,_0x498e4e){_0x469c3c=_0x469c3c-0x0;var _0x507037=_0x039b[_0x469c3c];return _0x507037;};'use strict';var express=require('express');var favicon=require('serve-favicon');var bodyParser=require(_0xb039('0x0'));var methodOverride=require(_0xb039('0x1'));var cookieParser=require('cookie-parser');var errorHandler=require(_0xb039('0x2'));var path=require(_0xb039('0x3'));var passport=require('passport');var cors=require(_0xb039('0x4'));var moment=require(_0xb039('0x5'));var config=require(_0xb039('0x6'));var db=require(_0xb039('0x7'))['db'];exports['default']=function(_0x200383){var _0x38ccd6=_0x200383[_0xb039('0x8')]('env');if(_0x38ccd6==='production'){_0x200383[_0xb039('0x9')](_0xb039('0xa'),path[_0xb039('0xb')](config['root'],_0xb039('0xc')));}if(_0x38ccd6===_0xb039('0xd')||_0x38ccd6===_0xb039('0xe')){_0x200383[_0xb039('0x9')](_0xb039('0xa'),path['join'](config[_0xb039('0xf')],'client'));_0x200383[_0xb039('0x10')](errorHandler());}_0x200383['set'](_0xb039('0x11'),function(_0x13ee30,_0x4d1b3f){if(this[_0x13ee30]instanceof Date){_0x4d1b3f=this[_0x13ee30][_0xb039('0x12')]()[_0xb039('0x13')]('.')[0x0]+'Z';}return _0x4d1b3f;});_0x200383[_0xb039('0x10')](express['static'](_0x200383['get'](_0xb039('0xa'))));_0x200383[_0xb039('0x9')](_0xb039('0x14'),config[_0xb039('0xf')]+_0xb039('0x15'));_0x200383[_0xb039('0x16')](_0xb039('0x17'),require(_0xb039('0x18'))[_0xb039('0x19')]);_0x200383[_0xb039('0x9')](_0xb039('0x1a'),_0xb039('0x17'));_0x200383[_0xb039('0x10')](bodyParser[_0xb039('0x1b')]({'limit':_0xb039('0x1c'),'extended':!![]}));_0x200383[_0xb039('0x10')](bodyParser[_0xb039('0x1d')]({'limit':_0xb039('0x1c')}));_0x200383[_0xb039('0x10')](cors());_0x200383[_0xb039('0x10')](methodOverride());_0x200383[_0xb039('0x10')](cookieParser());_0x200383[_0xb039('0x10')](passport[_0xb039('0x1e')]());}; \ No newline at end of file +var _0x708c=['passport','cors','moment','./environment','env','production','set','appPath','join','root','public','development','client','json\x20replacer','toISOString','views','/server/views','engine','html','ejs','renderFile','use','urlencoded','50mb','initialize','express','serve-favicon','method-override','cookie-parser','errorhandler','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x708c,0x130));var _0xc708=function(_0x597000,_0x3c8f2d){_0x597000=_0x597000-0x0;var _0x53b176=_0x708c[_0x597000];return _0x53b176;};'use strict';var express=require(_0xc708('0x0'));var favicon=require(_0xc708('0x1'));var bodyParser=require('body-parser');var methodOverride=require(_0xc708('0x2'));var cookieParser=require(_0xc708('0x3'));var errorHandler=require(_0xc708('0x4'));var path=require(_0xc708('0x5'));var passport=require(_0xc708('0x6'));var cors=require(_0xc708('0x7'));var moment=require(_0xc708('0x8'));var config=require(_0xc708('0x9'));var db=require('../mysqldb')['db'];exports['default']=function(_0x28ee5b){var _0x28aae2=_0x28ee5b['get'](_0xc708('0xa'));if(_0x28aae2===_0xc708('0xb')){_0x28ee5b[_0xc708('0xc')](_0xc708('0xd'),path[_0xc708('0xe')](config[_0xc708('0xf')],_0xc708('0x10')));}if(_0x28aae2===_0xc708('0x11')||_0x28aae2==='test'){_0x28ee5b['set'](_0xc708('0xd'),path['join'](config['root'],_0xc708('0x12')));_0x28ee5b['use'](errorHandler());}_0x28ee5b[_0xc708('0xc')](_0xc708('0x13'),function(_0xac51ef,_0x53d701){if(this[_0xac51ef]instanceof Date){_0x53d701=this[_0xac51ef][_0xc708('0x14')]()['split']('.')[0x0]+'Z';}return _0x53d701;});_0x28ee5b['use'](express['static'](_0x28ee5b['get'](_0xc708('0xd'))));_0x28ee5b['set'](_0xc708('0x15'),config[_0xc708('0xf')]+_0xc708('0x16'));_0x28ee5b[_0xc708('0x17')](_0xc708('0x18'),require(_0xc708('0x19'))[_0xc708('0x1a')]);_0x28ee5b[_0xc708('0xc')]('view\x20engine',_0xc708('0x18'));_0x28ee5b[_0xc708('0x1b')](bodyParser[_0xc708('0x1c')]({'limit':_0xc708('0x1d'),'extended':!![]}));_0x28ee5b['use'](bodyParser['json']({'limit':'50mb'}));_0x28ee5b['use'](cors());_0x28ee5b[_0xc708('0x1b')](methodOverride());_0x28ee5b[_0xc708('0x1b')](cookieParser());_0x28ee5b['use'](passport[_0xc708('0x1e')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 06afcf6..459e28c 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 _0x0dff=['mac','00:00:00:00:00:00','address','getFirstInterface','map','model','join','createHash','md5','update','hex','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','replace','macAddress','ipAddress','substring','crypto','bimedia-machine-uuid','child_process','execSync','networkInterfaces','orderBy','keys','length','filter','family','IPv4','concat','head'];(function(_0x549cdd,_0x5eb1d0){var _0x357641=function(_0x413286){while(--_0x413286){_0x549cdd['push'](_0x549cdd['shift']());}};_0x357641(++_0x5eb1d0);}(_0x0dff,0x1d3));var _0xf0df=function(_0x2772f3,_0x18c26b){_0x2772f3=_0x2772f3-0x0;var _0x26d7ac=_0x0dff[_0x2772f3];return _0x26d7ac;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0xf0df('0x0'));var machine=require(_0xf0df('0x1'));var exec=require(_0xf0df('0x2'))[_0xf0df('0x3')];var config=require('../environment');function getInterfaces(){var _0x31c9b1=[];var _0x4e6bcf=os[_0xf0df('0x4')]();var _0x5b0c48=_[_0xf0df('0x5')](_[_0xf0df('0x6')](_0x4e6bcf));for(var _0x34c573=0x0;_0x34c573<_0x5b0c48[_0xf0df('0x7')];_0x34c573++){var _0x493d90=_0x4e6bcf[_0x5b0c48[_0x34c573]][_0xf0df('0x8')](function(_0x43c296){return _0x43c296[_0xf0df('0x9')]===_0xf0df('0xa')&&_0x43c296['internal']===![];});_0x31c9b1=_0x31c9b1[_0xf0df('0xb')](_0x493d90);}return _0x31c9b1;}function getFirstInterface(){var _0x230a57=_[_0xf0df('0xc')](getInterfaces());return{'macAddress':_0x230a57&&_0x230a57[_0xf0df('0xd')]?_0x230a57[_0xf0df('0xd')]:_0xf0df('0xe'),'ipAddress':_0x230a57&&_0x230a57['address']?_0x230a57[_0xf0df('0xf')]:'127.0.0.1'};}exports[_0xf0df('0x10')]=getFirstInterface;function getCPUhash(){var _0x332f4f=_[_0xf0df('0x5')](os['cpus']()[_0xf0df('0x11')](function(_0x53c956){return _0x53c956[_0xf0df('0x12')];}))[_0xf0df('0x13')](':');return crypto[_0xf0df('0x14')](_0xf0df('0x15'))[_0xf0df('0x16')](_0x332f4f)['digest'](_0xf0df('0x17'));}exports['getUuid']=function(){var _0x270f7d=os['platform']();var _0x86f63c=/[0-9a-f-]{36}/;if(config[_0xf0df('0x18')]&&_0x86f63c[_0xf0df('0x19')](config[_0xf0df('0x18')])){return config[_0xf0df('0x18')];}else if(_0x270f7d===_0xf0df('0x1a')){return exec(_0xf0df('0x1b'),{'encoding':'utf8'})[_0xf0df('0x1c')]('\x0d\x0a','');}else{var _0x2831ca=getFirstInterface();var _0x1ef3c8=getCPUhash();var _0x58bab4=_0x1ef3c8+'|'+os['hostname']()+'|'+_0x2831ca[_0xf0df('0x1d')]+'|'+_0x2831ca[_0xf0df('0x1e')];var _0x54f661=crypto[_0xf0df('0x14')](_0xf0df('0x15'))[_0xf0df('0x16')](_0x58bab4)['digest']('hex');return _0x54f661[_0xf0df('0x1f')](0x0,0x8)+'-'+_0x54f661['substring'](0x8,0xc)+'-'+_0x54f661['substring'](0xc,0x10)+'-'+_0x54f661[_0xf0df('0x1f')](0x10,0x14)+'-'+_0x54f661[_0xf0df('0x1f')](0x14);}}; \ No newline at end of file +var _0x69cd=['model','createHash','md5','update','hex','platform','test','licenseToken','win32','utf8','macAddress','ipAddress','digest','substring','lodash','bimedia-machine-uuid','child_process','execSync','networkInterfaces','orderBy','keys','length','filter','family','internal','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus'];(function(_0x1304c6,_0x6bb485){var _0x2e6654=function(_0x2b623c){while(--_0x2b623c){_0x1304c6['push'](_0x1304c6['shift']());}};_0x2e6654(++_0x6bb485);}(_0x69cd,0x18e));var _0xd69c=function(_0x680821,_0x23e67f){_0x680821=_0x680821-0x0;var _0x3f132c=_0x69cd[_0x680821];return _0x3f132c;};'use strict';var _=require(_0xd69c('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0xd69c('0x1'));var exec=require(_0xd69c('0x2'))[_0xd69c('0x3')];var config=require('../environment');function getInterfaces(){var _0x44c7f8=[];var _0x5b796b=os[_0xd69c('0x4')]();var _0x4f6c28=_[_0xd69c('0x5')](_[_0xd69c('0x6')](_0x5b796b));for(var _0x439976=0x0;_0x439976<_0x4f6c28[_0xd69c('0x7')];_0x439976++){var _0x5f22d9=_0x5b796b[_0x4f6c28[_0x439976]][_0xd69c('0x8')](function(_0x4ba2bf){return _0x4ba2bf[_0xd69c('0x9')]==='IPv4'&&_0x4ba2bf[_0xd69c('0xa')]===![];});_0x44c7f8=_0x44c7f8['concat'](_0x5f22d9);}return _0x44c7f8;}function getFirstInterface(){var _0x4033f0=_[_0xd69c('0xb')](getInterfaces());return{'macAddress':_0x4033f0&&_0x4033f0[_0xd69c('0xc')]?_0x4033f0[_0xd69c('0xc')]:_0xd69c('0xd'),'ipAddress':_0x4033f0&&_0x4033f0[_0xd69c('0xe')]?_0x4033f0[_0xd69c('0xe')]:_0xd69c('0xf')};}exports[_0xd69c('0x10')]=getFirstInterface;function getCPUhash(){var _0x41ea16=_[_0xd69c('0x5')](os[_0xd69c('0x11')]()['map'](function(_0x38c0bd){return _0x38c0bd[_0xd69c('0x12')];}))['join'](':');return crypto[_0xd69c('0x13')](_0xd69c('0x14'))[_0xd69c('0x15')](_0x41ea16)['digest'](_0xd69c('0x16'));}exports['getUuid']=function(){var _0x5da9a1=os[_0xd69c('0x17')]();var _0x2c0276=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x2c0276[_0xd69c('0x18')](config['licenseToken'])){return config[_0xd69c('0x19')];}else if(_0x5da9a1===_0xd69c('0x1a')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0xd69c('0x1b')})['replace']('\x0d\x0a','');}else{var _0x3ca772=getFirstInterface();var _0x4dd104=getCPUhash();var _0x51af3e=_0x4dd104+'|'+os['hostname']()+'|'+_0x3ca772[_0xd69c('0x1c')]+'|'+_0x3ca772[_0xd69c('0x1d')];var _0x50ecd7=crypto[_0xd69c('0x13')](_0xd69c('0x14'))[_0xd69c('0x15')](_0x51af3e)[_0xd69c('0x1e')](_0xd69c('0x16'));return _0x50ecd7[_0xd69c('0x1f')](0x0,0x8)+'-'+_0x50ecd7[_0xd69c('0x1f')](0x8,0xc)+'-'+_0x50ecd7[_0xd69c('0x1f')](0xc,0x10)+'-'+_0x50ecd7[_0xd69c('0x1f')](0x10,0x14)+'-'+_0x50ecd7[_0xd69c('0x1f')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 0386e99..a1031ac 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 _0x1ccd=['active','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','finally','getUuid','License','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','message','util','moment','request-promise','bluebird','version','../../components/encryptor','../logger','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get','data1','data2'];(function(_0x5a5699,_0x5f0572){var _0x706221=function(_0x35a449){while(--_0x35a449){_0x5a5699['push'](_0x5a5699['shift']());}};_0x706221(++_0x5f0572);}(_0x1ccd,0x1a1));var _0xd1cc=function(_0x1e9424,_0x191cba){_0x1e9424=_0x1e9424-0x0;var _0x1bd96c=_0x1ccd[_0x1e9424];return _0x1bd96c;};'use strict';var util=require(_0xd1cc('0x0'));var moment=require(_0xd1cc('0x1'));var rp=require(_0xd1cc('0x2'));var BPromise=require(_0xd1cc('0x3'));var pkginfo=require('pkginfo')(module,_0xd1cc('0x4'));var db=require('../../mysqldb')['db'];var encryptor=require(_0xd1cc('0x5'));var hardware=require('./hardware');var logger=require(_0xd1cc('0x6'))('license');var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x279d77){return new BPromise(function(_0x4f1d68,_0x45640e){var _0x4ed2bc=util[_0xd1cc('0x7')]('%s/api/servers/%s/check?version=%s',HOST,_0x279d77,module['exports'][_0xd1cc('0x4')]);if(oldToken){_0x4ed2bc=util[_0xd1cc('0x7')](_0xd1cc('0x8'),HOST,_0x279d77,module['exports'][_0xd1cc('0x4')],oldToken);}var _0x2303e5={'uri':_0x4ed2bc,'method':_0xd1cc('0x9'),'timeout':0xea60,'json':!![]};return rp(_0x2303e5)[_0xd1cc('0xa')](function(_0x23b4ee){_0x4f1d68(_0x23b4ee);})[_0xd1cc('0xb')](function(_0x1a1c01){_0x45640e(_0x1a1c01);});});}function manageLicense(_0x4f4205,_0x366790){var _0x4750d7=_0x366790[_0xd1cc('0xc')]({'plain':!![]});if(!isOldTokenSent&&_0x4750d7[_0xd1cc('0xd')]!==_0x4f4205&&!_0x4750d7[_0xd1cc('0xe')]){oldToken=_0x4750d7[_0xd1cc('0xd')];}httpRequest(_0x4f4205)[_0xd1cc('0xa')](function(_0x4beacc){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x4beacc[_0xd1cc('0xf')]){isOldTokenSent=![];if(!_0x4750d7[_0xd1cc('0x10')]&&_0x4750d7[_0xd1cc('0x10')]!=_0x4beacc[_0xd1cc('0x10')]||_0x4750d7[_0xd1cc('0x10')]&&_0x4750d7['data2']){logger[_0xd1cc('0x11')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x4750d7[_0xd1cc('0x10')]&&!_0x4750d7[_0xd1cc('0xe')]&&_0x4750d7['license']!=_0x4beacc[_0xd1cc('0x10')]){logger[_0xd1cc('0x11')](_0xd1cc('0x12'));}if(_0x4750d7['license']&&!_0x4750d7[_0xd1cc('0xe')]&&_0x4750d7[_0xd1cc('0x10')]==_0x4beacc[_0xd1cc('0x10')]){return _0x366790;}return _0x366790[_0xd1cc('0x13')]({'data1':_0x4f4205,'data2':null,'license':_0x4beacc[_0xd1cc('0x10')]});}else{if(_0x4beacc[_0xd1cc('0x10')]||_0x4750d7[_0xd1cc('0x10')]){if(!_0x4750d7[_0xd1cc('0xe')]){if(_0x4750d7[_0xd1cc('0xd')]==_0x4f4205){GRAY_PERIOD_REASON='Disabled';logger[_0xd1cc('0x11')](_0xd1cc('0x14'));}else{GRAY_PERIOD_REASON='Changed';logger[_0xd1cc('0x11')](_0xd1cc('0x15'),_0x4750d7['data1'],_0x4f4205);}logger[_0xd1cc('0x11')](_0xd1cc('0x16'),GRAY_PERIOD_REASON['toUpperCase'](),moment()['format'](_0xd1cc('0x17')));return _0x366790[_0xd1cc('0x13')]({'data2':encryptor[_0xd1cc('0x18')](moment()['format'](_0xd1cc('0x17')))});}else{if(moment()[_0xd1cc('0x19')](encryptor[_0xd1cc('0x1a')](_0x4750d7[_0xd1cc('0xe')]),_0xd1cc('0x1b'))>DAYS){logger[_0xd1cc('0x11')](_0xd1cc('0x1c'),moment()['format'](_0xd1cc('0x17')));isOldTokenSent=![];return _0x366790[_0xd1cc('0x13')]({'data1':_0x4f4205,'data2':null,'license':null});}}}else{if(_0x4750d7[_0xd1cc('0xd')]!=_0x4f4205){logger[_0xd1cc('0x11')](_0xd1cc('0x15'),_0x4750d7['data1'],_0x4f4205);return _0x366790['update']({'data1':_0x4f4205,'data2':null,'license':null});}}}return _0x366790;})[_0xd1cc('0xa')](function(_0x5e00f7){_0x366790=_0x5e00f7;})['catch'](function(_0x24d02b){logger['error'](_0x24d02b['message']);})[_0xd1cc('0x1d')](function(){setTimeout(function(){manageLicense(hardware[_0xd1cc('0x1e')](),_0x366790);},TIME);});}function defaultLicense(){var _0x176024=hardware[_0xd1cc('0x1e')]();if(_0x176024){return db[_0xd1cc('0x1f')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x176024}})[_0xd1cc('0x20')](function(_0x5bce25,_0x5bee17){logger[_0xd1cc('0x11')](_0xd1cc('0x21'),_0x176024);manageLicense(_0x176024,_0x5bce25);})[_0xd1cc('0xb')](function(_0x3e579b){logger[_0xd1cc('0x22')](_0x3e579b[_0xd1cc('0x23')]);});}}exports['default']=defaultLicense; \ No newline at end of file +var _0x243b=['exports','version','%s/api/servers/%s/check?version=%s&oldtoken=%s','then','catch','get','data1','data2','active','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','update','YYYY-MM-DD\x20HH:mm','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','error','message','getUuid','License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','moment','request-promise','bluebird','../../mysqldb','../../components/encryptor','./hardware','../logger','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s'];(function(_0x1df09c,_0x2e64a0){var _0x2e88cf=function(_0x32cb18){while(--_0x32cb18){_0x1df09c['push'](_0x1df09c['shift']());}};_0x2e88cf(++_0x2e64a0);}(_0x243b,0x190));var _0xb243=function(_0x1002d5,_0x380b42){_0x1002d5=_0x1002d5-0x0;var _0x4967bb=_0x243b[_0x1002d5];return _0x4967bb;};'use strict';var util=require('util');var moment=require(_0xb243('0x0'));var rp=require(_0xb243('0x1'));var BPromise=require(_0xb243('0x2'));var pkginfo=require('pkginfo')(module,'version');var db=require(_0xb243('0x3'))['db'];var encryptor=require(_0xb243('0x4'));var hardware=require(_0xb243('0x5'));var logger=require(_0xb243('0x6'))('license');var HOST=_0xb243('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0xfb4b6e){return new BPromise(function(_0xdd5918,_0x3d8f1e){var _0x14040d=util[_0xb243('0x8')](_0xb243('0x9'),HOST,_0xfb4b6e,module[_0xb243('0xa')][_0xb243('0xb')]);if(oldToken){_0x14040d=util[_0xb243('0x8')](_0xb243('0xc'),HOST,_0xfb4b6e,module[_0xb243('0xa')][_0xb243('0xb')],oldToken);}var _0x42762a={'uri':_0x14040d,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x42762a)[_0xb243('0xd')](function(_0x1747b2){_0xdd5918(_0x1747b2);})[_0xb243('0xe')](function(_0x3841d7){_0x3d8f1e(_0x3841d7);});});}function manageLicense(_0x430c01,_0x42e007){var _0x4dbec4=_0x42e007[_0xb243('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x4dbec4[_0xb243('0x10')]!==_0x430c01&&!_0x4dbec4[_0xb243('0x11')]){oldToken=_0x4dbec4[_0xb243('0x10')];}httpRequest(_0x430c01)[_0xb243('0xd')](function(_0x5bcb22){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x5bcb22[_0xb243('0x12')]){isOldTokenSent=![];if(!_0x4dbec4[_0xb243('0x13')]&&_0x4dbec4[_0xb243('0x13')]!=_0x5bcb22[_0xb243('0x13')]||_0x4dbec4[_0xb243('0x13')]&&_0x4dbec4[_0xb243('0x11')]){logger[_0xb243('0x14')](_0xb243('0x15'));}if(_0x4dbec4['license']&&!_0x4dbec4[_0xb243('0x11')]&&_0x4dbec4[_0xb243('0x13')]!=_0x5bcb22[_0xb243('0x13')]){logger[_0xb243('0x14')](_0xb243('0x16'));}if(_0x4dbec4['license']&&!_0x4dbec4['data2']&&_0x4dbec4['license']==_0x5bcb22[_0xb243('0x13')]){return _0x42e007;}return _0x42e007['update']({'data1':_0x430c01,'data2':null,'license':_0x5bcb22[_0xb243('0x13')]});}else{if(_0x5bcb22[_0xb243('0x13')]||_0x4dbec4[_0xb243('0x13')]){if(!_0x4dbec4['data2']){if(_0x4dbec4[_0xb243('0x10')]==_0x430c01){GRAY_PERIOD_REASON=_0xb243('0x17');logger[_0xb243('0x14')](_0xb243('0x18'));}else{GRAY_PERIOD_REASON=_0xb243('0x19');logger['info'](_0xb243('0x1a'),_0x4dbec4[_0xb243('0x10')],_0x430c01);}logger[_0xb243('0x14')](_0xb243('0x1b'),GRAY_PERIOD_REASON[_0xb243('0x1c')](),moment()[_0xb243('0x8')]('YYYY-MM-DD\x20HH:mm'));return _0x42e007[_0xb243('0x1d')]({'data2':encryptor['encryptString'](moment()[_0xb243('0x8')](_0xb243('0x1e')))});}else{if(moment()[_0xb243('0x1f')](encryptor[_0xb243('0x20')](_0x4dbec4[_0xb243('0x11')]),_0xb243('0x21'))>DAYS){logger['info'](_0xb243('0x22'),moment()[_0xb243('0x8')](_0xb243('0x1e')));isOldTokenSent=![];return _0x42e007['update']({'data1':_0x430c01,'data2':null,'license':null});}}}else{if(_0x4dbec4['data1']!=_0x430c01){logger[_0xb243('0x14')](_0xb243('0x1a'),_0x4dbec4[_0xb243('0x10')],_0x430c01);return _0x42e007[_0xb243('0x1d')]({'data1':_0x430c01,'data2':null,'license':null});}}}return _0x42e007;})[_0xb243('0xd')](function(_0x516054){_0x42e007=_0x516054;})[_0xb243('0xe')](function(_0x1585f0){logger[_0xb243('0x23')](_0x1585f0[_0xb243('0x24')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0xb243('0x25')](),_0x42e007);},TIME);});}function defaultLicense(){var _0x1336bb=hardware['getUuid']();if(_0x1336bb){return db[_0xb243('0x26')][_0xb243('0x27')]({'where':{'id':0x1},'defaults':{'data1':_0x1336bb}})['spread'](function(_0x4e15e0,_0x5a3c3d){logger[_0xb243('0x14')](_0xb243('0x28'),_0x1336bb);manageLicense(_0x1336bb,_0x4e15e0);})['catch'](function(_0x1c6c58){logger[_0xb243('0x23')](_0x1c6c58[_0xb243('0x24')]);});}}exports['default']=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index e170b37..e1e4d7e 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 _0x0205=['sequelize','role','count','admin','user','telephone','users','telephones','forEach','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','lodash','moment','bluebird','../../components/encryptor','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','find','defaults','then','catch','uuid','data1','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','gray','deadline','add','days','disabled','User','findAll','COUNT'];(function(_0x31ce59,_0xd66fa6){var _0x13e0f9=function(_0x3ab7e4){while(--_0x3ab7e4){_0x31ce59['push'](_0x31ce59['shift']());}};_0x13e0f9(++_0xd66fa6);}(_0x0205,0x1a3));var _0x5020=function(_0x5df7bb,_0x175b3f){_0x5df7bb=_0x5df7bb-0x0;var _0x6c9994=_0x0205[_0x5df7bb];return _0x6c9994;};'use strict';var util=require('util');var _=require(_0x5020('0x0'));var moment=require(_0x5020('0x1'));var BPromise=require(_0x5020('0x2'));var hardware=require('./hardware');var encryptor=require(_0x5020('0x3'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x5020('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x5020('0x5'),'machineUuid':hardware[_0x5020('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x5020('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x22a40c){return new BPromise(function(_0x20ac88,_0xc14baf){return db['License'][_0x5020('0x7')](_[_0x5020('0x8')](_0x22a40c,{'raw':!![],'where':{'id':0x1}}))[_0x5020('0x9')](function(_0x546443){return checkLicense(_0x546443,null);})['then'](function(_0x61835c){_0x20ac88(_0x61835c);return;})[_0x5020('0xa')](function(_0x5cb441){_0xc14baf(_0x5cb441);});});}function checkLicense(_0x549ed9,_0x2de143){if(!_0x549ed9){demoLicense[_0x5020('0xb')]=_0x549ed9[_0x5020('0xc')];return demoLicense;}try{var _0x198f78=_0x2de143||_0x549ed9['license'];if(_[_0x5020('0xd')](_0x198f78)){throw new Error(_0x5020('0xe'));}var _0x57909d=_0x549ed9[_0x5020('0xc')];var _0x1ea526=_0x549ed9[_0x5020('0xf')];var _0x33551f=_0x57909d[_0x5020('0x10')]('-')[0x4];var _0x2324a1=_0x57909d['split']('-')[0x0];var _0x59f44b=encryptor[_0x5020('0x11')](_0x198f78,util[_0x5020('0x12')](_0x5020('0x13'),_0x33551f,_0x57909d,_0x2324a1));var _0x310905=JSON[_0x5020('0x14')](_0x59f44b);_0x310905[_0x5020('0x15')]=![];_0x310905[_0x5020('0xb')]=_0x57909d;_0x310905[_0x5020('0x16')]=hardware['getUuid']();if(_0x1ea526){var _0x22408b=encryptor[_0x5020('0x11')](_0x1ea526);_0x310905[_0x5020('0x17')]=_0x22408b;_0x310905[_0x5020('0x18')]=moment(_0x22408b)[_0x5020('0x19')](0x7,_0x5020('0x1a'))[_0x5020('0x12')]();_0x310905['grayReason']=_0x310905['uuid']!=_0x310905[_0x5020('0x16')]?'changed':_0x5020('0x1b');}return _0x310905;}catch(_0xa2bd88){breakingLicense['uuid']=_0x549ed9[_0x5020('0xc')];breakingLicense['message']=_0xa2bd88['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x3b7433,_0x50ecd7){getLicense()['then'](function(_0x263a76){return db[_0x5020('0x1c')][_0x5020('0x1d')]({'attributes':['role',[db['sequelize']['fn'](_0x5020('0x1e'),db[_0x5020('0x1f')]['col'](_0x5020('0x20'))),_0x5020('0x21')]],'group':_0x5020('0x20'),'where':{'role':{'$or':[_0x5020('0x22'),_0x5020('0x23'),_0x5020('0x24')]}},'raw':!![]})[_0x5020('0x9')](function(_0x3e3949){var _0x59aa96={'user':_0x263a76[_0x5020('0x25')]||0x0,'telephone':_0x263a76[_0x5020('0x26')]||0x0};_0x3e3949[_0x5020('0x27')](function(_0x298979){var _0x592b2d=_0x298979['role']===_0x5020('0x22')?_0x5020('0x23'):_0x298979[_0x5020('0x20')];_0x59aa96[_0x592b2d]-=_0x298979['count'];if(_0x59aa96[_0x592b2d]<0x0)_0x59aa96[_0x592b2d]=0x0;});_0x3b7433(_0x59aa96);return;});})[_0x5020('0xa')](function(_0x395d43){_0x50ecd7(_0x395d43);});});}function checkUserLimits(_0x3a616c){return new BPromise(function(_0x58c9d2,_0x1b0768){getLimits()[_0x5020('0x9')](function(_0x2caab7){var _0x44e99b=_[_0x5020('0x28')](_[_0x5020('0x29')](_0x3a616c,_0x5020('0x20')),[_0x5020('0x22'),_0x5020('0x23'),_0x5020('0x24')]);var _0x2f4cce=(_0x44e99b['admin']||0x0)+(_0x44e99b[_0x5020('0x23')]||0x0);var _0x19a689=_0x44e99b[_0x5020('0x24')]||0x0;if(_0x2f4cce>_0x2caab7['user'])return _0x1b0768(_0x5020('0x2a'));if(_0x19a689>_0x2caab7['telephone'])return _0x1b0768(_0x5020('0x2b'));return _0x58c9d2();})[_0x5020('0xa')](function(_0x33f0b4){_0x1b0768(_0x33f0b4);});});}module[_0x5020('0x2c')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xdcde=['then','uuid','data1','license','isEmpty','split','decryptString','format','%s:%s:%s','machineUuid','deadline','add','changed','disabled','message','User','findAll','sequelize','COUNT','col','count','role','admin','user','users','telephones','forEach','catch','pick','telephone','License\x20limit\x20reached\x20for\x20users','exports','util','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','find'];(function(_0x4ebda6,_0x5d9c61){var _0x41cde2=function(_0x3ce865){while(--_0x3ce865){_0x4ebda6['push'](_0x4ebda6['shift']());}};_0x41cde2(++_0x5d9c61);}(_0xdcde,0x1d8));var _0xedcd=function(_0x2ef8f1,_0x1280a3){_0x2ef8f1=_0x2ef8f1-0x0;var _0x17498d=_0xdcde[_0x2ef8f1];return _0x17498d;};'use strict';var util=require(_0xedcd('0x0'));var _=require('lodash');var moment=require(_0xedcd('0x1'));var BPromise=require(_0xedcd('0x2'));var hardware=require(_0xedcd('0x3'));var encryptor=require(_0xedcd('0x4'));var db=require(_0xedcd('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xedcd('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xedcd('0x7'),'machineUuid':hardware[_0xedcd('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xedcd('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xedcd('0x9'),'machineUuid':hardware[_0xedcd('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x1ed264){return new BPromise(function(_0x587aba,_0x208617){return db[_0xedcd('0xa')][_0xedcd('0xb')](_['defaults'](_0x1ed264,{'raw':!![],'where':{'id':0x1}}))[_0xedcd('0xc')](function(_0x299ca4){return checkLicense(_0x299ca4,null);})[_0xedcd('0xc')](function(_0x591da6){_0x587aba(_0x591da6);return;})['catch'](function(_0x528092){_0x208617(_0x528092);});});}function checkLicense(_0x13f3d3,_0x503708){if(!_0x13f3d3){demoLicense[_0xedcd('0xd')]=_0x13f3d3[_0xedcd('0xe')];return demoLicense;}try{var _0xc7ac84=_0x503708||_0x13f3d3[_0xedcd('0xf')];if(_[_0xedcd('0x10')](_0xc7ac84)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x3ad95b=_0x13f3d3[_0xedcd('0xe')];var _0x1d9ae5=_0x13f3d3['data2'];var _0x12d31c=_0x3ad95b['split']('-')[0x4];var _0x124b22=_0x3ad95b[_0xedcd('0x11')]('-')[0x0];var _0x2306a8=encryptor[_0xedcd('0x12')](_0xc7ac84,util[_0xedcd('0x13')](_0xedcd('0x14'),_0x12d31c,_0x3ad95b,_0x124b22));var _0x49bf4c=JSON['parse'](_0x2306a8);_0x49bf4c['demo']=![];_0x49bf4c['uuid']=_0x3ad95b;_0x49bf4c[_0xedcd('0x15')]=hardware[_0xedcd('0x8')]();if(_0x1d9ae5){var _0x997e07=encryptor[_0xedcd('0x12')](_0x1d9ae5);_0x49bf4c['gray']=_0x997e07;_0x49bf4c[_0xedcd('0x16')]=moment(_0x997e07)[_0xedcd('0x17')](0x7,'days')[_0xedcd('0x13')]();_0x49bf4c['grayReason']=_0x49bf4c[_0xedcd('0xd')]!=_0x49bf4c[_0xedcd('0x15')]?_0xedcd('0x18'):_0xedcd('0x19');}return _0x49bf4c;}catch(_0x188a81){breakingLicense[_0xedcd('0xd')]=_0x13f3d3[_0xedcd('0xe')];breakingLicense['message']=_0x188a81[_0xedcd('0x1a')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x39748f,_0x1ca0db){getLicense()[_0xedcd('0xc')](function(_0x34fde9){return db[_0xedcd('0x1b')][_0xedcd('0x1c')]({'attributes':['role',[db[_0xedcd('0x1d')]['fn'](_0xedcd('0x1e'),db['sequelize'][_0xedcd('0x1f')]('role')),_0xedcd('0x20')]],'group':_0xedcd('0x21'),'where':{'role':{'$or':[_0xedcd('0x22'),_0xedcd('0x23'),'telephone']}},'raw':!![]})['then'](function(_0x2abae0){var _0x2dbff4={'user':_0x34fde9[_0xedcd('0x24')]||0x0,'telephone':_0x34fde9[_0xedcd('0x25')]||0x0};_0x2abae0[_0xedcd('0x26')](function(_0x216850){var _0x2ad244=_0x216850[_0xedcd('0x21')]===_0xedcd('0x22')?_0xedcd('0x23'):_0x216850['role'];_0x2dbff4[_0x2ad244]-=_0x216850[_0xedcd('0x20')];if(_0x2dbff4[_0x2ad244]<0x0)_0x2dbff4[_0x2ad244]=0x0;});_0x39748f(_0x2dbff4);return;});})[_0xedcd('0x27')](function(_0x2e5722){_0x1ca0db(_0x2e5722);});});}function checkUserLimits(_0x2c09a3){return new BPromise(function(_0x59d8c1,_0x3ee111){getLimits()[_0xedcd('0xc')](function(_0x574043){var _0x45010e=_[_0xedcd('0x28')](_['countBy'](_0x2c09a3,_0xedcd('0x21')),['admin',_0xedcd('0x23'),_0xedcd('0x29')]);var _0x5b28f1=(_0x45010e[_0xedcd('0x22')]||0x0)+(_0x45010e[_0xedcd('0x23')]||0x0);var _0x4f7928=_0x45010e[_0xedcd('0x29')]||0x0;if(_0x5b28f1>_0x574043[_0xedcd('0x23')])return _0x3ee111(_0xedcd('0x2a'));if(_0x4f7928>_0x574043[_0xedcd('0x29')])return _0x3ee111('License\x20limit\x20reached\x20for\x20telephones');return _0x59d8c1();})['catch'](function(_0x23c912){_0x3ee111(_0x23c912);});});}module[_0xedcd('0x2b')]={'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 6bf9f06..477d4c9 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 _0x5204=['http://localhost:9000','app-id','secret','exports'];(function(_0x3f6c29,_0x370d86){var _0x4af959=function(_0x263612){while(--_0x263612){_0x3f6c29['push'](_0x3f6c29['shift']());}};_0x4af959(++_0x370d86);}(_0x5204,0xdf));var _0x4520=function(_0x2ab76b,_0x176579){_0x2ab76b=_0x2ab76b-0x0;var _0x201126=_0x5204[_0x2ab76b];return _0x201126;};'use strict';module[_0x4520('0x0')]={'DOMAIN':_0x4520('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x4520('0x2'),'GOOGLE_SECRET':_0x4520('0x3'),'DEBUG':''}; \ No newline at end of file +var _0xd914=['http://localhost:9000','app-id','secret','exports'];(function(_0x57baae,_0x4fbee0){var _0x33dde6=function(_0xb00c7b){while(--_0xb00c7b){_0x57baae['push'](_0x57baae['shift']());}};_0x33dde6(++_0x4fbee0);}(_0xd914,0x17f));var _0x4d91=function(_0x1e3c02,_0x5c07a2){_0x1e3c02=_0x1e3c02-0x0;var _0x4d26d7=_0xd914[_0x1e3c02];return _0x4d26d7;};'use strict';module[_0x4d91('0x0')]={'DOMAIN':_0x4d91('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x4d91('0x2'),'GOOGLE_SECRET':_0x4d91('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 71d759e..089cbce 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdbe5=['log','xcally','%s-%s.log','message','{{{','replace','}}}','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','exports','Logger','transports','%s-%s','error','File','info','Console','env','debugLevel','moment','winston','util','path','INFO','join','/var'];(function(_0x231933,_0x4a2ec6){var _0x268c09=function(_0x3c34b4){while(--_0x3c34b4){_0x231933['push'](_0x231933['shift']());}};_0x268c09(++_0x4a2ec6);}(_0xdbe5,0x138));var _0x5dbe=function(_0xe82570,_0x496912){_0xe82570=_0xe82570-0x0;var _0x24d82d=_0xdbe5[_0xe82570];return _0x24d82d;};'use strict';var moment=require(_0x5dbe('0x0'));var winston=require(_0x5dbe('0x1'));var util=require(_0x5dbe('0x2'));var path=require(_0x5dbe('0x3'));var debugLevel=_0x5dbe('0x4');function filename(_0x2e9325,_0x4b8a46){return path[_0x5dbe('0x5')](_0x5dbe('0x6'),_0x5dbe('0x7'),_0x5dbe('0x8'),util['format'](_0x5dbe('0x9'),_0x2e9325,_0x4b8a46));}function formatter(_0x2878cc,_0x2332c9){_0x2332c9[_0x5dbe('0xa')]=_0x2332c9['message']['replace'](/@@{/g,_0x5dbe('0xb'))[_0x5dbe('0xc')](/}@@/g,_0x5dbe('0xd'))[_0x5dbe('0xc')](/@{/g,'{{')[_0x5dbe('0xc')](/}@/g,'}}');return util[_0x5dbe('0xe')](_0x5dbe('0xf'),moment()['format'](_0x5dbe('0x10')),_0x2332c9[_0x5dbe('0x11')][_0x5dbe('0x12')](),_0x2878cc,_0x2332c9[_0x5dbe('0xa')]);}module[_0x5dbe('0x13')]=function(_0x209d80){return new winston[(_0x5dbe('0x14'))]({'transports':[new winston[(_0x5dbe('0x15'))]['File']({'name':util[_0x5dbe('0xe')](_0x5dbe('0x16'),_0x209d80,_0x5dbe('0x17')),'filename':filename(_0x209d80,_0x5dbe('0x17')),'level':_0x5dbe('0x17'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x361d68){return formatter(_0x209d80,_0x361d68);}}),new winston[(_0x5dbe('0x15'))][(_0x5dbe('0x18'))]({'name':util[_0x5dbe('0xe')](_0x5dbe('0x16'),_0x209d80,_0x5dbe('0x19')),'filename':filename(_0x209d80,'info'),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x40c1b2){return formatter(_0x209d80,_0x40c1b2);}}),new winston[(_0x5dbe('0x15'))][(_0x5dbe('0x1a'))]({'level':process[_0x5dbe('0x1b')][_0x5dbe('0x1c')]||debugLevel,'json':![],'formatter':function(_0x2dcb7f){return formatter(_0x209d80,_0x2dcb7f);}})]});}; \ No newline at end of file +var _0xa9b3=['xcally','format','%s-%s.log','message','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','level','Logger','transports','error','File','%s-%s','Console','moment','winston','util','path','join','/var','log'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa9b3,0xcb));var _0x3a9b=function(_0xea6c20,_0x5a0de8){_0xea6c20=_0xea6c20-0x0;var _0x458655=_0xa9b3[_0xea6c20];return _0x458655;};'use strict';var moment=require(_0x3a9b('0x0'));var winston=require(_0x3a9b('0x1'));var util=require(_0x3a9b('0x2'));var path=require(_0x3a9b('0x3'));var debugLevel='INFO';function filename(_0x1682b6,_0x23b8fc){return path[_0x3a9b('0x4')](_0x3a9b('0x5'),_0x3a9b('0x6'),_0x3a9b('0x7'),util[_0x3a9b('0x8')](_0x3a9b('0x9'),_0x1682b6,_0x23b8fc));}function formatter(_0x4acaa5,_0x6c8b2d){_0x6c8b2d[_0x3a9b('0xa')]=_0x6c8b2d['message'][_0x3a9b('0xb')](/@@{/g,'{{{')[_0x3a9b('0xb')](/}@@/g,_0x3a9b('0xc'))['replace'](/@{/g,'{{')[_0x3a9b('0xb')](/}@/g,'}}');return util[_0x3a9b('0x8')](_0x3a9b('0xd'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),_0x6c8b2d[_0x3a9b('0xe')]['toUpperCase'](),_0x4acaa5,_0x6c8b2d[_0x3a9b('0xa')]);}module['exports']=function(_0x2495b7){return new winston[(_0x3a9b('0xf'))]({'transports':[new winston[(_0x3a9b('0x10'))]['File']({'name':util[_0x3a9b('0x8')]('%s-%s',_0x2495b7,'error'),'filename':filename(_0x2495b7,'error'),'level':_0x3a9b('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x386417){return formatter(_0x2495b7,_0x386417);}}),new winston[(_0x3a9b('0x10'))][(_0x3a9b('0x12'))]({'name':util['format'](_0x3a9b('0x13'),_0x2495b7,'info'),'filename':filename(_0x2495b7,'info'),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x17c0e5){return formatter(_0x2495b7,_0x17c0e5);}}),new winston[(_0x3a9b('0x10'))][(_0x3a9b('0x14'))]({'level':process['env']['debugLevel']||debugLevel,'json':![],'formatter':function(_0xe0faa6){return formatter(_0x2495b7,_0xe0faa6);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 6a5a791..3e8641e 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 _0x5524=['../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/email/index.js','routing','../../services/xdr/index.js','exports','path','express','join'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x5524,0x76));var _0x4552=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x5524[_0x1035c1];return _0x308d67;};'use strict';var path=require(_0x4552('0x0'));var os=require('os');var config={'apps':[{'name':_0x4552('0x1'),'script':path[_0x4552('0x2')](__dirname,_0x4552('0x3'))},{'name':_0x4552('0x4'),'script':path[_0x4552('0x2')](__dirname,_0x4552('0x5'))},{'name':_0x4552('0x6'),'script':path[_0x4552('0x2')](__dirname,'../../services/agi/index.js')},{'name':'email','script':path[_0x4552('0x2')](__dirname,_0x4552('0x7'))},{'name':_0x4552('0x8'),'script':path[_0x4552('0x2')](__dirname,'../../services/routing/index.js')},{'name':'xdr','script':path[_0x4552('0x2')](__dirname,_0x4552('0x9'))}]};module[_0x4552('0xa')]=config; \ No newline at end of file +var _0xa4bd=['path','express','../../services/express/index.js','ami','agi','join','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','exports'];(function(_0x39df77,_0x1738bf){var _0x2a8bf4=function(_0x4f94af){while(--_0x4f94af){_0x39df77['push'](_0x39df77['shift']());}};_0x2a8bf4(++_0x1738bf);}(_0xa4bd,0x68));var _0xda4b=function(_0x1f6702,_0x5df09e){_0x1f6702=_0x1f6702-0x0;var _0x4882d1=_0xa4bd[_0x1f6702];return _0x4882d1;};'use strict';var path=require(_0xda4b('0x0'));var os=require('os');var config={'apps':[{'name':_0xda4b('0x1'),'script':path['join'](__dirname,_0xda4b('0x2'))},{'name':_0xda4b('0x3'),'script':path['join'](__dirname,'../../services/ami/index.js')},{'name':_0xda4b('0x4'),'script':path[_0xda4b('0x5')](__dirname,_0xda4b('0x6'))},{'name':_0xda4b('0x7'),'script':path[_0xda4b('0x5')](__dirname,_0xda4b('0x8'))},{'name':_0xda4b('0x9'),'script':path[_0xda4b('0x5')](__dirname,_0xda4b('0xa'))},{'name':_0xda4b('0xb'),'script':path[_0xda4b('0x5')](__dirname,'../../services/xdr/index.js')}]};module[_0xda4b('0xc')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 806540a..1128f77 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 _0xfa35=['dump','saved','pm2','bluebird','./config','connect','connected','start','then','disconnect','stop','restart','list','describe','delete'];(function(_0x2cb984,_0x365f50){var _0x2f73e6=function(_0x315369){while(--_0x315369){_0x2cb984['push'](_0x2cb984['shift']());}};_0x2f73e6(++_0x365f50);}(_0xfa35,0x1a6));var _0x5fa3=function(_0x2dc96f,_0x459058){_0x2dc96f=_0x2dc96f-0x0;var _0xd012da=_0xfa35[_0x2dc96f];return _0xd012da;};'use strict';var pm2=require(_0x5fa3('0x0'));var BPromise=require(_0x5fa3('0x1'));var config=require(_0x5fa3('0x2'));function connect(){return new BPromise(function(_0x41f363,_0x4821fc){return pm2[_0x5fa3('0x3')](function(_0x3e258d){if(_0x3e258d){return _0x4821fc(_0x3e258d);}return _0x41f363(_0x5fa3('0x4'));});});};exports[_0x5fa3('0x5')]=function(_0xfc859a){return connect()[_0x5fa3('0x6')](function(){return new BPromise(function(_0x335039,_0x4bd48e){return pm2[_0x5fa3('0x5')](_0xfc859a,function(_0x195931,_0x111e3c){if(_0x195931){return _0x4bd48e(_0x195931);}pm2[_0x5fa3('0x7')]();return _0x335039(_0x111e3c);});});});};exports[_0x5fa3('0x8')]=function(_0x5b8826){return connect()['then'](function(){return new BPromise(function(_0x52752d,_0x5e0513){return pm2[_0x5fa3('0x8')](_0x5b8826,function(_0x4b6fff,_0x182d19){if(_0x4b6fff){return _0x5e0513(_0x4b6fff);}pm2['disconnect']();return _0x52752d(_0x182d19);});});});};exports[_0x5fa3('0x9')]=function(_0x5e1efe){return connect()[_0x5fa3('0x6')](function(){return new BPromise(function(_0x380cd4,_0x5c4ba4){return pm2[_0x5fa3('0x9')](_0x5e1efe,function(_0x4ec6a5,_0x4e2d87){if(_0x4ec6a5){return _0x5c4ba4(_0x4ec6a5);}pm2[_0x5fa3('0x7')]();return _0x380cd4(_0x4e2d87);});});});};exports[_0x5fa3('0xa')]=function(){return connect()[_0x5fa3('0x6')](function(){return new BPromise(function(_0x422872,_0x3737c4){return pm2[_0x5fa3('0xa')](function(_0x46ccc8,_0x584a79){if(_0x46ccc8){return _0x3737c4(_0x46ccc8);}pm2[_0x5fa3('0x7')]();return _0x422872(_0x584a79);});});});};exports[_0x5fa3('0xb')]=function(_0x2e75eb){return connect()[_0x5fa3('0x6')](function(){return new BPromise(function(_0x119637,_0x4e07b5){return pm2[_0x5fa3('0xb')](_0x2e75eb,function(_0x3d04c8,_0x51d24b){if(_0x3d04c8){return _0x4e07b5(_0x3d04c8);}pm2[_0x5fa3('0x7')]();return _0x119637(_0x51d24b);});});});};exports[_0x5fa3('0xc')]=function(_0xe12beb){return connect()[_0x5fa3('0x6')](function(){return new BPromise(function(_0x5b6243,_0x4dc032){return pm2[_0x5fa3('0xc')](_0xe12beb,function(_0x4a4fcb,_0x165fe6){if(_0x4a4fcb){return _0x4dc032(_0x4a4fcb);}pm2[_0x5fa3('0x7')]();return _0x5b6243(_0x165fe6);});});});};exports[_0x5fa3('0xd')]=function(){return connect()[_0x5fa3('0x6')](function(){return new BPromise(function(_0x30abc4,_0x162111){return pm2[_0x5fa3('0xd')](function(_0x4ed19b){if(_0x4ed19b){return _0x162111(_0x4ed19b);}return _0x30abc4(_0x5fa3('0xe'));});});});}; \ No newline at end of file +var _0x525f=['connect','connected','then','disconnect','stop','restart','list','describe','delete','dump','saved','pm2','./config'];(function(_0x3bacfa,_0x2293b2){var _0x388302=function(_0x3f7886){while(--_0x3f7886){_0x3bacfa['push'](_0x3bacfa['shift']());}};_0x388302(++_0x2293b2);}(_0x525f,0x1b8));var _0xf525=function(_0x3bc9d3,_0x105bba){_0x3bc9d3=_0x3bc9d3-0x0;var _0x536b66=_0x525f[_0x3bc9d3];return _0x536b66;};'use strict';var pm2=require(_0xf525('0x0'));var BPromise=require('bluebird');var config=require(_0xf525('0x1'));function connect(){return new BPromise(function(_0x4147b2,_0x20215f){return pm2[_0xf525('0x2')](function(_0xd30c48){if(_0xd30c48){return _0x20215f(_0xd30c48);}return _0x4147b2(_0xf525('0x3'));});});};exports['start']=function(_0x2c41d1){return connect()[_0xf525('0x4')](function(){return new BPromise(function(_0x4a42c3,_0x440855){return pm2['start'](_0x2c41d1,function(_0x65e242,_0x118ca2){if(_0x65e242){return _0x440855(_0x65e242);}pm2[_0xf525('0x5')]();return _0x4a42c3(_0x118ca2);});});});};exports[_0xf525('0x6')]=function(_0x44805f){return connect()[_0xf525('0x4')](function(){return new BPromise(function(_0x1bec91,_0x3ec02b){return pm2['stop'](_0x44805f,function(_0x20ae22,_0x1850cf){if(_0x20ae22){return _0x3ec02b(_0x20ae22);}pm2[_0xf525('0x5')]();return _0x1bec91(_0x1850cf);});});});};exports[_0xf525('0x7')]=function(_0x4b9979){return connect()[_0xf525('0x4')](function(){return new BPromise(function(_0x80a76b,_0x373591){return pm2[_0xf525('0x7')](_0x4b9979,function(_0x4c0351,_0x1880f6){if(_0x4c0351){return _0x373591(_0x4c0351);}pm2[_0xf525('0x5')]();return _0x80a76b(_0x1880f6);});});});};exports[_0xf525('0x8')]=function(){return connect()[_0xf525('0x4')](function(){return new BPromise(function(_0x33d873,_0x3fc677){return pm2[_0xf525('0x8')](function(_0x49e9f4,_0x5a7d3b){if(_0x49e9f4){return _0x3fc677(_0x49e9f4);}pm2[_0xf525('0x5')]();return _0x33d873(_0x5a7d3b);});});});};exports[_0xf525('0x9')]=function(_0x3c2927){return connect()[_0xf525('0x4')](function(){return new BPromise(function(_0x131db8,_0x1fe063){return pm2[_0xf525('0x9')](_0x3c2927,function(_0x222cb1,_0x1a1c8d){if(_0x222cb1){return _0x1fe063(_0x222cb1);}pm2['disconnect']();return _0x131db8(_0x1a1c8d);});});});};exports['delete']=function(_0x25ba7a){return connect()[_0xf525('0x4')](function(){return new BPromise(function(_0x1244f9,_0x13679c){return pm2[_0xf525('0xa')](_0x25ba7a,function(_0x306d03,_0x39e20d){if(_0x306d03){return _0x13679c(_0x306d03);}pm2[_0xf525('0x5')]();return _0x1244f9(_0x39e20d);});});});};exports[_0xf525('0xb')]=function(){return connect()[_0xf525('0x4')](function(){return new BPromise(function(_0x1dd431,_0x2efb01){return pm2['dump'](function(_0x385d99){if(_0x385d99){return _0x2efb01(_0x385d99);}return _0x1dd431(_0xf525('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index be2cae5..cdc602d 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 _0x2ca9=['socket.io-emitter','Setting','chatTimeout','then','ChatInteraction','lastMsgAt','subtract','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','system','timeout','format','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','catch','error','inspect','lodash','moment','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost'];(function(_0x1af05b,_0x5134b5){var _0x5be7cc=function(_0x2d4ac0){while(--_0x2d4ac0){_0x1af05b['push'](_0x1af05b['shift']());}};_0x5be7cc(++_0x5134b5);}(_0x2ca9,0x1a8));var _0x92ca=function(_0x3421f7,_0x272690){_0x3421f7=_0x3421f7-0x0;var _0xc206ab=_0x2ca9[_0x3421f7];return _0xc206ab;};'use strict';var _=require(_0x92ca('0x0'));var moment=require(_0x92ca('0x1'));var Redis=require('ioredis');var util=require(_0x92ca('0x2'));var config=require(_0x92ca('0x3'));var db=require(_0x92ca('0x4'))['db'];var logger=require(_0x92ca('0x5'))(_0x92ca('0x6'));config[_0x92ca('0x7')]=_[_0x92ca('0x8')](config[_0x92ca('0x7')],{'host':_0x92ca('0x9'),'port':0x18eb});var io=require(_0x92ca('0xa'))(new Redis(config[_0x92ca('0x7')]));function closeInteractions(){var _0x44924f=0x0;var _0xa44984=[];return db[_0x92ca('0xb')]['find']({'raw':!![],'attributes':['id',_0x92ca('0xc')],'where':{'id':0x1}})[_0x92ca('0xd')](function(_0x462851){_0x44924f=_0x462851['chatTimeout'];if(_0x44924f){return db[_0x92ca('0xe')]['findAll']({'raw':!![],'attributes':['id',_0x92ca('0xf')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x92ca('0x10')](_0x462851['chatTimeout'],_0x92ca('0x11'))}}});}else{return[];}})[_0x92ca('0xd')](function(_0x45bad4){if(_0x45bad4&&_0x45bad4[_0x92ca('0x12')]){_0xa44984=_[_0x92ca('0x13')](_0x45bad4||[],'id');logger[_0x92ca('0x14')](_0x92ca('0x15'),_0xa44984[_0x92ca('0x16')]());return db[_0x92ca('0xe')]['update']({'closeReason':_0x92ca('0x17'),'disposition':_0x92ca('0x18'),'closed':!![],'closedAt':moment()[_0x92ca('0x19')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0xa44984}});}})[_0x92ca('0xd')](function(){if(_0xa44984&&_0xa44984[_0x92ca('0x12')]){logger[_0x92ca('0x14')](_0x92ca('0x1a'),_0xa44984[_0x92ca('0x16')]());for(var _0x12c25a=0x0;_0x12c25a<_0xa44984[_0x92ca('0x12')];_0x12c25a++){io[_0x92ca('0x1b')]('chatInteraction:update',{'id':_0xa44984[_0x12c25a],'closed':!![]});}}})[_0x92ca('0x1c')](function(_0x1ee6ad){logger[_0x92ca('0x1d')]('[CHAT]\x20Error\x20closing\x20interactions',_0x1ee6ad?util[_0x92ca('0x1e')](_0x1ee6ad,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x1161=['moment','ioredis','util','../../config/environment','../../mysqldb','schedule','redis','defaults','localhost','socket.io-emitter','find','chatTimeout','ChatInteraction','findAll','lastMsgAt','subtract','minutes','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','then','length','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','start'];(function(_0x475198,_0xbb6269){var _0x5084b1=function(_0x2f7bbe){while(--_0x2f7bbe){_0x475198['push'](_0x475198['shift']());}};_0x5084b1(++_0xbb6269);}(_0x1161,0xd2));var _0x1116=function(_0x46c5f6,_0x4f6b2c){_0x46c5f6=_0x46c5f6-0x0;var _0x2e6327=_0x1161[_0x46c5f6];return _0x2e6327;};'use strict';var _=require('lodash');var moment=require(_0x1116('0x0'));var Redis=require(_0x1116('0x1'));var util=require(_0x1116('0x2'));var config=require(_0x1116('0x3'));var db=require(_0x1116('0x4'))['db'];var logger=require('../logger')(_0x1116('0x5'));config[_0x1116('0x6')]=_[_0x1116('0x7')](config[_0x1116('0x6')],{'host':_0x1116('0x8'),'port':0x18eb});var io=require(_0x1116('0x9'))(new Redis(config[_0x1116('0x6')]));function closeInteractions(){var _0x528f1d=0x0;var _0x577f07=[];return db['Setting'][_0x1116('0xa')]({'raw':!![],'attributes':['id',_0x1116('0xb')],'where':{'id':0x1}})['then'](function(_0x521c72){_0x528f1d=_0x521c72[_0x1116('0xb')];if(_0x528f1d){return db[_0x1116('0xc')][_0x1116('0xd')]({'raw':!![],'attributes':['id',_0x1116('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x1116('0xf')](_0x521c72[_0x1116('0xb')],_0x1116('0x10'))}}});}else{return[];}})['then'](function(_0x4169c5){if(_0x4169c5&&_0x4169c5['length']){_0x577f07=_[_0x1116('0x11')](_0x4169c5||[],'id');logger[_0x1116('0x12')](_0x1116('0x13'),_0x577f07[_0x1116('0x14')]());return db[_0x1116('0xc')][_0x1116('0x15')]({'closeReason':_0x1116('0x16'),'disposition':_0x1116('0x17'),'closed':!![],'closedAt':moment()[_0x1116('0x18')](_0x1116('0x19'))},{'where':{'id':_0x577f07}});}})[_0x1116('0x1a')](function(){if(_0x577f07&&_0x577f07[_0x1116('0x1b')]){logger[_0x1116('0x12')](_0x1116('0x1c'),_0x577f07['join']());for(var _0x18602a=0x0;_0x18602a<_0x577f07[_0x1116('0x1b')];_0x18602a++){io[_0x1116('0x1d')](_0x1116('0x1e'),{'id':_0x577f07[_0x18602a],'closed':!![]});}}})[_0x1116('0x1f')](function(_0x16a588){logger[_0x1116('0x20')](_0x1116('0x21'),_0x16a588?util['inspect'](_0x16a588,{'showHidden':![],'depth':null}):'');});}exports[_0x1116('0x22')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 49a0936..cd371b1 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 _0x0f8a=['DefaultReportId','exec\x20defaul\x20report\x20id:%s','CustomReportId','runReport','no\x20report\x20id','Schedule','MailServerOut','keys','map','toString','keyBy','difference','intersection','length','stop','deleteJob','delete\x20cron','my\x20id','resolve','run\x20job','active','startAt','add','start','add\x20cron','stop\x20cron','cron','exists','endAt','update','util','path','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','Smtp','service','port','secure','auth','\x22%s\x22\x20<%s>','email','user','bcc','format','name','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','zip','status','message','attachments','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Sent','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','SendMail','then','error','error\x20mail','email\x20sent','catch','data','subtractNumber\x20null\x20or\x20undefined','isNil','YYYY-MM-DD\x20HH:mm:ss','scheduled','output'];(function(_0xf1ceb4,_0x3443e6){var _0x42ed45=function(_0x9ec7fa){while(--_0x9ec7fa){_0xf1ceb4['push'](_0xf1ceb4['shift']());}};_0x42ed45(++_0x3443e6);}(_0x0f8a,0x72));var _0xa0f8=function(_0x2f4be3,_0x517b55){_0x2f4be3=_0x2f4be3-0x0;var _0x3acfb8=_0x0f8a[_0x2f4be3];return _0x3acfb8;};'use strict';var fs=require('fs');var util=require(_0xa0f8('0x0'));var path=require(_0xa0f8('0x1'));var _=require('lodash');var moment=require(_0xa0f8('0x2'));var CronJobManager=require(_0xa0f8('0x3'));var jayson=require(_0xa0f8('0x4'));var BPromise=require(_0xa0f8('0x5'));var logger=require(_0xa0f8('0x6'))(_0xa0f8('0x7'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0xa0f8('0x8'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0xa0f8('0x9')][_0xa0f8('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x2ff131,_0x18055b){return function(){logger[_0xa0f8('0xb')](_0xa0f8('0xc'),_0x2ff131['email']);var _0x4c9d86=!![];var _0x34afcf={'tls':{'rejectUnauthorized':![]}};if(_0x2ff131[_0xa0f8('0xd')][_0xa0f8('0xe')][_0xa0f8('0xf')]){_0x34afcf[_0xa0f8('0xf')]=_0x2ff131['MailAccount'][_0xa0f8('0xe')][_0xa0f8('0xf')];}else{_0x34afcf['host']=_0x2ff131['MailAccount'][_0xa0f8('0xe')]['host'];_0x34afcf[_0xa0f8('0x10')]=_0x2ff131[_0xa0f8('0xd')][_0xa0f8('0xe')][_0xa0f8('0x10')];_0x34afcf[_0xa0f8('0x11')]=_0x2ff131[_0xa0f8('0xd')][_0xa0f8('0xe')][_0xa0f8('0x11')];}if(_0x2ff131[_0xa0f8('0xd')]['Smtp']['authentication']){_0x34afcf[_0xa0f8('0x12')]={'user':_0x2ff131['MailAccount']['Smtp']['user'],'pass':_0x2ff131[_0xa0f8('0xd')][_0xa0f8('0xe')]['pass']};}var _0x1539c6={'account':_0x34afcf,'message':{'from':util['format'](_0xa0f8('0x13'),_0x2ff131['MailAccount']['name'],_0x2ff131['MailAccount'][_0xa0f8('0x14')]||_0x2ff131[_0xa0f8('0xd')][_0xa0f8('0xe')][_0xa0f8('0x15')]),'to':_0x2ff131['email'],'cc':_0x2ff131['cc'],'bcc':_0x2ff131[_0xa0f8('0x16')],'subject':util[_0xa0f8('0x17')]('Report\x20%s\x20last\x20%s\x20%s',_0x18055b[_0xa0f8('0x18')],_0x2ff131[_0xa0f8('0x19')],_0x2ff131[_0xa0f8('0x1a')])}};var _0x5b1f39=path[_0xa0f8('0x1b')](__dirname,_0xa0f8('0x1c'));var _0x207ea0=_0x18055b[_0xa0f8('0x1d')];var _0x1f6c40=util[_0xa0f8('0x17')](_0xa0f8('0x1e'),path[_0xa0f8('0x1f')](_0x18055b[_0xa0f8('0x1d')],path[_0xa0f8('0x20')](_0x18055b[_0xa0f8('0x1d')])),_0xa0f8('0x21'));var _0x47255f=path[_0xa0f8('0x1b')](_0x5b1f39,_0x207ea0);var _0x3fabc7=path['join'](_0x5b1f39,_0x1f6c40);if(fs['existsSync'](_0x47255f)){_0x18055b[_0xa0f8('0x22')]='Sent';_0x1539c6[_0xa0f8('0x23')][_0xa0f8('0x24')]=[{'filename':_0x207ea0,'path':_0x47255f}];_0x1539c6[_0xa0f8('0x23')]['text']=util[_0xa0f8('0x17')](_0xa0f8('0x25'),JSON[_0xa0f8('0x26')](_0x18055b,null,0x2));}else if(fs['existsSync'](_0x3fabc7)){_0x18055b[_0xa0f8('0x22')]=_0xa0f8('0x27');_0x1539c6['message'][_0xa0f8('0x24')]=[{'filename':_0x1f6c40,'path':_0x3fabc7}];}else{_0x1539c6['message']['text']=_0xa0f8('0x28');if(!_0x2ff131[_0xa0f8('0x29')]){_0x4c9d86=![];logger[_0xa0f8('0xb')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x4c9d86){return client['request'](_0xa0f8('0x2a'),_0x1539c6)[_0xa0f8('0x2b')](function(_0x455f3e){if(_0x455f3e[_0xa0f8('0x2c')]){return logger[_0xa0f8('0x2c')](_0xa0f8('0x2d'),JSON['stringify'](_0x455f3e));}return logger['info'](_0xa0f8('0x2e'));})[_0xa0f8('0x2f')](function(_0x179bfc){return logger[_0xa0f8('0x2c')](_0xa0f8('0x2d'),JSON[_0xa0f8('0x26')](_0x179bfc));});}};}function handleError(){return function(_0x59b913){return logger['error'](JSON[_0xa0f8('0x26')](_0x59b913));};}function handleResult(_0x4a99a9){return function(_0x367625){logger['info'](_0xa0f8('0x30'),JSON['stringify'](_0x367625));if(_0x4a99a9[_0xa0f8('0xd')]&&_0x4a99a9[_0xa0f8('0xd')][_0xa0f8('0xe')]&&!_['isNil'](_0x4a99a9['email'])){setTimeout(handleSendEmail(_0x4a99a9,_0x367625),0x3c*0x3e8);}};}function handleJob(_0x288490){return function(){try{if(_['isNil'](_0x288490[_0xa0f8('0x19')])){return logger[_0xa0f8('0xb')](_0xa0f8('0x31'));}if(_[_0xa0f8('0x32')](_0x288490[_0xa0f8('0x1a')])){return logger[_0xa0f8('0xb')]('subtractUnit\x20null\x20or\x20undefined');}var _0x412a1c={'startDate':moment()['subtract'](_0x288490[_0xa0f8('0x19')],_0x288490[_0xa0f8('0x1a')])[_0xa0f8('0x17')](_0xa0f8('0x33')),'endDate':moment()[_0xa0f8('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0xa0f8('0x34'),'output':_0x288490[_0xa0f8('0x35')],'name':_0x288490['name']};if(!_[_0xa0f8('0x32')](_0x288490[_0xa0f8('0x36')])){logger[_0xa0f8('0xb')](_0xa0f8('0x37'),_0x288490[_0xa0f8('0x36')]);return analyticDefaultReportController['runReport']({'id':_0x288490[_0xa0f8('0x36')]},_0x412a1c)[_0xa0f8('0x2b')](handleResult(_0x288490))[_0xa0f8('0x2f')](handleError());}if(!_[_0xa0f8('0x32')](_0x288490[_0xa0f8('0x38')])){logger['info']('exec\x20custom\x20report\x20id:%s',_0x288490[_0xa0f8('0x38')]);return analyticCustomReportController[_0xa0f8('0x39')]({'id':_0x288490[_0xa0f8('0x38')]},_0x412a1c)[_0xa0f8('0x2b')](handleResult(_0x288490))[_0xa0f8('0x2f')](handleError());}}catch(_0x3a730f){logger[_0xa0f8('0x2c')](JSON[_0xa0f8('0x26')](_0x3a730f));}return logger['info'](_0xa0f8('0x3a'));};}function getJobs(_0x2db808){var _0x10db5f={};if(_0x2db808){_0x10db5f['id']=_0x2db808;}return db[_0xa0f8('0x3b')]['findAll']({'where':_0x10db5f,'include':[{'model':db[_0xa0f8('0xd')],'attributes':['id',_0xa0f8('0x18'),_0xa0f8('0x14')],'include':[{'model':db[_0xa0f8('0x3c')],'as':_0xa0f8('0xe')}]}]})['then'](function(_0x16a964){var _0x9c4982=_[_0xa0f8('0x3d')](manager['jobs']);var _0x142135=_[_0xa0f8('0x3e')](_0x16a964,function(_0x19ae75){return _0x19ae75['id'][_0xa0f8('0x3f')]();});var _0x6235f3=_[_0xa0f8('0x40')](_0x16a964,function(_0x3cb422){return _0x3cb422['id'][_0xa0f8('0x3f')]();});var _0x41a15e=_0x2db808?_0x142135:_[_0xa0f8('0x41')](_0x142135,_0x9c4982);var _0x187d0e=_[_0xa0f8('0x42')](_0x142135,_0x9c4982);var _0x2b104c=_['difference'](_0x9c4982,_0x142135);var _0x197cad;var _0x2879c0;for(_0x197cad=0x0;_0x197cad<_0x2b104c[_0xa0f8('0x43')]&&!_0x2db808;_0x197cad+=0x1){_0x2879c0=_0x2b104c[_0x197cad][_0xa0f8('0x3f')]();if(manager['exists'](_0x2879c0)){manager[_0xa0f8('0x44')](_0x2879c0);manager[_0xa0f8('0x45')](_0x2879c0);logger[_0xa0f8('0xb')](_0xa0f8('0x46'),_0x2879c0);}}logger[_0xa0f8('0xb')]('toRun',JSON[_0xa0f8('0x26')](_0x41a15e));for(_0x197cad=0x0;_0x197cad<_0x41a15e['length'];_0x197cad+=0x1){_0x2879c0=_0x41a15e[_0x197cad]['toString']();logger[_0xa0f8('0xb')]('index',_0x2879c0);if(_0x2db808){logger['info'](_0xa0f8('0x47'),_0x2db808);logger[_0xa0f8('0xb')](JSON['stringify'](_0x6235f3[_0x2879c0]));BPromise[_0xa0f8('0x48')]()[_0xa0f8('0x2b')](handleJob(_0x6235f3[_0x2879c0]));logger[_0xa0f8('0xb')](_0xa0f8('0x49'),_0x6235f3[_0x2879c0][_0xa0f8('0x18')],_0x6235f3[_0x2879c0]['cron']);}else if(_0x6235f3[_0x2879c0]['cron']&&_0x6235f3[_0x2879c0][_0xa0f8('0x4a')]&&moment()['isBetween'](_0x6235f3[_0x2879c0][_0xa0f8('0x4b')],_0x6235f3[_0x2879c0]['endAt'])){manager[_0xa0f8('0x4c')](_0x2879c0,_0x6235f3[_0x2879c0]['cron'],handleJob(_0x6235f3[_0x2879c0]));manager[_0xa0f8('0x4d')](_0x2879c0);logger[_0xa0f8('0xb')](_0xa0f8('0x4e'),_0x6235f3[_0x2879c0][_0xa0f8('0x18')],_0x6235f3[_0x2879c0]['cron']);}else if(manager['exists'](_0x2879c0)){manager[_0xa0f8('0x44')](_0x2879c0);manager[_0xa0f8('0x45')](_0x2879c0);logger[_0xa0f8('0xb')](_0xa0f8('0x4f'),_0x6235f3[_0x2879c0][_0xa0f8('0x18')],_0x6235f3[_0x2879c0][_0xa0f8('0x50')]);}}for(_0x197cad=0x0,_0x2879c0;_0x197cad<_0x187d0e[_0xa0f8('0x43')]&&!_0x2db808;_0x197cad+=0x1){_0x2879c0=_0x187d0e[_0x197cad][_0xa0f8('0x3f')]();if(manager[_0xa0f8('0x51')](_0x2879c0)){if(_0x6235f3[_0x2879c0][_0xa0f8('0x50')]&&_0x6235f3[_0x2879c0]['active']&&moment()['isBetween'](_0x6235f3[_0x2879c0]['startAt'],_0x6235f3[_0x2879c0][_0xa0f8('0x52')])){manager[_0xa0f8('0x53')](_0x2879c0,_0x6235f3[_0x2879c0]['cron'],handleJob(_0x6235f3[_0x2879c0]));logger['info']('update\x20cron',_0x6235f3[_0x2879c0]['name'],_0x6235f3[_0x2879c0]['cron']);}else{manager[_0xa0f8('0x44')](_0x2879c0);manager[_0xa0f8('0x45')](_0x2879c0);logger['info'](_0xa0f8('0x4f'),_0x6235f3[_0x2879c0][_0xa0f8('0x18')],_0x6235f3[_0x2879c0][_0xa0f8('0x50')]);}}}})[_0xa0f8('0x2f')](function(_0x5612bf){logger[_0xa0f8('0x2c')](JSON[_0xa0f8('0x26')](_0x5612bf));});}exports['run']=function(_0x269c28){return getJobs(_0x269c28);};exports[_0xa0f8('0x4d')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x0eae=['attachments','message','text','stringify','status','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','email\x20sent','catch','error\x20mail','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','exec\x20defaul\x20report\x20id:%s','runReport','DefaultReportId','CustomReportId','exec\x20custom\x20report\x20id:%s','Schedule','MailServerOut','keys','jobs','map','toString','keyBy','difference','intersection','length','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','isBetween','startAt','endAt','add','start','exists','deleteJob','stop\x20cron','active','update\x20cron','run','util','path','lodash','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','info','Try\x20to\x20send\x20a\x20mail\x20to','email','Smtp','service','MailAccount','host','port','secure','authentication','auth','user','pass','format','\x22%s\x22\x20<%s>','name','subtractNumber','join','../../files/reports','savename','extname','zip','Sent'];(function(_0x590ec5,_0xd9897e){var _0x308f95=function(_0x1bd67a){while(--_0x1bd67a){_0x590ec5['push'](_0x590ec5['shift']());}};_0x308f95(++_0xd9897e);}(_0x0eae,0x192));var _0xe0ea=function(_0x44d809,_0x1f76fb){_0x44d809=_0x44d809-0x0;var _0x5361b9=_0x0eae[_0x44d809];return _0x5361b9;};'use strict';var fs=require('fs');var util=require(_0xe0ea('0x0'));var path=require(_0xe0ea('0x1'));var _=require(_0xe0ea('0x2'));var moment=require('moment');var CronJobManager=require(_0xe0ea('0x3'));var jayson=require(_0xe0ea('0x4'));var BPromise=require(_0xe0ea('0x5'));var logger=require(_0xe0ea('0x6'))(_0xe0ea('0x7'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0xe0ea('0x8'));var analyticDefaultReportController=require(_0xe0ea('0x9'));var client=jayson['client']['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x329d48,_0x40a039){return function(){logger[_0xe0ea('0xa')](_0xe0ea('0xb'),_0x329d48[_0xe0ea('0xc')]);var _0xc2ce7c=!![];var _0x36038={'tls':{'rejectUnauthorized':![]}};if(_0x329d48['MailAccount'][_0xe0ea('0xd')][_0xe0ea('0xe')]){_0x36038[_0xe0ea('0xe')]=_0x329d48[_0xe0ea('0xf')]['Smtp'][_0xe0ea('0xe')];}else{_0x36038[_0xe0ea('0x10')]=_0x329d48[_0xe0ea('0xf')]['Smtp']['host'];_0x36038['port']=_0x329d48[_0xe0ea('0xf')][_0xe0ea('0xd')][_0xe0ea('0x11')];_0x36038[_0xe0ea('0x12')]=_0x329d48[_0xe0ea('0xf')][_0xe0ea('0xd')][_0xe0ea('0x12')];}if(_0x329d48[_0xe0ea('0xf')][_0xe0ea('0xd')][_0xe0ea('0x13')]){_0x36038[_0xe0ea('0x14')]={'user':_0x329d48[_0xe0ea('0xf')][_0xe0ea('0xd')][_0xe0ea('0x15')],'pass':_0x329d48[_0xe0ea('0xf')][_0xe0ea('0xd')][_0xe0ea('0x16')]};}var _0x406611={'account':_0x36038,'message':{'from':util[_0xe0ea('0x17')](_0xe0ea('0x18'),_0x329d48[_0xe0ea('0xf')][_0xe0ea('0x19')],_0x329d48[_0xe0ea('0xf')][_0xe0ea('0xc')]||_0x329d48[_0xe0ea('0xf')]['Smtp'][_0xe0ea('0x15')]),'to':_0x329d48[_0xe0ea('0xc')],'cc':_0x329d48['cc'],'bcc':_0x329d48['bcc'],'subject':util[_0xe0ea('0x17')]('Report\x20%s\x20last\x20%s\x20%s',_0x40a039[_0xe0ea('0x19')],_0x329d48[_0xe0ea('0x1a')],_0x329d48['subtractUnit'])}};var _0xdb87b0=path[_0xe0ea('0x1b')](__dirname,_0xe0ea('0x1c'));var _0x3ff53a=_0x40a039[_0xe0ea('0x1d')];var _0x3591d4=util[_0xe0ea('0x17')]('%s.%s',path['basename'](_0x40a039['savename'],path[_0xe0ea('0x1e')](_0x40a039[_0xe0ea('0x1d')])),_0xe0ea('0x1f'));var _0x23899d=path['join'](_0xdb87b0,_0x3ff53a);var _0x2da410=path[_0xe0ea('0x1b')](_0xdb87b0,_0x3591d4);if(fs['existsSync'](_0x23899d)){_0x40a039['status']=_0xe0ea('0x20');_0x406611['message'][_0xe0ea('0x21')]=[{'filename':_0x3ff53a,'path':_0x23899d}];_0x406611[_0xe0ea('0x22')][_0xe0ea('0x23')]=util[_0xe0ea('0x17')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0xe0ea('0x24')](_0x40a039,null,0x2));}else if(fs['existsSync'](_0x2da410)){_0x40a039[_0xe0ea('0x25')]=_0xe0ea('0x20');_0x406611[_0xe0ea('0x22')][_0xe0ea('0x21')]=[{'filename':_0x3591d4,'path':_0x2da410}];}else{_0x406611[_0xe0ea('0x22')]['text']='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x329d48[_0xe0ea('0x26')]){_0xc2ce7c=![];logger['info'](_0xe0ea('0x27'));}}if(_0xc2ce7c){return client[_0xe0ea('0x28')](_0xe0ea('0x29'),_0x406611)[_0xe0ea('0x2a')](function(_0x15d34b){if(_0x15d34b[_0xe0ea('0x2b')]){return logger[_0xe0ea('0x2b')]('error\x20mail',JSON[_0xe0ea('0x24')](_0x15d34b));}return logger[_0xe0ea('0xa')](_0xe0ea('0x2c'));})[_0xe0ea('0x2d')](function(_0x149d09){return logger['error'](_0xe0ea('0x2e'),JSON['stringify'](_0x149d09));});}};}function handleError(){return function(_0x4147ee){return logger[_0xe0ea('0x2b')](JSON[_0xe0ea('0x24')](_0x4147ee));};}function handleResult(_0x37fdb3){return function(_0x31cb75){logger['info']('data',JSON[_0xe0ea('0x24')](_0x31cb75));if(_0x37fdb3[_0xe0ea('0xf')]&&_0x37fdb3[_0xe0ea('0xf')][_0xe0ea('0xd')]&&!_[_0xe0ea('0x2f')](_0x37fdb3['email'])){setTimeout(handleSendEmail(_0x37fdb3,_0x31cb75),0x3c*0x3e8);}};}function handleJob(_0xfdf115){return function(){try{if(_[_0xe0ea('0x2f')](_0xfdf115[_0xe0ea('0x1a')])){return logger['info'](_0xe0ea('0x30'));}if(_[_0xe0ea('0x2f')](_0xfdf115[_0xe0ea('0x31')])){return logger[_0xe0ea('0xa')](_0xe0ea('0x32'));}var _0x52d215={'startDate':moment()['subtract'](_0xfdf115['subtractNumber'],_0xfdf115[_0xe0ea('0x31')])['format'](_0xe0ea('0x33')),'endDate':moment()[_0xe0ea('0x17')](_0xe0ea('0x33')),'type':_0xe0ea('0x34'),'output':_0xfdf115[_0xe0ea('0x35')],'name':_0xfdf115[_0xe0ea('0x19')]};if(!_[_0xe0ea('0x2f')](_0xfdf115['DefaultReportId'])){logger[_0xe0ea('0xa')](_0xe0ea('0x36'),_0xfdf115['DefaultReportId']);return analyticDefaultReportController[_0xe0ea('0x37')]({'id':_0xfdf115[_0xe0ea('0x38')]},_0x52d215)[_0xe0ea('0x2a')](handleResult(_0xfdf115))[_0xe0ea('0x2d')](handleError());}if(!_[_0xe0ea('0x2f')](_0xfdf115[_0xe0ea('0x39')])){logger[_0xe0ea('0xa')](_0xe0ea('0x3a'),_0xfdf115[_0xe0ea('0x39')]);return analyticCustomReportController[_0xe0ea('0x37')]({'id':_0xfdf115['CustomReportId']},_0x52d215)[_0xe0ea('0x2a')](handleResult(_0xfdf115))[_0xe0ea('0x2d')](handleError());}}catch(_0x55834d){logger['error'](JSON[_0xe0ea('0x24')](_0x55834d));}return logger[_0xe0ea('0xa')]('no\x20report\x20id');};}function getJobs(_0x59e3e6){var _0x1db0d0={};if(_0x59e3e6){_0x1db0d0['id']=_0x59e3e6;}return db[_0xe0ea('0x3b')]['findAll']({'where':_0x1db0d0,'include':[{'model':db[_0xe0ea('0xf')],'attributes':['id',_0xe0ea('0x19'),_0xe0ea('0xc')],'include':[{'model':db[_0xe0ea('0x3c')],'as':_0xe0ea('0xd')}]}]})[_0xe0ea('0x2a')](function(_0x462213){var _0x1d9526=_[_0xe0ea('0x3d')](manager[_0xe0ea('0x3e')]);var _0x1ab1f5=_[_0xe0ea('0x3f')](_0x462213,function(_0x27a23d){return _0x27a23d['id'][_0xe0ea('0x40')]();});var _0x5a2e5f=_[_0xe0ea('0x41')](_0x462213,function(_0x274fcb){return _0x274fcb['id']['toString']();});var _0x86255c=_0x59e3e6?_0x1ab1f5:_[_0xe0ea('0x42')](_0x1ab1f5,_0x1d9526);var _0x1ffea1=_[_0xe0ea('0x43')](_0x1ab1f5,_0x1d9526);var _0x55ede1=_[_0xe0ea('0x42')](_0x1d9526,_0x1ab1f5);var _0x51211f;var _0x2cb6b5;for(_0x51211f=0x0;_0x51211f<_0x55ede1[_0xe0ea('0x44')]&&!_0x59e3e6;_0x51211f+=0x1){_0x2cb6b5=_0x55ede1[_0x51211f][_0xe0ea('0x40')]();if(manager['exists'](_0x2cb6b5)){manager['stop'](_0x2cb6b5);manager['deleteJob'](_0x2cb6b5);logger[_0xe0ea('0xa')](_0xe0ea('0x45'),_0x2cb6b5);}}logger[_0xe0ea('0xa')](_0xe0ea('0x46'),JSON[_0xe0ea('0x24')](_0x86255c));for(_0x51211f=0x0;_0x51211f<_0x86255c[_0xe0ea('0x44')];_0x51211f+=0x1){_0x2cb6b5=_0x86255c[_0x51211f][_0xe0ea('0x40')]();logger[_0xe0ea('0xa')](_0xe0ea('0x47'),_0x2cb6b5);if(_0x59e3e6){logger[_0xe0ea('0xa')](_0xe0ea('0x48'),_0x59e3e6);logger[_0xe0ea('0xa')](JSON['stringify'](_0x5a2e5f[_0x2cb6b5]));BPromise[_0xe0ea('0x49')]()['then'](handleJob(_0x5a2e5f[_0x2cb6b5]));logger[_0xe0ea('0xa')](_0xe0ea('0x4a'),_0x5a2e5f[_0x2cb6b5][_0xe0ea('0x19')],_0x5a2e5f[_0x2cb6b5]['cron']);}else if(_0x5a2e5f[_0x2cb6b5][_0xe0ea('0x4b')]&&_0x5a2e5f[_0x2cb6b5]['active']&&moment()[_0xe0ea('0x4c')](_0x5a2e5f[_0x2cb6b5][_0xe0ea('0x4d')],_0x5a2e5f[_0x2cb6b5][_0xe0ea('0x4e')])){manager[_0xe0ea('0x4f')](_0x2cb6b5,_0x5a2e5f[_0x2cb6b5][_0xe0ea('0x4b')],handleJob(_0x5a2e5f[_0x2cb6b5]));manager[_0xe0ea('0x50')](_0x2cb6b5);logger[_0xe0ea('0xa')]('add\x20cron',_0x5a2e5f[_0x2cb6b5][_0xe0ea('0x19')],_0x5a2e5f[_0x2cb6b5][_0xe0ea('0x4b')]);}else if(manager[_0xe0ea('0x51')](_0x2cb6b5)){manager['stop'](_0x2cb6b5);manager[_0xe0ea('0x52')](_0x2cb6b5);logger[_0xe0ea('0xa')](_0xe0ea('0x53'),_0x5a2e5f[_0x2cb6b5]['name'],_0x5a2e5f[_0x2cb6b5][_0xe0ea('0x4b')]);}}for(_0x51211f=0x0,_0x2cb6b5;_0x51211f<_0x1ffea1[_0xe0ea('0x44')]&&!_0x59e3e6;_0x51211f+=0x1){_0x2cb6b5=_0x1ffea1[_0x51211f][_0xe0ea('0x40')]();if(manager[_0xe0ea('0x51')](_0x2cb6b5)){if(_0x5a2e5f[_0x2cb6b5][_0xe0ea('0x4b')]&&_0x5a2e5f[_0x2cb6b5][_0xe0ea('0x54')]&&moment()[_0xe0ea('0x4c')](_0x5a2e5f[_0x2cb6b5][_0xe0ea('0x4d')],_0x5a2e5f[_0x2cb6b5][_0xe0ea('0x4e')])){manager['update'](_0x2cb6b5,_0x5a2e5f[_0x2cb6b5][_0xe0ea('0x4b')],handleJob(_0x5a2e5f[_0x2cb6b5]));logger['info'](_0xe0ea('0x55'),_0x5a2e5f[_0x2cb6b5][_0xe0ea('0x19')],_0x5a2e5f[_0x2cb6b5][_0xe0ea('0x4b')]);}else{manager['stop'](_0x2cb6b5);manager[_0xe0ea('0x52')](_0x2cb6b5);logger[_0xe0ea('0xa')]('stop\x20cron',_0x5a2e5f[_0x2cb6b5][_0xe0ea('0x19')],_0x5a2e5f[_0x2cb6b5][_0xe0ea('0x4b')]);}}}})[_0xe0ea('0x2d')](function(_0x51ae2a){logger[_0xe0ea('0x2b')](JSON[_0xe0ea('0x24')](_0x51ae2a));});}exports[_0xe0ea('0x56')]=function(_0x22a6e7){return getJobs(_0x22a6e7);};exports[_0xe0ea('0x50')]=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 24ae27f..ab3230e 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 _0x0664=['transcribeRegion','forEach','all','error','start','aws-sdk','util','bluebird','../../config/logger','transcribe','TranscribeService','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data2','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','Transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','then','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','language','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','data1','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Negative','Mixed','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','bucket','findOne','Cloud\x20Provider\x20not\x20available','Positive','Neutral','catch','name','SequelizeValidationError','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId'];(function(_0x42cfc4,_0x3ea038){var _0x586a7a=function(_0x1f7583){while(--_0x1f7583){_0x42cfc4['push'](_0x42cfc4['shift']());}};_0x586a7a(++_0x3ea038);}(_0x0664,0x93));var _0x4066=function(_0x3646a6,_0x10205d){_0x3646a6=_0x3646a6-0x0;var _0x1bcebb=_0x0664[_0x3646a6];return _0x1bcebb;};var _=require('lodash');var AWS=require(_0x4066('0x0'));var rp=require('request-promise');var util=require(_0x4066('0x1'));var BPromise=require(_0x4066('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0x4066('0x3'))(_0x4066('0x4'));function getTranscriptionJob(_0x1479a6,_0x43d301,_0x362a79,_0x325e0e){return new Promise(function(_0x2febd3,_0x1e2bf0){var _0x143de5=new AWS[(_0x4066('0x5'))]({'accessKeyId':_0x43d301,'secretAccessKey':_0x1479a6,'region':_0x362a79});_0x143de5['getTranscriptionJob']({'TranscriptionJobName':_0x325e0e},function(_0x383df4,_0x5d360d){if(_0x383df4){return _0x1e2bf0(_0x383df4);}else{return _0x2febd3(_0x5d360d);}});});}function sentiment(_0x29a147,_0x2db4e6,_0x48333f,_0x5f3d44,_0x1da4d8){return new Promise(function(_0x3ea971,_0x16a1f7){var _0x41ad8b=new AWS['Comprehend']({'accessKeyId':_0x2db4e6,'secretAccessKey':_0x29a147,'region':_0x48333f});_0x41ad8b['detectSentiment']({'Text':_0x5f3d44,'LanguageCode':_0x1da4d8['substring'](0x0,0x2)},function(_0x4cbeb6,_0x2bac58){if(_0x4cbeb6){return _0x16a1f7(_0x4cbeb6);}else{return _0x3ea971(_0x2bac58);}});});}function checkTranscribeJob(_0x1b1712,_0x10c353,_0x12d36c){var _0x425456;return new BPromise(function(_0x3a0cf2,_0x38c65d){logger[_0x4066('0x6')](util['format'](_0x4066('0x7'),_0x1b1712['id'],_0x1b1712[_0x4066('0x8')]));return getTranscriptionJob(_0x12d36c['data1'],_0x12d36c[_0x4066('0x9')],_0x10c353['transcribeRegion'],_0x1b1712[_0x4066('0x8')])['then'](function(_0x50f71d){logger[_0x4066('0x6')](util[_0x4066('0xa')](_0x4066('0xb'),_0x1b1712['id'],_0x1b1712[_0x4066('0x8')],_0x50f71d[_0x4066('0xc')][_0x4066('0xd')]));if(!_0x1b1712[_0x4066('0xe')]){switch(_0x50f71d[_0x4066('0xc')][_0x4066('0xd')]){case _0x4066('0xf'):var _0x511cfa={'transcribeStatus':_0x50f71d['TranscriptionJob'][_0x4066('0xd')],'fileUri':_0x50f71d[_0x4066('0xc')]['Transcript'][_0x4066('0x10')]};logger[_0x4066('0x6')](util[_0x4066('0xa')](_0x4066('0x11'),_0x1b1712['id']));return rp({'uri':_0x50f71d[_0x4066('0xc')][_0x4066('0x12')]['TranscriptFileUri'],'json':!![]})['then'](function(_0x541306){logger['info'](util[_0x4066('0xa')](_0x4066('0x13'),_0x1b1712['id']));if(_0x541306&&_0x541306[_0x4066('0x14')]&&_0x541306[_0x4066('0x14')][_0x4066('0x15')]&&_0x541306['results'][_0x4066('0x15')][_0x4066('0x16')]){_0x511cfa[_0x4066('0xe')]='';for(var _0x2598c6=0x0;_0x2598c6<_0x541306[_0x4066('0x14')]['transcripts']['length'];_0x2598c6++){_0x511cfa[_0x4066('0xe')]+=_0x541306[_0x4066('0x14')][_0x4066('0x15')][_0x2598c6][_0x4066('0x17')]+'';}}return _0x1b1712[_0x4066('0x18')](_0x511cfa);})[_0x4066('0x19')](function(){logger[_0x4066('0x6')](util[_0x4066('0xa')](_0x4066('0x1a'),_0x1b1712['id']));if(!_0x1b1712[_0x4066('0x1b')]){throw new db[(_0x4066('0x1c'))][(_0x4066('0x1d'))](_0x4066('0x1e'));}if(!_0x10c353[_0x4066('0x1f')]||!_0x10c353[_0x4066('0x20')]||!_0x10c353['sentimentRegion']||!_0x10c353[_0x4066('0x21')]||!_0x10c353['bucket']){throw new db['Sequelize']['ValidationError'](_0x4066('0x22'));}if(!_0x511cfa['fileText']){throw new Error(_0x4066('0x23'));}if(_0x10c353[_0x4066('0x20')]===_0x12d36c['id']){return _0x12d36c;}else{return db[_0x4066('0x24')]['findOne']({'where':{'id':_settings[_0x4066('0x20')]}});}})['then'](function(_0x2468f0){if(!_0x2468f0){throw new db[(_0x4066('0x1c'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x2468f0[_0x4066('0x25')]||!_0x2468f0[_0x4066('0x9')]){throw new db['Sequelize'][(_0x4066('0x1d'))](_0x4066('0x26'));}_0x425456=_0x2468f0;logger[_0x4066('0x6')](util['format'](_0x4066('0x27'),_0x1b1712['id']));return sentiment(_0x425456['data1'],_0x425456[_0x4066('0x9')],_0x10c353[_0x4066('0x28')],_0x511cfa[_0x4066('0xe')],_0x10c353[_0x4066('0x21')]);})[_0x4066('0x19')](function(_0x255fd0){logger[_0x4066('0x6')](util[_0x4066('0xa')](_0x4066('0x29'),_0x1b1712['id']));return _0x1b1712[_0x4066('0x18')]({'sentiment':_0x255fd0[_0x4066('0x2a')],'sPositive':_0x255fd0[_0x4066('0x2b')]['Positive'],'sNegative':_0x255fd0[_0x4066('0x2b')][_0x4066('0x2c')],'sMixed':_0x255fd0['SentimentScore'][_0x4066('0x2d')],'sNeutral':_0x255fd0[_0x4066('0x2b')]['Neutral']});})[_0x4066('0x19')](function(){logger[_0x4066('0x6')](util[_0x4066('0xa')](_0x4066('0x1a'),_0x1b1712['id']));_0x3a0cf2();});case _0x4066('0x2e'):return _0x1b1712[_0x4066('0x18')]({'transcribeStatus':_0x4066('0x2e'),'failureReason':_0x50f71d[_0x4066('0xc')][_0x4066('0x2f')]})['then'](function(){logger[_0x4066('0x6')](util[_0x4066('0xa')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x1b1712['id']));_0x3a0cf2();});default:logger[_0x4066('0x6')](util[_0x4066('0xa')](_0x4066('0x30'),_0x1b1712['id']));break;}}else{return BPromise['resolve']()[_0x4066('0x19')](function(){if(!_0x1b1712[_0x4066('0x1b')]){throw new db[(_0x4066('0x1c'))][(_0x4066('0x1d'))](_0x4066('0x1e'));}if(!_0x10c353[_0x4066('0x1f')]||!_0x10c353[_0x4066('0x20')]||!_0x10c353['sentimentRegion']||!_0x10c353[_0x4066('0x21')]||!_0x10c353[_0x4066('0x31')]){throw new db[(_0x4066('0x1c'))][(_0x4066('0x1d'))](_0x4066('0x22'));}if(!_0x1b1712['fileText']){throw new Error(_0x4066('0x23'));}if(_0x10c353[_0x4066('0x20')]===_0x12d36c['id']){return _0x12d36c;}else{return db['CloudProvider'][_0x4066('0x32')]({'where':{'id':_settings[_0x4066('0x20')]}});}})[_0x4066('0x19')](function(_0x1c3abb){if(!_0x1c3abb){throw new db[(_0x4066('0x1c'))]['ValidationError'](_0x4066('0x33'));}if(!_0x1c3abb[_0x4066('0x25')]||!_0x1c3abb['data2']){throw new db[(_0x4066('0x1c'))][(_0x4066('0x1d'))](_0x4066('0x26'));}_0x425456=_0x1c3abb;logger[_0x4066('0x6')](util[_0x4066('0xa')](_0x4066('0x27'),_0x1b1712['id']));return sentiment(_0x425456[_0x4066('0x25')],_0x425456['data2'],_0x10c353[_0x4066('0x28')],_0x1b1712[_0x4066('0xe')],_0x10c353[_0x4066('0x21')]);})[_0x4066('0x19')](function(_0x1c99a8){logger[_0x4066('0x6')](util['format'](_0x4066('0x29'),_0x1b1712['id']));return _0x1b1712['update']({'sentiment':_0x1c99a8[_0x4066('0x2a')],'sPositive':_0x1c99a8['SentimentScore'][_0x4066('0x34')],'sNegative':_0x1c99a8[_0x4066('0x2b')][_0x4066('0x2c')],'sMixed':_0x1c99a8[_0x4066('0x2b')]['Mixed'],'sNeutral':_0x1c99a8[_0x4066('0x2b')][_0x4066('0x35')],'transcribeStatus':'COMPLETED'});})[_0x4066('0x19')](function(){logger['info'](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x1b1712['id']));_0x3a0cf2();});}})[_0x4066('0x36')](function(_0x3e7c11){if(_0x3e7c11){if(!_0x3e7c11[_0x4066('0x37')]||_0x3e7c11[_0x4066('0x37')]!==_0x4066('0x38')){logger['error'](util[_0x4066('0xa')](_0x4066('0x39'),_0x1b1712['id']),util[_0x4066('0x3a')](_0x3e7c11,{'showHidden':![],'depth':null}));}}_0x3a0cf2();});});}function checkTranscribe(){var _0x2dcad0;var _0x218d51;var _0x523396;return db[_0x4066('0x3b')][_0x4066('0x3c')]({'where':{'transcribeStatus':_0x4066('0x3d')}})[_0x4066('0x19')](function(_0x269ff0){if(!_0x269ff0||!_0x269ff0[_0x4066('0x16')]){throw new db[(_0x4066('0x1c'))]['ValidationError'](_0x4066('0x3e'));}_0x2dcad0=_0x269ff0;return db[_0x4066('0x3f')][_0x4066('0x32')]({'where':{'id':0x1}});})[_0x4066('0x19')](function(_0x3bfea2){if(!_0x3bfea2){throw new db['Sequelize'][(_0x4066('0x1d'))](_0x4066('0x40'));}_0x218d51=_0x3bfea2;if(!_0x218d51['transcribe']||!_0x218d51[_0x4066('0x41')]||!_0x218d51[_0x4066('0x42')]||!_0x218d51[_0x4066('0x21')]||!_0x218d51[_0x4066('0x31')]){throw new db[(_0x4066('0x1c'))][(_0x4066('0x1d'))]('Transcribe\x20not\x20configured');}return db[_0x4066('0x24')][_0x4066('0x32')]({'where':{'id':_0x218d51[_0x4066('0x41')]}});})['then'](function(_0xe0f43c){if(!_0xe0f43c){throw new db['Sequelize'][(_0x4066('0x1d'))](_0x4066('0x33'));}if(!_0xe0f43c['data1']||!_0xe0f43c['data2']){throw new db['Sequelize'][(_0x4066('0x1d'))](_0x4066('0x26'));}_0x523396=_0xe0f43c;var _0x1db0be=[];_0x2dcad0[_0x4066('0x43')](function(_0x4e677c){_0x1db0be['push'](checkTranscribeJob(_0x4e677c,_0x218d51,_0x523396));});return BPromise[_0x4066('0x44')](_0x1db0be);})[_0x4066('0x36')](function(_0x5886a1){if(_0x5886a1){if(!_0x5886a1['name']||_0x5886a1[_0x4066('0x37')]!=='SequelizeValidationError'){logger[_0x4066('0x45')](util['inspect'](_0x5886a1,{'showHidden':![],'depth':null}));}}});}exports[_0x4066('0x46')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0xefda=['push','catch','inspect','start','lodash','util','bluebird','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','length','transcripts','update','tempSentiment','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','language','Transcript\x20not\x20available','ValidationError','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','SentimentScore','Positive','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','bucket','Sentiment\x20Analysis\x20not\x20configured','findOne','Sentiment','Negative','name','SequelizeValidationError','error','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','CloudProvider','forEach'];(function(_0x15d59a,_0x4b13c2){var _0x575cd5=function(_0x5a6a3e){while(--_0x5a6a3e){_0x15d59a['push'](_0x15d59a['shift']());}};_0x575cd5(++_0x4b13c2);}(_0xefda,0x96));var _0xaefd=function(_0x15ca6b,_0x5c28b0){_0x15ca6b=_0x15ca6b-0x0;var _0x3fe560=_0xefda[_0x15ca6b];return _0x3fe560;};var _=require(_0xaefd('0x0'));var AWS=require('aws-sdk');var rp=require('request-promise');var util=require(_0xaefd('0x1'));var BPromise=require(_0xaefd('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0xaefd('0x3'))(_0xaefd('0x4'));function getTranscriptionJob(_0x2ade44,_0x22df24,_0x1ef6b4,_0x3288f9){return new Promise(function(_0x497258,_0x3677ea){var _0x3b9736=new AWS[(_0xaefd('0x5'))]({'accessKeyId':_0x22df24,'secretAccessKey':_0x2ade44,'region':_0x1ef6b4});_0x3b9736[_0xaefd('0x6')]({'TranscriptionJobName':_0x3288f9},function(_0x4ce248,_0x15193c){if(_0x4ce248){return _0x3677ea(_0x4ce248);}else{return _0x497258(_0x15193c);}});});}function sentiment(_0xbb04fb,_0x463ce7,_0x4d44ed,_0x48a255,_0x54a3b1){return new Promise(function(_0xa6239d,_0x16b36e){var _0x20135c=new AWS[(_0xaefd('0x7'))]({'accessKeyId':_0x463ce7,'secretAccessKey':_0xbb04fb,'region':_0x4d44ed});_0x20135c[_0xaefd('0x8')]({'Text':_0x48a255,'LanguageCode':_0x54a3b1[_0xaefd('0x9')](0x0,0x2)},function(_0x2ad4d9,_0x3dfddf){if(_0x2ad4d9){return _0x16b36e(_0x2ad4d9);}else{return _0xa6239d(_0x3dfddf);}});});}function checkTranscribeJob(_0x27be0f,_0x382983,_0x2a310c){var _0x4b2b5c;return new BPromise(function(_0x3172d3,_0x4ac467){logger[_0xaefd('0xa')](util[_0xaefd('0xb')](_0xaefd('0xc'),_0x27be0f['id'],_0x27be0f[_0xaefd('0xd')]));return getTranscriptionJob(_0x2a310c['data1'],_0x2a310c[_0xaefd('0xe')],_0x382983[_0xaefd('0xf')],_0x27be0f[_0xaefd('0xd')])[_0xaefd('0x10')](function(_0x10ee28){logger[_0xaefd('0xa')](util[_0xaefd('0xb')](_0xaefd('0x11'),_0x27be0f['id'],_0x27be0f['transcribeName'],_0x10ee28[_0xaefd('0x12')][_0xaefd('0x13')]));if(!_0x27be0f[_0xaefd('0x14')]){switch(_0x10ee28[_0xaefd('0x12')][_0xaefd('0x13')]){case _0xaefd('0x15'):var _0x516e84={'transcribeStatus':_0x10ee28[_0xaefd('0x12')][_0xaefd('0x13')],'fileUri':_0x10ee28[_0xaefd('0x12')][_0xaefd('0x16')][_0xaefd('0x17')]};logger[_0xaefd('0xa')](util['format'](_0xaefd('0x18'),_0x27be0f['id']));return rp({'uri':_0x10ee28[_0xaefd('0x12')][_0xaefd('0x16')][_0xaefd('0x17')],'json':!![]})[_0xaefd('0x10')](function(_0x577fb7){logger['info'](util['format'](_0xaefd('0x19'),_0x27be0f['id']));if(_0x577fb7&&_0x577fb7[_0xaefd('0x1a')]&&_0x577fb7[_0xaefd('0x1a')]['transcripts']&&_0x577fb7[_0xaefd('0x1a')]['transcripts'][_0xaefd('0x1b')]){_0x516e84[_0xaefd('0x14')]='';for(var _0x1a05eb=0x0;_0x1a05eb<_0x577fb7['results'][_0xaefd('0x1c')][_0xaefd('0x1b')];_0x1a05eb++){_0x516e84[_0xaefd('0x14')]+=_0x577fb7[_0xaefd('0x1a')][_0xaefd('0x1c')][_0x1a05eb]['transcript']+'';}}return _0x27be0f[_0xaefd('0x1d')](_0x516e84);})['then'](function(){logger[_0xaefd('0xa')](util[_0xaefd('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x27be0f['id']));if(!_0x27be0f[_0xaefd('0x1e')]){throw new db[(_0xaefd('0x1f'))]['ValidationError'](_0xaefd('0x20'));}if(!_0x382983[_0xaefd('0x21')]||!_0x382983[_0xaefd('0x22')]||!_0x382983['sentimentRegion']||!_0x382983[_0xaefd('0x23')]||!_0x382983['bucket']){throw new db[(_0xaefd('0x1f'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x516e84[_0xaefd('0x14')]){throw new Error(_0xaefd('0x24'));}if(_0x382983['sentimentAccountId']===_0x2a310c['id']){return _0x2a310c;}else{return db['CloudProvider']['findOne']({'where':{'id':_settings[_0xaefd('0x22')]}});}})[_0xaefd('0x10')](function(_0x4b6910){if(!_0x4b6910){throw new db['Sequelize'][(_0xaefd('0x25'))](_0xaefd('0x26'));}if(!_0x4b6910[_0xaefd('0x27')]||!_0x4b6910[_0xaefd('0xe')]){throw new db['Sequelize'][(_0xaefd('0x25'))](_0xaefd('0x28'));}_0x4b2b5c=_0x4b6910;logger[_0xaefd('0xa')](util[_0xaefd('0xb')](_0xaefd('0x29'),_0x27be0f['id']));return sentiment(_0x4b2b5c[_0xaefd('0x27')],_0x4b2b5c[_0xaefd('0xe')],_0x382983[_0xaefd('0x2a')],_0x516e84[_0xaefd('0x14')],_0x382983[_0xaefd('0x23')]);})[_0xaefd('0x10')](function(_0x195571){logger[_0xaefd('0xa')](util[_0xaefd('0xb')](_0xaefd('0x2b'),_0x27be0f['id']));return _0x27be0f[_0xaefd('0x1d')]({'sentiment':_0x195571['Sentiment'],'sPositive':_0x195571[_0xaefd('0x2c')][_0xaefd('0x2d')],'sNegative':_0x195571[_0xaefd('0x2c')]['Negative'],'sMixed':_0x195571[_0xaefd('0x2c')]['Mixed'],'sNeutral':_0x195571[_0xaefd('0x2c')][_0xaefd('0x2e')]});})[_0xaefd('0x10')](function(){logger[_0xaefd('0xa')](util[_0xaefd('0xb')](_0xaefd('0x2f'),_0x27be0f['id']));_0x3172d3();});case _0xaefd('0x30'):return _0x27be0f[_0xaefd('0x1d')]({'transcribeStatus':_0xaefd('0x30'),'failureReason':_0x10ee28[_0xaefd('0x12')][_0xaefd('0x31')]})[_0xaefd('0x10')](function(){logger[_0xaefd('0xa')](util[_0xaefd('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x27be0f['id']));_0x3172d3();});default:logger[_0xaefd('0xa')](util['format'](_0xaefd('0x32'),_0x27be0f['id']));break;}}else{return BPromise[_0xaefd('0x33')]()[_0xaefd('0x10')](function(){if(!_0x27be0f[_0xaefd('0x1e')]){throw new db[(_0xaefd('0x1f'))][(_0xaefd('0x25'))](_0xaefd('0x20'));}if(!_0x382983[_0xaefd('0x21')]||!_0x382983[_0xaefd('0x22')]||!_0x382983[_0xaefd('0x2a')]||!_0x382983['language']||!_0x382983[_0xaefd('0x34')]){throw new db[(_0xaefd('0x1f'))]['ValidationError'](_0xaefd('0x35'));}if(!_0x27be0f[_0xaefd('0x14')]){throw new Error(_0xaefd('0x24'));}if(_0x382983['sentimentAccountId']===_0x2a310c['id']){return _0x2a310c;}else{return db['CloudProvider'][_0xaefd('0x36')]({'where':{'id':_settings[_0xaefd('0x22')]}});}})[_0xaefd('0x10')](function(_0x179648){if(!_0x179648){throw new db[(_0xaefd('0x1f'))][(_0xaefd('0x25'))](_0xaefd('0x26'));}if(!_0x179648[_0xaefd('0x27')]||!_0x179648['data2']){throw new db[(_0xaefd('0x1f'))][(_0xaefd('0x25'))](_0xaefd('0x28'));}_0x4b2b5c=_0x179648;logger[_0xaefd('0xa')](util[_0xaefd('0xb')](_0xaefd('0x29'),_0x27be0f['id']));return sentiment(_0x4b2b5c[_0xaefd('0x27')],_0x4b2b5c[_0xaefd('0xe')],_0x382983['sentimentRegion'],_0x27be0f['fileText'],_0x382983[_0xaefd('0x23')]);})[_0xaefd('0x10')](function(_0x532328){logger['info'](util[_0xaefd('0xb')](_0xaefd('0x2b'),_0x27be0f['id']));return _0x27be0f[_0xaefd('0x1d')]({'sentiment':_0x532328[_0xaefd('0x37')],'sPositive':_0x532328[_0xaefd('0x2c')][_0xaefd('0x2d')],'sNegative':_0x532328[_0xaefd('0x2c')][_0xaefd('0x38')],'sMixed':_0x532328[_0xaefd('0x2c')]['Mixed'],'sNeutral':_0x532328[_0xaefd('0x2c')][_0xaefd('0x2e')],'transcribeStatus':_0xaefd('0x15')});})[_0xaefd('0x10')](function(){logger[_0xaefd('0xa')](util[_0xaefd('0xb')](_0xaefd('0x2f'),_0x27be0f['id']));_0x3172d3();});}})['catch'](function(_0x20716c){if(_0x20716c){if(!_0x20716c['name']||_0x20716c[_0xaefd('0x39')]!==_0xaefd('0x3a')){logger[_0xaefd('0x3b')](util[_0xaefd('0xb')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x27be0f['id']),util['inspect'](_0x20716c,{'showHidden':![],'depth':null}));}}_0x3172d3();});});}function checkTranscribe(){var _0x1a73c5;var _0x34839e;var _0x179b8b;return db['VoiceRecording'][_0xaefd('0x3c')]({'where':{'transcribeStatus':_0xaefd('0x3d')}})['then'](function(_0x3deacd){if(!_0x3deacd||!_0x3deacd[_0xaefd('0x1b')]){throw new db[(_0xaefd('0x1f'))][(_0xaefd('0x25'))](_0xaefd('0x3e'));}_0x1a73c5=_0x3deacd;return db[_0xaefd('0x3f')][_0xaefd('0x36')]({'where':{'id':0x1}});})[_0xaefd('0x10')](function(_0x4dc674){if(!_0x4dc674){throw new db['Sequelize'][(_0xaefd('0x25'))](_0xaefd('0x40'));}_0x34839e=_0x4dc674;if(!_0x34839e['transcribe']||!_0x34839e[_0xaefd('0x41')]||!_0x34839e['transcribeRegion']||!_0x34839e[_0xaefd('0x23')]||!_0x34839e[_0xaefd('0x34')]){throw new db[(_0xaefd('0x1f'))][(_0xaefd('0x25'))](_0xaefd('0x42'));}return db[_0xaefd('0x43')]['findOne']({'where':{'id':_0x34839e['transcribeAccountId']}});})[_0xaefd('0x10')](function(_0x338823){if(!_0x338823){throw new db['Sequelize'][(_0xaefd('0x25'))](_0xaefd('0x26'));}if(!_0x338823[_0xaefd('0x27')]||!_0x338823[_0xaefd('0xe')]){throw new db['Sequelize']['ValidationError'](_0xaefd('0x28'));}_0x179b8b=_0x338823;var _0x41ef40=[];_0x1a73c5[_0xaefd('0x44')](function(_0x1fe44a){_0x41ef40[_0xaefd('0x45')](checkTranscribeJob(_0x1fe44a,_0x34839e,_0x179b8b));});return BPromise['all'](_0x41ef40);})[_0xaefd('0x46')](function(_0x3b6290){if(_0x3b6290){if(!_0x3b6290['name']||_0x3b6290[_0xaefd('0x39')]!==_0xaefd('0x3a')){logger['error'](util[_0xaefd('0x47')](_0x3b6290,{'showHidden':![],'depth':null}));}}});}exports[_0xaefd('0x48')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index 31f6935..d7603e7 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 _0x86a1=['../logger','schedule','defaults','redis','WhatsappInteraction','lastMsgAt','subtract','hours','then','length','map','info','join','update','system','timeout','format','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb'];(function(_0x467488,_0x38c7ae){var _0x56107f=function(_0x4992b3){while(--_0x4992b3){_0x467488['push'](_0x467488['shift']());}};_0x56107f(++_0x38c7ae);}(_0x86a1,0x18d));var _0x186a=function(_0xbc4560,_0x4020b8){_0xbc4560=_0xbc4560-0x0;var _0x298cfb=_0x86a1[_0xbc4560];return _0x298cfb;};'use strict';var _=require(_0x186a('0x0'));var moment=require(_0x186a('0x1'));var Redis=require(_0x186a('0x2'));var util=require(_0x186a('0x3'));var config=require(_0x186a('0x4'));var db=require(_0x186a('0x5'))['db'];var logger=require(_0x186a('0x6'))(_0x186a('0x7'));config['redis']=_[_0x186a('0x8')](config[_0x186a('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x186a('0x9')]));function closeInteractions(){var _0x4299ac=[];return db[_0x186a('0xa')]['findAll']({'raw':!![],'attributes':['id',_0x186a('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x186a('0xc')](0x18,_0x186a('0xd'))}}})[_0x186a('0xe')](function(_0x8862b3){if(_0x8862b3&&_0x8862b3[_0x186a('0xf')]){_0x4299ac=_[_0x186a('0x10')](_0x8862b3||[],'id');logger[_0x186a('0x11')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x4299ac[_0x186a('0x12')]());return db[_0x186a('0xa')][_0x186a('0x13')]({'closeReason':_0x186a('0x14'),'disposition':_0x186a('0x15'),'closed':!![],'closedAt':moment()[_0x186a('0x16')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x4299ac}});}})[_0x186a('0xe')](function(){if(_0x4299ac&&_0x4299ac['length']){logger['info'](_0x186a('0x17'),_0x4299ac[_0x186a('0x12')]());for(var _0x4c6807=0x0;_0x4c6807<_0x4299ac[_0x186a('0xf')];_0x4c6807++){io[_0x186a('0x18')](_0x186a('0x19'),{'id':_0x4299ac[_0x4c6807],'closed':!![]});}}})[_0x186a('0x1a')](function(_0x159c70){logger[_0x186a('0x1b')](_0x186a('0x1c'),_0x159c70?util[_0x186a('0x1d')](_0x159c70,{'showHidden':![],'depth':null}):'');});}exports[_0x186a('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x1f38=['whatsappInteraction:update','start','lodash','moment','ioredis','../logger','localhost','socket.io-emitter','redis','findAll','subtract','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','emit'];(function(_0x499239,_0x49172c){var _0x55700d=function(_0x5cb73d){while(--_0x5cb73d){_0x499239['push'](_0x499239['shift']());}};_0x55700d(++_0x49172c);}(_0x1f38,0x116));var _0x81f3=function(_0x40bfc2,_0x538e26){_0x40bfc2=_0x40bfc2-0x0;var _0x14d1db=_0x1f38[_0x40bfc2];return _0x14d1db;};'use strict';var _=require(_0x81f3('0x0'));var moment=require(_0x81f3('0x1'));var Redis=require(_0x81f3('0x2'));var util=require('util');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require(_0x81f3('0x3'))('schedule');config['redis']=_['defaults'](config['redis'],{'host':_0x81f3('0x4'),'port':0x18eb});var io=require(_0x81f3('0x5'))(new Redis(config[_0x81f3('0x6')]));function closeInteractions(){var _0x542c32=[];return db['WhatsappInteraction'][_0x81f3('0x7')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x81f3('0x8')](0x18,'hours')}}})[_0x81f3('0x9')](function(_0x1f907e){if(_0x1f907e&&_0x1f907e[_0x81f3('0xa')]){_0x542c32=_[_0x81f3('0xb')](_0x1f907e||[],'id');logger[_0x81f3('0xc')](_0x81f3('0xd'),_0x542c32[_0x81f3('0xe')]());return db['WhatsappInteraction'][_0x81f3('0xf')]({'closeReason':_0x81f3('0x10'),'disposition':_0x81f3('0x11'),'closed':!![],'closedAt':moment()[_0x81f3('0x12')](_0x81f3('0x13'))},{'where':{'id':_0x542c32}});}})['then'](function(){if(_0x542c32&&_0x542c32[_0x81f3('0xa')]){logger[_0x81f3('0xc')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x542c32['join']());for(var _0x245234=0x0;_0x245234<_0x542c32['length'];_0x245234++){io[_0x81f3('0x14')](_0x81f3('0x15'),{'id':_0x542c32[_0x245234],'closed':!![]});}}})['catch'](function(_0x485807){logger['error']('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x485807?util['inspect'](_0x485807,{'showHidden':![],'depth':null}):'');});}exports[_0x81f3('0x16')]=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 82c4a72..d4c2643 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3ee5=['finished\x20populating','contacts1','destroy','log','hopper1','bulkCreate','CmHopper','hopper2','catch','../mysqldb','Biondo','@xcally.com','push','now','Innocenzo','CmContact','then'];(function(_0x3ae223,_0x4b787d){var _0x3935d9=function(_0x2eecf3){while(--_0x2eecf3){_0x3ae223['push'](_0x3ae223['shift']());}};_0x3935d9(++_0x4b787d);}(_0x3ee5,0xc4));var _0x53ee=function(_0x50da99,_0x25c8a1){_0x50da99=_0x50da99-0x0;var _0x8931ff=_0x3ee5[_0x50da99];return _0x8931ff;};'use strict';var util=require('util');var db=require(_0x53ee('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x53ee('0x1')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x53ee('0x2')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x53ee('0x3')]({'id':i,'active':![],'scheduledat':Date[_0x53ee('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x53ee('0x4')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x53ee('0x5')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x53ee('0x2')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x53ee('0x3')]({'id':i,'active':![],'scheduledat':Date[_0x53ee('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x53ee('0x4')]()});}db[_0x53ee('0x6')]['destroy']({'where':{}})['then'](function(){return db[_0x53ee('0x6')]['bulkCreate'](contacts);})[_0x53ee('0x7')](function(){console['log'](_0x53ee('0x8'),_0x53ee('0x9'));return db['CmHopper'][_0x53ee('0xa')]({'where':{}});})[_0x53ee('0x7')](function(){return db['CmHopper']['bulkCreate'](hopper);})[_0x53ee('0x7')](function(){console[_0x53ee('0xb')](_0x53ee('0x8'),_0x53ee('0xc'));return db[_0x53ee('0x6')][_0x53ee('0xd')](contacts2);})[_0x53ee('0x7')](function(){console['log'](_0x53ee('0x8'),'contacts2');return db[_0x53ee('0xe')][_0x53ee('0xd')](hopper2);})[_0x53ee('0x7')](function(){console[_0x53ee('0xb')](_0x53ee('0x8'),_0x53ee('0xf'));})[_0x53ee('0x10')](function(_0x58cfb5){console[_0x53ee('0xb')](_0x58cfb5);}); \ No newline at end of file +var _0x8fe5=['log','finished\x20populating','destroy','CmHopper','hopper1','contacts2','hopper2','catch','util','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','then','bulkCreate'];(function(_0x47da22,_0x5f48f1){var _0xbd7ef3=function(_0x119667){while(--_0x119667){_0x47da22['push'](_0x47da22['shift']());}};_0xbd7ef3(++_0x5f48f1);}(_0x8fe5,0x1ca));var _0x58fe=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x8fe5[_0xa464c9];return _0x3d73c4;};'use strict';var util=require(_0x58fe('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x58fe('0x1')]({'id':i,'firstName':_0x58fe('0x2')+i,'lastName':_0x58fe('0x3')+i,'phone':0xf879fb460+i,'email':_0x58fe('0x4')+i+_0x58fe('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x58fe('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x58fe('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x58fe('0x6')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x58fe('0x1')]({'id':i,'firstName':_0x58fe('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x58fe('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x58fe('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x58fe('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x58fe('0x6')](),'updatedAt':Date[_0x58fe('0x6')]()});}db[_0x58fe('0x7')]['destroy']({'where':{}})[_0x58fe('0x8')](function(){return db[_0x58fe('0x7')][_0x58fe('0x9')](contacts);})['then'](function(){console[_0x58fe('0xa')](_0x58fe('0xb'),'contacts1');return db['CmHopper'][_0x58fe('0xc')]({'where':{}});})[_0x58fe('0x8')](function(){return db[_0x58fe('0xd')][_0x58fe('0x9')](hopper);})[_0x58fe('0x8')](function(){console['log'](_0x58fe('0xb'),_0x58fe('0xe'));return db[_0x58fe('0x7')][_0x58fe('0x9')](contacts2);})[_0x58fe('0x8')](function(){console['log'](_0x58fe('0xb'),_0x58fe('0xf'));return db[_0x58fe('0xd')]['bulkCreate'](hopper2);})[_0x58fe('0x8')](function(){console[_0x58fe('0xa')](_0x58fe('0xb'),_0x58fe('0x10'));})[_0x58fe('0x11')](function(_0x197b4d){console[_0x58fe('0xa')](_0x197b4d);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 891ed58..12d1de1 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6e34=['udp','all','yes','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','bulkCreate','then','log','add\x20user','catch','util','../mysqldb','format','%s%s','agent','%s%s@xcally.com','password','friend'];(function(_0x57ca81,_0x554cb3){var _0x5e5ddb=function(_0x15ac19){while(--_0x15ac19){_0x57ca81['push'](_0x57ca81['shift']());}};_0x5e5ddb(++_0x554cb3);}(_0x6e34,0x1e6));var _0x46e3=function(_0x2b097b,_0xce66b7){_0x2b097b=_0x2b097b-0x0;var _0x392138=_0x6e34[_0x2b097b];return _0x392138;};'use strict';var util=require(_0x46e3('0x0'));var db=require(_0x46e3('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0x46e3('0x2')](_0x46e3('0x3'),_0x46e3('0x4'),i),'fullname':util[_0x46e3('0x2')](_0x46e3('0x3'),_0x46e3('0x4'),i),'email':util['format'](_0x46e3('0x5'),_0x46e3('0x4'),i),'role':_0x46e3('0x4'),'password':_0x46e3('0x6'),'internal':0xfa0+i,'type':_0x46e3('0x7'),'transport':[_0x46e3('0x8'),'ws','wss'],'disallow':[_0x46e3('0x9')],'allow':['ulaw'],'defaultuser':util['format'](_0x46e3('0x3'),'agent',i),'encryption':_0x46e3('0xa'),'avpf':'yes','force_avp':_0x46e3('0xa'),'icesupport':_0x46e3('0xa'),'dtlsenable':_0x46e3('0xa'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0x46e3('0xb'),'dtlssetup':_0x46e3('0xc'),'callerid':util[_0x46e3('0x2')](_0x46e3('0xd'),util[_0x46e3('0x2')]('%s%s',_0x46e3('0x4'),i),0xfa0+i)});}db['User'][_0x46e3('0xe')](users)[_0x46e3('0xf')](function(){console[_0x46e3('0x10')](_0x46e3('0x11'));})[_0x46e3('0x12')](function(_0x273546){console[_0x46e3('0x10')](_0x273546);}); \ No newline at end of file +var _0xe64d=['all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','catch','log','../mysqldb','%s%s','agent','format','%s%s@xcally.com','password','udp','wss'];(function(_0x136619,_0x31c9b2){var _0x38c4a5=function(_0x10b74d){while(--_0x10b74d){_0x136619['push'](_0x136619['shift']());}};_0x38c4a5(++_0x31c9b2);}(_0xe64d,0x1d8));var _0xde64=function(_0x4f32de,_0x5bd4a){_0x4f32de=_0x4f32de-0x0;var _0x149821=_0xe64d[_0x4f32de];return _0x149821;};'use strict';var util=require('util');var db=require(_0xde64('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util['format'](_0xde64('0x1'),_0xde64('0x2'),i),'fullname':util['format'](_0xde64('0x1'),_0xde64('0x2'),i),'email':util[_0xde64('0x3')](_0xde64('0x4'),'agent',i),'role':'agent','password':_0xde64('0x5'),'internal':0xfa0+i,'type':'friend','transport':[_0xde64('0x6'),'ws',_0xde64('0x7')],'disallow':[_0xde64('0x8')],'allow':[_0xde64('0x9')],'defaultuser':util[_0xde64('0x3')](_0xde64('0x1'),'agent',i),'encryption':'yes','avpf':_0xde64('0xa'),'force_avp':'yes','icesupport':'yes','dtlsenable':_0xde64('0xa'),'dtlsverify':'no','dtlscertfile':_0xde64('0xb'),'dtlsprivatekey':_0xde64('0xc'),'dtlssetup':_0xde64('0xd'),'callerid':util[_0xde64('0x3')](_0xde64('0xe'),util[_0xde64('0x3')](_0xde64('0x1'),'agent',i),0xfa0+i)});}db[_0xde64('0xf')][_0xde64('0x10')](users)[_0xde64('0x11')](function(){console['log']('add\x20user');})[_0xde64('0x12')](function(_0x46471f){console[_0xde64('0x13')](_0x46471f);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index feea314..d007236 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc137=['userProfileId','ChatQueue','Trunks','IvrCampaigns','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getWhatsappQueues','voice','chat','fax','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','map','ChatInteractions','removeChatInteractions','emit','user_has_chat_interactions:remove','MailInteractions','removeMailInteractions','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','removeWhatsappInteractions','catch','log','join','default','setMaxListeners','address','request','connection','remotePort','connectedAt','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','role','agent','telephone','ivr','UserProfileSection','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','UserProfileResource','resourceId','User','where','type','format','%s:queue:%s','Agents','length','user:%s','handshake','query','find','MailInteraction','FaxInteraction','FaxInteractions','SmsInteraction','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','Campaign','user'];(function(_0x14ea32,_0x262909){var _0x137bbb=function(_0x4a36ab){while(--_0x4a36ab){_0x14ea32['push'](_0x14ea32['shift']());}};_0x137bbb(++_0x262909);}(_0xc137,0xff));var _0x7c13=function(_0x1a64ff,_0x4277ba){_0x1a64ff=_0x1a64ff-0x0;var _0x4dc23b=_0xc137[_0x1a64ff];return _0x4dc23b;};'use strict';var _=require(_0x7c13('0x0'));var util=require(_0x7c13('0x1'));var BPromise=require(_0x7c13('0x2'));var db=require(_0x7c13('0x3'))['db'];var config=require(_0x7c13('0x4'));var queryQueues={'attributes':['id',_0x7c13('0x5')],'include':[{'as':'Agents','model':db['User'],'attributes':['id','name',_0x7c13('0x6')],'raw':!![],'where':{'role':_0x7c13('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x7c13('0x5')],'where':{'role':_0x7c13('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0x7c13('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0x7c13('0x5')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id','name','type'],'where':{'type':_0x7c13('0x9')}};function getAssociatedResources(_0x2c93d6,_0x489201,_0x9cb550){return db[_0x7c13('0xa')]['findOne']({'where':{'name':_0x2c93d6,'userProfileId':_0x489201},'raw':!![]})[_0x7c13('0xb')](function(_0x20501d){if(_0x20501d){if(_0x20501d[_0x7c13('0xc')]){switch(_0x2c93d6){case _0x7c13('0xd'):case _0x7c13('0xe'):case _0x7c13('0xf'):case _0x7c13('0x10'):case _0x7c13('0x11'):case _0x7c13('0x12'):case _0x7c13('0x13'):return db[_0x9cb550][_0x7c13('0x14')](queryQueues);case _0x7c13('0x15'):return db[_0x9cb550][_0x7c13('0x14')](queryTelephones);case'Trunks':return db[_0x9cb550][_0x7c13('0x14')](queryTrunks);case'IvrCampaigns':return db[_0x9cb550][_0x7c13('0x14')](queryCampaigns);}}else{return db[_0x7c13('0x16')][_0x7c13('0x14')]({'attributes':[_0x7c13('0x17')],'where':{'sectionId':_0x20501d['id']},'raw':!![]})[_0x7c13('0xb')](function(_0x3f9cf4){if(_0x3f9cf4){var _0x2b9855={'where':{'id':_['map'](_0x3f9cf4,_0x7c13('0x17'))},'raw':!![]};switch(_0x9cb550){case _0x7c13('0x18'):_0x2b9855['where'][_0x7c13('0x6')]=_0x7c13('0x8');break;case'Campaign':_0x2b9855[_0x7c13('0x19')][_0x7c13('0x1a')]=_0x7c13('0x9');break;}return db[_0x9cb550][_0x7c13('0x14')](_0x2b9855);}else{return[];}});}}else{return[];}})[_0x7c13('0xb')](function(_0x8a5383){return _0x8a5383;});}function joinOrLeaveQueues(_0x3a5c31,_0x46d80d,_0x39d21c,_0x5bd671){_0x3a5c31[_0x46d80d](util[_0x7c13('0x1b')](_0x7c13('0x1c'),_0x39d21c,_0x5bd671['name']));if(_0x5bd671['Agents']){for(var _0x2492e4=0x0;_0x2492e4<_0x5bd671[_0x7c13('0x1d')][_0x7c13('0x1e')];_0x2492e4+=0x1){_0x3a5c31[_0x46d80d](util['format'](_0x7c13('0x1f'),_0x5bd671[_0x7c13('0x1d')][_0x2492e4][_0x7c13('0x5')]));}}}function joinOrLeave(_0x12405c,_0x3a4753,_0xc5bc98){var _0x2cd2c1;if(_0x12405c[_0x7c13('0x20')][_0x7c13('0x21')]['id']){db[_0x7c13('0x18')][_0x7c13('0x22')]({'attributes':['id',_0x7c13('0x5'),_0x7c13('0x6'),'userProfileId'],'where':{'id':_0x12405c[_0x7c13('0x20')][_0x7c13('0x21')]['id']},'include':[{'model':db['ChatInteraction'],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x7c13('0x23')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x7c13('0x24')],'as':_0x7c13('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x7c13('0x26')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x7c13('0x27')],'as':_0x7c13('0x28'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0x7c13('0x29'),'attributes':['id'],'raw':!![]}]})[_0x7c13('0xb')](function(_0x2fe70e){if(_0x2fe70e){_0x2cd2c1=_0x2fe70e;_0x12405c[_0x3a4753](util[_0x7c13('0x1b')](_0x7c13('0x1f'),_0x2fe70e[_0x7c13('0x5')]));var _0x3e4da0=[];switch(_0x2fe70e[_0x7c13('0x6')]){case _0x7c13('0x2a'):_0x12405c[_0x3a4753](_0x7c13('0x2b'));_0x12405c[_0x3a4753](_0x7c13('0x2c'));if(queryQueues[_0x7c13('0x2d')]('include')){delete queryQueues[_0x7c13('0x2e')];}_0x3e4da0[_0x7c13('0x2f')](db[_0x7c13('0x30')][_0x7c13('0x14')](queryQueues));_0x3e4da0[_0x7c13('0x2f')](db['ChatQueue'][_0x7c13('0x14')](queryQueues));_0x3e4da0[_0x7c13('0x2f')](db[_0x7c13('0x31')][_0x7c13('0x14')](queryQueues));_0x3e4da0[_0x7c13('0x2f')](db[_0x7c13('0x32')][_0x7c13('0x14')](queryQueues));_0x3e4da0[_0x7c13('0x2f')](db[_0x7c13('0x33')][_0x7c13('0x14')](queryQueues));_0x3e4da0[_0x7c13('0x2f')](db[_0x7c13('0x34')][_0x7c13('0x14')](queryQueues));_0x3e4da0[_0x7c13('0x2f')](db[_0x7c13('0x35')][_0x7c13('0x14')](queryQueues));_0x3e4da0[_0x7c13('0x2f')](db[_0x7c13('0x18')][_0x7c13('0x14')](queryTelephones));_0x3e4da0['push'](db[_0x7c13('0x36')][_0x7c13('0x14')](queryTrunks));_0x3e4da0['push'](db[_0x7c13('0x37')][_0x7c13('0x14')](queryCampaigns));_0x3e4da0[_0x7c13('0x2f')](db['User']['findAll'](queryAgents));break;case _0x7c13('0x38'):_0x12405c[_0x3a4753](_0x7c13('0x2b'));_0x12405c[_0x3a4753]('voice:outbound');_0x3e4da0['push'](getAssociatedResources(_0x7c13('0xd'),_0x2fe70e[_0x7c13('0x39')],'VoiceQueue'));_0x3e4da0[_0x7c13('0x2f')](getAssociatedResources(_0x7c13('0xe'),_0x2fe70e[_0x7c13('0x39')],_0x7c13('0x3a')));_0x3e4da0[_0x7c13('0x2f')](getAssociatedResources(_0x7c13('0xf'),_0x2fe70e[_0x7c13('0x39')],_0x7c13('0x31')));_0x3e4da0[_0x7c13('0x2f')](getAssociatedResources(_0x7c13('0x10'),_0x2fe70e['userProfileId'],_0x7c13('0x32')));_0x3e4da0[_0x7c13('0x2f')](getAssociatedResources('MailQueues',_0x2fe70e[_0x7c13('0x39')],_0x7c13('0x33')));_0x3e4da0[_0x7c13('0x2f')](getAssociatedResources(_0x7c13('0x12'),_0x2fe70e[_0x7c13('0x39')],'OpenchannelQueue'));_0x3e4da0[_0x7c13('0x2f')](getAssociatedResources(_0x7c13('0x13'),_0x2fe70e[_0x7c13('0x39')],_0x7c13('0x35')));_0x3e4da0[_0x7c13('0x2f')](getAssociatedResources(_0x7c13('0x15'),_0x2fe70e['userProfileId'],_0x7c13('0x18')));_0x3e4da0[_0x7c13('0x2f')](getAssociatedResources(_0x7c13('0x3b'),_0x2fe70e[_0x7c13('0x39')],_0x7c13('0x36')));_0x3e4da0[_0x7c13('0x2f')](getAssociatedResources(_0x7c13('0x3c'),_0x2fe70e['userProfileId'],_0x7c13('0x37')));_0x3e4da0[_0x7c13('0x2f')](db[_0x7c13('0x18')][_0x7c13('0x14')](queryAgents));break;case'agent':_0x12405c[_0x3a4753](_0x7c13('0x2b'));_0x12405c[_0x3a4753](_0x7c13('0x2c'));_0x3e4da0[_0x7c13('0x2f')](_0x2fe70e[_0x7c13('0x3d')]({'attributes':['id',_0x7c13('0x5')]}));_0x3e4da0[_0x7c13('0x2f')](_0x2fe70e[_0x7c13('0x3e')]({'attributes':['id',_0x7c13('0x5')]}));_0x3e4da0[_0x7c13('0x2f')](_0x2fe70e[_0x7c13('0x3f')]({'attributes':['id',_0x7c13('0x5')]}));_0x3e4da0[_0x7c13('0x2f')](_0x2fe70e[_0x7c13('0x40')]({'attributes':['id','name']}));_0x3e4da0[_0x7c13('0x2f')](_0x2fe70e[_0x7c13('0x41')]({'attributes':['id',_0x7c13('0x5')]}));_0x3e4da0[_0x7c13('0x2f')](_0x2fe70e['getOpenchannelQueues']({'attributes':['id',_0x7c13('0x5')]}));_0x3e4da0[_0x7c13('0x2f')](_0x2fe70e[_0x7c13('0x42')]({'attributes':['id',_0x7c13('0x5')]}));break;}return BPromise['all'](_0x3e4da0);}})[_0x7c13('0xb')](function(_0x324077){if(_0x324077&&_0x324077['length']){for(var _0x22f37e=0x0;_0x22f37e<_0x324077[_0x7c13('0x1e')];_0x22f37e+=0x1){for(var _0x56b6a1=0x0;_0x56b6a1<_0x324077[_0x22f37e]['length'];_0x56b6a1+=0x1){switch(_0x22f37e){case 0x0:joinOrLeaveQueues(_0x12405c,_0x3a4753,_0x7c13('0x43'),_0x324077[_0x22f37e][_0x56b6a1]);break;case 0x1:joinOrLeaveQueues(_0x12405c,_0x3a4753,_0x7c13('0x44'),_0x324077[_0x22f37e][_0x56b6a1]);break;case 0x2:joinOrLeaveQueues(_0x12405c,_0x3a4753,_0x7c13('0x45'),_0x324077[_0x22f37e][_0x56b6a1]);break;case 0x3:joinOrLeaveQueues(_0x12405c,_0x3a4753,'sms',_0x324077[_0x22f37e][_0x56b6a1]);break;case 0x4:joinOrLeaveQueues(_0x12405c,_0x3a4753,_0x7c13('0x46'),_0x324077[_0x22f37e][_0x56b6a1]);break;case 0x5:joinOrLeaveQueues(_0x12405c,_0x3a4753,_0x7c13('0x47'),_0x324077[_0x22f37e][_0x56b6a1]);break;case 0x6:joinOrLeaveQueues(_0x12405c,_0x3a4753,_0x7c13('0x48'),_0x324077[_0x22f37e][_0x56b6a1]);break;case 0x7:if(_0x2cd2c1[_0x7c13('0x6')]!==_0x7c13('0x7'))_0x12405c[_0x3a4753](util[_0x7c13('0x1b')](_0x7c13('0x49'),_0x324077[_0x22f37e][_0x56b6a1][_0x7c13('0x5')]));break;case 0x8:if(_0x2cd2c1[_0x7c13('0x6')]!=='agent')_0x12405c[_0x3a4753](util[_0x7c13('0x1b')](_0x7c13('0x4a'),_0x324077[_0x22f37e][_0x56b6a1]['name']));break;case 0x9:if(_0x2cd2c1[_0x7c13('0x6')]!==_0x7c13('0x7'))_0x12405c[_0x3a4753](util[_0x7c13('0x1b')](_0x7c13('0x4b'),_0x324077[_0x22f37e][_0x56b6a1][_0x7c13('0x1a')],_0x324077[_0x22f37e][_0x56b6a1]['name']));break;case 0xa:_0x12405c[_0x3a4753](util[_0x7c13('0x1b')]('user:%s',_0x324077[_0x22f37e][_0x56b6a1][_0x7c13('0x5')]));break;}}}}})[_0x7c13('0xb')](function(){if(_0x3a4753===_0x7c13('0x4c')){var _0x2a5c1d=_[_0x7c13('0x4d')](_0x2cd2c1[_0x7c13('0x4e')],'id');return _0x2cd2c1[_0x7c13('0x4f')](_0x2a5c1d)[_0x7c13('0xb')](function(){for(var _0x1d565c=0x0;_0x1d565c<_0x2a5c1d[_0x7c13('0x1e')];_0x1d565c+=0x1){_0xc5bc98[_0x7c13('0x50')](_0x7c13('0x51'),{'ChatInteractionId':Number(_0x2a5c1d[_0x1d565c]),'UserId':Number(_0x2cd2c1['id'])});}});}})[_0x7c13('0xb')](function(){if(_0x3a4753===_0x7c13('0x4c')){var _0x139e45=_['map'](_0x2cd2c1[_0x7c13('0x52')],'id');return _0x2cd2c1[_0x7c13('0x53')](_0x139e45)['then'](function(){for(var _0x398d6a=0x0;_0x398d6a<_0x139e45[_0x7c13('0x1e')];_0x398d6a+=0x1){_0xc5bc98[_0x7c13('0x50')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x139e45[_0x398d6a]),'UserId':Number(_0x2cd2c1['id'])});}});}})[_0x7c13('0xb')](function(){if(_0x3a4753===_0x7c13('0x4c')){var _0x50d8da=_[_0x7c13('0x4d')](_0x2cd2c1[_0x7c13('0x25')],'id');return _0x2cd2c1['removeFaxInteractions'](_0x50d8da)[_0x7c13('0xb')](function(){for(var _0x4562ba=0x0;_0x4562ba<_0x50d8da[_0x7c13('0x1e')];_0x4562ba+=0x1){_0xc5bc98[_0x7c13('0x50')](_0x7c13('0x54'),{'FaxInteractionId':Number(_0x50d8da[_0x4562ba]),'UserId':Number(_0x2cd2c1['id'])});}});}})[_0x7c13('0xb')](function(){if(_0x3a4753===_0x7c13('0x4c')){var _0x4320e0=_['map'](_0x2cd2c1[_0x7c13('0x55')],'id');return _0x2cd2c1[_0x7c13('0x56')](_0x4320e0)['then'](function(){for(var _0x10c939=0x0;_0x10c939<_0x4320e0[_0x7c13('0x1e')];_0x10c939+=0x1){_0xc5bc98[_0x7c13('0x50')](_0x7c13('0x57'),{'SmsInteractionId':Number(_0x4320e0[_0x10c939]),'UserId':Number(_0x2cd2c1['id'])});}});}})[_0x7c13('0xb')](function(){if(_0x3a4753===_0x7c13('0x4c')){var _0x45044f=_[_0x7c13('0x4d')](_0x2cd2c1[_0x7c13('0x28')],'id');return _0x2cd2c1['removeOpenchannelInteractions'](_0x45044f)['then'](function(){for(var _0x4a2ff7=0x0;_0x4a2ff7<_0x45044f['length'];_0x4a2ff7+=0x1){_0xc5bc98['emit'](_0x7c13('0x58'),{'OpenchannelInteractionId':Number(_0x45044f[_0x4a2ff7]),'UserId':Number(_0x2cd2c1['id'])});}});}})[_0x7c13('0xb')](function(){if(_0x3a4753===_0x7c13('0x4c')){var _0x98dcbf=_[_0x7c13('0x4d')](_0x2cd2c1[_0x7c13('0x29')],'id');return _0x2cd2c1[_0x7c13('0x59')](_0x98dcbf)[_0x7c13('0xb')](function(){for(var _0x5e63f9=0x0;_0x5e63f9<_0x98dcbf[_0x7c13('0x1e')];_0x5e63f9+=0x1){_0xc5bc98[_0x7c13('0x50')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x98dcbf[_0x5e63f9]),'UserId':Number(_0x2cd2c1['id'])});}});}})[_0x7c13('0x5a')](function(_0x1149a1){_0x12405c[_0x7c13('0x5b')](_0x1149a1);});}}function onDisconnect(_0x6948ea,_0x47837a){joinOrLeave(_0x6948ea,_0x7c13('0x4c'),_0x47837a);}function onConnect(_0x4c419d){joinOrLeave(_0x4c419d,_0x7c13('0x5c'));}exports[_0x7c13('0x5d')]=function(_0x54feff){_0x54feff['on']('connection',function(_0x2b2b5c){_0x2b2b5c[_0x7c13('0x5e')](0x0);_0x2b2b5c[_0x7c13('0x5f')]=_0x2b2b5c[_0x7c13('0x60')][_0x7c13('0x61')]['remoteAddress']+':'+_0x2b2b5c[_0x7c13('0x60')]['connection'][_0x7c13('0x62')];_0x2b2b5c[_0x7c13('0x63')]=new Date();_0x2b2b5c[_0x7c13('0x5b')]=function(_0x49b9c8){console[_0x7c13('0x5b')]('SocketIO\x20'+_0x2b2b5c[_0x7c13('0x64')]['name']+'['+_0x2b2b5c[_0x7c13('0x5f')]+']',_0x49b9c8);};_0x2b2b5c['on'](_0x7c13('0x65'),function(){onDisconnect(_0x2b2b5c,_0x54feff);_0x2b2b5c[_0x7c13('0x5b')](_0x7c13('0x66'));});onConnect(_0x2b2b5c);_0x2b2b5c['log'](_0x7c13('0x67'));});}; \ No newline at end of file +var _0x07fa=['UserProfileResource','resourceId','map','where','format','%s:queue:%s','Agents','user:%s','handshake','query','find','role','userProfileId','ChatInteraction','MailInteractions','FaxInteraction','SmsInteraction','SmsInteractions','OpenchannelInteraction','WhatsappInteraction','WhatsappInteractions','admin','hasOwnProperty','include','push','ChatQueue','FaxQueue','OpenchannelQueue','WhatsappQueue','Trunk','Campaign','user','VoiceQueue','SmsQueue','MailQueues','voice:inbound','voice:outbound','getVoiceQueues','getFaxQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','length','chat','fax','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','type','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','FaxInteractions','removeFaxInteractions','removeSmsInteractions','OpenchannelInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','catch','connection','setMaxListeners','request','remotePort','connectedAt','log','SocketIO\x20','address','disconnect','DISCONNECTED','CONNECTED','util','bluebird','../mysqldb','./environment','name','User','telephone','agent','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','Telephones','findAll','Trunks','IvrCampaigns'];(function(_0x3efaa6,_0x1316e7){var _0x3ee01a=function(_0x41aa95){while(--_0x41aa95){_0x3efaa6['push'](_0x3efaa6['shift']());}};_0x3ee01a(++_0x1316e7);}(_0x07fa,0x177));var _0xa07f=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x07fa[_0x49b207];return _0x2dc8fa;};'use strict';var _=require('lodash');var util=require(_0xa07f('0x0'));var BPromise=require(_0xa07f('0x1'));var db=require(_0xa07f('0x2'))['db'];var config=require(_0xa07f('0x3'));var queryQueues={'attributes':['id',_0xa07f('0x4')],'include':[{'as':'Agents','model':db[_0xa07f('0x5')],'attributes':['id',_0xa07f('0x4'),'role'],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0xa07f('0x6')}};var queryTrunks={'raw':!![],'attributes':['id',_0xa07f('0x4')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0xa07f('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id','name','type'],'where':{'type':'ivr'}};function getAssociatedResources(_0x5cac85,_0x3edd48,_0x288476){return db['UserProfileSection'][_0xa07f('0x8')]({'where':{'name':_0x5cac85,'userProfileId':_0x3edd48},'raw':!![]})[_0xa07f('0x9')](function(_0x151dda){if(_0x151dda){if(_0x151dda[_0xa07f('0xa')]){switch(_0x5cac85){case _0xa07f('0xb'):case _0xa07f('0xc'):case _0xa07f('0xd'):case _0xa07f('0xe'):case'MailQueues':case _0xa07f('0xf'):case _0xa07f('0x10'):return db[_0x288476]['findAll'](queryQueues);case _0xa07f('0x11'):return db[_0x288476][_0xa07f('0x12')](queryTelephones);case _0xa07f('0x13'):return db[_0x288476]['findAll'](queryTrunks);case _0xa07f('0x14'):return db[_0x288476]['findAll'](queryCampaigns);}}else{return db[_0xa07f('0x15')][_0xa07f('0x12')]({'attributes':[_0xa07f('0x16')],'where':{'sectionId':_0x151dda['id']},'raw':!![]})[_0xa07f('0x9')](function(_0x5c45b8){if(_0x5c45b8){var _0x29cf60={'where':{'id':_[_0xa07f('0x17')](_0x5c45b8,_0xa07f('0x16'))},'raw':!![]};switch(_0x288476){case _0xa07f('0x5'):_0x29cf60[_0xa07f('0x18')]['role']=_0xa07f('0x6');break;case'Campaign':_0x29cf60['where']['type']='ivr';break;}return db[_0x288476]['findAll'](_0x29cf60);}else{return[];}});}}else{return[];}})['then'](function(_0x1d254a){return _0x1d254a;});}function joinOrLeaveQueues(_0x2cb01f,_0x1cc489,_0x3a5307,_0xe78a66){_0x2cb01f[_0x1cc489](util[_0xa07f('0x19')](_0xa07f('0x1a'),_0x3a5307,_0xe78a66['name']));if(_0xe78a66[_0xa07f('0x1b')]){for(var _0x5155df=0x0;_0x5155df<_0xe78a66[_0xa07f('0x1b')]['length'];_0x5155df+=0x1){_0x2cb01f[_0x1cc489](util['format'](_0xa07f('0x1c'),_0xe78a66[_0xa07f('0x1b')][_0x5155df][_0xa07f('0x4')]));}}}function joinOrLeave(_0x321c85,_0x4d6b10,_0x464a7e){var _0x4322fe;if(_0x321c85[_0xa07f('0x1d')][_0xa07f('0x1e')]['id']){db[_0xa07f('0x5')][_0xa07f('0x1f')]({'attributes':['id','name',_0xa07f('0x20'),_0xa07f('0x21')],'where':{'id':_0x321c85[_0xa07f('0x1d')][_0xa07f('0x1e')]['id']},'include':[{'model':db[_0xa07f('0x22')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0xa07f('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0xa07f('0x24')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xa07f('0x25')],'as':_0xa07f('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0xa07f('0x27')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xa07f('0x28')],'as':_0xa07f('0x29'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x52892e){if(_0x52892e){_0x4322fe=_0x52892e;_0x321c85[_0x4d6b10](util[_0xa07f('0x19')](_0xa07f('0x1c'),_0x52892e[_0xa07f('0x4')]));var _0x4841ba=[];switch(_0x52892e[_0xa07f('0x20')]){case _0xa07f('0x2a'):_0x321c85[_0x4d6b10]('voice:inbound');_0x321c85[_0x4d6b10]('voice:outbound');if(queryQueues[_0xa07f('0x2b')]('include')){delete queryQueues[_0xa07f('0x2c')];}_0x4841ba[_0xa07f('0x2d')](db['VoiceQueue'][_0xa07f('0x12')](queryQueues));_0x4841ba[_0xa07f('0x2d')](db[_0xa07f('0x2e')]['findAll'](queryQueues));_0x4841ba[_0xa07f('0x2d')](db[_0xa07f('0x2f')][_0xa07f('0x12')](queryQueues));_0x4841ba[_0xa07f('0x2d')](db['SmsQueue'][_0xa07f('0x12')](queryQueues));_0x4841ba['push'](db['MailQueue'][_0xa07f('0x12')](queryQueues));_0x4841ba[_0xa07f('0x2d')](db[_0xa07f('0x30')]['findAll'](queryQueues));_0x4841ba['push'](db[_0xa07f('0x31')][_0xa07f('0x12')](queryQueues));_0x4841ba[_0xa07f('0x2d')](db[_0xa07f('0x5')][_0xa07f('0x12')](queryTelephones));_0x4841ba[_0xa07f('0x2d')](db[_0xa07f('0x32')]['findAll'](queryTrunks));_0x4841ba[_0xa07f('0x2d')](db[_0xa07f('0x33')][_0xa07f('0x12')](queryCampaigns));_0x4841ba[_0xa07f('0x2d')](db['User']['findAll'](queryAgents));break;case _0xa07f('0x34'):_0x321c85[_0x4d6b10]('voice:inbound');_0x321c85[_0x4d6b10]('voice:outbound');_0x4841ba[_0xa07f('0x2d')](getAssociatedResources(_0xa07f('0xb'),_0x52892e['userProfileId'],_0xa07f('0x35')));_0x4841ba['push'](getAssociatedResources(_0xa07f('0xc'),_0x52892e[_0xa07f('0x21')],_0xa07f('0x2e')));_0x4841ba[_0xa07f('0x2d')](getAssociatedResources(_0xa07f('0xd'),_0x52892e['userProfileId'],'FaxQueue'));_0x4841ba[_0xa07f('0x2d')](getAssociatedResources(_0xa07f('0xe'),_0x52892e[_0xa07f('0x21')],_0xa07f('0x36')));_0x4841ba[_0xa07f('0x2d')](getAssociatedResources(_0xa07f('0x37'),_0x52892e[_0xa07f('0x21')],'MailQueue'));_0x4841ba[_0xa07f('0x2d')](getAssociatedResources(_0xa07f('0xf'),_0x52892e['userProfileId'],_0xa07f('0x30')));_0x4841ba[_0xa07f('0x2d')](getAssociatedResources('WhatsappQueues',_0x52892e[_0xa07f('0x21')],_0xa07f('0x31')));_0x4841ba['push'](getAssociatedResources(_0xa07f('0x11'),_0x52892e['userProfileId'],_0xa07f('0x5')));_0x4841ba[_0xa07f('0x2d')](getAssociatedResources(_0xa07f('0x13'),_0x52892e[_0xa07f('0x21')],_0xa07f('0x32')));_0x4841ba[_0xa07f('0x2d')](getAssociatedResources('IvrCampaigns',_0x52892e['userProfileId'],_0xa07f('0x33')));_0x4841ba['push'](db[_0xa07f('0x5')]['findAll'](queryAgents));break;case'agent':_0x321c85[_0x4d6b10](_0xa07f('0x38'));_0x321c85[_0x4d6b10](_0xa07f('0x39'));_0x4841ba[_0xa07f('0x2d')](_0x52892e[_0xa07f('0x3a')]({'attributes':['id',_0xa07f('0x4')]}));_0x4841ba[_0xa07f('0x2d')](_0x52892e['getChatQueues']({'attributes':['id',_0xa07f('0x4')]}));_0x4841ba[_0xa07f('0x2d')](_0x52892e[_0xa07f('0x3b')]({'attributes':['id',_0xa07f('0x4')]}));_0x4841ba[_0xa07f('0x2d')](_0x52892e['getSmsQueues']({'attributes':['id','name']}));_0x4841ba[_0xa07f('0x2d')](_0x52892e[_0xa07f('0x3c')]({'attributes':['id',_0xa07f('0x4')]}));_0x4841ba[_0xa07f('0x2d')](_0x52892e[_0xa07f('0x3d')]({'attributes':['id',_0xa07f('0x4')]}));_0x4841ba['push'](_0x52892e[_0xa07f('0x3e')]({'attributes':['id',_0xa07f('0x4')]}));break;}return BPromise[_0xa07f('0x3f')](_0x4841ba);}})['then'](function(_0x1df46b){if(_0x1df46b&&_0x1df46b[_0xa07f('0x40')]){for(var _0x2ea368=0x0;_0x2ea368<_0x1df46b[_0xa07f('0x40')];_0x2ea368+=0x1){for(var _0xf6008a=0x0;_0xf6008a<_0x1df46b[_0x2ea368]['length'];_0xf6008a+=0x1){switch(_0x2ea368){case 0x0:joinOrLeaveQueues(_0x321c85,_0x4d6b10,'voice',_0x1df46b[_0x2ea368][_0xf6008a]);break;case 0x1:joinOrLeaveQueues(_0x321c85,_0x4d6b10,_0xa07f('0x41'),_0x1df46b[_0x2ea368][_0xf6008a]);break;case 0x2:joinOrLeaveQueues(_0x321c85,_0x4d6b10,_0xa07f('0x42'),_0x1df46b[_0x2ea368][_0xf6008a]);break;case 0x3:joinOrLeaveQueues(_0x321c85,_0x4d6b10,_0xa07f('0x43'),_0x1df46b[_0x2ea368][_0xf6008a]);break;case 0x4:joinOrLeaveQueues(_0x321c85,_0x4d6b10,_0xa07f('0x44'),_0x1df46b[_0x2ea368][_0xf6008a]);break;case 0x5:joinOrLeaveQueues(_0x321c85,_0x4d6b10,_0xa07f('0x45'),_0x1df46b[_0x2ea368][_0xf6008a]);break;case 0x6:joinOrLeaveQueues(_0x321c85,_0x4d6b10,_0xa07f('0x46'),_0x1df46b[_0x2ea368][_0xf6008a]);break;case 0x7:if(_0x4322fe[_0xa07f('0x20')]!==_0xa07f('0x7'))_0x321c85[_0x4d6b10](util[_0xa07f('0x19')](_0xa07f('0x47'),_0x1df46b[_0x2ea368][_0xf6008a][_0xa07f('0x4')]));break;case 0x8:if(_0x4322fe[_0xa07f('0x20')]!==_0xa07f('0x7'))_0x321c85[_0x4d6b10](util[_0xa07f('0x19')](_0xa07f('0x48'),_0x1df46b[_0x2ea368][_0xf6008a]['name']));break;case 0x9:if(_0x4322fe[_0xa07f('0x20')]!==_0xa07f('0x7'))_0x321c85[_0x4d6b10](util[_0xa07f('0x19')](_0xa07f('0x49'),_0x1df46b[_0x2ea368][_0xf6008a][_0xa07f('0x4a')],_0x1df46b[_0x2ea368][_0xf6008a]['name']));break;case 0xa:_0x321c85[_0x4d6b10](util[_0xa07f('0x19')]('user:%s',_0x1df46b[_0x2ea368][_0xf6008a][_0xa07f('0x4')]));break;}}}}})[_0xa07f('0x9')](function(){if(_0x4d6b10===_0xa07f('0x4b')){var _0x21b225=_[_0xa07f('0x17')](_0x4322fe['ChatInteractions'],'id');return _0x4322fe[_0xa07f('0x4c')](_0x21b225)[_0xa07f('0x9')](function(){for(var _0x1cb16d=0x0;_0x1cb16d<_0x21b225[_0xa07f('0x40')];_0x1cb16d+=0x1){_0x464a7e[_0xa07f('0x4d')](_0xa07f('0x4e'),{'ChatInteractionId':Number(_0x21b225[_0x1cb16d]),'UserId':Number(_0x4322fe['id'])});}});}})[_0xa07f('0x9')](function(){if(_0x4d6b10===_0xa07f('0x4b')){var _0x491235=_[_0xa07f('0x17')](_0x4322fe['MailInteractions'],'id');return _0x4322fe[_0xa07f('0x4f')](_0x491235)[_0xa07f('0x9')](function(){for(var _0x3b22cd=0x0;_0x3b22cd<_0x491235['length'];_0x3b22cd+=0x1){_0x464a7e[_0xa07f('0x4d')](_0xa07f('0x50'),{'MailInteractionId':Number(_0x491235[_0x3b22cd]),'UserId':Number(_0x4322fe['id'])});}});}})['then'](function(){if(_0x4d6b10==='leave'){var _0x25b7d9=_[_0xa07f('0x17')](_0x4322fe[_0xa07f('0x51')],'id');return _0x4322fe[_0xa07f('0x52')](_0x25b7d9)[_0xa07f('0x9')](function(){for(var _0x194b54=0x0;_0x194b54<_0x25b7d9[_0xa07f('0x40')];_0x194b54+=0x1){_0x464a7e[_0xa07f('0x4d')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x25b7d9[_0x194b54]),'UserId':Number(_0x4322fe['id'])});}});}})[_0xa07f('0x9')](function(){if(_0x4d6b10===_0xa07f('0x4b')){var _0x944be5=_[_0xa07f('0x17')](_0x4322fe[_0xa07f('0x26')],'id');return _0x4322fe[_0xa07f('0x53')](_0x944be5)['then'](function(){for(var _0xd03bd2=0x0;_0xd03bd2<_0x944be5[_0xa07f('0x40')];_0xd03bd2+=0x1){_0x464a7e['emit']('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x944be5[_0xd03bd2]),'UserId':Number(_0x4322fe['id'])});}});}})['then'](function(){if(_0x4d6b10==='leave'){var _0x14c931=_[_0xa07f('0x17')](_0x4322fe[_0xa07f('0x54')],'id');return _0x4322fe[_0xa07f('0x55')](_0x14c931)['then'](function(){for(var _0x5e7221=0x0;_0x5e7221<_0x14c931[_0xa07f('0x40')];_0x5e7221+=0x1){_0x464a7e['emit']('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x14c931[_0x5e7221]),'UserId':Number(_0x4322fe['id'])});}});}})[_0xa07f('0x9')](function(){if(_0x4d6b10===_0xa07f('0x4b')){var _0x37dee6=_[_0xa07f('0x17')](_0x4322fe[_0xa07f('0x29')],'id');return _0x4322fe[_0xa07f('0x56')](_0x37dee6)[_0xa07f('0x9')](function(){for(var _0x11ffde=0x0;_0x11ffde<_0x37dee6['length'];_0x11ffde+=0x1){_0x464a7e[_0xa07f('0x4d')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x37dee6[_0x11ffde]),'UserId':Number(_0x4322fe['id'])});}});}})[_0xa07f('0x57')](function(_0x543598){_0x321c85['log'](_0x543598);});}}function onDisconnect(_0x44d3eb,_0x3f18d3){joinOrLeave(_0x44d3eb,_0xa07f('0x4b'),_0x3f18d3);}function onConnect(_0x38d084){joinOrLeave(_0x38d084,'join');}exports['default']=function(_0x47c6a8){_0x47c6a8['on'](_0xa07f('0x58'),function(_0x47c463){_0x47c463[_0xa07f('0x59')](0x0);_0x47c463['address']=_0x47c463[_0xa07f('0x5a')][_0xa07f('0x58')]['remoteAddress']+':'+_0x47c463['request']['connection'][_0xa07f('0x5b')];_0x47c463[_0xa07f('0x5c')]=new Date();_0x47c463[_0xa07f('0x5d')]=function(_0x54ac4e){console['log'](_0xa07f('0x5e')+_0x47c463['nsp'][_0xa07f('0x4')]+'['+_0x47c463[_0xa07f('0x5f')]+']',_0x54ac4e);};_0x47c463['on'](_0xa07f('0x60'),function(){onDisconnect(_0x47c463,_0x47c6a8);_0x47c463[_0xa07f('0x5d')](_0xa07f('0x61'));});onConnect(_0x47c463);_0x47c463[_0xa07f('0x5d')](_0xa07f('0x62'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index b1b5666..6217cd5 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 _0x12c7=['query','Sequelize','QueryTypes','SELECT','UserId','User','find','fullname','email','internal','interface','format','SIP/%s','name','agent','incomingmessage','event','opened','changed','closed','contact','default','length','hasOwnProperty','model','callback','toLowerCase','condition','jayson/promise','../logger','triggers','lodash','client','http','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','closedinteraction','newmessage','Sms','SmsInteraction','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','MailInteraction','Mail','Openchannel','OpenchannelInteraction','request','EventManager','then','info','Trigger,\x20%s','error','code','catch','get','channel','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0x12c7,0xe2));var _0x712c=function(_0x13a89c,_0x38f4dd){_0x13a89c=_0x13a89c-0x0;var _0x1378e6=_0x12c7[_0x13a89c];return _0x1378e6;};'use strict';var util=require('util');var db=require('../../mysqldb')['db'];var jayson=require(_0x712c('0x0'));var logger=require(_0x712c('0x1'))(_0x712c('0x2'));var _=require(_0x712c('0x3'));var client=jayson[_0x712c('0x4')][_0x712c('0x5')]({'port':0x232a});var triggers=[{'channel':_0x712c('0x6'),'model':_0x712c('0x7'),'event':_0x712c('0x8'),'condition':_0x712c('0x9'),'callback':afterCreate},{'channel':_0x712c('0x6'),'model':_0x712c('0x7'),'event':_0x712c('0xa'),'condition':_0x712c('0xb'),'callback':afterUpdate},{'channel':_0x712c('0x6'),'model':'ChatMessage','event':_0x712c('0x8'),'condition':_0x712c('0xc'),'callback':afterCreateMessage},{'channel':_0x712c('0xd'),'model':_0x712c('0xe'),'event':_0x712c('0x8'),'condition':'newinteraction','callback':afterCreate},{'channel':'Sms','model':_0x712c('0xe'),'event':_0x712c('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Sms','model':_0x712c('0xf'),'event':_0x712c('0x8'),'condition':_0x712c('0xc'),'callback':afterCreateMessage},{'channel':'Whatsapp','model':'WhatsappInteraction','event':_0x712c('0x8'),'condition':_0x712c('0x9'),'callback':afterCreate},{'channel':_0x712c('0x10'),'model':_0x712c('0x11'),'event':'afterUpdate','condition':_0x712c('0xb'),'callback':afterUpdate},{'channel':_0x712c('0x10'),'model':_0x712c('0x12'),'event':_0x712c('0x8'),'condition':_0x712c('0xc'),'callback':afterCreateMessage},{'channel':_0x712c('0x13'),'model':_0x712c('0x14'),'event':'afterCreate','condition':_0x712c('0x9'),'callback':afterCreate},{'channel':_0x712c('0x13'),'model':_0x712c('0x14'),'event':'afterUpdate','condition':_0x712c('0xb'),'callback':afterUpdate},{'channel':_0x712c('0x13'),'model':'FaxMessage','event':_0x712c('0x8'),'condition':_0x712c('0xc'),'callback':afterCreateMessage},{'channel':'Mail','model':_0x712c('0x15'),'event':_0x712c('0x8'),'condition':_0x712c('0x9'),'callback':afterCreate},{'channel':_0x712c('0x16'),'model':_0x712c('0x15'),'event':_0x712c('0xa'),'condition':_0x712c('0xb'),'callback':afterUpdate},{'channel':_0x712c('0x16'),'model':'MailMessage','event':_0x712c('0x8'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x712c('0x17'),'model':_0x712c('0x18'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0x712c('0x17'),'model':'OpenchannelInteraction','event':_0x712c('0xa'),'condition':_0x712c('0xb'),'callback':afterUpdate},{'channel':'Openchannel','model':'OpenchannelMessage','event':'afterCreate','condition':'newmessage','callback':afterCreateMessage}];function request(_0x21f97c){return client[_0x712c('0x19')](_0x712c('0x1a'),_0x21f97c)[_0x712c('0x1b')](function(_0x1e9280){logger[_0x712c('0x1c')](_0x712c('0x1d'),'EventManager',_0x1e9280);if(_0x1e9280['error']){if(_0x1e9280[_0x712c('0x1e')][_0x712c('0x1f')]===0x1f4){logger[_0x712c('0x1e')](_0x712c('0x1d'),_0x712c('0x1a'),_0x1e9280['error']);}}})[_0x712c('0x20')](function(_0x3f732f){logger['error']('Trigger,\x20%s','EventManager',_0x3f732f);});}function afterCreateMessage(_0x19d6ea,_0x5a2257){return function(_0x48c819,_0x3a7493){_0x48c819=_0x48c819[_0x712c('0x21')]({'plain':!![]});_0x48c819[_0x712c('0x22')]=_0x19d6ea;_0x48c819['event']=_0x48c819['direction'];var _0x1d66e5=_0x712c('0x23')+_0x48c819[_0x712c('0x24')];return db[_0x712c('0x25')][_0x712c('0x26')](_0x1d66e5,{'type':db[_0x712c('0x27')][_0x712c('0x28')][_0x712c('0x29')],'raw':!![]})[_0x712c('0x1b')](function(_0x31bc4d){return _0x31bc4d;})['then'](function(_0x421722){if(_0x421722){_0x48c819['contact']=_0x421722[0x0];}if(_0x48c819[_0x712c('0x2a')]){return db[_0x712c('0x2b')][_0x712c('0x2c')]({'where':{'id':_0x48c819[_0x712c('0x2a')]},'attributes':['id','name',_0x712c('0x2d'),_0x712c('0x2e'),_0x712c('0x2f')],'raw':!![]})[_0x712c('0x1b')](function(_0x1bc4fc){_0x48c819[_0x712c('0x30')]=util[_0x712c('0x31')](_0x712c('0x32'),_0x1bc4fc[_0x712c('0x33')]);_0x48c819['channel']=_0x19d6ea;_0x48c819[_0x712c('0x34')]=_0x1bc4fc;return request({'event':_0x712c('0x35'),'message':_0x48c819});})['catch'](function(_0xe20a8a){console['error'](_0xe20a8a);});}else{return request({'event':'outgoingmessage','message':_0x48c819});}});};}function afterCreate(_0x2dd24e,_0x3d79e9){return function(_0xaf7699,_0x49f46a){_0xaf7699=_0xaf7699['get']({'plain':!![]});_0xaf7699[_0x712c('0x22')]=_0x2dd24e;_0xaf7699[_0x712c('0x36')]=_0x712c('0x37');var _0x17ee14=_0x712c('0x23')+_0xaf7699[_0x712c('0x24')];return db[_0x712c('0x25')][_0x712c('0x26')](_0x17ee14,{'type':db['Sequelize'][_0x712c('0x28')][_0x712c('0x29')],'raw':!![]})[_0x712c('0x1b')](function(_0x51b884){return _0x51b884;})[_0x712c('0x1b')](function(_0x477b0c){if(_0x477b0c){_0xaf7699['contact']=_0x477b0c[0x0];}return request({'event':_0x3d79e9,'message':_0xaf7699});});};}function afterUpdate(_0x194f07,_0x4c566e){return function(_0x16e6dd,_0x45b722){if(_0x16e6dd[_0x712c('0x38')](_0x712c('0x39'))&&_0x16e6dd['closed']){_0x16e6dd=_0x16e6dd[_0x712c('0x21')]({'plain':!![]});_0x16e6dd[_0x712c('0x22')]=_0x194f07;_0x16e6dd[_0x712c('0x36')]=_0x712c('0x39');var _0x29f85f=_0x712c('0x23')+_0x16e6dd[_0x712c('0x24')];return db[_0x712c('0x25')][_0x712c('0x26')](_0x29f85f,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x712c('0x1b')](function(_0x3c90fb){return _0x3c90fb;})[_0x712c('0x1b')](function(_0x1214f8){if(_0x1214f8){_0x16e6dd[_0x712c('0x3a')]=_0x1214f8[0x0];}if(_0x16e6dd[_0x712c('0x2a')]){return db['User']['find']({'where':{'id':_0x16e6dd[_0x712c('0x2a')]},'attributes':['id',_0x712c('0x33'),_0x712c('0x2d'),'email','internal'],'raw':!![]})['then'](function(_0x17d5c2){_0x16e6dd[_0x712c('0x30')]=util['format'](_0x712c('0x32'),_0x17d5c2['name']);_0x16e6dd[_0x712c('0x34')]=_0x17d5c2;return request({'event':_0x4c566e,'message':_0x16e6dd});})['catch'](function(_0x4a334f){console[_0x712c('0x1e')](_0x4a334f);});}else{return request({'event':_0x4c566e,'message':_0x16e6dd});}});}};}exports[_0x712c('0x3b')]=function(){for(var _0x444d6f=0x0;_0x444d6f=_0x41aa34[_0xfc58('0x13')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x546b57(_0x1341ee);})['catch'](function(_0x1a4bc2){_0x30ee7b(_0x1a4bc2);});});}; \ No newline at end of file +var _0x63eb=['lodash','bluebird','../mysqldb','./license/util','voice','mail','chat','fax','openchannel','isValidChannel','toLowerCase','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','agent','User','count','then','agents','Maximum\x20login\x20has\x20been\x20reached'];(function(_0x299b49,_0x1968d8){var _0x83d99f=function(_0x430d92){while(--_0x430d92){_0x299b49['push'](_0x299b49['shift']());}};_0x83d99f(++_0x1968d8);}(_0x63eb,0x11e));var _0xb63e=function(_0x170890,_0x23cf14){_0x170890=_0x170890-0x0;var _0x446cbd=_0x63eb[_0x170890];return _0x446cbd;};'use strict';var _=require(_0xb63e('0x0'));var BPromise=require(_0xb63e('0x1'));var db=require(_0xb63e('0x2'))['db'];var util=require(_0xb63e('0x3'));var channels=[_0xb63e('0x4'),_0xb63e('0x5'),_0xb63e('0x6'),_0xb63e('0x7'),'sms','whatsapp',_0xb63e('0x8')];exports['getChannels']=function(){return channels;};exports[_0xb63e('0x9')]=function(_0x43cc59){_0x43cc59=_0x43cc59[_0xb63e('0xa')]();return _[_0xb63e('0xb')](channels,_0x43cc59);};exports[_0xb63e('0xc')]=function(_0x37d2cb,_0x17746d,_0xdc7b24,_0x1c7c5d){var _0x1f2925={'loginAttempts':_0x17746d,'blocked':_0xdc7b24};if(!_[_0xb63e('0xd')](_0x1c7c5d)){_0x1f2925[_0xb63e('0xe')]=_0x1c7c5d;}return _0x37d2cb[_0xb63e('0xf')](_0x1f2925);};exports['getLicense']=function(_0x6779b1){return new BPromise(function(_0x4fe615,_0x39b480){var _0x2f2171=0x0;if(_0x6779b1['role']!==_0xb63e('0x10')){_0x4fe615(_0x6779b1);}db[_0xb63e('0x11')][_0xb63e('0x12')]({'where':{'role':_0xb63e('0x10'),'online':!![],'id':{'$ne':_0x6779b1['id']}}})[_0xb63e('0x13')](function(_0x24bb13){_0x2f2171=_0x24bb13;return util['getLicense']();})[_0xb63e('0x13')](function(_0x426a6b){if(_0x426a6b&&_0x426a6b['agents']&&_0x2f2171>=_0x426a6b[_0xb63e('0x14')]){throw Error(_0xb63e('0x15'));}_0x4fe615(_0x6779b1);})['catch'](function(_0x535817){_0x39b480(_0x535817);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 113c0a5..3132f9e 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x04a3=['render','json','send','exports','404','status'];(function(_0x2574c7,_0x3a90e7){var _0xa8354e=function(_0x29fe6c){while(--_0x29fe6c){_0x2574c7['push'](_0x2574c7['shift']());}};_0xa8354e(++_0x3a90e7);}(_0x04a3,0x12f));var _0x304a=function(_0x5d33a9,_0x1d72e9){_0x5d33a9=_0x5d33a9-0x0;var _0x59ec9d=_0x04a3[_0x5d33a9];return _0x59ec9d;};'use strict';module[_0x304a('0x0')][0x194]=function pageNotFound(_0x18b164,_0x434e73){var _0x1b3187=_0x304a('0x1');var _0x211c24=0x194;var _0x3d3bd5={'status':_0x211c24};_0x434e73[_0x304a('0x2')](_0x3d3bd5['status']);_0x434e73[_0x304a('0x3')](_0x1b3187,{},function(_0x1fb4dc,_0x4c4497){if(_0x1fb4dc){return _0x434e73[_0x304a('0x2')](_0x3d3bd5[_0x304a('0x2')])[_0x304a('0x4')](_0x3d3bd5);}_0x434e73[_0x304a('0x5')](_0x4c4497);});}; \ No newline at end of file +var _0x1ece=['404','status','json','exports'];(function(_0x2064b0,_0x5117a5){var _0x208205=function(_0x425de8){while(--_0x425de8){_0x2064b0['push'](_0x2064b0['shift']());}};_0x208205(++_0x5117a5);}(_0x1ece,0x13f));var _0xe1ec=function(_0x3cca0a,_0x574808){_0x3cca0a=_0x3cca0a-0x0;var _0x5236e9=_0x1ece[_0x3cca0a];return _0x5236e9;};'use strict';module[_0xe1ec('0x0')][0x194]=function pageNotFound(_0x530817,_0xc34ef1){var _0x5b6b38=_0xe1ec('0x1');var _0x47d834=0x194;var _0x103635={'status':_0x47d834};_0xc34ef1['status'](_0x103635[_0xe1ec('0x2')]);_0xc34ef1['render'](_0x5b6b38,{},function(_0xdd321,_0x3fe67e){if(_0xdd321){return _0xc34ef1[_0xe1ec('0x2')](_0x103635[_0xe1ec('0x2')])[_0xe1ec('0x3')](_0x103635);}_0xc34ef1['send'](_0x3fe67e);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index b46e6d4..3a15983 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5354=['ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','ReportAgentPreview','CmCustomField','Action','../api/automation/automation.model','CannedAnswer','Disposition','../api/disposition/disposition.model','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','Schedule','Sound','../api/tag/tag.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','AnalyticExtractedReport','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','ServicenowField','../api/intDynamics365Account/intDynamics365Account.model','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','../api/setting/setting.model','SquareOdbc','SquareProject','../api/squareProject/squareProject.model','SquareRecording','SquareMessage','../api/squareMessage/squareMessage.model','License','../api/license/license.model','../api/campaign/campaign.model','../api/migration/migration.model','Attachment','Plugin','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','UserNotification','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','Realtime','../api/realtime/realtime.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','hasOne','VoiceMail','cascade','UserId','Recordings','hasMany','HopperFinals','HopperHistory','SmsInteractions','MailInteractions','WhatsappInteractions','SenderId','belongsToMany','Groups','chat_group_has_users','cm_user_has_contacts','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','ChatInteractions','user_has_chat_interactions','FaxInteractions','user_has_fax_interactions','OpenchannelInteractions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','MailQueues','ChatQueues','FaxQueues','UserSmsQueue','OpenchannelQueues','WhatsappQueues','CmList','user_has_voice_prefixes','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_openchannel_accounts','SmsAccount','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperHistories','HopperBlacks','JscriptySessions','belongsTo','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','voice_queues_has_cm_blacklists','VoiceMailMessage','mailboxuser','mailbox','QueueCalls','uniqueid','AgentReports','Contact','ContactId','MailAccountId','Imap','Smtp','Messages','Interactions','MailApplication','Applications','List','ListId','Template','TemplateId','user_has_mail_accounts','Teams','MailInteractionId','Account','Owner','mail_interaction_has_tags','Tags','Tag','ThroughTags','Users','Interaction','ChatWebsiteId','ChatOfflineMessageId','restrict','TagId','FaxAccountId','Exntensions','FaxMessage','FaxInteractionId','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','Dispositions','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','user_has_sms_interactions','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','Answers','OpenchannelMessage','OpenchannelInteractionId','openchannel_interaction_has_tags','ProactiveActions','ChatApplication','OpenchannelQueueReport','Agent','Queue','Website','ChatInteractionId','chat_interaction_has_tags','Attachments','team_has_chat_queues','ChatGroupId','Contacts','CompanyId','Phones','CmCompany','Company','cm_contact_has_tags','AdditionalPhones','CmHopperId','Campaign','CampaignId','Automation','OneAll','AutomationAllId','Condition','Any','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','Extensions','MailApplications','ChatApplications','SmsApplications','DefaultReportId','CustomReportId','whatsapp_interaction_has_tags','ContactItemType','ItemType','ItemTypeId','Hopper','AllConditions','AnyConditions','TriggerAnyId','TriggerId','Fields','MetricId','Configurations','AccountId','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','Field','VariableId','DeskConfiguration','DeskField','int_desk_configuration_has_tags','Subjects','ZendeskField','int_zendesk_configuration_has_tags','FreshdeskConfiguration','FreshdeskField','Dynamics365Configuration','Dynamics365Account','ToId','SessionId','ProjectId','JscriptyProject','team_has_mail_queues','SmsQueues','team_has_openchannel_queues','team_has_whatsapp_queues','SquareProjectId','Lists','campaigns_has_cm_lists','BlackLists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToAccount','ChatTransferReport','FromChatWebsiteId','ToChatQueueId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToQueue','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','userProfileId','UserProfileSection','UserProfileSections','Resources','sectionId','WhatsappAccount','WhatsappAccountId','WhatsappApplication','WhatsappInteractionId','WhatsappTransferReport','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','exports','path','../config/environment','sequelize','lodash','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','sequelizeHistory','defaultsDeep','database','options','username','password','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','VoiceExtension','../api/voiceExtension/voiceExtension.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','../api/mailSubstatus/mailSubstatus.model','MailInteraction','MailMessage','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','../api/faxMessage/faxMessage.model','FaxQueue','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','ChatWebsite','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatApplication/chatApplication.model','ChatInteraction','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model'];(function(_0x5cd7a3,_0x1aa14f){var _0x21235d=function(_0x3152a9){while(--_0x3152a9){_0x5cd7a3['push'](_0x5cd7a3['shift']());}};_0x21235d(++_0x1aa14f);}(_0x5354,0x18b));var _0x4535=function(_0x15db6d,_0x41dbfb){_0x15db6d=_0x15db6d-0x0;var _0x1c90eb=_0x5354[_0x15db6d];return _0x1c90eb;};'use strict';var path=require(_0x4535('0x0'));var config=require(_0x4535('0x1'));var Sequelize=require(_0x4535('0x2'));var _=require(_0x4535('0x3'));var jstz=require('jstz');var timezone=jstz['determine']();config['sequelize']=_['defaultsDeep'](config[_0x4535('0x2')],{'database':_0x4535('0x4'),'username':_0x4535('0x5'),'password':_0x4535('0x6'),'options':{'host':_0x4535('0x7'),'port':0xcea,'dialect':_0x4535('0x8'),'dialectOptions':{'charset':_0x4535('0x9')},'logging':![],'timezone':timezone[_0x4535('0xa')](),'define':{'charset':_0x4535('0xb'),'collate':'utf8_general_ci'}}});config[_0x4535('0xc')]=_[_0x4535('0xd')](config[_0x4535('0xc')],{'database':_0x4535('0x4'),'username':_0x4535('0x5'),'password':_0x4535('0x6'),'options':{'host':_0x4535('0x7'),'port':0xcea,'dialect':_0x4535('0x8'),'dialectOptions':{'charset':_0x4535('0x9')},'logging':![],'timezone':timezone[_0x4535('0xa')](),'define':{'charset':_0x4535('0xb'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0x4535('0xe')],config[_0x4535('0x2')]['username'],config['sequelize']['password'],config['sequelize'][_0x4535('0xf')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x4535('0xc')][_0x4535('0xe')],config[_0x4535('0xc')][_0x4535('0x10')],config[_0x4535('0xc')][_0x4535('0x11')],config[_0x4535('0xc')]['options'])};db[_0x4535('0x12')]=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0x14'));db[_0x4535('0x15')]=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0x16'));db[_0x4535('0x17')]=db[_0x4535('0x2')][_0x4535('0x13')]('../api/voiceContext/voiceContext.model');db[_0x4535('0x18')]=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0x19'));db['VoiceMusicOnHold']=db['sequelize']['import'](_0x4535('0x1a'));db[_0x4535('0x1b')]=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0x1c'));db[_0x4535('0x1d')]=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0x1e'));db[_0x4535('0x1f')]=db['sequelize'][_0x4535('0x13')](_0x4535('0x20'));db['VoiceMail']=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0x21'));db['VoiceMailMessage']=db[_0x4535('0x2')][_0x4535('0x13')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0x4535('0x22')]=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0x23'));db['VoiceDialReport']=db[_0x4535('0x2')]['import'](_0x4535('0x24'));db[_0x4535('0x25')]=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0x26'));db[_0x4535('0x27')]=db['sequelize'][_0x4535('0x13')](_0x4535('0x28'));db[_0x4535('0x29')]=db[_0x4535('0x2')][_0x4535('0x13')]('../api/memberReport/memberReport.model');db[_0x4535('0x2a')]=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0x2b'));db[_0x4535('0x2c')]=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0x2d'));db[_0x4535('0x2e')]=db['sequelize'][_0x4535('0x13')](_0x4535('0x2f'));db[_0x4535('0x30')]=db[_0x4535('0x2')][_0x4535('0x13')]('../api/userVoiceQueue/userVoiceQueue.model');db[_0x4535('0x31')]=db['sequelize'][_0x4535('0x13')](_0x4535('0x32'));db[_0x4535('0x33')]=db[_0x4535('0x2')]['import'](_0x4535('0x34'));db[_0x4535('0x35')]=db[_0x4535('0x2')]['import']('../api/userFaxQueue/userFaxQueue.model');db['UserSmsQueue']=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0x36'));db[_0x4535('0x37')]=db[_0x4535('0x2')]['import']('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0x4535('0x38')]=db['sequelize'][_0x4535('0x13')](_0x4535('0x39'));db[_0x4535('0x3a')]=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0x3b'));db[_0x4535('0x3c')]=db['sequelize'][_0x4535('0x13')]('../api/mailServerOut/mailServerOut.model');db[_0x4535('0x3d')]=db['sequelize'][_0x4535('0x13')](_0x4535('0x3e'));db[_0x4535('0x3f')]=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0x40'));db['MailSubstatus']=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0x41'));db[_0x4535('0x42')]=db[_0x4535('0x2')][_0x4535('0x13')]('../api/mailInteraction/mailInteraction.model');db[_0x4535('0x43')]=db[_0x4535('0x2')][_0x4535('0x13')]('../api/mailMessage/mailMessage.model');db['MailApplication']=db[_0x4535('0x2')]['import'](_0x4535('0x44'));db[_0x4535('0x45')]=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0x46'));db[_0x4535('0x47')]=db[_0x4535('0x2')]['import'](_0x4535('0x48'));db[_0x4535('0x49')]=db['sequelize'][_0x4535('0x13')](_0x4535('0x4a'));db[_0x4535('0x4b')]=db['sequelize'][_0x4535('0x13')](_0x4535('0x4c'));db[_0x4535('0x4d')]=db['sequelize'][_0x4535('0x13')](_0x4535('0x4e'));db[_0x4535('0x4f')]=db['sequelize'][_0x4535('0x13')](_0x4535('0x50'));db['FaxMessage']=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0x51'));db[_0x4535('0x52')]=db[_0x4535('0x2')][_0x4535('0x13')]('../api/faxQueue/faxQueue.model');db[_0x4535('0x53')]=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0x54'));db['SmsAccount']=db[_0x4535('0x2')]['import'](_0x4535('0x55'));db[_0x4535('0x56')]=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0x57'));db[_0x4535('0x58')]=db['sequelize']['import']('../api/smsInteraction/smsInteraction.model');db[_0x4535('0x59')]=db['sequelize'][_0x4535('0x13')](_0x4535('0x5a'));db[_0x4535('0x5b')]=db[_0x4535('0x2')]['import'](_0x4535('0x5c'));db[_0x4535('0x5d')]=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0x5e'));db[_0x4535('0x5f')]=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0x60'));db[_0x4535('0x61')]=db[_0x4535('0x2')]['import'](_0x4535('0x62'));db['OpenchannelMessage']=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0x63'));db[_0x4535('0x64')]=db[_0x4535('0x2')][_0x4535('0x13')]('../api/openchannelQueue/openchannelQueue.model');db[_0x4535('0x65')]=db['sequelize'][_0x4535('0x13')]('../api/chatWebsite/chatWebsite.model');db['OpenchannelQueueReport']=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0x66'));db['ChatApplication']=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0x67'));db[_0x4535('0x68')]=db[_0x4535('0x2')][_0x4535('0x13')]('../api/chatInteraction/chatInteraction.model');db[_0x4535('0x69')]=db['sequelize'][_0x4535('0x13')](_0x4535('0x6a'));db[_0x4535('0x6b')]=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0x6c'));db[_0x4535('0x6d')]=db['sequelize'][_0x4535('0x13')](_0x4535('0x6e'));db[_0x4535('0x6f')]=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0x70'));db[_0x4535('0x71')]=db[_0x4535('0x2')]['import'](_0x4535('0x72'));db['CmCompany']=db['sequelize']['import'](_0x4535('0x73'));db[_0x4535('0x74')]=db['sequelize'][_0x4535('0x13')](_0x4535('0x75'));db[_0x4535('0x76')]=db['sequelize'][_0x4535('0x13')](_0x4535('0x77'));db[_0x4535('0x78')]=db[_0x4535('0x2')]['import'](_0x4535('0x79'));db[_0x4535('0x7a')]=db[_0x4535('0x2')]['import'](_0x4535('0x7b'));db[_0x4535('0x7c')]=db['sequelize'][_0x4535('0x13')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x4535('0x7d')]=db['sequelize']['import']('../api/reportAgentPreview/reportAgentPreview.model');db[_0x4535('0x7e')]=db['sequelize'][_0x4535('0x13')]('../api/cmCustomField/cmCustomField.model');db[_0x4535('0x7f')]=db['sequelize'][_0x4535('0x13')]('../api/action/action.model');db['Automation']=db[_0x4535('0x2')]['import'](_0x4535('0x80'));db[_0x4535('0x81')]=db[_0x4535('0x2')]['import']('../api/cannedAnswer/cannedAnswer.model');db[_0x4535('0x82')]=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0x83'));db['Condition']=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0x84'));db[_0x4535('0x85')]=db['sequelize']['import'](_0x4535('0x86'));db[_0x4535('0x87')]=db['sequelize'][_0x4535('0x13')](_0x4535('0x88'));db[_0x4535('0x89')]=db[_0x4535('0x2')]['import'](_0x4535('0x8a'));db[_0x4535('0x8b')]=db['sequelize']['import']('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0x4535('0x8c')]=db[_0x4535('0x2')][_0x4535('0x13')]('../api/schedule/schedule.model');db[_0x4535('0x8d')]=db[_0x4535('0x2')][_0x4535('0x13')]('../api/sound/sound.model');db['Tag']=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0x8e'));db['ContactItemType']=db[_0x4535('0x2')]['import']('../api/contactItemType/contactItemType.model');db[_0x4535('0x8f')]=db['sequelize']['import'](_0x4535('0x90'));db[_0x4535('0x91')]=db[_0x4535('0x2')]['import'](_0x4535('0x92'));db['Template']=db[_0x4535('0x2')][_0x4535('0x13')]('../api/template/template.model');db[_0x4535('0x93')]=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0x94'));db[_0x4535('0x95')]=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0x96'));db[_0x4535('0x97')]=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0x98'));db[_0x4535('0x99')]=db['sequelize'][_0x4535('0x13')](_0x4535('0x9a'));db[_0x4535('0x9b')]=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0x9c'));db[_0x4535('0x9d')]=db['sequelize'][_0x4535('0x13')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0x4535('0x9e')]=db[_0x4535('0x2')][_0x4535('0x13')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0x4535('0x9f')]=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0xa0'));db[_0x4535('0xa1')]=db['sequelize'][_0x4535('0x13')](_0x4535('0xa2'));db[_0x4535('0xa3')]=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0xa4'));db[_0x4535('0xa5')]=db['sequelize'][_0x4535('0x13')](_0x4535('0xa6'));db[_0x4535('0xa7')]=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0xa8'));db[_0x4535('0xa9')]=db[_0x4535('0x2')]['import'](_0x4535('0xaa'));db[_0x4535('0xab')]=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0xac'));db[_0x4535('0xad')]=db['sequelize'][_0x4535('0x13')](_0x4535('0xae'));db[_0x4535('0xaf')]=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0xb0'));db[_0x4535('0xb1')]=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0xb2'));db['DeskConfiguration']=db[_0x4535('0x2')][_0x4535('0x13')]('../api/intDeskConfiguration/intDeskConfiguration.model');db['DeskField']=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0xb3'));db[_0x4535('0xb4')]=db['sequelize'][_0x4535('0x13')](_0x4535('0xb5'));db[_0x4535('0xb6')]=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0xb7'));db[_0x4535('0xb8')]=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0xb9'));db[_0x4535('0xba')]=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0xbb'));db[_0x4535('0xbc')]=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0xbd'));db['ZendeskField']=db[_0x4535('0x2')]['import'](_0x4535('0xbe'));db[_0x4535('0xbf')]=db[_0x4535('0x2')]['import'](_0x4535('0xc0'));db['FreshdeskConfiguration']=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0xc1'));db['FreshdeskField']=db[_0x4535('0x2')][_0x4535('0x13')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0x4535('0xc2')]=db['sequelize'][_0x4535('0x13')](_0x4535('0xc3'));db[_0x4535('0xc4')]=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0xc5'));db[_0x4535('0xc6')]=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0xc7'));db[_0x4535('0xc8')]=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0xc9'));db[_0x4535('0xca')]=db[_0x4535('0x2')][_0x4535('0x13')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0x4535('0xcb')]=db[_0x4535('0x2')][_0x4535('0x13')]('../api/intServicenowField/intServicenowField.model');db['Dynamics365Account']=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0xcc'));db['Dynamics365Configuration']=db['sequelize'][_0x4535('0x13')](_0x4535('0xcd'));db[_0x4535('0xce')]=db[_0x4535('0x2')][_0x4535('0x13')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0x4535('0xcf')]=db['sequelize']['import'](_0x4535('0xd0'));db[_0x4535('0xd1')]=db['sequelize'][_0x4535('0x13')](_0x4535('0xd2'));db[_0x4535('0xd3')]=db['sequelize'][_0x4535('0x13')](_0x4535('0xd4'));db['Integration']=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0x98'));db['Network']=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0xd5'));db[_0x4535('0xd6')]=db['sequelize'][_0x4535('0x13')](_0x4535('0xd7'));db[_0x4535('0xd8')]=db['sequelize'][_0x4535('0x13')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x4535('0xd9')]=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0xda'));db[_0x4535('0xdb')]=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0xdc'));db[_0x4535('0xdd')]=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0xde'));db[_0x4535('0xdf')]=db['sequelize']['import'](_0x4535('0xe0'));db['SquareReport']=db['sequelize'][_0x4535('0x13')](_0x4535('0xe1'));db['SquareDetailsReport']=db['sequelize'][_0x4535('0x13')](_0x4535('0xe2'));db['JscriptyProject']=db['sequelize']['import'](_0x4535('0xe3'));db['Setting']=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0xe4'));db[_0x4535('0xe5')]=db[_0x4535('0x2')]['import']('../api/squareOdbc/squareOdbc.model');db[_0x4535('0xe6')]=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0xe7'));db[_0x4535('0xe8')]=db[_0x4535('0x2')][_0x4535('0x13')]('../api/squareRecording/squareRecording.model');db[_0x4535('0xe9')]=db['sequelize'][_0x4535('0x13')](_0x4535('0xea'));db['Team']=db[_0x4535('0x2')]['import']('../api/team/team.model');db[_0x4535('0xeb')]=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0xec'));db['Campaign']=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0xed'));db['Migration']=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0xee'));db[_0x4535('0xef')]=db[_0x4535('0x2')]['import']('../api/attachment/attachment.model');db[_0x4535('0xf0')]=db[_0x4535('0x2')][_0x4535('0x13')]('../api/plugin/plugin.model');db[_0x4535('0xf1')]=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0xf2'));db['ChatTransferReport']=db['sequelize'][_0x4535('0x13')]('../api/chatTransferReport/chatTransferReport.model');db[_0x4535('0xf3')]=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0xf4'));db[_0x4535('0xf5')]=db[_0x4535('0x2')]['import'](_0x4535('0xf6'));db[_0x4535('0xf7')]=db[_0x4535('0x2')][_0x4535('0x13')]('../api/smsTransferReport/smsTransferReport.model');db['CmList']=db[_0x4535('0x2')]['import'](_0x4535('0xf8'));db[_0x4535('0xf9')]=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0xfa'));db[_0x4535('0xfb')]=db[_0x4535('0x2')][_0x4535('0x13')]('../api/userProfile/userProfile.model');db['UserProfileSection']=db[_0x4535('0x2')][_0x4535('0x13')]('../api/userProfileSection/userProfileSection.model');db['UserProfileResource']=db[_0x4535('0x2')][_0x4535('0x13')]('../api/userProfileResource/userProfileResource.model');db[_0x4535('0xfc')]=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0xfd'));db['WhatsappAccount']=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0xfe'));db['WhatsappApplication']=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0xff'));db[_0x4535('0x100')]=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0x101'));db[_0x4535('0x102')]=db[_0x4535('0x2')]['import'](_0x4535('0x103'));db[_0x4535('0x104')]=db[_0x4535('0x2')]['import'](_0x4535('0x105'));db['WhatsappTransferReport']=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0x106'));db[_0x4535('0x107')]=db[_0x4535('0x2')][_0x4535('0x13')](_0x4535('0x108'));db[_0x4535('0x109')]=db[_0x4535('0x2')][_0x4535('0x13')]('../api/cloudProvider/cloudProvider.model');db[_0x4535('0x10a')]=db[_0x4535('0x2')]['import'](_0x4535('0x10b'));db[_0x4535('0x10c')]=db['sequelize'][_0x4535('0x13')](_0x4535('0x10d'));db[_0x4535('0x12')][_0x4535('0x10e')](db[_0x4535('0x10f')],{'as':_0x4535('0x10f'),'onDelete':_0x4535('0x110'),'foreignKey':_0x4535('0x111')});db[_0x4535('0x12')]['hasMany'](db['VoiceRecording'],{'as':_0x4535('0x112'),'foreignKey':_0x4535('0x111')});db['User'][_0x4535('0x113')](db[_0x4535('0x2e')],{'as':'VoiceQueuesRt','foreignKey':_0x4535('0x111')});db[_0x4535('0x12')][_0x4535('0x113')](db['VoiceExtension'],{'as':'Extensions','onDelete':_0x4535('0x110'),'hooks':!![]});db[_0x4535('0x12')]['hasMany'](db[_0x4535('0x7a')],{'as':_0x4535('0x114'),'foreignKey':'UserId'});db[_0x4535('0x12')][_0x4535('0x113')](db[_0x4535('0x7c')],{'as':_0x4535('0x115'),'foreignKey':_0x4535('0x111')});db[_0x4535('0x12')]['hasMany'](db[_0x4535('0x7d')],{'as':_0x4535('0x7d'),'foreignKey':'UserId'});db[_0x4535('0x12')][_0x4535('0x113')](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','foreignKey':_0x4535('0x111')});db['User'][_0x4535('0x113')](db[_0x4535('0x68')],{'as':'ChatInteractions','foreignKey':_0x4535('0x111')});db[_0x4535('0x12')]['hasMany'](db['SmsInteraction'],{'as':_0x4535('0x116'),'foreignKey':_0x4535('0x111')});db[_0x4535('0x12')][_0x4535('0x113')](db[_0x4535('0x4f')],{'as':'FaxInteractions','foreignKey':_0x4535('0x111')});db[_0x4535('0x12')][_0x4535('0x113')](db[_0x4535('0x42')],{'as':_0x4535('0x117'),'foreignKey':_0x4535('0x111')});db[_0x4535('0x12')][_0x4535('0x113')](db[_0x4535('0x100')],{'as':_0x4535('0x118'),'foreignKey':_0x4535('0x111')});db['User']['hasMany'](db[_0x4535('0xfc')],{'as':'UserNotifications','foreignKey':_0x4535('0x119')});db['User']['belongsTo'](db['UserProfile'],{'as':_0x4535('0xfb'),'foreignKey':'userProfileId'});db[_0x4535('0x12')][_0x4535('0x11a')](db[_0x4535('0x6f')],{'as':_0x4535('0x11b'),'through':_0x4535('0x11c')});db[_0x4535('0x12')][_0x4535('0x11a')](db[_0x4535('0x74')],{'as':'Contacts','through':_0x4535('0x11d')});db['User'][_0x4535('0x11a')](db['CmList'],{'as':'Lists','through':_0x4535('0x11e')});db[_0x4535('0x12')][_0x4535('0x11a')](db[_0x4535('0x11f')],{'through':_0x4535('0x120')});db[_0x4535('0x12')][_0x4535('0x11a')](db[_0x4535('0x42')],{'as':'MailInteractions','through':_0x4535('0x121')});db['User'][_0x4535('0x11a')](db['ChatInteraction'],{'as':_0x4535('0x122'),'through':_0x4535('0x123')});db[_0x4535('0x12')][_0x4535('0x11a')](db[_0x4535('0x4f')],{'as':_0x4535('0x124'),'through':_0x4535('0x125')});db[_0x4535('0x12')][_0x4535('0x11a')](db['SmsInteraction'],{'as':'SmsInteractions','through':'user_has_sms_interactions'});db['User'][_0x4535('0x11a')](db['OpenchannelInteraction'],{'as':_0x4535('0x126'),'through':_0x4535('0x127')});db['User'][_0x4535('0x11a')](db['WhatsappInteraction'],{'as':_0x4535('0x118'),'through':_0x4535('0x128')});db[_0x4535('0x12')][_0x4535('0x11a')](db[_0x4535('0x1b')],{'as':_0x4535('0x129'),'through':_0x4535('0x30'),'required':![]});db[_0x4535('0x12')][_0x4535('0x11a')](db[_0x4535('0x3f')],{'as':_0x4535('0x12a'),'through':_0x4535('0x33'),'required':![]});db['User'][_0x4535('0x11a')](db[_0x4535('0x6d')],{'as':_0x4535('0x12b'),'through':_0x4535('0x31'),'required':![],'hooks':!![]});db[_0x4535('0x12')]['belongsToMany'](db[_0x4535('0x52')],{'as':_0x4535('0x12c'),'through':_0x4535('0x35'),'required':![]});db['User'][_0x4535('0x11a')](db[_0x4535('0x5b')],{'as':'SmsQueues','through':_0x4535('0x12d'),'required':![]});db[_0x4535('0x12')][_0x4535('0x11a')](db['OpenchannelQueue'],{'as':_0x4535('0x12e'),'through':_0x4535('0x37'),'required':![]});db[_0x4535('0x12')][_0x4535('0x11a')](db[_0x4535('0x107')],{'as':_0x4535('0x12f'),'through':_0x4535('0x38'),'required':![]});db[_0x4535('0x12')][_0x4535('0x11a')](db[_0x4535('0x130')],{'through':_0x4535('0x11e')});db[_0x4535('0x12')]['belongsToMany'](db[_0x4535('0xf9')],{'as':'VoicePrefixes','through':_0x4535('0x131'),'required':![]});db[_0x4535('0x12')][_0x4535('0x11a')](db[_0x4535('0x65')],{'as':_0x4535('0x132'),'through':_0x4535('0x133')});db[_0x4535('0x12')][_0x4535('0x11a')](db['FaxAccount'],{'as':_0x4535('0x134'),'through':_0x4535('0x135')});db['User'][_0x4535('0x11a')](db[_0x4535('0x3d')],{'as':_0x4535('0x136'),'through':'user_has_mail_accounts'});db['User']['belongsToMany'](db[_0x4535('0x5d')],{'as':'OpenchannelAccounts','through':_0x4535('0x137')});db['User']['belongsToMany'](db[_0x4535('0x138')],{'as':_0x4535('0x139'),'through':_0x4535('0x13a')});db[_0x4535('0x12')][_0x4535('0x11a')](db['WhatsappAccount'],{'as':_0x4535('0x13b'),'through':'user_has_whatsapp_accounts'});db[_0x4535('0x12')][_0x4535('0x11a')](db[_0x4535('0xe6')],{'as':_0x4535('0x13c'),'through':_0x4535('0x13d')});db['VoiceChanSpy'][_0x4535('0x113')](db[_0x4535('0x18')],{'as':_0x4535('0x13e'),'onDelete':_0x4535('0x110'),'foreignKey':_0x4535('0x13f')});db[_0x4535('0x17')][_0x4535('0x113')](db['VoiceExtension'],{'onDelete':'cascade'});db[_0x4535('0x18')]['hasMany'](db['VoiceExtension'],{'as':'Applications','onDelete':_0x4535('0x110')});db['VoiceMusicOnHold'][_0x4535('0x11a')](db[_0x4535('0x8d')],{'as':'Sounds','through':_0x4535('0x140')});db[_0x4535('0x1b')]['hasMany'](db[_0x4535('0x2e')],{'as':_0x4535('0x141'),'foreignKey':_0x4535('0x142')});db[_0x4535('0x1b')]['hasMany'](db[_0x4535('0x76')],{'as':_0x4535('0x143'),'foreignKey':_0x4535('0x142')});db['VoiceQueue']['hasMany'](db[_0x4535('0x7a')],{'as':'HopperFinals','foreignKey':_0x4535('0x142')});db[_0x4535('0x1b')][_0x4535('0x113')](db[_0x4535('0x7c')],{'as':_0x4535('0x144'),'foreignKey':_0x4535('0x142')});db[_0x4535('0x1b')][_0x4535('0x113')](db['ReportAgentPreview'],{'as':_0x4535('0x7d'),'foreignKey':_0x4535('0x142')});db[_0x4535('0x1b')]['hasMany'](db['CmHopperBlack'],{'as':_0x4535('0x145'),'foreignKey':'VoiceQueueId'});db[_0x4535('0x1b')]['hasMany'](db['JscriptySessionReport'],{'as':_0x4535('0x146'),'foreignKey':_0x4535('0x142')});db[_0x4535('0x1b')][_0x4535('0x147')](db[_0x4535('0x2a')],{'as':_0x4535('0x2a'),'foreignKey':_0x4535('0x148')});db[_0x4535('0x1b')][_0x4535('0x147')](db[_0x4535('0x2a')],{'as':_0x4535('0x149'),'foreignKey':_0x4535('0x14a')});db[_0x4535('0x1b')][_0x4535('0x147')](db[_0x4535('0x85')],{'as':_0x4535('0x85'),'foreignKey':_0x4535('0x14b')});db['VoiceQueue'][_0x4535('0x147')](db['Pause'],{'as':_0x4535('0x14c'),'foreignKey':_0x4535('0x14d')});db[_0x4535('0x1b')][_0x4535('0x11a')](db[_0x4535('0x130')],{'as':'Lists','through':_0x4535('0x14e')});db[_0x4535('0x1b')][_0x4535('0x11a')](db[_0x4535('0x12')],{'as':_0x4535('0x14f'),'through':_0x4535('0x30')});db[_0x4535('0x1b')][_0x4535('0x11a')](db[_0x4535('0x11f')],{'as':'Teams','through':_0x4535('0x10c')});db[_0x4535('0x1b')][_0x4535('0x11a')](db[_0x4535('0x130')],{'as':'BlackLists','through':_0x4535('0x150')});db[_0x4535('0x1d')]['belongsTo'](db['User'],{'as':_0x4535('0x12'),'foreignKey':_0x4535('0x111')});db[_0x4535('0x1f')][_0x4535('0x147')](db['User'],{'as':_0x4535('0x12'),'foreignKey':_0x4535('0x111')});db['VoiceMail'][_0x4535('0x113')](db[_0x4535('0x151')],{'as':'Messages','onDelete':_0x4535('0x110'),'foreignKey':_0x4535('0x152'),'sourceKey':_0x4535('0x153')});db[_0x4535('0x151')][_0x4535('0x147')](db[_0x4535('0x10f')],{'foreignKey':_0x4535('0x152'),'targetKey':_0x4535('0x153')});db[_0x4535('0x22')][_0x4535('0x113')](db[_0x4535('0x27')],{'as':_0x4535('0x154'),'foreignKey':_0x4535('0x155'),'constraints':![]});db['VoiceCallReport'][_0x4535('0x113')](db[_0x4535('0x25')],{'as':_0x4535('0x156'),'foreignKey':'uniqueid','constraints':![]});db[_0x4535('0x22')]['belongsTo'](db['User'],{'as':_0x4535('0x12'),'foreignKey':_0x4535('0x111')});db[_0x4535('0x22')]['belongsTo'](db[_0x4535('0x74')],{'as':_0x4535('0x157'),'foreignKey':_0x4535('0x158')});db[_0x4535('0x3a')][_0x4535('0x147')](db[_0x4535('0x3d')],{'as':_0x4535('0x3d'),'foreignKey':'MailAccountId'});db[_0x4535('0x3c')][_0x4535('0x147')](db[_0x4535('0x3d')],{'as':'MailAccount','foreignKey':_0x4535('0x159')});db['MailAccount'][_0x4535('0x10e')](db[_0x4535('0x3a')],{'as':_0x4535('0x15a'),'onDelete':_0x4535('0x110')});db[_0x4535('0x3d')]['hasOne'](db[_0x4535('0x3c')],{'as':_0x4535('0x15b'),'onDelete':_0x4535('0x110')});db['MailAccount'][_0x4535('0x113')](db[_0x4535('0x82')],{'as':'Dispositions','foreignKey':_0x4535('0x159'),'onDelete':'cascade'});db['MailAccount'][_0x4535('0x113')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x4535('0x159')});db[_0x4535('0x3d')][_0x4535('0x113')](db[_0x4535('0x43')],{'as':_0x4535('0x15c'),'foreignKey':_0x4535('0x159')});db['MailAccount'][_0x4535('0x113')](db[_0x4535('0x42')],{'as':_0x4535('0x15d')});db[_0x4535('0x3d')][_0x4535('0x113')](db[_0x4535('0x15e')],{'as':_0x4535('0x15f')});db[_0x4535('0x3d')][_0x4535('0x147')](db[_0x4535('0x130')],{'as':_0x4535('0x160'),'foreignKey':_0x4535('0x161')});db[_0x4535('0x3d')]['belongsTo'](db[_0x4535('0x162')],{'as':'Template','foreignKey':_0x4535('0x163')});db[_0x4535('0x3d')][_0x4535('0x147')](db['Pause'],{'as':_0x4535('0x14c'),'foreignKey':_0x4535('0x14d')});db[_0x4535('0x3d')][_0x4535('0x11a')](db[_0x4535('0x12')],{'as':_0x4535('0x14f'),'through':_0x4535('0x164')});db[_0x4535('0x3f')][_0x4535('0x11a')](db[_0x4535('0x12')],{'as':'Agents','through':'UserMailQueue'});db[_0x4535('0x3f')][_0x4535('0x11a')](db[_0x4535('0x11f')],{'through':'team_has_mail_queues','as':_0x4535('0x165')});db['MailInteraction'][_0x4535('0x113')](db['MailMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0x4535('0x166')});db[_0x4535('0x42')]['belongsTo'](db[_0x4535('0x3d')],{'as':_0x4535('0x167'),'foreignKey':_0x4535('0x159')});db[_0x4535('0x42')][_0x4535('0x147')](db[_0x4535('0x74')],{'as':_0x4535('0x157'),'foreignKey':_0x4535('0x158')});db['MailInteraction'][_0x4535('0x147')](db['User'],{'as':_0x4535('0x168'),'foreignKey':_0x4535('0x111')});db[_0x4535('0x42')][_0x4535('0x11a')](db['Tag'],{'through':_0x4535('0x169'),'as':_0x4535('0x16a')});db['MailInteraction'][_0x4535('0x11a')](db[_0x4535('0x16b')],{'through':_0x4535('0x169'),'as':_0x4535('0x16c')});db[_0x4535('0x42')][_0x4535('0x11a')](db[_0x4535('0x12')],{'as':_0x4535('0x16d'),'through':'user_has_mail_interactions','foreignKey':'MailInteractionId'});db[_0x4535('0x43')][_0x4535('0x113')](db[_0x4535('0xef')],{'as':'Attachments','onDelete':_0x4535('0x110')});db['MailMessage'][_0x4535('0x147')](db[_0x4535('0x12')],{'as':_0x4535('0x12')});db['MailMessage'][_0x4535('0x147')](db[_0x4535('0x74')],{'onDelete':_0x4535('0x110'),'as':_0x4535('0x157')});db[_0x4535('0x43')][_0x4535('0x147')](db['MailInteraction'],{'as':_0x4535('0x16e'),'foreignKey':_0x4535('0x166')});db[_0x4535('0x43')][_0x4535('0x147')](db['MailAccount'],{'as':'Account','foreignKey':_0x4535('0x159')});db[_0x4535('0x43')][_0x4535('0x147')](db[_0x4535('0x65')],{'as':'ChatWebsite','foreignKey':_0x4535('0x16f')});db[_0x4535('0x43')][_0x4535('0x147')](db[_0x4535('0x6b')],{'as':_0x4535('0x6b'),'foreignKey':_0x4535('0x170')});db['MailApplication'][_0x4535('0x147')](db[_0x4535('0x12')],{'onDelete':'restrict'});db['MailApplication']['belongsTo'](db[_0x4535('0x3f')],{'onDelete':_0x4535('0x171')});db[_0x4535('0x15e')][_0x4535('0x147')](db['MailAccount'],{'onDelete':_0x4535('0x171')});db[_0x4535('0x15e')]['belongsTo'](db['Interval'],{'onDelete':'restrict','foreignKey':_0x4535('0x14b')});db[_0x4535('0x15e')][_0x4535('0x147')](db['Tag'],{'onDelete':'restrict','foreignKey':_0x4535('0x172')});db[_0x4535('0x45')][_0x4535('0x147')](db[_0x4535('0x3d')],{});db['MailQueueReport'][_0x4535('0x147')](db[_0x4535('0x130')],{'as':_0x4535('0x160'),'foreignKey':_0x4535('0x161')});db[_0x4535('0x45')][_0x4535('0x147')](db[_0x4535('0x74')],{'as':'Contact','foreignKey':_0x4535('0x158')});db[_0x4535('0x45')][_0x4535('0x147')](db['MailInteraction'],{});db[_0x4535('0x45')]['belongsTo'](db['MailMessage'],{});db[_0x4535('0x45')][_0x4535('0x147')](db[_0x4535('0x12')],{});db[_0x4535('0x45')][_0x4535('0x147')](db['MailQueue'],{});db[_0x4535('0x47')][_0x4535('0x113')](db[_0x4535('0x49')],{'as':'Items','onDelete':'cascade'});db[_0x4535('0x4b')][_0x4535('0x113')](db[_0x4535('0x82')],{'as':'Dispositions','foreignKey':'FaxAccountId','onDelete':_0x4535('0x110')});db[_0x4535('0x4b')][_0x4535('0x113')](db[_0x4535('0x81')],{'as':'Answers','foreignKey':_0x4535('0x173')});db[_0x4535('0x4b')][_0x4535('0x113')](db[_0x4535('0x4f')],{'as':_0x4535('0x15d')});db['FaxAccount'][_0x4535('0x113')](db[_0x4535('0x4d')],{'as':_0x4535('0x15f')});db[_0x4535('0x4b')]['hasMany'](db['VoiceExtension'],{'as':_0x4535('0x174'),'onDelete':_0x4535('0x110')});db[_0x4535('0x4b')]['hasMany'](db[_0x4535('0x175')],{'as':_0x4535('0x15c')});db[_0x4535('0x4b')][_0x4535('0x147')](db[_0x4535('0x2a')],{'as':'Trunk'});db[_0x4535('0x4b')][_0x4535('0x147')](db[_0x4535('0x130')],{'as':_0x4535('0x160'),'foreignKey':_0x4535('0x161')});db[_0x4535('0x4b')]['belongsTo'](db[_0x4535('0x87')],{'as':_0x4535('0x14c'),'foreignKey':_0x4535('0x14d')});db[_0x4535('0x4b')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x4535('0x135')});db[_0x4535('0x4d')][_0x4535('0x147')](db[_0x4535('0x12')],{'onDelete':'restrict'});db['FaxApplication'][_0x4535('0x147')](db[_0x4535('0x52')],{'onDelete':_0x4535('0x171')});db['FaxApplication']['belongsTo'](db[_0x4535('0x4b')],{'onDelete':'restrict'});db['FaxApplication'][_0x4535('0x147')](db[_0x4535('0x16b')],{'onDelete':_0x4535('0x171'),'foreignKey':_0x4535('0x172')});db['FaxInteraction'][_0x4535('0x113')](db['FaxMessage'],{'as':_0x4535('0x15c'),'onDelete':_0x4535('0x110'),'foreignKey':_0x4535('0x176')});db[_0x4535('0x4f')][_0x4535('0x147')](db[_0x4535('0x4b')],{'as':_0x4535('0x167'),'foreignKey':_0x4535('0x173')});db[_0x4535('0x4f')][_0x4535('0x147')](db['CmContact'],{'as':_0x4535('0x157'),'foreignKey':_0x4535('0x158')});db[_0x4535('0x4f')][_0x4535('0x147')](db[_0x4535('0x12')],{'as':'Owner','foreignKey':'UserId'});db[_0x4535('0x4f')][_0x4535('0x11a')](db[_0x4535('0x16b')],{'through':_0x4535('0x177'),'as':_0x4535('0x16a')});db['FaxInteraction'][_0x4535('0x11a')](db[_0x4535('0x16b')],{'through':'fax_interaction_has_tags','as':_0x4535('0x16c')});db[_0x4535('0x4f')][_0x4535('0x11a')](db[_0x4535('0x12')],{'as':'Users','through':_0x4535('0x125'),'foreignKey':_0x4535('0x176')});db['FaxMessage'][_0x4535('0x147')](db['User'],{'onDelete':_0x4535('0x110'),'as':_0x4535('0x12')});db['FaxMessage'][_0x4535('0x147')](db[_0x4535('0x4f')],{'as':_0x4535('0x16e'),'foreignKey':_0x4535('0x176')});db[_0x4535('0x175')][_0x4535('0x147')](db[_0x4535('0x74')],{'onDelete':_0x4535('0x110'),'as':_0x4535('0x157')});db['FaxMessage'][_0x4535('0x147')](db['Attachment'],{'as':_0x4535('0xef'),'foreignKey':_0x4535('0x178')});db[_0x4535('0x175')]['belongsTo'](db[_0x4535('0x4b')],{'as':_0x4535('0x167'),'foreignKey':_0x4535('0x173')});db[_0x4535('0x52')]['belongsToMany'](db[_0x4535('0x12')],{'as':_0x4535('0x14f'),'through':_0x4535('0x35')});db[_0x4535('0x52')][_0x4535('0x11a')](db[_0x4535('0x11f')],{'through':_0x4535('0x179'),'as':_0x4535('0x165')});db['FaxQueueReport'][_0x4535('0x147')](db[_0x4535('0x4b')],{});db[_0x4535('0x53')][_0x4535('0x147')](db['CmList'],{'as':_0x4535('0x160'),'foreignKey':_0x4535('0x161')});db[_0x4535('0x53')][_0x4535('0x147')](db['CmContact'],{'as':_0x4535('0x157'),'foreignKey':'ContactId'});db['FaxQueueReport']['belongsTo'](db[_0x4535('0x4f')],{});db['FaxQueueReport'][_0x4535('0x147')](db[_0x4535('0x175')],{});db['FaxQueueReport'][_0x4535('0x147')](db[_0x4535('0x12')],{});db[_0x4535('0x53')][_0x4535('0x147')](db[_0x4535('0x52')],{});db[_0x4535('0x138')][_0x4535('0x113')](db[_0x4535('0x82')],{'as':_0x4535('0x17a'),'foreignKey':_0x4535('0x17b'),'onDelete':_0x4535('0x110')});db['SmsAccount'][_0x4535('0x113')](db[_0x4535('0x81')],{'as':'Answers','foreignKey':_0x4535('0x17b')});db[_0x4535('0x138')][_0x4535('0x113')](db['SmsMessage'],{'as':_0x4535('0x15c'),'foreignKey':_0x4535('0x17b')});db[_0x4535('0x138')][_0x4535('0x113')](db[_0x4535('0x58')],{'as':_0x4535('0x15d')});db['SmsAccount'][_0x4535('0x113')](db['SmsApplication'],{'as':_0x4535('0x15f')});db[_0x4535('0x138')][_0x4535('0x147')](db[_0x4535('0x130')],{'as':_0x4535('0x160'),'foreignKey':_0x4535('0x161')});db['SmsAccount'][_0x4535('0x147')](db[_0x4535('0x87')],{'as':_0x4535('0x14c'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x4535('0x138')][_0x4535('0x11a')](db['User'],{'as':'Agents','through':'user_has_sms_accounts'});db[_0x4535('0x56')]['belongsTo'](db[_0x4535('0x12')],{'onDelete':_0x4535('0x171')});db[_0x4535('0x56')][_0x4535('0x147')](db['SmsQueue'],{'onDelete':_0x4535('0x171')});db[_0x4535('0x56')][_0x4535('0x147')](db[_0x4535('0x138')],{'onDelete':'restrict'});db[_0x4535('0x56')][_0x4535('0x147')](db['Interval'],{'onDelete':_0x4535('0x171'),'foreignKey':'IntervalId'});db[_0x4535('0x56')][_0x4535('0x147')](db[_0x4535('0x16b')],{'onDelete':_0x4535('0x171'),'foreignKey':_0x4535('0x172')});db[_0x4535('0x58')]['hasMany'](db['SmsMessage'],{'as':_0x4535('0x15c'),'onDelete':_0x4535('0x110'),'foreignKey':_0x4535('0x17c')});db[_0x4535('0x58')][_0x4535('0x147')](db[_0x4535('0x138')],{'as':_0x4535('0x167'),'foreignKey':'SmsAccountId'});db['SmsInteraction'][_0x4535('0x147')](db[_0x4535('0x74')],{'as':_0x4535('0x157'),'foreignKey':_0x4535('0x158')});db['SmsInteraction'][_0x4535('0x147')](db[_0x4535('0x12')],{'as':_0x4535('0x168'),'foreignKey':'UserId'});db['SmsInteraction'][_0x4535('0x11a')](db[_0x4535('0x16b')],{'through':'sms_interaction_has_tags','as':'Tags'});db[_0x4535('0x58')][_0x4535('0x11a')](db['Tag'],{'through':_0x4535('0x17d'),'as':'ThroughTags'});db[_0x4535('0x58')][_0x4535('0x11a')](db['User'],{'as':_0x4535('0x16d'),'through':_0x4535('0x17e'),'foreignKey':_0x4535('0x17c')});db[_0x4535('0x59')]['belongsTo'](db[_0x4535('0x12')],{'as':_0x4535('0x12')});db[_0x4535('0x59')][_0x4535('0x147')](db[_0x4535('0x74')],{'onDelete':_0x4535('0x110'),'as':_0x4535('0x157')});db[_0x4535('0x59')][_0x4535('0x147')](db[_0x4535('0x58')],{'onDelete':_0x4535('0x110'),'as':_0x4535('0x16e'),'foreignKey':'SmsInteractionId'});db[_0x4535('0x59')]['belongsTo'](db['SmsAccount'],{'as':_0x4535('0x167'),'foreignKey':_0x4535('0x17b')});db[_0x4535('0x5b')][_0x4535('0x11a')](db[_0x4535('0x12')],{'as':_0x4535('0x14f'),'through':_0x4535('0x12d'),'foreignKey':_0x4535('0x17f')});db[_0x4535('0x5b')][_0x4535('0x11a')](db[_0x4535('0x11f')],{'through':_0x4535('0x180'),'as':_0x4535('0x165')});db[_0x4535('0x5d')][_0x4535('0x113')](db[_0x4535('0x82')],{'as':'Dispositions','foreignKey':_0x4535('0x181'),'onDelete':_0x4535('0x110')});db[_0x4535('0x5d')][_0x4535('0x113')](db[_0x4535('0x81')],{'as':_0x4535('0x182'),'foreignKey':_0x4535('0x181')});db[_0x4535('0x5d')][_0x4535('0x113')](db['OpenchannelInteraction'],{'as':_0x4535('0x15d'),'foreignKey':'OpenchannelAccountId'});db[_0x4535('0x5d')][_0x4535('0x113')](db['OpenchannelMessage'],{'as':_0x4535('0x15c'),'foreignKey':_0x4535('0x181')});db[_0x4535('0x5d')][_0x4535('0x113')](db[_0x4535('0x5f')],{'as':_0x4535('0x15f'),'foreignKey':_0x4535('0x181')});db[_0x4535('0x5d')][_0x4535('0x147')](db[_0x4535('0x130')],{'as':_0x4535('0x160'),'foreignKey':_0x4535('0x161')});db['OpenchannelAccount'][_0x4535('0x147')](db[_0x4535('0x87')],{'as':_0x4535('0x14c'),'foreignKey':_0x4535('0x14d')});db[_0x4535('0x5d')][_0x4535('0x11a')](db[_0x4535('0x12')],{'as':_0x4535('0x14f'),'through':_0x4535('0x137')});db['OpenchannelApplication'][_0x4535('0x147')](db[_0x4535('0x12')],{'onDelete':_0x4535('0x171')});db[_0x4535('0x5f')]['belongsTo'](db[_0x4535('0x64')],{'onDelete':_0x4535('0x171'),'foreignKey':'OpenchannelQueueId'});db[_0x4535('0x5f')][_0x4535('0x147')](db[_0x4535('0x5d')],{'onDelete':_0x4535('0x171'),'foreignKey':'OpenchannelAccountId'});db[_0x4535('0x5f')][_0x4535('0x147')](db[_0x4535('0x85')],{'onDelete':_0x4535('0x171'),'foreignKey':_0x4535('0x14b')});db['OpenchannelApplication'][_0x4535('0x147')](db[_0x4535('0x16b')],{'onDelete':_0x4535('0x171'),'foreignKey':_0x4535('0x172')});db[_0x4535('0x61')][_0x4535('0x113')](db[_0x4535('0x183')],{'as':_0x4535('0x15c'),'onDelete':_0x4535('0x110'),'foreignKey':_0x4535('0x184')});db[_0x4535('0x61')][_0x4535('0x147')](db['OpenchannelAccount'],{'as':_0x4535('0x167'),'foreignKey':_0x4535('0x181')});db[_0x4535('0x61')][_0x4535('0x147')](db[_0x4535('0x74')],{'as':_0x4535('0x157'),'foreignKey':_0x4535('0x158')});db['OpenchannelInteraction'][_0x4535('0x147')](db['User'],{'as':_0x4535('0x168'),'foreignKey':_0x4535('0x111')});db['OpenchannelInteraction'][_0x4535('0x11a')](db['Tag'],{'through':_0x4535('0x185'),'as':_0x4535('0x16a')});db[_0x4535('0x61')][_0x4535('0x11a')](db[_0x4535('0x16b')],{'through':_0x4535('0x185'),'as':_0x4535('0x16c')});db[_0x4535('0x61')]['belongsToMany'](db[_0x4535('0x12')],{'as':_0x4535('0x16d'),'through':_0x4535('0x127'),'foreignKey':_0x4535('0x184')});db[_0x4535('0x183')][_0x4535('0x147')](db['User'],{'onDelete':_0x4535('0x110'),'as':_0x4535('0x12')});db['OpenchannelMessage'][_0x4535('0x147')](db['CmContact'],{'onDelete':'cascade','as':_0x4535('0x157')});db[_0x4535('0x183')][_0x4535('0x147')](db[_0x4535('0x61')],{'onDelete':'cascade','as':_0x4535('0x16e'),'foreignKey':_0x4535('0x184')});db['OpenchannelMessage']['belongsTo'](db['Attachment'],{'as':'Attachment','foreignKey':_0x4535('0x178')});db[_0x4535('0x183')]['belongsTo'](db['OpenchannelAccount'],{'as':_0x4535('0x167'),'foreignKey':_0x4535('0x181')});db[_0x4535('0x64')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x4535('0x37'),'foreignKey':'OpenchannelQueueId'});db[_0x4535('0x64')]['belongsToMany'](db[_0x4535('0x11f')],{'through':'team_has_openchannel_queues','as':_0x4535('0x165')});db[_0x4535('0x65')][_0x4535('0x113')](db['Disposition'],{'as':_0x4535('0x17a'),'foreignKey':_0x4535('0x16f'),'onDelete':'cascade'});db[_0x4535('0x65')][_0x4535('0x113')](db['CannedAnswer'],{'as':_0x4535('0x182'),'foreignKey':_0x4535('0x16f')});db['ChatWebsite']['hasMany'](db[_0x4535('0x71')],{'as':_0x4535('0x186')});db[_0x4535('0x65')][_0x4535('0x113')](db[_0x4535('0x68')],{'as':_0x4535('0x15d')});db[_0x4535('0x65')][_0x4535('0x113')](db[_0x4535('0x187')],{'as':_0x4535('0x15f')});db[_0x4535('0x65')]['hasMany'](db['ChatMessage'],{'as':'Messages'});db[_0x4535('0x65')][_0x4535('0x147')](db[_0x4535('0x130')],{'as':_0x4535('0x160'),'foreignKey':'ListId'});db[_0x4535('0x65')][_0x4535('0x147')](db[_0x4535('0x85')],{'as':'Interval','foreignKey':_0x4535('0x14b')});db[_0x4535('0x65')][_0x4535('0x147')](db[_0x4535('0x3d')],{'as':_0x4535('0x3d'),'foreignKey':_0x4535('0x159')});db[_0x4535('0x65')][_0x4535('0x147')](db[_0x4535('0x87')],{'as':'mandatoryDispositionPause','foreignKey':_0x4535('0x14d')});db[_0x4535('0x65')][_0x4535('0x11a')](db[_0x4535('0x12')],{'as':'Agents','through':_0x4535('0x133')});db['OpenchannelQueueReport'][_0x4535('0x147')](db['OpenchannelAccount'],{});db[_0x4535('0x188')][_0x4535('0x147')](db[_0x4535('0x130')],{'as':'List','foreignKey':'ListId'});db[_0x4535('0x188')]['belongsTo'](db[_0x4535('0x74')],{'as':_0x4535('0x157'),'foreignKey':'ContactId'});db[_0x4535('0x188')][_0x4535('0x147')](db[_0x4535('0x61')],{});db[_0x4535('0x188')][_0x4535('0x147')](db['OpenchannelMessage'],{});db['OpenchannelQueueReport'][_0x4535('0x147')](db['User'],{});db['OpenchannelQueueReport'][_0x4535('0x147')](db[_0x4535('0x64')],{});db[_0x4535('0x187')][_0x4535('0x147')](db[_0x4535('0x12')],{'as':_0x4535('0x189'),'foreignKey':'UserId','onDelete':'restrict'});db[_0x4535('0x187')]['belongsTo'](db[_0x4535('0x6d')],{'as':_0x4535('0x18a'),'foreignKey':'ChatQueueId','onDelete':_0x4535('0x171')});db[_0x4535('0x187')][_0x4535('0x147')](db[_0x4535('0x65')],{'as':_0x4535('0x18b'),'foreignKey':_0x4535('0x16f'),'onDelete':'restrict'});db[_0x4535('0x187')]['belongsTo'](db[_0x4535('0x16b')],{'onDelete':'restrict','foreignKey':_0x4535('0x172')});db[_0x4535('0x68')]['hasMany'](db[_0x4535('0x69')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x4535('0x18c')});db['ChatInteraction'][_0x4535('0x147')](db[_0x4535('0x65')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x4535('0x68')][_0x4535('0x147')](db[_0x4535('0x74')],{'as':_0x4535('0x157'),'foreignKey':'ContactId'});db[_0x4535('0x68')][_0x4535('0x147')](db[_0x4535('0x12')],{'as':_0x4535('0x168'),'foreignKey':_0x4535('0x111')});db[_0x4535('0x68')]['belongsToMany'](db[_0x4535('0x16b')],{'through':_0x4535('0x18d'),'as':_0x4535('0x16a')});db[_0x4535('0x68')][_0x4535('0x11a')](db['Tag'],{'through':_0x4535('0x18d'),'as':_0x4535('0x16c')});db['ChatInteraction'][_0x4535('0x11a')](db['User'],{'as':_0x4535('0x16d'),'through':_0x4535('0x123'),'foreignKey':_0x4535('0x18c')});db[_0x4535('0x69')][_0x4535('0x147')](db[_0x4535('0x12')],{'onDelete':_0x4535('0x110'),'as':_0x4535('0x12')});db[_0x4535('0x69')][_0x4535('0x147')](db['CmContact'],{'onDelete':_0x4535('0x110'),'as':_0x4535('0x157'),'foreignKey':'ContactId'});db[_0x4535('0x69')][_0x4535('0x147')](db[_0x4535('0x68')],{'onDelete':_0x4535('0x110'),'as':'Interaction','foreignKey':_0x4535('0x18c')});db[_0x4535('0x69')]['belongsTo'](db[_0x4535('0xef')],{'as':_0x4535('0xef'),'foreignKey':_0x4535('0x178')});db[_0x4535('0x69')][_0x4535('0x147')](db['ChatWebsite'],{'as':'Account','foreignKey':_0x4535('0x16f')});db[_0x4535('0x6b')][_0x4535('0x113')](db[_0x4535('0xef')],{'as':_0x4535('0x18e'),'foreignKey':_0x4535('0x170'),'onDelete':'cascade','hooks':!![]});db[_0x4535('0x6b')][_0x4535('0x147')](db['CmContact'],{'onDelete':_0x4535('0x110'),'as':_0x4535('0x157'),'foreignKey':_0x4535('0x158')});db[_0x4535('0x6b')][_0x4535('0x147')](db[_0x4535('0x65')],{'as':'Account','foreignKey':_0x4535('0x16f')});db[_0x4535('0x6d')][_0x4535('0x11a')](db[_0x4535('0x12')],{'as':_0x4535('0x14f'),'through':_0x4535('0x31'),'hooks':!![]});db[_0x4535('0x6d')][_0x4535('0x11a')](db[_0x4535('0x11f')],{'through':_0x4535('0x18f'),'as':_0x4535('0x165')});db[_0x4535('0x6f')][_0x4535('0x113')](db[_0x4535('0xd8')],{'as':_0x4535('0x15c'),'foreignKey':_0x4535('0x190'),'onDelete':'cascade'});db[_0x4535('0x6f')]['belongsToMany'](db['User'],{'as':_0x4535('0x141'),'through':_0x4535('0x11c')});db['ChatProactiveAction'][_0x4535('0x147')](db[_0x4535('0x65')],{'as':_0x4535('0x18b'),'foreignKey':_0x4535('0x16f')});db['CmCompany']['hasMany'](db['CmContact'],{'as':_0x4535('0x191'),'foreignKey':_0x4535('0x192')});db[_0x4535('0x74')][_0x4535('0x113')](db['CmContactHasItem'],{'as':_0x4535('0x193'),'foreignKey':'CmContactId'});db[_0x4535('0x74')][_0x4535('0x113')](db[_0x4535('0x76')],{'as':_0x4535('0x143'),'foreignKey':_0x4535('0x158')});db[_0x4535('0x74')]['hasMany'](db[_0x4535('0x7a')],{'as':_0x4535('0x114'),'foreignKey':_0x4535('0x158')});db[_0x4535('0x74')]['hasMany'](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':'ContactId'});db[_0x4535('0x74')]['hasMany'](db['ReportAgentPreview'],{'as':_0x4535('0x7d'),'foreignKey':_0x4535('0x158')});db[_0x4535('0x74')][_0x4535('0x113')](db[_0x4535('0xdd')],{'as':_0x4535('0x146'),'foreignKey':_0x4535('0x158')});db[_0x4535('0x74')][_0x4535('0x113')](db[_0x4535('0x61')],{'as':_0x4535('0x126'),'foreignKey':_0x4535('0x158'),'onDelete':_0x4535('0x171')});db[_0x4535('0x74')][_0x4535('0x113')](db[_0x4535('0x68')],{'as':_0x4535('0x122'),'foreignKey':_0x4535('0x158'),'onDelete':_0x4535('0x171')});db['CmContact'][_0x4535('0x113')](db[_0x4535('0x58')],{'as':'SmsInteractions','foreignKey':_0x4535('0x158'),'onDelete':_0x4535('0x171')});db[_0x4535('0x74')][_0x4535('0x113')](db['FaxInteraction'],{'as':_0x4535('0x124'),'foreignKey':_0x4535('0x158'),'onDelete':_0x4535('0x171')});db['CmContact'][_0x4535('0x113')](db[_0x4535('0x42')],{'as':_0x4535('0x117'),'foreignKey':_0x4535('0x158'),'onDelete':_0x4535('0x171')});db[_0x4535('0x74')][_0x4535('0x147')](db[_0x4535('0x194')],{'as':_0x4535('0x195'),'foreignKey':_0x4535('0x192')});db[_0x4535('0x74')][_0x4535('0x147')](db[_0x4535('0x130')],{'as':_0x4535('0x160'),'foreignKey':_0x4535('0x161'),'onDelete':_0x4535('0x110')});db[_0x4535('0x74')]['belongsToMany'](db[_0x4535('0x12')],{'as':'Users','through':_0x4535('0x11d')});db[_0x4535('0x74')][_0x4535('0x11a')](db[_0x4535('0x16b')],{'as':'Tags','through':'cm_contact_has_tags'});db[_0x4535('0x74')][_0x4535('0x11a')](db[_0x4535('0x16b')],{'through':_0x4535('0x196'),'as':_0x4535('0x16c')});db[_0x4535('0x76')]['hasMany'](db['CmHopperAdditionalPhone'],{'as':_0x4535('0x197'),'foreignKey':_0x4535('0x198')});db['CmHopper']['belongsTo'](db[_0x4535('0x74')],{'as':_0x4535('0x157'),'foreignKey':'ContactId','onDelete':_0x4535('0x110')});db['CmHopper'][_0x4535('0x147')](db[_0x4535('0x130')],{'as':'List','foreignKey':'ListId','onDelete':_0x4535('0x110')});db['CmHopper'][_0x4535('0x147')](db[_0x4535('0x12')],{'as':'Agent','foreignKey':_0x4535('0x111')});db[_0x4535('0x76')][_0x4535('0x147')](db[_0x4535('0x1b')],{'as':_0x4535('0x18a'),'foreignKey':_0x4535('0x142'),'onDelete':_0x4535('0x110')});db['CmHopper'][_0x4535('0x147')](db['Campaign'],{'as':_0x4535('0x199'),'foreignKey':_0x4535('0x19a'),'onDelete':_0x4535('0x110')});db['CmHopper'][_0x4535('0x147')](db[_0x4535('0x12')],{'as':_0x4535('0x168'),'foreignKey':'OwnerId'});db['CmHopperBlack'][_0x4535('0x147')](db[_0x4535('0x74')],{'as':_0x4535('0x157'),'foreignKey':_0x4535('0x158'),'onDelete':_0x4535('0x110')});db[_0x4535('0x78')][_0x4535('0x147')](db['CmList'],{'as':_0x4535('0x160'),'foreignKey':_0x4535('0x161'),'onDelete':'cascade'});db['CmHopperBlack'][_0x4535('0x147')](db[_0x4535('0x1b')],{'as':_0x4535('0x18a'),'foreignKey':_0x4535('0x142'),'onDelete':_0x4535('0x110')});db[_0x4535('0x78')][_0x4535('0x147')](db[_0x4535('0x199')],{'as':'Campaign','foreignKey':'CampaignId','onDelete':_0x4535('0x110')});db[_0x4535('0x19b')]['hasMany'](db['Condition'],{'as':{'plural':'All','singular':_0x4535('0x19c')},'foreignKey':_0x4535('0x19d'),'onDelete':'cascade','hooks':!![]});db[_0x4535('0x19b')][_0x4535('0x113')](db[_0x4535('0x19e')],{'as':{'plural':_0x4535('0x19f'),'singular':_0x4535('0x1a0')},'foreignKey':_0x4535('0x1a1'),'onDelete':_0x4535('0x110'),'hooks':!![]});db[_0x4535('0x19b')][_0x4535('0x113')](db['Action'],{'as':_0x4535('0x1a2'),'foreignKey':_0x4535('0x1a3'),'onDelete':_0x4535('0x110'),'hooks':!![]});db['Disposition']['hasMany'](db[_0x4535('0x82')],{'as':_0x4535('0x17a'),'foreignKey':_0x4535('0x1a4'),'onDelete':_0x4535('0x110')});db[_0x4535('0x85')]['hasMany'](db[_0x4535('0x85')],{'as':_0x4535('0x1a5'),'foreignKey':_0x4535('0x14b'),'onDelete':_0x4535('0x110'),'hooks':!![],'required':![]});db[_0x4535('0x85')][_0x4535('0x113')](db['VoiceExtension'],{'as':_0x4535('0x1a6'),'foreignKey':_0x4535('0x14b'),'onDelete':_0x4535('0x171')});db['Interval'][_0x4535('0x113')](db[_0x4535('0x15e')],{'as':_0x4535('0x1a7'),'foreignKey':_0x4535('0x14b')});db['Interval'][_0x4535('0x113')](db[_0x4535('0x187')],{'as':_0x4535('0x1a8'),'foreignKey':_0x4535('0x14b')});db[_0x4535('0x85')]['hasMany'](db[_0x4535('0x4d')],{'as':'FaxApplications','foreignKey':_0x4535('0x14b')});db[_0x4535('0x85')][_0x4535('0x113')](db['SmsApplication'],{'as':_0x4535('0x1a9'),'foreignKey':'IntervalId'});db[_0x4535('0x8c')][_0x4535('0x147')](db[_0x4535('0x3d')],{});db[_0x4535('0x8c')][_0x4535('0x147')](db['AnalyticDefaultReport'],{'foreignKey':_0x4535('0x1aa')});db[_0x4535('0x8c')]['belongsTo'](db[_0x4535('0x9b')],{'foreignKey':_0x4535('0x1ab')});db[_0x4535('0x8d')][_0x4535('0x11a')](db['VoiceMusicOnHold'],{'as':'Mohs','through':_0x4535('0x140'),'onDelete':_0x4535('0x171')});db[_0x4535('0x16b')][_0x4535('0x11a')](db['CmContact'],{'through':'cm_contact_has_tags'});db[_0x4535('0x16b')][_0x4535('0x11a')](db[_0x4535('0x68')],{'through':_0x4535('0x18d')});db[_0x4535('0x16b')][_0x4535('0x11a')](db[_0x4535('0x42')],{'through':_0x4535('0x169')});db[_0x4535('0x16b')][_0x4535('0x11a')](db[_0x4535('0x58')],{'through':_0x4535('0x17d')});db[_0x4535('0x16b')][_0x4535('0x11a')](db['FaxInteraction'],{'through':'fax_interaction_has_tags'});db[_0x4535('0x16b')][_0x4535('0x11a')](db['OpenchannelInteraction'],{'through':_0x4535('0x185')});db[_0x4535('0x16b')][_0x4535('0x11a')](db[_0x4535('0x100')],{'through':_0x4535('0x1ac')});db[_0x4535('0x8f')]['belongsTo'](db[_0x4535('0x1ad')],{'as':_0x4535('0x1ae'),'foreignKey':_0x4535('0x1af')});db['CmHopperAdditionalPhone'][_0x4535('0x147')](db[_0x4535('0x76')],{'as':_0x4535('0x1b0'),'foreignKey':'CmHopperId'});db[_0x4535('0x93')][_0x4535('0x113')](db[_0x4535('0x19e')],{'as':{'plural':_0x4535('0x1b1'),'singular':'AllCondition'},'foreignKey':'TriggerAllId','onDelete':_0x4535('0x110'),'hooks':!![]});db[_0x4535('0x93')][_0x4535('0x113')](db[_0x4535('0x19e')],{'as':{'plural':_0x4535('0x1b2'),'singular':'AnyCondition'},'foreignKey':_0x4535('0x1b3'),'onDelete':_0x4535('0x110'),'hooks':!![]});db['Trigger']['hasMany'](db['Action'],{'as':_0x4535('0x1a2'),'foreignKey':_0x4535('0x1b4'),'onDelete':_0x4535('0x110'),'hooks':!![]});db[_0x4535('0x9b')][_0x4535('0x113')](db['AnalyticFieldReport'],{'as':_0x4535('0x1b5'),'onDelete':_0x4535('0x110'),'foreignKey':_0x4535('0x1ab'),'hooks':!![]});db[_0x4535('0x9d')]['hasMany'](db[_0x4535('0xa1')],{'as':_0x4535('0x1b5'),'onDelete':'cascade','foreignKey':_0x4535('0x1aa')});db[_0x4535('0x9f')]['hasMany'](db[_0x4535('0xa1')],{'as':'Fields','onDelete':_0x4535('0x110'),'foreignKey':_0x4535('0x1b6')});db['AnalyticFieldReport'][_0x4535('0x147')](db[_0x4535('0x9f')],{'foreignKey':_0x4535('0x1b6')});db[_0x4535('0xa5')][_0x4535('0x113')](db[_0x4535('0xa7')],{'as':_0x4535('0x1b7'),'onDelete':'cascade','foreignKey':_0x4535('0x1b8')});db['SalesforceConfiguration'][_0x4535('0x113')](db[_0x4535('0xa9')],{'as':'Subjects','onDelete':_0x4535('0x110'),'foreignKey':_0x4535('0x1b9')});db['SalesforceConfiguration'][_0x4535('0x113')](db[_0x4535('0xa9')],{'as':_0x4535('0x1ba'),'onDelete':_0x4535('0x110'),'foreignKey':_0x4535('0x1bb')});db['SalesforceConfiguration']['hasMany'](db['SalesforceField'],{'as':'Fields','onDelete':_0x4535('0x110'),'foreignKey':_0x4535('0x1bc')});db[_0x4535('0xa7')][_0x4535('0x147')](db['SalesforceAccount'],{'as':_0x4535('0x167'),'foreignKey':_0x4535('0x1b8')});db[_0x4535('0xa9')]['hasMany'](db['SalesforceField'],{'as':_0x4535('0x1bd'),'foreignKey':_0x4535('0x1b9')});db[_0x4535('0xa9')][_0x4535('0x113')](db[_0x4535('0xa9')],{'as':_0x4535('0x1be'),'foreignKey':'DescriptionId'});db[_0x4535('0xa9')]['hasMany'](db[_0x4535('0xa9')],{'as':_0x4535('0x1bf'),'foreignKey':'FieldId'});db[_0x4535('0xa9')][_0x4535('0x147')](db['Variable'],{'as':_0x4535('0x95'),'foreignKey':_0x4535('0x1c0')});db[_0x4535('0xab')]['hasMany'](db['SugarcrmConfiguration'],{'as':'Configurations','onDelete':_0x4535('0x110'),'foreignKey':_0x4535('0x1b8')});db[_0x4535('0xad')][_0x4535('0x113')](db[_0x4535('0xaf')],{'as':'Subjects','onDelete':_0x4535('0x110'),'foreignKey':'SubjectId'});db[_0x4535('0xad')][_0x4535('0x113')](db[_0x4535('0xaf')],{'as':_0x4535('0x1ba'),'onDelete':_0x4535('0x110'),'foreignKey':_0x4535('0x1bb')});db[_0x4535('0xad')][_0x4535('0x113')](db[_0x4535('0xaf')],{'as':_0x4535('0x1b5'),'onDelete':_0x4535('0x110'),'foreignKey':_0x4535('0x1bc')});db[_0x4535('0xad')][_0x4535('0x147')](db['SugarcrmAccount'],{'as':_0x4535('0x167'),'foreignKey':_0x4535('0x1b8')});db[_0x4535('0xaf')][_0x4535('0x113')](db['SugarcrmField'],{'as':'Subject','foreignKey':_0x4535('0x1b9')});db['SugarcrmField'][_0x4535('0x113')](db[_0x4535('0xaf')],{'as':_0x4535('0x1be'),'foreignKey':_0x4535('0x1bb')});db['SugarcrmField']['hasMany'](db[_0x4535('0xaf')],{'as':_0x4535('0x1bf'),'foreignKey':_0x4535('0x1bc')});db[_0x4535('0xaf')][_0x4535('0x147')](db[_0x4535('0x95')],{'as':_0x4535('0x95'),'foreignKey':_0x4535('0x1c0')});db[_0x4535('0xb1')][_0x4535('0x113')](db['DeskConfiguration'],{'as':'Configurations','onDelete':_0x4535('0x110'),'foreignKey':_0x4535('0x1b8')});db['DeskConfiguration'][_0x4535('0x113')](db['DeskField'],{'as':'Subjects','onDelete':_0x4535('0x110'),'foreignKey':_0x4535('0x1b9')});db[_0x4535('0x1c1')][_0x4535('0x113')](db[_0x4535('0x1c2')],{'as':_0x4535('0x1ba'),'onDelete':_0x4535('0x110'),'foreignKey':_0x4535('0x1bb')});db[_0x4535('0x1c1')][_0x4535('0x113')](db[_0x4535('0x1c2')],{'as':_0x4535('0x1b5'),'onDelete':'cascade','foreignKey':_0x4535('0x1bc')});db[_0x4535('0x1c1')][_0x4535('0x147')](db[_0x4535('0xb1')],{'as':'Account','foreignKey':_0x4535('0x1b8')});db[_0x4535('0x1c1')][_0x4535('0x11a')](db[_0x4535('0x16b')],{'through':_0x4535('0x1c3')});db[_0x4535('0x1c2')][_0x4535('0x113')](db['DeskField'],{'as':_0x4535('0x1bd'),'foreignKey':_0x4535('0x1b9')});db[_0x4535('0x1c2')]['hasMany'](db[_0x4535('0x1c2')],{'as':_0x4535('0x1be'),'foreignKey':'DescriptionId'});db[_0x4535('0x1c2')][_0x4535('0x113')](db[_0x4535('0x1c2')],{'as':_0x4535('0x1bf'),'foreignKey':_0x4535('0x1bc')});db[_0x4535('0x1c2')][_0x4535('0x147')](db[_0x4535('0x95')],{'as':_0x4535('0x95'),'foreignKey':_0x4535('0x1c0')});db[_0x4535('0xb4')][_0x4535('0x113')](db[_0x4535('0xb6')],{'as':_0x4535('0x1b7'),'onDelete':_0x4535('0x110'),'foreignKey':_0x4535('0x1b8')});db[_0x4535('0xb6')][_0x4535('0x113')](db[_0x4535('0xb8')],{'as':_0x4535('0x1c4'),'onDelete':'cascade','foreignKey':'SubjectId'});db['ZohoConfiguration'][_0x4535('0x113')](db[_0x4535('0xb8')],{'as':_0x4535('0x1ba'),'onDelete':_0x4535('0x110'),'foreignKey':_0x4535('0x1bb')});db[_0x4535('0xb6')][_0x4535('0x113')](db[_0x4535('0xb8')],{'as':_0x4535('0x1b5'),'onDelete':_0x4535('0x110'),'foreignKey':'FieldId'});db['ZohoConfiguration'][_0x4535('0x147')](db[_0x4535('0xb4')],{'as':_0x4535('0x167'),'foreignKey':_0x4535('0x1b8')});db['ZohoField'][_0x4535('0x113')](db[_0x4535('0xb8')],{'as':_0x4535('0x1bd'),'foreignKey':_0x4535('0x1b9')});db['ZohoField'][_0x4535('0x113')](db[_0x4535('0xb8')],{'as':'Description','foreignKey':'DescriptionId'});db['ZohoField'][_0x4535('0x113')](db[_0x4535('0xb8')],{'as':_0x4535('0x1bf'),'foreignKey':_0x4535('0x1bc')});db[_0x4535('0xb8')][_0x4535('0x147')](db[_0x4535('0x95')],{'as':_0x4535('0x95'),'foreignKey':_0x4535('0x1c0')});db[_0x4535('0xba')][_0x4535('0x113')](db['ZendeskConfiguration'],{'as':_0x4535('0x1b7'),'onDelete':_0x4535('0x110'),'foreignKey':_0x4535('0x1b8')});db['ZendeskConfiguration']['hasMany'](db[_0x4535('0x1c5')],{'as':_0x4535('0x1c4'),'foreignKey':_0x4535('0x1b9')});db['ZendeskConfiguration'][_0x4535('0x113')](db[_0x4535('0x1c5')],{'as':_0x4535('0x1ba'),'foreignKey':_0x4535('0x1bb')});db[_0x4535('0xbc')][_0x4535('0x113')](db[_0x4535('0x1c5')],{'as':_0x4535('0x1b5'),'foreignKey':_0x4535('0x1bc')});db[_0x4535('0xbc')][_0x4535('0x147')](db[_0x4535('0xba')],{'as':_0x4535('0x167'),'foreignKey':_0x4535('0x1b8')});db[_0x4535('0xbc')][_0x4535('0x11a')](db[_0x4535('0x16b')],{'through':_0x4535('0x1c6')});db[_0x4535('0x1c5')][_0x4535('0x113')](db['ZendeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x4535('0x1c5')][_0x4535('0x113')](db[_0x4535('0x1c5')],{'as':_0x4535('0x1be'),'foreignKey':'DescriptionId'});db[_0x4535('0x1c5')][_0x4535('0x113')](db[_0x4535('0x1c5')],{'as':'Field','foreignKey':_0x4535('0x1bc')});db['ZendeskField'][_0x4535('0x147')](db[_0x4535('0x95')],{'as':_0x4535('0x95'),'foreignKey':_0x4535('0x1c0')});db[_0x4535('0xbf')][_0x4535('0x113')](db[_0x4535('0x1c7')],{'as':'Configurations','onDelete':_0x4535('0x110'),'foreignKey':_0x4535('0x1b8')});db[_0x4535('0x1c7')][_0x4535('0x113')](db[_0x4535('0x1c8')],{'as':_0x4535('0x1c4'),'onDelete':_0x4535('0x110'),'foreignKey':_0x4535('0x1b9')});db[_0x4535('0x1c7')][_0x4535('0x113')](db[_0x4535('0x1c8')],{'as':_0x4535('0x1ba'),'onDelete':_0x4535('0x110'),'foreignKey':'DescriptionId'});db[_0x4535('0x1c7')][_0x4535('0x113')](db[_0x4535('0x1c8')],{'as':'Fields','onDelete':'cascade','foreignKey':'FieldId'});db[_0x4535('0x1c7')][_0x4535('0x147')](db[_0x4535('0xbf')],{'as':_0x4535('0x167'),'foreignKey':_0x4535('0x1b8')});db[_0x4535('0x1c7')][_0x4535('0x11a')](db['Tag'],{'through':'int_freshdesk_configuration_has_tags'});db[_0x4535('0x1c8')][_0x4535('0x113')](db[_0x4535('0x1c8')],{'as':_0x4535('0x1bd'),'foreignKey':_0x4535('0x1b9')});db[_0x4535('0x1c8')][_0x4535('0x113')](db['FreshdeskField'],{'as':'Description','foreignKey':'DescriptionId'});db['FreshdeskField'][_0x4535('0x113')](db[_0x4535('0x1c8')],{'as':'Field','foreignKey':_0x4535('0x1bc')});db[_0x4535('0x1c8')][_0x4535('0x147')](db[_0x4535('0x95')],{'as':_0x4535('0x95'),'foreignKey':_0x4535('0x1c0')});db['VtigerAccount'][_0x4535('0x113')](db[_0x4535('0xc4')],{'as':_0x4535('0x1b7'),'onDelete':'cascade','foreignKey':'AccountId'});db['VtigerConfiguration']['hasMany'](db[_0x4535('0xc6')],{'as':_0x4535('0x1c4'),'foreignKey':'SubjectId'});db[_0x4535('0xc4')]['hasMany'](db[_0x4535('0xc6')],{'as':_0x4535('0x1ba'),'foreignKey':'DescriptionId'});db[_0x4535('0xc4')][_0x4535('0x113')](db[_0x4535('0xc6')],{'as':_0x4535('0x1b5'),'foreignKey':_0x4535('0x1bc')});db[_0x4535('0xc4')]['belongsTo'](db[_0x4535('0xc2')],{'as':_0x4535('0x167'),'foreignKey':'AccountId'});db[_0x4535('0xc6')][_0x4535('0x113')](db[_0x4535('0xc6')],{'as':_0x4535('0x1bd'),'foreignKey':_0x4535('0x1b9')});db[_0x4535('0xc6')][_0x4535('0x113')](db[_0x4535('0xc6')],{'as':_0x4535('0x1be'),'foreignKey':_0x4535('0x1bb')});db[_0x4535('0xc6')][_0x4535('0x113')](db[_0x4535('0xc6')],{'as':'Field','foreignKey':_0x4535('0x1bc')});db['VtigerField']['belongsTo'](db[_0x4535('0x95')],{'as':_0x4535('0x95'),'foreignKey':_0x4535('0x1c0')});db[_0x4535('0xc8')]['hasMany'](db[_0x4535('0xca')],{'as':'Configurations','onDelete':_0x4535('0x110'),'foreignKey':_0x4535('0x1b8')});db['ServicenowConfiguration']['hasMany'](db[_0x4535('0xcb')],{'as':_0x4535('0x1c4'),'foreignKey':_0x4535('0x1b9')});db[_0x4535('0xca')]['hasMany'](db['ServicenowField'],{'as':'Descriptions','foreignKey':_0x4535('0x1bb')});db[_0x4535('0xca')]['hasMany'](db[_0x4535('0xcb')],{'as':'Fields','foreignKey':_0x4535('0x1bc')});db['ServicenowConfiguration'][_0x4535('0x147')](db[_0x4535('0xc8')],{'as':'Account','foreignKey':_0x4535('0x1b8')});db[_0x4535('0xcb')][_0x4535('0x113')](db['ServicenowField'],{'as':_0x4535('0x1bd'),'foreignKey':'SubjectId'});db[_0x4535('0xcb')][_0x4535('0x113')](db[_0x4535('0xcb')],{'as':_0x4535('0x1be'),'foreignKey':'DescriptionId'});db[_0x4535('0xcb')][_0x4535('0x113')](db[_0x4535('0xcb')],{'as':_0x4535('0x1bf'),'foreignKey':_0x4535('0x1bc')});db[_0x4535('0xcb')][_0x4535('0x147')](db[_0x4535('0x95')],{'as':_0x4535('0x95'),'foreignKey':'VariableId'});db['Dynamics365Account']['hasMany'](db[_0x4535('0x1c9')],{'as':_0x4535('0x1b7'),'onDelete':'cascade','foreignKey':_0x4535('0x1b8')});db['Dynamics365Configuration'][_0x4535('0x113')](db[_0x4535('0xce')],{'as':_0x4535('0x1c4'),'onDelete':_0x4535('0x110'),'foreignKey':'SubjectId'});db[_0x4535('0x1c9')]['hasMany'](db[_0x4535('0xce')],{'as':_0x4535('0x1ba'),'onDelete':_0x4535('0x110'),'foreignKey':'DescriptionId'});db[_0x4535('0x1c9')][_0x4535('0x113')](db['Dynamics365Field'],{'as':'Fields','onDelete':_0x4535('0x110'),'foreignKey':_0x4535('0x1bc')});db['Dynamics365Configuration'][_0x4535('0x147')](db[_0x4535('0x1ca')],{'as':_0x4535('0x167'),'foreignKey':_0x4535('0x1b8')});db['Dynamics365Field']['hasMany'](db[_0x4535('0xce')],{'as':'Subject','foreignKey':_0x4535('0x1b9')});db[_0x4535('0xce')][_0x4535('0x113')](db[_0x4535('0xce')],{'as':'Description','foreignKey':_0x4535('0x1bb')});db[_0x4535('0xce')][_0x4535('0x113')](db[_0x4535('0xce')],{'as':_0x4535('0x1bf'),'foreignKey':'FieldId'});db[_0x4535('0xce')][_0x4535('0x147')](db[_0x4535('0x95')],{'as':_0x4535('0x95'),'foreignKey':_0x4535('0x1c0')});db['FreshsalesAccount'][_0x4535('0x113')](db[_0x4535('0xd1')],{'as':_0x4535('0x1b7'),'onDelete':_0x4535('0x110'),'foreignKey':'AccountId'});db[_0x4535('0xd1')]['hasMany'](db[_0x4535('0xd3')],{'as':_0x4535('0x1c4'),'foreignKey':_0x4535('0x1b9')});db['FreshsalesConfiguration'][_0x4535('0x113')](db[_0x4535('0xd3')],{'as':_0x4535('0x1ba'),'foreignKey':'DescriptionId'});db[_0x4535('0xd1')][_0x4535('0x113')](db[_0x4535('0xd3')],{'as':_0x4535('0x1b5'),'foreignKey':_0x4535('0x1bc')});db[_0x4535('0xd1')][_0x4535('0x147')](db[_0x4535('0xcf')],{'as':_0x4535('0x167'),'foreignKey':_0x4535('0x1b8')});db[_0x4535('0xd3')][_0x4535('0x113')](db['FreshsalesField'],{'as':_0x4535('0x1bd'),'foreignKey':'SubjectId'});db[_0x4535('0xd3')][_0x4535('0x113')](db[_0x4535('0xd3')],{'as':'Description','foreignKey':_0x4535('0x1bb')});db['FreshsalesField']['hasMany'](db[_0x4535('0xd3')],{'as':'Field','foreignKey':_0x4535('0x1bc')});db['FreshsalesField'][_0x4535('0x147')](db[_0x4535('0x95')],{'as':_0x4535('0x95'),'foreignKey':_0x4535('0x1c0')});db['ChatQueueReport']['belongsTo'](db[_0x4535('0x65')],{});db['ChatQueueReport'][_0x4535('0x147')](db[_0x4535('0x130')],{'as':_0x4535('0x160'),'foreignKey':_0x4535('0x161')});db[_0x4535('0xd6')][_0x4535('0x147')](db[_0x4535('0x74')],{'as':_0x4535('0x157'),'foreignKey':_0x4535('0x158')});db[_0x4535('0xd6')][_0x4535('0x147')](db[_0x4535('0x68')],{});db[_0x4535('0xd6')][_0x4535('0x147')](db[_0x4535('0x69')],{});db['ChatQueueReport']['belongsTo'](db[_0x4535('0x12')],{});db[_0x4535('0xd6')]['belongsTo'](db[_0x4535('0x6d')],{});db[_0x4535('0xd8')]['belongsTo'](db[_0x4535('0x12')],{'onDelete':_0x4535('0x110'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0x4535('0x147')](db[_0x4535('0x12')],{'onDelete':_0x4535('0x110'),'foreignKey':_0x4535('0x1cb')});db[_0x4535('0xdd')][_0x4535('0x113')](db[_0x4535('0xdb')],{'foreignKey':'SessionId','onDelete':'cascade'});db['JscriptySessionReport'][_0x4535('0x113')](db[_0x4535('0xd9')],{'foreignKey':_0x4535('0x1cc'),'onDelete':_0x4535('0x110')});db[_0x4535('0xdf')][_0x4535('0x147')](db[_0x4535('0x138')],{});db['SmsQueueReport'][_0x4535('0x147')](db['CmList'],{'as':_0x4535('0x160'),'foreignKey':_0x4535('0x161')});db[_0x4535('0xdf')][_0x4535('0x147')](db[_0x4535('0x74')],{'as':'Contact','foreignKey':'ContactId'});db[_0x4535('0xdf')][_0x4535('0x147')](db[_0x4535('0x58')],{});db['SmsQueueReport'][_0x4535('0x147')](db[_0x4535('0x59')],{});db['SmsQueueReport'][_0x4535('0x147')](db[_0x4535('0x12')],{});db[_0x4535('0xdf')][_0x4535('0x147')](db['SmsQueue'],{});db['JscriptyProject'][_0x4535('0x113')](db[_0x4535('0xdd')],{'foreignKey':'ProjectId'});db['JscriptyProject'][_0x4535('0x113')](db['JscriptyQuestionReport'],{'foreignKey':_0x4535('0x1cd')});db[_0x4535('0x1ce')][_0x4535('0x113')](db[_0x4535('0xd9')],{'foreignKey':'ProjectId'});db[_0x4535('0xe6')][_0x4535('0x11a')](db['User'],{'as':_0x4535('0x16d'),'through':_0x4535('0x13d')});db['Team'][_0x4535('0x11a')](db[_0x4535('0x12')],{'as':'Agents','through':_0x4535('0x120')});db[_0x4535('0x11f')][_0x4535('0x11a')](db[_0x4535('0x1b')],{'through':_0x4535('0x10c'),'as':_0x4535('0x129')});db[_0x4535('0x11f')][_0x4535('0x11a')](db[_0x4535('0x3f')],{'through':_0x4535('0x1cf'),'as':'MailQueues'});db[_0x4535('0x11f')][_0x4535('0x11a')](db[_0x4535('0x6d')],{'through':_0x4535('0x18f'),'as':'ChatQueues'});db[_0x4535('0x11f')][_0x4535('0x11a')](db[_0x4535('0x52')],{'through':_0x4535('0x179'),'as':_0x4535('0x12c')});db[_0x4535('0x11f')][_0x4535('0x11a')](db[_0x4535('0x5b')],{'through':_0x4535('0x180'),'as':_0x4535('0x1d0')});db[_0x4535('0x11f')][_0x4535('0x11a')](db[_0x4535('0x64')],{'through':_0x4535('0x1d1'),'as':_0x4535('0x12e')});db['Team']['belongsToMany'](db[_0x4535('0x107')],{'through':_0x4535('0x1d2'),'as':_0x4535('0x12f')});db[_0x4535('0x199')][_0x4535('0x113')](db[_0x4535('0x76')],{'as':_0x4535('0x143'),'foreignKey':_0x4535('0x19a')});db[_0x4535('0x199')][_0x4535('0x113')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x4535('0x19a')});db[_0x4535('0x199')][_0x4535('0x113')](db[_0x4535('0x7c')],{'as':'HopperHistories','foreignKey':'CampaignId'});db[_0x4535('0x199')]['hasMany'](db[_0x4535('0x78')],{'as':_0x4535('0x145'),'foreignKey':_0x4535('0x19a')});db[_0x4535('0x199')][_0x4535('0x147')](db[_0x4535('0x2a')],{'as':_0x4535('0x2a'),'foreignKey':_0x4535('0x148')});db[_0x4535('0x199')][_0x4535('0x147')](db[_0x4535('0x2a')],{'as':_0x4535('0x149'),'foreignKey':'TrunkBackupId'});db['Campaign'][_0x4535('0x147')](db[_0x4535('0x85')],{'as':'Interval','foreignKey':_0x4535('0x14b')});db['Campaign'][_0x4535('0x147')](db[_0x4535('0xe6')],{'as':_0x4535('0xe6'),'foreignKey':_0x4535('0x1d3')});db['Campaign'][_0x4535('0x11a')](db[_0x4535('0x130')],{'as':_0x4535('0x1d4'),'through':_0x4535('0x1d5')});db[_0x4535('0x199')][_0x4535('0x11a')](db[_0x4535('0x130')],{'as':_0x4535('0x1d6'),'through':_0x4535('0x1d7')});db['Attachment']['belongsTo'](db[_0x4535('0x6b')],{'as':_0x4535('0x6b'),'foreignKey':'ChatOfflineMessageId'});db['MailTransferReport'][_0x4535('0x147')](db['MailMessage'],{});db[_0x4535('0xf1')][_0x4535('0x147')](db[_0x4535('0x42')],{});db[_0x4535('0xf1')]['belongsTo'](db[_0x4535('0x3d')],{'foreignKey':_0x4535('0x1d8'),'as':_0x4535('0x1d9')});db[_0x4535('0xf1')]['belongsTo'](db[_0x4535('0x12')],{'foreignKey':_0x4535('0x1da'),'as':_0x4535('0x1db')});db[_0x4535('0xf1')][_0x4535('0x147')](db[_0x4535('0x12')],{'foreignKey':_0x4535('0x1dc'),'as':_0x4535('0x1dd')});db[_0x4535('0xf1')][_0x4535('0x147')](db[_0x4535('0x3f')],{'foreignKey':_0x4535('0x1de'),'as':'ToQueue'});db[_0x4535('0xf1')][_0x4535('0x147')](db[_0x4535('0x3d')],{'foreignKey':'ToMailAccountId','as':_0x4535('0x1df')});db[_0x4535('0x1e0')][_0x4535('0x147')](db[_0x4535('0x69')],{});db[_0x4535('0x1e0')]['belongsTo'](db[_0x4535('0x68')],{});db[_0x4535('0x1e0')][_0x4535('0x147')](db[_0x4535('0x65')],{'foreignKey':_0x4535('0x1e1'),'as':_0x4535('0x1d9')});db[_0x4535('0x1e0')][_0x4535('0x147')](db[_0x4535('0x12')],{'foreignKey':'FromUserId','as':_0x4535('0x1db')});db['ChatTransferReport'][_0x4535('0x147')](db[_0x4535('0x12')],{'foreignKey':_0x4535('0x1dc'),'as':'ToAgent'});db[_0x4535('0x1e0')][_0x4535('0x147')](db[_0x4535('0x6d')],{'foreignKey':_0x4535('0x1e2'),'as':'ToQueue'});db['ChatTransferReport'][_0x4535('0x147')](db[_0x4535('0x65')],{'foreignKey':'ToChatWebsiteId','as':'ToAccount'});db[_0x4535('0xf3')][_0x4535('0x147')](db[_0x4535('0x175')],{});db[_0x4535('0xf3')][_0x4535('0x147')](db[_0x4535('0x4f')],{});db[_0x4535('0xf3')][_0x4535('0x147')](db[_0x4535('0x4b')],{'foreignKey':_0x4535('0x1e3'),'as':'FromAccount'});db['FaxTransferReport'][_0x4535('0x147')](db[_0x4535('0x12')],{'foreignKey':_0x4535('0x1da'),'as':_0x4535('0x1db')});db['FaxTransferReport'][_0x4535('0x147')](db[_0x4535('0x12')],{'foreignKey':_0x4535('0x1dc'),'as':_0x4535('0x1dd')});db['FaxTransferReport'][_0x4535('0x147')](db['FaxQueue'],{'foreignKey':_0x4535('0x1e4'),'as':'ToQueue'});db[_0x4535('0xf3')][_0x4535('0x147')](db[_0x4535('0x4b')],{'foreignKey':_0x4535('0x1e5'),'as':_0x4535('0x1df')});db[_0x4535('0xf5')][_0x4535('0x147')](db[_0x4535('0x183')],{});db[_0x4535('0xf5')][_0x4535('0x147')](db[_0x4535('0x61')],{});db['OpenchannelTransferReport'][_0x4535('0x147')](db[_0x4535('0x5d')],{'foreignKey':_0x4535('0x1e6'),'as':_0x4535('0x1d9')});db[_0x4535('0xf5')][_0x4535('0x147')](db[_0x4535('0x12')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x4535('0xf5')][_0x4535('0x147')](db[_0x4535('0x12')],{'foreignKey':_0x4535('0x1dc'),'as':_0x4535('0x1dd')});db['OpenchannelTransferReport']['belongsTo'](db[_0x4535('0x64')],{'foreignKey':_0x4535('0x1e7'),'as':_0x4535('0x1e8')});db[_0x4535('0xf5')][_0x4535('0x147')](db[_0x4535('0x5d')],{'foreignKey':_0x4535('0x1e9'),'as':_0x4535('0x1df')});db[_0x4535('0xf7')][_0x4535('0x147')](db['SmsMessage'],{});db[_0x4535('0xf7')][_0x4535('0x147')](db[_0x4535('0x58')],{});db['SmsTransferReport'][_0x4535('0x147')](db[_0x4535('0x138')],{'foreignKey':_0x4535('0x1ea'),'as':'FromAccount'});db['SmsTransferReport'][_0x4535('0x147')](db['User'],{'foreignKey':_0x4535('0x1da'),'as':'FromAgent'});db['SmsTransferReport'][_0x4535('0x147')](db[_0x4535('0x12')],{'foreignKey':_0x4535('0x1dc'),'as':_0x4535('0x1dd')});db[_0x4535('0xf7')][_0x4535('0x147')](db[_0x4535('0x5b')],{'foreignKey':_0x4535('0x1eb'),'as':_0x4535('0x1e8')});db['SmsTransferReport'][_0x4535('0x147')](db[_0x4535('0x138')],{'foreignKey':_0x4535('0x1ec'),'as':_0x4535('0x1df')});db['CmList'][_0x4535('0x113')](db[_0x4535('0x82')],{'as':'Dispositions','foreignKey':_0x4535('0x161'),'onDelete':'cascade'});db[_0x4535('0x130')]['hasMany'](db['CmCustomField'],{'as':_0x4535('0x1ed'),'foreignKey':_0x4535('0x161')});db[_0x4535('0x130')][_0x4535('0x113')](db[_0x4535('0x74')],{'as':'Contacts','onDelete':_0x4535('0x110'),'foreignKey':_0x4535('0x161')});db[_0x4535('0x130')][_0x4535('0x113')](db['CmHopperFinal'],{'as':_0x4535('0x114'),'foreignKey':_0x4535('0x161')});db[_0x4535('0x130')][_0x4535('0x113')](db[_0x4535('0x7c')],{'as':_0x4535('0x115'),'foreignKey':_0x4535('0x161')});db['CmList']['hasMany'](db[_0x4535('0x7d')],{'as':_0x4535('0x7d'),'foreignKey':_0x4535('0x161')});db[_0x4535('0x130')][_0x4535('0x11a')](db['VoiceQueue'],{'as':'Queues','through':_0x4535('0x14e')});db[_0x4535('0x130')][_0x4535('0x11a')](db[_0x4535('0x12')],{'as':_0x4535('0x14f'),'through':'cm_user_has_lists'});db[_0x4535('0xf9')][_0x4535('0x113')](db[_0x4535('0x18')],{'as':_0x4535('0x1a6'),'onDelete':_0x4535('0x110')});db[_0x4535('0xf9')][_0x4535('0x11a')](db['User'],{'as':_0x4535('0x14f'),'through':_0x4535('0x131')});db[_0x4535('0xfb')]['hasMany'](db[_0x4535('0x12')],{'as':_0x4535('0x16d'),'foreignKey':_0x4535('0x1ee')});db[_0x4535('0xfb')]['hasMany'](db[_0x4535('0x1ef')],{'as':_0x4535('0x1f0'),'foreignKey':_0x4535('0x1ee'),'onDelete':_0x4535('0x110')});db[_0x4535('0x1ef')][_0x4535('0x113')](db['UserProfileResource'],{'as':_0x4535('0x1f1'),'foreignKey':_0x4535('0x1f2'),'onDelete':_0x4535('0x110')});db[_0x4535('0x1f3')][_0x4535('0x113')](db['Disposition'],{'as':_0x4535('0x17a'),'foreignKey':_0x4535('0x1f4'),'onDelete':_0x4535('0x110')});db[_0x4535('0x1f3')][_0x4535('0x113')](db[_0x4535('0x81')],{'as':_0x4535('0x182'),'foreignKey':_0x4535('0x1f4')});db[_0x4535('0x1f3')][_0x4535('0x113')](db[_0x4535('0x102')],{'as':'Messages','foreignKey':'WhatsappAccountId'});db[_0x4535('0x1f3')][_0x4535('0x113')](db[_0x4535('0x100')],{'as':_0x4535('0x15d')});db[_0x4535('0x1f3')][_0x4535('0x113')](db[_0x4535('0x1f5')],{'as':'Applications'});db[_0x4535('0x1f3')][_0x4535('0x147')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x4535('0x1f3')]['belongsTo'](db[_0x4535('0x87')],{'as':_0x4535('0x14c'),'foreignKey':_0x4535('0x14d')});db[_0x4535('0x1f3')][_0x4535('0x11a')](db[_0x4535('0x12')],{'as':'Agents','through':'user_has_whatsapp_accounts'});db[_0x4535('0x1f5')][_0x4535('0x147')](db[_0x4535('0x12')],{'onDelete':_0x4535('0x171')});db[_0x4535('0x1f5')]['belongsTo'](db[_0x4535('0x107')],{'onDelete':_0x4535('0x171')});db[_0x4535('0x1f5')][_0x4535('0x147')](db[_0x4535('0x1f3')],{'onDelete':'restrict'});db['WhatsappApplication']['belongsTo'](db[_0x4535('0x85')],{'onDelete':'restrict','foreignKey':_0x4535('0x14b')});db[_0x4535('0x1f5')][_0x4535('0x147')](db[_0x4535('0x16b')],{'onDelete':_0x4535('0x171'),'foreignKey':'TagId'});db[_0x4535('0x100')]['hasMany'](db[_0x4535('0x102')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x4535('0x1f6')});db[_0x4535('0x100')][_0x4535('0x147')](db[_0x4535('0x1f3')],{'as':_0x4535('0x167'),'foreignKey':_0x4535('0x1f4')});db['WhatsappInteraction'][_0x4535('0x147')](db[_0x4535('0x74')],{'as':'Contact','foreignKey':_0x4535('0x158')});db[_0x4535('0x100')][_0x4535('0x147')](db[_0x4535('0x12')],{'as':'Owner','foreignKey':_0x4535('0x111')});db['WhatsappInteraction']['belongsToMany'](db[_0x4535('0x16b')],{'through':_0x4535('0x1ac'),'as':'Tags'});db[_0x4535('0x100')][_0x4535('0x11a')](db[_0x4535('0x16b')],{'through':_0x4535('0x1ac'),'as':_0x4535('0x16c')});db['WhatsappInteraction']['belongsToMany'](db[_0x4535('0x12')],{'as':_0x4535('0x16d'),'through':_0x4535('0x128'),'foreignKey':_0x4535('0x1f6')});db[_0x4535('0x102')][_0x4535('0x147')](db[_0x4535('0x12')],{'as':_0x4535('0x12')});db[_0x4535('0x102')][_0x4535('0x147')](db[_0x4535('0x74')],{'onDelete':'cascade','as':_0x4535('0x157')});db[_0x4535('0x102')][_0x4535('0x147')](db['WhatsappInteraction'],{'onDelete':_0x4535('0x110'),'as':_0x4535('0x16e'),'foreignKey':_0x4535('0x1f6')});db[_0x4535('0x102')][_0x4535('0x147')](db[_0x4535('0x1f3')],{'as':'Account','foreignKey':_0x4535('0x1f4')});db[_0x4535('0x104')][_0x4535('0x147')](db[_0x4535('0x1f3')],{});db[_0x4535('0x104')][_0x4535('0x147')](db[_0x4535('0x130')],{'as':_0x4535('0x160'),'foreignKey':'ListId'});db[_0x4535('0x104')]['belongsTo'](db[_0x4535('0x74')],{'as':_0x4535('0x157'),'foreignKey':_0x4535('0x158')});db['WhatsappQueueReport'][_0x4535('0x147')](db[_0x4535('0x100')],{});db[_0x4535('0x104')]['belongsTo'](db['WhatsappQueue'],{});db[_0x4535('0x104')]['belongsTo'](db['WhatsappMessage'],{});db[_0x4535('0x104')][_0x4535('0x147')](db[_0x4535('0x12')],{});db[_0x4535('0x1f7')]['belongsTo'](db[_0x4535('0x102')],{});db[_0x4535('0x1f7')][_0x4535('0x147')](db[_0x4535('0x100')],{});db[_0x4535('0x1f7')][_0x4535('0x147')](db['WhatsappAccount'],{'foreignKey':'FromWhatsappAccountId','as':'FromAccount'});db[_0x4535('0x1f7')][_0x4535('0x147')](db[_0x4535('0x1f3')],{'foreignKey':_0x4535('0x1f8'),'as':_0x4535('0x1df')});db[_0x4535('0x1f7')][_0x4535('0x147')](db[_0x4535('0x107')],{'foreignKey':_0x4535('0x1f9'),'as':'ToQueue'});db[_0x4535('0x1f7')][_0x4535('0x147')](db[_0x4535('0x12')],{'foreignKey':'FromUserId','as':_0x4535('0x1db')});db[_0x4535('0x1f7')][_0x4535('0x147')](db[_0x4535('0x12')],{'foreignKey':_0x4535('0x1dc'),'as':_0x4535('0x1dd')});db[_0x4535('0x107')]['belongsToMany'](db[_0x4535('0x12')],{'as':_0x4535('0x14f'),'through':_0x4535('0x38'),'foreignKey':_0x4535('0x1fa')});db[_0x4535('0x107')][_0x4535('0x11a')](db[_0x4535('0x11f')],{'through':'team_has_whatsapp_queues','as':_0x4535('0x165')});module[_0x4535('0x1fb')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xeb7c=['../api/squareMessage/squareMessage.model','License','../api/license/license.model','../api/campaign/campaign.model','Migration','Attachment','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserNotification','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','WhatsappInteraction','WhatsappMessage','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/realtime/realtime.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','hasOne','cascade','UserId','hasMany','Extensions','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','UserNotifications','SenderId','belongsTo','userProfileId','Groups','chat_group_has_users','belongsToMany','CmContact','Contacts','cm_user_has_contacts','CmList','Lists','cm_user_has_lists','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','WhatsappInteractions','user_has_whatsapp_interactions','VoiceQueues','MailQueues','ChatQueues','FaxQueues','OpenchannelQueues','VoicePrefixes','user_has_voice_prefixes','ChatWebsite','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccount','WhatsappAccounts','SquareProjects','user_has_square_projects','VoiceChanSpy','SpiedAgents','Applications','Members','VoiceQueueId','Hoppers','HopperFinals','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','mandatoryDispositionPause','Agents','Team','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','VoiceCallReport','VoiceQueueReport','QueueCalls','uniqueid','ContactId','MailAccountId','Smtp','Dispositions','Answers','Interactions','List','ListId','TemplateId','user_has_mail_accounts','MailQueue','team_has_mail_queues','Account','Owner','mail_interaction_has_tags','Tags','ThroughTags','MailInteractionId','Contact','Interaction','ChatWebsiteId','ChatOfflineMessageId','restrict','IntervalId','DashboardItem','FaxAccountId','CannedAnswer','mandatoryDispositionPauseId','FaxApplication','TagId','fax_interaction_has_tags','FaxInteractionId','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','Users','SmsQueueId','SmsQueue','team_has_sms_queues','OpenchannelAccountId','OpenchannelApplication','OpenchannelQueue','OpenchannelQueueId','openchannel_interaction_has_tags','OpenchannelInteractionId','team_has_openchannel_queues','ProactiveActions','ChatMessage','Queue','Website','chat_interaction_has_tags','ChatInteractionId','Attachments','team_has_chat_queues','ChatGroupId','CompanyId','Phones','CmContactId','HopperHistories','Company','cm_contact_has_tags','AdditionalPhones','CmHopperId','Agent','Campaign','CampaignId','OwnerId','Automation','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','ParentId','Intervals','MailApplications','FaxApplications','DefaultReportId','moh_has_sounds','whatsapp_interaction_has_tags','ItemTypeId','Hopper','Trigger','AllConditions','AllCondition','TriggerAllId','AnyCondition','TriggerAnyId','TriggerId','Fields','MetricId','SalesforceField','Subjects','SubjectId','Descriptions','DescriptionId','SalesforceAccount','AccountId','Subject','Description','Field','VariableId','Configurations','FieldId','int_desk_configuration_has_tags','ZohoField','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','FreshsalesAccount','ToId','SessionId','ProjectId','SmsQueues','team_has_whatsapp_queues','WhatsappQueues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToAccount','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','voice_queues_has_cm_lists','UserProfileSections','UserProfileResource','Resources','sectionId','WhatsappAccountId','user_has_whatsapp_accounts','WhatsappApplication','WhatsappInteractionId','WhatsappQueueReport','FromWhatsappAccountId','WhatsappQueueId','path','sequelize','lodash','defaultsDeep','motion2','xC@LL1234','utf8_general_ci','sequelizeHistory','xcall','mysql','utf8mb4','name','database','username','password','User','import','../api/user/user.model','VoiceContext','VoiceExtension','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','VoiceRecording','ScreenRecording','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','MailInteraction','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','Dashboard','FaxAccount','../api/faxAccount/faxAccount.model','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','FaxQueue','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','../api/chatInteraction/chatInteraction.model','../api/chatMessage/chatMessage.model','ChatOfflineMessage','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../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','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/template/template.model','../api/trigger/trigger.model','Variable','../api/variable/variable.model','../api/integration/integration.model','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticTreeReport/analyticTreeReport.model','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','SugarcrmField','DeskAccount','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Integration','Network','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage'];(function(_0x54cdde,_0x25089c){var _0x15e6dc=function(_0x232a5e){while(--_0x232a5e){_0x54cdde['push'](_0x54cdde['shift']());}};_0x15e6dc(++_0x25089c);}(_0xeb7c,0x10c));var _0xceb7=function(_0x47d858,_0x154933){_0x47d858=_0x47d858-0x0;var _0x1d46de=_0xeb7c[_0x47d858];return _0x1d46de;};'use strict';var path=require(_0xceb7('0x0'));var config=require('../config/environment');var Sequelize=require(_0xceb7('0x1'));var _=require(_0xceb7('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config['sequelize']=_[_0xceb7('0x3')](config[_0xceb7('0x1')],{'database':_0xceb7('0x4'),'username':'xcall','password':_0xceb7('0x5'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':'utf8','collate':_0xceb7('0x6')}}});config[_0xceb7('0x7')]=_[_0xceb7('0x3')](config['sequelizeHistory'],{'database':_0xceb7('0x4'),'username':_0xceb7('0x8'),'password':_0xceb7('0x5'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xceb7('0x9'),'dialectOptions':{'charset':_0xceb7('0xa')},'logging':![],'timezone':timezone[_0xceb7('0xb')](),'define':{'charset':'utf8','collate':_0xceb7('0x6')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xceb7('0x1')][_0xceb7('0xc')],config[_0xceb7('0x1')][_0xceb7('0xd')],config['sequelize'][_0xceb7('0xe')],config[_0xceb7('0x1')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xceb7('0x7')]['database'],config['sequelizeHistory'][_0xceb7('0xd')],config[_0xceb7('0x7')][_0xceb7('0xe')],config[_0xceb7('0x7')]['options'])};db[_0xceb7('0xf')]=db['sequelize'][_0xceb7('0x10')](_0xceb7('0x11'));db['VoiceChanSpy']=db['sequelize'][_0xceb7('0x10')]('../api/voiceChanSpy/voiceChanSpy.model');db[_0xceb7('0x12')]=db[_0xceb7('0x1')][_0xceb7('0x10')]('../api/voiceContext/voiceContext.model');db[_0xceb7('0x13')]=db['sequelize'][_0xceb7('0x10')]('../api/voiceExtension/voiceExtension.model');db[_0xceb7('0x14')]=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0x15'));db[_0xceb7('0x16')]=db['sequelize'][_0xceb7('0x10')]('../api/voiceQueue/voiceQueue.model');db[_0xceb7('0x17')]=db[_0xceb7('0x1')]['import']('../api/voiceRecording/voiceRecording.model');db[_0xceb7('0x18')]=db[_0xceb7('0x1')][_0xceb7('0x10')]('../api/screenRecording/screenRecording.model');db[_0xceb7('0x19')]=db['sequelize'][_0xceb7('0x10')](_0xceb7('0x1a'));db[_0xceb7('0x1b')]=db['sequelize'][_0xceb7('0x10')]('../api/voiceMailMessage/voiceMailMessage.model');db['VoiceCallReport']=db['sequelize'][_0xceb7('0x10')](_0xceb7('0x1c'));db[_0xceb7('0x1d')]=db['sequelize'][_0xceb7('0x10')](_0xceb7('0x1e'));db[_0xceb7('0x1f')]=db['sequelize'][_0xceb7('0x10')]('../api/voiceAgentReport/voiceAgentReport.model');db['VoiceQueueReport']=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0x20'));db[_0xceb7('0x21')]=db[_0xceb7('0x1')]['import'](_0xceb7('0x22'));db[_0xceb7('0x23')]=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0x24'));db[_0xceb7('0x25')]=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0x26'));db[_0xceb7('0x27')]=db['sequelize'][_0xceb7('0x10')](_0xceb7('0x28'));db[_0xceb7('0x29')]=db[_0xceb7('0x1')]['import'](_0xceb7('0x2a'));db[_0xceb7('0x2b')]=db[_0xceb7('0x1')][_0xceb7('0x10')]('../api/userChatQueue/userChatQueue.model');db[_0xceb7('0x2c')]=db[_0xceb7('0x1')]['import'](_0xceb7('0x2d'));db[_0xceb7('0x2e')]=db[_0xceb7('0x1')]['import'](_0xceb7('0x2f'));db[_0xceb7('0x30')]=db['sequelize'][_0xceb7('0x10')](_0xceb7('0x31'));db[_0xceb7('0x32')]=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0x33'));db[_0xceb7('0x34')]=db['sequelize'][_0xceb7('0x10')]('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0xceb7('0x35')]=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0x36'));db[_0xceb7('0x37')]=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0x38'));db[_0xceb7('0x39')]=db['sequelize'][_0xceb7('0x10')](_0xceb7('0x3a'));db['MailQueue']=db['sequelize'][_0xceb7('0x10')](_0xceb7('0x3b'));db['MailSubstatus']=db[_0xceb7('0x1')][_0xceb7('0x10')]('../api/mailSubstatus/mailSubstatus.model');db[_0xceb7('0x3c')]=db[_0xceb7('0x1')][_0xceb7('0x10')]('../api/mailInteraction/mailInteraction.model');db[_0xceb7('0x3d')]=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0x3e'));db[_0xceb7('0x3f')]=db[_0xceb7('0x1')]['import'](_0xceb7('0x40'));db[_0xceb7('0x41')]=db[_0xceb7('0x1')]['import']('../api/mailQueueReport/mailQueueReport.model');db[_0xceb7('0x42')]=db['sequelize']['import']('../api/dashboard/dashboard.model');db['DashboardItem']=db[_0xceb7('0x1')][_0xceb7('0x10')]('../api/dashboardItem/dashboardItem.model');db[_0xceb7('0x43')]=db['sequelize']['import'](_0xceb7('0x44'));db['FaxApplication']=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0x45'));db[_0xceb7('0x46')]=db[_0xceb7('0x1')]['import'](_0xceb7('0x47'));db[_0xceb7('0x48')]=db[_0xceb7('0x1')]['import']('../api/faxMessage/faxMessage.model');db[_0xceb7('0x49')]=db[_0xceb7('0x1')][_0xceb7('0x10')]('../api/faxQueue/faxQueue.model');db[_0xceb7('0x4a')]=db['sequelize'][_0xceb7('0x10')](_0xceb7('0x4b'));db[_0xceb7('0x4c')]=db[_0xceb7('0x1')][_0xceb7('0x10')]('../api/smsAccount/smsAccount.model');db[_0xceb7('0x4d')]=db[_0xceb7('0x1')]['import'](_0xceb7('0x4e'));db[_0xceb7('0x4f')]=db['sequelize'][_0xceb7('0x10')](_0xceb7('0x50'));db[_0xceb7('0x51')]=db[_0xceb7('0x1')][_0xceb7('0x10')]('../api/smsMessage/smsMessage.model');db['SmsQueue']=db['sequelize']['import'](_0xceb7('0x52'));db[_0xceb7('0x53')]=db[_0xceb7('0x1')]['import'](_0xceb7('0x54'));db['OpenchannelApplication']=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0x55'));db[_0xceb7('0x56')]=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0x57'));db[_0xceb7('0x58')]=db[_0xceb7('0x1')][_0xceb7('0x10')]('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0x59'));db['ChatWebsite']=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0x5a'));db[_0xceb7('0x5b')]=db[_0xceb7('0x1')][_0xceb7('0x10')]('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0xceb7('0x5c')]=db[_0xceb7('0x1')]['import']('../api/chatApplication/chatApplication.model');db[_0xceb7('0x5d')]=db[_0xceb7('0x1')]['import'](_0xceb7('0x5e'));db['ChatMessage']=db[_0xceb7('0x1')]['import'](_0xceb7('0x5f'));db[_0xceb7('0x60')]=db[_0xceb7('0x1')][_0xceb7('0x10')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0xceb7('0x61')]=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0x62'));db[_0xceb7('0x63')]=db[_0xceb7('0x1')]['import']('../api/chatGroup/chatGroup.model');db[_0xceb7('0x64')]=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0x65'));db[_0xceb7('0x66')]=db['sequelize'][_0xceb7('0x10')](_0xceb7('0x67'));db['CmContact']=db[_0xceb7('0x1')][_0xceb7('0x10')]('../api/cmContact/cmContact.model');db[_0xceb7('0x68')]=db[_0xceb7('0x1')]['import'](_0xceb7('0x69'));db[_0xceb7('0x6a')]=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0x6b'));db[_0xceb7('0x6c')]=db[_0xceb7('0x1')]['import'](_0xceb7('0x6d'));db[_0xceb7('0x6e')]=db[_0xceb7('0x1')]['import'](_0xceb7('0x6f'));db[_0xceb7('0x70')]=db['sequelize'][_0xceb7('0x10')](_0xceb7('0x71'));db['CmCustomField']=db['sequelize'][_0xceb7('0x10')](_0xceb7('0x72'));db[_0xceb7('0x73')]=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0x74'));db['Automation']=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0x75'));db['CannedAnswer']=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0x76'));db[_0xceb7('0x77')]=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0x78'));db[_0xceb7('0x79')]=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0x7a'));db[_0xceb7('0x7b')]=db[_0xceb7('0x1')]['import'](_0xceb7('0x7c'));db[_0xceb7('0x7d')]=db[_0xceb7('0x1')]['import'](_0xceb7('0x7e'));db[_0xceb7('0x7f')]=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0x80'));db[_0xceb7('0x81')]=db['sequelize'][_0xceb7('0x10')](_0xceb7('0x82'));db[_0xceb7('0x83')]=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0x84'));db[_0xceb7('0x85')]=db['sequelize'][_0xceb7('0x10')](_0xceb7('0x86'));db[_0xceb7('0x87')]=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0x88'));db[_0xceb7('0x89')]=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0x8a'));db[_0xceb7('0x8b')]=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0x8c'));db[_0xceb7('0x8d')]=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0x8e'));db[_0xceb7('0x8f')]=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0x90'));db['Trigger']=db[_0xceb7('0x1')]['import'](_0xceb7('0x91'));db[_0xceb7('0x92')]=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0x93'));db['Integration']=db[_0xceb7('0x1')]['import'](_0xceb7('0x94'));db['IntegrationReport']=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0x95'));db[_0xceb7('0x96')]=db[_0xceb7('0x1')]['import'](_0xceb7('0x97'));db[_0xceb7('0x98')]=db[_0xceb7('0x1')]['import'](_0xceb7('0x99'));db['AnalyticExtractedReport']=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0x9a'));db[_0xceb7('0x9b')]=db[_0xceb7('0x1')]['import']('../api/analyticMetric/analyticMetric.model');db[_0xceb7('0x9c')]=db[_0xceb7('0x1')][_0xceb7('0x10')]('../api/analyticFieldReport/analyticFieldReport.model');db['AnalyticTreeReport']=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0x9d'));db['SalesforceAccount']=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0x9e'));db[_0xceb7('0x9f')]=db['sequelize'][_0xceb7('0x10')](_0xceb7('0xa0'));db['SalesforceField']=db[_0xceb7('0x1')][_0xceb7('0x10')]('../api/intSalesforceField/intSalesforceField.model');db[_0xceb7('0xa1')]=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0xa2'));db[_0xceb7('0xa3')]=db[_0xceb7('0x1')][_0xceb7('0x10')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0xceb7('0xa4')]=db[_0xceb7('0x1')][_0xceb7('0x10')]('../api/intSugarcrmField/intSugarcrmField.model');db[_0xceb7('0xa5')]=db['sequelize'][_0xceb7('0x10')]('../api/intDeskAccount/intDeskAccount.model');db[_0xceb7('0xa6')]=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0xa7'));db[_0xceb7('0xa8')]=db[_0xceb7('0x1')][_0xceb7('0x10')]('../api/intDeskField/intDeskField.model');db[_0xceb7('0xa9')]=db['sequelize'][_0xceb7('0x10')](_0xceb7('0xaa'));db[_0xceb7('0xab')]=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0xac'));db['ZohoField']=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0xad'));db[_0xceb7('0xae')]=db['sequelize'][_0xceb7('0x10')]('../api/intZendeskAccount/intZendeskAccount.model');db['ZendeskConfiguration']=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0xaf'));db[_0xceb7('0xb0')]=db[_0xceb7('0x1')]['import'](_0xceb7('0xb1'));db['FreshdeskAccount']=db['sequelize'][_0xceb7('0x10')](_0xceb7('0xb2'));db['FreshdeskConfiguration']=db['sequelize']['import']('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0xceb7('0xb3')]=db[_0xceb7('0x1')]['import'](_0xceb7('0xb4'));db[_0xceb7('0xb5')]=db['sequelize']['import'](_0xceb7('0xb6'));db[_0xceb7('0xb7')]=db['sequelize'][_0xceb7('0x10')](_0xceb7('0xb8'));db[_0xceb7('0xb9')]=db[_0xceb7('0x1')][_0xceb7('0x10')]('../api/intVtigerField/intVtigerField.model');db[_0xceb7('0xba')]=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0xbb'));db[_0xceb7('0xbc')]=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0xbd'));db[_0xceb7('0xbe')]=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0xbf'));db[_0xceb7('0xc0')]=db[_0xceb7('0x1')][_0xceb7('0x10')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0xceb7('0xc1')]=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0xc2'));db[_0xceb7('0xc3')]=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0xc4'));db['FreshsalesAccount']=db['sequelize'][_0xceb7('0x10')](_0xceb7('0xc5'));db[_0xceb7('0xc6')]=db['sequelize'][_0xceb7('0x10')](_0xceb7('0xc7'));db[_0xceb7('0xc8')]=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0xc9'));db[_0xceb7('0xca')]=db[_0xceb7('0x1')]['import'](_0xceb7('0x94'));db[_0xceb7('0xcb')]=db['sequelize'][_0xceb7('0x10')]('../api/network/network.model');db[_0xceb7('0xcc')]=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0xcd'));db[_0xceb7('0xce')]=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0xcf'));db[_0xceb7('0xd0')]=db[_0xceb7('0x1')]['import'](_0xceb7('0xd1'));db[_0xceb7('0xd2')]=db['sequelize'][_0xceb7('0x10')](_0xceb7('0xd3'));db[_0xceb7('0xd4')]=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0xd5'));db[_0xceb7('0xd6')]=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0xd7'));db[_0xceb7('0xd8')]=db[_0xceb7('0x1')][_0xceb7('0x10')]('../api/squareReport/squareReport.model');db['SquareDetailsReport']=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0xd9'));db[_0xceb7('0xda')]=db['sequelize']['import'](_0xceb7('0xdb'));db[_0xceb7('0xdc')]=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0xdd'));db['SquareOdbc']=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0xde'));db[_0xceb7('0xdf')]=db['sequelize'][_0xceb7('0x10')](_0xceb7('0xe0'));db[_0xceb7('0xe1')]=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0xe2'));db[_0xceb7('0xe3')]=db[_0xceb7('0x1')]['import'](_0xceb7('0xe4'));db['Team']=db['sequelize'][_0xceb7('0x10')]('../api/team/team.model');db[_0xceb7('0xe5')]=db[_0xceb7('0x1')]['import'](_0xceb7('0xe6'));db['Campaign']=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0xe7'));db[_0xceb7('0xe8')]=db['sequelize'][_0xceb7('0x10')]('../api/migration/migration.model');db[_0xceb7('0xe9')]=db['sequelize'][_0xceb7('0x10')]('../api/attachment/attachment.model');db[_0xceb7('0xea')]=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0xeb'));db[_0xceb7('0xec')]=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0xed'));db[_0xceb7('0xee')]=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0xef'));db[_0xceb7('0xf0')]=db[_0xceb7('0x1')][_0xceb7('0x10')]('../api/faxTransferReport/faxTransferReport.model');db[_0xceb7('0xf1')]=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0xf2'));db[_0xceb7('0xf3')]=db['sequelize'][_0xceb7('0x10')](_0xceb7('0xf4'));db['CmList']=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0xf5'));db[_0xceb7('0xf6')]=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0xf7'));db[_0xceb7('0xf8')]=db[_0xceb7('0x1')][_0xceb7('0x10')]('../api/userProfile/userProfile.model');db[_0xceb7('0xf9')]=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0xfa'));db['UserProfileResource']=db[_0xceb7('0x1')][_0xceb7('0x10')]('../api/userProfileResource/userProfileResource.model');db[_0xceb7('0xfb')]=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0xfc'));db['WhatsappAccount']=db[_0xceb7('0x1')]['import'](_0xceb7('0xfd'));db['WhatsappApplication']=db[_0xceb7('0x1')][_0xceb7('0x10')]('../api/whatsappApplication/whatsappApplication.model');db[_0xceb7('0xfe')]=db[_0xceb7('0x1')][_0xceb7('0x10')]('../api/whatsappInteraction/whatsappInteraction.model');db[_0xceb7('0xff')]=db[_0xceb7('0x1')][_0xceb7('0x10')]('../api/whatsappMessage/whatsappMessage.model');db['WhatsappQueueReport']=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0x100'));db[_0xceb7('0x101')]=db[_0xceb7('0x1')]['import']('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0xceb7('0x102')]=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0x103'));db[_0xceb7('0x104')]=db['sequelize']['import']('../api/cloudProvider/cloudProvider.model');db['Realtime']=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0x105'));db[_0xceb7('0x106')]=db[_0xceb7('0x1')][_0xceb7('0x10')](_0xceb7('0x107'));db[_0xceb7('0xf')][_0xceb7('0x108')](db[_0xceb7('0x19')],{'as':'VoiceMail','onDelete':_0xceb7('0x109'),'foreignKey':_0xceb7('0x10a')});db[_0xceb7('0xf')][_0xceb7('0x10b')](db[_0xceb7('0x17')],{'as':'Recordings','foreignKey':'UserId'});db[_0xceb7('0xf')]['hasMany'](db[_0xceb7('0x27')],{'as':'VoiceQueuesRt','foreignKey':'UserId'});db[_0xceb7('0xf')][_0xceb7('0x10b')](db['VoiceExtension'],{'as':_0xceb7('0x10c'),'onDelete':_0xceb7('0x109'),'hooks':!![]});db[_0xceb7('0xf')][_0xceb7('0x10b')](db[_0xceb7('0x6c')],{'as':'HopperFinals','foreignKey':'UserId'});db[_0xceb7('0xf')][_0xceb7('0x10b')](db['CmHopperHistory'],{'as':_0xceb7('0x10d'),'foreignKey':_0xceb7('0x10a')});db[_0xceb7('0xf')][_0xceb7('0x10b')](db[_0xceb7('0x70')],{'as':'ReportAgentPreview','foreignKey':_0xceb7('0x10a')});db['User'][_0xceb7('0x10b')](db[_0xceb7('0x56')],{'as':_0xceb7('0x10e'),'foreignKey':_0xceb7('0x10a')});db[_0xceb7('0xf')][_0xceb7('0x10b')](db[_0xceb7('0x5d')],{'as':_0xceb7('0x10f'),'foreignKey':_0xceb7('0x10a')});db[_0xceb7('0xf')]['hasMany'](db[_0xceb7('0x4f')],{'as':_0xceb7('0x110'),'foreignKey':_0xceb7('0x10a')});db[_0xceb7('0xf')][_0xceb7('0x10b')](db[_0xceb7('0x46')],{'as':_0xceb7('0x111'),'foreignKey':_0xceb7('0x10a')});db[_0xceb7('0xf')][_0xceb7('0x10b')](db[_0xceb7('0x3c')],{'as':_0xceb7('0x112'),'foreignKey':_0xceb7('0x10a')});db[_0xceb7('0xf')]['hasMany'](db[_0xceb7('0xfe')],{'as':'WhatsappInteractions','foreignKey':_0xceb7('0x10a')});db[_0xceb7('0xf')][_0xceb7('0x10b')](db[_0xceb7('0xfb')],{'as':_0xceb7('0x113'),'foreignKey':_0xceb7('0x114')});db[_0xceb7('0xf')][_0xceb7('0x115')](db[_0xceb7('0xf8')],{'as':'UserProfile','foreignKey':_0xceb7('0x116')});db[_0xceb7('0xf')]['belongsToMany'](db[_0xceb7('0x63')],{'as':_0xceb7('0x117'),'through':_0xceb7('0x118')});db[_0xceb7('0xf')][_0xceb7('0x119')](db[_0xceb7('0x11a')],{'as':_0xceb7('0x11b'),'through':_0xceb7('0x11c')});db[_0xceb7('0xf')][_0xceb7('0x119')](db[_0xceb7('0x11d')],{'as':_0xceb7('0x11e'),'through':_0xceb7('0x11f')});db[_0xceb7('0xf')][_0xceb7('0x119')](db['Team'],{'through':'user_has_teams'});db['User'][_0xceb7('0x119')](db['MailInteraction'],{'as':_0xceb7('0x112'),'through':_0xceb7('0x120')});db[_0xceb7('0xf')][_0xceb7('0x119')](db['ChatInteraction'],{'as':_0xceb7('0x10f'),'through':_0xceb7('0x121')});db[_0xceb7('0xf')][_0xceb7('0x119')](db['FaxInteraction'],{'as':'FaxInteractions','through':_0xceb7('0x122')});db[_0xceb7('0xf')][_0xceb7('0x119')](db['SmsInteraction'],{'as':_0xceb7('0x110'),'through':_0xceb7('0x123')});db[_0xceb7('0xf')][_0xceb7('0x119')](db[_0xceb7('0x56')],{'as':'OpenchannelInteractions','through':_0xceb7('0x124')});db[_0xceb7('0xf')][_0xceb7('0x119')](db['WhatsappInteraction'],{'as':_0xceb7('0x125'),'through':_0xceb7('0x126')});db[_0xceb7('0xf')][_0xceb7('0x119')](db['VoiceQueue'],{'as':_0xceb7('0x127'),'through':_0xceb7('0x29'),'required':![]});db[_0xceb7('0xf')][_0xceb7('0x119')](db['MailQueue'],{'as':_0xceb7('0x128'),'through':_0xceb7('0x2c'),'required':![]});db[_0xceb7('0xf')][_0xceb7('0x119')](db[_0xceb7('0x61')],{'as':_0xceb7('0x129'),'through':_0xceb7('0x2b'),'required':![],'hooks':!![]});db[_0xceb7('0xf')][_0xceb7('0x119')](db['FaxQueue'],{'as':_0xceb7('0x12a'),'through':_0xceb7('0x2e'),'required':![]});db['User']['belongsToMany'](db['SmsQueue'],{'as':'SmsQueues','through':_0xceb7('0x30'),'required':![]});db['User'][_0xceb7('0x119')](db['OpenchannelQueue'],{'as':_0xceb7('0x12b'),'through':_0xceb7('0x32'),'required':![]});db['User'][_0xceb7('0x119')](db[_0xceb7('0x102')],{'as':'WhatsappQueues','through':_0xceb7('0x34'),'required':![]});db['User'][_0xceb7('0x119')](db[_0xceb7('0x11d')],{'through':_0xceb7('0x11f')});db[_0xceb7('0xf')][_0xceb7('0x119')](db[_0xceb7('0xf6')],{'as':_0xceb7('0x12c'),'through':_0xceb7('0x12d'),'required':![]});db[_0xceb7('0xf')][_0xceb7('0x119')](db[_0xceb7('0x12e')],{'as':_0xceb7('0x12f'),'through':_0xceb7('0x130')});db[_0xceb7('0xf')][_0xceb7('0x119')](db[_0xceb7('0x43')],{'as':_0xceb7('0x131'),'through':_0xceb7('0x132')});db['User'][_0xceb7('0x119')](db[_0xceb7('0x39')],{'as':'MailAccounts','through':'user_has_mail_accounts'});db[_0xceb7('0xf')][_0xceb7('0x119')](db['OpenchannelAccount'],{'as':_0xceb7('0x133'),'through':_0xceb7('0x134')});db[_0xceb7('0xf')][_0xceb7('0x119')](db['SmsAccount'],{'as':_0xceb7('0x135'),'through':_0xceb7('0x136')});db['User'][_0xceb7('0x119')](db[_0xceb7('0x137')],{'as':_0xceb7('0x138'),'through':'user_has_whatsapp_accounts'});db[_0xceb7('0xf')]['belongsToMany'](db['SquareProject'],{'as':_0xceb7('0x139'),'through':_0xceb7('0x13a')});db[_0xceb7('0x13b')][_0xceb7('0x10b')](db[_0xceb7('0x13')],{'as':_0xceb7('0x13c'),'onDelete':_0xceb7('0x109'),'foreignKey':'ChanSpyId'});db[_0xceb7('0x12')][_0xceb7('0x10b')](db['VoiceExtension'],{'onDelete':_0xceb7('0x109')});db[_0xceb7('0x13')][_0xceb7('0x10b')](db[_0xceb7('0x13')],{'as':_0xceb7('0x13d'),'onDelete':_0xceb7('0x109')});db[_0xceb7('0x14')]['belongsToMany'](db[_0xceb7('0x85')],{'as':'Sounds','through':'moh_has_sounds'});db[_0xceb7('0x16')][_0xceb7('0x10b')](db['UserVoiceQueueRt'],{'as':_0xceb7('0x13e'),'foreignKey':_0xceb7('0x13f')});db[_0xceb7('0x16')][_0xceb7('0x10b')](db['CmHopper'],{'as':_0xceb7('0x140'),'foreignKey':_0xceb7('0x13f')});db[_0xceb7('0x16')][_0xceb7('0x10b')](db[_0xceb7('0x6c')],{'as':_0xceb7('0x141'),'foreignKey':_0xceb7('0x13f')});db[_0xceb7('0x16')][_0xceb7('0x10b')](db[_0xceb7('0x6e')],{'as':'HopperHistories','foreignKey':_0xceb7('0x13f')});db[_0xceb7('0x16')][_0xceb7('0x10b')](db[_0xceb7('0x70')],{'as':_0xceb7('0x70'),'foreignKey':'VoiceQueueId'});db[_0xceb7('0x16')][_0xceb7('0x10b')](db['CmHopperBlack'],{'as':_0xceb7('0x142'),'foreignKey':_0xceb7('0x13f')});db[_0xceb7('0x16')]['hasMany'](db['JscriptySessionReport'],{'as':_0xceb7('0x143'),'foreignKey':_0xceb7('0x13f')});db['VoiceQueue'][_0xceb7('0x115')](db[_0xceb7('0x23')],{'as':_0xceb7('0x23'),'foreignKey':_0xceb7('0x144')});db['VoiceQueue'][_0xceb7('0x115')](db[_0xceb7('0x23')],{'as':_0xceb7('0x145'),'foreignKey':_0xceb7('0x146')});db[_0xceb7('0x16')][_0xceb7('0x115')](db[_0xceb7('0x7b')],{'as':_0xceb7('0x7b'),'foreignKey':'IntervalId'});db['VoiceQueue'][_0xceb7('0x115')](db[_0xceb7('0x7d')],{'as':_0xceb7('0x147'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xceb7('0x16')][_0xceb7('0x119')](db[_0xceb7('0x11d')],{'as':_0xceb7('0x11e'),'through':'voice_queues_has_cm_lists'});db[_0xceb7('0x16')][_0xceb7('0x119')](db[_0xceb7('0xf')],{'as':_0xceb7('0x148'),'through':_0xceb7('0x29')});db['VoiceQueue'][_0xceb7('0x119')](db[_0xceb7('0x149')],{'as':_0xceb7('0x14a'),'through':'TeamVoiceQueue'});db['VoiceQueue'][_0xceb7('0x119')](db[_0xceb7('0x11d')],{'as':_0xceb7('0x14b'),'through':_0xceb7('0x14c')});db[_0xceb7('0x17')][_0xceb7('0x115')](db[_0xceb7('0xf')],{'as':_0xceb7('0xf'),'foreignKey':_0xceb7('0x10a')});db[_0xceb7('0x18')][_0xceb7('0x115')](db[_0xceb7('0xf')],{'as':_0xceb7('0xf'),'foreignKey':_0xceb7('0x10a')});db[_0xceb7('0x19')]['hasMany'](db['VoiceMailMessage'],{'as':_0xceb7('0x14d'),'onDelete':_0xceb7('0x109'),'foreignKey':'mailboxuser','sourceKey':_0xceb7('0x14e')});db[_0xceb7('0x1b')][_0xceb7('0x115')](db[_0xceb7('0x19')],{'foreignKey':_0xceb7('0x14f'),'targetKey':_0xceb7('0x14e')});db[_0xceb7('0x150')][_0xceb7('0x10b')](db[_0xceb7('0x151')],{'as':_0xceb7('0x152'),'foreignKey':'uniqueid','constraints':![]});db['VoiceCallReport'][_0xceb7('0x10b')](db[_0xceb7('0x1f')],{'as':'AgentReports','foreignKey':_0xceb7('0x153'),'constraints':![]});db['VoiceCallReport'][_0xceb7('0x115')](db['User'],{'as':_0xceb7('0xf'),'foreignKey':_0xceb7('0x10a')});db[_0xceb7('0x150')][_0xceb7('0x115')](db[_0xceb7('0x11a')],{'as':'Contact','foreignKey':_0xceb7('0x154')});db[_0xceb7('0x35')][_0xceb7('0x115')](db['MailAccount'],{'as':'MailAccount','foreignKey':_0xceb7('0x155')});db['MailServerOut'][_0xceb7('0x115')](db['MailAccount'],{'as':_0xceb7('0x39'),'foreignKey':'MailAccountId'});db[_0xceb7('0x39')]['hasOne'](db[_0xceb7('0x35')],{'as':'Imap','onDelete':_0xceb7('0x109')});db[_0xceb7('0x39')][_0xceb7('0x108')](db[_0xceb7('0x37')],{'as':_0xceb7('0x156'),'onDelete':_0xceb7('0x109')});db[_0xceb7('0x39')]['hasMany'](db[_0xceb7('0x77')],{'as':_0xceb7('0x157'),'foreignKey':'MailAccountId','onDelete':_0xceb7('0x109')});db[_0xceb7('0x39')]['hasMany'](db['CannedAnswer'],{'as':_0xceb7('0x158'),'foreignKey':_0xceb7('0x155')});db[_0xceb7('0x39')][_0xceb7('0x10b')](db[_0xceb7('0x3d')],{'as':_0xceb7('0x14d'),'foreignKey':_0xceb7('0x155')});db['MailAccount'][_0xceb7('0x10b')](db['MailInteraction'],{'as':_0xceb7('0x159')});db[_0xceb7('0x39')][_0xceb7('0x10b')](db[_0xceb7('0x3f')],{'as':_0xceb7('0x13d')});db['MailAccount'][_0xceb7('0x115')](db[_0xceb7('0x11d')],{'as':_0xceb7('0x15a'),'foreignKey':_0xceb7('0x15b')});db[_0xceb7('0x39')][_0xceb7('0x115')](db[_0xceb7('0x8f')],{'as':_0xceb7('0x8f'),'foreignKey':_0xceb7('0x15c')});db[_0xceb7('0x39')][_0xceb7('0x115')](db[_0xceb7('0x7d')],{'as':_0xceb7('0x147'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xceb7('0x39')][_0xceb7('0x119')](db['User'],{'as':_0xceb7('0x148'),'through':_0xceb7('0x15d')});db[_0xceb7('0x15e')][_0xceb7('0x119')](db[_0xceb7('0xf')],{'as':_0xceb7('0x148'),'through':_0xceb7('0x2c')});db[_0xceb7('0x15e')][_0xceb7('0x119')](db[_0xceb7('0x149')],{'through':_0xceb7('0x15f'),'as':'Teams'});db[_0xceb7('0x3c')][_0xceb7('0x10b')](db[_0xceb7('0x3d')],{'as':_0xceb7('0x14d'),'onDelete':_0xceb7('0x109'),'foreignKey':'MailInteractionId'});db[_0xceb7('0x3c')][_0xceb7('0x115')](db[_0xceb7('0x39')],{'as':_0xceb7('0x160'),'foreignKey':_0xceb7('0x155')});db['MailInteraction']['belongsTo'](db[_0xceb7('0x11a')],{'as':'Contact','foreignKey':_0xceb7('0x154')});db[_0xceb7('0x3c')][_0xceb7('0x115')](db[_0xceb7('0xf')],{'as':_0xceb7('0x161'),'foreignKey':'UserId'});db[_0xceb7('0x3c')][_0xceb7('0x119')](db[_0xceb7('0x87')],{'through':_0xceb7('0x162'),'as':_0xceb7('0x163')});db[_0xceb7('0x3c')][_0xceb7('0x119')](db[_0xceb7('0x87')],{'through':'mail_interaction_has_tags','as':_0xceb7('0x164')});db['MailInteraction'][_0xceb7('0x119')](db[_0xceb7('0xf')],{'as':'Users','through':_0xceb7('0x120'),'foreignKey':_0xceb7('0x165')});db['MailMessage'][_0xceb7('0x10b')](db['Attachment'],{'as':'Attachments','onDelete':'cascade'});db[_0xceb7('0x3d')][_0xceb7('0x115')](db[_0xceb7('0xf')],{'as':_0xceb7('0xf')});db[_0xceb7('0x3d')]['belongsTo'](db[_0xceb7('0x11a')],{'onDelete':_0xceb7('0x109'),'as':_0xceb7('0x166')});db[_0xceb7('0x3d')][_0xceb7('0x115')](db[_0xceb7('0x3c')],{'as':_0xceb7('0x167'),'foreignKey':_0xceb7('0x165')});db[_0xceb7('0x3d')]['belongsTo'](db[_0xceb7('0x39')],{'as':'Account','foreignKey':'MailAccountId'});db[_0xceb7('0x3d')][_0xceb7('0x115')](db['ChatWebsite'],{'as':_0xceb7('0x12e'),'foreignKey':_0xceb7('0x168')});db['MailMessage'][_0xceb7('0x115')](db['ChatOfflineMessage'],{'as':_0xceb7('0x60'),'foreignKey':_0xceb7('0x169')});db[_0xceb7('0x3f')][_0xceb7('0x115')](db[_0xceb7('0xf')],{'onDelete':_0xceb7('0x16a')});db['MailApplication'][_0xceb7('0x115')](db['MailQueue'],{'onDelete':_0xceb7('0x16a')});db[_0xceb7('0x3f')][_0xceb7('0x115')](db[_0xceb7('0x39')],{'onDelete':_0xceb7('0x16a')});db[_0xceb7('0x3f')][_0xceb7('0x115')](db[_0xceb7('0x7b')],{'onDelete':_0xceb7('0x16a'),'foreignKey':_0xceb7('0x16b')});db['MailApplication'][_0xceb7('0x115')](db[_0xceb7('0x87')],{'onDelete':_0xceb7('0x16a'),'foreignKey':'TagId'});db[_0xceb7('0x41')][_0xceb7('0x115')](db[_0xceb7('0x39')],{});db['MailQueueReport'][_0xceb7('0x115')](db['CmList'],{'as':_0xceb7('0x15a'),'foreignKey':_0xceb7('0x15b')});db['MailQueueReport']['belongsTo'](db[_0xceb7('0x11a')],{'as':_0xceb7('0x166'),'foreignKey':_0xceb7('0x154')});db[_0xceb7('0x41')]['belongsTo'](db[_0xceb7('0x3c')],{});db[_0xceb7('0x41')]['belongsTo'](db[_0xceb7('0x3d')],{});db[_0xceb7('0x41')][_0xceb7('0x115')](db[_0xceb7('0xf')],{});db['MailQueueReport'][_0xceb7('0x115')](db[_0xceb7('0x15e')],{});db[_0xceb7('0x42')][_0xceb7('0x10b')](db[_0xceb7('0x16c')],{'as':'Items','onDelete':_0xceb7('0x109')});db[_0xceb7('0x43')][_0xceb7('0x10b')](db[_0xceb7('0x77')],{'as':'Dispositions','foreignKey':_0xceb7('0x16d'),'onDelete':_0xceb7('0x109')});db['FaxAccount'][_0xceb7('0x10b')](db[_0xceb7('0x16e')],{'as':_0xceb7('0x158'),'foreignKey':_0xceb7('0x16d')});db[_0xceb7('0x43')]['hasMany'](db[_0xceb7('0x46')],{'as':_0xceb7('0x159')});db[_0xceb7('0x43')]['hasMany'](db['FaxApplication'],{'as':'Applications'});db['FaxAccount'][_0xceb7('0x10b')](db['VoiceExtension'],{'as':'Exntensions','onDelete':_0xceb7('0x109')});db[_0xceb7('0x43')][_0xceb7('0x10b')](db[_0xceb7('0x48')],{'as':_0xceb7('0x14d')});db[_0xceb7('0x43')][_0xceb7('0x115')](db['Trunk'],{'as':_0xceb7('0x23')});db[_0xceb7('0x43')]['belongsTo'](db[_0xceb7('0x11d')],{'as':_0xceb7('0x15a'),'foreignKey':_0xceb7('0x15b')});db[_0xceb7('0x43')]['belongsTo'](db[_0xceb7('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0xceb7('0x16f')});db[_0xceb7('0x43')][_0xceb7('0x119')](db['User'],{'as':_0xceb7('0x148'),'through':_0xceb7('0x132')});db['FaxApplication'][_0xceb7('0x115')](db[_0xceb7('0xf')],{'onDelete':_0xceb7('0x16a')});db[_0xceb7('0x170')][_0xceb7('0x115')](db[_0xceb7('0x49')],{'onDelete':_0xceb7('0x16a')});db['FaxApplication'][_0xceb7('0x115')](db[_0xceb7('0x43')],{'onDelete':_0xceb7('0x16a')});db['FaxApplication'][_0xceb7('0x115')](db[_0xceb7('0x87')],{'onDelete':_0xceb7('0x16a'),'foreignKey':_0xceb7('0x171')});db[_0xceb7('0x46')][_0xceb7('0x10b')](db[_0xceb7('0x48')],{'as':_0xceb7('0x14d'),'onDelete':_0xceb7('0x109'),'foreignKey':'FaxInteractionId'});db[_0xceb7('0x46')][_0xceb7('0x115')](db[_0xceb7('0x43')],{'as':'Account','foreignKey':_0xceb7('0x16d')});db[_0xceb7('0x46')][_0xceb7('0x115')](db['CmContact'],{'as':_0xceb7('0x166'),'foreignKey':_0xceb7('0x154')});db['FaxInteraction']['belongsTo'](db['User'],{'as':_0xceb7('0x161'),'foreignKey':_0xceb7('0x10a')});db[_0xceb7('0x46')][_0xceb7('0x119')](db['Tag'],{'through':_0xceb7('0x172'),'as':'Tags'});db[_0xceb7('0x46')][_0xceb7('0x119')](db[_0xceb7('0x87')],{'through':_0xceb7('0x172'),'as':_0xceb7('0x164')});db['FaxInteraction'][_0xceb7('0x119')](db[_0xceb7('0xf')],{'as':'Users','through':'user_has_fax_interactions','foreignKey':_0xceb7('0x173')});db['FaxMessage'][_0xceb7('0x115')](db['User'],{'onDelete':'cascade','as':_0xceb7('0xf')});db['FaxMessage'][_0xceb7('0x115')](db[_0xceb7('0x46')],{'as':_0xceb7('0x167'),'foreignKey':_0xceb7('0x173')});db[_0xceb7('0x48')][_0xceb7('0x115')](db[_0xceb7('0x11a')],{'onDelete':_0xceb7('0x109'),'as':_0xceb7('0x166')});db[_0xceb7('0x48')]['belongsTo'](db['Attachment'],{'as':_0xceb7('0xe9'),'foreignKey':_0xceb7('0x174')});db[_0xceb7('0x48')][_0xceb7('0x115')](db[_0xceb7('0x43')],{'as':'Account','foreignKey':_0xceb7('0x16d')});db[_0xceb7('0x49')]['belongsToMany'](db[_0xceb7('0xf')],{'as':_0xceb7('0x148'),'through':_0xceb7('0x2e')});db[_0xceb7('0x49')]['belongsToMany'](db[_0xceb7('0x149')],{'through':_0xceb7('0x175'),'as':'Teams'});db[_0xceb7('0x4a')][_0xceb7('0x115')](db['FaxAccount'],{});db[_0xceb7('0x4a')][_0xceb7('0x115')](db[_0xceb7('0x11d')],{'as':'List','foreignKey':_0xceb7('0x15b')});db[_0xceb7('0x4a')]['belongsTo'](db[_0xceb7('0x11a')],{'as':_0xceb7('0x166'),'foreignKey':_0xceb7('0x154')});db['FaxQueueReport'][_0xceb7('0x115')](db[_0xceb7('0x46')],{});db[_0xceb7('0x4a')][_0xceb7('0x115')](db['FaxMessage'],{});db[_0xceb7('0x4a')][_0xceb7('0x115')](db['User'],{});db[_0xceb7('0x4a')][_0xceb7('0x115')](db[_0xceb7('0x49')],{});db[_0xceb7('0x4c')][_0xceb7('0x10b')](db[_0xceb7('0x77')],{'as':_0xceb7('0x157'),'foreignKey':_0xceb7('0x176'),'onDelete':_0xceb7('0x109')});db[_0xceb7('0x4c')][_0xceb7('0x10b')](db[_0xceb7('0x16e')],{'as':_0xceb7('0x158'),'foreignKey':_0xceb7('0x176')});db[_0xceb7('0x4c')][_0xceb7('0x10b')](db[_0xceb7('0x51')],{'as':_0xceb7('0x14d'),'foreignKey':_0xceb7('0x176')});db[_0xceb7('0x4c')][_0xceb7('0x10b')](db[_0xceb7('0x4f')],{'as':'Interactions'});db[_0xceb7('0x4c')][_0xceb7('0x10b')](db[_0xceb7('0x4d')],{'as':'Applications'});db[_0xceb7('0x4c')][_0xceb7('0x115')](db['CmList'],{'as':_0xceb7('0x15a'),'foreignKey':_0xceb7('0x15b')});db[_0xceb7('0x4c')][_0xceb7('0x115')](db['Pause'],{'as':_0xceb7('0x147'),'foreignKey':_0xceb7('0x16f')});db['SmsAccount'][_0xceb7('0x119')](db[_0xceb7('0xf')],{'as':_0xceb7('0x148'),'through':_0xceb7('0x136')});db[_0xceb7('0x4d')][_0xceb7('0x115')](db[_0xceb7('0xf')],{'onDelete':'restrict'});db['SmsApplication'][_0xceb7('0x115')](db['SmsQueue'],{'onDelete':'restrict'});db[_0xceb7('0x4d')]['belongsTo'](db[_0xceb7('0x4c')],{'onDelete':'restrict'});db[_0xceb7('0x4d')][_0xceb7('0x115')](db[_0xceb7('0x7b')],{'onDelete':_0xceb7('0x16a'),'foreignKey':'IntervalId'});db[_0xceb7('0x4d')][_0xceb7('0x115')](db[_0xceb7('0x87')],{'onDelete':_0xceb7('0x16a'),'foreignKey':'TagId'});db[_0xceb7('0x4f')][_0xceb7('0x10b')](db[_0xceb7('0x51')],{'as':_0xceb7('0x14d'),'onDelete':_0xceb7('0x109'),'foreignKey':_0xceb7('0x177')});db['SmsInteraction'][_0xceb7('0x115')](db[_0xceb7('0x4c')],{'as':'Account','foreignKey':_0xceb7('0x176')});db[_0xceb7('0x4f')]['belongsTo'](db[_0xceb7('0x11a')],{'as':'Contact','foreignKey':_0xceb7('0x154')});db[_0xceb7('0x4f')][_0xceb7('0x115')](db[_0xceb7('0xf')],{'as':_0xceb7('0x161'),'foreignKey':_0xceb7('0x10a')});db[_0xceb7('0x4f')][_0xceb7('0x119')](db[_0xceb7('0x87')],{'through':_0xceb7('0x178'),'as':_0xceb7('0x163')});db[_0xceb7('0x4f')][_0xceb7('0x119')](db['Tag'],{'through':_0xceb7('0x178'),'as':_0xceb7('0x164')});db[_0xceb7('0x4f')][_0xceb7('0x119')](db[_0xceb7('0xf')],{'as':_0xceb7('0x179'),'through':_0xceb7('0x123'),'foreignKey':_0xceb7('0x177')});db['SmsMessage'][_0xceb7('0x115')](db[_0xceb7('0xf')],{'as':'User'});db[_0xceb7('0x51')][_0xceb7('0x115')](db['CmContact'],{'onDelete':_0xceb7('0x109'),'as':'Contact'});db[_0xceb7('0x51')][_0xceb7('0x115')](db[_0xceb7('0x4f')],{'onDelete':_0xceb7('0x109'),'as':_0xceb7('0x167'),'foreignKey':'SmsInteractionId'});db['SmsMessage'][_0xceb7('0x115')](db[_0xceb7('0x4c')],{'as':_0xceb7('0x160'),'foreignKey':_0xceb7('0x176')});db['SmsQueue'][_0xceb7('0x119')](db[_0xceb7('0xf')],{'as':_0xceb7('0x148'),'through':_0xceb7('0x30'),'foreignKey':_0xceb7('0x17a')});db[_0xceb7('0x17b')]['belongsToMany'](db[_0xceb7('0x149')],{'through':_0xceb7('0x17c'),'as':_0xceb7('0x14a')});db[_0xceb7('0x53')][_0xceb7('0x10b')](db[_0xceb7('0x77')],{'as':_0xceb7('0x157'),'foreignKey':_0xceb7('0x17d'),'onDelete':'cascade'});db[_0xceb7('0x53')]['hasMany'](db['CannedAnswer'],{'as':_0xceb7('0x158'),'foreignKey':_0xceb7('0x17d')});db[_0xceb7('0x53')][_0xceb7('0x10b')](db[_0xceb7('0x56')],{'as':_0xceb7('0x159'),'foreignKey':_0xceb7('0x17d')});db[_0xceb7('0x53')]['hasMany'](db['OpenchannelMessage'],{'as':_0xceb7('0x14d'),'foreignKey':_0xceb7('0x17d')});db[_0xceb7('0x53')][_0xceb7('0x10b')](db[_0xceb7('0x17e')],{'as':_0xceb7('0x13d'),'foreignKey':'OpenchannelAccountId'});db[_0xceb7('0x53')]['belongsTo'](db[_0xceb7('0x11d')],{'as':'List','foreignKey':_0xceb7('0x15b')});db[_0xceb7('0x53')][_0xceb7('0x115')](db[_0xceb7('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0xceb7('0x53')][_0xceb7('0x119')](db[_0xceb7('0xf')],{'as':_0xceb7('0x148'),'through':'user_has_openchannel_accounts'});db[_0xceb7('0x17e')][_0xceb7('0x115')](db[_0xceb7('0xf')],{'onDelete':_0xceb7('0x16a')});db[_0xceb7('0x17e')][_0xceb7('0x115')](db[_0xceb7('0x17f')],{'onDelete':_0xceb7('0x16a'),'foreignKey':_0xceb7('0x180')});db[_0xceb7('0x17e')]['belongsTo'](db[_0xceb7('0x53')],{'onDelete':_0xceb7('0x16a'),'foreignKey':_0xceb7('0x17d')});db[_0xceb7('0x17e')][_0xceb7('0x115')](db[_0xceb7('0x7b')],{'onDelete':_0xceb7('0x16a'),'foreignKey':_0xceb7('0x16b')});db[_0xceb7('0x17e')][_0xceb7('0x115')](db[_0xceb7('0x87')],{'onDelete':'restrict','foreignKey':_0xceb7('0x171')});db[_0xceb7('0x56')]['hasMany'](db[_0xceb7('0x58')],{'as':'Messages','onDelete':_0xceb7('0x109'),'foreignKey':'OpenchannelInteractionId'});db[_0xceb7('0x56')][_0xceb7('0x115')](db[_0xceb7('0x53')],{'as':_0xceb7('0x160'),'foreignKey':_0xceb7('0x17d')});db[_0xceb7('0x56')][_0xceb7('0x115')](db[_0xceb7('0x11a')],{'as':'Contact','foreignKey':_0xceb7('0x154')});db[_0xceb7('0x56')][_0xceb7('0x115')](db[_0xceb7('0xf')],{'as':'Owner','foreignKey':_0xceb7('0x10a')});db[_0xceb7('0x56')][_0xceb7('0x119')](db[_0xceb7('0x87')],{'through':_0xceb7('0x181'),'as':_0xceb7('0x163')});db[_0xceb7('0x56')]['belongsToMany'](db[_0xceb7('0x87')],{'through':_0xceb7('0x181'),'as':'ThroughTags'});db['OpenchannelInteraction']['belongsToMany'](db[_0xceb7('0xf')],{'as':_0xceb7('0x179'),'through':_0xceb7('0x124'),'foreignKey':_0xceb7('0x182')});db['OpenchannelMessage'][_0xceb7('0x115')](db['User'],{'onDelete':_0xceb7('0x109'),'as':_0xceb7('0xf')});db[_0xceb7('0x58')][_0xceb7('0x115')](db[_0xceb7('0x11a')],{'onDelete':_0xceb7('0x109'),'as':_0xceb7('0x166')});db[_0xceb7('0x58')][_0xceb7('0x115')](db[_0xceb7('0x56')],{'onDelete':_0xceb7('0x109'),'as':_0xceb7('0x167'),'foreignKey':_0xceb7('0x182')});db[_0xceb7('0x58')][_0xceb7('0x115')](db[_0xceb7('0xe9')],{'as':_0xceb7('0xe9'),'foreignKey':_0xceb7('0x174')});db[_0xceb7('0x58')][_0xceb7('0x115')](db['OpenchannelAccount'],{'as':_0xceb7('0x160'),'foreignKey':_0xceb7('0x17d')});db[_0xceb7('0x17f')][_0xceb7('0x119')](db[_0xceb7('0xf')],{'as':_0xceb7('0x148'),'through':_0xceb7('0x32'),'foreignKey':'OpenchannelQueueId'});db[_0xceb7('0x17f')]['belongsToMany'](db['Team'],{'through':_0xceb7('0x183'),'as':_0xceb7('0x14a')});db['ChatWebsite'][_0xceb7('0x10b')](db[_0xceb7('0x77')],{'as':'Dispositions','foreignKey':'ChatWebsiteId','onDelete':_0xceb7('0x109')});db['ChatWebsite'][_0xceb7('0x10b')](db[_0xceb7('0x16e')],{'as':_0xceb7('0x158'),'foreignKey':'ChatWebsiteId'});db[_0xceb7('0x12e')]['hasMany'](db['ChatProactiveAction'],{'as':_0xceb7('0x184')});db[_0xceb7('0x12e')]['hasMany'](db['ChatInteraction'],{'as':_0xceb7('0x159')});db['ChatWebsite'][_0xceb7('0x10b')](db[_0xceb7('0x5c')],{'as':_0xceb7('0x13d')});db[_0xceb7('0x12e')][_0xceb7('0x10b')](db[_0xceb7('0x185')],{'as':'Messages'});db[_0xceb7('0x12e')][_0xceb7('0x115')](db['CmList'],{'as':'List','foreignKey':_0xceb7('0x15b')});db[_0xceb7('0x12e')][_0xceb7('0x115')](db['Interval'],{'as':'Interval','foreignKey':'IntervalId'});db['ChatWebsite'][_0xceb7('0x115')](db[_0xceb7('0x39')],{'as':'MailAccount','foreignKey':_0xceb7('0x155')});db[_0xceb7('0x12e')][_0xceb7('0x115')](db[_0xceb7('0x7d')],{'as':_0xceb7('0x147'),'foreignKey':_0xceb7('0x16f')});db[_0xceb7('0x12e')][_0xceb7('0x119')](db['User'],{'as':_0xceb7('0x148'),'through':_0xceb7('0x130')});db[_0xceb7('0x5b')]['belongsTo'](db['OpenchannelAccount'],{});db['OpenchannelQueueReport'][_0xceb7('0x115')](db[_0xceb7('0x11d')],{'as':_0xceb7('0x15a'),'foreignKey':_0xceb7('0x15b')});db[_0xceb7('0x5b')]['belongsTo'](db[_0xceb7('0x11a')],{'as':_0xceb7('0x166'),'foreignKey':'ContactId'});db['OpenchannelQueueReport'][_0xceb7('0x115')](db['OpenchannelInteraction'],{});db[_0xceb7('0x5b')][_0xceb7('0x115')](db[_0xceb7('0x58')],{});db['OpenchannelQueueReport']['belongsTo'](db[_0xceb7('0xf')],{});db[_0xceb7('0x5b')]['belongsTo'](db['OpenchannelQueue'],{});db[_0xceb7('0x5c')]['belongsTo'](db[_0xceb7('0xf')],{'as':'Agent','foreignKey':_0xceb7('0x10a'),'onDelete':_0xceb7('0x16a')});db['ChatApplication'][_0xceb7('0x115')](db[_0xceb7('0x61')],{'as':_0xceb7('0x186'),'foreignKey':'ChatQueueId','onDelete':'restrict'});db[_0xceb7('0x5c')][_0xceb7('0x115')](db['ChatWebsite'],{'as':_0xceb7('0x187'),'foreignKey':'ChatWebsiteId','onDelete':_0xceb7('0x16a')});db['ChatApplication']['belongsTo'](db[_0xceb7('0x87')],{'onDelete':_0xceb7('0x16a'),'foreignKey':_0xceb7('0x171')});db[_0xceb7('0x5d')][_0xceb7('0x10b')](db[_0xceb7('0x185')],{'as':'Messages','onDelete':_0xceb7('0x109'),'foreignKey':'ChatInteractionId'});db['ChatInteraction']['belongsTo'](db['ChatWebsite'],{'as':_0xceb7('0x160'),'foreignKey':_0xceb7('0x168')});db[_0xceb7('0x5d')][_0xceb7('0x115')](db[_0xceb7('0x11a')],{'as':_0xceb7('0x166'),'foreignKey':_0xceb7('0x154')});db[_0xceb7('0x5d')][_0xceb7('0x115')](db[_0xceb7('0xf')],{'as':'Owner','foreignKey':_0xceb7('0x10a')});db[_0xceb7('0x5d')][_0xceb7('0x119')](db[_0xceb7('0x87')],{'through':_0xceb7('0x188'),'as':'Tags'});db[_0xceb7('0x5d')][_0xceb7('0x119')](db[_0xceb7('0x87')],{'through':'chat_interaction_has_tags','as':'ThroughTags'});db[_0xceb7('0x5d')][_0xceb7('0x119')](db['User'],{'as':_0xceb7('0x179'),'through':_0xceb7('0x121'),'foreignKey':_0xceb7('0x189')});db[_0xceb7('0x185')][_0xceb7('0x115')](db[_0xceb7('0xf')],{'onDelete':_0xceb7('0x109'),'as':'User'});db[_0xceb7('0x185')]['belongsTo'](db[_0xceb7('0x11a')],{'onDelete':_0xceb7('0x109'),'as':'Contact','foreignKey':'ContactId'});db[_0xceb7('0x185')][_0xceb7('0x115')](db[_0xceb7('0x5d')],{'onDelete':_0xceb7('0x109'),'as':_0xceb7('0x167'),'foreignKey':_0xceb7('0x189')});db[_0xceb7('0x185')]['belongsTo'](db[_0xceb7('0xe9')],{'as':_0xceb7('0xe9'),'foreignKey':_0xceb7('0x174')});db[_0xceb7('0x185')][_0xceb7('0x115')](db[_0xceb7('0x12e')],{'as':_0xceb7('0x160'),'foreignKey':'ChatWebsiteId'});db[_0xceb7('0x60')][_0xceb7('0x10b')](db[_0xceb7('0xe9')],{'as':_0xceb7('0x18a'),'foreignKey':_0xceb7('0x169'),'onDelete':_0xceb7('0x109'),'hooks':!![]});db[_0xceb7('0x60')][_0xceb7('0x115')](db[_0xceb7('0x11a')],{'onDelete':_0xceb7('0x109'),'as':_0xceb7('0x166'),'foreignKey':_0xceb7('0x154')});db[_0xceb7('0x60')][_0xceb7('0x115')](db[_0xceb7('0x12e')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0xceb7('0x61')][_0xceb7('0x119')](db[_0xceb7('0xf')],{'as':'Agents','through':'UserChatQueue','hooks':!![]});db[_0xceb7('0x61')][_0xceb7('0x119')](db[_0xceb7('0x149')],{'through':_0xceb7('0x18b'),'as':'Teams'});db[_0xceb7('0x63')][_0xceb7('0x10b')](db['ChatInternalMessage'],{'as':_0xceb7('0x14d'),'foreignKey':_0xceb7('0x18c'),'onDelete':'cascade'});db[_0xceb7('0x63')][_0xceb7('0x119')](db['User'],{'as':_0xceb7('0x13e'),'through':'chat_group_has_users'});db[_0xceb7('0x64')]['belongsTo'](db[_0xceb7('0x12e')],{'as':_0xceb7('0x187'),'foreignKey':'ChatWebsiteId'});db['CmCompany'][_0xceb7('0x10b')](db[_0xceb7('0x11a')],{'as':_0xceb7('0x11b'),'foreignKey':_0xceb7('0x18d')});db[_0xceb7('0x11a')]['hasMany'](db[_0xceb7('0x8b')],{'as':_0xceb7('0x18e'),'foreignKey':_0xceb7('0x18f')});db['CmContact'][_0xceb7('0x10b')](db['CmHopper'],{'as':_0xceb7('0x140'),'foreignKey':_0xceb7('0x154')});db[_0xceb7('0x11a')][_0xceb7('0x10b')](db[_0xceb7('0x6c')],{'as':_0xceb7('0x141'),'foreignKey':'ContactId'});db['CmContact'][_0xceb7('0x10b')](db[_0xceb7('0x6e')],{'as':_0xceb7('0x190'),'foreignKey':_0xceb7('0x154')});db['CmContact'][_0xceb7('0x10b')](db['ReportAgentPreview'],{'as':_0xceb7('0x70'),'foreignKey':_0xceb7('0x154')});db[_0xceb7('0x11a')]['hasMany'](db[_0xceb7('0xd4')],{'as':_0xceb7('0x143'),'foreignKey':_0xceb7('0x154')});db[_0xceb7('0x11a')][_0xceb7('0x10b')](db[_0xceb7('0x56')],{'as':_0xceb7('0x10e'),'foreignKey':_0xceb7('0x154'),'onDelete':'restrict'});db['CmContact']['hasMany'](db[_0xceb7('0x5d')],{'as':'ChatInteractions','foreignKey':'ContactId','onDelete':_0xceb7('0x16a')});db[_0xceb7('0x11a')][_0xceb7('0x10b')](db[_0xceb7('0x4f')],{'as':_0xceb7('0x110'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0xceb7('0x11a')][_0xceb7('0x10b')](db[_0xceb7('0x46')],{'as':_0xceb7('0x111'),'foreignKey':_0xceb7('0x154'),'onDelete':_0xceb7('0x16a')});db['CmContact'][_0xceb7('0x10b')](db['MailInteraction'],{'as':_0xceb7('0x112'),'foreignKey':_0xceb7('0x154'),'onDelete':_0xceb7('0x16a')});db[_0xceb7('0x11a')][_0xceb7('0x115')](db[_0xceb7('0x66')],{'as':_0xceb7('0x191'),'foreignKey':_0xceb7('0x18d')});db[_0xceb7('0x11a')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db['CmContact'][_0xceb7('0x119')](db[_0xceb7('0xf')],{'as':'Users','through':_0xceb7('0x11c')});db[_0xceb7('0x11a')][_0xceb7('0x119')](db[_0xceb7('0x87')],{'as':_0xceb7('0x163'),'through':_0xceb7('0x192')});db[_0xceb7('0x11a')][_0xceb7('0x119')](db[_0xceb7('0x87')],{'through':_0xceb7('0x192'),'as':'ThroughTags'});db[_0xceb7('0x68')][_0xceb7('0x10b')](db[_0xceb7('0x8d')],{'as':_0xceb7('0x193'),'foreignKey':_0xceb7('0x194')});db[_0xceb7('0x68')][_0xceb7('0x115')](db[_0xceb7('0x11a')],{'as':_0xceb7('0x166'),'foreignKey':_0xceb7('0x154'),'onDelete':'cascade'});db[_0xceb7('0x68')][_0xceb7('0x115')](db[_0xceb7('0x11d')],{'as':_0xceb7('0x15a'),'foreignKey':_0xceb7('0x15b'),'onDelete':_0xceb7('0x109')});db[_0xceb7('0x68')][_0xceb7('0x115')](db[_0xceb7('0xf')],{'as':_0xceb7('0x195'),'foreignKey':_0xceb7('0x10a')});db[_0xceb7('0x68')][_0xceb7('0x115')](db[_0xceb7('0x16')],{'as':'Queue','foreignKey':_0xceb7('0x13f'),'onDelete':_0xceb7('0x109')});db[_0xceb7('0x68')][_0xceb7('0x115')](db[_0xceb7('0x196')],{'as':_0xceb7('0x196'),'foreignKey':_0xceb7('0x197'),'onDelete':_0xceb7('0x109')});db[_0xceb7('0x68')]['belongsTo'](db[_0xceb7('0xf')],{'as':_0xceb7('0x161'),'foreignKey':_0xceb7('0x198')});db[_0xceb7('0x6a')][_0xceb7('0x115')](db[_0xceb7('0x11a')],{'as':_0xceb7('0x166'),'foreignKey':_0xceb7('0x154'),'onDelete':_0xceb7('0x109')});db[_0xceb7('0x6a')]['belongsTo'](db[_0xceb7('0x11d')],{'as':_0xceb7('0x15a'),'foreignKey':'ListId','onDelete':_0xceb7('0x109')});db['CmHopperBlack'][_0xceb7('0x115')](db['VoiceQueue'],{'as':_0xceb7('0x186'),'foreignKey':_0xceb7('0x13f'),'onDelete':_0xceb7('0x109')});db[_0xceb7('0x6a')]['belongsTo'](db['Campaign'],{'as':'Campaign','foreignKey':'CampaignId','onDelete':_0xceb7('0x109')});db[_0xceb7('0x199')]['hasMany'](db['Condition'],{'as':{'plural':_0xceb7('0x19a'),'singular':_0xceb7('0x19b')},'foreignKey':_0xceb7('0x19c'),'onDelete':_0xceb7('0x109'),'hooks':!![]});db['Automation']['hasMany'](db['Condition'],{'as':{'plural':_0xceb7('0x19d'),'singular':_0xceb7('0x19e')},'foreignKey':_0xceb7('0x19f'),'onDelete':'cascade','hooks':!![]});db['Automation']['hasMany'](db['Action'],{'as':_0xceb7('0x1a0'),'foreignKey':'AutomationId','onDelete':_0xceb7('0x109'),'hooks':!![]});db['Disposition'][_0xceb7('0x10b')](db[_0xceb7('0x77')],{'as':'Dispositions','foreignKey':_0xceb7('0x1a1'),'onDelete':_0xceb7('0x109')});db[_0xceb7('0x7b')][_0xceb7('0x10b')](db[_0xceb7('0x7b')],{'as':_0xceb7('0x1a2'),'foreignKey':'IntervalId','onDelete':_0xceb7('0x109'),'hooks':!![],'required':![]});db[_0xceb7('0x7b')][_0xceb7('0x10b')](db['VoiceExtension'],{'as':'Extensions','foreignKey':'IntervalId','onDelete':_0xceb7('0x16a')});db[_0xceb7('0x7b')][_0xceb7('0x10b')](db['MailApplication'],{'as':_0xceb7('0x1a3'),'foreignKey':_0xceb7('0x16b')});db['Interval'][_0xceb7('0x10b')](db[_0xceb7('0x5c')],{'as':'ChatApplications','foreignKey':'IntervalId'});db[_0xceb7('0x7b')]['hasMany'](db[_0xceb7('0x170')],{'as':_0xceb7('0x1a4'),'foreignKey':_0xceb7('0x16b')});db[_0xceb7('0x7b')][_0xceb7('0x10b')](db[_0xceb7('0x4d')],{'as':'SmsApplications','foreignKey':_0xceb7('0x16b')});db[_0xceb7('0x83')]['belongsTo'](db[_0xceb7('0x39')],{});db[_0xceb7('0x83')][_0xceb7('0x115')](db['AnalyticDefaultReport'],{'foreignKey':_0xceb7('0x1a5')});db[_0xceb7('0x83')][_0xceb7('0x115')](db[_0xceb7('0x96')],{'foreignKey':'CustomReportId'});db[_0xceb7('0x85')][_0xceb7('0x119')](db[_0xceb7('0x14')],{'as':'Mohs','through':_0xceb7('0x1a6'),'onDelete':_0xceb7('0x16a')});db['Tag'][_0xceb7('0x119')](db[_0xceb7('0x11a')],{'through':'cm_contact_has_tags'});db[_0xceb7('0x87')]['belongsToMany'](db['ChatInteraction'],{'through':'chat_interaction_has_tags'});db['Tag'][_0xceb7('0x119')](db[_0xceb7('0x3c')],{'through':_0xceb7('0x162')});db['Tag'][_0xceb7('0x119')](db[_0xceb7('0x4f')],{'through':'sms_interaction_has_tags'});db[_0xceb7('0x87')][_0xceb7('0x119')](db[_0xceb7('0x46')],{'through':_0xceb7('0x172')});db['Tag'][_0xceb7('0x119')](db['OpenchannelInteraction'],{'through':_0xceb7('0x181')});db[_0xceb7('0x87')][_0xceb7('0x119')](db[_0xceb7('0xfe')],{'through':_0xceb7('0x1a7')});db['CmContactHasItem'][_0xceb7('0x115')](db['ContactItemType'],{'as':'ItemType','foreignKey':_0xceb7('0x1a8')});db[_0xceb7('0x8d')]['belongsTo'](db['CmHopper'],{'as':_0xceb7('0x1a9'),'foreignKey':_0xceb7('0x194')});db[_0xceb7('0x1aa')][_0xceb7('0x10b')](db[_0xceb7('0x79')],{'as':{'plural':_0xceb7('0x1ab'),'singular':_0xceb7('0x1ac')},'foreignKey':_0xceb7('0x1ad'),'onDelete':_0xceb7('0x109'),'hooks':!![]});db[_0xceb7('0x1aa')][_0xceb7('0x10b')](db['Condition'],{'as':{'plural':'AnyConditions','singular':_0xceb7('0x1ae')},'foreignKey':_0xceb7('0x1af'),'onDelete':_0xceb7('0x109'),'hooks':!![]});db[_0xceb7('0x1aa')]['hasMany'](db[_0xceb7('0x73')],{'as':'Actions','foreignKey':_0xceb7('0x1b0'),'onDelete':_0xceb7('0x109'),'hooks':!![]});db[_0xceb7('0x96')][_0xceb7('0x10b')](db['AnalyticFieldReport'],{'as':_0xceb7('0x1b1'),'onDelete':_0xceb7('0x109'),'foreignKey':'CustomReportId','hooks':!![]});db[_0xceb7('0x98')][_0xceb7('0x10b')](db[_0xceb7('0x9c')],{'as':_0xceb7('0x1b1'),'onDelete':_0xceb7('0x109'),'foreignKey':_0xceb7('0x1a5')});db[_0xceb7('0x9b')]['hasMany'](db[_0xceb7('0x9c')],{'as':_0xceb7('0x1b1'),'onDelete':_0xceb7('0x109'),'foreignKey':'MetricId'});db[_0xceb7('0x9c')][_0xceb7('0x115')](db[_0xceb7('0x9b')],{'foreignKey':_0xceb7('0x1b2')});db['SalesforceAccount'][_0xceb7('0x10b')](db[_0xceb7('0x9f')],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db[_0xceb7('0x9f')]['hasMany'](db[_0xceb7('0x1b3')],{'as':_0xceb7('0x1b4'),'onDelete':_0xceb7('0x109'),'foreignKey':_0xceb7('0x1b5')});db[_0xceb7('0x9f')][_0xceb7('0x10b')](db['SalesforceField'],{'as':_0xceb7('0x1b6'),'onDelete':_0xceb7('0x109'),'foreignKey':_0xceb7('0x1b7')});db['SalesforceConfiguration'][_0xceb7('0x10b')](db['SalesforceField'],{'as':_0xceb7('0x1b1'),'onDelete':_0xceb7('0x109'),'foreignKey':'FieldId'});db[_0xceb7('0x9f')][_0xceb7('0x115')](db[_0xceb7('0x1b8')],{'as':_0xceb7('0x160'),'foreignKey':_0xceb7('0x1b9')});db[_0xceb7('0x1b3')]['hasMany'](db[_0xceb7('0x1b3')],{'as':_0xceb7('0x1ba'),'foreignKey':_0xceb7('0x1b5')});db['SalesforceField']['hasMany'](db[_0xceb7('0x1b3')],{'as':_0xceb7('0x1bb'),'foreignKey':'DescriptionId'});db[_0xceb7('0x1b3')][_0xceb7('0x10b')](db[_0xceb7('0x1b3')],{'as':_0xceb7('0x1bc'),'foreignKey':'FieldId'});db[_0xceb7('0x1b3')]['belongsTo'](db[_0xceb7('0x92')],{'as':_0xceb7('0x92'),'foreignKey':'VariableId'});db['SugarcrmAccount'][_0xceb7('0x10b')](db[_0xceb7('0xa3')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xceb7('0x1b9')});db['SugarcrmConfiguration'][_0xceb7('0x10b')](db['SugarcrmField'],{'as':'Subjects','onDelete':_0xceb7('0x109'),'foreignKey':'SubjectId'});db[_0xceb7('0xa3')]['hasMany'](db['SugarcrmField'],{'as':_0xceb7('0x1b6'),'onDelete':'cascade','foreignKey':_0xceb7('0x1b7')});db['SugarcrmConfiguration'][_0xceb7('0x10b')](db['SugarcrmField'],{'as':_0xceb7('0x1b1'),'onDelete':_0xceb7('0x109'),'foreignKey':'FieldId'});db[_0xceb7('0xa3')][_0xceb7('0x115')](db['SugarcrmAccount'],{'as':_0xceb7('0x160'),'foreignKey':_0xceb7('0x1b9')});db[_0xceb7('0xa4')][_0xceb7('0x10b')](db[_0xceb7('0xa4')],{'as':_0xceb7('0x1ba'),'foreignKey':'SubjectId'});db[_0xceb7('0xa4')][_0xceb7('0x10b')](db['SugarcrmField'],{'as':_0xceb7('0x1bb'),'foreignKey':_0xceb7('0x1b7')});db[_0xceb7('0xa4')]['hasMany'](db['SugarcrmField'],{'as':_0xceb7('0x1bc'),'foreignKey':'FieldId'});db[_0xceb7('0xa4')][_0xceb7('0x115')](db['Variable'],{'as':_0xceb7('0x92'),'foreignKey':_0xceb7('0x1bd')});db[_0xceb7('0xa5')][_0xceb7('0x10b')](db[_0xceb7('0xa6')],{'as':_0xceb7('0x1be'),'onDelete':_0xceb7('0x109'),'foreignKey':_0xceb7('0x1b9')});db[_0xceb7('0xa6')]['hasMany'](db[_0xceb7('0xa8')],{'as':_0xceb7('0x1b4'),'onDelete':_0xceb7('0x109'),'foreignKey':'SubjectId'});db[_0xceb7('0xa6')]['hasMany'](db['DeskField'],{'as':'Descriptions','onDelete':_0xceb7('0x109'),'foreignKey':_0xceb7('0x1b7')});db[_0xceb7('0xa6')][_0xceb7('0x10b')](db[_0xceb7('0xa8')],{'as':_0xceb7('0x1b1'),'onDelete':_0xceb7('0x109'),'foreignKey':_0xceb7('0x1bf')});db[_0xceb7('0xa6')][_0xceb7('0x115')](db['DeskAccount'],{'as':_0xceb7('0x160'),'foreignKey':_0xceb7('0x1b9')});db[_0xceb7('0xa6')][_0xceb7('0x119')](db['Tag'],{'through':_0xceb7('0x1c0')});db[_0xceb7('0xa8')][_0xceb7('0x10b')](db[_0xceb7('0xa8')],{'as':_0xceb7('0x1ba'),'foreignKey':_0xceb7('0x1b5')});db[_0xceb7('0xa8')]['hasMany'](db[_0xceb7('0xa8')],{'as':_0xceb7('0x1bb'),'foreignKey':_0xceb7('0x1b7')});db['DeskField'][_0xceb7('0x10b')](db['DeskField'],{'as':'Field','foreignKey':'FieldId'});db[_0xceb7('0xa8')][_0xceb7('0x115')](db[_0xceb7('0x92')],{'as':'Variable','foreignKey':_0xceb7('0x1bd')});db['ZohoAccount'][_0xceb7('0x10b')](db['ZohoConfiguration'],{'as':_0xceb7('0x1be'),'onDelete':_0xceb7('0x109'),'foreignKey':'AccountId'});db[_0xceb7('0xab')][_0xceb7('0x10b')](db[_0xceb7('0x1c1')],{'as':_0xceb7('0x1b4'),'onDelete':_0xceb7('0x109'),'foreignKey':'SubjectId'});db['ZohoConfiguration'][_0xceb7('0x10b')](db[_0xceb7('0x1c1')],{'as':_0xceb7('0x1b6'),'onDelete':_0xceb7('0x109'),'foreignKey':_0xceb7('0x1b7')});db['ZohoConfiguration']['hasMany'](db[_0xceb7('0x1c1')],{'as':_0xceb7('0x1b1'),'onDelete':_0xceb7('0x109'),'foreignKey':_0xceb7('0x1bf')});db[_0xceb7('0xab')]['belongsTo'](db[_0xceb7('0xa9')],{'as':_0xceb7('0x160'),'foreignKey':'AccountId'});db[_0xceb7('0x1c1')][_0xceb7('0x10b')](db[_0xceb7('0x1c1')],{'as':_0xceb7('0x1ba'),'foreignKey':_0xceb7('0x1b5')});db[_0xceb7('0x1c1')][_0xceb7('0x10b')](db[_0xceb7('0x1c1')],{'as':_0xceb7('0x1bb'),'foreignKey':'DescriptionId'});db[_0xceb7('0x1c1')][_0xceb7('0x10b')](db[_0xceb7('0x1c1')],{'as':_0xceb7('0x1bc'),'foreignKey':_0xceb7('0x1bf')});db[_0xceb7('0x1c1')]['belongsTo'](db[_0xceb7('0x92')],{'as':_0xceb7('0x92'),'foreignKey':'VariableId'});db[_0xceb7('0xae')]['hasMany'](db[_0xceb7('0x1c2')],{'as':_0xceb7('0x1be'),'onDelete':_0xceb7('0x109'),'foreignKey':'AccountId'});db[_0xceb7('0x1c2')][_0xceb7('0x10b')](db['ZendeskField'],{'as':_0xceb7('0x1b4'),'foreignKey':_0xceb7('0x1b5')});db['ZendeskConfiguration'][_0xceb7('0x10b')](db[_0xceb7('0xb0')],{'as':_0xceb7('0x1b6'),'foreignKey':_0xceb7('0x1b7')});db[_0xceb7('0x1c2')]['hasMany'](db[_0xceb7('0xb0')],{'as':_0xceb7('0x1b1'),'foreignKey':_0xceb7('0x1bf')});db[_0xceb7('0x1c2')][_0xceb7('0x115')](db['ZendeskAccount'],{'as':_0xceb7('0x160'),'foreignKey':_0xceb7('0x1b9')});db[_0xceb7('0x1c2')]['belongsToMany'](db[_0xceb7('0x87')],{'through':_0xceb7('0x1c3')});db[_0xceb7('0xb0')][_0xceb7('0x10b')](db[_0xceb7('0xb0')],{'as':_0xceb7('0x1ba'),'foreignKey':'SubjectId'});db['ZendeskField']['hasMany'](db[_0xceb7('0xb0')],{'as':_0xceb7('0x1bb'),'foreignKey':_0xceb7('0x1b7')});db['ZendeskField'][_0xceb7('0x10b')](db[_0xceb7('0xb0')],{'as':_0xceb7('0x1bc'),'foreignKey':'FieldId'});db[_0xceb7('0xb0')][_0xceb7('0x115')](db[_0xceb7('0x92')],{'as':_0xceb7('0x92'),'foreignKey':'VariableId'});db[_0xceb7('0x1c4')][_0xceb7('0x10b')](db['FreshdeskConfiguration'],{'as':_0xceb7('0x1be'),'onDelete':'cascade','foreignKey':_0xceb7('0x1b9')});db['FreshdeskConfiguration'][_0xceb7('0x10b')](db[_0xceb7('0xb3')],{'as':_0xceb7('0x1b4'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0xceb7('0x1c5')][_0xceb7('0x10b')](db[_0xceb7('0xb3')],{'as':_0xceb7('0x1b6'),'onDelete':_0xceb7('0x109'),'foreignKey':'DescriptionId'});db[_0xceb7('0x1c5')]['hasMany'](db[_0xceb7('0xb3')],{'as':_0xceb7('0x1b1'),'onDelete':_0xceb7('0x109'),'foreignKey':'FieldId'});db[_0xceb7('0x1c5')][_0xceb7('0x115')](db[_0xceb7('0x1c4')],{'as':_0xceb7('0x160'),'foreignKey':'AccountId'});db[_0xceb7('0x1c5')][_0xceb7('0x119')](db[_0xceb7('0x87')],{'through':_0xceb7('0x1c6')});db[_0xceb7('0xb3')][_0xceb7('0x10b')](db[_0xceb7('0xb3')],{'as':_0xceb7('0x1ba'),'foreignKey':_0xceb7('0x1b5')});db['FreshdeskField']['hasMany'](db[_0xceb7('0xb3')],{'as':_0xceb7('0x1bb'),'foreignKey':_0xceb7('0x1b7')});db[_0xceb7('0xb3')][_0xceb7('0x10b')](db[_0xceb7('0xb3')],{'as':'Field','foreignKey':_0xceb7('0x1bf')});db[_0xceb7('0xb3')]['belongsTo'](db['Variable'],{'as':_0xceb7('0x92'),'foreignKey':_0xceb7('0x1bd')});db[_0xceb7('0xb5')][_0xceb7('0x10b')](db[_0xceb7('0xb7')],{'as':_0xceb7('0x1be'),'onDelete':_0xceb7('0x109'),'foreignKey':_0xceb7('0x1b9')});db[_0xceb7('0xb7')][_0xceb7('0x10b')](db[_0xceb7('0xb9')],{'as':_0xceb7('0x1b4'),'foreignKey':_0xceb7('0x1b5')});db[_0xceb7('0xb7')]['hasMany'](db[_0xceb7('0xb9')],{'as':_0xceb7('0x1b6'),'foreignKey':'DescriptionId'});db['VtigerConfiguration'][_0xceb7('0x10b')](db[_0xceb7('0xb9')],{'as':'Fields','foreignKey':_0xceb7('0x1bf')});db[_0xceb7('0xb7')][_0xceb7('0x115')](db[_0xceb7('0xb5')],{'as':_0xceb7('0x160'),'foreignKey':'AccountId'});db[_0xceb7('0xb9')]['hasMany'](db['VtigerField'],{'as':_0xceb7('0x1ba'),'foreignKey':_0xceb7('0x1b5')});db[_0xceb7('0xb9')]['hasMany'](db[_0xceb7('0xb9')],{'as':_0xceb7('0x1bb'),'foreignKey':_0xceb7('0x1b7')});db[_0xceb7('0xb9')][_0xceb7('0x10b')](db[_0xceb7('0xb9')],{'as':_0xceb7('0x1bc'),'foreignKey':_0xceb7('0x1bf')});db[_0xceb7('0xb9')][_0xceb7('0x115')](db[_0xceb7('0x92')],{'as':_0xceb7('0x92'),'foreignKey':_0xceb7('0x1bd')});db['ServicenowAccount'][_0xceb7('0x10b')](db[_0xceb7('0xbc')],{'as':_0xceb7('0x1be'),'onDelete':_0xceb7('0x109'),'foreignKey':_0xceb7('0x1b9')});db[_0xceb7('0xbc')]['hasMany'](db[_0xceb7('0xbe')],{'as':_0xceb7('0x1b4'),'foreignKey':'SubjectId'});db[_0xceb7('0xbc')][_0xceb7('0x10b')](db[_0xceb7('0xbe')],{'as':_0xceb7('0x1b6'),'foreignKey':_0xceb7('0x1b7')});db[_0xceb7('0xbc')][_0xceb7('0x10b')](db[_0xceb7('0xbe')],{'as':'Fields','foreignKey':_0xceb7('0x1bf')});db[_0xceb7('0xbc')][_0xceb7('0x115')](db[_0xceb7('0xba')],{'as':_0xceb7('0x160'),'foreignKey':'AccountId'});db[_0xceb7('0xbe')][_0xceb7('0x10b')](db[_0xceb7('0xbe')],{'as':_0xceb7('0x1ba'),'foreignKey':_0xceb7('0x1b5')});db['ServicenowField']['hasMany'](db[_0xceb7('0xbe')],{'as':_0xceb7('0x1bb'),'foreignKey':_0xceb7('0x1b7')});db['ServicenowField']['hasMany'](db[_0xceb7('0xbe')],{'as':_0xceb7('0x1bc'),'foreignKey':_0xceb7('0x1bf')});db[_0xceb7('0xbe')][_0xceb7('0x115')](db[_0xceb7('0x92')],{'as':_0xceb7('0x92'),'foreignKey':_0xceb7('0x1bd')});db[_0xceb7('0xc0')][_0xceb7('0x10b')](db[_0xceb7('0xc1')],{'as':_0xceb7('0x1be'),'onDelete':_0xceb7('0x109'),'foreignKey':_0xceb7('0x1b9')});db[_0xceb7('0xc1')][_0xceb7('0x10b')](db['Dynamics365Field'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0xceb7('0xc1')][_0xceb7('0x10b')](db[_0xceb7('0xc3')],{'as':'Descriptions','onDelete':_0xceb7('0x109'),'foreignKey':_0xceb7('0x1b7')});db[_0xceb7('0xc1')][_0xceb7('0x10b')](db[_0xceb7('0xc3')],{'as':'Fields','onDelete':'cascade','foreignKey':'FieldId'});db[_0xceb7('0xc1')]['belongsTo'](db['Dynamics365Account'],{'as':_0xceb7('0x160'),'foreignKey':_0xceb7('0x1b9')});db[_0xceb7('0xc3')][_0xceb7('0x10b')](db[_0xceb7('0xc3')],{'as':_0xceb7('0x1ba'),'foreignKey':'SubjectId'});db[_0xceb7('0xc3')]['hasMany'](db[_0xceb7('0xc3')],{'as':_0xceb7('0x1bb'),'foreignKey':_0xceb7('0x1b7')});db[_0xceb7('0xc3')][_0xceb7('0x10b')](db[_0xceb7('0xc3')],{'as':_0xceb7('0x1bc'),'foreignKey':_0xceb7('0x1bf')});db['Dynamics365Field']['belongsTo'](db[_0xceb7('0x92')],{'as':_0xceb7('0x92'),'foreignKey':_0xceb7('0x1bd')});db[_0xceb7('0x1c7')][_0xceb7('0x10b')](db['FreshsalesConfiguration'],{'as':_0xceb7('0x1be'),'onDelete':'cascade','foreignKey':_0xceb7('0x1b9')});db['FreshsalesConfiguration'][_0xceb7('0x10b')](db['FreshsalesField'],{'as':'Subjects','foreignKey':'SubjectId'});db[_0xceb7('0xc6')][_0xceb7('0x10b')](db[_0xceb7('0xc8')],{'as':'Descriptions','foreignKey':_0xceb7('0x1b7')});db[_0xceb7('0xc6')][_0xceb7('0x10b')](db[_0xceb7('0xc8')],{'as':'Fields','foreignKey':'FieldId'});db[_0xceb7('0xc6')][_0xceb7('0x115')](db[_0xceb7('0x1c7')],{'as':'Account','foreignKey':'AccountId'});db['FreshsalesField']['hasMany'](db['FreshsalesField'],{'as':_0xceb7('0x1ba'),'foreignKey':_0xceb7('0x1b5')});db[_0xceb7('0xc8')][_0xceb7('0x10b')](db[_0xceb7('0xc8')],{'as':_0xceb7('0x1bb'),'foreignKey':'DescriptionId'});db['FreshsalesField'][_0xceb7('0x10b')](db[_0xceb7('0xc8')],{'as':_0xceb7('0x1bc'),'foreignKey':_0xceb7('0x1bf')});db[_0xceb7('0xc8')][_0xceb7('0x115')](db[_0xceb7('0x92')],{'as':'Variable','foreignKey':'VariableId'});db[_0xceb7('0xcc')][_0xceb7('0x115')](db['ChatWebsite'],{});db[_0xceb7('0xcc')][_0xceb7('0x115')](db[_0xceb7('0x11d')],{'as':'List','foreignKey':_0xceb7('0x15b')});db['ChatQueueReport'][_0xceb7('0x115')](db[_0xceb7('0x11a')],{'as':_0xceb7('0x166'),'foreignKey':_0xceb7('0x154')});db[_0xceb7('0xcc')]['belongsTo'](db[_0xceb7('0x5d')],{});db[_0xceb7('0xcc')]['belongsTo'](db['ChatMessage'],{});db[_0xceb7('0xcc')][_0xceb7('0x115')](db[_0xceb7('0xf')],{});db[_0xceb7('0xcc')]['belongsTo'](db['ChatQueue'],{});db[_0xceb7('0xce')][_0xceb7('0x115')](db[_0xceb7('0xf')],{'onDelete':_0xceb7('0x109'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0xceb7('0x115')](db['User'],{'onDelete':_0xceb7('0x109'),'foreignKey':_0xceb7('0x1c8')});db[_0xceb7('0xd4')][_0xceb7('0x10b')](db[_0xceb7('0xd2')],{'foreignKey':_0xceb7('0x1c9'),'onDelete':_0xceb7('0x109')});db['JscriptySessionReport'][_0xceb7('0x10b')](db[_0xceb7('0xd0')],{'foreignKey':_0xceb7('0x1c9'),'onDelete':_0xceb7('0x109')});db['SmsQueueReport'][_0xceb7('0x115')](db[_0xceb7('0x4c')],{});db[_0xceb7('0xd6')][_0xceb7('0x115')](db[_0xceb7('0x11d')],{'as':_0xceb7('0x15a'),'foreignKey':_0xceb7('0x15b')});db[_0xceb7('0xd6')][_0xceb7('0x115')](db['CmContact'],{'as':'Contact','foreignKey':_0xceb7('0x154')});db[_0xceb7('0xd6')][_0xceb7('0x115')](db['SmsInteraction'],{});db[_0xceb7('0xd6')]['belongsTo'](db[_0xceb7('0x51')],{});db[_0xceb7('0xd6')][_0xceb7('0x115')](db['User'],{});db[_0xceb7('0xd6')][_0xceb7('0x115')](db[_0xceb7('0x17b')],{});db[_0xceb7('0xda')]['hasMany'](db[_0xceb7('0xd4')],{'foreignKey':_0xceb7('0x1ca')});db['JscriptyProject']['hasMany'](db[_0xceb7('0xd2')],{'foreignKey':_0xceb7('0x1ca')});db[_0xceb7('0xda')][_0xceb7('0x10b')](db['JscriptyAnswerReport'],{'foreignKey':_0xceb7('0x1ca')});db[_0xceb7('0xdf')]['belongsToMany'](db[_0xceb7('0xf')],{'as':'Users','through':_0xceb7('0x13a')});db[_0xceb7('0x149')][_0xceb7('0x119')](db[_0xceb7('0xf')],{'as':_0xceb7('0x148'),'through':'user_has_teams'});db[_0xceb7('0x149')][_0xceb7('0x119')](db[_0xceb7('0x16')],{'through':'TeamVoiceQueue','as':_0xceb7('0x127')});db[_0xceb7('0x149')][_0xceb7('0x119')](db[_0xceb7('0x15e')],{'through':'team_has_mail_queues','as':'MailQueues'});db[_0xceb7('0x149')][_0xceb7('0x119')](db[_0xceb7('0x61')],{'through':_0xceb7('0x18b'),'as':_0xceb7('0x129')});db[_0xceb7('0x149')][_0xceb7('0x119')](db[_0xceb7('0x49')],{'through':_0xceb7('0x175'),'as':_0xceb7('0x12a')});db[_0xceb7('0x149')][_0xceb7('0x119')](db[_0xceb7('0x17b')],{'through':_0xceb7('0x17c'),'as':_0xceb7('0x1cb')});db[_0xceb7('0x149')]['belongsToMany'](db[_0xceb7('0x17f')],{'through':_0xceb7('0x183'),'as':'OpenchannelQueues'});db[_0xceb7('0x149')][_0xceb7('0x119')](db['WhatsappQueue'],{'through':_0xceb7('0x1cc'),'as':_0xceb7('0x1cd')});db['Campaign'][_0xceb7('0x10b')](db[_0xceb7('0x68')],{'as':'Hoppers','foreignKey':_0xceb7('0x197')});db[_0xceb7('0x196')][_0xceb7('0x10b')](db[_0xceb7('0x6c')],{'as':'HopperFinals','foreignKey':'CampaignId'});db['Campaign'][_0xceb7('0x10b')](db[_0xceb7('0x6e')],{'as':_0xceb7('0x190'),'foreignKey':_0xceb7('0x197')});db[_0xceb7('0x196')]['hasMany'](db[_0xceb7('0x6a')],{'as':'HopperBlacks','foreignKey':_0xceb7('0x197')});db[_0xceb7('0x196')][_0xceb7('0x115')](db['Trunk'],{'as':_0xceb7('0x23'),'foreignKey':'TrunkId'});db['Campaign'][_0xceb7('0x115')](db[_0xceb7('0x23')],{'as':_0xceb7('0x145'),'foreignKey':'TrunkBackupId'});db[_0xceb7('0x196')][_0xceb7('0x115')](db[_0xceb7('0x7b')],{'as':_0xceb7('0x7b'),'foreignKey':'IntervalId'});db[_0xceb7('0x196')][_0xceb7('0x115')](db[_0xceb7('0xdf')],{'as':_0xceb7('0xdf'),'foreignKey':_0xceb7('0x1ce')});db[_0xceb7('0x196')][_0xceb7('0x119')](db[_0xceb7('0x11d')],{'as':_0xceb7('0x11e'),'through':_0xceb7('0x1cf')});db[_0xceb7('0x196')][_0xceb7('0x119')](db[_0xceb7('0x11d')],{'as':_0xceb7('0x14b'),'through':_0xceb7('0x1d0')});db['Attachment'][_0xceb7('0x115')](db[_0xceb7('0x60')],{'as':_0xceb7('0x60'),'foreignKey':_0xceb7('0x169')});db[_0xceb7('0xec')][_0xceb7('0x115')](db[_0xceb7('0x3d')],{});db['MailTransferReport'][_0xceb7('0x115')](db[_0xceb7('0x3c')],{});db['MailTransferReport']['belongsTo'](db['MailAccount'],{'foreignKey':_0xceb7('0x1d1'),'as':_0xceb7('0x1d2')});db[_0xceb7('0xec')]['belongsTo'](db[_0xceb7('0xf')],{'foreignKey':_0xceb7('0x1d3'),'as':_0xceb7('0x1d4')});db[_0xceb7('0xec')][_0xceb7('0x115')](db[_0xceb7('0xf')],{'foreignKey':_0xceb7('0x1d5'),'as':_0xceb7('0x1d6')});db[_0xceb7('0xec')][_0xceb7('0x115')](db[_0xceb7('0x15e')],{'foreignKey':_0xceb7('0x1d7'),'as':_0xceb7('0x1d8')});db[_0xceb7('0xec')]['belongsTo'](db[_0xceb7('0x39')],{'foreignKey':'ToMailAccountId','as':_0xceb7('0x1d9')});db[_0xceb7('0xee')][_0xceb7('0x115')](db[_0xceb7('0x185')],{});db[_0xceb7('0xee')][_0xceb7('0x115')](db[_0xceb7('0x5d')],{});db[_0xceb7('0xee')][_0xceb7('0x115')](db[_0xceb7('0x12e')],{'foreignKey':'FromChatWebsiteId','as':_0xceb7('0x1d2')});db[_0xceb7('0xee')][_0xceb7('0x115')](db[_0xceb7('0xf')],{'foreignKey':_0xceb7('0x1d3'),'as':_0xceb7('0x1d4')});db[_0xceb7('0xee')][_0xceb7('0x115')](db[_0xceb7('0xf')],{'foreignKey':_0xceb7('0x1d5'),'as':_0xceb7('0x1d6')});db[_0xceb7('0xee')]['belongsTo'](db[_0xceb7('0x61')],{'foreignKey':'ToChatQueueId','as':_0xceb7('0x1d8')});db[_0xceb7('0xee')][_0xceb7('0x115')](db[_0xceb7('0x12e')],{'foreignKey':_0xceb7('0x1da'),'as':_0xceb7('0x1d9')});db[_0xceb7('0xf0')][_0xceb7('0x115')](db[_0xceb7('0x48')],{});db['FaxTransferReport']['belongsTo'](db['FaxInteraction'],{});db[_0xceb7('0xf0')]['belongsTo'](db['FaxAccount'],{'foreignKey':_0xceb7('0x1db'),'as':'FromAccount'});db[_0xceb7('0xf0')][_0xceb7('0x115')](db[_0xceb7('0xf')],{'foreignKey':_0xceb7('0x1d3'),'as':_0xceb7('0x1d4')});db[_0xceb7('0xf0')][_0xceb7('0x115')](db['User'],{'foreignKey':_0xceb7('0x1d5'),'as':_0xceb7('0x1d6')});db[_0xceb7('0xf0')][_0xceb7('0x115')](db[_0xceb7('0x49')],{'foreignKey':_0xceb7('0x1dc'),'as':_0xceb7('0x1d8')});db[_0xceb7('0xf0')][_0xceb7('0x115')](db[_0xceb7('0x43')],{'foreignKey':_0xceb7('0x1dd'),'as':_0xceb7('0x1d9')});db['OpenchannelTransferReport'][_0xceb7('0x115')](db['OpenchannelMessage'],{});db['OpenchannelTransferReport']['belongsTo'](db[_0xceb7('0x56')],{});db[_0xceb7('0xf1')][_0xceb7('0x115')](db[_0xceb7('0x53')],{'foreignKey':_0xceb7('0x1de'),'as':_0xceb7('0x1d2')});db[_0xceb7('0xf1')][_0xceb7('0x115')](db[_0xceb7('0xf')],{'foreignKey':_0xceb7('0x1d3'),'as':'FromAgent'});db['OpenchannelTransferReport'][_0xceb7('0x115')](db[_0xceb7('0xf')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0xceb7('0xf1')][_0xceb7('0x115')](db['OpenchannelQueue'],{'foreignKey':'ToOpenchannelQueueId','as':_0xceb7('0x1d8')});db[_0xceb7('0xf1')][_0xceb7('0x115')](db[_0xceb7('0x53')],{'foreignKey':_0xceb7('0x1df'),'as':'ToAccount'});db[_0xceb7('0xf3')][_0xceb7('0x115')](db[_0xceb7('0x51')],{});db[_0xceb7('0xf3')]['belongsTo'](db[_0xceb7('0x4f')],{});db[_0xceb7('0xf3')]['belongsTo'](db[_0xceb7('0x4c')],{'foreignKey':'FromSmsAccountId','as':_0xceb7('0x1d2')});db['SmsTransferReport'][_0xceb7('0x115')](db[_0xceb7('0xf')],{'foreignKey':_0xceb7('0x1d3'),'as':_0xceb7('0x1d4')});db[_0xceb7('0xf3')][_0xceb7('0x115')](db[_0xceb7('0xf')],{'foreignKey':_0xceb7('0x1d5'),'as':'ToAgent'});db[_0xceb7('0xf3')]['belongsTo'](db[_0xceb7('0x17b')],{'foreignKey':_0xceb7('0x1e0'),'as':_0xceb7('0x1d8')});db[_0xceb7('0xf3')][_0xceb7('0x115')](db['SmsAccount'],{'foreignKey':_0xceb7('0x1e1'),'as':_0xceb7('0x1d9')});db[_0xceb7('0x11d')][_0xceb7('0x10b')](db['Disposition'],{'as':_0xceb7('0x157'),'foreignKey':_0xceb7('0x15b'),'onDelete':_0xceb7('0x109')});db['CmList'][_0xceb7('0x10b')](db['CmCustomField'],{'as':_0xceb7('0x1e2'),'foreignKey':_0xceb7('0x15b')});db[_0xceb7('0x11d')][_0xceb7('0x10b')](db[_0xceb7('0x11a')],{'as':_0xceb7('0x11b'),'onDelete':_0xceb7('0x109'),'foreignKey':_0xceb7('0x15b')});db[_0xceb7('0x11d')]['hasMany'](db[_0xceb7('0x6c')],{'as':_0xceb7('0x141'),'foreignKey':_0xceb7('0x15b')});db['CmList'][_0xceb7('0x10b')](db[_0xceb7('0x6e')],{'as':'HopperHistory','foreignKey':_0xceb7('0x15b')});db[_0xceb7('0x11d')][_0xceb7('0x10b')](db[_0xceb7('0x70')],{'as':_0xceb7('0x70'),'foreignKey':'ListId'});db['CmList']['belongsToMany'](db['VoiceQueue'],{'as':_0xceb7('0x1e3'),'through':_0xceb7('0x1e4')});db[_0xceb7('0x11d')]['belongsToMany'](db[_0xceb7('0xf')],{'as':_0xceb7('0x148'),'through':'cm_user_has_lists'});db[_0xceb7('0xf6')][_0xceb7('0x10b')](db[_0xceb7('0x13')],{'as':_0xceb7('0x10c'),'onDelete':'cascade'});db[_0xceb7('0xf6')][_0xceb7('0x119')](db[_0xceb7('0xf')],{'as':'Agents','through':'user_has_voice_prefixes'});db[_0xceb7('0xf8')]['hasMany'](db[_0xceb7('0xf')],{'as':_0xceb7('0x179'),'foreignKey':_0xceb7('0x116')});db[_0xceb7('0xf8')]['hasMany'](db[_0xceb7('0xf9')],{'as':_0xceb7('0x1e5'),'foreignKey':_0xceb7('0x116'),'onDelete':_0xceb7('0x109')});db[_0xceb7('0xf9')]['hasMany'](db[_0xceb7('0x1e6')],{'as':_0xceb7('0x1e7'),'foreignKey':_0xceb7('0x1e8'),'onDelete':'cascade'});db[_0xceb7('0x137')]['hasMany'](db[_0xceb7('0x77')],{'as':_0xceb7('0x157'),'foreignKey':_0xceb7('0x1e9'),'onDelete':'cascade'});db[_0xceb7('0x137')]['hasMany'](db[_0xceb7('0x16e')],{'as':_0xceb7('0x158'),'foreignKey':_0xceb7('0x1e9')});db[_0xceb7('0x137')][_0xceb7('0x10b')](db[_0xceb7('0xff')],{'as':_0xceb7('0x14d'),'foreignKey':'WhatsappAccountId'});db['WhatsappAccount'][_0xceb7('0x10b')](db[_0xceb7('0xfe')],{'as':'Interactions'});db[_0xceb7('0x137')][_0xceb7('0x10b')](db['WhatsappApplication'],{'as':_0xceb7('0x13d')});db[_0xceb7('0x137')]['belongsTo'](db[_0xceb7('0x11d')],{'as':'List','foreignKey':_0xceb7('0x15b')});db[_0xceb7('0x137')]['belongsTo'](db[_0xceb7('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0xceb7('0x16f')});db[_0xceb7('0x137')][_0xceb7('0x119')](db[_0xceb7('0xf')],{'as':_0xceb7('0x148'),'through':_0xceb7('0x1ea')});db['WhatsappApplication'][_0xceb7('0x115')](db[_0xceb7('0xf')],{'onDelete':_0xceb7('0x16a')});db[_0xceb7('0x1eb')][_0xceb7('0x115')](db[_0xceb7('0x102')],{'onDelete':'restrict'});db[_0xceb7('0x1eb')][_0xceb7('0x115')](db['WhatsappAccount'],{'onDelete':'restrict'});db[_0xceb7('0x1eb')][_0xceb7('0x115')](db['Interval'],{'onDelete':_0xceb7('0x16a'),'foreignKey':_0xceb7('0x16b')});db[_0xceb7('0x1eb')][_0xceb7('0x115')](db[_0xceb7('0x87')],{'onDelete':_0xceb7('0x16a'),'foreignKey':_0xceb7('0x171')});db['WhatsappInteraction'][_0xceb7('0x10b')](db[_0xceb7('0xff')],{'as':_0xceb7('0x14d'),'onDelete':_0xceb7('0x109'),'foreignKey':_0xceb7('0x1ec')});db[_0xceb7('0xfe')][_0xceb7('0x115')](db[_0xceb7('0x137')],{'as':'Account','foreignKey':'WhatsappAccountId'});db[_0xceb7('0xfe')][_0xceb7('0x115')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db['WhatsappInteraction'][_0xceb7('0x115')](db['User'],{'as':'Owner','foreignKey':_0xceb7('0x10a')});db[_0xceb7('0xfe')][_0xceb7('0x119')](db[_0xceb7('0x87')],{'through':_0xceb7('0x1a7'),'as':_0xceb7('0x163')});db['WhatsappInteraction'][_0xceb7('0x119')](db[_0xceb7('0x87')],{'through':_0xceb7('0x1a7'),'as':_0xceb7('0x164')});db['WhatsappInteraction'][_0xceb7('0x119')](db[_0xceb7('0xf')],{'as':_0xceb7('0x179'),'through':'user_has_whatsapp_interactions','foreignKey':_0xceb7('0x1ec')});db[_0xceb7('0xff')][_0xceb7('0x115')](db[_0xceb7('0xf')],{'as':_0xceb7('0xf')});db[_0xceb7('0xff')][_0xceb7('0x115')](db[_0xceb7('0x11a')],{'onDelete':'cascade','as':'Contact'});db['WhatsappMessage'][_0xceb7('0x115')](db[_0xceb7('0xfe')],{'onDelete':'cascade','as':_0xceb7('0x167'),'foreignKey':_0xceb7('0x1ec')});db['WhatsappMessage']['belongsTo'](db[_0xceb7('0x137')],{'as':'Account','foreignKey':_0xceb7('0x1e9')});db[_0xceb7('0x1ed')][_0xceb7('0x115')](db[_0xceb7('0x137')],{});db['WhatsappQueueReport'][_0xceb7('0x115')](db[_0xceb7('0x11d')],{'as':_0xceb7('0x15a'),'foreignKey':_0xceb7('0x15b')});db[_0xceb7('0x1ed')][_0xceb7('0x115')](db[_0xceb7('0x11a')],{'as':_0xceb7('0x166'),'foreignKey':'ContactId'});db[_0xceb7('0x1ed')][_0xceb7('0x115')](db[_0xceb7('0xfe')],{});db['WhatsappQueueReport']['belongsTo'](db[_0xceb7('0x102')],{});db[_0xceb7('0x1ed')][_0xceb7('0x115')](db['WhatsappMessage'],{});db[_0xceb7('0x1ed')][_0xceb7('0x115')](db[_0xceb7('0xf')],{});db['WhatsappTransferReport']['belongsTo'](db[_0xceb7('0xff')],{});db['WhatsappTransferReport'][_0xceb7('0x115')](db[_0xceb7('0xfe')],{});db[_0xceb7('0x101')][_0xceb7('0x115')](db[_0xceb7('0x137')],{'foreignKey':_0xceb7('0x1ee'),'as':_0xceb7('0x1d2')});db[_0xceb7('0x101')][_0xceb7('0x115')](db['WhatsappAccount'],{'foreignKey':'ToWhatsappAccountId','as':'ToAccount'});db[_0xceb7('0x101')][_0xceb7('0x115')](db[_0xceb7('0x102')],{'foreignKey':'ToQueueId','as':'ToQueue'});db[_0xceb7('0x101')][_0xceb7('0x115')](db[_0xceb7('0xf')],{'foreignKey':_0xceb7('0x1d3'),'as':'FromAgent'});db[_0xceb7('0x101')][_0xceb7('0x115')](db[_0xceb7('0xf')],{'foreignKey':_0xceb7('0x1d5'),'as':'ToAgent'});db[_0xceb7('0x102')][_0xceb7('0x119')](db[_0xceb7('0xf')],{'as':'Agents','through':_0xceb7('0x34'),'foreignKey':_0xceb7('0x1ef')});db[_0xceb7('0x102')]['belongsToMany'](db['Team'],{'through':'team_has_whatsapp_queues','as':'Teams'});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 0e2452f..ebfbad2 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x94d1=['/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','./api/jscriptyProject','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','./api/squareMessage','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','./api/migration','./api/attachment','/api/plugins','/api/mail/reports/transfer','./api/mailTransferReport','./api/chatTransferReport','/api/fax/reports/transfer','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','./api/userNotification','./api/whatsappAccount','/api/whatsapp/applications','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/auth/local','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','/api/rpc','/api/version','./api/version','/api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/apidoc','static','join','root','/www','/demo','/snippet','snippet','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','username','password','newPassword','lastName','street','mobile','fax','email','clientId','clientSecret','securityToken','code','accessKey','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerSecret','membername','exten','clientEmail','privateKey','accesskeyid','key','pass','accountSid','localstationid','dsn','secret','isPlainObject','isArray','length','isString','@@{','}@@','replace','includes','lodash','path','express','util','./errors','api','./config/logger','auth','default','use','logger','isEmpty','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','user','name','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','responseTime','device','other','agent_id','agent_name','test','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/fax/accounts','./api/faxAccount','/api/fax/applications','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/sms/accounts','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','./api/openchannelMessage','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','/api/chat/offline_messages','./api/chatOfflineMessage','./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/cm/hopper_black','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','./api/disposition','/api/conditions','./api/condition','/api/intervals','/api/pauses','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','/api/sounds','./api/sound','./api/tag','/api/contact_item_types','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','./api/intSalesforceConfiguration','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration'];(function(_0x54d2e,_0x38a3bc){var _0x1ee7e9=function(_0xe8f238){while(--_0xe8f238){_0x54d2e['push'](_0x54d2e['shift']());}};_0x1ee7e9(++_0x38a3bc);}(_0x94d1,0x1e5));var _0x194d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x94d1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x194d('0x0'));var path=require(_0x194d('0x1'));var express=require(_0x194d('0x2'));var ewinston=require('express-winston');var util=require(_0x194d('0x3'));var errors=require(_0x194d('0x4'));var config=require('./config/environment');var logger=require('./config/logger')(_0x194d('0x5'));var authLogger=require(_0x194d('0x6'))(_0x194d('0x7'));exports[_0x194d('0x8')]=function(_0x34ff43){_0x34ff43[_0x194d('0x9')](ewinston[_0x194d('0xa')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x18988a,_0x5b0115){var _0x21b0cf='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0x194d('0xb')](_0x18988a[_0x194d('0xc')])){_0x21b0cf+=_0x194d('0xd');var _0xf70dd=_0x18988a[_0x194d('0xc')];maskSensitiveData(_0xf70dd);}return util[_0x194d('0xe')](_0x21b0cf,_0x18988a[_0x194d('0xf')],_0x18988a[_0x194d('0x10')][_0x194d('0x11')]?_0x18988a[_0x194d('0x10')][_0x194d('0x11')]:_0x18988a[_0x194d('0x12')][_0x194d('0x13')]||_0x18988a['ip'],_0x18988a[_0x194d('0x14')],_0x5b0115[_0x194d('0x15')],_0x5b0115['responseTime'],_0x18988a[_0x194d('0x16')]?_0x18988a[_0x194d('0x16')]['id']:null,_0x18988a[_0x194d('0x16')]?_0x18988a[_0x194d('0x16')][_0x194d('0x17')]:null,_0x18988a[_0x194d('0x16')]?_0x18988a[_0x194d('0x16')]['role']:null,_0xf70dd?util[_0x194d('0x18')](_0xf70dd,![],null):'');}}));_0x34ff43[_0x194d('0x9')](ewinston['logger']({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x21823f,_0x280e9c){var _0x1a14fe='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x21823f['body']&&_0x21823f['body']['device']&&_0x21823f['body']['agent_id']){_0x1a14fe=_0x194d('0x19');}return util[_0x194d('0xe')](_0x1a14fe,_0x21823f[_0x194d('0xf')],_0x21823f[_0x194d('0x10')][_0x194d('0x11')]?_0x21823f['headers']['x-forwarded-for']:_0x21823f[_0x194d('0x12')][_0x194d('0x13')]||_0x21823f['ip'],_0x21823f['url'],_0x280e9c[_0x194d('0x15')],_0x280e9c[_0x194d('0x1a')],_0x21823f[_0x194d('0x16')]?_0x21823f[_0x194d('0x16')]['id']:null,_0x21823f[_0x194d('0x16')]?_0x21823f[_0x194d('0x16')][_0x194d('0x17')]:null,_0x21823f['user']?_0x21823f[_0x194d('0x16')]['role']:null,_0x21823f[_0x194d('0xc')]&&_0x21823f['body'][_0x194d('0x1b')]?_0x21823f['body'][_0x194d('0x1b')]:_0x194d('0x1c'),_0x21823f[_0x194d('0xc')]&&_0x21823f['body'][_0x194d('0x1d')]?_0x21823f[_0x194d('0xc')][_0x194d('0x1d')]:'',_0x21823f[_0x194d('0xc')]&&_0x21823f['body']['agent_name']?_0x21823f[_0x194d('0xc')][_0x194d('0x1e')]:'');},'ignoreRoute':function(_0x39f87f){var _0x2f93a2=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x2f93a2[_0x194d('0x1f')](_0x39f87f[_0x194d('0x14')]);}}));_0x34ff43['use']('/api/users',require(_0x194d('0x20')));_0x34ff43[_0x194d('0x9')](_0x194d('0x21'),require(_0x194d('0x22')));_0x34ff43[_0x194d('0x9')](_0x194d('0x23'),require(_0x194d('0x24')));_0x34ff43[_0x194d('0x9')](_0x194d('0x25'),require(_0x194d('0x26')));_0x34ff43[_0x194d('0x9')]('/api/voice/mohs',require(_0x194d('0x27')));_0x34ff43[_0x194d('0x9')](_0x194d('0x28'),require('./api/voiceQueue'));_0x34ff43[_0x194d('0x9')]('/api/voice/recordings',require(_0x194d('0x29')));_0x34ff43[_0x194d('0x9')](_0x194d('0x2a'),require(_0x194d('0x2b')));_0x34ff43[_0x194d('0x9')](_0x194d('0x2c'),require(_0x194d('0x2d')));_0x34ff43[_0x194d('0x9')](_0x194d('0x2e'),require('./api/voiceMailMessage'));_0x34ff43['use'](_0x194d('0x2f'),require(_0x194d('0x30')));_0x34ff43[_0x194d('0x9')](_0x194d('0x31'),require(_0x194d('0x32')));_0x34ff43['use'](_0x194d('0x33'),require(_0x194d('0x34')));_0x34ff43[_0x194d('0x9')](_0x194d('0x35'),require('./api/voiceQueueReport'));_0x34ff43[_0x194d('0x9')](_0x194d('0x36'),require(_0x194d('0x37')));_0x34ff43['use'](_0x194d('0x38'),require(_0x194d('0x39')));_0x34ff43[_0x194d('0x9')](_0x194d('0x3a'),require(_0x194d('0x3b')));_0x34ff43[_0x194d('0x9')]('/api/mail/out_servers',require(_0x194d('0x3c')));_0x34ff43[_0x194d('0x9')](_0x194d('0x3d'),require(_0x194d('0x3e')));_0x34ff43[_0x194d('0x9')](_0x194d('0x3f'),require(_0x194d('0x40')));_0x34ff43[_0x194d('0x9')]('/api/mail/substatuses',require(_0x194d('0x41')));_0x34ff43[_0x194d('0x9')](_0x194d('0x42'),require(_0x194d('0x43')));_0x34ff43[_0x194d('0x9')](_0x194d('0x44'),require('./api/mailMessage'));_0x34ff43[_0x194d('0x9')](_0x194d('0x45'),require(_0x194d('0x46')));_0x34ff43['use'](_0x194d('0x47'),require(_0x194d('0x48')));_0x34ff43['use'](_0x194d('0x49'),require(_0x194d('0x4a')));_0x34ff43['use']('/api/dashboards/items',require('./api/dashboardItem'));_0x34ff43[_0x194d('0x9')](_0x194d('0x4b'),require(_0x194d('0x4c')));_0x34ff43[_0x194d('0x9')](_0x194d('0x4d'),require('./api/faxApplication'));_0x34ff43[_0x194d('0x9')](_0x194d('0x4e'),require(_0x194d('0x4f')));_0x34ff43[_0x194d('0x9')](_0x194d('0x50'),require(_0x194d('0x51')));_0x34ff43[_0x194d('0x9')](_0x194d('0x52'),require(_0x194d('0x53')));_0x34ff43[_0x194d('0x9')]('/api/fax/reports/queue',require('./api/faxQueueReport'));_0x34ff43[_0x194d('0x9')](_0x194d('0x54'),require('./api/smsAccount'));_0x34ff43['use'](_0x194d('0x55'),require(_0x194d('0x56')));_0x34ff43[_0x194d('0x9')](_0x194d('0x57'),require(_0x194d('0x58')));_0x34ff43[_0x194d('0x9')]('/api/sms/messages',require('./api/smsMessage'));_0x34ff43['use']('/api/sms/queues',require(_0x194d('0x59')));_0x34ff43[_0x194d('0x9')](_0x194d('0x5a'),require(_0x194d('0x5b')));_0x34ff43['use']('/api/openchannel/applications',require(_0x194d('0x5c')));_0x34ff43[_0x194d('0x9')](_0x194d('0x5d'),require(_0x194d('0x5e')));_0x34ff43[_0x194d('0x9')]('/api/openchannel/messages',require(_0x194d('0x5f')));_0x34ff43[_0x194d('0x9')]('/api/openchannel/queues',require(_0x194d('0x60')));_0x34ff43[_0x194d('0x9')](_0x194d('0x61'),require(_0x194d('0x62')));_0x34ff43[_0x194d('0x9')](_0x194d('0x63'),require('./api/openchannelQueueReport'));_0x34ff43[_0x194d('0x9')](_0x194d('0x64'),require(_0x194d('0x65')));_0x34ff43[_0x194d('0x9')](_0x194d('0x66'),require(_0x194d('0x67')));_0x34ff43[_0x194d('0x9')](_0x194d('0x68'),require('./api/chatMessage'));_0x34ff43['use'](_0x194d('0x69'),require(_0x194d('0x6a')));_0x34ff43['use']('/api/chat/queues',require(_0x194d('0x6b')));_0x34ff43[_0x194d('0x9')](_0x194d('0x6c'),require(_0x194d('0x6d')));_0x34ff43[_0x194d('0x9')](_0x194d('0x6e'),require('./api/chatProactiveAction'));_0x34ff43[_0x194d('0x9')](_0x194d('0x6f'),require(_0x194d('0x70')));_0x34ff43['use'](_0x194d('0x71'),require(_0x194d('0x72')));_0x34ff43[_0x194d('0x9')](_0x194d('0x73'),require('./api/cmHopper'));_0x34ff43[_0x194d('0x9')](_0x194d('0x74'),require('./api/cmHopperBlack'));_0x34ff43[_0x194d('0x9')](_0x194d('0x75'),require('./api/cmHopperFinal'));_0x34ff43[_0x194d('0x9')](_0x194d('0x76'),require(_0x194d('0x77')));_0x34ff43[_0x194d('0x9')]('/api/cm/custom_fields',require(_0x194d('0x78')));_0x34ff43[_0x194d('0x9')](_0x194d('0x79'),require(_0x194d('0x7a')));_0x34ff43[_0x194d('0x9')](_0x194d('0x7b'),require(_0x194d('0x7c')));_0x34ff43[_0x194d('0x9')](_0x194d('0x7d'),require(_0x194d('0x7e')));_0x34ff43[_0x194d('0x9')]('/api/dispositions',require(_0x194d('0x7f')));_0x34ff43[_0x194d('0x9')](_0x194d('0x80'),require(_0x194d('0x81')));_0x34ff43[_0x194d('0x9')](_0x194d('0x82'),require('./api/interval'));_0x34ff43[_0x194d('0x9')](_0x194d('0x83'),require('./api/pause'));_0x34ff43[_0x194d('0x9')](_0x194d('0x84'),require(_0x194d('0x85')));_0x34ff43['use'](_0x194d('0x86'),require(_0x194d('0x87')));_0x34ff43['use'](_0x194d('0x88'),require('./api/schedule'));_0x34ff43[_0x194d('0x9')](_0x194d('0x89'),require(_0x194d('0x8a')));_0x34ff43[_0x194d('0x9')]('/api/tags',require(_0x194d('0x8b')));_0x34ff43[_0x194d('0x9')](_0x194d('0x8c'),require('./api/contactItemType'));_0x34ff43['use'](_0x194d('0x8d'),require(_0x194d('0x8e')));_0x34ff43['use'](_0x194d('0x8f'),require(_0x194d('0x90')));_0x34ff43[_0x194d('0x9')](_0x194d('0x91'),require(_0x194d('0x92')));_0x34ff43['use'](_0x194d('0x93'),require(_0x194d('0x94')));_0x34ff43[_0x194d('0x9')](_0x194d('0x95'),require('./api/variable'));_0x34ff43[_0x194d('0x9')]('/api/integrations',require(_0x194d('0x96')));_0x34ff43[_0x194d('0x9')](_0x194d('0x97'),require(_0x194d('0x98')));_0x34ff43[_0x194d('0x9')](_0x194d('0x99'),require(_0x194d('0x9a')));_0x34ff43['use'](_0x194d('0x9b'),require(_0x194d('0x9c')));_0x34ff43['use'](_0x194d('0x9d'),require(_0x194d('0x9e')));_0x34ff43[_0x194d('0x9')](_0x194d('0x9f'),require(_0x194d('0xa0')));_0x34ff43[_0x194d('0x9')](_0x194d('0xa1'),require(_0x194d('0xa2')));_0x34ff43[_0x194d('0x9')]('/api/analytics/tree_reports',require(_0x194d('0xa3')));_0x34ff43[_0x194d('0x9')](_0x194d('0xa4'),require(_0x194d('0xa5')));_0x34ff43[_0x194d('0x9')]('/api/integrations/salesforce/configurations',require(_0x194d('0xa6')));_0x34ff43[_0x194d('0x9')]('/api/integrations/salesforce/fields',require(_0x194d('0xa7')));_0x34ff43[_0x194d('0x9')](_0x194d('0xa8'),require(_0x194d('0xa9')));_0x34ff43[_0x194d('0x9')](_0x194d('0xaa'),require(_0x194d('0xab')));_0x34ff43['use'](_0x194d('0xac'),require(_0x194d('0xad')));_0x34ff43[_0x194d('0x9')](_0x194d('0xae'),require('./api/intDeskAccount'));_0x34ff43['use'](_0x194d('0xaf'),require(_0x194d('0xb0')));_0x34ff43['use'](_0x194d('0xb1'),require(_0x194d('0xb2')));_0x34ff43['use'](_0x194d('0xb3'),require(_0x194d('0xb4')));_0x34ff43[_0x194d('0x9')]('/api/integrations/zoho/configurations',require(_0x194d('0xb5')));_0x34ff43[_0x194d('0x9')](_0x194d('0xb6'),require(_0x194d('0xb7')));_0x34ff43['use'](_0x194d('0xb8'),require(_0x194d('0xb9')));_0x34ff43[_0x194d('0x9')](_0x194d('0xba'),require(_0x194d('0xbb')));_0x34ff43[_0x194d('0x9')](_0x194d('0xbc'),require(_0x194d('0xbd')));_0x34ff43[_0x194d('0x9')](_0x194d('0xbe'),require(_0x194d('0xbf')));_0x34ff43[_0x194d('0x9')](_0x194d('0xc0'),require(_0x194d('0xc1')));_0x34ff43[_0x194d('0x9')](_0x194d('0xc2'),require('./api/intFreshdeskField'));_0x34ff43[_0x194d('0x9')](_0x194d('0xc3'),require(_0x194d('0xc4')));_0x34ff43[_0x194d('0x9')](_0x194d('0xc5'),require(_0x194d('0xc6')));_0x34ff43['use'](_0x194d('0xc7'),require('./api/intVtigerField'));_0x34ff43[_0x194d('0x9')](_0x194d('0xc8'),require('./api/intServicenowAccount'));_0x34ff43[_0x194d('0x9')](_0x194d('0xc9'),require(_0x194d('0xca')));_0x34ff43[_0x194d('0x9')](_0x194d('0xcb'),require(_0x194d('0xcc')));_0x34ff43[_0x194d('0x9')](_0x194d('0xcd'),require(_0x194d('0xce')));_0x34ff43[_0x194d('0x9')](_0x194d('0xcf'),require('./api/intDynamics365Configuration'));_0x34ff43[_0x194d('0x9')](_0x194d('0xd0'),require(_0x194d('0xd1')));_0x34ff43[_0x194d('0x9')](_0x194d('0xd2'),require(_0x194d('0xd3')));_0x34ff43[_0x194d('0x9')]('/api/integrations/freshsales/configurations',require(_0x194d('0xd4')));_0x34ff43['use'](_0x194d('0xd5'),require('./api/intFreshsalesField'));_0x34ff43[_0x194d('0x9')](_0x194d('0xd6'),require(_0x194d('0xd7')));_0x34ff43['use'](_0x194d('0xd8'),require(_0x194d('0xd9')));_0x34ff43[_0x194d('0x9')](_0x194d('0xda'),require(_0x194d('0xdb')));_0x34ff43[_0x194d('0x9')](_0x194d('0xdc'),require('./api/jscriptyAnswerReport'));_0x34ff43[_0x194d('0x9')](_0x194d('0xdd'),require(_0x194d('0xde')));_0x34ff43[_0x194d('0x9')](_0x194d('0xdf'),require(_0x194d('0xe0')));_0x34ff43['use']('/api/sms/reports/queue',require('./api/smsQueueReport'));_0x34ff43[_0x194d('0x9')](_0x194d('0xe1'),require(_0x194d('0xe2')));_0x34ff43['use'](_0x194d('0xe3'),require(_0x194d('0xe4')));_0x34ff43[_0x194d('0x9')]('/api/jscripty/projects',require(_0x194d('0xe5')));_0x34ff43[_0x194d('0x9')]('/api/settings',require('./api/setting'));_0x34ff43['use'](_0x194d('0xe6'),require(_0x194d('0xe7')));_0x34ff43[_0x194d('0x9')](_0x194d('0xe8'),require(_0x194d('0xe9')));_0x34ff43[_0x194d('0x9')]('/api/square/recordings',require('./api/squareRecording'));_0x34ff43['use']('/api/square/messages',require(_0x194d('0xea')));_0x34ff43['use']('/api/teams',require(_0x194d('0xeb')));_0x34ff43[_0x194d('0x9')](_0x194d('0xec'),require(_0x194d('0xed')));_0x34ff43[_0x194d('0x9')](_0x194d('0xee'),require(_0x194d('0xef')));_0x34ff43[_0x194d('0x9')]('/api/migrations',require(_0x194d('0xf0')));_0x34ff43[_0x194d('0x9')]('/api/attachments',require(_0x194d('0xf1')));_0x34ff43[_0x194d('0x9')](_0x194d('0xf2'),require('./api/plugin'));_0x34ff43[_0x194d('0x9')](_0x194d('0xf3'),require(_0x194d('0xf4')));_0x34ff43[_0x194d('0x9')]('/api/chat/reports/transfer',require(_0x194d('0xf5')));_0x34ff43[_0x194d('0x9')](_0x194d('0xf6'),require('./api/faxTransferReport'));_0x34ff43[_0x194d('0x9')](_0x194d('0xf7'),require(_0x194d('0xf8')));_0x34ff43['use'](_0x194d('0xf9'),require(_0x194d('0xfa')));_0x34ff43[_0x194d('0x9')](_0x194d('0xfb'),require(_0x194d('0xfc')));_0x34ff43[_0x194d('0x9')](_0x194d('0xfd'),require(_0x194d('0xfe')));_0x34ff43['use'](_0x194d('0xff'),require(_0x194d('0x100')));_0x34ff43[_0x194d('0x9')](_0x194d('0x101'),require(_0x194d('0x102')));_0x34ff43['use'](_0x194d('0x103'),require(_0x194d('0x104')));_0x34ff43[_0x194d('0x9')]('/api/userNotifications',require(_0x194d('0x105')));_0x34ff43[_0x194d('0x9')]('/api/whatsapp/accounts',require(_0x194d('0x106')));_0x34ff43[_0x194d('0x9')](_0x194d('0x107'),require('./api/whatsappApplication'));_0x34ff43[_0x194d('0x9')](_0x194d('0x108'),require(_0x194d('0x109')));_0x34ff43[_0x194d('0x9')](_0x194d('0x10a'),require(_0x194d('0x10b')));_0x34ff43[_0x194d('0x9')]('/api/whatsapp/reports/queue',require(_0x194d('0x10c')));_0x34ff43[_0x194d('0x9')](_0x194d('0x10d'),require(_0x194d('0x10e')));_0x34ff43[_0x194d('0x9')](_0x194d('0x10f'),require(_0x194d('0x110')));_0x34ff43[_0x194d('0x9')](_0x194d('0x111'),require(_0x194d('0x112')));_0x34ff43[_0x194d('0x9')](_0x194d('0x113'),require(_0x194d('0x114')));_0x34ff43[_0x194d('0x9')](_0x194d('0x115'),require('./api/authLocal'));_0x34ff43[_0x194d('0x9')](_0x194d('0x116'),require(_0x194d('0x117')));_0x34ff43['use'](_0x194d('0x118'),require(_0x194d('0x119')));_0x34ff43[_0x194d('0x9')](_0x194d('0x11a'),require('./api/rpc'));_0x34ff43[_0x194d('0x9')](_0x194d('0x11b'),require(_0x194d('0x11c')));_0x34ff43[_0x194d('0x9')](_0x194d('0x11d'),require('./api/system'));_0x34ff43['use'](_0x194d('0x11e'),require(_0x194d('0x11f')));_0x34ff43[_0x194d('0x9')](_0x194d('0x120'),require(_0x194d('0x121')));_0x34ff43['use'](_0x194d('0x122'),express[_0x194d('0x123')](path[_0x194d('0x124')](config[_0x194d('0x125')],_0x194d('0x122'))));_0x34ff43['use']('/www',express[_0x194d('0x123')](path[_0x194d('0x124')](config['root'],_0x194d('0x126'))));_0x34ff43[_0x194d('0x9')](_0x194d('0x127'),express[_0x194d('0x123')](path['join'](config[_0x194d('0x125')],_0x194d('0x127'))));_0x34ff43[_0x194d('0x9')](_0x194d('0x128'),express['static'](path[_0x194d('0x124')](config[_0x194d('0x125')],_0x194d('0x129'),'3.0.0')));_0x34ff43[_0x194d('0x9')]('/plugins',express[_0x194d('0x123')](path[_0x194d('0x124')](config[_0x194d('0x125')],_0x194d('0x12a'))));_0x34ff43[_0x194d('0x12b')](_0x194d('0x12c'))['get'](errors[0x194]);_0x34ff43['route']('/*')[_0x194d('0x12d')](function(_0x52a29a,_0x40139d){_0x40139d[_0x194d('0x12e')](path[_0x194d('0x12f')](_0x34ff43[_0x194d('0x12d')](_0x194d('0x130'))+_0x194d('0x131')));});};var sensitiveFields=[_0x194d('0x132'),_0x194d('0x133'),_0x194d('0x134'),'apiKey','firstName',_0x194d('0x135'),_0x194d('0x136'),'phone',_0x194d('0x137'),_0x194d('0x138'),_0x194d('0x139'),_0x194d('0x13a'),_0x194d('0x13b'),_0x194d('0x13c'),_0x194d('0x13d'),_0x194d('0x13e'),'tenantId',_0x194d('0x13f'),_0x194d('0x140'),_0x194d('0x141'),_0x194d('0x142'),_0x194d('0x143'),'consumerKey',_0x194d('0x144'),_0x194d('0x145'),'calleridname','calleridnum',_0x194d('0x146'),'vidaooApiKey',_0x194d('0x147'),_0x194d('0x148'),_0x194d('0x149'),'secretaccesskey',_0x194d('0x14a'),_0x194d('0x16'),_0x194d('0x14b'),_0x194d('0x14c'),_0x194d('0x14d'),_0x194d('0x14e'),_0x194d('0x14f'),'registry','oldPassword'];function maskSensitiveData(_0x25b33e){var _0x28774b=/(?!^)[\s\S](?!$)/g;if(!_[_0x194d('0x150')](_0x25b33e))return;for(var _0x444a8d in _0x25b33e){if(_[_0x194d('0x151')](_0x25b33e[_0x444a8d])){for(var _0x3cbe61=0x0;_0x3cbe61<_0x25b33e[_0x444a8d][_0x194d('0x152')];_0x3cbe61++){maskSensitiveData(_0x25b33e[_0x444a8d][_0x3cbe61]);}}else if(_['isPlainObject'](_0x25b33e[_0x444a8d])){maskSensitiveData(_0x25b33e[_0x444a8d]);}else if(_[_0x194d('0x153')](_0x25b33e[_0x444a8d])){_0x25b33e[_0x444a8d]=_0x25b33e[_0x444a8d]['replace'](/{{{/g,_0x194d('0x154'))['replace'](/}}}/g,_0x194d('0x155'))[_0x194d('0x156')](/{{/g,'@{')[_0x194d('0x156')](/}}/g,'}@');if(_[_0x194d('0x157')](sensitiveFields,_0x444a8d)){_0x25b33e[_0x444a8d]=_0x25b33e[_0x444a8d][_0x194d('0x156')](_0x28774b,'*');}}}} \ No newline at end of file +var _0x6235=['/api/voice/recordings','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','/api/mail/queues','/api/mail/substatuses','./api/mailSubstatus','./api/mailInteraction','./api/mailMessage','./api/mailApplication','./api/mailQueueReport','/api/dashboards','./api/dashboard','./api/dashboardItem','/api/fax/accounts','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/queues','/api/fax/reports/queue','./api/faxQueueReport','./api/smsApplication','/api/sms/interactions','/api/sms/messages','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','./api/chatMessage','/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/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','/api/cdr','./api/cdr','/api/voiceQueuesLog','/api/schedules','/api/sounds','./api/tag','/api/contact_item_types','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','./api/trigger','/api/variables','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','/api/analytics/metrics','./api/analyticMetric','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','./api/intDeskConfiguration','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','./api/intVtigerAccount','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/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/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','./api/jscriptySessionReport','./api/smsQueueReport','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','./api/squareOdbc','/api/square/projects','./api/squareRecording','./api/squareMessage','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','./api/migration','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','/api/chat/reports/transfer','./api/chatTransferReport','./api/faxTransferReport','./api/openchannelTransferReport','/api/sms/reports/transfer','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/auth/local','/api/auth/google','./api/authGoogle','./api/jira','./api/rpc','/api/version','./api/version','./api/system','/api/pm2','./api/pm2','/api/webbar','/apidoc','static','join','root','/www','/demo','/snippet','snippet','3.0.0','/server/files/plugins','route','get','sendFile','resolve','appPath','password','newPassword','apiKey','lastName','street','phone','mobile','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','token','channelSecret','accessToken','authToken','consumerKey','membername','calleridnum','exten','vidaooApiKey','privateKey','accesskeyid','secretaccesskey','pass','accountSid','localstationid','dsn','secret','registry','isPlainObject','isArray','isString','replace','@@{','lodash','path','express','express-winston','util','./errors','./config/environment','api','./config/logger','auth','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','method','x-forwarded-for','headers','connection','remoteAddress','url','statusCode','responseTime','user','name','role','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)','other','agent_name','/api/users','/api/voice/contexts','./api/voiceContext','./api/voiceExtension','/api/voice/mohs'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x6235,0x122));var _0x5623=function(_0x26b143,_0x562d0b){_0x26b143=_0x26b143-0x0;var _0x2e89c5=_0x6235[_0x26b143];return _0x2e89c5;};'use strict';var _=require(_0x5623('0x0'));var path=require(_0x5623('0x1'));var express=require(_0x5623('0x2'));var ewinston=require(_0x5623('0x3'));var util=require(_0x5623('0x4'));var errors=require(_0x5623('0x5'));var config=require(_0x5623('0x6'));var logger=require('./config/logger')(_0x5623('0x7'));var authLogger=require(_0x5623('0x8'))(_0x5623('0x9'));exports['default']=function(_0x4f2d25){_0x4f2d25[_0x5623('0xa')](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0xfc0e1f,_0x363908){var _0x29a03b=_0x5623('0xb');if(!_[_0x5623('0xc')](_0xfc0e1f[_0x5623('0xd')])){_0x29a03b+=_0x5623('0xe');var _0x33314f=_0xfc0e1f[_0x5623('0xd')];maskSensitiveData(_0x33314f);}return util[_0x5623('0xf')](_0x29a03b,_0xfc0e1f[_0x5623('0x10')],_0xfc0e1f['headers'][_0x5623('0x11')]?_0xfc0e1f[_0x5623('0x12')][_0x5623('0x11')]:_0xfc0e1f[_0x5623('0x13')][_0x5623('0x14')]||_0xfc0e1f['ip'],_0xfc0e1f[_0x5623('0x15')],_0x363908[_0x5623('0x16')],_0x363908[_0x5623('0x17')],_0xfc0e1f[_0x5623('0x18')]?_0xfc0e1f[_0x5623('0x18')]['id']:null,_0xfc0e1f['user']?_0xfc0e1f[_0x5623('0x18')][_0x5623('0x19')]:null,_0xfc0e1f[_0x5623('0x18')]?_0xfc0e1f[_0x5623('0x18')][_0x5623('0x1a')]:null,_0x33314f?util[_0x5623('0x1b')](_0x33314f,![],null):'');}}));_0x4f2d25[_0x5623('0xa')](ewinston[_0x5623('0x1c')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x504c3d,_0x346337){var _0x14eeb2=_0x5623('0x1d');if(_0x504c3d['body']&&_0x504c3d['body'][_0x5623('0x1e')]&&_0x504c3d[_0x5623('0xd')][_0x5623('0x1f')]){_0x14eeb2=_0x5623('0x20');}return util[_0x5623('0xf')](_0x14eeb2,_0x504c3d[_0x5623('0x10')],_0x504c3d['headers'][_0x5623('0x11')]?_0x504c3d[_0x5623('0x12')][_0x5623('0x11')]:_0x504c3d['connection'][_0x5623('0x14')]||_0x504c3d['ip'],_0x504c3d[_0x5623('0x15')],_0x346337[_0x5623('0x16')],_0x346337['responseTime'],_0x504c3d[_0x5623('0x18')]?_0x504c3d[_0x5623('0x18')]['id']:null,_0x504c3d[_0x5623('0x18')]?_0x504c3d['user'][_0x5623('0x19')]:null,_0x504c3d[_0x5623('0x18')]?_0x504c3d[_0x5623('0x18')][_0x5623('0x1a')]:null,_0x504c3d['body']&&_0x504c3d['body']['device']?_0x504c3d[_0x5623('0xd')]['device']:_0x5623('0x21'),_0x504c3d[_0x5623('0xd')]&&_0x504c3d[_0x5623('0xd')]['agent_id']?_0x504c3d[_0x5623('0xd')][_0x5623('0x1f')]:'',_0x504c3d[_0x5623('0xd')]&&_0x504c3d[_0x5623('0xd')][_0x5623('0x22')]?_0x504c3d[_0x5623('0xd')][_0x5623('0x22')]:'');},'ignoreRoute':function(_0x16d85e){var _0x41f99d=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x41f99d['test'](_0x16d85e[_0x5623('0x15')]);}}));_0x4f2d25[_0x5623('0xa')](_0x5623('0x23'),require('./api/user'));_0x4f2d25['use']('/api/voice/chanspy',require('./api/voiceChanSpy'));_0x4f2d25[_0x5623('0xa')](_0x5623('0x24'),require(_0x5623('0x25')));_0x4f2d25[_0x5623('0xa')]('/api/voice/extensions',require(_0x5623('0x26')));_0x4f2d25['use'](_0x5623('0x27'),require('./api/voiceMusicOnHold'));_0x4f2d25[_0x5623('0xa')]('/api/voice/queues',require('./api/voiceQueue'));_0x4f2d25[_0x5623('0xa')](_0x5623('0x28'),require('./api/voiceRecording'));_0x4f2d25[_0x5623('0xa')](_0x5623('0x29'),require(_0x5623('0x2a')));_0x4f2d25[_0x5623('0xa')](_0x5623('0x2b'),require(_0x5623('0x2c')));_0x4f2d25['use'](_0x5623('0x2d'),require(_0x5623('0x2e')));_0x4f2d25[_0x5623('0xa')](_0x5623('0x2f'),require(_0x5623('0x30')));_0x4f2d25[_0x5623('0xa')](_0x5623('0x31'),require(_0x5623('0x32')));_0x4f2d25[_0x5623('0xa')](_0x5623('0x33'),require(_0x5623('0x34')));_0x4f2d25[_0x5623('0xa')](_0x5623('0x35'),require(_0x5623('0x36')));_0x4f2d25[_0x5623('0xa')](_0x5623('0x37'),require(_0x5623('0x38')));_0x4f2d25[_0x5623('0xa')](_0x5623('0x39'),require(_0x5623('0x3a')));_0x4f2d25[_0x5623('0xa')](_0x5623('0x3b'),require(_0x5623('0x3c')));_0x4f2d25['use'](_0x5623('0x3d'),require(_0x5623('0x3e')));_0x4f2d25[_0x5623('0xa')]('/api/mail/accounts',require(_0x5623('0x3f')));_0x4f2d25[_0x5623('0xa')](_0x5623('0x40'),require('./api/mailQueue'));_0x4f2d25[_0x5623('0xa')](_0x5623('0x41'),require(_0x5623('0x42')));_0x4f2d25[_0x5623('0xa')]('/api/mail/interactions',require(_0x5623('0x43')));_0x4f2d25[_0x5623('0xa')]('/api/mail/messages',require(_0x5623('0x44')));_0x4f2d25[_0x5623('0xa')]('/api/mail/applications',require(_0x5623('0x45')));_0x4f2d25[_0x5623('0xa')]('/api/mail/reports/queue',require(_0x5623('0x46')));_0x4f2d25[_0x5623('0xa')](_0x5623('0x47'),require(_0x5623('0x48')));_0x4f2d25['use']('/api/dashboards/items',require(_0x5623('0x49')));_0x4f2d25[_0x5623('0xa')](_0x5623('0x4a'),require('./api/faxAccount'));_0x4f2d25[_0x5623('0xa')](_0x5623('0x4b'),require(_0x5623('0x4c')));_0x4f2d25[_0x5623('0xa')](_0x5623('0x4d'),require(_0x5623('0x4e')));_0x4f2d25[_0x5623('0xa')]('/api/fax/messages',require('./api/faxMessage'));_0x4f2d25[_0x5623('0xa')](_0x5623('0x4f'),require('./api/faxQueue'));_0x4f2d25['use'](_0x5623('0x50'),require(_0x5623('0x51')));_0x4f2d25[_0x5623('0xa')]('/api/sms/accounts',require('./api/smsAccount'));_0x4f2d25['use']('/api/sms/applications',require(_0x5623('0x52')));_0x4f2d25[_0x5623('0xa')](_0x5623('0x53'),require('./api/smsInteraction'));_0x4f2d25[_0x5623('0xa')](_0x5623('0x54'),require('./api/smsMessage'));_0x4f2d25[_0x5623('0xa')](_0x5623('0x55'),require(_0x5623('0x56')));_0x4f2d25[_0x5623('0xa')](_0x5623('0x57'),require(_0x5623('0x58')));_0x4f2d25['use'](_0x5623('0x59'),require(_0x5623('0x5a')));_0x4f2d25['use'](_0x5623('0x5b'),require(_0x5623('0x5c')));_0x4f2d25[_0x5623('0xa')](_0x5623('0x5d'),require(_0x5623('0x5e')));_0x4f2d25[_0x5623('0xa')](_0x5623('0x5f'),require(_0x5623('0x60')));_0x4f2d25['use'](_0x5623('0x61'),require(_0x5623('0x62')));_0x4f2d25[_0x5623('0xa')]('/api/openchannel/reports/queue',require(_0x5623('0x63')));_0x4f2d25[_0x5623('0xa')](_0x5623('0x64'),require(_0x5623('0x65')));_0x4f2d25[_0x5623('0xa')](_0x5623('0x66'),require(_0x5623('0x67')));_0x4f2d25['use']('/api/chat/messages',require(_0x5623('0x68')));_0x4f2d25['use'](_0x5623('0x69'),require(_0x5623('0x6a')));_0x4f2d25[_0x5623('0xa')](_0x5623('0x6b'),require(_0x5623('0x6c')));_0x4f2d25[_0x5623('0xa')](_0x5623('0x6d'),require(_0x5623('0x6e')));_0x4f2d25[_0x5623('0xa')](_0x5623('0x6f'),require('./api/chatProactiveAction'));_0x4f2d25[_0x5623('0xa')](_0x5623('0x70'),require(_0x5623('0x71')));_0x4f2d25[_0x5623('0xa')](_0x5623('0x72'),require('./api/cmContact'));_0x4f2d25[_0x5623('0xa')](_0x5623('0x73'),require(_0x5623('0x74')));_0x4f2d25[_0x5623('0xa')](_0x5623('0x75'),require(_0x5623('0x76')));_0x4f2d25['use'](_0x5623('0x77'),require(_0x5623('0x78')));_0x4f2d25[_0x5623('0xa')]('/api/cm/hopper_history',require(_0x5623('0x79')));_0x4f2d25['use'](_0x5623('0x7a'),require(_0x5623('0x7b')));_0x4f2d25[_0x5623('0xa')](_0x5623('0x7c'),require(_0x5623('0x7d')));_0x4f2d25[_0x5623('0xa')](_0x5623('0x7e'),require('./api/automation'));_0x4f2d25['use']('/api/canned_answers',require('./api/cannedAnswer'));_0x4f2d25['use'](_0x5623('0x7f'),require(_0x5623('0x80')));_0x4f2d25[_0x5623('0xa')](_0x5623('0x81'),require(_0x5623('0x82')));_0x4f2d25[_0x5623('0xa')](_0x5623('0x83'),require(_0x5623('0x84')));_0x4f2d25['use'](_0x5623('0x85'),require('./api/pause'));_0x4f2d25['use'](_0x5623('0x86'),require(_0x5623('0x87')));_0x4f2d25[_0x5623('0xa')](_0x5623('0x88'),require('./api/voiceQueuesLog'));_0x4f2d25['use'](_0x5623('0x89'),require('./api/schedule'));_0x4f2d25[_0x5623('0xa')](_0x5623('0x8a'),require('./api/sound'));_0x4f2d25['use']('/api/tags',require(_0x5623('0x8b')));_0x4f2d25[_0x5623('0xa')](_0x5623('0x8c'),require('./api/contactItemType'));_0x4f2d25[_0x5623('0xa')](_0x5623('0x8d'),require(_0x5623('0x8e')));_0x4f2d25[_0x5623('0xa')](_0x5623('0x8f'),require(_0x5623('0x90')));_0x4f2d25[_0x5623('0xa')](_0x5623('0x91'),require(_0x5623('0x92')));_0x4f2d25[_0x5623('0xa')]('/api/triggers',require(_0x5623('0x93')));_0x4f2d25['use'](_0x5623('0x94'),require('./api/variable'));_0x4f2d25[_0x5623('0xa')]('/api/integrations',require('./api/integration'));_0x4f2d25[_0x5623('0xa')](_0x5623('0x95'),require(_0x5623('0x96')));_0x4f2d25['use'](_0x5623('0x97'),require(_0x5623('0x98')));_0x4f2d25['use'](_0x5623('0x99'),require(_0x5623('0x9a')));_0x4f2d25[_0x5623('0xa')](_0x5623('0x9b'),require('./api/analyticExtractedReport'));_0x4f2d25[_0x5623('0xa')](_0x5623('0x9c'),require(_0x5623('0x9d')));_0x4f2d25[_0x5623('0xa')]('/api/analytics/field_reports',require(_0x5623('0x9e')));_0x4f2d25[_0x5623('0xa')](_0x5623('0x9f'),require(_0x5623('0xa0')));_0x4f2d25[_0x5623('0xa')](_0x5623('0xa1'),require('./api/intSalesforceAccount'));_0x4f2d25[_0x5623('0xa')]('/api/integrations/salesforce/configurations',require(_0x5623('0xa2')));_0x4f2d25[_0x5623('0xa')](_0x5623('0xa3'),require(_0x5623('0xa4')));_0x4f2d25[_0x5623('0xa')]('/api/integrations/sugarcrm/accounts',require(_0x5623('0xa5')));_0x4f2d25[_0x5623('0xa')](_0x5623('0xa6'),require(_0x5623('0xa7')));_0x4f2d25[_0x5623('0xa')](_0x5623('0xa8'),require(_0x5623('0xa9')));_0x4f2d25['use'](_0x5623('0xaa'),require(_0x5623('0xab')));_0x4f2d25['use']('/api/integrations/desk/configurations',require(_0x5623('0xac')));_0x4f2d25[_0x5623('0xa')]('/api/integrations/desk/fields',require(_0x5623('0xad')));_0x4f2d25['use'](_0x5623('0xae'),require(_0x5623('0xaf')));_0x4f2d25[_0x5623('0xa')](_0x5623('0xb0'),require(_0x5623('0xb1')));_0x4f2d25['use']('/api/integrations/zoho/fields',require('./api/intZohoField'));_0x4f2d25[_0x5623('0xa')](_0x5623('0xb2'),require(_0x5623('0xb3')));_0x4f2d25[_0x5623('0xa')](_0x5623('0xb4'),require('./api/intZendeskConfiguration'));_0x4f2d25[_0x5623('0xa')](_0x5623('0xb5'),require(_0x5623('0xb6')));_0x4f2d25[_0x5623('0xa')]('/api/integrations/freshdesk/accounts',require(_0x5623('0xb7')));_0x4f2d25[_0x5623('0xa')](_0x5623('0xb8'),require(_0x5623('0xb9')));_0x4f2d25['use'](_0x5623('0xba'),require(_0x5623('0xbb')));_0x4f2d25[_0x5623('0xa')]('/api/integrations/vtiger/accounts',require(_0x5623('0xbc')));_0x4f2d25[_0x5623('0xa')](_0x5623('0xbd'),require('./api/intVtigerConfiguration'));_0x4f2d25[_0x5623('0xa')](_0x5623('0xbe'),require('./api/intVtigerField'));_0x4f2d25['use']('/api/integrations/servicenow/accounts',require(_0x5623('0xbf')));_0x4f2d25['use'](_0x5623('0xc0'),require(_0x5623('0xc1')));_0x4f2d25[_0x5623('0xa')](_0x5623('0xc2'),require(_0x5623('0xc3')));_0x4f2d25['use']('/api/integrations/dynamics365/accounts',require(_0x5623('0xc4')));_0x4f2d25['use'](_0x5623('0xc5'),require(_0x5623('0xc6')));_0x4f2d25['use'](_0x5623('0xc7'),require(_0x5623('0xc8')));_0x4f2d25['use'](_0x5623('0xc9'),require(_0x5623('0xca')));_0x4f2d25['use'](_0x5623('0xcb'),require(_0x5623('0xcc')));_0x4f2d25[_0x5623('0xa')](_0x5623('0xcd'),require(_0x5623('0xce')));_0x4f2d25[_0x5623('0xa')]('/api/networks',require(_0x5623('0xcf')));_0x4f2d25[_0x5623('0xa')]('/api/chat/reports/queue',require(_0x5623('0xd0')));_0x4f2d25[_0x5623('0xa')](_0x5623('0xd1'),require(_0x5623('0xd2')));_0x4f2d25[_0x5623('0xa')](_0x5623('0xd3'),require(_0x5623('0xd4')));_0x4f2d25[_0x5623('0xa')]('/api/jscripty/questions/reports',require('./api/jscriptyQuestionReport'));_0x4f2d25[_0x5623('0xa')]('/api/jscripty/sessions/reports',require(_0x5623('0xd5')));_0x4f2d25[_0x5623('0xa')]('/api/sms/reports/queue',require(_0x5623('0xd6')));_0x4f2d25['use']('/api/square/reports',require(_0x5623('0xd7')));_0x4f2d25[_0x5623('0xa')](_0x5623('0xd8'),require(_0x5623('0xd9')));_0x4f2d25['use'](_0x5623('0xda'),require(_0x5623('0xdb')));_0x4f2d25[_0x5623('0xa')](_0x5623('0xdc'),require(_0x5623('0xdd')));_0x4f2d25[_0x5623('0xa')]('/api/square/odbc',require(_0x5623('0xde')));_0x4f2d25[_0x5623('0xa')](_0x5623('0xdf'),require('./api/squareProject'));_0x4f2d25[_0x5623('0xa')]('/api/square/recordings',require(_0x5623('0xe0')));_0x4f2d25[_0x5623('0xa')]('/api/square/messages',require(_0x5623('0xe1')));_0x4f2d25[_0x5623('0xa')]('/api/teams',require(_0x5623('0xe2')));_0x4f2d25[_0x5623('0xa')](_0x5623('0xe3'),require(_0x5623('0xe4')));_0x4f2d25[_0x5623('0xa')](_0x5623('0xe5'),require(_0x5623('0xe6')));_0x4f2d25[_0x5623('0xa')]('/api/migrations',require(_0x5623('0xe7')));_0x4f2d25['use']('/api/attachments',require(_0x5623('0xe8')));_0x4f2d25[_0x5623('0xa')](_0x5623('0xe9'),require(_0x5623('0xea')));_0x4f2d25[_0x5623('0xa')](_0x5623('0xeb'),require('./api/mailTransferReport'));_0x4f2d25['use'](_0x5623('0xec'),require(_0x5623('0xed')));_0x4f2d25[_0x5623('0xa')]('/api/fax/reports/transfer',require(_0x5623('0xee')));_0x4f2d25[_0x5623('0xa')]('/api/openchannel/reports/transfer',require(_0x5623('0xef')));_0x4f2d25[_0x5623('0xa')](_0x5623('0xf0'),require('./api/smsTransferReport'));_0x4f2d25[_0x5623('0xa')](_0x5623('0xf1'),require(_0x5623('0xf2')));_0x4f2d25['use'](_0x5623('0xf3'),require(_0x5623('0xf4')));_0x4f2d25[_0x5623('0xa')](_0x5623('0xf5'),require(_0x5623('0xf6')));_0x4f2d25['use'](_0x5623('0xf7'),require(_0x5623('0xf8')));_0x4f2d25[_0x5623('0xa')](_0x5623('0xf9'),require('./api/userProfileResource'));_0x4f2d25[_0x5623('0xa')](_0x5623('0xfa'),require(_0x5623('0xfb')));_0x4f2d25[_0x5623('0xa')](_0x5623('0xfc'),require('./api/whatsappAccount'));_0x4f2d25['use']('/api/whatsapp/applications',require(_0x5623('0xfd')));_0x4f2d25['use'](_0x5623('0xfe'),require(_0x5623('0xff')));_0x4f2d25[_0x5623('0xa')](_0x5623('0x100'),require('./api/whatsappMessage'));_0x4f2d25['use'](_0x5623('0x101'),require(_0x5623('0x102')));_0x4f2d25[_0x5623('0xa')](_0x5623('0x103'),require(_0x5623('0x104')));_0x4f2d25[_0x5623('0xa')](_0x5623('0x105'),require(_0x5623('0x106')));_0x4f2d25[_0x5623('0xa')](_0x5623('0x107'),require(_0x5623('0x108')));_0x4f2d25['use'](_0x5623('0x109'),require(_0x5623('0x10a')));_0x4f2d25[_0x5623('0xa')](_0x5623('0x10b'),require('./api/authLocal'));_0x4f2d25[_0x5623('0xa')](_0x5623('0x10c'),require(_0x5623('0x10d')));_0x4f2d25[_0x5623('0xa')]('/api/jira',require(_0x5623('0x10e')));_0x4f2d25[_0x5623('0xa')]('/api/rpc',require(_0x5623('0x10f')));_0x4f2d25[_0x5623('0xa')](_0x5623('0x110'),require(_0x5623('0x111')));_0x4f2d25[_0x5623('0xa')]('/api/system',require(_0x5623('0x112')));_0x4f2d25[_0x5623('0xa')](_0x5623('0x113'),require(_0x5623('0x114')));_0x4f2d25['use'](_0x5623('0x115'),require('./api/webbar'));_0x4f2d25[_0x5623('0xa')](_0x5623('0x116'),express[_0x5623('0x117')](path[_0x5623('0x118')](config[_0x5623('0x119')],_0x5623('0x116'))));_0x4f2d25['use'](_0x5623('0x11a'),express[_0x5623('0x117')](path[_0x5623('0x118')](config[_0x5623('0x119')],_0x5623('0x11a'))));_0x4f2d25[_0x5623('0xa')](_0x5623('0x11b'),express[_0x5623('0x117')](path[_0x5623('0x118')](config['root'],_0x5623('0x11b'))));_0x4f2d25[_0x5623('0xa')](_0x5623('0x11c'),express[_0x5623('0x117')](path[_0x5623('0x118')](config[_0x5623('0x119')],_0x5623('0x11d'),_0x5623('0x11e'))));_0x4f2d25[_0x5623('0xa')]('/plugins',express[_0x5623('0x117')](path[_0x5623('0x118')](config[_0x5623('0x119')],_0x5623('0x11f'))));_0x4f2d25[_0x5623('0x120')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0x5623('0x121')](errors[0x194]);_0x4f2d25[_0x5623('0x120')]('/*')[_0x5623('0x121')](function(_0x51fc90,_0xdec12f){_0xdec12f[_0x5623('0x122')](path[_0x5623('0x123')](_0x4f2d25[_0x5623('0x121')](_0x5623('0x124'))+'/index.html'));});};var sensitiveFields=['username',_0x5623('0x125'),_0x5623('0x126'),_0x5623('0x127'),'firstName',_0x5623('0x128'),_0x5623('0x129'),_0x5623('0x12a'),_0x5623('0x12b'),'fax',_0x5623('0x12c'),_0x5623('0x12d'),_0x5623('0x12e'),_0x5623('0x12f'),_0x5623('0x130'),_0x5623('0x131'),_0x5623('0x132'),_0x5623('0x133'),_0x5623('0x134'),_0x5623('0x135'),'accessTokenSecret',_0x5623('0x136'),_0x5623('0x137'),'consumerSecret',_0x5623('0x138'),'calleridname',_0x5623('0x139'),_0x5623('0x13a'),_0x5623('0x13b'),'clientEmail',_0x5623('0x13c'),_0x5623('0x13d'),_0x5623('0x13e'),'key',_0x5623('0x18'),_0x5623('0x13f'),_0x5623('0x140'),_0x5623('0x141'),_0x5623('0x142'),_0x5623('0x143'),_0x5623('0x144'),'oldPassword'];function maskSensitiveData(_0x268d61){var _0x3465c0=/(?!^)[\s\S](?!$)/g;if(!_[_0x5623('0x145')](_0x268d61))return;for(var _0x235b69 in _0x268d61){if(_[_0x5623('0x146')](_0x268d61[_0x235b69])){for(var _0x5c4e65=0x0;_0x5c4e65<_0x268d61[_0x235b69]['length'];_0x5c4e65++){maskSensitiveData(_0x268d61[_0x235b69][_0x5c4e65]);}}else if(_['isPlainObject'](_0x268d61[_0x235b69])){maskSensitiveData(_0x268d61[_0x235b69]);}else if(_[_0x5623('0x147')](_0x268d61[_0x235b69])){_0x268d61[_0x235b69]=_0x268d61[_0x235b69][_0x5623('0x148')](/{{{/g,_0x5623('0x149'))[_0x5623('0x148')](/}}}/g,'}@@')[_0x5623('0x148')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x235b69)){_0x268d61[_0x235b69]=_0x268d61[_0x235b69][_0x5623('0x148')](_0x3465c0,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index d6d6ad3..f140fec 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3325=['../api/pause/pause.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intDynamics365Account/intDynamics365Account.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/whatsappAccount/whatsappAccount.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','server','http','rpc','port','localhost','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','bluebird','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc'];(function(_0x2659ac,_0x2bf93b){var _0x1d3167=function(_0x237b73){while(--_0x237b73){_0x2659ac['push'](_0x2659ac['shift']());}};_0x1d3167(++_0x2bf93b);}(_0x3325,0x1c9));var _0x5332=function(_0x5bdd93,_0x208ccb){_0x5bdd93=_0x5bdd93-0x0;var _0x2caf5e=_0x3325[_0x5bdd93];return _0x2caf5e;};'use strict';var jayson=require(_0x5332('0x0'));var BPromise=require(_0x5332('0x1'));var _=require('lodash');var config=require(_0x5332('0x2'));exports[_0x5332('0x3')]=function(){return new BPromise(function(_0x41703f,_0x59be96){var _0x3d1223={};_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require(_0x5332('0x5')));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require('../api/voiceExtension/voiceExtension.rpc'));_0x3d1223=_['merge'](_0x3d1223,require(_0x5332('0x6')));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require('../api/voiceRecording/voiceRecording.rpc'));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require(_0x5332('0x7')));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require(_0x5332('0x8')));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require(_0x5332('0x9')));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require(_0x5332('0xa')));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require(_0x5332('0xb')));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require(_0x5332('0xc')));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require(_0x5332('0xd')));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require(_0x5332('0xe')));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require(_0x5332('0xf')));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require('../api/mailAccount/mailAccount.rpc'));_0x3d1223=_['merge'](_0x3d1223,require(_0x5332('0x10')));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require(_0x5332('0x11')));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require(_0x5332('0x12')));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require(_0x5332('0x13')));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require(_0x5332('0x14')));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require(_0x5332('0x15')));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require(_0x5332('0x16')));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require(_0x5332('0x17')));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require(_0x5332('0x18')));_0x3d1223=_['merge'](_0x3d1223,require('../api/faxQueue/faxQueue.rpc'));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require(_0x5332('0x19')));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require(_0x5332('0x1a')));_0x3d1223=_['merge'](_0x3d1223,require(_0x5332('0x1b')));_0x3d1223=_['merge'](_0x3d1223,require(_0x5332('0x1c')));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require('../api/smsQueue/smsQueue.rpc'));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require(_0x5332('0x1d')));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require(_0x5332('0x1e')));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require(_0x5332('0x1f')));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require(_0x5332('0x20')));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require(_0x5332('0x21')));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require(_0x5332('0x22')));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require('../api/cmContact/cmContact.rpc'));_0x3d1223=_['merge'](_0x3d1223,require(_0x5332('0x23')));_0x3d1223=_['merge'](_0x3d1223,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require(_0x5332('0x24')));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require(_0x5332('0x25')));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require(_0x5332('0x26')));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require(_0x5332('0x27')));_0x3d1223=_['merge'](_0x3d1223,require(_0x5332('0x28')));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require('../api/sound/sound.rpc'));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require(_0x5332('0x29')));_0x3d1223=_['merge'](_0x3d1223,require(_0x5332('0x2a')));_0x3d1223=_['merge'](_0x3d1223,require(_0x5332('0x2b')));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require(_0x5332('0x2c')));_0x3d1223=_['merge'](_0x3d1223,require(_0x5332('0x2d')));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require(_0x5332('0x2e')));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require(_0x5332('0x2f')));_0x3d1223=_['merge'](_0x3d1223,require(_0x5332('0x30')));_0x3d1223=_['merge'](_0x3d1223,require(_0x5332('0x31')));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require(_0x5332('0x32')));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require(_0x5332('0x33')));_0x3d1223=_['merge'](_0x3d1223,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require(_0x5332('0x34')));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require(_0x5332('0x35')));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require('../api/squareReport/squareReport.rpc'));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require(_0x5332('0x36')));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require(_0x5332('0x37')));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require('../api/squareOdbc/squareOdbc.rpc'));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require(_0x5332('0x38')));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require(_0x5332('0x39')));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require(_0x5332('0x3a')));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require(_0x5332('0x3b')));_0x3d1223=_['merge'](_0x3d1223,require(_0x5332('0x3c')));_0x3d1223=_['merge'](_0x3d1223,require(_0x5332('0x3d')));_0x3d1223=_['merge'](_0x3d1223,require(_0x5332('0x3e')));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x3d1223=_[_0x5332('0x4')](_0x3d1223,require(_0x5332('0x3f')));_0x3d1223=_['merge'](_0x3d1223,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x4b7f30=jayson[_0x5332('0x40')](_0x3d1223)[_0x5332('0x41')]();var _0x5c80d7=config[_0x5332('0x42')][_0x5332('0x43')]||config[_0x5332('0x43')]+0x1;var _0x1325d5=config[_0x5332('0x42')]['ip']||_0x5332('0x44');_0x4b7f30['on']('error',function(_0x15f6e7){return _0x59be96(_0x15f6e7);});_0x4b7f30['listen'](_0x5c80d7,_0x1325d5,function(){console['log']('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x1325d5,_0x5c80d7);require(_0x5332('0x45'))['default']();return _0x41703f(_0x5332('0x46')+_0x1325d5+':'+_0x5c80d7);});});}; \ No newline at end of file +var _0x52e9=['../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.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','server','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','bluebird','lodash','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc'];(function(_0x5f3ebf,_0x3f4b2b){var _0x2376e1=function(_0x2b1e75){while(--_0x2b1e75){_0x5f3ebf['push'](_0x5f3ebf['shift']());}};_0x2376e1(++_0x3f4b2b);}(_0x52e9,0x69));var _0x952e=function(_0x374a06,_0x4dd6b5){_0x374a06=_0x374a06-0x0;var _0x8d041d=_0x52e9[_0x374a06];return _0x8d041d;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x952e('0x0'));var _=require(_0x952e('0x1'));var config=require('../config/environment');exports[_0x952e('0x2')]=function(){return new BPromise(function(_0x7dd477,_0x536b61){var _0x183f31={};_0x183f31=_[_0x952e('0x3')](_0x183f31,require(_0x952e('0x4')));_0x183f31=_[_0x952e('0x3')](_0x183f31,require(_0x952e('0x5')));_0x183f31=_['merge'](_0x183f31,require('../api/voiceQueue/voiceQueue.rpc'));_0x183f31=_[_0x952e('0x3')](_0x183f31,require(_0x952e('0x6')));_0x183f31=_[_0x952e('0x3')](_0x183f31,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x183f31=_[_0x952e('0x3')](_0x183f31,require(_0x952e('0x7')));_0x183f31=_[_0x952e('0x3')](_0x183f31,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x183f31=_[_0x952e('0x3')](_0x183f31,require(_0x952e('0x8')));_0x183f31=_['merge'](_0x183f31,require(_0x952e('0x9')));_0x183f31=_[_0x952e('0x3')](_0x183f31,require('../api/trunk/trunk.rpc'));_0x183f31=_['merge'](_0x183f31,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x183f31=_[_0x952e('0x3')](_0x183f31,require(_0x952e('0xa')));_0x183f31=_[_0x952e('0x3')](_0x183f31,require(_0x952e('0xb')));_0x183f31=_['merge'](_0x183f31,require(_0x952e('0xc')));_0x183f31=_[_0x952e('0x3')](_0x183f31,require('../api/mailQueue/mailQueue.rpc'));_0x183f31=_[_0x952e('0x3')](_0x183f31,require('../api/mailInteraction/mailInteraction.rpc'));_0x183f31=_[_0x952e('0x3')](_0x183f31,require(_0x952e('0xd')));_0x183f31=_['merge'](_0x183f31,require(_0x952e('0xe')));_0x183f31=_[_0x952e('0x3')](_0x183f31,require(_0x952e('0xf')));_0x183f31=_[_0x952e('0x3')](_0x183f31,require(_0x952e('0x10')));_0x183f31=_[_0x952e('0x3')](_0x183f31,require(_0x952e('0x11')));_0x183f31=_[_0x952e('0x3')](_0x183f31,require(_0x952e('0x12')));_0x183f31=_[_0x952e('0x3')](_0x183f31,require(_0x952e('0x13')));_0x183f31=_[_0x952e('0x3')](_0x183f31,require(_0x952e('0x14')));_0x183f31=_[_0x952e('0x3')](_0x183f31,require(_0x952e('0x15')));_0x183f31=_[_0x952e('0x3')](_0x183f31,require(_0x952e('0x16')));_0x183f31=_['merge'](_0x183f31,require(_0x952e('0x17')));_0x183f31=_[_0x952e('0x3')](_0x183f31,require('../api/smsMessage/smsMessage.rpc'));_0x183f31=_['merge'](_0x183f31,require('../api/smsQueue/smsQueue.rpc'));_0x183f31=_['merge'](_0x183f31,require(_0x952e('0x18')));_0x183f31=_[_0x952e('0x3')](_0x183f31,require(_0x952e('0x19')));_0x183f31=_[_0x952e('0x3')](_0x183f31,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x183f31=_[_0x952e('0x3')](_0x183f31,require(_0x952e('0x1a')));_0x183f31=_[_0x952e('0x3')](_0x183f31,require(_0x952e('0x1b')));_0x183f31=_[_0x952e('0x3')](_0x183f31,require('../api/chatInteraction/chatInteraction.rpc'));_0x183f31=_[_0x952e('0x3')](_0x183f31,require(_0x952e('0x1c')));_0x183f31=_['merge'](_0x183f31,require(_0x952e('0x1d')));_0x183f31=_[_0x952e('0x3')](_0x183f31,require(_0x952e('0x1e')));_0x183f31=_[_0x952e('0x3')](_0x183f31,require('../api/cmHopper/cmHopper.rpc'));_0x183f31=_[_0x952e('0x3')](_0x183f31,require(_0x952e('0x1f')));_0x183f31=_[_0x952e('0x3')](_0x183f31,require(_0x952e('0x20')));_0x183f31=_[_0x952e('0x3')](_0x183f31,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x183f31=_['merge'](_0x183f31,require(_0x952e('0x21')));_0x183f31=_[_0x952e('0x3')](_0x183f31,require('../api/interval/interval.rpc'));_0x183f31=_[_0x952e('0x3')](_0x183f31,require(_0x952e('0x22')));_0x183f31=_[_0x952e('0x3')](_0x183f31,require(_0x952e('0x23')));_0x183f31=_[_0x952e('0x3')](_0x183f31,require(_0x952e('0x24')));_0x183f31=_[_0x952e('0x3')](_0x183f31,require(_0x952e('0x25')));_0x183f31=_[_0x952e('0x3')](_0x183f31,require(_0x952e('0x26')));_0x183f31=_['merge'](_0x183f31,require(_0x952e('0x27')));_0x183f31=_[_0x952e('0x3')](_0x183f31,require(_0x952e('0x28')));_0x183f31=_[_0x952e('0x3')](_0x183f31,require(_0x952e('0x29')));_0x183f31=_[_0x952e('0x3')](_0x183f31,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x183f31=_[_0x952e('0x3')](_0x183f31,require(_0x952e('0x2a')));_0x183f31=_[_0x952e('0x3')](_0x183f31,require(_0x952e('0x2b')));_0x183f31=_[_0x952e('0x3')](_0x183f31,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x183f31=_[_0x952e('0x3')](_0x183f31,require(_0x952e('0x2c')));_0x183f31=_[_0x952e('0x3')](_0x183f31,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x183f31=_[_0x952e('0x3')](_0x183f31,require(_0x952e('0x2d')));_0x183f31=_[_0x952e('0x3')](_0x183f31,require(_0x952e('0x2e')));_0x183f31=_[_0x952e('0x3')](_0x183f31,require(_0x952e('0x2f')));_0x183f31=_[_0x952e('0x3')](_0x183f31,require(_0x952e('0x30')));_0x183f31=_[_0x952e('0x3')](_0x183f31,require('../api/squareReport/squareReport.rpc'));_0x183f31=_[_0x952e('0x3')](_0x183f31,require(_0x952e('0x31')));_0x183f31=_[_0x952e('0x3')](_0x183f31,require(_0x952e('0x32')));_0x183f31=_['merge'](_0x183f31,require('../api/squareOdbc/squareOdbc.rpc'));_0x183f31=_[_0x952e('0x3')](_0x183f31,require(_0x952e('0x33')));_0x183f31=_[_0x952e('0x3')](_0x183f31,require(_0x952e('0x34')));_0x183f31=_[_0x952e('0x3')](_0x183f31,require(_0x952e('0x35')));_0x183f31=_[_0x952e('0x3')](_0x183f31,require(_0x952e('0x36')));_0x183f31=_[_0x952e('0x3')](_0x183f31,require('../api/attachment/attachment.rpc'));_0x183f31=_[_0x952e('0x3')](_0x183f31,require('../api/plugin/plugin.rpc'));_0x183f31=_[_0x952e('0x3')](_0x183f31,require(_0x952e('0x37')));_0x183f31=_[_0x952e('0x3')](_0x183f31,require(_0x952e('0x38')));_0x183f31=_[_0x952e('0x3')](_0x183f31,require(_0x952e('0x39')));_0x183f31=_['merge'](_0x183f31,require(_0x952e('0x3a')));_0x183f31=_['merge'](_0x183f31,require(_0x952e('0x3b')));var _0x1ac095=jayson[_0x952e('0x3c')](_0x183f31)['http']();var _0x300003=config['rpc']['port']||config['port']+0x1;var _0x9d329d=config['rpc']['ip']||'localhost';_0x1ac095['on'](_0x952e('0x3d'),function(_0x3d6dcb){return _0x536b61(_0x3d6dcb);});_0x1ac095[_0x952e('0x2')](_0x300003,_0x9d329d,function(){console[_0x952e('0x3e')](_0x952e('0x3f'),_0x9d329d,_0x300003);require(_0x952e('0x40'))[_0x952e('0x41')]();return _0x7dd477(_0x952e('0x42')+_0x9d329d+':'+_0x300003);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 3c5535e..270e719 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 _0xe8a3=['destroy','inherits','sendRequest','sync','prototype','answer','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isNumber','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','GOTO\x20%s\x20%s\x20%s','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','AGI','wait','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','events','./reply','./error','call','setEncoding','setTimeout','utf8','emit','ready','line','toLowerCase','hangup','520-Invalid','520\x20End\x20of\x20proper','substring','no\x20code','replace','result=','indexOf','startsWith','length','error','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','pipe','command','function','write'];(function(_0x549bf0,_0x545544){var _0x583eca=function(_0x2f5ebc){while(--_0x2f5ebc){_0x549bf0['push'](_0x549bf0['shift']());}};_0x583eca(++_0x545544);}(_0xe8a3,0x19d));var _0x3e8a=function(_0x392ec2,_0x4e9f85){_0x392ec2=_0x392ec2-0x0;var _0x16e517=_0xe8a3[_0x392ec2];return _0x16e517;};'use strict';var util=require('util');var _=require('lodash');var EventEmitter=require(_0x3e8a('0x0'))['EventEmitter'];var AGIReply=require(_0x3e8a('0x1'));var AGIError=require(_0x3e8a('0x2'));function AGIChannel(_0x348242){var _0x390b60=this,_0xbeff3d=new AGIReply(),_0x397b05=![],_0x5c1bee={};EventEmitter[_0x3e8a('0x3')](_0x390b60);_0x348242[_0x3e8a('0x4')]('utf8');_0x348242[_0x3e8a('0x5')](0x8*0x3c*0x3c*0x3e8);_0xbeff3d[_0x3e8a('0x4')](_0x3e8a('0x6'));_0xbeff3d['on']('headers',function(_0x1f64a5){for(var _0x45ca6e in _0x1f64a5){_0x390b60[_0x45ca6e]=_0x1f64a5[_0x45ca6e];}_0x390b60[_0x3e8a('0x7')](_0x3e8a('0x8'));});_0xbeff3d['on'](_0x3e8a('0x9'),function(_0x41383b){if(_0x41383b[_0x3e8a('0xa')]()==_0x3e8a('0xb')){_0x390b60[_0x3e8a('0x7')](_0x3e8a('0xb'));return;}if(_0x41383b['substring'](0x0,0xb)==_0x3e8a('0xc')){_0x397b05=!![];}if(_0x397b05){_0x5c1bee['rx']+=_0x41383b+'\x0a';if(_0x41383b['search'](_0x3e8a('0xd'))!=-0x1){_0x397b05=![];}}else{_0x5c1bee['rx']=_0x41383b;}if(_0x397b05){return;}if(typeof _0x5c1bee['cb']=='function'){var _0x1a77e8=_0x5c1bee['rx'][_0x3e8a('0xe')](0x0,0x3),_0x35bf18=null,_0x24a81c=null;_0x1a77e8=parseInt(_0x1a77e8);if(isNaN(_0x1a77e8)){_0x5c1bee['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x3e8a('0xf')});return;}if(_0x1a77e8!=0xc8){_0x5c1bee['cb'](null,{'code':_0x1a77e8,'result':-0x1,'extra':'KO'});return;}_0x35bf18=_0x5c1bee['rx']['substring'](0x4)[_0x3e8a('0x10')](_0x3e8a('0x11'),'');if(_0x35bf18[_0x3e8a('0x12')]('\x20')!=-0x1){_0x35bf18=_0x35bf18['substr'](0x0,_0x35bf18['indexOf']('\x20'));}if(_[_0x3e8a('0x13')](_0x35bf18,'-1')){_0x35bf18=parseInt(_0x35bf18);}_0x24a81c=_0x5c1bee['rx']['split']('\x20');if(_0x24a81c[_0x3e8a('0x14')]==0x3){_0x24a81c=_0x24a81c[0x2][_0x3e8a('0xe')](0x1,_0x24a81c[0x2][_0x3e8a('0x14')]-0x1);}else if(_0x24a81c[_0x3e8a('0x14')]>0x3){var _0x379ce3=/\((.+)\)/;var _0xf815b1=_0x5c1bee['rx']['match'](_0x379ce3);if(_0xf815b1){_0x24a81c=_0xf815b1[0x1];}else{_0x24a81c=null;}}else{_0x24a81c=null;}_0x5c1bee['cb'](null,{'code':_0x1a77e8,'result':_0x35bf18,'extra':_0x24a81c});}});_0x348242['on'](_0x3e8a('0x15'),function(_0x1c254e){_0x390b60[_0x3e8a('0x7')](_0x3e8a('0x15'),new AGIError('E_AGI_SOCKET_ERROR',_0x1c254e[_0x3e8a('0x16')]));});_0x348242['on'](_0x3e8a('0x17'),function(){_0x390b60[_0x3e8a('0x7')]('close',new AGIError(_0x3e8a('0x18')));});_0x348242['on'](_0x3e8a('0x19'),function(){_0x390b60['emit']('timeout',new AGIError(_0x3e8a('0x1a')));_0x348242['destroy']();});_0x348242[_0x3e8a('0x1b')](_0xbeff3d);this[_0x3e8a('0x1c')]=function(_0x1ae8cb,_0x34a11e){var _0x1ae8cb=_0x1ae8cb||'',_0x34a11e=typeof _0x34a11e==_0x3e8a('0x1d')?_0x34a11e:new Function();_0x5c1bee={'tx':_0x1ae8cb,'rx':'','cb':_0x34a11e};_0x348242[_0x3e8a('0x1e')](_0x1ae8cb+'\x0a');},this[_0x3e8a('0x17')]=function(){_0x348242[_0x3e8a('0x1f')]();};}util[_0x3e8a('0x20')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x3e8a('0x21')]=function(_0x3083ce){return this[_0x3e8a('0x1c')][_0x3e8a('0x22')](this,_0x3083ce);};AGIChannel[_0x3e8a('0x23')][_0x3e8a('0x24')]=function(){return this[_0x3e8a('0x21')]('ANSWER');};AGIChannel[_0x3e8a('0x23')][_0x3e8a('0x25')]=function(_0x36a014,_0x382cdf,_0x425635){_0x36a014=_0x36a014===undefined?_0x3e8a('0x26'):_0x36a014;_0x382cdf=_0x382cdf===undefined?'5':_0x382cdf;_0x425635=_0x425635===undefined?'1':_0x425635;return this['sendRequest'](util[_0x3e8a('0x27')](_0x3e8a('0x28'),_0x36a014,_0x382cdf*0x3e8,_0x425635));};AGIChannel[_0x3e8a('0x23')][_0x3e8a('0x29')]=function(_0x40aee6){_0x40aee6=_0x40aee6||_0x3e8a('0x2a');return this[_0x3e8a('0x21')](util[_0x3e8a('0x27')](_0x3e8a('0x2b'),_0x40aee6));};AGIChannel['prototype'][_0x3e8a('0x2c')]=function(_0x331d3d,_0x2a97c2){if(_['isArray'](_0x2a97c2)){return this['sendRequest'](util['format'](_0x3e8a('0x2d'),_0x331d3d,_0x2a97c2[_0x3e8a('0x2e')](',')));}return this[_0x3e8a('0x21')](util[_0x3e8a('0x27')](_0x3e8a('0x2d'),_0x331d3d,_0x2a97c2));};AGIChannel['prototype'][_0x3e8a('0x2f')]=function(_0x7d9e7a){return this[_0x3e8a('0x21')](util[_0x3e8a('0x27')](_0x3e8a('0x30'),_0x7d9e7a));};AGIChannel[_0x3e8a('0x23')][_0x3e8a('0x31')]=function(_0x1cbc94){return this[_0x3e8a('0x21')](util[_0x3e8a('0x27')]('SET\x20EXTENSION\x20%s',_0x1cbc94));};AGIChannel[_0x3e8a('0x23')][_0x3e8a('0x32')]=function(_0x4b1d83){return this[_0x3e8a('0x21')](util[_0x3e8a('0x27')](_0x3e8a('0x33'),_0x4b1d83));};AGIChannel['prototype'][_0x3e8a('0xb')]=function(){return this['sendRequest'](_0x3e8a('0x34'));};AGIChannel[_0x3e8a('0x23')][_0x3e8a('0x35')]=function(_0x521a79,_0x31170a){var _0x2be72f=_['isBoolean'](_0x31170a)||_[_0x3e8a('0x36')](_0x31170a)?_0x31170a['toString']():_0x31170a;return this[_0x3e8a('0x21')](util[_0x3e8a('0x27')](_0x3e8a('0x37'),_0x521a79,_0x2be72f?_0x2be72f[_0x3e8a('0x38')]()[_0x3e8a('0x10')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype']['sayNumber']=function(_0x22f901,_0x4acb62){return this['sendRequest'](util['format'](_0x3e8a('0x39'),_0x22f901,_0x4acb62));};AGIChannel[_0x3e8a('0x23')][_0x3e8a('0x3a')]=function(_0x2e7a9b,_0x5bd7cb){return this['sendRequest'](util[_0x3e8a('0x27')](_0x3e8a('0x3b'),_0x2e7a9b,_0x5bd7cb));};AGIChannel['prototype'][_0x3e8a('0x3c')]=function(_0x243f38,_0x266950){return this[_0x3e8a('0x21')](util[_0x3e8a('0x27')](_0x3e8a('0x3d'),_0x243f38,_0x266950));};AGIChannel['prototype'][_0x3e8a('0x3e')]=function(_0x274ec0,_0x57d8c7,_0xc1dbf0){_0x57d8c7=_0x57d8c7||this['extension'];_0xc1dbf0=_0xc1dbf0||0x1;this[_0x3e8a('0x2f')](_0x274ec0);this[_0x3e8a('0x31')](_0x57d8c7);this[_0x3e8a('0x32')](_0xc1dbf0);return this[_0x3e8a('0x29')](util[_0x3e8a('0x27')](_0x3e8a('0x3f'),_0x274ec0,_0x57d8c7,_0xc1dbf0));};AGIChannel['prototype'][_0x3e8a('0x40')]=function(_0xadb3a0){return this['sendRequest'](util['format'](_0x3e8a('0x41'),_0xadb3a0));};AGIChannel['prototype']['recordFile']=function(_0x3c01f4,_0x19c4f2,_0x1e8dfe,_0x2b5d4e,_0xc69984,_0x244615){_0x19c4f2=_0x19c4f2||_0x3e8a('0x42');_0x1e8dfe=_0x1e8dfe||'';_0x2b5d4e=_0x2b5d4e===undefined?-0x1:_0x2b5d4e==='-1'?-0x1:_0x2b5d4e*0x3e8;_0xc69984=_0xc69984===undefined?'':'s='+_0xc69984;_0x244615=_0x244615?_0x3e8a('0x43'):'';return this[_0x3e8a('0x21')](util['format'](_0x3e8a('0x44'),_0x3c01f4,_0x19c4f2,_0x1e8dfe,_0x2b5d4e,_0x244615,_0xc69984));};AGIChannel[_0x3e8a('0x23')][_0x3e8a('0x45')]=function(_0xd2f9fc,_0x1d18f7){_0x1d18f7=_0x1d18f7||'';return this[_0x3e8a('0x21')](util[_0x3e8a('0x27')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0xd2f9fc,_0x1d18f7));};AGIChannel[_0x3e8a('0x23')]['agi']=function(_0x335adf){return this[_0x3e8a('0x2c')](_0x3e8a('0x46'),_0x335adf);};AGIChannel[_0x3e8a('0x23')][_0x3e8a('0x47')]=function(_0x34ae8b){return this[_0x3e8a('0x2c')]('WAIT',_0x34ae8b);};AGIChannel[_0x3e8a('0x23')][_0x3e8a('0x15')]=function(_0x183a71,_0x3a1bc7){this[_0x3e8a('0x29')](util[_0x3e8a('0x27')](_0x3e8a('0x48'),_0x183a71['id'],_0x183a71[_0x3e8a('0x49')],_0x3a1bc7));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file +var _0xf62d=['AGI','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','EventEmitter','./reply','./error','setTimeout','utf8','headers','emit','ready','line','toLowerCase','substring','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','prototype','sendRequest','sync','answer','ANSWER','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','isBoolean','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','extension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi'];(function(_0x2ae419,_0x494a1a){var _0xe4be63=function(_0x5d275a){while(--_0x5d275a){_0x2ae419['push'](_0x2ae419['shift']());}};_0xe4be63(++_0x494a1a);}(_0xf62d,0x1c0));var _0xdf62=function(_0x57c183,_0x28a52f){_0x57c183=_0x57c183-0x0;var _0x49eda9=_0xf62d[_0x57c183];return _0x49eda9;};'use strict';var util=require(_0xdf62('0x0'));var _=require(_0xdf62('0x1'));var EventEmitter=require('events')[_0xdf62('0x2')];var AGIReply=require(_0xdf62('0x3'));var AGIError=require(_0xdf62('0x4'));function AGIChannel(_0x44cd45){var _0x2f7d73=this,_0x451a23=new AGIReply(),_0x3fcfc7=![],_0x76ca4={};EventEmitter['call'](_0x2f7d73);_0x44cd45['setEncoding']('utf8');_0x44cd45[_0xdf62('0x5')](0x8*0x3c*0x3c*0x3e8);_0x451a23['setEncoding'](_0xdf62('0x6'));_0x451a23['on'](_0xdf62('0x7'),function(_0xfcbcc1){for(var _0x27182d in _0xfcbcc1){_0x2f7d73[_0x27182d]=_0xfcbcc1[_0x27182d];}_0x2f7d73[_0xdf62('0x8')](_0xdf62('0x9'));});_0x451a23['on'](_0xdf62('0xa'),function(_0x1316f3){if(_0x1316f3[_0xdf62('0xb')]()=='hangup'){_0x2f7d73[_0xdf62('0x8')]('hangup');return;}if(_0x1316f3[_0xdf62('0xc')](0x0,0xb)=='520-Invalid'){_0x3fcfc7=!![];}if(_0x3fcfc7){_0x76ca4['rx']+=_0x1316f3+'\x0a';if(_0x1316f3[_0xdf62('0xd')](_0xdf62('0xe'))!=-0x1){_0x3fcfc7=![];}}else{_0x76ca4['rx']=_0x1316f3;}if(_0x3fcfc7){return;}if(typeof _0x76ca4['cb']==_0xdf62('0xf')){var _0x1e2a6c=_0x76ca4['rx']['substring'](0x0,0x3),_0x855b8a=null,_0x4774c4=null;_0x1e2a6c=parseInt(_0x1e2a6c);if(isNaN(_0x1e2a6c)){_0x76ca4['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xdf62('0x10')});return;}if(_0x1e2a6c!=0xc8){_0x76ca4['cb'](null,{'code':_0x1e2a6c,'result':-0x1,'extra':'KO'});return;}_0x855b8a=_0x76ca4['rx'][_0xdf62('0xc')](0x4)[_0xdf62('0x11')](_0xdf62('0x12'),'');if(_0x855b8a['indexOf']('\x20')!=-0x1){_0x855b8a=_0x855b8a['substr'](0x0,_0x855b8a[_0xdf62('0x13')]('\x20'));}if(_['startsWith'](_0x855b8a,'-1')){_0x855b8a=parseInt(_0x855b8a);}_0x4774c4=_0x76ca4['rx'][_0xdf62('0x14')]('\x20');if(_0x4774c4[_0xdf62('0x15')]==0x3){_0x4774c4=_0x4774c4[0x2][_0xdf62('0xc')](0x1,_0x4774c4[0x2][_0xdf62('0x15')]-0x1);}else if(_0x4774c4['length']>0x3){var _0x47cb3a=/\((.+)\)/;var _0x159ff1=_0x76ca4['rx'][_0xdf62('0x16')](_0x47cb3a);if(_0x159ff1){_0x4774c4=_0x159ff1[0x1];}else{_0x4774c4=null;}}else{_0x4774c4=null;}_0x76ca4['cb'](null,{'code':_0x1e2a6c,'result':_0x855b8a,'extra':_0x4774c4});}});_0x44cd45['on']('error',function(_0x55b943){_0x2f7d73[_0xdf62('0x8')](_0xdf62('0x17'),new AGIError(_0xdf62('0x18'),_0x55b943[_0xdf62('0x19')]));});_0x44cd45['on'](_0xdf62('0x1a'),function(){_0x2f7d73[_0xdf62('0x8')](_0xdf62('0x1a'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x44cd45['on'](_0xdf62('0x1b'),function(){_0x2f7d73['emit'](_0xdf62('0x1b'),new AGIError(_0xdf62('0x1c')));_0x44cd45[_0xdf62('0x1d')]();});_0x44cd45[_0xdf62('0x1e')](_0x451a23);this[_0xdf62('0x1f')]=function(_0x57f177,_0x302458){var _0x57f177=_0x57f177||'',_0x302458=typeof _0x302458==_0xdf62('0xf')?_0x302458:new Function();_0x76ca4={'tx':_0x57f177,'rx':'','cb':_0x302458};_0x44cd45[_0xdf62('0x20')](_0x57f177+'\x0a');},this[_0xdf62('0x1a')]=function(){_0x44cd45['destroy']();};}util[_0xdf62('0x21')](AGIChannel,EventEmitter);AGIChannel[_0xdf62('0x22')][_0xdf62('0x23')]=function(_0x562510){return this['command'][_0xdf62('0x24')](this,_0x562510);};AGIChannel[_0xdf62('0x22')][_0xdf62('0x25')]=function(){return this[_0xdf62('0x23')](_0xdf62('0x26'));};AGIChannel[_0xdf62('0x22')]['getData']=function(_0xfd2900,_0x2f8bda,_0x3a1944){_0xfd2900=_0xfd2900===undefined?_0xdf62('0x27'):_0xfd2900;_0x2f8bda=_0x2f8bda===undefined?'5':_0x2f8bda;_0x3a1944=_0x3a1944===undefined?'1':_0x3a1944;return this['sendRequest'](util[_0xdf62('0x28')](_0xdf62('0x29'),_0xfd2900,_0x2f8bda*0x3e8,_0x3a1944));};AGIChannel[_0xdf62('0x22')][_0xdf62('0x2a')]=function(_0x4c4273){_0x4c4273=_0x4c4273||'NO\x20MESSAGE';return this['sendRequest'](util['format'](_0xdf62('0x2b'),_0x4c4273));};AGIChannel['prototype'][_0xdf62('0x2c')]=function(_0x109302,_0x3795ab){if(_[_0xdf62('0x2d')](_0x3795ab)){return this['sendRequest'](util['format'](_0xdf62('0x2e'),_0x109302,_0x3795ab[_0xdf62('0x2f')](',')));}return this[_0xdf62('0x23')](util[_0xdf62('0x28')]('EXEC\x20%s\x20%s',_0x109302,_0x3795ab));};AGIChannel[_0xdf62('0x22')][_0xdf62('0x30')]=function(_0x32ac66){return this[_0xdf62('0x23')](util[_0xdf62('0x28')](_0xdf62('0x31'),_0x32ac66));};AGIChannel[_0xdf62('0x22')][_0xdf62('0x32')]=function(_0x1c5c6c){return this[_0xdf62('0x23')](util[_0xdf62('0x28')](_0xdf62('0x33'),_0x1c5c6c));};AGIChannel[_0xdf62('0x22')][_0xdf62('0x34')]=function(_0x23cd16){return this['sendRequest'](util[_0xdf62('0x28')](_0xdf62('0x35'),_0x23cd16));};AGIChannel[_0xdf62('0x22')]['hangup']=function(){return this[_0xdf62('0x23')]('HANGUP');};AGIChannel['prototype']['setVariable']=function(_0x2a0783,_0x3ab39f){var _0x373a07=_[_0xdf62('0x36')](_0x3ab39f)||_['isNumber'](_0x3ab39f)?_0x3ab39f['toString']():_0x3ab39f;return this['sendRequest'](util[_0xdf62('0x28')](_0xdf62('0x37'),_0x2a0783,_0x373a07?_0x373a07[_0xdf62('0x38')]()[_0xdf62('0x11')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xdf62('0x22')]['sayNumber']=function(_0x386912,_0x258f0f){return this[_0xdf62('0x23')](util[_0xdf62('0x28')](_0xdf62('0x39'),_0x386912,_0x258f0f));};AGIChannel[_0xdf62('0x22')][_0xdf62('0x3a')]=function(_0x387354,_0x35d9fe){return this[_0xdf62('0x23')](util[_0xdf62('0x28')](_0xdf62('0x3b'),_0x387354,_0x35d9fe));};AGIChannel[_0xdf62('0x22')][_0xdf62('0x3c')]=function(_0x2b51e4,_0x392776){return this['sendRequest'](util[_0xdf62('0x28')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x2b51e4,_0x392776));};AGIChannel[_0xdf62('0x22')]['continueAt']=function(_0x5d4512,_0x261370,_0x2a9053){_0x261370=_0x261370||this[_0xdf62('0x3d')];_0x2a9053=_0x2a9053||0x1;this[_0xdf62('0x30')](_0x5d4512);this[_0xdf62('0x32')](_0x261370);this[_0xdf62('0x34')](_0x2a9053);return this['noop'](util['format'](_0xdf62('0x3e'),_0x5d4512,_0x261370,_0x2a9053));};AGIChannel['prototype'][_0xdf62('0x3f')]=function(_0x88f73d){return this[_0xdf62('0x23')](util['format'](_0xdf62('0x40'),_0x88f73d));};AGIChannel[_0xdf62('0x22')][_0xdf62('0x41')]=function(_0x52c0da,_0x303612,_0x572c7b,_0x1364af,_0x20a9d9,_0x431fcc){_0x303612=_0x303612||_0xdf62('0x42');_0x572c7b=_0x572c7b||'';_0x1364af=_0x1364af===undefined?-0x1:_0x1364af==='-1'?-0x1:_0x1364af*0x3e8;_0x20a9d9=_0x20a9d9===undefined?'':'s='+_0x20a9d9;_0x431fcc=_0x431fcc?'BEEP':'';return this[_0xdf62('0x23')](util[_0xdf62('0x28')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x52c0da,_0x303612,_0x572c7b,_0x1364af,_0x431fcc,_0x20a9d9));};AGIChannel[_0xdf62('0x22')][_0xdf62('0x43')]=function(_0x5ec592,_0x47a6a1){_0x47a6a1=_0x47a6a1||'';return this[_0xdf62('0x23')](util['format'](_0xdf62('0x44'),_0x5ec592,_0x47a6a1));};AGIChannel[_0xdf62('0x22')][_0xdf62('0x45')]=function(_0x52ede5){return this[_0xdf62('0x2c')](_0xdf62('0x46'),_0x52ede5);};AGIChannel[_0xdf62('0x22')]['wait']=function(_0x556091){return this[_0xdf62('0x2c')]('WAIT',_0x556091);};AGIChannel[_0xdf62('0x22')][_0xdf62('0x17')]=function(_0x35b8c2,_0x2ab556){this['noop'](util[_0xdf62('0x28')](_0xdf62('0x47'),_0x35b8c2['id'],_0x35b8c2[_0xdf62('0x48')],_0x2ab556));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xdf62('0x49')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 37052b6..af745c3 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 _0x01a4=['[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','message','name','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.'];(function(_0x177d91,_0x100749){var _0x225e7a=function(_0x3c7a22){while(--_0x3c7a22){_0x177d91['push'](_0x177d91['shift']());}};_0x225e7a(++_0x100749);}(_0x01a4,0xce));var _0x401a=function(_0x506d83,_0x1899e9){_0x506d83=_0x506d83-0x0;var _0x335e8b=_0x01a4[_0x506d83];return _0x335e8b;};'use strict';var util=require(_0x401a('0x0'));var error={'E_AGI_UNDEFINED':_0x401a('0x1'),'E_AGI_ARGUMENT_PORT':_0x401a('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x401a('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0x401a('0x4'),'E_AGI_SOCKET_ERROR':_0x401a('0x5'),'E_AGI_SOCKET_CLOSE':_0x401a('0x6'),'E_AGI_SOCKET_TIMEOUT':_0x401a('0x7'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x401a('0x8'),'E_AGI_IVR_ENTRY':_0x401a('0x9')};function AGIError(_0x47543c){var _0x47543c=_0x47543c||null,_0x2c4b90=_0x2c4b90||[],_0xfa064c=0x1,_0x3e6649='';if(!error[_0x47543c]){_0x47543c=_0x401a('0xa');}_0x2c4b90[_0x401a('0xb')](error[_0x47543c]);while(arguments[_0xfa064c]){_0x2c4b90[_0x401a('0xb')](arguments[_0xfa064c]);_0xfa064c++;}_0x3e6649=util['format']['apply'](util,_0x2c4b90);this[_0x401a('0xc')]=_0x3e6649;this[_0x401a('0xd')]=_0x47543c;}module['exports']=AGIError; \ No newline at end of file +var _0xb2ff=['util','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','apply','name','exports'];(function(_0x247fa1,_0x4ec37c){var _0x244f35=function(_0xfb98be){while(--_0xfb98be){_0x247fa1['push'](_0x247fa1['shift']());}};_0x244f35(++_0x4ec37c);}(_0xb2ff,0x188));var _0xfb2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb2ff[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xfb2f('0x0'));var error={'E_AGI_UNDEFINED':_0xfb2f('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0xfb2f('0x2'),'E_AGI_SERVER_CLOSE':_0xfb2f('0x3'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0xfb2f('0x4'),'E_AGI_SOCKET_ERROR':_0xfb2f('0x5'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0xfb2f('0x6'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xfb2f('0x7'),'E_AGI_IVR_ENTRY':_0xfb2f('0x8')};function AGIError(_0xe00472){var _0xe00472=_0xe00472||null,_0x30de1b=_0x30de1b||[],_0x5e6d84=0x1,_0x4ae572='';if(!error[_0xe00472]){_0xe00472=_0xfb2f('0x9');}_0x30de1b[_0xfb2f('0xa')](error[_0xe00472]);while(arguments[_0x5e6d84]){_0x30de1b[_0xfb2f('0xa')](arguments[_0x5e6d84]);_0x5e6d84++;}_0x4ae572=util['format'][_0xfb2f('0xb')](util,_0x30de1b);this['message']=_0x4ae572;this[_0xfb2f('0xc')]=_0xe00472;}module[_0xfb2f('0xd')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 38a7901..d86b1b0 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 _0xd6f3=['size','relations','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','length','condition','split','vswitch','default','target','agicommand','invalid','default\x20on\x20switch\x20not\x20found','max\x20retry\x20reach','exports','lodash','agi','menu','getsecretdigits','vertices','edges','numberOfEdges','prototype','addVertex','addEdge','push'];(function(_0x158535,_0x41aefb){var _0x164272=function(_0x16c909){while(--_0x16c909){_0x158535['push'](_0x158535['shift']());}};_0x164272(++_0x41aefb);}(_0xd6f3,0x161));var _0x3d6f=function(_0x59706e,_0x2cfb7e){_0x59706e=_0x59706e-0x0;var _0x14faad=_0xd6f3[_0x59706e];return _0x14faad;};'use strict';var _=require(_0x3d6f('0x0'));var logger=require('../../../config/logger')(_0x3d6f('0x1'));var verticesWithRetry=[_0x3d6f('0x2'),'getdigits',_0x3d6f('0x3')];var Graph=function(){this[_0x3d6f('0x4')]={};this[_0x3d6f('0x5')]={};this[_0x3d6f('0x6')]=0x0;};Graph[_0x3d6f('0x7')][_0x3d6f('0x8')]=function(_0x19f7e6){this[_0x3d6f('0x4')][_0x19f7e6['id']]=_0x19f7e6;this[_0x3d6f('0x5')][_0x19f7e6['id']]=[];};Graph[_0x3d6f('0x7')][_0x3d6f('0x9')]=function(_0x504fbc,_0x4989ac,_0x1cf5d4){this[_0x3d6f('0x5')][_0x504fbc][_0x3d6f('0xa')]({'target':_0x4989ac,'condition':_0x1cf5d4});this[_0x3d6f('0x6')]+=0x1;};Graph[_0x3d6f('0x7')]['size']=function(){return _[_0x3d6f('0xb')](this[_0x3d6f('0x4')]);};Graph[_0x3d6f('0x7')][_0x3d6f('0xc')]=function(){return this[_0x3d6f('0x6')];};Graph[_0x3d6f('0x7')]['getVertex']=function(_0x1deaa3){return this[_0x3d6f('0x4')][_0x1deaa3];};Graph[_0x3d6f('0x7')][_0x3d6f('0xd')]=function(_0xe79060,_0x2fb61e){if(!this['vertices'][_0xe79060]){return logger[_0x3d6f('0xe')](_0x3d6f('0xf'));}var _0xe0d4a0=_0x2fb61e(this[_0x3d6f('0x4')][_0xe79060]);if(!_0xe0d4a0){return logger[_0x3d6f('0xe')](_0x3d6f('0x10'));}if(this[_0x3d6f('0x5')][_0xe79060][_0x3d6f('0x11')]===0x0){return logger['info']('no\x20edge/s\x20available');}for(var _0x1f92c4=0x0,_0x20af92=[],_0x25ffdf=![];_0x1f92c4\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','agicommand','retry','maxRetry','addVertex','omit','mxCell','hasOwnProperty','isArray','length','source','target','addEdge','value','getSquareProject','then','catch','createSquareReport','indexOf','agi_','substring','inspect','variables','stringify','close','timeout','hangup','sync','production','debug','root','joinAt','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','start','clear','vertex','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','isUndefined','result','toString','agicommand\x20not\x20found','finally','traverseBFS','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','xml2json','lodash','moment','../../config/environment','agi','../../config/license/util','./mailRpc','./graph','./vertices','defaults','nextTick','error','stack','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','[ERROR]\x20%s','info','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s'];(function(_0x43e532,_0x22f68e){var _0x3d1ebd=function(_0x43e1f8){while(--_0x43e1f8){_0x43e532['push'](_0x43e532['shift']());}};_0x3d1ebd(++_0x22f68e);}(_0xfdb7,0x155));var _0x7fdb=function(_0x27a3b6,_0x25811c){_0x27a3b6=_0x27a3b6-0x0;var _0x28e95e=_0xfdb7[_0x27a3b6];return _0x28e95e;};'use strict';var parser=require(_0x7fdb('0x0'));var _=require(_0x7fdb('0x1'));var syncho=require('syncho');var util=require('util');var moment=require(_0x7fdb('0x2'));var config=require(_0x7fdb('0x3'));var logger=require('../../config/logger')(_0x7fdb('0x4'));var utilLicense=require(_0x7fdb('0x5'));var rpc=require('./rpc');var mailRpc=require(_0x7fdb('0x6'));var Graph=require(_0x7fdb('0x7'));var Vertices=require(_0x7fdb('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x7fdb('0x4')]=_[_0x7fdb('0x9')](config[_0x7fdb('0x4')],{'ip':'127.0.0.1','port':0x11dd});function connectionHandler(_0x5a41f6){process[_0x7fdb('0xa')](function(){syncho(function(){try{setChannelVariables(_0x5a41f6);agiHandler(_0x5a41f6);}catch(_0x472141){logger[_0x7fdb('0xb')](_0x472141[_0x7fdb('0xc')]);}});});}function listeningHandler(){console['log'](_0x7fdb('0xd'),config[_0x7fdb('0x4')][_0x7fdb('0xe')]);logger['info'](util[_0x7fdb('0xf')](_0x7fdb('0x10'),config[_0x7fdb('0x4')]['ip'],config[_0x7fdb('0x4')]['port']));}function errorHandler(_0x107842){if(_0x107842&&_0x107842[_0x7fdb('0x11')]&&_0x107842[_0x7fdb('0x12')]){logger[_0x7fdb('0xb')](util[_0x7fdb('0xf')](_0x7fdb('0x13'),_0x107842['name'],_0x107842['message']));}else{logger['error'](util[_0x7fdb('0xf')](_0x7fdb('0x14'),_0x107842[_0x7fdb('0xc')]));}}function closeHandler(){logger[_0x7fdb('0x15')](util[_0x7fdb('0xf')](_0x7fdb('0x16'),this[_0x7fdb('0x17')],this[_0x7fdb('0x18')],this[_0x7fdb('0x19')],this[_0x7fdb('0x1a')],this['uniqueid']));try{createSquareReport(this);}catch(_0x4c253d){logger[_0x7fdb('0xb')](_0x4c253d['stack']);}}function timeoutHandler(){logger['info'](util['format'](_0x7fdb('0x1b'),this[_0x7fdb('0x17')],this[_0x7fdb('0x18')],this[_0x7fdb('0x19')],this[_0x7fdb('0x1a')],this[_0x7fdb('0x1c')]));}function hangupHandler(){logger['info'](util[_0x7fdb('0xf')](_0x7fdb('0x1d'),this[_0x7fdb('0x17')],this[_0x7fdb('0x18')],this[_0x7fdb('0x19')],this[_0x7fdb('0x1a')],this['uniqueid']));this[_0x7fdb('0x1e')]=!![];}function getRoot(_0xdda8d8){return parser[_0x7fdb('0x1f')](_0xdda8d8,{'object':!![]})['mxGraphModel']['root'];}function addVertex(_0x3e565c,_0x4ef176,_0x3b7150){_0x4ef176[_0x7fdb('0x20')]=_0x3b7150;if(_0x4ef176['hasOwnProperty'](_0x7fdb('0x21'))){_0x4ef176[_0x7fdb('0x22')]=parseInt(_0x4ef176[_0x7fdb('0x21')],0xa);}_0x3e565c[_0x7fdb('0x23')](_[_0x7fdb('0x24')](_0x4ef176,_0x7fdb('0x25')));}function initGraph(_0x241fe6,_0x1a4791){var _0x21f626=new Graph();for(var _0x4e8474 in _0x241fe6){if(_0x241fe6[_0x7fdb('0x26')](_0x4e8474)){if(_[_0x7fdb('0x27')](_0x241fe6[_0x4e8474])){for(var _0x586b7a=0x0;_0x586b7a<_0x241fe6[_0x4e8474][_0x7fdb('0x28')];_0x586b7a+=0x1){addVertex(_0x21f626,_0x241fe6[_0x4e8474][_0x586b7a],_0x4e8474);}}else{addVertex(_0x21f626,_0x241fe6[_0x4e8474],_0x4e8474);}}}for(var _0x25c108=0x0;_0x25c108<_0x1a4791[_0x7fdb('0x28')];_0x25c108+=0x1){if(_0x1a4791[_0x25c108][_0x7fdb('0x29')]&&_0x1a4791[_0x25c108][_0x7fdb('0x2a')]){_0x21f626[_0x7fdb('0x2b')](_0x1a4791[_0x25c108][_0x7fdb('0x29')],_0x1a4791[_0x25c108]['target'],_0x1a4791[_0x25c108][_0x7fdb('0x2c')]);}}return _0x21f626;}function getSquareProject(_0x2cf0d9,_0x17fb9b){rpc[_0x7fdb('0x2d')](_0x2cf0d9)[_0x7fdb('0x2e')](function(_0x550441){_0x17fb9b(null,_0x550441);})[_0x7fdb('0x2f')](function(_0x22ee10){_0x17fb9b(null,_0x22ee10);});}function createSquareReport(_0x50c59e,_0x282833){rpc[_0x7fdb('0x30')](_0x50c59e)[_0x7fdb('0x2e')](function(_0x343029){if(_0x282833){_0x282833(null,_0x343029);}})[_0x7fdb('0x2f')](function(_0x4ea6cd){if(_0x282833){_0x282833(null,_0x4ea6cd);}});}function setChannelVariables(_0x7a410c){for(var _0x26721d in _0x7a410c){if(_0x7a410c[_0x7fdb('0x26')](_0x26721d)){if(_0x26721d[_0x7fdb('0x31')](_0x7fdb('0x32'))===0x0){_0x7a410c[_0x26721d[_0x7fdb('0x33')](0x4)]=_0x7a410c[_0x26721d];delete _0x7a410c[_0x26721d];}}}}function getLogFromObject(_0x17fb2c){return util[_0x7fdb('0x34')](_0x17fb2c,{'showHidden':![],'depth':null});}function agiHandler(_0xac7584){var _0x3e1512,_0x2f1045,_0x5428fc,_0x3cd15f,_0x2c25bc;logger['debug'](_0x7fdb('0x35'),JSON[_0x7fdb('0x36')](_0xac7584,null,0x2));logger[_0x7fdb('0x15')](util[_0x7fdb('0xf')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0xac7584['arg_1'],_0xac7584[_0x7fdb('0x18')],_0xac7584[_0x7fdb('0x19')],_0xac7584[_0x7fdb('0x1a')],_0xac7584[_0x7fdb('0x1c')]));_0xac7584['on']('error',errorHandler);_0xac7584['on'](_0x7fdb('0x37'),closeHandler);_0xac7584['on'](_0x7fdb('0x38'),timeoutHandler);_0xac7584[_0x7fdb('0x1e')]=![];_0xac7584['on'](_0x7fdb('0x39'),hangupHandler);var _0x17ea02=getSquareProject[_0x7fdb('0x3a')](null,_0xac7584[_0x7fdb('0x17')]);if(_0x17ea02){if(_0x17ea02[_0x7fdb('0x3b')]){_0x3e1512=getRoot(_0x17ea02[_0x7fdb('0x3b')]);if(_0x3e1512&&_0x3e1512['start']){logger[_0x7fdb('0x3c')](_0x7fdb('0x3d'),JSON['stringify'](_0x3e1512,null,0x2));_0xac7584[_0x7fdb('0x3e')]=moment()[_0x7fdb('0xf')](_0x7fdb('0x3f'));_0x2f1045=initGraph(_['omit'](_0x3e1512,_0x7fdb('0x25')),_0x3e1512['mxCell']);_0x5428fc=new Vertices(_0xac7584,rpc,mailRpc);logger['info'](util[_0x7fdb('0xf')](_0x7fdb('0x40'),_0xac7584['arg_1'],_0xac7584[_0x7fdb('0x18')],_0xac7584[_0x7fdb('0x19')],_0xac7584[_0x7fdb('0x1a')],_0xac7584[_0x7fdb('0x1c')]));_0x2f1045['traverseBFS'](_0x3e1512[_0x7fdb('0x41')]['id'],function(_0x5f3e1d){try{_0x5f3e1d=_0x5428fc[_0x7fdb('0x42')](_0x5f3e1d);logger[_0x7fdb('0x3c')](_0x7fdb('0x43'),JSON['stringify'](_0x5f3e1d,null,0x2));if(_0x5f3e1d['agicommand']==='gotoc'){logger['info'](_0x7fdb('0x44'));_0xac7584[_0x7fdb('0x45')]=_0x5f3e1d[_0x7fdb('0x45')]||_0xac7584[_0x7fdb('0x45')];_0xac7584[_0x7fdb('0x46')]=_0x5f3e1d[_0x7fdb('0x46')];_0xac7584[_0x7fdb('0x47')]=_0x5f3e1d[_0x7fdb('0x47')]?_0x5f3e1d[_0x7fdb('0x47')]-0x1:0x1;return null;}else if(_0x5f3e1d&&_0x5428fc[_0x5f3e1d[_0x7fdb('0x20')]]){_0x2c25bc=_0x5428fc[_0x5f3e1d['agicommand']](_0x5f3e1d);logger['info'](_0x7fdb('0x48'),JSON[_0x7fdb('0x36')](_0x2c25bc,null,0x2));if(_0x2c25bc&&_0x2c25bc[_0x7fdb('0x49')]===AGI_CODE_SUCCESS&&_0x2c25bc['result']!==AGI_RESULT_ERROR&&!_0xac7584['evtHangup']){logger[_0x7fdb('0x3c')]('response',getLogFromObject(_0x2c25bc));return _[_0x7fdb('0x4a')](_0x2c25bc['result'])?null:_0x2c25bc[_0x7fdb('0x4b')][_0x7fdb('0x4c')]();}else{logger[_0x7fdb('0xb')](_0x7fdb('0x48'),getLogFromObject(_0x2c25bc));return null;}}else{logger[_0x7fdb('0xb')](_0x7fdb('0x4d'));return null;}}catch(_0x2ab86a){logger[_0x7fdb('0xb')](_0x2ab86a[_0x7fdb('0xc')]);return null;}});if(_0x3e1512[_0x7fdb('0x4e')]){logger[_0x7fdb('0x15')](util[_0x7fdb('0xf')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0xac7584[_0x7fdb('0x17')],_0xac7584[_0x7fdb('0x18')],_0xac7584[_0x7fdb('0x19')],_0xac7584[_0x7fdb('0x1a')],_0xac7584[_0x7fdb('0x1c')]));_0x2f1045[_0x7fdb('0x4f')](_0x3e1512[_0x7fdb('0x4e')]['id'],function(_0x26025e){try{_0x26025e=_0x5428fc[_0x7fdb('0x42')](_0x26025e);logger[_0x7fdb('0x3c')]('vertex',JSON[_0x7fdb('0x36')](_0x26025e,null,0x2));if(_0x26025e&&_0x5428fc[_0x26025e[_0x7fdb('0x20')]]){_0x2c25bc=_0x5428fc[_0x26025e[_0x7fdb('0x20')]](_0x26025e);if(_0x2c25bc){logger[_0x7fdb('0x3c')](_0x7fdb('0x48'),getLogFromObject(_0x2c25bc));return _[_0x7fdb('0x4a')](_0x2c25bc['result'])?null:_0x2c25bc[_0x7fdb('0x4b')][_0x7fdb('0x4c')]();}else{logger[_0x7fdb('0xb')](_0x7fdb('0x48'),getLogFromObject(_0x2c25bc));return null;}}else{logger['error'](_0x7fdb('0x4d'));return null;}}catch(_0x33c7f9){logger[_0x7fdb('0xb')](_0x33c7f9[_0x7fdb('0xc')]);return null;}});}logger[_0x7fdb('0x15')](util[_0x7fdb('0xf')](_0x7fdb('0x50'),_0xac7584[_0x7fdb('0x17')],_0xac7584[_0x7fdb('0x18')],_0xac7584[_0x7fdb('0x19')],_0xac7584['dnid'],_0xac7584[_0x7fdb('0x1c')]));logger[_0x7fdb('0x15')](util[_0x7fdb('0xf')](_0x7fdb('0x51'),_0xac7584[_0x7fdb('0x45')],_0xac7584[_0x7fdb('0x46')],parseInt(_0xac7584[_0x7fdb('0x47')],0xa)+0x1));_0xac7584[_0x7fdb('0x52')](_0xac7584[_0x7fdb('0x45')],_0xac7584[_0x7fdb('0x46')],parseInt(_0xac7584[_0x7fdb('0x47')],0xa)+0x1);_0xac7584[_0x7fdb('0x37')]();}}else{logger[_0x7fdb('0xb')](util['format'](_0x7fdb('0x53'),_0xac7584[_0x7fdb('0x17')]));_0xac7584[_0x7fdb('0x52')](_0xac7584[_0x7fdb('0x45')],_0xac7584[_0x7fdb('0x46')],parseInt(_0xac7584['priority'],0xa)+0x1);_0xac7584['close']();}}else{logger['error'](util[_0x7fdb('0xf')]('Project\x20%s\x20not\x20found',_0xac7584[_0x7fdb('0x17')]));_0xac7584[_0x7fdb('0x52')](_0xac7584['context'],_0xac7584[_0x7fdb('0x46')],parseInt(_0xac7584['priority'],0xa)+0x1);_0xac7584[_0x7fdb('0x37')]();}}function main(){var _0x3bbdb3;return utilLicense[_0x7fdb('0x54')]()['then'](function(_0x11241){if(_0x11241){if(_0x11241['voice']){if(_0x11241[_0x7fdb('0x55')]&&_0x11241[_0x7fdb('0x55')]>0x0){logger[_0x7fdb('0x15')](util['format']('[LICENSE]\x20CHANNELS:\x20%s',_0x11241[_0x7fdb('0x55')]));_0x3bbdb3=_0x11241[_0x7fdb('0x55')];}else{logger[_0x7fdb('0x15')](_0x7fdb('0x56'));}}else{logger[_0x7fdb('0x15')](_0x7fdb('0x57'));_0x3bbdb3=-0x1;}}})[_0x7fdb('0x2f')](function(_0x4225bf){logger[_0x7fdb('0xb')](_0x7fdb('0x58'),_0x4225bf[_0x7fdb('0xc')]);})[_0x7fdb('0x4e')](function(){var _0x4bcc62=require(_0x7fdb('0x59'))(config['agi'][_0x7fdb('0xe')],config['agi']['ip'],_0x3bbdb3);_0x4bcc62['on'](_0x7fdb('0xb'),errorHandler);_0x4bcc62['on'](_0x7fdb('0x5a'),listeningHandler);_0x4bcc62['on']('connection',connectionHandler);_0x4bcc62['on'](_0x7fdb('0x37'),closeHandler);});}main(); \ No newline at end of file +var _0x4eb8=['xml2json','lodash','syncho','util','../../config/logger','agi','./mailRpc','./graph','./vertices','127.0.0.1','nextTick','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','dnid','uniqueid','arg_1','calleridname','evtHangup','toJson','mxGraphModel','root','agicommand','hasOwnProperty','retry','maxRetry','addVertex','mxCell','isArray','length','source','target','addEdge','value','getSquareProject','then','catch','createSquareReport','indexOf','inspect','debug','variables','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','sync','production','start','stringify','joinAt','YYYY-MM-DD\x20HH:mm:ss','omit','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','priority','response','code','result','isUndefined','toString','agicommand\x20not\x20found','finally','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','extension','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','./server','listening','connection'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0x4eb8,0x1c2));var _0x84eb=function(_0x49cdd0,_0x2508f9){_0x49cdd0=_0x49cdd0-0x0;var _0x13daaa=_0x4eb8[_0x49cdd0];return _0x13daaa;};'use strict';var parser=require(_0x84eb('0x0'));var _=require(_0x84eb('0x1'));var syncho=require(_0x84eb('0x2'));var util=require(_0x84eb('0x3'));var moment=require('moment');var config=require('../../config/environment');var logger=require(_0x84eb('0x4'))(_0x84eb('0x5'));var utilLicense=require('../../config/license/util');var rpc=require('./rpc');var mailRpc=require(_0x84eb('0x6'));var Graph=require(_0x84eb('0x7'));var Vertices=require(_0x84eb('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x84eb('0x5')]=_['defaults'](config[_0x84eb('0x5')],{'ip':_0x84eb('0x9'),'port':0x11dd});function connectionHandler(_0xb4418a){process[_0x84eb('0xa')](function(){syncho(function(){try{setChannelVariables(_0xb4418a);agiHandler(_0xb4418a);}catch(_0x15c21d){logger[_0x84eb('0xb')](_0x15c21d[_0x84eb('0xc')]);}});});}function listeningHandler(){console[_0x84eb('0xd')](_0x84eb('0xe'),config[_0x84eb('0x5')][_0x84eb('0xf')]);logger[_0x84eb('0x10')](util[_0x84eb('0x11')](_0x84eb('0x12'),config[_0x84eb('0x5')]['ip'],config[_0x84eb('0x5')][_0x84eb('0xf')]));}function errorHandler(_0x516829){if(_0x516829&&_0x516829[_0x84eb('0x13')]&&_0x516829[_0x84eb('0x14')]){logger[_0x84eb('0xb')](util[_0x84eb('0x11')](_0x84eb('0x15'),_0x516829[_0x84eb('0x13')],_0x516829[_0x84eb('0x14')]));}else{logger[_0x84eb('0xb')](util[_0x84eb('0x11')](_0x84eb('0x16'),_0x516829[_0x84eb('0xc')]));}}function closeHandler(){logger[_0x84eb('0x10')](util['format'](_0x84eb('0x17'),this['arg_1'],this['calleridname'],this[_0x84eb('0x18')],this[_0x84eb('0x19')],this[_0x84eb('0x1a')]));try{createSquareReport(this);}catch(_0xb98fec){logger[_0x84eb('0xb')](_0xb98fec['stack']);}}function timeoutHandler(){logger[_0x84eb('0x10')](util[_0x84eb('0x11')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x84eb('0x1b')],this[_0x84eb('0x1c')],this[_0x84eb('0x18')],this['dnid'],this[_0x84eb('0x1a')]));}function hangupHandler(){logger[_0x84eb('0x10')](util[_0x84eb('0x11')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x84eb('0x1b')],this[_0x84eb('0x1c')],this[_0x84eb('0x18')],this[_0x84eb('0x19')],this[_0x84eb('0x1a')]));this[_0x84eb('0x1d')]=!![];}function getRoot(_0x3002ff){return parser[_0x84eb('0x1e')](_0x3002ff,{'object':!![]})[_0x84eb('0x1f')][_0x84eb('0x20')];}function addVertex(_0x336778,_0x114436,_0xf74b){_0x114436[_0x84eb('0x21')]=_0xf74b;if(_0x114436[_0x84eb('0x22')](_0x84eb('0x23'))){_0x114436[_0x84eb('0x24')]=parseInt(_0x114436[_0x84eb('0x23')],0xa);}_0x336778[_0x84eb('0x25')](_['omit'](_0x114436,_0x84eb('0x26')));}function initGraph(_0x2a746d,_0x592005){var _0x9ed341=new Graph();for(var _0x47011c in _0x2a746d){if(_0x2a746d[_0x84eb('0x22')](_0x47011c)){if(_[_0x84eb('0x27')](_0x2a746d[_0x47011c])){for(var _0x1de1fc=0x0;_0x1de1fc<_0x2a746d[_0x47011c][_0x84eb('0x28')];_0x1de1fc+=0x1){addVertex(_0x9ed341,_0x2a746d[_0x47011c][_0x1de1fc],_0x47011c);}}else{addVertex(_0x9ed341,_0x2a746d[_0x47011c],_0x47011c);}}}for(var _0x27228e=0x0;_0x27228e<_0x592005[_0x84eb('0x28')];_0x27228e+=0x1){if(_0x592005[_0x27228e][_0x84eb('0x29')]&&_0x592005[_0x27228e][_0x84eb('0x2a')]){_0x9ed341[_0x84eb('0x2b')](_0x592005[_0x27228e]['source'],_0x592005[_0x27228e][_0x84eb('0x2a')],_0x592005[_0x27228e][_0x84eb('0x2c')]);}}return _0x9ed341;}function getSquareProject(_0x101d55,_0xa8786e){rpc[_0x84eb('0x2d')](_0x101d55)[_0x84eb('0x2e')](function(_0x10bf14){_0xa8786e(null,_0x10bf14);})[_0x84eb('0x2f')](function(_0x17ce0c){_0xa8786e(null,_0x17ce0c);});}function createSquareReport(_0x50c47e,_0x5b8e15){rpc[_0x84eb('0x30')](_0x50c47e)[_0x84eb('0x2e')](function(_0x3155be){if(_0x5b8e15){_0x5b8e15(null,_0x3155be);}})[_0x84eb('0x2f')](function(_0x2c798c){if(_0x5b8e15){_0x5b8e15(null,_0x2c798c);}});}function setChannelVariables(_0x2ab9a9){for(var _0x449da3 in _0x2ab9a9){if(_0x2ab9a9[_0x84eb('0x22')](_0x449da3)){if(_0x449da3[_0x84eb('0x31')]('agi_')===0x0){_0x2ab9a9[_0x449da3['substring'](0x4)]=_0x2ab9a9[_0x449da3];delete _0x2ab9a9[_0x449da3];}}}}function getLogFromObject(_0x5ae937){return util[_0x84eb('0x32')](_0x5ae937,{'showHidden':![],'depth':null});}function agiHandler(_0x24f6b5){var _0x573f65,_0x10e93b,_0xcfb28,_0x3c4422,_0x1ed9cf;logger[_0x84eb('0x33')](_0x84eb('0x34'),JSON['stringify'](_0x24f6b5,null,0x2));logger[_0x84eb('0x10')](util[_0x84eb('0x11')](_0x84eb('0x35'),_0x24f6b5['arg_1'],_0x24f6b5[_0x84eb('0x1c')],_0x24f6b5[_0x84eb('0x18')],_0x24f6b5['dnid'],_0x24f6b5[_0x84eb('0x1a')]));_0x24f6b5['on'](_0x84eb('0xb'),errorHandler);_0x24f6b5['on'](_0x84eb('0x36'),closeHandler);_0x24f6b5['on'](_0x84eb('0x37'),timeoutHandler);_0x24f6b5[_0x84eb('0x1d')]=![];_0x24f6b5['on']('hangup',hangupHandler);var _0x5184af=getSquareProject[_0x84eb('0x38')](null,_0x24f6b5[_0x84eb('0x1b')]);if(_0x5184af){if(_0x5184af['production']){_0x573f65=getRoot(_0x5184af[_0x84eb('0x39')]);if(_0x573f65&&_0x573f65[_0x84eb('0x3a')]){logger[_0x84eb('0x33')]('root',JSON[_0x84eb('0x3b')](_0x573f65,null,0x2));_0x24f6b5[_0x84eb('0x3c')]=moment()['format'](_0x84eb('0x3d'));_0x10e93b=initGraph(_[_0x84eb('0x3e')](_0x573f65,_0x84eb('0x26')),_0x573f65[_0x84eb('0x26')]);_0xcfb28=new Vertices(_0x24f6b5,rpc,mailRpc);logger[_0x84eb('0x10')](util[_0x84eb('0x11')](_0x84eb('0x3f'),_0x24f6b5[_0x84eb('0x1b')],_0x24f6b5['calleridname'],_0x24f6b5['callerid'],_0x24f6b5['dnid'],_0x24f6b5[_0x84eb('0x1a')]));_0x10e93b[_0x84eb('0x40')](_0x573f65['start']['id'],function(_0x4e5e6a){try{_0x4e5e6a=_0xcfb28[_0x84eb('0x41')](_0x4e5e6a);logger[_0x84eb('0x33')](_0x84eb('0x42'),JSON[_0x84eb('0x3b')](_0x4e5e6a,null,0x2));if(_0x4e5e6a[_0x84eb('0x21')]===_0x84eb('0x43')){logger[_0x84eb('0x10')](_0x84eb('0x44'));_0x24f6b5[_0x84eb('0x45')]=_0x4e5e6a[_0x84eb('0x45')]||_0x24f6b5[_0x84eb('0x45')];_0x24f6b5['extension']=_0x4e5e6a['extension'];_0x24f6b5[_0x84eb('0x46')]=_0x4e5e6a['priority']?_0x4e5e6a[_0x84eb('0x46')]-0x1:0x1;return null;}else if(_0x4e5e6a&&_0xcfb28[_0x4e5e6a['agicommand']]){_0x1ed9cf=_0xcfb28[_0x4e5e6a['agicommand']](_0x4e5e6a);logger[_0x84eb('0x10')](_0x84eb('0x47'),JSON[_0x84eb('0x3b')](_0x1ed9cf,null,0x2));if(_0x1ed9cf&&_0x1ed9cf[_0x84eb('0x48')]===AGI_CODE_SUCCESS&&_0x1ed9cf[_0x84eb('0x49')]!==AGI_RESULT_ERROR&&!_0x24f6b5[_0x84eb('0x1d')]){logger[_0x84eb('0x33')](_0x84eb('0x47'),getLogFromObject(_0x1ed9cf));return _[_0x84eb('0x4a')](_0x1ed9cf[_0x84eb('0x49')])?null:_0x1ed9cf[_0x84eb('0x49')][_0x84eb('0x4b')]();}else{logger[_0x84eb('0xb')]('response',getLogFromObject(_0x1ed9cf));return null;}}else{logger[_0x84eb('0xb')](_0x84eb('0x4c'));return null;}}catch(_0x8d3c8d){logger[_0x84eb('0xb')](_0x8d3c8d[_0x84eb('0xc')]);return null;}});if(_0x573f65[_0x84eb('0x4d')]){logger[_0x84eb('0x10')](util[_0x84eb('0x11')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x24f6b5[_0x84eb('0x1b')],_0x24f6b5['calleridname'],_0x24f6b5['callerid'],_0x24f6b5['dnid'],_0x24f6b5[_0x84eb('0x1a')]));_0x10e93b[_0x84eb('0x40')](_0x573f65[_0x84eb('0x4d')]['id'],function(_0x3d7afd){try{_0x3d7afd=_0xcfb28[_0x84eb('0x41')](_0x3d7afd);logger[_0x84eb('0x33')](_0x84eb('0x42'),JSON[_0x84eb('0x3b')](_0x3d7afd,null,0x2));if(_0x3d7afd&&_0xcfb28[_0x3d7afd[_0x84eb('0x21')]]){_0x1ed9cf=_0xcfb28[_0x3d7afd['agicommand']](_0x3d7afd);if(_0x1ed9cf){logger[_0x84eb('0x33')](_0x84eb('0x47'),getLogFromObject(_0x1ed9cf));return _[_0x84eb('0x4a')](_0x1ed9cf['result'])?null:_0x1ed9cf[_0x84eb('0x49')][_0x84eb('0x4b')]();}else{logger[_0x84eb('0xb')](_0x84eb('0x47'),getLogFromObject(_0x1ed9cf));return null;}}else{logger[_0x84eb('0xb')](_0x84eb('0x4c'));return null;}}catch(_0x52e5ac){logger[_0x84eb('0xb')](_0x52e5ac[_0x84eb('0xc')]);return null;}});}logger[_0x84eb('0x10')](util[_0x84eb('0x11')](_0x84eb('0x4e'),_0x24f6b5[_0x84eb('0x1b')],_0x24f6b5['calleridname'],_0x24f6b5[_0x84eb('0x18')],_0x24f6b5[_0x84eb('0x19')],_0x24f6b5[_0x84eb('0x1a')]));logger[_0x84eb('0x10')](util[_0x84eb('0x11')](_0x84eb('0x4f'),_0x24f6b5[_0x84eb('0x45')],_0x24f6b5[_0x84eb('0x50')],parseInt(_0x24f6b5[_0x84eb('0x46')],0xa)+0x1));_0x24f6b5[_0x84eb('0x51')](_0x24f6b5[_0x84eb('0x45')],_0x24f6b5[_0x84eb('0x50')],parseInt(_0x24f6b5['priority'],0xa)+0x1);_0x24f6b5[_0x84eb('0x36')]();}}else{logger['error'](util['format'](_0x84eb('0x52'),_0x24f6b5['arg_1']));_0x24f6b5[_0x84eb('0x51')](_0x24f6b5[_0x84eb('0x45')],_0x24f6b5[_0x84eb('0x50')],parseInt(_0x24f6b5[_0x84eb('0x46')],0xa)+0x1);_0x24f6b5['close']();}}else{logger['error'](util['format'](_0x84eb('0x53'),_0x24f6b5['arg_1']));_0x24f6b5['continueAt'](_0x24f6b5['context'],_0x24f6b5[_0x84eb('0x50')],parseInt(_0x24f6b5[_0x84eb('0x46')],0xa)+0x1);_0x24f6b5[_0x84eb('0x36')]();}}function main(){var _0xafbcb3;return utilLicense['getLicense']()[_0x84eb('0x2e')](function(_0x16fbe0){if(_0x16fbe0){if(_0x16fbe0[_0x84eb('0x54')]){if(_0x16fbe0[_0x84eb('0x55')]&&_0x16fbe0[_0x84eb('0x55')]>0x0){logger['info'](util[_0x84eb('0x11')](_0x84eb('0x56'),_0x16fbe0[_0x84eb('0x55')]));_0xafbcb3=_0x16fbe0[_0x84eb('0x55')];}else{logger[_0x84eb('0x10')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0x84eb('0x10')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0xafbcb3=-0x1;}}})[_0x84eb('0x2f')](function(_0x5290a4){logger[_0x84eb('0xb')]('[LICENSE]',_0x5290a4[_0x84eb('0xc')]);})[_0x84eb('0x4d')](function(){var _0x206a80=require(_0x84eb('0x57'))(config[_0x84eb('0x5')]['port'],config[_0x84eb('0x5')]['ip'],_0xafbcb3);_0x206a80['on'](_0x84eb('0xb'),errorHandler);_0x206a80['on'](_0x84eb('0x58'),listeningHandler);_0x206a80['on'](_0x84eb('0x59'),connectionHandler);_0x206a80['on']('close',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 8f3353e..bdcb7a7 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 _0xcabb=['then','error','message','result','sendMailMessage','SendMail','bluebird','client','http','request'];(function(_0x2562f3,_0x644c8){var _0x218af3=function(_0x46ec0e){while(--_0x46ec0e){_0x2562f3['push'](_0x2562f3['shift']());}};_0x218af3(++_0x644c8);}(_0xcabb,0x1aa));var _0xbcab=function(_0x4bb2c0,_0x4d9659){_0x4bb2c0=_0x4bb2c0-0x0;var _0x84fc=_0xcabb[_0x4bb2c0];return _0x84fc;};'use strict';var BPromise=require(_0xbcab('0x0'));var jayson=require('jayson/promise');var client=jayson[_0xbcab('0x1')][_0xbcab('0x2')]({'port':0x232b});function request(_0x4fc4a1,_0xa4bbeb){return new BPromise(function(_0x3664ab,_0xd2d6e){return client[_0xbcab('0x3')](_0x4fc4a1,_0xa4bbeb)[_0xbcab('0x4')](function(_0x12cbe2){if(_0x12cbe2[_0xbcab('0x5')]){return _0xd2d6e(_0x12cbe2[_0xbcab('0x5')][_0xbcab('0x6')]);}else{return _0x3664ab(_0x12cbe2[_0xbcab('0x7')]);}})['catch'](function(_0xf3165d){return _0xd2d6e(_0xf3165d);});});}exports[_0xbcab('0x8')]=function(_0x2de819,_0x4a1f91){return request(_0xbcab('0x9'),{'account':_0x2de819,'message':_0x4a1f91});}; \ No newline at end of file +var _0x7c29=['sendMailMessage','bluebird','jayson/promise','http','request','then','error','message','result','catch'];(function(_0x2a2166,_0x3a077f){var _0x3bcf50=function(_0x3f0300){while(--_0x3f0300){_0x2a2166['push'](_0x2a2166['shift']());}};_0x3bcf50(++_0x3a077f);}(_0x7c29,0x155));var _0x97c2=function(_0x520aba,_0x2cd633){_0x520aba=_0x520aba-0x0;var _0x56fd74=_0x7c29[_0x520aba];return _0x56fd74;};'use strict';var BPromise=require(_0x97c2('0x0'));var jayson=require(_0x97c2('0x1'));var client=jayson['client'][_0x97c2('0x2')]({'port':0x232b});function request(_0x472f21,_0x5cd3ae){return new BPromise(function(_0x55228f,_0x2a9202){return client[_0x97c2('0x3')](_0x472f21,_0x5cd3ae)[_0x97c2('0x4')](function(_0x30f628){if(_0x30f628[_0x97c2('0x5')]){return _0x2a9202(_0x30f628[_0x97c2('0x5')][_0x97c2('0x6')]);}else{return _0x55228f(_0x30f628[_0x97c2('0x7')]);}})[_0x97c2('0x8')](function(_0x152bd7){return _0x2a9202(_0x152bd7);});});}exports[_0x97c2('0x9')]=function(_0x1155a5,_0x16d62a){return request('SendMail',{'account':_0x1155a5,'message':_0x16d62a});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index e44862b..08cbef2 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 _0x3caa=['slice','emit','exports','util','stream','call','_localBuffer','\x0d\x0a\x0d\x0a','toString','_inBody','indexOf','substring','length','split','trim'];(function(_0x397004,_0x7949f){var _0xa7a10=function(_0x377854){while(--_0x377854){_0x397004['push'](_0x397004['shift']());}};_0xa7a10(++_0x7949f);}(_0x3caa,0x99));var _0xa3ca=function(_0x5cd0bd,_0x189b08){_0x5cd0bd=_0x5cd0bd-0x0;var _0x1bcadf=_0x3caa[_0x5cd0bd];return _0x1bcadf;};'use strict';var util=require(_0xa3ca('0x0'));var Transform=require(_0xa3ca('0x1'))['Transform'];function AGIReply(_0x24754b){Transform[_0xa3ca('0x2')](this,_0x24754b);this[_0xa3ca('0x3')]='';this['_inBody']=![];}util['inherits'](AGIReply,Transform);AGIReply['prototype']['_transform']=function(_0x3eb1fe,_0x39925a,_0x1f7dec){var _0x55d4b1='\x0a',_0xcc654a=['\x0a\x0a',_0xa3ca('0x4')],_0x200f3b=-0x1,_0x949059=-0x1,_0x4e1be8='',_0x534443=0x0,_0x60dbb5='',_0x4260cb='';this[_0xa3ca('0x3')]+=_0x3eb1fe[_0xa3ca('0x5')]();_0x60dbb5=this['_localBuffer'];if(!this[_0xa3ca('0x6')]){_0x534443=0x0;while(_0xcc654a[_0x534443]){while((_0x949059=_0x60dbb5[_0xa3ca('0x7')](_0xcc654a[_0x534443]))!=-0x1){_0x4e1be8=_0xcc654a[_0x534443];_0x4260cb=_0x60dbb5[_0xa3ca('0x8')](0x0,_0x949059);_0x60dbb5=_0x60dbb5[_0xa3ca('0x8')](_0x949059+_0x4e1be8[_0xa3ca('0x9')]);var _0x5c6128=_0x4260cb[_0xa3ca('0xa')](_0x55d4b1),_0xe146e7=0x0,_0xa74a8c={},_0x433738='',_0x779aa7='',_0x47e61e=-0x1;while(_0x5c6128[_0xe146e7]){_0x47e61e=_0x5c6128[_0xe146e7][_0xa3ca('0x7')](':');if(_0x47e61e!=-0x1){_0x433738=_0x5c6128[_0xe146e7]['slice'](0x0,_0x47e61e)[_0xa3ca('0xb')]();_0x779aa7=_0x5c6128[_0xe146e7][_0xa3ca('0xc')](_0x47e61e+0x1)[_0xa3ca('0xb')]();if(_0x433738[_0xa3ca('0x9')]>0x0){_0xa74a8c[_0x433738]=_0x779aa7;}}else{}_0xe146e7++;}this[_0xa3ca('0xd')]('headers',_0xa74a8c);this[_0xa3ca('0x6')]=!![];}_0x534443++;}this['_localBuffer']=_0x60dbb5;}else{while((_0x200f3b=_0x60dbb5['indexOf'](_0x55d4b1))!=-0x1){_0x4260cb=_0x60dbb5[_0xa3ca('0x8')](0x0,_0x200f3b);this['emit']('line',_0x4260cb);_0x60dbb5=_0x60dbb5['substring'](_0x200f3b+_0x55d4b1[_0xa3ca('0x9')]);}this[_0xa3ca('0x3')]=_0x60dbb5;}_0x1f7dec();};module[_0xa3ca('0xe')]=AGIReply; \ No newline at end of file +var _0x3750=['call','_inBody','inherits','_transform','\x0d\x0a\x0d\x0a','toString','_localBuffer','indexOf','substring','length','split','slice','emit','headers','line','exports','util','stream','Transform'];(function(_0x9d1b9c,_0x28cb00){var _0x1b2bdd=function(_0x3c3246){while(--_0x3c3246){_0x9d1b9c['push'](_0x9d1b9c['shift']());}};_0x1b2bdd(++_0x28cb00);}(_0x3750,0xbb));var _0x0375=function(_0x42c6f1,_0x338d7b){_0x42c6f1=_0x42c6f1-0x0;var _0x3c7398=_0x3750[_0x42c6f1];return _0x3c7398;};'use strict';var util=require(_0x0375('0x0'));var Transform=require(_0x0375('0x1'))[_0x0375('0x2')];function AGIReply(_0x147cec){Transform[_0x0375('0x3')](this,_0x147cec);this['_localBuffer']='';this[_0x0375('0x4')]=![];}util[_0x0375('0x5')](AGIReply,Transform);AGIReply['prototype'][_0x0375('0x6')]=function(_0x18a83e,_0x9dbc23,_0x405517){var _0xd3c20a='\x0a',_0x43ba53=['\x0a\x0a',_0x0375('0x7')],_0x4ccebd=-0x1,_0x2fe0f9=-0x1,_0x42c111='',_0x698f18=0x0,_0x37d9d3='',_0x1274b3='';this['_localBuffer']+=_0x18a83e[_0x0375('0x8')]();_0x37d9d3=this[_0x0375('0x9')];if(!this[_0x0375('0x4')]){_0x698f18=0x0;while(_0x43ba53[_0x698f18]){while((_0x2fe0f9=_0x37d9d3[_0x0375('0xa')](_0x43ba53[_0x698f18]))!=-0x1){_0x42c111=_0x43ba53[_0x698f18];_0x1274b3=_0x37d9d3[_0x0375('0xb')](0x0,_0x2fe0f9);_0x37d9d3=_0x37d9d3[_0x0375('0xb')](_0x2fe0f9+_0x42c111[_0x0375('0xc')]);var _0x3158b0=_0x1274b3[_0x0375('0xd')](_0xd3c20a),_0x46af03=0x0,_0x3b8176={},_0x45418c='',_0x8484d0='',_0x48f8c3=-0x1;while(_0x3158b0[_0x46af03]){_0x48f8c3=_0x3158b0[_0x46af03]['indexOf'](':');if(_0x48f8c3!=-0x1){_0x45418c=_0x3158b0[_0x46af03][_0x0375('0xe')](0x0,_0x48f8c3)['trim']();_0x8484d0=_0x3158b0[_0x46af03][_0x0375('0xe')](_0x48f8c3+0x1)['trim']();if(_0x45418c[_0x0375('0xc')]>0x0){_0x3b8176[_0x45418c]=_0x8484d0;}}else{}_0x46af03++;}this[_0x0375('0xf')](_0x0375('0x10'),_0x3b8176);this[_0x0375('0x4')]=!![];}_0x698f18++;}this[_0x0375('0x9')]=_0x37d9d3;}else{while((_0x4ccebd=_0x37d9d3[_0x0375('0xa')](_0xd3c20a))!=-0x1){_0x1274b3=_0x37d9d3[_0x0375('0xb')](0x0,_0x4ccebd);this[_0x0375('0xf')](_0x0375('0x11'),_0x1274b3);_0x37d9d3=_0x37d9d3['substring'](_0x4ccebd+_0xd3c20a['length']);}this['_localBuffer']=_0x37d9d3;}_0x405517();};module[_0x0375('0x12')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index a1c8b62..b2c3f6c 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 _0xee8c=['phone','ListId','CreateCmContact','getPauseById','ShowPause','LoginUser','agentPause','UnpauseUser','agentLogout','moment','lodash','util','client','http','then','message','result','getSquareProject','getMailAccountById','MailServerOut','Smtp','email','getSquareProjectById','ShowSquareProject','name','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowSquareOdbc','getUserById','ShowUser','getTrunkById','ShowTrunk','getSoundById','ShowSound','getIntervalById','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','createSquareMessage','ShowCmHopper'];(function(_0x2a25eb,_0x131fe3){var _0x23e20a=function(_0x3524ad){while(--_0x3524ad){_0x2a25eb['push'](_0x2a25eb['shift']());}};_0x23e20a(++_0x131fe3);}(_0xee8c,0x108));var _0xcee8=function(_0xff7c19,_0x3851ad){_0xff7c19=_0xff7c19-0x0;var _0x4cf916=_0xee8c[_0xff7c19];return _0x4cf916;};'use strict';var BPromise=require('bluebird');var moment=require(_0xcee8('0x0'));var _=require(_0xcee8('0x1'));var util=require(_0xcee8('0x2'));var jayson=require('jayson/promise');var client=jayson[_0xcee8('0x3')][_0xcee8('0x4')]({'port':0x2329});function request(_0x2e2ddc,_0x47c229){return new BPromise(function(_0x101812,_0x373471){return client['request'](_0x2e2ddc,_0x47c229)[_0xcee8('0x5')](function(_0x52471a){if(_0x52471a['error']){return _0x373471(_0x52471a['error'][_0xcee8('0x6')]);}else{return _0x101812(_0x52471a[_0xcee8('0x7')]);}})['catch'](function(_0x32b1c3){return _0x373471(_0x32b1c3);});});}exports[_0xcee8('0x8')]=function(_0x18d3a4){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x18d3a4},'attributes':['production']}});};exports[_0xcee8('0x9')]=function(_0x110b83){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x110b83},'include':[{'model':_0xcee8('0xa'),'as':_0xcee8('0xb')}],'attributes':['id','name',_0xcee8('0xc')]}});};exports[_0xcee8('0xd')]=function(_0x485170){return request(_0xcee8('0xe'),{'options':{'where':{'id':_0x485170},'attributes':[_0xcee8('0xf')]}});};exports[_0xcee8('0x10')]=function(_0x34fae2){return request(_0xcee8('0x11'),{'options':{'where':{'id':_0x34fae2},'attributes':[_0xcee8('0xf')]}});};exports[_0xcee8('0x12')]=function(_0x3bffb9){return request('ShowVariable',{'options':{'where':{'id':_0x3bffb9},'attributes':[_0xcee8('0xf')]}});};exports['getSquareOdbcById']=function(_0x24949d){return request(_0xcee8('0x13'),{'options':{'where':{'id':_0x24949d},'attributes':['dsn']}});};exports[_0xcee8('0x14')]=function(_0x579f6a){return request(_0xcee8('0x15'),{'options':{'where':{'id':_0x579f6a},'attributes':['name']}});};exports[_0xcee8('0x16')]=function(_0x33ecd7){return request(_0xcee8('0x17'),{'options':{'where':{'id':_0x33ecd7},'attributes':[_0xcee8('0xf')]}});};exports[_0xcee8('0x18')]=function(_0xeab999){return request(_0xcee8('0x19'),{'options':{'where':{'id':_0xeab999},'attributes':['save_name']}});};exports[_0xcee8('0x1a')]=function(_0x13ab12){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x13ab12},'include':[{'model':_0xcee8('0x1b'),'as':_0xcee8('0x1c')}]}});};exports[_0xcee8('0x1d')]=function(_0x2f7ed9){return request(_0xcee8('0x1e'),{'options':{'where':{'id':_0x2f7ed9},'attributes':['id',_0xcee8('0xf')]}});};exports[_0xcee8('0x1f')]=function(_0x22b695){return request(_0xcee8('0x20'),{'body':_0x22b695});};exports[_0xcee8('0x21')]=function(_0x3dfad2){return request(_0xcee8('0x22'),{'body':_0x3dfad2});};exports[_0xcee8('0x23')]=function(_0x5f0177){return request(_0xcee8('0x24'),{'body':_['merge'](_0x5f0177,{'project_name':_0x5f0177['arg_1'],'prev_project_name':_0x5f0177[_0xcee8('0x25')]||'','is_subproject':_0x5f0177[_0xcee8('0x25')]?!![]:![],'leaveAt':moment()['format'](_0xcee8('0x26'))})});};exports[_0xcee8('0x27')]=function(_0x13449d){return request('CreateSquareRecording',{'body':_0x13449d});};exports[_0xcee8('0x28')]=function(_0x122bc3){return request('CreateSquareMessage',{'body':_0x122bc3});};exports['createCmContact']=function(_0x3aa39d){return request(_0xcee8('0x29'),{'options':{'raw':![],'where':{'phone':_0x3aa39d[_0xcee8('0x2a')],'ListId':_0x3aa39d[_0xcee8('0x2b')]}}})['then'](function(_0x5d3464){if(_0x5d3464){return _0x5d3464;}return request(_0xcee8('0x2c'),{'body':_0x3aa39d});});};exports[_0xcee8('0x2d')]=function(_0x4ec842){return request(_0xcee8('0x2e'),{'options':{'where':{'id':_0x4ec842},'attributes':[_0xcee8('0xf')]}});};exports['agentLogin']=function(_0x6f8fa4,_0x412ef3){return request(_0xcee8('0x2f'),{'body':{'interface':_0x412ef3},'options':{'where':_0x6f8fa4}});};exports[_0xcee8('0x30')]=function(_0x42d4f9,_0x333ae0,_0x100ee6){return request('PauseUser',{'body':{'type':_0x333ae0,'uniqueid':_0x100ee6},'options':{'where':_0x42d4f9}});};exports['agentUnpause']=function(_0x5b2f87){return request(_0xcee8('0x31'),{'body':{},'options':{'where':_0x5b2f87}});};exports[_0xcee8('0x32')]=function(_0x1b35c3){return request('LogoutUser',{'body':{},'options':{'where':_0x1b35c3}});}; \ No newline at end of file +var _0xa9ac=['format','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','CreateCmContact','getPauseById','LoginUser','PauseUser','UnpauseUser','agentLogout','jayson/promise','client','http','request','then','error','result','catch','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','name','email','getSquareProjectById','getVoiceQueueById','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','getUserById','ShowTrunk','getSoundById','save_name','getIntervalById','ShowInterval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','CreateSquareReport','arg_1','arg_2'];(function(_0x3cd18d,_0x11a2e2){var _0x407a71=function(_0x5362f2){while(--_0x5362f2){_0x3cd18d['push'](_0x3cd18d['shift']());}};_0x407a71(++_0x11a2e2);}(_0xa9ac,0x182));var _0xca9a=function(_0x53bfdb,_0x8ecab3){_0x53bfdb=_0x53bfdb-0x0;var _0x469b15=_0xa9ac[_0x53bfdb];return _0x469b15;};'use strict';var BPromise=require('bluebird');var moment=require('moment');var _=require('lodash');var util=require('util');var jayson=require(_0xca9a('0x0'));var client=jayson[_0xca9a('0x1')][_0xca9a('0x2')]({'port':0x2329});function request(_0x8a9ad4,_0x1c1cd7){return new BPromise(function(_0x11f8da,_0x1c5dfd){return client[_0xca9a('0x3')](_0x8a9ad4,_0x1c1cd7)[_0xca9a('0x4')](function(_0x59dafd){if(_0x59dafd[_0xca9a('0x5')]){return _0x1c5dfd(_0x59dafd[_0xca9a('0x5')]['message']);}else{return _0x11f8da(_0x59dafd[_0xca9a('0x6')]);}})[_0xca9a('0x7')](function(_0x5648ca){return _0x1c5dfd(_0x5648ca);});});}exports[_0xca9a('0x8')]=function(_0x5e785f){return request(_0xca9a('0x9'),{'options':{'raw':![],'where':{'name':_0x5e785f},'attributes':[_0xca9a('0xa')]}});};exports[_0xca9a('0xb')]=function(_0x1ea634){return request(_0xca9a('0xc'),{'options':{'raw':![],'where':{'id':_0x1ea634},'include':[{'model':_0xca9a('0xd'),'as':'Smtp'}],'attributes':['id',_0xca9a('0xe'),_0xca9a('0xf')]}});};exports[_0xca9a('0x10')]=function(_0x567ee0){return request(_0xca9a('0x9'),{'options':{'where':{'id':_0x567ee0},'attributes':[_0xca9a('0xe')]}});};exports[_0xca9a('0x11')]=function(_0x32340b){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x32340b},'attributes':[_0xca9a('0xe')]}});};exports[_0xca9a('0x12')]=function(_0x3c0d2e){return request(_0xca9a('0x13'),{'options':{'where':{'id':_0x3c0d2e},'attributes':[_0xca9a('0xe')]}});};exports[_0xca9a('0x14')]=function(_0x29a008){return request(_0xca9a('0x15'),{'options':{'where':{'id':_0x29a008},'attributes':['dsn']}});};exports[_0xca9a('0x16')]=function(_0x84ec92){return request('ShowUser',{'options':{'where':{'id':_0x84ec92},'attributes':[_0xca9a('0xe')]}});};exports['getTrunkById']=function(_0x41ca0b){return request(_0xca9a('0x17'),{'options':{'where':{'id':_0x41ca0b},'attributes':[_0xca9a('0xe')]}});};exports[_0xca9a('0x18')]=function(_0x5f0e7a){return request('ShowSound',{'options':{'where':{'id':_0x5f0e7a},'attributes':[_0xca9a('0x19')]}});};exports[_0xca9a('0x1a')]=function(_0x27a917){return request(_0xca9a('0x1b'),{'options':{'raw':![],'where':{'id':_0x27a917},'include':[{'model':'Interval','as':_0xca9a('0x1c')}]}});};exports[_0xca9a('0x1d')]=function(_0x59a0cc){return request(_0xca9a('0x1e'),{'options':{'where':{'id':_0x59a0cc},'attributes':['id',_0xca9a('0xe')]}});};exports[_0xca9a('0x1f')]=function(_0x515e62){return request(_0xca9a('0x20'),{'body':_0x515e62});};exports[_0xca9a('0x21')]=function(_0x467a4b){return request(_0xca9a('0x22'),{'body':_0x467a4b});};exports['createSquareReport']=function(_0x3b494c){return request(_0xca9a('0x23'),{'body':_['merge'](_0x3b494c,{'project_name':_0x3b494c[_0xca9a('0x24')],'prev_project_name':_0x3b494c[_0xca9a('0x25')]||'','is_subproject':_0x3b494c[_0xca9a('0x25')]?!![]:![],'leaveAt':moment()[_0xca9a('0x26')](_0xca9a('0x27'))})});};exports['createSquareRecording']=function(_0x28fa44){return request(_0xca9a('0x28'),{'body':_0x28fa44});};exports[_0xca9a('0x29')]=function(_0x4c8314){return request(_0xca9a('0x2a'),{'body':_0x4c8314});};exports[_0xca9a('0x2b')]=function(_0x39916e){return request(_0xca9a('0x2c'),{'options':{'raw':![],'where':{'phone':_0x39916e[_0xca9a('0x2d')],'ListId':_0x39916e[_0xca9a('0x2e')]}}})['then'](function(_0xab4871){if(_0xab4871){return _0xab4871;}return request(_0xca9a('0x2f'),{'body':_0x39916e});});};exports[_0xca9a('0x30')]=function(_0x4d4622){return request('ShowPause',{'options':{'where':{'id':_0x4d4622},'attributes':['name']}});};exports['agentLogin']=function(_0x49a7b8,_0x4f751e){return request(_0xca9a('0x31'),{'body':{'interface':_0x4f751e},'options':{'where':_0x49a7b8}});};exports['agentPause']=function(_0x2103d9,_0x3bcd87,_0x1434e6){return request(_0xca9a('0x32'),{'body':{'type':_0x3bcd87,'uniqueid':_0x1434e6},'options':{'where':_0x2103d9}});};exports['agentUnpause']=function(_0x498501){return request(_0xca9a('0x33'),{'body':{},'options':{'where':_0x498501}});};exports[_0xca9a('0x34')]=function(_0x106835){return request('LogoutUser',{'body':{},'options':{'where':_0x106835}});}; \ 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 e4691e8..163d7ad 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 _0x7ebb=['./lex','exports','./polly'];(function(_0x2ed6f3,_0x4e5db9){var _0x455e65=function(_0x490f66){while(--_0x490f66){_0x2ed6f3['push'](_0x2ed6f3['shift']());}};_0x455e65(++_0x4e5db9);}(_0x7ebb,0x161));var _0xb7eb=function(_0x35a1cb,_0x5985c3){_0x35a1cb=_0x35a1cb-0x0;var _0x2cd095=_0x7ebb[_0x35a1cb];return _0x2cd095;};var polly=require(_0xb7eb('0x0'));var lex=require(_0xb7eb('0x1'));module[_0xb7eb('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xf417=['exports','./lex'];(function(_0x19eac3,_0x4a9eb3){var _0x337ea2=function(_0x5e2ae4){while(--_0x5e2ae4){_0x19eac3['push'](_0x19eac3['shift']());}};_0x337ea2(++_0x4a9eb3);}(_0xf417,0x8f));var _0x7f41=function(_0x4343f1,_0x325dce){_0x4343f1=_0x4343f1-0x0;var _0x5d84a0=_0xf417[_0x4343f1];return _0x5d84a0;};var polly=require('./polly');var lex=require(_0x7f41('0x0'));module[_0x7f41('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 1c12fd9..7c09bf8 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 _0x2547=['exports'];(function(_0x2c3642,_0x5cd3a0){var _0x302dfc=function(_0x317eec){while(--_0x317eec){_0x2c3642['push'](_0x2c3642['shift']());}};_0x302dfc(++_0x5cd3a0);}(_0x2547,0x1cd));var _0x7254=function(_0x226992,_0x5bcfa5){_0x226992=_0x226992-0x0;var _0x5c7f48=_0x2547[_0x226992];return _0x5c7f48;};'use strict';var lex=require('./lib/api');module[_0x7254('0x0')]=function(_0x23e38c,_0x44b692,_0x3ea6e6,_0xbbc747,_0x1a36de,_0x9f3435){return lex(_0x23e38c,_0x44b692,_0x3ea6e6,_0xbbc747,_0x1a36de,_0x9f3435);}; \ No newline at end of file +var _0xd8b0=['exports','./lib/api'];(function(_0x27ea1f,_0x4dbc9c){var _0x30872f=function(_0x355b18){while(--_0x355b18){_0x27ea1f['push'](_0x27ea1f['shift']());}};_0x30872f(++_0x4dbc9c);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var lex=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]=function(_0x5a55a3,_0x585166,_0x4b72b0,_0x3ff8df,_0x5b9b89,_0x43bca1){return lex(_0x5a55a3,_0x585166,_0x4b72b0,_0x3ff8df,_0x5b9b89,_0x43bca1);}; \ 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 351eb25..d00d597 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(_0x52fd5d,_0x32ef67){var _0x4cdadf=function(_0x266c81){while(--_0x266c81){_0x52fd5d['push'](_0x52fd5d['shift']());}};_0x4cdadf(++_0x32ef67);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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(_0x2f23cd,_0x9fd770){var _0x135019=function(_0x3e4dbf){while(--_0x3e4dbf){_0x2f23cd['push'](_0x2f23cd['shift']());}};_0x135019(++_0x9fd770);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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 2890401..d088ba3 100644 --- a/server/services/agi/scripts/aws/polly/index.js +++ b/server/services/agi/scripts/aws/polly/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaad8=['./lib/api','exports'];(function(_0x4013a4,_0x3dea38){var _0x33be86=function(_0x1e42ee){while(--_0x1e42ee){_0x4013a4['push'](_0x4013a4['shift']());}};_0x33be86(++_0x3dea38);}(_0xaad8,0x110));var _0x8aad=function(_0x51c235,_0x4d3844){_0x51c235=_0x51c235-0x0;var _0x5dd506=_0xaad8[_0x51c235];return _0x5dd506;};'use strict';var polly=require(_0x8aad('0x0'));module[_0x8aad('0x1')]=function(_0x966c0f,_0x5ef458,_0x5ddb53,_0x2f2f0e,_0x43db9d,_0x3802f2,_0x1b3fa0){return polly(_0x966c0f,_0x5ef458,_0x5ddb53,_0x2f2f0e,_0x43db9d,_0x3802f2,_0x1b3fa0);}; \ No newline at end of file +var _0x0e36=['./lib/api','exports'];(function(_0x217490,_0xa23332){var _0x5b9baa=function(_0x381ef2){while(--_0x381ef2){_0x217490['push'](_0x217490['shift']());}};_0x5b9baa(++_0xa23332);}(_0x0e36,0x64));var _0x60e3=function(_0xb5f0c9,_0x3c150f){_0xb5f0c9=_0xb5f0c9-0x0;var _0x45539e=_0x0e36[_0xb5f0c9];return _0x45539e;};'use strict';var polly=require(_0x60e3('0x0'));module[_0x60e3('0x1')]=function(_0x2ad5db,_0x440c2a,_0xc7609,_0x28c3ac,_0x3e00be,_0x543ec9,_0x4be8c3){return polly(_0x2ad5db,_0x440c2a,_0xc7609,_0x28c3ac,_0x3e00be,_0x543ec9,_0x4be8c3);}; \ 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 6ee1181..db09ae2 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 _0x50bb=['writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','text','mp3','path','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x50bb,0x66));var _0xb50b=function(_0x4545c4,_0x4967a0){_0x4545c4=_0x4545c4-0x0;var _0x1d17c2=_0x50bb[_0x4545c4];return _0x1d17c2;};'use strict';var fs=require('fs');var path=require(_0xb50b('0x0'));var BPromise=require(_0xb50b('0x1'));var rs=require(_0xb50b('0x2'));var AWS=require(_0xb50b('0x3'));function pollyResult(_0x327dcc,_0x5d5046,_0x5aec8a){return new BPromise(function(_0x4b80cf,_0x527ad3){_0x327dcc[_0xb50b('0x4')](_0x5d5046,function(_0x24861c,_0x44f7cf){if(_0x24861c){_0x527ad3(_0x24861c);}else if(_0x44f7cf){if(_0x44f7cf[_0xb50b('0x5')]instanceof Buffer){fs[_0xb50b('0x6')](_0x5aec8a,_0x44f7cf['AudioStream'],function(_0x53c861){if(_0x53c861){_0x527ad3(_0x53c861);}else{_0x4b80cf();}});}else{_0x527ad3(new Error(_0xb50b('0x7')));}}else{_0x527ad3(new Error(_0xb50b('0x8')));}});});}module[_0xb50b('0x9')]=function(_0x1ebb65,_0x5ccbcb,_0x35d0f9,_0x37d603,_0x4bb900,_0x4bcb5e,_0xa3e4d4){var _0x2cfaa7=new AWS['Polly']({'accessKeyId':_0x1ebb65,'secretAccessKey':_0x5ccbcb,'region':_0x35d0f9});var _0xd5b4e2={'Text':_0x4bb900,'TextType':_0x4bcb5e||_0xb50b('0xa'),'OutputFormat':_0xb50b('0xb'),'VoiceId':_0x37d603};return pollyResult(_0x2cfaa7,_0xd5b4e2,_0xa3e4d4);}; \ No newline at end of file +var _0x9220=['synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','Polly','text','mp3','path','bluebird','randomstring','aws-sdk'];(function(_0x47367e,_0x4fc36c){var _0x167882=function(_0x393bab){while(--_0x393bab){_0x47367e['push'](_0x47367e['shift']());}};_0x167882(++_0x4fc36c);}(_0x9220,0x68));var _0x0922=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0x9220[_0x32b542];return _0x554d54;};'use strict';var fs=require('fs');var path=require(_0x0922('0x0'));var BPromise=require(_0x0922('0x1'));var rs=require(_0x0922('0x2'));var AWS=require(_0x0922('0x3'));function pollyResult(_0x197e41,_0x3dbf8d,_0x39d523){return new BPromise(function(_0x6f414a,_0x2f0777){_0x197e41[_0x0922('0x4')](_0x3dbf8d,function(_0x2709e1,_0x5c77c5){if(_0x2709e1){_0x2f0777(_0x2709e1);}else if(_0x5c77c5){if(_0x5c77c5[_0x0922('0x5')]instanceof Buffer){fs[_0x0922('0x6')](_0x39d523,_0x5c77c5[_0x0922('0x5')],function(_0x3622b2){if(_0x3622b2){_0x2f0777(_0x3622b2);}else{_0x6f414a();}});}else{_0x2f0777(new Error(_0x0922('0x7')));}}else{_0x2f0777(new Error(_0x0922('0x8')));}});});}module['exports']=function(_0x5dc96a,_0x35dd05,_0x42d332,_0x453683,_0x42ebe8,_0x330b02,_0x14fd48){var _0x5b92a7=new AWS[(_0x0922('0x9'))]({'accessKeyId':_0x5dc96a,'secretAccessKey':_0x35dd05,'region':_0x42d332});var _0x9a8049={'Text':_0x42ebe8,'TextType':_0x330b02||_0x0922('0xa'),'OutputFormat':_0x0922('0xb'),'VoiceId':_0x453683};return pollyResult(_0x5b92a7,_0x9a8049,_0x14fd48);}; \ 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 31a3831..787e754 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 _0x7685=['./lib/api'];(function(_0x23ab91,_0x7876cb){var _0x4b681c=function(_0x482ec6){while(--_0x482ec6){_0x23ab91['push'](_0x23ab91['shift']());}};_0x4b681c(++_0x7876cb);}(_0x7685,0x1e8));var _0x5768=function(_0x1968f4,_0x60bc27){_0x1968f4=_0x1968f4-0x0;var _0x15c6ef=_0x7685[_0x1968f4];return _0x15c6ef;};'use strict';var asr=require(_0x5768('0x0'));module['exports']=function(_0x9da3c0,_0x26bd2f,_0x5c97c5,_0x59e618){return asr(_0x9da3c0,_0x26bd2f,_0x5c97c5);}; \ No newline at end of file +var _0x40a5=['./lib/api'];(function(_0x415a3b,_0x22a6b1){var _0xe84651=function(_0x5316ec){while(--_0x5316ec){_0x415a3b['push'](_0x415a3b['shift']());}};_0xe84651(++_0x22a6b1);}(_0x40a5,0x1b0));var _0x540a=function(_0x4b8968,_0x5c9b44){_0x4b8968=_0x4b8968-0x0;var _0x3a0ab7=_0x40a5[_0x4b8968];return _0x3a0ab7;};'use strict';var asr=require(_0x540a('0x0'));module['exports']=function(_0x1f0201,_0x152fa6,_0x594f38,_0x4630e4){return asr(_0x1f0201,_0x152fa6,_0x594f38);}; \ 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 0727330..69574fa 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 _0x34b2=['POST','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','base64'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x34b2,0x11c));var _0x234b=function(_0xfac6cd,_0x32fb94){_0xfac6cd=_0xfac6cd-0x0;var _0xeb2337=_0x34b2[_0xfac6cd];return _0xeb2337;};'use strict';var url=require(_0x234b('0x0'));var BPromise=require(_0x234b('0x1'));var fs=require('fs');var host=_0x234b('0x2');module[_0x234b('0x3')]=function(_0x373af7,_0x15fe02,_0x1f63a5){return new BPromise(function(_0x224eb0,_0x43cd81){var _0x55819c;if(typeof _0x373af7!==_0x234b('0x4')||_0x373af7[_0x234b('0x5')]===0x0){return _0x43cd81(_0x234b('0x6'));}if(typeof _0x15fe02!=='string'||_0x15fe02['length']===0x0){return _0x43cd81('key\x20should\x20be\x20a\x20string');}if(typeof _0x1f63a5!==_0x234b('0x7')&&(typeof _0x1f63a5!==_0x234b('0x4')||_0x1f63a5[_0x234b('0x5')]===0x0)){return _0x43cd81(_0x234b('0x8'));}try{_0x55819c=fs['readFileSync'](_0x373af7)['toString'](_0x234b('0x9'));}catch(_0x3a900b){return _0x43cd81(_0x3a900b);}return _0x224eb0({'method':_0x234b('0xa'),'uri':host+_0x234b('0xb')+_0x15fe02,'body':{'config':{'encoding':_0x234b('0xc'),'sampleRateHertz':_0x234b('0xd'),'languageCode':_0x1f63a5},'audio':{'content':_0x55819c}},'json':!![]});});}; \ No newline at end of file +var _0xc3fe=['lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','string','length'];(function(_0x1820f1,_0x1403e7){var _0x167aed=function(_0x4c89f5){while(--_0x4c89f5){_0x1820f1['push'](_0x1820f1['shift']());}};_0x167aed(++_0x1403e7);}(_0xc3fe,0xff));var _0xec3f=function(_0x4d4fe1,_0x5bedc7){_0x4d4fe1=_0x4d4fe1-0x0;var _0x3b6366=_0xc3fe[_0x4d4fe1];return _0x3b6366;};'use strict';var url=require(_0xec3f('0x0'));var BPromise=require(_0xec3f('0x1'));var fs=require('fs');var host=_0xec3f('0x2');module['exports']=function(_0x15ddf0,_0x2a45d9,_0x2d85fc){return new BPromise(function(_0x553ad4,_0x3e6b6e){var _0xda4641;if(typeof _0x15ddf0!==_0xec3f('0x3')||_0x15ddf0['length']===0x0){return _0x3e6b6e('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x2a45d9!==_0xec3f('0x3')||_0x2a45d9[_0xec3f('0x4')]===0x0){return _0x3e6b6e('key\x20should\x20be\x20a\x20string');}if(typeof _0x2d85fc!=='undefined'&&(typeof _0x2d85fc!==_0xec3f('0x3')||_0x2d85fc['length']===0x0)){return _0x3e6b6e(_0xec3f('0x5'));}try{_0xda4641=fs[_0xec3f('0x6')](_0x15ddf0)[_0xec3f('0x7')](_0xec3f('0x8'));}catch(_0x54a3fc){return _0x3e6b6e(_0x54a3fc);}return _0x553ad4({'method':_0xec3f('0x9'),'uri':host+_0xec3f('0xa')+_0x2a45d9,'body':{'config':{'encoding':_0xec3f('0xb'),'sampleRateHertz':_0xec3f('0xc'),'languageCode':_0x2d85fc},'audio':{'content':_0xda4641}},'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 dd8874a..13ee7c5 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 _0x1bf2=['exports'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0x1bf2,0x1ac));var _0x21bf=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x1bf2[_0x5ddb1c];return _0x354adc;};var asr=require('./asr');module[_0x21bf('0x0')]={'asr':asr}; \ No newline at end of file +var _0x18d8=['exports','./asr'];(function(_0x1e3ee9,_0x2b0ffb){var _0x185bb8=function(_0x4c562b){while(--_0x4c562b){_0x1e3ee9['push'](_0x1e3ee9['shift']());}};_0x185bb8(++_0x2b0ffb);}(_0x18d8,0x119));var _0x818d=function(_0x1f51b9,_0x2ebd2b){_0x1f51b9=_0x1f51b9-0x0;var _0xf81150=_0x18d8[_0x1f51b9];return _0xf81150;};var asr=require(_0x818d('0x0'));module[_0x818d('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index 145a389..bd545dc 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 _0xedc7=['./sestek','./tilde','agi','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','request\x20to\x20','info','pipe','end','path','get','data','wav','error\x20convert','tmp','generate','.wav','writeFileSync','base64','then','chmodSync','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','input','voice','audioConfig','MP3','POST','resolve','.mp3','from','audioContent','unlink','googleCloudTTS\x20path','googleTTS','utf8','f.req=','stringify','null','generic','slice','parse\x20response\x20failed:\x0a','length','\x22\x20might\x20not\x20exist','goggleTTS\x20path','asr','uri','results','map','alternatives','transcript','join','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','source','result','action','fulfillment','speech','code','metadata','isFallbackIntent','googleDialogflowV2','replace','sessionPath','detectIntent','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','intent','displayName','isFallback','queryText','responseId','intentDetectionConfidence','fulfillmentText','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','confidence','awsPolly','polly','awsLex','ispeechTTS','format','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','apiai-promise','bluebird','dialogflow','md5','querystring','randomstring','sox','url','parse','util','./aws','./google'];(function(_0xefb4e,_0xe56689){var _0x36c78c=function(_0x158fe3){while(--_0x158fe3){_0xefb4e['push'](_0xefb4e['shift']());}};_0x36c78c(++_0xe56689);}(_0xedc7,0x77));var _0x7edc=function(_0x486442,_0xfcf71f){_0x486442=_0x486442-0x0;var _0x4be075=_0xedc7[_0x486442];return _0x4be075;};'use strict';var apiai=require(_0x7edc('0x0'));var BPromise=require(_0x7edc('0x1'));var dialogflow=require(_0x7edc('0x2'));var fs=require('fs');var http=require('http');var https=require('https');var md5=require(_0x7edc('0x3'));var path=require('path');var querystring=require(_0x7edc('0x4'));var rp=require('request-promise');var rs=require(_0x7edc('0x5'));var sox=require(_0x7edc('0x6'));var tts=require('google-tts-api');var urlParse=require(_0x7edc('0x7'))[_0x7edc('0x8')];var util=require(_0x7edc('0x9'));var aws=require(_0x7edc('0xa'));var google=require(_0x7edc('0xb'));var sestek=require(_0x7edc('0xc'));var tilde=require(_0x7edc('0xd'));var logger=require('../../../config/logger')(_0x7edc('0xe'));var ISPEECH_API=_0x7edc('0xf');function downloadFile(_0x58d22b,_0x22b953){return new BPromise(function(_0x1a59d1,_0x22189a){var _0x298a5d=urlParse(_0x58d22b);var _0x54789a=_0x298a5d[_0x7edc('0x10')]===_0x7edc('0x11')?https:http;var _0x18b6b4={'host':_0x298a5d[_0x7edc('0x12')],'path':_0x298a5d['path'],'headers':{'user-agent':_0x7edc('0x13')}};_0x54789a['get'](_0x18b6b4,function(_0x2ff9ae){if(_0x2ff9ae[_0x7edc('0x14')]!==0xc8){logger[_0x7edc('0x15')]('request\x20to\x20'+_0x58d22b+_0x7edc('0x16')+_0x2ff9ae[_0x7edc('0x14')]+'\x20('+_0x2ff9ae[_0x7edc('0x17')]+')');_0x22189a(new Error(_0x7edc('0x18')+_0x58d22b+_0x7edc('0x16')+_0x2ff9ae[_0x7edc('0x14')]+'\x20('+_0x2ff9ae[_0x7edc('0x17')]+')'));return;}var _0x152f15=fs['createWriteStream'](_0x22b953);_0x152f15['on']('finish',function(){logger[_0x7edc('0x19')]('finish\x20download\x20file');_0x152f15['close'](_0x1a59d1);});_0x152f15['on']('error',function(_0x21cebf){fs['unlink'](_0x22b953);logger[_0x7edc('0x15')]('download\x20error',_0x21cebf);_0x22189a(_0x21cebf);});_0x2ff9ae[_0x7edc('0x1a')](_0x152f15);})['on'](_0x7edc('0x15'),function(_0x4674d4){logger[_0x7edc('0x15')](_0x4674d4);_0x22189a(_0x4674d4);})[_0x7edc('0x1b')]();});}function uploadFile(_0xd62da6){return new BPromise(function(_0x17f01b,_0xb942b1){var _0x38921a=urlParse(_0xd62da6);var _0x488468=_0x38921a[_0x7edc('0x10')]===_0x7edc('0x11')?https:http;var _0x2d5fec={'host':_0x38921a[_0x7edc('0x12')],'path':_0x38921a[_0x7edc('0x1c')],'headers':{'user-agent':_0x7edc('0x13')}};_0x488468[_0x7edc('0x1d')](_0x2d5fec,function(_0x7d628b){if(_0x7d628b[_0x7edc('0x14')]!==0xc8){_0xb942b1(new Error(_0x7edc('0x18')+_0xd62da6+'\x20failed,\x20status\x20code\x20=\x20'+_0x7d628b['statusCode']+'\x20('+_0x7d628b[_0x7edc('0x17')]+')'));return;}var _0x1a8ca8='';_0x7d628b['on'](_0x7edc('0x1e'),function(_0x54b024){_0x1a8ca8+=_0x54b024;});_0x7d628b['on']('end',function(){_0x17f01b(_0x1a8ca8);});})['on'](_0x7edc('0x15'),function(_0xaa76be){_0xb942b1(_0xaa76be);})[_0x7edc('0x1b')]();});}function convertFile(_0x26065d,_0xfd763c){return new BPromise(function(_0xa0b4d6,_0x973273){var _0x20eb1b=sox['transcode'](_0x26065d,_0xfd763c,{'sampleRate':0x1f40,'format':_0x7edc('0x1f'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x20eb1b['on']('error',function(_0x59e712){logger[_0x7edc('0x15')](_0x7edc('0x20'),_0x59e712);_0x973273(_0x59e712);});_0x20eb1b['on'](_0x7edc('0x1b'),function(){logger['info']('finish\x20to\x20convert');_0xa0b4d6();});_0x20eb1b['start']();});}function base64Decode(_0x555736,_0x1e0d96){var _0x34afd5=path['resolve'](__dirname,_0x7edc('0x21'),rs[_0x7edc('0x22')](0x4)+_0x7edc('0x23'));fs[_0x7edc('0x24')](_0x34afd5,_0x555736,_0x7edc('0x25'));return convertFile(_0x34afd5,_0x1e0d96)[_0x7edc('0x26')](function(){try{fs['unlink'](_0x34afd5);fs[_0x7edc('0x27')](_0x1e0d96,_0x7edc('0x28'));}catch(_0x2fb9f2){logger[_0x7edc('0x15')](_0x2fb9f2);}return _0x1e0d96[_0x7edc('0x29')]('.')[0x0];});}function base64Encode(_0xcf3b78){var _0x13202f=fs[_0x7edc('0x2a')](_0xcf3b78);return new Buffer(_0x13202f)[_0x7edc('0x2b')]('base64');}exports[_0x7edc('0x2c')]=function(_0x18ea4e,_0x1c0501,_0x5803dc,_0x5b259e,_0x3be892,_0x1cd4d5){var _0x1e794b,_0x523601;var _0x577e1f=_0x7edc('0x2d');var _0xda926f=_0x7edc('0x2e')+_0x18ea4e;var _0x5855c5={};if(_0x1c0501==='ssml'){_0x5855c5[_0x7edc('0x2f')]={'ssml':_0x5803dc};}else{_0x5855c5['input']={'text':_0x5803dc};};_0x5855c5[_0x7edc('0x30')]={'languageCode':_0x5b259e,'ssmlGender':_0x3be892};_0x5855c5[_0x7edc('0x31')]={'audioEncoding':_0x7edc('0x32'),'sampleRateHertz':0x1f40};var _0x1315ea={'url':_0x577e1f+'text:synthesize'+_0xda926f,'method':_0x7edc('0x33'),'json':!![],'body':_0x5855c5};return rp(_0x1315ea)[_0x7edc('0x26')](function(_0x3fc518){return new BPromise(function(_0x713a27,_0x1e001d){_0x1e794b=path[_0x7edc('0x34')](__dirname,_0x7edc('0x21'),rs[_0x7edc('0x22')](0x4)+_0x7edc('0x35'));var _0x2fe6aa=Buffer[_0x7edc('0x36')](_0x3fc518[_0x7edc('0x37')],_0x7edc('0x25'));return fs['writeFile'](_0x1e794b,_0x2fe6aa,function(_0x208a7f){_0x1e001d(_0x208a7f);},function(_0x22bc9c){fs[_0x7edc('0x27')](_0x1e794b,'777');_0x713a27(_0x22bc9c);});});})['then'](function(_0x480ba1){_0x523601=path['resolve'](__dirname,_0x7edc('0x21'),rs['generate'](0x4)+_0x7edc('0x23'));return convertFile(_0x1e794b,_0x523601);})[_0x7edc('0x26')](function(){try{fs[_0x7edc('0x38')](_0x1e794b);fs['chmodSync'](_0x523601,_0x7edc('0x28'));}catch(_0x555d09){logger[_0x7edc('0x15')](_0x555d09);}logger['info'](_0x7edc('0x39'),_0x523601[_0x7edc('0x29')]('.')[0x0]);return _0x523601[_0x7edc('0x29')]('.')[0x0];});};exports[_0x7edc('0x3a')]=function(_0x144bfa,_0x5cb37d){var _0xd9be7b='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x5400b6,_0x4e0f2d;var _0x76054d;var _0x45c9b5={'encoding':_0x7edc('0x3b'),'method':_0x7edc('0x33'),'timeout':0x2710,'url':_0xd9be7b,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x7edc('0x3c')+encodeURIComponent(JSON[_0x7edc('0x3d')]([[['jQ1olc',JSON[_0x7edc('0x3d')]([_0x144bfa,_0x5cb37d||'en',![],_0x7edc('0x3e')]),null,_0x7edc('0x3f')]]]))};return rp(_0x45c9b5)[_0x7edc('0x26')](function(_0x4740e1){try{_0x76054d=eval(_0x4740e1[_0x7edc('0x40')](0x5))[0x0][0x2];}catch(_0x5aa679){throw new Error(_0x7edc('0x41')+_0x4740e1[_0x7edc('0x1e')]);}if(!_0x76054d){if(_0x144bfa[_0x7edc('0x42')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error('lang\x20\x22'+_0x5cb37d+_0x7edc('0x43'));}}try{_0x76054d=eval(_0x76054d)[0x0];}catch(_0x53497b){throw new Error(_0x7edc('0x41')+res[_0x7edc('0x1e')]);}const _0x1504ae=_0x76054d;_0x5400b6=path['resolve'](__dirname,_0x7edc('0x21'),rs[_0x7edc('0x22')](0x4)+_0x7edc('0x35'));fs[_0x7edc('0x24')](_0x5400b6,_0x76054d,{'encoding':'base64'});_0x4e0f2d=path[_0x7edc('0x34')](__dirname,_0x7edc('0x21'),rs[_0x7edc('0x22')](0x4)+_0x7edc('0x23'));return convertFile(_0x5400b6,_0x4e0f2d);})['then'](function(){try{fs[_0x7edc('0x38')](_0x5400b6);fs[_0x7edc('0x27')](_0x4e0f2d,_0x7edc('0x28'));}catch(_0x2b294e){logger['error'](_0x2b294e);}logger[_0x7edc('0x19')](_0x7edc('0x44'),_0x4e0f2d[_0x7edc('0x29')]('.')[0x0]);return _0x4e0f2d[_0x7edc('0x29')]('.')[0x0];});};exports['googleASR']=function(_0x5a2a15,_0x358124,_0x2b0fa7){return google[_0x7edc('0x45')](_0x5a2a15,_0x358124,_0x2b0fa7)['then'](function(_0x1e8e6d){logger[_0x7edc('0x19')](_0x1e8e6d[_0x7edc('0x46')]);return rp(_0x1e8e6d);})[_0x7edc('0x26')](function(_0x3595de){var _0x2cad48='';var _0x2ca9b5=0x0;try{fs[_0x7edc('0x38')](_0x5a2a15);}catch(_0x46125d){logger[_0x7edc('0x15')](_0x46125d);}if(_0x3595de&&_0x3595de[_0x7edc('0x47')]){_0x2cad48=_0x3595de['results'][_0x7edc('0x48')](function(_0x45b997){return _0x45b997&&_0x45b997['alternatives'][0x0]&&_0x45b997[_0x7edc('0x49')][0x0][_0x7edc('0x4a')]?_0x45b997[_0x7edc('0x49')][0x0][_0x7edc('0x4a')]:'';})[_0x7edc('0x4b')]('\x0a');_0x2ca9b5=_0x3595de[_0x7edc('0x47')][_0x7edc('0x48')](function(_0x33c083){return _0x33c083&&_0x33c083['alternatives'][0x0]&&_0x33c083[_0x7edc('0x49')][0x0]['confidence']?_0x33c083[_0x7edc('0x49')][0x0]['confidence']:0x0;})[_0x7edc('0x4b')]('\x0a');}logger['info'](_0x7edc('0x4c'),_0x2cad48);logger[_0x7edc('0x19')](_0x7edc('0x4d'),_0x2ca9b5);return{'transcript':_0x2cad48,'confidence':_0x2ca9b5};})[_0x7edc('0x4e')](function(_0x33e74a){logger[_0x7edc('0x15')](_0x7edc('0x4f'),_0x33e74a[_0x7edc('0x14')],_0x33e74a[_0x7edc('0x50')],_0x33e74a[_0x7edc('0x51')]);});};exports[_0x7edc('0x52')]=function(_0xc7f3c8,_0x29aa11,_0x382205,_0x410fc1){var _0xf02d18=apiai(_0x29aa11,{'language':_0x410fc1||'en'});return _0xf02d18[_0x7edc('0x53')](_0x382205,{'sessionId':md5(_0xc7f3c8)})[_0x7edc('0x26')](function(_0x526942){logger[_0x7edc('0x19')](JSON[_0x7edc('0x3d')](_0x526942));return{'source':_0x526942['result'][_0x7edc('0x54')],'resolvedQuery':_0x526942[_0x7edc('0x55')]['resolvedQuery'],'action':_0x526942['result'][_0x7edc('0x56')],'actionIncomplete':_0x526942['result']['actionIncomplete'],'speech':_0x526942[_0x7edc('0x55')][_0x7edc('0x57')][_0x7edc('0x58')],'score':_0x526942[_0x7edc('0x55')]['score'],'statusCode':_0x526942['status'][_0x7edc('0x59')],'endConversation':_0x526942[_0x7edc('0x55')][_0x7edc('0x5a')]['endConversation']||![],'isFallbackIntent':_0x526942[_0x7edc('0x55')]['metadata'][_0x7edc('0x5b')]};});};exports[_0x7edc('0x5c')]=function(_0x437f7f,_0x1bf1b3,_0x125c88,_0x2b69c8,_0x30cda1,_0xff4013){var _0x42a9f2=_0x2b69c8[_0x7edc('0x5d')](/\\n/g,'\x0a');var _0x5076e0={'credentials':{'private_key':_0x42a9f2,'client_email':_0x125c88}};var _0x9b10e6=new dialogflow['SessionsClient'](_0x5076e0);var _0x4baa46=_0x9b10e6[_0x7edc('0x5e')](_0x1bf1b3,md5(_0x437f7f));var _0x2a551c={'session':_0x4baa46,'queryInput':{'text':{'text':_0x30cda1,'languageCode':_0xff4013}}};return _0x9b10e6[_0x7edc('0x5f')](_0x2a551c)[_0x7edc('0x26')](function(_0x23fa0f){if(_0x23fa0f&&_0x23fa0f[_0x7edc('0x42')]){logger[_0x7edc('0x19')]('Dialogflow\x20V2\x20response:',JSON['stringify'](_0x23fa0f));var _0x13aa99=_0x23fa0f[0x0];if(_0x13aa99){var _0x51ded1={'action':_0x13aa99[_0x7edc('0x60')][_0x7edc('0x56')],'allRequiredParamsPresent':_0x13aa99[_0x7edc('0x60')][_0x7edc('0x61')],'endConversation':_0x13aa99[_0x7edc('0x60')][_0x7edc('0x62')]&&_0x13aa99['queryResult'][_0x7edc('0x62')][_0x7edc('0x63')]?_0x13aa99['queryResult'][_0x7edc('0x62')][_0x7edc('0x63')][_0x7edc('0x64')][_0x7edc('0x65')]:![],'fulfillmentText':_0x13aa99['queryResult']['fulfillmentText'],'intentName':_0x13aa99[_0x7edc('0x60')][_0x7edc('0x66')][_0x7edc('0x50')],'intentDisplayName':_0x13aa99['queryResult']['intent'][_0x7edc('0x67')],'isFallbackIntent':_0x13aa99[_0x7edc('0x60')][_0x7edc('0x66')][_0x7edc('0x68')],'languageCode':_0x13aa99[_0x7edc('0x60')]['languageCode'],'queryText':_0x13aa99[_0x7edc('0x60')][_0x7edc('0x69')],'responseId':_0x13aa99[_0x7edc('0x6a')],'score':_0x13aa99[_0x7edc('0x60')][_0x7edc('0x6b')],'speech':_0x13aa99[_0x7edc('0x60')][_0x7edc('0x6c')],'providerResponse':JSON[_0x7edc('0x3d')](_0x23fa0f)};return _0x51ded1;}}});};exports[_0x7edc('0x6d')]=function(_0x1daaef,_0x263d2b,_0x407272,_0x46a383){return tilde[_0x7edc('0x45')](_0x1daaef,_0x263d2b,_0x407272,_0x46a383)['then'](function(_0x50146c){try{fs['unlink'](_0x1daaef);}catch(_0x47402a){logger['error'](_0x47402a);}logger[_0x7edc('0x19')](_0x7edc('0x6e'),_0x50146c[_0x7edc('0x4a')]);logger[_0x7edc('0x19')](_0x7edc('0x6f'),_0x50146c[_0x7edc('0x70')]);return _0x50146c;});};exports[_0x7edc('0x71')]=function(_0x86b3a,_0x12a79b,_0x3dc26f,_0x3fd4c4,_0x580741,_0x59e56f){var _0x4b2608=path[_0x7edc('0x34')](__dirname,_0x7edc('0x21'),rs[_0x7edc('0x22')](0x4)+_0x7edc('0x35'));var _0x427abe;return aws[_0x7edc('0x72')](_0x86b3a,_0x12a79b,_0x3dc26f,_0x3fd4c4,_0x580741,_0x59e56f,_0x4b2608)['then'](function(){_0x427abe=path[_0x7edc('0x34')](__dirname,_0x7edc('0x21'),rs[_0x7edc('0x22')](0x4)+_0x7edc('0x23'));return convertFile(_0x4b2608,_0x427abe);})[_0x7edc('0x26')](function(){try{fs[_0x7edc('0x38')](_0x4b2608);fs[_0x7edc('0x27')](_0x427abe,_0x7edc('0x28'));}catch(_0x13ba31){logger[_0x7edc('0x15')](_0x13ba31);}return _0x427abe[_0x7edc('0x29')]('.')[0x0];});};exports[_0x7edc('0x73')]=function(_0x49570a,_0x4e5898,_0x4a9aed,_0x1a1198,_0x30249e,_0x52b2db){return aws['lex'](_0x49570a,_0x4e5898,_0x4a9aed,_0x1a1198,_0x30249e,_0x52b2db)['then'](function(_0x9d9057){logger[_0x7edc('0x19')](JSON[_0x7edc('0x3d')](_0x9d9057));return _0x9d9057;});};exports[_0x7edc('0x74')]=function(_0x4385d6,_0x186b56,_0x2c6887,_0x495df6){var _0x5c8324=util[_0x7edc('0x75')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x4385d6,encodeURIComponent(_0x186b56),_0x2c6887,_0x495df6);var _0x36086e=path['resolve'](__dirname,_0x7edc('0x21'),rs[_0x7edc('0x22')](0x4)+'.mp3');var _0x35c66a;return downloadFile(_0x5c8324,_0x36086e)[_0x7edc('0x26')](function(){_0x35c66a=path[_0x7edc('0x34')](__dirname,_0x7edc('0x21'),rs[_0x7edc('0x22')](0x4)+_0x7edc('0x23'));return convertFile(_0x36086e,_0x35c66a);})['then'](function(){try{fs['unlink'](_0x36086e);fs[_0x7edc('0x27')](_0x35c66a,_0x7edc('0x28'));}catch(_0x2e8857){logger[_0x7edc('0x15')](_0x2e8857);}return _0x35c66a[_0x7edc('0x29')]('.')[0x0];});};exports[_0x7edc('0x76')]=function(_0x59c347,_0x56deaf,_0x42620b,_0x1b3234){var _0x5e0c14=util['format'](_0x7edc('0x77'),ISPEECH_API,_0x56deaf,_0x42620b,base64Encode(_0x59c347),_0x1b3234?util['format'](_0x7edc('0x78'),encodeURIComponent(_0x1b3234)):_0x7edc('0x79'));return uploadFile(_0x5e0c14)[_0x7edc('0x26')](function(_0x45c40c){return querystring[_0x7edc('0x8')](_0x45c40c);});};exports[_0x7edc('0x7a')]=function(_0x376722,_0x1a9efa){return sestek[_0x7edc('0x7b')](_0x376722,_0x1a9efa)[_0x7edc('0x26')](function(_0x5575c0){logger[_0x7edc('0x19')](JSON[_0x7edc('0x3d')](_0x5575c0));var _0x294dda={'speech':_0x5575c0[_0x7edc('0x7c')],'action':_0x5575c0[_0x7edc('0x7d')]?_0x5575c0[_0x7edc('0x7d')][_0x7edc('0x7e')]:undefined,'actiondata':_0x5575c0[_0x7edc('0x7d')]?_0x5575c0['channelData'][_0x7edc('0x7f')]:undefined};if(_0x5575c0['channelData']&&_0x5575c0['channelData']['AudioFromTts']){return base64Decode(_0x5575c0[_0x7edc('0x7d')][_0x7edc('0x80')][_0x7edc('0x81')],path[_0x7edc('0x34')](__dirname,_0x7edc('0x21'),rs[_0x7edc('0x22')](0x4)+_0x7edc('0x23')))['then'](function(_0x4df8ed){_0x294dda[_0x7edc('0x82')]=_0x4df8ed;return _0x294dda;});}return _0x294dda;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file +var _0xe96b=['Tilde\x20ASR\x20confidence','awsPolly','polly','lex','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','freeform=3','sestekNDA','text','channelData','CustomAction','AudioFromTts','Data','audiofile','dirName','apiai-promise','dialogflow','http','https','querystring','randomstring','sox','url','util','./sestek','./tilde','agi','https://api.ispeech.org/api/rest','protocol','host','WHAT_EVER','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','close','unlink','download\x20error','pipe','https:','path','request\x20to\x20','data','end','transcode','info','finish\x20to\x20convert','generate','.wav','then','chmodSync','777','readFileSync','toString','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/','ssml','input','voice','audioConfig','MP3','text:synthesize','resolve','tmp','from','audioContent','writeFile','googleCloudTTS\x20path','split','googleTTS','utf8','application/x-www-form-urlencoded','f.req=','stringify','null','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','.mp3','writeFileSync','goggleTTS\x20path','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','catch','[%s]\x20%s:%s','message','textRequest','result','source','resolvedQuery','fulfillment','speech','score','code','metadata','endConversation','googleDialogflowV2','replace','SessionsClient','detectIntent','Dialogflow\x20V2\x20response:','action','allRequiredParamsPresent','queryResult','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','name','intent','isFallback','languageCode','queryText','tildeASR','Tilde\x20ASR\x20transcription'];(function(_0x8b8564,_0x162976){var _0x360c61=function(_0x164cc9){while(--_0x164cc9){_0x8b8564['push'](_0x8b8564['shift']());}};_0x360c61(++_0x162976);}(_0xe96b,0x19a));var _0xbe96=function(_0x5a1bdc,_0x4223c3){_0x5a1bdc=_0x5a1bdc-0x0;var _0x418076=_0xe96b[_0x5a1bdc];return _0x418076;};'use strict';var apiai=require(_0xbe96('0x0'));var BPromise=require('bluebird');var dialogflow=require(_0xbe96('0x1'));var fs=require('fs');var http=require(_0xbe96('0x2'));var https=require(_0xbe96('0x3'));var md5=require('md5');var path=require('path');var querystring=require(_0xbe96('0x4'));var rp=require('request-promise');var rs=require(_0xbe96('0x5'));var sox=require(_0xbe96('0x6'));var tts=require('google-tts-api');var urlParse=require(_0xbe96('0x7'))['parse'];var util=require(_0xbe96('0x8'));var aws=require('./aws');var google=require('./google');var sestek=require(_0xbe96('0x9'));var tilde=require(_0xbe96('0xa'));var logger=require('../../../config/logger')(_0xbe96('0xb'));var ISPEECH_API=_0xbe96('0xc');function downloadFile(_0x1c5fd1,_0x4b2ffc){return new BPromise(function(_0x17cfde,_0x19a761){var _0x11b429=urlParse(_0x1c5fd1);var _0x2b6039=_0x11b429[_0xbe96('0xd')]==='https:'?https:http;var _0x90c78b={'host':_0x11b429[_0xbe96('0xe')],'path':_0x11b429['path'],'headers':{'user-agent':_0xbe96('0xf')}};_0x2b6039['get'](_0x90c78b,function(_0x568866){if(_0x568866[_0xbe96('0x10')]!==0xc8){logger[_0xbe96('0x11')]('request\x20to\x20'+_0x1c5fd1+_0xbe96('0x12')+_0x568866['statusCode']+'\x20('+_0x568866[_0xbe96('0x13')]+')');_0x19a761(new Error('request\x20to\x20'+_0x1c5fd1+_0xbe96('0x12')+_0x568866[_0xbe96('0x10')]+'\x20('+_0x568866[_0xbe96('0x13')]+')'));return;}var _0x8021b8=fs[_0xbe96('0x14')](_0x4b2ffc);_0x8021b8['on'](_0xbe96('0x15'),function(){logger['info']('finish\x20download\x20file');_0x8021b8[_0xbe96('0x16')](_0x17cfde);});_0x8021b8['on'](_0xbe96('0x11'),function(_0x1a5b30){fs[_0xbe96('0x17')](_0x4b2ffc);logger['error'](_0xbe96('0x18'),_0x1a5b30);_0x19a761(_0x1a5b30);});_0x568866[_0xbe96('0x19')](_0x8021b8);})['on'](_0xbe96('0x11'),function(_0xcd9a6){logger[_0xbe96('0x11')](_0xcd9a6);_0x19a761(_0xcd9a6);})['end']();});}function uploadFile(_0xc649){return new BPromise(function(_0x100d56,_0x5b4182){var _0x3111ee=urlParse(_0xc649);var _0xb9e1f1=_0x3111ee['protocol']===_0xbe96('0x1a')?https:http;var _0x13a18f={'host':_0x3111ee[_0xbe96('0xe')],'path':_0x3111ee[_0xbe96('0x1b')],'headers':{'user-agent':_0xbe96('0xf')}};_0xb9e1f1['get'](_0x13a18f,function(_0xe9abd5){if(_0xe9abd5[_0xbe96('0x10')]!==0xc8){_0x5b4182(new Error(_0xbe96('0x1c')+_0xc649+_0xbe96('0x12')+_0xe9abd5[_0xbe96('0x10')]+'\x20('+_0xe9abd5[_0xbe96('0x13')]+')'));return;}var _0x201a71='';_0xe9abd5['on'](_0xbe96('0x1d'),function(_0x126f50){_0x201a71+=_0x126f50;});_0xe9abd5['on'](_0xbe96('0x1e'),function(){_0x100d56(_0x201a71);});})['on'](_0xbe96('0x11'),function(_0x4f0e51){_0x5b4182(_0x4f0e51);})[_0xbe96('0x1e')]();});}function convertFile(_0x1879a5,_0x2be6f4){return new BPromise(function(_0x54f03e,_0x5e6ba5){var _0x4bc0ac=sox[_0xbe96('0x1f')](_0x1879a5,_0x2be6f4,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4bc0ac['on'](_0xbe96('0x11'),function(_0x2c1d78){logger[_0xbe96('0x11')]('error\x20convert',_0x2c1d78);_0x5e6ba5(_0x2c1d78);});_0x4bc0ac['on'](_0xbe96('0x1e'),function(){logger[_0xbe96('0x20')](_0xbe96('0x21'));_0x54f03e();});_0x4bc0ac['start']();});}function base64Decode(_0x43bf1f,_0x463e57){var _0x45cb1e=path['resolve'](__dirname,'tmp',rs[_0xbe96('0x22')](0x4)+_0xbe96('0x23'));fs['writeFileSync'](_0x45cb1e,_0x43bf1f,'base64');return convertFile(_0x45cb1e,_0x463e57)[_0xbe96('0x24')](function(){try{fs['unlink'](_0x45cb1e);fs[_0xbe96('0x25')](_0x463e57,_0xbe96('0x26'));}catch(_0x217c56){logger[_0xbe96('0x11')](_0x217c56);}return _0x463e57['split']('.')[0x0];});}function base64Encode(_0xbec380){var _0x1d31a7=fs[_0xbe96('0x27')](_0xbec380);return new Buffer(_0x1d31a7)[_0xbe96('0x28')](_0xbe96('0x29'));}exports[_0xbe96('0x2a')]=function(_0x26140c,_0x3d4b8a,_0x5cb942,_0x1d3a65,_0x47e23f,_0xcc74f6){var _0x52133a,_0x25d49b;var _0x44b8e8=_0xbe96('0x2b');var _0x5b9ecf='?key='+_0x26140c;var _0x16f091={};if(_0x3d4b8a===_0xbe96('0x2c')){_0x16f091[_0xbe96('0x2d')]={'ssml':_0x5cb942};}else{_0x16f091['input']={'text':_0x5cb942};};_0x16f091[_0xbe96('0x2e')]={'languageCode':_0x1d3a65,'ssmlGender':_0x47e23f};_0x16f091[_0xbe96('0x2f')]={'audioEncoding':_0xbe96('0x30'),'sampleRateHertz':0x1f40};var _0x1ce901={'url':_0x44b8e8+_0xbe96('0x31')+_0x5b9ecf,'method':'POST','json':!![],'body':_0x16f091};return rp(_0x1ce901)[_0xbe96('0x24')](function(_0x3df1dc){return new BPromise(function(_0x23f4b1,_0x5d316f){_0x52133a=path[_0xbe96('0x32')](__dirname,_0xbe96('0x33'),rs[_0xbe96('0x22')](0x4)+'.mp3');var _0x3b79b7=Buffer[_0xbe96('0x34')](_0x3df1dc[_0xbe96('0x35')],_0xbe96('0x29'));return fs[_0xbe96('0x36')](_0x52133a,_0x3b79b7,function(_0x4c96c0){_0x5d316f(_0x4c96c0);},function(_0x3bec66){fs['chmodSync'](_0x52133a,_0xbe96('0x26'));_0x23f4b1(_0x3bec66);});});})[_0xbe96('0x24')](function(_0xd2a430){_0x25d49b=path['resolve'](__dirname,_0xbe96('0x33'),rs['generate'](0x4)+_0xbe96('0x23'));return convertFile(_0x52133a,_0x25d49b);})[_0xbe96('0x24')](function(){try{fs['unlink'](_0x52133a);fs[_0xbe96('0x25')](_0x25d49b,'777');}catch(_0x102379){logger[_0xbe96('0x11')](_0x102379);}logger[_0xbe96('0x20')](_0xbe96('0x37'),_0x25d49b['split']('.')[0x0]);return _0x25d49b[_0xbe96('0x38')]('.')[0x0];});};exports[_0xbe96('0x39')]=function(_0x525712,_0x387a88){var _0x4b668b='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x836a2b,_0x58d56c;var _0x4c8a6e;var _0xa5037c={'encoding':_0xbe96('0x3a'),'method':'POST','timeout':0x2710,'url':_0x4b668b,'headers':{'Content-Type':_0xbe96('0x3b')},'body':_0xbe96('0x3c')+encodeURIComponent(JSON[_0xbe96('0x3d')]([[['jQ1olc',JSON['stringify']([_0x525712,_0x387a88||'en',![],_0xbe96('0x3e')]),null,_0xbe96('0x3f')]]]))};return rp(_0xa5037c)['then'](function(_0x5d425d){try{_0x4c8a6e=eval(_0x5d425d[_0xbe96('0x40')](0x5))[0x0][0x2];}catch(_0x2c80b2){throw new Error(_0xbe96('0x41')+_0x5d425d[_0xbe96('0x1d')]);}if(!_0x4c8a6e){if(_0x525712[_0xbe96('0x42')]>0xc8){throw new Error(_0xbe96('0x43'));}else{throw new Error(_0xbe96('0x44')+_0x387a88+'\x22\x20might\x20not\x20exist');}}try{_0x4c8a6e=eval(_0x4c8a6e)[0x0];}catch(_0xa72716){throw new Error(_0xbe96('0x41')+res[_0xbe96('0x1d')]);}const _0x2ce469=_0x4c8a6e;_0x836a2b=path['resolve'](__dirname,_0xbe96('0x33'),rs[_0xbe96('0x22')](0x4)+_0xbe96('0x45'));fs[_0xbe96('0x46')](_0x836a2b,_0x4c8a6e,{'encoding':_0xbe96('0x29')});_0x58d56c=path[_0xbe96('0x32')](__dirname,'tmp',rs[_0xbe96('0x22')](0x4)+'.wav');return convertFile(_0x836a2b,_0x58d56c);})[_0xbe96('0x24')](function(){try{fs[_0xbe96('0x17')](_0x836a2b);fs[_0xbe96('0x25')](_0x58d56c,'777');}catch(_0x22c139){logger[_0xbe96('0x11')](_0x22c139);}logger['info'](_0xbe96('0x47'),_0x58d56c[_0xbe96('0x38')]('.')[0x0]);return _0x58d56c['split']('.')[0x0];});};exports['googleASR']=function(_0x5bc627,_0x551134,_0x33b6a2){return google[_0xbe96('0x48')](_0x5bc627,_0x551134,_0x33b6a2)[_0xbe96('0x24')](function(_0x1d5259){logger[_0xbe96('0x20')](_0x1d5259[_0xbe96('0x49')]);return rp(_0x1d5259);})[_0xbe96('0x24')](function(_0x1b49c5){var _0x26eb32='';var _0x3ae68d=0x0;try{fs[_0xbe96('0x17')](_0x5bc627);}catch(_0x5dec08){logger[_0xbe96('0x11')](_0x5dec08);}if(_0x1b49c5&&_0x1b49c5[_0xbe96('0x4a')]){_0x26eb32=_0x1b49c5['results'][_0xbe96('0x4b')](function(_0x4890ca){return _0x4890ca&&_0x4890ca[_0xbe96('0x4c')][0x0]&&_0x4890ca[_0xbe96('0x4c')][0x0]['transcript']?_0x4890ca[_0xbe96('0x4c')][0x0][_0xbe96('0x4d')]:'';})[_0xbe96('0x4e')]('\x0a');_0x3ae68d=_0x1b49c5[_0xbe96('0x4a')]['map'](function(_0x3e7f11){return _0x3e7f11&&_0x3e7f11[_0xbe96('0x4c')][0x0]&&_0x3e7f11['alternatives'][0x0]['confidence']?_0x3e7f11[_0xbe96('0x4c')][0x0][_0xbe96('0x4f')]:0x0;})[_0xbe96('0x4e')]('\x0a');}logger[_0xbe96('0x20')](_0xbe96('0x50'),_0x26eb32);logger['info']('googleASR\x20confidence',_0x3ae68d);return{'transcript':_0x26eb32,'confidence':_0x3ae68d};})[_0xbe96('0x51')](function(_0x331b17){logger[_0xbe96('0x11')](_0xbe96('0x52'),_0x331b17[_0xbe96('0x10')],_0x331b17['name'],_0x331b17[_0xbe96('0x53')]);});};exports['googleDialogflow']=function(_0x58be2e,_0x4d0b16,_0x244b17,_0x4011d1){var _0x38ed25=apiai(_0x4d0b16,{'language':_0x4011d1||'en'});return _0x38ed25[_0xbe96('0x54')](_0x244b17,{'sessionId':md5(_0x58be2e)})['then'](function(_0x1cfd6a){logger[_0xbe96('0x20')](JSON[_0xbe96('0x3d')](_0x1cfd6a));return{'source':_0x1cfd6a[_0xbe96('0x55')][_0xbe96('0x56')],'resolvedQuery':_0x1cfd6a[_0xbe96('0x55')][_0xbe96('0x57')],'action':_0x1cfd6a[_0xbe96('0x55')]['action'],'actionIncomplete':_0x1cfd6a[_0xbe96('0x55')]['actionIncomplete'],'speech':_0x1cfd6a[_0xbe96('0x55')][_0xbe96('0x58')][_0xbe96('0x59')],'score':_0x1cfd6a[_0xbe96('0x55')][_0xbe96('0x5a')],'statusCode':_0x1cfd6a['status'][_0xbe96('0x5b')],'endConversation':_0x1cfd6a[_0xbe96('0x55')][_0xbe96('0x5c')][_0xbe96('0x5d')]||![],'isFallbackIntent':_0x1cfd6a['result'][_0xbe96('0x5c')]['isFallbackIntent']};});};exports[_0xbe96('0x5e')]=function(_0x2ae95f,_0x112f66,_0x45d304,_0x19786b,_0x2b9df3,_0x378839){var _0x413dab=_0x19786b[_0xbe96('0x5f')](/\\n/g,'\x0a');var _0x497761={'credentials':{'private_key':_0x413dab,'client_email':_0x45d304}};var _0x376d54=new dialogflow[(_0xbe96('0x60'))](_0x497761);var _0x1c18c6=_0x376d54['sessionPath'](_0x112f66,md5(_0x2ae95f));var _0x3e347a={'session':_0x1c18c6,'queryInput':{'text':{'text':_0x2b9df3,'languageCode':_0x378839}}};return _0x376d54[_0xbe96('0x61')](_0x3e347a)[_0xbe96('0x24')](function(_0x5744d4){if(_0x5744d4&&_0x5744d4[_0xbe96('0x42')]){logger[_0xbe96('0x20')](_0xbe96('0x62'),JSON[_0xbe96('0x3d')](_0x5744d4));var _0x1f4dca=_0x5744d4[0x0];if(_0x1f4dca){var _0x3a0115={'action':_0x1f4dca['queryResult'][_0xbe96('0x63')],'allRequiredParamsPresent':_0x1f4dca['queryResult'][_0xbe96('0x64')],'endConversation':_0x1f4dca[_0xbe96('0x65')]['diagnosticInfo']&&_0x1f4dca[_0xbe96('0x65')][_0xbe96('0x66')][_0xbe96('0x67')]?_0x1f4dca[_0xbe96('0x65')][_0xbe96('0x66')][_0xbe96('0x67')][_0xbe96('0x68')][_0xbe96('0x69')]:![],'fulfillmentText':_0x1f4dca[_0xbe96('0x65')][_0xbe96('0x6a')],'intentName':_0x1f4dca['queryResult']['intent'][_0xbe96('0x6b')],'intentDisplayName':_0x1f4dca[_0xbe96('0x65')]['intent']['displayName'],'isFallbackIntent':_0x1f4dca[_0xbe96('0x65')][_0xbe96('0x6c')][_0xbe96('0x6d')],'languageCode':_0x1f4dca[_0xbe96('0x65')][_0xbe96('0x6e')],'queryText':_0x1f4dca[_0xbe96('0x65')][_0xbe96('0x6f')],'responseId':_0x1f4dca['responseId'],'score':_0x1f4dca[_0xbe96('0x65')]['intentDetectionConfidence'],'speech':_0x1f4dca[_0xbe96('0x65')][_0xbe96('0x6a')],'providerResponse':JSON[_0xbe96('0x3d')](_0x5744d4)};return _0x3a0115;}}});};exports[_0xbe96('0x70')]=function(_0x29752b,_0x5c3203,_0x2753b9,_0x5dd3ef){return tilde[_0xbe96('0x48')](_0x29752b,_0x5c3203,_0x2753b9,_0x5dd3ef)[_0xbe96('0x24')](function(_0x25e437){try{fs[_0xbe96('0x17')](_0x29752b);}catch(_0x3ed8cb){logger[_0xbe96('0x11')](_0x3ed8cb);}logger[_0xbe96('0x20')](_0xbe96('0x71'),_0x25e437['transcript']);logger[_0xbe96('0x20')](_0xbe96('0x72'),_0x25e437[_0xbe96('0x4f')]);return _0x25e437;});};exports[_0xbe96('0x73')]=function(_0x44d9a6,_0x485e5d,_0x35365a,_0x339304,_0x27b0f4,_0xd112a0){var _0x569eb7=path[_0xbe96('0x32')](__dirname,_0xbe96('0x33'),rs[_0xbe96('0x22')](0x4)+_0xbe96('0x45'));var _0x398159;return aws[_0xbe96('0x74')](_0x44d9a6,_0x485e5d,_0x35365a,_0x339304,_0x27b0f4,_0xd112a0,_0x569eb7)[_0xbe96('0x24')](function(){_0x398159=path['resolve'](__dirname,_0xbe96('0x33'),rs[_0xbe96('0x22')](0x4)+_0xbe96('0x23'));return convertFile(_0x569eb7,_0x398159);})[_0xbe96('0x24')](function(){try{fs[_0xbe96('0x17')](_0x569eb7);fs['chmodSync'](_0x398159,'777');}catch(_0x4de122){logger[_0xbe96('0x11')](_0x4de122);}return _0x398159['split']('.')[0x0];});};exports['awsLex']=function(_0x2d757a,_0x2bb228,_0x5b8dd2,_0x450a30,_0x20e23e,_0x572e0d){return aws[_0xbe96('0x75')](_0x2d757a,_0x2bb228,_0x5b8dd2,_0x450a30,_0x20e23e,_0x572e0d)[_0xbe96('0x24')](function(_0x4c782c){logger[_0xbe96('0x20')](JSON[_0xbe96('0x3d')](_0x4c782c));return _0x4c782c;});};exports[_0xbe96('0x76')]=function(_0xf6bc0,_0xae9b1f,_0x308430,_0x8eed74){var _0x12dee6=util['format'](_0xbe96('0x77'),ISPEECH_API,_0xf6bc0,encodeURIComponent(_0xae9b1f),_0x308430,_0x8eed74);var _0x36d55a=path[_0xbe96('0x32')](__dirname,_0xbe96('0x33'),rs[_0xbe96('0x22')](0x4)+_0xbe96('0x45'));var _0x18a87c;return downloadFile(_0x12dee6,_0x36d55a)['then'](function(){_0x18a87c=path[_0xbe96('0x32')](__dirname,_0xbe96('0x33'),rs['generate'](0x4)+'.wav');return convertFile(_0x36d55a,_0x18a87c);})['then'](function(){try{fs[_0xbe96('0x17')](_0x36d55a);fs[_0xbe96('0x25')](_0x18a87c,_0xbe96('0x26'));}catch(_0x94f339){logger[_0xbe96('0x11')](_0x94f339);}return _0x18a87c['split']('.')[0x0];});};exports['ispeechASR']=function(_0x5be9e5,_0x9ac2fd,_0x3563cc,_0x380d62){var _0x4de70d=util[_0xbe96('0x78')](_0xbe96('0x79'),ISPEECH_API,_0x9ac2fd,_0x3563cc,base64Encode(_0x5be9e5),_0x380d62?util[_0xbe96('0x78')]('model=%s',encodeURIComponent(_0x380d62)):_0xbe96('0x7a'));return uploadFile(_0x4de70d)['then'](function(_0x193c39){return querystring['parse'](_0x193c39);});};exports[_0xbe96('0x7b')]=function(_0x4ff8a5,_0x3ebad0){return sestek['nda'](_0x4ff8a5,_0x3ebad0)[_0xbe96('0x24')](function(_0x4a05be){logger[_0xbe96('0x20')](JSON[_0xbe96('0x3d')](_0x4a05be));var _0x53cfa4={'speech':_0x4a05be[_0xbe96('0x7c')],'action':_0x4a05be[_0xbe96('0x7d')]?_0x4a05be[_0xbe96('0x7d')][_0xbe96('0x7e')]:undefined,'actiondata':_0x4a05be[_0xbe96('0x7d')]?_0x4a05be[_0xbe96('0x7d')]['CustomActionData']:undefined};if(_0x4a05be['channelData']&&_0x4a05be[_0xbe96('0x7d')]['AudioFromTts']){return base64Decode(_0x4a05be[_0xbe96('0x7d')][_0xbe96('0x7f')][_0xbe96('0x80')],path[_0xbe96('0x32')](__dirname,'tmp',rs[_0xbe96('0x22')](0x4)+_0xbe96('0x23')))[_0xbe96('0x24')](function(_0x1663bd){_0x53cfa4[_0xbe96('0x81')]=_0x1663bd;return _0x53cfa4;});}return _0x53cfa4;});};exports[_0xbe96('0x82')]=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 49aaa5b..883cb53 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 _0x1dca=['./nda','exports'];(function(_0x9edfd5,_0x286486){var _0x330738=function(_0x4aceb3){while(--_0x4aceb3){_0x9edfd5['push'](_0x9edfd5['shift']());}};_0x330738(++_0x286486);}(_0x1dca,0x72));var _0xa1dc=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0x1dca[_0x342baa];return _0x1208f3;};var nda=require(_0xa1dc('0x0'));module[_0xa1dc('0x1')]={'nda':nda}; \ No newline at end of file +var _0xb0e6=['exports','./nda'];(function(_0x541085,_0x1c1ad0){var _0x3d7c3d=function(_0x82eb5f){while(--_0x82eb5f){_0x541085['push'](_0x541085['shift']());}};_0x3d7c3d(++_0x1c1ad0);}(_0xb0e6,0x1c9));var _0x6b0e=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xb0e6[_0x19950b];return _0x3c6b41;};var nda=require(_0x6b0e('0x0'));module[_0x6b0e('0x1')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index 795faa1..0ace1d9 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 _0x9e0d=['channelData','AudioOutputSettings','audio/wav','custom_action','CustomActionData','custom_action_data','stringify','request-promise','url','../../../../../config/logger','agi','POST','resolve','ndauth_url','username','password','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','dnid','extension','Bearer\x20','access_token','project','body'];(function(_0x268cfd,_0x5a4f92){var _0x33cf10=function(_0x5cbb71){while(--_0x5cbb71){_0x268cfd['push'](_0x268cfd['shift']());}};_0x33cf10(++_0x5a4f92);}(_0x9e0d,0xf7));var _0xd9e0=function(_0x3b46d6,_0x56d71f){_0x3b46d6=_0x3b46d6-0x0;var _0x33dc0a=_0x9e0d[_0x3b46d6];return _0x33dc0a;};'use strict';var rp=require(_0xd9e0('0x0'));var url=require(_0xd9e0('0x1'));var logger=require(_0xd9e0('0x2'))(_0xd9e0('0x3'));module['exports']=function(_0x2c5792,_0x3ec198){var _0x145133={'method':_0xd9e0('0x4'),'uri':url[_0xd9e0('0x5')](_0x3ec198[_0xd9e0('0x6')],'/token'),'form':{'grant_type':'password','username':_0x3ec198[_0xd9e0('0x7')],'password':_0x3ec198[_0xd9e0('0x8')]},'json':!![]};return rp(_0x145133)[_0xd9e0('0x9')](function(_0x3f8bb2){var _0x256df0={'method':_0xd9e0('0x4'),'uri':url['resolve'](_0x3ec198[_0xd9e0('0xa')],_0xd9e0('0xb')),'body':{'type':_0x3ec198[_0xd9e0('0xc')]||_0xd9e0('0xd'),'channelId':_0xd9e0('0xe'),'conversation':{'id':_0x2c5792[_0xd9e0('0xf')]},'from':{'id':_0x2c5792[_0xd9e0('0x10')],'name':_0x2c5792['calleridname']},'recipient':{'id':_0x2c5792[_0xd9e0('0x11')],'name':_0x2c5792[_0xd9e0('0x12')]},'text':_0x3ec198['text'],'channelData':{}},'headers':{'Authorization':_0xd9e0('0x13')+_0x3f8bb2[_0xd9e0('0x14')]},'json':!![]};if(_0x3ec198[_0xd9e0('0x15')]){_0x256df0[_0xd9e0('0x16')][_0xd9e0('0x17')]['ProjectName']=_0x3ec198[_0xd9e0('0x15')];}if(_0x3ec198['ndagenerate_audio']=='1'){_0x256df0[_0xd9e0('0x16')]['channelData'][_0xd9e0('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xd9e0('0x19')};}if(_0x3ec198[_0xd9e0('0x1a')]){_0x256df0[_0xd9e0('0x16')][_0xd9e0('0x17')]['CustomAction']=_0x3ec198['custom_action'];if(_0x3ec198['custom_action_data']){_0x256df0[_0xd9e0('0x16')][_0xd9e0('0x17')][_0xd9e0('0x1b')]=_0x3ec198[_0xd9e0('0x1c')];}}logger['info'](JSON[_0xd9e0('0x1d')](_0x256df0));return rp(_0x256df0);});}; \ No newline at end of file +var _0x2242=['CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','exports','POST','ndauth_url','/token','password','then','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','dnid','Bearer\x20','access_token','project','body','ProjectName','channelData','AudioOutputSettings','CustomAction','custom_action','custom_action_data'];(function(_0x5b9cfe,_0x18e52b){var _0x265cac=function(_0x43d7e1){while(--_0x43d7e1){_0x5b9cfe['push'](_0x5b9cfe['shift']());}};_0x265cac(++_0x18e52b);}(_0x2242,0x1a3));var _0x2224=function(_0x421e29,_0x1b38cd){_0x421e29=_0x421e29-0x0;var _0x1ff84a=_0x2242[_0x421e29];return _0x1ff84a;};'use strict';var rp=require(_0x2224('0x0'));var url=require(_0x2224('0x1'));var logger=require(_0x2224('0x2'))('agi');module[_0x2224('0x3')]=function(_0x317565,_0x4acc10){var _0x1993b6={'method':_0x2224('0x4'),'uri':url['resolve'](_0x4acc10[_0x2224('0x5')],_0x2224('0x6')),'form':{'grant_type':_0x2224('0x7'),'username':_0x4acc10['username'],'password':_0x4acc10[_0x2224('0x7')]},'json':!![]};return rp(_0x1993b6)[_0x2224('0x8')](function(_0x35f807){var _0x25c6d4={'method':_0x2224('0x4'),'uri':url[_0x2224('0x9')](_0x4acc10[_0x2224('0xa')],_0x2224('0xb')),'body':{'type':_0x4acc10[_0x2224('0xc')]||_0x2224('0xd'),'channelId':_0x2224('0xe'),'conversation':{'id':_0x317565[_0x2224('0xf')]},'from':{'id':_0x317565[_0x2224('0x10')],'name':_0x317565[_0x2224('0x11')]},'recipient':{'id':_0x317565[_0x2224('0x12')],'name':_0x317565['extension']},'text':_0x4acc10['text'],'channelData':{}},'headers':{'Authorization':_0x2224('0x13')+_0x35f807[_0x2224('0x14')]},'json':!![]};if(_0x4acc10[_0x2224('0x15')]){_0x25c6d4[_0x2224('0x16')]['channelData'][_0x2224('0x17')]=_0x4acc10[_0x2224('0x15')];}if(_0x4acc10['ndagenerate_audio']=='1'){_0x25c6d4['body'][_0x2224('0x18')][_0x2224('0x19')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x4acc10['custom_action']){_0x25c6d4[_0x2224('0x16')][_0x2224('0x18')][_0x2224('0x1a')]=_0x4acc10[_0x2224('0x1b')];if(_0x4acc10[_0x2224('0x1c')]){_0x25c6d4[_0x2224('0x16')][_0x2224('0x18')][_0x2224('0x1d')]=_0x4acc10['custom_action_data'];}}logger[_0x2224('0x1e')](JSON[_0x2224('0x1f')](_0x25c6d4));return rp(_0x25c6d4);});}; \ 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 d38b74b..e04eb63 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 _0x1647=['exports'];(function(_0x497b1e,_0x586379){var _0x3f72e1=function(_0x4c227d){while(--_0x4c227d){_0x497b1e['push'](_0x497b1e['shift']());}};_0x3f72e1(++_0x586379);}(_0x1647,0x148));var _0x7164=function(_0x35dcca,_0x14e01d){_0x35dcca=_0x35dcca-0x0;var _0x4d843c=_0x1647[_0x35dcca];return _0x4d843c;};'use strict';var asr=require('./lib/api');module[_0x7164('0x0')]=function(_0x55716c,_0x4cdb68,_0x3aa483,_0x5be4a5){return asr(_0x55716c,_0x4cdb68,_0x3aa483,_0x5be4a5);}; \ No newline at end of file +var _0x9e65=['./lib/api','exports'];(function(_0x36eb0b,_0x627157){var _0x23b67d=function(_0x11302f){while(--_0x11302f){_0x36eb0b['push'](_0x36eb0b['shift']());}};_0x23b67d(++_0x627157);}(_0x9e65,0x8a));var _0x59e6=function(_0x41bd33,_0x8dd533){_0x41bd33=_0x41bd33-0x0;var _0x1ef83a=_0x9e65[_0x41bd33];return _0x1ef83a;};'use strict';var asr=require(_0x59e6('0x0'));module[_0x59e6('0x1')]=function(_0x1d6b86,_0x52d35d,_0x31975e,_0x4e2132){return asr(_0x1d6b86,_0x52d35d,_0x31975e,_0x4e2132);}; \ 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 e57eb58..447c4ec 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 _0xe873=['moment','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','digest','Open\x20Tilde\x20ASR\x20socket','unix','send','createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','stringify','terminate','status','result','final','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','isNil','isObject','open','message','bluebird','lodash'];(function(_0x11daaa,_0x3236fc){var _0x99432d=function(_0x4a8739){while(--_0x4a8739){_0x11daaa['push'](_0x11daaa['shift']());}};_0x99432d(++_0x3236fc);}(_0xe873,0x8e));var _0x3e87=function(_0x58f75d,_0x1f5811){_0x58f75d=_0x58f75d-0x0;var _0x15189f=_0xe873[_0x58f75d];return _0x15189f;};'use strict';var BPromise=require(_0x3e87('0x0'));var _=require(_0x3e87('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x3e87('0x2'));var crypto=require('crypto');var logger=require('../../../../../../config/logger')('agi');module[_0x3e87('0x3')]=function(_0xb8466c,_0x402cb9,_0x5983e6,_0x573d21){return new BPromise(function(_0x74e779,_0x5534c7){logger[_0x3e87('0x4')](_0x3e87('0x5'),_0x573d21||_0x3e87('0x6'));var _0x2f75d6=new WebSocket(_0x573d21||_0x3e87('0x6'),{'perMessageDeflate':![]});var _0x3c6546='';var _0x1a0be7='0';var _0x48b78e='1';var _0x279fc1=_0x3e87('0x7');function _0x11aab5(_0x19c627){var _0x5f1212=crypto['createHash']('sha1');_0x5f1212['update'](_0x19c627);return _0x5f1212[_0x3e87('0x8')]('hex');}function _0x37a0f9(){try{logger['info'](_0x3e87('0x9'));var _0x4f9080=moment()[_0x3e87('0xa')]();var _0x3f5a71=_0x11aab5(_0x4f9080+_0x402cb9+_0x5983e6);_0x2f75d6[_0x3e87('0xb')](JSON['stringify']({'appID':_0x402cb9,'timestamp':_0x4f9080,'appKey':_0x3f5a71}));var _0x3d5014=fs[_0x3e87('0xc')](_0xb8466c);_0x3d5014['on'](_0x3e87('0xd'),function(_0x4f6c43){_0x2f75d6[_0x3e87('0xb')](_0x4f6c43);});_0x3d5014['on'](_0x3e87('0xe'),function(){_0x2f75d6['send'](_0x3e87('0xf'));});}catch(_0x19d391){logger[_0x3e87('0x10')](_0x3e87('0x11'),JSON[_0x3e87('0x12')](_0x19d391));_0x2f75d6[_0x3e87('0x13')]();}}function _0x347651(_0x364be2){try{if(_0x364be2){var _0x1ef711=JSON['parse'](_0x364be2);switch(_0x1ef711[_0x3e87('0x14')]){case 0x0:if(_0x1ef711[_0x3e87('0x15')]){if(_0x1ef711[_0x3e87('0x15')][_0x3e87('0x16')]){logger[_0x3e87('0x4')]('Tilde\x20ASR\x20hypoteses',JSON[_0x3e87('0x12')](_0x1ef711[_0x3e87('0x15')][_0x3e87('0x17')]));_0x3c6546=_0x1ef711[_0x3e87('0x15')][_0x3e87('0x17')][0x0][_0x3e87('0x18')];_0x1a0be7=_0x1ef711[_0x3e87('0x15')][_0x3e87('0x17')][0x0][_0x3e87('0x19')];_0x48b78e='0';_0x279fc1=_0x3e87('0x1a');_0x2f75d6[_0x3e87('0x13')]();}}break;case 0x1:logger['info'](_0x3e87('0x7'));_0x48b78e='1';_0x279fc1=_0x3e87('0x7');break;case 0x2:logger[_0x3e87('0x4')](_0x3e87('0x1b'));_0x48b78e='2';_0x279fc1=_0x3e87('0x1b');break;case 0x9:logger[_0x3e87('0x4')](_0x3e87('0x1c'));_0x48b78e='9';_0x279fc1=_0x3e87('0x1c');break;case 0xa:logger['info'](_0x3e87('0x1d'));_0x48b78e='10';_0x279fc1=_0x3e87('0x1d');break;case 0xb:logger['info'](_0x3e87('0x1e'));_0x48b78e='11';_0x279fc1=_0x3e87('0x1e');}}}catch(_0x173cea){logger[_0x3e87('0x10')]('Tilde\x20ASR\x20parse\x20error',JSON['stringify'](_0x173cea));_0x2f75d6[_0x3e87('0x13')]();}}function _0x187b76(){logger[_0x3e87('0x4')](_0x3e87('0x1f'));_0x74e779({'transcript':_0x3c6546,'confidence':_0x1a0be7,'status':_0x48b78e,'status_message':_0x279fc1});}function _0x37e46e(_0x2a1ffc){logger[_0x3e87('0x10')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0x3e87('0x20')](_0x2a1ffc)){logger[_0x3e87('0x10')](_[_0x3e87('0x21')](_0x2a1ffc)?JSON['stringify'](_0x2a1ffc):_0x2a1ffc);}}_0x2f75d6['on'](_0x3e87('0x22'),_0x37a0f9);_0x2f75d6['on'](_0x3e87('0x23'),_0x347651);_0x2f75d6['on']('close',_0x187b76);_0x2f75d6['on'](_0x3e87('0x10'),_0x37e46e);});}; \ No newline at end of file +var _0x8315=['EOS','error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','stringify','hypotheses','transcript','likelihood','Success.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isObject','open','message','lodash','moment','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','send','createReadStream','data'];(function(_0x1967de,_0x363ca7){var _0x51cbd2=function(_0x319723){while(--_0x319723){_0x1967de['push'](_0x1967de['shift']());}};_0x51cbd2(++_0x363ca7);}(_0x8315,0xdd));var _0x5831=function(_0x18f785,_0x5b1816){_0x18f785=_0x18f785-0x0;var _0x5a7b82=_0x8315[_0x18f785];return _0x5a7b82;};'use strict';var BPromise=require('bluebird');var _=require(_0x5831('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x5831('0x1'));var crypto=require(_0x5831('0x2'));var logger=require(_0x5831('0x3'))(_0x5831('0x4'));module[_0x5831('0x5')]=function(_0x240097,_0x54a4c1,_0x215afc,_0x2ddfa9){return new BPromise(function(_0x49171f,_0x172d61){logger[_0x5831('0x6')](_0x5831('0x7'),_0x2ddfa9||_0x5831('0x8'));var _0x2c3ed2=new WebSocket(_0x2ddfa9||_0x5831('0x8'),{'perMessageDeflate':![]});var _0x21988b='';var _0x9dcb56='0';var _0x4b050f='1';var _0x48e66f=_0x5831('0x9');function _0x139072(_0xf9d96e){var _0x31397f=crypto[_0x5831('0xa')](_0x5831('0xb'));_0x31397f[_0x5831('0xc')](_0xf9d96e);return _0x31397f[_0x5831('0xd')](_0x5831('0xe'));}function _0x62dc84(){try{logger['info'](_0x5831('0xf'));var _0x43e27d=moment()['unix']();var _0x4062b8=_0x139072(_0x43e27d+_0x54a4c1+_0x215afc);_0x2c3ed2[_0x5831('0x10')](JSON['stringify']({'appID':_0x54a4c1,'timestamp':_0x43e27d,'appKey':_0x4062b8}));var _0xb37cfc=fs[_0x5831('0x11')](_0x240097);_0xb37cfc['on'](_0x5831('0x12'),function(_0x3dd559){_0x2c3ed2['send'](_0x3dd559);});_0xb37cfc['on']('close',function(){_0x2c3ed2[_0x5831('0x10')](_0x5831('0x13'));});}catch(_0xf57e1c){logger[_0x5831('0x14')]('Tilde\x20ASR\x20send\x20error',JSON['stringify'](_0xf57e1c));_0x2c3ed2[_0x5831('0x15')]();}}function _0x1d3163(_0x3df159){try{if(_0x3df159){var _0x47e6eb=JSON[_0x5831('0x16')](_0x3df159);switch(_0x47e6eb[_0x5831('0x17')]){case 0x0:if(_0x47e6eb[_0x5831('0x18')]){if(_0x47e6eb[_0x5831('0x18')][_0x5831('0x19')]){logger[_0x5831('0x6')](_0x5831('0x1a'),JSON[_0x5831('0x1b')](_0x47e6eb['result'][_0x5831('0x1c')]));_0x21988b=_0x47e6eb[_0x5831('0x18')][_0x5831('0x1c')][0x0][_0x5831('0x1d')];_0x9dcb56=_0x47e6eb[_0x5831('0x18')][_0x5831('0x1c')][0x0][_0x5831('0x1e')];_0x4b050f='0';_0x48e66f=_0x5831('0x1f');_0x2c3ed2['terminate']();}}break;case 0x1:logger['info'](_0x5831('0x9'));_0x4b050f='1';_0x48e66f='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger['info']('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x4b050f='2';_0x48e66f='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0x5831('0x6')](_0x5831('0x20'));_0x4b050f='9';_0x48e66f=_0x5831('0x20');break;case 0xa:logger[_0x5831('0x6')](_0x5831('0x21'));_0x4b050f='10';_0x48e66f=_0x5831('0x21');break;case 0xb:logger[_0x5831('0x6')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x4b050f='11';_0x48e66f='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x4cc6c1){logger[_0x5831('0x14')](_0x5831('0x22'),JSON['stringify'](_0x4cc6c1));_0x2c3ed2[_0x5831('0x15')]();}}function _0x12abf6(){logger[_0x5831('0x6')](_0x5831('0x23'));_0x49171f({'transcript':_0x21988b,'confidence':_0x9dcb56,'status':_0x4b050f,'status_message':_0x48e66f});}function _0x5db1c2(_0x52625c){logger[_0x5831('0x14')](_0x5831('0x24'));if(!_['isNil'](_0x52625c)){logger['error'](_[_0x5831('0x25')](_0x52625c)?JSON[_0x5831('0x1b')](_0x52625c):_0x52625c);}}_0x2c3ed2['on'](_0x5831('0x26'),_0x62dc84);_0x2c3ed2['on'](_0x5831('0x27'),_0x1d3163);_0x2c3ed2['on']('close',_0x12abf6);_0x2c3ed2['on'](_0x5831('0x14'),_0x5db1c2);});}; \ 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 8e9068d..383e66e 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 _0x4743=['./asr'];(function(_0x3d7c62,_0x3ab008){var _0x384fe7=function(_0x3218f8){while(--_0x3218f8){_0x3d7c62['push'](_0x3d7c62['shift']());}};_0x384fe7(++_0x3ab008);}(_0x4743,0x1c5));var _0x3474=function(_0x112db5,_0x38a06d){_0x112db5=_0x112db5-0x0;var _0x1d7d06=_0x4743[_0x112db5];return _0x1d7d06;};var asr=require(_0x3474('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0x51cf=['./asr','exports'];(function(_0x308213,_0x224541){var _0x2e1619=function(_0x972b51){while(--_0x972b51){_0x308213['push'](_0x308213['shift']());}};_0x2e1619(++_0x224541);}(_0x51cf,0x90));var _0xf51c=function(_0x1a9d72,_0x553da8){_0x1a9d72=_0x1a9d72-0x0;var _0x55998d=_0x51cf[_0x1a9d72];return _0x55998d;};var asr=require(_0xf51c('0x0'));module[_0xf51c('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 63d9300..c7a3a16 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 _0xf78f=['events','EventEmitter','./error','./channel','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listening','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_MAXCONNECTION','destroy','connection','code','close','E_AGI_SERVER_CLOSE','nextTick','exports','util','net'];(function(_0x40cbbd,_0x10185b){var _0x2ff260=function(_0x32037b){while(--_0x32037b){_0x40cbbd['push'](_0x40cbbd['shift']());}};_0x2ff260(++_0x10185b);}(_0xf78f,0x18a));var _0xff78=function(_0x17d30a,_0x1e5a9f){_0x17d30a=_0x17d30a-0x0;var _0x1e677f=_0xf78f[_0x17d30a];return _0x1e677f;};'use strict';var util=require(_0xff78('0x0'));var net=require(_0xff78('0x1'));var EventEmitter=require(_0xff78('0x2'))[_0xff78('0x3')];var AGIError=require(_0xff78('0x4'));var AGIChannel=require(_0xff78('0x5'));var AGIServer=function(_0x992ccf,_0xa84737,_0x1d8828){var _0x2e663c=this,_0x992ccf=_0x992ccf||0x11dd,_0xa84737=_0xa84737||'127.0.0.1',_0x5671de=null,_0xe6cec=0x0;EventEmitter[_0xff78('0x6')](_0x2e663c);function _0x3b354c(){if(!_0x992ccf){_0x2e663c[_0xff78('0x7')](_0xff78('0x8'),new AGIError(_0xff78('0x9')));return![];}_0x5671de=net[_0xff78('0xa')]();_0x5671de['listen'](_0x992ccf,_0xa84737);_0x5671de['on']('listening',function(){_0x2e663c[_0xff78('0x7')](_0xff78('0xb'));});_0x5671de['on']('connection',function(_0x1470f0){_0x5671de[_0xff78('0xc')](function(_0x13e129,_0x37645b){if(_0x13e129){_0x2e663c[_0xff78('0x7')]('error',new AGIError(_0xff78('0xd'),_0x13e129));}else if(_0x1d8828&&_0x1d8828<0x0){_0x2e663c[_0xff78('0x7')](_0xff78('0x8'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x1470f0['destroy']();}else if(_0x1d8828&&_0x1d8828>0x0&&_0x1d8828<_0x37645b){_0xe6cec+=0x1;_0x2e663c['emit'](_0xff78('0x8'),new AGIError(_0xff78('0xe'),_0xe6cec));_0x1470f0[_0xff78('0xf')]();}else{var _0x3889c9=new AGIChannel(_0x1470f0);_0x3889c9['on']('ready',function(){_0x2e663c['emit'](_0xff78('0x10'),_0x3889c9);});}});});_0x5671de['on'](_0xff78('0x8'),function(_0x5d98c4){_0x2e663c[_0xff78('0x7')]('error',new AGIError(_0xff78('0xd'),_0x5d98c4[_0xff78('0x11')]));});_0x5671de['on'](_0xff78('0x12'),function(){_0x2e663c[_0xff78('0x7')]('close',new AGIError(_0xff78('0x13')));});}process[_0xff78('0x14')](function(){_0x3b354c();});};util['inherits'](AGIServer,EventEmitter);module[_0xff78('0x15')]=function(_0xf44626,_0x4d3b33,_0x269b0e){return new AGIServer(_0xf44626,_0x4d3b33,_0x269b0e);}; \ No newline at end of file +var _0x40de=['E_AGI_SERVER_CLOSE','exports','util','events','./channel','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','emit','connection','destroy','E_AGI_SERVER_MAXCONNECTION','ready','E_AGI_SERVER_ERROR','close'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x40de,0x178));var _0xe40d=function(_0x4c8c4d,_0x170fc3){_0x4c8c4d=_0x4c8c4d-0x0;var _0x7c72d2=_0x40de[_0x4c8c4d];return _0x7c72d2;};'use strict';var util=require(_0xe40d('0x0'));var net=require('net');var EventEmitter=require(_0xe40d('0x1'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0xe40d('0x2'));var AGIServer=function(_0x151c9b,_0x466f6e,_0x3ecca2){var _0x27a845=this,_0x151c9b=_0x151c9b||0x11dd,_0x466f6e=_0x466f6e||'127.0.0.1',_0x5945ef=null,_0x3d62d8=0x0;EventEmitter['call'](_0x27a845);function _0xf07925(){if(!_0x151c9b){_0x27a845['emit'](_0xe40d('0x3'),new AGIError(_0xe40d('0x4')));return![];}_0x5945ef=net[_0xe40d('0x5')]();_0x5945ef[_0xe40d('0x6')](_0x151c9b,_0x466f6e);_0x5945ef['on'](_0xe40d('0x7'),function(){_0x27a845[_0xe40d('0x8')]('listening');});_0x5945ef['on'](_0xe40d('0x9'),function(_0x23bd04){_0x5945ef['getConnections'](function(_0x10bd29,_0x1aa1b8){if(_0x10bd29){_0x27a845['emit'](_0xe40d('0x3'),new AGIError('E_AGI_SERVER_ERROR',_0x10bd29));}else if(_0x3ecca2&&_0x3ecca2<0x0){_0x27a845['emit'](_0xe40d('0x3'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x23bd04[_0xe40d('0xa')]();}else if(_0x3ecca2&&_0x3ecca2>0x0&&_0x3ecca2<_0x1aa1b8){_0x3d62d8+=0x1;_0x27a845[_0xe40d('0x8')](_0xe40d('0x3'),new AGIError(_0xe40d('0xb'),_0x3d62d8));_0x23bd04['destroy']();}else{var _0x45394a=new AGIChannel(_0x23bd04);_0x45394a['on'](_0xe40d('0xc'),function(){_0x27a845[_0xe40d('0x8')](_0xe40d('0x9'),_0x45394a);});}});});_0x5945ef['on'](_0xe40d('0x3'),function(_0x506e33){_0x27a845[_0xe40d('0x8')](_0xe40d('0x3'),new AGIError(_0xe40d('0xd'),_0x506e33['code']));});_0x5945ef['on'](_0xe40d('0xe'),function(){_0x27a845[_0xe40d('0x8')](_0xe40d('0xe'),new AGIError(_0xe40d('0xf')));});}process['nextTick'](function(){_0xf07925();});};util['inherits'](AGIServer,EventEmitter);module[_0xe40d('0x10')]=function(_0x3a2260,_0x1038d1,_0x4a2543){return new AGIServer(_0x3a2260,_0x1038d1,_0x4a2543);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 1e52987..7ffea18 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 _0xa965=['en-US','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','number','includes','POST','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','headers','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','key','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appsecret','clear','clone','hasOwnProperty','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','%s.%s','length','saveRestApiResult','setVariable','split','replaceAll','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','grammar','no\x20grammar\x20configured','MRCPRecog','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','agi','command','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','no\x20list\x20selected','delay','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','MRCPSynth','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','getSquareOdbc','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','createSquareDetailsReport','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','keys','forEach','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','Executed\x20command\x20%s','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','googleDialogflow','DIALOGFLOW_%s','speech','out','dialogflow','Dialogflow\x20Result\x20%s','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20private_key\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','dialogflowV2','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','opts','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','getData','response','maxdigit','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','aws_secret_access_key','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','isString','AWS_LEX_%s','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','beep','NOBEEP','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appid','no\x20appid\x20configured','no\x20appsecret\x20configured','recordFile','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','gotoc','continueAt','extension','priority','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','wav','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','%s[%s]','no\x20file\x20audio\x20found','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','success','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Executed\x20command\x20%s\x20%s','queue','queue_id','no\x20queue\x20found','indexOf','toLowerCase','QUEUE','macro','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','Smtp','\x22%s\x22\x20<%s>','email','bcc','service','host','port','secure','authentication','auth','pass','template_id','sendMail\x20message','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Answer','Skipped\x20Answer','subproject','project_id','no\x20subproject\x20selected','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','AGI','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','apiKey','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','unlink','Google\x20TTS\x20is\x20unreachable','unpause','voicemail','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','shelljs','odbc','randomstring','moment','../../config/logger','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','menu','getdigits','getsecretdigits','channel','rpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbcById','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundPath','save_name','getMailAccount','getMailAccountById','mailRpc','sendMailMessage','getIntervals','interval','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','uniqueid','label','agicommand','createSquareRecording','calleridname','context','accountcode','dnid','arg_1','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','callback','Callback\x20scheduled\x20at\x20','scheduledAt','toString','callback_priority','getPause','getPauseById','agent','callerid','agentPause','agentUnpause','agentLogout','internal','LOCAL','agentLogin','shellCommand','exec','replace','googleCloudTTS','google_cloud_tts_text_type','text','languageCode'];(function(_0x56cb4b,_0x10a591){var _0x38837c=function(_0x3bcab8){while(--_0x3bcab8){_0x56cb4b['push'](_0x56cb4b['shift']());}};_0x38837c(++_0x10a591);}(_0xa965,0x172));var _0x5a96=function(_0x295314,_0x17b250){_0x295314=_0x295314-0x0;var _0x584b0c=_0xa965[_0x295314];return _0x584b0c;};'use strict';var fs=require('fs');var path=require('path');var util=require('util');var _=require('lodash');var sh=require(_0x5a96('0x0'));var odbc=require(_0x5a96('0x1'))();var rs=require(_0x5a96('0x2'));var moment=require(_0x5a96('0x3'));var Mustache=require('mustache');var rp=require('request-promise');var logger=require(_0x5a96('0x4'))('agi');var config=require(_0x5a96('0x5'));var scripts=require(_0x5a96('0x6'));var FILES_PATH=_0x5a96('0x7');var recursiveMapAttributes=[_0x5a96('0x8'),'rawBody'];var verticesWithRetry=[_0x5a96('0x9'),_0x5a96('0xa'),_0x5a96('0xb')];var AGIVertices=function(_0x191da2,_0x4ed0cf,_0x3db79f){this[_0x5a96('0xc')]=_0x191da2;this[_0x5a96('0xd')]=_0x4ed0cf;this['mailRpc']=_0x3db79f;};AGIVertices[_0x5a96('0xe')][_0x5a96('0xf')]=function(_0x11b8d1,_0x3fa616){this[_0x5a96('0xd')][_0x5a96('0x10')](_0x11b8d1)[_0x5a96('0x11')](function(_0xa63dac){_0x3fa616(null,_0xa63dac?_0xa63dac[_0x5a96('0x12')]:![]);})[_0x5a96('0x13')](function(_0x2ecf53){_0x3fa616(_0x2ecf53);});};AGIVertices[_0x5a96('0xe')][_0x5a96('0x14')]=function(_0x3d9618,_0x33a156){this[_0x5a96('0xd')][_0x5a96('0x15')](_0x3d9618)[_0x5a96('0x11')](function(_0x5791d1){_0x33a156(null,_0x5791d1?_0x5791d1[_0x5a96('0x12')]:![]);})[_0x5a96('0x13')](function(_0x4ed18b){_0x33a156(_0x4ed18b);});};AGIVertices[_0x5a96('0xe')][_0x5a96('0x16')]=function(_0x325239,_0x75cb1a){this[_0x5a96('0xd')][_0x5a96('0x17')](_0x325239)[_0x5a96('0x11')](function(_0x2400bd){_0x75cb1a(null,_0x2400bd?_0x2400bd['name']:![]);})[_0x5a96('0x13')](function(_0x2a859b){_0x75cb1a(_0x2a859b);});};AGIVertices[_0x5a96('0xe')]['getSquareOdbc']=function(_0x1b7c39,_0x3b12bb){this[_0x5a96('0xd')][_0x5a96('0x18')](_0x1b7c39)['then'](function(_0x4fcba0){_0x3b12bb(null,_0x4fcba0?_0x4fcba0['dsn']:![]);})[_0x5a96('0x13')](function(_0x120aac){_0x3b12bb(_0x120aac);});};AGIVertices[_0x5a96('0xe')][_0x5a96('0x19')]=function(_0x2d23b4,_0x3846df){this['rpc'][_0x5a96('0x1a')](_0x2d23b4)[_0x5a96('0x11')](function(_0x53508b){_0x3846df(null,_0x53508b?_0x53508b[_0x5a96('0x12')]:![]);})[_0x5a96('0x13')](function(_0x406337){_0x3846df(_0x406337);});};AGIVertices[_0x5a96('0xe')][_0x5a96('0x1b')]=function(_0x5c16af,_0x34aed1){this[_0x5a96('0xd')][_0x5a96('0x1c')](_0x5c16af)[_0x5a96('0x11')](function(_0x22fbc6){_0x34aed1(null,_0x22fbc6?_0x22fbc6[_0x5a96('0x12')]:![]);})[_0x5a96('0x13')](function(_0x24f88c){_0x34aed1(_0x24f88c);});};AGIVertices[_0x5a96('0xe')][_0x5a96('0x1d')]=function(_0x4534cb,_0x7ad3f){var _0x28578f=this;this[_0x5a96('0xd')]['getSoundById'](_0x4534cb)[_0x5a96('0x11')](function(_0x4e1114){_0x7ad3f(null,_0x4e1114?_0x28578f[_0x5a96('0x1e')](_0x4e1114[_0x5a96('0x1f')]):![]);})[_0x5a96('0x13')](function(_0x1d267f){_0x7ad3f(_0x1d267f);});};AGIVertices[_0x5a96('0xe')][_0x5a96('0x20')]=function(_0x2ef9fa,_0x471adc){this[_0x5a96('0xd')][_0x5a96('0x21')](_0x2ef9fa)[_0x5a96('0x11')](function(_0x450e83){_0x471adc(null,_0x450e83?_0x450e83:![]);})['catch'](function(_0x3d8edd){_0x471adc(_0x3d8edd);});};AGIVertices[_0x5a96('0xe')]['sendMailMessage']=function(_0x4fc7c0,_0x17d2ea,_0x3d343d){this[_0x5a96('0x22')][_0x5a96('0x23')](_0x4fc7c0,_0x17d2ea)['then'](function(){_0x3d343d(null);})['catch'](function(_0x5324e4){_0x3d343d(_0x5324e4);});};AGIVertices[_0x5a96('0xe')][_0x5a96('0x24')]=function(_0x57afa1,_0x1dd180){this[_0x5a96('0xd')]['getIntervalById'](_0x57afa1)[_0x5a96('0x11')](function(_0x362b08){if(_0x362b08){if(_0x362b08['IntervalId']){_0x1dd180(null,[_0x362b08[_0x5a96('0x25')]]);}else{_0x1dd180(null,_['map'](_0x362b08[_0x5a96('0x26')],'interval'));}}else{_0x1dd180(null,![]);}})[_0x5a96('0x13')](function(_0x377fd0){_0x1dd180(_0x377fd0);});};AGIVertices[_0x5a96('0xe')]['getSoundPath']=function(_0xa93b06){return util[_0x5a96('0x27')](_0x5a96('0x28'),FILES_PATH,_0xa93b06);};AGIVertices['prototype'][_0x5a96('0x29')]=function(_0x19efdd,_0x2b5b79,_0x3807a5){odbc['open'](_0x19efdd,function(_0x34b31b){if(_0x34b31b){logger[_0x5a96('0x2a')](_0x5a96('0x2b'),_0x34b31b);_0x3807a5(_0x34b31b);}else{logger[_0x5a96('0x2c')](_0x5a96('0x2d'));odbc[_0x5a96('0x2e')](_0x2b5b79,function(_0x21aa42,_0x5a2071){if(_0x21aa42){logger['info']('Error\x20executing\x20query\x20%s',_0x2b5b79);_0x3807a5(_0x21aa42);}else{logger[_0x5a96('0x2c')](_0x5a96('0x2f'),_0x2b5b79);odbc[_0x5a96('0x30')](function(_0xa1bcc7){if(_0xa1bcc7){logger[_0x5a96('0x2a')](_0x5a96('0x31'),_0xa1bcc7);}_0x3807a5(null,_0x5a2071);});}});}});};AGIVertices[_0x5a96('0xe')][_0x5a96('0x32')]=function(_0x5746cb,_0x30bb6c){this[_0x5a96('0xd')][_0x5a96('0x33')](_0x5746cb)['then'](function(_0x40602e){_0x30bb6c(null,_0x40602e?_0x40602e:![]);})['catch'](function(_0x556514){_0x30bb6c(_0x556514);});};AGIVertices[_0x5a96('0xe')][_0x5a96('0x34')]=function(_0x5b24cb,_0x39cbe){this[_0x5a96('0xd')][_0x5a96('0x34')](_0x5b24cb)[_0x5a96('0x11')](function(_0x5c90ff){_0x39cbe(null,_0x5c90ff);})[_0x5a96('0x13')](function(_0x54d665){_0x39cbe(_0x54d665);});};AGIVertices['prototype']['createSquareDetailsReport']=function(_0x1c8b8e,_0x10df76,_0x208dbb){this[_0x5a96('0xd')]['createSquareDetailsReport']({'uniqueid':this[_0x5a96('0xc')][_0x5a96('0x35')],'node':_0x1c8b8e[_0x5a96('0x36')],'application':_0x1c8b8e[_0x5a96('0x37')],'data':_0x10df76||null,'project_name':this[_0x5a96('0xc')]['arg_1'],'callerid':this[_0x5a96('0xc')]['callerid']})[_0x5a96('0x11')](function(_0x39be9f){if(_0x208dbb){_0x208dbb(null,_0x39be9f);}})[_0x5a96('0x13')](function(_0x4fa946){if(_0x208dbb){_0x208dbb(_0x4fa946);}});};AGIVertices['prototype'][_0x5a96('0x38')]=function(_0x20f2c4,_0x448dfe,_0x3e6af0,_0x2901ce){this[_0x5a96('0xd')][_0x5a96('0x38')]({'uniqueid':this[_0x5a96('0xc')]['uniqueid'],'callerid':this[_0x5a96('0xc')]['callerid'],'calleridname':this[_0x5a96('0xc')][_0x5a96('0x39')],'context':this[_0x5a96('0xc')][_0x5a96('0x3a')],'extension':this[_0x5a96('0xc')]['extension'],'priority':this['channel']['priority'],'accountcode':this[_0x5a96('0xc')][_0x5a96('0x3b')],'dnid':this['channel'][_0x5a96('0x3c')],'projectName':this[_0x5a96('0xc')][_0x5a96('0x3d')],'saveName':_0x448dfe,'filename':_0x20f2c4[_0x5a96('0x3e')]||_0x448dfe,'savePath':_0x3e6af0})[_0x5a96('0x11')](function(_0x462160){_0x2901ce(null,_0x462160);})[_0x5a96('0x13')](function(_0x4635d7){_0x2901ce(_0x4635d7);});};AGIVertices[_0x5a96('0xe')]['createSquareMessage']=function(_0x4b52df,_0x10fd59,_0x30abdc,_0x1bc353,_0x135909){this[_0x5a96('0xd')][_0x5a96('0x3f')]({'uniqueid':this[_0x5a96('0xc')]['uniqueid'],'body':_0x4b52df,'direction':_0x10fd59,'providerName':_0x30abdc,'providerResponse':_0x1bc353})[_0x5a96('0x11')](function(_0x32c996){if(_0x135909){_0x135909(null,_0x32c996);}})[_0x5a96('0x13')](function(_0x5a8dd4){if(_0x135909){_0x135909(_0x5a8dd4);}});};AGIVertices[_0x5a96('0xe')][_0x5a96('0x40')]=function(_0x539ea0,_0x1babbd){this[_0x5a96('0xd')][_0x5a96('0x40')]({'firstName':_[_0x5a96('0x41')](_0x539ea0['name'])||_[_0x5a96('0x42')](_0x539ea0[_0x5a96('0x12')])?_0x5a96('0x43')+Math[_0x5a96('0x44')]():_0x539ea0[_0x5a96('0x12')],'lastName':_['isEmpty'](_0x539ea0[_0x5a96('0x45')])||_[_0x5a96('0x42')](_0x539ea0[_0x5a96('0x45')])?null:_0x539ea0[_0x5a96('0x45')],'phone':_0x539ea0[_0x5a96('0x46')],'ListId':_0x539ea0['list_id'],'scheduledat':_0x539ea0['scheduledAt'],'callbackUniqueid':this[_0x5a96('0xc')]['uniqueid'],'tags':_0x5a96('0x47'),'description':_0x5a96('0x48')+_0x539ea0[_0x5a96('0x49')][_0x5a96('0x4a')](),'priority':_0x539ea0[_0x5a96('0x4b')]})[_0x5a96('0x11')](function(_0x3aaa24){_0x1babbd(null,_0x3aaa24);})[_0x5a96('0x13')](function(_0x1c02e5){_0x1babbd(_0x1c02e5);});};AGIVertices['prototype'][_0x5a96('0x4c')]=function(_0x2012b4,_0x1f18a9){this[_0x5a96('0xd')][_0x5a96('0x4d')](_0x2012b4)[_0x5a96('0x11')](function(_0x2f36c8){_0x1f18a9(null,_0x2f36c8?_0x2f36c8['name']:![]);})['catch'](function(_0x48552b){_0x1f18a9(_0x48552b);});};AGIVertices[_0x5a96('0xe')]['agentPause']=function(_0x42e678,_0x33a1ab,_0x384034){var _0x3629c7={'role':_0x5a96('0x4e')};_0x3629c7[_0x42e678]=this['channel'][_0x5a96('0x4f')];this['rpc'][_0x5a96('0x50')](_0x3629c7,_0x33a1ab,this[_0x5a96('0xc')][_0x5a96('0x35')])[_0x5a96('0x11')](function(_0x1c9d83){_0x384034(null,_['isNil'](_0x1c9d83)?![]:!![]);})['catch'](function(_0x7faad7){logger[_0x5a96('0x2a')](_0x7faad7);_0x384034(null,![]);});};AGIVertices['prototype'][_0x5a96('0x51')]=function(_0x315b5c,_0x165ca5){var _0x3b347a={'role':_0x5a96('0x4e')};_0x3b347a[_0x315b5c]=this['channel'][_0x5a96('0x4f')];this[_0x5a96('0xd')][_0x5a96('0x51')](_0x3b347a)[_0x5a96('0x11')](function(_0x561f92){_0x165ca5(null,_[_0x5a96('0x42')](_0x561f92)?![]:!![]);})[_0x5a96('0x13')](function(_0x4a399b){logger[_0x5a96('0x2a')](_0x4a399b);_0x165ca5(null,![]);});};AGIVertices[_0x5a96('0xe')]['agentLogout']=function(_0x51c986,_0x54976a){var _0x578b97={'role':'agent'};_0x578b97[_0x51c986]=this[_0x5a96('0xc')][_0x5a96('0x4f')];this[_0x5a96('0xd')][_0x5a96('0x52')](_0x578b97)[_0x5a96('0x11')](function(_0x4524ef){_0x54976a(null,_[_0x5a96('0x42')](_0x4524ef)?![]:!![]);})[_0x5a96('0x13')](function(_0x438951){logger[_0x5a96('0x2a')](_0x438951);_0x54976a(null,![]);});};AGIVertices[_0x5a96('0xe')]['agentLogin']=function(_0x3885a0,_0x3320d7){var _0x1a8bd4={'role':_0x5a96('0x4e')};_0x1a8bd4[_0x3885a0]=this[_0x5a96('0xc')][_0x5a96('0x4f')];var _0x3da80b=_0x3885a0!=_0x5a96('0x53')?util[_0x5a96('0x27')]('%s/%s@from-sip/n',_0x5a96('0x54'),this[_0x5a96('0xc')][_0x5a96('0x4f')]):undefined;this[_0x5a96('0xd')][_0x5a96('0x55')](_0x1a8bd4,_0x3da80b)['then'](function(_0x3b1b33){_0x3320d7(null,_[_0x5a96('0x42')](_0x3b1b33)?![]:!![]);})['catch'](function(_0x3cfb59){logger[_0x5a96('0x2a')](_0x3cfb59);_0x3320d7(null,![]);});};AGIVertices[_0x5a96('0xe')][_0x5a96('0x56')]=function(_0x204db3,_0x399784){sh[_0x5a96('0x57')](_['trim'](_0x204db3),function(_0x822c4f,_0x5e9f8c){var _0x436df5=_0x5e9f8c[_0x5a96('0x58')](/(\r\n|\n|\r)/gm,'');_0x399784(null,_0x436df5);});};AGIVertices[_0x5a96('0xe')][_0x5a96('0x59')]=function(_0x2b67fc,_0x492291){scripts[_0x5a96('0x59')](_0x2b67fc['apiKey'],_0x2b67fc[_0x5a96('0x5a')]||'text',_0x2b67fc[_0x5a96('0x5b')],_0x2b67fc[_0x5a96('0x5c')]||_0x5a96('0x5d'),_0x2b67fc['ssmlGender']||_0x5a96('0x5e'),_0x2b67fc[_0x5a96('0x5f')]||_0x5a96('0x60'))['then'](function(_0xb98026){_0x492291(null,_0xb98026);})[_0x5a96('0x13')](function(_0x162fa3){_0x492291(_0x162fa3);});};AGIVertices[_0x5a96('0xe')][_0x5a96('0x61')]=function(_0x716bb,_0x114744){scripts[_0x5a96('0x61')](_0x716bb[_0x5a96('0x5b')],_0x716bb[_0x5a96('0x62')]||'en',0x1)[_0x5a96('0x11')](function(_0x1a06a2){_0x114744(null,_0x1a06a2);})[_0x5a96('0x13')](function(_0x1cf2d3){_0x114744(_0x1cf2d3);});};AGIVertices[_0x5a96('0xe')][_0x5a96('0x63')]=function(_0x117356,_0x596dac){var _0x234f8a={'uri':_0x117356[_0x5a96('0x64')],'method':_0x117356[_0x5a96('0x65')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x117356[_0x5a96('0x66')])===_0x5a96('0x67')&&parseInt(_0x117356[_0x5a96('0x66')])>=0x1?parseInt(_0x117356[_0x5a96('0x66')])*0x3e8:0x5*0x3e8};if(_[_0x5a96('0x68')]([_0x5a96('0x69'),_0x5a96('0x6a')],_0x234f8a[_0x5a96('0x65')][_0x5a96('0x6b')]())){try{_0x234f8a[_0x5a96('0x6c')]=_0x117356['rawBody']?JSON[_0x5a96('0x6d')](_0x117356['rawBody']):{};}catch(_0x126750){logger[_0x5a96('0x2a')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x126750);}}try{_0x234f8a['headers']=_0x117356['rawHeaders']?JSON[_0x5a96('0x6d')](_0x117356[_0x5a96('0x8')]):{};}catch(_0x2386ee){logger['error'](_0x5a96('0x6e'),_0x2386ee);}if(_0x117356[_0x5a96('0x6f')]){try{var _0x1f6860=require(_0x117356[_0x5a96('0x6f')])[_0x5a96('0x70')](this,_0x234f8a);_0x234f8a['uri']=Mustache['render'](_0x117356[_0x5a96('0x64')],_0x1f6860,{},['$$','$$']);if(_0x234f8a['headers']){_0x234f8a[_0x5a96('0x71')]=JSON['parse'](Mustache[_0x5a96('0x72')](JSON[_0x5a96('0x73')](_0x234f8a[_0x5a96('0x71')]),_0x1f6860,{},['$$','$$']));}if(_0x234f8a[_0x5a96('0x6c')]){_0x234f8a[_0x5a96('0x6c')]=JSON[_0x5a96('0x6d')](Mustache[_0x5a96('0x72')](JSON[_0x5a96('0x73')](_0x234f8a['body']),_0x1f6860,{},['$$','$$']));}}catch(_0x58f644){logger[_0x5a96('0x2a')](_0x5a96('0x74'),_0x58f644);}}rp(_0x234f8a)['then'](function(_0xb2866f){var _0x47f4b0={'statusCode':_0xb2866f[_0x5a96('0x75')]||0xc8,'statusMessage':_0xb2866f[_0x5a96('0x76')]||'OK','headers':_0xb2866f[_0x5a96('0x71')]||{},'body':_0xb2866f[_0x5a96('0x6c')]||{}};_0x596dac(null,_0x47f4b0);})[_0x5a96('0x13')](function(_0x2a9c04){var _0x4441a8={'statusCode':_0x2a9c04[_0x5a96('0x75')]||0x1f4,'statusMessage':_0x2a9c04[_0x5a96('0x77')]||_0x5a96('0x78'),'headers':_0x2a9c04[_0x5a96('0x79')][_0x5a96('0x71')]||{},'body':_0x2a9c04[_0x5a96('0x79')][_0x5a96('0x6c')]||{}};_0x596dac(null,_0x4441a8);});};AGIVertices[_0x5a96('0xe')]['googleDialogflow']=function(_0x1dff46,_0x45d9c4){scripts['googleDialogflow'](this[_0x5a96('0xc')][_0x5a96('0x35')],_0x1dff46['key'],_0x1dff46['text'],_0x1dff46[_0x5a96('0x7a')]||'en')['then'](function(_0x5d6922){_0x45d9c4(null,_0x5d6922);})[_0x5a96('0x13')](function(_0x377716){_0x45d9c4(_0x377716);});};AGIVertices['prototype'][_0x5a96('0x7b')]=function(_0x1c52f0,_0x4ab07b){scripts[_0x5a96('0x7b')](this[_0x5a96('0xc')][_0x5a96('0x35')],_0x1c52f0[_0x5a96('0x7c')],_0x1c52f0[_0x5a96('0x7d')],_0x1c52f0[_0x5a96('0x7e')],_0x1c52f0['text'],_0x1c52f0[_0x5a96('0x7f')]||'en')[_0x5a96('0x11')](function(_0x107186){_0x4ab07b(null,_0x107186);})['catch'](function(_0x31f478){_0x4ab07b(_0x31f478);});};AGIVertices[_0x5a96('0xe')][_0x5a96('0x80')]=function(_0xba9ecc,_0x4223cd){scripts[_0x5a96('0x80')](this[_0x5a96('0xc')],_0xba9ecc)[_0x5a96('0x11')](function(_0x40c58d){_0x4223cd(null,_0x40c58d);})['catch'](function(_0x2c34d0){_0x4223cd(_0x2c34d0);});};AGIVertices[_0x5a96('0xe')][_0x5a96('0x81')]=function(_0x240f52,_0x316eee){scripts[_0x5a96('0x81')](_0x240f52[_0x5a96('0x82')],_0x240f52[_0x5a96('0x5b')],_0x240f52['ispeech_tts_language']||_0x5a96('0x5d'),_0x240f52[_0x5a96('0x83')])[_0x5a96('0x11')](function(_0x289e89){_0x316eee(null,_0x289e89);})[_0x5a96('0x13')](function(_0x1aac94){_0x316eee(_0x1aac94);});};AGIVertices[_0x5a96('0xe')]['ispeechASR']=function(_0x3f1507,_0x185dd5,_0x18389e){scripts[_0x5a96('0x84')](_0x185dd5,_0x3f1507[_0x5a96('0x82')],_0x3f1507[_0x5a96('0x85')]||_0x5a96('0x5d'),this[_0x5a96('0x86')](_0x3f1507[_0x5a96('0x87')])?_0x3f1507['model']:undefined)[_0x5a96('0x11')](function(_0x2e5509){_0x18389e(null,_0x2e5509);})[_0x5a96('0x13')](function(_0x19877b){_0x18389e(_0x19877b);});};AGIVertices[_0x5a96('0xe')][_0x5a96('0x88')]=function(_0x1a2629,_0x54e517){scripts[_0x5a96('0x88')](_0x1a2629[_0x5a96('0x89')],_0x1a2629['aws_secret_access_key'],_0x1a2629[_0x5a96('0x8a')],_0x1a2629[_0x5a96('0x8b')]||_0x5a96('0x8c'),_0x1a2629[_0x5a96('0x5b')],_0x1a2629[_0x5a96('0x8d')]||_0x5a96('0x5b'))['then'](function(_0x3e05df){_0x54e517(null,_0x3e05df);})[_0x5a96('0x13')](function(_0x86c10f){_0x54e517(_0x86c10f);});};AGIVertices[_0x5a96('0xe')][_0x5a96('0x8e')]=function(_0x792b77,_0x549ee9){scripts[_0x5a96('0x8e')](this[_0x5a96('0xc')][_0x5a96('0x35')],_0x792b77[_0x5a96('0x89')],_0x792b77['aws_secret_access_key'],_0x792b77[_0x5a96('0x8f')],_0x792b77[_0x5a96('0x5b')],_0x792b77[_0x5a96('0x90')])['then'](function(_0x589b1b){_0x549ee9(null,_0x589b1b);})[_0x5a96('0x13')](function(_0x2e396a){_0x549ee9(_0x2e396a);});};AGIVertices['prototype'][_0x5a96('0x91')]=function(_0x4b2223,_0x5095c5,_0x464ccd){scripts[_0x5a96('0x91')](_0x5095c5,_0x4b2223[_0x5a96('0x82')],_0x4b2223[_0x5a96('0x92')]||'en-US')[_0x5a96('0x11')](function(_0x425d9c){_0x464ccd(null,_0x425d9c);})[_0x5a96('0x13')](function(_0x1b4324){_0x464ccd(_0x1b4324);});};AGIVertices[_0x5a96('0xe')][_0x5a96('0x93')]=function(_0x4e787a,_0x3fea9d,_0x4c5153){scripts[_0x5a96('0x93')](_0x3fea9d,_0x4e787a['appid'],_0x4e787a[_0x5a96('0x94')],_0x4e787a['uri'])[_0x5a96('0x11')](function(_0x3819df){_0x4c5153(null,_0x3819df);})[_0x5a96('0x13')](function(_0x29e60c){_0x4c5153(_0x29e60c);});};AGIVertices[_0x5a96('0xe')][_0x5a96('0x95')]=function(_0x1b1e29){var _0x24a845=_[_0x5a96('0x68')](verticesWithRetry,_0x1b1e29[_0x5a96('0x37')])?_0x1b1e29:_[_0x5a96('0x96')](_0x1b1e29);for(var _0x5165c7 in _0x24a845){if(_0x24a845[_0x5a96('0x97')](_0x5165c7)){if(_0x24a845[_0x5165c7]&&_['isString'](_0x24a845[_0x5165c7])){if(_[_0x5a96('0x68')](recursiveMapAttributes,_0x5165c7)){_0x24a845[_0x5165c7]=this[_0x5a96('0x98')](_0x24a845[_0x5165c7]);}else{_0x24a845[_0x5165c7]=this[_0x5a96('0x99')](_0x24a845[_0x5165c7]);}}}}return _0x24a845;};AGIVertices[_0x5a96('0xe')][_0x5a96('0x9a')]=function(_0x5918cb){for(var _0x383861 in _0x5918cb){if(_0x5918cb['hasOwnProperty'](_0x383861)){if(_[_0x5a96('0x9b')](_0x5918cb[_0x383861])){this[_0x5a96('0x9a')](_0x5918cb[_0x383861]);}else if(_[_0x5a96('0x9c')](_0x5918cb[_0x383861])){for(var _0x546cc3=0x0;_0x546cc3<_0x5918cb[_0x383861]['length'];_0x546cc3++){this[_0x5a96('0x9a')](_0x5918cb[_0x383861][_0x546cc3]);}}else if(_['isString'](_0x5918cb[_0x383861])){_0x5918cb[_0x383861]=this[_0x5a96('0x99')](_0x5918cb[_0x383861]);}}}};AGIVertices[_0x5a96('0xe')]['saveRestApiResult']=function(_0x3f553a,_0x425e4b){for(var _0x1301f4 in _0x3f553a){if(_0x3f553a[_0x5a96('0x97')](_0x1301f4)){if(_['isPlainObject'](_0x3f553a[_0x1301f4])){if(!_['isEmpty'](_0x3f553a[_0x1301f4])){this['saveRestApiResult'](_0x3f553a[_0x1301f4],util[_0x5a96('0x27')](_0x5a96('0x9d'),_0x425e4b,_0x1301f4));}}else if(_[_0x5a96('0x9c')](_0x3f553a[_0x1301f4])){for(var _0x3c2cbc=0x0;_0x3c2cbc<_0x3f553a[_0x1301f4][_0x5a96('0x9e')];_0x3c2cbc++){this[_0x5a96('0x9f')](_0x3f553a[_0x1301f4][_0x3c2cbc],util[_0x5a96('0x27')]('%s.%s',_0x425e4b,_0x1301f4+'['+_0x3c2cbc+']'));}}else{if(!_[_0x5a96('0x42')](_0x3f553a[_0x1301f4])){this[_0x5a96('0xc')][_0x5a96('0xa0')](util[_0x5a96('0x27')](_0x5a96('0x9d'),_0x425e4b,_0x1301f4),_0x3f553a[_0x1301f4]);}}}}};AGIVertices[_0x5a96('0xe')][_0x5a96('0x98')]=function(_0x535e7e){try{var _0x290a17=JSON['parse'](_0x535e7e);this[_0x5a96('0x9a')](_0x290a17);return JSON['stringify'](_0x290a17);}catch(_0x2b959c){return this[_0x5a96('0x99')](_0x535e7e);}};AGIVertices[_0x5a96('0xe')][_0x5a96('0x99')]=function(_0x36695c){var _0x14f726=_0x36695c[_0x5a96('0xa1')]('{');for(var _0x4e62ad=0x1;_0x4e62ad<_0x14f726[_0x5a96('0x9e')];_0x4e62ad+=0x1){var _0x4ba5cf=_0x14f726[_0x4e62ad][_0x5a96('0xa1')]('}');if(_0x4ba5cf[_0x5a96('0x9e')]>0x1){_0x36695c=_0x36695c[_0x5a96('0xa2')]('{'+_0x4ba5cf[0x0]+'}',this[_0x5a96('0xc')][_0x5a96('0xf')](_0x4ba5cf[0x0])['extra']||_0x4ba5cf[0x0]);}}if(_0x14f726[_0x5a96('0x9e')]===0x1){return _0x36695c[_0x5a96('0x4a')]();}return this[_0x5a96('0x99')](_0x36695c);};AGIVertices[_0x5a96('0xe')][_0x5a96('0xa3')]=function(_0x509f59,_0x2161a5){var _0x2a08ad=this[_0x5a96('0xc')][_0x5a96('0xf')](_0x509f59);if(_0x2a08ad[_0x5a96('0xa4')]===-0x1){return _0x2a08ad;}logger[_0x5a96('0x2c')](util[_0x5a96('0x27')](_0x5a96('0xa5'),_0x2161a5,_0x2a08ad[_0x5a96('0xa6')]));return this[_0x5a96('0xc')][_0x5a96('0xa0')](_0x2161a5,_0x2a08ad[_0x5a96('0xa6')]);};AGIVertices['prototype'][_0x5a96('0x86')]=function(_0x22f2fe){return _0x22f2fe&&_0x22f2fe!=='0'&&_0x22f2fe!=='-1'&&_0x22f2fe!=='';};AGIVertices[_0x5a96('0xe')]['maxRetry']=function(_0x232f3b){this['createSquareDetailsReport'][_0x5a96('0x70')](this,_0x232f3b,'-');_0x232f3b['retry']=_0x232f3b[_0x5a96('0xa7')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x5a96('0xe')][_0x5a96('0xa8')]=function(_0x176b92){logger[_0x5a96('0x2c')](util[_0x5a96('0x27')](_0x5a96('0xa9'),_0x176b92[_0x5a96('0x36')]));if(!this[_0x5a96('0x86')](_0x176b92[_0x5a96('0x5b')])){return this[_0x5a96('0xc')]['noop']('no\x20text\x20configured');}var _0x1f554d='\x22'+_0x176b92[_0x5a96('0x5b')]+'\x22';if(this['isConfigured'](_0x176b92['options'])){_0x1f554d+=','+_0x176b92[_0x5a96('0x79')];}var _0x30fbf0=this[_0x5a96('0xc')][_0x5a96('0x57')]('MRCPSynth',_0x1f554d);if(_0x30fbf0[_0x5a96('0xa4')]===-0x1){return _0x30fbf0;}return this['channel'][_0x5a96('0xaa')](util['format'](_0x5a96('0xab'),_0x1f554d));};AGIVertices['prototype'][_0x5a96('0xac')]=function(_0x324de6){logger['info'](util['format']('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x324de6[_0x5a96('0x36')]));if(!this[_0x5a96('0x86')](_0x324de6[_0x5a96('0xad')])){return this[_0x5a96('0xc')][_0x5a96('0xaa')](_0x5a96('0xae'));}var _0x101930=_0x324de6[_0x5a96('0xad')];if(this[_0x5a96('0x86')](_0x324de6[_0x5a96('0x79')])){_0x101930+=','+_0x324de6[_0x5a96('0x79')];}var _0x57edda=this[_0x5a96('0xc')][_0x5a96('0x57')](_0x5a96('0xaf'),_0x101930);if(_0x57edda[_0x5a96('0xa4')]===-0x1){return _0x57edda;}var _0x25c41f=this[_0x5a96('0xa3')]('RECOG_CONFIDENCE()',_0x5a96('0xb0'));if(_0x25c41f[_0x5a96('0xa4')]===-0x1){return _0x25c41f;}var _0x26ad7b=this[_0x5a96('0xa3')](_0x5a96('0xb1'),_0x5a96('0xb2'));if(_0x26ad7b[_0x5a96('0xa4')]===-0x1){return _0x26ad7b;}var _0x430b0d=this[_0x5a96('0xa3')](_0x5a96('0xb3'),_0x5a96('0xb4'));if(_0x430b0d[_0x5a96('0xa4')]===-0x1){return _0x430b0d;}return this['channel'][_0x5a96('0xaa')](util[_0x5a96('0x27')]('Executed\x20command\x20MRCPRecog\x20%s',_0x101930));};AGIVertices[_0x5a96('0xe')][_0x5a96('0xb5')]=function(_0x5b99fe){logger['info'](util[_0x5a96('0x27')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x5b99fe[_0x5a96('0x36')]));return this['channel'][_0x5a96('0xb5')]([_0x5b99fe[_0x5a96('0xb6')],_0x5b99fe[_0x5a96('0xb7')]]);};AGIVertices[_0x5a96('0xe')]['answer']=function(_0x2be2b8){logger['info'](util[_0x5a96('0x27')](_0x5a96('0xb8'),_0x2be2b8[_0x5a96('0x36')]));if(this[_0x5a96('0x86')](_0x2be2b8[_0x5a96('0x66')])){logger[_0x5a96('0x2c')](util[_0x5a96('0x27')](_0x5a96('0xb9'),_0x2be2b8[_0x5a96('0x66')]));var _0x58e333=this[_0x5a96('0xc')][_0x5a96('0xba')](_0x2be2b8[_0x5a96('0x66')]);if(_0x58e333[_0x5a96('0xa4')]===-0x1){return _0x58e333;}}return this[_0x5a96('0xc')][_0x5a96('0xbb')]();};AGIVertices['prototype'][_0x5a96('0x47')]=function(_0x3b46a6){logger[_0x5a96('0x2c')](util[_0x5a96('0x27')](_0x5a96('0xbc'),_0x3b46a6[_0x5a96('0x36')]));if(!this[_0x5a96('0x86')](_0x3b46a6[_0x5a96('0xbd')])){return this[_0x5a96('0xc')][_0x5a96('0x2a')](_0x3b46a6,_0x5a96('0xbe'));}_0x3b46a6[_0x5a96('0x49')]=moment();if(this[_0x5a96('0x86')](_0x3b46a6[_0x5a96('0xbf')])){_0x3b46a6[_0x5a96('0x49')]=moment()['add'](_0x3b46a6['delay'],_0x5a96('0xc0'));}if(!this[_0x5a96('0x86')](_0x3b46a6[_0x5a96('0x4b')])){_0x3b46a6[_0x5a96('0x4b')]=0x2;}this[_0x5a96('0x40')]['sync'](this,_0x3b46a6);return this['channel'][_0x5a96('0xaa')](util['format'](_0x5a96('0xc1'),_0x3b46a6['phone'],_0x3b46a6[_0x5a96('0xbd')],_0x3b46a6['scheduledAt']));};AGIVertices[_0x5a96('0xe')]['custom_app']=function(_0x417da6){logger[_0x5a96('0x2c')](util['format']('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x417da6[_0x5a96('0x36')]));var _0x2607da=this[_0x5a96('0xc')][_0x5a96('0x57')](_0x417da6['application'],_0x417da6[_0x5a96('0x79')]);if(_0x2607da[_0x5a96('0xa4')]===-0x1){return _0x2607da;}return this[_0x5a96('0xc')][_0x5a96('0xaa')](util[_0x5a96('0x27')]('Executed\x20command\x20%s\x20%s',_0x417da6[_0x5a96('0xc2')],_0x417da6[_0x5a96('0x79')]));};AGIVertices[_0x5a96('0xe')][_0x5a96('0xc3')]=function(_0x5e5be1){logger[_0x5a96('0x2c')](util[_0x5a96('0x27')](_0x5a96('0xc4'),_0x5e5be1[_0x5a96('0x36')]));if(!this[_0x5a96('0x86')](_0x5e5be1[_0x5a96('0x5b')])){return this[_0x5a96('0xc')][_0x5a96('0xaa')](_0x5a96('0xc5'));}var _0x58002c='\x22'+_0x5e5be1[_0x5a96('0x5b')]+'\x22';if(this[_0x5a96('0x86')](_0x5e5be1[_0x5a96('0x79')])){_0x58002c+=','+_0x5e5be1[_0x5a96('0x79')];}var _0x3965be=this[_0x5a96('0xc')][_0x5a96('0x57')](_0x5a96('0xc6'),_0x58002c);if(_0x3965be[_0x5a96('0xa4')]===-0x1){return _0x3965be;}return this[_0x5a96('0xc')][_0x5a96('0xaa')](util[_0x5a96('0x27')]('Executed\x20command\x20MRCPSynth\x20%s',_0x58002c));};AGIVertices[_0x5a96('0xe')][_0x5a96('0xc7')]=function(_0x9c0950){logger['info'](util[_0x5a96('0x27')](_0x5a96('0xc8'),_0x9c0950[_0x5a96('0x36')]));if(!this[_0x5a96('0x86')](_0x9c0950[_0x5a96('0x5b')])){return this[_0x5a96('0xc')][_0x5a96('0xaa')](_0x5a96('0xc5'));}var _0x402adb='\x22'+_0x9c0950[_0x5a96('0x5b')]+'\x22';if(this[_0x5a96('0x86')](_0x9c0950[_0x5a96('0x79')])){_0x402adb+=','+_0x9c0950[_0x5a96('0x79')];}var _0x48d115=this[_0x5a96('0xc')][_0x5a96('0x57')]('MRCPSynth',_0x402adb);if(_0x48d115[_0x5a96('0xa4')]===-0x1){return _0x48d115;}return this[_0x5a96('0xc')][_0x5a96('0xaa')](util[_0x5a96('0x27')](_0x5a96('0xab'),_0x402adb));};AGIVertices[_0x5a96('0xe')][_0x5a96('0xc9')]=function(_0x36ff3e){logger[_0x5a96('0x2c')](util[_0x5a96('0x27')](_0x5a96('0xca'),_0x36ff3e[_0x5a96('0x36')]));if(!this[_0x5a96('0x86')](_0x36ff3e[_0x5a96('0xad')])){return this['channel'][_0x5a96('0xaa')](_0x5a96('0xae'));}var _0x461767=_0x36ff3e[_0x5a96('0xad')];if(this[_0x5a96('0x86')](_0x36ff3e[_0x5a96('0x79')])){_0x461767+=','+_0x36ff3e[_0x5a96('0x79')];}var _0x53fafb=this['channel'][_0x5a96('0x57')]('MRCPRecog',_0x461767);if(_0x53fafb[_0x5a96('0xa4')]===-0x1){return _0x53fafb;}var _0x22aec9=this[_0x5a96('0xa3')](_0x5a96('0xcb'),_0x5a96('0xcc'));if(_0x22aec9['result']===-0x1){return _0x22aec9;}var _0x3f0fa2=this[_0x5a96('0xa3')](_0x5a96('0xb1'),_0x5a96('0xcd'));if(_0x3f0fa2['result']===-0x1){return _0x3f0fa2;}var _0x153d5e=this[_0x5a96('0xa3')]('RECOG_INSTANCE()',_0x5a96('0xce'));if(_0x153d5e[_0x5a96('0xa4')]===-0x1){return _0x153d5e;}return this[_0x5a96('0xc')][_0x5a96('0xaa')](util[_0x5a96('0x27')](_0x5a96('0xcf'),_0x461767));};AGIVertices[_0x5a96('0xe')]['sestekasr']=function(_0x16f18e){logger[_0x5a96('0x2c')](util[_0x5a96('0x27')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x16f18e[_0x5a96('0x36')]));if(!this['isConfigured'](_0x16f18e[_0x5a96('0xad')])){return this[_0x5a96('0xc')]['noop'](_0x5a96('0xae'));}var _0x17b135=_0x16f18e['grammar'];if(this[_0x5a96('0x86')](_0x16f18e[_0x5a96('0x79')])){_0x17b135+=','+_0x16f18e[_0x5a96('0x79')];}var _0x257072=this[_0x5a96('0xc')][_0x5a96('0x57')](_0x5a96('0xaf'),_0x17b135);if(_0x257072[_0x5a96('0xa4')]===-0x1){return _0x257072;}var _0x168593=this[_0x5a96('0xa3')]('RECOG_CONFIDENCE()','SESTEK_ASR_CONFIDENCE');if(_0x168593['result']===-0x1){return _0x168593;}var _0x18d4af=this['getAndSetVariable'](_0x5a96('0xb1'),_0x5a96('0xd0'));if(_0x18d4af[_0x5a96('0xa4')]===-0x1){return _0x18d4af;}var _0x3eb776=this[_0x5a96('0xa3')](_0x5a96('0xb3'),_0x5a96('0xd1'));if(_0x3eb776[_0x5a96('0xa4')]===-0x1){return _0x3eb776;}return this[_0x5a96('0xc')][_0x5a96('0xaa')](util[_0x5a96('0x27')](_0x5a96('0xcf'),_0x17b135));};AGIVertices[_0x5a96('0xe')][_0x5a96('0xd2')]=function(_0x34bf9e){logger[_0x5a96('0x2c')](util[_0x5a96('0x27')](_0x5a96('0xd3'),_0x34bf9e[_0x5a96('0x36')]));if(!this[_0x5a96('0x86')](_0x34bf9e[_0x5a96('0xd4')])){return this[_0x5a96('0xc')][_0x5a96('0x2a')](_0x34bf9e,_0x5a96('0xd5'));}var _0x2067e1=this[_0x5a96('0xd6')]['sync'](this,_0x34bf9e['odbc_id']);if(!_0x2067e1){return this['channel']['error'](_0x34bf9e,_0x5a96('0xd7'));}if(!this[_0x5a96('0x86')](_0x34bf9e[_0x5a96('0x2e')])){return this[_0x5a96('0xc')]['error'](_0x34bf9e,_0x5a96('0xd8'));}var _0x1c037e=_0x34bf9e[_0x5a96('0x2e')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x5a96('0xc')]['noop'](util['format'](_0x5a96('0xd9'),_0x1c037e));var _0x559be7=this[_0x5a96('0x29')][_0x5a96('0x70')](this,_0x2067e1,_0x1c037e);this[_0x5a96('0xda')][_0x5a96('0x70')](this,_0x34bf9e,_0x1c037e);if(!this[_0x5a96('0x86')](_0x34bf9e['variable_id'])){return this[_0x5a96('0xc')][_0x5a96('0xaa')](_0x5a96('0xdb'));}var _0x53cc65=this[_0x5a96('0xf')][_0x5a96('0x70')](this,_0x34bf9e[_0x5a96('0xdc')]);if(!_0x53cc65){return this[_0x5a96('0xc')][_0x5a96('0x2a')](_0x34bf9e,'no\x20variable\x20found');}var _0x36e3ee=this;_0x559be7['forEach'](function(_0x2fa3c7,_0x357fd5){Object[_0x5a96('0xdd')](_0x2fa3c7)[_0x5a96('0xde')](function(_0x41e035){_0x36e3ee[_0x5a96('0xc')][_0x5a96('0xa0')](util[_0x5a96('0x27')](_0x5a96('0xdf'),_0x53cc65,_0x357fd5,_0x41e035),_0x2fa3c7[_0x41e035]);});});this[_0x5a96('0xc')][_0x5a96('0xa0')](util[_0x5a96('0x27')](_0x5a96('0xe0'),_0x53cc65),_0x559be7[_0x5a96('0x9e')]);return this[_0x5a96('0xc')]['noop'](util[_0x5a96('0x27')](_0x5a96('0xe1'),_0x53cc65));};AGIVertices[_0x5a96('0xe')][_0x5a96('0xe2')]=function(_0x557beb){logger[_0x5a96('0xe3')](util[_0x5a96('0x27')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x557beb[_0x5a96('0x36')]));if(!this[_0x5a96('0x86')](_0x557beb['sip_id'])){return this[_0x5a96('0xc')][_0x5a96('0x2a')](_0x557beb,_0x5a96('0xe4'));}var _0x868d19=this['getUser'][_0x5a96('0x70')](this,_0x557beb['sip_id']);if(!_0x868d19){return this[_0x5a96('0xc')]['error'](_0x557beb,_0x5a96('0xe5'));}var _0x525762=this['channel']['exec'](_0x5a96('0xe6'),[util[_0x5a96('0x27')](_0x5a96('0xe7'),_0x868d19),_0x557beb[_0x5a96('0x66')],_0x557beb['opts'],_0x557beb[_0x5a96('0x64')]]);if(_0x525762[_0x5a96('0xa4')]===-0x1){return _0x525762;}return this[_0x5a96('0xc')]['noop'](util[_0x5a96('0x27')](_0x5a96('0xe8'),_0x5a96('0xe6')));};AGIVertices[_0x5a96('0xe')]['dialogflow']=function(_0x52e9d3){logger[_0x5a96('0x2c')](util[_0x5a96('0x27')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x52e9d3[_0x5a96('0x36')]));if(!this[_0x5a96('0x86')](_0x52e9d3['key'])){return this[_0x5a96('0xc')][_0x5a96('0xaa')](_0x5a96('0xe9'));}if(!this[_0x5a96('0x86')](_0x52e9d3['text'])){return this[_0x5a96('0xc')][_0x5a96('0xaa')](_0x5a96('0xc5'));}this[_0x5a96('0xc')][_0x5a96('0xea')]=!![];this[_0x5a96('0xda')](_0x52e9d3);this[_0x5a96('0x3f')](_0x52e9d3[_0x5a96('0x5b')],'in','','');this[_0x5a96('0xc')][_0x5a96('0xaa')](util[_0x5a96('0x27')](_0x5a96('0xeb'),_0x52e9d3['text']));var _0x1d2eba=this[_0x5a96('0xec')][_0x5a96('0x70')](this,_0x52e9d3);if(_0x1d2eba){for(var _0x59e96e in _0x1d2eba){if(_0x1d2eba['hasOwnProperty'](_0x59e96e)){this[_0x5a96('0xc')][_0x5a96('0xa0')](util[_0x5a96('0x27')](_0x5a96('0xed'),_0x59e96e[_0x5a96('0x6b')]()),_0x1d2eba[_0x59e96e]);}}this[_0x5a96('0x3f')](_0x1d2eba[_0x5a96('0xee')],_0x5a96('0xef'),_0x5a96('0xf0'),'');return this[_0x5a96('0xc')][_0x5a96('0xaa')](util['format'](_0x5a96('0xf1'),_0x1d2eba[_0x5a96('0xee')]));}return this[_0x5a96('0xc')]['error'](_0x52e9d3,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0x5a96('0xe')]['dialogflowV2']=function(_0x3f6b76){logger[_0x5a96('0x2c')](util[_0x5a96('0x27')](_0x5a96('0xf2'),_0x3f6b76[_0x5a96('0x36')]));if(!this[_0x5a96('0x86')](_0x3f6b76['dialogflowV2_project_id'])){return this['channel'][_0x5a96('0xaa')](_0x5a96('0xf3'));}if(!this[_0x5a96('0x86')](_0x3f6b76[_0x5a96('0x7d')])){return this[_0x5a96('0xc')][_0x5a96('0xaa')]('no\x20client_email\x20configured');}if(!this[_0x5a96('0x86')](_0x3f6b76[_0x5a96('0x7e')])){return this['channel']['noop'](_0x5a96('0xf4'));}if(!this[_0x5a96('0x86')](_0x3f6b76[_0x5a96('0x7f')])){return this['channel'][_0x5a96('0xaa')]('no\x20anguage\x20configured');}if(!this['isConfigured'](_0x3f6b76[_0x5a96('0x5b')])){return this[_0x5a96('0xc')][_0x5a96('0xaa')](_0x5a96('0xc5'));}this[_0x5a96('0xc')][_0x5a96('0xea')]=!![];this['createSquareDetailsReport'](_0x3f6b76);this[_0x5a96('0x3f')](_0x3f6b76['text'],'in','','');this['channel']['noop'](util[_0x5a96('0x27')](_0x5a96('0xf5'),_0x3f6b76[_0x5a96('0x5b')]));var _0x396920=this[_0x5a96('0x7b')]['sync'](this,_0x3f6b76);if(_0x396920){for(var _0x727f5a in _0x396920){if(_0x396920[_0x5a96('0x97')](_0x727f5a)){if(_0x727f5a!==_0x5a96('0xf6')){this[_0x5a96('0xc')][_0x5a96('0xa0')](util['format'](_0x5a96('0xed'),_0x727f5a[_0x5a96('0x6b')]()),_0x396920[_0x727f5a]);}}}this[_0x5a96('0x3f')](_0x396920[_0x5a96('0xee')],'out',_0x5a96('0xf7'),_0x396920[_0x5a96('0xf6')]);return this[_0x5a96('0xc')][_0x5a96('0xaa')](util['format'](_0x5a96('0xf8'),_0x396920[_0x5a96('0xee')]));}return this[_0x5a96('0xc')]['error'](_0x3f6b76,_0x5a96('0xf9'));};AGIVertices[_0x5a96('0xe')][_0x5a96('0xfa')]=function(_0x4b8d5d){logger[_0x5a96('0x2c')](util[_0x5a96('0x27')](_0x5a96('0xfb'),_0x4b8d5d[_0x5a96('0x36')]));if(!this[_0x5a96('0x86')](_0x4b8d5d[_0x5a96('0xfc')])){return this[_0x5a96('0xc')][_0x5a96('0xaa')](_0x5a96('0xfd'));}if(!this[_0x5a96('0x86')](_0x4b8d5d[_0x5a96('0xfe')])){return this[_0x5a96('0xc')][_0x5a96('0xaa')]('no\x20username\x20configured');}if(!this[_0x5a96('0x86')](_0x4b8d5d[_0x5a96('0xff')])){return this[_0x5a96('0xc')][_0x5a96('0xaa')](_0x5a96('0x100'));}if(!this[_0x5a96('0x86')](_0x4b8d5d[_0x5a96('0x101')])){return this[_0x5a96('0xc')]['noop'](_0x5a96('0xc5'));}this[_0x5a96('0xc')][_0x5a96('0xea')]=!![];this[_0x5a96('0xda')](_0x4b8d5d);this[_0x5a96('0x3f')](_0x4b8d5d['text'],'in','','');this['channel']['noop'](util[_0x5a96('0x27')](_0x5a96('0x102'),_0x4b8d5d[_0x5a96('0x5b')]));var _0x19755c=this[_0x5a96('0x80')]['sync'](this,_0x4b8d5d);if(_0x19755c){for(var _0x33d8a4 in _0x19755c){if(_0x19755c[_0x5a96('0x97')](_0x33d8a4)){this[_0x5a96('0xc')][_0x5a96('0xa0')](util[_0x5a96('0x27')](_0x5a96('0x103'),_0x33d8a4[_0x5a96('0x6b')]()),_0x19755c[_0x33d8a4]);}}this['createSquareMessage'](_0x19755c[_0x5a96('0xee')],'out',_0x5a96('0xfa'),'');if(_0x19755c[_0x5a96('0x104')]){this[_0x5a96('0xc')][_0x5a96('0xaa')](util['format'](_0x5a96('0x105'),_0x19755c[_0x5a96('0x104')]));var _0x9c102a=this['channel'][_0x5a96('0x106')](_0x19755c[_0x5a96('0x104')]);try{fs['unlink'](_0x19755c[_0x5a96('0x104')]+_0x5a96('0x107'));}catch(_0x1840eb){logger['error'](_0x1840eb);}return _0x9c102a;}else{return this[_0x5a96('0xc')]['noop'](util[_0x5a96('0x27')](_0x5a96('0x108'),_0x19755c[_0x5a96('0xee')]));}}return this[_0x5a96('0xc')][_0x5a96('0x2a')](_0x4b8d5d,_0x5a96('0x109'));};AGIVertices[_0x5a96('0xe')][_0x5a96('0x10a')]=function(_0xd8ad2f){logger[_0x5a96('0x2c')](util['format'](_0x5a96('0x10b'),_0xd8ad2f[_0x5a96('0x36')]));return this[_0x5a96('0xc')][_0x5a96('0xaa')](_0x5a96('0x10a'));};AGIVertices[_0x5a96('0xe')][_0x5a96('0x10c')]=function(_0x3f567a){logger[_0x5a96('0x2c')](util[_0x5a96('0x27')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x3f567a['label']));var _0x52c1a6='';if(_0x3f567a[_0x5a96('0x10d')]){if(!this[_0x5a96('0x86')](_0x3f567a[_0x5a96('0x10d')])){return this[_0x5a96('0xc')][_0x5a96('0x2a')](_0x3f567a,_0x5a96('0x10e'));}else{var _0x9a5765=parseInt(_0x3f567a[_0x5a96('0x10d')],0xa);if(isNaN(_0x9a5765)){_0x52c1a6=_0x3f567a[_0x5a96('0x10d')];}else{_0x52c1a6=this[_0x5a96('0x1b')]['sync'](this,_0x3f567a[_0x5a96('0x10d')]);if(!_0x52c1a6){return this[_0x5a96('0xc')][_0x5a96('0x2a')](_0x3f567a,_0x5a96('0x10f'));}}}}else if(_0x3f567a[_0x5a96('0x110')]){_0x52c1a6=_0x3f567a[_0x5a96('0x110')];}else{return this[_0x5a96('0xc')][_0x5a96('0x2a')](_0x3f567a,_0x5a96('0x10e'));}var _0x377571=this[_0x5a96('0xc')][_0x5a96('0x57')](_0x5a96('0xe6'),[util[_0x5a96('0x27')](_0x5a96('0x111'),_0x52c1a6,_0x3f567a[_0x5a96('0x46')]),_0x3f567a[_0x5a96('0x66')],_0x3f567a[_0x5a96('0x112')],_0x3f567a[_0x5a96('0x64')]]);if(_0x377571[_0x5a96('0xa4')]===-0x1){return _0x377571;}return this[_0x5a96('0xc')][_0x5a96('0xaa')](util[_0x5a96('0x27')](_0x5a96('0xe8'),_0x5a96('0xe6')));};AGIVertices['prototype'][_0x5a96('0x113')]=function(_0x5ab560){logger[_0x5a96('0x2c')](util['format'](_0x5a96('0x114'),_0x5ab560[_0x5a96('0x36')]));return this[_0x5a96('0xc')][_0x5a96('0xaa')](_0x5a96('0x113'));};AGIVertices[_0x5a96('0xe')][_0x5a96('0xa')]=function(_0x4b0b63){logger[_0x5a96('0x2c')](util[_0x5a96('0x27')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x4b0b63[_0x5a96('0x36')]));if(_0x4b0b63['retry']===0x0){return this[_0x5a96('0xa7')](_0x4b0b63);}_0x4b0b63[_0x5a96('0x115')]-=0x1;if(!this[_0x5a96('0x86')](_0x4b0b63[_0x5a96('0x116')])){return this[_0x5a96('0xc')][_0x5a96('0x2a')](_0x4b0b63,_0x5a96('0x117'));}var _0x3a9601=this[_0x5a96('0x1d')][_0x5a96('0x70')](this,_0x4b0b63[_0x5a96('0x116')]);if(!_0x3a9601){return this[_0x5a96('0xc')][_0x5a96('0x2a')](_0x4b0b63,'no\x20file\x20audio\x20found');}if(!this[_0x5a96('0x86')](_0x4b0b63[_0x5a96('0xdc')])){return this[_0x5a96('0xc')][_0x5a96('0x2a')](_0x5a96('0xdb'));}var _0x3ca014=this[_0x5a96('0xc')][_0x5a96('0x118')](_0x3a9601,_0x4b0b63[_0x5a96('0x119')],_0x4b0b63[_0x5a96('0x11a')]);var _0x3919f6=_0x3ca014[_0x5a96('0xa4')]?_0x3ca014[_0x5a96('0xa4')]['toString']():'';logger[_0x5a96('0x2c')]('test',JSON[_0x5a96('0x73')](_0x3ca014));if(_0x3ca014[_0x5a96('0xa4')]===-0x1){this['createSquareDetailsReport'][_0x5a96('0x70')](this,_0x4b0b63,_0x3919f6);return _0x3ca014;}else if(_0x3ca014[_0x5a96('0xa6')]===_0x5a96('0x66')){_0x3ca014[_0x5a96('0xa4')]=_0x3919f6[_0x5a96('0x9e')]>=parseInt(_0x4b0b63[_0x5a96('0x11b')])?'x':'i';}else{_0x3ca014[_0x5a96('0xa4')]=_0x3919f6[_0x5a96('0x9e')]>=parseInt(_0x4b0b63[_0x5a96('0x11b')])&&_0x3919f6['length']<=parseInt(_0x4b0b63[_0x5a96('0x11a')])?'x':'i';}var _0x4082ff=this[_0x5a96('0xf')][_0x5a96('0x70')](this,_0x4b0b63[_0x5a96('0xdc')]);if(!_0x4082ff){return this[_0x5a96('0xc')][_0x5a96('0x2a')](_0x4b0b63,_0x5a96('0x11c'));}this['channel']['setVariable'](_0x4082ff,_0x3919f6);if(this[_0x5a96('0x86')](_0x4b0b63[_0x5a96('0x11d')])){var _0x86ab0f=parseInt(_0x4b0b63[_0x5a96('0x11d')],0xa);var _0x3a0946=rs[_0x5a96('0x11e')]({'charset':'*','length':_0x86ab0f});var _0x489d97=_0x3919f6[_0x5a96('0x9e')];if(_0x489d97>0x0){if(_0x489d97>_0x86ab0f){this[_0x5a96('0xda')][_0x5a96('0x70')](this,_0x4b0b63,_0x4b0b63[_0x5a96('0x11f')]===_0x5a96('0x120')?_0x3a0946+_0x3919f6[_0x5a96('0x121')](_0x86ab0f):_0x3919f6[_0x5a96('0x121')](0x0,_0x489d97-_0x86ab0f)+_0x3a0946);}else{this['createSquareDetailsReport']['sync'](this,_0x4b0b63,rs['generate']({'charset':'*','length':_0x489d97}));}}else{this[_0x5a96('0xda')][_0x5a96('0x70')](this,_0x4b0b63,'');}}else{this[_0x5a96('0xda')]['sync'](this,_0x4b0b63,_0x3919f6);}return _0x3ca014;};AGIVertices[_0x5a96('0xe')][_0x5a96('0xb')]=function(_0x36b58c){logger[_0x5a96('0x2c')](util[_0x5a96('0x27')](_0x5a96('0x122'),_0x36b58c[_0x5a96('0x36')]));return this[_0x5a96('0xa')](_0x36b58c);};AGIVertices[_0x5a96('0xe')][_0x5a96('0x123')]=function(_0x4b2997){logger[_0x5a96('0x2c')](util[_0x5a96('0x27')](_0x5a96('0x124'),_0x4b2997['label']));this[_0x5a96('0xda')]['sync'](this,_0x4b2997,_0x4b2997[_0x5a96('0x125')]);return this['channel'][_0x5a96('0xaa')](util['format'](_0x5a96('0x126'),_0x4b2997[_0x5a96('0x125')]));};AGIVertices[_0x5a96('0xe')][_0x5a96('0x127')]=function(_0x4b0579){logger[_0x5a96('0x2c')](util['format']('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x4b0579[_0x5a96('0x36')]));if(!this[_0x5a96('0x86')](_0x4b0579['aws_access_key_id'])||!this[_0x5a96('0x86')](_0x4b0579[_0x5a96('0x128')])){return this[_0x5a96('0xc')][_0x5a96('0xaa')](_0x5a96('0x129'));}if(!this[_0x5a96('0x86')](_0x4b0579['text'])){return this['channel']['noop'](_0x5a96('0xc5'));}this[_0x5a96('0xc')][_0x5a96('0xaa')](util[_0x5a96('0x27')](_0x5a96('0x12a'),_0x4b0579[_0x5a96('0x5b')]));var _0x4f3745=this['awsPolly'][_0x5a96('0x70')](this,_0x4b0579);if(_0x4f3745){this['channel'][_0x5a96('0xaa')](util[_0x5a96('0x27')](_0x5a96('0x12b'),_0x4f3745));var _0x15aa44=this[_0x5a96('0xc')][_0x5a96('0x106')](_0x4f3745);try{fs['unlink'](_0x4f3745+_0x5a96('0x107'));}catch(_0x3612f3){logger[_0x5a96('0x2a')](_0x3612f3);}return _0x15aa44;}return this[_0x5a96('0xc')][_0x5a96('0x2a')](_0x4b0579,_0x5a96('0x12c'));};AGIVertices['prototype'][_0x5a96('0x12d')]=function(_0x18f54e){logger['info'](util[_0x5a96('0x27')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x18f54e['label']));if(!this[_0x5a96('0x86')](_0x18f54e[_0x5a96('0x89')])||!this['isConfigured'](_0x18f54e[_0x5a96('0x128')])){return this[_0x5a96('0xc')][_0x5a96('0xaa')](_0x5a96('0x129'));}if(!this['isConfigured'](_0x18f54e[_0x5a96('0x90')])){return this['channel'][_0x5a96('0xaa')](_0x5a96('0x12e'));}if(!this['isConfigured'](_0x18f54e[_0x5a96('0x5b')])){return this[_0x5a96('0xc')][_0x5a96('0xaa')](_0x5a96('0xc5'));}this[_0x5a96('0xc')]['bot']=!![];this[_0x5a96('0xda')](_0x18f54e);this[_0x5a96('0x3f')](_0x18f54e[_0x5a96('0x5b')],'in','','');this['channel']['noop'](util['format'](_0x5a96('0x12f'),_0x18f54e[_0x5a96('0x5b')]));var _0x55e71b=this['awsLex'][_0x5a96('0x70')](this,_0x18f54e);if(_0x55e71b){for(var _0x3238b7 in _0x55e71b){if(_0x55e71b[_0x5a96('0x97')](_0x3238b7)&&_[_0x5a96('0x130')](_0x55e71b[_0x3238b7])){this[_0x5a96('0xc')][_0x5a96('0xa0')](util[_0x5a96('0x27')](_0x5a96('0x131'),_0x3238b7['toUpperCase']()),_0x55e71b[_0x3238b7]);}}if(_[_0x5a96('0x42')](_0x55e71b[_0x5a96('0x77')])){return this[_0x5a96('0xc')][_0x5a96('0xaa')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this['createSquareMessage'](_0x55e71b[_0x5a96('0x77')],_0x5a96('0xef'),_0x5a96('0x132'),'');return this[_0x5a96('0xc')][_0x5a96('0xaa')](util['format'](_0x5a96('0x133'),_0x55e71b['message']));}}return this['channel'][_0x5a96('0x2a')](_0x18f54e,_0x5a96('0x134'));};AGIVertices[_0x5a96('0xe')]['googleasr']=function(_0x6911be){logger[_0x5a96('0x2c')](util[_0x5a96('0x27')](_0x5a96('0x135'),_0x6911be[_0x5a96('0x36')],_0x6911be['timeout']));if(!this['isConfigured'](_0x6911be[_0x5a96('0x82')])){return this[_0x5a96('0xc')][_0x5a96('0xaa')](_0x5a96('0xe9'));}var _0x136ca9='wav';var _0xc3d02e=util[_0x5a96('0x27')](_0x5a96('0x136'),FILES_PATH,rs[_0x5a96('0x11e')](0x4));var _0x34d253=util[_0x5a96('0x27')](_0x5a96('0x9d'),_0xc3d02e,_0x136ca9);var _0x2c97af=!![];if(_0x6911be[_0x5a96('0x137')]===_0x5a96('0x138')){_0x2c97af=![];}var _0x2e6bae=this['channel']['recordFile'](_0xc3d02e,_0x136ca9,_0x6911be[_0x5a96('0x139')],_0x6911be['timeout'],undefined,_0x2c97af);if(_0x2e6bae[_0x5a96('0xa4')]!==-0x1){this[_0x5a96('0xc')]['noop'](util[_0x5a96('0x27')](_0x5a96('0x13a'),_0x34d253));var _0x25cadf=this[_0x5a96('0x91')][_0x5a96('0x70')](this,_0x6911be,_0x34d253);if(_0x25cadf){for(var _0x274741 in _0x25cadf){if(_0x25cadf['hasOwnProperty'](_0x274741)){this[_0x5a96('0xc')][_0x5a96('0xa0')](util[_0x5a96('0x27')](_0x5a96('0x13b'),_0x274741[_0x5a96('0x6b')]()),_0x25cadf[_0x274741]);}}return this[_0x5a96('0xc')][_0x5a96('0xaa')](util[_0x5a96('0x27')](_0x5a96('0x13c'),JSON['stringify'](_0x25cadf)));}}return _0x2e6bae;};AGIVertices[_0x5a96('0xe')][_0x5a96('0x13d')]=function(_0x3a848a){logger[_0x5a96('0x2c')](util[_0x5a96('0x27')](_0x5a96('0x13e'),_0x3a848a[_0x5a96('0x36')]));if(!this[_0x5a96('0x86')](_0x3a848a[_0x5a96('0x13f')])){return this[_0x5a96('0xc')][_0x5a96('0xaa')](_0x5a96('0x140'));}if(!this[_0x5a96('0x86')](_0x3a848a[_0x5a96('0x94')])){return this['channel']['noop'](_0x5a96('0x141'));}var _0x578a89='wav';var _0x54c7ce=util['format'](_0x5a96('0x136'),FILES_PATH,rs[_0x5a96('0x11e')](0x4));var _0x219eeb=util[_0x5a96('0x27')](_0x5a96('0x9d'),_0x54c7ce,_0x578a89);var _0x15264c=!![];if(_0x3a848a['beep']===_0x5a96('0x138')){_0x15264c=![];}var _0x1b3348=this[_0x5a96('0xc')][_0x5a96('0x142')](_0x54c7ce,_0x578a89,_0x3a848a['intKey'],_0x3a848a[_0x5a96('0x66')],undefined,_0x15264c);if(_0x1b3348['result']!==-0x1){this[_0x5a96('0xc')][_0x5a96('0xaa')](util[_0x5a96('0x27')](_0x5a96('0x143'),_0x219eeb));var _0x75caa3=this['tildeASR'][_0x5a96('0x70')](this,_0x3a848a,_0x219eeb);if(_0x75caa3){for(var _0x1357ec in _0x75caa3){if(_0x75caa3[_0x5a96('0x97')](_0x1357ec)){this[_0x5a96('0xc')][_0x5a96('0xa0')](util[_0x5a96('0x27')](_0x5a96('0x144'),_0x1357ec[_0x5a96('0x6b')]()),_0x75caa3[_0x1357ec]);}}return this[_0x5a96('0xc')][_0x5a96('0xaa')](util[_0x5a96('0x27')]('TildeASR\x20Result\x20%s',JSON[_0x5a96('0x73')](_0x75caa3)));}}return _0x1b3348;};AGIVertices[_0x5a96('0xe')][_0x5a96('0x145')]=function(_0x3e7eac){logger[_0x5a96('0x2c')](util[_0x5a96('0x27')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x3e7eac[_0x5a96('0x36')]));return this[_0x5a96('0xc')][_0x5a96('0x146')](_0x3e7eac[_0x5a96('0x3a')],_0x3e7eac[_0x5a96('0x147')],_0x3e7eac[_0x5a96('0x148')]);};AGIVertices['prototype'][_0x5a96('0x149')]=function(_0x2f987e){logger[_0x5a96('0x2c')](util[_0x5a96('0x27')](_0x5a96('0x14a'),_0x2f987e[_0x5a96('0x36')]));if(!this[_0x5a96('0x86')](_0x2f987e[_0x5a96('0x14b')])){return this[_0x5a96('0xc')][_0x5a96('0x2a')](_0x2f987e,_0x5a96('0x14c'));}try{var _0x3a403c=eval(_0x2f987e['condition'])?_0x5a96('0x14d'):_0x5a96('0x14e');this[_0x5a96('0xc')][_0x5a96('0xaa')](util[_0x5a96('0x27')](_0x5a96('0x14f'),_0x2f987e[_0x5a96('0x14b')],_0x3a403c));return{'code':0xc8,'result':_0x3a403c};}catch(_0x32de55){return{'code':0xc8,'result':_0x5a96('0x14e')};}};AGIVertices[_0x5a96('0xe')][_0x5a96('0x150')]=function(_0x352738){logger['info'](util['format']('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x352738[_0x5a96('0x36')]));if(!this['isConfigured'](_0x352738[_0x5a96('0x151')])){return this[_0x5a96('0xc')][_0x5a96('0x2a')](_0x352738,'no\x20interval\x20configured');}var _0x3e1d0e=this[_0x5a96('0x24')]['sync'](this,_0x352738[_0x5a96('0x151')]);if(!_0x3e1d0e){return this[_0x5a96('0xc')][_0x5a96('0x2a')](_0x352738,_0x5a96('0x152'));}for(var _0x32eb99=0x0;_0x32eb99<_0x3e1d0e['length'];_0x32eb99+=0x1){var _0x5e239a=this[_0x5a96('0xc')]['getVariable'](util[_0x5a96('0x27')](_0x5a96('0x153'),_0x3e1d0e[_0x32eb99]));if(_0x5e239a[_0x5a96('0xa4')]===-0x1){return _0x5e239a;}logger[_0x5a96('0x2c')](util[_0x5a96('0x27')](_0x5a96('0x154'),_0x3e1d0e[_0x32eb99],_0x5e239a[_0x5a96('0xa6')]));if(_0x5e239a[_0x5a96('0xa6')]===_0x5a96('0x14d')){logger[_0x5a96('0x2c')](util[_0x5a96('0x27')](_0x5a96('0x154'),_0x3e1d0e[_0x32eb99],_0x5a96('0x14d')));this['channel']['noop'](util[_0x5a96('0x27')](_0x5a96('0x154'),_0x3e1d0e[_0x32eb99],'true'));return{'code':0xc8,'result':_0x5a96('0x14d')};}else{logger[_0x5a96('0x2c')](util['format']('IFTIME\x20%s\x20%s',_0x3e1d0e[_0x32eb99],_0x5a96('0x14e')));this[_0x5a96('0xc')]['noop'](util[_0x5a96('0x27')]('IFTIME\x20%s\x20%s',_0x3e1d0e[_0x32eb99],_0x5a96('0x14e')));}}return{'code':0xc8,'result':_0x5a96('0x14e')};};AGIVertices[_0x5a96('0xe')][_0x5a96('0x155')]=function(_0x206da9){logger[_0x5a96('0x2c')](util['format'](_0x5a96('0x156'),_0x206da9['label']));return this['channel']['hangup']();};AGIVertices[_0x5a96('0xe')][_0x5a96('0x157')]=function(_0x10a0d6){logger[_0x5a96('0x2c')](util[_0x5a96('0x27')](_0x5a96('0x158'),_0x10a0d6[_0x5a96('0x36')]));if(!this[_0x5a96('0x86')](_0x10a0d6[_0x5a96('0x82')])){return this[_0x5a96('0xc')][_0x5a96('0xaa')](_0x5a96('0xe9'));}var _0x52d4b0=_0x5a96('0x159');var _0x57cd4d=util[_0x5a96('0x27')](_0x5a96('0x136'),FILES_PATH,rs['generate'](0x4));var _0x174247=util[_0x5a96('0x27')]('%s.%s',_0x57cd4d,_0x52d4b0);var _0x1a6bf3=!![];if(_0x10a0d6[_0x5a96('0x137')]===_0x5a96('0x138')){_0x1a6bf3=![];}var _0x156dd9=this[_0x5a96('0xc')][_0x5a96('0x142')](_0x57cd4d,_0x52d4b0,_0x10a0d6[_0x5a96('0x139')],_0x10a0d6[_0x5a96('0x66')],undefined,_0x1a6bf3);if(_0x156dd9[_0x5a96('0xa4')]!==-0x1){this['channel'][_0x5a96('0xaa')](util[_0x5a96('0x27')]('ispeech\x20%s\x20file\x20created',_0x174247));var _0x5e5682=this[_0x5a96('0x84')][_0x5a96('0x70')](this,_0x10a0d6,_0x174247);if(_0x5e5682){for(var _0x228900 in _0x5e5682){if(_0x5e5682[_0x5a96('0x97')](_0x228900)){this[_0x5a96('0xc')][_0x5a96('0xa0')](util[_0x5a96('0x27')](_0x5a96('0x15a'),_0x228900[_0x5a96('0x6b')]()),_0x5e5682[_0x228900]);}}return this[_0x5a96('0xc')][_0x5a96('0xaa')](util[_0x5a96('0x27')](_0x5a96('0x15b'),JSON[_0x5a96('0x73')](_0x5e5682)));}}return _0x156dd9;};AGIVertices[_0x5a96('0xe')]['ispeechtts']=function(_0x412a1){logger[_0x5a96('0x2c')](util[_0x5a96('0x27')](_0x5a96('0x15c'),_0x412a1['label']));if(!this[_0x5a96('0x86')](_0x412a1['key'])){return this['channel'][_0x5a96('0xaa')](_0x5a96('0xe9'));}if(!this['isConfigured'](_0x412a1['text'])){return this['channel'][_0x5a96('0xaa')](_0x5a96('0xc5'));}this['channel'][_0x5a96('0xaa')](util[_0x5a96('0x27')](_0x5a96('0x15d'),_0x412a1[_0x5a96('0x5b')]));var _0x41eca3=this[_0x5a96('0x81')]['sync'](this,_0x412a1);if(_0x41eca3){this[_0x5a96('0xc')][_0x5a96('0xaa')](util[_0x5a96('0x27')]('ispeech\x20%s\x20file\x20created',_0x41eca3));var _0x4ec045=this[_0x5a96('0xc')][_0x5a96('0x106')](_0x41eca3,_0x412a1['intKey']);try{fs['unlink'](_0x41eca3+_0x5a96('0x107'));}catch(_0x2dee18){logger[_0x5a96('0x2a')](_0x2dee18);}return _0x4ec045;}return this[_0x5a96('0xc')][_0x5a96('0x2a')](_0x412a1,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices['prototype']['login']=function(_0x278af1){logger[_0x5a96('0x2c')](util[_0x5a96('0x27')](_0x5a96('0x15e'),_0x278af1[_0x5a96('0x36')]));if(!this[_0x5a96('0x86')](_0x278af1['findBy'])){return this[_0x5a96('0xc')][_0x5a96('0x2a')](_0x278af1,_0x5a96('0x15f'));}logger['info'](util[_0x5a96('0x27')](_0x5a96('0x160'),this['channel'][_0x5a96('0x4f')],_0x278af1[_0x5a96('0x161')]));var _0x32f73d=this[_0x5a96('0x55')][_0x5a96('0x70')](this,_0x278af1[_0x5a96('0x161')]);if(_0x32f73d){logger[_0x5a96('0x2c')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x5a96('0xc')][_0x5a96('0x4f')],_0x278af1['findBy']));this[_0x5a96('0xc')][_0x5a96('0xaa')](util[_0x5a96('0x27')](_0x5a96('0x162'),this[_0x5a96('0xc')][_0x5a96('0x4f')],_0x278af1[_0x5a96('0x161')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x5a96('0x27')](_0x5a96('0x163'),this[_0x5a96('0xc')][_0x5a96('0x4f')],_0x278af1['findBy']));this['channel'][_0x5a96('0xaa')](util[_0x5a96('0x27')](_0x5a96('0x163'),this[_0x5a96('0xc')][_0x5a96('0x4f')],_0x278af1[_0x5a96('0x161')]));return{'code':0xc8,'result':_0x5a96('0x164')};}};AGIVertices['prototype'][_0x5a96('0x165')]=function(_0x3c9968){logger[_0x5a96('0x2c')](util['format'](_0x5a96('0x166'),_0x3c9968[_0x5a96('0x36')]));if(!this[_0x5a96('0x86')](_0x3c9968[_0x5a96('0x161')])){return this[_0x5a96('0xc')][_0x5a96('0x2a')](_0x3c9968,'no\x20find\x20by\x20configured');}logger[_0x5a96('0x2c')](util['format'](_0x5a96('0x160'),this['channel'][_0x5a96('0x4f')],_0x3c9968[_0x5a96('0x161')]));var _0x5eb7fa=this[_0x5a96('0x52')][_0x5a96('0x70')](this,_0x3c9968[_0x5a96('0x161')]);if(_0x5eb7fa){logger['info'](util[_0x5a96('0x27')](_0x5a96('0x162'),this[_0x5a96('0xc')][_0x5a96('0x4f')],_0x3c9968[_0x5a96('0x161')]));this[_0x5a96('0xc')]['noop'](util[_0x5a96('0x27')](_0x5a96('0x162'),this[_0x5a96('0xc')][_0x5a96('0x4f')],_0x3c9968[_0x5a96('0x161')]));return{'code':0xc8,'result':'success'};}else{logger[_0x5a96('0x2c')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x5a96('0xc')]['callerid'],_0x3c9968[_0x5a96('0x161')]));this['channel'][_0x5a96('0xaa')](util[_0x5a96('0x27')](_0x5a96('0x163'),this[_0x5a96('0xc')][_0x5a96('0x4f')],_0x3c9968[_0x5a96('0x161')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x5a96('0xe')]['math']=function(_0x2f208c){logger[_0x5a96('0x2c')](util[_0x5a96('0x27')](_0x5a96('0x167'),_0x2f208c[_0x5a96('0x36')]));if(!this['isConfigured'](_0x2f208c[_0x5a96('0x168')])){return this['channel'][_0x5a96('0x2a')](_0x2f208c,'no\x20operation\x20configured');}this['channel'][_0x5a96('0xaa')](util[_0x5a96('0x27')](_0x5a96('0x169'),_0x2f208c[_0x5a96('0x168')]));var _0x60a05f=eval(_0x2f208c['operation']);if(!this[_0x5a96('0x86')](_0x2f208c[_0x5a96('0xdc')])){return this[_0x5a96('0xc')]['noop'](_0x5a96('0xdb'));}var _0xa0d438=this[_0x5a96('0xf')][_0x5a96('0x70')](this,_0x2f208c[_0x5a96('0xdc')]);if(!_0xa0d438){return this[_0x5a96('0xc')][_0x5a96('0x2a')](_0x2f208c,_0x5a96('0x11c'));}if(_[_0x5a96('0x9c')](_0x60a05f)){var _0x3efeab=this;_0x60a05f[_0x5a96('0xde')](function(_0x2b41a1,_0x4611e6){_0x3efeab[_0x5a96('0xc')][_0x5a96('0xa0')](util['format'](_0x5a96('0x16a'),_0xa0d438,_0x4611e6),_0x2b41a1);});return this[_0x5a96('0xc')]['noop'](util[_0x5a96('0x27')]('variable\x20%s[key]\x20set',_0xa0d438));}else{return this[_0x5a96('0xc')]['setVariable'](_0xa0d438,_0x60a05f);}};AGIVertices[_0x5a96('0xe')][_0x5a96('0x9')]=function(_0xfc96d1){logger[_0x5a96('0x2c')](util['format']('Enter\x20in\x20MENU\x20(%s)\x20block',_0xfc96d1['label']));if(_0xfc96d1['retry']===0x0){return this['maxRetry'](_0xfc96d1);}_0xfc96d1[_0x5a96('0x115')]-=0x1;if(!this[_0x5a96('0x86')](_0xfc96d1[_0x5a96('0x116')])){return this[_0x5a96('0xc')][_0x5a96('0x2a')](_0xfc96d1,_0x5a96('0x117'));}var _0x49e925=this[_0x5a96('0x1d')]['sync'](this,_0xfc96d1[_0x5a96('0x116')]);if(!_0x49e925){return this[_0x5a96('0xc')]['error'](_0xfc96d1,_0x5a96('0x16b'));}var _0x1ece35=this[_0x5a96('0xc')][_0x5a96('0x118')](_0x49e925,_0xfc96d1[_0x5a96('0x119')],_0xfc96d1['digit']);var _0x1c6060=_0x1ece35[_0x5a96('0xa4')];if(_0x1ece35[_0x5a96('0xa4')]===-0x1){this['createSquareDetailsReport'][_0x5a96('0x70')](this,_0xfc96d1,'-1');return _0x1ece35;}else if(_0x1ece35[_0x5a96('0xa6')]===_0x5a96('0x66')){_0x1ece35[_0x5a96('0xa4')]=_0x1ece35['result'][_0x5a96('0x9e')]>0x0?_0x1ece35[_0x5a96('0xa4')]:'t';}else if(_[_0x5a96('0x41')](_0x1ece35['result'])){_0x1ece35['result']='#';_0x1c6060='#';}if(!this[_0x5a96('0x86')](_0xfc96d1[_0x5a96('0xdc')])){this[_0x5a96('0xc')][_0x5a96('0xaa')](_0x5a96('0xdb'));}else{var _0x17d6a1=this['getVariable'][_0x5a96('0x70')](this,_0xfc96d1[_0x5a96('0xdc')]);if(!_0x17d6a1){return this[_0x5a96('0xc')][_0x5a96('0x2a')](_0xfc96d1,_0x5a96('0x11c'));}this[_0x5a96('0xc')][_0x5a96('0xa0')](_0x17d6a1,_0x1c6060);}this[_0x5a96('0xda')][_0x5a96('0x70')](this,_0xfc96d1,_0x1c6060);return _0x1ece35;};AGIVertices[_0x5a96('0xe')][_0x5a96('0xaa')]=function(_0x12c731){logger[_0x5a96('0x2c')](util[_0x5a96('0x27')](_0x5a96('0x16c'),_0x12c731[_0x5a96('0x36')]));return this[_0x5a96('0xc')][_0x5a96('0xaa')](_0x12c731[_0x5a96('0x16d')]||_0x12c731['label']);};AGIVertices[_0x5a96('0xe')]['pause']=function(_0x4799db){logger[_0x5a96('0x2c')](util[_0x5a96('0x27')](_0x5a96('0x16e'),_0x4799db[_0x5a96('0x36')]));if(!this[_0x5a96('0x86')](_0x4799db[_0x5a96('0x161')])){return this[_0x5a96('0xc')][_0x5a96('0x2a')](_0x4799db,_0x5a96('0x15f'));}logger[_0x5a96('0x2c')](util[_0x5a96('0x27')](_0x5a96('0x160'),this[_0x5a96('0xc')][_0x5a96('0x4f')],_0x4799db[_0x5a96('0x161')]));var _0x4ec6d3=this[_0x5a96('0x4c')]['sync'](this,_0x4799db['pause_id']);var _0x35662e=this[_0x5a96('0x50')]['sync'](this,_0x4799db[_0x5a96('0x161')],_0x4ec6d3);if(_0x35662e){logger['info'](util[_0x5a96('0x27')](_0x5a96('0x162'),this[_0x5a96('0xc')]['callerid'],_0x4799db['findBy']));this['channel'][_0x5a96('0xaa')](util[_0x5a96('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x5a96('0xc')][_0x5a96('0x4f')],_0x4799db[_0x5a96('0x161')]));return{'code':0xc8,'result':_0x5a96('0x16f')};}else{logger[_0x5a96('0x2c')](util['format'](_0x5a96('0x163'),this[_0x5a96('0xc')][_0x5a96('0x4f')],_0x4799db[_0x5a96('0x161')]));this[_0x5a96('0xc')][_0x5a96('0xaa')](util[_0x5a96('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x5a96('0xc')][_0x5a96('0x4f')],_0x4799db['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x5a96('0xe')][_0x5a96('0x170')]=function(_0x29341a){logger['info'](util[_0x5a96('0x27')](_0x5a96('0x171'),_0x29341a[_0x5a96('0x36')]));if(!this[_0x5a96('0x86')](_0x29341a[_0x5a96('0x116')])){return this[_0x5a96('0xc')]['error'](_0x29341a,'no\x20file\x20audio\x20selected');}var _0x467f93=this[_0x5a96('0x1d')][_0x5a96('0x70')](this,_0x29341a[_0x5a96('0x116')]);if(!_0x467f93){return this[_0x5a96('0xc')]['error'](_0x29341a,_0x5a96('0x16b'));}var _0x146c8f=this[_0x5a96('0xc')][_0x5a96('0x57')](_0x5a96('0x172'),[_0x467f93,_0x29341a['opts']]);if(_0x146c8f[_0x5a96('0xa4')]===-0x1){return _0x146c8f;}return this[_0x5a96('0xc')][_0x5a96('0xaa')](util[_0x5a96('0x27')](_0x5a96('0x173'),'PLAYBACK',_0x467f93));};AGIVertices[_0x5a96('0xe')][_0x5a96('0x174')]=function(_0x2348dc){logger['info'](util[_0x5a96('0x27')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x2348dc[_0x5a96('0x36')]));if(!this['isConfigured'](_0x2348dc[_0x5a96('0x175')])){return this[_0x5a96('0xc')]['error'](_0x2348dc,'no\x20queue\x20selected');}var _0x24c4cb='';var _0x42cc10=parseInt(_0x2348dc[_0x5a96('0x175')],0xa);if(isNaN(_0x42cc10)){_0x24c4cb=_0x2348dc[_0x5a96('0x175')];}else{_0x24c4cb=this[_0x5a96('0x14')]['sync'](this,_0x2348dc[_0x5a96('0x175')]);if(!_0x24c4cb){return this[_0x5a96('0xc')][_0x5a96('0x2a')](_0x2348dc,_0x5a96('0x176'));}}var _0x317336='';if(this[_0x5a96('0x86')](_0x2348dc[_0x5a96('0x116')])){var _0x1035ad=this[_0x5a96('0x1d')][_0x5a96('0x70')](this,_0x2348dc[_0x5a96('0x116')]);if(_0x1035ad){_0x317336=_0x1035ad;}}this[_0x5a96('0xda')]['sync'](this,_0x2348dc,_0x24c4cb);if(_0x2348dc[_0x5a96('0x112')][_0x5a96('0x177')]('x')<0x0){_0x2348dc[_0x5a96('0x112')]+='x';}if(_0x2348dc[_0x5a96('0x112')][_0x5a96('0x177')]('X')<0x0){_0x2348dc['opts']+='X';}this[_0x5a96('0xc')][_0x5a96('0xa0')]('XMCS-QUEUE',_0x24c4cb?_0x24c4cb[_0x5a96('0x178')]():'');var _0x232a6b=this[_0x5a96('0xc')]['exec'](_0x5a96('0x179'),[_0x24c4cb,_0x2348dc[_0x5a96('0x112')],_0x2348dc[_0x5a96('0x64')],_0x317336,_0x2348dc['timeout'],_0x2348dc[_0x5a96('0xb5')],_0x2348dc[_0x5a96('0x17a')],_0x2348dc['gosub'],'',_0x2348dc['position']]);if(_0x232a6b[_0x5a96('0xa4')]===-0x1){return _0x232a6b;}return this[_0x5a96('0xc')][_0x5a96('0xaa')](util[_0x5a96('0x27')]('Executed\x20command\x20%s\x20%s','QUEUE',_0x24c4cb));};AGIVertices[_0x5a96('0xe')]['record']=function(_0x24de6e){logger[_0x5a96('0x2c')](util[_0x5a96('0x27')](_0x5a96('0x17b'),_0x24de6e['label']));var _0x5b0e06=_0x24de6e[_0x5a96('0x17c')]||_0x5a96('0x159');var _0xa36b68=util[_0x5a96('0x27')]('%s_%s',this[_0x5a96('0xc')][_0x5a96('0x35')],rs[_0x5a96('0x11e')](0x5));var _0x463420=util[_0x5a96('0x27')](_0x5a96('0x17d'),FILES_PATH,_0xa36b68,_0x5b0e06);var _0x209072=util['format'](_0x5a96('0x136'),FILES_PATH,_0xa36b68);this[_0x5a96('0x38')]['sync'](this,_0x24de6e,_0xa36b68,_0x463420);this[_0x5a96('0xc')][_0x5a96('0xa0')](_0x5a96('0x17e'),_0xa36b68);logger[_0x5a96('0x2c')](_0x5a96('0x17f'),_0x209072,_0x5b0e06,_0x24de6e[_0x5a96('0x180')],_0x24de6e['timeout']);return this['channel'][_0x5a96('0x142')](_0x209072,_0x5b0e06,_0x24de6e[_0x5a96('0x180')],_0x24de6e[_0x5a96('0x66')],undefined,!![]);};AGIVertices[_0x5a96('0xe')][_0x5a96('0x181')]=function(_0x51c5c6){logger[_0x5a96('0x2c')](util[_0x5a96('0x27')](_0x5a96('0x182'),_0x51c5c6[_0x5a96('0x36')]));if(!this[_0x5a96('0x86')](_0x51c5c6[_0x5a96('0x64')])){return this[_0x5a96('0xc')][_0x5a96('0xaa')](_0x5a96('0x183'));}var _0x133563=this['restAPI'][_0x5a96('0x70')](this,_0x51c5c6);logger[_0x5a96('0x2c')](util[_0x5a96('0x27')]('Response:',util[_0x5a96('0x184')](_0x133563,{'showHidden':![],'depth':null})));if(!this[_0x5a96('0x86')](_0x51c5c6[_0x5a96('0xdc')])){return this[_0x5a96('0xc')][_0x5a96('0xaa')](_0x5a96('0x185'));}var _0x46c728=this[_0x5a96('0xf')][_0x5a96('0x70')](this,_0x51c5c6[_0x5a96('0xdc')]);if(!_0x46c728){return this['channel'][_0x5a96('0x2a')](_0x51c5c6,'no\x20variable\x20found');}this[_0x5a96('0xc')][_0x5a96('0xa0')](util[_0x5a96('0x27')](_0x5a96('0x186'),_0x46c728),_0x133563[_0x5a96('0x75')]?_0x133563[_0x5a96('0x75')]:_0x5a96('0x187'));this[_0x5a96('0xc')][_0x5a96('0xa0')](util['format'](_0x5a96('0x188'),_0x46c728),_0x133563[_0x5a96('0x76')]?_0x133563['statusMessage']:'OK');if(_0x133563[_0x5a96('0x6c')]){try{this[_0x5a96('0x9f')](_0x133563['body'],_0x46c728);}catch(_0x3bb70d){logger[_0x5a96('0x2a')](util[_0x5a96('0x27')](_0x5a96('0x189'),_0x46c728));}}return this[_0x5a96('0xc')][_0x5a96('0xaa')](util[_0x5a96('0x27')](_0x5a96('0xe1'),_0x46c728));};AGIVertices[_0x5a96('0xe')][_0x5a96('0x18a')]=function(_0x240b86){logger['info'](util['format'](_0x5a96('0x18b'),_0x240b86[_0x5a96('0x36')]));return this[_0x5a96('0xc')][_0x5a96('0x18c')](_0x240b86[_0x5a96('0x18d')][_0x5a96('0x58')](/\s+/g,''),_0x240b86['escape_digits']);};AGIVertices['prototype'][_0x5a96('0x18e')]=function(_0x54ca74){logger[_0x5a96('0x2c')](util[_0x5a96('0x27')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x54ca74[_0x5a96('0x36')]));return this['channel'][_0x5a96('0x18f')](_0x54ca74[_0x5a96('0x67')][_0x5a96('0x58')](/\s+/g,''),_0x54ca74[_0x5a96('0x180')]);};AGIVertices[_0x5a96('0xe')][_0x5a96('0x190')]=function(_0x42c80d){logger['info'](util[_0x5a96('0x27')](_0x5a96('0x191'),_0x42c80d[_0x5a96('0x36')]));return this[_0x5a96('0xc')][_0x5a96('0x192')](_0x42c80d[_0x5a96('0x5b')],_0x42c80d['escape_digits']);};AGIVertices['prototype']['sendMail']=function(_0x10827e){logger[_0x5a96('0x2c')](util[_0x5a96('0x27')](_0x5a96('0x193'),_0x10827e[_0x5a96('0x36')]));if(!this[_0x5a96('0x86')](_0x10827e[_0x5a96('0x194')])){return this['channel'][_0x5a96('0xaa')]('no\x20mail\x20account\x20configured');}var _0x5ed661=this[_0x5a96('0x20')]['sync'](this,_0x10827e[_0x5a96('0x194')]);if(!_0x5ed661||!_0x5ed661[_0x5a96('0x195')]){return this[_0x5a96('0xc')][_0x5a96('0x2a')](_0x10827e,'no\x20mail\x20account\x20found');}var _0x364c41={'from':util[_0x5a96('0x27')](_0x5a96('0x196'),_0x5ed661['name'],_0x5ed661[_0x5a96('0x197')]||_0x5ed661[_0x5a96('0x195')]['user']),'to':_0x10827e['to']||'','cc':_0x10827e['cc']||'','bcc':_0x10827e[_0x5a96('0x198')]||'','subject':_0x10827e['subject'],'html':_0x10827e[_0x5a96('0x5b')],'text':_0x10827e['text']};var _0x4fe4fb={'tls':{'rejectUnauthorized':![]}};if(_0x5ed661[_0x5a96('0x195')][_0x5a96('0x199')]){_0x4fe4fb[_0x5a96('0x199')]=_0x5ed661['Smtp'][_0x5a96('0x199')];}else{_0x4fe4fb[_0x5a96('0x19a')]=_0x5ed661[_0x5a96('0x195')][_0x5a96('0x19a')];_0x4fe4fb[_0x5a96('0x19b')]=_0x5ed661[_0x5a96('0x195')][_0x5a96('0x19b')];_0x4fe4fb[_0x5a96('0x19c')]=_0x5ed661[_0x5a96('0x195')]['secure'];}if(_0x5ed661['Smtp'][_0x5a96('0x19d')]){_0x4fe4fb[_0x5a96('0x19e')]={'user':_0x5ed661['Smtp']['user'],'pass':_0x5ed661[_0x5a96('0x195')][_0x5a96('0x19f')]};}if(this['isConfigured'](_0x10827e[_0x5a96('0x1a0')])){}logger['debug'](_0x5a96('0x1a1'),JSON[_0x5a96('0x73')](_0x364c41));this[_0x5a96('0xda')][_0x5a96('0x70')](this,_0x10827e,_0x10827e[_0x5a96('0x194')]);this[_0x5a96('0xc')][_0x5a96('0xaa')](util['format']('Trying\x20SendMail\x20with\x20account\x20%s',_0x5ed661[_0x5a96('0x12')]));this['sendMailMessage'][_0x5a96('0x70')](this,_0x4fe4fb,_0x364c41);return this['channel']['noop']('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype'][_0x5a96('0x1a2')]=function(_0x946a79){logger['info'](util['format'](_0x5a96('0x1a3'),_0x946a79[_0x5a96('0x36')]));return this[_0x5a96('0xc')][_0x5a96('0xaa')](_0x5a96('0x1a4'));};AGIVertices[_0x5a96('0xe')]['sendSMS']=function(_0x183c2e){logger['info'](util[_0x5a96('0x27')](_0x5a96('0x1a5'),_0x183c2e[_0x5a96('0x36')]));if(!this[_0x5a96('0x86')](_0x183c2e[_0x5a96('0x1a6')])){return this[_0x5a96('0xc')][_0x5a96('0xaa')](_0x5a96('0x1a7'));}var _0x39a7c6=this['getSmsAccount'][_0x5a96('0x70')](this,_0x183c2e['sms_account_id']);if(!_0x39a7c6){return this[_0x5a96('0xc')][_0x5a96('0x2a')](_0x183c2e,_0x5a96('0x1a8'));}var _0x43cf9d={'body':_0x183c2e[_0x5a96('0x1a9')],'phone':_0x183c2e['to']||'','SmsAccountId':_0x39a7c6['id']};logger[_0x5a96('0xe3')]('sendSMS\x20message',JSON['stringify'](_0x43cf9d));this[_0x5a96('0xda')][_0x5a96('0x70')](this,_0x183c2e,_0x183c2e[_0x5a96('0x1a6')]);this[_0x5a96('0xc')]['noop'](util[_0x5a96('0x27')](_0x5a96('0x1aa'),_0x39a7c6['name']));this[_0x5a96('0x34')][_0x5a96('0x70')](this,_0x43cf9d);return this[_0x5a96('0xc')][_0x5a96('0xaa')](_0x5a96('0x1ab'));};AGIVertices[_0x5a96('0xe')][_0x5a96('0x1ac')]=function(_0x5ae973){logger['info'](util[_0x5a96('0x27')](_0x5a96('0x1ad'),_0x5ae973[_0x5a96('0x36')]));if(!this[_0x5a96('0x86')](_0x5ae973[_0x5a96('0xdc')])){return this['channel'][_0x5a96('0x2a')](_0x5ae973,_0x5a96('0x1ae'));}var _0x4eff28=this[_0x5a96('0xf')][_0x5a96('0x70')](this,_0x5ae973[_0x5a96('0xdc')]);if(!_0x4eff28){return this['channel'][_0x5a96('0x2a')](_0x5ae973,_0x5a96('0x11c'));}return this[_0x5a96('0xc')][_0x5a96('0xa0')](_0x4eff28,_0x5ae973[_0x5a96('0x1af')]);};AGIVertices['prototype']['start']=function(_0x330d93){logger['info'](util[_0x5a96('0x27')](_0x5a96('0x1b0'),_0x330d93[_0x5a96('0x36')]));this[_0x5a96('0xc')]['noop'](_0x5a96('0x1b1'));if(_0x330d93['answer']==='yes'){this[_0x5a96('0xc')]['noop'](_0x5a96('0x1b2'));return this[_0x5a96('0xc')][_0x5a96('0xbb')]();}return this[_0x5a96('0xc')][_0x5a96('0xaa')](_0x5a96('0x1b3'));};AGIVertices[_0x5a96('0xe')][_0x5a96('0x1b4')]=function(_0x514030){logger[_0x5a96('0x2c')](util['format']('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x514030[_0x5a96('0x36')]));if(!this['isConfigured'](_0x514030[_0x5a96('0x1b5')])){return this['channel'][_0x5a96('0x2a')](_0x514030,_0x5a96('0x1b6'));}var _0x279fbf=this['getSquareProject']['sync'](this,_0x514030[_0x5a96('0x1b5')]);if(!this['isConfigured'](_0x279fbf)){return this[_0x5a96('0xc')][_0x5a96('0x2a')](_0x514030,util[_0x5a96('0x27')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x514030[_0x5a96('0x1b5')]));}if(_0x279fbf===this[_0x5a96('0xc')][_0x5a96('0x3d')]){return this[_0x5a96('0xc')]['error'](_0x514030,_0x5a96('0x1b7'));}this['createSquareDetailsReport'][_0x5a96('0x70')](this,_0x514030,_0x279fbf);var _0x417348=this[_0x5a96('0xc')][_0x5a96('0x57')]('AGI',util[_0x5a96('0x27')](_0x5a96('0x1b8'),config[_0x5a96('0xb5')][_0x5a96('0x19a')]||_0x5a96('0x1b9'),_0x279fbf,this[_0x5a96('0xc')][_0x5a96('0x3d')]));if(_0x417348[_0x5a96('0xa4')]===-0x1){return _0x417348;}return this[_0x5a96('0xc')]['noop'](util[_0x5a96('0x27')](_0x5a96('0x173'),_0x5a96('0x1ba'),_0x279fbf));};AGIVertices[_0x5a96('0xe')]['system']=function(_0x3a95d8){logger[_0x5a96('0x2c')](util['format'](_0x5a96('0x1bb'),_0x3a95d8['label']));var _0x451177=this[_0x5a96('0x56')][_0x5a96('0x70')](this,_0x3a95d8[_0x5a96('0xb6')]);this['createSquareDetailsReport'][_0x5a96('0x70')](this,_0x3a95d8,_0x3a95d8['command']);if(this[_0x5a96('0x86')](_0x3a95d8['variable_id'])){var _0x58ecb2=this[_0x5a96('0xf')][_0x5a96('0x70')](this,_0x3a95d8['variable_id']);if(_0x58ecb2){this['channel']['setVariable'](_0x58ecb2,_0x451177);return this['channel']['noop'](util[_0x5a96('0x27')](_0x5a96('0x1bc'),_0x3a95d8[_0x5a96('0xb6')],_0x58ecb2));}}return this['channel'][_0x5a96('0xaa')](util[_0x5a96('0x27')](_0x5a96('0x1bd'),_0x3a95d8[_0x5a96('0xb6')]));};AGIVertices['prototype'][_0x5a96('0x1be')]=function(_0x1b62c3){logger[_0x5a96('0x2c')](util[_0x5a96('0x27')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x1b62c3[_0x5a96('0x36')]));_0x1b62c3[_0x5a96('0x5b')]=_0x1b62c3[_0x5a96('0x5b')][_0x5a96('0x58')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x5a96('0x86')](_0x1b62c3[_0x5a96('0x1bf')])){return this[_0x5a96('0xc')]['noop']('no\x20apiKey\x20configured');}if(!this[_0x5a96('0x86')](_0x1b62c3['text'])){return this[_0x5a96('0xc')][_0x5a96('0xaa')]('no\x20text\x20configured');}this[_0x5a96('0xc')][_0x5a96('0xaa')](util[_0x5a96('0x27')](_0x5a96('0x1c0'),_0x1b62c3[_0x5a96('0x5b')]));var _0x13c295=this['googleCloudTTS'][_0x5a96('0x70')](this,_0x1b62c3);if(_0x13c295){this[_0x5a96('0xc')]['noop'](util[_0x5a96('0x27')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x13c295));var _0x140e57=this[_0x5a96('0xc')]['streamFile'](_0x13c295);try{fs['unlink'](_0x13c295+'.wav');}catch(_0xb4b66e){logger[_0x5a96('0x2a')](_0xb4b66e);}return _0x140e57;}return this[_0x5a96('0xc')]['error'](_0x1b62c3,_0x5a96('0x1c1'));};AGIVertices[_0x5a96('0xe')][_0x5a96('0x1c2')]=function(_0x4fed84){logger[_0x5a96('0x2c')](util[_0x5a96('0x27')](_0x5a96('0x1c3'),_0x4fed84[_0x5a96('0x36')]));_0x4fed84[_0x5a96('0x5b')]=_0x4fed84[_0x5a96('0x5b')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x5a96('0x86')](_0x4fed84[_0x5a96('0x5b')])){return this[_0x5a96('0xc')][_0x5a96('0xaa')](_0x5a96('0xc5'));}this[_0x5a96('0xc')][_0x5a96('0xaa')](util[_0x5a96('0x27')](_0x5a96('0x1c4'),_0x4fed84[_0x5a96('0x5b')]));var _0x461ff6=this[_0x5a96('0x61')]['sync'](this,_0x4fed84);if(_0x461ff6){this['channel'][_0x5a96('0xaa')](util['format'](_0x5a96('0x1c5'),_0x461ff6));var _0x56b819=this[_0x5a96('0xc')][_0x5a96('0x106')](_0x461ff6);try{fs[_0x5a96('0x1c6')](_0x461ff6+_0x5a96('0x107'));}catch(_0x412d3c){logger[_0x5a96('0x2a')](_0x412d3c);}return _0x56b819;}return this['channel'][_0x5a96('0x2a')](_0x4fed84,_0x5a96('0x1c7'));};AGIVertices[_0x5a96('0xe')][_0x5a96('0x1c8')]=function(_0x515240){logger[_0x5a96('0x2c')](util[_0x5a96('0x27')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x515240[_0x5a96('0x36')]));if(!this[_0x5a96('0x86')](_0x515240[_0x5a96('0x161')])){return this[_0x5a96('0xc')]['error'](_0x515240,_0x5a96('0x15f'));}logger[_0x5a96('0x2c')](util['format'](_0x5a96('0x160'),this[_0x5a96('0xc')][_0x5a96('0x4f')],_0x515240['findBy']));var _0x1bc8df=this[_0x5a96('0x51')][_0x5a96('0x70')](this,_0x515240[_0x5a96('0x161')]);if(_0x1bc8df){logger[_0x5a96('0x2c')](util[_0x5a96('0x27')](_0x5a96('0x162'),this['channel'][_0x5a96('0x4f')],_0x515240[_0x5a96('0x161')]));this[_0x5a96('0xc')][_0x5a96('0xaa')](util[_0x5a96('0x27')](_0x5a96('0x162'),this[_0x5a96('0xc')][_0x5a96('0x4f')],_0x515240[_0x5a96('0x161')]));return{'code':0xc8,'result':'success'};}else{logger[_0x5a96('0x2c')](util[_0x5a96('0x27')](_0x5a96('0x163'),this[_0x5a96('0xc')][_0x5a96('0x4f')],_0x515240[_0x5a96('0x161')]));this[_0x5a96('0xc')][_0x5a96('0xaa')](util['format'](_0x5a96('0x163'),this['channel'][_0x5a96('0x4f')],_0x515240[_0x5a96('0x161')]));return{'code':0xc8,'result':_0x5a96('0x164')};}};AGIVertices[_0x5a96('0xe')][_0x5a96('0x1c9')]=function(_0x23b3b1){logger['info'](util[_0x5a96('0x27')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x23b3b1[_0x5a96('0x36')]));var _0x5bdffd=this[_0x5a96('0xc')][_0x5a96('0x57')](_0x5a96('0x1ca'),[_0x23b3b1[_0x5a96('0x1cb')],_0x23b3b1[_0x5a96('0x79')]]);if(_0x5bdffd[_0x5a96('0xa4')]===-0x1){return _0x5bdffd;}return this['channel'][_0x5a96('0xaa')](util['format']('Executed\x20command\x20%s\x20%s','VOICEMAIL',_0x23b3b1[_0x5a96('0x1cb')]));};AGIVertices[_0x5a96('0xe')]['vswitch']=function(_0x454a3f){logger[_0x5a96('0x2c')](util[_0x5a96('0x27')](_0x5a96('0x1cc'),_0x454a3f[_0x5a96('0x36')]));if(!this[_0x5a96('0x86')](_0x454a3f[_0x5a96('0xdc')])){return this[_0x5a96('0xc')][_0x5a96('0x2a')](_0x454a3f,_0x5a96('0x1ae'));}var _0x574d93=this[_0x5a96('0xf')]['sync'](this,_0x454a3f[_0x5a96('0xdc')]);if(!_0x574d93){return this[_0x5a96('0xc')][_0x5a96('0x2a')](_0x454a3f,'no\x20variable\x20found');}var _0x122c81=this[_0x5a96('0xc')]['getVariable'](_0x574d93);return{'code':0xc8,'result':_0x122c81['extra']?_0x122c81['extra']:'-'};};String[_0x5a96('0xe')][_0x5a96('0xa2')]=function(_0x386b9e,_0x814dfe){return this[_0x5a96('0xa1')](_0x386b9e)[_0x5a96('0x1cd')](_0x814dfe);};module[_0x5a96('0x1ce')]=AGIVertices; \ No newline at end of file +var _0x8aac=['FIND\x20AGENT\x20%s\x20BY\x20%s','failure','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','position','QUEUE','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','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','digits','saynumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','account_id','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','Smtp','user','subject','service','host','port','secure','auth','pass','template_id','sendMail\x20message','Mail\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','getSquareProject','project_id','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','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','apiKey','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','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','agentUnpause','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','exports','path','util','lodash','shelljs','randomstring','moment','request-promise','../../config/logger','agi','../../config/environment','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','mailRpc','prototype','getVariable','rpc','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','save_name','getMailAccount','getMailAccountById','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','dnid','file','createSquareMessage','createCmContact','isEmpty','callback_','lastName','list_id','scheduledAt','toString','callback_priority','agentPause','agent','isNil','error','agentLogout','agentLogin','%s/%s@from-sip/n','shellCommand','exec','trim','googleCloudTTS','google_cloud_tts_text_type','text','languageCode','en-US','MALE','MP3','googleTTS','google_tts_language','restAPI','url','method','number','timeout','includes','POST','PUT','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','computedVariables','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','ispeechASR','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','agicommand','clone','hasOwnProperty','isString','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','split','replaceAll','extra','getAndSetVariable','setVariable','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','result','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','no\x20grammar\x20configured','grammar','MRCPRecog','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Enter\x20in\x20AGI\x20(%s)\x20block','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','callback','no\x20list\x20selected','delay','add','minutes','phone','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','MRCPSynth','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','Executed\x20command\x20MRCPRecog\x20%s','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','sync','replace','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','no\x20variable\x20found','forEach','keys','%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','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','dialogflowV2_project_id','no\x20project_id\x20configured','client_email','no\x20client_email\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','no\x20password\x20configured','Trying\x20SestekNDA:\x20%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','unlink','.wav','SestekNDA\x20Result\x20%s','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','SIP/%s/%s','finally','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','mindigit','hiddendigitsnum','generate','hiddendigitspos','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','streamFile','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','amazonlex','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','NOBEEP','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','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','gotoiftime','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ispeech\x20TTS\x20is\x20unreachable','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block'];(function(_0xd6df5e,_0x4a4e46){var _0x155b12=function(_0x368fb6){while(--_0x368fb6){_0xd6df5e['push'](_0xd6df5e['shift']());}};_0x155b12(++_0x4a4e46);}(_0x8aac,0x6f));var _0xc8aa=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8aac[_0x3dd15e];return _0x231fd0;};'use strict';var fs=require('fs');var path=require(_0xc8aa('0x0'));var util=require(_0xc8aa('0x1'));var _=require(_0xc8aa('0x2'));var sh=require(_0xc8aa('0x3'));var odbc=require('odbc')();var rs=require(_0xc8aa('0x4'));var moment=require(_0xc8aa('0x5'));var Mustache=require('mustache');var rp=require(_0xc8aa('0x6'));var logger=require(_0xc8aa('0x7'))(_0xc8aa('0x8'));var config=require(_0xc8aa('0x9'));var scripts=require('./scripts');var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0xc8aa('0xa'),_0xc8aa('0xb')];var verticesWithRetry=[_0xc8aa('0xc'),_0xc8aa('0xd'),_0xc8aa('0xe')];var AGIVertices=function(_0x2a5719,_0x233fa4,_0x2b27d5){this[_0xc8aa('0xf')]=_0x2a5719;this['rpc']=_0x233fa4;this[_0xc8aa('0x10')]=_0x2b27d5;};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0x12')]=function(_0x54c949,_0x43b6ef){this[_0xc8aa('0x13')]['getVariableById'](_0x54c949)[_0xc8aa('0x14')](function(_0x242420){_0x43b6ef(null,_0x242420?_0x242420[_0xc8aa('0x15')]:![]);})[_0xc8aa('0x16')](function(_0x5f239c){_0x43b6ef(_0x5f239c);});};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0x17')]=function(_0x596c3f,_0x1affa0){this[_0xc8aa('0x13')][_0xc8aa('0x18')](_0x596c3f)[_0xc8aa('0x14')](function(_0x598660){_0x1affa0(null,_0x598660?_0x598660['name']:![]);})[_0xc8aa('0x16')](function(_0x4e4a47){_0x1affa0(_0x4e4a47);});};AGIVertices['prototype']['getSquareProject']=function(_0x55ec78,_0x39bb16){this[_0xc8aa('0x13')][_0xc8aa('0x19')](_0x55ec78)['then'](function(_0x70e800){_0x39bb16(null,_0x70e800?_0x70e800[_0xc8aa('0x15')]:![]);})[_0xc8aa('0x16')](function(_0x4a5855){_0x39bb16(_0x4a5855);});};AGIVertices['prototype'][_0xc8aa('0x1a')]=function(_0x17288d,_0x3416b6){this['rpc'][_0xc8aa('0x1b')](_0x17288d)['then'](function(_0x1dbaa1){_0x3416b6(null,_0x1dbaa1?_0x1dbaa1[_0xc8aa('0x1c')]:![]);})[_0xc8aa('0x16')](function(_0x25bdee){_0x3416b6(_0x25bdee);});};AGIVertices['prototype'][_0xc8aa('0x1d')]=function(_0x24148d,_0xc25e7){this[_0xc8aa('0x13')][_0xc8aa('0x1e')](_0x24148d)[_0xc8aa('0x14')](function(_0x5ba81d){_0xc25e7(null,_0x5ba81d?_0x5ba81d[_0xc8aa('0x15')]:![]);})[_0xc8aa('0x16')](function(_0x68797c){_0xc25e7(_0x68797c);});};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0x1f')]=function(_0xc0379e,_0x2cbdcc){this[_0xc8aa('0x13')][_0xc8aa('0x20')](_0xc0379e)['then'](function(_0x17881b){_0x2cbdcc(null,_0x17881b?_0x17881b[_0xc8aa('0x15')]:![]);})[_0xc8aa('0x16')](function(_0x5bcfb8){_0x2cbdcc(_0x5bcfb8);});};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0x21')]=function(_0x40eecd,_0x2d1c56){var _0x44a5e1=this;this[_0xc8aa('0x13')][_0xc8aa('0x22')](_0x40eecd)['then'](function(_0x1d7371){_0x2d1c56(null,_0x1d7371?_0x44a5e1['getSoundPath'](_0x1d7371[_0xc8aa('0x23')]):![]);})[_0xc8aa('0x16')](function(_0x199886){_0x2d1c56(_0x199886);});};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0x24')]=function(_0x26b8bf,_0xac997f){this[_0xc8aa('0x13')][_0xc8aa('0x25')](_0x26b8bf)[_0xc8aa('0x14')](function(_0x214005){_0xac997f(null,_0x214005?_0x214005:![]);})[_0xc8aa('0x16')](function(_0x1fc1f6){_0xac997f(_0x1fc1f6);});};AGIVertices['prototype']['sendMailMessage']=function(_0x327a11,_0x8056ef,_0x2bb3ba){this[_0xc8aa('0x10')]['sendMailMessage'](_0x327a11,_0x8056ef)[_0xc8aa('0x14')](function(){_0x2bb3ba(null);})[_0xc8aa('0x16')](function(_0x255e44){_0x2bb3ba(_0x255e44);});};AGIVertices['prototype'][_0xc8aa('0x26')]=function(_0x38d708,_0x221382){this[_0xc8aa('0x13')][_0xc8aa('0x27')](_0x38d708)[_0xc8aa('0x14')](function(_0x13dd5f){if(_0x13dd5f){if(_0x13dd5f[_0xc8aa('0x28')]){_0x221382(null,[_0x13dd5f[_0xc8aa('0x29')]]);}else{_0x221382(null,_[_0xc8aa('0x2a')](_0x13dd5f[_0xc8aa('0x2b')],_0xc8aa('0x29')));}}else{_0x221382(null,![]);}})['catch'](function(_0x263675){_0x221382(_0x263675);});};AGIVertices[_0xc8aa('0x11')]['getSoundPath']=function(_0x34ce01){return util[_0xc8aa('0x2c')](_0xc8aa('0x2d'),FILES_PATH,_0x34ce01);};AGIVertices['prototype'][_0xc8aa('0x2e')]=function(_0x3cce67,_0x29dd1f,_0x101fd3){odbc[_0xc8aa('0x2f')](_0x3cce67,function(_0x24df76){if(_0x24df76){logger['error'](_0xc8aa('0x30'),_0x24df76);_0x101fd3(_0x24df76);}else{logger[_0xc8aa('0x31')](_0xc8aa('0x32'));odbc[_0xc8aa('0x33')](_0x29dd1f,function(_0x1030e5,_0x3c430b){if(_0x1030e5){logger[_0xc8aa('0x31')](_0xc8aa('0x34'),_0x29dd1f);_0x101fd3(_0x1030e5);}else{logger[_0xc8aa('0x31')](_0xc8aa('0x35'),_0x29dd1f);odbc[_0xc8aa('0x36')](function(_0x1d14a9){if(_0x1d14a9){logger['error'](_0xc8aa('0x37'),_0x1d14a9);}_0x101fd3(null,_0x3c430b);});}});}});};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0x38')]=function(_0x40cb50,_0x1b04f7){this[_0xc8aa('0x13')][_0xc8aa('0x39')](_0x40cb50)[_0xc8aa('0x14')](function(_0x568c33){_0x1b04f7(null,_0x568c33?_0x568c33:![]);})['catch'](function(_0x2dbaab){_0x1b04f7(_0x2dbaab);});};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0x3a')]=function(_0x10d149,_0x43016c){this[_0xc8aa('0x13')]['createSmsMessage'](_0x10d149)[_0xc8aa('0x14')](function(_0x3ba39a){_0x43016c(null,_0x3ba39a);})[_0xc8aa('0x16')](function(_0x3a33ca){_0x43016c(_0x3a33ca);});};AGIVertices[_0xc8aa('0x11')]['createSquareDetailsReport']=function(_0x4bc438,_0x5acb5b,_0x28c40f){this[_0xc8aa('0x13')][_0xc8aa('0x3b')]({'uniqueid':this[_0xc8aa('0xf')][_0xc8aa('0x3c')],'node':_0x4bc438[_0xc8aa('0x3d')],'application':_0x4bc438['agicommand'],'data':_0x5acb5b||null,'project_name':this[_0xc8aa('0xf')][_0xc8aa('0x3e')],'callerid':this['channel'][_0xc8aa('0x3f')]})['then'](function(_0x1fa136){if(_0x28c40f){_0x28c40f(null,_0x1fa136);}})[_0xc8aa('0x16')](function(_0x635a01){if(_0x28c40f){_0x28c40f(_0x635a01);}});};AGIVertices['prototype'][_0xc8aa('0x40')]=function(_0x332e14,_0x29e9cd,_0x28950e,_0x154185){this[_0xc8aa('0x13')][_0xc8aa('0x40')]({'uniqueid':this[_0xc8aa('0xf')][_0xc8aa('0x3c')],'callerid':this[_0xc8aa('0xf')][_0xc8aa('0x3f')],'calleridname':this[_0xc8aa('0xf')][_0xc8aa('0x41')],'context':this[_0xc8aa('0xf')][_0xc8aa('0x42')],'extension':this[_0xc8aa('0xf')][_0xc8aa('0x43')],'priority':this[_0xc8aa('0xf')][_0xc8aa('0x44')],'accountcode':this[_0xc8aa('0xf')]['accountcode'],'dnid':this[_0xc8aa('0xf')][_0xc8aa('0x45')],'projectName':this['channel'][_0xc8aa('0x3e')],'saveName':_0x29e9cd,'filename':_0x332e14[_0xc8aa('0x46')]||_0x29e9cd,'savePath':_0x28950e})[_0xc8aa('0x14')](function(_0x340a6e){_0x154185(null,_0x340a6e);})[_0xc8aa('0x16')](function(_0x72aa8a){_0x154185(_0x72aa8a);});};AGIVertices['prototype'][_0xc8aa('0x47')]=function(_0x5ecf05,_0x569a4c,_0x359456,_0x194cdf,_0x2a1fce){this['rpc'][_0xc8aa('0x47')]({'uniqueid':this[_0xc8aa('0xf')][_0xc8aa('0x3c')],'body':_0x5ecf05,'direction':_0x569a4c,'providerName':_0x359456,'providerResponse':_0x194cdf})[_0xc8aa('0x14')](function(_0x3be49c){if(_0x2a1fce){_0x2a1fce(null,_0x3be49c);}})[_0xc8aa('0x16')](function(_0x416ab6){if(_0x2a1fce){_0x2a1fce(_0x416ab6);}});};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0x48')]=function(_0x50881c,_0x4b40b4){this[_0xc8aa('0x13')][_0xc8aa('0x48')]({'firstName':_[_0xc8aa('0x49')](_0x50881c[_0xc8aa('0x15')])||_['isNil'](_0x50881c['name'])?_0xc8aa('0x4a')+Math['random']():_0x50881c[_0xc8aa('0x15')],'lastName':_['isEmpty'](_0x50881c['lastName'])||_['isNil'](_0x50881c['lastName'])?null:_0x50881c[_0xc8aa('0x4b')],'phone':_0x50881c['phone'],'ListId':_0x50881c[_0xc8aa('0x4c')],'scheduledat':_0x50881c[_0xc8aa('0x4d')],'callbackUniqueid':this[_0xc8aa('0xf')][_0xc8aa('0x3c')],'tags':'callback','description':'Callback\x20scheduled\x20at\x20'+_0x50881c[_0xc8aa('0x4d')][_0xc8aa('0x4e')](),'priority':_0x50881c[_0xc8aa('0x4f')]})[_0xc8aa('0x14')](function(_0x5204a2){_0x4b40b4(null,_0x5204a2);})[_0xc8aa('0x16')](function(_0x1c152c){_0x4b40b4(_0x1c152c);});};AGIVertices[_0xc8aa('0x11')]['getPause']=function(_0x56c599,_0x35946e){this[_0xc8aa('0x13')]['getPauseById'](_0x56c599)[_0xc8aa('0x14')](function(_0x5072e7){_0x35946e(null,_0x5072e7?_0x5072e7[_0xc8aa('0x15')]:![]);})[_0xc8aa('0x16')](function(_0x526770){_0x35946e(_0x526770);});};AGIVertices['prototype'][_0xc8aa('0x50')]=function(_0x605b83,_0x2968a5,_0x82faad){var _0x25371e={'role':_0xc8aa('0x51')};_0x25371e[_0x605b83]=this['channel']['callerid'];this[_0xc8aa('0x13')][_0xc8aa('0x50')](_0x25371e,_0x2968a5,this[_0xc8aa('0xf')][_0xc8aa('0x3c')])[_0xc8aa('0x14')](function(_0x3d9681){_0x82faad(null,_[_0xc8aa('0x52')](_0x3d9681)?![]:!![]);})[_0xc8aa('0x16')](function(_0xe4eff9){logger['error'](_0xe4eff9);_0x82faad(null,![]);});};AGIVertices[_0xc8aa('0x11')]['agentUnpause']=function(_0x55da80,_0xe8bf5b){var _0x1eaf96={'role':_0xc8aa('0x51')};_0x1eaf96[_0x55da80]=this[_0xc8aa('0xf')][_0xc8aa('0x3f')];this[_0xc8aa('0x13')]['agentUnpause'](_0x1eaf96)[_0xc8aa('0x14')](function(_0x31c01c){_0xe8bf5b(null,_[_0xc8aa('0x52')](_0x31c01c)?![]:!![]);})[_0xc8aa('0x16')](function(_0x37ee82){logger[_0xc8aa('0x53')](_0x37ee82);_0xe8bf5b(null,![]);});};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0x54')]=function(_0x413853,_0x26c952){var _0x335dd7={'role':_0xc8aa('0x51')};_0x335dd7[_0x413853]=this[_0xc8aa('0xf')]['callerid'];this[_0xc8aa('0x13')][_0xc8aa('0x54')](_0x335dd7)['then'](function(_0x2884e8){_0x26c952(null,_[_0xc8aa('0x52')](_0x2884e8)?![]:!![]);})['catch'](function(_0x17bf2d){logger[_0xc8aa('0x53')](_0x17bf2d);_0x26c952(null,![]);});};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0x55')]=function(_0x2f1990,_0x2e1f30){var _0x47df39={'role':_0xc8aa('0x51')};_0x47df39[_0x2f1990]=this[_0xc8aa('0xf')]['callerid'];var _0x4d154c=_0x2f1990!='internal'?util['format'](_0xc8aa('0x56'),'LOCAL',this[_0xc8aa('0xf')][_0xc8aa('0x3f')]):undefined;this['rpc'][_0xc8aa('0x55')](_0x47df39,_0x4d154c)[_0xc8aa('0x14')](function(_0x2174d8){_0x2e1f30(null,_['isNil'](_0x2174d8)?![]:!![]);})[_0xc8aa('0x16')](function(_0x4aa62b){logger['error'](_0x4aa62b);_0x2e1f30(null,![]);});};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0x57')]=function(_0x456b64,_0x58b07){sh[_0xc8aa('0x58')](_[_0xc8aa('0x59')](_0x456b64),function(_0x17b9fd,_0x469bd1){var _0x156b01=_0x469bd1['replace'](/(\r\n|\n|\r)/gm,'');_0x58b07(null,_0x156b01);});};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0x5a')]=function(_0x1624e3,_0x5d178c){scripts[_0xc8aa('0x5a')](_0x1624e3['apiKey'],_0x1624e3[_0xc8aa('0x5b')]||'text',_0x1624e3[_0xc8aa('0x5c')],_0x1624e3[_0xc8aa('0x5d')]||_0xc8aa('0x5e'),_0x1624e3['ssmlGender']||_0xc8aa('0x5f'),_0x1624e3['audioEncoding']||_0xc8aa('0x60'))[_0xc8aa('0x14')](function(_0x1aa756){_0x5d178c(null,_0x1aa756);})[_0xc8aa('0x16')](function(_0x5d7feb){_0x5d178c(_0x5d7feb);});};AGIVertices['prototype'][_0xc8aa('0x61')]=function(_0x1232a3,_0x1019e2){scripts[_0xc8aa('0x61')](_0x1232a3[_0xc8aa('0x5c')],_0x1232a3[_0xc8aa('0x62')]||'en',0x1)[_0xc8aa('0x14')](function(_0x17921e){_0x1019e2(null,_0x17921e);})['catch'](function(_0x1ae8c6){_0x1019e2(_0x1ae8c6);});};AGIVertices['prototype'][_0xc8aa('0x63')]=function(_0x5460ad,_0x534fdb){var _0xae9fdd={'uri':_0x5460ad[_0xc8aa('0x64')],'method':_0x5460ad[_0xc8aa('0x65')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x5460ad['timeout'])===_0xc8aa('0x66')&&parseInt(_0x5460ad[_0xc8aa('0x67')])>=0x1?parseInt(_0x5460ad[_0xc8aa('0x67')])*0x3e8:0x5*0x3e8};if(_[_0xc8aa('0x68')]([_0xc8aa('0x69'),_0xc8aa('0x6a')],_0xae9fdd[_0xc8aa('0x65')]['toUpperCase']())){try{_0xae9fdd[_0xc8aa('0x6b')]=_0x5460ad['rawBody']?JSON[_0xc8aa('0x6c')](_0x5460ad[_0xc8aa('0xb')]):{};}catch(_0x348c04){logger[_0xc8aa('0x53')](_0xc8aa('0x6d'),_0x348c04);}}try{_0xae9fdd[_0xc8aa('0x6e')]=_0x5460ad['rawHeaders']?JSON[_0xc8aa('0x6c')](_0x5460ad['rawHeaders']):{};}catch(_0x9c6b72){logger['error']('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x9c6b72);}if(_0x5460ad[_0xc8aa('0x6f')]){try{var _0x3e3a09=require(_0x5460ad[_0xc8aa('0x6f')])['sync'](this,_0xae9fdd);_0xae9fdd[_0xc8aa('0x70')]=Mustache[_0xc8aa('0x71')](_0x5460ad[_0xc8aa('0x64')],_0x3e3a09,{},['$$','$$']);if(_0xae9fdd[_0xc8aa('0x6e')]){_0xae9fdd['headers']=JSON[_0xc8aa('0x6c')](Mustache['render'](JSON['stringify'](_0xae9fdd[_0xc8aa('0x6e')]),_0x3e3a09,{},['$$','$$']));}if(_0xae9fdd[_0xc8aa('0x6b')]){_0xae9fdd[_0xc8aa('0x6b')]=JSON[_0xc8aa('0x6c')](Mustache[_0xc8aa('0x71')](JSON[_0xc8aa('0x72')](_0xae9fdd[_0xc8aa('0x6b')]),_0x3e3a09,{},['$$','$$']));}}catch(_0x343634){logger[_0xc8aa('0x53')](_0xc8aa('0x73'),_0x343634);}}rp(_0xae9fdd)[_0xc8aa('0x14')](function(_0x83182a){var _0x2ee807={'statusCode':_0x83182a[_0xc8aa('0x74')]||0xc8,'statusMessage':_0x83182a[_0xc8aa('0x75')]||'OK','headers':_0x83182a[_0xc8aa('0x6e')]||{},'body':_0x83182a['body']||{}};_0x534fdb(null,_0x2ee807);})[_0xc8aa('0x16')](function(_0xe11a3e){var _0x4a6a31={'statusCode':_0xe11a3e[_0xc8aa('0x74')]||0x1f4,'statusMessage':_0xe11a3e['message']||_0xc8aa('0x76'),'headers':_0xe11a3e[_0xc8aa('0x77')][_0xc8aa('0x6e')]||{},'body':_0xe11a3e['options'][_0xc8aa('0x6b')]||{}};_0x534fdb(null,_0x4a6a31);});};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0x78')]=function(_0x2aded6,_0x41c65e){scripts['googleDialogflow'](this[_0xc8aa('0xf')]['uniqueid'],_0x2aded6[_0xc8aa('0x79')],_0x2aded6[_0xc8aa('0x5c')],_0x2aded6[_0xc8aa('0x7a')]||'en')[_0xc8aa('0x14')](function(_0x107a69){_0x41c65e(null,_0x107a69);})['catch'](function(_0x3ed54a){_0x41c65e(_0x3ed54a);});};AGIVertices['prototype'][_0xc8aa('0x7b')]=function(_0x27839e,_0x4906a5){scripts['googleDialogflowV2'](this[_0xc8aa('0xf')][_0xc8aa('0x3c')],_0x27839e['dialogflowV2_project_id'],_0x27839e['client_email'],_0x27839e[_0xc8aa('0x7c')],_0x27839e[_0xc8aa('0x5c')],_0x27839e[_0xc8aa('0x7d')]||'en')[_0xc8aa('0x14')](function(_0x5bda06){_0x4906a5(null,_0x5bda06);})[_0xc8aa('0x16')](function(_0x2b93ed){_0x4906a5(_0x2b93ed);});};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0x7e')]=function(_0x15ee03,_0x2448bd){scripts[_0xc8aa('0x7e')](this[_0xc8aa('0xf')],_0x15ee03)['then'](function(_0x3ad6bf){_0x2448bd(null,_0x3ad6bf);})[_0xc8aa('0x16')](function(_0x5338af){_0x2448bd(_0x5338af);});};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0x7f')]=function(_0x41fe02,_0x1822d4){scripts[_0xc8aa('0x7f')](_0x41fe02[_0xc8aa('0x79')],_0x41fe02[_0xc8aa('0x5c')],_0x41fe02[_0xc8aa('0x80')]||_0xc8aa('0x5e'),_0x41fe02['speed'])[_0xc8aa('0x14')](function(_0x54d52a){_0x1822d4(null,_0x54d52a);})[_0xc8aa('0x16')](function(_0x334083){_0x1822d4(_0x334083);});};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0x81')]=function(_0x3c544d,_0x1fd69c,_0x2484fc){scripts[_0xc8aa('0x81')](_0x1fd69c,_0x3c544d[_0xc8aa('0x79')],_0x3c544d['ispeech_asr_language']||_0xc8aa('0x5e'),this[_0xc8aa('0x82')](_0x3c544d[_0xc8aa('0x83')])?_0x3c544d['model']:undefined)[_0xc8aa('0x14')](function(_0x84a61){_0x2484fc(null,_0x84a61);})[_0xc8aa('0x16')](function(_0x2d68a2){_0x2484fc(_0x2d68a2);});};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0x84')]=function(_0x2cd107,_0x3b4aa9){scripts[_0xc8aa('0x84')](_0x2cd107[_0xc8aa('0x85')],_0x2cd107[_0xc8aa('0x86')],_0x2cd107[_0xc8aa('0x87')],_0x2cd107[_0xc8aa('0x88')]||_0xc8aa('0x89'),_0x2cd107[_0xc8aa('0x5c')],_0x2cd107['aws_text_type']||_0xc8aa('0x5c'))[_0xc8aa('0x14')](function(_0x37d272){_0x3b4aa9(null,_0x37d272);})['catch'](function(_0x341290){_0x3b4aa9(_0x341290);});};AGIVertices['prototype'][_0xc8aa('0x8a')]=function(_0x21a77a,_0x3a0586){scripts[_0xc8aa('0x8a')](this['channel'][_0xc8aa('0x3c')],_0x21a77a['aws_access_key_id'],_0x21a77a['aws_secret_access_key'],_0x21a77a[_0xc8aa('0x8b')],_0x21a77a[_0xc8aa('0x5c')],_0x21a77a[_0xc8aa('0x8c')])['then'](function(_0x7aa11c){_0x3a0586(null,_0x7aa11c);})[_0xc8aa('0x16')](function(_0x279af8){_0x3a0586(_0x279af8);});};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0x8d')]=function(_0x46d878,_0x465fec,_0x279903){scripts[_0xc8aa('0x8d')](_0x465fec,_0x46d878['key'],_0x46d878[_0xc8aa('0x8e')]||'en-US')[_0xc8aa('0x14')](function(_0x382682){_0x279903(null,_0x382682);})[_0xc8aa('0x16')](function(_0x1e5810){_0x279903(_0x1e5810);});};AGIVertices[_0xc8aa('0x11')]['tildeASR']=function(_0x5552f5,_0x2aef37,_0x372d31){scripts[_0xc8aa('0x8f')](_0x2aef37,_0x5552f5[_0xc8aa('0x90')],_0x5552f5[_0xc8aa('0x91')],_0x5552f5['uri'])['then'](function(_0x31c1f5){_0x372d31(null,_0x31c1f5);})[_0xc8aa('0x16')](function(_0x572830){_0x372d31(_0x572830);});};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0x92')]=function(_0x5c167a){var _0x522d85=_[_0xc8aa('0x68')](verticesWithRetry,_0x5c167a[_0xc8aa('0x93')])?_0x5c167a:_[_0xc8aa('0x94')](_0x5c167a);for(var _0xabbe70 in _0x522d85){if(_0x522d85[_0xc8aa('0x95')](_0xabbe70)){if(_0x522d85[_0xabbe70]&&_[_0xc8aa('0x96')](_0x522d85[_0xabbe70])){if(_[_0xc8aa('0x68')](recursiveMapAttributes,_0xabbe70)){_0x522d85[_0xabbe70]=this['replaceObjectAllVariables'](_0x522d85[_0xabbe70]);}else{_0x522d85[_0xabbe70]=this[_0xc8aa('0x97')](_0x522d85[_0xabbe70]);}}}}return _0x522d85;};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0x98')]=function(_0x905ec8){for(var _0x224681 in _0x905ec8){if(_0x905ec8['hasOwnProperty'](_0x224681)){if(_[_0xc8aa('0x99')](_0x905ec8[_0x224681])){this[_0xc8aa('0x98')](_0x905ec8[_0x224681]);}else if(_[_0xc8aa('0x9a')](_0x905ec8[_0x224681])){for(var _0x5cc007=0x0;_0x5cc007<_0x905ec8[_0x224681][_0xc8aa('0x9b')];_0x5cc007++){this[_0xc8aa('0x98')](_0x905ec8[_0x224681][_0x5cc007]);}}else if(_[_0xc8aa('0x96')](_0x905ec8[_0x224681])){_0x905ec8[_0x224681]=this[_0xc8aa('0x97')](_0x905ec8[_0x224681]);}}}};AGIVertices['prototype'][_0xc8aa('0x9c')]=function(_0x2cb010,_0x4d350a){for(var _0x4d93fd in _0x2cb010){if(_0x2cb010[_0xc8aa('0x95')](_0x4d93fd)){if(_[_0xc8aa('0x99')](_0x2cb010[_0x4d93fd])){if(!_['isEmpty'](_0x2cb010[_0x4d93fd])){this[_0xc8aa('0x9c')](_0x2cb010[_0x4d93fd],util[_0xc8aa('0x2c')](_0xc8aa('0x9d'),_0x4d350a,_0x4d93fd));}}else if(_['isArray'](_0x2cb010[_0x4d93fd])){for(var _0x3b715d=0x0;_0x3b715d<_0x2cb010[_0x4d93fd][_0xc8aa('0x9b')];_0x3b715d++){this[_0xc8aa('0x9c')](_0x2cb010[_0x4d93fd][_0x3b715d],util[_0xc8aa('0x2c')](_0xc8aa('0x9d'),_0x4d350a,_0x4d93fd+'['+_0x3b715d+']'));}}else{if(!_[_0xc8aa('0x52')](_0x2cb010[_0x4d93fd])){this[_0xc8aa('0xf')]['setVariable'](util['format']('%s.%s',_0x4d350a,_0x4d93fd),_0x2cb010[_0x4d93fd]);}}}}};AGIVertices[_0xc8aa('0x11')]['replaceObjectAllVariables']=function(_0x197e3a){try{var _0x49ab84=JSON['parse'](_0x197e3a);this['recursiveNodeIndex'](_0x49ab84);return JSON[_0xc8aa('0x72')](_0x49ab84);}catch(_0x1215b4){return this[_0xc8aa('0x97')](_0x197e3a);}};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0x97')]=function(_0x4bdb90){var _0x13339e=_0x4bdb90[_0xc8aa('0x9e')]('{');for(var _0x1ed9e7=0x1;_0x1ed9e7<_0x13339e[_0xc8aa('0x9b')];_0x1ed9e7+=0x1){var _0x3b33dd=_0x13339e[_0x1ed9e7][_0xc8aa('0x9e')]('}');if(_0x3b33dd[_0xc8aa('0x9b')]>0x1){_0x4bdb90=_0x4bdb90[_0xc8aa('0x9f')]('{'+_0x3b33dd[0x0]+'}',this[_0xc8aa('0xf')][_0xc8aa('0x12')](_0x3b33dd[0x0])[_0xc8aa('0xa0')]||_0x3b33dd[0x0]);}}if(_0x13339e[_0xc8aa('0x9b')]===0x1){return _0x4bdb90[_0xc8aa('0x4e')]();}return this[_0xc8aa('0x97')](_0x4bdb90);};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0xa1')]=function(_0x55cc26,_0x2cde58){var _0x126f0e=this[_0xc8aa('0xf')][_0xc8aa('0x12')](_0x55cc26);if(_0x126f0e['result']===-0x1){return _0x126f0e;}logger[_0xc8aa('0x31')](util['format']('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x2cde58,_0x126f0e['extra']));return this[_0xc8aa('0xf')][_0xc8aa('0xa2')](_0x2cde58,_0x126f0e[_0xc8aa('0xa0')]);};AGIVertices['prototype']['isConfigured']=function(_0x57eb8f){return _0x57eb8f&&_0x57eb8f!=='0'&&_0x57eb8f!=='-1'&&_0x57eb8f!=='';};AGIVertices['prototype'][_0xc8aa('0xa3')]=function(_0x50a83e){this[_0xc8aa('0x3b')]['sync'](this,_0x50a83e,'-');_0x50a83e[_0xc8aa('0xa4')]=_0x50a83e[_0xc8aa('0xa3')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0xc8aa('0xa5')]=function(_0x395d6f){logger[_0xc8aa('0x31')](util[_0xc8aa('0x2c')](_0xc8aa('0xa6'),_0x395d6f['label']));if(!this['isConfigured'](_0x395d6f[_0xc8aa('0x5c')])){return this[_0xc8aa('0xf')][_0xc8aa('0xa7')]('no\x20text\x20configured');}var _0x22fcba='\x22'+_0x395d6f['text']+'\x22';if(this[_0xc8aa('0x82')](_0x395d6f[_0xc8aa('0x77')])){_0x22fcba+=','+_0x395d6f[_0xc8aa('0x77')];}var _0xd2cf47=this[_0xc8aa('0xf')][_0xc8aa('0x58')]('MRCPSynth',_0x22fcba);if(_0xd2cf47[_0xc8aa('0xa8')]===-0x1){return _0xd2cf47;}return this[_0xc8aa('0xf')][_0xc8aa('0xa7')](util['format'](_0xc8aa('0xa9'),_0x22fcba));};AGIVertices['prototype'][_0xc8aa('0xaa')]=function(_0x1a02cd){logger[_0xc8aa('0x31')](util['format'](_0xc8aa('0xab'),_0x1a02cd[_0xc8aa('0x3d')]));if(!this[_0xc8aa('0x82')](_0x1a02cd['grammar'])){return this[_0xc8aa('0xf')]['noop'](_0xc8aa('0xac'));}var _0x1ad6d1=_0x1a02cd[_0xc8aa('0xad')];if(this[_0xc8aa('0x82')](_0x1a02cd[_0xc8aa('0x77')])){_0x1ad6d1+=','+_0x1a02cd[_0xc8aa('0x77')];}var _0x3f4125=this['channel'][_0xc8aa('0x58')](_0xc8aa('0xae'),_0x1ad6d1);if(_0x3f4125['result']===-0x1){return _0x3f4125;}var _0x43a347=this[_0xc8aa('0xa1')]('RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE');if(_0x43a347[_0xc8aa('0xa8')]===-0x1){return _0x43a347;}var _0x2805ed=this[_0xc8aa('0xa1')](_0xc8aa('0xaf'),_0xc8aa('0xb0'));if(_0x2805ed[_0xc8aa('0xa8')]===-0x1){return _0x2805ed;}var _0x4896ce=this['getAndSetVariable'](_0xc8aa('0xb1'),_0xc8aa('0xb2'));if(_0x4896ce[_0xc8aa('0xa8')]===-0x1){return _0x4896ce;}return this[_0xc8aa('0xf')]['noop'](util[_0xc8aa('0x2c')]('Executed\x20command\x20MRCPRecog\x20%s',_0x1ad6d1));};AGIVertices[_0xc8aa('0x11')]['agi']=function(_0xd9b792){logger[_0xc8aa('0x31')](util[_0xc8aa('0x2c')](_0xc8aa('0xb3'),_0xd9b792['label']));return this[_0xc8aa('0xf')][_0xc8aa('0x8')]([_0xd9b792['command'],_0xd9b792['args']]);};AGIVertices['prototype'][_0xc8aa('0xb4')]=function(_0x2cdf9d){logger[_0xc8aa('0x31')](util[_0xc8aa('0x2c')](_0xc8aa('0xb5'),_0x2cdf9d[_0xc8aa('0x3d')]));if(this['isConfigured'](_0x2cdf9d['timeout'])){logger['info'](util[_0xc8aa('0x2c')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x2cdf9d[_0xc8aa('0x67')]));var _0x24773b=this[_0xc8aa('0xf')][_0xc8aa('0xb6')](_0x2cdf9d[_0xc8aa('0x67')]);if(_0x24773b[_0xc8aa('0xa8')]===-0x1){return _0x24773b;}}return this[_0xc8aa('0xf')][_0xc8aa('0xb4')]();};AGIVertices['prototype'][_0xc8aa('0xb7')]=function(_0x2e5e5f){logger[_0xc8aa('0x31')](util[_0xc8aa('0x2c')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x2e5e5f[_0xc8aa('0x3d')]));if(!this['isConfigured'](_0x2e5e5f[_0xc8aa('0x4c')])){return this[_0xc8aa('0xf')][_0xc8aa('0x53')](_0x2e5e5f,_0xc8aa('0xb8'));}_0x2e5e5f[_0xc8aa('0x4d')]=moment();if(this[_0xc8aa('0x82')](_0x2e5e5f[_0xc8aa('0xb9')])){_0x2e5e5f[_0xc8aa('0x4d')]=moment()[_0xc8aa('0xba')](_0x2e5e5f[_0xc8aa('0xb9')],_0xc8aa('0xbb'));}if(!this[_0xc8aa('0x82')](_0x2e5e5f[_0xc8aa('0x4f')])){_0x2e5e5f[_0xc8aa('0x4f')]=0x2;}this['createCmContact']['sync'](this,_0x2e5e5f);return this['channel'][_0xc8aa('0xa7')](util['format']('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x2e5e5f[_0xc8aa('0xbc')],_0x2e5e5f[_0xc8aa('0x4c')],_0x2e5e5f['scheduledAt']));};AGIVertices['prototype'][_0xc8aa('0xbd')]=function(_0x307377){logger[_0xc8aa('0x31')](util[_0xc8aa('0x2c')](_0xc8aa('0xbe'),_0x307377[_0xc8aa('0x3d')]));var _0x48eb13=this[_0xc8aa('0xf')][_0xc8aa('0x58')](_0x307377[_0xc8aa('0xbf')],_0x307377[_0xc8aa('0x77')]);if(_0x48eb13[_0xc8aa('0xa8')]===-0x1){return _0x48eb13;}return this[_0xc8aa('0xf')]['noop'](util[_0xc8aa('0x2c')](_0xc8aa('0xc0'),_0x307377['application'],_0x307377[_0xc8aa('0x77')]));};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0xc1')]=function(_0x47798f){logger[_0xc8aa('0x31')](util[_0xc8aa('0x2c')](_0xc8aa('0xc2'),_0x47798f[_0xc8aa('0x3d')]));if(!this[_0xc8aa('0x82')](_0x47798f[_0xc8aa('0x5c')])){return this[_0xc8aa('0xf')][_0xc8aa('0xa7')](_0xc8aa('0xc3'));}var _0x1d195b='\x22'+_0x47798f[_0xc8aa('0x5c')]+'\x22';if(this[_0xc8aa('0x82')](_0x47798f[_0xc8aa('0x77')])){_0x1d195b+=','+_0x47798f[_0xc8aa('0x77')];}var _0x2828e2=this[_0xc8aa('0xf')][_0xc8aa('0x58')](_0xc8aa('0xc4'),_0x1d195b);if(_0x2828e2[_0xc8aa('0xa8')]===-0x1){return _0x2828e2;}return this['channel']['noop'](util[_0xc8aa('0x2c')]('Executed\x20command\x20MRCPSynth\x20%s',_0x1d195b));};AGIVertices[_0xc8aa('0x11')]['sestektts']=function(_0x2dfe38){logger[_0xc8aa('0x31')](util[_0xc8aa('0x2c')](_0xc8aa('0xc5'),_0x2dfe38['label']));if(!this[_0xc8aa('0x82')](_0x2dfe38['text'])){return this[_0xc8aa('0xf')][_0xc8aa('0xa7')](_0xc8aa('0xc3'));}var _0x5df376='\x22'+_0x2dfe38[_0xc8aa('0x5c')]+'\x22';if(this['isConfigured'](_0x2dfe38['options'])){_0x5df376+=','+_0x2dfe38[_0xc8aa('0x77')];}var _0xd5c115=this[_0xc8aa('0xf')][_0xc8aa('0x58')](_0xc8aa('0xc4'),_0x5df376);if(_0xd5c115[_0xc8aa('0xa8')]===-0x1){return _0xd5c115;}return this['channel']['noop'](util['format'](_0xc8aa('0xa9'),_0x5df376));};AGIVertices[_0xc8aa('0x11')]['lumenvoxasr']=function(_0x4585a1){logger[_0xc8aa('0x31')](util[_0xc8aa('0x2c')](_0xc8aa('0xc6'),_0x4585a1[_0xc8aa('0x3d')]));if(!this['isConfigured'](_0x4585a1['grammar'])){return this[_0xc8aa('0xf')]['noop']('no\x20grammar\x20configured');}var _0x1194bd=_0x4585a1[_0xc8aa('0xad')];if(this['isConfigured'](_0x4585a1['options'])){_0x1194bd+=','+_0x4585a1[_0xc8aa('0x77')];}var _0x3abcbd=this[_0xc8aa('0xf')][_0xc8aa('0x58')](_0xc8aa('0xae'),_0x1194bd);if(_0x3abcbd[_0xc8aa('0xa8')]===-0x1){return _0x3abcbd;}var _0x202bf8=this[_0xc8aa('0xa1')](_0xc8aa('0xc7'),_0xc8aa('0xc8'));if(_0x202bf8[_0xc8aa('0xa8')]===-0x1){return _0x202bf8;}var _0x1224a2=this['getAndSetVariable'](_0xc8aa('0xaf'),_0xc8aa('0xc9'));if(_0x1224a2['result']===-0x1){return _0x1224a2;}var _0xe2fe3e=this[_0xc8aa('0xa1')]('RECOG_INSTANCE()',_0xc8aa('0xca'));if(_0xe2fe3e['result']===-0x1){return _0xe2fe3e;}return this['channel'][_0xc8aa('0xa7')](util[_0xc8aa('0x2c')]('Executed\x20command\x20MRCPRecog\x20%s',_0x1194bd));};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0xcb')]=function(_0x2e946c){logger[_0xc8aa('0x31')](util['format'](_0xc8aa('0xcc'),_0x2e946c[_0xc8aa('0x3d')]));if(!this[_0xc8aa('0x82')](_0x2e946c[_0xc8aa('0xad')])){return this[_0xc8aa('0xf')][_0xc8aa('0xa7')]('no\x20grammar\x20configured');}var _0x2416ac=_0x2e946c[_0xc8aa('0xad')];if(this[_0xc8aa('0x82')](_0x2e946c[_0xc8aa('0x77')])){_0x2416ac+=','+_0x2e946c['options'];}var _0x1cf2ae=this[_0xc8aa('0xf')]['exec'](_0xc8aa('0xae'),_0x2416ac);if(_0x1cf2ae[_0xc8aa('0xa8')]===-0x1){return _0x1cf2ae;}var _0x3de212=this['getAndSetVariable'](_0xc8aa('0xc7'),_0xc8aa('0xcd'));if(_0x3de212['result']===-0x1){return _0x3de212;}var _0x5ca123=this['getAndSetVariable'](_0xc8aa('0xaf'),_0xc8aa('0xce'));if(_0x5ca123[_0xc8aa('0xa8')]===-0x1){return _0x5ca123;}var _0x54b714=this[_0xc8aa('0xa1')](_0xc8aa('0xb1'),'SESTEK_ASR_INSTANCE');if(_0x54b714[_0xc8aa('0xa8')]===-0x1){return _0x54b714;}return this['channel'][_0xc8aa('0xa7')](util['format'](_0xc8aa('0xcf'),_0x2416ac));};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0xd0')]=function(_0x569a74){logger[_0xc8aa('0x31')](util['format'](_0xc8aa('0xd1'),_0x569a74[_0xc8aa('0x3d')]));if(!this[_0xc8aa('0x82')](_0x569a74[_0xc8aa('0xd2')])){return this[_0xc8aa('0xf')][_0xc8aa('0x53')](_0x569a74,_0xc8aa('0xd3'));}var _0x2121ac=this['getSquareOdbc'][_0xc8aa('0xd4')](this,_0x569a74[_0xc8aa('0xd2')]);if(!_0x2121ac){return this[_0xc8aa('0xf')]['error'](_0x569a74,'no\x20odbc\x20database\x20found');}if(!this['isConfigured'](_0x569a74[_0xc8aa('0x33')])){return this[_0xc8aa('0xf')]['error'](_0x569a74,'no\x20query\x20configured');}var _0x51a2bd=_0x569a74[_0xc8aa('0x33')][_0xc8aa('0xd5')](/(\r\n|\n|\r)/gm,'\x20');this[_0xc8aa('0xf')][_0xc8aa('0xa7')](util[_0xc8aa('0x2c')](_0xc8aa('0xd6'),_0x51a2bd));var _0x1ab4a4=this['getQueryOdbc'][_0xc8aa('0xd4')](this,_0x2121ac,_0x51a2bd);this['createSquareDetailsReport']['sync'](this,_0x569a74,_0x51a2bd);if(!this[_0xc8aa('0x82')](_0x569a74['variable_id'])){return this[_0xc8aa('0xf')][_0xc8aa('0xa7')](_0xc8aa('0xd7'));}var _0x19ac49=this[_0xc8aa('0x12')][_0xc8aa('0xd4')](this,_0x569a74[_0xc8aa('0xd8')]);if(!_0x19ac49){return this[_0xc8aa('0xf')]['error'](_0x569a74,_0xc8aa('0xd9'));}var _0x238faa=this;_0x1ab4a4[_0xc8aa('0xda')](function(_0x9fa09d,_0x369908){Object[_0xc8aa('0xdb')](_0x9fa09d)[_0xc8aa('0xda')](function(_0x43a11c){_0x238faa[_0xc8aa('0xf')][_0xc8aa('0xa2')](util[_0xc8aa('0x2c')]('%s[%s][%s]',_0x19ac49,_0x369908,_0x43a11c),_0x9fa09d[_0x43a11c]);});});this[_0xc8aa('0xf')][_0xc8aa('0xa2')](util[_0xc8aa('0x2c')](_0xc8aa('0xdc'),_0x19ac49),_0x1ab4a4[_0xc8aa('0x9b')]);return this[_0xc8aa('0xf')]['noop'](util[_0xc8aa('0x2c')](_0xc8aa('0xdd'),_0x19ac49));};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0xde')]=function(_0x234a96){logger[_0xc8aa('0xdf')](util[_0xc8aa('0x2c')](_0xc8aa('0xe0'),_0x234a96['label']));if(!this['isConfigured'](_0x234a96[_0xc8aa('0xe1')])){return this[_0xc8aa('0xf')][_0xc8aa('0x53')](_0x234a96,_0xc8aa('0xe2'));}var _0x4511ac=this[_0xc8aa('0x1d')][_0xc8aa('0xd4')](this,_0x234a96['sip_id']);if(!_0x4511ac){return this['channel'][_0xc8aa('0x53')](_0x234a96,_0xc8aa('0xe3'));}var _0x32c7e1=this['channel']['exec'](_0xc8aa('0xe4'),[util[_0xc8aa('0x2c')](_0xc8aa('0xe5'),_0x4511ac),_0x234a96[_0xc8aa('0x67')],_0x234a96[_0xc8aa('0xe6')],_0x234a96['url']]);if(_0x32c7e1['result']===-0x1){return _0x32c7e1;}return this[_0xc8aa('0xf')][_0xc8aa('0xa7')](util[_0xc8aa('0x2c')](_0xc8aa('0xe7'),_0xc8aa('0xe4')));};AGIVertices['prototype'][_0xc8aa('0xe8')]=function(_0x22564a){logger[_0xc8aa('0x31')](util['format'](_0xc8aa('0xe9'),_0x22564a['label']));if(!this[_0xc8aa('0x82')](_0x22564a['key'])){return this[_0xc8aa('0xf')][_0xc8aa('0xa7')](_0xc8aa('0xea'));}if(!this[_0xc8aa('0x82')](_0x22564a['text'])){return this[_0xc8aa('0xf')][_0xc8aa('0xa7')]('no\x20text\x20configured');}this[_0xc8aa('0xf')][_0xc8aa('0xeb')]=!![];this[_0xc8aa('0x3b')](_0x22564a);this[_0xc8aa('0x47')](_0x22564a['text'],'in','','');this[_0xc8aa('0xf')][_0xc8aa('0xa7')](util['format'](_0xc8aa('0xec'),_0x22564a[_0xc8aa('0x5c')]));var _0x48bf98=this['googleDialogflow']['sync'](this,_0x22564a);if(_0x48bf98){for(var _0x24745f in _0x48bf98){if(_0x48bf98[_0xc8aa('0x95')](_0x24745f)){this[_0xc8aa('0xf')]['setVariable'](util['format'](_0xc8aa('0xed'),_0x24745f[_0xc8aa('0xee')]()),_0x48bf98[_0x24745f]);}}this[_0xc8aa('0x47')](_0x48bf98[_0xc8aa('0xef')],_0xc8aa('0xf0'),_0xc8aa('0xe8'),'');return this[_0xc8aa('0xf')][_0xc8aa('0xa7')](util['format'](_0xc8aa('0xf1'),_0x48bf98[_0xc8aa('0xef')]));}return this[_0xc8aa('0xf')][_0xc8aa('0x53')](_0x22564a,_0xc8aa('0xf2'));};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0xf3')]=function(_0x54dc92){logger[_0xc8aa('0x31')](util[_0xc8aa('0x2c')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x54dc92[_0xc8aa('0x3d')]));if(!this[_0xc8aa('0x82')](_0x54dc92[_0xc8aa('0xf4')])){return this[_0xc8aa('0xf')]['noop'](_0xc8aa('0xf5'));}if(!this['isConfigured'](_0x54dc92[_0xc8aa('0xf6')])){return this[_0xc8aa('0xf')][_0xc8aa('0xa7')](_0xc8aa('0xf7'));}if(!this[_0xc8aa('0x82')](_0x54dc92[_0xc8aa('0x7c')])){return this[_0xc8aa('0xf')][_0xc8aa('0xa7')]('no\x20private_key\x20configured');}if(!this[_0xc8aa('0x82')](_0x54dc92[_0xc8aa('0x7d')])){return this[_0xc8aa('0xf')][_0xc8aa('0xa7')](_0xc8aa('0xf8'));}if(!this[_0xc8aa('0x82')](_0x54dc92[_0xc8aa('0x5c')])){return this[_0xc8aa('0xf')][_0xc8aa('0xa7')](_0xc8aa('0xc3'));}this[_0xc8aa('0xf')]['bot']=!![];this[_0xc8aa('0x3b')](_0x54dc92);this['createSquareMessage'](_0x54dc92['text'],'in','','');this[_0xc8aa('0xf')]['noop'](util['format'](_0xc8aa('0xf9'),_0x54dc92[_0xc8aa('0x5c')]));var _0x2b28e1=this[_0xc8aa('0x7b')]['sync'](this,_0x54dc92);if(_0x2b28e1){for(var _0x12d548 in _0x2b28e1){if(_0x2b28e1['hasOwnProperty'](_0x12d548)){if(_0x12d548!==_0xc8aa('0xfa')){this[_0xc8aa('0xf')]['setVariable'](util['format'](_0xc8aa('0xed'),_0x12d548[_0xc8aa('0xee')]()),_0x2b28e1[_0x12d548]);}}}this[_0xc8aa('0x47')](_0x2b28e1[_0xc8aa('0xef')],_0xc8aa('0xf0'),_0xc8aa('0xf3'),_0x2b28e1[_0xc8aa('0xfa')]);return this['channel'][_0xc8aa('0xa7')](util['format']('DialogflowV2\x20Result\x20%s',_0x2b28e1['speech']));}return this['channel']['error'](_0x54dc92,_0xc8aa('0xfb'));};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0xfc')]=function(_0x1aeae8){logger['info'](util[_0xc8aa('0x2c')](_0xc8aa('0xfd'),_0x1aeae8[_0xc8aa('0x3d')]));if(!this[_0xc8aa('0x82')](_0x1aeae8[_0xc8aa('0xfe')])){return this[_0xc8aa('0xf')][_0xc8aa('0xa7')](_0xc8aa('0xff'));}if(!this[_0xc8aa('0x82')](_0x1aeae8[_0xc8aa('0x100')])){return this[_0xc8aa('0xf')][_0xc8aa('0xa7')](_0xc8aa('0x101'));}if(!this[_0xc8aa('0x82')](_0x1aeae8['password'])){return this[_0xc8aa('0xf')][_0xc8aa('0xa7')](_0xc8aa('0x102'));}if(!this[_0xc8aa('0x82')](_0x1aeae8['ndassistant_url'])){return this['channel'][_0xc8aa('0xa7')](_0xc8aa('0xc3'));}this['channel'][_0xc8aa('0xeb')]=!![];this['createSquareDetailsReport'](_0x1aeae8);this['createSquareMessage'](_0x1aeae8[_0xc8aa('0x5c')],'in','','');this[_0xc8aa('0xf')]['noop'](util['format'](_0xc8aa('0x103'),_0x1aeae8['text']));var _0x3c2c37=this['sestekNDA']['sync'](this,_0x1aeae8);if(_0x3c2c37){for(var _0x375430 in _0x3c2c37){if(_0x3c2c37[_0xc8aa('0x95')](_0x375430)){this[_0xc8aa('0xf')][_0xc8aa('0xa2')](util[_0xc8aa('0x2c')]('SESTEK_NDA_%s',_0x375430[_0xc8aa('0xee')]()),_0x3c2c37[_0x375430]);}}this['createSquareMessage'](_0x3c2c37[_0xc8aa('0xef')],_0xc8aa('0xf0'),_0xc8aa('0xfc'),'');if(_0x3c2c37[_0xc8aa('0x104')]){this['channel']['noop'](util[_0xc8aa('0x2c')](_0xc8aa('0x105'),_0x3c2c37[_0xc8aa('0x104')]));var _0x18f09f=this[_0xc8aa('0xf')]['streamFile'](_0x3c2c37[_0xc8aa('0x104')]);try{fs[_0xc8aa('0x106')](_0x3c2c37['audiofile']+_0xc8aa('0x107'));}catch(_0x1eebce){logger[_0xc8aa('0x53')](_0x1eebce);}return _0x18f09f;}else{return this['channel'][_0xc8aa('0xa7')](util[_0xc8aa('0x2c')](_0xc8aa('0x108'),_0x3c2c37[_0xc8aa('0xef')]));}}return this[_0xc8aa('0xf')][_0xc8aa('0x53')](_0x1aeae8,'SestekNDA\x20is\x20unreachable');};AGIVertices['prototype'][_0xc8aa('0x109')]=function(_0x448602){logger[_0xc8aa('0x31')](util[_0xc8aa('0x2c')](_0xc8aa('0x10a'),_0x448602[_0xc8aa('0x3d')]));return this[_0xc8aa('0xf')]['noop'](_0xc8aa('0x109'));};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0x10b')]=function(_0x4cf849){logger[_0xc8aa('0x31')](util[_0xc8aa('0x2c')](_0xc8aa('0x10c'),_0x4cf849[_0xc8aa('0x3d')]));var _0x4cebcb='';if(_0x4cf849[_0xc8aa('0x10d')]){if(!this[_0xc8aa('0x82')](_0x4cf849[_0xc8aa('0x10d')])){return this[_0xc8aa('0xf')]['error'](_0x4cf849,_0xc8aa('0x10e'));}else{var _0x4e515b=parseInt(_0x4cf849[_0xc8aa('0x10d')],0xa);if(isNaN(_0x4e515b)){_0x4cebcb=_0x4cf849[_0xc8aa('0x10d')];}else{_0x4cebcb=this[_0xc8aa('0x1f')][_0xc8aa('0xd4')](this,_0x4cf849[_0xc8aa('0x10d')]);if(!_0x4cebcb){return this[_0xc8aa('0xf')][_0xc8aa('0x53')](_0x4cf849,_0xc8aa('0x10f'));}}}}else if(_0x4cf849['trunk_name']){_0x4cebcb=_0x4cf849['trunk_name'];}else{return this[_0xc8aa('0xf')]['error'](_0x4cf849,_0xc8aa('0x10e'));}var _0x599623=this[_0xc8aa('0xf')][_0xc8aa('0x58')](_0xc8aa('0xe4'),[util[_0xc8aa('0x2c')](_0xc8aa('0x110'),_0x4cebcb,_0x4cf849[_0xc8aa('0xbc')]),_0x4cf849[_0xc8aa('0x67')],_0x4cf849[_0xc8aa('0xe6')],_0x4cf849[_0xc8aa('0x64')]]);if(_0x599623['result']===-0x1){return _0x599623;}return this[_0xc8aa('0xf')][_0xc8aa('0xa7')](util[_0xc8aa('0x2c')](_0xc8aa('0xe7'),_0xc8aa('0xe4')));};AGIVertices[_0xc8aa('0x11')]['finally']=function(_0x7eed5a){logger[_0xc8aa('0x31')](util[_0xc8aa('0x2c')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x7eed5a['label']));return this[_0xc8aa('0xf')][_0xc8aa('0xa7')](_0xc8aa('0x111'));};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0xd')]=function(_0x5782d8){logger[_0xc8aa('0x31')](util[_0xc8aa('0x2c')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x5782d8[_0xc8aa('0x3d')]));if(_0x5782d8['retry']===0x0){return this[_0xc8aa('0xa3')](_0x5782d8);}_0x5782d8[_0xc8aa('0xa4')]-=0x1;if(!this['isConfigured'](_0x5782d8[_0xc8aa('0x112')])){return this[_0xc8aa('0xf')]['error'](_0x5782d8,_0xc8aa('0x113'));}var _0x14ef4e=this[_0xc8aa('0x21')][_0xc8aa('0xd4')](this,_0x5782d8[_0xc8aa('0x112')]);if(!_0x14ef4e){return this[_0xc8aa('0xf')][_0xc8aa('0x53')](_0x5782d8,_0xc8aa('0x114'));}if(!this[_0xc8aa('0x82')](_0x5782d8['variable_id'])){return this[_0xc8aa('0xf')]['error'](_0xc8aa('0xd7'));}var _0x218aed=this[_0xc8aa('0xf')][_0xc8aa('0x115')](_0x14ef4e,_0x5782d8[_0xc8aa('0x116')],_0x5782d8['maxdigit']);var _0x171bda=_0x218aed['result']?_0x218aed[_0xc8aa('0xa8')][_0xc8aa('0x4e')]():'';logger[_0xc8aa('0x31')]('test',JSON[_0xc8aa('0x72')](_0x218aed));if(_0x218aed[_0xc8aa('0xa8')]===-0x1){this[_0xc8aa('0x3b')][_0xc8aa('0xd4')](this,_0x5782d8,_0x171bda);return _0x218aed;}else if(_0x218aed[_0xc8aa('0xa0')]===_0xc8aa('0x67')){_0x218aed['result']=_0x171bda[_0xc8aa('0x9b')]>=parseInt(_0x5782d8[_0xc8aa('0x117')])?'x':'i';}else{_0x218aed[_0xc8aa('0xa8')]=_0x171bda['length']>=parseInt(_0x5782d8[_0xc8aa('0x117')])&&_0x171bda[_0xc8aa('0x9b')]<=parseInt(_0x5782d8['maxdigit'])?'x':'i';}var _0x33f410=this[_0xc8aa('0x12')]['sync'](this,_0x5782d8[_0xc8aa('0xd8')]);if(!_0x33f410){return this[_0xc8aa('0xf')][_0xc8aa('0x53')](_0x5782d8,_0xc8aa('0xd9'));}this[_0xc8aa('0xf')][_0xc8aa('0xa2')](_0x33f410,_0x171bda);if(this['isConfigured'](_0x5782d8[_0xc8aa('0x118')])){var _0x5e89f6=parseInt(_0x5782d8[_0xc8aa('0x118')],0xa);var _0x27bf08=rs[_0xc8aa('0x119')]({'charset':'*','length':_0x5e89f6});var _0x5d9a7b=_0x171bda[_0xc8aa('0x9b')];if(_0x5d9a7b>0x0){if(_0x5d9a7b>_0x5e89f6){this['createSquareDetailsReport'][_0xc8aa('0xd4')](this,_0x5782d8,_0x5782d8[_0xc8aa('0x11a')]==='first'?_0x27bf08+_0x171bda[_0xc8aa('0x11b')](_0x5e89f6):_0x171bda[_0xc8aa('0x11b')](0x0,_0x5d9a7b-_0x5e89f6)+_0x27bf08);}else{this[_0xc8aa('0x3b')][_0xc8aa('0xd4')](this,_0x5782d8,rs['generate']({'charset':'*','length':_0x5d9a7b}));}}else{this[_0xc8aa('0x3b')]['sync'](this,_0x5782d8,'');}}else{this['createSquareDetailsReport'][_0xc8aa('0xd4')](this,_0x5782d8,_0x171bda);}return _0x218aed;};AGIVertices['prototype']['getsecretdigits']=function(_0x5ad236){logger[_0xc8aa('0x31')](util[_0xc8aa('0x2c')](_0xc8aa('0x11c'),_0x5ad236['label']));return this['getdigits'](_0x5ad236);};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0x11d')]=function(_0x457c4a){logger[_0xc8aa('0x31')](util[_0xc8aa('0x2c')](_0xc8aa('0x11e'),_0x457c4a['label']));this[_0xc8aa('0x3b')]['sync'](this,_0x457c4a,_0x457c4a[_0xc8aa('0x11f')]);return this[_0xc8aa('0xf')][_0xc8aa('0xa7')](util['format'](_0xc8aa('0x120'),_0x457c4a[_0xc8aa('0x11f')]));};AGIVertices[_0xc8aa('0x11')]['awspolly']=function(_0x47acf5){logger[_0xc8aa('0x31')](util['format'](_0xc8aa('0x121'),_0x47acf5[_0xc8aa('0x3d')]));if(!this['isConfigured'](_0x47acf5[_0xc8aa('0x85')])||!this[_0xc8aa('0x82')](_0x47acf5[_0xc8aa('0x86')])){return this[_0xc8aa('0xf')][_0xc8aa('0xa7')](_0xc8aa('0x122'));}if(!this[_0xc8aa('0x82')](_0x47acf5[_0xc8aa('0x5c')])){return this[_0xc8aa('0xf')][_0xc8aa('0xa7')](_0xc8aa('0xc3'));}this[_0xc8aa('0xf')][_0xc8aa('0xa7')](util['format'](_0xc8aa('0x123'),_0x47acf5[_0xc8aa('0x5c')]));var _0x572a59=this[_0xc8aa('0x84')][_0xc8aa('0xd4')](this,_0x47acf5);if(_0x572a59){this[_0xc8aa('0xf')][_0xc8aa('0xa7')](util[_0xc8aa('0x2c')](_0xc8aa('0x124'),_0x572a59));var _0x311c22=this['channel'][_0xc8aa('0x125')](_0x572a59);try{fs['unlink'](_0x572a59+_0xc8aa('0x107'));}catch(_0x3b226d){logger[_0xc8aa('0x53')](_0x3b226d);}return _0x311c22;}return this[_0xc8aa('0xf')][_0xc8aa('0x53')](_0x47acf5,_0xc8aa('0x126'));};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0x127')]=function(_0x1aae1c){logger[_0xc8aa('0x31')](util[_0xc8aa('0x2c')](_0xc8aa('0x128'),_0x1aae1c['label']));if(!this[_0xc8aa('0x82')](_0x1aae1c[_0xc8aa('0x85')])||!this['isConfigured'](_0x1aae1c[_0xc8aa('0x86')])){return this[_0xc8aa('0xf')][_0xc8aa('0xa7')](_0xc8aa('0x122'));}if(!this[_0xc8aa('0x82')](_0x1aae1c[_0xc8aa('0x8c')])){return this['channel'][_0xc8aa('0xa7')]('no\x20bot\x20name\x20configured');}if(!this[_0xc8aa('0x82')](_0x1aae1c[_0xc8aa('0x5c')])){return this[_0xc8aa('0xf')][_0xc8aa('0xa7')](_0xc8aa('0xc3'));}this[_0xc8aa('0xf')][_0xc8aa('0xeb')]=!![];this[_0xc8aa('0x3b')](_0x1aae1c);this[_0xc8aa('0x47')](_0x1aae1c['text'],'in','','');this[_0xc8aa('0xf')][_0xc8aa('0xa7')](util[_0xc8aa('0x2c')](_0xc8aa('0x129'),_0x1aae1c[_0xc8aa('0x5c')]));var _0xa7908f=this['awsLex'][_0xc8aa('0xd4')](this,_0x1aae1c);if(_0xa7908f){for(var _0x70d379 in _0xa7908f){if(_0xa7908f[_0xc8aa('0x95')](_0x70d379)&&_[_0xc8aa('0x96')](_0xa7908f[_0x70d379])){this['channel']['setVariable'](util[_0xc8aa('0x2c')](_0xc8aa('0x12a'),_0x70d379[_0xc8aa('0xee')]()),_0xa7908f[_0x70d379]);}}if(_[_0xc8aa('0x52')](_0xa7908f[_0xc8aa('0x12b')])){return this[_0xc8aa('0xf')][_0xc8aa('0xa7')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0xc8aa('0x47')](_0xa7908f[_0xc8aa('0x12b')],_0xc8aa('0xf0'),_0xc8aa('0x12c'),'');return this['channel']['noop'](util[_0xc8aa('0x2c')](_0xc8aa('0x12d'),_0xa7908f[_0xc8aa('0x12b')]));}}return this['channel']['error'](_0x1aae1c,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices['prototype'][_0xc8aa('0x12e')]=function(_0x36dc03){logger[_0xc8aa('0x31')](util[_0xc8aa('0x2c')](_0xc8aa('0x12f'),_0x36dc03['label'],_0x36dc03['timeout']));if(!this[_0xc8aa('0x82')](_0x36dc03['key'])){return this[_0xc8aa('0xf')]['noop'](_0xc8aa('0xea'));}var _0x1831ad=_0xc8aa('0x130');var _0xe95439=util['format'](_0xc8aa('0x131'),FILES_PATH,rs[_0xc8aa('0x119')](0x4));var _0x1d5298=util[_0xc8aa('0x2c')](_0xc8aa('0x9d'),_0xe95439,_0x1831ad);var _0x47fa92=!![];if(_0x36dc03[_0xc8aa('0x132')]==='NOBEEP'){_0x47fa92=![];}var _0x2cfede=this[_0xc8aa('0xf')][_0xc8aa('0x133')](_0xe95439,_0x1831ad,_0x36dc03[_0xc8aa('0x134')],_0x36dc03[_0xc8aa('0x67')],undefined,_0x47fa92);if(_0x2cfede[_0xc8aa('0xa8')]!==-0x1){this['channel'][_0xc8aa('0xa7')](util['format'](_0xc8aa('0x135'),_0x1d5298));var _0x1f2a10=this['googleASR'][_0xc8aa('0xd4')](this,_0x36dc03,_0x1d5298);if(_0x1f2a10){for(var _0xa68d0d in _0x1f2a10){if(_0x1f2a10[_0xc8aa('0x95')](_0xa68d0d)){this[_0xc8aa('0xf')][_0xc8aa('0xa2')](util[_0xc8aa('0x2c')](_0xc8aa('0x136'),_0xa68d0d['toUpperCase']()),_0x1f2a10[_0xa68d0d]);}}return this[_0xc8aa('0xf')][_0xc8aa('0xa7')](util[_0xc8aa('0x2c')](_0xc8aa('0x137'),JSON['stringify'](_0x1f2a10)));}}return _0x2cfede;};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0x138')]=function(_0x44c9aa){logger[_0xc8aa('0x31')](util[_0xc8aa('0x2c')](_0xc8aa('0x139'),_0x44c9aa[_0xc8aa('0x3d')]));if(!this[_0xc8aa('0x82')](_0x44c9aa[_0xc8aa('0x90')])){return this['channel'][_0xc8aa('0xa7')](_0xc8aa('0x13a'));}if(!this[_0xc8aa('0x82')](_0x44c9aa['appsecret'])){return this[_0xc8aa('0xf')][_0xc8aa('0xa7')](_0xc8aa('0x13b'));}var _0x4f37ee=_0xc8aa('0x130');var _0x1347b5=util[_0xc8aa('0x2c')](_0xc8aa('0x131'),FILES_PATH,rs[_0xc8aa('0x119')](0x4));var _0x433dd9=util[_0xc8aa('0x2c')](_0xc8aa('0x9d'),_0x1347b5,_0x4f37ee);var _0x52802f=!![];if(_0x44c9aa['beep']===_0xc8aa('0x13c')){_0x52802f=![];}var _0x5b76a6=this[_0xc8aa('0xf')][_0xc8aa('0x133')](_0x1347b5,_0x4f37ee,_0x44c9aa['intKey'],_0x44c9aa[_0xc8aa('0x67')],undefined,_0x52802f);if(_0x5b76a6['result']!==-0x1){this[_0xc8aa('0xf')]['noop'](util['format'](_0xc8aa('0x13d'),_0x433dd9));var _0x10e1a0=this[_0xc8aa('0x8f')][_0xc8aa('0xd4')](this,_0x44c9aa,_0x433dd9);if(_0x10e1a0){for(var _0x7aede3 in _0x10e1a0){if(_0x10e1a0[_0xc8aa('0x95')](_0x7aede3)){this['channel']['setVariable'](util[_0xc8aa('0x2c')](_0xc8aa('0x13e'),_0x7aede3[_0xc8aa('0xee')]()),_0x10e1a0[_0x7aede3]);}}return this[_0xc8aa('0xf')]['noop'](util[_0xc8aa('0x2c')]('TildeASR\x20Result\x20%s',JSON[_0xc8aa('0x72')](_0x10e1a0)));}}return _0x5b76a6;};AGIVertices[_0xc8aa('0x11')]['gotoc']=function(_0x258d3d){logger['info'](util[_0xc8aa('0x2c')](_0xc8aa('0x13f'),_0x258d3d[_0xc8aa('0x3d')]));return this['channel'][_0xc8aa('0x140')](_0x258d3d[_0xc8aa('0x42')],_0x258d3d[_0xc8aa('0x43')],_0x258d3d['priority']);};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0x141')]=function(_0x3e107c){logger['info'](util[_0xc8aa('0x2c')](_0xc8aa('0x142'),_0x3e107c[_0xc8aa('0x3d')]));if(!this[_0xc8aa('0x82')](_0x3e107c[_0xc8aa('0x143')])){return this[_0xc8aa('0xf')][_0xc8aa('0x53')](_0x3e107c,_0xc8aa('0x144'));}try{var _0x3c61ef=eval(_0x3e107c['condition'])?_0xc8aa('0x145'):_0xc8aa('0x146');this['channel'][_0xc8aa('0xa7')](util[_0xc8aa('0x2c')](_0xc8aa('0x147'),_0x3e107c[_0xc8aa('0x143')],_0x3c61ef));return{'code':0xc8,'result':_0x3c61ef};}catch(_0x57ad53){return{'code':0xc8,'result':_0xc8aa('0x146')};}};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0x148')]=function(_0x2e5db2){logger['info'](util[_0xc8aa('0x2c')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x2e5db2[_0xc8aa('0x3d')]));if(!this[_0xc8aa('0x82')](_0x2e5db2[_0xc8aa('0x149')])){return this[_0xc8aa('0xf')][_0xc8aa('0x53')](_0x2e5db2,_0xc8aa('0x14a'));}var _0x59f604=this[_0xc8aa('0x26')][_0xc8aa('0xd4')](this,_0x2e5db2[_0xc8aa('0x149')]);if(!_0x59f604){return this[_0xc8aa('0xf')][_0xc8aa('0x53')](_0x2e5db2,_0xc8aa('0x14b'));}for(var _0x103546=0x0;_0x103546<_0x59f604[_0xc8aa('0x9b')];_0x103546+=0x1){var _0x4a9935=this[_0xc8aa('0xf')]['getVariable'](util['format']('IFTIME(%s?true:false)',_0x59f604[_0x103546]));if(_0x4a9935[_0xc8aa('0xa8')]===-0x1){return _0x4a9935;}logger['info'](util['format'](_0xc8aa('0x14c'),_0x59f604[_0x103546],_0x4a9935['extra']));if(_0x4a9935[_0xc8aa('0xa0')]===_0xc8aa('0x145')){logger['info'](util[_0xc8aa('0x2c')](_0xc8aa('0x14c'),_0x59f604[_0x103546],_0xc8aa('0x145')));this[_0xc8aa('0xf')][_0xc8aa('0xa7')](util[_0xc8aa('0x2c')](_0xc8aa('0x14c'),_0x59f604[_0x103546],_0xc8aa('0x145')));return{'code':0xc8,'result':_0xc8aa('0x145')};}else{logger['info'](util[_0xc8aa('0x2c')](_0xc8aa('0x14c'),_0x59f604[_0x103546],_0xc8aa('0x146')));this[_0xc8aa('0xf')][_0xc8aa('0xa7')](util[_0xc8aa('0x2c')](_0xc8aa('0x14c'),_0x59f604[_0x103546],_0xc8aa('0x146')));}}return{'code':0xc8,'result':_0xc8aa('0x146')};};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0x14d')]=function(_0x41e836){logger[_0xc8aa('0x31')](util[_0xc8aa('0x2c')](_0xc8aa('0x14e'),_0x41e836[_0xc8aa('0x3d')]));return this['channel']['hangup']();};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0x14f')]=function(_0x28e30d){logger['info'](util[_0xc8aa('0x2c')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x28e30d['label']));if(!this[_0xc8aa('0x82')](_0x28e30d[_0xc8aa('0x79')])){return this[_0xc8aa('0xf')]['noop']('no\x20key\x20configured');}var _0x433fe9=_0xc8aa('0x130');var _0x2fe6bb=util['format'](_0xc8aa('0x131'),FILES_PATH,rs[_0xc8aa('0x119')](0x4));var _0x5cb3df=util[_0xc8aa('0x2c')](_0xc8aa('0x9d'),_0x2fe6bb,_0x433fe9);var _0x217845=!![];if(_0x28e30d[_0xc8aa('0x132')]===_0xc8aa('0x13c')){_0x217845=![];}var _0x49800c=this[_0xc8aa('0xf')][_0xc8aa('0x133')](_0x2fe6bb,_0x433fe9,_0x28e30d[_0xc8aa('0x134')],_0x28e30d[_0xc8aa('0x67')],undefined,_0x217845);if(_0x49800c[_0xc8aa('0xa8')]!==-0x1){this[_0xc8aa('0xf')][_0xc8aa('0xa7')](util[_0xc8aa('0x2c')]('ispeech\x20%s\x20file\x20created',_0x5cb3df));var _0x509136=this[_0xc8aa('0x81')]['sync'](this,_0x28e30d,_0x5cb3df);if(_0x509136){for(var _0x1c5165 in _0x509136){if(_0x509136[_0xc8aa('0x95')](_0x1c5165)){this[_0xc8aa('0xf')][_0xc8aa('0xa2')](util['format'](_0xc8aa('0x150'),_0x1c5165[_0xc8aa('0xee')]()),_0x509136[_0x1c5165]);}}return this[_0xc8aa('0xf')]['noop'](util['format'](_0xc8aa('0x151'),JSON[_0xc8aa('0x72')](_0x509136)));}}return _0x49800c;};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0x152')]=function(_0x358096){logger[_0xc8aa('0x31')](util[_0xc8aa('0x2c')](_0xc8aa('0x153'),_0x358096[_0xc8aa('0x3d')]));if(!this[_0xc8aa('0x82')](_0x358096[_0xc8aa('0x79')])){return this[_0xc8aa('0xf')][_0xc8aa('0xa7')](_0xc8aa('0xea'));}if(!this[_0xc8aa('0x82')](_0x358096['text'])){return this[_0xc8aa('0xf')][_0xc8aa('0xa7')](_0xc8aa('0xc3'));}this['channel']['noop'](util[_0xc8aa('0x2c')]('Trying\x20ispeech\x20TTS\x20%s',_0x358096[_0xc8aa('0x5c')]));var _0x39db4f=this[_0xc8aa('0x7f')][_0xc8aa('0xd4')](this,_0x358096);if(_0x39db4f){this[_0xc8aa('0xf')][_0xc8aa('0xa7')](util[_0xc8aa('0x2c')](_0xc8aa('0x154'),_0x39db4f));var _0x2f86ff=this['channel'][_0xc8aa('0x125')](_0x39db4f,_0x358096['intKey']);try{fs['unlink'](_0x39db4f+_0xc8aa('0x107'));}catch(_0x415065){logger[_0xc8aa('0x53')](_0x415065);}return _0x2f86ff;}return this[_0xc8aa('0xf')][_0xc8aa('0x53')](_0x358096,_0xc8aa('0x155'));};AGIVertices[_0xc8aa('0x11')]['login']=function(_0x221279){logger[_0xc8aa('0x31')](util['format'](_0xc8aa('0x156'),_0x221279[_0xc8aa('0x3d')]));if(!this[_0xc8aa('0x82')](_0x221279[_0xc8aa('0x157')])){return this['channel'][_0xc8aa('0x53')](_0x221279,_0xc8aa('0x158'));}logger[_0xc8aa('0x31')](util[_0xc8aa('0x2c')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xc8aa('0xf')]['callerid'],_0x221279[_0xc8aa('0x157')]));var _0x5b01f6=this['agentLogin']['sync'](this,_0x221279[_0xc8aa('0x157')]);if(_0x5b01f6){logger[_0xc8aa('0x31')](util[_0xc8aa('0x2c')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xc8aa('0xf')][_0xc8aa('0x3f')],_0x221279[_0xc8aa('0x157')]));this[_0xc8aa('0xf')][_0xc8aa('0xa7')](util[_0xc8aa('0x2c')](_0xc8aa('0x159'),this['channel'][_0xc8aa('0x3f')],_0x221279[_0xc8aa('0x157')]));return{'code':0xc8,'result':_0xc8aa('0x15a')};}else{logger['info'](util['format'](_0xc8aa('0x15b'),this[_0xc8aa('0xf')][_0xc8aa('0x3f')],_0x221279[_0xc8aa('0x157')]));this[_0xc8aa('0xf')][_0xc8aa('0xa7')](util[_0xc8aa('0x2c')](_0xc8aa('0x15b'),this[_0xc8aa('0xf')][_0xc8aa('0x3f')],_0x221279[_0xc8aa('0x157')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0x15c')]=function(_0x3f7b8e){logger[_0xc8aa('0x31')](util['format'](_0xc8aa('0x15d'),_0x3f7b8e['label']));if(!this[_0xc8aa('0x82')](_0x3f7b8e[_0xc8aa('0x157')])){return this[_0xc8aa('0xf')][_0xc8aa('0x53')](_0x3f7b8e,_0xc8aa('0x158'));}logger[_0xc8aa('0x31')](util[_0xc8aa('0x2c')](_0xc8aa('0x15e'),this[_0xc8aa('0xf')]['callerid'],_0x3f7b8e[_0xc8aa('0x157')]));var _0x49c64c=this[_0xc8aa('0x54')][_0xc8aa('0xd4')](this,_0x3f7b8e[_0xc8aa('0x157')]);if(_0x49c64c){logger[_0xc8aa('0x31')](util[_0xc8aa('0x2c')](_0xc8aa('0x159'),this[_0xc8aa('0xf')][_0xc8aa('0x3f')],_0x3f7b8e[_0xc8aa('0x157')]));this[_0xc8aa('0xf')][_0xc8aa('0xa7')](util[_0xc8aa('0x2c')](_0xc8aa('0x159'),this[_0xc8aa('0xf')]['callerid'],_0x3f7b8e['findBy']));return{'code':0xc8,'result':_0xc8aa('0x15a')};}else{logger[_0xc8aa('0x31')](util[_0xc8aa('0x2c')](_0xc8aa('0x15b'),this[_0xc8aa('0xf')][_0xc8aa('0x3f')],_0x3f7b8e['findBy']));this[_0xc8aa('0xf')][_0xc8aa('0xa7')](util['format'](_0xc8aa('0x15b'),this[_0xc8aa('0xf')][_0xc8aa('0x3f')],_0x3f7b8e['findBy']));return{'code':0xc8,'result':_0xc8aa('0x15f')};}};AGIVertices[_0xc8aa('0x11')]['math']=function(_0x345dff){logger['info'](util[_0xc8aa('0x2c')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x345dff[_0xc8aa('0x3d')]));if(!this['isConfigured'](_0x345dff[_0xc8aa('0x160')])){return this[_0xc8aa('0xf')]['error'](_0x345dff,_0xc8aa('0x161'));}this['channel']['noop'](util['format'](_0xc8aa('0x162'),_0x345dff[_0xc8aa('0x160')]));var _0x196531=eval(_0x345dff[_0xc8aa('0x160')]);if(!this[_0xc8aa('0x82')](_0x345dff[_0xc8aa('0xd8')])){return this[_0xc8aa('0xf')][_0xc8aa('0xa7')](_0xc8aa('0xd7'));}var _0x458d0c=this[_0xc8aa('0x12')][_0xc8aa('0xd4')](this,_0x345dff['variable_id']);if(!_0x458d0c){return this[_0xc8aa('0xf')]['error'](_0x345dff,_0xc8aa('0xd9'));}if(_[_0xc8aa('0x9a')](_0x196531)){var _0x1df28b=this;_0x196531[_0xc8aa('0xda')](function(_0x1e9c53,_0x1e0826){_0x1df28b[_0xc8aa('0xf')][_0xc8aa('0xa2')](util[_0xc8aa('0x2c')](_0xc8aa('0x163'),_0x458d0c,_0x1e0826),_0x1e9c53);});return this[_0xc8aa('0xf')][_0xc8aa('0xa7')](util[_0xc8aa('0x2c')](_0xc8aa('0x164'),_0x458d0c));}else{return this[_0xc8aa('0xf')]['setVariable'](_0x458d0c,_0x196531);}};AGIVertices['prototype'][_0xc8aa('0xc')]=function(_0x2075aa){logger[_0xc8aa('0x31')](util['format']('Enter\x20in\x20MENU\x20(%s)\x20block',_0x2075aa[_0xc8aa('0x3d')]));if(_0x2075aa[_0xc8aa('0xa4')]===0x0){return this[_0xc8aa('0xa3')](_0x2075aa);}_0x2075aa[_0xc8aa('0xa4')]-=0x1;if(!this['isConfigured'](_0x2075aa[_0xc8aa('0x112')])){return this[_0xc8aa('0xf')][_0xc8aa('0x53')](_0x2075aa,_0xc8aa('0x113'));}var _0x8c4e5f=this[_0xc8aa('0x21')][_0xc8aa('0xd4')](this,_0x2075aa[_0xc8aa('0x112')]);if(!_0x8c4e5f){return this[_0xc8aa('0xf')][_0xc8aa('0x53')](_0x2075aa,_0xc8aa('0x114'));}var _0x90d578=this[_0xc8aa('0xf')][_0xc8aa('0x115')](_0x8c4e5f,_0x2075aa[_0xc8aa('0x116')],_0x2075aa[_0xc8aa('0x165')]);var _0x48e009=_0x90d578['result'];if(_0x90d578[_0xc8aa('0xa8')]===-0x1){this[_0xc8aa('0x3b')][_0xc8aa('0xd4')](this,_0x2075aa,'-1');return _0x90d578;}else if(_0x90d578[_0xc8aa('0xa0')]===_0xc8aa('0x67')){_0x90d578[_0xc8aa('0xa8')]=_0x90d578[_0xc8aa('0xa8')][_0xc8aa('0x9b')]>0x0?_0x90d578[_0xc8aa('0xa8')]:'t';}else if(_[_0xc8aa('0x49')](_0x90d578[_0xc8aa('0xa8')])){_0x90d578[_0xc8aa('0xa8')]='#';_0x48e009='#';}if(!this[_0xc8aa('0x82')](_0x2075aa[_0xc8aa('0xd8')])){this[_0xc8aa('0xf')][_0xc8aa('0xa7')](_0xc8aa('0xd7'));}else{var _0x2846e3=this['getVariable']['sync'](this,_0x2075aa[_0xc8aa('0xd8')]);if(!_0x2846e3){return this[_0xc8aa('0xf')][_0xc8aa('0x53')](_0x2075aa,'no\x20variable\x20found');}this[_0xc8aa('0xf')][_0xc8aa('0xa2')](_0x2846e3,_0x48e009);}this['createSquareDetailsReport'][_0xc8aa('0xd4')](this,_0x2075aa,_0x48e009);return _0x90d578;};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0xa7')]=function(_0x36ccaf){logger[_0xc8aa('0x31')](util[_0xc8aa('0x2c')](_0xc8aa('0x166'),_0x36ccaf[_0xc8aa('0x3d')]));return this['channel'][_0xc8aa('0xa7')](_0x36ccaf[_0xc8aa('0x167')]||_0x36ccaf[_0xc8aa('0x3d')]);};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0x168')]=function(_0x128c97){logger[_0xc8aa('0x31')](util[_0xc8aa('0x2c')](_0xc8aa('0x169'),_0x128c97['label']));if(!this['isConfigured'](_0x128c97[_0xc8aa('0x157')])){return this[_0xc8aa('0xf')][_0xc8aa('0x53')](_0x128c97,_0xc8aa('0x158'));}logger[_0xc8aa('0x31')](util[_0xc8aa('0x2c')](_0xc8aa('0x15e'),this['channel']['callerid'],_0x128c97[_0xc8aa('0x157')]));var _0x370101=this[_0xc8aa('0x16a')][_0xc8aa('0xd4')](this,_0x128c97[_0xc8aa('0x16b')]);var _0x5573d3=this[_0xc8aa('0x50')]['sync'](this,_0x128c97[_0xc8aa('0x157')],_0x370101);if(_0x5573d3){logger[_0xc8aa('0x31')](util[_0xc8aa('0x2c')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xc8aa('0xf')][_0xc8aa('0x3f')],_0x128c97[_0xc8aa('0x157')]));this[_0xc8aa('0xf')]['noop'](util[_0xc8aa('0x2c')](_0xc8aa('0x159'),this[_0xc8aa('0xf')][_0xc8aa('0x3f')],_0x128c97[_0xc8aa('0x157')]));return{'code':0xc8,'result':_0xc8aa('0x15a')};}else{logger['info'](util[_0xc8aa('0x2c')](_0xc8aa('0x15b'),this[_0xc8aa('0xf')][_0xc8aa('0x3f')],_0x128c97[_0xc8aa('0x157')]));this[_0xc8aa('0xf')][_0xc8aa('0xa7')](util[_0xc8aa('0x2c')](_0xc8aa('0x159'),this['channel']['callerid'],_0x128c97[_0xc8aa('0x157')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0x16c')]=function(_0x4abaf2){logger[_0xc8aa('0x31')](util[_0xc8aa('0x2c')](_0xc8aa('0x16d'),_0x4abaf2[_0xc8aa('0x3d')]));if(!this[_0xc8aa('0x82')](_0x4abaf2[_0xc8aa('0x112')])){return this[_0xc8aa('0xf')][_0xc8aa('0x53')](_0x4abaf2,_0xc8aa('0x113'));}var _0x4c2eb2=this[_0xc8aa('0x21')][_0xc8aa('0xd4')](this,_0x4abaf2[_0xc8aa('0x112')]);if(!_0x4c2eb2){return this[_0xc8aa('0xf')][_0xc8aa('0x53')](_0x4abaf2,_0xc8aa('0x114'));}var _0x2bb356=this[_0xc8aa('0xf')][_0xc8aa('0x58')](_0xc8aa('0x16e'),[_0x4c2eb2,_0x4abaf2['opts']]);if(_0x2bb356[_0xc8aa('0xa8')]===-0x1){return _0x2bb356;}return this[_0xc8aa('0xf')]['noop'](util[_0xc8aa('0x2c')](_0xc8aa('0xc0'),_0xc8aa('0x16e'),_0x4c2eb2));};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0x16f')]=function(_0x46715b){logger[_0xc8aa('0x31')](util[_0xc8aa('0x2c')](_0xc8aa('0x170'),_0x46715b['label']));if(!this['isConfigured'](_0x46715b[_0xc8aa('0x171')])){return this[_0xc8aa('0xf')]['error'](_0x46715b,'no\x20queue\x20selected');}var _0x17fbe4='';var _0x4b5a99=parseInt(_0x46715b['queue_id'],0xa);if(isNaN(_0x4b5a99)){_0x17fbe4=_0x46715b[_0xc8aa('0x171')];}else{_0x17fbe4=this[_0xc8aa('0x17')][_0xc8aa('0xd4')](this,_0x46715b[_0xc8aa('0x171')]);if(!_0x17fbe4){return this[_0xc8aa('0xf')]['error'](_0x46715b,_0xc8aa('0x172'));}}var _0x30c746='';if(this[_0xc8aa('0x82')](_0x46715b[_0xc8aa('0x112')])){var _0x2c9e85=this['getSound'][_0xc8aa('0xd4')](this,_0x46715b[_0xc8aa('0x112')]);if(_0x2c9e85){_0x30c746=_0x2c9e85;}}this[_0xc8aa('0x3b')][_0xc8aa('0xd4')](this,_0x46715b,_0x17fbe4);if(_0x46715b[_0xc8aa('0xe6')][_0xc8aa('0x173')]('x')<0x0){_0x46715b['opts']+='x';}if(_0x46715b[_0xc8aa('0xe6')][_0xc8aa('0x173')]('X')<0x0){_0x46715b['opts']+='X';}this['channel'][_0xc8aa('0xa2')](_0xc8aa('0x174'),_0x17fbe4?_0x17fbe4[_0xc8aa('0x175')]():'');var _0x3666bb=this[_0xc8aa('0xf')]['exec']('QUEUE',[_0x17fbe4,_0x46715b[_0xc8aa('0xe6')],_0x46715b[_0xc8aa('0x64')],_0x30c746,_0x46715b[_0xc8aa('0x67')],_0x46715b[_0xc8aa('0x8')],_0x46715b['macro'],_0x46715b['gosub'],'',_0x46715b[_0xc8aa('0x176')]]);if(_0x3666bb[_0xc8aa('0xa8')]===-0x1){return _0x3666bb;}return this[_0xc8aa('0xf')][_0xc8aa('0xa7')](util[_0xc8aa('0x2c')](_0xc8aa('0xc0'),_0xc8aa('0x177'),_0x17fbe4));};AGIVertices['prototype'][_0xc8aa('0x178')]=function(_0x25acde){logger['info'](util[_0xc8aa('0x2c')](_0xc8aa('0x179'),_0x25acde['label']));var _0x6507b2=_0x25acde[_0xc8aa('0x17a')]||_0xc8aa('0x130');var _0x31b922=util[_0xc8aa('0x2c')](_0xc8aa('0x17b'),this[_0xc8aa('0xf')]['uniqueid'],rs[_0xc8aa('0x119')](0x5));var _0x1bc8c5=util[_0xc8aa('0x2c')](_0xc8aa('0x17c'),FILES_PATH,_0x31b922,_0x6507b2);var _0x2e3a72=util[_0xc8aa('0x2c')]('%s/recordings/%s',FILES_PATH,_0x31b922);this[_0xc8aa('0x40')][_0xc8aa('0xd4')](this,_0x25acde,_0x31b922,_0x1bc8c5);this[_0xc8aa('0xf')][_0xc8aa('0xa2')](_0xc8aa('0x17d'),_0x31b922);logger[_0xc8aa('0x31')](_0xc8aa('0x17e'),_0x2e3a72,_0x6507b2,_0x25acde[_0xc8aa('0x17f')],_0x25acde[_0xc8aa('0x67')]);return this[_0xc8aa('0xf')]['recordFile'](_0x2e3a72,_0x6507b2,_0x25acde[_0xc8aa('0x17f')],_0x25acde['timeout'],undefined,!![]);};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0x180')]=function(_0x3af173){logger[_0xc8aa('0x31')](util['format'](_0xc8aa('0x181'),_0x3af173['label']));if(!this[_0xc8aa('0x82')](_0x3af173['url'])){return this['channel'][_0xc8aa('0xa7')](_0xc8aa('0x182'));}var _0x4c98e9=this[_0xc8aa('0x63')][_0xc8aa('0xd4')](this,_0x3af173);logger[_0xc8aa('0x31')](util[_0xc8aa('0x2c')]('Response:',util[_0xc8aa('0x183')](_0x4c98e9,{'showHidden':![],'depth':null})));if(!this[_0xc8aa('0x82')](_0x3af173['variable_id'])){return this[_0xc8aa('0xf')]['noop'](_0xc8aa('0x184'));}var _0x3a259e=this['getVariable']['sync'](this,_0x3af173[_0xc8aa('0xd8')]);if(!_0x3a259e){return this['channel']['error'](_0x3af173,_0xc8aa('0xd9'));}this[_0xc8aa('0xf')][_0xc8aa('0xa2')](util[_0xc8aa('0x2c')](_0xc8aa('0x185'),_0x3a259e),_0x4c98e9[_0xc8aa('0x74')]?_0x4c98e9['statusCode']:_0xc8aa('0x186'));this[_0xc8aa('0xf')][_0xc8aa('0xa2')](util[_0xc8aa('0x2c')](_0xc8aa('0x187'),_0x3a259e),_0x4c98e9[_0xc8aa('0x75')]?_0x4c98e9['statusMessage']:'OK');if(_0x4c98e9['body']){try{this[_0xc8aa('0x9c')](_0x4c98e9[_0xc8aa('0x6b')],_0x3a259e);}catch(_0x4f9318){logger[_0xc8aa('0x53')](util[_0xc8aa('0x2c')](_0xc8aa('0x188'),_0x3a259e));}}return this[_0xc8aa('0xf')][_0xc8aa('0xa7')](util['format']('variable\x20%s\x20set',_0x3a259e));};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0x189')]=function(_0x12c24f){logger[_0xc8aa('0x31')](util[_0xc8aa('0x2c')](_0xc8aa('0x18a'),_0x12c24f[_0xc8aa('0x3d')]));return this[_0xc8aa('0xf')]['sayDigits'](_0x12c24f[_0xc8aa('0x18b')][_0xc8aa('0xd5')](/\s+/g,''),_0x12c24f[_0xc8aa('0x17f')]);};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0x18c')]=function(_0x24f1c3){logger[_0xc8aa('0x31')](util[_0xc8aa('0x2c')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x24f1c3[_0xc8aa('0x3d')]));return this['channel']['sayNumber'](_0x24f1c3['number'][_0xc8aa('0xd5')](/\s+/g,''),_0x24f1c3[_0xc8aa('0x17f')]);};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0x18d')]=function(_0x15afc6){logger[_0xc8aa('0x31')](util['format'](_0xc8aa('0x18e'),_0x15afc6['label']));return this[_0xc8aa('0xf')]['sayPhonetic'](_0x15afc6['text'],_0x15afc6[_0xc8aa('0x17f')]);};AGIVertices['prototype'][_0xc8aa('0x18f')]=function(_0x32ba0f){logger[_0xc8aa('0x31')](util[_0xc8aa('0x2c')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x32ba0f[_0xc8aa('0x3d')]));if(!this['isConfigured'](_0x32ba0f[_0xc8aa('0x190')])){return this[_0xc8aa('0xf')][_0xc8aa('0xa7')]('no\x20mail\x20account\x20configured');}var _0x317944=this[_0xc8aa('0x24')][_0xc8aa('0xd4')](this,_0x32ba0f['account_id']);if(!_0x317944||!_0x317944['Smtp']){return this[_0xc8aa('0xf')][_0xc8aa('0x53')](_0x32ba0f,_0xc8aa('0x191'));}var _0x6437f3={'from':util[_0xc8aa('0x2c')](_0xc8aa('0x192'),_0x317944[_0xc8aa('0x15')],_0x317944[_0xc8aa('0x193')]||_0x317944[_0xc8aa('0x194')][_0xc8aa('0x195')]),'to':_0x32ba0f['to']||'','cc':_0x32ba0f['cc']||'','bcc':_0x32ba0f['bcc']||'','subject':_0x32ba0f[_0xc8aa('0x196')],'html':_0x32ba0f[_0xc8aa('0x5c')],'text':_0x32ba0f['text']};var _0x3e9b6c={'tls':{'rejectUnauthorized':![]}};if(_0x317944[_0xc8aa('0x194')][_0xc8aa('0x197')]){_0x3e9b6c['service']=_0x317944[_0xc8aa('0x194')][_0xc8aa('0x197')];}else{_0x3e9b6c[_0xc8aa('0x198')]=_0x317944[_0xc8aa('0x194')][_0xc8aa('0x198')];_0x3e9b6c[_0xc8aa('0x199')]=_0x317944[_0xc8aa('0x194')][_0xc8aa('0x199')];_0x3e9b6c[_0xc8aa('0x19a')]=_0x317944[_0xc8aa('0x194')][_0xc8aa('0x19a')];}if(_0x317944[_0xc8aa('0x194')]['authentication']){_0x3e9b6c[_0xc8aa('0x19b')]={'user':_0x317944['Smtp'][_0xc8aa('0x195')],'pass':_0x317944[_0xc8aa('0x194')][_0xc8aa('0x19c')]};}if(this[_0xc8aa('0x82')](_0x32ba0f[_0xc8aa('0x19d')])){}logger['debug'](_0xc8aa('0x19e'),JSON[_0xc8aa('0x72')](_0x6437f3));this[_0xc8aa('0x3b')][_0xc8aa('0xd4')](this,_0x32ba0f,_0x32ba0f[_0xc8aa('0x190')]);this[_0xc8aa('0xf')][_0xc8aa('0xa7')](util[_0xc8aa('0x2c')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x317944[_0xc8aa('0x15')]));this['sendMailMessage']['sync'](this,_0x3e9b6c,_0x6437f3);return this[_0xc8aa('0xf')][_0xc8aa('0xa7')](_0xc8aa('0x19f'));};AGIVertices[_0xc8aa('0x11')]['sendFax']=function(_0x389a96){logger['info'](util[_0xc8aa('0x2c')](_0xc8aa('0x1a0'),_0x389a96[_0xc8aa('0x3d')]));return this[_0xc8aa('0xf')][_0xc8aa('0xa7')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0x1a1')]=function(_0x2bb715){logger[_0xc8aa('0x31')](util[_0xc8aa('0x2c')](_0xc8aa('0x1a2'),_0x2bb715[_0xc8aa('0x3d')]));if(!this['isConfigured'](_0x2bb715[_0xc8aa('0x1a3')])){return this[_0xc8aa('0xf')][_0xc8aa('0xa7')](_0xc8aa('0x1a4'));}var _0x243605=this[_0xc8aa('0x38')]['sync'](this,_0x2bb715[_0xc8aa('0x1a3')]);if(!_0x243605){return this[_0xc8aa('0xf')][_0xc8aa('0x53')](_0x2bb715,'no\x20sms\x20account\x20found');}var _0x43a3fb={'body':_0x2bb715[_0xc8aa('0x1a5')],'phone':_0x2bb715['to']||'','SmsAccountId':_0x243605['id']};logger[_0xc8aa('0xdf')](_0xc8aa('0x1a6'),JSON[_0xc8aa('0x72')](_0x43a3fb));this['createSquareDetailsReport'][_0xc8aa('0xd4')](this,_0x2bb715,_0x2bb715[_0xc8aa('0x1a3')]);this[_0xc8aa('0xf')][_0xc8aa('0xa7')](util[_0xc8aa('0x2c')](_0xc8aa('0x1a7'),_0x243605[_0xc8aa('0x15')]));this['createSmsMessage'][_0xc8aa('0xd4')](this,_0x43a3fb);return this[_0xc8aa('0xf')][_0xc8aa('0xa7')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0x1a8')]=function(_0x279cdc){logger[_0xc8aa('0x31')](util['format'](_0xc8aa('0x1a9'),_0x279cdc[_0xc8aa('0x3d')]));if(!this[_0xc8aa('0x82')](_0x279cdc[_0xc8aa('0xd8')])){return this['channel']['error'](_0x279cdc,_0xc8aa('0x1aa'));}var _0xf62e95=this[_0xc8aa('0x12')]['sync'](this,_0x279cdc[_0xc8aa('0xd8')]);if(!_0xf62e95){return this[_0xc8aa('0xf')][_0xc8aa('0x53')](_0x279cdc,_0xc8aa('0xd9'));}return this[_0xc8aa('0xf')][_0xc8aa('0xa2')](_0xf62e95,_0x279cdc[_0xc8aa('0x1ab')]);};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0x1ac')]=function(_0x2ff77b){logger['info'](util[_0xc8aa('0x2c')](_0xc8aa('0x1ad'),_0x2ff77b['label']));this['channel'][_0xc8aa('0xa7')](_0xc8aa('0x1ae'));if(_0x2ff77b[_0xc8aa('0xb4')]===_0xc8aa('0x1af')){this[_0xc8aa('0xf')][_0xc8aa('0xa7')]('Answer');return this['channel'][_0xc8aa('0xb4')]();}return this[_0xc8aa('0xf')][_0xc8aa('0xa7')]('Skipped\x20Answer');};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0x1b0')]=function(_0x474369){logger[_0xc8aa('0x31')](util[_0xc8aa('0x2c')](_0xc8aa('0x1b1'),_0x474369[_0xc8aa('0x3d')]));if(!this['isConfigured'](_0x474369['project_id'])){return this[_0xc8aa('0xf')][_0xc8aa('0x53')](_0x474369,_0xc8aa('0x1b2'));}var _0x8701bc=this[_0xc8aa('0x1b3')][_0xc8aa('0xd4')](this,_0x474369['project_id']);if(!this[_0xc8aa('0x82')](_0x8701bc)){return this['channel']['error'](_0x474369,util[_0xc8aa('0x2c')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x474369[_0xc8aa('0x1b4')]));}if(_0x8701bc===this[_0xc8aa('0xf')][_0xc8aa('0x3e')]){return this[_0xc8aa('0xf')][_0xc8aa('0x53')](_0x474369,_0xc8aa('0x1b5'));}this[_0xc8aa('0x3b')][_0xc8aa('0xd4')](this,_0x474369,_0x8701bc);var _0x50a767=this[_0xc8aa('0xf')][_0xc8aa('0x58')](_0xc8aa('0x1b6'),util['format']('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0xc8aa('0x8')]['host']||'127.0.0.1',_0x8701bc,this[_0xc8aa('0xf')][_0xc8aa('0x3e')]));if(_0x50a767[_0xc8aa('0xa8')]===-0x1){return _0x50a767;}return this[_0xc8aa('0xf')][_0xc8aa('0xa7')](util[_0xc8aa('0x2c')](_0xc8aa('0xc0'),_0xc8aa('0x1b6'),_0x8701bc));};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0x1b7')]=function(_0x2f9cce){logger[_0xc8aa('0x31')](util[_0xc8aa('0x2c')](_0xc8aa('0x1b8'),_0x2f9cce[_0xc8aa('0x3d')]));var _0x883b18=this['shellCommand'][_0xc8aa('0xd4')](this,_0x2f9cce['command']);this['createSquareDetailsReport'][_0xc8aa('0xd4')](this,_0x2f9cce,_0x2f9cce[_0xc8aa('0x1b9')]);if(this[_0xc8aa('0x82')](_0x2f9cce[_0xc8aa('0xd8')])){var _0x500c99=this[_0xc8aa('0x12')][_0xc8aa('0xd4')](this,_0x2f9cce[_0xc8aa('0xd8')]);if(_0x500c99){this[_0xc8aa('0xf')][_0xc8aa('0xa2')](_0x500c99,_0x883b18);return this[_0xc8aa('0xf')][_0xc8aa('0xa7')](util['format'](_0xc8aa('0x1ba'),_0x2f9cce['command'],_0x500c99));}}return this[_0xc8aa('0xf')][_0xc8aa('0xa7')](util[_0xc8aa('0x2c')](_0xc8aa('0x1bb'),_0x2f9cce[_0xc8aa('0x1b9')]));};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0x1bc')]=function(_0x3b6e00){logger[_0xc8aa('0x31')](util[_0xc8aa('0x2c')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x3b6e00[_0xc8aa('0x3d')]));_0x3b6e00[_0xc8aa('0x5c')]=_0x3b6e00['text'][_0xc8aa('0xd5')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xc8aa('0x82')](_0x3b6e00[_0xc8aa('0x1bd')])){return this[_0xc8aa('0xf')]['noop'](_0xc8aa('0x1be'));}if(!this[_0xc8aa('0x82')](_0x3b6e00[_0xc8aa('0x5c')])){return this[_0xc8aa('0xf')][_0xc8aa('0xa7')](_0xc8aa('0xc3'));}this[_0xc8aa('0xf')][_0xc8aa('0xa7')](util['format'](_0xc8aa('0x1bf'),_0x3b6e00[_0xc8aa('0x5c')]));var _0x20d720=this[_0xc8aa('0x5a')][_0xc8aa('0xd4')](this,_0x3b6e00);if(_0x20d720){this['channel']['noop'](util[_0xc8aa('0x2c')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x20d720));var _0xd0b124=this[_0xc8aa('0xf')][_0xc8aa('0x125')](_0x20d720);try{fs[_0xc8aa('0x106')](_0x20d720+'.wav');}catch(_0x29b080){logger[_0xc8aa('0x53')](_0x29b080);}return _0xd0b124;}return this[_0xc8aa('0xf')][_0xc8aa('0x53')](_0x3b6e00,_0xc8aa('0x1c0'));};AGIVertices['prototype'][_0xc8aa('0x1c1')]=function(_0x25ea7f){logger[_0xc8aa('0x31')](util['format'](_0xc8aa('0x1c2'),_0x25ea7f[_0xc8aa('0x3d')]));_0x25ea7f[_0xc8aa('0x5c')]=_0x25ea7f['text'][_0xc8aa('0xd5')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x25ea7f[_0xc8aa('0x5c')])){return this[_0xc8aa('0xf')][_0xc8aa('0xa7')](_0xc8aa('0xc3'));}this[_0xc8aa('0xf')]['noop'](util[_0xc8aa('0x2c')](_0xc8aa('0x1c3'),_0x25ea7f[_0xc8aa('0x5c')]));var _0x561614=this[_0xc8aa('0x61')][_0xc8aa('0xd4')](this,_0x25ea7f);if(_0x561614){this[_0xc8aa('0xf')][_0xc8aa('0xa7')](util[_0xc8aa('0x2c')](_0xc8aa('0x1c4'),_0x561614));var _0x4d14ca=this[_0xc8aa('0xf')]['streamFile'](_0x561614);try{fs[_0xc8aa('0x106')](_0x561614+_0xc8aa('0x107'));}catch(_0x1cd5df){logger[_0xc8aa('0x53')](_0x1cd5df);}return _0x4d14ca;}return this[_0xc8aa('0xf')]['error'](_0x25ea7f,_0xc8aa('0x1c5'));};AGIVertices[_0xc8aa('0x11')]['unpause']=function(_0x18dc88){logger[_0xc8aa('0x31')](util[_0xc8aa('0x2c')](_0xc8aa('0x1c6'),_0x18dc88['label']));if(!this[_0xc8aa('0x82')](_0x18dc88['findBy'])){return this[_0xc8aa('0xf')][_0xc8aa('0x53')](_0x18dc88,_0xc8aa('0x158'));}logger[_0xc8aa('0x31')](util['format'](_0xc8aa('0x15e'),this[_0xc8aa('0xf')][_0xc8aa('0x3f')],_0x18dc88[_0xc8aa('0x157')]));var _0x5dd905=this[_0xc8aa('0x1c7')][_0xc8aa('0xd4')](this,_0x18dc88[_0xc8aa('0x157')]);if(_0x5dd905){logger[_0xc8aa('0x31')](util[_0xc8aa('0x2c')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xc8aa('0xf')][_0xc8aa('0x3f')],_0x18dc88['findBy']));this[_0xc8aa('0xf')][_0xc8aa('0xa7')](util[_0xc8aa('0x2c')](_0xc8aa('0x159'),this[_0xc8aa('0xf')][_0xc8aa('0x3f')],_0x18dc88[_0xc8aa('0x157')]));return{'code':0xc8,'result':_0xc8aa('0x15a')};}else{logger[_0xc8aa('0x31')](util[_0xc8aa('0x2c')](_0xc8aa('0x15b'),this[_0xc8aa('0xf')][_0xc8aa('0x3f')],_0x18dc88[_0xc8aa('0x157')]));this[_0xc8aa('0xf')][_0xc8aa('0xa7')](util[_0xc8aa('0x2c')](_0xc8aa('0x15b'),this[_0xc8aa('0xf')][_0xc8aa('0x3f')],_0x18dc88[_0xc8aa('0x157')]));return{'code':0xc8,'result':_0xc8aa('0x15f')};}};AGIVertices['prototype']['voicemail']=function(_0x3b778d){logger[_0xc8aa('0x31')](util[_0xc8aa('0x2c')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x3b778d['label']));var _0x218ebe=this[_0xc8aa('0xf')][_0xc8aa('0x58')](_0xc8aa('0x1c8'),[_0x3b778d[_0xc8aa('0x1c9')],_0x3b778d[_0xc8aa('0x77')]]);if(_0x218ebe[_0xc8aa('0xa8')]===-0x1){return _0x218ebe;}return this['channel'][_0xc8aa('0xa7')](util[_0xc8aa('0x2c')]('Executed\x20command\x20%s\x20%s',_0xc8aa('0x1c8'),_0x3b778d[_0xc8aa('0x1c9')]));};AGIVertices[_0xc8aa('0x11')][_0xc8aa('0x1ca')]=function(_0x1e8e17){logger[_0xc8aa('0x31')](util[_0xc8aa('0x2c')](_0xc8aa('0x1cb'),_0x1e8e17[_0xc8aa('0x3d')]));if(!this[_0xc8aa('0x82')](_0x1e8e17[_0xc8aa('0xd8')])){return this['channel'][_0xc8aa('0x53')](_0x1e8e17,_0xc8aa('0x1aa'));}var _0x4c741f=this[_0xc8aa('0x12')][_0xc8aa('0xd4')](this,_0x1e8e17[_0xc8aa('0xd8')]);if(!_0x4c741f){return this['channel'][_0xc8aa('0x53')](_0x1e8e17,_0xc8aa('0xd9'));}var _0x12726a=this['channel'][_0xc8aa('0x12')](_0x4c741f);return{'code':0xc8,'result':_0x12726a[_0xc8aa('0xa0')]?_0x12726a[_0xc8aa('0xa0')]:'-'};};String[_0xc8aa('0x11')][_0xc8aa('0x9f')]=function(_0x320f1c,_0xb21ac){return this[_0xc8aa('0x9e')](_0x320f1c)['join'](_0xb21ac);};module[_0xc8aa('0x1cc')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 4b15960..1e56138 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 _0x1022=['acw','interface','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','all','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../ami','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','channels','agentconnect','syncAgentConnect','bind','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','seconds','prototype','startAcw','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','agents','getAgent','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','timers','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','updateAcw','update','uniqueid','catch','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ACWTIME:%s]','[%s][UPDATE][ERRORS:%s]','stringify','[ACW][STOP]\x20%s'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1022,0x174));var _0x2102=function(_0x5e49e4,_0x23fa81){_0x5e49e4=_0x5e49e4-0x0;var _0x376049=_0x1022[_0x5e49e4];return _0x376049;};'use strict';var util=require(_0x2102('0x0'));var _=require(_0x2102('0x1'));var moment=require(_0x2102('0x2'));var ami=require(_0x2102('0x3'));var logger=require(_0x2102('0x4'))('acw');var RpcUser=require(_0x2102('0x5'));var RpcVoiceAgentReport=require(_0x2102('0x6'));function Acw(_0x528ffa){this[_0x2102('0x7')]=_0x528ffa[_0x2102('0x7')];this['agents']=_0x528ffa['agents'];this['timers']=_0x528ffa['timers'];this[_0x2102('0x8')]={};ami['on'](_0x2102('0x9'),this[_0x2102('0xa')][_0x2102('0xb')](this));ami['on']('hanguprequest',this[_0x2102('0xc')][_0x2102('0xb')](this));ami['on'](_0x2102('0xd'),this[_0x2102('0xe')][_0x2102('0xb')](this));ami['on'](_0x2102('0xf'),this[_0x2102('0x10')][_0x2102('0xb')](this));ami['on'](_0x2102('0x11'),this['syncAttendedTransfer'][_0x2102('0xb')](this));ami['on'](_0x2102('0x12'),this[_0x2102('0x13')][_0x2102('0xb')](this));ami['on'](_0x2102('0x14'),this['syncAgentConnectPreview'][_0x2102('0xb')](this));}function getDiff(_0x260a42){var _0x3a293d=moment()['milliseconds'](0x0);var _0x42ae81=moment(_0x260a42)[_0x2102('0x15')](0x0);return _0x3a293d['diff'](_0x42ae81,_0x2102('0x16'));}Acw[_0x2102('0x17')][_0x2102('0x18')]=function(_0x102d8c){try{var _0x29364c=this;var _0x384fd0=this[_0x2102('0x8')][_0x102d8c]['interface'];var _0x14312a=this[_0x2102('0x8')][_0x102d8c][_0x2102('0x19')];var _0x266c6a=this[_0x2102('0x7')][_0x14312a];var _0x292b6a=![];var _0x56fe22=_0x2102('0x1a');if(_0x266c6a[_0x2102('0x1b')]){if(_0x266c6a[_0x2102('0x1c')][_0x2102('0x1d')]){_0x292b6a=!![];_0x56fe22=_0x266c6a['mandatoryDispositionPause'][_0x2102('0x1d')];}}ami[_0x2102('0x1e')]({'action':_0x2102('0x1f'),'interface':_0x384fd0,'paused':!![],'reason':_0x56fe22})['then'](function(_0x49977f){if(_0x29364c[_0x2102('0x20')][_0x384fd0]){return RpcUser[_0x2102('0x21')](_0x29364c[_0x2102('0x20')][_0x384fd0]['id'])[_0x2102('0x22')](function(_0x3b07f5){if(_0x3b07f5&&!_0x3b07f5[_0x2102('0x23')]){logger[_0x2102('0x24')](_0x2102('0x25'),_0x102d8c,_0x384fd0,_0x14312a);var _0x19f728=_0x29364c[_0x2102('0x8')][_0x102d8c][_0x2102('0x26')]&&_0x29364c[_0x2102('0x8')][_0x102d8c]['destlinkedid']?_0x29364c[_0x2102('0x8')][_0x102d8c][_0x2102('0x27')]:_0x102d8c;return RpcUser[_0x2102('0x28')](_0x29364c[_0x2102('0x20')][_0x384fd0],_0x56fe22,_0x19f728)[_0x2102('0x22')](function(_0x4a1d92){if(!_0x292b6a){_0x29364c[_0x2102('0x29')][_0x384fd0]={};logger[_0x2102('0x24')](_0x2102('0x2a'),_0x102d8c,_0x29364c[_0x2102('0x7')][_0x14312a][_0x2102('0x2b')],_0x384fd0,_0x14312a);_0x29364c['timers'][_0x384fd0][_0x2102('0x2c')]=setTimeout(_0x29364c[_0x2102('0x2d')][_0x2102('0xb')](_0x29364c,_0x384fd0),_0x29364c[_0x2102('0x7')][_0x14312a]['acwTimeout']*0x3e8);_0x29364c['timers'][_0x384fd0][_0x2102('0x2e')]=moment()[_0x2102('0x2f')](_0x2102('0x30'));_0x29364c[_0x2102('0x29')][_0x384fd0]['uniqueid']=_0x102d8c;_0x29364c[_0x2102('0x29')][_0x384fd0][_0x2102('0x19')]=_0x14312a;_0x29364c[_0x2102('0x29')][_0x384fd0][_0x2102('0x31')]=function(){var _0x2bfc4c=getDiff(_0x29364c[_0x2102('0x29')][_0x384fd0][_0x2102('0x2e')]);clearTimeout(_0x29364c['timers'][_0x384fd0][_0x2102('0x2c')]);_0x29364c[_0x2102('0x29')][_0x384fd0][_0x2102('0x2c')]=![];RpcVoiceAgentReport[_0x2102('0x32')]({'acwtime':_0x2bfc4c},_0x29364c['timers'][_0x384fd0][_0x2102('0x33')],_0x384fd0)['then'](function(_0x5b13b2){logger['info']('[%s][UPDATE][ACWTIME:%s]',_0x102d8c,_0x2bfc4c,_0x5b13b2);})[_0x2102('0x34')](function(_0x4d3795){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x102d8c,_0x4d3795);});delete _0x29364c[_0x2102('0x29')][_0x384fd0];};}});}else{logger['info'](_0x2102('0x35'),_0x102d8c,_0x384fd0,_0x14312a);}});}})['catch'](function(_0x48aa77){logger['error']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x102d8c,_0x29364c[_0x2102('0x7')][_0x14312a][_0x2102('0x2b')],_0x384fd0,_0x14312a);})['finally'](function(){delete _0x29364c[_0x2102('0x8')][_0x102d8c];});}catch(_0x59a81b){logger[_0x2102('0x36')](_0x2102('0x37'),_0x59a81b[_0x2102('0x38')]);}};Acw[_0x2102('0x17')][_0x2102('0x2d')]=function(_0x68b9c1){try{var _0x172069=this;if(_0x172069['timers'][_0x68b9c1]){_0x172069['timers'][_0x68b9c1][_0x2102('0x2c')]=![];var _0x1253f5=_0x172069[_0x2102('0x29')][_0x68b9c1]['uniqueid'];var _0x326b3d=_0x172069[_0x2102('0x29')][_0x68b9c1][_0x2102('0x19')];var _0x3826c6=_0x172069[_0x2102('0x7')][_0x326b3d]['acwTimeout'];logger[_0x2102('0x24')](_0x2102('0x39'),_0x1253f5,_0x68b9c1);RpcUser[_0x2102('0x3a')](this['agents'][_0x68b9c1]);RpcVoiceAgentReport['update']({'acwtime':_0x3826c6,'agentacw':!![]},_0x1253f5,_0x68b9c1)[_0x2102('0x22')](function(_0x3491ae){logger['info'](_0x2102('0x3b'),_0x1253f5,_0x3826c6,_0x3491ae);})[_0x2102('0x34')](function(_0x51ff61){logger[_0x2102('0x36')](_0x2102('0x3c'),_0x1253f5,_0x51ff61);});}else{logger[_0x2102('0x36')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x68b9c1);if(_0x172069[_0x2102('0x29')]){logger['info']('[ACW][TIMERS]',JSON[_0x2102('0x3d')](_0x172069[_0x2102('0x29')]));}}}catch(_0x521b86){logger[_0x2102('0x36')](_0x2102('0x3e'),_0x521b86[_0x2102('0x38')]);}};Acw[_0x2102('0x17')][_0x2102('0xa')]=function(_0x29f59a){try{if(this[_0x2102('0x7')][_0x29f59a[_0x2102('0x19')]]&&(this[_0x2102('0x7')][_0x29f59a['queue']][_0x2102('0x3f')]||this[_0x2102('0x7')][_0x29f59a[_0x2102('0x19')]]['mandatoryDisposition'])){if(this[_0x2102('0x20')][_0x29f59a[_0x2102('0x40')]]){this[_0x2102('0x8')][_0x29f59a[_0x2102('0x33')]]={'queue':_0x29f59a[_0x2102('0x19')],'interface':_0x29f59a[_0x2102('0x40')],'destlinkedid':_0x29f59a[_0x2102('0x27')]};}}}catch(_0x18bb8c){logger[_0x2102('0x36')](_0x2102('0x41'),_0x18bb8c[_0x2102('0x38')]);}};Acw[_0x2102('0x17')][_0x2102('0x42')]=function(_0x1e5052){try{if(this[_0x2102('0x7')][_0x1e5052[_0x2102('0x19')]]&&(this[_0x2102('0x7')][_0x1e5052['queue']][_0x2102('0x3f')]||this['voiceQueues'][_0x1e5052['queue']][_0x2102('0x1b')])){if(this[_0x2102('0x20')][_0x1e5052[_0x2102('0x40')]]){this[_0x2102('0x8')][_0x1e5052[_0x2102('0x33')]]={'queue':_0x1e5052[_0x2102('0x19')],'interface':_0x1e5052[_0x2102('0x40')]};}}}catch(_0x3cbd8){logger[_0x2102('0x36')](_0x2102('0x43'),_0x3cbd8['message']);}};Acw[_0x2102('0x17')][_0x2102('0xc')]=function(_0x27e3b8){try{if(this[_0x2102('0x8')][_0x27e3b8[_0x2102('0x33')]]&&_[_0x2102('0x44')](this[_0x2102('0x8')][_0x27e3b8['uniqueid']][_0x2102('0x26')])){logger[_0x2102('0x24')]('[%s][HANGUP:UNIQUEID]',_0x27e3b8[_0x2102('0x33')]);this[_0x2102('0x18')](_0x27e3b8[_0x2102('0x33')]);}else if(this[_0x2102('0x8')][_0x27e3b8[_0x2102('0x45')]]&&_[_0x2102('0x44')](this[_0x2102('0x8')][_0x27e3b8[_0x2102('0x45')]]['attended'])){logger[_0x2102('0x24')](_0x2102('0x46'),_0x27e3b8[_0x2102('0x45')]);this[_0x2102('0x18')](_0x27e3b8['linkedid']);}}catch(_0xf0949){logger[_0x2102('0x36')]('[ACW][syncHangupRequest]\x20%s',_0xf0949[_0x2102('0x38')]);}};Acw[_0x2102('0x17')][_0x2102('0xe')]=function(_0x415556){try{if(this['channels'][_0x415556[_0x2102('0x33')]]&&this['channels'][_0x415556[_0x2102('0x33')]][_0x2102('0x26')]){logger[_0x2102('0x24')](_0x2102('0x47'),_0x415556[_0x2102('0x33')]);this[_0x2102('0x18')](_0x415556[_0x2102('0x33')]);}else if(this['channels'][_0x415556[_0x2102('0x45')]]&&this[_0x2102('0x8')][_0x415556[_0x2102('0x45')]][_0x2102('0x26')]){logger['info'](_0x2102('0x48'),_0x415556[_0x2102('0x45')]);this[_0x2102('0x18')](_0x415556[_0x2102('0x45')]);}}catch(_0x28c384){logger[_0x2102('0x36')](_0x2102('0x49'),_0x28c384[_0x2102('0x38')]);}};Acw['prototype']['syncAttendedTransfer']=function(_0x465534){try{if(!_['isNil'](this['channels'][_0x465534[_0x2102('0x4a')]])){this[_0x2102('0x18')](_0x465534[_0x2102('0x4a')]);if(this[_0x2102('0x8')][_0x465534[_0x2102('0x4b')]]){this[_0x2102('0x8')][_0x465534[_0x2102('0x4b')]]['attended']=!![];this['channels'][_0x465534[_0x2102('0x4c')]]=this[_0x2102('0x8')][_0x465534[_0x2102('0x4b')]];delete this['channels'][_0x465534[_0x2102('0x4b')]];}}else if(!_['isNil'](this[_0x2102('0x8')][_0x465534['transfertargetuniqueid']])){this[_0x2102('0x18')](_0x465534[_0x2102('0x4c')]);if(this[_0x2102('0x8')][_0x465534[_0x2102('0x4d')]]){this['channels'][_0x465534[_0x2102('0x4d')]][_0x2102('0x26')]=!![];this[_0x2102('0x8')][_0x465534['transfereeuniqueid']]=this[_0x2102('0x8')][_0x465534[_0x2102('0x4d')]];delete this[_0x2102('0x8')][_0x465534['origtransfereruniqueid']];}}}catch(_0x421fc1){logger[_0x2102('0x36')](_0x2102('0x4e'),_0x421fc1[_0x2102('0x38')]);}};Acw['prototype'][_0x2102('0x13')]=function(_0x209b5c){try{if(this[_0x2102('0x8')][_0x209b5c[_0x2102('0x4f')]]){logger[_0x2102('0x24')](_0x2102('0x50'),JSON[_0x2102('0x3d')](_0x209b5c[_0x2102('0x4f')]));this[_0x2102('0x18')](_0x209b5c[_0x2102('0x4f')]);}else if(this[_0x2102('0x8')][_0x209b5c[_0x2102('0x51')]]){logger[_0x2102('0x24')](_0x2102('0x52'),JSON[_0x2102('0x3d')](_0x209b5c[_0x2102('0x51')]));this[_0x2102('0x18')](_0x209b5c['transfererlinkedid']);}}catch(_0x144781){logger[_0x2102('0x36')](_0x2102('0x53'),_0x144781['message']);}};Acw[_0x2102('0x17')]['syncAgentRingNoAnswer']=function(_0x554ffb){try{if(this[_0x2102('0x7')][_0x554ffb[_0x2102('0x19')]]&&this[_0x2102('0x7')][_0x554ffb[_0x2102('0x19')]]['autopause']===_0x2102('0x54')){if(this[_0x2102('0x20')][_0x554ffb[_0x2102('0x40')]]){logger[_0x2102('0x24')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x554ffb[_0x2102('0x33')],_0x554ffb['interface'],_0x554ffb[_0x2102('0x19')]);return RpcUser['savePause'](this[_0x2102('0x20')][_0x554ffb[_0x2102('0x40')]],'Auto-Pause',_0x554ffb[_0x2102('0x33')]);}}}catch(_0x22bfe4){logger['error'](_0x2102('0x55'),_0x22bfe4[_0x2102('0x38')]);}};module[_0x2102('0x56')]=Acw; \ No newline at end of file +var _0x9b33=['syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','channels','interface','queue','ACW','mandatoryDisposition','name','mandatoryDispositionPause','Action','QueuePause','then','agents','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','voiceQueues','lastPauseAt','uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','error','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','attended','[%s][HANGUP:LINKEDID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','util','lodash','moment','../ami','acw','../rpc/voiceAgentReport','timers','agentconnect','syncAgentConnect','bind','syncHangupRequest','hangup','syncHangup','agentringnoanswer'];(function(_0x3eb521,_0xf61d67){var _0x5a85c9=function(_0x5c8c9a){while(--_0x5c8c9a){_0x3eb521['push'](_0x3eb521['shift']());}};_0x5a85c9(++_0xf61d67);}(_0x9b33,0x18c));var _0x39b3=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0x9b33[_0x9fd887];return _0x1a54ab;};'use strict';var util=require(_0x39b3('0x0'));var _=require(_0x39b3('0x1'));var moment=require(_0x39b3('0x2'));var ami=require(_0x39b3('0x3'));var logger=require('../../../config/logger')(_0x39b3('0x4'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x39b3('0x5'));function Acw(_0xdfe7f5){this['voiceQueues']=_0xdfe7f5['voiceQueues'];this['agents']=_0xdfe7f5['agents'];this['timers']=_0xdfe7f5[_0x39b3('0x6')];this['channels']={};ami['on'](_0x39b3('0x7'),this[_0x39b3('0x8')][_0x39b3('0x9')](this));ami['on']('hanguprequest',this[_0x39b3('0xa')]['bind'](this));ami['on'](_0x39b3('0xb'),this[_0x39b3('0xc')][_0x39b3('0x9')](this));ami['on'](_0x39b3('0xd'),this[_0x39b3('0xe')][_0x39b3('0x9')](this));ami['on'](_0x39b3('0xf'),this[_0x39b3('0x10')]['bind'](this));ami['on'](_0x39b3('0x11'),this[_0x39b3('0x12')][_0x39b3('0x9')](this));ami['on'](_0x39b3('0x13'),this[_0x39b3('0x14')][_0x39b3('0x9')](this));}function getDiff(_0x1834b4){var _0x4d137c=moment()[_0x39b3('0x15')](0x0);var _0x569920=moment(_0x1834b4)[_0x39b3('0x15')](0x0);return _0x4d137c[_0x39b3('0x16')](_0x569920,_0x39b3('0x17'));}Acw[_0x39b3('0x18')]['startAcw']=function(_0x18e7e2){try{var _0x579615=this;var _0x3a91ac=this[_0x39b3('0x19')][_0x18e7e2][_0x39b3('0x1a')];var _0x34ba38=this['channels'][_0x18e7e2][_0x39b3('0x1b')];var _0x1f61b9=this['voiceQueues'][_0x34ba38];var _0x1c3e47=![];var _0x61a8c5=_0x39b3('0x1c');if(_0x1f61b9[_0x39b3('0x1d')]){if(_0x1f61b9['mandatoryDispositionPause'][_0x39b3('0x1e')]){_0x1c3e47=!![];_0x61a8c5=_0x1f61b9[_0x39b3('0x1f')][_0x39b3('0x1e')];}}ami[_0x39b3('0x20')]({'action':_0x39b3('0x21'),'interface':_0x3a91ac,'paused':!![],'reason':_0x61a8c5})[_0x39b3('0x22')](function(_0x49d25b){if(_0x579615[_0x39b3('0x23')][_0x3a91ac]){return RpcUser['getAgent'](_0x579615[_0x39b3('0x23')][_0x3a91ac]['id'])[_0x39b3('0x22')](function(_0x4d86f5){if(_0x4d86f5&&!_0x4d86f5[_0x39b3('0x24')]){logger[_0x39b3('0x25')](_0x39b3('0x26'),_0x18e7e2,_0x3a91ac,_0x34ba38);var _0x511fff=_0x579615[_0x39b3('0x19')][_0x18e7e2]['attended']&&_0x579615['channels'][_0x18e7e2][_0x39b3('0x27')]?_0x579615['channels'][_0x18e7e2][_0x39b3('0x27')]:_0x18e7e2;return RpcUser[_0x39b3('0x28')](_0x579615['agents'][_0x3a91ac],_0x61a8c5,_0x511fff)['then'](function(_0x1d623c){if(!_0x1c3e47){_0x579615[_0x39b3('0x6')][_0x3a91ac]={};logger[_0x39b3('0x25')](_0x39b3('0x29'),_0x18e7e2,_0x579615['voiceQueues'][_0x34ba38][_0x39b3('0x2a')],_0x3a91ac,_0x34ba38);_0x579615[_0x39b3('0x6')][_0x3a91ac][_0x39b3('0x2b')]=setTimeout(_0x579615['stopAcw'][_0x39b3('0x9')](_0x579615,_0x3a91ac),_0x579615[_0x39b3('0x2c')][_0x34ba38]['acwTimeout']*0x3e8);_0x579615[_0x39b3('0x6')][_0x3a91ac][_0x39b3('0x2d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x579615[_0x39b3('0x6')][_0x3a91ac][_0x39b3('0x2e')]=_0x18e7e2;_0x579615['timers'][_0x3a91ac][_0x39b3('0x1b')]=_0x34ba38;_0x579615[_0x39b3('0x6')][_0x3a91ac][_0x39b3('0x2f')]=function(){var _0x35cf2e=getDiff(_0x579615[_0x39b3('0x6')][_0x3a91ac][_0x39b3('0x2d')]);clearTimeout(_0x579615[_0x39b3('0x6')][_0x3a91ac]['timer']);_0x579615[_0x39b3('0x6')][_0x3a91ac][_0x39b3('0x2b')]=![];RpcVoiceAgentReport[_0x39b3('0x30')]({'acwtime':_0x35cf2e},_0x579615['timers'][_0x3a91ac][_0x39b3('0x2e')],_0x3a91ac)[_0x39b3('0x22')](function(_0x267b4b){logger['info'](_0x39b3('0x31'),_0x18e7e2,_0x35cf2e,_0x267b4b);})['catch'](function(_0x2f9d2b){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x18e7e2,_0x2f9d2b);});delete _0x579615[_0x39b3('0x6')][_0x3a91ac];};}});}else{logger[_0x39b3('0x25')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x18e7e2,_0x3a91ac,_0x34ba38);}});}})[_0x39b3('0x32')](function(_0x19186b){logger[_0x39b3('0x33')](_0x39b3('0x29'),_0x18e7e2,_0x579615[_0x39b3('0x2c')][_0x34ba38][_0x39b3('0x2a')],_0x3a91ac,_0x34ba38);})[_0x39b3('0x34')](function(){delete _0x579615[_0x39b3('0x19')][_0x18e7e2];});}catch(_0x676495){logger['error'](_0x39b3('0x35'),_0x676495[_0x39b3('0x36')]);}};Acw['prototype']['stopAcw']=function(_0x23856a){try{var _0x1f6f9b=this;if(_0x1f6f9b[_0x39b3('0x6')][_0x23856a]){_0x1f6f9b[_0x39b3('0x6')][_0x23856a][_0x39b3('0x2b')]=![];var _0x47e059=_0x1f6f9b[_0x39b3('0x6')][_0x23856a][_0x39b3('0x2e')];var _0x1efe5e=_0x1f6f9b[_0x39b3('0x6')][_0x23856a][_0x39b3('0x1b')];var _0x33fdef=_0x1f6f9b[_0x39b3('0x2c')][_0x1efe5e][_0x39b3('0x2a')];logger[_0x39b3('0x25')](_0x39b3('0x37'),_0x47e059,_0x23856a);RpcUser[_0x39b3('0x38')](this['agents'][_0x23856a]);RpcVoiceAgentReport['update']({'acwtime':_0x33fdef,'agentacw':!![]},_0x47e059,_0x23856a)[_0x39b3('0x22')](function(_0x3453f5){logger[_0x39b3('0x25')](_0x39b3('0x31'),_0x47e059,_0x33fdef,_0x3453f5);})[_0x39b3('0x32')](function(_0x2e9269){logger[_0x39b3('0x33')](_0x39b3('0x39'),_0x47e059,_0x2e9269);});}else{logger[_0x39b3('0x33')](_0x39b3('0x3a'),_0x23856a);if(_0x1f6f9b[_0x39b3('0x6')]){logger[_0x39b3('0x25')]('[ACW][TIMERS]',JSON['stringify'](_0x1f6f9b[_0x39b3('0x6')]));}}}catch(_0x53d58c){logger[_0x39b3('0x33')]('[ACW][STOP]\x20%s',_0x53d58c[_0x39b3('0x36')]);}};Acw[_0x39b3('0x18')][_0x39b3('0x8')]=function(_0xa790e1){try{if(this[_0x39b3('0x2c')][_0xa790e1[_0x39b3('0x1b')]]&&(this[_0x39b3('0x2c')][_0xa790e1[_0x39b3('0x1b')]][_0x39b3('0x4')]||this[_0x39b3('0x2c')][_0xa790e1[_0x39b3('0x1b')]][_0x39b3('0x1d')])){if(this[_0x39b3('0x23')][_0xa790e1[_0x39b3('0x1a')]]){this[_0x39b3('0x19')][_0xa790e1[_0x39b3('0x2e')]]={'queue':_0xa790e1['queue'],'interface':_0xa790e1['interface'],'destlinkedid':_0xa790e1[_0x39b3('0x27')]};}}}catch(_0x15afb){logger['error']('[ACW][syncAgentConnect]\x20%s',_0x15afb[_0x39b3('0x36')]);}};Acw[_0x39b3('0x18')]['syncAgentConnectPreview']=function(_0x4f0702){try{if(this[_0x39b3('0x2c')][_0x4f0702[_0x39b3('0x1b')]]&&(this[_0x39b3('0x2c')][_0x4f0702[_0x39b3('0x1b')]][_0x39b3('0x4')]||this['voiceQueues'][_0x4f0702[_0x39b3('0x1b')]][_0x39b3('0x1d')])){if(this[_0x39b3('0x23')][_0x4f0702['interface']]){this[_0x39b3('0x19')][_0x4f0702['uniqueid']]={'queue':_0x4f0702['queue'],'interface':_0x4f0702['interface']};}}}catch(_0x3f0c15){logger[_0x39b3('0x33')](_0x39b3('0x3b'),_0x3f0c15[_0x39b3('0x36')]);}};Acw[_0x39b3('0x18')][_0x39b3('0xa')]=function(_0x55c0ad){try{if(this[_0x39b3('0x19')][_0x55c0ad['uniqueid']]&&_[_0x39b3('0x3c')](this[_0x39b3('0x19')][_0x55c0ad['uniqueid']]['attended'])){logger[_0x39b3('0x25')](_0x39b3('0x3d'),_0x55c0ad[_0x39b3('0x2e')]);this[_0x39b3('0x3e')](_0x55c0ad[_0x39b3('0x2e')]);}else if(this['channels'][_0x55c0ad[_0x39b3('0x3f')]]&&_[_0x39b3('0x3c')](this[_0x39b3('0x19')][_0x55c0ad['linkedid']][_0x39b3('0x40')])){logger['info'](_0x39b3('0x41'),_0x55c0ad['linkedid']);this['startAcw'](_0x55c0ad['linkedid']);}}catch(_0x44061d){logger['error']('[ACW][syncHangupRequest]\x20%s',_0x44061d[_0x39b3('0x36')]);}};Acw[_0x39b3('0x18')]['syncHangup']=function(_0x1ebd4c){try{if(this[_0x39b3('0x19')][_0x1ebd4c[_0x39b3('0x2e')]]&&this['channels'][_0x1ebd4c[_0x39b3('0x2e')]][_0x39b3('0x40')]){logger[_0x39b3('0x25')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x1ebd4c[_0x39b3('0x2e')]);this[_0x39b3('0x3e')](_0x1ebd4c['uniqueid']);}else if(this[_0x39b3('0x19')][_0x1ebd4c[_0x39b3('0x3f')]]&&this['channels'][_0x1ebd4c['linkedid']][_0x39b3('0x40')]){logger['info']('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x1ebd4c['linkedid']);this[_0x39b3('0x3e')](_0x1ebd4c[_0x39b3('0x3f')]);}}catch(_0x36d9fc){logger[_0x39b3('0x33')](_0x39b3('0x42'),_0x36d9fc[_0x39b3('0x36')]);}};Acw[_0x39b3('0x18')][_0x39b3('0x10')]=function(_0xa47f7e){try{if(!_['isNil'](this[_0x39b3('0x19')][_0xa47f7e[_0x39b3('0x43')]])){this[_0x39b3('0x3e')](_0xa47f7e[_0x39b3('0x43')]);if(this[_0x39b3('0x19')][_0xa47f7e[_0x39b3('0x44')]]){this[_0x39b3('0x19')][_0xa47f7e[_0x39b3('0x44')]][_0x39b3('0x40')]=!![];this[_0x39b3('0x19')][_0xa47f7e[_0x39b3('0x45')]]=this[_0x39b3('0x19')][_0xa47f7e['secondtransfereruniqueid']];delete this['channels'][_0xa47f7e['secondtransfereruniqueid']];}}else if(!_[_0x39b3('0x46')](this[_0x39b3('0x19')][_0xa47f7e[_0x39b3('0x45')]])){this[_0x39b3('0x3e')](_0xa47f7e[_0x39b3('0x45')]);if(this['channels'][_0xa47f7e[_0x39b3('0x47')]]){this[_0x39b3('0x19')][_0xa47f7e['origtransfereruniqueid']]['attended']=!![];this[_0x39b3('0x19')][_0xa47f7e[_0x39b3('0x43')]]=this[_0x39b3('0x19')][_0xa47f7e['origtransfereruniqueid']];delete this[_0x39b3('0x19')][_0xa47f7e['origtransfereruniqueid']];}}}catch(_0x4bce91){logger[_0x39b3('0x33')](_0x39b3('0x48'),_0x4bce91[_0x39b3('0x36')]);}};Acw[_0x39b3('0x18')]['syncBlindTransfer']=function(_0x44db2b){try{if(this[_0x39b3('0x19')][_0x44db2b[_0x39b3('0x49')]]){logger['info'](_0x39b3('0x4a'),JSON[_0x39b3('0x4b')](_0x44db2b['transfereruniqueid']));this[_0x39b3('0x3e')](_0x44db2b['transfereruniqueid']);}else if(this[_0x39b3('0x19')][_0x44db2b[_0x39b3('0x4c')]]){logger[_0x39b3('0x25')](_0x39b3('0x4d'),JSON['stringify'](_0x44db2b['transfererlinkedid']));this[_0x39b3('0x3e')](_0x44db2b[_0x39b3('0x4c')]);}}catch(_0x51ff3f){logger[_0x39b3('0x33')](_0x39b3('0x4e'),_0x51ff3f[_0x39b3('0x36')]);}};Acw['prototype'][_0x39b3('0xe')]=function(_0x37467d){try{if(this[_0x39b3('0x2c')][_0x37467d['queue']]&&this[_0x39b3('0x2c')][_0x37467d[_0x39b3('0x1b')]][_0x39b3('0x4f')]==='all'){if(this['agents'][_0x37467d[_0x39b3('0x1a')]]){logger[_0x39b3('0x25')](_0x39b3('0x50'),_0x37467d['uniqueid'],_0x37467d[_0x39b3('0x1a')],_0x37467d[_0x39b3('0x1b')]);return RpcUser[_0x39b3('0x28')](this[_0x39b3('0x23')][_0x37467d[_0x39b3('0x1a')]],_0x39b3('0x51'),_0x37467d['uniqueid']);}}}catch(_0x11e4d5){logger['error']('[ACW][syncAgentRingNoAnswer]\x20%s',_0x11e4d5['message']);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index c847583..dfc81f1 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 _0x0836=['actionCoreShowChannels','coreshowchannels','info','once','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','resolve','then','actionQueueSummary','catch','close','exports','asterisk-manager','moment','util','lodash','ami','../../config/environment','asterisk','username','password','keepConnected','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','port','inspect','Action','sipshowregistry','actionDeviceStateList','actionSipPeerStatus','queuesummary'];(function(_0x14f3bd,_0x5026b7){var _0x4f6bb9=function(_0x5aac9e){while(--_0x5aac9e){_0x14f3bd['push'](_0x14f3bd['shift']());}};_0x4f6bb9(++_0x5026b7);}(_0x0836,0xc2));var _0x6083=function(_0x49f1fc,_0x4ca5a9){_0x49f1fc=_0x49f1fc-0x0;var _0x2554a6=_0x0836[_0x49f1fc];return _0x2554a6;};'use strict';var Manager=require(_0x6083('0x0'));var BPromise=require('bluebird');var moment=require(_0x6083('0x1'));var util=require(_0x6083('0x2'));var _=require(_0x6083('0x3'));var logger=require('../../config/logger')(_0x6083('0x4'));var config=require(_0x6083('0x5'));var ami=new Manager(config[_0x6083('0x6')]['port'],config['asterisk']['ip'],config[_0x6083('0x6')][_0x6083('0x7')],config[_0x6083('0x6')][_0x6083('0x8')],!![]);ami[_0x6083('0x9')]();ami['Action']=BPromise[_0x6083('0xa')](ami[_0x6083('0xb')]);function error(_0x2c0f02){logger[_0x6083('0xc')](util[_0x6083('0xd')](_0x6083('0xe'),config[_0x6083('0x6')]['username'],config['asterisk']['ip'],config[_0x6083('0x6')][_0x6083('0xf')],util[_0x6083('0x10')](_0x2c0f02,![],null)));}function close(){logger['error'](util[_0x6083('0xd')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0x6083('0x6')][_0x6083('0x7')],config[_0x6083('0x6')]['ip'],config['asterisk'][_0x6083('0xf')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x6083('0x11')]({'action':_0x6083('0x12')});};};ami[_0x6083('0x13')]=function(){return function(){return ami['Action']({'action':'devicestatelist'});};};ami[_0x6083('0x14')]=function(){return function(){return ami[_0x6083('0x11')]({'action':'sippeerstatus'});};};ami['actionQueueSummary']=function(){return function(){return ami[_0x6083('0x11')]({'action':_0x6083('0x15')});};};ami[_0x6083('0x16')]=function(){return function(){return ami[_0x6083('0x11')]({'action':_0x6083('0x17')});};};function connect(_0x5c6cd0){logger[_0x6083('0x18')](util[_0x6083('0xd')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0x6083('0x6')][_0x6083('0x7')],config[_0x6083('0x6')]['ip'],config[_0x6083('0x6')][_0x6083('0xf')]));ami[_0x6083('0x19')](_0x6083('0xc'),error);ami[_0x6083('0x19')]('close',close);}ami['on'](_0x6083('0x1a'),connect);ami['on'](_0x6083('0x1b'),function(_0x32e8e6){logger[_0x6083('0x18')](util['format'](_0x6083('0x1c'),config[_0x6083('0x6')][_0x6083('0x7')],config['asterisk']['ip'],config[_0x6083('0x6')][_0x6083('0xf')],util[_0x6083('0x10')](_0x32e8e6,![],null)));});ami['on'](_0x6083('0x1d'),function(_0x31101e){logger[_0x6083('0x18')](util[_0x6083('0xd')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x6083('0x6')][_0x6083('0x7')],config[_0x6083('0x6')]['ip'],config[_0x6083('0x6')][_0x6083('0xf')]));return BPromise[_0x6083('0x1e')]()[_0x6083('0x1f')](ami['actionSipShowRegistry']())[_0x6083('0x1f')](ami[_0x6083('0x13')]())[_0x6083('0x1f')](ami[_0x6083('0x14')]())[_0x6083('0x1f')](ami[_0x6083('0x20')]())[_0x6083('0x1f')](ami[_0x6083('0x16')]())[_0x6083('0x21')](function(_0x3b4159){console['log'](_0x3b4159);});});ami['once']('error',error);ami[_0x6083('0x19')](_0x6083('0x22'),close);module[_0x6083('0x23')]=ami; \ No newline at end of file +var _0xefa2=['moment','util','lodash','ami','../../config/environment','asterisk','port','password','keepConnected','promisify','action','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','inspect','error','format','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','Action','sipshowregistry','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','coreshowchannels','info','once','close','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','actionDeviceStateList','actionCoreShowChannels','exports','asterisk-manager'];(function(_0x308afc,_0x72dc19){var _0x41f28d=function(_0x10e8e2){while(--_0x10e8e2){_0x308afc['push'](_0x308afc['shift']());}};_0x41f28d(++_0x72dc19);}(_0xefa2,0x127));var _0x2efa=function(_0x4a7ab2,_0x59dfa8){_0x4a7ab2=_0x4a7ab2-0x0;var _0x272dbc=_0xefa2[_0x4a7ab2];return _0x272dbc;};'use strict';var Manager=require(_0x2efa('0x0'));var BPromise=require('bluebird');var moment=require(_0x2efa('0x1'));var util=require(_0x2efa('0x2'));var _=require(_0x2efa('0x3'));var logger=require('../../config/logger')(_0x2efa('0x4'));var config=require(_0x2efa('0x5'));var ami=new Manager(config[_0x2efa('0x6')][_0x2efa('0x7')],config[_0x2efa('0x6')]['ip'],config[_0x2efa('0x6')]['username'],config[_0x2efa('0x6')][_0x2efa('0x8')],!![]);ami[_0x2efa('0x9')]();ami['Action']=BPromise[_0x2efa('0xa')](ami[_0x2efa('0xb')]);function error(_0x18154e){logger['error'](util['format'](_0x2efa('0xc'),config[_0x2efa('0x6')][_0x2efa('0xd')],config[_0x2efa('0x6')]['ip'],config[_0x2efa('0x6')][_0x2efa('0x7')],util[_0x2efa('0xe')](_0x18154e,![],null)));}function close(){logger[_0x2efa('0xf')](util[_0x2efa('0x10')](_0x2efa('0x11'),config[_0x2efa('0x6')]['username'],config[_0x2efa('0x6')]['ip'],config['asterisk'][_0x2efa('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x2efa('0x12')]({'action':_0x2efa('0x13')});};};ami['actionDeviceStateList']=function(){return function(){return ami['Action']({'action':_0x2efa('0x14')});};};ami[_0x2efa('0x15')]=function(){return function(){return ami[_0x2efa('0x12')]({'action':_0x2efa('0x16')});};};ami['actionQueueSummary']=function(){return function(){return ami[_0x2efa('0x12')]({'action':_0x2efa('0x17')});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0x2efa('0x12')]({'action':_0x2efa('0x18')});};};function connect(_0x336be6){logger[_0x2efa('0x19')](util[_0x2efa('0x10')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0x2efa('0x6')][_0x2efa('0xd')],config['asterisk']['ip'],config[_0x2efa('0x6')][_0x2efa('0x7')]));ami['once'](_0x2efa('0xf'),error);ami[_0x2efa('0x1a')](_0x2efa('0x1b'),close);}ami['on']('connect',connect);ami['on'](_0x2efa('0x1c'),function(_0x5dde65){logger[_0x2efa('0x19')](util[_0x2efa('0x10')](_0x2efa('0x1d'),config[_0x2efa('0x6')][_0x2efa('0xd')],config[_0x2efa('0x6')]['ip'],config[_0x2efa('0x6')]['port'],util['inspect'](_0x5dde65,![],null)));});ami['on']('fullybooted',function(_0x322b57){logger['info'](util[_0x2efa('0x10')](_0x2efa('0x1e'),config[_0x2efa('0x6')][_0x2efa('0xd')],config[_0x2efa('0x6')]['ip'],config['asterisk'][_0x2efa('0x7')]));return BPromise[_0x2efa('0x1f')]()[_0x2efa('0x20')](ami[_0x2efa('0x21')]())['then'](ami[_0x2efa('0x22')]())['then'](ami[_0x2efa('0x15')]())[_0x2efa('0x20')](ami['actionQueueSummary']())['then'](ami[_0x2efa('0x23')]())['catch'](function(_0x561282){console['log'](_0x561282);});});ami[_0x2efa('0x1a')]('error',error);ami['once'](_0x2efa('0x1b'),close);module[_0x2efa('0x24')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 2c14cc2..bc99c1f 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 _0xb7e7=['exports','jayson/promise','../../config/logger','client','Request','debug','rpc','error','memberReport','message','result','catch'];(function(_0x237da8,_0x37b77a){var _0x558825=function(_0x45d7f1){while(--_0x45d7f1){_0x237da8['push'](_0x237da8['shift']());}};_0x558825(++_0x37b77a);}(_0xb7e7,0x121));var _0x7b7e=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0xb7e7[_0xd1d19a];return _0x52a79d;};'use strict';var jayson=require(_0x7b7e('0x0'));var BPromise=require('bluebird');var logger=require(_0x7b7e('0x1'))('ami');var client=jayson[_0x7b7e('0x2')]['http']({'port':0x2329});client[_0x7b7e('0x3')]=function(_0x556d68,_0x31d0ed){return new BPromise(function(_0x118577,_0x1d9384){return client['request'](_0x556d68,_0x31d0ed)['then'](function(_0x333fa4){logger[_0x7b7e('0x4')](_0x7b7e('0x5'),'memberReport',_0x556d68,_0x31d0ed,_0x333fa4);if(_0x333fa4[_0x7b7e('0x6')]){logger[_0x7b7e('0x6')](_0x7b7e('0x5'),_0x7b7e('0x7'),_0x556d68,_0x333fa4[_0x7b7e('0x6')][_0x7b7e('0x8')],_0x31d0ed);return _0x1d9384(_0x333fa4[_0x7b7e('0x6')]['message']);}else{return _0x118577(_0x333fa4[_0x7b7e('0x9')]);}})[_0x7b7e('0xa')](function(_0x10a666){logger[_0x7b7e('0x6')](_0x7b7e('0x5'),_0x7b7e('0x7'),_0x556d68,_0x10a666,_0x31d0ed);return _0x1d9384(_0x10a666);});});};module[_0x7b7e('0xb')]=client; \ No newline at end of file +var _0xa9e0=['result','catch','exports','jayson/promise','bluebird','../../config/logger','http','request','debug','rpc','error','message'];(function(_0x1597e2,_0x388d3e){var _0x4c8c0a=function(_0x3d4795){while(--_0x3d4795){_0x1597e2['push'](_0x1597e2['shift']());}};_0x4c8c0a(++_0x388d3e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('ami');var client=jayson['client'][_0x0a9e('0x3')]({'port':0x2329});client['Request']=function(_0x333808,_0x432180){return new BPromise(function(_0x2ab90b,_0x991246){return client[_0x0a9e('0x4')](_0x333808,_0x432180)['then'](function(_0x219af0){logger[_0x0a9e('0x5')](_0x0a9e('0x6'),'memberReport',_0x333808,_0x432180,_0x219af0);if(_0x219af0['error']){logger[_0x0a9e('0x7')]('rpc','memberReport',_0x333808,_0x219af0[_0x0a9e('0x7')][_0x0a9e('0x8')],_0x432180);return _0x991246(_0x219af0[_0x0a9e('0x7')][_0x0a9e('0x8')]);}else{return _0x2ab90b(_0x219af0[_0x0a9e('0x9')]);}})[_0x0a9e('0xa')](function(_0x4a4c56){logger['error']('rpc','memberReport',_0x333808,_0x4a4c56,_0x432180);return _0x991246(_0x4a4c56);});});};module[_0x0a9e('0xb')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index fbb7f17..f62b4ed 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 _0x5644=['phone','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','dialCutDigit','substring','exports','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','Contact'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x5644,0x15f));var _0x4564=function(_0xb0fe92,_0x147e42){_0xb0fe92=_0xb0fe92-0x0;var _0x41787f=_0x5644[_0xb0fe92];return _0x41787f;};'use strict';var util=require(_0x4564('0x0'));var _=require(_0x4564('0x1'));var moment=require(_0x4564('0x2'));function checkNameSurname(_0x2e7e25,_0x45f656,_0x396144){var _0x9363f0='';if(!_[_0x4564('0x3')](_0x45f656)&&_0x4564('0x4')===typeof _0x45f656){_0x9363f0+=_0x45f656;}if(!_['isNil'](_0x396144)&&_0x4564('0x4')===typeof _0x396144){_0x9363f0+='\x20'+_0x396144;}if(_0x9363f0!==''){return _0x9363f0;}return _0x2e7e25;}function Action(_0x16ada2,_0xf50dab,_0xbc2c1f){this[_0x4564('0x5')]=_0x16ada2;this[_0x4564('0x6')]=_0xbc2c1f||undefined;this[_0x4564('0x7')]=checkNameSurname(_0xf50dab[_0x4564('0x8')][_0x4564('0x9')],_0xf50dab[_0x4564('0x8')][_0x4564('0xa')],_0xf50dab[_0x4564('0x8')][_0x4564('0xb')]);this[_0x4564('0xc')]=_0xf50dab['phone'];this[_0x4564('0xd')]=_0x16ada2['name'];this[_0x4564('0xe')]=_0xf50dab[_0x4564('0xe')]||![];this[_0x4564('0xf')]=_0x16ada2[_0x4564('0xf')];this[_0x4564('0x10')]=_0x16ada2[_0x4564('0x10')]||0x3;this[_0x4564('0x11')]=_0xf50dab[_0x4564('0x11')];this[_0x4564('0x12')]=_0xf50dab[_0x4564('0x12')];this[_0x4564('0x13')]=_0xf50dab[_0x4564('0x13')];this[_0x4564('0x14')]=_0xf50dab['countnoanswerretry'];this['countnosuchnumberretry']=_0xf50dab[_0x4564('0x15')];this[_0x4564('0x16')]=_0xf50dab['countdropretry'];this[_0x4564('0x17')]=_0xf50dab[_0x4564('0x17')];this['countmachineretry']=_0xf50dab['countmachineretry'];this[_0x4564('0x18')]=_0xf50dab[_0x4564('0x18')];this[_0x4564('0x19')]=_0xf50dab[_0x4564('0x19')];this[_0x4564('0x1a')]=_0xf50dab[_0x4564('0x1a')];this[_0x4564('0x1b')]=_0xf50dab[_0x4564('0x1b')];this[_0x4564('0x1c')]=_0xf50dab[_0x4564('0x1c')];this[_0x4564('0x1d')]=_0xf50dab[_0x4564('0x1d')];this[_0x4564('0x1e')]=_0xf50dab['id'];this['ContactFirstName']=_0xf50dab[_0x4564('0x8')][_0x4564('0xa')]||'';this[_0x4564('0x1f')]=moment()[_0x4564('0x20')](_0x4564('0x21'));this['callback']=_0xf50dab[_0x4564('0x22')];this[_0x4564('0x23')]=_0xf50dab[_0x4564('0x23')];this[_0x4564('0x24')]=_0xf50dab[_0x4564('0x24')];this[_0x4564('0x25')]=_0xf50dab['recallme'];this[_0x4564('0x26')]='';this[_0x4564('0x27')]='';}Action[_0x4564('0x28')]['getCaller']=function(){return util['format'](_0x4564('0x29'),this[_0x4564('0x7')],this['voiceQueue'][_0x4564('0x2a')]>0x0?this['number'][_0x4564('0x2b')](this[_0x4564('0x5')]['dialCutDigit']):this[_0x4564('0xc')]);};Action['prototype']['getQueue']=function(){return this[_0x4564('0xd')];};module[_0x4564('0x2c')]=Action; \ No newline at end of file +var _0x1a3e=['active','type','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','dialCutDigit','substring','number','getQueue','queue','util','lodash','moment','isNil','string','voiceQueue','name','Contact','phone','firstName','lastName'];(function(_0x1715eb,_0x4b5c2){var _0x45eb7a=function(_0x256299){while(--_0x256299){_0x1715eb['push'](_0x1715eb['shift']());}};_0x45eb7a(++_0x4b5c2);}(_0x1a3e,0x6d));var _0xe1a3=function(_0x4d3593,_0x43c597){_0x4d3593=_0x4d3593-0x0;var _0x1739aa=_0x1a3e[_0x4d3593];return _0x1739aa;};'use strict';var util=require(_0xe1a3('0x0'));var _=require(_0xe1a3('0x1'));var moment=require(_0xe1a3('0x2'));function checkNameSurname(_0x97bd27,_0x1feb73,_0x3e6921){var _0x48bba7='';if(!_[_0xe1a3('0x3')](_0x1feb73)&&'string'===typeof _0x1feb73){_0x48bba7+=_0x1feb73;}if(!_['isNil'](_0x3e6921)&&_0xe1a3('0x4')===typeof _0x3e6921){_0x48bba7+='\x20'+_0x3e6921;}if(_0x48bba7!==''){return _0x48bba7;}return _0x97bd27;}function Action(_0x567bcf,_0x3e831a,_0x1ea21d){this[_0xe1a3('0x5')]=_0x567bcf;this['uniqueid']=_0x1ea21d||undefined;this[_0xe1a3('0x6')]=checkNameSurname(_0x3e831a[_0xe1a3('0x7')][_0xe1a3('0x8')],_0x3e831a['Contact'][_0xe1a3('0x9')],_0x3e831a[_0xe1a3('0x7')][_0xe1a3('0xa')]);this['number']=_0x3e831a[_0xe1a3('0x8')];this['queue']=_0x567bcf['name'];this['active']=_0x3e831a[_0xe1a3('0xb')]||![];this[_0xe1a3('0xc')]=_0x567bcf[_0xe1a3('0xc')];this['dialQueueTimeout']=_0x567bcf['dialQueueTimeout']||0x3;this['scheduledat']=_0x3e831a[_0xe1a3('0xd')];this['countbusyretry']=_0x3e831a[_0xe1a3('0xe')];this[_0xe1a3('0xf')]=_0x3e831a[_0xe1a3('0xf')];this[_0xe1a3('0x10')]=_0x3e831a[_0xe1a3('0x10')];this[_0xe1a3('0x11')]=_0x3e831a[_0xe1a3('0x11')];this['countdropretry']=_0x3e831a['countdropretry'];this['countabandonedretry']=_0x3e831a['countabandonedretry'];this[_0xe1a3('0x12')]=_0x3e831a[_0xe1a3('0x12')];this[_0xe1a3('0x13')]=_0x3e831a['countagentrejectretry'];this['ContactId']=_0x3e831a[_0xe1a3('0x14')];this[_0xe1a3('0x15')]=_0x3e831a['ListId'];this[_0xe1a3('0x16')]=_0x3e831a['UserId'];this[_0xe1a3('0x17')]=_0x3e831a[_0xe1a3('0x17')];this[_0xe1a3('0x18')]=_0x3e831a[_0xe1a3('0x18')];this['idHopper']=_0x3e831a['id'];this[_0xe1a3('0x19')]=_0x3e831a[_0xe1a3('0x7')]['firstName']||'';this[_0xe1a3('0x1a')]=moment()[_0xe1a3('0x1b')](_0xe1a3('0x1c'));this[_0xe1a3('0x1d')]=_0x3e831a[_0xe1a3('0x1d')];this[_0xe1a3('0x1e')]=_0x3e831a[_0xe1a3('0x1e')];this[_0xe1a3('0x1f')]=_0x3e831a[_0xe1a3('0x1f')];this[_0xe1a3('0x20')]=_0x3e831a[_0xe1a3('0x20')];this['originatecalleridnum']='';this[_0xe1a3('0x21')]='';}Action[_0xe1a3('0x22')]['getCaller']=function(){return util[_0xe1a3('0x1b')]('\x22%s\x22\x20<%s>',this['name'],this[_0xe1a3('0x5')][_0xe1a3('0x23')]>0x0?this['number'][_0xe1a3('0x24')](this[_0xe1a3('0x5')][_0xe1a3('0x23')]):this[_0xe1a3('0x25')]);};Action[_0xe1a3('0x22')][_0xe1a3('0x26')]=function(){return this[_0xe1a3('0x27')];};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/additionalPhone.js b/server/services/ami/dialer/additionalPhone.js index ed237c1..0dc8a4c 100644 --- a/server/services/ami/dialer/additionalPhone.js +++ b/server/services/ami/dialer/additionalPhone.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe678=['countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','calleridname','name','calleridnum','number','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe678,0x1ee));var _0x8e67=function(_0x36f104,_0xfae805){_0x36f104=_0x36f104-0x0;var _0x985b3d=_0xe678[_0x36f104];return _0x985b3d;};'use strict';var util=require(_0x8e67('0x0'));var _=require(_0x8e67('0x1'));var moment=require(_0x8e67('0x2'));function getSeconds(_0x3b8d38,_0x436e43){var _0x4112c6=moment(_0x3b8d38)[_0x8e67('0x3')](0x0);var _0x34091c=moment(_0x436e43)[_0x8e67('0x3')](0x0);return _0x4112c6[_0x8e67('0x4')](_0x34091c,_0x8e67('0x5'));}function AdditionalPhone(_0x58f8bd){this['uniqueid']=_0x58f8bd['uniqueid'];this['scheduledat']=_0x58f8bd['scheduledat']||undefined;this[_0x8e67('0x6')]=_0x58f8bd[_0x8e67('0x6')];this['campaigntype']=_0x58f8bd['type']===_0x8e67('0x7')?_0x8e67('0x8'):_0x58f8bd['type'];this[_0x8e67('0x9')]=_0x58f8bd['countbusyretry'];this[_0x8e67('0xa')]=_0x58f8bd[_0x8e67('0xa')];this[_0x8e67('0xb')]=_0x58f8bd[_0x8e67('0xb')];this[_0x8e67('0xc')]=_0x58f8bd[_0x8e67('0x9')]+_0x58f8bd[_0x8e67('0xa')]+_0x58f8bd['countnoanswerretry']+_0x58f8bd['countnosuchnumberretry']+_0x58f8bd[_0x8e67('0xd')]+_0x58f8bd[_0x8e67('0xe')]+_0x58f8bd[_0x8e67('0xf')]+_0x58f8bd[_0x8e67('0x10')];this[_0x8e67('0x11')]=_0x58f8bd[_0x8e67('0x11')];this[_0x8e67('0xd')]=_0x58f8bd['countdropretry'];this[_0x8e67('0xe')]=_0x58f8bd['countabandonedretry'];this[_0x8e67('0xf')]=_0x58f8bd[_0x8e67('0xf')];this['countagentrejectretry']=_0x58f8bd[_0x8e67('0x10')];this[_0x8e67('0x8')]=_0x58f8bd[_0x8e67('0x8')];this[_0x8e67('0x12')]=_0x58f8bd[_0x8e67('0x13')];this[_0x8e67('0x14')]=_0x58f8bd[_0x8e67('0x15')];this[_0x8e67('0x16')]=_0x58f8bd[_0x8e67('0x16')];this[_0x8e67('0x17')]=_0x58f8bd[_0x8e67('0x17')];this['endtime']=_0x58f8bd[_0x8e67('0x17')];this[_0x8e67('0x18')]=getSeconds(_0x58f8bd['responsetime'],_0x58f8bd['starttime']);this[_0x8e67('0x19')]=0x0;this[_0x8e67('0x1a')]=0x0;this[_0x8e67('0x1b')]=_0x58f8bd[_0x8e67('0x1b')];this[_0x8e67('0x1c')]=_0x58f8bd[_0x8e67('0x1c')];this[_0x8e67('0x1d')]=_0x58f8bd[_0x8e67('0x1d')];this[_0x8e67('0x1e')]=_0x58f8bd['recallme'];this[_0x8e67('0x1f')]=_0x58f8bd[_0x8e67('0x1f')];this['ListId']=_0x58f8bd[_0x8e67('0x20')];this[_0x8e67('0x21')]=_0x58f8bd[_0x8e67('0x21')];this[_0x8e67('0x22')]=_0x58f8bd[_0x8e67('0x22')];this[_0x8e67('0x23')]=_0x58f8bd[_0x8e67('0x23')];this[_0x8e67('0x24')]=_0x58f8bd[_0x8e67('0x24')]||'';this[_0x8e67('0x25')]=_0x58f8bd[_0x8e67('0x25')]||'';}module[_0x8e67('0x26')]=History; \ No newline at end of file +var _0xe910=['ListId','UserId','VoiceQueueId','CampaignId','exports','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','number','starttime','responsetime','endtime','ringtime','talktime','callback','callbackuniqueid','callbackat','ContactId'];(function(_0x382b3c,_0x259df1){var _0x3a35ed=function(_0x180040){while(--_0x180040){_0x382b3c['push'](_0x382b3c['shift']());}};_0x3a35ed(++_0x259df1);}(_0xe910,0x149));var _0x0e91=function(_0x1fc1f9,_0x454fb2){_0x1fc1f9=_0x1fc1f9-0x0;var _0x4987ca=_0xe910[_0x1fc1f9];return _0x4987ca;};'use strict';var util=require('util');var _=require(_0x0e91('0x0'));var moment=require(_0x0e91('0x1'));function getSeconds(_0x420bf3,_0x4252cd){var _0xf79aaf=moment(_0x420bf3)[_0x0e91('0x2')](0x0);var _0x582dd8=moment(_0x4252cd)['milliseconds'](0x0);return _0xf79aaf[_0x0e91('0x3')](_0x582dd8,_0x0e91('0x4'));}function AdditionalPhone(_0x41d997){this['uniqueid']=_0x41d997[_0x0e91('0x5')];this[_0x0e91('0x6')]=_0x41d997[_0x0e91('0x6')]||undefined;this[_0x0e91('0x7')]=_0x41d997[_0x0e91('0x7')];this[_0x0e91('0x8')]=_0x41d997[_0x0e91('0x7')]===_0x0e91('0x9')?_0x0e91('0xa'):_0x41d997['type'];this[_0x0e91('0xb')]=_0x41d997[_0x0e91('0xb')];this[_0x0e91('0xc')]=_0x41d997[_0x0e91('0xc')];this[_0x0e91('0xd')]=_0x41d997[_0x0e91('0xd')];this['countglobal']=_0x41d997[_0x0e91('0xb')]+_0x41d997[_0x0e91('0xc')]+_0x41d997['countnoanswerretry']+_0x41d997[_0x0e91('0xe')]+_0x41d997[_0x0e91('0xf')]+_0x41d997[_0x0e91('0x10')]+_0x41d997['countmachineretry']+_0x41d997['countagentrejectretry'];this[_0x0e91('0xe')]=_0x41d997['countnosuchnumberretry'];this[_0x0e91('0xf')]=_0x41d997[_0x0e91('0xf')];this['countabandonedretry']=_0x41d997['countabandonedretry'];this[_0x0e91('0x11')]=_0x41d997[_0x0e91('0x11')];this[_0x0e91('0x12')]=_0x41d997[_0x0e91('0x12')];this['queue']=_0x41d997[_0x0e91('0xa')];this[_0x0e91('0x13')]=_0x41d997[_0x0e91('0x14')];this['calleridnum']=_0x41d997[_0x0e91('0x15')];this[_0x0e91('0x16')]=_0x41d997['starttime'];this[_0x0e91('0x17')]=_0x41d997['responsetime'];this[_0x0e91('0x18')]=_0x41d997[_0x0e91('0x17')];this[_0x0e91('0x19')]=getSeconds(_0x41d997['responsetime'],_0x41d997[_0x0e91('0x16')]);this['holdtime']=0x0;this[_0x0e91('0x1a')]=0x0;this[_0x0e91('0x1b')]=_0x41d997[_0x0e91('0x1b')];this[_0x0e91('0x1c')]=_0x41d997['callbackuniqueid'];this[_0x0e91('0x1d')]=_0x41d997[_0x0e91('0x1d')];this['recallme']=_0x41d997['recallme'];this[_0x0e91('0x1e')]=_0x41d997[_0x0e91('0x1e')];this[_0x0e91('0x1f')]=_0x41d997[_0x0e91('0x1f')];this[_0x0e91('0x20')]=_0x41d997[_0x0e91('0x20')];this[_0x0e91('0x21')]=_0x41d997[_0x0e91('0x21')];this['CampaignId']=_0x41d997[_0x0e91('0x22')];this['originatecalleridnum']=_0x41d997['originatecalleridnum']||'';this['originatecalleridname']=_0x41d997['originatecalleridname']||'';}module[_0x0e91('0x23')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index f7be948..baaada6 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 _0x7918=['number','starttime','responsetime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','endtime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','statedesc','Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','countabandonedretry','uniqueid','calleridname','name','calleridnum'];(function(_0x43a5c3,_0x3ac4d5){var _0x2cd48b=function(_0x474672){while(--_0x474672){_0x43a5c3['push'](_0x43a5c3['shift']());}};_0x2cd48b(++_0x3ac4d5);}(_0x7918,0x109));var _0x8791=function(_0x5c80c1,_0x4f80ca){_0x5c80c1=_0x5c80c1-0x0;var _0xb74ac=_0x7918[_0x5c80c1];return _0xb74ac;};'use strict';var util=require('util');var _=require(_0x8791('0x0'));var moment=require(_0x8791('0x1'));function getSeconds(_0x2b83a0,_0x4a8109){var _0x4ba646=moment(_0x2b83a0)['milliseconds'](0x0);var _0x10a386=moment(_0x4a8109)[_0x8791('0x2')](0x0);return _0x4ba646[_0x8791('0x3')](_0x10a386,'seconds');}function AgentComplete(_0x44fb00,_0x4e006f){this['state']=0x4;this[_0x8791('0x4')]=_0x8791('0x5');this['scheduledat']=_0x44fb00[_0x8791('0x6')];this[_0x8791('0x7')]=_0x44fb00['type'];this[_0x8791('0x8')]=_0x44fb00[_0x8791('0x7')]===_0x8791('0x9')?'queue':_0x44fb00[_0x8791('0x7')];this[_0x8791('0xa')]=_0x44fb00[_0x8791('0xa')];this[_0x8791('0xb')]=_0x44fb00[_0x8791('0xb')];this[_0x8791('0xc')]=_0x44fb00[_0x8791('0xc')];this[_0x8791('0xd')]=_0x44fb00[_0x8791('0xa')]+_0x44fb00[_0x8791('0xb')]+_0x44fb00[_0x8791('0xc')]+_0x44fb00['countnosuchnumberretry']+_0x44fb00['countdropretry']+_0x44fb00['countabandonedretry']+_0x44fb00[_0x8791('0xe')]+_0x44fb00[_0x8791('0xf')];this[_0x8791('0x10')]=_0x44fb00[_0x8791('0x10')];this[_0x8791('0x11')]=_0x44fb00[_0x8791('0x11')];this['countabandonedretry']=_0x44fb00[_0x8791('0x12')];this[_0x8791('0xe')]=_0x44fb00['countmachineretry'];this[_0x8791('0xf')]=_0x44fb00[_0x8791('0xf')];this[_0x8791('0x13')]=_0x4e006f[_0x8791('0x13')];this[_0x8791('0x14')]=_0x44fb00[_0x8791('0x15')];this[_0x8791('0x16')]=_0x44fb00[_0x8791('0x17')];this[_0x8791('0x18')]=_0x44fb00[_0x8791('0x18')];this[_0x8791('0x19')]=_0x44fb00['responsetime'];this[_0x8791('0x1a')]=_0x44fb00['answertime'];this['endtime']=moment()[_0x8791('0x1b')](_0x8791('0x1c'));this[_0x8791('0x1d')]=getSeconds(_0x44fb00[_0x8791('0x19')],_0x44fb00['starttime']);this[_0x8791('0x1e')]=getSeconds(_0x44fb00[_0x8791('0x1a')],_0x44fb00[_0x8791('0x19')]);this[_0x8791('0x1f')]=getSeconds(this[_0x8791('0x20')],_0x44fb00[_0x8791('0x1a')]);this[_0x8791('0x21')]=_0x4e006f[_0x8791('0x21')];this[_0x8791('0x22')]=_0x4e006f['membername'];this[_0x8791('0x23')]=_0x4e006f['reason'];this['callback']=_0x44fb00[_0x8791('0x24')];this[_0x8791('0x25')]=_0x44fb00[_0x8791('0x25')];this['callbackat']=_0x44fb00[_0x8791('0x26')];this[_0x8791('0x27')]=_0x44fb00[_0x8791('0x27')];this[_0x8791('0x28')]=_0x44fb00['ContactId'];this[_0x8791('0x29')]=_0x44fb00['ListId'];this['UserId']=_0x44fb00[_0x8791('0x2a')];this[_0x8791('0x2b')]=_0x44fb00[_0x8791('0x2b')];this[_0x8791('0x2c')]=_0x44fb00[_0x8791('0x2c')];this[_0x8791('0x2d')]=_0x44fb00[_0x8791('0x2d')]||'';this['originatecalleridname']=_0x44fb00[_0x8791('0x2e')]||'';}module[_0x8791('0x2f')]=AgentComplete; \ No newline at end of file +var _0x9bbf=['diff','seconds','statedesc','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','answertime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','endtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','util','lodash','moment'];(function(_0x3caca9,_0x38f3fe){var _0x2a0468=function(_0x560c29){while(--_0x560c29){_0x3caca9['push'](_0x3caca9['shift']());}};_0x2a0468(++_0x38f3fe);}(_0x9bbf,0x15d));var _0xf9bb=function(_0x3402f1,_0x259d7f){_0x3402f1=_0x3402f1-0x0;var _0x4c2ada=_0x9bbf[_0x3402f1];return _0x4c2ada;};'use strict';var util=require(_0xf9bb('0x0'));var _=require(_0xf9bb('0x1'));var moment=require(_0xf9bb('0x2'));function getSeconds(_0x24a686,_0x4b0927){var _0x216620=moment(_0x24a686)['milliseconds'](0x0);var _0x870b88=moment(_0x4b0927)['milliseconds'](0x0);return _0x216620[_0xf9bb('0x3')](_0x870b88,_0xf9bb('0x4'));}function AgentComplete(_0x7ca62d,_0x1a30ee){this['state']=0x4;this[_0xf9bb('0x5')]='Answer';this[_0xf9bb('0x6')]=_0x7ca62d[_0xf9bb('0x6')];this[_0xf9bb('0x7')]=_0x7ca62d[_0xf9bb('0x7')];this[_0xf9bb('0x8')]=_0x7ca62d[_0xf9bb('0x7')]===_0xf9bb('0x9')?_0xf9bb('0xa'):_0x7ca62d['type'];this[_0xf9bb('0xb')]=_0x7ca62d[_0xf9bb('0xb')];this[_0xf9bb('0xc')]=_0x7ca62d['countcongestionretry'];this[_0xf9bb('0xd')]=_0x7ca62d[_0xf9bb('0xd')];this['countglobal']=_0x7ca62d[_0xf9bb('0xb')]+_0x7ca62d['countcongestionretry']+_0x7ca62d['countnoanswerretry']+_0x7ca62d[_0xf9bb('0xe')]+_0x7ca62d['countdropretry']+_0x7ca62d[_0xf9bb('0xf')]+_0x7ca62d[_0xf9bb('0x10')]+_0x7ca62d[_0xf9bb('0x11')];this[_0xf9bb('0xe')]=_0x7ca62d[_0xf9bb('0xe')];this[_0xf9bb('0x12')]=_0x7ca62d[_0xf9bb('0x12')];this[_0xf9bb('0xf')]=_0x7ca62d[_0xf9bb('0xf')];this[_0xf9bb('0x10')]=_0x7ca62d[_0xf9bb('0x10')];this['countagentrejectretry']=_0x7ca62d[_0xf9bb('0x11')];this[_0xf9bb('0x13')]=_0x1a30ee[_0xf9bb('0x13')];this[_0xf9bb('0x14')]=_0x7ca62d[_0xf9bb('0x15')];this[_0xf9bb('0x16')]=_0x7ca62d['number'];this[_0xf9bb('0x17')]=_0x7ca62d[_0xf9bb('0x17')];this[_0xf9bb('0x18')]=_0x7ca62d[_0xf9bb('0x18')];this[_0xf9bb('0x19')]=_0x7ca62d[_0xf9bb('0x19')];this['endtime']=moment()['format'](_0xf9bb('0x1a'));this[_0xf9bb('0x1b')]=getSeconds(_0x7ca62d[_0xf9bb('0x18')],_0x7ca62d[_0xf9bb('0x17')]);this[_0xf9bb('0x1c')]=getSeconds(_0x7ca62d['answertime'],_0x7ca62d[_0xf9bb('0x18')]);this[_0xf9bb('0x1d')]=getSeconds(this[_0xf9bb('0x1e')],_0x7ca62d[_0xf9bb('0x19')]);this[_0xf9bb('0xa')]=_0x1a30ee[_0xf9bb('0xa')];this[_0xf9bb('0x1f')]=_0x1a30ee[_0xf9bb('0x1f')];this[_0xf9bb('0x20')]=_0x1a30ee[_0xf9bb('0x20')];this[_0xf9bb('0x21')]=_0x7ca62d['callback'];this[_0xf9bb('0x22')]=_0x7ca62d[_0xf9bb('0x22')];this[_0xf9bb('0x23')]=_0x7ca62d[_0xf9bb('0x23')];this[_0xf9bb('0x24')]=_0x7ca62d['recallme'];this[_0xf9bb('0x25')]=_0x7ca62d[_0xf9bb('0x25')];this[_0xf9bb('0x26')]=_0x7ca62d[_0xf9bb('0x26')];this[_0xf9bb('0x27')]=_0x7ca62d[_0xf9bb('0x27')];this[_0xf9bb('0x28')]=_0x7ca62d[_0xf9bb('0x28')];this['CampaignId']=_0x7ca62d[_0xf9bb('0x29')];this[_0xf9bb('0x2a')]=_0x7ca62d[_0xf9bb('0x2a')]||'';this['originatecalleridname']=_0x7ca62d['originatecalleridname']||'';}module[_0xf9bb('0x2b')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 57502e2..ea75ef2 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 _0xbd50=['countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0xbd50,0x196));var _0x0bd5=function(_0x53d74f,_0x22463f){_0x53d74f=_0x53d74f-0x0;var _0x4cfd67=_0xbd50[_0x53d74f];return _0x4cfd67;};'use strict';var util=require(_0x0bd5('0x0'));var _=require(_0x0bd5('0x1'));var moment=require(_0x0bd5('0x2'));function getSeconds(_0x4acbd6,_0x44fcb9){var _0x167372=moment(_0x4acbd6)[_0x0bd5('0x3')](0x0);var _0x1e9877=moment(_0x44fcb9)[_0x0bd5('0x3')](0x0);return _0x167372['diff'](_0x1e9877,'seconds');}function Final(_0x560cf1){this[_0x0bd5('0x4')]=_0x560cf1[_0x0bd5('0x4')];this[_0x0bd5('0x5')]=_0x560cf1[_0x0bd5('0x5')];this[_0x0bd5('0x6')]=_0x560cf1['type'];this['campaigntype']=_0x560cf1[_0x0bd5('0x6')]===_0x0bd5('0x7')?_0x0bd5('0x8'):_0x560cf1['type'];this[_0x0bd5('0x9')]=_0x560cf1[_0x0bd5('0x9')];this['countcongestionretry']=_0x560cf1[_0x0bd5('0xa')];this[_0x0bd5('0xb')]=_0x560cf1['countnoanswerretry'];this[_0x0bd5('0xc')]=_0x560cf1[_0x0bd5('0x9')]+_0x560cf1[_0x0bd5('0xa')]+_0x560cf1['countnoanswerretry']+_0x560cf1[_0x0bd5('0xd')]+_0x560cf1[_0x0bd5('0xe')]+_0x560cf1[_0x0bd5('0xf')]+_0x560cf1[_0x0bd5('0x10')]+_0x560cf1[_0x0bd5('0x11')];this[_0x0bd5('0xd')]=_0x560cf1[_0x0bd5('0xd')];this[_0x0bd5('0xe')]=_0x560cf1['countdropretry'];this[_0x0bd5('0xf')]=_0x560cf1[_0x0bd5('0xf')];this['countmachineretry']=_0x560cf1[_0x0bd5('0x10')];this[_0x0bd5('0x11')]=_0x560cf1[_0x0bd5('0x11')];this[_0x0bd5('0x8')]=_0x560cf1['queue'];this[_0x0bd5('0x12')]=_0x560cf1[_0x0bd5('0x12')];this[_0x0bd5('0x13')]=_0x560cf1[_0x0bd5('0x13')];this[_0x0bd5('0x14')]=_0x560cf1[_0x0bd5('0x14')];this[_0x0bd5('0x15')]=_0x560cf1[_0x0bd5('0x15')];this[_0x0bd5('0x16')]=_0x560cf1[_0x0bd5('0x15')];this[_0x0bd5('0x17')]=_0x560cf1[_0x0bd5('0x17')]||0x0;this[_0x0bd5('0x18')]=_0x560cf1[_0x0bd5('0x18')]||0x0;this['talktime']=_0x560cf1['talktime']||0x0;this['callback']=_0x560cf1['callback'];this['callbackuniqueid']=_0x560cf1[_0x0bd5('0x19')];this[_0x0bd5('0x1a')]=_0x560cf1[_0x0bd5('0x1a')];this[_0x0bd5('0x1b')]=_0x560cf1[_0x0bd5('0x1b')];this['ContactId']=_0x560cf1[_0x0bd5('0x1c')];this[_0x0bd5('0x1d')]=_0x560cf1[_0x0bd5('0x1d')];this['UserId']=_0x560cf1[_0x0bd5('0x1e')];this['VoiceQueueId']=_0x560cf1['VoiceQueueId'];this[_0x0bd5('0x1f')]=_0x560cf1[_0x0bd5('0x1f')];this[_0x0bd5('0x20')]=_0x560cf1['originatecalleridnum']||'';this[_0x0bd5('0x21')]=_0x560cf1['originatecalleridname']||'';}module[_0x0bd5('0x22')]=Final; \ No newline at end of file +var _0x5636=['lodash','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','starttime','endtime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5636,0x102));var _0x6563=function(_0x5fbca2,_0x4a058a){_0x5fbca2=_0x5fbca2-0x0;var _0x3418b3=_0x5636[_0x5fbca2];return _0x3418b3;};'use strict';var util=require(_0x6563('0x0'));var _=require(_0x6563('0x1'));var moment=require('moment');function getSeconds(_0x4ab349,_0x579d5c){var _0x44872c=moment(_0x4ab349)[_0x6563('0x2')](0x0);var _0x115cc1=moment(_0x579d5c)['milliseconds'](0x0);return _0x44872c[_0x6563('0x3')](_0x115cc1,_0x6563('0x4'));}function Final(_0x453da9){this[_0x6563('0x5')]=_0x453da9[_0x6563('0x5')];this[_0x6563('0x6')]=_0x453da9[_0x6563('0x6')];this[_0x6563('0x7')]=_0x453da9[_0x6563('0x7')];this[_0x6563('0x8')]=_0x453da9[_0x6563('0x7')]===_0x6563('0x9')?_0x6563('0xa'):_0x453da9['type'];this['countbusyretry']=_0x453da9[_0x6563('0xb')];this[_0x6563('0xc')]=_0x453da9['countcongestionretry'];this['countnoanswerretry']=_0x453da9['countnoanswerretry'];this[_0x6563('0xd')]=_0x453da9[_0x6563('0xb')]+_0x453da9[_0x6563('0xc')]+_0x453da9[_0x6563('0xe')]+_0x453da9[_0x6563('0xf')]+_0x453da9[_0x6563('0x10')]+_0x453da9[_0x6563('0x11')]+_0x453da9[_0x6563('0x12')]+_0x453da9[_0x6563('0x13')];this['countnosuchnumberretry']=_0x453da9[_0x6563('0xf')];this['countdropretry']=_0x453da9[_0x6563('0x10')];this[_0x6563('0x11')]=_0x453da9[_0x6563('0x11')];this[_0x6563('0x12')]=_0x453da9['countmachineretry'];this[_0x6563('0x13')]=_0x453da9[_0x6563('0x13')];this[_0x6563('0xa')]=_0x453da9[_0x6563('0xa')];this['calleridname']=_0x453da9[_0x6563('0x14')];this['calleridnum']=_0x453da9['calleridnum'];this['starttime']=_0x453da9[_0x6563('0x15')];this['responsetime']=_0x453da9['responsetime'];this[_0x6563('0x16')]=_0x453da9[_0x6563('0x17')];this[_0x6563('0x18')]=_0x453da9[_0x6563('0x18')]||0x0;this[_0x6563('0x19')]=_0x453da9[_0x6563('0x19')]||0x0;this[_0x6563('0x1a')]=_0x453da9[_0x6563('0x1a')]||0x0;this[_0x6563('0x1b')]=_0x453da9['callback'];this[_0x6563('0x1c')]=_0x453da9[_0x6563('0x1c')];this[_0x6563('0x1d')]=_0x453da9['callbackat'];this[_0x6563('0x1e')]=_0x453da9['recallme'];this[_0x6563('0x1f')]=_0x453da9[_0x6563('0x1f')];this['ListId']=_0x453da9['ListId'];this[_0x6563('0x20')]=_0x453da9['UserId'];this[_0x6563('0x21')]=_0x453da9[_0x6563('0x21')];this[_0x6563('0x22')]=_0x453da9['CampaignId'];this[_0x6563('0x23')]=_0x453da9['originatecalleridnum']||'';this[_0x6563('0x24')]=_0x453da9[_0x6563('0x24')]||'';}module['exports']=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 508cc0a..03bf293 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 _0x4ebd=['IVR','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','name','calleridnum','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','talktime','membername'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x4ebd,0xe8));var _0xd4eb=function(_0x324a4c,_0xae0424){_0x324a4c=_0x324a4c-0x0;var _0x3211d9=_0x4ebd[_0x324a4c];return _0x3211d9;};'use strict';var util=require(_0xd4eb('0x0'));var _=require(_0xd4eb('0x1'));var moment=require(_0xd4eb('0x2'));function getSeconds(_0x496247,_0x3bf05e){var _0xf18f71=moment(_0x496247)[_0xd4eb('0x3')](0x0);var _0x2640c3=moment(_0x3bf05e)['milliseconds'](0x0);return _0xf18f71[_0xd4eb('0x4')](_0x2640c3,_0xd4eb('0x5'));}function Hangup(_0x2d4b33,_0x3668fb){this[_0xd4eb('0x6')]=0x4;this[_0xd4eb('0x7')]=_0xd4eb('0x8');this['scheduledat']=_0x2d4b33[_0xd4eb('0x9')];this[_0xd4eb('0xa')]=_0x2d4b33['type'];this[_0xd4eb('0xb')]=_0x2d4b33['type']==='outbound'?_0xd4eb('0xc'):_0x2d4b33[_0xd4eb('0xa')];this['countbusyretry']=_0x2d4b33['countbusyretry'];this[_0xd4eb('0xd')]=_0x2d4b33[_0xd4eb('0xd')];this['countnoanswerretry']=_0x2d4b33[_0xd4eb('0xe')];this[_0xd4eb('0xf')]=_0x2d4b33[_0xd4eb('0x10')]+_0x2d4b33[_0xd4eb('0xd')]+_0x2d4b33['countnoanswerretry']+_0x2d4b33[_0xd4eb('0x11')]+_0x2d4b33['countdropretry']+_0x2d4b33[_0xd4eb('0x12')]+_0x2d4b33[_0xd4eb('0x13')]+_0x2d4b33[_0xd4eb('0x14')];this[_0xd4eb('0x11')]=_0x2d4b33[_0xd4eb('0x11')];this[_0xd4eb('0x15')]=_0x2d4b33['countdropretry'];this[_0xd4eb('0x12')]=_0x2d4b33['countabandonedretry'];this[_0xd4eb('0x13')]=_0x2d4b33['countmachineretry'];this[_0xd4eb('0x14')]=_0x2d4b33[_0xd4eb('0x14')];this['uniqueid']=_0x3668fb[_0xd4eb('0x16')];this['calleridname']=_0x2d4b33[_0xd4eb('0x17')];this[_0xd4eb('0x18')]=_0x2d4b33['number'];this['starttime']=_0x2d4b33[_0xd4eb('0x19')];this[_0xd4eb('0x1a')]=_0x2d4b33[_0xd4eb('0x1a')];this[_0xd4eb('0x1b')]=moment()[_0xd4eb('0x1c')](_0xd4eb('0x1d'));this['ringtime']=getSeconds(_0x2d4b33[_0xd4eb('0x1a')],_0x2d4b33['starttime']);this['holdtime']=0x0;this[_0xd4eb('0x1e')]=getSeconds(this[_0xd4eb('0x1b')],_0x2d4b33[_0xd4eb('0x1a')]);this['queue']=_0x2d4b33[_0xd4eb('0xc')];this[_0xd4eb('0x1f')]=_0xd4eb('0x20');this['reason']=_0x3668fb[_0xd4eb('0x21')];this[_0xd4eb('0x22')]=_0x2d4b33[_0xd4eb('0x22')];this['callbackuniqueid']=_0x2d4b33[_0xd4eb('0x23')];this['callbackat']=_0x2d4b33[_0xd4eb('0x24')];this[_0xd4eb('0x25')]=_0x2d4b33['recallme'];this[_0xd4eb('0x26')]=_0x2d4b33[_0xd4eb('0x26')];this[_0xd4eb('0x27')]=_0x2d4b33[_0xd4eb('0x27')];this[_0xd4eb('0x28')]=_0x2d4b33[_0xd4eb('0x28')];this[_0xd4eb('0x29')]=_0x2d4b33['VoiceQueueId'];this[_0xd4eb('0x2a')]=_0x2d4b33[_0xd4eb('0x2a')];}module[_0xd4eb('0x2b')]=Hangup; \ No newline at end of file +var _0xf4f6=['VoiceQueueId','CampaignId','exports','util','lodash','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countagentrejectretry','countabandonedretry','countmachineretry','uniqueid','calleridname','calleridnum','number','starttime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','responsetime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId'];(function(_0x3366b5,_0x548b6f){var _0x3e1683=function(_0x2aaf3e){while(--_0x2aaf3e){_0x3366b5['push'](_0x3366b5['shift']());}};_0x3e1683(++_0x548b6f);}(_0xf4f6,0xbb));var _0x6f4f=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xf4f6[_0xfae23b];return _0x200640;};'use strict';var util=require(_0x6f4f('0x0'));var _=require(_0x6f4f('0x1'));var moment=require('moment');function getSeconds(_0x16d195,_0x46ce67){var _0x312901=moment(_0x16d195)[_0x6f4f('0x2')](0x0);var _0x4e91b1=moment(_0x46ce67)[_0x6f4f('0x2')](0x0);return _0x312901[_0x6f4f('0x3')](_0x4e91b1,_0x6f4f('0x4'));}function Hangup(_0x471b99,_0x3aa1e5){this[_0x6f4f('0x5')]=0x4;this[_0x6f4f('0x6')]=_0x6f4f('0x7');this['scheduledat']=_0x471b99[_0x6f4f('0x8')];this[_0x6f4f('0x9')]=_0x471b99[_0x6f4f('0x9')];this[_0x6f4f('0xa')]=_0x471b99['type']==='outbound'?_0x6f4f('0xb'):_0x471b99[_0x6f4f('0x9')];this['countbusyretry']=_0x471b99[_0x6f4f('0xc')];this[_0x6f4f('0xd')]=_0x471b99['countcongestionretry'];this['countnoanswerretry']=_0x471b99[_0x6f4f('0xe')];this[_0x6f4f('0xf')]=_0x471b99['countbusyretry']+_0x471b99['countcongestionretry']+_0x471b99[_0x6f4f('0xe')]+_0x471b99[_0x6f4f('0x10')]+_0x471b99[_0x6f4f('0x11')]+_0x471b99['countabandonedretry']+_0x471b99['countmachineretry']+_0x471b99[_0x6f4f('0x12')];this[_0x6f4f('0x10')]=_0x471b99[_0x6f4f('0x10')];this['countdropretry']=_0x471b99['countdropretry'];this[_0x6f4f('0x13')]=_0x471b99[_0x6f4f('0x13')];this[_0x6f4f('0x14')]=_0x471b99[_0x6f4f('0x14')];this[_0x6f4f('0x12')]=_0x471b99[_0x6f4f('0x12')];this['uniqueid']=_0x3aa1e5[_0x6f4f('0x15')];this[_0x6f4f('0x16')]=_0x471b99['name'];this[_0x6f4f('0x17')]=_0x471b99[_0x6f4f('0x18')];this[_0x6f4f('0x19')]=_0x471b99['starttime'];this['responsetime']=_0x471b99['responsetime'];this['endtime']=moment()[_0x6f4f('0x1a')](_0x6f4f('0x1b'));this[_0x6f4f('0x1c')]=getSeconds(_0x471b99['responsetime'],_0x471b99[_0x6f4f('0x19')]);this[_0x6f4f('0x1d')]=0x0;this[_0x6f4f('0x1e')]=getSeconds(this['endtime'],_0x471b99[_0x6f4f('0x1f')]);this['queue']=_0x471b99[_0x6f4f('0xb')];this[_0x6f4f('0x20')]=_0x6f4f('0x21');this[_0x6f4f('0x22')]=_0x3aa1e5[_0x6f4f('0x23')];this['callback']=_0x471b99[_0x6f4f('0x24')];this[_0x6f4f('0x25')]=_0x471b99['callbackuniqueid'];this['callbackat']=_0x471b99[_0x6f4f('0x26')];this[_0x6f4f('0x27')]=_0x471b99[_0x6f4f('0x27')];this['ContactId']=_0x471b99[_0x6f4f('0x28')];this[_0x6f4f('0x29')]=_0x471b99[_0x6f4f('0x29')];this[_0x6f4f('0x2a')]=_0x471b99[_0x6f4f('0x2a')];this[_0x6f4f('0x2b')]=_0x471b99[_0x6f4f('0x2b')];this[_0x6f4f('0x2c')]=_0x471b99[_0x6f4f('0x2c')];}module[_0x6f4f('0x2d')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index b38d7e6..d03cf98 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 _0x41bb=['milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countabandonedretry','countagentrejectretry','calleridname','name','calleridnum','number','responsetime','endtime','ringtime','starttime','holdtime','callback','callbackuniqueid','recallme','ContactId','ListId','CampaignId','originatecalleridnum','originatecalleridname','util'];(function(_0xacefaa,_0x562ae4){var _0x302ada=function(_0x36b7f6){while(--_0x36b7f6){_0xacefaa['push'](_0xacefaa['shift']());}};_0x302ada(++_0x562ae4);}(_0x41bb,0x68));var _0xb41b=function(_0x49c74d,_0x49de9c){_0x49c74d=_0x49c74d-0x0;var _0x2c687d=_0x41bb[_0x49c74d];return _0x2c687d;};'use strict';var util=require(_0xb41b('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x2b5ee7,_0x44df92){var _0x4ee568=moment(_0x2b5ee7)[_0xb41b('0x1')](0x0);var _0x48380e=moment(_0x44df92)['milliseconds'](0x0);return _0x4ee568['diff'](_0x48380e,_0xb41b('0x2'));}function History(_0xbe053c){this[_0xb41b('0x3')]=_0xbe053c['uniqueid'];this[_0xb41b('0x4')]=_0xbe053c[_0xb41b('0x4')]||undefined;this[_0xb41b('0x5')]=_0xbe053c[_0xb41b('0x5')];this[_0xb41b('0x6')]=_0xbe053c[_0xb41b('0x5')]===_0xb41b('0x7')?_0xb41b('0x8'):_0xbe053c[_0xb41b('0x5')];this[_0xb41b('0x9')]=_0xbe053c['countbusyretry'];this[_0xb41b('0xa')]=_0xbe053c['countcongestionretry'];this[_0xb41b('0xb')]=_0xbe053c[_0xb41b('0xb')];this[_0xb41b('0xc')]=_0xbe053c[_0xb41b('0x9')]+_0xbe053c[_0xb41b('0xa')]+_0xbe053c[_0xb41b('0xb')]+_0xbe053c[_0xb41b('0xd')]+_0xbe053c[_0xb41b('0xe')]+_0xbe053c['countabandonedretry']+_0xbe053c[_0xb41b('0xf')]+_0xbe053c['countagentrejectretry'];this[_0xb41b('0xd')]=_0xbe053c[_0xb41b('0xd')];this[_0xb41b('0xe')]=_0xbe053c[_0xb41b('0xe')];this[_0xb41b('0x10')]=_0xbe053c[_0xb41b('0x10')];this[_0xb41b('0xf')]=_0xbe053c['countmachineretry'];this[_0xb41b('0x11')]=_0xbe053c[_0xb41b('0x11')];this[_0xb41b('0x8')]=_0xbe053c[_0xb41b('0x8')];this[_0xb41b('0x12')]=_0xbe053c[_0xb41b('0x13')];this[_0xb41b('0x14')]=_0xbe053c[_0xb41b('0x15')];this['starttime']=_0xbe053c['starttime'];this[_0xb41b('0x16')]=_0xbe053c['responsetime'];this[_0xb41b('0x17')]=_0xbe053c['responsetime'];this[_0xb41b('0x18')]=getSeconds(_0xbe053c[_0xb41b('0x16')],_0xbe053c[_0xb41b('0x19')]);this[_0xb41b('0x1a')]=0x0;this['talktime']=0x0;this['callback']=_0xbe053c[_0xb41b('0x1b')];this[_0xb41b('0x1c')]=_0xbe053c['callbackuniqueid'];this['callbackat']=_0xbe053c['callbackat'];this[_0xb41b('0x1d')]=_0xbe053c['recallme'];this[_0xb41b('0x1e')]=_0xbe053c[_0xb41b('0x1e')];this['ListId']=_0xbe053c[_0xb41b('0x1f')];this['UserId']=_0xbe053c['UserId'];this['VoiceQueueId']=_0xbe053c['VoiceQueueId'];this[_0xb41b('0x20')]=_0xbe053c[_0xb41b('0x20')];this[_0xb41b('0x21')]=_0xbe053c[_0xb41b('0x21')]||'';this['originatecalleridname']=_0xbe053c[_0xb41b('0x22')]||'';}module['exports']=History; \ No newline at end of file +var _0x9253=['countabandonedretry','name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','moment','milliseconds','diff','seconds','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry'];(function(_0x455c37,_0x400635){var _0x53c784=function(_0x15f304){while(--_0x15f304){_0x455c37['push'](_0x455c37['shift']());}};_0x53c784(++_0x400635);}(_0x9253,0xf9));var _0x3925=function(_0xb54b31,_0x4ac97c){_0xb54b31=_0xb54b31-0x0;var _0x49d88b=_0x9253[_0xb54b31];return _0x49d88b;};'use strict';var util=require(_0x3925('0x0'));var _=require('lodash');var moment=require(_0x3925('0x1'));function getSeconds(_0x2f4dc4,_0x3650fb){var _0x33140b=moment(_0x2f4dc4)[_0x3925('0x2')](0x0);var _0x2f0125=moment(_0x3650fb)[_0x3925('0x2')](0x0);return _0x33140b[_0x3925('0x3')](_0x2f0125,_0x3925('0x4'));}function History(_0x38f629){this['uniqueid']=_0x38f629['uniqueid'];this['scheduledat']=_0x38f629[_0x3925('0x5')]||undefined;this[_0x3925('0x6')]=_0x38f629[_0x3925('0x6')];this['campaigntype']=_0x38f629[_0x3925('0x6')]===_0x3925('0x7')?_0x3925('0x8'):_0x38f629[_0x3925('0x6')];this[_0x3925('0x9')]=_0x38f629[_0x3925('0x9')];this['countcongestionretry']=_0x38f629[_0x3925('0xa')];this[_0x3925('0xb')]=_0x38f629['countnoanswerretry'];this[_0x3925('0xc')]=_0x38f629[_0x3925('0x9')]+_0x38f629[_0x3925('0xa')]+_0x38f629['countnoanswerretry']+_0x38f629[_0x3925('0xd')]+_0x38f629[_0x3925('0xe')]+_0x38f629['countabandonedretry']+_0x38f629[_0x3925('0xf')]+_0x38f629[_0x3925('0x10')];this['countnosuchnumberretry']=_0x38f629[_0x3925('0xd')];this[_0x3925('0xe')]=_0x38f629[_0x3925('0xe')];this[_0x3925('0x11')]=_0x38f629['countabandonedretry'];this[_0x3925('0xf')]=_0x38f629['countmachineretry'];this[_0x3925('0x10')]=_0x38f629[_0x3925('0x10')];this[_0x3925('0x8')]=_0x38f629[_0x3925('0x8')];this['calleridname']=_0x38f629[_0x3925('0x12')];this[_0x3925('0x13')]=_0x38f629[_0x3925('0x14')];this[_0x3925('0x15')]=_0x38f629['starttime'];this['responsetime']=_0x38f629[_0x3925('0x16')];this[_0x3925('0x17')]=_0x38f629[_0x3925('0x16')];this[_0x3925('0x18')]=getSeconds(_0x38f629[_0x3925('0x16')],_0x38f629[_0x3925('0x15')]);this[_0x3925('0x19')]=0x0;this[_0x3925('0x1a')]=0x0;this[_0x3925('0x1b')]=_0x38f629[_0x3925('0x1b')];this[_0x3925('0x1c')]=_0x38f629['callbackuniqueid'];this[_0x3925('0x1d')]=_0x38f629[_0x3925('0x1d')];this[_0x3925('0x1e')]=_0x38f629['recallme'];this[_0x3925('0x1f')]=_0x38f629[_0x3925('0x1f')];this['ListId']=_0x38f629[_0x3925('0x20')];this[_0x3925('0x21')]=_0x38f629['UserId'];this[_0x3925('0x22')]=_0x38f629[_0x3925('0x22')];this[_0x3925('0x23')]=_0x38f629['CampaignId'];this[_0x3925('0x24')]=_0x38f629['originatecalleridnum']||'';this[_0x3925('0x25')]=_0x38f629[_0x3925('0x25')]||'';}module['exports']=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 7a77cf2..6af163a 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 _0xde9f=['dialQueueProject','AnswerAGI','cause-txt','Unknow','reason','agent','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','Drop','dropreason','TIMEOUT','agiafterat','callAdditionalPhoneAfterMin','voiceQueue','additional','dialDropMaxRetry','starttime','calleridname','calleridnum','Abandoned','CALLEREXIT','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','queueCallerAbandonCreateState','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','channel','actionid','locked','paused','stateinterface','strategy','push','merge','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','finally','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','command','iftime\x20%s,%s','interval','content','indexOf','true','all','some','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','power','handlePower','dialPowerLevel','predictive','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialActive','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','[syncCampaigns]','\x5cw{0,','pow','replace','random','actionOriginate','object','originate','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','originatecalleridname','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','dialCutDigit','substring','trim','from-sip','[originateError]:\x20%s','originate\x20action\x20Error','response','callProgressDetecting','[callProgressDetecting]\x20','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialDropRetryFrequency','[rescheduleContact][Drop]','dialAgentRejectMaxRetry','countagentrejectretry','dialAgentRejectRetryFrequency','entity\x20is\x20undefine','[callProgressDetecting]','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberRetryFrequency','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','checkRetriveMax','reason\x203\x20ringing\x20no\x20answer','custom:agentbusy','busy','reason\x205\x20busy','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','AgentReject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Success','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','predictiveIntervalMaxThreshold','round','predictiveIntervalMinThreshold','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','dropRate','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','getDataPredictive','abandonmentRate','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','dialPredictiveOptimization','outboundQueuePauses','[CatchErlangB]','agentBusyFactor','startMethodPredictive','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','recallme','queueStatusComplete:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','scheduledat','dialRecallMeTimeout','Agent','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','[Originate][historyBlacklist]','inBlackList','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','checkIsBlackListIvr','checkContactBlack','[actionOriginateIvr]\x20','[getContactCampaign2]','floor','dialLimitQueue','not_inuse','[countReScheduled]\x20','ACTIVE','Contact.phone','[getContactDialer2]','tryOriginatePredictive','[actionOriginatePredictive]\x20','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','util','uuid','moment','ioredis','../preview/util/util','../../../config/logger','dialer','booked','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperFinal','../rpc/cmHopperAdditionalPhone','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./final','./agentComplete','./queueCallerAbandon','./hangup','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','sequence','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','agentconnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','\x20AGENTS\x20NOT\x20LOGGED','name','Interval','Intervals','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','type','outbound','answered','available','loggedIn','pTalking','sumBillable','sumHoldTime','talking','unmanaged','abandoned','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','Trunk','active','callerid','md5','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','clearing\x20variable\x20start\x20progressive','handlePredictive','preview','string','\x22\x22\x20<>','error','inspect','stack','length','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','[getContactDialer2][ReScheduled]','AVAILABLE_CONTACTS_FINISHED','waiting','sendMessageOneNotActive','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','endtime','clearZombieChannels','[uniqueid]','[actions]','undefined','isNil','Action','status','catch','updateOriginated','voiceQueues','queue','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','checkIsBlackList','[checkIsBlackList]\x20','verifyAdditionalPhones','[verifyAdditionalPhone]\x20','swapAdditionalPhones','[swapAdditionalPhone]\x20','averageHandleTime','avgHandleTime','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','SIP/%s','reachable','unmonitored','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','statedesc','HangupInAMD','membername','AMD','custom:amd','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','Machine','countmachineretry','countglobal','buildObj','[syncAgentComplete][createHistory][0]','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','countcongestionretry','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]'];(function(_0x4bcfb2,_0x43c1d1){var _0x25579b=function(_0x205028){while(--_0x205028){_0x4bcfb2['push'](_0x4bcfb2['shift']());}};_0x25579b(++_0x43c1d1);}(_0xde9f,0x118));var _0xfde9=function(_0xb5fc3e,_0x234703){_0xb5fc3e=_0xb5fc3e-0x0;var _0x2efc3c=_0xde9f[_0xb5fc3e];return _0x2efc3c;};'use strict';var util=require(_0xfde9('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0xfde9('0x1'));var moment=require(_0xfde9('0x2'));var rr=require('rr');var md5=require('md5');var Redis=require(_0xfde9('0x3'));var ut=require(_0xfde9('0x4'));var config=require('../../../config/environment/');var logger=require(_0xfde9('0x5'))(_0xfde9('0x6'));var loggerBooked=require(_0xfde9('0x5'))(_0xfde9('0x7'));var loggerPredictive=require('../../../config/logger')('predictive');var loggerPredictiveCalls=require(_0xfde9('0x5'))(_0xfde9('0x8'));var loggerSyncQueueSummary=require('../../../config/logger')(_0xfde9('0x9'));var ami=require(_0xfde9('0xa'));config[_0xfde9('0xb')]=_[_0xfde9('0xc')](config[_0xfde9('0xb')],{'host':_0xfde9('0xd'),'port':0x18eb});var io=require(_0xfde9('0xe'))(new Redis(config[_0xfde9('0xb')]));var cmHopper=require(_0xfde9('0xf'));var cmHopperHistory=require(_0xfde9('0x10'));var cmHopperFinal=require(_0xfde9('0x11'));var cmHopperAdditionalPhone=require(_0xfde9('0x12'));var cmHopperBlack=require(_0xfde9('0x13'));var voiceQueueRt=require(_0xfde9('0x14'));var Action=require('./action');var History=require('./history');var Final=require(_0xfde9('0x15'));var AgentComplete=require(_0xfde9('0x16'));var QueueCallerAbandon=require(_0xfde9('0x17'));var Hangup=require(_0xfde9('0x18'));var ipAgi=process['env']['XCALLY_IP_AGI']||_0xfde9('0x19');var strategy={'rrmemory':_0xfde9('0x1a'),'roundrobin':_0xfde9('0x1b')};var Sequence=function(){};Sequence[_0xfde9('0x1c')][_0xfde9('0x1d')]=function(_0x489841){this[_0xfde9('0x1e')]=this[_0xfde9('0x1e')]?this[_0xfde9('0x1e')]['finally'](_0x489841):_0x489841();};function Dialer(_0x31b1c7,_0x6a5413){this[_0xfde9('0x1f')]=new Sequence();this['preview']=_0x6a5413;this['voiceQueues']=_0x31b1c7['voiceQueues'];this['campaigns']=_0x31b1c7[_0xfde9('0x20')];this[_0xfde9('0x21')]=_0x31b1c7['agents'];this['trunks']=_0x31b1c7[_0xfde9('0x22')];this[_0xfde9('0x23')]=config[_0xfde9('0x23')]||0x2;this[_0xfde9('0x24')]={};this[_0xfde9('0x25')]={};this[_0xfde9('0x26')]={};this[_0xfde9('0x27')]={};this[_0xfde9('0x28')]={};this[_0xfde9('0x29')]={};this[_0xfde9('0x2a')]={};this[_0xfde9('0x2b')]={};this[_0xfde9('0x2c')]={};this['queueBookedRR']={};ami['on'](_0xfde9('0x2d'),this['syncAgentConnect'][_0xfde9('0x2e')](this));ami['on'](_0xfde9('0x2f'),this[_0xfde9('0x30')]['bind'](this));ami['on'](_0xfde9('0x31'),this[_0xfde9('0x32')]['bind'](this));ami['on'](_0xfde9('0x33'),this[_0xfde9('0x34')][_0xfde9('0x2e')](this));ami['on'](_0xfde9('0x35'),this[_0xfde9('0x9')][_0xfde9('0x2e')](this));ami['on'](_0xfde9('0x36'),this[_0xfde9('0x37')][_0xfde9('0x2e')](this));ami['on'](_0xfde9('0x38'),this[_0xfde9('0x39')][_0xfde9('0x2e')](this));ami['on'](_0xfde9('0x3a'),this[_0xfde9('0x3b')][_0xfde9('0x2e')](this));ami['on'](_0xfde9('0x3c'),this['syncQueueMember']['bind'](this));ami['on'](_0xfde9('0x3d'),this[_0xfde9('0x3e')]['bind'](this));this[_0xfde9('0x3f')]();this[_0xfde9('0x40')]();}function isNotNull(_0x1651e0){return _0x1651e0!==null&&!_[_0xfde9('0x41')](_0x1651e0);}function checkIsLoggedIn(_0x3c8c48,_0x595b4e){return function(){if(_0x595b4e<=0x0){_0x3c8c48[_0xfde9('0x42')]=_0xfde9('0x43');throw _0x3c8c48['name']+_0xfde9('0x44');}};}function isActive(_0x25b046){return _0x25b046;}function checkIsActive(_0x1613d7,_0x24bf33){return function(){if(!isActive(_0x24bf33)){_0x1613d7[_0xfde9('0x42')]='NOT_ACTIVE';throw _0x1613d7[_0xfde9('0x45')]+'\x20NOT\x20Active';}};}function checkInterval(_0x35dfe5){return function(){if(!isNotNull(_0x35dfe5['Interval'])){_0x35dfe5[_0xfde9('0x42')]='INTERVAL_IS_NULL';throw _0x35dfe5[_0xfde9('0x45')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x35dfe5[_0xfde9('0x46')][_0xfde9('0x47')])){_0x35dfe5[_0xfde9('0x42')]=_0xfde9('0x48');throw _0x35dfe5[_0xfde9('0x45')]+_0xfde9('0x49');}if(!isNotNull(_[_0xfde9('0x4a')](_0x35dfe5[_0xfde9('0x46')][_0xfde9('0x47')]))){_0x35dfe5[_0xfde9('0x42')]=_0xfde9('0x48');throw _0x35dfe5['name']+_0xfde9('0x49');}};}function msgResponse(_0x223949,_0x20c2a4,_0x304323){return{'action':_0x223949,'response':_0x20c2a4,'message':_0x304323,'stack':_0x304323};}function myreject(_0x4f6b6e){return function(_0x3cd49c){return _0x4f6b6e(msgResponse(_0xfde9('0x4b'),_0xfde9('0x4c'),JSON[_0xfde9('0x4d')](_0x3cd49c)));};}function getSeconds(_0x21b30f,_0x29bb5f){var _0x481488=moment(_0x21b30f)[_0xfde9('0x4e')](0x0);var _0x4f96a5=moment(_0x29bb5f)[_0xfde9('0x4e')](0x0);return _0x481488[_0xfde9('0x4f')](_0x4f96a5,_0xfde9('0x50'));}function emit(_0x5bd53a,_0xe47e34,_0x350977){io['to'](_0x5bd53a)[_0xfde9('0x51')](_0xe47e34,_0x350977);}function emitVoiceQueueSummary(_0x2f8f83){if(_0x2f8f83[_0xfde9('0x52')]===_0xfde9('0x53')){var _0x3da564={'id':_0x2f8f83['id'],'name':_0x2f8f83[_0xfde9('0x45')],'strategy':_0x2f8f83['strategy'],'answered':_0x2f8f83[_0xfde9('0x54')],'available':_0x2f8f83[_0xfde9('0x55')],'loggedIn':_0x2f8f83[_0xfde9('0x56')],'pTalking':_0x2f8f83[_0xfde9('0x57')],'sumBillable':_0x2f8f83[_0xfde9('0x58')],'sumDuration':_0x2f8f83['sumDuration'],'sumHoldTime':_0x2f8f83[_0xfde9('0x59')]||0x0,'talking':_0x2f8f83[_0xfde9('0x5a')],'total':_0x2f8f83['total'],'type':_0x2f8f83[_0xfde9('0x52')],'unmanaged':_0x2f8f83[_0xfde9('0x5b')],'abandoned':_0x2f8f83[_0xfde9('0x5c')],'waiting':_0x2f8f83['waiting'],'loggedInDb':_0x2f8f83['loggedInDb'],'dialActive':_0x2f8f83['dialActive'],'dialMethod':_0x2f8f83[_0xfde9('0x5d')],'dialOriginateCallerIdName':_0x2f8f83[_0xfde9('0x5e')],'dialOriginateCallerIdNumber':_0x2f8f83[_0xfde9('0x5f')],'dialOriginateTimeout':_0x2f8f83[_0xfde9('0x60')],'dialPrefix':_0x2f8f83[_0xfde9('0x61')],'outboundAnswerAgiCallsDay':_0x2f8f83[_0xfde9('0x62')],'outboundAnswerCallsDay':_0x2f8f83[_0xfde9('0x63')],'outboundBlacklistCallsDay':_0x2f8f83[_0xfde9('0x64')],'outboundBusyCallsDay':_0x2f8f83[_0xfde9('0x65')],'outboundCongestionCallsDay':_0x2f8f83[_0xfde9('0x66')],'outboundDropCallsDayACS':_0x2f8f83[_0xfde9('0x67')],'outboundDropCallsDayCallersExit':_0x2f8f83[_0xfde9('0x68')],'outboundDropCallsDayTimeout':_0x2f8f83['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x2f8f83['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x2f8f83['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x2f8f83['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x2f8f83[_0xfde9('0x69')],'outboundRejectCallsDay':_0x2f8f83[_0xfde9('0x6a')],'outboundUnknownCallsDay':_0x2f8f83[_0xfde9('0x6b')],'predictiveIntervalAnsweredCalls':_0x2f8f83[_0xfde9('0x6c')],'predictiveIntervalAvgHoldtime':_0x2f8f83[_0xfde9('0x6d')],'predictiveIntervalAvgTalktime':_0x2f8f83[_0xfde9('0x6e')],'predictiveIntervalDroppedCallsCallersExit':_0x2f8f83[_0xfde9('0x6f')],'predictiveIntervalDroppedCallsTimeout':_0x2f8f83[_0xfde9('0x70')],'predictiveIntervalErlangCalls':_0x2f8f83[_0xfde9('0x71')],'predictiveIntervalErlangCallsDroppedCalls':_0x2f8f83[_0xfde9('0x72')],'predictiveIntervalHitRate':_0x2f8f83[_0xfde9('0x73')],'predictiveIntervalMultiplicativeFactor':_0x2f8f83[_0xfde9('0x74')],'predictiveIntervalPauses':_0x2f8f83[_0xfde9('0x75')],'predictiveIntervalAvailable':_0x2f8f83[_0xfde9('0x76')],'predictiveIntervalTotalCalls':_0x2f8f83[_0xfde9('0x77')],'message':_0x2f8f83[_0xfde9('0x42')],'originated':_0x2f8f83[_0xfde9('0x78')],'erlangCalls':_0x2f8f83[_0xfde9('0x79')],'erlangCallToSecond':_0x2f8f83[_0xfde9('0x7a')],'erlangAbandonmentRate':_0x2f8f83['erlangAbandonmentRate'],'erlangBusyFactor':_0x2f8f83[_0xfde9('0x7b')],'startPredictive':_0x2f8f83[_0xfde9('0x29')],'startProgressive':_0x2f8f83[_0xfde9('0x2a')]};if(_0x2f8f83[_0xfde9('0x7c')]){_0x3da564[_0xfde9('0x7c')]={'id':_0x2f8f83[_0xfde9('0x7c')]['id'],'name':_0x2f8f83['Trunk'][_0xfde9('0x45')],'active':_0x2f8f83['Trunk'][_0xfde9('0x7d')],'callerid':_0x2f8f83['Trunk'][_0xfde9('0x7e')]};}if(_0x2f8f83[_0xfde9('0x46')]){_0x3da564[_0xfde9('0x46')]={'id':_0x2f8f83[_0xfde9('0x46')]['id'],'name':_0x2f8f83[_0xfde9('0x46')]['name']};}var _0x1c9140=md5(JSON[_0xfde9('0x4d')](_0x3da564));if(_0x2f8f83[_0xfde9('0x7f')]!==_0x1c9140){_0x2f8f83[_0xfde9('0x7f')]=_0x1c9140;emit(util[_0xfde9('0x80')](_0xfde9('0x81'),_0x3da564[_0xfde9('0x45')]),_0xfde9('0x82'),_0x3da564);}}}function emitCampaignSummary(_0x76df85){if(_0x76df85[_0xfde9('0x52')]===_0xfde9('0x83')){emit(util['format'](_0xfde9('0x84'),_0x76df85[_0xfde9('0x45')]),_0xfde9('0x85'),_0x76df85);}}function checkGetDataPredictive(_0xaa49a5){if(isNotNull(_0xaa49a5)&&!_[_0xfde9('0x4a')](_0xaa49a5)){loggerPredictive[_0xfde9('0x86')](_0xfde9('0x87'));loggerPredictive[_0xfde9('0x86')](_0xfde9('0x88'),_0xaa49a5[_0xfde9('0x77')]);loggerPredictive[_0xfde9('0x86')](_0xfde9('0x89'),_0xaa49a5[_0xfde9('0x6c')]);loggerPredictive['info'](_0xfde9('0x8a'),_0xaa49a5['predictiveIntervalDroppedCallsTimeout']);loggerPredictive['info'](_0xfde9('0x8b'),_0xaa49a5[_0xfde9('0x6f')]);loggerPredictive[_0xfde9('0x86')](_0xfde9('0x8c'),_0xaa49a5['predictiveIntervalAvgHoldtime']);loggerPredictive[_0xfde9('0x86')](_0xfde9('0x8d'),_0xaa49a5[_0xfde9('0x6e')]);loggerPredictive[_0xfde9('0x86')](_0xfde9('0x8e'));if(_0xaa49a5['predictiveIntervalTotalCalls']>0x0){if(!_[_0xfde9('0x41')](_0xaa49a5[_0xfde9('0x6e')])&&_0xaa49a5[_0xfde9('0x6e')]>0x0){return!![];}loggerPredictive[_0xfde9('0x86')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0xfde9('0x41')](_0xaa49a5['predictiveIntervalAvgHoldtime'])&&_0xaa49a5[_0xfde9('0x6d')]>0x0){return!![];}loggerPredictive[_0xfde9('0x86')](_0xfde9('0x8f'));}else{loggerPredictive[_0xfde9('0x86')](_0xfde9('0x90'));}}else{loggerPredictive[_0xfde9('0x86')](_0xfde9('0x91'));}return![];}function mergeDataErlangB(_0x1faa9d){return function(_0x12ff2b){loggerPredictive[_0xfde9('0x86')](_0xfde9('0x92'));loggerPredictive[_0xfde9('0x86')](_0xfde9('0x93'),_0x12ff2b['erlangCalls']);loggerPredictive[_0xfde9('0x86')](_0xfde9('0x94'),_0x12ff2b['erlangCallToSecond']);loggerPredictive[_0xfde9('0x86')](_0xfde9('0x95'),_0x12ff2b[_0xfde9('0x96')]);loggerPredictive[_0xfde9('0x86')](_0xfde9('0x97'),_0x12ff2b[_0xfde9('0x7b')]);loggerPredictive[_0xfde9('0x86')](_0xfde9('0x95'),_0x12ff2b[_0xfde9('0x96')]);loggerPredictive['info'](_0xfde9('0x8e'));_['merge'](_0x1faa9d,_0x12ff2b);};}function getDiff(_0x404f2c){var _0x25b0c4=moment()['milliseconds'](0x0);var _0xdd9962=moment(_0x404f2c)[_0xfde9('0x4e')](0x0);return _0x25b0c4['diff'](_0xdd9962,_0xfde9('0x50'));}function ifInterval(_0x25342c,_0x4d8fdc){if(_[_0xfde9('0x41')](_0x4d8fdc)){return![];}return getDiff(_0x4d8fdc)<_0x25342c*0x3c;}function freeVariablesPredictive(_0x1538c6){if(isNotNull(_0x1538c6)){if(!_[_0xfde9('0x41')](_0x1538c6['startProgressive'])){_0x1538c6[_0xfde9('0x2a')]=undefined;loggerPredictive[_0xfde9('0x86')](_0x1538c6[_0xfde9('0x45')],_0xfde9('0x98'));}if(!_[_0xfde9('0x41')](_0x1538c6['startPredictive'])){_0x1538c6[_0xfde9('0x29')]=undefined;loggerPredictive[_0xfde9('0x86')](_0x1538c6['name'],'clearing\x20variable\x20start\x20predictive');}if(!_[_0xfde9('0x41')](_0x1538c6[_0xfde9('0x99')])){clearInterval(_0x1538c6[_0xfde9('0x99')]);_0x1538c6[_0xfde9('0x99')]=undefined;loggerPredictive[_0xfde9('0x86')](_0x1538c6[_0xfde9('0x45')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x2eedf4,_0x113c67){if(_0x113c67===0x0){return 0x0;}var _0x140815=0x1;for(var _0x3672a6=0x1;_0x3672a6<=_0x113c67;_0x3672a6+=0x1){_0x140815=0x1+_0x140815*_0x3672a6/_0x2eedf4;}return 0x1/_0x140815;}function isVoiceQueueOutbound(_0x49ec58){return _0x49ec58==='outbound';}function isNotPreview(_0x377999){return _0x377999!==_0xfde9('0x9a');}function isCampaignIvr(_0x52e5f3){return _0x52e5f3===_0xfde9('0x83');}function getCallerId(_0x2a48a3,_0x5b5952,_0x3944f1){if(!_[_0xfde9('0x41')](_0x3944f1)&&typeof _0x3944f1===_0xfde9('0x9b')&&!_[_0xfde9('0x4a')](_0x3944f1)){if(!_[_0xfde9('0x41')](_0x5b5952)&&typeof _0x5b5952===_0xfde9('0x9b')&&!_[_0xfde9('0x4a')](_0x5b5952)){return util[_0xfde9('0x80')]('\x22%s\x22\x20<%s>',_0x5b5952,_0x3944f1);}return util[_0xfde9('0x80')]('\x22%s\x22\x20<%s>',_0x3944f1,_0x3944f1);}if(!_['isUndefined'](_0x2a48a3)&&typeof _0x2a48a3===_0xfde9('0x9b')&&!_[_0xfde9('0x4a')](_0x2a48a3)){return _0x2a48a3;}return _0xfde9('0x9c');}function loggerCatchQueueSummary(_0x16a2f6,_0x4dc93b){return function(_0x365fea){freeVariablesPredictive(_0x4dc93b);emitVoiceQueueSummary(_0x4dc93b);emitCampaignSummary(_0x4dc93b);loggerSyncQueueSummary[_0xfde9('0x9d')](_0x16a2f6,util[_0xfde9('0x9e')](_0x365fea,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x279b72,_0x3ff27b){return function(_0x575e31){loggerPredictive[_0xfde9('0x9d')](_0x3ff27b[_0xfde9('0x45')],_0x279b72);loggerPredictive[_0xfde9('0x9d')](_0x575e31[_0xfde9('0x9f')]);freeVariablesPredictive(_0x3ff27b);};}function loggerCatch(_0x566b97){return function(_0x1a1bb0){logger[_0xfde9('0x9d')](_0x566b97,util[_0xfde9('0x9e')](_0x1a1bb0,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x512033){return _0x512033&&!_[_0xfde9('0x41')](_0x512033)&&_0x512033[_0xfde9('0xa0')]>0x0;}function decremetOriginate(_0x4151f4){if(!_[_0xfde9('0x41')](_0x4151f4)&&_0x4151f4!==null){if(typeof _0x4151f4[_0xfde9('0x78')]!=='undefined'){if(_0x4151f4[_0xfde9('0x78')]>0x0){_0x4151f4[_0xfde9('0x78')]-=0x1;}else{logger[_0xfde9('0x9d')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0xfde9('0x9d')](_0xfde9('0xa1'));}}function checkContactLowerLimitOriginate(_0x48066e,_0x5f0468,_0x4b9506){if(_0x5f0468>_0x4b9506){for(var _0x6ec80e=0x0;_0x6ec80e<_0x5f0468-_0x4b9506;_0x6ec80e+=0x1){decremetOriginate(_0x48066e);}}}function loggerGetContactDialer(_0x1566e5,_0x540234,_0x487d56){return function(_0x1a7fd2){checkContactLowerLimitOriginate(_0x540234,_0x487d56,0x0);logger[_0xfde9('0x9d')](_0x1566e5,util['inspect'](_0x1a7fd2,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x522342){return function(_0x4347c2){if(isNotNull(_0x4347c2)&&isNotNull(_0x4347c2[0x0])){if(_0x4347c2[0x0][_0xfde9('0xa2')]>0x0){_0x522342[_0xfde9('0x42')]='RESCHEDULED_CONTACTS';logger[_0xfde9('0x86')](_0xfde9('0xa3')+_0x522342[_0xfde9('0x45')],_0x4347c2[0x0]['contactsRescheduled'],'contacts');}else{_0x522342['message']=_0xfde9('0xa4');logger[_0xfde9('0x86')]('[getContactDialer2][Empty]'+_0x522342[_0xfde9('0x45')]);}}};}function notSendMessagesQueue(_0x3fd1c2){if(_0x3fd1c2['sendMessageOneNotActive']){freeVariablesPredictive(_0x3fd1c2);if(_0x3fd1c2[_0xfde9('0x78')]===0x0&&_0x3fd1c2['talking']===0x0&&_0x3fd1c2[_0xfde9('0xa5')]===0x0&&(_0x3fd1c2['pTalking']||0x0)===0x0){_0x3fd1c2[_0xfde9('0xa6')]=![];_0x3fd1c2['available']=0x0;_0x3fd1c2[_0xfde9('0x42')]=_0xfde9('0xa7');loggerSyncQueueSummary[_0xfde9('0x9d')](_0xfde9('0xa8'),_0x3fd1c2[_0xfde9('0x45')],_0xfde9('0xa9'));}else{_0x3fd1c2[_0xfde9('0x42')]=_0xfde9('0xaa');loggerSyncQueueSummary[_0xfde9('0x9d')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x3fd1c2[_0xfde9('0x45')],_0xfde9('0xab'));}emitVoiceQueueSummary(_0x3fd1c2);}}function notSendMessagesCampaign(_0x75364a){if(_0x75364a[_0xfde9('0xa6')]){if(_0x75364a[_0xfde9('0x78')]===0x0){_0x75364a[_0xfde9('0xa6')]=![];_0x75364a[_0xfde9('0x42')]=_0xfde9('0xa7');loggerSyncQueueSummary[_0xfde9('0x9d')](_0xfde9('0xac'),_0x75364a[_0xfde9('0x45')],'is\x20not\x20active');}else{_0x75364a[_0xfde9('0x42')]=_0xfde9('0xaa');loggerSyncQueueSummary[_0xfde9('0x9d')](_0xfde9('0xac'),_0x75364a[_0xfde9('0x45')],_0xfde9('0xab'));}emitCampaignSummary(_0x75364a);}}function createObjHistory(_0x217799,_0x22afee,_0xff80b,_0xfd764d,_0x4b8b7e){_0x217799[_0xfde9('0x42')]=_0xff80b;var _0x3d0569=new Action(_0x217799,_0x22afee);var _0x1f4046=new History(_0x3d0569);_0x1f4046[_0xfde9('0xad')]=_0xfd764d;_0x1f4046['statedesc']=_0x4b8b7e;_0x1f4046[_0xfde9('0xae')]=_0x3d0569['starttime'];return _0x1f4046;}Dialer[_0xfde9('0x1c')]['loopClearZombieChannels']=function(){var _0x54a781=this;setInterval(function(){_0x54a781[_0xfde9('0xaf')](_0x54a781['uniqueId'],_0xfde9('0xb0'));_0x54a781[_0xfde9('0xaf')](_0x54a781[_0xfde9('0x25')],_0xfde9('0xb1'));},0x32c8);};Dialer[_0xfde9('0x1c')]['clearZombieChannels']=function(_0x40b1a2,_0x5977e7){var _0x34a750=this;for(var _0x2ec37b in _0x40b1a2){if(typeof _0x40b1a2[_0x2ec37b]!==_0xfde9('0xb2')){this['sequence'][_0xfde9('0x1d')](function(){if(!_[_0xfde9('0xb3')](_0x40b1a2[_0x2ec37b])){return ami[_0xfde9('0xb4')]({'action':_0xfde9('0xb5'),'channel':_0x40b1a2[_0x2ec37b]['channel']})[_0xfde9('0xb6')](function(_0xf2f3ff){if(_0xf2f3ff[_0xfde9('0x42')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x40b1a2[_0x2ec37b]&&_0x40b1a2[_0x2ec37b][_0xfde9('0x52')]!=='ivr'){_0x34a750[_0xfde9('0xb7')](_0x34a750[_0xfde9('0xb8')][_0x40b1a2[_0x2ec37b][_0xfde9('0xb9')]]);logger[_0xfde9('0x9d')]('[Dialer][checkChannel]',_0x5977e7,_0x2ec37b,_0x40b1a2[_0x2ec37b][_0xfde9('0xb9')]);delete _0x40b1a2[_0x2ec37b];}if(_0x40b1a2[_0x2ec37b]&&_0x40b1a2[_0x2ec37b][_0xfde9('0x52')]===_0xfde9('0x83')){_0x34a750[_0xfde9('0xb7')](_0x34a750[_0xfde9('0x20')][_0x40b1a2[_0x2ec37b][_0xfde9('0xb9')]]);logger[_0xfde9('0x9d')](_0xfde9('0xba'),_0x5977e7,_0x2ec37b,_0x40b1a2[_0x2ec37b][_0xfde9('0xb9')]);delete _0x40b1a2[_0x2ec37b];}},0x2328);}});}});}}};Dialer['prototype'][_0xfde9('0xbb')]=function(_0xf5ef10){return BPromise[_0xfde9('0xbc')]()[_0xfde9('0xbd')](cmHopper[_0xfde9('0xbb')](_0xf5ef10))[_0xfde9('0xb6')](loggerCatch('[countReScheduled]\x20'));};Dialer[_0xfde9('0x1c')][_0xfde9('0xbe')]=function(_0x15bf5d){return BPromise[_0xfde9('0xbc')]()[_0xfde9('0xbd')](cmHopperBlack['checkIsBlackList'](_0x15bf5d))[_0xfde9('0xb6')](loggerCatch(_0xfde9('0xbf')));};Dialer[_0xfde9('0x1c')]['verifyAdditionalPhones']=function(_0x151e4d,_0x584984,_0xa7756f){return BPromise[_0xfde9('0xbc')]()[_0xfde9('0xbd')](cmHopperAdditionalPhone[_0xfde9('0xc0')](_0x151e4d,_0x584984,_0xa7756f))[_0xfde9('0xb6')](loggerCatch(_0xfde9('0xc1')));};Dialer[_0xfde9('0x1c')][_0xfde9('0xc2')]=function(_0x58d7b8,_0x57e3f3,_0x41cdbb){return BPromise['resolve']()['then'](cmHopperAdditionalPhone['swapAdditionalPhones'](_0x58d7b8,_0x57e3f3,_0x41cdbb))['catch'](loggerCatch(_0xfde9('0xc3')));};Dialer[_0xfde9('0x1c')]['checkIsBlackListIvr']=function(_0x2d709f){return BPromise[_0xfde9('0xbc')]()[_0xfde9('0xbd')](cmHopperBlack['checkIsBlackListIvr'](_0x2d709f))['catch'](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer['prototype'][_0xfde9('0xc4')]=function(_0x4d6f0e){return BPromise[_0xfde9('0xbc')]()[_0xfde9('0xbd')](cmHopperHistory[_0xfde9('0xc5')](_0x4d6f0e))[_0xfde9('0xb6')](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0xfde9('0x1c')][_0xfde9('0xc6')]=function(_0x1dbb64){return BPromise[_0xfde9('0xbc')]()[_0xfde9('0xbd')](cmHopper[_0xfde9('0xc6')](_0x1dbb64))[_0xfde9('0xb6')](loggerCatch(_0xfde9('0xc7')));};Dialer[_0xfde9('0x1c')][_0xfde9('0xc8')]=function(_0x554ee9,_0x39ae38,_0x574b41){return BPromise[_0xfde9('0xbc')]()['then'](cmHopper[_0xfde9('0xc8')](_0x554ee9,_0x39ae38,_0x574b41))[_0xfde9('0xb6')](loggerCatch(_0xfde9('0xc9')));};Dialer['prototype'][_0xfde9('0xca')]=function(_0x36cea0,_0x4a4302,_0x524582,_0x11d97c,_0x5e60e4){return BPromise[_0xfde9('0xbc')]()[_0xfde9('0xbd')](cmHopper[_0xfde9('0xca')](_0x36cea0,_0x4a4302,_0x524582,_0x11d97c))[_0xfde9('0xb6')](function(_0x2c1334){_0x5e60e4['temp']-=_0x524582;_0x5e60e4[_0xfde9('0xcb')]=_0x5e60e4[_0xfde9('0xcb')]>0x0?_0x5e60e4[_0xfde9('0xcb')]:0x0;loggerCatch(_0xfde9('0xcc'))(_0x2c1334);});};Dialer['prototype'][_0xfde9('0xcd')]=function(_0x545f81,_0x4e07a8,_0x554317,_0x2628b1){return BPromise[_0xfde9('0xbc')]()[_0xfde9('0xbd')](cmHopper[_0xfde9('0xcd')](_0x545f81,_0x4e07a8,_0x554317))[_0xfde9('0xb6')](function(_0x404bdb){_0x2628b1[_0xfde9('0xcb')]-=_0x4e07a8;_0x2628b1[_0xfde9('0xcb')]=_0x2628b1[_0xfde9('0xcb')]>0x0?_0x2628b1[_0xfde9('0xcb')]:0x0;loggerCatch(_0xfde9('0xce'))(_0x404bdb);});};Dialer['prototype'][_0xfde9('0xcf')]=function(_0x8fbb4c){return BPromise[_0xfde9('0xbc')]()[_0xfde9('0xbd')](voiceQueueRt[_0xfde9('0xcf')](_0x8fbb4c))[_0xfde9('0xb6')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0xfde9('0x1c')][_0xfde9('0xd0')]=function(_0x43c1ca){return BPromise['resolve']()[_0xfde9('0xbd')](cmHopper[_0xfde9('0xd0')](_0x43c1ca))[_0xfde9('0xb6')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0xfde9('0x1c')][_0xfde9('0xd1')]=function(_0xca42cb){return BPromise['resolve']()[_0xfde9('0xbd')](cmHopperHistory[_0xfde9('0xd1')](_0xca42cb))['catch'](loggerCatch(_0xfde9('0xd2')));};Dialer['prototype']['updateOriginated']=function(_0xad3791){if(!_['isUndefined'](_0xad3791)&&_0xad3791!==null){if(typeof _0xad3791[_0xfde9('0x78')]!==_0xfde9('0xb2')){if(_0xad3791[_0xfde9('0x78')]>0x0){_0xad3791[_0xfde9('0x78')]-=0x1;}else{logger[_0xfde9('0x9d')](_0xfde9('0xd3'));}}}else{logger[_0xfde9('0x9d')](_0xfde9('0xd4'));}};Dialer[_0xfde9('0x1c')][_0xfde9('0xd5')]=function(_0x3016b2,_0x36b601){var _0x2b15e4=this;return function(_0x5175ef){_0x2b15e4['updateOriginated'](_0x36b601);logger[_0xfde9('0x9d')](_0x3016b2,util[_0xfde9('0x9e')](_0x5175ef,{'showHidden':![],'depth':null}));};};Dialer[_0xfde9('0x1c')][_0xfde9('0xd6')]=function(_0x4ec9f2,_0x555cb5,_0x533f54){var _0xf36734={'state':0x19,'statedesc':_0xfde9('0xd7')};this[_0xfde9('0xb7')](_0x555cb5);this[_0xfde9('0xd8')](_['merge'](_0xf36734,_[_0xfde9('0xd9')](_0x533f54,[_0xfde9('0xda'),_0xfde9('0xdb'),_0xfde9('0xdc'),_0xfde9('0xdd'),_0xfde9('0xde')])),_0xfde9('0xdf'),_0xfde9('0xe0'));logger[_0xfde9('0x9d')](_0x4ec9f2);};Dialer[_0xfde9('0x1c')][_0xfde9('0xe1')]=function(_0x1d1369){return _0x1d1369==='Success';};Dialer['prototype']['isTrunkReachable']=function(_0x421db2){return!_['isUndefined'](_0x421db2)&&_0x421db2&&!_[_0xfde9('0x41')](_0x421db2['name'])&&!_['isUndefined'](_0x421db2[_0xfde9('0x7d')])&&_0x421db2['active']&&(this['trunks'][util[_0xfde9('0x80')](_0xfde9('0xe2'),_0x421db2[_0xfde9('0x45')])]['status']===_0xfde9('0xe3')||this['trunks'][util['format'](_0xfde9('0xe2'),_0x421db2[_0xfde9('0x45')])][_0xfde9('0xb5')]===_0xfde9('0xe4'));};Dialer['prototype'][_0xfde9('0xd8')]=function(_0x41c1a1,_0x31e1ad,_0x447e79){this[_0xfde9('0xd1')](_0x41c1a1)[_0xfde9('0xb6')](loggerCatch(_0x31e1ad));this[_0xfde9('0xd0')](_0x41c1a1)[_0xfde9('0xb6')](loggerCatch(_0x447e79));};Dialer[_0xfde9('0x1c')][_0xfde9('0x3b')]=function(_0xe6f988){var _0x4eb6a4=this['uniqueId'][_0xe6f988[_0xfde9('0xe5')]];var _0x2a642d;if(!_['isNil'](_0xe6f988)&&!_['isNil'](_0xe6f988[_0xfde9('0xe6')])&&!_['isNil'](_0xe6f988[_0xfde9('0xe6')][_0xfde9('0xe7')])&&_0xe6f988[_0xfde9('0xe8')]===_0xfde9('0xe9')&&_0x4eb6a4){if(_0x4eb6a4['type']!==_0xfde9('0x83')&&this[_0xfde9('0xb8')][_0x4eb6a4[_0xfde9('0xb9')]][_0xfde9('0xea')]&&_0xe6f988[_0xfde9('0xeb')]===_0xfde9('0xec')){delete this[_0xfde9('0x27')][_0xe6f988[_0xfde9('0xe5')]];this[_0xfde9('0xb7')](this['voiceQueues'][_0x4eb6a4[_0xfde9('0xb9')]]);this[_0xfde9('0xb8')][_0x4eb6a4['queue']][_0xfde9('0x63')]+=0x1;this[_0xfde9('0xb8')][_0x4eb6a4[_0xfde9('0xb9')]][_0xfde9('0x62')]+=0x1;_0x2a642d=new Hangup(_0x4eb6a4,_0xe6f988);_0x2a642d[_0xfde9('0xad')]=0x12;_0x2a642d[_0xfde9('0xed')]=_0xfde9('0xee');_0x2a642d[_0xfde9('0xef')]=_0xfde9('0xf0');ami[_0xfde9('0x51')](_0xfde9('0xf1'),ut['buildObj'](_0x2a642d,_0xfde9('0xf2')));this[_0xfde9('0xd8')](_0x2a642d,_0xfde9('0xf3'),_0xfde9('0xf4'));}if(_0x4eb6a4[_0xfde9('0x52')]!==_0xfde9('0x83')&&this[_0xfde9('0xb8')][_0x4eb6a4[_0xfde9('0xb9')]][_0xfde9('0xea')]&&_0xe6f988['value']==='MACHINE'){var _0x965c99=this;return new BPromise(function(_0x132067,_0x2c8213){delete _0x965c99[_0xfde9('0x27')][_0xe6f988[_0xfde9('0xe5')]];_0x965c99[_0xfde9('0xb7')](_0x965c99[_0xfde9('0xb8')][_0x4eb6a4[_0xfde9('0xb9')]]);_0x965c99['voiceQueues'][_0x4eb6a4[_0xfde9('0xb9')]]['outboundAnswerCallsDay']+=0x1;_0x965c99['voiceQueues'][_0x4eb6a4[_0xfde9('0xb9')]][_0xfde9('0x62')]+=0x1;var _0x1f8755=_0x965c99['voiceQueues'][_0x4eb6a4[_0xfde9('0xb9')]];var _0x392a0e=new Hangup(_0x4eb6a4,_0xe6f988);_0x392a0e['state']=0x13;_0x392a0e[_0xfde9('0xed')]=_0xfde9('0xf5');_0x392a0e[_0xfde9('0xef')]=_0xfde9('0xf0');_0x392a0e[_0xfde9('0xf6')]+=0x1;_0x392a0e[_0xfde9('0xf7')]+=0x1;_0x392a0e[_0xfde9('0xf2')]=!![];ami[_0xfde9('0x51')](_0xfde9('0xf1'),ut[_0xfde9('0xf8')](_0x392a0e,_0xfde9('0xf2')));_0x965c99['createHistory'](_0x392a0e)[_0xfde9('0xb6')](loggerCatch(_0xfde9('0xf9')));if(_0x392a0e[_0xfde9('0xfa')]+_0x392a0e['countcongestionretry']+_0x392a0e[_0xfde9('0xfb')]+_0x392a0e[_0xfde9('0xfc')]+_0x392a0e[_0xfde9('0xfd')]+_0x392a0e[_0xfde9('0xfe')]+_0x392a0e[_0xfde9('0xf6')]+_0x392a0e['countagentrejectretry']>=_0x1f8755[_0xfde9('0xff')]){_0x965c99[_0xfde9('0x100')](_0x392a0e,_0x132067,_0x2c8213,_0xfde9('0x101'));}else{if(_0x392a0e[_0xfde9('0xf6')]>=_0x1f8755[_0xfde9('0x102')]){_0x965c99[_0xfde9('0x103')](_0x392a0e,_0x132067,_0x2c8213,_0xfde9('0x104'));}else{_0x965c99['rescheduleContact']({'active':![],'countmachineretry':_0x392a0e[_0xfde9('0xf6')],'scheduledat':moment()[_0xfde9('0x105')](_0x1f8755[_0xfde9('0x106')],_0xfde9('0x107'))[_0xfde9('0x80')](_0xfde9('0x108')),'ContactId':_0x392a0e[_0xfde9('0xda')],'ListId':_0x392a0e[_0xfde9('0xdb')],'VoiceQueueId':_0x392a0e[_0xfde9('0xdd')]||undefined,'CampaignId':_0x392a0e['CampaignId']||undefined})[_0xfde9('0xb6')](loggerCatch(_0xfde9('0x109')));_0x132067({'reschedule':0x1});}}});}if(_0x4eb6a4[_0xfde9('0x52')]==='ivr'&&this[_0xfde9('0x20')][_0x4eb6a4['queue']][_0xfde9('0xea')]&&_0xe6f988[_0xfde9('0xeb')]===_0xfde9('0xec')){delete this[_0xfde9('0x27')][_0xe6f988[_0xfde9('0xe5')]];this[_0xfde9('0xb7')](this[_0xfde9('0x20')][_0x4eb6a4[_0xfde9('0xb9')]]);_0x2a642d=new Hangup(_0x4eb6a4,_0xe6f988);_0x2a642d[_0xfde9('0xad')]=0x12;_0x2a642d[_0xfde9('0xed')]=_0xfde9('0xee');_0x2a642d[_0xfde9('0xef')]=_0xfde9('0xf0');ami['emit'](_0xfde9('0xf1'),ut[_0xfde9('0xf8')](_0x2a642d,_0xfde9('0xf2')));this[_0xfde9('0xd8')](_0x2a642d,_0xfde9('0x10a'),_0xfde9('0x10b'));}if(_0x4eb6a4[_0xfde9('0x52')]===_0xfde9('0x83')&&this[_0xfde9('0x20')][_0x4eb6a4['queue']][_0xfde9('0xea')]&&_0xe6f988[_0xfde9('0xeb')]===_0xfde9('0x10c')){var _0x965c99=this;return new BPromise(function(_0x1e89a1,_0x404146){delete _0x965c99[_0xfde9('0x27')][_0xe6f988[_0xfde9('0xe5')]];_0x965c99[_0xfde9('0xb7')](_0x965c99['campaigns'][_0x4eb6a4[_0xfde9('0xb9')]]);_0x965c99[_0xfde9('0x20')][_0x4eb6a4[_0xfde9('0xb9')]][_0xfde9('0x63')]+=0x1;_0x965c99[_0xfde9('0x20')][_0x4eb6a4[_0xfde9('0xb9')]][_0xfde9('0x62')]+=0x1;var _0xe0d679=_0x965c99[_0xfde9('0x20')][_0x4eb6a4['queue']];var _0x55394f=new Hangup(_0x4eb6a4,_0xe6f988);_0x55394f[_0xfde9('0xad')]=0x13;_0x55394f[_0xfde9('0xed')]=_0xfde9('0xf5');_0x55394f[_0xfde9('0xef')]=_0xfde9('0xf0');_0x55394f[_0xfde9('0xf6')]+=0x1;_0x55394f[_0xfde9('0xf7')]+=0x1;_0x55394f[_0xfde9('0xf2')]=!![];ami[_0xfde9('0x51')](_0xfde9('0xf1'),ut[_0xfde9('0xf8')](_0x55394f,_0xfde9('0xf2')));_0x965c99[_0xfde9('0xd1')](_0x55394f)[_0xfde9('0xb6')](loggerCatch(_0xfde9('0xf9')));if(_0x55394f['countbusyretry']+_0x55394f[_0xfde9('0x10d')]+_0x55394f['countnoanswerretry']+_0x55394f[_0xfde9('0xfc')]+_0x55394f['countdropretry']+_0x55394f[_0xfde9('0xfe')]+_0x55394f[_0xfde9('0xf6')]+_0x55394f['countagentrejectretry']>=_0xe0d679[_0xfde9('0xff')]){_0x965c99[_0xfde9('0x100')](_0x55394f,_0x1e89a1,_0x404146,'reason19\x20machine....');}else{if(_0x55394f[_0xfde9('0xf6')]>=_0xe0d679['dialMachineMaxRetry']){_0x965c99['createStateFinal'](_0x55394f,_0x1e89a1,_0x404146,_0xfde9('0x104'));}else{_0x965c99[_0xfde9('0xc6')]({'active':![],'countmachineretry':_0x55394f[_0xfde9('0xf6')],'scheduledat':moment()[_0xfde9('0x105')](_0xe0d679[_0xfde9('0x106')],_0xfde9('0x107'))[_0xfde9('0x80')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x55394f[_0xfde9('0xda')],'ListId':_0x55394f['ListId'],'VoiceQueueId':_0x55394f['VoiceQueueId']||undefined,'CampaignId':_0x55394f['CampaignId']||undefined})[_0xfde9('0xb6')](loggerCatch(_0xfde9('0x109')));_0x1e89a1({'reschedule':0x1});}}});}}};Dialer[_0xfde9('0x1c')][_0xfde9('0x37')]=function(_0x12db22){var _0x2f4dec=this[_0xfde9('0x27')][_0x12db22['uniqueid']];var _0x423f2f=this;var _0x344c52;if(_0x2f4dec&&_0x2f4dec[_0xfde9('0x52')]===_0xfde9('0x83')){delete this[_0xfde9('0x27')][_0x12db22[_0xfde9('0xe5')]];this[_0xfde9('0xb7')](this[_0xfde9('0x20')][_0x2f4dec[_0xfde9('0xb9')]]);this[_0xfde9('0x20')][_0x2f4dec[_0xfde9('0xb9')]][_0xfde9('0x10e')]+=0x1;_0x344c52=new Hangup(_0x2f4dec,_0x12db22);this['createHistory'](_0x344c52)['catch'](loggerCatch(_0xfde9('0x10f')));this['moveContactManagedDialer'](_0x344c52)[_0xfde9('0xb6')](loggerCatch(_0xfde9('0x110')));}if(_0x2f4dec&&_0x2f4dec['type']!==_0xfde9('0x83')&&isNotNull(this[_0xfde9('0xb8')][_0x2f4dec[_0xfde9('0xb9')]][_0xfde9('0x111')])){delete this['uniqueId'][_0x12db22['uniqueid']];this[_0xfde9('0xb7')](this[_0xfde9('0xb8')][_0x2f4dec[_0xfde9('0xb9')]]);this[_0xfde9('0xb8')][_0x2f4dec['queue']]['outboundAnswerCallsDay']+=0x1;this[_0xfde9('0xb8')][_0x2f4dec[_0xfde9('0xb9')]]['outboundAnswerAgiCallsDay']+=0x1;_0x344c52=new Hangup(_0x2f4dec,_0x12db22);_0x344c52[_0xfde9('0xad')]=0x10;_0x344c52[_0xfde9('0xed')]=_0xfde9('0x112');_0x344c52[_0xfde9('0xef')]='AGI';this[_0xfde9('0xd1')](_0x344c52)[_0xfde9('0xb6')](loggerCatch(_0xfde9('0x10f')));this['moveContactManagedDialer'](_0x344c52)[_0xfde9('0xb6')](loggerCatch(_0xfde9('0x110')));}if(_0x2f4dec&&_0x2f4dec[_0xfde9('0x52')]!==_0xfde9('0x83')&&!isNotNull(this[_0xfde9('0xb8')][_0x2f4dec[_0xfde9('0xb9')]][_0xfde9('0x111')])){delete this[_0xfde9('0x27')][_0x12db22[_0xfde9('0xe5')]];this[_0xfde9('0xb7')](this[_0xfde9('0xb8')][_0x2f4dec[_0xfde9('0xb9')]]);this[_0xfde9('0xb8')][_0x2f4dec[_0xfde9('0xb9')]]['outboundUnknownCallsDay']+=0x1;_0x344c52=new Hangup(_0x2f4dec,_0x12db22);_0x344c52[_0xfde9('0xad')]=0xc;_0x344c52['statedesc']=_0x12db22[_0xfde9('0x113')];_0x344c52['membername']=_0xfde9('0x114');this[_0xfde9('0xd1')](_0x344c52)[_0xfde9('0xb6')](loggerCatch(_0xfde9('0x10f')));this[_0xfde9('0xd0')](_0x344c52)[_0xfde9('0xb6')](loggerCatch(_0xfde9('0x110')));}};Dialer['prototype'][_0xfde9('0x34')]=function(_0x55bbbb){var _0x5c83d3=this[_0xfde9('0x27')][_0x55bbbb[_0xfde9('0xe5')]];var _0x242afe=this;if(this['voiceQueues'][_0x55bbbb[_0xfde9('0xb9')]]){if(_0x5c83d3&&_0x5c83d3['type']!=='ivr'){delete this['uniqueId'][_0x55bbbb[_0xfde9('0xe5')]];this['voiceQueues'][_0x55bbbb[_0xfde9('0xb9')]][_0xfde9('0x63')]+=0x1;var _0x332aee=new AgentComplete(_0x5c83d3,_0x55bbbb);if(_0x55bbbb[_0xfde9('0x115')]===_0xfde9('0x116')){_0x332aee['agiafterat']=this['voiceQueues'][_0x55bbbb[_0xfde9('0xb9')]][_0xfde9('0x117')]&&this[_0xfde9('0xb8')][_0x55bbbb[_0xfde9('0xb9')]][_0xfde9('0x118')]?moment()['format'](_0xfde9('0x108')):undefined;}this['createHistory'](_0x332aee)['catch'](loggerCatch(_0xfde9('0x119')));this[_0xfde9('0xd0')](_0x332aee)[_0xfde9('0xb6')](loggerCatch(_0xfde9('0x11a')));}}};Dialer[_0xfde9('0x1c')]['syncAgentConnect']=function(_0x113129){if(this[_0xfde9('0xb8')][_0x113129[_0xfde9('0xb9')]]){if(this[_0xfde9('0x27')][_0x113129[_0xfde9('0xe5')]]&&this[_0xfde9('0x27')][_0x113129[_0xfde9('0xe5')]][_0xfde9('0x52')]!=='ivr'){this[_0xfde9('0xb7')](this[_0xfde9('0xb8')][_0x113129[_0xfde9('0xb9')]]);this[_0xfde9('0x27')][_0x113129['uniqueid']][_0xfde9('0x11b')]=moment()[_0xfde9('0x80')](_0xfde9('0x108'));}}};Dialer[_0xfde9('0x1c')]['queueCallerAbandonCreateState']=function(_0x1e22f0,_0x413a07){this[_0xfde9('0xd1')](_0x1e22f0)[_0xfde9('0xb6')](loggerCatch(_0xfde9('0x119')));if(_0x413a07==0x0){this['moveContactManagedDialer'](_0x1e22f0)[_0xfde9('0xb6')](loggerCatch(_0xfde9('0x11c')));}};Dialer[_0xfde9('0x1c')][_0xfde9('0x30')]=function(_0x9696a9){var _0x488a5b=this[_0xfde9('0x27')][_0x9696a9[_0xfde9('0xe5')]];var _0x24ea47=this;var _0x53c1a7=![];var _0x552fb0;var _0x2493ed;if(this[_0xfde9('0xb8')][_0x9696a9['queue']]){if(_0x488a5b&&_0x488a5b[_0xfde9('0x52')]!==_0xfde9('0x83')){delete this[_0xfde9('0x27')][_0x9696a9[_0xfde9('0xe5')]];this['updateOriginated'](this['voiceQueues'][_0x9696a9[_0xfde9('0xb9')]]);_0x488a5b[_0xfde9('0x11d')]=moment()[_0xfde9('0x80')](_0xfde9('0x108'));var _0x2a510c=new QueueCallerAbandon(_0x488a5b,_0x9696a9);if(getSeconds(_0x488a5b['droptime'],_0x488a5b[_0xfde9('0x11e')])>=_0x488a5b[_0xfde9('0x11f')]){this['voiceQueues'][_0x9696a9[_0xfde9('0xb9')]][_0xfde9('0x70')]+=0x1;this[_0xfde9('0xb8')][_0x9696a9['queue']][_0xfde9('0x120')]+=0x1;this['voiceQueues'][_0x9696a9[_0xfde9('0xb9')]][_0xfde9('0x72')]+=0x1;_0x2a510c[_0xfde9('0xad')]=0xa;_0x2a510c[_0xfde9('0xed')]=_0xfde9('0x121');_0x2a510c[_0xfde9('0x122')]=_0xfde9('0x123');_0x2a510c[_0xfde9('0x124')]=this[_0xfde9('0xb8')][_0x9696a9['queue']][_0xfde9('0x117')]?moment()[_0xfde9('0x80')](_0xfde9('0x108')):undefined;_0x2a510c['countdropretry']+=0x1;_0x2a510c[_0xfde9('0xf7')]+=0x1;_0x552fb0=this[_0xfde9('0xb8')][_0x9696a9[_0xfde9('0xb9')]]['dialDropRetryFrequency'];_0x2493ed=this[_0xfde9('0xb8')][_0x9696a9[_0xfde9('0xb9')]][_0xfde9('0x125')];_0x24ea47[_0xfde9('0xc0')](_0x2a510c,_0x2a510c['state'],_0x488a5b[_0xfde9('0x126')])[_0xfde9('0xbd')](function(_0x4bf6fd){_0x53c1a7=_0x4bf6fd[_0xfde9('0x127')]==0x1;if(_0x2a510c[_0xfde9('0xfd')]>=_0x24ea47[_0xfde9('0xb8')][_0x9696a9[_0xfde9('0xb9')]][_0xfde9('0x128')]){_0x24ea47['queueCallerAbandonCreateState'](_0x2a510c,_0x4bf6fd[_0xfde9('0x127')]);}else{_0x24ea47[_0xfde9('0xc6')]({'active':![],'countdropretry':_0x2a510c['countdropretry'],'scheduledat':moment()['add'](_0x24ea47[_0xfde9('0xb8')][_0x9696a9[_0xfde9('0xb9')]]['dialDropRetryFrequency'],_0xfde9('0x107'))['format'](_0xfde9('0x108')),'ContactId':_0x488a5b[_0xfde9('0xda')],'ListId':_0x488a5b[_0xfde9('0xdb')],'VoiceQueueId':_0x488a5b[_0xfde9('0xdd')]||undefined,'CampaignId':_0x488a5b['CampaignId']||undefined})[_0xfde9('0xb6')](loggerCatch('[rescheduleContact][Drop]'));var _0x2744e3=new History(_0x2a510c);_0x2744e3['state']=0xa;_0x2744e3[_0xfde9('0xed')]='Drop';_0x2744e3[_0xfde9('0x129')]=moment()[_0xfde9('0x80')]('YYYY-MM-DD\x20HH:mm:ss');_0x2744e3[_0xfde9('0xae')]=_0x2744e3[_0xfde9('0x129')];_0x2744e3[_0xfde9('0x12a')]=_0x2a510c[_0xfde9('0x12a')];_0x2744e3[_0xfde9('0x12b')]=_0x2a510c[_0xfde9('0x12b')];_0x24ea47['createHistory'](_0x2744e3)['catch'](loggerCatch('[syncAgentComplete][createHistory][10]'));}})[_0xfde9('0xbd')](function(_0x4ae575){if(_0x53c1a7)_0x24ea47[_0xfde9('0xc2')](_0x2a510c,_0x552fb0,_0x2493ed)[_0xfde9('0xbd')](function(_0x5bdcc9){return 0x1;});});}else{this[_0xfde9('0xb8')][_0x9696a9[_0xfde9('0xb9')]][_0xfde9('0x6f')]+=0x1;this[_0xfde9('0xb8')][_0x9696a9[_0xfde9('0xb9')]][_0xfde9('0x68')]+=0x1;_0x2a510c[_0xfde9('0xad')]=0xb;_0x2a510c['statedesc']=_0xfde9('0x12c');_0x2a510c[_0xfde9('0x122')]=_0xfde9('0x12d');_0x2a510c[_0xfde9('0xfe')]+=0x1;_0x2a510c[_0xfde9('0xf7')]+=0x1;_0x552fb0=this[_0xfde9('0xb8')][_0x9696a9[_0xfde9('0xb9')]][_0xfde9('0x12e')];_0x2493ed=this['voiceQueues'][_0x9696a9[_0xfde9('0xb9')]][_0xfde9('0x125')];_0x24ea47['verifyAdditionalPhones'](_0x2a510c,_0x2a510c['state'],_0x488a5b[_0xfde9('0x126')])[_0xfde9('0xbd')](function(_0x3beee6){if(_0x2a510c['countabandonedretry']>=_0x24ea47['voiceQueues'][_0x9696a9[_0xfde9('0xb9')]][_0xfde9('0x12f')]){_0x24ea47[_0xfde9('0x130')](_0x2a510c,_0x3beee6[_0xfde9('0x127')]);}else{_0x24ea47[_0xfde9('0xc6')]({'active':![],'countabandonedretry':_0x2a510c[_0xfde9('0xfe')],'scheduledat':moment()[_0xfde9('0x105')](_0x24ea47['voiceQueues'][_0x9696a9[_0xfde9('0xb9')]]['dialAbandonedRetryFrequency'],_0xfde9('0x107'))[_0xfde9('0x80')](_0xfde9('0x108')),'ContactId':_0x488a5b['ContactId'],'ListId':_0x488a5b[_0xfde9('0xdb')],'VoiceQueueId':_0x488a5b['VoiceQueueId']||undefined,'CampaignId':_0x488a5b[_0xfde9('0xde')]||undefined})[_0xfde9('0xb6')](loggerCatch(_0xfde9('0x131')));var _0xcd46b9=new History(_0x2a510c);_0xcd46b9[_0xfde9('0xad')]=0xb;_0xcd46b9[_0xfde9('0xed')]=_0xfde9('0x12c');_0xcd46b9['starttime']=moment()['format'](_0xfde9('0x108'));_0xcd46b9[_0xfde9('0xae')]=_0xcd46b9[_0xfde9('0x129')];_0xcd46b9[_0xfde9('0x12a')]=_0x2a510c['calleridname'];_0xcd46b9[_0xfde9('0x12b')]=_0x2a510c[_0xfde9('0x12b')];_0x24ea47[_0xfde9('0xd1')](_0xcd46b9)[_0xfde9('0xb6')](loggerCatch(_0xfde9('0x132')));}})[_0xfde9('0xbd')](function(_0x426794){if(_0x53c1a7)_0x24ea47[_0xfde9('0xc2')](_0x2a510c,_0x552fb0,_0x2493ed)[_0xfde9('0xbd')](function(_0xf9ba5f){return 0x1;});});}}}};Dialer[_0xfde9('0x1c')][_0xfde9('0x39')]=function(_0x7bfc5f){if(this[_0xfde9('0x25')][_0x7bfc5f[_0xfde9('0xe5')]]){this[_0xfde9('0x25')][_0x7bfc5f[_0xfde9('0xe5')]][_0xfde9('0x133')]=_0x7bfc5f['channel'];}if(this[_0xfde9('0x27')][_0x7bfc5f['uniqueid']]){this[_0xfde9('0x27')][_0x7bfc5f['uniqueid']][_0xfde9('0x133')]=_0x7bfc5f[_0xfde9('0x133')];}};Dialer[_0xfde9('0x1c')]['syncQueueMember']=function(_0x3e04c1){if(strategy[this[_0xfde9('0xb8')][this[_0xfde9('0x25')][_0x3e04c1['actionid']][_0xfde9('0xb9')]]['strategy']]===_0xfde9('0x1b')){if(this['actions'][_0x3e04c1[_0xfde9('0x134')]]&&_['isNil'](this[_0xfde9('0x25')][_0x3e04c1['actionid']][_0xfde9('0x135')])&&_0x3e04c1[_0xfde9('0xb5')]==='1'&&_0x3e04c1[_0xfde9('0x136')]==='0'){if(this[_0xfde9('0x21')][_0x3e04c1[_0xfde9('0x137')]]){if(!this['agents'][_0x3e04c1[_0xfde9('0x137')]][_0xfde9('0x135')]){this['agents'][_0x3e04c1[_0xfde9('0x137')]]['locked']=!![];this[_0xfde9('0x25')][_0x3e04c1[_0xfde9('0x134')]][_0xfde9('0x135')]=!![];this[_0xfde9('0x25')][_0x3e04c1['actionid']][_0xfde9('0x137')]=_0x3e04c1[_0xfde9('0x137')];}}}}else if((strategy[this[_0xfde9('0xb8')][this['actions'][_0x3e04c1[_0xfde9('0x134')]][_0xfde9('0xb9')]][_0xfde9('0x138')]]||_0xfde9('0x1a'))==='rrmemory'){if(this[_0xfde9('0x25')][_0x3e04c1[_0xfde9('0x134')]]){if(this[_0xfde9('0x21')][_0x3e04c1[_0xfde9('0x137')]]){this[_0xfde9('0x25')][_0x3e04c1[_0xfde9('0x134')]][_0xfde9('0x137')]=_0x3e04c1[_0xfde9('0x137')];if(_[_0xfde9('0xb3')](this[_0xfde9('0x2c')][this[_0xfde9('0x25')][_0x3e04c1[_0xfde9('0x134')]][_0xfde9('0xb9')]])){this[_0xfde9('0x2c')][this[_0xfde9('0x25')][_0x3e04c1[_0xfde9('0x134')]][_0xfde9('0xb9')]]=[];}this['queueBooked'][this[_0xfde9('0x25')][_0x3e04c1[_0xfde9('0x134')]][_0xfde9('0xb9')]][_0xfde9('0x139')](_[_0xfde9('0x13a')](_[_0xfde9('0xd9')](this['actions'][_0x3e04c1[_0xfde9('0x134')]],['idHopper','stateinterface']),{'status':_0x3e04c1['status'],'paused':_0x3e04c1[_0xfde9('0x136')]}));}}}};function unlockQueueStatus(_0x27e1c4,_0x4221f7){setTimeout(function(){if(_['isUndefined'](_0x27e1c4[_0xfde9('0x13b')])){loggerBooked[_0xfde9('0x9d')](_0xfde9('0x13c'),_0x4221f7);}_0x27e1c4['queueStatusComplete']=!![];loggerBooked[_0xfde9('0x86')](_0xfde9('0x13d'),_0x4221f7,JSON[_0xfde9('0x4d')](_[_0xfde9('0xd9')](_0x27e1c4,[_0xfde9('0x45'),'queueStatusComplete'])));},0x1f3);}Dialer[_0xfde9('0x1c')][_0xfde9('0x3e')]=function(_0x50d98c){var _0x3caafb=this;var _0x5c7d9c=_0x3caafb[_0xfde9('0xb8')][_0x3caafb['actions'][_0x50d98c[_0xfde9('0x134')]][_0xfde9('0xb9')]];if(strategy[this['voiceQueues'][this[_0xfde9('0x25')][_0x50d98c['actionid']][_0xfde9('0xb9')]][_0xfde9('0x138')]]===_0xfde9('0x1b')){if(this[_0xfde9('0x25')][_0x50d98c['actionid']]&&this[_0xfde9('0x25')][_0x50d98c['actionid']][_0xfde9('0x137')]){this[_0xfde9('0x9a')][_0xfde9('0x13e')](this[_0xfde9('0x25')][_0x50d98c[_0xfde9('0x134')]][_0xfde9('0x13f')],this[_0xfde9('0x25')][_0x50d98c[_0xfde9('0x134')]][_0xfde9('0x137')])[_0xfde9('0xb6')](function(_0x30fbe7){logger[_0xfde9('0x9d')](_0xfde9('0x140'),util[_0xfde9('0x9e')](_0x30fbe7,{'showHidden':![],'depth':null}));})['finally'](function(){_0x3caafb[_0xfde9('0xb7')](_0x3caafb[_0xfde9('0xb8')][_0x3caafb[_0xfde9('0x25')][_0x50d98c['actionid']][_0xfde9('0xb9')]]);_0x3caafb['agents'][_0x3caafb['actions'][_0x50d98c['actionid']][_0xfde9('0x137')]][_0xfde9('0x135')]=![];delete _0x3caafb[_0xfde9('0x25')][_0x50d98c[_0xfde9('0x134')]];unlockQueueStatus(_0x5c7d9c);});}else{this[_0xfde9('0xb7')](this[_0xfde9('0xb8')][this[_0xfde9('0x25')][_0x50d98c[_0xfde9('0x134')]]['queue']]);this[_0xfde9('0xc6')]({'active':![],'ContactId':this[_0xfde9('0x25')][_0x50d98c[_0xfde9('0x134')]]['ContactId'],'ListId':this[_0xfde9('0x25')][_0x50d98c[_0xfde9('0x134')]][_0xfde9('0xdb')],'VoiceQueueId':this[_0xfde9('0x25')][_0x50d98c['actionid']][_0xfde9('0xdd')]||undefined,'CampaignId':this[_0xfde9('0x25')][_0x50d98c[_0xfde9('0x134')]][_0xfde9('0xde')]||undefined})[_0xfde9('0xb6')](loggerCatch(_0xfde9('0x141')));delete this[_0xfde9('0x25')][_0x50d98c[_0xfde9('0x134')]];unlockQueueStatus(_0x5c7d9c);}}else if((strategy[this[_0xfde9('0xb8')][this[_0xfde9('0x25')][_0x50d98c[_0xfde9('0x134')]][_0xfde9('0xb9')]][_0xfde9('0x138')]]||_0xfde9('0x1a'))===_0xfde9('0x1a')){var _0xbc8c1d;if(this[_0xfde9('0x25')][_0x50d98c[_0xfde9('0x134')]]&&!_['isEmpty'](this[_0xfde9('0x2c')][this[_0xfde9('0x25')][_0x50d98c[_0xfde9('0x134')]][_0xfde9('0xb9')]])){if(this['queueBookedRR'][_0x3caafb[_0xfde9('0x25')][_0x50d98c[_0xfde9('0x134')]][_0xfde9('0xb9')]]){this[_0xfde9('0x142')][_0x3caafb[_0xfde9('0x25')][_0x50d98c[_0xfde9('0x134')]][_0xfde9('0xb9')]]=this['queueBookedRR'][this['actions'][_0x50d98c[_0xfde9('0x134')]][_0xfde9('0xb9')]]?this['queueBookedRR'][this[_0xfde9('0x25')][_0x50d98c[_0xfde9('0x134')]][_0xfde9('0xb9')]]:this[_0xfde9('0x2c')][this[_0xfde9('0x25')][_0x50d98c[_0xfde9('0x134')]]['queue']]?this[_0xfde9('0x2c')][this[_0xfde9('0x25')][_0x50d98c[_0xfde9('0x134')]][_0xfde9('0xb9')]][_0xfde9('0x143')]||0x0:0x0;}this[_0xfde9('0x2c')][this[_0xfde9('0x25')][_0x50d98c[_0xfde9('0x134')]][_0xfde9('0xb9')]]['_rr']=this['queueBookedRR'][this['actions'][_0x50d98c[_0xfde9('0x134')]]['queue']];for(var _0x490b57=0x0;_0x490b57=0x0;})[_0xfde9('0xb6')](myreject(_0x4f91a5)));}}else{_0x5c6229[_0xfde9('0x139')](ami[_0xfde9('0xb4')]({'action':_0xfde9('0x15a'),'command':util[_0xfde9('0x80')](_0xfde9('0x15b'),_0x217f18,!_[_0xfde9('0x41')](config[_0xfde9('0x158')][_0x3355c8])?_0x3355c8:'')})['then'](function(_0x302921){return _0x302921[_0xfde9('0x15d')][_0xfde9('0x15e')](_0xfde9('0x15f'))>=0x0;})['catch'](myreject(_0x4f91a5)));}BPromise[_0xfde9('0x160')](_0x5c6229)[_0xfde9('0xbd')](function(_0x1aeb30){var _0x15456e=_[_0xfde9('0x161')](_0x1aeb30);if(_0x15456e){return _0x1201b3(_0x15456e);}else{_0x28e80b[_0xfde9('0x42')]=_0x597f94?'GLOBAL_INTERVAL_IS_OVERTIME':'INTERVAL_IS_OVERTIME';return _0x4f91a5(msgResponse('[ifTime][promiseAll]',_0xfde9('0x155'),_0xfde9('0x162')+_0x597f94+'\x20'+_0x342f78+_0xfde9('0x163')+util['inspect'](_0x217f18,{'showHidden':![],'depth':null})+_0xfde9('0x164')+_0x3355c8));}})['catch'](function(_0x4a0d3d){return _0x4f91a5(msgResponse(_0xfde9('0x154'),_0xfde9('0x155'),JSON['stringify'](_0x4a0d3d)));});});};Dialer[_0xfde9('0x1c')][_0xfde9('0x165')]=function(_0xde8928){var _0x32e9f2=this;return function(){switch(_0xde8928['dialMethod']){case _0xfde9('0x166'):freeVariablesPredictive(_0xde8928);_0x32e9f2['handlePower'](_0xde8928,0x1);break;case _0xfde9('0x167'):freeVariablesPredictive(_0xde8928);_0x32e9f2[_0xfde9('0x168')](_0xde8928,_0xde8928[_0xfde9('0x169')]);break;case _0xfde9('0x16a'):_0x32e9f2['predictive'](_0xde8928);break;case'booked':freeVariablesPredictive(_0xde8928);_0x32e9f2['handlePower'](_0xde8928,0x1);break;default:freeVariablesPredictive(_0xde8928);logger[_0xfde9('0x9d')](_0xfde9('0x16b'),_0xde8928[_0xfde9('0x45')],_0xfde9('0x16c'));}};};Dialer[_0xfde9('0x1c')][_0xfde9('0x16d')]=function(_0x5080d7){var _0xf6378b=this;return function(){_0xf6378b[_0xfde9('0x16e')](_0x5080d7);};};Dialer['prototype']['syncQueueSummary']=function(_0x3851fc){var _0x47e818=this;if(isNotPreview(_0x3851fc[_0xfde9('0x5d')])){if(isVoiceQueueOutbound(_0x3851fc[_0xfde9('0x52')])&&isActive(_0x3851fc[_0xfde9('0x16f')])){_0x3851fc[_0xfde9('0xa6')]=!![];BPromise[_0xfde9('0xbc')]()[_0xfde9('0xbd')](checkIsLoggedIn(_0x3851fc,_0x3851fc[_0xfde9('0x56')]))[_0xfde9('0xbd')](checkIsActive(_0x3851fc,_0x3851fc[_0xfde9('0x16f')]))[_0xfde9('0xbd')](checkInterval(_0x3851fc))[_0xfde9('0xbd')](_0x47e818[_0xfde9('0x170')](_0x3851fc))[_0xfde9('0xbd')](_0x47e818['checkIfTime'](_0x3851fc[_0xfde9('0x171')],_0x3851fc[_0xfde9('0x172')],_0x3851fc[_0xfde9('0x45')],_0x3851fc))[_0xfde9('0xbd')](_0x47e818[_0xfde9('0x153')](_0x3851fc['Interval'],_0x3851fc['dialTimezone'],_0x3851fc[_0xfde9('0x45')],_0x3851fc))['then'](_0x47e818['checkDialMethod'](_0x3851fc))[_0xfde9('0xb6')](loggerCatchQueueSummary('[syncQueueSummary]',_0x3851fc));}else{notSendMessagesQueue(_0x3851fc);}}else{freeVariablesPredictive(_0x3851fc);}};Dialer[_0xfde9('0x1c')]['syncCampaigns']=function(){var _0x22b26a=this;var _0x149402;for(var _0x7f7652 in this[_0xfde9('0x20')]){if(typeof this['campaigns'][_0x7f7652]!==_0xfde9('0xb2')){_0x149402=this[_0xfde9('0x20')][_0x7f7652];if(isCampaignIvr(_0x149402[_0xfde9('0x52')])&&isActive(_0x149402[_0xfde9('0x7d')])){_0x149402[_0xfde9('0xa6')]=!![];BPromise[_0xfde9('0xbc')]()[_0xfde9('0xbd')](checkIsActive(_0x149402,_0x149402['active']))[_0xfde9('0xbd')](checkInterval(_0x149402))[_0xfde9('0xbd')](_0x22b26a[_0xfde9('0x170')](_0x149402))[_0xfde9('0xbd')](_0x22b26a[_0xfde9('0x152')](_0x149402[_0xfde9('0x171')],_0x149402[_0xfde9('0x172')],_0x149402[_0xfde9('0x45')],_0x149402))['then'](_0x22b26a[_0xfde9('0x153')](_0x149402[_0xfde9('0x46')],_0x149402[_0xfde9('0x172')],_0x149402[_0xfde9('0x45')],_0x149402))[_0xfde9('0xbd')](_0x22b26a['launchHandleIvr'](_0x149402))[_0xfde9('0xb6')](loggerCatchQueueSummary(_0xfde9('0x173'),_0x149402));}else{notSendMessagesCampaign(_0x149402);}}}};function getCallerIdRandom(_0x5b33a1,_0x24dd59){var _0x3bd1bf;var _0x57c1b3;var _0x1ab818;if(_0x24dd59<=0x0){_0x24dd59=0x1;}_0x3bd1bf=new RegExp(_0xfde9('0x174')+_0x24dd59+'}$');_0x57c1b3=Math[_0xfde9('0x175')](0xa,_0x24dd59-0x1);_0x1ab818=Math['pow'](0xa,_0x24dd59)-0x1;return util[_0xfde9('0x80')]('%s',_[_0xfde9('0x176')](_0x5b33a1,_0x3bd1bf,_[_0xfde9('0x177')](_0x57c1b3,_0x1ab818)));}function extractCalleridName(_0x6851c){var _0x5b7015=_0x6851c['match'](/"(.*?)"/);return _0x5b7015?_0x5b7015[0x1]:_0x6851c;}function extractCalleridNumber(_0x4583b8){var _0x281cfe=_0x4583b8['match'](/<(.*?)>/);return _0x281cfe?_0x281cfe[0x1]:_0x4583b8;}Dialer[_0xfde9('0x1c')][_0xfde9('0x178')]=function(_0x50527a,_0x295937){var _0x381577=this;var _0x439568=uuid['v4']();this[_0xfde9('0x25')][_0x439568]=new Action(_0x50527a,_0x295937,_0x439568);return new BPromise(function(_0x56c498,_0x3f462d){if(_[_0xfde9('0x41')](_0x50527a)&&typeof _0x50527a!==_0xfde9('0x179')){return _0x3f462d(msgResponse(_0xfde9('0x17a'),'Failure','voiceQueue\x20is\x20undefine'));}if(_[_0xfde9('0x41')](_0x295937[_0xfde9('0x17b')])||_0x295937['phone']===null){return _0x3f462d(msgResponse(_0xfde9('0x17a'),_0xfde9('0x155'),_0xfde9('0x17c')));}var _0x43007b={'XMD-CALLERID':_0x381577[_0xfde9('0x25')][_0x439568][_0xfde9('0x17d')](),'XMD-AGI':_0x50527a['dialQueueProject']?util[_0xfde9('0x80')](_0xfde9('0x17e'),ipAgi,_0x50527a['dialQueueProject']):'NONE','XMD-AGIAFTER':_0x50527a[_0xfde9('0x117')]?util[_0xfde9('0x80')]('\x22agi://%s/square,%s\x22',ipAgi,_0x50527a[_0xfde9('0x117')]):_0xfde9('0x17f'),'XMD-QUEUE':_0x50527a[_0xfde9('0x52')]===_0xfde9('0x53')?util['format'](_0xfde9('0x180'),_0x50527a[_0xfde9('0x45')],_0x50527a[_0xfde9('0x181')]||'',_0x50527a[_0xfde9('0x118')]?'c':'',_0x50527a[_0xfde9('0x11f')]||0x3):'NONE','XMD-CONTACTID':_0x295937[_0xfde9('0xda')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x381577[_0xfde9('0x25')][_0x439568]['getCaller'](),'XMD-AMD':_0x50527a[_0xfde9('0xea')]?'ACTIVE':_0xfde9('0x17f'),'XMD-DESTINATION':_0xfde9('0xe9')};if(_0x50527a[_0xfde9('0xea')]){_0x43007b['XMD-AMDINITIALSILENCE']=_0x50527a['dialAMDInitialSilence']||0x9c4;_0x43007b[_0xfde9('0x182')]=_0x50527a[_0xfde9('0x183')]||0x5dc;_0x43007b[_0xfde9('0x184')]=_0x50527a[_0xfde9('0x185')]||0x320;_0x43007b['XMD-AMDTOTALANALYSISTIME']=_0x50527a[_0xfde9('0x186')]||0x1388;_0x43007b[_0xfde9('0x187')]=_0x50527a[_0xfde9('0x188')]||0x64;_0x43007b[_0xfde9('0x189')]=_0x50527a[_0xfde9('0x18a')]||0x32;_0x43007b[_0xfde9('0x18b')]=_0x50527a['dialAMDMaximumNumberOfWords']||0x3;_0x43007b[_0xfde9('0x18c')]=_0x50527a[_0xfde9('0x18d')]||0x100;_0x43007b['XMD-AMDMAXIMUMWORDLENGTH']=_0x50527a[_0xfde9('0x18e')]||0x1388;}if(_0x50527a['type']===_0xfde9('0x53')){_0x43007b[_0xfde9('0x18f')]=_0x295937[_0xfde9('0xdd')];}else{_0x43007b[_0xfde9('0x190')]=_0x295937[_0xfde9('0xde')];}for(var _0x30c867 in _0x295937[_0xfde9('0x191')]){if(typeof _0x295937[_0xfde9('0x191')][_0x30c867]!==_0xfde9('0xb2')){if(isNotNull(_0x295937['Contact'][_0x30c867])&&_0x30c867!=='id'&&_0x30c867!==_0xfde9('0x192')&&_0x30c867!==_0xfde9('0x193')&&_0x30c867!==_0xfde9('0x194')){_0x43007b[util[_0xfde9('0x80')](_0xfde9('0x195'),_0xfde9('0x196'),_[_0xfde9('0x197')](_0x30c867))]=_0x295937[_0xfde9('0x191')][_0x30c867];}}}var _0x481e0b=_0x381577[_0xfde9('0x14e')](_0x50527a['Trunk'])?getCallerId(_0x50527a[_0xfde9('0x7c')][_0xfde9('0x7e')],_0x50527a[_0xfde9('0x5e')],_0x50527a[_0xfde9('0x198')]>0x0?getCallerIdRandom(_0x50527a[_0xfde9('0x5f')],_0x50527a[_0xfde9('0x198')]):_0x50527a[_0xfde9('0x5f')]):getCallerId(_[_0xfde9('0xb3')](_0x50527a[_0xfde9('0x14f')])?_0x50527a[_0xfde9('0x7c')][_0xfde9('0x7e')]:_0x50527a[_0xfde9('0x14f')]['callerid'],_0x50527a[_0xfde9('0x5e')],_0x50527a[_0xfde9('0x198')]>0x0?getCallerIdRandom(_0x50527a['dialOriginateCallerIdNumber'],_0x50527a[_0xfde9('0x198')]):_0x50527a['dialOriginateCallerIdNumber']);if(_0x481e0b){_0x43007b['XMD-ORIGINATECALLERIDNAME']=_0x381577[_0xfde9('0x25')][_0x439568][_0xfde9('0x199')]=extractCalleridName(_0x481e0b);_0x43007b[_0xfde9('0x19a')]=_0x295937[_0xfde9('0x17b')];}return ami[_0xfde9('0xb4')]({'actionid':_0x439568,'action':_0xfde9('0x17a'),'channel':_0x381577[_0xfde9('0x14e')](_0x50527a[_0xfde9('0x7c')])?util['format'](_0xfde9('0x19b'),_0x50527a[_0xfde9('0x7c')][_0xfde9('0x45')],isNotNull(_0x50527a[_0xfde9('0x61')])?_0x50527a[_0xfde9('0x61')]['trim']()||'':'',_0x50527a[_0xfde9('0x19c')]>0x0?_0x295937[_0xfde9('0x17b')][_0xfde9('0x19d')](_0x50527a[_0xfde9('0x19c')]):_0x295937[_0xfde9('0x17b')]):util[_0xfde9('0x80')](_0xfde9('0x19b'),_[_0xfde9('0xb3')](_0x50527a[_0xfde9('0x14f')])?_0x50527a[_0xfde9('0x7c')][_0xfde9('0x45')]:_0x50527a[_0xfde9('0x14f')][_0xfde9('0x45')],isNotNull(_0x50527a[_0xfde9('0x61')])?_0x50527a['dialPrefix'][_0xfde9('0x19e')]()||'':'',_0x50527a[_0xfde9('0x19c')]>0x0?_0x295937[_0xfde9('0x17b')][_0xfde9('0x19d')](_0x50527a[_0xfde9('0x19c')]):_0x295937[_0xfde9('0x17b')]),'callerid':_0x481e0b,'Exten':_0xfde9('0xe9'),'Context':_0xfde9('0x19f'),'Priority':'1','variable':_0x43007b,'timeout':(_0x50527a['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x439568})[_0xfde9('0xbd')](function(_0x4c0976){return _0x56c498(_0x4c0976);})['catch'](function(_0x12084d){_0x50527a['outboundOriginateFailureCallsDay']+=0x1;var _0x129e74=new History(_0x381577[_0xfde9('0x25')][_0x439568]);logger[_0xfde9('0x9d')](util[_0xfde9('0x80')](_0xfde9('0x1a0'),JSON[_0xfde9('0x4d')](_0x12084d)));_0x129e74[_0xfde9('0xad')]=0xe;_0x129e74[_0xfde9('0xed')]='OriginateError';_0x129e74[_0xfde9('0x129')]=moment()['format'](_0xfde9('0x108'));_0x129e74['endtime']=_0x129e74['starttime'];_0x381577[_0xfde9('0xd1')](_0x129e74)[_0xfde9('0xb6')](loggerCatch('[originate][error]'));_0x381577[_0xfde9('0xd0')](_0x129e74)['catch'](loggerCatch('[originate][error]'))[_0xfde9('0x147')](function(){delete _0x381577[_0xfde9('0x25')][_0x439568];return _0x3f462d(msgResponse(_0xfde9('0x17a'),'Error',_0xfde9('0x1a1')));});});});};Dialer[_0xfde9('0x1c')][_0xfde9('0x32')]=function(_0x44a9b3){var _0x4b6e13=this[_0xfde9('0x25')][_0x44a9b3[_0xfde9('0x134')]];if(_0x4b6e13){delete this['actions'][_0x44a9b3[_0xfde9('0x134')]];_0x4b6e13[_0xfde9('0x11e')]=moment()[_0xfde9('0x80')](_0xfde9('0x108'));var _0xa58a12=_0x4b6e13[_0xfde9('0x52')]===_0xfde9('0x83')?this[_0xfde9('0x20')][_0x4b6e13[_0xfde9('0xb9')]]:this['voiceQueues'][_0x4b6e13['getQueue']()];if(!this[_0xfde9('0xe1')](_0x44a9b3[_0xfde9('0x1a2')])){this['updateOriginated'](_0xa58a12);return this[_0xfde9('0x1a3')](_0x4b6e13,_0xa58a12,_0x44a9b3)[_0xfde9('0xb6')](loggerCatch(_0xfde9('0x1a4')));}this[_0xfde9('0x27')][_0x44a9b3[_0xfde9('0xe5')]]=_0x4b6e13;}};Dialer[_0xfde9('0x1c')]['checkRetriveMax']=function(_0x3de940,_0x5d3e4d,_0x1e7b63){var _0x2bd6a3=new History(_0x5d3e4d);if(_0x2bd6a3[_0xfde9('0xfa')]+_0x2bd6a3['countcongestionretry']+_0x2bd6a3[_0xfde9('0xfb')]+_0x2bd6a3[_0xfde9('0xfc')]+_0x2bd6a3[_0xfde9('0xfd')]+_0x2bd6a3['countabandonedretry']+_0x2bd6a3[_0xfde9('0xf6')]+_0x2bd6a3['countagentrejectretry']>=_0x1e7b63[_0xfde9('0xff')]-0x1){return!![];}switch(_0x3de940){case 0x3:if(_0x2bd6a3[_0xfde9('0xfb')]>=_0x1e7b63[_0xfde9('0x1a5')]-0x1){return!![];}this[_0xfde9('0xc6')]({'active':![],'countnoanswerretry':_0x2bd6a3[_0xfde9('0xfb')]+=0x1,'scheduledat':moment()[_0xfde9('0x105')](_0x1e7b63[_0xfde9('0x1a6')],_0xfde9('0x107'))[_0xfde9('0x80')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2bd6a3[_0xfde9('0xda')],'ListId':_0x2bd6a3['ListId'],'VoiceQueueId':_0x2bd6a3['VoiceQueueId']||undefined,'CampaignId':_0x2bd6a3[_0xfde9('0xde')]||undefined})['catch'](loggerCatch(_0xfde9('0x1a7')));break;case 0x5:if(_0x2bd6a3['countbusyretry']>=_0x1e7b63[_0xfde9('0x1a8')]-0x1){return!![];}this[_0xfde9('0xc6')]({'active':![],'countbusyretry':_0x2bd6a3[_0xfde9('0xfa')]+=0x1,'scheduledat':moment()[_0xfde9('0x105')](_0x1e7b63[_0xfde9('0x1a9')],_0xfde9('0x107'))[_0xfde9('0x80')](_0xfde9('0x108')),'ContactId':_0x2bd6a3[_0xfde9('0xda')],'ListId':_0x2bd6a3[_0xfde9('0xdb')],'VoiceQueueId':_0x2bd6a3[_0xfde9('0xdd')]||undefined,'CampaignId':_0x2bd6a3[_0xfde9('0xde')]||undefined})[_0xfde9('0xb6')](loggerCatch(_0xfde9('0x1aa')));break;case 0x8:if(_0x2bd6a3[_0xfde9('0x10d')]>=_0x1e7b63[_0xfde9('0x1ab')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x2bd6a3['countcongestionretry']+=0x1,'scheduledat':moment()['add'](_0x1e7b63['dialCongestionRetryFrequency'],'minutes')[_0xfde9('0x80')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2bd6a3[_0xfde9('0xda')],'ListId':_0x2bd6a3['ListId'],'VoiceQueueId':_0x2bd6a3[_0xfde9('0xdd')]||undefined,'CampaignId':_0x2bd6a3[_0xfde9('0xde')]||undefined})['catch'](loggerCatch(_0xfde9('0x1ac')));break;case 0x0:if(_0x2bd6a3[_0xfde9('0xfc')]>=_0x1e7b63[_0xfde9('0x1ad')]-0x1){return!![];}else{this[_0xfde9('0xc6')]({'active':![],'countnosuchnumberretry':_0x2bd6a3['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0xfde9('0x105')](_0x1e7b63['dialNoSuchNumberRetryFrequency'],_0xfde9('0x107'))[_0xfde9('0x80')](_0xfde9('0x108')),'ContactId':_0x2bd6a3[_0xfde9('0xda')],'ListId':_0x2bd6a3['ListId'],'VoiceQueueId':_0x2bd6a3['VoiceQueueId']||undefined,'CampaignId':_0x2bd6a3[_0xfde9('0xde')]||undefined})['catch'](loggerCatch(_0xfde9('0x1ae')));}break;case 0xa:if(_0x2bd6a3[_0xfde9('0xfd')]>=_0x1e7b63['dialDropMaxRetry']-0x1){return!![];}this[_0xfde9('0xc6')]({'active':![],'countdropretry':_0x2bd6a3[_0xfde9('0xfd')]+=0x1,'scheduledat':moment()[_0xfde9('0x105')](_0x1e7b63[_0xfde9('0x1af')],_0xfde9('0x107'))['format'](_0xfde9('0x108')),'ContactId':_0x2bd6a3[_0xfde9('0xda')],'ListId':_0x2bd6a3[_0xfde9('0xdb')],'VoiceQueueId':_0x2bd6a3[_0xfde9('0xdd')]||undefined,'CampaignId':_0x2bd6a3['CampaignId']||undefined})[_0xfde9('0xb6')](loggerCatch(_0xfde9('0x1b0')));break;case 0xb:if(_0x2bd6a3[_0xfde9('0xfe')]>=_0x1e7b63['dialAbandonedMaxRetry']-0x1){return!![];}this[_0xfde9('0xc6')]({'active':![],'countabandonedretry':_0x2bd6a3[_0xfde9('0xfe')]+=0x1,'scheduledat':moment()[_0xfde9('0x105')](_0x1e7b63[_0xfde9('0x12e')],_0xfde9('0x107'))[_0xfde9('0x80')](_0xfde9('0x108')),'ContactId':_0x2bd6a3[_0xfde9('0xda')],'ListId':_0x2bd6a3[_0xfde9('0xdb')],'VoiceQueueId':_0x2bd6a3[_0xfde9('0xdd')]||undefined,'CampaignId':_0x2bd6a3['CampaignId']||undefined})[_0xfde9('0xb6')](loggerCatch(_0xfde9('0x131')));break;case 0x13:if(_0x2bd6a3[_0xfde9('0xf6')]>=_0x1e7b63[_0xfde9('0x102')]-0x1){return!![];}this[_0xfde9('0xc6')]({'active':![],'countmachineretry':_0x2bd6a3['countmachineretry']+=0x1,'scheduledat':moment()['add'](_0x1e7b63[_0xfde9('0x106')],_0xfde9('0x107'))[_0xfde9('0x80')](_0xfde9('0x108')),'ContactId':_0x2bd6a3[_0xfde9('0xda')],'ListId':_0x2bd6a3[_0xfde9('0xdb')],'VoiceQueueId':_0x2bd6a3['VoiceQueueId']||undefined,'CampaignId':_0x2bd6a3[_0xfde9('0xde')]||undefined})[_0xfde9('0xb6')](loggerCatch(_0xfde9('0x109')));break;case 0x14:if(_0x2bd6a3['countagentrejectretry']>=_0x1e7b63[_0xfde9('0x1b1')]-0x1){return!![];}this[_0xfde9('0xc6')]({'active':![],'countagentrejectretry':_0x2bd6a3[_0xfde9('0x1b2')]+=0x1,'scheduledat':moment()[_0xfde9('0x105')](_0x1e7b63[_0xfde9('0x1b3')],_0xfde9('0x107'))[_0xfde9('0x80')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2bd6a3['ContactId'],'ListId':_0x2bd6a3[_0xfde9('0xdb')],'VoiceQueueId':_0x2bd6a3[_0xfde9('0xdd')]||undefined,'CampaignId':_0x2bd6a3[_0xfde9('0xde')]||undefined})[_0xfde9('0xb6')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer['prototype'][_0xfde9('0x1a3')]=function(_0x7ff81a,_0x3e9c28,_0x281d1b){var _0x1a88e8=this;var _0x17854a=new History(_0x7ff81a);var _0x8f2cc2=![];var _0x445bd4;var _0x40c586;return new BPromise(function(_0x207f25,_0x1c4706){if(_[_0xfde9('0x41')](_0x3e9c28)&&typeof _0x3e9c28!==_0xfde9('0x179')){return _0x1c4706(msgResponse('[callProgressDetecting]',_0xfde9('0x155'),_0xfde9('0x1b4')));}if(_[_0xfde9('0x41')](_0x281d1b)&&typeof _0x281d1b!==_0xfde9('0x179')){return _0x1c4706(msgResponse(_0xfde9('0x1b5'),_0xfde9('0x155'),'evt\x20is\x20undefine'));}_0x1a88e8[_0xfde9('0xc0')](_0x17854a,_0x281d1b[_0xfde9('0x115')],_0x3e9c28)[_0xfde9('0xbd')](function(_0x2646d6){if(_0x2646d6[_0xfde9('0x127')]==0x1)_0x8f2cc2=!![];switch(_0x281d1b[_0xfde9('0x115')]){case'0':_0x3e9c28[_0xfde9('0x1b6')]+=0x1;_0x17854a['state']=0x0;_0x17854a['statedesc']=_0xfde9('0x1b7');_0x17854a[_0xfde9('0xfc')]+=0x1;_0x17854a[_0xfde9('0xf7')]+=0x1;ami[_0xfde9('0x51')](_0xfde9('0x1b8'),ut[_0xfde9('0xf8')](_0x7ff81a,_0xfde9('0x1b9')));_0x445bd4=_0x3e9c28[_0xfde9('0x1ba')];_0x40c586=_0x3e9c28[_0xfde9('0x125')];_0x1a88e8[_0xfde9('0xd1')](_0x17854a)[_0xfde9('0xb6')](loggerCatch(_0xfde9('0xf9')));if(_0x1a88e8['checkRetriveMax'](0x0,_0x7ff81a,_0x3e9c28)&&!_0x8f2cc2){if(_0x17854a['countnosuchnumberretry']>=_0x3e9c28['dialNoSuchNumberMaxRetry']){_0x1a88e8[_0xfde9('0x103')](_0x17854a,_0x207f25,_0x1c4706,_0xfde9('0x1bb'));}else{_0x1a88e8[_0xfde9('0x100')](_0x17854a,_0x207f25,_0x1c4706,_0xfde9('0x1bb'));}}break;case'3':_0x3e9c28[_0xfde9('0x1bc')]+=0x1;_0x17854a['state']=0x3;_0x17854a[_0xfde9('0xed')]=_0xfde9('0x1bd');_0x17854a[_0xfde9('0xfb')]+=0x1;_0x17854a[_0xfde9('0xf7')]+=0x1;ami[_0xfde9('0x51')](_0xfde9('0x1be'),ut['buildObj'](_0x7ff81a,_0xfde9('0x1bf')));_0x445bd4=_0x3e9c28[_0xfde9('0x1a6')];_0x40c586=_0x3e9c28[_0xfde9('0x125')];_0x1a88e8[_0xfde9('0xd1')](_0x17854a)[_0xfde9('0xb6')](loggerCatch(_0xfde9('0x1c0')));if(_0x1a88e8[_0xfde9('0x1c1')](0x3,_0x7ff81a,_0x3e9c28)&&!_0x8f2cc2){if(_0x17854a[_0xfde9('0xfb')]>=_0x3e9c28['dialNoAnswerMaxRetry']){_0x1a88e8[_0xfde9('0x103')](_0x17854a,_0x207f25,_0x1c4706,'reason\x203\x20ringing\x20no\x20answer');}else{_0x1a88e8['stateGlobal'](_0x17854a,_0x207f25,_0x1c4706,_0xfde9('0x1c2'));}}break;case'5':_0x3e9c28[_0xfde9('0x65')]+=0x1;_0x17854a[_0xfde9('0xad')]=0x5;_0x17854a[_0xfde9('0xed')]='Busy';_0x17854a[_0xfde9('0xfa')]+=0x1;_0x17854a['countglobal']+=0x1;ami['emit'](_0xfde9('0x1c3'),ut[_0xfde9('0xf8')](_0x7ff81a,_0xfde9('0x1c4')));_0x445bd4=_0x3e9c28['dialBusyRetryFrequency'];_0x40c586=_0x3e9c28[_0xfde9('0x125')];_0x1a88e8[_0xfde9('0xd1')](_0x17854a)[_0xfde9('0xb6')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x1a88e8[_0xfde9('0x1c1')](0x5,_0x7ff81a,_0x3e9c28)&&!_0x8f2cc2){if(_0x17854a[_0xfde9('0xfa')]>=_0x3e9c28[_0xfde9('0x1a8')]){_0x1a88e8[_0xfde9('0x103')](_0x17854a,_0x207f25,_0x1c4706,_0xfde9('0x1c5'));}else{_0x1a88e8[_0xfde9('0x100')](_0x17854a,_0x207f25,_0x1c4706,'reason\x205\x20busy');}}break;case'8':_0x3e9c28[_0xfde9('0x66')]+=0x1;_0x17854a[_0xfde9('0xad')]=0x8;_0x17854a['statedesc']=_0xfde9('0x1c6');_0x17854a[_0xfde9('0x10d')]+=0x1;_0x17854a[_0xfde9('0xf7')]+=0x1;_0x445bd4=_0x3e9c28[_0xfde9('0x1c7')];_0x40c586=_0x3e9c28[_0xfde9('0x125')];ami[_0xfde9('0x51')](_0xfde9('0x1c8'),ut[_0xfde9('0xf8')](_0x7ff81a,_0xfde9('0x1c9')));_0x1a88e8['createHistory'](_0x17854a)[_0xfde9('0xb6')](loggerCatch(_0xfde9('0x1ca')));if(_0x1a88e8[_0xfde9('0x1c1')](0x8,_0x7ff81a,_0x3e9c28)&&!_0x8f2cc2){if(_0x17854a['countcongestionretry']>=_0x3e9c28[_0xfde9('0x1ab')]){_0x1a88e8['createStateFinal'](_0x17854a,_0x207f25,_0x1c4706,'reason\x208\x20congestion');}else{_0x1a88e8[_0xfde9('0x100')](_0x17854a,_0x207f25,_0x1c4706,_0xfde9('0x1cb'));}}break;case'11':_0x3e9c28['outboundAbandonedCallsDay']+=0x1;_0x17854a['state']=0xb;_0x17854a[_0xfde9('0xed')]='Abandoned';_0x17854a[_0xfde9('0xfe')]+=0x1;_0x17854a[_0xfde9('0xf7')]+=0x1;_0x445bd4=_0x3e9c28[_0xfde9('0x12e')];_0x40c586=_0x3e9c28[_0xfde9('0x125')];_0x1a88e8['createHistory'](_0x17854a)[_0xfde9('0xb6')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x1a88e8[_0xfde9('0x1c1')](0xb,_0x7ff81a,_0x3e9c28)&&!_0x8f2cc2){if(_0x17854a[_0xfde9('0xfe')]>=_0x3e9c28['dialAbandonedMaxRetry']){_0x1a88e8[_0xfde9('0x103')](_0x17854a,_0x207f25,_0x1c4706,_0xfde9('0x1cc'));}else{_0x1a88e8[_0xfde9('0x100')](_0x17854a,_0x207f25,_0x1c4706,_0xfde9('0x1cc'));}}break;case'20':_0x3e9c28[_0xfde9('0x6a')]+=0x1;_0x17854a[_0xfde9('0xad')]=0x14;_0x17854a[_0xfde9('0xed')]=_0xfde9('0x1cd');_0x17854a[_0xfde9('0x1b2')]+=0x1;_0x17854a[_0xfde9('0xf7')]+=0x1;_0x445bd4=_0x3e9c28[_0xfde9('0x1b3')];_0x40c586=_0x3e9c28[_0xfde9('0x125')];ami[_0xfde9('0x51')]('custom:agentreject',ut[_0xfde9('0xf8')](_0x7ff81a,_0xfde9('0x1ce')));_0x1a88e8[_0xfde9('0xd1')](_0x17854a)[_0xfde9('0xb6')](loggerCatch(_0xfde9('0x1cf')));if(_0x1a88e8[_0xfde9('0x1c1')](0x14,_0x7ff81a,_0x3e9c28)&&!_0x8f2cc2){if(_0x17854a[_0xfde9('0x1b2')]>=_0x3e9c28[_0xfde9('0x1b1')]){_0x1a88e8[_0xfde9('0x103')](_0x17854a,_0x207f25,_0x1c4706,_0xfde9('0x1d0'));}else{_0x1a88e8['stateGlobal'](_0x17854a,_0x207f25,_0x1c4706,_0xfde9('0x1d0'));}}break;default:_0x3e9c28[_0xfde9('0x6b')]+=0x1;_0x17854a[_0xfde9('0xad')]=0xc;_0x17854a['statedesc']=_0x281d1b[_0xfde9('0x115')];_0x445bd4=_0x3e9c28[_0xfde9('0x1b3')];_0x40c586=_0x3e9c28[_0xfde9('0x125')];_0x1a88e8[_0xfde9('0xd1')](_0x17854a)[_0xfde9('0xb6')](loggerCatch(_0xfde9('0x1d1')));if(_0x1a88e8[_0xfde9('0x1c1')](_0x281d1b['reason'],_0x7ff81a,_0x3e9c28)&&!_0x8f2cc2){if(_0x17854a[_0xfde9('0xfa')]+_0x17854a[_0xfde9('0x10d')]+_0x17854a[_0xfde9('0xfb')]+_0x17854a[_0xfde9('0xfc')]+_0x17854a['countdropretry']+_0x17854a['countabandonedretry']+_0x17854a['countmachineretry']+_0x17854a['countagentrejectretry']>=_0x3e9c28[_0xfde9('0xff')]){_0x1a88e8['stateGlobal'](_0x17854a,_0x207f25,_0x1c4706,_0x281d1b[_0xfde9('0x115')]);}else{_0x1a88e8['createStateFinal'](_0x17854a,_0x207f25,_0x1c4706,_0x281d1b[_0xfde9('0x115')]);}}}})[_0xfde9('0xbd')](function(_0x4f304f){if(_0x8f2cc2){_0x1a88e8[_0xfde9('0xc2')](_0x17854a,_0x445bd4,_0x40c586)[_0xfde9('0xbd')](function(_0x2c47b5){return _0x207f25(0x1);});}});});};Dialer[_0xfde9('0x1c')][_0xfde9('0x100')]=function(_0x94b68d,_0xfb2948,_0x1f3bdb,_0x571382){var _0x59e6b4=new Final(_0x94b68d);_0x59e6b4[_0xfde9('0xad')]=0xf;_0x59e6b4[_0xfde9('0xed')]='Global';this[_0xfde9('0x103')](_0x59e6b4,_0xfb2948,_0x1f3bdb,_0x571382);};Dialer[_0xfde9('0x1c')][_0xfde9('0x103')]=function(_0x4d65af,_0x448f93,_0x594274,_0x3793a6){this[_0xfde9('0xd0')](_0x4d65af)['then'](function(){return _0x448f93(msgResponse(_0xfde9('0x1b5'),_0xfde9('0x1d2'),_0x3793a6));})[_0xfde9('0xb6')](function(){return _0x594274(msgResponse('[moveContactManagedDialer][0]',_0xfde9('0x155'),_0xfde9('0x1d3')));});};Dialer[_0xfde9('0x1c')]['predictive']=function(_0x3f676e){var _0x293e76=_0x3f676e[_0xfde9('0x1d4')]/0x64;var _0x425973=_0x3f676e[_0xfde9('0x120')]/(_0x3f676e[_0xfde9('0x120')]+_0x3f676e[_0xfde9('0x63')]);var _0x1a483a=Math['round'](_0x3f676e[_0xfde9('0x76')]*(_0x3f676e[_0xfde9('0x1d5')]/0x64));var _0x13b3e3=Math[_0xfde9('0x1d6')](_0x3f676e[_0xfde9('0x76')]*(_0x3f676e[_0xfde9('0x1d7')]/0x64));var _0x55f798=_0x3f676e[_0xfde9('0x55')]+_0x3f676e[_0xfde9('0x5a')];var _0x564bb5=Math['floor'](_0x3f676e[_0xfde9('0x79')]*_0x3f676e['erlangAbandonmentRate']*_0x3f676e[_0xfde9('0x73')]*_0x3f676e[_0xfde9('0x74')]);if(_[_0xfde9('0x41')](_0x3f676e['startProgressive'])){if(!_[_0xfde9('0x41')](_0x3f676e[_0xfde9('0x29')])){_0x3f676e[_0xfde9('0x29')]=undefined;loggerPredictive[_0xfde9('0x9d')](_0xfde9('0x1d8'),_0xfde9('0x1d9'));}if(!_[_0xfde9('0x41')](_0x3f676e[_0xfde9('0x99')])){loggerPredictive[_0xfde9('0x9d')]('[startMethodPredictive][StartProgressive]',_0xfde9('0x1da'));clearInterval(_0x3f676e[_0xfde9('0x99')]);_0x3f676e['handlePredictive']=undefined;}_0x3f676e[_0xfde9('0x2a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x3f676e['name'],_0xfde9('0x1db'),_0x3f676e[_0xfde9('0x2a')]);this['handlePower'](_0x3f676e,0x1);}else if(ifInterval(_0x3f676e[_0xfde9('0x1dc')],_0x3f676e[_0xfde9('0x2a')])){this[_0xfde9('0x168')](_0x3f676e,0x1);loggerPredictiveCalls[_0xfde9('0x86')](_0xfde9('0x1dd'),_0x3f676e['startProgressive'],_0x3f676e['name']);_0x3f676e['erlangCalls']=0x0;_0x3f676e[_0xfde9('0x72')]=0x0;}else if(_0x293e76<_0x425973&&_0x3f676e['dialPredictiveOptimization']==='dropRate'){freeVariablesPredictive(_0x3f676e);loggerPredictive[_0xfde9('0x86')](_0xfde9('0x1de'),'Dropped\x20calls\x20day',_0x425973,_0xfde9('0x2a'),_0x3f676e[_0xfde9('0x45')]);}else if(_0x564bb5<_0x3f676e[_0xfde9('0x72')]&&_0x3f676e['dialPredictiveOptimization']===_0xfde9('0x1df')){freeVariablesPredictive(_0x3f676e);loggerPredictive[_0xfde9('0x86')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0xfde9('0x1e0'),_0x564bb5,_0xfde9('0x1e1'),_0x3f676e[_0xfde9('0x72')],_0xfde9('0x2a'),_0x3f676e[_0xfde9('0x45')]);}else if(!ifInterval(_0x3f676e[_0xfde9('0x1dc')],_0x3f676e[_0xfde9('0x2a')])&&_[_0xfde9('0x41')](_0x3f676e[_0xfde9('0x29')])&&!_[_0xfde9('0x41')](_0x3f676e[_0xfde9('0x2a')])){_0x3f676e[_0xfde9('0x29')]=moment()[_0xfde9('0x80')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xfde9('0x86')](_0x3f676e['name'],_0xfde9('0x1e2'),_0x3f676e[_0xfde9('0x29')]);this[_0xfde9('0xc4')](_0x3f676e[_0xfde9('0x1dc')])[_0xfde9('0xbd')](this['getDataPredictive'](_0x3f676e))[_0xfde9('0xbd')](mergeDataErlangB(_0x3f676e))['then'](this['startMethodPredictive'](_0x3f676e))[_0xfde9('0xb6')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x3f676e));}else if(!ifInterval(_0x3f676e['dialPredictiveInterval'],_0x3f676e[_0xfde9('0x29')])){_0x3f676e['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x3f676e['startPredictive']=moment()['format'](_0xfde9('0x108'));loggerPredictive[_0xfde9('0x86')](_0x3f676e['name'],'recalculate\x20predictive\x20at',_0x3f676e[_0xfde9('0x29')]);clearInterval(_0x3f676e[_0xfde9('0x99')]);_0x3f676e[_0xfde9('0x99')]=undefined;this['averageHandleTime'](_0x3f676e[_0xfde9('0x1dc')])[_0xfde9('0xbd')](this['getDataPredictive'](_0x3f676e))['then'](mergeDataErlangB(_0x3f676e))['then'](this['startMethodPredictive'](_0x3f676e))['catch'](loggerCatchPredictive(_0xfde9('0x1e3'),_0x3f676e));}else if(_0x3f676e[_0xfde9('0x76')]&&_0x55f798<_0x3f676e[_0xfde9('0x76')]-_0x13b3e3){freeVariablesPredictive(_0x3f676e);loggerPredictive[_0xfde9('0x86')](_0x3f676e['name'],_0xfde9('0x1e4'),_0x55f798,_0xfde9('0x1e5'),_0x3f676e[_0xfde9('0x76')],'-',_0x13b3e3,'=',_0x3f676e['predictiveIntervalAvailable']-_0x13b3e3,')');}else if(_0x3f676e[_0xfde9('0x76')]&&_0x55f798>_0x3f676e[_0xfde9('0x76')]+_0x1a483a){freeVariablesPredictive(_0x3f676e);loggerPredictive[_0xfde9('0x86')](_0x3f676e[_0xfde9('0x45')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x55f798,_0xfde9('0x1e6'),_0x3f676e[_0xfde9('0x76')],'+',_0x1a483a,'=',_0x3f676e[_0xfde9('0x76')]+_0x1a483a,')');}};Dialer[_0xfde9('0x1c')][_0xfde9('0x1e7')]=function(_0x3b1607){var _0x1af3cb=this;return function(_0x4b1424){return new BPromise(function(_0x106ddd,_0x284d05){_[_0xfde9('0x13a')](_0x3b1607,_0x4b1424[0x0]);if(checkGetDataPredictive(_0x4b1424[0x0])){var _0x30cbee=_0x3b1607[_0xfde9('0x76')]=_0x3b1607[_0xfde9('0x5a')]+_0x3b1607['available'];var _0x1da0a0=_0x3b1607[_0xfde9('0x1dc')]*0x3c;var _0x3e6d21=_0x4b1424[0x0][_0xfde9('0x6e')]+_0x4b1424[0x0]['predictiveIntervalAvgHoldtime'];var _0x1d919d=(_0x4b1424[0x0]['predictiveIntervalAnsweredCalls']+_0x4b1424[0x0][_0xfde9('0x70')]+_0x4b1424[0x0][_0xfde9('0x6f')])/_0x4b1424[0x0]['predictiveIntervalTotalCalls'];_0x3b1607['predictiveIntervalHitRate']=_0x1d919d>0x0?_0x1d919d:0x1;switch(_0x3b1607['dialPredictiveOptimization']){case _0xfde9('0x1df'):var _0x4ebe01=_0x3b1607['dialPredictiveOptimizationPercentage']/0x64;return _0x1af3cb[_0xfde9('0x1e8')](_0x30cbee,_0x1da0a0,_0x3e6d21,_0x1d919d,_0x4ebe01)['then'](function(_0x2b22f1){return _0x106ddd(_0x2b22f1);});case'agentBusyFactor':var _0xac16ba=_0x3b1607[_0xfde9('0x1d4')]/0x64;return _0x1af3cb[_0xfde9('0x1e9')](_0x30cbee,_0x1da0a0,_0x3e6d21,_0x1d919d,_0xac16ba)[_0xfde9('0xbd')](function(_0x2234bd){return _0x106ddd(_0x2234bd);});default:return _0x284d05(msgResponse(_0xfde9('0x1ea'),_0xfde9('0x155'),_0xfde9('0x1eb')));}}else{return _0x284d05(msgResponse(_0xfde9('0x1ea'),_0xfde9('0x155'),_0xfde9('0x1ec')));}});};};Dialer[_0xfde9('0x1c')][_0xfde9('0x1ed')]=function(_0xe25806){var _0x5edcd7=this;return function(_0x52e523){return new BPromise(function(_0xd237e8,_0x249d46){_[_0xfde9('0x13a')](_0xe25806,_0x52e523[0x0]);if(checkGetDataPredictive(_0x52e523[0x0])){loggerPredictive[_0xfde9('0x86')](JSON['stringify'](_0x52e523[0x0]));if(_0xe25806[_0xfde9('0x1ee')]===_0xfde9('0x1df')){return _0x5edcd7[_0xfde9('0xcf')](_0xe25806['id'])['then'](function(_0x36dc03){var _0x6edd28=_0xe25806[_0xfde9('0x56')]-_0x36dc03[0x0][_0xfde9('0x1ef')];var _0x4e938b=_0xe25806['dialPredictiveInterval']*0x3c;var _0x1105a1=_0x52e523[0x0][_0xfde9('0x6e')]+_0x52e523[0x0]['predictiveIntervalAvgHoldtime'];var _0x3268bc=(_0x52e523[0x0][_0xfde9('0x6c')]+_0x52e523[0x0][_0xfde9('0x70')]+_0x52e523[0x0][_0xfde9('0x6f')])/_0x52e523[0x0][_0xfde9('0x77')];var _0x228c39=_0xe25806[_0xfde9('0x1d4')]/0x64;_0xe25806[_0xfde9('0x75')]=_0x36dc03[0x0]['outboundQueuePauses']||0x0;_0xe25806[_0xfde9('0x73')]=_0x3268bc>0x0?_0x3268bc:0x1;return _0x5edcd7[_0xfde9('0x1e8')](_0x6edd28,_0x4e938b,_0x1105a1,_0x3268bc,_0x228c39);})[_0xfde9('0xbd')](function(_0x5622cc){return _0xd237e8(_0x5622cc);})['catch'](function(_0x2e7757){return _0x249d46(msgResponse(_0xfde9('0x1f0'),'Failure',JSON[_0xfde9('0x4d')](_0x2e7757)));});}if(_0xe25806['dialPredictiveOptimization']===_0xfde9('0x1f1')){return _0x5edcd7[_0xfde9('0xcf')](_0xe25806['id'])['then'](function(_0x5ef443){var _0x4c1bfa=_0xe25806[_0xfde9('0x56')]-_0x5ef443[0x0][_0xfde9('0x1ef')];var _0x4a789a=_0xe25806[_0xfde9('0x1dc')]*0x3c;var _0x1abd8c=_0x52e523[0x0][_0xfde9('0x6e')]+_0x52e523[0x0][_0xfde9('0x6d')];var _0x611066=(_0x52e523[0x0][_0xfde9('0x6c')]+_0x52e523[0x0][_0xfde9('0x70')]+_0x52e523[0x0][_0xfde9('0x6f')])/_0x52e523[0x0]['predictiveIntervalTotalCalls'];var _0x1ea7f8=_0xe25806[_0xfde9('0x1d4')]/0x64;_0xe25806[_0xfde9('0x75')]=_0x5ef443[0x0][_0xfde9('0x1ef')]||0x0;_0xe25806[_0xfde9('0x73')]=_0x611066>0x0?_0x611066:0x1;return _0x5edcd7[_0xfde9('0x1e9')](_0x4c1bfa,_0x4a789a,_0x1abd8c,_0x611066,_0x1ea7f8);})['then'](function(_0x5669ba){return _0xd237e8(_0x5669ba);})[_0xfde9('0xb6')](function(_0x3fd545){return _0x249d46(msgResponse(_0xfde9('0x1f0'),'Failure',JSON[_0xfde9('0x4d')](_0x3fd545)));});}}else{return _0x249d46(msgResponse(_0xfde9('0x1ea'),_0xfde9('0x155'),_0xfde9('0x1ec')));}});};};Dialer[_0xfde9('0x1c')][_0xfde9('0x1f2')]=function(_0x13344f){var _0x112d82=this;return function(){var _0x24b733=0x0;var _0x40c8ba=Math['floor'](_0x13344f[_0xfde9('0x7a')]*0x3e8);if(_0x40c8ba>0x0){_0x40c8ba=_0x40c8ba<0x64?0x64:_0x40c8ba;loggerPredictive[_0xfde9('0x86')](_0x13344f[_0xfde9('0x45')],_0xfde9('0x1f3'),_0x40c8ba,_0xfde9('0x4e'));_0x13344f[_0xfde9('0x99')]=setInterval(function(){_0x112d82[_0xfde9('0x99')](_0x13344f);loggerPredictiveCalls[_0xfde9('0x86')](_0xfde9('0x1f4'),_0x24b733+=0x1);},_0x40c8ba);}else{loggerPredictive[_0xfde9('0x86')](_0x13344f[_0xfde9('0x45')],_0xfde9('0x1f5'));}};};Dialer[_0xfde9('0x1c')]['checkContactBlack']=function(_0x451053,_0x27825d){var _0x44eb01=this;return function(_0x56bb24){if(_['isEmpty'](_0x56bb24)){if(_[_0xfde9('0xb3')](_0x27825d['UserId'])||!_0x27825d[_0xfde9('0x1f6')]){if(_0x451053[_0xfde9('0x5d')]==='booked'){_0x451053[_0xfde9('0x13b')]=_[_0xfde9('0x41')](_0x451053[_0xfde9('0x13b')])?!![]:_0x451053[_0xfde9('0x13b')];var _0x52c756=uuid['v4']();_0x44eb01[_0xfde9('0x25')][_0x52c756]=new Action(_0x451053,_0x27825d,_0x52c756);loggerBooked[_0xfde9('0x86')]('[booked][checkContactBlack]',_0x52c756,_0xfde9('0x1f7'),JSON[_0xfde9('0x4d')](_0x451053[_0xfde9('0x13b')]),'Queue:\x20',_0x451053[_0xfde9('0x45')]);if(_0x451053['queueStatusComplete']){_0x451053['queueStatusComplete']=![];_0x44eb01['queueBooked'][_0x44eb01[_0xfde9('0x25')][_0x52c756]['queue']]=[];ami['Action']({'actionid':_0x52c756,'action':'queuestatus','queue':_0x451053[_0xfde9('0x45')]})[_0xfde9('0xb6')](function(){_0x44eb01['updateOriginated'](_0x451053);_0x44eb01[_0xfde9('0xc6')]({'active':![],'ContactId':_0x44eb01[_0xfde9('0x25')][_0x52c756]['ContactId'],'ListId':_0x44eb01[_0xfde9('0x25')][_0x52c756][_0xfde9('0xdb')],'VoiceQueueId':_0x44eb01[_0xfde9('0x25')][_0x52c756][_0xfde9('0xdd')]||undefined,'CampaignId':_0x44eb01[_0xfde9('0x25')][_0x52c756][_0xfde9('0xde')]||undefined})[_0xfde9('0xb6')](loggerCatch(_0xfde9('0x1f8')));delete _0x44eb01[_0xfde9('0x25')][_0x52c756];});}else{loggerBooked[_0xfde9('0x86')](_0xfde9('0x1f9'),JSON[_0xfde9('0x4d')](_0x451053[_0xfde9('0x13b')]),_0xfde9('0x1fa'),_0x451053[_0xfde9('0x45')]);_0x44eb01[_0xfde9('0xb7')](_0x451053);_0x44eb01[_0xfde9('0xc6')]({'active':![],'ContactId':_0x44eb01[_0xfde9('0x25')][_0x52c756][_0xfde9('0xda')],'ListId':_0x44eb01[_0xfde9('0x25')][_0x52c756][_0xfde9('0xdb')],'VoiceQueueId':_0x44eb01[_0xfde9('0x25')][_0x52c756][_0xfde9('0xdd')]||undefined,'CampaignId':_0x44eb01['actions'][_0x52c756][_0xfde9('0xde')]||undefined})['catch'](loggerCatch(_0xfde9('0x1f8')));delete _0x44eb01[_0xfde9('0x25')][_0x52c756];}}else{return _0x44eb01[_0xfde9('0x178')](_0x451053,_0x27825d);}}else{if(getDiff(_0x27825d[_0xfde9('0x1fb')])<_0x451053[_0xfde9('0x1fc')]*0x3c){if(_0x27825d[_0xfde9('0x1fd')]&&!_0x27825d[_0xfde9('0x1fd')]['voicePause']){_0x44eb01[_0xfde9('0x9a')][_0xfde9('0x13e')](_0x27825d['id'])[_0xfde9('0x147')](function(){_0x44eb01[_0xfde9('0xb7')](_0x451053);});}else{_0x44eb01['unlockContact']({'active':![]},_0x27825d['id'],0x1)['finally'](function(){_0x44eb01[_0xfde9('0xb7')](_0x451053);});}}else{_0x451053['outboundReCallsDay']+=0x1;_0x44eb01['updateOriginated'](_0x451053);if(_0x451053['dialRecallInQueue']){_0x44eb01[_0xfde9('0xc6')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x27825d['ContactId'],'ListId':_0x27825d['ListId'],'VoiceQueueId':_0x27825d['VoiceQueueId']||undefined,'CampaignId':_0x27825d[_0xfde9('0xde')]||undefined})[_0xfde9('0xb6')](loggerCatch(_0xfde9('0x1fe')));_0x44eb01['createHistory'](createObjHistory(_0x451053,_0x27825d,_0xfde9('0x1ff'),0x17,'RecallInQueue'))[_0xfde9('0xb6')](loggerCatch(_0xfde9('0x200')));}else{_0x44eb01[_0xfde9('0xd8')](createObjHistory(_0x451053,_0x27825d,_0xfde9('0x201'),0x16,_0xfde9('0x202')),_0xfde9('0x203'),_0xfde9('0x204'));}}}}else{_0x451053[_0xfde9('0x64')]+=0x1;_0x44eb01[_0xfde9('0xd8')](createObjHistory(_0x451053,_0x27825d,_0xfde9('0x205'),0xd,'Blacklist'),_0xfde9('0x206'),'[Originate][MoveBlacklist]');throw _0xfde9('0x207');}};};Dialer[_0xfde9('0x1c')][_0xfde9('0x16e')]=function(_0x22eb15){var _0x5f500d=this;var _0x29bec1=_0x22eb15['limitCalls']-_0x22eb15['originated']-_0x22eb15[_0xfde9('0xcb')];emitCampaignSummary(_0x22eb15);if(_0x29bec1>0x0){if(_0x29bec1>this[_0xfde9('0x23')]){_0x29bec1=this[_0xfde9('0x23')];}_0x22eb15[_0xfde9('0xcb')]+=_0x29bec1;this['getContactDialerIvr'](_0x22eb15['id'],_0x29bec1,_0x22eb15[_0xfde9('0x208')],_0x22eb15)[_0xfde9('0xbd')](function(_0x41728d){_0x22eb15[_0xfde9('0xcb')]-=_0x29bec1;_0x22eb15[_0xfde9('0xcb')]=_0x22eb15[_0xfde9('0xcb')]>0x0?_0x22eb15['temp']:0x0;if(!checkContactEmpty(_0x41728d)){_0x22eb15[_0xfde9('0x42')]=_0xfde9('0xa4');logger[_0xfde9('0x86')](_0xfde9('0x209')+_0x22eb15[_0xfde9('0x45')]);}else{_0x22eb15[_0xfde9('0x78')]+=_0x41728d[_0xfde9('0xa0')];_0x22eb15[_0xfde9('0x42')]=_0xfde9('0x20a');for(var _0x28c8ef=0x0;_0x28c8ef<_0x41728d[_0xfde9('0xa0')];_0x28c8ef+=0x1){_0x22eb15[_0xfde9('0x20b')]+=0x1;if(_[_0xfde9('0xb3')](_0x41728d[_0x28c8ef])||_[_0xfde9('0xb3')](_0x41728d[_0x28c8ef][_0xfde9('0x191')])||_[_0xfde9('0xb3')](_0x41728d[_0x28c8ef][_0xfde9('0x17b')])){_0x5f500d[_0xfde9('0xd6')](_0xfde9('0x20c'),_0x22eb15,_0x41728d[_0x28c8ef]);}else{_0x5f500d[_0xfde9('0x20d')](_['pick'](_0x41728d[_0x28c8ef],[_0xfde9('0xde'),'Contact.phone']))['then'](_0x5f500d[_0xfde9('0x20e')](_0x22eb15,_0x41728d[_0x28c8ef]))[_0xfde9('0xb6')](_0x5f500d[_0xfde9('0xd5')](_0xfde9('0x20f'),_0x22eb15));}}}})['catch'](loggerGetContactDialer(_0xfde9('0x210'),_0x22eb15,_0x29bec1));}};Dialer[_0xfde9('0x1c')][_0xfde9('0x168')]=function(_0x3b5bb0,_0x290086){var _0x4622dd=this;var _0x229bab=[];var _0x5aed4b=_0x290086>=0x1?_0x290086:0x1;if(_0x3b5bb0[_0xfde9('0x5d')]===_0xfde9('0x7')){_0x5aed4b=0x1;}var _0x3037c2=Math[_0xfde9('0x211')](_0x3b5bb0[_0xfde9('0x55')]*_0x5aed4b)-_0x3b5bb0[_0xfde9('0x78')]-_0x3b5bb0[_0xfde9('0xcb')];emitVoiceQueueSummary(_0x3b5bb0);if(_0x3b5bb0['dialLimitQueue']>0x0){var _0x187bdf=_0x3b5bb0[_0xfde9('0x212')]-_0x3b5bb0[_0xfde9('0x78')]-_0x3b5bb0[_0xfde9('0x5a')]-_0x3b5bb0[_0xfde9('0xcb')]-_0x3b5bb0[_0xfde9('0x57')];if(_0x3037c2>_0x187bdf){_0x3037c2=_0x187bdf;}}if(_0x3037c2>0x0){if(_0x3b5bb0[_0xfde9('0x5d')]===_0xfde9('0x7')){_0x3037c2=0x1;}if(_0x3037c2>this['maxNumberOriginate']){_0x3037c2=this[_0xfde9('0x23')];}_0x3b5bb0[_0xfde9('0xcb')]+=_0x3037c2;for(var _0x3454ad in this[_0xfde9('0x21')]){if(typeof this['agents'][_0x3454ad]!=='undefined'){if(this[_0xfde9('0x21')][_0x3454ad][_0xfde9('0xad')]===_0xfde9('0x213')&&this[_0xfde9('0x21')][_0x3454ad][_0xfde9('0xb5')]==='reachable'){_0x229bab[_0xfde9('0x139')](this['agents'][_0x3454ad]['id']);}}}this[_0xfde9('0xca')](_0x3b5bb0['id'],_0x229bab,_0x3037c2,_0x3b5bb0[_0xfde9('0x208')],_0x3b5bb0)[_0xfde9('0xbd')](function(_0x261d90){_0x3b5bb0[_0xfde9('0xcb')]-=_0x3037c2;_0x3b5bb0['temp']=_0x3b5bb0[_0xfde9('0xcb')]>0x0?_0x3b5bb0[_0xfde9('0xcb')]:0x0;if(!checkContactEmpty(_0x261d90)){_0x4622dd[_0xfde9('0xbb')](_0x3b5bb0)[_0xfde9('0xbd')](sendMessageReschedule(_0x3b5bb0))['catch'](loggerCatch(_0xfde9('0x214')));}else{_0x3b5bb0[_0xfde9('0x78')]+=_0x261d90[_0xfde9('0xa0')];_0x3b5bb0[_0xfde9('0x42')]=_0x3b5bb0[_0xfde9('0x5d')]===_0xfde9('0x7')?_0xfde9('0x215'):_0xfde9('0x20a');for(var _0x226864=0x0;_0x226864<_0x261d90[_0xfde9('0xa0')];_0x226864+=0x1){if(_[_0xfde9('0xb3')](_0x261d90[_0x226864])||_['isNil'](_0x261d90[_0x226864][_0xfde9('0x191')])||_[_0xfde9('0xb3')](_0x261d90[_0x226864]['phone'])){_0x4622dd[_0xfde9('0xd6')]('[actionOriginate]\x20',_0x3b5bb0,_0x261d90[_0x226864]);}else{_0x4622dd[_0xfde9('0xbe')](_[_0xfde9('0xd9')](_0x261d90[_0x226864],[_0xfde9('0xdd'),_0xfde9('0x216')]))[_0xfde9('0xbd')](_0x4622dd[_0xfde9('0x20e')](_0x3b5bb0,_0x261d90[_0x226864]))[_0xfde9('0xb6')](_0x4622dd[_0xfde9('0xd5')](_0xfde9('0x20c'),_0x3b5bb0));}}}})['catch'](loggerGetContactDialer(_0xfde9('0x217'),_0x3b5bb0,_0x3037c2));}};Dialer[_0xfde9('0x1c')][_0xfde9('0x99')]=function(_0x148a4c){if(_0x148a4c[_0xfde9('0x212')]>0x0){var _0x1843e8=_0x148a4c[_0xfde9('0x212')]-_0x148a4c[_0xfde9('0x78')]-_0x148a4c['talking'];if(_0x1843e8>0x0){this[_0xfde9('0x218')](_0x148a4c);}else{loggerPredictiveCalls[_0xfde9('0x86')]('[handlePredictive][limitChannel]');}}else{this['tryOriginatePredictive'](_0x148a4c);}};Dialer[_0xfde9('0x1c')][_0xfde9('0x218')]=function(_0x1cdf15){var _0x37208c=this;var _0x29f3fd=[];_0x1cdf15[_0xfde9('0x78')]+=0x1;for(var _0xc23220 in this['agents']){if(typeof this[_0xfde9('0x21')][_0xc23220]!==_0xfde9('0xb2')){if(this[_0xfde9('0x21')][_0xc23220][_0xfde9('0xad')]===_0xfde9('0x213')&&this[_0xfde9('0x21')][_0xc23220][_0xfde9('0xb5')]===_0xfde9('0xe3')){_0x29f3fd[_0xfde9('0x139')](this[_0xfde9('0x21')][_0xc23220]['id']);}}}this[_0xfde9('0xca')](_0x1cdf15['id'],_0x29f3fd,0x1,_0x1cdf15[_0xfde9('0x208')],_0x1cdf15)[_0xfde9('0xbd')](function(_0x3f7883){if(!checkContactEmpty(_0x3f7883)){checkContactLowerLimitOriginate(_0x1cdf15,0x1,0x0);_0x37208c[_0xfde9('0xbb')](_0x1cdf15)[_0xfde9('0xbd')](sendMessageReschedule(_0x1cdf15))[_0xfde9('0xb6')](loggerCatch(_0xfde9('0x214')));}else{_0x1cdf15[_0xfde9('0x42')]=_0xfde9('0x20a');if(_[_0xfde9('0xb3')](_0x3f7883[0x0])||_[_0xfde9('0xb3')](_0x3f7883[0x0][_0xfde9('0x191')])||_[_0xfde9('0xb3')](_0x3f7883[0x0][_0xfde9('0x17b')])){_0x37208c[_0xfde9('0xd6')](_0xfde9('0x20c'),_0x1cdf15,_0x3f7883[0x0]);}else{_0x37208c[_0xfde9('0xbe')](_[_0xfde9('0xd9')](_0x3f7883[0x0],[_0xfde9('0xdd'),_0xfde9('0x216')]))[_0xfde9('0xbd')](_0x37208c[_0xfde9('0x20e')](_0x1cdf15,_0x3f7883[0x0]))[_0xfde9('0xb6')](_0x37208c[_0xfde9('0xd5')](_0xfde9('0x219'),_0x1cdf15));}}})['catch'](loggerGetContactDialer('[getContactDialerPredictive]',_0x1cdf15,0x1));emitVoiceQueueSummary(_0x1cdf15);};Dialer[_0xfde9('0x1c')][_0xfde9('0x1e8')]=function(_0x58f2f1,_0x3e6624,_0x42350e,_0x1b55c2,_0x1939bf,_0x34c728){loggerPredictive[_0xfde9('0x86')](_0xfde9('0x21a'));loggerPredictive[_0xfde9('0x86')](_0xfde9('0x21b'),_0x58f2f1);loggerPredictive['info'](_0xfde9('0x21c'),_0x3e6624);loggerPredictive[_0xfde9('0x86')]('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',_0x42350e);loggerPredictive[_0xfde9('0x86')](_0xfde9('0x21d'),_0x1b55c2);loggerPredictive[_0xfde9('0x86')](_0xfde9('0x21e'),_0x1939bf);loggerPredictive[_0xfde9('0x86')](_0xfde9('0x8e'));return new BPromise(function(_0x36ceff,_0x50bae1){if(_0x58f2f1<=0x0||isNaN(_0x58f2f1)){return _0x50bae1(msgResponse('[abandonmentRate]',_0xfde9('0x4c'),_0xfde9('0x21f')+_0x58f2f1));}if(_0x42350e<=0x0||isNaN(_0x42350e)){return _0x50bae1(msgResponse(_0xfde9('0x220'),_0xfde9('0x4c'),_0xfde9('0x221')+_0x42350e));}if(_0x1b55c2<=0x0||isNaN(_0x1b55c2)){return _0x50bae1(msgResponse(_0xfde9('0x220'),'Error',_0xfde9('0x222')+_0x1b55c2));}if(_0x3e6624<=0x0||isNaN(_0x3e6624)){return _0x50bae1(msgResponse(_0xfde9('0x220'),_0xfde9('0x4c'),_0xfde9('0x223')+_0x3e6624));}if(_0x1939bf<=0x0||isNaN(_0x1939bf)){return _0x50bae1(msgResponse('[abandonmentRate]',_0xfde9('0x4c'),'Amax\x20=\x20'+_0x1939bf));}_0x34c728=_0x34c728||0x0;var _0x1b53c3=0x1/_0x42350e;var _0x474404=0x0;var _0x589a25=0x0;var _0x37b20f=0x0;var _0x5dfdec=0x0;for(var _0x5f6ac6=0x0;_0x37b20f<_0x1939bf;_0x5f6ac6+=0x1){_0x589a25=_0x5f6ac6/_0x3e6624;_0x474404=(_0x1b55c2*_0x589a25+_0x34c728)/_0x1b53c3;_0x37b20f=erlangb(_0x474404,_0x58f2f1);_0x5dfdec=_0x474404/_0x58f2f1*(0x1-erlangb(_0x474404,_0x58f2f1));}return _0x36ceff({'erlangCalls':_0x5f6ac6,'erlangCallToSecond':_0x3e6624/_0x5f6ac6,'erlangAbandonmentRate':_0x37b20f,'erlangBusyFactor':_0x5dfdec});});};Dialer[_0xfde9('0x1c')]['busyFactor']=function(_0x4d4ab4,_0x26a970,_0x33c61c,_0x2b8f52,_0x463233,_0x3cb379){loggerPredictive['info']('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive['info'](_0xfde9('0x21b'),_0x4d4ab4);loggerPredictive[_0xfde9('0x86')](_0xfde9('0x21c'),_0x26a970);loggerPredictive['info'](_0xfde9('0x224'),_0x33c61c);loggerPredictive[_0xfde9('0x86')](_0xfde9('0x21d'),_0x2b8f52);loggerPredictive['info'](_0xfde9('0x225'),_0x463233);loggerPredictive['info']('---------------------------');return new BPromise(function(_0x4446a8,_0x48c058){if(_0x4d4ab4<=0x0||isNaN(_0x4d4ab4)){return _0x48c058(msgResponse('[busyFactor]','Error',_0xfde9('0x21f')+_0x4d4ab4));}if(_0x33c61c<=0x0||isNaN(_0x33c61c)){return _0x48c058(msgResponse(_0xfde9('0x226'),'Error',_0xfde9('0x221')+_0x33c61c));}if(_0x2b8f52<=0x0||isNaN(_0x2b8f52)){return _0x48c058(msgResponse('[busyFactor]','Error',_0xfde9('0x222')+_0x2b8f52));}if(_0x26a970<=0x0||isNaN(_0x26a970)){return _0x48c058(msgResponse(_0xfde9('0x226'),_0xfde9('0x4c'),_0xfde9('0x223')+_0x26a970));}if(_0x463233<=0x0||isNaN(_0x463233)){return _0x48c058(msgResponse('[busyFactor]',_0xfde9('0x4c'),_0xfde9('0x227')+_0x463233));}_0x3cb379=_0x3cb379||0x0;var _0x23d956=0x1/_0x33c61c;var _0x55913d=0x0;var _0x2ee14a=0x0;var _0x385812=0x0;var _0x263fae=0x0;for(var _0x11adf7=0x0;_0x263fae<_0x463233;_0x11adf7+=0x1){_0x2ee14a=_0x11adf7/_0x26a970;_0x55913d=(_0x2b8f52*_0x2ee14a+_0x3cb379)/_0x23d956;_0x385812=erlangb(_0x55913d,_0x4d4ab4);_0x263fae=_0x55913d/_0x4d4ab4*(0x1-erlangb(_0x55913d,_0x4d4ab4));}return _0x4446a8({'erlangCalls':_0x11adf7,'erlangCallToSecond':_0x26a970/_0x11adf7,'erlangAbandonmentRate':_0x385812,'erlangBusyFactor':_0x263fae});});};module[_0xfde9('0x228')]=Dialer; \ No newline at end of file +var _0x3d04=['power','dialPowerLevel','predictive','launchHandleIvr','handleIvr','dialActive','dialGlobalInterval','dialTimezone','[syncQueueSummary]','checkIsTrunkReachable','[syncCampaigns]','\x5cw{0,','pow','replace','match','actionOriginate','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','ACTIVE','xcally-motion-dialer','XMD-AMDGREETING','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','tags','createdAt','updatedAt','toUpper','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','originatecalleridname','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','[originateError]:\x20%s','[originate][error]','syncOriginateResponse','getQueue','response','[callProgressDetecting]\x20','checkRetriveMax','countnosuchnumberretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialDropMaxRetry','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','callProgressDetecting','object','[callProgressDetecting]','custom:agentnosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','custom:agentbusy','busy','dialBusyRetryFrequency','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','Global','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','predictiveIntervalMaxThreshold','round','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','dialPredictiveInterval','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','recallme','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','Agent','voicePause','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','length','ivrTotalCallsDays','Contact.phone','checkContactBlack','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','RUNNING','[actionOriginate]\x20','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','exports','util','lodash','bluebird','uuid','moment','md5','ioredis','../preview/util/util','../../../config/logger','dialer','booked','syncQueueSummary','../ami','redis','defaults','socket.io-emitter','../rpc/cmHopperHistory','../rpc/cmHopperFinal','../rpc/cmHopperAdditionalPhone','../rpc/cmHopperBlack','./action','./history','./agentComplete','./queueCallerAbandon','./hangup','XCALLY_IP_AGI','127.0.0.1','rrmemory','prototype','enqueue','tail','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','originateresponse','syncAgentComplete','syncHangup','newexten','varset','syncVarSet','queuemember','syncQueueMember','syncQueueStatusComplete','loopCampaigns','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','Intervals','\x20INTERVAL_IS_NULL','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','total','abandoned','loggedInDb','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBusyCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','isUndefined','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','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','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','preview','string','isEmpty','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','talking','waiting','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','endtime','starttime','loopClearZombieChannels','clearZombieChannels','[uniqueid]','[actions]','undefined','isNil','status','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','verifyAdditionalPhones','[swapAdditionalPhone]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','saveInDb','merge','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','unmonitored','uniqueid','variable','amdstatus','exten','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','statedesc','Machine','countmachineretry','[syncAgentComplete][createHistory][0]','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countagentrejectretry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','countbusyretry','dialGlobalMaxRetry','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','cause-txt','Unknow','reason','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','syncQueueCallerAbandon','droptime','responsetime','dialQueueTimeout','Drop','TIMEOUT','countglobal','dialDropRetryFrequency','callAdditionalPhoneAfterMin','additional','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','CALLEREXIT','dialAbandonedRetryFrequency','voiceQueue','dialAbandonedMaxRetry','Abandoned','[syncAgentComplete][createHistory][11]','syncNewExten','channel','actionid','roundrobin','locked','stateinterface','push','idHopper','paused','queueStatusComplete','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','finally','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','syncCampaigns','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','Failure','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','timezones','content','indexOf','true','Action','all','some','GLOBAL_INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','progressive','handlePower'];(function(_0x193db9,_0x49973f){var _0x55542d=function(_0x4230a6){while(--_0x4230a6){_0x193db9['push'](_0x193db9['shift']());}};_0x55542d(++_0x49973f);}(_0x3d04,0xbe));var _0x43d0=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3d04[_0x2dafbe];return _0x58a45a;};'use strict';var util=require(_0x43d0('0x0'));var _=require(_0x43d0('0x1'));var BPromise=require(_0x43d0('0x2'));var uuid=require(_0x43d0('0x3'));var moment=require(_0x43d0('0x4'));var rr=require('rr');var md5=require(_0x43d0('0x5'));var Redis=require(_0x43d0('0x6'));var ut=require(_0x43d0('0x7'));var config=require('../../../config/environment/');var logger=require(_0x43d0('0x8'))(_0x43d0('0x9'));var loggerBooked=require(_0x43d0('0x8'))(_0x43d0('0xa'));var loggerPredictive=require('../../../config/logger')('predictive');var loggerPredictiveCalls=require('../../../config/logger')('predictiveCalls');var loggerSyncQueueSummary=require(_0x43d0('0x8'))(_0x43d0('0xb'));var ami=require(_0x43d0('0xc'));config[_0x43d0('0xd')]=_[_0x43d0('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x43d0('0xf'))(new Redis(config['redis']));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x43d0('0x10'));var cmHopperFinal=require(_0x43d0('0x11'));var cmHopperAdditionalPhone=require(_0x43d0('0x12'));var cmHopperBlack=require(_0x43d0('0x13'));var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require(_0x43d0('0x14'));var History=require(_0x43d0('0x15'));var Final=require('./final');var AgentComplete=require(_0x43d0('0x16'));var QueueCallerAbandon=require(_0x43d0('0x17'));var Hangup=require(_0x43d0('0x18'));var ipAgi=process['env'][_0x43d0('0x19')]||_0x43d0('0x1a');var strategy={'rrmemory':_0x43d0('0x1b'),'roundrobin':'roundrobin'};var Sequence=function(){};Sequence[_0x43d0('0x1c')][_0x43d0('0x1d')]=function(_0x44e6ec){this[_0x43d0('0x1e')]=this[_0x43d0('0x1e')]?this['tail']['finally'](_0x44e6ec):_0x44e6ec();};function Dialer(_0x1e91a7,_0x3356f1){this[_0x43d0('0x1f')]=new Sequence();this['preview']=_0x3356f1;this[_0x43d0('0x20')]=_0x1e91a7['voiceQueues'];this[_0x43d0('0x21')]=_0x1e91a7[_0x43d0('0x21')];this[_0x43d0('0x22')]=_0x1e91a7['agents'];this[_0x43d0('0x23')]=_0x1e91a7[_0x43d0('0x23')];this['maxNumberOriginate']=config[_0x43d0('0x24')]||0x2;this[_0x43d0('0x25')]={};this[_0x43d0('0x26')]={};this[_0x43d0('0x27')]={};this[_0x43d0('0x28')]={};this[_0x43d0('0x29')]={};this[_0x43d0('0x2a')]={};this[_0x43d0('0x2b')]={};this[_0x43d0('0x2c')]={};this[_0x43d0('0x2d')]={};this[_0x43d0('0x2e')]={};ami['on'](_0x43d0('0x2f'),this[_0x43d0('0x30')][_0x43d0('0x31')](this));ami['on'](_0x43d0('0x32'),this['syncQueueCallerAbandon'][_0x43d0('0x31')](this));ami['on'](_0x43d0('0x33'),this['syncOriginateResponse'][_0x43d0('0x31')](this));ami['on']('agentcomplete',this[_0x43d0('0x34')][_0x43d0('0x31')](this));ami['on']('custom:queuesummary',this[_0x43d0('0xb')][_0x43d0('0x31')](this));ami['on']('hangup',this[_0x43d0('0x35')][_0x43d0('0x31')](this));ami['on'](_0x43d0('0x36'),this['syncNewExten'][_0x43d0('0x31')](this));ami['on'](_0x43d0('0x37'),this[_0x43d0('0x38')][_0x43d0('0x31')](this));ami['on'](_0x43d0('0x39'),this[_0x43d0('0x3a')][_0x43d0('0x31')](this));ami['on']('queuestatuscomplete',this[_0x43d0('0x3b')][_0x43d0('0x31')](this));this[_0x43d0('0x3c')]();this['loopClearZombieChannels']();}function isNotNull(_0x4bfce9){return _0x4bfce9!==null&&!_['isUndefined'](_0x4bfce9);}function checkIsLoggedIn(_0x3c1ea3,_0x2db9dc){return function(){if(_0x2db9dc<=0x0){_0x3c1ea3[_0x43d0('0x3d')]=_0x43d0('0x3e');throw _0x3c1ea3[_0x43d0('0x3f')]+_0x43d0('0x40');}};}function isActive(_0x5d23c2){return _0x5d23c2;}function checkIsActive(_0x77654d,_0x167217){return function(){if(!isActive(_0x167217)){_0x77654d[_0x43d0('0x3d')]=_0x43d0('0x41');throw _0x77654d[_0x43d0('0x3f')]+_0x43d0('0x42');}};}function checkInterval(_0x12a8b9){return function(){if(!isNotNull(_0x12a8b9[_0x43d0('0x43')])){_0x12a8b9[_0x43d0('0x3d')]=_0x43d0('0x44');throw _0x12a8b9[_0x43d0('0x3f')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x12a8b9[_0x43d0('0x43')][_0x43d0('0x45')])){_0x12a8b9[_0x43d0('0x3d')]=_0x43d0('0x44');throw _0x12a8b9['name']+_0x43d0('0x46');}if(!isNotNull(_['isEmpty'](_0x12a8b9[_0x43d0('0x43')][_0x43d0('0x45')]))){_0x12a8b9['message']=_0x43d0('0x44');throw _0x12a8b9[_0x43d0('0x3f')]+_0x43d0('0x46');}};}function msgResponse(_0x3c1d26,_0x154db6,_0x31d67c){return{'action':_0x3c1d26,'response':_0x154db6,'message':_0x31d67c,'stack':_0x31d67c};}function myreject(_0x35a375){return function(_0x21d26e){return _0x35a375(msgResponse(_0x43d0('0x47'),_0x43d0('0x48'),JSON[_0x43d0('0x49')](_0x21d26e)));};}function getSeconds(_0x498334,_0x3afb3b){var _0x397bd6=moment(_0x498334)[_0x43d0('0x4a')](0x0);var _0x7891c5=moment(_0x3afb3b)[_0x43d0('0x4a')](0x0);return _0x397bd6[_0x43d0('0x4b')](_0x7891c5,_0x43d0('0x4c'));}function emit(_0xf5b750,_0x198836,_0x43bcc5){io['to'](_0xf5b750)[_0x43d0('0x4d')](_0x198836,_0x43bcc5);}function emitVoiceQueueSummary(_0x1f0092){if(_0x1f0092[_0x43d0('0x4e')]===_0x43d0('0x4f')){var _0x58c04d={'id':_0x1f0092['id'],'name':_0x1f0092[_0x43d0('0x3f')],'strategy':_0x1f0092[_0x43d0('0x50')],'answered':_0x1f0092[_0x43d0('0x51')],'available':_0x1f0092[_0x43d0('0x52')],'loggedIn':_0x1f0092[_0x43d0('0x53')],'pTalking':_0x1f0092[_0x43d0('0x54')],'sumBillable':_0x1f0092[_0x43d0('0x55')],'sumDuration':_0x1f0092[_0x43d0('0x56')],'sumHoldTime':_0x1f0092['sumHoldTime']||0x0,'talking':_0x1f0092['talking'],'total':_0x1f0092[_0x43d0('0x57')],'type':_0x1f0092['type'],'unmanaged':_0x1f0092['unmanaged'],'abandoned':_0x1f0092[_0x43d0('0x58')],'waiting':_0x1f0092['waiting'],'loggedInDb':_0x1f0092[_0x43d0('0x59')],'dialActive':_0x1f0092['dialActive'],'dialMethod':_0x1f0092[_0x43d0('0x5a')],'dialOriginateCallerIdName':_0x1f0092['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x1f0092[_0x43d0('0x5b')],'dialOriginateTimeout':_0x1f0092[_0x43d0('0x5c')],'dialPrefix':_0x1f0092[_0x43d0('0x5d')],'outboundAnswerAgiCallsDay':_0x1f0092['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x1f0092[_0x43d0('0x5e')],'outboundBlacklistCallsDay':_0x1f0092['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x1f0092[_0x43d0('0x5f')],'outboundCongestionCallsDay':_0x1f0092['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x1f0092['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x1f0092[_0x43d0('0x60')],'outboundDropCallsDayTimeout':_0x1f0092[_0x43d0('0x61')],'outboundNoAnswerCallsDay':_0x1f0092['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x1f0092[_0x43d0('0x62')],'outboundOriginateFailureCallsDay':_0x1f0092[_0x43d0('0x63')],'outboundReCallsDay':_0x1f0092[_0x43d0('0x64')],'outboundRejectCallsDay':_0x1f0092[_0x43d0('0x65')],'outboundUnknownCallsDay':_0x1f0092[_0x43d0('0x66')],'predictiveIntervalAnsweredCalls':_0x1f0092['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x1f0092[_0x43d0('0x67')],'predictiveIntervalAvgTalktime':_0x1f0092[_0x43d0('0x68')],'predictiveIntervalDroppedCallsCallersExit':_0x1f0092[_0x43d0('0x69')],'predictiveIntervalDroppedCallsTimeout':_0x1f0092[_0x43d0('0x6a')],'predictiveIntervalErlangCalls':_0x1f0092['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x1f0092[_0x43d0('0x6b')],'predictiveIntervalHitRate':_0x1f0092[_0x43d0('0x6c')],'predictiveIntervalMultiplicativeFactor':_0x1f0092[_0x43d0('0x6d')],'predictiveIntervalPauses':_0x1f0092[_0x43d0('0x6e')],'predictiveIntervalAvailable':_0x1f0092[_0x43d0('0x6f')],'predictiveIntervalTotalCalls':_0x1f0092['predictiveIntervalTotalCalls'],'message':_0x1f0092[_0x43d0('0x3d')],'originated':_0x1f0092[_0x43d0('0x70')],'erlangCalls':_0x1f0092['erlangCalls'],'erlangCallToSecond':_0x1f0092[_0x43d0('0x71')],'erlangAbandonmentRate':_0x1f0092[_0x43d0('0x72')],'erlangBusyFactor':_0x1f0092[_0x43d0('0x73')],'startPredictive':_0x1f0092['startPredictive'],'startProgressive':_0x1f0092[_0x43d0('0x2b')]};if(_0x1f0092['Trunk']){_0x58c04d[_0x43d0('0x74')]={'id':_0x1f0092['Trunk']['id'],'name':_0x1f0092[_0x43d0('0x74')][_0x43d0('0x3f')],'active':_0x1f0092[_0x43d0('0x74')][_0x43d0('0x75')],'callerid':_0x1f0092[_0x43d0('0x74')]['callerid']};}if(_0x1f0092[_0x43d0('0x43')]){_0x58c04d['Interval']={'id':_0x1f0092[_0x43d0('0x43')]['id'],'name':_0x1f0092[_0x43d0('0x43')][_0x43d0('0x3f')]};}var _0x94df19=md5(JSON[_0x43d0('0x49')](_0x58c04d));if(_0x1f0092[_0x43d0('0x5')]!==_0x94df19){_0x1f0092[_0x43d0('0x5')]=_0x94df19;emit(util[_0x43d0('0x76')](_0x43d0('0x77'),_0x58c04d[_0x43d0('0x3f')]),_0x43d0('0x78'),_0x58c04d);}}}function emitCampaignSummary(_0x22b1f9){if(_0x22b1f9['type']===_0x43d0('0x79')){emit(util[_0x43d0('0x76')](_0x43d0('0x7a'),_0x22b1f9['name']),_0x43d0('0x7b'),_0x22b1f9);}}function checkGetDataPredictive(_0x5f229e){if(isNotNull(_0x5f229e)&&!_['isEmpty'](_0x5f229e)){loggerPredictive[_0x43d0('0x7c')](_0x43d0('0x7d'));loggerPredictive[_0x43d0('0x7c')](_0x43d0('0x7e'),_0x5f229e[_0x43d0('0x7f')]);loggerPredictive['info']('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5f229e[_0x43d0('0x80')]);loggerPredictive['info'](_0x43d0('0x81'),_0x5f229e[_0x43d0('0x6a')]);loggerPredictive['info']('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5f229e['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x43d0('0x7c')](_0x43d0('0x82'),_0x5f229e[_0x43d0('0x67')]);loggerPredictive[_0x43d0('0x7c')](_0x43d0('0x83'),_0x5f229e[_0x43d0('0x68')]);loggerPredictive[_0x43d0('0x7c')](_0x43d0('0x84'));if(_0x5f229e[_0x43d0('0x7f')]>0x0){if(!_['isUndefined'](_0x5f229e[_0x43d0('0x68')])&&_0x5f229e[_0x43d0('0x68')]>0x0){return!![];}loggerPredictive[_0x43d0('0x7c')](_0x43d0('0x85'));if(!_[_0x43d0('0x86')](_0x5f229e[_0x43d0('0x67')])&&_0x5f229e[_0x43d0('0x67')]>0x0){return!![];}loggerPredictive[_0x43d0('0x7c')](_0x43d0('0x87'));}else{loggerPredictive[_0x43d0('0x7c')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive['info'](_0x43d0('0x88'));}return![];}function mergeDataErlangB(_0x12e3c0){return function(_0x1ea22a){loggerPredictive[_0x43d0('0x7c')](_0x43d0('0x89'));loggerPredictive[_0x43d0('0x7c')](_0x43d0('0x8a'),_0x1ea22a[_0x43d0('0x8b')]);loggerPredictive[_0x43d0('0x7c')](_0x43d0('0x8c'),_0x1ea22a[_0x43d0('0x71')]);loggerPredictive[_0x43d0('0x7c')](_0x43d0('0x8d'),_0x1ea22a[_0x43d0('0x72')]);loggerPredictive[_0x43d0('0x7c')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1ea22a['erlangBusyFactor']);loggerPredictive['info'](_0x43d0('0x8d'),_0x1ea22a[_0x43d0('0x72')]);loggerPredictive[_0x43d0('0x7c')]('---------------------------');_['merge'](_0x12e3c0,_0x1ea22a);};}function getDiff(_0x5dcd89){var _0x3c1da4=moment()['milliseconds'](0x0);var _0x2121fc=moment(_0x5dcd89)[_0x43d0('0x4a')](0x0);return _0x3c1da4[_0x43d0('0x4b')](_0x2121fc,'seconds');}function ifInterval(_0x167434,_0x47668e){if(_[_0x43d0('0x86')](_0x47668e)){return![];}return getDiff(_0x47668e)<_0x167434*0x3c;}function freeVariablesPredictive(_0x44094a){if(isNotNull(_0x44094a)){if(!_[_0x43d0('0x86')](_0x44094a[_0x43d0('0x2b')])){_0x44094a[_0x43d0('0x2b')]=undefined;loggerPredictive[_0x43d0('0x7c')](_0x44094a[_0x43d0('0x3f')],_0x43d0('0x8e'));}if(!_['isUndefined'](_0x44094a[_0x43d0('0x2a')])){_0x44094a[_0x43d0('0x2a')]=undefined;loggerPredictive[_0x43d0('0x7c')](_0x44094a[_0x43d0('0x3f')],_0x43d0('0x8f'));}if(!_[_0x43d0('0x86')](_0x44094a['handlePredictive'])){clearInterval(_0x44094a[_0x43d0('0x90')]);_0x44094a[_0x43d0('0x90')]=undefined;loggerPredictive[_0x43d0('0x7c')](_0x44094a[_0x43d0('0x3f')],_0x43d0('0x91'));}}}function erlangb(_0x3de90d,_0x4ebbc0){if(_0x4ebbc0===0x0){return 0x0;}var _0x11d916=0x1;for(var _0xd04e88=0x1;_0xd04e88<=_0x4ebbc0;_0xd04e88+=0x1){_0x11d916=0x1+_0x11d916*_0xd04e88/_0x3de90d;}return 0x1/_0x11d916;}function isVoiceQueueOutbound(_0x2fc753){return _0x2fc753===_0x43d0('0x4f');}function isNotPreview(_0x50e7bf){return _0x50e7bf!==_0x43d0('0x92');}function isCampaignIvr(_0x44333){return _0x44333===_0x43d0('0x79');}function getCallerId(_0x516243,_0x5454ea,_0x3ca7a5){if(!_[_0x43d0('0x86')](_0x3ca7a5)&&typeof _0x3ca7a5==='string'&&!_['isEmpty'](_0x3ca7a5)){if(!_[_0x43d0('0x86')](_0x5454ea)&&typeof _0x5454ea===_0x43d0('0x93')&&!_[_0x43d0('0x94')](_0x5454ea)){return util[_0x43d0('0x76')](_0x43d0('0x95'),_0x5454ea,_0x3ca7a5);}return util[_0x43d0('0x76')](_0x43d0('0x95'),_0x3ca7a5,_0x3ca7a5);}if(!_[_0x43d0('0x86')](_0x516243)&&typeof _0x516243==='string'&&!_[_0x43d0('0x94')](_0x516243)){return _0x516243;}return _0x43d0('0x96');}function loggerCatchQueueSummary(_0x594847,_0x5e7452){return function(_0x531419){freeVariablesPredictive(_0x5e7452);emitVoiceQueueSummary(_0x5e7452);emitCampaignSummary(_0x5e7452);loggerSyncQueueSummary[_0x43d0('0x97')](_0x594847,util[_0x43d0('0x98')](_0x531419,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x1f3cda,_0x505946){return function(_0x9b5f0d){loggerPredictive[_0x43d0('0x97')](_0x505946['name'],_0x1f3cda);loggerPredictive[_0x43d0('0x97')](_0x9b5f0d[_0x43d0('0x99')]);freeVariablesPredictive(_0x505946);};}function loggerCatch(_0x519e2c){return function(_0x3ed718){logger['error'](_0x519e2c,util[_0x43d0('0x98')](_0x3ed718,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0xa43542){return _0xa43542&&!_['isUndefined'](_0xa43542)&&_0xa43542['length']>0x0;}function decremetOriginate(_0x1a68db){if(!_[_0x43d0('0x86')](_0x1a68db)&&_0x1a68db!==null){if(typeof _0x1a68db[_0x43d0('0x70')]!=='undefined'){if(_0x1a68db['originated']>0x0){_0x1a68db[_0x43d0('0x70')]-=0x1;}else{logger[_0x43d0('0x97')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x43d0('0x97')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x4f125f,_0x27a2c7,_0x1d657a){if(_0x27a2c7>_0x1d657a){for(var _0xb03b17=0x0;_0xb03b17<_0x27a2c7-_0x1d657a;_0xb03b17+=0x1){decremetOriginate(_0x4f125f);}}}function loggerGetContactDialer(_0x2b7cf1,_0x1486f8,_0x3f5c9b){return function(_0x18bf64){checkContactLowerLimitOriginate(_0x1486f8,_0x3f5c9b,0x0);logger[_0x43d0('0x97')](_0x2b7cf1,util[_0x43d0('0x98')](_0x18bf64,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x29ac7e){return function(_0x3b488c){if(isNotNull(_0x3b488c)&&isNotNull(_0x3b488c[0x0])){if(_0x3b488c[0x0]['contactsRescheduled']>0x0){_0x29ac7e[_0x43d0('0x3d')]='RESCHEDULED_CONTACTS';logger['info'](_0x43d0('0x9a')+_0x29ac7e[_0x43d0('0x3f')],_0x3b488c[0x0]['contactsRescheduled'],_0x43d0('0x9b'));}else{_0x29ac7e[_0x43d0('0x3d')]=_0x43d0('0x9c');logger[_0x43d0('0x7c')](_0x43d0('0x9d')+_0x29ac7e[_0x43d0('0x3f')]);}}};}function notSendMessagesQueue(_0x1a2b0c){if(_0x1a2b0c[_0x43d0('0x9e')]){freeVariablesPredictive(_0x1a2b0c);if(_0x1a2b0c[_0x43d0('0x70')]===0x0&&_0x1a2b0c[_0x43d0('0x9f')]===0x0&&_0x1a2b0c[_0x43d0('0xa0')]===0x0&&(_0x1a2b0c[_0x43d0('0x54')]||0x0)===0x0){_0x1a2b0c[_0x43d0('0x9e')]=![];_0x1a2b0c[_0x43d0('0x52')]=0x0;_0x1a2b0c[_0x43d0('0x3d')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x43d0('0x97')](_0x43d0('0xa1'),_0x1a2b0c[_0x43d0('0x3f')],_0x43d0('0xa2'));}else{_0x1a2b0c[_0x43d0('0x3d')]=_0x43d0('0xa3');loggerSyncQueueSummary['error'](_0x43d0('0xa1'),_0x1a2b0c['name'],_0x43d0('0xa4'));}emitVoiceQueueSummary(_0x1a2b0c);}}function notSendMessagesCampaign(_0x948a6a){if(_0x948a6a[_0x43d0('0x9e')]){if(_0x948a6a[_0x43d0('0x70')]===0x0){_0x948a6a[_0x43d0('0x9e')]=![];_0x948a6a[_0x43d0('0x3d')]=_0x43d0('0x41');loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x948a6a[_0x43d0('0x3f')],_0x43d0('0xa2'));}else{_0x948a6a[_0x43d0('0x3d')]=_0x43d0('0xa3');loggerSyncQueueSummary[_0x43d0('0x97')](_0x43d0('0xa5'),_0x948a6a['name'],'is\x20disactive');}emitCampaignSummary(_0x948a6a);}}function createObjHistory(_0x2cef12,_0x5c6b0b,_0x1ed60f,_0x2cc15b,_0xefc976){_0x2cef12[_0x43d0('0x3d')]=_0x1ed60f;var _0x20ef8b=new Action(_0x2cef12,_0x5c6b0b);var _0x106247=new History(_0x20ef8b);_0x106247[_0x43d0('0xa6')]=_0x2cc15b;_0x106247['statedesc']=_0xefc976;_0x106247[_0x43d0('0xa7')]=_0x20ef8b[_0x43d0('0xa8')];return _0x106247;}Dialer[_0x43d0('0x1c')][_0x43d0('0xa9')]=function(){var _0x23422e=this;setInterval(function(){_0x23422e[_0x43d0('0xaa')](_0x23422e[_0x43d0('0x28')],_0x43d0('0xab'));_0x23422e[_0x43d0('0xaa')](_0x23422e[_0x43d0('0x26')],_0x43d0('0xac'));},0x32c8);};Dialer[_0x43d0('0x1c')][_0x43d0('0xaa')]=function(_0x11a9bc,_0x4fa0de){var _0x5cd9d9=this;for(var _0x4c19fe in _0x11a9bc){if(typeof _0x11a9bc[_0x4c19fe]!==_0x43d0('0xad')){this[_0x43d0('0x1f')][_0x43d0('0x1d')](function(){if(!_[_0x43d0('0xae')](_0x11a9bc[_0x4c19fe])){return ami['Action']({'action':_0x43d0('0xaf'),'channel':_0x11a9bc[_0x4c19fe]['channel']})[_0x43d0('0xb0')](function(_0x28f523){if(_0x28f523[_0x43d0('0x3d')]===_0x43d0('0xb1')){setTimeout(function(){if(_0x11a9bc[_0x4c19fe]&&_0x11a9bc[_0x4c19fe][_0x43d0('0x4e')]!==_0x43d0('0x79')){_0x5cd9d9[_0x43d0('0xb2')](_0x5cd9d9['voiceQueues'][_0x11a9bc[_0x4c19fe][_0x43d0('0xb3')]]);logger[_0x43d0('0x97')](_0x43d0('0xb4'),_0x4fa0de,_0x4c19fe,_0x11a9bc[_0x4c19fe][_0x43d0('0xb3')]);delete _0x11a9bc[_0x4c19fe];}if(_0x11a9bc[_0x4c19fe]&&_0x11a9bc[_0x4c19fe]['type']===_0x43d0('0x79')){_0x5cd9d9['updateOriginated'](_0x5cd9d9[_0x43d0('0x21')][_0x11a9bc[_0x4c19fe]['queue']]);logger[_0x43d0('0x97')](_0x43d0('0xb5'),_0x4fa0de,_0x4c19fe,_0x11a9bc[_0x4c19fe][_0x43d0('0xb3')]);delete _0x11a9bc[_0x4c19fe];}},0x2328);}});}});}}};Dialer['prototype'][_0x43d0('0xb6')]=function(_0x3e1e3e){return BPromise[_0x43d0('0xb7')]()[_0x43d0('0xb8')](cmHopper['countReScheduled'](_0x3e1e3e))[_0x43d0('0xb0')](loggerCatch(_0x43d0('0xb9')));};Dialer[_0x43d0('0x1c')][_0x43d0('0xba')]=function(_0x3dba5b){return BPromise[_0x43d0('0xb7')]()[_0x43d0('0xb8')](cmHopperBlack[_0x43d0('0xba')](_0x3dba5b))['catch'](loggerCatch(_0x43d0('0xbb')));};Dialer['prototype'][_0x43d0('0xbc')]=function(_0x39de5f,_0x552180,_0x2e085a){return BPromise[_0x43d0('0xb7')]()[_0x43d0('0xb8')](cmHopperAdditionalPhone[_0x43d0('0xbc')](_0x39de5f,_0x552180,_0x2e085a))[_0x43d0('0xb0')](loggerCatch('[verifyAdditionalPhone]\x20'));};Dialer[_0x43d0('0x1c')]['swapAdditionalPhones']=function(_0x21af05,_0x5e1aa3,_0x2f768b){return BPromise['resolve']()[_0x43d0('0xb8')](cmHopperAdditionalPhone['swapAdditionalPhones'](_0x21af05,_0x5e1aa3,_0x2f768b))['catch'](loggerCatch(_0x43d0('0xbd')));};Dialer[_0x43d0('0x1c')][_0x43d0('0xbe')]=function(_0xa016ad){return BPromise[_0x43d0('0xb7')]()[_0x43d0('0xb8')](cmHopperBlack[_0x43d0('0xbe')](_0xa016ad))[_0x43d0('0xb0')](loggerCatch(_0x43d0('0xbf')));};Dialer[_0x43d0('0x1c')][_0x43d0('0xc0')]=function(_0x26ae3b){return BPromise[_0x43d0('0xb7')]()['then'](cmHopperHistory[_0x43d0('0xc1')](_0x26ae3b))[_0x43d0('0xb0')](loggerCatch(_0x43d0('0xc2')));};Dialer[_0x43d0('0x1c')][_0x43d0('0xc3')]=function(_0x53ff2b){return BPromise[_0x43d0('0xb7')]()[_0x43d0('0xb8')](cmHopper[_0x43d0('0xc3')](_0x53ff2b))[_0x43d0('0xb0')](loggerCatch(_0x43d0('0xc4')));};Dialer[_0x43d0('0x1c')]['unlockContact']=function(_0xd44f11,_0x27def6,_0x399a8a){return BPromise['resolve']()[_0x43d0('0xb8')](cmHopper[_0x43d0('0xc5')](_0xd44f11,_0x27def6,_0x399a8a))['catch'](loggerCatch('[unlockContact]\x20'));};Dialer[_0x43d0('0x1c')][_0x43d0('0xc6')]=function(_0x3baafe,_0x37600d,_0x5a1538,_0xe05507,_0x1072d3){return BPromise['resolve']()['then'](cmHopper[_0x43d0('0xc6')](_0x3baafe,_0x37600d,_0x5a1538,_0xe05507))['catch'](function(_0x4c487e){_0x1072d3[_0x43d0('0xc7')]-=_0x5a1538;_0x1072d3[_0x43d0('0xc7')]=_0x1072d3[_0x43d0('0xc7')]>0x0?_0x1072d3[_0x43d0('0xc7')]:0x0;loggerCatch(_0x43d0('0xc8'))(_0x4c487e);});};Dialer[_0x43d0('0x1c')][_0x43d0('0xc9')]=function(_0x1ab7fb,_0x55c834,_0x51850d,_0x3646d3){return BPromise[_0x43d0('0xb7')]()[_0x43d0('0xb8')](cmHopper[_0x43d0('0xc9')](_0x1ab7fb,_0x55c834,_0x51850d))['catch'](function(_0x5f1062){_0x3646d3[_0x43d0('0xc7')]-=_0x55c834;_0x3646d3[_0x43d0('0xc7')]=_0x3646d3[_0x43d0('0xc7')]>0x0?_0x3646d3[_0x43d0('0xc7')]:0x0;loggerCatch(_0x43d0('0xca'))(_0x5f1062);});};Dialer['prototype'][_0x43d0('0xcb')]=function(_0x45cc44){return BPromise[_0x43d0('0xb7')]()[_0x43d0('0xb8')](voiceQueueRt[_0x43d0('0xcb')](_0x45cc44))[_0x43d0('0xb0')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x43d0('0x1c')]['moveContactManagedDialer']=function(_0x41884a){return BPromise[_0x43d0('0xb7')]()[_0x43d0('0xb8')](cmHopper[_0x43d0('0xcc')](_0x41884a))['catch'](loggerCatch(_0x43d0('0xcd')));};Dialer['prototype'][_0x43d0('0xce')]=function(_0x45c33a){return BPromise[_0x43d0('0xb7')]()[_0x43d0('0xb8')](cmHopperHistory[_0x43d0('0xce')](_0x45c33a))[_0x43d0('0xb0')](loggerCatch(_0x43d0('0xcf')));};Dialer[_0x43d0('0x1c')][_0x43d0('0xb2')]=function(_0xe7360){if(!_[_0x43d0('0x86')](_0xe7360)&&_0xe7360!==null){if(typeof _0xe7360[_0x43d0('0x70')]!=='undefined'){if(_0xe7360[_0x43d0('0x70')]>0x0){_0xe7360[_0x43d0('0x70')]-=0x1;}else{logger[_0x43d0('0x97')](_0x43d0('0xd0'));}}}else{logger[_0x43d0('0x97')](_0x43d0('0xd1'));}};Dialer[_0x43d0('0x1c')][_0x43d0('0xd2')]=function(_0x8e3f97,_0x4a371e){var _0x1513c5=this;return function(_0x562766){_0x1513c5[_0x43d0('0xb2')](_0x4a371e);logger['error'](_0x8e3f97,util[_0x43d0('0x98')](_0x562766,{'showHidden':![],'depth':null}));};};Dialer[_0x43d0('0x1c')][_0x43d0('0xd3')]=function(_0x4c3def,_0x297a45,_0x4f385c){var _0x2b1721={'state':0x19,'statedesc':'notFound'};this[_0x43d0('0xb2')](_0x297a45);this[_0x43d0('0xd4')](_[_0x43d0('0xd5')](_0x2b1721,_[_0x43d0('0xd6')](_0x4f385c,[_0x43d0('0xd7'),_0x43d0('0xd8'),_0x43d0('0xd9'),_0x43d0('0xda'),_0x43d0('0xdb')])),_0x43d0('0xdc'),'[emptyContact]');logger[_0x43d0('0x97')](_0x4c3def);};Dialer[_0x43d0('0x1c')][_0x43d0('0xdd')]=function(_0x3877a0){return _0x3877a0===_0x43d0('0xde');};Dialer[_0x43d0('0x1c')][_0x43d0('0xdf')]=function(_0x58a1af){return!_[_0x43d0('0x86')](_0x58a1af)&&_0x58a1af&&!_[_0x43d0('0x86')](_0x58a1af[_0x43d0('0x3f')])&&!_['isUndefined'](_0x58a1af[_0x43d0('0x75')])&&_0x58a1af['active']&&(this[_0x43d0('0x23')][util[_0x43d0('0x76')](_0x43d0('0xe0'),_0x58a1af['name'])][_0x43d0('0xaf')]===_0x43d0('0xe1')||this['trunks'][util[_0x43d0('0x76')](_0x43d0('0xe0'),_0x58a1af[_0x43d0('0x3f')])][_0x43d0('0xaf')]===_0x43d0('0xe2'));};Dialer[_0x43d0('0x1c')][_0x43d0('0xd4')]=function(_0x12ccde,_0x45dac1,_0x4eaf1b){this[_0x43d0('0xce')](_0x12ccde)['catch'](loggerCatch(_0x45dac1));this[_0x43d0('0xcc')](_0x12ccde)[_0x43d0('0xb0')](loggerCatch(_0x4eaf1b));};Dialer[_0x43d0('0x1c')]['syncVarSet']=function(_0x13e4f5){var _0x8ce8ee=this['uniqueId'][_0x13e4f5[_0x43d0('0xe3')]];var _0xdb8b85;if(!_[_0x43d0('0xae')](_0x13e4f5)&&!_['isNil'](_0x13e4f5[_0x43d0('0xe4')])&&!_[_0x43d0('0xae')](_0x13e4f5[_0x43d0('0xe4')][_0x43d0('0xe5')])&&_0x13e4f5[_0x43d0('0xe6')]==='xcally-motion-dialer'&&_0x8ce8ee){if(_0x8ce8ee[_0x43d0('0x4e')]!==_0x43d0('0x79')&&this[_0x43d0('0x20')][_0x8ce8ee['queue']][_0x43d0('0xe7')]&&_0x13e4f5[_0x43d0('0xe8')]===_0x43d0('0xe9')){delete this[_0x43d0('0x28')][_0x13e4f5['uniqueid']];this[_0x43d0('0xb2')](this['voiceQueues'][_0x8ce8ee[_0x43d0('0xb3')]]);this['voiceQueues'][_0x8ce8ee[_0x43d0('0xb3')]][_0x43d0('0x5e')]+=0x1;this[_0x43d0('0x20')][_0x8ce8ee['queue']][_0x43d0('0xea')]+=0x1;_0xdb8b85=new Hangup(_0x8ce8ee,_0x13e4f5);_0xdb8b85[_0x43d0('0xa6')]=0x12;_0xdb8b85['statedesc']=_0x43d0('0xeb');_0xdb8b85[_0x43d0('0xec')]=_0x43d0('0xed');ami[_0x43d0('0x4d')]('custom:amd',ut[_0x43d0('0xee')](_0xdb8b85,_0x43d0('0xef')));this[_0x43d0('0xd4')](_0xdb8b85,_0x43d0('0xf0'),_0x43d0('0xf1'));}if(_0x8ce8ee[_0x43d0('0x4e')]!==_0x43d0('0x79')&&this['voiceQueues'][_0x8ce8ee[_0x43d0('0xb3')]][_0x43d0('0xe7')]&&_0x13e4f5['value']===_0x43d0('0xf2')){var _0x1b4f2b=this;return new BPromise(function(_0x4d0dd5,_0x507686){delete _0x1b4f2b[_0x43d0('0x28')][_0x13e4f5[_0x43d0('0xe3')]];_0x1b4f2b[_0x43d0('0xb2')](_0x1b4f2b['voiceQueues'][_0x8ce8ee['queue']]);_0x1b4f2b[_0x43d0('0x20')][_0x8ce8ee['queue']][_0x43d0('0x5e')]+=0x1;_0x1b4f2b[_0x43d0('0x20')][_0x8ce8ee[_0x43d0('0xb3')]][_0x43d0('0xea')]+=0x1;var _0x538f7c=_0x1b4f2b[_0x43d0('0x20')][_0x8ce8ee[_0x43d0('0xb3')]];var _0x257231=new Hangup(_0x8ce8ee,_0x13e4f5);_0x257231['state']=0x13;_0x257231[_0x43d0('0xf3')]=_0x43d0('0xf4');_0x257231[_0x43d0('0xec')]=_0x43d0('0xed');_0x257231[_0x43d0('0xf5')]+=0x1;_0x257231['countglobal']+=0x1;_0x257231['amd']=!![];ami[_0x43d0('0x4d')]('custom:amd',ut[_0x43d0('0xee')](_0x257231,'amd'));_0x1b4f2b['createHistory'](_0x257231)[_0x43d0('0xb0')](loggerCatch(_0x43d0('0xf6')));if(_0x257231['countbusyretry']+_0x257231[_0x43d0('0xf7')]+_0x257231[_0x43d0('0xf8')]+_0x257231['countnosuchnumberretry']+_0x257231[_0x43d0('0xf9')]+_0x257231[_0x43d0('0xfa')]+_0x257231[_0x43d0('0xf5')]+_0x257231[_0x43d0('0xfb')]>=_0x538f7c['dialGlobalMaxRetry']){_0x1b4f2b[_0x43d0('0xfc')](_0x257231,_0x4d0dd5,_0x507686,_0x43d0('0xfd'));}else{if(_0x257231[_0x43d0('0xf5')]>=_0x538f7c[_0x43d0('0xfe')]){_0x1b4f2b[_0x43d0('0xff')](_0x257231,_0x4d0dd5,_0x507686,_0x43d0('0x100'));}else{_0x1b4f2b[_0x43d0('0xc3')]({'active':![],'countmachineretry':_0x257231[_0x43d0('0xf5')],'scheduledat':moment()[_0x43d0('0x101')](_0x538f7c[_0x43d0('0x102')],_0x43d0('0x103'))[_0x43d0('0x76')](_0x43d0('0x104')),'ContactId':_0x257231[_0x43d0('0xd7')],'ListId':_0x257231[_0x43d0('0xd8')],'VoiceQueueId':_0x257231[_0x43d0('0xda')]||undefined,'CampaignId':_0x257231[_0x43d0('0xdb')]||undefined})['catch'](loggerCatch(_0x43d0('0x105')));_0x4d0dd5({'reschedule':0x1});}}});}if(_0x8ce8ee[_0x43d0('0x4e')]===_0x43d0('0x79')&&this[_0x43d0('0x21')][_0x8ce8ee['queue']][_0x43d0('0xe7')]&&_0x13e4f5[_0x43d0('0xe8')]===_0x43d0('0xe9')){delete this[_0x43d0('0x28')][_0x13e4f5['uniqueid']];this[_0x43d0('0xb2')](this[_0x43d0('0x21')][_0x8ce8ee['queue']]);_0xdb8b85=new Hangup(_0x8ce8ee,_0x13e4f5);_0xdb8b85['state']=0x12;_0xdb8b85['statedesc']=_0x43d0('0xeb');_0xdb8b85['membername']=_0x43d0('0xed');ami[_0x43d0('0x4d')]('custom:amd',ut[_0x43d0('0xee')](_0xdb8b85,_0x43d0('0xef')));this[_0x43d0('0xd4')](_0xdb8b85,_0x43d0('0x106'),'[syncHangupInAMDIvr]');}if(_0x8ce8ee[_0x43d0('0x4e')]===_0x43d0('0x79')&&this['campaigns'][_0x8ce8ee['queue']][_0x43d0('0xe7')]&&_0x13e4f5[_0x43d0('0xe8')]===_0x43d0('0xf2')){var _0x1b4f2b=this;return new BPromise(function(_0xab66ab,_0x495db4){delete _0x1b4f2b[_0x43d0('0x28')][_0x13e4f5['uniqueid']];_0x1b4f2b[_0x43d0('0xb2')](_0x1b4f2b[_0x43d0('0x21')][_0x8ce8ee['queue']]);_0x1b4f2b[_0x43d0('0x21')][_0x8ce8ee[_0x43d0('0xb3')]][_0x43d0('0x5e')]+=0x1;_0x1b4f2b['campaigns'][_0x8ce8ee[_0x43d0('0xb3')]][_0x43d0('0xea')]+=0x1;var _0x39fa25=_0x1b4f2b[_0x43d0('0x21')][_0x8ce8ee['queue']];var _0x116d18=new Hangup(_0x8ce8ee,_0x13e4f5);_0x116d18[_0x43d0('0xa6')]=0x13;_0x116d18[_0x43d0('0xf3')]=_0x43d0('0xf4');_0x116d18['membername']=_0x43d0('0xed');_0x116d18[_0x43d0('0xf5')]+=0x1;_0x116d18['countglobal']+=0x1;_0x116d18[_0x43d0('0xef')]=!![];ami[_0x43d0('0x4d')]('custom:amd',ut[_0x43d0('0xee')](_0x116d18,'amd'));_0x1b4f2b[_0x43d0('0xce')](_0x116d18)[_0x43d0('0xb0')](loggerCatch(_0x43d0('0xf6')));if(_0x116d18[_0x43d0('0x107')]+_0x116d18[_0x43d0('0xf7')]+_0x116d18['countnoanswerretry']+_0x116d18['countnosuchnumberretry']+_0x116d18[_0x43d0('0xf9')]+_0x116d18[_0x43d0('0xfa')]+_0x116d18[_0x43d0('0xf5')]+_0x116d18[_0x43d0('0xfb')]>=_0x39fa25[_0x43d0('0x108')]){_0x1b4f2b[_0x43d0('0xfc')](_0x116d18,_0xab66ab,_0x495db4,_0x43d0('0xfd'));}else{if(_0x116d18[_0x43d0('0xf5')]>=_0x39fa25[_0x43d0('0xfe')]){_0x1b4f2b[_0x43d0('0xff')](_0x116d18,_0xab66ab,_0x495db4,'reason\x2019\x20machine....');}else{_0x1b4f2b[_0x43d0('0xc3')]({'active':![],'countmachineretry':_0x116d18[_0x43d0('0xf5')],'scheduledat':moment()[_0x43d0('0x101')](_0x39fa25[_0x43d0('0x102')],_0x43d0('0x103'))[_0x43d0('0x76')](_0x43d0('0x104')),'ContactId':_0x116d18[_0x43d0('0xd7')],'ListId':_0x116d18['ListId'],'VoiceQueueId':_0x116d18['VoiceQueueId']||undefined,'CampaignId':_0x116d18[_0x43d0('0xdb')]||undefined})[_0x43d0('0xb0')](loggerCatch(_0x43d0('0x105')));_0xab66ab({'reschedule':0x1});}}});}}};Dialer[_0x43d0('0x1c')]['syncHangup']=function(_0x46c63d){var _0x10a85c=this[_0x43d0('0x28')][_0x46c63d['uniqueid']];var _0x3200c8=this;var _0x1cb96a;if(_0x10a85c&&_0x10a85c[_0x43d0('0x4e')]===_0x43d0('0x79')){delete this[_0x43d0('0x28')][_0x46c63d[_0x43d0('0xe3')]];this[_0x43d0('0xb2')](this['campaigns'][_0x10a85c[_0x43d0('0xb3')]]);this[_0x43d0('0x21')][_0x10a85c[_0x43d0('0xb3')]][_0x43d0('0x109')]+=0x1;_0x1cb96a=new Hangup(_0x10a85c,_0x46c63d);this[_0x43d0('0xce')](_0x1cb96a)[_0x43d0('0xb0')](loggerCatch(_0x43d0('0x10a')));this[_0x43d0('0xcc')](_0x1cb96a)[_0x43d0('0xb0')](loggerCatch(_0x43d0('0x10b')));}if(_0x10a85c&&_0x10a85c['type']!==_0x43d0('0x79')&&isNotNull(this[_0x43d0('0x20')][_0x10a85c[_0x43d0('0xb3')]][_0x43d0('0x10c')])){delete this[_0x43d0('0x28')][_0x46c63d['uniqueid']];this[_0x43d0('0xb2')](this[_0x43d0('0x20')][_0x10a85c['queue']]);this[_0x43d0('0x20')][_0x10a85c[_0x43d0('0xb3')]][_0x43d0('0x5e')]+=0x1;this[_0x43d0('0x20')][_0x10a85c[_0x43d0('0xb3')]]['outboundAnswerAgiCallsDay']+=0x1;_0x1cb96a=new Hangup(_0x10a85c,_0x46c63d);_0x1cb96a['state']=0x10;_0x1cb96a['statedesc']='AnswerAGI';_0x1cb96a['membername']='AGI';this['createHistory'](_0x1cb96a)['catch'](loggerCatch(_0x43d0('0x10a')));this[_0x43d0('0xcc')](_0x1cb96a)[_0x43d0('0xb0')](loggerCatch(_0x43d0('0x10b')));}if(_0x10a85c&&_0x10a85c[_0x43d0('0x4e')]!==_0x43d0('0x79')&&!isNotNull(this[_0x43d0('0x20')][_0x10a85c[_0x43d0('0xb3')]][_0x43d0('0x10c')])){delete this[_0x43d0('0x28')][_0x46c63d['uniqueid']];this[_0x43d0('0xb2')](this[_0x43d0('0x20')][_0x10a85c[_0x43d0('0xb3')]]);this[_0x43d0('0x20')][_0x10a85c['queue']]['outboundUnknownCallsDay']+=0x1;_0x1cb96a=new Hangup(_0x10a85c,_0x46c63d);_0x1cb96a[_0x43d0('0xa6')]=0xc;_0x1cb96a[_0x43d0('0xf3')]=_0x46c63d[_0x43d0('0x10d')];_0x1cb96a[_0x43d0('0xec')]=_0x43d0('0x10e');this[_0x43d0('0xce')](_0x1cb96a)[_0x43d0('0xb0')](loggerCatch(_0x43d0('0x10a')));this[_0x43d0('0xcc')](_0x1cb96a)['catch'](loggerCatch(_0x43d0('0x10b')));}};Dialer[_0x43d0('0x1c')][_0x43d0('0x34')]=function(_0x1ddf76){var _0x30e086=this[_0x43d0('0x28')][_0x1ddf76['uniqueid']];var _0x4e3a13=this;if(this['voiceQueues'][_0x1ddf76[_0x43d0('0xb3')]]){if(_0x30e086&&_0x30e086[_0x43d0('0x4e')]!==_0x43d0('0x79')){delete this[_0x43d0('0x28')][_0x1ddf76[_0x43d0('0xe3')]];this[_0x43d0('0x20')][_0x1ddf76[_0x43d0('0xb3')]][_0x43d0('0x5e')]+=0x1;var _0x4a180b=new AgentComplete(_0x30e086,_0x1ddf76);if(_0x1ddf76[_0x43d0('0x10f')]==='agent'){_0x4a180b[_0x43d0('0x110')]=this[_0x43d0('0x20')][_0x1ddf76[_0x43d0('0xb3')]][_0x43d0('0x111')]&&this[_0x43d0('0x20')][_0x1ddf76[_0x43d0('0xb3')]][_0x43d0('0x112')]?moment()[_0x43d0('0x76')](_0x43d0('0x104')):undefined;}this[_0x43d0('0xce')](_0x4a180b)['catch'](loggerCatch(_0x43d0('0x113')));this[_0x43d0('0xcc')](_0x4a180b)[_0x43d0('0xb0')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x43d0('0x1c')][_0x43d0('0x30')]=function(_0x111292){if(this[_0x43d0('0x20')][_0x111292['queue']]){if(this['uniqueId'][_0x111292['uniqueid']]&&this[_0x43d0('0x28')][_0x111292['uniqueid']][_0x43d0('0x4e')]!==_0x43d0('0x79')){this['updateOriginated'](this['voiceQueues'][_0x111292[_0x43d0('0xb3')]]);this['uniqueId'][_0x111292[_0x43d0('0xe3')]][_0x43d0('0x114')]=moment()[_0x43d0('0x76')](_0x43d0('0x104'));}}};Dialer['prototype'][_0x43d0('0x115')]=function(_0x2cbbc9,_0x348e7b){this[_0x43d0('0xce')](_0x2cbbc9)[_0x43d0('0xb0')](loggerCatch(_0x43d0('0x113')));if(_0x348e7b==0x0){this[_0x43d0('0xcc')](_0x2cbbc9)['catch'](loggerCatch(_0x43d0('0x116')));}};Dialer['prototype'][_0x43d0('0x117')]=function(_0xa1f13f){var _0xc14b7b=this['uniqueId'][_0xa1f13f[_0x43d0('0xe3')]];var _0x2fa32b=this;var _0x144cc0=![];var _0x41074d;var _0x2b8760;if(this[_0x43d0('0x20')][_0xa1f13f['queue']]){if(_0xc14b7b&&_0xc14b7b[_0x43d0('0x4e')]!==_0x43d0('0x79')){delete this[_0x43d0('0x28')][_0xa1f13f[_0x43d0('0xe3')]];this[_0x43d0('0xb2')](this['voiceQueues'][_0xa1f13f[_0x43d0('0xb3')]]);_0xc14b7b[_0x43d0('0x118')]=moment()[_0x43d0('0x76')](_0x43d0('0x104'));var _0x492b9=new QueueCallerAbandon(_0xc14b7b,_0xa1f13f);if(getSeconds(_0xc14b7b['droptime'],_0xc14b7b[_0x43d0('0x119')])>=_0xc14b7b[_0x43d0('0x11a')]){this['voiceQueues'][_0xa1f13f['queue']][_0x43d0('0x6a')]+=0x1;this[_0x43d0('0x20')][_0xa1f13f[_0x43d0('0xb3')]][_0x43d0('0x61')]+=0x1;this['voiceQueues'][_0xa1f13f[_0x43d0('0xb3')]][_0x43d0('0x6b')]+=0x1;_0x492b9[_0x43d0('0xa6')]=0xa;_0x492b9[_0x43d0('0xf3')]=_0x43d0('0x11b');_0x492b9['dropreason']=_0x43d0('0x11c');_0x492b9[_0x43d0('0x110')]=this[_0x43d0('0x20')][_0xa1f13f[_0x43d0('0xb3')]][_0x43d0('0x111')]?moment()[_0x43d0('0x76')](_0x43d0('0x104')):undefined;_0x492b9[_0x43d0('0xf9')]+=0x1;_0x492b9[_0x43d0('0x11d')]+=0x1;_0x41074d=this[_0x43d0('0x20')][_0xa1f13f[_0x43d0('0xb3')]][_0x43d0('0x11e')];_0x2b8760=this[_0x43d0('0x20')][_0xa1f13f['queue']][_0x43d0('0x11f')];_0x2fa32b['verifyAdditionalPhones'](_0x492b9,_0x492b9[_0x43d0('0xa6')],_0xc14b7b['voiceQueue'])[_0x43d0('0xb8')](function(_0x96d8ad){_0x144cc0=_0x96d8ad[_0x43d0('0x120')]==0x1;if(_0x492b9[_0x43d0('0xf9')]>=_0x2fa32b[_0x43d0('0x20')][_0xa1f13f['queue']]['dialDropMaxRetry']){_0x2fa32b['queueCallerAbandonCreateState'](_0x492b9,_0x96d8ad['additional']);}else{_0x2fa32b[_0x43d0('0xc3')]({'active':![],'countdropretry':_0x492b9[_0x43d0('0xf9')],'scheduledat':moment()[_0x43d0('0x101')](_0x2fa32b['voiceQueues'][_0xa1f13f['queue']][_0x43d0('0x11e')],_0x43d0('0x103'))[_0x43d0('0x76')](_0x43d0('0x104')),'ContactId':_0xc14b7b['ContactId'],'ListId':_0xc14b7b[_0x43d0('0xd8')],'VoiceQueueId':_0xc14b7b[_0x43d0('0xda')]||undefined,'CampaignId':_0xc14b7b[_0x43d0('0xdb')]||undefined})[_0x43d0('0xb0')](loggerCatch(_0x43d0('0x121')));var _0x44f778=new History(_0x492b9);_0x44f778[_0x43d0('0xa6')]=0xa;_0x44f778[_0x43d0('0xf3')]=_0x43d0('0x11b');_0x44f778[_0x43d0('0xa8')]=moment()[_0x43d0('0x76')](_0x43d0('0x104'));_0x44f778[_0x43d0('0xa7')]=_0x44f778[_0x43d0('0xa8')];_0x44f778[_0x43d0('0x122')]=_0x492b9[_0x43d0('0x122')];_0x44f778[_0x43d0('0x123')]=_0x492b9[_0x43d0('0x123')];_0x2fa32b[_0x43d0('0xce')](_0x44f778)[_0x43d0('0xb0')](loggerCatch(_0x43d0('0x124')));}})[_0x43d0('0xb8')](function(_0x56fafb){if(_0x144cc0)_0x2fa32b[_0x43d0('0x125')](_0x492b9,_0x41074d,_0x2b8760)[_0x43d0('0xb8')](function(_0x16e684){return 0x1;});});}else{this[_0x43d0('0x20')][_0xa1f13f[_0x43d0('0xb3')]][_0x43d0('0x69')]+=0x1;this[_0x43d0('0x20')][_0xa1f13f['queue']]['outboundDropCallsDayCallersExit']+=0x1;_0x492b9['state']=0xb;_0x492b9[_0x43d0('0xf3')]='Abandoned';_0x492b9['dropreason']=_0x43d0('0x126');_0x492b9[_0x43d0('0xfa')]+=0x1;_0x492b9[_0x43d0('0x11d')]+=0x1;_0x41074d=this[_0x43d0('0x20')][_0xa1f13f[_0x43d0('0xb3')]][_0x43d0('0x127')];_0x2b8760=this[_0x43d0('0x20')][_0xa1f13f[_0x43d0('0xb3')]][_0x43d0('0x11f')];_0x2fa32b[_0x43d0('0xbc')](_0x492b9,_0x492b9[_0x43d0('0xa6')],_0xc14b7b[_0x43d0('0x128')])[_0x43d0('0xb8')](function(_0x16ab65){if(_0x492b9[_0x43d0('0xfa')]>=_0x2fa32b[_0x43d0('0x20')][_0xa1f13f[_0x43d0('0xb3')]][_0x43d0('0x129')]){_0x2fa32b[_0x43d0('0x115')](_0x492b9,_0x16ab65['additional']);}else{_0x2fa32b[_0x43d0('0xc3')]({'active':![],'countabandonedretry':_0x492b9[_0x43d0('0xfa')],'scheduledat':moment()[_0x43d0('0x101')](_0x2fa32b[_0x43d0('0x20')][_0xa1f13f[_0x43d0('0xb3')]][_0x43d0('0x127')],_0x43d0('0x103'))['format'](_0x43d0('0x104')),'ContactId':_0xc14b7b[_0x43d0('0xd7')],'ListId':_0xc14b7b[_0x43d0('0xd8')],'VoiceQueueId':_0xc14b7b[_0x43d0('0xda')]||undefined,'CampaignId':_0xc14b7b[_0x43d0('0xdb')]||undefined})[_0x43d0('0xb0')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x57a6c0=new History(_0x492b9);_0x57a6c0[_0x43d0('0xa6')]=0xb;_0x57a6c0[_0x43d0('0xf3')]=_0x43d0('0x12a');_0x57a6c0[_0x43d0('0xa8')]=moment()[_0x43d0('0x76')](_0x43d0('0x104'));_0x57a6c0[_0x43d0('0xa7')]=_0x57a6c0[_0x43d0('0xa8')];_0x57a6c0[_0x43d0('0x122')]=_0x492b9[_0x43d0('0x122')];_0x57a6c0['calleridnum']=_0x492b9[_0x43d0('0x123')];_0x2fa32b[_0x43d0('0xce')](_0x57a6c0)[_0x43d0('0xb0')](loggerCatch(_0x43d0('0x12b')));}})[_0x43d0('0xb8')](function(_0x214add){if(_0x144cc0)_0x2fa32b[_0x43d0('0x125')](_0x492b9,_0x41074d,_0x2b8760)['then'](function(_0x49b488){return 0x1;});});}}}};Dialer[_0x43d0('0x1c')][_0x43d0('0x12c')]=function(_0x4f2de6){if(this[_0x43d0('0x26')][_0x4f2de6[_0x43d0('0xe3')]]){this['actions'][_0x4f2de6['uniqueid']][_0x43d0('0x12d')]=_0x4f2de6['channel'];}if(this['uniqueId'][_0x4f2de6[_0x43d0('0xe3')]]){this[_0x43d0('0x28')][_0x4f2de6[_0x43d0('0xe3')]][_0x43d0('0x12d')]=_0x4f2de6[_0x43d0('0x12d')];}};Dialer['prototype'][_0x43d0('0x3a')]=function(_0x889f29){if(strategy[this['voiceQueues'][this[_0x43d0('0x26')][_0x889f29[_0x43d0('0x12e')]][_0x43d0('0xb3')]][_0x43d0('0x50')]]===_0x43d0('0x12f')){if(this[_0x43d0('0x26')][_0x889f29['actionid']]&&_[_0x43d0('0xae')](this[_0x43d0('0x26')][_0x889f29[_0x43d0('0x12e')]][_0x43d0('0x130')])&&_0x889f29[_0x43d0('0xaf')]==='1'&&_0x889f29['paused']==='0'){if(this[_0x43d0('0x22')][_0x889f29[_0x43d0('0x131')]]){if(!this['agents'][_0x889f29[_0x43d0('0x131')]][_0x43d0('0x130')]){this[_0x43d0('0x22')][_0x889f29[_0x43d0('0x131')]][_0x43d0('0x130')]=!![];this[_0x43d0('0x26')][_0x889f29[_0x43d0('0x12e')]][_0x43d0('0x130')]=!![];this[_0x43d0('0x26')][_0x889f29[_0x43d0('0x12e')]][_0x43d0('0x131')]=_0x889f29[_0x43d0('0x131')];}}}}else if((strategy[this['voiceQueues'][this[_0x43d0('0x26')][_0x889f29[_0x43d0('0x12e')]][_0x43d0('0xb3')]]['strategy']]||_0x43d0('0x1b'))===_0x43d0('0x1b')){if(this['actions'][_0x889f29['actionid']]){if(this['agents'][_0x889f29[_0x43d0('0x131')]]){this[_0x43d0('0x26')][_0x889f29[_0x43d0('0x12e')]][_0x43d0('0x131')]=_0x889f29[_0x43d0('0x131')];if(_['isNil'](this[_0x43d0('0x2d')][this['actions'][_0x889f29[_0x43d0('0x12e')]][_0x43d0('0xb3')]])){this[_0x43d0('0x2d')][this[_0x43d0('0x26')][_0x889f29[_0x43d0('0x12e')]]['queue']]=[];}this[_0x43d0('0x2d')][this['actions'][_0x889f29[_0x43d0('0x12e')]][_0x43d0('0xb3')]][_0x43d0('0x132')](_[_0x43d0('0xd5')](_[_0x43d0('0xd6')](this[_0x43d0('0x26')][_0x889f29['actionid']],[_0x43d0('0x133'),_0x43d0('0x131')]),{'status':_0x889f29[_0x43d0('0xaf')],'paused':_0x889f29[_0x43d0('0x134')]}));}}}};function unlockQueueStatus(_0x2c15b9,_0x4a7984){setTimeout(function(){if(_[_0x43d0('0x86')](_0x2c15b9[_0x43d0('0x135')])){loggerBooked[_0x43d0('0x97')]('[unlockQueueStatus][undefined]',_0x4a7984);}_0x2c15b9[_0x43d0('0x135')]=!![];loggerBooked[_0x43d0('0x7c')](_0x43d0('0x136'),_0x4a7984,JSON[_0x43d0('0x49')](_[_0x43d0('0xd6')](_0x2c15b9,[_0x43d0('0x3f'),'queueStatusComplete'])));},0x1f3);}Dialer[_0x43d0('0x1c')][_0x43d0('0x3b')]=function(_0x2d81ef){var _0x41fb59=this;var _0x4b6d1a=_0x41fb59[_0x43d0('0x20')][_0x41fb59[_0x43d0('0x26')][_0x2d81ef['actionid']][_0x43d0('0xb3')]];if(strategy[this[_0x43d0('0x20')][this[_0x43d0('0x26')][_0x2d81ef[_0x43d0('0x12e')]][_0x43d0('0xb3')]]['strategy']]==='roundrobin'){if(this[_0x43d0('0x26')][_0x2d81ef[_0x43d0('0x12e')]]&&this[_0x43d0('0x26')][_0x2d81ef['actionid']][_0x43d0('0x131')]){this[_0x43d0('0x92')][_0x43d0('0x137')](this['actions'][_0x2d81ef[_0x43d0('0x12e')]][_0x43d0('0x133')],this['actions'][_0x2d81ef['actionid']][_0x43d0('0x131')])['catch'](function(_0x1ccefb){logger[_0x43d0('0x97')](_0x43d0('0x138'),util[_0x43d0('0x98')](_0x1ccefb,{'showHidden':![],'depth':null}));})[_0x43d0('0x139')](function(){_0x41fb59[_0x43d0('0xb2')](_0x41fb59[_0x43d0('0x20')][_0x41fb59['actions'][_0x2d81ef[_0x43d0('0x12e')]][_0x43d0('0xb3')]]);_0x41fb59[_0x43d0('0x22')][_0x41fb59[_0x43d0('0x26')][_0x2d81ef[_0x43d0('0x12e')]]['stateinterface']]['locked']=![];delete _0x41fb59['actions'][_0x2d81ef[_0x43d0('0x12e')]];unlockQueueStatus(_0x4b6d1a);});}else{this[_0x43d0('0xb2')](this['voiceQueues'][this['actions'][_0x2d81ef[_0x43d0('0x12e')]][_0x43d0('0xb3')]]);this[_0x43d0('0xc3')]({'active':![],'ContactId':this[_0x43d0('0x26')][_0x2d81ef[_0x43d0('0x12e')]][_0x43d0('0xd7')],'ListId':this[_0x43d0('0x26')][_0x2d81ef[_0x43d0('0x12e')]][_0x43d0('0xd8')],'VoiceQueueId':this[_0x43d0('0x26')][_0x2d81ef[_0x43d0('0x12e')]][_0x43d0('0xda')]||undefined,'CampaignId':this['actions'][_0x2d81ef[_0x43d0('0x12e')]][_0x43d0('0xdb')]||undefined})[_0x43d0('0xb0')](loggerCatch(_0x43d0('0x13a')));delete this[_0x43d0('0x26')][_0x2d81ef[_0x43d0('0x12e')]];unlockQueueStatus(_0x4b6d1a);}}else if((strategy[this[_0x43d0('0x20')][this['actions'][_0x2d81ef['actionid']][_0x43d0('0xb3')]][_0x43d0('0x50')]]||_0x43d0('0x1b'))===_0x43d0('0x1b')){var _0x107d99;if(this[_0x43d0('0x26')][_0x2d81ef[_0x43d0('0x12e')]]&&!_['isEmpty'](this[_0x43d0('0x2d')][this['actions'][_0x2d81ef[_0x43d0('0x12e')]][_0x43d0('0xb3')]])){if(this[_0x43d0('0x2e')][_0x41fb59[_0x43d0('0x26')][_0x2d81ef[_0x43d0('0x12e')]]['queue']]){this[_0x43d0('0x2e')][_0x41fb59[_0x43d0('0x26')][_0x2d81ef['actionid']][_0x43d0('0xb3')]]=this[_0x43d0('0x2e')][this[_0x43d0('0x26')][_0x2d81ef[_0x43d0('0x12e')]][_0x43d0('0xb3')]]?this[_0x43d0('0x2e')][this[_0x43d0('0x26')][_0x2d81ef[_0x43d0('0x12e')]][_0x43d0('0xb3')]]:this[_0x43d0('0x2d')][this['actions'][_0x2d81ef[_0x43d0('0x12e')]][_0x43d0('0xb3')]]?this[_0x43d0('0x2d')][this[_0x43d0('0x26')][_0x2d81ef[_0x43d0('0x12e')]][_0x43d0('0xb3')]][_0x43d0('0x13b')]||0x0:0x0;}this['queueBooked'][this['actions'][_0x2d81ef['actionid']][_0x43d0('0xb3')]][_0x43d0('0x13b')]=this[_0x43d0('0x2e')][this['actions'][_0x2d81ef['actionid']]['queue']];for(var _0x44e3cd=0x0;_0x44e3cd=0x0;})['catch'](myreject(_0x5db110)));}}else{_0x186519['push'](ami[_0x43d0('0x158')]({'action':_0x43d0('0x151'),'command':util[_0x43d0('0x76')](_0x43d0('0x152'),_0x2828f0,!_['isUndefined'](config[_0x43d0('0x154')][_0x18fbbb])?_0x18fbbb:'')})['then'](function(_0x1e3ab7){return _0x1e3ab7[_0x43d0('0x155')]['indexOf'](_0x43d0('0x157'))>=0x0;})[_0x43d0('0xb0')](myreject(_0x5db110)));}BPromise[_0x43d0('0x159')](_0x186519)['then'](function(_0xce5d03){var _0x436402=_[_0x43d0('0x15a')](_0xce5d03);if(_0x436402){return _0x10ae57(_0x436402);}else{_0x23e9b0[_0x43d0('0x3d')]=_0x5bebdc?_0x43d0('0x15b'):'INTERVAL_IS_OVERTIME';return _0x5db110(msgResponse(_0x43d0('0x15c'),_0x43d0('0x14d'),_0x43d0('0x15d')+_0x5bebdc+'\x20'+_0x3219d7+_0x43d0('0x15e')+util[_0x43d0('0x98')](_0x2828f0,{'showHidden':![],'depth':null})+_0x43d0('0x15f')+_0x18fbbb));}})[_0x43d0('0xb0')](function(_0x3d139b){return _0x5db110(msgResponse(_0x43d0('0x149'),_0x43d0('0x14d'),JSON['stringify'](_0x3d139b)));});});};Dialer[_0x43d0('0x1c')]['checkDialMethod']=function(_0x168552){var _0x525b90=this;return function(){switch(_0x168552[_0x43d0('0x5a')]){case _0x43d0('0x160'):freeVariablesPredictive(_0x168552);_0x525b90[_0x43d0('0x161')](_0x168552,0x1);break;case _0x43d0('0x162'):freeVariablesPredictive(_0x168552);_0x525b90[_0x43d0('0x161')](_0x168552,_0x168552[_0x43d0('0x163')]);break;case _0x43d0('0x164'):_0x525b90['predictive'](_0x168552);break;case _0x43d0('0xa'):freeVariablesPredictive(_0x168552);_0x525b90[_0x43d0('0x161')](_0x168552,0x1);break;default:freeVariablesPredictive(_0x168552);logger[_0x43d0('0x97')]('Queue',_0x168552['name'],'method\x20not\x20recognized');}};};Dialer[_0x43d0('0x1c')][_0x43d0('0x165')]=function(_0x48f243){var _0x3655d8=this;return function(){_0x3655d8[_0x43d0('0x166')](_0x48f243);};};Dialer[_0x43d0('0x1c')][_0x43d0('0xb')]=function(_0x5e6092){var _0x2b9f35=this;if(isNotPreview(_0x5e6092[_0x43d0('0x5a')])){if(isVoiceQueueOutbound(_0x5e6092[_0x43d0('0x4e')])&&isActive(_0x5e6092[_0x43d0('0x167')])){_0x5e6092[_0x43d0('0x9e')]=!![];BPromise[_0x43d0('0xb7')]()[_0x43d0('0xb8')](checkIsLoggedIn(_0x5e6092,_0x5e6092[_0x43d0('0x53')]))[_0x43d0('0xb8')](checkIsActive(_0x5e6092,_0x5e6092['dialActive']))['then'](checkInterval(_0x5e6092))[_0x43d0('0xb8')](_0x2b9f35['checkIsTrunkReachable'](_0x5e6092))['then'](_0x2b9f35[_0x43d0('0x148')](_0x5e6092[_0x43d0('0x168')],_0x5e6092[_0x43d0('0x169')],_0x5e6092[_0x43d0('0x3f')],_0x5e6092))['then'](_0x2b9f35['checkIfTimeIntervals'](_0x5e6092['Interval'],_0x5e6092[_0x43d0('0x169')],_0x5e6092[_0x43d0('0x3f')],_0x5e6092))[_0x43d0('0xb8')](_0x2b9f35['checkDialMethod'](_0x5e6092))['catch'](loggerCatchQueueSummary(_0x43d0('0x16a'),_0x5e6092));}else{notSendMessagesQueue(_0x5e6092);}}else{freeVariablesPredictive(_0x5e6092);}};Dialer[_0x43d0('0x1c')][_0x43d0('0x144')]=function(){var _0x19834c=this;var _0x58b72e;for(var _0x3fe5ce in this[_0x43d0('0x21')]){if(typeof this['campaigns'][_0x3fe5ce]!==_0x43d0('0xad')){_0x58b72e=this[_0x43d0('0x21')][_0x3fe5ce];if(isCampaignIvr(_0x58b72e[_0x43d0('0x4e')])&&isActive(_0x58b72e[_0x43d0('0x75')])){_0x58b72e['sendMessageOneNotActive']=!![];BPromise['resolve']()[_0x43d0('0xb8')](checkIsActive(_0x58b72e,_0x58b72e[_0x43d0('0x75')]))['then'](checkInterval(_0x58b72e))[_0x43d0('0xb8')](_0x19834c[_0x43d0('0x16b')](_0x58b72e))[_0x43d0('0xb8')](_0x19834c[_0x43d0('0x148')](_0x58b72e[_0x43d0('0x168')],_0x58b72e[_0x43d0('0x169')],_0x58b72e['name'],_0x58b72e))[_0x43d0('0xb8')](_0x19834c['checkIfTimeIntervals'](_0x58b72e[_0x43d0('0x43')],_0x58b72e['dialTimezone'],_0x58b72e[_0x43d0('0x3f')],_0x58b72e))[_0x43d0('0xb8')](_0x19834c[_0x43d0('0x165')](_0x58b72e))[_0x43d0('0xb0')](loggerCatchQueueSummary(_0x43d0('0x16c'),_0x58b72e));}else{notSendMessagesCampaign(_0x58b72e);}}}};function getCallerIdRandom(_0x2d5685,_0xcb31bf){var _0x34aa3d;var _0xa094a;var _0x28d1a8;if(_0xcb31bf<=0x0){_0xcb31bf=0x1;}_0x34aa3d=new RegExp(_0x43d0('0x16d')+_0xcb31bf+'}$');_0xa094a=Math[_0x43d0('0x16e')](0xa,_0xcb31bf-0x1);_0x28d1a8=Math[_0x43d0('0x16e')](0xa,_0xcb31bf)-0x1;return util[_0x43d0('0x76')]('%s',_[_0x43d0('0x16f')](_0x2d5685,_0x34aa3d,_['random'](_0xa094a,_0x28d1a8)));}function extractCalleridName(_0x2d7060){var _0x21aedd=_0x2d7060[_0x43d0('0x170')](/"(.*?)"/);return _0x21aedd?_0x21aedd[0x1]:_0x2d7060;}function extractCalleridNumber(_0x2d1ace){var _0x45fb48=_0x2d1ace['match'](/<(.*?)>/);return _0x45fb48?_0x45fb48[0x1]:_0x2d1ace;}Dialer['prototype'][_0x43d0('0x171')]=function(_0x218af9,_0x19ecb2){var _0x7e2cd1=this;var _0x3a1109=uuid['v4']();this[_0x43d0('0x26')][_0x3a1109]=new Action(_0x218af9,_0x19ecb2,_0x3a1109);return new BPromise(function(_0x387f82,_0x3f5c77){if(_[_0x43d0('0x86')](_0x218af9)&&typeof _0x218af9!=='object'){return _0x3f5c77(msgResponse(_0x43d0('0x172'),_0x43d0('0x14d'),_0x43d0('0x173')));}if(_[_0x43d0('0x86')](_0x19ecb2[_0x43d0('0x174')])||_0x19ecb2[_0x43d0('0x174')]===null){return _0x3f5c77(msgResponse('originate','Failure',_0x43d0('0x175')));}var _0x1790c7={'XMD-CALLERID':_0x7e2cd1[_0x43d0('0x26')][_0x3a1109]['getCaller'](),'XMD-AGI':_0x218af9[_0x43d0('0x10c')]?util[_0x43d0('0x76')](_0x43d0('0x176'),ipAgi,_0x218af9[_0x43d0('0x10c')]):_0x43d0('0x177'),'XMD-AGIAFTER':_0x218af9[_0x43d0('0x111')]?util[_0x43d0('0x76')](_0x43d0('0x176'),ipAgi,_0x218af9[_0x43d0('0x111')]):_0x43d0('0x177'),'XMD-QUEUE':_0x218af9['type']===_0x43d0('0x4f')?util[_0x43d0('0x76')](_0x43d0('0x178'),_0x218af9[_0x43d0('0x3f')],_0x218af9['dialQueueOptions']||'',_0x218af9['dialAgiAfterHangupAgent']?'c':'',_0x218af9[_0x43d0('0x11a')]||0x3):_0x43d0('0x177'),'XMD-CONTACTID':_0x19ecb2[_0x43d0('0xd7')],'XMD-CDRTYPE':_0x43d0('0x9'),'CALLERID(all)':_0x7e2cd1['actions'][_0x3a1109]['getCaller'](),'XMD-AMD':_0x218af9['dialAMDActive']?_0x43d0('0x179'):_0x43d0('0x177'),'XMD-DESTINATION':_0x43d0('0x17a')};if(_0x218af9['dialAMDActive']){_0x1790c7['XMD-AMDINITIALSILENCE']=_0x218af9['dialAMDInitialSilence']||0x9c4;_0x1790c7[_0x43d0('0x17b')]=_0x218af9['dialAMDGreeting']||0x5dc;_0x1790c7['XMD-AMDAFTERGREETINGSILENCE']=_0x218af9[_0x43d0('0x17c')]||0x320;_0x1790c7[_0x43d0('0x17d')]=_0x218af9[_0x43d0('0x17e')]||0x1388;_0x1790c7[_0x43d0('0x17f')]=_0x218af9[_0x43d0('0x180')]||0x64;_0x1790c7[_0x43d0('0x181')]=_0x218af9[_0x43d0('0x182')]||0x32;_0x1790c7[_0x43d0('0x183')]=_0x218af9[_0x43d0('0x184')]||0x3;_0x1790c7[_0x43d0('0x185')]=_0x218af9[_0x43d0('0x186')]||0x100;_0x1790c7['XMD-AMDMAXIMUMWORDLENGTH']=_0x218af9[_0x43d0('0x187')]||0x1388;}if(_0x218af9[_0x43d0('0x4e')]==='outbound'){_0x1790c7[_0x43d0('0x188')]=_0x19ecb2[_0x43d0('0xda')];}else{_0x1790c7[_0x43d0('0x189')]=_0x19ecb2[_0x43d0('0xdb')];}for(var _0x3a8d5f in _0x19ecb2[_0x43d0('0x18a')]){if(typeof _0x19ecb2[_0x43d0('0x18a')][_0x3a8d5f]!==_0x43d0('0xad')){if(isNotNull(_0x19ecb2['Contact'][_0x3a8d5f])&&_0x3a8d5f!=='id'&&_0x3a8d5f!==_0x43d0('0x18b')&&_0x3a8d5f!==_0x43d0('0x18c')&&_0x3a8d5f!==_0x43d0('0x18d')){_0x1790c7[util[_0x43d0('0x76')]('%s%s','XMD-',_[_0x43d0('0x18e')](_0x3a8d5f))]=_0x19ecb2[_0x43d0('0x18a')][_0x3a8d5f];}}}var _0x11affc=_0x7e2cd1[_0x43d0('0xdf')](_0x218af9[_0x43d0('0x74')])?getCallerId(_0x218af9[_0x43d0('0x74')][_0x43d0('0x18f')],_0x218af9[_0x43d0('0x190')],_0x218af9[_0x43d0('0x191')]>0x0?getCallerIdRandom(_0x218af9['dialOriginateCallerIdNumber'],_0x218af9[_0x43d0('0x191')]):_0x218af9['dialOriginateCallerIdNumber']):getCallerId(_['isNil'](_0x218af9['TrunkBackup'])?_0x218af9[_0x43d0('0x74')][_0x43d0('0x18f')]:_0x218af9[_0x43d0('0x145')][_0x43d0('0x18f')],_0x218af9['dialOriginateCallerIdName'],_0x218af9['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x218af9[_0x43d0('0x5b')],_0x218af9[_0x43d0('0x191')]):_0x218af9[_0x43d0('0x5b')]);if(_0x11affc){_0x1790c7['XMD-ORIGINATECALLERIDNAME']=_0x7e2cd1[_0x43d0('0x26')][_0x3a1109][_0x43d0('0x192')]=extractCalleridName(_0x11affc);_0x1790c7[_0x43d0('0x193')]=_0x19ecb2[_0x43d0('0x174')];}return ami[_0x43d0('0x158')]({'actionid':_0x3a1109,'action':'originate','channel':_0x7e2cd1['isTrunkReachable'](_0x218af9[_0x43d0('0x74')])?util[_0x43d0('0x76')](_0x43d0('0x194'),_0x218af9[_0x43d0('0x74')]['name'],isNotNull(_0x218af9[_0x43d0('0x5d')])?_0x218af9[_0x43d0('0x5d')][_0x43d0('0x195')]()||'':'',_0x218af9[_0x43d0('0x196')]>0x0?_0x19ecb2[_0x43d0('0x174')][_0x43d0('0x197')](_0x218af9[_0x43d0('0x196')]):_0x19ecb2[_0x43d0('0x174')]):util[_0x43d0('0x76')]('SIP/%s/%s%s',_[_0x43d0('0xae')](_0x218af9['TrunkBackup'])?_0x218af9[_0x43d0('0x74')][_0x43d0('0x3f')]:_0x218af9[_0x43d0('0x145')]['name'],isNotNull(_0x218af9['dialPrefix'])?_0x218af9[_0x43d0('0x5d')][_0x43d0('0x195')]()||'':'',_0x218af9[_0x43d0('0x196')]>0x0?_0x19ecb2['phone'][_0x43d0('0x197')](_0x218af9[_0x43d0('0x196')]):_0x19ecb2[_0x43d0('0x174')]),'callerid':_0x11affc,'Exten':'xcally-motion-dialer','Context':_0x43d0('0x198'),'Priority':'1','variable':_0x1790c7,'timeout':(_0x218af9['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x3a1109})[_0x43d0('0xb8')](function(_0x41d17b){return _0x387f82(_0x41d17b);})[_0x43d0('0xb0')](function(_0x3544fc){_0x218af9['outboundOriginateFailureCallsDay']+=0x1;var _0x1576aa=new History(_0x7e2cd1[_0x43d0('0x26')][_0x3a1109]);logger[_0x43d0('0x97')](util[_0x43d0('0x76')](_0x43d0('0x199'),JSON[_0x43d0('0x49')](_0x3544fc)));_0x1576aa[_0x43d0('0xa6')]=0xe;_0x1576aa[_0x43d0('0xf3')]='OriginateError';_0x1576aa[_0x43d0('0xa8')]=moment()[_0x43d0('0x76')](_0x43d0('0x104'));_0x1576aa[_0x43d0('0xa7')]=_0x1576aa[_0x43d0('0xa8')];_0x7e2cd1['createHistory'](_0x1576aa)[_0x43d0('0xb0')](loggerCatch('[originate][error]'));_0x7e2cd1[_0x43d0('0xcc')](_0x1576aa)[_0x43d0('0xb0')](loggerCatch(_0x43d0('0x19a')))[_0x43d0('0x139')](function(){delete _0x7e2cd1[_0x43d0('0x26')][_0x3a1109];return _0x3f5c77(msgResponse(_0x43d0('0x172'),_0x43d0('0x48'),'originate\x20action\x20Error'));});});});};Dialer['prototype'][_0x43d0('0x19b')]=function(_0x59e19b){var _0x149e1c=this[_0x43d0('0x26')][_0x59e19b[_0x43d0('0x12e')]];if(_0x149e1c){delete this[_0x43d0('0x26')][_0x59e19b[_0x43d0('0x12e')]];_0x149e1c[_0x43d0('0x119')]=moment()['format'](_0x43d0('0x104'));var _0x41a193=_0x149e1c[_0x43d0('0x4e')]===_0x43d0('0x79')?this[_0x43d0('0x21')][_0x149e1c[_0x43d0('0xb3')]]:this[_0x43d0('0x20')][_0x149e1c[_0x43d0('0x19c')]()];if(!this['isSuccess'](_0x59e19b[_0x43d0('0x19d')])){this[_0x43d0('0xb2')](_0x41a193);return this['callProgressDetecting'](_0x149e1c,_0x41a193,_0x59e19b)[_0x43d0('0xb0')](loggerCatch(_0x43d0('0x19e')));}this[_0x43d0('0x28')][_0x59e19b['uniqueid']]=_0x149e1c;}};Dialer['prototype'][_0x43d0('0x19f')]=function(_0x54bc4b,_0x1d26d7,_0x26b9fd){var _0x25a6f9=new History(_0x1d26d7);if(_0x25a6f9[_0x43d0('0x107')]+_0x25a6f9[_0x43d0('0xf7')]+_0x25a6f9[_0x43d0('0xf8')]+_0x25a6f9[_0x43d0('0x1a0')]+_0x25a6f9[_0x43d0('0xf9')]+_0x25a6f9[_0x43d0('0xfa')]+_0x25a6f9['countmachineretry']+_0x25a6f9['countagentrejectretry']>=_0x26b9fd[_0x43d0('0x108')]-0x1){return!![];}switch(_0x54bc4b){case 0x3:if(_0x25a6f9['countnoanswerretry']>=_0x26b9fd[_0x43d0('0x1a1')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x25a6f9[_0x43d0('0xf8')]+=0x1,'scheduledat':moment()['add'](_0x26b9fd[_0x43d0('0x1a2')],_0x43d0('0x103'))[_0x43d0('0x76')](_0x43d0('0x104')),'ContactId':_0x25a6f9[_0x43d0('0xd7')],'ListId':_0x25a6f9[_0x43d0('0xd8')],'VoiceQueueId':_0x25a6f9[_0x43d0('0xda')]||undefined,'CampaignId':_0x25a6f9[_0x43d0('0xdb')]||undefined})[_0x43d0('0xb0')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x25a6f9[_0x43d0('0x107')]>=_0x26b9fd[_0x43d0('0x1a3')]-0x1){return!![];}this[_0x43d0('0xc3')]({'active':![],'countbusyretry':_0x25a6f9[_0x43d0('0x107')]+=0x1,'scheduledat':moment()[_0x43d0('0x101')](_0x26b9fd['dialBusyRetryFrequency'],_0x43d0('0x103'))[_0x43d0('0x76')](_0x43d0('0x104')),'ContactId':_0x25a6f9[_0x43d0('0xd7')],'ListId':_0x25a6f9[_0x43d0('0xd8')],'VoiceQueueId':_0x25a6f9[_0x43d0('0xda')]||undefined,'CampaignId':_0x25a6f9['CampaignId']||undefined})[_0x43d0('0xb0')](loggerCatch(_0x43d0('0x1a4')));break;case 0x8:if(_0x25a6f9['countcongestionretry']>=_0x26b9fd['dialCongestionMaxRetry']-0x1){return!![];}this[_0x43d0('0xc3')]({'active':![],'countcongestionretry':_0x25a6f9[_0x43d0('0xf7')]+=0x1,'scheduledat':moment()[_0x43d0('0x101')](_0x26b9fd[_0x43d0('0x1a5')],_0x43d0('0x103'))[_0x43d0('0x76')](_0x43d0('0x104')),'ContactId':_0x25a6f9[_0x43d0('0xd7')],'ListId':_0x25a6f9[_0x43d0('0xd8')],'VoiceQueueId':_0x25a6f9[_0x43d0('0xda')]||undefined,'CampaignId':_0x25a6f9['CampaignId']||undefined})[_0x43d0('0xb0')](loggerCatch(_0x43d0('0x1a6')));break;case 0x0:if(_0x25a6f9[_0x43d0('0x1a0')]>=_0x26b9fd[_0x43d0('0x1a7')]-0x1){return!![];}else{this[_0x43d0('0xc3')]({'active':![],'countnosuchnumberretry':_0x25a6f9['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0x43d0('0x101')](_0x26b9fd['dialNoSuchNumberRetryFrequency'],_0x43d0('0x103'))[_0x43d0('0x76')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x25a6f9[_0x43d0('0xd7')],'ListId':_0x25a6f9[_0x43d0('0xd8')],'VoiceQueueId':_0x25a6f9[_0x43d0('0xda')]||undefined,'CampaignId':_0x25a6f9[_0x43d0('0xdb')]||undefined})[_0x43d0('0xb0')](loggerCatch(_0x43d0('0x1a8')));}break;case 0xa:if(_0x25a6f9[_0x43d0('0xf9')]>=_0x26b9fd[_0x43d0('0x1a9')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x25a6f9[_0x43d0('0xf9')]+=0x1,'scheduledat':moment()['add'](_0x26b9fd[_0x43d0('0x11e')],_0x43d0('0x103'))[_0x43d0('0x76')](_0x43d0('0x104')),'ContactId':_0x25a6f9[_0x43d0('0xd7')],'ListId':_0x25a6f9[_0x43d0('0xd8')],'VoiceQueueId':_0x25a6f9[_0x43d0('0xda')]||undefined,'CampaignId':_0x25a6f9[_0x43d0('0xdb')]||undefined})[_0x43d0('0xb0')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x25a6f9[_0x43d0('0xfa')]>=_0x26b9fd[_0x43d0('0x129')]-0x1){return!![];}this[_0x43d0('0xc3')]({'active':![],'countabandonedretry':_0x25a6f9[_0x43d0('0xfa')]+=0x1,'scheduledat':moment()[_0x43d0('0x101')](_0x26b9fd[_0x43d0('0x127')],_0x43d0('0x103'))['format'](_0x43d0('0x104')),'ContactId':_0x25a6f9['ContactId'],'ListId':_0x25a6f9[_0x43d0('0xd8')],'VoiceQueueId':_0x25a6f9[_0x43d0('0xda')]||undefined,'CampaignId':_0x25a6f9['CampaignId']||undefined})['catch'](loggerCatch(_0x43d0('0x1aa')));break;case 0x13:if(_0x25a6f9['countmachineretry']>=_0x26b9fd['dialMachineMaxRetry']-0x1){return!![];}this[_0x43d0('0xc3')]({'active':![],'countmachineretry':_0x25a6f9[_0x43d0('0xf5')]+=0x1,'scheduledat':moment()[_0x43d0('0x101')](_0x26b9fd[_0x43d0('0x102')],_0x43d0('0x103'))[_0x43d0('0x76')](_0x43d0('0x104')),'ContactId':_0x25a6f9[_0x43d0('0xd7')],'ListId':_0x25a6f9[_0x43d0('0xd8')],'VoiceQueueId':_0x25a6f9[_0x43d0('0xda')]||undefined,'CampaignId':_0x25a6f9[_0x43d0('0xdb')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x25a6f9['countagentrejectretry']>=_0x26b9fd[_0x43d0('0x1ab')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x25a6f9[_0x43d0('0xfb')]+=0x1,'scheduledat':moment()[_0x43d0('0x101')](_0x26b9fd[_0x43d0('0x1ac')],'minutes')[_0x43d0('0x76')](_0x43d0('0x104')),'ContactId':_0x25a6f9[_0x43d0('0xd7')],'ListId':_0x25a6f9[_0x43d0('0xd8')],'VoiceQueueId':_0x25a6f9[_0x43d0('0xda')]||undefined,'CampaignId':_0x25a6f9[_0x43d0('0xdb')]||undefined})[_0x43d0('0xb0')](loggerCatch(_0x43d0('0x1ad')));break;default:return!![];}};Dialer['prototype'][_0x43d0('0x1ae')]=function(_0x1cdcef,_0x4888c9,_0x3fc3d4){var _0x5fbfac=this;var _0x144e71=new History(_0x1cdcef);var _0x39ad9f=![];var _0x15e3a8;var _0x1866f1;return new BPromise(function(_0x4ddaf1,_0x3335ff){if(_['isUndefined'](_0x4888c9)&&typeof _0x4888c9!==_0x43d0('0x1af')){return _0x3335ff(msgResponse('[callProgressDetecting]','Failure','entity\x20is\x20undefine'));}if(_[_0x43d0('0x86')](_0x3fc3d4)&&typeof _0x3fc3d4!==_0x43d0('0x1af')){return _0x3335ff(msgResponse(_0x43d0('0x1b0'),_0x43d0('0x14d'),'evt\x20is\x20undefine'));}_0x5fbfac[_0x43d0('0xbc')](_0x144e71,_0x3fc3d4['reason'],_0x4888c9)[_0x43d0('0xb8')](function(_0x51d15d){if(_0x51d15d[_0x43d0('0x120')]==0x1)_0x39ad9f=!![];switch(_0x3fc3d4[_0x43d0('0x10f')]){case'0':_0x4888c9[_0x43d0('0x62')]+=0x1;_0x144e71['state']=0x0;_0x144e71[_0x43d0('0xf3')]='NoSuchNumber';_0x144e71[_0x43d0('0x1a0')]+=0x1;_0x144e71[_0x43d0('0x11d')]+=0x1;ami[_0x43d0('0x4d')](_0x43d0('0x1b1'),ut['buildObj'](_0x1cdcef,'nosuchnumber'));_0x15e3a8=_0x4888c9['dialNoSuchNumberRetryFrequency'];_0x1866f1=_0x4888c9['callAdditionalPhoneAfterMin'];_0x5fbfac[_0x43d0('0xce')](_0x144e71)[_0x43d0('0xb0')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x5fbfac[_0x43d0('0x19f')](0x0,_0x1cdcef,_0x4888c9)&&!_0x39ad9f){if(_0x144e71['countnosuchnumberretry']>=_0x4888c9[_0x43d0('0x1a7')]){_0x5fbfac['createStateFinal'](_0x144e71,_0x4ddaf1,_0x3335ff,_0x43d0('0x1b2'));}else{_0x5fbfac[_0x43d0('0xfc')](_0x144e71,_0x4ddaf1,_0x3335ff,_0x43d0('0x1b2'));}}break;case'3':_0x4888c9['outboundNoAnswerCallsDay']+=0x1;_0x144e71[_0x43d0('0xa6')]=0x3;_0x144e71['statedesc']=_0x43d0('0x1b3');_0x144e71[_0x43d0('0xf8')]+=0x1;_0x144e71['countglobal']+=0x1;ami[_0x43d0('0x4d')](_0x43d0('0x1b4'),ut['buildObj'](_0x1cdcef,_0x43d0('0x1b5')));_0x15e3a8=_0x4888c9[_0x43d0('0x1a2')];_0x1866f1=_0x4888c9[_0x43d0('0x11f')];_0x5fbfac[_0x43d0('0xce')](_0x144e71)[_0x43d0('0xb0')](loggerCatch(_0x43d0('0x1b6')));if(_0x5fbfac[_0x43d0('0x19f')](0x3,_0x1cdcef,_0x4888c9)&&!_0x39ad9f){if(_0x144e71[_0x43d0('0xf8')]>=_0x4888c9[_0x43d0('0x1a1')]){_0x5fbfac[_0x43d0('0xff')](_0x144e71,_0x4ddaf1,_0x3335ff,_0x43d0('0x1b7'));}else{_0x5fbfac[_0x43d0('0xfc')](_0x144e71,_0x4ddaf1,_0x3335ff,_0x43d0('0x1b7'));}}break;case'5':_0x4888c9[_0x43d0('0x5f')]+=0x1;_0x144e71[_0x43d0('0xa6')]=0x5;_0x144e71[_0x43d0('0xf3')]='Busy';_0x144e71['countbusyretry']+=0x1;_0x144e71['countglobal']+=0x1;ami[_0x43d0('0x4d')](_0x43d0('0x1b8'),ut[_0x43d0('0xee')](_0x1cdcef,_0x43d0('0x1b9')));_0x15e3a8=_0x4888c9[_0x43d0('0x1ba')];_0x1866f1=_0x4888c9[_0x43d0('0x11f')];_0x5fbfac[_0x43d0('0xce')](_0x144e71)[_0x43d0('0xb0')](loggerCatch(_0x43d0('0x1bb')));if(_0x5fbfac['checkRetriveMax'](0x5,_0x1cdcef,_0x4888c9)&&!_0x39ad9f){if(_0x144e71[_0x43d0('0x107')]>=_0x4888c9[_0x43d0('0x1a3')]){_0x5fbfac[_0x43d0('0xff')](_0x144e71,_0x4ddaf1,_0x3335ff,_0x43d0('0x1bc'));}else{_0x5fbfac[_0x43d0('0xfc')](_0x144e71,_0x4ddaf1,_0x3335ff,_0x43d0('0x1bc'));}}break;case'8':_0x4888c9['outboundCongestionCallsDay']+=0x1;_0x144e71[_0x43d0('0xa6')]=0x8;_0x144e71[_0x43d0('0xf3')]=_0x43d0('0x1bd');_0x144e71[_0x43d0('0xf7')]+=0x1;_0x144e71['countglobal']+=0x1;_0x15e3a8=_0x4888c9['dialCongestionRetryFrequency'];_0x1866f1=_0x4888c9[_0x43d0('0x11f')];ami[_0x43d0('0x4d')](_0x43d0('0x1be'),ut[_0x43d0('0xee')](_0x1cdcef,'congestion'));_0x5fbfac['createHistory'](_0x144e71)[_0x43d0('0xb0')](loggerCatch(_0x43d0('0x1bf')));if(_0x5fbfac[_0x43d0('0x19f')](0x8,_0x1cdcef,_0x4888c9)&&!_0x39ad9f){if(_0x144e71[_0x43d0('0xf7')]>=_0x4888c9[_0x43d0('0x1c0')]){_0x5fbfac[_0x43d0('0xff')](_0x144e71,_0x4ddaf1,_0x3335ff,_0x43d0('0x1c1'));}else{_0x5fbfac[_0x43d0('0xfc')](_0x144e71,_0x4ddaf1,_0x3335ff,_0x43d0('0x1c1'));}}break;case'11':_0x4888c9[_0x43d0('0x1c2')]+=0x1;_0x144e71['state']=0xb;_0x144e71[_0x43d0('0xf3')]='Abandoned';_0x144e71[_0x43d0('0xfa')]+=0x1;_0x144e71[_0x43d0('0x11d')]+=0x1;_0x15e3a8=_0x4888c9[_0x43d0('0x127')];_0x1866f1=_0x4888c9[_0x43d0('0x11f')];_0x5fbfac[_0x43d0('0xce')](_0x144e71)['catch'](loggerCatch(_0x43d0('0x12b')));if(_0x5fbfac[_0x43d0('0x19f')](0xb,_0x1cdcef,_0x4888c9)&&!_0x39ad9f){if(_0x144e71[_0x43d0('0xfa')]>=_0x4888c9[_0x43d0('0x129')]){_0x5fbfac[_0x43d0('0xff')](_0x144e71,_0x4ddaf1,_0x3335ff,_0x43d0('0x1c3'));}else{_0x5fbfac[_0x43d0('0xfc')](_0x144e71,_0x4ddaf1,_0x3335ff,_0x43d0('0x1c3'));}}break;case'20':_0x4888c9[_0x43d0('0x65')]+=0x1;_0x144e71[_0x43d0('0xa6')]=0x14;_0x144e71[_0x43d0('0xf3')]='AgentReject';_0x144e71['countagentrejectretry']+=0x1;_0x144e71[_0x43d0('0x11d')]+=0x1;_0x15e3a8=_0x4888c9['dialAgentRejectRetryFrequency'];_0x1866f1=_0x4888c9['callAdditionalPhoneAfterMin'];ami[_0x43d0('0x4d')](_0x43d0('0x1c4'),ut['buildObj'](_0x1cdcef,_0x43d0('0x1c5')));_0x5fbfac[_0x43d0('0xce')](_0x144e71)[_0x43d0('0xb0')](loggerCatch(_0x43d0('0x1c6')));if(_0x5fbfac['checkRetriveMax'](0x14,_0x1cdcef,_0x4888c9)&&!_0x39ad9f){if(_0x144e71[_0x43d0('0xfb')]>=_0x4888c9[_0x43d0('0x1ab')]){_0x5fbfac[_0x43d0('0xff')](_0x144e71,_0x4ddaf1,_0x3335ff,'reason\x2020\x20agentreject');}else{_0x5fbfac[_0x43d0('0xfc')](_0x144e71,_0x4ddaf1,_0x3335ff,'reason\x2020\x20agentreject');}}break;default:_0x4888c9['outboundUnknownCallsDay']+=0x1;_0x144e71[_0x43d0('0xa6')]=0xc;_0x144e71[_0x43d0('0xf3')]=_0x3fc3d4[_0x43d0('0x10f')];_0x15e3a8=_0x4888c9[_0x43d0('0x1ac')];_0x1866f1=_0x4888c9['callAdditionalPhoneAfterMin'];_0x5fbfac[_0x43d0('0xce')](_0x144e71)['catch'](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x5fbfac[_0x43d0('0x19f')](_0x3fc3d4[_0x43d0('0x10f')],_0x1cdcef,_0x4888c9)&&!_0x39ad9f){if(_0x144e71[_0x43d0('0x107')]+_0x144e71[_0x43d0('0xf7')]+_0x144e71['countnoanswerretry']+_0x144e71['countnosuchnumberretry']+_0x144e71[_0x43d0('0xf9')]+_0x144e71[_0x43d0('0xfa')]+_0x144e71[_0x43d0('0xf5')]+_0x144e71[_0x43d0('0xfb')]>=_0x4888c9[_0x43d0('0x108')]){_0x5fbfac[_0x43d0('0xfc')](_0x144e71,_0x4ddaf1,_0x3335ff,_0x3fc3d4[_0x43d0('0x10f')]);}else{_0x5fbfac[_0x43d0('0xff')](_0x144e71,_0x4ddaf1,_0x3335ff,_0x3fc3d4[_0x43d0('0x10f')]);}}}})[_0x43d0('0xb8')](function(_0x40a301){if(_0x39ad9f){_0x5fbfac[_0x43d0('0x125')](_0x144e71,_0x15e3a8,_0x1866f1)['then'](function(_0x1fd1e6){return _0x4ddaf1(0x1);});}});});};Dialer[_0x43d0('0x1c')]['stateGlobal']=function(_0x452afc,_0x21fe43,_0x317a97,_0x3ff321){var _0x9b75e6=new Final(_0x452afc);_0x9b75e6[_0x43d0('0xa6')]=0xf;_0x9b75e6['statedesc']=_0x43d0('0x1c7');this[_0x43d0('0xff')](_0x9b75e6,_0x21fe43,_0x317a97,_0x3ff321);};Dialer['prototype'][_0x43d0('0xff')]=function(_0x381069,_0x494444,_0x57eeb8,_0x537005){this[_0x43d0('0xcc')](_0x381069)['then'](function(){return _0x494444(msgResponse(_0x43d0('0x1b0'),_0x43d0('0xde'),_0x537005));})[_0x43d0('0xb0')](function(){return _0x57eeb8(msgResponse(_0x43d0('0x1c8'),_0x43d0('0x14d'),'contact\x20not\x20moved'));});};Dialer[_0x43d0('0x1c')][_0x43d0('0x164')]=function(_0x502a9b){var _0x4d8f03=_0x502a9b[_0x43d0('0x1c9')]/0x64;var _0x28084a=_0x502a9b[_0x43d0('0x61')]/(_0x502a9b[_0x43d0('0x61')]+_0x502a9b['outboundAnswerCallsDay']);var _0x460f70=Math['round'](_0x502a9b['predictiveIntervalAvailable']*(_0x502a9b[_0x43d0('0x1ca')]/0x64));var _0x4ecfbe=Math[_0x43d0('0x1cb')](_0x502a9b[_0x43d0('0x6f')]*(_0x502a9b[_0x43d0('0x1cc')]/0x64));var _0x5436a4=_0x502a9b['available']+_0x502a9b['talking'];var _0x5a6ab7=Math[_0x43d0('0x1cd')](_0x502a9b[_0x43d0('0x8b')]*_0x502a9b[_0x43d0('0x72')]*_0x502a9b[_0x43d0('0x6c')]*_0x502a9b[_0x43d0('0x6d')]);if(_[_0x43d0('0x86')](_0x502a9b[_0x43d0('0x2b')])){if(!_[_0x43d0('0x86')](_0x502a9b[_0x43d0('0x2a')])){_0x502a9b[_0x43d0('0x2a')]=undefined;loggerPredictive['error'](_0x43d0('0x1ce'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x43d0('0x86')](_0x502a9b[_0x43d0('0x90')])){loggerPredictive['error'](_0x43d0('0x1ce'),_0x43d0('0x1cf'));clearInterval(_0x502a9b[_0x43d0('0x90')]);_0x502a9b['handlePredictive']=undefined;}_0x502a9b[_0x43d0('0x2b')]=moment()['format'](_0x43d0('0x104'));loggerPredictive[_0x43d0('0x7c')](_0x502a9b[_0x43d0('0x3f')],_0x43d0('0x1d0'),_0x502a9b[_0x43d0('0x2b')]);this[_0x43d0('0x161')](_0x502a9b,0x1);}else if(ifInterval(_0x502a9b['dialPredictiveInterval'],_0x502a9b['startProgressive'])){this['handlePower'](_0x502a9b,0x1);loggerPredictiveCalls[_0x43d0('0x7c')](_0x43d0('0x1d1'),_0x502a9b['startProgressive'],_0x502a9b[_0x43d0('0x3f')]);_0x502a9b['erlangCalls']=0x0;_0x502a9b[_0x43d0('0x6b')]=0x0;}else if(_0x4d8f03<_0x28084a&&_0x502a9b['dialPredictiveOptimization']==='dropRate'){freeVariablesPredictive(_0x502a9b);loggerPredictive[_0x43d0('0x7c')](_0x43d0('0x1d2'),'Dropped\x20calls\x20day',_0x28084a,'startProgressive',_0x502a9b[_0x43d0('0x3f')]);}else if(_0x5a6ab7<_0x502a9b[_0x43d0('0x6b')]&&_0x502a9b[_0x43d0('0x1d3')]===_0x43d0('0x1d4')){freeVariablesPredictive(_0x502a9b);loggerPredictive[_0x43d0('0x7c')](_0x43d0('0x1d5'),_0x43d0('0x1d6'),_0x5a6ab7,_0x43d0('0x1d7'),_0x502a9b['predictiveIntervalErlangCallsDroppedCalls'],'startProgressive',_0x502a9b[_0x43d0('0x3f')]);}else if(!ifInterval(_0x502a9b[_0x43d0('0x1d8')],_0x502a9b['startProgressive'])&&_[_0x43d0('0x86')](_0x502a9b[_0x43d0('0x2a')])&&!_['isUndefined'](_0x502a9b['startProgressive'])){_0x502a9b['startPredictive']=moment()['format'](_0x43d0('0x104'));loggerPredictive['info'](_0x502a9b[_0x43d0('0x3f')],'started\x20in\x20predictive\x20at',_0x502a9b[_0x43d0('0x2a')]);this['averageHandleTime'](_0x502a9b[_0x43d0('0x1d8')])[_0x43d0('0xb8')](this[_0x43d0('0x1d9')](_0x502a9b))['then'](mergeDataErlangB(_0x502a9b))['then'](this[_0x43d0('0x1da')](_0x502a9b))[_0x43d0('0xb0')](loggerCatchPredictive(_0x43d0('0x1db'),_0x502a9b));}else if(!ifInterval(_0x502a9b[_0x43d0('0x1d8')],_0x502a9b[_0x43d0('0x2a')])){_0x502a9b[_0x43d0('0x6b')]=0x0;_0x502a9b[_0x43d0('0x2a')]=moment()[_0x43d0('0x76')](_0x43d0('0x104'));loggerPredictive[_0x43d0('0x7c')](_0x502a9b[_0x43d0('0x3f')],_0x43d0('0x1dc'),_0x502a9b[_0x43d0('0x2a')]);clearInterval(_0x502a9b[_0x43d0('0x90')]);_0x502a9b[_0x43d0('0x90')]=undefined;this[_0x43d0('0xc0')](_0x502a9b[_0x43d0('0x1d8')])['then'](this['getDataPredictive'](_0x502a9b))[_0x43d0('0xb8')](mergeDataErlangB(_0x502a9b))[_0x43d0('0xb8')](this[_0x43d0('0x1da')](_0x502a9b))[_0x43d0('0xb0')](loggerCatchPredictive(_0x43d0('0x1dd'),_0x502a9b));}else if(_0x502a9b[_0x43d0('0x6f')]&&_0x5436a4<_0x502a9b[_0x43d0('0x6f')]-_0x4ecfbe){freeVariablesPredictive(_0x502a9b);loggerPredictive[_0x43d0('0x7c')](_0x502a9b[_0x43d0('0x3f')],_0x43d0('0x1de'),_0x5436a4,_0x43d0('0x1df'),_0x502a9b[_0x43d0('0x6f')],'-',_0x4ecfbe,'=',_0x502a9b[_0x43d0('0x6f')]-_0x4ecfbe,')');}else if(_0x502a9b[_0x43d0('0x6f')]&&_0x5436a4>_0x502a9b['predictiveIntervalAvailable']+_0x460f70){freeVariablesPredictive(_0x502a9b);loggerPredictive[_0x43d0('0x7c')](_0x502a9b[_0x43d0('0x3f')],_0x43d0('0x1de'),_0x5436a4,')\x20are\x20more\x20than\x20threshold\x20(',_0x502a9b[_0x43d0('0x6f')],'+',_0x460f70,'=',_0x502a9b[_0x43d0('0x6f')]+_0x460f70,')');}};Dialer[_0x43d0('0x1c')][_0x43d0('0x1d9')]=function(_0x4d25c4){var _0xdc4c16=this;return function(_0x165e94){return new BPromise(function(_0x5b5201,_0x3b5c1d){_[_0x43d0('0xd5')](_0x4d25c4,_0x165e94[0x0]);if(checkGetDataPredictive(_0x165e94[0x0])){var _0x2b28b7=_0x4d25c4[_0x43d0('0x6f')]=_0x4d25c4[_0x43d0('0x9f')]+_0x4d25c4['available'];var _0x399215=_0x4d25c4[_0x43d0('0x1d8')]*0x3c;var _0x42e601=_0x165e94[0x0]['predictiveIntervalAvgTalktime']+_0x165e94[0x0][_0x43d0('0x67')];var _0x2ce718=(_0x165e94[0x0]['predictiveIntervalAnsweredCalls']+_0x165e94[0x0][_0x43d0('0x6a')]+_0x165e94[0x0][_0x43d0('0x69')])/_0x165e94[0x0][_0x43d0('0x7f')];_0x4d25c4[_0x43d0('0x6c')]=_0x2ce718>0x0?_0x2ce718:0x1;switch(_0x4d25c4[_0x43d0('0x1d3')]){case'dropRate':var _0xf23217=_0x4d25c4['dialPredictiveOptimizationPercentage']/0x64;return _0xdc4c16[_0x43d0('0x1e0')](_0x2b28b7,_0x399215,_0x42e601,_0x2ce718,_0xf23217)[_0x43d0('0xb8')](function(_0x28a8ce){return _0x5b5201(_0x28a8ce);});case _0x43d0('0x1e1'):var _0x386dfb=_0x4d25c4['dialPredictiveOptimizationPercentage']/0x64;return _0xdc4c16[_0x43d0('0x1e2')](_0x2b28b7,_0x399215,_0x42e601,_0x2ce718,_0x386dfb)[_0x43d0('0xb8')](function(_0x2d63f3){return _0x5b5201(_0x2d63f3);});default:return _0x3b5c1d(msgResponse(_0x43d0('0x1e3'),_0x43d0('0x14d'),'Unknown\x20Predictive'));}}else{return _0x3b5c1d(msgResponse(_0x43d0('0x1e3'),_0x43d0('0x14d'),_0x43d0('0x1e4')));}});};};Dialer[_0x43d0('0x1c')][_0x43d0('0x1e5')]=function(_0x559de3){var _0x30dc88=this;return function(_0x32c93e){return new BPromise(function(_0x2eb1e1,_0x4089d1){_['merge'](_0x559de3,_0x32c93e[0x0]);if(checkGetDataPredictive(_0x32c93e[0x0])){loggerPredictive[_0x43d0('0x7c')](JSON[_0x43d0('0x49')](_0x32c93e[0x0]));if(_0x559de3[_0x43d0('0x1d3')]===_0x43d0('0x1d4')){return _0x30dc88[_0x43d0('0xcb')](_0x559de3['id'])[_0x43d0('0xb8')](function(_0x28ce1f){var _0x28cb71=_0x559de3[_0x43d0('0x53')]-_0x28ce1f[0x0][_0x43d0('0x1e6')];var _0x1b89b5=_0x559de3['dialPredictiveInterval']*0x3c;var _0x50d671=_0x32c93e[0x0][_0x43d0('0x68')]+_0x32c93e[0x0]['predictiveIntervalAvgHoldtime'];var _0x18d5e3=(_0x32c93e[0x0][_0x43d0('0x80')]+_0x32c93e[0x0][_0x43d0('0x6a')]+_0x32c93e[0x0][_0x43d0('0x69')])/_0x32c93e[0x0]['predictiveIntervalTotalCalls'];var _0x13f560=_0x559de3['dialPredictiveOptimizationPercentage']/0x64;_0x559de3[_0x43d0('0x6e')]=_0x28ce1f[0x0][_0x43d0('0x1e6')]||0x0;_0x559de3['predictiveIntervalHitRate']=_0x18d5e3>0x0?_0x18d5e3:0x1;return _0x30dc88[_0x43d0('0x1e0')](_0x28cb71,_0x1b89b5,_0x50d671,_0x18d5e3,_0x13f560);})[_0x43d0('0xb8')](function(_0x47821a){return _0x2eb1e1(_0x47821a);})[_0x43d0('0xb0')](function(_0x515705){return _0x4089d1(msgResponse(_0x43d0('0x1e7'),_0x43d0('0x14d'),JSON[_0x43d0('0x49')](_0x515705)));});}if(_0x559de3[_0x43d0('0x1d3')]===_0x43d0('0x1e1')){return _0x30dc88[_0x43d0('0xcb')](_0x559de3['id'])[_0x43d0('0xb8')](function(_0x67f21d){var _0x158351=_0x559de3['loggedIn']-_0x67f21d[0x0][_0x43d0('0x1e6')];var _0x431f33=_0x559de3[_0x43d0('0x1d8')]*0x3c;var _0x112a92=_0x32c93e[0x0][_0x43d0('0x68')]+_0x32c93e[0x0][_0x43d0('0x67')];var _0x15d9da=(_0x32c93e[0x0][_0x43d0('0x80')]+_0x32c93e[0x0][_0x43d0('0x6a')]+_0x32c93e[0x0][_0x43d0('0x69')])/_0x32c93e[0x0][_0x43d0('0x7f')];var _0x4b06de=_0x559de3['dialPredictiveOptimizationPercentage']/0x64;_0x559de3['predictiveIntervalPauses']=_0x67f21d[0x0][_0x43d0('0x1e6')]||0x0;_0x559de3[_0x43d0('0x6c')]=_0x15d9da>0x0?_0x15d9da:0x1;return _0x30dc88[_0x43d0('0x1e2')](_0x158351,_0x431f33,_0x112a92,_0x15d9da,_0x4b06de);})[_0x43d0('0xb8')](function(_0x25429f){return _0x2eb1e1(_0x25429f);})[_0x43d0('0xb0')](function(_0x571395){return _0x4089d1(msgResponse(_0x43d0('0x1e7'),'Failure',JSON[_0x43d0('0x49')](_0x571395)));});}}else{return _0x4089d1(msgResponse('[getDataPredictive]','Failure',_0x43d0('0x1e4')));}});};};Dialer[_0x43d0('0x1c')]['startMethodPredictive']=function(_0x5469a7){var _0x31d35c=this;return function(){var _0x179267=0x0;var _0x2f4245=Math[_0x43d0('0x1cd')](_0x5469a7[_0x43d0('0x71')]*0x3e8);if(_0x2f4245>0x0){_0x2f4245=_0x2f4245<0x64?0x64:_0x2f4245;loggerPredictive[_0x43d0('0x7c')](_0x5469a7[_0x43d0('0x3f')],_0x43d0('0x1e8'),_0x2f4245,_0x43d0('0x4a'));_0x5469a7[_0x43d0('0x90')]=setInterval(function(){_0x31d35c[_0x43d0('0x90')](_0x5469a7);loggerPredictiveCalls[_0x43d0('0x7c')](_0x43d0('0x1e9'),_0x179267+=0x1);},_0x2f4245);}else{loggerPredictive[_0x43d0('0x7c')](_0x5469a7[_0x43d0('0x3f')],_0x43d0('0x1ea'));}};};Dialer[_0x43d0('0x1c')]['checkContactBlack']=function(_0x4250ad,_0x25bdc0){var _0x1b763f=this;return function(_0x62554a){if(_[_0x43d0('0x94')](_0x62554a)){if(_[_0x43d0('0xae')](_0x25bdc0['UserId'])||!_0x25bdc0[_0x43d0('0x1eb')]){if(_0x4250ad[_0x43d0('0x5a')]===_0x43d0('0xa')){_0x4250ad[_0x43d0('0x135')]=_['isUndefined'](_0x4250ad['queueStatusComplete'])?!![]:_0x4250ad[_0x43d0('0x135')];var _0x532651=uuid['v4']();_0x1b763f['actions'][_0x532651]=new Action(_0x4250ad,_0x25bdc0,_0x532651);loggerBooked[_0x43d0('0x7c')]('[booked][checkContactBlack]',_0x532651,_0x43d0('0x1ec'),JSON[_0x43d0('0x49')](_0x4250ad[_0x43d0('0x135')]),_0x43d0('0x1ed'),_0x4250ad['name']);if(_0x4250ad[_0x43d0('0x135')]){_0x4250ad[_0x43d0('0x135')]=![];_0x1b763f[_0x43d0('0x2d')][_0x1b763f[_0x43d0('0x26')][_0x532651][_0x43d0('0xb3')]]=[];ami[_0x43d0('0x158')]({'actionid':_0x532651,'action':_0x43d0('0x1ee'),'queue':_0x4250ad['name']})[_0x43d0('0xb0')](function(){_0x1b763f[_0x43d0('0xb2')](_0x4250ad);_0x1b763f[_0x43d0('0xc3')]({'active':![],'ContactId':_0x1b763f[_0x43d0('0x26')][_0x532651][_0x43d0('0xd7')],'ListId':_0x1b763f[_0x43d0('0x26')][_0x532651][_0x43d0('0xd8')],'VoiceQueueId':_0x1b763f[_0x43d0('0x26')][_0x532651][_0x43d0('0xda')]||undefined,'CampaignId':_0x1b763f[_0x43d0('0x26')][_0x532651][_0x43d0('0xdb')]||undefined})[_0x43d0('0xb0')](loggerCatch(_0x43d0('0x1ef')));delete _0x1b763f[_0x43d0('0x26')][_0x532651];});}else{loggerBooked[_0x43d0('0x7c')](_0x43d0('0x1f0'),JSON[_0x43d0('0x49')](_0x4250ad[_0x43d0('0x135')]),_0x43d0('0x1ed'),_0x4250ad[_0x43d0('0x3f')]);_0x1b763f[_0x43d0('0xb2')](_0x4250ad);_0x1b763f[_0x43d0('0xc3')]({'active':![],'ContactId':_0x1b763f[_0x43d0('0x26')][_0x532651][_0x43d0('0xd7')],'ListId':_0x1b763f['actions'][_0x532651][_0x43d0('0xd8')],'VoiceQueueId':_0x1b763f[_0x43d0('0x26')][_0x532651][_0x43d0('0xda')]||undefined,'CampaignId':_0x1b763f['actions'][_0x532651][_0x43d0('0xdb')]||undefined})['catch'](loggerCatch(_0x43d0('0x1ef')));delete _0x1b763f[_0x43d0('0x26')][_0x532651];}}else{return _0x1b763f[_0x43d0('0x171')](_0x4250ad,_0x25bdc0);}}else{if(getDiff(_0x25bdc0[_0x43d0('0x1f1')])<_0x4250ad[_0x43d0('0x1f2')]*0x3c){if(_0x25bdc0[_0x43d0('0x1f3')]&&!_0x25bdc0[_0x43d0('0x1f3')][_0x43d0('0x1f4')]){_0x1b763f[_0x43d0('0x92')]['run'](_0x25bdc0['id'])[_0x43d0('0x139')](function(){_0x1b763f[_0x43d0('0xb2')](_0x4250ad);});}else{_0x1b763f[_0x43d0('0xc5')]({'active':![]},_0x25bdc0['id'],0x1)[_0x43d0('0x139')](function(){_0x1b763f['updateOriginated'](_0x4250ad);});}}else{_0x4250ad[_0x43d0('0x64')]+=0x1;_0x1b763f[_0x43d0('0xb2')](_0x4250ad);if(_0x4250ad['dialRecallInQueue']){_0x1b763f['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x25bdc0[_0x43d0('0xd7')],'ListId':_0x25bdc0[_0x43d0('0xd8')],'VoiceQueueId':_0x25bdc0['VoiceQueueId']||undefined,'CampaignId':_0x25bdc0[_0x43d0('0xdb')]||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x1b763f[_0x43d0('0xce')](createObjHistory(_0x4250ad,_0x25bdc0,_0x43d0('0x1f5'),0x17,'RecallInQueue'))['catch'](loggerCatch(_0x43d0('0x1f6')));}else{_0x1b763f[_0x43d0('0xd4')](createObjHistory(_0x4250ad,_0x25bdc0,'RECALLFAILEDTIMEOUT',0x16,_0x43d0('0x1f7')),_0x43d0('0x1f8'),_0x43d0('0x1f9'));}}}}else{_0x4250ad[_0x43d0('0x1fa')]+=0x1;_0x1b763f['saveInDb'](createObjHistory(_0x4250ad,_0x25bdc0,_0x43d0('0x1fb'),0xd,_0x43d0('0x1fc')),_0x43d0('0x1fd'),_0x43d0('0x1fe'));throw _0x43d0('0x1ff');}};};Dialer[_0x43d0('0x1c')][_0x43d0('0x166')]=function(_0x4d6b53){var _0x405cc6=this;var _0x4349dd=_0x4d6b53[_0x43d0('0x200')]-_0x4d6b53['originated']-_0x4d6b53[_0x43d0('0xc7')];emitCampaignSummary(_0x4d6b53);if(_0x4349dd>0x0){if(_0x4349dd>this[_0x43d0('0x24')]){_0x4349dd=this[_0x43d0('0x24')];}_0x4d6b53[_0x43d0('0xc7')]+=_0x4349dd;this[_0x43d0('0xc9')](_0x4d6b53['id'],_0x4349dd,_0x4d6b53[_0x43d0('0x201')],_0x4d6b53)['then'](function(_0x4fac17){_0x4d6b53[_0x43d0('0xc7')]-=_0x4349dd;_0x4d6b53['temp']=_0x4d6b53[_0x43d0('0xc7')]>0x0?_0x4d6b53[_0x43d0('0xc7')]:0x0;if(!checkContactEmpty(_0x4fac17)){_0x4d6b53[_0x43d0('0x3d')]=_0x43d0('0x9c');logger[_0x43d0('0x7c')](_0x43d0('0x202')+_0x4d6b53['name']);}else{_0x4d6b53[_0x43d0('0x70')]+=_0x4fac17['length'];_0x4d6b53[_0x43d0('0x3d')]='RUNNING';for(var _0x2f913e=0x0;_0x2f913e<_0x4fac17[_0x43d0('0x203')];_0x2f913e+=0x1){_0x4d6b53[_0x43d0('0x204')]+=0x1;if(_[_0x43d0('0xae')](_0x4fac17[_0x2f913e])||_[_0x43d0('0xae')](_0x4fac17[_0x2f913e]['Contact'])||_[_0x43d0('0xae')](_0x4fac17[_0x2f913e]['phone'])){_0x405cc6[_0x43d0('0xd3')]('[actionOriginate]\x20',_0x4d6b53,_0x4fac17[_0x2f913e]);}else{_0x405cc6[_0x43d0('0xbe')](_[_0x43d0('0xd6')](_0x4fac17[_0x2f913e],['CampaignId',_0x43d0('0x205')]))[_0x43d0('0xb8')](_0x405cc6[_0x43d0('0x206')](_0x4d6b53,_0x4fac17[_0x2f913e]))['catch'](_0x405cc6[_0x43d0('0xd2')](_0x43d0('0x207'),_0x4d6b53));}}}})[_0x43d0('0xb0')](loggerGetContactDialer(_0x43d0('0x208'),_0x4d6b53,_0x4349dd));}};Dialer['prototype'][_0x43d0('0x161')]=function(_0x58b989,_0x32ced4){var _0x1efa9e=this;var _0x57bd03=[];var _0x411933=_0x32ced4>=0x1?_0x32ced4:0x1;if(_0x58b989[_0x43d0('0x5a')]===_0x43d0('0xa')){_0x411933=0x1;}var _0x8b4147=Math[_0x43d0('0x1cd')](_0x58b989[_0x43d0('0x52')]*_0x411933)-_0x58b989[_0x43d0('0x70')]-_0x58b989[_0x43d0('0xc7')];emitVoiceQueueSummary(_0x58b989);if(_0x58b989[_0x43d0('0x209')]>0x0){var _0x2f45a5=_0x58b989[_0x43d0('0x209')]-_0x58b989['originated']-_0x58b989['talking']-_0x58b989[_0x43d0('0xc7')]-_0x58b989[_0x43d0('0x54')];if(_0x8b4147>_0x2f45a5){_0x8b4147=_0x2f45a5;}}if(_0x8b4147>0x0){if(_0x58b989['dialMethod']===_0x43d0('0xa')){_0x8b4147=0x1;}if(_0x8b4147>this[_0x43d0('0x24')]){_0x8b4147=this['maxNumberOriginate'];}_0x58b989[_0x43d0('0xc7')]+=_0x8b4147;for(var _0x3a27f3 in this[_0x43d0('0x22')]){if(typeof this[_0x43d0('0x22')][_0x3a27f3]!==_0x43d0('0xad')){if(this[_0x43d0('0x22')][_0x3a27f3][_0x43d0('0xa6')]===_0x43d0('0x20a')&&this[_0x43d0('0x22')][_0x3a27f3][_0x43d0('0xaf')]==='reachable'){_0x57bd03[_0x43d0('0x132')](this[_0x43d0('0x22')][_0x3a27f3]['id']);}}}this[_0x43d0('0xc6')](_0x58b989['id'],_0x57bd03,_0x8b4147,_0x58b989['dialOrderByScheduledAt'],_0x58b989)['then'](function(_0x3387e9){_0x58b989[_0x43d0('0xc7')]-=_0x8b4147;_0x58b989[_0x43d0('0xc7')]=_0x58b989[_0x43d0('0xc7')]>0x0?_0x58b989['temp']:0x0;if(!checkContactEmpty(_0x3387e9)){_0x1efa9e['countReScheduled'](_0x58b989)[_0x43d0('0xb8')](sendMessageReschedule(_0x58b989))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x58b989['originated']+=_0x3387e9['length'];_0x58b989[_0x43d0('0x3d')]=_0x58b989[_0x43d0('0x5a')]===_0x43d0('0xa')?_0x43d0('0x179'):_0x43d0('0x20b');for(var _0x411467=0x0;_0x411467<_0x3387e9['length'];_0x411467+=0x1){if(_[_0x43d0('0xae')](_0x3387e9[_0x411467])||_[_0x43d0('0xae')](_0x3387e9[_0x411467][_0x43d0('0x18a')])||_[_0x43d0('0xae')](_0x3387e9[_0x411467]['phone'])){_0x1efa9e[_0x43d0('0xd3')]('[actionOriginate]\x20',_0x58b989,_0x3387e9[_0x411467]);}else{_0x1efa9e['checkIsBlackList'](_[_0x43d0('0xd6')](_0x3387e9[_0x411467],[_0x43d0('0xda'),'Contact.phone']))[_0x43d0('0xb8')](_0x1efa9e[_0x43d0('0x206')](_0x58b989,_0x3387e9[_0x411467]))['catch'](_0x1efa9e[_0x43d0('0xd2')](_0x43d0('0x20c'),_0x58b989));}}}})[_0x43d0('0xb0')](loggerGetContactDialer(_0x43d0('0x20d'),_0x58b989,_0x8b4147));}};Dialer[_0x43d0('0x1c')]['handlePredictive']=function(_0x360df9){if(_0x360df9[_0x43d0('0x209')]>0x0){var _0x5dda2c=_0x360df9[_0x43d0('0x209')]-_0x360df9['originated']-_0x360df9['talking'];if(_0x5dda2c>0x0){this[_0x43d0('0x20e')](_0x360df9);}else{loggerPredictiveCalls[_0x43d0('0x7c')](_0x43d0('0x20f'));}}else{this[_0x43d0('0x20e')](_0x360df9);}};Dialer['prototype'][_0x43d0('0x20e')]=function(_0x31ec3c){var _0x291882=this;var _0x1a89b8=[];_0x31ec3c[_0x43d0('0x70')]+=0x1;for(var _0x2219ad in this['agents']){if(typeof this[_0x43d0('0x22')][_0x2219ad]!==_0x43d0('0xad')){if(this[_0x43d0('0x22')][_0x2219ad][_0x43d0('0xa6')]===_0x43d0('0x20a')&&this['agents'][_0x2219ad][_0x43d0('0xaf')]===_0x43d0('0xe1')){_0x1a89b8['push'](this[_0x43d0('0x22')][_0x2219ad]['id']);}}}this[_0x43d0('0xc6')](_0x31ec3c['id'],_0x1a89b8,0x1,_0x31ec3c[_0x43d0('0x201')],_0x31ec3c)[_0x43d0('0xb8')](function(_0x317be8){if(!checkContactEmpty(_0x317be8)){checkContactLowerLimitOriginate(_0x31ec3c,0x1,0x0);_0x291882[_0x43d0('0xb6')](_0x31ec3c)['then'](sendMessageReschedule(_0x31ec3c))[_0x43d0('0xb0')](loggerCatch(_0x43d0('0xb9')));}else{_0x31ec3c[_0x43d0('0x3d')]='RUNNING';if(_[_0x43d0('0xae')](_0x317be8[0x0])||_[_0x43d0('0xae')](_0x317be8[0x0][_0x43d0('0x18a')])||_['isNil'](_0x317be8[0x0][_0x43d0('0x174')])){_0x291882[_0x43d0('0xd3')](_0x43d0('0x20c'),_0x31ec3c,_0x317be8[0x0]);}else{_0x291882[_0x43d0('0xba')](_['pick'](_0x317be8[0x0],[_0x43d0('0xda'),_0x43d0('0x205')]))[_0x43d0('0xb8')](_0x291882[_0x43d0('0x206')](_0x31ec3c,_0x317be8[0x0]))['catch'](_0x291882[_0x43d0('0xd2')](_0x43d0('0x210'),_0x31ec3c));}}})['catch'](loggerGetContactDialer(_0x43d0('0x211'),_0x31ec3c,0x1));emitVoiceQueueSummary(_0x31ec3c);};Dialer[_0x43d0('0x1c')][_0x43d0('0x1e0')]=function(_0xde7ae6,_0x4b31ff,_0x119c96,_0x130a1d,_0x128781,_0xa42841){loggerPredictive[_0x43d0('0x7c')](_0x43d0('0x212'));loggerPredictive[_0x43d0('0x7c')](_0x43d0('0x213'),_0xde7ae6);loggerPredictive[_0x43d0('0x7c')](_0x43d0('0x214'),_0x4b31ff);loggerPredictive[_0x43d0('0x7c')]('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x119c96);loggerPredictive['info']('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',_0x130a1d);loggerPredictive['info'](_0x43d0('0x215'),_0x128781);loggerPredictive[_0x43d0('0x7c')]('---------------------------');return new BPromise(function(_0x179fbc,_0x4b309a){if(_0xde7ae6<=0x0||isNaN(_0xde7ae6)){return _0x4b309a(msgResponse(_0x43d0('0x216'),'Error','m\x20=\x20'+_0xde7ae6));}if(_0x119c96<=0x0||isNaN(_0x119c96)){return _0x4b309a(msgResponse(_0x43d0('0x216'),_0x43d0('0x48'),_0x43d0('0x217')+_0x119c96));}if(_0x130a1d<=0x0||isNaN(_0x130a1d)){return _0x4b309a(msgResponse(_0x43d0('0x216'),_0x43d0('0x48'),_0x43d0('0x218')+_0x130a1d));}if(_0x4b31ff<=0x0||isNaN(_0x4b31ff)){return _0x4b309a(msgResponse(_0x43d0('0x216'),_0x43d0('0x48'),_0x43d0('0x219')+_0x4b31ff));}if(_0x128781<=0x0||isNaN(_0x128781)){return _0x4b309a(msgResponse(_0x43d0('0x216'),_0x43d0('0x48'),_0x43d0('0x21a')+_0x128781));}_0xa42841=_0xa42841||0x0;var _0x41500f=0x1/_0x119c96;var _0x4b438a=0x0;var _0x1a9a27=0x0;var _0x4ed9d3=0x0;var _0x30910e=0x0;for(var _0xff2e0b=0x0;_0x4ed9d3<_0x128781;_0xff2e0b+=0x1){_0x1a9a27=_0xff2e0b/_0x4b31ff;_0x4b438a=(_0x130a1d*_0x1a9a27+_0xa42841)/_0x41500f;_0x4ed9d3=erlangb(_0x4b438a,_0xde7ae6);_0x30910e=_0x4b438a/_0xde7ae6*(0x1-erlangb(_0x4b438a,_0xde7ae6));}return _0x179fbc({'erlangCalls':_0xff2e0b,'erlangCallToSecond':_0x4b31ff/_0xff2e0b,'erlangAbandonmentRate':_0x4ed9d3,'erlangBusyFactor':_0x30910e});});};Dialer[_0x43d0('0x1c')]['busyFactor']=function(_0x13245d,_0x4945ee,_0x36532e,_0x48533a,_0x4365ab,_0x28f1dd){loggerPredictive[_0x43d0('0x7c')](_0x43d0('0x21b'));loggerPredictive[_0x43d0('0x7c')](_0x43d0('0x213'),_0x13245d);loggerPredictive[_0x43d0('0x7c')](_0x43d0('0x214'),_0x4945ee);loggerPredictive[_0x43d0('0x7c')]('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x36532e);loggerPredictive[_0x43d0('0x7c')](_0x43d0('0x21c'),_0x48533a);loggerPredictive[_0x43d0('0x7c')](_0x43d0('0x21d'),_0x4365ab);loggerPredictive['info'](_0x43d0('0x84'));return new BPromise(function(_0x4d7f4b,_0x182e1a){if(_0x13245d<=0x0||isNaN(_0x13245d)){return _0x182e1a(msgResponse(_0x43d0('0x21e'),_0x43d0('0x48'),'m\x20=\x20'+_0x13245d));}if(_0x36532e<=0x0||isNaN(_0x36532e)){return _0x182e1a(msgResponse(_0x43d0('0x21e'),'Error',_0x43d0('0x217')+_0x36532e));}if(_0x48533a<=0x0||isNaN(_0x48533a)){return _0x182e1a(msgResponse('[busyFactor]',_0x43d0('0x48'),_0x43d0('0x218')+_0x48533a));}if(_0x4945ee<=0x0||isNaN(_0x4945ee)){return _0x182e1a(msgResponse(_0x43d0('0x21e'),_0x43d0('0x48'),'interval\x20=\x20'+_0x4945ee));}if(_0x4365ab<=0x0||isNaN(_0x4365ab)){return _0x182e1a(msgResponse(_0x43d0('0x21e'),_0x43d0('0x48'),'Umin\x20=\x20'+_0x4365ab));}_0x28f1dd=_0x28f1dd||0x0;var _0x7adc96=0x1/_0x36532e;var _0x233b80=0x0;var _0x12d06d=0x0;var _0x2d0cb0=0x0;var _0x18e8b5=0x0;for(var _0x5af8a=0x0;_0x18e8b5<_0x4365ab;_0x5af8a+=0x1){_0x12d06d=_0x5af8a/_0x4945ee;_0x233b80=(_0x48533a*_0x12d06d+_0x28f1dd)/_0x7adc96;_0x2d0cb0=erlangb(_0x233b80,_0x13245d);_0x18e8b5=_0x233b80/_0x13245d*(0x1-erlangb(_0x233b80,_0x13245d));}return _0x4d7f4b({'erlangCalls':_0x5af8a,'erlangCallToSecond':_0x4945ee/_0x5af8a,'erlangAbandonmentRate':_0x2d0cb0,'erlangBusyFactor':_0x18e8b5});});};module[_0x43d0('0x21f')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index c8e2b07..27e1299 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 _0x5bd8=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','holdtime','membername','connectedlinename','reason','callback','callbackuniqueid'];(function(_0x3c81b5,_0x3f5ed7){var _0x5888c4=function(_0x4e65b0){while(--_0x4e65b0){_0x3c81b5['push'](_0x3c81b5['shift']());}};_0x5888c4(++_0x3f5ed7);}(_0x5bd8,0x1ea));var _0x85bd=function(_0x1cc7bf,_0x143305){_0x1cc7bf=_0x1cc7bf-0x0;var _0x2ca440=_0x5bd8[_0x1cc7bf];return _0x2ca440;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function getSeconds(_0x1a5ccb,_0x787655){var _0x222e2f=moment(_0x1a5ccb)[_0x85bd('0x0')](0x0);var _0x1415f2=moment(_0x787655)[_0x85bd('0x0')](0x0);return _0x222e2f[_0x85bd('0x1')](_0x1415f2,_0x85bd('0x2'));}function QueueCallerAbandon(_0x2a8ad0,_0x5339df){this[_0x85bd('0x3')]=_0x2a8ad0[_0x85bd('0x3')];this[_0x85bd('0x4')]=_0x2a8ad0[_0x85bd('0x4')];this[_0x85bd('0x5')]=_0x2a8ad0[_0x85bd('0x4')]===_0x85bd('0x6')?_0x85bd('0x7'):_0x2a8ad0[_0x85bd('0x4')];this[_0x85bd('0x8')]=_0x2a8ad0['countbusyretry'];this['countcongestionretry']=_0x2a8ad0[_0x85bd('0x9')];this[_0x85bd('0xa')]=_0x2a8ad0[_0x85bd('0xa')];this['countglobal']=_0x2a8ad0[_0x85bd('0x8')]+_0x2a8ad0[_0x85bd('0x9')]+_0x2a8ad0[_0x85bd('0xa')]+_0x2a8ad0['countnosuchnumberretry']+_0x2a8ad0[_0x85bd('0xb')]+_0x2a8ad0['countabandonedretry']+_0x2a8ad0[_0x85bd('0xc')]+_0x2a8ad0[_0x85bd('0xd')];this[_0x85bd('0xe')]=_0x2a8ad0[_0x85bd('0xe')];this['countdropretry']=_0x2a8ad0[_0x85bd('0xb')];this[_0x85bd('0xf')]=_0x2a8ad0['countabandonedretry'];this['countmachineretry']=_0x2a8ad0[_0x85bd('0xc')];this[_0x85bd('0xd')]=_0x2a8ad0[_0x85bd('0xd')];this[_0x85bd('0x10')]=_0x5339df[_0x85bd('0x10')];this[_0x85bd('0x11')]=_0x2a8ad0[_0x85bd('0x12')];this[_0x85bd('0x13')]=_0x2a8ad0[_0x85bd('0x14')];this[_0x85bd('0x15')]=_0x2a8ad0['starttime'];this[_0x85bd('0x16')]=_0x2a8ad0['responsetime'];this[_0x85bd('0x17')]=_0x2a8ad0[_0x85bd('0x17')];this['endtime']=this[_0x85bd('0x17')];this['ringtime']=getSeconds(_0x2a8ad0[_0x85bd('0x16')],_0x2a8ad0[_0x85bd('0x15')]);this[_0x85bd('0x18')]=getSeconds(this[_0x85bd('0x17')],_0x2a8ad0[_0x85bd('0x16')]);this['talktime']=0x0;this['queue']=_0x5339df['queue'];this[_0x85bd('0x19')]=_0x5339df[_0x85bd('0x1a')];this[_0x85bd('0x1b')]=_0x5339df['reason'];this[_0x85bd('0x1c')]=_0x2a8ad0[_0x85bd('0x1c')];this[_0x85bd('0x1d')]=_0x2a8ad0[_0x85bd('0x1d')];this[_0x85bd('0x1e')]=_0x2a8ad0[_0x85bd('0x1e')];this[_0x85bd('0x1f')]=_0x2a8ad0['recallme'];this[_0x85bd('0x20')]=_0x2a8ad0[_0x85bd('0x20')];this['ListId']=_0x2a8ad0[_0x85bd('0x21')];this[_0x85bd('0x22')]=_0x2a8ad0[_0x85bd('0x22')];this[_0x85bd('0x23')]=_0x2a8ad0[_0x85bd('0x23')];this['CampaignId']=_0x2a8ad0[_0x85bd('0x24')];this[_0x85bd('0x25')]=_0x2a8ad0[_0x85bd('0x25')]||'';this['originatecalleridname']=_0x2a8ad0[_0x85bd('0x26')]||'';}module[_0x85bd('0x27')]=QueueCallerAbandon; \ No newline at end of file +var _0x78d2=['countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','ringtime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry'];(function(_0x31af1b,_0x1d973a){var _0x298be9=function(_0xcb0dea){while(--_0xcb0dea){_0x31af1b['push'](_0x31af1b['shift']());}};_0x298be9(++_0x1d973a);}(_0x78d2,0x9e));var _0x278d=function(_0x2db63f,_0x5e3dcc){_0x2db63f=_0x2db63f-0x0;var _0x2da78c=_0x78d2[_0x2db63f];return _0x2da78c;};'use strict';var util=require(_0x278d('0x0'));var _=require(_0x278d('0x1'));var moment=require(_0x278d('0x2'));function getSeconds(_0x348a34,_0x3c10fa){var _0x1ef7b4=moment(_0x348a34)[_0x278d('0x3')](0x0);var _0x4b6371=moment(_0x3c10fa)[_0x278d('0x3')](0x0);return _0x1ef7b4['diff'](_0x4b6371,'seconds');}function QueueCallerAbandon(_0x5aed89,_0x5d4f93){this['scheduledat']=_0x5aed89[_0x278d('0x4')];this[_0x278d('0x5')]=_0x5aed89['type'];this[_0x278d('0x6')]=_0x5aed89[_0x278d('0x5')]===_0x278d('0x7')?_0x278d('0x8'):_0x5aed89['type'];this[_0x278d('0x9')]=_0x5aed89[_0x278d('0x9')];this[_0x278d('0xa')]=_0x5aed89[_0x278d('0xa')];this[_0x278d('0xb')]=_0x5aed89[_0x278d('0xb')];this[_0x278d('0xc')]=_0x5aed89[_0x278d('0x9')]+_0x5aed89[_0x278d('0xa')]+_0x5aed89['countnoanswerretry']+_0x5aed89[_0x278d('0xd')]+_0x5aed89[_0x278d('0xe')]+_0x5aed89[_0x278d('0xf')]+_0x5aed89['countmachineretry']+_0x5aed89[_0x278d('0x10')];this[_0x278d('0xd')]=_0x5aed89[_0x278d('0xd')];this[_0x278d('0xe')]=_0x5aed89['countdropretry'];this[_0x278d('0xf')]=_0x5aed89[_0x278d('0xf')];this[_0x278d('0x11')]=_0x5aed89[_0x278d('0x11')];this[_0x278d('0x10')]=_0x5aed89[_0x278d('0x10')];this[_0x278d('0x12')]=_0x5d4f93['uniqueid'];this[_0x278d('0x13')]=_0x5aed89[_0x278d('0x14')];this[_0x278d('0x15')]=_0x5aed89[_0x278d('0x16')];this[_0x278d('0x17')]=_0x5aed89[_0x278d('0x17')];this['responsetime']=_0x5aed89[_0x278d('0x18')];this['droptime']=_0x5aed89[_0x278d('0x19')];this['endtime']=this[_0x278d('0x19')];this[_0x278d('0x1a')]=getSeconds(_0x5aed89['responsetime'],_0x5aed89[_0x278d('0x17')]);this['holdtime']=getSeconds(this[_0x278d('0x19')],_0x5aed89[_0x278d('0x18')]);this['talktime']=0x0;this['queue']=_0x5d4f93[_0x278d('0x8')];this[_0x278d('0x1b')]=_0x5d4f93[_0x278d('0x1c')];this['reason']=_0x5d4f93[_0x278d('0x1d')];this[_0x278d('0x1e')]=_0x5aed89['callback'];this[_0x278d('0x1f')]=_0x5aed89[_0x278d('0x1f')];this[_0x278d('0x20')]=_0x5aed89[_0x278d('0x20')];this[_0x278d('0x21')]=_0x5aed89['recallme'];this[_0x278d('0x22')]=_0x5aed89[_0x278d('0x22')];this[_0x278d('0x23')]=_0x5aed89[_0x278d('0x23')];this['UserId']=_0x5aed89[_0x278d('0x24')];this['VoiceQueueId']=_0x5aed89[_0x278d('0x25')];this[_0x278d('0x26')]=_0x5aed89['CampaignId'];this[_0x278d('0x27')]=_0x5aed89['originatecalleridnum']||'';this[_0x278d('0x28')]=_0x5aed89[_0x278d('0x28')]||'';}module[_0x278d('0x29')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index fa54d7a..cfb066a 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(_0x2e2ab7,_0x4d6403){var _0x30b9ca=function(_0x1b6991){while(--_0x1b6991){_0x2e2ab7['push'](_0x2e2ab7['shift']());}};_0x30b9ca(++_0x4d6403);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function 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(_0x218caf,_0xd86fcf){var _0x3aa5b7=function(_0x574b42){while(--_0x574b42){_0x218caf['push'](_0x218caf['shift']());}};_0x3aa5b7(++_0xd86fcf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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 c6798b8..5ebc5bd 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 _0x7b1a=['Action','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','Empty\x20path','Is\x20Valid','exports','util','lodash','moment','path','./util/gs','../../../config/logger','fax','../ami','./channel','./util/util','./action','../rpc/faxAccount','channels','faxAccounts','trunks','syncNewchannel','bind','syncVarSet','newstate','syncNewState','newexten','syncNewExten','syncFaxStatus','receivefax','hangup','originateresponse','syncOriginateResponse','context','from-voip-provider','hasOwnProperty','exten','uniqueid','channel','name','\x20syncNewchannel\x20','actions','info','prototype','value','channelstate','channelstatedesc','variable','operation','status','localstationid','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','parse','calleridnum','.pdf','catch','error','stringify','\x20receiveFax\x20','merge','pick','reason','AttachmentId','SENDING\x20FAILED\x20','then','[Fax][Message][Error][Updated]','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','update','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20sendFile\x20','faxstatus','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','message','Fax\x20received','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','Convert\x20pdf\x20to\x20tif','variablesAction'];(function(_0x4cb280,_0x2b649d){var _0x3a05ae=function(_0x49f8bd){while(--_0x49f8bd){_0x4cb280['push'](_0x4cb280['shift']());}};_0x3a05ae(++_0x2b649d);}(_0x7b1a,0x1db));var _0xa7b1=function(_0x2177e4,_0xdb658f){_0x2177e4=_0x2177e4-0x0;var _0x18130d=_0x7b1a[_0x2177e4];return _0x18130d;};'use strict';var util=require(_0xa7b1('0x0'));var _=require(_0xa7b1('0x1'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0xa7b1('0x2'));var path=require(_0xa7b1('0x3'));var tiff2pdf=require('tiff2pdf');var gs=require(_0xa7b1('0x4'));var logger=require(_0xa7b1('0x5'))(_0xa7b1('0x6'));var ami=require(_0xa7b1('0x7'));var rpcDb=require('./rpcDb');var Channel=require(_0xa7b1('0x8'));var ut=require(_0xa7b1('0x9'));var Action=require(_0xa7b1('0xa'));var faxAccount=require(_0xa7b1('0xb'));var attachment=require('../rpc/attachment');var faxMessage=require('../rpc/faxMessage');function Fax(_0xe46420){this[_0xa7b1('0xc')]={};this[_0xa7b1('0xd')]=_0xe46420[_0xa7b1('0xd')];this[_0xa7b1('0xe')]=_0xe46420[_0xa7b1('0xe')];this['actions']={};ami['on']('newchannel',this[_0xa7b1('0xf')][_0xa7b1('0x10')](this));ami['on']('varset',this[_0xa7b1('0x11')]['bind'](this));ami['on'](_0xa7b1('0x12'),this[_0xa7b1('0x13')][_0xa7b1('0x10')](this));ami['on'](_0xa7b1('0x14'),this[_0xa7b1('0x15')][_0xa7b1('0x10')](this));ami['on']('faxstatus',this[_0xa7b1('0x16')][_0xa7b1('0x10')](this));ami['on'](_0xa7b1('0x17'),this['syncReceiveFax'][_0xa7b1('0x10')](this));ami['on'](_0xa7b1('0x18'),this['syncHangup'][_0xa7b1('0x10')](this));ami['on'](_0xa7b1('0x19'),this[_0xa7b1('0x1a')]['bind'](this));}Fax['prototype'][_0xa7b1('0xf')]=function(_0x3b5e15){if(_0x3b5e15[_0xa7b1('0x1b')]===_0xa7b1('0x1c')){for(var _0x1ec6a3 in this[_0xa7b1('0xd')]){if(this['faxAccounts'][_0xa7b1('0x1d')](_0x1ec6a3)){if(_0x3b5e15[_0xa7b1('0x1e')]===this['faxAccounts'][_0x1ec6a3]['localstationid']){this[_0xa7b1('0xc')][_0x3b5e15['uniqueid']]={};this[_0xa7b1('0xc')][_0x3b5e15[_0xa7b1('0x1f')]][_0xa7b1('0x20')]=_0x3b5e15['channel'];this[_0xa7b1('0xc')][_0x3b5e15[_0xa7b1('0x1f')]]['id']=this[_0xa7b1('0xd')][_0x1ec6a3]['id'];this[_0xa7b1('0xc')][_0x3b5e15[_0xa7b1('0x1f')]][_0xa7b1('0x21')]=this['faxAccounts'][_0x1ec6a3][_0xa7b1('0x21')];logger['info'](_0x3b5e15[_0xa7b1('0x1f')],_0xa7b1('0x22'));}}}}if(this[_0xa7b1('0x23')][_0x3b5e15[_0xa7b1('0x1f')]]){this['channels'][_0x3b5e15[_0xa7b1('0x1f')]]={};this['channels'][_0x3b5e15[_0xa7b1('0x1f')]][_0xa7b1('0x20')]=_0x3b5e15[_0xa7b1('0x20')];logger[_0xa7b1('0x24')](_0x3b5e15[_0xa7b1('0x1f')],_0xa7b1('0x22'));}};Fax[_0xa7b1('0x25')][_0xa7b1('0x11')]=function(_0x3ba982){if(this[_0xa7b1('0xc')][_0x3ba982['uniqueid']]){for(var _0x46105b in _0x3ba982['variable']){if(_0x3ba982['variable']['hasOwnProperty'](_0x46105b)){this[_0xa7b1('0xc')][_0x3ba982[_0xa7b1('0x1f')]][_0x46105b]=_0x3ba982[_0xa7b1('0x26')];}}}};Fax[_0xa7b1('0x25')]['syncNewState']=function(_0x594a6b){if(this[_0xa7b1('0xc')][_0x594a6b['uniqueid']]){this[_0xa7b1('0xc')][_0x594a6b[_0xa7b1('0x1f')]][_0xa7b1('0x27')]=_0x594a6b[_0xa7b1('0x27')];this['channels'][_0x594a6b['uniqueid']][_0xa7b1('0x28')]=_0x594a6b['channelstatedesc'];}};Fax[_0xa7b1('0x25')][_0xa7b1('0x15')]=function(_0x33a924){if(this[_0xa7b1('0xc')][_0x33a924[_0xa7b1('0x1f')]]){for(var _0x326ec7 in _0x33a924[_0xa7b1('0x29')]){if(_0x33a924[_0xa7b1('0x29')]['hasOwnProperty'](_0x326ec7)){this[_0xa7b1('0xc')][_0x33a924[_0xa7b1('0x1f')]][_0x326ec7]=_0x33a924[_0xa7b1('0x26')];}}}};Fax['prototype'][_0xa7b1('0x16')]=function(_0x59adb8){if(this[_0xa7b1('0xc')][_0x59adb8['uniqueid']]){this[_0xa7b1('0xc')][_0x59adb8[_0xa7b1('0x1f')]][_0xa7b1('0x2a')]=_0x59adb8[_0xa7b1('0x2a')];this[_0xa7b1('0xc')][_0x59adb8[_0xa7b1('0x1f')]][_0xa7b1('0x2b')]=_0x59adb8['status'];this[_0xa7b1('0xc')][_0x59adb8[_0xa7b1('0x1f')]][_0xa7b1('0x2c')]=_0x59adb8['localstationid'];this['channels'][_0x59adb8[_0xa7b1('0x1f')]][_0xa7b1('0x2d')]=_0x59adb8[_0xa7b1('0x2d')];logger[_0xa7b1('0x24')](_0x59adb8[_0xa7b1('0x1f')],_0xa7b1('0x2e'));}};Fax[_0xa7b1('0x25')][_0xa7b1('0x2f')]=function(_0xf3ee29){var _0x20b42c=this;if(this['channels'][_0xf3ee29['uniqueid']]){var _0x5bfbf7=this['channels'][_0xf3ee29['uniqueid']]['id'];this[_0xa7b1('0xc')][_0xf3ee29['uniqueid']][_0xa7b1('0x30')]=_0xf3ee29[_0xa7b1('0x30')];this['channels'][_0xf3ee29[_0xa7b1('0x1f')]][_0xa7b1('0x31')]=_0xf3ee29[_0xa7b1('0x31')];this['channels'][_0xf3ee29[_0xa7b1('0x1f')]][_0xa7b1('0x2c')]=_0xf3ee29['localstationid'];this[_0xa7b1('0xc')][_0xf3ee29[_0xa7b1('0x1f')]][_0xa7b1('0x32')]=_0xf3ee29[_0xa7b1('0x32')];this[_0xa7b1('0xc')][_0xf3ee29[_0xa7b1('0x1f')]][_0xa7b1('0x33')]=_0xf3ee29[_0xa7b1('0x33')];this[_0xa7b1('0xc')][_0xf3ee29[_0xa7b1('0x1f')]][_0xa7b1('0x2d')]=_0xf3ee29[_0xa7b1('0x2d')];this[_0xa7b1('0xc')][_0xf3ee29[_0xa7b1('0x1f')]]['calleridnum']=_0xf3ee29['calleridnum'];if(this[_0xa7b1('0xc')][_0xf3ee29[_0xa7b1('0x1f')]]['pagestransferred']>0x0){tiff2pdf(_0xf3ee29[_0xa7b1('0x2d')],_0xa7b1('0x34'),function(_0x5b091a){logger[_0xa7b1('0x24')](_0xf3ee29[_0xa7b1('0x1f')],_0xa7b1('0x35'),_0x5b091a['message']);attachment['create']({'name':path[_0xa7b1('0x36')](_0xf3ee29[_0xa7b1('0x2d')])['name'],'basename':path[_0xa7b1('0x36')](_0xf3ee29[_0xa7b1('0x2d')])['name']+'.pdf','type':'application/pdf'})['then'](function(_0x3bcfb0){faxAccount['notify'](_0x5bfbf7,{'from':_0xf3ee29[_0xa7b1('0x37')],'mapKey':_0xa7b1('0x6'),'body':path[_0xa7b1('0x36')](_0xf3ee29[_0xa7b1('0x2d')])[_0xa7b1('0x21')]+_0xa7b1('0x38'),'AttachmentId':_0x3bcfb0['id']})[_0xa7b1('0x39')](function(_0x187a9b){logger[_0xa7b1('0x3a')](_0xf3ee29[_0xa7b1('0x1f')],'\x20notify\x20',JSON[_0xa7b1('0x3b')](_0x187a9b));});})[_0xa7b1('0x39')](function(_0x4a62d5){logger[_0xa7b1('0x3a')](_0xf3ee29[_0xa7b1('0x1f')],_0xa7b1('0x3c'),JSON[_0xa7b1('0x3b')](_0x4a62d5));});});}logger[_0xa7b1('0x24')](_0xf3ee29[_0xa7b1('0x1f')],_0xa7b1('0x3c'));}};Fax[_0xa7b1('0x25')][_0xa7b1('0x1a')]=function(_0x353281){if(this[_0xa7b1('0x23')][_0x353281[_0xa7b1('0x1f')]]){_[_0xa7b1('0x3d')](this[_0xa7b1('0xc')][_0x353281[_0xa7b1('0x1f')]],_[_0xa7b1('0x3e')](_0x353281,['response',_0xa7b1('0x3f')]));}};function updateStatus(_0x14baed){if(_0x14baed[_0xa7b1('0x40')]){faxMessage['update'](_0x14baed['AttachmentId'],{'failMessage':_0xa7b1('0x41')})[_0xa7b1('0x42')](function(_0x243d8a){ut['logger'](_0xa7b1('0x43'),_0x243d8a);})[_0xa7b1('0x39')](function(_0x1dcfd6){ut[_0xa7b1('0x44')](_0xa7b1('0x45'),_0x1dcfd6);});}else{ut[_0xa7b1('0x44')](_0xa7b1('0x46'));}}Fax[_0xa7b1('0x25')][_0xa7b1('0x47')]=function(_0x386270,_0x235715,_0x255653){var _0x2872ad=this;var _0x49852f={};if(_0x235715){_0x49852f={'read':_0x235715};}else{_0x49852f={'failMessage':_0x255653};}if(this[_0xa7b1('0x23')][_0x386270][_0xa7b1('0x40')]){faxMessage[_0xa7b1('0x48')](this[_0xa7b1('0x23')][_0x386270][_0xa7b1('0x40')],_0x49852f)[_0xa7b1('0x42')](function(_0x5b3b55){ut[_0xa7b1('0x44')](_0xa7b1('0x49'),_0x5b3b55);})['catch'](function(_0x9191f8){ut[_0xa7b1('0x44')](_0xa7b1('0x4a'),_0x9191f8);})['finally'](function(){delete _0x2872ad[_0xa7b1('0xc')][_0x386270];delete _0x2872ad[_0xa7b1('0x23')][_0x386270];});}else{ut[_0xa7b1('0x44')](_0xa7b1('0x4b'));delete this[_0xa7b1('0xc')][_0x386270];delete this[_0xa7b1('0x23')][_0x386270];}};Fax[_0xa7b1('0x25')][_0xa7b1('0x4c')]=function(_0x21875c){var _0x20144a=this;if(this[_0xa7b1('0xc')][_0x21875c[_0xa7b1('0x1f')]]){if(this[_0xa7b1('0x23')][_0x21875c[_0xa7b1('0x1f')]]){this[_0xa7b1('0xc')][_0x21875c[_0xa7b1('0x1f')]]['id']=this[_0xa7b1('0x23')][_0x21875c['uniqueid']]['id'];this[_0xa7b1('0xc')][_0x21875c['uniqueid']][_0xa7b1('0x21')]=this[_0xa7b1('0x23')][_0x21875c[_0xa7b1('0x1f')]]['name'];}logger[_0xa7b1('0x24')](_0x21875c[_0xa7b1('0x1f')],this[_0xa7b1('0x23')][_0x21875c[_0xa7b1('0x1f')]]?_0xa7b1('0x4d'):'\x20hangup\x20faxRiceive\x20',JSON[_0xa7b1('0x3b')](this[_0xa7b1('0xc')][_0x21875c['uniqueid']]));if(this[_0xa7b1('0x23')][_0x21875c[_0xa7b1('0x1f')]]){if(this['channels'][_0x21875c[_0xa7b1('0x1f')]]['faxpages']>0x0&&this[_0xa7b1('0xc')][_0x21875c[_0xa7b1('0x1f')]][_0xa7b1('0x4e')]===_0xa7b1('0x4f')){this[_0xa7b1('0x47')](_0x21875c[_0xa7b1('0x1f')],!![]);}else{this[_0xa7b1('0x47')](_0x21875c['uniqueid'],![],this[_0xa7b1('0xc')][_0x21875c[_0xa7b1('0x1f')]][_0xa7b1('0x50')]?_0xa7b1('0x51')+this[_0xa7b1('0xc')][_0x21875c['uniqueid']][_0xa7b1('0x50')]:_0xa7b1('0x52'));}}}};Fax[_0xa7b1('0x25')][_0xa7b1('0x53')]=function(_0x2a6460){var _0x12e31e=this;return new BPromise(function(_0x38b170,_0x60748a){_0x12e31e[_0xa7b1('0x54')](_0x2a6460,_0x12e31e[_0xa7b1('0xd')][_0x2a6460[_0xa7b1('0x55')]])[_0xa7b1('0x42')](function(_0x5b3649){ut['logger'](_0xa7b1('0x56'),_0x5b3649);_0x38b170(ut[_0xa7b1('0x57')](_0xa7b1('0x58')));})['catch'](function(_0xb7b280){ut[_0xa7b1('0x44')]('[Fax][execOriginate][failure]',_0xb7b280);updateStatus(_0x2a6460);_0x60748a(ut['message']('Fax\x20failed'));});});};Fax['prototype']['checkAfterSend']=function(_0x5beaf1){var _0x56a44f=this;return new BPromise(function(_0x49b500,_0x3001b4){var _0x105826=_0x56a44f[_0xa7b1('0x59')](_0x56a44f['faxAccounts'][_0x5beaf1[_0xa7b1('0x55')]][_0xa7b1('0x5a')],_0x5beaf1);if(_0x105826[_0xa7b1('0x5b')]){_0x49b500(ut[_0xa7b1('0x57')](_0xa7b1('0x5c')));}else{_0x3001b4(ut['message'](_0x105826['message']));}});};function originate(_0x3ef77f,_0x4d2d95,_0x25d1c7){return new BPromise(function(_0x2bb464,_0x369ba8){if(_0x25d1c7){var _0x2029b2=util[_0xa7b1('0x5d')](_0xa7b1('0x5e'),path[_0xa7b1('0x36')](_0x3ef77f[_0xa7b1('0x3')])[_0xa7b1('0x21')],_0x3ef77f[_0xa7b1('0x3')]);gs[_0xa7b1('0x5f')](_0x2029b2)[_0xa7b1('0x42')](function(){_0x3ef77f['path']=util[_0xa7b1('0x5d')](_0xa7b1('0x60'),path[_0xa7b1('0x36')](_0x3ef77f[_0xa7b1('0x3')])[_0xa7b1('0x61')],path['parse'](_0x3ef77f['path'])[_0xa7b1('0x21')]);_0x4d2d95['XMF-PATH']=_0x3ef77f[_0xa7b1('0x3')];ut[_0xa7b1('0x44')](_0xa7b1('0x62'),'');ami['Action'](ut[_0xa7b1('0x63')](_0x3ef77f,_0x4d2d95))[_0xa7b1('0x42')](function(_0x159d69){_0x2bb464(_0x159d69);})[_0xa7b1('0x39')](function(_0x5593b9){_0x369ba8(_0x5593b9);});})[_0xa7b1('0x39')](function(_0x200b2e){_0x369ba8(_0x200b2e);});}else{ami[_0xa7b1('0x64')](ut['variablesAction'](_0x3ef77f,_0x4d2d95))[_0xa7b1('0x42')](function(_0x449ac7){_0x2bb464(_0x449ac7);})[_0xa7b1('0x39')](function(_0xc3958e){_0x369ba8(_0xc3958e);});}});}Fax[_0xa7b1('0x25')][_0xa7b1('0x54')]=function(_0x3333f4,_0x3291ef){var _0x38ebd9=this;return new BPromise(function(_0x4305bd,_0x5afda6){var _0x2e353b=uuid['v4']();var _0x62ebba=ut['addVariables'](_0x3333f4,_0x3291ef);_0x38ebd9[_0xa7b1('0x23')][_0x2e353b]=new Action(_0x2e353b,_0x3291ef,_0x3333f4);var _0x46ddb5=_0x38ebd9['actions'][_0x2e353b];if(path[_0xa7b1('0x36')](_0x3333f4['path'])[_0xa7b1('0x65')]===_0xa7b1('0x38')){originate(_0x46ddb5,_0x62ebba,!![])[_0xa7b1('0x42')](function(_0x4ee80a){_0x4305bd(_0x4ee80a);})[_0xa7b1('0x39')](function(_0x16c682){_0x5afda6(_0x16c682);});}else{originate(_0x46ddb5,_0x62ebba,![])['then'](function(_0x30a03c){_0x4305bd(_0x30a03c);})[_0xa7b1('0x39')](function(_0x484133){_0x5afda6(_0x484133);});}});};Fax[_0xa7b1('0x25')][_0xa7b1('0x66')]=function(_0x5eb4fd){return!_[_0xa7b1('0x67')](_0x5eb4fd)&&!_[_0xa7b1('0x67')](_0x5eb4fd[_0xa7b1('0x21')])&&!_[_0xa7b1('0x67')](_0x5eb4fd[_0xa7b1('0x68')])&&_0x5eb4fd['active']&&!_['isNil'](this[_0xa7b1('0xe')][util[_0xa7b1('0x5d')](_0xa7b1('0x69'),_0x5eb4fd[_0xa7b1('0x21')])])&&!_['isNil'](this[_0xa7b1('0xe')][util[_0xa7b1('0x5d')]('SIP/%s',_0x5eb4fd[_0xa7b1('0x21')])]['status'])&&(this[_0xa7b1('0xe')][util['format']('SIP/%s',_0x5eb4fd[_0xa7b1('0x21')])][_0xa7b1('0x2b')]===_0xa7b1('0x6a')||this['trunks'][util[_0xa7b1('0x5d')](_0xa7b1('0x69'),_0x5eb4fd[_0xa7b1('0x21')])][_0xa7b1('0x2b')]==='unmonitored');};Fax['prototype']['checkTrunk']=function(_0x22b53e,_0x4f1a76){if(!this[_0xa7b1('0x66')](_0x22b53e)){ut[_0xa7b1('0x44')](_0xa7b1('0x6b'),_[_0xa7b1('0x67')](_0x22b53e)?'':_0x22b53e[_0xa7b1('0x21')]+_0xa7b1('0x6c'));return{'isValid':![],'message':_0xa7b1('0x6d')};}if(_[_0xa7b1('0x67')](_0x4f1a76[_0xa7b1('0x6')])){ut['logger'](_0xa7b1('0x6e'),JSON['stringify'](_0x4f1a76));return{'isValid':![],'message':_0xa7b1('0x6f')};}if(_[_0xa7b1('0x67')](_0x4f1a76[_0xa7b1('0x3')])){ut[_0xa7b1('0x44')]('[Fax][checkTrunk][Empty\x20path]',JSON['stringify'](_0x4f1a76));return{'isValid':![],'message':_0xa7b1('0x70')};}return{'isValid':!![],'message':_0xa7b1('0x71')};};module[_0xa7b1('0x72')]=Fax; \ No newline at end of file +var _0x28ff=['pagestransferred','resolution','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','application/pdf','then','notify','error','\x20notify\x20','stringify','\x20receiveFax\x20','reason','AttachmentId','logger','[Fax][Message][Error][Updated]','catch','[Fax][Message][Error][NoUpdate1]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20sendFile\x20','SUCCESS','SENDING\x20FAILED:\x20','faxstatusstring','SENDING\x20FAILED','execOriginate','FaxAccountId','[Fax][execOriginate][failure]','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','isTrunkReachable','isNil','active','trunks','SIP/%s','reachable','unmonitored','Trunk\x20not\x20working','fax','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','util','uuid','moment','path','../../../config/logger','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','faxAccounts','newchannel','syncNewchannel','varset','syncVarSet','bind','syncNewState','newexten','syncNewExten','faxstatus','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','hasOwnProperty','exten','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','actions','variable','channelstate','channelstatedesc','value','syncFaxStatus','operation','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid'];(function(_0x4214c2,_0x120074){var _0x5dac78=function(_0x281bfe){while(--_0x281bfe){_0x4214c2['push'](_0x4214c2['shift']());}};_0x5dac78(++_0x120074);}(_0x28ff,0x118));var _0xf28f=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x28ff[_0x465a0c];return _0x1e202e;};'use strict';var util=require(_0xf28f('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0xf28f('0x1'));var moment=require(_0xf28f('0x2'));var path=require(_0xf28f('0x3'));var tiff2pdf=require('tiff2pdf');var gs=require('./util/gs');var logger=require(_0xf28f('0x4'))('fax');var ami=require(_0xf28f('0x5'));var rpcDb=require(_0xf28f('0x6'));var Channel=require(_0xf28f('0x7'));var ut=require(_0xf28f('0x8'));var Action=require(_0xf28f('0x9'));var faxAccount=require(_0xf28f('0xa'));var attachment=require(_0xf28f('0xb'));var faxMessage=require(_0xf28f('0xc'));function Fax(_0x2cfd8b){this['channels']={};this['faxAccounts']=_0x2cfd8b[_0xf28f('0xd')];this['trunks']=_0x2cfd8b['trunks'];this['actions']={};ami['on'](_0xf28f('0xe'),this[_0xf28f('0xf')]['bind'](this));ami['on'](_0xf28f('0x10'),this[_0xf28f('0x11')][_0xf28f('0x12')](this));ami['on']('newstate',this[_0xf28f('0x13')][_0xf28f('0x12')](this));ami['on'](_0xf28f('0x14'),this[_0xf28f('0x15')][_0xf28f('0x12')](this));ami['on'](_0xf28f('0x16'),this['syncFaxStatus'][_0xf28f('0x12')](this));ami['on']('receivefax',this[_0xf28f('0x17')][_0xf28f('0x12')](this));ami['on'](_0xf28f('0x18'),this[_0xf28f('0x19')][_0xf28f('0x12')](this));ami['on'](_0xf28f('0x1a'),this[_0xf28f('0x1b')][_0xf28f('0x12')](this));}Fax[_0xf28f('0x1c')][_0xf28f('0xf')]=function(_0xcb6fa2){if(_0xcb6fa2[_0xf28f('0x1d')]==='from-voip-provider'){for(var _0x506a37 in this[_0xf28f('0xd')]){if(this[_0xf28f('0xd')][_0xf28f('0x1e')](_0x506a37)){if(_0xcb6fa2[_0xf28f('0x1f')]===this['faxAccounts'][_0x506a37]['localstationid']){this[_0xf28f('0x20')][_0xcb6fa2[_0xf28f('0x21')]]={};this[_0xf28f('0x20')][_0xcb6fa2[_0xf28f('0x21')]][_0xf28f('0x22')]=_0xcb6fa2[_0xf28f('0x22')];this['channels'][_0xcb6fa2[_0xf28f('0x21')]]['id']=this[_0xf28f('0xd')][_0x506a37]['id'];this[_0xf28f('0x20')][_0xcb6fa2[_0xf28f('0x21')]][_0xf28f('0x23')]=this[_0xf28f('0xd')][_0x506a37]['name'];logger[_0xf28f('0x24')](_0xcb6fa2[_0xf28f('0x21')],_0xf28f('0x25'));}}}}if(this[_0xf28f('0x26')][_0xcb6fa2['uniqueid']]){this[_0xf28f('0x20')][_0xcb6fa2['uniqueid']]={};this[_0xf28f('0x20')][_0xcb6fa2[_0xf28f('0x21')]][_0xf28f('0x22')]=_0xcb6fa2[_0xf28f('0x22')];logger[_0xf28f('0x24')](_0xcb6fa2[_0xf28f('0x21')],'\x20syncNewchannel\x20');}};Fax[_0xf28f('0x1c')][_0xf28f('0x11')]=function(_0x5016eb){if(this[_0xf28f('0x20')][_0x5016eb[_0xf28f('0x21')]]){for(var _0xf99f8d in _0x5016eb[_0xf28f('0x27')]){if(_0x5016eb[_0xf28f('0x27')][_0xf28f('0x1e')](_0xf99f8d)){this['channels'][_0x5016eb[_0xf28f('0x21')]][_0xf99f8d]=_0x5016eb['value'];}}}};Fax[_0xf28f('0x1c')][_0xf28f('0x13')]=function(_0x1117af){if(this[_0xf28f('0x20')][_0x1117af[_0xf28f('0x21')]]){this['channels'][_0x1117af['uniqueid']]['channelstate']=_0x1117af[_0xf28f('0x28')];this['channels'][_0x1117af[_0xf28f('0x21')]][_0xf28f('0x29')]=_0x1117af['channelstatedesc'];}};Fax[_0xf28f('0x1c')]['syncNewExten']=function(_0x560cc5){if(this[_0xf28f('0x20')][_0x560cc5[_0xf28f('0x21')]]){for(var _0x509811 in _0x560cc5[_0xf28f('0x27')]){if(_0x560cc5[_0xf28f('0x27')][_0xf28f('0x1e')](_0x509811)){this[_0xf28f('0x20')][_0x560cc5[_0xf28f('0x21')]][_0x509811]=_0x560cc5[_0xf28f('0x2a')];}}}};Fax[_0xf28f('0x1c')][_0xf28f('0x2b')]=function(_0x2523ce){if(this[_0xf28f('0x20')][_0x2523ce[_0xf28f('0x21')]]){this[_0xf28f('0x20')][_0x2523ce[_0xf28f('0x21')]][_0xf28f('0x2c')]=_0x2523ce[_0xf28f('0x2c')];this[_0xf28f('0x20')][_0x2523ce[_0xf28f('0x21')]][_0xf28f('0x2d')]=_0x2523ce[_0xf28f('0x2d')];this[_0xf28f('0x20')][_0x2523ce['uniqueid']][_0xf28f('0x2e')]=_0x2523ce['localstationid'];this[_0xf28f('0x20')][_0x2523ce[_0xf28f('0x21')]][_0xf28f('0x2f')]=_0x2523ce[_0xf28f('0x2f')];logger[_0xf28f('0x24')](_0x2523ce[_0xf28f('0x21')],_0xf28f('0x30'));}};Fax[_0xf28f('0x1c')][_0xf28f('0x17')]=function(_0x587821){var _0x1705c6=this;if(this[_0xf28f('0x20')][_0x587821[_0xf28f('0x21')]]){var _0x1d04d4=this[_0xf28f('0x20')][_0x587821[_0xf28f('0x21')]]['id'];this['channels'][_0x587821['uniqueid']][_0xf28f('0x31')]=_0x587821[_0xf28f('0x31')];this[_0xf28f('0x20')][_0x587821[_0xf28f('0x21')]]['pagestransferred']=_0x587821[_0xf28f('0x32')];this[_0xf28f('0x20')][_0x587821[_0xf28f('0x21')]][_0xf28f('0x2e')]=_0x587821['localstationid'];this[_0xf28f('0x20')][_0x587821[_0xf28f('0x21')]][_0xf28f('0x33')]=_0x587821[_0xf28f('0x33')];this[_0xf28f('0x20')][_0x587821[_0xf28f('0x21')]]['transferrate']=_0x587821['transferrate'];this[_0xf28f('0x20')][_0x587821[_0xf28f('0x21')]][_0xf28f('0x2f')]=_0x587821[_0xf28f('0x2f')];this[_0xf28f('0x20')][_0x587821[_0xf28f('0x21')]][_0xf28f('0x34')]=_0x587821[_0xf28f('0x34')];if(this['channels'][_0x587821[_0xf28f('0x21')]]['pagestransferred']>0x0){tiff2pdf(_0x587821[_0xf28f('0x2f')],_0xf28f('0x35'),function(_0x1e8a11){logger['info'](_0x587821[_0xf28f('0x21')],_0xf28f('0x36'),_0x1e8a11[_0xf28f('0x37')]);attachment[_0xf28f('0x38')]({'name':path[_0xf28f('0x39')](_0x587821[_0xf28f('0x2f')])[_0xf28f('0x23')],'basename':path[_0xf28f('0x39')](_0x587821[_0xf28f('0x2f')])[_0xf28f('0x23')]+'.pdf','type':_0xf28f('0x3a')})[_0xf28f('0x3b')](function(_0x332826){faxAccount[_0xf28f('0x3c')](_0x1d04d4,{'from':_0x587821[_0xf28f('0x34')],'mapKey':'fax','body':path[_0xf28f('0x39')](_0x587821[_0xf28f('0x2f')])[_0xf28f('0x23')]+'.pdf','AttachmentId':_0x332826['id']})['catch'](function(_0x2c8363){logger[_0xf28f('0x3d')](_0x587821[_0xf28f('0x21')],_0xf28f('0x3e'),JSON[_0xf28f('0x3f')](_0x2c8363));});})['catch'](function(_0x2eccbc){logger[_0xf28f('0x3d')](_0x587821[_0xf28f('0x21')],'\x20receiveFax\x20',JSON['stringify'](_0x2eccbc));});});}logger[_0xf28f('0x24')](_0x587821[_0xf28f('0x21')],_0xf28f('0x40'));}};Fax[_0xf28f('0x1c')][_0xf28f('0x1b')]=function(_0x5d3102){if(this[_0xf28f('0x26')][_0x5d3102[_0xf28f('0x21')]]){_['merge'](this[_0xf28f('0x20')][_0x5d3102[_0xf28f('0x21')]],_['pick'](_0x5d3102,['response',_0xf28f('0x41')]));}};function updateStatus(_0x3929f6){if(_0x3929f6[_0xf28f('0x42')]){faxMessage['update'](_0x3929f6['AttachmentId'],{'failMessage':'SENDING\x20FAILED\x20'})[_0xf28f('0x3b')](function(_0x56a6d8){ut[_0xf28f('0x43')](_0xf28f('0x44'),_0x56a6d8);})[_0xf28f('0x45')](function(_0x2d0528){ut[_0xf28f('0x43')](_0xf28f('0x46'),_0x2d0528);});}else{ut[_0xf28f('0x43')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0xf28f('0x1c')][_0xf28f('0x47')]=function(_0xe48a3a,_0x4a96ee,_0x75289b){var _0x56fb17=this;var _0x22fc85={};if(_0x4a96ee){_0x22fc85={'read':_0x4a96ee};}else{_0x22fc85={'failMessage':_0x75289b};}if(this['actions'][_0xe48a3a][_0xf28f('0x42')]){faxMessage['update'](this['actions'][_0xe48a3a][_0xf28f('0x42')],_0x22fc85)[_0xf28f('0x3b')](function(_0x33de9f){ut[_0xf28f('0x43')](_0xf28f('0x48'),_0x33de9f);})[_0xf28f('0x45')](function(_0x16464d){ut[_0xf28f('0x43')](_0xf28f('0x49'),_0x16464d);})[_0xf28f('0x4a')](function(){delete _0x56fb17['channels'][_0xe48a3a];delete _0x56fb17[_0xf28f('0x26')][_0xe48a3a];});}else{ut[_0xf28f('0x43')]('[Fax][Message][NoUpdate2]');delete this[_0xf28f('0x20')][_0xe48a3a];delete this[_0xf28f('0x26')][_0xe48a3a];}};Fax[_0xf28f('0x1c')][_0xf28f('0x19')]=function(_0xae52b5){var _0x3baf23=this;if(this['channels'][_0xae52b5[_0xf28f('0x21')]]){if(this[_0xf28f('0x26')][_0xae52b5[_0xf28f('0x21')]]){this[_0xf28f('0x20')][_0xae52b5[_0xf28f('0x21')]]['id']=this[_0xf28f('0x26')][_0xae52b5[_0xf28f('0x21')]]['id'];this[_0xf28f('0x20')][_0xae52b5[_0xf28f('0x21')]]['name']=this[_0xf28f('0x26')][_0xae52b5[_0xf28f('0x21')]][_0xf28f('0x23')];}logger[_0xf28f('0x24')](_0xae52b5[_0xf28f('0x21')],this['actions'][_0xae52b5[_0xf28f('0x21')]]?_0xf28f('0x4b'):'\x20hangup\x20faxRiceive\x20',JSON[_0xf28f('0x3f')](this[_0xf28f('0x20')][_0xae52b5[_0xf28f('0x21')]]));if(this[_0xf28f('0x26')][_0xae52b5[_0xf28f('0x21')]]){if(this[_0xf28f('0x20')][_0xae52b5[_0xf28f('0x21')]]['faxpages']>0x0&&this['channels'][_0xae52b5['uniqueid']][_0xf28f('0x16')]===_0xf28f('0x4c')){this['updateStatus'](_0xae52b5['uniqueid'],!![]);}else{this[_0xf28f('0x47')](_0xae52b5[_0xf28f('0x21')],![],this['channels'][_0xae52b5['uniqueid']]['faxstatusstring']?_0xf28f('0x4d')+this[_0xf28f('0x20')][_0xae52b5[_0xf28f('0x21')]][_0xf28f('0x4e')]:_0xf28f('0x4f'));}}}};Fax[_0xf28f('0x1c')]['send']=function(_0x194977){var _0x3a1283=this;return new BPromise(function(_0x4a514f,_0x11eb82){_0x3a1283[_0xf28f('0x50')](_0x194977,_0x3a1283[_0xf28f('0xd')][_0x194977[_0xf28f('0x51')]])[_0xf28f('0x3b')](function(_0x2d4fd7){ut[_0xf28f('0x43')]('[Fax][execOriginate][success]',_0x2d4fd7);_0x4a514f(ut[_0xf28f('0x37')]('Fax\x20received'));})[_0xf28f('0x45')](function(_0x5b0a1a){ut[_0xf28f('0x43')](_0xf28f('0x52'),_0x5b0a1a);updateStatus(_0x194977);_0x11eb82(ut['message']('Fax\x20failed'));});});};Fax[_0xf28f('0x1c')][_0xf28f('0x53')]=function(_0x4e5188){var _0x4f765c=this;return new BPromise(function(_0x1db0df,_0x3c63cb){var _0x4c4d66=_0x4f765c[_0xf28f('0x54')](_0x4f765c[_0xf28f('0xd')][_0x4e5188[_0xf28f('0x51')]][_0xf28f('0x55')],_0x4e5188);if(_0x4c4d66[_0xf28f('0x56')]){_0x1db0df(ut[_0xf28f('0x37')](_0xf28f('0x57')));}else{_0x3c63cb(ut[_0xf28f('0x37')](_0x4c4d66[_0xf28f('0x37')]));}});};function originate(_0x16fdc9,_0x59a2e1,_0x47b669){return new BPromise(function(_0x2b013c,_0x13d7e3){if(_0x47b669){var _0x2ce90d=util[_0xf28f('0x58')](_0xf28f('0x59'),path[_0xf28f('0x39')](_0x16fdc9[_0xf28f('0x3')])[_0xf28f('0x23')],_0x16fdc9[_0xf28f('0x3')]);gs[_0xf28f('0x5a')](_0x2ce90d)['then'](function(){_0x16fdc9['path']=util[_0xf28f('0x58')](_0xf28f('0x5b'),path[_0xf28f('0x39')](_0x16fdc9[_0xf28f('0x3')])[_0xf28f('0x5c')],path[_0xf28f('0x39')](_0x16fdc9[_0xf28f('0x3')])['name']);_0x59a2e1[_0xf28f('0x5d')]=_0x16fdc9[_0xf28f('0x3')];ut[_0xf28f('0x43')](_0xf28f('0x5e'),'');ami[_0xf28f('0x5f')](ut[_0xf28f('0x60')](_0x16fdc9,_0x59a2e1))['then'](function(_0x12641e){_0x2b013c(_0x12641e);})[_0xf28f('0x45')](function(_0x23c9ef){_0x13d7e3(_0x23c9ef);});})[_0xf28f('0x45')](function(_0xdb08a6){_0x13d7e3(_0xdb08a6);});}else{ami[_0xf28f('0x5f')](ut['variablesAction'](_0x16fdc9,_0x59a2e1))[_0xf28f('0x3b')](function(_0x5dc9dc){_0x2b013c(_0x5dc9dc);})[_0xf28f('0x45')](function(_0x139888){_0x13d7e3(_0x139888);});}});}Fax['prototype'][_0xf28f('0x50')]=function(_0x14a7b3,_0x10e3fc){var _0x1ce680=this;return new BPromise(function(_0x54d4bf,_0x381609){var _0x592087=uuid['v4']();var _0x385b7a=ut[_0xf28f('0x61')](_0x14a7b3,_0x10e3fc);_0x1ce680[_0xf28f('0x26')][_0x592087]=new Action(_0x592087,_0x10e3fc,_0x14a7b3);var _0x6a9a91=_0x1ce680[_0xf28f('0x26')][_0x592087];if(path[_0xf28f('0x39')](_0x14a7b3[_0xf28f('0x3')])['ext']==='.pdf'){originate(_0x6a9a91,_0x385b7a,!![])[_0xf28f('0x3b')](function(_0x61db75){_0x54d4bf(_0x61db75);})[_0xf28f('0x45')](function(_0xbbbe4){_0x381609(_0xbbbe4);});}else{originate(_0x6a9a91,_0x385b7a,![])[_0xf28f('0x3b')](function(_0x3e3cb0){_0x54d4bf(_0x3e3cb0);})[_0xf28f('0x45')](function(_0x4e99de){_0x381609(_0x4e99de);});}});};Fax[_0xf28f('0x1c')][_0xf28f('0x62')]=function(_0x125f2c){return!_[_0xf28f('0x63')](_0x125f2c)&&!_[_0xf28f('0x63')](_0x125f2c[_0xf28f('0x23')])&&!_[_0xf28f('0x63')](_0x125f2c[_0xf28f('0x64')])&&_0x125f2c[_0xf28f('0x64')]&&!_['isNil'](this[_0xf28f('0x65')][util[_0xf28f('0x58')](_0xf28f('0x66'),_0x125f2c[_0xf28f('0x23')])])&&!_[_0xf28f('0x63')](this['trunks'][util[_0xf28f('0x58')]('SIP/%s',_0x125f2c[_0xf28f('0x23')])][_0xf28f('0x2d')])&&(this[_0xf28f('0x65')][util[_0xf28f('0x58')](_0xf28f('0x66'),_0x125f2c[_0xf28f('0x23')])][_0xf28f('0x2d')]===_0xf28f('0x67')||this[_0xf28f('0x65')][util[_0xf28f('0x58')](_0xf28f('0x66'),_0x125f2c[_0xf28f('0x23')])][_0xf28f('0x2d')]===_0xf28f('0x68'));};Fax['prototype']['checkTrunk']=function(_0x201159,_0x22a078){if(!this['isTrunkReachable'](_0x201159)){ut[_0xf28f('0x43')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0xf28f('0x63')](_0x201159)?'':_0x201159[_0xf28f('0x23')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0xf28f('0x69')};}if(_[_0xf28f('0x63')](_0x22a078[_0xf28f('0x6a')])){ut[_0xf28f('0x43')](_0xf28f('0x6b'),JSON['stringify'](_0x22a078));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0xf28f('0x63')](_0x22a078[_0xf28f('0x3')])){ut['logger'](_0xf28f('0x6c'),JSON[_0xf28f('0x3f')](_0x22a078));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0xf28f('0x6d')};};module['exports']=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index c9220d5..1e11a8b 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 _0x2521=['preview','lodash','notify','resolve','then','[Notify]\x20','util','bluebird','../../../config/logger'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x2521,0x138));var _0x1252=function(_0x102f97,_0x5bda2f){_0x102f97=_0x102f97-0x0;var _0xd22058=_0x2521[_0x102f97];return _0xd22058;};'use strict';var util=require(_0x1252('0x0'));var BPromise=require(_0x1252('0x1'));var logger=require(_0x1252('0x2'))(_0x1252('0x3'));var _=require(_0x1252('0x4'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x3fb678){return function(_0x4c4461){logger['error'](_0x3fb678,util['inspect'](_0x4c4461,{'showHidden':![],'depth':null}));};}exports[_0x1252('0x5')]=function(_0x50cd30,_0x179ea6){return BPromise[_0x1252('0x6')]()[_0x1252('0x7')](faxAccount['notify'](_0x50cd30,_0x179ea6))['catch'](loggerCatch(_0x1252('0x8')));}; \ No newline at end of file +var _0xc787=['error','notify','resolve','then','catch','[Notify]\x20','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount'];(function(_0x74f73,_0x2acc98){var _0x3827c2=function(_0x22acbf){while(--_0x22acbf){_0x74f73['push'](_0x74f73['shift']());}};_0x3827c2(++_0x2acc98);}(_0xc787,0x69));var _0x7c78=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xc787[_0x4243a3];return _0x1b2a33;};'use strict';var util=require('util');var BPromise=require(_0x7c78('0x0'));var logger=require(_0x7c78('0x1'))(_0x7c78('0x2'));var _=require(_0x7c78('0x3'));var faxAccount=require(_0x7c78('0x4'));function loggerCatch(_0x1d2f59){return function(_0x406352){logger[_0x7c78('0x5')](_0x1d2f59,util['inspect'](_0x406352,{'showHidden':![],'depth':null}));};}exports[_0x7c78('0x6')]=function(_0x40445f,_0x3ede95){return BPromise[_0x7c78('0x7')]()[_0x7c78('0x8')](faxAccount['notify'](_0x40445f,_0x3ede95))[_0x7c78('0x9')](loggerCatch(_0x7c78('0xa')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index d223568..f5da40b 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 _0xd22b=['info','Exec\x20gs','util','fax','child_process','exec','execute'];(function(_0xd8768,_0x3fedcb){var _0x46228f=function(_0x65a836){while(--_0x65a836){_0xd8768['push'](_0xd8768['shift']());}};_0x46228f(++_0x3fedcb);}(_0xd22b,0x113));var _0xbd22=function(_0x5a9319,_0x1e8a58){_0x5a9319=_0x5a9319-0x0;var _0x35f131=_0xd22b[_0x5a9319];return _0x35f131;};'use strict';var util=require(_0xbd22('0x0'));var logger=require('../../../../config/logger')(_0xbd22('0x1'));var BPromise=require('bluebird');var exec=require(_0xbd22('0x2'))[_0xbd22('0x3')];exports[_0xbd22('0x4')]=function(_0x19e131){return new BPromise(function(_0x4027cc,_0x2b7883){exec(_0x19e131,function(_0x2d2146,_0x3ffd81,_0x305730){logger[_0xbd22('0x5')]('Exec\x20gs',_0x3ffd81);if(_0x2d2146){logger[_0xbd22('0x5')](_0xbd22('0x6'),'\x20Error\x20:',util['inspect'](_0x2d2146,{'showHidden':![],'depth':null}),_0x3ffd81,_0x305730);_0x2b7883(_0x2d2146);}_0x4027cc(_0x3ffd81);});});}; \ No newline at end of file +var _0x868e=['util','fax','bluebird','child_process','exec','info','Exec\x20gs','\x20Error\x20:'];(function(_0x48a8ea,_0xbcba72){var _0x121dcc=function(_0x19007c){while(--_0x19007c){_0x48a8ea['push'](_0x48a8ea['shift']());}};_0x121dcc(++_0xbcba72);}(_0x868e,0x1c8));var _0xe868=function(_0x57ab74,_0x24e54b){_0x57ab74=_0x57ab74-0x0;var _0x1b4bff=_0x868e[_0x57ab74];return _0x1b4bff;};'use strict';var util=require(_0xe868('0x0'));var logger=require('../../../../config/logger')(_0xe868('0x1'));var BPromise=require(_0xe868('0x2'));var exec=require(_0xe868('0x3'))[_0xe868('0x4')];exports['execute']=function(_0x54d9b9){return new BPromise(function(_0x5d97e2,_0x1a27d7){exec(_0x54d9b9,function(_0x29572b,_0x39c1f3,_0xd7eb85){logger[_0xe868('0x5')](_0xe868('0x6'),_0x39c1f3);if(_0x29572b){logger[_0xe868('0x5')](_0xe868('0x6'),_0xe868('0x7'),util['inspect'](_0x29572b,{'showHidden':![],'depth':null}),_0x39c1f3,_0xd7eb85);_0x1a27d7(_0x29572b);}_0x5d97e2(_0x39c1f3);});});}; \ 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 ff2efb7..c343f10 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 _0xc7a2=['minrate','format','\x22%s\x22','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','uniqueid','originate','\x22%s\x22\x20<%s>','headerinfo','util','moment','message','info','inspect','addVariables','ecm'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xc7a2,0x1c5));var _0x2c7a=function(_0x2c654f,_0x11ce94){_0x2c654f=_0x2c654f-0x0;var _0xa53d15=_0xc7a2[_0x2c654f];return _0xa53d15;};'use strict';var util=require(_0x2c7a('0x0'));var _=require('lodash');var moment=require(_0x2c7a('0x1'));var logger=require('../../../../config/logger')('fax');exports[_0x2c7a('0x2')]=function(_0x5ec58e){return{'message':_0x5ec58e};};exports['logger']=function(_0xae4fb,_0x5e767c){logger[_0x2c7a('0x3')](_0xae4fb,util[_0x2c7a('0x4')](_0x5e767c,{'showHidden':![],'depth':null}));};exports[_0x2c7a('0x5')]=function(_0x10adbd,_0x1c801e){var _0x48307c={'XMF-ECM':_0x1c801e[_0x2c7a('0x6')],'XMF-HEADERINFO':_0x1c801e['headerinfo'],'XMF-MINRATE':_0x1c801e[_0x2c7a('0x7')],'XMF-MAXRATE':_0x1c801e['maxrate'],'XMF-MODEM':util[_0x2c7a('0x8')](_0x2c7a('0x9'),_0x1c801e['modem']),'XMF-GATEWAY':_0x1c801e[_0x2c7a('0xa')],'XMF-FAXDETECT':_0x1c801e[_0x2c7a('0xb')],'XMF-T38TIMEOUT':_0x1c801e[_0x2c7a('0xc')],'XMF-LOCALSTATIONID':_0x1c801e[_0x2c7a('0xd')],'XMF-PATH':_0x10adbd[_0x2c7a('0xe')]};return _0x48307c;};exports[_0x2c7a('0xf')]=function(_0x1f6685,_0x4d27d8){return{'actionid':_0x1f6685[_0x2c7a('0x10')],'action':_0x2c7a('0x11'),'channel':_0x1f6685['channel'],'Exten':'xcally-motion-fax','Context':'from-sip','Priority':'1','callerid':util[_0x2c7a('0x8')](_0x2c7a('0x12'),_0x1f6685[_0x2c7a('0x13')]?_0x1f6685[_0x2c7a('0x13')]:'',_0x1f6685[_0x2c7a('0xd')]),'variable':_0x4d27d8,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x1f6685[_0x2c7a('0x10')]};}; \ No newline at end of file +var _0xcc78=['\x22%s\x22\x20<%s>','headerinfo','util','lodash','moment','../../../../config/logger','message','logger','info','inspect','addVariables','ecm','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','variablesAction','uniqueid','originate','channel','xcally-motion-fax','from-sip'];(function(_0x183238,_0x312786){var _0x4d89a6=function(_0x403096){while(--_0x403096){_0x183238['push'](_0x183238['shift']());}};_0x4d89a6(++_0x312786);}(_0xcc78,0x120));var _0x8cc7=function(_0x3c0fde,_0x2cd91c){_0x3c0fde=_0x3c0fde-0x0;var _0xc46888=_0xcc78[_0x3c0fde];return _0xc46888;};'use strict';var util=require(_0x8cc7('0x0'));var _=require(_0x8cc7('0x1'));var moment=require(_0x8cc7('0x2'));var logger=require(_0x8cc7('0x3'))('fax');exports[_0x8cc7('0x4')]=function(_0x315339){return{'message':_0x315339};};exports[_0x8cc7('0x5')]=function(_0x7aa92d,_0x28abf3){logger[_0x8cc7('0x6')](_0x7aa92d,util[_0x8cc7('0x7')](_0x28abf3,{'showHidden':![],'depth':null}));};exports[_0x8cc7('0x8')]=function(_0x4fd62c,_0x458191){var _0x309a74={'XMF-ECM':_0x458191[_0x8cc7('0x9')],'XMF-HEADERINFO':_0x458191['headerinfo'],'XMF-MINRATE':_0x458191['minrate'],'XMF-MAXRATE':_0x458191[_0x8cc7('0xa')],'XMF-MODEM':util[_0x8cc7('0xb')](_0x8cc7('0xc'),_0x458191[_0x8cc7('0xd')]),'XMF-GATEWAY':_0x458191[_0x8cc7('0xe')],'XMF-FAXDETECT':_0x458191[_0x8cc7('0xf')],'XMF-T38TIMEOUT':_0x458191[_0x8cc7('0x10')],'XMF-LOCALSTATIONID':_0x458191[_0x8cc7('0x11')],'XMF-PATH':_0x4fd62c['path']};return _0x309a74;};exports[_0x8cc7('0x12')]=function(_0x368520,_0x1bc135){return{'actionid':_0x368520[_0x8cc7('0x13')],'action':_0x8cc7('0x14'),'channel':_0x368520[_0x8cc7('0x15')],'Exten':_0x8cc7('0x16'),'Context':_0x8cc7('0x17'),'Priority':'1','callerid':util[_0x8cc7('0xb')](_0x8cc7('0x18'),_0x368520['headerinfo']?_0x368520[_0x8cc7('0x19')]:'',_0x368520[_0x8cc7('0x11')]),'variable':_0x1bc135,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x368520[_0x8cc7('0x13')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 8eeebb0..b045770 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 _0xc435=['initDynamics365Accounts','getCampaigns','initCampaigns','initVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','log','listen','sync','bluebird','./server','./realtime','./report','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','getAgents','then','initAgents','getTelephones','getTrunks','initTrunks','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','initVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts'];(function(_0x248b16,_0x50d61b){var _0x2fbfe8=function(_0x332262){while(--_0x332262){_0x248b16['push'](_0x248b16['shift']());}};_0x2fbfe8(++_0x50d61b);}(_0xc435,0xd7));var _0x5c43=function(_0x22f724,_0x547ff5){_0x22f724=_0x22f724-0x0;var _0x6a15cb=_0xc435[_0x22f724];return _0x6a15cb;};'use strict';var BPromise=require(_0x5c43('0x0'));var util=require('util');var moment=require('moment');var server=require(_0x5c43('0x1'));var Realtime=require(_0x5c43('0x2'));var Report=require(_0x5c43('0x3'));var Acw=require('./acw');var Trigger=require('./trigger');var Dialer=require(_0x5c43('0x4'));var Preview=require(_0x5c43('0x5'));var Fax=require(_0x5c43('0x6'));var user=require(_0x5c43('0x7'));var voiceQueue=require(_0x5c43('0x8'));var voiceQueueReport=require(_0x5c43('0x9'));var voiceCallReport=require(_0x5c43('0xa'));var trunk=require(_0x5c43('0xb'));var trigger=require(_0x5c43('0xc'));var template=require(_0x5c43('0xd'));var cmHopperHistory=require(_0x5c43('0xe'));var campaign=require(_0x5c43('0xf'));var voiceExtension=require(_0x5c43('0x10'));var faxAccount=require(_0x5c43('0x11'));var zendesk=require(_0x5c43('0x12'));var salesforce=require(_0x5c43('0x13'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require('./rpc/integrations/freshdesk');var desk=require('./rpc/integrations/desk');var zoho=require(_0x5c43('0x14'));var vtiger=require(_0x5c43('0x15'));var freshsales=require(_0x5c43('0x16'));var servicenow=require(_0x5c43('0x17'));var dynamics365=require(_0x5c43('0x18'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x5c43('0x19')](_0x5c43('0x1a'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x5c43('0x19')](_0x5c43('0x1a'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()['then'](user[_0x5c43('0x1b')]())[_0x5c43('0x1c')](realtime[_0x5c43('0x1d')]())['then'](user[_0x5c43('0x1e')]())[_0x5c43('0x1c')](realtime['initTelephones']())[_0x5c43('0x1c')](trunk[_0x5c43('0x1f')]())['then'](realtime[_0x5c43('0x20')]())[_0x5c43('0x1c')](voiceQueue['getVoiceQueues']())[_0x5c43('0x1c')](realtime[_0x5c43('0x21')]())[_0x5c43('0x1c')](trigger[_0x5c43('0x22')]())[_0x5c43('0x1c')](realtime[_0x5c43('0x23')]())[_0x5c43('0x1c')](template[_0x5c43('0x24')]())[_0x5c43('0x1c')](realtime[_0x5c43('0x25')]())['then'](zendesk[_0x5c43('0x26')]())[_0x5c43('0x1c')](realtime[_0x5c43('0x27')]())['then'](salesforce[_0x5c43('0x28')]())[_0x5c43('0x1c')](realtime['initSalesforceAccounts']())[_0x5c43('0x1c')](sugarcrm[_0x5c43('0x29')]())[_0x5c43('0x1c')](realtime['initSugarcrmAccounts']())[_0x5c43('0x1c')](freshdesk[_0x5c43('0x2a')]())[_0x5c43('0x1c')](realtime[_0x5c43('0x2b')]())[_0x5c43('0x1c')](desk[_0x5c43('0x2c')]())[_0x5c43('0x1c')](realtime[_0x5c43('0x2d')]())[_0x5c43('0x1c')](zoho[_0x5c43('0x2e')]())[_0x5c43('0x1c')](realtime[_0x5c43('0x2f')]())[_0x5c43('0x1c')](vtiger['getVtigerAccounts']())[_0x5c43('0x1c')](realtime[_0x5c43('0x30')]())[_0x5c43('0x1c')](freshsales['getFreshsalesAccounts']())[_0x5c43('0x1c')](realtime[_0x5c43('0x31')]())[_0x5c43('0x1c')](servicenow[_0x5c43('0x32')]())['then'](realtime[_0x5c43('0x33')]())['then'](dynamics365[_0x5c43('0x34')]())['then'](realtime[_0x5c43('0x35')]())['then'](campaign[_0x5c43('0x36')]())['then'](realtime[_0x5c43('0x37')]())[_0x5c43('0x1c')](voiceExtension['getVoiceExtensions']())[_0x5c43('0x1c')](realtime[_0x5c43('0x38')]())[_0x5c43('0x1c')](faxAccount[_0x5c43('0x39')]())['then'](realtime[_0x5c43('0x3a')]())[_0x5c43('0x1c')](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0x5c43('0x1c')](voiceQueueReport['getVoiceQueueReports']())[_0x5c43('0x1c')](realtime[_0x5c43('0x3b')]())[_0x5c43('0x1c')](cmHopperHistory['getVoiceQueueHopperHistory']())['then'](realtime[_0x5c43('0x3c')]())[_0x5c43('0x1c')](cmHopperHistory[_0x5c43('0x3d')]())[_0x5c43('0x1c')](realtime['initCampaignHopperHistory']())[_0x5c43('0x1c')](voiceCallReport[_0x5c43('0x3e')]())[_0x5c43('0x1c')](realtime[_0x5c43('0x3f')]())['then'](function(_0x41591f){})['catch'](function(_0xb739af){console[_0x5c43('0x40')](_0xb739af);});}function main(){return server[_0x5c43('0x41')](realtime,preview,fax)[_0x5c43('0x1c')](function(_0x56aae3){return initRealtime();})['then'](function(){return initParams();})[_0x5c43('0x1c')](function(){report[_0x5c43('0x42')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x403b95){console[_0x5c43('0x40')](_0x403b95);});}main(); \ No newline at end of file +var _0xdbbe=['initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','initCampaignHopperHistory','getVoiceCallReports','catch','log','listen','sync','bluebird','util','moment','./realtime','./report','./trigger','./dialer','./fax','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','then','getAgents','initTelephones','getTrunks','initTrunks','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','initFreshdeskAccounts','getDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','getDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','initFaxAccounts','getVoiceQueueReports'];(function(_0x3eef9a,_0x46c8a5){var _0x24ebd5=function(_0x4dabee){while(--_0x4dabee){_0x3eef9a['push'](_0x3eef9a['shift']());}};_0x24ebd5(++_0x46c8a5);}(_0xdbbe,0x183));var _0xedbb=function(_0x1098db,_0x39ba6b){_0x1098db=_0x1098db-0x0;var _0x14f090=_0xdbbe[_0x1098db];return _0x14f090;};'use strict';var BPromise=require(_0xedbb('0x0'));var util=require(_0xedbb('0x1'));var moment=require(_0xedbb('0x2'));var server=require('./server');var Realtime=require(_0xedbb('0x3'));var Report=require(_0xedbb('0x4'));var Acw=require('./acw');var Trigger=require(_0xedbb('0x5'));var Dialer=require(_0xedbb('0x6'));var Preview=require('./preview');var Fax=require(_0xedbb('0x7'));var user=require('./rpc/user');var voiceQueue=require(_0xedbb('0x8'));var voiceQueueReport=require(_0xedbb('0x9'));var voiceCallReport=require(_0xedbb('0xa'));var trunk=require(_0xedbb('0xb'));var trigger=require('./rpc/trigger');var template=require('./rpc/template');var cmHopperHistory=require(_0xedbb('0xc'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0xedbb('0xd'));var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0xedbb('0xe'));var salesforce=require(_0xedbb('0xf'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require('./rpc/integrations/freshdesk');var desk=require('./rpc/integrations/desk');var zoho=require(_0xedbb('0x10'));var vtiger=require(_0xedbb('0x11'));var freshsales=require(_0xedbb('0x12'));var servicenow=require(_0xedbb('0x13'));var dynamics365=require(_0xedbb('0x14'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xedbb('0x15')](_0xedbb('0x16'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xedbb('0x15')](_0xedbb('0x16'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xedbb('0x17')]()[_0xedbb('0x18')](user[_0xedbb('0x19')]())[_0xedbb('0x18')](realtime['initAgents']())[_0xedbb('0x18')](user['getTelephones']())[_0xedbb('0x18')](realtime[_0xedbb('0x1a')]())[_0xedbb('0x18')](trunk[_0xedbb('0x1b')]())[_0xedbb('0x18')](realtime[_0xedbb('0x1c')]())[_0xedbb('0x18')](voiceQueue['getVoiceQueues']())[_0xedbb('0x18')](realtime[_0xedbb('0x1d')]())[_0xedbb('0x18')](trigger[_0xedbb('0x1e')]())['then'](realtime[_0xedbb('0x1f')]())[_0xedbb('0x18')](template[_0xedbb('0x20')]())[_0xedbb('0x18')](realtime[_0xedbb('0x21')]())[_0xedbb('0x18')](zendesk[_0xedbb('0x22')]())['then'](realtime[_0xedbb('0x23')]())[_0xedbb('0x18')](salesforce['getSalesforceAccounts']())[_0xedbb('0x18')](realtime[_0xedbb('0x24')]())[_0xedbb('0x18')](sugarcrm[_0xedbb('0x25')]())[_0xedbb('0x18')](realtime[_0xedbb('0x26')]())[_0xedbb('0x18')](freshdesk['getFreshdeskAccounts']())[_0xedbb('0x18')](realtime[_0xedbb('0x27')]())[_0xedbb('0x18')](desk[_0xedbb('0x28')]())[_0xedbb('0x18')](realtime['initDeskAccounts']())[_0xedbb('0x18')](zoho[_0xedbb('0x29')]())[_0xedbb('0x18')](realtime[_0xedbb('0x2a')]())[_0xedbb('0x18')](vtiger[_0xedbb('0x2b')]())['then'](realtime['initVtigerAccounts']())[_0xedbb('0x18')](freshsales[_0xedbb('0x2c')]())[_0xedbb('0x18')](realtime[_0xedbb('0x2d')]())['then'](servicenow[_0xedbb('0x2e')]())[_0xedbb('0x18')](realtime['initServicenowAccounts']())['then'](dynamics365[_0xedbb('0x2f')]())[_0xedbb('0x18')](realtime['initDynamics365Accounts']())[_0xedbb('0x18')](campaign[_0xedbb('0x30')]())['then'](realtime[_0xedbb('0x31')]())[_0xedbb('0x18')](voiceExtension[_0xedbb('0x32')]())[_0xedbb('0x18')](realtime[_0xedbb('0x33')]())['then'](faxAccount['getFaxAccounts']())[_0xedbb('0x18')](realtime[_0xedbb('0x34')]())['then'](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0xedbb('0x18')](voiceQueueReport[_0xedbb('0x35')]())[_0xedbb('0x18')](realtime[_0xedbb('0x36')]())['then'](cmHopperHistory[_0xedbb('0x37')]())[_0xedbb('0x18')](realtime[_0xedbb('0x38')]())['then'](cmHopperHistory['getCampaignHopperHistory']())['then'](realtime[_0xedbb('0x39')]())['then'](voiceCallReport[_0xedbb('0x3a')]())['then'](realtime['initVoiceCallReports']())[_0xedbb('0x18')](function(_0x45dcdb){})[_0xedbb('0x3b')](function(_0x2628fb){console[_0xedbb('0x3c')](_0x2628fb);});}function main(){return server[_0xedbb('0x3d')](realtime,preview,fax)[_0xedbb('0x18')](function(_0x3993f2){return initRealtime();})[_0xedbb('0x18')](function(){return initParams();})['then'](function(){report[_0xedbb('0x3e')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x3bef07){console['log'](_0x3bef07);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 9c2f64e..ea7aa7b 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 _0x0713=['idle','inuse','talking','voiceStatusTime','toNumber','format','voiceStatusQueue','stringify','user:%s','emit','user:save','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusCallerIdNumber','onhold','local','prototype','state','toLowerCase','not_inuse'];(function(_0x218267,_0x17c7f8){var _0x1d1abd=function(_0x3fd2be){while(--_0x3fd2be){_0x218267['push'](_0x218267['shift']());}};_0x1d1abd(++_0x17c7f8);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var md5=require(_0x3071('0x1'));var Redis=require(_0x3071('0x2'));var config=require(_0x3071('0x3'));config[_0x3071('0x4')]=_['defaults'](config[_0x3071('0x4')],{'host':_0x3071('0x5'),'port':0x18eb});var io=require(_0x3071('0x6'))(new Redis(config[_0x3071('0x4')]));function Agent(_0xabd7b6){this['id']=_0xabd7b6['id']||0x0;this[_0x3071('0x7')]=_0xabd7b6[_0x3071('0x7')]||'';this[_0x3071('0x8')]=_0xabd7b6[_0x3071('0x8')]||'';this[_0x3071('0x9')]=_0xabd7b6[_0x3071('0x9')]||'';this[_0x3071('0xa')]=_0xabd7b6[_0x3071('0xa')]||'';this['state']=_0x3071('0xb');this[_0x3071('0xc')]=0x0;this[_0x3071('0xd')]=_0x3071('0xb');this[_0x3071('0xe')]='';this['phone']='';this[_0x3071('0xf')]='';this[_0x3071('0x10')]='';this[_0x3071('0x11')]=_0xabd7b6[_0x3071('0x11')]||![];this[_0x3071('0x12')]='unknown';this['voiceStatusTime']=0x0;this[_0x3071('0x13')]='';this['voiceStatusQueue']='';this[_0x3071('0x14')]=![];this[_0x3071('0x15')]=![];this['md5']='';}Agent[_0x3071('0x16')]['updateStatusRealtime']=function(_0x2fc15d){var _0x45c93b;if(_0x2fc15d&&_0x2fc15d[_0x3071('0x17')]){_0x45c93b=_0x2fc15d[_0x3071('0x17')][_0x3071('0x18')]();switch(_0x45c93b){case _0x3071('0x19'):_0x45c93b=_0x3071('0x1a');break;case _0x3071('0x1b'):_0x45c93b=_0x3071('0x1c');break;}}if(_0x45c93b&&this[_0x3071('0x12')]!==_0x45c93b||_0x2fc15d['statePause']){this[_0x3071('0x1d')]=_[_0x3071('0x1e')](moment()[_0x3071('0x1f')]('x'));}if(_0x45c93b){this[_0x3071('0x12')]=_0x45c93b;}var _0x3acf0e={'id':this['id'],'name':this[_0x3071('0x7')],'email':this[_0x3071('0x8')],'accountcode':this[_0x3071('0x9')],'fullname':this['fullname'],'state':this[_0x3071('0x17')],'stateTime':this[_0x3071('0xc')],'status':this[_0x3071('0xd')],'address':this['address'],'online':this[_0x3071('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x3071('0x1d')],'voiceStatusCallerIdNumber':this[_0x3071('0x13')],'voiceStatusQueue':this[_0x3071('0x20')],'interface':this[_0x3071('0x10')],'onhold':this[_0x3071('0x14')]};var _0x34c50e=md5(JSON[_0x3071('0x21')](_0x3acf0e));if(this[_0x3071('0x1')]!==_0x34c50e){this['md5']=_0x34c50e;io['to'](util['format'](_0x3071('0x22'),_0x3acf0e[_0x3071('0x7')]))[_0x3071('0x23')](_0x3071('0x24'),_0x3acf0e);io[_0x3071('0x23')](_0x3071('0x25'),_0x3acf0e);}};module[_0x3071('0x26')]=Agent; \ No newline at end of file +var _0xedd9=['phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','prototype','updateStatusRealtime','state','toLowerCase','idle','inuse','talking','statePause','toNumber','interface','format','user:%s','user:save','emit','user:presence','exports','util','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','unknown','status'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xedd9,0xfc));var _0x9edd=function(_0xd654be,_0x55ef7c){_0xd654be=_0xd654be-0x0;var _0x22cfb8=_0xedd9[_0xd654be];return _0x22cfb8;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var md5=require(_0x9edd('0x2'));var Redis=require(_0x9edd('0x3'));var config=require(_0x9edd('0x4'));config[_0x9edd('0x5')]=_[_0x9edd('0x6')](config[_0x9edd('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x9edd('0x7'))(new Redis(config[_0x9edd('0x5')]));function Agent(_0x268f9e){this['id']=_0x268f9e['id']||0x0;this[_0x9edd('0x8')]=_0x268f9e['name']||'';this[_0x9edd('0x9')]=_0x268f9e['email']||'';this[_0x9edd('0xa')]=_0x268f9e[_0x9edd('0xa')]||'';this[_0x9edd('0xb')]=_0x268f9e[_0x9edd('0xb')]||'';this['state']=_0x9edd('0xc');this['stateTime']=0x0;this[_0x9edd('0xd')]=_0x9edd('0xc');this['address']='';this[_0x9edd('0xe')]='';this[_0x9edd('0xf')]='';this['interface']='';this[_0x9edd('0x10')]=_0x268f9e[_0x9edd('0x10')]||![];this[_0x9edd('0x11')]=_0x9edd('0xc');this[_0x9edd('0x12')]=0x0;this[_0x9edd('0x13')]='';this[_0x9edd('0x14')]='';this[_0x9edd('0x15')]=![];this['local']=![];this[_0x9edd('0x2')]='';}Agent[_0x9edd('0x16')][_0x9edd('0x17')]=function(_0x4d9a7){var _0x13b6b6;if(_0x4d9a7&&_0x4d9a7[_0x9edd('0x18')]){_0x13b6b6=_0x4d9a7[_0x9edd('0x18')][_0x9edd('0x19')]();switch(_0x13b6b6){case'not_inuse':_0x13b6b6=_0x9edd('0x1a');break;case _0x9edd('0x1b'):_0x13b6b6=_0x9edd('0x1c');break;}}if(_0x13b6b6&&this['voiceStatus']!==_0x13b6b6||_0x4d9a7[_0x9edd('0x1d')]){this[_0x9edd('0x12')]=_[_0x9edd('0x1e')](moment()['format']('x'));}if(_0x13b6b6){this[_0x9edd('0x11')]=_0x13b6b6;}var _0x5d879c={'id':this['id'],'name':this[_0x9edd('0x8')],'email':this[_0x9edd('0x9')],'accountcode':this['accountcode'],'fullname':this['fullname'],'state':this[_0x9edd('0x18')],'stateTime':this['stateTime'],'status':this[_0x9edd('0xd')],'address':this['address'],'online':this['online'],'voiceStatus':this[_0x9edd('0x11')],'voiceStatusTime':this[_0x9edd('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0x9edd('0x1f')],'onhold':this[_0x9edd('0x15')]};var _0x477878=md5(JSON['stringify'](_0x5d879c));if(this[_0x9edd('0x2')]!==_0x477878){this[_0x9edd('0x2')]=_0x477878;io['to'](util[_0x9edd('0x20')](_0x9edd('0x21'),_0x5d879c[_0x9edd('0x8')]))['emit'](_0x9edd('0x22'),_0x5d879c);io[_0x9edd('0x23')](_0x9edd('0x24'),_0x5d879c);}};module[_0x9edd('0x25')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index e7b6d4b..489d5d1 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 _0xc386=['name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength'];(function(_0x2946ba,_0x3256a3){var _0x31458f=function(_0xc47568){while(--_0xc47568){_0x2946ba['push'](_0x2946ba['shift']());}};_0x31458f(++_0x3256a3);}(_0xc386,0xc4));var _0x6c38=function(_0x4c5eff,_0x1a6f74){_0x4c5eff=_0x4c5eff-0x0;var _0x5aa9c7=_0xc386[_0x4c5eff];return _0x5aa9c7;};'use strict';function Campaign(_0x3a9166){this['id']=_0x3a9166['id']||0x0;this[_0x6c38('0x0')]=_0x3a9166['name']||'';this[_0x6c38('0x1')]=_0x3a9166[_0x6c38('0x1')]||_0x6c38('0x2');this[_0x6c38('0x3')]=0x0;this[_0x6c38('0x4')]=0x0;this[_0x6c38('0x5')]=0x0;this[_0x6c38('0x6')]=0x0;this['message']='';this[_0x6c38('0x7')]=!![];this[_0x6c38('0x8')]=_0x3a9166['active'];this[_0x6c38('0x9')]=_0x3a9166[_0x6c38('0x9')];this[_0x6c38('0xa')]=_0x3a9166['dialTimezone']||null;this[_0x6c38('0xb')]=_0x3a9166['dialGlobalInterval']?_0x3a9166[_0x6c38('0xb')]:null;this[_0x6c38('0xc')]=_0x3a9166[_0x6c38('0xc')];this[_0x6c38('0xd')]=_0x3a9166[_0x6c38('0xd')];this[_0x6c38('0xe')]=_0x3a9166[_0x6c38('0xe')]||0x1e;this['dialCongestionMaxRetry']=_0x3a9166[_0x6c38('0xf')];this[_0x6c38('0x10')]=_0x3a9166[_0x6c38('0x10')];this[_0x6c38('0x11')]=_0x3a9166[_0x6c38('0x11')];this[_0x6c38('0x12')]=_0x3a9166['dialBusyRetryFrequency'];this[_0x6c38('0x13')]=_0x3a9166['dialNoAnswerMaxRetry'];this[_0x6c38('0x14')]=_0x3a9166[_0x6c38('0x14')];this[_0x6c38('0x15')]=_0x3a9166[_0x6c38('0x15')];this[_0x6c38('0x16')]=_0x3a9166[_0x6c38('0x16')]||0x3;this[_0x6c38('0x17')]=_0x3a9166[_0x6c38('0x17')]||0x96;this[_0x6c38('0x18')]=_0x3a9166['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x3a9166['dialDropRetryFrequency']||0x96;this[_0x6c38('0x19')]=_0x3a9166['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x3a9166[_0x6c38('0x1a')]||0x96;this[_0x6c38('0x1b')]=_0x3a9166[_0x6c38('0x1b')]||0x3;this[_0x6c38('0x1c')]=_0x3a9166[_0x6c38('0x1c')]||0x96;this[_0x6c38('0x1d')]=_0x3a9166[_0x6c38('0x1d')]||0x3;this[_0x6c38('0x1e')]=_0x3a9166['dialAgentRejectRetryFrequency']||0x96;this[_0x6c38('0x1f')]=_0x3a9166[_0x6c38('0x1f')]||_0x6c38('0x20');this[_0x6c38('0x21')]=_0x3a9166[_0x6c38('0x21')]||undefined;this[_0x6c38('0x22')]=_0x3a9166['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x6c38('0x23')]=_0x3a9166[_0x6c38('0x23')]||undefined;this['TrunkBackup']=_0x3a9166['TrunkBackup']?_0x3a9166[_0x6c38('0x24')]:undefined;this['Trunk']=_0x3a9166[_0x6c38('0x25')]?_0x3a9166[_0x6c38('0x25')]:undefined;this[_0x6c38('0x26')]=_0x3a9166['Interval']?_0x3a9166[_0x6c38('0x26')]:undefined;this[_0x6c38('0x27')]=_0x3a9166[_0x6c38('0x27')]?_0x3a9166[_0x6c38('0x27')]:undefined;this[_0x6c38('0x28')]=_0x3a9166[_0x6c38('0x27')]?_0x3a9166['SquareProject'][_0x6c38('0x0')]:undefined;this[_0x6c38('0x29')]=_0x3a9166[_0x6c38('0x29')]||![];this['dialAMDInitialSilence']=_0x3a9166['dialAMDInitialSilence'];this[_0x6c38('0x2a')]=_0x3a9166[_0x6c38('0x2a')];this[_0x6c38('0x2b')]=_0x3a9166[_0x6c38('0x2b')];this['dialAMDTotalAnalysisTime']=_0x3a9166['dialAMDTotalAnalysisTime'];this[_0x6c38('0x2c')]=_0x3a9166[_0x6c38('0x2c')];this[_0x6c38('0x2d')]=_0x3a9166['dialAMDBetweenWordsSilence'];this[_0x6c38('0x2e')]=_0x3a9166[_0x6c38('0x2e')];this['dialAMDSilenceThreshold']=_0x3a9166[_0x6c38('0x2f')];this[_0x6c38('0x30')]=_0x3a9166[_0x6c38('0x30')];}module['exports']=Campaign; \ No newline at end of file +var _0xe355=['dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','campaign','originated','temp','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','dialMachineRetryFrequency'];(function(_0xe97428,_0x6ef36b){var _0x542281=function(_0xfdd0b){while(--_0xfdd0b){_0xe97428['push'](_0xe97428['shift']());}};_0x542281(++_0x6ef36b);}(_0xe355,0xb6));var _0x5e35=function(_0x168fd3,_0x11fbbd){_0x168fd3=_0x168fd3-0x0;var _0x47f2b7=_0xe355[_0x168fd3];return _0x47f2b7;};'use strict';function Campaign(_0x2496b5){this['id']=_0x2496b5['id']||0x0;this[_0x5e35('0x0')]=_0x2496b5[_0x5e35('0x0')]||'';this['type']=_0x2496b5['type']||_0x5e35('0x1');this[_0x5e35('0x2')]=0x0;this[_0x5e35('0x3')]=0x0;this[_0x5e35('0x4')]=0x0;this[_0x5e35('0x5')]=0x0;this[_0x5e35('0x6')]='';this[_0x5e35('0x7')]=!![];this[_0x5e35('0x8')]=_0x2496b5[_0x5e35('0x8')];this[_0x5e35('0x9')]=_0x2496b5[_0x5e35('0x9')];this[_0x5e35('0xa')]=_0x2496b5[_0x5e35('0xa')]||null;this[_0x5e35('0xb')]=_0x2496b5[_0x5e35('0xb')]?_0x2496b5[_0x5e35('0xb')]:null;this[_0x5e35('0xc')]=_0x2496b5[_0x5e35('0xc')];this['dialOriginateCallerIdNumber']=_0x2496b5[_0x5e35('0xd')];this['dialOriginateTimeout']=_0x2496b5[_0x5e35('0xe')]||0x1e;this['dialCongestionMaxRetry']=_0x2496b5[_0x5e35('0xf')];this[_0x5e35('0x10')]=_0x2496b5[_0x5e35('0x10')];this[_0x5e35('0x11')]=_0x2496b5[_0x5e35('0x11')];this[_0x5e35('0x12')]=_0x2496b5[_0x5e35('0x12')];this[_0x5e35('0x13')]=_0x2496b5[_0x5e35('0x13')];this[_0x5e35('0x14')]=_0x2496b5[_0x5e35('0x14')];this[_0x5e35('0x15')]=_0x2496b5[_0x5e35('0x15')];this['dialNoSuchNumberMaxRetry']=_0x2496b5[_0x5e35('0x16')]||0x3;this[_0x5e35('0x17')]=_0x2496b5[_0x5e35('0x17')]||0x96;this[_0x5e35('0x18')]=_0x2496b5[_0x5e35('0x18')]||0x3;this['dialDropRetryFrequency']=_0x2496b5[_0x5e35('0x19')]||0x96;this[_0x5e35('0x1a')]=_0x2496b5[_0x5e35('0x1a')]||0x3;this[_0x5e35('0x1b')]=_0x2496b5[_0x5e35('0x1b')]||0x96;this[_0x5e35('0x1c')]=_0x2496b5[_0x5e35('0x1c')]||0x3;this[_0x5e35('0x1d')]=_0x2496b5['dialMachineRetryFrequency']||0x96;this['dialAgentRejectMaxRetry']=_0x2496b5[_0x5e35('0x1e')]||0x3;this[_0x5e35('0x1f')]=_0x2496b5['dialAgentRejectRetryFrequency']||0x96;this[_0x5e35('0x20')]=_0x2496b5[_0x5e35('0x20')]||_0x5e35('0x21');this[_0x5e35('0x22')]=_0x2496b5[_0x5e35('0x22')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x2496b5[_0x5e35('0x23')]||undefined;this[_0x5e35('0x24')]=_0x2496b5['dialCutDigit']||undefined;this[_0x5e35('0x25')]=_0x2496b5[_0x5e35('0x25')]?_0x2496b5[_0x5e35('0x25')]:undefined;this[_0x5e35('0x26')]=_0x2496b5[_0x5e35('0x26')]?_0x2496b5[_0x5e35('0x26')]:undefined;this[_0x5e35('0x27')]=_0x2496b5[_0x5e35('0x27')]?_0x2496b5[_0x5e35('0x27')]:undefined;this['SquareProject']=_0x2496b5['SquareProject']?_0x2496b5[_0x5e35('0x28')]:undefined;this[_0x5e35('0x29')]=_0x2496b5['SquareProject']?_0x2496b5[_0x5e35('0x28')][_0x5e35('0x0')]:undefined;this[_0x5e35('0x2a')]=_0x2496b5[_0x5e35('0x2a')]||![];this[_0x5e35('0x2b')]=_0x2496b5[_0x5e35('0x2b')];this['dialAMDGreeting']=_0x2496b5[_0x5e35('0x2c')];this[_0x5e35('0x2d')]=_0x2496b5[_0x5e35('0x2d')];this[_0x5e35('0x2e')]=_0x2496b5[_0x5e35('0x2e')];this[_0x5e35('0x2f')]=_0x2496b5[_0x5e35('0x2f')];this[_0x5e35('0x30')]=_0x2496b5[_0x5e35('0x30')];this[_0x5e35('0x31')]=_0x2496b5['dialAMDMaximumNumberOfWords'];this[_0x5e35('0x32')]=_0x2496b5['dialAMDSilenceThreshold'];this[_0x5e35('0x33')]=_0x2496b5[_0x5e35('0x33')];}module[_0x5e35('0x34')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 86065a2..46e2457 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 _0x3ef1=['lastapplication','duration','holdtime','type','tag','disposition','monitor','monitorFilename','queue','transfercalleridnum','transferType','mohtime','exports','starttime','channel','calleridname','connectedlinename','accountcode','uniqueid','answertime','unmanaged'];(function(_0x50eed4,_0x57242b){var _0x48fd03=function(_0x28a771){while(--_0x28a771){_0x50eed4['push'](_0x50eed4['shift']());}};_0x48fd03(++_0x57242b);}(_0x3ef1,0x187));var _0x13ef=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x3ef1[_0x167cc1];return _0x10bc4b;};'use strict';function Channel(){this[_0x13ef('0x0')]=null;this[_0x13ef('0x1')]='';this['destinationchannel']='';this['calleridnum']=0x0;this[_0x13ef('0x2')]='';this['connectedlinenum']=undefined;this[_0x13ef('0x3')]=undefined;this[_0x13ef('0x4')]=0x0;this['context']='';this[_0x13ef('0x5')]=0x0;this['linkedid']=0x0;this['exten']=0x0;this['answered']=![];this[_0x13ef('0x6')]=null;this['endtime']=null;this[_0x13ef('0x7')]=![];this['abandoned']=![];this[_0x13ef('0x8')]='';this['lastdata']='';this[_0x13ef('0x9')]=0x0;this['billableseconds']=0x0;this[_0x13ef('0xa')]=0x0;this[_0x13ef('0xb')]=null;this[_0x13ef('0xc')]=null;this[_0x13ef('0xd')]=null;this[_0x13ef('0xe')]=![];this[_0x13ef('0xf')]=null;this[_0x13ef('0x10')]=null;this['monitors']=[];this[_0x13ef('0x11')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x13ef('0x12')]=undefined;this[_0x13ef('0x13')]=0x0;}module[_0x13ef('0x14')]=Channel; \ No newline at end of file +var _0x8507=['lastdata','duration','holdtime','type','tag','monitors','transfercalleridnum','transferconnectedlinenum','transferType','exports','starttime','destinationchannel','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','exten','answered','answertime','unmanaged'];(function(_0x5e7083,_0x5cfb6f){var _0x24deaa=function(_0x4f70ab){while(--_0x4f70ab){_0x5e7083['push'](_0x5e7083['shift']());}};_0x24deaa(++_0x5cfb6f);}(_0x8507,0x14c));var _0x7850=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8507[_0x20a584];return _0x4b41a8;};'use strict';function Channel(){this[_0x7850('0x0')]=null;this['channel']='';this[_0x7850('0x1')]='';this['calleridnum']=0x0;this[_0x7850('0x2')]='';this[_0x7850('0x3')]=undefined;this[_0x7850('0x4')]=undefined;this[_0x7850('0x5')]=0x0;this[_0x7850('0x6')]='';this[_0x7850('0x7')]=0x0;this[_0x7850('0x8')]=0x0;this[_0x7850('0x9')]=0x0;this[_0x7850('0xa')]=![];this[_0x7850('0xb')]=null;this['endtime']=null;this[_0x7850('0xc')]=![];this['abandoned']=![];this['lastapplication']='';this[_0x7850('0xd')]='';this[_0x7850('0xe')]=0x0;this['billableseconds']=0x0;this[_0x7850('0xf')]=0x0;this[_0x7850('0x10')]=null;this[_0x7850('0x11')]=null;this['disposition']=null;this['monitor']=![];this['monitorFilename']=null;this['queue']=null;this[_0x7850('0x12')]=[];this[_0x7850('0x13')]=undefined;this[_0x7850('0x14')]=undefined;this[_0x7850('0x15')]=undefined;this['mohtime']=0x0;}module[_0x7850('0x16')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index bdb5f50..ccf9115 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 _0x6fb2=['type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret'];(function(_0x3d2c73,_0x431958){var _0xb7712f=function(_0x56ec21){while(--_0x56ec21){_0x3d2c73['push'](_0x3d2c73['shift']());}};_0xb7712f(++_0x431958);}(_0x6fb2,0x163));var _0x26fb=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6fb2[_0x501510];return _0x1e6ee5;};'use strict';function DeskAccount(_0x297ed1){this['id']=_0x297ed1['id']||0x0;this[_0x26fb('0x0')]=_0x297ed1['name']||'';this['username']=_0x297ed1[_0x26fb('0x1')]||'';this['remoteUri']=_0x297ed1[_0x26fb('0x2')]||'';this['authType']=_0x297ed1[_0x26fb('0x3')]||'';this[_0x26fb('0x4')]=_0x297ed1[_0x26fb('0x4')]||'';this[_0x26fb('0x5')]=_0x297ed1[_0x26fb('0x5')]||'';this['consumerSecret']=_0x297ed1[_0x26fb('0x6')]||'';this[_0x26fb('0x7')]=_0x297ed1[_0x26fb('0x7')]||'';this[_0x26fb('0x8')]=_0x297ed1[_0x26fb('0x8')]||'';this[_0x26fb('0x9')]=_0x297ed1[_0x26fb('0x9')]||'';this['serverUrl']=_0x297ed1[_0x26fb('0xa')]||'';this[_0x26fb('0xb')]=_0x297ed1[_0x26fb('0xb')]||{};}module[_0x26fb('0xc')]=DeskAccount; \ No newline at end of file +var _0xb3c7=['serverUrl','Configurations','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb3c7,0x1be));var _0x7b3c=function(_0x240088,_0x2c184e){_0x240088=_0x240088-0x0;var _0x30286c=_0xb3c7[_0x240088];return _0x30286c;};'use strict';function DeskAccount(_0x2773e2){this['id']=_0x2773e2['id']||0x0;this[_0x7b3c('0x0')]=_0x2773e2[_0x7b3c('0x0')]||'';this[_0x7b3c('0x1')]=_0x2773e2[_0x7b3c('0x1')]||'';this[_0x7b3c('0x2')]=_0x2773e2[_0x7b3c('0x2')]||'';this['authType']=_0x2773e2[_0x7b3c('0x3')]||'';this[_0x7b3c('0x4')]=_0x2773e2[_0x7b3c('0x4')]||'';this[_0x7b3c('0x5')]=_0x2773e2[_0x7b3c('0x5')]||'';this[_0x7b3c('0x6')]=_0x2773e2[_0x7b3c('0x6')]||'';this[_0x7b3c('0x7')]=_0x2773e2[_0x7b3c('0x7')]||'';this[_0x7b3c('0x8')]=_0x2773e2[_0x7b3c('0x8')]||'';this[_0x7b3c('0x9')]=_0x2773e2[_0x7b3c('0x9')]||'';this[_0x7b3c('0xa')]=_0x2773e2[_0x7b3c('0xa')]||'';this['Configurations']=_0x2773e2[_0x7b3c('0xb')]||{};}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 1c330bf..ebff742 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 _0xb58b=['remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','exports','name','username','password'];(function(_0x1c3073,_0x1bfa1e){var _0x3cb69c=function(_0x2c1851){while(--_0x2c1851){_0x1c3073['push'](_0x1c3073['shift']());}};_0x3cb69c(++_0x1bfa1e);}(_0xb58b,0x1f1));var _0xbb58=function(_0x1787fd,_0xf44dec){_0x1787fd=_0x1787fd-0x0;var _0xbf4c6=_0xb58b[_0x1787fd];return _0xbf4c6;};'use strict';function Dynamics365Account(_0x250573){this['id']=_0x250573['id']||0x0;this[_0xbb58('0x0')]=_0x250573[_0xbb58('0x0')]||'';this[_0xbb58('0x1')]=_0x250573['username']||'';this[_0xbb58('0x2')]=_0x250573[_0xbb58('0x2')]||'';this['remoteUri']=_0x250573[_0xbb58('0x3')]||'';this['tenantId']=_0x250573[_0xbb58('0x4')]||'';this[_0xbb58('0x5')]=_0x250573[_0xbb58('0x5')]||'';this['clientSecret']=_0x250573[_0xbb58('0x6')]||{};this[_0xbb58('0x7')]=_0x250573[_0xbb58('0x7')]||'';this[_0xbb58('0x8')]=_0x250573[_0xbb58('0x8')]||{};}module[_0xbb58('0x9')]=Dynamics365Account; \ No newline at end of file +var _0xf4eb=['tenantId','clientId','clientSecret','serverUrl','exports','password','remoteUri'];(function(_0x133ee2,_0x1365ff){var _0x28e86f=function(_0x162938){while(--_0x162938){_0x133ee2['push'](_0x133ee2['shift']());}};_0x28e86f(++_0x1365ff);}(_0xf4eb,0xec));var _0xbf4e=function(_0x507c71,_0xa143c2){_0x507c71=_0x507c71-0x0;var _0x2cc6f2=_0xf4eb[_0x507c71];return _0x2cc6f2;};'use strict';function Dynamics365Account(_0x3e6fbd){this['id']=_0x3e6fbd['id']||0x0;this['name']=_0x3e6fbd['name']||'';this['username']=_0x3e6fbd['username']||'';this[_0xbf4e('0x0')]=_0x3e6fbd['password']||'';this['remoteUri']=_0x3e6fbd[_0xbf4e('0x1')]||'';this[_0xbf4e('0x2')]=_0x3e6fbd[_0xbf4e('0x2')]||'';this[_0xbf4e('0x3')]=_0x3e6fbd[_0xbf4e('0x3')]||'';this[_0xbf4e('0x4')]=_0x3e6fbd[_0xbf4e('0x4')]||{};this['serverUrl']=_0x3e6fbd[_0xbf4e('0x5')]||'';this['Configurations']=_0x3e6fbd['Configurations']||{};}module[_0xbf4e('0x6')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 47d834e..5f48813 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 _0x5e58=['exports','name','description','ecm','localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId'];(function(_0x1d20e5,_0x3d4f74){var _0x14c8d3=function(_0x368a35){while(--_0x368a35){_0x1d20e5['push'](_0x1d20e5['shift']());}};_0x14c8d3(++_0x3d4f74);}(_0x5e58,0x6a));var _0x85e5=function(_0x5276f1,_0x1fcf3f){_0x5276f1=_0x5276f1-0x0;var _0xa2d451=_0x5e58[_0x5276f1];return _0xa2d451;};'use strict';function FaxAccount(_0x103a59){this['id']=_0x103a59['id']||0x0;this[_0x85e5('0x0')]=_0x103a59[_0x85e5('0x0')]||'';this[_0x85e5('0x1')]=_0x103a59[_0x85e5('0x1')];this[_0x85e5('0x2')]=_0x103a59[_0x85e5('0x2')];this['headerinfo']=_0x103a59['headerinfo'];this['localstationid']=_0x103a59[_0x85e5('0x3')];this[_0x85e5('0x4')]=_0x103a59[_0x85e5('0x4')]||0x960;this[_0x85e5('0x5')]=_0x103a59[_0x85e5('0x5')]||0x3840;this[_0x85e5('0x6')]=_0x103a59['modem']||'v17,v27,v29';this['gateway']=_0x103a59[_0x85e5('0x7')]||'no';this[_0x85e5('0x8')]=_0x103a59[_0x85e5('0x8')]||'no';this[_0x85e5('0x9')]=_0x103a59[_0x85e5('0x9')]||0x1388;this['tech']=_0x103a59[_0x85e5('0xa')]||_0x85e5('0xb');this[_0x85e5('0xc')]=_0x103a59['Trunk']?_0x103a59[_0x85e5('0xc')]:undefined;this[_0x85e5('0xd')]=_0x103a59[_0x85e5('0xd')];this['key']=_0x103a59['key'];}module[_0x85e5('0xe')]=FaxAccount; \ No newline at end of file +var _0xc539=['minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xc539,0x1a4));var _0x9c53=function(_0x162adc,_0x7a65f7){_0x162adc=_0x162adc-0x0;var _0x4b3a76=_0xc539[_0x162adc];return _0x4b3a76;};'use strict';function FaxAccount(_0x1da4df){this['id']=_0x1da4df['id']||0x0;this[_0x9c53('0x0')]=_0x1da4df['name']||'';this[_0x9c53('0x1')]=_0x1da4df[_0x9c53('0x1')];this[_0x9c53('0x2')]=_0x1da4df[_0x9c53('0x2')];this[_0x9c53('0x3')]=_0x1da4df['headerinfo'];this['localstationid']=_0x1da4df[_0x9c53('0x4')];this[_0x9c53('0x5')]=_0x1da4df[_0x9c53('0x5')]||0x960;this[_0x9c53('0x6')]=_0x1da4df[_0x9c53('0x6')]||0x3840;this[_0x9c53('0x7')]=_0x1da4df['modem']||_0x9c53('0x8');this[_0x9c53('0x9')]=_0x1da4df['gateway']||'no';this[_0x9c53('0xa')]=_0x1da4df[_0x9c53('0xa')]||'no';this[_0x9c53('0xb')]=_0x1da4df['t38timeout']||0x1388;this[_0x9c53('0xc')]=_0x1da4df['tech']||'SIP';this['Trunk']=_0x1da4df[_0x9c53('0xd')]?_0x1da4df['Trunk']:undefined;this[_0x9c53('0xe')]=_0x1da4df[_0x9c53('0xe')];this[_0x9c53('0xf')]=_0x1da4df[_0x9c53('0xf')];}module[_0x9c53('0x10')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 414f5c5..34d0b66 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 _0xffbc=['exports','username','token','remoteUri','serverUrl','Configurations'];(function(_0x357979,_0x56feef){var _0xabb42f=function(_0x447f9d){while(--_0x447f9d){_0x357979['push'](_0x357979['shift']());}};_0xabb42f(++_0x56feef);}(_0xffbc,0x16f));var _0xcffb=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xffbc[_0x55e08b];return _0xd1a7ff;};'use strict';function FreshdeskAccount(_0x15adb0){this['id']=_0x15adb0['id']||0x0;this['name']=_0x15adb0['name']||'';this[_0xcffb('0x0')]=_0x15adb0[_0xcffb('0x0')]||'';this['apiKey']=_0x15adb0[_0xcffb('0x1')]||'';this[_0xcffb('0x2')]=_0x15adb0[_0xcffb('0x2')]||'';this[_0xcffb('0x3')]=_0x15adb0['serverUrl']||'';this[_0xcffb('0x4')]=_0x15adb0['Configurations']||{};}module[_0xcffb('0x5')]=FreshdeskAccount; \ No newline at end of file +var _0x05b5=['apiKey','token','remoteUri','serverUrl','Configurations','name','username'];(function(_0x58926f,_0x4f9633){var _0x19f1fc=function(_0x173455){while(--_0x173455){_0x58926f['push'](_0x58926f['shift']());}};_0x19f1fc(++_0x4f9633);}(_0x05b5,0xb4));var _0x505b=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x05b5[_0x2b4411];return _0x8e41ef;};'use strict';function FreshdeskAccount(_0x2558e7){this['id']=_0x2558e7['id']||0x0;this[_0x505b('0x0')]=_0x2558e7[_0x505b('0x0')]||'';this[_0x505b('0x1')]=_0x2558e7[_0x505b('0x1')]||'';this[_0x505b('0x2')]=_0x2558e7[_0x505b('0x3')]||'';this[_0x505b('0x4')]=_0x2558e7['remoteUri']||'';this[_0x505b('0x5')]=_0x2558e7['serverUrl']||'';this[_0x505b('0x6')]=_0x2558e7[_0x505b('0x6')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 0a59a24..e8b720b 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 _0x2123=['name','username','apiKey','token','remoteUri','serverUrl','Configurations','exports'];(function(_0x4f5ef9,_0x2eaea0){var _0x4e43c1=function(_0x5845ca){while(--_0x5845ca){_0x4f5ef9['push'](_0x4f5ef9['shift']());}};_0x4e43c1(++_0x2eaea0);}(_0x2123,0x190));var _0x3212=function(_0x424116,_0x502c85){_0x424116=_0x424116-0x0;var _0x5408c8=_0x2123[_0x424116];return _0x5408c8;};'use strict';function FreshsalesAccount(_0x4a2fc9){this['id']=_0x4a2fc9['id']||0x0;this[_0x3212('0x0')]=_0x4a2fc9[_0x3212('0x0')]||'';this[_0x3212('0x1')]=_0x4a2fc9[_0x3212('0x1')]||'';this[_0x3212('0x2')]=_0x4a2fc9[_0x3212('0x3')]||'';this[_0x3212('0x4')]=_0x4a2fc9[_0x3212('0x4')]||'';this[_0x3212('0x5')]=_0x4a2fc9[_0x3212('0x5')]||'';this[_0x3212('0x6')]=_0x4a2fc9['Configurations']||{};}module[_0x3212('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0x0958=['apiKey','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x4e9b51,_0x3f9476){var _0x2929fc=function(_0x5d898d){while(--_0x5d898d){_0x4e9b51['push'](_0x4e9b51['shift']());}};_0x2929fc(++_0x3f9476);}(_0x0958,0x7c));var _0x8095=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0958[_0x321bb2];return _0x9c12ed;};'use strict';function FreshsalesAccount(_0x309912){this['id']=_0x309912['id']||0x0;this[_0x8095('0x0')]=_0x309912[_0x8095('0x0')]||'';this['username']=_0x309912[_0x8095('0x1')]||'';this[_0x8095('0x2')]=_0x309912['token']||'';this['remoteUri']=_0x309912[_0x8095('0x3')]||'';this[_0x8095('0x4')]=_0x309912['serverUrl']||'';this['Configurations']=_0x309912[_0x8095('0x5')]||{};}module[_0x8095('0x6')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index a9f0eb0..0a55fda 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 _0xbca0=['count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','exten','priority','holdtime','assigned','lastAssignedTo','mohtime','exports','uniqueid','calleridnum','queue','queuecallerjoinAt','queuecallerleaveAt','position'];(function(_0x3b223c,_0x31f0a3){var _0x1aed3c=function(_0x19e840){while(--_0x19e840){_0x3b223c['push'](_0x3b223c['shift']());}};_0x1aed3c(++_0x31f0a3);}(_0xbca0,0x132));var _0x0bca=function(_0x15f174,_0x1e35fb){_0x15f174=_0x15f174-0x0;var _0x585e95=_0xbca0[_0x15f174];return _0x585e95;};'use strict';function QueueReport(){this['type']='inbound';this[_0x0bca('0x0')]='';this[_0x0bca('0x1')]='';this['calleridname']='';this[_0x0bca('0x2')]='';this[_0x0bca('0x3')]=null;this[_0x0bca('0x4')]=null;this[_0x0bca('0x5')]=0x1;this[_0x0bca('0x6')]=0x1;this[_0x0bca('0x7')]=![];this[_0x0bca('0x8')]=null;this[_0x0bca('0x9')]=![];this['queuecallercompleteAt']=null;this['queuecallerexit']=![];this[_0x0bca('0xa')]=null;this[_0x0bca('0xb')]=0x1;this[_0x0bca('0xc')]='';this[_0x0bca('0xd')]='';this[_0x0bca('0xe')]='';this[_0x0bca('0xf')]='';this[_0x0bca('0x10')]='';this[_0x0bca('0x11')]='';this[_0x0bca('0x12')]='';this[_0x0bca('0x13')]=0x0;this[_0x0bca('0x14')]=![];this[_0x0bca('0x15')]='';this[_0x0bca('0x16')]=0x0;this['variables']={};}module[_0x0bca('0x17')]=QueueReport; \ No newline at end of file +var _0x781a=['context','exten','priority','holdtime','lastAssignedTo','mohtime','variables','exports','type','inbound','calleridnum','queue','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode'];(function(_0x2779cc,_0x54a518){var _0x13a711=function(_0x1a36c7){while(--_0x1a36c7){_0x2779cc['push'](_0x2779cc['shift']());}};_0x13a711(++_0x54a518);}(_0x781a,0xbe));var _0xa781=function(_0x42dbc4,_0x594a90){_0x42dbc4=_0x42dbc4-0x0;var _0x65f8c6=_0x781a[_0x42dbc4];return _0x65f8c6;};'use strict';function QueueReport(){this[_0xa781('0x0')]=_0xa781('0x1');this['uniqueid']='';this[_0xa781('0x2')]='';this['calleridname']='';this[_0xa781('0x3')]='';this['queuecallerjoinAt']=null;this[_0xa781('0x4')]=null;this[_0xa781('0x5')]=0x1;this[_0xa781('0x6')]=0x1;this[_0xa781('0x7')]=![];this[_0xa781('0x8')]=null;this[_0xa781('0x9')]=![];this[_0xa781('0xa')]=null;this[_0xa781('0xb')]=![];this[_0xa781('0xc')]=null;this[_0xa781('0xd')]=0x1;this[_0xa781('0xe')]='';this[_0xa781('0xf')]='';this[_0xa781('0x10')]='';this[_0xa781('0x11')]='';this[_0xa781('0x12')]='';this[_0xa781('0x13')]='';this[_0xa781('0x14')]='';this[_0xa781('0x15')]=0x0;this['assigned']=![];this[_0xa781('0x16')]='';this[_0xa781('0x17')]=0x0;this[_0xa781('0x18')]={};}module[_0xa781('0x19')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 6d73f52..0622891 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 _0x9beb=['exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations'];(function(_0x1cac92,_0x39fce7){var _0x2a82e1=function(_0x1f65eb){while(--_0x1f65eb){_0x1cac92['push'](_0x1cac92['shift']());}};_0x2a82e1(++_0x39fce7);}(_0x9beb,0x151));var _0xb9be=function(_0x6c4231,_0x4a471e){_0x6c4231=_0x6c4231-0x0;var _0x52de9a=_0x9beb[_0x6c4231];return _0x52de9a;};'use strict';function SalesforceAccount(_0x15d8c7){this['id']=_0x15d8c7['id']||0x0;this[_0xb9be('0x0')]=_0x15d8c7[_0xb9be('0x0')]||'';this[_0xb9be('0x1')]=_0x15d8c7[_0xb9be('0x1')]||'';this[_0xb9be('0x2')]=_0x15d8c7['remoteUri']||'';this[_0xb9be('0x3')]=_0x15d8c7['password']||'';this[_0xb9be('0x4')]=_0x15d8c7[_0xb9be('0x4')]||'';this['clientSecret']=_0x15d8c7[_0xb9be('0x5')]||'';this[_0xb9be('0x6')]=_0x15d8c7[_0xb9be('0x6')]||'';this['type']=_0x15d8c7[_0xb9be('0x7')]||_0xb9be('0x8');this[_0xb9be('0x9')]=_0x15d8c7[_0xb9be('0x9')]||'';this['Configurations']=_0x15d8c7[_0xb9be('0xa')]||{};}module[_0xb9be('0xb')]=SalesforceAccount; \ No newline at end of file +var _0x7d14=['username','remoteUri','password','clientId','clientSecret','type','serverUrl','Configurations','exports','name'];(function(_0x43023c,_0x53062e){var _0x8c0d9a=function(_0x144ead){while(--_0x144ead){_0x43023c['push'](_0x43023c['shift']());}};_0x8c0d9a(++_0x53062e);}(_0x7d14,0x6d));var _0x47d1=function(_0x39e65f,_0x533ae4){_0x39e65f=_0x39e65f-0x0;var _0x4f6c08=_0x7d14[_0x39e65f];return _0x4f6c08;};'use strict';function SalesforceAccount(_0x5f0d90){this['id']=_0x5f0d90['id']||0x0;this[_0x47d1('0x0')]=_0x5f0d90['name']||'';this[_0x47d1('0x1')]=_0x5f0d90[_0x47d1('0x1')]||'';this[_0x47d1('0x2')]=_0x5f0d90[_0x47d1('0x2')]||'';this['password']=_0x5f0d90[_0x47d1('0x3')]||'';this[_0x47d1('0x4')]=_0x5f0d90[_0x47d1('0x4')]||'';this[_0x47d1('0x5')]=_0x5f0d90[_0x47d1('0x5')]||'';this['securityToken']=_0x5f0d90['securityToken']||'';this['type']=_0x5f0d90[_0x47d1('0x6')]||'integrationTab';this[_0x47d1('0x7')]=_0x5f0d90[_0x47d1('0x7')]||'';this[_0x47d1('0x8')]=_0x5f0d90[_0x47d1('0x8')]||{};}module[_0x47d1('0x9')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 9bda834..4c27fe5 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 _0x14cd=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x9a3e0f,_0x2f796d){var _0x3d2a9a=function(_0x3aeb03){while(--_0x3aeb03){_0x9a3e0f['push'](_0x9a3e0f['shift']());}};_0x3d2a9a(++_0x2f796d);}(_0x14cd,0x1b4));var _0xd14c=function(_0x44d3a1,_0x36fc67){_0x44d3a1=_0x44d3a1-0x0;var _0x1e9dd2=_0x14cd[_0x44d3a1];return _0x1e9dd2;};'use strict';function ServicenowAccount(_0x2746d6){this['id']=_0x2746d6['id']||0x0;this['name']=_0x2746d6[_0xd14c('0x0')]||'';this[_0xd14c('0x1')]=_0x2746d6[_0xd14c('0x1')]||'';this[_0xd14c('0x2')]=_0x2746d6[_0xd14c('0x2')]||'';this[_0xd14c('0x3')]=_0x2746d6['remoteUri']||'';this['serverUrl']=_0x2746d6[_0xd14c('0x4')]||'';this[_0xd14c('0x5')]=_0x2746d6[_0xd14c('0x5')]||{};}module[_0xd14c('0x6')]=ServicenowAccount; \ No newline at end of file +var _0xa7c4=['serverUrl','Configurations','exports','username','password','remoteUri'];(function(_0xfcfaa1,_0x1bda5f){var _0xc741ab=function(_0x598563){while(--_0x598563){_0xfcfaa1['push'](_0xfcfaa1['shift']());}};_0xc741ab(++_0x1bda5f);}(_0xa7c4,0x12f));var _0x4a7c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa7c4[_0x3dd15e];return _0x231fd0;};'use strict';function ServicenowAccount(_0x3a4d71){this['id']=_0x3a4d71['id']||0x0;this['name']=_0x3a4d71['name']||'';this[_0x4a7c('0x0')]=_0x3a4d71['username']||'';this[_0x4a7c('0x1')]=_0x3a4d71[_0x4a7c('0x1')]||'';this[_0x4a7c('0x2')]=_0x3a4d71[_0x4a7c('0x2')]||'';this[_0x4a7c('0x3')]=_0x3a4d71[_0x4a7c('0x3')]||'';this[_0x4a7c('0x4')]=_0x3a4d71[_0x4a7c('0x4')]||{};}module[_0x4a7c('0x5')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index dcfc24f..3e7307c 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 _0x973b=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x577211,_0x842174){var _0x48d24d=function(_0x1dec20){while(--_0x1dec20){_0x577211['push'](_0x577211['shift']());}};_0x48d24d(++_0x842174);}(_0x973b,0xb9));var _0xb973=function(_0x3267d3,_0x85822e){_0x3267d3=_0x3267d3-0x0;var _0x1f5b99=_0x973b[_0x3267d3];return _0x1f5b99;};'use strict';function SugarcrmAccount(_0x5c899f){this['id']=_0x5c899f['id']||0x0;this[_0xb973('0x0')]=_0x5c899f[_0xb973('0x0')]||'';this[_0xb973('0x1')]=_0x5c899f['username']||'';this[_0xb973('0x2')]=_0x5c899f[_0xb973('0x2')]||'';this[_0xb973('0x3')]=_0x5c899f[_0xb973('0x3')]||'';this[_0xb973('0x4')]=_0x5c899f[_0xb973('0x4')]||'';this[_0xb973('0x5')]=_0x5c899f['Configurations']||{};}module[_0xb973('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x9e01=['exports','name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x548b40,_0x57bb6e){var _0x36166c=function(_0x12ba1d){while(--_0x12ba1d){_0x548b40['push'](_0x548b40['shift']());}};_0x36166c(++_0x57bb6e);}(_0x9e01,0xe1));var _0x19e0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9e01[_0x20a584];return _0x4b41a8;};'use strict';function SugarcrmAccount(_0x453b5a){this['id']=_0x453b5a['id']||0x0;this[_0x19e0('0x0')]=_0x453b5a[_0x19e0('0x0')]||'';this[_0x19e0('0x1')]=_0x453b5a[_0x19e0('0x1')]||'';this[_0x19e0('0x2')]=_0x453b5a[_0x19e0('0x2')]||'';this[_0x19e0('0x3')]=_0x453b5a[_0x19e0('0x3')]||'';this[_0x19e0('0x4')]=_0x453b5a[_0x19e0('0x4')]||'';this[_0x19e0('0x5')]=_0x453b5a[_0x19e0('0x5')]||{};}module[_0x19e0('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 84a1056..a56c150 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 _0x48cb=['accountcode','state','unknown','stateTime','status','address','exports','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x48cb,0x16f));var _0xb48c=function(_0xe9c770,_0x4f76c4){_0xe9c770=_0xe9c770-0x0;var _0x48f174=_0x48cb[_0xe9c770];return _0x48f174;};'use strict';function Telephone(_0x43c47b){this['id']=_0x43c47b['id']||0x0;this[_0xb48c('0x0')]=_0x43c47b[_0xb48c('0x0')]||'';this[_0xb48c('0x1')]=_0x43c47b['accountcode']||'';this[_0xb48c('0x2')]=_0xb48c('0x3');this[_0xb48c('0x4')]=0x0;this[_0xb48c('0x5')]=_0xb48c('0x3');this[_0xb48c('0x6')]='';}module[_0xb48c('0x7')]=Telephone; \ No newline at end of file +var _0xbca8=['name','accountcode','unknown','stateTime','status','exports'];(function(_0xb6e875,_0x103e2d){var _0x3bf7a1=function(_0x371716){while(--_0x371716){_0xb6e875['push'](_0xb6e875['shift']());}};_0x3bf7a1(++_0x103e2d);}(_0xbca8,0xcc));var _0x8bca=function(_0x34c237,_0x591354){_0x34c237=_0x34c237-0x0;var _0x134ec4=_0xbca8[_0x34c237];return _0x134ec4;};'use strict';function Telephone(_0x2a5c50){this['id']=_0x2a5c50['id']||0x0;this[_0x8bca('0x0')]=_0x2a5c50[_0x8bca('0x0')]||'';this[_0x8bca('0x1')]=_0x2a5c50[_0x8bca('0x1')]||'';this['state']=_0x8bca('0x2');this[_0x8bca('0x3')]=0x0;this[_0x8bca('0x4')]='unknown';this['address']='';}module[_0x8bca('0x5')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index ed6dee1..e71accd 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['name','html'];(function(_0x59a9cd,_0xf0ab10){var _0x19b8da=function(_0x293ce7){while(--_0x293ce7){_0x59a9cd['push'](_0x59a9cd['shift']());}};_0x19b8da(++_0xf0ab10);}(_0xb10b,0x12a));var _0xbb10=function(_0x437472,_0x31db2d){_0x437472=_0x437472-0x0;var _0x217fce=_0xb10b[_0x437472];return _0x217fce;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x17c08f,_0x2a0a86){var _0x1cd3f3=function(_0x2595b1){while(--_0x2595b1){_0x17c08f['push'](_0x17c08f['shift']());}};_0x1cd3f3(++_0x2a0a86);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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 b49a505..5d74061 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 _0xb10b=['AllConditions','AnyConditions','Actions','exports','name','channel','status'];(function(_0x3dbb0c,_0x437ac4){var _0x5134b1=function(_0x24a10b){while(--_0x24a10b){_0x3dbb0c['push'](_0x3dbb0c['shift']());}};_0x5134b1(++_0x437ac4);}(_0xb10b,0x12a));var _0xbb10=function(_0x4caade,_0x549ce1){_0x4caade=_0x4caade-0x0;var _0x2041ff=_0xb10b[_0x4caade];return _0x2041ff;};'use strict';function Trigger(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'voice';this[_0xbb10('0x2')]=_0x13ce8d[_0xbb10('0x2')]||![];this[_0xbb10('0x3')]=_0x13ce8d[_0xbb10('0x3')]||[];this[_0xbb10('0x4')]=_0x13ce8d[_0xbb10('0x4')]||[];this['Actions']=_0x13ce8d[_0xbb10('0x5')]||[];}module[_0xbb10('0x6')]=Trigger; \ No newline at end of file +var _0xda2d=['channel','voice','AllConditions','AnyConditions','Actions','exports','name'];(function(_0x12fce8,_0x42ab4a){var _0x2b1da7=function(_0x477479){while(--_0x477479){_0x12fce8['push'](_0x12fce8['shift']());}};_0x2b1da7(++_0x42ab4a);}(_0xda2d,0x102));var _0xdda2=function(_0x4991a6,_0x1d0a72){_0x4991a6=_0x4991a6-0x0;var _0x50e749=_0xda2d[_0x4991a6];return _0x50e749;};'use strict';function Trigger(_0x2625ed){this['id']=_0x2625ed['id']||0x0;this[_0xdda2('0x0')]=_0x2625ed[_0xdda2('0x0')]||'';this[_0xdda2('0x1')]=_0x2625ed[_0xdda2('0x1')]||_0xdda2('0x2');this['status']=_0x2625ed['status']||![];this['AllConditions']=_0x2625ed[_0xdda2('0x3')]||[];this[_0xdda2('0x4')]=_0x2625ed[_0xdda2('0x4')]||[];this[_0xdda2('0x5')]=_0x2625ed[_0xdda2('0x5')]||[];}module[_0xdda2('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 64b4bcf..f3d4883 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 _0xe57f=['unknown','stateTime','registry','split','host','port','domain','domainport','refresh','stateRegistry','registrationtime','address','defaultuser','active'];(function(_0x5938c8,_0x4a9ca){var _0x4353f7=function(_0x50764f){while(--_0x50764f){_0x5938c8['push'](_0x5938c8['shift']());}};_0x4353f7(++_0x4a9ca);}(_0xe57f,0x1bf));var _0xfe57=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xe57f[_0xa464c9];return _0x3d73c4;};'use strict';function Trunk(_0x4138b1){this['id']=_0x4138b1['id']||0x0;this[_0xfe57('0x0')]=_0x4138b1[_0xfe57('0x0')]||![];this['name']=_0x4138b1['name']||'';this['state']=_0xfe57('0x1');this[_0xfe57('0x2')]=0x0;this['status']=_0xfe57('0x1');this[_0xfe57('0x3')]=_0x4138b1[_0xfe57('0x3')]&&_0x4138b1[_0xfe57('0x3')]['indexOf'](':')?_0x4138b1['registry'][_0xfe57('0x4')](':')[0x0]:'';this[_0xfe57('0x5')]='';this[_0xfe57('0x6')]='';this[_0xfe57('0x7')]='';this[_0xfe57('0x8')]='';this[_0xfe57('0x9')]='';this[_0xfe57('0xa')]=_0xfe57('0x1');this[_0xfe57('0xb')]='';this[_0xfe57('0xc')]='';this['defaultuser']=_0x4138b1[_0xfe57('0xd')]||'';}module['exports']=Trunk; \ No newline at end of file +var _0x405d=['split','port','domain','domainport','refresh','stateRegistry','registrationtime','defaultuser','active','state','unknown','status','registry','indexOf'];(function(_0x1b8599,_0x525285){var _0x4490a6=function(_0x3b89fb){while(--_0x3b89fb){_0x1b8599['push'](_0x1b8599['shift']());}};_0x4490a6(++_0x525285);}(_0x405d,0x158));var _0xd405=function(_0xf3c6ae,_0x5be977){_0xf3c6ae=_0xf3c6ae-0x0;var _0x358759=_0x405d[_0xf3c6ae];return _0x358759;};'use strict';function Trunk(_0x3895b7){this['id']=_0x3895b7['id']||0x0;this['active']=_0x3895b7[_0xd405('0x0')]||![];this['name']=_0x3895b7['name']||'';this[_0xd405('0x1')]=_0xd405('0x2');this['stateTime']=0x0;this[_0xd405('0x3')]='unknown';this[_0xd405('0x4')]=_0x3895b7[_0xd405('0x4')]&&_0x3895b7['registry'][_0xd405('0x5')](':')?_0x3895b7[_0xd405('0x4')][_0xd405('0x6')](':')[0x0]:'';this['host']='';this[_0xd405('0x7')]='';this[_0xd405('0x8')]='';this[_0xd405('0x9')]='';this[_0xd405('0xa')]='';this[_0xd405('0xb')]=_0xd405('0x2');this[_0xd405('0xc')]='';this['address']='';this[_0xd405('0xd')]=_0x3895b7[_0xd405('0xd')]||'';}module['exports']=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index ee85bc4..343fb9a 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 _0xa2f4=['recordingFormat','mandatoryDisposition','exports','exten'];(function(_0x588e40,_0x2a6615){var _0x45b8c2=function(_0x214739){while(--_0x214739){_0x588e40['push'](_0x588e40['shift']());}};_0x45b8c2(++_0x2a6615);}(_0xa2f4,0x11f));var _0x4a2f=function(_0x59f0ea,_0x12b743){_0x59f0ea=_0x59f0ea-0x0;var _0x32db39=_0xa2f4[_0x59f0ea];return _0x32db39;};'use strict';function voiceExtension(_0x1c5f39){this['id']=_0x1c5f39['id']||0x0;this[_0x4a2f('0x0')]=_0x1c5f39['exten']||'';this[_0x4a2f('0x1')]=_0x1c5f39[_0x4a2f('0x1')]||'none';this['mandatoryDisposition']=_0x1c5f39[_0x4a2f('0x2')]||![];}module[_0x4a2f('0x3')]=voiceExtension; \ No newline at end of file +var _0xf59f=['mandatoryDisposition','none'];(function(_0x333f84,_0x495a4d){var _0x3b617e=function(_0x53d8f6){while(--_0x53d8f6){_0x333f84['push'](_0x333f84['shift']());}};_0x3b617e(++_0x495a4d);}(_0xf59f,0x199));var _0xff59=function(_0x663723,_0x4d4595){_0x663723=_0x663723-0x0;var _0x4cc827=_0xf59f[_0x663723];return _0x4cc827;};'use strict';function voiceExtension(_0x1b3a1c){this['id']=_0x1b3a1c['id']||0x0;this['exten']=_0x1b3a1c['exten']||'';this['recordingFormat']=_0x1b3a1c['recordingFormat']||_0xff59('0x0');this[_0xff59('0x1')]=_0x1b3a1c[_0xff59('0x1')]||![];}module['exports']=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index a583208..c67b3d3 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 _0xdda3=['startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','not_inuse','inuse','invalid','onhold','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','talking','answered','sumDuration','sumBillable','unmanaged','abandoned','loggedIn','acw','acwTimeout','autopause','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay'];(function(_0x3c19ca,_0x131d1c){var _0x425bee=function(_0x463ae3){while(--_0x463ae3){_0x3c19ca['push'](_0x3c19ca['shift']());}};_0x425bee(++_0x131d1c);}(_0xdda3,0x10d));var _0x3dda=function(_0x5538a4,_0xe0b8b0){_0x5538a4=_0x5538a4-0x0;var _0x530a52=_0xdda3[_0x5538a4];return _0x530a52;};'use strict';var statusDesc=[_0x3dda('0x0'),_0x3dda('0x1'),_0x3dda('0x2'),'busy',_0x3dda('0x3'),'unavailable','ringing','ringinuse',_0x3dda('0x4')];var monitorFormat={'wav':_0x3dda('0x5'),'wav49':_0x3dda('0x6'),'gsm':_0x3dda('0x7')};var strategy={'rrmemory':_0x3dda('0x8'),'roundrobin':_0x3dda('0x9')};function VoiceQueue(_0x4cf418){this['id']=_0x4cf418['id']||0x0;this[_0x3dda('0xa')]=_0x4cf418[_0x3dda('0xa')]||'';this[_0x3dda('0xb')]=_0x4cf418['monitor_format']||'';this[_0x3dda('0xc')]=_0x4cf418[_0x3dda('0xc')]||_0x3dda('0xd');this[_0x3dda('0xe')]=0x0;this[_0x3dda('0xf')]=0x0;this['total']=0x0;this[_0x3dda('0x10')]=0x0;this[_0x3dda('0x11')]=0x0;this['sumHoldTime']=0x0;this[_0x3dda('0x12')]=0x0;this[_0x3dda('0x13')]=0x0;this[_0x3dda('0x14')]=0x0;this[_0x3dda('0x15')]=0x0;this['available']=0x0;this[_0x3dda('0x16')]=_0x4cf418[_0x3dda('0x16')]||![];this[_0x3dda('0x17')]=_0x4cf418[_0x3dda('0x17')]||0xa;this['autopause']=_0x4cf418[_0x3dda('0x18')]||'no';this['sendMessageOneNotActive']=!![];this['message']='';this[_0x3dda('0x19')]=0x0;this[_0x3dda('0x1a')]=0x0;this[_0x3dda('0x1b')]=_0x4cf418['dialTimezone']||null;this[_0x3dda('0x1c')]=_0x4cf418['dialGlobalInterval']?_0x4cf418[_0x3dda('0x1c')]:null;this[_0x3dda('0x1d')]=_0x4cf418[_0x3dda('0x1d')];this[_0x3dda('0x1e')]=_0x4cf418['dialMethod']||_0x3dda('0x1f');this[_0x3dda('0x20')]=_0x4cf418[_0x3dda('0x20')]||0x0;this['dialLimitQueue']=_0x4cf418['dialLimitQueue']||0x0;this['dialPowerLevel']=_0x4cf418[_0x3dda('0x21')]||0x1;this[_0x3dda('0x22')]=_0x4cf418[_0x3dda('0x22')]||_0x3dda('0x23');this[_0x3dda('0x24')]=_0x4cf418[_0x3dda('0x24')]||0.03;this[_0x3dda('0x25')]=_0x4cf418[_0x3dda('0x25')]||0x258;this['dialOriginateCallerIdName']=_0x4cf418[_0x3dda('0x26')]||_0x3dda('0x27');this[_0x3dda('0x28')]=_0x4cf418[_0x3dda('0x28')]||'anonymous';this['dialOriginateTimeout']=_0x4cf418[_0x3dda('0x29')]||0x1e;this[_0x3dda('0x2a')]=_0x4cf418['dialQueueOptions']||_0x3dda('0x2b');this[_0x3dda('0x2c')]=_0x4cf418['dialQueueTimeout']||0x3;this[_0x3dda('0x2d')]=_0x4cf418[_0x3dda('0x2d')]||undefined;this[_0x3dda('0x2e')]=_0x4cf418[_0x3dda('0x2e')]||0x3;this['dialCongestionRetryFrequency']=_0x4cf418['dialCongestionRetryFrequency']||0x96;this[_0x3dda('0x2f')]=_0x4cf418[_0x3dda('0x2f')]||0x3;this['dialBusyRetryFrequency']=_0x4cf418[_0x3dda('0x30')]||0x96;this[_0x3dda('0x31')]=_0x4cf418[_0x3dda('0x31')]||0x3;this['dialNoAnswerRetryFrequency']=_0x4cf418[_0x3dda('0x32')]||0x96;this[_0x3dda('0x33')]=_0x4cf418[_0x3dda('0x33')]||0x3;this[_0x3dda('0x34')]=_0x4cf418['dialNoSuchNumberRetryFrequency']||0x96;this[_0x3dda('0x35')]=_0x4cf418['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x4cf418['dialDropRetryFrequency']||0x96;this['dialAbandonedMaxRetry']=_0x4cf418[_0x3dda('0x36')]||0x3;this[_0x3dda('0x37')]=_0x4cf418['dialAbandonedRetryFrequency']||0x96;this[_0x3dda('0x38')]=_0x4cf418[_0x3dda('0x38')]||0x3;this[_0x3dda('0x39')]=_0x4cf418[_0x3dda('0x39')]||0x96;this[_0x3dda('0x3a')]=_0x4cf418['dialAgentRejectMaxRetry']||0x3;this[_0x3dda('0x3b')]=_0x4cf418[_0x3dda('0x3b')]||0x96;this['callAdditionalPhoneAfterMin']=_0x4cf418[_0x3dda('0x3c')]||0x3;this[_0x3dda('0x3d')]=_0x4cf418[_0x3dda('0x3d')]||0x4;this[_0x3dda('0x3e')]=_0x4cf418['Trunk']?_0x4cf418[_0x3dda('0x3e')]:undefined;this[_0x3dda('0x3f')]=_0x4cf418['TrunkBackup']?_0x4cf418[_0x3dda('0x3f')]:undefined;this[_0x3dda('0x40')]=_0x4cf418['dialPrefix']||undefined;this[_0x3dda('0x41')]=_0x4cf418['Interval']?_0x4cf418[_0x3dda('0x41')]:undefined;this['dialOrderByScheduledAt']=_0x4cf418[_0x3dda('0x42')]||_0x3dda('0x43');this[_0x3dda('0x44')]=_0x4cf418[_0x3dda('0x44')]||undefined;this[_0x3dda('0x45')]=_0x4cf418['dialCutDigit']||undefined;this[_0x3dda('0x46')]=strategy[_0x4cf418[_0x3dda('0x46')]]||_0x3dda('0x8');this[_0x3dda('0x47')]=!![];this['dialAMDActive']=_0x4cf418[_0x3dda('0x48')]||![];this[_0x3dda('0x49')]=_0x4cf418[_0x3dda('0x49')];this[_0x3dda('0x4a')]=_0x4cf418[_0x3dda('0x4a')];this[_0x3dda('0x4b')]=_0x4cf418[_0x3dda('0x4b')];this['dialAMDTotalAnalysisTime']=_0x4cf418['dialAMDTotalAnalysisTime'];this[_0x3dda('0x4c')]=_0x4cf418[_0x3dda('0x4c')];this[_0x3dda('0x4d')]=_0x4cf418['dialAMDBetweenWordsSilence'];this[_0x3dda('0x4e')]=_0x4cf418[_0x3dda('0x4e')];this[_0x3dda('0x4f')]=_0x4cf418['dialAMDSilenceThreshold'];this[_0x3dda('0x50')]=_0x4cf418[_0x3dda('0x50')];this['outboundRejectCallsDay']=0x0;this[_0x3dda('0x51')]=0x0;this['timeout']=_0x4cf418[_0x3dda('0x52')];this[_0x3dda('0x53')]=0x0;this[_0x3dda('0x54')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x3dda('0x55')]=0x0;this[_0x3dda('0x56')]=0x0;this[_0x3dda('0x57')]=0x0;this[_0x3dda('0x58')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0x3dda('0x59')]=0x0;this[_0x3dda('0x5a')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0x3dda('0x5b')]=0x0;this[_0x3dda('0x5c')]=0x0;this[_0x3dda('0x5d')]=0x0;this[_0x3dda('0x5e')]=undefined;this[_0x3dda('0x5f')]=undefined;this[_0x3dda('0x60')]=undefined;this[_0x3dda('0x61')]=1.05;this[_0x3dda('0x62')]=0x0;this[_0x3dda('0x63')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0x3dda('0x64')]=0x0;this[_0x3dda('0x65')]=0x0;this[_0x3dda('0x66')]=0x0;this[_0x3dda('0x67')]=0x0;this[_0x3dda('0x68')]=0x0;this[_0x3dda('0x69')]=_0x4cf418[_0x3dda('0x6a')]||0x14;this[_0x3dda('0x6b')]=_0x4cf418[_0x3dda('0x6a')]||0xa;this[_0x3dda('0x6c')]=0x0;this[_0x3dda('0x6d')]=0x0;this[_0x3dda('0x6e')]=0x1;this[_0x3dda('0x6f')]=0x0;this['erlangCallToSecond']=0x0;this[_0x3dda('0x70')]=0x0;this[_0x3dda('0x71')]=0x0;this[_0x3dda('0x72')]=_0x4cf418['dialRecallMeTimeout']||0x1e;this['dialRecallInQueue']=_0x4cf418[_0x3dda('0x73')]||![];this[_0x3dda('0x74')]=_0x4cf418[_0x3dda('0x74')]||undefined;this[_0x3dda('0x75')]=_0x4cf418[_0x3dda('0x75')]||![];this[_0x3dda('0x76')]=_0x4cf418[_0x3dda('0x76')]||![];this['monitor_format']=monitorFormat[_0x4cf418[_0x3dda('0xb')]]?monitorFormat[_0x4cf418[_0x3dda('0xb')]]:undefined;this[_0x3dda('0x77')]=_0x4cf418[_0x3dda('0x77')]||![];this[_0x3dda('0x78')]=_0x4cf418['mandatoryDispositionPause']?_0x4cf418[_0x3dda('0x78')]:undefined;}module['exports']=VoiceQueue; \ No newline at end of file +var _0x0af6=['outboundAbandonedDay','startProgressive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalDroppedCallsTimeout','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','inuse','busy','invalid','unavailable','ringing','onhold','wav','gsm','rrmemory','monitor_format','inbound','waiting','total','sumDuration','sumHoldTime','sumBillable','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','temp','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS'];(function(_0x459149,_0x56eed1){var _0x5b8dae=function(_0x375f07){while(--_0x375f07){_0x459149['push'](_0x459149['shift']());}};_0x5b8dae(++_0x56eed1);}(_0x0af6,0x1ce));var _0x60af=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x0af6[_0x1928c9];return _0x51b5fb;};'use strict';var statusDesc=[_0x60af('0x0'),'not_inuse',_0x60af('0x1'),_0x60af('0x2'),_0x60af('0x3'),_0x60af('0x4'),_0x60af('0x5'),'ringinuse',_0x60af('0x6')];var monitorFormat={'wav':_0x60af('0x7'),'wav49':'wav49','gsm':_0x60af('0x8')};var strategy={'rrmemory':_0x60af('0x9'),'roundrobin':'roundrobin'};function VoiceQueue(_0x4cfa34){this['id']=_0x4cfa34['id']||0x0;this['name']=_0x4cfa34['name']||'';this[_0x60af('0xa')]=_0x4cfa34[_0x60af('0xa')]||'';this['type']=_0x4cfa34['type']||_0x60af('0xb');this[_0x60af('0xc')]=0x0;this['talking']=0x0;this[_0x60af('0xd')]=0x0;this['answered']=0x0;this[_0x60af('0xe')]=0x0;this[_0x60af('0xf')]=0x0;this[_0x60af('0x10')]=0x0;this['unmanaged']=0x0;this[_0x60af('0x11')]=0x0;this[_0x60af('0x12')]=0x0;this[_0x60af('0x13')]=0x0;this[_0x60af('0x14')]=_0x4cfa34[_0x60af('0x14')]||![];this[_0x60af('0x15')]=_0x4cfa34['acwTimeout']||0xa;this[_0x60af('0x16')]=_0x4cfa34[_0x60af('0x16')]||'no';this[_0x60af('0x17')]=!![];this['message']='';this['originated']=0x0;this[_0x60af('0x18')]=0x0;this['dialTimezone']=_0x4cfa34['dialTimezone']||null;this[_0x60af('0x19')]=_0x4cfa34[_0x60af('0x19')]?_0x4cfa34[_0x60af('0x19')]:null;this[_0x60af('0x1a')]=_0x4cfa34['dialActive'];this[_0x60af('0x1b')]=_0x4cfa34['dialMethod']||_0x60af('0x1c');this['dialLimitChannel']=_0x4cfa34[_0x60af('0x1d')]||0x0;this[_0x60af('0x1e')]=_0x4cfa34['dialLimitQueue']||0x0;this[_0x60af('0x1f')]=_0x4cfa34[_0x60af('0x1f')]||0x1;this[_0x60af('0x20')]=_0x4cfa34[_0x60af('0x20')]||_0x60af('0x21');this[_0x60af('0x22')]=_0x4cfa34[_0x60af('0x22')]||0.03;this[_0x60af('0x23')]=_0x4cfa34['dialPredictiveInterval']||0x258;this['dialOriginateCallerIdName']=_0x4cfa34[_0x60af('0x24')]||_0x60af('0x25');this[_0x60af('0x26')]=_0x4cfa34['dialOriginateCallerIdNumber']||_0x60af('0x25');this[_0x60af('0x27')]=_0x4cfa34[_0x60af('0x27')]||0x1e;this[_0x60af('0x28')]=_0x4cfa34[_0x60af('0x28')]||'tTxX';this[_0x60af('0x29')]=_0x4cfa34[_0x60af('0x29')]||0x3;this[_0x60af('0x2a')]=_0x4cfa34[_0x60af('0x2a')]||undefined;this[_0x60af('0x2b')]=_0x4cfa34[_0x60af('0x2b')]||0x3;this[_0x60af('0x2c')]=_0x4cfa34['dialCongestionRetryFrequency']||0x96;this[_0x60af('0x2d')]=_0x4cfa34[_0x60af('0x2d')]||0x3;this[_0x60af('0x2e')]=_0x4cfa34['dialBusyRetryFrequency']||0x96;this[_0x60af('0x2f')]=_0x4cfa34[_0x60af('0x2f')]||0x3;this[_0x60af('0x30')]=_0x4cfa34[_0x60af('0x30')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x4cfa34[_0x60af('0x31')]||0x3;this[_0x60af('0x32')]=_0x4cfa34[_0x60af('0x32')]||0x96;this[_0x60af('0x33')]=_0x4cfa34[_0x60af('0x33')]||0x3;this['dialDropRetryFrequency']=_0x4cfa34[_0x60af('0x34')]||0x96;this['dialAbandonedMaxRetry']=_0x4cfa34['dialAbandonedMaxRetry']||0x3;this[_0x60af('0x35')]=_0x4cfa34[_0x60af('0x35')]||0x96;this[_0x60af('0x36')]=_0x4cfa34['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0x4cfa34[_0x60af('0x37')]||0x96;this['dialAgentRejectMaxRetry']=_0x4cfa34[_0x60af('0x38')]||0x3;this['dialAgentRejectRetryFrequency']=_0x4cfa34[_0x60af('0x39')]||0x96;this[_0x60af('0x3a')]=_0x4cfa34[_0x60af('0x3a')]||0x3;this['dialGlobalMaxRetry']=_0x4cfa34[_0x60af('0x3b')]||0x4;this[_0x60af('0x3c')]=_0x4cfa34[_0x60af('0x3c')]?_0x4cfa34[_0x60af('0x3c')]:undefined;this[_0x60af('0x3d')]=_0x4cfa34[_0x60af('0x3d')]?_0x4cfa34['TrunkBackup']:undefined;this[_0x60af('0x3e')]=_0x4cfa34[_0x60af('0x3e')]||undefined;this['Interval']=_0x4cfa34['Interval']?_0x4cfa34[_0x60af('0x3f')]:undefined;this[_0x60af('0x40')]=_0x4cfa34[_0x60af('0x40')]||_0x60af('0x41');this[_0x60af('0x42')]=_0x4cfa34['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x60af('0x43')]=_0x4cfa34['dialCutDigit']||undefined;this[_0x60af('0x44')]=strategy[_0x4cfa34[_0x60af('0x44')]]||_0x60af('0x9');this['queueStatusComplete']=!![];this[_0x60af('0x45')]=_0x4cfa34['dialAMDActive']||![];this['dialAMDInitialSilence']=_0x4cfa34['dialAMDInitialSilence'];this[_0x60af('0x46')]=_0x4cfa34[_0x60af('0x46')];this[_0x60af('0x47')]=_0x4cfa34[_0x60af('0x47')];this[_0x60af('0x48')]=_0x4cfa34[_0x60af('0x48')];this['dialAMDMinWordLength']=_0x4cfa34['dialAMDMinWordLength'];this[_0x60af('0x49')]=_0x4cfa34['dialAMDBetweenWordsSilence'];this['dialAMDMaximumNumberOfWords']=_0x4cfa34[_0x60af('0x4a')];this[_0x60af('0x4b')]=_0x4cfa34[_0x60af('0x4b')];this['dialAMDMaximumWordLength']=_0x4cfa34[_0x60af('0x4c')];this[_0x60af('0x4d')]=0x0;this['pTalking']=0x0;this[_0x60af('0x4e')]=_0x4cfa34[_0x60af('0x4e')];this['outboundAnswerCallsDay']=0x0;this[_0x60af('0x4f')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x60af('0x50')]=0x0;this[_0x60af('0x51')]=0x0;this[_0x60af('0x52')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0x60af('0x53')]=0x0;this[_0x60af('0x54')]=0x0;this[_0x60af('0x55')]=0x0;this[_0x60af('0x56')]=0x0;this[_0x60af('0x57')]=0x0;this['outboundReCallsDay']=0x0;this[_0x60af('0x58')]=0x0;this[_0x60af('0x59')]=undefined;this['startPredictive']=undefined;this[_0x60af('0x5a')]=undefined;this[_0x60af('0x5b')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0x60af('0x5c')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0x60af('0x5d')]=0x0;this[_0x60af('0x5e')]=0x0;this[_0x60af('0x5f')]=_0x4cfa34[_0x60af('0x60')]||0x14;this[_0x60af('0x61')]=_0x4cfa34[_0x60af('0x60')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x60af('0x62')]=0x0;this[_0x60af('0x63')]=0x1;this[_0x60af('0x64')]=0x0;this['erlangCallToSecond']=0x0;this[_0x60af('0x65')]=0x0;this[_0x60af('0x66')]=0x0;this['dialRecallMeTimeout']=_0x4cfa34['dialRecallMeTimeout']||0x1e;this['dialRecallInQueue']=_0x4cfa34[_0x60af('0x67')]||![];this[_0x60af('0x68')]=_0x4cfa34[_0x60af('0x68')]||undefined;this[_0x60af('0x69')]=_0x4cfa34['dialAgiAfterHangupClient']||![];this['dialAgiAfterHangupAgent']=_0x4cfa34[_0x60af('0x6a')]||![];this['monitor_format']=monitorFormat[_0x4cfa34[_0x60af('0xa')]]?monitorFormat[_0x4cfa34[_0x60af('0xa')]]:undefined;this[_0x60af('0x6b')]=_0x4cfa34[_0x60af('0x6b')]||![];this[_0x60af('0x6c')]=_0x4cfa34['mandatoryDispositionPause']?_0x4cfa34[_0x60af('0x6c')]:undefined;}module[_0x60af('0x6d')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 7fa1cb7..ac7e1f4 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 _0x6194=['username','accessKey','remoteUri','serverUrl','Configurations','name'];(function(_0x2bfde2,_0xdd460a){var _0x1f9f01=function(_0x1068a7){while(--_0x1068a7){_0x2bfde2['push'](_0x2bfde2['shift']());}};_0x1f9f01(++_0xdd460a);}(_0x6194,0x173));var _0x4619=function(_0x2d8db5,_0x3c9c8d){_0x2d8db5=_0x2d8db5-0x0;var _0xdc5579=_0x6194[_0x2d8db5];return _0xdc5579;};'use strict';function VtigerAccount(_0x5d141b){this['id']=_0x5d141b['id']||0x0;this[_0x4619('0x0')]=_0x5d141b[_0x4619('0x0')]||'';this['username']=_0x5d141b[_0x4619('0x1')]||'';this['accessKey']=_0x5d141b[_0x4619('0x2')]||'';this[_0x4619('0x3')]=_0x5d141b['remoteUri']||'';this[_0x4619('0x4')]=_0x5d141b[_0x4619('0x4')]||'';this['Configurations']=_0x5d141b[_0x4619('0x5')]||{};}module['exports']=VtigerAccount; \ No newline at end of file +var _0x2191=['serverUrl','Configurations','exports','name','username','accessKey'];(function(_0x3855b7,_0x1fcf5c){var _0x46d712=function(_0x85178d){while(--_0x85178d){_0x3855b7['push'](_0x3855b7['shift']());}};_0x46d712(++_0x1fcf5c);}(_0x2191,0x99));var _0x1219=function(_0x413178,_0x2e082d){_0x413178=_0x413178-0x0;var _0x25206d=_0x2191[_0x413178];return _0x25206d;};'use strict';function VtigerAccount(_0x3ca3cf){this['id']=_0x3ca3cf['id']||0x0;this[_0x1219('0x0')]=_0x3ca3cf[_0x1219('0x0')]||'';this[_0x1219('0x1')]=_0x3ca3cf['username']||'';this[_0x1219('0x2')]=_0x3ca3cf[_0x1219('0x2')]||'';this['remoteUri']=_0x3ca3cf['remoteUri']||'';this[_0x1219('0x3')]=_0x3ca3cf[_0x1219('0x3')]||'';this['Configurations']=_0x3ca3cf[_0x1219('0x4')]||{};}module[_0x1219('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 408c176..b3d1124 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 _0x0370=['authType','type','serverUrl','Configurations','name','username','password','remoteUri'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x0370,0x184));var _0x0037=function(_0x11fef0,_0x7d5c89){_0x11fef0=_0x11fef0-0x0;var _0x5d9b58=_0x0370[_0x11fef0];return _0x5d9b58;};'use strict';function ZendeskAccount(_0x2bccd7){this['id']=_0x2bccd7['id']||0x0;this[_0x0037('0x0')]=_0x2bccd7[_0x0037('0x0')]||'';this[_0x0037('0x1')]=_0x2bccd7[_0x0037('0x1')]||'';this[_0x0037('0x2')]=_0x2bccd7[_0x0037('0x2')]||'';this['token']=_0x2bccd7['token']||'';this[_0x0037('0x3')]=_0x2bccd7[_0x0037('0x3')]||'';this[_0x0037('0x4')]=_0x2bccd7[_0x0037('0x4')]||'';this[_0x0037('0x5')]=_0x2bccd7[_0x0037('0x5')]||'integrationTab';this[_0x0037('0x6')]=_0x2bccd7[_0x0037('0x6')]||'';this[_0x0037('0x7')]=_0x2bccd7[_0x0037('0x7')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file +var _0x6905=['password','token','authType','type','integrationTab','serverUrl','Configurations','exports','name','username'];(function(_0x2e2afb,_0x368358){var _0x58784d=function(_0x14f4ff){while(--_0x14f4ff){_0x2e2afb['push'](_0x2e2afb['shift']());}};_0x58784d(++_0x368358);}(_0x6905,0x1d4));var _0x5690=function(_0x4d8a8f,_0x2afd4c){_0x4d8a8f=_0x4d8a8f-0x0;var _0xfc4adc=_0x6905[_0x4d8a8f];return _0xfc4adc;};'use strict';function ZendeskAccount(_0x2feb98){this['id']=_0x2feb98['id']||0x0;this[_0x5690('0x0')]=_0x2feb98[_0x5690('0x0')]||'';this[_0x5690('0x1')]=_0x2feb98[_0x5690('0x1')]||'';this[_0x5690('0x2')]=_0x2feb98['password']||'';this['token']=_0x2feb98[_0x5690('0x3')]||'';this['remoteUri']=_0x2feb98['remoteUri']||'';this[_0x5690('0x4')]=_0x2feb98['authType']||'';this[_0x5690('0x5')]=_0x2feb98[_0x5690('0x5')]||_0x5690('0x6');this[_0x5690('0x7')]=_0x2feb98['serverUrl']||'';this[_0x5690('0x8')]=_0x2feb98['Configurations']||{};}module[_0x5690('0x9')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 3f8097c..54f8c7f 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 _0x7cee=['description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','name'];(function(_0x5b54d5,_0x19a84f){var _0x583fd4=function(_0x4a0981){while(--_0x4a0981){_0x5b54d5['push'](_0x5b54d5['shift']());}};_0x583fd4(++_0x19a84f);}(_0x7cee,0x135));var _0xe7ce=function(_0x5ff517,_0x3e4ee0){_0x5ff517=_0x5ff517-0x0;var _0x19a245=_0x7cee[_0x5ff517];return _0x19a245;};'use strict';function ZohoAccount(_0x678629){this['id']=_0x678629['id']||0x0;this[_0xe7ce('0x0')]=_0x678629[_0xe7ce('0x0')]||'';this[_0xe7ce('0x1')]=_0x678629[_0xe7ce('0x1')]||'';this['host']=_0x678629[_0xe7ce('0x2')]||'';this[_0xe7ce('0x3')]=_0x678629['zone']||'';this[_0xe7ce('0x4')]=_0x678629[_0xe7ce('0x4')]||'';this[_0xe7ce('0x5')]=_0x678629[_0xe7ce('0x5')]||'';this['serverUrl']=_0x678629[_0xe7ce('0x6')]||'';this[_0xe7ce('0x7')]=_0x678629[_0xe7ce('0x7')]||'';this[_0xe7ce('0x8')]=_0x678629['refreshToken']||'';this[_0xe7ce('0x9')]=_0x678629[_0xe7ce('0x9')]||{};}module['exports']=ZohoAccount; \ No newline at end of file +var _0x40b6=['Configurations','name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken'];(function(_0x6cf3b6,_0x4b7560){var _0xdbe948=function(_0x1504d6){while(--_0x1504d6){_0x6cf3b6['push'](_0x6cf3b6['shift']());}};_0xdbe948(++_0x4b7560);}(_0x40b6,0x17d));var _0x640b=function(_0x1bf809,_0x536f55){_0x1bf809=_0x1bf809-0x0;var _0x1caa4e=_0x40b6[_0x1bf809];return _0x1caa4e;};'use strict';function ZohoAccount(_0x4fad08){this['id']=_0x4fad08['id']||0x0;this['name']=_0x4fad08[_0x640b('0x0')]||'';this[_0x640b('0x1')]=_0x4fad08['description']||'';this['host']=_0x4fad08[_0x640b('0x2')]||'';this[_0x640b('0x3')]=_0x4fad08[_0x640b('0x3')]||'';this['clientId']=_0x4fad08[_0x640b('0x4')]||'';this[_0x640b('0x5')]=_0x4fad08[_0x640b('0x5')]||'';this['serverUrl']=_0x4fad08[_0x640b('0x6')]||'';this[_0x640b('0x7')]=_0x4fad08['code']||'';this[_0x640b('0x8')]=_0x4fad08[_0x640b('0x8')]||'';this[_0x640b('0x9')]=_0x4fad08[_0x640b('0x9')]||{};}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 3499ac6..0f8280f 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 _0x77e6=['VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','util','lodash','moment','isNil','string','idContact','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','phone','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countabandonedretry','countagentrejectretry','callback','callbackat','recallme','ContactId','ListId','UserId'];(function(_0x54613f,_0x47a2b9){var _0x1a51b2=function(_0x244f7f){while(--_0x244f7f){_0x54613f['push'](_0x54613f['shift']());}};_0x1a51b2(++_0x47a2b9);}(_0x77e6,0x1a6));var _0x677e=function(_0x580edc,_0x5297d7){_0x580edc=_0x580edc-0x0;var _0x22d06a=_0x77e6[_0x580edc];return _0x22d06a;};'use strict';var util=require(_0x677e('0x0'));var _=require(_0x677e('0x1'));var moment=require(_0x677e('0x2'));function checkNameSurname(_0xa48f0c,_0x2dba41,_0x3a0a0e){var _0x4142a3='';if(!_[_0x677e('0x3')](_0x2dba41)&&'string'===typeof _0x2dba41){_0x4142a3+=_0x2dba41;}if(!_[_0x677e('0x3')](_0x3a0a0e)&&_0x677e('0x4')===typeof _0x3a0a0e){_0x4142a3+='\x20'+_0x3a0a0e;}if(_0x4142a3!==''){return _0x4142a3;}return _0xa48f0c;}function Action(_0x52e3f9,_0x18c5e1,_0x591b21,_0x40d314,_0x4d1a57){this['uniqueid']=_0x591b21||undefined;this[_0x677e('0x5')]=_0x52e3f9['id'];this[_0x677e('0x6')]=_0x18c5e1[_0x677e('0x7')];this[_0x677e('0x8')]=_0x18c5e1['type'];this[_0x677e('0x9')]='queue';this[_0x677e('0xa')]=![];this[_0x677e('0xb')]=_[_0x677e('0x3')](_0x52e3f9[_0x677e('0xc')])?undefined:_0x52e3f9[_0x677e('0xc')][_0x677e('0x7')];this[_0x677e('0xd')]=this[_0x677e('0xb')]?util[_0x677e('0xe')](_0x677e('0xf'),this[_0x677e('0xb')]):_0x40d314||undefined;this[_0x677e('0x10')]=checkNameSurname(_0x52e3f9[_0x677e('0x11')][_0x677e('0x12')],_0x52e3f9['Contact']['firstName'],_0x52e3f9['Contact'][_0x677e('0x13')]);this[_0x677e('0x14')]=_0x52e3f9[_0x677e('0x14')]||![];this[_0x677e('0x15')]=_0x52e3f9[_0x677e('0x12')];this[_0x677e('0x16')]=_0x52e3f9[_0x677e('0x16')];this[_0x677e('0x17')]=_0x52e3f9[_0x677e('0x17')]||0x0;this[_0x677e('0x18')]=_0x52e3f9[_0x677e('0x18')]||0x0;this[_0x677e('0x19')]=_0x52e3f9['countnoanswerretry']||0x0;this[_0x677e('0x1a')]=(_0x52e3f9[_0x677e('0x17')]||0x0)+(_0x52e3f9[_0x677e('0x18')]||0x0)+(_0x52e3f9[_0x677e('0x19')]||0x0)+(_0x52e3f9[_0x677e('0x1b')]||0x0)+(_0x52e3f9[_0x677e('0x1c')]||0x0)+(_0x52e3f9['countabandonedretry']||0x0)+(_0x52e3f9[_0x677e('0x1d')]||0x0)+(_0x52e3f9['countagentrejectretry']||0x0);this[_0x677e('0x1b')]=_0x52e3f9[_0x677e('0x1b')]||0x0;this[_0x677e('0x1c')]=_0x52e3f9['countdropretry']||0x0;this[_0x677e('0x1e')]=_0x52e3f9[_0x677e('0x1e')]||0x0;this[_0x677e('0x1d')]=_0x52e3f9[_0x677e('0x1d')]||0x0;this[_0x677e('0x1f')]=_0x52e3f9[_0x677e('0x1f')]||0x0;this[_0x677e('0x20')]=_0x52e3f9['callback'];this['callbackuniqueid']=_0x52e3f9['callbackuniqueid'];this[_0x677e('0x21')]=_0x52e3f9[_0x677e('0x21')];this[_0x677e('0x22')]=_0x52e3f9[_0x677e('0x22')];this[_0x677e('0x23')]=_0x52e3f9[_0x677e('0x23')];this[_0x677e('0x24')]=_0x52e3f9[_0x677e('0x24')];this[_0x677e('0x25')]=_[_0x677e('0x3')](_0x52e3f9['Agent'])?_0x52e3f9['UserId']:_0x52e3f9[_0x677e('0xc')]['id'];this[_0x677e('0x26')]=_0x52e3f9['VoiceQueueId'];this[_0x677e('0x27')]='';this[_0x677e('0x28')]='';}Action[_0x677e('0x29')][_0x677e('0x2a')]=function(){return util[_0x677e('0xe')](_0x677e('0x2b'),this['calleridname'],this[_0x677e('0x2c')]);};module[_0x677e('0x2d')]=Action; \ No newline at end of file +var _0x955f=['countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','calleridname','exports','util','lodash','moment','isNil','uniqueid','queue','name','type','campaigntype','dialAnswer','Agent','channelAgent','format','membername','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry'];(function(_0x117753,_0x15f8ce){var _0x2ba9f1=function(_0x2de444){while(--_0x2de444){_0x117753['push'](_0x117753['shift']());}};_0x2ba9f1(++_0x15f8ce);}(_0x955f,0x1eb));var _0xf955=function(_0x448a7b,_0x206ee4){_0x448a7b=_0x448a7b-0x0;var _0x3b9129=_0x955f[_0x448a7b];return _0x3b9129;};'use strict';var util=require(_0xf955('0x0'));var _=require(_0xf955('0x1'));var moment=require(_0xf955('0x2'));function checkNameSurname(_0x382225,_0x2834f7,_0x585f6e){var _0xd75c8f='';if(!_['isNil'](_0x2834f7)&&'string'===typeof _0x2834f7){_0xd75c8f+=_0x2834f7;}if(!_[_0xf955('0x3')](_0x585f6e)&&'string'===typeof _0x585f6e){_0xd75c8f+='\x20'+_0x585f6e;}if(_0xd75c8f!==''){return _0xd75c8f;}return _0x382225;}function Action(_0x13b796,_0x2caff2,_0x3fdac2,_0x59d5b3,_0x18432f){this[_0xf955('0x4')]=_0x3fdac2||undefined;this['idContact']=_0x13b796['id'];this[_0xf955('0x5')]=_0x2caff2[_0xf955('0x6')];this[_0xf955('0x7')]=_0x2caff2[_0xf955('0x7')];this[_0xf955('0x8')]=_0xf955('0x5');this[_0xf955('0x9')]=![];this['membername']=_[_0xf955('0x3')](_0x13b796['Agent'])?undefined:_0x13b796[_0xf955('0xa')][_0xf955('0x6')];this[_0xf955('0xb')]=this['membername']?util[_0xf955('0xc')]('SIP/%s',this[_0xf955('0xd')]):_0x59d5b3||undefined;this['calleridname']=checkNameSurname(_0x13b796[_0xf955('0xe')][_0xf955('0xf')],_0x13b796[_0xf955('0xe')][_0xf955('0x10')],_0x13b796[_0xf955('0xe')][_0xf955('0x11')]);this[_0xf955('0x12')]=_0x13b796[_0xf955('0x12')]||![];this[_0xf955('0x13')]=_0x13b796[_0xf955('0xf')];this['scheduledat']=_0x13b796[_0xf955('0x14')];this['countbusyretry']=_0x13b796[_0xf955('0x15')]||0x0;this[_0xf955('0x16')]=_0x13b796[_0xf955('0x16')]||0x0;this[_0xf955('0x17')]=_0x13b796['countnoanswerretry']||0x0;this['countglobal']=(_0x13b796[_0xf955('0x15')]||0x0)+(_0x13b796[_0xf955('0x16')]||0x0)+(_0x13b796[_0xf955('0x17')]||0x0)+(_0x13b796['countnosuchnumberretry']||0x0)+(_0x13b796[_0xf955('0x18')]||0x0)+(_0x13b796[_0xf955('0x19')]||0x0)+(_0x13b796[_0xf955('0x1a')]||0x0)+(_0x13b796[_0xf955('0x1b')]||0x0);this[_0xf955('0x1c')]=_0x13b796['countnosuchnumberretry']||0x0;this[_0xf955('0x18')]=_0x13b796[_0xf955('0x18')]||0x0;this[_0xf955('0x19')]=_0x13b796['countabandonedretry']||0x0;this[_0xf955('0x1a')]=_0x13b796['countmachineretry']||0x0;this[_0xf955('0x1b')]=_0x13b796[_0xf955('0x1b')]||0x0;this[_0xf955('0x1d')]=_0x13b796[_0xf955('0x1d')];this[_0xf955('0x1e')]=_0x13b796['callbackuniqueid'];this[_0xf955('0x1f')]=_0x13b796[_0xf955('0x1f')];this[_0xf955('0x20')]=_0x13b796[_0xf955('0x20')];this[_0xf955('0x21')]=_0x13b796[_0xf955('0x21')];this[_0xf955('0x22')]=_0x13b796['ListId'];this[_0xf955('0x23')]=_[_0xf955('0x3')](_0x13b796[_0xf955('0xa')])?_0x13b796[_0xf955('0x23')]:_0x13b796[_0xf955('0xa')]['id'];this[_0xf955('0x24')]=_0x13b796[_0xf955('0x24')];this['originatecalleridnum']='';this[_0xf955('0x25')]='';}Action[_0xf955('0x26')][_0xf955('0x27')]=function(){return util[_0xf955('0xc')](_0xf955('0x28'),this[_0xf955('0x29')],this['number']);};module[_0xf955('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 9b6c779..d2a2245 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 _0x0065=['\x20Queue','countbusyretry','Busy','dialBusyRetryFrequency','busy','[callProgressDetectingCustomer][logBusy]','cloneAction','Global','activeContact','countnoanswerretry','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerRetryFrequency','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','dialCongestionMaxRetry','CANCEL','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','dialAbandonedRetryFrequency','cause-txt','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','destlinkedid','isUndefined','object','reason','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','logAgent','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','updateOriginated','[originated][decrement][callProgressDetectingAgent]','resolve','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','Contact','VoiceQueueId','lookAgent','isEmpty','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','Calling','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','[Blacklist][error]','active','SIP/%s','reachable','unmonitored','run','execRun','unlockContact','getContactPreview','recallme','checkIsBlackList','checkInBlack','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','validateContact','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','execCall','trim','phone','SIP/%s/%s%s','substring','getCallerId','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','originatecalleridnum','extractCalleridNumber','variablesAction','destconnectedlinenum','calleridnum','user:%s','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncOriginateResponse','actionid','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','rejected','callProgressDetectingAgent','dialQueueProject','cause','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','addVariable','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','lodash','md5','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','tail','finally','sequence','trunks','actions','agents','clockClearZombieChannels','originateresponse','bind','syncHangup','syncHangupRequest','syncDialEnd','newexten','syncNewExten','syncVarSet','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','type','outbound','name','available','pTalking','sumBillable','sumDuration','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalTotalCalls','message','originated','erlangCallToSecond','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','stringify','voice:queue:%s','voice_queue:save','info','format','voice_queue_channel:remove','emit','voice_queue_presence:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','campaignsPreview','hasOwnProperty','booked','clearZombieChannels','recallMe','clearZombieChannel','enqueue','isNil','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','ListId','Action','status','channel','catch','No\x20such\x20channel','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','agentReadyId','then','scheduledat','dialRecallMeTimeout','Agent','voicePause','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','setMessage','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','unlockAgent','linkedid','actioncountonusuch','incrementPreviewCounters','idContact','swapAdditionalPhones','ANSWER','responsetime','[syncHangup][talking][increment]','connect','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','answered','[16]','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','talktime','uniqueid'];(function(_0x1a84fc,_0x32fb6f){var _0x178d3a=function(_0x50cadc){while(--_0x50cadc){_0x1a84fc['push'](_0x1a84fc['shift']());}};_0x178d3a(++_0x32fb6f);}(_0x0065,0x97));var _0x5006=function(_0x3dbf08,_0x1bbc94){_0x3dbf08=_0x3dbf08-0x0;var _0x258697=_0x0065[_0x3dbf08];return _0x258697;};'use strict';var util=require('util');var _=require(_0x5006('0x0'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require('moment');var md5=require(_0x5006('0x1'));var Redis=require(_0x5006('0x2'));var config=require(_0x5006('0x3'));var logger=require(_0x5006('0x4'))(_0x5006('0x5'));var loggerAction=require(_0x5006('0x4'))(_0x5006('0x6'));var ami=require(_0x5006('0x7'));var rpcDb=require(_0x5006('0x8'));var cmHopperAdditionalPhone=require(_0x5006('0x9'));var Action=require(_0x5006('0xa'));var ut=require(_0x5006('0xb'));config[_0x5006('0xc')]=_[_0x5006('0xd')](config[_0x5006('0xc')],{'host':_0x5006('0xe'),'port':0x18eb});var io=require(_0x5006('0xf'))(new Redis(config[_0x5006('0xc')]));var Sequence=function(){};Sequence[_0x5006('0x10')]['enqueue']=function(_0x2ecb42){this[_0x5006('0x11')]=this[_0x5006('0x11')]?this[_0x5006('0x11')][_0x5006('0x12')](_0x2ecb42):_0x2ecb42();};function Preview(_0x7706ba){this[_0x5006('0x13')]=new Sequence();this['campaignsPreview']=_0x7706ba['voiceQueues'];this[_0x5006('0x14')]=_0x7706ba[_0x5006('0x14')];this[_0x5006('0x15')]={};this['agents']=_0x7706ba[_0x5006('0x16')];this[_0x5006('0x17')]=0x0;ami['on'](_0x5006('0x18'),this['syncOriginateResponse'][_0x5006('0x19')](this));ami['on']('hangup',this[_0x5006('0x1a')][_0x5006('0x19')](this));ami['on']('hanguprequest',this[_0x5006('0x1b')][_0x5006('0x19')](this));ami['on']('dialend',this[_0x5006('0x1c')][_0x5006('0x19')](this));ami['on'](_0x5006('0x1d'),this[_0x5006('0x1e')][_0x5006('0x19')](this));ami['on']('varset',this[_0x5006('0x1f')][_0x5006('0x19')](this));ami['on']('attendedtransfer',this[_0x5006('0x20')][_0x5006('0x19')](this));ami['on'](_0x5006('0x21'),this[_0x5006('0x22')][_0x5006('0x19')](this));this[_0x5006('0x23')](this['campaignsPreview']);}function emit(_0x5b3767,_0x27edbe,_0x3262e5){io['to'](_0x5b3767)['emit'](_0x27edbe,_0x3262e5);}function emitCampaignPreview(_0x5791d4){if(_0x5791d4[_0x5006('0x24')]===_0x5006('0x25')){var _0x1a4c1c={'id':_0x5791d4['id'],'name':_0x5791d4[_0x5006('0x26')],'strategy':_0x5791d4['strategy'],'answered':_0x5791d4['answered'],'available':_0x5791d4[_0x5006('0x27')],'loggedIn':_0x5791d4['loggedIn'],'pTalking':_0x5791d4[_0x5006('0x28')],'sumBillable':_0x5791d4[_0x5006('0x29')],'sumDuration':_0x5791d4[_0x5006('0x2a')],'sumHoldTime':_0x5791d4['sumHoldTime']||0x0,'talking':_0x5791d4['talking'],'total':_0x5791d4[_0x5006('0x2b')],'type':_0x5791d4['type'],'unmanaged':_0x5791d4[_0x5006('0x2c')],'abandoned':_0x5791d4[_0x5006('0x2d')],'waiting':_0x5791d4[_0x5006('0x2e')],'loggedInDb':_0x5791d4[_0x5006('0x2f')],'dialActive':_0x5791d4[_0x5006('0x30')],'dialMethod':_0x5791d4[_0x5006('0x31')],'dialOriginateCallerIdName':_0x5791d4['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x5791d4['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x5791d4[_0x5006('0x32')],'dialPrefix':_0x5791d4[_0x5006('0x33')],'outboundAnswerAgiCallsDay':_0x5791d4[_0x5006('0x34')],'outboundAnswerCallsDay':_0x5791d4[_0x5006('0x35')],'outboundBlacklistCallsDay':_0x5791d4['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x5791d4[_0x5006('0x36')],'outboundCongestionCallsDay':_0x5791d4[_0x5006('0x37')],'outboundDropCallsDayACS':_0x5791d4[_0x5006('0x38')],'outboundDropCallsDayCallersExit':_0x5791d4[_0x5006('0x39')],'outboundDropCallsDayTimeout':_0x5791d4[_0x5006('0x3a')],'outboundNoAnswerCallsDay':_0x5791d4['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x5791d4[_0x5006('0x3b')],'outboundOriginateFailureCallsDay':_0x5791d4['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x5791d4[_0x5006('0x3c')],'outboundRejectCallsDay':_0x5791d4[_0x5006('0x3d')],'outboundUnknownCallsDay':_0x5791d4[_0x5006('0x3e')],'outboundAbandonedCallsDay':_0x5791d4[_0x5006('0x3f')],'predictiveIntervalAnsweredCalls':_0x5791d4[_0x5006('0x40')],'predictiveIntervalAvgHoldtime':_0x5791d4[_0x5006('0x41')],'predictiveIntervalAvgTalktime':_0x5791d4[_0x5006('0x42')],'predictiveIntervalDroppedCallsCallersExit':_0x5791d4[_0x5006('0x43')],'predictiveIntervalDroppedCallsTimeout':_0x5791d4[_0x5006('0x44')],'predictiveIntervalErlangCalls':_0x5791d4[_0x5006('0x45')],'predictiveIntervalErlangCallsDroppedCalls':_0x5791d4[_0x5006('0x46')],'predictiveIntervalHitRate':_0x5791d4[_0x5006('0x47')],'predictiveIntervalMultiplicativeFactor':_0x5791d4['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x5791d4[_0x5006('0x48')],'predictiveIntervalAvailable':_0x5791d4['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x5791d4[_0x5006('0x49')],'message':_0x5791d4[_0x5006('0x4a')],'originated':_0x5791d4[_0x5006('0x4b')],'erlangCalls':_0x5791d4['erlangCalls'],'erlangCallToSecond':_0x5791d4[_0x5006('0x4c')],'erlangAbandonmentRate':_0x5791d4['erlangAbandonmentRate'],'erlangBusyFactor':_0x5791d4[_0x5006('0x4d')],'startPredictive':_0x5791d4[_0x5006('0x4e')],'startProgressive':_0x5791d4[_0x5006('0x4f')]};if(_0x5791d4[_0x5006('0x50')]){_0x1a4c1c[_0x5006('0x50')]={'id':_0x5791d4[_0x5006('0x50')]['id'],'name':_0x5791d4[_0x5006('0x50')][_0x5006('0x26')],'active':_0x5791d4[_0x5006('0x50')]['active'],'callerid':_0x5791d4[_0x5006('0x50')][_0x5006('0x51')]};}if(_0x5791d4[_0x5006('0x52')]){_0x1a4c1c[_0x5006('0x52')]={'id':_0x5791d4['Interval']['id'],'name':_0x5791d4[_0x5006('0x52')][_0x5006('0x26')]};}var _0x40f365=md5(JSON[_0x5006('0x53')](_0x1a4c1c));if(_0x5791d4[_0x5006('0x1')]!==_0x40f365){_0x5791d4[_0x5006('0x1')]=_0x40f365;emit(util['format'](_0x5006('0x54'),_0x1a4c1c[_0x5006('0x26')]),_0x5006('0x55'),_0x1a4c1c);}}}function emitVoiceQueueChannelRemove(_0x36e258){logger[_0x5006('0x56')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0x5006('0x53')](_0x36e258));emit(util[_0x5006('0x57')](_0x5006('0x54'),_0x36e258[_0x5006('0x26')]),_0x5006('0x58'),_0x36e258);io[_0x5006('0x59')](_0x5006('0x5a'),_0x36e258);}function notSendMessagesQueue(_0x4a68f8){if(_0x4a68f8[_0x5006('0x5b')]){if(_0x4a68f8[_0x5006('0x4b')]===0x0&&_0x4a68f8[_0x5006('0x28')]===0x0){_0x4a68f8[_0x5006('0x5b')]=![];_0x4a68f8[_0x5006('0x27')]=0x0;_0x4a68f8[_0x5006('0x5c')]=0x0;_0x4a68f8[_0x5006('0x4a')]=_0x5006('0x5d');ut[_0x5006('0x5e')](_0x5006('0x5f'),_0x4a68f8[_0x5006('0x26')]+_0x5006('0x60'));}else{_0x4a68f8[_0x5006('0x4a')]=_0x5006('0x61');ut[_0x5006('0x5e')](_0x5006('0x5f'),_0x4a68f8[_0x5006('0x26')]+_0x5006('0x62'));}emitCampaignPreview(_0x4a68f8);}}Preview[_0x5006('0x10')]['loopCampaigns']=function(){var _0x227298=this;setInterval(function(){_0x227298[_0x5006('0x63')]();},0x7cf);};Preview[_0x5006('0x10')][_0x5006('0x63')]=function(){var _0x45de17=this[_0x5006('0x64')];this[_0x5006('0x17')]+=0x1;for(var _0x1e28df in _0x45de17){if(_0x45de17[_0x5006('0x65')](_0x1e28df)&&(_0x45de17[_0x1e28df][_0x5006('0x31')]===_0x5006('0x5')||_0x45de17[_0x1e28df][_0x5006('0x31')]===_0x5006('0x66'))&&_0x45de17[_0x1e28df][_0x5006('0x24')]===_0x5006('0x25')){if(this[_0x5006('0x17')]>0x7){this[_0x5006('0x17')]=0x0;this[_0x5006('0x67')]();}}if(_0x45de17[_0x5006('0x65')](_0x1e28df)&&_0x45de17[_0x1e28df][_0x5006('0x31')]==='preview'&&_0x45de17[_0x1e28df][_0x5006('0x24')]===_0x5006('0x25')){if(_0x45de17[_0x1e28df]['dialActive']){this['setMessage'](_0x45de17[_0x1e28df]);this[_0x5006('0x68')](_0x45de17[_0x1e28df]);}else{notSendMessagesQueue(_0x45de17[_0x1e28df]);}}}};Preview[_0x5006('0x10')][_0x5006('0x69')]=function(_0x57a8e4){var _0xaa39c2=this;this[_0x5006('0x13')][_0x5006('0x6a')](function(){if(!_[_0x5006('0x6b')](_0xaa39c2[_0x5006('0x15')][_0x57a8e4])){loggerAction[_0x5006('0x56')]('[clearZombieChannels][talking]',_0x57a8e4,_0x5006('0x6c'),_0xaa39c2['actions'][_0x57a8e4][_0x5006('0x6d')],_0x5006('0x6e'),JSON[_0x5006('0x53')](_0xaa39c2[_0x5006('0x64')][_0xaa39c2['actions'][_0x57a8e4][_0x5006('0x6d')]][_0x5006('0x4b')]),_0x5006('0x6f'),JSON[_0x5006('0x53')](_0xaa39c2[_0x5006('0x64')][_0xaa39c2[_0x5006('0x15')][_0x57a8e4][_0x5006('0x6d')]][_0x5006('0x28')]),JSON[_0x5006('0x53')](_0xaa39c2['actions'][_0x57a8e4][_0x5006('0x70')]),JSON[_0x5006('0x53')](_[_0x5006('0x71')](_0xaa39c2['actions'][_0x57a8e4],['contactId','UserId','VoiceQueueId',_0x5006('0x72')])));return ami[_0x5006('0x73')]({'action':_0x5006('0x74'),'channel':_0xaa39c2[_0x5006('0x15')][_0x57a8e4][_0x5006('0x75')]})[_0x5006('0x76')](function(_0x54a50e){if(_0x54a50e[_0x5006('0x4a')]===_0x5006('0x77')){setTimeout(function(){if(_0xaa39c2[_0x5006('0x15')][_0x57a8e4]){ut['updateOriginated'](_0xaa39c2[_0x5006('0x64')][_0xaa39c2['actions'][_0x57a8e4][_0x5006('0x6d')]],_0x5006('0x78'));if(_0xaa39c2[_0x5006('0x15')][_0x57a8e4][_0x5006('0x70')]===!![]){ut[_0x5006('0x79')](_0xaa39c2['campaignsPreview'][_0xaa39c2[_0x5006('0x15')][_0x57a8e4][_0x5006('0x6d')]],_0x5006('0x78'));ut[_0x5006('0x7a')](_0x5006('0x7b')+_0x57a8e4,_0xaa39c2['actions'][_0x57a8e4]['queue']);}ut[_0x5006('0x7a')](_0x5006('0x7c')+_0x57a8e4,_0xaa39c2['actions'][_0x57a8e4][_0x5006('0x6d')]);delete _0xaa39c2[_0x5006('0x15')][_0x57a8e4];}},0x2328);}});}});};Preview['prototype'][_0x5006('0x67')]=function(){var _0x39ac60=this;loggerAction[_0x5006('0x56')](_0x5006('0x7d'),_[_0x5006('0x7e')](this[_0x5006('0x15')]));for(var _0x95d774 in this['actions']){if(_0x39ac60['actions'][_0x5006('0x65')](_0x95d774)){_0x39ac60[_0x5006('0x69')](_0x95d774);}}};Preview[_0x5006('0x10')]['recallMe']=function(_0x518c3c){var _0x4925e3=this;rpcDb['getContactRecallMe'](_0x518c3c['id'],ut[_0x5006('0x7f')](this[_0x5006('0x16')]))[_0x5006('0x80')](function(_0x3f77f4){if(!_['isNil'](_0x3f77f4)){for(var _0x32216b=0x0;_0x32216b<_0x3f77f4['length'];_0x32216b+=0x1){if(ut['getDiff'](_0x3f77f4[_0x32216b][_0x5006('0x81')])<_0x518c3c[_0x5006('0x82')]*0x3c){if(_0x3f77f4[_0x32216b][_0x5006('0x83')]&&!_0x3f77f4[_0x32216b][_0x5006('0x83')][_0x5006('0x84')]){_0x4925e3['run'](_0x3f77f4[_0x32216b]['id'])[_0x5006('0x80')](ut[_0x5006('0x85')](_0x5006('0x86')))['catch'](ut[_0x5006('0x85')]('[RecallMe]'));}else{rpcDb[_0x5006('0x87')](_0x3f77f4[_0x32216b]['id']);}}else{var _0x32c8b3=new Action(_0x3f77f4[_0x32216b],_0x518c3c);_0x32c8b3[_0x5006('0x88')]=moment()['format'](_0x5006('0x89'));_0x518c3c[_0x5006('0x3c')]+=0x1;ut[_0x5006('0x8a')](_0x32c8b3,0x17,_0x5006('0x8b'));if(_0x518c3c[_0x5006('0x8c')]){rpcDb[_0x5006('0x8d')](ut['createBody'](_0x3f77f4[_0x32216b]));rpcDb[_0x5006('0x8e')](_0x32c8b3,_0x5006('0x8f'));}else{ut[_0x5006('0x8a')](_0x32c8b3,0x16,_0x5006('0x90'));rpcDb['createCustomerHistory'](_0x32c8b3,_0x5006('0x91'));rpcDb[_0x5006('0x92')](_0x32c8b3,'[HistoryRecallClose]');}}}}})[_0x5006('0x76')](ut['logger2'](_0x5006('0x93')));};Preview['prototype'][_0x5006('0x94')]=function(_0x42fb56){_0x42fb56[_0x5006('0x5b')]=!![];if(ut[_0x5006('0x95')](_0x42fb56['loggedIn'])){_0x42fb56[_0x5006('0x4a')]=_0x5006('0x96');}else if(!ut[_0x5006('0x97')](_0x42fb56['dialActive'])){_0x42fb56[_0x5006('0x4a')]=_0x5006('0x5d');}else if(!this[_0x5006('0x98')](_0x42fb56[_0x5006('0x50')])){if(!this[_0x5006('0x98')](_0x42fb56['TrunkBackup'])){_0x42fb56[_0x5006('0x4a')]=_0x5006('0x99');}else{_0x42fb56[_0x5006('0x4a')]=_0x5006('0x9a');}}else{_0x42fb56[_0x5006('0x4a')]=_0x5006('0x9a');}emitCampaignPreview(_0x42fb56);};Preview[_0x5006('0x10')][_0x5006('0x9b')]=function(_0x4c4885,_0x433e82,_0x55c8ae){var _0x124b15=this;var _0x564c3b=this[_0x5006('0x15')][_0x433e82];var _0x4b6cbb=this['campaignsPreview'][_0x564c3b[_0x5006('0x6d')]];var _0x26d88e;var _0x11d1ef=![];var _0x2cbf24=0x2;var _0x19c78b=0x3;if(_0x4b6cbb){switch(_0x55c8ae){case'1':_0x4b6cbb[_0x5006('0x3b')]+=0x1;_0x564c3b[_0x5006('0x9c')]+=0x1;_0x564c3b[_0x5006('0x9d')]=ut[_0x5006('0x9e')](_0x564c3b);ut[_0x5006('0x8a')](_0x564c3b,0x0,_0x5006('0x9f'));ami['emit']('custom:agentnosuchnumber',ut[_0x5006('0xa0')](_0x564c3b,_0x5006('0xa1')));rpcDb['createCustomerHistory'](_0x564c3b,_0x5006('0xa2'));_0x124b15[_0x5006('0xa3')](_0x564c3b,'0',_0x4b6cbb)[_0x5006('0x80')](function(_0x231818){_0x11d1ef=_0x231818[_0x5006('0xa4')]==0x1;_0x2cbf24=_0x4b6cbb[_0x5006('0xa5')];_0x19c78b=_0x4b6cbb[_0x5006('0xa6')];if(!_0x11d1ef){if(ut['totalGlobal'](_0x564c3b)>=_0x4b6cbb[_0x5006('0xa7')]){_0x26d88e=ut['cloneAction'](_0x564c3b,0xf,'Global');rpcDb['createCustomerFinal'](_0x26d88e,_0x5006('0xa8'));}else{if(_0x564c3b[_0x5006('0x9c')]>=_0x4b6cbb['dialNoSuchNumberMaxRetry']){rpcDb[_0x5006('0x92')](_0x564c3b,_0x5006('0xa8'));}else{rpcDb[_0x5006('0xa9')](ut[_0x5006('0xaa')](_0x564c3b,_0x5006('0x9c'),_0x4b6cbb[_0x5006('0xa5')]),_0x564c3b[_0x5006('0xab')],_0x564c3b['activeContact']);}}delete this[_0x5006('0x15')][_0x4c4885[_0x5006('0xac')]];}else{_0x564c3b[_0x5006('0x9c')]++;logger[_0x5006('0x56')](_0x5006('0xad'),_0x564c3b['countnosuchnumberretry']);logger[_0x5006('0x56')]('id',_0x564c3b['idContact']);_0x124b15[_0x5006('0xae')]({'id':_0x564c3b[_0x5006('0xaf')],'field':{'countnosuchnumberretry':_0x564c3b['countnosuchnumberretry']}})[_0x5006('0x80')](function(){_0x124b15[_0x5006('0xb0')](_0x564c3b,_0x2cbf24,_0x19c78b)['then'](function(){});});}});break;case _0x5006('0xb1'):var _0x1f10f8=moment()[_0x5006('0x57')]('YYYY-MM-DD\x20HH:mm:ss');_0x564c3b[_0x5006('0xb2')]=_0x1f10f8;_0x564c3b['answertime']=_0x1f10f8;_0x564c3b[_0x5006('0x70')]=!![];_0x4b6cbb[_0x5006('0x28')]+=0x1;logger['info'](_0x5006('0xb3'),_0x564c3b['uniqueid'],'\x20Queue',_0x4b6cbb[_0x5006('0x26')],_0x5006('0x6f'),_0x4b6cbb[_0x5006('0x28')]);ami[_0x5006('0x59')]('custom:agentconnect',ut['buildObj'](_0x564c3b,_0x5006('0xb4'),this[_0x5006('0x64')][_0x564c3b[_0x5006('0x6d')]]));if(_0x4b6cbb['acw']){ami['emit'](_0x5006('0xb5'),ut[_0x5006('0xb6')](_0x564c3b));}break;case'16':ami['emit'](_0x5006('0xb7'),ut['buildObj'](_0x564c3b,_0x5006('0xb8'),this[_0x5006('0x64')][_0x564c3b[_0x5006('0x6d')]]));emitVoiceQueueChannelRemove(ut[_0x5006('0xa0')](_0x564c3b,'complete'));_0x4b6cbb[_0x5006('0x35')]+=0x1;_0x4b6cbb[_0x5006('0x2b')]+=0x1;_0x4b6cbb[_0x5006('0xb9')]+=0x1;ut['decrementTalkink'](_0x4b6cbb,_0x5006('0xba'));_0x564c3b['countglobal']=ut[_0x5006('0x9e')](_0x564c3b);ut[_0x5006('0x8a')](_0x564c3b,0x4,'Answer');rpcDb[_0x5006('0x8e')](_0x564c3b,_0x5006('0xbb'));rpcDb[_0x5006('0x92')](_0x564c3b,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0x5006('0xbc')](_0x564c3b);_0x4b6cbb[_0x5006('0x2a')]+=_0x564c3b['talktime'];_0x4b6cbb[_0x5006('0x29')]+=_0x564c3b[_0x5006('0xbd')];logger[_0x5006('0x56')]('[syncHangup][talking][decrement]',_0x564c3b[_0x5006('0xbe')],_0x5006('0xbf'),_0x4b6cbb[_0x5006('0x26')],_0x5006('0x6f'),_0x4b6cbb[_0x5006('0x28')]);delete this['actions'][_0x4c4885['linkedid']];break;case'BUSY':_0x4b6cbb[_0x5006('0x36')]+=0x1;_0x564c3b[_0x5006('0xc0')]+=0x1;_0x564c3b[_0x5006('0x9d')]=ut[_0x5006('0x9e')](_0x564c3b);ut[_0x5006('0x8a')](_0x564c3b,0x5,_0x5006('0xc1'));_0x2cbf24=_0x4b6cbb[_0x5006('0xc2')];_0x19c78b=_0x4b6cbb[_0x5006('0xa6')];ami[_0x5006('0x59')]('custom:agentbusy',ut[_0x5006('0xa0')](_0x564c3b,_0x5006('0xc3')));rpcDb['createCustomerHistory'](_0x564c3b,_0x5006('0xc4'));_0x124b15['verifyAdditionalPhones'](_0x564c3b,'5',_0x4b6cbb)[_0x5006('0x80')](function(_0x34f160){_0x11d1ef=_0x34f160[_0x5006('0xa4')]==0x1;if(!_0x11d1ef){if(ut['totalGlobal'](_0x564c3b)>=_0x4b6cbb[_0x5006('0xa7')]){_0x26d88e=ut[_0x5006('0xc5')](_0x564c3b,0xf,_0x5006('0xc6'));rpcDb[_0x5006('0x92')](_0x26d88e,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x564c3b['countbusyretry']>=_0x4b6cbb['dialBusyMaxRetry']){rpcDb[_0x5006('0x92')](_0x564c3b,_0x5006('0xc4'));}else{rpcDb[_0x5006('0xa9')](ut[_0x5006('0xaa')](_0x564c3b,_0x5006('0xc0'),_0x4b6cbb[_0x5006('0xc2')]),_0x564c3b[_0x5006('0xab')],_0x564c3b[_0x5006('0xc7')]);}}}else{_0x564c3b[_0x5006('0xc0')]++;_0x124b15[_0x5006('0xae')]({'id':_0x564c3b[_0x5006('0xaf')],'field':{'countbusyretry':_0x564c3b[_0x5006('0xc0')]}})[_0x5006('0x80')](function(){_0x124b15[_0x5006('0xb0')](_0x564c3b,_0x2cbf24,_0x19c78b)['then'](function(){});});}});break;case'NOANSWER':_0x4b6cbb['outboundNoAnswerCallsDay']+=0x1;_0x564c3b[_0x5006('0xc8')]+=0x1;_0x564c3b[_0x5006('0x9d')]=ut['totalGlobal'](_0x564c3b);ut[_0x5006('0x8a')](_0x564c3b,0x3,'NoAnswer');_0x2cbf24=_0x4b6cbb['dialNoAnswerRetryFrequency'];_0x19c78b=_0x4b6cbb[_0x5006('0xa6')];ami[_0x5006('0x59')](_0x5006('0xc9'),ut[_0x5006('0xa0')](_0x564c3b,_0x5006('0xca')));rpcDb[_0x5006('0x8e')](_0x564c3b,_0x5006('0xcb'));_0x124b15[_0x5006('0xa3')](_0x564c3b,'3',_0x4b6cbb)['then'](function(_0x195727){_0x11d1ef=_0x195727[_0x5006('0xa4')]==0x1;if(!_0x11d1ef){if(ut[_0x5006('0x9e')](_0x564c3b)>=_0x4b6cbb['dialGlobalMaxRetry']){_0x26d88e=ut[_0x5006('0xc5')](_0x564c3b,0xf,_0x5006('0xc6'));rpcDb[_0x5006('0x92')](_0x26d88e,_0x5006('0xcc'));}else{if(_0x564c3b['countnoanswerretry']>=_0x4b6cbb['dialNoAnswerMaxRetry']){rpcDb[_0x5006('0x92')](_0x564c3b,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0x5006('0xa9')](ut[_0x5006('0xaa')](_0x564c3b,_0x5006('0xc8'),_0x4b6cbb[_0x5006('0xcd')]),_0x564c3b[_0x5006('0xab')],_0x564c3b['activeContact']);}}}else{_0x564c3b[_0x5006('0xc8')]++;_0x124b15[_0x5006('0xae')]({'id':_0x564c3b[_0x5006('0xaf')],'field':{'countnoanswerretry':_0x564c3b[_0x5006('0xc8')]}})['then'](function(){_0x124b15[_0x5006('0xb0')](_0x564c3b,_0x2cbf24,_0x19c78b)[_0x5006('0x80')](function(){});});}});break;case'CONGESTION':_0x4b6cbb['outboundCongestionCallsDay']+=0x1;_0x564c3b['countcongestionretry']+=0x1;_0x564c3b[_0x5006('0x9d')]=ut[_0x5006('0x9e')](_0x564c3b);ut[_0x5006('0x8a')](_0x564c3b,0x8,_0x5006('0xce'));_0x2cbf24=_0x4b6cbb[_0x5006('0xcf')];_0x19c78b=_0x4b6cbb[_0x5006('0xa6')];ami[_0x5006('0x59')](_0x5006('0xd0'),ut['buildObj'](_0x564c3b,_0x5006('0xd1')));rpcDb['createCustomerHistory'](_0x564c3b,'[callProgressDetectingCustomer][logCongestion]');_0x124b15['verifyAdditionalPhones'](_0x564c3b,'8',_0x4b6cbb)[_0x5006('0x80')](function(_0x53f796){_0x11d1ef=_0x53f796['additional']==0x1;if(!_0x11d1ef){if(ut[_0x5006('0x9e')](_0x564c3b)>=_0x4b6cbb[_0x5006('0xa7')]){_0x26d88e=ut[_0x5006('0xc5')](_0x564c3b,0xf,_0x5006('0xc6'));rpcDb['createCustomerFinal'](_0x26d88e,_0x5006('0xd2'));}else{if(_0x564c3b[_0x5006('0xd3')]>=_0x4b6cbb[_0x5006('0xd4')]){rpcDb[_0x5006('0x92')](_0x564c3b,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0x5006('0xa9')](ut[_0x5006('0xaa')](_0x564c3b,'countcongestionretry',_0x4b6cbb[_0x5006('0xc2')]),_0x564c3b[_0x5006('0xab')],_0x564c3b[_0x5006('0xc7')]);}}}else{_0x564c3b[_0x5006('0xd3')]++;_0x124b15[_0x5006('0xae')]({'id':_0x564c3b['idContact'],'field':{'countcongestionretry':_0x564c3b[_0x5006('0xd3')]}})['then'](function(){_0x124b15['swapAdditionalPhones'](_0x564c3b,_0x2cbf24,_0x19c78b)[_0x5006('0x80')](function(){});});}});break;case _0x5006('0xd5'):_0x4b6cbb['outboundRejectCallsDay']+=0x1;_0x564c3b[_0x5006('0xd6')]+=0x1;_0x564c3b['countglobal']=ut['totalGlobal'](_0x564c3b);ut[_0x5006('0x8a')](_0x564c3b,0x14,_0x5006('0xd7'));_0x2cbf24=_0x4b6cbb[_0x5006('0xd8')];_0x19c78b=_0x4b6cbb[_0x5006('0xa6')];ami['emit'](_0x5006('0xd9'),ut['buildObj'](_0x564c3b,_0x5006('0xda')));rpcDb[_0x5006('0x8e')](_0x564c3b,_0x5006('0xdb'));_0x124b15[_0x5006('0xa3')](_0x564c3b,'20',_0x4b6cbb)[_0x5006('0x80')](function(_0x2f02be){_0x11d1ef=_0x2f02be['additional']==0x1;if(!_0x11d1ef){if(ut[_0x5006('0x9e')](_0x564c3b)>=_0x4b6cbb[_0x5006('0xa7')]){_0x26d88e=ut[_0x5006('0xc5')](_0x564c3b,0x14,_0x5006('0xd7'));rpcDb['createCustomerFinal'](_0x26d88e,_0x5006('0xdc'));}else{if(_0x564c3b['countagentrejectretry']>=_0x4b6cbb['dialAgentRejectMaxRetry']){rpcDb[_0x5006('0x92')](_0x564c3b,_0x5006('0xdc'));}else{rpcDb[_0x5006('0xa9')](ut[_0x5006('0xaa')](_0x564c3b,_0x5006('0xd6'),_0x4b6cbb[_0x5006('0xd8')]),_0x564c3b[_0x5006('0xab')],_0x564c3b[_0x5006('0xc7')]);}}}else{_0x564c3b['countnoanswerretry']++;_0x124b15[_0x5006('0xae')]({'id':_0x564c3b['idContact'],'field':{'countnoanswerretry':_0x564c3b['countnoanswerretry']}})[_0x5006('0x80')](function(){_0x124b15[_0x5006('0xb0')](_0x564c3b,_0x2cbf24,_0x19c78b)[_0x5006('0x80')](function(){});});}});break;case _0x5006('0xdd'):_0x4b6cbb[_0x5006('0x3f')]+=0x1;_0x564c3b[_0x5006('0xde')]+=0x1;_0x564c3b[_0x5006('0x9d')]=ut[_0x5006('0x9e')](_0x564c3b);ut['logCustomer'](_0x564c3b,0xb,_0x5006('0xdf'));rpcDb[_0x5006('0x8e')](_0x564c3b,_0x5006('0xe0'));_0x124b15[_0x5006('0xa3')](_0x564c3b,'11',_0x4b6cbb)[_0x5006('0x80')](function(_0x484fc6){_0x11d1ef=_0x484fc6['additional']==0x1;if(!_0x11d1ef){if(ut[_0x5006('0x9e')](_0x564c3b)>=_0x4b6cbb[_0x5006('0xa7')]){_0x26d88e=ut[_0x5006('0xc5')](_0x564c3b,0xf,_0x5006('0xc6'));rpcDb['createCustomerFinal'](_0x26d88e,_0x5006('0xe0'));}else{if(_0x564c3b['countabandonedetry']>=_0x4b6cbb[_0x5006('0xe1')]){rpcDb['createCustomerFinal'](_0x564c3b,_0x5006('0xe0'));}else{rpcDb[_0x5006('0xa9')](ut[_0x5006('0xaa')](_0x564c3b,_0x5006('0xde'),_0x4b6cbb[_0x5006('0xe2')]),_0x564c3b[_0x5006('0xab')],_0x564c3b[_0x5006('0xc7')]);}}}else{_0x564c3b[_0x5006('0xc8')]++;_0x124b15[_0x5006('0xae')]({'id':_0x564c3b[_0x5006('0xaf')],'field':{'countnoanswerretry':_0x564c3b['countnoanswerretry']}})[_0x5006('0x80')](function(){_0x124b15['swapAdditionalPhones'](_0x564c3b,_0x2cbf24,_0x19c78b)[_0x5006('0x80')](function(){});});}});break;case'18':_0x4b6cbb[_0x5006('0x3e')]+=0x1;_0x564c3b['countmachineretry']+=0x1;_0x564c3b[_0x5006('0x9d')]=ut['totalGlobal'](_0x564c3b);ut[_0x5006('0x8a')](_0x564c3b,0x12,_0x4c4885[_0x5006('0xe3')]||_0x4c4885['dialstatus']);ami['emit'](_0x5006('0xe4'),ut[_0x5006('0xa0')](_0x564c3b,_0x5006('0xe5')));rpcDb[_0x5006('0x8e')](_0x564c3b,_0x5006('0xe6'));_0x124b15[_0x5006('0xa3')](_0x564c3b,'18',_0x4b6cbb)[_0x5006('0x80')](function(_0x5e8696){_0x11d1ef=_0x5e8696[_0x5006('0xa4')]==0x1;if(!_0x11d1ef){if(ut[_0x5006('0x9e')](_0x564c3b)>=_0x4b6cbb['dialGlobalMaxRetry']){_0x26d88e=ut[_0x5006('0xc5')](_0x564c3b,0x12,'Global');rpcDb['createCustomerFinal'](_0x26d88e,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0x5006('0x92')](_0x564c3b,'[callProgressDetectingCustomer][hangupInAMD]');}}else{_0x564c3b[_0x5006('0xc8')]++;_0x124b15['incrementPreviewCounters']({'id':_0x564c3b['idContact'],'field':{'countnoanswerretry':_0x564c3b[_0x5006('0xc8')]}})[_0x5006('0x80')](function(){_0x124b15[_0x5006('0xb0')](_0x564c3b,_0x2cbf24,_0x19c78b)[_0x5006('0x80')](function(){});});}});delete this[_0x5006('0x15')][_0x4c4885[_0x5006('0xac')]];break;case'19':_0x4b6cbb[_0x5006('0x3e')]+=0x1;_0x564c3b[_0x5006('0x9d')]=ut['totalGlobal'](_0x564c3b);ut['logCustomer'](_0x564c3b,0x13,_0x4c4885[_0x5006('0xe3')]||_0x4c4885[_0x5006('0xe7')]);ami[_0x5006('0x59')](_0x5006('0xe4'),ut[_0x5006('0xa0')](_0x564c3b,_0x5006('0xe5')));rpcDb[_0x5006('0x8e')](_0x564c3b,_0x5006('0xe8'));_0x124b15[_0x5006('0xa3')](_0x564c3b,'18',_0x4b6cbb)[_0x5006('0x80')](function(_0x3008d8){_0x11d1ef=_0x3008d8[_0x5006('0xa4')]==0x1;if(!_0x11d1ef){if(ut[_0x5006('0x9e')](_0x564c3b)>=_0x4b6cbb[_0x5006('0xa7')]){_0x26d88e=ut[_0x5006('0xc5')](_0x564c3b,0xf,_0x5006('0xc6'));rpcDb[_0x5006('0x92')](_0x26d88e,_0x5006('0xe8'));}else{rpcDb[_0x5006('0x92')](_0x564c3b,_0x5006('0xe8'));}}else{_0x564c3b[_0x5006('0xc8')]++;_0x124b15[_0x5006('0xae')]({'id':_0x564c3b['idContact'],'field':{'countnoanswerretry':_0x564c3b[_0x5006('0xc8')]}})['then'](function(){_0x124b15['swapAdditionalPhones'](_0x564c3b,_0x2cbf24,_0x19c78b)['then'](function(){});});}});delete this[_0x5006('0x15')][_0x4c4885[_0x5006('0xac')]];break;default:if(_0x564c3b['dialAnswer']){ut[_0x5006('0x79')](_0x4b6cbb,_0x5006('0xe9'));ut['loggerError'](_0x5006('0xea')+_0x4b6cbb[_0x5006('0x26')],_0x4c4885);}_0x4b6cbb[_0x5006('0x3e')]+=0x1;_0x564c3b[_0x5006('0x9d')]=ut['totalGlobal'](_0x564c3b);ut[_0x5006('0x8a')](_0x564c3b,0xc,_0x4c4885[_0x5006('0xe3')]||_0x4c4885[_0x5006('0xe7')]);_0x2cbf24=_0x4b6cbb[_0x5006('0xd8')];_0x19c78b=_0x4b6cbb[_0x5006('0xa6')];rpcDb[_0x5006('0x8e')](_0x564c3b,'[callProgressDetectingCustomer][logUnknown]');_0x124b15[_0x5006('0xa3')](_0x564c3b,'20',_0x4b6cbb)['then'](function(_0x2818b7){_0x11d1ef=_0x2818b7['additional']==0x1;if(!_0x11d1ef){if(ut[_0x5006('0x9e')](_0x564c3b)>=_0x4b6cbb['dialGlobalMaxRetry']){_0x26d88e=ut[_0x5006('0xc5')](_0x564c3b,0xf,_0x5006('0xc6'));rpcDb[_0x5006('0x92')](_0x26d88e,_0x5006('0xeb'));}else{rpcDb[_0x5006('0x92')](_0x564c3b,_0x5006('0xeb'));}delete this[_0x5006('0x15')][_0x4c4885['linkedid']];}else{_0x124b15[_0x5006('0xb0')](_0x564c3b,_0x2cbf24,_0x19c78b)[_0x5006('0x80')](function(_0x4f9fba){});}});}if(!(_0x564c3b[_0x5006('0x70')]&&_0x55c8ae==='16')){ut['updateOriginated'](_0x4b6cbb,_0x5006('0xec'));logger[_0x5006('0x56')]('[originated][decrement][callProgressDetectingCustomer]',_0x564c3b['uniqueid'],'\x20Queue',_0x4b6cbb['name'],'originated:\x20',_0x4b6cbb[_0x5006('0x4b')]);}if(_0x55c8ae!==_0x5006('0xb1')){delete this[_0x5006('0x15')][_0x4c4885[_0x5006('0xac')]];delete this[_0x5006('0x15')][_0x4c4885[_0x5006('0xed')]];}}};Preview[_0x5006('0x10')]['callProgressDetectingAgent']=function(_0x476541,_0x2f1341,_0x205a0){if(_[_0x5006('0xee')](_0x2f1341)&&_0x5006('0xef')!==typeof _0x2f1341){return;}if(_[_0x5006('0xee')](_0x205a0)&&_0x5006('0xef')!==typeof _0x205a0){return;}switch(_0x205a0[_0x5006('0xf0')]){case'0':ut['logAgent'](_0x476541,0x0,_0x5006('0x9f'));rpcDb[_0x5006('0xf1')](_0x476541,_0x5006('0xf2'));break;case'3':ut[_0x5006('0xf3')](_0x476541,0x3,_0x5006('0xf4'));rpcDb[_0x5006('0xf1')](_0x476541,_0x5006('0xf5'));break;case'5':ut['logAgent'](_0x476541,0x5,'Busy');rpcDb[_0x5006('0xf1')](_0x476541,_0x5006('0xf6'));break;case'8':ut[_0x5006('0xf3')](_0x476541,0x8,'Congestion');rpcDb['createAgentHistory'](_0x476541,_0x5006('0xf7'));break;case'22':ut['logAgent'](_0x476541,0x16,'AnswerAGI');rpcDb[_0x5006('0xf1')](_0x476541,_0x5006('0xf8'));break;default:ut[_0x5006('0xf3')](_0x476541,0xc,_0x205a0[_0x5006('0xf0')]);rpcDb[_0x5006('0xf1')](_0x476541,_0x5006('0xf7'));}ut[_0x5006('0xf9')](_0x2f1341,'[callProgressDetectingAgent]');logger[_0x5006('0x56')](_0x5006('0xfa'),_0x476541[_0x5006('0xbe')],_0x5006('0xbf'),_0x2f1341[_0x5006('0x26')],_0x5006('0x6e'),_0x2f1341[_0x5006('0x4b')]);delete this[_0x5006('0x15')][_0x476541[_0x5006('0xbe')]];};Preview[_0x5006('0x10')][_0x5006('0xa3')]=function(_0x2ac63d,_0x51e143,_0x4dbdfc){return BPromise[_0x5006('0xfb')]()['then'](cmHopperAdditionalPhone[_0x5006('0xa3')](_0x2ac63d,_0x51e143,_0x4dbdfc))['catch'](logger['info'](_0x5006('0xfc')));};Preview[_0x5006('0x10')]['swapAdditionalPhones']=function(_0x3a855b,_0xbea293,_0x21d0ad){return BPromise[_0x5006('0xfb')]()['then'](cmHopperAdditionalPhone[_0x5006('0xb0')](_0x3a855b,_0xbea293,_0x21d0ad))[_0x5006('0x76')](logger[_0x5006('0x56')](_0x5006('0xfd')));};Preview[_0x5006('0x10')][_0x5006('0xae')]=function(_0x46cd7a){return BPromise[_0x5006('0xfb')]()[_0x5006('0x80')](cmHopperAdditionalPhone[_0x5006('0xae')](_0x46cd7a))[_0x5006('0x76')](logger[_0x5006('0x56')]('[incrementPreviewCounters]\x20'));};Preview[_0x5006('0x10')]['checkInBlack']=function(_0xb2c3e3,_0x174224,_0x1f1ed8,_0x11e8a4,_0x41ab2e){var _0x3b0aae=this;return new BPromise(function(_0x40ced2,_0x7dab04){if(_[_0x5006('0x6b')](_0x174224)||_[_0x5006('0x6b')](_0x174224[_0x5006('0xfe')])||_[_0x5006('0x6b')](_0x174224['phone'])||_[_0x5006('0x6b')](_0x174224[_0x5006('0xff')])){_0x7dab04(ut[_0x5006('0x4a')]('Contact\x20is\x20undefined',_0x11e8a4,_0x41ab2e));return;}var _0x3b53d5=uuid['v4']();var _0x8b670b=_0x3b0aae['campaignsPreview'][_0x174224[_0x5006('0x6c')]['name']];var _0x38c547=_0x1f1ed8?_0x3b0aae[_0x5006('0x16')][_0x1f1ed8]['id']:undefined;_0x3b0aae[_0x5006('0x15')][_0x3b53d5]=new Action(_0x174224,_0x8b670b,_0x3b53d5,_0x1f1ed8,_0x38c547);var _0x3a4f83=_0x3b0aae['actions'][_0x3b53d5];_0x3a4f83[_0x5006('0xab')]=_0x11e8a4;_0x3a4f83[_0x5006('0xc7')]=_0x41ab2e;_0x3a4f83[_0x5006('0x100')]=_0x1f1ed8;if(_[_0x5006('0x101')](_0xb2c3e3)){_0x3b0aae['execCall'](_0x3a4f83,_0x8b670b,_0x174224,_0x1f1ed8)['then'](function(_0x2abf1b){logger[_0x5006('0x56')](_0x5006('0x102'),_0x5006('0x103')+_0x3a4f83[_0x5006('0x6d')]+_0x5006('0x104')+_0x3a4f83[_0x5006('0xaf')],JSON['stringify'](_0x2abf1b));ami[_0x5006('0x59')](_0x5006('0x105'),ut[_0x5006('0xa0')](_0x3a4f83,'called',_0x3b0aae[_0x5006('0x64')][_0x3a4f83[_0x5006('0x6d')]]));_0x40ced2(ut[_0x5006('0x4a')](_0x5006('0x106')));})[_0x5006('0x76')](function(_0x148f0f){ut[_0x5006('0x5e')](_0x5006('0x107'),_0x148f0f);_0x7dab04(ut[_0x5006('0x4a')](_0x5006('0x108'),_0x11e8a4,_0x41ab2e));});}else{_0x8b670b[_0x5006('0x109')]+=0x1;ut[_0x5006('0x10a')](_0x3a4f83);rpcDb['createHistory'](_0x3a4f83,_0x5006('0x10b'));delete _0x3b0aae[_0x5006('0x15')][_0x3b53d5];_0x7dab04(ut[_0x5006('0x4a')]('Contact\x20in\x20black\x20List',_0x11e8a4,_0x41ab2e));}});};Preview[_0x5006('0x10')]['isTrunkReachable']=function(_0x33edd0){return!_['isNil'](_0x33edd0)&&!_['isNil'](_0x33edd0[_0x5006('0x26')])&&!_[_0x5006('0x6b')](_0x33edd0['active'])&&_0x33edd0[_0x5006('0x10c')]&&!_[_0x5006('0x6b')](this[_0x5006('0x14')][util['format'](_0x5006('0x10d'),_0x33edd0[_0x5006('0x26')])])&&!_['isNil'](this[_0x5006('0x14')][util[_0x5006('0x57')]('SIP/%s',_0x33edd0[_0x5006('0x26')])]['status'])&&(this['trunks'][util[_0x5006('0x57')](_0x5006('0x10d'),_0x33edd0[_0x5006('0x26')])]['status']===_0x5006('0x10e')||this[_0x5006('0x14')][util['format'](_0x5006('0x10d'),_0x33edd0[_0x5006('0x26')])][_0x5006('0x74')]===_0x5006('0x10f'));};Preview[_0x5006('0x10')][_0x5006('0x110')]=function(_0x4cab0c,_0x171f9d){var _0x580524=this;return new BPromise(function(_0x39a10f,_0x14d88c){_0x580524[_0x5006('0x111')](_0x4cab0c,_0x171f9d)[_0x5006('0x80')](function(_0x291f0c){_0x39a10f(_[_0x5006('0x71')](_0x291f0c,[_0x5006('0x4a')]));})[_0x5006('0x76')](function(_0x399a7a){if(_0x399a7a['unlock']){rpcDb[_0x5006('0x112')](_0x4cab0c);}if(_0x399a7a[_0x5006('0x10c')]){rpcDb[_0x5006('0x87')](_0x4cab0c);}_0x14d88c(_[_0x5006('0x71')](_0x399a7a,['message']));});});};Preview[_0x5006('0x10')][_0x5006('0x111')]=function(_0x2b2000,_0x39b087){var _0x9958b0=this;return new BPromise(function(_0x1b5961,_0x31e876){var _0x6e2d1e,_0x38ca26;rpcDb[_0x5006('0x113')](_0x2b2000)[_0x5006('0x80')](function(_0x34c78a){if(!_[_0x5006('0x6b')](_0x34c78a[0x0])){_0x38ca26=_0x34c78a[0x0][_0x5006('0x114')]?![]:!![];_0x6e2d1e=_0x34c78a[0x0][_0x5006('0x114')]?!![]:![];_0x6e2d1e=_0x39b087?!![]:_0x6e2d1e;}var _0x166112=_0x9958b0['validateContact'](_0x34c78a);if(_0x166112['isValid']){rpcDb[_0x5006('0x115')](_[_0x5006('0x71')](_0x34c78a[0x0],[_0x5006('0xff'),'phone']))[_0x5006('0x80')](function(_0x527ea4){_0x9958b0[_0x5006('0x116')](_0x527ea4,_0x34c78a[0x0],_0x39b087,_0x38ca26,_0x6e2d1e)[_0x5006('0x80')](function(_0x2195e0){_0x1b5961(_0x2195e0);})['catch'](function(_0xbf1e1c){_0x31e876(_0xbf1e1c);});})[_0x5006('0x76')](function(_0x39fbd7){ut[_0x5006('0x5e')](_0x5006('0x117'),_0x39fbd7);_0x31e876(ut[_0x5006('0x4a')]('Call\x20unsuccessful',_0x38ca26,_0x6e2d1e));});}else{_0x31e876(ut['message'](_0x166112[_0x5006('0x4a')],_0x38ca26,_0x6e2d1e));}})['catch'](function(_0x40f5e8){ut[_0x5006('0x5e')](_0x5006('0x118'),_0x40f5e8);_0x31e876(ut[_0x5006('0x4a')](_0x5006('0x119'),![],!![]));});});};Preview['prototype'][_0x5006('0x11a')]=function(_0x9624b2){if(_['isNil'](_0x9624b2)||_['isEmpty'](_0x9624b2)||!_[_0x5006('0x6b')](_0x9624b2[0x0]['Agent'])&&_[_0x5006('0x6b')](_0x9624b2[0x0][_0x5006('0x83')]['name'])){ut[_0x5006('0x5e')]('[Preview][validateContact][Empty\x20Contact]',_0x9624b2);return{'isValid':![],'message':_0x5006('0x11b')};}var _0x52582b=this[_0x5006('0x64')][_0x9624b2[0x0][_0x5006('0x6c')][_0x5006('0x26')]];_0x52582b[_0x5006('0x4a')]=_0x5006('0x9a');if(_[_0x5006('0x6b')](_0x52582b)){ut[_0x5006('0x5e')](_0x5006('0x11c'),_0x52582b);return{'isValid':![],'message':_0x5006('0x11d')};}if(!this['isTrunkReachable'](_0x52582b[_0x5006('0x50')])){ut[_0x5006('0x5e')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x5006('0x11e')+_0x52582b[_0x5006('0x26')]+_0x5006('0x11f'));if(!this[_0x5006('0x98')](_0x52582b[_0x5006('0x120')])){ut[_0x5006('0x5e')](_0x5006('0x121'),_0x52582b[_0x5006('0x26')]+_0x5006('0x122'));return{'isValid':![],'message':_0x5006('0x123')};}}if(!ut[_0x5006('0x97')](_0x52582b[_0x5006('0x30')])){ut['logger'](_0x5006('0x124'),_0x52582b[_0x5006('0x26')]+'\x20Not\x20Active');return{'isValid':![],'message':_0x5006('0x11e')+_0x52582b[_0x5006('0x26')]+_0x5006('0x125')};}return{'isValid':!![],'message':_0x5006('0x126')};};Preview[_0x5006('0x10')][_0x5006('0x127')]=function(_0x10d667,_0x6f08f0,_0x22c105,_0x315e14){var _0x7d41fd=this;return new BPromise(function(_0x28ada5,_0x825b87){var _0x3ea472=_0x10d667['uniqueid'];var _0x7d65e3=_0x7d41fd[_0x5006('0x98')](_0x6f08f0[_0x5006('0x50')])?util[_0x5006('0x57')]('SIP/%s/%s%s',_0x6f08f0['Trunk']['name'],_[_0x5006('0x6b')](_0x6f08f0[_0x5006('0x33')])?'':_0x6f08f0[_0x5006('0x33')][_0x5006('0x128')]()||'',_0x6f08f0['dialCutDigit']>0x0?_0x22c105[_0x5006('0x129')]['substring'](_0x6f08f0['dialCutDigit']):_0x22c105[_0x5006('0x129')]):util['format'](_0x5006('0x12a'),_['isNil'](_0x6f08f0[_0x5006('0x120')])?_0x6f08f0['Trunk'][_0x5006('0x26')]:_0x6f08f0['TrunkBackup'][_0x5006('0x26')],_[_0x5006('0x6b')](_0x6f08f0[_0x5006('0x33')])?'':_0x6f08f0[_0x5006('0x33')][_0x5006('0x128')]()||'',_0x6f08f0['dialCutDigit']>0x0?_0x22c105[_0x5006('0x129')][_0x5006('0x12b')](_0x6f08f0['dialCutDigit']):_0x22c105['phone']);var _0x56f243=_0x7d41fd[_0x5006('0x98')](_0x6f08f0[_0x5006('0x50')])?ut[_0x5006('0x12c')](_0x6f08f0[_0x5006('0x50')][_0x5006('0x51')],_0x6f08f0[_0x5006('0x12d')],_0x6f08f0[_0x5006('0x12e')]>0x0?ut[_0x5006('0x12f')](_0x6f08f0[_0x5006('0x130')],_0x6f08f0[_0x5006('0x12e')]):_0x6f08f0[_0x5006('0x130')]):ut[_0x5006('0x12c')](_[_0x5006('0x6b')](_0x6f08f0[_0x5006('0x120')])?_0x6f08f0[_0x5006('0x50')][_0x5006('0x51')]:_0x6f08f0[_0x5006('0x120')]['callerid'],_0x6f08f0[_0x5006('0x12d')],_0x6f08f0[_0x5006('0x12e')]>0x0?ut['getCallerIdRandom'](_0x6f08f0[_0x5006('0x130')],_0x6f08f0[_0x5006('0x12e')]):_0x6f08f0['dialOriginateCallerIdNumber']);if(_0x56f243){_0x10d667[_0x5006('0x131')]=ut['extractCalleridName'](_0x56f243);_0x10d667[_0x5006('0x132')]=ut[_0x5006('0x133')](_0x56f243);}var _0x45c791=ut['addVariables'](_0x6f08f0,_0x22c105,_0x7d65e3,_0x56f243,_0x3ea472,_0x10d667);_['merge'](_0x10d667,ut['toLowerVariables'](_0x45c791));_0x10d667[_0x5006('0x88')]=moment()[_0x5006('0x57')](_0x5006('0x89'));ami[_0x5006('0x73')](ut[_0x5006('0x134')](_0x10d667,_0x6f08f0,_0x45c791,_0x10d667[_0x5006('0xc7')],_0x315e14))[_0x5006('0x80')](function(_0x3b7dda){var _0xc13337=_0x10d667['channelAgent'];if(!_['isNil'](_0xc13337)){if(!_[_0x5006('0x6b')](_0x7d41fd['agents'][_0xc13337])){_0x7d41fd[_0x5006('0x16')][_0xc13337][_0x5006('0x135')]=_0x10d667[_0x5006('0x136')];emit(util[_0x5006('0x57')](_0x5006('0x137'),_0x7d41fd['agents'][_0xc13337]['name']),'user:agentconnect',{'destaccountcode':_0x7d41fd[_0x5006('0x16')][_0xc13337]['accountcode'],'destconnectedlinenum':_0x10d667[_0x5006('0x136')]});}}_0x6f08f0[_0x5006('0x4b')]+=0x1;logger[_0x5006('0x56')](_0x5006('0x138'),_0x3ea472,_0x5006('0xbf'),_0x6f08f0['name'],_0x5006('0x6e'),_0x6f08f0[_0x5006('0x4b')]);_0x28ada5(_0x3b7dda);})[_0x5006('0x76')](function(_0x5c550b){ut[_0x5006('0xf3')](_0x10d667,0xe,_0x5006('0x139'));rpcDb[_0x5006('0xf1')](_0x10d667,_0x5006('0x13a'));_0x825b87(_0x5c550b);});});};Preview[_0x5006('0x10')][_0x5006('0x1e')]=function(_0x346522){if(this[_0x5006('0x15')][_0x346522[_0x5006('0xac')]]){this[_0x5006('0x15')][_0x346522[_0x5006('0xac')]][_0x5006('0x75')]=_0x346522['channel'];}};Preview['prototype'][_0x5006('0x13b')]=function(_0x2a19f2){var _0xc8a040=this;var _0x148a8d=this[_0x5006('0x15')][_0x2a19f2[_0x5006('0x13c')]];if(_0x148a8d){if(_0x148a8d[_0x5006('0x100')]&&this[_0x5006('0x16')][_0x148a8d[_0x5006('0x100')]]){ut[_0x5006('0x13d')](_0x148a8d,this['agents'][_0x148a8d[_0x5006('0x100')]]['name'],this[_0x5006('0x16')][_0x148a8d[_0x5006('0x100')]]['id']);}var _0x56f50e=_[_0x5006('0x13e')](_0x148a8d);_0x56f50e[_0x5006('0xb2')]=moment()['format'](_0x5006('0x89'));var _0x303b82=_0xc8a040[_0x5006('0x64')][_0x148a8d[_0x5006('0x6d')]];if(ut[_0x5006('0x13f')](_0x2a19f2[_0x5006('0x140')])){if(_0x148a8d[_0x5006('0xab')]){rpcDb[_0x5006('0x112')](_0x148a8d['idContact']);}if(_0x148a8d['activeContact']){rpcDb['disableContact'](_0x148a8d[_0x5006('0xaf')]);}ami[_0x5006('0x59')](_0x5006('0x141'),ut[_0x5006('0xa0')](_0x148a8d,_0x5006('0x142'),this['campaignsPreview'][_0x148a8d[_0x5006('0x6d')]]));this[_0x5006('0x143')](_0x56f50e,_0x303b82,_0x2a19f2);}else{_0x148a8d[_0x5006('0x88')]=moment()[_0x5006('0x57')](_0x5006('0x89'));ut[_0x5006('0xf3')](_0x56f50e,0x4,'Answer');rpcDb[_0x5006('0xf1')](_0x56f50e,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0x5006('0x10')]['syncHangup']=function(_0x489bf5){var _0x28a65c=this;var _0x1a2306=this[_0x5006('0x15')][_0x489bf5[_0x5006('0xac')]];var _0x2465d6;if(_0x1a2306){_0x2465d6=this['campaignsPreview'][_0x1a2306[_0x5006('0x6d')]];logger[_0x5006('0x56')]('[syncHangup][talking]',_0x489bf5[_0x5006('0xac')],_0x5006('0xbf'),_0x2465d6['name'],_0x5006('0x6f'),_0x2465d6[_0x5006('0x28')]);}if(this[_0x5006('0x15')][_0x489bf5[_0x5006('0xac')]]&&_0x489bf5[_0x5006('0xac')]!==_0x489bf5[_0x5006('0xbe')]){if(_0x489bf5['cause']==='16'&&this[_0x5006('0x15')][_0x489bf5[_0x5006('0xac')]]['dialAnswer']){this[_0x5006('0x9b')](_0x489bf5,_0x489bf5[_0x5006('0xac')],_0x489bf5['cause']);}else if(this[_0x5006('0x15')][_0x489bf5[_0x5006('0xac')]][_0x5006('0x70')]){logger[_0x5006('0x56')]('[syncHangup][talking][cause]',_0x489bf5[_0x5006('0xac')],_0x489bf5['cause'],_0x5006('0xbf'),_0x2465d6['name'],_0x5006('0x6f'),_0x2465d6[_0x5006('0x28')]);this[_0x5006('0x9b')](_0x489bf5,_0x489bf5[_0x5006('0xac')],_0x489bf5['cause']);}}else if(_0x1a2306&&_['isNil'](_0x1a2306['statedesc'])&&_0x2465d6[_0x5006('0x144')]&&_0x489bf5[_0x5006('0xac')]===_0x489bf5[_0x5006('0xbe')]&&_['isNil'](_0x489bf5[_0x5006('0xf0')])&&_0x489bf5[_0x5006('0x145')]==='16'&&_0x489bf5[_0x5006('0x146')]==='6'&&_[_0x5006('0xee')](_0x1a2306[_0x5006('0x147')])){if(_0x1a2306[_0x5006('0xab')]){rpcDb[_0x5006('0x112')](_0x1a2306[_0x5006('0xaf')]);}if(_0x1a2306[_0x5006('0xc7')]){rpcDb['disableContact'](_0x1a2306[_0x5006('0xaf')]);}_0x489bf5[_0x5006('0xf0')]='22';this[_0x5006('0x143')](_0x1a2306,_0x2465d6,_0x489bf5);}else if(_0x1a2306&&_0x1a2306[_0x5006('0x147')]){if(_0x489bf5['cause']==='16'&&this[_0x5006('0x15')][_0x489bf5[_0x5006('0xac')]]['dialAnswer']){logger['info'](_0x5006('0x148'),_0x489bf5[_0x5006('0xac')],_0x489bf5['cause'],_0x5006('0xbf'),_0x2465d6['name'],_0x5006('0x6f'),_0x2465d6[_0x5006('0x28')]);this[_0x5006('0x9b')](_0x489bf5,_0x489bf5[_0x5006('0xac')],_0x489bf5[_0x5006('0x145')]);}else if(this[_0x5006('0x15')][_0x489bf5[_0x5006('0xac')]][_0x5006('0x70')]){logger[_0x5006('0x56')]('[syncHangup][talking][cause]',_0x489bf5['linkedid'],_0x489bf5['cause'],_0x5006('0xbf'),_0x2465d6[_0x5006('0x26')],_0x5006('0x6f'),_0x2465d6[_0x5006('0x28')]);this['callProgressDetectingCustomer'](_0x489bf5,_0x489bf5[_0x5006('0xac')],_0x489bf5[_0x5006('0x145')]);}}};Preview[_0x5006('0x10')][_0x5006('0x1c')]=function(_0x5bf525){if(this[_0x5006('0x15')][_0x5bf525['destlinkedid']]&&_0x5bf525[_0x5006('0xed')]!==_0x5bf525[_0x5006('0x149')]){this[_0x5006('0x9b')](_0x5bf525,_0x5bf525[_0x5006('0xed')],_0x5bf525[_0x5006('0xe7')]);}};Preview[_0x5006('0x10')][_0x5006('0x1b')]=function(_0x1bdde3){if(this[_0x5006('0x15')][_0x1bdde3[_0x5006('0xac')]]&&_0x1bdde3[_0x5006('0xac')]!==_0x1bdde3[_0x5006('0xbe')]&&!this[_0x5006('0x15')][_0x1bdde3[_0x5006('0xac')]][_0x5006('0x70')]){if(_0x1bdde3['cause']==='1'){this[_0x5006('0x9b')](_0x1bdde3,_0x1bdde3[_0x5006('0xac')],_0x1bdde3[_0x5006('0x145')]);}}};Preview[_0x5006('0x10')][_0x5006('0x14a')]=function(_0x525786,_0x5af79c,_0x3cbe27){if(this[_0x5006('0x15')][_0x525786]){if(_['isNil'](this[_0x5006('0x15')][_0x525786][_0x5006('0x14b')])){this['actions'][_0x525786][_0x5006('0x14b')]={};}this[_0x5006('0x15')][_0x525786]['variables'][_0x5af79c]=_0x3cbe27;}};Preview[_0x5006('0x10')]['syncVarSet']=function(_0x306c48){try{if(!_[_0x5006('0x6b')](_0x306c48)){if(ut[_0x5006('0x14c')](_[_0x5006('0x14d')](_0x306c48[_0x5006('0x14e')])[0x0])){this[_0x5006('0x14a')](_0x306c48[_0x5006('0xbe')],_[_0x5006('0x14d')](_0x306c48[_0x5006('0x14e')])[0x0],_0x306c48[_0x5006('0x14f')]);}}}catch(_0x207ab5){logger[_0x5006('0x150')](_0x5006('0x151'),util[_0x5006('0x152')](_0x207ab5,{'showHidden':![],'depth':null}));}};Preview['prototype']['syncAttendedTransfer']=function(_0x4b49fa){if(_0x4b49fa){if(this[_0x5006('0x15')][_0x4b49fa[_0x5006('0x153')]]){this[_0x5006('0x15')][_0x4b49fa[_0x5006('0x153')]][_0x5006('0x147')]=!![];}}};Preview[_0x5006('0x10')]['syncBlindTransfer']=function(_0xd47e3f){if(_0xd47e3f){if(this[_0x5006('0x15')][_0xd47e3f[_0x5006('0x154')]]){this[_0x5006('0x15')][_0xd47e3f[_0x5006('0x154')]]['transfer']=!![];}}};module[_0x5006('0x155')]=Preview; \ No newline at end of file +var _0xc315=['updateOriginated','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','object','reason','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','logAgent','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','resolve','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','[incrementPreviewCounters]\x20','checkInBlack','Contact','phone','VoiceQueueId','lookAgent','execCall','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','unlock','unlockContact','getContactPreview','isValid','checkIsBlackList','Call\x20unsuccessful','[Preview][getContactPreview]','validateContact','isEmpty','Agent','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Trunk\x20not\x20work]','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','substring','dialCutDigit','getCallerIdRandom','dialRandomLastDigitCallerIdNumber','getCallerId','originatecalleridnum','extractCalleridNumber','addVariables','toLowerVariables','starttime','variablesAction','channelAgent','destconnectedlinenum','calleridnum','user:%s','user:agentconnect','accountcode','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','rejected','callProgressDetectingAgent','[callProgressDetectingAgent][logAnswer]','syncHangup','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','channelstate','isUndefined','transfer','[syncHangup][talking][transfer]','filterKey','keys','variable','addVariable','transfertargetlinkedid','transfererlinkedid','util','lodash','moment','md5','ioredis','../../../config/environment','../../../config/logger','actionPreview','../ami','./rpcDb','../rpc/cmHopperAdditionalPhone','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','tail','sequence','campaignsPreview','voiceQueues','trunks','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','hangup','bind','hanguprequest','syncHangupRequest','dialend','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','loopCampaigns','type','outbound','name','answered','available','loggedIn','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','Trunk','active','callerid','Interval','stringify','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','voice_queue_presence:remove','pTalking','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','IS_DISACTIVED','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20disactive','syncCampaigns','hasOwnProperty','booked','clearZombieChannels','preview','dialActive','setMessage','recallMe','clearZombieChannel','isNil','actions','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','UserId','ListId','Action','status','channel','catch','No\x20such\x20channel','[clearZombieChannel]','loggerError','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','then','scheduledat','dialRecallMeTimeout','run','[RecallMe]','logger2','disableContact','YYYY-MM-DD\x20HH:mm:ss','logCustomer','dialRecallInQueue','rescheduleContactInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','[HistoryRecallClose]','[getContactRecallMe]','isActive','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','totalGlobal','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','createCustomerFinal','rescheduleContact','unlockAgent','actioncountonusuch','incrementPreviewCounters','idContact','swapAdditionalPhones','ANSWER','responsetime','answertime','\x20Queue','emit','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','decrementTalkink','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','uniqueid','linkedid','BUSY','countbusyretry','Busy','custom:agentbusy','busy','cloneAction','[callProgressDetectingCustomer][logBusyGlobal]','scheduledAt','dialBusyRetryFrequency','activeContact','NOANSWER','NoAnswer','dialNoAnswerRetryFrequency','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','countcongestionretry','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','countagentrejectretry','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','AgentReject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[callProgressDetectingCustomer][logUnknownGlobal]'];(function(_0x53bcc3,_0x364374){var _0x47c959=function(_0x40ef7d){while(--_0x40ef7d){_0x53bcc3['push'](_0x53bcc3['shift']());}};_0x47c959(++_0x364374);}(_0xc315,0x1cb));var _0x5c31=function(_0x47828c,_0x5ddc9b){_0x47828c=_0x47828c-0x0;var _0x5300ac=_0xc315[_0x47828c];return _0x5300ac;};'use strict';var util=require(_0x5c31('0x0'));var _=require(_0x5c31('0x1'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0x5c31('0x2'));var md5=require(_0x5c31('0x3'));var Redis=require(_0x5c31('0x4'));var config=require(_0x5c31('0x5'));var logger=require(_0x5c31('0x6'))('preview');var loggerAction=require(_0x5c31('0x6'))(_0x5c31('0x7'));var ami=require(_0x5c31('0x8'));var rpcDb=require(_0x5c31('0x9'));var cmHopperAdditionalPhone=require(_0x5c31('0xa'));var Action=require('./action');var ut=require(_0x5c31('0xb'));config[_0x5c31('0xc')]=_[_0x5c31('0xd')](config[_0x5c31('0xc')],{'host':_0x5c31('0xe'),'port':0x18eb});var io=require(_0x5c31('0xf'))(new Redis(config[_0x5c31('0xc')]));var Sequence=function(){};Sequence[_0x5c31('0x10')]['enqueue']=function(_0x5e2044){this['tail']=this[_0x5c31('0x11')]?this['tail']['finally'](_0x5e2044):_0x5e2044();};function Preview(_0x2642d0){this[_0x5c31('0x12')]=new Sequence();this[_0x5c31('0x13')]=_0x2642d0[_0x5c31('0x14')];this[_0x5c31('0x15')]=_0x2642d0[_0x5c31('0x15')];this['actions']={};this[_0x5c31('0x16')]=_0x2642d0[_0x5c31('0x16')];this[_0x5c31('0x17')]=0x0;ami['on'](_0x5c31('0x18'),this[_0x5c31('0x19')]['bind'](this));ami['on'](_0x5c31('0x1a'),this['syncHangup'][_0x5c31('0x1b')](this));ami['on'](_0x5c31('0x1c'),this[_0x5c31('0x1d')][_0x5c31('0x1b')](this));ami['on'](_0x5c31('0x1e'),this['syncDialEnd'][_0x5c31('0x1b')](this));ami['on'](_0x5c31('0x1f'),this[_0x5c31('0x20')][_0x5c31('0x1b')](this));ami['on'](_0x5c31('0x21'),this[_0x5c31('0x22')]['bind'](this));ami['on'](_0x5c31('0x23'),this[_0x5c31('0x24')][_0x5c31('0x1b')](this));ami['on']('blindtransfer',this[_0x5c31('0x25')][_0x5c31('0x1b')](this));this[_0x5c31('0x26')](this[_0x5c31('0x13')]);}function emit(_0x450ebf,_0x19b6fe,_0x268b27){io['to'](_0x450ebf)['emit'](_0x19b6fe,_0x268b27);}function emitCampaignPreview(_0x4810d5){if(_0x4810d5[_0x5c31('0x27')]===_0x5c31('0x28')){var _0x407931={'id':_0x4810d5['id'],'name':_0x4810d5[_0x5c31('0x29')],'strategy':_0x4810d5['strategy'],'answered':_0x4810d5[_0x5c31('0x2a')],'available':_0x4810d5[_0x5c31('0x2b')],'loggedIn':_0x4810d5[_0x5c31('0x2c')],'pTalking':_0x4810d5['pTalking'],'sumBillable':_0x4810d5[_0x5c31('0x2d')],'sumDuration':_0x4810d5[_0x5c31('0x2e')],'sumHoldTime':_0x4810d5[_0x5c31('0x2f')]||0x0,'talking':_0x4810d5[_0x5c31('0x30')],'total':_0x4810d5[_0x5c31('0x31')],'type':_0x4810d5[_0x5c31('0x27')],'unmanaged':_0x4810d5[_0x5c31('0x32')],'abandoned':_0x4810d5[_0x5c31('0x33')],'waiting':_0x4810d5['waiting'],'loggedInDb':_0x4810d5[_0x5c31('0x34')],'dialActive':_0x4810d5['dialActive'],'dialMethod':_0x4810d5[_0x5c31('0x35')],'dialOriginateCallerIdName':_0x4810d5[_0x5c31('0x36')],'dialOriginateCallerIdNumber':_0x4810d5[_0x5c31('0x37')],'dialOriginateTimeout':_0x4810d5['dialOriginateTimeout'],'dialPrefix':_0x4810d5[_0x5c31('0x38')],'outboundAnswerAgiCallsDay':_0x4810d5['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x4810d5[_0x5c31('0x39')],'outboundBlacklistCallsDay':_0x4810d5['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x4810d5[_0x5c31('0x3a')],'outboundCongestionCallsDay':_0x4810d5[_0x5c31('0x3b')],'outboundDropCallsDayACS':_0x4810d5[_0x5c31('0x3c')],'outboundDropCallsDayCallersExit':_0x4810d5['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x4810d5[_0x5c31('0x3d')],'outboundNoAnswerCallsDay':_0x4810d5[_0x5c31('0x3e')],'outboundNoSuchCallsDay':_0x4810d5[_0x5c31('0x3f')],'outboundOriginateFailureCallsDay':_0x4810d5[_0x5c31('0x40')],'outboundReCallsDay':_0x4810d5[_0x5c31('0x41')],'outboundRejectCallsDay':_0x4810d5[_0x5c31('0x42')],'outboundUnknownCallsDay':_0x4810d5[_0x5c31('0x43')],'outboundAbandonedCallsDay':_0x4810d5[_0x5c31('0x44')],'predictiveIntervalAnsweredCalls':_0x4810d5['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x4810d5[_0x5c31('0x45')],'predictiveIntervalAvgTalktime':_0x4810d5[_0x5c31('0x46')],'predictiveIntervalDroppedCallsCallersExit':_0x4810d5['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x4810d5['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x4810d5[_0x5c31('0x47')],'predictiveIntervalErlangCallsDroppedCalls':_0x4810d5[_0x5c31('0x48')],'predictiveIntervalHitRate':_0x4810d5[_0x5c31('0x49')],'predictiveIntervalMultiplicativeFactor':_0x4810d5[_0x5c31('0x4a')],'predictiveIntervalPauses':_0x4810d5[_0x5c31('0x4b')],'predictiveIntervalAvailable':_0x4810d5[_0x5c31('0x4c')],'predictiveIntervalTotalCalls':_0x4810d5[_0x5c31('0x4d')],'message':_0x4810d5[_0x5c31('0x4e')],'originated':_0x4810d5[_0x5c31('0x4f')],'erlangCalls':_0x4810d5[_0x5c31('0x50')],'erlangCallToSecond':_0x4810d5[_0x5c31('0x51')],'erlangAbandonmentRate':_0x4810d5[_0x5c31('0x52')],'erlangBusyFactor':_0x4810d5['erlangBusyFactor'],'startPredictive':_0x4810d5['startPredictive'],'startProgressive':_0x4810d5['startProgressive']};if(_0x4810d5['Trunk']){_0x407931[_0x5c31('0x53')]={'id':_0x4810d5[_0x5c31('0x53')]['id'],'name':_0x4810d5[_0x5c31('0x53')][_0x5c31('0x29')],'active':_0x4810d5[_0x5c31('0x53')][_0x5c31('0x54')],'callerid':_0x4810d5[_0x5c31('0x53')][_0x5c31('0x55')]};}if(_0x4810d5[_0x5c31('0x56')]){_0x407931['Interval']={'id':_0x4810d5['Interval']['id'],'name':_0x4810d5[_0x5c31('0x56')][_0x5c31('0x29')]};}var _0x5b162d=md5(JSON[_0x5c31('0x57')](_0x407931));if(_0x4810d5[_0x5c31('0x3')]!==_0x5b162d){_0x4810d5[_0x5c31('0x3')]=_0x5b162d;emit(util['format'](_0x5c31('0x58'),_0x407931[_0x5c31('0x29')]),_0x5c31('0x59'),_0x407931);}}}function emitVoiceQueueChannelRemove(_0x1819ef){logger[_0x5c31('0x5a')](_0x5c31('0x5b'),JSON['stringify'](_0x1819ef));emit(util[_0x5c31('0x5c')](_0x5c31('0x58'),_0x1819ef[_0x5c31('0x29')]),'voice_queue_channel:remove',_0x1819ef);io['emit'](_0x5c31('0x5d'),_0x1819ef);}function notSendMessagesQueue(_0x3c55ed){if(_0x3c55ed['sendMessageOneNotActive']){if(_0x3c55ed[_0x5c31('0x4f')]===0x0&&_0x3c55ed[_0x5c31('0x5e')]===0x0){_0x3c55ed[_0x5c31('0x5f')]=![];_0x3c55ed['available']=0x0;_0x3c55ed[_0x5c31('0x60')]=0x0;_0x3c55ed['message']=_0x5c31('0x61');ut[_0x5c31('0x62')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x3c55ed[_0x5c31('0x29')]+'\x20is\x20not\x20active');}else{_0x3c55ed[_0x5c31('0x4e')]=_0x5c31('0x63');ut[_0x5c31('0x62')](_0x5c31('0x64'),_0x3c55ed[_0x5c31('0x29')]+_0x5c31('0x65'));}emitCampaignPreview(_0x3c55ed);}}Preview[_0x5c31('0x10')]['loopCampaigns']=function(){var _0x4b4b65=this;setInterval(function(){_0x4b4b65[_0x5c31('0x66')]();},0x7cf);};Preview[_0x5c31('0x10')][_0x5c31('0x66')]=function(){var _0x111981=this[_0x5c31('0x13')];this[_0x5c31('0x17')]+=0x1;for(var _0x145bab in _0x111981){if(_0x111981[_0x5c31('0x67')](_0x145bab)&&(_0x111981[_0x145bab][_0x5c31('0x35')]==='preview'||_0x111981[_0x145bab]['dialMethod']===_0x5c31('0x68'))&&_0x111981[_0x145bab][_0x5c31('0x27')]==='outbound'){if(this[_0x5c31('0x17')]>0x7){this[_0x5c31('0x17')]=0x0;this[_0x5c31('0x69')]();}}if(_0x111981[_0x5c31('0x67')](_0x145bab)&&_0x111981[_0x145bab]['dialMethod']===_0x5c31('0x6a')&&_0x111981[_0x145bab]['type']===_0x5c31('0x28')){if(_0x111981[_0x145bab][_0x5c31('0x6b')]){this[_0x5c31('0x6c')](_0x111981[_0x145bab]);this[_0x5c31('0x6d')](_0x111981[_0x145bab]);}else{notSendMessagesQueue(_0x111981[_0x145bab]);}}}};Preview[_0x5c31('0x10')][_0x5c31('0x6e')]=function(_0x3dc89b){var _0x37c885=this;this[_0x5c31('0x12')]['enqueue'](function(){if(!_[_0x5c31('0x6f')](_0x37c885[_0x5c31('0x70')][_0x3dc89b])){loggerAction['info'](_0x5c31('0x71'),_0x3dc89b,_0x5c31('0x72'),_0x37c885['actions'][_0x3dc89b][_0x5c31('0x73')],_0x5c31('0x74'),JSON[_0x5c31('0x57')](_0x37c885[_0x5c31('0x13')][_0x37c885[_0x5c31('0x70')][_0x3dc89b][_0x5c31('0x73')]]['originated']),_0x5c31('0x75'),JSON[_0x5c31('0x57')](_0x37c885[_0x5c31('0x13')][_0x37c885[_0x5c31('0x70')][_0x3dc89b][_0x5c31('0x73')]][_0x5c31('0x5e')]),JSON[_0x5c31('0x57')](_0x37c885[_0x5c31('0x70')][_0x3dc89b][_0x5c31('0x76')]),JSON[_0x5c31('0x57')](_[_0x5c31('0x77')](_0x37c885[_0x5c31('0x70')][_0x3dc89b],[_0x5c31('0x78'),_0x5c31('0x79'),'VoiceQueueId',_0x5c31('0x7a')])));return ami[_0x5c31('0x7b')]({'action':_0x5c31('0x7c'),'channel':_0x37c885['actions'][_0x3dc89b][_0x5c31('0x7d')]})[_0x5c31('0x7e')](function(_0x3aba4d){if(_0x3aba4d['message']===_0x5c31('0x7f')){setTimeout(function(){if(_0x37c885[_0x5c31('0x70')][_0x3dc89b]){ut['updateOriginated'](_0x37c885[_0x5c31('0x13')][_0x37c885[_0x5c31('0x70')][_0x3dc89b]['queue']],_0x5c31('0x80'));if(_0x37c885[_0x5c31('0x70')][_0x3dc89b][_0x5c31('0x76')]===!![]){ut['decrementTalkink'](_0x37c885[_0x5c31('0x13')][_0x37c885[_0x5c31('0x70')][_0x3dc89b][_0x5c31('0x73')]],_0x5c31('0x80'));ut[_0x5c31('0x81')]('[Dialer][checkChannel][pTalking][Preview]'+_0x3dc89b,_0x37c885['actions'][_0x3dc89b][_0x5c31('0x73')]);}ut[_0x5c31('0x81')](_0x5c31('0x82')+_0x3dc89b,_0x37c885['actions'][_0x3dc89b][_0x5c31('0x73')]);delete _0x37c885[_0x5c31('0x70')][_0x3dc89b];}},0x2328);}});}});};Preview[_0x5c31('0x10')][_0x5c31('0x69')]=function(){var _0x15e3aa=this;loggerAction[_0x5c31('0x5a')](_0x5c31('0x83'),_[_0x5c31('0x84')](this[_0x5c31('0x70')]));for(var _0xc2006b in this[_0x5c31('0x70')]){if(_0x15e3aa[_0x5c31('0x70')][_0x5c31('0x67')](_0xc2006b)){_0x15e3aa['clearZombieChannel'](_0xc2006b);}}};Preview[_0x5c31('0x10')]['recallMe']=function(_0x9fb394){var _0x342e22=this;rpcDb[_0x5c31('0x85')](_0x9fb394['id'],ut[_0x5c31('0x86')](this[_0x5c31('0x16')]))[_0x5c31('0x87')](function(_0x5829fc){if(!_[_0x5c31('0x6f')](_0x5829fc)){for(var _0x2e1cf1=0x0;_0x2e1cf1<_0x5829fc['length'];_0x2e1cf1+=0x1){if(ut['getDiff'](_0x5829fc[_0x2e1cf1][_0x5c31('0x88')])<_0x9fb394[_0x5c31('0x89')]*0x3c){if(_0x5829fc[_0x2e1cf1]['Agent']&&!_0x5829fc[_0x2e1cf1]['Agent']['voicePause']){_0x342e22[_0x5c31('0x8a')](_0x5829fc[_0x2e1cf1]['id'])[_0x5c31('0x87')](ut['logger2'](_0x5c31('0x8b')))[_0x5c31('0x7e')](ut[_0x5c31('0x8c')](_0x5c31('0x8b')));}else{rpcDb[_0x5c31('0x8d')](_0x5829fc[_0x2e1cf1]['id']);}}else{var _0x47a4cf=new Action(_0x5829fc[_0x2e1cf1],_0x9fb394);_0x47a4cf['starttime']=moment()[_0x5c31('0x5c')](_0x5c31('0x8e'));_0x9fb394['outboundReCallsDay']+=0x1;ut[_0x5c31('0x8f')](_0x47a4cf,0x17,'RecallInQueue');if(_0x9fb394[_0x5c31('0x90')]){rpcDb[_0x5c31('0x91')](ut[_0x5c31('0x92')](_0x5829fc[_0x2e1cf1]));rpcDb['createCustomerHistory'](_0x47a4cf,_0x5c31('0x93'));}else{ut[_0x5c31('0x8f')](_0x47a4cf,0x16,_0x5c31('0x94'));rpcDb[_0x5c31('0x95')](_0x47a4cf,_0x5c31('0x96'));rpcDb['createCustomerFinal'](_0x47a4cf,_0x5c31('0x96'));}}}}})[_0x5c31('0x7e')](ut['logger2'](_0x5c31('0x97')));};Preview[_0x5c31('0x10')]['setMessage']=function(_0x315b09){_0x315b09[_0x5c31('0x5f')]=!![];if(ut['IsNotLoggedIn'](_0x315b09['loggedIn'])){_0x315b09[_0x5c31('0x4e')]='AGENTS_NOT_LOGGED';}else if(!ut[_0x5c31('0x98')](_0x315b09[_0x5c31('0x6b')])){_0x315b09[_0x5c31('0x4e')]=_0x5c31('0x61');}else if(!this[_0x5c31('0x99')](_0x315b09['Trunk'])){if(!this[_0x5c31('0x99')](_0x315b09[_0x5c31('0x9a')])){_0x315b09[_0x5c31('0x4e')]='TRUNK_IS_NOT_REACHABLE';}else{_0x315b09[_0x5c31('0x4e')]=_0x5c31('0x9b');}}else{_0x315b09[_0x5c31('0x4e')]='ACTIVE';}emitCampaignPreview(_0x315b09);};Preview[_0x5c31('0x10')][_0x5c31('0x9c')]=function(_0x30cb82,_0x1c65d7,_0x522205){var _0xbd4dfc=this;var _0x140b30=this[_0x5c31('0x70')][_0x1c65d7];var _0x5c7e30=this[_0x5c31('0x13')][_0x140b30[_0x5c31('0x73')]];var _0x1777f0;var _0x3ee9a7=![];var _0x1a8c1e=0x2;var _0x23b5ed=0x3;if(_0x5c7e30){switch(_0x522205){case'1':_0x5c7e30['outboundNoSuchCallsDay']+=0x1;_0x140b30[_0x5c31('0x9d')]+=0x1;_0x140b30[_0x5c31('0x9e')]=ut['totalGlobal'](_0x140b30);ut[_0x5c31('0x8f')](_0x140b30,0x0,_0x5c31('0x9f'));ami['emit'](_0x5c31('0xa0'),ut[_0x5c31('0xa1')](_0x140b30,_0x5c31('0xa2')));rpcDb[_0x5c31('0x95')](_0x140b30,_0x5c31('0xa3'));_0xbd4dfc[_0x5c31('0xa4')](_0x140b30,'0',_0x5c7e30)[_0x5c31('0x87')](function(_0x388a13){_0x3ee9a7=_0x388a13[_0x5c31('0xa5')]==0x1;_0x1a8c1e=_0x5c7e30[_0x5c31('0xa6')];_0x23b5ed=_0x5c7e30[_0x5c31('0xa7')];if(!_0x3ee9a7){if(ut[_0x5c31('0xa8')](_0x140b30)>=_0x5c7e30[_0x5c31('0xa9')]){_0x1777f0=ut['cloneAction'](_0x140b30,0xf,_0x5c31('0xaa'));rpcDb['createCustomerFinal'](_0x1777f0,_0x5c31('0xab'));}else{if(_0x140b30[_0x5c31('0x9d')]>=_0x5c7e30[_0x5c31('0xac')]){rpcDb[_0x5c31('0xad')](_0x140b30,_0x5c31('0xab'));}else{rpcDb[_0x5c31('0xae')](ut['scheduledAt'](_0x140b30,'countnosuchnumberretry',_0x5c7e30[_0x5c31('0xa6')]),_0x140b30[_0x5c31('0xaf')],_0x140b30['activeContact']);}}delete this[_0x5c31('0x70')][_0x30cb82['linkedid']];}else{_0x140b30[_0x5c31('0x9d')]++;logger[_0x5c31('0x5a')](_0x5c31('0xb0'),_0x140b30[_0x5c31('0x9d')]);logger[_0x5c31('0x5a')]('id',_0x140b30['idContact']);_0xbd4dfc[_0x5c31('0xb1')]({'id':_0x140b30[_0x5c31('0xb2')],'field':{'countnosuchnumberretry':_0x140b30[_0x5c31('0x9d')]}})[_0x5c31('0x87')](function(){_0xbd4dfc[_0x5c31('0xb3')](_0x140b30,_0x1a8c1e,_0x23b5ed)[_0x5c31('0x87')](function(){});});}});break;case _0x5c31('0xb4'):var _0x1ca042=moment()[_0x5c31('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0x140b30[_0x5c31('0xb5')]=_0x1ca042;_0x140b30[_0x5c31('0xb6')]=_0x1ca042;_0x140b30[_0x5c31('0x76')]=!![];_0x5c7e30[_0x5c31('0x5e')]+=0x1;logger[_0x5c31('0x5a')]('[syncHangup][talking][increment]',_0x140b30['uniqueid'],_0x5c31('0xb7'),_0x5c7e30[_0x5c31('0x29')],_0x5c31('0x75'),_0x5c7e30[_0x5c31('0x5e')]);ami[_0x5c31('0xb8')](_0x5c31('0xb9'),ut[_0x5c31('0xa1')](_0x140b30,_0x5c31('0xba'),this[_0x5c31('0x13')][_0x140b30['queue']]));if(_0x5c7e30[_0x5c31('0xbb')]){ami[_0x5c31('0xb8')](_0x5c31('0xbc'),ut[_0x5c31('0xbd')](_0x140b30));}break;case'16':ami[_0x5c31('0xb8')](_0x5c31('0xbe'),ut[_0x5c31('0xa1')](_0x140b30,'complete',this[_0x5c31('0x13')][_0x140b30[_0x5c31('0x73')]]));emitVoiceQueueChannelRemove(ut[_0x5c31('0xa1')](_0x140b30,_0x5c31('0xbf')));_0x5c7e30[_0x5c31('0x39')]+=0x1;_0x5c7e30[_0x5c31('0x31')]+=0x1;_0x5c7e30[_0x5c31('0x2a')]+=0x1;ut[_0x5c31('0xc0')](_0x5c7e30,_0x5c31('0xc1'));_0x140b30[_0x5c31('0x9e')]=ut['totalGlobal'](_0x140b30);ut[_0x5c31('0x8f')](_0x140b30,0x4,_0x5c31('0xc2'));rpcDb[_0x5c31('0x95')](_0x140b30,_0x5c31('0xc3'));rpcDb['createCustomerFinal'](_0x140b30,_0x5c31('0xc4'));rpcDb[_0x5c31('0xc5')](_0x140b30);_0x5c7e30[_0x5c31('0x2e')]+=_0x140b30['talktime'];_0x5c7e30['sumBillable']+=_0x140b30[_0x5c31('0xc6')];logger[_0x5c31('0x5a')]('[syncHangup][talking][decrement]',_0x140b30[_0x5c31('0xc7')],'\x20Queue',_0x5c7e30[_0x5c31('0x29')],'pTalking:\x20',_0x5c7e30[_0x5c31('0x5e')]);delete this[_0x5c31('0x70')][_0x30cb82[_0x5c31('0xc8')]];break;case _0x5c31('0xc9'):_0x5c7e30[_0x5c31('0x3a')]+=0x1;_0x140b30[_0x5c31('0xca')]+=0x1;_0x140b30['countglobal']=ut[_0x5c31('0xa8')](_0x140b30);ut[_0x5c31('0x8f')](_0x140b30,0x5,_0x5c31('0xcb'));_0x1a8c1e=_0x5c7e30['dialBusyRetryFrequency'];_0x23b5ed=_0x5c7e30[_0x5c31('0xa7')];ami[_0x5c31('0xb8')](_0x5c31('0xcc'),ut[_0x5c31('0xa1')](_0x140b30,_0x5c31('0xcd')));rpcDb['createCustomerHistory'](_0x140b30,'[callProgressDetectingCustomer][logBusy]');_0xbd4dfc[_0x5c31('0xa4')](_0x140b30,'5',_0x5c7e30)[_0x5c31('0x87')](function(_0x25c345){_0x3ee9a7=_0x25c345[_0x5c31('0xa5')]==0x1;if(!_0x3ee9a7){if(ut[_0x5c31('0xa8')](_0x140b30)>=_0x5c7e30[_0x5c31('0xa9')]){_0x1777f0=ut[_0x5c31('0xce')](_0x140b30,0xf,'Global');rpcDb[_0x5c31('0xad')](_0x1777f0,_0x5c31('0xcf'));}else{if(_0x140b30[_0x5c31('0xca')]>=_0x5c7e30['dialBusyMaxRetry']){rpcDb[_0x5c31('0xad')](_0x140b30,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0x5c31('0xae')](ut[_0x5c31('0xd0')](_0x140b30,'countbusyretry',_0x5c7e30[_0x5c31('0xd1')]),_0x140b30[_0x5c31('0xaf')],_0x140b30[_0x5c31('0xd2')]);}}}else{_0x140b30[_0x5c31('0xca')]++;_0xbd4dfc['incrementPreviewCounters']({'id':_0x140b30[_0x5c31('0xb2')],'field':{'countbusyretry':_0x140b30[_0x5c31('0xca')]}})[_0x5c31('0x87')](function(){_0xbd4dfc[_0x5c31('0xb3')](_0x140b30,_0x1a8c1e,_0x23b5ed)[_0x5c31('0x87')](function(){});});}});break;case _0x5c31('0xd3'):_0x5c7e30[_0x5c31('0x3e')]+=0x1;_0x140b30['countnoanswerretry']+=0x1;_0x140b30[_0x5c31('0x9e')]=ut[_0x5c31('0xa8')](_0x140b30);ut['logCustomer'](_0x140b30,0x3,_0x5c31('0xd4'));_0x1a8c1e=_0x5c7e30[_0x5c31('0xd5')];_0x23b5ed=_0x5c7e30[_0x5c31('0xa7')];ami['emit'](_0x5c31('0xd6'),ut[_0x5c31('0xa1')](_0x140b30,_0x5c31('0xd7')));rpcDb[_0x5c31('0x95')](_0x140b30,'[callProgressDetectingCustomer][logNoAnswer]');_0xbd4dfc[_0x5c31('0xa4')](_0x140b30,'3',_0x5c7e30)[_0x5c31('0x87')](function(_0x3dc29d){_0x3ee9a7=_0x3dc29d[_0x5c31('0xa5')]==0x1;if(!_0x3ee9a7){if(ut[_0x5c31('0xa8')](_0x140b30)>=_0x5c7e30[_0x5c31('0xa9')]){_0x1777f0=ut[_0x5c31('0xce')](_0x140b30,0xf,'Global');rpcDb[_0x5c31('0xad')](_0x1777f0,_0x5c31('0xd8'));}else{if(_0x140b30[_0x5c31('0xd9')]>=_0x5c7e30[_0x5c31('0xda')]){rpcDb[_0x5c31('0xad')](_0x140b30,_0x5c31('0xdb'));}else{rpcDb[_0x5c31('0xae')](ut[_0x5c31('0xd0')](_0x140b30,_0x5c31('0xd9'),_0x5c7e30[_0x5c31('0xd5')]),_0x140b30[_0x5c31('0xaf')],_0x140b30[_0x5c31('0xd2')]);}}}else{_0x140b30[_0x5c31('0xd9')]++;_0xbd4dfc['incrementPreviewCounters']({'id':_0x140b30['idContact'],'field':{'countnoanswerretry':_0x140b30['countnoanswerretry']}})[_0x5c31('0x87')](function(){_0xbd4dfc[_0x5c31('0xb3')](_0x140b30,_0x1a8c1e,_0x23b5ed)[_0x5c31('0x87')](function(){});});}});break;case'CONGESTION':_0x5c7e30[_0x5c31('0x3b')]+=0x1;_0x140b30[_0x5c31('0xdc')]+=0x1;_0x140b30[_0x5c31('0x9e')]=ut[_0x5c31('0xa8')](_0x140b30);ut[_0x5c31('0x8f')](_0x140b30,0x8,'Congestion');_0x1a8c1e=_0x5c7e30['dialCongestionRetryFrequency'];_0x23b5ed=_0x5c7e30[_0x5c31('0xa7')];ami[_0x5c31('0xb8')](_0x5c31('0xdd'),ut[_0x5c31('0xa1')](_0x140b30,_0x5c31('0xde')));rpcDb[_0x5c31('0x95')](_0x140b30,_0x5c31('0xdf'));_0xbd4dfc['verifyAdditionalPhones'](_0x140b30,'8',_0x5c7e30)[_0x5c31('0x87')](function(_0x840115){_0x3ee9a7=_0x840115[_0x5c31('0xa5')]==0x1;if(!_0x3ee9a7){if(ut[_0x5c31('0xa8')](_0x140b30)>=_0x5c7e30['dialGlobalMaxRetry']){_0x1777f0=ut[_0x5c31('0xce')](_0x140b30,0xf,_0x5c31('0xaa'));rpcDb['createCustomerFinal'](_0x1777f0,_0x5c31('0xe0'));}else{if(_0x140b30[_0x5c31('0xdc')]>=_0x5c7e30[_0x5c31('0xe1')]){rpcDb[_0x5c31('0xad')](_0x140b30,_0x5c31('0xdf'));}else{rpcDb[_0x5c31('0xae')](ut[_0x5c31('0xd0')](_0x140b30,_0x5c31('0xdc'),_0x5c7e30[_0x5c31('0xd1')]),_0x140b30[_0x5c31('0xaf')],_0x140b30[_0x5c31('0xd2')]);}}}else{_0x140b30[_0x5c31('0xdc')]++;_0xbd4dfc['incrementPreviewCounters']({'id':_0x140b30[_0x5c31('0xb2')],'field':{'countcongestionretry':_0x140b30[_0x5c31('0xdc')]}})['then'](function(){_0xbd4dfc[_0x5c31('0xb3')](_0x140b30,_0x1a8c1e,_0x23b5ed)[_0x5c31('0x87')](function(){});});}});break;case _0x5c31('0xe2'):_0x5c7e30['outboundRejectCallsDay']+=0x1;_0x140b30[_0x5c31('0xe3')]+=0x1;_0x140b30[_0x5c31('0x9e')]=ut[_0x5c31('0xa8')](_0x140b30);ut['logCustomer'](_0x140b30,0x14,'AgentReject');_0x1a8c1e=_0x5c7e30['dialAgentRejectRetryFrequency'];_0x23b5ed=_0x5c7e30[_0x5c31('0xa7')];ami[_0x5c31('0xb8')](_0x5c31('0xe4'),ut[_0x5c31('0xa1')](_0x140b30,_0x5c31('0xe5')));rpcDb['createCustomerHistory'](_0x140b30,_0x5c31('0xe6'));_0xbd4dfc[_0x5c31('0xa4')](_0x140b30,'20',_0x5c7e30)['then'](function(_0x1a6c13){_0x3ee9a7=_0x1a6c13[_0x5c31('0xa5')]==0x1;if(!_0x3ee9a7){if(ut[_0x5c31('0xa8')](_0x140b30)>=_0x5c7e30[_0x5c31('0xa9')]){_0x1777f0=ut[_0x5c31('0xce')](_0x140b30,0x14,_0x5c31('0xe7'));rpcDb['createCustomerFinal'](_0x1777f0,_0x5c31('0xe8'));}else{if(_0x140b30[_0x5c31('0xe3')]>=_0x5c7e30[_0x5c31('0xe9')]){rpcDb[_0x5c31('0xad')](_0x140b30,_0x5c31('0xe8'));}else{rpcDb['rescheduleContact'](ut[_0x5c31('0xd0')](_0x140b30,_0x5c31('0xe3'),_0x5c7e30[_0x5c31('0xea')]),_0x140b30['unlockAgent'],_0x140b30[_0x5c31('0xd2')]);}}}else{_0x140b30[_0x5c31('0xd9')]++;_0xbd4dfc[_0x5c31('0xb1')]({'id':_0x140b30[_0x5c31('0xb2')],'field':{'countnoanswerretry':_0x140b30[_0x5c31('0xd9')]}})[_0x5c31('0x87')](function(){_0xbd4dfc['swapAdditionalPhones'](_0x140b30,_0x1a8c1e,_0x23b5ed)['then'](function(){});});}});break;case'ABANDONED':_0x5c7e30[_0x5c31('0x44')]+=0x1;_0x140b30[_0x5c31('0xeb')]+=0x1;_0x140b30[_0x5c31('0x9e')]=ut[_0x5c31('0xa8')](_0x140b30);ut['logCustomer'](_0x140b30,0xb,_0x5c31('0xec'));rpcDb[_0x5c31('0x95')](_0x140b30,_0x5c31('0xed'));_0xbd4dfc[_0x5c31('0xa4')](_0x140b30,'11',_0x5c7e30)[_0x5c31('0x87')](function(_0x331355){_0x3ee9a7=_0x331355[_0x5c31('0xa5')]==0x1;if(!_0x3ee9a7){if(ut[_0x5c31('0xa8')](_0x140b30)>=_0x5c7e30[_0x5c31('0xa9')]){_0x1777f0=ut[_0x5c31('0xce')](_0x140b30,0xf,_0x5c31('0xaa'));rpcDb['createCustomerFinal'](_0x1777f0,_0x5c31('0xed'));}else{if(_0x140b30[_0x5c31('0xee')]>=_0x5c7e30[_0x5c31('0xef')]){rpcDb['createCustomerFinal'](_0x140b30,_0x5c31('0xed'));}else{rpcDb[_0x5c31('0xae')](ut[_0x5c31('0xd0')](_0x140b30,'countabandonedretry',_0x5c7e30[_0x5c31('0xf0')]),_0x140b30[_0x5c31('0xaf')],_0x140b30[_0x5c31('0xd2')]);}}}else{_0x140b30['countnoanswerretry']++;_0xbd4dfc[_0x5c31('0xb1')]({'id':_0x140b30[_0x5c31('0xb2')],'field':{'countnoanswerretry':_0x140b30[_0x5c31('0xd9')]}})[_0x5c31('0x87')](function(){_0xbd4dfc[_0x5c31('0xb3')](_0x140b30,_0x1a8c1e,_0x23b5ed)[_0x5c31('0x87')](function(){});});}});break;case'18':_0x5c7e30['outboundUnknownCallsDay']+=0x1;_0x140b30['countmachineretry']+=0x1;_0x140b30[_0x5c31('0x9e')]=ut[_0x5c31('0xa8')](_0x140b30);ut[_0x5c31('0x8f')](_0x140b30,0x12,_0x30cb82[_0x5c31('0xf1')]||_0x30cb82[_0x5c31('0xf2')]);ami['emit'](_0x5c31('0xf3'),ut['buildObj'](_0x140b30,_0x5c31('0xf4')));rpcDb[_0x5c31('0x95')](_0x140b30,_0x5c31('0xf5'));_0xbd4dfc[_0x5c31('0xa4')](_0x140b30,'18',_0x5c7e30)[_0x5c31('0x87')](function(_0xffe368){_0x3ee9a7=_0xffe368['additional']==0x1;if(!_0x3ee9a7){if(ut[_0x5c31('0xa8')](_0x140b30)>=_0x5c7e30['dialGlobalMaxRetry']){_0x1777f0=ut[_0x5c31('0xce')](_0x140b30,0x12,_0x5c31('0xaa'));rpcDb[_0x5c31('0xad')](_0x1777f0,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0x5c31('0xad')](_0x140b30,_0x5c31('0xf5'));}}else{_0x140b30['countnoanswerretry']++;_0xbd4dfc[_0x5c31('0xb1')]({'id':_0x140b30['idContact'],'field':{'countnoanswerretry':_0x140b30[_0x5c31('0xd9')]}})[_0x5c31('0x87')](function(){_0xbd4dfc[_0x5c31('0xb3')](_0x140b30,_0x1a8c1e,_0x23b5ed)[_0x5c31('0x87')](function(){});});}});delete this[_0x5c31('0x70')][_0x30cb82['linkedid']];break;case'19':_0x5c7e30[_0x5c31('0x43')]+=0x1;_0x140b30[_0x5c31('0x9e')]=ut[_0x5c31('0xa8')](_0x140b30);ut[_0x5c31('0x8f')](_0x140b30,0x13,_0x30cb82[_0x5c31('0xf1')]||_0x30cb82[_0x5c31('0xf2')]);ami[_0x5c31('0xb8')](_0x5c31('0xf3'),ut[_0x5c31('0xa1')](_0x140b30,_0x5c31('0xf4')));rpcDb[_0x5c31('0x95')](_0x140b30,_0x5c31('0xf6'));_0xbd4dfc[_0x5c31('0xa4')](_0x140b30,'18',_0x5c7e30)[_0x5c31('0x87')](function(_0x4c6069){_0x3ee9a7=_0x4c6069['additional']==0x1;if(!_0x3ee9a7){if(ut['totalGlobal'](_0x140b30)>=_0x5c7e30[_0x5c31('0xa9')]){_0x1777f0=ut[_0x5c31('0xce')](_0x140b30,0xf,_0x5c31('0xaa'));rpcDb[_0x5c31('0xad')](_0x1777f0,'[callProgressDetectingCustomer][machine]');}else{rpcDb['createCustomerFinal'](_0x140b30,'[callProgressDetectingCustomer][machine]');}}else{_0x140b30[_0x5c31('0xd9')]++;_0xbd4dfc['incrementPreviewCounters']({'id':_0x140b30[_0x5c31('0xb2')],'field':{'countnoanswerretry':_0x140b30[_0x5c31('0xd9')]}})[_0x5c31('0x87')](function(){_0xbd4dfc[_0x5c31('0xb3')](_0x140b30,_0x1a8c1e,_0x23b5ed)[_0x5c31('0x87')](function(){});});}});delete this[_0x5c31('0x70')][_0x30cb82[_0x5c31('0xc8')]];break;default:if(_0x140b30[_0x5c31('0x76')]){ut[_0x5c31('0xc0')](_0x5c7e30,_0x5c31('0xf7'));ut[_0x5c31('0x81')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x5c7e30['name'],_0x30cb82);}_0x5c7e30[_0x5c31('0x43')]+=0x1;_0x140b30[_0x5c31('0x9e')]=ut[_0x5c31('0xa8')](_0x140b30);ut['logCustomer'](_0x140b30,0xc,_0x30cb82[_0x5c31('0xf1')]||_0x30cb82[_0x5c31('0xf2')]);_0x1a8c1e=_0x5c7e30[_0x5c31('0xea')];_0x23b5ed=_0x5c7e30[_0x5c31('0xa7')];rpcDb['createCustomerHistory'](_0x140b30,'[callProgressDetectingCustomer][logUnknown]');_0xbd4dfc[_0x5c31('0xa4')](_0x140b30,'20',_0x5c7e30)['then'](function(_0x1db888){_0x3ee9a7=_0x1db888[_0x5c31('0xa5')]==0x1;if(!_0x3ee9a7){if(ut[_0x5c31('0xa8')](_0x140b30)>=_0x5c7e30['dialGlobalMaxRetry']){_0x1777f0=ut[_0x5c31('0xce')](_0x140b30,0xf,_0x5c31('0xaa'));rpcDb[_0x5c31('0xad')](_0x1777f0,_0x5c31('0xf8'));}else{rpcDb[_0x5c31('0xad')](_0x140b30,_0x5c31('0xf8'));}delete this[_0x5c31('0x70')][_0x30cb82[_0x5c31('0xc8')]];}else{_0xbd4dfc[_0x5c31('0xb3')](_0x140b30,_0x1a8c1e,_0x23b5ed)[_0x5c31('0x87')](function(_0x1754a7){});}});}if(!(_0x140b30['dialAnswer']&&_0x522205==='16')){ut[_0x5c31('0xf9')](_0x5c7e30,_0x5c31('0xfa'));logger[_0x5c31('0x5a')](_0x5c31('0xfb'),_0x140b30[_0x5c31('0xc7')],_0x5c31('0xb7'),_0x5c7e30[_0x5c31('0x29')],_0x5c31('0x74'),_0x5c7e30[_0x5c31('0x4f')]);}if(_0x522205!=='ANSWER'){delete this[_0x5c31('0x70')][_0x30cb82['linkedid']];delete this[_0x5c31('0x70')][_0x30cb82[_0x5c31('0xfc')]];}}};Preview[_0x5c31('0x10')]['callProgressDetectingAgent']=function(_0x38fd5d,_0x18838d,_0x5cbb85){if(_['isUndefined'](_0x18838d)&&'object'!==typeof _0x18838d){return;}if(_['isUndefined'](_0x5cbb85)&&_0x5c31('0xfd')!==typeof _0x5cbb85){return;}switch(_0x5cbb85[_0x5c31('0xfe')]){case'0':ut['logAgent'](_0x38fd5d,0x0,'NoSuchNumber');rpcDb[_0x5c31('0xff')](_0x38fd5d,_0x5c31('0x100'));break;case'3':ut[_0x5c31('0x101')](_0x38fd5d,0x3,_0x5c31('0xd4'));rpcDb[_0x5c31('0xff')](_0x38fd5d,_0x5c31('0x102'));break;case'5':ut['logAgent'](_0x38fd5d,0x5,_0x5c31('0xcb'));rpcDb['createAgentHistory'](_0x38fd5d,_0x5c31('0x103'));break;case'8':ut[_0x5c31('0x101')](_0x38fd5d,0x8,'Congestion');rpcDb[_0x5c31('0xff')](_0x38fd5d,_0x5c31('0x104'));break;case'22':ut[_0x5c31('0x101')](_0x38fd5d,0x16,_0x5c31('0x105'));rpcDb[_0x5c31('0xff')](_0x38fd5d,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0x5c31('0x101')](_0x38fd5d,0xc,_0x5cbb85[_0x5c31('0xfe')]);rpcDb[_0x5c31('0xff')](_0x38fd5d,_0x5c31('0x104'));}ut[_0x5c31('0xf9')](_0x18838d,_0x5c31('0x106'));logger['info'](_0x5c31('0x107'),_0x38fd5d[_0x5c31('0xc7')],'\x20Queue',_0x18838d[_0x5c31('0x29')],'originated:\x20',_0x18838d[_0x5c31('0x4f')]);delete this['actions'][_0x38fd5d[_0x5c31('0xc7')]];};Preview[_0x5c31('0x10')][_0x5c31('0xa4')]=function(_0x2f1df3,_0x396cfd,_0xcc16f9){return BPromise[_0x5c31('0x108')]()[_0x5c31('0x87')](cmHopperAdditionalPhone[_0x5c31('0xa4')](_0x2f1df3,_0x396cfd,_0xcc16f9))[_0x5c31('0x7e')](logger[_0x5c31('0x5a')](_0x5c31('0x109')));};Preview[_0x5c31('0x10')][_0x5c31('0xb3')]=function(_0xf58864,_0x41d36e,_0x47359e){return BPromise['resolve']()[_0x5c31('0x87')](cmHopperAdditionalPhone[_0x5c31('0xb3')](_0xf58864,_0x41d36e,_0x47359e))['catch'](logger[_0x5c31('0x5a')](_0x5c31('0x10a')));};Preview['prototype'][_0x5c31('0xb1')]=function(_0x436586){return BPromise[_0x5c31('0x108')]()[_0x5c31('0x87')](cmHopperAdditionalPhone[_0x5c31('0xb1')](_0x436586))['catch'](logger[_0x5c31('0x5a')](_0x5c31('0x10b')));};Preview[_0x5c31('0x10')][_0x5c31('0x10c')]=function(_0x530404,_0x58da25,_0x3308fb,_0x3c28e3,_0x8283ed){var _0x50df57=this;return new BPromise(function(_0x41b4a1,_0x442264){if(_[_0x5c31('0x6f')](_0x58da25)||_[_0x5c31('0x6f')](_0x58da25[_0x5c31('0x10d')])||_[_0x5c31('0x6f')](_0x58da25[_0x5c31('0x10e')])||_[_0x5c31('0x6f')](_0x58da25[_0x5c31('0x10f')])){_0x442264(ut[_0x5c31('0x4e')]('Contact\x20is\x20undefined',_0x3c28e3,_0x8283ed));return;}var _0x563c8e=uuid['v4']();var _0x17b7f6=_0x50df57[_0x5c31('0x13')][_0x58da25[_0x5c31('0x72')]['name']];var _0x598184=_0x3308fb?_0x50df57['agents'][_0x3308fb]['id']:undefined;_0x50df57['actions'][_0x563c8e]=new Action(_0x58da25,_0x17b7f6,_0x563c8e,_0x3308fb,_0x598184);var _0x295f73=_0x50df57[_0x5c31('0x70')][_0x563c8e];_0x295f73[_0x5c31('0xaf')]=_0x3c28e3;_0x295f73['activeContact']=_0x8283ed;_0x295f73[_0x5c31('0x110')]=_0x3308fb;if(_['isEmpty'](_0x530404)){_0x50df57[_0x5c31('0x111')](_0x295f73,_0x17b7f6,_0x58da25,_0x3308fb)[_0x5c31('0x87')](function(_0x52e20f){logger['info']('[Preview][execCall][success]',_0x5c31('0x112')+_0x295f73[_0x5c31('0x73')]+_0x5c31('0x113')+_0x295f73[_0x5c31('0xb2')],JSON['stringify'](_0x52e20f));ami[_0x5c31('0xb8')](_0x5c31('0x114'),ut['buildObj'](_0x295f73,_0x5c31('0x115'),_0x50df57['campaignsPreview'][_0x295f73[_0x5c31('0x73')]]));_0x41b4a1(ut[_0x5c31('0x4e')](_0x5c31('0x116')));})[_0x5c31('0x7e')](function(_0x2077f1){ut[_0x5c31('0x62')](_0x5c31('0x117'),_0x2077f1);_0x442264(ut[_0x5c31('0x4e')](_0x5c31('0x118'),_0x3c28e3,_0x8283ed));});}else{_0x17b7f6[_0x5c31('0x119')]+=0x1;ut[_0x5c31('0x11a')](_0x295f73);rpcDb[_0x5c31('0x11b')](_0x295f73,_0x5c31('0x11c'));delete _0x50df57[_0x5c31('0x70')][_0x563c8e];_0x442264(ut[_0x5c31('0x4e')](_0x5c31('0x11d'),_0x3c28e3,_0x8283ed));}});};Preview['prototype'][_0x5c31('0x99')]=function(_0x2e7153){return!_[_0x5c31('0x6f')](_0x2e7153)&&!_[_0x5c31('0x6f')](_0x2e7153[_0x5c31('0x29')])&&!_[_0x5c31('0x6f')](_0x2e7153[_0x5c31('0x54')])&&_0x2e7153[_0x5c31('0x54')]&&!_[_0x5c31('0x6f')](this[_0x5c31('0x15')][util[_0x5c31('0x5c')](_0x5c31('0x11e'),_0x2e7153['name'])])&&!_[_0x5c31('0x6f')](this['trunks'][util[_0x5c31('0x5c')]('SIP/%s',_0x2e7153[_0x5c31('0x29')])][_0x5c31('0x7c')])&&(this['trunks'][util[_0x5c31('0x5c')]('SIP/%s',_0x2e7153['name'])][_0x5c31('0x7c')]===_0x5c31('0x11f')||this[_0x5c31('0x15')][util[_0x5c31('0x5c')](_0x5c31('0x11e'),_0x2e7153[_0x5c31('0x29')])]['status']==='unmonitored');};Preview['prototype'][_0x5c31('0x8a')]=function(_0x61d5be,_0x3d8dad){var _0x477feb=this;return new BPromise(function(_0x16c226,_0x37cb14){_0x477feb['execRun'](_0x61d5be,_0x3d8dad)[_0x5c31('0x87')](function(_0x3c1383){_0x16c226(_[_0x5c31('0x77')](_0x3c1383,[_0x5c31('0x4e')]));})['catch'](function(_0x37c7e2){if(_0x37c7e2[_0x5c31('0x120')]){rpcDb[_0x5c31('0x121')](_0x61d5be);}if(_0x37c7e2['active']){rpcDb['disableContact'](_0x61d5be);}_0x37cb14(_['pick'](_0x37c7e2,[_0x5c31('0x4e')]));});});};Preview[_0x5c31('0x10')]['execRun']=function(_0x1086bd,_0x23791f){var _0x2cceed=this;return new BPromise(function(_0x5ed491,_0x2bfaaf){var _0x2a8011,_0x425256;rpcDb[_0x5c31('0x122')](_0x1086bd)[_0x5c31('0x87')](function(_0x3f4bf9){if(!_[_0x5c31('0x6f')](_0x3f4bf9[0x0])){_0x425256=_0x3f4bf9[0x0]['recallme']?![]:!![];_0x2a8011=_0x3f4bf9[0x0]['recallme']?!![]:![];_0x2a8011=_0x23791f?!![]:_0x2a8011;}var _0x4bb296=_0x2cceed['validateContact'](_0x3f4bf9);if(_0x4bb296[_0x5c31('0x123')]){rpcDb[_0x5c31('0x124')](_['pick'](_0x3f4bf9[0x0],['VoiceQueueId','phone']))[_0x5c31('0x87')](function(_0x76b32c){_0x2cceed[_0x5c31('0x10c')](_0x76b32c,_0x3f4bf9[0x0],_0x23791f,_0x425256,_0x2a8011)[_0x5c31('0x87')](function(_0x43feda){_0x5ed491(_0x43feda);})['catch'](function(_0x56f73b){_0x2bfaaf(_0x56f73b);});})[_0x5c31('0x7e')](function(_0x2356de){ut['logger']('[Preview][checkIsBlackList]',_0x2356de);_0x2bfaaf(ut[_0x5c31('0x4e')](_0x5c31('0x125'),_0x425256,_0x2a8011));});}else{_0x2bfaaf(ut[_0x5c31('0x4e')](_0x4bb296[_0x5c31('0x4e')],_0x425256,_0x2a8011));}})['catch'](function(_0x4c8e04){ut[_0x5c31('0x62')](_0x5c31('0x126'),_0x4c8e04);_0x2bfaaf(ut[_0x5c31('0x4e')](_0x5c31('0x125'),![],!![]));});});};Preview['prototype'][_0x5c31('0x127')]=function(_0xad3ec3){if(_[_0x5c31('0x6f')](_0xad3ec3)||_[_0x5c31('0x128')](_0xad3ec3)||!_[_0x5c31('0x6f')](_0xad3ec3[0x0][_0x5c31('0x129')])&&_[_0x5c31('0x6f')](_0xad3ec3[0x0]['Agent'][_0x5c31('0x29')])){ut[_0x5c31('0x62')](_0x5c31('0x12a'),_0xad3ec3);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x2e61d5=this['campaignsPreview'][_0xad3ec3[0x0][_0x5c31('0x72')][_0x5c31('0x29')]];_0x2e61d5['message']=_0x5c31('0x9b');if(_[_0x5c31('0x6f')](_0x2e61d5)){ut[_0x5c31('0x62')](_0x5c31('0x12b'),_0x2e61d5);return{'isValid':![],'message':_0x5c31('0x12c')};}if(!this['isTrunkReachable'](_0x2e61d5['Trunk'])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20work]',_0x5c31('0x12d')+_0x2e61d5['name']+_0x5c31('0x12e'));if(!this[_0x5c31('0x99')](_0x2e61d5[_0x5c31('0x9a')])){ut[_0x5c31('0x62')](_0x5c31('0x12f'),_0x2e61d5[_0x5c31('0x29')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0x5c31('0x130')};}}if(!ut['isActive'](_0x2e61d5[_0x5c31('0x6b')])){ut[_0x5c31('0x62')](_0x5c31('0x131'),_0x2e61d5[_0x5c31('0x29')]+_0x5c31('0x132'));return{'isValid':![],'message':_0x5c31('0x12d')+_0x2e61d5[_0x5c31('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0x5c31('0x133')};};Preview['prototype'][_0x5c31('0x111')]=function(_0x235572,_0x1b25a9,_0x3fb9f3,_0x4b17c4){var _0x5626f4=this;return new BPromise(function(_0x5c2e8c,_0x34c0a1){var _0x114119=_0x235572['uniqueid'];var _0x2d35aa=_0x5626f4[_0x5c31('0x99')](_0x1b25a9[_0x5c31('0x53')])?util[_0x5c31('0x5c')](_0x5c31('0x134'),_0x1b25a9[_0x5c31('0x53')]['name'],_['isNil'](_0x1b25a9[_0x5c31('0x38')])?'':_0x1b25a9['dialPrefix'][_0x5c31('0x135')]()||'',_0x1b25a9['dialCutDigit']>0x0?_0x3fb9f3[_0x5c31('0x10e')][_0x5c31('0x136')](_0x1b25a9[_0x5c31('0x137')]):_0x3fb9f3[_0x5c31('0x10e')]):util[_0x5c31('0x5c')]('SIP/%s/%s%s',_[_0x5c31('0x6f')](_0x1b25a9[_0x5c31('0x9a')])?_0x1b25a9['Trunk'][_0x5c31('0x29')]:_0x1b25a9['TrunkBackup']['name'],_[_0x5c31('0x6f')](_0x1b25a9[_0x5c31('0x38')])?'':_0x1b25a9[_0x5c31('0x38')][_0x5c31('0x135')]()||'',_0x1b25a9[_0x5c31('0x137')]>0x0?_0x3fb9f3['phone']['substring'](_0x1b25a9['dialCutDigit']):_0x3fb9f3[_0x5c31('0x10e')]);var _0x575e6e=_0x5626f4['isTrunkReachable'](_0x1b25a9['Trunk'])?ut['getCallerId'](_0x1b25a9[_0x5c31('0x53')][_0x5c31('0x55')],_0x1b25a9[_0x5c31('0x36')],_0x1b25a9['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x5c31('0x138')](_0x1b25a9[_0x5c31('0x37')],_0x1b25a9[_0x5c31('0x139')]):_0x1b25a9[_0x5c31('0x37')]):ut[_0x5c31('0x13a')](_[_0x5c31('0x6f')](_0x1b25a9[_0x5c31('0x9a')])?_0x1b25a9[_0x5c31('0x53')][_0x5c31('0x55')]:_0x1b25a9['TrunkBackup'][_0x5c31('0x55')],_0x1b25a9[_0x5c31('0x36')],_0x1b25a9[_0x5c31('0x139')]>0x0?ut['getCallerIdRandom'](_0x1b25a9[_0x5c31('0x37')],_0x1b25a9[_0x5c31('0x139')]):_0x1b25a9[_0x5c31('0x37')]);if(_0x575e6e){_0x235572['originatecalleridname']=ut['extractCalleridName'](_0x575e6e);_0x235572[_0x5c31('0x13b')]=ut[_0x5c31('0x13c')](_0x575e6e);}var _0x376434=ut[_0x5c31('0x13d')](_0x1b25a9,_0x3fb9f3,_0x2d35aa,_0x575e6e,_0x114119,_0x235572);_['merge'](_0x235572,ut[_0x5c31('0x13e')](_0x376434));_0x235572[_0x5c31('0x13f')]=moment()[_0x5c31('0x5c')](_0x5c31('0x8e'));ami[_0x5c31('0x7b')](ut[_0x5c31('0x140')](_0x235572,_0x1b25a9,_0x376434,_0x235572[_0x5c31('0xd2')],_0x4b17c4))[_0x5c31('0x87')](function(_0x2ac171){var _0x4ac995=_0x235572[_0x5c31('0x141')];if(!_[_0x5c31('0x6f')](_0x4ac995)){if(!_['isNil'](_0x5626f4['agents'][_0x4ac995])){_0x5626f4[_0x5c31('0x16')][_0x4ac995][_0x5c31('0x142')]=_0x235572[_0x5c31('0x143')];emit(util[_0x5c31('0x5c')](_0x5c31('0x144'),_0x5626f4[_0x5c31('0x16')][_0x4ac995]['name']),_0x5c31('0x145'),{'destaccountcode':_0x5626f4[_0x5c31('0x16')][_0x4ac995][_0x5c31('0x146')],'destconnectedlinenum':_0x235572['calleridnum']});}}_0x1b25a9[_0x5c31('0x4f')]+=0x1;logger[_0x5c31('0x5a')](_0x5c31('0x147'),_0x114119,_0x5c31('0xb7'),_0x1b25a9[_0x5c31('0x29')],_0x5c31('0x74'),_0x1b25a9[_0x5c31('0x4f')]);_0x5c2e8c(_0x2ac171);})['catch'](function(_0x8051a1){ut[_0x5c31('0x101')](_0x235572,0xe,_0x5c31('0x148'));rpcDb[_0x5c31('0xff')](_0x235572,_0x5c31('0x149'));_0x34c0a1(_0x8051a1);});});};Preview['prototype'][_0x5c31('0x20')]=function(_0x350873){if(this[_0x5c31('0x70')][_0x350873['linkedid']]){this['actions'][_0x350873[_0x5c31('0xc8')]][_0x5c31('0x7d')]=_0x350873[_0x5c31('0x7d')];}};Preview[_0x5c31('0x10')]['syncOriginateResponse']=function(_0x4558ed){var _0x9eeb5a=this;var _0x212298=this[_0x5c31('0x70')][_0x4558ed[_0x5c31('0x14a')]];if(_0x212298){if(_0x212298['lookAgent']&&this[_0x5c31('0x16')][_0x212298[_0x5c31('0x110')]]){ut[_0x5c31('0x14b')](_0x212298,this[_0x5c31('0x16')][_0x212298['lookAgent']]['name'],this[_0x5c31('0x16')][_0x212298[_0x5c31('0x110')]]['id']);}var _0x266955=_[_0x5c31('0x14c')](_0x212298);_0x266955[_0x5c31('0xb5')]=moment()['format'](_0x5c31('0x8e'));var _0x1ebddf=_0x9eeb5a[_0x5c31('0x13')][_0x212298[_0x5c31('0x73')]];if(ut[_0x5c31('0x14d')](_0x4558ed[_0x5c31('0x14e')])){if(_0x212298[_0x5c31('0xaf')]){rpcDb['unlockContact'](_0x212298[_0x5c31('0xb2')]);}if(_0x212298[_0x5c31('0xd2')]){rpcDb[_0x5c31('0x8d')](_0x212298['idContact']);}ami[_0x5c31('0xb8')](_0x5c31('0x14f'),ut['buildObj'](_0x212298,_0x5c31('0x150'),this[_0x5c31('0x13')][_0x212298[_0x5c31('0x73')]]));this[_0x5c31('0x151')](_0x266955,_0x1ebddf,_0x4558ed);}else{_0x212298[_0x5c31('0x13f')]=moment()[_0x5c31('0x5c')](_0x5c31('0x8e'));ut[_0x5c31('0x101')](_0x266955,0x4,_0x5c31('0xc2'));rpcDb[_0x5c31('0xff')](_0x266955,_0x5c31('0x152'));}}};Preview[_0x5c31('0x10')][_0x5c31('0x153')]=function(_0x53d5ce){var _0x51201a=this;var _0x4e5ab5=this[_0x5c31('0x70')][_0x53d5ce[_0x5c31('0xc8')]];var _0x21b5c5;if(_0x4e5ab5){_0x21b5c5=this['campaignsPreview'][_0x4e5ab5[_0x5c31('0x73')]];logger['info'](_0x5c31('0x154'),_0x53d5ce[_0x5c31('0xc8')],_0x5c31('0xb7'),_0x21b5c5[_0x5c31('0x29')],_0x5c31('0x75'),_0x21b5c5[_0x5c31('0x5e')]);}if(this[_0x5c31('0x70')][_0x53d5ce[_0x5c31('0xc8')]]&&_0x53d5ce[_0x5c31('0xc8')]!==_0x53d5ce[_0x5c31('0xc7')]){if(_0x53d5ce['cause']==='16'&&this[_0x5c31('0x70')][_0x53d5ce[_0x5c31('0xc8')]][_0x5c31('0x76')]){this[_0x5c31('0x9c')](_0x53d5ce,_0x53d5ce[_0x5c31('0xc8')],_0x53d5ce[_0x5c31('0x155')]);}else if(this['actions'][_0x53d5ce[_0x5c31('0xc8')]]['dialAnswer']){logger[_0x5c31('0x5a')](_0x5c31('0x156'),_0x53d5ce[_0x5c31('0xc8')],_0x53d5ce[_0x5c31('0x155')],_0x5c31('0xb7'),_0x21b5c5['name'],_0x5c31('0x75'),_0x21b5c5[_0x5c31('0x5e')]);this['callProgressDetectingCustomer'](_0x53d5ce,_0x53d5ce[_0x5c31('0xc8')],_0x53d5ce['cause']);}}else if(_0x4e5ab5&&_[_0x5c31('0x6f')](_0x4e5ab5[_0x5c31('0x157')])&&_0x21b5c5['dialQueueProject']&&_0x53d5ce[_0x5c31('0xc8')]===_0x53d5ce['uniqueid']&&_['isNil'](_0x53d5ce[_0x5c31('0xfe')])&&_0x53d5ce[_0x5c31('0x155')]==='16'&&_0x53d5ce[_0x5c31('0x158')]==='6'&&_[_0x5c31('0x159')](_0x4e5ab5['transfer'])){if(_0x4e5ab5['unlockAgent']){rpcDb[_0x5c31('0x121')](_0x4e5ab5[_0x5c31('0xb2')]);}if(_0x4e5ab5['activeContact']){rpcDb[_0x5c31('0x8d')](_0x4e5ab5['idContact']);}_0x53d5ce[_0x5c31('0xfe')]='22';this[_0x5c31('0x151')](_0x4e5ab5,_0x21b5c5,_0x53d5ce);}else if(_0x4e5ab5&&_0x4e5ab5[_0x5c31('0x15a')]){if(_0x53d5ce[_0x5c31('0x155')]==='16'&&this[_0x5c31('0x70')][_0x53d5ce[_0x5c31('0xc8')]][_0x5c31('0x76')]){logger['info'](_0x5c31('0x15b'),_0x53d5ce[_0x5c31('0xc8')],_0x53d5ce[_0x5c31('0x155')],_0x5c31('0xb7'),_0x21b5c5['name'],_0x5c31('0x75'),_0x21b5c5[_0x5c31('0x5e')]);this[_0x5c31('0x9c')](_0x53d5ce,_0x53d5ce[_0x5c31('0xc8')],_0x53d5ce[_0x5c31('0x155')]);}else if(this[_0x5c31('0x70')][_0x53d5ce['linkedid']]['dialAnswer']){logger[_0x5c31('0x5a')]('[syncHangup][talking][cause]',_0x53d5ce[_0x5c31('0xc8')],_0x53d5ce[_0x5c31('0x155')],_0x5c31('0xb7'),_0x21b5c5[_0x5c31('0x29')],'pTalking:\x20',_0x21b5c5['pTalking']);this['callProgressDetectingCustomer'](_0x53d5ce,_0x53d5ce[_0x5c31('0xc8')],_0x53d5ce[_0x5c31('0x155')]);}}};Preview[_0x5c31('0x10')]['syncDialEnd']=function(_0x1120a0){if(this[_0x5c31('0x70')][_0x1120a0['destlinkedid']]&&_0x1120a0[_0x5c31('0xfc')]!==_0x1120a0['destuniqueid']){this[_0x5c31('0x9c')](_0x1120a0,_0x1120a0[_0x5c31('0xfc')],_0x1120a0[_0x5c31('0xf2')]);}};Preview[_0x5c31('0x10')][_0x5c31('0x1d')]=function(_0x461cef){if(this[_0x5c31('0x70')][_0x461cef['linkedid']]&&_0x461cef[_0x5c31('0xc8')]!==_0x461cef['uniqueid']&&!this[_0x5c31('0x70')][_0x461cef[_0x5c31('0xc8')]][_0x5c31('0x76')]){if(_0x461cef[_0x5c31('0x155')]==='1'){this[_0x5c31('0x9c')](_0x461cef,_0x461cef[_0x5c31('0xc8')],_0x461cef[_0x5c31('0x155')]);}}};Preview[_0x5c31('0x10')]['addVariable']=function(_0x3665a5,_0x4a1be0,_0x519a26){if(this[_0x5c31('0x70')][_0x3665a5]){if(_[_0x5c31('0x6f')](this[_0x5c31('0x70')][_0x3665a5]['variables'])){this[_0x5c31('0x70')][_0x3665a5]['variables']={};}this['actions'][_0x3665a5]['variables'][_0x4a1be0]=_0x519a26;}};Preview[_0x5c31('0x10')][_0x5c31('0x22')]=function(_0x45bf8a){try{if(!_[_0x5c31('0x6f')](_0x45bf8a)){if(ut[_0x5c31('0x15c')](_[_0x5c31('0x15d')](_0x45bf8a[_0x5c31('0x15e')])[0x0])){this[_0x5c31('0x15f')](_0x45bf8a[_0x5c31('0xc7')],_[_0x5c31('0x15d')](_0x45bf8a[_0x5c31('0x15e')])[0x0],_0x45bf8a['value']);}}}catch(_0x5385e1){logger['error']('[syncVarSet][Preview]',util['inspect'](_0x5385e1,{'showHidden':![],'depth':null}));}};Preview[_0x5c31('0x10')][_0x5c31('0x24')]=function(_0x3eb6ba){if(_0x3eb6ba){if(this[_0x5c31('0x70')][_0x3eb6ba[_0x5c31('0x160')]]){this[_0x5c31('0x70')][_0x3eb6ba[_0x5c31('0x160')]][_0x5c31('0x15a')]=!![];}}};Preview['prototype'][_0x5c31('0x25')]=function(_0x5ad199){if(_0x5ad199){if(this[_0x5c31('0x70')][_0x5ad199[_0x5c31('0x161')]]){this[_0x5c31('0x70')][_0x5ad199[_0x5c31('0x161')]][_0x5c31('0x15a')]=!![];}}};module['exports']=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index c5be0d8..eb93c69 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 _0x0392=['preview','lodash','../rpc/cmHopperFinal','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','[unlockContact]\x20','disableContact','unlockContact','[activeContact]\x20','crateCustomerReportQueue','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger'];(function(_0x30e874,_0x728fa0){var _0x1ebbc1=function(_0xbe3020){while(--_0xbe3020){_0x30e874['push'](_0x30e874['shift']());}};_0x1ebbc1(++_0x728fa0);}(_0x0392,0x124));var _0x2039=function(_0x2eea9a,_0x368daf){_0x2eea9a=_0x2eea9a-0x0;var _0x1ec61e=_0x0392[_0x2eea9a];return _0x1ec61e;};'use strict';var util=require(_0x2039('0x0'));var BPromise=require(_0x2039('0x1'));var logger=require(_0x2039('0x2'))(_0x2039('0x3'));var _=require(_0x2039('0x4'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0x2039('0x5'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x2039('0x6'));var voiceQueueRt=require(_0x2039('0x7'));var agentReportPreview=require(_0x2039('0x8'));var voiceQueueReport=require(_0x2039('0x9'));function loggerCatch(_0x2c9fe4){return function(_0x42d6ea){logger[_0x2039('0xa')](_0x2c9fe4,util[_0x2039('0xb')](_0x42d6ea,{'showHidden':![],'depth':null}));};}function create(_0x3721a9){return BPromise[_0x2039('0xc')]()[_0x2039('0xd')](cmHopperHistory[_0x2039('0xe')](_0x3721a9))[_0x2039('0xf')](loggerCatch(_0x2039('0x10')));}function createAgent(_0x303017){return BPromise[_0x2039('0xc')]()[_0x2039('0xd')](agentReportPreview['createHistory'](_0x303017))[_0x2039('0xf')](loggerCatch(_0x2039('0x10')));}function moveContact(_0x24db70){return BPromise[_0x2039('0xc')]()[_0x2039('0xd')](cmHopper[_0x2039('0x11')](_0x24db70,!![]))[_0x2039('0xf')](loggerCatch(_0x2039('0x12')));}exports[_0x2039('0x13')]=function(_0x50fe65){return BPromise[_0x2039('0xc')]()[_0x2039('0xd')](cmHopperBlack[_0x2039('0x13')](_0x50fe65))[_0x2039('0xf')](loggerCatch(_0x2039('0x14')));};exports[_0x2039('0x15')]=function(_0x50c7f0){return BPromise['resolve']()[_0x2039('0xd')](cmHopper[_0x2039('0x15')](_0x50c7f0))['catch'](loggerCatch(_0x2039('0x16')));};exports[_0x2039('0xe')]=function(_0x3d8c72,_0x2447fa){create(_0x3d8c72)[_0x2039('0xf')](loggerCatch(_0x2447fa));moveContact(_0x3d8c72)[_0x2039('0xf')](loggerCatch(_0x2447fa));};exports[_0x2039('0x17')]=function(_0x2df4b1,_0x34e824){createAgent(_0x2df4b1)['catch'](loggerCatch(_0x34e824));};exports[_0x2039('0x18')]=function(_0x90f565,_0x4c84c0){create(_0x90f565)['catch'](loggerCatch(_0x4c84c0));};exports['createCustomerFinal']=function(_0x3e1252,_0x3193fb){moveContact(_0x3e1252)[_0x2039('0xf')](loggerCatch(_0x3193fb));};exports[_0x2039('0x19')]=function(_0x4fbced,_0x53afac,_0x733916){if(_0x53afac){_0x4fbced[_0x2039('0x1a')]=null;}if(_0x733916){_0x4fbced[_0x2039('0x1b')]=![];}return BPromise[_0x2039('0xc')]()[_0x2039('0xd')](cmHopper[_0x2039('0x19')](_0x4fbced))[_0x2039('0xf')](loggerCatch(_0x2039('0x1c')));};exports[_0x2039('0x1d')]=function(_0x2bd6e3){return BPromise[_0x2039('0xc')]()[_0x2039('0xd')](cmHopper[_0x2039('0x1d')](_0x2bd6e3))[_0x2039('0xf')](loggerCatch(_0x2039('0x1e')));};exports['unlockContact']=function(_0x35b8ef){return BPromise[_0x2039('0xc')]()[_0x2039('0xd')](cmHopper['unlockContact']({'UserId':null},_0x35b8ef,0x1))[_0x2039('0xf')](loggerCatch(_0x2039('0x1f')));};exports[_0x2039('0x20')]=function(_0x49a6a3){return BPromise[_0x2039('0xc')]()[_0x2039('0xd')](cmHopper[_0x2039('0x21')]({'active':![]},_0x49a6a3,0x1))[_0x2039('0xf')](loggerCatch(_0x2039('0x22')));};exports[_0x2039('0x23')]=function(_0xfd212f){var _0xa102f3={};_0xa102f3['type']=_0xfd212f['type'];_0xa102f3['uniqueid']=_0xfd212f['uniqueid'];_0xa102f3[_0x2039('0x24')]=_0xfd212f[_0x2039('0x24')];_0xa102f3[_0x2039('0x25')]=_0xfd212f[_0x2039('0x25')];_0xa102f3['queue']=_0xfd212f[_0x2039('0x26')];_0xa102f3[_0x2039('0x27')]=_0xfd212f[_0x2039('0x28')];_0xa102f3['queuecallerleaveAt']=_0xfd212f[_0x2039('0x28')];_0xa102f3[_0x2039('0x29')]=0x1;_0xa102f3[_0x2039('0x2a')]=_0xfd212f['endtime'];_0xa102f3[_0x2039('0x2b')]=_0xfd212f[_0x2039('0x2c')];_0xa102f3[_0x2039('0x2d')]=_0x2039('0x2e');_0xa102f3[_0x2039('0x2f')]=_0x2039('0x30');_0xa102f3[_0x2039('0x31')]=0x0;_0xa102f3[_0x2039('0x32')]=0x1;_0xa102f3['lastAssignedTo']=_0xfd212f[_0x2039('0x2c')];_0xa102f3[_0x2039('0x33')]=_0x2039('0x34');return BPromise[_0x2039('0xc')]()['then'](voiceQueueReport[_0x2039('0x35')](_0xa102f3))['catch'](loggerCatch(_0x2039('0x36')));};exports[_0x2039('0x37')]=function(_0x385cbb,_0x176070){return BPromise[_0x2039('0xc')]()[_0x2039('0xd')](cmHopper[_0x2039('0x37')](_0x385cbb,_0x176070))[_0x2039('0xf')](loggerCatch(_0x2039('0x38')));};exports[_0x2039('0x39')]=function(_0x590e6e){return BPromise[_0x2039('0xc')]()[_0x2039('0xd')](cmHopper[_0x2039('0x19')](_0x590e6e,!![],!![]))[_0x2039('0xf')](loggerCatch(_0x2039('0x3a')));}; \ No newline at end of file +var _0x74f9=['then','createHistory','[createHistory]\x20','catch','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','active','countReScheduled','unlockContact','[unlockContact]\x20','[activeContact]\x20','type','uniqueid','calleridnum','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','COMPLETED','create','rescheduleContactInQueue','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve'];(function(_0x45dafe,_0x9ff797){var _0x5e7f7e=function(_0x1b6d36){while(--_0x1b6d36){_0x45dafe['push'](_0x45dafe['shift']());}};_0x5e7f7e(++_0x9ff797);}(_0x74f9,0x80));var _0x974f=function(_0xa1b74d,_0x614e6f){_0xa1b74d=_0xa1b74d-0x0;var _0x56bad4=_0x74f9[_0xa1b74d];return _0x56bad4;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0x974f('0x0'))(_0x974f('0x1'));var _=require(_0x974f('0x2'));var cmHopper=require(_0x974f('0x3'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x974f('0x4'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0x974f('0x5'));var voiceQueueReport=require(_0x974f('0x6'));function loggerCatch(_0x3bc884){return function(_0x4e5ca8){logger[_0x974f('0x7')](_0x3bc884,util[_0x974f('0x8')](_0x4e5ca8,{'showHidden':![],'depth':null}));};}function create(_0x2a6528){return BPromise[_0x974f('0x9')]()[_0x974f('0xa')](cmHopperHistory[_0x974f('0xb')](_0x2a6528))['catch'](loggerCatch(_0x974f('0xc')));}function createAgent(_0x517d5){return BPromise[_0x974f('0x9')]()[_0x974f('0xa')](agentReportPreview[_0x974f('0xb')](_0x517d5))[_0x974f('0xd')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x555730){return BPromise['resolve']()[_0x974f('0xa')](cmHopper[_0x974f('0xe')](_0x555730,!![]))[_0x974f('0xd')](loggerCatch(_0x974f('0xf')));}exports[_0x974f('0x10')]=function(_0x5553fa){return BPromise[_0x974f('0x9')]()['then'](cmHopperBlack[_0x974f('0x10')](_0x5553fa))[_0x974f('0xd')](loggerCatch(_0x974f('0x11')));};exports[_0x974f('0x12')]=function(_0xee2661){return BPromise['resolve']()[_0x974f('0xa')](cmHopper[_0x974f('0x12')](_0xee2661))['catch'](loggerCatch(_0x974f('0x13')));};exports[_0x974f('0xb')]=function(_0x15f0df,_0x909e3a){create(_0x15f0df)[_0x974f('0xd')](loggerCatch(_0x909e3a));moveContact(_0x15f0df)[_0x974f('0xd')](loggerCatch(_0x909e3a));};exports[_0x974f('0x14')]=function(_0x455bff,_0x3bb53e){createAgent(_0x455bff)[_0x974f('0xd')](loggerCatch(_0x3bb53e));};exports[_0x974f('0x15')]=function(_0x3af566,_0x255f9d){create(_0x3af566)[_0x974f('0xd')](loggerCatch(_0x255f9d));};exports['createCustomerFinal']=function(_0x2ab0cc,_0x2b1bd9){moveContact(_0x2ab0cc)[_0x974f('0xd')](loggerCatch(_0x2b1bd9));};exports['rescheduleContact']=function(_0x17107c,_0x359ee0,_0x5361cd){if(_0x359ee0){_0x17107c['UserId']=null;}if(_0x5361cd){_0x17107c[_0x974f('0x16')]=![];}return BPromise[_0x974f('0x9')]()[_0x974f('0xa')](cmHopper['rescheduleContact'](_0x17107c))[_0x974f('0xd')](loggerCatch('[rescheduleContact]\x20'));};exports[_0x974f('0x17')]=function(_0x4ba6a8){return BPromise['resolve']()[_0x974f('0xa')](cmHopper[_0x974f('0x17')](_0x4ba6a8))[_0x974f('0xd')](loggerCatch('[countReScheduled]\x20'));};exports[_0x974f('0x18')]=function(_0x3be902){return BPromise[_0x974f('0x9')]()[_0x974f('0xa')](cmHopper[_0x974f('0x18')]({'UserId':null},_0x3be902,0x1))[_0x974f('0xd')](loggerCatch(_0x974f('0x19')));};exports['disableContact']=function(_0x70a106){return BPromise[_0x974f('0x9')]()[_0x974f('0xa')](cmHopper[_0x974f('0x18')]({'active':![]},_0x70a106,0x1))[_0x974f('0xd')](loggerCatch(_0x974f('0x1a')));};exports['crateCustomerReportQueue']=function(_0x11012e){var _0x27736e={};_0x27736e[_0x974f('0x1b')]=_0x11012e['type'];_0x27736e[_0x974f('0x1c')]=_0x11012e[_0x974f('0x1c')];_0x27736e[_0x974f('0x1d')]=_0x11012e[_0x974f('0x1d')];_0x27736e['calleridname']=_0x11012e['calleridname'];_0x27736e[_0x974f('0x1e')]=_0x11012e[_0x974f('0x1e')];_0x27736e[_0x974f('0x1f')]=_0x11012e[_0x974f('0x20')];_0x27736e[_0x974f('0x21')]=_0x11012e[_0x974f('0x20')];_0x27736e[_0x974f('0x22')]=0x1;_0x27736e[_0x974f('0x23')]=_0x11012e['endtime'];_0x27736e[_0x974f('0x24')]=_0x11012e[_0x974f('0x25')];_0x27736e[_0x974f('0x26')]=_0x974f('0x27');_0x27736e[_0x974f('0x28')]=_0x974f('0x29');_0x27736e[_0x974f('0x2a')]=0x0;_0x27736e['assigned']=0x1;_0x27736e['lastAssignedTo']=_0x11012e['membername'];_0x27736e['queuecallerexitreason']=_0x974f('0x2b');return BPromise['resolve']()[_0x974f('0xa')](voiceQueueReport[_0x974f('0x2c')](_0x27736e))['catch'](loggerCatch('[voiceQueueReport]\x20'));};exports['getContactRecallMe']=function(_0x21fbad,_0x486338){return BPromise[_0x974f('0x9')]()[_0x974f('0xa')](cmHopper['getContactRecallMe'](_0x21fbad,_0x486338))[_0x974f('0xd')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0x974f('0x2d')]=function(_0x2e6218){return BPromise[_0x974f('0x9')]()[_0x974f('0xa')](cmHopper['rescheduleContact'](_0x2e6218,!![],!![]))['catch'](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index d262517..eb7ddff 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 _0x0849=['rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','match','extractCalleridNumber','util','moment','../../../../config/logger','env','127.0.0.1','milliseconds','seconds','inspect','info','loggerError','error','logger2','message','getCallerId','string','isEmpty','isUndefined','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','monitor_format','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','ringtime','logLookAgent','membername','UserId','logCustomer','talktime','Failure','RECALL','BOOKED','uniqueid','channelAgent','from-sip','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','cloneAction','clone','scheduledAt','active','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','queue','interface','mandatoryDisposition','buildAcw','agentReadyId','not_inuse','push','getDiff','diff','CampaignId','idContact','type','campaigntype','dialAnswer','callbackat','recallme','sipcallid','xmd-phone','xmd-dialurl','xmd-dialtimeout','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agi'];(function(_0x5cb723,_0x19cfff){var _0x421929=function(_0x27ce2f){while(--_0x27ce2f){_0x5cb723['push'](_0x5cb723['shift']());}};_0x421929(++_0x19cfff);}(_0x0849,0x1a3));var _0x9084=function(_0x87eff8,_0x17ee9a){_0x87eff8=_0x87eff8-0x0;var _0x585883=_0x0849[_0x87eff8];return _0x585883;};'use strict';var util=require(_0x9084('0x0'));var _=require('lodash');var moment=require(_0x9084('0x1'));var logger=require(_0x9084('0x2'))('preview');var ipAgi=process[_0x9084('0x3')]['XCALLY_IP_AGI']||_0x9084('0x4');function getSeconds(_0x325f79,_0x116db4){var _0x5baf6a=moment(_0x325f79)[_0x9084('0x5')](0x0);var _0x1b657d=moment(_0x116db4)[_0x9084('0x5')](0x0);return _0x5baf6a['diff'](_0x1b657d,_0x9084('0x6'));}exports['loggerCatch']=function(_0x22783b){return function(_0x257709){logger['error'](_0x22783b,util[_0x9084('0x7')](_0x257709,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x47a281,_0x19a97a){logger[_0x9084('0x8')](_0x47a281,util[_0x9084('0x7')](_0x19a97a,{'showHidden':![],'depth':null}));};exports[_0x9084('0x9')]=function(_0x5d17d8,_0x2e808f){logger[_0x9084('0xa')](_0x5d17d8,util[_0x9084('0x7')](_0x2e808f,{'showHidden':![],'depth':null}));};exports[_0x9084('0xb')]=function(_0x5198a6){return function(_0x5b2395){logger[_0x9084('0x8')](_0x5198a6,util[_0x9084('0x7')](_0x5b2395,{'showHidden':![],'depth':null}));};};exports[_0x9084('0xc')]=function(_0x46c08a,_0x27b2cc,_0x4cbb57){return{'message':_0x46c08a,'unlock':_0x27b2cc,'active':_0x4cbb57};};exports[_0x9084('0xd')]=function(_0x80b54,_0x2ecb0f,_0x6181ff){if(!_['isUndefined'](_0x6181ff)&&_0x9084('0xe')===typeof _0x6181ff&&!_[_0x9084('0xf')](_0x6181ff)){if(!_[_0x9084('0x10')](_0x2ecb0f)&&_0x9084('0xe')===typeof _0x2ecb0f&&!_[_0x9084('0xf')](_0x2ecb0f)){return util[_0x9084('0x11')](_0x9084('0x12'),_0x2ecb0f,_0x6181ff);}return util[_0x9084('0x11')](_0x9084('0x12'),_0x6181ff,_0x6181ff);}if(!_[_0x9084('0x10')](_0x80b54)&&'string'===typeof _0x80b54&&!_[_0x9084('0xf')](_0x80b54)){return _0x80b54;}return _0x9084('0x13');};exports['isActive']=function(_0x1058e4){if(_[_0x9084('0x14')](_0x1058e4)){return![];}return _0x1058e4;};exports[_0x9084('0x15')]=function(_0x50dd4c,_0x2410cb,_0x4199cb,_0xee7863,_0x49e1dd,_0x374472){var _0x1db882={'XMD-QUEUE':_0x2410cb[_0x9084('0x16')]?_0x2410cb[_0x9084('0x16')][_0x9084('0x17')]:'','XMD-CALLERID':_0xee7863,'XMD-CALLERID-PREVIEW':_0x374472?util[_0x9084('0x11')](_0x9084('0x12'),_0x374472[_0x9084('0x18')],_0x374472[_0x9084('0x19')]):_0xee7863,'XMD-DIALID':_0x49e1dd,'XMD-CONTACTID':_0x2410cb[_0x9084('0x1a')],'XMD-CDRTYPE':_0x9084('0x1b'),'CALLERID(all)':_0xee7863,'XMD-VOICEQUEUEID':_0x2410cb[_0x9084('0x1c')],'XMD-DIALCHANNEL':_0x4199cb,'XMD-DIALTIMEOUT':_0x50dd4c[_0x9084('0x1d')]||0x1e,'XMD-DIALOPTIONS':util[_0x9084('0x11')]('\x22rtTxX%s%s\x22',_0x50dd4c[_0x9084('0x1e')]?'g':'',_['isEmpty'](_0x50dd4c[_0x9084('0x1f')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x50dd4c['dialPreviewUrl']||'','XMD-AGI':_0x50dd4c[_0x9084('0x20')]?util[_0x9084('0x11')](_0x9084('0x21'),ipAgi,_0x50dd4c[_0x9084('0x20')]):'NONE','XMD-AGIAFTER':_0x50dd4c[_0x9084('0x1e')]?util[_0x9084('0x11')](_0x9084('0x21'),ipAgi,_0x50dd4c[_0x9084('0x1e')]):_0x9084('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x374472?_0x374472[_0x9084('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x374472?_0x374472[_0x9084('0x24')]:'','XMD-DESTINATION':_0x9084('0x25')};if(!_['isEmpty'](_0x50dd4c[_0x9084('0x1f')])){_0x1db882[util['format']('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x50dd4c['monitor_format'];_0x1db882[util[_0x9084('0x11')]('%s',_0x9084('0x26'))]=_0x49e1dd;}if(_0x2410cb&&_0x2410cb['Contact']){for(var _0x3bc505 in _0x2410cb[_0x9084('0x27')]){if(_0x2410cb[_0x9084('0x27')][_0x9084('0x28')](_0x3bc505)){if(!_['isNil'](_0x2410cb['Contact'][_0x3bc505])&&_0x3bc505!=='id'&&_0x3bc505!==_0x9084('0x29')&&_0x3bc505!==_0x9084('0x2a')&&_0x3bc505!==_0x9084('0x2b')){_0x1db882[util[_0x9084('0x11')](_0x9084('0x2c'),_0x9084('0x2d'),_[_0x9084('0x2e')](_0x3bc505))]=_0x2410cb[_0x9084('0x27')][_0x3bc505];}}}}return _0x1db882;};exports[_0x9084('0x2f')]=function(_0x386e41){var _0x5b146d={};for(var _0x2223f1 in _0x386e41){if(_0x386e41[_0x9084('0x28')](_0x2223f1)){_0x5b146d[util[_0x9084('0x11')]('%s',_['toLower'](_0x2223f1))]=_0x386e41[_0x2223f1];}}return{'variables':_0x5b146d};};exports[_0x9084('0x30')]=function(_0x2b0c34,_0x4d8c9e){if(!_[_0x9084('0x14')](_0x2b0c34)){if(_0x2b0c34[_0x9084('0x28')](_0x9084('0x31'))){if(_0x2b0c34[_0x9084('0x31')]>0x0){_0x2b0c34['originated']-=0x1;}else{logger[_0x9084('0xa')](_0x9084('0x32'),_0x4d8c9e);}}}else{logger[_0x9084('0xa')](_0x9084('0x33'),_0x4d8c9e);}};exports[_0x9084('0x34')]=function(_0x3cdb43){var _0x29bd26=moment()[_0x9084('0x11')](_0x9084('0x35'));_0x3cdb43[_0x9084('0x36')]=0xd;_0x3cdb43[_0x9084('0x37')]=_0x9084('0x38');_0x3cdb43[_0x9084('0x39')]=_0x29bd26;_0x3cdb43[_0x9084('0x3a')]=_0x29bd26;_0x3cdb43[_0x9084('0x3b')]=_0x29bd26;};exports['logAgent']=function(_0x50886e,_0x253421,_0x439173){var _0x1bd59e=moment()[_0x9084('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x50886e['state']=_0x253421;_0x50886e[_0x9084('0x37')]=_0x439173;_0x50886e[_0x9084('0x3a')]=_0x1bd59e;_0x50886e[_0x9084('0x3c')]=getSeconds(_0x50886e[_0x9084('0x3a')],_0x50886e['starttime']);};exports[_0x9084('0x3d')]=function(_0x404a28,_0x246184,_0x29b267){_0x404a28[_0x9084('0x3e')]=_0x246184;_0x404a28[_0x9084('0x3f')]=_0x29b267;};exports[_0x9084('0x40')]=function(_0x5931f5,_0x42c625,_0x272da4){var _0x5188ed=moment()[_0x9084('0x11')](_0x9084('0x35'));_0x5931f5[_0x9084('0x36')]=_0x42c625;_0x5931f5[_0x9084('0x37')]=_0x272da4;_0x5931f5['responsetime']=_0x5931f5['responsetime']?_0x5931f5[_0x9084('0x3a')]:_0x5188ed;_0x5931f5[_0x9084('0x3b')]=_0x5931f5[_0x9084('0x3b')]?_0x5931f5['endtime']:_0x5188ed;_0x5931f5['ringtime']=getSeconds(_0x5931f5[_0x9084('0x3a')]||0x0,_0x5931f5[_0x9084('0x39')]||0x0);_0x5931f5[_0x9084('0x41')]=_0x5931f5['answertime']?getSeconds(_0x5931f5[_0x9084('0x3b')],_0x5931f5['answertime']):0x0;};exports['isFailure']=function(_0x3f4162){return _0x3f4162===_0x9084('0x42');};exports['variablesAction']=function(_0x21aade,_0x5e62bd,_0xa7bce7,_0x5a9b7b,_0xfa2931){var _0x4adf23=_0x5a9b7b?_0x9084('0x43'):_0x21aade[_0x9084('0x18')];_0x4adf23=_0xfa2931?_0x9084('0x44'):_0x4adf23;return{'actionid':_0x21aade[_0x9084('0x45')],'action':'originate','channel':_0x21aade[_0x9084('0x46')],'callerid':util[_0x9084('0x11')]('\x22%s\x22\x20<%s>',_0x4adf23,_0x21aade[_0x9084('0x19')]),'Exten':_0x9084('0x25'),'Context':_0x9084('0x47'),'Priority':'1','variable':_0xa7bce7,'timeout':(_0x5e62bd['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x21aade['uniqueid']};};exports[_0x9084('0x48')]=function(_0x1a8c01){return _0x1a8c01[_0x9084('0x49')]+_0x1a8c01[_0x9084('0x4a')]+_0x1a8c01[_0x9084('0x4b')]+_0x1a8c01[_0x9084('0x4c')]+_0x1a8c01['countnosuchnumberretry'];};exports[_0x9084('0x4d')]=function(_0x234f89){var _0x284894=_[_0x9084('0x4e')](_0x234f89);_0x284894[_0x9084('0x36')]=0xf;_0x284894[_0x9084('0x37')]='Global';return _0x284894;};exports[_0x9084('0x4f')]=function(_0x18ef0f,_0xe64342,_0x4d7711){var _0x10e278={};_0x10e278[_0xe64342]=_0x18ef0f[_0xe64342];_0x10e278[_0x9084('0x50')]=![];_0x10e278['scheduledat']=moment()[_0x9084('0x51')](_0x4d7711,_0x9084('0x52'))['format']('YYYY-MM-DD\x20HH:mm:ss');_0x10e278[_0x9084('0x1a')]=_0x18ef0f[_0x9084('0x1a')];_0x10e278[_0x9084('0x53')]=_0x18ef0f[_0x9084('0x53')];_0x10e278['VoiceQueueId']=_0x18ef0f[_0x9084('0x1c')]||undefined;return _0x10e278;};exports[_0x9084('0x54')]=function(_0x4f1de1,_0x49b1c0){if(!_[_0x9084('0x14')](_0x4f1de1)){if(_0x4f1de1[_0x9084('0x55')]>0x0){_0x4f1de1['pTalking']-=0x1;}else{logger[_0x9084('0xa')](_0x49b1c0,_0x9084('0x56'));}}else{logger['error'](_0x49b1c0,_0x9084('0x57'));}};exports[_0x9084('0x58')]=function(_0x4cff00){if(_0x4cff00<=0x0){return!![];}return![];};exports[_0x9084('0x59')]=function(_0x4dc1a1,_0x423469,_0x141840){_0x4dc1a1[_0x9084('0x5a')]=_0x423469;_0x4dc1a1['name']=_0x4dc1a1[_0x9084('0x5b')];_0x4dc1a1[_0x9084('0x5c')]=_0x4dc1a1[_0x9084('0x46')];if(_0x141840){_0x4dc1a1[_0x9084('0x5d')]=_0x141840[_0x9084('0x5d')];}return _0x4dc1a1;};exports[_0x9084('0x5e')]=function(_0x5ddc35){var _0xb3cf03={};_0xb3cf03[_0x9084('0x5b')]=_0x5ddc35[_0x9084('0x5b')];_0xb3cf03[_0x9084('0x5c')]=_0x5ddc35['channelAgent'];_0xb3cf03['uniqueid']=_0x5ddc35[_0x9084('0x45')];return _0xb3cf03;};exports[_0x9084('0x5f')]=function(_0x3662ad){var _0x504d09=[];for(var _0x2a2621 in _0x3662ad){if(_0x3662ad[_0x9084('0x28')](_0x2a2621)){if(!_['isNil'](_0x3662ad[_0x2a2621])&&_0x3662ad[_0x2a2621][_0x9084('0x36')]===_0x9084('0x60')&&_0x3662ad[_0x2a2621]['status']==='reachable'){_0x504d09[_0x9084('0x61')](_0x3662ad[_0x2a2621]['id']);}}}return _0x504d09;};exports[_0x9084('0x62')]=function(_0x4efbce){var _0xdf2f63=moment()[_0x9084('0x5')](0x0);var _0x43b921=moment(_0x4efbce)[_0x9084('0x5')](0x0);return _0xdf2f63[_0x9084('0x63')](_0x43b921,'seconds');};exports['createBody']=function(_0x257296){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x257296['ContactId'],'ListId':_0x257296[_0x9084('0x53')],'VoiceQueueId':_0x257296[_0x9084('0x1c')]||undefined,'CampaignId':_0x257296[_0x9084('0x64')]||undefined};};exports['filterKey']=function(_0x870237){if(_0x870237===_0x9084('0x45')||_0x870237===_0x9084('0x65')||_0x870237===_0x9084('0x5b')||_0x870237===_0x9084('0x66')||_0x870237===_0x9084('0x67')||_0x870237===_0x9084('0x68')||_0x870237===_0x9084('0x3e')||_0x870237===_0x9084('0x46')||_0x870237==='calleridname'||_0x870237==='active'||_0x870237===_0x9084('0x19')||_0x870237==='scheduledat'||_0x870237===_0x9084('0x49')||_0x870237===_0x9084('0x4a')||_0x870237==='countnoanswerretry'||_0x870237==='countglobal'||_0x870237==='callback'||_0x870237==='callbackuniqueid'||_0x870237===_0x9084('0x69')||_0x870237===_0x9084('0x6a')||_0x870237==='ContactId'||_0x870237==='ListId'||_0x870237===_0x9084('0x3f')||_0x870237===_0x9084('0x1c')||_0x870237===_0x9084('0x6b')||_0x870237==='xmd-voicequeueid'||_0x870237==='xmd-queue'||_0x870237===_0x9084('0x6c')||_0x870237==='xmd-listid'||_0x870237===_0x9084('0x6d')||_0x870237===_0x9084('0x6e')||_0x870237==='xmd-dialoptions'||_0x870237===_0x9084('0x6f')||_0x870237===_0x9084('0x70')||_0x870237===_0x9084('0x71')||_0x870237===_0x9084('0x72')||_0x870237===_0x9084('0x73')||_0x870237==='xmd-agiafter'||_0x870237===_0x9084('0x74')||_0x870237===_0x9084('0x75')||_0x870237===_0x9084('0x76')||_0x870237===_0x9084('0x77')||_0x870237===_0x9084('0x78')||_0x870237===_0x9084('0x79')||_0x870237===_0x9084('0x7a')||_0x870237===_0x9084('0x7b')||_0x870237===_0x9084('0x7c')||_0x870237===_0x9084('0x75')||_0x870237===_0x9084('0x76')||_0x870237===_0x9084('0x77')||_0x870237===_0x9084('0x78')||_0x870237==='rtpaudioqosloss'||_0x870237===_0x9084('0x7a')||_0x870237==='rtpaudioqosrtt'||_0x870237===_0x9084('0x7c')||_0x870237===_0x9084('0x7d')||_0x870237===_0x9084('0x7e')||_0x870237===_0x9084('0x36')||_0x870237===_0x9084('0x37')){return![];}return!![];};exports[_0x9084('0x7f')]=function(_0x22f640,_0x279ed){var _0x6f75bb,_0x3f31ac,_0xc062a0;if(_0x279ed<=0x0){_0x279ed=0x1;}_0x6f75bb=new RegExp(_0x9084('0x80')+_0x279ed+'}$');_0x3f31ac=Math[_0x9084('0x81')](0xa,_0x279ed-0x1);_0xc062a0=Math[_0x9084('0x81')](0xa,_0x279ed)-0x1;return util[_0x9084('0x11')]('%s',_[_0x9084('0x82')](_0x22f640,_0x6f75bb,_[_0x9084('0x83')](_0x3f31ac,_0xc062a0)));};exports['extractCalleridName']=function(_0x1b03ec){var _0x1c588f=_0x1b03ec[_0x9084('0x84')](/"(.*?)"/);return _0x1c588f?_0x1c588f[0x1]:_0x1b03ec;};exports[_0x9084('0x85')]=function(_0x2d5353){var _0x1c37f6=_0x2d5353['match'](/<(.*?)>/);return _0x1c37f6?_0x1c37f6[0x1]:_0x2d5353;}; \ No newline at end of file +var _0x3a39=['callbackat','recallme','xmd-queue','xmd-phone','xmd-listid','xmd-dialoptions','xmd-contactid','xmd-cdrtype','xmd-callerid','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','bridgepeer','bridgepvtcallid','pow','replace','extractCalleridName','match','extractCalleridNumber','lodash','moment','env','XCALLY_IP_AGI','milliseconds','seconds','loggerCatch','inspect','logger','info','loggerError','error','logger2','message','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','isActive','addVariables','Queue','name','calleridname','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','monitor_format','_XCALLY_MIXMONITOR_FORMAT','Contact','isNil','tags','updatedAt','%s%s','toUpper','toLowerVariables','hasOwnProperty','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','logAgent','ringtime','UserId','logCustomer','endtime','answertime','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','calleridnum','xcally-motion-preview','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','scheduledAt','active','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','IsNotLoggedIn','queue','mandatoryDisposition','buildAcw','interface','agentReadyId','not_inuse','status','push','getDiff','diff','createBody','CampaignId','idContact','type','campaigntype','dialAnswer','countglobal','callback'];(function(_0x2f7a76,_0x2b5dc3){var _0x4fc5cb=function(_0x126bb1){while(--_0x126bb1){_0x2f7a76['push'](_0x2f7a76['shift']());}};_0x4fc5cb(++_0x2b5dc3);}(_0x3a39,0x11c));var _0x93a3=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x3a39[_0x397e5f];return _0x5302b8;};'use strict';var util=require('util');var _=require(_0x93a3('0x0'));var moment=require(_0x93a3('0x1'));var logger=require('../../../../config/logger')('preview');var ipAgi=process[_0x93a3('0x2')][_0x93a3('0x3')]||'127.0.0.1';function getSeconds(_0x84f9da,_0x354cd5){var _0x1253e9=moment(_0x84f9da)[_0x93a3('0x4')](0x0);var _0x7c14e1=moment(_0x354cd5)['milliseconds'](0x0);return _0x1253e9['diff'](_0x7c14e1,_0x93a3('0x5'));}exports[_0x93a3('0x6')]=function(_0x35214e){return function(_0x2cc4e1){logger['error'](_0x35214e,util[_0x93a3('0x7')](_0x2cc4e1,{'showHidden':![],'depth':null}));};};exports[_0x93a3('0x8')]=function(_0x3a8a44,_0x2ab203){logger[_0x93a3('0x9')](_0x3a8a44,util[_0x93a3('0x7')](_0x2ab203,{'showHidden':![],'depth':null}));};exports[_0x93a3('0xa')]=function(_0x5e427e,_0x5ca5e6){logger[_0x93a3('0xb')](_0x5e427e,util['inspect'](_0x5ca5e6,{'showHidden':![],'depth':null}));};exports[_0x93a3('0xc')]=function(_0x523297){return function(_0x31bcea){logger[_0x93a3('0x9')](_0x523297,util[_0x93a3('0x7')](_0x31bcea,{'showHidden':![],'depth':null}));};};exports[_0x93a3('0xd')]=function(_0x158455,_0x423160,_0x3f2e66){return{'message':_0x158455,'unlock':_0x423160,'active':_0x3f2e66};};exports[_0x93a3('0xe')]=function(_0x4aeba1,_0x336411,_0x330b85){if(!_[_0x93a3('0xf')](_0x330b85)&&_0x93a3('0x10')===typeof _0x330b85&&!_[_0x93a3('0x11')](_0x330b85)){if(!_[_0x93a3('0xf')](_0x336411)&&_0x93a3('0x10')===typeof _0x336411&&!_[_0x93a3('0x11')](_0x336411)){return util['format'](_0x93a3('0x12'),_0x336411,_0x330b85);}return util[_0x93a3('0x13')](_0x93a3('0x12'),_0x330b85,_0x330b85);}if(!_[_0x93a3('0xf')](_0x4aeba1)&&'string'===typeof _0x4aeba1&&!_[_0x93a3('0x11')](_0x4aeba1)){return _0x4aeba1;}return _0x93a3('0x14');};exports[_0x93a3('0x15')]=function(_0x2696c9){if(_['isNil'](_0x2696c9)){return![];}return _0x2696c9;};exports[_0x93a3('0x16')]=function(_0x5216d5,_0xdf6902,_0x3c44d1,_0x4c9e67,_0x2e11e1,_0x1dacf0){var _0x1b555e={'XMD-QUEUE':_0xdf6902[_0x93a3('0x17')]?_0xdf6902[_0x93a3('0x17')][_0x93a3('0x18')]:'','XMD-CALLERID':_0x4c9e67,'XMD-CALLERID-PREVIEW':_0x1dacf0?util[_0x93a3('0x13')](_0x93a3('0x12'),_0x1dacf0[_0x93a3('0x19')],_0x1dacf0['calleridnum']):_0x4c9e67,'XMD-DIALID':_0x2e11e1,'XMD-CONTACTID':_0xdf6902[_0x93a3('0x1a')],'XMD-CDRTYPE':_0x93a3('0x1b'),'CALLERID(all)':_0x4c9e67,'XMD-VOICEQUEUEID':_0xdf6902[_0x93a3('0x1c')],'XMD-DIALCHANNEL':_0x3c44d1,'XMD-DIALTIMEOUT':_0x5216d5[_0x93a3('0x1d')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0x93a3('0x1e'),_0x5216d5[_0x93a3('0x1f')]?'g':'',_['isEmpty'](_0x5216d5['monitor_format'])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x5216d5['dialPreviewUrl']||'','XMD-AGI':_0x5216d5[_0x93a3('0x20')]?util['format'](_0x93a3('0x21'),ipAgi,_0x5216d5[_0x93a3('0x20')]):_0x93a3('0x22'),'XMD-AGIAFTER':_0x5216d5['dialQueueProject2']?util[_0x93a3('0x13')](_0x93a3('0x21'),ipAgi,_0x5216d5[_0x93a3('0x1f')]):_0x93a3('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x1dacf0?_0x1dacf0[_0x93a3('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x1dacf0?_0x1dacf0[_0x93a3('0x24')]:'','XMD-DESTINATION':'xcally-motion-preview'};if(!_[_0x93a3('0x11')](_0x5216d5[_0x93a3('0x25')])){_0x1b555e[util[_0x93a3('0x13')]('%s',_0x93a3('0x26'))]=_0x5216d5[_0x93a3('0x25')];_0x1b555e[util['format']('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x2e11e1;}if(_0xdf6902&&_0xdf6902[_0x93a3('0x27')]){for(var _0x5eb494 in _0xdf6902['Contact']){if(_0xdf6902['Contact']['hasOwnProperty'](_0x5eb494)){if(!_[_0x93a3('0x28')](_0xdf6902['Contact'][_0x5eb494])&&_0x5eb494!=='id'&&_0x5eb494!==_0x93a3('0x29')&&_0x5eb494!=='createdAt'&&_0x5eb494!==_0x93a3('0x2a')){_0x1b555e[util[_0x93a3('0x13')](_0x93a3('0x2b'),'XMD-',_[_0x93a3('0x2c')](_0x5eb494))]=_0xdf6902[_0x93a3('0x27')][_0x5eb494];}}}}return _0x1b555e;};exports[_0x93a3('0x2d')]=function(_0x530929){var _0x32a3cb={};for(var _0x428f99 in _0x530929){if(_0x530929[_0x93a3('0x2e')](_0x428f99)){_0x32a3cb[util[_0x93a3('0x13')]('%s',_[_0x93a3('0x2f')](_0x428f99))]=_0x530929[_0x428f99];}}return{'variables':_0x32a3cb};};exports['updateOriginated']=function(_0x6cb168,_0x4a90a8){if(!_[_0x93a3('0x28')](_0x6cb168)){if(_0x6cb168['hasOwnProperty']('originated')){if(_0x6cb168[_0x93a3('0x30')]>0x0){_0x6cb168[_0x93a3('0x30')]-=0x1;}else{logger['error'](_0x93a3('0x31'),_0x4a90a8);}}}else{logger['error'](_0x93a3('0x32'),_0x4a90a8);}};exports[_0x93a3('0x33')]=function(_0x10e684){var _0x3073a0=moment()[_0x93a3('0x13')](_0x93a3('0x34'));_0x10e684[_0x93a3('0x35')]=0xd;_0x10e684[_0x93a3('0x36')]=_0x93a3('0x37');_0x10e684[_0x93a3('0x38')]=_0x3073a0;_0x10e684[_0x93a3('0x39')]=_0x3073a0;_0x10e684['endtime']=_0x3073a0;};exports[_0x93a3('0x3a')]=function(_0x5608f7,_0x3a5031,_0x3e88a5){var _0x35c231=moment()[_0x93a3('0x13')](_0x93a3('0x34'));_0x5608f7[_0x93a3('0x35')]=_0x3a5031;_0x5608f7[_0x93a3('0x36')]=_0x3e88a5;_0x5608f7[_0x93a3('0x39')]=_0x35c231;_0x5608f7[_0x93a3('0x3b')]=getSeconds(_0x5608f7['responsetime'],_0x5608f7['starttime']);};exports['logLookAgent']=function(_0x1b479f,_0x1ab102,_0x1e4014){_0x1b479f['membername']=_0x1ab102;_0x1b479f[_0x93a3('0x3c')]=_0x1e4014;};exports[_0x93a3('0x3d')]=function(_0x4a66b1,_0x214f6e,_0x33daaa){var _0x2879c1=moment()[_0x93a3('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x4a66b1[_0x93a3('0x35')]=_0x214f6e;_0x4a66b1[_0x93a3('0x36')]=_0x33daaa;_0x4a66b1[_0x93a3('0x39')]=_0x4a66b1[_0x93a3('0x39')]?_0x4a66b1[_0x93a3('0x39')]:_0x2879c1;_0x4a66b1[_0x93a3('0x3e')]=_0x4a66b1[_0x93a3('0x3e')]?_0x4a66b1['endtime']:_0x2879c1;_0x4a66b1[_0x93a3('0x3b')]=getSeconds(_0x4a66b1[_0x93a3('0x39')]||0x0,_0x4a66b1[_0x93a3('0x38')]||0x0);_0x4a66b1['talktime']=_0x4a66b1[_0x93a3('0x3f')]?getSeconds(_0x4a66b1[_0x93a3('0x3e')],_0x4a66b1[_0x93a3('0x3f')]):0x0;};exports['isFailure']=function(_0x1f3ea7){return _0x1f3ea7==='Failure';};exports[_0x93a3('0x40')]=function(_0x4cbc75,_0x4a6afe,_0x11252f,_0x422c8d,_0xd1bf9f){var _0x13452a=_0x422c8d?_0x93a3('0x41'):_0x4cbc75['calleridname'];_0x13452a=_0xd1bf9f?_0x93a3('0x42'):_0x13452a;return{'actionid':_0x4cbc75[_0x93a3('0x43')],'action':_0x93a3('0x44'),'channel':_0x4cbc75[_0x93a3('0x45')],'callerid':util[_0x93a3('0x13')](_0x93a3('0x12'),_0x13452a,_0x4cbc75[_0x93a3('0x46')]),'Exten':_0x93a3('0x47'),'Context':_0x93a3('0x48'),'Priority':'1','variable':_0x11252f,'timeout':(_0x4a6afe[_0x93a3('0x49')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4cbc75[_0x93a3('0x43')]};};exports[_0x93a3('0x4a')]=function(_0x3ad8fc){return _0x3ad8fc[_0x93a3('0x4b')]+_0x3ad8fc[_0x93a3('0x4c')]+_0x3ad8fc[_0x93a3('0x4d')]+_0x3ad8fc[_0x93a3('0x4e')]+_0x3ad8fc[_0x93a3('0x4f')];};exports[_0x93a3('0x50')]=function(_0xfa8b78){var _0xe9ec15=_[_0x93a3('0x51')](_0xfa8b78);_0xe9ec15[_0x93a3('0x35')]=0xf;_0xe9ec15[_0x93a3('0x36')]='Global';return _0xe9ec15;};exports[_0x93a3('0x52')]=function(_0x4d6578,_0xa268f7,_0x273f12){var _0x1946ef={};_0x1946ef[_0xa268f7]=_0x4d6578[_0xa268f7];_0x1946ef[_0x93a3('0x53')]=![];_0x1946ef[_0x93a3('0x54')]=moment()[_0x93a3('0x55')](_0x273f12,_0x93a3('0x56'))[_0x93a3('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x1946ef['ContactId']=_0x4d6578[_0x93a3('0x1a')];_0x1946ef[_0x93a3('0x57')]=_0x4d6578[_0x93a3('0x57')];_0x1946ef[_0x93a3('0x1c')]=_0x4d6578[_0x93a3('0x1c')]||undefined;return _0x1946ef;};exports[_0x93a3('0x58')]=function(_0x1a8448,_0x3977d9){if(!_[_0x93a3('0x28')](_0x1a8448)){if(_0x1a8448[_0x93a3('0x59')]>0x0){_0x1a8448['pTalking']-=0x1;}else{logger['error'](_0x3977d9,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0x93a3('0xb')](_0x3977d9,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0x93a3('0x5a')]=function(_0x5665c9){if(_0x5665c9<=0x0){return!![];}return![];};exports['buildObj']=function(_0x231e07,_0x14d3b7,_0xb84f9b){_0x231e07['lastevent']=_0x14d3b7;_0x231e07['name']=_0x231e07[_0x93a3('0x5b')];_0x231e07['interface']=_0x231e07[_0x93a3('0x45')];if(_0xb84f9b){_0x231e07[_0x93a3('0x5c')]=_0xb84f9b[_0x93a3('0x5c')];}return _0x231e07;};exports[_0x93a3('0x5d')]=function(_0x521438){var _0x15c9fc={};_0x15c9fc[_0x93a3('0x5b')]=_0x521438[_0x93a3('0x5b')];_0x15c9fc[_0x93a3('0x5e')]=_0x521438[_0x93a3('0x45')];_0x15c9fc[_0x93a3('0x43')]=_0x521438[_0x93a3('0x43')];return _0x15c9fc;};exports[_0x93a3('0x5f')]=function(_0x134114){var _0x1dec97=[];for(var _0x21a8e9 in _0x134114){if(_0x134114[_0x93a3('0x2e')](_0x21a8e9)){if(!_['isNil'](_0x134114[_0x21a8e9])&&_0x134114[_0x21a8e9][_0x93a3('0x35')]===_0x93a3('0x60')&&_0x134114[_0x21a8e9][_0x93a3('0x61')]==='reachable'){_0x1dec97[_0x93a3('0x62')](_0x134114[_0x21a8e9]['id']);}}}return _0x1dec97;};exports[_0x93a3('0x63')]=function(_0x35df0b){var _0x2a9c38=moment()[_0x93a3('0x4')](0x0);var _0xb43e35=moment(_0x35df0b)[_0x93a3('0x4')](0x0);return _0x2a9c38[_0x93a3('0x64')](_0xb43e35,'seconds');};exports[_0x93a3('0x65')]=function(_0x4adff4){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x4adff4['ContactId'],'ListId':_0x4adff4['ListId'],'VoiceQueueId':_0x4adff4[_0x93a3('0x1c')]||undefined,'CampaignId':_0x4adff4[_0x93a3('0x66')]||undefined};};exports['filterKey']=function(_0x4d2921){if(_0x4d2921===_0x93a3('0x43')||_0x4d2921===_0x93a3('0x67')||_0x4d2921===_0x93a3('0x5b')||_0x4d2921===_0x93a3('0x68')||_0x4d2921===_0x93a3('0x69')||_0x4d2921===_0x93a3('0x6a')||_0x4d2921==='membername'||_0x4d2921===_0x93a3('0x45')||_0x4d2921==='calleridname'||_0x4d2921==='active'||_0x4d2921===_0x93a3('0x46')||_0x4d2921===_0x93a3('0x54')||_0x4d2921===_0x93a3('0x4b')||_0x4d2921===_0x93a3('0x4c')||_0x4d2921==='countnoanswerretry'||_0x4d2921===_0x93a3('0x6b')||_0x4d2921===_0x93a3('0x6c')||_0x4d2921==='callbackuniqueid'||_0x4d2921===_0x93a3('0x6d')||_0x4d2921===_0x93a3('0x6e')||_0x4d2921===_0x93a3('0x1a')||_0x4d2921===_0x93a3('0x57')||_0x4d2921==='UserId'||_0x4d2921===_0x93a3('0x1c')||_0x4d2921==='sipcallid'||_0x4d2921==='xmd-voicequeueid'||_0x4d2921===_0x93a3('0x6f')||_0x4d2921===_0x93a3('0x70')||_0x4d2921===_0x93a3('0x71')||_0x4d2921==='xmd-dialurl'||_0x4d2921==='xmd-dialtimeout'||_0x4d2921===_0x93a3('0x72')||_0x4d2921==='xmd-dialid'||_0x4d2921==='xmd-dialchannel'||_0x4d2921===_0x93a3('0x73')||_0x4d2921===_0x93a3('0x74')||_0x4d2921===_0x93a3('0x75')||_0x4d2921==='xmd-agiafter'||_0x4d2921==='xmd-agi'||_0x4d2921===_0x93a3('0x76')||_0x4d2921===_0x93a3('0x77')||_0x4d2921===_0x93a3('0x78')||_0x4d2921==='rtpaudioqosjitterbridged'||_0x4d2921===_0x93a3('0x79')||_0x4d2921===_0x93a3('0x7a')||_0x4d2921==='rtpaudioqosrtt'||_0x4d2921==='rtpaudioqosrttbridged'||_0x4d2921===_0x93a3('0x76')||_0x4d2921===_0x93a3('0x77')||_0x4d2921===_0x93a3('0x78')||_0x4d2921==='rtpaudioqosjitterbridged'||_0x4d2921==='rtpaudioqosloss'||_0x4d2921===_0x93a3('0x7a')||_0x4d2921===_0x93a3('0x7b')||_0x4d2921==='rtpaudioqosrttbridged'||_0x4d2921===_0x93a3('0x7c')||_0x4d2921===_0x93a3('0x7d')||_0x4d2921===_0x93a3('0x35')||_0x4d2921==='statedesc'){return![];}return!![];};exports['getCallerIdRandom']=function(_0x1fe013,_0x2c6ff0){var _0x4f74ec,_0xdfaa1d,_0x3e4a14;if(_0x2c6ff0<=0x0){_0x2c6ff0=0x1;}_0x4f74ec=new RegExp('\x5cw{0,'+_0x2c6ff0+'}$');_0xdfaa1d=Math['pow'](0xa,_0x2c6ff0-0x1);_0x3e4a14=Math[_0x93a3('0x7e')](0xa,_0x2c6ff0)-0x1;return util[_0x93a3('0x13')]('%s',_[_0x93a3('0x7f')](_0x1fe013,_0x4f74ec,_['random'](_0xdfaa1d,_0x3e4a14)));};exports[_0x93a3('0x80')]=function(_0x348967){var _0x116f78=_0x348967[_0x93a3('0x81')](/"(.*?)"/);return _0x116f78?_0x116f78[0x1]:_0x348967;};exports[_0x93a3('0x82')]=function(_0x23abfa){var _0x515364=_0x23abfa[_0x93a3('0x81')](/<(.*?)>/);return _0x515364?_0x515364[0x1]:_0x23abfa;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 0bb06a9..abe2419 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 _0x4c12=['string','number','boolean','queueremove','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd'];(function(_0x386ceb,_0x1239d4){var _0x27bf8f=function(_0x210ff7){while(--_0x210ff7){_0x386ceb['push'](_0x386ceb['shift']());}};_0x27bf8f(++_0x1239d4);}(_0x4c12,0x19d));var _0x24c1=function(_0x2fee96,_0x2f735d){_0x2fee96=_0x2fee96-0x0;var _0x2e6ad1=_0x4c12[_0x2fee96];return _0x2e6ad1;};'use strict';exports[_0x24c1('0x0')]={'queue':{'type':_0x24c1('0x1'),'required':!![]},'interface':{'type':_0x24c1('0x1'),'required':!![]},'membername':{'type':_0x24c1('0x1'),'required':!![]},'penalty':{'type':_0x24c1('0x2'),'required':![]},'paused':{'type':_0x24c1('0x3'),'required':![]}};exports[_0x24c1('0x4')]={'queue':{'type':_0x24c1('0x1'),'required':!![]},'interface':{'type':_0x24c1('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':_0x24c1('0x1'),'required':!![]},'paused':{'type':_0x24c1('0x3')},'reason':{'type':_0x24c1('0x1'),'required':![]}};exports['reload']={'module':{'type':_0x24c1('0x1'),'required':![]}};exports[_0x24c1('0x5')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x24c1('0x6')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':'string'},'format':{'type':_0x24c1('0x1')},'mixmonitorid':{'type':_0x24c1('0x1')}};exports[_0x24c1('0x7')]={'uniqueid':{'type':_0x24c1('0x1'),'required':!![]}};exports[_0x24c1('0x8')]={'uniqueid':{'type':_0x24c1('0x1'),'required':!![]},'exten':{'type':_0x24c1('0x1'),'required':!![]},'context':{'type':_0x24c1('0x1')}}; \ No newline at end of file +var _0x883e=['reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','string','number','boolean','queuepause'];(function(_0x44770b,_0x292817){var _0x156812=function(_0x10a8d3){while(--_0x10a8d3){_0x44770b['push'](_0x44770b['shift']());}};_0x156812(++_0x292817);}(_0x883e,0xf8));var _0xe883=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x883e[_0x3dd15e];return _0x231fd0;};'use strict';exports['queueadd']={'queue':{'type':'string','required':!![]},'interface':{'type':_0xe883('0x0'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0xe883('0x1'),'required':![]},'paused':{'type':_0xe883('0x2'),'required':![]}};exports['queueremove']={'queue':{'type':'string','required':!![]},'interface':{'type':_0xe883('0x0'),'required':!![]}};exports[_0xe883('0x3')]={'interface':{'type':_0xe883('0x0'),'required':!![]},'paused':{'type':_0xe883('0x2')},'reason':{'type':_0xe883('0x0'),'required':![]}};exports[_0xe883('0x4')]={'module':{'type':_0xe883('0x0'),'required':![]}};exports[_0xe883('0x5')]={'uniqueid':{'type':_0xe883('0x0'),'required':!![]}};exports[_0xe883('0x6')]={'uniqueid':{'type':_0xe883('0x0'),'required':!![]},'filename':{'type':_0xe883('0x0')},'format':{'type':'string'},'mixmonitorid':{'type':_0xe883('0x0')}};exports[_0xe883('0x7')]={'uniqueid':{'type':_0xe883('0x0'),'required':!![]}};exports[_0xe883('0x8')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0xe883('0x0'),'required':!![]},'context':{'type':_0xe883('0x0')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 38fd537..31878db 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 _0x7dec=['../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','trunks','triggers','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','hasOwnProperty','format','interface','total','answered','sumDuration','sumBillable','ivrTotalCallsDays','ivrAnswerCallsDay','isEmpty','unmanaged','sumHoldTime','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','initAgents','length','isNil','SIP/%s','name','isUndefined','initTelephones','telephones','mergeFromDatabase','initTrunks','initVoiceQueues','voiceQueues','initTemplates','initZendeskAccounts','initSalesforceAccounts','initZohoAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','queue','queuecallerexit','queuecallerabandon','abandoned','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','ANSWERED','billableseconds','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','bluebird','util','moment','../model/telephone','../model/trunk','../model/trigger'];(function(_0x4495d7,_0x441091){var _0x459726=function(_0x32523b){while(--_0x32523b){_0x4495d7['push'](_0x4495d7['shift']());}};_0x459726(++_0x441091);}(_0x7dec,0x1aa));var _0xc7de=function(_0x21f931,_0x598b2d){_0x21f931=_0x21f931-0x0;var _0x3f083c=_0x7dec[_0x21f931];return _0x3f083c;};'use strict';var BPromise=require(_0xc7de('0x0'));var util=require(_0xc7de('0x1'));var _=require('lodash');var moment=require(_0xc7de('0x2'));var Agent=require('../model/agent');var Telephone=require(_0xc7de('0x3'));var Trunk=require(_0xc7de('0x4'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0xc7de('0x5'));var Template=require(_0xc7de('0x6'));var Campaign=require(_0xc7de('0x7'));var VoiceExtension=require(_0xc7de('0x8'));var ZendeskAccount=require(_0xc7de('0x9'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xc7de('0xa'));var SugarcrmAccount=require(_0xc7de('0xb'));var ZohoAccount=require(_0xc7de('0xc'));var DeskAccount=require(_0xc7de('0xd'));var VtigerAccount=require(_0xc7de('0xe'));var ServicenowAccount=require(_0xc7de('0xf'));var Dynamics365Account=require(_0xc7de('0x10'));var FreshsalesAccount=require(_0xc7de('0x11'));var FaxAccount=require(_0xc7de('0x12'));var Realtime=function(){this[_0xc7de('0x13')]={};this['telephones']={};this[_0xc7de('0x14')]={};this['voiceQueues']={};this[_0xc7de('0x15')]={};this[_0xc7de('0x16')]={};this[_0xc7de('0x17')]={};this[_0xc7de('0x18')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xc7de('0x19')]={};this[_0xc7de('0x1a')]={};this[_0xc7de('0x1b')]={};this[_0xc7de('0x1c')]={};this[_0xc7de('0x1d')]={};this[_0xc7de('0x1e')]={};this[_0xc7de('0x1f')]={};this[_0xc7de('0x20')]={};this[_0xc7de('0x21')]={};this[_0xc7de('0x22')]={};this[_0xc7de('0x23')]={};this[_0xc7de('0x24')]={};this[_0xc7de('0x25')]={};this[_0xc7de('0x26')]={};this[_0xc7de('0x27')]={};this[_0xc7de('0x28')]={};this[_0xc7de('0x29')]={};};function freeIsNotKey(_0x4be4b5,_0x5078f3,_0x1563d1){var _0x16d122=_['mapKeys'](_0x4be4b5,function(_0x4ac20f,_0x151d6d){return _0x4ac20f[_0x1563d1];});for(var _0x1d03af in _0x5078f3){if(_0x5078f3[_0xc7de('0x2a')](_0x1d03af)){if(!_0x16d122[_0x1d03af]){delete _0x5078f3[_0x1d03af];}}}}function freeIsNotKeySip(_0x5197f3,_0x518c0e){var _0x2d193f=_['mapKeys'](_0x5197f3,function(_0x36345c,_0x13c29e){return util[_0xc7de('0x2b')]('SIP/%s',_0x36345c['name']);});for(var _0x197fbd in _0x518c0e){if(_0x518c0e[_0xc7de('0x2a')](_0x197fbd)){if(!_0x2d193f[_0x197fbd]){delete _0x518c0e[_0x197fbd];}}}}function freeIsNotKeyAgent(_0x1b9cd2,_0x5eba79){var _0x17bff1=_['mapKeys'](_0x1b9cd2,function(_0x279c1a,_0x31bca6){var _0x2561e7=_['isNil'](_0x279c1a[_0xc7de('0x2c')])?util[_0xc7de('0x2b')]('SIP/%s',_0x279c1a['name']):_0x279c1a[_0xc7de('0x2c')];return _0x2561e7;});for(var _0x30c23e in _0x5eba79){if(_0x5eba79[_0xc7de('0x2a')](_0x30c23e)){if(!_0x17bff1[_0x30c23e]){delete _0x5eba79[_0x30c23e];}}}}function clearVoiceCallReports(_0x533ef3){_0x533ef3[_0xc7de('0x2d')]=0x0;_0x533ef3[_0xc7de('0x2e')]=0x0;_0x533ef3['sumHoldTime']=0x0;_0x533ef3[_0xc7de('0x2f')]=0x0;_0x533ef3[_0xc7de('0x30')]=0x0;}function clearCampaigns(_0x154bf7){if(!_['isEmpty'](_0x154bf7)){for(var _0x3d3d38 in _0x154bf7){if(_0x154bf7[_0xc7de('0x2a')](_0x3d3d38)){_0x154bf7[_0x3d3d38][_0xc7de('0x31')]=0x0;_0x154bf7[_0x3d3d38][_0xc7de('0x32')]=0x0;}}}}function clearVoiceQueues(_0xa6cf92){if(!_[_0xc7de('0x33')](_0xa6cf92)){for(var _0x3c4c4c in _0xa6cf92){if(_0xa6cf92['hasOwnProperty'](_0x3c4c4c)){_0xa6cf92[_0x3c4c4c][_0xc7de('0x2d')]=0x0;_0xa6cf92[_0x3c4c4c][_0xc7de('0x2e')]=0x0;_0xa6cf92[_0x3c4c4c][_0xc7de('0x34')]=0x0;_0xa6cf92[_0x3c4c4c]['abandoned']=0x0;_0xa6cf92[_0x3c4c4c][_0xc7de('0x35')]=0x0;_0xa6cf92[_0x3c4c4c][_0xc7de('0x2f')]=0x0;_0xa6cf92[_0x3c4c4c][_0xc7de('0x30')]=0x0;_0xa6cf92[_0x3c4c4c][_0xc7de('0x36')]=0x0;_0xa6cf92[_0x3c4c4c]['outboundNoAnswerCallsDay']=0x0;_0xa6cf92[_0x3c4c4c][_0xc7de('0x37')]=0x0;_0xa6cf92[_0x3c4c4c][_0xc7de('0x38')]=0x0;_0xa6cf92[_0x3c4c4c][_0xc7de('0x39')]=0x0;_0xa6cf92[_0x3c4c4c][_0xc7de('0x3a')]=0x0;_0xa6cf92[_0x3c4c4c]['outboundDropCallsDayTimeout']=0x0;_0xa6cf92[_0x3c4c4c][_0xc7de('0x3b')]=0x0;_0xa6cf92[_0x3c4c4c]['outboundBlacklistCallsDay']=0x0;_0xa6cf92[_0x3c4c4c][_0xc7de('0x3c')]=0x0;_0xa6cf92[_0x3c4c4c][_0xc7de('0x3d')]=0x0;_0xa6cf92[_0x3c4c4c][_0xc7de('0x3e')]=0x0;_0xa6cf92[_0x3c4c4c][_0xc7de('0x36')]=0x0;_0xa6cf92[_0x3c4c4c][_0xc7de('0x3f')]=0x0;_0xa6cf92[_0x3c4c4c][_0xc7de('0x40')]=!![];}}}}Realtime[_0xc7de('0x41')]['mergeFromDatabase']=function(_0x44beff,_0x12728f){for(var _0x219f17 in _0x12728f){if(_0x44beff[_0xc7de('0x2a')](_0x219f17)){_0x44beff[_0x219f17]=_0x12728f[_0x219f17];}}};Realtime[_0xc7de('0x41')][_0xc7de('0x42')]=function(){var _0x3fb5be=this;return function(_0xced4fd){if(_0xced4fd){freeIsNotKeyAgent(_0xced4fd,_0x3fb5be[_0xc7de('0x13')]);for(var _0x4a8840=0x0,_0x1fe35f={},_0x33ce1d={};_0x4a8840<_0xced4fd[_0xc7de('0x43')];_0x4a8840+=0x1){_0x1fe35f=_0xced4fd[_0x4a8840];var _0x44e2a9=_[_0xc7de('0x44')](_0x1fe35f[_0xc7de('0x2c')])?util['format'](_0xc7de('0x45'),_0x1fe35f[_0xc7de('0x46')]):_0x1fe35f[_0xc7de('0x2c')];if(_[_0xc7de('0x47')](_0x3fb5be[_0xc7de('0x13')][_0x44e2a9])){_0x3fb5be[_0xc7de('0x13')][_0x44e2a9]=new Agent(_0x1fe35f);}else{_0x3fb5be['mergeFromDatabase'](_0x3fb5be[_0xc7de('0x13')][_0x44e2a9],_0x1fe35f);}}}return _0x3fb5be[_0xc7de('0x13')];};};Realtime['prototype'][_0xc7de('0x48')]=function(){var _0x33c875=this;return function(_0x2a71e5){if(_0x2a71e5){freeIsNotKeySip(_0x2a71e5,_0x33c875[_0xc7de('0x49')]);for(var _0x493ad9=0x0,_0x55064e={},_0x25bab6={};_0x493ad9<_0x2a71e5[_0xc7de('0x43')];_0x493ad9+=0x1){_0x55064e=_0x2a71e5[_0x493ad9];if(_['isUndefined'](_0x33c875['telephones'][util[_0xc7de('0x2b')](_0xc7de('0x45'),_0x55064e[_0xc7de('0x46')])])){_0x33c875[_0xc7de('0x49')][util[_0xc7de('0x2b')]('SIP/%s',_0x55064e[_0xc7de('0x46')])]=new Telephone(_0x55064e);}else{_0x33c875[_0xc7de('0x4a')](_0x33c875[_0xc7de('0x49')][util[_0xc7de('0x2b')](_0xc7de('0x45'),_0x55064e[_0xc7de('0x46')])],_0x55064e);}}}return _0x33c875['telephones'];};};Realtime[_0xc7de('0x41')][_0xc7de('0x4b')]=function(){var _0x556276=this;return function(_0x144b3e){if(_0x144b3e){freeIsNotKeySip(_0x144b3e,_0x556276['trunks']);for(var _0x32912d=0x0,_0x862a2={},_0x6b437f={};_0x32912d<_0x144b3e[_0xc7de('0x43')];_0x32912d+=0x1){_0x862a2=_0x144b3e[_0x32912d];if(_[_0xc7de('0x47')](_0x556276[_0xc7de('0x14')][util[_0xc7de('0x2b')]('SIP/%s',_0x862a2[_0xc7de('0x46')])])){_0x556276['trunks'][util[_0xc7de('0x2b')](_0xc7de('0x45'),_0x862a2[_0xc7de('0x46')])]=new Trunk(_0x862a2);}else{_0x556276[_0xc7de('0x4a')](_0x556276[_0xc7de('0x14')][util[_0xc7de('0x2b')](_0xc7de('0x45'),_0x862a2[_0xc7de('0x46')])],_0x862a2);}}}return _0x556276[_0xc7de('0x14')];};};Realtime['prototype'][_0xc7de('0x4c')]=function(){var _0x55e0da=this;return function(_0x130845){if(_0x130845){freeIsNotKey(_0x130845,_0x55e0da[_0xc7de('0x4d')],_0xc7de('0x46'));for(var _0x7a463=0x0,_0x11c295={},_0x4d0c58={};_0x7a463<_0x130845[_0xc7de('0x43')];_0x7a463+=0x1){_0x11c295=_0x130845[_0x7a463];if(_[_0xc7de('0x47')](_0x55e0da[_0xc7de('0x4d')][_0x11c295['name']])){_0x55e0da[_0xc7de('0x4d')][_0x11c295['name']]=new VoiceQueue(_0x11c295);}else{_0x55e0da['mergeFromDatabase'](_0x55e0da[_0xc7de('0x4d')][_0x11c295[_0xc7de('0x46')]],_0x11c295);}}}return _0x55e0da[_0xc7de('0x4d')];};};Realtime[_0xc7de('0x41')]['initTriggers']=function(){var _0x479d0c=this;return function(_0x33bdd6){if(_0x33bdd6){freeIsNotKey(_0x33bdd6,_0x479d0c[_0xc7de('0x15')],'id');for(var _0x5cd5ac=0x0,_0xd1beaf={},_0x230cf8={};_0x5cd5ac<_0x33bdd6['length'];_0x5cd5ac+=0x1){_0xd1beaf=_0x33bdd6[_0x5cd5ac];if(_['isUndefined'](_0x479d0c['triggers'][_0xd1beaf['id']])){_0x479d0c[_0xc7de('0x15')][_0xd1beaf['id']]=new Trigger(_0xd1beaf);}else{_0x479d0c[_0xc7de('0x4a')](_0x479d0c[_0xc7de('0x15')][_0xd1beaf['id']],_0xd1beaf);}}}return _0x479d0c[_0xc7de('0x15')];};};Realtime[_0xc7de('0x41')][_0xc7de('0x4e')]=function(){var _0x2c133e=this;return function(_0x36b01c){if(_0x36b01c){freeIsNotKey(_0x36b01c,_0x2c133e[_0xc7de('0x17')],'id');for(var _0x15e9c7=0x0,_0x2b1f97={},_0x3248df={};_0x15e9c7<_0x36b01c[_0xc7de('0x43')];_0x15e9c7+=0x1){_0x2b1f97=_0x36b01c[_0x15e9c7];if(_['isUndefined'](_0x2c133e[_0xc7de('0x17')][_0x2b1f97['id']])){_0x2c133e['templates'][_0x2b1f97['id']]=new Template(_0x2b1f97);}else{_0x2c133e[_0xc7de('0x4a')](_0x2c133e[_0xc7de('0x17')][_0x2b1f97['id']],_0x2b1f97);}}}return _0x2c133e[_0xc7de('0x17')];};};Realtime['prototype'][_0xc7de('0x4f')]=function(){var _0x28f620=this;return function(_0x450b35){if(_0x450b35){freeIsNotKey(_0x450b35,_0x28f620['zendeskAccounts'],'id');for(var _0x482ba7=0x0,_0x247471={},_0x3a45b0={};_0x482ba7<_0x450b35['length'];_0x482ba7+=0x1){_0x247471=_0x450b35[_0x482ba7];if(_[_0xc7de('0x47')](_0x28f620[_0xc7de('0x1f')][_0x247471['id']])){_0x28f620[_0xc7de('0x1f')][_0x247471['id']]=new ZendeskAccount(_0x247471);}else{_0x28f620[_0xc7de('0x4a')](_0x28f620[_0xc7de('0x1f')][_0x247471['id']],_0x247471);}}}return _0x28f620['zendeskAccounts'];};};Realtime[_0xc7de('0x41')][_0xc7de('0x50')]=function(){var _0x42da4b=this;return function(_0x1bc045){if(_0x1bc045){freeIsNotKey(_0x1bc045,_0x42da4b[_0xc7de('0x20')],'id');for(var _0x49a126=0x0,_0x6a0734={},_0x365a30={};_0x49a126<_0x1bc045[_0xc7de('0x43')];_0x49a126+=0x1){_0x6a0734=_0x1bc045[_0x49a126];if(_[_0xc7de('0x47')](_0x42da4b[_0xc7de('0x20')][_0x6a0734['id']])){_0x42da4b[_0xc7de('0x20')][_0x6a0734['id']]=new SalesforceAccount(_0x6a0734);}else{_0x42da4b[_0xc7de('0x4a')](_0x42da4b['salesforceAccounts'][_0x6a0734['id']],_0x6a0734);}}}return _0x42da4b[_0xc7de('0x20')];};};Realtime[_0xc7de('0x41')]['initFreshdeskAccounts']=function(){var _0x45741d=this;return function(_0x1d05bf){if(_0x1d05bf){freeIsNotKey(_0x1d05bf,_0x45741d[_0xc7de('0x22')],'id');for(var _0x14c798=0x0,_0x3aec49={},_0x482425={};_0x14c798<_0x1d05bf[_0xc7de('0x43')];_0x14c798+=0x1){_0x3aec49=_0x1d05bf[_0x14c798];if(_[_0xc7de('0x47')](_0x45741d[_0xc7de('0x22')][_0x3aec49['id']])){_0x45741d[_0xc7de('0x22')][_0x3aec49['id']]=new FreshdeskAccount(_0x3aec49);}else{_0x45741d[_0xc7de('0x4a')](_0x45741d[_0xc7de('0x22')][_0x3aec49['id']],_0x3aec49);}}}return _0x45741d[_0xc7de('0x22')];};};Realtime[_0xc7de('0x41')][_0xc7de('0x51')]=function(){var _0x1ab38d=this;return function(_0x340567){if(_0x340567){freeIsNotKey(_0x340567,_0x1ab38d[_0xc7de('0x23')],'id');for(var _0x49e9b=0x0,_0x2edbb6={},_0x139b3b={};_0x49e9b<_0x340567[_0xc7de('0x43')];_0x49e9b+=0x1){_0x2edbb6=_0x340567[_0x49e9b];if(_[_0xc7de('0x47')](_0x1ab38d['zohoAccounts'][_0x2edbb6['id']])){_0x1ab38d[_0xc7de('0x23')][_0x2edbb6['id']]=new ZohoAccount(_0x2edbb6);}else{_0x1ab38d[_0xc7de('0x4a')](_0x1ab38d[_0xc7de('0x23')][_0x2edbb6['id']],_0x2edbb6);}}}return _0x1ab38d['zohoAccounts'];};};Realtime[_0xc7de('0x41')]['initDeskAccounts']=function(){var _0x141458=this;return function(_0x425ddc){if(_0x425ddc){freeIsNotKey(_0x425ddc,_0x141458[_0xc7de('0x24')],'id');for(var _0x170fa3=0x0,_0xcf9575={},_0x355487={};_0x170fa3<_0x425ddc[_0xc7de('0x43')];_0x170fa3+=0x1){_0xcf9575=_0x425ddc[_0x170fa3];if(_[_0xc7de('0x47')](_0x141458['deskAccounts'][_0xcf9575['id']])){_0x141458[_0xc7de('0x24')][_0xcf9575['id']]=new DeskAccount(_0xcf9575);}else{_0x141458[_0xc7de('0x4a')](_0x141458[_0xc7de('0x24')][_0xcf9575['id']],_0xcf9575);}}}return _0x141458['deskAccounts'];};};Realtime[_0xc7de('0x41')][_0xc7de('0x52')]=function(){var _0x5b2db8=this;return function(_0x4f3b72){if(_0x4f3b72){freeIsNotKey(_0x4f3b72,_0x5b2db8['sugarcrmAccounts'],'id');for(var _0x2e9fd3=0x0,_0x2e5ce1={},_0x305769={};_0x2e9fd3<_0x4f3b72[_0xc7de('0x43')];_0x2e9fd3+=0x1){_0x2e5ce1=_0x4f3b72[_0x2e9fd3];if(_[_0xc7de('0x47')](_0x5b2db8['sugarcrmAccounts'][_0x2e5ce1['id']])){_0x5b2db8[_0xc7de('0x21')][_0x2e5ce1['id']]=new SugarcrmAccount(_0x2e5ce1);}else{_0x5b2db8[_0xc7de('0x4a')](_0x5b2db8[_0xc7de('0x21')][_0x2e5ce1['id']],_0x2e5ce1);}}}return _0x5b2db8[_0xc7de('0x21')];};};Realtime['prototype'][_0xc7de('0x53')]=function(){var _0x5beb6a=this;return function(_0x460300){if(_0x460300){freeIsNotKey(_0x460300,_0x5beb6a['vtigerAccounts'],'id');for(var _0x2d8297=0x0,_0x3a371e={},_0x66e5df={};_0x2d8297<_0x460300[_0xc7de('0x43')];_0x2d8297+=0x1){_0x3a371e=_0x460300[_0x2d8297];if(_[_0xc7de('0x47')](_0x5beb6a[_0xc7de('0x25')][_0x3a371e['id']])){_0x5beb6a[_0xc7de('0x25')][_0x3a371e['id']]=new VtigerAccount(_0x3a371e);}else{_0x5beb6a[_0xc7de('0x4a')](_0x5beb6a[_0xc7de('0x25')][_0x3a371e['id']],_0x3a371e);}}}return _0x5beb6a[_0xc7de('0x25')];};};Realtime[_0xc7de('0x41')][_0xc7de('0x54')]=function(){var _0x52ea6d=this;return function(_0x5854de){if(_0x5854de){freeIsNotKey(_0x5854de,_0x52ea6d['servicenowAccounts'],'id');for(var _0x41c9aa=0x0,_0x3fe411={},_0x1fbddd={};_0x41c9aa<_0x5854de[_0xc7de('0x43')];_0x41c9aa+=0x1){_0x3fe411=_0x5854de[_0x41c9aa];if(_['isUndefined'](_0x52ea6d[_0xc7de('0x26')][_0x3fe411['id']])){_0x52ea6d[_0xc7de('0x26')][_0x3fe411['id']]=new ServicenowAccount(_0x3fe411);}else{_0x52ea6d['mergeFromDatabase'](_0x52ea6d[_0xc7de('0x26')][_0x3fe411['id']],_0x3fe411);}}}return _0x52ea6d[_0xc7de('0x26')];};};Realtime[_0xc7de('0x41')]['initDynamics365Accounts']=function(){var _0x493b95=this;return function(_0x50bb61){if(_0x50bb61){freeIsNotKey(_0x50bb61,_0x493b95['dynamics365Accounts'],'id');for(var _0x29b164=0x0,_0x592105={},_0x520350={};_0x29b164<_0x50bb61[_0xc7de('0x43')];_0x29b164+=0x1){_0x592105=_0x50bb61[_0x29b164];if(_[_0xc7de('0x47')](_0x493b95['dynamics365Accounts'][_0x592105['id']])){_0x493b95[_0xc7de('0x27')][_0x592105['id']]=new Dynamics365Account(_0x592105);}else{_0x493b95[_0xc7de('0x4a')](_0x493b95[_0xc7de('0x27')][_0x592105['id']],_0x592105);}}}return _0x493b95[_0xc7de('0x27')];};};Realtime['prototype'][_0xc7de('0x55')]=function(){var _0x2170c6=this;return function(_0x3e1f58){if(_0x3e1f58){freeIsNotKey(_0x3e1f58,_0x2170c6['freshsalesAccounts'],'id');for(var _0x58e05b=0x0,_0x30f031={},_0x39b915={};_0x58e05b<_0x3e1f58[_0xc7de('0x43')];_0x58e05b+=0x1){_0x30f031=_0x3e1f58[_0x58e05b];if(_['isUndefined'](_0x2170c6[_0xc7de('0x28')][_0x30f031['id']])){_0x2170c6['freshsalesAccounts'][_0x30f031['id']]=new FreshsalesAccount(_0x30f031);}else{_0x2170c6[_0xc7de('0x4a')](_0x2170c6[_0xc7de('0x28')][_0x30f031['id']],_0x30f031);}}}return _0x2170c6[_0xc7de('0x28')];};};Realtime['prototype'][_0xc7de('0x56')]=function(){var _0x2f503b=this;return function(_0x31ab6a){for(var _0x249e06=0x0;_0x249e06<_0x31ab6a[_0xc7de('0x43')];_0x249e06+=0x1){_[_0xc7de('0x57')](_0x2f503b[_0xc7de('0x4d')][_0x31ab6a[_0x249e06][_0xc7de('0x46')]],_0x31ab6a[_0x249e06]);}return _0x2f503b[_0xc7de('0x4d')];};};Realtime[_0xc7de('0x41')]['initVoiceQueueReports']=function(){var _0xe6bc54=this;return function(_0x222cf9){clearVoiceQueues(_0xe6bc54[_0xc7de('0x4d')]);if(_0x222cf9){_0x222cf9=_['groupBy'](_0x222cf9,'uniqueid');for(var _0x56bee6 in _0x222cf9){if(_0x222cf9[_0xc7de('0x2a')](_0x56bee6)){var _0x9c60af={};for(var _0x13700b=0x0;_0x13700b<_0x222cf9[_0x56bee6]['length'];_0x13700b+=0x1){var _0x7478a8=_0x222cf9[_0x56bee6][_0x13700b][_0xc7de('0x58')];if(_0xe6bc54['voiceQueues'][_0x7478a8]){if(_0x222cf9[_0x56bee6][_0x13700b][_0xc7de('0x59')]){_0xe6bc54[_0xc7de('0x4d')][_0x7478a8][_0xc7de('0x34')]+=0x1;}if(_0x222cf9[_0x56bee6][_0x13700b][_0xc7de('0x5a')]){_0xe6bc54['voiceQueues'][_0x7478a8][_0xc7de('0x5b')]+=0x1;}_0xe6bc54[_0xc7de('0x4d')][_0x7478a8][_0xc7de('0x35')]+=moment(_0x222cf9[_0x56bee6][_0x13700b][_0xc7de('0x5c')])[_0xc7de('0x5d')](moment(_0x222cf9[_0x56bee6][_0x13700b][_0xc7de('0x5e')]),_0xc7de('0x5f'))||0x0;if(_0x13700b===_0x222cf9[_0x56bee6][_0xc7de('0x43')]-0x1){_0xe6bc54['voiceQueues'][_0x7478a8][_0xc7de('0x2f')]+=moment(_0x222cf9[_0x56bee6][_0x13700b][_0xc7de('0x60')]||_0x222cf9[_0x56bee6][_0x13700b][_0xc7de('0x61')]||_0x222cf9[_0x56bee6][_0x13700b][_0xc7de('0x62')])['diff'](moment(_0x222cf9[_0x56bee6][_0x13700b][_0xc7de('0x5e')]),_0xc7de('0x5f'))||0x0;_0xe6bc54[_0xc7de('0x4d')][_0x7478a8][_0xc7de('0x2d')]+=0x1;if(_0x222cf9[_0x56bee6][_0x13700b][_0xc7de('0x63')]){_0xe6bc54[_0xc7de('0x4d')][_0x7478a8]['answered']+=0x1;_0xe6bc54[_0xc7de('0x4d')][_0x7478a8][_0xc7de('0x30')]+=moment(_0x222cf9[_0x56bee6][_0x13700b][_0xc7de('0x60')])[_0xc7de('0x5d')](moment(_0x222cf9[_0x56bee6][_0x13700b][_0xc7de('0x5c')]),'seconds')||0x0;}}else{_0xe6bc54[_0xc7de('0x4d')][_0x7478a8][_0xc7de('0x2f')]+=_0xe6bc54['voiceQueues'][_0x7478a8]['sumHoldTime']||0x0;}}}}}}return _0xe6bc54[_0xc7de('0x4d')];};};Realtime[_0xc7de('0x41')][_0xc7de('0x64')]=function(){var _0x61c042=this;return function(_0x12a9a8){clearVoiceCallReports(_0x61c042[_0xc7de('0x18')]);if(_0x12a9a8){for(var _0x5c9edc=0x0;_0x5c9edc<_0x12a9a8[_0xc7de('0x43')];_0x5c9edc+=0x1){_0x61c042[_0xc7de('0x18')][_0xc7de('0x2d')]+=0x1;_0x61c042[_0xc7de('0x18')][_0xc7de('0x2f')]+=_0x12a9a8[_0x5c9edc][_0xc7de('0x65')];if(_0x12a9a8[_0x5c9edc]['disposition']===_0xc7de('0x66')){_0x61c042[_0xc7de('0x18')]['answered']+=0x1;_0x61c042[_0xc7de('0x18')]['sumHoldTime']+=_0x12a9a8[_0x5c9edc][_0xc7de('0x65')]-_0x12a9a8[_0x5c9edc]['billableseconds']||0x0;_0x61c042[_0xc7de('0x18')][_0xc7de('0x30')]+=_0x12a9a8[_0x5c9edc][_0xc7de('0x67')];}}}return _0x61c042[_0xc7de('0x18')];};};Realtime['prototype']['initCampaigns']=function(){var _0xa1459f=this;return function(_0x406c3a){if(_0x406c3a){freeIsNotKey(_0x406c3a,_0xa1459f[_0xc7de('0x16')],'name');for(var _0x2f1dc8=0x0,_0x8b9b48={};_0x2f1dc8<_0x406c3a[_0xc7de('0x43')];_0x2f1dc8+=0x1){_0x8b9b48=_0x406c3a[_0x2f1dc8];if(_[_0xc7de('0x47')](_0xa1459f[_0xc7de('0x16')][_0x8b9b48['name']])){_0xa1459f[_0xc7de('0x16')][_0x8b9b48[_0xc7de('0x46')]]=new Campaign(_0x8b9b48);}else{_0xa1459f[_0xc7de('0x4a')](_0xa1459f[_0xc7de('0x16')][_0x8b9b48[_0xc7de('0x46')]],_0x8b9b48);_0xa1459f['campaigns'][_0x8b9b48['name']]['dialQueueProject']=_0x8b9b48[_0xc7de('0x68')]?_0x8b9b48[_0xc7de('0x68')][_0xc7de('0x46')]:undefined;}}}return _0xa1459f[_0xc7de('0x16')];};};Realtime['prototype'][_0xc7de('0x69')]=function(){var _0x3bb049=this;return function(_0x5a2838){if(_0x5a2838){freeIsNotKey(_0x5a2838,_0x3bb049['voiceExtensions'],'id');for(var _0x3704f2=0x0,_0x168162={};_0x3704f2<_0x5a2838[_0xc7de('0x43')];_0x3704f2+=0x1){_0x168162=_0x5a2838[_0x3704f2];if(_[_0xc7de('0x47')](_0x3bb049[_0xc7de('0x19')][_0x168162['id']])){_0x3bb049['voiceExtensions'][_0x168162['id']]=new VoiceExtension(_0x168162);}else{_0x3bb049[_0xc7de('0x4a')](_0x3bb049[_0xc7de('0x19')][_0x168162['id']],_0x168162);}}}return _0x3bb049[_0xc7de('0x19')];};};Realtime[_0xc7de('0x41')][_0xc7de('0x6a')]=function(){var _0x5c7fd1=this;return function(_0x2ccbfa){clearCampaigns(_0x5c7fd1[_0xc7de('0x16')]);for(var _0x1c7f57=0x0;_0x1c7f57<_0x2ccbfa[_0xc7de('0x43')];_0x1c7f57+=0x1){_[_0xc7de('0x57')](_0x5c7fd1[_0xc7de('0x16')][_0x2ccbfa[_0x1c7f57][_0xc7de('0x46')]],_0x2ccbfa[_0x1c7f57]);}return _0x5c7fd1[_0xc7de('0x16')];};};Realtime[_0xc7de('0x41')][_0xc7de('0x6b')]=function(){var _0x2aa71d=this;return function(_0x2916ad){if(_0x2916ad){freeIsNotKey(_0x2916ad,_0x2aa71d['faxAccounts'],'id');for(var _0x1b5fc2=0x0,_0x9a0a49={},_0x25f417={};_0x1b5fc2<_0x2916ad['length'];_0x1b5fc2+=0x1){_0x9a0a49=_0x2916ad[_0x1b5fc2];if(_[_0xc7de('0x47')](_0x2aa71d['faxAccounts'][_0x9a0a49['id']])){_0x2aa71d[_0xc7de('0x29')][_0x9a0a49['id']]=new FaxAccount(_0x9a0a49);}else{_0x2aa71d[_0xc7de('0x4a')](_0x2aa71d['faxAccounts'][_0x9a0a49['id']],_0x9a0a49);}}}return _0x2aa71d[_0xc7de('0x29')];};};module['exports']=Realtime; \ No newline at end of file +var _0xff49=['unmanaged','abandoned','sumHoldTime','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','name','isUndefined','initTelephones','initTrunks','initVoiceQueues','voiceQueues','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','uniqueid','queuecallerexit','queuecallerleaveAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','diff','queuecallerjoinAt','initVoiceCallReports','disposition','ANSWERED','billableseconds','SquareProject','initCampaignHopperHistory','util','lodash','../model/agent','../model/trunk','../model/voiceQueue','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','agents','telephones','trunks','triggers','campaigns','templates','outbound','voiceExtensions','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','isNil','interface','SIP/%s','answered','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','total'];(function(_0x241d5c,_0x5c3b55){var _0x491fd3=function(_0x546fb3){while(--_0x546fb3){_0x241d5c['push'](_0x241d5c['shift']());}};_0x491fd3(++_0x5c3b55);}(_0xff49,0x100));var _0x9ff4=function(_0x2abc3d,_0x48edca){_0x2abc3d=_0x2abc3d-0x0;var _0x252745=_0xff49[_0x2abc3d];return _0x252745;};'use strict';var BPromise=require('bluebird');var util=require(_0x9ff4('0x0'));var _=require(_0x9ff4('0x1'));var moment=require('moment');var Agent=require(_0x9ff4('0x2'));var Telephone=require('../model/telephone');var Trunk=require(_0x9ff4('0x3'));var VoiceQueue=require(_0x9ff4('0x4'));var Trigger=require('../model/trigger');var Template=require(_0x9ff4('0x5'));var Campaign=require(_0x9ff4('0x6'));var VoiceExtension=require(_0x9ff4('0x7'));var ZendeskAccount=require(_0x9ff4('0x8'));var SalesforceAccount=require(_0x9ff4('0x9'));var FreshdeskAccount=require(_0x9ff4('0xa'));var SugarcrmAccount=require(_0x9ff4('0xb'));var ZohoAccount=require(_0x9ff4('0xc'));var DeskAccount=require(_0x9ff4('0xd'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0x9ff4('0xe')]={};this[_0x9ff4('0xf')]={};this[_0x9ff4('0x10')]={};this['voiceQueues']={};this[_0x9ff4('0x11')]={};this[_0x9ff4('0x12')]={};this[_0x9ff4('0x13')]={};this[_0x9ff4('0x14')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x9ff4('0x15')]={};this['channels']={};this[_0x9ff4('0x16')]={};this[_0x9ff4('0x17')]={};this[_0x9ff4('0x18')]={};this[_0x9ff4('0x19')]={};this[_0x9ff4('0x1a')]={};this[_0x9ff4('0x1b')]={};this[_0x9ff4('0x1c')]={};this[_0x9ff4('0x1d')]={};this[_0x9ff4('0x1e')]={};this[_0x9ff4('0x1f')]={};this[_0x9ff4('0x20')]={};this[_0x9ff4('0x21')]={};this[_0x9ff4('0x22')]={};this[_0x9ff4('0x23')]={};this[_0x9ff4('0x24')]={};};function freeIsNotKey(_0x30e0a3,_0x2275e3,_0x2ab732){var _0x290161=_[_0x9ff4('0x25')](_0x30e0a3,function(_0x4bd1d6,_0x353366){return _0x4bd1d6[_0x2ab732];});for(var _0x1a8618 in _0x2275e3){if(_0x2275e3[_0x9ff4('0x26')](_0x1a8618)){if(!_0x290161[_0x1a8618]){delete _0x2275e3[_0x1a8618];}}}}function freeIsNotKeySip(_0x3b0aea,_0x2ec08e){var _0x315519=_[_0x9ff4('0x25')](_0x3b0aea,function(_0x15a78c,_0x323981){return util[_0x9ff4('0x27')]('SIP/%s',_0x15a78c['name']);});for(var _0x203417 in _0x2ec08e){if(_0x2ec08e[_0x9ff4('0x26')](_0x203417)){if(!_0x315519[_0x203417]){delete _0x2ec08e[_0x203417];}}}}function freeIsNotKeyAgent(_0x31c4cb,_0x5774de){var _0x53ac50=_[_0x9ff4('0x25')](_0x31c4cb,function(_0x2444d1,_0x38301c){var _0x357f31=_[_0x9ff4('0x28')](_0x2444d1[_0x9ff4('0x29')])?util['format'](_0x9ff4('0x2a'),_0x2444d1['name']):_0x2444d1['interface'];return _0x357f31;});for(var _0x411bda in _0x5774de){if(_0x5774de[_0x9ff4('0x26')](_0x411bda)){if(!_0x53ac50[_0x411bda]){delete _0x5774de[_0x411bda];}}}}function clearVoiceCallReports(_0xf137a2){_0xf137a2['total']=0x0;_0xf137a2[_0x9ff4('0x2b')]=0x0;_0xf137a2['sumHoldTime']=0x0;_0xf137a2[_0x9ff4('0x2c')]=0x0;_0xf137a2[_0x9ff4('0x2d')]=0x0;}function clearCampaigns(_0x40202a){if(!_[_0x9ff4('0x2e')](_0x40202a)){for(var _0x4b2180 in _0x40202a){if(_0x40202a['hasOwnProperty'](_0x4b2180)){_0x40202a[_0x4b2180][_0x9ff4('0x2f')]=0x0;_0x40202a[_0x4b2180][_0x9ff4('0x30')]=0x0;}}}}function clearVoiceQueues(_0xbe7ea6){if(!_['isEmpty'](_0xbe7ea6)){for(var _0x3ff1d2 in _0xbe7ea6){if(_0xbe7ea6[_0x9ff4('0x26')](_0x3ff1d2)){_0xbe7ea6[_0x3ff1d2][_0x9ff4('0x31')]=0x0;_0xbe7ea6[_0x3ff1d2][_0x9ff4('0x2b')]=0x0;_0xbe7ea6[_0x3ff1d2][_0x9ff4('0x32')]=0x0;_0xbe7ea6[_0x3ff1d2][_0x9ff4('0x33')]=0x0;_0xbe7ea6[_0x3ff1d2][_0x9ff4('0x34')]=0x0;_0xbe7ea6[_0x3ff1d2]['sumDuration']=0x0;_0xbe7ea6[_0x3ff1d2][_0x9ff4('0x2d')]=0x0;_0xbe7ea6[_0x3ff1d2][_0x9ff4('0x35')]=0x0;_0xbe7ea6[_0x3ff1d2]['outboundNoAnswerCallsDay']=0x0;_0xbe7ea6[_0x3ff1d2][_0x9ff4('0x36')]=0x0;_0xbe7ea6[_0x3ff1d2][_0x9ff4('0x37')]=0x0;_0xbe7ea6[_0x3ff1d2][_0x9ff4('0x38')]=0x0;_0xbe7ea6[_0x3ff1d2][_0x9ff4('0x39')]=0x0;_0xbe7ea6[_0x3ff1d2][_0x9ff4('0x3a')]=0x0;_0xbe7ea6[_0x3ff1d2][_0x9ff4('0x3b')]=0x0;_0xbe7ea6[_0x3ff1d2]['outboundBlacklistCallsDay']=0x0;_0xbe7ea6[_0x3ff1d2]['outboundOriginateFailureCallsDay']=0x0;_0xbe7ea6[_0x3ff1d2]['outboundRejectCallsDay']=0x0;_0xbe7ea6[_0x3ff1d2][_0x9ff4('0x3c')]=0x0;_0xbe7ea6[_0x3ff1d2]['outboundAnswerAgiCallsDay']=0x0;_0xbe7ea6[_0x3ff1d2][_0x9ff4('0x3d')]=0x0;_0xbe7ea6[_0x3ff1d2][_0x9ff4('0x3e')]=!![];}}}}Realtime[_0x9ff4('0x3f')][_0x9ff4('0x40')]=function(_0xb0d302,_0x23eb62){for(var _0x108d42 in _0x23eb62){if(_0xb0d302[_0x9ff4('0x26')](_0x108d42)){_0xb0d302[_0x108d42]=_0x23eb62[_0x108d42];}}};Realtime[_0x9ff4('0x3f')][_0x9ff4('0x41')]=function(){var _0x2bde9d=this;return function(_0x402036){if(_0x402036){freeIsNotKeyAgent(_0x402036,_0x2bde9d[_0x9ff4('0xe')]);for(var _0x20cd69=0x0,_0x17bdd3={},_0xd455c3={};_0x20cd69<_0x402036[_0x9ff4('0x42')];_0x20cd69+=0x1){_0x17bdd3=_0x402036[_0x20cd69];var _0x1a2f10=_['isNil'](_0x17bdd3[_0x9ff4('0x29')])?util['format'](_0x9ff4('0x2a'),_0x17bdd3[_0x9ff4('0x43')]):_0x17bdd3[_0x9ff4('0x29')];if(_[_0x9ff4('0x44')](_0x2bde9d[_0x9ff4('0xe')][_0x1a2f10])){_0x2bde9d['agents'][_0x1a2f10]=new Agent(_0x17bdd3);}else{_0x2bde9d[_0x9ff4('0x40')](_0x2bde9d[_0x9ff4('0xe')][_0x1a2f10],_0x17bdd3);}}}return _0x2bde9d[_0x9ff4('0xe')];};};Realtime[_0x9ff4('0x3f')][_0x9ff4('0x45')]=function(){var _0x51bc6d=this;return function(_0x3b7659){if(_0x3b7659){freeIsNotKeySip(_0x3b7659,_0x51bc6d['telephones']);for(var _0x35b9ab=0x0,_0x3ae34d={},_0x5b21ad={};_0x35b9ab<_0x3b7659[_0x9ff4('0x42')];_0x35b9ab+=0x1){_0x3ae34d=_0x3b7659[_0x35b9ab];if(_['isUndefined'](_0x51bc6d['telephones'][util[_0x9ff4('0x27')](_0x9ff4('0x2a'),_0x3ae34d['name'])])){_0x51bc6d[_0x9ff4('0xf')][util[_0x9ff4('0x27')](_0x9ff4('0x2a'),_0x3ae34d[_0x9ff4('0x43')])]=new Telephone(_0x3ae34d);}else{_0x51bc6d[_0x9ff4('0x40')](_0x51bc6d[_0x9ff4('0xf')][util[_0x9ff4('0x27')](_0x9ff4('0x2a'),_0x3ae34d[_0x9ff4('0x43')])],_0x3ae34d);}}}return _0x51bc6d[_0x9ff4('0xf')];};};Realtime[_0x9ff4('0x3f')][_0x9ff4('0x46')]=function(){var _0x424591=this;return function(_0x447ef2){if(_0x447ef2){freeIsNotKeySip(_0x447ef2,_0x424591[_0x9ff4('0x10')]);for(var _0x2aeb19=0x0,_0x44ba52={},_0x15b438={};_0x2aeb19<_0x447ef2[_0x9ff4('0x42')];_0x2aeb19+=0x1){_0x44ba52=_0x447ef2[_0x2aeb19];if(_['isUndefined'](_0x424591[_0x9ff4('0x10')][util[_0x9ff4('0x27')](_0x9ff4('0x2a'),_0x44ba52['name'])])){_0x424591['trunks'][util[_0x9ff4('0x27')]('SIP/%s',_0x44ba52[_0x9ff4('0x43')])]=new Trunk(_0x44ba52);}else{_0x424591[_0x9ff4('0x40')](_0x424591['trunks'][util[_0x9ff4('0x27')](_0x9ff4('0x2a'),_0x44ba52['name'])],_0x44ba52);}}}return _0x424591[_0x9ff4('0x10')];};};Realtime[_0x9ff4('0x3f')][_0x9ff4('0x47')]=function(){var _0x554a66=this;return function(_0x208816){if(_0x208816){freeIsNotKey(_0x208816,_0x554a66[_0x9ff4('0x48')],'name');for(var _0x56d3ce=0x0,_0x6bfc96={},_0x14e95d={};_0x56d3ce<_0x208816[_0x9ff4('0x42')];_0x56d3ce+=0x1){_0x6bfc96=_0x208816[_0x56d3ce];if(_[_0x9ff4('0x44')](_0x554a66['voiceQueues'][_0x6bfc96[_0x9ff4('0x43')]])){_0x554a66['voiceQueues'][_0x6bfc96['name']]=new VoiceQueue(_0x6bfc96);}else{_0x554a66['mergeFromDatabase'](_0x554a66['voiceQueues'][_0x6bfc96[_0x9ff4('0x43')]],_0x6bfc96);}}}return _0x554a66['voiceQueues'];};};Realtime[_0x9ff4('0x3f')][_0x9ff4('0x49')]=function(){var _0x126b4a=this;return function(_0x55fd32){if(_0x55fd32){freeIsNotKey(_0x55fd32,_0x126b4a['triggers'],'id');for(var _0x26411b=0x0,_0x3264ad={},_0x4e6d4b={};_0x26411b<_0x55fd32[_0x9ff4('0x42')];_0x26411b+=0x1){_0x3264ad=_0x55fd32[_0x26411b];if(_['isUndefined'](_0x126b4a['triggers'][_0x3264ad['id']])){_0x126b4a[_0x9ff4('0x11')][_0x3264ad['id']]=new Trigger(_0x3264ad);}else{_0x126b4a[_0x9ff4('0x40')](_0x126b4a['triggers'][_0x3264ad['id']],_0x3264ad);}}}return _0x126b4a['triggers'];};};Realtime[_0x9ff4('0x3f')][_0x9ff4('0x4a')]=function(){var _0x5195ed=this;return function(_0x40d809){if(_0x40d809){freeIsNotKey(_0x40d809,_0x5195ed[_0x9ff4('0x13')],'id');for(var _0x21d738=0x0,_0x5dc4a6={},_0x4328ed={};_0x21d738<_0x40d809[_0x9ff4('0x42')];_0x21d738+=0x1){_0x5dc4a6=_0x40d809[_0x21d738];if(_[_0x9ff4('0x44')](_0x5195ed['templates'][_0x5dc4a6['id']])){_0x5195ed['templates'][_0x5dc4a6['id']]=new Template(_0x5dc4a6);}else{_0x5195ed[_0x9ff4('0x40')](_0x5195ed[_0x9ff4('0x13')][_0x5dc4a6['id']],_0x5dc4a6);}}}return _0x5195ed[_0x9ff4('0x13')];};};Realtime[_0x9ff4('0x3f')][_0x9ff4('0x4b')]=function(){var _0x3f05e0=this;return function(_0x227d7a){if(_0x227d7a){freeIsNotKey(_0x227d7a,_0x3f05e0['zendeskAccounts'],'id');for(var _0x320ddc=0x0,_0x3847e1={},_0x1c5797={};_0x320ddc<_0x227d7a[_0x9ff4('0x42')];_0x320ddc+=0x1){_0x3847e1=_0x227d7a[_0x320ddc];if(_['isUndefined'](_0x3f05e0[_0x9ff4('0x1a')][_0x3847e1['id']])){_0x3f05e0[_0x9ff4('0x1a')][_0x3847e1['id']]=new ZendeskAccount(_0x3847e1);}else{_0x3f05e0[_0x9ff4('0x40')](_0x3f05e0['zendeskAccounts'][_0x3847e1['id']],_0x3847e1);}}}return _0x3f05e0[_0x9ff4('0x1a')];};};Realtime['prototype'][_0x9ff4('0x4c')]=function(){var _0x2c900a=this;return function(_0x5d5a41){if(_0x5d5a41){freeIsNotKey(_0x5d5a41,_0x2c900a[_0x9ff4('0x1b')],'id');for(var _0x34f391=0x0,_0x55adcf={},_0x5ab252={};_0x34f391<_0x5d5a41[_0x9ff4('0x42')];_0x34f391+=0x1){_0x55adcf=_0x5d5a41[_0x34f391];if(_[_0x9ff4('0x44')](_0x2c900a[_0x9ff4('0x1b')][_0x55adcf['id']])){_0x2c900a['salesforceAccounts'][_0x55adcf['id']]=new SalesforceAccount(_0x55adcf);}else{_0x2c900a[_0x9ff4('0x40')](_0x2c900a[_0x9ff4('0x1b')][_0x55adcf['id']],_0x55adcf);}}}return _0x2c900a[_0x9ff4('0x1b')];};};Realtime[_0x9ff4('0x3f')][_0x9ff4('0x4d')]=function(){var _0x55c60c=this;return function(_0x3cb9a7){if(_0x3cb9a7){freeIsNotKey(_0x3cb9a7,_0x55c60c[_0x9ff4('0x1d')],'id');for(var _0x42c8f6=0x0,_0x35f226={},_0x58b070={};_0x42c8f6<_0x3cb9a7['length'];_0x42c8f6+=0x1){_0x35f226=_0x3cb9a7[_0x42c8f6];if(_[_0x9ff4('0x44')](_0x55c60c['freshdeskAccounts'][_0x35f226['id']])){_0x55c60c['freshdeskAccounts'][_0x35f226['id']]=new FreshdeskAccount(_0x35f226);}else{_0x55c60c[_0x9ff4('0x40')](_0x55c60c['freshdeskAccounts'][_0x35f226['id']],_0x35f226);}}}return _0x55c60c[_0x9ff4('0x1d')];};};Realtime[_0x9ff4('0x3f')][_0x9ff4('0x4e')]=function(){var _0x2f2d55=this;return function(_0x35c73a){if(_0x35c73a){freeIsNotKey(_0x35c73a,_0x2f2d55[_0x9ff4('0x1e')],'id');for(var _0x23b456=0x0,_0x1e593e={},_0x2de465={};_0x23b456<_0x35c73a[_0x9ff4('0x42')];_0x23b456+=0x1){_0x1e593e=_0x35c73a[_0x23b456];if(_[_0x9ff4('0x44')](_0x2f2d55[_0x9ff4('0x1e')][_0x1e593e['id']])){_0x2f2d55[_0x9ff4('0x1e')][_0x1e593e['id']]=new ZohoAccount(_0x1e593e);}else{_0x2f2d55[_0x9ff4('0x40')](_0x2f2d55[_0x9ff4('0x1e')][_0x1e593e['id']],_0x1e593e);}}}return _0x2f2d55[_0x9ff4('0x1e')];};};Realtime[_0x9ff4('0x3f')][_0x9ff4('0x4f')]=function(){var _0x1bc007=this;return function(_0x131a37){if(_0x131a37){freeIsNotKey(_0x131a37,_0x1bc007[_0x9ff4('0x1f')],'id');for(var _0x7e4c81=0x0,_0x40d040={},_0x4c18bf={};_0x7e4c81<_0x131a37[_0x9ff4('0x42')];_0x7e4c81+=0x1){_0x40d040=_0x131a37[_0x7e4c81];if(_[_0x9ff4('0x44')](_0x1bc007[_0x9ff4('0x1f')][_0x40d040['id']])){_0x1bc007[_0x9ff4('0x1f')][_0x40d040['id']]=new DeskAccount(_0x40d040);}else{_0x1bc007[_0x9ff4('0x40')](_0x1bc007['deskAccounts'][_0x40d040['id']],_0x40d040);}}}return _0x1bc007[_0x9ff4('0x1f')];};};Realtime['prototype'][_0x9ff4('0x50')]=function(){var _0x41b48b=this;return function(_0x5718d2){if(_0x5718d2){freeIsNotKey(_0x5718d2,_0x41b48b[_0x9ff4('0x1c')],'id');for(var _0x32d1c8=0x0,_0x4e69e9={},_0x321f75={};_0x32d1c8<_0x5718d2[_0x9ff4('0x42')];_0x32d1c8+=0x1){_0x4e69e9=_0x5718d2[_0x32d1c8];if(_[_0x9ff4('0x44')](_0x41b48b[_0x9ff4('0x1c')][_0x4e69e9['id']])){_0x41b48b[_0x9ff4('0x1c')][_0x4e69e9['id']]=new SugarcrmAccount(_0x4e69e9);}else{_0x41b48b[_0x9ff4('0x40')](_0x41b48b[_0x9ff4('0x1c')][_0x4e69e9['id']],_0x4e69e9);}}}return _0x41b48b[_0x9ff4('0x1c')];};};Realtime[_0x9ff4('0x3f')][_0x9ff4('0x51')]=function(){var _0x2f293e=this;return function(_0x27f520){if(_0x27f520){freeIsNotKey(_0x27f520,_0x2f293e[_0x9ff4('0x20')],'id');for(var _0x586c7e=0x0,_0x28df91={},_0x43b478={};_0x586c7e<_0x27f520['length'];_0x586c7e+=0x1){_0x28df91=_0x27f520[_0x586c7e];if(_['isUndefined'](_0x2f293e[_0x9ff4('0x20')][_0x28df91['id']])){_0x2f293e[_0x9ff4('0x20')][_0x28df91['id']]=new VtigerAccount(_0x28df91);}else{_0x2f293e[_0x9ff4('0x40')](_0x2f293e['vtigerAccounts'][_0x28df91['id']],_0x28df91);}}}return _0x2f293e[_0x9ff4('0x20')];};};Realtime[_0x9ff4('0x3f')][_0x9ff4('0x52')]=function(){var _0x2a09e9=this;return function(_0x18eb4c){if(_0x18eb4c){freeIsNotKey(_0x18eb4c,_0x2a09e9[_0x9ff4('0x21')],'id');for(var _0x4a07e3=0x0,_0xe069fb={},_0x5d032d={};_0x4a07e3<_0x18eb4c['length'];_0x4a07e3+=0x1){_0xe069fb=_0x18eb4c[_0x4a07e3];if(_[_0x9ff4('0x44')](_0x2a09e9[_0x9ff4('0x21')][_0xe069fb['id']])){_0x2a09e9[_0x9ff4('0x21')][_0xe069fb['id']]=new ServicenowAccount(_0xe069fb);}else{_0x2a09e9[_0x9ff4('0x40')](_0x2a09e9[_0x9ff4('0x21')][_0xe069fb['id']],_0xe069fb);}}}return _0x2a09e9[_0x9ff4('0x21')];};};Realtime[_0x9ff4('0x3f')]['initDynamics365Accounts']=function(){var _0x14cc3f=this;return function(_0xc9278e){if(_0xc9278e){freeIsNotKey(_0xc9278e,_0x14cc3f['dynamics365Accounts'],'id');for(var _0x90e7a6=0x0,_0x3c765a={},_0x23065c={};_0x90e7a6<_0xc9278e[_0x9ff4('0x42')];_0x90e7a6+=0x1){_0x3c765a=_0xc9278e[_0x90e7a6];if(_[_0x9ff4('0x44')](_0x14cc3f[_0x9ff4('0x22')][_0x3c765a['id']])){_0x14cc3f['dynamics365Accounts'][_0x3c765a['id']]=new Dynamics365Account(_0x3c765a);}else{_0x14cc3f[_0x9ff4('0x40')](_0x14cc3f[_0x9ff4('0x22')][_0x3c765a['id']],_0x3c765a);}}}return _0x14cc3f[_0x9ff4('0x22')];};};Realtime[_0x9ff4('0x3f')][_0x9ff4('0x53')]=function(){var _0x259aca=this;return function(_0x4c21df){if(_0x4c21df){freeIsNotKey(_0x4c21df,_0x259aca[_0x9ff4('0x23')],'id');for(var _0x509eca=0x0,_0x55252c={},_0x2ed51e={};_0x509eca<_0x4c21df['length'];_0x509eca+=0x1){_0x55252c=_0x4c21df[_0x509eca];if(_[_0x9ff4('0x44')](_0x259aca[_0x9ff4('0x23')][_0x55252c['id']])){_0x259aca[_0x9ff4('0x23')][_0x55252c['id']]=new FreshsalesAccount(_0x55252c);}else{_0x259aca[_0x9ff4('0x40')](_0x259aca[_0x9ff4('0x23')][_0x55252c['id']],_0x55252c);}}}return _0x259aca[_0x9ff4('0x23')];};};Realtime[_0x9ff4('0x3f')][_0x9ff4('0x54')]=function(){var _0x7c1be9=this;return function(_0x4e4550){for(var _0x2e52ea=0x0;_0x2e52ea<_0x4e4550[_0x9ff4('0x42')];_0x2e52ea+=0x1){_[_0x9ff4('0x55')](_0x7c1be9[_0x9ff4('0x48')][_0x4e4550[_0x2e52ea]['name']],_0x4e4550[_0x2e52ea]);}return _0x7c1be9['voiceQueues'];};};Realtime[_0x9ff4('0x3f')][_0x9ff4('0x56')]=function(){var _0x3c4946=this;return function(_0x5cff75){clearVoiceQueues(_0x3c4946[_0x9ff4('0x48')]);if(_0x5cff75){_0x5cff75=_['groupBy'](_0x5cff75,_0x9ff4('0x57'));for(var _0x450999 in _0x5cff75){if(_0x5cff75[_0x9ff4('0x26')](_0x450999)){var _0x537885={};for(var _0x2020d9=0x0;_0x2020d9<_0x5cff75[_0x450999]['length'];_0x2020d9+=0x1){var _0x2d4c4f=_0x5cff75[_0x450999][_0x2020d9]['queue'];if(_0x3c4946[_0x9ff4('0x48')][_0x2d4c4f]){if(_0x5cff75[_0x450999][_0x2020d9][_0x9ff4('0x58')]){_0x3c4946[_0x9ff4('0x48')][_0x2d4c4f][_0x9ff4('0x32')]+=0x1;}if(_0x5cff75[_0x450999][_0x2020d9]['queuecallerabandon']){_0x3c4946[_0x9ff4('0x48')][_0x2d4c4f]['abandoned']+=0x1;}_0x3c4946[_0x9ff4('0x48')][_0x2d4c4f]['sumHoldTime']+=moment(_0x5cff75[_0x450999][_0x2020d9][_0x9ff4('0x59')])['diff'](moment(_0x5cff75[_0x450999][_0x2020d9]['queuecallerjoinAt']),_0x9ff4('0x5a'))||0x0;if(_0x2020d9===_0x5cff75[_0x450999]['length']-0x1){_0x3c4946['voiceQueues'][_0x2d4c4f][_0x9ff4('0x2c')]+=moment(_0x5cff75[_0x450999][_0x2020d9][_0x9ff4('0x5b')]||_0x5cff75[_0x450999][_0x2020d9][_0x9ff4('0x5c')]||_0x5cff75[_0x450999][_0x2020d9][_0x9ff4('0x5d')])[_0x9ff4('0x5e')](moment(_0x5cff75[_0x450999][_0x2020d9][_0x9ff4('0x5f')]),_0x9ff4('0x5a'))||0x0;_0x3c4946[_0x9ff4('0x48')][_0x2d4c4f]['total']+=0x1;if(_0x5cff75[_0x450999][_0x2020d9]['queuecallercomplete']){_0x3c4946[_0x9ff4('0x48')][_0x2d4c4f]['answered']+=0x1;_0x3c4946[_0x9ff4('0x48')][_0x2d4c4f][_0x9ff4('0x2d')]+=moment(_0x5cff75[_0x450999][_0x2020d9][_0x9ff4('0x5b')])[_0x9ff4('0x5e')](moment(_0x5cff75[_0x450999][_0x2020d9][_0x9ff4('0x59')]),_0x9ff4('0x5a'))||0x0;}}else{_0x3c4946['voiceQueues'][_0x2d4c4f][_0x9ff4('0x2c')]+=_0x3c4946['voiceQueues'][_0x2d4c4f][_0x9ff4('0x34')]||0x0;}}}}}}return _0x3c4946[_0x9ff4('0x48')];};};Realtime[_0x9ff4('0x3f')][_0x9ff4('0x60')]=function(){var _0x1e8f26=this;return function(_0x5d8f53){clearVoiceCallReports(_0x1e8f26[_0x9ff4('0x14')]);if(_0x5d8f53){for(var _0x4522ae=0x0;_0x4522ae<_0x5d8f53[_0x9ff4('0x42')];_0x4522ae+=0x1){_0x1e8f26[_0x9ff4('0x14')][_0x9ff4('0x31')]+=0x1;_0x1e8f26[_0x9ff4('0x14')][_0x9ff4('0x2c')]+=_0x5d8f53[_0x4522ae]['duration'];if(_0x5d8f53[_0x4522ae][_0x9ff4('0x61')]===_0x9ff4('0x62')){_0x1e8f26[_0x9ff4('0x14')][_0x9ff4('0x2b')]+=0x1;_0x1e8f26[_0x9ff4('0x14')][_0x9ff4('0x34')]+=_0x5d8f53[_0x4522ae]['duration']-_0x5d8f53[_0x4522ae]['billableseconds']||0x0;_0x1e8f26[_0x9ff4('0x14')]['sumBillable']+=_0x5d8f53[_0x4522ae][_0x9ff4('0x63')];}}}return _0x1e8f26[_0x9ff4('0x14')];};};Realtime['prototype']['initCampaigns']=function(){var _0x583544=this;return function(_0x2d505e){if(_0x2d505e){freeIsNotKey(_0x2d505e,_0x583544['campaigns'],'name');for(var _0x48e324=0x0,_0xec91c9={};_0x48e324<_0x2d505e['length'];_0x48e324+=0x1){_0xec91c9=_0x2d505e[_0x48e324];if(_[_0x9ff4('0x44')](_0x583544['campaigns'][_0xec91c9['name']])){_0x583544[_0x9ff4('0x12')][_0xec91c9['name']]=new Campaign(_0xec91c9);}else{_0x583544[_0x9ff4('0x40')](_0x583544[_0x9ff4('0x12')][_0xec91c9[_0x9ff4('0x43')]],_0xec91c9);_0x583544[_0x9ff4('0x12')][_0xec91c9[_0x9ff4('0x43')]]['dialQueueProject']=_0xec91c9[_0x9ff4('0x64')]?_0xec91c9['SquareProject'][_0x9ff4('0x43')]:undefined;}}}return _0x583544['campaigns'];};};Realtime[_0x9ff4('0x3f')]['initVoiceExtensions']=function(){var _0x4b95b3=this;return function(_0x487ffa){if(_0x487ffa){freeIsNotKey(_0x487ffa,_0x4b95b3[_0x9ff4('0x15')],'id');for(var _0x1b4c79=0x0,_0x79feb9={};_0x1b4c79<_0x487ffa['length'];_0x1b4c79+=0x1){_0x79feb9=_0x487ffa[_0x1b4c79];if(_[_0x9ff4('0x44')](_0x4b95b3['voiceExtensions'][_0x79feb9['id']])){_0x4b95b3[_0x9ff4('0x15')][_0x79feb9['id']]=new VoiceExtension(_0x79feb9);}else{_0x4b95b3[_0x9ff4('0x40')](_0x4b95b3[_0x9ff4('0x15')][_0x79feb9['id']],_0x79feb9);}}}return _0x4b95b3[_0x9ff4('0x15')];};};Realtime[_0x9ff4('0x3f')][_0x9ff4('0x65')]=function(){var _0x1ef601=this;return function(_0x5a84c0){clearCampaigns(_0x1ef601[_0x9ff4('0x12')]);for(var _0x5c1967=0x0;_0x5c1967<_0x5a84c0['length'];_0x5c1967+=0x1){_[_0x9ff4('0x55')](_0x1ef601[_0x9ff4('0x12')][_0x5a84c0[_0x5c1967]['name']],_0x5a84c0[_0x5c1967]);}return _0x1ef601[_0x9ff4('0x12')];};};Realtime[_0x9ff4('0x3f')]['initFaxAccounts']=function(){var _0x38c249=this;return function(_0x4a4d51){if(_0x4a4d51){freeIsNotKey(_0x4a4d51,_0x38c249[_0x9ff4('0x24')],'id');for(var _0x2b2070=0x0,_0x56ebfe={},_0xbd8727={};_0x2b2070<_0x4a4d51['length'];_0x2b2070+=0x1){_0x56ebfe=_0x4a4d51[_0x2b2070];if(_[_0x9ff4('0x44')](_0x38c249[_0x9ff4('0x24')][_0x56ebfe['id']])){_0x38c249[_0x9ff4('0x24')][_0x56ebfe['id']]=new FaxAccount(_0x56ebfe);}else{_0x38c249[_0x9ff4('0x40')](_0x38c249[_0x9ff4('0x24')][_0x56ebfe['id']],_0x56ebfe);}}}return _0x38c249[_0x9ff4('0x24')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 57b05a0..ee2437b 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 _0xccc6=['dialer','lastapplication','queue','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','originatecalleridnum','destinationchannel','channel','calleridpreview','calleridnum','disposition','ANSWERED','connectedlinenum','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','monitors','monitorFilename','filename','createdAt','membername','xcally-motion-dialer','forEach','startsWith','substring','indexOf','mobile','phone','lastIndexOf','exports','lodash','moment','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceAgentReport','./voiceDialReport','./userReport','agents','telephones','prototype','realtime','xdr','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','name','interface','length','assigned','lastAssignedTo','format','SIP/%s','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','YYYY-MM-DD\x20HH:mm:ss','create','destination','exten','type'];(function(_0x1f01e9,_0x47e086){var _0x265f36=function(_0x2f7910){while(--_0x2f7910){_0x1f01e9['push'](_0x1f01e9['shift']());}};_0x265f36(++_0x47e086);}(_0xccc6,0x17f));var _0x6ccc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xccc6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6ccc('0x0'));var moment=require(_0x6ccc('0x1'));var util=require('util');var config=require(_0x6ccc('0x2'));var ami=require(_0x6ccc('0x3'));var RpcVoiceAgentReport=require(_0x6ccc('0x4'));var RpcVoiceCallReport=require(_0x6ccc('0x5'));var RpcVoiceDialReport=require(_0x6ccc('0x6'));var RpcMemberReport=require(_0x6ccc('0x7'));var RpcVoiceQueueReport=require(_0x6ccc('0x8'));var RpcVoiceRecording=require(_0x6ccc('0x9'));var RpcVoiceTransferReport=require(_0x6ccc('0xa'));var VoiceQueueReport=require(_0x6ccc('0xb'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0x6ccc('0xc'));var VoiceDialReport=require(_0x6ccc('0xd'));var UserReport=require(_0x6ccc('0xe'));function Report(_0x48f5be){this['realtime']=_0x48f5be;this['agents']=_0x48f5be[_0x6ccc('0xf')];this[_0x6ccc('0x10')]=_0x48f5be[_0x6ccc('0x10')];}Report[_0x6ccc('0x11')]['sync']=function(_0xb03e4c){var _0x23b0d4=new VoiceQueueReport(this[_0x6ccc('0x12')]);var _0x54c657=new VoiceAgentReport(this[_0x6ccc('0x12')]);var _0x172ce7=new VoiceDialReport(this[_0x6ccc('0x12')]);var _0x4af370=new VoiceCallReport(this[_0x6ccc('0x12')]);var _0x3c159b=new UserReport(this[_0x6ccc('0x12')]);if(config[_0x6ccc('0x13')]&&config[_0x6ccc('0x13')]['disabled']){ami['on'](_0x6ccc('0x14'),this[_0x6ccc('0x15')][_0x6ccc('0x16')](this));ami['on'](_0x6ccc('0x17'),this[_0x6ccc('0x18')][_0x6ccc('0x16')](this));ami['on'](_0x6ccc('0x19'),this[_0x6ccc('0x1a')][_0x6ccc('0x16')](this));ami['on'](_0x6ccc('0x1b'),this[_0x6ccc('0x1c')][_0x6ccc('0x16')](this));ami['on'](_0x6ccc('0x1d'),this[_0x6ccc('0x1e')][_0x6ccc('0x16')](this));ami['on'](_0x6ccc('0x1f'),this[_0x6ccc('0x20')][_0x6ccc('0x16')](this));}};Report[_0x6ccc('0x11')][_0x6ccc('0x21')]=function(_0x3323bd){var _0x3de2dd;_0x3de2dd=_[_0x6ccc('0x22')](this['agents'],function(_0x3e2c1c){return _0x3e2c1c[_0x6ccc('0x23')]==_0x3323bd||_0x3e2c1c['name']==_0x3323bd;});if(_['isNil'](_0x3de2dd)){var _0x1c8262=_[_0x6ccc('0x22')](this[_0x6ccc('0x10')],function(_0x84a211){return _0x84a211['accountcode']==_0x3323bd||_0x84a211[_0x6ccc('0x24')]==_0x3323bd;});if(_0x1c8262){_0x3de2dd=_['find'](this[_0x6ccc('0xf')],function(_0x55875e){return _0x55875e[_0x6ccc('0x25')]==util['format']('SIP/%s',_0x1c8262[_0x6ccc('0x24')]);});}}return _0x3de2dd;};Report[_0x6ccc('0x11')]['voiceQueueReport']=function(_0x421e44){for(var _0xdf78f6=0x0;_0xdf78f6<_0x421e44[_0x6ccc('0x26')];_0xdf78f6+=0x1){var _0x29218a=this[_0x6ccc('0x21')](_0x421e44[_0xdf78f6]['connectedlinenum']);if(_0x29218a){_0x421e44[_0xdf78f6][_0x6ccc('0x23')]=_0x29218a[_0x6ccc('0x23')];_0x421e44[_0xdf78f6][_0x6ccc('0x27')]=!![];_0x421e44[_0xdf78f6][_0x6ccc('0x28')]=_0x29218a[_0x6ccc('0x24')];_0x421e44[_0xdf78f6]['interface']=_['isNil'](_0x29218a[_0x6ccc('0x25')])?util[_0x6ccc('0x29')](_0x6ccc('0x2a'),_0x29218a['name']):_0x29218a[_0x6ccc('0x25')];if(_0x421e44[_0xdf78f6][_0x6ccc('0x2b')]){_0x421e44[_0xdf78f6][_0x6ccc('0x2c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x421e44[_0xdf78f6][_0x6ccc('0x2d')]){_0x421e44[_0xdf78f6][_0x6ccc('0x2e')]=moment()[_0x6ccc('0x29')](_0x6ccc('0x2f'));}RpcMemberReport['voiceQueueReport'](_0x421e44[_0xdf78f6]);}RpcVoiceQueueReport[_0x6ccc('0x30')](_0x421e44[_0xdf78f6]);}};function extractCalleridNumber(_0x25c236){var _0x2303fd=_0x25c236['match'](/<(.*?)>/);return _0x2303fd?_0x2303fd[0x1]:_0x25c236;}Report['prototype'][_0x6ccc('0x18')]=function(_0x21d505){_0x21d505['destination']=_0x21d505[_0x6ccc('0x31')]||_0x21d505[_0x6ccc('0x32')];if(_0x21d505[_0x6ccc('0x33')]==_0x6ccc('0x34')){_0x21d505[_0x6ccc('0x35')]=_0x6ccc('0x36');_0x21d505[_0x6ccc('0x37')]=_0x21d505[_0x6ccc('0x36')];if(_0x21d505[_0x6ccc('0x38')]==_0x6ccc('0x39')){_0x21d505[_0x6ccc('0x23')]='';_0x21d505[_0x6ccc('0x31')]=extractCalleridNumber(_0x21d505[_0x6ccc('0x3a')]);}else if(_0x21d505[_0x6ccc('0x38')]==_0x6ccc('0x3b')){if(_0x21d505[_0x6ccc('0x31')]==_0x6ccc('0x3c')){_0x21d505[_0x6ccc('0x31')]=extractCalleridNumber(_0x21d505['calleridpreview']);_0x21d505['calleridnum']=_0x21d505[_0x6ccc('0x3d')];_0x21d505[_0x6ccc('0x3e')]=[_0x21d505[_0x6ccc('0x3f')],_0x21d505['channel']=_0x21d505['destinationchannel']][0x0];_0x21d505[_0x6ccc('0x3a')]=_0x21d505[_0x6ccc('0x40')];}else{_0x21d505['destination']=_0x21d505[_0x6ccc('0x41')];_0x21d505[_0x6ccc('0x41')]=_0x21d505[_0x6ccc('0x3d')];if(_0x21d505[_0x6ccc('0x42')]==_0x6ccc('0x43')){_0x21d505[_0x6ccc('0x23')]=_0x21d505[_0x6ccc('0x44')];}else{_0x21d505[_0x6ccc('0x23')]='';}}}}else{_0x21d505[_0x6ccc('0x3a')]=util['format'](_0x6ccc('0x45'),_0x21d505[_0x6ccc('0x46')],_0x21d505[_0x6ccc('0x41')]);}if(RpcVoiceTransferReport[_0x6ccc('0x47')][_0x21d505[_0x6ccc('0x48')]]){var _0x50d8c1=RpcVoiceTransferReport[_0x6ccc('0x47')][_0x21d505[_0x6ccc('0x48')]];_0x50d8c1['transfereelinkedid']=_0x21d505['uniqueid'];RpcVoiceTransferReport['blindTransfer'](_0x50d8c1);delete RpcVoiceTransferReport['transfers'][_0x21d505['linkedid']];}RpcVoiceCallReport[_0x6ccc('0x30')](_0x21d505);if(_0x21d505['monitor']){for(var _0x13ce6a=0x0;_0x13ce6a<_0x21d505[_0x6ccc('0x49')][_0x6ccc('0x26')];_0x13ce6a+=0x1){_0x21d505[_0x6ccc('0x4a')]=_0x21d505[_0x6ccc('0x49')][_0x13ce6a][_0x6ccc('0x4b')];_0x21d505[_0x6ccc('0x4c')]=_0x21d505['monitors'][_0x13ce6a][_0x6ccc('0x4c')];if(_0x21d505[_0x6ccc('0x32')]=='xcally-motion-preview'){_0x21d505['calleridnum']=_0x21d505['connectedlinenum'];_0x21d505[_0x6ccc('0x46')]=_0x21d505['connectedlinename'];_0x21d505['connectedlinenum']=_0x21d505['accountcode'];_0x21d505['connectedlinename']=_0x21d505[_0x6ccc('0x4d')];_0x21d505['exten']=_0x21d505[_0x6ccc('0x3d')];}else if(_0x21d505[_0x6ccc('0x32')]==_0x6ccc('0x4e')){_0x21d505[_0x6ccc('0x41')]=_0x21d505[_0x6ccc('0x31')];_0x21d505[_0x6ccc('0x32')]=_0x21d505[_0x6ccc('0x3d')];}RpcVoiceRecording['create'](_0x21d505);}}};Report[_0x6ccc('0x11')]['voiceAgentReport']=function(_0x3dd010){if(_['isArray'](_0x3dd010)){_0x3dd010[_0x6ccc('0x4f')](function(_0x37aee6){RpcVoiceAgentReport['create'](_0x37aee6);});}else{RpcVoiceAgentReport[_0x6ccc('0x30')](_0x3dd010);}};Report[_0x6ccc('0x11')][_0x6ccc('0x1c')]=function(_0x7f0648){RpcVoiceDialReport[_0x6ccc('0x30')](_0x7f0648);var _0x4d96a9;var _0x512991;var _0x281124=_0x7f0648[_0x6ccc('0x3f')];if(_[_0x6ccc('0x50')](_0x281124,'Local')){_0x512991=_0x281124[_0x6ccc('0x51')](_0x281124[_0x6ccc('0x52')]('/')+0x1,_0x281124[_0x6ccc('0x52')]('@'));_0x4d96a9=_[_0x6ccc('0x22')](this[_0x6ccc('0xf')],function(_0x3fb5f3){return _0x3fb5f3[_0x6ccc('0x53')]==_0x512991||_0x3fb5f3[_0x6ccc('0x54')]==_0x512991||_0x3fb5f3[_0x6ccc('0x23')]==_0x512991;});}else{_0x512991=_0x281124[_0x6ccc('0x51')](_0x281124[_0x6ccc('0x52')]('/')+0x1,_0x281124[_0x6ccc('0x55')]('-'));_0x4d96a9=this[_0x6ccc('0x21')](_0x512991);}if(_0x4d96a9){_0x7f0648[_0x6ccc('0x25')]=_['isNil'](_0x4d96a9[_0x6ccc('0x25')])?util['format'](_0x6ccc('0x2a'),_0x4d96a9[_0x6ccc('0x24')]):_0x4d96a9[_0x6ccc('0x25')];_0x7f0648[_0x6ccc('0x4d')]=_0x4d96a9[_0x6ccc('0x24')];_0x7f0648[_0x6ccc('0x23')]=_0x4d96a9[_0x6ccc('0x23')];RpcMemberReport['voiceDialReport'](_0x7f0648);}};Report[_0x6ccc('0x11')][_0x6ccc('0x1e')]=function(_0x22b21d){RpcVoiceTransferReport['transfers'][_0x22b21d['transfererlinkedid']]=_0x22b21d;};Report[_0x6ccc('0x11')][_0x6ccc('0x20')]=function(_0x5d89cb){RpcVoiceTransferReport[_0x6ccc('0x20')](_0x5d89cb);};module[_0x6ccc('0x56')]=Report; \ No newline at end of file +var _0x281e=['disabled','custom:voiceQueueReport','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','blindtransfer','bind','attendedtransfer','attendedTransfer','findAgent','accountcode','name','isNil','find','interface','format','SIP/%s','voiceQueueReport','length','connectedlinenum','lastAssignedTo','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','destination','dialer','lastapplication','lastdata','queue','context','from-voip-provider','callerid','from-sip','calleridnum','originatecalleridnum','destinationchannel','channel','disposition','calleridname','linkedid','transfers','transfereelinkedid','uniqueid','blindTransfer','create','monitor','monitors','monitorFilename','filename','createdAt','exten','xcally-motion-preview','connectedlinename','voiceDialReport','substring','indexOf','phone','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./userReport','realtime','agents','telephones','prototype','xdr'];(function(_0x10b64e,_0x3cb8bb){var _0x35ff06=function(_0x595cec){while(--_0x595cec){_0x10b64e['push'](_0x10b64e['shift']());}};_0x35ff06(++_0x3cb8bb);}(_0x281e,0x1cd));var _0xe281=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0x281e[_0x2261ce];return _0x524640;};'use strict';var _=require(_0xe281('0x0'));var moment=require(_0xe281('0x1'));var util=require(_0xe281('0x2'));var config=require(_0xe281('0x3'));var ami=require(_0xe281('0x4'));var RpcVoiceAgentReport=require(_0xe281('0x5'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0xe281('0x6'));var RpcMemberReport=require(_0xe281('0x7'));var RpcVoiceQueueReport=require(_0xe281('0x8'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0xe281('0x9'));var VoiceQueueReport=require(_0xe281('0xa'));var VoiceCallReport=require(_0xe281('0xb'));var VoiceAgentReport=require(_0xe281('0xc'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0xe281('0xd'));function Report(_0x40fff2){this[_0xe281('0xe')]=_0x40fff2;this[_0xe281('0xf')]=_0x40fff2[_0xe281('0xf')];this[_0xe281('0x10')]=_0x40fff2['telephones'];}Report[_0xe281('0x11')]['sync']=function(_0x24649f){var _0x77a514=new VoiceQueueReport(this['realtime']);var _0x34c987=new VoiceAgentReport(this[_0xe281('0xe')]);var _0x526c42=new VoiceDialReport(this['realtime']);var _0x39a5e4=new VoiceCallReport(this['realtime']);var _0x480340=new UserReport(this[_0xe281('0xe')]);if(config[_0xe281('0x12')]&&config[_0xe281('0x12')][_0xe281('0x13')]){ami['on'](_0xe281('0x14'),this['voiceQueueReport']['bind'](this));ami['on'](_0xe281('0x15'),this[_0xe281('0x16')]['bind'](this));ami['on'](_0xe281('0x17'),this[_0xe281('0x18')]['bind'](this));ami['on']('custom:voiceDialReport',this['voiceDialReport']['bind'](this));ami['on'](_0xe281('0x19'),this['blindTransfer'][_0xe281('0x1a')](this));ami['on'](_0xe281('0x1b'),this[_0xe281('0x1c')]['bind'](this));}};Report[_0xe281('0x11')][_0xe281('0x1d')]=function(_0x40ee63){var _0x1e0ce9;_0x1e0ce9=_['find'](this[_0xe281('0xf')],function(_0x33148f){return _0x33148f[_0xe281('0x1e')]==_0x40ee63||_0x33148f[_0xe281('0x1f')]==_0x40ee63;});if(_[_0xe281('0x20')](_0x1e0ce9)){var _0xb57337=_[_0xe281('0x21')](this[_0xe281('0x10')],function(_0x4d4d4e){return _0x4d4d4e[_0xe281('0x1e')]==_0x40ee63||_0x4d4d4e[_0xe281('0x1f')]==_0x40ee63;});if(_0xb57337){_0x1e0ce9=_[_0xe281('0x21')](this[_0xe281('0xf')],function(_0x214833){return _0x214833[_0xe281('0x22')]==util[_0xe281('0x23')](_0xe281('0x24'),_0xb57337['name']);});}}return _0x1e0ce9;};Report[_0xe281('0x11')][_0xe281('0x25')]=function(_0x45db07){for(var _0x27d0b5=0x0;_0x27d0b5<_0x45db07[_0xe281('0x26')];_0x27d0b5+=0x1){var _0x2dedcb=this['findAgent'](_0x45db07[_0x27d0b5][_0xe281('0x27')]);if(_0x2dedcb){_0x45db07[_0x27d0b5][_0xe281('0x1e')]=_0x2dedcb[_0xe281('0x1e')];_0x45db07[_0x27d0b5]['assigned']=!![];_0x45db07[_0x27d0b5][_0xe281('0x28')]=_0x2dedcb[_0xe281('0x1f')];_0x45db07[_0x27d0b5]['interface']=_[_0xe281('0x20')](_0x2dedcb[_0xe281('0x22')])?util[_0xe281('0x23')](_0xe281('0x24'),_0x2dedcb[_0xe281('0x1f')]):_0x2dedcb[_0xe281('0x22')];if(_0x45db07[_0x27d0b5][_0xe281('0x29')]){_0x45db07[_0x27d0b5][_0xe281('0x2a')]=moment()[_0xe281('0x23')](_0xe281('0x2b'));}if(_0x45db07[_0x27d0b5][_0xe281('0x2c')]){_0x45db07[_0x27d0b5][_0xe281('0x2d')]=moment()[_0xe281('0x23')](_0xe281('0x2b'));}RpcMemberReport[_0xe281('0x25')](_0x45db07[_0x27d0b5]);}RpcVoiceQueueReport['create'](_0x45db07[_0x27d0b5]);}};function extractCalleridNumber(_0x9ace54){var _0x31e056=_0x9ace54['match'](/<(.*?)>/);return _0x31e056?_0x31e056[0x1]:_0x9ace54;}Report[_0xe281('0x11')][_0xe281('0x16')]=function(_0x57f91f){_0x57f91f[_0xe281('0x2e')]=_0x57f91f['destination']||_0x57f91f['exten'];if(_0x57f91f['type']==_0xe281('0x2f')){_0x57f91f[_0xe281('0x30')]='queue';_0x57f91f[_0xe281('0x31')]=_0x57f91f[_0xe281('0x32')];if(_0x57f91f[_0xe281('0x33')]==_0xe281('0x34')){_0x57f91f[_0xe281('0x1e')]='';_0x57f91f[_0xe281('0x2e')]=extractCalleridNumber(_0x57f91f[_0xe281('0x35')]);}else if(_0x57f91f[_0xe281('0x33')]==_0xe281('0x36')){if(_0x57f91f['destination']=='xcally-motion-preview'){_0x57f91f[_0xe281('0x2e')]=extractCalleridNumber(_0x57f91f['calleridpreview']);_0x57f91f[_0xe281('0x37')]=_0x57f91f[_0xe281('0x38')];_0x57f91f[_0xe281('0x39')]=[_0x57f91f[_0xe281('0x3a')],_0x57f91f[_0xe281('0x3a')]=_0x57f91f[_0xe281('0x39')]][0x0];_0x57f91f['callerid']=_0x57f91f['calleridpreview'];}else{_0x57f91f[_0xe281('0x2e')]=_0x57f91f['calleridnum'];_0x57f91f['calleridnum']=_0x57f91f['originatecalleridnum'];if(_0x57f91f[_0xe281('0x3b')]=='ANSWERED'){_0x57f91f[_0xe281('0x1e')]=_0x57f91f[_0xe281('0x27')];}else{_0x57f91f[_0xe281('0x1e')]='';}}}}else{_0x57f91f[_0xe281('0x35')]=util[_0xe281('0x23')]('\x22%s\x22\x20<%s>',_0x57f91f[_0xe281('0x3c')],_0x57f91f[_0xe281('0x37')]);}if(RpcVoiceTransferReport['transfers'][_0x57f91f[_0xe281('0x3d')]]){var _0x3c01d5=RpcVoiceTransferReport[_0xe281('0x3e')][_0x57f91f[_0xe281('0x3d')]];_0x3c01d5[_0xe281('0x3f')]=_0x57f91f[_0xe281('0x40')];RpcVoiceTransferReport[_0xe281('0x41')](_0x3c01d5);delete RpcVoiceTransferReport[_0xe281('0x3e')][_0x57f91f[_0xe281('0x3d')]];}RpcVoiceCallReport[_0xe281('0x42')](_0x57f91f);if(_0x57f91f[_0xe281('0x43')]){for(var _0x3e7676=0x0;_0x3e7676<_0x57f91f[_0xe281('0x44')][_0xe281('0x26')];_0x3e7676+=0x1){_0x57f91f[_0xe281('0x45')]=_0x57f91f[_0xe281('0x44')][_0x3e7676][_0xe281('0x46')];_0x57f91f[_0xe281('0x47')]=_0x57f91f['monitors'][_0x3e7676]['createdAt'];if(_0x57f91f[_0xe281('0x48')]==_0xe281('0x49')){_0x57f91f[_0xe281('0x37')]=_0x57f91f[_0xe281('0x27')];_0x57f91f[_0xe281('0x3c')]=_0x57f91f['connectedlinename'];_0x57f91f['connectedlinenum']=_0x57f91f[_0xe281('0x1e')];_0x57f91f[_0xe281('0x4a')]=_0x57f91f['membername'];_0x57f91f[_0xe281('0x48')]=_0x57f91f['originatecalleridnum'];}else if(_0x57f91f[_0xe281('0x48')]=='xcally-motion-dialer'){_0x57f91f[_0xe281('0x37')]=_0x57f91f[_0xe281('0x2e')];_0x57f91f['exten']=_0x57f91f['originatecalleridnum'];}RpcVoiceRecording[_0xe281('0x42')](_0x57f91f);}}};Report[_0xe281('0x11')][_0xe281('0x18')]=function(_0x2c7518){if(_['isArray'](_0x2c7518)){_0x2c7518['forEach'](function(_0x209d91){RpcVoiceAgentReport[_0xe281('0x42')](_0x209d91);});}else{RpcVoiceAgentReport[_0xe281('0x42')](_0x2c7518);}};Report[_0xe281('0x11')][_0xe281('0x4b')]=function(_0x2d182d){RpcVoiceDialReport['create'](_0x2d182d);var _0x512458;var _0x257c91;var _0x1371a5=_0x2d182d['channel'];if(_['startsWith'](_0x1371a5,'Local')){_0x257c91=_0x1371a5[_0xe281('0x4c')](_0x1371a5[_0xe281('0x4d')]('/')+0x1,_0x1371a5[_0xe281('0x4d')]('@'));_0x512458=_['find'](this[_0xe281('0xf')],function(_0x17d701){return _0x17d701['mobile']==_0x257c91||_0x17d701[_0xe281('0x4e')]==_0x257c91||_0x17d701[_0xe281('0x1e')]==_0x257c91;});}else{_0x257c91=_0x1371a5[_0xe281('0x4c')](_0x1371a5[_0xe281('0x4d')]('/')+0x1,_0x1371a5['lastIndexOf']('-'));_0x512458=this[_0xe281('0x1d')](_0x257c91);}if(_0x512458){_0x2d182d[_0xe281('0x22')]=_['isNil'](_0x512458[_0xe281('0x22')])?util[_0xe281('0x23')](_0xe281('0x24'),_0x512458[_0xe281('0x1f')]):_0x512458[_0xe281('0x22')];_0x2d182d['membername']=_0x512458[_0xe281('0x1f')];_0x2d182d[_0xe281('0x1e')]=_0x512458[_0xe281('0x1e')];RpcMemberReport[_0xe281('0x4b')](_0x2d182d);}};Report[_0xe281('0x11')]['blindTransfer']=function(_0x516e03){RpcVoiceTransferReport['transfers'][_0x516e03['transfererlinkedid']]=_0x516e03;};Report['prototype'][_0xe281('0x1c')]=function(_0x2f22b4){RpcVoiceTransferReport[_0xe281('0x1c')](_0x2f22b4);};module[_0xe281('0x4f')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 27c6b46..c6ae240 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 _0xbf26=['state','omit','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','trunk:%s','name','trunk:save','syncDeviceState','[userReport][devicestatechange]\x20device:%s\x20state:%s','debug','[userReport][devicestatechange]','device','toLowerCase','inuse','local','stateTime','toNumber','format','updateStatusRealtime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','Local','substring','indexOf','phone','accountcode','peer','address','[userReport][peerstatus]','registered','status','peerstatus','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','moment','ioredis','bluebird','../../../config/environment','../../../config/logger','../ami','redis','defaults','localhost','trunks','agents','telephones','registryentry','syncRegistry','bind','syncRealtimeShow','resolve','actionSipShowRegistry','catch','[userReport][sipshowregistry]','inspect','then','actionDeviceStateList','error','[userReport][devicestatelist]','[userReport][sippeerstatus]','prototype','isNotNull','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','username','[userReport][registry]','find','stateRegistry'];(function(_0x57d978,_0xb66619){var _0x1eca77=function(_0x2aba2e){while(--_0x2aba2e){_0x57d978['push'](_0x57d978['shift']());}};_0x1eca77(++_0xb66619);}(_0xbf26,0x198));var _0x6bf2=function(_0x1adf7b,_0x3309c7){_0x1adf7b=_0x1adf7b-0x0;var _0x1dc12b=_0xbf26[_0x1adf7b];return _0x1dc12b;};'use strict';var _=require(_0x6bf2('0x0'));var moment=require(_0x6bf2('0x1'));var util=require('util');var Redis=require(_0x6bf2('0x2'));var BPromise=require(_0x6bf2('0x3'));var config=require(_0x6bf2('0x4'));var logger=require(_0x6bf2('0x5'))('ami');var ami=require(_0x6bf2('0x6'));config[_0x6bf2('0x7')]=_[_0x6bf2('0x8')](config['redis'],{'host':_0x6bf2('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function UserReport(_0x12ebe1){this['trunks']=_0x12ebe1[_0x6bf2('0xa')];this[_0x6bf2('0xb')]=_0x12ebe1['agents'];this['telephones']=_0x12ebe1[_0x6bf2('0xc')];ami['on'](_0x6bf2('0xd'),this[_0x6bf2('0xe')]['bind'](this));ami['on']('registry',this[_0x6bf2('0xe')][_0x6bf2('0xf')](this));ami['on']('devicestatechange',this['syncDeviceState'][_0x6bf2('0xf')](this));ami['on']('peerstatus',this['syncPeerStatus'][_0x6bf2('0xf')](this));return this[_0x6bf2('0x10')]();}function showSipRegistrations(){Promise[_0x6bf2('0x11')]()['then'](ami[_0x6bf2('0x12')]())[_0x6bf2('0x13')](function(_0x33fa94){logger['error'](_0x6bf2('0x14'),util[_0x6bf2('0x15')](_0x33fa94,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x6bf2('0x11')]()[_0x6bf2('0x16')](ami[_0x6bf2('0x17')]())[_0x6bf2('0x13')](function(_0x30abdf){logger[_0x6bf2('0x18')](_0x6bf2('0x19'),util[_0x6bf2('0x15')](_0x30abdf,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x6bf2('0x11')]()['then'](ami['actionSipPeerStatus']())[_0x6bf2('0x13')](function(_0x3eaf55){logger['error'](_0x6bf2('0x1a'),util['inspect'](_0x3eaf55,{'showHidden':![],'depth':null}));});}UserReport[_0x6bf2('0x1b')][_0x6bf2('0x10')]=function(){setInterval(function(){BPromise['resolve']()[_0x6bf2('0x16')](showSipRegistrations())[_0x6bf2('0x16')](listDeviceStates())[_0x6bf2('0x16')](showPeersStatus());},0x32c8);};UserReport['prototype'][_0x6bf2('0x1c')]=function(_0x340413){return _0x340413!==null&&!_['isUndefined'](_0x340413);};UserReport[_0x6bf2('0x1b')][_0x6bf2('0x1d')]=function(_0x2f1242,_0x1fac2d,_0x35fd47){io['to'](_0x2f1242)['emit'](_0x1fac2d,_0x35fd47);};UserReport[_0x6bf2('0x1b')][_0x6bf2('0xe')]=function(_0x4b59a2){try{if(this[_0x6bf2('0x1c')](_0x4b59a2)){logger[_0x6bf2('0x1e')](_0x6bf2('0x1f'),_0x4b59a2[_0x6bf2('0x20')],_0x4b59a2['state']);logger['debug'](_0x6bf2('0x21'),util[_0x6bf2('0x15')](_0x4b59a2,{'showHidden':![],'depth':null}));var _0x36c115=_[_0x6bf2('0x22')](this['trunks'],{'defaultuser':_0x4b59a2[_0x6bf2('0x20')]});if(_0x36c115){_0x4b59a2[_0x6bf2('0x23')]=_0x4b59a2[_0x6bf2('0x24')];_['merge'](_0x36c115,_[_0x6bf2('0x25')](_0x4b59a2,[_0x6bf2('0x26'),_0x6bf2('0x27'),_0x6bf2('0x20'),'state']));logger['debug'](_0x6bf2('0x28'),util[_0x6bf2('0x15')](_0x36c115,{'showHidden':![],'depth':null}));this[_0x6bf2('0x1d')](util['format'](_0x6bf2('0x29'),_0x36c115[_0x6bf2('0x2a')]),_0x6bf2('0x2b'),_0x36c115);}}}catch(_0xea89e9){logger[_0x6bf2('0x18')](_0x6bf2('0x21'),util[_0x6bf2('0x15')](_0xea89e9,{'showHidden':![],'depth':null}));}};UserReport[_0x6bf2('0x1b')][_0x6bf2('0x2c')]=function(_0x193960){try{if(this[_0x6bf2('0x1c')](_0x193960)){logger[_0x6bf2('0x1e')](_0x6bf2('0x2d'),_0x193960['device'],_0x193960[_0x6bf2('0x24')]);logger[_0x6bf2('0x2e')](_0x6bf2('0x2f'),util[_0x6bf2('0x15')](_0x193960,{'showHidden':![],'depth':null}));if(this[_0x6bf2('0xb')][_0x193960['device']]){if(!this[_0x6bf2('0xb')][_0x193960[_0x6bf2('0x30')]]['local']||_0x193960[_0x6bf2('0x24')][_0x6bf2('0x31')]()==_0x6bf2('0x32')){this[_0x6bf2('0xb')][_0x193960['device']][_0x6bf2('0x33')]=![];if(this[_0x6bf2('0xb')][_0x193960[_0x6bf2('0x30')]][_0x6bf2('0x24')]!==_0x193960[_0x6bf2('0x24')][_0x6bf2('0x31')]()){this['agents'][_0x193960[_0x6bf2('0x30')]][_0x6bf2('0x34')]=_[_0x6bf2('0x35')](moment()[_0x6bf2('0x36')]('x'));}this[_0x6bf2('0xb')][_0x193960[_0x6bf2('0x30')]][_0x6bf2('0x24')]=_0x193960[_0x6bf2('0x24')][_0x6bf2('0x31')]();this[_0x6bf2('0xb')][_0x193960['device']][_0x6bf2('0x37')](_0x193960);}}else if(this[_0x6bf2('0xc')][_0x193960['device']]){if(this['telephones'][_0x193960[_0x6bf2('0x30')]][_0x6bf2('0x24')]!==_0x193960[_0x6bf2('0x24')][_0x6bf2('0x31')]()){this['telephones'][_0x193960[_0x6bf2('0x30')]][_0x6bf2('0x34')]=_[_0x6bf2('0x35')](moment()[_0x6bf2('0x36')]('x'));}this[_0x6bf2('0xc')][_0x193960[_0x6bf2('0x30')]][_0x6bf2('0x24')]=_0x193960[_0x6bf2('0x24')][_0x6bf2('0x31')]();logger[_0x6bf2('0x2e')](_0x6bf2('0x38'),util[_0x6bf2('0x15')](this[_0x6bf2('0xc')][_0x193960['device']],{'showHidden':![],'depth':null}));this['emit'](util[_0x6bf2('0x36')](_0x6bf2('0x39'),this['telephones'][_0x193960['device']][_0x6bf2('0x2a')]),_0x6bf2('0x3a'),this[_0x6bf2('0xc')][_0x193960[_0x6bf2('0x30')]]);}else if(this['trunks'][_0x193960[_0x6bf2('0x30')]]){if(this['trunks'][_0x193960[_0x6bf2('0x30')]][_0x6bf2('0x24')]!==_0x193960[_0x6bf2('0x24')][_0x6bf2('0x31')]()){this[_0x6bf2('0xa')][_0x193960[_0x6bf2('0x30')]][_0x6bf2('0x34')]=_[_0x6bf2('0x35')](moment()['format']('x'));}this[_0x6bf2('0xa')][_0x193960[_0x6bf2('0x30')]][_0x6bf2('0x24')]=_0x193960[_0x6bf2('0x24')][_0x6bf2('0x31')]();logger[_0x6bf2('0x2e')](_0x6bf2('0x3b'),util['inspect'](this['trunks'][_0x193960[_0x6bf2('0x30')]],{'showHidden':![],'depth':null}));this[_0x6bf2('0x1d')](util[_0x6bf2('0x36')](_0x6bf2('0x29'),this[_0x6bf2('0xa')][_0x193960['device']][_0x6bf2('0x2a')]),_0x6bf2('0x2b'),this[_0x6bf2('0xa')][_0x193960[_0x6bf2('0x30')]]);}else if(_['startsWith'](_0x193960[_0x6bf2('0x30')],_0x6bf2('0x3c'))){var _0x161b8c=_0x193960[_0x6bf2('0x30')];var _0x2238dd=_0x161b8c[_0x6bf2('0x3d')](_0x161b8c[_0x6bf2('0x3e')]('/')+0x1,_0x161b8c['indexOf']('@'));var _0x2f38a9=_['find'](this[_0x6bf2('0xb')],function(_0x30a4bb){return _0x30a4bb['mobile']==_0x2238dd||_0x30a4bb[_0x6bf2('0x3f')]==_0x2238dd||_0x30a4bb[_0x6bf2('0x40')]==_0x2238dd;});if(_0x2f38a9){if(_0x2f38a9['state']!==_0x193960[_0x6bf2('0x24')][_0x6bf2('0x31')]()){_0x2f38a9[_0x6bf2('0x34')]=_[_0x6bf2('0x35')](moment()[_0x6bf2('0x36')]('x'));}_0x2f38a9[_0x6bf2('0x24')]=_0x193960[_0x6bf2('0x24')][_0x6bf2('0x31')]();_0x2f38a9['local']=!![];_0x2f38a9['updateStatusRealtime'](_0x193960);}}}}catch(_0x488299){logger['error']('[userReport][devicestatechange]',util[_0x6bf2('0x15')](_0x488299,{'showHidden':![],'depth':null}));}};UserReport['prototype']['syncPeerStatus']=function(_0x4a4f52){try{if(this[_0x6bf2('0x1c')](_0x4a4f52)&&this[_0x6bf2('0x1c')](_0x4a4f52['peerstatus'])){logger[_0x6bf2('0x1e')]('[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s',_0x4a4f52[_0x6bf2('0x41')],_0x4a4f52[_0x6bf2('0x42')],_0x4a4f52['peerstatus']);logger[_0x6bf2('0x2e')](_0x6bf2('0x43'),util[_0x6bf2('0x15')](_0x4a4f52,{'showHidden':![],'depth':null}));if(this[_0x6bf2('0xb')][_0x4a4f52['peer']]){if(!this[_0x6bf2('0xb')][_0x4a4f52[_0x6bf2('0x41')]][_0x6bf2('0x33')]||_0x4a4f52['peerstatus'][_0x6bf2('0x31')]()==_0x6bf2('0x44')){this['agents'][_0x4a4f52[_0x6bf2('0x41')]][_0x6bf2('0x33')]=![];this[_0x6bf2('0xb')][_0x4a4f52[_0x6bf2('0x41')]][_0x6bf2('0x45')]=_0x4a4f52[_0x6bf2('0x46')][_0x6bf2('0x31')]();this['agents'][_0x4a4f52[_0x6bf2('0x41')]]['address']=_0x4a4f52[_0x6bf2('0x42')];this[_0x6bf2('0xb')][_0x4a4f52[_0x6bf2('0x41')]][_0x6bf2('0x37')](_0x4a4f52);}}else if(this['telephones'][_0x4a4f52['peer']]){this[_0x6bf2('0xc')][_0x4a4f52['peer']][_0x6bf2('0x45')]=_0x4a4f52['peerstatus'][_0x6bf2('0x31')]();this[_0x6bf2('0xc')][_0x4a4f52[_0x6bf2('0x41')]]['address']=_0x4a4f52[_0x6bf2('0x42')];logger[_0x6bf2('0x2e')](_0x6bf2('0x47'),util[_0x6bf2('0x15')](this[_0x6bf2('0xc')][_0x4a4f52[_0x6bf2('0x41')]],{'showHidden':![],'depth':null}));this[_0x6bf2('0x1d')](util[_0x6bf2('0x36')]('telephone:%s',this[_0x6bf2('0xc')][_0x4a4f52[_0x6bf2('0x41')]][_0x6bf2('0x2a')]),_0x6bf2('0x3a'),this[_0x6bf2('0xc')][_0x4a4f52[_0x6bf2('0x41')]]);}else if(this['trunks'][_0x4a4f52['peer']]){this[_0x6bf2('0xa')][_0x4a4f52[_0x6bf2('0x41')]][_0x6bf2('0x45')]=_0x4a4f52[_0x6bf2('0x46')]['toLowerCase']();this[_0x6bf2('0xa')][_0x4a4f52[_0x6bf2('0x41')]]['address']=_0x4a4f52['address'];logger[_0x6bf2('0x2e')](_0x6bf2('0x48'),util[_0x6bf2('0x15')](this[_0x6bf2('0xa')][_0x4a4f52[_0x6bf2('0x41')]],{'showHidden':![],'depth':null}));this[_0x6bf2('0x1d')](util[_0x6bf2('0x36')](_0x6bf2('0x29'),this[_0x6bf2('0xa')][_0x4a4f52[_0x6bf2('0x41')]][_0x6bf2('0x2a')]),_0x6bf2('0x2b'),this['trunks'][_0x4a4f52[_0x6bf2('0x41')]]);}}}catch(_0x3f7f57){logger['error'](_0x6bf2('0x43'),util[_0x6bf2('0x15')](_0x3f7f57,{'showHidden':![],'depth':null}));}};module[_0x6bf2('0x49')]=UserReport; \ No newline at end of file +var _0x308c=['defaults','localhost','trunks','agents','syncRegistry','registry','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','bind','syncRealtimeShow','resolve','then','actionSipShowRegistry','catch','[userReport][sipshowregistry]','error','[userReport][devicestatelist]','inspect','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isNotNull','username','state','debug','[userReport][registry]','find','stateRegistry','merge','omit','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','emit','format','trunk:%s','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','inuse','toLowerCase','stateTime','toNumber','telephones','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','name','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','trunk:save','Local','indexOf','mobile','phone','accountcode','updateStatusRealtime','info','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','[userReport][peerstatus]','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','telephone:%s','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','lodash','moment','util','ioredis','../../../config/environment','ami','../ami','redis'];(function(_0x36cee2,_0x37dfce){var _0x1a1ef1=function(_0x4d2a3d){while(--_0x4d2a3d){_0x36cee2['push'](_0x36cee2['shift']());}};_0x1a1ef1(++_0x37dfce);}(_0x308c,0x1c0));var _0xc308=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x308c[_0x36ed48];return _0x51c63a;};'use strict';var _=require(_0xc308('0x0'));var moment=require(_0xc308('0x1'));var util=require(_0xc308('0x2'));var Redis=require(_0xc308('0x3'));var BPromise=require('bluebird');var config=require(_0xc308('0x4'));var logger=require('../../../config/logger')(_0xc308('0x5'));var ami=require(_0xc308('0x6'));config[_0xc308('0x7')]=_[_0xc308('0x8')](config['redis'],{'host':_0xc308('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc308('0x7')]));function UserReport(_0x34603d){this['trunks']=_0x34603d[_0xc308('0xa')];this['agents']=_0x34603d[_0xc308('0xb')];this['telephones']=_0x34603d['telephones'];ami['on']('registryentry',this[_0xc308('0xc')]['bind'](this));ami['on'](_0xc308('0xd'),this['syncRegistry']['bind'](this));ami['on'](_0xc308('0xe'),this[_0xc308('0xf')]['bind'](this));ami['on'](_0xc308('0x10'),this[_0xc308('0x11')][_0xc308('0x12')](this));return this[_0xc308('0x13')]();}function showSipRegistrations(){Promise[_0xc308('0x14')]()[_0xc308('0x15')](ami[_0xc308('0x16')]())[_0xc308('0x17')](function(_0x8e6e0b){logger['error'](_0xc308('0x18'),util['inspect'](_0x8e6e0b,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0xc308('0x14')]()[_0xc308('0x15')](ami['actionDeviceStateList']())[_0xc308('0x17')](function(_0x4f419e){logger[_0xc308('0x19')](_0xc308('0x1a'),util[_0xc308('0x1b')](_0x4f419e,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xc308('0x14')]()[_0xc308('0x15')](ami[_0xc308('0x1c')]())[_0xc308('0x17')](function(_0x500bac){logger[_0xc308('0x19')](_0xc308('0x1d'),util[_0xc308('0x1b')](_0x500bac,{'showHidden':![],'depth':null}));});}UserReport[_0xc308('0x1e')]['syncRealtimeShow']=function(){setInterval(function(){BPromise['resolve']()[_0xc308('0x15')](showSipRegistrations())[_0xc308('0x15')](listDeviceStates())[_0xc308('0x15')](showPeersStatus());},0x32c8);};UserReport[_0xc308('0x1e')]['isNotNull']=function(_0x196b16){return _0x196b16!==null&&!_['isUndefined'](_0x196b16);};UserReport[_0xc308('0x1e')]['emit']=function(_0x56d457,_0x1c81a5,_0x2734ee){io['to'](_0x56d457)['emit'](_0x1c81a5,_0x2734ee);};UserReport[_0xc308('0x1e')]['syncRegistry']=function(_0x27ab28){try{if(this[_0xc308('0x1f')](_0x27ab28)){logger['info']('[userReport][registry]\x20registry:%s\x20state:%s',_0x27ab28[_0xc308('0x20')],_0x27ab28[_0xc308('0x21')]);logger[_0xc308('0x22')](_0xc308('0x23'),util[_0xc308('0x1b')](_0x27ab28,{'showHidden':![],'depth':null}));var _0x8b167d=_[_0xc308('0x24')](this['trunks'],{'defaultuser':_0x27ab28[_0xc308('0x20')]});if(_0x8b167d){_0x27ab28[_0xc308('0x25')]=_0x27ab28[_0xc308('0x21')];_[_0xc308('0x26')](_0x8b167d,_[_0xc308('0x27')](_0x27ab28,[_0xc308('0x28'),_0xc308('0x29'),_0xc308('0x20'),_0xc308('0x21')]));logger[_0xc308('0x22')](_0xc308('0x2a'),util[_0xc308('0x1b')](_0x8b167d,{'showHidden':![],'depth':null}));this[_0xc308('0x2b')](util[_0xc308('0x2c')](_0xc308('0x2d'),_0x8b167d['name']),'trunk:save',_0x8b167d);}}}catch(_0x542fa6){logger[_0xc308('0x19')]('[userReport][registry]',util[_0xc308('0x1b')](_0x542fa6,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0xc308('0xf')]=function(_0xedaeb5){try{if(this[_0xc308('0x1f')](_0xedaeb5)){logger['info'](_0xc308('0x2e'),_0xedaeb5[_0xc308('0x2f')],_0xedaeb5[_0xc308('0x21')]);logger[_0xc308('0x22')](_0xc308('0x30'),util[_0xc308('0x1b')](_0xedaeb5,{'showHidden':![],'depth':null}));if(this['agents'][_0xedaeb5['device']]){if(!this[_0xc308('0xb')][_0xedaeb5['device']][_0xc308('0x31')]||_0xedaeb5[_0xc308('0x21')]['toLowerCase']()==_0xc308('0x32')){this[_0xc308('0xb')][_0xedaeb5[_0xc308('0x2f')]]['local']=![];if(this['agents'][_0xedaeb5[_0xc308('0x2f')]][_0xc308('0x21')]!==_0xedaeb5[_0xc308('0x21')][_0xc308('0x33')]()){this[_0xc308('0xb')][_0xedaeb5[_0xc308('0x2f')]][_0xc308('0x34')]=_[_0xc308('0x35')](moment()[_0xc308('0x2c')]('x'));}this[_0xc308('0xb')][_0xedaeb5[_0xc308('0x2f')]][_0xc308('0x21')]=_0xedaeb5[_0xc308('0x21')][_0xc308('0x33')]();this['agents'][_0xedaeb5[_0xc308('0x2f')]]['updateStatusRealtime'](_0xedaeb5);}}else if(this[_0xc308('0x36')][_0xedaeb5[_0xc308('0x2f')]]){if(this[_0xc308('0x36')][_0xedaeb5[_0xc308('0x2f')]][_0xc308('0x21')]!==_0xedaeb5[_0xc308('0x21')]['toLowerCase']()){this['telephones'][_0xedaeb5[_0xc308('0x2f')]][_0xc308('0x34')]=_[_0xc308('0x35')](moment()[_0xc308('0x2c')]('x'));}this[_0xc308('0x36')][_0xedaeb5[_0xc308('0x2f')]][_0xc308('0x21')]=_0xedaeb5[_0xc308('0x21')][_0xc308('0x33')]();logger[_0xc308('0x22')](_0xc308('0x37'),util[_0xc308('0x1b')](this[_0xc308('0x36')][_0xedaeb5['device']],{'showHidden':![],'depth':null}));this[_0xc308('0x2b')](util[_0xc308('0x2c')]('telephone:%s',this['telephones'][_0xedaeb5[_0xc308('0x2f')]][_0xc308('0x38')]),_0xc308('0x39'),this[_0xc308('0x36')][_0xedaeb5[_0xc308('0x2f')]]);}else if(this[_0xc308('0xa')][_0xedaeb5[_0xc308('0x2f')]]){if(this[_0xc308('0xa')][_0xedaeb5[_0xc308('0x2f')]]['state']!==_0xedaeb5[_0xc308('0x21')]['toLowerCase']()){this[_0xc308('0xa')][_0xedaeb5[_0xc308('0x2f')]][_0xc308('0x34')]=_[_0xc308('0x35')](moment()[_0xc308('0x2c')]('x'));}this[_0xc308('0xa')][_0xedaeb5['device']][_0xc308('0x21')]=_0xedaeb5[_0xc308('0x21')][_0xc308('0x33')]();logger[_0xc308('0x22')](_0xc308('0x3a'),util[_0xc308('0x1b')](this[_0xc308('0xa')][_0xedaeb5['device']],{'showHidden':![],'depth':null}));this[_0xc308('0x2b')](util['format'](_0xc308('0x2d'),this['trunks'][_0xedaeb5[_0xc308('0x2f')]][_0xc308('0x38')]),_0xc308('0x3b'),this[_0xc308('0xa')][_0xedaeb5['device']]);}else if(_['startsWith'](_0xedaeb5[_0xc308('0x2f')],_0xc308('0x3c'))){var _0x59b95b=_0xedaeb5['device'];var _0x15f0bc=_0x59b95b['substring'](_0x59b95b[_0xc308('0x3d')]('/')+0x1,_0x59b95b[_0xc308('0x3d')]('@'));var _0x2570da=_[_0xc308('0x24')](this[_0xc308('0xb')],function(_0x3533f5){return _0x3533f5[_0xc308('0x3e')]==_0x15f0bc||_0x3533f5[_0xc308('0x3f')]==_0x15f0bc||_0x3533f5[_0xc308('0x40')]==_0x15f0bc;});if(_0x2570da){if(_0x2570da[_0xc308('0x21')]!==_0xedaeb5[_0xc308('0x21')]['toLowerCase']()){_0x2570da[_0xc308('0x34')]=_[_0xc308('0x35')](moment()[_0xc308('0x2c')]('x'));}_0x2570da[_0xc308('0x21')]=_0xedaeb5[_0xc308('0x21')]['toLowerCase']();_0x2570da[_0xc308('0x31')]=!![];_0x2570da[_0xc308('0x41')](_0xedaeb5);}}}}catch(_0x4acb0e){logger[_0xc308('0x19')]('[userReport][devicestatechange]',util['inspect'](_0x4acb0e,{'showHidden':![],'depth':null}));}};UserReport[_0xc308('0x1e')]['syncPeerStatus']=function(_0x41360c){try{if(this[_0xc308('0x1f')](_0x41360c)&&this[_0xc308('0x1f')](_0x41360c[_0xc308('0x10')])){logger[_0xc308('0x42')](_0xc308('0x43'),_0x41360c[_0xc308('0x44')],_0x41360c[_0xc308('0x45')],_0x41360c[_0xc308('0x10')]);logger[_0xc308('0x22')](_0xc308('0x46'),util[_0xc308('0x1b')](_0x41360c,{'showHidden':![],'depth':null}));if(this['agents'][_0x41360c[_0xc308('0x44')]]){if(!this[_0xc308('0xb')][_0x41360c[_0xc308('0x44')]][_0xc308('0x31')]||_0x41360c[_0xc308('0x10')]['toLowerCase']()==_0xc308('0x47')){this[_0xc308('0xb')][_0x41360c[_0xc308('0x44')]][_0xc308('0x31')]=![];this[_0xc308('0xb')][_0x41360c['peer']]['status']=_0x41360c[_0xc308('0x10')][_0xc308('0x33')]();this[_0xc308('0xb')][_0x41360c[_0xc308('0x44')]][_0xc308('0x45')]=_0x41360c[_0xc308('0x45')];this['agents'][_0x41360c[_0xc308('0x44')]][_0xc308('0x41')](_0x41360c);}}else if(this[_0xc308('0x36')][_0x41360c['peer']]){this['telephones'][_0x41360c[_0xc308('0x44')]][_0xc308('0x48')]=_0x41360c[_0xc308('0x10')][_0xc308('0x33')]();this['telephones'][_0x41360c['peer']][_0xc308('0x45')]=_0x41360c[_0xc308('0x45')];logger[_0xc308('0x22')](_0xc308('0x49'),util['inspect'](this[_0xc308('0x36')][_0x41360c[_0xc308('0x44')]],{'showHidden':![],'depth':null}));this[_0xc308('0x2b')](util['format'](_0xc308('0x4a'),this[_0xc308('0x36')][_0x41360c[_0xc308('0x44')]]['name']),'telephone:save',this[_0xc308('0x36')][_0x41360c[_0xc308('0x44')]]);}else if(this[_0xc308('0xa')][_0x41360c[_0xc308('0x44')]]){this[_0xc308('0xa')][_0x41360c[_0xc308('0x44')]][_0xc308('0x48')]=_0x41360c['peerstatus']['toLowerCase']();this[_0xc308('0xa')][_0x41360c[_0xc308('0x44')]]['address']=_0x41360c['address'];logger[_0xc308('0x22')](_0xc308('0x4b'),util[_0xc308('0x1b')](this[_0xc308('0xa')][_0x41360c['peer']],{'showHidden':![],'depth':null}));this[_0xc308('0x2b')](util[_0xc308('0x2c')](_0xc308('0x2d'),this[_0xc308('0xa')][_0x41360c['peer']][_0xc308('0x38')]),_0xc308('0x3b'),this[_0xc308('0xa')][_0x41360c[_0xc308('0x44')]]);}}}catch(_0x3d9a1a){logger[_0xc308('0x19')]('[userReport][peerstatus]',util[_0xc308('0x1b')](_0x3d9a1a,{'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 c0f5e62..85c46d4 100644 --- a/server/services/ami/report/voiceAgentReport.js +++ b/server/services/ami/report/voiceAgentReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','uniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','merge','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','format','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','voiceChannels','routealias','interface','pick','destconnectedlinenum','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:%s','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answered_elsewhere','[%s][voiceAgentReport][agentconnect]','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','error','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','agentringnoanswer','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','reason','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','agent','talktime','acw','acwtime','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]','lodash','moment','util','../../../config/logger','../ami'];(function(_0x1fe981,_0x48c08b){var _0xe7c85c=function(_0x442248){while(--_0x442248){_0x1fe981['push'](_0x1fe981['shift']());}};_0xe7c85c(++_0x48c08b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'use strict';var _=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x0a9e('0x3'))('ami');var ami=require(_0x0a9e('0x4'));config[_0x0a9e('0x5')]=_[_0x0a9e('0x6')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x5')]));function VoiceAgentReport(_0x441e3a){this[_0x0a9e('0x8')]={};this['voiceChannels']=_0x441e3a['channels'];this[_0x0a9e('0x9')]=_0x441e3a['voiceQueues'];this['agents']=_0x441e3a[_0x0a9e('0xa')];this[_0x0a9e('0xb')]={};ami['on'](_0x0a9e('0xc'),this[_0x0a9e('0xd')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0xf'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x10'),this[_0x0a9e('0x11')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x12'),this[_0x0a9e('0x13')]['bind'](this));ami['on'](_0x0a9e('0x14'),this[_0x0a9e('0x15')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0xe')](this));ami['on']('musiconholdstart',this[_0x0a9e('0x18')]['bind'](this));ami['on'](_0x0a9e('0x19'),this['syncMusicOnHoldStop'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x1a'),this['syncAttendedTransfer'][_0x0a9e('0xe')](this));ami['on']('blindtransfer',this[_0x0a9e('0x1b')][_0x0a9e('0xe')](this));}VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1d')]=function(_0x31b1ca,_0x2eb11f,_0x530eb7){io['to'](_0x31b1ca)[_0x0a9e('0x1d')](_0x2eb11f,_0x530eb7);};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1e')]=function(_0x1c696a){return _0x1c696a!==null&&!_[_0x0a9e('0x1f')](_0x1c696a);};VoiceAgentReport['prototype'][_0x0a9e('0xd')]=function(_0x155cce){try{if(this['isNotNull'](_0x155cce)){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x155cce['uniqueid'],_0x155cce[_0x0a9e('0x21')],_0x155cce[_0x0a9e('0x22')]);logger[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x155cce,{'showHidden':![],'depth':null}));if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]]={};}if(_[_0x0a9e('0x1f')](this['channels'][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]={'agentcalledAt':moment()['format'](_0x0a9e('0x27')),'lastevent':'called','mandatoryDisposition':this[_0x0a9e('0x9')][_0x155cce['queue']]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x29')]||![]:![],'type':this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x2a')]||'inbound':_0x0a9e('0x2b'),'variables':this[_0x0a9e('0xb')][_0x155cce[_0x0a9e('0x26')]]};}_[_0x0a9e('0x2c')](this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],_[_0x0a9e('0x2d')](_0x155cce,[_0x0a9e('0x2e'),_0x0a9e('0x2f')]));logger[_0x0a9e('0x23')](_0x0a9e('0x30'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x31'),this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]);logger['debug'](_0x0a9e('0x32'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x33')]('user:%s',_0x155cce[_0x0a9e('0x21')]),'user:called',this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]);}}catch(_0x3f3d41){logger['error'](_0x0a9e('0x34'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x3f3d41,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncAgentConnect']=function(_0x54135e){try{if(this[_0x0a9e('0x1e')](_0x54135e)){if(this['channels'][_0x54135e[_0x0a9e('0x26')]]){logger[_0x0a9e('0x23')](_0x0a9e('0x35'),_0x54135e[_0x0a9e('0x26')],util['inspect'](_0x54135e,{'showHidden':![],'depth':null}));for(var _0x31916f in this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]]){if(this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x31916f)){if(_0x54135e[_0x0a9e('0x22')]===_0x31916f){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x54135e[_0x0a9e('0x26')],_0x54135e[_0x0a9e('0x21')],_0x54135e['destuniqueid']);this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x37')]=moment()[_0x0a9e('0x33')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x38')]=_0x54135e['connectedlinename'];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x39')]=_0x54135e['connectedlinenum'];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3a')]=_0x54135e[_0x0a9e('0x3a')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3b')]=_0x54135e[_0x0a9e('0x3b')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3c')]=_0x54135e[_0x0a9e('0x3c')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3d')]='connect';if(this['voiceChannels'][this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x26')]]){var _0x315881=this[_0x0a9e('0x3e')][this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x26')]][_0x0a9e('0x3f')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3f')]=_0x315881;_0x54135e['routealias']=_0x315881;}_[_0x0a9e('0x2c')](this[_0x0a9e('0xa')][_0x54135e[_0x0a9e('0x40')]],_[_0x0a9e('0x41')](_0x54135e,[_0x0a9e('0x28'),_0x0a9e('0x42'),_0x0a9e('0x3f')]));logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:',_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami['emit'](_0x0a9e('0x43'),this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]]);logger[_0x0a9e('0x23')](_0x0a9e('0x44'),_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x33')](_0x0a9e('0x45'),_0x54135e[_0x0a9e('0x21')]),_0x0a9e('0x46'),this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x54135e[_0x0a9e('0x22')]]);}else if(!this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['agentringnoanswer']&&!this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')](_0x0a9e('0x47'),_0x54135e[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x21')],_0x31916f);this['channels'][_0x54135e['uniqueid']][_0x31916f]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x48')]=moment()['format'](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['answeredelsewheredestinationuniqueid']=_0x54135e[_0x0a9e('0x22')];this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f]['answeredelsewheremembername']=_0x54135e[_0x0a9e('0x21')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f]['lastevent']=_0x0a9e('0x49');this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['reason']=_0x0a9e('0x49');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:',_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')]('custom:agentansweredelsewhere',this['channels'][_0x54135e['uniqueid']][_0x31916f]);}}}}}}catch(_0x2da03c){logger['error'](_0x0a9e('0x4a'),_0x54135e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2da03c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x4b')]=function(_0x272738){try{if(this[_0x0a9e('0x1e')](_0x272738)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x272738[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x272738,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]]&&this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']]){logger[_0x0a9e('0x20')](_0x0a9e('0x4c'),_0x272738['uniqueid'],_0x272738[_0x0a9e('0x21')],_0x272738['destuniqueid']);this[_0x0a9e('0x8')][_0x272738['uniqueid']][_0x272738['destuniqueid']]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x272738['uniqueid']][_0x272738[_0x0a9e('0x22')]][_0x0a9e('0x48')]=moment()[_0x0a9e('0x33')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']][_0x0a9e('0x3d')]='rejected';this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738[_0x0a9e('0x22')]]['reason']=_0x0a9e('0x4d');logger[_0x0a9e('0x23')](_0x0a9e('0x4e'),_0x272738[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x4f'),this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738[_0x0a9e('0x22')]]);}}}catch(_0x4d4a35){logger[_0x0a9e('0x50')](_0x0a9e('0x51'),_0x272738[_0x0a9e('0x26')],util['inspect'](_0x4d4a35,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncQueueCallerAbandon']=function(_0x5211e3){try{if(this[_0x0a9e('0x1e')](_0x5211e3)){logger[_0x0a9e('0x23')](_0x0a9e('0x52'),_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x5211e3,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]]){for(var _0x54a37d in this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x54a37d)&&!this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x53')]&&!this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d]['agentcomplete']){logger[_0x0a9e('0x20')](_0x0a9e('0x54'),_0x5211e3[_0x0a9e('0x26')],this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x21')],_0x54a37d);this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x53')]=!![];this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x48')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x3d')]=_0x0a9e('0x55');this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x56')]=_0x0a9e('0x55');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x5211e3['uniqueid']][_0x54a37d],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')]('custom:agentqueuecallerabandon',this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d]);}}}}}catch(_0x4c46c1){logger[_0x0a9e('0x50')](_0x0a9e('0x57'),_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4c46c1,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x13')]=function(_0x2e9552){try{if(this[_0x0a9e('0x1e')](_0x2e9552)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2e9552,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]]){for(var _0x4abc8f in this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x4abc8f)){if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x37')]&&!this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')](_0x0a9e('0x58'),_0x2e9552[_0x0a9e('0x26')],this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x21')],_0x4abc8f);this[_0x0a9e('0x8')][_0x2e9552['uniqueid']][_0x4abc8f][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x59')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]['lastevent']=_0x0a9e('0x5a');this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x56')]=_0x2e9552['reason']==_0x0a9e('0x5b')?_0x0a9e('0x5c'):_0x2e9552[_0x0a9e('0x56')];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x5d')]=_0x2e9552[_0x0a9e('0x5d')];if(this['voiceQueues'][_0x2e9552[_0x0a9e('0x28')]]&&this[_0x0a9e('0x9')][_0x2e9552[_0x0a9e('0x28')]][_0x0a9e('0x5e')]){this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x5f')]=this['voiceQueues'][_0x2e9552[_0x0a9e('0x28')]]['acwTimeout'];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x60')]=!![];}this[_0x0a9e('0xa')][_0x2e9552['interface']]=_['omit'](this[_0x0a9e('0xa')][_0x2e9552[_0x0a9e('0x40')]],[_0x0a9e('0x28'),'destconnectedlinenum']);logger[_0x0a9e('0x23')](_0x0a9e('0x61'),_0x2e9552['uniqueid'],util['inspect'](this[_0x0a9e('0x8')][_0x2e9552['uniqueid']][_0x4abc8f],{'showHidden':![],'depth':null}));ami['emit']('custom:agentcomplete',this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]);logger[_0x0a9e('0x23')](_0x0a9e('0x62'),_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f],{'showHidden':![],'depth':null}));this['emit'](util[_0x0a9e('0x33')](_0x0a9e('0x45'),_0x2e9552[_0x0a9e('0x21')]),_0x0a9e('0x63'),this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]);}}}}}}catch(_0x32f761){logger[_0x0a9e('0x50')]('[%s][voiceAgentReport][agentcomplete]',_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x32f761,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x15')]=function(_0x255e49){try{if(this[_0x0a9e('0x1e')](_0x255e49)){logger[_0x0a9e('0x23')](_0x0a9e('0x64'),_0x255e49['uniqueid'],util[_0x0a9e('0x25')](_0x255e49,{'showHidden':![],'depth':null}));this[_0x0a9e('0x65')](_0x255e49['uniqueid'],_[_0x0a9e('0x66')](_0x255e49[_0x0a9e('0x67')])[0x0],_0x255e49[_0x0a9e('0x68')]);if(this['channels'][_0x255e49[_0x0a9e('0x26')]]){for(var _0x52ec10 in this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x52ec10)){logger[_0x0a9e('0x20')](_0x0a9e('0x69'),_0x255e49[_0x0a9e('0x26')],_0x52ec10,_['keys'](_0x255e49[_0x0a9e('0x67')])[0x0],_0x255e49[_0x0a9e('0x68')]);if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')])){this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')]={};}this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')]=this[_0x0a9e('0xb')][_0x255e49['uniqueid']];}}}}}catch(_0xc81b64){logger[_0x0a9e('0x50')](_0x0a9e('0x6a'),_0x255e49[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xc81b64,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x65')]=function(_0x1756c7,_0x5ce99d,_0x23b447){var _0x5e725e=[_0x0a9e('0x6b'),_0x0a9e('0x6c'),_0x0a9e('0x6d'),_0x0a9e('0x6e'),'rtpaudioqosloss',_0x0a9e('0x6f'),'rtpaudioqosrtt',_0x0a9e('0x70'),_0x0a9e('0x71'),'sipuri',_0x0a9e('0x72'),_0x0a9e('0x73'),_0x0a9e('0x74'),'memberdynamic','memberinterface',_0x0a9e('0x75'),_0x0a9e('0x21'),_0x0a9e('0x76'),_0x0a9e('0x77')];if(!_[_0x0a9e('0x78')](_0x5ce99d)&&!_[_0x0a9e('0x79')](_0x5e725e,_0x5ce99d)){if(_[_0x0a9e('0x1f')](this[_0x0a9e('0xb')][_0x1756c7])){this[_0x0a9e('0xb')][_0x1756c7]={};}this['variables'][_0x1756c7][_0x5ce99d]=_0x23b447;}};VoiceAgentReport[_0x0a9e('0x1c')]['syncHangup']=function(_0x287324){try{if(this[_0x0a9e('0x1e')](_0x287324)){logger[_0x0a9e('0x23')](_0x0a9e('0x7a'),_0x287324[_0x0a9e('0x26')],util['inspect'](_0x287324,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]){for(var _0x2791c5 in this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]){if(this['channels'][_0x287324['uniqueid']][_0x0a9e('0x36')](_0x2791c5)){if(this['channels'][_0x287324[_0x0a9e('0x26')]][_0x2791c5][_0x0a9e('0x56')]==_0x0a9e('0x5b')&&this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]][_0x2791c5][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x287324[_0x0a9e('0x26')],_0x2791c5);this['channels'][_0x287324[_0x0a9e('0x26')]][_0x2791c5]['agentcompleteAt']=moment()[_0x0a9e('0x33')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger['debug'](_0x0a9e('0x7b'),_0x287324[_0x0a9e('0x26')],util['inspect'](_[_0x0a9e('0x7c')](this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x7d'),_['values'](this['channels'][_0x287324[_0x0a9e('0x26')]]));delete this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]];}if(this[_0x0a9e('0xb')][_0x287324[_0x0a9e('0x26')]]){delete this['variables'][_0x287324[_0x0a9e('0x26')]];}}}catch(_0xadce3d){logger['error'](_0x0a9e('0x7e'),_0x287324[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xadce3d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x7f')]=function(_0x23b39e){try{if(this[_0x0a9e('0x1e')](_0x23b39e)){logger[_0x0a9e('0x23')](_0x0a9e('0x80'),_0x23b39e[_0x0a9e('0x26')],util['inspect'](_0x23b39e,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]]){for(var _0x2ada60 in this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]]){if(this['channels'][_0x23b39e['transfereeuniqueid']][_0x0a9e('0x36')](_0x2ada60)){if(_0x23b39e[_0x0a9e('0x82')]===_0x2ada60){logger[_0x0a9e('0x20')](_0x0a9e('0x83'),_0x23b39e[_0x0a9e('0x26')],this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x21')],_0x2ada60);var _0x3450ae=moment();this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x23b39e['transfereeuniqueid']][_0x2ada60][_0x0a9e('0x59')]=moment()[_0x0a9e('0x33')](_0x0a9e('0x27'));this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60]['lastevent']=_0x0a9e('0x5a');this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x56')]=_0x0a9e('0x5b');this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x5d')]=_0x3450ae[_0x0a9e('0x84')](this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x37')],_0x0a9e('0x85'));}}}}if(this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x86')]]){var _0x248368=this['channels'][_0x23b39e['secondtransfereruniqueid']];this[_0x0a9e('0x8')][_0x23b39e['secondtransfereruniqueid']]=this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]];this['channels'][_0x23b39e[_0x0a9e('0x81')]]=_0x248368;}}}catch(_0xe2b083){logger[_0x0a9e('0x50')](_0x0a9e('0x87'),_0x23b39e['uniqueid'],util[_0x0a9e('0x25')](_0xe2b083,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1b')]=function(_0x34a791){try{if(this['isNotNull'](_0x34a791)){logger[_0x0a9e('0x23')](_0x0a9e('0x88'),_0x34a791[_0x0a9e('0x26')],util['inspect'](_0x34a791,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]]){for(var _0x17b29d in this['channels'][_0x34a791[_0x0a9e('0x81')]]){if(this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x0a9e('0x36')](_0x17b29d)){if(_0x34a791[_0x0a9e('0x89')]===_0x17b29d){logger['info'](_0x0a9e('0x8a'),_0x34a791[_0x0a9e('0x26')],this['channels'][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x21')],_0x17b29d);var _0x1f6f1c=moment();this['channels'][_0x34a791['transfereeuniqueid']][_0x17b29d]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d]['agentcompleteAt']=_0x1f6f1c;this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x3d')]='complete';this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x56')]=_0x0a9e('0x5b');this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x5d')]=_0x1f6f1c[_0x0a9e('0x84')](this[_0x0a9e('0x8')][_0x34a791['transfereeuniqueid']][_0x17b29d][_0x0a9e('0x37')],'seconds');}}}}}}catch(_0x138cf5){logger[_0x0a9e('0x50')](_0x0a9e('0x8b'),_0x34a791[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x138cf5,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncMusicOnHoldStart']=function(_0x1a0314){var _0x33da81='';try{if(this[_0x0a9e('0x1e')](_0x1a0314)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x1a0314[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x1a0314,{'showHidden':![],'depth':null}));if(_0x1a0314[_0x0a9e('0x8c')]){_0x33da81=_0x1a0314[_0x0a9e('0x8c')][_0x0a9e('0x8d')](0x0,_0x1a0314[_0x0a9e('0x8c')][_0x0a9e('0x8e')]('-'));if(this[_0x0a9e('0xa')][_0x33da81]){logger[_0x0a9e('0x20')](_0x0a9e('0x8f'),_0x1a0314['uniqueid'],_0x33da81);this[_0x0a9e('0xa')][_0x33da81][_0x0a9e('0x90')]=!![];}}}}catch(_0x2ff265){logger[_0x0a9e('0x50')](_0x0a9e('0x91'),_0x1a0314[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2ff265,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncMusicOnHoldStop']=function(_0x3b581c){var _0xd2391='';try{if(this[_0x0a9e('0x1e')](_0x3b581c)){logger['debug'](_0x0a9e('0x92'),_0x3b581c[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x3b581c,{'showHidden':![],'depth':null}));if(_0x3b581c[_0x0a9e('0x8c')]){_0xd2391=_0x3b581c[_0x0a9e('0x8c')][_0x0a9e('0x8d')](0x0,_0x3b581c[_0x0a9e('0x8c')][_0x0a9e('0x8e')]('-'));if(this[_0x0a9e('0xa')][_0xd2391]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][musiconholdstop]\x20interface:%s',_0x3b581c[_0x0a9e('0x26')],_0xd2391);this[_0x0a9e('0xa')][_0xd2391][_0x0a9e('0x90')]=![];}}}}catch(_0x3db98f){logger[_0x0a9e('0x50')](_0x0a9e('0x93'),_0x3b581c['uniqueid'],util[_0x0a9e('0x25')](_0x3db98f,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file +var _0xa9e0=['redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','uniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','merge','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','format','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','voiceChannels','routealias','interface','pick','destconnectedlinenum','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:%s','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answered_elsewhere','[%s][voiceAgentReport][agentconnect]','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','error','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','agentringnoanswer','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','reason','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','agent','talktime','acw','acwtime','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]','lodash','moment','util','../../../config/logger','../ami'];(function(_0x2da6ef,_0xe703e0){var _0x21a967=function(_0x25ab70){while(--_0x25ab70){_0x2da6ef['push'](_0x2da6ef['shift']());}};_0x21a967(++_0xe703e0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'use strict';var _=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x0a9e('0x3'))('ami');var ami=require(_0x0a9e('0x4'));config[_0x0a9e('0x5')]=_[_0x0a9e('0x6')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x5')]));function VoiceAgentReport(_0x441e3a){this[_0x0a9e('0x8')]={};this['voiceChannels']=_0x441e3a['channels'];this[_0x0a9e('0x9')]=_0x441e3a['voiceQueues'];this['agents']=_0x441e3a[_0x0a9e('0xa')];this[_0x0a9e('0xb')]={};ami['on'](_0x0a9e('0xc'),this[_0x0a9e('0xd')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0xf'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x10'),this[_0x0a9e('0x11')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x12'),this[_0x0a9e('0x13')]['bind'](this));ami['on'](_0x0a9e('0x14'),this[_0x0a9e('0x15')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0xe')](this));ami['on']('musiconholdstart',this[_0x0a9e('0x18')]['bind'](this));ami['on'](_0x0a9e('0x19'),this['syncMusicOnHoldStop'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x1a'),this['syncAttendedTransfer'][_0x0a9e('0xe')](this));ami['on']('blindtransfer',this[_0x0a9e('0x1b')][_0x0a9e('0xe')](this));}VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1d')]=function(_0x31b1ca,_0x2eb11f,_0x530eb7){io['to'](_0x31b1ca)[_0x0a9e('0x1d')](_0x2eb11f,_0x530eb7);};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1e')]=function(_0x1c696a){return _0x1c696a!==null&&!_[_0x0a9e('0x1f')](_0x1c696a);};VoiceAgentReport['prototype'][_0x0a9e('0xd')]=function(_0x155cce){try{if(this['isNotNull'](_0x155cce)){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x155cce['uniqueid'],_0x155cce[_0x0a9e('0x21')],_0x155cce[_0x0a9e('0x22')]);logger[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x155cce,{'showHidden':![],'depth':null}));if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]]={};}if(_[_0x0a9e('0x1f')](this['channels'][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]={'agentcalledAt':moment()['format'](_0x0a9e('0x27')),'lastevent':'called','mandatoryDisposition':this[_0x0a9e('0x9')][_0x155cce['queue']]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x29')]||![]:![],'type':this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x2a')]||'inbound':_0x0a9e('0x2b'),'variables':this[_0x0a9e('0xb')][_0x155cce[_0x0a9e('0x26')]]};}_[_0x0a9e('0x2c')](this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],_[_0x0a9e('0x2d')](_0x155cce,[_0x0a9e('0x2e'),_0x0a9e('0x2f')]));logger[_0x0a9e('0x23')](_0x0a9e('0x30'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x31'),this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]);logger['debug'](_0x0a9e('0x32'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x33')]('user:%s',_0x155cce[_0x0a9e('0x21')]),'user:called',this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]);}}catch(_0x3f3d41){logger['error'](_0x0a9e('0x34'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x3f3d41,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncAgentConnect']=function(_0x54135e){try{if(this[_0x0a9e('0x1e')](_0x54135e)){if(this['channels'][_0x54135e[_0x0a9e('0x26')]]){logger[_0x0a9e('0x23')](_0x0a9e('0x35'),_0x54135e[_0x0a9e('0x26')],util['inspect'](_0x54135e,{'showHidden':![],'depth':null}));for(var _0x31916f in this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]]){if(this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x31916f)){if(_0x54135e[_0x0a9e('0x22')]===_0x31916f){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x54135e[_0x0a9e('0x26')],_0x54135e[_0x0a9e('0x21')],_0x54135e['destuniqueid']);this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x37')]=moment()[_0x0a9e('0x33')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x38')]=_0x54135e['connectedlinename'];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x39')]=_0x54135e['connectedlinenum'];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3a')]=_0x54135e[_0x0a9e('0x3a')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3b')]=_0x54135e[_0x0a9e('0x3b')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3c')]=_0x54135e[_0x0a9e('0x3c')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3d')]='connect';if(this['voiceChannels'][this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x26')]]){var _0x315881=this[_0x0a9e('0x3e')][this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x26')]][_0x0a9e('0x3f')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3f')]=_0x315881;_0x54135e['routealias']=_0x315881;}_[_0x0a9e('0x2c')](this[_0x0a9e('0xa')][_0x54135e[_0x0a9e('0x40')]],_[_0x0a9e('0x41')](_0x54135e,[_0x0a9e('0x28'),_0x0a9e('0x42'),_0x0a9e('0x3f')]));logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:',_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami['emit'](_0x0a9e('0x43'),this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]]);logger[_0x0a9e('0x23')](_0x0a9e('0x44'),_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x33')](_0x0a9e('0x45'),_0x54135e[_0x0a9e('0x21')]),_0x0a9e('0x46'),this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x54135e[_0x0a9e('0x22')]]);}else if(!this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['agentringnoanswer']&&!this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')](_0x0a9e('0x47'),_0x54135e[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x21')],_0x31916f);this['channels'][_0x54135e['uniqueid']][_0x31916f]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x48')]=moment()['format'](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['answeredelsewheredestinationuniqueid']=_0x54135e[_0x0a9e('0x22')];this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f]['answeredelsewheremembername']=_0x54135e[_0x0a9e('0x21')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f]['lastevent']=_0x0a9e('0x49');this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['reason']=_0x0a9e('0x49');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:',_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')]('custom:agentansweredelsewhere',this['channels'][_0x54135e['uniqueid']][_0x31916f]);}}}}}}catch(_0x2da03c){logger['error'](_0x0a9e('0x4a'),_0x54135e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2da03c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x4b')]=function(_0x272738){try{if(this[_0x0a9e('0x1e')](_0x272738)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x272738[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x272738,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]]&&this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']]){logger[_0x0a9e('0x20')](_0x0a9e('0x4c'),_0x272738['uniqueid'],_0x272738[_0x0a9e('0x21')],_0x272738['destuniqueid']);this[_0x0a9e('0x8')][_0x272738['uniqueid']][_0x272738['destuniqueid']]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x272738['uniqueid']][_0x272738[_0x0a9e('0x22')]][_0x0a9e('0x48')]=moment()[_0x0a9e('0x33')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']][_0x0a9e('0x3d')]='rejected';this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738[_0x0a9e('0x22')]]['reason']=_0x0a9e('0x4d');logger[_0x0a9e('0x23')](_0x0a9e('0x4e'),_0x272738[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x4f'),this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738[_0x0a9e('0x22')]]);}}}catch(_0x4d4a35){logger[_0x0a9e('0x50')](_0x0a9e('0x51'),_0x272738[_0x0a9e('0x26')],util['inspect'](_0x4d4a35,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncQueueCallerAbandon']=function(_0x5211e3){try{if(this[_0x0a9e('0x1e')](_0x5211e3)){logger[_0x0a9e('0x23')](_0x0a9e('0x52'),_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x5211e3,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]]){for(var _0x54a37d in this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x54a37d)&&!this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x53')]&&!this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d]['agentcomplete']){logger[_0x0a9e('0x20')](_0x0a9e('0x54'),_0x5211e3[_0x0a9e('0x26')],this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x21')],_0x54a37d);this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x53')]=!![];this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x48')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x3d')]=_0x0a9e('0x55');this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x56')]=_0x0a9e('0x55');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x5211e3['uniqueid']][_0x54a37d],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')]('custom:agentqueuecallerabandon',this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d]);}}}}}catch(_0x4c46c1){logger[_0x0a9e('0x50')](_0x0a9e('0x57'),_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4c46c1,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x13')]=function(_0x2e9552){try{if(this[_0x0a9e('0x1e')](_0x2e9552)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2e9552,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]]){for(var _0x4abc8f in this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x4abc8f)){if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x37')]&&!this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')](_0x0a9e('0x58'),_0x2e9552[_0x0a9e('0x26')],this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x21')],_0x4abc8f);this[_0x0a9e('0x8')][_0x2e9552['uniqueid']][_0x4abc8f][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x59')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]['lastevent']=_0x0a9e('0x5a');this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x56')]=_0x2e9552['reason']==_0x0a9e('0x5b')?_0x0a9e('0x5c'):_0x2e9552[_0x0a9e('0x56')];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x5d')]=_0x2e9552[_0x0a9e('0x5d')];if(this['voiceQueues'][_0x2e9552[_0x0a9e('0x28')]]&&this[_0x0a9e('0x9')][_0x2e9552[_0x0a9e('0x28')]][_0x0a9e('0x5e')]){this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x5f')]=this['voiceQueues'][_0x2e9552[_0x0a9e('0x28')]]['acwTimeout'];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x60')]=!![];}this[_0x0a9e('0xa')][_0x2e9552['interface']]=_['omit'](this[_0x0a9e('0xa')][_0x2e9552[_0x0a9e('0x40')]],[_0x0a9e('0x28'),'destconnectedlinenum']);logger[_0x0a9e('0x23')](_0x0a9e('0x61'),_0x2e9552['uniqueid'],util['inspect'](this[_0x0a9e('0x8')][_0x2e9552['uniqueid']][_0x4abc8f],{'showHidden':![],'depth':null}));ami['emit']('custom:agentcomplete',this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]);logger[_0x0a9e('0x23')](_0x0a9e('0x62'),_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f],{'showHidden':![],'depth':null}));this['emit'](util[_0x0a9e('0x33')](_0x0a9e('0x45'),_0x2e9552[_0x0a9e('0x21')]),_0x0a9e('0x63'),this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]);}}}}}}catch(_0x32f761){logger[_0x0a9e('0x50')]('[%s][voiceAgentReport][agentcomplete]',_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x32f761,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x15')]=function(_0x255e49){try{if(this[_0x0a9e('0x1e')](_0x255e49)){logger[_0x0a9e('0x23')](_0x0a9e('0x64'),_0x255e49['uniqueid'],util[_0x0a9e('0x25')](_0x255e49,{'showHidden':![],'depth':null}));this[_0x0a9e('0x65')](_0x255e49['uniqueid'],_[_0x0a9e('0x66')](_0x255e49[_0x0a9e('0x67')])[0x0],_0x255e49[_0x0a9e('0x68')]);if(this['channels'][_0x255e49[_0x0a9e('0x26')]]){for(var _0x52ec10 in this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x52ec10)){logger[_0x0a9e('0x20')](_0x0a9e('0x69'),_0x255e49[_0x0a9e('0x26')],_0x52ec10,_['keys'](_0x255e49[_0x0a9e('0x67')])[0x0],_0x255e49[_0x0a9e('0x68')]);if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')])){this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')]={};}this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')]=this[_0x0a9e('0xb')][_0x255e49['uniqueid']];}}}}}catch(_0xc81b64){logger[_0x0a9e('0x50')](_0x0a9e('0x6a'),_0x255e49[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xc81b64,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x65')]=function(_0x1756c7,_0x5ce99d,_0x23b447){var _0x5e725e=[_0x0a9e('0x6b'),_0x0a9e('0x6c'),_0x0a9e('0x6d'),_0x0a9e('0x6e'),'rtpaudioqosloss',_0x0a9e('0x6f'),'rtpaudioqosrtt',_0x0a9e('0x70'),_0x0a9e('0x71'),'sipuri',_0x0a9e('0x72'),_0x0a9e('0x73'),_0x0a9e('0x74'),'memberdynamic','memberinterface',_0x0a9e('0x75'),_0x0a9e('0x21'),_0x0a9e('0x76'),_0x0a9e('0x77')];if(!_[_0x0a9e('0x78')](_0x5ce99d)&&!_[_0x0a9e('0x79')](_0x5e725e,_0x5ce99d)){if(_[_0x0a9e('0x1f')](this[_0x0a9e('0xb')][_0x1756c7])){this[_0x0a9e('0xb')][_0x1756c7]={};}this['variables'][_0x1756c7][_0x5ce99d]=_0x23b447;}};VoiceAgentReport[_0x0a9e('0x1c')]['syncHangup']=function(_0x287324){try{if(this[_0x0a9e('0x1e')](_0x287324)){logger[_0x0a9e('0x23')](_0x0a9e('0x7a'),_0x287324[_0x0a9e('0x26')],util['inspect'](_0x287324,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]){for(var _0x2791c5 in this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]){if(this['channels'][_0x287324['uniqueid']][_0x0a9e('0x36')](_0x2791c5)){if(this['channels'][_0x287324[_0x0a9e('0x26')]][_0x2791c5][_0x0a9e('0x56')]==_0x0a9e('0x5b')&&this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]][_0x2791c5][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x287324[_0x0a9e('0x26')],_0x2791c5);this['channels'][_0x287324[_0x0a9e('0x26')]][_0x2791c5]['agentcompleteAt']=moment()[_0x0a9e('0x33')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger['debug'](_0x0a9e('0x7b'),_0x287324[_0x0a9e('0x26')],util['inspect'](_[_0x0a9e('0x7c')](this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x7d'),_['values'](this['channels'][_0x287324[_0x0a9e('0x26')]]));delete this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]];}if(this[_0x0a9e('0xb')][_0x287324[_0x0a9e('0x26')]]){delete this['variables'][_0x287324[_0x0a9e('0x26')]];}}}catch(_0xadce3d){logger['error'](_0x0a9e('0x7e'),_0x287324[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xadce3d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x7f')]=function(_0x23b39e){try{if(this[_0x0a9e('0x1e')](_0x23b39e)){logger[_0x0a9e('0x23')](_0x0a9e('0x80'),_0x23b39e[_0x0a9e('0x26')],util['inspect'](_0x23b39e,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]]){for(var _0x2ada60 in this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]]){if(this['channels'][_0x23b39e['transfereeuniqueid']][_0x0a9e('0x36')](_0x2ada60)){if(_0x23b39e[_0x0a9e('0x82')]===_0x2ada60){logger[_0x0a9e('0x20')](_0x0a9e('0x83'),_0x23b39e[_0x0a9e('0x26')],this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x21')],_0x2ada60);var _0x3450ae=moment();this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x23b39e['transfereeuniqueid']][_0x2ada60][_0x0a9e('0x59')]=moment()[_0x0a9e('0x33')](_0x0a9e('0x27'));this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60]['lastevent']=_0x0a9e('0x5a');this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x56')]=_0x0a9e('0x5b');this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x5d')]=_0x3450ae[_0x0a9e('0x84')](this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x37')],_0x0a9e('0x85'));}}}}if(this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x86')]]){var _0x248368=this['channels'][_0x23b39e['secondtransfereruniqueid']];this[_0x0a9e('0x8')][_0x23b39e['secondtransfereruniqueid']]=this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]];this['channels'][_0x23b39e[_0x0a9e('0x81')]]=_0x248368;}}}catch(_0xe2b083){logger[_0x0a9e('0x50')](_0x0a9e('0x87'),_0x23b39e['uniqueid'],util[_0x0a9e('0x25')](_0xe2b083,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1b')]=function(_0x34a791){try{if(this['isNotNull'](_0x34a791)){logger[_0x0a9e('0x23')](_0x0a9e('0x88'),_0x34a791[_0x0a9e('0x26')],util['inspect'](_0x34a791,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]]){for(var _0x17b29d in this['channels'][_0x34a791[_0x0a9e('0x81')]]){if(this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x0a9e('0x36')](_0x17b29d)){if(_0x34a791[_0x0a9e('0x89')]===_0x17b29d){logger['info'](_0x0a9e('0x8a'),_0x34a791[_0x0a9e('0x26')],this['channels'][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x21')],_0x17b29d);var _0x1f6f1c=moment();this['channels'][_0x34a791['transfereeuniqueid']][_0x17b29d]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d]['agentcompleteAt']=_0x1f6f1c;this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x3d')]='complete';this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x56')]=_0x0a9e('0x5b');this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x5d')]=_0x1f6f1c[_0x0a9e('0x84')](this[_0x0a9e('0x8')][_0x34a791['transfereeuniqueid']][_0x17b29d][_0x0a9e('0x37')],'seconds');}}}}}}catch(_0x138cf5){logger[_0x0a9e('0x50')](_0x0a9e('0x8b'),_0x34a791[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x138cf5,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncMusicOnHoldStart']=function(_0x1a0314){var _0x33da81='';try{if(this[_0x0a9e('0x1e')](_0x1a0314)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x1a0314[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x1a0314,{'showHidden':![],'depth':null}));if(_0x1a0314[_0x0a9e('0x8c')]){_0x33da81=_0x1a0314[_0x0a9e('0x8c')][_0x0a9e('0x8d')](0x0,_0x1a0314[_0x0a9e('0x8c')][_0x0a9e('0x8e')]('-'));if(this[_0x0a9e('0xa')][_0x33da81]){logger[_0x0a9e('0x20')](_0x0a9e('0x8f'),_0x1a0314['uniqueid'],_0x33da81);this[_0x0a9e('0xa')][_0x33da81][_0x0a9e('0x90')]=!![];}}}}catch(_0x2ff265){logger[_0x0a9e('0x50')](_0x0a9e('0x91'),_0x1a0314[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2ff265,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncMusicOnHoldStop']=function(_0x3b581c){var _0xd2391='';try{if(this[_0x0a9e('0x1e')](_0x3b581c)){logger['debug'](_0x0a9e('0x92'),_0x3b581c[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x3b581c,{'showHidden':![],'depth':null}));if(_0x3b581c[_0x0a9e('0x8c')]){_0xd2391=_0x3b581c[_0x0a9e('0x8c')][_0x0a9e('0x8d')](0x0,_0x3b581c[_0x0a9e('0x8c')][_0x0a9e('0x8e')]('-'));if(this[_0x0a9e('0xa')][_0xd2391]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][musiconholdstop]\x20interface:%s',_0x3b581c[_0x0a9e('0x26')],_0xd2391);this[_0x0a9e('0xa')][_0xd2391][_0x0a9e('0x90')]=![];}}}}catch(_0x3db98f){logger[_0x0a9e('0x50')](_0x0a9e('0x93'),_0x3b581c['uniqueid'],util[_0x0a9e('0x25')](_0x3db98f,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 31f97e7..221d342 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 _0x108a=['transfereruniqueid','BLIND','[%s][voiceCallReport][musiconholdstart]\x20event:','answertime','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','exports','moment','util','../../../config/logger','ami','../ami','../model/channel','../rpc/setting','unknown','not_inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','queue','agi','dial','voicemail','FAILED','NO\x20ANSWER','ANSWERED','redis','socket.io-emitter','channels','agents','blindTransfers','syncNewExten','bind','newexten','newchannel','syncVarSet','hangup','syncHangup','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','info','actionCoreShowChannels','error','prototype','isNotNull','isUndefined','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','calleridname','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','uniqueid','inspect','linkedid','merge','pick','keys','context','from-sip','split','exten','xcally-motion-preview','channel','connectedlinenum','format','user:%s','name','[%s][voiceCallReport][newcallerid]','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','YYYY-MM-DD\x20HH:mm:ss','channelstate','destconnectedlinenum','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','accountcode','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','startsWith','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','seconds','disposition','includes','lastapplication','lastdata','set','cdr(','match','[%s][voiceCallReport][newexten]','syncNewState','answered','holdtime','starttime','connectedlinename','destinationchannel','toNumber','UserId','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','.WAV','monitorFilename','monitors','isNil','rec','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','xmcs-queue','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','diff','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','then','transferType','isEmpty','getSettings','stopRecordingOnTransfer','resolve','Action','catch','StopMixMonitor','finally','webbar:stopmonitors','BlindTransfer','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','some','routeid','ATTENDED','syncBlindTransfer','extension','[%s][voiceCallReport][blindtransfer]\x20event:','transfereecalleridnum','transfererchannel'];(function(_0x67f01,_0x42ddab){var _0x44e6d2=function(_0x979be4){while(--_0x979be4){_0x67f01['push'](_0x67f01['shift']());}};_0x44e6d2(++_0x42ddab);}(_0x108a,0xd6));var _0xa108=function(_0x583b60,_0x32f412){_0x583b60=_0x583b60-0x0;var _0x503c47=_0x108a[_0x583b60];return _0x503c47;};'use strict';var BPromise=require('bluebird');var _=require('lodash');var moment=require(_0xa108('0x0'));var util=require(_0xa108('0x1'));var path=require('path');var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0xa108('0x2'))(_0xa108('0x3'));var ami=require(_0xa108('0x4'));var Channel=require(_0xa108('0x5'));var RpcSetting=require(_0xa108('0x6'));var statusDesc=[_0xa108('0x7'),_0xa108('0x8'),'inuse',_0xa108('0x9'),_0xa108('0xa'),_0xa108('0xb'),_0xa108('0xc'),_0xa108('0xd'),_0xa108('0xe')];var applications=['set',_0xa108('0xf'),_0xa108('0x10'),_0xa108('0x11'),'playback',_0xa108('0x12')];var dispositions=['NO\x20ANSWER',_0xa108('0x13'),_0xa108('0x13'),_0xa108('0x14'),'NO\x20ANSWER',_0xa108('0x14'),_0xa108('0x15'),'BUSY',_0xa108('0x13'),_0xa108('0x13'),_0xa108('0x13')];var actions={};config[_0xa108('0x16')]=_['defaults'](config[_0xa108('0x16')],{'host':'localhost','port':0x18eb});var io=require(_0xa108('0x17'))(new Redis(config[_0xa108('0x16')]));function VoiceCallReport(_0x4f8434){this['channels']=_0x4f8434[_0xa108('0x18')];this[_0xa108('0x19')]=_0x4f8434[_0xa108('0x19')];this[_0xa108('0x1a')]={};ami['on']('coreshowchannel',this[_0xa108('0x1b')][_0xa108('0x1c')](this));ami['on'](_0xa108('0x1d'),this[_0xa108('0x1b')][_0xa108('0x1c')](this));ami['on'](_0xa108('0x1e'),this['syncNewChannel'][_0xa108('0x1c')](this));ami['on']('newstate',this['syncNewState']['bind'](this));ami['on']('varset',this[_0xa108('0x1f')]['bind'](this));ami['on'](_0xa108('0x20'),this[_0xa108('0x21')]['bind'](this));ami['on']('newcallerid',this[_0xa108('0x22')][_0xa108('0x1c')](this));ami['on'](_0xa108('0x23'),this[_0xa108('0x24')]['bind'](this));ami['on'](_0xa108('0x25'),this['syncBlindTransfer'][_0xa108('0x1c')](this));ami['on'](_0xa108('0x26'),this[_0xa108('0x27')][_0xa108('0x1c')](this));ami['on'](_0xa108('0x28'),this[_0xa108('0x29')][_0xa108('0x1c')](this));try{logger[_0xa108('0x2a')]('[voiceCallReport][coreshowchannels]\x20started');ami[_0xa108('0x2b')]();}catch(_0x5ad480){logger[_0xa108('0x2c')]('[voiceCallReport][coreshowchannels]',util['inspect'](_0x5ad480,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xa108('0x2d')][_0xa108('0x2e')]=function(_0x5dc5f5){return _0x5dc5f5!==null&&!_[_0xa108('0x2f')](_0x5dc5f5);};VoiceCallReport[_0xa108('0x2d')]['emit']=function(_0x4bce9d,_0x444afc,_0xf09042){io['to'](_0x4bce9d)[_0xa108('0x30')](_0x444afc,_0xf09042);};VoiceCallReport[_0xa108('0x2d')][_0xa108('0x22')]=function(_0x369507){try{if(this[_0xa108('0x2e')](_0x369507)){logger[_0xa108('0x2a')](_0xa108('0x31'),_0x369507['uniqueid'],_0x369507[_0xa108('0x32')],_0x369507[_0xa108('0x33')]);logger[_0xa108('0x34')](_0xa108('0x35'),_0x369507[_0xa108('0x36')],util[_0xa108('0x37')](_0x369507,{'showHidden':![],'depth':null}));if(_0x369507[_0xa108('0x36')]===_0x369507[_0xa108('0x38')]){if(!_[_0xa108('0x2f')](this[_0xa108('0x18')][_0x369507[_0xa108('0x36')]])){_[_0xa108('0x39')](this['channels'][_0x369507[_0xa108('0x36')]],_[_0xa108('0x3a')](_0x369507,_[_0xa108('0x3b')](this[_0xa108('0x18')][_0x369507[_0xa108('0x36')]])));}}if(_0x369507[_0xa108('0x3c')]===_0xa108('0x3d')){if(this[_0xa108('0x19')][_0x369507['channel'][_0xa108('0x3e')]('-')[0x0]]){if(_0x369507[_0xa108('0x3f')]==_0xa108('0x40')){this[_0xa108('0x19')][_0x369507[_0xa108('0x41')][_0xa108('0x3e')]('-')[0x0]]['destconnectedlinenum']=_0x369507[_0xa108('0x42')];this[_0xa108('0x30')](util[_0xa108('0x43')](_0xa108('0x44'),this[_0xa108('0x19')][_0x369507[_0xa108('0x41')]['split']('-')[0x0]][_0xa108('0x45')]),'user:agentconnect',{'destaccountcode':this[_0xa108('0x19')][_0x369507['channel'][_0xa108('0x3e')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x369507[_0xa108('0x42')]});}}}}}catch(_0x1126b0){logger[_0xa108('0x2c')](_0xa108('0x46'),_0x369507[_0xa108('0x36')],util[_0xa108('0x37')](_0x1126b0,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncNewChannel']=function(_0x325a46){try{if(this[_0xa108('0x2e')](_0x325a46)){logger[_0xa108('0x34')]('[%s][voiceCallReport][newchannel]\x20event:',_0x325a46[_0xa108('0x36')],util['inspect'](_0x325a46,{'showHidden':![],'depth':null}));if(_0x325a46[_0xa108('0x36')]===_0x325a46[_0xa108('0x38')]&&_0x325a46[_0xa108('0x41')]!=_0xa108('0x47')){if(_[_0xa108('0x2f')](this[_0xa108('0x18')][_0x325a46[_0xa108('0x36')]])){logger[_0xa108('0x2a')](_0xa108('0x48'),_0x325a46['uniqueid'],_0x325a46[_0xa108('0x3c')],_0x325a46[_0xa108('0x3f')]);this[_0xa108('0x18')][_0x325a46['uniqueid']]=new Channel();this[_0xa108('0x18')][_0x325a46[_0xa108('0x36')]]['starttime']=moment()['format'](_0xa108('0x49'));this[_0xa108('0x18')][_0x325a46[_0xa108('0x36')]]['disposition']=dispositions[_['toNumber'](_0x325a46[_0xa108('0x4a')])];_['merge'](this[_0xa108('0x18')][_0x325a46[_0xa108('0x36')]],_[_0xa108('0x3a')](_0x325a46,_[_0xa108('0x3b')](this['channels'][_0x325a46['uniqueid']])));if(_0x325a46['context']===_0xa108('0x3d')){if(this[_0xa108('0x19')][_0x325a46[_0xa108('0x41')][_0xa108('0x3e')]('-')[0x0]]){if(_['isUndefined'](this[_0xa108('0x19')][_0x325a46['channel'][_0xa108('0x3e')]('-')[0x0]][_0xa108('0x4b')])){this[_0xa108('0x19')][_0x325a46['channel']['split']('-')[0x0]][_0xa108('0x4b')]=_0x325a46['exten'];logger[_0xa108('0x34')](_0xa108('0x4c'),_0x325a46[_0xa108('0x36')],util[_0xa108('0x37')]({'destaccountcode':this['agents'][_0x325a46[_0xa108('0x41')][_0xa108('0x3e')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x325a46[_0xa108('0x3f')]},{'showHidden':![],'depth':null}));this[_0xa108('0x30')](util[_0xa108('0x43')](_0xa108('0x44'),this[_0xa108('0x19')][_0x325a46['channel']['split']('-')[0x0]][_0xa108('0x45')]),_0xa108('0x4d'),{'destaccountcode':this[_0xa108('0x19')][_0x325a46[_0xa108('0x41')][_0xa108('0x3e')]('-')[0x0]][_0xa108('0x4e')],'destconnectedlinenum':_0x325a46[_0xa108('0x3f')]});}}}}}}}catch(_0x54110b){logger[_0xa108('0x2c')](_0xa108('0x4f'),_0x325a46[_0xa108('0x36')],util[_0xa108('0x37')](_0x54110b,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xa108('0x1b')]=function(_0xb9facf){try{if(this[_0xa108('0x2e')](_0xb9facf)){logger['debug'](_0xa108('0x50'),_0xb9facf[_0xa108('0x36')],util['inspect'](_0xb9facf,{'showHidden':![],'depth':null}));if(_0xb9facf[_0xa108('0x36')]===_0xb9facf['linkedid']&&_0xb9facf[_0xa108('0x3f')]!='h'&&_0xb9facf['channel']!=_0xa108('0x47')){_0xb9facf[_0xa108('0x51')]=_0xb9facf[_0xa108('0x51')][_0xa108('0x52')]();_0xb9facf[_0xa108('0x53')]=_0xb9facf[_0xa108('0x54')]&&_0xb9facf[_0xa108('0x54')][_0xa108('0x55')](_0xa108('0x56'))?_0xb9facf[_0xa108('0x54')]:(_0xb9facf[_0xa108('0x54')]||_0xb9facf['applicationdata'])['toLowerCase']();logger[_0xa108('0x2a')](_0xa108('0x57'),_0xb9facf[_0xa108('0x36')],_0xb9facf[_0xa108('0x51')],_0xb9facf[_0xa108('0x53')]);if(_[_0xa108('0x2f')](this[_0xa108('0x18')][_0xb9facf[_0xa108('0x36')]])){this[_0xa108('0x18')][_0xb9facf[_0xa108('0x36')]]=new Channel();this[_0xa108('0x18')][_0xb9facf[_0xa108('0x36')]]['starttime']=_0xb9facf[_0xa108('0x58')]?moment()['subtract'](moment[_0xa108('0x58')](_0xb9facf[_0xa108('0x58')])[_0xa108('0x59')](),_0xa108('0x59'))[_0xa108('0x43')]('YYYY-MM-DD\x20HH:mm:ss'):moment()[_0xa108('0x43')](_0xa108('0x49'));this['channels'][_0xb9facf[_0xa108('0x36')]][_0xa108('0x5a')]=_0xa108('0x14');}_[_0xa108('0x39')](this[_0xa108('0x18')][_0xb9facf[_0xa108('0x36')]],_[_0xa108('0x3a')](_0xb9facf,_[_0xa108('0x3b')](this['channels'][_0xb9facf['uniqueid']])));if(_[_0xa108('0x5b')](applications,_0xb9facf['application'])){this[_0xa108('0x18')][_0xb9facf[_0xa108('0x36')]][_0xa108('0x5c')]=_0xb9facf[_0xa108('0x51')];this['channels'][_0xb9facf['uniqueid']][_0xa108('0x5d')]=_0xb9facf[_0xa108('0x53')];if(_0xb9facf['application']===_0xa108('0x5e')&&_[_0xa108('0x55')](_0xb9facf['applicationdata'][_0xa108('0x52')](),_0xa108('0x5f'))){var _0x35b79f=_0xb9facf[_0xa108('0x53')][_0xa108('0x3e')]('=');var _0x327295=_0x35b79f[0x0][_0xa108('0x52')]()[_0xa108('0x60')](/cdr\((.*)\)/);if(_0x327295){this[_0xa108('0x18')][_0xb9facf['uniqueid']][_0x327295[0x1]]=_0x35b79f[0x1];}}else if(_0xb9facf['application']==='queue'){this[_0xa108('0x18')][_0xb9facf[_0xa108('0x36')]]['queue']=_0xb9facf[_0xa108('0x53')][_0xa108('0x3e')](',')[0x0];}}}}}catch(_0x50fbb2){logger['error'](_0xa108('0x61'),_0xb9facf[_0xa108('0x36')],util[_0xa108('0x37')](_0x50fbb2,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa108('0x2d')][_0xa108('0x62')]=function(_0x379e77){try{if(this[_0xa108('0x2e')](_0x379e77)){logger[_0xa108('0x2a')]('[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s',_0x379e77[_0xa108('0x36')],_0x379e77['linkedid'],_0x379e77['calleridname'],_0x379e77[_0xa108('0x33')]);logger['debug']('[%s][voiceCallReport][newstate]\x20event:',_0x379e77[_0xa108('0x36')],util[_0xa108('0x37')](_0x379e77,{'showHidden':![],'depth':null}));if(_0x379e77[_0xa108('0x36')]!==_0x379e77[_0xa108('0x38')]){if(this[_0xa108('0x18')][_0x379e77[_0xa108('0x38')]]){if(_0x379e77[_0xa108('0x4a')]==='6'){if(!this['channels'][_0x379e77[_0xa108('0x38')]][_0xa108('0x63')]){var _0x499a74=moment();this['channels'][_0x379e77[_0xa108('0x38')]]['answered']=!![];this['channels'][_0x379e77[_0xa108('0x38')]]['answertime']=_0x499a74[_0xa108('0x43')]('YYYY-MM-DD\x20HH:mm:ss');if(this['channels'][_0x379e77['linkedid']]['starttime']){this[_0xa108('0x18')][_0x379e77[_0xa108('0x38')]][_0xa108('0x64')]=_0x499a74['diff'](this[_0xa108('0x18')][_0x379e77['linkedid']][_0xa108('0x65')],_0xa108('0x59'));}}this['channels'][_0x379e77[_0xa108('0x38')]][_0xa108('0x38')]=_0x379e77[_0xa108('0x36')];if(_0x379e77['calleridnum']!==_0xa108('0x40')){this[_0xa108('0x18')][_0x379e77[_0xa108('0x38')]][_0xa108('0x42')]=_0x379e77[_0xa108('0x33')];}this['channels'][_0x379e77[_0xa108('0x38')]][_0xa108('0x66')]=_0x379e77[_0xa108('0x32')];this[_0xa108('0x18')][_0x379e77['linkedid']][_0xa108('0x67')]=_0x379e77['channel'];this[_0xa108('0x18')][_0x379e77['linkedid']][_0xa108('0x5a')]=dispositions[_[_0xa108('0x68')](_0x379e77[_0xa108('0x4a')])];if(this['agents'][_0x379e77[_0xa108('0x41')][_0xa108('0x3e')]('-')[0x0]]){this[_0xa108('0x18')][_0x379e77[_0xa108('0x38')]][_0xa108('0x69')]=this[_0xa108('0x19')][_0x379e77[_0xa108('0x41')]['split']('-')[0x0]]['id'];this[_0xa108('0x18')][_0x379e77[_0xa108('0x38')]][_0xa108('0x6a')]=this[_0xa108('0x19')][_0x379e77[_0xa108('0x41')][_0xa108('0x3e')]('-')[0x0]][_0xa108('0x45')];}}}}else{if(this[_0xa108('0x18')][_0x379e77[_0xa108('0x36')]]){if(_0x379e77[_0xa108('0x4a')]==='6'){if(this['agents'][_0x379e77[_0xa108('0x41')][_0xa108('0x3e')]('-')[0x0]]){this['channels'][_0x379e77[_0xa108('0x36')]]['UserId']=this[_0xa108('0x19')][_0x379e77[_0xa108('0x41')][_0xa108('0x3e')]('-')[0x0]]['id'];this[_0xa108('0x18')][_0x379e77[_0xa108('0x36')]][_0xa108('0x6a')]=this[_0xa108('0x19')][_0x379e77[_0xa108('0x41')][_0xa108('0x3e')]('-')[0x0]][_0xa108('0x45')];}}}}if(_0x379e77[_0xa108('0x4a')]==='6'&&_0x379e77['context']===_0xa108('0x3d')){if(this['agents'][_0x379e77['channel'][_0xa108('0x3e')]('-')[0x0]]){this['agents'][_0x379e77['channel'][_0xa108('0x3e')]('-')[0x0]]['destconnectedlinenum']=_0x379e77[_0xa108('0x3f')];var _0x163ce3;if(this['channels'][_0x379e77[_0xa108('0x36')]])_0x163ce3=this['channels'][_0x379e77[_0xa108('0x36')]][_0xa108('0x6b')];else if(this[_0xa108('0x18')][_0x379e77['linkedid']])_0x163ce3=this[_0xa108('0x18')][_0x379e77[_0xa108('0x38')]]['routealias'];logger[_0xa108('0x34')](_0xa108('0x6c'),_0x379e77[_0xa108('0x36')],util[_0xa108('0x37')]({'destaccountcode':this[_0xa108('0x19')][_0x379e77[_0xa108('0x41')]['split']('-')[0x0]][_0xa108('0x4e')],'destconnectedlinenum':_0x379e77['exten'],'routealias':_0x163ce3},{'showHidden':![],'depth':null}));this[_0xa108('0x30')](util[_0xa108('0x43')](_0xa108('0x44'),this[_0xa108('0x19')][_0x379e77[_0xa108('0x41')][_0xa108('0x3e')]('-')[0x0]][_0xa108('0x45')]),_0xa108('0x4d'),{'destaccountcode':this['agents'][_0x379e77[_0xa108('0x41')]['split']('-')[0x0]][_0xa108('0x4e')],'destconnectedlinenum':_0x379e77[_0xa108('0x3f')],'routealias':_0x163ce3});}}}}catch(_0x5e6bbb){logger['error']('[%s][voiceCallReport][newstate]',_0x379e77['uniqueid'],util[_0xa108('0x37')](_0x5e6bbb,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa108('0x2d')][_0xa108('0x6d')]=function(_0x200771,_0x477667){try{if(this['channels'][_0x200771]){logger['info'](_0xa108('0x6e'),_0x200771,_0x477667);this[_0xa108('0x18')][_0x200771][_0xa108('0x6f')]=!![];if(_[_0xa108('0x70')](_0x477667,'.wav49')){_0x477667=_0x477667['replace'](_0xa108('0x71'),_0xa108('0x72'));}this[_0xa108('0x18')][_0x200771][_0xa108('0x73')]=_0x477667;var _0x227905=_['find'](this['channels'][_0x200771][_0xa108('0x74')],{'filename':_0x477667});if(_[_0xa108('0x75')](_0x227905)){this[_0xa108('0x18')][_0x200771][_0xa108('0x74')]['push']({'filename':_0x477667,'createdAt':moment()[_0xa108('0x43')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':_0xa108('0x76')});}}}catch(_0x54fa6e){logger['error'](_0xa108('0x77'),_0x200771,util[_0xa108('0x37')](_0x54fa6e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa108('0x2d')][_0xa108('0x1f')]=function(_0x58cd7d){try{if(this[_0xa108('0x2e')](_0x58cd7d)){logger[_0xa108('0x34')](_0xa108('0x78'),_0x58cd7d[_0xa108('0x36')],util['inspect'](_0x58cd7d,{'showHidden':![],'depth':null}));if(this[_0xa108('0x18')][_0x58cd7d[_0xa108('0x36')]]&&_0x58cd7d[_0xa108('0x41')]!=_0xa108('0x47')){if(this['isNotNull'](_0x58cd7d[_0xa108('0x79')])){if(this[_0xa108('0x2e')](_0x58cd7d['variable'][_0xa108('0x7a')])){logger[_0xa108('0x2a')](_0xa108('0x7b'),_0x58cd7d[_0xa108('0x36')],_0x58cd7d[_0xa108('0x7c')]);this[_0xa108('0x6d')](_0x58cd7d[_0xa108('0x36')],_0x58cd7d[_0xa108('0x7c')]);}else if(this[_0xa108('0x2e')](_0x58cd7d[_0xa108('0x79')][_0xa108('0x7d')])){logger[_0xa108('0x2a')]('[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s',_0x58cd7d[_0xa108('0x36')],_0x58cd7d[_0xa108('0x7c')]);this[_0xa108('0x18')][_0x58cd7d[_0xa108('0x36')]]['calleridnum']=_0x58cd7d[_0xa108('0x7c')];}else if(this[_0xa108('0x2e')](_0x58cd7d[_0xa108('0x79')]['xmd-callerid'])){logger[_0xa108('0x2a')](_0xa108('0x7e'),_0x58cd7d['uniqueid'],_0x58cd7d[_0xa108('0x7c')]);this[_0xa108('0x18')][_0x58cd7d['uniqueid']][_0xa108('0x7f')]=_0x58cd7d[_0xa108('0x7c')];}else if(this[_0xa108('0x2e')](_0x58cd7d[_0xa108('0x79')][_0xa108('0x80')])){logger[_0xa108('0x2a')](_0xa108('0x81'),_0x58cd7d[_0xa108('0x36')],_0x58cd7d[_0xa108('0x7c')]);this[_0xa108('0x18')][_0x58cd7d['uniqueid']][_0xa108('0x82')]=_0x58cd7d[_0xa108('0x7c')];}else if(this['isNotNull'](_0x58cd7d[_0xa108('0x79')][_0xa108('0x83')])){logger[_0xa108('0x2a')](_0xa108('0x84'),_0x58cd7d[_0xa108('0x36')],_0x58cd7d[_0xa108('0x7c')]['split'](',')[0x0]);this['channels'][_0x58cd7d[_0xa108('0x36')]][_0xa108('0xf')]=_0x58cd7d['value'][_0xa108('0x3e')](',')[0x0];}else if(this[_0xa108('0x2e')](_0x58cd7d[_0xa108('0x79')]['xmd-originatecalleridnum'])){logger[_0xa108('0x2a')](_0xa108('0x85'),_0x58cd7d['uniqueid'],_0x58cd7d[_0xa108('0x7c')]);this[_0xa108('0x18')][_0x58cd7d[_0xa108('0x36')]]['originatecalleridnum']=_0x58cd7d[_0xa108('0x7c')];}else if(this[_0xa108('0x2e')](_0x58cd7d[_0xa108('0x79')][_0xa108('0x86')])){logger[_0xa108('0x2a')](_0xa108('0x87'),_0x58cd7d['uniqueid'],_0x58cd7d[_0xa108('0x7c')]);this[_0xa108('0x18')][_0x58cd7d[_0xa108('0x36')]][_0xa108('0x88')]=_0x58cd7d[_0xa108('0x7c')];}else if(this[_0xa108('0x2e')](_0x58cd7d[_0xa108('0x79')][_0xa108('0x89')])){logger[_0xa108('0x2a')](_0xa108('0x8a'),_0x58cd7d[_0xa108('0x36')],_0x58cd7d['value']);this['channels'][_0x58cd7d[_0xa108('0x36')]]['calleridpreview']=_0x58cd7d['value'];}else if(this['isNotNull'](_0x58cd7d[_0xa108('0x79')][_0xa108('0x8b')])){logger[_0xa108('0x2a')]('[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s',_0x58cd7d[_0xa108('0x36')],_0x58cd7d['value']);this[_0xa108('0x18')][_0x58cd7d[_0xa108('0x36')]][_0xa108('0xf')]=_0x58cd7d[_0xa108('0x7c')];}else if(this['isNotNull'](_0x58cd7d[_0xa108('0x79')][_0xa108('0x8c')])){logger[_0xa108('0x2a')](_0xa108('0x8d'),_0x58cd7d[_0xa108('0x36')],_0x58cd7d['value']);this[_0xa108('0x18')][_0x58cd7d['uniqueid']][_0xa108('0x8e')]=_0x58cd7d[_0xa108('0x7c')];}}}else if(this['isNotNull'](_0x58cd7d[_0xa108('0x79')][_0xa108('0x7a')])){if(_0x58cd7d[_0xa108('0x7c')]){var _0x5c82a0=path[_0xa108('0x8f')](_0x58cd7d[_0xa108('0x7c')])[_0xa108('0x45')];logger[_0xa108('0x2a')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x5c82a0,_0x58cd7d[_0xa108('0x7c')]);this[_0xa108('0x6d')](_0x5c82a0,_0x58cd7d[_0xa108('0x7c')]);}}else if(this[_0xa108('0x18')][_0x58cd7d[_0xa108('0x38')]]){if(this[_0xa108('0x2e')](_0x58cd7d[_0xa108('0x79')])){if(this[_0xa108('0x2e')](_0x58cd7d[_0xa108('0x79')][_0xa108('0x8c')])){logger[_0xa108('0x2a')](_0xa108('0x8d'),_0x58cd7d[_0xa108('0x38')],_0x58cd7d[_0xa108('0x7c')]);this['channels'][_0x58cd7d['linkedid']][_0xa108('0x90')]=_0x58cd7d['value'];}}}}}catch(_0xfa87fe){logger['error'](_0xa108('0x91'),_0x58cd7d[_0xa108('0x36')],util[_0xa108('0x37')](_0xfa87fe,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xa108('0x21')]=function(_0x317bce){try{if(this[_0xa108('0x2e')](_0x317bce)){logger[_0xa108('0x34')](_0xa108('0x92'),_0x317bce[_0xa108('0x36')],util[_0xa108('0x37')](_0x317bce,{'showHidden':![],'depth':null}));if(this[_0xa108('0x18')][_0x317bce[_0xa108('0x36')]]){logger[_0xa108('0x2a')](_0xa108('0x93'),_0x317bce[_0xa108('0x36')],_0x317bce[_0xa108('0x94')]);var _0x3d5d60=moment();this['channels'][_0x317bce['uniqueid']][_0xa108('0x95')]=_0x3d5d60[_0xa108('0x43')](_0xa108('0x49'));this[_0xa108('0x18')][_0x317bce[_0xa108('0x36')]][_0xa108('0x58')]=_0x3d5d60[_0xa108('0x96')](this[_0xa108('0x18')][_0x317bce[_0xa108('0x36')]][_0xa108('0x65')],'seconds');if(this[_0xa108('0x18')][_0x317bce[_0xa108('0x36')]][_0xa108('0x63')]){this[_0xa108('0x18')][_0x317bce[_0xa108('0x36')]][_0xa108('0x97')]=_0x3d5d60[_0xa108('0x96')](this[_0xa108('0x18')][_0x317bce[_0xa108('0x36')]]['answertime'],_0xa108('0x59'));this[_0xa108('0x18')][_0x317bce[_0xa108('0x36')]][_0xa108('0x64')]=this[_0xa108('0x18')][_0x317bce[_0xa108('0x36')]][_0xa108('0x58')]-this[_0xa108('0x18')][_0x317bce[_0xa108('0x36')]][_0xa108('0x97')];}if(_0x317bce[_0xa108('0x3c')]===_0xa108('0x3d')){if(this['agents'][_0x317bce[_0xa108('0x41')][_0xa108('0x3e')]('-')[0x0]]){this['agents'][_0x317bce[_0xa108('0x41')][_0xa108('0x3e')]('-')[0x0]]=_[_0xa108('0x98')](this['agents'][_0x317bce[_0xa108('0x41')][_0xa108('0x3e')]('-')[0x0]],[_0xa108('0x4b')]);logger[_0xa108('0x34')](_0xa108('0x99'),_0x317bce['uniqueid'],util[_0xa108('0x37')]({'id':this[_0xa108('0x19')][_0x317bce['channel'][_0xa108('0x3e')]('-')[0x0]]['id'],'destaccountcode':this[_0xa108('0x19')][_0x317bce[_0xa108('0x41')][_0xa108('0x3e')]('-')[0x0]][_0xa108('0x4e')]},{'showHidden':![],'depth':null}));this[_0xa108('0x30')](util['format'](_0xa108('0x44'),this[_0xa108('0x19')][_0x317bce[_0xa108('0x41')][_0xa108('0x3e')]('-')[0x0]][_0xa108('0x45')]),_0xa108('0x9a'),{'id':this[_0xa108('0x19')][_0x317bce['channel'][_0xa108('0x3e')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x317bce['channel'][_0xa108('0x3e')]('-')[0x0]]['accountcode']});}}var _0x5293a9=this;Promise['resolve']()[_0xa108('0x9b')](function(){var _0x2d8cde=_0x5293a9[_0xa108('0x18')][_0x317bce['uniqueid']];if(typeof _0x2d8cde[_0xa108('0x9c')]==='undefined')return;if(_[_0xa108('0x9d')](_0x2d8cde[_0xa108('0x74')]))return;return RpcSetting[_0xa108('0x9e')]()[_0xa108('0x9b')](function(_0x343a3c){if(!_0x343a3c[_0xa108('0x9f')])return;return Promise[_0xa108('0xa0')]()[_0xa108('0x9b')](function(){return ami[_0xa108('0xa1')]({'action':'StopMixMonitor','channel':_0x2d8cde[_0xa108('0x41')]})[_0xa108('0xa2')](function(){});})[_0xa108('0x9b')](function(){return ami[_0xa108('0xa1')]({'action':_0xa108('0xa3'),'channel':_0x2d8cde[_0xa108('0x67')]})[_0xa108('0xa2')](function(){})[_0xa108('0xa4')](function(){var _0x1df44c=_0x5293a9[_0xa108('0x19')][_0x2d8cde['destinationchannel']['split']('-')[0x0]];if(!_0x1df44c)return;io['emit'](_0xa108('0xa5'),{'agentId':_0x1df44c['id'],'uniqueid':_0x2d8cde[_0xa108('0x36')]});});});});})[_0xa108('0x9b')](function(){if(_0x317bce['event']===_0xa108('0xa6')){_0x5293a9[_0xa108('0x1a')][_0x317bce[_0xa108('0x36')]]=_0x5293a9[_0xa108('0x18')][_0x317bce[_0xa108('0x36')]];}else{if(_0x5293a9[_0xa108('0x18')][_0x317bce[_0xa108('0x36')]][_0xa108('0x82')]===_0xa108('0xa7')&&_0x5293a9[_0xa108('0x1a')][_0x317bce[_0xa108('0x36')]]){_0x5293a9[_0xa108('0x18')][_0x317bce[_0xa108('0x36')]][_0xa108('0x36')]=[_0x5293a9[_0xa108('0x18')][_0x317bce[_0xa108('0x36')]][_0xa108('0x38')],_0x5293a9[_0xa108('0x18')][_0x317bce['uniqueid']][_0xa108('0x38')]=_0x5293a9[_0xa108('0x18')][_0x317bce[_0xa108('0x36')]][_0xa108('0x36')]][0x0];delete _0x5293a9[_0xa108('0x1a')][_0x317bce[_0xa108('0x36')]];}}logger[_0xa108('0x34')](_0xa108('0xa8'),_0x317bce['uniqueid'],util[_0xa108('0x37')](_0x5293a9['channels'][_0x317bce['uniqueid']],{'showHidden':![],'depth':null}));ami[_0xa108('0x30')](_0xa108('0xa9'),_0x5293a9[_0xa108('0x18')][_0x317bce[_0xa108('0x36')]]);delete _0x5293a9[_0xa108('0x18')][_0x317bce[_0xa108('0x36')]];});}}}catch(_0x5a141b){logger['error'](_0xa108('0xaa'),_0x317bce['uniqueid'],util[_0xa108('0x37')](_0x5a141b,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xa108('0x24')]=function(_0x40d704){try{if(this['isNotNull'](_0x40d704)){logger['info'](_0xa108('0xab'),_0x40d704[_0xa108('0x36')],_0x40d704[_0xa108('0xac')],_0x40d704[_0xa108('0xad')]);logger[_0xa108('0x34')](_0xa108('0xae'),_0x40d704[_0xa108('0x36')],util['inspect'](_0x40d704,{'showHidden':![],'depth':null}));if(this[_0xa108('0x18')][_0x40d704[_0xa108('0xaf')]]){this[_0xa108('0x18')][_0x40d704[_0xa108('0xaf')]][_0xa108('0xb0')]=_0x40d704[_0xa108('0xac')];this['channels'][_0x40d704['transfereeuniqueid']][_0xa108('0xb1')]=_0x40d704[_0xa108('0xad')];if(this[_0xa108('0x18')][_0x40d704['secondtransfereruniqueid']]){var _0x39d573=this['channels'][_0x40d704['secondtransfereruniqueid']];this[_0xa108('0x18')][_0x40d704[_0xa108('0xb2')]]=this[_0xa108('0x18')][_0x40d704[_0xa108('0xaf')]];this[_0xa108('0x18')][_0x40d704[_0xa108('0xaf')]]=_0x39d573;}}else if(this[_0xa108('0x18')][_0x40d704[_0xa108('0xb3')]]){this[_0xa108('0x18')][_0x40d704[_0xa108('0xb3')]]['transfercalleridnum']=_0x40d704[_0xa108('0xac')];this[_0xa108('0x18')][_0x40d704[_0xa108('0xb3')]][_0xa108('0xb1')]=_0x40d704['transfertargetcalleridnum'];if(this[_0xa108('0x18')][_0x40d704[_0xa108('0xb4')]]){var _0x39d573=this[_0xa108('0x18')][_0x40d704[_0xa108('0xb4')]];this[_0xa108('0x18')][_0x40d704[_0xa108('0xb4')]]=this[_0xa108('0x18')][_0x40d704[_0xa108('0xb3')]];this[_0xa108('0x18')][_0x40d704['transfertargetuniqueid']]=_0x39d573;}}if((this[_0xa108('0x18')][_0x40d704[_0xa108('0xb4')]]||this[_0xa108('0x18')][_0x40d704[_0xa108('0xb5')]])&&this[_0xa108('0x18')][_0x40d704[_0xa108('0xb2')]]){var _0xbff822=_[_0xa108('0xb6')]([this[_0xa108('0x18')][_0x40d704[_0xa108('0xb4')]],this[_0xa108('0x18')][_0x40d704[_0xa108('0xb5')]],this[_0xa108('0x18')][_0x40d704[_0xa108('0xb2')]]],function(_0x1b6a39){return _0x1b6a39&&_0x1b6a39[_0xa108('0x82')]==='outbound'&&_0x1b6a39[_0xa108('0xb7')];});if(_0xbff822){if(this[_0xa108('0x18')][_0x40d704[_0xa108('0xb4')]])this[_0xa108('0x18')][_0x40d704[_0xa108('0xb4')]][_0xa108('0x9c')]='ATTENDED';if(this[_0xa108('0x18')][_0x40d704['origtransfererlinkedid']])this['channels'][_0x40d704[_0xa108('0xb5')]][_0xa108('0x9c')]=_0xa108('0xb8');this[_0xa108('0x18')][_0x40d704[_0xa108('0xb2')]][_0xa108('0x9c')]='ATTENDED';}}}}catch(_0x4e3592){logger[_0xa108('0x2c')]('[%s][voiceCallReport][attendedtransfer]',_0x40d704[_0xa108('0x36')],util[_0xa108('0x37')](_0x4e3592,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa108('0x2d')][_0xa108('0xb9')]=function(_0x16d6ae){try{if(this[_0xa108('0x2e')](_0x16d6ae)){logger[_0xa108('0x2a')]('[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x16d6ae['uniqueid'],_0x16d6ae['transfereecalleridnum'],_0x16d6ae[_0xa108('0xba')]);logger[_0xa108('0x34')](_0xa108('0xbb'),_0x16d6ae[_0xa108('0x36')],util['inspect'](_0x16d6ae,{'showHidden':![],'depth':null}));if(this[_0xa108('0x18')][_0x16d6ae['transfereeuniqueid']]){this['channels'][_0x16d6ae[_0xa108('0xaf')]][_0xa108('0xb0')]=_0x16d6ae[_0xa108('0xbc')];this[_0xa108('0x18')][_0x16d6ae[_0xa108('0xaf')]][_0xa108('0xb1')]=_0x16d6ae[_0xa108('0xba')];this['channels'][_0x16d6ae[_0xa108('0xaf')]]['transferType']='BLIND';this['syncHangup']({'event':_0xa108('0xa6'),'uniqueid':_0x16d6ae[_0xa108('0xaf')],'context':_0x16d6ae[_0xa108('0x3c')],'channel':_0x16d6ae[_0xa108('0xbd')]});}else{this[_0xa108('0x18')][_0x16d6ae[_0xa108('0xbe')]]['transferType']=_0xa108('0xbf');}}}catch(_0x41a283){logger[_0xa108('0x2c')]('[%s][voiceCallReport][blindtransfer]',_0x16d6ae['uniqueid'],util[_0xa108('0x37')](_0x41a283,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa108('0x2d')]['syncMusicOnHoldStart']=function(_0x4422df){try{if(this[_0xa108('0x2e')](_0x4422df)){logger['debug'](_0xa108('0xc0'),_0x4422df[_0xa108('0x36')],util['inspect'](_0x4422df,{'showHidden':![],'depth':null}));if(this[_0xa108('0x18')][_0x4422df[_0xa108('0x36')]]){if(!_[_0xa108('0x75')](this['channels'][_0x4422df[_0xa108('0x36')]][_0xa108('0xc1')])){this[_0xa108('0x18')][_0x4422df[_0xa108('0x36')]][_0xa108('0xc2')]=moment()['format'](_0xa108('0x49'));logger[_0xa108('0x2a')](_0xa108('0xc3'),_0x4422df[_0xa108('0x36')],this['channels'][_0x4422df['uniqueid']]['mohstarttime']);}}}}catch(_0x17bce2){logger[_0xa108('0x2c')](_0xa108('0xc4'),_0x4422df[_0xa108('0x36')],util[_0xa108('0x37')](_0x17bce2,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa108('0x2d')]['syncMusicOnHoldStop']=function(_0x1317bd){try{if(this[_0xa108('0x2e')](_0x1317bd)){logger[_0xa108('0x34')](_0xa108('0xc5'),_0x1317bd[_0xa108('0x36')],util['inspect'](_0x1317bd,{'showHidden':![],'depth':null}));if(this['channels'][_0x1317bd['uniqueid']]){if(!_[_0xa108('0x75')](this[_0xa108('0x18')][_0x1317bd[_0xa108('0x36')]][_0xa108('0xc2')])){this[_0xa108('0x18')][_0x1317bd['uniqueid']][_0xa108('0xc6')]+=moment()[_0xa108('0xc7')](0x0)['diff'](this['channels'][_0x1317bd['uniqueid']][_0xa108('0xc2')],_0xa108('0x59'));logger[_0xa108('0x2a')](_0xa108('0xc8'),_0x1317bd[_0xa108('0x36')],this[_0xa108('0x18')][_0x1317bd[_0xa108('0x36')]][_0xa108('0xc6')]);delete this[_0xa108('0x18')][_0x1317bd[_0xa108('0x36')]]['mohstarttime'];}}}}catch(_0x1dec24){logger[_0xa108('0x2c')]('[%s][voiceCallReport][musiconholdstop]',_0x1317bd[_0xa108('0x36')],util[_0xa108('0x37')](_0x1dec24,{'showHidden':![],'depth':null}));}};module[_0xa108('0xc9')]=VoiceCallReport; \ No newline at end of file +var _0xb948=['origtransferercalleridnum','origtransfereruniqueid','some','origtransfererlinkedid','ATTENDED','syncBlindTransfer','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','BlindTransfer','transfererchannel','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','syncMusicOnHoldStart','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','mohstarttime','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]','exports','bluebird','moment','util','path','ioredis','../../../config/environment','ami','../ami','../model/channel','../rpc/setting','not_inuse','busy','invalid','unavailable','ringinuse','onhold','set','queue','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','localhost','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newchannel','syncNewChannel','newstate','syncNewState','varset','syncVarSet','hangup','syncHangup','newcallerid','syncNewCallerId','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','inspect','isUndefined','prototype','emit','isNotNull','uniqueid','calleridname','calleridnum','debug','linkedid','merge','pick','keys','from-sip','channel','split','exten','xcally-motion-preview','destconnectedlinenum','connectedlinenum','format','user:%s','user:agentconnect','[%s][voiceCallReport][newcallerid]','[%s][voiceCallReport][newchannel]\x20event:','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','context','starttime','disposition','toNumber','channelstate','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','accountcode','[%s][voiceCallReport][newchannel]','application','toLowerCase','appdata','startsWith','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','applicationdata','subtract','duration','seconds','YYYY-MM-DD\x20HH:mm:ss','includes','lastapplication','lastdata','cdr(','match','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','holdtime','diff','destinationchannel','membername','name','UserId','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','monitor','endsWith','replace','.WAV','monitorFilename','find','monitors','isNil','push','rec','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','OutgoingSpoolFailed','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','type','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20reason:%s','endtime','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','resolve','then','transferType','isEmpty','getSettings','StopMixMonitor','catch','Action','finally','webbar:stopmonitors','event','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfertargetcalleridnum','transfereeuniqueid','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','transfercalleridnum'];(function(_0x3e0d34,_0x22f14f){var _0x41c02f=function(_0x500ddc){while(--_0x500ddc){_0x3e0d34['push'](_0x3e0d34['shift']());}};_0x41c02f(++_0x22f14f);}(_0xb948,0xe8));var _0x8b94=function(_0x11ca63,_0xea9f9c){_0x11ca63=_0x11ca63-0x0;var _0x41f1f6=_0xb948[_0x11ca63];return _0x41f1f6;};'use strict';var BPromise=require(_0x8b94('0x0'));var _=require('lodash');var moment=require(_0x8b94('0x1'));var util=require(_0x8b94('0x2'));var path=require(_0x8b94('0x3'));var Redis=require(_0x8b94('0x4'));var config=require(_0x8b94('0x5'));var logger=require('../../../config/logger')(_0x8b94('0x6'));var ami=require(_0x8b94('0x7'));var Channel=require(_0x8b94('0x8'));var RpcSetting=require(_0x8b94('0x9'));var statusDesc=['unknown',_0x8b94('0xa'),'inuse',_0x8b94('0xb'),_0x8b94('0xc'),_0x8b94('0xd'),'ringing',_0x8b94('0xe'),_0x8b94('0xf')];var applications=[_0x8b94('0x10'),_0x8b94('0x11'),_0x8b94('0x12'),_0x8b94('0x13'),_0x8b94('0x14'),_0x8b94('0x15')];var dispositions=[_0x8b94('0x16'),'FAILED',_0x8b94('0x17'),_0x8b94('0x16'),_0x8b94('0x16'),_0x8b94('0x16'),_0x8b94('0x18'),_0x8b94('0x19'),_0x8b94('0x17'),_0x8b94('0x17'),_0x8b94('0x17')];var actions={};config[_0x8b94('0x1a')]=_[_0x8b94('0x1b')](config['redis'],{'host':_0x8b94('0x1c'),'port':0x18eb});var io=require(_0x8b94('0x1d'))(new Redis(config[_0x8b94('0x1a')]));function VoiceCallReport(_0x3ec1fc){this[_0x8b94('0x1e')]=_0x3ec1fc[_0x8b94('0x1e')];this[_0x8b94('0x1f')]=_0x3ec1fc[_0x8b94('0x1f')];this[_0x8b94('0x20')]={};ami['on'](_0x8b94('0x21'),this[_0x8b94('0x22')][_0x8b94('0x23')](this));ami['on']('newexten',this[_0x8b94('0x22')]['bind'](this));ami['on'](_0x8b94('0x24'),this[_0x8b94('0x25')][_0x8b94('0x23')](this));ami['on'](_0x8b94('0x26'),this[_0x8b94('0x27')]['bind'](this));ami['on'](_0x8b94('0x28'),this[_0x8b94('0x29')]['bind'](this));ami['on'](_0x8b94('0x2a'),this[_0x8b94('0x2b')][_0x8b94('0x23')](this));ami['on'](_0x8b94('0x2c'),this[_0x8b94('0x2d')][_0x8b94('0x23')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer']['bind'](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x8b94('0x23')](this));ami['on'](_0x8b94('0x2e'),this['syncMusicOnHoldStart'][_0x8b94('0x23')](this));ami['on'](_0x8b94('0x2f'),this[_0x8b94('0x30')][_0x8b94('0x23')](this));try{logger[_0x8b94('0x31')](_0x8b94('0x32'));ami[_0x8b94('0x33')]();}catch(_0x42e3d6){logger[_0x8b94('0x34')](_0x8b94('0x35'),util[_0x8b94('0x36')](_0x42e3d6,{'showHidden':![],'depth':null}));}}VoiceCallReport['prototype']['isNotNull']=function(_0x23c5e6){return _0x23c5e6!==null&&!_[_0x8b94('0x37')](_0x23c5e6);};VoiceCallReport[_0x8b94('0x38')][_0x8b94('0x39')]=function(_0x24d274,_0x3ba731,_0x533ab6){io['to'](_0x24d274)['emit'](_0x3ba731,_0x533ab6);};VoiceCallReport[_0x8b94('0x38')]['syncNewCallerId']=function(_0x36d718){try{if(this[_0x8b94('0x3a')](_0x36d718)){logger[_0x8b94('0x31')]('[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s',_0x36d718[_0x8b94('0x3b')],_0x36d718[_0x8b94('0x3c')],_0x36d718[_0x8b94('0x3d')]);logger[_0x8b94('0x3e')]('[%s][voiceCallReport][newcallerid]\x20event:',_0x36d718['uniqueid'],util['inspect'](_0x36d718,{'showHidden':![],'depth':null}));if(_0x36d718[_0x8b94('0x3b')]===_0x36d718[_0x8b94('0x3f')]){if(!_[_0x8b94('0x37')](this[_0x8b94('0x1e')][_0x36d718[_0x8b94('0x3b')]])){_[_0x8b94('0x40')](this[_0x8b94('0x1e')][_0x36d718['uniqueid']],_[_0x8b94('0x41')](_0x36d718,_[_0x8b94('0x42')](this[_0x8b94('0x1e')][_0x36d718[_0x8b94('0x3b')]])));}}if(_0x36d718['context']===_0x8b94('0x43')){if(this[_0x8b94('0x1f')][_0x36d718[_0x8b94('0x44')][_0x8b94('0x45')]('-')[0x0]]){if(_0x36d718[_0x8b94('0x46')]==_0x8b94('0x47')){this[_0x8b94('0x1f')][_0x36d718[_0x8b94('0x44')][_0x8b94('0x45')]('-')[0x0]][_0x8b94('0x48')]=_0x36d718[_0x8b94('0x49')];this[_0x8b94('0x39')](util[_0x8b94('0x4a')](_0x8b94('0x4b'),this[_0x8b94('0x1f')][_0x36d718[_0x8b94('0x44')]['split']('-')[0x0]]['name']),_0x8b94('0x4c'),{'destaccountcode':this[_0x8b94('0x1f')][_0x36d718[_0x8b94('0x44')][_0x8b94('0x45')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x36d718['connectedlinenum']});}}}}}catch(_0xd1e561){logger[_0x8b94('0x34')](_0x8b94('0x4d'),_0x36d718[_0x8b94('0x3b')],util[_0x8b94('0x36')](_0xd1e561,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8b94('0x38')][_0x8b94('0x25')]=function(_0x52a7ab){try{if(this[_0x8b94('0x3a')](_0x52a7ab)){logger[_0x8b94('0x3e')](_0x8b94('0x4e'),_0x52a7ab[_0x8b94('0x3b')],util[_0x8b94('0x36')](_0x52a7ab,{'showHidden':![],'depth':null}));if(_0x52a7ab[_0x8b94('0x3b')]===_0x52a7ab[_0x8b94('0x3f')]&&_0x52a7ab[_0x8b94('0x44')]!='OutgoingSpoolFailed'){if(_[_0x8b94('0x37')](this['channels'][_0x52a7ab[_0x8b94('0x3b')]])){logger[_0x8b94('0x31')](_0x8b94('0x4f'),_0x52a7ab[_0x8b94('0x3b')],_0x52a7ab[_0x8b94('0x50')],_0x52a7ab[_0x8b94('0x46')]);this['channels'][_0x52a7ab['uniqueid']]=new Channel();this[_0x8b94('0x1e')][_0x52a7ab[_0x8b94('0x3b')]][_0x8b94('0x51')]=moment()[_0x8b94('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x52a7ab[_0x8b94('0x3b')]][_0x8b94('0x52')]=dispositions[_[_0x8b94('0x53')](_0x52a7ab[_0x8b94('0x54')])];_[_0x8b94('0x40')](this[_0x8b94('0x1e')][_0x52a7ab['uniqueid']],_[_0x8b94('0x41')](_0x52a7ab,_[_0x8b94('0x42')](this[_0x8b94('0x1e')][_0x52a7ab['uniqueid']])));if(_0x52a7ab[_0x8b94('0x50')]==='from-sip'){if(this[_0x8b94('0x1f')][_0x52a7ab[_0x8b94('0x44')]['split']('-')[0x0]]){if(_[_0x8b94('0x37')](this['agents'][_0x52a7ab['channel'][_0x8b94('0x45')]('-')[0x0]][_0x8b94('0x48')])){this[_0x8b94('0x1f')][_0x52a7ab[_0x8b94('0x44')]['split']('-')[0x0]]['destconnectedlinenum']=_0x52a7ab[_0x8b94('0x46')];logger[_0x8b94('0x3e')](_0x8b94('0x55'),_0x52a7ab[_0x8b94('0x3b')],util[_0x8b94('0x36')]({'destaccountcode':this[_0x8b94('0x1f')][_0x52a7ab[_0x8b94('0x44')][_0x8b94('0x45')]('-')[0x0]][_0x8b94('0x56')],'destconnectedlinenum':_0x52a7ab['exten']},{'showHidden':![],'depth':null}));this[_0x8b94('0x39')](util[_0x8b94('0x4a')]('user:%s',this[_0x8b94('0x1f')][_0x52a7ab[_0x8b94('0x44')][_0x8b94('0x45')]('-')[0x0]]['name']),_0x8b94('0x4c'),{'destaccountcode':this[_0x8b94('0x1f')][_0x52a7ab[_0x8b94('0x44')]['split']('-')[0x0]][_0x8b94('0x56')],'destconnectedlinenum':_0x52a7ab[_0x8b94('0x46')]});}}}}}}}catch(_0x40a654){logger[_0x8b94('0x34')](_0x8b94('0x57'),_0x52a7ab[_0x8b94('0x3b')],util[_0x8b94('0x36')](_0x40a654,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8b94('0x38')][_0x8b94('0x22')]=function(_0x20ecb5){try{if(this[_0x8b94('0x3a')](_0x20ecb5)){logger['debug']('[%s][voiceCallReport][newexten]\x20event:',_0x20ecb5[_0x8b94('0x3b')],util[_0x8b94('0x36')](_0x20ecb5,{'showHidden':![],'depth':null}));if(_0x20ecb5[_0x8b94('0x3b')]===_0x20ecb5[_0x8b94('0x3f')]&&_0x20ecb5[_0x8b94('0x46')]!='h'&&_0x20ecb5[_0x8b94('0x44')]!='OutgoingSpoolFailed'){_0x20ecb5[_0x8b94('0x58')]=_0x20ecb5[_0x8b94('0x58')][_0x8b94('0x59')]();_0x20ecb5['applicationdata']=_0x20ecb5[_0x8b94('0x5a')]&&_0x20ecb5[_0x8b94('0x5a')][_0x8b94('0x5b')](_0x8b94('0x5c'))?_0x20ecb5[_0x8b94('0x5a')]:(_0x20ecb5['appdata']||_0x20ecb5['applicationdata'])[_0x8b94('0x59')]();logger[_0x8b94('0x31')](_0x8b94('0x5d'),_0x20ecb5[_0x8b94('0x3b')],_0x20ecb5[_0x8b94('0x58')],_0x20ecb5[_0x8b94('0x5e')]);if(_[_0x8b94('0x37')](this['channels'][_0x20ecb5[_0x8b94('0x3b')]])){this[_0x8b94('0x1e')][_0x20ecb5[_0x8b94('0x3b')]]=new Channel();this[_0x8b94('0x1e')][_0x20ecb5[_0x8b94('0x3b')]][_0x8b94('0x51')]=_0x20ecb5['duration']?moment()[_0x8b94('0x5f')](moment[_0x8b94('0x60')](_0x20ecb5['duration'])['seconds'](),_0x8b94('0x61'))[_0x8b94('0x4a')](_0x8b94('0x62')):moment()[_0x8b94('0x4a')](_0x8b94('0x62'));this[_0x8b94('0x1e')][_0x20ecb5[_0x8b94('0x3b')]][_0x8b94('0x52')]=_0x8b94('0x16');}_[_0x8b94('0x40')](this[_0x8b94('0x1e')][_0x20ecb5[_0x8b94('0x3b')]],_[_0x8b94('0x41')](_0x20ecb5,_[_0x8b94('0x42')](this[_0x8b94('0x1e')][_0x20ecb5[_0x8b94('0x3b')]])));if(_[_0x8b94('0x63')](applications,_0x20ecb5[_0x8b94('0x58')])){this[_0x8b94('0x1e')][_0x20ecb5[_0x8b94('0x3b')]][_0x8b94('0x64')]=_0x20ecb5[_0x8b94('0x58')];this['channels'][_0x20ecb5[_0x8b94('0x3b')]][_0x8b94('0x65')]=_0x20ecb5[_0x8b94('0x5e')];if(_0x20ecb5[_0x8b94('0x58')]===_0x8b94('0x10')&&_[_0x8b94('0x5b')](_0x20ecb5['applicationdata']['toLowerCase'](),_0x8b94('0x66'))){var _0x1c8b15=_0x20ecb5[_0x8b94('0x5e')]['split']('=');var _0x416e8a=_0x1c8b15[0x0][_0x8b94('0x59')]()[_0x8b94('0x67')](/cdr\((.*)\)/);if(_0x416e8a){this[_0x8b94('0x1e')][_0x20ecb5['uniqueid']][_0x416e8a[0x1]]=_0x1c8b15[0x1];}}else if(_0x20ecb5[_0x8b94('0x58')]===_0x8b94('0x11')){this[_0x8b94('0x1e')][_0x20ecb5[_0x8b94('0x3b')]][_0x8b94('0x11')]=_0x20ecb5[_0x8b94('0x5e')][_0x8b94('0x45')](',')[0x0];}}}}}catch(_0x5b565e){logger[_0x8b94('0x34')]('[%s][voiceCallReport][newexten]',_0x20ecb5[_0x8b94('0x3b')],util[_0x8b94('0x36')](_0x5b565e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8b94('0x38')][_0x8b94('0x27')]=function(_0x5bbf9f){try{if(this[_0x8b94('0x3a')](_0x5bbf9f)){logger[_0x8b94('0x31')](_0x8b94('0x68'),_0x5bbf9f[_0x8b94('0x3b')],_0x5bbf9f[_0x8b94('0x3f')],_0x5bbf9f['calleridname'],_0x5bbf9f[_0x8b94('0x3d')]);logger[_0x8b94('0x3e')](_0x8b94('0x69'),_0x5bbf9f[_0x8b94('0x3b')],util[_0x8b94('0x36')](_0x5bbf9f,{'showHidden':![],'depth':null}));if(_0x5bbf9f[_0x8b94('0x3b')]!==_0x5bbf9f[_0x8b94('0x3f')]){if(this[_0x8b94('0x1e')][_0x5bbf9f[_0x8b94('0x3f')]]){if(_0x5bbf9f[_0x8b94('0x54')]==='6'){if(!this[_0x8b94('0x1e')][_0x5bbf9f['linkedid']][_0x8b94('0x6a')]){var _0x3fad9b=moment();this[_0x8b94('0x1e')][_0x5bbf9f['linkedid']][_0x8b94('0x6a')]=!![];this['channels'][_0x5bbf9f[_0x8b94('0x3f')]][_0x8b94('0x6b')]=_0x3fad9b['format']('YYYY-MM-DD\x20HH:mm:ss');if(this[_0x8b94('0x1e')][_0x5bbf9f[_0x8b94('0x3f')]][_0x8b94('0x51')]){this['channels'][_0x5bbf9f[_0x8b94('0x3f')]][_0x8b94('0x6c')]=_0x3fad9b[_0x8b94('0x6d')](this[_0x8b94('0x1e')][_0x5bbf9f[_0x8b94('0x3f')]][_0x8b94('0x51')],_0x8b94('0x61'));}}this[_0x8b94('0x1e')][_0x5bbf9f['linkedid']][_0x8b94('0x3f')]=_0x5bbf9f[_0x8b94('0x3b')];if(_0x5bbf9f[_0x8b94('0x3d')]!=='xcally-motion-preview'){this[_0x8b94('0x1e')][_0x5bbf9f[_0x8b94('0x3f')]]['connectedlinenum']=_0x5bbf9f[_0x8b94('0x3d')];}this[_0x8b94('0x1e')][_0x5bbf9f[_0x8b94('0x3f')]]['connectedlinename']=_0x5bbf9f['calleridname'];this[_0x8b94('0x1e')][_0x5bbf9f['linkedid']][_0x8b94('0x6e')]=_0x5bbf9f['channel'];this[_0x8b94('0x1e')][_0x5bbf9f[_0x8b94('0x3f')]][_0x8b94('0x52')]=dispositions[_[_0x8b94('0x53')](_0x5bbf9f[_0x8b94('0x54')])];if(this[_0x8b94('0x1f')][_0x5bbf9f[_0x8b94('0x44')][_0x8b94('0x45')]('-')[0x0]]){this[_0x8b94('0x1e')][_0x5bbf9f['linkedid']]['UserId']=this['agents'][_0x5bbf9f[_0x8b94('0x44')]['split']('-')[0x0]]['id'];this['channels'][_0x5bbf9f[_0x8b94('0x3f')]][_0x8b94('0x6f')]=this[_0x8b94('0x1f')][_0x5bbf9f['channel'][_0x8b94('0x45')]('-')[0x0]][_0x8b94('0x70')];}}}}else{if(this[_0x8b94('0x1e')][_0x5bbf9f[_0x8b94('0x3b')]]){if(_0x5bbf9f['channelstate']==='6'){if(this['agents'][_0x5bbf9f[_0x8b94('0x44')][_0x8b94('0x45')]('-')[0x0]]){this[_0x8b94('0x1e')][_0x5bbf9f[_0x8b94('0x3b')]][_0x8b94('0x71')]=this[_0x8b94('0x1f')][_0x5bbf9f['channel'][_0x8b94('0x45')]('-')[0x0]]['id'];this['channels'][_0x5bbf9f[_0x8b94('0x3b')]][_0x8b94('0x6f')]=this[_0x8b94('0x1f')][_0x5bbf9f[_0x8b94('0x44')][_0x8b94('0x45')]('-')[0x0]]['name'];}}}}if(_0x5bbf9f[_0x8b94('0x54')]==='6'&&_0x5bbf9f['context']===_0x8b94('0x43')){if(this[_0x8b94('0x1f')][_0x5bbf9f['channel']['split']('-')[0x0]]){this[_0x8b94('0x1f')][_0x5bbf9f[_0x8b94('0x44')]['split']('-')[0x0]][_0x8b94('0x48')]=_0x5bbf9f[_0x8b94('0x46')];var _0x4c3505;if(this[_0x8b94('0x1e')][_0x5bbf9f[_0x8b94('0x3b')]])_0x4c3505=this[_0x8b94('0x1e')][_0x5bbf9f[_0x8b94('0x3b')]][_0x8b94('0x72')];else if(this[_0x8b94('0x1e')][_0x5bbf9f['linkedid']])_0x4c3505=this[_0x8b94('0x1e')][_0x5bbf9f[_0x8b94('0x3f')]][_0x8b94('0x72')];logger[_0x8b94('0x3e')](_0x8b94('0x73'),_0x5bbf9f[_0x8b94('0x3b')],util[_0x8b94('0x36')]({'destaccountcode':this[_0x8b94('0x1f')][_0x5bbf9f[_0x8b94('0x44')]['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x5bbf9f[_0x8b94('0x46')],'routealias':_0x4c3505},{'showHidden':![],'depth':null}));this[_0x8b94('0x39')](util[_0x8b94('0x4a')]('user:%s',this['agents'][_0x5bbf9f[_0x8b94('0x44')][_0x8b94('0x45')]('-')[0x0]][_0x8b94('0x70')]),_0x8b94('0x4c'),{'destaccountcode':this[_0x8b94('0x1f')][_0x5bbf9f['channel'][_0x8b94('0x45')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x5bbf9f[_0x8b94('0x46')],'routealias':_0x4c3505});}}}}catch(_0x588def){logger[_0x8b94('0x34')](_0x8b94('0x74'),_0x5bbf9f['uniqueid'],util['inspect'](_0x588def,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8b94('0x38')][_0x8b94('0x75')]=function(_0x4f29f0,_0x3f5985){try{if(this[_0x8b94('0x1e')][_0x4f29f0]){logger['info']('[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s',_0x4f29f0,_0x3f5985);this[_0x8b94('0x1e')][_0x4f29f0][_0x8b94('0x76')]=!![];if(_[_0x8b94('0x77')](_0x3f5985,'.wav49')){_0x3f5985=_0x3f5985[_0x8b94('0x78')]('.wav49',_0x8b94('0x79'));}this[_0x8b94('0x1e')][_0x4f29f0][_0x8b94('0x7a')]=_0x3f5985;var _0x28a1a7=_[_0x8b94('0x7b')](this[_0x8b94('0x1e')][_0x4f29f0][_0x8b94('0x7c')],{'filename':_0x3f5985});if(_[_0x8b94('0x7d')](_0x28a1a7)){this[_0x8b94('0x1e')][_0x4f29f0][_0x8b94('0x7c')][_0x8b94('0x7e')]({'filename':_0x3f5985,'createdAt':moment()[_0x8b94('0x4a')](_0x8b94('0x62')),'mixmonitorid':'','status':_0x8b94('0x7f')});}}}catch(_0x3ceb07){logger[_0x8b94('0x34')](_0x8b94('0x80'),_0x4f29f0,util[_0x8b94('0x36')](_0x3ceb07,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8b94('0x38')]['syncVarSet']=function(_0x3a82f5){try{if(this[_0x8b94('0x3a')](_0x3a82f5)){logger[_0x8b94('0x3e')](_0x8b94('0x81'),_0x3a82f5[_0x8b94('0x3b')],util[_0x8b94('0x36')](_0x3a82f5,{'showHidden':![],'depth':null}));if(this[_0x8b94('0x1e')][_0x3a82f5[_0x8b94('0x3b')]]&&_0x3a82f5[_0x8b94('0x44')]!=_0x8b94('0x82')){if(this[_0x8b94('0x3a')](_0x3a82f5['variable'])){if(this[_0x8b94('0x3a')](_0x3a82f5[_0x8b94('0x83')][_0x8b94('0x84')])){logger[_0x8b94('0x31')](_0x8b94('0x85'),_0x3a82f5['uniqueid'],_0x3a82f5[_0x8b94('0x86')]);this[_0x8b94('0x75')](_0x3a82f5[_0x8b94('0x3b')],_0x3a82f5['value']);}else if(this[_0x8b94('0x3a')](_0x3a82f5[_0x8b94('0x83')][_0x8b94('0x87')])){logger['info'](_0x8b94('0x88'),_0x3a82f5['uniqueid'],_0x3a82f5[_0x8b94('0x86')]);this[_0x8b94('0x1e')][_0x3a82f5['uniqueid']]['calleridnum']=_0x3a82f5[_0x8b94('0x86')];}else if(this[_0x8b94('0x3a')](_0x3a82f5[_0x8b94('0x83')][_0x8b94('0x89')])){logger[_0x8b94('0x31')](_0x8b94('0x8a'),_0x3a82f5[_0x8b94('0x3b')],_0x3a82f5[_0x8b94('0x86')]);this[_0x8b94('0x1e')][_0x3a82f5[_0x8b94('0x3b')]][_0x8b94('0x8b')]=_0x3a82f5[_0x8b94('0x86')];}else if(this[_0x8b94('0x3a')](_0x3a82f5[_0x8b94('0x83')][_0x8b94('0x8c')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x3a82f5[_0x8b94('0x3b')],_0x3a82f5[_0x8b94('0x86')]);this[_0x8b94('0x1e')][_0x3a82f5[_0x8b94('0x3b')]][_0x8b94('0x8d')]=_0x3a82f5[_0x8b94('0x86')];}else if(this[_0x8b94('0x3a')](_0x3a82f5[_0x8b94('0x83')][_0x8b94('0x8e')])){logger[_0x8b94('0x31')](_0x8b94('0x8f'),_0x3a82f5['uniqueid'],_0x3a82f5['value'][_0x8b94('0x45')](',')[0x0]);this[_0x8b94('0x1e')][_0x3a82f5[_0x8b94('0x3b')]][_0x8b94('0x11')]=_0x3a82f5[_0x8b94('0x86')]['split'](',')[0x0];}else if(this['isNotNull'](_0x3a82f5['variable'][_0x8b94('0x90')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x3a82f5['uniqueid'],_0x3a82f5[_0x8b94('0x86')]);this[_0x8b94('0x1e')][_0x3a82f5[_0x8b94('0x3b')]][_0x8b94('0x91')]=_0x3a82f5[_0x8b94('0x86')];}else if(this[_0x8b94('0x3a')](_0x3a82f5[_0x8b94('0x83')][_0x8b94('0x92')])){logger[_0x8b94('0x31')](_0x8b94('0x93'),_0x3a82f5[_0x8b94('0x3b')],_0x3a82f5[_0x8b94('0x86')]);this[_0x8b94('0x1e')][_0x3a82f5['uniqueid']][_0x8b94('0x94')]=_0x3a82f5['value'];}else if(this[_0x8b94('0x3a')](_0x3a82f5[_0x8b94('0x83')][_0x8b94('0x95')])){logger[_0x8b94('0x31')](_0x8b94('0x96'),_0x3a82f5[_0x8b94('0x3b')],_0x3a82f5['value']);this[_0x8b94('0x1e')][_0x3a82f5[_0x8b94('0x3b')]][_0x8b94('0x97')]=_0x3a82f5[_0x8b94('0x86')];}else if(this[_0x8b94('0x3a')](_0x3a82f5[_0x8b94('0x83')][_0x8b94('0x98')])){logger[_0x8b94('0x31')](_0x8b94('0x99'),_0x3a82f5[_0x8b94('0x3b')],_0x3a82f5[_0x8b94('0x86')]);this[_0x8b94('0x1e')][_0x3a82f5[_0x8b94('0x3b')]]['queue']=_0x3a82f5[_0x8b94('0x86')];}else if(this['isNotNull'](_0x3a82f5['variable'][_0x8b94('0x9a')])){logger[_0x8b94('0x31')](_0x8b94('0x9b'),_0x3a82f5[_0x8b94('0x3b')],_0x3a82f5[_0x8b94('0x86')]);this[_0x8b94('0x1e')][_0x3a82f5[_0x8b94('0x3b')]][_0x8b94('0x9c')]=_0x3a82f5['value'];}}}else if(this[_0x8b94('0x3a')](_0x3a82f5['variable'][_0x8b94('0x84')])){if(_0x3a82f5[_0x8b94('0x86')]){var _0xc38640=path[_0x8b94('0x9d')](_0x3a82f5[_0x8b94('0x86')])['name'];logger[_0x8b94('0x31')](_0x8b94('0x85'),_0xc38640,_0x3a82f5[_0x8b94('0x86')]);this[_0x8b94('0x75')](_0xc38640,_0x3a82f5[_0x8b94('0x86')]);}}else if(this[_0x8b94('0x1e')][_0x3a82f5[_0x8b94('0x3f')]]){if(this['isNotNull'](_0x3a82f5[_0x8b94('0x83')])){if(this[_0x8b94('0x3a')](_0x3a82f5[_0x8b94('0x83')][_0x8b94('0x9a')])){logger['info'](_0x8b94('0x9b'),_0x3a82f5[_0x8b94('0x3f')],_0x3a82f5['value']);this[_0x8b94('0x1e')][_0x3a82f5[_0x8b94('0x3f')]][_0x8b94('0x9e')]=_0x3a82f5[_0x8b94('0x86')];}}}}}catch(_0x25e36a){logger[_0x8b94('0x34')](_0x8b94('0x9f'),_0x3a82f5['uniqueid'],util[_0x8b94('0x36')](_0x25e36a,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncHangup']=function(_0x2b5d8e){try{if(this[_0x8b94('0x3a')](_0x2b5d8e)){logger[_0x8b94('0x3e')]('[%s][voiceCallReport][hangup]\x20event:',_0x2b5d8e[_0x8b94('0x3b')],util[_0x8b94('0x36')](_0x2b5d8e,{'showHidden':![],'depth':null}));if(this['channels'][_0x2b5d8e[_0x8b94('0x3b')]]){logger['info'](_0x8b94('0xa0'),_0x2b5d8e[_0x8b94('0x3b')],_0x2b5d8e['cause-txt']);var _0x15f228=moment();this[_0x8b94('0x1e')][_0x2b5d8e['uniqueid']][_0x8b94('0xa1')]=_0x15f228[_0x8b94('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x8b94('0x1e')][_0x2b5d8e['uniqueid']][_0x8b94('0x60')]=_0x15f228[_0x8b94('0x6d')](this[_0x8b94('0x1e')][_0x2b5d8e[_0x8b94('0x3b')]]['starttime'],_0x8b94('0x61'));if(this[_0x8b94('0x1e')][_0x2b5d8e[_0x8b94('0x3b')]][_0x8b94('0x6a')]){this[_0x8b94('0x1e')][_0x2b5d8e['uniqueid']]['billableseconds']=_0x15f228[_0x8b94('0x6d')](this[_0x8b94('0x1e')][_0x2b5d8e[_0x8b94('0x3b')]][_0x8b94('0x6b')],_0x8b94('0x61'));this[_0x8b94('0x1e')][_0x2b5d8e[_0x8b94('0x3b')]][_0x8b94('0x6c')]=this[_0x8b94('0x1e')][_0x2b5d8e['uniqueid']][_0x8b94('0x60')]-this[_0x8b94('0x1e')][_0x2b5d8e[_0x8b94('0x3b')]][_0x8b94('0xa2')];}if(_0x2b5d8e['context']===_0x8b94('0x43')){if(this[_0x8b94('0x1f')][_0x2b5d8e[_0x8b94('0x44')]['split']('-')[0x0]]){this['agents'][_0x2b5d8e[_0x8b94('0x44')]['split']('-')[0x0]]=_[_0x8b94('0xa3')](this[_0x8b94('0x1f')][_0x2b5d8e[_0x8b94('0x44')][_0x8b94('0x45')]('-')[0x0]],['destconnectedlinenum']);logger['debug'](_0x8b94('0xa4'),_0x2b5d8e[_0x8b94('0x3b')],util[_0x8b94('0x36')]({'id':this['agents'][_0x2b5d8e[_0x8b94('0x44')][_0x8b94('0x45')]('-')[0x0]]['id'],'destaccountcode':this[_0x8b94('0x1f')][_0x2b5d8e[_0x8b94('0x44')]['split']('-')[0x0]][_0x8b94('0x56')]},{'showHidden':![],'depth':null}));this['emit'](util[_0x8b94('0x4a')](_0x8b94('0x4b'),this[_0x8b94('0x1f')][_0x2b5d8e['channel'][_0x8b94('0x45')]('-')[0x0]][_0x8b94('0x70')]),_0x8b94('0xa5'),{'id':this[_0x8b94('0x1f')][_0x2b5d8e[_0x8b94('0x44')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0x8b94('0x1f')][_0x2b5d8e[_0x8b94('0x44')]['split']('-')[0x0]]['accountcode']});}}var _0x3c5c49=this;Promise[_0x8b94('0xa6')]()[_0x8b94('0xa7')](function(){var _0x3bc687=_0x3c5c49['channels'][_0x2b5d8e[_0x8b94('0x3b')]];if(typeof _0x3bc687[_0x8b94('0xa8')]==='undefined')return;if(_[_0x8b94('0xa9')](_0x3bc687['monitors']))return;return RpcSetting[_0x8b94('0xaa')]()['then'](function(_0x298a43){if(!_0x298a43['stopRecordingOnTransfer'])return;return Promise[_0x8b94('0xa6')]()['then'](function(){return ami['Action']({'action':_0x8b94('0xab'),'channel':_0x3bc687[_0x8b94('0x44')]})[_0x8b94('0xac')](function(){});})[_0x8b94('0xa7')](function(){return ami[_0x8b94('0xad')]({'action':'StopMixMonitor','channel':_0x3bc687[_0x8b94('0x6e')]})[_0x8b94('0xac')](function(){})[_0x8b94('0xae')](function(){var _0x1df7c3=_0x3c5c49[_0x8b94('0x1f')][_0x3bc687['destinationchannel']['split']('-')[0x0]];if(!_0x1df7c3)return;io['emit'](_0x8b94('0xaf'),{'agentId':_0x1df7c3['id'],'uniqueid':_0x3bc687[_0x8b94('0x3b')]});});});});})['then'](function(){if(_0x2b5d8e[_0x8b94('0xb0')]==='BlindTransfer'){_0x3c5c49['blindTransfers'][_0x2b5d8e['uniqueid']]=_0x3c5c49['channels'][_0x2b5d8e[_0x8b94('0x3b')]];}else{if(_0x3c5c49[_0x8b94('0x1e')][_0x2b5d8e[_0x8b94('0x3b')]][_0x8b94('0x8d')]===_0x8b94('0xb1')&&_0x3c5c49[_0x8b94('0x20')][_0x2b5d8e[_0x8b94('0x3b')]]){_0x3c5c49[_0x8b94('0x1e')][_0x2b5d8e['uniqueid']][_0x8b94('0x3b')]=[_0x3c5c49['channels'][_0x2b5d8e[_0x8b94('0x3b')]]['linkedid'],_0x3c5c49[_0x8b94('0x1e')][_0x2b5d8e[_0x8b94('0x3b')]][_0x8b94('0x3f')]=_0x3c5c49[_0x8b94('0x1e')][_0x2b5d8e[_0x8b94('0x3b')]][_0x8b94('0x3b')]][0x0];delete _0x3c5c49[_0x8b94('0x20')][_0x2b5d8e['uniqueid']];}}logger['debug'](_0x8b94('0xb2'),_0x2b5d8e[_0x8b94('0x3b')],util[_0x8b94('0x36')](_0x3c5c49[_0x8b94('0x1e')][_0x2b5d8e[_0x8b94('0x3b')]],{'showHidden':![],'depth':null}));ami['emit'](_0x8b94('0xb3'),_0x3c5c49[_0x8b94('0x1e')][_0x2b5d8e['uniqueid']]);delete _0x3c5c49[_0x8b94('0x1e')][_0x2b5d8e[_0x8b94('0x3b')]];});}}}catch(_0x4ade3e){logger['error'](_0x8b94('0xb4'),_0x2b5d8e[_0x8b94('0x3b')],util[_0x8b94('0x36')](_0x4ade3e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8b94('0x38')]['syncAttendedTransfer']=function(_0x4eab39){try{if(this['isNotNull'](_0x4eab39)){logger['info'](_0x8b94('0xb5'),_0x4eab39[_0x8b94('0x3b')],_0x4eab39['origtransferercalleridnum'],_0x4eab39[_0x8b94('0xb6')]);logger[_0x8b94('0x3e')]('[%s][voiceCallReport][attendedtransfer]\x20event:',_0x4eab39[_0x8b94('0x3b')],util[_0x8b94('0x36')](_0x4eab39,{'showHidden':![],'depth':null}));if(this[_0x8b94('0x1e')][_0x4eab39['transfereeuniqueid']]){this[_0x8b94('0x1e')][_0x4eab39[_0x8b94('0xb7')]]['transfercalleridnum']=_0x4eab39['origtransferercalleridnum'];this[_0x8b94('0x1e')][_0x4eab39[_0x8b94('0xb7')]][_0x8b94('0xb8')]=_0x4eab39[_0x8b94('0xb6')];if(this[_0x8b94('0x1e')][_0x4eab39[_0x8b94('0xb9')]]){var _0x5f190c=this[_0x8b94('0x1e')][_0x4eab39[_0x8b94('0xb9')]];this[_0x8b94('0x1e')][_0x4eab39['secondtransfereruniqueid']]=this[_0x8b94('0x1e')][_0x4eab39[_0x8b94('0xb7')]];this[_0x8b94('0x1e')][_0x4eab39['transfereeuniqueid']]=_0x5f190c;}}else if(this[_0x8b94('0x1e')][_0x4eab39[_0x8b94('0xba')]]){this['channels'][_0x4eab39['transfertargetuniqueid']][_0x8b94('0xbb')]=_0x4eab39[_0x8b94('0xbc')];this[_0x8b94('0x1e')][_0x4eab39[_0x8b94('0xba')]][_0x8b94('0xb8')]=_0x4eab39[_0x8b94('0xb6')];if(this[_0x8b94('0x1e')][_0x4eab39[_0x8b94('0xbd')]]){var _0x5f190c=this[_0x8b94('0x1e')][_0x4eab39[_0x8b94('0xbd')]];this[_0x8b94('0x1e')][_0x4eab39[_0x8b94('0xbd')]]=this[_0x8b94('0x1e')][_0x4eab39['transfertargetuniqueid']];this[_0x8b94('0x1e')][_0x4eab39[_0x8b94('0xba')]]=_0x5f190c;}}if((this[_0x8b94('0x1e')][_0x4eab39[_0x8b94('0xbd')]]||this[_0x8b94('0x1e')][_0x4eab39['origtransfererlinkedid']])&&this[_0x8b94('0x1e')][_0x4eab39['secondtransfereruniqueid']]){var _0x54e211=_[_0x8b94('0xbe')]([this['channels'][_0x4eab39[_0x8b94('0xbd')]],this[_0x8b94('0x1e')][_0x4eab39[_0x8b94('0xbf')]],this[_0x8b94('0x1e')][_0x4eab39[_0x8b94('0xb9')]]],function(_0x200950){return _0x200950&&_0x200950[_0x8b94('0x8d')]===_0x8b94('0xb1')&&_0x200950['routeid'];});if(_0x54e211){if(this[_0x8b94('0x1e')][_0x4eab39[_0x8b94('0xbd')]])this[_0x8b94('0x1e')][_0x4eab39[_0x8b94('0xbd')]][_0x8b94('0xa8')]=_0x8b94('0xc0');if(this[_0x8b94('0x1e')][_0x4eab39[_0x8b94('0xbf')]])this[_0x8b94('0x1e')][_0x4eab39[_0x8b94('0xbf')]][_0x8b94('0xa8')]='ATTENDED';this[_0x8b94('0x1e')][_0x4eab39[_0x8b94('0xb9')]][_0x8b94('0xa8')]=_0x8b94('0xc0');}}}}catch(_0xbec416){logger[_0x8b94('0x34')]('[%s][voiceCallReport][attendedtransfer]',_0x4eab39['uniqueid'],util[_0x8b94('0x36')](_0xbec416,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x8b94('0xc1')]=function(_0x576b5e){try{if(this['isNotNull'](_0x576b5e)){logger[_0x8b94('0x31')](_0x8b94('0xc2'),_0x576b5e[_0x8b94('0x3b')],_0x576b5e[_0x8b94('0xc3')],_0x576b5e[_0x8b94('0xc4')]);logger['debug']('[%s][voiceCallReport][blindtransfer]\x20event:',_0x576b5e['uniqueid'],util['inspect'](_0x576b5e,{'showHidden':![],'depth':null}));if(this['channels'][_0x576b5e['transfereeuniqueid']]){this[_0x8b94('0x1e')][_0x576b5e[_0x8b94('0xb7')]][_0x8b94('0xbb')]=_0x576b5e[_0x8b94('0xc3')];this['channels'][_0x576b5e[_0x8b94('0xb7')]]['transferconnectedlinenum']=_0x576b5e[_0x8b94('0xc4')];this['channels'][_0x576b5e[_0x8b94('0xb7')]][_0x8b94('0xa8')]='BLIND';this[_0x8b94('0x2b')]({'event':_0x8b94('0xc5'),'uniqueid':_0x576b5e[_0x8b94('0xb7')],'context':_0x576b5e[_0x8b94('0x50')],'channel':_0x576b5e[_0x8b94('0xc6')]});}else{this[_0x8b94('0x1e')][_0x576b5e[_0x8b94('0xc7')]][_0x8b94('0xa8')]='BLIND';}}}catch(_0x14dac4){logger['error'](_0x8b94('0xc8'),_0x576b5e[_0x8b94('0x3b')],util[_0x8b94('0x36')](_0x14dac4,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8b94('0x38')][_0x8b94('0xc9')]=function(_0x15c2be){try{if(this['isNotNull'](_0x15c2be)){logger[_0x8b94('0x3e')]('[%s][voiceCallReport][musiconholdstart]\x20event:',_0x15c2be['uniqueid'],util[_0x8b94('0x36')](_0x15c2be,{'showHidden':![],'depth':null}));if(this[_0x8b94('0x1e')][_0x15c2be[_0x8b94('0x3b')]]){if(!_['isNil'](this[_0x8b94('0x1e')][_0x15c2be[_0x8b94('0x3b')]][_0x8b94('0x6b')])){this[_0x8b94('0x1e')][_0x15c2be['uniqueid']]['mohstarttime']=moment()[_0x8b94('0x4a')](_0x8b94('0x62'));logger[_0x8b94('0x31')](_0x8b94('0xca'),_0x15c2be[_0x8b94('0x3b')],this[_0x8b94('0x1e')][_0x15c2be[_0x8b94('0x3b')]][_0x8b94('0xcb')]);}}}}catch(_0x2ba97e){logger[_0x8b94('0x34')](_0x8b94('0xcc'),_0x15c2be[_0x8b94('0x3b')],util[_0x8b94('0x36')](_0x2ba97e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8b94('0x38')][_0x8b94('0x30')]=function(_0x5a4e8b){try{if(this[_0x8b94('0x3a')](_0x5a4e8b)){logger[_0x8b94('0x3e')](_0x8b94('0xcd'),_0x5a4e8b['uniqueid'],util[_0x8b94('0x36')](_0x5a4e8b,{'showHidden':![],'depth':null}));if(this[_0x8b94('0x1e')][_0x5a4e8b['uniqueid']]){if(!_['isNil'](this[_0x8b94('0x1e')][_0x5a4e8b[_0x8b94('0x3b')]][_0x8b94('0xcb')])){this['channels'][_0x5a4e8b[_0x8b94('0x3b')]][_0x8b94('0xce')]+=moment()[_0x8b94('0xcf')](0x0)['diff'](this[_0x8b94('0x1e')][_0x5a4e8b[_0x8b94('0x3b')]]['mohstarttime'],_0x8b94('0x61'));logger[_0x8b94('0x31')]('[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s',_0x5a4e8b['uniqueid'],this[_0x8b94('0x1e')][_0x5a4e8b['uniqueid']]['mohtime']);delete this[_0x8b94('0x1e')][_0x5a4e8b[_0x8b94('0x3b')]][_0x8b94('0xcb')];}}}}catch(_0x2ed9ac){logger[_0x8b94('0x34')](_0x8b94('0xd0'),_0x5a4e8b[_0x8b94('0x3b')],util[_0x8b94('0x36')](_0x2ed9ac,{'showHidden':![],'depth':null}));}};module[_0x8b94('0xd1')]=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index 9c8fbf5..d5c5c10 100644 --- a/server/services/ami/report/voiceDialReport.js +++ b/server/services/ami/report/voiceDialReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xefc3=['addVariable','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','sipuri','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','cause-txt','duration','endtime','starttime','seconds','complete','total','answered','holdtime','billableseconds','sumHoldTime','sumBillable','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][newexten]\x20event:','application','toLowerCase','set','applicationdata','appdata','startsWith','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','[%s][voiceDialReport][newexten]','exports','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','outbound','applications','variables','syncDialEnd','bind','newexten','syncNewExten','syncHangup','prototype','isNotNull','emit','syncDialBegin','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','merge','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','omit','event','privilege','info','membername','interface','voice:outbound','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','error','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','lastevent','connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','voice_outbound_channel:save','[%s][voiceDialReport][dialend]','syncVarSet','[%s][voiceDialReport][varset]\x20event:','keys','value','variable','outboundrouteid','isUndefined','[%s][voiceDialReport][varset]'];(function(_0xc79d1d,_0x5ac66e){var _0x4249c9=function(_0x1692a8){while(--_0x1692a8){_0xc79d1d['push'](_0xc79d1d['shift']());}};_0x4249c9(++_0x5ac66e);}(_0xefc3,0x107));var _0x3efc=function(_0x29f417,_0x396585){_0x29f417=_0x29f417-0x0;var _0x3c5b3a=_0xefc3[_0x29f417];return _0x3c5b3a;};'use strict';var _=require('lodash');var moment=require(_0x3efc('0x0'));var util=require(_0x3efc('0x1'));var Redis=require(_0x3efc('0x2'));var config=require(_0x3efc('0x3'));var logger=require(_0x3efc('0x4'))(_0x3efc('0x5'));var ami=require(_0x3efc('0x6'));config[_0x3efc('0x7')]=_[_0x3efc('0x8')](config[_0x3efc('0x7')],{'host':_0x3efc('0x9'),'port':0x18eb});var io=require(_0x3efc('0xa'))(new Redis(config['redis']));function VoiceDialReport(_0x4b21b9){this[_0x3efc('0xb')]=_0x4b21b9['outboundChannels'];this[_0x3efc('0xc')]=_0x4b21b9[_0x3efc('0xc')];this[_0x3efc('0xd')]={};this[_0x3efc('0xe')]={};ami['on']('dialbegin',this['syncDialBegin']['bind'](this));ami['on']('dialend',this[_0x3efc('0xf')][_0x3efc('0x10')](this));ami['on']('varset',this['syncVarSet']['bind'](this));ami['on'](_0x3efc('0x11'),this[_0x3efc('0x12')][_0x3efc('0x10')](this));ami['on']('hangup',this[_0x3efc('0x13')]['bind'](this));}VoiceDialReport[_0x3efc('0x14')][_0x3efc('0x15')]=function(_0x16708c){return _0x16708c!==null&&!_['isUndefined'](_0x16708c);};VoiceDialReport['prototype'][_0x3efc('0x16')]=function(_0x4a2d76,_0x47bfc6,_0x30a9f8){io['to'](_0x4a2d76)[_0x3efc('0x16')](_0x47bfc6,_0x30a9f8);};VoiceDialReport[_0x3efc('0x14')][_0x3efc('0x17')]=function(_0xfef84a){try{if(this[_0x3efc('0x15')](_0xfef84a)){logger[_0x3efc('0x18')](_0x3efc('0x19'),_0xfef84a[_0x3efc('0x1a')],util[_0x3efc('0x1b')](_0xfef84a,{'showHidden':![],'depth':null}));if(this[_0x3efc('0xb')][_0xfef84a[_0x3efc('0x1a')]]){_[_0x3efc('0x1c')](this[_0x3efc('0xb')][_0xfef84a[_0x3efc('0x1a')]],{'starttime':moment()[_0x3efc('0x1d')](_0x3efc('0x1e')),'lastevent':_0x3efc('0x1f'),'interface':_0xfef84a[_0x3efc('0x20')]['substring'](0x0,_0xfef84a[_0x3efc('0x20')]['lastIndexOf']('-')),'membername':_0xfef84a[_0x3efc('0x20')][_0x3efc('0x21')](_0xfef84a['channel'][_0x3efc('0x22')]('/')+0x1,_0xfef84a[_0x3efc('0x20')][_0x3efc('0x22')]('-'))},_[_0x3efc('0x23')](_0xfef84a,[_0x3efc('0x24'),_0x3efc('0x25')]));logger[_0x3efc('0x26')]('[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called',_0xfef84a[_0x3efc('0x1a')],this[_0x3efc('0xb')][_0xfef84a[_0x3efc('0x1a')]][_0x3efc('0x27')],this[_0x3efc('0xb')][_0xfef84a[_0x3efc('0x1a')]][_0x3efc('0x28')]);logger[_0x3efc('0x18')]('[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:',_0xfef84a[_0x3efc('0x1a')],util[_0x3efc('0x1b')](this[_0x3efc('0xb')][_0xfef84a[_0x3efc('0x1a')]],{'showHidden':![],'depth':null}));if(this['applications'][_0xfef84a[_0x3efc('0x1a')]])_[_0x3efc('0x1c')](this[_0x3efc('0xb')][_0xfef84a[_0x3efc('0x1a')]],this['applications'][_0xfef84a[_0x3efc('0x1a')]]);this['emit'](_0x3efc('0x29'),'voice_outbound_channel:save',this[_0x3efc('0xb')][_0xfef84a[_0x3efc('0x1a')]]);logger['debug'](_0x3efc('0x2a'),_0xfef84a[_0x3efc('0x1a')],util[_0x3efc('0x1b')](this[_0x3efc('0xb')][_0xfef84a['uniqueid']],{'showHidden':![],'depth':null}));ami['emit']('custom:dialbegin',this[_0x3efc('0xb')][_0xfef84a[_0x3efc('0x1a')]]);}}}catch(_0x2cce81){logger[_0x3efc('0x2b')]('[%s][voiceDialReport][dialbegin]',_0xfef84a[_0x3efc('0x1a')],util['inspect'](_0x2cce81,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x3efc('0x14')]['syncDialEnd']=function(_0x4cc265){try{if(this[_0x3efc('0x15')](_0x4cc265)){logger[_0x3efc('0x18')](_0x3efc('0x2c'),_0x4cc265[_0x3efc('0x1a')],util[_0x3efc('0x1b')](_0x4cc265,{'showHidden':![],'depth':null}));if(this[_0x3efc('0xb')][_0x4cc265[_0x3efc('0x1a')]]){this['channels'][_0x4cc265[_0x3efc('0x1a')]]['dialstatus']=_0x4cc265['dialstatus'];if(_0x4cc265[_0x3efc('0x2d')]===_0x3efc('0x2e')){this['channels'][_0x4cc265[_0x3efc('0x1a')]][_0x3efc('0x2f')]=_0x4cc265['connectedlinenum'];this[_0x3efc('0xb')][_0x4cc265[_0x3efc('0x1a')]][_0x3efc('0x30')]=_0x4cc265[_0x3efc('0x30')];this[_0x3efc('0xb')][_0x4cc265[_0x3efc('0x1a')]][_0x3efc('0x31')]=moment()[_0x3efc('0x1d')](_0x3efc('0x1e'));this[_0x3efc('0xb')][_0x4cc265['uniqueid']][_0x3efc('0x32')]=_0x3efc('0x33');logger[_0x3efc('0x26')]('[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect',_0x4cc265[_0x3efc('0x1a')],_0x4cc265[_0x3efc('0x20')][_0x3efc('0x21')](_0x4cc265[_0x3efc('0x20')][_0x3efc('0x22')]('/')+0x1,_0x4cc265[_0x3efc('0x20')][_0x3efc('0x22')]('-')));logger[_0x3efc('0x18')](_0x3efc('0x34'),_0x4cc265[_0x3efc('0x1a')],util[_0x3efc('0x1b')](this['channels'][_0x4cc265[_0x3efc('0x1a')]],{'showHidden':![],'depth':null}));ami[_0x3efc('0x16')](_0x3efc('0x35'),this['channels'][_0x4cc265[_0x3efc('0x1a')]]);}logger['debug']('[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:',_0x4cc265['uniqueid'],util['inspect'](this['channels'][_0x4cc265['uniqueid']],{'showHidden':![],'depth':null}));this['emit'](_0x3efc('0x29'),_0x3efc('0x36'),this['channels'][_0x4cc265['uniqueid']]);}}}catch(_0x21c33e){logger['error'](_0x3efc('0x37'),_0x4cc265[_0x3efc('0x1a')],util[_0x3efc('0x1b')](_0x21c33e,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x3efc('0x14')][_0x3efc('0x38')]=function(_0xe7845a){try{if(this[_0x3efc('0x15')](_0xe7845a)){logger[_0x3efc('0x18')](_0x3efc('0x39'),_0xe7845a[_0x3efc('0x1a')],util[_0x3efc('0x1b')](_0xe7845a,{'showHidden':![],'depth':null}));this['addVariable'](_0xe7845a[_0x3efc('0x1a')],_[_0x3efc('0x3a')](_0xe7845a['variable'])[0x0],_0xe7845a[_0x3efc('0x3b')]);if(this[_0x3efc('0x15')](_0xe7845a[_0x3efc('0x3c')])&&this[_0x3efc('0x15')](_0xe7845a[_0x3efc('0x3c')][_0x3efc('0x3d')])){if(_[_0x3efc('0x3e')](this[_0x3efc('0xb')][_0xe7845a[_0x3efc('0x1a')]])){this[_0x3efc('0xb')][_0xe7845a[_0x3efc('0x1a')]]={'routeId':_0xe7845a['value'],'variables':this[_0x3efc('0xe')][_0xe7845a['uniqueid']]};logger['info']('[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s',_0xe7845a[_0x3efc('0x1a')],_0xe7845a[_0x3efc('0x3c')][_0x3efc('0x3d')],_['keys'](_0xe7845a[_0x3efc('0x3c')])[0x0],_0xe7845a[_0x3efc('0x3b')]);logger[_0x3efc('0x18')]('[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:',_0xe7845a[_0x3efc('0x1a')],util[_0x3efc('0x1b')](this[_0x3efc('0xb')][_0xe7845a[_0x3efc('0x1a')]],{'showHidden':![],'depth':null}));this[_0x3efc('0x16')](_0x3efc('0x29'),_0x3efc('0x36'),this['channels'][_0xe7845a[_0x3efc('0x1a')]]);}}}}catch(_0x3eec99){logger[_0x3efc('0x2b')](_0x3efc('0x3f'),_0xe7845a[_0x3efc('0x1a')],util[_0x3efc('0x1b')](_0x3eec99,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x3efc('0x14')][_0x3efc('0x40')]=function(_0x105edb,_0x3aac19,_0x1d2086){var _0x319da2=[_0x3efc('0x41'),'rtpaudioqosbridged',_0x3efc('0x42'),_0x3efc('0x43'),_0x3efc('0x44'),_0x3efc('0x45'),'rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid',_0x3efc('0x46'),'bridgepeer','bridgepvtcallid',_0x3efc('0x47'),_0x3efc('0x48'),_0x3efc('0x49'),_0x3efc('0x4a'),'membername',_0x3efc('0x4b'),_0x3efc('0x4c')];if(!_[_0x3efc('0x4d')](_0x3aac19)&&!_[_0x3efc('0x4e')](_0x319da2,_0x3aac19)){if(_[_0x3efc('0x3e')](this[_0x3efc('0xe')][_0x105edb])){this[_0x3efc('0xe')][_0x105edb]={};}this[_0x3efc('0xe')][_0x105edb][_0x3aac19]=_0x1d2086;}};VoiceDialReport['prototype'][_0x3efc('0x13')]=function(_0x5c834e){try{if(this[_0x3efc('0x15')](_0x5c834e)){logger[_0x3efc('0x18')]('[%s][voiceDialReport][hangup]\x20event:',_0x5c834e[_0x3efc('0x1a')],util[_0x3efc('0x1b')](_0x5c834e,{'showHidden':![],'depth':null}));if(this['channels'][_0x5c834e[_0x3efc('0x1a')]]){logger[_0x3efc('0x26')]('[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete',_0x5c834e[_0x3efc('0x1a')],_0x5c834e[_0x3efc('0x4f')]);this['channels'][_0x5c834e[_0x3efc('0x1a')]]['endtime']=moment()[_0x3efc('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x5c834e[_0x3efc('0x1a')]][_0x3efc('0x50')]=moment(this[_0x3efc('0xb')][_0x5c834e[_0x3efc('0x1a')]][_0x3efc('0x51')])['diff'](this[_0x3efc('0xb')][_0x5c834e['uniqueid']][_0x3efc('0x52')],_0x3efc('0x53'));this[_0x3efc('0xb')][_0x5c834e[_0x3efc('0x1a')]][_0x3efc('0x32')]=_0x3efc('0x54');this[_0x3efc('0xc')][_0x3efc('0x55')]+=0x1;if(this[_0x3efc('0xb')][_0x5c834e[_0x3efc('0x1a')]][_0x3efc('0x31')]){this[_0x3efc('0xc')][_0x3efc('0x56')]+=0x1;this[_0x3efc('0xb')][_0x5c834e['uniqueid']][_0x3efc('0x57')]=moment(this[_0x3efc('0xb')][_0x5c834e[_0x3efc('0x1a')]][_0x3efc('0x31')])['diff'](this[_0x3efc('0xb')][_0x5c834e[_0x3efc('0x1a')]]['starttime'],_0x3efc('0x53'));this[_0x3efc('0xb')][_0x5c834e[_0x3efc('0x1a')]][_0x3efc('0x58')]=moment(this['channels'][_0x5c834e[_0x3efc('0x1a')]]['endtime'])['diff'](this[_0x3efc('0xb')][_0x5c834e[_0x3efc('0x1a')]][_0x3efc('0x31')],_0x3efc('0x53'));this['outbound'][_0x3efc('0x59')]+=this[_0x3efc('0xb')][_0x5c834e['uniqueid']][_0x3efc('0x57')]||0x0;this[_0x3efc('0xc')][_0x3efc('0x5a')]+=this[_0x3efc('0xb')][_0x5c834e[_0x3efc('0x1a')]][_0x3efc('0x58')];}this[_0x3efc('0xc')][_0x3efc('0x5b')]+=this['channels'][_0x5c834e[_0x3efc('0x1a')]][_0x3efc('0x50')];logger[_0x3efc('0x18')](_0x3efc('0x5c'),_0x5c834e[_0x3efc('0x1a')],util[_0x3efc('0x1b')](this['channels'][_0x5c834e[_0x3efc('0x1a')]],{'showHidden':![],'depth':null}));ami['emit']('custom:voiceDialReport',this[_0x3efc('0xb')][_0x5c834e[_0x3efc('0x1a')]]);logger[_0x3efc('0x18')](_0x3efc('0x5d'),_0x5c834e[_0x3efc('0x1a')],util[_0x3efc('0x1b')](this[_0x3efc('0xb')][_0x5c834e[_0x3efc('0x1a')]],{'showHidden':![],'depth':null}));ami[_0x3efc('0x16')](_0x3efc('0x5e'),this[_0x3efc('0xb')][_0x5c834e[_0x3efc('0x1a')]]);logger[_0x3efc('0x18')]('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:',_0x5c834e[_0x3efc('0x1a')],util['inspect'](this[_0x3efc('0xb')][_0x5c834e[_0x3efc('0x1a')]],{'showHidden':![],'depth':null}));this[_0x3efc('0x16')](_0x3efc('0x29'),'voice_outbound:save',this[_0x3efc('0xc')]);logger[_0x3efc('0x26')]('[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event',JSON['stringify'](this[_0x3efc('0xb')][_0x5c834e[_0x3efc('0x1a')]]));logger['debug']('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:',_0x5c834e[_0x3efc('0x1a')],util[_0x3efc('0x1b')](this[_0x3efc('0xb')][_0x5c834e['uniqueid']],{'showHidden':![],'depth':null}));this[_0x3efc('0x16')](_0x3efc('0x29'),_0x3efc('0x5f'),this[_0x3efc('0xb')][_0x5c834e[_0x3efc('0x1a')]]);delete this[_0x3efc('0xb')][_0x5c834e['uniqueid']];}else if(this['channels'][_0x5c834e['linkedid']]){this['channels'][_0x5c834e['linkedid']][_0x3efc('0x1a')]=this[_0x3efc('0xb')][_0x5c834e[_0x3efc('0x60')]][_0x3efc('0x61')];}if(this['variables'][_0x5c834e[_0x3efc('0x1a')]]){delete this[_0x3efc('0xe')][_0x5c834e[_0x3efc('0x1a')]];}}}catch(_0x3cb2a5){logger[_0x3efc('0x2b')]('[%s][voiceDialReport][hangup]',_0x5c834e[_0x3efc('0x1a')],util[_0x3efc('0x1b')](_0x3cb2a5,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x3efc('0x14')]['syncNewExten']=function(_0x1eb972){try{if(this[_0x3efc('0x15')](_0x1eb972)){logger[_0x3efc('0x18')](_0x3efc('0x62'),_0x1eb972[_0x3efc('0x1a')],util['inspect'](_0x1eb972,{'showHidden':![],'depth':null}));if(_0x1eb972[_0x3efc('0x63')][_0x3efc('0x64')]()===_0x3efc('0x65')){_0x1eb972[_0x3efc('0x66')]=(_0x1eb972[_0x3efc('0x67')]||_0x1eb972[_0x3efc('0x66')])[_0x3efc('0x64')]();if(_[_0x3efc('0x68')](_0x1eb972[_0x3efc('0x66')],_0x3efc('0x69'))){if(_[_0x3efc('0x3e')](this['applications'][_0x1eb972[_0x3efc('0x1a')]]))this[_0x3efc('0xd')][_0x1eb972[_0x3efc('0x1a')]]={};logger[_0x3efc('0x26')](_0x3efc('0x6a'),_0x1eb972[_0x3efc('0x1a')],_0x1eb972[_0x3efc('0x63')],_0x1eb972['applicationdata']);var _0x297076=_0x1eb972[_0x3efc('0x66')]['split']('=');var _0x695cfb=_0x297076[0x0]['match'](/cdr\((.*)\)/);if(_0x695cfb)this[_0x3efc('0xd')][_0x1eb972['uniqueid']][_0x695cfb[0x1]]=_0x297076[0x1];}}}}catch(_0x466220){logger['error'](_0x3efc('0x6b'),_0x1eb972[_0x3efc('0x1a')],util['inspect'](_0x466220,{'showHidden':![],'depth':null}));}};module[_0x3efc('0x6c')]=VoiceDialReport; \ No newline at end of file +var _0xd08a=['lastIndexOf','event','privilege','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','debug','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','error','[%s][voiceDialReport][dialbegin]','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','lastevent','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][varset]\x20event:','addVariable','keys','variable','value','outboundrouteid','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberinterface','memberlastcall','memberpenalty','includes','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','duration','diff','seconds','complete','answered','holdtime','starttime','billableseconds','sumHoldTime','sumBillable','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','[%s][voiceDialReport][newexten]\x20event:','application','applicationdata','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','match','[%s][voiceDialReport][newexten]','lodash','moment','ioredis','../../../config/environment','../../../config/logger','../ami','redis','defaults','localhost','socket.io-emitter','channels','outboundChannels','outbound','applications','variables','dialbegin','syncDialBegin','dialend','syncDialEnd','bind','syncVarSet','newexten','syncNewExten','hangup','syncHangup','prototype','isNotNull','isUndefined','emit','inspect','uniqueid','merge','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring'];(function(_0x238671,_0x34aea0){var _0x474844=function(_0x26cab4){while(--_0x26cab4){_0x238671['push'](_0x238671['shift']());}};_0x474844(++_0x34aea0);}(_0xd08a,0x1b3));var _0xad08=function(_0x6ccb36,_0x18c063){_0x6ccb36=_0x6ccb36-0x0;var _0x3accfc=_0xd08a[_0x6ccb36];return _0x3accfc;};'use strict';var _=require(_0xad08('0x0'));var moment=require(_0xad08('0x1'));var util=require('util');var Redis=require(_0xad08('0x2'));var config=require(_0xad08('0x3'));var logger=require(_0xad08('0x4'))('ami');var ami=require(_0xad08('0x5'));config[_0xad08('0x6')]=_[_0xad08('0x7')](config[_0xad08('0x6')],{'host':_0xad08('0x8'),'port':0x18eb});var io=require(_0xad08('0x9'))(new Redis(config[_0xad08('0x6')]));function VoiceDialReport(_0x21a1b1){this[_0xad08('0xa')]=_0x21a1b1[_0xad08('0xb')];this[_0xad08('0xc')]=_0x21a1b1[_0xad08('0xc')];this[_0xad08('0xd')]={};this[_0xad08('0xe')]={};ami['on'](_0xad08('0xf'),this[_0xad08('0x10')]['bind'](this));ami['on'](_0xad08('0x11'),this[_0xad08('0x12')][_0xad08('0x13')](this));ami['on']('varset',this[_0xad08('0x14')]['bind'](this));ami['on'](_0xad08('0x15'),this[_0xad08('0x16')]['bind'](this));ami['on'](_0xad08('0x17'),this[_0xad08('0x18')]['bind'](this));}VoiceDialReport[_0xad08('0x19')][_0xad08('0x1a')]=function(_0x2a22ee){return _0x2a22ee!==null&&!_[_0xad08('0x1b')](_0x2a22ee);};VoiceDialReport[_0xad08('0x19')][_0xad08('0x1c')]=function(_0x52cb19,_0x5b3a0f,_0x2ee2ac){io['to'](_0x52cb19)[_0xad08('0x1c')](_0x5b3a0f,_0x2ee2ac);};VoiceDialReport[_0xad08('0x19')][_0xad08('0x10')]=function(_0x1e1512){try{if(this[_0xad08('0x1a')](_0x1e1512)){logger['debug']('[%s][voiceDialReport][dialbegin]\x20event:',_0x1e1512['uniqueid'],util[_0xad08('0x1d')](_0x1e1512,{'showHidden':![],'depth':null}));if(this[_0xad08('0xa')][_0x1e1512[_0xad08('0x1e')]]){_[_0xad08('0x1f')](this[_0xad08('0xa')][_0x1e1512['uniqueid']],{'starttime':moment()[_0xad08('0x20')](_0xad08('0x21')),'lastevent':_0xad08('0x22'),'interface':_0x1e1512[_0xad08('0x23')][_0xad08('0x24')](0x0,_0x1e1512[_0xad08('0x23')][_0xad08('0x25')]('-')),'membername':_0x1e1512[_0xad08('0x23')][_0xad08('0x24')](_0x1e1512[_0xad08('0x23')]['lastIndexOf']('/')+0x1,_0x1e1512[_0xad08('0x23')]['lastIndexOf']('-'))},_['omit'](_0x1e1512,[_0xad08('0x26'),_0xad08('0x27')]));logger[_0xad08('0x28')](_0xad08('0x29'),_0x1e1512[_0xad08('0x1e')],this['channels'][_0x1e1512[_0xad08('0x1e')]][_0xad08('0x2a')],this[_0xad08('0xa')][_0x1e1512[_0xad08('0x1e')]]['interface']);logger[_0xad08('0x2b')](_0xad08('0x2c'),_0x1e1512['uniqueid'],util[_0xad08('0x1d')](this[_0xad08('0xa')][_0x1e1512[_0xad08('0x1e')]],{'showHidden':![],'depth':null}));if(this[_0xad08('0xd')][_0x1e1512['uniqueid']])_[_0xad08('0x1f')](this[_0xad08('0xa')][_0x1e1512[_0xad08('0x1e')]],this['applications'][_0x1e1512[_0xad08('0x1e')]]);this['emit'](_0xad08('0x2d'),_0xad08('0x2e'),this[_0xad08('0xa')][_0x1e1512[_0xad08('0x1e')]]);logger[_0xad08('0x2b')](_0xad08('0x2f'),_0x1e1512[_0xad08('0x1e')],util[_0xad08('0x1d')](this[_0xad08('0xa')][_0x1e1512[_0xad08('0x1e')]],{'showHidden':![],'depth':null}));ami[_0xad08('0x1c')](_0xad08('0x30'),this[_0xad08('0xa')][_0x1e1512['uniqueid']]);}}}catch(_0x43ea0b){logger[_0xad08('0x31')](_0xad08('0x32'),_0x1e1512[_0xad08('0x1e')],util['inspect'](_0x43ea0b,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xad08('0x19')][_0xad08('0x12')]=function(_0x49b0a4){try{if(this[_0xad08('0x1a')](_0x49b0a4)){logger['debug']('[%s][voiceDialReport][dialend]\x20event:',_0x49b0a4['uniqueid'],util['inspect'](_0x49b0a4,{'showHidden':![],'depth':null}));if(this[_0xad08('0xa')][_0x49b0a4[_0xad08('0x1e')]]){this['channels'][_0x49b0a4[_0xad08('0x1e')]][_0xad08('0x33')]=_0x49b0a4[_0xad08('0x33')];if(_0x49b0a4['dialstatus']===_0xad08('0x34')){this[_0xad08('0xa')][_0x49b0a4[_0xad08('0x1e')]]['connectedlinenum']=_0x49b0a4[_0xad08('0x35')];this[_0xad08('0xa')][_0x49b0a4[_0xad08('0x1e')]][_0xad08('0x36')]=_0x49b0a4[_0xad08('0x36')];this[_0xad08('0xa')][_0x49b0a4[_0xad08('0x1e')]][_0xad08('0x37')]=moment()[_0xad08('0x20')](_0xad08('0x21'));this[_0xad08('0xa')][_0x49b0a4[_0xad08('0x1e')]][_0xad08('0x38')]=_0xad08('0x39');logger[_0xad08('0x28')](_0xad08('0x3a'),_0x49b0a4[_0xad08('0x1e')],_0x49b0a4[_0xad08('0x23')]['substring'](_0x49b0a4[_0xad08('0x23')]['lastIndexOf']('/')+0x1,_0x49b0a4[_0xad08('0x23')][_0xad08('0x25')]('-')));logger[_0xad08('0x2b')](_0xad08('0x3b'),_0x49b0a4['uniqueid'],util[_0xad08('0x1d')](this[_0xad08('0xa')][_0x49b0a4[_0xad08('0x1e')]],{'showHidden':![],'depth':null}));ami['emit'](_0xad08('0x3c'),this[_0xad08('0xa')][_0x49b0a4[_0xad08('0x1e')]]);}logger[_0xad08('0x2b')]('[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:',_0x49b0a4[_0xad08('0x1e')],util[_0xad08('0x1d')](this[_0xad08('0xa')][_0x49b0a4['uniqueid']],{'showHidden':![],'depth':null}));this[_0xad08('0x1c')](_0xad08('0x2d'),_0xad08('0x2e'),this[_0xad08('0xa')][_0x49b0a4[_0xad08('0x1e')]]);}}}catch(_0x1080b5){logger[_0xad08('0x31')]('[%s][voiceDialReport][dialend]',_0x49b0a4['uniqueid'],util[_0xad08('0x1d')](_0x1080b5,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0xad08('0x14')]=function(_0x59491f){try{if(this[_0xad08('0x1a')](_0x59491f)){logger[_0xad08('0x2b')](_0xad08('0x3d'),_0x59491f[_0xad08('0x1e')],util[_0xad08('0x1d')](_0x59491f,{'showHidden':![],'depth':null}));this[_0xad08('0x3e')](_0x59491f[_0xad08('0x1e')],_[_0xad08('0x3f')](_0x59491f[_0xad08('0x40')])[0x0],_0x59491f[_0xad08('0x41')]);if(this[_0xad08('0x1a')](_0x59491f['variable'])&&this[_0xad08('0x1a')](_0x59491f['variable'][_0xad08('0x42')])){if(_['isUndefined'](this[_0xad08('0xa')][_0x59491f[_0xad08('0x1e')]])){this[_0xad08('0xa')][_0x59491f[_0xad08('0x1e')]]={'routeId':_0x59491f[_0xad08('0x41')],'variables':this[_0xad08('0xe')][_0x59491f[_0xad08('0x1e')]]};logger[_0xad08('0x28')](_0xad08('0x43'),_0x59491f[_0xad08('0x1e')],_0x59491f['variable'][_0xad08('0x42')],_[_0xad08('0x3f')](_0x59491f[_0xad08('0x40')])[0x0],_0x59491f[_0xad08('0x41')]);logger[_0xad08('0x2b')](_0xad08('0x44'),_0x59491f['uniqueid'],util['inspect'](this[_0xad08('0xa')][_0x59491f['uniqueid']],{'showHidden':![],'depth':null}));this['emit']('voice:outbound',_0xad08('0x2e'),this[_0xad08('0xa')][_0x59491f['uniqueid']]);}}}}catch(_0x475333){logger[_0xad08('0x31')](_0xad08('0x45'),_0x59491f[_0xad08('0x1e')],util['inspect'](_0x475333,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xad08('0x19')]['addVariable']=function(_0x3ec6aa,_0x5bb271,_0x1cbf74){var _0x27745c=['rtpaudioqos',_0xad08('0x46'),_0xad08('0x47'),_0xad08('0x48'),'rtpaudioqosloss',_0xad08('0x49'),_0xad08('0x4a'),_0xad08('0x4b'),'sipcallid',_0xad08('0x4c'),_0xad08('0x4d'),_0xad08('0x4e'),_0xad08('0x4f'),'memberdynamic',_0xad08('0x50'),_0xad08('0x51'),_0xad08('0x2a'),_0xad08('0x52'),'memberrealtime'];if(!_['isNil'](_0x5bb271)&&!_[_0xad08('0x53')](_0x27745c,_0x5bb271)){if(_[_0xad08('0x1b')](this['variables'][_0x3ec6aa])){this[_0xad08('0xe')][_0x3ec6aa]={};}this[_0xad08('0xe')][_0x3ec6aa][_0x5bb271]=_0x1cbf74;}};VoiceDialReport[_0xad08('0x19')][_0xad08('0x18')]=function(_0x2e9576){try{if(this['isNotNull'](_0x2e9576)){logger[_0xad08('0x2b')](_0xad08('0x54'),_0x2e9576[_0xad08('0x1e')],util[_0xad08('0x1d')](_0x2e9576,{'showHidden':![],'depth':null}));if(this[_0xad08('0xa')][_0x2e9576['uniqueid']]){logger[_0xad08('0x28')](_0xad08('0x55'),_0x2e9576[_0xad08('0x1e')],_0x2e9576[_0xad08('0x56')]);this['channels'][_0x2e9576[_0xad08('0x1e')]][_0xad08('0x57')]=moment()[_0xad08('0x20')](_0xad08('0x21'));this[_0xad08('0xa')][_0x2e9576['uniqueid']][_0xad08('0x58')]=moment(this['channels'][_0x2e9576['uniqueid']]['endtime'])[_0xad08('0x59')](this['channels'][_0x2e9576[_0xad08('0x1e')]]['starttime'],_0xad08('0x5a'));this[_0xad08('0xa')][_0x2e9576['uniqueid']]['lastevent']=_0xad08('0x5b');this[_0xad08('0xc')]['total']+=0x1;if(this[_0xad08('0xa')][_0x2e9576[_0xad08('0x1e')]][_0xad08('0x37')]){this[_0xad08('0xc')][_0xad08('0x5c')]+=0x1;this[_0xad08('0xa')][_0x2e9576[_0xad08('0x1e')]][_0xad08('0x5d')]=moment(this[_0xad08('0xa')][_0x2e9576[_0xad08('0x1e')]][_0xad08('0x37')])['diff'](this['channels'][_0x2e9576[_0xad08('0x1e')]][_0xad08('0x5e')],_0xad08('0x5a'));this[_0xad08('0xa')][_0x2e9576['uniqueid']][_0xad08('0x5f')]=moment(this[_0xad08('0xa')][_0x2e9576[_0xad08('0x1e')]][_0xad08('0x57')])[_0xad08('0x59')](this[_0xad08('0xa')][_0x2e9576[_0xad08('0x1e')]][_0xad08('0x37')],_0xad08('0x5a'));this[_0xad08('0xc')][_0xad08('0x60')]+=this[_0xad08('0xa')][_0x2e9576[_0xad08('0x1e')]]['holdtime']||0x0;this[_0xad08('0xc')][_0xad08('0x61')]+=this[_0xad08('0xa')][_0x2e9576[_0xad08('0x1e')]][_0xad08('0x5f')];}this[_0xad08('0xc')][_0xad08('0x62')]+=this[_0xad08('0xa')][_0x2e9576[_0xad08('0x1e')]]['duration'];logger['debug'](_0xad08('0x63'),_0x2e9576[_0xad08('0x1e')],util[_0xad08('0x1d')](this[_0xad08('0xa')][_0x2e9576[_0xad08('0x1e')]],{'showHidden':![],'depth':null}));ami['emit'](_0xad08('0x64'),this[_0xad08('0xa')][_0x2e9576[_0xad08('0x1e')]]);logger['debug'](_0xad08('0x65'),_0x2e9576[_0xad08('0x1e')],util[_0xad08('0x1d')](this['channels'][_0x2e9576[_0xad08('0x1e')]],{'showHidden':![],'depth':null}));ami[_0xad08('0x1c')](_0xad08('0x66'),this[_0xad08('0xa')][_0x2e9576['uniqueid']]);logger[_0xad08('0x2b')]('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:',_0x2e9576[_0xad08('0x1e')],util[_0xad08('0x1d')](this[_0xad08('0xa')][_0x2e9576[_0xad08('0x1e')]],{'showHidden':![],'depth':null}));this[_0xad08('0x1c')](_0xad08('0x2d'),_0xad08('0x67'),this[_0xad08('0xc')]);logger[_0xad08('0x28')](_0xad08('0x68'),JSON[_0xad08('0x69')](this[_0xad08('0xa')][_0x2e9576['uniqueid']]));logger[_0xad08('0x2b')](_0xad08('0x6a'),_0x2e9576['uniqueid'],util[_0xad08('0x1d')](this[_0xad08('0xa')][_0x2e9576[_0xad08('0x1e')]],{'showHidden':![],'depth':null}));this[_0xad08('0x1c')](_0xad08('0x2d'),_0xad08('0x6b'),this[_0xad08('0xa')][_0x2e9576[_0xad08('0x1e')]]);delete this['channels'][_0x2e9576[_0xad08('0x1e')]];}else if(this[_0xad08('0xa')][_0x2e9576[_0xad08('0x6c')]]){this[_0xad08('0xa')][_0x2e9576[_0xad08('0x6c')]][_0xad08('0x1e')]=this[_0xad08('0xa')][_0x2e9576[_0xad08('0x6c')]][_0xad08('0x6d')];}if(this[_0xad08('0xe')][_0x2e9576['uniqueid']]){delete this[_0xad08('0xe')][_0x2e9576[_0xad08('0x1e')]];}}}catch(_0x51d536){logger[_0xad08('0x31')](_0xad08('0x6e'),_0x2e9576[_0xad08('0x1e')],util['inspect'](_0x51d536,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xad08('0x19')][_0xad08('0x16')]=function(_0x7c12a1){try{if(this[_0xad08('0x1a')](_0x7c12a1)){logger[_0xad08('0x2b')](_0xad08('0x6f'),_0x7c12a1[_0xad08('0x1e')],util[_0xad08('0x1d')](_0x7c12a1,{'showHidden':![],'depth':null}));if(_0x7c12a1[_0xad08('0x70')]['toLowerCase']()==='set'){_0x7c12a1[_0xad08('0x71')]=(_0x7c12a1['appdata']||_0x7c12a1[_0xad08('0x71')])['toLowerCase']();if(_['startsWith'](_0x7c12a1[_0xad08('0x71')],_0xad08('0x72'))){if(_[_0xad08('0x1b')](this['applications'][_0x7c12a1[_0xad08('0x1e')]]))this[_0xad08('0xd')][_0x7c12a1[_0xad08('0x1e')]]={};logger['info'](_0xad08('0x73'),_0x7c12a1[_0xad08('0x1e')],_0x7c12a1['application'],_0x7c12a1[_0xad08('0x71')]);var _0x2a6a70=_0x7c12a1[_0xad08('0x71')]['split']('=');var _0x2b4671=_0x2a6a70[0x0][_0xad08('0x74')](/cdr\((.*)\)/);if(_0x2b4671)this[_0xad08('0xd')][_0x7c12a1[_0xad08('0x1e')]][_0x2b4671[0x1]]=_0x2a6a70[0x1];}}}}catch(_0x2a4632){logger[_0xad08('0x31')](_0xad08('0x75'),_0x7c12a1[_0xad08('0x1e')],util[_0xad08('0x1d')](_0x2a4632,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index 10824ae..dc361bd 100644 --- a/server/services/ami/report/voiceQueueReport.js +++ b/server/services/ami/report/voiceQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xea1a=['loggedin','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','[voiceQueueReport][queuesummarycomplete]\x20event:','[%s][voiceQueueReport][queuecallerjoin]','isUndefined','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','merge','pick','keys','[%s][voiceQueueReport][queuecallerabandon]','queuecallercomplete','holdtime','originalposition','queuecallerabandonAt','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerleave]','last','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','[%s][voiceQueueReport][agentconnect]','queuecallerexitreason','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','assigned','queuecallerexit','transfer','COMPLETED','startsWith','toLowerCase','local/','linkedid','queuecallerexitAt','seconds','FORWARDTRANSFER','transferexten','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','reason','toUpperCase','syncVarSet','addVariable','variable','value','CONTINUE','TIMEOUT','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','[%s][voiceQueueReport][varset]','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','memberrealtime','includes','length','diff','milliseconds','sumBillable','queuecallercompleteAt','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','lastevent','cause-txt','hangup','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDEDTRANSFER','transfertype','ATTENDED','switch','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','origtransfererexten','origtransfereruniqueid','transfertargetuniqueid','syncBlindTransfer','[%s][voiceQueueReport][blindtransfer]','context','transfererchannel','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstart]','syncMusicOnHoldStop','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','mohtime','application','set','applicationdata','appdata','CDR(routeAlias)','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','match','[%s][voiceQueueReport][newexten]','lodash','moment','util','md5','../../../config/environment','../../../config/logger','ami','../ami','../model/queueReport','redis','defaults','socket.io-emitter','prototype','tail','finally','agents','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','queuesummary','syncQueueSummary','bind','syncQueueSummaryComplete','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','varset','syncHangup','fullybooted','syncFullyBooted','newexten','syncNewExten','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','loopQueueSummary','loopQueueShow','hasOwnProperty','isEmpty','originated','talking','waiting','unlockRR','clearZombieChannels','channels','sequence','isNil','Action','status','catch','message','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','inspect','queueReports','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','emitVoiceQueueChannelSave','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','voice:queue:%s','voice_queue_channel:save','voice_queue_presence:save',']\x20sending\x20voice_queue_channel:remove\x20event:','format','name','voice_queue_channel:remove','voice_queue_presence:remove','emitVoiceQueueSummary','type','inbound','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','total','unmanaged','abandoned','Trunk','active','callerid','Interval','stringify','queues','[voiceQueueReport][queues]','then','isNotNull','queue','info','[voiceQueueReport][queuesummary]\x20name:%s','countBy','toNumber','callers'];(function(_0x17c595,_0x2bde21){var _0x1ec55b=function(_0x28b734){while(--_0x28b734){_0x17c595['push'](_0x17c595['shift']());}};_0x1ec55b(++_0x2bde21);}(_0xea1a,0x158));var _0xaea1=function(_0x52c885,_0x4584c9){_0x52c885=_0x52c885-0x0;var _0x385492=_0xea1a[_0x52c885];return _0x385492;};'use strict';var _=require(_0xaea1('0x0'));var moment=require(_0xaea1('0x1'));var util=require(_0xaea1('0x2'));var md5=require(_0xaea1('0x3'));var Redis=require('ioredis');var config=require(_0xaea1('0x4'));var logger=require(_0xaea1('0x5'))(_0xaea1('0x6'));var ami=require(_0xaea1('0x7'));var QueueReport=require(_0xaea1('0x8'));config[_0xaea1('0x9')]=_[_0xaea1('0xa')](config[_0xaea1('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xaea1('0xb'))(new Redis(config[_0xaea1('0x9')]));var Sequence=function(){};Sequence[_0xaea1('0xc')]['enqueue']=function(_0x1b5adf){this['tail']=this[_0xaea1('0xd')]?this['tail'][_0xaea1('0xe')](_0x1b5adf):_0x1b5adf();};function VoiceQueueReport(_0x4de4c1){this['sequence']=new Sequence();this['queueReports']={};this[_0xaea1('0xf')]=_0x4de4c1['agents'];this['channels']=_0x4de4c1[_0xaea1('0x10')];this[_0xaea1('0x11')]=_0x4de4c1['voiceQueues'];this[_0xaea1('0x12')]=!![];this[_0xaea1('0x13')]=_0x4de4c1[_0xaea1('0x13')];this[_0xaea1('0x14')]={};ami['on'](_0xaea1('0x15'),this[_0xaea1('0x16')][_0xaea1('0x17')](this));ami['on']('queuesummarycomplete',this[_0xaea1('0x18')][_0xaea1('0x17')](this));ami['on'](_0xaea1('0x19'),this[_0xaea1('0x1a')][_0xaea1('0x17')](this));ami['on'](_0xaea1('0x1b'),this[_0xaea1('0x1c')][_0xaea1('0x17')](this));ami['on'](_0xaea1('0x1d'),this[_0xaea1('0x1e')][_0xaea1('0x17')](this));ami['on'](_0xaea1('0x1f'),this[_0xaea1('0x20')][_0xaea1('0x17')](this));ami['on'](_0xaea1('0x21'),this[_0xaea1('0x22')][_0xaea1('0x17')](this));ami['on'](_0xaea1('0x23'),this['syncVarSet'][_0xaea1('0x17')](this));ami['on']('hangup',this[_0xaea1('0x24')][_0xaea1('0x17')](this));ami['on'](_0xaea1('0x25'),this[_0xaea1('0x26')][_0xaea1('0x17')](this));ami['on'](_0xaea1('0x27'),this[_0xaea1('0x28')][_0xaea1('0x17')](this));ami['on'](_0xaea1('0x29'),this[_0xaea1('0x2a')]['bind'](this));ami['on'](_0xaea1('0x2b'),this['syncMusicOnHoldStop']['bind'](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0xaea1('0x17')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0xaea1('0x17')](this));this[_0xaea1('0x2c')]();this[_0xaea1('0x2d')]();}function clearChannels(_0x4e75b4){if(!_['isEmpty'](_0x4e75b4)){for(var _0x3a42ae in _0x4e75b4){if(_0x4e75b4[_0xaea1('0x2e')](_0x3a42ae)){delete _0x4e75b4[_0x3a42ae];}}}}function clearCampaigns(_0x644394){if(!_[_0xaea1('0x2f')](_0x644394)){for(var _0x38d92f in _0x644394){if(_0x644394['hasOwnProperty'](_0x38d92f)){_0x644394[_0x38d92f][_0xaea1('0x30')]=0x0;}}}}function clearVoiceQueues(_0x38e1bd){if(!_[_0xaea1('0x2f')](_0x38e1bd)){for(var _0x3f8e30 in _0x38e1bd){if(_0x38e1bd[_0xaea1('0x2e')](_0x3f8e30)){_0x38e1bd[_0x3f8e30][_0xaea1('0x30')]=0x0;_0x38e1bd[_0x3f8e30][_0xaea1('0x31')]=0x0;_0x38e1bd[_0x3f8e30]['pTalking']=0x0;_0x38e1bd[_0x3f8e30][_0xaea1('0x32')]=0x0;_0x38e1bd[_0x3f8e30]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x17a26d){if(!_[_0xaea1('0x2f')](_0x17a26d)){for(var _0x4af8b4 in _0x17a26d){if(_0x17a26d[_0xaea1('0x2e')](_0x4af8b4)){_0x17a26d[_0x4af8b4][_0xaea1('0x33')]=!![];}}}}VoiceQueueReport['prototype'][_0xaea1('0x34')]=function(){var _0x4ff9fe=this;for(var _0x5cad8b in this['channels']){if(this[_0xaea1('0x35')]['hasOwnProperty'](_0x5cad8b)&&!this[_0xaea1('0x35')][_0x5cad8b]['switch']){this[_0xaea1('0x36')]['enqueue'](function(){if(!_[_0xaea1('0x37')](_0x4ff9fe[_0xaea1('0x35')][_0x5cad8b])){return ami[_0xaea1('0x38')]({'action':_0xaea1('0x39'),'channel':_0x4ff9fe[_0xaea1('0x35')][_0x5cad8b]['channel']})[_0xaea1('0x3a')](function(_0x155422){if(_0x155422[_0xaea1('0x3b')]===_0xaea1('0x3c')){setTimeout(function(){if(_0x4ff9fe['channels'][_0x5cad8b]){delete _0x4ff9fe[_0xaea1('0x35')][_0x5cad8b];logger[_0xaea1('0x3d')](_0xaea1('0x3e'),_0x5cad8b,util[_0xaea1('0x3f')](_0x155422,{'showHidden':![],'depth':null}));}if(_0x4ff9fe[_0xaea1('0x40')][_0x5cad8b]){delete _0x4ff9fe[_0xaea1('0x40')][_0x5cad8b];logger[_0xaea1('0x3d')](_0xaea1('0x41'),_0x5cad8b,util[_0xaea1('0x3f')](_0x155422,{'showHidden':![],'depth':null}));}if(_0x4ff9fe[_0xaea1('0x14')][_0x5cad8b]){delete _0x4ff9fe[_0xaea1('0x14')][_0x5cad8b];logger[_0xaea1('0x3d')](_0xaea1('0x42'),_0x5cad8b,util[_0xaea1('0x3f')](_0x155422,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport['prototype']['syncFullyBooted']=function(){logger['error'](_0xaea1('0x43'));clearChannels(this['channels']);this[_0xaea1('0x44')](this[_0xaea1('0x40')]);clearAgentBooked(this['agents']);clearVoiceQueues(this[_0xaea1('0x11')]);clearCampaigns(this[_0xaea1('0x13')]);};VoiceQueueReport[_0xaea1('0xc')][_0xaea1('0x44')]=function(_0x2fd4fd){var _0x18edb8=this;if(!_[_0xaea1('0x2f')](_0x2fd4fd)){for(var _0x231ed8 in _0x2fd4fd){if(_0x2fd4fd['hasOwnProperty'](_0x231ed8)){_0x18edb8[_0xaea1('0x45')](_0x2fd4fd[_0x231ed8],_0xaea1('0x46'));delete _0x2fd4fd[_0x231ed8];}}}};VoiceQueueReport[_0xaea1('0xc')][_0xaea1('0x47')]=function(_0x306a5b,_0x2974e0,_0x8fab87){io['to'](_0x306a5b)['emit'](_0x2974e0,_0x8fab87);};VoiceQueueReport[_0xaea1('0xc')][_0xaea1('0x48')]=function(_0x38c572,_0x8fe0af){logger[_0xaea1('0x49')](_0xaea1('0x4a')+_0x8fe0af+_0xaea1('0x4b'),_0x38c572[_0xaea1('0x4c')],util[_0xaea1('0x3f')](_0x38c572,{'showHidden':![],'depth':null}));this['emit'](util['format'](_0xaea1('0x4d'),_0x38c572['name']),_0xaea1('0x4e'),_0x38c572);io['emit'](_0xaea1('0x4f'),_0x38c572);};VoiceQueueReport[_0xaea1('0xc')][_0xaea1('0x45')]=function(_0x572917,_0x26de34){logger['debug'](_0xaea1('0x4a')+_0x26de34+_0xaea1('0x50'),_0x572917[_0xaea1('0x4c')],util[_0xaea1('0x3f')](_0x572917,{'showHidden':![],'depth':null}));this[_0xaea1('0x47')](util[_0xaea1('0x51')](_0xaea1('0x4d'),_0x572917[_0xaea1('0x52')]),_0xaea1('0x53'),_0x572917);io[_0xaea1('0x47')](_0xaea1('0x54'),_0x572917);};VoiceQueueReport[_0xaea1('0xc')][_0xaea1('0x55')]=function(_0x21d442,_0x339b36){if(_0x21d442[_0xaea1('0x56')]===_0xaea1('0x57')){var _0x2ca010={'id':_0x21d442['id'],'name':_0x21d442['name'],'strategy':_0x21d442['strategy'],'answered':_0x21d442[_0xaea1('0x58')],'available':_0x21d442[_0xaea1('0x59')],'loggedIn':_0x21d442[_0xaea1('0x5a')],'pTalking':_0x21d442[_0xaea1('0x5b')],'sumBillable':_0x21d442['sumBillable'],'sumDuration':_0x21d442[_0xaea1('0x5c')],'sumHoldTime':_0x21d442[_0xaea1('0x5d')]||0x0,'talking':_0x21d442[_0xaea1('0x31')],'total':_0x21d442[_0xaea1('0x5e')],'type':_0x21d442[_0xaea1('0x56')],'unmanaged':_0x21d442[_0xaea1('0x5f')],'abandoned':_0x21d442[_0xaea1('0x60')],'waiting':_0x21d442[_0xaea1('0x32')]};if(_0x21d442[_0xaea1('0x61')]){_0x2ca010['Trunk']={'id':_0x21d442[_0xaea1('0x61')]['id'],'name':_0x21d442[_0xaea1('0x61')]['name'],'active':_0x21d442[_0xaea1('0x61')][_0xaea1('0x62')],'callerid':_0x21d442[_0xaea1('0x61')][_0xaea1('0x63')]};}if(_0x21d442[_0xaea1('0x64')]){_0x2ca010[_0xaea1('0x64')]={'id':_0x21d442['Interval']['id'],'name':_0x21d442[_0xaea1('0x64')][_0xaea1('0x52')]};}var _0x1a9c58=md5(JSON[_0xaea1('0x65')](_0x2ca010));if(_0x21d442[_0xaea1('0x3')]!==_0x1a9c58){_0x21d442[_0xaea1('0x3')]=_0x1a9c58;logger[_0xaea1('0x49')]('[voiceQueueReport]['+_0x339b36+']\x20sending\x20voice_queue:save\x20event:',util[_0xaea1('0x3f')](_0x2ca010,{'showHidden':![],'depth':null}));this[_0xaea1('0x47')](util[_0xaea1('0x51')](_0xaea1('0x4d'),_0x2ca010[_0xaea1('0x52')]),'voice_queue:save',_0x2ca010);}}};VoiceQueueReport[_0xaea1('0xc')]['isNotNull']=function(_0x2adf76){return _0x2adf76!==null&&!_['isUndefined'](_0x2adf76);};VoiceQueueReport[_0xaea1('0xc')][_0xaea1('0x2d')]=function(){var _0x2ef58a=this;setInterval(function(){_0x2ef58a[_0xaea1('0x34')]();ami[_0xaea1('0x38')]({'action':_0xaea1('0x66')})[_0xaea1('0x3a')](function(_0xb784da){logger['error'](_0xaea1('0x67'),util['inspect'](_0xb784da,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0xaea1('0xc')][_0xaea1('0x2c')]=function(){var _0x145809=this;setInterval(function(){if(_0x145809['flagQueueSummary']){return ami[_0xaea1('0x38')]({'action':_0xaea1('0x15')})[_0xaea1('0x68')](function(_0x5ee7b1){_0x145809['flagQueueSummary']=![];})[_0xaea1('0x3a')](function(_0x45f796){logger[_0xaea1('0x3d')]('[voiceQueueReport][queuesummary]',util[_0xaea1('0x3f')](_0x45f796,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport['prototype'][_0xaea1('0x16')]=function(_0x2ae2eb){try{if(this[_0xaea1('0x69')](_0x2ae2eb)&&this[_0xaea1('0x69')](_0x2ae2eb[_0xaea1('0x6a')])){logger['debug']('[voiceQueueReport][queuesummary]\x20event:',util[_0xaea1('0x3f')](_0x2ae2eb,{'showHidden':![],'depth':null}));if(this[_0xaea1('0x11')][_0x2ae2eb[_0xaea1('0x6a')]]){logger[_0xaea1('0x6b')](_0xaea1('0x6c'),_0x2ae2eb[_0xaea1('0x6a')]);var _0x39134a=_[_0xaea1('0x6d')](this[_0xaea1('0x35')],_0xaea1('0x6a'))[_0x2ae2eb[_0xaea1('0x6a')]]||0x0;var _0x4cbdef=_0x39134a-_0x2ae2eb['callers'];if(this[_0xaea1('0x11')][_0x2ae2eb['queue']][_0xaea1('0x32')]!==_[_0xaea1('0x6e')](_0x2ae2eb[_0xaea1('0x6f')])||this['voiceQueues'][_0x2ae2eb[_0xaea1('0x6a')]][_0xaea1('0x5a')]!==_[_0xaea1('0x6e')](_0x2ae2eb[_0xaea1('0x70')])||this[_0xaea1('0x11')][_0x2ae2eb['queue']][_0xaea1('0x59')]!==_[_0xaea1('0x6e')](_0x2ae2eb[_0xaea1('0x59')])||this['voiceQueues'][_0x2ae2eb[_0xaea1('0x6a')]]['talking']!==_0x4cbdef){this[_0xaea1('0x11')][_0x2ae2eb[_0xaea1('0x6a')]][_0xaea1('0x32')]=_[_0xaea1('0x6e')](_0x2ae2eb[_0xaea1('0x6f')]);this[_0xaea1('0x11')][_0x2ae2eb[_0xaea1('0x6a')]][_0xaea1('0x5a')]=_[_0xaea1('0x6e')](_0x2ae2eb[_0xaea1('0x70')]);this[_0xaea1('0x11')][_0x2ae2eb[_0xaea1('0x6a')]][_0xaea1('0x59')]=_[_0xaea1('0x6e')](_0x2ae2eb[_0xaea1('0x59')]);this[_0xaea1('0x11')][_0x2ae2eb[_0xaea1('0x6a')]][_0xaea1('0x31')]=_0x4cbdef>0x0?_0x4cbdef:0x0;this[_0xaea1('0x11')][_0x2ae2eb[_0xaea1('0x6a')]][_0xaea1('0x31')]=this[_0xaea1('0x11')][_0x2ae2eb[_0xaea1('0x6a')]][_0xaea1('0x31')]>_[_0xaea1('0x6e')](_0x2ae2eb[_0xaea1('0x70')])?_[_0xaea1('0x6e')](_0x2ae2eb['loggedin']):this[_0xaea1('0x11')][_0x2ae2eb[_0xaea1('0x6a')]][_0xaea1('0x31')];this[_0xaea1('0x55')](this[_0xaea1('0x11')][_0x2ae2eb['queue']],_0xaea1('0x15'));}logger[_0xaea1('0x49')](_0xaea1('0x71'),util[_0xaea1('0x3f')](this[_0xaea1('0x11')][_0x2ae2eb['queue']],{'showHidden':![],'depth':null}));ami[_0xaea1('0x47')]('custom:queuesummary',this['voiceQueues'][_0x2ae2eb[_0xaea1('0x6a')]]);}}}catch(_0x12a068){logger[_0xaea1('0x3d')]('[voiceQueueReport][queuesummary]',util['inspect'](_0x12a068,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xaea1('0xc')][_0xaea1('0x18')]=function(_0x3e75a0){logger['debug'](_0xaea1('0x72'),util[_0xaea1('0x3f')](_0x3e75a0,{'showHidden':![],'depth':null}));this[_0xaea1('0x12')]=!![];};VoiceQueueReport[_0xaea1('0xc')][_0xaea1('0x1a')]=function(_0x4def94){try{if(this[_0xaea1('0x69')](_0x4def94)){logger[_0xaea1('0x49')](_0xaea1('0x73'),_0x4def94[_0xaea1('0x4c')],util['inspect'](_0x4def94,{'showHidden':![],'depth':null}));if(_[_0xaea1('0x74')](this[_0xaea1('0x40')][_0x4def94['uniqueid']]))this[_0xaea1('0x40')][_0x4def94['uniqueid']]=[];if(_['isUndefined'](this[_0xaea1('0x35')][_0x4def94['uniqueid']]))this['channels'][_0x4def94['uniqueid']]={};var _0x359ab1=new QueueReport();_0x359ab1[_0xaea1('0x52')]=_0x4def94[_0xaea1('0x6a')];_0x359ab1[_0xaea1('0x56')]=this['voiceQueues'][_0x359ab1[_0xaea1('0x52')]]&&this[_0xaea1('0x11')][_0x359ab1[_0xaea1('0x52')]][_0xaea1('0x56')]?this['voiceQueues'][_0x359ab1[_0xaea1('0x52')]][_0xaea1('0x56')]||_0xaea1('0x57'):'inbound';_0x359ab1[_0xaea1('0x6a')]=_0x4def94['queue'];_0x359ab1[_0xaea1('0x75')]=moment()['format'](_0xaea1('0x76'));_0x359ab1[_0xaea1('0x77')]=_0x4def94[_0xaea1('0x77')];_0x359ab1[_0xaea1('0x78')]=_0x4def94['count'];_0x359ab1[_0xaea1('0x4c')]=_0x4def94['uniqueid'];_0x359ab1[_0xaea1('0x79')]=this[_0xaea1('0x35')][_0x4def94[_0xaea1('0x4c')]][_0xaea1('0x79')];logger['info']('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x359ab1[_0xaea1('0x52')],_0x359ab1[_0xaea1('0x56')]);_[_0xaea1('0x7a')](_0x359ab1,_[_0xaea1('0x7b')](_0x4def94,_[_0xaea1('0x7c')](_0x359ab1)));this['queueReports'][_0x4def94[_0xaea1('0x4c')]]['push'](_0x359ab1);this[_0xaea1('0x35')][_0x4def94[_0xaea1('0x4c')]]=_0x359ab1;this[_0xaea1('0x48')](_0x359ab1,_0xaea1('0x19'));}}catch(_0x165222){logger[_0xaea1('0x3d')](_0xaea1('0x73'),_0x4def94[_0xaea1('0x4c')],util[_0xaea1('0x3f')](_0x165222,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xaea1('0xc')][_0xaea1('0x1c')]=function(_0x352596){try{if(this[_0xaea1('0x69')](_0x352596)){logger['debug'](_0xaea1('0x7d'),_0x352596['uniqueid'],util['inspect'](_0x352596,{'showHidden':![],'depth':null}));if(this[_0xaea1('0x40')][_0x352596[_0xaea1('0x4c')]]){var _0x42a9be=_['last'](this[_0xaea1('0x40')][_0x352596['uniqueid']]);_0x42a9be[_0xaea1('0x7e')]=![];_0x42a9be['queuecallercompleteAt']=null;_0x42a9be[_0xaea1('0x7f')]=_0x352596['holdtime'];_0x42a9be[_0xaea1('0x80')]=_0x352596[_0xaea1('0x80')];_0x42a9be['queuecallerabandon']=!![];_0x42a9be[_0xaea1('0x81')]=moment()[_0xaea1('0x51')](_0xaea1('0x76'));_0x42a9be['queuecallerexitreason']=_0xaea1('0x82');_0x42a9be[_0xaea1('0x83')]=null;logger[_0xaea1('0x6b')](_0xaea1('0x84'),_0x42a9be['name'],_0x42a9be[_0xaea1('0x56')]);this[_0xaea1('0x35')][_0x352596['uniqueid']]=_0x42a9be;this[_0xaea1('0x45')](_0x42a9be,_0xaea1('0x1b'));}}}catch(_0x1b6365){logger[_0xaea1('0x3d')](_0xaea1('0x7d'),_0x352596[_0xaea1('0x4c')],util[_0xaea1('0x3f')](_0x1b6365,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xaea1('0xc')][_0xaea1('0x1e')]=function(_0xa8fc4a){try{if(this['isNotNull'](_0xa8fc4a)){logger[_0xaea1('0x49')](_0xaea1('0x85'),_0xa8fc4a[_0xaea1('0x4c')],util[_0xaea1('0x3f')](_0xa8fc4a,{'showHidden':![],'depth':null}));if(this[_0xaea1('0x40')][_0xa8fc4a['uniqueid']]){var _0x4e9360=_[_0xaea1('0x86')](this[_0xaea1('0x40')][_0xa8fc4a[_0xaea1('0x4c')]]);_0x4e9360[_0xaea1('0x87')]=moment()[_0xaea1('0x51')](_0xaea1('0x76'));_0x4e9360[_0xaea1('0x88')]=_0xa8fc4a[_0xaea1('0x88')];_0x4e9360[_0xaea1('0x89')]=_0xa8fc4a[_0xaea1('0x89')];logger[_0xaea1('0x6b')](_0xaea1('0x8a'),_0x4e9360['name'],_0x4e9360[_0xaea1('0x56')],_0xa8fc4a[_0xaea1('0x88')],_0xa8fc4a[_0xaea1('0x89')]);this['channels'][_0xa8fc4a[_0xaea1('0x4c')]]=_0x4e9360;this[_0xaea1('0x48')](_0x4e9360,_0xaea1('0x1d'));}}}catch(_0x5c78ec){logger[_0xaea1('0x3d')](_0xaea1('0x85'),_0xa8fc4a[_0xaea1('0x4c')],util[_0xaea1('0x3f')](_0x5c78ec,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xaea1('0xc')]['syncAgentConnect']=function(_0x5dfbfd){try{if(this[_0xaea1('0x69')](_0x5dfbfd)){logger[_0xaea1('0x49')](_0xaea1('0x8b'),_0x5dfbfd[_0xaea1('0x4c')],util[_0xaea1('0x3f')](_0x5dfbfd,{'showHidden':![],'depth':null}));if(this[_0xaea1('0x40')][_0x5dfbfd[_0xaea1('0x4c')]]){var _0x4440ac=_[_0xaea1('0x86')](this['queueReports'][_0x5dfbfd[_0xaea1('0x4c')]]);_0x4440ac[_0xaea1('0x7e')]=!![];_0x4440ac[_0xaea1('0x8c')]=_0xaea1('0x8d');logger['info'](_0xaea1('0x8e'),_0x4440ac[_0xaea1('0x52')],_0x4440ac[_0xaea1('0x56')]);}}}catch(_0x4382ca){logger[_0xaea1('0x3d')](_0xaea1('0x8b'),_0x5dfbfd[_0xaea1('0x4c')],util[_0xaea1('0x3f')](_0x4382ca,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xaea1('0xc')][_0xaea1('0x20')]=function(_0xec1c0e){try{if(this[_0xaea1('0x69')](_0xec1c0e)){logger['debug'](_0xaea1('0x8f'),_0xec1c0e[_0xaea1('0x4c')],util[_0xaea1('0x3f')](_0xec1c0e,{'showHidden':![],'depth':null}));if(this[_0xaea1('0x40')][_0xec1c0e[_0xaea1('0x4c')]]){var _0x47a1e4=_['last'](this[_0xaea1('0x40')][_0xec1c0e[_0xaea1('0x4c')]]);_0x47a1e4[_0xaea1('0x1b')]=![];_0x47a1e4[_0xaea1('0x81')]=null;_0x47a1e4[_0xaea1('0x90')]=!![];_0x47a1e4[_0xaea1('0x83')]=_0xec1c0e['membername'];_0x47a1e4[_0xaea1('0x7f')]=_0xec1c0e[_0xaea1('0x7f')];_0x47a1e4[_0xaea1('0x7e')]=!![];_0x47a1e4[_0xaea1('0x91')]=![];_0x47a1e4['queuecallerexitAt']=null;if(!_0x47a1e4[_0xaea1('0x92')]){if(_0xec1c0e['reason']==_0xaea1('0x92')){_0x47a1e4[_0xaea1('0x8c')]=_0xaea1('0x93');logger[_0xaea1('0x6b')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x47a1e4['name'],_0x47a1e4['type']);}else{if(_[_0xaea1('0x94')](_0xec1c0e['channel'][_0xaea1('0x95')](),_0xaea1('0x96'))){if(this[_0xaea1('0x40')][_0xec1c0e['linkedid']]){var _0x44aa43=_['last'](this['queueReports'][_0xec1c0e[_0xaea1('0x97')]]);_0x44aa43[_0xaea1('0x7e')]=![];_0x44aa43[_0xaea1('0x91')]=!![];_0x44aa43[_0xaea1('0x98')]=moment(_0x47a1e4['queuecallerjoinAt'])['add'](_0xec1c0e[_0xaea1('0x7f')],_0xaea1('0x99'))[_0xaea1('0x51')](_0xaea1('0x76'));_0x44aa43[_0xaea1('0x8c')]=_0xaea1('0x9a');_0x44aa43[_0xaea1('0x92')]=!![];_0x44aa43['transfertype']='FORWARD';_0x44aa43[_0xaea1('0x9b')]=_0xec1c0e[_0xaea1('0x9c')];_0x44aa43[_0xaea1('0x9d')]=_0xec1c0e[_0xaea1('0x4c')];logger[_0xaea1('0x6b')](_0xaea1('0x9e'),_0x44aa43[_0xaea1('0x52')],_0x44aa43[_0xaea1('0x56')]);var _0x3062cb=this[_0xaea1('0x40')][_0xec1c0e[_0xaea1('0x97')]];this['queueReports'][_0xec1c0e['linkedid']]=this['queueReports'][_0xec1c0e['uniqueid']];this['queueReports'][_0xec1c0e[_0xaea1('0x4c')]]=_0x3062cb;}}else{_0x47a1e4[_0xaea1('0x8c')]=_0xaea1('0x9f')+_0xec1c0e[_0xaea1('0xa0')][_0xaea1('0xa1')]();logger[_0xaea1('0x6b')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x47a1e4[_0xaea1('0x52')],_0x47a1e4[_0xaea1('0x56')],_0x47a1e4['queuecallerexitreason']);}}}this[_0xaea1('0x35')][_0xec1c0e['uniqueid']]=_0x47a1e4;this['emitVoiceQueueChannelRemove'](_0x47a1e4,_0xaea1('0x1f'));}}}catch(_0x40411e){logger[_0xaea1('0x3d')](_0xaea1('0x8f'),_0xec1c0e[_0xaea1('0x4c')],util[_0xaea1('0x3f')](_0x40411e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xaea1('0xc')][_0xaea1('0xa2')]=function(_0x82af2a){try{if(this[_0xaea1('0x69')](_0x82af2a)){logger[_0xaea1('0x49')]('[%s][voiceQueueReport][varset]',_0x82af2a[_0xaea1('0x4c')],util[_0xaea1('0x3f')](_0x82af2a,{'showHidden':![],'depth':null}));this[_0xaea1('0xa3')](_0x82af2a['uniqueid'],_['keys'](_0x82af2a[_0xaea1('0xa4')])[0x0],_0x82af2a[_0xaea1('0xa5')]);if(this[_0xaea1('0x40')][_0x82af2a['uniqueid']]){var _0x275173=_['last'](this[_0xaea1('0x40')][_0x82af2a['uniqueid']]);if(_0x275173){if(this[_0xaea1('0x69')](_0x82af2a[_0xaea1('0xa4')])&&this['isNotNull'](_0x82af2a[_0xaea1('0xa4')]['queuestatus'])){switch(_0x82af2a[_0xaea1('0xa5')]){case _0xaea1('0xa6'):_0x275173['queuecallerexit']=![];_0x275173['queuecallerexitAt']=null;break;case _0xaea1('0xa7'):_0x275173['lastevent']=_0xaea1('0xa8');_0x275173[_0xaea1('0x91')]=!![];_0x275173[_0xaea1('0x98')]=moment()[_0xaea1('0x51')](_0xaea1('0x76'));_0x275173['queuecallerleaveAt']=moment()[_0xaea1('0x51')](_0xaea1('0x76'));logger[_0xaea1('0x49')](_0xaea1('0xa9'),_0x82af2a[_0xaea1('0x4c')],util[_0xaea1('0x3f')](_0x275173,{'showHidden':![],'depth':null}));ami[_0xaea1('0x47')]('custom:timeout',_0x275173);break;default:_0x275173[_0xaea1('0x91')]=!![];_0x275173['queuecallerexitAt']=moment()[_0xaea1('0x51')](_0xaea1('0x76'));_0x275173[_0xaea1('0x87')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x275173[_0xaea1('0x1b')]=![];_0x275173[_0xaea1('0x81')]=null;_0x275173['queuecallerexitreason']=_0x82af2a[_0xaea1('0xa5')];this[_0xaea1('0x35')][_0x82af2a[_0xaea1('0x4c')]]=_0x275173;this['emitVoiceQueueChannelRemove'](_0x275173,_0xaea1('0x23'));}else if(this[_0xaea1('0x69')](_0x82af2a['variable'])&&this[_0xaea1('0x69')](_0x82af2a[_0xaea1('0xa4')][_0xaea1('0xaa')])){if(!_0x275173[_0xaea1('0x1b')]){_0x275173[_0xaea1('0x91')]=!![];_0x275173['queuecallerexitAt']=moment()[_0xaea1('0x51')](_0xaea1('0x76'));_0x275173[_0xaea1('0x8c')]=_0xaea1('0xab');_0x275173[_0xaea1('0x87')]=moment()[_0xaea1('0x51')](_0xaea1('0x76'));this['channels'][_0x82af2a[_0xaea1('0x4c')]]=_0x275173;}}logger[_0xaea1('0x6b')](_0xaea1('0xac'),_0x82af2a[_0xaea1('0x4c')],_0x275173[_0xaea1('0x52')],_0x275173['type'],_[_0xaea1('0x7c')](_0x82af2a[_0xaea1('0xa4')])[0x0],_0x82af2a[_0xaea1('0xa5')]);_0x275173[_0xaea1('0x14')]=this[_0xaea1('0x14')][_0x82af2a[_0xaea1('0x4c')]];}}}}catch(_0x5e5ea7){logger[_0xaea1('0x3d')](_0xaea1('0xad'),_0x82af2a[_0xaea1('0x4c')],util[_0xaea1('0x3f')](_0x5e5ea7,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xaea1('0xa3')]=function(_0x421786,_0x3648b0,_0x444452){var _0x554ebf=[_0xaea1('0xae'),'rtpaudioqosbridged',_0xaea1('0xaf'),_0xaea1('0xb0'),'rtpaudioqosloss','rtpaudioqoslossbridged',_0xaea1('0xb1'),_0xaea1('0xb2'),_0xaea1('0xb3'),_0xaea1('0xb4'),_0xaea1('0xb5'),_0xaea1('0xb6'),_0xaea1('0xb7'),_0xaea1('0xb8'),'memberinterface',_0xaea1('0xb9'),'membername','memberpenalty',_0xaea1('0xba')];if(!_['isNil'](_0x3648b0)&&!_[_0xaea1('0xbb')](_0x554ebf,_0x3648b0)){if(_[_0xaea1('0x74')](this[_0xaea1('0x14')][_0x421786])){this['variables'][_0x421786]={};}this[_0xaea1('0x14')][_0x421786][_0x3648b0]=_0x444452;}};VoiceQueueReport[_0xaea1('0xc')][_0xaea1('0x24')]=function(_0x35e5f6){try{if(this[_0xaea1('0x69')](_0x35e5f6)){logger[_0xaea1('0x49')]('[%s][voiceQueueReport][hangup]',_0x35e5f6[_0xaea1('0x4c')],util[_0xaea1('0x3f')](_0x35e5f6,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x35e5f6[_0xaea1('0x4c')]]){for(var _0xb1fb25=0x0,_0x1eca1e={};_0xb1fb250x0?_0x3e407a:0x0;this[_0x489c('0x13')][_0x3752b6[_0x489c('0x6d')]][_0x489c('0x31')]=this[_0x489c('0x13')][_0x3752b6[_0x489c('0x6d')]][_0x489c('0x31')]>_[_0x489c('0x72')](_0x3752b6['loggedin'])?_[_0x489c('0x72')](_0x3752b6['loggedin']):this[_0x489c('0x13')][_0x3752b6[_0x489c('0x6d')]]['talking'];this[_0x489c('0x53')](this[_0x489c('0x13')][_0x3752b6[_0x489c('0x6d')]],'queuesummary');}logger[_0x489c('0x48')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0x489c('0x3e')](this['voiceQueues'][_0x3752b6['queue']],{'showHidden':![],'depth':null}));ami[_0x489c('0x46')](_0x489c('0x74'),this[_0x489c('0x13')][_0x3752b6[_0x489c('0x6d')]]);}}}catch(_0x190f1c){logger['error'](_0x489c('0x6b'),util['inspect'](_0x190f1c,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueSummaryComplete']=function(_0x433df1){logger[_0x489c('0x48')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x489c('0x3e')](_0x433df1,{'showHidden':![],'depth':null}));this[_0x489c('0x69')]=!![];};VoiceQueueReport[_0x489c('0xa')][_0x489c('0x18')]=function(_0x38ee40){try{if(this[_0x489c('0x66')](_0x38ee40)){logger[_0x489c('0x48')](_0x489c('0x75'),_0x38ee40['uniqueid'],util[_0x489c('0x3e')](_0x38ee40,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x489c('0xf')][_0x38ee40['uniqueid']]))this[_0x489c('0xf')][_0x38ee40[_0x489c('0x4b')]]=[];if(_['isUndefined'](this['channels'][_0x38ee40[_0x489c('0x4b')]]))this[_0x489c('0x11')][_0x38ee40['uniqueid']]={};var _0x43bf6f=new QueueReport();_0x43bf6f[_0x489c('0x4e')]=_0x38ee40[_0x489c('0x6d')];_0x43bf6f[_0x489c('0x54')]=this[_0x489c('0x13')][_0x43bf6f[_0x489c('0x4e')]]&&this['voiceQueues'][_0x43bf6f[_0x489c('0x4e')]][_0x489c('0x54')]?this['voiceQueues'][_0x43bf6f[_0x489c('0x4e')]][_0x489c('0x54')]||_0x489c('0x55'):'inbound';_0x43bf6f[_0x489c('0x6d')]=_0x38ee40[_0x489c('0x6d')];_0x43bf6f[_0x489c('0x76')]=moment()[_0x489c('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');_0x43bf6f[_0x489c('0x77')]=_0x38ee40['position'];_0x43bf6f[_0x489c('0x78')]=_0x38ee40[_0x489c('0x78')];_0x43bf6f['uniqueid']=_0x38ee40[_0x489c('0x4b')];_0x43bf6f[_0x489c('0x79')]=this['channels'][_0x38ee40[_0x489c('0x4b')]][_0x489c('0x79')];logger[_0x489c('0x6e')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x43bf6f[_0x489c('0x4e')],_0x43bf6f[_0x489c('0x54')]);_['merge'](_0x43bf6f,_[_0x489c('0x7a')](_0x38ee40,_[_0x489c('0x7b')](_0x43bf6f)));this[_0x489c('0xf')][_0x38ee40[_0x489c('0x4b')]][_0x489c('0x7c')](_0x43bf6f);this['channels'][_0x38ee40['uniqueid']]=_0x43bf6f;this['emitVoiceQueueChannelSave'](_0x43bf6f,_0x489c('0x7d'));}}catch(_0x5720ac){logger[_0x489c('0x3f')](_0x489c('0x75'),_0x38ee40[_0x489c('0x4b')],util['inspect'](_0x5720ac,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x489c('0x7e')]=function(_0xff7d3b){try{if(this['isNotNull'](_0xff7d3b)){logger[_0x489c('0x48')]('[%s][voiceQueueReport][queuecallerabandon]',_0xff7d3b['uniqueid'],util[_0x489c('0x3e')](_0xff7d3b,{'showHidden':![],'depth':null}));if(this[_0x489c('0xf')][_0xff7d3b[_0x489c('0x4b')]]){var _0x65402d=_[_0x489c('0x7f')](this[_0x489c('0xf')][_0xff7d3b[_0x489c('0x4b')]]);_0x65402d[_0x489c('0x80')]=![];_0x65402d[_0x489c('0x81')]=null;_0x65402d[_0x489c('0x82')]=_0xff7d3b['holdtime'];_0x65402d['originalposition']=_0xff7d3b['originalposition'];_0x65402d[_0x489c('0x83')]=!![];_0x65402d[_0x489c('0x84')]=moment()[_0x489c('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');_0x65402d[_0x489c('0x85')]=_0x489c('0x86');_0x65402d[_0x489c('0x87')]=null;logger['info'](_0x489c('0x88'),_0x65402d['name'],_0x65402d[_0x489c('0x54')]);this[_0x489c('0x11')][_0xff7d3b[_0x489c('0x4b')]]=_0x65402d;this[_0x489c('0x44')](_0x65402d,_0x489c('0x83'));}}}catch(_0xe98a05){logger['error']('[%s][voiceQueueReport][queuecallerabandon]',_0xff7d3b[_0x489c('0x4b')],util[_0x489c('0x3e')](_0xe98a05,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x489c('0xa')][_0x489c('0x19')]=function(_0x506880){try{if(this[_0x489c('0x66')](_0x506880)){logger[_0x489c('0x48')]('[%s][voiceQueueReport][queuecallerleave]',_0x506880[_0x489c('0x4b')],util[_0x489c('0x3e')](_0x506880,{'showHidden':![],'depth':null}));if(this[_0x489c('0xf')][_0x506880['uniqueid']]){var _0x59d692=_['last'](this[_0x489c('0xf')][_0x506880[_0x489c('0x4b')]]);_0x59d692[_0x489c('0x89')]=moment()[_0x489c('0x4c')](_0x489c('0x8a'));_0x59d692[_0x489c('0x8b')]=_0x506880[_0x489c('0x8b')];_0x59d692[_0x489c('0x8c')]=_0x506880[_0x489c('0x8c')];logger['info'](_0x489c('0x8d'),_0x59d692[_0x489c('0x4e')],_0x59d692[_0x489c('0x54')],_0x506880[_0x489c('0x8b')],_0x506880[_0x489c('0x8c')]);this[_0x489c('0x11')][_0x506880[_0x489c('0x4b')]]=_0x59d692;this[_0x489c('0x47')](_0x59d692,_0x489c('0x8e'));}}}catch(_0x49e329){logger['error']('[%s][voiceQueueReport][queuecallerleave]',_0x506880['uniqueid'],util['inspect'](_0x49e329,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x489c('0xa')]['syncAgentConnect']=function(_0x1b472c){try{if(this['isNotNull'](_0x1b472c)){logger['debug'](_0x489c('0x8f'),_0x1b472c[_0x489c('0x4b')],util[_0x489c('0x3e')](_0x1b472c,{'showHidden':![],'depth':null}));if(this[_0x489c('0xf')][_0x1b472c[_0x489c('0x4b')]]){var _0x4300be=_[_0x489c('0x7f')](this[_0x489c('0xf')][_0x1b472c['uniqueid']]);_0x4300be[_0x489c('0x80')]=!![];_0x4300be['queuecallerexitreason']=_0x489c('0x90');logger[_0x489c('0x6e')](_0x489c('0x91'),_0x4300be[_0x489c('0x4e')],_0x4300be[_0x489c('0x54')]);}}}catch(_0x463648){logger[_0x489c('0x3f')](_0x489c('0x8f'),_0x1b472c[_0x489c('0x4b')],util[_0x489c('0x3e')](_0x463648,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x489c('0xa')][_0x489c('0x1b')]=function(_0x46e245){try{if(this[_0x489c('0x66')](_0x46e245)){logger['debug'](_0x489c('0x92'),_0x46e245[_0x489c('0x4b')],util[_0x489c('0x3e')](_0x46e245,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x46e245['uniqueid']]){var _0x28f76c=_['last'](this[_0x489c('0xf')][_0x46e245['uniqueid']]);_0x28f76c[_0x489c('0x83')]=![];_0x28f76c[_0x489c('0x84')]=null;_0x28f76c[_0x489c('0x93')]=!![];_0x28f76c[_0x489c('0x87')]=_0x46e245[_0x489c('0x94')];_0x28f76c[_0x489c('0x82')]=_0x46e245[_0x489c('0x82')];_0x28f76c[_0x489c('0x80')]=!![];_0x28f76c['queuecallerexit']=![];_0x28f76c[_0x489c('0x95')]=null;if(!_0x28f76c[_0x489c('0x96')]){if(_0x46e245['reason']==_0x489c('0x96')){_0x28f76c[_0x489c('0x85')]='COMPLETED';logger[_0x489c('0x6e')](_0x489c('0x97'),_0x28f76c[_0x489c('0x4e')],_0x28f76c[_0x489c('0x54')]);}else{if(_[_0x489c('0x98')](_0x46e245[_0x489c('0x39')]['toLowerCase'](),'local/')){if(this[_0x489c('0xf')][_0x46e245[_0x489c('0x99')]]){var _0x442dfc=_[_0x489c('0x7f')](this[_0x489c('0xf')][_0x46e245[_0x489c('0x99')]]);_0x442dfc['queuecallercomplete']=![];_0x442dfc['queuecallerexit']=!![];_0x442dfc[_0x489c('0x95')]=moment(_0x28f76c[_0x489c('0x76')])[_0x489c('0x9a')](_0x46e245['holdtime'],_0x489c('0x9b'))[_0x489c('0x4c')](_0x489c('0x8a'));_0x442dfc['queuecallerexitreason']='FORWARDTRANSFER';_0x442dfc[_0x489c('0x96')]=!![];_0x442dfc[_0x489c('0x9c')]=_0x489c('0x9d');_0x442dfc[_0x489c('0x9e')]=_0x46e245[_0x489c('0x9f')];_0x442dfc['transferuniqueid']=_0x46e245[_0x489c('0x4b')];logger[_0x489c('0x6e')](_0x489c('0xa0'),_0x442dfc['name'],_0x442dfc[_0x489c('0x54')]);var _0x4632bf=this[_0x489c('0xf')][_0x46e245['linkedid']];this[_0x489c('0xf')][_0x46e245[_0x489c('0x99')]]=this[_0x489c('0xf')][_0x46e245[_0x489c('0x4b')]];this[_0x489c('0xf')][_0x46e245[_0x489c('0x4b')]]=_0x4632bf;}}else{_0x28f76c[_0x489c('0x85')]='COMPLETEDBY'+_0x46e245[_0x489c('0xa1')]['toUpperCase']();logger[_0x489c('0x6e')](_0x489c('0xa2'),_0x28f76c['name'],_0x28f76c['type'],_0x28f76c[_0x489c('0x85')]);}}}this[_0x489c('0x11')][_0x46e245[_0x489c('0x4b')]]=_0x28f76c;this[_0x489c('0x44')](_0x28f76c,_0x489c('0x1a'));}}}catch(_0x3be36){logger[_0x489c('0x3f')](_0x489c('0x92'),_0x46e245[_0x489c('0x4b')],util[_0x489c('0x3e')](_0x3be36,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x489c('0xa')]['syncVarSet']=function(_0x28c651){try{if(this['isNotNull'](_0x28c651)){logger[_0x489c('0x48')]('[%s][voiceQueueReport][varset]',_0x28c651['uniqueid'],util[_0x489c('0x3e')](_0x28c651,{'showHidden':![],'depth':null}));this[_0x489c('0xa3')](_0x28c651['uniqueid'],_[_0x489c('0x7b')](_0x28c651[_0x489c('0xa4')])[0x0],_0x28c651[_0x489c('0xa5')]);if(this[_0x489c('0xf')][_0x28c651[_0x489c('0x4b')]]){var _0x52ff97=_[_0x489c('0x7f')](this['queueReports'][_0x28c651[_0x489c('0x4b')]]);if(_0x52ff97){if(this[_0x489c('0x66')](_0x28c651[_0x489c('0xa4')])&&this[_0x489c('0x66')](_0x28c651['variable'][_0x489c('0xa6')])){switch(_0x28c651[_0x489c('0xa5')]){case _0x489c('0xa7'):_0x52ff97['queuecallerexit']=![];_0x52ff97[_0x489c('0x95')]=null;break;case'TIMEOUT':_0x52ff97[_0x489c('0xa8')]=_0x489c('0xa9');_0x52ff97[_0x489c('0xaa')]=!![];_0x52ff97[_0x489c('0x95')]=moment()[_0x489c('0x4c')](_0x489c('0x8a'));_0x52ff97[_0x489c('0x89')]=moment()[_0x489c('0x4c')](_0x489c('0x8a'));logger[_0x489c('0x48')](_0x489c('0xab'),_0x28c651[_0x489c('0x4b')],util[_0x489c('0x3e')](_0x52ff97,{'showHidden':![],'depth':null}));ami[_0x489c('0x46')](_0x489c('0xac'),_0x52ff97);break;default:_0x52ff97[_0x489c('0xaa')]=!![];_0x52ff97['queuecallerexitAt']=moment()[_0x489c('0x4c')](_0x489c('0x8a'));_0x52ff97[_0x489c('0x89')]=moment()[_0x489c('0x4c')](_0x489c('0x8a'));}_0x52ff97[_0x489c('0x83')]=![];_0x52ff97[_0x489c('0x84')]=null;_0x52ff97[_0x489c('0x85')]=_0x28c651['value'];this[_0x489c('0x11')][_0x28c651[_0x489c('0x4b')]]=_0x52ff97;this[_0x489c('0x44')](_0x52ff97,_0x489c('0x1e'));}else if(this['isNotNull'](_0x28c651['variable'])&&this[_0x489c('0x66')](_0x28c651[_0x489c('0xa4')]['queueposition'])){if(!_0x52ff97[_0x489c('0x83')]){_0x52ff97[_0x489c('0xaa')]=!![];_0x52ff97[_0x489c('0x95')]=moment()[_0x489c('0x4c')](_0x489c('0x8a'));_0x52ff97['queuecallerexitreason']=_0x489c('0xad');_0x52ff97[_0x489c('0x89')]=moment()[_0x489c('0x4c')](_0x489c('0x8a'));this[_0x489c('0x11')][_0x28c651[_0x489c('0x4b')]]=_0x52ff97;}}logger['info'](_0x489c('0xae'),_0x28c651[_0x489c('0x4b')],_0x52ff97[_0x489c('0x4e')],_0x52ff97['type'],_[_0x489c('0x7b')](_0x28c651[_0x489c('0xa4')])[0x0],_0x28c651[_0x489c('0xa5')]);_0x52ff97[_0x489c('0x41')]=this[_0x489c('0x41')][_0x28c651[_0x489c('0x4b')]];}}}}catch(_0x3e3bfd){logger[_0x489c('0x3f')](_0x489c('0xaf'),_0x28c651['uniqueid'],util[_0x489c('0x3e')](_0x3e3bfd,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x489c('0xa')]['addVariable']=function(_0x49af27,_0x136a44,_0xe11855){var _0x384124=[_0x489c('0xb0'),'rtpaudioqosbridged',_0x489c('0xb1'),_0x489c('0xb2'),'rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt',_0x489c('0xb3'),_0x489c('0xb4'),_0x489c('0xb5'),_0x489c('0xb6'),_0x489c('0xb7'),_0x489c('0xb8'),_0x489c('0xb9'),_0x489c('0xba'),_0x489c('0xbb'),_0x489c('0x94'),_0x489c('0xbc'),_0x489c('0xbd')];if(!_[_0x489c('0x37')](_0x136a44)&&!_[_0x489c('0xbe')](_0x384124,_0x136a44)){if(_[_0x489c('0x67')](this['variables'][_0x49af27])){this[_0x489c('0x41')][_0x49af27]={};}this[_0x489c('0x41')][_0x49af27][_0x136a44]=_0xe11855;}};VoiceQueueReport[_0x489c('0xa')][_0x489c('0x21')]=function(_0x51c036){try{if(this[_0x489c('0x66')](_0x51c036)){logger[_0x489c('0x48')]('[%s][voiceQueueReport][hangup]',_0x51c036[_0x489c('0x4b')],util[_0x489c('0x3e')](_0x51c036,{'showHidden':![],'depth':null}));if(this[_0x489c('0xf')][_0x51c036[_0x489c('0x4b')]]){for(var _0x16b4f4=0x0,_0x42eea6={};_0x16b4f4=0x0?moment(_0x213a51[_0x9a07('0x15')])[_0x9a07('0xb')](_0x213a51['starttime'],'seconds'):null,'data1':_0x9a07('0x16'),'data2':_0x213a51[_0x9a07('0x10')],'data3':_0x213a51[_0x9a07('0xe')],'data4':_0x213a51[_0x9a07('0x17')]||null,'role':_0x9a07('0xf'),'internal':_0x213a51[_0x9a07('0x10')]?_[_0x9a07('0x11')](_0x213a51[_0x9a07('0x10')]):undefined,'uniqueid':_0x213a51['uniqueid']},'log':'CreateMemberReport'});}; \ No newline at end of file +var _0x78de=['agent','accountcode','uniqueid','voiceDialReport','membername','starttime','endtime','seconds','toNumber','moment','lodash','util','../client','queuecallercompleteAt','Request','CreateMemberReport','voice','lastAssignedTo','isNil','interface','format','SIP/%s','TALKING','diff','queuecallerleaveAt','inbound','calleridnum','exten','queue'];(function(_0x47e549,_0x2e53d6){var _0x251374=function(_0x400458){while(--_0x400458){_0x47e549['push'](_0x47e549['shift']());}};_0x251374(++_0x2e53d6);}(_0x78de,0x1bc));var _0xe78d=function(_0x2a2166,_0x3a077f){_0x2a2166=_0x2a2166-0x0;var _0x3bcf50=_0x78de[_0x2a2166];return _0x3bcf50;};'use strict';var moment=require(_0xe78d('0x0'));var _=require(_0xe78d('0x1'));var util=require(_0xe78d('0x2'));var client=require(_0xe78d('0x3'));exports['voiceQueueReport']=function(_0x2055ab){var _0x1700d1=_0x2055ab[_0xe78d('0x4')]||_0x2055ab['queuecallerexitAt'];return client[_0xe78d('0x5')](_0xe78d('0x6'),{'body':{'channel':_0xe78d('0x7'),'membername':_0x2055ab[_0xe78d('0x8')],'interface':_[_0xe78d('0x9')](_0x2055ab[_0xe78d('0xa')])?util[_0xe78d('0xb')](_0xe78d('0xc'),_0x2055ab[_0xe78d('0x8')]):_0x2055ab[_0xe78d('0xa')],'type':_0xe78d('0xd'),'enterAt':_0x2055ab['queuecallerleaveAt'],'exitAt':_0x1700d1,'duration':moment(_0x1700d1)[_0xe78d('0xe')](_0x2055ab[_0xe78d('0xf')],'seconds'),'data1':_0xe78d('0x10'),'data2':_0x2055ab[_0xe78d('0x11')],'data3':_0x2055ab[_0xe78d('0x12')],'data4':null,'data5':_0x2055ab[_0xe78d('0x13')],'role':_0xe78d('0x14'),'internal':_0x2055ab[_0xe78d('0x15')]?_['toNumber'](_0x2055ab[_0xe78d('0x15')]):undefined,'uniqueid':_0x2055ab[_0xe78d('0x16')]},'log':'CreateMemberReport'});};exports[_0xe78d('0x17')]=function(_0x3b72fb){return client[_0xe78d('0x5')]('CreateMemberReport',{'body':{'channel':_0xe78d('0x7'),'membername':_0x3b72fb[_0xe78d('0x18')],'interface':_0x3b72fb[_0xe78d('0xa')],'type':'TALKING','enterAt':_0x3b72fb[_0xe78d('0x19')],'exitAt':_0x3b72fb[_0xe78d('0x1a')],'duration':moment(_0x3b72fb[_0xe78d('0x1a')])[_0xe78d('0xe')](_0x3b72fb[_0xe78d('0x19')],_0xe78d('0x1b'))>=0x0?moment(_0x3b72fb['endtime'])[_0xe78d('0xe')](_0x3b72fb[_0xe78d('0x19')],_0xe78d('0x1b')):null,'data1':'outbound','data2':_0x3b72fb[_0xe78d('0x15')],'data3':_0x3b72fb[_0xe78d('0x12')],'data4':_0x3b72fb['dialstring']||null,'role':_0xe78d('0x14'),'internal':_0x3b72fb[_0xe78d('0x15')]?_[_0xe78d('0x1c')](_0x3b72fb[_0xe78d('0x15')]):undefined,'uniqueid':_0x3b72fb['uniqueid']},'log':_0xe78d('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index ce0af01..b3183a5 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 _0xef8e=['getSettings','Request','ShowSetting','GetSettings'];(function(_0x40e74c,_0x1883a2){var _0x3a8c6b=function(_0x1a4ae4){while(--_0x1a4ae4){_0x40e74c['push'](_0x40e74c['shift']());}};_0x3a8c6b(++_0x1883a2);}(_0xef8e,0x8c));var _0xeef8=function(_0x39c8a4,_0x137a9e){_0x39c8a4=_0x39c8a4-0x0;var _0x41f618=_0xef8e[_0x39c8a4];return _0x41f618;};'use strict';var client=require('../client');exports[_0xeef8('0x0')]=function(){return client[_0xeef8('0x1')](_0xeef8('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer']},'log':_0xeef8('0x3')});}; \ No newline at end of file +var _0xc263=['GetSettings','../client','Request','stopRecordingOnTransfer'];(function(_0x4e5bd9,_0x5bfa74){var _0x51c524=function(_0x2d086e){while(--_0x2d086e){_0x4e5bd9['push'](_0x4e5bd9['shift']());}};_0x51c524(++_0x5bfa74);}(_0xc263,0x171));var _0x3c26=function(_0x44a9dc,_0xe81ac0){_0x44a9dc=_0x44a9dc-0x0;var _0x2654eb=_0xc263[_0x44a9dc];return _0x2654eb;};'use strict';var client=require(_0x3c26('0x0'));exports['getSettings']=function(){return client[_0x3c26('0x1')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x3c26('0x2')]},'log':_0x3c26('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index e8fc191..1dca2e2 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 _0xe66d=['html','../client','getTemplates','Request','GetTemplate','name'];(function(_0x25e9df,_0x17a63a){var _0x3dea70=function(_0x3b808a){while(--_0x3b808a){_0x25e9df['push'](_0x25e9df['shift']());}};_0x3dea70(++_0x17a63a);}(_0xe66d,0x14b));var _0xde66=function(_0x3be20a,_0x223336){_0x3be20a=_0x3be20a-0x0;var _0x7382f6=_0xe66d[_0x3be20a];return _0x7382f6;};'use strict';var client=require(_0xde66('0x0'));exports[_0xde66('0x1')]=function(_0x5ee7d2){return function(_0x3facc4){return client[_0xde66('0x2')](_0xde66('0x3'),{'options':{'raw':!![],'attributes':['id',_0xde66('0x4'),_0xde66('0x5')]},'log':_0xde66('0x3')});};}; \ No newline at end of file +var _0x883e=['Request','GetTemplate','name','html','../client','getTemplates'];(function(_0x5e4c0c,_0x25b7f8){var _0x3dbcf9=function(_0x308606){while(--_0x308606){_0x5e4c0c['push'](_0x5e4c0c['shift']());}};_0x3dbcf9(++_0x25b7f8);}(_0x883e,0xd0));var _0xe883=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x883e[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xe883('0x0'));exports[_0xe883('0x1')]=function(_0xe29d12){return function(_0x53bba4){return client[_0xe883('0x2')](_0xe883('0x3'),{'options':{'raw':!![],'attributes':['id',_0xe883('0x4'),_0xe883('0x5')]},'log':_0xe883('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 9c68880..89203a7 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 _0x8abe=['GetTrigger','name','Condition','AllConditions','operator','value','field','Action','Actions','action','data1','data3','data6','data7','../client','Request'];(function(_0x441dd0,_0xa02a45){var _0x3840a2=function(_0x11dab0){while(--_0x11dab0){_0x441dd0['push'](_0x441dd0['shift']());}};_0x3840a2(++_0xa02a45);}(_0x8abe,0x10e));var _0xe8ab=function(_0x4c5911,_0x434a9b){_0x4c5911=_0x4c5911-0x0;var _0x22de3e=_0x8abe[_0x4c5911];return _0x22de3e;};'use strict';var client=require(_0xe8ab('0x0'));exports['getTriggers']=function(_0x4034cb){return function(_0x3e87ff){return client[_0xe8ab('0x1')](_0xe8ab('0x2'),{'options':{'raw':![],'attributes':['id',_0xe8ab('0x3'),'channel','status'],'include':[{'model':_0xe8ab('0x4'),'as':_0xe8ab('0x5'),'attributes':['id','field',_0xe8ab('0x6'),_0xe8ab('0x7')]},{'model':_0xe8ab('0x4'),'as':'AnyConditions','attributes':['id',_0xe8ab('0x8'),_0xe8ab('0x6'),_0xe8ab('0x7')]},{'model':_0xe8ab('0x9'),'as':_0xe8ab('0xa'),'attributes':['id',_0xe8ab('0xb'),_0xe8ab('0xc'),'data2',_0xe8ab('0xd'),'data4','data5',_0xe8ab('0xe'),_0xe8ab('0xf')]}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0xc4d3=['action','data1','data3','data4','data5','data6','../client','getTriggers','Request','GetTrigger','channel','status','AllConditions','field','operator','value','Action'];(function(_0x48e1ec,_0x35f468){var _0x3b33eb=function(_0x507bf9){while(--_0x507bf9){_0x48e1ec['push'](_0x48e1ec['shift']());}};_0x3b33eb(++_0x35f468);}(_0xc4d3,0x6c));var _0x3c4d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4d3[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x3c4d('0x0'));exports[_0x3c4d('0x1')]=function(_0x4e86d8){return function(_0xe4929b){return client[_0x3c4d('0x2')](_0x3c4d('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x3c4d('0x4'),_0x3c4d('0x5')],'include':[{'model':'Condition','as':_0x3c4d('0x6'),'attributes':['id',_0x3c4d('0x7'),_0x3c4d('0x8'),_0x3c4d('0x9')]},{'model':'Condition','as':'AnyConditions','attributes':['id',_0x3c4d('0x7'),_0x3c4d('0x8'),_0x3c4d('0x9')]},{'model':_0x3c4d('0xa'),'as':'Actions','attributes':['id',_0x3c4d('0xb'),_0x3c4d('0xc'),'data2',_0x3c4d('0xd'),_0x3c4d('0xe'),_0x3c4d('0xf'),_0x3c4d('0x10'),'data7']}]},'log':_0x3c4d('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 51e70c1..43d3379 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 _0x3d12=['name','registry','getTrunks','GetTrunk'];(function(_0x16d6a9,_0x5edb18){var _0x3be7ab=function(_0x428cf1){while(--_0x428cf1){_0x16d6a9['push'](_0x16d6a9['shift']());}};_0x3be7ab(++_0x5edb18);}(_0x3d12,0x1e6));var _0x23d1=function(_0x2beb8b,_0x3c189c){_0x2beb8b=_0x2beb8b-0x0;var _0x5d0dad=_0x3d12[_0x2beb8b];return _0x5d0dad;};'use strict';var client=require('../client');exports[_0x23d1('0x0')]=function(_0x277f69){return function(_0x1c775f){return client['Request'](_0x23d1('0x1'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x23d1('0x2'),_0x23d1('0x3'),'defaultuser']},'log':_0x23d1('0x1')});};}; \ No newline at end of file +var _0x3a16=['registry','defaultuser','../client','Request','GetTrunk'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3a16,0x192));var _0x63a1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3a16[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x63a1('0x0'));exports['getTrunks']=function(_0x5091be){return function(_0xb8c70c){return client[_0x63a1('0x1')](_0x63a1('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x63a1('0x3'),_0x63a1('0x4')]},'log':_0x63a1('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 38ac20a..6d825d0 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 _0xedd9=['mobile','getTelephones','internal','PauseUser','savePause','saveUnpause','UnpauseUser','ShowUser','interface','getAgent','getAgents','Request','GetUser','agent','name','email','accountcode','fullname','lastLoginAt','pauseType','lastPauseAt','voicePause'];(function(_0x91db80,_0x1041c1){var _0xa8c896=function(_0x34ee1d){while(--_0x34ee1d){_0x91db80['push'](_0x91db80['shift']());}};_0xa8c896(++_0x1041c1);}(_0xedd9,0xfc));var _0x9edd=function(_0x32e709,_0xb7f745){_0x32e709=_0x32e709-0x0;var _0x2f0fbd=_0xedd9[_0x32e709];return _0x2f0fbd;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3')},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),_0x9edd('0xb'),'phone',_0x9edd('0xc'),'interface']},'log':_0x9edd('0x0')});};};exports[_0x9edd('0xd')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x9edd('0x4'),'accountcode',_0x9edd('0xe')]},'log':_0x9edd('0xd')});};};exports['savePause']=function(_0xbf9da6,_0x13dc4f,_0x5b6c00){return client[_0x9edd('0x1')](_0x9edd('0xf'),{'body':{'type':_0x13dc4f,'uniqueid':_0x5b6c00},'options':{'where':{'id':_0xbf9da6['id']}},'log':_0x9edd('0x10')});};exports[_0x9edd('0x11')]=function(_0x287ddd){return client[_0x9edd('0x1')](_0x9edd('0x12'),{'body':{},'options':{'where':{'id':_0x287ddd['id']}},'log':_0x9edd('0x10')});};exports['getAgent']=function(_0x176bfa){return client[_0x9edd('0x1')](_0x9edd('0x13'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3'),'id':_0x176bfa},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),'voicePause',_0x9edd('0x14')]},'log':_0x9edd('0x15')});}; \ No newline at end of file +var _0x9c44=['online','pauseType','Request','GetUser','agent','name','email','accountcode','lastLoginAt','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','telephone','internal','PauseUser','savePause','getAgent','ShowUser','fullname'];(function(_0x47f5cd,_0x130ab2){var _0x309fa0=function(_0x59ccf2){while(--_0x59ccf2){_0x47f5cd['push'](_0x47f5cd['shift']());}};_0x309fa0(++_0x130ab2);}(_0x9c44,0x178));var _0x49c4=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x9c44[_0x16b9ed];return _0x66b1f8;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2')},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5'),'fullname','online',_0x49c4('0x6'),'pauseType',_0x49c4('0x7'),_0x49c4('0x8'),_0x49c4('0x9'),_0x49c4('0xa'),_0x49c4('0xb')]},'log':'getAgents'});};};exports[_0x49c4('0xc')]=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':!![],'where':{'role':_0x49c4('0xd')},'attributes':['id','name','accountcode',_0x49c4('0xe')]},'log':_0x49c4('0xc')});};};exports['savePause']=function(_0xb611a1,_0x459d09,_0x4adb3c){return client['Request'](_0x49c4('0xf'),{'body':{'type':_0x459d09,'uniqueid':_0x4adb3c},'options':{'where':{'id':_0xb611a1['id']}},'log':_0x49c4('0x10')});};exports['saveUnpause']=function(_0x7df3a9){return client[_0x49c4('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x7df3a9['id']}},'log':_0x49c4('0x10')});};exports[_0x49c4('0x11')]=function(_0x21f15a){return client[_0x49c4('0x0')](_0x49c4('0x12'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2'),'id':_0x21f15a},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),'accountcode',_0x49c4('0x13'),_0x49c4('0x14'),_0x49c4('0x6'),_0x49c4('0x15'),_0x49c4('0x7'),'voicePause',_0x49c4('0xb')]},'log':_0x49c4('0x11')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 05acd7f..f321da6 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 _0x3142=['Request','UpdateVoiceAgentReport','../client','create','CreateVoiceAgentReport'];(function(_0x50887c,_0x43cc4f){var _0x2ac1ea=function(_0x14dcf1){while(--_0x14dcf1){_0x50887c['push'](_0x50887c['shift']());}};_0x2ac1ea(++_0x43cc4f);}(_0x3142,0xc5));var _0x2314=function(_0x5a7547,_0x5e3f7a){_0x5a7547=_0x5a7547-0x0;var _0x3c8a86=_0x3142[_0x5a7547];return _0x3c8a86;};'use strict';var client=require(_0x2314('0x0'));exports[_0x2314('0x1')]=function(_0xc3b2c7){return client['Request'](_0x2314('0x2'),{'body':_0xc3b2c7,'log':'CreateVoiceAgentReport'});};exports['update']=function(_0x1490d0,_0x363db4,_0x3b3490){return client[_0x2314('0x3')](_0x2314('0x4'),{'body':_0x1490d0,'options':{'where':{'uniqueid':_0x363db4,'interface':_0x3b3490,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0x5100=['UpdateVoiceAgentReport','../client','create','CreateVoiceAgentReport','update','Request'];(function(_0x4f1a92,_0x43fb4d){var _0x140f3a=function(_0x2ac56d){while(--_0x2ac56d){_0x4f1a92['push'](_0x4f1a92['shift']());}};_0x140f3a(++_0x43fb4d);}(_0x5100,0x18d));var _0x0510=function(_0x2b9847,_0x5b5294){_0x2b9847=_0x2b9847-0x0;var _0x4e393f=_0x5100[_0x2b9847];return _0x4e393f;};'use strict';var client=require(_0x0510('0x0'));exports[_0x0510('0x1')]=function(_0x25d553){return client['Request'](_0x0510('0x2'),{'body':_0x25d553,'log':_0x0510('0x2')});};exports[_0x0510('0x3')]=function(_0x45e8af,_0x38e1f1,_0x8f73ce){return client[_0x0510('0x4')](_0x0510('0x5'),{'body':_0x45e8af,'options':{'where':{'uniqueid':_0x38e1f1,'interface':_0x8f73ce,'agentcomplete':!![]}},'log':_0x0510('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index eb624b7..4976d95 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 _0x777e=['calleridnum','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','format','YYYY-MM-DD\x20HH:mm:ss','endOf','day','type','disposition','duration','billableseconds','GetVoiceCallReports','moment','lodash','../client','create','Request','CreateVoiceCallReport','merge'];(function(_0x80a0d6,_0x1d1378){var _0x14f250=function(_0x58236e){while(--_0x58236e){_0x80a0d6['push'](_0x80a0d6['shift']());}};_0x14f250(++_0x1d1378);}(_0x777e,0x10a));var _0xe777=function(_0x45f111,_0x3a1a4a){_0x45f111=_0x45f111-0x0;var _0x483508=_0x777e[_0x45f111];return _0x483508;};'use strict';var moment=require(_0xe777('0x0'));var util=require('util');var _=require(_0xe777('0x1'));var client=require(_0xe777('0x2'));exports[_0xe777('0x3')]=function(_0x4c4fe2){return client[_0xe777('0x4')](_0xe777('0x5'),{'body':_[_0xe777('0x6')](_0x4c4fe2,{'source':_0x4c4fe2[_0xe777('0x7')],'destinationcontext':_0x4c4fe2['context'],'callerid':_0x4c4fe2['callerid'],'amaflags':_0xe777('0x8')}),'log':_0xe777('0x5')});};exports[_0xe777('0x9')]=function(){return function(){return client[_0xe777('0x4')](_0xe777('0xa'),{'options':{'where':{'type':[_0xe777('0xb')],'createdAt':{'$between':[moment()['startOf']('day')[_0xe777('0xc')](_0xe777('0xd')),moment()[_0xe777('0xe')](_0xe777('0xf'))[_0xe777('0xc')](_0xe777('0xd'))]}},'attributes':[_0xe777('0x10'),_0xe777('0x11'),_0xe777('0x12'),_0xe777('0x13')]},'log':_0xe777('0x14')});};}; \ No newline at end of file +var _0xbf99=['format','YYYY-MM-DD\x20HH:mm:ss','type','duration','billableseconds','GetVoiceCallReports','moment','util','lodash','create','Request','merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day'];(function(_0x4befe1,_0x2195ac){var _0x2d961d=function(_0x569669){while(--_0x569669){_0x4befe1['push'](_0x4befe1['shift']());}};_0x2d961d(++_0x2195ac);}(_0xbf99,0xae));var _0x9bf9=function(_0x34b4bf,_0x59fcdc){_0x34b4bf=_0x34b4bf-0x0;var _0x31cf3e=_0xbf99[_0x34b4bf];return _0x31cf3e;};'use strict';var moment=require(_0x9bf9('0x0'));var util=require(_0x9bf9('0x1'));var _=require(_0x9bf9('0x2'));var client=require('../client');exports[_0x9bf9('0x3')]=function(_0x509361){return client[_0x9bf9('0x4')]('CreateVoiceCallReport',{'body':_[_0x9bf9('0x5')](_0x509361,{'source':_0x509361[_0x9bf9('0x6')],'destinationcontext':_0x509361[_0x9bf9('0x7')],'callerid':_0x509361[_0x9bf9('0x8')],'amaflags':_0x9bf9('0x9')}),'log':'CreateVoiceCallReport'});};exports[_0x9bf9('0xa')]=function(){return function(){return client[_0x9bf9('0x4')](_0x9bf9('0xb'),{'options':{'where':{'type':[_0x9bf9('0xc')],'createdAt':{'$between':[moment()[_0x9bf9('0xd')](_0x9bf9('0xe'))[_0x9bf9('0xf')](_0x9bf9('0x10')),moment()['endOf'](_0x9bf9('0xe'))[_0x9bf9('0xf')](_0x9bf9('0x10'))]}},'attributes':[_0x9bf9('0x11'),'disposition',_0x9bf9('0x12'),_0x9bf9('0x13')]},'log':_0x9bf9('0x14')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 6021d4b..75b8c05 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 _0x6c56=['create','Request','CreateVoiceDialReport'];(function(_0xe017b1,_0xd091ee){var _0x144370=function(_0x592bbe){while(--_0x592bbe){_0xe017b1['push'](_0xe017b1['shift']());}};_0x144370(++_0xd091ee);}(_0x6c56,0x18c));var _0x66c5=function(_0x25ba6a,_0x4422d6){_0x25ba6a=_0x25ba6a-0x0;var _0x1be09a=_0x6c56[_0x25ba6a];return _0x1be09a;};'use strict';var client=require('../client');exports[_0x66c5('0x0')]=function(_0x5170d6){return client[_0x66c5('0x1')](_0x66c5('0x2'),{'body':_0x5170d6,'log':_0x66c5('0x2')});}; \ No newline at end of file +var _0xde0c=['../client','create','CreateVoiceDialReport'];(function(_0x17eb11,_0x25d8c6){var _0x559093=function(_0x1bf619){while(--_0x1bf619){_0x17eb11['push'](_0x17eb11['shift']());}};_0x559093(++_0x25d8c6);}(_0xde0c,0xc9));var _0xcde0=function(_0x39cde6,_0x2196d7){_0x39cde6=_0x39cde6-0x0;var _0xde6d89=_0xde0c[_0x39cde6];return _0xde6d89;};'use strict';var client=require(_0xcde0('0x0'));exports[_0xcde0('0x1')]=function(_0x30d108){return client['Request']('CreateVoiceDialReport',{'body':_0x30d108,'log':_0xcde0('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index a991234..5014d64 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 _0x89e8=['exten','recordingFormat','../client','getVoiceExtensions','Request','GetVoiceExtension'];(function(_0x176d0f,_0x11fa00){var _0x566b50=function(_0x2a554e){while(--_0x2a554e){_0x176d0f['push'](_0x176d0f['shift']());}};_0x566b50(++_0x11fa00);}(_0x89e8,0x74));var _0x889e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x89e8[_0x2dafbe];return _0x58a45a;};'use strict';var client=require(_0x889e('0x0'));exports[_0x889e('0x1')]=function(){return function(){return client[_0x889e('0x2')](_0x889e('0x3'),{'options':{'raw':!![],'attributes':['id',_0x889e('0x4'),_0x889e('0x5')],'where':{'VoiceExtensionId':null}},'log':_0x889e('0x1')});};}; \ No newline at end of file +var _0x4058=['GetVoiceExtension','exten','recordingFormat','../client','getVoiceExtensions','Request'];(function(_0x4ad441,_0x28f14f){var _0x3693b6=function(_0x3813a9){while(--_0x3813a9){_0x4ad441['push'](_0x4ad441['shift']());}};_0x3693b6(++_0x28f14f);}(_0x4058,0x129));var _0x8405=function(_0x57a371,_0x5aa0c5){_0x57a371=_0x57a371-0x0;var _0x109a96=_0x4058[_0x57a371];return _0x109a96;};'use strict';var client=require(_0x8405('0x0'));exports[_0x8405('0x1')]=function(){return function(){return client[_0x8405('0x2')](_0x8405('0x3'),{'options':{'raw':!![],'attributes':['id',_0x8405('0x4'),_0x8405('0x5')],'where':{'VoiceExtensionId':null}},'log':_0x8405('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 58c2d23..615d404 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 _0x4328=['dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMinThreshold','callAdditionalPhoneAfterMin','Trunk','name','callerid','Pause','mandatoryDispositionPause','TrunkBackup','active','Interval','Intervals','interval','../client','getVoiceQueues','acw','autopause','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','timeout','dialRecallMeTimeout','dialRecallInQueue'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x4328,0x177));var _0x8432=function(_0x300f8f,_0x1bd42b){_0x300f8f=_0x300f8f-0x0;var _0x52a167=_0x4328[_0x300f8f];return _0x52a167;};'use strict';var client=require(_0x8432('0x0'));exports[_0x8432('0x1')]=function(){return function(){return client['Request']('GetVoiceQueue',{'options':{'raw':![],'attributes':['id','name',_0x8432('0x2'),'acwTimeout',_0x8432('0x3'),'monitor_format',_0x8432('0x4'),_0x8432('0x5'),_0x8432('0x6'),_0x8432('0x7'),_0x8432('0x8'),_0x8432('0x9'),_0x8432('0xa'),'dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions',_0x8432('0xb'),_0x8432('0xc'),_0x8432('0xd'),'dialCongestionRetryFrequency',_0x8432('0xe'),'dialBusyRetryFrequency',_0x8432('0xf'),_0x8432('0x10'),'dialGlobalMaxRetry',_0x8432('0x11'),_0x8432('0x12'),_0x8432('0x13'),_0x8432('0x14'),_0x8432('0x15'),_0x8432('0x16'),_0x8432('0x17'),_0x8432('0x18'),_0x8432('0x19'),'dialAMDMinWordLength',_0x8432('0x1a'),'dialAMDMaximumNumberOfWords',_0x8432('0x1b'),'dialAMDMaximumWordLength',_0x8432('0x1c'),_0x8432('0x1d'),_0x8432('0x1e'),'dialOrderByScheduledAt',_0x8432('0x1f'),_0x8432('0x20'),_0x8432('0x21'),_0x8432('0x22'),_0x8432('0x23'),_0x8432('0x24'),_0x8432('0x25'),_0x8432('0x26'),_0x8432('0x27'),_0x8432('0x28'),_0x8432('0x29'),'dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry',_0x8432('0x2a'),_0x8432('0x2b'),_0x8432('0x2c'),_0x8432('0x2d'),'dialPredictiveIntervalMaxThreshold',_0x8432('0x2e'),_0x8432('0x2f')],'include':[{'model':_0x8432('0x30'),'as':_0x8432('0x30'),'attributes':['id',_0x8432('0x31'),_0x8432('0x32'),'active']},{'model':_0x8432('0x33'),'as':_0x8432('0x34'),'attributes':['id','name']},{'model':_0x8432('0x30'),'as':_0x8432('0x35'),'attributes':['id',_0x8432('0x31'),_0x8432('0x32'),_0x8432('0x36')]},{'model':_0x8432('0x37'),'as':_0x8432('0x37'),'attributes':['id','name'],'include':[{'model':_0x8432('0x37'),'as':_0x8432('0x38'),'attributes':['id',_0x8432('0x31'),_0x8432('0x39')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file +var _0x7332=['dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','callAdditionalPhoneAfterMin','Trunk','callerid','active','Pause','mandatoryDispositionPause','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','monitor_format','type','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions'];(function(_0x151950,_0x3a62ef){var _0x25f81f=function(_0x330340){while(--_0x330340){_0x151950['push'](_0x151950['shift']());}};_0x25f81f(++_0x3a62ef);}(_0x7332,0x110));var _0x2733=function(_0x50c982,_0x2461ee){_0x50c982=_0x50c982-0x0;var _0x481a38=_0x7332[_0x50c982];return _0x481a38;};'use strict';var client=require(_0x2733('0x0'));exports[_0x2733('0x1')]=function(){return function(){return client[_0x2733('0x2')](_0x2733('0x3'),{'options':{'raw':![],'attributes':['id',_0x2733('0x4'),_0x2733('0x5'),_0x2733('0x6'),'autopause',_0x2733('0x7'),_0x2733('0x8'),'dialActive','dialMethod',_0x2733('0x9'),_0x2733('0xa'),'dialPowerLevel',_0x2733('0xb'),_0x2733('0xc'),_0x2733('0xd'),_0x2733('0xe'),_0x2733('0xf'),_0x2733('0x10'),_0x2733('0x11'),_0x2733('0x12'),_0x2733('0x13'),_0x2733('0x14'),'dialCongestionRetryFrequency',_0x2733('0x15'),_0x2733('0x16'),'dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency',_0x2733('0x17'),_0x2733('0x18'),_0x2733('0x19'),'dialPrefix',_0x2733('0x1a'),_0x2733('0x1b'),_0x2733('0x1c'),_0x2733('0x1d'),_0x2733('0x1e'),_0x2733('0x1f'),'dialAMDMinWordLength',_0x2733('0x20'),'dialAMDMaximumNumberOfWords',_0x2733('0x21'),_0x2733('0x22'),'timeout','dialRecallMeTimeout',_0x2733('0x23'),_0x2733('0x24'),_0x2733('0x25'),_0x2733('0x26'),'dialQueueProject2',_0x2733('0x7'),_0x2733('0x27'),_0x2733('0x28'),'dialCutDigit','dialNoSuchNumberMaxRetry',_0x2733('0x29'),'dialDropMaxRetry','dialDropRetryFrequency',_0x2733('0x2a'),'dialAbandonedRetryFrequency',_0x2733('0x2b'),_0x2733('0x2c'),_0x2733('0x2d'),_0x2733('0x2e'),_0x2733('0x2f'),_0x2733('0x30'),'dialPredictiveIntervalMinThreshold',_0x2733('0x31')],'include':[{'model':_0x2733('0x32'),'as':_0x2733('0x32'),'attributes':['id',_0x2733('0x4'),_0x2733('0x33'),_0x2733('0x34')]},{'model':_0x2733('0x35'),'as':_0x2733('0x36'),'attributes':['id',_0x2733('0x4')]},{'model':_0x2733('0x32'),'as':'TrunkBackup','attributes':['id','name',_0x2733('0x33'),'active']},{'model':_0x2733('0x37'),'as':_0x2733('0x37'),'attributes':['id',_0x2733('0x4')],'include':[{'model':'Interval','as':_0x2733('0x38'),'attributes':['id',_0x2733('0x4'),_0x2733('0x39')]}]}]},'log':_0x2733('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 6da2cbf..479cc82 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(_0xc6e1ca,_0x395e0d){var _0x48bde1=function(_0x34bae9){while(--_0x34bae9){_0xc6e1ca['push'](_0xc6e1ca['shift']());}};_0x48bde1(++_0x395e0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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(_0x4f18bb,_0x2ff841){var _0x5465b7=function(_0x31b9fe){while(--_0x31b9fe){_0x4f18bb['push'](_0x4f18bb['shift']());}};_0x5465b7(++_0x2ff841);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'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 cfbbdd3..8417e29 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 _0xd631=['Request','GetVoiceQueueRtPauses','getVoiceQueueRtPauses','../client'];(function(_0x47e15b,_0x4628ea){var _0x247166=function(_0xf4780c){while(--_0xf4780c){_0x47e15b['push'](_0x47e15b['shift']());}};_0x247166(++_0x4628ea);}(_0xd631,0x1bf));var _0x1d63=function(_0x1147ab,_0x10e72b){_0x1147ab=_0x1147ab-0x0;var _0x55cb5a=_0xd631[_0x1147ab];return _0x55cb5a;};'use strict';var client=require(_0x1d63('0x0'));exports['getVoiceQueueRtPauses']=function(_0x374a17){return function(){return client[_0x1d63('0x1')](_0x1d63('0x2'),{'options':{'where':{'VoiceQueueId':_0x374a17,'paused':!![]},'raw':!![]},'log':_0x1d63('0x3')});};}; \ No newline at end of file +var _0x7dc0=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses','../client'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x7dc0,0x15f));var _0x07dc=function(_0x200827,_0x4af951){_0x200827=_0x200827-0x0;var _0x120047=_0x7dc0[_0x200827];return _0x120047;};'use strict';var client=require(_0x07dc('0x0'));exports[_0x07dc('0x1')]=function(_0x76cbd3){return function(){return client[_0x07dc('0x2')](_0x07dc('0x3'),{'options':{'where':{'VoiceQueueId':_0x76cbd3,'paused':!![]},'raw':!![]},'log':_0x07dc('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 360e248..5c465ea 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x3379aa,_0x2f36cc){var _0x166c1d=function(_0x1a15ae){while(--_0x1a15ae){_0x3379aa['push'](_0x3379aa['shift']());}};_0x166c1d(++_0x2f36cc);}(_0x7a54,0x106));var _0x47a5=function(_0x3001f1,_0x4cc94e){_0x3001f1=_0x3001f1-0x0;var _0xfcc604=_0x7a54[_0x3001f1];return _0xfcc604;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x3c6182,_0x470e3f){var _0x108b2d=function(_0x485d5c){while(--_0x485d5c){_0x3c6182['push'](_0x3c6182['shift']());}};_0x108b2d(++_0x470e3f);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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 7aa1cde..4859305 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 _0xbdd5=['transfererconnectedlinename','transfereraccountcode','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','CreateVoiceTransferReport','result','transfererchannel','transferercalleridname'];(function(_0x2d46aa,_0x33a896){var _0x57ab18=function(_0x181a7e){while(--_0x181a7e){_0x2d46aa['push'](_0x2d46aa['shift']());}};_0x57ab18(++_0x33a896);}(_0xbdd5,0x139));var _0x5bdd=function(_0x34f183,_0x95ceb8){_0x34f183=_0x34f183-0x0;var _0x3f312c=_0xbdd5[_0x34f183];return _0x3f312c;};'use strict';var client=require(_0x5bdd('0x0'));exports[_0x5bdd('0x1')]={};exports[_0x5bdd('0x2')]=function(_0x21cad7){return client['Request'](_0x5bdd('0x3'),{'body':{'result':_0x21cad7[_0x5bdd('0x4')],'transfererchannel':_0x21cad7[_0x5bdd('0x5')],'transferercalleridnum':_0x21cad7['transferercalleridnum'],'transferercalleridname':_0x21cad7[_0x5bdd('0x6')],'transfererconnectedlinenum':_0x21cad7['transfererconnectedlinenum'],'transfererconnectedlinename':_0x21cad7[_0x5bdd('0x7')],'transfereraccountcode':_0x21cad7[_0x5bdd('0x8')],'transferercontext':_0x21cad7['transferercontext'],'transfererexten':_0x21cad7['transfererexten'],'transfererlinkedid':_0x21cad7[_0x5bdd('0x9')],'transfereechannel':_0x21cad7[_0x5bdd('0xa')],'transfereecalleridnum':_0x21cad7[_0x5bdd('0xb')],'transfereecalleridname':_0x21cad7[_0x5bdd('0xc')],'transfereeconnectedlinenum':_0x21cad7[_0x5bdd('0xd')],'transfereeconnectedlinename':_0x21cad7[_0x5bdd('0xe')],'transfereeaccountcode':_0x21cad7[_0x5bdd('0xf')],'transfereecontext':_0x21cad7[_0x5bdd('0x10')],'transfereeexten':_0x21cad7[_0x5bdd('0x11')],'transfereelinkedid':_0x21cad7[_0x5bdd('0x12')],'isexternal':_0x21cad7[_0x5bdd('0x13')],'context':_0x21cad7[_0x5bdd('0x14')],'extension':_0x21cad7[_0x5bdd('0x15')],'type':'blind'},'log':_0x5bdd('0x3')});};exports[_0x5bdd('0x16')]=function(_0x5bd2a3){return client['Request'](_0x5bdd('0x3'),{'body':{'result':_0x5bd2a3['result'],'transfererchannel':_0x5bd2a3[_0x5bdd('0x17')],'transferercalleridnum':_0x5bd2a3[_0x5bdd('0x18')],'transferercalleridname':_0x5bd2a3[_0x5bdd('0x19')],'transfererconnectedlinenum':_0x5bd2a3[_0x5bdd('0x1a')],'transfererconnectedlinename':_0x5bd2a3[_0x5bdd('0x1b')],'transfereraccountcode':_0x5bd2a3[_0x5bdd('0x1c')],'transferercontext':_0x5bd2a3[_0x5bdd('0x1d')],'transfererexten':_0x5bd2a3['secondtransfererexten'],'transfererlinkedid':_0x5bd2a3[_0x5bdd('0x1e')],'transfereechannel':_0x5bd2a3[_0x5bdd('0x1f')],'transfereecalleridnum':_0x5bd2a3['transfertargetcalleridnum'],'transfereecalleridname':_0x5bd2a3[_0x5bdd('0x20')],'transfereeconnectedlinenum':_0x5bd2a3[_0x5bdd('0x21')],'transfereeconnectedlinename':_0x5bd2a3['transfertargetconnectedlinename'],'transfereeaccountcode':_0x5bd2a3['transfertargetaccountcode'],'transfereecontext':_0x5bd2a3[_0x5bdd('0x22')],'transfereeexten':_0x5bd2a3[_0x5bdd('0x23')],'transfereelinkedid':_0x5bd2a3[_0x5bdd('0x24')],'isexternal':_0x5bd2a3[_0x5bdd('0x13')],'context':_0x5bd2a3[_0x5bdd('0x25')],'extension':_0x5bd2a3[_0x5bdd('0x26')],'type':_0x5bdd('0x27')},'log':_0x5bdd('0x3')});}; \ No newline at end of file +var _0x5ce7=['Request','CreateVoiceTransferReport','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereecontext','transfereelinkedid','isexternal','extension','blind','attendedTransfer','result','origtransferercalleridnum','origtransferercalleridname','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridnum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','origtransfererexten','attended','../client','transfers','blindTransfer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5ce7,0x15b));var _0x75ce=function(_0x52195d,_0x52e4fd){_0x52195d=_0x52195d-0x0;var _0x522e83=_0x5ce7[_0x52195d];return _0x522e83;};'use strict';var client=require(_0x75ce('0x0'));exports[_0x75ce('0x1')]={};exports[_0x75ce('0x2')]=function(_0x5aff62){return client[_0x75ce('0x3')](_0x75ce('0x4'),{'body':{'result':_0x5aff62['result'],'transfererchannel':_0x5aff62['transfererchannel'],'transferercalleridnum':_0x5aff62['transferercalleridnum'],'transferercalleridname':_0x5aff62[_0x75ce('0x5')],'transfererconnectedlinenum':_0x5aff62[_0x75ce('0x6')],'transfererconnectedlinename':_0x5aff62[_0x75ce('0x7')],'transfereraccountcode':_0x5aff62[_0x75ce('0x8')],'transferercontext':_0x5aff62[_0x75ce('0x9')],'transfererexten':_0x5aff62[_0x75ce('0xa')],'transfererlinkedid':_0x5aff62[_0x75ce('0xb')],'transfereechannel':_0x5aff62['transfereechannel'],'transfereecalleridnum':_0x5aff62[_0x75ce('0xc')],'transfereecalleridname':_0x5aff62[_0x75ce('0xd')],'transfereeconnectedlinenum':_0x5aff62[_0x75ce('0xe')],'transfereeconnectedlinename':_0x5aff62[_0x75ce('0xf')],'transfereeaccountcode':_0x5aff62['transfereeaccountcode'],'transfereecontext':_0x5aff62[_0x75ce('0x10')],'transfereeexten':_0x5aff62['transfereeexten'],'transfereelinkedid':_0x5aff62[_0x75ce('0x11')],'isexternal':_0x5aff62[_0x75ce('0x12')],'context':_0x5aff62['context'],'extension':_0x5aff62[_0x75ce('0x13')],'type':_0x75ce('0x14')},'log':_0x75ce('0x4')});};exports[_0x75ce('0x15')]=function(_0x153d00){return client[_0x75ce('0x3')]('CreateVoiceTransferReport',{'body':{'result':_0x153d00[_0x75ce('0x16')],'transfererchannel':_0x153d00['origtransfererchannel'],'transferercalleridnum':_0x153d00[_0x75ce('0x17')],'transferercalleridname':_0x153d00[_0x75ce('0x18')],'transfererconnectedlinenum':_0x153d00['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x153d00['secondtransfererconnectedlinename'],'transfereraccountcode':_0x153d00[_0x75ce('0x19')],'transferercontext':_0x153d00[_0x75ce('0x1a')],'transfererexten':_0x153d00[_0x75ce('0x1b')],'transfererlinkedid':_0x153d00[_0x75ce('0x1c')],'transfereechannel':_0x153d00['transfertargetchannel'],'transfereecalleridnum':_0x153d00[_0x75ce('0x1d')],'transfereecalleridname':_0x153d00['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x153d00['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x153d00[_0x75ce('0x1e')],'transfereeaccountcode':_0x153d00[_0x75ce('0x1f')],'transfereecontext':_0x153d00['transfertargetcontext'],'transfereeexten':_0x153d00[_0x75ce('0x20')],'transfereelinkedid':_0x153d00['transfertargetlinkedid'],'isexternal':_0x153d00[_0x75ce('0x12')],'context':_0x153d00['origtransferercontext'],'extension':_0x153d00[_0x75ce('0x21')],'type':_0x75ce('0x22')},'log':_0x75ce('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 483b0b8..055a24c 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 _0x15ef=['timer','agents','updateStatusRealtime','pause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','module','action','Action','then','command','Command','content','voiceQueues','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','talking','total','type','abandoned','waiting','outbound','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','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','length','find','omit','undefined','validate','channels','uniqueid','channel','filename','wav','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','push','rec','mixmonitorid','MixMonitor\x20Success','catch','voicechannel','StopMixMonitor','destinationchannel','stop','%s.%s','status','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','values','queueChannels','voicequeuechannelhangup','map','exten','context','telephones','trunks','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','checkAfterSend','server','http','listen','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','jayson/promise','bluebird','moment','../../../config/environment','../properties','../ami','format','%s/%s','SIP','timers'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x15ef,0x80));var _0xf15e=function(_0x54d59a,_0x5b3c2c){_0x54d59a=_0x54d59a-0x0;var _0x5b52b6=_0x15ef[_0x54d59a];return _0x5b52b6;};'use strict';var _=require('lodash');var util=require(_0xf15e('0x0'));var jayson=require(_0xf15e('0x1'));var schema=require('validate');var BPromise=require(_0xf15e('0x2'));var moment=require(_0xf15e('0x3'));var config=require(_0xf15e('0x4'));var properties=require(_0xf15e('0x5'));var ami=require(_0xf15e('0x6'));exports['listen']=function(_0x1b9a24,_0x5c0553,_0x5e96b4){return new BPromise(function(_0x5ba863,_0x66708e){var _0x232359={'QueuePause':function(_0x490097){return new Promise(function(_0x2d6e94,_0x4daf89){var _0x1168c3=util[_0xf15e('0x7')](_0xf15e('0x8'),_0xf15e('0x9'),_0x490097['name']);if(_0x1b9a24['timers']&&_0x1b9a24['timers'][_0x1168c3]&&_0x1b9a24[_0xf15e('0xa')][_0x1168c3][_0xf15e('0xb')]){_0x1b9a24['timers'][_0x1168c3]['updateAcw']();}if(_0x1b9a24['agents'][_0x1168c3]){_0x1b9a24[_0xf15e('0xc')][_0x1168c3][_0xf15e('0xd')]({'statePause':_0x490097[_0xf15e('0xe')]?!![]:![]});}_0x2d6e94({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x442d51){var _0x1b8543=this;return new Promise(function(_0x16a04a,_0x5da521){if(ami[_0xf15e('0xf')]()==![]){return _0x5da521(_0x1b8543[_0xf15e('0x10')](0x1f4,[config[_0xf15e('0x11')]['ip'],config[_0xf15e('0x11')][_0xf15e('0x12')],_0xf15e('0x13')][_0xf15e('0x14')]('\x20')));}_0x442d51=_[_0xf15e('0x15')](_0x442d51,_['keys'](properties[_0xf15e('0x16')]));_0x442d51[_0xf15e('0x17')]='Reload';return ami[_0xf15e('0x18')](_0x442d51)[_0xf15e('0x19')](function(_0x45e418){_0x16a04a({'code':0xc8,'message':_0x45e418['message']});})['catch'](function(_0x3ad067){_0x5da521(_0x1b8543[_0xf15e('0x10')](0x1f5,_0x3ad067['message']));});});},'Command':function(_0x86d14f){var _0x1f1f33=this;return new Promise(function(_0xa47259,_0x4b144c){if(ami['isConnected']()==![]){return _0x4b144c(_0x1f1f33[_0xf15e('0x10')](0x1f4,[config[_0xf15e('0x11')]['ip'],config['asterisk'][_0xf15e('0x12')],'ami\x20disconnected']['join']('\x20')));}_0x86d14f=_[_0xf15e('0x15')](_0x86d14f,_0xf15e('0x1a'));_0x86d14f[_0xf15e('0x17')]=_0xf15e('0x1b');return ami['Action'](_0x86d14f)[_0xf15e('0x19')](function(_0xa09c0c){_0xa47259({'code':0xc8,'message':_0xa09c0c[_0xf15e('0x1c')]});})['catch'](function(_0x248c4b){_0x4b144c(_0x1f1f33[_0xf15e('0x10')](0x1f5,_0x248c4b['message']));});});},'VoiceQueues':function(_0x5d381a){return new Promise(function(_0x2e6d94,_0xb36af){var _0x1fd237=[];for(var _0x471079 in _0x1b9a24[_0xf15e('0x1d')]){if(_0x1b9a24['voiceQueues']['hasOwnProperty'](_0x471079)){var _0x3f9d64=_0x1b9a24[_0xf15e('0x1d')][_0x471079];var _0x4a83e5={'id':_0x3f9d64['id'],'name':_0x3f9d64[_0xf15e('0x1e')],'strategy':_0x3f9d64[_0xf15e('0x1f')],'answered':_0x3f9d64[_0xf15e('0x20')],'available':_0x3f9d64[_0xf15e('0x21')],'loggedIn':_0x3f9d64[_0xf15e('0x22')],'pTalking':_0x3f9d64[_0xf15e('0x23')],'sumBillable':_0x3f9d64[_0xf15e('0x24')],'sumDuration':_0x3f9d64[_0xf15e('0x25')],'sumHoldTime':_0x3f9d64['sumHoldTime']||0x0,'talking':_0x3f9d64[_0xf15e('0x26')],'total':_0x3f9d64[_0xf15e('0x27')],'type':_0x3f9d64[_0xf15e('0x28')],'unmanaged':_0x3f9d64['unmanaged'],'abandoned':_0x3f9d64[_0xf15e('0x29')],'waiting':_0x3f9d64[_0xf15e('0x2a')],'loggedInDb':_0x3f9d64['loggedInDb']};if(_0x3f9d64[_0xf15e('0x28')]===_0xf15e('0x2b')){_0x4a83e5[_0xf15e('0x2c')]=_0x3f9d64['dialActive'];_0x4a83e5[_0xf15e('0x2d')]=_0x3f9d64[_0xf15e('0x2d')];_0x4a83e5[_0xf15e('0x2e')]=_0x3f9d64[_0xf15e('0x2e')];_0x4a83e5['dialOriginateCallerIdNumber']=_0x3f9d64[_0xf15e('0x2f')];_0x4a83e5[_0xf15e('0x30')]=_0x3f9d64['dialOriginateTimeout'];_0x4a83e5[_0xf15e('0x31')]=_0x3f9d64[_0xf15e('0x31')];_0x4a83e5[_0xf15e('0x32')]=_0x3f9d64['temp'];_0x4a83e5[_0xf15e('0x33')]=_0x3f9d64[_0xf15e('0x33')];_0x4a83e5['outboundAnswerCallsDay']=_0x3f9d64[_0xf15e('0x34')];_0x4a83e5['outboundBlacklistCallsDay']=_0x3f9d64[_0xf15e('0x35')];_0x4a83e5[_0xf15e('0x36')]=_0x3f9d64['outboundBusyCallsDay'];_0x4a83e5['outboundCongestionCallsDay']=_0x3f9d64[_0xf15e('0x37')];_0x4a83e5[_0xf15e('0x38')]=_0x3f9d64['outboundDropCallsDayACS'];_0x4a83e5[_0xf15e('0x39')]=_0x3f9d64[_0xf15e('0x39')];_0x4a83e5[_0xf15e('0x3a')]=_0x3f9d64[_0xf15e('0x3a')];_0x4a83e5[_0xf15e('0x3b')]=_0x3f9d64[_0xf15e('0x3b')];_0x4a83e5['outboundNoSuchCallsDay']=_0x3f9d64[_0xf15e('0x3c')];_0x4a83e5[_0xf15e('0x3d')]=_0x3f9d64[_0xf15e('0x3d')];_0x4a83e5[_0xf15e('0x3e')]=_0x3f9d64[_0xf15e('0x3e')];_0x4a83e5[_0xf15e('0x3f')]=_0x3f9d64[_0xf15e('0x3f')];_0x4a83e5[_0xf15e('0x40')]=_0x3f9d64['outboundUnknownCallsDay'];_0x4a83e5[_0xf15e('0x41')]=_0x3f9d64['predictiveIntervalAnsweredCalls'];_0x4a83e5[_0xf15e('0x42')]=_0x3f9d64[_0xf15e('0x42')];_0x4a83e5[_0xf15e('0x43')]=_0x3f9d64[_0xf15e('0x43')];_0x4a83e5[_0xf15e('0x44')]=_0x3f9d64[_0xf15e('0x44')];_0x4a83e5['predictiveIntervalDroppedCallsTimeout']=_0x3f9d64[_0xf15e('0x45')];_0x4a83e5[_0xf15e('0x46')]=_0x3f9d64[_0xf15e('0x46')];_0x4a83e5[_0xf15e('0x47')]=_0x3f9d64['predictiveIntervalErlangCallsDroppedCalls'];_0x4a83e5['predictiveIntervalHitRate']=_0x3f9d64[_0xf15e('0x48')];_0x4a83e5[_0xf15e('0x49')]=_0x3f9d64[_0xf15e('0x49')];_0x4a83e5['predictiveIntervalPauses']=_0x3f9d64['predictiveIntervalPauses'];_0x4a83e5['predictiveIntervalAvailable']=_0x3f9d64['predictiveIntervalAvailable'];_0x4a83e5['predictiveIntervalTotalCalls']=_0x3f9d64[_0xf15e('0x4a')];_0x4a83e5[_0xf15e('0x4b')]=_0x3f9d64[_0xf15e('0x4b')];_0x4a83e5['originated']=_0x3f9d64[_0xf15e('0x4c')];_0x4a83e5['erlangCalls']=_0x3f9d64[_0xf15e('0x4d')];_0x4a83e5[_0xf15e('0x4e')]=_0x3f9d64[_0xf15e('0x4e')];_0x4a83e5[_0xf15e('0x4f')]=_0x3f9d64['erlangAbandonmentRate'];_0x4a83e5[_0xf15e('0x50')]=_0x3f9d64[_0xf15e('0x50')];_0x4a83e5[_0xf15e('0x51')]=_0x3f9d64[_0xf15e('0x51')];_0x4a83e5[_0xf15e('0x52')]=_0x3f9d64['startProgressive'];}if(_0x3f9d64[_0xf15e('0x53')]){_0x4a83e5[_0xf15e('0x53')]={'id':_0x3f9d64[_0xf15e('0x53')]['id'],'name':_0x3f9d64[_0xf15e('0x53')][_0xf15e('0x1e')],'active':_0x3f9d64[_0xf15e('0x53')][_0xf15e('0x54')],'callerid':_0x3f9d64['Trunk'][_0xf15e('0x55')]};}if(_0x3f9d64[_0xf15e('0x56')]){_0x4a83e5['Interval']={'id':_0x3f9d64['Interval']['id'],'name':_0x3f9d64[_0xf15e('0x56')]['name']};}_0x1fd237['push'](_0x4a83e5);}}_0x2e6d94({'count':_0x1fd237[_0xf15e('0x57')],'rows':_0x1fd237});});},'UpdateVoiceQueue':function(_0x3d99f8){return new Promise(function(_0x4cdfa6,_0x4becd6){var _0x1f2e17=_[_0xf15e('0x58')](_0x1b9a24[_0xf15e('0x1d')],{'id':parseInt(_0x3d99f8['id'])});var _0x33df95=_[_0xf15e('0x59')](_0x3d99f8,['id']);if(_0x1f2e17){for(var _0x31a916 in _0x33df95){if(typeof _0x33df95[_0x31a916]!==_0xf15e('0x5a')&&typeof _0x1f2e17[_0x31a916]!==_0xf15e('0x5a')){_0x1f2e17[_0x31a916]=_0x33df95[_0x31a916];}}_0x4cdfa6(_0x1f2e17);}else{_0x4becd6();}});},'VoiceChannels':function(_0x4fd67c){return new Promise(function(_0x1dba1c,_0x44f075){var _0x3b79a8=_['values'](_0x1b9a24['channels']);_0x1dba1c({'count':_0x3b79a8[_0xf15e('0x57')],'rows':_0x3b79a8});});},'VoiceChannelMixMonitor':function(_0x368a1f){var _0x382ae5=this;return new Promise(function(_0x3da6fe,_0x1cb428){if(ami[_0xf15e('0xf')]()==![]){return _0x1cb428(_0x382ae5[_0xf15e('0x10')](0x1f4,[config[_0xf15e('0x11')]['ip'],config['asterisk'][_0xf15e('0x12')],_0xf15e('0x13')]['join']('\x20')));}var _0x378492=schema(properties['voicechannel'])[_0xf15e('0x5b')](_0x368a1f);if(_0x378492[_0xf15e('0x57')]>0x0){return _0x1cb428(_0x382ae5[_0xf15e('0x10')](0x1f4,_['map'](_0x378492,_0xf15e('0x4b'))[_0xf15e('0x14')](',\x20')));}var _0x30c8ac=_[_0xf15e('0x58')](_0x1b9a24[_0xf15e('0x5c')],{'uniqueid':_0x368a1f[_0xf15e('0x5d')]});if(_0x30c8ac&&_0x30c8ac[_0xf15e('0x5e')]){var _0x2507b3=util[_0xf15e('0x7')]('%s.%s',_0x368a1f[_0xf15e('0x5f')]||_0x368a1f[_0xf15e('0x5d')],_0x368a1f[_0xf15e('0x7')]||_0xf15e('0x60'));return ami[_0xf15e('0x18')]({'action':'MixMonitor','channel':_0x30c8ac[_0xf15e('0x5e')],'file':_0x2507b3,'options':_0xf15e('0x61')})[_0xf15e('0x19')](function(_0x25827b){var _0x3235d8=_[_0xf15e('0x58')](_0x30c8ac[_0xf15e('0x62')],{'filename':_0xf15e('0x63')+_0x2507b3[_0xf15e('0x64')]()});if(_[_0xf15e('0x65')](_0x3235d8)){_0x30c8ac[_0xf15e('0x62')][_0xf15e('0x66')]({'filename':'/var/spool/asterisk/monitor/'+_0x2507b3[_0xf15e('0x64')](),'createdAt':moment()[_0xf15e('0x7')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x25827b['mixmonitorid'],'status':_0xf15e('0x67')});}else{_0x3235d8[_0xf15e('0x68')]=_0x25827b['mixmonitorid'];_0x3235d8['status']=_0xf15e('0x67');}_0x3da6fe({'code':0xc8,'message':[_0x368a1f[_0xf15e('0x5d')],_0xf15e('0x69'),_0x25827b[_0xf15e('0x68')]][_0xf15e('0x14')]('\x20'),'mixmonitorid':_0x25827b[_0xf15e('0x68')]});})[_0xf15e('0x6a')](function(_0x54efa8){_0x1cb428(_0x382ae5['error'](0x1f5,[_0x368a1f[_0xf15e('0x5d')],_0x54efa8['message'][_0xf15e('0x64')]()][_0xf15e('0x14')]('\x20')));});}else{return _0x1cb428(_0x382ae5[_0xf15e('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x30b2f3){var _0x295d49=this;return new Promise(function(_0x469a1b,_0x13837c){if(ami['isConnected']()==![]){return _0x13837c(_0x295d49['error'](0x1f4,[config[_0xf15e('0x11')]['ip'],config[_0xf15e('0x11')]['username'],'ami\x20disconnected'][_0xf15e('0x14')]('\x20')));}var _0x1eec69=schema(properties[_0xf15e('0x6b')])[_0xf15e('0x5b')](_0x30b2f3);if(_0x1eec69['length']>0x0){return _0x13837c(_0x295d49['error'](0x1f4,_['map'](_0x1eec69,_0xf15e('0x4b'))[_0xf15e('0x14')](',\x20')));}var _0x5f1121=_['find'](_0x1b9a24[_0xf15e('0x5c')],{'uniqueid':_0x30b2f3['uniqueid']});if(_0x5f1121){return BPromise['resolve']()['then'](function(){if(_0x5f1121['channel']){return ami['Action']({'action':_0xf15e('0x6c'),'channel':_0x5f1121[_0xf15e('0x5e')],'mixmonitorid':_0x30b2f3[_0xf15e('0x68')]})['catch'](function(_0x4979fd){});}})[_0xf15e('0x19')](function(){if(_0x5f1121[_0xf15e('0x6d')]){return ami['Action']({'action':'StopMixMonitor','channel':_0x5f1121[_0xf15e('0x6d')],'mixmonitorid':_0x30b2f3[_0xf15e('0x68')]})[_0xf15e('0x6a')](function(_0x532f5b){});}})['then'](function(_0x37e0b2){var _0x44cefb=_['find'](_0x5f1121['monitors'],{'mixmonitorid':_0x30b2f3['mixmonitorid']});if(_0x44cefb){_0x44cefb['status']=_0xf15e('0x6e');}})[_0xf15e('0x19')](function(){var _0x53630b=util['format'](_0xf15e('0x6f'),_0x30b2f3['filename']||_0x30b2f3[_0xf15e('0x5d')],_0x30b2f3['format']||_0xf15e('0x60'));var _0x2a3255=_[_0xf15e('0x58')](_0x5f1121['monitors'],{'filename':_0xf15e('0x63')+_0x53630b['toLowerCase']()});if(_0x2a3255){_0x2a3255[_0xf15e('0x70')]=_0xf15e('0x6e');}})[_0xf15e('0x19')](function(){_0x469a1b({'code':0xc8,'message':[_0x30b2f3[_0xf15e('0x5d')],_0xf15e('0x71')][_0xf15e('0x14')]('\x20')});})[_0xf15e('0x6a')](function(_0x2ea42f){_0x13837c(_0x295d49['error'](0x1f5,[_0x30b2f3[_0xf15e('0x5d')],_0x2ea42f['message']['toLowerCase']()][_0xf15e('0x14')]('\x20')));});}else{return _0x13837c(_0x295d49['error'](0x1f5,_0xf15e('0x72')));}});},'VoiceQueuesChannels':function(_0x37ed48){return new Promise(function(_0x2cff3a,_0x2cf9f7){var _0x45a25a=_[_0xf15e('0x73')](_0x1b9a24[_0xf15e('0x74')]);_0x2cff3a({'count':_0x45a25a[_0xf15e('0x57')],'rows':_0x45a25a});});},'VoiceQueuesChannel':function(_0x18b2d2){var _0x8c9b10=this;return new Promise(function(_0x4f57f5,_0x5df791){var _0x72d9b6=schema(properties['voicequeuechannel'])['validate'](_0x18b2d2);if(_0x72d9b6[_0xf15e('0x57')]>0x0){return _0x5df791(_0x8c9b10[_0xf15e('0x10')](0x1f4,_['map'](_0x72d9b6,_0xf15e('0x4b'))[_0xf15e('0x14')](',\x20')));}var _0x574403=_['find'](_0x1b9a24[_0xf15e('0x74')],{'uniqueid':_0x18b2d2['uniqueid']});if(_0x574403){_0x4f57f5(_0x574403);}else{return _0x5df791(_0x8c9b10[_0xf15e('0x10')](0x1f5,_0xf15e('0x72')));}});},'VoiceQueuesChannelHangup':function(_0x30cf00){var _0x380fb2=this;return new Promise(function(_0x19890b,_0x340451){if(ami['isConnected']()==![]){return _0x340451(_0x380fb2[_0xf15e('0x10')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0xf15e('0x12')],_0xf15e('0x13')][_0xf15e('0x14')]('\x20')));}var _0xbf57fb=schema(properties[_0xf15e('0x75')])['validate'](_0x30cf00);if(_0xbf57fb[_0xf15e('0x57')]>0x0){return _0x340451(_0x380fb2[_0xf15e('0x10')](0x1f4,_[_0xf15e('0x76')](_0xbf57fb,_0xf15e('0x4b'))[_0xf15e('0x14')](',\x20')));}var _0x482082=_['find'](_0x1b9a24[_0xf15e('0x74')],{'uniqueid':_0x30cf00[_0xf15e('0x5d')]});if(_0x482082&&_0x482082[_0xf15e('0x5e')]){return ami['Action']({'action':'Hangup','channel':_0x482082[_0xf15e('0x5e')]})['then'](function(_0x449164){_0x19890b({'code':0xc8,'message':[_0x30cf00[_0xf15e('0x5d')],_0x449164['message'][_0xf15e('0x64')]()][_0xf15e('0x14')]('\x20')});})['catch'](function(_0x8c5913){_0x340451(_0x380fb2['error'](0x1f5,[_0x30cf00[_0xf15e('0x5d')],_0x8c5913[_0xf15e('0x4b')][_0xf15e('0x64')]()][_0xf15e('0x14')]('\x20')));});}else{return _0x340451(_0x380fb2[_0xf15e('0x10')](0x1f5,_0xf15e('0x72')));}});},'VoiceQueuesChannelRedirect':function(_0x4d320f){var _0x5025bb=this;return new Promise(function(_0x3c1ac2,_0x18bc85){if(ami['isConnected']()==![]){return _0x18bc85(_0x5025bb['error'](0x1f4,[config[_0xf15e('0x11')]['ip'],config['asterisk'][_0xf15e('0x12')],'ami\x20disconnected'][_0xf15e('0x14')]('\x20')));}var _0x474c24=schema(properties['voicequeuechannelredirect'])[_0xf15e('0x5b')](_0x4d320f);if(_0x474c24['length']>0x0){return _0x18bc85(_0x5025bb[_0xf15e('0x10')](0x1f4,_[_0xf15e('0x76')](_0x474c24,_0xf15e('0x4b'))['join'](',\x20')));}var _0x40beaf=_[_0xf15e('0x58')](_0x1b9a24[_0xf15e('0x74')],{'uniqueid':_0x4d320f[_0xf15e('0x5d')]});if(_0x40beaf&&_0x40beaf[_0xf15e('0x5e')]){return ami['Action']({'action':'Redirect','channel':_0x40beaf[_0xf15e('0x5e')],'exten':_0x4d320f[_0xf15e('0x77')],'context':_0x4d320f[_0xf15e('0x78')]||_0x40beaf['context'],'priority':0x1})[_0xf15e('0x19')](function(_0x346ed4){_0x3c1ac2({'code':0xc8,'message':[_0x4d320f[_0xf15e('0x5d')],_0x346ed4[_0xf15e('0x4b')]['toLowerCase']()][_0xf15e('0x14')]('\x20')});})[_0xf15e('0x6a')](function(_0x91a322){_0x18bc85(_0x5025bb[_0xf15e('0x10')](0x1f5,[_0x4d320f[_0xf15e('0x5d')],_0x91a322[_0xf15e('0x4b')][_0xf15e('0x64')]()][_0xf15e('0x14')]('\x20')));});}else{return _0x18bc85(_0x5025bb[_0xf15e('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x34ee2f){return new Promise(function(_0x56e37c,_0x1484a4){var _0x1108bd=_[_0xf15e('0x73')](_0x1b9a24[_0xf15e('0xc')]);_0x56e37c({'count':_0x1108bd['length'],'rows':_0x1108bd});});},'Telephones':function(_0x4f251c){return new Promise(function(_0x4a6ea5,_0x4ba658){var _0x532693=_[_0xf15e('0x73')](_0x1b9a24[_0xf15e('0x79')]);_0x4a6ea5({'count':_0x532693[_0xf15e('0x57')],'rows':_0x532693});});},'Trunks':function(_0x2450b1){return new Promise(function(_0x459d82,_0xcee4f5){var _0x387a2c=_[_0xf15e('0x73')](_0x1b9a24[_0xf15e('0x7a')]);_0x459d82({'count':_0x387a2c['length'],'rows':_0x387a2c});});},'OutboundChannels':function(_0x425290){return new Promise(function(_0x10406e,_0x4a3a36){var _0x299be3=_[_0xf15e('0x73')](_0x1b9a24[_0xf15e('0x7b')]);_0x10406e({'count':_0x299be3[_0xf15e('0x57')],'rows':_0x299be3});});},'Outbound':function(_0x48414e){return new Promise(function(_0x44c30b,_0x40f151){_0x44c30b(_0x1b9a24[_0xf15e('0x2b')]);});},'Campaigns':function(_0x39f9ce){return new Promise(function(_0x426b4b,_0x1bf82a){var _0xdf7775=_['values'](_0x1b9a24[_0xf15e('0x7c')]);_0x426b4b({'count':_0xdf7775[_0xf15e('0x57')],'rows':_0xdf7775});});},'VoiceQueuesPreview':function(_0x51d84b){var _0x295a21=this;return new Promise(function(_0x402613,_0x5b1c88){_0x5c0553[_0xf15e('0x7d')](_0x51d84b['id'])[_0xf15e('0x19')](function(_0x228a23){_0x402613({'code':0xc8,'message':_0x228a23['message']});})[_0xf15e('0x6a')](function(_0x8f566e){_0x5b1c88(_0x295a21[_0xf15e('0x10')](0x1f4,_0x8f566e[_0xf15e('0x4b')]));});});},'EventManager':function(_0x412200){var _0x3a9705=this;return new Promise(function(_0x1c2891,_0x4ee137){if(!_0x412200[_0xf15e('0x7e')]){return _0x4ee137(_0x3a9705[_0xf15e('0x10')](0x1f4,_0xf15e('0x7f')));}ami[_0xf15e('0x80')](_0xf15e('0x81')+_0x412200['event'],_0x412200['message']);_0x1c2891({'code':0xc8,'message':_0x412200});});},'FaxAccounts':function(_0x51819f){return new Promise(function(_0x26591d,_0x1a9e87){var _0x863deb=_[_0xf15e('0x73')](_0x1b9a24[_0xf15e('0x82')]);_0x26591d({'count':_0x863deb[_0xf15e('0x57')],'rows':_0x863deb});});},'SendFax':function(_0x22f526){var _0x49f1b4=this;return new Promise(function(_0x3daaf6,_0x27f242){_0x5e96b4[_0xf15e('0x83')](_0x22f526)['then'](function(_0x528d11){_0x3daaf6({'code':0xc8,'message':_0x528d11['message']});})[_0xf15e('0x6a')](function(_0x3f9a36){_0x27f242(_0x49f1b4[_0xf15e('0x10')](0x1f4,_0x3f9a36[_0xf15e('0x4b')]));});});},'CheckAfterSend':function(_0x369af7){var _0x29f953=this;return new Promise(function(_0x3a9b61,_0x38851f){_0x5e96b4[_0xf15e('0x84')](_0x369af7)[_0xf15e('0x19')](function(_0x17d407){_0x3a9b61({'code':0xc8,'message':_0x17d407[_0xf15e('0x4b')]});})[_0xf15e('0x6a')](function(_0x40b26e){_0x38851f(_0x29f953[_0xf15e('0x10')](0x1f4,_0x40b26e['message']));});});}};var _0x3f1966=jayson[_0xf15e('0x85')](_0x232359)[_0xf15e('0x86')]();_0x3f1966['on']('error',function(_0xd854c8){return _0x66708e(_0xd854c8);});_0x3f1966[_0xf15e('0x87')](0x232a,_0xf15e('0x88'),function(){console['log'](_0xf15e('0x89'),0x232a);return _0x5ba863(_0xf15e('0x8a')+0x232a);});});}; \ No newline at end of file +var _0x6b1b=['join','Command','content','catch','voiceQueues','hasOwnProperty','name','strategy','answered','available','loggedIn','sumBillable','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','push','length','omit','undefined','values','channels','voicechannel','map','uniqueid','channel','%s.%s','filename','ai(mixmonitorid)','find','monitors','toLowerCase','/var/spool/asterisk/monitor/','mixmonitorid','status','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','destinationchannel','StopMixMonitor','stop','wav','Hangup','queueChannels','exten','context','telephones','trunks','outboundChannels','campaigns','event','emit','custom:','send','server','http','127.0.0.1','util','jayson/promise','validate','moment','../../../config/environment','../properties','../ami','listen','format','SIP','timer','timers','agents','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','action','Reload','Action','then','message'];(function(_0xc429c4,_0x456238){var _0x57989b=function(_0x37adac){while(--_0x37adac){_0xc429c4['push'](_0xc429c4['shift']());}};_0x57989b(++_0x456238);}(_0x6b1b,0x1e7));var _0xb6b1=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0x6b1b[_0xf71120];return _0xbe2fd3;};'use strict';var _=require('lodash');var util=require(_0xb6b1('0x0'));var jayson=require(_0xb6b1('0x1'));var schema=require(_0xb6b1('0x2'));var BPromise=require('bluebird');var moment=require(_0xb6b1('0x3'));var config=require(_0xb6b1('0x4'));var properties=require(_0xb6b1('0x5'));var ami=require(_0xb6b1('0x6'));exports[_0xb6b1('0x7')]=function(_0x345886,_0x41bf3e,_0x113a39){return new BPromise(function(_0x1ff716,_0x13334e){var _0x1a4cd0={'QueuePause':function(_0x5b440a){return new Promise(function(_0x2734cc,_0x52aa76){var _0x4da7d3=util[_0xb6b1('0x8')]('%s/%s',_0xb6b1('0x9'),_0x5b440a['name']);if(_0x345886['timers']&&_0x345886['timers'][_0x4da7d3]&&_0x345886['timers'][_0x4da7d3][_0xb6b1('0xa')]){_0x345886[_0xb6b1('0xb')][_0x4da7d3]['updateAcw']();}if(_0x345886[_0xb6b1('0xc')][_0x4da7d3]){_0x345886['agents'][_0x4da7d3]['updateStatusRealtime']({'statePause':_0x5b440a[_0xb6b1('0xd')]?!![]:![]});}_0x2734cc({'code':0xc8,'message':_0xb6b1('0xe')});});},'Reload':function(_0x12f3ff){var _0x327eee=this;return new Promise(function(_0x23881d,_0x18f6b5){if(ami[_0xb6b1('0xf')]()==![]){return _0x18f6b5(_0x327eee[_0xb6b1('0x10')](0x1f4,[config[_0xb6b1('0x11')]['ip'],config[_0xb6b1('0x11')][_0xb6b1('0x12')],_0xb6b1('0x13')]['join']('\x20')));}_0x12f3ff=_['pick'](_0x12f3ff,_['keys'](properties['module']));_0x12f3ff[_0xb6b1('0x14')]=_0xb6b1('0x15');return ami[_0xb6b1('0x16')](_0x12f3ff)[_0xb6b1('0x17')](function(_0x32e395){_0x23881d({'code':0xc8,'message':_0x32e395[_0xb6b1('0x18')]});})['catch'](function(_0x581e28){_0x18f6b5(_0x327eee[_0xb6b1('0x10')](0x1f5,_0x581e28[_0xb6b1('0x18')]));});});},'Command':function(_0x16d969){var _0x11e8ae=this;return new Promise(function(_0x45d9e6,_0x3fc9b1){if(ami['isConnected']()==![]){return _0x3fc9b1(_0x11e8ae['error'](0x1f4,[config[_0xb6b1('0x11')]['ip'],config[_0xb6b1('0x11')]['username'],'ami\x20disconnected'][_0xb6b1('0x19')]('\x20')));}_0x16d969=_['pick'](_0x16d969,'command');_0x16d969[_0xb6b1('0x14')]=_0xb6b1('0x1a');return ami[_0xb6b1('0x16')](_0x16d969)[_0xb6b1('0x17')](function(_0x164952){_0x45d9e6({'code':0xc8,'message':_0x164952[_0xb6b1('0x1b')]});})[_0xb6b1('0x1c')](function(_0x3b1ff7){_0x3fc9b1(_0x11e8ae[_0xb6b1('0x10')](0x1f5,_0x3b1ff7[_0xb6b1('0x18')]));});});},'VoiceQueues':function(_0x5069cd){return new Promise(function(_0x214cd0,_0x4f1e2e){var _0xd8e094=[];for(var _0x5864d6 in _0x345886[_0xb6b1('0x1d')]){if(_0x345886['voiceQueues'][_0xb6b1('0x1e')](_0x5864d6)){var _0x387603=_0x345886[_0xb6b1('0x1d')][_0x5864d6];var _0x178401={'id':_0x387603['id'],'name':_0x387603[_0xb6b1('0x1f')],'strategy':_0x387603[_0xb6b1('0x20')],'answered':_0x387603[_0xb6b1('0x21')],'available':_0x387603[_0xb6b1('0x22')],'loggedIn':_0x387603[_0xb6b1('0x23')],'pTalking':_0x387603['pTalking'],'sumBillable':_0x387603[_0xb6b1('0x24')],'sumDuration':_0x387603['sumDuration'],'sumHoldTime':_0x387603[_0xb6b1('0x25')]||0x0,'talking':_0x387603[_0xb6b1('0x26')],'total':_0x387603[_0xb6b1('0x27')],'type':_0x387603[_0xb6b1('0x28')],'unmanaged':_0x387603[_0xb6b1('0x29')],'abandoned':_0x387603[_0xb6b1('0x2a')],'waiting':_0x387603[_0xb6b1('0x2b')],'loggedInDb':_0x387603['loggedInDb']};if(_0x387603[_0xb6b1('0x28')]===_0xb6b1('0x2c')){_0x178401[_0xb6b1('0x2d')]=_0x387603['dialActive'];_0x178401[_0xb6b1('0x2e')]=_0x387603[_0xb6b1('0x2e')];_0x178401['dialOriginateCallerIdName']=_0x387603[_0xb6b1('0x2f')];_0x178401[_0xb6b1('0x30')]=_0x387603[_0xb6b1('0x30')];_0x178401[_0xb6b1('0x31')]=_0x387603[_0xb6b1('0x31')];_0x178401[_0xb6b1('0x32')]=_0x387603['dialPrefix'];_0x178401[_0xb6b1('0x33')]=_0x387603[_0xb6b1('0x33')];_0x178401['outboundAnswerAgiCallsDay']=_0x387603[_0xb6b1('0x34')];_0x178401['outboundAnswerCallsDay']=_0x387603[_0xb6b1('0x35')];_0x178401[_0xb6b1('0x36')]=_0x387603[_0xb6b1('0x36')];_0x178401[_0xb6b1('0x37')]=_0x387603[_0xb6b1('0x37')];_0x178401[_0xb6b1('0x38')]=_0x387603['outboundCongestionCallsDay'];_0x178401[_0xb6b1('0x39')]=_0x387603[_0xb6b1('0x39')];_0x178401[_0xb6b1('0x3a')]=_0x387603[_0xb6b1('0x3a')];_0x178401['outboundDropCallsDayTimeout']=_0x387603['outboundDropCallsDayTimeout'];_0x178401['outboundNoAnswerCallsDay']=_0x387603[_0xb6b1('0x3b')];_0x178401[_0xb6b1('0x3c')]=_0x387603[_0xb6b1('0x3c')];_0x178401[_0xb6b1('0x3d')]=_0x387603[_0xb6b1('0x3d')];_0x178401[_0xb6b1('0x3e')]=_0x387603[_0xb6b1('0x3e')];_0x178401[_0xb6b1('0x3f')]=_0x387603[_0xb6b1('0x3f')];_0x178401[_0xb6b1('0x40')]=_0x387603[_0xb6b1('0x40')];_0x178401[_0xb6b1('0x41')]=_0x387603['predictiveIntervalAnsweredCalls'];_0x178401[_0xb6b1('0x42')]=_0x387603[_0xb6b1('0x42')];_0x178401[_0xb6b1('0x43')]=_0x387603[_0xb6b1('0x43')];_0x178401[_0xb6b1('0x44')]=_0x387603[_0xb6b1('0x44')];_0x178401[_0xb6b1('0x45')]=_0x387603[_0xb6b1('0x45')];_0x178401[_0xb6b1('0x46')]=_0x387603[_0xb6b1('0x46')];_0x178401[_0xb6b1('0x47')]=_0x387603['predictiveIntervalErlangCallsDroppedCalls'];_0x178401[_0xb6b1('0x48')]=_0x387603[_0xb6b1('0x48')];_0x178401[_0xb6b1('0x49')]=_0x387603[_0xb6b1('0x49')];_0x178401[_0xb6b1('0x4a')]=_0x387603[_0xb6b1('0x4a')];_0x178401[_0xb6b1('0x4b')]=_0x387603[_0xb6b1('0x4b')];_0x178401['predictiveIntervalTotalCalls']=_0x387603['predictiveIntervalTotalCalls'];_0x178401[_0xb6b1('0x18')]=_0x387603[_0xb6b1('0x18')];_0x178401[_0xb6b1('0x4c')]=_0x387603['originated'];_0x178401[_0xb6b1('0x4d')]=_0x387603[_0xb6b1('0x4d')];_0x178401[_0xb6b1('0x4e')]=_0x387603[_0xb6b1('0x4e')];_0x178401[_0xb6b1('0x4f')]=_0x387603[_0xb6b1('0x4f')];_0x178401[_0xb6b1('0x50')]=_0x387603[_0xb6b1('0x50')];_0x178401['startPredictive']=_0x387603[_0xb6b1('0x51')];_0x178401['startProgressive']=_0x387603[_0xb6b1('0x52')];}if(_0x387603[_0xb6b1('0x53')]){_0x178401[_0xb6b1('0x53')]={'id':_0x387603[_0xb6b1('0x53')]['id'],'name':_0x387603[_0xb6b1('0x53')][_0xb6b1('0x1f')],'active':_0x387603['Trunk'][_0xb6b1('0x54')],'callerid':_0x387603[_0xb6b1('0x53')]['callerid']};}if(_0x387603[_0xb6b1('0x55')]){_0x178401['Interval']={'id':_0x387603[_0xb6b1('0x55')]['id'],'name':_0x387603[_0xb6b1('0x55')][_0xb6b1('0x1f')]};}_0xd8e094[_0xb6b1('0x56')](_0x178401);}}_0x214cd0({'count':_0xd8e094[_0xb6b1('0x57')],'rows':_0xd8e094});});},'UpdateVoiceQueue':function(_0x20489a){return new Promise(function(_0x19cc0f,_0x31a6c7){var _0x1d5b09=_['find'](_0x345886['voiceQueues'],{'id':parseInt(_0x20489a['id'])});var _0x3826bd=_[_0xb6b1('0x58')](_0x20489a,['id']);if(_0x1d5b09){for(var _0x5959ca in _0x3826bd){if(typeof _0x3826bd[_0x5959ca]!==_0xb6b1('0x59')&&typeof _0x1d5b09[_0x5959ca]!==_0xb6b1('0x59')){_0x1d5b09[_0x5959ca]=_0x3826bd[_0x5959ca];}}_0x19cc0f(_0x1d5b09);}else{_0x31a6c7();}});},'VoiceChannels':function(_0x6f7b41){return new Promise(function(_0x1a95cf,_0x7cebdc){var _0x505a80=_[_0xb6b1('0x5a')](_0x345886[_0xb6b1('0x5b')]);_0x1a95cf({'count':_0x505a80[_0xb6b1('0x57')],'rows':_0x505a80});});},'VoiceChannelMixMonitor':function(_0x3f02bc){var _0x4da826=this;return new Promise(function(_0x5bfd0e,_0x20e93b){if(ami['isConnected']()==![]){return _0x20e93b(_0x4da826[_0xb6b1('0x10')](0x1f4,[config[_0xb6b1('0x11')]['ip'],config['asterisk'][_0xb6b1('0x12')],'ami\x20disconnected'][_0xb6b1('0x19')]('\x20')));}var _0x7d4763=schema(properties[_0xb6b1('0x5c')])[_0xb6b1('0x2')](_0x3f02bc);if(_0x7d4763[_0xb6b1('0x57')]>0x0){return _0x20e93b(_0x4da826[_0xb6b1('0x10')](0x1f4,_[_0xb6b1('0x5d')](_0x7d4763,_0xb6b1('0x18'))[_0xb6b1('0x19')](',\x20')));}var _0x2700ed=_['find'](_0x345886[_0xb6b1('0x5b')],{'uniqueid':_0x3f02bc[_0xb6b1('0x5e')]});if(_0x2700ed&&_0x2700ed[_0xb6b1('0x5f')]){var _0x39c0d9=util[_0xb6b1('0x8')](_0xb6b1('0x60'),_0x3f02bc[_0xb6b1('0x61')]||_0x3f02bc[_0xb6b1('0x5e')],_0x3f02bc[_0xb6b1('0x8')]||'wav');return ami[_0xb6b1('0x16')]({'action':'MixMonitor','channel':_0x2700ed['channel'],'file':_0x39c0d9,'options':_0xb6b1('0x62')})[_0xb6b1('0x17')](function(_0x5be7bf){var _0x3b482b=_[_0xb6b1('0x63')](_0x2700ed[_0xb6b1('0x64')],{'filename':'/var/spool/asterisk/monitor/'+_0x39c0d9[_0xb6b1('0x65')]()});if(_['isNil'](_0x3b482b)){_0x2700ed['monitors'][_0xb6b1('0x56')]({'filename':_0xb6b1('0x66')+_0x39c0d9['toLowerCase'](),'createdAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x5be7bf[_0xb6b1('0x67')],'status':'rec'});}else{_0x3b482b['mixmonitorid']=_0x5be7bf['mixmonitorid'];_0x3b482b[_0xb6b1('0x68')]=_0xb6b1('0x69');}_0x5bfd0e({'code':0xc8,'message':[_0x3f02bc[_0xb6b1('0x5e')],_0xb6b1('0x6a'),_0x5be7bf[_0xb6b1('0x67')]][_0xb6b1('0x19')]('\x20'),'mixmonitorid':_0x5be7bf['mixmonitorid']});})[_0xb6b1('0x1c')](function(_0x322e35){_0x20e93b(_0x4da826['error'](0x1f5,[_0x3f02bc['uniqueid'],_0x322e35[_0xb6b1('0x18')][_0xb6b1('0x65')]()]['join']('\x20')));});}else{return _0x20e93b(_0x4da826['error'](0x1f5,_0xb6b1('0x6b')));}});},'VoiceChannelStopMixMonitor':function(_0x484afc){var _0x463482=this;return new Promise(function(_0x1ce8a2,_0x4a07ed){if(ami[_0xb6b1('0xf')]()==![]){return _0x4a07ed(_0x463482[_0xb6b1('0x10')](0x1f4,[config[_0xb6b1('0x11')]['ip'],config[_0xb6b1('0x11')][_0xb6b1('0x12')],_0xb6b1('0x13')][_0xb6b1('0x19')]('\x20')));}var _0x35aae0=schema(properties[_0xb6b1('0x5c')])[_0xb6b1('0x2')](_0x484afc);if(_0x35aae0['length']>0x0){return _0x4a07ed(_0x463482[_0xb6b1('0x10')](0x1f4,_[_0xb6b1('0x5d')](_0x35aae0,_0xb6b1('0x18'))[_0xb6b1('0x19')](',\x20')));}var _0x4a7796=_[_0xb6b1('0x63')](_0x345886[_0xb6b1('0x5b')],{'uniqueid':_0x484afc[_0xb6b1('0x5e')]});if(_0x4a7796){return BPromise[_0xb6b1('0x6c')]()[_0xb6b1('0x17')](function(){if(_0x4a7796[_0xb6b1('0x5f')]){return ami[_0xb6b1('0x16')]({'action':'StopMixMonitor','channel':_0x4a7796['channel'],'mixmonitorid':_0x484afc[_0xb6b1('0x67')]})['catch'](function(_0x2e91fa){});}})[_0xb6b1('0x17')](function(){if(_0x4a7796[_0xb6b1('0x6d')]){return ami['Action']({'action':_0xb6b1('0x6e'),'channel':_0x4a7796[_0xb6b1('0x6d')],'mixmonitorid':_0x484afc[_0xb6b1('0x67')]})[_0xb6b1('0x1c')](function(_0x463112){});}})['then'](function(_0x4ddcf3){var _0x11e94e=_[_0xb6b1('0x63')](_0x4a7796[_0xb6b1('0x64')],{'mixmonitorid':_0x484afc[_0xb6b1('0x67')]});if(_0x11e94e){_0x11e94e[_0xb6b1('0x68')]=_0xb6b1('0x6f');}})[_0xb6b1('0x17')](function(){var _0x3d6edf=util[_0xb6b1('0x8')](_0xb6b1('0x60'),_0x484afc[_0xb6b1('0x61')]||_0x484afc[_0xb6b1('0x5e')],_0x484afc['format']||_0xb6b1('0x70'));var _0x49ace7=_[_0xb6b1('0x63')](_0x4a7796[_0xb6b1('0x64')],{'filename':_0xb6b1('0x66')+_0x3d6edf['toLowerCase']()});if(_0x49ace7){_0x49ace7[_0xb6b1('0x68')]='stop';}})['then'](function(){_0x1ce8a2({'code':0xc8,'message':[_0x484afc[_0xb6b1('0x5e')],'StopMixMonitor\x20Success'][_0xb6b1('0x19')]('\x20')});})[_0xb6b1('0x1c')](function(_0x509667){_0x4a07ed(_0x463482[_0xb6b1('0x10')](0x1f5,[_0x484afc['uniqueid'],_0x509667[_0xb6b1('0x18')][_0xb6b1('0x65')]()][_0xb6b1('0x19')]('\x20')));});}else{return _0x4a07ed(_0x463482['error'](0x1f5,_0xb6b1('0x6b')));}});},'VoiceQueuesChannels':function(_0x4ef26a){return new Promise(function(_0x20f2f2,_0x469f7f){var _0x3e1695=_[_0xb6b1('0x5a')](_0x345886['queueChannels']);_0x20f2f2({'count':_0x3e1695[_0xb6b1('0x57')],'rows':_0x3e1695});});},'VoiceQueuesChannel':function(_0x410fe6){var _0x3e663d=this;return new Promise(function(_0xb611fa,_0x381793){var _0x2aa294=schema(properties['voicequeuechannel'])[_0xb6b1('0x2')](_0x410fe6);if(_0x2aa294[_0xb6b1('0x57')]>0x0){return _0x381793(_0x3e663d[_0xb6b1('0x10')](0x1f4,_[_0xb6b1('0x5d')](_0x2aa294,'message')[_0xb6b1('0x19')](',\x20')));}var _0x1c4bde=_['find'](_0x345886['queueChannels'],{'uniqueid':_0x410fe6['uniqueid']});if(_0x1c4bde){_0xb611fa(_0x1c4bde);}else{return _0x381793(_0x3e663d['error'](0x1f5,_0xb6b1('0x6b')));}});},'VoiceQueuesChannelHangup':function(_0x439b23){var _0x17ce08=this;return new Promise(function(_0xc203ce,_0x1d039a){if(ami[_0xb6b1('0xf')]()==![]){return _0x1d039a(_0x17ce08[_0xb6b1('0x10')](0x1f4,[config['asterisk']['ip'],config[_0xb6b1('0x11')]['username'],'ami\x20disconnected'][_0xb6b1('0x19')]('\x20')));}var _0x28213e=schema(properties['voicequeuechannelhangup'])[_0xb6b1('0x2')](_0x439b23);if(_0x28213e[_0xb6b1('0x57')]>0x0){return _0x1d039a(_0x17ce08[_0xb6b1('0x10')](0x1f4,_[_0xb6b1('0x5d')](_0x28213e,_0xb6b1('0x18'))['join'](',\x20')));}var _0x3d96c6=_[_0xb6b1('0x63')](_0x345886['queueChannels'],{'uniqueid':_0x439b23['uniqueid']});if(_0x3d96c6&&_0x3d96c6[_0xb6b1('0x5f')]){return ami[_0xb6b1('0x16')]({'action':_0xb6b1('0x71'),'channel':_0x3d96c6[_0xb6b1('0x5f')]})[_0xb6b1('0x17')](function(_0x28860e){_0xc203ce({'code':0xc8,'message':[_0x439b23[_0xb6b1('0x5e')],_0x28860e[_0xb6b1('0x18')][_0xb6b1('0x65')]()]['join']('\x20')});})[_0xb6b1('0x1c')](function(_0x57fd39){_0x1d039a(_0x17ce08[_0xb6b1('0x10')](0x1f5,[_0x439b23[_0xb6b1('0x5e')],_0x57fd39[_0xb6b1('0x18')]['toLowerCase']()][_0xb6b1('0x19')]('\x20')));});}else{return _0x1d039a(_0x17ce08[_0xb6b1('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x37c3e6){var _0x588390=this;return new Promise(function(_0x4c79dc,_0x955b9b){if(ami['isConnected']()==![]){return _0x955b9b(_0x588390[_0xb6b1('0x10')](0x1f4,[config['asterisk']['ip'],config[_0xb6b1('0x11')][_0xb6b1('0x12')],_0xb6b1('0x13')][_0xb6b1('0x19')]('\x20')));}var _0x3765ca=schema(properties['voicequeuechannelredirect'])[_0xb6b1('0x2')](_0x37c3e6);if(_0x3765ca[_0xb6b1('0x57')]>0x0){return _0x955b9b(_0x588390[_0xb6b1('0x10')](0x1f4,_[_0xb6b1('0x5d')](_0x3765ca,_0xb6b1('0x18'))[_0xb6b1('0x19')](',\x20')));}var _0x19415a=_[_0xb6b1('0x63')](_0x345886[_0xb6b1('0x72')],{'uniqueid':_0x37c3e6[_0xb6b1('0x5e')]});if(_0x19415a&&_0x19415a[_0xb6b1('0x5f')]){return ami[_0xb6b1('0x16')]({'action':'Redirect','channel':_0x19415a[_0xb6b1('0x5f')],'exten':_0x37c3e6[_0xb6b1('0x73')],'context':_0x37c3e6['context']||_0x19415a[_0xb6b1('0x74')],'priority':0x1})[_0xb6b1('0x17')](function(_0x5b02b7){_0x4c79dc({'code':0xc8,'message':[_0x37c3e6[_0xb6b1('0x5e')],_0x5b02b7['message'][_0xb6b1('0x65')]()]['join']('\x20')});})[_0xb6b1('0x1c')](function(_0x5e1d5c){_0x955b9b(_0x588390['error'](0x1f5,[_0x37c3e6[_0xb6b1('0x5e')],_0x5e1d5c[_0xb6b1('0x18')]['toLowerCase']()][_0xb6b1('0x19')]('\x20')));});}else{return _0x955b9b(_0x588390[_0xb6b1('0x10')](0x1f5,_0xb6b1('0x6b')));}});},'Agents':function(_0xac8b8a){return new Promise(function(_0x292dbe,_0x6b6d3){var _0x3e7949=_[_0xb6b1('0x5a')](_0x345886[_0xb6b1('0xc')]);_0x292dbe({'count':_0x3e7949[_0xb6b1('0x57')],'rows':_0x3e7949});});},'Telephones':function(_0x28231c){return new Promise(function(_0x18a71f,_0x521366){var _0x1d1e49=_[_0xb6b1('0x5a')](_0x345886[_0xb6b1('0x75')]);_0x18a71f({'count':_0x1d1e49[_0xb6b1('0x57')],'rows':_0x1d1e49});});},'Trunks':function(_0x489898){return new Promise(function(_0x1ee829,_0x2be41a){var _0x15818e=_[_0xb6b1('0x5a')](_0x345886[_0xb6b1('0x76')]);_0x1ee829({'count':_0x15818e[_0xb6b1('0x57')],'rows':_0x15818e});});},'OutboundChannels':function(_0x4872c7){return new Promise(function(_0x3954dd,_0x2c0509){var _0xe96200=_[_0xb6b1('0x5a')](_0x345886[_0xb6b1('0x77')]);_0x3954dd({'count':_0xe96200[_0xb6b1('0x57')],'rows':_0xe96200});});},'Outbound':function(_0x137c52){return new Promise(function(_0x433ce8,_0x400819){_0x433ce8(_0x345886[_0xb6b1('0x2c')]);});},'Campaigns':function(_0x3b9eb2){return new Promise(function(_0x54fa89,_0x5d3d77){var _0x2046e5=_[_0xb6b1('0x5a')](_0x345886[_0xb6b1('0x78')]);_0x54fa89({'count':_0x2046e5[_0xb6b1('0x57')],'rows':_0x2046e5});});},'VoiceQueuesPreview':function(_0x36d30b){var _0x32b89e=this;return new Promise(function(_0x43d32a,_0x3fbff1){_0x41bf3e['run'](_0x36d30b['id'])[_0xb6b1('0x17')](function(_0x1fa035){_0x43d32a({'code':0xc8,'message':_0x1fa035[_0xb6b1('0x18')]});})['catch'](function(_0x8f27ea){_0x3fbff1(_0x32b89e['error'](0x1f4,_0x8f27ea['message']));});});},'EventManager':function(_0x13f438){var _0x320c96=this;return new Promise(function(_0xa7b8d2,_0xf5dbf9){if(!_0x13f438[_0xb6b1('0x79')]){return _0xf5dbf9(_0x320c96[_0xb6b1('0x10')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0xb6b1('0x7a')](_0xb6b1('0x7b')+_0x13f438[_0xb6b1('0x79')],_0x13f438[_0xb6b1('0x18')]);_0xa7b8d2({'code':0xc8,'message':_0x13f438});});},'FaxAccounts':function(_0x5712df){return new Promise(function(_0x4ea394,_0xdeaa28){var _0x5c8321=_[_0xb6b1('0x5a')](_0x345886['faxAccounts']);_0x4ea394({'count':_0x5c8321[_0xb6b1('0x57')],'rows':_0x5c8321});});},'SendFax':function(_0x516f87){var _0x58b209=this;return new Promise(function(_0x384595,_0x349feb){_0x113a39[_0xb6b1('0x7c')](_0x516f87)[_0xb6b1('0x17')](function(_0x3929e1){_0x384595({'code':0xc8,'message':_0x3929e1['message']});})[_0xb6b1('0x1c')](function(_0x170d5c){_0x349feb(_0x58b209[_0xb6b1('0x10')](0x1f4,_0x170d5c[_0xb6b1('0x18')]));});});},'CheckAfterSend':function(_0x523037){var _0xb668af=this;return new Promise(function(_0x5248c7,_0x3158cd){_0x113a39['checkAfterSend'](_0x523037)[_0xb6b1('0x17')](function(_0x554155){_0x5248c7({'code':0xc8,'message':_0x554155['message']});})['catch'](function(_0x4908ab){_0x3158cd(_0xb668af[_0xb6b1('0x10')](0x1f4,_0x4908ab['message']));});});}};var _0x25dbd6=jayson[_0xb6b1('0x7d')](_0x1a4cd0)[_0xb6b1('0x7e')]();_0x25dbd6['on'](_0xb6b1('0x10'),function(_0x5d1c1d){return _0x13334e(_0x5d1c1d);});_0x25dbd6[_0xb6b1('0x7')](0x232a,_0xb6b1('0x7f'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x1ff716('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 ece283d..60e34ad 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 _0x7530=['ioredis','util','../../../../config/environment','../../../../config/logger','../../rpc/cmContact','defaults','localhost','socket.io-emitter','redis','[CM][%s][%s]','emit','exec','data1','data2','xmd-contactid','ListId','data3','split','phone','$or','map','routeId','destcalleridnum','firstName','mobile','fax','createdAt','scheduledAt','updatedAt','union','resolve','getContacts','then','isEmpty','length','info','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','calleridnum','calleridname','','destcalleridname','Unknown','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','action','toLowerCase','lodash','bluebird'];(function(_0x295894,_0x12c140){var _0xe8e75a=function(_0x1387bd){while(--_0x1387bd){_0x295894['push'](_0x295894['shift']());}};_0xe8e75a(++_0x12c140);}(_0x7530,0x125));var _0x0753=function(_0x3b8774,_0x301a46){_0x3b8774=_0x3b8774-0x0;var _0x5bcfcc=_0x7530[_0x3b8774];return _0x5bcfcc;};'use strict';var _=require(_0x0753('0x0'));var BPromise=require(_0x0753('0x1'));var Redis=require(_0x0753('0x2'));var util=require(_0x0753('0x3'));var config=require(_0x0753('0x4'));var logger=require(_0x0753('0x5'))('trigger');var cmContactRpc=require(_0x0753('0x6'));config['redis']=_[_0x0753('0x7')](config['redis'],{'host':_0x0753('0x8'),'port':0x18eb});var io=require(_0x0753('0x9'))(new Redis(config[_0x0753('0xa')]));function emit(_0x1937b4,_0x1794dd,_0x1ede2a,_0x180f00,_0x423b5a){logger['info'](_0x0753('0xb'),_0x1937b4,_0x1794dd['id'],_0x1ede2a,_0x180f00,JSON['stringify'](_0x423b5a));io['to'](_0x1ede2a)[_0x0753('0xc')](_0x180f00,_0x423b5a);}exports[_0x0753('0xd')]=function(_0x3d3dce,_0x948dc1,_0x5b129f,_0x19c5b7){var _0x3ddb5d,_0x44c38d;var _0xc401fa={};var _0x560592=Number(_0x5b129f[_0x0753('0xe')]);var _0x1030af=_0x5b129f[_0x0753('0xf')]?Boolean(Number(_0x5b129f[_0x0753('0xf')])):![];var _0xc14310;if(_0x19c5b7[_0x0753('0x10')]){_0xc401fa['id']=_0x19c5b7[_0x0753('0x10')];}if(!_0xc401fa['id']){_0xc401fa[_0x0753('0x11')]=_0x560592;_0xc14310=_0x5b129f['data3']&&_0x5b129f[_0x0753('0x12')]!=='0'?_0x5b129f[_0x0753('0x12')][_0x0753('0x13')](','):[_0x0753('0x14')];_0xc401fa[_0x0753('0x15')]=_[_0x0753('0x16')](_0xc14310,function(_0x352ae0){var _0x433059={};_0x433059[_0x352ae0]=_0x19c5b7[_0x0753('0x17')]?_0x19c5b7[_0x0753('0x18')]:_0x19c5b7['calleridnum'];return _0x433059;});}var _0xedfa91=['id',_0x0753('0x19'),'lastName',_0x0753('0x14'),_0x0753('0x1a'),_0x0753('0x1b'),_0x0753('0x11'),_0x0753('0x1c'),_0x0753('0x1d'),_0x0753('0x1e')];var _0xc169b0=_[_0x0753('0x1f')](_0xedfa91,_0xc14310);BPromise[_0x0753('0x20')]()['then'](cmContactRpc[_0x0753('0x21')]({'attributes':_0xc169b0,'where':_0xc401fa}))[_0x0753('0x22')](function(_0x3ced99){_0x44c38d=_0x3ced99;if(!_[_0x0753('0x23')](_0x44c38d)){if(_0x44c38d[_0x0753('0x24')]===0x1){_0x3ddb5d=_0x44c38d[0x0];logger[_0x0753('0x25')](_0x0753('0x26'),_0x19c5b7[_0x0753('0x27')],_0x948dc1['id'],_0x3ddb5d['id']);}else{logger[_0x0753('0x25')](_0x0753('0x28'),_0x19c5b7[_0x0753('0x27')],_0x948dc1['id'],_[_0x0753('0x16')](_0x44c38d,'id')[_0x0753('0x29')](','));}return;}else{logger['info']('[CM][%s][%s]\x20Contact\x20not\x20found',_0x19c5b7[_0x0753('0x27')],_0x948dc1['id']);var _0x191697={'ListId':_0x560592};var _0x57832a=_0x5b129f[_0x0753('0x2a')]&&_0x5b129f[_0x0753('0x2a')]!=='0'?_0x5b129f[_0x0753('0x2a')]:'phone';if(_0x1030af){logger[_0x0753('0x25')](_0x0753('0x2b'),_0x19c5b7[_0x0753('0x27')],_0x948dc1['id']);_0x191697[_0x57832a]=_[_0x0753('0x2c')](_0x19c5b7[_0x0753('0x17')])?_0x19c5b7[_0x0753('0x2d')]:_0x19c5b7[_0x0753('0x18')];if(_[_0x0753('0x2c')](_0x19c5b7['routeId'])){_0x191697[_0x0753('0x19')]=_0x19c5b7[_0x0753('0x2e')]&&_0x19c5b7[_0x0753('0x2e')]!==_0x0753('0x2f')?_0x19c5b7[_0x0753('0x2e')]:'Unknown';}else{_0x191697[_0x0753('0x19')]=_0x19c5b7[_0x0753('0x30')]&&_0x19c5b7[_0x0753('0x30')]!==_0x0753('0x2f')?_0x19c5b7[_0x0753('0x30')]:_0x0753('0x31');}return BPromise[_0x0753('0x20')]()['then'](cmContactRpc[_0x0753('0x32')](_0x191697))[_0x0753('0x22')](function(_0x14f1a9){_0x3ddb5d=_0x14f1a9;_0x44c38d[_0x0753('0x33')](_0x14f1a9);if(_0x3ddb5d){logger[_0x0753('0x25')](_0x0753('0x34'),_0x19c5b7[_0x0753('0x27')],_0x948dc1['id'],_0x3ddb5d['id']);}return;});}else{logger[_0x0753('0x25')](_0x0753('0x35'),_0x19c5b7[_0x0753('0x27')],_0x948dc1['id']);_0x191697[_0x57832a]=_[_0x0753('0x2c')](_0x19c5b7[_0x0753('0x17')])?_0x19c5b7[_0x0753('0x2d')]:_0x19c5b7[_0x0753('0x18')];if(_[_0x0753('0x2c')](_0x19c5b7[_0x0753('0x17')])){_0x191697['firstName']=_0x19c5b7[_0x0753('0x2e')]&&_0x19c5b7['calleridname']!==_0x0753('0x2f')?_0x19c5b7[_0x0753('0x2e')]:_0x0753('0x31');}else{_0x191697[_0x0753('0x19')]=_0x19c5b7[_0x0753('0x30')]&&_0x19c5b7[_0x0753('0x30')]!==_0x0753('0x2f')?_0x19c5b7[_0x0753('0x30')]:_0x0753('0x31');}_0x3ddb5d=_0x191697;_0x44c38d['push'](_0x191697);return;}}})[_0x0753('0x22')](function(){if(_0x3d3dce){emit(_0x19c5b7[_0x0753('0x27')],_0x948dc1,util[_0x0753('0x36')](_0x0753('0x37'),_0x3d3dce[_0x0753('0x38')]),util[_0x0753('0x36')]('trigger:%s',_0x5b129f[_0x0753('0x39')][_0x0753('0x3a')]()),{'evt':_['merge'](_0x19c5b7,{'autoCreate':_0x1030af}),'contact':_0x3ddb5d===undefined?{}:_0x3ddb5d,'contacts':_0x44c38d[_0x0753('0x24')]===0x0?undefined:_0x44c38d});}});}; \ No newline at end of file +var _0x2849=['firstName','lastName','mobile','fax','createdAt','scheduledAt','union','resolve','then','isEmpty','length','info','[CM][%s][%s]\x20Contact\x20found:%s','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','uniqueid','join','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','destcalleridnum','calleridname','','Unknown','destcalleridname','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','trigger:%s','toLowerCase','merge','ioredis','util','../../../../config/logger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','[CM][%s][%s]','stringify','data1','data2','xmd-contactid','ListId','data3','phone','$or','map','routeId','calleridnum'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2849,0xc0));var _0x9284=function(_0x394b57,_0x51a186){_0x394b57=_0x394b57-0x0;var _0x5ebf68=_0x2849[_0x394b57];return _0x5ebf68;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var Redis=require(_0x9284('0x0'));var util=require(_0x9284('0x1'));var config=require('../../../../config/environment');var logger=require(_0x9284('0x2'))('trigger');var cmContactRpc=require(_0x9284('0x3'));config[_0x9284('0x4')]=_[_0x9284('0x5')](config['redis'],{'host':_0x9284('0x6'),'port':0x18eb});var io=require(_0x9284('0x7'))(new Redis(config[_0x9284('0x4')]));function emit(_0x2adc68,_0x4750b8,_0x5a1a39,_0x49374e,_0x31983a){logger['info'](_0x9284('0x8'),_0x2adc68,_0x4750b8['id'],_0x5a1a39,_0x49374e,JSON[_0x9284('0x9')](_0x31983a));io['to'](_0x5a1a39)['emit'](_0x49374e,_0x31983a);}exports['exec']=function(_0x2e79b5,_0x22ac16,_0xa12ed1,_0x45d8ac){var _0x309207,_0x5e0c1a;var _0x31ca18={};var _0x273c89=Number(_0xa12ed1[_0x9284('0xa')]);var _0xb96203=_0xa12ed1[_0x9284('0xb')]?Boolean(Number(_0xa12ed1[_0x9284('0xb')])):![];var _0x2de8a1;if(_0x45d8ac[_0x9284('0xc')]){_0x31ca18['id']=_0x45d8ac[_0x9284('0xc')];}if(!_0x31ca18['id']){_0x31ca18[_0x9284('0xd')]=_0x273c89;_0x2de8a1=_0xa12ed1[_0x9284('0xe')]&&_0xa12ed1['data3']!=='0'?_0xa12ed1[_0x9284('0xe')]['split'](','):[_0x9284('0xf')];_0x31ca18[_0x9284('0x10')]=_[_0x9284('0x11')](_0x2de8a1,function(_0x2cc434){var _0x14ddf1={};_0x14ddf1[_0x2cc434]=_0x45d8ac[_0x9284('0x12')]?_0x45d8ac['destcalleridnum']:_0x45d8ac[_0x9284('0x13')];return _0x14ddf1;});}var _0x553bf4=['id',_0x9284('0x14'),_0x9284('0x15'),_0x9284('0xf'),_0x9284('0x16'),_0x9284('0x17'),'ListId',_0x9284('0x18'),_0x9284('0x19'),'updatedAt'];var _0x476a9f=_[_0x9284('0x1a')](_0x553bf4,_0x2de8a1);BPromise[_0x9284('0x1b')]()['then'](cmContactRpc['getContacts']({'attributes':_0x476a9f,'where':_0x31ca18}))[_0x9284('0x1c')](function(_0x303f5f){_0x5e0c1a=_0x303f5f;if(!_[_0x9284('0x1d')](_0x5e0c1a)){if(_0x5e0c1a[_0x9284('0x1e')]===0x1){_0x309207=_0x5e0c1a[0x0];logger[_0x9284('0x1f')](_0x9284('0x20'),_0x45d8ac['uniqueid'],_0x22ac16['id'],_0x309207['id']);}else{logger['info'](_0x9284('0x21'),_0x45d8ac[_0x9284('0x22')],_0x22ac16['id'],_[_0x9284('0x11')](_0x5e0c1a,'id')[_0x9284('0x23')](','));}return;}else{logger[_0x9284('0x1f')]('[CM][%s][%s]\x20Contact\x20not\x20found',_0x45d8ac['uniqueid'],_0x22ac16['id']);var _0x3721c2={'ListId':_0x273c89};var _0x34b404=_0xa12ed1[_0x9284('0x24')]&&_0xa12ed1[_0x9284('0x24')]!=='0'?_0xa12ed1[_0x9284('0x24')]:'phone';if(_0xb96203){logger[_0x9284('0x1f')](_0x9284('0x25'),_0x45d8ac[_0x9284('0x22')],_0x22ac16['id']);_0x3721c2[_0x34b404]=_[_0x9284('0x26')](_0x45d8ac['routeId'])?_0x45d8ac[_0x9284('0x13')]:_0x45d8ac[_0x9284('0x27')];if(_[_0x9284('0x26')](_0x45d8ac['routeId'])){_0x3721c2[_0x9284('0x14')]=_0x45d8ac[_0x9284('0x28')]&&_0x45d8ac[_0x9284('0x28')]!==_0x9284('0x29')?_0x45d8ac[_0x9284('0x28')]:_0x9284('0x2a');}else{_0x3721c2[_0x9284('0x14')]=_0x45d8ac[_0x9284('0x2b')]&&_0x45d8ac[_0x9284('0x2b')]!==_0x9284('0x29')?_0x45d8ac[_0x9284('0x2b')]:_0x9284('0x2a');}return BPromise[_0x9284('0x1b')]()[_0x9284('0x1c')](cmContactRpc['createContact'](_0x3721c2))['then'](function(_0x5675c5){_0x309207=_0x5675c5;_0x5e0c1a[_0x9284('0x2c')](_0x5675c5);if(_0x309207){logger['info'](_0x9284('0x2d'),_0x45d8ac[_0x9284('0x22')],_0x22ac16['id'],_0x309207['id']);}return;});}else{logger[_0x9284('0x1f')](_0x9284('0x2e'),_0x45d8ac['uniqueid'],_0x22ac16['id']);_0x3721c2[_0x34b404]=_[_0x9284('0x26')](_0x45d8ac[_0x9284('0x12')])?_0x45d8ac[_0x9284('0x13')]:_0x45d8ac[_0x9284('0x27')];if(_[_0x9284('0x26')](_0x45d8ac[_0x9284('0x12')])){_0x3721c2[_0x9284('0x14')]=_0x45d8ac[_0x9284('0x28')]&&_0x45d8ac['calleridname']!==_0x9284('0x29')?_0x45d8ac[_0x9284('0x28')]:'Unknown';}else{_0x3721c2[_0x9284('0x14')]=_0x45d8ac[_0x9284('0x2b')]&&_0x45d8ac['destcalleridname']!==_0x9284('0x29')?_0x45d8ac[_0x9284('0x2b')]:_0x9284('0x2a');}_0x309207=_0x3721c2;_0x5e0c1a[_0x9284('0x2c')](_0x3721c2);return;}}})[_0x9284('0x1c')](function(){if(_0x2e79b5){emit(_0x45d8ac[_0x9284('0x22')],_0x22ac16,util[_0x9284('0x2f')](_0x9284('0x30'),_0x2e79b5[_0x9284('0x31')]),util[_0x9284('0x2f')](_0x9284('0x32'),_0xa12ed1['action'][_0x9284('0x33')]()),{'evt':_[_0x9284('0x34')](_0x45d8ac,{'autoCreate':_0xb96203}),'contact':_0x309207===undefined?{}:_0x309207,'contacts':_0x5e0c1a[_0x9284('0x1e')]===0x0?undefined:_0x5e0c1a});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 9e6b004..1ae71e8 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 _0x0fa1=['parse','query','replace','AllConditions','every','checkConditions','channel','some','AnyConditions','field','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','event','agent','membername','lastevent','exports','util','url','mustache','ioredis','./urlforward','./cmContact','../../../config/environment','../../../config/logger','trigger','redis','defaults','localhost','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','zendeskAccounts','freshdeskAccounts','salesforceAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','accounts','sugarcrmAccounts','servicenowAccounts','custom:agentcalled','bind','custom:agentconnect','syncCustomEvent','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','info','clone','checkTriggers','status','checkTrigger','merge','variables','Actions','length','interface','action','toLowerCase','motionbar','data1','TemplateId','html','data2','render','template\x20not\x20found','uri','buildUri','isNil','data3','location','uriLocation','windowWidth','data5','800','windowHeight','600','winArguments','name','format','trigger:%s:%s','jscripty','trigger:%s','user:%s','contactmanager','exec','integration','queue','voiceExtensions','routeId','urlforward'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0x0fa1,0x108));var _0x10fa=function(_0xe1843c,_0x544404){_0xe1843c=_0xe1843c-0x0;var _0x467efc=_0x0fa1[_0xe1843c];return _0x467efc;};'use strict';var util=require(_0x10fa('0x0'));var _=require('lodash');var url=require(_0x10fa('0x1'));var Mustache=require(_0x10fa('0x2'));var Redis=require(_0x10fa('0x3'));var urlforward=require(_0x10fa('0x4'));var integration=require('./integration');var cmContact=require(_0x10fa('0x5'));var script=require('./script');var config=require(_0x10fa('0x6'));var logger=require(_0x10fa('0x7'))(_0x10fa('0x8'));var ami=require('../ami');config[_0x10fa('0x9')]=_[_0x10fa('0xa')](config['redis'],{'host':_0x10fa('0xb'),'port':0x18eb});var io=require(_0x10fa('0xc'))(new Redis(config[_0x10fa('0x9')]));var operators={'equals':function(_0x5453d3,_0x56df04){return _0x5453d3==_0x56df04;},'not_equals':function(_0x3a2698,_0x218d35){return _0x3a2698!=_0x218d35;}};var barAndWebActions=[_0x10fa('0xd'),'url',_0x10fa('0xe')];function Trigger(_0x211db1){this[_0x10fa('0xf')]=_0x211db1[_0x10fa('0xf')];this[_0x10fa('0x10')]=_0x211db1['agents'];this[_0x10fa('0x11')]=_0x211db1['voiceQueues'];this[_0x10fa('0x12')]=_0x211db1[_0x10fa('0x12')];this['voiceExtensions']=_0x211db1['voiceExtensions'];this[_0x10fa('0x13')]=_0x211db1['zendeskAccounts'];this[_0x10fa('0x14')]=_0x211db1[_0x10fa('0x14')];this[_0x10fa('0x15')]=_0x211db1[_0x10fa('0x15')];this['sugarcrmAccounts']=_0x211db1['sugarcrmAccounts'];this[_0x10fa('0x16')]=_0x211db1[_0x10fa('0x16')];this[_0x10fa('0x17')]=_0x211db1[_0x10fa('0x17')];this[_0x10fa('0x18')]=_0x211db1['vtigerAccounts'];this['servicenowAccounts']=_0x211db1['servicenowAccounts'];this[_0x10fa('0x19')]=_0x211db1[_0x10fa('0x19')];this[_0x10fa('0x1a')]=_0x211db1[_0x10fa('0x1a')];this[_0x10fa('0x1b')]={'zendesk':this['zendeskAccounts'],'salesforce':this[_0x10fa('0x15')],'freshdesk':this[_0x10fa('0x14')],'sugarcrm':this[_0x10fa('0x1c')],'zoho':this[_0x10fa('0x16')],'desk':this[_0x10fa('0x17')],'vtiger':this[_0x10fa('0x18')],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0x10fa('0x1a')],'servicenow':this[_0x10fa('0x1d')]};ami['on'](_0x10fa('0x1e'),this['syncCustomEvent'][_0x10fa('0x1f')](this));ami['on'](_0x10fa('0x20'),this[_0x10fa('0x21')][_0x10fa('0x1f')](this));ami['on'](_0x10fa('0x22'),this[_0x10fa('0x21')][_0x10fa('0x1f')](this));ami['on'](_0x10fa('0x23'),this[_0x10fa('0x21')][_0x10fa('0x1f')](this));ami['on'](_0x10fa('0x24'),this[_0x10fa('0x21')][_0x10fa('0x1f')](this));ami['on'](_0x10fa('0x25'),this[_0x10fa('0x21')]['bind'](this));ami['on'](_0x10fa('0x26'),this['syncCustomEvent'][_0x10fa('0x1f')](this));ami['on'](_0x10fa('0x27'),this['syncCustomEvent']['bind'](this));ami['on'](_0x10fa('0x28'),this[_0x10fa('0x21')][_0x10fa('0x1f')](this));ami['on'](_0x10fa('0x29'),this[_0x10fa('0x21')][_0x10fa('0x1f')](this));ami['on'](_0x10fa('0x2a'),this[_0x10fa('0x21')][_0x10fa('0x1f')](this));ami['on'](_0x10fa('0x2b'),this[_0x10fa('0x21')][_0x10fa('0x1f')](this));ami['on'](_0x10fa('0x2c'),this[_0x10fa('0x2d')][_0x10fa('0x1f')](this));ami['on'](_0x10fa('0x2e'),this[_0x10fa('0x2d')]['bind'](this));ami['on'](_0x10fa('0x2f'),this[_0x10fa('0x2d')]['bind'](this));ami['on'](_0x10fa('0x30'),this[_0x10fa('0x21')][_0x10fa('0x1f')](this));ami['on'](_0x10fa('0x31'),this[_0x10fa('0x21')][_0x10fa('0x1f')](this));ami['on'](_0x10fa('0x32'),this[_0x10fa('0x21')][_0x10fa('0x1f')](this));ami['on']('custom:outgoingmessage',this[_0x10fa('0x21')]['bind'](this));ami['on'](_0x10fa('0x33'),this[_0x10fa('0x21')][_0x10fa('0x1f')](this));ami['on'](_0x10fa('0x34'),this[_0x10fa('0x21')]['bind'](this));}Trigger[_0x10fa('0x35')][_0x10fa('0x36')]=function(_0xb87303,_0x18b2a5,_0x29f0db){logger[_0x10fa('0x37')](_0xb87303,_0x18b2a5,JSON['stringify'](_0x29f0db));io['to'](_0xb87303)[_0x10fa('0x36')](_0x18b2a5,_0x29f0db);};Trigger[_0x10fa('0x35')][_0x10fa('0x21')]=function(_0x1fb383){var _0x19324d=_[_0x10fa('0x38')](_0x1fb383);this[_0x10fa('0x39')](_0x19324d);};Trigger[_0x10fa('0x35')][_0x10fa('0x2d')]=function(_0x44bff4){if(this[_0x10fa('0x10')][_0x44bff4['interface']]){this[_0x10fa('0x21')](_0x44bff4);}};Trigger[_0x10fa('0x35')][_0x10fa('0x39')]=function(_0x26acc5){var _0x57cb22;for(var _0x583e85 in this[_0x10fa('0xf')]){if(this['triggers']['hasOwnProperty'](_0x583e85)){if(this[_0x10fa('0xf')][_0x583e85][_0x10fa('0x3a')]){_0x57cb22=this[_0x10fa('0x3b')](this[_0x10fa('0xf')][_0x583e85],_0x26acc5);if(_0x57cb22){_[_0x10fa('0x3c')](_0x26acc5,_0x26acc5[_0x10fa('0x3d')]);for(var _0x3526a2=0x0,_0x543696,_0x341bb2,_0x1cd135;_0x3526a20x0){_0x55ad0f=_[_0xf326('0x25')](_0x581531,_0x1617d2);}return _0x55ad0f;}function getCustomFields(_0x1ae23a,_0x2fa28e){var _0x5dbe63=[];var _0xc115d9={'custom_fields':{}};if(_0x1ae23a[_0xf326('0x26')]>0x0){_['forEach'](_0x1ae23a,function(_0x225776){if(_[_0xf326('0x27')]([_0xf326('0x28'),_0xf326('0x29')],_0x225776[_0xf326('0x2a')])&&_0x225776[_0xf326('0x2b')]&&!_0x225776[_0xf326('0x2c')]){_0xc115d9[_0x225776[_0xf326('0x2b')][_0xf326('0x2d')]()]=_0x225776[_0xf326('0x2e')]['toString']();}else if(_[_0xf326('0x27')]([_0xf326('0x28'),_0xf326('0x29')],_0x225776['type'])&&_0x225776[_0xf326('0x2f')]&&_0x225776[_0xf326('0x2c')]){_0xc115d9[_0xf326('0x30')][_0x225776['idField']]=_0x225776['content'][_0xf326('0x31')]();}else if(_0x225776[_0xf326('0x2a')]===_0xf326('0x32')&&_0x225776[_0xf326('0x33')]&&_0x225776[_0xf326('0x2f')]&&_0x225776[_0xf326('0x2c')]){_0x2fa28e[_0x225776[_0xf326('0x33')]]&&(_0xc115d9[_0xf326('0x30')][_0x225776['idField']]=_0x2fa28e[_0x225776[_0xf326('0x33')]][_0xf326('0x31')]());}else if(_0x225776['type']===_0xf326('0x34')&&_0x225776['Variable']&&_0x225776[_0xf326('0x35')]['name']&&_0x225776['idField']&&_0x225776[_0xf326('0x2c')]){_0x2fa28e[_0x225776['Variable'][_0xf326('0x36')]['toLowerCase']()]&&(_0xc115d9[_0xf326('0x30')][_0x225776[_0xf326('0x2f')]]=_0x2fa28e[_0x225776[_0xf326('0x35')]['name'][_0xf326('0x2d')]()][_0xf326('0x31')]());}});}if(_0xc115d9['priority']){_0xc115d9[_0xf326('0x37')]=Number(_0xc115d9[_0xf326('0x37')]);}return _0xc115d9;}function getTicket(_0x40fa7a,_0xaf65e0,_0x51076c,_0x2c4416,_0xb1ef35){logger[_0xf326('0xb')](_0xf326('0x38'));var _0x1d88ed=_['merge']({'subject':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3a')],_0xb1ef35,'\x20'),'type':'phone','status':'new','labels':[_0xf326('0x3b'),'Motion','CTI'][_0xf326('0x3c')](getTags(_0x2c4416['Tags'],_0xf326('0x36'))),'description':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3d')],_0xb1ef35,'\x0a'),'_links':{'assigned_user':{'href':util[_0xf326('0x13')]('/api/v2/users/%d',_0xaf65e0['id']),'class':_0xf326('0x3e')}},'message':{'direction':'in','body':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3d')],_0xb1ef35,'\x0a')}},getCustomFields(_0x2c4416[_0xf326('0x3f')],_0xb1ef35));return request({'uri':util[_0xf326('0x13')](_0xf326('0x40'),_0x40fa7a[_0xf326('0x16')],_0x51076c['id']),'method':_0xf326('0x23'),'body':_0x1d88ed});}exports[_0xf326('0x41')]=function(_0x1227d3,_0x361776,_0x2bab13,_0x50d63f,_0x1b6126,_0x1637dc){var _0x2ed1a7,_0x270288;_0x1637dc[_0xf326('0x16')]=intUtil[_0xf326('0x42')](_0x1637dc['remoteUri']);_0x1637dc[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x1637dc['serverUrl']);if(_0x1b6126&&_0x1b6126[_0xf326('0x44')]){logger[_0xf326('0xb')](_0xf326('0x45'),_0xf326('0x46'));_0x361776[_0xf326('0x47')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1637dc[_0xf326('0x43')],_0x361776[_0xf326('0x48')],md5(_0x361776['uniqueid']));}else{_0x361776['recordingURL']='';}headers[_0xf326('0x49')]=getAuth(_0x1637dc);return getUser(_0x1637dc,_0x50d63f[_0xf326('0x4a')])[_0xf326('0xe')](function(_0x5b3705){_0x2ed1a7=_0x5b3705;logger[_0xf326('0xb')](_0xf326('0x4b'),_0x2ed1a7['id']);return getEndUser(_0x1637dc,_0x361776[_0xf326('0x4c')],_0x361776[_0xf326('0x4d')]);})[_0xf326('0xe')](function(_0x2d9bba){_0x270288=_0x2d9bba;logger[_0xf326('0xb')](_0xf326('0x4e'),_0x270288['id']);return getTicket(_0x1637dc,_0x2ed1a7,_0x270288,_0x2bab13,_0x361776);})[_0xf326('0xe')](function(_0x27ced1){if(_0x27ced1){logger[_0xf326('0xb')](_0xf326('0x4f'));logger[_0xf326('0xb')](_0xf326('0x50'),_0x27ced1['id']);switch(_0x1637dc[_0xf326('0x2a')]){case'integrationTab':logger[_0xf326('0xb')](_0xf326('0x45'),_0xf326('0x51'));emit(util[_0xf326('0x13')]('user:%s',_0x50d63f[_0xf326('0x36')]),_0xf326('0x52'),{'recordId':_0x27ced1['id']});break;case _0xf326('0x53'):logger[_0xf326('0xb')]('[QUEUE]',_0xf326('0x54'));emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x50d63f[_0xf326('0x36')]),_0xf326('0x56'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x27ced1['id'])});break;default:logger[_0xf326('0x57')](_0xf326('0x45'),_0xf326('0x58'));}}})['catch'](function(_0x102fba){console[_0xf326('0x57')](_0x102fba);logger[_0xf326('0x57')]('[QUEUE]',JSON['stringify'](_0x102fba));});};exports[_0xf326('0x59')]=function(_0x5b4832,_0x1cf58f,_0x554277,_0x458e5f,_0x7ee57,_0x28c959,_0x25e091){var _0x212594,_0x35d3c8;_0x28c959[_0xf326('0x16')]=intUtil['stripTrailingSlash'](_0x28c959[_0xf326('0x16')]);_0x28c959[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x28c959['serverUrl']);if(_0x25e091&&_0x25e091[_0xf326('0x5a')]&&_0x25e091[_0xf326('0x5a')]!==_0xf326('0x5b')){logger[_0xf326('0xb')](_0xf326('0x5c'),'Recording\x20is\x20enabled!');_0x1cf58f[_0xf326('0x47')]=util[_0xf326('0x13')](_0xf326('0x5d'),_0x28c959[_0xf326('0x43')],_0x1cf58f['uniqueid'],md5(_0x1cf58f[_0xf326('0x48')]));}headers[_0xf326('0x49')]=getAuth(_0x28c959);return getUser(_0x28c959,_0x458e5f[_0xf326('0x4a')])[_0xf326('0xe')](function(_0x4d3b9e){_0x212594=_0x4d3b9e;logger['info'](_0xf326('0x4b'),_0x212594['id']);return getEndUser(_0x28c959,_0x1cf58f[_0xf326('0x5e')],_0x1cf58f['destcalleridnum']);})[_0xf326('0xe')](function(_0x29de71){_0x35d3c8=_0x29de71;logger[_0xf326('0xb')](_0xf326('0x4e'),_0x35d3c8['id']);return getTicket(_0x28c959,_0x212594,_0x35d3c8,_0x554277,_0x1cf58f);})['then'](function(_0xb1c18c){if(_0xb1c18c){logger['info']('Ticket\x20created!');logger[_0xf326('0xb')]('The\x20Ticket\x20ID\x20is:',_0xb1c18c['id']);switch(_0x28c959[_0xf326('0x2a')]){case _0xf326('0x5f'):logger[_0xf326('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x458e5f[_0xf326('0x36')]),'trigger:desk:display',{'recordId':_0xb1c18c['id']});break;case _0xf326('0x53'):logger['info'](_0xf326('0x45'),_0xf326('0x54'));emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x458e5f[_0xf326('0x36')]),_0xf326('0x56'),{'uri':util[_0xf326('0x13')](_0xf326('0x60'),_0x28c959[_0xf326('0x16')],_0xb1c18c['id'])});break;default:logger[_0xf326('0x57')](_0xf326('0x5c'),_0xf326('0x58'));}}})[_0xf326('0x61')](function(_0x4ca1b8){logger[_0xf326('0x57')]('[OUTBOUND]',JSON[_0xf326('0x62')](_0x4ca1b8));});};exports[_0xf326('0x63')]=function(_0x5e858d,_0x2b770c,_0x5283da,_0x3255b2,_0xd55246,_0x28f3cb){var _0x2d45c9,_0x31b6dd;_0x28f3cb['remoteUri']=intUtil['stripTrailingSlash'](_0x28f3cb[_0xf326('0x16')]);_0x28f3cb[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x28f3cb[_0xf326('0x43')]);if(_0xd55246&&_0xd55246[_0xf326('0x44')]){logger['info']('['+_0x2b770c[_0xf326('0x64')][_0xf326('0x65')]()+']','Recording\x20is\x20enabled!');_0x2b770c['recordingURL']=util['format'](_0xf326('0x5d'),_0x28f3cb[_0xf326('0x43')],_0x2b770c[_0xf326('0x48')],md5(_0x2b770c[_0xf326('0x48')]));}else{_0x2b770c[_0xf326('0x47')]='';}headers[_0xf326('0x49')]=getAuth(_0x28f3cb);return getUser(_0x28f3cb)[_0xf326('0xe')](function(_0x4b9013){_0x2d45c9=_0x4b9013;logger[_0xf326('0xb')](_0xf326('0x4b'),_0x2d45c9['id']);return getEndUser(_0x28f3cb,_0x2b770c[_0xf326('0x4c')],_0x2b770c[_0xf326('0x4d')]);})['then'](function(_0x3717fe){_0x31b6dd=_0x3717fe;logger['info']('The\x20Enduser\x20ID\x20is:',_0x31b6dd['id']);return getTicket(_0x28f3cb,_0x2d45c9,_0x31b6dd,_0x5283da,_0x2b770c);})[_0xf326('0xe')](function(_0x540fa0){if(_0x540fa0){logger[_0xf326('0xb')](_0xf326('0x4f'));logger[_0xf326('0xb')](_0xf326('0x50'),_0x540fa0['id']);}})[_0xf326('0x61')](function(_0x541491){logger['error']('['+_0x2b770c['lastevent'][_0xf326('0x65')]()+']',JSON[_0xf326('0x62')](_0x541491));});}; \ No newline at end of file +var _0x3e74=['customField','content','idField','custom_fields','variable','variableName','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','getString','phone','new','xCALLY','Motion','CTI','concat','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','stripTrailingSlash','serverUrl','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','newTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','catch','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridnum','The\x20Enduser\x20ID\x20is:','trigger:desk:display','trigger:browser:url','%s/agent/tickets/%s','stringify','unmanaged','monitor_format','lastevent','toUpperCase','calleridnum','lodash','md5','util','ioredis','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Getting\x20agent\x20with\x20email','%s/users','then','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','format','debug','[HTTP]','GET','authType','basic','%s:%s','username','password','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','total_entries','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','length','forEach','includes','string','picklist','type','nameField'];(function(_0x814222,_0x54b4ad){var _0x25e6f5=function(_0x178220){while(--_0x178220){_0x814222['push'](_0x814222['shift']());}};_0x25e6f5(++_0x54b4ad);}(_0x3e74,0x175));var _0x43e7=function(_0x4cb64c,_0x1ad2e8){_0x4cb64c=_0x4cb64c-0x0;var _0x2eaa7f=_0x3e74[_0x4cb64c];return _0x2eaa7f;};'use strict';var _=require(_0x43e7('0x0'));var rp=require('request-promise');var md5=require(_0x43e7('0x1'));var util=require(_0x43e7('0x2'));var Redis=require(_0x43e7('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x43e7('0x4'))('desk');config[_0x43e7('0x5')]=_[_0x43e7('0x6')](config[_0x43e7('0x5')],{'host':_0x43e7('0x7'),'port':0x18eb});var io=require(_0x43e7('0x8'))(new Redis(config['redis']));function emit(_0x45a0d1,_0x3491d6,_0x2ede2d){io['to'](_0x45a0d1)[_0x43e7('0x9')](_0x3491d6,_0x2ede2d);}var headers={'Content-Type':_0x43e7('0xa'),'Accept':'application/json'};function getUser(_0x212c6c,_0x554d44){if(intUtil['validateEmail'](_0x554d44)===!![]){logger[_0x43e7('0xb')](_0x43e7('0xc'),_0x554d44);return request({'uri':util['format'](_0x43e7('0xd'),_0x212c6c['remoteUri'])})[_0x43e7('0xe')](function(_0x37302c){if(_0x37302c['total_entries']){return _[_0x43e7('0xf')](_0x37302c[_0x43e7('0x10')][_0x43e7('0x11')],{'email':_0x554d44});}})[_0x43e7('0xe')](function(_0x4e008c){if(_0x4e008c){logger['info'](_0x43e7('0x12'));return _0x4e008c;}else{logger[_0x43e7('0xb')](_0x43e7('0x13'));return request({'uri':util['format']('%s/users/me',_0x212c6c[_0x43e7('0x14')])});}});}else{logger[_0x43e7('0xb')](_0x43e7('0x15'));return request({'uri':util[_0x43e7('0x16')]('%s/users/me',_0x212c6c['remoteUri'])});}}function request(_0xdf16c){logger[_0x43e7('0x17')](_0x43e7('0x18'),JSON['stringify'](_0xdf16c));return rp(_['defaults'](_0xdf16c,{'method':_0x43e7('0x19'),'headers':headers,'json':!![]}));}function getAuth(_0x1ca758){var _0x9037d3;if(_0x1ca758[_0x43e7('0x1a')]===_0x43e7('0x1b')){_0x9037d3=util[_0x43e7('0x16')](_0x43e7('0x1c'),_0x1ca758[_0x43e7('0x1d')],_0x1ca758[_0x43e7('0x1e')]);}else if(_0x1ca758[_0x43e7('0x1a')]===_0x43e7('0x1f')){_0x9037d3=util[_0x43e7('0x16')]('%s/token:%s',_0x1ca758[_0x43e7('0x1d')],_0x1ca758[_0x43e7('0x1f')]);}return util['format'](_0x43e7('0x20'),new Buffer(_0x9037d3)[_0x43e7('0x21')](_0x43e7('0x22')));}function getEndUser(_0x28aacc,_0x4077fb,_0x2f4cb4){logger['info'](_0x43e7('0x23'),_0x2f4cb4);return request({'uri':util['format']('%s/customers/search',_0x28aacc[_0x43e7('0x14')]),'qs':{'phone':_0x2f4cb4}})[_0x43e7('0xe')](function(_0x4b2b9f){if(_0x4b2b9f[_0x43e7('0x24')]){logger['info'](_0x43e7('0x25'));return _0x4b2b9f['_embedded'][_0x43e7('0x11')][0x0];}else{logger[_0x43e7('0xb')](_0x43e7('0x26'));return request({'uri':util[_0x43e7('0x16')]('%s/customers',_0x28aacc['remoteUri']),'method':_0x43e7('0x27'),'body':{'first_name':_0x4077fb,'title':_0x4077fb,'phone_numbers':[{'type':'work','value':_0x2f4cb4}]}});}});}function getTags(_0x2dd5f,_0x40dc8f){var _0x3565cf=[];if(_0x2dd5f&&_0x2dd5f[_0x43e7('0x28')]>0x0){_0x3565cf=_['map'](_0x2dd5f,_0x40dc8f);}return _0x3565cf;}function getCustomFields(_0x33a1a5,_0x4690a6){var _0x45b675=[];var _0x50f9f5={'custom_fields':{}};if(_0x33a1a5[_0x43e7('0x28')]>0x0){_[_0x43e7('0x29')](_0x33a1a5,function(_0x2b85a5){if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5[_0x43e7('0x2d')])&&_0x2b85a5[_0x43e7('0x2e')]&&!_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x2b85a5[_0x43e7('0x2e')]['toLowerCase']()]=_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x21')]();}else if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5['type'])&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x2b85a5['content']['toString']();}else if(_0x2b85a5['type']===_0x43e7('0x33')&&_0x2b85a5[_0x43e7('0x34')]&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x34')]]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5['idField']]=_0x4690a6[_0x2b85a5['variableName']]['toString']());}else if(_0x2b85a5['type']==='customVariable'&&_0x2b85a5['Variable']&&_0x2b85a5['Variable'][_0x43e7('0x35')]&&_0x2b85a5['idField']&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x36')][_0x43e7('0x35')][_0x43e7('0x37')]()]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x4690a6[_0x2b85a5[_0x43e7('0x36')]['name']['toLowerCase']()]['toString']());}});}if(_0x50f9f5[_0x43e7('0x38')]){_0x50f9f5[_0x43e7('0x38')]=Number(_0x50f9f5[_0x43e7('0x38')]);}return _0x50f9f5;}function getTicket(_0x16cdba,_0x1b1440,_0x1ed538,_0x1d4589,_0x2ffd43){logger['info'](_0x43e7('0x39'));var _0x2b0ffe=_['merge']({'subject':intUtil[_0x43e7('0x3a')](_0x1d4589['Subjects'],_0x2ffd43,'\x20'),'type':_0x43e7('0x3b'),'status':_0x43e7('0x3c'),'labels':[_0x43e7('0x3d'),_0x43e7('0x3e'),_0x43e7('0x3f')][_0x43e7('0x40')](getTags(_0x1d4589['Tags'],'name')),'description':intUtil[_0x43e7('0x3a')](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a'),'_links':{'assigned_user':{'href':util[_0x43e7('0x16')](_0x43e7('0x42'),_0x1b1440['id']),'class':_0x43e7('0x43')}},'message':{'direction':'in','body':intUtil['getString'](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a')}},getCustomFields(_0x1d4589[_0x43e7('0x44')],_0x2ffd43));return request({'uri':util['format'](_0x43e7('0x45'),_0x16cdba['remoteUri'],_0x1ed538['id']),'method':_0x43e7('0x27'),'body':_0x2b0ffe});}exports['queue']=function(_0x3d81ae,_0x3b4235,_0x3a5807,_0x1c2c6b,_0x49b866,_0x47d6a1){var _0x103393,_0x40c509;_0x47d6a1[_0x43e7('0x14')]=intUtil[_0x43e7('0x46')](_0x47d6a1['remoteUri']);_0x47d6a1['serverUrl']=intUtil['stripTrailingSlash'](_0x47d6a1[_0x43e7('0x47')]);if(_0x49b866&&_0x49b866['monitor_format']){logger[_0x43e7('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3b4235[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x47d6a1[_0x43e7('0x47')],_0x3b4235[_0x43e7('0x4a')],md5(_0x3b4235[_0x43e7('0x4a')]));}else{_0x3b4235['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x47d6a1);return getUser(_0x47d6a1,_0x1c2c6b[_0x43e7('0x4c')])[_0x43e7('0xe')](function(_0x1fd277){_0x103393=_0x1fd277;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x103393['id']);return getEndUser(_0x47d6a1,_0x3b4235['calleridname'],_0x3b4235['calleridnum']);})[_0x43e7('0xe')](function(_0x36a09e){_0x40c509=_0x36a09e;logger[_0x43e7('0xb')]('The\x20Enduser\x20ID\x20is:',_0x40c509['id']);return getTicket(_0x47d6a1,_0x103393,_0x40c509,_0x3a5807,_0x3b4235);})['then'](function(_0x56489b){if(_0x56489b){logger[_0x43e7('0xb')](_0x43e7('0x4e'));logger['info'](_0x43e7('0x4f'),_0x56489b['id']);switch(_0x47d6a1[_0x43e7('0x2d')]){case _0x43e7('0x50'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0x43e7('0x51'),_0x1c2c6b[_0x43e7('0x35')]),'trigger:desk:display',{'recordId':_0x56489b['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')](_0x43e7('0x53'),_0x43e7('0x54'));emit(util['format'](_0x43e7('0x51'),_0x1c2c6b['name']),'trigger:browser:url',{'uri':util[_0x43e7('0x16')](_0x43e7('0x55'),_0x56489b['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x53'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x1cd87c){console[_0x43e7('0x56')](_0x1cd87c);logger[_0x43e7('0x56')](_0x43e7('0x53'),JSON['stringify'](_0x1cd87c));});};exports[_0x43e7('0x59')]=function(_0x46c910,_0x499c03,_0x39e3ca,_0x4e6f6d,_0x35b799,_0x520857,_0x34e2ec){var _0x1f561f,_0xfe13fa;_0x520857['remoteUri']=intUtil['stripTrailingSlash'](_0x520857[_0x43e7('0x14')]);_0x520857[_0x43e7('0x47')]=intUtil[_0x43e7('0x46')](_0x520857[_0x43e7('0x47')]);if(_0x34e2ec&&_0x34e2ec[_0x43e7('0x5a')]&&_0x34e2ec[_0x43e7('0x5a')]!==_0x43e7('0x5b')){logger[_0x43e7('0xb')](_0x43e7('0x5c'),_0x43e7('0x5d'));_0x499c03[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x520857[_0x43e7('0x47')],_0x499c03['uniqueid'],md5(_0x499c03[_0x43e7('0x4a')]));}headers[_0x43e7('0x4b')]=getAuth(_0x520857);return getUser(_0x520857,_0x4e6f6d[_0x43e7('0x4c')])['then'](function(_0x5d63c6){_0x1f561f=_0x5d63c6;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x1f561f['id']);return getEndUser(_0x520857,_0x499c03['destcalleridname'],_0x499c03[_0x43e7('0x5e')]);})['then'](function(_0x49a6ce){_0xfe13fa=_0x49a6ce;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xfe13fa['id']);return getTicket(_0x520857,_0x1f561f,_0xfe13fa,_0x39e3ca,_0x499c03);})[_0x43e7('0xe')](function(_0x40155c){if(_0x40155c){logger[_0x43e7('0xb')]('Ticket\x20created!');logger[_0x43e7('0xb')](_0x43e7('0x4f'),_0x40155c['id']);switch(_0x520857['type']){case _0x43e7('0x50'):logger[_0x43e7('0xb')](_0x43e7('0x53'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format']('user:%s',_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x60'),{'recordId':_0x40155c['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x43e7('0x16')](_0x43e7('0x51'),_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x61'),{'uri':util['format'](_0x43e7('0x62'),_0x520857[_0x43e7('0x14')],_0x40155c['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x5c'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x4665db){logger[_0x43e7('0x56')](_0x43e7('0x5c'),JSON[_0x43e7('0x63')](_0x4665db));});};exports[_0x43e7('0x64')]=function(_0x57fdfe,_0x5f3824,_0x2b0711,_0x58a3a8,_0x501616,_0x50edb2){var _0xb3e981,_0xe666b0;_0x50edb2['remoteUri']=intUtil[_0x43e7('0x46')](_0x50edb2[_0x43e7('0x14')]);_0x50edb2[_0x43e7('0x47')]=intUtil['stripTrailingSlash'](_0x50edb2[_0x43e7('0x47')]);if(_0x501616&&_0x501616[_0x43e7('0x65')]){logger[_0x43e7('0xb')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',_0x43e7('0x5d'));_0x5f3824[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x50edb2[_0x43e7('0x47')],_0x5f3824[_0x43e7('0x4a')],md5(_0x5f3824['uniqueid']));}else{_0x5f3824['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x50edb2);return getUser(_0x50edb2)['then'](function(_0x5cb26e){_0xb3e981=_0x5cb26e;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0xb3e981['id']);return getEndUser(_0x50edb2,_0x5f3824['calleridname'],_0x5f3824[_0x43e7('0x68')]);})[_0x43e7('0xe')](function(_0x1e2fed){_0xe666b0=_0x1e2fed;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xe666b0['id']);return getTicket(_0x50edb2,_0xb3e981,_0xe666b0,_0x2b0711,_0x5f3824);})[_0x43e7('0xe')](function(_0x398a78){if(_0x398a78){logger['info'](_0x43e7('0x4e'));logger[_0x43e7('0xb')]('The\x20Ticket\x20ID\x20is:',_0x398a78['id']);}})[_0x43e7('0x58')](function(_0x5c2c5f){logger[_0x43e7('0x56')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',JSON[_0x43e7('0x63')](_0x5c2c5f));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index ca18439..9ff0dd4 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 _0x0b79=['value','isNil','email','length','internalemailaddress','isdisabled','info','toUpperCase',']\x20Agent\x20found\x20','systemuserid','userId','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','headers','odata-entityid','lastIndexOf','GET','replace','%2b','4.0','telephone1','enduserId','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','includes','string','picklist','type','nameField','customField','substring','indexOf','content','ticketType','incident','POST','incidents','assign','getString','Subjects','Descriptions','Fields','phonecall','/contacts(','callDirection','queue','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','remoteUri','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','request-promise','util','md5','ioredis','dynamics365','redis','defaults','localhost','password','then','catch','error',']\x20Wrong\x20credentials!','message','Bearer\x20'];(function(_0x3dacbc,_0x263ad2){var _0x5a031e=function(_0x8c8208){while(--_0x8c8208){_0x3dacbc['push'](_0x3dacbc['shift']());}};_0x5a031e(++_0x263ad2);}(_0x0b79,0xad));var _0x90b7=function(_0x50e0e3,_0x5bbdbc){_0x50e0e3=_0x50e0e3-0x0;var _0x105cdc=_0x0b79[_0x50e0e3];return _0x105cdc;};'use strict';var _=require(_0x90b7('0x0'));var BPromise=require(_0x90b7('0x1'));var rp=require(_0x90b7('0x2'));var util=require(_0x90b7('0x3'));var intUtil=require('./util');var md5=require(_0x90b7('0x4'));var Redis=require(_0x90b7('0x5'));var logger=require('../../../../config/logger')(_0x90b7('0x6'));var config=require('../../../../config/environment');config[_0x90b7('0x7')]=_[_0x90b7('0x8')](config[_0x90b7('0x7')],{'host':_0x90b7('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x90b7('0x7')]));function getAuthToken(_0x5c8d2a,_0x41981b,_0x3a929){var _0x381499={'method':'POST','uri':_0x41981b,'form':{'client_id':_0x5c8d2a['clientId'],'resource':_0x5c8d2a['remoteUri'],'username':_0x5c8d2a['username'],'password':_0x5c8d2a[_0x90b7('0xa')],'grant_type':_0x90b7('0xa'),'client_secret':_0x5c8d2a['clientSecret']},'json':!![]};return rp(_0x381499)[_0x90b7('0xb')](function(_0x5e817e){return _0x5e817e['access_token'];})[_0x90b7('0xc')](function(_0x3af6f7){logger[_0x90b7('0xd')]('['+[_0x3a929['toUpperCase']()]+_0x90b7('0xe'));return _0x3af6f7[_0x90b7('0xf')];});}function getUser(_0x4d7424,_0xa91d51,_0x182866,_0xb36b26,_0xd8d12,_0x5f4942){return new BPromise(function(_0x1c84cd,_0x325f68){return getAuthToken(_0xa91d51,_0xb36b26,_0x5f4942)[_0x90b7('0xb')](function(_0x357dc1){var _0x504b1c={'method':'GET','uri':_0xd8d12+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0x90b7('0x10')+_0x357dc1,'OData-Version':'4.0'},'json':!![]};return rp(_0x504b1c);})[_0x90b7('0xb')](function(_0x510387){var _0x249b90=_0x510387[_0x90b7('0x11')];var _0x429c74=![];var _0x1e7d2d=null;if(!_[_0x90b7('0x12')](_0x182866)){if(intUtil['validateEmail'](_0x182866[_0x90b7('0x13')])){_0x4d7424['userEmail']=_0x182866['email'];for(_0x1e7d2d=0x0;_0x1e7d2d<_0x249b90[_0x90b7('0x14')];_0x1e7d2d++){if(_0x249b90[_0x1e7d2d][_0x90b7('0x15')]===_0x182866[_0x90b7('0x13')]&&!_0x249b90[_0x1e7d2d][_0x90b7('0x16')]){_0x429c74=!![];logger[_0x90b7('0x17')]('['+[_0x5f4942[_0x90b7('0x18')]()]+_0x90b7('0x19')+_0x249b90[_0x1e7d2d][_0x90b7('0x1a')]+'!');_0x4d7424[_0x90b7('0x1b')]=_0x249b90[_0x1e7d2d][_0x90b7('0x1a')];}}}}if(!_0x429c74){logger[_0x90b7('0x17')]('['+[_0x5f4942[_0x90b7('0x18')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x4d7424['userEmail']=_0xa91d51['username'];for(_0x1e7d2d=0x0;_0x1e7d2d<_0x249b90[_0x90b7('0x14')];_0x1e7d2d++){if(_0x249b90[_0x1e7d2d]['internalemailaddress']===_0xa91d51['username']){_0x4d7424[_0x90b7('0x1b')]=_0x249b90[_0x1e7d2d][_0x90b7('0x1a')];}}}_0x1c84cd(_0x4d7424);})['catch'](function(_0x30207f){_0x325f68(_0x30207f['message']);});});}function createEndUser(_0x40aa5c,_0x13626e,_0x55e497,_0x47d4be,_0x351325,_0x37c6ef){return new BPromise(function(_0x2d6c17,_0x32aec3){return getAuthToken(_0x13626e,_0x55e497,_0x37c6ef)[_0x90b7('0xb')](function(_0x17a12a){var _0x21f8ef=_0x37c6ef[_0x90b7('0x1c')]()===_0x90b7('0x1d')?_0x351325[_0x90b7('0x1e')]:_0x351325[_0x90b7('0x1f')];var _0xcdaa62={'method':'POST','uri':_0x47d4be+_0x90b7('0x20'),'body':{'telephone1':_0x21f8ef,'fullname':_0x21f8ef,'firstname':_0x21f8ef,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x90b7('0x21')+_0x40aa5c['userId']+')'},'headers':{'Authorization':_0x90b7('0x10')+_0x17a12a,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};return rp(_0xcdaa62);})['then'](function(_0x1784e1){var _0x45bc89=_0x1784e1[_0x90b7('0x22')][_0x90b7('0x23')];var _0x1c7db1=_0x45bc89['substring'](_0x45bc89[_0x90b7('0x24')]('(')+0x1,_0x45bc89[_0x90b7('0x24')](')'));_0x40aa5c['enduserId']=_0x1c7db1;_0x2d6c17(_0x40aa5c);})[_0x90b7('0xc')](function(_0x25a51c){_0x32aec3(_0x25a51c[_0x90b7('0xf')]);});});}function getEndUser(_0x4927ff,_0x407a5f,_0x3f1e2f,_0xcf7057,_0x34695e,_0x5ae0e9){return new BPromise(function(_0x187790,_0x3e581f){var _0x482182=_0x5ae0e9[_0x90b7('0x1c')]()==='outbound'?_0x34695e[_0x90b7('0x1e')]:_0x34695e[_0x90b7('0x1f')];return getAuthToken(_0x407a5f,_0x3f1e2f,_0x5ae0e9)[_0x90b7('0xb')](function(_0x1a62ac){var _0x5f024c={'method':_0x90b7('0x25'),'uri':_0xcf7057+'contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27'+_0x482182[_0x90b7('0x26')]('+',_0x90b7('0x27'))+'\x27','headers':{'Authorization':_0x90b7('0x10')+_0x1a62ac,'If-None-Match':null,'OData-Version':_0x90b7('0x28')},'json':!![]};return rp(_0x5f024c);})[_0x90b7('0xb')](function(_0x1105ee){var _0xc5e235=null;if(_0x1105ee){var _0x3a811e=_0x1105ee[_0x90b7('0x11')];var _0x1ced5e=![];for(_0xc5e235=0x0;_0xc5e235<_0x3a811e['length'];_0xc5e235++){if(_0x3a811e[_0xc5e235][_0x90b7('0x29')]===_0x482182){_0x1ced5e=!![];_0x4927ff[_0x90b7('0x2a')]=_0x3a811e[_0xc5e235][_0x90b7('0x2b')];}}if(_0x1ced5e){_0x187790(_0x4927ff);}else{return createEndUser(_0x4927ff,_0x407a5f,_0x3f1e2f,_0xcf7057,_0x34695e,_0x5ae0e9)[_0x90b7('0xb')](function(_0x248bb7){logger['info']('['+[_0x5ae0e9[_0x90b7('0x18')]()]+_0x90b7('0x2c'),_0x248bb7[_0x90b7('0x2a')]);_0x187790(_0x248bb7);});}}else{return createEndUser(_0x4927ff,_0x407a5f,_0x3f1e2f,_0xcf7057,_0x34695e,_0x5ae0e9)[_0x90b7('0xb')](function(_0x3ee28e){logger[_0x90b7('0x17')]('['+[_0x5ae0e9['toUpperCase']()]+_0x90b7('0x2d'),_0x3ee28e[_0x90b7('0x2a')]);_0x187790(_0x3ee28e);});}});});}function getCustomFields(_0x53a7de,_0x56d0e6,_0x5043e4){var _0xee4f49={};if(_0x53a7de[_0x90b7('0x14')]>0x0){_[_0x90b7('0x2e')](_0x53a7de,function(_0x26977e){if(_[_0x90b7('0x2f')]([_0x90b7('0x30'),_0x90b7('0x31')],_0x26977e[_0x90b7('0x32')])&&_0x26977e[_0x90b7('0x33')]&&!_0x26977e[_0x90b7('0x34')]){var _0x1cb637=_0x26977e['idField']['toLowerCase']();var _0x2a0806=_0x1cb637[_0x90b7('0x35')](0x0,_0x1cb637[_0x90b7('0x36')]('_'));var _0x133c65=_0x1cb637[_0x90b7('0x35')](_0x1cb637[_0x90b7('0x36')]('_')+0x1);if(_0x2a0806===_0x5043e4){_0xee4f49[_0x133c65]=_0x26977e[_0x90b7('0x37')];}}});}return _0xee4f49;}function getTicket(_0x89457f,_0x39f0b9,_0x558e50,_0x1e2549,_0x33917d,_0x4e0877,_0x17354d){return new BPromise(function(_0x5aea99,_0x1fc8c2){var _0x1233e2;return getAuthToken(_0x39f0b9,_0x558e50,_0x17354d)[_0x90b7('0xb')](function(_0x346ad1){if(_0x4e0877[_0x90b7('0x38')]===_0x90b7('0x39')){_0x1233e2={'method':_0x90b7('0x3a'),'uri':_0x1e2549+_0x90b7('0x3b'),'body':Object[_0x90b7('0x3c')]({},{'title':intUtil[_0x90b7('0x3d')](_0x4e0877[_0x90b7('0x3e')],_0x33917d,'\x20'),'description':intUtil[_0x90b7('0x3d')](_0x4e0877[_0x90b7('0x3f')],_0x33917d,'\x0a'),'customerid_contact@odata.bind':'/contacts('+_0x89457f[_0x90b7('0x2a')]+')','ownerid@odata.bind':_0x90b7('0x21')+_0x89457f[_0x90b7('0x1b')]+')','caseorigincode':'1'},getCustomFields(_0x4e0877[_0x90b7('0x40')],_0x33917d,_0x4e0877[_0x90b7('0x38')])),'headers':{'Authorization':_0x90b7('0x10')+_0x346ad1,'OData-Version':_0x90b7('0x28')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x4e0877[_0x90b7('0x38')]===_0x90b7('0x41')){_0x1233e2={'method':_0x90b7('0x3a'),'uri':_0x1e2549+'phonecalls','body':Object[_0x90b7('0x3c')]({},{'subject':intUtil[_0x90b7('0x3d')](_0x4e0877[_0x90b7('0x3e')],_0x33917d,'\x20'),'phonenumber':String(_0x33917d['calleridnum']),'description':intUtil['getString'](_0x4e0877[_0x90b7('0x3f')],_0x33917d,'\x0a'),'regardingobjectid_contact@odata.bind':_0x90b7('0x42')+_0x89457f[_0x90b7('0x2a')]+')','ownerid@odata.bind':_0x90b7('0x21')+_0x89457f['userId']+')','directioncode':_0x89457f[_0x90b7('0x43')]==='queue'?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x90b7('0x21')+_0x89457f[_0x90b7('0x1b')]+')','participationtypemask':_0x89457f[_0x90b7('0x43')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x90b7('0x42')+_0x89457f[_0x90b7('0x2a')]+')','participationtypemask':_0x89457f[_0x90b7('0x43')]===_0x90b7('0x44')?0x1:0x2}]},getCustomFields(_0x4e0877[_0x90b7('0x40')],_0x33917d,_0x4e0877[_0x90b7('0x38')])),'headers':{'Authorization':_0x90b7('0x10')+_0x346ad1,'OData-Version':_0x90b7('0x28')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x1233e2);})[_0x90b7('0xb')](function(_0xb5637){var _0xde6b6a=_0xb5637[_0x90b7('0x22')][_0x90b7('0x23')];var _0x250316=_0xde6b6a['substring'](_0xde6b6a[_0x90b7('0x24')]('(')+0x1,_0xde6b6a[_0x90b7('0x24')](')'));_0x89457f[_0x90b7('0x45')]=_0x250316;_0x5aea99(_0x89457f);})[_0x90b7('0xc')](function(_0x585d05){_0x1fc8c2(_0x585d05[_0x90b7('0xf')]);});});}function emit(_0x4e13e0,_0xa97d6e,_0x207026,_0x4c8fe7){var _0x277b62={'uri':util[_0x90b7('0x46')](_0x90b7('0x47'),_0x4e13e0,_0x207026,_0x4c8fe7)};io['to'](util[_0x90b7('0x46')]('user:%s',_0xa97d6e))['emit']('trigger:browser:url',_0x277b62);}exports['cs']=function(_0xc07445,_0x34da32,_0x3b03c3,_0x36e5c9,_0x48d7d6,_0x553d84,_0x15edf2,_0x47eb92){var _0x3eac99={};_0x553d84[_0x90b7('0x48')]=intUtil[_0x90b7('0x49')](_0x553d84[_0x90b7('0x48')]);_0x553d84[_0x90b7('0x4a')]=intUtil[_0x90b7('0x49')](_0x553d84['serverUrl']);_0x3eac99[_0x90b7('0x43')]=_0x47eb92===_0x90b7('0x44')||_0x47eb92===_0x90b7('0x4b')?_0x90b7('0x44'):_0x90b7('0x1d');var _0x18ffa2=util[_0x90b7('0x46')](_0x90b7('0x4c'),_0x553d84['remoteUri']);var _0x4e8c82=util[_0x90b7('0x46')](_0x90b7('0x4d'),_0x553d84[_0x90b7('0x4e')]);var _0x34ed1=util[_0x90b7('0x46')](_0x90b7('0x4f'),_0x553d84['serverUrl'],_0x34da32[_0x90b7('0x50')],md5(_0x34da32[_0x90b7('0x50')]));if(_0x48d7d6&&_0x48d7d6['monitor_format']){logger['info'](_0x90b7('0x51'),_0x90b7('0x52'));_0x34da32[_0x90b7('0x53')]=_0x34ed1;}else if(_0x15edf2&&_0x15edf2['recordingFormat']&&_0x15edf2[_0x90b7('0x54')]!==_0x90b7('0x55')){logger[_0x90b7('0x17')](_0x90b7('0x56'),_0x90b7('0x52'));_0x34da32[_0x90b7('0x53')]=_0x34ed1;}else{_0x34da32['recordingURL']='';}return getUser(_0x3eac99,_0x553d84,_0x36e5c9,_0x4e8c82,_0x18ffa2,_0x47eb92)[_0x90b7('0xb')](function(_0x4b44c4){logger[_0x90b7('0x17')]('['+_0x47eb92[_0x90b7('0x18')]()+']\x20The\x20User\x20ID\x20is:',_0x4b44c4[_0x90b7('0x1b')]);logger[_0x90b7('0x17')]('['+_0x47eb92['toUpperCase']()+']\x20The\x20User\x20email\x20is:',_0x4b44c4['userEmail']);return getEndUser(_0x4b44c4,_0x553d84,_0x4e8c82,_0x18ffa2,_0x34da32,_0x47eb92);})['then'](function(_0x577f8e){logger[_0x90b7('0x17')]('['+_0x47eb92[_0x90b7('0x18')]()+_0x90b7('0x57'),_0x577f8e[_0x90b7('0x2a')]);logger[_0x90b7('0x17')]('['+_0x47eb92[_0x90b7('0x18')]()+_0x90b7('0x58'),_0x34da32[_0x90b7('0x1f')]);return getTicket(_0x577f8e,_0x553d84,_0x4e8c82,_0x18ffa2,_0x34da32,_0x3b03c3,_0x47eb92);})[_0x90b7('0xb')](function(_0x59a20c){logger[_0x90b7('0x17')](util['format']('['+_0x47eb92[_0x90b7('0x18')]()+_0x90b7('0x59'),_0x3b03c3[_0x90b7('0x38')],_0x59a20c['ticketId']));logger[_0x90b7('0x17')](util[_0x90b7('0x46')]('['+_0x47eb92['toUpperCase']()+_0x90b7('0x5a'),_0x47eb92));if(_0x47eb92!=='unmanaged'){logger[_0x90b7('0x17')]('['+_0x47eb92[_0x90b7('0x18')]()+']',_0x90b7('0x5b'));emit(_0x553d84[_0x90b7('0x48')],_0x36e5c9[_0x90b7('0x5c')],_0x3b03c3[_0x90b7('0x38')],_0x59a20c[_0x90b7('0x45')]);}})[_0x90b7('0xc')](function(_0x16bc3b){logger[_0x90b7('0xd')]('['+_0x47eb92[_0x90b7('0x18')]()+_0x90b7('0x5d'),util[_0x90b7('0x5e')](_0x16bc3b,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xb040=['calleridnum','contacts','/systemusers(','headers','odata-entityid','lastIndexOf','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','enduserId','contactid',']\x20Enduser\x20created!','includes','string','picklist','nameField','substring','ticketType','incident','incidents','getString','Descriptions','/contacts(','Fields','phonecalls','assign','Subjects','callDirection','queue','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','trigger:browser:url','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:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','request-promise','util','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','clientId','remoteUri','username','password','clientSecret','then','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','userEmail','length','internalemailaddress','email','isdisabled','info',']\x20Agent\x20found\x20','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','toLowerCase','outbound','destcalleridnum'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb040,0x156));var _0x0b04=function(_0x231527,_0x1eb957){_0x231527=_0x231527-0x0;var _0x55bc37=_0xb040[_0x231527];return _0x55bc37;};'use strict';var _=require(_0x0b04('0x0'));var BPromise=require('bluebird');var rp=require(_0x0b04('0x1'));var util=require(_0x0b04('0x2'));var intUtil=require('./util');var md5=require('md5');var Redis=require('ioredis');var logger=require(_0x0b04('0x3'))(_0x0b04('0x4'));var config=require(_0x0b04('0x5'));config[_0x0b04('0x6')]=_[_0x0b04('0x7')](config['redis'],{'host':_0x0b04('0x8'),'port':0x18eb});var io=require(_0x0b04('0x9'))(new Redis(config[_0x0b04('0x6')]));function getAuthToken(_0x56af44,_0x593edb,_0x1debc3){var _0xeee25d={'method':_0x0b04('0xa'),'uri':_0x593edb,'form':{'client_id':_0x56af44[_0x0b04('0xb')],'resource':_0x56af44[_0x0b04('0xc')],'username':_0x56af44[_0x0b04('0xd')],'password':_0x56af44[_0x0b04('0xe')],'grant_type':_0x0b04('0xe'),'client_secret':_0x56af44[_0x0b04('0xf')]},'json':!![]};return rp(_0xeee25d)[_0x0b04('0x10')](function(_0x386a27){return _0x386a27['access_token'];})[_0x0b04('0x11')](function(_0x289eda){logger[_0x0b04('0x12')]('['+[_0x1debc3[_0x0b04('0x13')]()]+_0x0b04('0x14'));return _0x289eda[_0x0b04('0x15')];});}function getUser(_0x5bf5ed,_0x133733,_0x4bc84d,_0x5d7d6e,_0x4efe83,_0x2ed394){return new BPromise(function(_0x945c8e,_0x2e4f6e){return getAuthToken(_0x133733,_0x5d7d6e,_0x2ed394)[_0x0b04('0x10')](function(_0x567348){var _0x3c8228={'method':_0x0b04('0x16'),'uri':_0x4efe83+_0x0b04('0x17'),'headers':{'Authorization':_0x0b04('0x18')+_0x567348,'OData-Version':_0x0b04('0x19')},'json':!![]};return rp(_0x3c8228);})['then'](function(_0x221311){var _0x2dc2dc=_0x221311[_0x0b04('0x1a')];var _0x54bb81=![];var _0x10ddb7=null;if(!_[_0x0b04('0x1b')](_0x4bc84d)){if(intUtil[_0x0b04('0x1c')](_0x4bc84d['email'])){_0x5bf5ed[_0x0b04('0x1d')]=_0x4bc84d['email'];for(_0x10ddb7=0x0;_0x10ddb7<_0x2dc2dc[_0x0b04('0x1e')];_0x10ddb7++){if(_0x2dc2dc[_0x10ddb7][_0x0b04('0x1f')]===_0x4bc84d[_0x0b04('0x20')]&&!_0x2dc2dc[_0x10ddb7][_0x0b04('0x21')]){_0x54bb81=!![];logger[_0x0b04('0x22')]('['+[_0x2ed394[_0x0b04('0x13')]()]+_0x0b04('0x23')+_0x2dc2dc[_0x10ddb7][_0x0b04('0x24')]+'!');_0x5bf5ed['userId']=_0x2dc2dc[_0x10ddb7][_0x0b04('0x24')];}}}}if(!_0x54bb81){logger[_0x0b04('0x22')]('['+[_0x2ed394['toUpperCase']()]+_0x0b04('0x25'));_0x5bf5ed[_0x0b04('0x1d')]=_0x133733['username'];for(_0x10ddb7=0x0;_0x10ddb7<_0x2dc2dc[_0x0b04('0x1e')];_0x10ddb7++){if(_0x2dc2dc[_0x10ddb7][_0x0b04('0x1f')]===_0x133733[_0x0b04('0xd')]){_0x5bf5ed[_0x0b04('0x26')]=_0x2dc2dc[_0x10ddb7][_0x0b04('0x24')];}}}_0x945c8e(_0x5bf5ed);})[_0x0b04('0x11')](function(_0x23d509){_0x2e4f6e(_0x23d509[_0x0b04('0x15')]);});});}function createEndUser(_0x3f7cc4,_0x1ccc00,_0x907631,_0x3fb6c9,_0x320ba6,_0x43753f){return new BPromise(function(_0x31194c,_0x25bda2){return getAuthToken(_0x1ccc00,_0x907631,_0x43753f)['then'](function(_0x2cac36){var _0x1547c9=_0x43753f[_0x0b04('0x27')]()===_0x0b04('0x28')?_0x320ba6[_0x0b04('0x29')]:_0x320ba6[_0x0b04('0x2a')];var _0x3cd402={'method':'POST','uri':_0x3fb6c9+_0x0b04('0x2b'),'body':{'telephone1':_0x1547c9,'fullname':_0x1547c9,'firstname':_0x1547c9,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x0b04('0x2c')+_0x3f7cc4[_0x0b04('0x26')]+')'},'headers':{'Authorization':_0x0b04('0x18')+_0x2cac36,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x3cd402);})[_0x0b04('0x10')](function(_0x5f2a70){var _0x3209e9=_0x5f2a70[_0x0b04('0x2d')][_0x0b04('0x2e')];var _0x479c15=_0x3209e9['substring'](_0x3209e9[_0x0b04('0x2f')]('(')+0x1,_0x3209e9[_0x0b04('0x2f')](')'));_0x3f7cc4['enduserId']=_0x479c15;_0x31194c(_0x3f7cc4);})[_0x0b04('0x11')](function(_0x1833e1){_0x25bda2(_0x1833e1[_0x0b04('0x15')]);});});}function getEndUser(_0x5530ff,_0x28fc36,_0x5e9762,_0x137dec,_0x284ef4,_0x4a40c2){return new BPromise(function(_0xaff3b7,_0x53bfda){var _0xdb7133=_0x4a40c2[_0x0b04('0x27')]()==='outbound'?_0x284ef4[_0x0b04('0x29')]:_0x284ef4[_0x0b04('0x2a')];return getAuthToken(_0x28fc36,_0x5e9762,_0x4a40c2)[_0x0b04('0x10')](function(_0x386890){var _0x3a24a3={'method':_0x0b04('0x16'),'uri':_0x137dec+_0x0b04('0x30')+_0xdb7133[_0x0b04('0x31')]('+',_0x0b04('0x32'))+'\x27','headers':{'Authorization':_0x0b04('0x18')+_0x386890,'If-None-Match':null,'OData-Version':_0x0b04('0x19')},'json':!![]};return rp(_0x3a24a3);})['then'](function(_0x262ad1){var _0x581def=null;if(_0x262ad1){var _0x435880=_0x262ad1[_0x0b04('0x1a')];var _0xed6ada=![];for(_0x581def=0x0;_0x581def<_0x435880[_0x0b04('0x1e')];_0x581def++){if(_0x435880[_0x581def]['telephone1']===_0xdb7133){_0xed6ada=!![];_0x5530ff[_0x0b04('0x33')]=_0x435880[_0x581def][_0x0b04('0x34')];}}if(_0xed6ada){_0xaff3b7(_0x5530ff);}else{return createEndUser(_0x5530ff,_0x28fc36,_0x5e9762,_0x137dec,_0x284ef4,_0x4a40c2)['then'](function(_0x20c732){logger['info']('['+[_0x4a40c2['toUpperCase']()]+_0x0b04('0x35'),_0x20c732[_0x0b04('0x33')]);_0xaff3b7(_0x20c732);});}}else{return createEndUser(_0x5530ff,_0x28fc36,_0x5e9762,_0x137dec,_0x284ef4,_0x4a40c2)['then'](function(_0x1e4d01){logger[_0x0b04('0x22')]('['+[_0x4a40c2['toUpperCase']()]+']\x20Enduser\x20Created!',_0x1e4d01[_0x0b04('0x33')]);_0xaff3b7(_0x1e4d01);});}});});}function getCustomFields(_0x462922,_0xaa7e9c,_0x33cb74){var _0x4a84b7={};if(_0x462922['length']>0x0){_['forEach'](_0x462922,function(_0x475f7c){if(_[_0x0b04('0x36')]([_0x0b04('0x37'),_0x0b04('0x38')],_0x475f7c['type'])&&_0x475f7c[_0x0b04('0x39')]&&!_0x475f7c['customField']){var _0x2d2382=_0x475f7c['idField'][_0x0b04('0x27')]();var _0x3b0258=_0x2d2382[_0x0b04('0x3a')](0x0,_0x2d2382['indexOf']('_'));var _0x51e43e=_0x2d2382[_0x0b04('0x3a')](_0x2d2382['indexOf']('_')+0x1);if(_0x3b0258===_0x33cb74){_0x4a84b7[_0x51e43e]=_0x475f7c['content'];}}});}return _0x4a84b7;}function getTicket(_0x3c3845,_0x242dd0,_0x570dea,_0x1be360,_0x2bd3a2,_0x3cc09f,_0x234973){return new BPromise(function(_0x28461b,_0x5b5a21){var _0x2ad65a;return getAuthToken(_0x242dd0,_0x570dea,_0x234973)[_0x0b04('0x10')](function(_0x4e380f){if(_0x3cc09f[_0x0b04('0x3b')]===_0x0b04('0x3c')){_0x2ad65a={'method':_0x0b04('0xa'),'uri':_0x1be360+_0x0b04('0x3d'),'body':Object['assign']({},{'title':intUtil['getString'](_0x3cc09f['Subjects'],_0x2bd3a2,'\x20'),'description':intUtil[_0x0b04('0x3e')](_0x3cc09f[_0x0b04('0x3f')],_0x2bd3a2,'\x0a'),'customerid_contact@odata.bind':_0x0b04('0x40')+_0x3c3845[_0x0b04('0x33')]+')','ownerid@odata.bind':_0x0b04('0x2c')+_0x3c3845[_0x0b04('0x26')]+')','caseorigincode':'1'},getCustomFields(_0x3cc09f[_0x0b04('0x41')],_0x2bd3a2,_0x3cc09f[_0x0b04('0x3b')])),'headers':{'Authorization':_0x0b04('0x18')+_0x4e380f,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x3cc09f[_0x0b04('0x3b')]==='phonecall'){_0x2ad65a={'method':_0x0b04('0xa'),'uri':_0x1be360+_0x0b04('0x42'),'body':Object[_0x0b04('0x43')]({},{'subject':intUtil[_0x0b04('0x3e')](_0x3cc09f[_0x0b04('0x44')],_0x2bd3a2,'\x20'),'phonenumber':String(_0x2bd3a2[_0x0b04('0x2a')]),'description':intUtil[_0x0b04('0x3e')](_0x3cc09f['Descriptions'],_0x2bd3a2,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0x3c3845[_0x0b04('0x33')]+')','ownerid@odata.bind':_0x0b04('0x2c')+_0x3c3845[_0x0b04('0x26')]+')','directioncode':_0x3c3845[_0x0b04('0x45')]===_0x0b04('0x46')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x0b04('0x2c')+_0x3c3845[_0x0b04('0x26')]+')','participationtypemask':_0x3c3845[_0x0b04('0x45')]===_0x0b04('0x46')?0x2:0x1},{'partyid_contact@odata.bind':_0x0b04('0x40')+_0x3c3845['enduserId']+')','participationtypemask':_0x3c3845[_0x0b04('0x45')]===_0x0b04('0x46')?0x1:0x2}]},getCustomFields(_0x3cc09f[_0x0b04('0x41')],_0x2bd3a2,_0x3cc09f['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x4e380f,'OData-Version':_0x0b04('0x19')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x2ad65a);})[_0x0b04('0x10')](function(_0x3ff7c0){var _0x1dc023=_0x3ff7c0[_0x0b04('0x2d')]['odata-entityid'];var _0x2cabd3=_0x1dc023[_0x0b04('0x3a')](_0x1dc023['lastIndexOf']('(')+0x1,_0x1dc023['lastIndexOf'](')'));_0x3c3845['ticketId']=_0x2cabd3;_0x28461b(_0x3c3845);})['catch'](function(_0x1da398){_0x5b5a21(_0x1da398[_0x0b04('0x15')]);});});}function emit(_0x594949,_0xfa580c,_0x5406e5,_0x2f0031){var _0x8940fb={'uri':util[_0x0b04('0x47')](_0x0b04('0x48'),_0x594949,_0x5406e5,_0x2f0031)};io['to'](util['format']('user:%s',_0xfa580c))['emit'](_0x0b04('0x49'),_0x8940fb);}exports['cs']=function(_0x58e63b,_0x67dcc,_0x23d3ed,_0x5ed754,_0x5e8b49,_0x5a6b96,_0x56da99,_0x408600){var _0x34783f={};_0x5a6b96['remoteUri']=intUtil['stripTrailingSlash'](_0x5a6b96['remoteUri']);_0x5a6b96[_0x0b04('0x4a')]=intUtil['stripTrailingSlash'](_0x5a6b96[_0x0b04('0x4a')]);_0x34783f[_0x0b04('0x45')]=_0x408600===_0x0b04('0x46')||_0x408600===_0x0b04('0x4b')?'queue':_0x0b04('0x28');var _0x340308=util[_0x0b04('0x47')](_0x0b04('0x4c'),_0x5a6b96['remoteUri']);var _0x5d2cc3=util[_0x0b04('0x47')](_0x0b04('0x4d'),_0x5a6b96['tenantId']);var _0x2863c9=util[_0x0b04('0x47')](_0x0b04('0x4e'),_0x5a6b96[_0x0b04('0x4a')],_0x67dcc[_0x0b04('0x4f')],md5(_0x67dcc[_0x0b04('0x4f')]));if(_0x5e8b49&&_0x5e8b49[_0x0b04('0x50')]){logger[_0x0b04('0x22')](_0x0b04('0x51'),_0x0b04('0x52'));_0x67dcc[_0x0b04('0x53')]=_0x2863c9;}else if(_0x56da99&&_0x56da99[_0x0b04('0x54')]&&_0x56da99[_0x0b04('0x54')]!=='none'){logger[_0x0b04('0x22')](_0x0b04('0x55'),_0x0b04('0x52'));_0x67dcc[_0x0b04('0x53')]=_0x2863c9;}else{_0x67dcc[_0x0b04('0x53')]='';}return getUser(_0x34783f,_0x5a6b96,_0x5ed754,_0x5d2cc3,_0x340308,_0x408600)[_0x0b04('0x10')](function(_0x42e6e0){logger[_0x0b04('0x22')]('['+_0x408600[_0x0b04('0x13')]()+']\x20The\x20User\x20ID\x20is:',_0x42e6e0[_0x0b04('0x26')]);logger[_0x0b04('0x22')]('['+_0x408600['toUpperCase']()+_0x0b04('0x56'),_0x42e6e0[_0x0b04('0x1d')]);return getEndUser(_0x42e6e0,_0x5a6b96,_0x5d2cc3,_0x340308,_0x67dcc,_0x408600);})[_0x0b04('0x10')](function(_0x5ec551){logger[_0x0b04('0x22')]('['+_0x408600[_0x0b04('0x13')]()+_0x0b04('0x57'),_0x5ec551['enduserId']);logger['info']('['+_0x408600[_0x0b04('0x13')]()+_0x0b04('0x58'),_0x67dcc[_0x0b04('0x2a')]);return getTicket(_0x5ec551,_0x5a6b96,_0x5d2cc3,_0x340308,_0x67dcc,_0x23d3ed,_0x408600);})[_0x0b04('0x10')](function(_0x11d1c8){logger['info'](util[_0x0b04('0x47')]('['+_0x408600[_0x0b04('0x13')]()+_0x0b04('0x59'),_0x23d3ed[_0x0b04('0x3b')],_0x11d1c8[_0x0b04('0x5a')]));logger['info'](util[_0x0b04('0x47')]('['+_0x408600[_0x0b04('0x13')]()+_0x0b04('0x5b'),_0x408600));if(_0x408600!==_0x0b04('0x4b')){logger['info']('['+_0x408600[_0x0b04('0x13')]()+']',_0x0b04('0x5c'));emit(_0x5a6b96[_0x0b04('0xc')],_0x5ed754[_0x0b04('0x5d')],_0x23d3ed[_0x0b04('0x3b')],_0x11d1c8[_0x0b04('0x5a')]);}})[_0x0b04('0x11')](function(_0x18ac54){logger[_0x0b04('0x12')]('['+_0x408600['toUpperCase']()+_0x0b04('0x5e'),util[_0x0b04('0x5f')](_0x18ac54,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/freshdesk.js b/server/services/ami/trigger/integration/freshdesk.js index c9afa9b..d3c6be9 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 _0x141d=['Ticket\x20created!','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','error','outbound','serverUrl','recordingFormat','none','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','[OUTBOUND]','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','getString','Subjects','Descriptions','
','Tags','Fields','mapValues','keyBy','custom_fields','value','remoteUri','then','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','contact','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/contacts','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Enduser\x20created.','Basic\x20%s','base64','debug','stringify','GET','map','forEach','includes','picklist','type','nameField','toLowerCase','content','toString','idField','customField','push','variableName','customVariable','Variable','name','queue','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:'];(function(_0x43f881,_0xd6e5a2){var _0x365c14=function(_0x50d386){while(--_0x50d386){_0x43f881['push'](_0x43f881['shift']());}};_0x365c14(++_0xd6e5a2);}(_0x141d,0x133));var _0xd141=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x141d[_0x5b561d];return _0x431060;};'use strict';var _=require(_0xd141('0x0'));var rp=require(_0xd141('0x1'));var md5=require(_0xd141('0x2'));var util=require(_0xd141('0x3'));var Redis=require(_0xd141('0x4'));var intUtil=require(_0xd141('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xd141('0x6'));config[_0xd141('0x7')]=_[_0xd141('0x8')](config[_0xd141('0x7')],{'host':_0xd141('0x9'),'port':0x18eb});var io=require(_0xd141('0xa'))(new Redis(config[_0xd141('0x7')]));var headers={'Content-Type':_0xd141('0xb'),'Accept':'application/json'};function emit(_0x4a0884,_0x1559a5,_0x440b2a){io['to'](_0x4a0884)[_0xd141('0xc')](_0x1559a5,_0x440b2a);}function getTicket(_0x534d9f,_0x599960,_0x12beeb,_0x2af19e,_0x1011ae){logger[_0xd141('0xd')](_0xd141('0xe'));var _0x5b30d=_[_0xd141('0xf')]({'responder_id':_0x599960['id'],'requester_id':_0x12beeb['id'],'name':util[_0xd141('0x10')](_0xd141('0x11'),_0x1011ae[_0xd141('0x12')]),'phone':_0x1011ae['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xd141('0x13')](_0x2af19e[_0xd141('0x14')],_0x1011ae,'\x20'),'description':intUtil[_0xd141('0x13')](_0x2af19e[_0xd141('0x15')],_0x1011ae,_0xd141('0x16')),'tags':getTags(_0x2af19e[_0xd141('0x17')],'name')},getCustomFields(_0x2af19e[_0xd141('0x18')],_0x1011ae));_0x5b30d['custom_fields']=_[_0xd141('0x19')](_[_0xd141('0x1a')](_0x5b30d[_0xd141('0x1b')],'id'),_0xd141('0x1c'));return request({'uri':util[_0xd141('0x10')]('%s/api/v2/tickets',_0x534d9f[_0xd141('0x1d')]),'method':'POST','body':_0x5b30d})[_0xd141('0x1e')](function(_0x32e955){logger[_0xd141('0xd')]('Ticket\x20created!');return _0x32e955;});}function getUser(_0x4a8266,_0x267d9e){if(intUtil[_0xd141('0x1f')](_0x267d9e)){return request({'uri':util[_0xd141('0x10')](_0xd141('0x20'),_0x4a8266[_0xd141('0x1d')]),'qs':{'email':_0x267d9e}})[_0xd141('0x1e')](function(_0x28e4e1){if(_0x28e4e1[_0xd141('0x21')]){logger['info'](_0xd141('0x22'));return _[_0xd141('0x23')](_0x28e4e1,function(_0x34135c){return _0x34135c[_0xd141('0x24')]['email']===_0x267d9e;});}else{logger[_0xd141('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0xd141('0x25'),_0x4a8266[_0xd141('0x1d')])})[_0xd141('0x1e')](function(_0x3f7805){logger[_0xd141('0xd')](_0xd141('0x26'));return _0x3f7805;});}});}else{logger[_0xd141('0xd')](_0xd141('0x27'));return request({'uri':util[_0xd141('0x10')](_0xd141('0x25'),_0x4a8266[_0xd141('0x1d')])})[_0xd141('0x1e')](function(_0x33af6f){logger['info'](_0xd141('0x26'));return _0x33af6f;});}}function getEndUser(_0x2e9db4,_0x23cd13,_0x1cd339){logger[_0xd141('0xd')]('Searching\x20enduser\x20with\x20phone',_0x1cd339);return request({'uri':util['format'](_0xd141('0x28'),_0x2e9db4[_0xd141('0x1d')]),'qs':{'phone':_0x1cd339}})[_0xd141('0x1e')](function(_0x22c64b){if(_0x22c64b['length']){logger[_0xd141('0xd')]('Enduser\x20found!');return _['find'](_0x22c64b,{'phone':_0x1cd339});}else{logger[_0xd141('0xd')](_0xd141('0x29'));return request({'uri':util[_0xd141('0x10')](_0xd141('0x28'),_0x2e9db4[_0xd141('0x1d')]),'method':_0xd141('0x2a'),'body':{'name':_0x23cd13,'phone':_0x1cd339}})[_0xd141('0x1e')](function(_0x56804f){logger['info'](_0xd141('0x2b'));return _0x56804f;});}});}function getAuth(_0xd0cd01){return util[_0xd141('0x10')](_0xd141('0x2c'),new Buffer(_0xd0cd01['apiKey']+':X')['toString'](_0xd141('0x2d')));}function request(_0x2c019b){logger[_0xd141('0x2e')]('[HTTP]',JSON[_0xd141('0x2f')](_0x2c019b));return rp(_[_0xd141('0x8')](_0x2c019b,{'method':_0xd141('0x30'),'headers':headers,'json':!![]}));}function getTags(_0x3bee9d,_0x89d06d){var _0x2db35d=[];if(_0x3bee9d&&_0x3bee9d[_0xd141('0x21')]>0x0){_0x2db35d=_[_0xd141('0x31')](_0x3bee9d,_0x89d06d);}return _0x2db35d;}function getCustomFields(_0x243209,_0x32307b){var _0x1f9fa5=[];var _0xc7dfd2={'custom_fields':[]};if(_0x243209['length']>0x0){_[_0xd141('0x32')](_0x243209,function(_0x222468){if(_[_0xd141('0x33')](['string',_0xd141('0x34')],_0x222468[_0xd141('0x35')])&&_0x222468[_0xd141('0x36')]&&!_0x222468['customField']){_0xc7dfd2[_0x222468[_0xd141('0x36')][_0xd141('0x37')]()]=_0x222468[_0xd141('0x38')][_0xd141('0x39')]();}else if(_['includes'](['string',_0xd141('0x34')],_0x222468[_0xd141('0x35')])&&_0x222468[_0xd141('0x3a')]&&_0x222468[_0xd141('0x3b')]){_0xc7dfd2[_0xd141('0x1b')][_0xd141('0x3c')]({'id':_0x222468['idField'],'value':_0x222468['content'][_0xd141('0x39')]()});}else if(_0x222468[_0xd141('0x35')]==='variable'&&_0x222468[_0xd141('0x3d')]&&_0x222468[_0xd141('0x3a')]&&_0x222468['customField']){_0x32307b[_0x222468['variableName']]&&_0xc7dfd2[_0xd141('0x1b')][_0xd141('0x3c')]({'id':_0x222468[_0xd141('0x3a')],'value':_0x32307b[_0x222468[_0xd141('0x3d')]]['toString']()});}else if(_0x222468['type']===_0xd141('0x3e')&&_0x222468[_0xd141('0x3f')]&&_0x222468['Variable'][_0xd141('0x40')]&&_0x222468['idField']&&_0x222468[_0xd141('0x3b')]){_0x32307b[_0x222468['Variable']['name'][_0xd141('0x37')]()]&&_0xc7dfd2[_0xd141('0x1b')][_0xd141('0x3c')]({'id':_0x222468[_0xd141('0x3a')],'value':_0x32307b[_0x222468[_0xd141('0x3f')][_0xd141('0x40')][_0xd141('0x37')]()]['toString']()});}});}return _0xc7dfd2;}exports[_0xd141('0x41')]=function(_0x224e18,_0x4f1445,_0x282ed9,_0x33380e,_0x5008a6,_0x28fca4){var _0x4128f8,_0x368967;_0x28fca4[_0xd141('0x1d')]=intUtil[_0xd141('0x42')](_0x28fca4[_0xd141('0x1d')]);_0x28fca4['serverUrl']=intUtil[_0xd141('0x42')](_0x28fca4['serverUrl']);if(_0x5008a6&&_0x5008a6[_0xd141('0x43')]){logger['info'](_0xd141('0x44'),'Recording\x20is\x20enabled!');_0x4f1445[_0xd141('0x45')]=util[_0xd141('0x10')](_0xd141('0x46'),_0x28fca4['serverUrl'],_0x4f1445[_0xd141('0x47')],md5(_0x4f1445[_0xd141('0x47')]));}else{_0x4f1445[_0xd141('0x45')]='';}headers[_0xd141('0x48')]=getAuth(_0x28fca4);return getUser(_0x28fca4,_0x33380e[_0xd141('0x49')])[_0xd141('0x1e')](function(_0x3d5027){_0x4128f8=_0x3d5027;logger['info'](_0xd141('0x4a'),_0x4128f8['id']);return getEndUser(_0x28fca4,_0x4f1445[_0xd141('0x12')],_0x4f1445[_0xd141('0x4b')]);})['then'](function(_0x4277fe){_0x368967=_0x4277fe;logger['info'](_0xd141('0x4c'),_0x368967['id']);return getTicket(_0x28fca4,_0x4128f8,_0x368967,_0x282ed9,_0x4f1445);})[_0xd141('0x1e')](function(_0x592958){if(_0x592958&&_0x592958['id']){logger[_0xd141('0xd')](_0xd141('0x4d'));logger[_0xd141('0xd')](_0xd141('0x4e'),_0x592958['id']);logger[_0xd141('0xd')](_0xd141('0x44'),_0xd141('0x4f'));emit(util[_0xd141('0x10')]('user:%s',_0x33380e[_0xd141('0x40')]),'trigger:browser:url',{'uri':util[_0xd141('0x10')]('%s/helpdesk/tickets/%d',_0x28fca4[_0xd141('0x1d')],_0x592958['id'])});}})[_0xd141('0x50')](function(_0x47e45c){logger[_0xd141('0x51')]('[QUEUE]',JSON[_0xd141('0x2f')](_0x47e45c));});};exports[_0xd141('0x52')]=function(_0x553b81,_0x3a6dd9,_0x794ce6,_0x5bb2f9,_0x597cc8,_0x4a3564,_0xa2f7e5){var _0x64dc08,_0x39bc1c;_0x4a3564[_0xd141('0x1d')]=intUtil[_0xd141('0x42')](_0x4a3564['remoteUri']);_0x4a3564[_0xd141('0x53')]=intUtil[_0xd141('0x42')](_0x4a3564[_0xd141('0x53')]);if(_0xa2f7e5&&_0xa2f7e5['recordingFormat']&&_0xa2f7e5[_0xd141('0x54')]!==_0xd141('0x55')){logger[_0xd141('0xd')]('[OUTBOUND]',_0xd141('0x56'));_0x3a6dd9[_0xd141('0x45')]=util[_0xd141('0x10')](_0xd141('0x46'),_0x4a3564[_0xd141('0x53')],_0x3a6dd9['uniqueid'],md5(_0x3a6dd9[_0xd141('0x47')]));}headers[_0xd141('0x48')]=getAuth(_0x4a3564);return getUser(_0x4a3564,_0x5bb2f9['email'])[_0xd141('0x1e')](function(_0x29a8d4){_0x64dc08=_0x29a8d4;logger[_0xd141('0xd')](_0xd141('0x4a'),_0x64dc08['id']);return getEndUser(_0x4a3564,_0x3a6dd9[_0xd141('0x57')],_0x3a6dd9[_0xd141('0x58')]);})['then'](function(_0x117db6){_0x39bc1c=_0x117db6;logger[_0xd141('0xd')](_0xd141('0x4c'),_0x39bc1c['id']);return getTicket(_0x4a3564,_0x64dc08,_0x39bc1c,_0x794ce6,_0x3a6dd9);})[_0xd141('0x1e')](function(_0x237f40){if(_0x237f40&&_0x237f40['id']){logger[_0xd141('0xd')](_0xd141('0x4d'));logger[_0xd141('0xd')](_0xd141('0x4e'),_0x237f40['id']);logger[_0xd141('0xd')](_0xd141('0x59'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xd141('0x10')](_0xd141('0x5a'),_0x5bb2f9[_0xd141('0x40')]),_0xd141('0x5b'),{'uri':util['format'](_0xd141('0x5c'),_0x4a3564[_0xd141('0x1d')],_0x237f40['id'])});}})[_0xd141('0x50')](function(_0x40f744){logger[_0xd141('0x51')](_0xd141('0x59'),JSON[_0xd141('0x2f')](_0x40f744));});};exports[_0xd141('0x5d')]=function(_0x429d34,_0x5d2266,_0x40f063,_0x12c860,_0x135ad9,_0x4afcdf){var _0x3cb1fc,_0x5c4d8b;_0x4afcdf[_0xd141('0x1d')]=intUtil[_0xd141('0x42')](_0x4afcdf['remoteUri']);_0x4afcdf[_0xd141('0x53')]=intUtil[_0xd141('0x42')](_0x4afcdf[_0xd141('0x53')]);if(_0x135ad9&&_0x135ad9[_0xd141('0x43')]){logger[_0xd141('0xd')]('['+_0x5d2266[_0xd141('0x5e')][_0xd141('0x5f')]()+']',_0xd141('0x56'));_0x5d2266[_0xd141('0x45')]=util[_0xd141('0x10')](_0xd141('0x46'),_0x4afcdf[_0xd141('0x53')],_0x5d2266[_0xd141('0x47')],md5(_0x5d2266[_0xd141('0x47')]));}else{_0x5d2266['recordingURL']='';}headers[_0xd141('0x48')]=getAuth(_0x4afcdf);return getUser(_0x4afcdf,'')[_0xd141('0x1e')](function(_0x6f48b){_0x3cb1fc=_0x6f48b;logger['info']('The\x20User\x20ID\x20is:',_0x3cb1fc['id']);return getEndUser(_0x4afcdf,_0x5d2266[_0xd141('0x12')],_0x5d2266[_0xd141('0x4b')]);})[_0xd141('0x1e')](function(_0x1ac5d9){_0x5c4d8b=_0x1ac5d9;logger[_0xd141('0xd')](_0xd141('0x4c'),_0x5c4d8b['id']);return getTicket(_0x4afcdf,_0x3cb1fc,_0x5c4d8b,_0x40f063,_0x5d2266);})[_0xd141('0x1e')](function(_0x32cea8){if(_0x32cea8){logger[_0xd141('0xd')](_0xd141('0x4d'));logger[_0xd141('0xd')](_0xd141('0x4e'),_0x32cea8['id']);}})['catch'](function(_0x4e7d88){logger[_0xd141('0x51')]('['+_0x5d2266[_0xd141('0x5e')][_0xd141('0x5f')]()+']',JSON['stringify'](_0x4e7d88));});}; \ No newline at end of file +var _0x2582=['getString','Descriptions','
','Tags','name','keyBy','custom_fields','value','%s/api/v2/tickets','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','remoteUri','contact','email','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','length','Enduser\x20found!','find','Enduser\x20created.','Basic\x20%s','toString','base64','[HTTP]','stringify','defaults','GET','map','forEach','includes','string','picklist','type','customField','nameField','toLowerCase','content','push','idField','variable','variableName','customVariable','Variable','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','outbound','serverUrl','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','error','unmanaged','lastevent','toUpperCase','request-promise','util','ioredis','./util','../../../../config/logger','redis','localhost','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','Subjects'];(function(_0x466b83,_0x2fa26c){var _0xa1a2e2=function(_0x2de045){while(--_0x2de045){_0x466b83['push'](_0x466b83['shift']());}};_0xa1a2e2(++_0x2fa26c);}(_0x2582,0x103));var _0x2258=function(_0x1e5cc0,_0x5260ec){_0x1e5cc0=_0x1e5cc0-0x0;var _0x3b6f1b=_0x2582[_0x1e5cc0];return _0x3b6f1b;};'use strict';var _=require('lodash');var rp=require(_0x2258('0x0'));var md5=require('md5');var util=require(_0x2258('0x1'));var Redis=require(_0x2258('0x2'));var intUtil=require(_0x2258('0x3'));var config=require('../../../../config/environment');var logger=require(_0x2258('0x4'))('freshdesk');config[_0x2258('0x5')]=_['defaults'](config[_0x2258('0x5')],{'host':_0x2258('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2258('0x5')]));var headers={'Content-Type':_0x2258('0x7'),'Accept':'application/json'};function emit(_0x41f1b2,_0x928ee6,_0x431e20){io['to'](_0x41f1b2)[_0x2258('0x8')](_0x928ee6,_0x431e20);}function getTicket(_0x337cc9,_0x2b892a,_0x15cdba,_0x25f8ff,_0x2c8203){logger[_0x2258('0x9')](_0x2258('0xa'));var _0x5b4a9f=_[_0x2258('0xb')]({'responder_id':_0x2b892a['id'],'requester_id':_0x15cdba['id'],'name':util[_0x2258('0xc')](_0x2258('0xd'),_0x2c8203[_0x2258('0xe')]),'phone':_0x2c8203[_0x2258('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x25f8ff[_0x2258('0x10')],_0x2c8203,'\x20'),'description':intUtil[_0x2258('0x11')](_0x25f8ff[_0x2258('0x12')],_0x2c8203,_0x2258('0x13')),'tags':getTags(_0x25f8ff[_0x2258('0x14')],_0x2258('0x15'))},getCustomFields(_0x25f8ff['Fields'],_0x2c8203));_0x5b4a9f['custom_fields']=_['mapValues'](_[_0x2258('0x16')](_0x5b4a9f[_0x2258('0x17')],'id'),_0x2258('0x18'));return request({'uri':util['format'](_0x2258('0x19'),_0x337cc9['remoteUri']),'method':_0x2258('0x1a'),'body':_0x5b4a9f})[_0x2258('0x1b')](function(_0x27c1e5){logger[_0x2258('0x9')](_0x2258('0x1c'));return _0x27c1e5;});}function getUser(_0x14ae74,_0x122832){if(intUtil[_0x2258('0x1d')](_0x122832)){return request({'uri':util[_0x2258('0xc')](_0x2258('0x1e'),_0x14ae74[_0x2258('0x1f')]),'qs':{'email':_0x122832}})[_0x2258('0x1b')](function(_0x1efac5){if(_0x1efac5['length']){logger[_0x2258('0x9')]('Agent\x20found!');return _['find'](_0x1efac5,function(_0x8c6b5e){return _0x8c6b5e[_0x2258('0x20')][_0x2258('0x21')]===_0x122832;});}else{logger[_0x2258('0x9')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x2258('0xc')]('%s/api/v2/agents/me',_0x14ae74[_0x2258('0x1f')])})['then'](function(_0x379b20){logger[_0x2258('0x9')](_0x2258('0x22'));return _0x379b20;});}});}else{logger[_0x2258('0x9')](_0x2258('0x23'));return request({'uri':util[_0x2258('0xc')](_0x2258('0x24'),_0x14ae74[_0x2258('0x1f')])})[_0x2258('0x1b')](function(_0x17602f){logger['info']('Admin\x20account\x20selected.');return _0x17602f;});}}function getEndUser(_0x3f6cd1,_0x30165c,_0x2cff4b){logger[_0x2258('0x9')](_0x2258('0x25'),_0x2cff4b);return request({'uri':util[_0x2258('0xc')](_0x2258('0x26'),_0x3f6cd1[_0x2258('0x1f')]),'qs':{'phone':_0x2cff4b}})[_0x2258('0x1b')](function(_0x3c6013){if(_0x3c6013[_0x2258('0x27')]){logger['info'](_0x2258('0x28'));return _[_0x2258('0x29')](_0x3c6013,{'phone':_0x2cff4b});}else{logger[_0x2258('0x9')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format'](_0x2258('0x26'),_0x3f6cd1[_0x2258('0x1f')]),'method':'POST','body':{'name':_0x30165c,'phone':_0x2cff4b}})['then'](function(_0x471407){logger['info'](_0x2258('0x2a'));return _0x471407;});}});}function getAuth(_0x6bc5f7){return util['format'](_0x2258('0x2b'),new Buffer(_0x6bc5f7['apiKey']+':X')[_0x2258('0x2c')](_0x2258('0x2d')));}function request(_0x2ad082){logger['debug'](_0x2258('0x2e'),JSON[_0x2258('0x2f')](_0x2ad082));return rp(_[_0x2258('0x30')](_0x2ad082,{'method':_0x2258('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x31784e,_0x515d94){var _0x33436f=[];if(_0x31784e&&_0x31784e[_0x2258('0x27')]>0x0){_0x33436f=_[_0x2258('0x32')](_0x31784e,_0x515d94);}return _0x33436f;}function getCustomFields(_0x24b8c8,_0x477063){var _0x2f64c2=[];var _0x186676={'custom_fields':[]};if(_0x24b8c8['length']>0x0){_[_0x2258('0x33')](_0x24b8c8,function(_0x2202fa){if(_[_0x2258('0x34')]([_0x2258('0x35'),_0x2258('0x36')],_0x2202fa[_0x2258('0x37')])&&_0x2202fa['nameField']&&!_0x2202fa[_0x2258('0x38')]){_0x186676[_0x2202fa[_0x2258('0x39')][_0x2258('0x3a')]()]=_0x2202fa[_0x2258('0x3b')][_0x2258('0x2c')]();}else if(_[_0x2258('0x34')](['string',_0x2258('0x36')],_0x2202fa[_0x2258('0x37')])&&_0x2202fa['idField']&&_0x2202fa['customField']){_0x186676['custom_fields'][_0x2258('0x3c')]({'id':_0x2202fa[_0x2258('0x3d')],'value':_0x2202fa[_0x2258('0x3b')]['toString']()});}else if(_0x2202fa[_0x2258('0x37')]===_0x2258('0x3e')&&_0x2202fa[_0x2258('0x3f')]&&_0x2202fa[_0x2258('0x3d')]&&_0x2202fa[_0x2258('0x38')]){_0x477063[_0x2202fa[_0x2258('0x3f')]]&&_0x186676[_0x2258('0x17')][_0x2258('0x3c')]({'id':_0x2202fa[_0x2258('0x3d')],'value':_0x477063[_0x2202fa[_0x2258('0x3f')]][_0x2258('0x2c')]()});}else if(_0x2202fa[_0x2258('0x37')]===_0x2258('0x40')&&_0x2202fa[_0x2258('0x41')]&&_0x2202fa['Variable'][_0x2258('0x15')]&&_0x2202fa[_0x2258('0x3d')]&&_0x2202fa[_0x2258('0x38')]){_0x477063[_0x2202fa[_0x2258('0x41')]['name'][_0x2258('0x3a')]()]&&_0x186676[_0x2258('0x17')]['push']({'id':_0x2202fa[_0x2258('0x3d')],'value':_0x477063[_0x2202fa[_0x2258('0x41')]['name'][_0x2258('0x3a')]()]['toString']()});}});}return _0x186676;}exports['queue']=function(_0x1b0186,_0xf3e9c4,_0x43812b,_0x5185f7,_0x51b473,_0x3d17d0){var _0xe89ce7,_0x5e1302;_0x3d17d0['remoteUri']=intUtil[_0x2258('0x42')](_0x3d17d0[_0x2258('0x1f')]);_0x3d17d0['serverUrl']=intUtil[_0x2258('0x42')](_0x3d17d0['serverUrl']);if(_0x51b473&&_0x51b473[_0x2258('0x43')]){logger[_0x2258('0x9')](_0x2258('0x44'),'Recording\x20is\x20enabled!');_0xf3e9c4[_0x2258('0x45')]=util['format'](_0x2258('0x46'),_0x3d17d0['serverUrl'],_0xf3e9c4[_0x2258('0x47')],md5(_0xf3e9c4['uniqueid']));}else{_0xf3e9c4['recordingURL']='';}headers[_0x2258('0x48')]=getAuth(_0x3d17d0);return getUser(_0x3d17d0,_0x5185f7['email'])[_0x2258('0x1b')](function(_0x1ab4d1){_0xe89ce7=_0x1ab4d1;logger[_0x2258('0x9')](_0x2258('0x49'),_0xe89ce7['id']);return getEndUser(_0x3d17d0,_0xf3e9c4[_0x2258('0xe')],_0xf3e9c4[_0x2258('0xf')]);})[_0x2258('0x1b')](function(_0x2f4b22){_0x5e1302=_0x2f4b22;logger[_0x2258('0x9')](_0x2258('0x4a'),_0x5e1302['id']);return getTicket(_0x3d17d0,_0xe89ce7,_0x5e1302,_0x43812b,_0xf3e9c4);})[_0x2258('0x1b')](function(_0x508a8e){if(_0x508a8e&&_0x508a8e['id']){logger[_0x2258('0x9')](_0x2258('0x1c'));logger[_0x2258('0x9')](_0x2258('0x4b'),_0x508a8e['id']);logger['info'](_0x2258('0x44'),_0x2258('0x4c'));emit(util[_0x2258('0xc')](_0x2258('0x4d'),_0x5185f7[_0x2258('0x15')]),_0x2258('0x4e'),{'uri':util['format'](_0x2258('0x4f'),_0x3d17d0[_0x2258('0x1f')],_0x508a8e['id'])});}})[_0x2258('0x50')](function(_0x3f975b){logger['error'](_0x2258('0x44'),JSON[_0x2258('0x2f')](_0x3f975b));});};exports[_0x2258('0x51')]=function(_0x34d5e0,_0x125159,_0x3c8878,_0x130f84,_0x33faab,_0x564a97,_0x21fe10){var _0x4a7eed,_0x53f0b6;_0x564a97[_0x2258('0x1f')]=intUtil[_0x2258('0x42')](_0x564a97[_0x2258('0x1f')]);_0x564a97[_0x2258('0x52')]=intUtil[_0x2258('0x42')](_0x564a97[_0x2258('0x52')]);if(_0x21fe10&&_0x21fe10[_0x2258('0x53')]&&_0x21fe10[_0x2258('0x53')]!==_0x2258('0x54')){logger['info'](_0x2258('0x55'),_0x2258('0x56'));_0x125159['recordingURL']=util[_0x2258('0xc')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x564a97['serverUrl'],_0x125159[_0x2258('0x47')],md5(_0x125159[_0x2258('0x47')]));}headers[_0x2258('0x48')]=getAuth(_0x564a97);return getUser(_0x564a97,_0x130f84[_0x2258('0x21')])[_0x2258('0x1b')](function(_0x5df98a){_0x4a7eed=_0x5df98a;logger[_0x2258('0x9')](_0x2258('0x49'),_0x4a7eed['id']);return getEndUser(_0x564a97,_0x125159[_0x2258('0x57')],_0x125159['destcalleridnum']);})[_0x2258('0x1b')](function(_0xa06676){_0x53f0b6=_0xa06676;logger['info'](_0x2258('0x4a'),_0x53f0b6['id']);return getTicket(_0x564a97,_0x4a7eed,_0x53f0b6,_0x3c8878,_0x125159);})[_0x2258('0x1b')](function(_0x4fe69c){if(_0x4fe69c&&_0x4fe69c['id']){logger['info'](_0x2258('0x1c'));logger[_0x2258('0x9')]('The\x20Ticket\x20ID\x20is:',_0x4fe69c['id']);logger[_0x2258('0x9')](_0x2258('0x55'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x2258('0xc')](_0x2258('0x4d'),_0x130f84['name']),_0x2258('0x4e'),{'uri':util[_0x2258('0xc')](_0x2258('0x4f'),_0x564a97[_0x2258('0x1f')],_0x4fe69c['id'])});}})[_0x2258('0x50')](function(_0x392bfe){logger[_0x2258('0x58')](_0x2258('0x55'),JSON[_0x2258('0x2f')](_0x392bfe));});};exports[_0x2258('0x59')]=function(_0x494d24,_0x5f0efb,_0x1f844b,_0x18c899,_0x3de76c,_0x3540c8){var _0x239f51,_0x21b7e8;_0x3540c8['remoteUri']=intUtil[_0x2258('0x42')](_0x3540c8[_0x2258('0x1f')]);_0x3540c8[_0x2258('0x52')]=intUtil[_0x2258('0x42')](_0x3540c8[_0x2258('0x52')]);if(_0x3de76c&&_0x3de76c[_0x2258('0x43')]){logger[_0x2258('0x9')]('['+_0x5f0efb[_0x2258('0x5a')][_0x2258('0x5b')]()+']','Recording\x20is\x20enabled!');_0x5f0efb[_0x2258('0x45')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3540c8[_0x2258('0x52')],_0x5f0efb['uniqueid'],md5(_0x5f0efb[_0x2258('0x47')]));}else{_0x5f0efb[_0x2258('0x45')]='';}headers[_0x2258('0x48')]=getAuth(_0x3540c8);return getUser(_0x3540c8,'')[_0x2258('0x1b')](function(_0x29424a){_0x239f51=_0x29424a;logger[_0x2258('0x9')]('The\x20User\x20ID\x20is:',_0x239f51['id']);return getEndUser(_0x3540c8,_0x5f0efb[_0x2258('0xe')],_0x5f0efb[_0x2258('0xf')]);})[_0x2258('0x1b')](function(_0x14e52a){_0x21b7e8=_0x14e52a;logger[_0x2258('0x9')](_0x2258('0x4a'),_0x21b7e8['id']);return getTicket(_0x3540c8,_0x239f51,_0x21b7e8,_0x1f844b,_0x5f0efb);})[_0x2258('0x1b')](function(_0x22a482){if(_0x22a482){logger['info'](_0x2258('0x1c'));logger[_0x2258('0x9')](_0x2258('0x4b'),_0x22a482['id']);}})[_0x2258('0x50')](function(_0xf9ed5c){logger[_0x2258('0x58')]('['+_0x5f0efb['lastevent'][_0x2258('0x5b')]()+']',JSON[_0x2258('0x2f')](_0xf9ed5c));});}; \ 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 93a7a98..e50a53a 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 _0xd393=['message','Getting\x20user\x20with\x20email','agentEmail','userEmail','User\x20found:','userId','Admin\x20selected','adminId','toUpperCase','&entities=contact','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','POST','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Contact','add','ticketId','task','/contacts/','user:%s','emit','trigger:browser:url','apiKey','stripTrailingSlash','serverUrl','remoteUri','username','toLowerCase','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]','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','util','moment','bluebird','ioredis','./util','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','length','email','adminEmail','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error'];(function(_0x627b1b,_0x462114){var _0x2fd022=function(_0x2059c5){while(--_0x2059c5){_0x627b1b['push'](_0x627b1b['shift']());}};_0x2fd022(++_0x462114);}(_0xd393,0x12c));var _0x3d39=function(_0x25af72,_0x5ef6d2){_0x25af72=_0x25af72-0x0;var _0x310697=_0xd393[_0x25af72];return _0x310697;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require('md5');var util=require(_0x3d39('0x0'));var moment=require(_0x3d39('0x1'));var Promise=require(_0x3d39('0x2'));var Redis=require(_0x3d39('0x3'));var intUtil=require(_0x3d39('0x4'));var config=require('../../../../config/environment');var logger=require(_0x3d39('0x5'))('freshsales');config[_0x3d39('0x6')]=_[_0x3d39('0x7')](config['redis'],{'host':_0x3d39('0x8'),'port':0x18eb});var io=require(_0x3d39('0x9'))(new Redis(config[_0x3d39('0x6')]));function getAdminId(_0x1f27da,_0x5ddd24,_0x51dae5,_0x45e12d){return new Promise(function(_0x4c7261,_0x418622){var _0x13150a=![];var _0x34e0f3={'method':_0x3d39('0xa'),'uri':_0x45e12d+_0x3d39('0xb'),'json':!![]};_0x34e0f3[_0x3d39('0xc')]=_0x51dae5;logger[_0x3d39('0xd')](_0x3d39('0xe'));return rp(_0x34e0f3)[_0x3d39('0xf')](function(_0x48d5e0){if(_0x48d5e0){var _0x5147b8=_0x48d5e0[_0x3d39('0x10')];var _0x2dc2fa=null;for(_0x2dc2fa=0x0;_0x2dc2fa<_0x5147b8[_0x3d39('0x11')];_0x2dc2fa++){if(_0x5147b8[_0x2dc2fa][_0x3d39('0x12')]===_0x1f27da[_0x3d39('0x13')]){_0x1f27da['adminId']=_0x5147b8[_0x2dc2fa]['id'];_0x13150a=!![];}}if(_0x13150a){logger['info'](_0x3d39('0x14'),_0x1f27da['adminId']);_0x4c7261(_0x1f27da);}else{_0x418622({'statusCode':0x194,'message':_0x3d39('0x15')});}}else{_0x418622({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x3d39('0x16')](function(_0x3aff43){logger[_0x3d39('0x17')]('['+[_0x5ddd24['toUpperCase']()]+']',_0x3aff43[_0x3d39('0x18')]);_0x418622(_0x3aff43);});});}function getUser(_0x3e18e7,_0x2124a1,_0x162c3e){return function(_0x163a0b){return new Promise(function(_0xec4000,_0xfbf68a){var _0x1f36ef={'method':'GET','uri':_0x162c3e+_0x3d39('0xb'),'json':!![]};_0x1f36ef[_0x3d39('0xc')]=_0x2124a1;logger[_0x3d39('0xd')]('Getting\x20user\x20list');return rp(_0x1f36ef)['then'](function(_0x5a89e3){if(_0x5a89e3){var _0x9c7675=_0x5a89e3[_0x3d39('0x10')];var _0x2ef79=![];var _0x465a46=null;if(_0x163a0b['agentEmail']!==null){logger['info'](_0x3d39('0x19'),_0x163a0b[_0x3d39('0x1a')]);_0x163a0b[_0x3d39('0x1b')]=_0x163a0b[_0x3d39('0x1a')];for(_0x465a46=0x0;_0x465a46<_0x9c7675[_0x3d39('0x11')];_0x465a46++){if(_0x9c7675[_0x465a46][_0x3d39('0x12')]===_0x163a0b['agentEmail']){_0x2ef79=!![];_0x163a0b['userId']=_0x9c7675[_0x465a46]['id'];logger[_0x3d39('0xd')](_0x3d39('0x1c'),_0x163a0b[_0x3d39('0x1d')]);}}}if(!_0x2ef79){logger[_0x3d39('0xd')](_0x3d39('0x1e'));_0x163a0b[_0x3d39('0x1b')]=_0x163a0b[_0x3d39('0x13')];_0x163a0b[_0x3d39('0x1d')]=_0x163a0b[_0x3d39('0x1f')];_0x2ef79=!![];}if(_0x2ef79){_0xec4000(_0x163a0b);}else{_0xfbf68a({'statusCode':0x194,'message':_0x3d39('0x15')});}}else{_0xfbf68a({'statusCode':0x194,'message':_0x3d39('0x15')});}})[_0x3d39('0x16')](function(_0x3f0691){logger[_0x3d39('0x17')]('['+[_0x3e18e7[_0x3d39('0x20')]()]+']',_0x3f0691[_0x3d39('0x18')]);_0xfbf68a(_0x3f0691);});});};}function searchContact(_0x1c0de1,_0x5ac703,_0x9f7247,_0x55f52a){return new Promise(function(_0x27ba0b,_0x29d4b9){var _0x433ff9={'method':_0x3d39('0xa'),'headers':_0x5ac703,'uri':_0x1c0de1+'/api/lookup?q='+_0x55f52a+'&f='+_0x9f7247+_0x3d39('0x21'),'json':!![]};rp(_0x433ff9)[_0x3d39('0xf')](function(_0x57527b){var _0x5654cc=_['find'](_0x57527b[_0x3d39('0x22')][_0x3d39('0x22')],[_0x9f7247,_0x55f52a]);_0x27ba0b(_0x5654cc);})[_0x3d39('0x16')](function(_0x16b3eb){_0x29d4b9(_0x16b3eb);});});}function getEndUser(_0x5542bc,_0x3ac1fe,_0x24f341){return function(_0x5462d5){return new Promise(function(_0x400002,_0x16c351){logger['info'](util[_0x3d39('0x23')](_0x3d39('0x24'),_0x5462d5[_0x3d39('0x25')]));searchContact(_0x24f341,_0x3ac1fe,'mobile_number',_0x5462d5['contactNumber'])[_0x3d39('0xf')](function(_0xa60182){if(_0xa60182){_0x5462d5[_0x3d39('0x26')]=_0xa60182['id'];logger[_0x3d39('0xd')](_0x3d39('0x27'),_0x5462d5['endUserId']);return _0x400002(_0x5462d5);}searchContact(_0x24f341,_0x3ac1fe,_0x3d39('0x28'),_0x5462d5['contactNumber'])[_0x3d39('0xf')](function(_0x16ba88){if(_0x16ba88){_0x5462d5['endUserId']=_0x16ba88['id'];logger[_0x3d39('0xd')](_0x3d39('0x29'),_0x5462d5[_0x3d39('0x26')]);return _0x400002(_0x5462d5);}createEndUser(_0x5462d5,_0x5542bc,_0x3ac1fe,_0x24f341)[_0x3d39('0xf')](function(_0x4fc325){logger[_0x3d39('0xd')]('Contact\x20created:',_0x4fc325[_0x3d39('0x26')]);return _0x400002(_0x4fc325);});});})[_0x3d39('0x16')](function(_0x44ef4b){_0x16c351(_0x44ef4b);});});};}function createEndUser(_0xe5e795,_0x2bd0a5,_0x25fefc,_0x444ea7){return new Promise(function(_0xdbf424,_0x803c76){var _0x439939=moment();var _0x38b5f7={'method':_0x3d39('0x2a'),'uri':_0x444ea7+'/api/contacts','body':{'contact':{'last_name':_0xe5e795['contactNumber'],'work_number':_0xe5e795[_0x3d39('0x25')],'mobile_number':_0xe5e795[_0x3d39('0x25')],'owner_id':_0xe5e795[_0x3d39('0x1d')],'created_at':_0x439939[_0x3d39('0x23')](_0x3d39('0x2b'))}},'json':!![]};_0x38b5f7[_0x3d39('0xc')]=_0x25fefc;logger[_0x3d39('0xd')](_0x3d39('0x2c'));return rp(_0x38b5f7)['then'](function(_0x3bcd8c){_0xe5e795[_0x3d39('0x26')]=_0x3bcd8c[_0x3d39('0x2d')]['id'];_0xdbf424(_0xe5e795);})[_0x3d39('0x16')](function(_0x24b812){logger['error']('['+[_0x2bd0a5[_0x3d39('0x20')]()]+']',_0x24b812[_0x3d39('0x18')]);_0x803c76(_0x24b812[_0x3d39('0x18')]);});});}function getTicket(_0x21109b,_0x4c9c31,_0x5a0d62,_0x45e4ae,_0x1b51a3){return function(_0x247b73){logger['info'](_0x3d39('0x2e'));return new Promise(function(_0x11724f,_0x3ce47f){var _0x51e8f1=moment();var _0x3f1f5d={'method':_0x3d39('0x2a'),'uri':_0x5a0d62+_0x3d39('0x2f'),'body':{'title':intUtil[_0x3d39('0x30')](_0x45e4ae[_0x3d39('0x31')],_0x1b51a3,'\x20'),'description':intUtil['getString'](_0x45e4ae['Descriptions'],_0x1b51a3,'\x0a'),'owner_id':_0x247b73[_0x3d39('0x1d')],'creater_id':_0x247b73['adminId'],'targetable_id':_0x247b73[_0x3d39('0x26')],'targetable_type':_0x3d39('0x32'),'created_at':_0x51e8f1[_0x3d39('0x23')](_0x3d39('0x2b')),'due_date':_0x51e8f1[_0x3d39('0x33')](0x1e,'m')[_0x3d39('0x23')](_0x3d39('0x2b'))},'json':!![]};_0x3f1f5d[_0x3d39('0xc')]=_0x4c9c31;return rp(_0x3f1f5d)['then'](function(_0x1238c8){_0x247b73[_0x3d39('0x34')]=_0x1238c8[_0x3d39('0x35')]['id'];logger[_0x3d39('0xd')]('Task\x20created:',_0x247b73['ticketId']);_0x11724f(_0x247b73);})[_0x3d39('0x16')](function(_0xcd88da){logger[_0x3d39('0x17')]('['+[_0x21109b[_0x3d39('0x20')]()]+']',_0xcd88da['message']);_0x3ce47f(_0xcd88da[_0x3d39('0x18')]);});});};}function emit(_0x178453,_0x4c959c,_0x49efe9){var _0x37eb69={'uri':_0x178453+_0x3d39('0x36')+_0x49efe9};io['to'](util['format'](_0x3d39('0x37'),_0x4c959c))[_0x3d39('0x38')](_0x3d39('0x39'),_0x37eb69);}exports['cs']=function(_0x5dad89,_0x50c909,_0x88278d,_0x23d1cb,_0x2ca504,_0x4fa254,_0x1c077d,_0x4fe30e){var _0x4fe2ed={};var _0x39fda9={'Authorization':'Token\x20token='+_0x4fa254[_0x3d39('0x3a')]};_0x4fa254['remoteUri']=intUtil[_0x3d39('0x3b')](_0x4fa254['remoteUri']);_0x4fa254[_0x3d39('0x3c')]=intUtil[_0x3d39('0x3b')](_0x4fa254['serverUrl']);var _0x3b7bab=_0x4fa254[_0x3d39('0x3d')];_0x4fe2ed[_0x3d39('0x13')]=_0x4fa254[_0x3d39('0x3e')];_0x4fe2ed[_0x3d39('0x25')]=_0x4fe30e[_0x3d39('0x3f')]()===_0x3d39('0x40')?_0x50c909[_0x3d39('0x41')]:_0x50c909[_0x3d39('0x42')];_0x4fe2ed[_0x3d39('0x43')]=_0x4fe30e===_0x3d39('0x44')||_0x4fe30e===_0x3d39('0x45')?_0x3d39('0x44'):_0x3d39('0x40');if(_0x23d1cb){_0x4fe2ed['agentEmail']=_0x23d1cb[_0x3d39('0x12')];}var _0x356903=util['format'](_0x3d39('0x46'),_0x4fa254[_0x3d39('0x3c')],_0x50c909[_0x3d39('0x47')],md5(_0x50c909[_0x3d39('0x47')]));if(_0x2ca504&&_0x2ca504['monitor_format']){logger[_0x3d39('0xd')](_0x3d39('0x48'),_0x3d39('0x49'));_0x50c909[_0x3d39('0x4a')]=_0x356903;}else if(_0x1c077d&&_0x1c077d[_0x3d39('0x4b')]&&_0x1c077d[_0x3d39('0x4b')]!==_0x3d39('0x4c')){logger[_0x3d39('0xd')](_0x3d39('0x4d'),'Recording\x20is\x20enabled!');_0x50c909['recordingURL']=_0x356903;}else{_0x50c909[_0x3d39('0x4a')]='';}return getAdminId(_0x4fe2ed,_0x4fe30e,_0x39fda9,_0x3b7bab)['then'](getUser(_0x4fe30e,_0x39fda9,_0x3b7bab))[_0x3d39('0xf')](getEndUser(_0x4fe30e,_0x39fda9,_0x3b7bab))['then'](getTicket(_0x4fe30e,_0x39fda9,_0x3b7bab,_0x88278d,_0x50c909))[_0x3d39('0xf')](function(_0x550e48){logger['info'](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x550e48[_0x3d39('0x34')]));if(_0x4fe30e!==_0x3d39('0x45')){logger[_0x3d39('0xd')]('['+[_0x4fe30e[_0x3d39('0x20')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x3b7bab,_0x23d1cb[_0x3d39('0x4e')],_0x550e48[_0x3d39('0x26')]);}})[_0x3d39('0x16')](function(_0x27024d){logger['error']('['+[_0x4fe30e[_0x3d39('0x20')]()]+_0x3d39('0x4f'),util[_0x3d39('0x50')](_0x27024d,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x2949=['ticketId','task','Task\x20created:','/contacts/','user:%s','Token\x20token=','serverUrl','stripTrailingSlash','remoteUri','username','toLowerCase','destcalleridnum','calleridnum','callDirection','queue','unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','util','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','email','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','Getting\x20user\x20list','then','users','agentEmail','Getting\x20user\x20with\x20email','userEmail','length','userId','User\x20found:','Admin\x20selected','&f=','&entities=contact','format','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20created:','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','getString','Subjects','Descriptions','Contact','add'];(function(_0x1738c2,_0x1222e4){var _0x57cbdd=function(_0x5c58d8){while(--_0x5c58d8){_0x1738c2['push'](_0x1738c2['shift']());}};_0x57cbdd(++_0x1222e4);}(_0x2949,0x6f));var _0x9294=function(_0x37dd9d,_0x317c54){_0x37dd9d=_0x37dd9d-0x0;var _0x33ec83=_0x2949[_0x37dd9d];return _0x33ec83;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require('md5');var util=require(_0x9294('0x0'));var moment=require('moment');var Promise=require(_0x9294('0x1'));var Redis=require(_0x9294('0x2'));var intUtil=require(_0x9294('0x3'));var config=require(_0x9294('0x4'));var logger=require(_0x9294('0x5'))(_0x9294('0x6'));config[_0x9294('0x7')]=_[_0x9294('0x8')](config[_0x9294('0x7')],{'host':_0x9294('0x9'),'port':0x18eb});var io=require(_0x9294('0xa'))(new Redis(config[_0x9294('0x7')]));function getAdminId(_0x36bd32,_0x5ca15b,_0x13db86,_0x515b6b){return new Promise(function(_0x10985b,_0x1fc8ea){var _0x3dc411=![];var _0x45edd1={'method':_0x9294('0xb'),'uri':_0x515b6b+_0x9294('0xc'),'json':!![]};_0x45edd1[_0x9294('0xd')]=_0x13db86;logger[_0x9294('0xe')](_0x9294('0xf'));return rp(_0x45edd1)['then'](function(_0x591952){if(_0x591952){var _0x5633e0=_0x591952['users'];var _0x29fcae=null;for(_0x29fcae=0x0;_0x29fcae<_0x5633e0['length'];_0x29fcae++){if(_0x5633e0[_0x29fcae][_0x9294('0x10')]===_0x36bd32[_0x9294('0x11')]){_0x36bd32['adminId']=_0x5633e0[_0x29fcae]['id'];_0x3dc411=!![];}}if(_0x3dc411){logger['info']('Admin\x20found:',_0x36bd32[_0x9294('0x12')]);_0x10985b(_0x36bd32);}else{_0x1fc8ea({'statusCode':0x194,'message':_0x9294('0x13')});}}else{_0x1fc8ea({'statusCode':0x194,'message':_0x9294('0x13')});}})[_0x9294('0x14')](function(_0x2881d1){logger[_0x9294('0x15')]('['+[_0x5ca15b[_0x9294('0x16')]()]+']',_0x2881d1[_0x9294('0x17')]);_0x1fc8ea(_0x2881d1);});});}function getUser(_0x5d06d2,_0x3b9116,_0x3c5df2){return function(_0x22008a){return new Promise(function(_0x48f816,_0x4b165f){var _0x4f4567={'method':_0x9294('0xb'),'uri':_0x3c5df2+_0x9294('0xc'),'json':!![]};_0x4f4567[_0x9294('0xd')]=_0x3b9116;logger[_0x9294('0xe')](_0x9294('0x18'));return rp(_0x4f4567)[_0x9294('0x19')](function(_0x509caf){if(_0x509caf){var _0x43d26f=_0x509caf[_0x9294('0x1a')];var _0x322d74=![];var _0x247652=null;if(_0x22008a[_0x9294('0x1b')]!==null){logger[_0x9294('0xe')](_0x9294('0x1c'),_0x22008a[_0x9294('0x1b')]);_0x22008a[_0x9294('0x1d')]=_0x22008a[_0x9294('0x1b')];for(_0x247652=0x0;_0x247652<_0x43d26f[_0x9294('0x1e')];_0x247652++){if(_0x43d26f[_0x247652][_0x9294('0x10')]===_0x22008a[_0x9294('0x1b')]){_0x322d74=!![];_0x22008a[_0x9294('0x1f')]=_0x43d26f[_0x247652]['id'];logger[_0x9294('0xe')](_0x9294('0x20'),_0x22008a[_0x9294('0x1f')]);}}}if(!_0x322d74){logger['info'](_0x9294('0x21'));_0x22008a[_0x9294('0x1d')]=_0x22008a[_0x9294('0x11')];_0x22008a['userId']=_0x22008a[_0x9294('0x12')];_0x322d74=!![];}if(_0x322d74){_0x48f816(_0x22008a);}else{_0x4b165f({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x4b165f({'statusCode':0x194,'message':_0x9294('0x13')});}})[_0x9294('0x14')](function(_0x39dafd){logger['error']('['+[_0x5d06d2[_0x9294('0x16')]()]+']',_0x39dafd[_0x9294('0x17')]);_0x4b165f(_0x39dafd);});});};}function searchContact(_0x51bce0,_0x49ab12,_0x2869b4,_0x44b3a4){return new Promise(function(_0x1c976a,_0x114a44){var _0x5c65a={'method':_0x9294('0xb'),'headers':_0x49ab12,'uri':_0x51bce0+'/api/lookup?q='+_0x44b3a4+_0x9294('0x22')+_0x2869b4+_0x9294('0x23'),'json':!![]};rp(_0x5c65a)[_0x9294('0x19')](function(_0x4fd1b4){var _0x220f8a=_['find'](_0x4fd1b4['contacts']['contacts'],[_0x2869b4,_0x44b3a4]);_0x1c976a(_0x220f8a);})['catch'](function(_0x316bb7){_0x114a44(_0x316bb7);});});}function getEndUser(_0x5ef65b,_0x3a7228,_0x5f2c83){return function(_0x4a87c7){return new Promise(function(_0x1ab1ff,_0x3d3508){logger[_0x9294('0xe')](util[_0x9294('0x24')]('Searching\x20contact\x20with\x20phone\x20%s',_0x4a87c7[_0x9294('0x25')]));searchContact(_0x5f2c83,_0x3a7228,_0x9294('0x26'),_0x4a87c7['contactNumber'])[_0x9294('0x19')](function(_0x57019e){if(_0x57019e){_0x4a87c7[_0x9294('0x27')]=_0x57019e['id'];logger[_0x9294('0xe')](_0x9294('0x28'),_0x4a87c7[_0x9294('0x27')]);return _0x1ab1ff(_0x4a87c7);}searchContact(_0x5f2c83,_0x3a7228,_0x9294('0x29'),_0x4a87c7[_0x9294('0x25')])[_0x9294('0x19')](function(_0x386d98){if(_0x386d98){_0x4a87c7[_0x9294('0x27')]=_0x386d98['id'];logger[_0x9294('0xe')]('Contact\x20found\x20work_number:',_0x4a87c7[_0x9294('0x27')]);return _0x1ab1ff(_0x4a87c7);}createEndUser(_0x4a87c7,_0x5ef65b,_0x3a7228,_0x5f2c83)[_0x9294('0x19')](function(_0x29cfe2){logger[_0x9294('0xe')](_0x9294('0x2a'),_0x29cfe2[_0x9294('0x27')]);return _0x1ab1ff(_0x29cfe2);});});})[_0x9294('0x14')](function(_0x2625a6){_0x3d3508(_0x2625a6);});});};}function createEndUser(_0x4cecdd,_0xdbd8a4,_0x8caa3c,_0x459b0b){return new Promise(function(_0x1dbdd4,_0x1cdb91){var _0x194bfb=moment();var _0x1c3f69={'method':'POST','uri':_0x459b0b+_0x9294('0x2b'),'body':{'contact':{'last_name':_0x4cecdd['contactNumber'],'work_number':_0x4cecdd[_0x9294('0x25')],'mobile_number':_0x4cecdd[_0x9294('0x25')],'owner_id':_0x4cecdd[_0x9294('0x1f')],'created_at':_0x194bfb[_0x9294('0x24')](_0x9294('0x2c'))}},'json':!![]};_0x1c3f69[_0x9294('0xd')]=_0x8caa3c;logger[_0x9294('0xe')](_0x9294('0x2d'));return rp(_0x1c3f69)['then'](function(_0x824730){_0x4cecdd[_0x9294('0x27')]=_0x824730[_0x9294('0x2e')]['id'];_0x1dbdd4(_0x4cecdd);})[_0x9294('0x14')](function(_0x8499ee){logger[_0x9294('0x15')]('['+[_0xdbd8a4['toUpperCase']()]+']',_0x8499ee[_0x9294('0x17')]);_0x1cdb91(_0x8499ee[_0x9294('0x17')]);});});}function getTicket(_0x1d7db8,_0x2578c7,_0x1006f5,_0x55c76e,_0x5c8c43){return function(_0x3adad8){logger[_0x9294('0xe')](_0x9294('0x2f'));return new Promise(function(_0x232540,_0x508d82){var _0x40457d=moment();var _0x2d0e3b={'method':'POST','uri':_0x1006f5+'/api/tasks','body':{'title':intUtil[_0x9294('0x30')](_0x55c76e[_0x9294('0x31')],_0x5c8c43,'\x20'),'description':intUtil[_0x9294('0x30')](_0x55c76e[_0x9294('0x32')],_0x5c8c43,'\x0a'),'owner_id':_0x3adad8[_0x9294('0x1f')],'creater_id':_0x3adad8[_0x9294('0x12')],'targetable_id':_0x3adad8[_0x9294('0x27')],'targetable_type':_0x9294('0x33'),'created_at':_0x40457d[_0x9294('0x24')](_0x9294('0x2c')),'due_date':_0x40457d[_0x9294('0x34')](0x1e,'m')[_0x9294('0x24')](_0x9294('0x2c'))},'json':!![]};_0x2d0e3b[_0x9294('0xd')]=_0x2578c7;return rp(_0x2d0e3b)[_0x9294('0x19')](function(_0x2c7205){_0x3adad8[_0x9294('0x35')]=_0x2c7205[_0x9294('0x36')]['id'];logger['info'](_0x9294('0x37'),_0x3adad8['ticketId']);_0x232540(_0x3adad8);})['catch'](function(_0x4eb6cb){logger['error']('['+[_0x1d7db8[_0x9294('0x16')]()]+']',_0x4eb6cb[_0x9294('0x17')]);_0x508d82(_0x4eb6cb[_0x9294('0x17')]);});});};}function emit(_0x37151f,_0x4b69f3,_0xee793a){var _0x416bd4={'uri':_0x37151f+_0x9294('0x38')+_0xee793a};io['to'](util[_0x9294('0x24')](_0x9294('0x39'),_0x4b69f3))['emit']('trigger:browser:url',_0x416bd4);}exports['cs']=function(_0x446bac,_0x5bd4ea,_0x5585c8,_0xb8a61b,_0x4b0822,_0x2e2062,_0x2d677c,_0x348fea){var _0x25581b={};var _0x28b311={'Authorization':_0x9294('0x3a')+_0x2e2062['apiKey']};_0x2e2062['remoteUri']=intUtil['stripTrailingSlash'](_0x2e2062['remoteUri']);_0x2e2062[_0x9294('0x3b')]=intUtil[_0x9294('0x3c')](_0x2e2062['serverUrl']);var _0xcab1ab=_0x2e2062[_0x9294('0x3d')];_0x25581b['adminEmail']=_0x2e2062[_0x9294('0x3e')];_0x25581b['contactNumber']=_0x348fea[_0x9294('0x3f')]()==='outbound'?_0x5bd4ea[_0x9294('0x40')]:_0x5bd4ea[_0x9294('0x41')];_0x25581b[_0x9294('0x42')]=_0x348fea===_0x9294('0x43')||_0x348fea===_0x9294('0x44')?'queue':_0x9294('0x45');if(_0xb8a61b){_0x25581b[_0x9294('0x1b')]=_0xb8a61b[_0x9294('0x10')];}var _0x5698d9=util[_0x9294('0x24')](_0x9294('0x46'),_0x2e2062[_0x9294('0x3b')],_0x5bd4ea[_0x9294('0x47')],md5(_0x5bd4ea[_0x9294('0x47')]));if(_0x4b0822&&_0x4b0822['monitor_format']){logger[_0x9294('0xe')](_0x9294('0x48'),_0x9294('0x49'));_0x5bd4ea[_0x9294('0x4a')]=_0x5698d9;}else if(_0x2d677c&&_0x2d677c[_0x9294('0x4b')]&&_0x2d677c[_0x9294('0x4b')]!==_0x9294('0x4c')){logger['info'](_0x9294('0x4d'),_0x9294('0x49'));_0x5bd4ea[_0x9294('0x4a')]=_0x5698d9;}else{_0x5bd4ea[_0x9294('0x4a')]='';}return getAdminId(_0x25581b,_0x348fea,_0x28b311,_0xcab1ab)['then'](getUser(_0x348fea,_0x28b311,_0xcab1ab))[_0x9294('0x19')](getEndUser(_0x348fea,_0x28b311,_0xcab1ab))[_0x9294('0x19')](getTicket(_0x348fea,_0x28b311,_0xcab1ab,_0x5585c8,_0x5bd4ea))[_0x9294('0x19')](function(_0xa36a88){logger['info'](util[_0x9294('0x24')](_0x9294('0x4e'),_0xa36a88[_0x9294('0x35')]));if(_0x348fea!==_0x9294('0x44')){logger[_0x9294('0xe')]('['+[_0x348fea[_0x9294('0x16')]()]+']',_0x9294('0x4f'));emit(_0xcab1ab,_0xb8a61b[_0x9294('0x50')],_0xa36a88['endUserId']);}})[_0x9294('0x14')](function(_0xe88ddc){logger[_0x9294('0x15')]('['+[_0x348fea[_0x9294('0x16')]()]+_0x9294('0x51'),util['inspect'](_0xe88ddc,{'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 8e3a89d..efa862d 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 _0xd9f3=['freshdesk','zoho','desk','vtiger','dynamics365','freshsales','servicenow','exec','includes','toLowerCase','data1','find','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','unknown\x20integration','../../../../config/logger','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','format','%s\x20account\x20#%s\x20not\x20found','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./freshsales','zendesk','salesforce','sugarcrm'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0xd9f3,0x183));var _0x3d9f=function(_0x78f5eb,_0x47a1dd){_0x78f5eb=_0x78f5eb-0x0;var _0x580dcc=_0xd9f3[_0x78f5eb];return _0x580dcc;};'use strict';var _=require('lodash');var util=require(_0x3d9f('0x0'));var zendesk=require(_0x3d9f('0x1'));var salesforce=require(_0x3d9f('0x2'));var sugarcrm=require(_0x3d9f('0x3'));var freshdesk=require(_0x3d9f('0x4'));var zoho=require(_0x3d9f('0x5'));var desk=require(_0x3d9f('0x6'));var vtiger=require(_0x3d9f('0x7'));var servicenow=require(_0x3d9f('0x8'));var dynamics365=require('./dynamics365');var freshsales=require(_0x3d9f('0x9'));var integrations=[_0x3d9f('0xa'),_0x3d9f('0xb'),_0x3d9f('0xc'),_0x3d9f('0xd'),_0x3d9f('0xe'),_0x3d9f('0xf'),_0x3d9f('0x10'),_0x3d9f('0x11'),_0x3d9f('0x12'),_0x3d9f('0x13')];exports[_0x3d9f('0x14')]=function(_0x2e3dd2,_0x14439a,_0x3a94fb,_0x43be02,_0x231865,_0x101b9a){if(_0x3a94fb){if(_[_0x3d9f('0x15')](integrations,_0x2e3dd2['data1'][_0x3d9f('0x16')]())){try{var _0x5a20de=null;var _0x5b4d46='';var _0x4bf1ea=_0x3a94fb[_0x2e3dd2[_0x3d9f('0x17')][_0x3d9f('0x16')]()];if(_0x4bf1ea){var _0x1da5b=_0x4bf1ea[_0x2e3dd2['data2']];if(_0x1da5b){var _0x4cac10=_[_0x3d9f('0x18')](_0x1da5b[_0x3d9f('0x19')],{'id':parseInt(_0x2e3dd2[_0x3d9f('0x1a')],0xa)});if(_0x4cac10){if(_0x43be02){if(_0x231865&&_0x14439a[_0x3d9f('0x1b')]){_0x5b4d46='queue';}else if(_0x14439a[_0x3d9f('0x1c')]){_0x5b4d46=_0x3d9f('0x1d');}else{console[_0x3d9f('0x1e')](_0x3d9f('0x1f'),_0x14439a);}}else{_0x5b4d46=_0x3d9f('0x20');}switch(_0x2e3dd2['data1'][_0x3d9f('0x16')]()){case _0x3d9f('0xa'):zendesk[_0x5b4d46](_0x2e3dd2,_0x14439a,_0x4cac10,_0x43be02,_0x231865,_0x1da5b,_0x101b9a);break;case _0x3d9f('0xb'):salesforce[_0x5b4d46](_0x2e3dd2,_0x14439a,_0x4cac10,_0x43be02,_0x231865,_0x1da5b,_0x101b9a);break;case'sugarcrm':sugarcrm[_0x5b4d46](_0x2e3dd2,_0x14439a,_0x4cac10,_0x43be02,_0x231865,_0x1da5b,_0x101b9a);break;case'freshdesk':freshdesk[_0x5b4d46](_0x2e3dd2,_0x14439a,_0x4cac10,_0x43be02,_0x231865,_0x1da5b,_0x101b9a);break;case _0x3d9f('0xe'):zoho[_0x5b4d46](_0x2e3dd2,_0x14439a,_0x4cac10,_0x43be02,_0x231865,_0x1da5b,_0x101b9a);break;case _0x3d9f('0xf'):desk[_0x5b4d46](_0x2e3dd2,_0x14439a,_0x4cac10,_0x43be02,_0x231865,_0x1da5b,_0x101b9a);break;case _0x3d9f('0x10'):vtiger[_0x5b4d46](_0x2e3dd2,_0x14439a,_0x4cac10,_0x43be02,_0x231865,_0x1da5b,_0x101b9a);break;case'freshsales':freshsales['cs'](_0x2e3dd2,_0x14439a,_0x4cac10,_0x43be02,_0x231865,_0x1da5b,_0x101b9a,_0x5b4d46);break;case'servicenow':servicenow['cs'](_0x2e3dd2,_0x14439a,_0x4cac10,_0x43be02,_0x231865,_0x1da5b,_0x101b9a,_0x5b4d46);break;case'dynamics365':dynamics365['cs'](_0x2e3dd2,_0x14439a,_0x4cac10,_0x43be02,_0x231865,_0x1da5b,_0x101b9a,_0x5b4d46);break;default:console[_0x3d9f('0x1e')](_0x3d9f('0x21'));}}else{_0x5a20de=require(_0x3d9f('0x22'))(_0x2e3dd2[_0x3d9f('0x17')][_0x3d9f('0x16')]());_0x5a20de[_0x3d9f('0x23')](_0x3d9f('0x24'),util['format'](_0x3d9f('0x25'),_0x2e3dd2[_0x3d9f('0x17')][_0x3d9f('0x16')](),_0x2e3dd2[_0x3d9f('0x1a')]));}}else{_0x5a20de=require(_0x3d9f('0x22'))(_0x2e3dd2[_0x3d9f('0x17')]['toLowerCase']());_0x5a20de['error'](_0x3d9f('0x24'),util[_0x3d9f('0x26')](_0x3d9f('0x27'),_0x2e3dd2[_0x3d9f('0x17')]['toLowerCase'](),_0x2e3dd2['data2']));}}else{}}catch(_0x573bab){console[_0x3d9f('0x23')](_0x573bab);}}}}; \ No newline at end of file +var _0x6786=['vtiger','freshsales','unknown\x20integration','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','util','./zendesk','./freshdesk','./vtiger','./servicenow','./dynamics365','./freshsales','salesforce','freshdesk','zoho','desk','dynamics365','servicenow','exec','toLowerCase','data1','data2','find','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','sugarcrm'];(function(_0x4e7ee8,_0x4d0ab8){var _0x5202dd=function(_0x41da6a){while(--_0x41da6a){_0x4e7ee8['push'](_0x4e7ee8['shift']());}};_0x5202dd(++_0x4d0ab8);}(_0x6786,0xa7));var _0x6678=function(_0x45aa72,_0x8af642){_0x45aa72=_0x45aa72-0x0;var _0x75adaa=_0x6786[_0x45aa72];return _0x75adaa;};'use strict';var _=require('lodash');var util=require(_0x6678('0x0'));var zendesk=require(_0x6678('0x1'));var salesforce=require('./salesforce');var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x6678('0x2'));var zoho=require('./zoho');var desk=require('./desk');var vtiger=require(_0x6678('0x3'));var servicenow=require(_0x6678('0x4'));var dynamics365=require(_0x6678('0x5'));var freshsales=require(_0x6678('0x6'));var integrations=['zendesk',_0x6678('0x7'),'sugarcrm',_0x6678('0x8'),_0x6678('0x9'),_0x6678('0xa'),'vtiger',_0x6678('0xb'),'freshsales',_0x6678('0xc')];exports[_0x6678('0xd')]=function(_0x122eed,_0x584aa6,_0x22fe56,_0x4a65ce,_0x1313ef,_0x4cdf57){if(_0x22fe56){if(_['includes'](integrations,_0x122eed['data1'][_0x6678('0xe')]())){try{var _0x466077=null;var _0x253706='';var _0x5b0946=_0x22fe56[_0x122eed[_0x6678('0xf')][_0x6678('0xe')]()];if(_0x5b0946){var _0x561587=_0x5b0946[_0x122eed[_0x6678('0x10')]];if(_0x561587){var _0x8571=_[_0x6678('0x11')](_0x561587['Configurations'],{'id':parseInt(_0x122eed[_0x6678('0x12')],0xa)});if(_0x8571){if(_0x4a65ce){if(_0x1313ef&&_0x584aa6['queue']){_0x253706=_0x6678('0x13');}else if(_0x584aa6[_0x6678('0x14')]){_0x253706=_0x6678('0x15');}else{console[_0x6678('0x16')](_0x6678('0x17'),_0x584aa6);}}else{_0x253706='unmanaged';}switch(_0x122eed[_0x6678('0xf')]['toLowerCase']()){case'zendesk':zendesk[_0x253706](_0x122eed,_0x584aa6,_0x8571,_0x4a65ce,_0x1313ef,_0x561587,_0x4cdf57);break;case _0x6678('0x7'):salesforce[_0x253706](_0x122eed,_0x584aa6,_0x8571,_0x4a65ce,_0x1313ef,_0x561587,_0x4cdf57);break;case _0x6678('0x18'):sugarcrm[_0x253706](_0x122eed,_0x584aa6,_0x8571,_0x4a65ce,_0x1313ef,_0x561587,_0x4cdf57);break;case _0x6678('0x8'):freshdesk[_0x253706](_0x122eed,_0x584aa6,_0x8571,_0x4a65ce,_0x1313ef,_0x561587,_0x4cdf57);break;case _0x6678('0x9'):zoho[_0x253706](_0x122eed,_0x584aa6,_0x8571,_0x4a65ce,_0x1313ef,_0x561587,_0x4cdf57);break;case _0x6678('0xa'):desk[_0x253706](_0x122eed,_0x584aa6,_0x8571,_0x4a65ce,_0x1313ef,_0x561587,_0x4cdf57);break;case _0x6678('0x19'):vtiger[_0x253706](_0x122eed,_0x584aa6,_0x8571,_0x4a65ce,_0x1313ef,_0x561587,_0x4cdf57);break;case _0x6678('0x1a'):freshsales['cs'](_0x122eed,_0x584aa6,_0x8571,_0x4a65ce,_0x1313ef,_0x561587,_0x4cdf57,_0x253706);break;case'servicenow':servicenow['cs'](_0x122eed,_0x584aa6,_0x8571,_0x4a65ce,_0x1313ef,_0x561587,_0x4cdf57,_0x253706);break;case'dynamics365':dynamics365['cs'](_0x122eed,_0x584aa6,_0x8571,_0x4a65ce,_0x1313ef,_0x561587,_0x4cdf57,_0x253706);break;default:console[_0x6678('0x16')](_0x6678('0x1b'));}}else{_0x466077=require('../../../../config/logger')(_0x122eed['data1']['toLowerCase']());_0x466077[_0x6678('0x1c')](_0x6678('0x1d'),util['format'](_0x6678('0x1e'),_0x122eed[_0x6678('0xf')][_0x6678('0xe')](),_0x122eed[_0x6678('0x12')]));}}else{_0x466077=require('../../../../config/logger')(_0x122eed[_0x6678('0xf')][_0x6678('0xe')]());_0x466077[_0x6678('0x1c')]('[EXEC]',util['format'](_0x6678('0x1f'),_0x122eed[_0x6678('0xf')][_0x6678('0xe')](),_0x122eed[_0x6678('0x10')]));}}else{}}catch(_0x588933){console[_0x6678('0x1c')](_0x588933);}}}}; \ 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 f98f504..845f81d 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 _0x5497=['resolve','user_id','display_name','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','Lead','account_contact_lead','additionalSearchAccount','Account','additionalSearchLead','first','attributes','type','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','Caller\x20-\x20%s','format','Company','No\x20Company','upperFirst','includes','string','idField','toString','variable','variableName','customVariable','Variable','name','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','uniqueid','calleridname','calleridnum','Fields','trigger:salesforce:display','trigger:browser:url','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','[QUEUE]','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','destcalleridname','[OUTBOUND]\x20Ticket\x20%s\x20created.','integrationTab','user:%s','newTab','%s/%s/e','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.','lodash','moment','util','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','emit','assign','getString','Subjects','Descriptions','Task','utc','IsReminderSet','IsRecurrence','contact','endUserType','lead','WhoId','ticketType','Case','ContactId','account','AccountId','leadId','info','sobject','create','isNil','User','execute','then','length','find','Email','Agent\x20%s\x20found.','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.'];(function(_0x53ce5b,_0x177d83){var _0x19595e=function(_0x355e5b){while(--_0x355e5b){_0x53ce5b['push'](_0x53ce5b['shift']());}};_0x19595e(++_0x177d83);}(_0x5497,0xca));var _0x7549=function(_0x35b18a,_0x6b2fbe){_0x35b18a=_0x35b18a-0x0;var _0x4db1bd=_0x5497[_0x35b18a];return _0x4db1bd;};'use strict';var _=require(_0x7549('0x0'));var rp=require('request-promise');var moment=require(_0x7549('0x1'));var BPromise=require('bluebird');var md5=require('md5');var jsforce=require('jsforce');var util=require(_0x7549('0x2'));var Redis=require('ioredis');var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x7549('0x3'))('salesforce');config['redis']=_[_0x7549('0x4')](config[_0x7549('0x5')],{'host':_0x7549('0x6'),'port':0x18eb});var io=require(_0x7549('0x7'))(new Redis(config[_0x7549('0x5')]));function emit(_0x22a031,_0x161494,_0x48aca1){io['to'](_0x22a031)[_0x7549('0x8')](_0x161494,_0x48aca1);}function getTicket(_0x5f32f7,_0x2556a8,_0x2932ed,_0x4143ea,_0x1eb2da,_0x32056c,_0x519f70,_0x2d9650){var _0x54e250=Object[_0x7549('0x9')]({},{'OwnerId':_0x2556a8['id'],'Subject':intUtil[_0x7549('0xa')](_0x4143ea[_0x7549('0xb')],_0x1eb2da,'\x20'),'Description':intUtil[_0x7549('0xa')](_0x4143ea[_0x7549('0xc')],_0x1eb2da,'\x0a')},getCustomFields(_0x32056c,_0x1eb2da));if(_0x2932ed){if(_0x4143ea['ticketType']===_0x7549('0xd')){_0x54e250['ActivityDate']=moment[_0x7549('0xe')]();_0x54e250[_0x7549('0xf')]=![];_0x54e250[_0x7549('0x10')]=![];if(_0x2932ed['endUserType']===_0x7549('0x11')||_0x2932ed[_0x7549('0x12')]===_0x7549('0x13')){_0x54e250[_0x7549('0x14')]=_0x2932ed['id'];}else if(_0x2932ed[_0x7549('0x12')]==='account'){_0x54e250['WhatId']=_0x2932ed['id'];}}else if(_0x4143ea[_0x7549('0x15')]===_0x7549('0x16')){if(_0x2932ed[_0x7549('0x12')]===_0x7549('0x11')){_0x54e250[_0x7549('0x17')]=_0x2932ed['id'];}else if(_0x2932ed['endUserType']===_0x7549('0x18')){_0x54e250[_0x7549('0x19')]=_0x2932ed['id'];}else if(_0x2932ed['endUserType']==='lead'&&_0x4143ea[_0x7549('0x1a')]){_0x54e250[_0x4143ea['leadId']]=_0x2932ed['id'];}else{logger[_0x7549('0x1b')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x519f70[_0x7549('0x1c')](_0x4143ea['ticketType'])[_0x7549('0x1d')](_0x54e250);}function getUser(_0x3b1747,_0x1b47c6,_0x292792){if(!_[_0x7549('0x1e')](_0x1b47c6)&&intUtil['validateEmail'](_0x1b47c6)){var _0x2f36ad={'Email':_0x1b47c6};var _0x1428ad={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x292792[_0x7549('0x1c')](_0x7549('0x1f'))['find'](_0x2f36ad,_0x1428ad)[_0x7549('0x20')]()[_0x7549('0x21')](function(_0x245de4){if(_0x245de4[_0x7549('0x22')]){var _0x142e5c=_[_0x7549('0x23')](_0x245de4,function(_0x21305f){return _0x21305f[_0x7549('0x24')]===_0x1b47c6;});if(_0x142e5c){logger[_0x7549('0x1b')](_0x7549('0x25'),_0x1b47c6);return BPromise['resolve']({'id':_0x142e5c['Id'],'name':_0x142e5c[_0x7549('0x26')]});}}else{logger[_0x7549('0x1b')](_0x7549('0x27'),_0x1b47c6);return _0x292792['identity']()[_0x7549('0x21')](function(_0x2e8978){return BPromise[_0x7549('0x28')]({'id':_0x2e8978[_0x7549('0x29')],'name':_0x2e8978[_0x7549('0x2a')]});});}});}else{logger[_0x7549('0x1b')](_0x7549('0x27'),_0x1b47c6);return _0x292792['identity']()[_0x7549('0x21')](function(_0x476f36){return BPromise[_0x7549('0x28')]({'id':_0x476f36[_0x7549('0x29')],'name':_0x476f36[_0x7549('0x2a')]});});}}function getEndUser(_0x3d6a90,_0x5a9a34,_0x4696cc,_0x48cdea,_0x548dd2){var _0x4e8a61={'$or':{'Phone':_0x48cdea}};var _0x4b6ccb={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x7549('0x28')]()['then'](function(){logger[_0x7549('0x1b')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x48cdea,_0x5a9a34[_0x7549('0x2b')]);switch(_0x5a9a34[_0x7549('0x2b')]){case _0x7549('0x2c'):var _0x30f6a3=_[_0x7549('0x2d')](_0x4e8a61);if(_0x5a9a34[_0x7549('0x2e')]){var _0x575705={};_0x575705[_0x5a9a34['additionalSearchContact']]=_0x48cdea;_[_0x7549('0x2f')](_0x30f6a3[_0x7549('0x30')],_0x575705);}return _0x548dd2[_0x7549('0x1c')](_0x7549('0x31'))[_0x7549('0x23')](_0x30f6a3,_0x4b6ccb)[_0x7549('0x20')]()[_0x7549('0x21')](function(_0x11288a){if(_0x11288a&&_0x11288a[_0x7549('0x22')]){return _0x11288a;}else{var _0x34f460=_[_0x7549('0x2d')](_0x4e8a61);if(_0x5a9a34['additionalSearchLead']){var _0x27f04a={};_0x27f04a[_0x5a9a34['additionalSearchLead']]=_0x48cdea;_['merge'](_0x34f460[_0x7549('0x30')],_0x27f04a);}return _0x548dd2[_0x7549('0x1c')](_0x7549('0x32'))[_0x7549('0x23')](_0x34f460,_0x4b6ccb);}});case _0x7549('0x33'):var _0x3b4b8d=_[_0x7549('0x2d')](_0x4e8a61);if(_0x5a9a34[_0x7549('0x34')]){var _0x575705={};_0x575705[_0x5a9a34[_0x7549('0x34')]]=_0x48cdea;_[_0x7549('0x2f')](_0x3b4b8d['$or'],_0x575705);}return _0x548dd2[_0x7549('0x1c')](_0x7549('0x35'))[_0x7549('0x23')](_0x3b4b8d,_0x4b6ccb)[_0x7549('0x20')]()['then'](function(_0x32be16){if(_0x32be16&&_0x32be16[_0x7549('0x22')]){return _0x32be16;}else{var _0x577de5=_[_0x7549('0x2d')](_0x4e8a61);if(_0x5a9a34['additionalSearchContact']){var _0x9df0b6={};_0x9df0b6[_0x5a9a34[_0x7549('0x2e')]]=_0x48cdea;_[_0x7549('0x2f')](_0x577de5['$or'],_0x9df0b6);}return _0x548dd2['sobject'](_0x7549('0x31'))[_0x7549('0x23')](_0x577de5,_0x4b6ccb)[_0x7549('0x21')](function(_0x72fffc){if(_0x72fffc&&_0x72fffc[_0x7549('0x22')]){return _0x72fffc;}else{var _0x58e119=_['cloneDeep'](_0x4e8a61);if(_0x5a9a34[_0x7549('0x36')]){var _0x16cee9={};_0x16cee9[_0x5a9a34[_0x7549('0x36')]]=_0x48cdea;_['merge'](_0x58e119['$or'],_0x16cee9);}return _0x548dd2[_0x7549('0x1c')](_0x7549('0x32'))[_0x7549('0x23')](_0x58e119,_0x4b6ccb);}});}});case _0x7549('0x11'):var _0x30f6a3=_[_0x7549('0x2d')](_0x4e8a61);if(_0x5a9a34[_0x7549('0x2e')]){var _0x575705={};_0x575705[_0x5a9a34['additionalSearchContact']]=_0x48cdea;_[_0x7549('0x2f')](_0x30f6a3[_0x7549('0x30')],_0x575705);}return _0x548dd2[_0x7549('0x1c')](_0x7549('0x31'))[_0x7549('0x23')](_0x30f6a3,_0x4b6ccb)['execute']();case'lead':var _0x41ee4f=_[_0x7549('0x2d')](_0x4e8a61);if(_0x5a9a34[_0x7549('0x36')]){var _0x575705={};_0x575705[_0x5a9a34[_0x7549('0x36')]]=_0x48cdea;_['merge'](_0x41ee4f[_0x7549('0x30')],_0x575705);}return _0x548dd2[_0x7549('0x1c')]('Lead')[_0x7549('0x23')](_0x41ee4f,_0x4b6ccb);case'account':var _0x3b4b8d=_[_0x7549('0x2d')](_0x4e8a61);if(_0x5a9a34['additionalSearchAccount']){var _0x575705={};_0x575705[_0x5a9a34[_0x7549('0x34')]]=_0x48cdea;_['merge'](_0x3b4b8d[_0x7549('0x30')],_0x575705);}return _0x548dd2[_0x7549('0x1c')]('Account')[_0x7549('0x23')](_0x3b4b8d,_0x4b6ccb);default:return null;}})['then'](function(_0x2b2d70){if(_0x2b2d70&&_0x2b2d70[_0x7549('0x22')]){var _0x2794fc=_[_0x7549('0x37')](_0x2b2d70);if(_0x2794fc){return BPromise[_0x7549('0x28')]({'id':_0x2794fc['Id'],'name':_0x2794fc['Name'],'phone':_0x2794fc['Phone'],'endUserType':_0x2794fc[_0x7549('0x38')][_0x7549('0x39')][_0x7549('0x3a')]()});}}})['then'](function(_0x2d1aba){if(_0x2d1aba){logger[_0x7549('0x1b')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x2d1aba[_0x7549('0x12')],_0x48cdea);return BPromise[_0x7549('0x28')](_0x2d1aba);}else{logger[_0x7549('0x1b')](_0x7549('0x3b'),_0x48cdea);var _0x186c60={'Phone':_0x48cdea};if(_0x5a9a34[_0x7549('0x3c')]){if(_0x5a9a34['moduleCreate']==='contact'){logger[_0x7549('0x1b')](_0x7549('0x3d'),_0x48cdea,_0x5a9a34[_0x7549('0x3c')]);_0x186c60[_0x7549('0x3e')]=_0x4696cc!==_0x7549('0x3f')?_0x4696cc:util['format'](_0x7549('0x40'),_0x48cdea);}else if(_0x5a9a34[_0x7549('0x3c')]===_0x7549('0x13')){logger[_0x7549('0x1b')](_0x7549('0x3d'),_0x48cdea,_0x5a9a34[_0x7549('0x3c')]);_0x186c60['LastName']=_0x4696cc!==''?_0x4696cc:util[_0x7549('0x41')](_0x7549('0x40'),_0x48cdea);_0x186c60[_0x7549('0x42')]=_0x7549('0x43');}else if(_0x5a9a34[_0x7549('0x3c')]===_0x7549('0x18')){logger[_0x7549('0x1b')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x48cdea,_0x5a9a34[_0x7549('0x3c')]);_0x186c60[_0x7549('0x26')]=_0x4696cc!==_0x7549('0x3f')?_0x4696cc:util[_0x7549('0x41')](_0x7549('0x40'),_0x48cdea);}else{return null;}}return _0x548dd2[_0x7549('0x1c')](_[_0x7549('0x44')](_0x5a9a34[_0x7549('0x3c')]))[_0x7549('0x1d')](_0x186c60)[_0x7549('0x21')](function(_0x1cfc96){return BPromise[_0x7549('0x28')]({'id':_0x1cfc96['id'],'endUserType':_0x5a9a34[_0x7549('0x3c')]});});}});}function getCustomFields(_0x1bd5c7,_0x5788b7){var _0x27b450={};if(_0x1bd5c7[_0x7549('0x22')]>0x0){_['forEach'](_0x1bd5c7,function(_0x2bf193){if(_[_0x7549('0x45')]([_0x7549('0x46'),'picklist'],_0x2bf193['type'])&&_0x2bf193[_0x7549('0x47')]){_0x27b450[_0x2bf193['idField']]=_0x2bf193['content'][_0x7549('0x48')]();}else if(_0x2bf193[_0x7549('0x39')]===_0x7549('0x49')&&_0x2bf193[_0x7549('0x4a')]&&_0x2bf193[_0x7549('0x47')]){_0x5788b7[_0x2bf193['variableName']]&&(_0x27b450[_0x2bf193[_0x7549('0x47')]]=_0x5788b7[_0x2bf193['variableName']][_0x7549('0x48')]());}else if(_0x2bf193[_0x7549('0x39')]===_0x7549('0x4b')&&_0x2bf193[_0x7549('0x4c')]&&_0x2bf193[_0x7549('0x4c')][_0x7549('0x4d')]&&_0x2bf193[_0x7549('0x47')]){_0x5788b7[_0x2bf193[_0x7549('0x4c')][_0x7549('0x4d')]['toLowerCase']()]&&(_0x27b450[_0x2bf193[_0x7549('0x47')]]=_0x5788b7[_0x2bf193['Variable'][_0x7549('0x4d')][_0x7549('0x3a')]()]['toString']());}});}return _0x27b450;}function getConnection(_0x5476b2){var _0x3fcfba=_0x5476b2['password'][_0x7549('0x4e')](_0x5476b2[_0x7549('0x4f')]);var _0x49274b=new jsforce[(_0x7549('0x50'))]({'oauth2':{'loginUrl':_0x5476b2[_0x7549('0x51')]||_0x7549('0x52'),'clientId':_0x5476b2[_0x7549('0x53')],'clientSecret':_0x5476b2[_0x7549('0x54')]}});return _0x49274b[_0x7549('0x55')](_0x5476b2[_0x7549('0x56')],_0x3fcfba)[_0x7549('0x21')](function(){logger[_0x7549('0x1b')](_0x7549('0x57'));return _0x49274b;});}exports[_0x7549('0x58')]=function(_0x38e8bf,_0x350125,_0x569a0f,_0x3df59d,_0x373555,_0x5bc2dd){var _0x3161f7,_0x1fdef5,_0x4a763e,_0x18cd50;_0x5bc2dd[_0x7549('0x59')]=intUtil[_0x7549('0x5a')](_0x5bc2dd[_0x7549('0x59')]);_0x5bc2dd[_0x7549('0x51')]=intUtil[_0x7549('0x5a')](_0x5bc2dd[_0x7549('0x51')]);if(_0x373555&&_0x373555[_0x7549('0x5b')]){logger[_0x7549('0x1b')]('[QUEUE]',_0x7549('0x5c'));_0x350125[_0x7549('0x5d')]=util[_0x7549('0x41')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5bc2dd[_0x7549('0x59')],_0x350125[_0x7549('0x5e')],md5(_0x350125[_0x7549('0x5e')]));}else{_0x350125[_0x7549('0x5d')]='';}return getConnection(_0x5bc2dd)[_0x7549('0x21')](function(_0x13f31a){_0x18cd50=_0x13f31a;return getUser(_0x5bc2dd,_0x3df59d['email'],_0x18cd50);})[_0x7549('0x21')](function(_0x21a578){_0x3161f7=_0x21a578;return getEndUser(_0x5bc2dd,_0x569a0f,_0x350125[_0x7549('0x5f')],_0x350125[_0x7549('0x60')],_0x18cd50);})[_0x7549('0x21')](function(_0x4f637d){_0x1fdef5=_0x4f637d;return getTicket(_0x5bc2dd,_0x3161f7,_0x1fdef5,_0x569a0f,_0x350125,_0x569a0f[_0x7549('0x61')],_0x18cd50,_0x7549('0x58'));})[_0x7549('0x21')](function(_0x2817e6){_0x4a763e=_0x2817e6;logger[_0x7549('0x1b')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x4a763e['id']);logger['info']('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x4a763e['id'],_0x3df59d[_0x7549('0x4d')],_0x5bc2dd[_0x7549('0x39')]);switch(_0x5bc2dd[_0x7549('0x39')]){case'integrationTab':emit(util[_0x7549('0x41')]('user:%s',_0x3df59d[_0x7549('0x4d')]),_0x7549('0x62'),{'recordId':_0x4a763e['id']});break;case'newTab':emit(util[_0x7549('0x41')]('user:%s',_0x3df59d[_0x7549('0x4d')]),_0x7549('0x63'),{'uri':util['format']('%s/%s/e',_0x18cd50['instanceUrl'],_0x4a763e['id'])});break;default:logger[_0x7549('0x64')](_0x7549('0x65'));}})[_0x7549('0x66')](function(_0x70facf){logger[_0x7549('0x64')](_0x7549('0x67'),_0x70facf);});};exports[_0x7549('0x68')]=function(_0xd9ef6d,_0x1eec29,_0x144318,_0x4184fb,_0x50989c,_0x17849a,_0x5df5f6){var _0x2db7f4,_0x494922,_0x209829,_0x5046f7;_0x17849a[_0x7549('0x59')]=intUtil[_0x7549('0x5a')](_0x17849a['serverUrl']);_0x17849a[_0x7549('0x51')]=intUtil[_0x7549('0x5a')](_0x17849a[_0x7549('0x51')]);if(_0x5df5f6&&_0x5df5f6['recordingFormat']&&_0x5df5f6[_0x7549('0x69')]!==_0x7549('0x6a')){logger[_0x7549('0x1b')](_0x7549('0x6b'),_0x7549('0x5c'));_0x1eec29[_0x7549('0x5d')]=util[_0x7549('0x41')](_0x7549('0x6c'),_0x17849a[_0x7549('0x59')],_0x1eec29[_0x7549('0x5e')],md5(_0x1eec29[_0x7549('0x5e')]));}return getConnection(_0x17849a)['then'](function(_0x4eb750){_0x5046f7=_0x4eb750;return getUser(_0x17849a,_0x4184fb[_0x7549('0x6d')],_0x5046f7);})['then'](function(_0x4dbce9){_0x2db7f4=_0x4dbce9;return getEndUser(_0x17849a,_0x144318,_0x1eec29[_0x7549('0x6e')],_0x1eec29['destcalleridnum'],_0x5046f7);})[_0x7549('0x21')](function(_0x2b2813){_0x494922=_0x2b2813;return getTicket(_0x17849a,_0x2db7f4,_0x494922,_0x144318,_0x1eec29,_0x144318[_0x7549('0x61')],_0x5046f7,_0x7549('0x68'));})[_0x7549('0x21')](function(_0x2b9b37){_0x209829=_0x2b9b37;logger['info'](_0x7549('0x6f'),_0x209829['id']);logger[_0x7549('0x1b')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x209829['id'],_0x4184fb['name'],_0x17849a[_0x7549('0x39')]);switch(_0x17849a['type']){case _0x7549('0x70'):emit(util['format'](_0x7549('0x71'),_0x4184fb[_0x7549('0x4d')]),_0x7549('0x62'),{'recordId':_0x209829['id']});break;case _0x7549('0x72'):emit(util[_0x7549('0x41')](_0x7549('0x71'),_0x4184fb[_0x7549('0x4d')]),_0x7549('0x63'),{'uri':util['format'](_0x7549('0x73'),_0x5046f7['instanceUrl'],_0x209829['id'])});break;default:logger[_0x7549('0x64')](_0x7549('0x6b'),_0x7549('0x74'));}})[_0x7549('0x66')](function(_0x28bfea){logger[_0x7549('0x64')](_0x7549('0x6b'),_0x28bfea);});};exports[_0x7549('0x75')]=function(_0x298fa4,_0x2fa704,_0x418223,_0x165359,_0x25d7db,_0x24625b){var _0x497c1b,_0xb5c6fe,_0x33592b,_0x1e4bfa;_0x24625b[_0x7549('0x59')]=intUtil[_0x7549('0x5a')](_0x24625b[_0x7549('0x59')]);_0x24625b[_0x7549('0x51')]=intUtil[_0x7549('0x5a')](_0x24625b[_0x7549('0x51')]);if(_0x25d7db&&_0x25d7db[_0x7549('0x5b')]){logger['info']('['+_0x2fa704[_0x7549('0x76')][_0x7549('0x77')]()+']','Recording\x20is\x20enabled!');_0x2fa704[_0x7549('0x5d')]=util[_0x7549('0x41')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x24625b[_0x7549('0x59')],_0x2fa704[_0x7549('0x5e')],md5(_0x2fa704['uniqueid']));}else{_0x2fa704['recordingURL']='';}return getConnection(_0x24625b)[_0x7549('0x21')](function(_0x4d6752){_0x1e4bfa=_0x4d6752;if(!_[_0x7549('0x1e')](_0x165359)){return getUser(_0x24625b,_0x165359[_0x7549('0x4d')],_0x1e4bfa);}else{return getUser(_0x24625b,null,_0x1e4bfa);}})[_0x7549('0x21')](function(_0x125a8a){_0x497c1b=_0x125a8a;return getEndUser(_0x24625b,_0x418223,_0x2fa704[_0x7549('0x5f')],_0x2fa704[_0x7549('0x60')],_0x1e4bfa);})[_0x7549('0x21')](function(_0x4b98f8){_0xb5c6fe=_0x4b98f8;return getTicket(_0x24625b,_0x497c1b,_0xb5c6fe,_0x418223,_0x2fa704,_0x418223[_0x7549('0x61')],_0x1e4bfa);})[_0x7549('0x21')](function(_0x37d2aa){_0x33592b=_0x37d2aa;logger[_0x7549('0x1b')]('['+_0x2fa704[_0x7549('0x76')]['toUpperCase']()+_0x7549('0x78'),_0x33592b['id']);logger[_0x7549('0x1b')]('['+_0x2fa704[_0x7549('0x76')]['toUpperCase']()+']\x20Integration\x20account\x20type\x20%s.',_0x24625b['type']);})[_0x7549('0x66')](function(_0x50e647){logger[_0x7549('0x64')]('['+_0x2fa704[_0x7549('0x76')][_0x7549('0x77')]()+']',_0x50e647);});}; \ No newline at end of file +var _0xe6fe=['Account','Contact','first','Phone','attributes','type','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','','Caller\x20-\x20%s','format','Company','No\x20Company','forEach','picklist','idField','variable','variableName','toString','customVariable','Variable','name','toLowerCase','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','login','username','Connection\x20established.','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','queue','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','[QUEUE]','outbound','recordingFormat','none','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase','calleridnum','Fields',']\x20Ticket\x20%s\x20created.','lodash','request-promise','moment','bluebird','md5','jsforce','util','ioredis','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','assign','Subjects','getString','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','account','WhatId','ticketType','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','create','isNil','validateEmail','sobject','User','find','execute','then','length','Email','Agent\x20%s\x20found.','resolve','Name','identity','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','$or','additionalSearchLead','merge','Lead','additionalSearchAccount'];(function(_0x28669c,_0x1f62c4){var _0x4a3af6=function(_0x3e25d5){while(--_0x3e25d5){_0x28669c['push'](_0x28669c['shift']());}};_0x4a3af6(++_0x1f62c4);}(_0xe6fe,0x152));var _0xee6f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe6fe[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xee6f('0x0'));var rp=require(_0xee6f('0x1'));var moment=require(_0xee6f('0x2'));var BPromise=require(_0xee6f('0x3'));var md5=require(_0xee6f('0x4'));var jsforce=require(_0xee6f('0x5'));var util=require(_0xee6f('0x6'));var Redis=require(_0xee6f('0x7'));var intUtil=require('./util');var config=require(_0xee6f('0x8'));var logger=require(_0xee6f('0x9'))(_0xee6f('0xa'));config[_0xee6f('0xb')]=_[_0xee6f('0xc')](config[_0xee6f('0xb')],{'host':_0xee6f('0xd'),'port':0x18eb});var io=require(_0xee6f('0xe'))(new Redis(config[_0xee6f('0xb')]));function emit(_0x4f2ae6,_0xb8f9ee,_0x1918f3){io['to'](_0x4f2ae6)[_0xee6f('0xf')](_0xb8f9ee,_0x1918f3);}function getTicket(_0x5f8921,_0x66fe0a,_0x23df8b,_0x348caf,_0x20abe1,_0x129fd5,_0x422fd7,_0x3d2fd4){var _0x2373d7=Object[_0xee6f('0x10')]({},{'OwnerId':_0x66fe0a['id'],'Subject':intUtil['getString'](_0x348caf[_0xee6f('0x11')],_0x20abe1,'\x20'),'Description':intUtil[_0xee6f('0x12')](_0x348caf['Descriptions'],_0x20abe1,'\x0a')},getCustomFields(_0x129fd5,_0x20abe1));if(_0x23df8b){if(_0x348caf['ticketType']==='Task'){_0x2373d7[_0xee6f('0x13')]=moment[_0xee6f('0x14')]();_0x2373d7[_0xee6f('0x15')]=![];_0x2373d7[_0xee6f('0x16')]=![];if(_0x23df8b[_0xee6f('0x17')]===_0xee6f('0x18')||_0x23df8b[_0xee6f('0x17')]===_0xee6f('0x19')){_0x2373d7[_0xee6f('0x1a')]=_0x23df8b['id'];}else if(_0x23df8b[_0xee6f('0x17')]===_0xee6f('0x1b')){_0x2373d7[_0xee6f('0x1c')]=_0x23df8b['id'];}}else if(_0x348caf[_0xee6f('0x1d')]==='Case'){if(_0x23df8b['endUserType']===_0xee6f('0x18')){_0x2373d7[_0xee6f('0x1e')]=_0x23df8b['id'];}else if(_0x23df8b[_0xee6f('0x17')]===_0xee6f('0x1b')){_0x2373d7[_0xee6f('0x1f')]=_0x23df8b['id'];}else if(_0x23df8b[_0xee6f('0x17')]===_0xee6f('0x19')&&_0x348caf[_0xee6f('0x20')]){_0x2373d7[_0x348caf[_0xee6f('0x20')]]=_0x23df8b['id'];}else{logger[_0xee6f('0x21')](_0xee6f('0x22'));}}}return _0x422fd7['sobject'](_0x348caf['ticketType'])[_0xee6f('0x23')](_0x2373d7);}function getUser(_0x5d3c36,_0x3f2978,_0x1f44bb){if(!_[_0xee6f('0x24')](_0x3f2978)&&intUtil[_0xee6f('0x25')](_0x3f2978)){var _0x5b0cc6={'Email':_0x3f2978};var _0x3d9042={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x1f44bb[_0xee6f('0x26')](_0xee6f('0x27'))[_0xee6f('0x28')](_0x5b0cc6,_0x3d9042)[_0xee6f('0x29')]()[_0xee6f('0x2a')](function(_0x317a9d){if(_0x317a9d[_0xee6f('0x2b')]){var _0x234dd6=_[_0xee6f('0x28')](_0x317a9d,function(_0x233c97){return _0x233c97[_0xee6f('0x2c')]===_0x3f2978;});if(_0x234dd6){logger[_0xee6f('0x21')](_0xee6f('0x2d'),_0x3f2978);return BPromise[_0xee6f('0x2e')]({'id':_0x234dd6['Id'],'name':_0x234dd6[_0xee6f('0x2f')]});}}else{logger[_0xee6f('0x21')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x3f2978);return _0x1f44bb[_0xee6f('0x30')]()[_0xee6f('0x2a')](function(_0x23adda){return BPromise['resolve']({'id':_0x23adda[_0xee6f('0x31')],'name':_0x23adda[_0xee6f('0x32')]});});}});}else{logger[_0xee6f('0x21')](_0xee6f('0x33'),_0x3f2978);return _0x1f44bb[_0xee6f('0x30')]()[_0xee6f('0x2a')](function(_0x4a9965){return BPromise[_0xee6f('0x2e')]({'id':_0x4a9965['user_id'],'name':_0x4a9965[_0xee6f('0x32')]});});}}function getEndUser(_0x261c42,_0x287e2,_0x4c2e42,_0x138a38,_0xc54fb8){var _0x149548={'$or':{'Phone':_0x138a38}};var _0x192c64={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xee6f('0x2e')]()[_0xee6f('0x2a')](function(){logger['info']('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x138a38,_0x287e2[_0xee6f('0x34')]);switch(_0x287e2[_0xee6f('0x34')]){case _0xee6f('0x35'):var _0x34b5e1=_[_0xee6f('0x36')](_0x149548);if(_0x287e2[_0xee6f('0x37')]){var _0x5c3472={};_0x5c3472[_0x287e2[_0xee6f('0x37')]]=_0x138a38;_['merge'](_0x34b5e1[_0xee6f('0x38')],_0x5c3472);}return _0xc54fb8[_0xee6f('0x26')]('Contact')[_0xee6f('0x28')](_0x34b5e1,_0x192c64)[_0xee6f('0x29')]()[_0xee6f('0x2a')](function(_0x59f270){if(_0x59f270&&_0x59f270['length']){return _0x59f270;}else{var _0x4e9209=_[_0xee6f('0x36')](_0x149548);if(_0x287e2[_0xee6f('0x39')]){var _0x26d0f3={};_0x26d0f3[_0x287e2[_0xee6f('0x39')]]=_0x138a38;_[_0xee6f('0x3a')](_0x4e9209[_0xee6f('0x38')],_0x26d0f3);}return _0xc54fb8['sobject'](_0xee6f('0x3b'))[_0xee6f('0x28')](_0x4e9209,_0x192c64);}});case'account_contact_lead':var _0xe5aef2=_[_0xee6f('0x36')](_0x149548);if(_0x287e2[_0xee6f('0x3c')]){var _0x5c3472={};_0x5c3472[_0x287e2['additionalSearchAccount']]=_0x138a38;_[_0xee6f('0x3a')](_0xe5aef2['$or'],_0x5c3472);}return _0xc54fb8[_0xee6f('0x26')](_0xee6f('0x3d'))[_0xee6f('0x28')](_0xe5aef2,_0x192c64)[_0xee6f('0x29')]()[_0xee6f('0x2a')](function(_0xb6b912){if(_0xb6b912&&_0xb6b912[_0xee6f('0x2b')]){return _0xb6b912;}else{var _0x1a3968=_[_0xee6f('0x36')](_0x149548);if(_0x287e2[_0xee6f('0x37')]){var _0x2c3ef1={};_0x2c3ef1[_0x287e2[_0xee6f('0x37')]]=_0x138a38;_['merge'](_0x1a3968[_0xee6f('0x38')],_0x2c3ef1);}return _0xc54fb8[_0xee6f('0x26')](_0xee6f('0x3e'))[_0xee6f('0x28')](_0x1a3968,_0x192c64)[_0xee6f('0x2a')](function(_0x1fdf09){if(_0x1fdf09&&_0x1fdf09[_0xee6f('0x2b')]){return _0x1fdf09;}else{var _0x1d3813=_['cloneDeep'](_0x149548);if(_0x287e2[_0xee6f('0x39')]){var _0x255c59={};_0x255c59[_0x287e2[_0xee6f('0x39')]]=_0x138a38;_[_0xee6f('0x3a')](_0x1d3813[_0xee6f('0x38')],_0x255c59);}return _0xc54fb8[_0xee6f('0x26')](_0xee6f('0x3b'))[_0xee6f('0x28')](_0x1d3813,_0x192c64);}});}});case _0xee6f('0x18'):var _0x34b5e1=_['cloneDeep'](_0x149548);if(_0x287e2[_0xee6f('0x37')]){var _0x5c3472={};_0x5c3472[_0x287e2[_0xee6f('0x37')]]=_0x138a38;_['merge'](_0x34b5e1[_0xee6f('0x38')],_0x5c3472);}return _0xc54fb8[_0xee6f('0x26')](_0xee6f('0x3e'))[_0xee6f('0x28')](_0x34b5e1,_0x192c64)[_0xee6f('0x29')]();case _0xee6f('0x19'):var _0x2645e3=_[_0xee6f('0x36')](_0x149548);if(_0x287e2['additionalSearchLead']){var _0x5c3472={};_0x5c3472[_0x287e2[_0xee6f('0x39')]]=_0x138a38;_[_0xee6f('0x3a')](_0x2645e3['$or'],_0x5c3472);}return _0xc54fb8['sobject'](_0xee6f('0x3b'))[_0xee6f('0x28')](_0x2645e3,_0x192c64);case'account':var _0xe5aef2=_['cloneDeep'](_0x149548);if(_0x287e2[_0xee6f('0x3c')]){var _0x5c3472={};_0x5c3472[_0x287e2[_0xee6f('0x3c')]]=_0x138a38;_[_0xee6f('0x3a')](_0xe5aef2['$or'],_0x5c3472);}return _0xc54fb8[_0xee6f('0x26')](_0xee6f('0x3d'))[_0xee6f('0x28')](_0xe5aef2,_0x192c64);default:return null;}})[_0xee6f('0x2a')](function(_0x21f45b){if(_0x21f45b&&_0x21f45b[_0xee6f('0x2b')]){var _0x3167cc=_[_0xee6f('0x3f')](_0x21f45b);if(_0x3167cc){return BPromise[_0xee6f('0x2e')]({'id':_0x3167cc['Id'],'name':_0x3167cc[_0xee6f('0x2f')],'phone':_0x3167cc[_0xee6f('0x40')],'endUserType':_0x3167cc[_0xee6f('0x41')][_0xee6f('0x42')]['toLowerCase']()});}}})[_0xee6f('0x2a')](function(_0x4c2dc7){if(_0x4c2dc7){logger[_0xee6f('0x21')](_0xee6f('0x43'),_0x4c2dc7['endUserType'],_0x138a38);return BPromise[_0xee6f('0x2e')](_0x4c2dc7);}else{logger[_0xee6f('0x21')](_0xee6f('0x44'),_0x138a38);var _0x3c5e76={'Phone':_0x138a38};if(_0x287e2[_0xee6f('0x45')]){if(_0x287e2[_0xee6f('0x45')]===_0xee6f('0x18')){logger[_0xee6f('0x21')](_0xee6f('0x46'),_0x138a38,_0x287e2['moduleCreate']);_0x3c5e76['LastName']=_0x4c2e42!==_0xee6f('0x47')?_0x4c2e42:util['format'](_0xee6f('0x48'),_0x138a38);}else if(_0x287e2[_0xee6f('0x45')]===_0xee6f('0x19')){logger[_0xee6f('0x21')](_0xee6f('0x46'),_0x138a38,_0x287e2['moduleCreate']);_0x3c5e76['LastName']=_0x4c2e42!==_0xee6f('0x47')?_0x4c2e42:util[_0xee6f('0x49')](_0xee6f('0x48'),_0x138a38);_0x3c5e76[_0xee6f('0x4a')]=_0xee6f('0x4b');}else if(_0x287e2[_0xee6f('0x45')]==='account'){logger[_0xee6f('0x21')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x138a38,_0x287e2[_0xee6f('0x45')]);_0x3c5e76['Name']=_0x4c2e42!==_0xee6f('0x47')?_0x4c2e42:util[_0xee6f('0x49')](_0xee6f('0x48'),_0x138a38);}else{return null;}}return _0xc54fb8[_0xee6f('0x26')](_['upperFirst'](_0x287e2[_0xee6f('0x45')]))[_0xee6f('0x23')](_0x3c5e76)[_0xee6f('0x2a')](function(_0x3bd2f6){return BPromise['resolve']({'id':_0x3bd2f6['id'],'endUserType':_0x287e2[_0xee6f('0x45')]});});}});}function getCustomFields(_0x16c879,_0x5926c2){var _0x422530={};if(_0x16c879['length']>0x0){_[_0xee6f('0x4c')](_0x16c879,function(_0xbfb45e){if(_['includes'](['string',_0xee6f('0x4d')],_0xbfb45e[_0xee6f('0x42')])&&_0xbfb45e[_0xee6f('0x4e')]){_0x422530[_0xbfb45e[_0xee6f('0x4e')]]=_0xbfb45e['content']['toString']();}else if(_0xbfb45e[_0xee6f('0x42')]===_0xee6f('0x4f')&&_0xbfb45e[_0xee6f('0x50')]&&_0xbfb45e[_0xee6f('0x4e')]){_0x5926c2[_0xbfb45e[_0xee6f('0x50')]]&&(_0x422530[_0xbfb45e[_0xee6f('0x4e')]]=_0x5926c2[_0xbfb45e[_0xee6f('0x50')]][_0xee6f('0x51')]());}else if(_0xbfb45e['type']===_0xee6f('0x52')&&_0xbfb45e[_0xee6f('0x53')]&&_0xbfb45e[_0xee6f('0x53')][_0xee6f('0x54')]&&_0xbfb45e[_0xee6f('0x4e')]){_0x5926c2[_0xbfb45e['Variable'][_0xee6f('0x54')][_0xee6f('0x55')]()]&&(_0x422530[_0xbfb45e[_0xee6f('0x4e')]]=_0x5926c2[_0xbfb45e[_0xee6f('0x53')]['name'][_0xee6f('0x55')]()][_0xee6f('0x51')]());}});}return _0x422530;}function getConnection(_0x472d44){var _0x4166bd=_0x472d44[_0xee6f('0x56')][_0xee6f('0x57')](_0x472d44[_0xee6f('0x58')]);var _0x376cd6=new jsforce[(_0xee6f('0x59'))]({'oauth2':{'loginUrl':_0x472d44[_0xee6f('0x5a')]||_0xee6f('0x5b'),'clientId':_0x472d44[_0xee6f('0x5c')],'clientSecret':_0x472d44['clientSecret']}});return _0x376cd6[_0xee6f('0x5d')](_0x472d44[_0xee6f('0x5e')],_0x4166bd)[_0xee6f('0x2a')](function(){logger[_0xee6f('0x21')](_0xee6f('0x5f'));return _0x376cd6;});}exports['queue']=function(_0x1fab8b,_0x5cddc9,_0x1f442a,_0xee20e2,_0x16e0fd,_0x8002f){var _0x3c94f3,_0x1111ee,_0x566b40,_0x3f7d62;_0x8002f['serverUrl']=intUtil[_0xee6f('0x60')](_0x8002f[_0xee6f('0x61')]);_0x8002f[_0xee6f('0x5a')]=intUtil['stripTrailingSlash'](_0x8002f[_0xee6f('0x5a')]);if(_0x16e0fd&&_0x16e0fd[_0xee6f('0x62')]){logger[_0xee6f('0x21')]('[QUEUE]',_0xee6f('0x63'));_0x5cddc9[_0xee6f('0x64')]=util[_0xee6f('0x49')](_0xee6f('0x65'),_0x8002f[_0xee6f('0x61')],_0x5cddc9[_0xee6f('0x66')],md5(_0x5cddc9[_0xee6f('0x66')]));}else{_0x5cddc9[_0xee6f('0x64')]='';}return getConnection(_0x8002f)[_0xee6f('0x2a')](function(_0xdb8481){_0x3f7d62=_0xdb8481;return getUser(_0x8002f,_0xee20e2[_0xee6f('0x67')],_0x3f7d62);})[_0xee6f('0x2a')](function(_0x2e78f7){_0x3c94f3=_0x2e78f7;return getEndUser(_0x8002f,_0x1f442a,_0x5cddc9[_0xee6f('0x68')],_0x5cddc9['calleridnum'],_0x3f7d62);})[_0xee6f('0x2a')](function(_0x286133){_0x1111ee=_0x286133;return getTicket(_0x8002f,_0x3c94f3,_0x1111ee,_0x1f442a,_0x5cddc9,_0x1f442a['Fields'],_0x3f7d62,_0xee6f('0x69'));})[_0xee6f('0x2a')](function(_0x5aa88d){_0x566b40=_0x5aa88d;logger[_0xee6f('0x21')](_0xee6f('0x6a'),_0x566b40['id']);logger[_0xee6f('0x21')](_0xee6f('0x6b'),_0x566b40['id'],_0xee20e2[_0xee6f('0x54')],_0x8002f[_0xee6f('0x42')]);switch(_0x8002f[_0xee6f('0x42')]){case'integrationTab':emit(util['format'](_0xee6f('0x6c'),_0xee20e2[_0xee6f('0x54')]),'trigger:salesforce:display',{'recordId':_0x566b40['id']});break;case _0xee6f('0x6d'):emit(util[_0xee6f('0x49')]('user:%s',_0xee20e2[_0xee6f('0x54')]),_0xee6f('0x6e'),{'uri':util[_0xee6f('0x49')](_0xee6f('0x6f'),_0x3f7d62[_0xee6f('0x70')],_0x566b40['id'])});break;default:logger[_0xee6f('0x71')](_0xee6f('0x72'));}})[_0xee6f('0x73')](function(_0x337eef){logger[_0xee6f('0x71')](_0xee6f('0x74'),_0x337eef);});};exports[_0xee6f('0x75')]=function(_0x269c76,_0x4da9bf,_0x1383ed,_0x4f923f,_0x31c3c7,_0x3d45e7,_0x4bf8c7){var _0x46eda3,_0x4c215d,_0x348c23,_0x24de15;_0x3d45e7[_0xee6f('0x61')]=intUtil[_0xee6f('0x60')](_0x3d45e7[_0xee6f('0x61')]);_0x3d45e7[_0xee6f('0x5a')]=intUtil[_0xee6f('0x60')](_0x3d45e7[_0xee6f('0x5a')]);if(_0x4bf8c7&&_0x4bf8c7['recordingFormat']&&_0x4bf8c7[_0xee6f('0x76')]!==_0xee6f('0x77')){logger['info']('[OUTBOUND]',_0xee6f('0x63'));_0x4da9bf['recordingURL']=util[_0xee6f('0x49')](_0xee6f('0x65'),_0x3d45e7['serverUrl'],_0x4da9bf['uniqueid'],md5(_0x4da9bf[_0xee6f('0x66')]));}return getConnection(_0x3d45e7)[_0xee6f('0x2a')](function(_0x18a4de){_0x24de15=_0x18a4de;return getUser(_0x3d45e7,_0x4f923f[_0xee6f('0x67')],_0x24de15);})[_0xee6f('0x2a')](function(_0x550043){_0x46eda3=_0x550043;return getEndUser(_0x3d45e7,_0x1383ed,_0x4da9bf[_0xee6f('0x78')],_0x4da9bf[_0xee6f('0x79')],_0x24de15);})[_0xee6f('0x2a')](function(_0x53f634){_0x4c215d=_0x53f634;return getTicket(_0x3d45e7,_0x46eda3,_0x4c215d,_0x1383ed,_0x4da9bf,_0x1383ed['Fields'],_0x24de15,_0xee6f('0x75'));})[_0xee6f('0x2a')](function(_0x3c2495){_0x348c23=_0x3c2495;logger['info'](_0xee6f('0x7a'),_0x348c23['id']);logger[_0xee6f('0x21')](_0xee6f('0x7b'),_0x348c23['id'],_0x4f923f[_0xee6f('0x54')],_0x3d45e7['type']);switch(_0x3d45e7[_0xee6f('0x42')]){case'integrationTab':emit(util[_0xee6f('0x49')](_0xee6f('0x6c'),_0x4f923f['name']),_0xee6f('0x7c'),{'recordId':_0x348c23['id']});break;case _0xee6f('0x6d'):emit(util[_0xee6f('0x49')](_0xee6f('0x6c'),_0x4f923f[_0xee6f('0x54')]),_0xee6f('0x6e'),{'uri':util[_0xee6f('0x49')](_0xee6f('0x6f'),_0x24de15['instanceUrl'],_0x348c23['id'])});break;default:logger['error'](_0xee6f('0x7d'),_0xee6f('0x7e'));}})[_0xee6f('0x73')](function(_0x4ebd83){logger['error'](_0xee6f('0x7d'),_0x4ebd83);});};exports[_0xee6f('0x7f')]=function(_0x404866,_0x1f71e1,_0xcca232,_0x30c8fe,_0x424ef6,_0x4b1a8a){var _0x1a3885,_0x177a66,_0x1203e7,_0x31a053;_0x4b1a8a[_0xee6f('0x61')]=intUtil[_0xee6f('0x60')](_0x4b1a8a[_0xee6f('0x61')]);_0x4b1a8a[_0xee6f('0x5a')]=intUtil['stripTrailingSlash'](_0x4b1a8a[_0xee6f('0x5a')]);if(_0x424ef6&&_0x424ef6['monitor_format']){logger[_0xee6f('0x21')]('['+_0x1f71e1[_0xee6f('0x80')][_0xee6f('0x81')]()+']',_0xee6f('0x63'));_0x1f71e1[_0xee6f('0x64')]=util['format'](_0xee6f('0x65'),_0x4b1a8a[_0xee6f('0x61')],_0x1f71e1[_0xee6f('0x66')],md5(_0x1f71e1['uniqueid']));}else{_0x1f71e1[_0xee6f('0x64')]='';}return getConnection(_0x4b1a8a)[_0xee6f('0x2a')](function(_0x3289dd){_0x31a053=_0x3289dd;if(!_['isNil'](_0x30c8fe)){return getUser(_0x4b1a8a,_0x30c8fe[_0xee6f('0x54')],_0x31a053);}else{return getUser(_0x4b1a8a,null,_0x31a053);}})['then'](function(_0x2fb130){_0x1a3885=_0x2fb130;return getEndUser(_0x4b1a8a,_0xcca232,_0x1f71e1[_0xee6f('0x68')],_0x1f71e1[_0xee6f('0x82')],_0x31a053);})['then'](function(_0x549cae){_0x177a66=_0x549cae;return getTicket(_0x4b1a8a,_0x1a3885,_0x177a66,_0xcca232,_0x1f71e1,_0xcca232[_0xee6f('0x83')],_0x31a053);})[_0xee6f('0x2a')](function(_0x26b194){_0x1203e7=_0x26b194;logger[_0xee6f('0x21')]('['+_0x1f71e1[_0xee6f('0x80')][_0xee6f('0x81')]()+_0xee6f('0x84'),_0x1203e7['id']);logger[_0xee6f('0x21')]('['+_0x1f71e1[_0xee6f('0x80')][_0xee6f('0x81')]()+']\x20Integration\x20account\x20type\x20%s.',_0x4b1a8a[_0xee6f('0x42')]);})[_0xee6f('0x73')](function(_0x318047){logger['error']('['+_0x1f71e1[_0xee6f('0x80')][_0xee6f('0x81')]()+']',_0x318047);});}; \ 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 88757ae..5afa953 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 _0x209c=['stripTrailingSlash','serverUrl','format','%s/api/now/table/','isNil','email','callDirection','unmanaged','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','request-promise','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','length','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','active','true','userId','adminId','userEmail','adminEmail','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','idField','variable','variableName','customVariable','Variable',']\x20getTicket\x20input\x20crm','outbound','endUserId','incident','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketNumber','number','?sysparm_query=name%3D','label_entry','Incident','ticketId','Incident\x20-\x20','push','all','Tags','map','name','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','user:%s','trigger:browser:url','username','password','sysparm_display_value=true','remoteUri'];(function(_0x589aee,_0x140a03){var _0x2f5ed4=function(_0x3d224f){while(--_0x3d224f){_0x589aee['push'](_0x589aee['shift']());}};_0x2f5ed4(++_0x140a03);}(_0x209c,0xf4));var _0xc209=function(_0x2d645d,_0x8513e9){_0x2d645d=_0x2d645d-0x0;var _0x23e71e=_0x209c[_0x2d645d];return _0x23e71e;};'use strict';var _=require('lodash');var Promise=require('bluebird');var rp=require(_0xc209('0x0'));var util=require(_0xc209('0x1'));var md5=require(_0xc209('0x2'));var Redis=require(_0xc209('0x3'));var intUtil=require(_0xc209('0x4'));var config=require(_0xc209('0x5'));var logger=require(_0xc209('0x6'))(_0xc209('0x7'));config[_0xc209('0x8')]=_['defaults'](config[_0xc209('0x8')],{'host':_0xc209('0x9'),'port':0x18eb});var io=require(_0xc209('0xa'))(new Redis(config['redis']));function getAdminUser(_0x27d87e,_0x3bd8df,_0x5c6253,_0x421616,_0x2963e8,_0x5a30c5){return new Promise(function(_0x51b029,_0x4ddd32){var _0x49f319={'method':_0xc209('0xb'),'uri':_0x421616+_0xc209('0xc')+'&'+_0x2963e8+'&'+_0x5a30c5,'auth':_0x3bd8df,'json':!![]};return rp(_0x49f319)['then'](function(_0x3bd2b1){if(_0x3bd2b1['result'][_0xc209('0xd')]>0x0){_0x5c6253['adminId']=_0x3bd2b1[_0xc209('0xe')][0x0][_0xc209('0xf')];}logger[_0xc209('0x10')]('['+[_0x27d87e[_0xc209('0x11')]()]+_0xc209('0x12'),_0x5c6253);_0x51b029(_0x5c6253);})[_0xc209('0x13')](function(_0x2c20b1){logger[_0xc209('0x14')]('['+[_0x27d87e['toUpperCase']()]+']',_0x2c20b1[_0xc209('0x15')]);_0x4ddd32(_0x2c20b1['message']);});});}function getUser(_0xee9b72,_0x7625f,_0x58a7c7,_0x574a76,_0x2864cc){return function(_0xec0b41){logger['info']('['+[_0xee9b72['toUpperCase']()]+_0xc209('0x16'),_0xec0b41);return new Promise(function(_0x3a8288,_0x3d0ee5){if(intUtil[_0xc209('0x17')](_0xec0b41['userEmail'])){var _0x3784f0={'method':_0xc209('0xb'),'uri':_0x58a7c7+_0xc209('0x18')+_0xec0b41['userEmail']+'&'+_0x574a76+'&'+_0x2864cc,'auth':_0x7625f,'json':!![]};logger['info']('['+[_0xee9b72[_0xc209('0x11')]()]+_0xc209('0x19'),_0x3784f0);return rp(_0x3784f0)[_0xc209('0x1a')](function(_0x45bd75){logger[_0xc209('0x10')]('['+[_0xee9b72[_0xc209('0x11')]()]+_0xc209('0x1b'),_0x45bd75);if(_0x45bd75['result']['length']>0x0&&String(_0x45bd75[_0xc209('0xe')][0x0][_0xc209('0x1c')])===_0xc209('0x1d')){_0xec0b41[_0xc209('0x1e')]=_0x45bd75[_0xc209('0xe')][0x0][_0xc209('0xf')];}else{_0xec0b41[_0xc209('0x1e')]=_0xec0b41[_0xc209('0x1f')];_0xec0b41[_0xc209('0x20')]=_0xec0b41[_0xc209('0x21')];}logger[_0xc209('0x10')]('['+[_0xee9b72['toUpperCase']()]+'],\x20getUser\x20crm',_0xec0b41);_0x3a8288(_0xec0b41);})[_0xc209('0x13')](function(_0x304e05){logger['error']('['+[_0xee9b72[_0xc209('0x11')]()]+']',_0x304e05[_0xc209('0x15')]);_0x3d0ee5(_0x304e05[_0xc209('0x15')]);});}else{logger[_0xc209('0x10')]('['+[_0xee9b72[_0xc209('0x11')]()]+']\x20using\x20admin\x20profile');_0xec0b41[_0xc209('0x1e')]=_0xec0b41[_0xc209('0x1f')];_0xec0b41[_0xc209('0x20')]=_0xec0b41[_0xc209('0x21')];_0x3a8288(_0xec0b41);}});};}function createEndUser(_0x54a98d,_0x3546d1,_0x50070c,_0xba07bb,_0x4afb0e){logger[_0xc209('0x10')]('['+[_0x54a98d[_0xc209('0x11')]()]+_0xc209('0x22'),_0x50070c);return new Promise(function(_0x11d53c,_0x1c4e13){var _0x151544={'method':_0xc209('0x23'),'uri':_0xba07bb+_0xc209('0x24')+_0x4afb0e,'body':{'user_name':_0x50070c[_0xc209('0x25')],'roles':_0xc209('0x26'),'first_name':_0x50070c[_0xc209('0x25')],'active':_0xc209('0x1d'),'date_format':_0xc209('0x27'),'phone':_0x50070c[_0xc209('0x25')]},'auth':_0x3546d1,'json':!![]};return rp(_0x151544)[_0xc209('0x1a')](function(_0x4e49ac){logger['info']('['+[_0x54a98d['toUpperCase']()]+_0xc209('0x28'),_0x4e49ac['result']);_0x50070c['endUserId']=_0x4e49ac['result'][_0xc209('0xf')];_0x11d53c(_0x50070c);})[_0xc209('0x13')](function(_0x3e14e9){logger[_0xc209('0x14')]('['+[_0x54a98d['toUpperCase']()]+']',_0x3e14e9[_0xc209('0x15')]);_0x1c4e13(_0x3e14e9[_0xc209('0x15')]);});});}function getEndUser(_0x412cc4,_0x5d0ab0,_0x35b091,_0x2f92d4,_0x76e484){return function(_0x3902dc){logger[_0xc209('0x10')]('['+[_0x412cc4['toUpperCase']()]+_0xc209('0x29'),_0x3902dc);return new Promise(function(_0x21f87e,_0x3f4163){var _0x5ca959={'method':'GET','uri':_0x35b091+'sys_user?sysparm_query=phone%3D'+_0x3902dc[_0xc209('0x25')]+'&'+_0x2f92d4+'&'+_0x76e484,'auth':_0x5d0ab0,'json':!![]};return rp(_0x5ca959)['then'](function(_0x63f47){if(_0x63f47[_0xc209('0xe')][_0xc209('0xd')]>0x0){_0x3902dc['endUserId']=_0x63f47[_0xc209('0xe')][0x0]['sys_id'];logger['info']('['+[_0x412cc4[_0xc209('0x11')]()]+'],\x20getEndUser\x20crm',_0x3902dc);_0x21f87e(_0x3902dc);}else{return createEndUser(_0x412cc4,_0x5d0ab0,_0x3902dc,_0x35b091,_0x2f92d4)[_0xc209('0x1a')](function(_0x2210fd){logger[_0xc209('0x10')]('['+[_0x412cc4[_0xc209('0x11')]()]+_0xc209('0x2a'),_0x2210fd);_0x21f87e(_0x2210fd);});}})['catch'](function(_0x5c6615){logger['error']('['+[_0x412cc4[_0xc209('0x11')]()]+']',_0x5c6615[_0xc209('0x15')]);_0x3f4163(_0x5c6615[_0xc209('0x15')]);});});};}function getCustomFields(_0x10858c,_0x5e2ff8){var _0x2893a8={};if(_0x10858c[_0xc209('0xd')]>0x0){_[_0xc209('0x2b')](_0x10858c,function(_0x29750f){if(_[_0xc209('0x2c')]([_0xc209('0x2d'),_0xc209('0x2e')],_0x29750f[_0xc209('0x2f')])&&_0x29750f[_0xc209('0x30')]&&!_0x29750f[_0xc209('0x31')]){_0x2893a8[_0x29750f['nameField'][_0xc209('0x32')]()]=_0x29750f[_0xc209('0x33')][_0xc209('0x34')]();}else if(_['includes'](['string','picklist'],_0x29750f[_0xc209('0x2f')])&&_0x29750f[_0xc209('0x35')]&&_0x29750f[_0xc209('0x31')]){_0x2893a8[_0x29750f[_0xc209('0x35')]['toLowerCase']()]=_0x29750f[_0xc209('0x33')]['toString']();}else if(_0x29750f['type']===_0xc209('0x36')&&_0x29750f[_0xc209('0x37')]&&_0x29750f[_0xc209('0x35')]&&_0x29750f['customField']){_0x2893a8[_0x29750f[_0xc209('0x35')][_0xc209('0x32')]()]=_0x5e2ff8[_0x29750f[_0xc209('0x37')]][_0xc209('0x34')]();}else if(_0x29750f[_0xc209('0x2f')]===_0xc209('0x38')&&_0x29750f[_0xc209('0x39')]&&_0x29750f[_0xc209('0x39')]['name']&&_0x29750f[_0xc209('0x35')]&&_0x29750f[_0xc209('0x31')]){_0x2893a8[_0x29750f[_0xc209('0x35')]['toLowerCase']()]=_0x5e2ff8[_0x29750f['Variable']['name'][_0xc209('0x32')]()]['toString']();}});}return _0x2893a8;}function getTicket(_0x2b6d40,_0x47541b,_0x1c35f4,_0x1c5da1,_0x5977d5,_0xbbb278){return function(_0x388982){logger['info']('['+[_0x2b6d40[_0xc209('0x11')]()]+_0xc209('0x3a'),_0x388982);return new Promise(function(_0x1838c1,_0x4a4c66){var _0x50fc85=_0x2b6d40['toLowerCase']()===_0xc209('0x3b')?_0x388982['userId']:_0x388982[_0xc209('0x3c')];var _0x46d418={'method':_0xc209('0x23'),'uri':_0x1c35f4+_0xc209('0x3d')+'?'+_0xbbb278,'body':Object[_0xc209('0x3e')]({},{'active':'true','caller_id':_0x50fc85,'assigned_to':_0x388982['userId'],'short_description':intUtil[_0xc209('0x3f')](_0x1c5da1[_0xc209('0x40')],_0x5977d5,'\x20'),'description':intUtil['getString'](_0x1c5da1[_0xc209('0x41')],_0x5977d5,'\x0a')},getCustomFields(_0x1c5da1[_0xc209('0x42')],_0x5977d5)),'auth':_0x47541b,'json':!![]};return rp(_0x46d418)['then'](function(_0x1fcbe0){logger['info']('['+[_0x2b6d40['toUpperCase']()]+_0xc209('0x43'),_0x1fcbe0[_0xc209('0xe')]);_0x388982['ticketId']=_0x1fcbe0[_0xc209('0xe')][_0xc209('0xf')];_0x388982[_0xc209('0x44')]=_0x1fcbe0[_0xc209('0xe')][_0xc209('0x45')];logger['info']('['+[_0x2b6d40[_0xc209('0x11')]()]+']\x20getTicket\x20crm',_0x388982);_0x1838c1(_0x388982);})[_0xc209('0x13')](function(_0x199129){logger[_0xc209('0x14')]('['+[_0x2b6d40[_0xc209('0x11')]()]+']',_0x199129[_0xc209('0x15')]);_0x4a4c66(_0x199129[_0xc209('0x15')]);});});};}function createRemoteTag(_0x52366a,_0x3c4e44,_0x56d3d1,_0x3455c0){return new Promise(function(_0x111cdb,_0x19effa){var _0x35ed8c={'method':_0xc209('0x23'),'uri':_0x56d3d1+'label'+'?'+_0x3455c0,'body':{'short_description':_0x52366a,'global':!![],'active':!![],'name':_0x52366a},'auth':_0x3c4e44,'json':!![]};return rp(_0x35ed8c)[_0xc209('0x1a')](function(_0x4fe855){var _0x2a6ba8=_0x4fe855['result'][_0xc209('0xf')];_0x111cdb(_0x2a6ba8);});});}function getRemoteTag(_0x1c4f52,_0x538aa5,_0x51a64c,_0x583a5e,_0xea441a){return new Promise(function(_0x25cabb,_0x137951){var _0x2c0503={'method':_0xc209('0xb'),'uri':_0x51a64c+'label'+_0xc209('0x46')+_0x1c4f52+'&'+_0x583a5e,'auth':_0x538aa5,'json':!![]};return rp(_0x2c0503)['then'](function(_0x22b4cf){if(_0x22b4cf[_0xc209('0xe')][_0xc209('0xd')]>0x0){var _0x40c97e=_0x22b4cf[_0xc209('0xe')][0x0][_0xc209('0xf')];_0x25cabb(_0x40c97e);}else{return createRemoteTag(_0x1c4f52,_0x538aa5,_0x51a64c,_0x583a5e)[_0xc209('0x1a')](function(_0xfbdd19){_0x25cabb(_0xfbdd19);});}});});}function assignTagToIncident(_0x10c2c1,_0xac2c5e,_0x16b1cb,_0x323d02,_0x246bdb){return new Promise(function(_0x2c0293,_0x9fb267){var _0x25ab99={'method':_0xc209('0x23'),'uri':_0x16b1cb+_0xc209('0x47')+'?'+_0x246bdb,'body':{'label':_0x10c2c1,'table':_0xc209('0x3d'),'id_type':_0xc209('0x48'),'table_key':_0x323d02[_0xc209('0x49')],'title':_0xc209('0x4a')+_0x323d02[_0xc209('0x44')],'id_display':_0x323d02[_0xc209('0x44')]},'auth':_0xac2c5e,'json':!![]};return rp(_0x25ab99)[_0xc209('0x1a')](function(_0x5cea14){_0x2c0293();})[_0xc209('0x13')](function(){_0x2c0293();});});}function manageTags(_0x49fb51,_0x1ba8cd,_0x2e8079,_0x1c8847,_0x253558,_0x2d8cc4,_0xa04aaf){return new Promise(function(_0x4baa96,_0x460eaf){var _0x2bbc6d=[];_0x1ba8cd[_0xc209('0x2b')](function(_0x2ca04e){_0x2bbc6d[_0xc209('0x4b')](getRemoteTag(_0x2ca04e,_0x2e8079,_0x1c8847,_0x2d8cc4,_0xa04aaf));});return Promise[_0xc209('0x4c')](_0x2bbc6d)[_0xc209('0x1a')](function(_0x2d2dbe){if(_0x2d2dbe[_0xc209('0xd')]){logger[_0xc209('0x10')]('['+[_0x49fb51[_0xc209('0x11')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x2d2dbe);var _0x1bfb0f=[];_0x2d2dbe[_0xc209('0x2b')](function(_0x30cc3f){_0x1bfb0f['push'](assignTagToIncident(_0x30cc3f,_0x2e8079,_0x1c8847,_0x253558,_0x2d8cc4));});return Promise['all'](_0x1bfb0f)[_0xc209('0x1a')](function(){_0x4baa96();})['catch'](function(){_0x4baa96();});}else{_0x4baa96();}});});}function getTags(_0x2bf4de,_0x3caa31,_0x1aa742,_0x2a546d,_0x32f2f0,_0x40681f){return function(_0x1bfd3c){return new Promise(function(_0x46f534,_0x315116){var _0x1e5485=[];var _0x2680f5=_0x2a546d[_0xc209('0x4d')];if(_0x2680f5&&_0x2680f5[_0xc209('0xd')]>0x0){_0x1e5485=_[_0xc209('0x4e')](_0x2680f5,_0xc209('0x4f'));}if(_0x1e5485['length']>0x0){return manageTags(_0x2bf4de,_0x1e5485,_0x3caa31,_0x1aa742,_0x1bfd3c,_0x32f2f0,_0x40681f)[_0xc209('0x1a')](function(){_0x46f534(_0x1bfd3c);});}else{_0x46f534(_0x1bfd3c);}});};}function emit(_0x29f132,_0x166f30,_0x3521f1){var _0x3b4826=_0xc209('0x50')+_0xc209('0x51')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0xc209('0x52');var _0xbd8460={'uri':_0x29f132+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x3521f1+_0x3b4826};io['to'](util['format'](_0xc209('0x53'),_0x166f30))['emit'](_0xc209('0x54'),_0xbd8460);}exports['cs']=function(_0x16ab94,_0x302284,_0x40ba6e,_0x9c9522,_0x54d1a5,_0x1ba731,_0xb1ba01,_0x4b819e){var _0xc8b8a6={};var _0x457f10={'user':_0x1ba731[_0xc209('0x55')],'pass':_0x1ba731[_0xc209('0x56')]};var _0x26b4a0='sysparm_limit=1';var _0x947585=_0xc209('0x57');_0x1ba731['remoteUri']=intUtil['stripTrailingSlash'](_0x1ba731[_0xc209('0x58')]);_0x1ba731['serverUrl']=intUtil[_0xc209('0x59')](_0x1ba731[_0xc209('0x5a')]);var _0x4194e3=util[_0xc209('0x5b')](_0xc209('0x5c'),_0x1ba731[_0xc209('0x58')]);_0xc8b8a6[_0xc209('0x20')]=!_[_0xc209('0x5d')](_0x9c9522)?_0x9c9522[_0xc209('0x5e')]:null;_0xc8b8a6['adminEmail']=_0x1ba731[_0xc209('0x5e')];_0xc8b8a6['endUserNumber']=_0x4b819e[_0xc209('0x32')]()===_0xc209('0x3b')?_0x302284['destcalleridnum']:_0x302284['calleridnum'];_0xc8b8a6[_0xc209('0x5f')]=_0x4b819e==='queue'||_0x4b819e===_0xc209('0x60')?_0xc209('0x61'):_0xc209('0x3b');var _0x51e639=util['format'](_0xc209('0x62'),_0x1ba731[_0xc209('0x5a')],_0x302284[_0xc209('0x63')],md5(_0x302284[_0xc209('0x63')]));if(_0x54d1a5&&_0x54d1a5[_0xc209('0x64')]){logger[_0xc209('0x10')](_0xc209('0x65'),_0xc209('0x66'));_0x302284[_0xc209('0x67')]=_0x51e639;}else if(_0xb1ba01&&_0xb1ba01[_0xc209('0x68')]&&_0xb1ba01[_0xc209('0x68')]!==_0xc209('0x69')){logger[_0xc209('0x10')](_0xc209('0x6a'),_0xc209('0x66'));_0x302284[_0xc209('0x67')]=_0x51e639;}else{_0x302284[_0xc209('0x67')]='';}return getAdminUser(_0x4b819e,_0x457f10,_0xc8b8a6,_0x4194e3,_0x947585,_0x26b4a0)[_0xc209('0x1a')](getUser(_0x4b819e,_0x457f10,_0x4194e3,_0x947585,_0x26b4a0))[_0xc209('0x1a')](getEndUser(_0x4b819e,_0x457f10,_0x4194e3,_0x947585,_0x26b4a0))[_0xc209('0x1a')](getTicket(_0x4b819e,_0x457f10,_0x4194e3,_0x40ba6e,_0x302284,_0x947585))[_0xc209('0x1a')](function(_0x497ef0){logger[_0xc209('0x10')](util[_0xc209('0x5b')](_0xc209('0x6b'),_0x497ef0['ticketId']));logger[_0xc209('0x10')](util['format']('call\x20direction:\x20%s',_0x4b819e));if(_0x4b819e!==_0xc209('0x60')){logger[_0xc209('0x10')]('['+[_0x4b819e['toUpperCase']()]+']',_0xc209('0x6c'));emit(_0x1ba731[_0xc209('0x58')],_0x9c9522[_0xc209('0x4f')],_0x497ef0[_0xc209('0x49')]);}})['catch'](function(_0x44c30a){logger['error']('['+[_0x4b819e[_0xc209('0x11')]()]+_0xc209('0x6d'),util[_0xc209('0x6e')](_0x44c30a,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x32dc=['inspect','lodash','bluebird','request-promise','md5','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','POST','endUserNumber','user','System','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','length','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','variableName','idField','customVariable','Variable','name','outbound','getString','Subjects','Descriptions','Fields','ticketId','number',']\x20getTicket\x20crm','label','incident','Incident','Incident\x20-\x20','ticketNumber','push',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','all','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','format','trigger:browser:url','username','password','sysparm_limit=1','stripTrailingSlash','remoteUri','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingFormat','none','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x32dc,0x1ad));var _0xc32d=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x32dc[_0x160c73];return _0xd9302;};'use strict';var _=require(_0xc32d('0x0'));var Promise=require(_0xc32d('0x1'));var rp=require(_0xc32d('0x2'));var util=require('util');var md5=require(_0xc32d('0x3'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0xc32d('0x4'));var logger=require(_0xc32d('0x5'))(_0xc32d('0x6'));config[_0xc32d('0x7')]=_[_0xc32d('0x8')](config[_0xc32d('0x7')],{'host':_0xc32d('0x9'),'port':0x18eb});var io=require(_0xc32d('0xa'))(new Redis(config['redis']));function getAdminUser(_0x2a8609,_0x4892d9,_0x83fc2b,_0x49d28a,_0x20a8df,_0x219a7d){return new Promise(function(_0x533a19,_0x29dcba){var _0x2fc4a2={'method':_0xc32d('0xb'),'uri':_0x49d28a+_0xc32d('0xc')+'&'+_0x20a8df+'&'+_0x219a7d,'auth':_0x4892d9,'json':!![]};return rp(_0x2fc4a2)[_0xc32d('0xd')](function(_0x42c2b9){if(_0x42c2b9[_0xc32d('0xe')]['length']>0x0){_0x83fc2b[_0xc32d('0xf')]=_0x42c2b9['result'][0x0][_0xc32d('0x10')];}logger[_0xc32d('0x11')]('['+[_0x2a8609[_0xc32d('0x12')]()]+_0xc32d('0x13'),_0x83fc2b);_0x533a19(_0x83fc2b);})[_0xc32d('0x14')](function(_0x3703a3){logger[_0xc32d('0x15')]('['+[_0x2a8609[_0xc32d('0x12')]()]+']',_0x3703a3['message']);_0x29dcba(_0x3703a3[_0xc32d('0x16')]);});});}function getUser(_0x5215f2,_0x26dd22,_0x15ff19,_0x3c1b89,_0x52071d){return function(_0x4e4c3f){logger[_0xc32d('0x11')]('['+[_0x5215f2[_0xc32d('0x12')]()]+_0xc32d('0x17'),_0x4e4c3f);return new Promise(function(_0x4d8c07,_0x36ed87){if(intUtil['validateEmail'](_0x4e4c3f['userEmail'])){var _0x596cf0={'method':_0xc32d('0xb'),'uri':_0x15ff19+_0xc32d('0x18')+_0x4e4c3f[_0xc32d('0x19')]+'&'+_0x3c1b89+'&'+_0x52071d,'auth':_0x26dd22,'json':!![]};logger[_0xc32d('0x11')]('['+[_0x5215f2[_0xc32d('0x12')]()]+_0xc32d('0x1a'),_0x596cf0);return rp(_0x596cf0)[_0xc32d('0xd')](function(_0x4f411f){logger['info']('['+[_0x5215f2[_0xc32d('0x12')]()]+_0xc32d('0x1b'),_0x4f411f);if(_0x4f411f[_0xc32d('0xe')]['length']>0x0&&String(_0x4f411f[_0xc32d('0xe')][0x0][_0xc32d('0x1c')])===_0xc32d('0x1d')){_0x4e4c3f[_0xc32d('0x1e')]=_0x4f411f[_0xc32d('0xe')][0x0][_0xc32d('0x10')];}else{_0x4e4c3f[_0xc32d('0x1e')]=_0x4e4c3f['adminId'];_0x4e4c3f[_0xc32d('0x19')]=_0x4e4c3f[_0xc32d('0x1f')];}logger['info']('['+[_0x5215f2['toUpperCase']()]+_0xc32d('0x20'),_0x4e4c3f);_0x4d8c07(_0x4e4c3f);})['catch'](function(_0x59e504){logger[_0xc32d('0x15')]('['+[_0x5215f2[_0xc32d('0x12')]()]+']',_0x59e504['message']);_0x36ed87(_0x59e504['message']);});}else{logger[_0xc32d('0x11')]('['+[_0x5215f2[_0xc32d('0x12')]()]+_0xc32d('0x21'));_0x4e4c3f[_0xc32d('0x1e')]=_0x4e4c3f[_0xc32d('0xf')];_0x4e4c3f[_0xc32d('0x19')]=_0x4e4c3f['adminEmail'];_0x4d8c07(_0x4e4c3f);}});};}function createEndUser(_0x88b1c1,_0x248024,_0x510b56,_0x100d1c,_0x55fcf4){logger[_0xc32d('0x11')]('['+[_0x88b1c1[_0xc32d('0x12')]()]+'],\x20createEndUser\x20input\x20crm',_0x510b56);return new Promise(function(_0x28aac6,_0x476e20){var _0x528ad0={'method':_0xc32d('0x22'),'uri':_0x100d1c+'sys_user?'+_0x55fcf4,'body':{'user_name':_0x510b56[_0xc32d('0x23')],'roles':_0xc32d('0x24'),'first_name':_0x510b56[_0xc32d('0x23')],'active':_0xc32d('0x1d'),'date_format':_0xc32d('0x25'),'phone':_0x510b56[_0xc32d('0x23')]},'auth':_0x248024,'json':!![]};return rp(_0x528ad0)[_0xc32d('0xd')](function(_0x10d5a5){logger[_0xc32d('0x11')]('['+[_0x88b1c1['toUpperCase']()]+'],\x20EndUser\x20schema',_0x10d5a5[_0xc32d('0xe')]);_0x510b56[_0xc32d('0x26')]=_0x10d5a5['result'][_0xc32d('0x10')];_0x28aac6(_0x510b56);})['catch'](function(_0x426bf4){logger[_0xc32d('0x15')]('['+[_0x88b1c1[_0xc32d('0x12')]()]+']',_0x426bf4[_0xc32d('0x16')]);_0x476e20(_0x426bf4[_0xc32d('0x16')]);});});}function getEndUser(_0x3d6202,_0x4e3d11,_0x3008ab,_0x369789,_0x1c8c9f){return function(_0x5498c2){logger[_0xc32d('0x11')]('['+[_0x3d6202[_0xc32d('0x12')]()]+_0xc32d('0x27'),_0x5498c2);return new Promise(function(_0x2151bd,_0x452bb5){var _0x25be76={'method':_0xc32d('0xb'),'uri':_0x3008ab+_0xc32d('0x28')+_0x5498c2[_0xc32d('0x23')]+'&'+_0x369789+'&'+_0x1c8c9f,'auth':_0x4e3d11,'json':!![]};return rp(_0x25be76)[_0xc32d('0xd')](function(_0x4bd5cf){if(_0x4bd5cf[_0xc32d('0xe')][_0xc32d('0x29')]>0x0){_0x5498c2[_0xc32d('0x26')]=_0x4bd5cf['result'][0x0][_0xc32d('0x10')];logger['info']('['+[_0x3d6202[_0xc32d('0x12')]()]+_0xc32d('0x2a'),_0x5498c2);_0x2151bd(_0x5498c2);}else{return createEndUser(_0x3d6202,_0x4e3d11,_0x5498c2,_0x3008ab,_0x369789)['then'](function(_0xae3cfd){logger[_0xc32d('0x11')]('['+[_0x3d6202[_0xc32d('0x12')]()]+_0xc32d('0x2b'),_0xae3cfd);_0x2151bd(_0xae3cfd);});}})[_0xc32d('0x14')](function(_0x4ee822){logger[_0xc32d('0x15')]('['+[_0x3d6202[_0xc32d('0x12')]()]+']',_0x4ee822[_0xc32d('0x16')]);_0x452bb5(_0x4ee822[_0xc32d('0x16')]);});});};}function getCustomFields(_0x231e43,_0x178027){var _0x26131a={};if(_0x231e43[_0xc32d('0x29')]>0x0){_[_0xc32d('0x2c')](_0x231e43,function(_0x473d98){if(_[_0xc32d('0x2d')]([_0xc32d('0x2e'),_0xc32d('0x2f')],_0x473d98[_0xc32d('0x30')])&&_0x473d98[_0xc32d('0x31')]&&!_0x473d98[_0xc32d('0x32')]){_0x26131a[_0x473d98[_0xc32d('0x31')][_0xc32d('0x33')]()]=_0x473d98[_0xc32d('0x34')][_0xc32d('0x35')]();}else if(_['includes']([_0xc32d('0x2e'),_0xc32d('0x2f')],_0x473d98[_0xc32d('0x30')])&&_0x473d98['idField']&&_0x473d98['customField']){_0x26131a[_0x473d98['idField'][_0xc32d('0x33')]()]=_0x473d98[_0xc32d('0x34')][_0xc32d('0x35')]();}else if(_0x473d98[_0xc32d('0x30')]==='variable'&&_0x473d98[_0xc32d('0x36')]&&_0x473d98[_0xc32d('0x37')]&&_0x473d98[_0xc32d('0x32')]){_0x26131a[_0x473d98[_0xc32d('0x37')]['toLowerCase']()]=_0x178027[_0x473d98[_0xc32d('0x36')]][_0xc32d('0x35')]();}else if(_0x473d98[_0xc32d('0x30')]===_0xc32d('0x38')&&_0x473d98[_0xc32d('0x39')]&&_0x473d98['Variable']['name']&&_0x473d98[_0xc32d('0x37')]&&_0x473d98['customField']){_0x26131a[_0x473d98[_0xc32d('0x37')][_0xc32d('0x33')]()]=_0x178027[_0x473d98[_0xc32d('0x39')][_0xc32d('0x3a')]['toLowerCase']()][_0xc32d('0x35')]();}});}return _0x26131a;}function getTicket(_0x55e51d,_0x1f7aa2,_0xeb8c0,_0x1cb42d,_0x43989a,_0x570aff){return function(_0x2c39e1){logger['info']('['+[_0x55e51d['toUpperCase']()]+']\x20getTicket\x20input\x20crm',_0x2c39e1);return new Promise(function(_0xc35037,_0x2d117c){var _0x3444fd=_0x55e51d[_0xc32d('0x33')]()===_0xc32d('0x3b')?_0x2c39e1[_0xc32d('0x1e')]:_0x2c39e1[_0xc32d('0x26')];var _0x40694e={'method':_0xc32d('0x22'),'uri':_0xeb8c0+'incident'+'?'+_0x570aff,'body':Object['assign']({},{'active':_0xc32d('0x1d'),'caller_id':_0x3444fd,'assigned_to':_0x2c39e1['userId'],'short_description':intUtil[_0xc32d('0x3c')](_0x1cb42d[_0xc32d('0x3d')],_0x43989a,'\x20'),'description':intUtil[_0xc32d('0x3c')](_0x1cb42d[_0xc32d('0x3e')],_0x43989a,'\x0a')},getCustomFields(_0x1cb42d[_0xc32d('0x3f')],_0x43989a)),'auth':_0x1f7aa2,'json':!![]};return rp(_0x40694e)['then'](function(_0x5b53ea){logger[_0xc32d('0x11')]('['+[_0x55e51d[_0xc32d('0x12')]()]+']\x20POST\x20incident\x20entity\x20schema',_0x5b53ea['result']);_0x2c39e1[_0xc32d('0x40')]=_0x5b53ea[_0xc32d('0xe')][_0xc32d('0x10')];_0x2c39e1['ticketNumber']=_0x5b53ea['result'][_0xc32d('0x41')];logger[_0xc32d('0x11')]('['+[_0x55e51d[_0xc32d('0x12')]()]+_0xc32d('0x42'),_0x2c39e1);_0xc35037(_0x2c39e1);})[_0xc32d('0x14')](function(_0x57d3ab){logger['error']('['+[_0x55e51d['toUpperCase']()]+']',_0x57d3ab[_0xc32d('0x16')]);_0x2d117c(_0x57d3ab[_0xc32d('0x16')]);});});};}function createRemoteTag(_0x4e1e09,_0x12b4a3,_0x1f796d,_0x38c426){return new Promise(function(_0x585396,_0x412f55){var _0x264b7d={'method':_0xc32d('0x22'),'uri':_0x1f796d+'label'+'?'+_0x38c426,'body':{'short_description':_0x4e1e09,'global':!![],'active':!![],'name':_0x4e1e09},'auth':_0x12b4a3,'json':!![]};return rp(_0x264b7d)[_0xc32d('0xd')](function(_0x38d074){var _0x34f89b=_0x38d074['result'][_0xc32d('0x10')];_0x585396(_0x34f89b);});});}function getRemoteTag(_0x2c5eb1,_0x404d43,_0x5e5e10,_0x3d3444,_0x2af9fb){return new Promise(function(_0x395ac0,_0xdd1354){var _0x59beb3={'method':_0xc32d('0xb'),'uri':_0x5e5e10+_0xc32d('0x43')+'?sysparm_query=name%3D'+_0x2c5eb1+'&'+_0x3d3444,'auth':_0x404d43,'json':!![]};return rp(_0x59beb3)['then'](function(_0x4b9797){if(_0x4b9797[_0xc32d('0xe')][_0xc32d('0x29')]>0x0){var _0x2cfc41=_0x4b9797[_0xc32d('0xe')][0x0][_0xc32d('0x10')];_0x395ac0(_0x2cfc41);}else{return createRemoteTag(_0x2c5eb1,_0x404d43,_0x5e5e10,_0x3d3444)[_0xc32d('0xd')](function(_0x1bbd17){_0x395ac0(_0x1bbd17);});}});});}function assignTagToIncident(_0x4df366,_0x2f1cd8,_0x5ab469,_0x294274,_0x69cd34){return new Promise(function(_0x548895,_0xd98b9d){var _0x2241e1={'method':_0xc32d('0x22'),'uri':_0x5ab469+'label_entry'+'?'+_0x69cd34,'body':{'label':_0x4df366,'table':_0xc32d('0x44'),'id_type':_0xc32d('0x45'),'table_key':_0x294274['ticketId'],'title':_0xc32d('0x46')+_0x294274['ticketNumber'],'id_display':_0x294274[_0xc32d('0x47')]},'auth':_0x2f1cd8,'json':!![]};return rp(_0x2241e1)[_0xc32d('0xd')](function(_0x36ab5a){_0x548895();})[_0xc32d('0x14')](function(){_0x548895();});});}function manageTags(_0x2642f1,_0x24836e,_0x5cba53,_0x4dd5fa,_0xed51ba,_0x1a18dd,_0x191c1f){return new Promise(function(_0x3d51bd,_0x4aed63){var _0x58e7be=[];_0x24836e[_0xc32d('0x2c')](function(_0x460cea){_0x58e7be[_0xc32d('0x48')](getRemoteTag(_0x460cea,_0x5cba53,_0x4dd5fa,_0x1a18dd,_0x191c1f));});return Promise['all'](_0x58e7be)[_0xc32d('0xd')](function(_0x414bcd){if(_0x414bcd[_0xc32d('0x29')]){logger['info']('['+[_0x2642f1[_0xc32d('0x12')]()]+_0xc32d('0x49'),_0x414bcd);var _0xc5955d=[];_0x414bcd['forEach'](function(_0x5e65e2){_0xc5955d['push'](assignTagToIncident(_0x5e65e2,_0x5cba53,_0x4dd5fa,_0xed51ba,_0x1a18dd));});return Promise[_0xc32d('0x4a')](_0xc5955d)['then'](function(){_0x3d51bd();})[_0xc32d('0x14')](function(){_0x3d51bd();});}else{_0x3d51bd();}});});}function getTags(_0x41b089,_0x44c917,_0xb99a4d,_0xe544b0,_0x30e2fe,_0x465f8c){return function(_0x3ae8ba){return new Promise(function(_0x3e0a9d,_0x3e352a){var _0x1d1254=[];var _0xa71c85=_0xe544b0[_0xc32d('0x4b')];if(_0xa71c85&&_0xa71c85['length']>0x0){_0x1d1254=_[_0xc32d('0x4c')](_0xa71c85,_0xc32d('0x3a'));}if(_0x1d1254[_0xc32d('0x29')]>0x0){return manageTags(_0x41b089,_0x1d1254,_0x44c917,_0xb99a4d,_0x3ae8ba,_0x30e2fe,_0x465f8c)['then'](function(){_0x3e0a9d(_0x3ae8ba);});}else{_0x3e0a9d(_0x3ae8ba);}});};}function emit(_0x44382b,_0x29a2a7,_0x4c1cd4){var _0x5850a8=_0xc32d('0x4d')+_0xc32d('0x4e')+_0xc32d('0x4f')+_0xc32d('0x50');var _0x48219e={'uri':_0x44382b+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x4c1cd4+_0x5850a8};io['to'](util[_0xc32d('0x51')]('user:%s',_0x29a2a7))['emit'](_0xc32d('0x52'),_0x48219e);}exports['cs']=function(_0xf38929,_0x2be314,_0x397c9d,_0x61a019,_0x5fc466,_0x37d61d,_0x5689a9,_0x598e57){var _0x2ede97={};var _0x357b93={'user':_0x37d61d[_0xc32d('0x53')],'pass':_0x37d61d[_0xc32d('0x54')]};var _0x278d5f=_0xc32d('0x55');var _0xe752aa='sysparm_display_value=true';_0x37d61d['remoteUri']=intUtil[_0xc32d('0x56')](_0x37d61d[_0xc32d('0x57')]);_0x37d61d[_0xc32d('0x58')]=intUtil[_0xc32d('0x56')](_0x37d61d[_0xc32d('0x58')]);var _0x2556ee=util['format'](_0xc32d('0x59'),_0x37d61d[_0xc32d('0x57')]);_0x2ede97[_0xc32d('0x19')]=!_[_0xc32d('0x5a')](_0x61a019)?_0x61a019[_0xc32d('0x5b')]:null;_0x2ede97['adminEmail']=_0x37d61d[_0xc32d('0x5b')];_0x2ede97[_0xc32d('0x23')]=_0x598e57[_0xc32d('0x33')]()===_0xc32d('0x3b')?_0x2be314[_0xc32d('0x5c')]:_0x2be314[_0xc32d('0x5d')];_0x2ede97[_0xc32d('0x5e')]=_0x598e57===_0xc32d('0x5f')||_0x598e57===_0xc32d('0x60')?_0xc32d('0x5f'):_0xc32d('0x3b');var _0x4c0ab2=util[_0xc32d('0x51')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x37d61d['serverUrl'],_0x2be314[_0xc32d('0x61')],md5(_0x2be314[_0xc32d('0x61')]));if(_0x5fc466&&_0x5fc466[_0xc32d('0x62')]){logger[_0xc32d('0x11')]('[QUEUE]',_0xc32d('0x63'));_0x2be314['recordingURL']=_0x4c0ab2;}else if(_0x5689a9&&_0x5689a9[_0xc32d('0x64')]&&_0x5689a9[_0xc32d('0x64')]!==_0xc32d('0x65')){logger['info']('[OUTBOUND]',_0xc32d('0x63'));_0x2be314['recordingURL']=_0x4c0ab2;}else{_0x2be314[_0xc32d('0x66')]='';}return getAdminUser(_0x598e57,_0x357b93,_0x2ede97,_0x2556ee,_0xe752aa,_0x278d5f)[_0xc32d('0xd')](getUser(_0x598e57,_0x357b93,_0x2556ee,_0xe752aa,_0x278d5f))[_0xc32d('0xd')](getEndUser(_0x598e57,_0x357b93,_0x2556ee,_0xe752aa,_0x278d5f))[_0xc32d('0xd')](getTicket(_0x598e57,_0x357b93,_0x2556ee,_0x397c9d,_0x2be314,_0xe752aa))[_0xc32d('0xd')](function(_0x14bcfe){logger[_0xc32d('0x11')](util[_0xc32d('0x51')](_0xc32d('0x67'),_0x14bcfe[_0xc32d('0x40')]));logger[_0xc32d('0x11')](util[_0xc32d('0x51')](_0xc32d('0x68'),_0x598e57));if(_0x598e57!==_0xc32d('0x60')){logger['info']('['+[_0x598e57['toUpperCase']()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x37d61d[_0xc32d('0x57')],_0x61a019[_0xc32d('0x3a')],_0x14bcfe[_0xc32d('0x40')]);}})[_0xc32d('0x14')](function(_0x4b2472){logger[_0xc32d('0x15')]('['+[_0x598e57['toUpperCase']()]+_0xc32d('0x69'),util[_0xc32d('0x6a')](_0x4b2472,{'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 5520a5a..297a710 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 _0x02a3=['Outbound','users','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[OUTBOUND]','user:%s','error','unmanaged','toUpperCase','isNil','calleridname','lastevent','lodash','md5','util','ioredis','../../../../config/logger','sugarcrm','defaults','localhost','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','name','getString','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','length','forEach','variableName','push','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','toString','base64','get_server_info','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','value','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','merge','type','customField','nameField','toLowerCase','content','string','custom_fields','variable','customVariable','Variable','POST','username','password','PLAIN','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','monitor_format','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','[QUEUE]','%s/service/v4_1/rest.php','recordingFormat','none','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x02a3,0x101));var _0x302a=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0x02a3[_0x26f702];return _0x11417d;};'use strict';var _=require(_0x302a('0x0'));var rp=require('request-promise');var BPromise=require('bluebird');var md5=require(_0x302a('0x1'));var util=require(_0x302a('0x2'));var Redis=require(_0x302a('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x302a('0x4'))(_0x302a('0x5'));config['redis']=_[_0x302a('0x6')](config['redis'],{'host':_0x302a('0x7'),'port':0x18eb});var io=require(_0x302a('0x8'))(new Redis(config['redis']));var def={'method':'POST','json':!![]};function emit(_0x211522,_0x2b9a4d,_0xcd47c5){io['to'](_0x211522)[_0x302a('0x9')](_0x2b9a4d,_0xcd47c5);}function getTicket(_0x35f1e0,_0x3bc7e0,_0x387eb4,_0x160d2a,_0x21ba93,_0x5035f9,_0x368556,_0xed30d1){logger[_0x302a('0xa')](_0x302a('0xb'));var _0x429a27=new Date();var _0xed6e51=[{'name':_0x302a('0xc'),'value':intUtil[_0x302a('0xd')](_0x160d2a['Subjects'],_0x21ba93,'\x20')},{'name':_0x302a('0xe'),'value':_0x3bc7e0['id']},{'name':_0x302a('0xf'),'value':_0x3bc7e0['id']},{'name':_0x302a('0x10'),'value':intUtil[_0x302a('0xd')](_0x160d2a[_0x302a('0x11')],_0x21ba93,'\x0a')},{'name':_0x302a('0x12'),'value':_0x429a27[_0x302a('0x13')]()['slice'](0x0,0x13)[_0x302a('0x14')]('T','\x20')},{'name':_0x302a('0x15'),'value':'0'},{'name':_0x302a('0x16'),'value':'15'},{'name':_0x302a('0x17'),'value':_0x387eb4['id']},{'name':_0x302a('0x18'),'value':_0x302a('0x19')},{'name':_0x302a('0x1a'),'value':_0x387eb4[_0x302a('0xc')]},{'name':_0x302a('0x1b'),'value':_0xed30d1}];if(_0x5035f9[_0x302a('0x1c')]){_[_0x302a('0x1d')](_0x5035f9,function(_0x1e50cb){if(_0x21ba93[_0x1e50cb[_0x302a('0x1e')]]){_0xed6e51[_0x302a('0x1f')]({'name':_0x1e50cb[_0x302a('0x20')],'value':_0x21ba93[_0x1e50cb[_0x302a('0x1e')]]});}});}return request({'form':{'method':_0x302a('0x21'),'input_type':'JSON','response_type':_0x302a('0x22'),'rest_data':JSON[_0x302a('0x23')]({'session':_0x368556['id'],'module_name':_0x302a('0x24'),'name_value_list':_0xed6e51})}});}function getAuth(_0xccfcb9){return util[_0x302a('0x25')](_0x302a('0x26'),new Buffer(_0xccfcb9['apiKey']+':X')[_0x302a('0x27')](_0x302a('0x28')));}function getServerInfo(_0x154f63){return request({'form':{'method':_0x302a('0x29'),'input_type':_0x302a('0x22'),'response_type':_0x302a('0x22'),'rest_data':JSON[_0x302a('0x23')]({'session':_0x154f63['id']})}});}function getUser(_0x43f3ea,_0x34f220,_0x495fed){if(!_['isNil'](_0x34f220)){logger['info']('Getting\x20agent\x20with\x20name',_0x34f220);return request({'form':{'method':'get_entry_list','input_type':_0x302a('0x22'),'response_type':_0x302a('0x22'),'rest_data':JSON[_0x302a('0x23')]({'session':_0x495fed['id'],'module_name':_0x302a('0x2a'),'query':util['format'](_0x302a('0x2b'),_0x34f220),'order_by':'','offset':'0','select_fields':['id','name',_0x302a('0x2c')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x302a('0x2d')](function(_0x39252b){if(_0x39252b[_0x302a('0x2e')][_0x302a('0x1c')]){var _0xae1e09=_[_0x302a('0x2f')](_0x39252b[_0x302a('0x2e')],function(_0xa2c0a3){return _0xa2c0a3[_0x302a('0x30')][_0x302a('0x2c')][_0x302a('0x31')]===_0x34f220;});if(_0xae1e09){logger['info'](_0x302a('0x32'));return BPromise['resolve']({'id':_0xae1e09[_0x302a('0x30')]['id'][_0x302a('0x31')],'name':_0xae1e09['name_value_list'][_0x302a('0xc')][_0x302a('0x31')]});}}logger[_0x302a('0xa')](_0x302a('0x33'));return BPromise[_0x302a('0x34')]({'id':_0x495fed[_0x302a('0x30')][_0x302a('0x35')][_0x302a('0x31')],'name':_0x495fed[_0x302a('0x30')][_0x302a('0x2c')][_0x302a('0x31')]});});}else{logger[_0x302a('0xa')](_0x302a('0x36'));return BPromise[_0x302a('0x34')]({'id':_0x495fed['name_value_list'][_0x302a('0x35')]['value'],'name':_0x495fed[_0x302a('0x30')][_0x302a('0x2c')][_0x302a('0x31')]});}}function getEndUser(_0x2f9123,_0xa05c25,_0xdc77dd,_0x140059){logger['info'](_0x302a('0x37'),_0xdc77dd);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':_0x302a('0x22'),'rest_data':JSON[_0x302a('0x23')]({'session':_0x140059['id'],'module_name':_0x302a('0x19'),'query':util[_0x302a('0x25')](_0x302a('0x38'),_0xdc77dd),'order_by':'','offset':'0','select_fields':['id',_0x302a('0xc'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x302a('0x2d')](function(_0xa0b923){if(_0xa0b923[_0x302a('0x2e')][_0x302a('0x1c')]){var _0x134f96=_[_0x302a('0x2f')](_0xa0b923[_0x302a('0x2e')],function(_0x552da3){return _0x552da3[_0x302a('0x30')][_0x302a('0x39')][_0x302a('0x31')]===_0xdc77dd;});if(_0x134f96){logger[_0x302a('0xa')](_0x302a('0x3a'));return BPromise[_0x302a('0x34')]({'id':_0x134f96[_0x302a('0x30')]['id'][_0x302a('0x31')],'name':_0x134f96['name_value_list'][_0x302a('0xc')][_0x302a('0x31')],'phone':_0x134f96[_0x302a('0x30')][_0x302a('0x39')]['value']});}}else{logger[_0x302a('0xa')](_0x302a('0x3b'));return request({'form':{'method':'set_entry','input_type':'JSON','response_type':_0x302a('0x22'),'rest_data':JSON[_0x302a('0x23')]({'session':_0x140059['id'],'module_name':_0x302a('0x19'),'name_value_list':[{'name':_0x302a('0x3c'),'value':_0xa05c25!==_0x302a('0x3d')?_0xa05c25:util[_0x302a('0x25')](_0x302a('0x3e'),_0xdc77dd)},{'name':'phone_home','value':_0xdc77dd}]})}})[_0x302a('0x2d')](function(_0x14fac2){logger[_0x302a('0xa')](_0x302a('0x3f'));return BPromise['resolve']({'id':_0x14fac2['id'],'name':_0x14fac2[_0x302a('0x2e')][_0x302a('0x3c')][_0x302a('0x31')],'phone':_0x14fac2[_0x302a('0x2e')][_0x302a('0x39')][_0x302a('0x31')]});});}});}function request(_0xf44f33){logger[_0x302a('0x40')]('[HTTP]',JSON[_0x302a('0x23')](_0xf44f33));return rp(_[_0x302a('0x41')](def,_0xf44f33));}function getTags(_0x334a0d,_0x1804c2){var _0x4bd3ea=[];if(_0x334a0d&&_0x334a0d['length']>0x0){_0x4bd3ea=_['map'](_0x334a0d,_0x1804c2);}return _0x4bd3ea;}function getCustomFields(_0x6bdbc6,_0x3cdf37){var _0x520a84=[];var _0x4e20a3={'custom_fields':[]};if(_0x6bdbc6[_0x302a('0x1c')]>0x0){_[_0x302a('0x1d')](_0x6bdbc6,function(_0x549806){if(_0x549806[_0x302a('0x42')]==='string'&&_0x549806['nameField']&&!_0x549806[_0x302a('0x43')]){_0x4e20a3[_0x549806[_0x302a('0x44')][_0x302a('0x45')]()]=_0x549806[_0x302a('0x46')]['toString']();}else if(_0x549806['type']===_0x302a('0x47')&&_0x549806['idField']&&_0x549806[_0x302a('0x43')]){_0x4e20a3[_0x302a('0x48')][_0x302a('0x1f')]({'id':_0x549806[_0x302a('0x20')],'value':_0x549806['content'][_0x302a('0x27')]()});}else if(_0x549806[_0x302a('0x42')]===_0x302a('0x49')&&_0x549806[_0x302a('0x1e')]&&_0x549806[_0x302a('0x20')]&&_0x549806[_0x302a('0x43')]){_0x3cdf37[_0x549806[_0x302a('0x1e')]]&&_0x4e20a3[_0x302a('0x48')][_0x302a('0x1f')]({'id':_0x549806[_0x302a('0x20')],'value':_0x3cdf37[_0x549806['variableName']][_0x302a('0x27')]()});}else if(_0x549806[_0x302a('0x42')]===_0x302a('0x4a')&&_0x549806[_0x302a('0x4b')]&&_0x549806['Variable'][_0x302a('0xc')]&&_0x549806[_0x302a('0x20')]&&_0x549806[_0x302a('0x43')]){_0x3cdf37[_0x549806[_0x302a('0x4b')][_0x302a('0xc')][_0x302a('0x45')]()]&&_0x4e20a3[_0x302a('0x48')][_0x302a('0x1f')]({'id':_0x549806[_0x302a('0x20')],'value':_0x3cdf37[_0x549806[_0x302a('0x4b')][_0x302a('0xc')]['toLowerCase']()]['toString']()});}});}return _0x4e20a3;}function getConnection(_0x5d5c67){return request({'method':_0x302a('0x4c'),'form':{'method':'login','input_type':'JSON','response_type':_0x302a('0x22'),'rest_data':JSON[_0x302a('0x23')]({'user_auth':{'user_name':_0x5d5c67[_0x302a('0x4d')],'password':_0x5d5c67[_0x302a('0x4e')],'encryption':_0x302a('0x4f')},'application':_0x302a('0x50')})}})[_0x302a('0x2d')](function(_0x468a02){var _0xd022fa=_0x468a02;if(_0xd022fa['id']){def['sessionID']=_0xd022fa['id'];return BPromise[_0x302a('0x34')](_0xd022fa);}else{throw new Error(util[_0x302a('0x25')](_0x302a('0x51'),_0x5d5c67['id']));}});}function setRelationship(_0x28ba18,_0x5eedb4,_0x551318,_0x227b8b){return request({'form':{'method':_0x302a('0x52'),'input_type':'JSON','response_type':_0x302a('0x22'),'rest_data':JSON[_0x302a('0x23')]({'session':_0x28ba18['id'],'module_name':_0x302a('0x24'),'module_id':_0x551318['id'],'link_field_name':_0x227b8b,'related_ids':[_0x5eedb4['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x302a('0x53')]=function(_0x18c66c,_0x23e4f0,_0xb356dc,_0x4fcfa6,_0x4d2790,_0x29ff6d){var _0x4d1ccf,_0x5991ff,_0x2ccbba,_0x297401;_0x29ff6d[_0x302a('0x54')]=intUtil[_0x302a('0x55')](_0x29ff6d[_0x302a('0x54')]);_0x29ff6d[_0x302a('0x56')]=intUtil[_0x302a('0x55')](_0x29ff6d[_0x302a('0x56')]);def[_0x302a('0x57')]=util[_0x302a('0x25')]('%s/service/v4_1/rest.php',_0x29ff6d[_0x302a('0x54')]);if(_0x4d2790&&_0x4d2790[_0x302a('0x58')]){logger[_0x302a('0xa')]('[QUEUE]','Recording\x20is\x20enabled!');_0x23e4f0[_0x302a('0x59')]=util[_0x302a('0x25')](_0x302a('0x5a'),_0x29ff6d['serverUrl'],_0x23e4f0['uniqueid'],md5(_0x23e4f0[_0x302a('0x5b')]));}else{_0x23e4f0[_0x302a('0x59')]='';}return getConnection(_0x29ff6d)[_0x302a('0x2d')](function(_0x392f36){_0x297401=_0x392f36;return getUser(_0x29ff6d,_0x4fcfa6[_0x302a('0xc')],_0x297401);})[_0x302a('0x2d')](function(_0x3ad2f5){_0x4d1ccf=_0x3ad2f5;logger[_0x302a('0xa')]('The\x20User\x20ID\x20is:',_0x4d1ccf['id']);return getEndUser(_0x29ff6d,_0x23e4f0['calleridname'],_0x23e4f0[_0x302a('0x5c')],_0x297401);})[_0x302a('0x2d')](function(_0x286e08){_0x5991ff=_0x286e08;logger[_0x302a('0xa')](_0x302a('0x5d'),_0x5991ff['id']);return getTicket(_0x29ff6d,_0x4d1ccf,_0x5991ff,_0xb356dc,_0x23e4f0,_0xb356dc[_0x302a('0x5e')],_0x297401,'Inbound');})['then'](function(_0x5cf54b){_0x2ccbba=_0x5cf54b;logger[_0x302a('0xa')](_0x302a('0x5f'));logger['info'](_0x302a('0x60'),_0x2ccbba['id']);return setRelationship(_0x297401,_0x4d1ccf,_0x2ccbba,'users');})[_0x302a('0x2d')](function(){return setRelationship(_0x297401,_0x5991ff,_0x2ccbba,_0x302a('0x61'));})[_0x302a('0x2d')](function(){return getServerInfo(_0x297401);})[_0x302a('0x2d')](function(_0x13185b){var _0x56d484=parseInt(_0x13185b[_0x302a('0x62')][_0x302a('0x63')](0x0));var _0x4ebdb7=util['format'](_0x302a('0x64'),_0x29ff6d['remoteUri'],_0x2ccbba['id']);if(_0x56d484>0x6){_0x4ebdb7=util[_0x302a('0x25')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x29ff6d[_0x302a('0x54')],_0x2ccbba['id']);}logger[_0x302a('0xa')]('[QUEUE]',_0x302a('0x65'));emit(util[_0x302a('0x25')]('user:%s',_0x4fcfa6['name']),_0x302a('0x66'),{'uri':_0x4ebdb7});})[_0x302a('0x67')](function(_0x429579){logger['error'](_0x302a('0x68'),JSON['stringify'](_0x429579));});};exports['outbound']=function(_0x5822d4,_0x30b0fd,_0x34e335,_0x580935,_0x59f9c4,_0x4f4b95,_0x209275){var _0x1b9138,_0x24aae5,_0x3497cb,_0x19a282;_0x4f4b95[_0x302a('0x54')]=intUtil[_0x302a('0x55')](_0x4f4b95[_0x302a('0x54')]);_0x4f4b95['serverUrl']=intUtil[_0x302a('0x55')](_0x4f4b95['serverUrl']);def['uri']=util[_0x302a('0x25')](_0x302a('0x69'),_0x4f4b95[_0x302a('0x54')]);if(_0x209275&&_0x209275['recordingFormat']&&_0x209275[_0x302a('0x6a')]!==_0x302a('0x6b')){logger[_0x302a('0xa')]('[OUTBOUND]',_0x302a('0x6c'));_0x30b0fd['recordingURL']=util[_0x302a('0x25')](_0x302a('0x5a'),_0x4f4b95[_0x302a('0x56')],_0x30b0fd['uniqueid'],md5(_0x30b0fd[_0x302a('0x5b')]));}return getConnection(_0x4f4b95)[_0x302a('0x2d')](function(_0x441aee){_0x19a282=_0x441aee;return getUser(_0x4f4b95,_0x580935[_0x302a('0xc')],_0x19a282);})[_0x302a('0x2d')](function(_0x559571){_0x1b9138=_0x559571;logger[_0x302a('0xa')](_0x302a('0x6d'),_0x1b9138['id']);return getEndUser(_0x4f4b95,_0x30b0fd[_0x302a('0x6e')],_0x30b0fd[_0x302a('0x6f')],_0x19a282);})[_0x302a('0x2d')](function(_0xb34413){_0x24aae5=_0xb34413;logger['info'](_0x302a('0x5d'),_0x24aae5['id']);return getTicket(_0x4f4b95,_0x1b9138,_0x24aae5,_0x34e335,_0x30b0fd,_0x34e335[_0x302a('0x5e')],_0x19a282,_0x302a('0x70'));})[_0x302a('0x2d')](function(_0x287484){_0x3497cb=_0x287484;logger[_0x302a('0xa')](_0x302a('0x5f'));logger[_0x302a('0xa')]('The\x20Ticket\x20ID\x20is:',_0x3497cb['id']);return setRelationship(_0x19a282,_0x1b9138,_0x3497cb,_0x302a('0x71'));})[_0x302a('0x2d')](function(){return setRelationship(_0x19a282,_0x24aae5,_0x3497cb,_0x302a('0x61'));})['then'](function(){return getServerInfo(_0x19a282);})[_0x302a('0x2d')](function(_0x46d75b){var _0x1a2b11=parseInt(_0x46d75b[_0x302a('0x62')][_0x302a('0x63')](0x0));var _0x4065fd=util[_0x302a('0x25')](_0x302a('0x64'),_0x4f4b95['remoteUri'],_0x3497cb['id']);if(_0x1a2b11>0x6){_0x4065fd=util['format'](_0x302a('0x72'),_0x4f4b95[_0x302a('0x54')],_0x3497cb['id']);}logger[_0x302a('0xa')](_0x302a('0x73'),_0x302a('0x65'));emit(util[_0x302a('0x25')](_0x302a('0x74'),_0x580935[_0x302a('0xc')]),_0x302a('0x66'),{'uri':_0x4065fd});})[_0x302a('0x67')](function(_0x19e3c4){logger[_0x302a('0x75')](_0x302a('0x73'),JSON['stringify'](_0x19e3c4));});};exports[_0x302a('0x76')]=function(_0x5ac5eb,_0x3bc939,_0x2b3ed6,_0x2d41fc,_0x4604ba,_0x42241e){var _0x24b2b4,_0x3756f5,_0x332f66,_0x5ed55b;_0x42241e[_0x302a('0x54')]=intUtil[_0x302a('0x55')](_0x42241e[_0x302a('0x54')]);_0x42241e[_0x302a('0x56')]=intUtil[_0x302a('0x55')](_0x42241e[_0x302a('0x56')]);def['uri']=util[_0x302a('0x25')](_0x302a('0x69'),_0x42241e[_0x302a('0x54')]);if(_0x4604ba&&_0x4604ba[_0x302a('0x58')]){logger['info']('['+_0x3bc939['lastevent'][_0x302a('0x77')]()+']',_0x302a('0x6c'));_0x3bc939[_0x302a('0x59')]=util[_0x302a('0x25')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x42241e[_0x302a('0x56')],_0x3bc939[_0x302a('0x5b')],md5(_0x3bc939[_0x302a('0x5b')]));}else{_0x3bc939[_0x302a('0x59')]='';}return getConnection(_0x42241e)[_0x302a('0x2d')](function(_0x450401){_0x5ed55b=_0x450401;if(!_[_0x302a('0x78')](_0x2d41fc)){return getUser(_0x42241e,_0x2d41fc[_0x302a('0xc')],_0x5ed55b);}else{return getUser(_0x42241e,null,_0x5ed55b);}})[_0x302a('0x2d')](function(_0xd269bd){_0x24b2b4=_0xd269bd;logger['info']('The\x20User\x20ID\x20is:',_0x24b2b4['id']);return getEndUser(_0x42241e,_0x3bc939[_0x302a('0x79')],_0x3bc939[_0x302a('0x5c')],_0x5ed55b);})[_0x302a('0x2d')](function(_0x3608a0){_0x3756f5=_0x3608a0;logger[_0x302a('0xa')](_0x302a('0x5d'),_0x3756f5['id']);return getTicket(_0x42241e,_0x24b2b4,_0x3756f5,_0x2b3ed6,_0x3bc939,_0x2b3ed6[_0x302a('0x5e')],_0x5ed55b,'Inbound');})[_0x302a('0x2d')](function(_0x306599){_0x332f66=_0x306599;logger[_0x302a('0xa')](_0x302a('0x5f'));logger[_0x302a('0xa')](_0x302a('0x60'),_0x332f66['id']);return setRelationship(_0x5ed55b,_0x24b2b4,_0x332f66,_0x302a('0x71'));})[_0x302a('0x2d')](function(){return setRelationship(_0x5ed55b,_0x3756f5,_0x332f66,_0x302a('0x61'));})['then'](function(){return getServerInfo(_0x5ed55b);})[_0x302a('0x67')](function(_0x332835){logger['error']('['+_0x3bc939[_0x302a('0x7a')][_0x302a('0x77')]()+']',JSON['stringify'](_0x332835));});}; \ No newline at end of file +var _0x82fe=['users','contacts','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','recordingURL','The\x20User\x20ID\x20is:','destcalleridnum','Outbound','charAt','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','md5','util','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','description','Descriptions','date_start','slice','replace','duration_minutes','parent_id','parent_type','Contacts','direction','length','variableName','push','idField','JSON','stringify','Calls','format','apiKey','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','value','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','forEach','type','string','nameField','customField','toString','custom_fields','content','variable','customVariable','Variable','toLowerCase','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','set_relationship','queue','stripTrailingSlash','remoteUri','serverUrl','uri','%s/service/v4_1/rest.php','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:'];(function(_0x2342e5,_0x324add){var _0x5b9d61=function(_0x544d51){while(--_0x544d51){_0x2342e5['push'](_0x2342e5['shift']());}};_0x5b9d61(++_0x324add);}(_0x82fe,0x92));var _0xe82f=function(_0x1d39f6,_0x146f4a){_0x1d39f6=_0x1d39f6-0x0;var _0x3dbd7a=_0x82fe[_0x1d39f6];return _0x3dbd7a;};'use strict';var _=require(_0xe82f('0x0'));var rp=require(_0xe82f('0x1'));var BPromise=require(_0xe82f('0x2'));var md5=require(_0xe82f('0x3'));var util=require(_0xe82f('0x4'));var Redis=require('ioredis');var intUtil=require(_0xe82f('0x5'));var config=require(_0xe82f('0x6'));var logger=require(_0xe82f('0x7'))('sugarcrm');config[_0xe82f('0x8')]=_[_0xe82f('0x9')](config[_0xe82f('0x8')],{'host':_0xe82f('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe82f('0x8')]));var def={'method':_0xe82f('0xb'),'json':!![]};function emit(_0x54dda8,_0x4dd2d5,_0x185c8b){io['to'](_0x54dda8)[_0xe82f('0xc')](_0x4dd2d5,_0x185c8b);}function getTicket(_0x41668f,_0x99543e,_0x3cec05,_0x4c5163,_0x4a2cf3,_0x5b5894,_0x2c1138,_0x154a29){logger[_0xe82f('0xd')](_0xe82f('0xe'));var _0x514d0a=new Date();var _0x426b3a=[{'name':_0xe82f('0xf'),'value':intUtil[_0xe82f('0x10')](_0x4c5163[_0xe82f('0x11')],_0x4a2cf3,'\x20')},{'name':_0xe82f('0x12'),'value':_0x99543e['id']},{'name':'created_by','value':_0x99543e['id']},{'name':_0xe82f('0x13'),'value':intUtil[_0xe82f('0x10')](_0x4c5163[_0xe82f('0x14')],_0x4a2cf3,'\x0a')},{'name':_0xe82f('0x15'),'value':_0x514d0a['toISOString']()[_0xe82f('0x16')](0x0,0x13)[_0xe82f('0x17')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0xe82f('0x18'),'value':'15'},{'name':_0xe82f('0x19'),'value':_0x3cec05['id']},{'name':_0xe82f('0x1a'),'value':_0xe82f('0x1b')},{'name':'parent_name','value':_0x3cec05[_0xe82f('0xf')]},{'name':_0xe82f('0x1c'),'value':_0x154a29}];if(_0x5b5894[_0xe82f('0x1d')]){_['forEach'](_0x5b5894,function(_0x476985){if(_0x4a2cf3[_0x476985[_0xe82f('0x1e')]]){_0x426b3a[_0xe82f('0x1f')]({'name':_0x476985[_0xe82f('0x20')],'value':_0x4a2cf3[_0x476985[_0xe82f('0x1e')]]});}});}return request({'form':{'method':'set_entry','input_type':'JSON','response_type':_0xe82f('0x21'),'rest_data':JSON[_0xe82f('0x22')]({'session':_0x2c1138['id'],'module_name':_0xe82f('0x23'),'name_value_list':_0x426b3a})}});}function getAuth(_0x768c36){return util[_0xe82f('0x24')]('Basic\x20%s',new Buffer(_0x768c36[_0xe82f('0x25')]+':X')['toString'](_0xe82f('0x26')));}function getServerInfo(_0x3acec4){return request({'form':{'method':_0xe82f('0x27'),'input_type':_0xe82f('0x21'),'response_type':_0xe82f('0x21'),'rest_data':JSON[_0xe82f('0x22')]({'session':_0x3acec4['id']})}});}function getUser(_0x3bcf45,_0xa796da,_0x90bafb){if(!_[_0xe82f('0x28')](_0xa796da)){logger[_0xe82f('0xd')](_0xe82f('0x29'),_0xa796da);return request({'form':{'method':_0xe82f('0x2a'),'input_type':_0xe82f('0x21'),'response_type':'JSON','rest_data':JSON[_0xe82f('0x22')]({'session':_0x90bafb['id'],'module_name':_0xe82f('0x2b'),'query':util[_0xe82f('0x24')](_0xe82f('0x2c'),_0xa796da),'order_by':'','offset':'0','select_fields':['id',_0xe82f('0xf'),_0xe82f('0x2d')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xe82f('0x2e')](function(_0x3d665e){if(_0x3d665e[_0xe82f('0x2f')][_0xe82f('0x1d')]){var _0x48117a=_[_0xe82f('0x30')](_0x3d665e[_0xe82f('0x2f')],function(_0x26a294){return _0x26a294[_0xe82f('0x31')][_0xe82f('0x2d')][_0xe82f('0x32')]===_0xa796da;});if(_0x48117a){logger['info'](_0xe82f('0x33'));return BPromise['resolve']({'id':_0x48117a['name_value_list']['id'][_0xe82f('0x32')],'name':_0x48117a[_0xe82f('0x31')][_0xe82f('0xf')][_0xe82f('0x32')]});}}logger[_0xe82f('0xd')](_0xe82f('0x34'));return BPromise[_0xe82f('0x35')]({'id':_0x90bafb[_0xe82f('0x31')]['user_id']['value'],'name':_0x90bafb[_0xe82f('0x31')][_0xe82f('0x2d')][_0xe82f('0x32')]});});}else{logger['info'](_0xe82f('0x36'));return BPromise['resolve']({'id':_0x90bafb[_0xe82f('0x31')]['user_id'][_0xe82f('0x32')],'name':_0x90bafb[_0xe82f('0x31')][_0xe82f('0x2d')][_0xe82f('0x32')]});}}function getEndUser(_0x136afa,_0x40150b,_0x7e1171,_0x30bf16){logger[_0xe82f('0xd')](_0xe82f('0x37'),_0x7e1171);return request({'form':{'method':_0xe82f('0x2a'),'input_type':_0xe82f('0x21'),'response_type':_0xe82f('0x21'),'rest_data':JSON[_0xe82f('0x22')]({'session':_0x30bf16['id'],'module_name':'Contacts','query':util[_0xe82f('0x24')](_0xe82f('0x38'),_0x7e1171),'order_by':'','offset':'0','select_fields':['id',_0xe82f('0xf'),_0xe82f('0x39')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xe82f('0x2e')](function(_0x4ccb42){if(_0x4ccb42[_0xe82f('0x2f')][_0xe82f('0x1d')]){var _0x243dc4=_[_0xe82f('0x30')](_0x4ccb42[_0xe82f('0x2f')],function(_0x196267){return _0x196267[_0xe82f('0x31')]['phone_home'][_0xe82f('0x32')]===_0x7e1171;});if(_0x243dc4){logger[_0xe82f('0xd')](_0xe82f('0x3a'));return BPromise[_0xe82f('0x35')]({'id':_0x243dc4['name_value_list']['id'][_0xe82f('0x32')],'name':_0x243dc4[_0xe82f('0x31')][_0xe82f('0xf')][_0xe82f('0x32')],'phone':_0x243dc4['name_value_list']['phone_home'][_0xe82f('0x32')]});}}else{logger[_0xe82f('0xd')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':'set_entry','input_type':_0xe82f('0x21'),'response_type':_0xe82f('0x21'),'rest_data':JSON[_0xe82f('0x22')]({'session':_0x30bf16['id'],'module_name':'Contacts','name_value_list':[{'name':_0xe82f('0x3b'),'value':_0x40150b!==_0xe82f('0x3c')?_0x40150b:util[_0xe82f('0x24')](_0xe82f('0x3d'),_0x7e1171)},{'name':_0xe82f('0x39'),'value':_0x7e1171}]})}})['then'](function(_0x1f8702){logger['info'](_0xe82f('0x3e'));return BPromise[_0xe82f('0x35')]({'id':_0x1f8702['id'],'name':_0x1f8702[_0xe82f('0x2f')][_0xe82f('0x3b')]['value'],'phone':_0x1f8702['entry_list'][_0xe82f('0x39')][_0xe82f('0x32')]});});}});}function request(_0x4dd622){logger[_0xe82f('0x3f')](_0xe82f('0x40'),JSON[_0xe82f('0x22')](_0x4dd622));return rp(_[_0xe82f('0x41')](def,_0x4dd622));}function getTags(_0x2369ef,_0x1d80b8){var _0x343146=[];if(_0x2369ef&&_0x2369ef[_0xe82f('0x1d')]>0x0){_0x343146=_[_0xe82f('0x42')](_0x2369ef,_0x1d80b8);}return _0x343146;}function getCustomFields(_0x46c075,_0x5705c8){var _0x5bf35b=[];var _0xe864d={'custom_fields':[]};if(_0x46c075['length']>0x0){_[_0xe82f('0x43')](_0x46c075,function(_0x1d54d7){if(_0x1d54d7[_0xe82f('0x44')]===_0xe82f('0x45')&&_0x1d54d7[_0xe82f('0x46')]&&!_0x1d54d7[_0xe82f('0x47')]){_0xe864d[_0x1d54d7['nameField']['toLowerCase']()]=_0x1d54d7['content'][_0xe82f('0x48')]();}else if(_0x1d54d7[_0xe82f('0x44')]===_0xe82f('0x45')&&_0x1d54d7[_0xe82f('0x20')]&&_0x1d54d7[_0xe82f('0x47')]){_0xe864d[_0xe82f('0x49')][_0xe82f('0x1f')]({'id':_0x1d54d7['idField'],'value':_0x1d54d7[_0xe82f('0x4a')][_0xe82f('0x48')]()});}else if(_0x1d54d7['type']===_0xe82f('0x4b')&&_0x1d54d7['variableName']&&_0x1d54d7[_0xe82f('0x20')]&&_0x1d54d7[_0xe82f('0x47')]){_0x5705c8[_0x1d54d7[_0xe82f('0x1e')]]&&_0xe864d[_0xe82f('0x49')][_0xe82f('0x1f')]({'id':_0x1d54d7[_0xe82f('0x20')],'value':_0x5705c8[_0x1d54d7[_0xe82f('0x1e')]]['toString']()});}else if(_0x1d54d7[_0xe82f('0x44')]===_0xe82f('0x4c')&&_0x1d54d7[_0xe82f('0x4d')]&&_0x1d54d7[_0xe82f('0x4d')][_0xe82f('0xf')]&&_0x1d54d7[_0xe82f('0x20')]&&_0x1d54d7[_0xe82f('0x47')]){_0x5705c8[_0x1d54d7[_0xe82f('0x4d')]['name'][_0xe82f('0x4e')]()]&&_0xe864d['custom_fields'][_0xe82f('0x1f')]({'id':_0x1d54d7[_0xe82f('0x20')],'value':_0x5705c8[_0x1d54d7[_0xe82f('0x4d')]['name'][_0xe82f('0x4e')]()][_0xe82f('0x48')]()});}});}return _0xe864d;}function getConnection(_0x1f67d4){return request({'method':_0xe82f('0xb'),'form':{'method':_0xe82f('0x4f'),'input_type':_0xe82f('0x21'),'response_type':_0xe82f('0x21'),'rest_data':JSON[_0xe82f('0x22')]({'user_auth':{'user_name':_0x1f67d4[_0xe82f('0x50')],'password':_0x1f67d4[_0xe82f('0x51')],'encryption':_0xe82f('0x52')},'application':_0xe82f('0x53')})}})[_0xe82f('0x2e')](function(_0x42ba63){var _0x2d3bf4=_0x42ba63;if(_0x2d3bf4['id']){def[_0xe82f('0x54')]=_0x2d3bf4['id'];return BPromise[_0xe82f('0x35')](_0x2d3bf4);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x1f67d4['id']));}});}function setRelationship(_0x5ab918,_0x18af3c,_0x3a11a9,_0x42a12d){return request({'form':{'method':_0xe82f('0x55'),'input_type':_0xe82f('0x21'),'response_type':_0xe82f('0x21'),'rest_data':JSON[_0xe82f('0x22')]({'session':_0x5ab918['id'],'module_name':_0xe82f('0x23'),'module_id':_0x3a11a9['id'],'link_field_name':_0x42a12d,'related_ids':[_0x18af3c['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xe82f('0x56')]=function(_0x1f607d,_0x3b67d9,_0x26f795,_0x171d3b,_0x261362,_0x38d623){var _0x3a826d,_0x1f3313,_0x4b9ad4,_0x3e9239;_0x38d623['remoteUri']=intUtil[_0xe82f('0x57')](_0x38d623[_0xe82f('0x58')]);_0x38d623[_0xe82f('0x59')]=intUtil[_0xe82f('0x57')](_0x38d623[_0xe82f('0x59')]);def[_0xe82f('0x5a')]=util[_0xe82f('0x24')](_0xe82f('0x5b'),_0x38d623[_0xe82f('0x58')]);if(_0x261362&&_0x261362['monitor_format']){logger[_0xe82f('0xd')](_0xe82f('0x5c'),'Recording\x20is\x20enabled!');_0x3b67d9['recordingURL']=util[_0xe82f('0x24')](_0xe82f('0x5d'),_0x38d623[_0xe82f('0x59')],_0x3b67d9[_0xe82f('0x5e')],md5(_0x3b67d9[_0xe82f('0x5e')]));}else{_0x3b67d9['recordingURL']='';}return getConnection(_0x38d623)[_0xe82f('0x2e')](function(_0x169784){_0x3e9239=_0x169784;return getUser(_0x38d623,_0x171d3b[_0xe82f('0xf')],_0x3e9239);})[_0xe82f('0x2e')](function(_0x4f0c29){_0x3a826d=_0x4f0c29;logger[_0xe82f('0xd')]('The\x20User\x20ID\x20is:',_0x3a826d['id']);return getEndUser(_0x38d623,_0x3b67d9[_0xe82f('0x5f')],_0x3b67d9[_0xe82f('0x60')],_0x3e9239);})[_0xe82f('0x2e')](function(_0x18523e){_0x1f3313=_0x18523e;logger['info'](_0xe82f('0x61'),_0x1f3313['id']);return getTicket(_0x38d623,_0x3a826d,_0x1f3313,_0x26f795,_0x3b67d9,_0x26f795[_0xe82f('0x62')],_0x3e9239,_0xe82f('0x63'));})[_0xe82f('0x2e')](function(_0x3167cf){_0x4b9ad4=_0x3167cf;logger[_0xe82f('0xd')](_0xe82f('0x64'));logger[_0xe82f('0xd')](_0xe82f('0x65'),_0x4b9ad4['id']);return setRelationship(_0x3e9239,_0x3a826d,_0x4b9ad4,_0xe82f('0x66'));})[_0xe82f('0x2e')](function(){return setRelationship(_0x3e9239,_0x1f3313,_0x4b9ad4,_0xe82f('0x67'));})['then'](function(){return getServerInfo(_0x3e9239);})[_0xe82f('0x2e')](function(_0x106c3e){var _0x47020d=parseInt(_0x106c3e[_0xe82f('0x68')]['charAt'](0x0));var _0x56e71a=util[_0xe82f('0x24')](_0xe82f('0x69'),_0x38d623[_0xe82f('0x58')],_0x4b9ad4['id']);if(_0x47020d>0x6){_0x56e71a=util[_0xe82f('0x24')](_0xe82f('0x6a'),_0x38d623[_0xe82f('0x58')],_0x4b9ad4['id']);}logger[_0xe82f('0xd')]('[QUEUE]',_0xe82f('0x6b'));emit(util[_0xe82f('0x24')](_0xe82f('0x6c'),_0x171d3b[_0xe82f('0xf')]),_0xe82f('0x6d'),{'uri':_0x56e71a});})[_0xe82f('0x6e')](function(_0x289460){logger[_0xe82f('0x6f')](_0xe82f('0x5c'),JSON[_0xe82f('0x22')](_0x289460));});};exports[_0xe82f('0x70')]=function(_0x5541d5,_0x3fcda0,_0x504b70,_0xe7e2c3,_0x101bee,_0x479c4a,_0x35f1fe){var _0x5c90fb,_0x4d5822,_0x38a1ff,_0x123fc6;_0x479c4a[_0xe82f('0x58')]=intUtil[_0xe82f('0x57')](_0x479c4a[_0xe82f('0x58')]);_0x479c4a[_0xe82f('0x59')]=intUtil['stripTrailingSlash'](_0x479c4a['serverUrl']);def['uri']=util[_0xe82f('0x24')](_0xe82f('0x5b'),_0x479c4a[_0xe82f('0x58')]);if(_0x35f1fe&&_0x35f1fe[_0xe82f('0x71')]&&_0x35f1fe[_0xe82f('0x71')]!=='none'){logger[_0xe82f('0xd')](_0xe82f('0x72'),_0xe82f('0x73'));_0x3fcda0[_0xe82f('0x74')]=util[_0xe82f('0x24')](_0xe82f('0x5d'),_0x479c4a[_0xe82f('0x59')],_0x3fcda0['uniqueid'],md5(_0x3fcda0[_0xe82f('0x5e')]));}return getConnection(_0x479c4a)[_0xe82f('0x2e')](function(_0x3bd8e7){_0x123fc6=_0x3bd8e7;return getUser(_0x479c4a,_0xe7e2c3['name'],_0x123fc6);})['then'](function(_0x34fcc7){_0x5c90fb=_0x34fcc7;logger['info'](_0xe82f('0x75'),_0x5c90fb['id']);return getEndUser(_0x479c4a,_0x3fcda0['destcalleridname'],_0x3fcda0[_0xe82f('0x76')],_0x123fc6);})[_0xe82f('0x2e')](function(_0x5081d6){_0x4d5822=_0x5081d6;logger[_0xe82f('0xd')](_0xe82f('0x61'),_0x4d5822['id']);return getTicket(_0x479c4a,_0x5c90fb,_0x4d5822,_0x504b70,_0x3fcda0,_0x504b70[_0xe82f('0x62')],_0x123fc6,_0xe82f('0x77'));})['then'](function(_0x30c8e5){_0x38a1ff=_0x30c8e5;logger[_0xe82f('0xd')](_0xe82f('0x64'));logger[_0xe82f('0xd')](_0xe82f('0x65'),_0x38a1ff['id']);return setRelationship(_0x123fc6,_0x5c90fb,_0x38a1ff,'users');})[_0xe82f('0x2e')](function(){return setRelationship(_0x123fc6,_0x4d5822,_0x38a1ff,'contacts');})[_0xe82f('0x2e')](function(){return getServerInfo(_0x123fc6);})[_0xe82f('0x2e')](function(_0x5cfa5e){var _0x2632ec=parseInt(_0x5cfa5e[_0xe82f('0x68')][_0xe82f('0x78')](0x0));var _0x86dc75=util[_0xe82f('0x24')](_0xe82f('0x69'),_0x479c4a['remoteUri'],_0x38a1ff['id']);if(_0x2632ec>0x6){_0x86dc75=util['format'](_0xe82f('0x6a'),_0x479c4a['remoteUri'],_0x38a1ff['id']);}logger[_0xe82f('0xd')]('[OUTBOUND]',_0xe82f('0x6b'));emit(util[_0xe82f('0x24')]('user:%s',_0xe7e2c3[_0xe82f('0xf')]),_0xe82f('0x6d'),{'uri':_0x86dc75});})[_0xe82f('0x6e')](function(_0x4f1133){logger['error'](_0xe82f('0x72'),JSON['stringify'](_0x4f1133));});};exports[_0xe82f('0x79')]=function(_0xd9b83d,_0x2eeb8c,_0x1f823e,_0x372c31,_0x376e3e,_0x31cc29){var _0x35ca73,_0x3bb3c9,_0x10a42a,_0x19c289;_0x31cc29[_0xe82f('0x58')]=intUtil[_0xe82f('0x57')](_0x31cc29[_0xe82f('0x58')]);_0x31cc29['serverUrl']=intUtil['stripTrailingSlash'](_0x31cc29[_0xe82f('0x59')]);def[_0xe82f('0x5a')]=util[_0xe82f('0x24')]('%s/service/v4_1/rest.php',_0x31cc29[_0xe82f('0x58')]);if(_0x376e3e&&_0x376e3e['monitor_format']){logger[_0xe82f('0xd')]('['+_0x2eeb8c[_0xe82f('0x7a')]['toUpperCase']()+']',_0xe82f('0x73'));_0x2eeb8c[_0xe82f('0x74')]=util[_0xe82f('0x24')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x31cc29[_0xe82f('0x59')],_0x2eeb8c[_0xe82f('0x5e')],md5(_0x2eeb8c[_0xe82f('0x5e')]));}else{_0x2eeb8c[_0xe82f('0x74')]='';}return getConnection(_0x31cc29)[_0xe82f('0x2e')](function(_0x3b0b27){_0x19c289=_0x3b0b27;if(!_[_0xe82f('0x28')](_0x372c31)){return getUser(_0x31cc29,_0x372c31[_0xe82f('0xf')],_0x19c289);}else{return getUser(_0x31cc29,null,_0x19c289);}})['then'](function(_0x2ed87e){_0x35ca73=_0x2ed87e;logger['info'](_0xe82f('0x75'),_0x35ca73['id']);return getEndUser(_0x31cc29,_0x2eeb8c[_0xe82f('0x5f')],_0x2eeb8c['calleridnum'],_0x19c289);})[_0xe82f('0x2e')](function(_0x1bbd5f){_0x3bb3c9=_0x1bbd5f;logger[_0xe82f('0xd')](_0xe82f('0x61'),_0x3bb3c9['id']);return getTicket(_0x31cc29,_0x35ca73,_0x3bb3c9,_0x1f823e,_0x2eeb8c,_0x1f823e[_0xe82f('0x62')],_0x19c289,_0xe82f('0x63'));})[_0xe82f('0x2e')](function(_0x536581){_0x10a42a=_0x536581;logger[_0xe82f('0xd')]('Ticket\x20created!');logger[_0xe82f('0xd')]('The\x20Ticket\x20ID\x20is:',_0x10a42a['id']);return setRelationship(_0x19c289,_0x35ca73,_0x10a42a,_0xe82f('0x66'));})[_0xe82f('0x2e')](function(){return setRelationship(_0x19c289,_0x3bb3c9,_0x10a42a,_0xe82f('0x67'));})['then'](function(){return getServerInfo(_0x19c289);})['catch'](function(_0xd19350){logger['error']('['+_0x2eeb8c[_0xe82f('0x7a')][_0xe82f('0x7b')]()+']',JSON['stringify'](_0xd19350));});}; \ 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 7fa2d18..b536971 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 _0x11d2=['lodash','util','getString','sortBy','length','string','push','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','test'];(function(_0xf5936,_0x5ddef2){var _0x124458=function(_0x1b03b){while(--_0x1b03b){_0xf5936['push'](_0xf5936['shift']());}};_0x124458(++_0x5ddef2);}(_0x11d2,0x134));var _0x211d=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0x11d2[_0x35885a];return _0xe86249;};'use strict';var _=require(_0x211d('0x0'));var util=require(_0x211d('0x1'));exports[_0x211d('0x2')]=function(_0xc9643c,_0x356f7b,_0x7e0795){var _0x23650c=[];if(_0xc9643c['length']>0x0){var _0xb2a4c1=_[_0x211d('0x3')](_0xc9643c,['id']);for(var _0x3e6579=0x0;_0x3e6579<_0xb2a4c1[_0x211d('0x4')];_0x3e6579++){var _0x892a7c=_0xb2a4c1[_0x3e6579];if(_0x892a7c['type']===_0x211d('0x5')){_0x23650c[_0x211d('0x6')](_0x892a7c['content']);}else if(_0x892a7c[_0x211d('0x7')]===_0x211d('0x8')&&_0x892a7c[_0x211d('0x9')]){_0x356f7b[_0x892a7c[_0x211d('0x9')]]&&_0x23650c['push'](_0x356f7b[_0x892a7c[_0x211d('0x9')]][_0x211d('0xa')]());}else if(_0x892a7c[_0x211d('0x7')]===_0x211d('0xb')&&_0x892a7c[_0x211d('0xc')]&&_0x892a7c[_0x211d('0xc')][_0x211d('0xd')]){_0x356f7b[_0x892a7c['Variable'][_0x211d('0xd')][_0x211d('0xe')]()]&&_0x23650c[_0x211d('0x6')](_0x356f7b[_0x892a7c[_0x211d('0xc')][_0x211d('0xd')][_0x211d('0xe')]()][_0x211d('0xa')]());}else if(_0x892a7c[_0x211d('0x7')]===_0x211d('0xf')){if(_0x892a7c[_0x211d('0x10')]===_0x211d('0x5')&&_0x892a7c[_0x211d('0x11')]){_0x23650c[_0x211d('0x6')](util[_0x211d('0x12')](_0x211d('0x13'),_0x892a7c[_0x211d('0x11')],_0x892a7c['keyContent']));}else if(_0x892a7c['keyType']===_0x211d('0x8')&&_0x892a7c[_0x211d('0x9')]&&_0x892a7c[_0x211d('0x11')]){_0x356f7b[_0x892a7c[_0x211d('0x9')]]&&_0x23650c[_0x211d('0x6')](util[_0x211d('0x12')](_0x211d('0x13'),_0x892a7c[_0x211d('0x11')],_0x356f7b[_0x892a7c[_0x211d('0x9')]]));}else if(_0x892a7c[_0x211d('0x10')]===_0x211d('0xb')&&_0x892a7c[_0x211d('0xc')]&&_0x892a7c[_0x211d('0xc')][_0x211d('0xd')]&&_0x892a7c[_0x211d('0x11')]){_0x356f7b[_0x892a7c[_0x211d('0xc')][_0x211d('0xd')][_0x211d('0xe')]()]&&_0x23650c['push'](util['format']('%s:\x20%s',_0x892a7c[_0x211d('0x11')],_0x356f7b[_0x892a7c['Variable'][_0x211d('0xd')][_0x211d('0xe')]()]));}}}}return _0x23650c[_0x211d('0x14')](_0x7e0795);};exports[_0x211d('0x15')]=function(_0x594e7d){var _0x179de4=_0x594e7d[_0x211d('0x16')](-0x1);if(_0x179de4==='/'){_0x594e7d=_0x594e7d[_0x211d('0x17')](0x0,_0x594e7d[_0x211d('0x18')](_0x179de4));}return _0x594e7d;};exports[_0x211d('0x19')]=function(_0x35552f){if(!_[_0x211d('0x1a')](_0x35552f)&&_0x35552f!==''){var _0x2e5bad=/^(([^<>()\[\]\\.,;:\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 _0x2e5bad[_0x211d('0x1b')](String(_0x35552f)[_0x211d('0xe')]());}else{return![];}}; \ No newline at end of file +var _0x5a77=['variable','join','stripTrailingSlash','substring','validateEmail','isNil','lodash','util','getString','length','sortBy','type','string','push','content','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','%s:\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5a77,0x1c8));var _0x75a7=function(_0x920cd7,_0x46f0d2){_0x920cd7=_0x920cd7-0x0;var _0x31c57b=_0x5a77[_0x920cd7];return _0x31c57b;};'use strict';var _=require(_0x75a7('0x0'));var util=require(_0x75a7('0x1'));exports[_0x75a7('0x2')]=function(_0x3c23d9,_0x19f7f5,_0x4c709a){var _0x51eb8a=[];if(_0x3c23d9[_0x75a7('0x3')]>0x0){var _0x3fe6fc=_[_0x75a7('0x4')](_0x3c23d9,['id']);for(var _0x1df455=0x0;_0x1df455<_0x3fe6fc[_0x75a7('0x3')];_0x1df455++){var _0x595827=_0x3fe6fc[_0x1df455];if(_0x595827[_0x75a7('0x5')]===_0x75a7('0x6')){_0x51eb8a[_0x75a7('0x7')](_0x595827[_0x75a7('0x8')]);}else if(_0x595827[_0x75a7('0x5')]==='variable'&&_0x595827[_0x75a7('0x9')]){_0x19f7f5[_0x595827[_0x75a7('0x9')]]&&_0x51eb8a[_0x75a7('0x7')](_0x19f7f5[_0x595827[_0x75a7('0x9')]][_0x75a7('0xa')]());}else if(_0x595827[_0x75a7('0x5')]===_0x75a7('0xb')&&_0x595827['Variable']&&_0x595827[_0x75a7('0xc')][_0x75a7('0xd')]){_0x19f7f5[_0x595827[_0x75a7('0xc')][_0x75a7('0xd')][_0x75a7('0xe')]()]&&_0x51eb8a[_0x75a7('0x7')](_0x19f7f5[_0x595827['Variable']['name']['toLowerCase']()][_0x75a7('0xa')]());}else if(_0x595827[_0x75a7('0x5')]===_0x75a7('0xf')){if(_0x595827[_0x75a7('0x10')]==='string'&&_0x595827[_0x75a7('0x11')]){_0x51eb8a[_0x75a7('0x7')](util['format'](_0x75a7('0x12'),_0x595827[_0x75a7('0x11')],_0x595827['keyContent']));}else if(_0x595827[_0x75a7('0x10')]===_0x75a7('0x13')&&_0x595827['variableName']&&_0x595827['key']){_0x19f7f5[_0x595827[_0x75a7('0x9')]]&&_0x51eb8a[_0x75a7('0x7')](util['format']('%s:\x20%s',_0x595827[_0x75a7('0x11')],_0x19f7f5[_0x595827['variableName']]));}else if(_0x595827['keyType']===_0x75a7('0xb')&&_0x595827[_0x75a7('0xc')]&&_0x595827[_0x75a7('0xc')]['name']&&_0x595827[_0x75a7('0x11')]){_0x19f7f5[_0x595827[_0x75a7('0xc')][_0x75a7('0xd')]['toLowerCase']()]&&_0x51eb8a[_0x75a7('0x7')](util['format'](_0x75a7('0x12'),_0x595827['key'],_0x19f7f5[_0x595827[_0x75a7('0xc')]['name'][_0x75a7('0xe')]()]));}}}}return _0x51eb8a[_0x75a7('0x14')](_0x4c709a);};exports[_0x75a7('0x15')]=function(_0x9e50dc){var _0x158739=_0x9e50dc['slice'](-0x1);if(_0x158739==='/'){_0x9e50dc=_0x9e50dc[_0x75a7('0x16')](0x0,_0x9e50dc['lastIndexOf'](_0x158739));}return _0x9e50dc;};exports[_0x75a7('0x17')]=function(_0x4a0004){if(!_[_0x75a7('0x18')](_0x4a0004)&&_0x4a0004!==''){var _0x16b580=/^(([^<>()\[\]\\.,;:\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 _0x16b580['test'](String(_0x4a0004)['toLowerCase']());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index 5a0bfab..3107b8e 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 _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x45df98,_0x3384a4){var _0x2b1f91=function(_0x633b7e){while(--_0x633b7e){_0x45df98['push'](_0x45df98['shift']());}};_0x2b1f91(++_0x3384a4);}(_0x9c44,0x178));var _0x49c4=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x9c44[_0x5f09c5];return _0x426ad9;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ No newline at end of file +var _0x34e8=['redis','defaults','localhost','emit','length','forEach','includes','string','picklist','type','idField','toString','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','getString','Subjects','POST','format','remoteUri','create','sessionName','HelpDesk','stringify','success','error','catch','statusCode','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','query','username','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','Agent\x20found!','resolve','email1','first_name','last_name','userId','[vTiger],\x20%s,\x20%s,\x20%s','getUser','admin','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','phone','getEndUser','accessKey','getchallenge','then','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','The\x20User\x20ID\x20is:','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','split','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger'];(function(_0x341100,_0x4b7308){var _0x21bdf3=function(_0x1ce016){while(--_0x1ce016){_0x341100['push'](_0x341100['shift']());}};_0x21bdf3(++_0x4b7308);}(_0x34e8,0x12c));var _0x834e=function(_0xf4d45b,_0xdc655c){_0xf4d45b=_0xf4d45b-0x0;var _0x2c879d=_0x34e8[_0xf4d45b];return _0x2c879d;};'use strict';var _=require(_0x834e('0x0'));var rp=require(_0x834e('0x1'));var BPromise=require(_0x834e('0x2'));var md5=require(_0x834e('0x3'));var util=require('util');var Redis=require(_0x834e('0x4'));var intUtil=require(_0x834e('0x5'));var config=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));config[_0x834e('0x9')]=_[_0x834e('0xa')](config['redis'],{'host':_0x834e('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x834e('0x9')]));function emit(_0x3cc2e3,_0x3a3ef6,_0x2e69e2){io['to'](_0x3cc2e3)[_0x834e('0xc')](_0x3a3ef6,_0x2e69e2);}function getCustomFields(_0x23501c,_0x363786){var _0x1af45a={};if(_0x23501c[_0x834e('0xd')]>0x0){_[_0x834e('0xe')](_0x23501c,function(_0x1e41fe){if(_[_0x834e('0xf')]([_0x834e('0x10'),_0x834e('0x11')],_0x1e41fe[_0x834e('0x12')])&&_0x1e41fe[_0x834e('0x13')]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x1e41fe['content'][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='variable'&&_0x1e41fe[_0x834e('0x15')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe[_0x834e('0x15')]]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['variableName']][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='customVariable'&&_0x1e41fe[_0x834e('0x16')]&&_0x1e41fe['Variable'][_0x834e('0x17')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()][_0x834e('0x14')]();}});}return _0x1af45a;}function createTicket(_0xb993a1,_0x237947,_0x254677,_0x1dd214,_0x595515,_0x2545b4,_0x1fd2c6){logger[_0x834e('0x19')](_0x834e('0x1a'));var _0x4ab05d=_[_0x834e('0x1b')]({'parent_id':'','assigned_user_id':_0x237947['id'],'ticketpriorities':_0x834e('0x1c'),'ticketstatus':'Open','ticket_title':intUtil[_0x834e('0x1d')](_0x1dd214[_0x834e('0x1e')],_0x595515,'\x20'),'description':intUtil[_0x834e('0x1d')](_0x1dd214['Descriptions'],_0x595515,'\x0a'),'contact_id':_0x254677['id']},getCustomFields(_0x2545b4,_0x595515));var _0x4e3f48={'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0xb993a1[_0x834e('0x21')]),'form':{'operation':_0x834e('0x22'),'username':_0xb993a1['username'],'sessionName':_0x1fd2c6[_0x834e('0x23')],'elementType':_0x834e('0x24'),'element':JSON[_0x834e('0x25')](_0x4ab05d)},'json':!![]};return request(_0x4e3f48)['then'](function(_0x24fcf7){if(_0x24fcf7[_0x834e('0x26')]){return BPromise['resolve']({'id':_0x24fcf7['result']['id']});}else{throw new Error(util[_0x834e('0x20')]('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x834e('0x25')](_0x24fcf7[_0x834e('0x27')])));}})[_0x834e('0x28')](function(_0x2cc2eb){var _0x3cd928=_0x2cc2eb[_0x834e('0x29')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','createTicket',_0x3cd928,JSON['stringify'](_0x2cc2eb));});}function getUser(_0x2c7a8d,_0x567cea,_0x106d6a){if(intUtil['validateEmail'](_0x567cea)){logger[_0x834e('0x19')](_0x834e('0x2a'),_0x567cea);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x2c7a8d[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x2c7a8d[_0x834e('0x2e')],'sessionName':_0x106d6a[_0x834e('0x23')],'query':util['format'](_0x834e('0x2f'),_0x567cea)},'json':!![]})['then'](function(_0x2c75c2){if(_0x2c75c2[_0x834e('0x26')]&&_0x2c75c2[_0x834e('0x30')][_0x834e('0xd')]){logger[_0x834e('0x19')](_0x834e('0x31'));return BPromise[_0x834e('0x32')]({'id':_0x2c75c2[_0x834e('0x30')][0x0]['id'],'email':_0x2c75c2[_0x834e('0x30')][0x0][_0x834e('0x33')],'name':_0x2c75c2['result'][0x0][_0x834e('0x34')]+'\x20'+_0x2c75c2[_0x834e('0x30')][_0x834e('0x35')]});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':'admin'});}})['catch'](function(_0x3e58fa){var _0x41bf4d=_0x3e58fa[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x41bf4d,JSON['stringify'](_0x3e58fa));});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':_0x834e('0x39')})[_0x834e('0x28')](function(_0x491c28){var _0x481f70=_0x491c28[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x481f70,JSON[_0x834e('0x25')](_0x491c28));});}}function getEndUser(_0x4ca43c,_0x1c5ed6,_0x548d1d,_0x50c243){logger[_0x834e('0x19')]('Searching\x20end\x20user\x20with\x20phone',_0x548d1d);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x4ca43c[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x4ca43c['username'],'sessionName':_0x50c243[_0x834e('0x23')],'query':util[_0x834e('0x20')](_0x834e('0x3a'),_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d)},'json':!![]})['then'](function(_0x35380e){if(_0x35380e[_0x834e('0x26')]&&_0x35380e['result'][_0x834e('0xd')]){logger['info'](_0x834e('0x3b'));return BPromise[_0x834e('0x32')]({'id':_0x35380e['result'][0x0]['id'],'name':_0x35380e['result'][0x0][_0x834e('0x3c')]+'\x20'+_0x35380e[_0x834e('0x30')][0x0][_0x834e('0x3d')],'phone':_0x548d1d});}else{logger[_0x834e('0x19')](_0x834e('0x3e'));return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0x4ca43c[_0x834e('0x21')]),'form':{'operation':'create','sessionName':_0x50c243[_0x834e('0x23')],'elementType':'Contacts','element':JSON[_0x834e('0x25')]({'lastname':_0x1c5ed6,'phone':_0x548d1d,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x361f60){logger[_0x834e('0x19')]('Enduser\x20created.');return BPromise[_0x834e('0x32')]({'id':_0x361f60[_0x834e('0x30')]['id'],'name':_0x361f60[_0x834e('0x30')][_0x834e('0x3d')],'phone':_0x361f60[_0x834e('0x30')][_0x834e('0x3f')]});})[_0x834e('0x28')](function(_0x3ccd8e){var _0x5dc63b=_0x3ccd8e[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x40'),_0x5dc63b,JSON['stringify'](_0x3ccd8e));});}});}function getConnection(_0x112306){var _0x42fd90=_0x112306[_0x834e('0x2e')];var _0x2112d5=_0x112306[_0x834e('0x41')];return request({'method':_0x834e('0x2b'),'uri':util['format']('%s/webservice.php',_0x112306[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x42'),'username':_0x42fd90},'json':!![]})[_0x834e('0x43')](function(_0x40ff5a){if(_0x40ff5a[_0x834e('0x26')]){return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x112306[_0x834e('0x21')]),'form':{'operation':_0x834e('0x44'),'username':_0x42fd90,'accessKey':md5(_0x40ff5a[_0x834e('0x30')][_0x834e('0x45')]+_0x2112d5)},'json':!![]});}})[_0x834e('0x43')](function(_0x1a3237){if(_0x1a3237[_0x834e('0x26')]){return BPromise[_0x834e('0x32')](_0x1a3237[_0x834e('0x30')]);}else{throw new Error(util[_0x834e('0x20')](_0x834e('0x46'),_0x112306['id']));}})[_0x834e('0x28')](function(_0x4cfacd){var _0x1cc0b8=_0x4cfacd[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x47'),_0x1cc0b8,JSON['stringify'](_0x4cfacd));});}function request(_0x3dcca3){logger[_0x834e('0x19')](_0x834e('0x48'),JSON[_0x834e('0x25')](_0x3dcca3));return rp(_0x3dcca3);}exports[_0x834e('0x49')]=function(_0xb77aab,_0x4549ba,_0x4a8b32,_0x1ad7fe,_0x8bc6c6,_0x3e0550){var _0x363675,_0x86ad2b,_0x396bbe,_0x344b51;_0x3e0550[_0x834e('0x21')]=intUtil['stripTrailingSlash'](_0x3e0550[_0x834e('0x21')]);if(_0x8bc6c6&&_0x8bc6c6['monitor_format']){logger[_0x834e('0x19')]('[QUEUE]',_0x834e('0x4a'));_0x4549ba['recordingURL']=util['format'](_0x834e('0x4b'),_0x3e0550[_0x834e('0x4c')],_0x4549ba['uniqueid'],md5(_0x4549ba['uniqueid']));}else{_0x4549ba[_0x834e('0x4d')]='';}return getConnection(_0x3e0550)[_0x834e('0x43')](function(_0x138ed2){_0x344b51=_0x138ed2;return getUser(_0x3e0550,_0x1ad7fe[_0x834e('0x4e')],_0x344b51);})[_0x834e('0x43')](function(_0x315858){_0x363675=_0x315858;logger[_0x834e('0x19')](_0x834e('0x4f'),_0x363675['id']);return getEndUser(_0x3e0550,_0x4549ba['calleridname'],_0x4549ba[_0x834e('0x50')],_0x344b51);})[_0x834e('0x43')](function(_0x5d5ac2){_0x86ad2b=_0x5d5ac2;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x86ad2b['id']);return createTicket(_0x3e0550,_0x363675,_0x86ad2b,_0x4a8b32,_0x4549ba,_0x4a8b32[_0x834e('0x51')],_0x344b51);})[_0x834e('0x43')](function(_0x5160c4){_0x396bbe=_0x5160c4;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x396bbe['id']);var _0x5a2924=util[_0x834e('0x20')](_0x834e('0x54'),_0x3e0550[_0x834e('0x21')],_['split'](_0x396bbe['id'],'x')[0x1]);logger[_0x834e('0x19')](_0x834e('0x55'),_0x834e('0x56'));emit(util[_0x834e('0x20')](_0x834e('0x57'),_0x1ad7fe[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5a2924});})[_0x834e('0x28')](function(_0x208c21){logger[_0x834e('0x27')](_0x834e('0x55'),JSON[_0x834e('0x25')](_0x208c21));});};exports[_0x834e('0x59')]=function(_0x1659c8,_0x460a7a,_0x17b8e3,_0x297cce,_0x14ed83,_0x193a15,_0x3e3467){var _0xed4081,_0x2cb233,_0x5c83eb,_0x2145cf;_0x193a15[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x193a15[_0x834e('0x21')]);_0x193a15['serverUrl']=intUtil[_0x834e('0x5a')](_0x193a15['serverUrl']);if(_0x3e3467&&_0x3e3467['recordingFormat']&&_0x3e3467[_0x834e('0x5b')]!==_0x834e('0x5c')){logger[_0x834e('0x19')](_0x834e('0x5d'),_0x834e('0x4a'));_0x460a7a[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x193a15['serverUrl'],_0x460a7a[_0x834e('0x5e')],md5(_0x460a7a['uniqueid']));}return getConnection(_0x193a15)[_0x834e('0x43')](function(_0xd35dda){_0x2145cf=_0xd35dda;return getUser(_0x193a15,_0x297cce['email'],_0x2145cf);})['then'](function(_0x4a4def){_0xed4081=_0x4a4def;logger[_0x834e('0x19')](_0x834e('0x4f'),_0xed4081['id']);return getEndUser(_0x193a15,_0x460a7a[_0x834e('0x5f')],_0x460a7a[_0x834e('0x60')],_0x2145cf);})['then'](function(_0x2b0d93){_0x2cb233=_0x2b0d93;logger[_0x834e('0x19')](_0x834e('0x61'),_0x2cb233['id']);return createTicket(_0x193a15,_0xed4081,_0x2cb233,_0x17b8e3,_0x460a7a,_0x17b8e3[_0x834e('0x51')],_0x2145cf);})[_0x834e('0x43')](function(_0x28b5c9){_0x5c83eb=_0x28b5c9;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x5c83eb['id']);var _0x5b2bf6=util[_0x834e('0x20')](_0x834e('0x54'),_0x193a15[_0x834e('0x21')],_[_0x834e('0x62')](_0x5c83eb['id'],'x')[0x1]);logger['info'](_0x834e('0x5d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x297cce[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5b2bf6});})['catch'](function(_0x2645df){logger[_0x834e('0x27')]('[OUTBOUND]',JSON[_0x834e('0x25')](_0x2645df));});};exports[_0x834e('0x63')]=function(_0x4b88e7,_0x5df169,_0x346be5,_0x2a42a3,_0x8bc7d9,_0x44c909){var _0x1d8e7,_0x493239,_0x264a6f,_0x520367;_0x44c909[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x21')]);_0x44c909['serverUrl']=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x4c')]);if(_0x8bc7d9&&_0x8bc7d9['monitor_format']){logger[_0x834e('0x19')]('['+_0x5df169[_0x834e('0x64')][_0x834e('0x65')]()+']','Recording\x20is\x20enabled!');_0x5df169[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x44c909[_0x834e('0x4c')],_0x5df169[_0x834e('0x5e')],md5(_0x5df169[_0x834e('0x5e')]));}else{_0x5df169[_0x834e('0x4d')]='';}return getConnection(_0x44c909)[_0x834e('0x43')](function(_0xd49002){_0x520367=_0xd49002;return getUser(_0x44c909,'',_0x520367);})[_0x834e('0x43')](function(_0x57d898){_0x1d8e7=_0x57d898;logger['info']('The\x20User\x20ID\x20is:',_0x1d8e7['id']);return getEndUser(_0x44c909,_0x5df169[_0x834e('0x66')],_0x5df169[_0x834e('0x50')],_0x520367);})[_0x834e('0x43')](function(_0x37fa2c){_0x493239=_0x37fa2c;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x493239['id']);return createTicket(_0x44c909,_0x1d8e7,_0x493239,_0x346be5,_0x5df169,_0x346be5['Fields'],_0x520367);})[_0x834e('0x43')](function(_0x1ad428){_0x264a6f=_0x1ad428;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')]('The\x20Ticket\x20ID\x20is:',_0x264a6f['id']);})[_0x834e('0x28')](function(_0x2b162a){logger[_0x834e('0x27')]('['+_0x5df169['lastevent'][_0x834e('0x65')]()+']',JSON[_0x834e('0x25')](_0x2b162a));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 67533bb..204df8a 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 _0xec3e=['toString','type','idField','custom_fields','push','variable','variableName','customVariable','Variable','name','customField','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','user:%s','trigger:browser:url','%s/agent/tickets/%s','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','inspect','recordingFormat','none','[OUTBOUND]','destcalleridnum','integrationTab','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','replace','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','monitor_format','lastevent','The\x20Ticket\x20ID\x20is:','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','defaults','redis','localhost','socket.io-emitter','emit','application/json','info','format','POST','merge','Tags','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','remoteUri','type:user\x20role:agent\x20email:%s','count','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','end-user','authType','password','%s:%s','username','token','%s/token:%s','base64','debug','[HTTP]','stringify','map','forEach','includes','string','picklist','nameField','toLowerCase','content'];(function(_0x5d5e3b,_0xc516c3){var _0x4d559d=function(_0x3a25ed){while(--_0x3a25ed){_0x5d5e3b['push'](_0x5d5e3b['shift']());}};_0x4d559d(++_0xc516c3);}(_0xec3e,0x10b));var _0xeec3=function(_0x6fa273,_0x4e46d8){_0x6fa273=_0x6fa273-0x0;var _0x9acc8b=_0xec3e[_0x6fa273];return _0x9acc8b;};'use strict';var _=require(_0xeec3('0x0'));var rp=require(_0xeec3('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0xeec3('0x2'));var intUtil=require(_0xeec3('0x3'));var config=require(_0xeec3('0x4'));var logger=require(_0xeec3('0x5'))(_0xeec3('0x6'));config['redis']=_[_0xeec3('0x7')](config[_0xeec3('0x8')],{'host':_0xeec3('0x9'),'port':0x18eb});var io=require(_0xeec3('0xa'))(new Redis(config[_0xeec3('0x8')]));function emit(_0x342b4f,_0x26a024,_0x181ec6){io['to'](_0x342b4f)[_0xeec3('0xb')](_0x26a024,_0x181ec6);}var headers={'Content-Type':_0xeec3('0xc'),'Accept':_0xeec3('0xc')};function getTicket(_0x3b6a60,_0x383d00,_0x3b6370,_0x37bc12,_0x5c33e0){logger[_0xeec3('0xd')]('Creating\x20new\x20ticket...');return request({'uri':util[_0xeec3('0xe')]('%s/tickets.json',_0x3b6a60['remoteUri']),'method':_0xeec3('0xf'),'body':{'ticket':_[_0xeec3('0x10')]({'requester_id':_0x3b6370['id'],'submitter_id':_0x383d00?_0x383d00['id']:undefined,'assignee_id':_0x383d00?_0x383d00['id']:undefined,'tags':getTags(_0x37bc12[_0xeec3('0x11')],'name'),'subject':intUtil[_0xeec3('0x12')](_0x37bc12[_0xeec3('0x13')],_0x5c33e0,'\x20'),'description':intUtil[_0xeec3('0x12')](_0x37bc12[_0xeec3('0x14')],_0x5c33e0,'\x0a'),'comment':{'public':![],'body':intUtil[_0xeec3('0x12')](_0x37bc12[_0xeec3('0x14')],_0x5c33e0,'\x0a')}},getCustomFields(_0x37bc12[_0xeec3('0x15')],_0x5c33e0))}})[_0xeec3('0x16')](function(_0x263de7){logger[_0xeec3('0xd')](_0xeec3('0x17'));return _0x263de7[_0xeec3('0x18')];});}function getUser(_0x9211e6,_0x148481){if(intUtil[_0xeec3('0x19')](_0x148481)){logger['info'](_0xeec3('0x1a'),_0x148481);return request({'uri':util['format'](_0xeec3('0x1b'),_0x9211e6[_0xeec3('0x1c')]),'qs':{'query':util[_0xeec3('0xe')](_0xeec3('0x1d'),_0x148481)}})[_0xeec3('0x16')](function(_0x4e5ef2){if(_0x4e5ef2[_0xeec3('0x1e')]){logger[_0xeec3('0xd')]('Agent\x20found!');return _[_0xeec3('0x1f')](_0x4e5ef2[_0xeec3('0x20')],{'email':_0x148481,'role':_0xeec3('0x21')});}else{logger[_0xeec3('0xd')](_0xeec3('0x22'));return request({'uri':util[_0xeec3('0xe')](_0xeec3('0x23'),_0x9211e6[_0xeec3('0x1c')])})[_0xeec3('0x16')](function(_0x158166){logger[_0xeec3('0xd')](_0xeec3('0x24'));return _0x158166['user'];});}});}else{logger[_0xeec3('0xd')](_0xeec3('0x22'));return request({'uri':util[_0xeec3('0xe')](_0xeec3('0x23'),_0x9211e6[_0xeec3('0x1c')])})[_0xeec3('0x16')](function(_0x161440){logger[_0xeec3('0xd')](_0xeec3('0x24'));return _0x161440[_0xeec3('0x25')];});}}function getEndUser(_0x1a2968,_0x548b8d,_0xcb63ce){logger['info'](_0xeec3('0x26'),_0xcb63ce);return request({'uri':util['format'](_0xeec3('0x1b'),_0x1a2968['remoteUri']),'qs':{'query':util['format'](_0xeec3('0x27'),_0xcb63ce)}})[_0xeec3('0x16')](function(_0x4be0bb){var _0x59fd75;if(_0x4be0bb[_0xeec3('0x20')][_0xeec3('0x28')]){_0x4be0bb[_0xeec3('0x20')]=_['filter'](_0x4be0bb[_0xeec3('0x20')],{'suspended':![],'role':'end-user'});if(_0x4be0bb[_0xeec3('0x20')][_0xeec3('0x28')]){_0x59fd75=_[_0xeec3('0x29')](_0x4be0bb['results']);}}if(_0x59fd75){logger[_0xeec3('0xd')]('Enduser\x20found!');return _0x59fd75;}else{logger[_0xeec3('0xd')](_0xeec3('0x2a'));return request({'uri':util[_0xeec3('0xe')](_0xeec3('0x2b'),_0x1a2968[_0xeec3('0x1c')]),'method':_0xeec3('0xf'),'body':{'user':{'role':_0xeec3('0x2c'),'name':util[_0xeec3('0xe')]('Caller\x20-\x20%s',_0x548b8d||_0xcb63ce),'phone':_0xcb63ce}}})[_0xeec3('0x16')](function(_0xfd073b){logger['info']('Enduser\x20created.');return _0xfd073b[_0xeec3('0x25')];});}});}function getAuth(_0x1c7ad7){var _0x174e6e;if(_0x1c7ad7[_0xeec3('0x2d')]===_0xeec3('0x2e')){_0x174e6e=util[_0xeec3('0xe')](_0xeec3('0x2f'),_0x1c7ad7[_0xeec3('0x30')],_0x1c7ad7[_0xeec3('0x2e')]);}else if(_0x1c7ad7[_0xeec3('0x2d')]===_0xeec3('0x31')){_0x174e6e=util['format'](_0xeec3('0x32'),_0x1c7ad7[_0xeec3('0x30')],_0x1c7ad7['token']);}return util['format']('Basic\x20%s',new Buffer(_0x174e6e)['toString'](_0xeec3('0x33')));}function request(_0x48a62c){logger[_0xeec3('0x34')](_0xeec3('0x35'),JSON[_0xeec3('0x36')](_0x48a62c));return rp(_[_0xeec3('0x7')](_0x48a62c,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x51b1f5,_0x45b603){var _0x234039=[];if(_0x51b1f5&&_0x51b1f5[_0xeec3('0x28')]>0x0){_0x234039=_[_0xeec3('0x37')](_0x51b1f5,_0x45b603);}return _0x234039;}function getCustomFields(_0x147968,_0x54e312){var _0x58b2a8=[];var _0x962d15={'custom_fields':[]};if(_0x147968['length']>0x0){_[_0xeec3('0x38')](_0x147968,function(_0x2012d1){if(_[_0xeec3('0x39')]([_0xeec3('0x3a'),_0xeec3('0x3b')],_0x2012d1['type'])&&_0x2012d1[_0xeec3('0x3c')]&&!_0x2012d1['customField']){_0x962d15[_0x2012d1[_0xeec3('0x3c')][_0xeec3('0x3d')]()]=_0x2012d1[_0xeec3('0x3e')][_0xeec3('0x3f')]();}else if(_['includes']([_0xeec3('0x3a'),_0xeec3('0x3b')],_0x2012d1[_0xeec3('0x40')])&&_0x2012d1[_0xeec3('0x41')]&&_0x2012d1['customField']){_0x962d15[_0xeec3('0x42')][_0xeec3('0x43')]({'id':_0x2012d1['idField'],'value':_0x2012d1['content'][_0xeec3('0x3f')]()});}else if(_0x2012d1[_0xeec3('0x40')]===_0xeec3('0x44')&&_0x2012d1[_0xeec3('0x45')]&&_0x2012d1[_0xeec3('0x41')]&&_0x2012d1['customField']){_0x54e312[_0x2012d1['variableName']]&&_0x962d15[_0xeec3('0x42')][_0xeec3('0x43')]({'id':_0x2012d1[_0xeec3('0x41')],'value':_0x54e312[_0x2012d1[_0xeec3('0x45')]][_0xeec3('0x3f')]()});}else if(_0x2012d1[_0xeec3('0x40')]===_0xeec3('0x46')&&_0x2012d1[_0xeec3('0x47')]&&_0x2012d1[_0xeec3('0x47')][_0xeec3('0x48')]&&_0x2012d1[_0xeec3('0x41')]&&_0x2012d1[_0xeec3('0x49')]){_0x54e312[_0x2012d1['Variable']['name'][_0xeec3('0x3d')]()]&&_0x962d15['custom_fields'][_0xeec3('0x43')]({'id':_0x2012d1[_0xeec3('0x41')],'value':_0x54e312[_0x2012d1[_0xeec3('0x47')][_0xeec3('0x48')][_0xeec3('0x3d')]()][_0xeec3('0x3f')]()});}});}return _0x962d15;}exports[_0xeec3('0x4a')]=function(_0xf7bd48,_0x1a6f35,_0x15195e,_0x15c072,_0x4fdcd9,_0x22bb76){var _0x1ad5f7,_0x4dcf68;_0x22bb76[_0xeec3('0x1c')]=intUtil[_0xeec3('0x4b')](_0x22bb76[_0xeec3('0x1c')]);_0x22bb76[_0xeec3('0x4c')]=intUtil[_0xeec3('0x4b')](_0x22bb76[_0xeec3('0x4c')]);if(_0x4fdcd9&&_0x4fdcd9['monitor_format']){logger[_0xeec3('0xd')](_0xeec3('0x4d'),_0xeec3('0x4e'));_0x1a6f35[_0xeec3('0x4f')]=util[_0xeec3('0xe')](_0xeec3('0x50'),_0x22bb76[_0xeec3('0x4c')],_0x1a6f35[_0xeec3('0x51')],md5(_0x1a6f35[_0xeec3('0x51')]));}else{_0x1a6f35[_0xeec3('0x4f')]='';}headers[_0xeec3('0x52')]=getAuth(_0x22bb76);return getUser(_0x22bb76,_0x15c072[_0xeec3('0x53')])[_0xeec3('0x16')](function(_0x3d1b8e){_0x1ad5f7=_0x3d1b8e;logger[_0xeec3('0xd')](_0xeec3('0x54'),_0x1ad5f7['id']);return getEndUser(_0x22bb76,_0x1a6f35[_0xeec3('0x55')],_0x1a6f35[_0xeec3('0x56')]);})[_0xeec3('0x16')](function(_0x130fd8){_0x4dcf68=_0x130fd8;logger['info']('The\x20Enduser\x20ID\x20is:',_0x4dcf68['id']);return getTicket(_0x22bb76,_0x1ad5f7,_0x4dcf68,_0x15195e,_0x1a6f35);})['then'](function(_0x2b4807){if(_0x2b4807){logger[_0xeec3('0xd')]('The\x20Ticket\x20ID\x20is:',_0x2b4807['id']);switch(_0x22bb76[_0xeec3('0x40')]){case'integrationTab':logger[_0xeec3('0xd')]('[QUEUE]',_0xeec3('0x57'));return request({'uri':util['format'](_0xeec3('0x58'),_0x22bb76[_0xeec3('0x1c')],_0x1ad5f7['id'],_0x2b4807['id']),'method':'POST'});case'newTab':logger['info'](_0xeec3('0x4d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xeec3('0xe')](_0xeec3('0x59'),_0x15c072[_0xeec3('0x48')]),_0xeec3('0x5a'),{'uri':util[_0xeec3('0xe')](_0xeec3('0x5b'),_0x22bb76[_0xeec3('0x1c')]['replace'](_0xeec3('0x5c'),''),_0x2b4807['id'])});break;default:logger[_0xeec3('0x5d')](_0xeec3('0x4d'),_0xeec3('0x5e'));}}})['catch'](function(_0x5c9d02){logger[_0xeec3('0x5d')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0xeec3('0x5f')](_0x5c9d02,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x2145d1,_0x5bcb9f,_0x1a1b55,_0x133512,_0x32468d,_0x3346d7,_0x2a4370){var _0x1c1a46,_0x513a28;_0x3346d7[_0xeec3('0x1c')]=intUtil[_0xeec3('0x4b')](_0x3346d7['remoteUri']);_0x3346d7[_0xeec3('0x4c')]=intUtil[_0xeec3('0x4b')](_0x3346d7['serverUrl']);if(_0x2a4370&&_0x2a4370[_0xeec3('0x60')]&&_0x2a4370[_0xeec3('0x60')]!==_0xeec3('0x61')){logger[_0xeec3('0xd')](_0xeec3('0x62'),'Recording\x20is\x20enabled!');_0x5bcb9f[_0xeec3('0x4f')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3346d7[_0xeec3('0x4c')],_0x5bcb9f['uniqueid'],md5(_0x5bcb9f['uniqueid']));}headers[_0xeec3('0x52')]=getAuth(_0x3346d7);return getUser(_0x3346d7,_0x133512[_0xeec3('0x53')])['then'](function(_0x402977){_0x1c1a46=_0x402977;logger[_0xeec3('0xd')](_0xeec3('0x54'),_0x1c1a46['id']);return getEndUser(_0x3346d7,_0x5bcb9f['destcalleridname'],_0x5bcb9f[_0xeec3('0x63')]);})[_0xeec3('0x16')](function(_0x21866a){_0x513a28=_0x21866a;logger[_0xeec3('0xd')]('The\x20Enduser\x20ID\x20is:',_0x513a28['id']);return getTicket(_0x3346d7,_0x1c1a46,_0x513a28,_0x1a1b55,_0x5bcb9f);})['then'](function(_0x440cb4){if(_0x440cb4){logger['info']('The\x20Ticket\x20ID\x20is:',_0x440cb4['id']);switch(_0x3346d7['type']){case _0xeec3('0x64'):logger[_0xeec3('0xd')](_0xeec3('0x62'),_0xeec3('0x57'));return request({'uri':util['format'](_0xeec3('0x58'),_0x3346d7[_0xeec3('0x1c')],_0x1c1a46['id'],_0x440cb4['id']),'method':_0xeec3('0xf')});case _0xeec3('0x65'):logger[_0xeec3('0xd')](_0xeec3('0x62'),_0xeec3('0x66'));emit(util[_0xeec3('0xe')](_0xeec3('0x59'),_0x133512['name']),'trigger:browser:url',{'uri':util[_0xeec3('0xe')](_0xeec3('0x5b'),_0x3346d7[_0xeec3('0x1c')][_0xeec3('0x67')]('/api/v2',''),_0x440cb4['id'])});break;default:logger[_0xeec3('0x5d')](_0xeec3('0x62'),_0xeec3('0x5e'));}}})[_0xeec3('0x68')](function(_0x1b9d14){logger[_0xeec3('0x5d')](_0xeec3('0x69'),util[_0xeec3('0x5f')](_0x1b9d14,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x423cfe,_0x1bde34,_0xbc6668,_0x2907d0,_0x20e205,_0x8fc2ea){var _0x694b5c,_0x242cdd;_0x8fc2ea['remoteUri']=intUtil['stripTrailingSlash'](_0x8fc2ea[_0xeec3('0x1c')]);_0x8fc2ea[_0xeec3('0x4c')]=intUtil[_0xeec3('0x4b')](_0x8fc2ea[_0xeec3('0x4c')]);if(_0x20e205&&_0x20e205[_0xeec3('0x6a')]){logger[_0xeec3('0xd')]('['+_0x1bde34[_0xeec3('0x6b')]['toUpperCase']()+']',_0xeec3('0x4e'));_0x1bde34['recordingURL']=util[_0xeec3('0xe')](_0xeec3('0x50'),_0x8fc2ea[_0xeec3('0x4c')],_0x1bde34[_0xeec3('0x51')],md5(_0x1bde34[_0xeec3('0x51')]));}else{_0x1bde34[_0xeec3('0x4f')]='';}headers[_0xeec3('0x52')]=getAuth(_0x8fc2ea);return getUser(_0x8fc2ea)[_0xeec3('0x16')](function(_0x305abf){_0x694b5c=_0x305abf;logger[_0xeec3('0xd')](_0xeec3('0x54'),_0x694b5c['id']);return getEndUser(_0x8fc2ea,_0x1bde34['calleridname'],_0x1bde34['calleridnum']);})['then'](function(_0x444839){_0x242cdd=_0x444839;logger['info']('The\x20Enduser\x20ID\x20is:',_0x242cdd['id']);return getTicket(_0x8fc2ea,_0x694b5c,_0x242cdd,_0xbc6668,_0x1bde34);})['then'](function(_0x3fc428){if(_0x3fc428){logger[_0xeec3('0xd')](_0xeec3('0x6c'),_0x3fc428['id']);}})[_0xeec3('0x68')](function(_0x1d6865){logger[_0xeec3('0x5d')]('['+_0x1bde34[_0xeec3('0x6b')]['toUpperCase']()+']'+_0xeec3('0x6d'),util['inspect'](_0x1d6865,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xc2bd=['[HTTP]','stringify','map','string','picklist','type','nameField','customField','includes','idField','push','content','variable','variableName','customVariable','Variable','custom_fields','toLowerCase','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','trigger:browser:url','replace','/api/v2','error','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/agent/tickets/%s','Zendesk\x20account\x20type\x20not\x20recognized','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','toUpperCase','calleridnum','lastevent','\x20Error\x20running\x20Zendesk\x20integration','inspect','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','emit','application/json','info','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','validateEmail','format','count','Agent\x20found!','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','Enduser\x20found!','end-user','authType','%s:%s','username','password','token','Basic\x20%s','toString','base64','debug'];(function(_0x4cc802,_0xc3bf6b){var _0x595c66=function(_0x4eb7c8){while(--_0x4eb7c8){_0x4cc802['push'](_0x4cc802['shift']());}};_0x595c66(++_0xc3bf6b);}(_0xc2bd,0xa4));var _0xdc2b=function(_0x5799df,_0x5aacd5){_0x5799df=_0x5799df-0x0;var _0x319488=_0xc2bd[_0x5799df];return _0x319488;};'use strict';var _=require('lodash');var rp=require(_0xdc2b('0x0'));var md5=require(_0xdc2b('0x1'));var util=require(_0xdc2b('0x2'));var Redis=require('ioredis');var intUtil=require(_0xdc2b('0x3'));var config=require(_0xdc2b('0x4'));var logger=require(_0xdc2b('0x5'))(_0xdc2b('0x6'));config[_0xdc2b('0x7')]=_[_0xdc2b('0x8')](config[_0xdc2b('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xdc2b('0x7')]));function emit(_0x502afe,_0x205672,_0x44b7ef){io['to'](_0x502afe)[_0xdc2b('0x9')](_0x205672,_0x44b7ef);}var headers={'Content-Type':_0xdc2b('0xa'),'Accept':'application/json'};function getTicket(_0x4a34c7,_0x38e461,_0x208f74,_0x2e7157,_0x4c1d1e){logger[_0xdc2b('0xb')]('Creating\x20new\x20ticket...');return request({'uri':util['format'](_0xdc2b('0xc'),_0x4a34c7[_0xdc2b('0xd')]),'method':_0xdc2b('0xe'),'body':{'ticket':_[_0xdc2b('0xf')]({'requester_id':_0x208f74['id'],'submitter_id':_0x38e461?_0x38e461['id']:undefined,'assignee_id':_0x38e461?_0x38e461['id']:undefined,'tags':getTags(_0x2e7157[_0xdc2b('0x10')],_0xdc2b('0x11')),'subject':intUtil[_0xdc2b('0x12')](_0x2e7157[_0xdc2b('0x13')],_0x4c1d1e,'\x20'),'description':intUtil[_0xdc2b('0x12')](_0x2e7157['Descriptions'],_0x4c1d1e,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x2e7157[_0xdc2b('0x14')],_0x4c1d1e,'\x0a')}},getCustomFields(_0x2e7157[_0xdc2b('0x15')],_0x4c1d1e))}})[_0xdc2b('0x16')](function(_0x1eefd0){logger[_0xdc2b('0xb')](_0xdc2b('0x17'));return _0x1eefd0['ticket'];});}function getUser(_0x55bad5,_0x45cd82){if(intUtil[_0xdc2b('0x18')](_0x45cd82)){logger[_0xdc2b('0xb')]('Getting\x20agent\x20with\x20email',_0x45cd82);return request({'uri':util[_0xdc2b('0x19')]('%s/search.json',_0x55bad5['remoteUri']),'qs':{'query':util[_0xdc2b('0x19')]('type:user\x20role:agent\x20email:%s',_0x45cd82)}})[_0xdc2b('0x16')](function(_0x558e5c){if(_0x558e5c[_0xdc2b('0x1a')]){logger[_0xdc2b('0xb')](_0xdc2b('0x1b'));return _['find'](_0x558e5c[_0xdc2b('0x1c')],{'email':_0x45cd82,'role':_0xdc2b('0x1d')});}else{logger['info'](_0xdc2b('0x1e'));return request({'uri':util[_0xdc2b('0x19')](_0xdc2b('0x1f'),_0x55bad5['remoteUri'])})[_0xdc2b('0x16')](function(_0x44eca2){logger[_0xdc2b('0xb')](_0xdc2b('0x20'));return _0x44eca2[_0xdc2b('0x21')];});}});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xdc2b('0x19')](_0xdc2b('0x1f'),_0x55bad5[_0xdc2b('0xd')])})[_0xdc2b('0x16')](function(_0x2a0054){logger[_0xdc2b('0xb')]('Admin\x20account\x20selected.');return _0x2a0054[_0xdc2b('0x21')];});}}function getEndUser(_0x5c868d,_0x2922a7,_0x3836ee){logger['info'](_0xdc2b('0x22'),_0x3836ee);return request({'uri':util[_0xdc2b('0x19')]('%s/search.json',_0x5c868d[_0xdc2b('0xd')]),'qs':{'query':util[_0xdc2b('0x19')](_0xdc2b('0x23'),_0x3836ee)}})[_0xdc2b('0x16')](function(_0x4526dd){var _0x314c67;if(_0x4526dd[_0xdc2b('0x1c')][_0xdc2b('0x24')]){_0x4526dd['results']=_['filter'](_0x4526dd[_0xdc2b('0x1c')],{'suspended':![],'role':'end-user'});if(_0x4526dd['results'][_0xdc2b('0x24')]){_0x314c67=_['first'](_0x4526dd[_0xdc2b('0x1c')]);}}if(_0x314c67){logger[_0xdc2b('0xb')](_0xdc2b('0x25'));return _0x314c67;}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xdc2b('0x19')]('%s/users.json',_0x5c868d[_0xdc2b('0xd')]),'method':_0xdc2b('0xe'),'body':{'user':{'role':_0xdc2b('0x26'),'name':util[_0xdc2b('0x19')]('Caller\x20-\x20%s',_0x2922a7||_0x3836ee),'phone':_0x3836ee}}})[_0xdc2b('0x16')](function(_0x22225d){logger['info']('Enduser\x20created.');return _0x22225d['user'];});}});}function getAuth(_0x2d7c0c){var _0x40d802;if(_0x2d7c0c[_0xdc2b('0x27')]==='password'){_0x40d802=util[_0xdc2b('0x19')](_0xdc2b('0x28'),_0x2d7c0c[_0xdc2b('0x29')],_0x2d7c0c[_0xdc2b('0x2a')]);}else if(_0x2d7c0c['authType']===_0xdc2b('0x2b')){_0x40d802=util[_0xdc2b('0x19')]('%s/token:%s',_0x2d7c0c[_0xdc2b('0x29')],_0x2d7c0c['token']);}return util[_0xdc2b('0x19')](_0xdc2b('0x2c'),new Buffer(_0x40d802)[_0xdc2b('0x2d')](_0xdc2b('0x2e')));}function request(_0x113fc0){logger[_0xdc2b('0x2f')](_0xdc2b('0x30'),JSON[_0xdc2b('0x31')](_0x113fc0));return rp(_[_0xdc2b('0x8')](_0x113fc0,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x4807f0,_0x321090){var _0x1ec11d=[];if(_0x4807f0&&_0x4807f0[_0xdc2b('0x24')]>0x0){_0x1ec11d=_[_0xdc2b('0x32')](_0x4807f0,_0x321090);}return _0x1ec11d;}function getCustomFields(_0x2566cb,_0x364fc6){var _0x53afb9=[];var _0x450e2d={'custom_fields':[]};if(_0x2566cb[_0xdc2b('0x24')]>0x0){_['forEach'](_0x2566cb,function(_0x6c1f5e){if(_['includes']([_0xdc2b('0x33'),_0xdc2b('0x34')],_0x6c1f5e[_0xdc2b('0x35')])&&_0x6c1f5e[_0xdc2b('0x36')]&&!_0x6c1f5e[_0xdc2b('0x37')]){_0x450e2d[_0x6c1f5e[_0xdc2b('0x36')]['toLowerCase']()]=_0x6c1f5e['content'][_0xdc2b('0x2d')]();}else if(_[_0xdc2b('0x38')]([_0xdc2b('0x33'),_0xdc2b('0x34')],_0x6c1f5e[_0xdc2b('0x35')])&&_0x6c1f5e[_0xdc2b('0x39')]&&_0x6c1f5e['customField']){_0x450e2d['custom_fields'][_0xdc2b('0x3a')]({'id':_0x6c1f5e[_0xdc2b('0x39')],'value':_0x6c1f5e[_0xdc2b('0x3b')][_0xdc2b('0x2d')]()});}else if(_0x6c1f5e['type']===_0xdc2b('0x3c')&&_0x6c1f5e[_0xdc2b('0x3d')]&&_0x6c1f5e[_0xdc2b('0x39')]&&_0x6c1f5e['customField']){_0x364fc6[_0x6c1f5e[_0xdc2b('0x3d')]]&&_0x450e2d['custom_fields'][_0xdc2b('0x3a')]({'id':_0x6c1f5e['idField'],'value':_0x364fc6[_0x6c1f5e[_0xdc2b('0x3d')]][_0xdc2b('0x2d')]()});}else if(_0x6c1f5e[_0xdc2b('0x35')]===_0xdc2b('0x3e')&&_0x6c1f5e[_0xdc2b('0x3f')]&&_0x6c1f5e['Variable'][_0xdc2b('0x11')]&&_0x6c1f5e['idField']&&_0x6c1f5e[_0xdc2b('0x37')]){_0x364fc6[_0x6c1f5e[_0xdc2b('0x3f')]['name']['toLowerCase']()]&&_0x450e2d[_0xdc2b('0x40')][_0xdc2b('0x3a')]({'id':_0x6c1f5e['idField'],'value':_0x364fc6[_0x6c1f5e[_0xdc2b('0x3f')][_0xdc2b('0x11')][_0xdc2b('0x41')]()]['toString']()});}});}return _0x450e2d;}exports['queue']=function(_0x49243e,_0x27ed75,_0x285d82,_0x486bbf,_0x561d3c,_0x311811){var _0xfe70a2,_0x43c1a5;_0x311811[_0xdc2b('0xd')]=intUtil[_0xdc2b('0x42')](_0x311811[_0xdc2b('0xd')]);_0x311811['serverUrl']=intUtil[_0xdc2b('0x42')](_0x311811[_0xdc2b('0x43')]);if(_0x561d3c&&_0x561d3c[_0xdc2b('0x44')]){logger[_0xdc2b('0xb')](_0xdc2b('0x45'),_0xdc2b('0x46'));_0x27ed75[_0xdc2b('0x47')]=util[_0xdc2b('0x19')](_0xdc2b('0x48'),_0x311811[_0xdc2b('0x43')],_0x27ed75[_0xdc2b('0x49')],md5(_0x27ed75[_0xdc2b('0x49')]));}else{_0x27ed75[_0xdc2b('0x47')]='';}headers[_0xdc2b('0x4a')]=getAuth(_0x311811);return getUser(_0x311811,_0x486bbf[_0xdc2b('0x4b')])[_0xdc2b('0x16')](function(_0xc0fecd){_0xfe70a2=_0xc0fecd;logger[_0xdc2b('0xb')](_0xdc2b('0x4c'),_0xfe70a2['id']);return getEndUser(_0x311811,_0x27ed75[_0xdc2b('0x4d')],_0x27ed75['calleridnum']);})[_0xdc2b('0x16')](function(_0x2455d5){_0x43c1a5=_0x2455d5;logger[_0xdc2b('0xb')](_0xdc2b('0x4e'),_0x43c1a5['id']);return getTicket(_0x311811,_0xfe70a2,_0x43c1a5,_0x285d82,_0x27ed75);})[_0xdc2b('0x16')](function(_0xbb697e){if(_0xbb697e){logger[_0xdc2b('0xb')](_0xdc2b('0x4f'),_0xbb697e['id']);switch(_0x311811[_0xdc2b('0x35')]){case _0xdc2b('0x50'):logger[_0xdc2b('0xb')](_0xdc2b('0x45'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util['format']('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x311811['remoteUri'],_0xfe70a2['id'],_0xbb697e['id']),'method':_0xdc2b('0xe')});case'newTab':logger['info'](_0xdc2b('0x45'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xdc2b('0x51'),_0x486bbf[_0xdc2b('0x11')]),_0xdc2b('0x52'),{'uri':util[_0xdc2b('0x19')]('%s/agent/tickets/%s',_0x311811[_0xdc2b('0xd')][_0xdc2b('0x53')](_0xdc2b('0x54'),''),_0xbb697e['id'])});break;default:logger[_0xdc2b('0x55')]('[QUEUE]','Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xdc2b('0x56')](function(_0xae5354){logger[_0xdc2b('0x55')](_0xdc2b('0x57'),util['inspect'](_0xae5354,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x265687,_0x2dd579,_0x19f615,_0x4ab6a6,_0xdb384f,_0x2ba43a,_0x3f518d){var _0x4dc93b,_0x516c16;_0x2ba43a[_0xdc2b('0xd')]=intUtil[_0xdc2b('0x42')](_0x2ba43a[_0xdc2b('0xd')]);_0x2ba43a[_0xdc2b('0x43')]=intUtil[_0xdc2b('0x42')](_0x2ba43a['serverUrl']);if(_0x3f518d&&_0x3f518d[_0xdc2b('0x58')]&&_0x3f518d[_0xdc2b('0x58')]!==_0xdc2b('0x59')){logger[_0xdc2b('0xb')](_0xdc2b('0x5a'),'Recording\x20is\x20enabled!');_0x2dd579['recordingURL']=util[_0xdc2b('0x19')](_0xdc2b('0x48'),_0x2ba43a[_0xdc2b('0x43')],_0x2dd579[_0xdc2b('0x49')],md5(_0x2dd579[_0xdc2b('0x49')]));}headers['Authorization']=getAuth(_0x2ba43a);return getUser(_0x2ba43a,_0x4ab6a6[_0xdc2b('0x4b')])[_0xdc2b('0x16')](function(_0x5ca5a8){_0x4dc93b=_0x5ca5a8;logger[_0xdc2b('0xb')](_0xdc2b('0x4c'),_0x4dc93b['id']);return getEndUser(_0x2ba43a,_0x2dd579[_0xdc2b('0x5b')],_0x2dd579[_0xdc2b('0x5c')]);})[_0xdc2b('0x16')](function(_0xa5e32a){_0x516c16=_0xa5e32a;logger['info'](_0xdc2b('0x4e'),_0x516c16['id']);return getTicket(_0x2ba43a,_0x4dc93b,_0x516c16,_0x19f615,_0x2dd579);})['then'](function(_0xff5751){if(_0xff5751){logger[_0xdc2b('0xb')]('The\x20Ticket\x20ID\x20is:',_0xff5751['id']);switch(_0x2ba43a[_0xdc2b('0x35')]){case _0xdc2b('0x50'):logger['info'](_0xdc2b('0x5a'),_0xdc2b('0x5d'));return request({'uri':util[_0xdc2b('0x19')](_0xdc2b('0x5e'),_0x2ba43a[_0xdc2b('0xd')],_0x4dc93b['id'],_0xff5751['id']),'method':_0xdc2b('0xe')});case _0xdc2b('0x5f'):logger['info'](_0xdc2b('0x5a'),_0xdc2b('0x60'));emit(util['format']('user:%s',_0x4ab6a6[_0xdc2b('0x11')]),_0xdc2b('0x52'),{'uri':util[_0xdc2b('0x19')](_0xdc2b('0x61'),_0x2ba43a[_0xdc2b('0xd')][_0xdc2b('0x53')]('/api/v2',''),_0xff5751['id'])});break;default:logger[_0xdc2b('0x55')](_0xdc2b('0x5a'),_0xdc2b('0x62'));}}})['catch'](function(_0x48eaec){logger['error'](_0xdc2b('0x63'),util['inspect'](_0x48eaec,{'showHidden':!![],'depth':null}));});};exports[_0xdc2b('0x64')]=function(_0x4afab3,_0x2a971c,_0x292580,_0xa61f30,_0x534438,_0x32e6e4){var _0xcce517,_0x25a455;_0x32e6e4[_0xdc2b('0xd')]=intUtil[_0xdc2b('0x42')](_0x32e6e4['remoteUri']);_0x32e6e4[_0xdc2b('0x43')]=intUtil[_0xdc2b('0x42')](_0x32e6e4[_0xdc2b('0x43')]);if(_0x534438&&_0x534438[_0xdc2b('0x44')]){logger[_0xdc2b('0xb')]('['+_0x2a971c['lastevent'][_0xdc2b('0x65')]()+']',_0xdc2b('0x46'));_0x2a971c[_0xdc2b('0x47')]=util[_0xdc2b('0x19')](_0xdc2b('0x48'),_0x32e6e4['serverUrl'],_0x2a971c[_0xdc2b('0x49')],md5(_0x2a971c[_0xdc2b('0x49')]));}else{_0x2a971c[_0xdc2b('0x47')]='';}headers[_0xdc2b('0x4a')]=getAuth(_0x32e6e4);return getUser(_0x32e6e4)['then'](function(_0x372d02){_0xcce517=_0x372d02;logger['info'](_0xdc2b('0x4c'),_0xcce517['id']);return getEndUser(_0x32e6e4,_0x2a971c[_0xdc2b('0x4d')],_0x2a971c[_0xdc2b('0x66')]);})[_0xdc2b('0x16')](function(_0x102a54){_0x25a455=_0x102a54;logger[_0xdc2b('0xb')]('The\x20Enduser\x20ID\x20is:',_0x25a455['id']);return getTicket(_0x32e6e4,_0xcce517,_0x25a455,_0x292580,_0x2a971c);})['then'](function(_0xce191b){if(_0xce191b){logger[_0xdc2b('0xb')]('The\x20Ticket\x20ID\x20is:',_0xce191b['id']);}})[_0xdc2b('0x56')](function(_0x699829){logger[_0xdc2b('0x55')]('['+_0x2a971c[_0xdc2b('0x67')][_0xdc2b('0x65')]()+']'+_0xdc2b('0x68'),util[_0xdc2b('0x69')](_0x699829,{'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 0f1617a..e8fdb70 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 _0x5145=['recordingFormat','none','[OUTBOUND]','destcalleridnum','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','/crm/EntityInfo.do?module=Calls&id=','calleridnum','lastevent','toUpperCase','lodash','request-promise','md5','util','./util','moment','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','emit','debug','[HTTP]','string','picklist','idField','toString','variable','variableName','type','customVariable','Variable','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','clientId','refresh_token','then','add','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','name','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','error','The\x20failing\x20result\x20is','catch','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','Zoho-oauthtoken\x20','SUCCESS','details','Error:\x20','log','moduleSearch','uri','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','/crm/v2/Contacts/search?criteria=((Phone:equals:','lead','Creating\x20new\x20call...','Subject','getString','Subjects','Full_Name','First_Name','Last_Name','What_Id','$se_module','Call_Duration','utc','talktime','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','called','Call_Result','complete','connect','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','outbound','agentcalledAt','Inbound','merge','/crm/v2/Calls','code','err','host','serverUrl','stripTrailingSlash','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','The\x20Call\x20ID\x20is:','user:%s','trigger:browser:url','https://crm.'];(function(_0x49d9db,_0x41347b){var _0x5f049d=function(_0x2fb1ac){while(--_0x2fb1ac){_0x49d9db['push'](_0x49d9db['shift']());}};_0x5f049d(++_0x41347b);}(_0x5145,0x1bf));var _0x5514=function(_0x3d449d,_0x13beef){_0x3d449d=_0x3d449d-0x0;var _0x191130=_0x5145[_0x3d449d];return _0x191130;};'use strict';var _=require(_0x5514('0x0'));var rp=require(_0x5514('0x1'));var md5=require(_0x5514('0x2'));var util=require(_0x5514('0x3'));var intUtil=require(_0x5514('0x4'));var moment=require(_0x5514('0x5'));var Redis=require('ioredis');var BPromise=require(_0x5514('0x6'));var config=require(_0x5514('0x7'));var logger=require(_0x5514('0x8'))(_0x5514('0x9'));config[_0x5514('0xa')]=_[_0x5514('0xb')](config[_0x5514('0xa')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5514('0xa')]));function emit(_0x357f2b,_0x3dc3d7,_0x1ae0ec){io['to'](_0x357f2b)[_0x5514('0xc')](_0x3dc3d7,_0x1ae0ec);}function request(_0x2448ca){logger[_0x5514('0xd')](_0x5514('0xe'),JSON['stringify'](_0x2448ca));return rp(_0x2448ca);}function getCustomFields(_0x2c97f2,_0x462bca){var _0x59c929={};if(_0x2c97f2['length']>0x0){_['forEach'](_0x2c97f2,function(_0x83dfa4){if(_['includes']([_0x5514('0xf'),_0x5514('0x10')],_0x83dfa4['type'])&&_0x83dfa4[_0x5514('0x11')]){_0x59c929[_0x83dfa4[_0x5514('0x11')]]=_0x83dfa4['content'][_0x5514('0x12')]();}else if(_0x83dfa4['type']===_0x5514('0x13')&&_0x83dfa4['variableName']&&_0x83dfa4['idField']&&_0x462bca[_0x83dfa4[_0x5514('0x14')]]){_0x59c929[_0x83dfa4['idField']]=_0x462bca[_0x83dfa4[_0x5514('0x14')]][_0x5514('0x12')]();}else if(_0x83dfa4[_0x5514('0x15')]===_0x5514('0x16')&&_0x83dfa4['Variable']&&_0x83dfa4[_0x5514('0x17')]['name']&&_0x83dfa4['idField']&&_0x462bca[_0x83dfa4[_0x5514('0x17')]['name'][_0x5514('0x18')]()]){_0x59c929[_0x83dfa4[_0x5514('0x11')]]=_0x462bca[_0x83dfa4[_0x5514('0x17')]['name']['toLowerCase']()][_0x5514('0x12')]();}});}return _0x59c929;}function getName(_0x3f7eaa){if(_0x3f7eaa[_0x5514('0x19')]('\x20')>0x0){var _0x4f5147=_0x3f7eaa[_0x5514('0x1a')](/ (.+)/);if(_0x4f5147[0x1]){return _0x4f5147;}}return[_0x3f7eaa,_0x3f7eaa];}var accountsTokens={};function getAccessToken(_0xb58224){return new Promise(function(_0x10d1c9,_0x14c334){if(!_[_0x5514('0x1b')](accountsTokens[_0xb58224['id']])&&!_[_0x5514('0x1b')](accountsTokens[_0xb58224['id']][_0x5514('0x1c')])){if(moment()[_0x5514('0x1d')](accountsTokens[_0xb58224['id']][_0x5514('0x1e')])){_0x10d1c9(accountsTokens[_0xb58224['id']][_0x5514('0x1c')]);}}var _0x5cfc05;switch(_0xb58224[_0x5514('0x1f')]){case'US':_0x5cfc05=_0x5514('0x20');break;case'AU':_0x5cfc05=_0x5514('0x21');break;case'EU':_0x5cfc05='https://accounts.zoho.eu';break;case'IN':_0x5cfc05=_0x5514('0x22');break;case'CN':_0x5cfc05='https://accounts.zoho.com.cn';break;default:_0x5cfc05=_0x5514('0x23');break;}var _0xd23515={'method':_0x5514('0x24'),'uri':_0x5cfc05+_0x5514('0x25'),'qs':{'refresh_token':_0xb58224['refreshToken'],'client_id':_0xb58224[_0x5514('0x26')],'client_secret':_0xb58224['clientSecret'],'grant_type':_0x5514('0x27')},'json':!![]};return rp(_0xd23515)[_0x5514('0x28')](function(_0x129a7e){accountsTokens[_0xb58224['id']]={'access_token':_0x129a7e[_0x5514('0x1c')],'expires_in':moment()[_0x5514('0x29')](_0x129a7e[_0x5514('0x1e')],'seconds')};_0x10d1c9(_0x129a7e[_0x5514('0x1c')]);})['catch'](function(_0x564af8){logger['error'](_0x5514('0x2a'),_0x564af8[_0x5514('0x2b')]);_0x14c334(_0x564af8);});});}function getUser(_0x1318d7,_0x30ea86,_0x12ce99,_0x4df769){logger[_0x5514('0x2c')](_0x5514('0x2d'));return request({'method':_0x5514('0x2e'),'uri':util[_0x5514('0x2f')](_0x5514('0x30'),_0x30ea86),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x1318d7},'json':!![]})[_0x5514('0x28')](function(_0x172f64){if(_0x172f64[_0x5514('0x31')]){var _0x1218ec=-0x1;if(_[_0x5514('0x32')](_0x172f64['users'])){if(!_['isNil'](_0x4df769)){_0x1218ec=_[_0x5514('0x33')](_0x172f64[_0x5514('0x31')],function(_0x5e5915){return _0x5e5915[_0x5514('0x34')]===_0x4df769;});}if(_0x1218ec>=0x0){logger[_0x5514('0x2c')](_0x5514('0x35'));}else{logger[_0x5514('0x2c')](_0x5514('0x36'));_0x1218ec=_[_0x5514('0x33')](_0x172f64['users'],function(_0x2eac8f){return _0x2eac8f[_0x5514('0x37')]['name']===_0x5514('0x38');});}return _0x172f64['users'][_0x1218ec];}else{if(_0x172f64[_0x5514('0x39')][_0x5514('0x37')][_0x5514('0x3a')]==='Administrator'){logger[_0x5514('0x2c')]('Using\x20the\x20admin\x20account!');user=_0x172f64[_0x5514('0x39')];return user;}else{logger['error']('The\x20failing\x20result\x20is',JSON[_0x5514('0x3b')](_0x172f64));throw new Error(_0x5514('0x3c')+JSON[_0x5514('0x3b')](_0x172f64));}}}else{logger[_0x5514('0x3d')](_0x5514('0x3e'),JSON['stringify'](_0x172f64));throw new Error(_0x5514('0x3c')+JSON[_0x5514('0x3b')](_0x172f64));}})[_0x5514('0x3f')](function(_0x7e18de){console[_0x5514('0x3d')](_0x7e18de);});}function getZohoUser(_0x11465b,_0x1a74be){return new BPromise(function(_0x55077b,_0x516b72){request(_0x11465b)['then'](function(_0x3db954){var _0x5f25ec=null;if(_0x3db954){_0x5f25ec=_0x3db954[_0x5514('0x40')][0x0];_0x5f25ec[_0x5514('0x41')]=_0x1a74be;}_0x55077b(_0x5f25ec);})[_0x5514('0x3f')](function(_0x81d9f){_0x516b72(_0x81d9f);});});}function createEndUser(_0x177791,_0x4be071,_0x3681e1,_0x5a0dd1,_0x15ee82,_0x59c2f1){var _0x3681e1=getName(_0x3681e1);return request({'method':_0x5514('0x24'),'uri':_0x5514('0x42')+_0x4be071+_0x5514('0x43')+_[_0x5514('0x44')](_0x59c2f1[_0x5514('0x45')])+'s','body':{'data':[{'Last_Name':_0x3681e1[0x1],'First_Name':_0x3681e1[0x0],'Phone':_0x5a0dd1,'Owner':{'name':!_[_0x5514('0x1b')](_0x15ee82['role'][_0x5514('0x3a')])?_0x15ee82[_0x5514('0x46')]['name']:!_[_0x5514('0x1b')](_0x15ee82['first_name'])?_0x15ee82[_0x5514('0x47')]+'\x20'+_0x15ee82['last_name']:_0x15ee82[_0x5514('0x48')],'id':_0x15ee82['id']}}]},'headers':{'Authorization':_0x5514('0x49')+_0x177791},'json':!![]})[_0x5514('0x28')](function(_0x29811b){if(_0x29811b&&_0x29811b['data'][0x0]['code']===_0x5514('0x4a')){var _0x5bf601=_0x29811b[_0x5514('0x40')][0x0][_0x5514('0x4b')];_0x5bf601['enduserType']=_[_0x5514('0x44')](_0x59c2f1[_0x5514('0x45')])+'s';return _0x5bf601;}logger[_0x5514('0x3d')](_0x5514('0x3e'),JSON[_0x5514('0x3b')](data));throw new Error(_0x5514('0x4c')+JSON[_0x5514('0x3b')](data));})['catch'](function(_0x5d2bf3){console[_0x5514('0x4d')]('CREATE\x20ERROR',_0x5d2bf3);});}function getEndUser(_0x3c741c,_0x216592,_0x1f7488,_0xac7408,_0x12cfec,_0x510d72,_0x16fa56){var _0x376cfa={'method':'GET','uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x3c741c},'json':!![]};switch(_0x16fa56[_0x5514('0x4e')]){case'contact_lead':_0x376cfa[_0x5514('0x4f')]=_0x5514('0x42')+_0x216592+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x12cfec+'))';return getZohoUser(_0x376cfa,_0x5514('0x50'))[_0x5514('0x28')](function(_0x2edd70){if(_0x2edd70)return _0x2edd70;_0x376cfa[_0x5514('0x4f')]=_0x5514('0x42')+_0x216592+_0x5514('0x51')+_0x12cfec+'))';return getZohoUser(_0x376cfa,_0x5514('0x52'))['then'](function(_0x5086c3){if(_0x5086c3)return _0x5086c3;if(_0x16fa56[_0x5514('0x45')]!=_0x5514('0x53')){return createEndUser(_0x3c741c,_0x216592,_0xac7408,_0x12cfec,_0x510d72,_0x16fa56);}else{return{};}});});break;case'contact':_0x376cfa[_0x5514('0x4f')]=_0x5514('0x42')+_0x216592+_0x5514('0x54')+_0x12cfec+'))';return getZohoUser(_0x376cfa,'Contacts')['then'](function(_0x110f1c){if(_0x110f1c)return _0x110f1c;if(_0x16fa56[_0x5514('0x45')]!=_0x5514('0x53')){return createEndUser(_0x3c741c,_0x216592,_0xac7408,_0x12cfec,_0x510d72,_0x16fa56);}else{return{};}});break;case _0x5514('0x55'):_0x376cfa['uri']=_0x5514('0x42')+_0x216592+_0x5514('0x51')+_0x12cfec+'))';return getZohoUser(_0x376cfa,_0x5514('0x52'))[_0x5514('0x28')](function(_0x571578){if(_0x571578)return _0x571578;if(_0x16fa56[_0x5514('0x45')]!=_0x5514('0x53')){return createEndUser(_0x3c741c,_0x216592,_0xac7408,_0x12cfec,_0x510d72,_0x16fa56);}else{return{};}});break;}}function getCall(_0x52758e,_0x4fdc4f,_0x53c908,_0x719f7b,_0x2b1872,_0x31853c,_0x572f37,_0x46e368){logger[_0x5514('0x2c')](_0x5514('0x56'));var _0x59dd8f={};_0x59dd8f['Owner']={'name':!_['isNil'](_0x719f7b[_0x5514('0x46')][_0x5514('0x3a')])&&!_[_0x5514('0x1b')](_0x719f7b[_0x5514('0x37')][_0x5514('0x3a')])&&_0x719f7b[_0x5514('0x37')][_0x5514('0x3a')]==='administrator'?_0x719f7b[_0x5514('0x46')]['name']:!_[_0x5514('0x1b')](_0x719f7b[_0x5514('0x47')])?_0x719f7b['first_name']+'\x20'+_0x719f7b[_0x5514('0x48')]:_0x719f7b[_0x5514('0x48')],'id':_0x719f7b['id']};_0x59dd8f[_0x5514('0x57')]=intUtil[_0x5514('0x58')](_0x31853c[_0x5514('0x59')],_0x572f37,'\x20');_0x59dd8f['Description']=intUtil[_0x5514('0x58')](_0x31853c['Descriptions'],_0x572f37,'\x0a');if(_0x2b1872[_0x5514('0x41')]===_0x5514('0x50')){_0x59dd8f['Who_Id']={'name':!_['isNil'](_0x2b1872[_0x5514('0x5a')])?_0x2b1872[_0x5514('0x5a')]:!_['isNil'](_0x2b1872[_0x5514('0x5b')])?_0x2b1872[_0x5514('0x5b')]+'\x20'+_0x2b1872[_0x5514('0x5c')]:_0x2b1872[_0x5514('0x5c')],'id':_0x2b1872['id']};}if(_0x2b1872[_0x5514('0x41')]===_0x5514('0x52')){_0x59dd8f[_0x5514('0x5d')]={'name':!_[_0x5514('0x1b')](_0x2b1872[_0x5514('0x5a')])?_0x2b1872[_0x5514('0x5a')]:!_[_0x5514('0x1b')](_0x2b1872[_0x5514('0x5b')])?_0x2b1872['First_Name']+'\x20'+_0x2b1872['Last_Name']:_0x2b1872[_0x5514('0x5c')],'id':_0x2b1872['id']};_0x59dd8f[_0x5514('0x5e')]=_[_0x5514('0x44')](_0x2b1872[_0x5514('0x41')]);}if(_0x572f37['talktime']){_0x59dd8f[_0x5514('0x5f')]=moment[_0x5514('0x60')](parseInt(_0x572f37[_0x5514('0x61')])*0x3e8)[_0x5514('0x2f')](_0x5514('0x62'));}else if(_0x572f37[_0x5514('0x63')]&&_0x572f37[_0x5514('0x64')]){_0x59dd8f[_0x5514('0x5f')]=moment['utc'](moment(_0x572f37[_0x5514('0x64')],_0x5514('0x65'))[_0x5514('0x66')](moment(_0x572f37['starttime'],_0x5514('0x65'))))['format'](_0x5514('0x62'));}switch(_0x572f37['lastevent']){case _0x5514('0x67'):_0x59dd8f[_0x5514('0x68')]='Called';break;case _0x5514('0x69'):case _0x5514('0x6a'):_0x59dd8f[_0x5514('0x68')]=_0x5514('0x6b');break;case _0x5514('0x6c'):_0x59dd8f['Call_Result']=_0x5514('0x6d');break;case _0x5514('0x6e'):_0x59dd8f['Call_Result']=_0x5514('0x6f');break;case _0x5514('0x70'):_0x59dd8f[_0x5514('0x68')]=_0x5514('0x71');default:}_0x59dd8f['Call_Start_Time']=(_0x46e368===_0x5514('0x72')?moment(_0x572f37['starttime'])[_0x5514('0x2f')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x572f37[_0x5514('0x73')])['format']('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x5514('0x2f')](_0x5514('0x65'));_0x59dd8f['Call_Type']=_0x46e368||_0x5514('0x74');_0x59dd8f=_[_0x5514('0x75')](_0x59dd8f,getCustomFields(_0x31853c['Fields'],_0x572f37));return request({'method':_0x5514('0x24'),'uri':_0x5514('0x42')+_0x4fdc4f+_0x5514('0x76'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x52758e},'body':{'data':[_0x59dd8f]},'json':!![]})['then'](function(_0x485dd4){if(_0x485dd4&&_0x485dd4[_0x5514('0x40')][0x0][_0x5514('0x77')]===_0x5514('0x4a')){logger[_0x5514('0x2c')]('Call\x20created!');return{'id':_0x485dd4[_0x5514('0x40')][0x0]['details']['id']};}})[_0x5514('0x3f')](function(_0x1310b6){logger[_0x5514('0x2c')](_0x5514('0x78'),_0x1310b6[_0x5514('0x2b')]);console[_0x5514('0x4d')](_0x5514('0x78'),_0x1310b6);});}exports['queue']=function(_0x406d10,_0x58487f,_0xa7b2a2,_0x13ba52,_0x17c381,_0x119b70){var _0x2324dc,_0x38c521,_0x526f39;_0x119b70[_0x5514('0x79')]=intUtil['stripTrailingSlash'](_0x119b70[_0x5514('0x79')]);_0x119b70[_0x5514('0x7a')]=intUtil[_0x5514('0x7b')](_0x119b70['serverUrl']);if(_0x17c381&&_0x17c381['monitor_format']){logger['info']('[QUEUE]',_0x5514('0x7c'));_0x58487f[_0x5514('0x7d')]=_0x119b70[_0x5514('0x7a')]+_0x5514('0x7e')+_0x58487f[_0x5514('0x7f')]+_0x5514('0x80')+md5(_0x58487f[_0x5514('0x7f')]);}else{_0x58487f[_0x5514('0x7d')]='';}var _0x1fda87=_0x119b70[_0x5514('0x79')]===_0x5514('0x81')?'eu':_0x5514('0x82');return getAccessToken(_0x119b70)[_0x5514('0x28')](function(_0x15ed08){_0x526f39=_0x15ed08;return getUser(_0x526f39,_0x1fda87,_0x119b70,_0x13ba52['email']);})[_0x5514('0x28')](function(_0x228eac){_0x2324dc=_0x228eac;logger[_0x5514('0x2c')](_0x5514('0x83'),_0x2324dc['id']);return getEndUser(_0x526f39,_0x1fda87,_0x119b70,_0x58487f[_0x5514('0x84')],_0x58487f['calleridnum'],_0x2324dc,_0xa7b2a2);})['then'](function(_0x2973ba){_0x38c521=_0x2973ba;return getCall(_0x526f39,_0x1fda87,_0x119b70,_0x2324dc,_0x38c521,_0xa7b2a2,_0x58487f,_0x5514('0x74'));})[_0x5514('0x28')](function(_0x485f5d){if(_0x485f5d){logger['info'](_0x5514('0x85'),_0x485f5d['id']);logger['info']('[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x5514('0x86'),_0x13ba52[_0x5514('0x3a')]),_0x5514('0x87'),{'uri':_0x5514('0x88')+_0x119b70['host']+'/crm/EntityInfo.do?module=Calls&id='+_0x485f5d['id']});}})[_0x5514('0x3f')](function(_0x490e25){logger[_0x5514('0x3d')]('[QUEUE]',JSON[_0x5514('0x3b')](_0x490e25));});};exports['outbound']=function(_0x6b4ca8,_0x29e9d9,_0x3a5764,_0x3c9186,_0x5aff91,_0x18e9e0,_0x1edace){var _0x2d43db,_0x3c7021,_0x374aa0;_0x18e9e0['host']=intUtil['stripTrailingSlash'](_0x18e9e0[_0x5514('0x79')]);_0x18e9e0['serverUrl']=intUtil[_0x5514('0x7b')](_0x18e9e0[_0x5514('0x7a')]);if(_0x1edace&&_0x1edace['recordingFormat']&&_0x1edace[_0x5514('0x89')]!==_0x5514('0x8a')){logger[_0x5514('0x2c')](_0x5514('0x8b'),_0x5514('0x7c'));_0x29e9d9[_0x5514('0x7d')]=_0x18e9e0[_0x5514('0x7a')]+_0x5514('0x7e')+_0x29e9d9[_0x5514('0x7f')]+_0x5514('0x80')+md5(_0x29e9d9[_0x5514('0x7f')]);}var _0xd438da=_0x18e9e0[_0x5514('0x79')]==='zoho.eu'?'eu':_0x5514('0x82');return getAccessToken(_0x18e9e0)[_0x5514('0x28')](function(_0x275265){_0x374aa0=_0x275265;return getUser(_0x374aa0,_0xd438da,_0x18e9e0,_0x3c9186[_0x5514('0x34')]);})['then'](function(_0x47eb17){_0x2d43db=_0x47eb17;logger['info'](_0x5514('0x83'),_0x2d43db['id']);return getEndUser(_0x374aa0,_0xd438da,_0x18e9e0,_0x29e9d9['destcalleridname'],_0x29e9d9[_0x5514('0x8c')],_0x2d43db,_0x3a5764);})['then'](function(_0x276a4){_0x3c7021=_0x276a4;return getCall(_0x374aa0,_0xd438da,_0x18e9e0,_0x2d43db,_0x3c7021,_0x3a5764,_0x29e9d9,'Outbound');})['then'](function(_0x5e04f9){if(_0x5e04f9){logger[_0x5514('0x2c')](_0x5514('0x85'),_0x5e04f9['id']);logger['info'](_0x5514('0x8b'),_0x5514('0x8d'));emit(util[_0x5514('0x2f')](_0x5514('0x86'),_0x3c9186['name']),_0x5514('0x87'),{'uri':_0x5514('0x88')+_0x18e9e0[_0x5514('0x79')]+_0x5514('0x8e')+_0x5e04f9['id']});}})[_0x5514('0x3f')](function(_0x1f5f64){logger['error'](_0x5514('0x8b'),JSON[_0x5514('0x3b')](_0x1f5f64));});};exports['unmanaged']=function(_0x1c9c62,_0x193d9c,_0x589dea,_0x194def,_0x459d57,_0x392d2a){var _0x4e7ab2,_0x4da936,_0x24c2cf;_0x392d2a[_0x5514('0x79')]=intUtil[_0x5514('0x7b')](_0x392d2a[_0x5514('0x79')]);_0x392d2a[_0x5514('0x7a')]=intUtil[_0x5514('0x7b')](_0x392d2a['serverUrl']);if(_0x459d57&&_0x459d57['monitor_format']){logger[_0x5514('0x2c')]('['+_0x193d9c['lastevent']['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x193d9c[_0x5514('0x7d')]=_0x392d2a['serverUrl']+'/api/voice/recordings/'+_0x193d9c['uniqueid']+_0x5514('0x80')+md5(_0x193d9c[_0x5514('0x7f')]);}else{_0x193d9c[_0x5514('0x7d')]='';}var _0x11849e=_0x392d2a['host']==='zoho.eu'?'eu':_0x5514('0x82');return getAccessToken(_0x392d2a)['then'](function(_0x500078){_0x24c2cf=_0x500078;return getUser(_0x24c2cf,_0x11849e,_0x392d2a);})[_0x5514('0x28')](function(_0x36af54){_0x4e7ab2=_0x36af54;logger[_0x5514('0x2c')]('The\x20User\x20ID\x20is:',_0x4e7ab2['id']);return getEndUser(_0x24c2cf,_0x11849e,_0x392d2a,_0x193d9c[_0x5514('0x84')],_0x193d9c[_0x5514('0x8f')],_0x4e7ab2,_0x589dea);})[_0x5514('0x28')](function(_0x315150){_0x4da936=_0x315150;return getCall(_0x24c2cf,_0x11849e,_0x392d2a,_0x4e7ab2,_0x4da936,_0x589dea,_0x193d9c,'Inbound');})[_0x5514('0x28')](function(_0x4b8bdf){if(_0x4b8bdf){logger[_0x5514('0x2c')](_0x5514('0x85'),_0x4b8bdf['id']);}})[_0x5514('0x3f')](function(_0x424c2f){logger['error']('['+_0x193d9c[_0x5514('0x90')][_0x5514('0x91')]()+']',JSON[_0x5514('0x3b')](_0x424c2f));});}; \ No newline at end of file +var _0xede9=['timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','merge','Fields','Call\x20created!','details','err','log','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','Outbound','The\x20Call\x20ID\x20is:','[OUTBOUND]','toUpperCase','lodash','request-promise','md5','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','includes','picklist','type','idField','content','toString','variableName','customVariable','Variable','name','toLowerCase','indexOf','isNil','access_token','expires_in','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','catch','error','Failing\x20creating\x20the\x20access_token','Search\x20user','format','Zoho-oauthtoken\x20','users','findIndex','info','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','Error:\x20','CREATE\x20ERROR','moduleSearch','uri','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','lead','Creating\x20new\x20call...','Subject','getString','Subjects','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','Call_Duration','utc','talktime','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','Call_Result','Called','complete','Answered','rejected','abandoned','Abandoned'];(function(_0x514465,_0x564fe5){var _0x3c4592=function(_0xa60bfb){while(--_0xa60bfb){_0x514465['push'](_0x514465['shift']());}};_0x3c4592(++_0x564fe5);}(_0xede9,0x1d6));var _0x9ede=function(_0x24a9d4,_0x403c75){_0x24a9d4=_0x24a9d4-0x0;var _0x4157ec=_0xede9[_0x24a9d4];return _0x4157ec;};'use strict';var _=require(_0x9ede('0x0'));var rp=require(_0x9ede('0x1'));var md5=require(_0x9ede('0x2'));var util=require('util');var intUtil=require(_0x9ede('0x3'));var moment=require(_0x9ede('0x4'));var Redis=require(_0x9ede('0x5'));var BPromise=require(_0x9ede('0x6'));var config=require(_0x9ede('0x7'));var logger=require(_0x9ede('0x8'))(_0x9ede('0x9'));config[_0x9ede('0xa')]=_[_0x9ede('0xb')](config['redis'],{'host':_0x9ede('0xc'),'port':0x18eb});var io=require(_0x9ede('0xd'))(new Redis(config[_0x9ede('0xa')]));function emit(_0x22285e,_0x166dc0,_0x2b0f72){io['to'](_0x22285e)[_0x9ede('0xe')](_0x166dc0,_0x2b0f72);}function request(_0x5da949){logger[_0x9ede('0xf')](_0x9ede('0x10'),JSON[_0x9ede('0x11')](_0x5da949));return rp(_0x5da949);}function getCustomFields(_0x5717e5,_0x58e4c1){var _0x5a3db3={};if(_0x5717e5[_0x9ede('0x12')]>0x0){_['forEach'](_0x5717e5,function(_0x5c9a6f){if(_[_0x9ede('0x13')](['string',_0x9ede('0x14')],_0x5c9a6f[_0x9ede('0x15')])&&_0x5c9a6f[_0x9ede('0x16')]){_0x5a3db3[_0x5c9a6f[_0x9ede('0x16')]]=_0x5c9a6f[_0x9ede('0x17')][_0x9ede('0x18')]();}else if(_0x5c9a6f[_0x9ede('0x15')]==='variable'&&_0x5c9a6f[_0x9ede('0x19')]&&_0x5c9a6f[_0x9ede('0x16')]&&_0x58e4c1[_0x5c9a6f['variableName']]){_0x5a3db3[_0x5c9a6f[_0x9ede('0x16')]]=_0x58e4c1[_0x5c9a6f[_0x9ede('0x19')]][_0x9ede('0x18')]();}else if(_0x5c9a6f['type']===_0x9ede('0x1a')&&_0x5c9a6f[_0x9ede('0x1b')]&&_0x5c9a6f[_0x9ede('0x1b')]['name']&&_0x5c9a6f['idField']&&_0x58e4c1[_0x5c9a6f[_0x9ede('0x1b')][_0x9ede('0x1c')][_0x9ede('0x1d')]()]){_0x5a3db3[_0x5c9a6f[_0x9ede('0x16')]]=_0x58e4c1[_0x5c9a6f[_0x9ede('0x1b')][_0x9ede('0x1c')][_0x9ede('0x1d')]()][_0x9ede('0x18')]();}});}return _0x5a3db3;}function getName(_0x14955f){if(_0x14955f[_0x9ede('0x1e')]('\x20')>0x0){var _0x17a273=_0x14955f['split'](/ (.+)/);if(_0x17a273[0x1]){return _0x17a273;}}return[_0x14955f,_0x14955f];}var accountsTokens={};function getAccessToken(_0x2a16de){return new Promise(function(_0x285738,_0x570a05){if(!_[_0x9ede('0x1f')](accountsTokens[_0x2a16de['id']])&&!_[_0x9ede('0x1f')](accountsTokens[_0x2a16de['id']][_0x9ede('0x20')])){if(moment()['isBefore'](accountsTokens[_0x2a16de['id']][_0x9ede('0x21')])){_0x285738(accountsTokens[_0x2a16de['id']]['access_token']);}}var _0x294f18;switch(_0x2a16de['zone']){case'US':_0x294f18=_0x9ede('0x22');break;case'AU':_0x294f18='https://accounts.zoho.com.au';break;case'EU':_0x294f18=_0x9ede('0x23');break;case'IN':_0x294f18='https://accounts.zoho.in';break;case'CN':_0x294f18=_0x9ede('0x24');break;default:_0x294f18=_0x9ede('0x23');break;}var _0xa5b2eb={'method':_0x9ede('0x25'),'uri':_0x294f18+_0x9ede('0x26'),'qs':{'refresh_token':_0x2a16de[_0x9ede('0x27')],'client_id':_0x2a16de[_0x9ede('0x28')],'client_secret':_0x2a16de[_0x9ede('0x29')],'grant_type':_0x9ede('0x2a')},'json':!![]};return rp(_0xa5b2eb)[_0x9ede('0x2b')](function(_0x37e5e6){accountsTokens[_0x2a16de['id']]={'access_token':_0x37e5e6[_0x9ede('0x20')],'expires_in':moment()['add'](_0x37e5e6['expires_in'],'seconds')};_0x285738(_0x37e5e6[_0x9ede('0x20')]);})[_0x9ede('0x2c')](function(_0x4c3bcd){logger[_0x9ede('0x2d')](_0x9ede('0x2e'),_0x4c3bcd['stack']);_0x570a05(_0x4c3bcd);});});}function getUser(_0x50a9c6,_0x57aa8b,_0x2b5c34,_0x29273c){logger['info'](_0x9ede('0x2f'));return request({'method':'GET','uri':util[_0x9ede('0x30')]('https://www.zohoapis.%s/crm/v2/users',_0x57aa8b),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0x9ede('0x31')+_0x50a9c6},'json':!![]})[_0x9ede('0x2b')](function(_0x467a93){if(_0x467a93['users']){var _0x4ce2bf=-0x1;if(_['isArrayLikeObject'](_0x467a93[_0x9ede('0x32')])){if(!_['isNil'](_0x29273c)){_0x4ce2bf=_[_0x9ede('0x33')](_0x467a93['users'],function(_0x1e9f78){return _0x1e9f78['email']===_0x29273c;});}if(_0x4ce2bf>=0x0){logger['info']('Agent\x20found!');}else{logger[_0x9ede('0x34')](_0x9ede('0x35'));_0x4ce2bf=_[_0x9ede('0x33')](_0x467a93[_0x9ede('0x32')],function(_0x199067){return _0x199067[_0x9ede('0x36')]['name']===_0x9ede('0x37');});}return _0x467a93[_0x9ede('0x32')][_0x4ce2bf];}else{if(_0x467a93[_0x9ede('0x38')][_0x9ede('0x36')][_0x9ede('0x1c')]===_0x9ede('0x37')){logger['info'](_0x9ede('0x35'));user=_0x467a93[_0x9ede('0x38')];return user;}else{logger[_0x9ede('0x2d')](_0x9ede('0x39'),JSON[_0x9ede('0x11')](_0x467a93));throw new Error(_0x9ede('0x3a')+JSON['stringify'](_0x467a93));}}}else{logger[_0x9ede('0x2d')](_0x9ede('0x39'),JSON[_0x9ede('0x11')](_0x467a93));throw new Error(_0x9ede('0x3a')+JSON['stringify'](_0x467a93));}})['catch'](function(_0x3e9ca7){console[_0x9ede('0x2d')](_0x3e9ca7);});}function getZohoUser(_0x3d2fa5,_0x4693dd){return new BPromise(function(_0x4828d4,_0x5087e4){request(_0x3d2fa5)[_0x9ede('0x2b')](function(_0x1bde04){var _0x15c8cf=null;if(_0x1bde04){_0x15c8cf=_0x1bde04[_0x9ede('0x3b')][0x0];_0x15c8cf[_0x9ede('0x3c')]=_0x4693dd;}_0x4828d4(_0x15c8cf);})[_0x9ede('0x2c')](function(_0x4d2311){_0x5087e4(_0x4d2311);});});}function createEndUser(_0x110161,_0x4923f7,_0x156622,_0x5c2e37,_0x4f877c,_0x14baa1){var _0x156622=getName(_0x156622);return request({'method':'POST','uri':'https://www.zohoapis.'+_0x4923f7+_0x9ede('0x3d')+_[_0x9ede('0x3e')](_0x14baa1[_0x9ede('0x3f')])+'s','body':{'data':[{'Last_Name':_0x156622[0x1],'First_Name':_0x156622[0x0],'Phone':_0x5c2e37,'Owner':{'name':!_[_0x9ede('0x1f')](_0x4f877c['role'][_0x9ede('0x1c')])?_0x4f877c[_0x9ede('0x40')][_0x9ede('0x1c')]:!_[_0x9ede('0x1f')](_0x4f877c[_0x9ede('0x41')])?_0x4f877c[_0x9ede('0x41')]+'\x20'+_0x4f877c['last_name']:_0x4f877c[_0x9ede('0x42')],'id':_0x4f877c['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x110161},'json':!![]})['then'](function(_0x2c32f8){if(_0x2c32f8&&_0x2c32f8['data'][0x0][_0x9ede('0x43')]==='SUCCESS'){var _0x412d2c=_0x2c32f8['data'][0x0]['details'];_0x412d2c['enduserType']=_[_0x9ede('0x3e')](_0x14baa1[_0x9ede('0x3f')])+'s';return _0x412d2c;}logger['error'](_0x9ede('0x39'),JSON[_0x9ede('0x11')](data));throw new Error(_0x9ede('0x44')+JSON[_0x9ede('0x11')](data));})[_0x9ede('0x2c')](function(_0x38867e){console['log'](_0x9ede('0x45'),_0x38867e);});}function getEndUser(_0x2b8917,_0x4bed3d,_0x24d627,_0x2bb9f5,_0x232ea5,_0x502228,_0x5b8b60){var _0x57ce01={'method':'GET','uri':'','headers':{'Authorization':_0x9ede('0x31')+_0x2b8917},'json':!![]};switch(_0x5b8b60[_0x9ede('0x46')]){case'contact_lead':_0x57ce01[_0x9ede('0x47')]=_0x9ede('0x48')+_0x4bed3d+_0x9ede('0x49')+_0x232ea5+'))';return getZohoUser(_0x57ce01,_0x9ede('0x4a'))[_0x9ede('0x2b')](function(_0x366bce){if(_0x366bce)return _0x366bce;_0x57ce01[_0x9ede('0x47')]=_0x9ede('0x48')+_0x4bed3d+_0x9ede('0x4b')+_0x232ea5+'))';return getZohoUser(_0x57ce01,_0x9ede('0x4c'))[_0x9ede('0x2b')](function(_0x2c3772){if(_0x2c3772)return _0x2c3772;if(_0x5b8b60[_0x9ede('0x3f')]!=_0x9ede('0x4d')){return createEndUser(_0x2b8917,_0x4bed3d,_0x2bb9f5,_0x232ea5,_0x502228,_0x5b8b60);}else{return{};}});});break;case _0x9ede('0x4e'):_0x57ce01[_0x9ede('0x47')]=_0x9ede('0x48')+_0x4bed3d+_0x9ede('0x49')+_0x232ea5+'))';return getZohoUser(_0x57ce01,_0x9ede('0x4a'))[_0x9ede('0x2b')](function(_0x1a01b0){if(_0x1a01b0)return _0x1a01b0;if(_0x5b8b60['moduleCreate']!='nothing'){return createEndUser(_0x2b8917,_0x4bed3d,_0x2bb9f5,_0x232ea5,_0x502228,_0x5b8b60);}else{return{};}});break;case _0x9ede('0x4f'):_0x57ce01[_0x9ede('0x47')]=_0x9ede('0x48')+_0x4bed3d+_0x9ede('0x4b')+_0x232ea5+'))';return getZohoUser(_0x57ce01,'Leads')[_0x9ede('0x2b')](function(_0x23cf5b){if(_0x23cf5b)return _0x23cf5b;if(_0x5b8b60[_0x9ede('0x3f')]!=_0x9ede('0x4d')){return createEndUser(_0x2b8917,_0x4bed3d,_0x2bb9f5,_0x232ea5,_0x502228,_0x5b8b60);}else{return{};}});break;}}function getCall(_0x436d31,_0x550e19,_0x28b210,_0x49b18f,_0xa875cc,_0x170a36,_0x3abfdb,_0x513cde){logger[_0x9ede('0x34')](_0x9ede('0x50'));var _0x1f7837={};_0x1f7837['Owner']={'name':!_[_0x9ede('0x1f')](_0x49b18f[_0x9ede('0x40')][_0x9ede('0x1c')])&&!_[_0x9ede('0x1f')](_0x49b18f[_0x9ede('0x36')][_0x9ede('0x1c')])&&_0x49b18f[_0x9ede('0x36')][_0x9ede('0x1c')]==='administrator'?_0x49b18f[_0x9ede('0x40')][_0x9ede('0x1c')]:!_[_0x9ede('0x1f')](_0x49b18f[_0x9ede('0x41')])?_0x49b18f[_0x9ede('0x41')]+'\x20'+_0x49b18f[_0x9ede('0x42')]:_0x49b18f[_0x9ede('0x42')],'id':_0x49b18f['id']};_0x1f7837[_0x9ede('0x51')]=intUtil[_0x9ede('0x52')](_0x170a36[_0x9ede('0x53')],_0x3abfdb,'\x20');_0x1f7837['Description']=intUtil[_0x9ede('0x52')](_0x170a36[_0x9ede('0x54')],_0x3abfdb,'\x0a');if(_0xa875cc[_0x9ede('0x3c')]===_0x9ede('0x4a')){_0x1f7837[_0x9ede('0x55')]={'name':!_[_0x9ede('0x1f')](_0xa875cc['Full_Name'])?_0xa875cc[_0x9ede('0x56')]:!_['isNil'](_0xa875cc[_0x9ede('0x57')])?_0xa875cc['First_Name']+'\x20'+_0xa875cc[_0x9ede('0x58')]:_0xa875cc['Last_Name'],'id':_0xa875cc['id']};}if(_0xa875cc['enduserType']===_0x9ede('0x4c')){_0x1f7837['What_Id']={'name':!_['isNil'](_0xa875cc[_0x9ede('0x56')])?_0xa875cc[_0x9ede('0x56')]:!_['isNil'](_0xa875cc[_0x9ede('0x57')])?_0xa875cc['First_Name']+'\x20'+_0xa875cc[_0x9ede('0x58')]:_0xa875cc[_0x9ede('0x58')],'id':_0xa875cc['id']};_0x1f7837['$se_module']=_[_0x9ede('0x3e')](_0xa875cc['enduserType']);}if(_0x3abfdb['talktime']){_0x1f7837[_0x9ede('0x59')]=moment[_0x9ede('0x5a')](parseInt(_0x3abfdb[_0x9ede('0x5b')])*0x3e8)[_0x9ede('0x30')](_0x9ede('0x5c'));}else if(_0x3abfdb[_0x9ede('0x5d')]&&_0x3abfdb[_0x9ede('0x5e')]){_0x1f7837[_0x9ede('0x59')]=moment[_0x9ede('0x5a')](moment(_0x3abfdb[_0x9ede('0x5e')],_0x9ede('0x5f'))[_0x9ede('0x60')](moment(_0x3abfdb[_0x9ede('0x61')],_0x9ede('0x5f'))))[_0x9ede('0x30')](_0x9ede('0x5c'));}switch(_0x3abfdb[_0x9ede('0x62')]){case'called':_0x1f7837[_0x9ede('0x63')]=_0x9ede('0x64');break;case _0x9ede('0x65'):case'connect':_0x1f7837[_0x9ede('0x63')]=_0x9ede('0x66');break;case _0x9ede('0x67'):_0x1f7837[_0x9ede('0x63')]='Rejected';break;case _0x9ede('0x68'):_0x1f7837[_0x9ede('0x63')]=_0x9ede('0x69');break;case _0x9ede('0x6a'):_0x1f7837[_0x9ede('0x63')]='Timeout';default:}_0x1f7837[_0x9ede('0x6b')]=(_0x513cde===_0x9ede('0x6c')?moment(_0x3abfdb['starttime'])['format']('YYYY-MM-DDTHH:mm:ss'):moment(_0x3abfdb[_0x9ede('0x6d')])[_0x9ede('0x30')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x9ede('0x30')](_0x9ede('0x5f'));_0x1f7837[_0x9ede('0x6e')]=_0x513cde||_0x9ede('0x6f');_0x1f7837=_[_0x9ede('0x70')](_0x1f7837,getCustomFields(_0x170a36[_0x9ede('0x71')],_0x3abfdb));return request({'method':_0x9ede('0x25'),'uri':_0x9ede('0x48')+_0x550e19+'/crm/v2/Calls','headers':{'Authorization':_0x9ede('0x31')+_0x436d31},'body':{'data':[_0x1f7837]},'json':!![]})[_0x9ede('0x2b')](function(_0x2798c6){if(_0x2798c6&&_0x2798c6[_0x9ede('0x3b')][0x0]['code']==='SUCCESS'){logger[_0x9ede('0x34')](_0x9ede('0x72'));return{'id':_0x2798c6[_0x9ede('0x3b')][0x0][_0x9ede('0x73')]['id']};}})[_0x9ede('0x2c')](function(_0x14654f){logger['info'](_0x9ede('0x74'),_0x14654f['stack']);console[_0x9ede('0x75')](_0x9ede('0x74'),_0x14654f);});}exports['queue']=function(_0x46bef1,_0x2ac020,_0x563a8e,_0x28ccc6,_0x52d961,_0x1d24fe){var _0x153e5e,_0x8638f0,_0x5020d8;_0x1d24fe[_0x9ede('0x76')]=intUtil[_0x9ede('0x77')](_0x1d24fe[_0x9ede('0x76')]);_0x1d24fe['serverUrl']=intUtil[_0x9ede('0x77')](_0x1d24fe[_0x9ede('0x78')]);if(_0x52d961&&_0x52d961[_0x9ede('0x79')]){logger[_0x9ede('0x34')](_0x9ede('0x7a'),_0x9ede('0x7b'));_0x2ac020[_0x9ede('0x7c')]=_0x1d24fe[_0x9ede('0x78')]+_0x9ede('0x7d')+_0x2ac020[_0x9ede('0x7e')]+_0x9ede('0x7f')+md5(_0x2ac020[_0x9ede('0x7e')]);}else{_0x2ac020[_0x9ede('0x7c')]='';}var _0x4ec58a=_0x1d24fe['host']===_0x9ede('0x80')?'eu':_0x9ede('0x81');return getAccessToken(_0x1d24fe)[_0x9ede('0x2b')](function(_0x40e0ac){_0x5020d8=_0x40e0ac;return getUser(_0x5020d8,_0x4ec58a,_0x1d24fe,_0x28ccc6[_0x9ede('0x82')]);})['then'](function(_0x1f3f59){_0x153e5e=_0x1f3f59;logger[_0x9ede('0x34')](_0x9ede('0x83'),_0x153e5e['id']);return getEndUser(_0x5020d8,_0x4ec58a,_0x1d24fe,_0x2ac020[_0x9ede('0x84')],_0x2ac020[_0x9ede('0x85')],_0x153e5e,_0x563a8e);})['then'](function(_0x589185){_0x8638f0=_0x589185;return getCall(_0x5020d8,_0x4ec58a,_0x1d24fe,_0x153e5e,_0x8638f0,_0x563a8e,_0x2ac020,_0x9ede('0x6f'));})['then'](function(_0x489a06){if(_0x489a06){logger[_0x9ede('0x34')]('The\x20Call\x20ID\x20is:',_0x489a06['id']);logger['info'](_0x9ede('0x7a'),_0x9ede('0x86'));emit(util[_0x9ede('0x30')](_0x9ede('0x87'),_0x28ccc6[_0x9ede('0x1c')]),_0x9ede('0x88'),{'uri':_0x9ede('0x89')+_0x1d24fe[_0x9ede('0x76')]+_0x9ede('0x8a')+_0x489a06['id']});}})[_0x9ede('0x2c')](function(_0x48a11e){logger['error'](_0x9ede('0x7a'),JSON[_0x9ede('0x11')](_0x48a11e));});};exports[_0x9ede('0x6c')]=function(_0x527e64,_0x2373b2,_0x5aa06f,_0x4890f0,_0x5cd93c,_0x45e4cf,_0x2fb8ec){var _0x510585,_0x4b8636,_0x125011;_0x45e4cf[_0x9ede('0x76')]=intUtil[_0x9ede('0x77')](_0x45e4cf[_0x9ede('0x76')]);_0x45e4cf[_0x9ede('0x78')]=intUtil[_0x9ede('0x77')](_0x45e4cf[_0x9ede('0x78')]);if(_0x2fb8ec&&_0x2fb8ec[_0x9ede('0x8b')]&&_0x2fb8ec[_0x9ede('0x8b')]!=='none'){logger[_0x9ede('0x34')]('[OUTBOUND]',_0x9ede('0x7b'));_0x2373b2[_0x9ede('0x7c')]=_0x45e4cf[_0x9ede('0x78')]+_0x9ede('0x7d')+_0x2373b2[_0x9ede('0x7e')]+_0x9ede('0x7f')+md5(_0x2373b2['uniqueid']);}var _0x3b5da1=_0x45e4cf[_0x9ede('0x76')]===_0x9ede('0x80')?'eu':_0x9ede('0x81');return getAccessToken(_0x45e4cf)[_0x9ede('0x2b')](function(_0x24e0b6){_0x125011=_0x24e0b6;return getUser(_0x125011,_0x3b5da1,_0x45e4cf,_0x4890f0[_0x9ede('0x82')]);})[_0x9ede('0x2b')](function(_0x3ccabf){_0x510585=_0x3ccabf;logger[_0x9ede('0x34')](_0x9ede('0x83'),_0x510585['id']);return getEndUser(_0x125011,_0x3b5da1,_0x45e4cf,_0x2373b2['destcalleridname'],_0x2373b2['destcalleridnum'],_0x510585,_0x5aa06f);})[_0x9ede('0x2b')](function(_0x4b739e){_0x4b8636=_0x4b739e;return getCall(_0x125011,_0x3b5da1,_0x45e4cf,_0x510585,_0x4b8636,_0x5aa06f,_0x2373b2,_0x9ede('0x8c'));})[_0x9ede('0x2b')](function(_0x200d6d){if(_0x200d6d){logger[_0x9ede('0x34')](_0x9ede('0x8d'),_0x200d6d['id']);logger[_0x9ede('0x34')](_0x9ede('0x8e'),_0x9ede('0x86'));emit(util[_0x9ede('0x30')](_0x9ede('0x87'),_0x4890f0['name']),_0x9ede('0x88'),{'uri':_0x9ede('0x89')+_0x45e4cf[_0x9ede('0x76')]+'/crm/EntityInfo.do?module=Calls&id='+_0x200d6d['id']});}})[_0x9ede('0x2c')](function(_0x4bc7c5){logger[_0x9ede('0x2d')](_0x9ede('0x8e'),JSON[_0x9ede('0x11')](_0x4bc7c5));});};exports['unmanaged']=function(_0x5ea724,_0x1139b2,_0x479484,_0x5c6354,_0x3450b1,_0x490600){var _0xc9b9a,_0x1efa43,_0xe56014;_0x490600[_0x9ede('0x76')]=intUtil[_0x9ede('0x77')](_0x490600[_0x9ede('0x76')]);_0x490600['serverUrl']=intUtil[_0x9ede('0x77')](_0x490600[_0x9ede('0x78')]);if(_0x3450b1&&_0x3450b1[_0x9ede('0x79')]){logger[_0x9ede('0x34')]('['+_0x1139b2[_0x9ede('0x62')][_0x9ede('0x8f')]()+']','Recording\x20is\x20enabled!');_0x1139b2[_0x9ede('0x7c')]=_0x490600[_0x9ede('0x78')]+_0x9ede('0x7d')+_0x1139b2[_0x9ede('0x7e')]+_0x9ede('0x7f')+md5(_0x1139b2[_0x9ede('0x7e')]);}else{_0x1139b2['recordingURL']='';}var _0x4ac198=_0x490600['host']===_0x9ede('0x80')?'eu':'com';return getAccessToken(_0x490600)[_0x9ede('0x2b')](function(_0x105dea){_0xe56014=_0x105dea;return getUser(_0xe56014,_0x4ac198,_0x490600);})[_0x9ede('0x2b')](function(_0x234590){_0xc9b9a=_0x234590;logger[_0x9ede('0x34')](_0x9ede('0x83'),_0xc9b9a['id']);return getEndUser(_0xe56014,_0x4ac198,_0x490600,_0x1139b2[_0x9ede('0x84')],_0x1139b2[_0x9ede('0x85')],_0xc9b9a,_0x479484);})['then'](function(_0x9cbfcf){_0x1efa43=_0x9cbfcf;return getCall(_0xe56014,_0x4ac198,_0x490600,_0xc9b9a,_0x1efa43,_0x479484,_0x1139b2,_0x9ede('0x6f'));})['then'](function(_0x1e0766){if(_0x1e0766){logger[_0x9ede('0x34')]('The\x20Call\x20ID\x20is:',_0x1e0766['id']);}})[_0x9ede('0x2c')](function(_0x2fd5f3){logger[_0x9ede('0x2d')]('['+_0x1139b2[_0x9ede('0x62')][_0x9ede('0x8f')]()+']',JSON['stringify'](_0x2fd5f3));});}; \ 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 63a8973..061d223 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 _0xdc21=['exec','data2','Script','data3','error','format','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','../../../../config/logger','trigger'];(function(_0x4278f2,_0x35a90a){var _0x51f6fd=function(_0x3f44fb){while(--_0x3f44fb){_0x4278f2['push'](_0x4278f2['shift']());}};_0x51f6fd(++_0x35a90a);}(_0xdc21,0xcb));var _0x1dc2=function(_0x3d9877,_0x2beb68){_0x3d9877=_0x3d9877-0x0;var _0x4273cb=_0xdc21[_0x3d9877];return _0x4273cb;};'use strict';var util=require(_0x1dc2('0x0'));var sh=require(_0x1dc2('0x1'));var Mustache=require(_0x1dc2('0x2'));var logger=require(_0x1dc2('0x3'))(_0x1dc2('0x4'));exports[_0x1dc2('0x5')]=function(_0x27a264,_0x5d80d2){var _0x290c94=_0x27a264[_0x1dc2('0x6')]?_0x27a264[_0x1dc2('0x6')]:_0x1dc2('0x7');var _0x4dc712=_0x27a264[_0x1dc2('0x8')]?Mustache['render'](_0x27a264[_0x1dc2('0x8')],_0x5d80d2):_0x5d80d2;sh[_0x1dc2('0x5')](_0x4dc712,function(_0x3280f7,_0x5842c5,_0x2a0d60){if(_0x3280f7!==0x0){logger[_0x1dc2('0x9')](util[_0x1dc2('0xa')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x290c94,_0x4dc712,_0x3280f7,_0x2a0d60));}else{logger[_0x1dc2('0xb')](util[_0x1dc2('0xa')](_0x1dc2('0xc'),_0x290c94,_0x4dc712,_0x5842c5));}});}; \ No newline at end of file +var _0x19b0=['%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','../../../../config/logger','exec','data2','Script','data3','render','error','format'];(function(_0x2422d4,_0x1e788c){var _0xd11167=function(_0xf46545){while(--_0xf46545){_0x2422d4['push'](_0x2422d4['shift']());}};_0xd11167(++_0x1e788c);}(_0x19b0,0x9e));var _0x019b=function(_0x51726b,_0x3bbb4e){_0x51726b=_0x51726b-0x0;var _0x150424=_0x19b0[_0x51726b];return _0x150424;};'use strict';var util=require(_0x019b('0x0'));var sh=require(_0x019b('0x1'));var Mustache=require(_0x019b('0x2'));var logger=require(_0x019b('0x3'))('trigger');exports[_0x019b('0x4')]=function(_0x1cf44d,_0x50884b){var _0x617185=_0x1cf44d[_0x019b('0x5')]?_0x1cf44d['data2']:_0x019b('0x6');var _0x4c2340=_0x1cf44d[_0x019b('0x7')]?Mustache[_0x019b('0x8')](_0x1cf44d['data3'],_0x50884b):_0x50884b;sh[_0x019b('0x4')](_0x4c2340,function(_0x17e2e2,_0x109e46,_0x474f9c){if(_0x17e2e2!==0x0){logger[_0x019b('0x9')](util[_0x019b('0xa')](_0x019b('0xb'),_0x617185,_0x4c2340,_0x17e2e2,_0x474f9c));}else{logger['info'](util[_0x019b('0xa')](_0x019b('0xc'),_0x617185,_0x4c2340,_0x109e46));}});}; \ 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 b13b6aa..4d08ae6 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 _0xe5a7=['PUT','data7','body','info','format','stringify','then','isNil',',\x20request\x20body:\x20','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','lodash','mustache','../../../../config/logger','exec','data1','toUpperCase','render','data2','number','data5','headers','data6','parse','error','stack','GET','DELETE','POST'];(function(_0x270718,_0xab9058){var _0x4af2ba=function(_0x5f3dcd){while(--_0x5f3dcd){_0x270718['push'](_0x270718['shift']());}};_0x4af2ba(++_0xab9058);}(_0xe5a7,0x179));var _0x7e5a=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xe5a7[_0x55e08b];return _0xd1a7ff;};'use strict';var rp=require(_0x7e5a('0x0'));var util=require('util');var _=require(_0x7e5a('0x1'));var Mustache=require(_0x7e5a('0x2'));var logger=require(_0x7e5a('0x3'))('trigger');exports[_0x7e5a('0x4')]=function(_0x37fb75,_0x2e5c94){var _0x4f78a3,_0x42dc7f;var _0x348340={'method':_0x37fb75[_0x7e5a('0x5')][_0x7e5a('0x6')](),'uri':Mustache[_0x7e5a('0x7')](_0x37fb75[_0x7e5a('0x8')],_0x2e5c94),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x37fb75['data5'])===_0x7e5a('0x9')&&parseInt(_0x37fb75['data5'])>=0x1&&parseInt(_0x37fb75[_0x7e5a('0xa')])<=0xa?parseInt(_0x37fb75[_0x7e5a('0xa')])*0x3e8:0x5*0x3e8};try{_0x348340[_0x7e5a('0xb')]=_0x37fb75[_0x7e5a('0xc')]?JSON[_0x7e5a('0xd')](Mustache['render'](_0x37fb75[_0x7e5a('0xc')],_0x2e5c94)):{};}catch(_0xe9e1e3){logger[_0x7e5a('0xe')](_0xe9e1e3[_0x7e5a('0xf')]);}switch(_0x37fb75[_0x7e5a('0x5')][_0x7e5a('0x6')]()){case _0x7e5a('0x10'):case _0x7e5a('0x11'):_0x4f78a3=null;_0x348340['qs']=_0x2e5c94;break;case _0x7e5a('0x12'):case _0x7e5a('0x13'):if(_0x37fb75[_0x7e5a('0x14')]){try{_0x4f78a3=JSON['parse'](Mustache[_0x7e5a('0x7')](_0x37fb75[_0x7e5a('0x14')],_0x2e5c94));_0x348340['body']=_0x4f78a3;}catch(_0x501a0c){logger['error'](_0x501a0c[_0x7e5a('0xf')]);logger[_0x7e5a('0xe')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x4f78a3=_0x2e5c94;_0x348340[_0x7e5a('0x15')]=_0x4f78a3;}break;}logger[_0x7e5a('0x16')](util[_0x7e5a('0x17')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x37fb75['data1'],_0x37fb75[_0x7e5a('0x8')],JSON[_0x7e5a('0x18')](_0x348340)));rp(_0x348340)[_0x7e5a('0x19')](function(_0x34b0cb){_0x4f78a3=!_[_0x7e5a('0x1a')](_0x4f78a3)?_0x7e5a('0x1b')+_0x4f78a3:'';_0x42dc7f=typeof _0x34b0cb[_0x7e5a('0x15')]==='object'?JSON[_0x7e5a('0x18')](_0x34b0cb[_0x7e5a('0x15')]):_0x34b0cb[_0x7e5a('0x15')];logger[_0x7e5a('0x16')](util['format'](_0x7e5a('0x1c'),_0x37fb75[_0x7e5a('0x5')],_0x37fb75['data2'],_0x34b0cb[_0x7e5a('0x1d')],_0x42dc7f));})['catch'](function(_0x5bfd53){logger[_0x7e5a('0xe')](util[_0x7e5a('0x17')](_0x7e5a('0x1e'),_0x37fb75[_0x7e5a('0x5')],_0x37fb75[_0x7e5a('0x8')],_0x5bfd53[_0x7e5a('0x1d')],_0x5bfd53[_0x7e5a('0x1f')],_0x5bfd53[_0x7e5a('0x20')]));});}; \ No newline at end of file +var _0x1c78=['stack','PUT','data7','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','request-promise','util','lodash','mustache','../../../../config/logger','exec','data1','toUpperCase','render','data2','data5','data6','parse'];(function(_0x4e324f,_0x4f0cfc){var _0x4e6076=function(_0x4b8227){while(--_0x4b8227){_0x4e324f['push'](_0x4e324f['shift']());}};_0x4e6076(++_0x4f0cfc);}(_0x1c78,0x1f1));var _0x81c7=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x1c78[_0x432682];return _0x463d05;};'use strict';var rp=require(_0x81c7('0x0'));var util=require(_0x81c7('0x1'));var _=require(_0x81c7('0x2'));var Mustache=require(_0x81c7('0x3'));var logger=require(_0x81c7('0x4'))('trigger');exports[_0x81c7('0x5')]=function(_0x5ba647,_0x3affa7){var _0x40d0a7,_0x4daf2b;var _0x231071={'method':_0x5ba647[_0x81c7('0x6')][_0x81c7('0x7')](),'uri':Mustache[_0x81c7('0x8')](_0x5ba647[_0x81c7('0x9')],_0x3affa7),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5ba647['data5'])==='number'&&parseInt(_0x5ba647[_0x81c7('0xa')])>=0x1&&parseInt(_0x5ba647[_0x81c7('0xa')])<=0xa?parseInt(_0x5ba647[_0x81c7('0xa')])*0x3e8:0x5*0x3e8};try{_0x231071['headers']=_0x5ba647[_0x81c7('0xb')]?JSON[_0x81c7('0xc')](Mustache[_0x81c7('0x8')](_0x5ba647[_0x81c7('0xb')],_0x3affa7)):{};}catch(_0x28f83f){logger['error'](_0x28f83f[_0x81c7('0xd')]);}switch(_0x5ba647['data1'][_0x81c7('0x7')]()){case'GET':case'DELETE':_0x40d0a7=null;_0x231071['qs']=_0x3affa7;break;case'POST':case _0x81c7('0xe'):if(_0x5ba647['data7']){try{_0x40d0a7=JSON[_0x81c7('0xc')](Mustache[_0x81c7('0x8')](_0x5ba647[_0x81c7('0xf')],_0x3affa7));_0x231071[_0x81c7('0x10')]=_0x40d0a7;}catch(_0x74dc9){logger[_0x81c7('0x11')](_0x74dc9[_0x81c7('0xd')]);logger[_0x81c7('0x11')](_0x81c7('0x12'));}}else{_0x40d0a7=_0x3affa7;_0x231071['body']=_0x40d0a7;}break;}logger[_0x81c7('0x13')](util[_0x81c7('0x14')](_0x81c7('0x15'),_0x5ba647['data1'],_0x5ba647[_0x81c7('0x9')],JSON[_0x81c7('0x16')](_0x231071)));rp(_0x231071)[_0x81c7('0x17')](function(_0x4b7eac){_0x40d0a7=!_[_0x81c7('0x18')](_0x40d0a7)?_0x81c7('0x19')+_0x40d0a7:'';_0x4daf2b=typeof _0x4b7eac[_0x81c7('0x10')]==='object'?JSON['stringify'](_0x4b7eac[_0x81c7('0x10')]):_0x4b7eac[_0x81c7('0x10')];logger[_0x81c7('0x13')](util[_0x81c7('0x14')](_0x81c7('0x1a'),_0x5ba647[_0x81c7('0x6')],_0x5ba647[_0x81c7('0x9')],_0x4b7eac[_0x81c7('0x1b')],_0x4daf2b));})[_0x81c7('0x1c')](function(_0xb53d54){logger['error'](util[_0x81c7('0x14')](_0x81c7('0x1d'),_0x5ba647[_0x81c7('0x6')],_0x5ba647[_0x81c7('0x9')],_0xb53d54[_0x81c7('0x1b')],_0xb53d54['name'],_0xb53d54['message']));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index eeb6a2b..ed95b32 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 _0xbab5=['then','debug','rpc','error','message','catch','exports','jayson/promise','bluebird','routing','client','Request','request'];(function(_0xe6dcc9,_0x78419b){var _0xeb450=function(_0x5438e4){while(--_0x5438e4){_0xe6dcc9['push'](_0xe6dcc9['shift']());}};_0xeb450(++_0x78419b);}(_0xbab5,0x1b4));var _0x5bab=function(_0x246ae4,_0x1a5fec){_0x246ae4=_0x246ae4-0x0;var _0x19f22f=_0xbab5[_0x246ae4];return _0x19f22f;};'use strict';var jayson=require(_0x5bab('0x0'));var BPromise=require(_0x5bab('0x1'));var logger=require('../../config/logger')(_0x5bab('0x2'));var client=jayson[_0x5bab('0x3')]['http']({'port':0x2329});client[_0x5bab('0x4')]=function(_0x383f29,_0x58cfa7){return new BPromise(function(_0x58667c,_0x3a3aa6){return client[_0x5bab('0x5')](_0x383f29,_0x58cfa7)[_0x5bab('0x6')](function(_0x2a2d78){logger[_0x5bab('0x7')](_0x5bab('0x8'),'routing',_0x383f29,_0x58cfa7,_0x2a2d78);if(_0x2a2d78['error']){logger[_0x5bab('0x9')](_0x5bab('0x8'),'routing',_0x383f29,_0x2a2d78['error'][_0x5bab('0xa')],_0x58cfa7);return _0x3a3aa6(_0x2a2d78[_0x5bab('0x9')]['message']);}else{return _0x58667c(_0x2a2d78['result']);}})[_0x5bab('0xb')](function(_0x56c180){logger[_0x5bab('0x9')](_0x5bab('0x8'),_0x5bab('0x2'),_0x383f29,_0x56c180,_0x58cfa7);return _0x3a3aa6(_0x56c180);});});};module[_0x5bab('0xc')]=client; \ No newline at end of file +var _0xbb0b=['bluebird','../../config/logger','routing','http','Request','request','then','debug','error','rpc','message','exports','jayson/promise'];(function(_0x2ed806,_0x4e64aa){var _0x55f7aa=function(_0x139a81){while(--_0x139a81){_0x2ed806['push'](_0x2ed806['shift']());}};_0x55f7aa(++_0x4e64aa);}(_0xbb0b,0x15e));var _0xbbb0=function(_0x8d69c9,_0x19059d){_0x8d69c9=_0x8d69c9-0x0;var _0x1bbfd7=_0xbb0b[_0x8d69c9];return _0x1bbfd7;};'use strict';var jayson=require(_0xbbb0('0x0'));var BPromise=require(_0xbbb0('0x1'));var logger=require(_0xbbb0('0x2'))(_0xbbb0('0x3'));var client=jayson['client'][_0xbbb0('0x4')]({'port':0x2329});client[_0xbbb0('0x5')]=function(_0x38f801,_0x1b50d3){return new BPromise(function(_0x78c0c4,_0x3d1ba0){return client[_0xbbb0('0x6')](_0x38f801,_0x1b50d3)[_0xbbb0('0x7')](function(_0x591efd){logger[_0xbbb0('0x8')]('rpc',_0xbbb0('0x3'),_0x38f801,_0x1b50d3,_0x591efd);if(_0x591efd[_0xbbb0('0x9')]){logger['error'](_0xbbb0('0xa'),_0xbbb0('0x3'),_0x38f801,_0x591efd[_0xbbb0('0x9')][_0xbbb0('0xb')],_0x1b50d3);return _0x3d1ba0(_0x591efd[_0xbbb0('0x9')][_0xbbb0('0xb')]);}else{return _0x78c0c4(_0x591efd['result']);}})['catch'](function(_0x528c67){logger[_0xbbb0('0x9')](_0xbbb0('0xa'),'routing',_0x38f801,_0x528c67,_0x1b50d3);return _0x3d1ba0(_0x528c67);});});};module[_0xbbb0('0xc')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 765e4be..3024b3a 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 _0xad6b=['./rpc/mailAccount','./rpc/setting','then','initMailAccounts','listen','getSettings','loginMailFrequency','catch','log','bluebird','./server','./lib/email'];(function(_0x5f4f1,_0x121988){var _0x310966=function(_0x2960bf){while(--_0x2960bf){_0x5f4f1['push'](_0x5f4f1['shift']());}};_0x310966(++_0x121988);}(_0xad6b,0x159));var _0xbad6=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xad6b[_0x4e676e];return _0x336a3c;};'use strict';var BPromise=require(_0xbad6('0x0'));var server=require(_0xbad6('0x1'));var Realtime=require('./realtime');var EmailChannel=require(_0xbad6('0x2'));var mailAccount=require(_0xbad6('0x3'));var setting=require(_0xbad6('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise['resolve']()[_0xbad6('0x5')](mailAccount['getMailAccounts']())[_0xbad6('0x5')](realtime[_0xbad6('0x6')]())[_0xbad6('0x5')](function(){email['refresh'](realtime['mailAccounts']);return realtime;});}function main(){return server[_0xbad6('0x7')](realtime,email)[_0xbad6('0x5')](function(){return initRealtime();})[_0xbad6('0x5')](function(){return setting[_0xbad6('0x8')]();})[_0xbad6('0x5')](function(_0x4f3e76){return setInterval(initRealtime,_0x4f3e76[_0xbad6('0x9')]*0x3e8);})[_0xbad6('0xa')](function(_0x1d91f9){console[_0xbad6('0xb')](_0x1d91f9);});}main(); \ No newline at end of file +var _0xfd4a=['listen','loginMailFrequency','bluebird','./realtime','./lib/email','./rpc/mailAccount','resolve','getMailAccounts','then','initMailAccounts','refresh','mailAccounts'];(function(_0x4a1ec0,_0x26287b){var _0x49ab91=function(_0x206584){while(--_0x206584){_0x4a1ec0['push'](_0x4a1ec0['shift']());}};_0x49ab91(++_0x26287b);}(_0xfd4a,0x10a));var _0xafd4=function(_0x54514d,_0x5211b9){_0x54514d=_0x54514d-0x0;var _0x1389cf=_0xfd4a[_0x54514d];return _0x1389cf;};'use strict';var BPromise=require(_0xafd4('0x0'));var server=require('./server');var Realtime=require(_0xafd4('0x1'));var EmailChannel=require(_0xafd4('0x2'));var mailAccount=require(_0xafd4('0x3'));var setting=require('./rpc/setting');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0xafd4('0x4')]()['then'](mailAccount[_0xafd4('0x5')]())[_0xafd4('0x6')](realtime[_0xafd4('0x7')]())['then'](function(){email[_0xafd4('0x8')](realtime[_0xafd4('0x9')]);return realtime;});}function main(){return server[_0xafd4('0xa')](realtime,email)[_0xafd4('0x6')](function(){return initRealtime();})[_0xafd4('0x6')](function(){return setting['getSettings']();})[_0xafd4('0x6')](function(_0x2cf130){return setInterval(initRealtime,_0x2cf130[_0xafd4('0xb')]*0x3e8);})['catch'](function(_0x4d45b0){console['log'](_0x4d45b0);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 20aca9f..a3475bd 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 _0xdf3a=['emit','mailAccount:update','hasOwnProperty','box','handleImapBox','handleImapEmail','bind','end','handleImapEnd','disabled','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','Mail\x20accepted\x20from\x20routing','catch','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapError','send','verifySmtp','Smtp','lastSync','verify','verified','lodash','moment','bluebird','md5','ioredis','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','name','key','active','status','Imap','messageStatus','total','isNil','stringify'];(function(_0x3191f9,_0x52c4d1){var _0x2cb3b0=function(_0x44a247){while(--_0x44a247){_0x3191f9['push'](_0x3191f9['shift']());}};_0x2cb3b0(++_0x52c4d1);}(_0xdf3a,0x1a3));var _0xadf3=function(_0x303b47,_0x3d1f9a){_0x303b47=_0x303b47-0x0;var _0x4785bd=_0xdf3a[_0x303b47];return _0x4785bd;};'use strict';var _=require(_0xadf3('0x0'));var moment=require(_0xadf3('0x1'));var BPromise=require(_0xadf3('0x2'));var md5=require(_0xadf3('0x3'));var Redis=require(_0xadf3('0x4'));var config=require('../../../config/environment');var logger=require(_0xadf3('0x5'))(_0xadf3('0x6'));config[_0xadf3('0x7')]=_[_0xadf3('0x8')](config[_0xadf3('0x7')],{'host':_0xadf3('0x9'),'port':0x18eb});var io=require(_0xadf3('0xa'))(new Redis(config[_0xadf3('0x7')]));var EmailImap=require(_0xadf3('0xb'));var EmailSmtp=require(_0xadf3('0xc'));var mailAccount=require(_0xadf3('0xd'));var md5Accounts={};function EmailChannel(_0x173454){logger[_0xadf3('0xe')](_0xadf3('0xf'));this[_0xadf3('0x10')]=_0x173454[_0xadf3('0x10')];this[_0xadf3('0x11')]={};this[_0xadf3('0x12')]=new EmailSmtp();}EmailChannel[_0xadf3('0x13')]['emit']=function(_0x5e43f3){var _0x5399c2=this[_0xadf3('0x10')][_0x5e43f3];var _0x160d4e={'id':_0x5399c2['id'],'name':_0x5399c2[_0xadf3('0x14')],'key':_0x5399c2[_0xadf3('0x15')],'active':_0x5399c2[_0xadf3('0x16')],'Imap':{'status':_0x5399c2['Imap'][_0xadf3('0x17')],'messageStatus':_0x5399c2[_0xadf3('0x18')][_0xadf3('0x19')],'total':_0x5399c2['Imap'][_0xadf3('0x1a')]}};if(_[_0xadf3('0x1b')](md5Accounts[_0x5e43f3])){md5Accounts[_0x5e43f3]={};}var _0x14a7c5=md5(JSON[_0xadf3('0x1c')](_0x160d4e));if(md5Accounts[_0x5e43f3][_0xadf3('0x3')]!==_0x14a7c5){md5Accounts[_0x5e43f3][_0xadf3('0x3')]=_0x14a7c5;io[_0xadf3('0x1d')](_0xadf3('0x1e'),_0x160d4e);}};EmailChannel[_0xadf3('0x13')]['refresh']=function(_0x307620){for(var _0x2d006d in _0x307620){if(_0x307620[_0xadf3('0x1f')](_0x2d006d)){if(_0x307620[_0x2d006d]['Imap']&&_0x307620[_0x2d006d]['active']){var _0x5e5c26=_0x307620[_0x2d006d]['Imap'];if(!this[_0xadf3('0x11')][_0xadf3('0x1f')](_0x5e5c26['id'])){this['imapAccounts'][_0x5e5c26['id']]=new EmailImap(_0x5e5c26,_0x307620[_0x2d006d][_0xadf3('0x6')]);this[_0xadf3('0x11')][_0x5e5c26['id']]['on'](_0xadf3('0x20'),this[_0xadf3('0x21')]['bind'](this,_0x2d006d));this['imapAccounts'][_0x5e5c26['id']]['on'](_0xadf3('0x6'),this[_0xadf3('0x22')][_0xadf3('0x23')](this,_0x2d006d));this['imapAccounts'][_0x5e5c26['id']]['on'](_0xadf3('0x24'),this[_0xadf3('0x25')][_0xadf3('0x23')](this,_0x2d006d));this[_0xadf3('0x11')][_0x5e5c26['id']]['on']('error',this['handleImapError']['bind'](this,_0x2d006d));}}else{if(_['isNil'](this['mailAccounts'][_0x2d006d]['Imap'])){this[_0xadf3('0x10')][_0x2d006d][_0xadf3('0x18')]={};}this['mailAccounts'][_0x2d006d][_0xadf3('0x18')][_0xadf3('0x17')]=_0xadf3('0x26');this[_0xadf3('0x10')][_0x2d006d][_0xadf3('0x18')]['messageStatus']='';this[_0xadf3('0x1d')](_0x2d006d);}}}};EmailChannel[_0xadf3('0x13')][_0xadf3('0x21')]=function(_0x234888,_0xaceef9){if(this['mailAccounts'][_0x234888]){this[_0xadf3('0x10')][_0x234888][_0xadf3('0x18')]['status']='connected';this['mailAccounts'][_0x234888]['Imap']['messageStatus']=_0xaceef9[_0xadf3('0x14')];if(_0xaceef9[_0xadf3('0x27')]){this['mailAccounts'][_0x234888][_0xadf3('0x18')][_0xadf3('0x1a')]=_0xaceef9[_0xadf3('0x27')]['total'];}return this['emit'](_0x234888);}};EmailChannel['prototype'][_0xadf3('0x22')]=function(_0x4a9817,_0x3d6881){logger['info'](_0xadf3('0x28'),_0x3d6881[_0xadf3('0x29')],_0x3d6881[_0xadf3('0x2a')],_0x3d6881[_0xadf3('0x2b')],_0x4a9817);if(this[_0xadf3('0x10')][_0x4a9817]){return mailAccount[_0xadf3('0x2c')](_0x4a9817,_0x3d6881)['then'](function(_0x38f569){if(_0x38f569){logger[_0xadf3('0xe')](_0xadf3('0x2d'));}})[_0xadf3('0x2e')](function(_0x5b6beb){logger[_0xadf3('0x2f')](_0xadf3('0x30'),JSON['stringify'](_0x5b6beb));});}};EmailChannel[_0xadf3('0x13')][_0xadf3('0x25')]=function(_0x2f9fc4){if(this[_0xadf3('0x10')][_0x2f9fc4]&&this[_0xadf3('0x10')][_0x2f9fc4][_0xadf3('0x18')]){if(this[_0xadf3('0x11')][this[_0xadf3('0x10')][_0x2f9fc4][_0xadf3('0x18')]['id']]){delete this[_0xadf3('0x11')][this[_0xadf3('0x10')][_0x2f9fc4][_0xadf3('0x18')]['id']];}this[_0xadf3('0x10')][_0x2f9fc4][_0xadf3('0x18')]['lastSync']=moment();this[_0xadf3('0x1d')](_0x2f9fc4);}};EmailChannel[_0xadf3('0x13')][_0xadf3('0x31')]=function(_0x19bc6c,_0x4c9e82){if(this[_0xadf3('0x10')][_0x19bc6c]){this[_0xadf3('0x10')][_0x19bc6c]['Imap'][_0xadf3('0x17')]=_0xadf3('0x2f');this['mailAccounts'][_0x19bc6c][_0xadf3('0x18')][_0xadf3('0x19')]=_0x4c9e82;return this[_0xadf3('0x1d')](_0x19bc6c);}};EmailChannel['prototype']['sendMail']=function(_0x2a7823,_0x534d90){return this[_0xadf3('0x12')][_0xadf3('0x32')](_0x2a7823,_0x534d90);};EmailChannel['prototype'][_0xadf3('0x33')]=function(_0x310b6b){var _0xe76107=this;if(this[_0xadf3('0x10')][_0x310b6b['id']]){if(_[_0xadf3('0x1b')](this['mailAccounts'][_0x310b6b['id']][_0xadf3('0x34')])){this['mailAccounts'][_0x310b6b['id']][_0xadf3('0x34')]={};}this[_0xadf3('0x10')][_0x310b6b['id']][_0xadf3('0x34')][_0xadf3('0x35')]=moment();return new BPromise(function(_0x3c5654,_0x58f33d){return _0xe76107[_0xadf3('0x12')][_0xadf3('0x36')](_0x310b6b)['then'](function(_0x8b6403){_0xe76107[_0xadf3('0x10')][_0x310b6b['id']][_0xadf3('0x34')][_0xadf3('0x17')]=_0xadf3('0x37');_0xe76107['mailAccounts'][_0x310b6b['id']]['Smtp'][_0xadf3('0x19')]='';_0xe76107[_0xadf3('0x1d')](_0x310b6b['id']);_0x3c5654(_0x8b6403);})[_0xadf3('0x2e')](function(_0x138688){_0xe76107[_0xadf3('0x10')][_0x310b6b['id']]['Smtp'][_0xadf3('0x17')]=_0xadf3('0x2f');_0xe76107['mailAccounts'][_0x310b6b['id']][_0xadf3('0x34')]['messageStatus']=_0x138688;_0xe76107['emit'](_0x310b6b['id']);_0x58f33d(_0x138688);});});}return this[_0xadf3('0x12')][_0xadf3('0x36')](_0x310b6b);};module['exports']=EmailChannel; \ No newline at end of file +var _0xddbe=['info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','messageStatus','total','stringify','md5','mailAccount:update','refresh','hasOwnProperty','box','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','isNil','status','disabled','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','then','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','sendMail','send','Smtp','lastSync','verify','exports','lodash','bluebird','../../../config/logger','email','defaults','redis','socket.io-emitter','./imap','./smtp','../rpc/mailAccount'];(function(_0x343170,_0x3ed922){var _0x1f002c=function(_0xc8a8c3){while(--_0xc8a8c3){_0x343170['push'](_0x343170['shift']());}};_0x1f002c(++_0x3ed922);}(_0xddbe,0x8f));var _0xeddb=function(_0x1e3ef7,_0x581f03){_0x1e3ef7=_0x1e3ef7-0x0;var _0x2ee539=_0xddbe[_0x1e3ef7];return _0x2ee539;};'use strict';var _=require(_0xeddb('0x0'));var moment=require('moment');var BPromise=require(_0xeddb('0x1'));var md5=require('md5');var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0xeddb('0x2'))(_0xeddb('0x3'));config['redis']=_[_0xeddb('0x4')](config[_0xeddb('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xeddb('0x6'))(new Redis(config[_0xeddb('0x5')]));var EmailImap=require(_0xeddb('0x7'));var EmailSmtp=require(_0xeddb('0x8'));var mailAccount=require(_0xeddb('0x9'));var md5Accounts={};function EmailChannel(_0x4de7da){logger[_0xeddb('0xa')](_0xeddb('0xb'));this[_0xeddb('0xc')]=_0x4de7da[_0xeddb('0xc')];this[_0xeddb('0xd')]={};this[_0xeddb('0xe')]=new EmailSmtp();}EmailChannel[_0xeddb('0xf')][_0xeddb('0x10')]=function(_0x586f7f){var _0x238b00=this[_0xeddb('0xc')][_0x586f7f];var _0x4c2f51={'id':_0x238b00['id'],'name':_0x238b00[_0xeddb('0x11')],'key':_0x238b00[_0xeddb('0x12')],'active':_0x238b00[_0xeddb('0x13')],'Imap':{'status':_0x238b00['Imap']['status'],'messageStatus':_0x238b00[_0xeddb('0x14')][_0xeddb('0x15')],'total':_0x238b00['Imap'][_0xeddb('0x16')]}};if(_['isNil'](md5Accounts[_0x586f7f])){md5Accounts[_0x586f7f]={};}var _0x33e97c=md5(JSON[_0xeddb('0x17')](_0x4c2f51));if(md5Accounts[_0x586f7f][_0xeddb('0x18')]!==_0x33e97c){md5Accounts[_0x586f7f][_0xeddb('0x18')]=_0x33e97c;io['emit'](_0xeddb('0x19'),_0x4c2f51);}};EmailChannel[_0xeddb('0xf')][_0xeddb('0x1a')]=function(_0x2c257e){for(var _0x5bc2ca in _0x2c257e){if(_0x2c257e[_0xeddb('0x1b')](_0x5bc2ca)){if(_0x2c257e[_0x5bc2ca][_0xeddb('0x14')]&&_0x2c257e[_0x5bc2ca][_0xeddb('0x13')]){var _0x53e8cf=_0x2c257e[_0x5bc2ca]['Imap'];if(!this[_0xeddb('0xd')][_0xeddb('0x1b')](_0x53e8cf['id'])){this[_0xeddb('0xd')][_0x53e8cf['id']]=new EmailImap(_0x53e8cf,_0x2c257e[_0x5bc2ca][_0xeddb('0x3')]);this[_0xeddb('0xd')][_0x53e8cf['id']]['on'](_0xeddb('0x1c'),this['handleImapBox'][_0xeddb('0x1d')](this,_0x5bc2ca));this[_0xeddb('0xd')][_0x53e8cf['id']]['on'](_0xeddb('0x3'),this[_0xeddb('0x1e')][_0xeddb('0x1d')](this,_0x5bc2ca));this[_0xeddb('0xd')][_0x53e8cf['id']]['on'](_0xeddb('0x1f'),this[_0xeddb('0x20')]['bind'](this,_0x5bc2ca));this['imapAccounts'][_0x53e8cf['id']]['on'](_0xeddb('0x21'),this[_0xeddb('0x22')][_0xeddb('0x1d')](this,_0x5bc2ca));}}else{if(_[_0xeddb('0x23')](this['mailAccounts'][_0x5bc2ca][_0xeddb('0x14')])){this['mailAccounts'][_0x5bc2ca][_0xeddb('0x14')]={};}this[_0xeddb('0xc')][_0x5bc2ca][_0xeddb('0x14')][_0xeddb('0x24')]=_0xeddb('0x25');this[_0xeddb('0xc')][_0x5bc2ca][_0xeddb('0x14')][_0xeddb('0x15')]='';this[_0xeddb('0x10')](_0x5bc2ca);}}}};EmailChannel[_0xeddb('0xf')]['handleImapBox']=function(_0x1632da,_0x22e2aa){if(this[_0xeddb('0xc')][_0x1632da]){this[_0xeddb('0xc')][_0x1632da][_0xeddb('0x14')][_0xeddb('0x24')]=_0xeddb('0x26');this[_0xeddb('0xc')][_0x1632da][_0xeddb('0x14')][_0xeddb('0x15')]=_0x22e2aa[_0xeddb('0x11')];if(_0x22e2aa['messages']){this[_0xeddb('0xc')][_0x1632da][_0xeddb('0x14')][_0xeddb('0x16')]=_0x22e2aa[_0xeddb('0x27')][_0xeddb('0x16')];}return this[_0xeddb('0x10')](_0x1632da);}};EmailChannel[_0xeddb('0xf')][_0xeddb('0x1e')]=function(_0x40a827,_0x15008d){logger[_0xeddb('0xa')](_0xeddb('0x28'),_0x15008d['firstName'],_0x15008d[_0xeddb('0x29')],_0x15008d['from'],_0x40a827);if(this[_0xeddb('0xc')][_0x40a827]){return mailAccount['notify'](_0x40a827,_0x15008d)[_0xeddb('0x2a')](function(_0x1bea53){if(_0x1bea53){logger[_0xeddb('0xa')]('Mail\x20accepted\x20from\x20routing');}})[_0xeddb('0x2b')](function(_0x2f7210){logger[_0xeddb('0x21')](_0xeddb('0x2c'),JSON[_0xeddb('0x17')](_0x2f7210));});}};EmailChannel['prototype'][_0xeddb('0x20')]=function(_0x4523cb){if(this['mailAccounts'][_0x4523cb]&&this['mailAccounts'][_0x4523cb][_0xeddb('0x14')]){if(this[_0xeddb('0xd')][this['mailAccounts'][_0x4523cb][_0xeddb('0x14')]['id']]){delete this[_0xeddb('0xd')][this[_0xeddb('0xc')][_0x4523cb][_0xeddb('0x14')]['id']];}this[_0xeddb('0xc')][_0x4523cb][_0xeddb('0x14')]['lastSync']=moment();this[_0xeddb('0x10')](_0x4523cb);}};EmailChannel[_0xeddb('0xf')]['handleImapError']=function(_0x19af52,_0x1cadfa){if(this['mailAccounts'][_0x19af52]){this['mailAccounts'][_0x19af52][_0xeddb('0x14')][_0xeddb('0x24')]=_0xeddb('0x21');this[_0xeddb('0xc')][_0x19af52]['Imap']['messageStatus']=_0x1cadfa;return this[_0xeddb('0x10')](_0x19af52);}};EmailChannel[_0xeddb('0xf')][_0xeddb('0x2d')]=function(_0x50d1cb,_0x122c85){return this['smtp'][_0xeddb('0x2e')](_0x50d1cb,_0x122c85);};EmailChannel[_0xeddb('0xf')]['verifySmtp']=function(_0x540a4a){var _0x4079e1=this;if(this['mailAccounts'][_0x540a4a['id']]){if(_[_0xeddb('0x23')](this[_0xeddb('0xc')][_0x540a4a['id']][_0xeddb('0x2f')])){this[_0xeddb('0xc')][_0x540a4a['id']]['Smtp']={};}this[_0xeddb('0xc')][_0x540a4a['id']][_0xeddb('0x2f')][_0xeddb('0x30')]=moment();return new BPromise(function(_0x4e4743,_0x407926){return _0x4079e1[_0xeddb('0xe')][_0xeddb('0x31')](_0x540a4a)['then'](function(_0x2432b6){_0x4079e1[_0xeddb('0xc')][_0x540a4a['id']][_0xeddb('0x2f')]['status']='verified';_0x4079e1['mailAccounts'][_0x540a4a['id']][_0xeddb('0x2f')][_0xeddb('0x15')]='';_0x4079e1['emit'](_0x540a4a['id']);_0x4e4743(_0x2432b6);})[_0xeddb('0x2b')](function(_0x530f8e){_0x4079e1[_0xeddb('0xc')][_0x540a4a['id']][_0xeddb('0x2f')][_0xeddb('0x24')]=_0xeddb('0x21');_0x4079e1[_0xeddb('0xc')][_0x540a4a['id']][_0xeddb('0x2f')][_0xeddb('0x15')]=_0x530f8e;_0x4079e1['emit'](_0x540a4a['id']);_0x407926(_0x530f8e);});});}return this[_0xeddb('0xe')]['verify'](_0x540a4a);};module[_0xeddb('0x32')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 6711aa2..e9cd630 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 _0x9c44=['handleFetchMessage','error','handleFetchEnd','closeBox','attributes','handleMessageAttributes','handleMessageEnd','handleMessageBody','handleSimpleParser','parser','handleFetchError','stringify','textCode','hasOwnProperty','upperFirst','exports','imap','lodash','randomstring','mailparser','simpleParser','iconv','EventEmitter','../../../config/logger','email','mailbox','account','getAccount','ready','handleReady','once','bind','handleError','connect','inherits','prototype','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','required','getHost','openBox','handleOpenBox','emit','box','handleCloseBox','end','search','UNSEEN','handleReadUnseen','length','message'];(function(_0x20daa4,_0x25ada7){var _0x15c123=function(_0x228736){while(--_0x228736){_0x20daa4['push'](_0x20daa4['shift']());}};_0x15c123(++_0x25ada7);}(_0x9c44,0x178));var _0x49c4=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x9c44[_0x4f9b18];return _0x29f20c;};'use strict';var fs=require('fs');var path=require('path');var util=require('util');var Imap=require(_0x49c4('0x0'));var _=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var simpleParser=require(_0x49c4('0x3'))[_0x49c4('0x4')];var Iconv=require(_0x49c4('0x5'))['Iconv'];var EventEmitter=require('events')[_0x49c4('0x6')];var utils=require('./utils');var logger=require(_0x49c4('0x7'))(_0x49c4('0x8'));function EmailImap(_0x69bc41,_0x2c4e2e){this[_0x49c4('0x9')]='INBOX';this[_0x49c4('0xa')]=this[_0x49c4('0xb')](_0x69bc41,_0x2c4e2e);this[_0x49c4('0x0')]=new Imap(this[_0x49c4('0xa')]);this['imap']['once'](_0x49c4('0xc'),this[_0x49c4('0xd')]['bind'](this));this[_0x49c4('0x0')][_0x49c4('0xe')]('end',this['handleEnd'][_0x49c4('0xf')](this));this[_0x49c4('0x0')]['on']('error',this[_0x49c4('0x10')][_0x49c4('0xf')](this));this['imap'][_0x49c4('0x11')]();}util[_0x49c4('0x12')](EmailImap,EventEmitter);EmailImap[_0x49c4('0x13')][_0x49c4('0xb')]=function(_0x12777c,_0x18211c){var _0x75ea8={'connTimeout':_0x12777c[_0x49c4('0x14')]?_0x12777c['connTimeout']*0x3e8:0x2710,'authTimeout':_0x12777c[_0x49c4('0x15')]?_0x12777c[_0x49c4('0x15')]*0x3e8:0x1388};if(_[_0x49c4('0x16')](_0x12777c[_0x49c4('0x17')])){if(_0x12777c[_0x49c4('0x18')]){_0x75ea8['user']=_0x12777c[_0x49c4('0x19')];_0x75ea8[_0x49c4('0x1a')]=_0x12777c['password'];}_0x75ea8['host']=_0x12777c[_0x49c4('0x1b')];_0x75ea8[_0x49c4('0x1c')]=_0x12777c[_0x49c4('0x1c')]||0x3e1;if(_0x12777c['tls']){_0x75ea8[_0x49c4('0x1d')]=!![];}else{_0x75ea8['tls']=![];_0x75ea8[_0x49c4('0x1e')]=_0x49c4('0x1f');}}else{_0x75ea8[_0x49c4('0x19')]=_0x12777c[_0x49c4('0x19')];_0x75ea8[_0x49c4('0x1a')]=_0x12777c[_0x49c4('0x1a')];_0x75ea8[_0x49c4('0x1b')]=utils[_0x49c4('0x20')](_0x12777c[_0x49c4('0x17')]);_0x75ea8['port']=0x3e1;_0x75ea8['tls']=!![];}_0x75ea8['email']=_0x18211c||_0x12777c[_0x49c4('0x19')]||'anonymous@xcally.com';return _0x75ea8;};EmailImap['prototype'][_0x49c4('0xd')]=function(){this[_0x49c4('0x0')][_0x49c4('0x21')](this[_0x49c4('0x9')],![],this['handleOpenBox']['bind'](this));};EmailImap[_0x49c4('0x13')][_0x49c4('0x22')]=function(_0x565423,_0x207358){if(_0x565423){this[_0x49c4('0x10')](_0x565423,!![]);}else{this[_0x49c4('0x23')](_0x49c4('0x24'),_0x207358);this['readUnseen']();}};EmailImap['prototype'][_0x49c4('0x25')]=function(_0x53c199){if(_0x53c199){this[_0x49c4('0x10')](_0x53c199,!![]);}else{this[_0x49c4('0x0')][_0x49c4('0x26')]();}};EmailImap[_0x49c4('0x13')]['readUnseen']=function(){this[_0x49c4('0x0')][_0x49c4('0x27')]([_0x49c4('0x28')],this[_0x49c4('0x29')][_0x49c4('0xf')](this));};EmailImap[_0x49c4('0x13')][_0x49c4('0x29')]=function(_0x427b26,_0x17b50f){if(_0x427b26){this[_0x49c4('0x10')](_0x427b26,!![]);}else{if(_0x17b50f[_0x49c4('0x2a')]){try{var _0x4ea6ea=this['imap']['fetch'](_0x17b50f,{'bodies':'','markSeen':!![]});_0x4ea6ea['on'](_0x49c4('0x2b'),this[_0x49c4('0x2c')][_0x49c4('0xf')](this));_0x4ea6ea[_0x49c4('0xe')](_0x49c4('0x2d'),this['handleFetchError'][_0x49c4('0xf')](this));_0x4ea6ea[_0x49c4('0xe')](_0x49c4('0x26'),this[_0x49c4('0x2e')]['bind'](this));}catch(_0x57a29c){logger[_0x49c4('0x2d')](_0x57a29c);}}else{this[_0x49c4('0x0')][_0x49c4('0x2f')](!![],this[_0x49c4('0x25')][_0x49c4('0xf')](this));}}};EmailImap['prototype'][_0x49c4('0x2c')]=function(_0x84c621,_0x1bfa0f){_0x84c621['on']('body',this['handleMessageBody'][_0x49c4('0xf')](this));_0x84c621[_0x49c4('0xe')](_0x49c4('0x30'),this[_0x49c4('0x31')][_0x49c4('0xf')](this));_0x84c621[_0x49c4('0xe')](_0x49c4('0x26'),this[_0x49c4('0x32')][_0x49c4('0xf')](this));};EmailImap['prototype'][_0x49c4('0x33')]=function(_0x5b96df,_0xdda586){simpleParser(_0x5b96df,{'Iconv':Iconv},this[_0x49c4('0x34')][_0x49c4('0xf')](this));};EmailImap[_0x49c4('0x13')]['handleMessageAttributes']=function(_0x335f0c){};EmailImap[_0x49c4('0x13')][_0x49c4('0x32')]=function(){};EmailImap['prototype'][_0x49c4('0x34')]=function(_0x21d8c7,_0x178987){if(_0x21d8c7){logger[_0x49c4('0x2d')](_0x21d8c7);}else{var _0x1ba7a0=this;utils[_0x49c4('0x35')](this[_0x49c4('0xa')],_0x178987,function(_0x2ba76a){_0x1ba7a0[_0x49c4('0x23')](_0x49c4('0x8'),_0x2ba76a);});}};EmailImap[_0x49c4('0x13')]['handleFetchEnd']=function(){this[_0x49c4('0x0')][_0x49c4('0x2f')](!![],this[_0x49c4('0x25')][_0x49c4('0xf')](this));};EmailImap[_0x49c4('0x13')][_0x49c4('0x36')]=function(_0x1be62d){this[_0x49c4('0x10')](_0x1be62d);this[_0x49c4('0x0')][_0x49c4('0x2f')](!![],this[_0x49c4('0x25')][_0x49c4('0xf')](this));};EmailImap[_0x49c4('0x13')]['handleEnd']=function(){this[_0x49c4('0x23')]('end');};EmailImap[_0x49c4('0x13')][_0x49c4('0x10')]=function(_0x28d4fb,_0x1480da){logger[_0x49c4('0x2d')](_0x49c4('0x10'),this['account']['email'],JSON[_0x49c4('0x37')](_0x28d4fb));var _0x1e7bdc='';if(_0x28d4fb){if(_0x28d4fb[_0x49c4('0x38')]){_0x1e7bdc=_0x28d4fb[_0x49c4('0x38')];}else{for(var _0x490823 in _0x28d4fb){if(_0x28d4fb[_0x49c4('0x39')](_0x490823)){_0x1e7bdc+=_[_0x49c4('0x3a')](_0x490823)+':\x20'+_0x28d4fb[_0x490823]+'\x0a';}}}}if(_0x1480da){this[_0x49c4('0x0')][_0x49c4('0x26')]();}else{this[_0x49c4('0x23')](_0x49c4('0x2d'),_0x1e7bdc);this[_0x49c4('0x23')](_0x49c4('0x26'));}};module[_0x49c4('0x3b')]=EmailImap; \ No newline at end of file +var _0x6a24=['handleMessageAttributes','handleMessageEnd','handleMessageBody','handleSimpleParser','parser','handleFetchError','stringify','textCode','hasOwnProperty','upperFirst','exports','path','util','lodash','randomstring','mailparser','simpleParser','iconv','events','EventEmitter','../../../config/logger','email','mailbox','INBOX','getAccount','account','once','ready','handleReady','bind','imap','end','handleEnd','error','handleError','connect','inherits','prototype','authTimeout','service','authentication','user','password','host','port','tls','autotls','required','getHost','anonymous@xcally.com','openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchEnd','closeBox','body','attributes'];(function(_0xd1a252,_0x16396f){var _0x560ee1=function(_0x35dd90){while(--_0x35dd90){_0xd1a252['push'](_0xd1a252['shift']());}};_0x560ee1(++_0x16396f);}(_0x6a24,0xd1));var _0x46a2=function(_0x3c9085,_0x564c78){_0x3c9085=_0x3c9085-0x0;var _0x17629f=_0x6a24[_0x3c9085];return _0x17629f;};'use strict';var fs=require('fs');var path=require(_0x46a2('0x0'));var util=require(_0x46a2('0x1'));var Imap=require('imap');var _=require(_0x46a2('0x2'));var rs=require(_0x46a2('0x3'));var simpleParser=require(_0x46a2('0x4'))[_0x46a2('0x5')];var Iconv=require(_0x46a2('0x6'))['Iconv'];var EventEmitter=require(_0x46a2('0x7'))[_0x46a2('0x8')];var utils=require('./utils');var logger=require(_0x46a2('0x9'))(_0x46a2('0xa'));function EmailImap(_0x506698,_0x49870f){this[_0x46a2('0xb')]=_0x46a2('0xc');this['account']=this[_0x46a2('0xd')](_0x506698,_0x49870f);this['imap']=new Imap(this[_0x46a2('0xe')]);this['imap'][_0x46a2('0xf')](_0x46a2('0x10'),this[_0x46a2('0x11')][_0x46a2('0x12')](this));this[_0x46a2('0x13')][_0x46a2('0xf')](_0x46a2('0x14'),this[_0x46a2('0x15')]['bind'](this));this['imap']['on'](_0x46a2('0x16'),this[_0x46a2('0x17')]['bind'](this));this[_0x46a2('0x13')][_0x46a2('0x18')]();}util[_0x46a2('0x19')](EmailImap,EventEmitter);EmailImap[_0x46a2('0x1a')][_0x46a2('0xd')]=function(_0x2fd383,_0x19f6a7){var _0x9f99cf={'connTimeout':_0x2fd383['connTimeout']?_0x2fd383['connTimeout']*0x3e8:0x2710,'authTimeout':_0x2fd383[_0x46a2('0x1b')]?_0x2fd383[_0x46a2('0x1b')]*0x3e8:0x1388};if(_['isNil'](_0x2fd383[_0x46a2('0x1c')])){if(_0x2fd383[_0x46a2('0x1d')]){_0x9f99cf['user']=_0x2fd383[_0x46a2('0x1e')];_0x9f99cf[_0x46a2('0x1f')]=_0x2fd383['password'];}_0x9f99cf[_0x46a2('0x20')]=_0x2fd383[_0x46a2('0x20')];_0x9f99cf['port']=_0x2fd383[_0x46a2('0x21')]||0x3e1;if(_0x2fd383[_0x46a2('0x22')]){_0x9f99cf[_0x46a2('0x22')]=!![];}else{_0x9f99cf[_0x46a2('0x22')]=![];_0x9f99cf[_0x46a2('0x23')]=_0x46a2('0x24');}}else{_0x9f99cf[_0x46a2('0x1e')]=_0x2fd383[_0x46a2('0x1e')];_0x9f99cf[_0x46a2('0x1f')]=_0x2fd383[_0x46a2('0x1f')];_0x9f99cf[_0x46a2('0x20')]=utils[_0x46a2('0x25')](_0x2fd383[_0x46a2('0x1c')]);_0x9f99cf['port']=0x3e1;_0x9f99cf[_0x46a2('0x22')]=!![];}_0x9f99cf['email']=_0x19f6a7||_0x2fd383[_0x46a2('0x1e')]||_0x46a2('0x26');return _0x9f99cf;};EmailImap['prototype'][_0x46a2('0x11')]=function(){this[_0x46a2('0x13')][_0x46a2('0x27')](this[_0x46a2('0xb')],![],this['handleOpenBox'][_0x46a2('0x12')](this));};EmailImap[_0x46a2('0x1a')][_0x46a2('0x28')]=function(_0x297158,_0x74bb6a){if(_0x297158){this[_0x46a2('0x17')](_0x297158,!![]);}else{this[_0x46a2('0x29')](_0x46a2('0x2a'),_0x74bb6a);this[_0x46a2('0x2b')]();}};EmailImap[_0x46a2('0x1a')][_0x46a2('0x2c')]=function(_0x582ada){if(_0x582ada){this[_0x46a2('0x17')](_0x582ada,!![]);}else{this[_0x46a2('0x13')][_0x46a2('0x14')]();}};EmailImap[_0x46a2('0x1a')][_0x46a2('0x2b')]=function(){this[_0x46a2('0x13')]['search']([_0x46a2('0x2d')],this[_0x46a2('0x2e')][_0x46a2('0x12')](this));};EmailImap[_0x46a2('0x1a')][_0x46a2('0x2e')]=function(_0x511bea,_0x4024be){if(_0x511bea){this['handleError'](_0x511bea,!![]);}else{if(_0x4024be[_0x46a2('0x2f')]){try{var _0x97a3bf=this[_0x46a2('0x13')][_0x46a2('0x30')](_0x4024be,{'bodies':'','markSeen':!![]});_0x97a3bf['on'](_0x46a2('0x31'),this[_0x46a2('0x32')][_0x46a2('0x12')](this));_0x97a3bf[_0x46a2('0xf')](_0x46a2('0x16'),this['handleFetchError'][_0x46a2('0x12')](this));_0x97a3bf[_0x46a2('0xf')](_0x46a2('0x14'),this[_0x46a2('0x33')][_0x46a2('0x12')](this));}catch(_0x59e84a){logger['error'](_0x59e84a);}}else{this[_0x46a2('0x13')][_0x46a2('0x34')](!![],this[_0x46a2('0x2c')][_0x46a2('0x12')](this));}}};EmailImap[_0x46a2('0x1a')][_0x46a2('0x32')]=function(_0x504195,_0x4d04ac){_0x504195['on'](_0x46a2('0x35'),this['handleMessageBody'][_0x46a2('0x12')](this));_0x504195[_0x46a2('0xf')](_0x46a2('0x36'),this[_0x46a2('0x37')]['bind'](this));_0x504195[_0x46a2('0xf')](_0x46a2('0x14'),this[_0x46a2('0x38')][_0x46a2('0x12')](this));};EmailImap['prototype'][_0x46a2('0x39')]=function(_0x3f7d3f,_0x244c4b){simpleParser(_0x3f7d3f,{'Iconv':Iconv},this[_0x46a2('0x3a')]['bind'](this));};EmailImap[_0x46a2('0x1a')]['handleMessageAttributes']=function(_0x3b56f8){};EmailImap['prototype'][_0x46a2('0x38')]=function(){};EmailImap[_0x46a2('0x1a')]['handleSimpleParser']=function(_0x316b3d,_0x57fdfe){if(_0x316b3d){logger['error'](_0x316b3d);}else{var _0x25aa1d=this;utils[_0x46a2('0x3b')](this[_0x46a2('0xe')],_0x57fdfe,function(_0x160efd){_0x25aa1d[_0x46a2('0x29')](_0x46a2('0xa'),_0x160efd);});}};EmailImap['prototype'][_0x46a2('0x33')]=function(){this[_0x46a2('0x13')][_0x46a2('0x34')](!![],this[_0x46a2('0x2c')][_0x46a2('0x12')](this));};EmailImap[_0x46a2('0x1a')][_0x46a2('0x3c')]=function(_0x27cd37){this[_0x46a2('0x17')](_0x27cd37);this[_0x46a2('0x13')]['closeBox'](!![],this[_0x46a2('0x2c')][_0x46a2('0x12')](this));};EmailImap[_0x46a2('0x1a')][_0x46a2('0x15')]=function(){this['emit'](_0x46a2('0x14'));};EmailImap[_0x46a2('0x1a')][_0x46a2('0x17')]=function(_0x3869d4,_0x1fcc03){logger['error'](_0x46a2('0x17'),this['account'][_0x46a2('0xa')],JSON[_0x46a2('0x3d')](_0x3869d4));var _0x5df93d='';if(_0x3869d4){if(_0x3869d4[_0x46a2('0x3e')]){_0x5df93d=_0x3869d4[_0x46a2('0x3e')];}else{for(var _0xc8b7f0 in _0x3869d4){if(_0x3869d4[_0x46a2('0x3f')](_0xc8b7f0)){_0x5df93d+=_[_0x46a2('0x40')](_0xc8b7f0)+':\x20'+_0x3869d4[_0xc8b7f0]+'\x0a';}}}}if(_0x1fcc03){this[_0x46a2('0x13')][_0x46a2('0x14')]();}else{this[_0x46a2('0x29')](_0x46a2('0x16'),_0x5df93d);this[_0x46a2('0x29')]('end');}};module[_0x46a2('0x41')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index e249b47..1905686 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 _0x5cda=['nodemailer','bluebird','send','use','compile','sendMail','toString','prototype','verify','Not\x20verifired','exports'];(function(_0x3c4f1f,_0x20d3ec){var _0x19cb69=function(_0x2e04bc){while(--_0x2e04bc){_0x3c4f1f['push'](_0x3c4f1f['shift']());}};_0x19cb69(++_0x20d3ec);}(_0x5cda,0xa5));var _0xa5cd=function(_0x499029,_0xa41dab){_0x499029=_0x499029-0x0;var _0xea8b32=_0x5cda[_0x499029];return _0xea8b32;};'use strict';var nodemailer=require(_0xa5cd('0x0'));var BPromise=require(_0xa5cd('0x1'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp['prototype'][_0xa5cd('0x2')]=function(_0xd11475,_0x6eb336){return new BPromise(function(_0x452d3f,_0x5688bc){var _0x4b79ed=nodemailer['createTransport'](_0xd11475);_0x4b79ed[_0xa5cd('0x3')](_0xa5cd('0x4'),inlineBase64());_0x4b79ed[_0xa5cd('0x5')](_0x6eb336,function(_0x80f7bc,_0x166a33){if(_0x80f7bc){_0x5688bc(_0x80f7bc[_0xa5cd('0x6')]());}else{_0x452d3f(_0x166a33);}});});};EmailSmtp[_0xa5cd('0x7')]['verify']=function(_0x41f168){return new BPromise(function(_0x3e3d11,_0x5e2cb1){var _0x42bbf3=nodemailer['createTransport'](_0x41f168);_0x42bbf3[_0xa5cd('0x8')](function(_0x15a546,_0x51d94f){if(_0x15a546){_0x5e2cb1(_0x15a546[_0xa5cd('0x6')]());}else{if(_0x51d94f){_0x3e3d11(_0x51d94f);}else{_0x5e2cb1(_0xa5cd('0x9'));}}});});};module[_0xa5cd('0xa')]=EmailSmtp; \ No newline at end of file +var _0xf21e=['toString','prototype','verify','Not\x20verifired','exports','nodemailer','bluebird','nodemailer-plugin-inline-base64','send','compile'];(function(_0xab8ffa,_0x29179d){var _0x173c69=function(_0x595e6e){while(--_0x595e6e){_0xab8ffa['push'](_0xab8ffa['shift']());}};_0x173c69(++_0x29179d);}(_0xf21e,0x14f));var _0xef21=function(_0x45f293,_0x24182f){_0x45f293=_0x45f293-0x0;var _0x544727=_0xf21e[_0x45f293];return _0x544727;};'use strict';var nodemailer=require(_0xef21('0x0'));var BPromise=require(_0xef21('0x1'));var inlineBase64=require(_0xef21('0x2'));function EmailSmtp(){}EmailSmtp['prototype'][_0xef21('0x3')]=function(_0xac1318,_0x185a54){return new BPromise(function(_0x319e56,_0x1d926e){var _0x5eda1a=nodemailer['createTransport'](_0xac1318);_0x5eda1a['use'](_0xef21('0x4'),inlineBase64());_0x5eda1a['sendMail'](_0x185a54,function(_0x423ed2,_0x181663){if(_0x423ed2){_0x1d926e(_0x423ed2[_0xef21('0x5')]());}else{_0x319e56(_0x181663);}});});};EmailSmtp[_0xef21('0x6')]['verify']=function(_0x1fa012){return new BPromise(function(_0x525888,_0xe3314){var _0x29e9a2=nodemailer['createTransport'](_0x1fa012);_0x29e9a2[_0xef21('0x7')](function(_0x59c7dd,_0x5dd7a1){if(_0x59c7dd){_0xe3314(_0x59c7dd[_0xef21('0x5')]());}else{if(_0x5dd7a1){_0x525888(_0x5dd7a1);}else{_0xe3314(_0xef21('0x8'));}}});});};module[_0xef21('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 6c80b37..f392511 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 _0x1a85=['Empty\x20message

','Attachments','Title','Data','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','outlook.office365.com','127.0.0.1','randomstring','path','util','email','../../../config/environment','head','address','anonymous','generate','value','name','split','length','slice','join','Anonymous','pop','isEmpty','@xcally.com','html','test','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml'];(function(_0x6eba65,_0x1c4afa){var _0x4fe862=function(_0x51cd30){while(--_0x51cd30){_0x6eba65['push'](_0x6eba65['shift']());}};_0x4fe862(++_0x1c4afa);}(_0x1a85,0x178));var _0x51a8=function(_0x52fd3d,_0x3af718){_0x52fd3d=_0x52fd3d-0x0;var _0x49b06d=_0x1a85[_0x52fd3d];return _0x49b06d;};'use strict';var _=require('lodash');var moment=require('moment');var random=require(_0x51a8('0x0'));var fs=require('fs');var path=require(_0x51a8('0x1'));var util=require(_0x51a8('0x2'));var tnef=require('node-tnef');var logger=require('../../../config/logger')(_0x51a8('0x3'));var config=require(_0x51a8('0x4'));function getAddress(_0x99e371){var _0x48a21b=_[_0x51a8('0x5')](_0x99e371['value']);return _0x48a21b&&_0x48a21b[_0x51a8('0x6')]?_0x48a21b['address']:_0x51a8('0x7')+random[_0x51a8('0x8')](0x6)+'@xcally.com';}function getFirstName(_0x228c64){var _0x513685=_['head'](_0x228c64[_0x51a8('0x9')]);if(_0x513685&&_0x513685[_0x51a8('0xa')]){var _0x1a476d=_0x513685[_0x51a8('0xa')][_0x51a8('0xb')](/\s+/);return _0x1a476d[_0x51a8('0xc')]?_0x1a476d[_0x51a8('0xd')](0x0,-0x1)[_0x51a8('0xe')]('\x20'):_0x513685[_0x51a8('0xa')];}return _0x51a8('0xf');}function getLastName(_0xc7c203){var _0xc46d7=_[_0x51a8('0x5')](_0xc7c203[_0x51a8('0x9')]);if(_0xc46d7&&_0xc46d7[_0x51a8('0xa')]){var _0x2e1629=_0xc46d7[_0x51a8('0xa')]['split'](/\s+/);return _0x2e1629[_0x51a8('0xc')]>0x1?_0x2e1629[_0x51a8('0x10')]():'';}return'';}function getMails(_0xaec066,_0x50d992){var _0xf4eb6e='';for(var _0x547d40=0x0;_0x547d40<_0x50d992[_0x51a8('0x9')][_0x51a8('0xc')];_0x547d40+=0x1){if(_0x50d992[_0x51a8('0x9')][_0x547d40][_0x51a8('0x6')]!==_0xaec066){if(!_[_0x51a8('0x11')](_0xf4eb6e)){_0xf4eb6e+=',';}_0xf4eb6e+=_0x50d992[_0x51a8('0x9')][_0x547d40][_0x51a8('0xa')]||_0x50d992['value'][_0x547d40][_0x51a8('0x6')]||'';_0xf4eb6e+='\x20<';_0xf4eb6e+=_0x50d992[_0x51a8('0x9')][_0x547d40][_0x51a8('0x6')]?_0x50d992[_0x51a8('0x9')][_0x547d40][_0x51a8('0x6')]:_0x51a8('0x7')+random['generate'](0x6)+_0x51a8('0x12');_0xf4eb6e+='>';}}return _0xf4eb6e;}function parseEmail(_0x3b7e7e,_0x2217ce,_0x2f2681){if(_0x2217ce[_0x51a8('0x13')]){var _0x3bc044=/)<[^<]*)*<\/script>/gi;while(_0x3bc044[_0x51a8('0x14')](_0x2217ce[_0x51a8('0x13')])){_0x2217ce['html']=_0x2217ce[_0x51a8('0x13')]['replace'](_0x3bc044,'');}if(_0x2217ce[_0x51a8('0x13')][_0x51a8('0x15')](_0x51a8('0x16'))){var _0x3759d6=[];_0x2217ce['attachments'][_0x51a8('0x17')](_0x4b9cdd=>{_0x3759d6['push'](_0x4b9cdd[_0x51a8('0x18')]);});var _0x52e503=/]+>/g;var _0x384d25=/src=\"data:image\/([a-zA-Z]*);base64,([^\"]*)\"/g;var _0x78d3d6=_0x2217ce[_0x51a8('0x13')][_0x51a8('0x19')](_0x384d25,_0x51a8('0x1a'));var _0x2f2f05=_0x78d3d6[_0x51a8('0x19')](_0x52e503,_0x51a8('0x1b'));for(let _0x5b3f49=0x0;_0x5b3f49<_0x3759d6[_0x51a8('0xc')];_0x5b3f49++){var _0x1b7577=_0x2f2f05[_0x51a8('0x19')](_0x51a8('0x1b'),_0x51a8('0x1c')+_0x3759d6[_0x5b3f49]+_0x51a8('0x1d'));_0x2f2f05=_0x1b7577;}_0x2217ce[_0x51a8('0x13')]=_0x2f2f05;}_0x2f2681[_0x51a8('0x1e')]=_0x2217ce[_0x51a8('0x13')];}else{_0x2f2681[_0x51a8('0x1e')]=_0x2217ce[_0x51a8('0x1f')];}if(_0x2f2681[_0x51a8('0x1e')]){_0x2f2681['body']=_0x2f2681[_0x51a8('0x1e')]['replace'](/\x20[Attachment:\x20','\x20]','body','message','originTo','email','originCc','bcc','attachments','attachment','attachment-','join','root','server/files/attachments/','writeFileSync','content','contentType','parser','from','subject','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','textAsHtml','filter','application/ms-tnef','parseBuffer','

Empty\x20message

','Attachments','getHost','gmail','yahoo','imap.mail.yahoo.com','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','randomstring','util','node-tnef'];(function(_0x49b9b9,_0x1aa38b){var _0x3ce3c8=function(_0x51dcdb){while(--_0x51dcdb){_0x49b9b9['push'](_0x49b9b9['shift']());}};_0x3ce3c8(++_0x1aa38b);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x8e3f[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xf8e3('0x0'));var moment=require(_0xf8e3('0x1'));var random=require(_0xf8e3('0x2'));var fs=require('fs');var path=require('path');var util=require(_0xf8e3('0x3'));var tnef=require(_0xf8e3('0x4'));var logger=require(_0xf8e3('0x5'))('email');var config=require(_0xf8e3('0x6'));function getAddress(_0x41bc05){var _0x4dab56=_[_0xf8e3('0x7')](_0x41bc05[_0xf8e3('0x8')]);return _0x4dab56&&_0x4dab56[_0xf8e3('0x9')]?_0x4dab56[_0xf8e3('0x9')]:'anonymous'+random[_0xf8e3('0xa')](0x6)+_0xf8e3('0xb');}function getFirstName(_0x17f56c){var _0x95ad03=_[_0xf8e3('0x7')](_0x17f56c[_0xf8e3('0x8')]);if(_0x95ad03&&_0x95ad03[_0xf8e3('0xc')]){var _0x2a3b59=_0x95ad03[_0xf8e3('0xc')][_0xf8e3('0xd')](/\s+/);return _0x2a3b59[_0xf8e3('0xe')]?_0x2a3b59[_0xf8e3('0xf')](0x0,-0x1)['join']('\x20'):_0x95ad03[_0xf8e3('0xc')];}return _0xf8e3('0x10');}function getLastName(_0x3b6ac6){var _0x4888eb=_[_0xf8e3('0x7')](_0x3b6ac6[_0xf8e3('0x8')]);if(_0x4888eb&&_0x4888eb[_0xf8e3('0xc')]){var _0xd73686=_0x4888eb['name'][_0xf8e3('0xd')](/\s+/);return _0xd73686[_0xf8e3('0xe')]>0x1?_0xd73686[_0xf8e3('0x11')]():'';}return'';}function getMails(_0x4af736,_0x44f631){var _0x5136c6='';for(var _0x1ec773=0x0;_0x1ec773<_0x44f631[_0xf8e3('0x8')][_0xf8e3('0xe')];_0x1ec773+=0x1){if(_0x44f631['value'][_0x1ec773]['address']!==_0x4af736){if(!_[_0xf8e3('0x12')](_0x5136c6)){_0x5136c6+=',';}_0x5136c6+=_0x44f631[_0xf8e3('0x8')][_0x1ec773][_0xf8e3('0xc')]||_0x44f631[_0xf8e3('0x8')][_0x1ec773][_0xf8e3('0x9')]||'';_0x5136c6+='\x20<';_0x5136c6+=_0x44f631[_0xf8e3('0x8')][_0x1ec773][_0xf8e3('0x9')]?_0x44f631[_0xf8e3('0x8')][_0x1ec773][_0xf8e3('0x9')]:_0xf8e3('0x13')+random['generate'](0x6)+_0xf8e3('0xb');_0x5136c6+='>';}}return _0x5136c6;}function parseEmail(_0x3638f8,_0x24e8d6,_0x31f55d){if(_0x24e8d6[_0xf8e3('0x14')]){var _0x11c58e=/)<[^<]*)*<\/script>/gi;while(_0x11c58e[_0xf8e3('0x15')](_0x24e8d6[_0xf8e3('0x14')])){_0x24e8d6['html']=_0x24e8d6[_0xf8e3('0x14')][_0xf8e3('0x16')](_0x11c58e,'');}if(_0x24e8d6[_0xf8e3('0x14')][_0xf8e3('0x17')]('{_0x39df34[_0xf8e3('0x19')](_0x225a1b[_0xf8e3('0x1a')]);});var _0x1f4b68=/]+>/g;var _0x3ac384=/src=\"data:image\/([a-zA-Z]*);base64,([^\"]*)\"/g;var _0x512a83=_0x24e8d6[_0xf8e3('0x14')][_0xf8e3('0x16')](_0x3ac384,_0xf8e3('0x1b'));var _0x417b42=_0x512a83[_0xf8e3('0x16')](_0x1f4b68,_0xf8e3('0x1c'));for(let _0x2963ed=0x0;_0x2963ed<_0x39df34[_0xf8e3('0xe')];_0x2963ed++){var _0x56fa8e=_0x417b42[_0xf8e3('0x16')](_0xf8e3('0x1c'),_0xf8e3('0x1d')+_0x39df34[_0x2963ed]+_0xf8e3('0x1e'));_0x417b42=_0x56fa8e;}_0x24e8d6[_0xf8e3('0x14')]=_0x417b42;}_0x31f55d[_0xf8e3('0x1f')]=_0x24e8d6[_0xf8e3('0x14')];}else{_0x31f55d[_0xf8e3('0x1f')]=_0x24e8d6['textAsHtml'];}if(_0x31f55d[_0xf8e3('0x1f')]){_0x31f55d[_0xf8e3('0x1f')]=_0x31f55d[_0xf8e3('0x1f')][_0xf8e3('0x16')](/0x0){if(this[_0x1fe675+_0x81da('0x25')]>0x0&&this[_0x1fe675+_0x81da('0x24')]>=this[_0x1fe675+_0x81da('0x25')]){return _0x81da('0x26');}else{return _0x81da('0x27');}}else{return _0x81da('0x28');}};Agent[_0x81da('0x22')]['updateRealtime']=function(){var _0x117d72=[_0x81da('0x29'),'chat',_0x81da('0x2a'),_0x81da('0x2b'),_0x81da('0x2c'),_0x81da('0x2d')];for(var _0x265ec0=0x0;_0x265ec0<_0x117d72['length'];_0x265ec0+=0x1){var _0x266688=this['getChannelStatus'](_0x117d72[_0x265ec0]);if(this[_0x117d72[_0x265ec0]+_0x81da('0x2e')]!==_0x266688){this[_0x117d72[_0x265ec0]+_0x81da('0x2f')]=_['toNumber'](moment()[_0x81da('0x30')]('x'));}this[_0x117d72[_0x265ec0]+_0x81da('0x2e')]=_0x266688;}var _0xaa05e5={'id':this['id'],'name':this[_0x81da('0x7')],'online':this[_0x81da('0x8')],'voicePause':this[_0x81da('0x9')],'chatPause':this['chatPause'],'mailPause':this[_0x81da('0xb')],'smsPause':this[_0x81da('0xd')],'faxPause':this['faxPause'],'openchannelPause':this[_0x81da('0xe')],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0x81da('0x31')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0x81da('0x32')],'mailStatus':this[_0x81da('0x33')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0x81da('0x13')],'mailCurrentCapacity':this[_0x81da('0x14')],'faxStatus':this[_0x81da('0x34')],'faxStatusTime':this[_0x81da('0x15')],'faxCapacity':this[_0x81da('0x16')],'faxCurrentCapacity':this[_0x81da('0x17')],'smsStatus':this[_0x81da('0x18')],'smsStatusTime':this[_0x81da('0x19')],'smsCapacity':this[_0x81da('0x1a')],'smsCurrentCapacity':this[_0x81da('0x35')],'whatsappStatus':this[_0x81da('0x1b')],'whatsappStatusTime':this[_0x81da('0x36')],'whatsappCapacity':this[_0x81da('0x1c')],'whatsappCurrentCapacity':this[_0x81da('0x37')],'openchannelStatus':this[_0x81da('0x1d')],'openchannelStatusTime':this[_0x81da('0x1e')],'openchannelCapacity':this[_0x81da('0x1f')],'openchannelCurrentCapacity':this[_0x81da('0x20')],'busy':this['busy'],'busyQueue':this[_0x81da('0x21')]};var _0x14b293=md5(JSON[_0x81da('0x38')](_0xaa05e5));if(this[_0x81da('0x2')]!==_0x14b293){this[_0x81da('0x2')]=_0x14b293;io[_0x81da('0x39')](_0x81da('0x3a'),_0xaa05e5);}};module[_0x81da('0x3b')]=Agent; \ No newline at end of file +var _0xa2c2=['chatStatus','unknown','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','updateRealtime','prototype','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','openchannel','sms','whatsapp','length','getChannelStatus','StatusTime','format','chatPause','mailCurrentCapacity','smsStatusTime','whatsappCurrentCapacity','openchannelStatus','stringify','user:save','lodash','moment','md5','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','mailPause','faxPause','smsPause','openchannelPause'];(function(_0xd0ebcd,_0x37863c){var _0x1204fa=function(_0x5ce51c){while(--_0x5ce51c){_0xd0ebcd['push'](_0xd0ebcd['shift']());}};_0x1204fa(++_0x37863c);}(_0xa2c2,0xa0));var _0x2a2c=function(_0x2ab14a,_0x200373){_0x2ab14a=_0x2ab14a-0x0;var _0x3698c9=_0xa2c2[_0x2ab14a];return _0x3698c9;};'use strict';var _=require(_0x2a2c('0x0'));var moment=require(_0x2a2c('0x1'));var md5=require(_0x2a2c('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x2a2c('0x3')]=_[_0x2a2c('0x4')](config[_0x2a2c('0x3')],{'host':_0x2a2c('0x5'),'port':0x18eb});var io=require(_0x2a2c('0x6'))(new Redis(config[_0x2a2c('0x3')]));function Agent(_0x1d2cff){this['id']=_0x1d2cff['id']||0x0;this[_0x2a2c('0x7')]=_0x1d2cff[_0x2a2c('0x7')]||'';this[_0x2a2c('0x8')]=_0x1d2cff[_0x2a2c('0x8')]||!![];this[_0x2a2c('0x9')]=_0x1d2cff[_0x2a2c('0x9')]||![];this['chatPause']=_0x1d2cff['chatPause']||![];this[_0x2a2c('0xa')]=_0x1d2cff[_0x2a2c('0xa')]||![];this[_0x2a2c('0xb')]=_0x1d2cff[_0x2a2c('0xb')]||![];this['smsPause']=_0x1d2cff[_0x2a2c('0xc')]||![];this['openchannelPause']=_0x1d2cff[_0x2a2c('0xd')]||![];this[_0x2a2c('0xe')]=_0x2a2c('0xf');this['chatStatusTime']=0x0;this[_0x2a2c('0x10')]=_0x1d2cff[_0x2a2c('0x10')]||0x0;this[_0x2a2c('0x11')]=0x0;this[_0x2a2c('0x12')]=_0x2a2c('0xf');this[_0x2a2c('0x13')]=0x0;this[_0x2a2c('0x14')]=_0x1d2cff[_0x2a2c('0x14')]||0x0;this['mailCurrentCapacity']=0x0;this[_0x2a2c('0x15')]=_0x2a2c('0xf');this[_0x2a2c('0x16')]=0x0;this[_0x2a2c('0x17')]=_0x1d2cff[_0x2a2c('0x17')]||0x0;this[_0x2a2c('0x18')]=0x0;this[_0x2a2c('0x19')]=_0x2a2c('0xf');this['smsStatusTime']=0x0;this['smsCapacity']=_0x1d2cff[_0x2a2c('0x1a')]||0x0;this[_0x2a2c('0x1b')]=0x0;this[_0x2a2c('0x1c')]='unknown';this[_0x2a2c('0x1d')]=0x0;this['whatsappCapacity']=_0x1d2cff[_0x2a2c('0x1e')]||0x0;this['whatsappCurrentCapacity']=0x0;this['openchannelStatus']='unknown';this[_0x2a2c('0x1f')]=0x0;this[_0x2a2c('0x20')]=_0x1d2cff['openchannelCapacity']||0x0;this[_0x2a2c('0x21')]=0x0;this[_0x2a2c('0x22')]=![];this[_0x2a2c('0x23')]=undefined;this[_0x2a2c('0x2')]='';this[_0x2a2c('0x24')]();}Agent[_0x2a2c('0x25')]['getChannelStatus']=function(_0x22d040){if(this[_0x22d040+_0x2a2c('0x26')]>0x0){if(this[_0x22d040+_0x2a2c('0x27')]>0x0&&this[_0x22d040+_0x2a2c('0x26')]>=this[_0x22d040+'Capacity']){return _0x2a2c('0x28');}else{return _0x2a2c('0x29');}}else{return _0x2a2c('0x2a');}};Agent['prototype'][_0x2a2c('0x24')]=function(){var _0x1add7c=[_0x2a2c('0x2b'),'chat',_0x2a2c('0x2c'),'fax',_0x2a2c('0x2d'),_0x2a2c('0x2e')];for(var _0x5a6969=0x0;_0x5a6969<_0x1add7c[_0x2a2c('0x2f')];_0x5a6969+=0x1){var _0x2ef073=this[_0x2a2c('0x30')](_0x1add7c[_0x5a6969]);if(this[_0x1add7c[_0x5a6969]+'Status']!==_0x2ef073){this[_0x1add7c[_0x5a6969]+_0x2a2c('0x31')]=_['toNumber'](moment()[_0x2a2c('0x32')]('x'));}this[_0x1add7c[_0x5a6969]+'Status']=_0x2ef073;}var _0x4cbd38={'id':this['id'],'name':this['name'],'online':this[_0x2a2c('0x8')],'voicePause':this[_0x2a2c('0x9')],'chatPause':this[_0x2a2c('0x33')],'mailPause':this[_0x2a2c('0xa')],'smsPause':this[_0x2a2c('0xc')],'faxPause':this[_0x2a2c('0xb')],'openchannelPause':this[_0x2a2c('0xd')],'chatStatus':this[_0x2a2c('0xe')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x2a2c('0x10')],'chatCurrentCapacity':this[_0x2a2c('0x11')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0x2a2c('0x13')],'mailCapacity':this[_0x2a2c('0x14')],'mailCurrentCapacity':this[_0x2a2c('0x34')],'faxStatus':this['faxStatus'],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0x2a2c('0x17')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0x2a2c('0x19')],'smsStatusTime':this[_0x2a2c('0x35')],'smsCapacity':this[_0x2a2c('0x1a')],'smsCurrentCapacity':this[_0x2a2c('0x1b')],'whatsappStatus':this[_0x2a2c('0x1c')],'whatsappStatusTime':this[_0x2a2c('0x1d')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0x2a2c('0x36')],'openchannelStatus':this[_0x2a2c('0x37')],'openchannelStatusTime':this[_0x2a2c('0x1f')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0x2a2c('0x21')],'busy':this['busy'],'busyQueue':this['busyQueue']};var _0x57ba4c=md5(JSON[_0x2a2c('0x38')](_0x4cbd38));if(this[_0x2a2c('0x2')]!==_0x57ba4c){this[_0x2a2c('0x2')]=_0x57ba4c;io['emit'](_0x2a2c('0x39'),_0x4cbd38);}};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 583d9ef..f178d18 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 _0x79a0=['md5','util','redis','defaults','localhost','name','timeout','strategy','Agents','mapAgentsId','updateRouting','prototype','_rr','map','updateRealtime','loggedIn','paused','length','online','available','waiting','stringify','chat:queue:%s','emit','chat_queue:save','lodash'];(function(_0x130e28,_0x2a818c){var _0x53fde5=function(_0x35697e){while(--_0x35697e){_0x130e28['push'](_0x130e28['shift']());}};_0x53fde5(++_0x2a818c);}(_0x79a0,0x1b9));var _0x079a=function(_0x54d0bd,_0x256a7e){_0x54d0bd=_0x54d0bd-0x0;var _0x4f9107=_0x79a0[_0x54d0bd];return _0x4f9107;};'use strict';var _=require(_0x079a('0x0'));var md5=require(_0x079a('0x1'));var util=require(_0x079a('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x079a('0x3')]=_[_0x079a('0x4')](config[_0x079a('0x3')],{'host':_0x079a('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x079a('0x3')]));function ChatQueue(_0x1fe2f8){this['id']=_0x1fe2f8['id']||0x0;this[_0x079a('0x6')]=_0x1fe2f8[_0x079a('0x6')]||'';this[_0x079a('0x7')]=_0x1fe2f8[_0x079a('0x7')]||0xa;this['strategy']=_0x1fe2f8[_0x079a('0x8')]||'beepall';this[_0x079a('0x9')]=_0x1fe2f8[_0x079a('0x9')];this[_0x079a('0xa')]={};this['waiting']=0x0;this[_0x079a('0x1')]='';this[_0x079a('0xb')]();this['updateRealtime']();}ChatQueue[_0x079a('0xc')]['updateRouting']=function(){var _0x2fcad=this[_0x079a('0xa')][_0x079a('0xd')];this[_0x079a('0xa')]=_[_0x079a('0xe')](this[_0x079a('0x9')],'id');this[_0x079a('0xa')]['_rr']=_0x2fcad;};ChatQueue[_0x079a('0xc')][_0x079a('0xf')]=function(){this[_0x079a('0x10')]=0x0;this[_0x079a('0x11')]=0x0;for(var _0x58ed45=0x0;_0x58ed45=0x0?this[_0x079a('0x14')]:0x0;var _0x4ea656={'id':this['id'],'available':this[_0x079a('0x14')],'loggedIn':this['loggedIn'],'name':this[_0x079a('0x6')],'paused':this[_0x079a('0x11')],'waiting':this[_0x079a('0x15')]};var _0x1f717e=md5(JSON[_0x079a('0x16')](_0x4ea656));if(this['md5']!==_0x1f717e){this[_0x079a('0x1')]=_0x1f717e;io['to'](util['format'](_0x079a('0x17'),_0x4ea656[_0x079a('0x6')]))[_0x079a('0x18')](_0x079a('0x19'),_0x4ea656);}};module['exports']=ChatQueue; \ No newline at end of file +var _0xbba6=['loggedIn','paused','online','available','waiting','stringify','format','chat:queue:%s','emit','exports','lodash','md5','util','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','map','_rr'];(function(_0x431117,_0x4fd94b){var _0x54cb9a=function(_0x2a64c7){while(--_0x2a64c7){_0x431117['push'](_0x431117['shift']());}};_0x54cb9a(++_0x4fd94b);}(_0xbba6,0x1e6));var _0x6bba=function(_0x54d153,_0x284eb2){_0x54d153=_0x54d153-0x0;var _0x2ee5b7=_0xbba6[_0x54d153];return _0x2ee5b7;};'use strict';var _=require(_0x6bba('0x0'));var md5=require(_0x6bba('0x1'));var util=require(_0x6bba('0x2'));var Redis=require('ioredis');var config=require(_0x6bba('0x3'));config[_0x6bba('0x4')]=_[_0x6bba('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x6bba('0x6'))(new Redis(config[_0x6bba('0x4')]));function ChatQueue(_0x1ce930){this['id']=_0x1ce930['id']||0x0;this[_0x6bba('0x7')]=_0x1ce930['name']||'';this[_0x6bba('0x8')]=_0x1ce930[_0x6bba('0x8')]||0xa;this[_0x6bba('0x9')]=_0x1ce930[_0x6bba('0x9')]||_0x6bba('0xa');this['Agents']=_0x1ce930[_0x6bba('0xb')];this[_0x6bba('0xc')]={};this['waiting']=0x0;this[_0x6bba('0x1')]='';this[_0x6bba('0xd')]();this[_0x6bba('0xe')]();}ChatQueue[_0x6bba('0xf')][_0x6bba('0xd')]=function(){var _0x4366dd=this[_0x6bba('0xc')]['_rr'];this['mapAgentsId']=_[_0x6bba('0x10')](this['Agents'],'id');this[_0x6bba('0xc')][_0x6bba('0x11')]=_0x4366dd;};ChatQueue[_0x6bba('0xf')][_0x6bba('0xe')]=function(){this[_0x6bba('0x12')]=0x0;this[_0x6bba('0x13')]=0x0;for(var _0x2171c9=0x0;_0x2171c9=0x0?this[_0x6bba('0x15')]:0x0;var _0x57010e={'id':this['id'],'available':this['available'],'loggedIn':this[_0x6bba('0x12')],'name':this[_0x6bba('0x7')],'paused':this[_0x6bba('0x13')],'waiting':this[_0x6bba('0x16')]};var _0xf69a45=md5(JSON[_0x6bba('0x17')](_0x57010e));if(this[_0x6bba('0x1')]!==_0xf69a45){this['md5']=_0xf69a45;io['to'](util[_0x6bba('0x18')](_0x6bba('0x19'),_0x57010e[_0x6bba('0x7')]))[_0x6bba('0x1a')]('chat_queue:save',_0x57010e);}};module[_0x6bba('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 f16c40e..7d59ae2 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 _0xc003=['Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','_rr','paused','length','online','faxPause','loggedIn','available','format','fax:queue:%s','fax_queue:save','md5','util','defaults','redis','localhost','name','timeout','strategy','beepall'];(function(_0x569ba0,_0x52f552){var _0x33c118=function(_0xa33691){while(--_0xa33691){_0x569ba0['push'](_0x569ba0['shift']());}};_0x33c118(++_0x52f552);}(_0xc003,0x197));var _0x3c00=function(_0x5b2a8f,_0x34cd2d){_0x5b2a8f=_0x5b2a8f-0x0;var _0x104354=_0xc003[_0x5b2a8f];return _0x104354;};'use strict';var _=require('lodash');var md5=require(_0x3c00('0x0'));var util=require(_0x3c00('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_[_0x3c00('0x2')](config[_0x3c00('0x3')],{'host':_0x3c00('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3c00('0x3')]));function FaxQueue(_0x28cf99){this['id']=_0x28cf99['id']||0x0;this[_0x3c00('0x5')]=_0x28cf99[_0x3c00('0x5')]||'';this['timeout']=_0x28cf99[_0x3c00('0x6')]||0xa;this[_0x3c00('0x7')]=_0x28cf99[_0x3c00('0x7')]||_0x3c00('0x8');this[_0x3c00('0x9')]=_0x28cf99[_0x3c00('0x9')];this[_0x3c00('0xa')]={};this[_0x3c00('0xb')]=0x0;this[_0x3c00('0x0')]='';this[_0x3c00('0xc')]();this[_0x3c00('0xd')]();}FaxQueue[_0x3c00('0xe')][_0x3c00('0xc')]=function(){var _0x282c34=this[_0x3c00('0xa')]['_rr'];this[_0x3c00('0xa')]=_[_0x3c00('0xf')](this[_0x3c00('0x9')],'id');this[_0x3c00('0xa')][_0x3c00('0x10')]=_0x282c34;};FaxQueue[_0x3c00('0xe')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x3c00('0x11')]=0x0;for(var _0x5d829d=0x0;_0x5d829d=0x0?this[_0x3c00('0x16')]:0x0;var _0x4a74fc={'id':this['id'],'available':this[_0x3c00('0x16')],'loggedIn':this[_0x3c00('0x15')],'name':this['name'],'paused':this[_0x3c00('0x11')],'waiting':this[_0x3c00('0xb')]};var _0x5cab4c=md5(JSON['stringify'](_0x4a74fc));if(this[_0x3c00('0x0')]!==_0x5cab4c){this['md5']=_0x5cab4c;io['to'](util[_0x3c00('0x17')](_0x3c00('0x18'),_0x4a74fc[_0x3c00('0x5')]))['emit'](_0x3c00('0x19'),_0x4a74fc);}};module['exports']=FaxQueue; \ No newline at end of file +var _0xec7b=['waiting','updateRouting','updateRealtime','mapAgentsId','_rr','map','length','loggedIn','faxPause','paused','available','fax:queue:%s','emit','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','strategy','Agents'];(function(_0x4fdb79,_0x12c116){var _0x3ec15b=function(_0x50c82e){while(--_0x50c82e){_0x4fdb79['push'](_0x4fdb79['shift']());}};_0x3ec15b(++_0x12c116);}(_0xec7b,0xd6));var _0xbec7=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xec7b[_0x4dbaad];return _0x226c72;};'use strict';var _=require('lodash');var md5=require(_0xbec7('0x0'));var util=require(_0xbec7('0x1'));var Redis=require(_0xbec7('0x2'));var config=require(_0xbec7('0x3'));config[_0xbec7('0x4')]=_[_0xbec7('0x5')](config[_0xbec7('0x4')],{'host':_0xbec7('0x6'),'port':0x18eb});var io=require(_0xbec7('0x7'))(new Redis(config['redis']));function FaxQueue(_0x170c1a){this['id']=_0x170c1a['id']||0x0;this[_0xbec7('0x8')]=_0x170c1a[_0xbec7('0x8')]||'';this['timeout']=_0x170c1a['timeout']||0xa;this['strategy']=_0x170c1a[_0xbec7('0x9')]||'beepall';this[_0xbec7('0xa')]=_0x170c1a[_0xbec7('0xa')];this['mapAgentsId']={};this[_0xbec7('0xb')]=0x0;this[_0xbec7('0x0')]='';this[_0xbec7('0xc')]();this[_0xbec7('0xd')]();}FaxQueue['prototype'][_0xbec7('0xc')]=function(){var _0x4e4be4=this[_0xbec7('0xe')][_0xbec7('0xf')];this[_0xbec7('0xe')]=_[_0xbec7('0x10')](this[_0xbec7('0xa')],'id');this[_0xbec7('0xe')][_0xbec7('0xf')]=_0x4e4be4;};FaxQueue['prototype'][_0xbec7('0xd')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x94751a=0x0;_0x94751a=0x0?this['available']:0x0;var _0x389b4f={'id':this['id'],'available':this[_0xbec7('0x15')],'loggedIn':this[_0xbec7('0x12')],'name':this[_0xbec7('0x8')],'paused':this[_0xbec7('0x14')],'waiting':this['waiting']};var _0x30b3e5=md5(JSON['stringify'](_0x389b4f));if(this[_0xbec7('0x0')]!==_0x30b3e5){this[_0xbec7('0x0')]=_0x30b3e5;io['to'](util['format'](_0xbec7('0x16'),_0x389b4f[_0xbec7('0x8')]))[_0xbec7('0x17')]('fax_queue:save',_0x389b4f);}};module[_0xbec7('0x18')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 3815e1a..55b877f 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 _0xe964=['Intervals'];(function(_0x1dbb21,_0x3e649f){var _0x53d001=function(_0x26b8e6){while(--_0x26b8e6){_0x1dbb21['push'](_0x1dbb21['shift']());}};_0x53d001(++_0x3e649f);}(_0xe964,0x9f));var _0x4e96=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe964[_0x3dd15e];return _0x231fd0;};'use strict';function Interval(_0xf67cf3){this['id']=_0xf67cf3['id']||0x0;this['name']=_0xf67cf3['name']||'';this[_0x4e96('0x0')]=_0xf67cf3[_0x4e96('0x0')]||{};}module['exports']=Interval; \ No newline at end of file +var _0x0955=['name','Intervals','exports'];(function(_0x413684,_0x18dcd3){var _0x25bb16=function(_0xae5054){while(--_0xae5054){_0x413684['push'](_0x413684['shift']());}};_0x25bb16(++_0x18dcd3);}(_0x0955,0x18c));var _0x5095=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0x0955[_0x411017];return _0x2adeea;};'use strict';function Interval(_0x1289aa){this['id']=_0x1289aa['id']||0x0;this[_0x5095('0x0')]=_0x1289aa['name']||'';this[_0x5095('0x1')]=_0x1289aa[_0x5095('0x1')]||{};}module[_0x5095('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 5f404a0..4066357 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 _0xac51=['beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','_rr','updateRealtime','loggedIn','length','online','mailPause','paused','available','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy'];(function(_0x18cf20,_0xf30f84){var _0x36ceb2=function(_0x4d401d){while(--_0x4d401d){_0x18cf20['push'](_0x18cf20['shift']());}};_0x36ceb2(++_0xf30f84);}(_0xac51,0x1b7));var _0x1ac5=function(_0x2f3923,_0x15eb6d){_0x2f3923=_0x2f3923-0x0;var _0x2ebbae=_0xac51[_0x2f3923];return _0x2ebbae;};'use strict';var _=require(_0x1ac5('0x0'));var md5=require(_0x1ac5('0x1'));var util=require(_0x1ac5('0x2'));var Redis=require(_0x1ac5('0x3'));var config=require(_0x1ac5('0x4'));config['redis']=_['defaults'](config[_0x1ac5('0x5')],{'host':_0x1ac5('0x6'),'port':0x18eb});var io=require(_0x1ac5('0x7'))(new Redis(config['redis']));function MailQueue(_0xa3c01d){this['id']=_0xa3c01d['id']||0x0;this[_0x1ac5('0x8')]=_0xa3c01d[_0x1ac5('0x8')]||'';this[_0x1ac5('0x9')]=_0xa3c01d[_0x1ac5('0x9')]||0xa;this[_0x1ac5('0xa')]=_0xa3c01d[_0x1ac5('0xa')]||_0x1ac5('0xb');this['Agents']=_0xa3c01d[_0x1ac5('0xc')];this['mapAgentsId']={};this[_0x1ac5('0xd')]=0x0;this[_0x1ac5('0x1')]='';this[_0x1ac5('0xe')]();this['updateRealtime']();}MailQueue[_0x1ac5('0xf')][_0x1ac5('0xe')]=function(){var _0x16cfa8=this[_0x1ac5('0x10')][_0x1ac5('0x11')];this[_0x1ac5('0x10')]=_['map'](this['Agents'],'id');this[_0x1ac5('0x10')][_0x1ac5('0x11')]=_0x16cfa8;};MailQueue[_0x1ac5('0xf')][_0x1ac5('0x12')]=function(){this[_0x1ac5('0x13')]=0x0;this['paused']=0x0;for(var _0x2d16ca=0x0;_0x2d16ca=0x0?this[_0x1ac5('0x18')]:0x0;var _0x7a34e3={'id':this['id'],'available':this[_0x1ac5('0x18')],'loggedIn':this[_0x1ac5('0x13')],'name':this[_0x1ac5('0x8')],'paused':this[_0x1ac5('0x17')],'waiting':this[_0x1ac5('0xd')]};var _0x412641=md5(JSON['stringify'](_0x7a34e3));if(this['md5']!==_0x412641){this[_0x1ac5('0x1')]=_0x412641;io['to'](util[_0x1ac5('0x19')](_0x1ac5('0x1a'),_0x7a34e3[_0x1ac5('0x8')]))[_0x1ac5('0x1b')](_0x1ac5('0x1c'),_0x7a34e3);}};module[_0x1ac5('0x1d')]=MailQueue; \ No newline at end of file +var _0xcf41=['defaults','localhost','name','timeout','strategy','Agents','mapAgentsId','waiting','md5','updateRouting','prototype','map','updateRealtime','loggedIn','length','online','paused','available','mail:queue:%s','emit','mail_queue:save','exports','util','ioredis','../../../config/environment','redis'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xcf41,0x1b6));var _0x1cf4=function(_0x56ba59,_0x3a61c0){_0x56ba59=_0x56ba59-0x0;var _0x21e4c1=_0xcf41[_0x56ba59];return _0x21e4c1;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x1cf4('0x0'));var Redis=require(_0x1cf4('0x1'));var config=require(_0x1cf4('0x2'));config[_0x1cf4('0x3')]=_[_0x1cf4('0x4')](config[_0x1cf4('0x3')],{'host':_0x1cf4('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function MailQueue(_0x1fcd47){this['id']=_0x1fcd47['id']||0x0;this[_0x1cf4('0x6')]=_0x1fcd47['name']||'';this[_0x1cf4('0x7')]=_0x1fcd47[_0x1cf4('0x7')]||0xa;this[_0x1cf4('0x8')]=_0x1fcd47[_0x1cf4('0x8')]||'beepall';this[_0x1cf4('0x9')]=_0x1fcd47['Agents'];this[_0x1cf4('0xa')]={};this[_0x1cf4('0xb')]=0x0;this[_0x1cf4('0xc')]='';this[_0x1cf4('0xd')]();this['updateRealtime']();}MailQueue[_0x1cf4('0xe')][_0x1cf4('0xd')]=function(){var _0x1473af=this[_0x1cf4('0xa')]['_rr'];this[_0x1cf4('0xa')]=_[_0x1cf4('0xf')](this[_0x1cf4('0x9')],'id');this[_0x1cf4('0xa')]['_rr']=_0x1473af;};MailQueue['prototype'][_0x1cf4('0x10')]=function(){this[_0x1cf4('0x11')]=0x0;this['paused']=0x0;for(var _0x15da1b=0x0;_0x15da1b=0x0?this[_0x1cf4('0x15')]:0x0;var _0xce52fa={'id':this['id'],'available':this[_0x1cf4('0x15')],'loggedIn':this[_0x1cf4('0x11')],'name':this[_0x1cf4('0x6')],'paused':this[_0x1cf4('0x14')],'waiting':this['waiting']};var _0x5a554b=md5(JSON['stringify'](_0xce52fa));if(this[_0x1cf4('0xc')]!==_0x5a554b){this[_0x1cf4('0xc')]=_0x5a554b;io['to'](util['format'](_0x1cf4('0x16'),_0xce52fa[_0x1cf4('0x6')]))[_0x1cf4('0x17')](_0x1cf4('0x18'),_0xce52fa);}};module[_0x1cf4('0x19')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index b8422ba..76c513b 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 _0x326f=['exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','mapAgentsId','waiting','md5','updateRouting','updateRealtime','Agents','prototype','loggedIn','paused','online','openchannelPause','available','stringify','openchannel:queue:%s','openchannel_queue:save'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x326f,0xd1));var _0xf326=function(_0x489b65,_0x4ca747){_0x489b65=_0x489b65-0x0;var _0x1e5c98=_0x326f[_0x489b65];return _0x1e5c98;};'use strict';var _=require(_0xf326('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xf326('0x1'));var config=require(_0xf326('0x2'));config[_0xf326('0x3')]=_[_0xf326('0x4')](config[_0xf326('0x3')],{'host':_0xf326('0x5'),'port':0x18eb});var io=require(_0xf326('0x6'))(new Redis(config[_0xf326('0x3')]));function OpenchannelQueue(_0x1b5a56){this['id']=_0x1b5a56['id']||0x0;this[_0xf326('0x7')]=_0x1b5a56['name']||'';this[_0xf326('0x8')]=_0x1b5a56[_0xf326('0x8')]||0xa;this[_0xf326('0x9')]=_0x1b5a56[_0xf326('0x9')]||'beepall';this['Agents']=_0x1b5a56['Agents'];this[_0xf326('0xa')]={};this[_0xf326('0xb')]=0x0;this[_0xf326('0xc')]='';this[_0xf326('0xd')]();this[_0xf326('0xe')]();}OpenchannelQueue['prototype'][_0xf326('0xd')]=function(){var _0x53cbcd=this[_0xf326('0xa')]['_rr'];this[_0xf326('0xa')]=_['map'](this[_0xf326('0xf')],'id');this[_0xf326('0xa')]['_rr']=_0x53cbcd;};OpenchannelQueue[_0xf326('0x10')][_0xf326('0xe')]=function(){this[_0xf326('0x11')]=0x0;this[_0xf326('0x12')]=0x0;for(var _0x5c8483=0x0;_0x5c8483=0x0?this[_0xf326('0x15')]:0x0;var _0x18bee3={'id':this['id'],'available':this[_0xf326('0x15')],'loggedIn':this[_0xf326('0x11')],'name':this[_0xf326('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x56ad41=md5(JSON[_0xf326('0x16')](_0x18bee3));if(this[_0xf326('0xc')]!==_0x56ad41){this['md5']=_0x56ad41;io['to'](util['format'](_0xf326('0x17'),_0x18bee3['name']))['emit'](_0xf326('0x18'),_0x18bee3);}};module[_0xf326('0x19')]=OpenchannelQueue; \ No newline at end of file +var _0xc4aa=['strategy','Agents','mapAgentsId','updateRouting','updateRealtime','map','_rr','prototype','loggedIn','paused','length','online','available','waiting','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xc4aa[_0x346737];return _0x1ade2e;};'use strict';var _=require(_0xac4a('0x0'));var md5=require(_0xac4a('0x1'));var util=require(_0xac4a('0x2'));var Redis=require(_0xac4a('0x3'));var config=require(_0xac4a('0x4'));config[_0xac4a('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xac4a('0x6'))(new Redis(config[_0xac4a('0x5')]));function OpenchannelQueue(_0x730a38){this['id']=_0x730a38['id']||0x0;this[_0xac4a('0x7')]=_0x730a38[_0xac4a('0x7')]||'';this[_0xac4a('0x8')]=_0x730a38[_0xac4a('0x8')]||0xa;this[_0xac4a('0x9')]=_0x730a38['strategy']||'beepall';this[_0xac4a('0xa')]=_0x730a38[_0xac4a('0xa')];this[_0xac4a('0xb')]={};this['waiting']=0x0;this[_0xac4a('0x1')]='';this[_0xac4a('0xc')]();this[_0xac4a('0xd')]();}OpenchannelQueue['prototype'][_0xac4a('0xc')]=function(){var _0x488e3c=this[_0xac4a('0xb')]['_rr'];this[_0xac4a('0xb')]=_[_0xac4a('0xe')](this[_0xac4a('0xa')],'id');this['mapAgentsId'][_0xac4a('0xf')]=_0x488e3c;};OpenchannelQueue[_0xac4a('0x10')][_0xac4a('0xd')]=function(){this[_0xac4a('0x11')]=0x0;this[_0xac4a('0x12')]=0x0;for(var _0x3b71c0=0x0;_0x3b71c0=0x0?this[_0xac4a('0x15')]:0x0;var _0x44ec59={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xac4a('0x7')],'paused':this[_0xac4a('0x12')],'waiting':this[_0xac4a('0x16')]};var _0x4d837c=md5(JSON[_0xac4a('0x17')](_0x44ec59));if(this[_0xac4a('0x1')]!==_0x4d837c){this[_0xac4a('0x1')]=_0x4d837c;io['to'](util[_0xac4a('0x18')](_0xac4a('0x19'),_0x44ec59[_0xac4a('0x7')]))[_0xac4a('0x1a')](_0xac4a('0x1b'),_0x44ec59);}};module['exports']=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index dca6da4..e414989 100644 --- a/server/services/routing/model/smsQueue.js +++ b/server/services/routing/model/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x72b1=['format','exports','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','smsPause','available','stringify','md5'];(function(_0xba3b80,_0x3ccb24){var _0x6e5fae=function(_0x1189d6){while(--_0x1189d6){_0xba3b80['push'](_0xba3b80['shift']());}};_0x6e5fae(++_0x3ccb24);}(_0x72b1,0x16e));var _0x172b=function(_0x39098d,_0x367ab3){_0x39098d=_0x39098d-0x0;var _0x1bbd10=_0x72b1[_0x39098d];return _0x1bbd10;};'use strict';var _=require(_0x172b('0x0'));var md5=require('md5');var util=require(_0x172b('0x1'));var Redis=require(_0x172b('0x2'));var config=require(_0x172b('0x3'));config[_0x172b('0x4')]=_[_0x172b('0x5')](config[_0x172b('0x4')],{'host':_0x172b('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x172b('0x4')]));function SmsQueue(_0x40c72e){this['id']=_0x40c72e['id']||0x0;this[_0x172b('0x7')]=_0x40c72e[_0x172b('0x7')]||'';this['timeout']=_0x40c72e[_0x172b('0x8')]||0xa;this['strategy']=_0x40c72e[_0x172b('0x9')]||'beepall';this[_0x172b('0xa')]=_0x40c72e[_0x172b('0xa')];this[_0x172b('0xb')]={};this[_0x172b('0xc')]=0x0;this['md5']='';this[_0x172b('0xd')]();this[_0x172b('0xe')]();}SmsQueue[_0x172b('0xf')][_0x172b('0xd')]=function(){var _0xa4ada9=this[_0x172b('0xb')][_0x172b('0x10')];this['mapAgentsId']=_[_0x172b('0x11')](this[_0x172b('0xa')],'id');this[_0x172b('0xb')]['_rr']=_0xa4ada9;};SmsQueue[_0x172b('0xf')]['updateRealtime']=function(){this[_0x172b('0x12')]=0x0;this[_0x172b('0x13')]=0x0;for(var _0x5239b9=0x0;_0x5239b9=0x0?this[_0x172b('0x17')]:0x0;var _0x18c22a={'id':this['id'],'available':this[_0x172b('0x17')],'loggedIn':this[_0x172b('0x12')],'name':this['name'],'paused':this[_0x172b('0x13')],'waiting':this[_0x172b('0xc')]};var _0x2bedae=md5(JSON[_0x172b('0x18')](_0x18c22a));if(this[_0x172b('0x19')]!==_0x2bedae){this[_0x172b('0x19')]=_0x2bedae;io['to'](util[_0x172b('0x1a')]('sms:queue:%s',_0x18c22a['name']))['emit']('sms_queue:save',_0x18c22a);}};module[_0x172b('0x1b')]=SmsQueue; \ No newline at end of file +var _0xc6d8=['Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','online','available','stringify','sms_queue:save','lodash','util','../../../config/environment','defaults','socket.io-emitter','redis','name','timeout','strategy','beepall'];(function(_0xb1496a,_0x190543){var _0x301916=function(_0x4e17ab){while(--_0x4e17ab){_0xb1496a['push'](_0xb1496a['shift']());}};_0x301916(++_0x190543);}(_0xc6d8,0xd7));var _0x8c6d=function(_0x5137c9,_0x3d193f){_0x5137c9=_0x5137c9-0x0;var _0x548778=_0xc6d8[_0x5137c9];return _0x548778;};'use strict';var _=require(_0x8c6d('0x0'));var md5=require('md5');var util=require(_0x8c6d('0x1'));var Redis=require('ioredis');var config=require(_0x8c6d('0x2'));config['redis']=_[_0x8c6d('0x3')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x8c6d('0x4'))(new Redis(config[_0x8c6d('0x5')]));function SmsQueue(_0x17781d){this['id']=_0x17781d['id']||0x0;this[_0x8c6d('0x6')]=_0x17781d[_0x8c6d('0x6')]||'';this[_0x8c6d('0x7')]=_0x17781d[_0x8c6d('0x7')]||0xa;this['strategy']=_0x17781d[_0x8c6d('0x8')]||_0x8c6d('0x9');this[_0x8c6d('0xa')]=_0x17781d['Agents'];this[_0x8c6d('0xb')]={};this[_0x8c6d('0xc')]=0x0;this[_0x8c6d('0xd')]='';this[_0x8c6d('0xe')]();this[_0x8c6d('0xf')]();}SmsQueue[_0x8c6d('0x10')][_0x8c6d('0xe')]=function(){var _0x392a6b=this['mapAgentsId'][_0x8c6d('0x11')];this['mapAgentsId']=_['map'](this[_0x8c6d('0xa')],'id');this[_0x8c6d('0xb')][_0x8c6d('0x11')]=_0x392a6b;};SmsQueue[_0x8c6d('0x10')][_0x8c6d('0xf')]=function(){this[_0x8c6d('0x12')]=0x0;this[_0x8c6d('0x13')]=0x0;for(var _0x103699=0x0;_0x103699=0x0?this[_0x8c6d('0x16')]:0x0;var _0x5a22de={'id':this['id'],'available':this['available'],'loggedIn':this[_0x8c6d('0x12')],'name':this['name'],'paused':this[_0x8c6d('0x13')],'waiting':this[_0x8c6d('0xc')]};var _0x1d0f0a=md5(JSON[_0x8c6d('0x17')](_0x5a22de));if(this[_0x8c6d('0xd')]!==_0x1d0f0a){this['md5']=_0x1d0f0a;io['to'](util['format']('sms:queue:%s',_0x5a22de[_0x8c6d('0x6')]))['emit'](_0x8c6d('0x18'),_0x5a22de);}};module['exports']=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 66e354b..07f79a1 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 _0xd628=['name','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','strategy','beepall','Agents','waiting','prototype','updateRouting','_rr','map','mapAgentsId','loggedIn','paused','length','online','whatsappPause','available'];(function(_0x50efe7,_0xae9d62){var _0x4272ac=function(_0xa4463d){while(--_0xa4463d){_0x50efe7['push'](_0x50efe7['shift']());}};_0x4272ac(++_0xae9d62);}(_0xd628,0x7f));var _0x8d62=function(_0x46c824,_0x3e4067){_0x46c824=_0x46c824-0x0;var _0x345d33=_0xd628[_0x46c824];return _0x345d33;};'use strict';var _=require('lodash');var md5=require(_0x8d62('0x0'));var util=require(_0x8d62('0x1'));var Redis=require(_0x8d62('0x2'));var config=require(_0x8d62('0x3'));config[_0x8d62('0x4')]=_[_0x8d62('0x5')](config[_0x8d62('0x4')],{'host':_0x8d62('0x6'),'port':0x18eb});var io=require(_0x8d62('0x7'))(new Redis(config[_0x8d62('0x4')]));function WhatsappQueue(_0x2f3bdc){this['id']=_0x2f3bdc['id']||0x0;this['name']=_0x2f3bdc['name']||'';this['timeout']=_0x2f3bdc['timeout']||0xa;this[_0x8d62('0x8')]=_0x2f3bdc['strategy']||_0x8d62('0x9');this[_0x8d62('0xa')]=_0x2f3bdc[_0x8d62('0xa')];this['mapAgentsId']={};this[_0x8d62('0xb')]=0x0;this['md5']='';this['updateRouting']();this['updateRealtime']();}WhatsappQueue[_0x8d62('0xc')][_0x8d62('0xd')]=function(){var _0x36cbca=this['mapAgentsId'][_0x8d62('0xe')];this['mapAgentsId']=_[_0x8d62('0xf')](this[_0x8d62('0xa')],'id');this[_0x8d62('0x10')]['_rr']=_0x36cbca;};WhatsappQueue[_0x8d62('0xc')]['updateRealtime']=function(){this[_0x8d62('0x11')]=0x0;this[_0x8d62('0x12')]=0x0;for(var _0x5e5dc2=0x0;_0x5e5dc2=0x0?this[_0x8d62('0x16')]:0x0;var _0x33b4c2={'id':this['id'],'available':this[_0x8d62('0x16')],'loggedIn':this[_0x8d62('0x11')],'name':this[_0x8d62('0x17')],'paused':this[_0x8d62('0x12')],'waiting':this[_0x8d62('0xb')]};var _0x6f78b=md5(JSON[_0x8d62('0x18')](_0x33b4c2));if(this[_0x8d62('0x0')]!==_0x6f78b){this['md5']=_0x6f78b;io['to'](util[_0x8d62('0x19')](_0x8d62('0x1a'),_0x33b4c2[_0x8d62('0x17')]))[_0x8d62('0x1b')](_0x8d62('0x1c'),_0x33b4c2);}};module[_0x8d62('0x1d')]=WhatsappQueue; \ No newline at end of file +var _0xb3d9=['whatsapp:queue:%s','whatsapp_queue:save','lodash','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','map','_rr','paused','length','whatsappPause','available','loggedIn','stringify','format'];(function(_0x6bdb2b,_0x20e322){var _0x9421cb=function(_0x378ad7){while(--_0x378ad7){_0x6bdb2b['push'](_0x6bdb2b['shift']());}};_0x9421cb(++_0x20e322);}(_0xb3d9,0x17b));var _0x9b3d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb3d9[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x9b3d('0x0'));var md5=require('md5');var util=require(_0x9b3d('0x1'));var Redis=require(_0x9b3d('0x2'));var config=require(_0x9b3d('0x3'));config[_0x9b3d('0x4')]=_['defaults'](config['redis'],{'host':_0x9b3d('0x5'),'port':0x18eb});var io=require(_0x9b3d('0x6'))(new Redis(config['redis']));function WhatsappQueue(_0x4650ba){this['id']=_0x4650ba['id']||0x0;this[_0x9b3d('0x7')]=_0x4650ba[_0x9b3d('0x7')]||'';this[_0x9b3d('0x8')]=_0x4650ba['timeout']||0xa;this['strategy']=_0x4650ba[_0x9b3d('0x9')]||_0x9b3d('0xa');this['Agents']=_0x4650ba[_0x9b3d('0xb')];this[_0x9b3d('0xc')]={};this[_0x9b3d('0xd')]=0x0;this[_0x9b3d('0xe')]='';this[_0x9b3d('0xf')]();this[_0x9b3d('0x10')]();}WhatsappQueue[_0x9b3d('0x11')][_0x9b3d('0xf')]=function(){var _0x24e85c=this[_0x9b3d('0xc')]['_rr'];this['mapAgentsId']=_[_0x9b3d('0x12')](this['Agents'],'id');this[_0x9b3d('0xc')][_0x9b3d('0x13')]=_0x24e85c;};WhatsappQueue['prototype'][_0x9b3d('0x10')]=function(){this['loggedIn']=0x0;this[_0x9b3d('0x14')]=0x0;for(var _0x14f517=0x0;_0x14f517=0x0?this[_0x9b3d('0x17')]:0x0;var _0xefdc32={'id':this['id'],'available':this[_0x9b3d('0x17')],'loggedIn':this[_0x9b3d('0x18')],'name':this[_0x9b3d('0x7')],'paused':this[_0x9b3d('0x14')],'waiting':this['waiting']};var _0x8639b9=md5(JSON[_0x9b3d('0x19')](_0xefdc32));if(this[_0x9b3d('0xe')]!==_0x8639b9){this[_0x9b3d('0xe')]=_0x8639b9;io['to'](util[_0x9b3d('0x1a')](_0x9b3d('0x1b'),_0xefdc32[_0x9b3d('0x7')]))['emit'](_0x9b3d('0x1c'),_0xefdc32);}};module['exports']=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 1f83280..07d76e6 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(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file +var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x1fe403,_0x82e474){var _0x32cfad=function(_0x4765cf){while(--_0x4765cf){_0x1fe403['push'](_0x1fe403['shift']());}};_0x32cfad(++_0x82e474);}(_0xb10b,0x12a));var _0xbb10=function(_0x3c815e,_0x3d8105){_0x3c815e=_0x3c815e-0x0;var _0xf66654=_0xb10b[_0x3c815e];return _0xf66654;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 33b0b1c..b7b19c6 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 _0x8142=['Request','UpdateChatInteraction','addTags','AddTagsToChatInteraction','../client'];(function(_0x50358e,_0x3c8398){var _0x778d94=function(_0x1b8ea8){while(--_0x1b8ea8){_0x50358e['push'](_0x50358e['shift']());}};_0x778d94(++_0x3c8398);}(_0x8142,0x180));var _0x2814=function(_0x5c7a85,_0x41dd19){_0x5c7a85=_0x5c7a85-0x0;var _0x35290f=_0x8142[_0x5c7a85];return _0x35290f;};'use strict';var client=require(_0x2814('0x0'));exports['update']=function(_0x10f9ea,_0x10134e){return client[_0x2814('0x1')](_0x2814('0x2'),{'body':_0x10134e,'options':{'where':{'id':_0x10f9ea}},'log':'updateChatInteraction'});};exports[_0x2814('0x3')]=function(_0x5c3bc1,_0x1b92de){return client['Request'](_0x2814('0x4'),{'body':_0x1b92de,'options':{'where':{'id':_0x5c3bc1}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xe5f7=['addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','Request','UpdateChatInteraction'];(function(_0x17d2d2,_0x571ed9){var _0x4c89f6=function(_0x27cc25){while(--_0x27cc25){_0x17d2d2['push'](_0x17d2d2['shift']());}};_0x4c89f6(++_0x571ed9);}(_0xe5f7,0x130));var _0x7e5f=function(_0x3a92b7,_0x25638e){_0x3a92b7=_0x3a92b7-0x0;var _0x535ea7=_0xe5f7[_0x3a92b7];return _0x535ea7;};'use strict';var client=require(_0x7e5f('0x0'));exports[_0x7e5f('0x1')]=function(_0x431f73,_0x35c540){return client[_0x7e5f('0x2')](_0x7e5f('0x3'),{'body':_0x35c540,'options':{'where':{'id':_0x431f73}},'log':'updateChatInteraction'});};exports[_0x7e5f('0x4')]=function(_0x11ac47,_0x5bc2cc){return client[_0x7e5f('0x2')](_0x7e5f('0x5'),{'body':_0x5bc2cc,'options':{'where':{'id':_0x11ac47}},'log':_0x7e5f('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index cf13c85..f7ab5b0 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 _0x86e5=['Request','CreateChatMessage','../client','create'];(function(_0x10c004,_0x32499d){var _0x245a80=function(_0x5589af){while(--_0x5589af){_0x10c004['push'](_0x10c004['shift']());}};_0x245a80(++_0x32499d);}(_0x86e5,0x11a));var _0x586e=function(_0x270af3,_0x3461fb){_0x270af3=_0x270af3-0x0;var _0x52fcad=_0x86e5[_0x270af3];return _0x52fcad;};'use strict';var client=require(_0x586e('0x0'));exports[_0x586e('0x1')]=function(_0x425687){return client[_0x586e('0x2')](_0x586e('0x3'),{'body':_0x425687,'log':'createChatMessage'});}; \ No newline at end of file +var _0x53c0=['CreateChatMessage','createChatMessage','create'];(function(_0x2b33a2,_0x208fac){var _0x5904ef=function(_0x47281c){while(--_0x47281c){_0x2b33a2['push'](_0x2b33a2['shift']());}};_0x5904ef(++_0x208fac);}(_0x53c0,0xc5));var _0x053c=function(_0x516927,_0xb4aad0){_0x516927=_0x516927-0x0;var _0x30749b=_0x53c0[_0x516927];return _0x30749b;};'use strict';var client=require('../client');exports[_0x053c('0x0')]=function(_0x31047d){return client['Request'](_0x053c('0x1'),{'body':_0x31047d,'log':_0x053c('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index c67c079..62a2c5e 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 _0x3435=['Request','GetChatQueue','name','timeout','User','Agents','chatPause','../client','getChatQueues'];(function(_0x4b362b,_0xb811a){var _0x5cde92=function(_0x143f21){while(--_0x143f21){_0x4b362b['push'](_0x4b362b['shift']());}};_0x5cde92(++_0xb811a);}(_0x3435,0xfa));var _0x5343=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x3435[_0x255d5b];return _0x3e141a;};'use strict';var client=require(_0x5343('0x0'));exports[_0x5343('0x1')]=function(){return function(){return client[_0x5343('0x2')](_0x5343('0x3'),{'options':{'raw':![],'attributes':['id',_0x5343('0x4'),_0x5343('0x5'),'strategy'],'include':[{'model':_0x5343('0x6'),'as':_0x5343('0x7'),'attributes':['id','name','online',_0x5343('0x8')]}]},'log':_0x5343('0x1')});};}; \ No newline at end of file +var _0x31c2=['chatPause','../client','getChatQueues','Request','GetChatQueue','name','timeout','strategy','User','online'];(function(_0x3a66d5,_0x41b74a){var _0x4cc124=function(_0x3a89a5){while(--_0x3a89a5){_0x3a66d5['push'](_0x3a66d5['shift']());}};_0x4cc124(++_0x41b74a);}(_0x31c2,0x1e1));var _0x231c=function(_0x23ea4c,_0x31e8b5){_0x23ea4c=_0x23ea4c-0x0;var _0x50ebf3=_0x31c2[_0x23ea4c];return _0x50ebf3;};'use strict';var client=require(_0x231c('0x0'));exports[_0x231c('0x1')]=function(){return function(){return client[_0x231c('0x2')](_0x231c('0x3'),{'options':{'raw':![],'attributes':['id',_0x231c('0x4'),_0x231c('0x5'),_0x231c('0x6')],'include':[{'model':_0x231c('0x7'),'as':'Agents','attributes':['id','name',_0x231c('0x8'),_0x231c('0x9')]}]},'log':_0x231c('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 1e6bb3c..20fcbd5 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 _0x5d31=['CreateChatQueueReport','UpdateChatQueueReport','DESC','../client','create'];(function(_0x4f6618,_0xfda162){var _0x394e1a=function(_0x46416b){while(--_0x46416b){_0x4f6618['push'](_0x4f6618['shift']());}};_0x394e1a(++_0xfda162);}(_0x5d31,0xb7));var _0x15d3=function(_0x472ded,_0x7b9b67){_0x472ded=_0x472ded-0x0;var _0x4cdf81=_0x5d31[_0x472ded];return _0x4cdf81;};'use strict';var client=require(_0x15d3('0x0'));exports[_0x15d3('0x1')]=function(_0x255280){return client['Request'](_0x15d3('0x2'),{'body':_0x255280,'log':_0x15d3('0x2')});};exports['update']=function(_0x19b9b6,_0x526c77){return client['Request'](_0x15d3('0x3'),{'body':_0x526c77,'options':{'where':{'uniqueid':_0x19b9b6},'order':[['id',_0x15d3('0x4')]],'limit':0x1},'log':_0x15d3('0x3')});}; \ No newline at end of file +var _0x7e16=['UpdateChatQueueReport','../client','create','Request','update','DESC'];(function(_0x1ec0d0,_0x2c2acc){var _0x1f7aa6=function(_0x1b920c){while(--_0x1b920c){_0x1ec0d0['push'](_0x1ec0d0['shift']());}};_0x1f7aa6(++_0x2c2acc);}(_0x7e16,0x16f));var _0x67e1=function(_0xce7990,_0x34736c){_0xce7990=_0xce7990-0x0;var _0x2f3cc7=_0x7e16[_0xce7990];return _0x2f3cc7;};'use strict';var client=require(_0x67e1('0x0'));exports[_0x67e1('0x1')]=function(_0x14f1a6){return client[_0x67e1('0x2')]('CreateChatQueueReport',{'body':_0x14f1a6,'log':'CreateChatQueueReport'});};exports[_0x67e1('0x3')]=function(_0x53bbdf,_0x268f07){return client[_0x67e1('0x2')]('UpdateChatQueueReport',{'body':_0x268f07,'options':{'where':{'uniqueid':_0x53bbdf},'order':[['id',_0x67e1('0x4')]],'limit':0x1},'log':_0x67e1('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 949674b..f04f2b6 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x3d0966,_0x39b8ab){var _0x357663=function(_0x51040b){while(--_0x51040b){_0x3d0966['push'](_0x3d0966['shift']());}};_0x357663(++_0x39b8ab);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file +var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x40c81c,_0x4be505){var _0x1b4116=function(_0x15a45a){while(--_0x15a45a){_0x40c81c['push'](_0x40c81c['shift']());}};_0x1b4116(++_0x4be505);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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 401a604..eed402f 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 _0x510f=['createFaxMessage','create','Request'];(function(_0x21b067,_0x2df071){var _0x21d746=function(_0x1f9aca){while(--_0x1f9aca){_0x21b067['push'](_0x21b067['shift']());}};_0x21d746(++_0x2df071);}(_0x510f,0x130));var _0xf510=function(_0x16d793,_0x22f0f7){_0x16d793=_0x16d793-0x0;var _0x444f4f=_0x510f[_0x16d793];return _0x444f4f;};'use strict';var client=require('../client');exports[_0xf510('0x0')]=function(_0x500017){return client[_0xf510('0x1')]('CreateFaxMessage',{'body':_0x500017,'log':_0xf510('0x2')});}; \ No newline at end of file +var _0x2749=['../client','create','Request','CreateFaxMessage'];(function(_0xaddae5,_0x12be73){var _0x5bcdc8=function(_0xdd8007){while(--_0xdd8007){_0xaddae5['push'](_0xaddae5['shift']());}};_0x5bcdc8(++_0x12be73);}(_0x2749,0xe0));var _0x9274=function(_0x5b4aab,_0xc572bb){_0x5b4aab=_0x5b4aab-0x0;var _0x4e433e=_0x2749[_0x5b4aab];return _0x4e433e;};'use strict';var client=require(_0x9274('0x0'));exports[_0x9274('0x1')]=function(_0x366c9c){return client[_0x9274('0x2')](_0x9274('0x3'),{'body':_0x366c9c,'log':'createFaxMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index d9a1fa4..f428901 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 _0x0134=['User','Agents','online','faxPause','getFaxQueues','Request','GetFaxQueue','name'];(function(_0x20aff0,_0x56bf42){var _0xd17ce9=function(_0x3af923){while(--_0x3af923){_0x20aff0['push'](_0x20aff0['shift']());}};_0xd17ce9(++_0x56bf42);}(_0x0134,0xec));var _0x4013=function(_0x4dcf3a,_0xa0d121){_0x4dcf3a=_0x4dcf3a-0x0;var _0x31cc5f=_0x0134[_0x4dcf3a];return _0x31cc5f;};'use strict';var client=require('../client');exports[_0x4013('0x0')]=function(){return function(){return client[_0x4013('0x1')](_0x4013('0x2'),{'options':{'raw':![],'attributes':['id',_0x4013('0x3'),'timeout','strategy'],'include':[{'model':_0x4013('0x4'),'as':_0x4013('0x5'),'attributes':['id',_0x4013('0x3'),_0x4013('0x6'),_0x4013('0x7')]}]},'log':_0x4013('0x0')});};}; \ No newline at end of file +var _0xe7bf=['User','Agents','name','online','faxPause','../client','getFaxQueues','Request','timeout','strategy'];(function(_0x1a58d1,_0xa90685){var _0x101adc=function(_0x4a7543){while(--_0x4a7543){_0x1a58d1['push'](_0x1a58d1['shift']());}};_0x101adc(++_0xa90685);}(_0xe7bf,0xff));var _0xfe7b=function(_0x5abf8f,_0x1b1dad){_0x5abf8f=_0x5abf8f-0x0;var _0x39d60a=_0xe7bf[_0x5abf8f];return _0x39d60a;};'use strict';var client=require(_0xfe7b('0x0'));exports[_0xfe7b('0x1')]=function(){return function(){return client[_0xfe7b('0x2')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id','name',_0xfe7b('0x3'),_0xfe7b('0x4')],'include':[{'model':_0xfe7b('0x5'),'as':_0xfe7b('0x6'),'attributes':['id',_0xfe7b('0x7'),_0xfe7b('0x8'),_0xfe7b('0x9')]}]},'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 a476e32..6f13481 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 _0x1419=['CreateFaxQueueReport','update','Request','UpdateFaxQueueReport','DESC','../client','create'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x1419,0x14e));var _0x9141=function(_0x42ab25,_0x1b4d60){_0x42ab25=_0x42ab25-0x0;var _0x47c111=_0x1419[_0x42ab25];return _0x47c111;};'use strict';var client=require(_0x9141('0x0'));exports[_0x9141('0x1')]=function(_0x59e3f7){return client['Request'](_0x9141('0x2'),{'body':_0x59e3f7,'log':_0x9141('0x2')});};exports[_0x9141('0x3')]=function(_0xd3f0c4,_0x458485){return client[_0x9141('0x4')](_0x9141('0x5'),{'body':_0x458485,'options':{'where':{'uniqueid':_0xd3f0c4},'order':[['id',_0x9141('0x6')]],'limit':0x1},'log':_0x9141('0x5')});}; \ No newline at end of file +var _0xc275=['create','CreateFaxQueueReport','update','Request','UpdateFaxQueueReport','DESC','../client'];(function(_0x390733,_0x1e3d32){var _0x33beb9=function(_0x4491a3){while(--_0x4491a3){_0x390733['push'](_0x390733['shift']());}};_0x33beb9(++_0x1e3d32);}(_0xc275,0x125));var _0x5c27=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xc275[_0x46e363];return _0x3fb059;};'use strict';var client=require(_0x5c27('0x0'));exports[_0x5c27('0x1')]=function(_0x220e5a){return client['Request'](_0x5c27('0x2'),{'body':_0x220e5a,'log':_0x5c27('0x2')});};exports[_0x5c27('0x3')]=function(_0x522718,_0x38a97c){return client[_0x5c27('0x4')](_0x5c27('0x5'),{'body':_0x38a97c,'options':{'where':{'uniqueid':_0x522718},'order':[['id',_0x5c27('0x6')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index e08026b..aab213f 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 _0x3783=['Request','GetInterval','name','Interval','Intervals','interval','../client','getIntervals'];(function(_0x2b2d6d,_0x358f90){var _0x55a665=function(_0x121d9a){while(--_0x121d9a){_0x2b2d6d['push'](_0x2b2d6d['shift']());}};_0x55a665(++_0x358f90);}(_0x3783,0x12e));var _0x3378=function(_0x456dad,_0x1a9889){_0x456dad=_0x456dad-0x0;var _0x245f82=_0x3783[_0x456dad];return _0x245f82;};'use strict';var client=require(_0x3378('0x0'));exports[_0x3378('0x1')]=function(){return function(){return client[_0x3378('0x2')](_0x3378('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x3378('0x4')],'include':[{'model':_0x3378('0x5'),'as':_0x3378('0x6'),'attributes':['id',_0x3378('0x4'),_0x3378('0x7')]}]},'log':_0x3378('0x1')});};}; \ No newline at end of file +var _0xb9ea=['GetInterval','name','Interval','../client','getIntervals'];(function(_0x446208,_0xb483fb){var _0xe49563=function(_0x1d3a21){while(--_0x1d3a21){_0x446208['push'](_0x446208['shift']());}};_0xe49563(++_0xb483fb);}(_0xb9ea,0x17f));var _0xab9e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb9ea[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0xab9e('0x0'));exports[_0xab9e('0x1')]=function(){return function(){return client['Request'](_0xab9e('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xab9e('0x3')],'include':[{'model':_0xab9e('0x4'),'as':'Intervals','attributes':['id',_0xab9e('0x3'),'interval']}]},'log':_0xab9e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index ba2fb3f..4ba57f9 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 _0xf2e3=['Request','UpdateMailInteraction','updateMailInteraction','addTags','addTagsToChatInteraction','../client'];(function(_0x498c19,_0x118e41){var _0x924202=function(_0x5257a6){while(--_0x5257a6){_0x498c19['push'](_0x498c19['shift']());}};_0x924202(++_0x118e41);}(_0xf2e3,0x9b));var _0x3f2e=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0xf2e3[_0x525c7b];return _0x27b33e;};'use strict';var client=require(_0x3f2e('0x0'));exports['update']=function(_0x143e9e,_0x231b2b){return client[_0x3f2e('0x1')](_0x3f2e('0x2'),{'body':_0x231b2b,'options':{'where':{'id':_0x143e9e}},'log':_0x3f2e('0x3')});};exports[_0x3f2e('0x4')]=function(_0x3938e2,_0xabcf5c){return client[_0x3f2e('0x1')]('AddTagsToMailInteraction',{'body':_0xabcf5c,'options':{'where':{'id':_0x3938e2}},'log':_0x3f2e('0x5')});}; \ No newline at end of file +var _0x1eba=['addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0x1eba[_0x25bea7];return _0x175952;};'use strict';var client=require(_0xa1eb('0x0'));exports[_0xa1eb('0x1')]=function(_0x406a58,_0x2158d5){return client[_0xa1eb('0x2')]('UpdateMailInteraction',{'body':_0x2158d5,'options':{'where':{'id':_0x406a58}},'log':'updateMailInteraction'});};exports[_0xa1eb('0x3')]=function(_0x34be5a,_0x16a13a){return client[_0xa1eb('0x2')](_0xa1eb('0x4'),{'body':_0x16a13a,'options':{'where':{'id':_0x34be5a}},'log':_0xa1eb('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index bc57e5c..fff50fb 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 _0x31e5=['CreateMailMessage','../client','create','Request'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x31e5,0x1e1));var _0x531e=function(_0xcda377,_0x1e2678){_0xcda377=_0xcda377-0x0;var _0x1c024f=_0x31e5[_0xcda377];return _0x1c024f;};'use strict';var client=require(_0x531e('0x0'));exports[_0x531e('0x1')]=function(_0x369d82){return client[_0x531e('0x2')](_0x531e('0x3'),{'body':_0x369d82,'log':'createMailMessage'});}; \ No newline at end of file +var _0xb62e=['create','../client'];(function(_0x21630b,_0x1491a4){var _0x3624c7=function(_0x3168d1){while(--_0x3168d1){_0x21630b['push'](_0x21630b['shift']());}};_0x3624c7(++_0x1491a4);}(_0xb62e,0x7b));var _0xeb62=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xb62e[_0x3b380d];return _0x54502b;};'use strict';var client=require(_0xeb62('0x0'));exports[_0xeb62('0x1')]=function(_0x7c83cf){return client['Request']('CreateMailMessage',{'body':_0x7c83cf,'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 03a4600..665f111 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 _0x5040=['User','Agents','online','getMailQueues','../client','Request','name','timeout','strategy'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x5040,0x1b4));var _0x0504=function(_0x4e43ab,_0x148206){_0x4e43ab=_0x4e43ab-0x0;var _0x8a4a51=_0x5040[_0x4e43ab];return _0x8a4a51;};'use strict';var client=require(_0x0504('0x0'));exports['getMailQueues']=function(){return function(){return client[_0x0504('0x1')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x0504('0x2'),_0x0504('0x3'),_0x0504('0x4')],'include':[{'model':_0x0504('0x5'),'as':_0x0504('0x6'),'attributes':['id',_0x0504('0x2'),_0x0504('0x7'),'mailPause']}]},'log':_0x0504('0x8')});};}; \ No newline at end of file +var _0xeb3d=['Agents','name','online','../client','getMailQueues','timeout','strategy'];(function(_0xdfde1c,_0x148a6b){var _0x3f29c2=function(_0x63c7f5){while(--_0x63c7f5){_0xdfde1c['push'](_0xdfde1c['shift']());}};_0x3f29c2(++_0x148a6b);}(_0xeb3d,0xab));var _0xdeb3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xeb3d[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0xdeb3('0x0'));exports[_0xdeb3('0x1')]=function(){return function(){return client['Request']('GetMailQueue',{'options':{'raw':![],'attributes':['id','name',_0xdeb3('0x2'),_0xdeb3('0x3')],'include':[{'model':'User','as':_0xdeb3('0x4'),'attributes':['id',_0xdeb3('0x5'),_0xdeb3('0x6'),'mailPause']}]},'log':_0xdeb3('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 26c6a28..c6a8b8f 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 _0x7f56=['CreateMailQueueReport','UpdateMailQueueReport','DESC','create','Request'];(function(_0x3ec8b6,_0x2e0c56){var _0x23b89e=function(_0xb35d72){while(--_0xb35d72){_0x3ec8b6['push'](_0x3ec8b6['shift']());}};_0x23b89e(++_0x2e0c56);}(_0x7f56,0x139));var _0x67f5=function(_0x4d2993,_0x1c9473){_0x4d2993=_0x4d2993-0x0;var _0x427374=_0x7f56[_0x4d2993];return _0x427374;};'use strict';var client=require('../client');exports[_0x67f5('0x0')]=function(_0x1d0d65){return client[_0x67f5('0x1')]('CreateMailQueueReport',{'body':_0x1d0d65,'log':_0x67f5('0x2')});};exports['update']=function(_0x288fe0,_0x5573fe){return client['Request'](_0x67f5('0x3'),{'body':_0x5573fe,'options':{'where':{'uniqueid':_0x288fe0},'order':[['id',_0x67f5('0x4')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file +var _0xe39f=['DESC','../client','create','Request','CreateMailQueueReport','update','UpdateMailQueueReport'];(function(_0x49da09,_0x1d5b15){var _0x42dfde=function(_0x445986){while(--_0x445986){_0x49da09['push'](_0x49da09['shift']());}};_0x42dfde(++_0x1d5b15);}(_0xe39f,0x1d6));var _0xfe39=function(_0x2dbac1,_0x44db3b){_0x2dbac1=_0x2dbac1-0x0;var _0x8c4e86=_0xe39f[_0x2dbac1];return _0x8c4e86;};'use strict';var client=require(_0xfe39('0x0'));exports[_0xfe39('0x1')]=function(_0x3d12ad){return client[_0xfe39('0x2')](_0xfe39('0x3'),{'body':_0x3d12ad,'log':_0xfe39('0x3')});};exports[_0xfe39('0x4')]=function(_0x431784,_0x2d97e8){return client[_0xfe39('0x2')](_0xfe39('0x5'),{'body':_0x2d97e8,'options':{'where':{'uniqueid':_0x431784},'order':[['id',_0xfe39('0x6')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index afd01f4..9df54ed 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 _0x4042=['Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','update'];(function(_0x52d127,_0x20484b){var _0x4ddf33=function(_0x3d288f){while(--_0x3d288f){_0x52d127['push'](_0x52d127['shift']());}};_0x4ddf33(++_0x20484b);}(_0x4042,0xfb));var _0x2404=function(_0x8bff5b,_0x1d21d3){_0x8bff5b=_0x8bff5b-0x0;var _0x1b9b4b=_0x4042[_0x8bff5b];return _0x1b9b4b;};'use strict';var client=require('../client');exports[_0x2404('0x0')]=function(_0x4d3ed2,_0x275317){return client[_0x2404('0x1')](_0x2404('0x2'),{'body':_0x275317,'options':{'where':{'id':_0x4d3ed2}},'log':_0x2404('0x3')});};exports[_0x2404('0x4')]=function(_0x231c7a,_0x13f346){return client['Request'](_0x2404('0x5'),{'body':_0x13f346,'options':{'where':{'id':_0x231c7a}},'log':_0x2404('0x6')});}; \ No newline at end of file +var _0x5b27=['addTags','AddTagsToOpenchannelInteraction','../client','update','Request','updateOpenchannelInteraction'];(function(_0x5b95d9,_0x24d08e){var _0x20523c=function(_0xdfd6e){while(--_0xdfd6e){_0x5b95d9['push'](_0x5b95d9['shift']());}};_0x20523c(++_0x24d08e);}(_0x5b27,0x1b8));var _0x75b2=function(_0x154b2f,_0x52f9bd){_0x154b2f=_0x154b2f-0x0;var _0x123746=_0x5b27[_0x154b2f];return _0x123746;};'use strict';var client=require(_0x75b2('0x0'));exports[_0x75b2('0x1')]=function(_0x3fa5b6,_0x4a16be){return client[_0x75b2('0x2')]('UpdateOpenchannelInteraction',{'body':_0x4a16be,'options':{'where':{'id':_0x3fa5b6}},'log':_0x75b2('0x3')});};exports[_0x75b2('0x4')]=function(_0x469abd,_0x3c59d5){return client['Request'](_0x75b2('0x5'),{'body':_0x3c59d5,'options':{'where':{'id':_0x469abd}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 08babbe..db9927b 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 _0x75b4=['../client','Request','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x315593,_0x262bf2){var _0x34e66e=function(_0x309d60){while(--_0x309d60){_0x315593['push'](_0x315593['shift']());}};_0x34e66e(++_0x262bf2);}(_0x75b4,0x104));var _0x475b=function(_0x493c9d,_0x260794){_0x493c9d=_0x493c9d-0x0;var _0xdf4be4=_0x75b4[_0x493c9d];return _0xdf4be4;};'use strict';var client=require(_0x475b('0x0'));exports['create']=function(_0x3338b5){return client[_0x475b('0x1')](_0x475b('0x2'),{'body':_0x3338b5,'log':_0x475b('0x3')});}; \ No newline at end of file +var _0xa053=['createOpenchannelMessage','create','Request','CreateOpenchannelMessage'];(function(_0x409310,_0x5bd2cc){var _0x356109=function(_0x5bc20c){while(--_0x5bc20c){_0x409310['push'](_0x409310['shift']());}};_0x356109(++_0x5bd2cc);}(_0xa053,0x1d1));var _0x3a05=function(_0x10e44b,_0x4f791b){_0x10e44b=_0x10e44b-0x0;var _0x50e33d=_0xa053[_0x10e44b];return _0x50e33d;};'use strict';var client=require('../client');exports[_0x3a05('0x0')]=function(_0x2525d3){return client[_0x3a05('0x1')](_0x3a05('0x2'),{'body':_0x2525d3,'log':_0x3a05('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index e071993..0637f04 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 _0x421b=['User','Agents','online','openchannelPause','getOpenchannelQueues','Request','name','timeout','strategy'];(function(_0x540b3e,_0x515465){var _0x2689dd=function(_0x3aaeb8){while(--_0x3aaeb8){_0x540b3e['push'](_0x540b3e['shift']());}};_0x2689dd(++_0x515465);}(_0x421b,0x1e2));var _0xb421=function(_0x2fec16,_0x3c6e34){_0x2fec16=_0x2fec16-0x0;var _0x56b703=_0x421b[_0x2fec16];return _0x56b703;};'use strict';var client=require('../client');exports['getOpenchannelQueues']=function(){return function(){return client[_0xb421('0x0')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0xb421('0x1'),_0xb421('0x2'),_0xb421('0x3')],'include':[{'model':_0xb421('0x4'),'as':_0xb421('0x5'),'attributes':['id','name',_0xb421('0x6'),_0xb421('0x7')]}]},'log':_0xb421('0x8')});};}; \ No newline at end of file +var _0x8e01=['strategy','name','online','openchannelPause','../client','getOpenchannelQueues','GetOpenchannelQueue','timeout'];(function(_0x2e5298,_0x3cfa5b){var _0x46d150=function(_0x475026){while(--_0x475026){_0x2e5298['push'](_0x2e5298['shift']());}};_0x46d150(++_0x3cfa5b);}(_0x8e01,0x1f4));var _0x18e0=function(_0x5969ee,_0x34d07c){_0x5969ee=_0x5969ee-0x0;var _0x426e7a=_0x8e01[_0x5969ee];return _0x426e7a;};'use strict';var client=require(_0x18e0('0x0'));exports[_0x18e0('0x1')]=function(){return function(){return client['Request'](_0x18e0('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x18e0('0x3'),_0x18e0('0x4')],'include':[{'model':'User','as':'Agents','attributes':['id',_0x18e0('0x5'),_0x18e0('0x6'),_0x18e0('0x7')]}]},'log':_0x18e0('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index c88a260..e9e63fc 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 _0xbcde=['Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','../client','create'];(function(_0x1a0f6b,_0x17f5db){var _0x2d3d09=function(_0x10d9f4){while(--_0x10d9f4){_0x1a0f6b['push'](_0x1a0f6b['shift']());}};_0x2d3d09(++_0x17f5db);}(_0xbcde,0x1ef));var _0xebcd=function(_0x222162,_0xa9a64d){_0x222162=_0x222162-0x0;var _0x46db7e=_0xbcde[_0x222162];return _0x46db7e;};'use strict';var client=require(_0xebcd('0x0'));exports[_0xebcd('0x1')]=function(_0x2e153d){return client[_0xebcd('0x2')](_0xebcd('0x3'),{'body':_0x2e153d,'log':_0xebcd('0x3')});};exports[_0xebcd('0x4')]=function(_0x4cd900,_0x5bcfb3){return client[_0xebcd('0x2')](_0xebcd('0x5'),{'body':_0x5bcfb3,'options':{'where':{'uniqueid':_0x4cd900},'order':[['id',_0xebcd('0x6')]],'limit':0x1},'log':_0xebcd('0x5')});}; \ No newline at end of file +var _0x7e36=['Request','CreateOpenchannelQueueReport','update','DESC','../client','create'];(function(_0x26ac72,_0x482803){var _0x25fc90=function(_0x5f063c){while(--_0x5f063c){_0x26ac72['push'](_0x26ac72['shift']());}};_0x25fc90(++_0x482803);}(_0x7e36,0x166));var _0x67e3=function(_0x1acc2d,_0x597696){_0x1acc2d=_0x1acc2d-0x0;var _0xabfa6d=_0x7e36[_0x1acc2d];return _0xabfa6d;};'use strict';var client=require(_0x67e3('0x0'));exports[_0x67e3('0x1')]=function(_0x233242){return client[_0x67e3('0x2')](_0x67e3('0x3'),{'body':_0x233242,'log':'CreateOpenchannelQueueReport'});};exports[_0x67e3('0x4')]=function(_0x3beba1,_0x1e82c1){return client['Request']('UpdateOpenchannelQueueReport',{'body':_0x1e82c1,'options':{'where':{'uniqueid':_0x3beba1},'order':[['id',_0x67e3('0x5')]],'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 067fd11..8ca14a7 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 _0x4016=['updateSmsInteraction','addTagsToSmsInteraction','update'];(function(_0x3ebb69,_0x3e612e){var _0x421e59=function(_0x5a8c66){while(--_0x5a8c66){_0x3ebb69['push'](_0x3ebb69['shift']());}};_0x421e59(++_0x3e612e);}(_0x4016,0x131));var _0x6401=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x4016[_0xa464c9];return _0x3d73c4;};'use strict';var client=require('../client');exports[_0x6401('0x0')]=function(_0x40f99f,_0x48c66b){return client['Request']('UpdateSmsInteraction',{'body':_0x48c66b,'options':{'where':{'id':_0x40f99f}},'log':_0x6401('0x1')});};exports['addTags']=function(_0x4fc38,_0x27c82a){return client['Request']('AddTagsToSmsInteraction',{'body':_0x27c82a,'options':{'where':{'id':_0x4fc38}},'log':_0x6401('0x2')});}; \ No newline at end of file +var _0x2cc1=['UpdateSmsInteraction','updateSmsInteraction','addTags','AddTagsToSmsInteraction','../client','update','Request'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x2cc1,0x1bd));var _0x12cc=function(_0x4361b6,_0x29e3fe){_0x4361b6=_0x4361b6-0x0;var _0x477231=_0x2cc1[_0x4361b6];return _0x477231;};'use strict';var client=require(_0x12cc('0x0'));exports[_0x12cc('0x1')]=function(_0x4387a4,_0x3b815b){return client[_0x12cc('0x2')](_0x12cc('0x3'),{'body':_0x3b815b,'options':{'where':{'id':_0x4387a4}},'log':_0x12cc('0x4')});};exports[_0x12cc('0x5')]=function(_0x49436d,_0x587141){return client[_0x12cc('0x2')](_0x12cc('0x6'),{'body':_0x587141,'options':{'where':{'id':_0x49436d}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 3951204..3a037b2 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 _0x2c6b=['../client','create','Request','CreateSmsMessage','createSmsMessage'];(function(_0x158798,_0xb82129){var _0x7ffe48=function(_0x3a20ac){while(--_0x3a20ac){_0x158798['push'](_0x158798['shift']());}};_0x7ffe48(++_0xb82129);}(_0x2c6b,0x177));var _0xb2c6=function(_0x17bc3f,_0x57dcee){_0x17bc3f=_0x17bc3f-0x0;var _0x2e56e1=_0x2c6b[_0x17bc3f];return _0x2e56e1;};'use strict';var client=require(_0xb2c6('0x0'));exports[_0xb2c6('0x1')]=function(_0x557a24){return client[_0xb2c6('0x2')](_0xb2c6('0x3'),{'body':_0x557a24,'log':_0xb2c6('0x4')});}; \ No newline at end of file +var _0x134e=['create','Request','CreateSmsMessage'];(function(_0x16d028,_0x38dc25){var _0x2dbdb3=function(_0x455f3d){while(--_0x455f3d){_0x16d028['push'](_0x16d028['shift']());}};_0x2dbdb3(++_0x38dc25);}(_0x134e,0x93));var _0xe134=function(_0x6da5c1,_0x4e0857){_0x6da5c1=_0x6da5c1-0x0;var _0x55d929=_0x134e[_0x6da5c1];return _0x55d929;};'use strict';var client=require('../client');exports[_0xe134('0x0')]=function(_0x33c69c){return client[_0xe134('0x1')](_0xe134('0x2'),{'body':_0x33c69c,'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 9f9918a..7ea6c4c 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 _0xd8b0=['timeout','strategy','User','Agents','name','../client','getSmsQueues'];(function(_0xf1c89e,_0x2209a9){var _0xa0613=function(_0x5b1e8c){while(--_0x5b1e8c){_0xf1c89e['push'](_0xf1c89e['shift']());}};_0xa0613(++_0x2209a9);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var client=require(_0x0d8b('0x0'));exports[_0x0d8b('0x1')]=function(){return function(){return client['Request']('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0d8b('0x2'),_0x0d8b('0x3')],'include':[{'model':_0x0d8b('0x4'),'as':_0x0d8b('0x5'),'attributes':['id',_0x0d8b('0x6'),'online','smsPause']}]},'log':_0x0d8b('0x1')});};}; \ No newline at end of file +var _0x70e0=['User','Agents','online','../client','getSmsQueues','Request','timeout','strategy'];(function(_0x30471c,_0x4b5e23){var _0x56f02a=function(_0x2bd1d0){while(--_0x2bd1d0){_0x30471c['push'](_0x30471c['shift']());}};_0x56f02a(++_0x4b5e23);}(_0x70e0,0x17b));var _0x070e=function(_0x298ac0,_0x432971){_0x298ac0=_0x298ac0-0x0;var _0x186a7e=_0x70e0[_0x298ac0];return _0x186a7e;};'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 a883f54..70d7fff 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 _0x70e0=['create','CreateSmsQueueReport','update','UpdateSmsQueueReport','../client'];(function(_0x2a2091,_0x5d6a29){var _0x284077=function(_0x52e315){while(--_0x52e315){_0x2a2091['push'](_0x2a2091['shift']());}};_0x284077(++_0x5d6a29);}(_0x70e0,0x17b));var _0x070e=function(_0x10ad96,_0x591d46){_0x10ad96=_0x10ad96-0x0;var _0x39c609=_0x70e0[_0x10ad96];return _0x39c609;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(_0x198c2e){return client['Request']('CreateSmsQueueReport',{'body':_0x198c2e,'log':_0x070e('0x2')});};exports[_0x070e('0x3')]=function(_0x277d32,_0x2593e5){return client['Request'](_0x070e('0x4'),{'body':_0x2593e5,'options':{'where':{'uniqueid':_0x277d32},'order':[['id','DESC']],'limit':0x1},'log':_0x070e('0x4')});}; \ No newline at end of file +var _0x55ca=['../client','create','CreateSmsQueueReport','update','Request','UpdateSmsQueueReport','DESC'];(function(_0xfc0067,_0x3d6303){var _0x2d2bd3=function(_0x3b005c){while(--_0x3b005c){_0xfc0067['push'](_0xfc0067['shift']());}};_0x2d2bd3(++_0x3d6303);}(_0x55ca,0x126));var _0xa55c=function(_0x491b60,_0x4dcc2c){_0x491b60=_0x491b60-0x0;var _0x461a23=_0x55ca[_0x491b60];return _0x461a23;};'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 7f8054a..95c60e1 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(_0x2d2ffc,_0xabf7e6){var _0x48decc=function(_0xede534){while(--_0xede534){_0x2d2ffc['push'](_0x2d2ffc['shift']());}};_0x48decc(++_0xabf7e6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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(_0x8c0c75,_0x3be00f){var _0x122a19=function(_0x5be2e3){while(--_0x5be2e3){_0x8c0c75['push'](_0x8c0c75['shift']());}};_0x122a19(++_0x3be00f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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 cc87263..51f0b12 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 _0xffd6=['update','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','Request','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client'];(function(_0x28d3ef,_0x4bc32f){var _0x1efee7=function(_0x273325){while(--_0x273325){_0x28d3ef['push'](_0x28d3ef['shift']());}};_0x1efee7(++_0x4bc32f);}(_0xffd6,0x97));var _0x6ffd=function(_0x448f8,_0x2aa1d7){_0x448f8=_0x448f8-0x0;var _0xa73126=_0xffd6[_0x448f8];return _0xa73126;};'use strict';var client=require(_0x6ffd('0x0'));exports[_0x6ffd('0x1')]=function(_0x292378,_0x4fadac){return client['Request'](_0x6ffd('0x2'),{'body':_0x4fadac,'options':{'where':{'id':_0x292378}},'log':_0x6ffd('0x3')});};exports[_0x6ffd('0x4')]=function(_0x560afa,_0x1d12e3){return client[_0x6ffd('0x5')](_0x6ffd('0x6'),{'body':_0x1d12e3,'options':{'where':{'id':_0x560afa}},'log':_0x6ffd('0x7')});}; \ No newline at end of file +var _0x0309=['updateWhatsappInteraction','addTags','../client','Request','UpdateWhatsappInteraction'];(function(_0x1fe794,_0x5c1a61){var _0x5216b2=function(_0x2558b2){while(--_0x2558b2){_0x1fe794['push'](_0x1fe794['shift']());}};_0x5216b2(++_0x5c1a61);}(_0x0309,0x165));var _0x9030=function(_0xe34cff,_0x31d9f8){_0xe34cff=_0xe34cff-0x0;var _0x1d2291=_0x0309[_0xe34cff];return _0x1d2291;};'use strict';var client=require(_0x9030('0x0'));exports['update']=function(_0x19fdcc,_0x4875db){return client[_0x9030('0x1')](_0x9030('0x2'),{'body':_0x4875db,'options':{'where':{'id':_0x19fdcc}},'log':_0x9030('0x3')});};exports[_0x9030('0x4')]=function(_0x29e331,_0x2e6276){return client[_0x9030('0x1')]('AddTagsToWhatsappInteraction',{'body':_0x2e6276,'options':{'where':{'id':_0x29e331}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 6358d1d..273715d 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 _0x8e7b=['Request','CreateWhatsappMessage','create'];(function(_0x190e0a,_0x5c4772){var _0x5417be=function(_0x3a3d45){while(--_0x3a3d45){_0x190e0a['push'](_0x190e0a['shift']());}};_0x5417be(++_0x5c4772);}(_0x8e7b,0x80));var _0xb8e7=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x8e7b[_0x344a3f];return _0x264712;};'use strict';var client=require('../client');exports[_0xb8e7('0x0')]=function(_0x2c948f){return client[_0xb8e7('0x1')](_0xb8e7('0x2'),{'body':_0x2c948f,'log':'createWhatsappMessage'});}; \ No newline at end of file +var _0x5573=['../client','create','Request','createWhatsappMessage'];(function(_0x1ebce2,_0x10e903){var _0x4a330c=function(_0x4fd810){while(--_0x4fd810){_0x1ebce2['push'](_0x1ebce2['shift']());}};_0x4a330c(++_0x10e903);}(_0x5573,0xd0));var _0x3557=function(_0x2d2e85,_0x22faa9){_0x2d2e85=_0x2d2e85-0x0;var _0x3e9f5e=_0x5573[_0x2d2e85];return _0x3e9f5e;};'use strict';var client=require(_0x3557('0x0'));exports[_0x3557('0x1')]=function(_0x34512a){return client[_0x3557('0x2')]('CreateWhatsappMessage',{'body':_0x34512a,'log':_0x3557('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index c4a7275..a802284 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 _0x9bb0=['Agents','online','whatsappPause','../client','getWhatsappQueues','GetWhatsappQueue','name','timeout'];(function(_0x663a9e,_0x163492){var _0x2b133e=function(_0x4912b0){while(--_0x4912b0){_0x663a9e['push'](_0x663a9e['shift']());}};_0x2b133e(++_0x163492);}(_0x9bb0,0x163));var _0x09bb=function(_0x439534,_0x4ff786){_0x439534=_0x439534-0x0;var _0x211660=_0x9bb0[_0x439534];return _0x211660;};'use strict';var client=require(_0x09bb('0x0'));exports[_0x09bb('0x1')]=function(){return function(){return client['Request'](_0x09bb('0x2'),{'options':{'raw':![],'attributes':['id',_0x09bb('0x3'),_0x09bb('0x4'),'strategy'],'include':[{'model':'User','as':_0x09bb('0x5'),'attributes':['id',_0x09bb('0x3'),_0x09bb('0x6'),_0x09bb('0x7')]}]},'log':_0x09bb('0x1')});};}; \ No newline at end of file +var _0xc5b3=['../client','getWhatsappQueues','Request','name','strategy','User','Agents','whatsappPause'];(function(_0x55ff79,_0x3d45e7){var _0x579067=function(_0x3650e4){while(--_0x3650e4){_0x55ff79['push'](_0x55ff79['shift']());}};_0x579067(++_0x3d45e7);}(_0xc5b3,0xb0));var _0x3c5b=function(_0x39fd11,_0x5d7883){_0x39fd11=_0x39fd11-0x0;var _0x302799=_0xc5b3[_0x39fd11];return _0x302799;};'use strict';var client=require(_0x3c5b('0x0'));exports[_0x3c5b('0x1')]=function(){return function(){return client[_0x3c5b('0x2')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0x3c5b('0x3'),'timeout',_0x3c5b('0x4')],'include':[{'model':_0x3c5b('0x5'),'as':_0x3c5b('0x6'),'attributes':['id',_0x3c5b('0x3'),'online',_0x3c5b('0x7')]}]},'log':_0x3c5b('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 8806ad1..dbdd31b 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 _0xf320=['create','Request','CreateWhatsappQueueReport','update','DESC','UpdateWhatsappQueueReport','../client'];(function(_0x11ccde,_0x42546d){var _0x2fac73=function(_0x287939){while(--_0x287939){_0x11ccde['push'](_0x11ccde['shift']());}};_0x2fac73(++_0x42546d);}(_0xf320,0xed));var _0x0f32=function(_0x96a519,_0x1de251){_0x96a519=_0x96a519-0x0;var _0xf31872=_0xf320[_0x96a519];return _0xf31872;};'use strict';var client=require(_0x0f32('0x0'));exports[_0x0f32('0x1')]=function(_0x575748){return client[_0x0f32('0x2')](_0x0f32('0x3'),{'body':_0x575748,'log':_0x0f32('0x3')});};exports[_0x0f32('0x4')]=function(_0x26c57f,_0x5e730d){return client[_0x0f32('0x2')]('UpdateWhatsappQueueReport',{'body':_0x5e730d,'options':{'where':{'uniqueid':_0x26c57f},'order':[['id',_0x0f32('0x5')]],'limit':0x1},'log':_0x0f32('0x6')});}; \ No newline at end of file +var _0x6a73=['Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','../client','create'];(function(_0x31e584,_0x4d9f7f){var _0x5686d0=function(_0x1f9e99){while(--_0x1f9e99){_0x31e584['push'](_0x31e584['shift']());}};_0x5686d0(++_0x4d9f7f);}(_0x6a73,0xd6));var _0x36a7=function(_0x29c261,_0x3af39a){_0x29c261=_0x29c261-0x0;var _0x1a9335=_0x6a73[_0x29c261];return _0x1a9335;};'use strict';var client=require(_0x36a7('0x0'));exports[_0x36a7('0x1')]=function(_0x5a7895){return client[_0x36a7('0x2')](_0x36a7('0x3'),{'body':_0x5a7895,'log':'CreateWhatsappQueueReport'});};exports[_0x36a7('0x4')]=function(_0xb5308e,_0x54504b){return client[_0x36a7('0x2')](_0x36a7('0x5'),{'body':_0x54504b,'options':{'where':{'uniqueid':_0xb5308e},'order':[['id','DESC']],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index 6d4dde5..8b31fde 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 _0x7112=['timeout','atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','validate','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','string','number','info','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','message','join','stop','find','agents'];(function(_0x255bed,_0x49636a){var _0x496608=function(_0x17fb5f){while(--_0x17fb5f){_0x255bed['push'](_0x255bed['shift']());}};_0x496608(++_0x49636a);}(_0x7112,0x15c));var _0x2711=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7112[_0xa464c9];return _0x3d73c4;};'use strict';var schema=require(_0x2711('0x0'));var _=require(_0x2711('0x1'));var util=require(_0x2711('0x2'));var seqqueue=require(_0x2711('0x3'));var logger=require(_0x2711('0x4'))(_0x2711('0x5'));var strategy=require(_0x2711('0x6'));var queue=schema({'name':{'type':_0x2711('0x7'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x2711('0x8'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x58512d,_0x58110f,_0x35aacf){return logger[_0x2711('0x9')](util['format']('[%s][AGENT][NAME:%s][STATUS:%s]',_0x58512d,_0x58110f['name'],_0x35aacf));}function handleFindAgent(_0x53ff8e){return function(_0x43c9bc){return _0x43c9bc[_0x2711('0xa')][_0x2711('0xb')]()===_0x53ff8e[_0x2711('0xb')]();};}exports[_0x2711('0xc')]=function(_0x106f7a,_0x2fd446,_0x2bb7ec,_0x252e19){return function(_0x3dc338){try{var _0xdfd50e={'name':_0x2fd446[0x0],'timeout':_0x2fd446[0x1]};var _0x3c7e10=queue[_0x2711('0x0')](_0xdfd50e,{'typecast':!![]});if(_0x3c7e10[_0x2711('0xd')]){logger[_0x2711('0xe')](_0x2711('0xf'),_0x106f7a,_[_0x2711('0x10')](_0x3c7e10,_0x2711('0x11'))[_0x2711('0x12')](',\x20'));_0x3dc338[_0x2711('0x13')]();}else{var _0x29b653=_[_0x2711('0x14')](_0x2bb7ec[_0x2711('0x15')],handleFindAgent(_0xdfd50e[_0x2711('0xa')]));if(_0x29b653){var _0x164519=(_0xdfd50e[_0x2711('0x16')]||0xa)*0x3e8;var _0x50811c,_0x1286cb;var _0x3448c7=seqqueue['createQueue'](_0x164519);_0x3448c7['id']=_0x106f7a;_0x3448c7[_0x2711('0x17')]=_0x164519;_0x3448c7[_0x2711('0x18')]=_0x252e19['channel'];writeLog(_0x106f7a,_0x29b653,util['format'](_0x2711('0x19'),_0x164519));_0x2bb7ec[_0x2711('0x1a')][_0x106f7a]['on'](_0x2711('0x1b'),function(){logger[_0x2711('0x9')](_0x2711('0x1c'),_0x106f7a);clearTimeout(_0x1286cb);_0x1286cb=undefined;_0x3448c7[_0x2711('0x1d')]();if(_0x2bb7ec[_0x2711('0x1a')][_0x106f7a]){delete _0x2bb7ec[_0x2711('0x1a')][_0x106f7a];}_0x3dc338['stop']();});_0x2bb7ec['rules'][_0x106f7a]['on'](_0x2711('0x1e'),function(){if(_0x2bb7ec[_0x2711('0x1a')][_0x106f7a]){delete _0x2bb7ec[_0x2711('0x1a')][_0x106f7a];}});_0x1286cb=setTimeout(function(){logger[_0x2711('0x9')](_0x2711('0x1f'),_0x106f7a);clearTimeout(_0x1286cb);_0x3448c7[_0x2711('0x1d')]();_0x3dc338[_0x2711('0x20')]();},_0x164519);strategy[_0x2711('0x21')](_0x3448c7,_0x29b653,_0x2bb7ec,_0x252e19);}else{logger[_0x2711('0xe')](_0x2711('0x22'),_0x106f7a,_0xdfd50e[_0x2711('0xa')]);_0x3dc338[_0x2711('0x13')]();}}}catch(_0x31a930){console[_0x2711('0x23')](_0x31a930);logger[_0x2711('0xe')](_0x2711('0x24'),_0x106f7a,_0x31a930['stack']);_0x3dc338[_0x2711('0x13')]();}};}; \ No newline at end of file +var _0x65ac=['end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','stop','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','log','[%s][QUEUE]\x20%s','stack','lodash','util','seq-queue','routing','string','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','validate','length','error','map','message','join','find','agents','createQueue','channel','rules'];(function(_0x4a163c,_0x252f3d){var _0x52d17f=function(_0x29b474){while(--_0x29b474){_0x4a163c['push'](_0x4a163c['shift']());}};_0x52d17f(++_0x252f3d);}(_0x65ac,0x100));var _0xc65a=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x65ac[_0x13e741];return _0x3f8bb3;};'use strict';var schema=require('validate');var _=require(_0xc65a('0x0'));var util=require(_0xc65a('0x1'));var seqqueue=require(_0xc65a('0x2'));var logger=require('../../../../config/logger')(_0xc65a('0x3'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0xc65a('0x4'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xc65a('0x5'),'message':_0xc65a('0x6')}});function writeLog(_0x3dac21,_0x25abc5,_0x979e5b){return logger[_0xc65a('0x7')](util[_0xc65a('0x8')](_0xc65a('0x9'),_0x3dac21,_0x25abc5[_0xc65a('0xa')],_0x979e5b));}function handleFindAgent(_0x7ac755){return function(_0x2e160a){return _0x2e160a[_0xc65a('0xa')][_0xc65a('0xb')]()===_0x7ac755[_0xc65a('0xb')]();};}exports[_0xc65a('0xc')]=function(_0x37569b,_0x2a574c,_0x14e923,_0x2702b3){return function(_0x507289){try{var _0x1bcb0f={'name':_0x2a574c[0x0],'timeout':_0x2a574c[0x1]};var _0x2642db=queue[_0xc65a('0xd')](_0x1bcb0f,{'typecast':!![]});if(_0x2642db[_0xc65a('0xe')]){logger[_0xc65a('0xf')]('[%s][AGENT]\x20%s',_0x37569b,_[_0xc65a('0x10')](_0x2642db,_0xc65a('0x11'))[_0xc65a('0x12')](',\x20'));_0x507289['stop']();}else{var _0x5755d7=_[_0xc65a('0x13')](_0x14e923[_0xc65a('0x14')],handleFindAgent(_0x1bcb0f['name']));if(_0x5755d7){var _0x1aa1ce=(_0x1bcb0f['timeout']||0xa)*0x3e8;var _0x114237,_0x45c819;var _0x48ba52=seqqueue[_0xc65a('0x15')](_0x1aa1ce);_0x48ba52['id']=_0x37569b;_0x48ba52['atimeout']=_0x1aa1ce;_0x48ba52[_0xc65a('0x16')]=_0x2702b3['channel'];writeLog(_0x37569b,_0x5755d7,util[_0xc65a('0x8')]('START:%s',_0x1aa1ce));_0x14e923[_0xc65a('0x17')][_0x37569b]['on'](_0xc65a('0x18'),function(){logger[_0xc65a('0x7')](_0xc65a('0x19'),_0x37569b);clearTimeout(_0x45c819);_0x45c819=undefined;_0x48ba52[_0xc65a('0x1a')]();if(_0x14e923[_0xc65a('0x17')][_0x37569b]){delete _0x14e923[_0xc65a('0x17')][_0x37569b];}_0x507289[_0xc65a('0x1b')]();});_0x14e923[_0xc65a('0x17')][_0x37569b]['on'](_0xc65a('0x1c'),function(){if(_0x14e923[_0xc65a('0x17')][_0x37569b]){delete _0x14e923[_0xc65a('0x17')][_0x37569b];}});_0x45c819=setTimeout(function(){logger['info'](_0xc65a('0x1d'),_0x37569b);clearTimeout(_0x45c819);_0x48ba52[_0xc65a('0x1a')]();_0x507289[_0xc65a('0x1e')]();},_0x1aa1ce);strategy[_0xc65a('0x1f')](_0x48ba52,_0x5755d7,_0x14e923,_0x2702b3);}else{logger[_0xc65a('0xf')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x37569b,_0x1bcb0f[_0xc65a('0xa')]);_0x507289['stop']();}}}catch(_0x1801da){console[_0xc65a('0x20')](_0x1801da);logger[_0xc65a('0xf')](_0xc65a('0x21'),_0x37569b,_0x1801da[_0xc65a('0x22')]);_0x507289[_0xc65a('0x1b')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index defdce9..eb9f212 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 _0x2625=['info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','ChatWebsiteId','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','Message','then','body','catch','finally','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','next','amazonlex','providerName','providerResponse','stringify','create','dialogState','Failed','lodash','moment','aws-sdk','./utils','../../../../config/logger','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','interaction','UserId'];(function(_0x5e84cd,_0xb0d9f3){var _0xafd3e6=function(_0x2babeb){while(--_0x2babeb){_0x5e84cd['push'](_0x5e84cd['shift']());}};_0xafd3e6(++_0xb0d9f3);}(_0x2625,0x166));var _0x5262=function(_0x39d544,_0x35c14f){_0x39d544=_0x39d544-0x0;var _0x5a5ff2=_0x2625[_0x39d544];return _0x5a5ff2;};'use strict';var _=require(_0x5262('0x0'));var moment=require(_0x5262('0x1'));var AWS=require(_0x5262('0x2'));var utils=require(_0x5262('0x3'));var logger=require(_0x5262('0x4'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x5262('0x5')),'smsMessage':require(_0x5262('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x5262('0x7'))};exports['consequence']=function(_0x53add5,_0x2776aa){return function(_0x3c65c5){try{if(!_['isNil'](this[_0x5262('0x8')][_0x5262('0x9')])){logger[_0x5262('0xa')](_0x5262('0xb'),_0x53add5,_0x5262('0xc'));return _0x3c65c5['next']();}var _0x5747ba={'ContactId':this[_0x5262('0xd')]['id'],'sentAt':moment()[_0x5262('0xe')](_0x5262('0xf')),'direction':_0x5262('0x10')};if(this[_0x5262('0x11')]==='sms'||this[_0x5262('0x11')]===_0x5262('0x12')){_0x5747ba['phone']=this[_0x5262('0x8')][_0x5262('0x13')];}var _0x381c2a=this[_0x5262('0x11')];if(_0x381c2a===_0x5262('0x14')){_0x5747ba[_0x5262('0x15')]=this['account']['id'];}else{_0x5747ba[_[_0x5262('0x16')](_0x381c2a)+_0x5262('0x17')]=this['account']['id'];}_0x5747ba[_[_0x5262('0x16')](_0x381c2a)+_0x5262('0x18')]=this[_0x5262('0x8')]['id'];if(this['interaction'][_0x5262('0x19')]){var _0x54d8ed=_0x2776aa[0x4];if(!_[_0x5262('0x1a')](_0x54d8ed)){_0x5747ba['body']=utils[_0x5262('0x1b')](_0x54d8ed,this);return rpc[_0x381c2a+_0x5262('0x1c')]['create'](_0x5747ba)[_0x5262('0x1d')](function(_0x1a02c6){logger['info'](_0x5262('0xb'),_0x53add5,_0x5747ba[_0x5262('0x1e')]);})[_0x5262('0x1f')](function(_0x10e5cb){logger['error'](_0x5262('0xb'),_0x53add5,JSON['stringify'](_0x10e5cb));})[_0x5262('0x20')](function(){logger[_0x5262('0xa')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x53add5);_0x3c65c5[_0x5262('0x21')]();});}else{logger[_0x5262('0xa')](_0x5262('0x22'),_0x53add5);_0x3c65c5['stop']();}}else{var _0x39e19f=this;var _0x4c0c65=new AWS[(_0x5262('0x23'))]({'accessKeyId':_0x2776aa[0x0],'secretAccessKey':_0x2776aa[0x1],'region':_0x2776aa[0x2]});var _0x1c6be2={'botAlias':_0x5262('0x24'),'botName':_0x2776aa[0x3],'inputText':this['message']['body'],'userId':this[_0x5262('0x11')]+':'+this[_0x5262('0x8')]['id']['toString']()};_0x4c0c65['postText'](_0x1c6be2,function(_0x10a571,_0x2315a0){if(_0x10a571){logger['error'](_0x5262('0xb'),_0x53add5,_0x10a571[_0x5262('0x25')]);_0x3c65c5[_0x5262('0x26')]();}else if(_0x2315a0&&_0x2315a0[_0x5262('0x25')]){_0x39e19f[_0x5262('0x1e')][_0x5262('0x27')]=_0x2315a0;_0x5747ba[_0x5262('0x1e')]=_0x2315a0['message'];_0x5747ba[_0x5262('0x28')]=_0x5262('0x27');_0x5747ba[_0x5262('0x29')]=JSON[_0x5262('0x2a')](_0x2315a0);return rpc[_0x381c2a+_0x5262('0x1c')][_0x5262('0x2b')](_0x5747ba)['then'](function(_0x4fd357){logger[_0x5262('0xa')](_0x5262('0xb'),_0x53add5,_0x5747ba[_0x5262('0x1e')]);if(_0x2315a0[_0x5262('0x2c')]==_0x5262('0x2d')){_0x3c65c5['next']();}else{_0x3c65c5[_0x5262('0x21')]();}})[_0x5262('0x1f')](function(_0x34d7e2){logger['error'](_0x5262('0xb'),_0x53add5,JSON['stringify'](_0x34d7e2));_0x3c65c5[_0x5262('0x26')]();});}else{_0x3c65c5[_0x5262('0x26')]();}});}}catch(_0x2a5eb4){logger['error'](_0x5262('0xb'),_0x53add5,JSON[_0x5262('0x2a')](_0x2a5eb4));_0x3c65c5[_0x5262('0x21')]();}};}; \ No newline at end of file +var _0xf202=['then','catch','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','whatsapp','phone','chat','upperFirst','AccountId','account','InteractionId','created','isEmpty','body','create','info','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','error','amazonlex','Message'];(function(_0x54e218,_0x51fae6){var _0xdb60f8=function(_0x274685){while(--_0x274685){_0x54e218['push'](_0x54e218['shift']());}};_0xdb60f8(++_0x51fae6);}(_0xf202,0x1e2));var _0x2f20=function(_0xa476b3,_0xaa4568){_0xa476b3=_0xa476b3-0x0;var _0x332b2c=_0xf202[_0xa476b3];return _0x332b2c;};'use strict';var _=require(_0x2f20('0x0'));var moment=require(_0x2f20('0x1'));var AWS=require('aws-sdk');var utils=require(_0x2f20('0x2'));var logger=require(_0x2f20('0x3'))(_0x2f20('0x4'));var rpc={'chatMessage':require(_0x2f20('0x5')),'openchannelMessage':require(_0x2f20('0x6')),'mailMessage':require(_0x2f20('0x7')),'smsMessage':require(_0x2f20('0x8')),'faxMessage':require(_0x2f20('0x9')),'whatsappMessage':require(_0x2f20('0xa'))};exports[_0x2f20('0xb')]=function(_0x42f7f8,_0x4a3b84){return function(_0x27e92e){try{if(!_[_0x2f20('0xc')](this[_0x2f20('0xd')][_0x2f20('0xe')])){logger['info'](_0x2f20('0xf'),_0x42f7f8,_0x2f20('0x10'));return _0x27e92e[_0x2f20('0x11')]();}var _0x59b1ef={'ContactId':this[_0x2f20('0x12')]['id'],'sentAt':moment()[_0x2f20('0x13')](_0x2f20('0x14')),'direction':_0x2f20('0x15')};if(this['channel']===_0x2f20('0x16')||this[_0x2f20('0x17')]===_0x2f20('0x18')){_0x59b1ef[_0x2f20('0x19')]=this['interaction'][_0x2f20('0x19')];}var _0x21e88a=this[_0x2f20('0x17')];if(_0x21e88a===_0x2f20('0x1a')){_0x59b1ef['ChatWebsiteId']=this['account']['id'];}else{_0x59b1ef[_[_0x2f20('0x1b')](_0x21e88a)+_0x2f20('0x1c')]=this[_0x2f20('0x1d')]['id'];}_0x59b1ef[_[_0x2f20('0x1b')](_0x21e88a)+_0x2f20('0x1e')]=this[_0x2f20('0xd')]['id'];if(this['interaction'][_0x2f20('0x1f')]){var _0x30ef1a=_0x4a3b84[0x4];if(!_[_0x2f20('0x20')](_0x30ef1a)){_0x59b1ef[_0x2f20('0x21')]=utils['getMustacheRender'](_0x30ef1a,this);return rpc[_0x21e88a+'Message'][_0x2f20('0x22')](_0x59b1ef)['then'](function(_0x1d1010){logger[_0x2f20('0x23')](_0x2f20('0xf'),_0x42f7f8,_0x59b1ef[_0x2f20('0x21')]);})['catch'](function(_0x3a42f3){logger['error'](_0x2f20('0xf'),_0x42f7f8,JSON[_0x2f20('0x24')](_0x3a42f3));})['finally'](function(){logger['info'](_0x2f20('0x25'),_0x42f7f8);_0x27e92e[_0x2f20('0x26')]();});}else{logger[_0x2f20('0x23')](_0x2f20('0x27'),_0x42f7f8);_0x27e92e['stop']();}}else{var _0x2b853f=this;var _0x2b799b=new AWS[(_0x2f20('0x28'))]({'accessKeyId':_0x4a3b84[0x0],'secretAccessKey':_0x4a3b84[0x1],'region':_0x4a3b84[0x2]});var _0x27daf9={'botAlias':'$LATEST','botName':_0x4a3b84[0x3],'inputText':this[_0x2f20('0x29')][_0x2f20('0x21')],'userId':this[_0x2f20('0x17')]+':'+this[_0x2f20('0xd')]['id'][_0x2f20('0x2a')]()};_0x2b799b['postText'](_0x27daf9,function(_0x590914,_0x573bf6){if(_0x590914){logger[_0x2f20('0x2b')](_0x2f20('0xf'),_0x42f7f8,_0x590914[_0x2f20('0x29')]);_0x27e92e['next']();}else if(_0x573bf6&&_0x573bf6[_0x2f20('0x29')]){_0x2b853f[_0x2f20('0x21')][_0x2f20('0x2c')]=_0x573bf6;_0x59b1ef[_0x2f20('0x21')]=_0x573bf6['message'];_0x59b1ef['providerName']='amazonlex';_0x59b1ef['providerResponse']=JSON[_0x2f20('0x24')](_0x573bf6);return rpc[_0x21e88a+_0x2f20('0x2d')]['create'](_0x59b1ef)[_0x2f20('0x2e')](function(_0xdb671a){logger['info'](_0x2f20('0xf'),_0x42f7f8,_0x59b1ef[_0x2f20('0x21')]);if(_0x573bf6['dialogState']=='Failed'){_0x27e92e[_0x2f20('0x11')]();}else{_0x27e92e[_0x2f20('0x26')]();}})[_0x2f20('0x2f')](function(_0x5c9b5c){logger['error'](_0x2f20('0xf'),_0x42f7f8,JSON[_0x2f20('0x24')](_0x5c9b5c));_0x27e92e[_0x2f20('0x11')]();});}else{_0x27e92e[_0x2f20('0x11')]();}});}}catch(_0x4dc6c2){logger[_0x2f20('0x2b')](_0x2f20('0xf'),_0x42f7f8,JSON['stringify'](_0x4dc6c2));_0x27e92e['stop']();}};}; \ 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 a043bff..58cb5c2 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 _0x2465=['[%s][AUTOREPLY]\x20%s','finally','resolve','stop','moment','./utils','routing','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','interaction','created','info','next','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','channel','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','mail','body','getMustacheRender','message','from','phone','subject','Re:\x20','chat','ChatWebsiteId','account','upperFirst','AccountId','Message','service','Smtp','port','secure','authentication','user','inReplyTo','html','','','headers','All','auto_reply','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','create','stringify','error','[RPC][%s][AUTOREPLY]\x20%s','Interaction','update','catch','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s'];(function(_0x4762d3,_0xc09b0c){var _0x3ed202=function(_0xe970eb){while(--_0xe970eb){_0x4762d3['push'](_0x4762d3['shift']());}};_0x3ed202(++_0xc09b0c);}(_0x2465,0x8e));var _0x5246=function(_0x484b4a,_0x4c9d15){_0x484b4a=_0x484b4a-0x0;var _0x2cf1df=_0x2465[_0x484b4a];return _0x2cf1df;};'use strict';var _=require('lodash');var moment=require(_0x5246('0x0'));var utils=require(_0x5246('0x1'));var logger=require('../../../../config/logger')(_0x5246('0x2'));var rpc={'chatMessage':require(_0x5246('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x5246('0x4')),'faxMessage':require(_0x5246('0x5')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0x5246('0x6')),'openchannelInteraction':require(_0x5246('0x7')),'mailInteraction':require(_0x5246('0x8')),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require(_0x5246('0x9')),'whatsappInteraction':require(_0x5246('0xa'))};var mailRpc=require(_0x5246('0xb'));exports[_0x5246('0xc')]=function(_0x445524,_0x1391db){return function(_0xf7d09c){try{if(_0x1391db[0x0]==='1'&&(_['isNil'](this[_0x5246('0xd')]['created'])||!this[_0x5246('0xd')][_0x5246('0xe')])){logger[_0x5246('0xf')]('[%s][AUTOREPLY]\x20%s',_0x445524,'Autoreply\x20already\x20sent');return _0xf7d09c[_0x5246('0x10')]();}if(_0x1391db[0x0]==='2'&&this['interaction'][_0x5246('0x11')]){logger['info'](_0x5246('0x12'),_0x445524,_0x5246('0x13'));return _0xf7d09c[_0x5246('0x10')]();}var _0x15eaf0=this[_0x5246('0x14')];var _0x476660={'ContactId':this[_0x5246('0x15')]['id'],'sentAt':moment()[_0x5246('0x16')](_0x5246('0x17')),'direction':_0x5246('0x18')};if(this[_0x5246('0x14')]===_0x5246('0x19')){_0x476660[_0x5246('0x1a')]=utils[_0x5246('0x1b')](_0x1391db[0x2],this);}else{_0x476660['body']=utils[_0x5246('0x1b')](_0x1391db[0x1],this);}if(this[_0x5246('0x1c')]){_0x476660['to']=this[_0x5246('0x1c')][_0x5246('0x1d')]||'';if(this[_0x5246('0x14')]===_0x5246('0x19')&&_0x1391db[0x1]==='1'){_0x476660['cc']=this[_0x5246('0x1c')]['cc']||'';}_0x476660[_0x5246('0x1d')]=this[_0x5246('0x1c')]['to']||'';_0x476660[_0x5246('0x1e')]=this[_0x5246('0x1c')][_0x5246('0x1e')]||'';_0x476660['read']=!![];if(this[_0x5246('0x1c')][_0x5246('0x1f')]){_0x476660[_0x5246('0x1f')]='';_0x476660[_0x5246('0x1f')]+=_['startsWith'](this[_0x5246('0x1c')][_0x5246('0x1f')],'Re:')?'':_0x5246('0x20');_0x476660[_0x5246('0x1f')]+=this[_0x5246('0x1c')][_0x5246('0x1f')];}}if(this[_0x5246('0x14')]===_0x5246('0x21')){_0x476660[_0x5246('0x22')]=this[_0x5246('0x23')]['id'];}else{_0x476660[_[_0x5246('0x24')](this[_0x5246('0x14')])+_0x5246('0x25')]=this['account']['id'];}_0x476660[_[_0x5246('0x24')](this['channel'])+'InteractionId']=this[_0x5246('0xd')]['id'];var _0x2c0dfa=this[_0x5246('0xd')];if(rpc[this['channel']+_0x5246('0x26')]){if(this[_0x5246('0x14')]===_0x5246('0x19')){var _0x278e22={'tls':{'rejectUnauthorized':![]}};if(this[_0x5246('0x23')]['Smtp'][_0x5246('0x27')]){_0x278e22['service']=this[_0x5246('0x23')][_0x5246('0x28')][_0x5246('0x27')];}else{_0x278e22['host']=this[_0x5246('0x23')][_0x5246('0x28')]['host'];_0x278e22[_0x5246('0x29')]=this[_0x5246('0x23')][_0x5246('0x28')]['port'];_0x278e22[_0x5246('0x2a')]=this['account']['Smtp'][_0x5246('0x2a')];}if(this[_0x5246('0x23')]['Smtp'][_0x5246('0x2b')]){_0x278e22['auth']={'user':this['account']['Smtp'][_0x5246('0x2c')],'pass':this[_0x5246('0x23')]['Smtp']['pass']};}_0x476660[_0x5246('0x2d')]=this[_0x5246('0x1c')]['messageId'];_0x476660[_0x5246('0x2e')]=_0x5246('0x2f')+_['replace'](_0x476660[_0x5246('0x1a')],_0x5246('0x30'),_0x5246('0x31'))+_0x5246('0x32');_0x476660[_0x5246('0x33')]={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':_0x5246('0x34'),'Precedence':_0x5246('0x35')};return mailRpc['sendMailMessage'](_0x278e22,_0x476660)[_0x5246('0x36')](function(_0x3ef404){logger[_0x5246('0xf')](_0x5246('0x37'),_0x445524);_0x476660[_0x5246('0x38')]=_0x3ef404[_0x5246('0x1c')][_0x5246('0x38')];return rpc[_0x15eaf0+'Message'][_0x5246('0x39')](_0x476660);})[_0x5246('0x36')](function(_0x25302b){logger[_0x5246('0xf')]('[%s][AUTOREPLY]\x20%s',_0x445524,JSON[_0x5246('0x3a')](_0x25302b));})['catch'](function(_0x406955){logger[_0x5246('0x3b')](_0x5246('0x3c'),_0x445524,JSON[_0x5246('0x3a')](_0x406955));})['finally'](function(){Promise['resolve']()[_0x5246('0x36')](function(){if(_0x1391db[0x0]!=='2'||_0x2c0dfa['autoreplyExecuted'])return;return rpc[_0x15eaf0+_0x5246('0x3d')][_0x5246('0x3e')](_0x2c0dfa['id'],{'autoreplyExecuted':!![]})[_0x5246('0x36')](function(_0xb5ef91){logger['info'](_0x5246('0x12'),_0x445524,JSON[_0x5246('0x3a')](_0xb5ef91));})[_0x5246('0x3f')](function(_0x3d7625){logger[_0x5246('0x3b')](_0x5246('0x40'),_0x445524,JSON[_0x5246('0x3a')](_0x3d7625));});})[_0x5246('0x36')](function(){_0xf7d09c['next']();});});}else{return rpc[this[_0x5246('0x14')]+_0x5246('0x26')][_0x5246('0x39')](_0x476660)['then'](function(_0x2e42b5){logger[_0x5246('0xf')]('[%s][AUTOREPLY]\x20%s',_0x445524,_0x476660[_0x5246('0x1a')]);})[_0x5246('0x3f')](function(_0x34a362){logger['error'](_0x5246('0x41'),_0x445524,JSON['stringify'](_0x34a362));})[_0x5246('0x42')](function(){Promise[_0x5246('0x43')]()[_0x5246('0x36')](function(){if(_0x1391db[0x0]!=='2'||_0x2c0dfa['autoreplyExecuted'])return;return rpc[_0x15eaf0+'Interaction']['update'](_0x2c0dfa['id'],{'autoreplyExecuted':!![]})['then'](function(_0x104610){logger['info']('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x445524,JSON[_0x5246('0x3a')](_0x104610));})[_0x5246('0x3f')](function(_0x41e904){logger['error'](_0x5246('0x40'),_0x445524,JSON['stringify'](_0x41e904));});})[_0x5246('0x36')](function(){_0xf7d09c[_0x5246('0x10')]();});});}}}catch(_0x174a1e){logger[_0x5246('0x3b')](_0x5246('0x41'),_0x445524,JSON[_0x5246('0x3a')](_0x174a1e));_0xf7d09c[_0x5246('0x44')]();}};}; \ No newline at end of file +var _0xaba2=['YYYY-MM-DD\x20HH:mm:ss','out','channel','mail','getMustacheRender','body','message','from','phone','read','subject','startsWith','Re:\x20','chat','ChatWebsiteId','account','Message','service','host','Smtp','port','authentication','auth','pass','inReplyTo','messageId','html','','','headers','auto-replied','auto_reply','sendMailMessage','then','create','stringify','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction','catch','error','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','isNil','interaction','created','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','autoreplyExecuted','info','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','next','contact','format'];(function(_0x51eddc,_0x50980d){var _0x42fc9a=function(_0xbe043f){while(--_0xbe043f){_0x51eddc['push'](_0x51eddc['shift']());}};_0x42fc9a(++_0x50980d);}(_0xaba2,0xbd));var _0x2aba=function(_0x14f9d4,_0x35b621){_0x14f9d4=_0x14f9d4-0x0;var _0x2a8de3=_0xaba2[_0x14f9d4];return _0x2a8de3;};'use strict';var _=require(_0x2aba('0x0'));var moment=require(_0x2aba('0x1'));var utils=require(_0x2aba('0x2'));var logger=require(_0x2aba('0x3'))(_0x2aba('0x4'));var rpc={'chatMessage':require(_0x2aba('0x5')),'openchannelMessage':require(_0x2aba('0x6')),'mailMessage':require(_0x2aba('0x7')),'smsMessage':require(_0x2aba('0x8')),'faxMessage':require(_0x2aba('0x9')),'whatsappMessage':require(_0x2aba('0xa')),'chatInteraction':require(_0x2aba('0xb')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0x2aba('0xc')),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require(_0x2aba('0xd')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require('../../mailRpc');exports[_0x2aba('0xe')]=function(_0x1db4bd,_0x518daf){return function(_0x71dbcb){try{if(_0x518daf[0x0]==='1'&&(_[_0x2aba('0xf')](this[_0x2aba('0x10')][_0x2aba('0x11')])||!this[_0x2aba('0x10')][_0x2aba('0x11')])){logger['info'](_0x2aba('0x12'),_0x1db4bd,_0x2aba('0x13'));return _0x71dbcb['next']();}if(_0x518daf[0x0]==='2'&&this[_0x2aba('0x10')][_0x2aba('0x14')]){logger[_0x2aba('0x15')](_0x2aba('0x16'),_0x1db4bd,_0x2aba('0x17'));return _0x71dbcb[_0x2aba('0x18')]();}var _0x2742d7=this['channel'];var _0xd67881={'ContactId':this[_0x2aba('0x19')]['id'],'sentAt':moment()[_0x2aba('0x1a')](_0x2aba('0x1b')),'direction':_0x2aba('0x1c')};if(this[_0x2aba('0x1d')]===_0x2aba('0x1e')){_0xd67881['body']=utils[_0x2aba('0x1f')](_0x518daf[0x2],this);}else{_0xd67881[_0x2aba('0x20')]=utils['getMustacheRender'](_0x518daf[0x1],this);}if(this[_0x2aba('0x21')]){_0xd67881['to']=this[_0x2aba('0x21')][_0x2aba('0x22')]||'';if(this[_0x2aba('0x1d')]===_0x2aba('0x1e')&&_0x518daf[0x1]==='1'){_0xd67881['cc']=this[_0x2aba('0x21')]['cc']||'';}_0xd67881[_0x2aba('0x22')]=this['message']['to']||'';_0xd67881[_0x2aba('0x23')]=this[_0x2aba('0x21')][_0x2aba('0x23')]||'';_0xd67881[_0x2aba('0x24')]=!![];if(this['message']['subject']){_0xd67881[_0x2aba('0x25')]='';_0xd67881[_0x2aba('0x25')]+=_[_0x2aba('0x26')](this[_0x2aba('0x21')][_0x2aba('0x25')],'Re:')?'':_0x2aba('0x27');_0xd67881[_0x2aba('0x25')]+=this[_0x2aba('0x21')][_0x2aba('0x25')];}}if(this[_0x2aba('0x1d')]===_0x2aba('0x28')){_0xd67881[_0x2aba('0x29')]=this[_0x2aba('0x2a')]['id'];}else{_0xd67881[_['upperFirst'](this[_0x2aba('0x1d')])+'AccountId']=this[_0x2aba('0x2a')]['id'];}_0xd67881[_['upperFirst'](this[_0x2aba('0x1d')])+'InteractionId']=this['interaction']['id'];var _0x2a6396=this['interaction'];if(rpc[this[_0x2aba('0x1d')]+_0x2aba('0x2b')]){if(this[_0x2aba('0x1d')]===_0x2aba('0x1e')){var _0x2087f0={'tls':{'rejectUnauthorized':![]}};if(this['account']['Smtp'][_0x2aba('0x2c')]){_0x2087f0[_0x2aba('0x2c')]=this['account']['Smtp'][_0x2aba('0x2c')];}else{_0x2087f0[_0x2aba('0x2d')]=this[_0x2aba('0x2a')][_0x2aba('0x2e')][_0x2aba('0x2d')];_0x2087f0[_0x2aba('0x2f')]=this[_0x2aba('0x2a')][_0x2aba('0x2e')][_0x2aba('0x2f')];_0x2087f0['secure']=this[_0x2aba('0x2a')][_0x2aba('0x2e')]['secure'];}if(this['account'][_0x2aba('0x2e')][_0x2aba('0x30')]){_0x2087f0[_0x2aba('0x31')]={'user':this['account'][_0x2aba('0x2e')]['user'],'pass':this[_0x2aba('0x2a')]['Smtp'][_0x2aba('0x32')]};}_0xd67881[_0x2aba('0x33')]=this[_0x2aba('0x21')][_0x2aba('0x34')];_0xd67881[_0x2aba('0x35')]=_0x2aba('0x36')+_['replace'](_0xd67881[_0x2aba('0x20')],']+(>|$)/g,''),'priorityTrue':_0x2f2d1f[0x1],'priorityFalse':_0x2f2d1f[0x2]};var _0x2a35cf=gotoif[_0x900c('0x0')](_0x3034d1,{'typecast':!![]});if(_0x2a35cf[_0x900c('0xb')]){logger[_0x900c('0xc')](_0x900c('0xd'),_0x422719,_['map'](_0x2a35cf,_0x900c('0xe'))['join'](',\x20'));_0x4753ed[_0x900c('0xf')]();}else{try{var _0x17c936=eval('('+_0x3034d1[_0x900c('0x10')]+')');var _0x55af01=_0x17c936?_0x3034d1[_0x900c('0x11')]:_0x3034d1[_0x900c('0x12')];logger[_0x900c('0x13')](_0x900c('0x14'),_0x422719,_0x3034d1[_0x900c('0x10')],_0x17c936,_0x55af01||'next');if(_0x55af01){var _0x3f7acc=_['findIndex'](_0x4753ed[_0x900c('0x15')](),{'p':_0x55af01});if(_0x3f7acc>=0x0){logger['info']('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x422719,_0x55af01||_0x900c('0x16'),_0x3f7acc);_0x4753ed[_0x900c('0x16')](_0x3f7acc);}else{logger['info'](_0x900c('0x17'),_0x422719,_0x55af01||_0x900c('0x16'));_0x4753ed['stop']();}}else{_0x4753ed['next']();}}catch(_0x2c92cf){logger[_0x900c('0xc')](_0x900c('0x18'),_0x422719,_0x2c92cf[_0x900c('0xe')]);_0x4753ed[_0x900c('0xf')]();}}}catch(_0x387905){logger[_0x900c('0xc')](_0x900c('0xd'),_0x422719,JSON[_0x900c('0x19')](_0x387905));_0x4753ed['stop']();}};}; \ No newline at end of file +var _0xf5c8=['lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','replace','length','error','[%s][GOTOIF]\x20%s','join','stop','priorityTrue','priorityFalse','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','validate'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xf5c8,0x143));var _0x8f5c=function(_0x13e724,_0x296739){_0x13e724=_0x13e724-0x0;var _0x334a44=_0xf5c8[_0x13e724];return _0x334a44;};'use strict';var schema=require(_0x8f5c('0x0'));var _=require(_0x8f5c('0x1'));var htmlToText=require(_0x8f5c('0x2'));var utils=require(_0x8f5c('0x3'));var logger=require(_0x8f5c('0x4'))(_0x8f5c('0x5'));var gotoif=schema({'condition':{'type':_0x8f5c('0x6'),'required':!![],'message':_0x8f5c('0x7')},'priorityTrue':{'type':_0x8f5c('0x8'),'message':_0x8f5c('0x9')},'priorityFalse':{'type':_0x8f5c('0x8'),'message':_0x8f5c('0xa')}});exports[_0x8f5c('0xb')]=function(_0x3eaef3,_0x1801db){return function(_0x473764){try{var _0x9dbddd={'condition':htmlToText[_0x8f5c('0xc')](utils['getMustacheRender'](_0x1801db[0x0],this),{'wordwrap':![]})[_0x8f5c('0xd')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x1801db[0x1],'priorityFalse':_0x1801db[0x2]};var _0x55ce00=gotoif[_0x8f5c('0x0')](_0x9dbddd,{'typecast':!![]});if(_0x55ce00[_0x8f5c('0xe')]){logger[_0x8f5c('0xf')](_0x8f5c('0x10'),_0x3eaef3,_['map'](_0x55ce00,'message')[_0x8f5c('0x11')](',\x20'));_0x473764[_0x8f5c('0x12')]();}else{try{var _0x598dd4=eval('('+_0x9dbddd['condition']+')');var _0x2c78a2=_0x598dd4?_0x9dbddd[_0x8f5c('0x13')]:_0x9dbddd[_0x8f5c('0x14')];logger['info'](_0x8f5c('0x15'),_0x3eaef3,_0x9dbddd['condition'],_0x598dd4,_0x2c78a2||_0x8f5c('0x16'));if(_0x2c78a2){var _0x510e2d=_['findIndex'](_0x473764['rules'](),{'p':_0x2c78a2});if(_0x510e2d>=0x0){logger[_0x8f5c('0x17')](_0x8f5c('0x18'),_0x3eaef3,_0x2c78a2||_0x8f5c('0x16'),_0x510e2d);_0x473764[_0x8f5c('0x16')](_0x510e2d);}else{logger[_0x8f5c('0x17')](_0x8f5c('0x19'),_0x3eaef3,_0x2c78a2||'next');_0x473764[_0x8f5c('0x12')]();}}else{_0x473764[_0x8f5c('0x16')]();}}catch(_0x5c38a8){logger[_0x8f5c('0xf')](_0x8f5c('0x1a'),_0x3eaef3,_0x5c38a8['message']);_0x473764['stop']();}}}catch(_0x588138){logger['error'](_0x8f5c('0x10'),_0x3eaef3,JSON['stringify'](_0x588138));_0x473764[_0x8f5c('0x12')]();}};}; \ 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 a154d99..d803300 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 _0xbf5c=['map','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','../../../../config/logger','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','error','[%s][GOTOP]\x20%s'];(function(_0x259d11,_0x222597){var _0x34f70c=function(_0x5b6321){while(--_0x5b6321){_0x259d11['push'](_0x259d11['shift']());}};_0x34f70c(++_0x222597);}(_0xbf5c,0x98));var _0xcbf5=function(_0x57b8f,_0x46bd03){_0x57b8f=_0x57b8f-0x0;var _0x500dc9=_0xbf5c[_0x57b8f];return _0x500dc9;};'use strict';var schema=require(_0xcbf5('0x0'));var _=require(_0xcbf5('0x1'));var logger=require(_0xcbf5('0x2'))(_0xcbf5('0x3'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0xcbf5('0x4')}});exports[_0xcbf5('0x5')]=function(_0x580c57,_0x52188f){return function(_0x40f5eb){try{var _0x53bd65={'priority':_0x52188f[0x0]};var _0x206f5d=gotop[_0xcbf5('0x0')](_0x53bd65,{'typecast':!![]});if(_0x206f5d['length']){logger[_0xcbf5('0x6')](_0xcbf5('0x7'),_0x580c57,_[_0xcbf5('0x8')](_0x206f5d,_0xcbf5('0x9'))[_0xcbf5('0xa')](',\x20'));_0x40f5eb[_0xcbf5('0xb')]();}else{logger[_0xcbf5('0xc')](_0xcbf5('0xd'),_0x580c57,_0x53bd65[_0xcbf5('0xe')]);if(_0x53bd65['priority']){var _0x26cfd9=_[_0xcbf5('0xf')](_0x40f5eb['rules'](),{'p':_0x53bd65['priority']});if(_0x26cfd9>=0x0){logger[_0xcbf5('0xc')](_0xcbf5('0x10'),_0x580c57,_0x53bd65['priority']||_0xcbf5('0x11'),_0x26cfd9);_0x40f5eb[_0xcbf5('0x11')](_0x26cfd9);}else{logger[_0xcbf5('0xc')](_0xcbf5('0x12'),_0x580c57,_0x53bd65[_0xcbf5('0xe')]||_0xcbf5('0x11'));_0x40f5eb['stop']();}}else{_0x40f5eb[_0xcbf5('0x11')]();}}}catch(_0x31b275){logger[_0xcbf5('0x6')](_0xcbf5('0x7'),_0x580c57,JSON[_0xcbf5('0x13')](_0x31b275));_0x40f5eb[_0xcbf5('0xb')]();}};}; \ No newline at end of file +var _0x356c=['consequence','error','map','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0x356c,0x1ce));var _0xc356=function(_0x22a04e,_0x224117){_0x22a04e=_0x22a04e-0x0;var _0x2ff10f=_0x356c[_0x22a04e];return _0x2ff10f;};'use strict';var schema=require(_0xc356('0x0'));var _=require(_0xc356('0x1'));var logger=require(_0xc356('0x2'))(_0xc356('0x3'));var gotop=schema({'priority':{'type':_0xc356('0x4'),'required':!![],'message':_0xc356('0x5')}});exports[_0xc356('0x6')]=function(_0x405d2d,_0x339a7f){return function(_0x5bac83){try{var _0xf900d0={'priority':_0x339a7f[0x0]};var _0x378fe1=gotop[_0xc356('0x0')](_0xf900d0,{'typecast':!![]});if(_0x378fe1['length']){logger[_0xc356('0x7')]('[%s][GOTOP]\x20%s',_0x405d2d,_[_0xc356('0x8')](_0x378fe1,_0xc356('0x9'))[_0xc356('0xa')](',\x20'));_0x5bac83[_0xc356('0xb')]();}else{logger[_0xc356('0xc')](_0xc356('0xd'),_0x405d2d,_0xf900d0[_0xc356('0xe')]);if(_0xf900d0[_0xc356('0xe')]){var _0x4ba039=_[_0xc356('0xf')](_0x5bac83['rules'](),{'p':_0xf900d0[_0xc356('0xe')]});if(_0x4ba039>=0x0){logger['info'](_0xc356('0x10'),_0x405d2d,_0xf900d0[_0xc356('0xe')]||_0xc356('0x11'),_0x4ba039);_0x5bac83[_0xc356('0x11')](_0x4ba039);}else{logger[_0xc356('0xc')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x405d2d,_0xf900d0['priority']||_0xc356('0x11'));_0x5bac83[_0xc356('0xb')]();}}else{_0x5bac83[_0xc356('0x11')]();}}}catch(_0x2304e1){logger[_0xc356('0x7')]('[%s][GOTOP]\x20%s',_0x405d2d,JSON['stringify'](_0x2304e1));_0x5bac83[_0xc356('0xb')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index bef22c5..e292fa8 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 _0xd6ab=['next','catch','error','stop','[%s][MESSAGE]\x20%s','stringify','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','contact','chat','account','upperFirst','channel','AccountId','interaction','Message','create','then','info','body'];(function(_0xeb8609,_0x111e27){var _0x3ec75d=function(_0x53e458){while(--_0x53e458){_0xeb8609['push'](_0xeb8609['shift']());}};_0x3ec75d(++_0x111e27);}(_0xd6ab,0x124));var _0xbd6a=function(_0x819e48,_0x430040){_0x819e48=_0x819e48-0x0;var _0x522d4a=_0xd6ab[_0x819e48];return _0x522d4a;};'use strict';var _=require(_0xbd6a('0x0'));var utils=require(_0xbd6a('0x1'));var logger=require(_0xbd6a('0x2'))(_0xbd6a('0x3'));var rpc={'chatMessage':require(_0xbd6a('0x4')),'openchannelMessage':require(_0xbd6a('0x5')),'mailMessage':require(_0xbd6a('0x6')),'smsMessage':require(_0xbd6a('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x6545b8,_0x24a641){return function(_0x5c5bfe){try{var _0x441979={'body':utils['getMustacheRender'](_0x24a641[0x0],this),'ContactId':this[_0xbd6a('0x8')]['id']};if(this['channel']===_0xbd6a('0x9')){_0x441979['ChatWebsiteId']=this[_0xbd6a('0xa')]['id'];}else{_0x441979[_[_0xbd6a('0xb')](this[_0xbd6a('0xc')])+_0xbd6a('0xd')]=this[_0xbd6a('0xa')]['id'];}_0x441979[_[_0xbd6a('0xb')](this[_0xbd6a('0xc')])+'InteractionId']=this[_0xbd6a('0xe')]['id'];if(rpc[this['channel']+'Message']){return rpc[this[_0xbd6a('0xc')]+_0xbd6a('0xf')][_0xbd6a('0x10')](_0x441979)[_0xbd6a('0x11')](function(_0x64e59){logger[_0xbd6a('0x12')]('[%s][MESSAGE]\x20%s',_0x6545b8,_0x441979[_0xbd6a('0x13')]);_0x5c5bfe[_0xbd6a('0x14')]();})[_0xbd6a('0x15')](function(_0x1897fd){logger[_0xbd6a('0x16')]('[%s][MESSAGE]\x20%s',_0x6545b8,JSON['stringify'](_0x1897fd));_0x5c5bfe[_0xbd6a('0x17')]();});}}catch(_0x467a41){logger[_0xbd6a('0x16')](_0xbd6a('0x18'),_0x6545b8,JSON[_0xbd6a('0x19')](_0x467a41));_0x5c5bfe[_0xbd6a('0x17')]();}};}; \ No newline at end of file +var _0x484a=['stringify','lodash','./utils','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','getMustacheRender','channel','chat','ChatWebsiteId','account','AccountId','interaction','Message','create','info','body','next','catch','[%s][MESSAGE]\x20%s','stop','error'];(function(_0x2562c6,_0x5e6df4){var _0x50f5e6=function(_0x20a555){while(--_0x20a555){_0x2562c6['push'](_0x2562c6['shift']());}};_0x50f5e6(++_0x5e6df4);}(_0x484a,0x191));var _0xa484=function(_0x544024,_0x3ab55f){_0x544024=_0x544024-0x0;var _0x1f1a03=_0x484a[_0x544024];return _0x1f1a03;};'use strict';var _=require(_0xa484('0x0'));var utils=require(_0xa484('0x1'));var logger=require('../../../../config/logger')(_0xa484('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xa484('0x3')),'mailMessage':require(_0xa484('0x4')),'smsMessage':require(_0xa484('0x5')),'faxMessage':require(_0xa484('0x6')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xa484('0x7')]=function(_0x403a1e,_0x1b1653){return function(_0x388a7f){try{var _0x4891d8={'body':utils[_0xa484('0x8')](_0x1b1653[0x0],this),'ContactId':this['contact']['id']};if(this[_0xa484('0x9')]===_0xa484('0xa')){_0x4891d8[_0xa484('0xb')]=this[_0xa484('0xc')]['id'];}else{_0x4891d8[_['upperFirst'](this[_0xa484('0x9')])+_0xa484('0xd')]=this[_0xa484('0xc')]['id'];}_0x4891d8[_['upperFirst'](this[_0xa484('0x9')])+'InteractionId']=this[_0xa484('0xe')]['id'];if(rpc[this[_0xa484('0x9')]+_0xa484('0xf')]){return rpc[this['channel']+'Message'][_0xa484('0x10')](_0x4891d8)['then'](function(_0x1eeef5){logger[_0xa484('0x11')]('[%s][MESSAGE]\x20%s',_0x403a1e,_0x4891d8[_0xa484('0x12')]);_0x388a7f[_0xa484('0x13')]();})[_0xa484('0x14')](function(_0x9b2653){logger['error'](_0xa484('0x15'),_0x403a1e,JSON['stringify'](_0x9b2653));_0x388a7f[_0xa484('0x16')]();});}}catch(_0x20cdb1){logger[_0xa484('0x17')](_0xa484('0x15'),_0x403a1e,JSON[_0xa484('0x18')](_0x20cdb1));_0x388a7f[_0xa484('0x16')]();}};}; \ 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 7caebe0..665874d 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 _0x41b8=['getMustacheRender','next','stringify','stop','./utils','../../../../config/logger','routing','consequence','[%s][NOOP]\x20%s'];(function(_0x146edd,_0x2be255){var _0x46079b=function(_0x20ad8c){while(--_0x20ad8c){_0x146edd['push'](_0x146edd['shift']());}};_0x46079b(++_0x2be255);}(_0x41b8,0x94));var _0x841b=function(_0x4c1ec2,_0x4f42b7){_0x4c1ec2=_0x4c1ec2-0x0;var _0x3f6f1c=_0x41b8[_0x4c1ec2];return _0x3f6f1c;};'use strict';var utils=require(_0x841b('0x0'));var logger=require(_0x841b('0x1'))(_0x841b('0x2'));exports[_0x841b('0x3')]=function(_0x40a8b5,_0x4ee583){return function(_0x5bddc8){try{logger['info'](_0x841b('0x4'),_0x40a8b5,utils[_0x841b('0x5')](_0x4ee583[0x0],this));_0x5bddc8[_0x841b('0x6')]();}catch(_0x1a58e9){logger['error'](_0x841b('0x4'),_0x40a8b5,JSON[_0x841b('0x7')](_0x1a58e9));_0x5bddc8[_0x841b('0x8')]();}};}; \ No newline at end of file +var _0x2262=['../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','error','stringify','stop','./utils'];(function(_0x1336e5,_0x29f491){var _0x54dce8=function(_0x47d08c){while(--_0x47d08c){_0x1336e5['push'](_0x1336e5['shift']());}};_0x54dce8(++_0x29f491);}(_0x2262,0xe6));var _0x2226=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2262[_0x20a584];return _0x4b41a8;};'use strict';var utils=require(_0x2226('0x0'));var logger=require(_0x2226('0x1'))(_0x2226('0x2'));exports[_0x2226('0x3')]=function(_0x2bbe90,_0x2217f7){return function(_0x43ebce){try{logger[_0x2226('0x4')](_0x2226('0x5'),_0x2bbe90,utils[_0x2226('0x6')](_0x2217f7[0x0],this));_0x43ebce[_0x2226('0x7')]();}catch(_0x4846b6){logger[_0x2226('0x8')](_0x2226('0x5'),_0x2bbe90,JSON[_0x2226('0x9')](_0x4846b6));_0x43ebce[_0x2226('0xa')]();}};}; \ 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 0008de3..4c7dbf6 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 _0xbfae=['rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','queue_id','account','queue','from','joinAt','clone','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','pick','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','error','create\x20queue\x20report','waiting','YYYY-MM-DD\x20HH:mm:ss','accepted','body','catch','update\x20queue\x20report','timeout','update','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','stop','find','createQueue','atimeout','qtimeout'];(function(_0x1443eb,_0x203408){var _0x2b8810=function(_0x48bc4e){while(--_0x48bc4e){_0x1443eb['push'](_0x1443eb['shift']());}};_0x2b8810(++_0x203408);}(_0xbfae,0x13a));var _0xebfa=function(_0x152ad2,_0x1ec031){_0x152ad2=_0x152ad2-0x0;var _0x31cfba=_0xbfae[_0x152ad2];return _0x31cfba;};'use strict';var schema=require('validate');var _=require(_0xebfa('0x0'));var util=require(_0xebfa('0x1'));var seqqueue=require(_0xebfa('0x2'));var moment=require(_0xebfa('0x3'));var Redis=require(_0xebfa('0x4'));var config=require(_0xebfa('0x5'));var logger=require(_0xebfa('0x6'))(_0xebfa('0x7'));var strategy=require('./strategy');config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var attributes=['id',_0xebfa('0x8'),_0xebfa('0x9'),_0xebfa('0xa'),_0xebfa('0xb'),_0xebfa('0xc')];function emit(_0x37c8ef,_0x5867d0,_0x217ac4){io['to'](_0x37c8ef)['emit'](_0x5867d0,_0x217ac4);}function emitChannelQueueInteraction(_0x39483e,_0x3f6d04,_0x17021b,_0x3fc9c3,_0x26cbf1,_0x26308b,_0x3918c2,_0x34a1a1){var _0x1871c7=_[_0xebfa('0xd')](_0x17021b);_0x1871c7[_0xebfa('0x8')]=_0x34a1a1;_0x1871c7[_0xebfa('0xa')]=_0x3f6d04;_0x1871c7[_0xebfa('0x9')]=_0x3fc9c3;_0x1871c7['id']=_0x26cbf1;if(_0x26308b){_0x3918c2[util[_0xebfa('0xe')](_0xebfa('0xf'),_0x39483e)][_0x26cbf1]=_['pick'](_0x1871c7,attributes);}else{delete _0x3918c2[util['format']('%sQueuesWaitingInteractions',_0x39483e)][_0x26cbf1];}emit(util[_0xebfa('0xe')](_0xebfa('0x10'),_0x39483e,_0x3f6d04),util[_0xebfa('0xe')](_0xebfa('0x11'),_0x39483e,_0x26308b?_0xebfa('0x12'):'remove'),_[_0xebfa('0x13')](_0x1871c7,attributes));}var rpc={'openchannelQueueReport':require(_0xebfa('0x14')),'mailQueueReport':require(_0xebfa('0x15')),'chatQueueReport':require(_0xebfa('0x16')),'smsQueueReport':require(_0xebfa('0x17')),'faxQueueReport':require(_0xebfa('0x18')),'whatsappQueueReport':require(_0xebfa('0x19'))};var queue=schema({'name':{'type':_0xebfa('0x1a'),'required':!![],'message':_0xebfa('0x1b')},'timeout':{'type':_0xebfa('0x1c'),'message':_0xebfa('0x1d')}});function startRouting(_0x43ff48,_0x25762e,_0x8e37,_0x59d15f){if(_0x43ff48&&_0x25762e&&_0x8e37){_0x25762e['waiting']+=0x1;var _0x3fe552={'uniqueid':_0x43ff48,'from':_0x8e37['body']?_0x8e37['body'][_0xebfa('0xb')]:'','joinAt':moment()[_0xebfa('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x8e37[_0xebfa('0x1e')]?_0x8e37[_0xebfa('0x1e')]['id']:null,'ListId':_0x8e37[_0xebfa('0x1f')]?_0x8e37[_0xebfa('0x1f')]['id']:null};_0x3fe552[_[_0xebfa('0x20')](_0x8e37[_0xebfa('0x21')])+_0xebfa('0x22')]=_0x25762e['id']||null;_0x3fe552[_['upperFirst'](_0x8e37['channel'])+_0xebfa('0x23')]=_0x8e37[_0xebfa('0x24')]?_0x8e37[_0xebfa('0x24')]['id']:null;_0x3fe552[_[_0xebfa('0x20')](_0x8e37[_0xebfa('0x21')])+_0xebfa('0x25')]=_0x8e37[_0xebfa('0x26')]?_0x8e37[_0xebfa('0x26')]['id']:null;_0x3fe552[_[_0xebfa('0x20')](_0x8e37[_0xebfa('0x21')])+(_0x8e37[_0xebfa('0x21')]!==_0xebfa('0x27')?_0xebfa('0x28'):_0xebfa('0x29'))]=_0x8e37['account']?_0x8e37['account']['id']:null;logger[_0xebfa('0x2a')](util[_0xebfa('0xe')](_0xebfa('0x2b'),_0x43ff48,_0x25762e[_0xebfa('0x2c')]));emitChannelQueueInteraction(_0x8e37[_0xebfa('0x21')],_0x25762e[_0xebfa('0x2c')],_0x3fe552,_0x8e37['account']['name'],_0x8e37[_0xebfa('0x26')]['id'],!![],_0x59d15f,_0x25762e['id']);if(rpc[_0x8e37[_0xebfa('0x21')]+_0xebfa('0x2d')]){return rpc[_0x8e37[_0xebfa('0x21')]+_0xebfa('0x2d')]['create'](_0x3fe552)['catch'](function(_0xf2813e){logger[_0xebfa('0x2e')](_0xebfa('0x2f'));});}}}function stopRouting(_0xce663a,_0x2f3e2d,_0x4abc63,_0x599f5f){if(_0xce663a&&_0x2f3e2d){_0x2f3e2d[_0xebfa('0x30')]-=0x1;var _0x3c6825={'leaveAt':moment()[_0xebfa('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0xebfa('0xe')](_0xebfa('0x31')),'reason':_0xebfa('0x32')};logger[_0xebfa('0x2a')](util['format']('[%s][STOP:QUEUE][NAME:%s]',_0xce663a,_0x2f3e2d[_0xebfa('0x2c')]));emitChannelQueueInteraction(_0x4abc63['channel'],_0x2f3e2d[_0xebfa('0x2c')],_0x4abc63[_0xebfa('0x33')],_0x4abc63[_0xebfa('0x9')]['name'],_0x4abc63['message']['id'],![],_0x599f5f,_0x2f3e2d['id']);if(rpc[_0x4abc63[_0xebfa('0x21')]+_0xebfa('0x2d')]){return rpc[_0x4abc63[_0xebfa('0x21')]+_0xebfa('0x2d')]['update'](_0xce663a,_0x3c6825)[_0xebfa('0x34')](function(_0x3ddb8d){logger['error'](_0xebfa('0x35'));});}}}function endRouting(_0x28750e,_0x48d01e,_0x5c5277,_0x340738){if(_0x28750e&&_0x48d01e){_0x48d01e[_0xebfa('0x30')]-=0x1;var _0x23d1c5={'leaveAt':moment()[_0xebfa('0xe')](_0xebfa('0x31')),'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xebfa('0x36')};logger[_0xebfa('0x2a')](util[_0xebfa('0xe')]('[%s][END:QUEUE][NAME:%s]',_0x28750e,_0x48d01e[_0xebfa('0x2c')]));emitChannelQueueInteraction(_0x5c5277[_0xebfa('0x21')],_0x48d01e['name'],_0x5c5277[_0xebfa('0x33')],_0x5c5277[_0xebfa('0x9')][_0xebfa('0x2c')],_0x5c5277['message']['id'],![],_0x340738);if(rpc[_0x5c5277[_0xebfa('0x21')]+_0xebfa('0x2d')]){return rpc[_0x5c5277['channel']+'QueueReport'][_0xebfa('0x37')](_0x28750e,_0x23d1c5)[_0xebfa('0x34')](function(_0x1b3d73){logger[_0xebfa('0x2e')](_0xebfa('0x35'));});}}}function handleFindQueue(_0x36fc70){return function(_0x46de37){return _0x46de37['name'][_0xebfa('0x38')]()===_0x36fc70['toLowerCase']();};}exports[_0xebfa('0x39')]=function(_0x474de9,_0x171130,_0x4cbd03,_0x82a63e){return function(_0x2ce973){try{var _0x447ac1={'name':_0x171130[0x0],'timeout':_0x171130[0x1]};var _0x804caa=queue['validate'](_0x447ac1,{'typecast':!![]});if(_0x804caa[_0xebfa('0x3a')]){logger[_0xebfa('0x2e')](_0xebfa('0x3b'),_0x474de9,_[_0xebfa('0x3c')](_0x804caa,_0xebfa('0x26'))['join'](',\x20'));_0x2ce973[_0xebfa('0x3d')]();}else{var _0x25cb3a=_[_0xebfa('0x3e')](_0x4cbd03[_0x82a63e[_0xebfa('0x21')]+'Queues'],handleFindQueue(_0x447ac1[_0xebfa('0x2c')]));if(_0x25cb3a){startRouting(_0x474de9,_0x25cb3a,_0x82a63e,_0x4cbd03);var _0x4a3725=(_0x25cb3a[_0xebfa('0x36')]||0xa)*0x3e8;var _0x333936=(_0x447ac1[_0xebfa('0x36')]||0x14)*0x3e8;var _0x6d6751,_0x3222f8;if(_0x4a3725>_0x333936){_0x333936=_0x4a3725;}var _0x4e5562=seqqueue[_0xebfa('0x3f')](_0x4a3725);_0x4e5562['id']=_0x474de9;_0x4e5562[_0xebfa('0x40')]=_0x4a3725;_0x4e5562[_0xebfa('0x41')]=_0x333936;_0x4e5562['channel']=_0x82a63e['channel'];_0x4cbd03[_0xebfa('0x42')][_0x474de9]['on']('end',function(){logger[_0xebfa('0x2a')](_0xebfa('0x43'),_0x474de9);stopRouting(_0x474de9,_0x25cb3a,_0x82a63e,_0x4cbd03);clearTimeout(_0x6d6751);_0x6d6751=undefined;_0x4e5562[_0xebfa('0x44')](!![]);if(_0x4cbd03['rules'][_0x474de9]){delete _0x4cbd03[_0xebfa('0x42')][_0x474de9];}_0x2ce973[_0xebfa('0x3d')]();});_0x4cbd03[_0xebfa('0x42')][_0x474de9]['on'](_0xebfa('0x45'),function(){if(_0x4cbd03[_0xebfa('0x42')][_0x474de9]){delete _0x4cbd03['rules'][_0x474de9];}});_0x6d6751=setTimeout(function(){logger[_0xebfa('0x2a')](_0xebfa('0x46'),_0x474de9);endRouting(_0x474de9,_0x25cb3a,_0x82a63e,_0x4cbd03);clearTimeout(_0x6d6751);_0x4e5562[_0xebfa('0x44')](!![]);_0x2ce973['next']();},_0x333936);switch(_0x25cb3a[_0xebfa('0x47')]){case'rrmemory':strategy[_0xebfa('0x48')](_0x4e5562,_0x25cb3a,_0x4cbd03,_0x82a63e);break;default:strategy['beepall'](_0x4e5562,_0x25cb3a,_0x4cbd03,_0x82a63e);}}else{logger['error'](_0xebfa('0x49'),_0x474de9,_0x447ac1[_0xebfa('0x2c')]);_0x2ce973[_0xebfa('0x3d')]();}}}catch(_0xafdd6c){console[_0xebfa('0x4a')](_0xafdd6c);logger[_0xebfa('0x2e')](_0xebfa('0x3b'),_0x474de9,_0xafdd6c[_0xebfa('0x4b')]);_0x2ce973['stop']();}};}; \ No newline at end of file +var _0x2bca=['update\x20queue\x20report','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','qtimeout','end','close','rules','[%s][QUEUE]\x20APPLICATION\x20END','next','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','defaults','redis','localhost','socket.io-emitter','queue_id','account','queue','from','joinAt','emit','clone','format','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','number','timeout\x20is\x20a\x20number','waiting','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','accepted','[%s][STOP:QUEUE][NAME:%s]','update','timeout','[%s][END:QUEUE][NAME:%s]'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x2bca,0x19a));var _0xa2bc=function(_0x617e96,_0x512786){_0x617e96=_0x617e96-0x0;var _0x4a4f17=_0x2bca[_0x617e96];return _0x4a4f17;};'use strict';var schema=require(_0xa2bc('0x0'));var _=require('lodash');var util=require(_0xa2bc('0x1'));var seqqueue=require(_0xa2bc('0x2'));var moment=require(_0xa2bc('0x3'));var Redis=require(_0xa2bc('0x4'));var config=require(_0xa2bc('0x5'));var logger=require(_0xa2bc('0x6'))(_0xa2bc('0x7'));var strategy=require(_0xa2bc('0x8'));config['redis']=_[_0xa2bc('0x9')](config[_0xa2bc('0xa')],{'host':_0xa2bc('0xb'),'port':0x18eb});var io=require(_0xa2bc('0xc'))(new Redis(config[_0xa2bc('0xa')]));var attributes=['id',_0xa2bc('0xd'),_0xa2bc('0xe'),_0xa2bc('0xf'),_0xa2bc('0x10'),_0xa2bc('0x11')];function emit(_0x2f1a8b,_0x64292f,_0x5e25ca){io['to'](_0x2f1a8b)[_0xa2bc('0x12')](_0x64292f,_0x5e25ca);}function emitChannelQueueInteraction(_0x13ce5a,_0x184c2e,_0xb521f9,_0x5b58f1,_0x5ba3c9,_0x468ac4,_0x443e9f,_0x227816){var _0xe99586=_[_0xa2bc('0x13')](_0xb521f9);_0xe99586[_0xa2bc('0xd')]=_0x227816;_0xe99586['queue']=_0x184c2e;_0xe99586['account']=_0x5b58f1;_0xe99586['id']=_0x5ba3c9;if(_0x468ac4){_0x443e9f[util[_0xa2bc('0x14')]('%sQueuesWaitingInteractions',_0x13ce5a)][_0x5ba3c9]=_[_0xa2bc('0x15')](_0xe99586,attributes);}else{delete _0x443e9f[util['format']('%sQueuesWaitingInteractions',_0x13ce5a)][_0x5ba3c9];}emit(util['format'](_0xa2bc('0x16'),_0x13ce5a,_0x184c2e),util['format'](_0xa2bc('0x17'),_0x13ce5a,_0x468ac4?_0xa2bc('0x18'):_0xa2bc('0x19')),_[_0xa2bc('0x15')](_0xe99586,attributes));}var rpc={'openchannelQueueReport':require(_0xa2bc('0x1a')),'mailQueueReport':require(_0xa2bc('0x1b')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0xa2bc('0x1c')),'whatsappQueueReport':require(_0xa2bc('0x1d'))};var queue=schema({'name':{'type':_0xa2bc('0x1e'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xa2bc('0x1f'),'message':_0xa2bc('0x20')}});function startRouting(_0x13758e,_0x2e842d,_0x29371b,_0x4b4864){if(_0x13758e&&_0x2e842d&&_0x29371b){_0x2e842d[_0xa2bc('0x21')]+=0x1;var _0x3d8c02={'uniqueid':_0x13758e,'from':_0x29371b['body']?_0x29371b['body'][_0xa2bc('0x10')]:'','joinAt':moment()['format'](_0xa2bc('0x22')),'ContactId':_0x29371b[_0xa2bc('0x23')]?_0x29371b[_0xa2bc('0x23')]['id']:null,'ListId':_0x29371b[_0xa2bc('0x24')]?_0x29371b[_0xa2bc('0x24')]['id']:null};_0x3d8c02[_[_0xa2bc('0x25')](_0x29371b[_0xa2bc('0x26')])+_0xa2bc('0x27')]=_0x2e842d['id']||null;_0x3d8c02[_[_0xa2bc('0x25')](_0x29371b[_0xa2bc('0x26')])+_0xa2bc('0x28')]=_0x29371b[_0xa2bc('0x29')]?_0x29371b[_0xa2bc('0x29')]['id']:null;_0x3d8c02[_[_0xa2bc('0x25')](_0x29371b[_0xa2bc('0x26')])+'MessageId']=_0x29371b['message']?_0x29371b[_0xa2bc('0x2a')]['id']:null;_0x3d8c02[_[_0xa2bc('0x25')](_0x29371b[_0xa2bc('0x26')])+(_0x29371b[_0xa2bc('0x26')]!==_0xa2bc('0x2b')?_0xa2bc('0x2c'):_0xa2bc('0x2d'))]=_0x29371b[_0xa2bc('0xe')]?_0x29371b['account']['id']:null;logger[_0xa2bc('0x2e')](util[_0xa2bc('0x14')](_0xa2bc('0x2f'),_0x13758e,_0x2e842d[_0xa2bc('0x30')]));emitChannelQueueInteraction(_0x29371b[_0xa2bc('0x26')],_0x2e842d[_0xa2bc('0x30')],_0x3d8c02,_0x29371b[_0xa2bc('0xe')]['name'],_0x29371b[_0xa2bc('0x2a')]['id'],!![],_0x4b4864,_0x2e842d['id']);if(rpc[_0x29371b[_0xa2bc('0x26')]+'QueueReport']){return rpc[_0x29371b[_0xa2bc('0x26')]+_0xa2bc('0x31')][_0xa2bc('0x32')](_0x3d8c02)[_0xa2bc('0x33')](function(_0x3f42e3){logger[_0xa2bc('0x34')]('create\x20queue\x20report');});}}}function stopRouting(_0x3762f2,_0x26f1d8,_0x7fe456,_0x463eec){if(_0x3762f2&&_0x26f1d8){_0x26f1d8[_0xa2bc('0x21')]-=0x1;var _0x284b4a={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0xa2bc('0x14')](_0xa2bc('0x22')),'reason':_0xa2bc('0x35')};logger[_0xa2bc('0x2e')](util[_0xa2bc('0x14')](_0xa2bc('0x36'),_0x3762f2,_0x26f1d8['name']));emitChannelQueueInteraction(_0x7fe456[_0xa2bc('0x26')],_0x26f1d8[_0xa2bc('0x30')],_0x7fe456['body'],_0x7fe456[_0xa2bc('0xe')]['name'],_0x7fe456[_0xa2bc('0x2a')]['id'],![],_0x463eec,_0x26f1d8['id']);if(rpc[_0x7fe456[_0xa2bc('0x26')]+'QueueReport']){return rpc[_0x7fe456[_0xa2bc('0x26')]+_0xa2bc('0x31')][_0xa2bc('0x37')](_0x3762f2,_0x284b4a)[_0xa2bc('0x33')](function(_0x288f9d){logger['error']('update\x20queue\x20report');});}}}function endRouting(_0x80bf1b,_0x1a981c,_0x4f223d,_0x2f4337){if(_0x80bf1b&&_0x1a981c){_0x1a981c['waiting']-=0x1;var _0x4756db={'leaveAt':moment()['format'](_0xa2bc('0x22')),'exitAt':moment()[_0xa2bc('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xa2bc('0x38')};logger['info'](util['format'](_0xa2bc('0x39'),_0x80bf1b,_0x1a981c['name']));emitChannelQueueInteraction(_0x4f223d['channel'],_0x1a981c[_0xa2bc('0x30')],_0x4f223d['body'],_0x4f223d[_0xa2bc('0xe')][_0xa2bc('0x30')],_0x4f223d['message']['id'],![],_0x2f4337);if(rpc[_0x4f223d[_0xa2bc('0x26')]+_0xa2bc('0x31')]){return rpc[_0x4f223d[_0xa2bc('0x26')]+'QueueReport']['update'](_0x80bf1b,_0x4756db)[_0xa2bc('0x33')](function(_0x3daa7b){logger[_0xa2bc('0x34')](_0xa2bc('0x3a'));});}}}function handleFindQueue(_0x30aa01){return function(_0x17e9f8){return _0x17e9f8[_0xa2bc('0x30')][_0xa2bc('0x3b')]()===_0x30aa01[_0xa2bc('0x3b')]();};}exports[_0xa2bc('0x3c')]=function(_0x323e89,_0x456c59,_0x28e3ed,_0x3e02b0){return function(_0x551bcc){try{var _0x3dc791={'name':_0x456c59[0x0],'timeout':_0x456c59[0x1]};var _0x911ae1=queue[_0xa2bc('0x0')](_0x3dc791,{'typecast':!![]});if(_0x911ae1[_0xa2bc('0x3d')]){logger[_0xa2bc('0x34')](_0xa2bc('0x3e'),_0x323e89,_[_0xa2bc('0x3f')](_0x911ae1,_0xa2bc('0x2a'))[_0xa2bc('0x40')](',\x20'));_0x551bcc[_0xa2bc('0x41')]();}else{var _0x391b4d=_[_0xa2bc('0x42')](_0x28e3ed[_0x3e02b0[_0xa2bc('0x26')]+_0xa2bc('0x43')],handleFindQueue(_0x3dc791[_0xa2bc('0x30')]));if(_0x391b4d){startRouting(_0x323e89,_0x391b4d,_0x3e02b0,_0x28e3ed);var _0x2f31b2=(_0x391b4d[_0xa2bc('0x38')]||0xa)*0x3e8;var _0x253cf7=(_0x3dc791['timeout']||0x14)*0x3e8;var _0x52262d,_0x5477ad;if(_0x2f31b2>_0x253cf7){_0x253cf7=_0x2f31b2;}var _0x280b09=seqqueue['createQueue'](_0x2f31b2);_0x280b09['id']=_0x323e89;_0x280b09['atimeout']=_0x2f31b2;_0x280b09[_0xa2bc('0x44')]=_0x253cf7;_0x280b09[_0xa2bc('0x26')]=_0x3e02b0[_0xa2bc('0x26')];_0x28e3ed['rules'][_0x323e89]['on'](_0xa2bc('0x45'),function(){logger[_0xa2bc('0x2e')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x323e89);stopRouting(_0x323e89,_0x391b4d,_0x3e02b0,_0x28e3ed);clearTimeout(_0x52262d);_0x52262d=undefined;_0x280b09[_0xa2bc('0x46')](!![]);if(_0x28e3ed[_0xa2bc('0x47')][_0x323e89]){delete _0x28e3ed[_0xa2bc('0x47')][_0x323e89];}_0x551bcc[_0xa2bc('0x41')]();});_0x28e3ed[_0xa2bc('0x47')][_0x323e89]['on']('complete',function(){if(_0x28e3ed[_0xa2bc('0x47')][_0x323e89]){delete _0x28e3ed['rules'][_0x323e89];}});_0x52262d=setTimeout(function(){logger[_0xa2bc('0x2e')](_0xa2bc('0x48'),_0x323e89);endRouting(_0x323e89,_0x391b4d,_0x3e02b0,_0x28e3ed);clearTimeout(_0x52262d);_0x280b09[_0xa2bc('0x46')](!![]);_0x551bcc[_0xa2bc('0x49')]();},_0x253cf7);switch(_0x391b4d['strategy']){case _0xa2bc('0x4a'):strategy[_0xa2bc('0x4a')](_0x280b09,_0x391b4d,_0x28e3ed,_0x3e02b0);break;default:strategy[_0xa2bc('0x4b')](_0x280b09,_0x391b4d,_0x28e3ed,_0x3e02b0);}}else{logger['error'](_0xa2bc('0x4c'),_0x323e89,_0x3dc791[_0xa2bc('0x30')]);_0x551bcc[_0xa2bc('0x41')]();}}}catch(_0x58d78a){console['log'](_0x58d78a);logger[_0xa2bc('0x34')]('[%s][QUEUE]\x20%s',_0x323e89,_0x58d78a[_0xa2bc('0x4d')]);_0x551bcc['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/agent.js b/server/services/routing/server/applications/strategy/agent.js index cc275e5..fec770d 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 _0xb7b5=['isAgentAvailable','busyQueue','showNotification','notificationId',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','busy','writeLog','STOP','TIMEOUT','uuid','../../../../../config/logger','routing','squeue','agent','push','handleRun','bind','handleTimeout','handleDrained','prototype','[%s][AGENT]\x20try\x20with\x20%s','realtime','agents','info','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership'];(function(_0x15fc0b,_0x186ccc){var _0x1dc955=function(_0x3df31f){while(--_0x3df31f){_0x15fc0b['push'](_0x15fc0b['shift']());}};_0x1dc955(++_0x186ccc);}(_0xb7b5,0xeb));var _0x5b7b=function(_0x1b35a6,_0x597111){_0x1b35a6=_0x1b35a6-0x0;var _0x4853bf=_0xb7b5[_0x1b35a6];return _0x4853bf;};'use strict';var _=require('lodash');var uuid=require(_0x5b7b('0x0'));var util=require('./util');var logger=require(_0x5b7b('0x1'))(_0x5b7b('0x2'));var Agent=function(_0x1546ca,_0x287591,_0x17d9dc,_0x52f4f0){this['notificationId']=uuid['v4']();this[_0x5b7b('0x3')]=_0x1546ca;this[_0x5b7b('0x4')]=_0x287591;this['realtime']=_0x17d9dc;this[_0x5b7b('0x2')]=_0x52f4f0;this[_0x5b7b('0x3')][_0x5b7b('0x5')](this[_0x5b7b('0x6')][_0x5b7b('0x7')](this),this['handleTimeout'][_0x5b7b('0x7')](this));this[_0x5b7b('0x3')]['on']('timeout',this[_0x5b7b('0x8')]['bind'](this));this['squeue']['on']('drained',this[_0x5b7b('0x9')][_0x5b7b('0x7')](this));};Agent[_0x5b7b('0xa')][_0x5b7b('0x5')]=function(){this['squeue'][_0x5b7b('0x5')](this['handleRun'][_0x5b7b('0x7')](this),this[_0x5b7b('0x8')][_0x5b7b('0x7')](this));};Agent[_0x5b7b('0xa')][_0x5b7b('0x9')]=function(){this[_0x5b7b('0x8')](!![]);};Agent[_0x5b7b('0xa')][_0x5b7b('0x6')]=function(_0x15897b){logger['info'](_0x5b7b('0xb'),this['squeue']['id'],this[_0x5b7b('0x4')]['id']);if(_['isNil'](this[_0x5b7b('0xc')][_0x5b7b('0xd')][this[_0x5b7b('0x4')]['id']])){logger[_0x5b7b('0xe')](_0x5b7b('0xf'),this[_0x5b7b('0x3')]['id'],this[_0x5b7b('0x4')]['id']);setTimeout(this['push'][_0x5b7b('0x7')](this),0x3e8);}else{if(this[_0x5b7b('0x2')][_0x5b7b('0x10')]||util[_0x5b7b('0x11')](this[_0x5b7b('0x3')]['id'],this[_0x5b7b('0xc')][_0x5b7b('0xd')][this[_0x5b7b('0x4')]['id']],this[_0x5b7b('0x3')]['channel'],![])){this[_0x5b7b('0xc')][_0x5b7b('0xd')][this[_0x5b7b('0x4')]['id']]['busy']=!![];this[_0x5b7b('0xc')]['agents'][this['agent']['id']][_0x5b7b('0x12')]=undefined;util[_0x5b7b('0x13')](this[_0x5b7b('0x14')],this[_0x5b7b('0x3')]['id'],this['realtime'][_0x5b7b('0xd')][this['agent']['id']],null,this[_0x5b7b('0x2')]);util['writeLog'](this['squeue']['id'],this[_0x5b7b('0xc')][_0x5b7b('0xd')][this[_0x5b7b('0x4')]['id']],'RINGING'+(this[_0x5b7b('0x2')][_0x5b7b('0x10')]?_0x5b7b('0x15'):''));}else{logger['info'](_0x5b7b('0x16'),this['squeue']['id'],this[_0x5b7b('0x4')]['id']);setTimeout(this[_0x5b7b('0x5')]['bind'](this),0x3e8);}}};Agent[_0x5b7b('0xa')][_0x5b7b('0x8')]=function(_0x14df3f){if(_['isNil'](this[_0x5b7b('0xc')][_0x5b7b('0xd')][this[_0x5b7b('0x4')]['id']])){return logger[_0x5b7b('0xe')](_0x5b7b('0xf'),this['squeue']['id'],this[_0x5b7b('0x4')]['id']);}else{logger['info'](_0x5b7b('0x17'),this[_0x5b7b('0x3')]['id'],this[_0x5b7b('0x4')]['id']);util['hideNotification'](this['notificationId'],this[_0x5b7b('0x3')]['id'],this['realtime'][_0x5b7b('0xd')][this[_0x5b7b('0x4')]['id']],null,this['routing']);this[_0x5b7b('0xc')][_0x5b7b('0xd')][this[_0x5b7b('0x4')]['id']][_0x5b7b('0x18')]=![];this[_0x5b7b('0xc')]['agents'][this[_0x5b7b('0x4')]['id']]['busyQueue']=undefined;util[_0x5b7b('0x19')](this[_0x5b7b('0x3')]['id'],this[_0x5b7b('0xc')][_0x5b7b('0xd')][this[_0x5b7b('0x4')]['id']],_0x14df3f?_0x5b7b('0x1a'):_0x5b7b('0x1b'));}if(!_0x14df3f){setTimeout(this['push'][_0x5b7b('0x7')](this),0x3e8);}};function agent(_0x16d1e4,_0x3e160a,_0x2ac861,_0x28811a){return new Agent(_0x16d1e4,_0x3e160a,_0x2ac861,_0x28811a);}module['exports']=agent; \ No newline at end of file +var _0x7c81=['realtime','handleRun','bind','timeout','drained','handleDrained','prototype','push','handleTimeout','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','info','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','notificationId','STOP','TIMEOUT','exports','uuid','./util','../../../../../config/logger','routing','squeue','agent'];(function(_0x503950,_0x5022eb){var _0x1657a9=function(_0x4c1e8f){while(--_0x4c1e8f){_0x503950['push'](_0x503950['shift']());}};_0x1657a9(++_0x5022eb);}(_0x7c81,0x112));var _0x17c8=function(_0x2842b4,_0x2b1b7b){_0x2842b4=_0x2842b4-0x0;var _0x2b9521=_0x7c81[_0x2842b4];return _0x2b9521;};'use strict';var _=require('lodash');var uuid=require(_0x17c8('0x0'));var util=require(_0x17c8('0x1'));var logger=require(_0x17c8('0x2'))(_0x17c8('0x3'));var Agent=function(_0xb04f9e,_0x26db59,_0x3422aa,_0x25a743){this['notificationId']=uuid['v4']();this[_0x17c8('0x4')]=_0xb04f9e;this[_0x17c8('0x5')]=_0x26db59;this[_0x17c8('0x6')]=_0x3422aa;this['routing']=_0x25a743;this[_0x17c8('0x4')]['push'](this[_0x17c8('0x7')][_0x17c8('0x8')](this),this['handleTimeout'][_0x17c8('0x8')](this));this[_0x17c8('0x4')]['on'](_0x17c8('0x9'),this['handleTimeout'][_0x17c8('0x8')](this));this['squeue']['on'](_0x17c8('0xa'),this[_0x17c8('0xb')][_0x17c8('0x8')](this));};Agent[_0x17c8('0xc')][_0x17c8('0xd')]=function(){this[_0x17c8('0x4')]['push'](this[_0x17c8('0x7')][_0x17c8('0x8')](this),this[_0x17c8('0xe')][_0x17c8('0x8')](this));};Agent[_0x17c8('0xc')][_0x17c8('0xb')]=function(){this[_0x17c8('0xe')](!![]);};Agent['prototype']['handleRun']=function(_0x381cf3){logger['info'](_0x17c8('0xf'),this[_0x17c8('0x4')]['id'],this[_0x17c8('0x5')]['id']);if(_[_0x17c8('0x10')](this[_0x17c8('0x6')][_0x17c8('0x11')][this[_0x17c8('0x5')]['id']])){logger[_0x17c8('0x12')](_0x17c8('0x13'),this['squeue']['id'],this[_0x17c8('0x5')]['id']);setTimeout(this[_0x17c8('0xd')]['bind'](this),0x3e8);}else{if(this[_0x17c8('0x3')][_0x17c8('0x14')]||util[_0x17c8('0x15')](this[_0x17c8('0x4')]['id'],this[_0x17c8('0x6')][_0x17c8('0x11')][this[_0x17c8('0x5')]['id']],this[_0x17c8('0x4')][_0x17c8('0x16')],![])){this[_0x17c8('0x6')][_0x17c8('0x11')][this[_0x17c8('0x5')]['id']][_0x17c8('0x17')]=!![];this['realtime']['agents'][this[_0x17c8('0x5')]['id']][_0x17c8('0x18')]=undefined;util[_0x17c8('0x19')](this['notificationId'],this[_0x17c8('0x4')]['id'],this[_0x17c8('0x6')][_0x17c8('0x11')][this[_0x17c8('0x5')]['id']],null,this[_0x17c8('0x3')]);util[_0x17c8('0x1a')](this[_0x17c8('0x4')]['id'],this[_0x17c8('0x6')][_0x17c8('0x11')][this[_0x17c8('0x5')]['id']],_0x17c8('0x1b')+(this[_0x17c8('0x3')][_0x17c8('0x14')]?_0x17c8('0x1c'):''));}else{logger[_0x17c8('0x12')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x17c8('0x4')]['id'],this['agent']['id']);setTimeout(this[_0x17c8('0xd')]['bind'](this),0x3e8);}}};Agent['prototype'][_0x17c8('0xe')]=function(_0x4b6462){if(_[_0x17c8('0x10')](this[_0x17c8('0x6')][_0x17c8('0x11')][this[_0x17c8('0x5')]['id']])){return logger[_0x17c8('0x12')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x17c8('0x4')]['id'],this[_0x17c8('0x5')]['id']);}else{logger[_0x17c8('0x12')](_0x17c8('0x1d'),this[_0x17c8('0x4')]['id'],this[_0x17c8('0x5')]['id']);util[_0x17c8('0x1e')](this[_0x17c8('0x1f')],this[_0x17c8('0x4')]['id'],this[_0x17c8('0x6')][_0x17c8('0x11')][this[_0x17c8('0x5')]['id']],null,this[_0x17c8('0x3')]);this[_0x17c8('0x6')][_0x17c8('0x11')][this[_0x17c8('0x5')]['id']][_0x17c8('0x17')]=![];this[_0x17c8('0x6')][_0x17c8('0x11')][this[_0x17c8('0x5')]['id']][_0x17c8('0x18')]=undefined;util[_0x17c8('0x1a')](this[_0x17c8('0x4')]['id'],this[_0x17c8('0x6')]['agents'][this[_0x17c8('0x5')]['id']],_0x4b6462?_0x17c8('0x20'):_0x17c8('0x21'));}if(!_0x4b6462){setTimeout(this['push']['bind'](this),0x3e8);}};function agent(_0x4fcd13,_0x52955a,_0x20237e,_0x25c897){return new Agent(_0x4fcd13,_0x52955a,_0x20237e,_0x25c897);}module[_0x17c8('0x22')]=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index 4f7cde5..b004448 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 _0x723e=['push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','isNil','queue','Agents','length','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','agents','channel','writeLog','RINGING','busy','busyQueue','name','[%s][QUEUE]\x20EMPTY','hideNotification','exports','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','realtime'];(function(_0x1d630f,_0x343a35){var _0x327b13=function(_0x1cd250){while(--_0x1cd250){_0x1d630f['push'](_0x1d630f['shift']());}};_0x327b13(++_0x343a35);}(_0x723e,0x179));var _0xe723=function(_0x4169d1,_0x30a16a){_0x4169d1=_0x4169d1-0x0;var _0x3ea5f6=_0x723e[_0x4169d1];return _0x3ea5f6;};'use strict';var _=require('lodash');var uuid=require(_0xe723('0x0'));var util=require(_0xe723('0x1'));var logger=require(_0xe723('0x2'))(_0xe723('0x3'));var Beepall=function(_0x2801c5,_0xab58a8,_0x39e35c,_0x1da20f){this[_0xe723('0x4')]=uuid['v4']();this[_0xe723('0x5')]=_0x2801c5;this['queue']=_0xab58a8;this[_0xe723('0x6')]=_0x39e35c;this[_0xe723('0x3')]=_0x1da20f;this[_0xe723('0x5')][_0xe723('0x7')](this[_0xe723('0x8')][_0xe723('0x9')](this),this[_0xe723('0xa')][_0xe723('0x9')](this));this['squeue']['on'](_0xe723('0xb'),this[_0xe723('0xa')][_0xe723('0x9')](this));this['squeue']['on'](_0xe723('0xc'),this[_0xe723('0xd')][_0xe723('0x9')](this));};Beepall['prototype'][_0xe723('0x7')]=function(){this[_0xe723('0x5')][_0xe723('0x7')](this[_0xe723('0x8')][_0xe723('0x9')](this),this['handleTimeout'][_0xe723('0x9')](this));};Beepall['prototype']['handleDrained']=function(_0x5201f2){this['handleTimeout'](!![]);};Beepall[_0xe723('0xe')][_0xe723('0x8')]=function(_0x30ce1f){var _0x2b010b=!![];if(!_[_0xe723('0xf')](this['queue'])&&!_[_0xe723('0xf')](this[_0xe723('0x10')][_0xe723('0x11')])&&this[_0xe723('0x10')][_0xe723('0x11')][_0xe723('0x12')]>0x0){for(var _0x2cd7ca=0x0,_0x4a6f95;_0x2cd7ca0x0){for(var _0x24c4e4=0x0,_0x16200a;_0x24c4e40x0&&_0x1e512d[_0x219be1+_0x5474('0x26')]>=_0x1e512d[_0x219be1+'Capacity']){writeLog(_0xe4850d,_0x1e512d,_0x219be1[_0x5474('0x27')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x5474('0x28')]=function(_0x1384e4,_0x2a8730,_0x5865fe,_0x574ed6,_0x42b99a){return sendNotification(!![],_0x1384e4,_0x2a8730,_0x5865fe,_0x574ed6,_0x42b99a);};exports['hideNotification']=function(_0x57731b,_0x5d2381,_0x492a31,_0x168dee,_0x1b8adb){return sendNotification(![],_0x57731b,_0x5d2381,_0x492a31,_0x168dee,_0x1b8adb);};exports['writeLog']=writeLog; \ No newline at end of file +var _0x1623=['account','notificationShake','body','queue','msg','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','format','message','remove','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','showNotification','lodash','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','socket.io-emitter','emit','user:%s','name','user:save','split','\x20interaction'];(function(_0x27f3a7,_0x11cb1a){var _0x401f75=function(_0xb94a17){while(--_0xb94a17){_0x27f3a7['push'](_0x27f3a7['shift']());}};_0x401f75(++_0x11cb1a);}(_0x1623,0xab));var _0x3162=function(_0x52dd27,_0x110fbc){_0x52dd27=_0x52dd27-0x0;var _0x41f2ab=_0x1623[_0x52dd27];return _0x41f2ab;};'use strict';var _=require(_0x3162('0x0'));var util=require('util');var utils=require('../utils');var Mustache=require(_0x3162('0x1'));var Redis=require(_0x3162('0x2'));var config=require(_0x3162('0x3'));var logger=require(_0x3162('0x4'))(_0x3162('0x5'));config['redis']=_['defaults'](config[_0x3162('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x3162('0x7'))(new Redis(config[_0x3162('0x6')]));function emit(_0x53260d,_0xffe9b6,_0x2dc07e){io['to'](_0x53260d)[_0x3162('0x8')](_0xffe9b6,_0x2dc07e);}function sendNotification(_0x36609e,_0x10d684,_0x382676,_0xe43099,_0x113d28,_0x4bde10){io['to'](util['format'](_0x3162('0x9'),_0xe43099[_0x3162('0xa')]))[_0x3162('0x8')](_0x3162('0xb'),_0xe43099);var _0x813d62=_0x4bde10||{};var _0x208f4e=_0x382676[_0x3162('0xc')]('.');var _0x38da60={'uniqueid':_0x10d684,'channel':_0x208f4e[0x0],'id':_0x208f4e[0x1],'title':_0x208f4e[0x0]+_0x3162('0xd'),'interactionId':_0x208f4e[0x2],'queue':_0x113d28?_0x113d28['name']:null,'sound':_0x813d62[_0x3162('0xe')]['notificationSound'],'shake':_0x813d62[_0x3162('0xe')][_0x3162('0xf')]};try{if(!_0x813d62['body']){_0x813d62['body']={};}if(_0x113d28){_0x813d62[_0x3162('0x10')][_0x3162('0x11')]=_0x113d28;}else if(_0x813d62[_0x3162('0x10')]['queue']){delete _0x813d62[_0x3162('0x10')][_0x3162('0x11')];}_0x38da60[_0x3162('0x12')]=utils['getMustacheRender'](_0x813d62[_0x3162('0xe')][_0x3162('0x13')],_0x813d62);}catch(_0x46864e){_0x38da60[_0x3162('0x12')]=_0x3162('0x14');logger[_0x3162('0x15')](util[_0x3162('0x16')]('[%s][QUEUE]\x20%s',_0x10d684,_0x46864e[_0x3162('0x17')]));}io['to'](util[_0x3162('0x16')](_0x3162('0x9'),_0xe43099[_0x3162('0xa')]))['emit'](util[_0x3162('0x16')]('notification:%s',_0x36609e?'save':_0x3162('0x18')),_0x38da60);}function writeLog(_0x3e4d23,_0x31946d,_0x523fab){return logger['info'](util[_0x3162('0x16')](_0x3162('0x19'),_0x3e4d23,_0x31946d[_0x3162('0xa')],_0x523fab));}exports[_0x3162('0x1a')]=function(_0x31b27b,_0x14cbba,_0x52ae25,_0x1b2713){if(_0x14cbba['busy']){writeLog(_0x31b27b,_0x14cbba,_0x3162('0x1b'));return![];}if(!_0x14cbba[_0x3162('0x1c')]){writeLog(_0x31b27b,_0x14cbba,_0x3162('0x1d'));return![];}if(_0x14cbba[_0x52ae25+_0x3162('0x1e')]){writeLog(_0x31b27b,_0x14cbba,_0x3162('0x1f'));return![];}if(_0x1b2713&&_0x14cbba[_0x3162('0x20')](_0x52ae25+_0x3162('0x21'))&&_0x14cbba[_0x3162('0x20')](_0x52ae25+_0x3162('0x22'))){if(_0x14cbba[_0x52ae25+_0x3162('0x21')]>0x0&&_0x14cbba[_0x52ae25+_0x3162('0x22')]>=_0x14cbba[_0x52ae25+_0x3162('0x21')]){writeLog(_0x31b27b,_0x14cbba,_0x52ae25[_0x3162('0x23')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x3162('0x24')]=function(_0x552469,_0x37acdd,_0x31f7fd,_0x10c90b,_0x57f567){return sendNotification(!![],_0x552469,_0x37acdd,_0x31f7fd,_0x10c90b,_0x57f567);};exports['hideNotification']=function(_0xda0389,_0xaa1f35,_0x14df16,_0x399148,_0x2f88ec){return sendNotification(![],_0xda0389,_0xaa1f35,_0x14df16,_0x399148,_0x2f88ec);};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 32a0fbc..e59eb35 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 _0x749e=['next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','validate','shelljs','lodash','./utils','../../../../config/logger','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next'];(function(_0x5e0aa1,_0x30a9fa){var _0x111fae=function(_0x2c34af){while(--_0x2c34af){_0x5e0aa1['push'](_0x5e0aa1['shift']());}};_0x111fae(++_0x30a9fa);}(_0x749e,0x171));var _0xe749=function(_0x8ccb31,_0x7659b5){_0x8ccb31=_0x8ccb31-0x0;var _0x4011f8=_0x749e[_0x8ccb31];return _0x4011f8;};'use strict';var schema=require(_0xe749('0x0'));var sh=require(_0xe749('0x1'));var _=require(_0xe749('0x2'));var utils=require(_0xe749('0x3'));var logger=require(_0xe749('0x4'))('routing');var system=schema({'command':{'type':_0xe749('0x5'),'required':!![],'message':_0xe749('0x6')}});exports[_0xe749('0x7')]=function(_0x13500d,_0x3cfebb){return function(_0x2853d7){try{var _0x17879f={'command':_0x3cfebb[0x0]};var _0x380a33=system[_0xe749('0x0')](_0x17879f,{'typecast':!![]});if(_0x380a33[_0xe749('0x8')]){logger[_0xe749('0x9')](_0xe749('0xa'),_0x13500d,_['map'](_0x380a33,_0xe749('0xb'))[_0xe749('0xc')](',\x20'));logger[_0xe749('0xd')](_0xe749('0xe'),_0x13500d);_0x2853d7[_0xe749('0xf')]();}else{var _0x5444f3=this;var _0xb12710=utils[_0xe749('0x10')](_0x3cfebb[0x0],this);logger['info'](_0xe749('0x11'),_0x13500d,_0xb12710);sh['exec'](_['trim'](_0xb12710),function(_0x105df0,_0x4e408d){logger[_0xe749('0xd')](_0xe749('0x12'),_0x13500d,_0x105df0);if(_0x105df0==0x0){var _0x345528=_0x4e408d[_0xe749('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0xe749('0x14')](_0x3cfebb[0x1])||_[_0xe749('0x15')](_0x3cfebb[0x1])){logger[_0xe749('0xd')]('[%s][SYSTEM]\x20no\x20variable',_0x13500d);_0x5444f3[_0xe749('0x16')][_0x3cfebb[0x1]]=_0x345528;}else{logger[_0xe749('0xd')](_0xe749('0x17'),_0x13500d,_0x3cfebb[0x1],_0x345528);_0x5444f3[_0xe749('0x16')][_0x3cfebb[0x1]]=_0x345528;}}_0x2853d7[_0xe749('0xf')]();});}}catch(_0x3491c7){logger[_0xe749('0x9')](_0xe749('0xa'),_0x13500d,_['isObject'](_0x3491c7)?JSON['stringify'](_0x3491c7):_0x3491c7);logger[_0xe749('0xd')](_0xe749('0xe'),_0x13500d);_0x2853d7[_0xe749('0xf')]();}};}; \ No newline at end of file +var _0x37d7=['string','consequence','length','error','map','message','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','replace','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','[%s][SYSTEM]\x20%s','isObject','validate','shelljs','lodash','./utils','../../../../config/logger'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x37d7,0x163));var _0x737d=function(_0x5ba2c8,_0x5826ef){_0x5ba2c8=_0x5ba2c8-0x0;var _0x6c177f=_0x37d7[_0x5ba2c8];return _0x6c177f;};'use strict';var schema=require(_0x737d('0x0'));var sh=require(_0x737d('0x1'));var _=require(_0x737d('0x2'));var utils=require(_0x737d('0x3'));var logger=require(_0x737d('0x4'))('routing');var system=schema({'command':{'type':_0x737d('0x5'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x737d('0x6')]=function(_0x46c018,_0xd51656){return function(_0x1e152e){try{var _0x1e1c26={'command':_0xd51656[0x0]};var _0x14b91c=system[_0x737d('0x0')](_0x1e1c26,{'typecast':!![]});if(_0x14b91c[_0x737d('0x7')]){logger[_0x737d('0x8')]('[%s][SYSTEM]\x20%s',_0x46c018,_[_0x737d('0x9')](_0x14b91c,_0x737d('0xa'))['join'](',\x20'));logger[_0x737d('0xb')](_0x737d('0xc'),_0x46c018);_0x1e152e['next']();}else{var _0x2f0661=this;var _0x293d25=utils[_0x737d('0xd')](_0xd51656[0x0],this);logger[_0x737d('0xb')](_0x737d('0xe'),_0x46c018,_0x293d25);sh[_0x737d('0xf')](_['trim'](_0x293d25),function(_0x1e0dd0,_0x3863ce){logger['info']('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x46c018,_0x1e0dd0);if(_0x1e0dd0==0x0){var _0x2234aa=_0x3863ce[_0x737d('0x10')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0xd51656[0x1])||_[_0x737d('0x11')](_0xd51656[0x1])){logger[_0x737d('0xb')](_0x737d('0x12'),_0x46c018);_0x2f0661[_0x737d('0x13')][_0xd51656[0x1]]=_0x2234aa;}else{logger[_0x737d('0xb')](_0x737d('0x14'),_0x46c018,_0xd51656[0x1],_0x2234aa);_0x2f0661['body'][_0xd51656[0x1]]=_0x2234aa;}}_0x1e152e[_0x737d('0x15')]();});}}catch(_0x5dc2b0){logger[_0x737d('0x8')](_0x737d('0x16'),_0x46c018,_[_0x737d('0x17')](_0x5dc2b0)?JSON['stringify'](_0x5dc2b0):_0x5dc2b0);logger['info'](_0x737d('0xc'),_0x46c018);_0x1e152e['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index 55ee6b6..49227b7 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 _0xfeac=['then','info','catch','stringify','finally','error','[%s][TAG]\x20%s','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','number','consequence','map','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction'];(function(_0x184031,_0x2672ea){var _0x4aa18a=function(_0x217bd1){while(--_0x217bd1){_0x184031['push'](_0x184031['shift']());}};_0x4aa18a(++_0x2672ea);}(_0xfeac,0xd8));var _0xcfea=function(_0x225c6e,_0x3b09cb){_0x225c6e=_0x225c6e-0x0;var _0x1f73c2=_0xfeac[_0x225c6e];return _0x1f73c2;};'use strict';var schema=require(_0xcfea('0x0'));var _=require(_0xcfea('0x1'));var rpc={'chatInteraction':require(_0xcfea('0x2')),'openchannelInteraction':require(_0xcfea('0x3')),'smsInteraction':require(_0xcfea('0x4')),'mailInteraction':require(_0xcfea('0x5')),'faxInteraction':require(_0xcfea('0x6')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0xcfea('0x7'))('routing');var tag=schema({'tag':{'type':_0xcfea('0x8'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xcfea('0x9')]=function(_0x527cbb,_0x2dd917,_0x5c5c7c,_0x4700d5){return function(_0x24ae65){try{var _0x1bb80a={'tag':_0x2dd917[0x0]};var _0xc5c3c8=tag[_0xcfea('0x0')](_0x1bb80a,{'typecast':!![]});if(_0xc5c3c8['length']){logger['error']('[%s][TAG]\x20%s',_0x527cbb,_[_0xcfea('0xa')](_0xc5c3c8,'message')[_0xcfea('0xb')](',\x20'));logger['info'](_0xcfea('0xc'),_0x527cbb);_0x24ae65[_0xcfea('0xd')]();}else{var _0x36e484={'ids':[_0x2dd917[0x0]]};if(rpc[_0x4700d5[_0xcfea('0xe')]+_0xcfea('0xf')]){rpc[_0x4700d5[_0xcfea('0xe')]+_0xcfea('0xf')][_0xcfea('0x10')](_0x4700d5[_0xcfea('0x11')]['id'],_0x36e484)[_0xcfea('0x12')](function(_0x5241e5){logger[_0xcfea('0x13')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x527cbb,_0x2dd917[0x1],_0x4700d5[_0xcfea('0xe')],_0x4700d5[_0xcfea('0x11')]['id']);})[_0xcfea('0x14')](function(_0x387f24){logger['error']('[%s][TAG]\x20%s',_0x527cbb,JSON[_0xcfea('0x15')](_0x387f24));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x527cbb);})[_0xcfea('0x16')](function(){_0x24ae65[_0xcfea('0xd')]();});}}}catch(_0x5f28cb){logger[_0xcfea('0x17')](_0xcfea('0x18'),_0x527cbb,_[_0xcfea('0x19')](_0x5f28cb)?JSON[_0xcfea('0x15')](_0x5f28cb):_0x5f28cb);logger[_0xcfea('0x13')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x527cbb);_0x24ae65['next']();}};}; \ No newline at end of file +var _0x56dc=['catch','stringify','next','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','error','[%s][TAG]\x20%s','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','channel','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s'];(function(_0x4a0a4e,_0x318269){var _0x4b292f=function(_0x1c41c6){while(--_0x1c41c6){_0x4a0a4e['push'](_0x4a0a4e['shift']());}};_0x4b292f(++_0x318269);}(_0x56dc,0xcc));var _0xc56d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x56dc[_0x3dd15e];return _0x231fd0;};'use strict';var schema=require(_0xc56d('0x0'));var _=require(_0xc56d('0x1'));var rpc={'chatInteraction':require(_0xc56d('0x2')),'openchannelInteraction':require(_0xc56d('0x3')),'smsInteraction':require(_0xc56d('0x4')),'mailInteraction':require(_0xc56d('0x5')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0xc56d('0x6'))(_0xc56d('0x7'));var tag=schema({'tag':{'type':_0xc56d('0x8'),'required':!![],'message':_0xc56d('0x9')}});exports['consequence']=function(_0x2ef3c8,_0x2a8ec3,_0x5939cb,_0x45a673){return function(_0x2749ae){try{var _0x2793ac={'tag':_0x2a8ec3[0x0]};var _0x2cb138=tag[_0xc56d('0x0')](_0x2793ac,{'typecast':!![]});if(_0x2cb138['length']){logger[_0xc56d('0xa')](_0xc56d('0xb'),_0x2ef3c8,_[_0xc56d('0xc')](_0x2cb138,_0xc56d('0xd'))[_0xc56d('0xe')](',\x20'));logger[_0xc56d('0xf')](_0xc56d('0x10'),_0x2ef3c8);_0x2749ae['next']();}else{var _0x3f4e99={'ids':[_0x2a8ec3[0x0]]};if(rpc[_0x45a673[_0xc56d('0x11')]+'Interaction']){rpc[_0x45a673[_0xc56d('0x11')]+'Interaction']['addTags'](_0x45a673[_0xc56d('0x12')]['id'],_0x3f4e99)[_0xc56d('0x13')](function(_0x22d66a){logger[_0xc56d('0xf')](_0xc56d('0x14'),_0x2ef3c8,_0x2a8ec3[0x1],_0x45a673[_0xc56d('0x11')],_0x45a673[_0xc56d('0x12')]['id']);})[_0xc56d('0x15')](function(_0x22b111){logger['error'](_0xc56d('0xb'),_0x2ef3c8,JSON[_0xc56d('0x16')](_0x22b111));logger[_0xc56d('0xf')](_0xc56d('0x10'),_0x2ef3c8);})['finally'](function(){_0x2749ae[_0xc56d('0x17')]();});}}}catch(_0x8bbe9d){logger['error'](_0xc56d('0xb'),_0x2ef3c8,_[_0xc56d('0x18')](_0x8bbe9d)?JSON[_0xc56d('0x16')](_0x8bbe9d):_0x8bbe9d);logger['info'](_0xc56d('0x10'),_0x2ef3c8);_0x2749ae[_0xc56d('0x17')]();}};}; \ 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 b8da2ce..3731e17 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x3801ea,_0x3daa3a){var _0x18743e=function(_0x32763c){while(--_0x32763c){_0x3801ea['push'](_0x3801ea['shift']());}};_0x18743e(++_0x3daa3a);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file +var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0xe99bd0,_0x1a7d81){var _0x527461=function(_0x6e2085){while(--_0x6e2085){_0xe99bd0['push'](_0xe99bd0['shift']());}};_0x527461(++_0x1a7d81);}(_0xe706,0xa3));var _0x6e70=function(_0xa861aa,_0x2895a4){_0xa861aa=_0xa861aa-0x0;var _0x1e34de=_0xe706[_0xa861aa];return _0x1e34de;};'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 7c03781..655ea6b 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 _0x743c=['priority','info','Push\x20new\x20rule','execute','Applications\x20executed','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','error','agent','agents','busy','end','QueueReport','UserId','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','busyQueue','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','127.0.0.1','log','lodash','util','path','jayson/promise','bluebird','uuid','../../../config/logger','routing','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','app','.js','autoreply','split','mail','push','slice','join','dialogflow','appdata','dialogflowv2','amazonlex','tag','TagId','%s:%s:%s','./interval','condition','intervals','./applications/','consequence'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x743c,0x148));var _0xc743=function(_0x197853,_0x24487b){_0x197853=_0x197853-0x0;var _0x1cbb30=_0x743c[_0x197853];return _0x1cbb30;};'use strict';var _=require(_0xc743('0x0'));var util=require(_0xc743('0x1'));var path=require(_0xc743('0x2'));var fs=require('fs');var jayson=require(_0xc743('0x3'));var BPromise=require(_0xc743('0x4'));var uuid=require(_0xc743('0x5'));var config=require('../../../config/environment');var logger=require(_0xc743('0x6'))(_0xc743('0x7'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0xc743('0x8')),'smsQueueReport':require(_0xc743('0x9')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xc743('0xa'))};var RuleEngine=require(_0xc743('0xb'));function getId(_0x343055,_0x14e768,_0xd288d0){return util[_0xc743('0xc')](_0xc743('0xd'),_0x343055,_0x14e768||0x0,_0xd288d0||0x0);}function getIntervals(_0x2b1c10,_0x553c5e){var _0x4063c4=[];if(!_[_0xc743('0xe')](_0x553c5e[_0xc743('0xf')])&&!_[_0xc743('0xe')](_0x2b1c10[_0x553c5e[_0xc743('0xf')]])&&!_[_0xc743('0xe')](_0x2b1c10[_0x553c5e['IntervalId']][_0xc743('0x10')])){_0x4063c4=_[_0xc743('0x11')](_0x2b1c10[_0x553c5e['IntervalId']][_0xc743('0x10')],_0xc743('0x12'));}else if(!_[_0xc743('0xe')](_0x553c5e[_0xc743('0x12')])){_0x4063c4=[_0x553c5e[_0xc743('0x12')]];}return _0x4063c4;}exports[_0xc743('0x13')]=function(_0x357cd3){_0x357cd3[_0xc743('0x14')]={};return new BPromise(function(_0x377836,_0x5bc776){var _0x5739e6={'Start':function(_0x16ad71){var _0x43f301=this;return new Promise(function(_0x15019b,_0x48d7ba){if(_0x16ad71){try{var _0x4f46fa=[];var _0x54cb0f=getId(_0x16ad71[_0xc743('0x15')],_0x16ad71[_0xc743('0x16')]?_0x16ad71[_0xc743('0x16')]['id']:0x0,_0x16ad71[_0xc743('0x17')]?_0x16ad71[_0xc743('0x17')]['id']:0x0);if(_0x16ad71[_0xc743('0x18')]&&_[_0xc743('0x19')](_0x16ad71[_0xc743('0x18')])&&_0x16ad71[_0xc743('0x18')][_0xc743('0x1a')]){for(var _0x4156f7=0x0;_0x4156f7<_0x16ad71[_0xc743('0x18')]['length'];_0x4156f7+=0x1){var _0x4be3d7=_0x16ad71[_0xc743('0x18')][_0x4156f7];if(fs[_0xc743('0x1b')](path['join'](__dirname,_0xc743('0x18'),_0x4be3d7[_0xc743('0x1c')]+_0xc743('0x1d')))){var _0xd4fd0f=[];switch(_0x4be3d7[_0xc743('0x1c')]['toLowerCase']()){case _0xc743('0x1e'):var _0x45f9d9=_0x4be3d7['appdata'][_0xc743('0x1f')](',');if(_0x16ad71['channel']===_0xc743('0x20')){_0xd4fd0f[_0xc743('0x21')](_0x45f9d9[0x0]);_0xd4fd0f[_0xc743('0x21')](_0x45f9d9[0x1]);_0xd4fd0f[_0xc743('0x21')](_0x45f9d9[_0xc743('0x22')](0x2,_0x45f9d9['length'])[_0xc743('0x23')](','));}else{_0xd4fd0f['push'](_0x45f9d9[0x0]);_0xd4fd0f['push'](_0x45f9d9[_0xc743('0x22')](0x1,_0x45f9d9[_0xc743('0x1a')])['join'](','));}break;case _0xc743('0x24'):var _0x49ac28=_0x4be3d7[_0xc743('0x25')][_0xc743('0x1f')](',');_0xd4fd0f[_0xc743('0x21')](_0x49ac28[0x0]);_0xd4fd0f[_0xc743('0x21')](_0x49ac28[0x1]);_0xd4fd0f[_0xc743('0x21')](_0x49ac28[_0xc743('0x22')](0x2,_0x49ac28[_0xc743('0x1a')])[_0xc743('0x23')](','));break;case _0xc743('0x26'):var _0x3d9945=_0x4be3d7[_0xc743('0x25')][_0xc743('0x1f')](',');_0xd4fd0f[_0xc743('0x21')](_0x3d9945[0x0]);_0xd4fd0f[_0xc743('0x21')](_0x3d9945[0x1]);_0xd4fd0f[_0xc743('0x21')](_0x3d9945[0x2]);_0xd4fd0f['push'](_0x3d9945[0x3]);_0xd4fd0f[_0xc743('0x21')](_0x3d9945[_0xc743('0x22')](0x4,_0x3d9945[_0xc743('0x1a')])[_0xc743('0x23')](','));break;case _0xc743('0x27'):var _0x5725ea=_0x4be3d7[_0xc743('0x25')][_0xc743('0x1f')](',');_0xd4fd0f['push'](_0x5725ea[0x0]);_0xd4fd0f[_0xc743('0x21')](_0x5725ea[0x1]);_0xd4fd0f[_0xc743('0x21')](_0x5725ea[0x2]);_0xd4fd0f[_0xc743('0x21')](_0x5725ea[0x3]);_0xd4fd0f[_0xc743('0x21')](_0x5725ea[_0xc743('0x22')](0x4,_0x5725ea[_0xc743('0x1a')])[_0xc743('0x23')](','));break;case'message':_0xd4fd0f[_0xc743('0x21')](_0x4be3d7[_0xc743('0x25')]);break;case _0xc743('0x28'):_0xd4fd0f[_0xc743('0x21')](_0x4be3d7[_0xc743('0x29')]);_0xd4fd0f[_0xc743('0x21')](_0x4be3d7[_0xc743('0x25')]);break;default:_0xd4fd0f=_[_0xc743('0xe')](_0x4be3d7[_0xc743('0x25')])?[]:_0x4be3d7[_0xc743('0x25')][_0xc743('0x1f')](',');}var _0x55d95c={'id':util[_0xc743('0xc')](_0xc743('0x2a'),_0x54cb0f,_0x4be3d7['id'],_0x4be3d7[_0xc743('0x1c')]),'condition':require(_0xc743('0x2b'))[_0xc743('0x2c')](_0x54cb0f,getIntervals(_0x357cd3[_0xc743('0x2d')],_0x4be3d7),_0x357cd3),'consequence':require(_0xc743('0x2e')+_0x4be3d7[_0xc743('0x1c')])[_0xc743('0x2f')](_0x54cb0f,_0xd4fd0f,_0x357cd3,_0x16ad71),'p':_0x4be3d7[_0xc743('0x30')]||0x0};logger[_0xc743('0x31')](_0xc743('0x32'),_0x55d95c['id'],'on\x20interval',getIntervals(_0x357cd3[_0xc743('0x2d')],_0x4be3d7)['join']('\x20|\x20'));_0x4f46fa[_0xc743('0x21')](_0x55d95c);}else{logger['error']('Please\x20create\x20a\x20new\x20file\x20under',path[_0xc743('0x23')](__dirname,_0xc743('0x18'),_0x4be3d7[_0xc743('0x1c')]+_0xc743('0x1d')));}}_0x357cd3[_0xc743('0x14')][_0x54cb0f]=new RuleEngine(_0x4f46fa);_0x357cd3[_0xc743('0x14')][_0x54cb0f][_0xc743('0x33')](_0x16ad71,function(_0x53426a){logger['info'](_0xc743('0x34'),JSON[_0xc743('0x35')](_0x53426a[_0xc743('0x36')]));if(_0x357cd3['rules'][_0x54cb0f]){_0x357cd3['rules'][_0x54cb0f][_0xc743('0x37')](_0xc743('0x38'));}});return _0x15019b({'code':0xc8,'message':_0x16ad71});}else{logger[_0xc743('0x31')](_0xc743('0x39'));return _0x15019b({'code':0xc8,'message':_0x16ad71});}}catch(_0x3a658d){logger[_0xc743('0x3a')](_0x3a658d['stack']);return _0x48d7ba(_0x43f301[_0xc743('0x3a')](0x1f4,_0x3a658d));}}return _0x48d7ba('routing\x20is\x20empty');});},'AcceptMessage':function(_0xed4843){var _0x5f5161=this;return new Promise(function(_0x2cba86,_0x3262e7){if(_0xed4843[_0xc743('0x3b')]&&_0xed4843[_0xc743('0x3b')]['id']){if(_0x357cd3[_0xc743('0x3c')][_0xed4843[_0xc743('0x3b')]['id']]){_0x357cd3['agents'][_0xed4843['agent']['id']][_0xc743('0x3d')]=![];_0x357cd3[_0xc743('0x3c')][_0xed4843[_0xc743('0x3b')]['id']]['busyQueue']=undefined;}}if(_0xed4843['message']&&_0xed4843[_0xc743('0x16')]['id']){try{var _0x2319c3=getId(_0xed4843[_0xc743('0x15')],_0xed4843[_0xc743('0x16')]?_0xed4843[_0xc743('0x16')]['id']:0x0,_0xed4843[_0xc743('0x17')]?_0xed4843[_0xc743('0x17')]['id']:0x0);if(_0x357cd3['rules'][_0x2319c3]){_0x357cd3[_0xc743('0x14')][_0x2319c3]['emit'](_0xc743('0x3e'));if(rpc[_0xed4843[_0xc743('0x15')]+'QueueReport']){rpc[_0xed4843['channel']+_0xc743('0x3f')]['update'](_0x2319c3,{'UserId':_0xed4843[_0xc743('0x16')][_0xc743('0x40')]})[_0xc743('0x41')](function(_0x19167f){logger[_0xc743('0x3a')](_0xc743('0x42'));});}}return _0x2cba86({'code':0xc8,'message':_0xed4843});}catch(_0x23b28c){logger['error'](_0x23b28c[_0xc743('0x43')]);return _0x3262e7(_0x5f5161['error'](0x1f4,_0x23b28c));}}logger['error'](_0xc743('0x44'));return _0x3262e7(_0x5f5161[_0xc743('0x3a')](0x1f4,_0xc743('0x44')));});},'RejectMessage':function(_0x47fa2c){var _0x4d2bb4=this;return new Promise(function(_0x207c5e,_0xd2fb73){if(_0x47fa2c[_0xc743('0x3b')]&&_0x47fa2c[_0xc743('0x3b')]['id']){try{if(_0x357cd3['agents'][_0x47fa2c[_0xc743('0x3b')]['id']]){_0x357cd3[_0xc743('0x3c')][_0x47fa2c[_0xc743('0x3b')]['id']][_0xc743('0x3d')]=![];_0x357cd3['agents'][_0x47fa2c[_0xc743('0x3b')]['id']][_0xc743('0x45')]=undefined;}return _0x207c5e({'code':0xc8,'message':_0x47fa2c});}catch(_0x3ca4ec){logger[_0xc743('0x3a')](_0x3ca4ec[_0xc743('0x43')]);return _0xd2fb73(_0x4d2bb4[_0xc743('0x3a')](0x1f4,_0x3ca4ec));}}logger[_0xc743('0x3a')](_0xc743('0x44'));return _0xd2fb73(_0x4d2bb4[_0xc743('0x3a')](0x1f4,_0xc743('0x44')));});},'AbandonInteraction':function(_0x15fe9d){var _0x33ae11=this;return new Promise(function(_0x17cb11,_0x29953d){if(_0x15fe9d[_0xc743('0x15')]&&_0x15fe9d[_0xc743('0x17')]&&_0x15fe9d[_0xc743('0x17')]['id']){try{var _0xe201ef=getId(_0x15fe9d['channel'],_0x15fe9d['message']?_0x15fe9d['message']['id']:0x0,_0x15fe9d[_0xc743('0x17')]?_0x15fe9d[_0xc743('0x17')]['id']:0x0);if(_0x357cd3[_0xc743('0x14')][_0xe201ef]){_0x357cd3[_0xc743('0x14')][_0xe201ef][_0xc743('0x37')](_0xc743('0x3e'));}return _0x17cb11({'code':0xc8,'message':_0x15fe9d});}catch(_0x38f15a){logger[_0xc743('0x3a')](_0x38f15a['stack']);return _0x29953d(_0x33ae11[_0xc743('0x3a')](0x1f4,_0x38f15a));}}logger['error'](_0xc743('0x44'));return _0x29953d(_0x33ae11[_0xc743('0x3a')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x45dc69){var _0x34f81a=this;return new Promise(function(_0x1e2450,_0x474d23){if(_0x357cd3[_0xc743('0x3c')][_0xc743('0x46')](_0x45dc69['id'])){for(var _0x573471 in _0x45dc69[_0xc743('0x47')]){if(_0x45dc69['capacity']['hasOwnProperty'](_0x573471)){if(_0x357cd3['agents'][_0x45dc69['id']][_0xc743('0x46')](_0x573471+_0xc743('0x48'))){_0x357cd3[_0xc743('0x3c')][_0x45dc69['id']][_0x573471+'CurrentCapacity']=parseInt(_0x45dc69['capacity'][_0x573471],0xa);}}}_0x357cd3[_0xc743('0x3c')][_0x45dc69['id']][_0xc743('0x49')]();return _0x1e2450({'code':0xc8,'message':_0x357cd3[_0xc743('0x3c')][_0x45dc69['id']]});}else{return _0x474d23(_0x34f81a[_0xc743('0x3a')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x29e993){return new Promise(function(_0x4de155,_0x3209d8){var _0x7c0850=_[_0xc743('0x4a')](_0x357cd3['agents']);_0x4de155({'count':_0x7c0850['length'],'rows':_0x7c0850});});},'ChatQueues':function(_0xd23451){return new Promise(function(_0x2e261e,_0xc469e5){var _0x40c6db=[];for(var _0x495ab6 in _0x357cd3[_0xc743('0x4b')]){if(_0x357cd3[_0xc743('0x4b')][_0xc743('0x46')](_0x495ab6)){var _0x18ee8c=_0x357cd3[_0xc743('0x4b')][_0x495ab6];var _0x4472a5={'id':_0x18ee8c['id'],'available':_0x18ee8c[_0xc743('0x4c')],'loggedIn':_0x18ee8c[_0xc743('0x4d')],'name':_0x18ee8c[_0xc743('0x4e')],'paused':_0x18ee8c[_0xc743('0x4f')],'waiting':_0x18ee8c[_0xc743('0x50')]};_0x40c6db['push'](_0x4472a5);}}_0x2e261e({'count':_0x40c6db[_0xc743('0x1a')],'rows':_0x40c6db});});},'MailQueues':function(_0x418e96){return new Promise(function(_0x3def59,_0x50a23d){var _0x195311=[];for(var _0x6af443 in _0x357cd3[_0xc743('0x51')]){if(_0x357cd3[_0xc743('0x51')]['hasOwnProperty'](_0x6af443)){var _0x3120ee=_0x357cd3['mailQueues'][_0x6af443];var _0x294eb4={'id':_0x3120ee['id'],'available':_0x3120ee[_0xc743('0x4c')],'loggedIn':_0x3120ee[_0xc743('0x4d')],'name':_0x3120ee[_0xc743('0x4e')],'paused':_0x3120ee['paused'],'waiting':_0x3120ee[_0xc743('0x50')]};_0x195311[_0xc743('0x21')](_0x294eb4);}}_0x3def59({'count':_0x195311[_0xc743('0x1a')],'rows':_0x195311});});},'OpenchannelQueues':function(_0x301e5e){return new Promise(function(_0x49371e,_0x2fc2e4){var _0x3f92e8=[];for(var _0x216336 in _0x357cd3['openchannelQueues']){if(_0x357cd3[_0xc743('0x52')][_0xc743('0x46')](_0x216336)){var _0x551b07=_0x357cd3['openchannelQueues'][_0x216336];var _0x13df4b={'id':_0x551b07['id'],'available':_0x551b07['available'],'loggedIn':_0x551b07[_0xc743('0x4d')],'name':_0x551b07[_0xc743('0x4e')],'paused':_0x551b07[_0xc743('0x4f')],'waiting':_0x551b07[_0xc743('0x50')]};_0x3f92e8[_0xc743('0x21')](_0x13df4b);}}_0x49371e({'count':_0x3f92e8['length'],'rows':_0x3f92e8});});},'SmsQueues':function(_0x1924fc){return new Promise(function(_0x442966,_0x1f3d10){var _0x48a420=[];for(var _0x476d15 in _0x357cd3[_0xc743('0x53')]){if(_0x357cd3['smsQueues']['hasOwnProperty'](_0x476d15)){var _0x26e6b4=_0x357cd3[_0xc743('0x53')][_0x476d15];var _0x2d0fc6={'id':_0x26e6b4['id'],'available':_0x26e6b4['available'],'loggedIn':_0x26e6b4[_0xc743('0x4d')],'name':_0x26e6b4['name'],'paused':_0x26e6b4[_0xc743('0x4f')],'waiting':_0x26e6b4[_0xc743('0x50')]};_0x48a420[_0xc743('0x21')](_0x2d0fc6);}}_0x442966({'count':_0x48a420[_0xc743('0x1a')],'rows':_0x48a420});});},'FaxQueues':function(_0x290466){return new Promise(function(_0x2ddaae,_0x2c64fd){var _0x802190=[];for(var _0x1f1522 in _0x357cd3[_0xc743('0x54')]){if(_0x357cd3[_0xc743('0x54')]['hasOwnProperty'](_0x1f1522)){var _0x531d0f=_0x357cd3[_0xc743('0x54')][_0x1f1522];var _0x19fdb2={'id':_0x531d0f['id'],'available':_0x531d0f['available'],'loggedIn':_0x531d0f[_0xc743('0x4d')],'name':_0x531d0f['name'],'paused':_0x531d0f[_0xc743('0x4f')],'waiting':_0x531d0f[_0xc743('0x50')]};_0x802190[_0xc743('0x21')](_0x19fdb2);}}_0x2ddaae({'count':_0x802190[_0xc743('0x1a')],'rows':_0x802190});});},'WhatsappQueues':function(_0x21cc1f){return new Promise(function(_0x3fe377,_0x4618e1){var _0x5e52a5=[];for(var _0x5bd332 in _0x357cd3['whatsappQueues']){if(_0x357cd3[_0xc743('0x55')][_0xc743('0x46')](_0x5bd332)){var _0x1f8f2f=_0x357cd3[_0xc743('0x55')][_0x5bd332];var _0xeae10b={'id':_0x1f8f2f['id'],'available':_0x1f8f2f[_0xc743('0x4c')],'loggedIn':_0x1f8f2f[_0xc743('0x4d')],'name':_0x1f8f2f[_0xc743('0x4e')],'paused':_0x1f8f2f[_0xc743('0x4f')],'waiting':_0x1f8f2f[_0xc743('0x50')]};_0x5e52a5[_0xc743('0x21')](_0xeae10b);}}_0x3fe377({'count':_0x5e52a5[_0xc743('0x1a')],'rows':_0x5e52a5});});},'ChatQueuesWaitingInteractions':function(_0x3a1358){return new Promise(function(_0x229872,_0x368735){var _0x2e65d2=_['values'](_0x357cd3['chatQueuesWaitingInteractions']);_0x229872({'count':_0x2e65d2['length'],'rows':_0x2e65d2});});},'MailQueuesWaitingInteractions':function(_0x27883a){return new Promise(function(_0x41c457,_0x2155b4){var _0x4bc33d=_['values'](_0x357cd3[_0xc743('0x56')]);_0x41c457({'count':_0x4bc33d[_0xc743('0x1a')],'rows':_0x4bc33d});});},'OpenchannelQueuesWaitingInteractions':function(_0x52bd00){return new Promise(function(_0x343dfb,_0x587255){var _0x3445dd=_[_0xc743('0x4a')](_0x357cd3[_0xc743('0x57')]);_0x343dfb({'count':_0x3445dd[_0xc743('0x1a')],'rows':_0x3445dd});});},'SmsQueuesWaitingInteractions':function(_0x10cd14){return new Promise(function(_0x5c809b,_0x3bc874){var _0x12ae96=_['values'](_0x357cd3[_0xc743('0x58')]);_0x5c809b({'count':_0x12ae96[_0xc743('0x1a')],'rows':_0x12ae96});});},'FaxQueuesWaitingInteractions':function(_0x310680){return new Promise(function(_0x30ed52,_0x52770f){var _0x6266b4=_[_0xc743('0x4a')](_0x357cd3[_0xc743('0x59')]);_0x30ed52({'count':_0x6266b4['length'],'rows':_0x6266b4});});},'WhatsappQueuesWaitingInteractions':function(_0x34104c){return new Promise(function(_0x1e420c,_0x22e27a){var _0x9bbebf=_[_0xc743('0x4a')](_0x357cd3[_0xc743('0x5a')]);_0x1e420c({'count':_0x9bbebf[_0xc743('0x1a')],'rows':_0x9bbebf});});}};var _0x1a7f80=jayson[_0xc743('0x5b')](_0x5739e6)['http']();_0x1a7f80['on'](_0xc743('0x3a'),function(_0x444b8a){logger['error'](JSON[_0xc743('0x35')](_0x444b8a));return _0x5bc776(_0x444b8a);});_0x1a7f80[_0xc743('0x13')](0x232c,_0xc743('0x5c'),function(){console[_0xc743('0x5d')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x377836('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file +var _0xae2c=['appdata','amazonlex','tag','TagId','%s:%s:%s','./interval','condition','info','Push\x20new\x20rule','on\x20interval','intervals','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','Applications\x20executed','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','error','routing\x20is\x20empty','agent','agents','busyQueue','QueueReport','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','stack','hasOwnProperty','capacity','CurrentCapacity','values','chatQueues','available','name','paused','waiting','mailQueues','openchannelQueues','loggedIn','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','path','jayson/promise','uuid','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','isNil','IntervalId','Intervals','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','join','app','.js','toLowerCase','split','mail','push','slice','dialogflow'];(function(_0x5723ff,_0x1e34d3){var _0x5a37ea=function(_0x121d37){while(--_0x121d37){_0x5723ff['push'](_0x5723ff['shift']());}};_0x5a37ea(++_0x1e34d3);}(_0xae2c,0x94));var _0xcae2=function(_0x511daa,_0x76389b){_0x511daa=_0x511daa-0x0;var _0x2b7875=_0xae2c[_0x511daa];return _0x2b7875;};'use strict';var _=require(_0xcae2('0x0'));var util=require('util');var path=require(_0xcae2('0x1'));var fs=require('fs');var jayson=require(_0xcae2('0x2'));var BPromise=require('bluebird');var uuid=require(_0xcae2('0x3'));var config=require('../../../config/environment');var logger=require(_0xcae2('0x4'))(_0xcae2('0x5'));var rpc={'openchannelQueueReport':require(_0xcae2('0x6')),'mailQueueReport':require(_0xcae2('0x7')),'chatQueueReport':require(_0xcae2('0x8')),'smsQueueReport':require(_0xcae2('0x9')),'faxQueueReport':require(_0xcae2('0xa')),'whatsappQueueReport':require(_0xcae2('0xb'))};var RuleEngine=require(_0xcae2('0xc'));function getId(_0x8c9fd4,_0x249219,_0x3e0761){return util[_0xcae2('0xd')]('%s.%s.%s',_0x8c9fd4,_0x249219||0x0,_0x3e0761||0x0);}function getIntervals(_0x3da4e4,_0x1b4bd5){var _0x411f54=[];if(!_[_0xcae2('0xe')](_0x1b4bd5[_0xcae2('0xf')])&&!_['isNil'](_0x3da4e4[_0x1b4bd5['IntervalId']])&&!_[_0xcae2('0xe')](_0x3da4e4[_0x1b4bd5[_0xcae2('0xf')]]['Intervals'])){_0x411f54=_['map'](_0x3da4e4[_0x1b4bd5[_0xcae2('0xf')]][_0xcae2('0x10')],_0xcae2('0x11'));}else if(!_[_0xcae2('0xe')](_0x1b4bd5['interval'])){_0x411f54=[_0x1b4bd5[_0xcae2('0x11')]];}return _0x411f54;}exports[_0xcae2('0x12')]=function(_0x2f9497){_0x2f9497[_0xcae2('0x13')]={};return new BPromise(function(_0x293ce0,_0xc46017){var _0x213633={'Start':function(_0xd631a4){var _0x48d9cc=this;return new Promise(function(_0x32c44b,_0xdb6d88){if(_0xd631a4){try{var _0x3fa952=[];var _0x5bdcca=getId(_0xd631a4[_0xcae2('0x14')],_0xd631a4[_0xcae2('0x15')]?_0xd631a4[_0xcae2('0x15')]['id']:0x0,_0xd631a4['interaction']?_0xd631a4[_0xcae2('0x16')]['id']:0x0);if(_0xd631a4[_0xcae2('0x17')]&&_[_0xcae2('0x18')](_0xd631a4['applications'])&&_0xd631a4['applications'][_0xcae2('0x19')]){for(var _0x26d879=0x0;_0x26d879<_0xd631a4[_0xcae2('0x17')][_0xcae2('0x19')];_0x26d879+=0x1){var _0x3e8e79=_0xd631a4['applications'][_0x26d879];if(fs[_0xcae2('0x1a')](path[_0xcae2('0x1b')](__dirname,_0xcae2('0x17'),_0x3e8e79[_0xcae2('0x1c')]+_0xcae2('0x1d')))){var _0x3c025d=[];switch(_0x3e8e79[_0xcae2('0x1c')][_0xcae2('0x1e')]()){case'autoreply':var _0x177078=_0x3e8e79['appdata'][_0xcae2('0x1f')](',');if(_0xd631a4['channel']===_0xcae2('0x20')){_0x3c025d['push'](_0x177078[0x0]);_0x3c025d[_0xcae2('0x21')](_0x177078[0x1]);_0x3c025d['push'](_0x177078[_0xcae2('0x22')](0x2,_0x177078[_0xcae2('0x19')])[_0xcae2('0x1b')](','));}else{_0x3c025d['push'](_0x177078[0x0]);_0x3c025d[_0xcae2('0x21')](_0x177078[_0xcae2('0x22')](0x1,_0x177078['length'])[_0xcae2('0x1b')](','));}break;case _0xcae2('0x23'):var _0x13869e=_0x3e8e79[_0xcae2('0x24')][_0xcae2('0x1f')](',');_0x3c025d[_0xcae2('0x21')](_0x13869e[0x0]);_0x3c025d[_0xcae2('0x21')](_0x13869e[0x1]);_0x3c025d[_0xcae2('0x21')](_0x13869e[_0xcae2('0x22')](0x2,_0x13869e[_0xcae2('0x19')])[_0xcae2('0x1b')](','));break;case'dialogflowv2':var _0x44ec20=_0x3e8e79[_0xcae2('0x24')]['split'](',');_0x3c025d[_0xcae2('0x21')](_0x44ec20[0x0]);_0x3c025d[_0xcae2('0x21')](_0x44ec20[0x1]);_0x3c025d[_0xcae2('0x21')](_0x44ec20[0x2]);_0x3c025d[_0xcae2('0x21')](_0x44ec20[0x3]);_0x3c025d[_0xcae2('0x21')](_0x44ec20[_0xcae2('0x22')](0x4,_0x44ec20[_0xcae2('0x19')])[_0xcae2('0x1b')](','));break;case _0xcae2('0x25'):var _0xcc6b65=_0x3e8e79[_0xcae2('0x24')][_0xcae2('0x1f')](',');_0x3c025d[_0xcae2('0x21')](_0xcc6b65[0x0]);_0x3c025d[_0xcae2('0x21')](_0xcc6b65[0x1]);_0x3c025d[_0xcae2('0x21')](_0xcc6b65[0x2]);_0x3c025d[_0xcae2('0x21')](_0xcc6b65[0x3]);_0x3c025d[_0xcae2('0x21')](_0xcc6b65['slice'](0x4,_0xcc6b65[_0xcae2('0x19')])[_0xcae2('0x1b')](','));break;case'message':_0x3c025d[_0xcae2('0x21')](_0x3e8e79[_0xcae2('0x24')]);break;case _0xcae2('0x26'):_0x3c025d[_0xcae2('0x21')](_0x3e8e79[_0xcae2('0x27')]);_0x3c025d[_0xcae2('0x21')](_0x3e8e79['appdata']);break;default:_0x3c025d=_[_0xcae2('0xe')](_0x3e8e79[_0xcae2('0x24')])?[]:_0x3e8e79[_0xcae2('0x24')]['split'](',');}var _0x5ee9db={'id':util[_0xcae2('0xd')](_0xcae2('0x28'),_0x5bdcca,_0x3e8e79['id'],_0x3e8e79['app']),'condition':require(_0xcae2('0x29'))[_0xcae2('0x2a')](_0x5bdcca,getIntervals(_0x2f9497['intervals'],_0x3e8e79),_0x2f9497),'consequence':require('./applications/'+_0x3e8e79[_0xcae2('0x1c')])['consequence'](_0x5bdcca,_0x3c025d,_0x2f9497,_0xd631a4),'p':_0x3e8e79['priority']||0x0};logger[_0xcae2('0x2b')](_0xcae2('0x2c'),_0x5ee9db['id'],_0xcae2('0x2d'),getIntervals(_0x2f9497[_0xcae2('0x2e')],_0x3e8e79)['join'](_0xcae2('0x2f')));_0x3fa952[_0xcae2('0x21')](_0x5ee9db);}else{logger['error'](_0xcae2('0x30'),path[_0xcae2('0x1b')](__dirname,'applications',_0x3e8e79[_0xcae2('0x1c')]+_0xcae2('0x1d')));}}_0x2f9497[_0xcae2('0x13')][_0x5bdcca]=new RuleEngine(_0x3fa952);_0x2f9497[_0xcae2('0x13')][_0x5bdcca]['execute'](_0xd631a4,function(_0x2daacb){logger['info'](_0xcae2('0x31'),JSON[_0xcae2('0x32')](_0x2daacb[_0xcae2('0x33')]));if(_0x2f9497[_0xcae2('0x13')][_0x5bdcca]){_0x2f9497['rules'][_0x5bdcca][_0xcae2('0x34')](_0xcae2('0x35'));}});return _0x32c44b({'code':0xc8,'message':_0xd631a4});}else{logger[_0xcae2('0x2b')](_0xcae2('0x36'));return _0x32c44b({'code':0xc8,'message':_0xd631a4});}}catch(_0x14adfc){logger[_0xcae2('0x37')](_0x14adfc['stack']);return _0xdb6d88(_0x48d9cc[_0xcae2('0x37')](0x1f4,_0x14adfc));}}return _0xdb6d88(_0xcae2('0x38'));});},'AcceptMessage':function(_0xd19aed){var _0x198c24=this;return new Promise(function(_0x45d3bb,_0x443033){if(_0xd19aed[_0xcae2('0x39')]&&_0xd19aed['agent']['id']){if(_0x2f9497['agents'][_0xd19aed['agent']['id']]){_0x2f9497[_0xcae2('0x3a')][_0xd19aed[_0xcae2('0x39')]['id']]['busy']=![];_0x2f9497['agents'][_0xd19aed[_0xcae2('0x39')]['id']][_0xcae2('0x3b')]=undefined;}}if(_0xd19aed[_0xcae2('0x15')]&&_0xd19aed[_0xcae2('0x15')]['id']){try{var _0x5262f9=getId(_0xd19aed[_0xcae2('0x14')],_0xd19aed[_0xcae2('0x15')]?_0xd19aed['message']['id']:0x0,_0xd19aed[_0xcae2('0x16')]?_0xd19aed['interaction']['id']:0x0);if(_0x2f9497[_0xcae2('0x13')][_0x5262f9]){_0x2f9497[_0xcae2('0x13')][_0x5262f9]['emit']('end');if(rpc[_0xd19aed[_0xcae2('0x14')]+'QueueReport']){rpc[_0xd19aed[_0xcae2('0x14')]+_0xcae2('0x3c')]['update'](_0x5262f9,{'UserId':_0xd19aed[_0xcae2('0x15')][_0xcae2('0x3d')]})[_0xcae2('0x3e')](function(_0x4233de){logger[_0xcae2('0x37')](_0xcae2('0x3f'));});}}return _0x45d3bb({'code':0xc8,'message':_0xd19aed});}catch(_0x30215c){logger[_0xcae2('0x37')](_0x30215c['stack']);return _0x443033(_0x198c24[_0xcae2('0x37')](0x1f4,_0x30215c));}}logger['error'](_0xcae2('0x40'));return _0x443033(_0x198c24['error'](0x1f4,_0xcae2('0x40')));});},'RejectMessage':function(_0xdc57ec){var _0x1d105b=this;return new Promise(function(_0x270160,_0x31714e){if(_0xdc57ec[_0xcae2('0x39')]&&_0xdc57ec[_0xcae2('0x39')]['id']){try{if(_0x2f9497['agents'][_0xdc57ec[_0xcae2('0x39')]['id']]){_0x2f9497[_0xcae2('0x3a')][_0xdc57ec[_0xcae2('0x39')]['id']]['busy']=![];_0x2f9497[_0xcae2('0x3a')][_0xdc57ec['agent']['id']][_0xcae2('0x3b')]=undefined;}return _0x270160({'code':0xc8,'message':_0xdc57ec});}catch(_0x37ed63){logger[_0xcae2('0x37')](_0x37ed63[_0xcae2('0x41')]);return _0x31714e(_0x1d105b[_0xcae2('0x37')](0x1f4,_0x37ed63));}}logger[_0xcae2('0x37')](_0xcae2('0x40'));return _0x31714e(_0x1d105b[_0xcae2('0x37')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x346fc1){var _0x402af7=this;return new Promise(function(_0x122770,_0x7b2a03){if(_0x346fc1[_0xcae2('0x14')]&&_0x346fc1[_0xcae2('0x16')]&&_0x346fc1[_0xcae2('0x16')]['id']){try{var _0x22079c=getId(_0x346fc1[_0xcae2('0x14')],_0x346fc1[_0xcae2('0x15')]?_0x346fc1[_0xcae2('0x15')]['id']:0x0,_0x346fc1[_0xcae2('0x16')]?_0x346fc1[_0xcae2('0x16')]['id']:0x0);if(_0x2f9497[_0xcae2('0x13')][_0x22079c]){_0x2f9497[_0xcae2('0x13')][_0x22079c][_0xcae2('0x34')]('end');}return _0x122770({'code':0xc8,'message':_0x346fc1});}catch(_0x827a3f){logger[_0xcae2('0x37')](_0x827a3f[_0xcae2('0x41')]);return _0x7b2a03(_0x402af7[_0xcae2('0x37')](0x1f4,_0x827a3f));}}logger[_0xcae2('0x37')](_0xcae2('0x40'));return _0x7b2a03(_0x402af7['error'](0x1f4,_0xcae2('0x40')));});},'AgentCapacity':function(_0x5a0dd2){var _0x17a3ef=this;return new Promise(function(_0x2d3f68,_0x4af9ed){if(_0x2f9497[_0xcae2('0x3a')][_0xcae2('0x42')](_0x5a0dd2['id'])){for(var _0x1da011 in _0x5a0dd2[_0xcae2('0x43')]){if(_0x5a0dd2['capacity'][_0xcae2('0x42')](_0x1da011)){if(_0x2f9497[_0xcae2('0x3a')][_0x5a0dd2['id']][_0xcae2('0x42')](_0x1da011+_0xcae2('0x44'))){_0x2f9497[_0xcae2('0x3a')][_0x5a0dd2['id']][_0x1da011+_0xcae2('0x44')]=parseInt(_0x5a0dd2[_0xcae2('0x43')][_0x1da011],0xa);}}}_0x2f9497['agents'][_0x5a0dd2['id']]['updateRealtime']();return _0x2d3f68({'code':0xc8,'message':_0x2f9497[_0xcae2('0x3a')][_0x5a0dd2['id']]});}else{return _0x4af9ed(_0x17a3ef['error'](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x195470){return new Promise(function(_0x231103,_0x38e29c){var _0x110608=_[_0xcae2('0x45')](_0x2f9497[_0xcae2('0x3a')]);_0x231103({'count':_0x110608['length'],'rows':_0x110608});});},'ChatQueues':function(_0x4b0be6){return new Promise(function(_0x329a91,_0x59316a){var _0x20789e=[];for(var _0x24ac86 in _0x2f9497[_0xcae2('0x46')]){if(_0x2f9497[_0xcae2('0x46')]['hasOwnProperty'](_0x24ac86)){var _0x3440ad=_0x2f9497[_0xcae2('0x46')][_0x24ac86];var _0x4d54c8={'id':_0x3440ad['id'],'available':_0x3440ad[_0xcae2('0x47')],'loggedIn':_0x3440ad['loggedIn'],'name':_0x3440ad[_0xcae2('0x48')],'paused':_0x3440ad[_0xcae2('0x49')],'waiting':_0x3440ad[_0xcae2('0x4a')]};_0x20789e[_0xcae2('0x21')](_0x4d54c8);}}_0x329a91({'count':_0x20789e[_0xcae2('0x19')],'rows':_0x20789e});});},'MailQueues':function(_0x4ad279){return new Promise(function(_0x2119c6,_0x3bc0e2){var _0x2628ba=[];for(var _0x2839a1 in _0x2f9497[_0xcae2('0x4b')]){if(_0x2f9497[_0xcae2('0x4b')][_0xcae2('0x42')](_0x2839a1)){var _0x1b7415=_0x2f9497[_0xcae2('0x4b')][_0x2839a1];var _0x49970c={'id':_0x1b7415['id'],'available':_0x1b7415[_0xcae2('0x47')],'loggedIn':_0x1b7415['loggedIn'],'name':_0x1b7415['name'],'paused':_0x1b7415[_0xcae2('0x49')],'waiting':_0x1b7415[_0xcae2('0x4a')]};_0x2628ba['push'](_0x49970c);}}_0x2119c6({'count':_0x2628ba[_0xcae2('0x19')],'rows':_0x2628ba});});},'OpenchannelQueues':function(_0x25dc03){return new Promise(function(_0x15ccc6,_0x36ae42){var _0x1ef38a=[];for(var _0x201a40 in _0x2f9497[_0xcae2('0x4c')]){if(_0x2f9497[_0xcae2('0x4c')][_0xcae2('0x42')](_0x201a40)){var _0x354c52=_0x2f9497[_0xcae2('0x4c')][_0x201a40];var _0xddb734={'id':_0x354c52['id'],'available':_0x354c52[_0xcae2('0x47')],'loggedIn':_0x354c52[_0xcae2('0x4d')],'name':_0x354c52[_0xcae2('0x48')],'paused':_0x354c52[_0xcae2('0x49')],'waiting':_0x354c52[_0xcae2('0x4a')]};_0x1ef38a[_0xcae2('0x21')](_0xddb734);}}_0x15ccc6({'count':_0x1ef38a[_0xcae2('0x19')],'rows':_0x1ef38a});});},'SmsQueues':function(_0x2d242b){return new Promise(function(_0x19faa5,_0x5e51f2){var _0x12e8d9=[];for(var _0x2cea57 in _0x2f9497[_0xcae2('0x4e')]){if(_0x2f9497['smsQueues'][_0xcae2('0x42')](_0x2cea57)){var _0x39df75=_0x2f9497[_0xcae2('0x4e')][_0x2cea57];var _0x4c80ae={'id':_0x39df75['id'],'available':_0x39df75[_0xcae2('0x47')],'loggedIn':_0x39df75[_0xcae2('0x4d')],'name':_0x39df75[_0xcae2('0x48')],'paused':_0x39df75[_0xcae2('0x49')],'waiting':_0x39df75[_0xcae2('0x4a')]};_0x12e8d9[_0xcae2('0x21')](_0x4c80ae);}}_0x19faa5({'count':_0x12e8d9[_0xcae2('0x19')],'rows':_0x12e8d9});});},'FaxQueues':function(_0xeee2d){return new Promise(function(_0x404bec,_0x78fd57){var _0x42b13b=[];for(var _0x3ddd55 in _0x2f9497['faxQueues']){if(_0x2f9497[_0xcae2('0x4f')][_0xcae2('0x42')](_0x3ddd55)){var _0x7570e3=_0x2f9497[_0xcae2('0x4f')][_0x3ddd55];var _0xa95af2={'id':_0x7570e3['id'],'available':_0x7570e3[_0xcae2('0x47')],'loggedIn':_0x7570e3[_0xcae2('0x4d')],'name':_0x7570e3['name'],'paused':_0x7570e3[_0xcae2('0x49')],'waiting':_0x7570e3[_0xcae2('0x4a')]};_0x42b13b[_0xcae2('0x21')](_0xa95af2);}}_0x404bec({'count':_0x42b13b['length'],'rows':_0x42b13b});});},'WhatsappQueues':function(_0x2e53d6){return new Promise(function(_0x37e7dd,_0x5d7bb7){var _0x5bcd2f=[];for(var _0x12c228 in _0x2f9497['whatsappQueues']){if(_0x2f9497[_0xcae2('0x50')][_0xcae2('0x42')](_0x12c228)){var _0x56ffc3=_0x2f9497[_0xcae2('0x50')][_0x12c228];var _0x26f072={'id':_0x56ffc3['id'],'available':_0x56ffc3['available'],'loggedIn':_0x56ffc3[_0xcae2('0x4d')],'name':_0x56ffc3['name'],'paused':_0x56ffc3[_0xcae2('0x49')],'waiting':_0x56ffc3[_0xcae2('0x4a')]};_0x5bcd2f[_0xcae2('0x21')](_0x26f072);}}_0x37e7dd({'count':_0x5bcd2f[_0xcae2('0x19')],'rows':_0x5bcd2f});});},'ChatQueuesWaitingInteractions':function(_0x5a3296){return new Promise(function(_0x289527,_0x4ed96a){var _0x25e19f=_[_0xcae2('0x45')](_0x2f9497[_0xcae2('0x51')]);_0x289527({'count':_0x25e19f['length'],'rows':_0x25e19f});});},'MailQueuesWaitingInteractions':function(_0x397fb6){return new Promise(function(_0x1c21cd,_0x5a00fc){var _0x3a1dd3=_[_0xcae2('0x45')](_0x2f9497[_0xcae2('0x52')]);_0x1c21cd({'count':_0x3a1dd3[_0xcae2('0x19')],'rows':_0x3a1dd3});});},'OpenchannelQueuesWaitingInteractions':function(_0x2217c5){return new Promise(function(_0x4b1fec,_0x595d22){var _0x593bca=_[_0xcae2('0x45')](_0x2f9497[_0xcae2('0x53')]);_0x4b1fec({'count':_0x593bca[_0xcae2('0x19')],'rows':_0x593bca});});},'SmsQueuesWaitingInteractions':function(_0x476dd6){return new Promise(function(_0x1f0ab0,_0xb0f416){var _0x15ac0b=_[_0xcae2('0x45')](_0x2f9497[_0xcae2('0x54')]);_0x1f0ab0({'count':_0x15ac0b[_0xcae2('0x19')],'rows':_0x15ac0b});});},'FaxQueuesWaitingInteractions':function(_0x58f299){return new Promise(function(_0x3f6fcf,_0x30f7fa){var _0x41268d=_[_0xcae2('0x45')](_0x2f9497[_0xcae2('0x55')]);_0x3f6fcf({'count':_0x41268d[_0xcae2('0x19')],'rows':_0x41268d});});},'WhatsappQueuesWaitingInteractions':function(_0x459e2a){return new Promise(function(_0x56d588,_0x5d32cd){var _0x28cd66=_[_0xcae2('0x45')](_0x2f9497[_0xcae2('0x56')]);_0x56d588({'count':_0x28cd66[_0xcae2('0x19')],'rows':_0x28cd66});});}};var _0x31d984=jayson['server'](_0x213633)[_0xcae2('0x57')]();_0x31d984['on'](_0xcae2('0x37'),function(_0x4fe7a6){logger[_0xcae2('0x37')](JSON['stringify'](_0x4fe7a6));return _0xc46017(_0x4fe7a6);});_0x31d984[_0xcae2('0x12')](0x232c,_0xcae2('0x58'),function(){console[_0xcae2('0x59')](_0xcae2('0x5a'),0x232c);return _0x293ce0(_0xcae2('0x5b')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 9d8bb47..82cc775 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 _0xf0c5=['info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','Command','format','indexOf','true','all','some','join','\x20|\x20','log','util','lodash','../../../config/logger','client','http','request','then','error','message','result','catch','rules'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0xf0c5,0x184));var _0x5f0c=function(_0x2fdb9c,_0x54946e){_0x2fdb9c=_0x2fdb9c-0x0;var _0x272937=_0xf0c5[_0x2fdb9c];return _0x272937;};'use strict';var util=require(_0x5f0c('0x0'));var BPromise=require('bluebird');var jayson=require('jayson/promise');var _=require(_0x5f0c('0x1'));var logger=require(_0x5f0c('0x2'))('routing');var client=jayson[_0x5f0c('0x3')][_0x5f0c('0x4')]({'port':0x232a});function request(_0x541c43,_0x3cd417){return new BPromise(function(_0x3433b2,_0x31ebc1){return client[_0x5f0c('0x5')](_0x541c43,_0x3cd417)[_0x5f0c('0x6')](function(_0x81e545){if(_0x81e545[_0x5f0c('0x7')]){return _0x31ebc1(_0x81e545['error'][_0x5f0c('0x8')]);}else{return _0x3433b2(_0x81e545[_0x5f0c('0x9')]);}})[_0x5f0c('0xa')](function(_0xd8bd3d){return _0x31ebc1(_0xd8bd3d);});});}exports['condition']=function(_0x133e38,_0x341b88,_0x5706e5){return function(_0x5c473f){if(_0x5706e5[_0x5f0c('0xb')]&&!_0x5706e5[_0x5f0c('0xb')][_0x133e38]){logger[_0x5f0c('0xc')](_0x5f0c('0xd'),_0x133e38);return _0x5c473f[_0x5f0c('0xe')]();}var _0x34ba0c=[];for(var _0x4008ba=0x0;_0x4008ba<_0x341b88[_0x5f0c('0xf')];_0x4008ba+=0x1){_0x34ba0c['push'](request(_0x5f0c('0x10'),{'command':util[_0x5f0c('0x11')]('iftime\x20%s',_0x341b88[_0x4008ba])})['then'](function(_0x168904){return _0x168904&&_0x168904[_0x5f0c('0x8')]&&_0x168904[_0x5f0c('0x8')][_0x5f0c('0x12')](_0x5f0c('0x13'))>=0x0?!![]:![];})[_0x5f0c('0xa')](function(_0x4ef8a7){logger['error']('[%s][INTERVAL]\x20%s',_0x133e38,_0x341b88[_0x4008ba]);}));}BPromise[_0x5f0c('0x14')](_0x34ba0c)[_0x5f0c('0x6')](function(_0x5e6580){var _0x51938b=_[_0x5f0c('0x15')](_0x5e6580);logger[_0x5f0c('0xc')]('[%s][INTERVAL]\x20%s\x20%s',_0x133e38,_0x341b88[_0x5f0c('0x16')](_0x5f0c('0x17')),_0x51938b);_0x5c473f['when'](_0x51938b);})['catch'](function(_0x40dae9){console[_0x5f0c('0x18')](_0x40dae9);logger[_0x5f0c('0x7')]('[%s][INTERVAL]\x20%s\x20%s',_0x133e38,_0x341b88[_0x5f0c('0x16')]('\x20|\x20'),_0x40dae9['stack']);_0x5c473f[_0x5f0c('0xe')]();});};}; \ No newline at end of file +var _0x7ce2=['lodash','../../../config/logger','routing','client','http','request','error','message','result','condition','rules','stop','length','push','format','iftime\x20%s','indexOf','true','catch','[%s][INTERVAL]\x20%s','all','then','some','info','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','log','stack','util','jayson/promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7ce2,0x12a));var _0x27ce=function(_0x2028f6,_0x406432){_0x2028f6=_0x2028f6-0x0;var _0x1549f3=_0x7ce2[_0x2028f6];return _0x1549f3;};'use strict';var util=require(_0x27ce('0x0'));var BPromise=require('bluebird');var jayson=require(_0x27ce('0x1'));var _=require(_0x27ce('0x2'));var logger=require(_0x27ce('0x3'))(_0x27ce('0x4'));var client=jayson[_0x27ce('0x5')][_0x27ce('0x6')]({'port':0x232a});function request(_0x290862,_0x2ba6c5){return new BPromise(function(_0x257d9d,_0x41376c){return client[_0x27ce('0x7')](_0x290862,_0x2ba6c5)['then'](function(_0x36a7b2){if(_0x36a7b2['error']){return _0x41376c(_0x36a7b2[_0x27ce('0x8')][_0x27ce('0x9')]);}else{return _0x257d9d(_0x36a7b2[_0x27ce('0xa')]);}})['catch'](function(_0x91403f){return _0x41376c(_0x91403f);});});}exports[_0x27ce('0xb')]=function(_0x35dc2c,_0x240f94,_0x20ab7f){return function(_0x41b96b){if(_0x20ab7f[_0x27ce('0xc')]&&!_0x20ab7f[_0x27ce('0xc')][_0x35dc2c]){logger['info']('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x35dc2c);return _0x41b96b[_0x27ce('0xd')]();}var _0x42c4a4=[];for(var _0xba8b5a=0x0;_0xba8b5a<_0x240f94[_0x27ce('0xe')];_0xba8b5a+=0x1){_0x42c4a4[_0x27ce('0xf')](request('Command',{'command':util[_0x27ce('0x10')](_0x27ce('0x11'),_0x240f94[_0xba8b5a])})['then'](function(_0x55f9f7){return _0x55f9f7&&_0x55f9f7[_0x27ce('0x9')]&&_0x55f9f7[_0x27ce('0x9')][_0x27ce('0x12')](_0x27ce('0x13'))>=0x0?!![]:![];})[_0x27ce('0x14')](function(_0x4880c0){logger[_0x27ce('0x8')](_0x27ce('0x15'),_0x35dc2c,_0x240f94[_0xba8b5a]);}));}BPromise[_0x27ce('0x16')](_0x42c4a4)[_0x27ce('0x17')](function(_0xa8552c){var _0x30a6a2=_[_0x27ce('0x18')](_0xa8552c);logger[_0x27ce('0x19')](_0x27ce('0x1a'),_0x35dc2c,_0x240f94['join'](_0x27ce('0x1b')),_0x30a6a2);_0x41b96b['when'](_0x30a6a2);})['catch'](function(_0x2e8a6b){console[_0x27ce('0x1c')](_0x2e8a6b);logger[_0x27ce('0x8')](_0x27ce('0x1a'),_0x35dc2c,_0x240f94['join']('\x20|\x20'),_0x2e8a6b[_0x27ce('0x1d')]);_0x41b96b[_0x27ce('0xd')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 0902495..f94179b 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 _0x7af2=['agentconnectAt','connect','talktime','answered_elsewhere','answeredelsewheredestinationuniqueid','isNil','diffTime','agentcompleteAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','origtransfererexten','transfereeuniqueid','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','agententerreason','[%s][agents][attendedtransfer]','cause','indexOf','splice','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','[%s][agents][hangup]','util','./utils','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','getVoiceQueueByName','type','agentcomplete','agentacw','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','lastevent','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','info','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','timeout','reason','holdtime','ringtime','push','[%s][agents][agentringnoanswer]','queuecallerabandon','forIn','includes','agentringnoanswerAt','abandoned','[%s][agents][queuecallerabandon]','[%s][agents][agentconnect]'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7af2,0x119));var _0x27af=function(_0x336660,_0x3dfc4c){_0x336660=_0x336660-0x0;var _0x535345=_0x7af2[_0x336660];return _0x535345;};'use strict';var _=require('lodash');var util=require(_0x27af('0x0'));var utils=require(_0x27af('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x908794,_0x316e13){utils['info'](util[_0x27af('0x2')](_0x27af('0x3'),_0x908794[_0x27af('0x4')],_0x908794[_0x27af('0x5')],_0x908794[_0x27af('0x6')],_0x908794[_0x27af('0x7')],_0x908794[_0x27af('0x8')],_0x908794[_0x27af('0x9')],_0x908794[_0x27af('0xa')],_0x908794['lastevent']));if(_0x908794[_0x27af('0x6')]){utils[_0x27af('0xb')](_0x908794[_0x27af('0x6')])['then'](function(_0x369a20){if(_0x369a20){_0x908794[_0x27af('0xc')]=_0x369a20[_0x27af('0xc')];_0x908794['agentacw']=_0x908794[_0x27af('0xd')]?_0x369a20['acw']:![];_0x908794['acwtime']=_0x908794[_0x27af('0xe')]?_0x369a20['acwTimeout']:0x0;}utils['request'](_0x27af('0xf'),_0x908794);});}else{utils['request'](_0x27af('0xf'),_0x908794);}if(_0x316e13){delete transfers[_0x908794['uniqueid']];}else{delete agents[_0x908794[_0x27af('0x10')]];}}exports[_0x27af('0x11')]=function(_0x1fd964){try{utils[_0x27af('0x12')](util[_0x27af('0x2')](_0x27af('0x13'),_0x1fd964[_0x27af('0x4')]),_0x1fd964);agents[_0x1fd964[_0x27af('0x10')]]=_0x1fd964;agents[_0x1fd964[_0x27af('0x10')]][_0x27af('0x14')]=utils[_0x27af('0x15')]();agents[_0x1fd964[_0x27af('0x10')]][_0x27af('0x16')]=_0x27af('0x17');agents[_0x1fd964[_0x27af('0x10')]][_0x27af('0xa')]=null;agents[_0x1fd964[_0x27af('0x10')]][_0x27af('0x18')]=null;utils['info'](util[_0x27af('0x2')](_0x27af('0x19'),_0x1fd964['uniqueid'],agents[_0x1fd964['destuniqueid']][_0x27af('0x7')],_0x1fd964[_0x27af('0x10')]));}catch(_0x351587){utils[_0x27af('0x1a')](util[_0x27af('0x2')]('[%s][agents][agentcalled]',_0x1fd964[_0x27af('0x4')]),_0x351587);}};exports[_0x27af('0x1b')]=function(_0xcb4b90){try{if(!_['isNil'](agents[_0xcb4b90[_0x27af('0x10')]])){utils[_0x27af('0x12')](util[_0x27af('0x2')]('[%s][agents][agentringnoanswer]',_0xcb4b90[_0x27af('0x4')]),_0xcb4b90);utils[_0x27af('0x1c')](util[_0x27af('0x2')](_0x27af('0x1d'),_0xcb4b90[_0x27af('0x4')],agents[_0xcb4b90[_0x27af('0x10')]][_0x27af('0x7')],_0xcb4b90[_0x27af('0x10')]));agents[_0xcb4b90[_0x27af('0x10')]]['agentringnoanswer']=!![];agents[_0xcb4b90['destuniqueid']]['agentringnoanswerAt']=utils[_0x27af('0x15')]();agents[_0xcb4b90['destuniqueid']][_0x27af('0x16')]=_0x27af('0x1e');agents[_0xcb4b90['destuniqueid']][_0x27af('0x1f')]=_0x27af('0x1e');agents[_0xcb4b90[_0x27af('0x10')]][_0x27af('0x20')]=_0xcb4b90[_0x27af('0x21')]?parseInt(_0xcb4b90[_0x27af('0x21')])/0x3e8:0x0;agents[_0xcb4b90[_0x27af('0x10')]]['talktime']=0x0;unanswered[_0x27af('0x22')](_0xcb4b90[_0x27af('0x10')]);}}catch(_0xadd38e){utils[_0x27af('0x1a')](util[_0x27af('0x2')](_0x27af('0x23'),_0xcb4b90[_0x27af('0x4')]),_0xadd38e);}};exports[_0x27af('0x24')]=function(_0x4406e2){try{_[_0x27af('0x25')](agents,function(_0x205e41,_0x4f4955){if(_0x205e41[_0x27af('0x4')]==_0x4406e2[_0x27af('0x4')]&&!_[_0x27af('0x26')](unanswered,_0x205e41[_0x27af('0x10')])){utils[_0x27af('0x12')](util[_0x27af('0x2')]('[%s][agents][queuecallerabandon]',_0x4406e2['uniqueid']),_0x4406e2);utils[_0x27af('0x1c')](util[_0x27af('0x2')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x4406e2[_0x27af('0x4')],_0x205e41[_0x27af('0x7')],_0x205e41[_0x27af('0x10')]));_0x205e41[_0x27af('0x1b')]=!![];_0x205e41[_0x27af('0x27')]=utils[_0x27af('0x15')]();_0x205e41[_0x27af('0x16')]=_0x27af('0x28');_0x205e41[_0x27af('0x1f')]=_0x27af('0x28');_0x205e41[_0x27af('0x20')]=_0x4406e2['holdtime'];_0x205e41['talktime']=0x0;writeDB(_0x205e41);}});}catch(_0x1de1d0){utils[_0x27af('0x1a')](util['format'](_0x27af('0x29'),_0x4406e2[_0x27af('0x4')]),_0x1de1d0);}};exports['agentconnect']=function(_0x83aa0b){try{if(agents[_0x83aa0b[_0x27af('0x10')]]){utils[_0x27af('0x12')](util[_0x27af('0x2')](_0x27af('0x2a'),_0x83aa0b['uniqueid']),_0x83aa0b);utils[_0x27af('0x1c')](util[_0x27af('0x2')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x83aa0b['uniqueid'],agents[_0x83aa0b[_0x27af('0x10')]][_0x27af('0x7')],_0x83aa0b[_0x27af('0x10')]));agents[_0x83aa0b[_0x27af('0x10')]][_0x27af('0x2b')]=utils[_0x27af('0x15')]();agents[_0x83aa0b['destuniqueid']][_0x27af('0xa')]=_0x83aa0b['connectedlinenum'];agents[_0x83aa0b[_0x27af('0x10')]][_0x27af('0x18')]=_0x83aa0b[_0x27af('0x18')];agents[_0x83aa0b[_0x27af('0x10')]][_0x27af('0x20')]=_0x83aa0b['ringtime'];agents[_0x83aa0b[_0x27af('0x10')]][_0x27af('0x16')]=_0x27af('0x2c');_[_0x27af('0x25')](agents,function(_0x10c1be,_0x32b558){if(_0x10c1be[_0x27af('0x10')]!=_0x83aa0b[_0x27af('0x10')]&&_0x10c1be[_0x27af('0x4')]==_0x83aa0b[_0x27af('0x4')]){_0x10c1be[_0x27af('0x2d')]=0x0;_0x10c1be[_0x27af('0x20')]=_0x83aa0b[_0x27af('0x21')];_0x10c1be[_0x27af('0x1b')]=!![];_0x10c1be['agentringnoanswerAt']=utils[_0x27af('0x15')]();_0x10c1be[_0x27af('0x16')]=_0x27af('0x2e');_0x10c1be[_0x27af('0x1f')]='answered_elsewhere';_0x10c1be[_0x27af('0x2f')]=_0x83aa0b['destuniqueid'];_0x10c1be['answeredelsewheremembername']=_0x83aa0b[_0x27af('0x7')];writeDB(_0x10c1be);}});}}catch(_0x3c9c81){utils[_0x27af('0x1a')](util[_0x27af('0x2')](_0x27af('0x2a'),_0x83aa0b[_0x27af('0x4')]),_0x3c9c81);}};exports[_0x27af('0xd')]=function(_0x26eb28){try{if(!_[_0x27af('0x30')](agents[_0x26eb28[_0x27af('0x10')]])){utils[_0x27af('0x12')](util[_0x27af('0x2')]('[%s][agents][agentcomplete]',_0x26eb28[_0x27af('0x4')]),_0x26eb28);utils[_0x27af('0x1c')](util['format']('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x26eb28[_0x27af('0x4')],agents[_0x26eb28[_0x27af('0x10')]][_0x27af('0x7')],_0x26eb28[_0x27af('0x10')]));agents[_0x26eb28[_0x27af('0x10')]]['agentcomplete']=!![];agents[_0x26eb28[_0x27af('0x10')]]['agentcompleteAt']=utils[_0x27af('0x15')]();agents[_0x26eb28[_0x27af('0x10')]][_0x27af('0x2d')]=utils[_0x27af('0x31')](agents[_0x26eb28[_0x27af('0x10')]][_0x27af('0x32')],agents[_0x26eb28[_0x27af('0x10')]]['agentconnectAt']);agents[_0x26eb28['destuniqueid']][_0x27af('0x1f')]=_0x26eb28['reason'];agents[_0x26eb28[_0x27af('0x10')]][_0x27af('0x16')]=_0x27af('0x33');writeDB(agents[_0x26eb28[_0x27af('0x10')]]);}}catch(_0x37f2fa){utils[_0x27af('0x1a')](util[_0x27af('0x2')]('[%s][agents][agentcomplete]',_0x26eb28[_0x27af('0x4')]),_0x37f2fa);}};exports[_0x27af('0x34')]=function(_0x20e180){try{if(!_[_0x27af('0x30')](agents[_0x20e180[_0x27af('0x35')]])){utils['debug'](util[_0x27af('0x2')](_0x27af('0x36'),_0x20e180[_0x27af('0x4')]),_0x20e180);utils['info'](util['format'](_0x27af('0x37'),_0x20e180[_0x27af('0x4')],agents[_0x20e180[_0x27af('0x35')]]['membername'],agents[_0x20e180['transfereruniqueid']][_0x27af('0x4')]));agents[_0x20e180['transfereruniqueid']][_0x27af('0x38')]=!![];agents[_0x20e180[_0x27af('0x35')]][_0x27af('0x39')]=_0x27af('0x3a');agents[_0x20e180[_0x27af('0x35')]][_0x27af('0x3b')]=_0x20e180[_0x27af('0x3c')];agents[_0x20e180[_0x27af('0x35')]][_0x27af('0x3d')]=agents[_0x20e180[_0x27af('0x35')]][_0x27af('0x4')];}}catch(_0x5c02c1){utils[_0x27af('0x1a')](util[_0x27af('0x2')](_0x27af('0x36'),_0x20e180[_0x27af('0x4')]),_0x5c02c1);}};exports[_0x27af('0x3e')]=function(_0x2ad074){try{utils[_0x27af('0x12')](util[_0x27af('0x2')]('[%s][agents][attendedtransfer]',_0x2ad074[_0x27af('0x3f')]),_0x2ad074);if(_0x2ad074['origtransfereruniqueid']==_0x2ad074[_0x27af('0x40')]){if(!_[_0x27af('0x30')](agents[_0x2ad074[_0x27af('0x41')]])){utils['info'](util[_0x27af('0x2')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x2ad074[_0x27af('0x3f')],agents[_0x2ad074[_0x27af('0x41')]][_0x27af('0x7')]));agents[_0x2ad074['secondtransfereruniqueid']][_0x27af('0x38')]=!![];agents[_0x2ad074['secondtransfereruniqueid']][_0x27af('0x39')]='ATTENDED';agents[_0x2ad074[_0x27af('0x41')]][_0x27af('0x3b')]=_0x2ad074[_0x27af('0x42')];agents[_0x2ad074['secondtransfereruniqueid']]['transferuniqueid']=_0x2ad074[_0x27af('0x3f')];}if(_0x2ad074[_0x27af('0x43')]&&agents[_0x2ad074[_0x27af('0x43')]]){agents[_0x2ad074[_0x27af('0x43')]]['agententerreason']=0x1;transfers[_0x2ad074[_0x27af('0x43')]]=_[_0x27af('0x44')](agents[_0x2ad074[_0x27af('0x43')]]);transfers[_0x2ad074[_0x27af('0x43')]][_0x27af('0x9')]=agents[_0x2ad074[_0x27af('0x41')]]['calleridnum'];transfers[_0x2ad074[_0x27af('0x43')]][_0x27af('0x45')]=agents[_0x2ad074[_0x27af('0x41')]][_0x27af('0x45')];transfers[_0x2ad074['transfereeuniqueid']][_0x27af('0x14')]=utils['now']();transfers[_0x2ad074[_0x27af('0x43')]][_0x27af('0x2b')]=utils['now']();transfers[_0x2ad074[_0x27af('0x43')]][_0x27af('0x20')]=0x0;transfers[_0x2ad074['transfereeuniqueid']]['agententerreason']=0x2;}}else if(_0x2ad074[_0x27af('0x41')]==_0x2ad074[_0x27af('0x46')]){if(!_[_0x27af('0x30')](agents[_0x2ad074['origtransfereruniqueid']])){utils[_0x27af('0x1c')](util[_0x27af('0x2')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x2ad074[_0x27af('0x3f')],agents[_0x2ad074[_0x27af('0x3f')]]['membername']));agents[_0x2ad074['origtransfereruniqueid']][_0x27af('0x38')]=!![];agents[_0x2ad074[_0x27af('0x3f')]]['transfertype']='ATTENDED';agents[_0x2ad074[_0x27af('0x3f')]][_0x27af('0x3b')]=_0x2ad074[_0x27af('0x47')];agents[_0x2ad074[_0x27af('0x3f')]][_0x27af('0x3d')]=_0x2ad074[_0x27af('0x41')];}if(_0x2ad074[_0x27af('0x48')]&&agents[_0x2ad074['transfertargetuniqueid']]){agents[_0x2ad074['transfertargetuniqueid']][_0x27af('0x49')]=0x1;transfers[_0x2ad074[_0x27af('0x48')]]=_[_0x27af('0x44')](agents[_0x2ad074[_0x27af('0x48')]]);transfers[_0x2ad074[_0x27af('0x48')]][_0x27af('0x9')]=agents[_0x2ad074[_0x27af('0x3f')]][_0x27af('0x9')];transfers[_0x2ad074[_0x27af('0x48')]][_0x27af('0x45')]=agents[_0x2ad074[_0x27af('0x3f')]][_0x27af('0x45')];transfers[_0x2ad074[_0x27af('0x48')]][_0x27af('0x14')]=utils[_0x27af('0x15')]();transfers[_0x2ad074[_0x27af('0x48')]][_0x27af('0x2b')]=utils['now']();transfers[_0x2ad074[_0x27af('0x48')]][_0x27af('0x20')]=0x0;transfers[_0x2ad074['transfertargetuniqueid']][_0x27af('0x49')]=0x2;}}}catch(_0x4b0a4){utils[_0x27af('0x1a')](util[_0x27af('0x2')](_0x27af('0x4a'),_0x2ad074[_0x27af('0x3f')]),_0x4b0a4);}};exports['hangup']=function(_0x132ed4){try{utils[_0x27af('0x12')](util[_0x27af('0x2')]('[%s][agents][hangup]',_0x132ed4['uniqueid']),_0x132ed4);if(agents[_0x132ed4[_0x27af('0x4')]]&&agents[_0x132ed4['uniqueid']][_0x27af('0x1f')]===_0x27af('0x1e')){if(_0x132ed4[_0x27af('0x4b')]==='21'){agents[_0x132ed4[_0x27af('0x4')]][_0x27af('0x1f')]='rejected';agents[_0x132ed4[_0x27af('0x4')]][_0x27af('0x16')]='rejected';}utils[_0x27af('0x1c')](util[_0x27af('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x132ed4['uniqueid'],agents[_0x132ed4[_0x27af('0x4')]][_0x27af('0x7')],agents[_0x132ed4[_0x27af('0x4')]][_0x27af('0x1f')],agents[_0x132ed4[_0x27af('0x4')]][_0x27af('0x16')]));writeDB(agents[_0x132ed4[_0x27af('0x4')]]);var _0x5db94f=unanswered[_0x27af('0x4c')](_0x132ed4[_0x27af('0x4')]);if(_0x5db94f>-0x1){unanswered[_0x27af('0x4d')](_0x5db94f,0x1);}}if(transfers[_0x132ed4[_0x27af('0x4')]]){transfers[_0x132ed4['uniqueid']]['agentcomplete']=!![];transfers[_0x132ed4[_0x27af('0x4')]][_0x27af('0x32')]=utils[_0x27af('0x15')]();transfers[_0x132ed4[_0x27af('0x4')]]['talktime']=utils['diffTime'](transfers[_0x132ed4['uniqueid']][_0x27af('0x32')],transfers[_0x132ed4[_0x27af('0x4')]][_0x27af('0x2b')]);transfers[_0x132ed4[_0x27af('0x4')]][_0x27af('0x1f')]=_0x27af('0x4e');transfers[_0x132ed4['uniqueid']]['lastevent']=_0x27af('0x33');utils[_0x27af('0x1c')](util[_0x27af('0x2')](_0x27af('0x4f'),_0x132ed4['uniqueid'],transfers[_0x132ed4['uniqueid']][_0x27af('0x7')],transfers[_0x132ed4[_0x27af('0x4')]][_0x27af('0x1f')],transfers[_0x132ed4[_0x27af('0x4')]][_0x27af('0x16')]));writeDB(transfers[_0x132ed4[_0x27af('0x4')]],!![]);}if(agents[_0x132ed4[_0x27af('0x4')]]&&agents[_0x132ed4[_0x27af('0x4')]][_0x27af('0x2b')]){agents[_0x132ed4[_0x27af('0x4')]][_0x27af('0xd')]=!![];agents[_0x132ed4['uniqueid']][_0x27af('0x32')]=utils[_0x27af('0x15')]();agents[_0x132ed4[_0x27af('0x4')]]['talktime']=utils[_0x27af('0x31')](agents[_0x132ed4[_0x27af('0x4')]][_0x27af('0x32')],agents[_0x132ed4['uniqueid']][_0x27af('0x2b')]);agents[_0x132ed4['uniqueid']][_0x27af('0x1f')]=agents[_0x132ed4[_0x27af('0x4')]][_0x27af('0x38')]?_0x27af('0x38'):_0x27af('0x4e');agents[_0x132ed4[_0x27af('0x4')]][_0x27af('0x16')]=_0x27af('0x33');utils['info'](util[_0x27af('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x132ed4[_0x27af('0x4')],agents[_0x132ed4[_0x27af('0x4')]][_0x27af('0x7')],agents[_0x132ed4['uniqueid']]['reason'],agents[_0x132ed4[_0x27af('0x4')]][_0x27af('0x16')]));writeDB(agents[_0x132ed4[_0x27af('0x4')]]);}}catch(_0x48c7eb){utils['error'](util['format'](_0x27af('0x50'),_0x132ed4[_0x27af('0x4')]),_0x48c7eb);}}; \ No newline at end of file +var _0x34b7=['acwtime','agentacw','acwTimeout','request','CreateVoiceAgentReport','uniqueid','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','agentringnoanswerAt','timeout','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','reason','[%s][agents][queuecallerabandon]','agentconnect','agentconnectAt','connect','answered_elsewhere','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diffTime','agentcompleteAt','complete','blindtransfer','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','transfertype','blind','transferexten','extension','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','origtransfererexten','transferuniqueid','transfereeuniqueid','agententerreason','secondtransfererexten','transfertargetuniqueid','clone','calleridname','[%s][agents][hangup]','cause','rejected','indexOf','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','type','agentcomplete','acw'];(function(_0x23f682,_0x5a6780){var _0x517943=function(_0xd92db8){while(--_0xd92db8){_0x23f682['push'](_0x23f682['shift']());}};_0x517943(++_0x5a6780);}(_0x34b7,0x196));var _0x734b=function(_0x3c5aa6,_0x4c4f86){_0x3c5aa6=_0x3c5aa6-0x0;var _0x49e397=_0x34b7[_0x3c5aa6];return _0x49e397;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x734b('0x0'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x1aedd0,_0x6e4318){utils[_0x734b('0x1')](util[_0x734b('0x2')](_0x734b('0x3'),_0x1aedd0['uniqueid'],_0x1aedd0['channel'],_0x1aedd0[_0x734b('0x4')],_0x1aedd0[_0x734b('0x5')],_0x1aedd0[_0x734b('0x6')],_0x1aedd0[_0x734b('0x7')],_0x1aedd0[_0x734b('0x8')],_0x1aedd0[_0x734b('0x9')]));if(_0x1aedd0['queue']){utils[_0x734b('0xa')](_0x1aedd0[_0x734b('0x4')])['then'](function(_0x53f163){if(_0x53f163){_0x1aedd0['type']=_0x53f163[_0x734b('0xb')];_0x1aedd0['agentacw']=_0x1aedd0[_0x734b('0xc')]?_0x53f163[_0x734b('0xd')]:![];_0x1aedd0[_0x734b('0xe')]=_0x1aedd0[_0x734b('0xf')]?_0x53f163[_0x734b('0x10')]:0x0;}utils[_0x734b('0x11')](_0x734b('0x12'),_0x1aedd0);});}else{utils[_0x734b('0x11')](_0x734b('0x12'),_0x1aedd0);}if(_0x6e4318){delete transfers[_0x1aedd0[_0x734b('0x13')]];}else{delete agents[_0x1aedd0[_0x734b('0x14')]];}}exports[_0x734b('0x15')]=function(_0x145ec3){try{utils[_0x734b('0x16')](util['format'](_0x734b('0x17'),_0x145ec3[_0x734b('0x13')]),_0x145ec3);agents[_0x145ec3[_0x734b('0x14')]]=_0x145ec3;agents[_0x145ec3[_0x734b('0x14')]][_0x734b('0x18')]=utils[_0x734b('0x19')]();agents[_0x145ec3[_0x734b('0x14')]][_0x734b('0x9')]=_0x734b('0x1a');agents[_0x145ec3[_0x734b('0x14')]][_0x734b('0x8')]=null;agents[_0x145ec3['destuniqueid']][_0x734b('0x1b')]=null;utils[_0x734b('0x1')](util[_0x734b('0x2')](_0x734b('0x1c'),_0x145ec3['uniqueid'],agents[_0x145ec3['destuniqueid']][_0x734b('0x5')],_0x145ec3[_0x734b('0x14')]));}catch(_0x1e6ed9){utils[_0x734b('0x1d')](util[_0x734b('0x2')](_0x734b('0x17'),_0x145ec3[_0x734b('0x13')]),_0x1e6ed9);}};exports[_0x734b('0x1e')]=function(_0x67eed){try{if(!_[_0x734b('0x1f')](agents[_0x67eed[_0x734b('0x14')]])){utils[_0x734b('0x16')](util[_0x734b('0x2')](_0x734b('0x20'),_0x67eed['uniqueid']),_0x67eed);utils[_0x734b('0x1')](util[_0x734b('0x2')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x67eed[_0x734b('0x13')],agents[_0x67eed[_0x734b('0x14')]][_0x734b('0x5')],_0x67eed[_0x734b('0x14')]));agents[_0x67eed[_0x734b('0x14')]][_0x734b('0x1e')]=!![];agents[_0x67eed[_0x734b('0x14')]][_0x734b('0x21')]=utils[_0x734b('0x19')]();agents[_0x67eed[_0x734b('0x14')]][_0x734b('0x9')]=_0x734b('0x22');agents[_0x67eed[_0x734b('0x14')]]['reason']='timeout';agents[_0x67eed[_0x734b('0x14')]][_0x734b('0x23')]=_0x67eed['ringtime']?parseInt(_0x67eed[_0x734b('0x24')])/0x3e8:0x0;agents[_0x67eed[_0x734b('0x14')]][_0x734b('0x25')]=0x0;unanswered[_0x734b('0x26')](_0x67eed[_0x734b('0x14')]);}}catch(_0x1b8295){utils[_0x734b('0x1d')](util['format'](_0x734b('0x20'),_0x67eed[_0x734b('0x13')]),_0x1b8295);}};exports[_0x734b('0x27')]=function(_0x241c89){try{_[_0x734b('0x28')](agents,function(_0x427c36,_0x1fed72){if(_0x427c36[_0x734b('0x13')]==_0x241c89[_0x734b('0x13')]&&!_[_0x734b('0x29')](unanswered,_0x427c36['destuniqueid'])){utils[_0x734b('0x16')](util[_0x734b('0x2')]('[%s][agents][queuecallerabandon]',_0x241c89[_0x734b('0x13')]),_0x241c89);utils[_0x734b('0x1')](util[_0x734b('0x2')](_0x734b('0x2a'),_0x241c89[_0x734b('0x13')],_0x427c36[_0x734b('0x5')],_0x427c36[_0x734b('0x14')]));_0x427c36[_0x734b('0x1e')]=!![];_0x427c36[_0x734b('0x21')]=utils[_0x734b('0x19')]();_0x427c36[_0x734b('0x9')]=_0x734b('0x2b');_0x427c36[_0x734b('0x2c')]=_0x734b('0x2b');_0x427c36[_0x734b('0x23')]=_0x241c89['holdtime'];_0x427c36[_0x734b('0x25')]=0x0;writeDB(_0x427c36);}});}catch(_0x5e2444){utils[_0x734b('0x1d')](util[_0x734b('0x2')](_0x734b('0x2d'),_0x241c89[_0x734b('0x13')]),_0x5e2444);}};exports[_0x734b('0x2e')]=function(_0x16ab66){try{if(agents[_0x16ab66['destuniqueid']]){utils['debug'](util[_0x734b('0x2')]('[%s][agents][agentconnect]',_0x16ab66[_0x734b('0x13')]),_0x16ab66);utils['info'](util[_0x734b('0x2')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x16ab66[_0x734b('0x13')],agents[_0x16ab66['destuniqueid']][_0x734b('0x5')],_0x16ab66[_0x734b('0x14')]));agents[_0x16ab66[_0x734b('0x14')]][_0x734b('0x2f')]=utils[_0x734b('0x19')]();agents[_0x16ab66[_0x734b('0x14')]][_0x734b('0x8')]=_0x16ab66['connectedlinenum'];agents[_0x16ab66[_0x734b('0x14')]][_0x734b('0x1b')]=_0x16ab66['connectedlinename'];agents[_0x16ab66[_0x734b('0x14')]][_0x734b('0x23')]=_0x16ab66[_0x734b('0x24')];agents[_0x16ab66[_0x734b('0x14')]]['lastevent']=_0x734b('0x30');_[_0x734b('0x28')](agents,function(_0x4efb1f,_0x40674c){if(_0x4efb1f[_0x734b('0x14')]!=_0x16ab66['destuniqueid']&&_0x4efb1f[_0x734b('0x13')]==_0x16ab66[_0x734b('0x13')]){_0x4efb1f[_0x734b('0x25')]=0x0;_0x4efb1f[_0x734b('0x23')]=_0x16ab66['ringtime'];_0x4efb1f['agentringnoanswer']=!![];_0x4efb1f[_0x734b('0x21')]=utils['now']();_0x4efb1f['lastevent']=_0x734b('0x31');_0x4efb1f['reason']=_0x734b('0x31');_0x4efb1f['answeredelsewheredestinationuniqueid']=_0x16ab66[_0x734b('0x14')];_0x4efb1f[_0x734b('0x32')]=_0x16ab66[_0x734b('0x5')];writeDB(_0x4efb1f);}});}}catch(_0x4c3fdc){utils['error'](util[_0x734b('0x2')]('[%s][agents][agentconnect]',_0x16ab66['uniqueid']),_0x4c3fdc);}};exports[_0x734b('0xc')]=function(_0x159db9){try{if(!_['isNil'](agents[_0x159db9[_0x734b('0x14')]])){utils['debug'](util[_0x734b('0x2')](_0x734b('0x33'),_0x159db9[_0x734b('0x13')]),_0x159db9);utils['info'](util[_0x734b('0x2')](_0x734b('0x34'),_0x159db9[_0x734b('0x13')],agents[_0x159db9[_0x734b('0x14')]]['membername'],_0x159db9['destuniqueid']));agents[_0x159db9['destuniqueid']][_0x734b('0xc')]=!![];agents[_0x159db9['destuniqueid']]['agentcompleteAt']=utils[_0x734b('0x19')]();agents[_0x159db9['destuniqueid']][_0x734b('0x25')]=utils[_0x734b('0x35')](agents[_0x159db9[_0x734b('0x14')]][_0x734b('0x36')],agents[_0x159db9['destuniqueid']][_0x734b('0x2f')]);agents[_0x159db9['destuniqueid']][_0x734b('0x2c')]=_0x159db9[_0x734b('0x2c')];agents[_0x159db9[_0x734b('0x14')]]['lastevent']=_0x734b('0x37');writeDB(agents[_0x159db9['destuniqueid']]);}}catch(_0x357ae4){utils[_0x734b('0x1d')](util['format'](_0x734b('0x33'),_0x159db9[_0x734b('0x13')]),_0x357ae4);}};exports[_0x734b('0x38')]=function(_0x38125a){try{if(!_[_0x734b('0x1f')](agents[_0x38125a['transfereruniqueid']])){utils[_0x734b('0x16')](util['format'](_0x734b('0x39'),_0x38125a['uniqueid']),_0x38125a);utils[_0x734b('0x1')](util[_0x734b('0x2')](_0x734b('0x3a'),_0x38125a[_0x734b('0x13')],agents[_0x38125a[_0x734b('0x3b')]]['membername'],agents[_0x38125a['transfereruniqueid']]['uniqueid']));agents[_0x38125a[_0x734b('0x3b')]][_0x734b('0x3c')]=!![];agents[_0x38125a['transfereruniqueid']][_0x734b('0x3d')]=_0x734b('0x3e');agents[_0x38125a['transfereruniqueid']][_0x734b('0x3f')]=_0x38125a[_0x734b('0x40')];agents[_0x38125a[_0x734b('0x3b')]]['transferuniqueid']=agents[_0x38125a[_0x734b('0x3b')]][_0x734b('0x13')];}}catch(_0x423b22){utils[_0x734b('0x1d')](util['format'](_0x734b('0x39'),_0x38125a[_0x734b('0x13')]),_0x423b22);}};exports[_0x734b('0x41')]=function(_0x432a96){try{utils['debug'](util[_0x734b('0x2')]('[%s][agents][attendedtransfer]',_0x432a96[_0x734b('0x42')]),_0x432a96);if(_0x432a96[_0x734b('0x42')]==_0x432a96[_0x734b('0x43')]){if(!_[_0x734b('0x1f')](agents[_0x432a96['secondtransfereruniqueid']])){utils[_0x734b('0x1')](util[_0x734b('0x2')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x432a96['origtransfereruniqueid'],agents[_0x432a96[_0x734b('0x44')]]['membername']));agents[_0x432a96[_0x734b('0x44')]][_0x734b('0x3c')]=!![];agents[_0x432a96[_0x734b('0x44')]]['transfertype']=_0x734b('0x45');agents[_0x432a96['secondtransfereruniqueid']][_0x734b('0x3f')]=_0x432a96[_0x734b('0x46')];agents[_0x432a96[_0x734b('0x44')]][_0x734b('0x47')]=_0x432a96['origtransfereruniqueid'];}if(_0x432a96[_0x734b('0x48')]&&agents[_0x432a96['transfereeuniqueid']]){agents[_0x432a96[_0x734b('0x48')]][_0x734b('0x49')]=0x1;transfers[_0x432a96[_0x734b('0x48')]]=_['clone'](agents[_0x432a96[_0x734b('0x48')]]);transfers[_0x432a96['transfereeuniqueid']][_0x734b('0x7')]=agents[_0x432a96[_0x734b('0x44')]][_0x734b('0x7')];transfers[_0x432a96[_0x734b('0x48')]]['calleridname']=agents[_0x432a96[_0x734b('0x44')]]['calleridname'];transfers[_0x432a96[_0x734b('0x48')]][_0x734b('0x18')]=utils[_0x734b('0x19')]();transfers[_0x432a96['transfereeuniqueid']][_0x734b('0x2f')]=utils[_0x734b('0x19')]();transfers[_0x432a96[_0x734b('0x48')]][_0x734b('0x23')]=0x0;transfers[_0x432a96[_0x734b('0x48')]][_0x734b('0x49')]=0x2;}}else if(_0x432a96[_0x734b('0x44')]==_0x432a96['secondtransfererlinkedid']){if(!_[_0x734b('0x1f')](agents[_0x432a96[_0x734b('0x42')]])){utils[_0x734b('0x1')](util['format']('[%s][agents][attendedtransfer]\x20agent:%s',_0x432a96[_0x734b('0x42')],agents[_0x432a96[_0x734b('0x42')]][_0x734b('0x5')]));agents[_0x432a96[_0x734b('0x42')]]['transfer']=!![];agents[_0x432a96['origtransfereruniqueid']]['transfertype']=_0x734b('0x45');agents[_0x432a96[_0x734b('0x42')]][_0x734b('0x3f')]=_0x432a96[_0x734b('0x4a')];agents[_0x432a96[_0x734b('0x42')]][_0x734b('0x47')]=_0x432a96[_0x734b('0x44')];}if(_0x432a96[_0x734b('0x4b')]&&agents[_0x432a96[_0x734b('0x4b')]]){agents[_0x432a96[_0x734b('0x4b')]][_0x734b('0x49')]=0x1;transfers[_0x432a96[_0x734b('0x4b')]]=_[_0x734b('0x4c')](agents[_0x432a96[_0x734b('0x4b')]]);transfers[_0x432a96[_0x734b('0x4b')]][_0x734b('0x7')]=agents[_0x432a96[_0x734b('0x42')]][_0x734b('0x7')];transfers[_0x432a96[_0x734b('0x4b')]][_0x734b('0x4d')]=agents[_0x432a96[_0x734b('0x42')]]['calleridname'];transfers[_0x432a96[_0x734b('0x4b')]][_0x734b('0x18')]=utils[_0x734b('0x19')]();transfers[_0x432a96[_0x734b('0x4b')]][_0x734b('0x2f')]=utils['now']();transfers[_0x432a96[_0x734b('0x4b')]][_0x734b('0x23')]=0x0;transfers[_0x432a96[_0x734b('0x4b')]][_0x734b('0x49')]=0x2;}}}catch(_0x3c7d93){utils[_0x734b('0x1d')](util['format']('[%s][agents][attendedtransfer]',_0x432a96['origtransfereruniqueid']),_0x3c7d93);}};exports['hangup']=function(_0x4d95c7){try{utils[_0x734b('0x16')](util[_0x734b('0x2')](_0x734b('0x4e'),_0x4d95c7[_0x734b('0x13')]),_0x4d95c7);if(agents[_0x4d95c7['uniqueid']]&&agents[_0x4d95c7['uniqueid']][_0x734b('0x2c')]===_0x734b('0x22')){if(_0x4d95c7[_0x734b('0x4f')]==='21'){agents[_0x4d95c7[_0x734b('0x13')]]['reason']=_0x734b('0x50');agents[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x9')]=_0x734b('0x50');}utils['info'](util[_0x734b('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x4d95c7[_0x734b('0x13')],agents[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x5')],agents[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x2c')],agents[_0x4d95c7['uniqueid']][_0x734b('0x9')]));writeDB(agents[_0x4d95c7[_0x734b('0x13')]]);var _0x3c40b5=unanswered[_0x734b('0x51')](_0x4d95c7[_0x734b('0x13')]);if(_0x3c40b5>-0x1){unanswered['splice'](_0x3c40b5,0x1);}}if(transfers[_0x4d95c7[_0x734b('0x13')]]){transfers[_0x4d95c7[_0x734b('0x13')]][_0x734b('0xc')]=!![];transfers[_0x4d95c7[_0x734b('0x13')]]['agentcompleteAt']=utils[_0x734b('0x19')]();transfers[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x25')]=utils[_0x734b('0x35')](transfers[_0x4d95c7[_0x734b('0x13')]]['agentcompleteAt'],transfers[_0x4d95c7[_0x734b('0x13')]]['agentconnectAt']);transfers[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x2c')]=_0x734b('0x52');transfers[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x9')]=_0x734b('0x37');utils['info'](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x4d95c7[_0x734b('0x13')],transfers[_0x4d95c7['uniqueid']][_0x734b('0x5')],transfers[_0x4d95c7[_0x734b('0x13')]]['reason'],transfers[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x9')]));writeDB(transfers[_0x4d95c7[_0x734b('0x13')]],!![]);}if(agents[_0x4d95c7[_0x734b('0x13')]]&&agents[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x2f')]){agents[_0x4d95c7[_0x734b('0x13')]][_0x734b('0xc')]=!![];agents[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x36')]=utils['now']();agents[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x25')]=utils[_0x734b('0x35')](agents[_0x4d95c7['uniqueid']][_0x734b('0x36')],agents[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x2f')]);agents[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x2c')]=agents[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x3c')]?_0x734b('0x3c'):'agent';agents[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x9')]=_0x734b('0x37');utils[_0x734b('0x1')](util[_0x734b('0x2')](_0x734b('0x53'),_0x4d95c7[_0x734b('0x13')],agents[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x5')],agents[_0x4d95c7['uniqueid']][_0x734b('0x2c')],agents[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x9')]));writeDB(agents[_0x4d95c7['uniqueid']]);}}catch(_0x31e1ec){utils[_0x734b('0x1d')](util[_0x734b('0x2')](_0x734b('0x4e'),_0x4d95c7[_0x734b('0x13')]),_0x31e1ec);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index c945ebc..2974a0a 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 _0x3c2e=['membername','connectedlinenum','lastevent','accountcode','UserId','request','CreateVoiceCallReport','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','calleridnum','now','DOCUMENTATION','[%s][calls][newstate]','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','isNil','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','ANSWERED','error','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','endtime','diffTime','starttime','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','secondtransfererchannel','userfield','_attended','transfertargetchannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstartAt','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstop]','[%s][calls][musiconholdstop]\x20mohtime:%s','mohtime','varset','[%s][calls][varset]','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','source','value','variable','xmd-phone','destination','xmd-callerid','xmd-callerid-preview','xmd-queue','xmcs-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','lastapplication','Queue','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','newexten','[%s][calls][newexten]','application','appdata','toLowerCase','startsWith','split','substring','includes','hangup','noop','execif','set','NO\x20ANSWER','FAILED','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue'];(function(_0x221657,_0x3cccd8){var _0x123902=function(_0x58a2ac){while(--_0x58a2ac){_0x221657['push'](_0x221657['shift']());}};_0x123902(++_0x3cccd8);}(_0x3c2e,0x186));var _0xe3c2=function(_0x2bbba2,_0x45831a){_0x2bbba2=_0x2bbba2-0x0;var _0x7521b1=_0x3c2e[_0x2bbba2];return _0x7521b1;};'use strict';var _=require('lodash');var util=require('util');var utils=require('./utils');var transfers=require('./transfers.controller');var dispositions=[_0xe3c2('0x0'),'FAILED','FAILED',_0xe3c2('0x0'),_0xe3c2('0x0'),_0xe3c2('0x0'),'ANSWERED','BUSY','FAILED','FAILED',_0xe3c2('0x1')];var channels={};function writeDB(_0x4323ef){var _0x424e8c;if(transfers['blinds'][_0x4323ef['uniqueid']]){_0x424e8c=_0x4323ef['uniqueid'];_0x4323ef['uniqueid']=transfers[_0xe3c2('0x2')][_0x4323ef[_0xe3c2('0x3')]][_0xe3c2('0x4')];}utils[_0xe3c2('0x5')](util[_0xe3c2('0x6')](_0xe3c2('0x7'),_0x4323ef[_0xe3c2('0x3')],_0x4323ef[_0xe3c2('0x8')],_0x4323ef[_0xe3c2('0x9')],_0x4323ef[_0xe3c2('0xa')],_0x4323ef['interface'],_0x4323ef['calleridnum'],_0x4323ef[_0xe3c2('0xb')],_0x4323ef[_0xe3c2('0xc')]));if(_0x4323ef[_0xe3c2('0xd')]){utils['getUserByInternal'](_0x4323ef[_0xe3c2('0xd')])['then'](function(_0x1a00ed){if(_0x1a00ed){_0x4323ef[_0xe3c2('0xe')]=_0x1a00ed['id'];}utils[_0xe3c2('0xf')](_0xe3c2('0x10'),_0x4323ef);});}else{utils['request']('CreateVoiceCallReport',_0x4323ef);}if(channels[_0x4323ef['uniqueid']]){delete channels[_0x4323ef[_0xe3c2('0x3')]];}else if(_0x424e8c&&channels[_0x424e8c]){delete transfers[_0xe3c2('0x2')][_0x424e8c];delete channels[_0x424e8c];}}exports['newchannel']=function(_0x3116a4){try{utils[_0xe3c2('0x11')](util[_0xe3c2('0x6')](_0xe3c2('0x12'),_0x3116a4[_0xe3c2('0x3')]),_0x3116a4);if(_0x3116a4[_0xe3c2('0x3')]==_0x3116a4[_0xe3c2('0x13')]&&_0x3116a4['channel']!=_0xe3c2('0x14')){utils[_0xe3c2('0x5')](util[_0xe3c2('0x6')](_0xe3c2('0x15'),_0x3116a4['uniqueid'],_0x3116a4[_0xe3c2('0x16')],_0x3116a4[_0xe3c2('0x17')]));channels[_0x3116a4['uniqueid']]={'uniqueid':_0x3116a4[_0xe3c2('0x3')],'accountcode':_0x3116a4[_0xe3c2('0xd')],'source':_0x3116a4[_0xe3c2('0x18')],'destination':_0x3116a4[_0xe3c2('0x17')],'destinationcontext':_0x3116a4[_0xe3c2('0x16')],'channel':_0x3116a4[_0xe3c2('0x8')],'starttime':utils[_0xe3c2('0x19')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xe3c2('0x0'),'amaflags':_0xe3c2('0x1a')};}}catch(_0x37727d){utils['error'](util[_0xe3c2('0x6')](_0xe3c2('0x12'),_0x3116a4[_0xe3c2('0x3')]),_0x37727d);}};exports['newstate']=function(_0x19d169){try{utils[_0xe3c2('0x11')](util['format'](_0xe3c2('0x1b'),_0x19d169[_0xe3c2('0x3')]),_0x19d169);if(!_['isNil'](channels[_0x19d169['uniqueid']])&&_0x19d169[_0xe3c2('0x1c')]==0x6){utils[_0xe3c2('0x5')](util[_0xe3c2('0x6')](_0xe3c2('0x1d'),_0x19d169['uniqueid'],_0x19d169[_0xe3c2('0x16')],_0x19d169['channel']));if(_[_0xe3c2('0x1e')](channels[_0x19d169[_0xe3c2('0x3')]]['systemanswertime'])){channels[_0x19d169[_0xe3c2('0x3')]]['systemanswertime']=utils[_0xe3c2('0x19')]();}}else if(!_['isNil'](channels[_0x19d169[_0xe3c2('0x13')]])&&_0x19d169[_0xe3c2('0x1c')]==0x6&&_0x19d169[_0xe3c2('0x16')]!='transfer'){utils[_0xe3c2('0x5')](util[_0xe3c2('0x6')](_0xe3c2('0x1f'),_0x19d169[_0xe3c2('0x3')],_0x19d169[_0xe3c2('0x13')],_0x19d169['context'],_0x19d169['channel']));channels[_0x19d169['linkedid']][_0xe3c2('0xd')]=_0x19d169[_0xe3c2('0xd')];channels[_0x19d169[_0xe3c2('0x13')]][_0xe3c2('0x20')]=_0x19d169[_0xe3c2('0x8')];if(_[_0xe3c2('0x1e')](channels[_0x19d169[_0xe3c2('0x13')]]['answertime'])){channels[_0x19d169[_0xe3c2('0x13')]][_0xe3c2('0x21')]=utils[_0xe3c2('0x19')]();}channels[_0x19d169[_0xe3c2('0x13')]][_0xe3c2('0x22')]=dispositions[_[_0xe3c2('0x23')](_0x19d169[_0xe3c2('0x1c')])]||_0xe3c2('0x24');}}catch(_0x2d188d){utils[_0xe3c2('0x25')](util[_0xe3c2('0x6')](_0xe3c2('0x1b'),_0x19d169[_0xe3c2('0x3')]),_0x2d188d);}};exports['hangup']=function(_0x3f5354){try{if(!_[_0xe3c2('0x1e')](channels[_0x3f5354[_0xe3c2('0x3')]])){utils[_0xe3c2('0x11')](util[_0xe3c2('0x6')](_0xe3c2('0x26'),_0x3f5354[_0xe3c2('0x3')]),_0x3f5354);if(_['isNil'](channels[_0x3f5354[_0xe3c2('0x3')]][_0xe3c2('0x27')])){channels[_0x3f5354[_0xe3c2('0x3')]]['callerid']=_0x3f5354[_0xe3c2('0x28')]+'\x20<'+_0x3f5354[_0xe3c2('0x18')]+'>';}utils[_0xe3c2('0x5')](util[_0xe3c2('0x6')](_0xe3c2('0x29'),_0x3f5354[_0xe3c2('0x3')],channels[_0x3f5354[_0xe3c2('0x3')]][_0xe3c2('0x27')],_0x3f5354['cause-txt']));channels[_0x3f5354['uniqueid']][_0xe3c2('0x2a')]=utils[_0xe3c2('0x19')]();channels[_0x3f5354[_0xe3c2('0x3')]]['duration']=utils[_0xe3c2('0x2b')](channels[_0x3f5354[_0xe3c2('0x3')]][_0xe3c2('0x2a')],channels[_0x3f5354['uniqueid']][_0xe3c2('0x2c')]);channels[_0x3f5354['uniqueid']]['billableseconds']=channels[_0x3f5354['uniqueid']][_0xe3c2('0x21')]?utils['diffTime'](channels[_0x3f5354[_0xe3c2('0x3')]]['endtime'],channels[_0x3f5354[_0xe3c2('0x3')]][_0xe3c2('0x21')]):0x0;writeDB(channels[_0x3f5354[_0xe3c2('0x3')]]);}}catch(_0x54ada8){utils['error'](util[_0xe3c2('0x6')]('[%s][calls][hangup]',_0x3f5354[_0xe3c2('0x3')]),_0x54ada8);}};exports[_0xe3c2('0x2d')]=function(_0x259317){try{if(!_[_0xe3c2('0x1e')](channels[_0x259317[_0xe3c2('0x2e')]])){utils[_0xe3c2('0x11')](util[_0xe3c2('0x6')](_0xe3c2('0x2f'),_0x259317[_0xe3c2('0x30')]),_0x259317);if(channels[_0x259317['localtwolinkedid']][_0xe3c2('0x8')]==_0x259317['transfereechannel']){utils[_0xe3c2('0x5')](util['format']('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x259317[_0xe3c2('0x30')],_0x259317['localtwolinkedid'],_0x259317[_0xe3c2('0x31')]));channels[_0x259317[_0xe3c2('0x2e')]]['destinationchannel']=_0x259317['secondtransfererchannel'];channels[_0x259317[_0xe3c2('0x2e')]][_0xe3c2('0x32')]=_0xe3c2('0x33');}else if(channels[_0x259317[_0xe3c2('0x2e')]][_0xe3c2('0x8')]=_0x259317[_0xe3c2('0x34')]){utils['info'](util[_0xe3c2('0x6')](_0xe3c2('0x35'),_0x259317[_0xe3c2('0x30')],_0x259317['localtwolinkedid'],_0x259317['origtransfererchannel']));channels[_0x259317[_0xe3c2('0x2e')]]['destinationchannel']=_0x259317[_0xe3c2('0x36')];channels[_0x259317[_0xe3c2('0x2e')]]['userfield']=_0xe3c2('0x33');}}}catch(_0x163210){utils[_0xe3c2('0x25')](util[_0xe3c2('0x6')]('[%s][calls][attendedtransfer]',_0x259317[_0xe3c2('0x30')]),_0x163210);}};exports[_0xe3c2('0x37')]=function(_0x56393d){try{if(!_[_0xe3c2('0x1e')](channels[_0x56393d['uniqueid']])){utils[_0xe3c2('0x11')](util[_0xe3c2('0x6')]('[%s][calls][musiconholdstart]',_0x56393d[_0xe3c2('0x3')]),_0x56393d);channels[_0x56393d[_0xe3c2('0x3')]]['musiconholdstartAt']=utils[_0xe3c2('0x19')]();utils['info'](util[_0xe3c2('0x6')](_0xe3c2('0x38'),_0x56393d[_0xe3c2('0x3')],channels[_0x56393d[_0xe3c2('0x3')]][_0xe3c2('0x39')]));}}catch(_0x3c33e6){utils['error'](util[_0xe3c2('0x6')](_0xe3c2('0x3a'),_0x56393d[_0xe3c2('0x3')]),_0x3c33e6);}};exports['musiconholdstop']=function(_0x48cf22){try{if(!_[_0xe3c2('0x1e')](channels[_0x48cf22['uniqueid']])){utils[_0xe3c2('0x11')](util['format'](_0xe3c2('0x3b'),_0x48cf22[_0xe3c2('0x3')]),_0x48cf22);if(!_['isNil'](channels[_0x48cf22['uniqueid']]['musiconholdstartAt'])){channels[_0x48cf22['uniqueid']]['mohtime']+=utils[_0xe3c2('0x2b')](utils[_0xe3c2('0x19')](),channels[_0x48cf22[_0xe3c2('0x3')]][_0xe3c2('0x39')]);utils[_0xe3c2('0x5')](util['format'](_0xe3c2('0x3c'),_0x48cf22[_0xe3c2('0x3')],channels[_0x48cf22[_0xe3c2('0x3')]][_0xe3c2('0x3d')]));delete channels[_0x48cf22[_0xe3c2('0x3')]][_0xe3c2('0x39')];}}}catch(_0x15ab4a){utils['error'](util[_0xe3c2('0x6')](_0xe3c2('0x3b'),_0x48cf22[_0xe3c2('0x3')]),_0x15ab4a);}};exports[_0xe3c2('0x3e')]=function(_0x25e024){try{if(!_[_0xe3c2('0x1e')](channels[_0x25e024['uniqueid']])){utils[_0xe3c2('0x11')](util[_0xe3c2('0x6')](_0xe3c2('0x3f'),_0x25e024[_0xe3c2('0x3')]),_0x25e024);if(!_[_0xe3c2('0x1e')](_0x25e024['variable'][_0xe3c2('0x40')])){utils['info'](util['format'](_0xe3c2('0x41'),_0x25e024[_0xe3c2('0x3')],_0x25e024['value']));channels[_0x25e024['uniqueid']][_0xe3c2('0x42')]=_0x25e024[_0xe3c2('0x43')];}if(!_[_0xe3c2('0x1e')](_0x25e024[_0xe3c2('0x44')][_0xe3c2('0x45')])){utils[_0xe3c2('0x5')](util[_0xe3c2('0x6')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x25e024['uniqueid'],_0x25e024[_0xe3c2('0x43')]));channels[_0x25e024[_0xe3c2('0x3')]][_0xe3c2('0x46')]=_0x25e024[_0xe3c2('0x43')];channels[_0x25e024['uniqueid']][_0xe3c2('0x27')]='\x22'+_0x25e024['value']+'\x22\x20<'+_0x25e024['value']+'>';}if(!_[_0xe3c2('0x1e')](_0x25e024[_0xe3c2('0x44')]['xmd-callerid-preview'])||!_[_0xe3c2('0x1e')](_0x25e024[_0xe3c2('0x44')][_0xe3c2('0x47')])){utils['info'](util[_0xe3c2('0x6')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x25e024[_0xe3c2('0x3')],!_['isNil'](_0x25e024[_0xe3c2('0x44')][_0xe3c2('0x48')])?'xmd-callerid-preview':'xmd-callerid',_0x25e024[_0xe3c2('0x43')]));channels[_0x25e024[_0xe3c2('0x3')]][_0xe3c2('0x27')]=_0x25e024[_0xe3c2('0x43')];}if(!_[_0xe3c2('0x1e')](_0x25e024['variable'][_0xe3c2('0x49')])||!_[_0xe3c2('0x1e')](_0x25e024[_0xe3c2('0x44')][_0xe3c2('0x4a')])){utils[_0xe3c2('0x5')](util[_0xe3c2('0x6')](_0xe3c2('0x4b'),_0x25e024[_0xe3c2('0x3')],!_[_0xe3c2('0x1e')](_0x25e024[_0xe3c2('0x44')][_0xe3c2('0x49')])?_0xe3c2('0x49'):_0xe3c2('0x4a'),_0x25e024[_0xe3c2('0x43')]));channels[_0x25e024[_0xe3c2('0x3')]][_0xe3c2('0x4c')]=_0xe3c2('0x4d');channels[_0x25e024[_0xe3c2('0x3')]][_0xe3c2('0x4e')]=_0x25e024['value'];channels[_0x25e024[_0xe3c2('0x3')]][_0xe3c2('0x9')]=!![];}if(!_[_0xe3c2('0x1e')](_0x25e024[_0xe3c2('0x44')]['xmd-contactid'])){utils[_0xe3c2('0x5')](util[_0xe3c2('0x6')](_0xe3c2('0x4f'),_0x25e024[_0xe3c2('0x3')],_0x25e024[_0xe3c2('0x43')]));channels[_0x25e024['uniqueid']][_0xe3c2('0x50')]=_0x25e024[_0xe3c2('0x43')];}if(!_[_0xe3c2('0x1e')](_0x25e024[_0xe3c2('0x44')]['xmd-cdrtype'])){utils[_0xe3c2('0x5')](util[_0xe3c2('0x6')](_0xe3c2('0x51'),_0x25e024['uniqueid'],_0x25e024[_0xe3c2('0x43')]));channels[_0x25e024[_0xe3c2('0x3')]][_0xe3c2('0x52')]=_0x25e024[_0xe3c2('0x43')];}if(!_[_0xe3c2('0x1e')](_0x25e024[_0xe3c2('0x44')]['outboundrouteid'])){utils[_0xe3c2('0x5')](util[_0xe3c2('0x6')](_0xe3c2('0x53'),_0x25e024[_0xe3c2('0x3')],_0x25e024[_0xe3c2('0x43')]));channels[_0x25e024[_0xe3c2('0x3')]][_0xe3c2('0x54')]=_0x25e024[_0xe3c2('0x43')];}if(!_[_0xe3c2('0x1e')](_0x25e024['variable']['sipcallid'])){utils['info'](util[_0xe3c2('0x6')](_0xe3c2('0x55'),_0x25e024[_0xe3c2('0x3')],_0x25e024[_0xe3c2('0x43')]));channels[_0x25e024[_0xe3c2('0x3')]][_0xe3c2('0x56')]=_0x25e024[_0xe3c2('0x43')];}}}catch(_0x4dc4f7){utils[_0xe3c2('0x25')](util['format'](_0xe3c2('0x3f'),_0x25e024[_0xe3c2('0x3')]),_0x4dc4f7);}};exports[_0xe3c2('0x57')]=function(_0x15c362){try{if(!_[_0xe3c2('0x1e')](channels[_0x15c362[_0xe3c2('0x3')]])){utils[_0xe3c2('0x11')](util['format'](_0xe3c2('0x58'),_0x15c362[_0xe3c2('0x3')]),_0x15c362);utils[_0xe3c2('0x5')](util[_0xe3c2('0x6')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x15c362[_0xe3c2('0x3')],_0x15c362[_0xe3c2('0x59')],_0x15c362[_0xe3c2('0x5a')]));if(_0x15c362[_0xe3c2('0x59')][_0xe3c2('0x5b')]()=='set'&&_[_0xe3c2('0x5c')](_0x15c362[_0xe3c2('0x5a')][_0xe3c2('0x5b')](),'cdr')){var _0x2538a6=_0x15c362['appdata'][_0xe3c2('0x5d')]('=');var _0x4c2f8a=_0x2538a6[0x0][_0xe3c2('0x5e')](_0x2538a6[0x0]['lastIndexOf']('(')+0x1,_0x2538a6[0x0]['lastIndexOf'](')'));var _0x46711a=_0x2538a6[0x1];channels[_0x15c362[_0xe3c2('0x3')]][_0x4c2f8a]=_0x46711a;}if(!_[_0xe3c2('0x5f')]([_0xe3c2('0x60'),_0xe3c2('0x61'),_0xe3c2('0x62'),_0xe3c2('0x63'),'gotoif'],_0x15c362[_0xe3c2('0x59')]['toLowerCase']())){channels[_0x15c362[_0xe3c2('0x3')]][_0xe3c2('0x4c')]=_0x15c362['application'];channels[_0x15c362[_0xe3c2('0x3')]][_0xe3c2('0x4e')]=_0x15c362['appdata'];}}}catch(_0x37b5df){utils['error'](util[_0xe3c2('0x6')](_0xe3c2('0x58'),_0x15c362[_0xe3c2('0x3')]),_0x37b5df);}}; \ No newline at end of file +var _0xd5a9=['xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmcs-queue','xmd-queue','lastapplication','Queue','lastdata','xmd-contactid','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','newexten','[%s][calls][newexten]','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','includes','hangup','execif','lodash','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','now','error','newstate','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','linkedid','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','context','answertime','disposition','callerid','calleridname','calleridnum','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','billableseconds','[%s][calls][hangup]','attendedtransfer','localtwolinkedid','origtransfereruniqueid','transfereechannel','secondtransfererchannel','userfield','_attended','transfertargetchannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfererchannel','destinationchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstop]','mohtime','varset','[%s][calls][varset]','variable'];(function(_0x1d998b,_0x21ae39){var _0x5f4fc3=function(_0x4fa68d){while(--_0x4fa68d){_0x1d998b['push'](_0x1d998b['shift']());}};_0x5f4fc3(++_0x21ae39);}(_0xd5a9,0xf4));var _0x9d5a=function(_0x577b4c,_0xbf0f9e){_0x577b4c=_0x577b4c-0x0;var _0xaccf1e=_0xd5a9[_0x577b4c];return _0xaccf1e;};'use strict';var _=require(_0x9d5a('0x0'));var util=require('util');var utils=require(_0x9d5a('0x1'));var transfers=require(_0x9d5a('0x2'));var dispositions=[_0x9d5a('0x3'),_0x9d5a('0x4'),'FAILED',_0x9d5a('0x3'),_0x9d5a('0x3'),_0x9d5a('0x3'),_0x9d5a('0x5'),'BUSY',_0x9d5a('0x4'),_0x9d5a('0x4'),_0x9d5a('0x4')];var channels={};function writeDB(_0x444acf){var _0x22405e;if(transfers[_0x9d5a('0x6')][_0x444acf[_0x9d5a('0x7')]]){_0x22405e=_0x444acf[_0x9d5a('0x7')];_0x444acf[_0x9d5a('0x7')]=transfers['blinds'][_0x444acf[_0x9d5a('0x7')]][_0x9d5a('0x8')];}utils[_0x9d5a('0x9')](util[_0x9d5a('0xa')](_0x9d5a('0xb'),_0x444acf[_0x9d5a('0x7')],_0x444acf[_0x9d5a('0xc')],_0x444acf[_0x9d5a('0xd')],_0x444acf[_0x9d5a('0xe')],_0x444acf[_0x9d5a('0xf')],_0x444acf['calleridnum'],_0x444acf[_0x9d5a('0x10')],_0x444acf[_0x9d5a('0x11')]));if(_0x444acf[_0x9d5a('0x12')]){utils[_0x9d5a('0x13')](_0x444acf['accountcode'])[_0x9d5a('0x14')](function(_0x44f31d){if(_0x44f31d){_0x444acf[_0x9d5a('0x15')]=_0x44f31d['id'];}utils[_0x9d5a('0x16')](_0x9d5a('0x17'),_0x444acf);});}else{utils['request'](_0x9d5a('0x17'),_0x444acf);}if(channels[_0x444acf['uniqueid']]){delete channels[_0x444acf[_0x9d5a('0x7')]];}else if(_0x22405e&&channels[_0x22405e]){delete transfers['blinds'][_0x22405e];delete channels[_0x22405e];}}exports[_0x9d5a('0x18')]=function(_0x50adff){try{utils[_0x9d5a('0x19')](util[_0x9d5a('0xa')](_0x9d5a('0x1a'),_0x50adff[_0x9d5a('0x7')]),_0x50adff);if(_0x50adff[_0x9d5a('0x7')]==_0x50adff['linkedid']&&_0x50adff['channel']!='OutgoingSpoolFailed'){utils[_0x9d5a('0x9')](util[_0x9d5a('0xa')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x50adff[_0x9d5a('0x7')],_0x50adff['context'],_0x50adff['exten']));channels[_0x50adff[_0x9d5a('0x7')]]={'uniqueid':_0x50adff['uniqueid'],'accountcode':_0x50adff[_0x9d5a('0x12')],'source':_0x50adff['calleridnum'],'destination':_0x50adff['exten'],'destinationcontext':_0x50adff['context'],'channel':_0x50adff[_0x9d5a('0xc')],'starttime':utils[_0x9d5a('0x1b')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':'DOCUMENTATION'};}}catch(_0x554d34){utils[_0x9d5a('0x1c')](util[_0x9d5a('0xa')](_0x9d5a('0x1a'),_0x50adff['uniqueid']),_0x554d34);}};exports[_0x9d5a('0x1d')]=function(_0x3a2d22){try{utils[_0x9d5a('0x19')](util[_0x9d5a('0xa')](_0x9d5a('0x1e'),_0x3a2d22[_0x9d5a('0x7')]),_0x3a2d22);if(!_[_0x9d5a('0x1f')](channels[_0x3a2d22[_0x9d5a('0x7')]])&&_0x3a2d22[_0x9d5a('0x20')]==0x6){utils['info'](util[_0x9d5a('0xa')](_0x9d5a('0x21'),_0x3a2d22[_0x9d5a('0x7')],_0x3a2d22['context'],_0x3a2d22['channel']));if(_[_0x9d5a('0x1f')](channels[_0x3a2d22['uniqueid']][_0x9d5a('0x22')])){channels[_0x3a2d22['uniqueid']][_0x9d5a('0x22')]=utils[_0x9d5a('0x1b')]();}}else if(!_[_0x9d5a('0x1f')](channels[_0x3a2d22[_0x9d5a('0x23')]])&&_0x3a2d22['channelstate']==0x6&&_0x3a2d22['context']!=_0x9d5a('0x24')){utils[_0x9d5a('0x9')](util['format'](_0x9d5a('0x25'),_0x3a2d22[_0x9d5a('0x7')],_0x3a2d22[_0x9d5a('0x23')],_0x3a2d22[_0x9d5a('0x26')],_0x3a2d22[_0x9d5a('0xc')]));channels[_0x3a2d22[_0x9d5a('0x23')]][_0x9d5a('0x12')]=_0x3a2d22[_0x9d5a('0x12')];channels[_0x3a2d22[_0x9d5a('0x23')]]['destinationchannel']=_0x3a2d22[_0x9d5a('0xc')];if(_[_0x9d5a('0x1f')](channels[_0x3a2d22[_0x9d5a('0x23')]][_0x9d5a('0x27')])){channels[_0x3a2d22[_0x9d5a('0x23')]][_0x9d5a('0x27')]=utils['now']();}channels[_0x3a2d22[_0x9d5a('0x23')]][_0x9d5a('0x28')]=dispositions[_['toNumber'](_0x3a2d22[_0x9d5a('0x20')])]||'ANSWERED';}}catch(_0x11a56d){utils[_0x9d5a('0x1c')](util['format'](_0x9d5a('0x1e'),_0x3a2d22[_0x9d5a('0x7')]),_0x11a56d);}};exports['hangup']=function(_0x370852){try{if(!_['isNil'](channels[_0x370852[_0x9d5a('0x7')]])){utils[_0x9d5a('0x19')](util[_0x9d5a('0xa')]('[%s][calls][hangup]',_0x370852['uniqueid']),_0x370852);if(_['isNil'](channels[_0x370852[_0x9d5a('0x7')]][_0x9d5a('0x29')])){channels[_0x370852[_0x9d5a('0x7')]][_0x9d5a('0x29')]=_0x370852[_0x9d5a('0x2a')]+'\x20<'+_0x370852[_0x9d5a('0x2b')]+'>';}utils[_0x9d5a('0x9')](util[_0x9d5a('0xa')](_0x9d5a('0x2c'),_0x370852[_0x9d5a('0x7')],channels[_0x370852['uniqueid']]['callerid'],_0x370852[_0x9d5a('0x2d')]));channels[_0x370852[_0x9d5a('0x7')]][_0x9d5a('0x2e')]=utils[_0x9d5a('0x1b')]();channels[_0x370852['uniqueid']][_0x9d5a('0x2f')]=utils[_0x9d5a('0x30')](channels[_0x370852[_0x9d5a('0x7')]]['endtime'],channels[_0x370852[_0x9d5a('0x7')]]['starttime']);channels[_0x370852['uniqueid']][_0x9d5a('0x31')]=channels[_0x370852[_0x9d5a('0x7')]]['answertime']?utils[_0x9d5a('0x30')](channels[_0x370852[_0x9d5a('0x7')]][_0x9d5a('0x2e')],channels[_0x370852[_0x9d5a('0x7')]][_0x9d5a('0x27')]):0x0;writeDB(channels[_0x370852[_0x9d5a('0x7')]]);}}catch(_0x3b1294){utils[_0x9d5a('0x1c')](util[_0x9d5a('0xa')](_0x9d5a('0x32'),_0x370852[_0x9d5a('0x7')]),_0x3b1294);}};exports[_0x9d5a('0x33')]=function(_0x3bb344){try{if(!_['isNil'](channels[_0x3bb344[_0x9d5a('0x34')]])){utils[_0x9d5a('0x19')](util[_0x9d5a('0xa')]('[%s][calls][attendedtransfer]',_0x3bb344[_0x9d5a('0x35')]),_0x3bb344);if(channels[_0x3bb344[_0x9d5a('0x34')]][_0x9d5a('0xc')]==_0x3bb344[_0x9d5a('0x36')]){utils[_0x9d5a('0x9')](util['format']('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x3bb344['origtransfereruniqueid'],_0x3bb344[_0x9d5a('0x34')],_0x3bb344['secondtransfererchannel']));channels[_0x3bb344['localtwolinkedid']]['destinationchannel']=_0x3bb344[_0x9d5a('0x37')];channels[_0x3bb344[_0x9d5a('0x34')]][_0x9d5a('0x38')]=_0x9d5a('0x39');}else if(channels[_0x3bb344[_0x9d5a('0x34')]]['channel']=_0x3bb344[_0x9d5a('0x3a')]){utils['info'](util[_0x9d5a('0xa')](_0x9d5a('0x3b'),_0x3bb344[_0x9d5a('0x35')],_0x3bb344['localtwolinkedid'],_0x3bb344[_0x9d5a('0x3c')]));channels[_0x3bb344[_0x9d5a('0x34')]][_0x9d5a('0x3d')]=_0x3bb344[_0x9d5a('0x3c')];channels[_0x3bb344[_0x9d5a('0x34')]][_0x9d5a('0x38')]='_attended';}}}catch(_0x51b17c){utils[_0x9d5a('0x1c')](util[_0x9d5a('0xa')]('[%s][calls][attendedtransfer]',_0x3bb344[_0x9d5a('0x35')]),_0x51b17c);}};exports[_0x9d5a('0x3e')]=function(_0x4db8b9){try{if(!_[_0x9d5a('0x1f')](channels[_0x4db8b9[_0x9d5a('0x7')]])){utils[_0x9d5a('0x19')](util[_0x9d5a('0xa')](_0x9d5a('0x3f'),_0x4db8b9['uniqueid']),_0x4db8b9);channels[_0x4db8b9['uniqueid']][_0x9d5a('0x40')]=utils[_0x9d5a('0x1b')]();utils['info'](util[_0x9d5a('0xa')](_0x9d5a('0x41'),_0x4db8b9[_0x9d5a('0x7')],channels[_0x4db8b9[_0x9d5a('0x7')]][_0x9d5a('0x40')]));}}catch(_0x26a49b){utils['error'](util[_0x9d5a('0xa')](_0x9d5a('0x3f'),_0x4db8b9[_0x9d5a('0x7')]),_0x26a49b);}};exports['musiconholdstop']=function(_0x78772){try{if(!_[_0x9d5a('0x1f')](channels[_0x78772[_0x9d5a('0x7')]])){utils['debug'](util[_0x9d5a('0xa')](_0x9d5a('0x42'),_0x78772[_0x9d5a('0x7')]),_0x78772);if(!_['isNil'](channels[_0x78772[_0x9d5a('0x7')]][_0x9d5a('0x40')])){channels[_0x78772[_0x9d5a('0x7')]][_0x9d5a('0x43')]+=utils[_0x9d5a('0x30')](utils[_0x9d5a('0x1b')](),channels[_0x78772['uniqueid']][_0x9d5a('0x40')]);utils[_0x9d5a('0x9')](util['format']('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x78772[_0x9d5a('0x7')],channels[_0x78772[_0x9d5a('0x7')]]['mohtime']));delete channels[_0x78772[_0x9d5a('0x7')]][_0x9d5a('0x40')];}}}catch(_0x3f9281){utils[_0x9d5a('0x1c')](util[_0x9d5a('0xa')](_0x9d5a('0x42'),_0x78772['uniqueid']),_0x3f9281);}};exports[_0x9d5a('0x44')]=function(_0x3b7d93){try{if(!_[_0x9d5a('0x1f')](channels[_0x3b7d93[_0x9d5a('0x7')]])){utils[_0x9d5a('0x19')](util[_0x9d5a('0xa')](_0x9d5a('0x45'),_0x3b7d93[_0x9d5a('0x7')]),_0x3b7d93);if(!_[_0x9d5a('0x1f')](_0x3b7d93[_0x9d5a('0x46')][_0x9d5a('0x47')])){utils[_0x9d5a('0x9')](util['format'](_0x9d5a('0x48'),_0x3b7d93[_0x9d5a('0x7')],_0x3b7d93[_0x9d5a('0x49')]));channels[_0x3b7d93['uniqueid']]['source']=_0x3b7d93[_0x9d5a('0x49')];}if(!_[_0x9d5a('0x1f')](_0x3b7d93['variable']['xmd-phone'])){utils[_0x9d5a('0x9')](util[_0x9d5a('0xa')](_0x9d5a('0x4a'),_0x3b7d93[_0x9d5a('0x7')],_0x3b7d93[_0x9d5a('0x49')]));channels[_0x3b7d93['uniqueid']][_0x9d5a('0x4b')]=_0x3b7d93[_0x9d5a('0x49')];channels[_0x3b7d93['uniqueid']][_0x9d5a('0x29')]='\x22'+_0x3b7d93[_0x9d5a('0x49')]+'\x22\x20<'+_0x3b7d93['value']+'>';}if(!_['isNil'](_0x3b7d93['variable'][_0x9d5a('0x4c')])||!_[_0x9d5a('0x1f')](_0x3b7d93[_0x9d5a('0x46')][_0x9d5a('0x4d')])){utils[_0x9d5a('0x9')](util[_0x9d5a('0xa')](_0x9d5a('0x4e'),_0x3b7d93[_0x9d5a('0x7')],!_[_0x9d5a('0x1f')](_0x3b7d93[_0x9d5a('0x46')][_0x9d5a('0x4c')])?_0x9d5a('0x4c'):_0x9d5a('0x4d'),_0x3b7d93['value']));channels[_0x3b7d93[_0x9d5a('0x7')]][_0x9d5a('0x29')]=_0x3b7d93[_0x9d5a('0x49')];}if(!_[_0x9d5a('0x1f')](_0x3b7d93[_0x9d5a('0x46')]['xmd-queue'])||!_['isNil'](_0x3b7d93['variable'][_0x9d5a('0x4f')])){utils[_0x9d5a('0x9')](util[_0x9d5a('0xa')](_0x9d5a('0x4e'),_0x3b7d93[_0x9d5a('0x7')],!_['isNil'](_0x3b7d93[_0x9d5a('0x46')][_0x9d5a('0x50')])?_0x9d5a('0x50'):_0x9d5a('0x4f'),_0x3b7d93[_0x9d5a('0x49')]));channels[_0x3b7d93[_0x9d5a('0x7')]][_0x9d5a('0x51')]=_0x9d5a('0x52');channels[_0x3b7d93['uniqueid']][_0x9d5a('0x53')]=_0x3b7d93['value'];channels[_0x3b7d93[_0x9d5a('0x7')]][_0x9d5a('0xd')]=!![];}if(!_[_0x9d5a('0x1f')](_0x3b7d93[_0x9d5a('0x46')][_0x9d5a('0x54')])){utils['info'](util[_0x9d5a('0xa')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x3b7d93['uniqueid'],_0x3b7d93[_0x9d5a('0x49')]));channels[_0x3b7d93[_0x9d5a('0x7')]]['ContactId']=_0x3b7d93[_0x9d5a('0x49')];}if(!_[_0x9d5a('0x1f')](_0x3b7d93[_0x9d5a('0x46')][_0x9d5a('0x55')])){utils[_0x9d5a('0x9')](util[_0x9d5a('0xa')](_0x9d5a('0x56'),_0x3b7d93[_0x9d5a('0x7')],_0x3b7d93[_0x9d5a('0x49')]));channels[_0x3b7d93['uniqueid']]['type']=_0x3b7d93[_0x9d5a('0x49')];}if(!_[_0x9d5a('0x1f')](_0x3b7d93[_0x9d5a('0x46')][_0x9d5a('0x57')])){utils['info'](util[_0x9d5a('0xa')](_0x9d5a('0x58'),_0x3b7d93[_0x9d5a('0x7')],_0x3b7d93[_0x9d5a('0x49')]));channels[_0x3b7d93[_0x9d5a('0x7')]][_0x9d5a('0x59')]=_0x3b7d93[_0x9d5a('0x49')];}if(!_[_0x9d5a('0x1f')](_0x3b7d93[_0x9d5a('0x46')][_0x9d5a('0x5a')])){utils['info'](util['format']('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x3b7d93[_0x9d5a('0x7')],_0x3b7d93[_0x9d5a('0x49')]));channels[_0x3b7d93['uniqueid']][_0x9d5a('0x5a')]=_0x3b7d93['value'];}}}catch(_0x3bd9d9){utils[_0x9d5a('0x1c')](util['format'](_0x9d5a('0x45'),_0x3b7d93[_0x9d5a('0x7')]),_0x3bd9d9);}};exports[_0x9d5a('0x5b')]=function(_0x4098e5){try{if(!_[_0x9d5a('0x1f')](channels[_0x4098e5[_0x9d5a('0x7')]])){utils[_0x9d5a('0x19')](util['format'](_0x9d5a('0x5c'),_0x4098e5[_0x9d5a('0x7')]),_0x4098e5);utils[_0x9d5a('0x9')](util['format']('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x4098e5[_0x9d5a('0x7')],_0x4098e5[_0x9d5a('0x5d')],_0x4098e5[_0x9d5a('0x5e')]));if(_0x4098e5[_0x9d5a('0x5d')][_0x9d5a('0x5f')]()==_0x9d5a('0x60')&&_[_0x9d5a('0x61')](_0x4098e5['appdata'][_0x9d5a('0x5f')](),_0x9d5a('0x62'))){var _0x10ff8f=_0x4098e5['appdata'][_0x9d5a('0x63')]('=');var _0x38db08=_0x10ff8f[0x0][_0x9d5a('0x64')](_0x10ff8f[0x0]['lastIndexOf']('(')+0x1,_0x10ff8f[0x0][_0x9d5a('0x65')](')'));var _0xcbee4b=_0x10ff8f[0x1];channels[_0x4098e5['uniqueid']][_0x38db08]=_0xcbee4b;}if(!_[_0x9d5a('0x66')]([_0x9d5a('0x67'),'noop',_0x9d5a('0x68'),_0x9d5a('0x60'),'gotoif'],_0x4098e5[_0x9d5a('0x5d')][_0x9d5a('0x5f')]())){channels[_0x4098e5[_0x9d5a('0x7')]]['lastapplication']=_0x4098e5['application'];channels[_0x4098e5['uniqueid']][_0x9d5a('0x53')]=_0x4098e5[_0x9d5a('0x5e')];}}}catch(_0x4d524e){utils['error'](util[_0x9d5a('0xa')](_0x9d5a('0x5c'),_0x4098e5[_0x9d5a('0x7')]),_0x4d524e);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index bfbdf82..df0b92b 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 _0xadf0=['shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','close','connect','info','[core]\x20connected'];(function(_0x47aecd,_0x4fb832){var _0x51abf0=function(_0x1336ad){while(--_0x1336ad){_0x47aecd['push'](_0x47aecd['shift']());}};_0x51abf0(++_0x4fb832);}(_0xadf0,0x12d));var _0x0adf=function(_0x24d2dc,_0x3f92b6){_0x24d2dc=_0x24d2dc-0x0;var _0x5c64e1=_0xadf0[_0x24d2dc];return _0x5c64e1;};'use strict';var utils=require('./utils');exports[_0x0adf('0x0')]=function(){utils[_0x0adf('0x1')](_0x0adf('0x2'));};exports[_0x0adf('0x3')]=function(){utils[_0x0adf('0x1')](_0x0adf('0x4'));};exports[_0x0adf('0x5')]=function(){utils['info'](_0x0adf('0x6'));};exports['error']=function(_0x5a492c){utils['error']('[core]\x20error',_0x5a492c);};exports[_0x0adf('0x7')]=function(){utils[_0x0adf('0x1')]('[core]\x20close');};exports['managerevent']=function(_0x33e906){}; \ No newline at end of file +var _0xb976=['info','[core]\x20connected','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent','connect'];(function(_0x52264c,_0x185ad3){var _0x56e5d2=function(_0x2d5dda){while(--_0x2d5dda){_0x52264c['push'](_0x52264c['shift']());}};_0x56e5d2(++_0x185ad3);}(_0xb976,0x175));var _0x6b97=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb976[_0x3dd15e];return _0x231fd0;};'use strict';var utils=require('./utils');exports[_0x6b97('0x0')]=function(){utils[_0x6b97('0x1')](_0x6b97('0x2'));};exports['shutdown']=function(){utils['info'](_0x6b97('0x3'));};exports[_0x6b97('0x4')]=function(){utils['info'](_0x6b97('0x5'));};exports[_0x6b97('0x6')]=function(_0x4c1737){utils[_0x6b97('0x6')](_0x6b97('0x7'),_0x4c1737);};exports[_0x6b97('0x8')]=function(){utils[_0x6b97('0x1')](_0x6b97('0x9'));};exports[_0x6b97('0xa')]=function(_0x4a22b9){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 605eb67..12c55d2 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 _0xb66c=['isNil','variable','outboundrouteid','value','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','answertime','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','cause-txt','complete','diffTime','endtime','util','./utils','info','format','channel','dialstring','calleridnum','dialstatus','request','CreateVoiceDialReport','uniqueid','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','appdata','error','varset','[%s][dials][varset]'];(function(_0x11fbfe,_0x170dbb){var _0xc54685=function(_0x5c0986){while(--_0x5c0986){_0x11fbfe['push'](_0x11fbfe['shift']());}};_0xc54685(++_0x170dbb);}(_0xb66c,0xcb));var _0xcb66=function(_0x270982,_0xb92382){_0x270982=_0x270982-0x0;var _0x5841fa=_0xb66c[_0x270982];return _0x5841fa;};'use strict';var _=require('lodash');var util=require(_0xcb66('0x0'));var utils=require(_0xcb66('0x1'));var dials={};function writeDB(_0x432b48){utils[_0xcb66('0x2')](util[_0xcb66('0x3')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x432b48['uniqueid'],_0x432b48[_0xcb66('0x4')],_0x432b48[_0xcb66('0x5')],_0x432b48[_0xcb66('0x6')],_0x432b48['connectedlinenum'],_0x432b48[_0xcb66('0x7')]));utils[_0xcb66('0x8')](_0xcb66('0x9'),_0x432b48);delete dials[_0x432b48[_0xcb66('0xa')]];}exports['newexten']=function(_0x110f8e){try{utils[_0xcb66('0xb')](util[_0xcb66('0x3')](_0xcb66('0xc'),_0x110f8e[_0xcb66('0xa')]),_0x110f8e);utils[_0xcb66('0x2')](util[_0xcb66('0x3')](_0xcb66('0xd'),_0x110f8e['uniqueid'],_0x110f8e[_0xcb66('0xe')],_0x110f8e['appdata']));if(_0x110f8e['application'][_0xcb66('0xf')]()==_0xcb66('0x10')&&_[_0xcb66('0x11')](_0x110f8e[_0xcb66('0x12')][_0xcb66('0xf')](),'cdr(routeid)')){var _0x3c31b4=_0x110f8e['appdata']['split']('=');dials[_0x110f8e[_0xcb66('0xa')]]={'routeId':_0x3c31b4[0x1]};}}catch(_0x1db74f){utils[_0xcb66('0x13')](util[_0xcb66('0x3')](_0xcb66('0xc'),_0x110f8e[_0xcb66('0xa')]),_0x1db74f);}};exports[_0xcb66('0x14')]=function(_0x3fd20e){try{utils[_0xcb66('0xb')](util[_0xcb66('0x3')](_0xcb66('0x15'),_0x3fd20e['uniqueid']),_0x3fd20e);if(!_[_0xcb66('0x16')](_0x3fd20e[_0xcb66('0x17')][_0xcb66('0x18')])){utils[_0xcb66('0x2')](util[_0xcb66('0x3')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x3fd20e[_0xcb66('0xa')],_0x3fd20e['value']));dials[_0x3fd20e[_0xcb66('0xa')]]={'routeId':_0x3fd20e[_0xcb66('0x19')]};}}catch(_0x263d7c){utils[_0xcb66('0x13')](util[_0xcb66('0x3')](_0xcb66('0x15'),_0x3fd20e[_0xcb66('0xa')]),_0x263d7c);}};exports[_0xcb66('0x1a')]=function(_0x4247cf){try{if(!_[_0xcb66('0x16')](dials[_0x4247cf[_0xcb66('0xa')]])){utils['debug'](util[_0xcb66('0x3')](_0xcb66('0x1b'),_0x4247cf[_0xcb66('0xa')]),_0x4247cf);dials[_0x4247cf[_0xcb66('0xa')]]=_[_0xcb66('0x1c')](dials[_0x4247cf['uniqueid']],_0x4247cf);dials[_0x4247cf[_0xcb66('0xa')]][_0xcb66('0x1d')]=utils[_0xcb66('0x1e')]();dials[_0x4247cf['uniqueid']][_0xcb66('0x1f')]=_0xcb66('0x20');utils[_0xcb66('0x2')](util[_0xcb66('0x3')](_0xcb66('0x21'),_0x4247cf[_0xcb66('0xa')],dials[_0x4247cf[_0xcb66('0xa')]][_0xcb66('0x1d')]));}}catch(_0x34abfb){utils[_0xcb66('0x13')](util[_0xcb66('0x3')](_0xcb66('0x1b'),_0x4247cf['uniqueid']),_0x34abfb);}};exports[_0xcb66('0x22')]=function(_0x58cf30){try{if(!_[_0xcb66('0x16')](dials[_0x58cf30[_0xcb66('0xa')]])){utils[_0xcb66('0xb')](util[_0xcb66('0x3')](_0xcb66('0x23'),_0x58cf30['uniqueid']),_0x58cf30);dials[_0x58cf30['uniqueid']]['dialstatus']=_0x58cf30[_0xcb66('0x7')];if(_0x58cf30[_0xcb66('0x7')]=='ANSWER'){dials[_0x58cf30[_0xcb66('0xa')]]=_[_0xcb66('0x1c')](dials[_0x58cf30[_0xcb66('0xa')]],_0x58cf30);dials[_0x58cf30['uniqueid']][_0xcb66('0x24')]=utils[_0xcb66('0x1e')]();dials[_0x58cf30[_0xcb66('0xa')]][_0xcb66('0x1f')]='connect';utils[_0xcb66('0x2')](util[_0xcb66('0x3')](_0xcb66('0x25'),_0x58cf30[_0xcb66('0xa')],_0x58cf30[_0xcb66('0x7')],dials[_0x58cf30[_0xcb66('0xa')]][_0xcb66('0x24')]));}else{utils[_0xcb66('0x2')](util[_0xcb66('0x3')](_0xcb66('0x26'),_0x58cf30[_0xcb66('0xa')],_0x58cf30['dialstatus']));}}}catch(_0x3afb57){utils[_0xcb66('0x13')](util[_0xcb66('0x3')](_0xcb66('0x23'),_0x58cf30[_0xcb66('0xa')]),_0x3afb57);}};exports['hangup']=function(_0x37121f){try{if(!_[_0xcb66('0x16')](dials[_0x37121f[_0xcb66('0xa')]])){utils[_0xcb66('0xb')](util[_0xcb66('0x3')](_0xcb66('0x27'),_0x37121f[_0xcb66('0xa')]),_0x37121f);utils[_0xcb66('0x2')](util[_0xcb66('0x3')](_0xcb66('0x28'),_0x37121f[_0xcb66('0xa')],_0x37121f['calleridnum'],_0x37121f['calleridname'],_0x37121f[_0xcb66('0x29')]));dials[_0x37121f[_0xcb66('0xa')]]=_[_0xcb66('0x1c')](dials[_0x37121f[_0xcb66('0xa')]],{'endtime':utils[_0xcb66('0x1e')](),'lastevent':_0xcb66('0x2a')});dials[_0x37121f[_0xcb66('0xa')]]['duration']=utils[_0xcb66('0x2b')](dials[_0x37121f[_0xcb66('0xa')]][_0xcb66('0x2c')],dials[_0x37121f['uniqueid']][_0xcb66('0x1d')]);dials[_0x37121f['uniqueid']]['holdtime']=utils[_0xcb66('0x2b')](dials[_0x37121f[_0xcb66('0xa')]]['answertime']||dials[_0x37121f[_0xcb66('0xa')]][_0xcb66('0x2c')],dials[_0x37121f[_0xcb66('0xa')]][_0xcb66('0x1d')]);dials[_0x37121f[_0xcb66('0xa')]]['billableseconds']=dials[_0x37121f[_0xcb66('0xa')]][_0xcb66('0x24')]?utils[_0xcb66('0x2b')](dials[_0x37121f[_0xcb66('0xa')]][_0xcb66('0x2c')],dials[_0x37121f[_0xcb66('0xa')]]['answertime']):0x0;writeDB(dials[_0x37121f[_0xcb66('0xa')]]);}}catch(_0x3a2fe6){utils[_0xcb66('0x13')](util[_0xcb66('0x3')](_0xcb66('0x27'),_0x37121f[_0xcb66('0xa')]),_0x3a2fe6);}}; \ No newline at end of file +var _0xc501=['calleridname','cause-txt','holdtime','billableseconds','diffTime','endtime','util','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','newexten','debug','format','application','appdata','toLowerCase','set','startsWith','error','[%s][dials][newexten]','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialbegin]','dialend','[%s][dials][dialend]','dialstatus','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s'];(function(_0x41e600,_0x5b21ff){var _0x20be14=function(_0x2bbada){while(--_0x2bbada){_0x41e600['push'](_0x41e600['shift']());}};_0x20be14(++_0x5b21ff);}(_0xc501,0x148));var _0x1c50=function(_0x5179a5,_0x419746){_0x5179a5=_0x5179a5-0x0;var _0x15c8ce=_0xc501[_0x5179a5];return _0x15c8ce;};'use strict';var _=require('lodash');var util=require(_0x1c50('0x0'));var utils=require('./utils');var dials={};function writeDB(_0x13eb16){utils[_0x1c50('0x1')](util['format'](_0x1c50('0x2'),_0x13eb16[_0x1c50('0x3')],_0x13eb16[_0x1c50('0x4')],_0x13eb16[_0x1c50('0x5')],_0x13eb16[_0x1c50('0x6')],_0x13eb16['connectedlinenum'],_0x13eb16['dialstatus']));utils['request']('CreateVoiceDialReport',_0x13eb16);delete dials[_0x13eb16['uniqueid']];}exports[_0x1c50('0x7')]=function(_0x14a400){try{utils[_0x1c50('0x8')](util[_0x1c50('0x9')]('[%s][dials][newexten]',_0x14a400[_0x1c50('0x3')]),_0x14a400);utils[_0x1c50('0x1')](util[_0x1c50('0x9')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x14a400[_0x1c50('0x3')],_0x14a400[_0x1c50('0xa')],_0x14a400[_0x1c50('0xb')]));if(_0x14a400['application'][_0x1c50('0xc')]()==_0x1c50('0xd')&&_[_0x1c50('0xe')](_0x14a400['appdata'][_0x1c50('0xc')](),'cdr(routeid)')){var _0x1359ba=_0x14a400[_0x1c50('0xb')]['split']('=');dials[_0x14a400[_0x1c50('0x3')]]={'routeId':_0x1359ba[0x1]};}}catch(_0x5d3525){utils[_0x1c50('0xf')](util[_0x1c50('0x9')](_0x1c50('0x10'),_0x14a400[_0x1c50('0x3')]),_0x5d3525);}};exports['varset']=function(_0x393fad){try{utils[_0x1c50('0x8')](util[_0x1c50('0x9')](_0x1c50('0x11'),_0x393fad[_0x1c50('0x3')]),_0x393fad);if(!_[_0x1c50('0x12')](_0x393fad[_0x1c50('0x13')][_0x1c50('0x14')])){utils[_0x1c50('0x1')](util[_0x1c50('0x9')](_0x1c50('0x15'),_0x393fad[_0x1c50('0x3')],_0x393fad[_0x1c50('0x16')]));dials[_0x393fad[_0x1c50('0x3')]]={'routeId':_0x393fad['value']};}}catch(_0x31a8ce){utils[_0x1c50('0xf')](util[_0x1c50('0x9')](_0x1c50('0x11'),_0x393fad[_0x1c50('0x3')]),_0x31a8ce);}};exports[_0x1c50('0x17')]=function(_0x2817cf){try{if(!_[_0x1c50('0x12')](dials[_0x2817cf[_0x1c50('0x3')]])){utils[_0x1c50('0x8')](util['format']('[%s][dials][dialbegin]',_0x2817cf[_0x1c50('0x3')]),_0x2817cf);dials[_0x2817cf[_0x1c50('0x3')]]=_[_0x1c50('0x18')](dials[_0x2817cf[_0x1c50('0x3')]],_0x2817cf);dials[_0x2817cf[_0x1c50('0x3')]][_0x1c50('0x19')]=utils[_0x1c50('0x1a')]();dials[_0x2817cf['uniqueid']][_0x1c50('0x1b')]=_0x1c50('0x1c');utils['info'](util['format'](_0x1c50('0x1d'),_0x2817cf[_0x1c50('0x3')],dials[_0x2817cf['uniqueid']][_0x1c50('0x19')]));}}catch(_0x550a06){utils['error'](util[_0x1c50('0x9')](_0x1c50('0x1e'),_0x2817cf[_0x1c50('0x3')]),_0x550a06);}};exports[_0x1c50('0x1f')]=function(_0xef571a){try{if(!_[_0x1c50('0x12')](dials[_0xef571a[_0x1c50('0x3')]])){utils[_0x1c50('0x8')](util[_0x1c50('0x9')](_0x1c50('0x20'),_0xef571a[_0x1c50('0x3')]),_0xef571a);dials[_0xef571a['uniqueid']][_0x1c50('0x21')]=_0xef571a[_0x1c50('0x21')];if(_0xef571a['dialstatus']==_0x1c50('0x22')){dials[_0xef571a[_0x1c50('0x3')]]=_[_0x1c50('0x18')](dials[_0xef571a[_0x1c50('0x3')]],_0xef571a);dials[_0xef571a[_0x1c50('0x3')]][_0x1c50('0x23')]=utils[_0x1c50('0x1a')]();dials[_0xef571a['uniqueid']]['lastevent']=_0x1c50('0x24');utils[_0x1c50('0x1')](util[_0x1c50('0x9')](_0x1c50('0x25'),_0xef571a['uniqueid'],_0xef571a[_0x1c50('0x21')],dials[_0xef571a['uniqueid']][_0x1c50('0x23')]));}else{utils[_0x1c50('0x1')](util[_0x1c50('0x9')]('[%s][dials][dialend]\x20dialstatus:%s',_0xef571a[_0x1c50('0x3')],_0xef571a[_0x1c50('0x21')]));}}}catch(_0x2760df){utils[_0x1c50('0xf')](util[_0x1c50('0x9')]('[%s][dials][dialend]',_0xef571a['uniqueid']),_0x2760df);}};exports['hangup']=function(_0x2023fe){try{if(!_[_0x1c50('0x12')](dials[_0x2023fe[_0x1c50('0x3')]])){utils[_0x1c50('0x8')](util['format'](_0x1c50('0x26'),_0x2023fe[_0x1c50('0x3')]),_0x2023fe);utils[_0x1c50('0x1')](util[_0x1c50('0x9')](_0x1c50('0x27'),_0x2023fe[_0x1c50('0x3')],_0x2023fe[_0x1c50('0x6')],_0x2023fe[_0x1c50('0x28')],_0x2023fe[_0x1c50('0x29')]));dials[_0x2023fe['uniqueid']]=_[_0x1c50('0x18')](dials[_0x2023fe[_0x1c50('0x3')]],{'endtime':utils[_0x1c50('0x1a')](),'lastevent':'complete'});dials[_0x2023fe[_0x1c50('0x3')]]['duration']=utils['diffTime'](dials[_0x2023fe[_0x1c50('0x3')]]['endtime'],dials[_0x2023fe[_0x1c50('0x3')]][_0x1c50('0x19')]);dials[_0x2023fe['uniqueid']][_0x1c50('0x2a')]=utils['diffTime'](dials[_0x2023fe[_0x1c50('0x3')]][_0x1c50('0x23')]||dials[_0x2023fe['uniqueid']]['endtime'],dials[_0x2023fe[_0x1c50('0x3')]][_0x1c50('0x19')]);dials[_0x2023fe[_0x1c50('0x3')]][_0x1c50('0x2b')]=dials[_0x2023fe['uniqueid']][_0x1c50('0x23')]?utils[_0x1c50('0x2c')](dials[_0x2023fe[_0x1c50('0x3')]][_0x1c50('0x2d')],dials[_0x2023fe['uniqueid']][_0x1c50('0x23')]):0x0;writeDB(dials[_0x2023fe[_0x1c50('0x3')]]);}}catch(_0x3640c1){utils[_0x1c50('0xf')](util[_0x1c50('0x9')](_0x1c50('0x26'),_0x2023fe[_0x1c50('0x3')]),_0x3640c1);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 25dbaaa..f3ff35c 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 _0x4d44=['[%s][index][newchannel]','[%s][index][dialbegin]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','asterisk','username','keepConnected','xdr','info','XDR\x20DISABLED','./queues.controller','./recordings.controller','./dials.controller','./transfers.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel'];(function(_0x4bfac3,_0x58324d){var _0x15f0f2=function(_0xf0c511){while(--_0xf0c511){_0x4bfac3['push'](_0x4bfac3['shift']());}};_0x15f0f2(++_0x58324d);}(_0x4d44,0x186));var _0x44d4=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x4d44[_0x199572];return _0x13cfa3;};var AsteriskManager=require(_0x44d4('0x0'));var config=require(_0x44d4('0x1'));var utils=require(_0x44d4('0x2'));var util=require(_0x44d4('0x3'));var ami=new AsteriskManager(config[_0x44d4('0x4')]['port'],config[_0x44d4('0x4')]['ip'],config[_0x44d4('0x4')][_0x44d4('0x5')],config[_0x44d4('0x4')]['password'],!![]);ami[_0x44d4('0x6')]();if(config[_0x44d4('0x7')]&&config['xdr']['disabled']){utils[_0x44d4('0x8')](_0x44d4('0x9'));}else{var agents=require('./agents.controller');var calls=require('./calls.controller');var queues=require(_0x44d4('0xa'));var recordings=require(_0x44d4('0xb'));var members=require('./members.controller');var dials=require(_0x44d4('0xc'));var transfers=require(_0x44d4('0xd'));var core=require('./core.controller');ami['on'](_0x44d4('0xe'),core[_0x44d4('0xe')]);ami['on'](_0x44d4('0xf'),core[_0x44d4('0xf')]);ami['on'](_0x44d4('0x10'),core[_0x44d4('0x10')]);ami['on'](_0x44d4('0x11'),core[_0x44d4('0x11')]);ami['on'](_0x44d4('0x12'),core['close']);ami['on']('managerevent',core[_0x44d4('0x13')]);ami['on'](_0x44d4('0x14'),function(_0x15105d){try{utils[_0x44d4('0x15')](util[_0x44d4('0x16')](_0x44d4('0x17'),_0x15105d[_0x44d4('0x18')]),_0x15105d);members[_0x44d4('0x14')](_0x15105d);}catch(_0x4869cd){utils[_0x44d4('0x11')](util[_0x44d4('0x16')](_0x44d4('0x17'),_0x15105d['device']),_0x4869cd);}});ami['on'](_0x44d4('0x19'),function(_0x585f50){try{utils[_0x44d4('0x15')](util[_0x44d4('0x16')](_0x44d4('0x1a'),_0x585f50[_0x44d4('0x1b')]),_0x585f50);agents[_0x44d4('0x19')](_0x585f50);}catch(_0xf9f053){utils[_0x44d4('0x11')](util[_0x44d4('0x16')](_0x44d4('0x1a'),_0x585f50[_0x44d4('0x1b')]),_0xf9f053);}});ami['on'](_0x44d4('0x1c'),function(_0x5af799){try{utils[_0x44d4('0x15')](util[_0x44d4('0x16')](_0x44d4('0x1d'),_0x5af799['uniqueid']),_0x5af799);agents[_0x44d4('0x1c')](_0x5af799);}catch(_0x3111b4){utils[_0x44d4('0x11')](util[_0x44d4('0x16')](_0x44d4('0x1d'),_0x5af799[_0x44d4('0x1b')]),_0x3111b4);}});ami['on'](_0x44d4('0x1e'),function(_0xf29424){try{utils[_0x44d4('0x15')](util[_0x44d4('0x16')]('[%s][index][agentconnect]',_0xf29424['uniqueid']),_0xf29424);agents[_0x44d4('0x1e')](_0xf29424);queues[_0x44d4('0x1e')](_0xf29424);}catch(_0x1801c0){utils[_0x44d4('0x11')](util[_0x44d4('0x16')](_0x44d4('0x1f'),_0xf29424['uniqueid']),_0x1801c0);}});ami['on']('agentcomplete',function(_0x466152){try{utils['debug'](util[_0x44d4('0x16')](_0x44d4('0x20'),_0x466152['uniqueid']),_0x466152);agents[_0x44d4('0x21')](_0x466152);queues['agentcomplete'](_0x466152);members[_0x44d4('0x21')](_0x466152);}catch(_0x3d2130){utils['error'](util[_0x44d4('0x16')](_0x44d4('0x20'),_0x466152[_0x44d4('0x1b')]),_0x3d2130);}});ami['on'](_0x44d4('0x22'),function(_0xec72f3){try{utils[_0x44d4('0x15')](util[_0x44d4('0x16')](_0x44d4('0x23'),_0xec72f3['uniqueid']),_0xec72f3);agents[_0x44d4('0x22')](_0xec72f3);queues[_0x44d4('0x22')](_0xec72f3);}catch(_0x1ff7dd){utils[_0x44d4('0x11')](util[_0x44d4('0x16')]('[%s][index][queuecallerabandon]',_0xec72f3['uniqueid']),_0x1ff7dd);}});ami['on'](_0x44d4('0x24'),function(_0xc39663){try{utils[_0x44d4('0x15')](util[_0x44d4('0x16')](_0x44d4('0x25'),_0xc39663[_0x44d4('0x1b')]),_0xc39663);queues[_0x44d4('0x24')](_0xc39663);recordings[_0x44d4('0x24')](_0xc39663);}catch(_0x23378a){utils['error'](util[_0x44d4('0x16')](_0x44d4('0x25'),_0xc39663[_0x44d4('0x1b')]),_0x23378a);}});ami['on'](_0x44d4('0x26'),function(_0x4f4b7c){try{utils['debug'](util[_0x44d4('0x16')](_0x44d4('0x27'),_0x4f4b7c['uniqueid']),_0x4f4b7c);queues[_0x44d4('0x26')](_0x4f4b7c);}catch(_0x4541c0){utils[_0x44d4('0x11')](util[_0x44d4('0x16')](_0x44d4('0x27'),_0x4f4b7c[_0x44d4('0x1b')]),_0x4541c0);}});ami['on'](_0x44d4('0x28'),function(_0x4c1d8e){try{utils['debug'](util[_0x44d4('0x16')]('[%s][index][musiconholdstart]',_0x4c1d8e['uniqueid']),_0x4c1d8e);queues[_0x44d4('0x28')](_0x4c1d8e);calls['musiconholdstart'](_0x4c1d8e);}catch(_0x22ec4b){utils[_0x44d4('0x11')](util[_0x44d4('0x16')]('[%s][index][musiconholdstart]',_0x4c1d8e['uniqueid']),_0x22ec4b);}});ami['on'](_0x44d4('0x29'),function(_0x4e1770){try{utils['debug'](util[_0x44d4('0x16')]('[%s][index][musiconholdstop]',_0x4e1770[_0x44d4('0x1b')]),_0x4e1770);queues['musiconholdstop'](_0x4e1770);calls[_0x44d4('0x29')](_0x4e1770);}catch(_0x53a375){utils['error'](util['format'](_0x44d4('0x2a'),_0x4e1770[_0x44d4('0x1b')]),_0x53a375);}});ami['on'](_0x44d4('0x2b'),function(_0x42e47b){try{utils['debug'](util[_0x44d4('0x16')](_0x44d4('0x2c'),_0x42e47b['uniqueid']),_0x42e47b);calls[_0x44d4('0x2b')](_0x42e47b);recordings[_0x44d4('0x2b')](_0x42e47b);}catch(_0x47cc6b){utils[_0x44d4('0x11')](util['format'](_0x44d4('0x2c'),_0x42e47b[_0x44d4('0x1b')]),_0x47cc6b);}});ami['on'](_0x44d4('0x2d'),function(_0x454be0){try{utils[_0x44d4('0x15')](util['format'](_0x44d4('0x2e'),_0x454be0[_0x44d4('0x1b')]),_0x454be0);calls[_0x44d4('0x2d')](_0x454be0);recordings[_0x44d4('0x2d')](_0x454be0);dials[_0x44d4('0x2d')](_0x454be0);agents[_0x44d4('0x2d')](_0x454be0);queues[_0x44d4('0x2d')](_0x454be0);}catch(_0x3c97c0){utils[_0x44d4('0x11')](util[_0x44d4('0x16')](_0x44d4('0x2e'),_0x454be0[_0x44d4('0x1b')]),_0x3c97c0);}});ami['on'](_0x44d4('0x2f'),function(_0x54e347){try{utils['debug'](util[_0x44d4('0x16')](_0x44d4('0x30'),_0x54e347[_0x44d4('0x1b')]),_0x54e347);members[_0x44d4('0x2f')](_0x54e347);}catch(_0x1f6daa){utils[_0x44d4('0x11')](util[_0x44d4('0x16')](_0x44d4('0x30'),_0x54e347[_0x44d4('0x1b')]),_0x1f6daa);}});ami['on'](_0x44d4('0x31'),function(_0x470e09){try{utils[_0x44d4('0x15')](util[_0x44d4('0x16')]('[%s][index][blindtransfer]',_0x470e09[_0x44d4('0x1b')]),_0x470e09);queues[_0x44d4('0x31')](_0x470e09);agents['blindtransfer'](_0x470e09);transfers[_0x44d4('0x31')](_0x470e09);}catch(_0x5a61cd){utils[_0x44d4('0x11')](util[_0x44d4('0x16')]('[%s][index][blindtransfer]',_0x470e09['uniqueid']),_0x5a61cd);}});ami['on'](_0x44d4('0x32'),function(_0x4ad287){try{utils[_0x44d4('0x15')](util[_0x44d4('0x16')](_0x44d4('0x33'),_0x4ad287[_0x44d4('0x34')]),_0x4ad287);queues['attendedtransfer'](_0x4ad287);transfers[_0x44d4('0x32')](_0x4ad287);agents[_0x44d4('0x32')](_0x4ad287);calls['attendedtransfer'](_0x4ad287);}catch(_0x237a1d){utils[_0x44d4('0x11')](util['format'](_0x44d4('0x33'),_0x4ad287[_0x44d4('0x34')]),_0x237a1d);}});ami['on'](_0x44d4('0x35'),function(_0x298b88){try{utils['debug'](util[_0x44d4('0x16')](_0x44d4('0x36'),_0x298b88['uniqueid']),_0x298b88);queues[_0x44d4('0x35')](_0x298b88);recordings[_0x44d4('0x35')](_0x298b88);calls[_0x44d4('0x35')](_0x298b88);dials['varset'](_0x298b88);}catch(_0x434be5){utils[_0x44d4('0x11')](util[_0x44d4('0x16')](_0x44d4('0x36'),_0x298b88[_0x44d4('0x1b')]),_0x434be5);}});ami['on'](_0x44d4('0x37'),function(_0x4aa485){try{utils[_0x44d4('0x15')](util[_0x44d4('0x16')](_0x44d4('0x38'),_0x4aa485[_0x44d4('0x1b')]),_0x4aa485);calls['newexten'](_0x4aa485);recordings[_0x44d4('0x37')](_0x4aa485);dials['newexten'](_0x4aa485);}catch(_0x66fae3){utils[_0x44d4('0x11')](util[_0x44d4('0x16')](_0x44d4('0x38'),_0x4aa485['uniqueid']),_0x66fae3);}});ami['on'](_0x44d4('0x39'),function(_0x452ad3){try{utils['debug'](util[_0x44d4('0x16')]('[%s][index][newchannel]',_0x452ad3[_0x44d4('0x1b')]),_0x452ad3);calls[_0x44d4('0x39')](_0x452ad3);recordings[_0x44d4('0x39')](_0x452ad3);}catch(_0x1bf9b5){utils[_0x44d4('0x11')](util[_0x44d4('0x16')](_0x44d4('0x3a'),_0x452ad3['uniqueid']),_0x1bf9b5);}});ami['on']('dialbegin',function(_0x291149){try{utils[_0x44d4('0x15')](util[_0x44d4('0x16')](_0x44d4('0x3b'),_0x291149[_0x44d4('0x1b')]),_0x291149);dials[_0x44d4('0x3c')](_0x291149);}catch(_0x34a8ba){utils['error'](util[_0x44d4('0x16')](_0x44d4('0x3d'),_0x291149[_0x44d4('0x1b')]),_0x34a8ba);}});ami['on'](_0x44d4('0x3e'),function(_0x4c4bdc){try{utils[_0x44d4('0x15')](util[_0x44d4('0x16')](_0x44d4('0x3f'),_0x4c4bdc['uniqueid']),_0x4c4bdc);dials['dialend'](_0x4c4bdc);}catch(_0x357f6d){utils[_0x44d4('0x11')](util[_0x44d4('0x16')](_0x44d4('0x3f'),_0x4c4bdc[_0x44d4('0x1b')]),_0x357f6d);}});} \ No newline at end of file +var _0x50ee=['port','username','password','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./dials.controller','./core.controller','connect','shutdown','fullybooted','error','devicestatechange','debug','format','[%s][index][devicestatechange]','device','uniqueid','agentcalled','[%s][index][agentcalled]','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','[%s][index][musiconholdstop]','musiconholdstop','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','[%s][index][newchannel]','newchannel','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','util','asterisk'];(function(_0x19e513,_0x2cfe4b){var _0x5b1d5a=function(_0xfc4be){while(--_0xfc4be){_0x19e513['push'](_0x19e513['shift']());}};_0x5b1d5a(++_0x2cfe4b);}(_0x50ee,0x18e));var _0xe50e=function(_0x5a2285,_0x3212d1){_0x5a2285=_0x5a2285-0x0;var _0x48f6ed=_0x50ee[_0x5a2285];return _0x48f6ed;};var AsteriskManager=require(_0xe50e('0x0'));var config=require(_0xe50e('0x1'));var utils=require('./utils');var util=require(_0xe50e('0x2'));var ami=new AsteriskManager(config[_0xe50e('0x3')][_0xe50e('0x4')],config[_0xe50e('0x3')]['ip'],config[_0xe50e('0x3')][_0xe50e('0x5')],config[_0xe50e('0x3')][_0xe50e('0x6')],!![]);ami[_0xe50e('0x7')]();if(config[_0xe50e('0x8')]&&config[_0xe50e('0x8')][_0xe50e('0x9')]){utils[_0xe50e('0xa')](_0xe50e('0xb'));}else{var agents=require(_0xe50e('0xc'));var calls=require(_0xe50e('0xd'));var queues=require(_0xe50e('0xe'));var recordings=require('./recordings.controller');var members=require('./members.controller');var dials=require(_0xe50e('0xf'));var transfers=require('./transfers.controller');var core=require(_0xe50e('0x10'));ami['on'](_0xe50e('0x11'),core[_0xe50e('0x11')]);ami['on'](_0xe50e('0x12'),core[_0xe50e('0x12')]);ami['on'](_0xe50e('0x13'),core['fullybooted']);ami['on'](_0xe50e('0x14'),core[_0xe50e('0x14')]);ami['on']('close',core['close']);ami['on']('managerevent',core['managerevent']);ami['on'](_0xe50e('0x15'),function(_0x3b0623){try{utils[_0xe50e('0x16')](util[_0xe50e('0x17')](_0xe50e('0x18'),_0x3b0623[_0xe50e('0x19')]),_0x3b0623);members[_0xe50e('0x15')](_0x3b0623);}catch(_0x576017){utils['error'](util[_0xe50e('0x17')](_0xe50e('0x18'),_0x3b0623[_0xe50e('0x19')]),_0x576017);}});ami['on']('agentcalled',function(_0x451440){try{utils[_0xe50e('0x16')](util[_0xe50e('0x17')]('[%s][index][agentcalled]',_0x451440[_0xe50e('0x1a')]),_0x451440);agents[_0xe50e('0x1b')](_0x451440);}catch(_0x1a9d9d){utils[_0xe50e('0x14')](util[_0xe50e('0x17')](_0xe50e('0x1c'),_0x451440[_0xe50e('0x1a')]),_0x1a9d9d);}});ami['on'](_0xe50e('0x1d'),function(_0x41545c){try{utils['debug'](util[_0xe50e('0x17')](_0xe50e('0x1e'),_0x41545c[_0xe50e('0x1a')]),_0x41545c);agents[_0xe50e('0x1d')](_0x41545c);}catch(_0x1ae462){utils[_0xe50e('0x14')](util[_0xe50e('0x17')](_0xe50e('0x1e'),_0x41545c[_0xe50e('0x1a')]),_0x1ae462);}});ami['on'](_0xe50e('0x1f'),function(_0x46e1fe){try{utils[_0xe50e('0x16')](util[_0xe50e('0x17')](_0xe50e('0x20'),_0x46e1fe[_0xe50e('0x1a')]),_0x46e1fe);agents[_0xe50e('0x1f')](_0x46e1fe);queues[_0xe50e('0x1f')](_0x46e1fe);}catch(_0x1fdbff){utils[_0xe50e('0x14')](util[_0xe50e('0x17')](_0xe50e('0x20'),_0x46e1fe['uniqueid']),_0x1fdbff);}});ami['on'](_0xe50e('0x21'),function(_0x59faf7){try{utils['debug'](util[_0xe50e('0x17')]('[%s][index][agentcomplete]',_0x59faf7[_0xe50e('0x1a')]),_0x59faf7);agents[_0xe50e('0x21')](_0x59faf7);queues[_0xe50e('0x21')](_0x59faf7);members['agentcomplete'](_0x59faf7);}catch(_0x2cf9f8){utils[_0xe50e('0x14')](util['format'](_0xe50e('0x22'),_0x59faf7[_0xe50e('0x1a')]),_0x2cf9f8);}});ami['on'](_0xe50e('0x23'),function(_0x52f243){try{utils[_0xe50e('0x16')](util[_0xe50e('0x17')](_0xe50e('0x24'),_0x52f243[_0xe50e('0x1a')]),_0x52f243);agents[_0xe50e('0x23')](_0x52f243);queues[_0xe50e('0x23')](_0x52f243);}catch(_0x34b2cc){utils[_0xe50e('0x14')](util['format'](_0xe50e('0x24'),_0x52f243['uniqueid']),_0x34b2cc);}});ami['on'](_0xe50e('0x25'),function(_0x31eb3a){try{utils['debug'](util[_0xe50e('0x17')](_0xe50e('0x26'),_0x31eb3a[_0xe50e('0x1a')]),_0x31eb3a);queues[_0xe50e('0x25')](_0x31eb3a);recordings[_0xe50e('0x25')](_0x31eb3a);}catch(_0x402e19){utils['error'](util['format'](_0xe50e('0x26'),_0x31eb3a[_0xe50e('0x1a')]),_0x402e19);}});ami['on'](_0xe50e('0x27'),function(_0x424622){try{utils[_0xe50e('0x16')](util[_0xe50e('0x17')](_0xe50e('0x28'),_0x424622['uniqueid']),_0x424622);queues['queuecallerleave'](_0x424622);}catch(_0x353757){utils[_0xe50e('0x14')](util[_0xe50e('0x17')]('[%s][index][queuecallerleave]',_0x424622[_0xe50e('0x1a')]),_0x353757);}});ami['on'](_0xe50e('0x29'),function(_0x3defeb){try{utils[_0xe50e('0x16')](util[_0xe50e('0x17')](_0xe50e('0x2a'),_0x3defeb['uniqueid']),_0x3defeb);queues[_0xe50e('0x29')](_0x3defeb);calls[_0xe50e('0x29')](_0x3defeb);}catch(_0x3b9805){utils['error'](util[_0xe50e('0x17')](_0xe50e('0x2a'),_0x3defeb[_0xe50e('0x1a')]),_0x3b9805);}});ami['on']('musiconholdstop',function(_0xb7764c){try{utils[_0xe50e('0x16')](util[_0xe50e('0x17')](_0xe50e('0x2b'),_0xb7764c['uniqueid']),_0xb7764c);queues[_0xe50e('0x2c')](_0xb7764c);calls[_0xe50e('0x2c')](_0xb7764c);}catch(_0x553f5e){utils[_0xe50e('0x14')](util['format'](_0xe50e('0x2b'),_0xb7764c['uniqueid']),_0x553f5e);}});ami['on'](_0xe50e('0x2d'),function(_0x4f9547){try{utils[_0xe50e('0x16')](util[_0xe50e('0x17')](_0xe50e('0x2e'),_0x4f9547['uniqueid']),_0x4f9547);calls[_0xe50e('0x2d')](_0x4f9547);recordings[_0xe50e('0x2d')](_0x4f9547);}catch(_0x1c1a83){utils[_0xe50e('0x14')](util['format'](_0xe50e('0x2e'),_0x4f9547[_0xe50e('0x1a')]),_0x1c1a83);}});ami['on']('hangup',function(_0x57458c){try{utils[_0xe50e('0x16')](util[_0xe50e('0x17')](_0xe50e('0x2f'),_0x57458c[_0xe50e('0x1a')]),_0x57458c);calls[_0xe50e('0x30')](_0x57458c);recordings['hangup'](_0x57458c);dials[_0xe50e('0x30')](_0x57458c);agents[_0xe50e('0x30')](_0x57458c);queues[_0xe50e('0x30')](_0x57458c);}catch(_0x2f082f){utils['error'](util[_0xe50e('0x17')](_0xe50e('0x2f'),_0x57458c['uniqueid']),_0x2f082f);}});ami['on'](_0xe50e('0x31'),function(_0x4a5e40){try{utils[_0xe50e('0x16')](util[_0xe50e('0x17')](_0xe50e('0x32'),_0x4a5e40[_0xe50e('0x1a')]),_0x4a5e40);members[_0xe50e('0x31')](_0x4a5e40);}catch(_0x458cdc){utils['error'](util[_0xe50e('0x17')](_0xe50e('0x32'),_0x4a5e40['uniqueid']),_0x458cdc);}});ami['on'](_0xe50e('0x33'),function(_0x2de4db){try{utils[_0xe50e('0x16')](util['format'](_0xe50e('0x34'),_0x2de4db['uniqueid']),_0x2de4db);queues[_0xe50e('0x33')](_0x2de4db);agents[_0xe50e('0x33')](_0x2de4db);transfers['blindtransfer'](_0x2de4db);}catch(_0x287e98){utils['error'](util[_0xe50e('0x17')]('[%s][index][blindtransfer]',_0x2de4db[_0xe50e('0x1a')]),_0x287e98);}});ami['on'](_0xe50e('0x35'),function(_0x2cdaac){try{utils[_0xe50e('0x16')](util['format'](_0xe50e('0x36'),_0x2cdaac[_0xe50e('0x37')]),_0x2cdaac);queues[_0xe50e('0x35')](_0x2cdaac);transfers[_0xe50e('0x35')](_0x2cdaac);agents[_0xe50e('0x35')](_0x2cdaac);calls[_0xe50e('0x35')](_0x2cdaac);}catch(_0x57b83d){utils[_0xe50e('0x14')](util['format'](_0xe50e('0x36'),_0x2cdaac['origtransfereruniqueid']),_0x57b83d);}});ami['on'](_0xe50e('0x38'),function(_0xbb6d85){try{utils[_0xe50e('0x16')](util[_0xe50e('0x17')](_0xe50e('0x39'),_0xbb6d85[_0xe50e('0x1a')]),_0xbb6d85);queues[_0xe50e('0x38')](_0xbb6d85);recordings[_0xe50e('0x38')](_0xbb6d85);calls[_0xe50e('0x38')](_0xbb6d85);dials[_0xe50e('0x38')](_0xbb6d85);}catch(_0x3e1223){utils[_0xe50e('0x14')](util[_0xe50e('0x17')](_0xe50e('0x39'),_0xbb6d85[_0xe50e('0x1a')]),_0x3e1223);}});ami['on'](_0xe50e('0x3a'),function(_0x3ea879){try{utils[_0xe50e('0x16')](util['format'](_0xe50e('0x3b'),_0x3ea879[_0xe50e('0x1a')]),_0x3ea879);calls['newexten'](_0x3ea879);recordings[_0xe50e('0x3a')](_0x3ea879);dials[_0xe50e('0x3a')](_0x3ea879);}catch(_0x49c7d9){utils[_0xe50e('0x14')](util[_0xe50e('0x17')](_0xe50e('0x3b'),_0x3ea879['uniqueid']),_0x49c7d9);}});ami['on']('newchannel',function(_0x2b0a1a){try{utils['debug'](util[_0xe50e('0x17')](_0xe50e('0x3c'),_0x2b0a1a[_0xe50e('0x1a')]),_0x2b0a1a);calls['newchannel'](_0x2b0a1a);recordings[_0xe50e('0x3d')](_0x2b0a1a);}catch(_0x369d7b){utils[_0xe50e('0x14')](util[_0xe50e('0x17')](_0xe50e('0x3c'),_0x2b0a1a[_0xe50e('0x1a')]),_0x369d7b);}});ami['on'](_0xe50e('0x3e'),function(_0x309959){try{utils[_0xe50e('0x16')](util[_0xe50e('0x17')](_0xe50e('0x3f'),_0x309959[_0xe50e('0x1a')]),_0x309959);dials['dialbegin'](_0x309959);}catch(_0x1c582d){utils[_0xe50e('0x14')](util[_0xe50e('0x17')](_0xe50e('0x40'),_0x309959['uniqueid']),_0x1c582d);}});ami['on'](_0xe50e('0x41'),function(_0x3ca545){try{utils[_0xe50e('0x16')](util[_0xe50e('0x17')](_0xe50e('0x42'),_0x3ca545[_0xe50e('0x1a')]),_0x3ca545);dials[_0xe50e('0x41')](_0x3ca545);}catch(_0x5eb61b){utils[_0xe50e('0x14')](util[_0xe50e('0x17')](_0xe50e('0x42'),_0x3ca545['uniqueid']),_0x5eb61b);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index a6753c5..d8225e1 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 _0x90ae=['Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','type','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','catch','[%s][members][writeDB]','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','state','INUSE','voice','TALKING','now','NOT_INUSE','exitAt','duration','enterAt','error','agentcomplete','isNil','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','[%s][members][cdr]','data1','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','split','lodash','util','./utils'];(function(_0x5c8eea,_0xad222b){var _0x5980d3=function(_0x353056){while(--_0x353056){_0x5c8eea['push'](_0x5c8eea['shift']());}};_0x5980d3(++_0xad222b);}(_0x90ae,0x195));var _0xe90a=function(_0x529820,_0x246f6d){_0x529820=_0x529820-0x0;var _0x223a4d=_0x90ae[_0x529820];return _0x223a4d;};'use strict';var _=require(_0xe90a('0x0'));var util=require(_0xe90a('0x1'));var utils=require(_0xe90a('0x2'));var members={};var exclude=['Local/_attended@transfer',_0xe90a('0x3')];function writeDB(_0x2eb615){utils[_0xe90a('0x4')](util[_0xe90a('0x5')](_0xe90a('0x6'),_0x2eb615[_0xe90a('0x7')],_0x2eb615[_0xe90a('0x8')],_0x2eb615[_0xe90a('0x9')],_0x2eb615[_0xe90a('0xa')],_0x2eb615['membername'],_0x2eb615[_0xe90a('0xb')]));if(_0x2eb615[_0xe90a('0x8')]){utils[_0xe90a('0xc')](_0x2eb615[_0xe90a('0x8')])[_0xe90a('0xd')](function(_0x2602fa){if(_0x2602fa){_0x2eb615['membername']=_0x2602fa[_0xe90a('0xe')];_0x2eb615[_0xe90a('0xf')]=_0x2602fa[_0xe90a('0xf')];utils[_0xe90a('0x10')](_0xe90a('0x11'),_0x2eb615);}else{utils[_0xe90a('0x12')](_0x2eb615[_0xe90a('0x8')]['split']('/')[0x1])[_0xe90a('0xd')](function(_0x3da327){if(_0x3da327){_0x2eb615['membername']=_0x3da327['name'];_0x2eb615[_0xe90a('0xf')]=_0x3da327[_0xe90a('0xf')];utils['request'](_0xe90a('0x11'),_0x2eb615);}});}})[_0xe90a('0x13')](function(_0x20ea41){utils['error'](util[_0xe90a('0x5')](_0xe90a('0x14'),_0x2eb615['uniqueid']),_0x20ea41);});}delete members[_0x2eb615[_0xe90a('0x8')]];}function startsWith(_0x53969d,_0x5342d7){return _['some'](_0x53969d,function(_0x3061fb){return _[_0xe90a('0x15')](_0x5342d7,_0x3061fb);});}exports[_0xe90a('0x16')]=function(_0x22602f){try{utils[_0xe90a('0x17')](util[_0xe90a('0x5')](_0xe90a('0x18'),members[_0x22602f[_0xe90a('0x19')]]?members[_0x22602f[_0xe90a('0x19')]][_0xe90a('0x7')]:_0x22602f[_0xe90a('0x19')]),_0x22602f);utils[_0xe90a('0x4')](util[_0xe90a('0x5')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x22602f[_0xe90a('0x19')]]?members[_0x22602f[_0xe90a('0x19')]][_0xe90a('0x7')]:_0x22602f[_0xe90a('0x19')],_0x22602f['state'],_0x22602f[_0xe90a('0x19')]));switch(_0x22602f[_0xe90a('0x1a')]){case _0xe90a('0x1b'):case'BUSY':if(!startsWith(exclude,_0x22602f[_0xe90a('0x19')])){members[_0x22602f[_0xe90a('0x19')]]={'channel':_0xe90a('0x1c'),'interface':_0x22602f[_0xe90a('0x19')],'type':_0xe90a('0x1d'),'enterAt':utils[_0xe90a('0x1e')](),'role':'agent'};}break;case _0xe90a('0x1f'):if(!_['isNil'](members[_0x22602f[_0xe90a('0x19')]])){members[_0x22602f[_0xe90a('0x19')]][_0xe90a('0x20')]=utils[_0xe90a('0x1e')]();members[_0x22602f[_0xe90a('0x19')]][_0xe90a('0x21')]=utils['diffTime'](members[_0x22602f[_0xe90a('0x19')]][_0xe90a('0x20')],members[_0x22602f['device']][_0xe90a('0x22')]);if(members[_0x22602f[_0xe90a('0x19')]]['uniqueid']){writeDB(members[_0x22602f[_0xe90a('0x19')]]);}}break;default:break;}}catch(_0xd167a5){utils[_0xe90a('0x23')](util[_0xe90a('0x5')]('[%s][members][devicestatechange]',members[_0x22602f[_0xe90a('0x19')]]?members[_0x22602f[_0xe90a('0x19')]]['uniqueid']:_0x22602f[_0xe90a('0x19')]),_0xd167a5);}};exports[_0xe90a('0x24')]=function(_0x2dac6f){try{if(!_[_0xe90a('0x25')](members[_0x2dac6f[_0xe90a('0x8')]])){utils[_0xe90a('0x17')](util['format'](_0xe90a('0x26'),_0x2dac6f[_0xe90a('0x7')]),_0x2dac6f);utils['info'](util[_0xe90a('0x5')](_0xe90a('0x27'),_0x2dac6f[_0xe90a('0x7')],_0x2dac6f[_0xe90a('0x8')],_0x2dac6f[_0xe90a('0x28')]));members[_0x2dac6f[_0xe90a('0x8')]]=_[_0xe90a('0x29')](members[_0x2dac6f[_0xe90a('0x8')]],{'data4':_0x2dac6f['queue'],'uniqueid':_0x2dac6f[_0xe90a('0x7')]});}}catch(_0x3ac7b6){utils[_0xe90a('0x23')](util[_0xe90a('0x5')]('[%s][members][agentcomplete]',_0x2dac6f[_0xe90a('0x7')]),_0x3ac7b6);}};exports[_0xe90a('0x2a')]=function(_0x1b9dc9){try{utils[_0xe90a('0x17')](util[_0xe90a('0x5')](_0xe90a('0x2b'),_0x1b9dc9[_0xe90a('0x7')]),_0x1b9dc9);if(_0x1b9dc9[_0xe90a('0x9')]){var _0x9cee5=_0x1b9dc9['channel']['split']('-')[0x0];if(!_[_0xe90a('0x25')](members[_0x9cee5])){members[_0x9cee5]=_[_0xe90a('0x29')](members[_0x9cee5],{'data1':members[_0x9cee5][_0xe90a('0x2c')]||_0x1b9dc9[_0xe90a('0xb')],'data2':members[_0x9cee5]['data2']||_0x1b9dc9[_0xe90a('0x2d')],'data3':members[_0x9cee5][_0xe90a('0x2e')]||_0x1b9dc9[_0xe90a('0x2f')],'uniqueid':members[_0x9cee5][_0xe90a('0x7')]||_0x1b9dc9[_0xe90a('0x7')]});utils[_0xe90a('0x4')](util['format'](_0xe90a('0x30'),_0x1b9dc9[_0xe90a('0x7')],members[_0x9cee5][_0xe90a('0x2c')],members[_0x9cee5][_0xe90a('0xa')],members[_0x9cee5]['data3']));if(members[_0x9cee5][_0xe90a('0x20')]){writeDB(members[_0x9cee5]);}}}if(_0x1b9dc9['destinationchannel']){var _0xb70230=_0x1b9dc9[_0xe90a('0x31')][_0xe90a('0x32')]('-')[0x0];if(!_[_0xe90a('0x25')](members[_0xb70230])){members[_0xb70230]=_['assign'](members[_0xb70230],{'data1':members[_0xb70230][_0xe90a('0x2c')]||_0x1b9dc9[_0xe90a('0xb')],'data2':members[_0xb70230][_0xe90a('0xa')]||_0x1b9dc9['source'],'data3':members[_0xb70230]['data3']||_0x1b9dc9['destination'],'uniqueid':members[_0xb70230][_0xe90a('0x7')]||_0x1b9dc9[_0xe90a('0x7')]});utils[_0xe90a('0x4')](util[_0xe90a('0x5')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x1b9dc9[_0xe90a('0x7')],members[_0xb70230][_0xe90a('0x2c')],members[_0xb70230][_0xe90a('0xa')],members[_0xb70230][_0xe90a('0x2e')]));if(members[_0xb70230]['exitAt']){writeDB(members[_0xb70230]);}}}}catch(_0x169ca8){utils['error'](util['format'](_0xe90a('0x2b'),_0x1b9dc9['uniqueid']),_0x169ca8);}}; \ No newline at end of file +var _0x2c6a=['BUSY','TALKING','agent','isNil','exitAt','now','duration','enterAt','agentcomplete','[%s][members][agentcomplete]','queue','assign','data1','data2','source','data3','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','split','destination','[%s][members][cdr]','lodash','util','./utils','Local/_attended@transfer','info','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','type','getUserByInterface','then','membername','internal','request','CreateMemberReport','name','error','format','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE'];(function(_0x3a8789,_0x5bb70b){var _0x19e422=function(_0x49d386){while(--_0x49d386){_0x3a8789['push'](_0x3a8789['shift']());}};_0x19e422(++_0x5bb70b);}(_0x2c6a,0xa7));var _0xa2c6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2c6a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa2c6('0x0'));var util=require(_0xa2c6('0x1'));var utils=require(_0xa2c6('0x2'));var members={};var exclude=[_0xa2c6('0x3'),'Queue:'];function writeDB(_0x54904b){utils[_0xa2c6('0x4')](util['format'](_0xa2c6('0x5'),_0x54904b[_0xa2c6('0x6')],_0x54904b[_0xa2c6('0x7')],_0x54904b[_0xa2c6('0x8')],_0x54904b['data2'],_0x54904b['membername'],_0x54904b[_0xa2c6('0x9')]));if(_0x54904b[_0xa2c6('0x7')]){utils[_0xa2c6('0xa')](_0x54904b[_0xa2c6('0x7')])[_0xa2c6('0xb')](function(_0x40ac01){if(_0x40ac01){_0x54904b[_0xa2c6('0xc')]=_0x40ac01['name'];_0x54904b[_0xa2c6('0xd')]=_0x40ac01[_0xa2c6('0xd')];utils[_0xa2c6('0xe')](_0xa2c6('0xf'),_0x54904b);}else{utils['getUserByName'](_0x54904b[_0xa2c6('0x7')]['split']('/')[0x1])[_0xa2c6('0xb')](function(_0xb638){if(_0xb638){_0x54904b[_0xa2c6('0xc')]=_0xb638[_0xa2c6('0x10')];_0x54904b['internal']=_0xb638[_0xa2c6('0xd')];utils[_0xa2c6('0xe')](_0xa2c6('0xf'),_0x54904b);}});}})['catch'](function(_0x196cf2){utils[_0xa2c6('0x11')](util[_0xa2c6('0x12')](_0xa2c6('0x13'),_0x54904b[_0xa2c6('0x6')]),_0x196cf2);});}delete members[_0x54904b['interface']];}function startsWith(_0x412229,_0x374404){return _[_0xa2c6('0x14')](_0x412229,function(_0x354dff){return _[_0xa2c6('0x15')](_0x374404,_0x354dff);});}exports[_0xa2c6('0x16')]=function(_0x4fd220){try{utils[_0xa2c6('0x17')](util['format'](_0xa2c6('0x18'),members[_0x4fd220[_0xa2c6('0x19')]]?members[_0x4fd220[_0xa2c6('0x19')]][_0xa2c6('0x6')]:_0x4fd220[_0xa2c6('0x19')]),_0x4fd220);utils[_0xa2c6('0x4')](util[_0xa2c6('0x12')](_0xa2c6('0x1a'),members[_0x4fd220['device']]?members[_0x4fd220[_0xa2c6('0x19')]][_0xa2c6('0x6')]:_0x4fd220[_0xa2c6('0x19')],_0x4fd220[_0xa2c6('0x1b')],_0x4fd220[_0xa2c6('0x19')]));switch(_0x4fd220['state']){case _0xa2c6('0x1c'):case _0xa2c6('0x1d'):if(!startsWith(exclude,_0x4fd220['device'])){members[_0x4fd220[_0xa2c6('0x19')]]={'channel':'voice','interface':_0x4fd220[_0xa2c6('0x19')],'type':_0xa2c6('0x1e'),'enterAt':utils['now'](),'role':_0xa2c6('0x1f')};}break;case'NOT_INUSE':if(!_[_0xa2c6('0x20')](members[_0x4fd220[_0xa2c6('0x19')]])){members[_0x4fd220[_0xa2c6('0x19')]][_0xa2c6('0x21')]=utils[_0xa2c6('0x22')]();members[_0x4fd220['device']][_0xa2c6('0x23')]=utils['diffTime'](members[_0x4fd220[_0xa2c6('0x19')]][_0xa2c6('0x21')],members[_0x4fd220['device']][_0xa2c6('0x24')]);if(members[_0x4fd220[_0xa2c6('0x19')]][_0xa2c6('0x6')]){writeDB(members[_0x4fd220[_0xa2c6('0x19')]]);}}break;default:break;}}catch(_0x13e5a4){utils[_0xa2c6('0x11')](util[_0xa2c6('0x12')](_0xa2c6('0x18'),members[_0x4fd220[_0xa2c6('0x19')]]?members[_0x4fd220['device']][_0xa2c6('0x6')]:_0x4fd220[_0xa2c6('0x19')]),_0x13e5a4);}};exports[_0xa2c6('0x25')]=function(_0x3702ec){try{if(!_['isNil'](members[_0x3702ec['interface']])){utils['debug'](util['format'](_0xa2c6('0x26'),_0x3702ec[_0xa2c6('0x6')]),_0x3702ec);utils[_0xa2c6('0x4')](util[_0xa2c6('0x12')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x3702ec[_0xa2c6('0x6')],_0x3702ec[_0xa2c6('0x7')],_0x3702ec[_0xa2c6('0x27')]));members[_0x3702ec[_0xa2c6('0x7')]]=_[_0xa2c6('0x28')](members[_0x3702ec[_0xa2c6('0x7')]],{'data4':_0x3702ec[_0xa2c6('0x27')],'uniqueid':_0x3702ec[_0xa2c6('0x6')]});}}catch(_0xcd7cb){utils['error'](util[_0xa2c6('0x12')](_0xa2c6('0x26'),_0x3702ec[_0xa2c6('0x6')]),_0xcd7cb);}};exports['cdr']=function(_0x3f8bd3){try{utils[_0xa2c6('0x17')](util['format']('[%s][members][cdr]',_0x3f8bd3[_0xa2c6('0x6')]),_0x3f8bd3);if(_0x3f8bd3[_0xa2c6('0x8')]){var _0x37c16c=_0x3f8bd3[_0xa2c6('0x8')]['split']('-')[0x0];if(!_[_0xa2c6('0x20')](members[_0x37c16c])){members[_0x37c16c]=_[_0xa2c6('0x28')](members[_0x37c16c],{'data1':members[_0x37c16c][_0xa2c6('0x29')]||_0x3f8bd3[_0xa2c6('0x9')],'data2':members[_0x37c16c][_0xa2c6('0x2a')]||_0x3f8bd3[_0xa2c6('0x2b')],'data3':members[_0x37c16c][_0xa2c6('0x2c')]||_0x3f8bd3['destination'],'uniqueid':members[_0x37c16c][_0xa2c6('0x6')]||_0x3f8bd3[_0xa2c6('0x6')]});utils[_0xa2c6('0x4')](util[_0xa2c6('0x12')](_0xa2c6('0x2d'),_0x3f8bd3[_0xa2c6('0x6')],members[_0x37c16c][_0xa2c6('0x29')],members[_0x37c16c]['data2'],members[_0x37c16c][_0xa2c6('0x2c')]));if(members[_0x37c16c][_0xa2c6('0x21')]){writeDB(members[_0x37c16c]);}}}if(_0x3f8bd3['destinationchannel']){var _0x139874=_0x3f8bd3['destinationchannel'][_0xa2c6('0x2e')]('-')[0x0];if(!_[_0xa2c6('0x20')](members[_0x139874])){members[_0x139874]=_['assign'](members[_0x139874],{'data1':members[_0x139874][_0xa2c6('0x29')]||_0x3f8bd3[_0xa2c6('0x9')],'data2':members[_0x139874]['data2']||_0x3f8bd3[_0xa2c6('0x2b')],'data3':members[_0x139874][_0xa2c6('0x2c')]||_0x3f8bd3[_0xa2c6('0x2f')],'uniqueid':members[_0x139874]['uniqueid']||_0x3f8bd3[_0xa2c6('0x6')]});utils['info'](util['format'](_0xa2c6('0x2d'),_0x3f8bd3[_0xa2c6('0x6')],members[_0x139874][_0xa2c6('0x29')],members[_0x139874][_0xa2c6('0x2a')],members[_0x139874][_0xa2c6('0x2c')]));if(members[_0x139874][_0xa2c6('0x21')]){writeDB(members[_0x139874]);}}}}catch(_0x47b22c){utils['error'](util[_0xa2c6('0x12')](_0xa2c6('0x30'),_0x3f8bd3['uniqueid']),_0x47b22c);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 751e2bf..15ce077 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 _0x6371=['queuecallerabandon','queuecallerabandonAt','info','name','queueposition','queuecallerexitAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','assigned','destaccountcode','membername','agentcomplete','lastAssignedTo','reason','transfer','COMPLETEDBY','toUpperCase','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','transfereeuniqueid','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][blindtransfer]','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererlinkedid','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','ATTENDED','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]','lodash','./utils','format','uniqueid','channel','queue','calleridnum','accountcode','queuecallerexitreason','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','position','now','error','isNil','queuecallerleaveAt','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','[%s][queues][hangup]','[%s][queues][varset]','variable','queuestatus','value','CONTINUE'];(function(_0x4ef88b,_0x272542){var _0xba292=function(_0x1411c4){while(--_0x1411c4){_0x4ef88b['push'](_0x4ef88b['shift']());}};_0xba292(++_0x272542);}(_0x6371,0x1d4));var _0x1637=function(_0x389832,_0x10a4a9){_0x389832=_0x389832-0x0;var _0x59429e=_0x6371[_0x389832];return _0x59429e;};'use strict';var _=require(_0x1637('0x0'));var util=require('util');var utils=require(_0x1637('0x1'));var queues={};function writeDB(_0x42ff3a){utils['info'](util[_0x1637('0x2')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x42ff3a[_0x1637('0x3')],_0x42ff3a[_0x1637('0x4')],_0x42ff3a[_0x1637('0x5')],_0x42ff3a['lastAssignedTo'],_0x42ff3a[_0x1637('0x6')],_0x42ff3a[_0x1637('0x7')],_0x42ff3a[_0x1637('0x8')]));if(_0x42ff3a[_0x1637('0x5')]){utils['getVoiceQueueByName'](_0x42ff3a['queue'])[_0x1637('0x9')](function(_0x3c983a){if(_0x3c983a){_0x42ff3a[_0x1637('0xa')]=_0x3c983a['type'];}utils[_0x1637('0xb')](_0x1637('0xc'),_0x42ff3a);});}else{utils[_0x1637('0xb')](_0x1637('0xc'),_0x42ff3a);}if(_0x42ff3a[_0x1637('0xd')]){delete queues[_0x42ff3a[_0x1637('0xd')]];}else{delete queues[_0x42ff3a['uniqueid']];}}exports[_0x1637('0xe')]=function(_0x2bde47){try{utils[_0x1637('0xf')](util[_0x1637('0x2')](_0x1637('0x10'),_0x2bde47[_0x1637('0x3')]),_0x2bde47);utils['info'](util[_0x1637('0x2')](_0x1637('0x11'),_0x2bde47[_0x1637('0x3')],_0x2bde47['queue'],_0x2bde47['position']));queues[_0x2bde47[_0x1637('0x3')]]=_[_0x1637('0x12')](_0x2bde47,{'originalposition':_0x2bde47[_0x1637('0x13')],'queuecallerjoinAt':utils[_0x1637('0x14')](),'mohtime':0x0});}catch(_0x56c9e9){utils[_0x1637('0x15')](util[_0x1637('0x2')](_0x1637('0x10'),_0x2bde47[_0x1637('0x3')]),_0x56c9e9);}};exports['hangup']=function(_0x56604b){try{if(!_[_0x1637('0x16')](queues[_0x56604b[_0x1637('0x3')]])){utils['debug'](util['format']('[%s][queues][hangup]',_0x56604b[_0x1637('0x3')]),_0x56604b);if(queues[_0x56604b[_0x1637('0x3')]][_0x1637('0x17')]){if(!queues[_0x56604b[_0x1637('0x3')]]['queuecallerabandon']&&!queues[_0x56604b[_0x1637('0x3')]][_0x1637('0x18')]){queues[_0x56604b[_0x1637('0x3')]][_0x1637('0x19')]=!![];queues[_0x56604b[_0x1637('0x3')]][_0x1637('0x1a')]=utils[_0x1637('0x14')]();queues[_0x56604b['uniqueid']][_0x1637('0x8')]=_0x1637('0x1b');}utils['info'](util[_0x1637('0x2')](_0x1637('0x1c'),_0x56604b[_0x1637('0x3')],queues[_0x56604b['uniqueid']]['name'],queues[_0x56604b['uniqueid']][_0x1637('0x8')]));writeDB(queues[_0x56604b[_0x1637('0x3')]]);}else if(queues[_0x56604b['uniqueid']][_0x1637('0xd')]){utils['info'](util[_0x1637('0x2')](_0x1637('0x1d'),_0x56604b[_0x1637('0x3')],queues[_0x56604b['uniqueid']]['name'],queues[_0x56604b[_0x1637('0x3')]][_0x1637('0xd')]));queues[queues[_0x56604b[_0x1637('0x3')]][_0x1637('0xd')]]=queues[_0x56604b[_0x1637('0x3')]];queues[queues[_0x56604b[_0x1637('0x3')]][_0x1637('0xd')]][_0x1637('0x1e')]=0x2;delete queues[_0x56604b[_0x1637('0x3')]];}}}catch(_0x2bb34e){utils[_0x1637('0x15')](util['format'](_0x1637('0x1f'),_0x56604b[_0x1637('0x3')]),_0x2bb34e);}};exports['varset']=function(_0x197be1){try{utils[_0x1637('0xf')](util['format'](_0x1637('0x20'),_0x197be1['uniqueid']),_0x197be1);if(!_[_0x1637('0x16')](_0x197be1[_0x1637('0x21')][_0x1637('0x22')])&&_0x197be1[_0x1637('0x23')]['toUpperCase']()!==_0x1637('0x24')){if(!_[_0x1637('0x16')](queues[_0x197be1[_0x1637('0x3')]])){queues[_0x197be1[_0x1637('0x3')]][_0x1637('0x25')]=![];queues[_0x197be1[_0x1637('0x3')]][_0x1637('0x26')]=null;queues[_0x197be1[_0x1637('0x3')]]['queuecallerexit']=!![];queues[_0x197be1[_0x1637('0x3')]]['queuecallerexitAt']=utils[_0x1637('0x14')]();queues[_0x197be1[_0x1637('0x3')]]['queuecallerexitreason']=_0x197be1[_0x1637('0x23')]['toUpperCase']();utils[_0x1637('0x27')](util[_0x1637('0x2')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x197be1['uniqueid'],queues[_0x197be1[_0x1637('0x3')]][_0x1637('0x28')],_0x197be1[_0x1637('0x23')],queues[_0x197be1['uniqueid']][_0x1637('0x8')]));writeDB(queues[_0x197be1[_0x1637('0x3')]]);}}else if(!_[_0x1637('0x16')](_0x197be1[_0x1637('0x21')][_0x1637('0x29')])){if(!_[_0x1637('0x16')](queues[_0x197be1[_0x1637('0x3')]])&&!queues[_0x197be1[_0x1637('0x3')]][_0x1637('0x25')]){queues[_0x197be1[_0x1637('0x3')]][_0x1637('0x25')]=![];queues[_0x197be1[_0x1637('0x3')]][_0x1637('0x26')]=null;queues[_0x197be1[_0x1637('0x3')]][_0x1637('0x18')]=!![];queues[_0x197be1[_0x1637('0x3')]][_0x1637('0x2a')]=utils[_0x1637('0x14')]();queues[_0x197be1[_0x1637('0x3')]][_0x1637('0x8')]=_0x1637('0x2b');utils['info'](util[_0x1637('0x2')](_0x1637('0x2c'),_0x197be1[_0x1637('0x3')],queues[_0x197be1[_0x1637('0x3')]][_0x1637('0x28')],_0x197be1[_0x1637('0x23')],queues[_0x197be1[_0x1637('0x3')]][_0x1637('0x8')]));}}}catch(_0x3b5fbf){utils[_0x1637('0x15')](util[_0x1637('0x2')](_0x1637('0x20'),_0x197be1[_0x1637('0x3')]),_0x3b5fbf);}};exports[_0x1637('0x25')]=function(_0x27d755){try{if(!_['isNil'](queues[_0x27d755[_0x1637('0x3')]])){utils[_0x1637('0xf')](util[_0x1637('0x2')](_0x1637('0x2d'),_0x27d755['uniqueid']),_0x27d755);queues[_0x27d755[_0x1637('0x3')]][_0x1637('0x18')]=![];queues[_0x27d755[_0x1637('0x3')]][_0x1637('0x2a')]=null;queues[_0x27d755[_0x1637('0x3')]][_0x1637('0x25')]=!![];queues[_0x27d755[_0x1637('0x3')]][_0x1637('0x26')]=utils[_0x1637('0x14')]();queues[_0x27d755['uniqueid']][_0x1637('0x8')]=_0x1637('0x2e');utils[_0x1637('0x27')](util['format'](_0x1637('0x2f'),_0x27d755[_0x1637('0x3')],queues[_0x27d755['uniqueid']][_0x1637('0x28')],queues[_0x27d755[_0x1637('0x3')]][_0x1637('0x8')]));}}catch(_0x3492f0){utils['error'](util['format'](_0x1637('0x2d'),_0x27d755[_0x1637('0x3')]),_0x3492f0);}};exports[_0x1637('0x30')]=function(_0x6e4b3c){try{if(!_[_0x1637('0x16')](queues[_0x6e4b3c[_0x1637('0x3')]])){utils['debug'](util[_0x1637('0x2')](_0x1637('0x31'),_0x6e4b3c[_0x1637('0x3')]),_0x6e4b3c);utils[_0x1637('0x27')](util[_0x1637('0x2')](_0x1637('0x32'),_0x6e4b3c[_0x1637('0x3')],queues[_0x6e4b3c[_0x1637('0x3')]][_0x1637('0x28')],_0x6e4b3c[_0x1637('0x33')],_0x6e4b3c[_0x1637('0x34')]));queues[_0x6e4b3c[_0x1637('0x3')]]['queuecallerleave']=!![];queues[_0x6e4b3c[_0x1637('0x3')]][_0x1637('0x17')]=utils[_0x1637('0x14')]();queues[_0x6e4b3c[_0x1637('0x3')]][_0x1637('0x35')]=utils[_0x1637('0x36')](queues[_0x6e4b3c['uniqueid']][_0x1637('0x17')],queues[_0x6e4b3c[_0x1637('0x3')]][_0x1637('0x37')]);queues[_0x6e4b3c['uniqueid']][_0x1637('0x13')]=_0x6e4b3c[_0x1637('0x13')];queues[_0x6e4b3c[_0x1637('0x3')]][_0x1637('0x38')]=_0x6e4b3c[_0x1637('0x38')];queues[_0x6e4b3c[_0x1637('0x3')]][_0x1637('0x33')]=_0x6e4b3c[_0x1637('0x33')];queues[_0x6e4b3c[_0x1637('0x3')]][_0x1637('0x34')]=_0x6e4b3c['connectedlinename'];}}catch(_0x3af21f){utils[_0x1637('0x15')](util[_0x1637('0x2')](_0x1637('0x31'),_0x6e4b3c[_0x1637('0x3')]),_0x3af21f);}};exports['agentconnect']=function(_0x52369e){try{if(!_['isNil'](queues[_0x52369e[_0x1637('0x3')]])){utils['debug'](util[_0x1637('0x2')]('[%s][queues][agentconnect]',_0x52369e[_0x1637('0x3')]),_0x52369e);utils[_0x1637('0x27')](util['format'](_0x1637('0x39'),_0x52369e['uniqueid'],queues[_0x52369e[_0x1637('0x3')]]['name'],_0x52369e['membername'],_0x52369e['destaccountcode']));queues[_0x52369e[_0x1637('0x3')]][_0x1637('0x25')]=![];queues[_0x52369e['uniqueid']]['queuecallerabandon']=![];queues[_0x52369e['uniqueid']][_0x1637('0x26')]=null;queues[_0x52369e['uniqueid']][_0x1637('0x18')]=![];queues[_0x52369e[_0x1637('0x3')]][_0x1637('0x8')]=null;queues[_0x52369e[_0x1637('0x3')]][_0x1637('0x2a')]=null;queues[_0x52369e[_0x1637('0x3')]][_0x1637('0x3a')]=!![];queues[_0x52369e[_0x1637('0x3')]]['accountcode']=_0x52369e[_0x1637('0x3b')];queues[_0x52369e[_0x1637('0x3')]]['lastAssignedTo']=_0x52369e[_0x1637('0x3c')];}}catch(_0xa85deb){utils[_0x1637('0x15')](util[_0x1637('0x2')]('[%s][queues][agentconnect]',_0x52369e[_0x1637('0x3')]),_0xa85deb);}};exports[_0x1637('0x3d')]=function(_0x4114cf){try{if(!_[_0x1637('0x16')](queues[_0x4114cf['uniqueid']])){if(queues[_0x4114cf[_0x1637('0x3')]]['queuecallerleaveAt']){utils[_0x1637('0xf')](util[_0x1637('0x2')]('[%s][queues][agentcomplete]',_0x4114cf[_0x1637('0x3')]),_0x4114cf);queues[_0x4114cf['uniqueid']][_0x1637('0x25')]=![];queues[_0x4114cf[_0x1637('0x3')]][_0x1637('0x25')]=![];queues[_0x4114cf[_0x1637('0x3')]]['queuecallerabandonAt']=null;queues[_0x4114cf['uniqueid']][_0x1637('0x18')]=![];queues[_0x4114cf[_0x1637('0x3')]]['queuecallerexitAt']=null;queues[_0x4114cf[_0x1637('0x3')]][_0x1637('0x3a')]=!![];queues[_0x4114cf[_0x1637('0x3')]][_0x1637('0x3e')]=_0x4114cf[_0x1637('0x3c')];queues[_0x4114cf[_0x1637('0x3')]]['queuecallercomplete']=!![];queues[_0x4114cf[_0x1637('0x3')]][_0x1637('0x1a')]=utils[_0x1637('0x14')]();if(_0x4114cf[_0x1637('0x3f')]==_0x1637('0x40')){if(!queues[_0x4114cf[_0x1637('0x3')]][_0x1637('0x40')]){queues[_0x4114cf[_0x1637('0x3')]][_0x1637('0x8')]='TRANSFER';}}else{queues[_0x4114cf[_0x1637('0x3')]][_0x1637('0x8')]=_0x1637('0x41')+_0x4114cf[_0x1637('0x3f')][_0x1637('0x42')]();}utils[_0x1637('0x27')](util[_0x1637('0x2')](_0x1637('0x43'),_0x4114cf[_0x1637('0x3')],queues[_0x4114cf['uniqueid']][_0x1637('0x28')],_0x4114cf['membername'],queues[_0x4114cf[_0x1637('0x3')]][_0x1637('0x8')]));writeDB(queues[_0x4114cf[_0x1637('0x3')]]);}}}catch(_0x17703b){utils[_0x1637('0x15')](util['format'](_0x1637('0x44'),_0x4114cf['uniqueid']),_0x17703b);}};exports['blindtransfer']=function(_0x493a89){try{if(!_[_0x1637('0x16')](queues[_0x493a89['transfereeuniqueid']])){utils[_0x1637('0xf')](util[_0x1637('0x2')]('[%s][queues][blindtransfer]',_0x493a89['uniqueid']),_0x493a89);queues[_0x493a89[_0x1637('0x45')]]['transfer']=!![];queues[_0x493a89[_0x1637('0x45')]][_0x1637('0x46')]=_0x1637('0x47');queues[_0x493a89[_0x1637('0x45')]][_0x1637('0x48')]=_0x493a89[_0x1637('0x49')];queues[_0x493a89[_0x1637('0x45')]][_0x1637('0x4a')]=_0x493a89[_0x1637('0x45')];queues[_0x493a89['transfereeuniqueid']][_0x1637('0x8')]=_0x1637('0x4b');utils['info'](util[_0x1637('0x2')](_0x1637('0x4c'),_0x493a89[_0x1637('0x3')],queues[_0x493a89[_0x1637('0x45')]][_0x1637('0x28')],_0x493a89[_0x1637('0x45')],_0x493a89['extension']));}}catch(_0x173891){utils[_0x1637('0x15')](util[_0x1637('0x2')](_0x1637('0x4d'),_0x493a89[_0x1637('0x3')]),_0x173891);}};exports[_0x1637('0x4e')]=function(_0x5580c2){try{utils[_0x1637('0xf')](util[_0x1637('0x2')](_0x1637('0x4f'),_0x5580c2[_0x1637('0x50')]),_0x5580c2);if(_0x5580c2['origtransfereruniqueid']==_0x5580c2[_0x1637('0x51')]){if(!_['isNil'](queues[_0x5580c2['secondtransfererlinkedid']])){utils[_0x1637('0x27')](util[_0x1637('0x2')](_0x1637('0x52'),_0x5580c2[_0x1637('0x50')],queues[_0x5580c2[_0x1637('0x53')]]['name'],_0x5580c2[_0x1637('0x54')]));queues[_0x5580c2[_0x1637('0x53')]][_0x1637('0x40')]=!![];queues[_0x5580c2['secondtransfererlinkedid']]['transfertype']='ATTENDED';queues[_0x5580c2[_0x1637('0x53')]]['transferexten']=_0x5580c2[_0x1637('0x54')];queues[_0x5580c2[_0x1637('0x53')]]['transferuniqueid']=_0x5580c2['origtransfereruniqueid'];queues[_0x5580c2['secondtransfererlinkedid']][_0x1637('0x8')]=_0x1637('0x55');}if(!_[_0x1637('0x16')](queues[_0x5580c2[_0x1637('0x51')]])){if(_0x5580c2['transfereelinkedid']&&queues[_0x5580c2[_0x1637('0x56')]]){queues[_0x5580c2[_0x1637('0x56')]][_0x1637('0x1e')]=0x1;queues[_0x5580c2['transfereeuniqueid']]=_[_0x1637('0x57')](queues[_0x5580c2[_0x1637('0x56')]]);queues[_0x5580c2[_0x1637('0x45')]][_0x1637('0xd')]=_0x5580c2[_0x1637('0x58')];queues[_0x5580c2[_0x1637('0x45')]]['queuecallerenterreason']=0x2;queues[_0x5580c2[_0x1637('0x45')]][_0x1637('0x6')]=queues[_0x5580c2['secondtransfererlinkedid']][_0x1637('0x6')];queues[_0x5580c2[_0x1637('0x45')]]['calleridname']=queues[_0x5580c2[_0x1637('0x53')]][_0x1637('0x59')];queues[_0x5580c2[_0x1637('0x45')]][_0x1637('0x37')]=utils[_0x1637('0x14')]();queues[_0x5580c2[_0x1637('0x45')]][_0x1637('0x17')]=utils['now']();queues[_0x5580c2[_0x1637('0x45')]]['holdtime']=0x0;queues[_0x5580c2[_0x1637('0x45')]][_0x1637('0x5a')]=0x0;utils[_0x1637('0x27')](util[_0x1637('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x5580c2['origtransfereruniqueid'],queues[_0x5580c2[_0x1637('0x45')]]['name'],queues[_0x5580c2[_0x1637('0x45')]][_0x1637('0x6')],queues[_0x5580c2[_0x1637('0x45')]][_0x1637('0x59')]));}else{utils[_0x1637('0x27')](util[_0x1637('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x5580c2['origtransfereruniqueid'],queues[_0x5580c2['origtransfererlinkedid']][_0x1637('0x28')],_0x5580c2[_0x1637('0x53')]));queues[_0x5580c2[_0x1637('0x51')]]['transfereduniqueid']=_0x5580c2[_0x1637('0x53')];}}}else if(_0x5580c2[_0x1637('0x5b')]==_0x5580c2['secondtransfererlinkedid']){if(!_[_0x1637('0x16')](queues[_0x5580c2[_0x1637('0x51')]])){utils['info'](util[_0x1637('0x2')](_0x1637('0x5c'),_0x5580c2['origtransfereruniqueid'],queues[_0x5580c2['origtransfererlinkedid']][_0x1637('0x28')],_0x5580c2[_0x1637('0x5b')],_0x5580c2[_0x1637('0x5d')]));queues[_0x5580c2[_0x1637('0x51')]][_0x1637('0x40')]=!![];queues[_0x5580c2['origtransfererlinkedid']][_0x1637('0x46')]=_0x1637('0x5e');queues[_0x5580c2['origtransfererlinkedid']][_0x1637('0x48')]=_0x5580c2[_0x1637('0x5d')];queues[_0x5580c2['origtransfererlinkedid']]['transferuniqueid']=_0x5580c2[_0x1637('0x5b')];queues[_0x5580c2['origtransfererlinkedid']][_0x1637('0x8')]=_0x1637('0x55');}if(!_[_0x1637('0x16')](queues[_0x5580c2[_0x1637('0x53')]])){if(_0x5580c2[_0x1637('0x5f')]&&queues[_0x5580c2[_0x1637('0x5f')]]){queues[_0x5580c2[_0x1637('0x5f')]]['queuecallerenterreason']=0x1;queues[_0x5580c2['transfertargetuniqueid']]=_[_0x1637('0x57')](queues[_0x5580c2[_0x1637('0x5f')]]);queues[_0x5580c2[_0x1637('0x58')]][_0x1637('0xd')]=_0x5580c2[_0x1637('0x58')];queues[_0x5580c2[_0x1637('0x58')]][_0x1637('0x1e')]=0x2;queues[_0x5580c2[_0x1637('0x58')]][_0x1637('0x6')]=queues[_0x5580c2[_0x1637('0x51')]][_0x1637('0x6')];queues[_0x5580c2[_0x1637('0x58')]][_0x1637('0x59')]=queues[_0x5580c2[_0x1637('0x51')]][_0x1637('0x59')];queues[_0x5580c2['transfertargetuniqueid']]['queuecallerjoinAt']=utils[_0x1637('0x14')]();queues[_0x5580c2['transfertargetuniqueid']]['queuecallerleaveAt']=utils[_0x1637('0x14')]();queues[_0x5580c2[_0x1637('0x58')]][_0x1637('0x35')]=0x0;queues[_0x5580c2[_0x1637('0x58')]][_0x1637('0x5a')]=0x0;utils[_0x1637('0x27')](util[_0x1637('0x2')](_0x1637('0x60'),_0x5580c2[_0x1637('0x50')],queues[_0x5580c2[_0x1637('0x58')]]['name'],queues[_0x5580c2[_0x1637('0x58')]][_0x1637('0xd')],queues[_0x5580c2['transfertargetuniqueid']]['calleridnum'],queues[_0x5580c2[_0x1637('0x58')]][_0x1637('0x59')]));}else{utils['info'](util['format'](_0x1637('0x61'),_0x5580c2[_0x1637('0x50')],queues[_0x5580c2[_0x1637('0x53')]][_0x1637('0x28')],_0x5580c2[_0x1637('0x51')]));queues[_0x5580c2[_0x1637('0x53')]][_0x1637('0xd')]=_0x5580c2[_0x1637('0x51')];}}}}catch(_0x25f4fa){utils[_0x1637('0x15')](util[_0x1637('0x2')](_0x1637('0x4f'),_0x5580c2['origtransfereruniqueid']),_0x25f4fa);}};exports['musiconholdstart']=function(_0x3b59af){try{if(!_[_0x1637('0x16')](queues[_0x3b59af[_0x1637('0x3')]])){utils['debug'](util[_0x1637('0x2')](_0x1637('0x62'),_0x3b59af[_0x1637('0x3')]),_0x3b59af);queues[_0x3b59af[_0x1637('0x3')]][_0x1637('0x63')]=utils[_0x1637('0x14')]();utils[_0x1637('0x27')](util[_0x1637('0x2')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x3b59af[_0x1637('0x3')],queues[_0x3b59af['uniqueid']]['name'],queues[_0x3b59af[_0x1637('0x3')]][_0x1637('0x63')]));}}catch(_0x39256e){utils[_0x1637('0x15')](util[_0x1637('0x2')](_0x1637('0x62'),_0x3b59af[_0x1637('0x3')]),_0x39256e);}};exports['musiconholdstop']=function(_0x5ddd4a){try{if(!_[_0x1637('0x16')](queues[_0x5ddd4a[_0x1637('0x3')]])){if(!_[_0x1637('0x16')](queues[_0x5ddd4a['uniqueid']][_0x1637('0x63')])){utils[_0x1637('0xf')](util[_0x1637('0x2')](_0x1637('0x64'),_0x5ddd4a[_0x1637('0x3')]),_0x5ddd4a);queues[_0x5ddd4a[_0x1637('0x3')]][_0x1637('0x5a')]+=utils[_0x1637('0x36')](utils['now'](),queues[_0x5ddd4a[_0x1637('0x3')]][_0x1637('0x63')]);utils[_0x1637('0x27')](util[_0x1637('0x2')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x5ddd4a['uniqueid'],queues[_0x5ddd4a[_0x1637('0x3')]][_0x1637('0x28')],queues[_0x5ddd4a['uniqueid']][_0x1637('0x5a')]));delete queues[_0x5ddd4a['uniqueid']][_0x1637('0x63')];}}}catch(_0x33765c){utils[_0x1637('0x15')](util[_0x1637('0x2')](_0x1637('0x64'),_0x5ddd4a[_0x1637('0x3')]),_0x33765c);}}; \ No newline at end of file +var _0x3538=['then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','queuecallerexitreason','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','[%s][queues][hangup]','[%s][queues][varset]','isNil','variable','queuestatus','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','value','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','queuecallerleave','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','queuecallerleaveAt','holdtime','diffTime','queuecallerjoinAt','count','connectedlinename','[%s][queues][queuecallerleave]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','[%s][queues][agentconnect]','agentcomplete','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererlinkedid','origtransfererexten','ATTENDED','transfereelinkedid','clone','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][attendedtransfer]','musiconholdstart','[%s][queues][musiconholdstart]','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','getVoiceQueueByName'];(function(_0x3f8298,_0x3e6b7c){var _0x4a71ab=function(_0x56ec21){while(--_0x56ec21){_0x3f8298['push'](_0x3f8298['shift']());}};_0x4a71ab(++_0x3e6b7c);}(_0x3538,0x131));var _0x8353=function(_0x5dfa3b,_0x43fbd4){_0x5dfa3b=_0x5dfa3b-0x0;var _0x3577dc=_0x3538[_0x5dfa3b];return _0x3577dc;};'use strict';var _=require(_0x8353('0x0'));var util=require(_0x8353('0x1'));var utils=require(_0x8353('0x2'));var queues={};function writeDB(_0x3ae7bc){utils[_0x8353('0x3')](util[_0x8353('0x4')](_0x8353('0x5'),_0x3ae7bc[_0x8353('0x6')],_0x3ae7bc[_0x8353('0x7')],_0x3ae7bc[_0x8353('0x8')],_0x3ae7bc[_0x8353('0x9')],_0x3ae7bc[_0x8353('0xa')],_0x3ae7bc[_0x8353('0xb')],_0x3ae7bc['queuecallerexitreason']));if(_0x3ae7bc[_0x8353('0x8')]){utils[_0x8353('0xc')](_0x3ae7bc[_0x8353('0x8')])[_0x8353('0xd')](function(_0x134d76){if(_0x134d76){_0x3ae7bc['type']=_0x134d76[_0x8353('0xe')];}utils[_0x8353('0xf')](_0x8353('0x10'),_0x3ae7bc);});}else{utils[_0x8353('0xf')](_0x8353('0x10'),_0x3ae7bc);}if(_0x3ae7bc[_0x8353('0x11')]){delete queues[_0x3ae7bc[_0x8353('0x11')]];}else{delete queues[_0x3ae7bc[_0x8353('0x6')]];}}exports[_0x8353('0x12')]=function(_0x528f86){try{utils[_0x8353('0x13')](util['format'](_0x8353('0x14'),_0x528f86[_0x8353('0x6')]),_0x528f86);utils['info'](util[_0x8353('0x4')](_0x8353('0x15'),_0x528f86[_0x8353('0x6')],_0x528f86[_0x8353('0x8')],_0x528f86[_0x8353('0x16')]));queues[_0x528f86[_0x8353('0x6')]]=_[_0x8353('0x17')](_0x528f86,{'originalposition':_0x528f86[_0x8353('0x16')],'queuecallerjoinAt':utils[_0x8353('0x18')](),'mohtime':0x0});}catch(_0x196bbc){utils[_0x8353('0x19')](util[_0x8353('0x4')]('[%s][queues][queuecallerjoin]',_0x528f86['uniqueid']),_0x196bbc);}};exports[_0x8353('0x1a')]=function(_0x8f5c28){try{if(!_['isNil'](queues[_0x8f5c28[_0x8353('0x6')]])){utils['debug'](util['format']('[%s][queues][hangup]',_0x8f5c28[_0x8353('0x6')]),_0x8f5c28);if(queues[_0x8f5c28[_0x8353('0x6')]]['queuecallerleaveAt']){if(!queues[_0x8f5c28['uniqueid']][_0x8353('0x1b')]&&!queues[_0x8f5c28[_0x8353('0x6')]][_0x8353('0x1c')]){queues[_0x8f5c28['uniqueid']][_0x8353('0x1d')]=!![];queues[_0x8f5c28['uniqueid']][_0x8353('0x1e')]=utils[_0x8353('0x18')]();queues[_0x8f5c28[_0x8353('0x6')]][_0x8353('0x1f')]='COMPLETEDBYAGENT';}utils[_0x8353('0x3')](util[_0x8353('0x4')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x8f5c28[_0x8353('0x6')],queues[_0x8f5c28['uniqueid']][_0x8353('0x20')],queues[_0x8f5c28[_0x8353('0x6')]][_0x8353('0x1f')]));writeDB(queues[_0x8f5c28[_0x8353('0x6')]]);}else if(queues[_0x8f5c28[_0x8353('0x6')]][_0x8353('0x11')]){utils[_0x8353('0x3')](util[_0x8353('0x4')](_0x8353('0x21'),_0x8f5c28[_0x8353('0x6')],queues[_0x8f5c28[_0x8353('0x6')]][_0x8353('0x20')],queues[_0x8f5c28[_0x8353('0x6')]][_0x8353('0x11')]));queues[queues[_0x8f5c28['uniqueid']]['transfereduniqueid']]=queues[_0x8f5c28[_0x8353('0x6')]];queues[queues[_0x8f5c28[_0x8353('0x6')]][_0x8353('0x11')]][_0x8353('0x22')]=0x2;delete queues[_0x8f5c28[_0x8353('0x6')]];}}}catch(_0x78397e){utils[_0x8353('0x19')](util[_0x8353('0x4')](_0x8353('0x23'),_0x8f5c28[_0x8353('0x6')]),_0x78397e);}};exports['varset']=function(_0x59e4ca){try{utils[_0x8353('0x13')](util[_0x8353('0x4')](_0x8353('0x24'),_0x59e4ca[_0x8353('0x6')]),_0x59e4ca);if(!_[_0x8353('0x25')](_0x59e4ca[_0x8353('0x26')][_0x8353('0x27')])&&_0x59e4ca['value'][_0x8353('0x28')]()!==_0x8353('0x29')){if(!_[_0x8353('0x25')](queues[_0x59e4ca[_0x8353('0x6')]])){queues[_0x59e4ca[_0x8353('0x6')]]['queuecallerabandon']=![];queues[_0x59e4ca['uniqueid']][_0x8353('0x2a')]=null;queues[_0x59e4ca[_0x8353('0x6')]][_0x8353('0x1c')]=!![];queues[_0x59e4ca['uniqueid']][_0x8353('0x2b')]=utils['now']();queues[_0x59e4ca[_0x8353('0x6')]][_0x8353('0x1f')]=_0x59e4ca[_0x8353('0x2c')][_0x8353('0x28')]();utils[_0x8353('0x3')](util[_0x8353('0x4')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x59e4ca['uniqueid'],queues[_0x59e4ca[_0x8353('0x6')]][_0x8353('0x20')],_0x59e4ca['value'],queues[_0x59e4ca[_0x8353('0x6')]]['queuecallerexitreason']));writeDB(queues[_0x59e4ca[_0x8353('0x6')]]);}}else if(!_[_0x8353('0x25')](_0x59e4ca[_0x8353('0x26')][_0x8353('0x2d')])){if(!_[_0x8353('0x25')](queues[_0x59e4ca['uniqueid']])&&!queues[_0x59e4ca[_0x8353('0x6')]][_0x8353('0x1b')]){queues[_0x59e4ca[_0x8353('0x6')]][_0x8353('0x1b')]=![];queues[_0x59e4ca[_0x8353('0x6')]][_0x8353('0x2a')]=null;queues[_0x59e4ca[_0x8353('0x6')]][_0x8353('0x1c')]=!![];queues[_0x59e4ca[_0x8353('0x6')]][_0x8353('0x2b')]=utils[_0x8353('0x18')]();queues[_0x59e4ca[_0x8353('0x6')]][_0x8353('0x1f')]=_0x8353('0x2e');utils[_0x8353('0x3')](util[_0x8353('0x4')](_0x8353('0x2f'),_0x59e4ca[_0x8353('0x6')],queues[_0x59e4ca[_0x8353('0x6')]][_0x8353('0x20')],_0x59e4ca['value'],queues[_0x59e4ca['uniqueid']][_0x8353('0x1f')]));}}}catch(_0x2cb72c){utils['error'](util['format'](_0x8353('0x24'),_0x59e4ca['uniqueid']),_0x2cb72c);}};exports['queuecallerabandon']=function(_0xe775e7){try{if(!_['isNil'](queues[_0xe775e7[_0x8353('0x6')]])){utils['debug'](util[_0x8353('0x4')](_0x8353('0x30'),_0xe775e7[_0x8353('0x6')]),_0xe775e7);queues[_0xe775e7[_0x8353('0x6')]][_0x8353('0x1c')]=![];queues[_0xe775e7[_0x8353('0x6')]][_0x8353('0x2b')]=null;queues[_0xe775e7['uniqueid']]['queuecallerabandon']=!![];queues[_0xe775e7[_0x8353('0x6')]][_0x8353('0x2a')]=utils[_0x8353('0x18')]();queues[_0xe775e7['uniqueid']][_0x8353('0x1f')]='ABANDONED';utils[_0x8353('0x3')](util[_0x8353('0x4')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0xe775e7[_0x8353('0x6')],queues[_0xe775e7[_0x8353('0x6')]][_0x8353('0x20')],queues[_0xe775e7[_0x8353('0x6')]][_0x8353('0x1f')]));}}catch(_0x5da6bc){utils['error'](util[_0x8353('0x4')](_0x8353('0x30'),_0xe775e7[_0x8353('0x6')]),_0x5da6bc);}};exports[_0x8353('0x31')]=function(_0x5574a2){try{if(!_['isNil'](queues[_0x5574a2[_0x8353('0x6')]])){utils[_0x8353('0x13')](util['format']('[%s][queues][queuecallerleave]',_0x5574a2['uniqueid']),_0x5574a2);utils[_0x8353('0x3')](util[_0x8353('0x4')](_0x8353('0x32'),_0x5574a2[_0x8353('0x6')],queues[_0x5574a2[_0x8353('0x6')]]['name'],_0x5574a2[_0x8353('0x33')],_0x5574a2['connectedlinename']));queues[_0x5574a2[_0x8353('0x6')]]['queuecallerleave']=!![];queues[_0x5574a2['uniqueid']][_0x8353('0x34')]=utils[_0x8353('0x18')]();queues[_0x5574a2[_0x8353('0x6')]][_0x8353('0x35')]=utils[_0x8353('0x36')](queues[_0x5574a2[_0x8353('0x6')]][_0x8353('0x34')],queues[_0x5574a2['uniqueid']][_0x8353('0x37')]);queues[_0x5574a2[_0x8353('0x6')]]['position']=_0x5574a2[_0x8353('0x16')];queues[_0x5574a2[_0x8353('0x6')]][_0x8353('0x38')]=_0x5574a2[_0x8353('0x38')];queues[_0x5574a2[_0x8353('0x6')]][_0x8353('0x33')]=_0x5574a2[_0x8353('0x33')];queues[_0x5574a2[_0x8353('0x6')]]['connectedlinename']=_0x5574a2[_0x8353('0x39')];}}catch(_0x2d71d4){utils[_0x8353('0x19')](util['format'](_0x8353('0x3a'),_0x5574a2[_0x8353('0x6')]),_0x2d71d4);}};exports['agentconnect']=function(_0x16be5a){try{if(!_[_0x8353('0x25')](queues[_0x16be5a[_0x8353('0x6')]])){utils[_0x8353('0x13')](util[_0x8353('0x4')]('[%s][queues][agentconnect]',_0x16be5a['uniqueid']),_0x16be5a);utils[_0x8353('0x3')](util[_0x8353('0x4')](_0x8353('0x3b'),_0x16be5a[_0x8353('0x6')],queues[_0x16be5a[_0x8353('0x6')]][_0x8353('0x20')],_0x16be5a[_0x8353('0x3c')],_0x16be5a[_0x8353('0x3d')]));queues[_0x16be5a[_0x8353('0x6')]][_0x8353('0x1b')]=![];queues[_0x16be5a[_0x8353('0x6')]][_0x8353('0x1b')]=![];queues[_0x16be5a['uniqueid']][_0x8353('0x2a')]=null;queues[_0x16be5a['uniqueid']]['queuecallerexit']=![];queues[_0x16be5a[_0x8353('0x6')]][_0x8353('0x1f')]=null;queues[_0x16be5a[_0x8353('0x6')]][_0x8353('0x2b')]=null;queues[_0x16be5a[_0x8353('0x6')]][_0x8353('0x3e')]=!![];queues[_0x16be5a[_0x8353('0x6')]][_0x8353('0xb')]=_0x16be5a['destaccountcode'];queues[_0x16be5a[_0x8353('0x6')]][_0x8353('0x9')]=_0x16be5a[_0x8353('0x3c')];}}catch(_0x46a56a){utils[_0x8353('0x19')](util[_0x8353('0x4')](_0x8353('0x3f'),_0x16be5a[_0x8353('0x6')]),_0x46a56a);}};exports[_0x8353('0x40')]=function(_0x3c8b87){try{if(!_[_0x8353('0x25')](queues[_0x3c8b87[_0x8353('0x6')]])){if(queues[_0x3c8b87[_0x8353('0x6')]][_0x8353('0x34')]){utils[_0x8353('0x13')](util['format']('[%s][queues][agentcomplete]',_0x3c8b87[_0x8353('0x6')]),_0x3c8b87);queues[_0x3c8b87[_0x8353('0x6')]][_0x8353('0x1b')]=![];queues[_0x3c8b87[_0x8353('0x6')]][_0x8353('0x1b')]=![];queues[_0x3c8b87['uniqueid']][_0x8353('0x2a')]=null;queues[_0x3c8b87['uniqueid']][_0x8353('0x1c')]=![];queues[_0x3c8b87[_0x8353('0x6')]][_0x8353('0x2b')]=null;queues[_0x3c8b87['uniqueid']][_0x8353('0x3e')]=!![];queues[_0x3c8b87[_0x8353('0x6')]][_0x8353('0x9')]=_0x3c8b87[_0x8353('0x3c')];queues[_0x3c8b87[_0x8353('0x6')]][_0x8353('0x1d')]=!![];queues[_0x3c8b87[_0x8353('0x6')]]['queuecallercompleteAt']=utils['now']();if(_0x3c8b87[_0x8353('0x41')]==_0x8353('0x42')){if(!queues[_0x3c8b87['uniqueid']][_0x8353('0x42')]){queues[_0x3c8b87[_0x8353('0x6')]][_0x8353('0x1f')]=_0x8353('0x43');}}else{queues[_0x3c8b87[_0x8353('0x6')]][_0x8353('0x1f')]=_0x8353('0x44')+_0x3c8b87[_0x8353('0x41')]['toUpperCase']();}utils['info'](util[_0x8353('0x4')](_0x8353('0x45'),_0x3c8b87[_0x8353('0x6')],queues[_0x3c8b87['uniqueid']][_0x8353('0x20')],_0x3c8b87['membername'],queues[_0x3c8b87[_0x8353('0x6')]][_0x8353('0x1f')]));writeDB(queues[_0x3c8b87[_0x8353('0x6')]]);}}}catch(_0x4dbce0){utils[_0x8353('0x19')](util['format'](_0x8353('0x46'),_0x3c8b87[_0x8353('0x6')]),_0x4dbce0);}};exports['blindtransfer']=function(_0x136eea){try{if(!_[_0x8353('0x25')](queues[_0x136eea[_0x8353('0x47')]])){utils['debug'](util[_0x8353('0x4')](_0x8353('0x48'),_0x136eea[_0x8353('0x6')]),_0x136eea);queues[_0x136eea[_0x8353('0x47')]][_0x8353('0x42')]=!![];queues[_0x136eea['transfereeuniqueid']][_0x8353('0x49')]=_0x8353('0x4a');queues[_0x136eea[_0x8353('0x47')]][_0x8353('0x4b')]=_0x136eea[_0x8353('0x4c')];queues[_0x136eea[_0x8353('0x47')]][_0x8353('0x4d')]=_0x136eea[_0x8353('0x47')];queues[_0x136eea['transfereeuniqueid']][_0x8353('0x1f')]=_0x8353('0x4e');utils['info'](util[_0x8353('0x4')](_0x8353('0x4f'),_0x136eea[_0x8353('0x6')],queues[_0x136eea['transfereeuniqueid']][_0x8353('0x20')],_0x136eea[_0x8353('0x47')],_0x136eea[_0x8353('0x4c')]));}}catch(_0x293eb2){utils[_0x8353('0x19')](util[_0x8353('0x4')](_0x8353('0x48'),_0x136eea[_0x8353('0x6')]),_0x293eb2);}};exports[_0x8353('0x50')]=function(_0x5dcda4){try{utils[_0x8353('0x13')](util[_0x8353('0x4')]('[%s][queues][attendedtransfer]',_0x5dcda4[_0x8353('0x51')]),_0x5dcda4);if(_0x5dcda4[_0x8353('0x51')]==_0x5dcda4[_0x8353('0x52')]){if(!_[_0x8353('0x25')](queues[_0x5dcda4['secondtransfererlinkedid']])){utils[_0x8353('0x3')](util[_0x8353('0x4')](_0x8353('0x53'),_0x5dcda4[_0x8353('0x51')],queues[_0x5dcda4[_0x8353('0x54')]][_0x8353('0x20')],_0x5dcda4[_0x8353('0x55')]));queues[_0x5dcda4[_0x8353('0x54')]]['transfer']=!![];queues[_0x5dcda4[_0x8353('0x54')]][_0x8353('0x49')]=_0x8353('0x56');queues[_0x5dcda4[_0x8353('0x54')]][_0x8353('0x4b')]=_0x5dcda4[_0x8353('0x55')];queues[_0x5dcda4[_0x8353('0x54')]][_0x8353('0x4d')]=_0x5dcda4[_0x8353('0x51')];queues[_0x5dcda4[_0x8353('0x54')]][_0x8353('0x1f')]='ATTENDEDTRANSFER';}if(!_[_0x8353('0x25')](queues[_0x5dcda4[_0x8353('0x52')]])){if(_0x5dcda4[_0x8353('0x57')]&&queues[_0x5dcda4[_0x8353('0x57')]]){queues[_0x5dcda4[_0x8353('0x57')]]['queuecallerenterreason']=0x1;queues[_0x5dcda4[_0x8353('0x47')]]=_[_0x8353('0x58')](queues[_0x5dcda4[_0x8353('0x57')]]);queues[_0x5dcda4[_0x8353('0x47')]][_0x8353('0x11')]=_0x5dcda4['transfertargetuniqueid'];queues[_0x5dcda4[_0x8353('0x47')]][_0x8353('0x22')]=0x2;queues[_0x5dcda4[_0x8353('0x47')]]['calleridnum']=queues[_0x5dcda4[_0x8353('0x54')]][_0x8353('0xa')];queues[_0x5dcda4[_0x8353('0x47')]][_0x8353('0x59')]=queues[_0x5dcda4[_0x8353('0x54')]][_0x8353('0x59')];queues[_0x5dcda4[_0x8353('0x47')]]['queuecallerjoinAt']=utils[_0x8353('0x18')]();queues[_0x5dcda4[_0x8353('0x47')]][_0x8353('0x34')]=utils['now']();queues[_0x5dcda4[_0x8353('0x47')]]['holdtime']=0x0;queues[_0x5dcda4[_0x8353('0x47')]][_0x8353('0x5a')]=0x0;utils['info'](util['format'](_0x8353('0x5b'),_0x5dcda4['origtransfereruniqueid'],queues[_0x5dcda4[_0x8353('0x47')]][_0x8353('0x20')],queues[_0x5dcda4[_0x8353('0x47')]]['calleridnum'],queues[_0x5dcda4[_0x8353('0x47')]][_0x8353('0x59')]));}else{utils['info'](util[_0x8353('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x5dcda4[_0x8353('0x51')],queues[_0x5dcda4['origtransfererlinkedid']]['name'],_0x5dcda4[_0x8353('0x54')]));queues[_0x5dcda4['origtransfererlinkedid']][_0x8353('0x11')]=_0x5dcda4['secondtransfererlinkedid'];}}}else if(_0x5dcda4[_0x8353('0x5c')]==_0x5dcda4['secondtransfererlinkedid']){if(!_['isNil'](queues[_0x5dcda4['origtransfererlinkedid']])){utils['info'](util[_0x8353('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x5dcda4['origtransfereruniqueid'],queues[_0x5dcda4[_0x8353('0x52')]][_0x8353('0x20')],_0x5dcda4[_0x8353('0x5c')],_0x5dcda4['secondtransfererexten']));queues[_0x5dcda4['origtransfererlinkedid']][_0x8353('0x42')]=!![];queues[_0x5dcda4[_0x8353('0x52')]]['transfertype']=_0x8353('0x56');queues[_0x5dcda4[_0x8353('0x52')]]['transferexten']=_0x5dcda4[_0x8353('0x5d')];queues[_0x5dcda4['origtransfererlinkedid']][_0x8353('0x4d')]=_0x5dcda4[_0x8353('0x5c')];queues[_0x5dcda4[_0x8353('0x52')]]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_[_0x8353('0x25')](queues[_0x5dcda4[_0x8353('0x54')]])){if(_0x5dcda4[_0x8353('0x5e')]&&queues[_0x5dcda4['transfertargetlinkedid']]){queues[_0x5dcda4[_0x8353('0x5e')]][_0x8353('0x22')]=0x1;queues[_0x5dcda4[_0x8353('0x5f')]]=_['clone'](queues[_0x5dcda4['transfertargetlinkedid']]);queues[_0x5dcda4['transfertargetuniqueid']][_0x8353('0x11')]=_0x5dcda4[_0x8353('0x5f')];queues[_0x5dcda4[_0x8353('0x5f')]][_0x8353('0x22')]=0x2;queues[_0x5dcda4[_0x8353('0x5f')]][_0x8353('0xa')]=queues[_0x5dcda4[_0x8353('0x52')]][_0x8353('0xa')];queues[_0x5dcda4[_0x8353('0x5f')]][_0x8353('0x59')]=queues[_0x5dcda4[_0x8353('0x52')]][_0x8353('0x59')];queues[_0x5dcda4['transfertargetuniqueid']]['queuecallerjoinAt']=utils[_0x8353('0x18')]();queues[_0x5dcda4[_0x8353('0x5f')]][_0x8353('0x34')]=utils[_0x8353('0x18')]();queues[_0x5dcda4[_0x8353('0x5f')]][_0x8353('0x35')]=0x0;queues[_0x5dcda4[_0x8353('0x5f')]][_0x8353('0x5a')]=0x0;utils[_0x8353('0x3')](util['format'](_0x8353('0x60'),_0x5dcda4[_0x8353('0x51')],queues[_0x5dcda4['transfertargetuniqueid']][_0x8353('0x20')],queues[_0x5dcda4[_0x8353('0x5f')]]['transfereduniqueid'],queues[_0x5dcda4['transfertargetuniqueid']][_0x8353('0xa')],queues[_0x5dcda4['transfertargetuniqueid']]['calleridname']));}else{utils['info'](util[_0x8353('0x4')](_0x8353('0x61'),_0x5dcda4[_0x8353('0x51')],queues[_0x5dcda4[_0x8353('0x54')]][_0x8353('0x20')],_0x5dcda4['origtransfererlinkedid']));queues[_0x5dcda4['secondtransfererlinkedid']][_0x8353('0x11')]=_0x5dcda4[_0x8353('0x52')];}}}}catch(_0x225f81){utils[_0x8353('0x19')](util[_0x8353('0x4')](_0x8353('0x62'),_0x5dcda4['origtransfereruniqueid']),_0x225f81);}};exports[_0x8353('0x63')]=function(_0x5317fe){try{if(!_[_0x8353('0x25')](queues[_0x5317fe[_0x8353('0x6')]])){utils[_0x8353('0x13')](util['format'](_0x8353('0x64'),_0x5317fe[_0x8353('0x6')]),_0x5317fe);queues[_0x5317fe[_0x8353('0x6')]]['musiconholdstartAt']=utils['now']();utils['info'](util['format'](_0x8353('0x65'),_0x5317fe[_0x8353('0x6')],queues[_0x5317fe[_0x8353('0x6')]][_0x8353('0x20')],queues[_0x5317fe[_0x8353('0x6')]][_0x8353('0x66')]));}}catch(_0x16ac28){utils[_0x8353('0x19')](util[_0x8353('0x4')]('[%s][queues][musiconholdstart]',_0x5317fe[_0x8353('0x6')]),_0x16ac28);}};exports[_0x8353('0x67')]=function(_0x50018d){try{if(!_[_0x8353('0x25')](queues[_0x50018d[_0x8353('0x6')]])){if(!_['isNil'](queues[_0x50018d['uniqueid']]['musiconholdstartAt'])){utils[_0x8353('0x13')](util[_0x8353('0x4')](_0x8353('0x68'),_0x50018d[_0x8353('0x6')]),_0x50018d);queues[_0x50018d['uniqueid']][_0x8353('0x5a')]+=utils[_0x8353('0x36')](utils[_0x8353('0x18')](),queues[_0x50018d['uniqueid']][_0x8353('0x66')]);utils['info'](util['format'](_0x8353('0x69'),_0x50018d['uniqueid'],queues[_0x50018d[_0x8353('0x6')]]['name'],queues[_0x50018d[_0x8353('0x6')]][_0x8353('0x5a')]));delete queues[_0x50018d['uniqueid']][_0x8353('0x66')];}}}catch(_0x5e426f){utils[_0x8353('0x19')](util['format'](_0x8353('0x68'),_0x50018d['uniqueid']),_0x5e426f);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index e226ddd..e99330f 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 _0x5288=['[%s][recordings][newstate]\x20context:%s\x20channel:%s','linkedid','channelstate','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','context','error','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','find','monitors','push','hangup','[%s][recordings][hangup]','calleridnum','cause-txt','calleridname','connectedlinenum','connectedlinename','type','outbound','forEach','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','set','startsWith','cdr','split','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','util','./utils','info','format','uniqueid','accountcode','getUserByInternal','then','membername','name','UserId','request','debug','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','channel','[%s][recordings][newstate]','isNil'];(function(_0x245772,_0x2c0818){var _0x1a1c3b=function(_0x4087ac){while(--_0x4087ac){_0x245772['push'](_0x245772['shift']());}};_0x1a1c3b(++_0x2c0818);}(_0x5288,0x6a));var _0x8528=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0x5288[_0x62c958];return _0x57ec61;};'use strict';var _=require('lodash');var util=require(_0x8528('0x0'));var utils=require(_0x8528('0x1'));var recordings={};function writeDB(_0x434916){utils[_0x8528('0x2')](util[_0x8528('0x3')]('[%s][recordings][writeDB]',_0x434916[_0x8528('0x4')]));if(_0x434916[_0x8528('0x5')]){utils[_0x8528('0x6')](_0x434916[_0x8528('0x5')])[_0x8528('0x7')](function(_0x1845a3){if(_0x1845a3){_0x434916[_0x8528('0x8')]=_0x1845a3[_0x8528('0x9')];_0x434916[_0x8528('0xa')]=_0x1845a3['id'];}utils[_0x8528('0xb')]('CreateVoiceRecording',_0x434916);});}else{utils[_0x8528('0xb')]('CreateVoiceRecording',_0x434916);}}exports['newchannel']=function(_0xad8a35){try{utils[_0x8528('0xc')](util[_0x8528('0x3')]('[%s][recordings][newchannel]',_0xad8a35['uniqueid']),_0xad8a35);if(_0xad8a35[_0x8528('0x4')]==_0xad8a35['linkedid']){utils[_0x8528('0x2')](util[_0x8528('0x3')](_0x8528('0xd'),_0xad8a35['uniqueid'],_0xad8a35['context'],_0xad8a35[_0x8528('0xe')]));recordings[_0xad8a35[_0x8528('0x4')]]={'uniqueid':_0xad8a35[_0x8528('0x4')],'accountcode':_0xad8a35[_0x8528('0x5')],'exten':_0xad8a35['exten'],'context':_0xad8a35['context'],'channel':_0xad8a35[_0x8528('0xf')],'monitors':[]};}}catch(_0x2111df){utils['error'](util[_0x8528('0x3')]('[%s][recordings][newchannel]',_0xad8a35[_0x8528('0x4')]),_0x2111df);}};exports['newstate']=function(_0x217f3d){try{utils[_0x8528('0xc')](util[_0x8528('0x3')](_0x8528('0x10'),_0x217f3d['uniqueid']),_0x217f3d);if(!_[_0x8528('0x11')](recordings[_0x217f3d[_0x8528('0x4')]])&&_0x217f3d['channelstate']==0x6){utils[_0x8528('0x2')](util['format'](_0x8528('0x12'),_0x217f3d[_0x8528('0x4')],_0x217f3d['context'],_0x217f3d[_0x8528('0xf')]));}else if(!_['isNil'](recordings[_0x217f3d[_0x8528('0x13')]])&&_0x217f3d[_0x8528('0x14')]==0x6&&_0x217f3d['context']!=_0x8528('0x15')){utils[_0x8528('0x2')](util[_0x8528('0x3')](_0x8528('0x16'),_0x217f3d[_0x8528('0x4')],_0x217f3d['linkedid'],_0x217f3d[_0x8528('0x17')],_0x217f3d['channel']));recordings[_0x217f3d[_0x8528('0x13')]][_0x8528('0x5')]=_0x217f3d[_0x8528('0x5')];}}catch(_0x21af9d){utils[_0x8528('0x18')](util[_0x8528('0x3')]('[%s][recordings][newstate]',_0x217f3d[_0x8528('0x4')]),_0x21af9d);}};exports[_0x8528('0x19')]=function(_0x1b0b2b){try{if(!_[_0x8528('0x11')](_0x1b0b2b[_0x8528('0x1a')])&&!_[_0x8528('0x11')](_0x1b0b2b[_0x8528('0x1a')][_0x8528('0x1b')])){utils[_0x8528('0xc')](util[_0x8528('0x3')](_0x8528('0x1c'),_0x1b0b2b[_0x8528('0x4')]),_0x1b0b2b);utils[_0x8528('0x2')](util['format'](_0x8528('0x1d'),_0x1b0b2b['uniqueid'],_0x1b0b2b['variable'],_0x1b0b2b[_0x8528('0x1e')]));if(_[_0x8528('0x1f')](_0x1b0b2b['value'],_0x8528('0x20'))){_0x1b0b2b[_0x8528('0x1e')]=_0x1b0b2b['value'][_0x8528('0x21')](_0x8528('0x20'),'.WAV');}if(recordings[_0x1b0b2b[_0x8528('0x13')]]){var _0x2bffd2=_[_0x8528('0x22')](recordings[_0x1b0b2b[_0x8528('0x13')]][_0x8528('0x23')],{'value':_0x1b0b2b[_0x8528('0x1e')]});if(_['isNil'](_0x2bffd2)){recordings[_0x1b0b2b[_0x8528('0x13')]][_0x8528('0x23')][_0x8528('0x24')]({'value':_0x1b0b2b[_0x8528('0x1e')]});}}}}catch(_0x5c9436){utils['error'](util[_0x8528('0x3')](_0x8528('0x1c'),_0x1b0b2b['uniqueid']),_0x5c9436);}};exports[_0x8528('0x25')]=function(_0x3501bb){try{if(!_[_0x8528('0x11')](recordings[_0x3501bb[_0x8528('0x4')]])){utils['debug'](util[_0x8528('0x3')](_0x8528('0x26'),_0x3501bb[_0x8528('0x4')]),_0x3501bb);utils['info'](util[_0x8528('0x3')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x3501bb[_0x8528('0x4')],_0x3501bb[_0x8528('0x27')],_0x3501bb['calleridname'],_0x3501bb[_0x8528('0x28')]));recordings[_0x3501bb[_0x8528('0x4')]]['calleridnum']=_0x3501bb[_0x8528('0x27')];recordings[_0x3501bb[_0x8528('0x4')]]['calleridname']=_0x3501bb[_0x8528('0x29')];recordings[_0x3501bb[_0x8528('0x4')]][_0x8528('0x2a')]=_0x3501bb[_0x8528('0x2a')];recordings[_0x3501bb[_0x8528('0x4')]][_0x8528('0x2b')]=_0x3501bb['connectedlinename'];if(recordings[_0x3501bb['uniqueid']][_0x8528('0x2c')]==_0x8528('0x2d')&&recordings[_0x3501bb['uniqueid']][_0x8528('0x5')]){recordings[_0x3501bb['uniqueid']][_0x8528('0x2a')]=recordings[_0x3501bb[_0x8528('0x4')]][_0x8528('0x5')];recordings[_0x3501bb['uniqueid']]['connectedlinename']='';}recordings[_0x3501bb[_0x8528('0x4')]][_0x8528('0x23')][_0x8528('0x2e')](function(_0x1c2480){var _0x26324a=_['clone'](recordings[_0x3501bb['uniqueid']]);_0x26324a[_0x8528('0x1e')]=_0x1c2480['value'];writeDB(_0x26324a);});delete recordings[_0x3501bb[_0x8528('0x4')]];}}catch(_0x2b6c57){utils[_0x8528('0x18')](util['format'](_0x8528('0x26'),_0x3501bb[_0x8528('0x4')]),_0x2b6c57);}};exports[_0x8528('0x2f')]=function(_0x3f68ed){try{if(!_['isNil'](recordings[_0x3f68ed[_0x8528('0x4')]])){utils['debug'](util[_0x8528('0x3')](_0x8528('0x30'),_0x3f68ed[_0x8528('0x4')]),_0x3f68ed);utils[_0x8528('0x2')](util[_0x8528('0x3')](_0x8528('0x31'),_0x3f68ed[_0x8528('0x4')],_0x3f68ed['application'],_0x3f68ed[_0x8528('0x32')]));if(_0x3f68ed[_0x8528('0x33')][_0x8528('0x34')]()==_0x8528('0x35')&&_[_0x8528('0x36')](_0x3f68ed[_0x8528('0x32')][_0x8528('0x34')](),_0x8528('0x37'))){var _0x566320=_0x3f68ed['appdata'][_0x8528('0x38')]('=');var _0x29e7cc=_0x566320[0x0]['substring'](_0x566320[0x0][_0x8528('0x39')]('(')+0x1,_0x566320[0x0][_0x8528('0x39')](')'));var _0x29b1c9=_0x566320[0x1];recordings[_0x3f68ed[_0x8528('0x4')]][_0x29e7cc]=_0x29b1c9;}}}catch(_0x399187){utils[_0x8528('0x18')](util[_0x8528('0x3')](_0x8528('0x30'),_0x3f68ed[_0x8528('0x4')]),_0x399187);}};exports[_0x8528('0x3a')]=function(_0x4616c5){try{if(!_['isNil'](recordings[_0x4616c5[_0x8528('0x4')]])){utils['debug'](util[_0x8528('0x3')](_0x8528('0x3b'),_0x4616c5[_0x8528('0x4')]),_0x4616c5);utils[_0x8528('0x2')](util[_0x8528('0x3')](_0x8528('0x3c'),_0x4616c5[_0x8528('0x4')],_0x4616c5[_0x8528('0x3d')]));recordings[_0x4616c5[_0x8528('0x4')]][_0x8528('0x3d')]=_0x4616c5[_0x8528('0x3d')];}}catch(_0x4bd509){utils[_0x8528('0x18')](util[_0x8528('0x3')]('[%s][recordings][queuecallerjoin]',_0x4616c5['uniqueid']),_0x4bd509);}}; \ No newline at end of file +var _0xfbe5=['variable','mixmonitor_filename','debug','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','endsWith','value','.wav49','replace','.WAV','find','monitors','push','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridname','cause-txt','calleridnum','connectedlinenum','connectedlinename','type','outbound','forEach','newexten','[%s][recordings][newexten]','appdata','set','startsWith','cdr','split','substring','lastIndexOf','[%s][recordings][queuecallerjoin]','queue','lodash','util','./utils','info','format','accountcode','getUserByInternal','then','UserId','request','newchannel','[%s][recordings][newchannel]','uniqueid','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','error','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channel','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0xfbe5,0xd3));var _0x5fbe=function(_0x13298b,_0x2a0003){_0x13298b=_0x13298b-0x0;var _0x9ef93e=_0xfbe5[_0x13298b];return _0x9ef93e;};'use strict';var _=require(_0x5fbe('0x0'));var util=require(_0x5fbe('0x1'));var utils=require(_0x5fbe('0x2'));var recordings={};function writeDB(_0x5a9cbb){utils[_0x5fbe('0x3')](util[_0x5fbe('0x4')]('[%s][recordings][writeDB]',_0x5a9cbb['uniqueid']));if(_0x5a9cbb[_0x5fbe('0x5')]){utils[_0x5fbe('0x6')](_0x5a9cbb[_0x5fbe('0x5')])[_0x5fbe('0x7')](function(_0x49b6e3){if(_0x49b6e3){_0x5a9cbb['membername']=_0x49b6e3['name'];_0x5a9cbb[_0x5fbe('0x8')]=_0x49b6e3['id'];}utils[_0x5fbe('0x9')]('CreateVoiceRecording',_0x5a9cbb);});}else{utils['request']('CreateVoiceRecording',_0x5a9cbb);}}exports[_0x5fbe('0xa')]=function(_0x565d9e){try{utils['debug'](util['format'](_0x5fbe('0xb'),_0x565d9e[_0x5fbe('0xc')]),_0x565d9e);if(_0x565d9e['uniqueid']==_0x565d9e[_0x5fbe('0xd')]){utils['info'](util[_0x5fbe('0x4')](_0x5fbe('0xe'),_0x565d9e['uniqueid'],_0x565d9e[_0x5fbe('0xf')],_0x565d9e[_0x5fbe('0x10')]));recordings[_0x565d9e[_0x5fbe('0xc')]]={'uniqueid':_0x565d9e['uniqueid'],'accountcode':_0x565d9e[_0x5fbe('0x5')],'exten':_0x565d9e[_0x5fbe('0x10')],'context':_0x565d9e[_0x5fbe('0xf')],'channel':_0x565d9e['channel'],'monitors':[]};}}catch(_0x2ee638){utils[_0x5fbe('0x11')](util[_0x5fbe('0x4')]('[%s][recordings][newchannel]',_0x565d9e[_0x5fbe('0xc')]),_0x2ee638);}};exports['newstate']=function(_0x473ad0){try{utils['debug'](util['format'](_0x5fbe('0x12'),_0x473ad0[_0x5fbe('0xc')]),_0x473ad0);if(!_[_0x5fbe('0x13')](recordings[_0x473ad0['uniqueid']])&&_0x473ad0[_0x5fbe('0x14')]==0x6){utils['info'](util['format'](_0x5fbe('0x15'),_0x473ad0[_0x5fbe('0xc')],_0x473ad0['context'],_0x473ad0[_0x5fbe('0x16')]));}else if(!_[_0x5fbe('0x13')](recordings[_0x473ad0[_0x5fbe('0xd')]])&&_0x473ad0[_0x5fbe('0x14')]==0x6&&_0x473ad0[_0x5fbe('0xf')]!=_0x5fbe('0x17')){utils['info'](util[_0x5fbe('0x4')](_0x5fbe('0x18'),_0x473ad0['uniqueid'],_0x473ad0[_0x5fbe('0xd')],_0x473ad0[_0x5fbe('0xf')],_0x473ad0[_0x5fbe('0x16')]));recordings[_0x473ad0[_0x5fbe('0xd')]][_0x5fbe('0x5')]=_0x473ad0[_0x5fbe('0x5')];}}catch(_0x41b56c){utils[_0x5fbe('0x11')](util[_0x5fbe('0x4')](_0x5fbe('0x12'),_0x473ad0[_0x5fbe('0xc')]),_0x41b56c);}};exports['varset']=function(_0x48eb2b){try{if(!_[_0x5fbe('0x13')](_0x48eb2b[_0x5fbe('0x19')])&&!_[_0x5fbe('0x13')](_0x48eb2b[_0x5fbe('0x19')][_0x5fbe('0x1a')])){utils[_0x5fbe('0x1b')](util['format'](_0x5fbe('0x1c'),_0x48eb2b[_0x5fbe('0xc')]),_0x48eb2b);utils['info'](util['format'](_0x5fbe('0x1d'),_0x48eb2b[_0x5fbe('0xc')],_0x48eb2b[_0x5fbe('0x19')],_0x48eb2b['value']));if(_[_0x5fbe('0x1e')](_0x48eb2b[_0x5fbe('0x1f')],_0x5fbe('0x20'))){_0x48eb2b[_0x5fbe('0x1f')]=_0x48eb2b[_0x5fbe('0x1f')][_0x5fbe('0x21')](_0x5fbe('0x20'),_0x5fbe('0x22'));}if(recordings[_0x48eb2b[_0x5fbe('0xd')]]){var _0x1b3f9d=_[_0x5fbe('0x23')](recordings[_0x48eb2b['linkedid']][_0x5fbe('0x24')],{'value':_0x48eb2b['value']});if(_[_0x5fbe('0x13')](_0x1b3f9d)){recordings[_0x48eb2b[_0x5fbe('0xd')]][_0x5fbe('0x24')][_0x5fbe('0x25')]({'value':_0x48eb2b[_0x5fbe('0x1f')]});}}}}catch(_0x429226){utils[_0x5fbe('0x11')](util[_0x5fbe('0x4')](_0x5fbe('0x1c'),_0x48eb2b[_0x5fbe('0xc')]),_0x429226);}};exports['hangup']=function(_0x42fc8b){try{if(!_[_0x5fbe('0x13')](recordings[_0x42fc8b[_0x5fbe('0xc')]])){utils[_0x5fbe('0x1b')](util[_0x5fbe('0x4')](_0x5fbe('0x26'),_0x42fc8b[_0x5fbe('0xc')]),_0x42fc8b);utils[_0x5fbe('0x3')](util[_0x5fbe('0x4')](_0x5fbe('0x27'),_0x42fc8b['uniqueid'],_0x42fc8b['calleridnum'],_0x42fc8b[_0x5fbe('0x28')],_0x42fc8b[_0x5fbe('0x29')]));recordings[_0x42fc8b[_0x5fbe('0xc')]][_0x5fbe('0x2a')]=_0x42fc8b[_0x5fbe('0x2a')];recordings[_0x42fc8b[_0x5fbe('0xc')]]['calleridname']=_0x42fc8b[_0x5fbe('0x28')];recordings[_0x42fc8b['uniqueid']][_0x5fbe('0x2b')]=_0x42fc8b['connectedlinenum'];recordings[_0x42fc8b[_0x5fbe('0xc')]]['connectedlinename']=_0x42fc8b[_0x5fbe('0x2c')];if(recordings[_0x42fc8b[_0x5fbe('0xc')]][_0x5fbe('0x2d')]==_0x5fbe('0x2e')&&recordings[_0x42fc8b[_0x5fbe('0xc')]][_0x5fbe('0x5')]){recordings[_0x42fc8b[_0x5fbe('0xc')]]['connectedlinenum']=recordings[_0x42fc8b[_0x5fbe('0xc')]][_0x5fbe('0x5')];recordings[_0x42fc8b[_0x5fbe('0xc')]][_0x5fbe('0x2c')]='';}recordings[_0x42fc8b[_0x5fbe('0xc')]][_0x5fbe('0x24')][_0x5fbe('0x2f')](function(_0x120c5d){var _0x7d016c=_['clone'](recordings[_0x42fc8b[_0x5fbe('0xc')]]);_0x7d016c['value']=_0x120c5d[_0x5fbe('0x1f')];writeDB(_0x7d016c);});delete recordings[_0x42fc8b['uniqueid']];}}catch(_0x2fa1f5){utils[_0x5fbe('0x11')](util[_0x5fbe('0x4')](_0x5fbe('0x26'),_0x42fc8b[_0x5fbe('0xc')]),_0x2fa1f5);}};exports[_0x5fbe('0x30')]=function(_0x5e86b7){try{if(!_['isNil'](recordings[_0x5e86b7[_0x5fbe('0xc')]])){utils[_0x5fbe('0x1b')](util['format'](_0x5fbe('0x31'),_0x5e86b7[_0x5fbe('0xc')]),_0x5e86b7);utils[_0x5fbe('0x3')](util[_0x5fbe('0x4')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x5e86b7[_0x5fbe('0xc')],_0x5e86b7['application'],_0x5e86b7[_0x5fbe('0x32')]));if(_0x5e86b7['application']['toLowerCase']()==_0x5fbe('0x33')&&_[_0x5fbe('0x34')](_0x5e86b7[_0x5fbe('0x32')]['toLowerCase'](),_0x5fbe('0x35'))){var _0x22e6ca=_0x5e86b7[_0x5fbe('0x32')][_0x5fbe('0x36')]('=');var _0x3762bd=_0x22e6ca[0x0][_0x5fbe('0x37')](_0x22e6ca[0x0][_0x5fbe('0x38')]('(')+0x1,_0x22e6ca[0x0]['lastIndexOf'](')'));var _0x108bed=_0x22e6ca[0x1];recordings[_0x5e86b7['uniqueid']][_0x3762bd]=_0x108bed;}}}catch(_0x4962d2){utils['error'](util[_0x5fbe('0x4')](_0x5fbe('0x31'),_0x5e86b7[_0x5fbe('0xc')]),_0x4962d2);}};exports['queuecallerjoin']=function(_0x2e650a){try{if(!_[_0x5fbe('0x13')](recordings[_0x2e650a[_0x5fbe('0xc')]])){utils[_0x5fbe('0x1b')](util[_0x5fbe('0x4')](_0x5fbe('0x39'),_0x2e650a[_0x5fbe('0xc')]),_0x2e650a);utils[_0x5fbe('0x3')](util[_0x5fbe('0x4')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x2e650a['uniqueid'],_0x2e650a[_0x5fbe('0x3a')]));recordings[_0x2e650a[_0x5fbe('0xc')]][_0x5fbe('0x3a')]=_0x2e650a[_0x5fbe('0x3a')];}}catch(_0x329ee3){utils[_0x5fbe('0x11')](util[_0x5fbe('0x4')]('[%s][recordings][queuecallerjoin]',_0x2e650a[_0x5fbe('0xc')]),_0x329ee3);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 2382729..ba02b0f 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 _0x7127=['attended','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetexten','lodash','util','./utils','format','[%s][transfers][writeDB]\x20type:%s','type','origtransfereruniqueid','uniqueid','CreateVoiceTransferReport','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','info','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinename','secondtransferercontext','origtransfererlinkedid','origtransfererexten'];(function(_0x1d3861,_0x5680bc){var _0x4ce942=function(_0x55a635){while(--_0x55a635){_0x1d3861['push'](_0x1d3861['shift']());}};_0x4ce942(++_0x5680bc);}(_0x7127,0x82));var _0x7712=function(_0x45abb0,_0x46bcfc){_0x45abb0=_0x45abb0-0x0;var _0x553de2=_0x7127[_0x45abb0];return _0x553de2;};'use strict';var _=require(_0x7712('0x0'));var util=require(_0x7712('0x1'));var utils=require(_0x7712('0x2'));function writeDB(_0xce6694){utils['info'](util[_0x7712('0x3')](_0x7712('0x4'),_0xce6694[_0x7712('0x5')]==='attended'?_0xce6694[_0x7712('0x6')]:_0xce6694[_0x7712('0x7')],_0xce6694['type']));utils['request'](_0x7712('0x8'),_0xce6694);}exports[_0x7712('0x9')]={};exports[_0x7712('0xa')]=function(_0x32e6e3){try{utils[_0x7712('0xb')](util[_0x7712('0x3')](_0x7712('0xc'),_0x32e6e3[_0x7712('0x7')]),_0x32e6e3);utils[_0x7712('0xd')](util[_0x7712('0x3')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x32e6e3[_0x7712('0x7')],_0x32e6e3[_0x7712('0xe')],_0x32e6e3[_0x7712('0xf')],_0x32e6e3[_0x7712('0x10')],_0x32e6e3[_0x7712('0x11')]));_0x32e6e3['type']=_0x7712('0x12');exports[_0x7712('0x9')][_0x32e6e3[_0x7712('0x13')]]=_0x32e6e3;writeDB(_0x32e6e3);}catch(_0xb67c9e){utils[_0x7712('0x14')](util[_0x7712('0x3')](_0x7712('0xc'),_0x32e6e3[_0x7712('0x7')]),_0xb67c9e);}};exports[_0x7712('0x15')]=function(_0x5ba6e1){try{utils[_0x7712('0xb')](util['format'](_0x7712('0x16'),_0x5ba6e1[_0x7712('0x6')]),_0x5ba6e1);utils[_0x7712('0xd')](util[_0x7712('0x3')](_0x7712('0x17'),_0x5ba6e1[_0x7712('0x6')],_0x5ba6e1[_0x7712('0x18')],_0x5ba6e1[_0x7712('0x19')],_0x5ba6e1[_0x7712('0x1a')],_0x5ba6e1[_0x7712('0x1b')]));_0x5ba6e1=_[_0x7712('0x1c')](_0x5ba6e1,{'transfererchannel':_0x5ba6e1[_0x7712('0x1d')],'transferercalleridnum':_0x5ba6e1[_0x7712('0x18')],'transferercalleridname':_0x5ba6e1[_0x7712('0x19')],'transfererconnectedlinenum':_0x5ba6e1['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x5ba6e1[_0x7712('0x1e')],'transfereraccountcode':_0x5ba6e1['origtransfereraccountcode'],'transferercontext':_0x5ba6e1[_0x7712('0x1f')],'transfererexten':_0x5ba6e1['secondtransfererexten'],'transfererlinkedid':_0x5ba6e1[_0x7712('0x20')],'context':_0x5ba6e1['origtransferercontext'],'extension':_0x5ba6e1[_0x7712('0x21')],'type':_0x7712('0x22')});if(_[_0x7712('0x23')](_0x5ba6e1[_0x7712('0x24')])){_0x5ba6e1=_[_0x7712('0x1c')](_0x5ba6e1,{'transfereechannel':_0x5ba6e1[_0x7712('0x25')],'transfereecalleridnum':_0x5ba6e1['transfertargetcalleridnum'],'transfereecalleridname':_0x5ba6e1[_0x7712('0x1b')],'transfereeconnectedlinenum':_0x5ba6e1[_0x7712('0x26')],'transfereeconnectedlinename':_0x5ba6e1['transfertargetconnectedlinename'],'transfereeaccountcode':_0x5ba6e1[_0x7712('0x27')],'transfereecontext':_0x5ba6e1['transfertargetcontext'],'transfereeexten':_0x5ba6e1[_0x7712('0x28')],'transfereelinkedid':_0x5ba6e1['transfertargetlinkedid']});}writeDB(_0x5ba6e1);}catch(_0x4076c1){utils[_0x7712('0x14')](util[_0x7712('0x3')](_0x7712('0x16'),_0x5ba6e1[_0x7712('0x6')]),_0x4076c1);}}; \ No newline at end of file +var _0xb94d=['transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridname','blind','error','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransferercontext','origtransfererexten','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum'];(function(_0x3d7322,_0x2b9a3d){var _0x568e92=function(_0x237839){while(--_0x237839){_0x3d7322['push'](_0x3d7322['shift']());}};_0x568e92(++_0x2b9a3d);}(_0xb94d,0x163));var _0xdb94=function(_0x2336ea,_0x46e872){_0x2336ea=_0x2336ea-0x0;var _0x216bf9=_0xb94d[_0x2336ea];return _0x216bf9;};'use strict';var _=require('lodash');var util=require(_0xdb94('0x0'));var utils=require(_0xdb94('0x1'));function writeDB(_0xe08bfa){utils[_0xdb94('0x2')](util[_0xdb94('0x3')](_0xdb94('0x4'),_0xe08bfa[_0xdb94('0x5')]===_0xdb94('0x6')?_0xe08bfa[_0xdb94('0x7')]:_0xe08bfa[_0xdb94('0x8')],_0xe08bfa[_0xdb94('0x5')]));utils[_0xdb94('0x9')](_0xdb94('0xa'),_0xe08bfa);}exports[_0xdb94('0xb')]={};exports[_0xdb94('0xc')]=function(_0x45d70e){try{utils[_0xdb94('0xd')](util['format'](_0xdb94('0xe'),_0x45d70e[_0xdb94('0x8')]),_0x45d70e);utils['info'](util[_0xdb94('0x3')](_0xdb94('0xf'),_0x45d70e[_0xdb94('0x8')],_0x45d70e['transferercalleridnum'],_0x45d70e[_0xdb94('0x10')],_0x45d70e['transfereecalleridnum'],_0x45d70e[_0xdb94('0x11')]));_0x45d70e[_0xdb94('0x5')]=_0xdb94('0x12');exports[_0xdb94('0xb')][_0x45d70e['transfereruniqueid']]=_0x45d70e;writeDB(_0x45d70e);}catch(_0x411c13){utils[_0xdb94('0x13')](util['format'](_0xdb94('0xe'),_0x45d70e[_0xdb94('0x8')]),_0x411c13);}};exports['attendedtransfer']=function(_0x35ac5a){try{utils[_0xdb94('0xd')](util[_0xdb94('0x3')]('[%s][transfers][attendedtransfer]',_0x35ac5a[_0xdb94('0x7')]),_0x35ac5a);utils['info'](util[_0xdb94('0x3')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x35ac5a[_0xdb94('0x7')],_0x35ac5a['origtransferercalleridnum'],_0x35ac5a['origtransferercalleridname'],_0x35ac5a[_0xdb94('0x14')],_0x35ac5a[_0xdb94('0x15')]));_0x35ac5a=_[_0xdb94('0x16')](_0x35ac5a,{'transfererchannel':_0x35ac5a[_0xdb94('0x17')],'transferercalleridnum':_0x35ac5a[_0xdb94('0x18')],'transferercalleridname':_0x35ac5a[_0xdb94('0x19')],'transfererconnectedlinenum':_0x35ac5a[_0xdb94('0x1a')],'transfererconnectedlinename':_0x35ac5a[_0xdb94('0x1b')],'transfereraccountcode':_0x35ac5a[_0xdb94('0x1c')],'transferercontext':_0x35ac5a['secondtransferercontext'],'transfererexten':_0x35ac5a[_0xdb94('0x1d')],'transfererlinkedid':_0x35ac5a['origtransfererlinkedid'],'context':_0x35ac5a[_0xdb94('0x1e')],'extension':_0x35ac5a[_0xdb94('0x1f')],'type':_0xdb94('0x6')});if(_['isNil'](_0x35ac5a[_0xdb94('0x20')])){_0x35ac5a=_[_0xdb94('0x16')](_0x35ac5a,{'transfereechannel':_0x35ac5a[_0xdb94('0x21')],'transfereecalleridnum':_0x35ac5a[_0xdb94('0x14')],'transfereecalleridname':_0x35ac5a[_0xdb94('0x15')],'transfereeconnectedlinenum':_0x35ac5a[_0xdb94('0x22')],'transfereeconnectedlinename':_0x35ac5a['transfertargetconnectedlinename'],'transfereeaccountcode':_0x35ac5a[_0xdb94('0x23')],'transfereecontext':_0x35ac5a[_0xdb94('0x24')],'transfereeexten':_0x35ac5a[_0xdb94('0x25')],'transfereelinkedid':_0x35ac5a[_0xdb94('0x26')]});}writeDB(_0x35ac5a);}catch(_0x565103){utils['error'](util[_0xdb94('0x3')]('[%s][transfers][attendedtransfer]',_0x35ac5a[_0xdb94('0x7')]),_0x565103);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index f193702..957d253 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 _0xfa75=['request','[utils][request]\x20name:%s','GetUser','internal','name','interface','then','stringify','result','length','[utils][getUserByInternal]\x20internal:%s\x20%s','notfound','catch','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','found','[utils][getUserByInterface]','getUserByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','subtractTime','seconds','format','YYYY-MM-DD\x20HH:mm:ss','diff','now','isAfter','isBefore','bluebird','jayson/promise','moment','client','http','../../config/logger','xdr','info','inspect','debug','error'];(function(_0x251ff4,_0x340fbf){var _0x5f1afd=function(_0xdb0a32){while(--_0xdb0a32){_0x251ff4['push'](_0x251ff4['shift']());}};_0x5f1afd(++_0x340fbf);}(_0xfa75,0x1ef));var _0x5fa7=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfa75[_0x20a584];return _0x4b41a8;};'use strict';var BPromise=require(_0x5fa7('0x0'));var jayson=require(_0x5fa7('0x1'));var moment=require(_0x5fa7('0x2'));var util=require('util');var client=jayson[_0x5fa7('0x3')][_0x5fa7('0x4')]({'port':0x2329});var logger=require(_0x5fa7('0x5'))(_0x5fa7('0x6'));exports['info']=function(_0x6a44ff,_0xd10f54){logger[_0x5fa7('0x7')](_0x6a44ff,_0xd10f54?util[_0x5fa7('0x8')](_0xd10f54,{'showHidden':![],'depth':null}):'');};exports[_0x5fa7('0x9')]=function(_0x548e4e,_0x317893){logger['debug'](_0x548e4e,_0x317893?util[_0x5fa7('0x8')](_0x317893,{'showHidden':![],'depth':null}):'');};exports[_0x5fa7('0xa')]=function(_0x2d5024,_0x27492d){logger[_0x5fa7('0xa')](_0x2d5024,_0x27492d?util['inspect'](_0x27492d,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x3be490,_0x4da680){return client[_0x5fa7('0xb')](_0x3be490,{'body':_0x4da680})['then'](function(_0x36a70f){logger['debug'](_0x5fa7('0xc'),_0x3be490,_0x36a70f?util[_0x5fa7('0x8')](_0x36a70f,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x1d6b5a){logger[_0x5fa7('0xa')](_0x5fa7('0xc'),_0x3be490,_0x1d6b5a?util[_0x5fa7('0x8')](_0x1d6b5a,{'showHidden':![],'depth':null}):'');});};function getUser(_0x1287f5){return client[_0x5fa7('0xb')](_0x5fa7('0xd'),{'options':{'raw':!![],'attributes':['id',_0x5fa7('0xe'),_0x5fa7('0xf'),_0x5fa7('0x10')],'where':_0x1287f5,'limit':0x1}})[_0x5fa7('0x11')](function(_0x139941){logger['debug']('[utils][getUser]\x20where:%s',JSON[_0x5fa7('0x12')](_0x1287f5),_0x139941?util[_0x5fa7('0x8')](_0x139941,{'showHidden':![],'depth':null}):'');return _0x139941[_0x5fa7('0x13')][_0x5fa7('0x14')]?_0x139941['result'][0x0]:null;});}exports['getUserByInternal']=function(_0x1669b1){return new BPromise(function(_0x38da63,_0x212f13){if(_0x1669b1){return getUser({'internal':_0x1669b1})['then'](function(_0xdbc522){logger[_0x5fa7('0x7')](_0x5fa7('0x15'),_0x1669b1,_0xdbc522?'found':_0x5fa7('0x16'));return _0x38da63(_0xdbc522);})[_0x5fa7('0x17')](function(_0x3a3cce){logger['error']('[utils][getUserByInternal]',_0x3a3cce?util[_0x5fa7('0x8')](_0x3a3cce,{'showHidden':![],'depth':null}):'');return _0x38da63(null);});}return _0x38da63(null);});};exports[_0x5fa7('0x18')]=function(_0x3ae4c1){return new BPromise(function(_0xf58234,_0x1b47ae){if(_0x3ae4c1){return getUser({'interface':_0x3ae4c1})['then'](function(_0x58c402){logger[_0x5fa7('0x7')](_0x5fa7('0x19'),_0x3ae4c1,_0x58c402?_0x5fa7('0x1a'):_0x5fa7('0x16'));return _0xf58234(_0x58c402);})[_0x5fa7('0x17')](function(_0x551f58){logger['error'](_0x5fa7('0x1b'),_0x551f58?util[_0x5fa7('0x8')](_0x551f58,{'showHidden':![],'depth':null}):'');return _0xf58234(null);});}return _0xf58234(null);});};exports[_0x5fa7('0x1c')]=function(_0x58fc8a){return new BPromise(function(_0x52f35,_0x4a377f){if(_0x58fc8a){return getUser({'name':_0x58fc8a})[_0x5fa7('0x11')](function(_0x14203b){logger[_0x5fa7('0x7')]('[utils][getUserByName]\x20name:%s\x20%s',_0x58fc8a,_0x14203b?_0x5fa7('0x1a'):_0x5fa7('0x16'));return _0x52f35(_0x14203b);})[_0x5fa7('0x17')](function(_0x15111e){logger[_0x5fa7('0xa')]('[utils][getUserByName]',_0x15111e?util[_0x5fa7('0x8')](_0x15111e,{'showHidden':![],'depth':null}):'');return _0x52f35(null);});}return _0x52f35(null);});};exports['getVoiceQueueByName']=function(_0x2bac5e){return new BPromise(function(_0x31d7c9,_0x1b1157){if(_0x2bac5e){return client[_0x5fa7('0xb')](_0x5fa7('0x1d'),{'options':{'raw':!![],'attributes':['id',_0x5fa7('0xf'),_0x5fa7('0x1e'),_0x5fa7('0x1f'),_0x5fa7('0x20')],'where':{'name':_0x2bac5e},'limit':0x1}})[_0x5fa7('0x11')](function(_0x11df17){logger[_0x5fa7('0x9')](_0x5fa7('0x21'),_0x2bac5e,_0x11df17?util['inspect'](_0x11df17,{'showHidden':![],'depth':null}):'');logger[_0x5fa7('0x7')](_0x5fa7('0x22'),_0x2bac5e,_0x11df17?'found':_0x5fa7('0x16'));return _0x31d7c9(_0x11df17[_0x5fa7('0x13')]['length']?_0x11df17[_0x5fa7('0x13')][0x0]:null);})[_0x5fa7('0x17')](function(_0x24a492){logger[_0x5fa7('0xa')](_0x5fa7('0x23'),_0x24a492?util[_0x5fa7('0x8')](_0x24a492,{'showHidden':![],'depth':null}):'');return _0x31d7c9(null);});}return _0x31d7c9(null);});};exports[_0x5fa7('0x24')]=function(_0x14bfca,_0x553073){return moment(_0x14bfca)[_0x5fa7('0x25')](_0x553073,'seconds')['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x5fa7('0x26')]=function(_0x5d180f,_0x5e63c8){return moment(_0x5d180f)['subtract'](_0x5e63c8,_0x5fa7('0x27'))[_0x5fa7('0x28')](_0x5fa7('0x29'));};exports['diffTime']=function(_0x2ebbf8,_0x3aec54){return moment(_0x2ebbf8)[_0x5fa7('0x2a')](moment(_0x3aec54),_0x5fa7('0x27'));};exports['sumTime']=function(_0x3b8e87,_0x2bbe24){return parseInt(_0x3b8e87,0xa)+parseInt(_0x2bbe24,0xa);};exports[_0x5fa7('0x2b')]=function(){return moment()['format'](_0x5fa7('0x29'));};exports[_0x5fa7('0x2c')]=function(_0x561a42,_0x5805bc){if(_0x5805bc){return moment(_0x561a42)[_0x5fa7('0x2c')](_0x5805bc);}return!![];};exports[_0x5fa7('0x2d')]=function(_0x3a18e5,_0x377ea4){if(_0x377ea4){return moment(_0x3a18e5)[_0x5fa7('0x2d')](_0x377ea4);}else if(_0x3a18e5){return!![];}return![];}; \ No newline at end of file +var _0xdc59=['moment','util','client','http','../../config/logger','xdr','info','inspect','debug','error','request','catch','[utils][request]\x20name:%s','internal','name','then','[utils][getUser]\x20where:%s','result','length','getUserByInternal','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','sumTime','isBefore','bluebird','jayson/promise'];(function(_0x27604f,_0x5ae336){var _0x40d189=function(_0xebacde){while(--_0xebacde){_0x27604f['push'](_0x27604f['shift']());}};_0x40d189(++_0x5ae336);}(_0xdc59,0x19c));var _0x9dc5=function(_0x119705,_0xba9427){_0x119705=_0x119705-0x0;var _0x2affc2=_0xdc59[_0x119705];return _0x2affc2;};'use strict';var BPromise=require(_0x9dc5('0x0'));var jayson=require(_0x9dc5('0x1'));var moment=require(_0x9dc5('0x2'));var util=require(_0x9dc5('0x3'));var client=jayson[_0x9dc5('0x4')][_0x9dc5('0x5')]({'port':0x2329});var logger=require(_0x9dc5('0x6'))(_0x9dc5('0x7'));exports[_0x9dc5('0x8')]=function(_0x1e276f,_0x10b7fb){logger['info'](_0x1e276f,_0x10b7fb?util[_0x9dc5('0x9')](_0x10b7fb,{'showHidden':![],'depth':null}):'');};exports[_0x9dc5('0xa')]=function(_0x3a009d,_0x193198){logger[_0x9dc5('0xa')](_0x3a009d,_0x193198?util[_0x9dc5('0x9')](_0x193198,{'showHidden':![],'depth':null}):'');};exports[_0x9dc5('0xb')]=function(_0x597497,_0x22d0a4){logger[_0x9dc5('0xb')](_0x597497,_0x22d0a4?util[_0x9dc5('0x9')](_0x22d0a4,{'showHidden':![],'depth':null}):'');};exports[_0x9dc5('0xc')]=function(_0x31a47b,_0x1a75b4){return client[_0x9dc5('0xc')](_0x31a47b,{'body':_0x1a75b4})['then'](function(_0x5830c8){logger['debug']('[utils][request]\x20name:%s',_0x31a47b,_0x5830c8?util[_0x9dc5('0x9')](_0x5830c8,{'showHidden':![],'depth':null}):'');})[_0x9dc5('0xd')](function(_0x5c806b){logger[_0x9dc5('0xb')](_0x9dc5('0xe'),_0x31a47b,_0x5c806b?util[_0x9dc5('0x9')](_0x5c806b,{'showHidden':![],'depth':null}):'');});};function getUser(_0x10bc05){return client[_0x9dc5('0xc')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0x9dc5('0xf'),_0x9dc5('0x10'),'interface'],'where':_0x10bc05,'limit':0x1}})[_0x9dc5('0x11')](function(_0x1aa47e){logger['debug'](_0x9dc5('0x12'),JSON['stringify'](_0x10bc05),_0x1aa47e?util['inspect'](_0x1aa47e,{'showHidden':![],'depth':null}):'');return _0x1aa47e[_0x9dc5('0x13')][_0x9dc5('0x14')]?_0x1aa47e['result'][0x0]:null;});}exports[_0x9dc5('0x15')]=function(_0x979cb7){return new BPromise(function(_0x5c149e,_0x16dd10){if(_0x979cb7){return getUser({'internal':_0x979cb7})[_0x9dc5('0x11')](function(_0x37e13d){logger['info']('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x979cb7,_0x37e13d?_0x9dc5('0x16'):_0x9dc5('0x17'));return _0x5c149e(_0x37e13d);})['catch'](function(_0x14637e){logger[_0x9dc5('0xb')](_0x9dc5('0x18'),_0x14637e?util[_0x9dc5('0x9')](_0x14637e,{'showHidden':![],'depth':null}):'');return _0x5c149e(null);});}return _0x5c149e(null);});};exports[_0x9dc5('0x19')]=function(_0x1d7cac){return new BPromise(function(_0x11bb41,_0x4cb235){if(_0x1d7cac){return getUser({'interface':_0x1d7cac})[_0x9dc5('0x11')](function(_0x3ae6b5){logger['info']('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x1d7cac,_0x3ae6b5?_0x9dc5('0x16'):_0x9dc5('0x17'));return _0x11bb41(_0x3ae6b5);})[_0x9dc5('0xd')](function(_0xad553f){logger['error'](_0x9dc5('0x1a'),_0xad553f?util['inspect'](_0xad553f,{'showHidden':![],'depth':null}):'');return _0x11bb41(null);});}return _0x11bb41(null);});};exports[_0x9dc5('0x1b')]=function(_0x30f354){return new BPromise(function(_0x1cc355,_0x413b8f){if(_0x30f354){return getUser({'name':_0x30f354})[_0x9dc5('0x11')](function(_0x21f2cc){logger[_0x9dc5('0x8')](_0x9dc5('0x1c'),_0x30f354,_0x21f2cc?'found':'notfound');return _0x1cc355(_0x21f2cc);})[_0x9dc5('0xd')](function(_0x86763e){logger[_0x9dc5('0xb')](_0x9dc5('0x1d'),_0x86763e?util[_0x9dc5('0x9')](_0x86763e,{'showHidden':![],'depth':null}):'');return _0x1cc355(null);});}return _0x1cc355(null);});};exports[_0x9dc5('0x1e')]=function(_0x4fec29){return new BPromise(function(_0x5a7f10,_0x2b2bc7){if(_0x4fec29){return client[_0x9dc5('0xc')](_0x9dc5('0x1f'),{'options':{'raw':!![],'attributes':['id','name',_0x9dc5('0x20'),'acw',_0x9dc5('0x21')],'where':{'name':_0x4fec29},'limit':0x1}})[_0x9dc5('0x11')](function(_0xdff75f){logger['debug']('[utils][getVoiceQueueByName]\x20name:%s',_0x4fec29,_0xdff75f?util[_0x9dc5('0x9')](_0xdff75f,{'showHidden':![],'depth':null}):'');logger[_0x9dc5('0x8')](_0x9dc5('0x22'),_0x4fec29,_0xdff75f?_0x9dc5('0x16'):_0x9dc5('0x17'));return _0x5a7f10(_0xdff75f['result']['length']?_0xdff75f[_0x9dc5('0x13')][0x0]:null);})[_0x9dc5('0xd')](function(_0x48894b){logger[_0x9dc5('0xb')]('[utils][getVoiceQueueByName]',_0x48894b?util['inspect'](_0x48894b,{'showHidden':![],'depth':null}):'');return _0x5a7f10(null);});}return _0x5a7f10(null);});};exports[_0x9dc5('0x23')]=function(_0x1bdca0,_0xd86997){return moment(_0x1bdca0)[_0x9dc5('0x24')](_0xd86997,_0x9dc5('0x25'))[_0x9dc5('0x26')](_0x9dc5('0x27'));};exports[_0x9dc5('0x28')]=function(_0x1add87,_0x3417bc){return moment(_0x1add87)[_0x9dc5('0x29')](_0x3417bc,_0x9dc5('0x25'))[_0x9dc5('0x26')](_0x9dc5('0x27'));};exports[_0x9dc5('0x2a')]=function(_0x304108,_0x28c209){return moment(_0x304108)[_0x9dc5('0x2b')](moment(_0x28c209),_0x9dc5('0x25'));};exports[_0x9dc5('0x2c')]=function(_0x203aa2,_0x63708c){return parseInt(_0x203aa2,0xa)+parseInt(_0x63708c,0xa);};exports['now']=function(){return moment()['format']('YYYY-MM-DD\x20HH:mm:ss');};exports['isAfter']=function(_0x4c7099,_0x550188){if(_0x550188){return moment(_0x4c7099)['isAfter'](_0x550188);}return!![];};exports['isBefore']=function(_0x487fdd,_0x5decd9){if(_0x5decd9){return moment(_0x487fdd)[_0x9dc5('0x2d')](_0x5decd9);}else if(_0x487fdd){return!![];}return![];}; \ No newline at end of file -- 1.7.1